Built motion from commit (unavailable).|2.2.4 2.2.4
authorAndrea Bianco <andrea.bianco@xcally.com>
Tue, 13 Aug 2019 17:14:18 +0000 (19:14 +0200)
committerAndrea Bianco <andrea.bianco@xcally.com>
Tue, 13 Aug 2019 17:14:18 +0000 (19:14 +0200)
1026 files changed:
apidoc/api_project.js
apidoc/api_project.json
package.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/license/service.js
server/components/parsers/qs.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/index.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/index.js
server/files/chat/iframe.js
server/migrations/2.2.4.js [new file with mode: 0644]
server/mysqldb/index.js
server/routes.js
server/rpc/index.js
server/services/agi/channel.js
server/services/agi/error.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/action.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js
snippet/1.0.11/assets/images/avatars/agent0.png [moved from snippet/1.0.10/assets/images/avatars/agent0.png with 100% similarity]
snippet/1.0.11/assets/images/avatars/customer0.png [moved from snippet/1.0.10/assets/images/avatars/customer0.png with 100% similarity]
snippet/1.0.11/assets/images/avatars/robot0.png [moved from snippet/1.0.10/assets/images/avatars/robot0.png with 100% similarity]
snippet/1.0.11/assets/images/logos/whisker_32x32.png [moved from snippet/1.0.10/assets/images/logos/whisker_32x32.png with 100% similarity]
snippet/1.0.11/fonts/materialdesignicons-webfont.eot [moved from snippet/1.0.10/fonts/materialdesignicons-webfont.eot with 100% similarity]
snippet/1.0.11/fonts/materialdesignicons-webfont.svg [moved from snippet/1.0.10/fonts/materialdesignicons-webfont.svg with 100% similarity]
snippet/1.0.11/fonts/materialdesignicons-webfont.ttf [moved from snippet/1.0.10/fonts/materialdesignicons-webfont.ttf with 100% similarity]
snippet/1.0.11/fonts/materialdesignicons-webfont.woff [moved from snippet/1.0.10/fonts/materialdesignicons-webfont.woff with 100% similarity]
snippet/1.0.11/fonts/materialdesignicons-webfont.woff2 [moved from snippet/1.0.10/fonts/materialdesignicons-webfont.woff2 with 100% similarity]
snippet/1.0.11/index.html [moved from snippet/1.0.10/index.html with 96% similarity]
snippet/1.0.11/scripts/app.js [moved from snippet/1.0.10/scripts/app.js with 92% similarity]
snippet/1.0.11/scripts/vendor.js [moved from snippet/1.0.10/scripts/vendor.js with 85% similarity]
snippet/1.0.11/styles/app.css [moved from snippet/1.0.10/styles/app.css with 100% similarity]
snippet/1.0.11/styles/vendor.css [moved from snippet/1.0.10/styles/vendor.css with 83% similarity]

index eb00a7f..ee0ba95 100644 (file)
@@ -1 +1 @@
-define({\r  "name": "xCALLY Motion API",\r  "version": "2.2.3",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-08-09T15:58:58.045Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r});
+define({\r  "name": "xCALLY Motion API",\r  "version": "2.2.4",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-08-13T17:08:59.692Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r});
index 4f0a2f0..11b9848 100644 (file)
@@ -1 +1 @@
-{\r  "name": "xCALLY Motion API",\r  "version": "2.2.3",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-08-09T15:58:58.045Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r}
+{\r  "name": "xCALLY Motion API",\r  "version": "2.2.4",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre><code class=\"language-sh\">GET /api/users\n</code></pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre><code class=\"language-sh\">https://motion.xcally.com/api/users\n</code></pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre><code class=\"language-sh\">GET  /api/users/{id}\n</code></pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or a xCALLY API token.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</code></pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre><code class=\"language-sh\">curl -H &quot;Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo&quot; https://motion.xcally.com/api/users\n</code></pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2019-08-13T17:08:59.692Z",\r    "url": "http://apidocjs.com",\r    "version": "0.17.7"\r  }\r}
index ae8772f..1222cac 100644 (file)
@@ -1,6 +1,6 @@
 {
     "name": "motion",
-    "version": "2.2.3",
+    "version": "2.2.4",
     "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
     "main": "server/app.js",
     "engines": {
index 35eee8e..e7995c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot'];(function(_0x3628e7,_0x2c305e){var _0x218c3c=function(_0x213406){while(--_0x213406){_0x3628e7['push'](_0x3628e7['shift']());}};_0x218c3c(++_0x2c305e);}(_0xeda8,0x104));var _0x8eda=function(_0x5e9dee,_0xeaba15){_0x5e9dee=_0x5e9dee-0x0;var _0x2b15ff=_0xeda8[_0x5e9dee];return _0x2b15ff;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x12899a){return this[_0x8eda('0x2')](_0x8eda('0x3'));}},'action':{'type':Sequelize[_0x8eda('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8eda('0x5'),_0x8eda('0x6'),_0x8eda('0x7'),_0x8eda('0x8'),_0x8eda('0x9'),_0x8eda('0xa'),_0x8eda('0xb')]],'msg':_0x8eda('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot'},'data1':{'type':Sequelize[_0x8eda('0x4')](0x1000),'comment':_0x8eda('0xd')},'data2':{'type':Sequelize[_0x8eda('0x4')](0x1000),'comment':_0x8eda('0xe')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x8eda('0x4')]},'data7':{'type':Sequelize[_0x8eda('0xf')]}};
\ No newline at end of file
+var _0x46ed=['sequelize','exports','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x46ed,0x168));var _0xd46e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x46ed[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x392bc1){return this[_0xd46e('0x2')](_0xd46e('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xd46e('0x4'),_0xd46e('0x5'),'motionbar',_0xd46e('0x6'),_0xd46e('0x7'),_0xd46e('0x8'),_0xd46e('0x9')]],'msg':_0xd46e('0xa')}},'comment':_0xd46e('0xa')},'data1':{'type':Sequelize[_0xd46e('0xb')](0x1000),'comment':_0xd46e('0xc')},'data2':{'type':Sequelize[_0xd46e('0xb')](0x1000),'comment':_0xd46e('0xd')},'data3':{'type':Sequelize[_0xd46e('0xb')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0xd46e('0xb')](0x1000)},'data5':{'type':Sequelize[_0xd46e('0xb')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xd46e('0xe')]}};
\ No newline at end of file
index 43a28aa..844dc5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f50=['catch','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','body','find','Action'];(function(_0x3bab53,_0x46230f){var _0x1a969e=function(_0x15ecb1){while(--_0x15ecb1){_0x3bab53['push'](_0x3bab53['shift']());}};_0x1a969e(++_0x46230f);}(_0x9f50,0x115));var _0x09f5=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0x9f50[_0x49f67f];return _0x4779a1;};'use strict';var pdf=require(_0x09f5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x09f5('0x1'));var jsonpatch=require(_0x09f5('0x2'));var rp=require(_0x09f5('0x3'));var moment=require(_0x09f5('0x4'));var BPromise=require(_0x09f5('0x5'));var Mustache=require(_0x09f5('0x6'));var util=require(_0x09f5('0x7'));var path=require(_0x09f5('0x8'));var sox=require(_0x09f5('0x9'));var csv=require(_0x09f5('0xa'));var ejs=require(_0x09f5('0xb'));var fs=require('fs');var _=require(_0x09f5('0xc'));var squel=require('squel');var crypto=require(_0x09f5('0xd'));var jsforce=require(_0x09f5('0xe'));var deskjs=require(_0x09f5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x09f5('0x10'));var Redis=require(_0x09f5('0x11'));var qs=require(_0x09f5('0x12'));var logger=require(_0x09f5('0x13'))(_0x09f5('0x14'));var utils=require(_0x09f5('0x15'));var config=require(_0x09f5('0x16'));var db=require(_0x09f5('0x17'))['db'];function respondWithStatusCode(_0x404ad7,_0x396a6c){_0x396a6c=_0x396a6c||0xcc;return function(_0x40678b){if(_0x40678b){return _0x404ad7['sendStatus'](_0x396a6c);}return _0x404ad7[_0x09f5('0x18')](_0x396a6c)[_0x09f5('0x19')]();};}function respondWithResult(_0x59447d,_0x4cb9e5){_0x4cb9e5=_0x4cb9e5||0xc8;return function(_0x47fd78){if(_0x47fd78){return _0x59447d[_0x09f5('0x18')](_0x4cb9e5)[_0x09f5('0x1a')](_0x47fd78);}};}function respondWithFilteredResult(_0x2700ef,_0x58d282){return function(_0x29a7c1){if(_0x29a7c1){var _0x54a1d9=_0x29a7c1[_0x09f5('0x1b')],_0x97b3ee=_0x58d282['offset'],_0x10aaf7=_0x58d282[_0x09f5('0x1c')]+_0x58d282[_0x09f5('0x1d')],_0x30ea2a;if(_0x10aaf7>=_0x54a1d9){_0x10aaf7=_0x54a1d9;_0x30ea2a=0xc8;}else{_0x30ea2a=0xce;}_0x2700ef[_0x09f5('0x18')](_0x30ea2a);return _0x2700ef[_0x09f5('0x1e')](_0x09f5('0x1f'),_0x97b3ee+'-'+_0x10aaf7+'/'+_0x54a1d9)[_0x09f5('0x1a')](_0x29a7c1);}return null;};}function patchUpdates(_0x2116fb){return function(_0x51ac79){try{jsonpatch[_0x09f5('0x20')](_0x51ac79,_0x2116fb,!![]);}catch(_0x517821){return BPromise[_0x09f5('0x21')](_0x517821);}return _0x51ac79[_0x09f5('0x22')]();};}function saveUpdates(_0x382ea3,_0x5b782e){return function(_0x5a49cf){if(_0x5a49cf){return _0x5a49cf[_0x09f5('0x23')](_0x382ea3)['then'](function(_0x57c1e7){return _0x57c1e7;});}return null;};}function removeEntity(_0x4b8645,_0x4001f0){return function(_0x4c58b8){if(_0x4c58b8){return _0x4c58b8[_0x09f5('0x24')]()[_0x09f5('0x25')](function(){_0x4b8645[_0x09f5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502e25,_0x58a3c8){return function(_0x2ee470){if(!_0x2ee470){_0x502e25['sendStatus'](0x194);}return _0x2ee470;};}function handleError(_0x5a04c4,_0x1f2f30){_0x1f2f30=_0x1f2f30||0x1f4;return function(_0x306189){logger[_0x09f5('0x26')](_0x306189[_0x09f5('0x27')]);if(_0x306189[_0x09f5('0x28')]){delete _0x306189[_0x09f5('0x28')];}_0x5a04c4[_0x09f5('0x18')](_0x1f2f30)[_0x09f5('0x29')](_0x306189);};}exports['update']=function(_0x89d172,_0x546006){if(_0x89d172[_0x09f5('0x2a')]['id']){delete _0x89d172[_0x09f5('0x2a')]['id'];}return db['Action'][_0x09f5('0x2b')]({'where':{'id':_0x89d172['params']['id']}})[_0x09f5('0x25')](handleEntityNotFound(_0x546006,null))[_0x09f5('0x25')](saveUpdates(_0x89d172[_0x09f5('0x2a')],null))['then'](respondWithResult(_0x546006,null))['catch'](handleError(_0x546006,null));};exports[_0x09f5('0x24')]=function(_0x4887f9,_0x2e4ac2){return db[_0x09f5('0x2c')]['find']({'where':{'id':_0x4887f9['params']['id']}})['then'](handleEntityNotFound(_0x2e4ac2,null))[_0x09f5('0x25')](removeEntity(_0x2e4ac2,null))[_0x09f5('0x2d')](handleError(_0x2e4ac2,null));};
\ No newline at end of file
+var _0xa432=['end','json','count','offset','limit','status','apply','reject','save','destroy','then','error','stack','name','Action','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0xa432,0x1a1));var _0x2a43=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xa432[_0x1e7b16];return _0x37fadc;};'use strict';var pdf=require(_0x2a43('0x0'));var emlformat=require(_0x2a43('0x1'));var rimraf=require(_0x2a43('0x2'));var zipdir=require(_0x2a43('0x3'));var jsonpatch=require(_0x2a43('0x4'));var rp=require(_0x2a43('0x5'));var moment=require(_0x2a43('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2a43('0x7'));var util=require(_0x2a43('0x8'));var path=require(_0x2a43('0x9'));var sox=require(_0x2a43('0xa'));var csv=require(_0x2a43('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2a43('0xc'));var squel=require(_0x2a43('0xd'));var crypto=require(_0x2a43('0xe'));var jsforce=require(_0x2a43('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2a43('0xb'));var querystring=require(_0x2a43('0x10'));var Papa=require(_0x2a43('0x11'));var Redis=require('ioredis');var qs=require(_0x2a43('0x12'));var logger=require('../../config/logger')(_0x2a43('0x13'));var utils=require(_0x2a43('0x14'));var config=require('../../config/environment');var db=require(_0x2a43('0x15'))['db'];function respondWithStatusCode(_0x2b6bbb,_0x5abf26){_0x5abf26=_0x5abf26||0xcc;return function(_0x15c209){if(_0x15c209){return _0x2b6bbb[_0x2a43('0x16')](_0x5abf26);}return _0x2b6bbb['status'](_0x5abf26)[_0x2a43('0x17')]();};}function respondWithResult(_0x481a32,_0x36d875){_0x36d875=_0x36d875||0xc8;return function(_0x374db0){if(_0x374db0){return _0x481a32['status'](_0x36d875)[_0x2a43('0x18')](_0x374db0);}};}function respondWithFilteredResult(_0x23f6c3,_0x5b9241){return function(_0x2e7f96){if(_0x2e7f96){var _0x50ef9d=_0x2e7f96[_0x2a43('0x19')],_0x2b4bdd=_0x5b9241['offset'],_0x18aa2f=_0x5b9241[_0x2a43('0x1a')]+_0x5b9241[_0x2a43('0x1b')],_0x598249;if(_0x18aa2f>=_0x50ef9d){_0x18aa2f=_0x50ef9d;_0x598249=0xc8;}else{_0x598249=0xce;}_0x23f6c3[_0x2a43('0x1c')](_0x598249);return _0x23f6c3['set']('Content-Range',_0x2b4bdd+'-'+_0x18aa2f+'/'+_0x50ef9d)['json'](_0x2e7f96);}return null;};}function patchUpdates(_0x1ebe86){return function(_0x535073){try{jsonpatch[_0x2a43('0x1d')](_0x535073,_0x1ebe86,!![]);}catch(_0x35e069){return BPromise[_0x2a43('0x1e')](_0x35e069);}return _0x535073[_0x2a43('0x1f')]();};}function saveUpdates(_0x136bec,_0x358aaf){return function(_0x151341){if(_0x151341){return _0x151341['update'](_0x136bec)['then'](function(_0xb98064){return _0xb98064;});}return null;};}function removeEntity(_0x329325,_0xa71950){return function(_0x4b2d21){if(_0x4b2d21){return _0x4b2d21[_0x2a43('0x20')]()[_0x2a43('0x21')](function(){_0x329325[_0x2a43('0x1c')](0xcc)[_0x2a43('0x17')]();});}};}function handleEntityNotFound(_0x3c5f85,_0x30d53d){return function(_0x39f72b){if(!_0x39f72b){_0x3c5f85[_0x2a43('0x16')](0x194);}return _0x39f72b;};}function handleError(_0x236c90,_0x228ab4){_0x228ab4=_0x228ab4||0x1f4;return function(_0x4b35b0){logger[_0x2a43('0x22')](_0x4b35b0[_0x2a43('0x23')]);if(_0x4b35b0[_0x2a43('0x24')]){delete _0x4b35b0[_0x2a43('0x24')];}_0x236c90[_0x2a43('0x1c')](_0x228ab4)['send'](_0x4b35b0);};}exports['update']=function(_0x3c9224,_0x30c470){if(_0x3c9224['body']['id']){delete _0x3c9224['body']['id'];}return db[_0x2a43('0x25')]['find']({'where':{'id':_0x3c9224[_0x2a43('0x26')]['id']}})['then'](handleEntityNotFound(_0x30c470,null))[_0x2a43('0x21')](saveUpdates(_0x3c9224['body'],null))[_0x2a43('0x21')](respondWithResult(_0x30c470,null))[_0x2a43('0x27')](handleError(_0x30c470,null));};exports['destroy']=function(_0x4bc21e,_0x56c507){return db[_0x2a43('0x25')]['find']({'where':{'id':_0x4bc21e['params']['id']}})[_0x2a43('0x21')](handleEntityNotFound(_0x56c507,null))['then'](removeEntity(_0x56c507,null))['catch'](handleError(_0x56c507,null));};
\ No newline at end of file
index 7ea1876..a32a262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffcd=['exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./action.attributes'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0xffcd,0x19c));var _0xdffc=function(_0x349200,_0x423568){_0x349200=_0x349200-0x0;var _0x4c2485=_0xffcd[_0x349200];return _0x4c2485;};'use strict';var _=require(_0xdffc('0x0'));var util=require(_0xdffc('0x1'));var logger=require(_0xdffc('0x2'))(_0xdffc('0x3'));var moment=require(_0xdffc('0x4'));var BPromise=require(_0xdffc('0x5'));var rp=require(_0xdffc('0x6'));var attributes=require(_0xdffc('0x7'));module[_0xdffc('0x8')]=function(_0x1beddd,_0x2e1d61){return _0x1beddd[_0xdffc('0x9')](_0xdffc('0xa'),attributes,{'tableName':_0xdffc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc47e=['define','Action','lodash','util','../../config/logger','moment','bluebird','./action.attributes','exports'];(function(_0x3b59b1,_0x4eec8a){var _0x3c97a7=function(_0x3ccfec){while(--_0x3ccfec){_0x3b59b1['push'](_0x3b59b1['shift']());}};_0x3c97a7(++_0x4eec8a);}(_0xc47e,0x1bb));var _0xec47=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0xc47e[_0x54fbff];return _0x5cf619;};'use strict';var _=require(_0xec47('0x0'));var util=require(_0xec47('0x1'));var logger=require(_0xec47('0x2'))('api');var moment=require(_0xec47('0x3'));var BPromise=require(_0xec47('0x4'));var rp=require('request-promise');var attributes=require(_0xec47('0x5'));module[_0xec47('0x6')]=function(_0x589335,_0x2c80a2){return _0x589335[_0xec47('0x7')](_0xec47('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b563c3a..5acddda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb38e=['Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x477d84,_0x3d5e14){var _0x4b273a=function(_0x17cb4b){while(--_0x17cb4b){_0x477d84['push'](_0x477d84['shift']());}};_0x4b273a(++_0x3d5e14);}(_0xb38e,0xa7));var _0xeb38=function(_0x48a3c6,_0x2575d1){_0x48a3c6=_0x48a3c6-0x0;var _0x5f342d=_0xb38e[_0x48a3c6];return _0x5f342d;};'use strict';var _=require(_0xeb38('0x0'));var util=require(_0xeb38('0x1'));var moment=require(_0xeb38('0x2'));var BPromise=require(_0xeb38('0x3'));var rs=require(_0xeb38('0x4'));var fs=require('fs');var Redis=require(_0xeb38('0x5'));var db=require(_0xeb38('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb38('0x7'))(_0xeb38('0x8'));var config=require('../../config/environment');var jayson=require(_0xeb38('0x9'));var client=jayson[_0xeb38('0xa')][_0xeb38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31db8c,_0x4cfa4d,_0x3003aa){return new BPromise(function(_0x196580,_0x3b2df7){return client[_0xeb38('0xc')](_0x31db8c,_0x3003aa)['then'](function(_0x2b0c8b){logger[_0xeb38('0xd')](_0xeb38('0xe'),_0x4cfa4d,_0xeb38('0xf'));logger[_0xeb38('0x10')](_0xeb38('0x11'),_0x4cfa4d,_0xeb38('0xf'),JSON['stringify'](_0x2b0c8b));if(_0x2b0c8b[_0xeb38('0x12')]){if(_0x2b0c8b['error'][_0xeb38('0x13')]===0x1f4){logger[_0xeb38('0x12')]('Action,\x20%s,\x20%s',_0x4cfa4d,_0x2b0c8b[_0xeb38('0x12')][_0xeb38('0x14')]);return _0x3b2df7(_0x2b0c8b[_0xeb38('0x12')][_0xeb38('0x14')]);}logger[_0xeb38('0x12')](_0xeb38('0xe'),_0x4cfa4d,_0x2b0c8b['error'][_0xeb38('0x14')]);return _0x196580(_0x2b0c8b[_0xeb38('0x12')][_0xeb38('0x14')]);}else{logger[_0xeb38('0xd')](_0xeb38('0xe'),_0x4cfa4d,_0xeb38('0xf'));_0x196580(_0x2b0c8b[_0xeb38('0x15')]['message']);}})[_0xeb38('0x16')](function(_0x980c8){logger[_0xeb38('0x12')]('Action,\x20%s,\x20%s',_0x4cfa4d,_0x980c8);_0x3b2df7(_0x980c8);});});}
\ No newline at end of file
+var _0xd6ce=['info','Action,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x44b5fa,_0x3bcfee){var _0x1a7b53=function(_0x47a9fc){while(--_0x47a9fc){_0x44b5fa['push'](_0x44b5fa['shift']());}};_0x1a7b53(++_0x3bcfee);}(_0xd6ce,0x127));var _0xed6c=function(_0x327d2e,_0x5dd298){_0x327d2e=_0x327d2e-0x0;var _0x219044=_0xd6ce[_0x327d2e];return _0x219044;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var moment=require(_0xed6c('0x2'));var BPromise=require(_0xed6c('0x3'));var rs=require(_0xed6c('0x4'));var fs=require('fs');var Redis=require(_0xed6c('0x5'));var db=require(_0xed6c('0x6'))['db'];var utils=require(_0xed6c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xed6c('0x8'));var jayson=require(_0xed6c('0x9'));var client=jayson[_0xed6c('0xa')][_0xed6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a6546,_0x5e0e3a,_0x7668a7){return new BPromise(function(_0x46e2c4,_0x4fd673){return client['request'](_0x4a6546,_0x7668a7)[_0xed6c('0xc')](function(_0xc996c4){logger[_0xed6c('0xd')](_0xed6c('0xe'),_0x5e0e3a,'request\x20sent');logger['debug']('Action,\x20%s,\x20%s,\x20%s',_0x5e0e3a,'request\x20sent',JSON[_0xed6c('0xf')](_0xc996c4));if(_0xc996c4['error']){if(_0xc996c4['error'][_0xed6c('0x10')]===0x1f4){logger[_0xed6c('0x11')]('Action,\x20%s,\x20%s',_0x5e0e3a,_0xc996c4[_0xed6c('0x11')]['message']);return _0x4fd673(_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);}logger['error'](_0xed6c('0xe'),_0x5e0e3a,_0xc996c4[_0xed6c('0x11')][_0xed6c('0x12')]);return _0x46e2c4(_0xc996c4[_0xed6c('0x11')]['message']);}else{logger['info'](_0xed6c('0xe'),_0x5e0e3a,_0xed6c('0x13'));_0x46e2c4(_0xc996c4[_0xed6c('0x14')]['message']);}})[_0xed6c('0x15')](function(_0x526c54){logger[_0xed6c('0x11')](_0xed6c('0xe'),_0x5e0e3a,_0x526c54);_0x4fd673(_0x526c54);});});}
\ No newline at end of file
index 39a1a52..841dfad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcecc=['/:id','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0xcecc,0x186));var _0xccec=function(_0x2eb2bb,_0x57332a){_0x2eb2bb=_0x2eb2bb-0x0;var _0x4c8909=_0xcecc[_0x2eb2bb];return _0x4c8909;};'use strict';var multer=require(_0xccec('0x0'));var util=require('util');var path=require(_0xccec('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xccec('0x2')]();var auth=require(_0xccec('0x3'));var interaction=require(_0xccec('0x4'));var config=require(_0xccec('0x5'));var controller=require('./action.controller');router['put'](_0xccec('0x6'),auth['isAuthenticated'](),controller[_0xccec('0x7')]);router[_0xccec('0x8')](_0xccec('0x6'),auth['isAuthenticated'](),controller[_0xccec('0x9')]);module[_0xccec('0xa')]=router;
\ No newline at end of file
+var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./action.controller','put','update','delete','/:id','destroy'];(function(_0x431c98,_0x4d8039){var _0x1081a2=function(_0x898108){while(--_0x898108){_0x431c98['push'](_0x431c98['shift']());}};_0x1081a2(++_0x4d8039);}(_0xb7e7,0x121));var _0x7b7e=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb7e7[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);module[_0x7b7e('0xb')]=router;
\ No newline at end of file
index 6bdacff..044258a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce40=['sequelize','STRING','TEXT'];(function(_0x25b00d,_0x482daf){var _0x5bb873=function(_0x53f359){while(--_0x53f359){_0x25b00d['push'](_0x25b00d['shift']());}};_0x5bb873(++_0x482daf);}(_0xce40,0x15f));var _0x0ce4=function(_0x4f8d61,_0x29eff0){_0x4f8d61=_0x4f8d61-0x0;var _0x3bc078=_0xce40[_0x4f8d61];return _0x3bc078;};'use strict';var Sequelize=require(_0x0ce4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x0ce4('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x0ce4('0x2')]}};
\ No newline at end of file
+var _0x36b7=['exports','STRING','TEXT','sequelize'];(function(_0x416f93,_0x29df20){var _0x51430c=function(_0x271df0){while(--_0x271df0){_0x416f93['push'](_0x416f93['shift']());}};_0x51430c(++_0x29df20);}(_0x36b7,0x1a7));var _0x736b=function(_0x290b74,_0x4186b7){_0x290b74=_0x290b74-0x0;var _0x2cd1b0=_0x36b7[_0x290b74];return _0x2cd1b0;};'use strict';var Sequelize=require(_0x736b('0x0'));module[_0x736b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x736b('0x2')]},'parent':{'type':Sequelize[_0x736b('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x736b('0x3')]},'joins':{'type':Sequelize[_0x736b('0x3')]}};
\ No newline at end of file
index 5f49a49..5e364c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['day','merge','filter','map','type','key','VIRTUAL','field','options','findAll','rows','show','intersection','includeAll','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','find','params','join','outer_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parse','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','right_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','No\x20available\x20data','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','COUNT(%s)','groupBy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','destroy','get','CustomReports','error','name','send','index','AnalyticCustomReport','rawAttributes','keys','query','dateStart','dateEnd','filters','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','pick','add'];(function(_0xf2f76c,_0xbb16ed){var _0x518dfd=function(_0x4fe247){while(--_0x4fe247){_0xf2f76c['push'](_0xf2f76c['shift']());}};_0x518dfd(++_0xbb16ed);}(_0x7a54,0x106));var _0x47a5=function(_0x13fdc6,_0x536940){_0x13fdc6=_0x13fdc6-0x0;var _0x557255=_0x7a54[_0x13fdc6];return _0x557255;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var qs=require(_0x47a5('0xf'));var logger=require('../../config/logger')(_0x47a5('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x47a5('0x11'))['db'];function respondWithStatusCode(_0x69e4d4,_0x2f399b){_0x2f399b=_0x2f399b||0xcc;return function(_0x250fad){if(_0x250fad){return _0x69e4d4[_0x47a5('0x12')](_0x2f399b);}return _0x69e4d4[_0x47a5('0x13')](_0x2f399b)[_0x47a5('0x14')]();};}function respondWithResult(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xc8;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x13')](_0x44bd3e)[_0x47a5('0x15')](_0x221b54);}};}function respondWithFilteredResult(_0x139f25,_0x620ee9){return function(_0x3c6c46){if(_0x3c6c46){var _0x190faa=_0x3c6c46[_0x47a5('0x16')],_0x4e99a8=_0x620ee9[_0x47a5('0x17')],_0x362359=_0x620ee9[_0x47a5('0x17')]+_0x620ee9['limit'],_0x11faf5;if(_0x362359>=_0x190faa){_0x362359=_0x190faa;_0x11faf5=0xc8;}else{_0x11faf5=0xce;}_0x139f25['status'](_0x11faf5);return _0x139f25[_0x47a5('0x18')]('Content-Range',_0x4e99a8+'-'+_0x362359+'/'+_0x190faa)['json'](_0x3c6c46);}return null;};}function patchUpdates(_0x423a81){return function(_0xaf70a6){try{jsonpatch[_0x47a5('0x19')](_0xaf70a6,_0x423a81,!![]);}catch(_0x1ef371){return BPromise[_0x47a5('0x1a')](_0x1ef371);}return _0xaf70a6[_0x47a5('0x1b')]();};}function saveUpdates(_0x2763d6,_0xe3c618){return function(_0x3aed38){if(_0x3aed38){return _0x3aed38['update'](_0x2763d6)[_0x47a5('0x1c')](function(_0xf160ba){return _0xf160ba;});}return null;};}function removeEntity(_0x47cf3c,_0x2b0360){return function(_0x1f03f7){if(_0x1f03f7){return _0x1f03f7[_0x47a5('0x1d')]()['then'](function(){var _0xb8ae6c=_0x1f03f7[_0x47a5('0x1e')]({'plain':!![]});var _0x23db32=_0x47a5('0x1f');return db['UserProfileResource'][_0x47a5('0x1d')]({'where':{'type':_0x23db32,'resourceId':_0xb8ae6c['id']}})[_0x47a5('0x1c')](function(){return _0x1f03f7;});})['then'](function(){_0x47cf3c[_0x47a5('0x13')](0xcc)[_0x47a5('0x14')]();});}};}function handleEntityNotFound(_0x4437f1,_0x129ce5){return function(_0x3abd6a){if(!_0x3abd6a){_0x4437f1['sendStatus'](0x194);}return _0x3abd6a;};}function handleError(_0x53078a,_0x136745){_0x136745=_0x136745||0x1f4;return function(_0x5686db){logger[_0x47a5('0x20')](_0x5686db['stack']);if(_0x5686db[_0x47a5('0x21')]){delete _0x5686db[_0x47a5('0x21')];}_0x53078a[_0x47a5('0x13')](_0x136745)[_0x47a5('0x22')](_0x5686db);};}exports[_0x47a5('0x23')]=function(_0x3ba0b7,_0x24b162){var _0x136b14={},_0x16631f={},_0x361bfa={'count':0x0,'rows':[]};var _0x1127f8=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x16631f['model']=_[_0x47a5('0x26')](_0x1127f8);var _0x51833b={'dateStart':_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x28')],'dateEnd':_0x3ba0b7[_0x47a5('0x27')]['dateEnd']};delete _0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x28')];delete _0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x29')];_0x16631f['query']=_['keys'](_0x3ba0b7[_0x47a5('0x27')]);_0x16631f[_0x47a5('0x2a')]=_['intersection'](_0x16631f['model'],_0x16631f[_0x47a5('0x27')]);_0x136b14[_0x47a5('0x2b')]=_['intersection'](_0x16631f[_0x47a5('0x2c')],qs['fields'](_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x2d')]));_0x136b14['attributes']=_0x136b14['attributes'][_0x47a5('0x2e')]?_0x136b14['attributes']:_0x16631f[_0x47a5('0x2c')];if(!_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x2f')]('nolimit')){_0x136b14[_0x47a5('0x30')]=qs['limit'](_0x3ba0b7['query'][_0x47a5('0x30')]);_0x136b14['offset']=qs[_0x47a5('0x17')](_0x3ba0b7['query'][_0x47a5('0x17')]);}_0x136b14[_0x47a5('0x31')]=qs[_0x47a5('0x32')](_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x32')]);_0x136b14[_0x47a5('0x33')]=qs[_0x47a5('0x2a')](_[_0x47a5('0x34')](_0x3ba0b7[_0x47a5('0x27')],_0x16631f['filters']));if(_0x51833b[_0x47a5('0x28')]){if(_0x51833b[_0x47a5('0x29')]){_0x51833b['dateEnd']=moment(_0x51833b[_0x47a5('0x29')])[_0x47a5('0x35')](0x1,_0x47a5('0x36'));}else{_0x51833b['dateEnd']=moment(_0x51833b[_0x47a5('0x28')])[_0x47a5('0x35')](0x1,'day');}_[_0x47a5('0x37')](_0x136b14[_0x47a5('0x33')],{'createdAt':{'$gte':_0x51833b['dateStart'],'$lte':_0x51833b['dateEnd']}});}if(_0x3ba0b7['query'][_0x47a5('0x38')]){_0x136b14['where']=_[_0x47a5('0x37')](_0x136b14[_0x47a5('0x33')],{'$or':_[_0x47a5('0x39')](_0x1127f8,function(_0x111f0d){if(_0x111f0d[_0x47a5('0x3a')][_0x47a5('0x3b')]!==_0x47a5('0x3c')){var _0x1f3d01={};_0x1f3d01[_0x111f0d[_0x47a5('0x3d')]]={'$like':'%'+_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x38')]+'%'};return _0x1f3d01;}})});}_0x136b14=_[_0x47a5('0x37')]({},_0x136b14,_0x3ba0b7[_0x47a5('0x3e')]);var _0x56dbbd={'where':_0x136b14[_0x47a5('0x33')]};return db[_0x47a5('0x24')][_0x47a5('0x16')](_0x56dbbd)[_0x47a5('0x1c')](function(_0x586f4f){_0x361bfa[_0x47a5('0x16')]=_0x586f4f;if(_0x3ba0b7['query']['includeAll']){_0x136b14['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x47a5('0x3f')](_0x136b14);})['then'](function(_0x2bb502){_0x361bfa[_0x47a5('0x40')]=_0x2bb502;return _0x361bfa;})[_0x47a5('0x1c')](respondWithFilteredResult(_0x24b162,_0x136b14))['catch'](handleError(_0x24b162,null));};exports[_0x47a5('0x41')]=function(_0x20c5bc,_0x586747){var _0x483650={'raw':![],'where':{'id':_0x20c5bc['params']['id']}},_0xbe21d9={};_0xbe21d9[_0x47a5('0x2c')]=_[_0x47a5('0x26')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0xbe21d9[_0x47a5('0x27')]=_[_0x47a5('0x26')](_0x20c5bc[_0x47a5('0x27')]);_0xbe21d9[_0x47a5('0x2a')]=_[_0x47a5('0x42')](_0xbe21d9[_0x47a5('0x2c')],_0xbe21d9[_0x47a5('0x27')]);_0x483650[_0x47a5('0x2b')]=_[_0x47a5('0x42')](_0xbe21d9[_0x47a5('0x2c')],qs[_0x47a5('0x2d')](_0x20c5bc[_0x47a5('0x27')]['fields']));_0x483650[_0x47a5('0x2b')]=_0x483650[_0x47a5('0x2b')]['length']?_0x483650['attributes']:_0xbe21d9[_0x47a5('0x2c')];if(_0x20c5bc['query'][_0x47a5('0x43')]){_0x483650[_0x47a5('0x44')]=[{'all':!![]}];}_0x483650=_['merge']({},_0x483650,_0x20c5bc['options']);return db[_0x47a5('0x24')]['find'](_0x483650)[_0x47a5('0x1c')](handleEntityNotFound(_0x586747,null))[_0x47a5('0x1c')](respondWithResult(_0x586747,null))[_0x47a5('0x45')](handleError(_0x586747,null));};exports[_0x47a5('0x46')]=function(_0x44fe8a,_0x26acd2){return db[_0x47a5('0x24')]['create'](_0x44fe8a['body'],{})[_0x47a5('0x1c')](function(_0x411230){var _0x1163e3=_0x44fe8a[_0x47a5('0x47')][_0x47a5('0x1e')]({'plain':!![]});if(!_0x1163e3)throw new Error(_0x47a5('0x48'));if(_0x1163e3[_0x47a5('0x49')]==='user'){var _0x45cca5=_0x411230[_0x47a5('0x1e')]({'plain':!![]});var _0x5f6a='Reports';return db[_0x47a5('0x4a')]['find']({'where':{'name':_0x5f6a,'userProfileId':_0x1163e3[_0x47a5('0x4b')]},'raw':!![]})[_0x47a5('0x1c')](function(_0x46e90b){if(_0x46e90b&&_0x46e90b[_0x47a5('0x4c')]===0x0){return db['UserProfileResource'][_0x47a5('0x46')]({'name':_0x45cca5[_0x47a5('0x21')],'resourceId':_0x45cca5['id'],'type':_0x47a5('0x1f'),'sectionId':_0x46e90b['id']},{})[_0x47a5('0x1c')](function(){return _0x411230;});}else{return _0x411230;}})[_0x47a5('0x45')](function(_0x6a53b3){logger[_0x47a5('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6a53b3);throw _0x6a53b3;});}return _0x411230;})[_0x47a5('0x1c')](respondWithResult(_0x26acd2,0xc9))[_0x47a5('0x45')](handleError(_0x26acd2,null));};exports[_0x47a5('0x4d')]=function(_0x8da9fb,_0x3329aa){if(_0x8da9fb[_0x47a5('0x4e')]['id']){delete _0x8da9fb['body']['id'];}return db[_0x47a5('0x24')][_0x47a5('0x4f')]({'where':{'id':_0x8da9fb[_0x47a5('0x50')]['id']}})['then'](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x1c')](saveUpdates(_0x8da9fb[_0x47a5('0x4e')],null))[_0x47a5('0x1c')](respondWithResult(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports['destroy']=function(_0x274e38,_0x376e1d){return db['AnalyticCustomReport']['find']({'where':{'id':_0x274e38[_0x47a5('0x50')]['id']}})['then'](handleEntityNotFound(_0x376e1d,null))[_0x47a5('0x1c')](removeEntity(_0x376e1d,null))['catch'](handleError(_0x376e1d,null));};exports['preview']=function(_0x389ed9,_0x46d2d3){var _0x53eedf=0xa;var _0x1b958b=[_0x47a5('0x51'),'left_join','right_join',_0x47a5('0x52'),_0x47a5('0x53')];var _0x867da0={'SUM':_0x47a5('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x55'),'MAX':_0x47a5('0x56'),'MIN':_0x47a5('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x47a5('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x47a5('0x59')};var _0x470da6={'SEC_TO_TIME':_0x47a5('0x5a'),'DATE':_0x47a5('0x5b'),'HOUR':_0x47a5('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x47a5('0x5d')};var _0x5d1550=function(_0x5cbe97){return!_['includes'](['IS\x20NULL',_0x47a5('0x5e'),_0x47a5('0x5f'),_0x47a5('0x60')],_0x5cbe97);};var _0x52e3ee=function(_0x4d3db1){if(!_0x4d3db1||!_0x4d3db1[_0x47a5('0x61')][_0x47a5('0x2e')]){return'';}for(var _0x45d4b6='(',_0x3c2b46=0x0;_0x3c2b46<_0x4d3db1[_0x47a5('0x61')]['length'];_0x3c2b46+=0x1){_0x3c2b46>0x0&&(_0x45d4b6+='\x20'+_0x4d3db1[_0x47a5('0x62')]+'\x20');_0x45d4b6+=_0x4d3db1['rules'][_0x3c2b46][_0x47a5('0x63')]?_0x52e3ee(_0x4d3db1[_0x47a5('0x61')][_0x3c2b46]['group']):_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x3d')]+'\x20'+_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x64')]+(_0x5d1550(_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x64')])?'\x20'+_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x65')]:'');}return _0x45d4b6+')';};var _0x57ed0a={'where':{'id':_0x389ed9['params']['id']}},_0x2dcc3b,_0x2a3a57,_0x3c75c6,_0x26e7fc,_0x396cb0;_0x57ed0a=_[_0x47a5('0x37')]({},_0x57ed0a,_0x389ed9[_0x47a5('0x3e')]);return db[_0x47a5('0x24')][_0x47a5('0x4f')](_0x57ed0a)[_0x47a5('0x1c')](function(_0x168329){if(_0x168329){_0x2dcc3b=_0x168329;return _0x168329[_0x47a5('0x66')]();}return null;})[_0x47a5('0x1c')](function(_0x350af8){if(_0x350af8){if(!_0x350af8[_0x47a5('0x2e')]){throw new db[(_0x47a5('0x67'))][(_0x47a5('0x68'))](_0x47a5('0x69'),0x193);}_0x2a3a57=_0x350af8;return db[_0x47a5('0x6a')][_0x47a5('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x42dd7d){if(_0x42dd7d){_0x3c75c6=_[_0x47a5('0x6b')](_0x42dd7d,'id');var _0x30504e;var _0x4b42f3=squel[_0x47a5('0x6c')]();_0x4b42f3[_0x47a5('0x6d')](_0x2dcc3b[_0x47a5('0x6e')]);for(var _0x26f1ac=0x0;_0x26f1ac<_0x2a3a57['length'];_0x26f1ac+=0x1){_0x30504e=_0x2a3a57[_0x26f1ac][_0x47a5('0x6f')]?_0x3c75c6[_0x2a3a57[_0x26f1ac]['MetricId']][_0x47a5('0x70')]:_0x2a3a57[_0x26f1ac]['field'];_0x30504e=_0x2a3a57[_0x26f1ac][_0x47a5('0x71')]?_['replace'](_0x867da0[_0x2a3a57[_0x26f1ac][_0x47a5('0x71')]],'%s',_0x30504e):_0x30504e;_0x30504e=_0x2a3a57[_0x26f1ac][_0x47a5('0x72')]?_[_0x47a5('0x73')](_0x470da6[_0x2a3a57[_0x26f1ac]['format']],'%s',_0x30504e):_0x30504e;if(_0x2a3a57[_0x26f1ac]['groupBy']){_0x4b42f3['group'](_0x30504e);}_0x2a3a57[_0x26f1ac][_0x47a5('0x74')]&&_0x4b42f3[_0x47a5('0x31')](_0x30504e,_0x2a3a57[_0x26f1ac][_0x47a5('0x74')]===_0x47a5('0x75')?![]:!![]);_0x4b42f3['field'](_0x30504e,_0x2a3a57[_0x26f1ac][_0x47a5('0x76')]||_0x30504e);}if(_0x2dcc3b[_0x47a5('0x77')]){_0x2dcc3b[_0x47a5('0x77')]=JSON[_0x47a5('0x78')](_0x2dcc3b[_0x47a5('0x77')]);for(var _0xb9f589=0x0;_0xb9f589<_0x2dcc3b[_0x47a5('0x77')][_0x47a5('0x2e')];_0xb9f589+=0x1){if(_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x3a')]&&_[_0x47a5('0x79')](_0x1b958b,_0x2dcc3b[_0x47a5('0x77')][_0xb9f589]['type'])&&_0x2dcc3b[_0x47a5('0x77')][_0xb9f589]['parentKey']&&_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7a')]&&_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7b')]){_0x4b42f3[_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x3a')]](_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7a')],null,util[_0x47a5('0x72')](_0x47a5('0x7c'),_0x2dcc3b[_0x47a5('0x6e')],_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7d')],_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7a')],_0x2dcc3b['joins'][_0xb9f589]['foreignKey']));}}}if(_0x2dcc3b['conditions']){_0x2dcc3b['conditions']=JSON[_0x47a5('0x78')](_0x2dcc3b[_0x47a5('0x7e')]);_0x4b42f3['where'](_0x52e3ee(_0x2dcc3b[_0x47a5('0x7e')][_0x47a5('0x63')]));}_0x396cb0=_0x4b42f3[_0x47a5('0x7f')]();_0x4b42f3[_0x47a5('0x30')](_0x53eedf);_0x4b42f3[_0x47a5('0x17')](0x0);logger[_0x47a5('0x80')](_0x47a5('0x81'),_0x4b42f3[_0x47a5('0x82')]());return db[_0x47a5('0x83')][_0x47a5('0x27')](_0x4b42f3[_0x47a5('0x82')](),{'type':db['sequelize'][_0x47a5('0x84')][_0x47a5('0x85')]});}})[_0x47a5('0x1c')](respondWithResult(_0x46d2d3,null))['catch'](handleError(_0x46d2d3,null));};function runReport(_0x340846,_0x32f393,_0x17b61d){var _0x5d41d8=_0x32f393[_0x47a5('0x21')];var _0x5205ba=0xa;var _0x49d93d=[_0x47a5('0x51'),_0x47a5('0x86'),_0x47a5('0x87'),_0x47a5('0x52'),_0x47a5('0x53')];var _0xea50f3={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x55'),'MAX':'MAX(%s)','MIN':_0x47a5('0x57'),'AVG':_0x47a5('0x88'),'GROUP_CONCAT':_0x47a5('0x58'),'GROUP_CONCAT ASC':_0x47a5('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c66e3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x47a5('0x5c'),'ROUND':_0x47a5('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1926bd=function(_0x21828e){return!_[_0x47a5('0x79')](['IS\x20NULL',_0x47a5('0x5e'),'IS\x20EMPTY',_0x47a5('0x60')],_0x21828e);};var _0x219beb=function(_0x63e2e5){if(!_0x63e2e5||!_0x63e2e5['rules'][_0x47a5('0x2e')]){return'';}for(var _0x196600='(',_0x2ae38b=0x0;_0x2ae38b<_0x63e2e5['rules'][_0x47a5('0x2e')];_0x2ae38b+=0x1){_0x2ae38b>0x0&&(_0x196600+='\x20'+_0x63e2e5['operator']+'\x20');_0x196600+=_0x63e2e5[_0x47a5('0x61')][_0x2ae38b]['group']?_0x219beb(_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x63')]):_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x3d')]+'\x20'+_0x63e2e5['rules'][_0x2ae38b][_0x47a5('0x64')]+(_0x1926bd(_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x64')])?'\x20'+_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x65')]:'');}return _0x196600+')';};var _0x57ac25={'where':{'id':_0x340846['id']}},_0x56c35e,_0x569550,_0x4ab01f,_0xd6c211,_0xa8809a;_0x57ac25=_[_0x47a5('0x37')]({},_0x57ac25,_0x17b61d);return db['AnalyticCustomReport'][_0x47a5('0x4f')](_0x57ac25)[_0x47a5('0x1c')](function(_0x565fbe){if(_0x565fbe){_0x56c35e=_0x565fbe;return _0x565fbe[_0x47a5('0x66')]();}return null;})[_0x47a5('0x1c')](function(_0x19acfa){if(_0x19acfa){if(!_0x19acfa[_0x47a5('0x2e')]){throw new db['Sequelize']['ValidationErrorItem'](_0x47a5('0x69'),0x193);}_0x569550=_0x19acfa;return db[_0x47a5('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x47a5('0x1c')](function(_0x23f055){if(_0x23f055){_0x4ab01f=_['keyBy'](_0x23f055,'id');var _0x309a92;var _0x2a02cd=squel[_0x47a5('0x6c')]();_0x2a02cd['from'](_0x56c35e[_0x47a5('0x6e')]);for(var _0x59b4a5=0x0;_0x59b4a5<_0x569550[_0x47a5('0x2e')];_0x59b4a5+=0x1){_0x309a92=_0x569550[_0x59b4a5]['MetricId']?_0x4ab01f[_0x569550[_0x59b4a5][_0x47a5('0x6f')]][_0x47a5('0x70')]:_0x569550[_0x59b4a5]['field'];_0x309a92=_0x569550[_0x59b4a5][_0x47a5('0x71')]?_['replace'](_0xea50f3[_0x569550[_0x59b4a5][_0x47a5('0x71')]],'%s',_0x309a92):_0x309a92;_0x309a92=_0x569550[_0x59b4a5][_0x47a5('0x72')]?_[_0x47a5('0x73')](_0x3c66e3[_0x569550[_0x59b4a5][_0x47a5('0x72')]],'%s',_0x309a92):_0x309a92;if(_0x569550[_0x59b4a5]['groupBy']){_0x2a02cd[_0x47a5('0x63')](_0x309a92);}_0x569550[_0x59b4a5]['orderBy']&&_0x2a02cd['order'](_0x309a92,_0x569550[_0x59b4a5][_0x47a5('0x74')]===_0x47a5('0x75')?![]:!![]);_0x2a02cd[_0x47a5('0x3d')](_0x309a92,_0x569550[_0x59b4a5][_0x47a5('0x76')]||_0x309a92);}if(_0x56c35e[_0x47a5('0x77')]){_0x56c35e['joins']=JSON[_0x47a5('0x78')](_0x56c35e[_0x47a5('0x77')]);for(var _0x241e1d=0x0;_0x241e1d<_0x56c35e[_0x47a5('0x77')]['length'];_0x241e1d+=0x1){if(_0x56c35e[_0x47a5('0x77')][_0x241e1d]['type']&&_[_0x47a5('0x79')](_0x49d93d,_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x3a')])&&_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7d')]&&_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7a')]&&_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7b')]){_0x2a02cd[_0x56c35e['joins'][_0x241e1d][_0x47a5('0x3a')]](_0x56c35e[_0x47a5('0x77')][_0x241e1d]['foreignTable'],null,util[_0x47a5('0x72')](_0x47a5('0x7c'),_0x56c35e[_0x47a5('0x6e')],_0x56c35e['joins'][_0x241e1d]['parentKey'],_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7a')],_0x56c35e['joins'][_0x241e1d]['foreignKey']));}}}if(_0x56c35e[_0x47a5('0x7e')]){_0x56c35e[_0x47a5('0x7e')]=JSON['parse'](_0x56c35e[_0x47a5('0x7e')]);_0x2a02cd[_0x47a5('0x33')](_0x219beb(_0x56c35e['conditions'][_0x47a5('0x63')]));}_0xa8809a=_0x2a02cd[_0x47a5('0x7f')]();_0x2a02cd[_0x47a5('0x30')](_0x5205ba);_0x2a02cd[_0x47a5('0x17')](0x0);logger[_0x47a5('0x80')](_0x47a5('0x81'),_0x2a02cd['toString']());return db['sequelize']['query'](_0x2a02cd[_0x47a5('0x82')](),{'type':db[_0x47a5('0x83')]['QueryTypes'][_0x47a5('0x85')]});}})[_0x47a5('0x1c')](function(_0x32ca1c){if(!_0x32ca1c[_0x47a5('0x2e')]){throw new db[(_0x47a5('0x67'))]['ValidationErrorItem'](_0x47a5('0x8b'),0xcc);}if(_0x32f393['output']==='web'){return null;}var _0x5db0ed=_[_0x47a5('0x37')](_0x32f393,{'name':_0x32f393['fullPath']||_0x32f393[_0x47a5('0x21')]||_0x56c35e[_0x47a5('0x21')],'basename':_0x5d41d8,'savename':util[_0x47a5('0x72')]('%s-%s.%s',_0x32f393[_0x47a5('0x21')]||_0x56c35e[_0x47a5('0x21')],require(_0x47a5('0x8c'))[_0x47a5('0x8d')](0x4),_0x32f393[_0x47a5('0x8e')]||'csv'),'reportId':_0x56c35e['id'],'reportType':_0x47a5('0x8f')});return db[_0x47a5('0x90')]['create'](_0x5db0ed,{'raw':!![]});})[_0x47a5('0x1c')](function(_0x419870){if(_0x56c35e[_0x47a5('0x6e')]===_0x47a5('0x91')){_0xa8809a[_0x47a5('0x33')](_0x56c35e[_0x47a5('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x32f393[_0x47a5('0x92')],_0x32f393[_0x47a5('0x93')]);}else{_0xa8809a['where'](_0x56c35e[_0x47a5('0x6e')]+_0x47a5('0x94'),_0x32f393[_0x47a5('0x92')],_0x32f393[_0x47a5('0x93')]);}if(_0x419870){logger['info']('Run\x20Query:',_0xa8809a['toString']());require('child_process')[_0x47a5('0x95')](path[_0x47a5('0x51')](__dirname,_0x47a5('0x96'),_0x419870[_0x47a5('0x8e')]),[_0x419870['id'],_0xa8809a[_0x47a5('0x82')](),path[_0x47a5('0x51')](__dirname,_0x47a5('0x97'),_0x419870[_0x47a5('0x98')]),_0x5d41d8]);return _0x419870;}else{var _0x4bd164=squel[_0x47a5('0x6c')]();_0x4bd164[_0x47a5('0x6d')]('('+_0xa8809a[_0x47a5('0x82')]()+')',_0x47a5('0x99'));_0x4bd164['field']('COUNT(*)',_0x47a5('0x16'));_0xa8809a['limit'](_0x32f393['limit']||_0x5205ba);_0xa8809a[_0x47a5('0x17')](_0x32f393[_0x47a5('0x17')]||0x0);return db['sequelize'][_0x47a5('0x27')](_0x4bd164[_0x47a5('0x82')](),{'type':db[_0x47a5('0x83')]['QueryTypes'][_0x47a5('0x85')]})[_0x47a5('0x1c')](function(_0x48a491){if(!_0x48a491[_0x47a5('0x2e')]){_0xd6c211=0x0;}else{_0xd6c211=_0x48a491[0x0][_0x47a5('0x16')]||0x0;}return db[_0x47a5('0x83')][_0x47a5('0x27')](_0xa8809a[_0x47a5('0x82')](),{'type':db[_0x47a5('0x83')]['QueryTypes'][_0x47a5('0x85')]});})['then'](function(_0x2a3f32){return{'rows':_0x2a3f32||[],'count':_0xd6c211};});}});}exports[_0x47a5('0x9a')]=function(_0xe3f69f,_0x25f188){return runReport(_0xe3f69f['params'],_0xe3f69f[_0x47a5('0x27')],_0xe3f69f[_0x47a5('0x3e')])[_0x47a5('0x1c')](respondWithResult(_0x25f188,null))[_0x47a5('0x45')](handleError(_0x25f188,null));};exports[_0x47a5('0x9b')]=runReport;exports[_0x47a5('0x27')]=function(_0x31b8b1,_0x359fd8){var _0x1b3e82=0xa;var _0xa2045c=[_0x47a5('0x51'),_0x47a5('0x86'),'right_join',_0x47a5('0x52'),_0x47a5('0x53')];var _0x591bde={'SUM':_0x47a5('0x54'),'COUNT':_0x47a5('0x9c'),'COUNT DISTINCT':_0x47a5('0x55'),'MAX':_0x47a5('0x56'),'MIN':_0x47a5('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x47a5('0x58'),'GROUP_CONCAT ASC':_0x47a5('0x89'),'GROUP_CONCAT DESC':_0x47a5('0x59')};var _0x266a2f={'SEC_TO_TIME':_0x47a5('0x5a'),'DATE':_0x47a5('0x5b'),'HOUR':_0x47a5('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xa3d578=function(_0x580ce8){return!_[_0x47a5('0x79')](['IS\x20NULL',_0x47a5('0x5e'),_0x47a5('0x5f'),_0x47a5('0x60')],_0x580ce8);};var _0x2bc7ae=function(_0x49cb8c){if(!_0x49cb8c||!_0x49cb8c[_0x47a5('0x61')][_0x47a5('0x2e')]){return'';}for(var _0xaca12c='(',_0x5a150a=0x0;_0x5a150a<_0x49cb8c['rules'][_0x47a5('0x2e')];_0x5a150a+=0x1){_0x5a150a>0x0&&(_0xaca12c+='\x20'+_0x49cb8c[_0x47a5('0x62')]+'\x20');_0xaca12c+=_0x49cb8c[_0x47a5('0x61')][_0x5a150a][_0x47a5('0x63')]?_0x2bc7ae(_0x49cb8c[_0x47a5('0x61')][_0x5a150a][_0x47a5('0x63')]):_0x49cb8c[_0x47a5('0x61')][_0x5a150a][_0x47a5('0x3d')]+'\x20'+_0x49cb8c['rules'][_0x5a150a][_0x47a5('0x64')]+(_0xa3d578(_0x49cb8c['rules'][_0x5a150a][_0x47a5('0x64')])?'\x20'+_0x49cb8c[_0x47a5('0x61')][_0x5a150a]['value']:'');}return _0xaca12c+')';};var _0x48d4cf={'where':{'id':_0x31b8b1[_0x47a5('0x50')]['id']}},_0x229280,_0x41d2da,_0x530387,_0x4420fa,_0x2b2693;_0x48d4cf=_[_0x47a5('0x37')]({},_0x48d4cf,_0x31b8b1['options']);return db[_0x47a5('0x24')]['find'](_0x48d4cf)['then'](function(_0x4c3ebb){if(_0x4c3ebb){_0x229280=_0x4c3ebb;return _0x4c3ebb[_0x47a5('0x66')]();}return null;})['then'](function(_0x16bf1a){if(_0x16bf1a){if(!_0x16bf1a[_0x47a5('0x2e')]){throw new db[(_0x47a5('0x67'))][(_0x47a5('0x68'))](_0x47a5('0x69'),0x193);}_0x41d2da=_0x16bf1a;return db[_0x47a5('0x6a')][_0x47a5('0x3f')]({'raw':!![]});}return null;})[_0x47a5('0x1c')](function(_0x2f11d8){if(_0x2f11d8){_0x530387=_[_0x47a5('0x6b')](_0x2f11d8,'id');var _0x42b7ef;var _0xf05c39=squel[_0x47a5('0x6c')]();_0xf05c39[_0x47a5('0x6d')](_0x229280[_0x47a5('0x6e')]);for(var _0x5e17cb=0x0;_0x5e17cb<_0x41d2da[_0x47a5('0x2e')];_0x5e17cb+=0x1){_0x42b7ef=_0x41d2da[_0x5e17cb][_0x47a5('0x6f')]?_0x530387[_0x41d2da[_0x5e17cb][_0x47a5('0x6f')]][_0x47a5('0x70')]:_0x41d2da[_0x5e17cb]['field'];_0x42b7ef=_0x41d2da[_0x5e17cb][_0x47a5('0x71')]?_['replace'](_0x591bde[_0x41d2da[_0x5e17cb][_0x47a5('0x71')]],'%s',_0x42b7ef):_0x42b7ef;_0x42b7ef=_0x41d2da[_0x5e17cb]['format']?_[_0x47a5('0x73')](_0x266a2f[_0x41d2da[_0x5e17cb][_0x47a5('0x72')]],'%s',_0x42b7ef):_0x42b7ef;if(_0x41d2da[_0x5e17cb][_0x47a5('0x9d')]){_0xf05c39['group'](_0x42b7ef);}_0x41d2da[_0x5e17cb][_0x47a5('0x74')]&&_0xf05c39[_0x47a5('0x31')](_0x42b7ef,_0x41d2da[_0x5e17cb][_0x47a5('0x74')]==='DESC'?![]:!![]);_0xf05c39['field'](_0x42b7ef,_0x41d2da[_0x5e17cb][_0x47a5('0x76')]||_0x42b7ef);}if(_0x229280[_0x47a5('0x77')]){_0x229280[_0x47a5('0x77')]=JSON[_0x47a5('0x78')](_0x229280[_0x47a5('0x77')]);for(var _0x579e5c=0x0;_0x579e5c<_0x229280[_0x47a5('0x77')]['length'];_0x579e5c+=0x1){if(_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x3a')]&&_[_0x47a5('0x79')](_0xa2045c,_0x229280[_0x47a5('0x77')][_0x579e5c]['type'])&&_0x229280['joins'][_0x579e5c][_0x47a5('0x7d')]&&_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7a')]&&_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7b')]){_0xf05c39[_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x3a')]](_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x229280[_0x47a5('0x6e')],_0x229280['joins'][_0x579e5c][_0x47a5('0x7d')],_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7a')],_0x229280['joins'][_0x579e5c][_0x47a5('0x7b')]));}}}if(_0x229280[_0x47a5('0x7e')]){_0x229280['conditions']=JSON[_0x47a5('0x78')](_0x229280['conditions']);_0xf05c39[_0x47a5('0x33')](_0x2bc7ae(_0x229280[_0x47a5('0x7e')][_0x47a5('0x63')]));}_0x2b2693=_0xf05c39['clone']();_0xf05c39['limit'](_0x1b3e82);_0xf05c39['offset'](0x0);logger['debug']('Limited\x20Query:',_0xf05c39[_0x47a5('0x82')]());return db['sequelize'][_0x47a5('0x27')](_0xf05c39[_0x47a5('0x82')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x47a5('0x1c')](function(){return{'sql':_0x2b2693['toString']()};})['then'](respondWithResult(_0x359fd8,null))['catch'](handleError(_0x359fd8,null));};
\ No newline at end of file
+var _0x7a54=['day','merge','filter','map','type','key','VIRTUAL','field','options','findAll','rows','show','intersection','includeAll','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','find','params','join','outer_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parse','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','right_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','No\x20available\x20data','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','COUNT(%s)','groupBy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','destroy','get','CustomReports','error','name','send','index','AnalyticCustomReport','rawAttributes','keys','query','dateStart','dateEnd','filters','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','pick','add'];(function(_0x2d2c28,_0x2f2e2e){var _0xf8b290=function(_0x5b3c54){while(--_0x5b3c54){_0x2d2c28['push'](_0x2d2c28['shift']());}};_0xf8b290(++_0x2f2e2e);}(_0x7a54,0x106));var _0x47a5=function(_0x504183,_0x5ec053){_0x504183=_0x504183-0x0;var _0x12a46f=_0x7a54[_0x504183];return _0x12a46f;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var qs=require(_0x47a5('0xf'));var logger=require('../../config/logger')(_0x47a5('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x47a5('0x11'))['db'];function respondWithStatusCode(_0x69e4d4,_0x2f399b){_0x2f399b=_0x2f399b||0xcc;return function(_0x250fad){if(_0x250fad){return _0x69e4d4[_0x47a5('0x12')](_0x2f399b);}return _0x69e4d4[_0x47a5('0x13')](_0x2f399b)[_0x47a5('0x14')]();};}function respondWithResult(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xc8;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x13')](_0x44bd3e)[_0x47a5('0x15')](_0x221b54);}};}function respondWithFilteredResult(_0x139f25,_0x620ee9){return function(_0x3c6c46){if(_0x3c6c46){var _0x190faa=_0x3c6c46[_0x47a5('0x16')],_0x4e99a8=_0x620ee9[_0x47a5('0x17')],_0x362359=_0x620ee9[_0x47a5('0x17')]+_0x620ee9['limit'],_0x11faf5;if(_0x362359>=_0x190faa){_0x362359=_0x190faa;_0x11faf5=0xc8;}else{_0x11faf5=0xce;}_0x139f25['status'](_0x11faf5);return _0x139f25[_0x47a5('0x18')]('Content-Range',_0x4e99a8+'-'+_0x362359+'/'+_0x190faa)['json'](_0x3c6c46);}return null;};}function patchUpdates(_0x423a81){return function(_0xaf70a6){try{jsonpatch[_0x47a5('0x19')](_0xaf70a6,_0x423a81,!![]);}catch(_0x1ef371){return BPromise[_0x47a5('0x1a')](_0x1ef371);}return _0xaf70a6[_0x47a5('0x1b')]();};}function saveUpdates(_0x2763d6,_0xe3c618){return function(_0x3aed38){if(_0x3aed38){return _0x3aed38['update'](_0x2763d6)[_0x47a5('0x1c')](function(_0xf160ba){return _0xf160ba;});}return null;};}function removeEntity(_0x47cf3c,_0x2b0360){return function(_0x1f03f7){if(_0x1f03f7){return _0x1f03f7[_0x47a5('0x1d')]()['then'](function(){var _0xb8ae6c=_0x1f03f7[_0x47a5('0x1e')]({'plain':!![]});var _0x23db32=_0x47a5('0x1f');return db['UserProfileResource'][_0x47a5('0x1d')]({'where':{'type':_0x23db32,'resourceId':_0xb8ae6c['id']}})[_0x47a5('0x1c')](function(){return _0x1f03f7;});})['then'](function(){_0x47cf3c[_0x47a5('0x13')](0xcc)[_0x47a5('0x14')]();});}};}function handleEntityNotFound(_0x4437f1,_0x129ce5){return function(_0x3abd6a){if(!_0x3abd6a){_0x4437f1['sendStatus'](0x194);}return _0x3abd6a;};}function handleError(_0x53078a,_0x136745){_0x136745=_0x136745||0x1f4;return function(_0x5686db){logger[_0x47a5('0x20')](_0x5686db['stack']);if(_0x5686db[_0x47a5('0x21')]){delete _0x5686db[_0x47a5('0x21')];}_0x53078a[_0x47a5('0x13')](_0x136745)[_0x47a5('0x22')](_0x5686db);};}exports[_0x47a5('0x23')]=function(_0x3ba0b7,_0x24b162){var _0x136b14={},_0x16631f={},_0x361bfa={'count':0x0,'rows':[]};var _0x1127f8=db[_0x47a5('0x24')][_0x47a5('0x25')];_0x16631f['model']=_[_0x47a5('0x26')](_0x1127f8);var _0x51833b={'dateStart':_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x28')],'dateEnd':_0x3ba0b7[_0x47a5('0x27')]['dateEnd']};delete _0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x28')];delete _0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x29')];_0x16631f['query']=_['keys'](_0x3ba0b7[_0x47a5('0x27')]);_0x16631f[_0x47a5('0x2a')]=_['intersection'](_0x16631f['model'],_0x16631f[_0x47a5('0x27')]);_0x136b14[_0x47a5('0x2b')]=_['intersection'](_0x16631f[_0x47a5('0x2c')],qs['fields'](_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x2d')]));_0x136b14['attributes']=_0x136b14['attributes'][_0x47a5('0x2e')]?_0x136b14['attributes']:_0x16631f[_0x47a5('0x2c')];if(!_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x2f')]('nolimit')){_0x136b14[_0x47a5('0x30')]=qs['limit'](_0x3ba0b7['query'][_0x47a5('0x30')]);_0x136b14['offset']=qs[_0x47a5('0x17')](_0x3ba0b7['query'][_0x47a5('0x17')]);}_0x136b14[_0x47a5('0x31')]=qs[_0x47a5('0x32')](_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x32')]);_0x136b14[_0x47a5('0x33')]=qs[_0x47a5('0x2a')](_[_0x47a5('0x34')](_0x3ba0b7[_0x47a5('0x27')],_0x16631f['filters']));if(_0x51833b[_0x47a5('0x28')]){if(_0x51833b[_0x47a5('0x29')]){_0x51833b['dateEnd']=moment(_0x51833b[_0x47a5('0x29')])[_0x47a5('0x35')](0x1,_0x47a5('0x36'));}else{_0x51833b['dateEnd']=moment(_0x51833b[_0x47a5('0x28')])[_0x47a5('0x35')](0x1,'day');}_[_0x47a5('0x37')](_0x136b14[_0x47a5('0x33')],{'createdAt':{'$gte':_0x51833b['dateStart'],'$lte':_0x51833b['dateEnd']}});}if(_0x3ba0b7['query'][_0x47a5('0x38')]){_0x136b14['where']=_[_0x47a5('0x37')](_0x136b14[_0x47a5('0x33')],{'$or':_[_0x47a5('0x39')](_0x1127f8,function(_0x111f0d){if(_0x111f0d[_0x47a5('0x3a')][_0x47a5('0x3b')]!==_0x47a5('0x3c')){var _0x1f3d01={};_0x1f3d01[_0x111f0d[_0x47a5('0x3d')]]={'$like':'%'+_0x3ba0b7[_0x47a5('0x27')][_0x47a5('0x38')]+'%'};return _0x1f3d01;}})});}_0x136b14=_[_0x47a5('0x37')]({},_0x136b14,_0x3ba0b7[_0x47a5('0x3e')]);var _0x56dbbd={'where':_0x136b14[_0x47a5('0x33')]};return db[_0x47a5('0x24')][_0x47a5('0x16')](_0x56dbbd)[_0x47a5('0x1c')](function(_0x586f4f){_0x361bfa[_0x47a5('0x16')]=_0x586f4f;if(_0x3ba0b7['query']['includeAll']){_0x136b14['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x47a5('0x3f')](_0x136b14);})['then'](function(_0x2bb502){_0x361bfa[_0x47a5('0x40')]=_0x2bb502;return _0x361bfa;})[_0x47a5('0x1c')](respondWithFilteredResult(_0x24b162,_0x136b14))['catch'](handleError(_0x24b162,null));};exports[_0x47a5('0x41')]=function(_0x20c5bc,_0x586747){var _0x483650={'raw':![],'where':{'id':_0x20c5bc['params']['id']}},_0xbe21d9={};_0xbe21d9[_0x47a5('0x2c')]=_[_0x47a5('0x26')](db[_0x47a5('0x24')][_0x47a5('0x25')]);_0xbe21d9[_0x47a5('0x27')]=_[_0x47a5('0x26')](_0x20c5bc[_0x47a5('0x27')]);_0xbe21d9[_0x47a5('0x2a')]=_[_0x47a5('0x42')](_0xbe21d9[_0x47a5('0x2c')],_0xbe21d9[_0x47a5('0x27')]);_0x483650[_0x47a5('0x2b')]=_[_0x47a5('0x42')](_0xbe21d9[_0x47a5('0x2c')],qs[_0x47a5('0x2d')](_0x20c5bc[_0x47a5('0x27')]['fields']));_0x483650[_0x47a5('0x2b')]=_0x483650[_0x47a5('0x2b')]['length']?_0x483650['attributes']:_0xbe21d9[_0x47a5('0x2c')];if(_0x20c5bc['query'][_0x47a5('0x43')]){_0x483650[_0x47a5('0x44')]=[{'all':!![]}];}_0x483650=_['merge']({},_0x483650,_0x20c5bc['options']);return db[_0x47a5('0x24')]['find'](_0x483650)[_0x47a5('0x1c')](handleEntityNotFound(_0x586747,null))[_0x47a5('0x1c')](respondWithResult(_0x586747,null))[_0x47a5('0x45')](handleError(_0x586747,null));};exports[_0x47a5('0x46')]=function(_0x44fe8a,_0x26acd2){return db[_0x47a5('0x24')]['create'](_0x44fe8a['body'],{})[_0x47a5('0x1c')](function(_0x411230){var _0x1163e3=_0x44fe8a[_0x47a5('0x47')][_0x47a5('0x1e')]({'plain':!![]});if(!_0x1163e3)throw new Error(_0x47a5('0x48'));if(_0x1163e3[_0x47a5('0x49')]==='user'){var _0x45cca5=_0x411230[_0x47a5('0x1e')]({'plain':!![]});var _0x5f6a='Reports';return db[_0x47a5('0x4a')]['find']({'where':{'name':_0x5f6a,'userProfileId':_0x1163e3[_0x47a5('0x4b')]},'raw':!![]})[_0x47a5('0x1c')](function(_0x46e90b){if(_0x46e90b&&_0x46e90b[_0x47a5('0x4c')]===0x0){return db['UserProfileResource'][_0x47a5('0x46')]({'name':_0x45cca5[_0x47a5('0x21')],'resourceId':_0x45cca5['id'],'type':_0x47a5('0x1f'),'sectionId':_0x46e90b['id']},{})[_0x47a5('0x1c')](function(){return _0x411230;});}else{return _0x411230;}})[_0x47a5('0x45')](function(_0x6a53b3){logger[_0x47a5('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6a53b3);throw _0x6a53b3;});}return _0x411230;})[_0x47a5('0x1c')](respondWithResult(_0x26acd2,0xc9))[_0x47a5('0x45')](handleError(_0x26acd2,null));};exports[_0x47a5('0x4d')]=function(_0x8da9fb,_0x3329aa){if(_0x8da9fb[_0x47a5('0x4e')]['id']){delete _0x8da9fb['body']['id'];}return db[_0x47a5('0x24')][_0x47a5('0x4f')]({'where':{'id':_0x8da9fb[_0x47a5('0x50')]['id']}})['then'](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x1c')](saveUpdates(_0x8da9fb[_0x47a5('0x4e')],null))[_0x47a5('0x1c')](respondWithResult(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports['destroy']=function(_0x274e38,_0x376e1d){return db['AnalyticCustomReport']['find']({'where':{'id':_0x274e38[_0x47a5('0x50')]['id']}})['then'](handleEntityNotFound(_0x376e1d,null))[_0x47a5('0x1c')](removeEntity(_0x376e1d,null))['catch'](handleError(_0x376e1d,null));};exports['preview']=function(_0x389ed9,_0x46d2d3){var _0x53eedf=0xa;var _0x1b958b=[_0x47a5('0x51'),'left_join','right_join',_0x47a5('0x52'),_0x47a5('0x53')];var _0x867da0={'SUM':_0x47a5('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x55'),'MAX':_0x47a5('0x56'),'MIN':_0x47a5('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x47a5('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x47a5('0x59')};var _0x470da6={'SEC_TO_TIME':_0x47a5('0x5a'),'DATE':_0x47a5('0x5b'),'HOUR':_0x47a5('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x47a5('0x5d')};var _0x5d1550=function(_0x5cbe97){return!_['includes'](['IS\x20NULL',_0x47a5('0x5e'),_0x47a5('0x5f'),_0x47a5('0x60')],_0x5cbe97);};var _0x52e3ee=function(_0x4d3db1){if(!_0x4d3db1||!_0x4d3db1[_0x47a5('0x61')][_0x47a5('0x2e')]){return'';}for(var _0x45d4b6='(',_0x3c2b46=0x0;_0x3c2b46<_0x4d3db1[_0x47a5('0x61')]['length'];_0x3c2b46+=0x1){_0x3c2b46>0x0&&(_0x45d4b6+='\x20'+_0x4d3db1[_0x47a5('0x62')]+'\x20');_0x45d4b6+=_0x4d3db1['rules'][_0x3c2b46][_0x47a5('0x63')]?_0x52e3ee(_0x4d3db1[_0x47a5('0x61')][_0x3c2b46]['group']):_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x3d')]+'\x20'+_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x64')]+(_0x5d1550(_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x64')])?'\x20'+_0x4d3db1[_0x47a5('0x61')][_0x3c2b46][_0x47a5('0x65')]:'');}return _0x45d4b6+')';};var _0x57ed0a={'where':{'id':_0x389ed9['params']['id']}},_0x2dcc3b,_0x2a3a57,_0x3c75c6,_0x26e7fc,_0x396cb0;_0x57ed0a=_[_0x47a5('0x37')]({},_0x57ed0a,_0x389ed9[_0x47a5('0x3e')]);return db[_0x47a5('0x24')][_0x47a5('0x4f')](_0x57ed0a)[_0x47a5('0x1c')](function(_0x168329){if(_0x168329){_0x2dcc3b=_0x168329;return _0x168329[_0x47a5('0x66')]();}return null;})[_0x47a5('0x1c')](function(_0x350af8){if(_0x350af8){if(!_0x350af8[_0x47a5('0x2e')]){throw new db[(_0x47a5('0x67'))][(_0x47a5('0x68'))](_0x47a5('0x69'),0x193);}_0x2a3a57=_0x350af8;return db[_0x47a5('0x6a')][_0x47a5('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x42dd7d){if(_0x42dd7d){_0x3c75c6=_[_0x47a5('0x6b')](_0x42dd7d,'id');var _0x30504e;var _0x4b42f3=squel[_0x47a5('0x6c')]();_0x4b42f3[_0x47a5('0x6d')](_0x2dcc3b[_0x47a5('0x6e')]);for(var _0x26f1ac=0x0;_0x26f1ac<_0x2a3a57['length'];_0x26f1ac+=0x1){_0x30504e=_0x2a3a57[_0x26f1ac][_0x47a5('0x6f')]?_0x3c75c6[_0x2a3a57[_0x26f1ac]['MetricId']][_0x47a5('0x70')]:_0x2a3a57[_0x26f1ac]['field'];_0x30504e=_0x2a3a57[_0x26f1ac][_0x47a5('0x71')]?_['replace'](_0x867da0[_0x2a3a57[_0x26f1ac][_0x47a5('0x71')]],'%s',_0x30504e):_0x30504e;_0x30504e=_0x2a3a57[_0x26f1ac][_0x47a5('0x72')]?_[_0x47a5('0x73')](_0x470da6[_0x2a3a57[_0x26f1ac]['format']],'%s',_0x30504e):_0x30504e;if(_0x2a3a57[_0x26f1ac]['groupBy']){_0x4b42f3['group'](_0x30504e);}_0x2a3a57[_0x26f1ac][_0x47a5('0x74')]&&_0x4b42f3[_0x47a5('0x31')](_0x30504e,_0x2a3a57[_0x26f1ac][_0x47a5('0x74')]===_0x47a5('0x75')?![]:!![]);_0x4b42f3['field'](_0x30504e,_0x2a3a57[_0x26f1ac][_0x47a5('0x76')]||_0x30504e);}if(_0x2dcc3b[_0x47a5('0x77')]){_0x2dcc3b[_0x47a5('0x77')]=JSON[_0x47a5('0x78')](_0x2dcc3b[_0x47a5('0x77')]);for(var _0xb9f589=0x0;_0xb9f589<_0x2dcc3b[_0x47a5('0x77')][_0x47a5('0x2e')];_0xb9f589+=0x1){if(_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x3a')]&&_[_0x47a5('0x79')](_0x1b958b,_0x2dcc3b[_0x47a5('0x77')][_0xb9f589]['type'])&&_0x2dcc3b[_0x47a5('0x77')][_0xb9f589]['parentKey']&&_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7a')]&&_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7b')]){_0x4b42f3[_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x3a')]](_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7a')],null,util[_0x47a5('0x72')](_0x47a5('0x7c'),_0x2dcc3b[_0x47a5('0x6e')],_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7d')],_0x2dcc3b[_0x47a5('0x77')][_0xb9f589][_0x47a5('0x7a')],_0x2dcc3b['joins'][_0xb9f589]['foreignKey']));}}}if(_0x2dcc3b['conditions']){_0x2dcc3b['conditions']=JSON[_0x47a5('0x78')](_0x2dcc3b[_0x47a5('0x7e')]);_0x4b42f3['where'](_0x52e3ee(_0x2dcc3b[_0x47a5('0x7e')][_0x47a5('0x63')]));}_0x396cb0=_0x4b42f3[_0x47a5('0x7f')]();_0x4b42f3[_0x47a5('0x30')](_0x53eedf);_0x4b42f3[_0x47a5('0x17')](0x0);logger[_0x47a5('0x80')](_0x47a5('0x81'),_0x4b42f3[_0x47a5('0x82')]());return db[_0x47a5('0x83')][_0x47a5('0x27')](_0x4b42f3[_0x47a5('0x82')](),{'type':db['sequelize'][_0x47a5('0x84')][_0x47a5('0x85')]});}})[_0x47a5('0x1c')](respondWithResult(_0x46d2d3,null))['catch'](handleError(_0x46d2d3,null));};function runReport(_0x340846,_0x32f393,_0x17b61d){var _0x5d41d8=_0x32f393[_0x47a5('0x21')];var _0x5205ba=0xa;var _0x49d93d=[_0x47a5('0x51'),_0x47a5('0x86'),_0x47a5('0x87'),_0x47a5('0x52'),_0x47a5('0x53')];var _0xea50f3={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x55'),'MAX':'MAX(%s)','MIN':_0x47a5('0x57'),'AVG':_0x47a5('0x88'),'GROUP_CONCAT':_0x47a5('0x58'),'GROUP_CONCAT ASC':_0x47a5('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3c66e3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x47a5('0x5c'),'ROUND':_0x47a5('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1926bd=function(_0x21828e){return!_[_0x47a5('0x79')](['IS\x20NULL',_0x47a5('0x5e'),'IS\x20EMPTY',_0x47a5('0x60')],_0x21828e);};var _0x219beb=function(_0x63e2e5){if(!_0x63e2e5||!_0x63e2e5['rules'][_0x47a5('0x2e')]){return'';}for(var _0x196600='(',_0x2ae38b=0x0;_0x2ae38b<_0x63e2e5['rules'][_0x47a5('0x2e')];_0x2ae38b+=0x1){_0x2ae38b>0x0&&(_0x196600+='\x20'+_0x63e2e5['operator']+'\x20');_0x196600+=_0x63e2e5[_0x47a5('0x61')][_0x2ae38b]['group']?_0x219beb(_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x63')]):_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x3d')]+'\x20'+_0x63e2e5['rules'][_0x2ae38b][_0x47a5('0x64')]+(_0x1926bd(_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x64')])?'\x20'+_0x63e2e5[_0x47a5('0x61')][_0x2ae38b][_0x47a5('0x65')]:'');}return _0x196600+')';};var _0x57ac25={'where':{'id':_0x340846['id']}},_0x56c35e,_0x569550,_0x4ab01f,_0xd6c211,_0xa8809a;_0x57ac25=_[_0x47a5('0x37')]({},_0x57ac25,_0x17b61d);return db['AnalyticCustomReport'][_0x47a5('0x4f')](_0x57ac25)[_0x47a5('0x1c')](function(_0x565fbe){if(_0x565fbe){_0x56c35e=_0x565fbe;return _0x565fbe[_0x47a5('0x66')]();}return null;})[_0x47a5('0x1c')](function(_0x19acfa){if(_0x19acfa){if(!_0x19acfa[_0x47a5('0x2e')]){throw new db['Sequelize']['ValidationErrorItem'](_0x47a5('0x69'),0x193);}_0x569550=_0x19acfa;return db[_0x47a5('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x47a5('0x1c')](function(_0x23f055){if(_0x23f055){_0x4ab01f=_['keyBy'](_0x23f055,'id');var _0x309a92;var _0x2a02cd=squel[_0x47a5('0x6c')]();_0x2a02cd['from'](_0x56c35e[_0x47a5('0x6e')]);for(var _0x59b4a5=0x0;_0x59b4a5<_0x569550[_0x47a5('0x2e')];_0x59b4a5+=0x1){_0x309a92=_0x569550[_0x59b4a5]['MetricId']?_0x4ab01f[_0x569550[_0x59b4a5][_0x47a5('0x6f')]][_0x47a5('0x70')]:_0x569550[_0x59b4a5]['field'];_0x309a92=_0x569550[_0x59b4a5][_0x47a5('0x71')]?_['replace'](_0xea50f3[_0x569550[_0x59b4a5][_0x47a5('0x71')]],'%s',_0x309a92):_0x309a92;_0x309a92=_0x569550[_0x59b4a5][_0x47a5('0x72')]?_[_0x47a5('0x73')](_0x3c66e3[_0x569550[_0x59b4a5][_0x47a5('0x72')]],'%s',_0x309a92):_0x309a92;if(_0x569550[_0x59b4a5]['groupBy']){_0x2a02cd[_0x47a5('0x63')](_0x309a92);}_0x569550[_0x59b4a5]['orderBy']&&_0x2a02cd['order'](_0x309a92,_0x569550[_0x59b4a5][_0x47a5('0x74')]===_0x47a5('0x75')?![]:!![]);_0x2a02cd[_0x47a5('0x3d')](_0x309a92,_0x569550[_0x59b4a5][_0x47a5('0x76')]||_0x309a92);}if(_0x56c35e[_0x47a5('0x77')]){_0x56c35e['joins']=JSON[_0x47a5('0x78')](_0x56c35e[_0x47a5('0x77')]);for(var _0x241e1d=0x0;_0x241e1d<_0x56c35e[_0x47a5('0x77')]['length'];_0x241e1d+=0x1){if(_0x56c35e[_0x47a5('0x77')][_0x241e1d]['type']&&_[_0x47a5('0x79')](_0x49d93d,_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x3a')])&&_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7d')]&&_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7a')]&&_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7b')]){_0x2a02cd[_0x56c35e['joins'][_0x241e1d][_0x47a5('0x3a')]](_0x56c35e[_0x47a5('0x77')][_0x241e1d]['foreignTable'],null,util[_0x47a5('0x72')](_0x47a5('0x7c'),_0x56c35e[_0x47a5('0x6e')],_0x56c35e['joins'][_0x241e1d]['parentKey'],_0x56c35e[_0x47a5('0x77')][_0x241e1d][_0x47a5('0x7a')],_0x56c35e['joins'][_0x241e1d]['foreignKey']));}}}if(_0x56c35e[_0x47a5('0x7e')]){_0x56c35e[_0x47a5('0x7e')]=JSON['parse'](_0x56c35e[_0x47a5('0x7e')]);_0x2a02cd[_0x47a5('0x33')](_0x219beb(_0x56c35e['conditions'][_0x47a5('0x63')]));}_0xa8809a=_0x2a02cd[_0x47a5('0x7f')]();_0x2a02cd[_0x47a5('0x30')](_0x5205ba);_0x2a02cd[_0x47a5('0x17')](0x0);logger[_0x47a5('0x80')](_0x47a5('0x81'),_0x2a02cd['toString']());return db['sequelize']['query'](_0x2a02cd[_0x47a5('0x82')](),{'type':db[_0x47a5('0x83')]['QueryTypes'][_0x47a5('0x85')]});}})[_0x47a5('0x1c')](function(_0x32ca1c){if(!_0x32ca1c[_0x47a5('0x2e')]){throw new db[(_0x47a5('0x67'))]['ValidationErrorItem'](_0x47a5('0x8b'),0xcc);}if(_0x32f393['output']==='web'){return null;}var _0x5db0ed=_[_0x47a5('0x37')](_0x32f393,{'name':_0x32f393['fullPath']||_0x32f393[_0x47a5('0x21')]||_0x56c35e[_0x47a5('0x21')],'basename':_0x5d41d8,'savename':util[_0x47a5('0x72')]('%s-%s.%s',_0x32f393[_0x47a5('0x21')]||_0x56c35e[_0x47a5('0x21')],require(_0x47a5('0x8c'))[_0x47a5('0x8d')](0x4),_0x32f393[_0x47a5('0x8e')]||'csv'),'reportId':_0x56c35e['id'],'reportType':_0x47a5('0x8f')});return db[_0x47a5('0x90')]['create'](_0x5db0ed,{'raw':!![]});})[_0x47a5('0x1c')](function(_0x419870){if(_0x56c35e[_0x47a5('0x6e')]===_0x47a5('0x91')){_0xa8809a[_0x47a5('0x33')](_0x56c35e[_0x47a5('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x32f393[_0x47a5('0x92')],_0x32f393[_0x47a5('0x93')]);}else{_0xa8809a['where'](_0x56c35e[_0x47a5('0x6e')]+_0x47a5('0x94'),_0x32f393[_0x47a5('0x92')],_0x32f393[_0x47a5('0x93')]);}if(_0x419870){logger['info']('Run\x20Query:',_0xa8809a['toString']());require('child_process')[_0x47a5('0x95')](path[_0x47a5('0x51')](__dirname,_0x47a5('0x96'),_0x419870[_0x47a5('0x8e')]),[_0x419870['id'],_0xa8809a[_0x47a5('0x82')](),path[_0x47a5('0x51')](__dirname,_0x47a5('0x97'),_0x419870[_0x47a5('0x98')]),_0x5d41d8]);return _0x419870;}else{var _0x4bd164=squel[_0x47a5('0x6c')]();_0x4bd164[_0x47a5('0x6d')]('('+_0xa8809a[_0x47a5('0x82')]()+')',_0x47a5('0x99'));_0x4bd164['field']('COUNT(*)',_0x47a5('0x16'));_0xa8809a['limit'](_0x32f393['limit']||_0x5205ba);_0xa8809a[_0x47a5('0x17')](_0x32f393[_0x47a5('0x17')]||0x0);return db['sequelize'][_0x47a5('0x27')](_0x4bd164[_0x47a5('0x82')](),{'type':db[_0x47a5('0x83')]['QueryTypes'][_0x47a5('0x85')]})[_0x47a5('0x1c')](function(_0x48a491){if(!_0x48a491[_0x47a5('0x2e')]){_0xd6c211=0x0;}else{_0xd6c211=_0x48a491[0x0][_0x47a5('0x16')]||0x0;}return db[_0x47a5('0x83')][_0x47a5('0x27')](_0xa8809a[_0x47a5('0x82')](),{'type':db[_0x47a5('0x83')]['QueryTypes'][_0x47a5('0x85')]});})['then'](function(_0x2a3f32){return{'rows':_0x2a3f32||[],'count':_0xd6c211};});}});}exports[_0x47a5('0x9a')]=function(_0xe3f69f,_0x25f188){return runReport(_0xe3f69f['params'],_0xe3f69f[_0x47a5('0x27')],_0xe3f69f[_0x47a5('0x3e')])[_0x47a5('0x1c')](respondWithResult(_0x25f188,null))[_0x47a5('0x45')](handleError(_0x25f188,null));};exports[_0x47a5('0x9b')]=runReport;exports[_0x47a5('0x27')]=function(_0x31b8b1,_0x359fd8){var _0x1b3e82=0xa;var _0xa2045c=[_0x47a5('0x51'),_0x47a5('0x86'),'right_join',_0x47a5('0x52'),_0x47a5('0x53')];var _0x591bde={'SUM':_0x47a5('0x54'),'COUNT':_0x47a5('0x9c'),'COUNT DISTINCT':_0x47a5('0x55'),'MAX':_0x47a5('0x56'),'MIN':_0x47a5('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x47a5('0x58'),'GROUP_CONCAT ASC':_0x47a5('0x89'),'GROUP_CONCAT DESC':_0x47a5('0x59')};var _0x266a2f={'SEC_TO_TIME':_0x47a5('0x5a'),'DATE':_0x47a5('0x5b'),'HOUR':_0x47a5('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xa3d578=function(_0x580ce8){return!_[_0x47a5('0x79')](['IS\x20NULL',_0x47a5('0x5e'),_0x47a5('0x5f'),_0x47a5('0x60')],_0x580ce8);};var _0x2bc7ae=function(_0x49cb8c){if(!_0x49cb8c||!_0x49cb8c[_0x47a5('0x61')][_0x47a5('0x2e')]){return'';}for(var _0xaca12c='(',_0x5a150a=0x0;_0x5a150a<_0x49cb8c['rules'][_0x47a5('0x2e')];_0x5a150a+=0x1){_0x5a150a>0x0&&(_0xaca12c+='\x20'+_0x49cb8c[_0x47a5('0x62')]+'\x20');_0xaca12c+=_0x49cb8c[_0x47a5('0x61')][_0x5a150a][_0x47a5('0x63')]?_0x2bc7ae(_0x49cb8c[_0x47a5('0x61')][_0x5a150a][_0x47a5('0x63')]):_0x49cb8c[_0x47a5('0x61')][_0x5a150a][_0x47a5('0x3d')]+'\x20'+_0x49cb8c['rules'][_0x5a150a][_0x47a5('0x64')]+(_0xa3d578(_0x49cb8c['rules'][_0x5a150a][_0x47a5('0x64')])?'\x20'+_0x49cb8c[_0x47a5('0x61')][_0x5a150a]['value']:'');}return _0xaca12c+')';};var _0x48d4cf={'where':{'id':_0x31b8b1[_0x47a5('0x50')]['id']}},_0x229280,_0x41d2da,_0x530387,_0x4420fa,_0x2b2693;_0x48d4cf=_[_0x47a5('0x37')]({},_0x48d4cf,_0x31b8b1['options']);return db[_0x47a5('0x24')]['find'](_0x48d4cf)['then'](function(_0x4c3ebb){if(_0x4c3ebb){_0x229280=_0x4c3ebb;return _0x4c3ebb[_0x47a5('0x66')]();}return null;})['then'](function(_0x16bf1a){if(_0x16bf1a){if(!_0x16bf1a[_0x47a5('0x2e')]){throw new db[(_0x47a5('0x67'))][(_0x47a5('0x68'))](_0x47a5('0x69'),0x193);}_0x41d2da=_0x16bf1a;return db[_0x47a5('0x6a')][_0x47a5('0x3f')]({'raw':!![]});}return null;})[_0x47a5('0x1c')](function(_0x2f11d8){if(_0x2f11d8){_0x530387=_[_0x47a5('0x6b')](_0x2f11d8,'id');var _0x42b7ef;var _0xf05c39=squel[_0x47a5('0x6c')]();_0xf05c39[_0x47a5('0x6d')](_0x229280[_0x47a5('0x6e')]);for(var _0x5e17cb=0x0;_0x5e17cb<_0x41d2da[_0x47a5('0x2e')];_0x5e17cb+=0x1){_0x42b7ef=_0x41d2da[_0x5e17cb][_0x47a5('0x6f')]?_0x530387[_0x41d2da[_0x5e17cb][_0x47a5('0x6f')]][_0x47a5('0x70')]:_0x41d2da[_0x5e17cb]['field'];_0x42b7ef=_0x41d2da[_0x5e17cb][_0x47a5('0x71')]?_['replace'](_0x591bde[_0x41d2da[_0x5e17cb][_0x47a5('0x71')]],'%s',_0x42b7ef):_0x42b7ef;_0x42b7ef=_0x41d2da[_0x5e17cb]['format']?_[_0x47a5('0x73')](_0x266a2f[_0x41d2da[_0x5e17cb][_0x47a5('0x72')]],'%s',_0x42b7ef):_0x42b7ef;if(_0x41d2da[_0x5e17cb][_0x47a5('0x9d')]){_0xf05c39['group'](_0x42b7ef);}_0x41d2da[_0x5e17cb][_0x47a5('0x74')]&&_0xf05c39[_0x47a5('0x31')](_0x42b7ef,_0x41d2da[_0x5e17cb][_0x47a5('0x74')]==='DESC'?![]:!![]);_0xf05c39['field'](_0x42b7ef,_0x41d2da[_0x5e17cb][_0x47a5('0x76')]||_0x42b7ef);}if(_0x229280[_0x47a5('0x77')]){_0x229280[_0x47a5('0x77')]=JSON[_0x47a5('0x78')](_0x229280[_0x47a5('0x77')]);for(var _0x579e5c=0x0;_0x579e5c<_0x229280[_0x47a5('0x77')]['length'];_0x579e5c+=0x1){if(_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x3a')]&&_[_0x47a5('0x79')](_0xa2045c,_0x229280[_0x47a5('0x77')][_0x579e5c]['type'])&&_0x229280['joins'][_0x579e5c][_0x47a5('0x7d')]&&_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7a')]&&_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7b')]){_0xf05c39[_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x3a')]](_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x229280[_0x47a5('0x6e')],_0x229280['joins'][_0x579e5c][_0x47a5('0x7d')],_0x229280[_0x47a5('0x77')][_0x579e5c][_0x47a5('0x7a')],_0x229280['joins'][_0x579e5c][_0x47a5('0x7b')]));}}}if(_0x229280[_0x47a5('0x7e')]){_0x229280['conditions']=JSON[_0x47a5('0x78')](_0x229280['conditions']);_0xf05c39[_0x47a5('0x33')](_0x2bc7ae(_0x229280[_0x47a5('0x7e')][_0x47a5('0x63')]));}_0x2b2693=_0xf05c39['clone']();_0xf05c39['limit'](_0x1b3e82);_0xf05c39['offset'](0x0);logger['debug']('Limited\x20Query:',_0xf05c39[_0x47a5('0x82')]());return db['sequelize'][_0x47a5('0x27')](_0xf05c39[_0x47a5('0x82')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x47a5('0x1c')](function(){return{'sql':_0x2b2693['toString']()};})['then'](respondWithResult(_0x359fd8,null))['catch'](handleError(_0x359fd8,null));};
\ No newline at end of file
index 24393c5..7e7df29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91f0=['api','request-promise','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x91f0,0x101));var _0x091f=function(_0x480db0,_0x146afe){_0x480db0=_0x480db0-0x0;var _0x548eea=_0x91f0[_0x480db0];return _0x548eea;};'use strict';var _=require(_0x091f('0x0'));var util=require(_0x091f('0x1'));var logger=require(_0x091f('0x2'))(_0x091f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x091f('0x4'));var attributes=require(_0x091f('0x5'));module[_0x091f('0x6')]=function(_0x155957,_0x463691){return _0x155957[_0x091f('0x7')](_0x091f('0x8'),attributes,{'tableName':_0x091f('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b3f=['moment','bluebird','request-promise','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api'];(function(_0x515c65,_0x3f1b7d){var _0x3bb796=function(_0x29cf72){while(--_0x29cf72){_0x515c65['push'](_0x515c65['shift']());}};_0x3bb796(++_0x3f1b7d);}(_0x3b3f,0x93));var _0xf3b3=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3b3f[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xf3b3('0x0'));var logger=require(_0xf3b3('0x1'))(_0xf3b3('0x2'));var moment=require(_0xf3b3('0x3'));var BPromise=require(_0xf3b3('0x4'));var rp=require(_0xf3b3('0x5'));var attributes=require(_0xf3b3('0x6'));module[_0xf3b3('0x7')]=function(_0x5376a4,_0x3ef3d3){return _0x5376a4['define'](_0xf3b3('0x8'),attributes,{'tableName':_0xf3b3('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e375a45..e364fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0xa656ef,_0x3d31df){var _0x20e81=function(_0x128119){while(--_0x128119){_0xa656ef['push'](_0xa656ef['shift']());}};_0x20e81(++_0x3d31df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
+var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1df9d5,_0x413e27){var _0x356c8a=function(_0x1d8bd2){while(--_0x1d8bd2){_0x1df9d5['push'](_0x1df9d5['shift']());}};_0x356c8a(++_0x413e27);}(_0xb10b,0x12a));var _0xbb10=function(_0x1cc211,_0x4856f1){_0x1cc211=_0x1cc211-0x0;var _0x5df05a=_0xb10b[_0x1cc211];return _0x5df05a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}
\ No newline at end of file
index 5f86fa8..3d00a7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aad=['../../components/auth/service','./analyticCustomReport.controller','index','get','/:id','show','/:id/preview','isAuthenticated','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x4c5d68,_0x227713){var _0x2d4e1d=function(_0x324a63){while(--_0x324a63){_0x4c5d68['push'](_0x4c5d68['shift']());}};_0x2d4e1d(++_0x227713);}(_0x8aad,0x146));var _0xd8aa=function(_0x4cd6c4,_0x17ea1e){_0x4cd6c4=_0x4cd6c4-0x0;var _0x345ee8=_0x8aad[_0x4cd6c4];return _0x345ee8;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var auth=require(_0xd8aa('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8aa('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8aa('0x6')]);router[_0xd8aa('0x7')](_0xd8aa('0x8'),auth['isAuthenticated'](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x7')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller['preview']);router['get'](_0xd8aa('0xc'),auth[_0xd8aa('0xb')](),controller[_0xd8aa('0xd')]);router[_0xd8aa('0x7')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')]('/',auth[_0xd8aa('0xb')](),controller[_0xd8aa('0x11')]);router[_0xd8aa('0x12')](_0xd8aa('0x8'),auth[_0xd8aa('0xb')](),controller[_0xd8aa('0x13')]);router[_0xd8aa('0x14')](_0xd8aa('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xd8aa('0x15')]=router;
\ No newline at end of file
+var _0x25e7=['get','/:id/preview','preview','/:id/run','run','/:id/query','post','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','isAuthenticated','show'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x25e7,0x1d6));var _0x725e=function(_0x1880f5,_0x18418a){_0x1880f5=_0x1880f5-0x0;var _0x3f0957=_0x25e7[_0x1880f5];return _0x3f0957;};'use strict';var multer=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var path=require(_0x725e('0x2'));var timeout=require(_0x725e('0x3'));var express=require(_0x725e('0x4'));var router=express[_0x725e('0x5')]();var auth=require(_0x725e('0x6'));var interaction=require(_0x725e('0x7'));var config=require(_0x725e('0x8'));var controller=require(_0x725e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x725e('0xa')]);router['get']('/:id',auth[_0x725e('0xb')](),controller[_0x725e('0xc')]);router[_0x725e('0xd')](_0x725e('0xe'),auth[_0x725e('0xb')](),controller[_0x725e('0xf')]);router[_0x725e('0xd')](_0x725e('0x10'),auth[_0x725e('0xb')](),controller[_0x725e('0x11')]);router[_0x725e('0xd')](_0x725e('0x12'),auth['isAuthenticated'](),controller['query']);router[_0x725e('0x13')]('/',auth[_0x725e('0xb')](),controller['create']);router['put'](_0x725e('0x14'),auth[_0x725e('0xb')](),controller['update']);router[_0x725e('0x15')](_0x725e('0x14'),auth[_0x725e('0xb')](),controller['destroy']);module[_0x725e('0x16')]=router;
\ No newline at end of file
index 39c0a4b..f157ffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b1c=['STRING','TEXT','sequelize','exports'];(function(_0x26e6d5,_0x13ceff){var _0x174341=function(_0x53b570){while(--_0x53b570){_0x26e6d5['push'](_0x26e6d5['shift']());}};_0x174341(++_0x13ceff);}(_0x1b1c,0x1a6));var _0xc1b1=function(_0x3e7a1e,_0x1589be){_0x3e7a1e=_0x3e7a1e-0x0;var _0x267c30=_0x1b1c[_0x3e7a1e];return _0x267c30;};'use strict';var Sequelize=require(_0xc1b1('0x0'));module[_0xc1b1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc1b1('0x2')]},'parent':{'type':Sequelize[_0xc1b1('0x2')]},'table':{'type':Sequelize[_0xc1b1('0x2')]},'conditions':{'type':Sequelize[_0xc1b1('0x3')]},'joins':{'type':Sequelize[_0xc1b1('0x3')]}};
\ No newline at end of file
+var _0xd106=['STRING','TEXT','sequelize','exports'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xd106,0xa6));var _0x6d10=function(_0x71e044,_0x123374){_0x71e044=_0x71e044-0x0;var _0x449c00=_0xd106[_0x71e044];return _0x449c00;};'use strict';var Sequelize=require(_0x6d10('0x0'));module[_0x6d10('0x1')]={'name':{'type':Sequelize[_0x6d10('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6d10('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6d10('0x2')]},'conditions':{'type':Sequelize[_0x6d10('0x3')]},'joins':{'type':Sequelize[_0x6d10('0x3')]}};
\ No newline at end of file
index 044e4cf..43a38a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cf8=['GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','outer_join','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','QueryTypes','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','SEC_TO_TIME(%s)','AnalyticMetric','alias','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','reject','update','then','get','DefaultReports','UserProfileResource','destroy','stack','send','index','AnalyticDefaultReport','rawAttributes','model','query','dateStart','dateEnd','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','day','add','merge','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0x6cf8,0xf0));var _0x86cf=function(_0x5297a3,_0x49b863){_0x5297a3=_0x5297a3-0x0;var _0x21b181=_0x6cf8[_0x5297a3];return _0x21b181;};'use strict';var pdf=require(_0x86cf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x86cf('0x1'));var zipdir=require(_0x86cf('0x2'));var jsonpatch=require(_0x86cf('0x3'));var rp=require(_0x86cf('0x4'));var moment=require(_0x86cf('0x5'));var BPromise=require(_0x86cf('0x6'));var Mustache=require(_0x86cf('0x7'));var util=require(_0x86cf('0x8'));var path=require(_0x86cf('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86cf('0xa'));var fs=require('fs');var _=require(_0x86cf('0xb'));var squel=require('squel');var crypto=require(_0x86cf('0xc'));var jsforce=require(_0x86cf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x86cf('0xe'));var querystring=require(_0x86cf('0xf'));var Papa=require(_0x86cf('0x10'));var Redis=require(_0x86cf('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x86cf('0x12'))(_0x86cf('0x13'));var utils=require(_0x86cf('0x14'));var config=require('../../config/environment');var db=require(_0x86cf('0x15'))['db'];function respondWithStatusCode(_0x59caa9,_0x2a74ea){_0x2a74ea=_0x2a74ea||0xcc;return function(_0x1eee29){if(_0x1eee29){return _0x59caa9['sendStatus'](_0x2a74ea);}return _0x59caa9[_0x86cf('0x16')](_0x2a74ea)[_0x86cf('0x17')]();};}function respondWithResult(_0x376a4b,_0x20c594){_0x20c594=_0x20c594||0xc8;return function(_0x489192){if(_0x489192){return _0x376a4b['status'](_0x20c594)[_0x86cf('0x18')](_0x489192);}};}function respondWithFilteredResult(_0x3a1ce6,_0x413d78){return function(_0x1e4716){if(_0x1e4716){var _0x52d01d=_0x1e4716[_0x86cf('0x19')],_0x2258a0=_0x413d78[_0x86cf('0x1a')],_0x4e5451=_0x413d78[_0x86cf('0x1a')]+_0x413d78[_0x86cf('0x1b')],_0x16e3e8;if(_0x4e5451>=_0x52d01d){_0x4e5451=_0x52d01d;_0x16e3e8=0xc8;}else{_0x16e3e8=0xce;}_0x3a1ce6['status'](_0x16e3e8);return _0x3a1ce6['set']('Content-Range',_0x2258a0+'-'+_0x4e5451+'/'+_0x52d01d)[_0x86cf('0x18')](_0x1e4716);}return null;};}function patchUpdates(_0x3bf0d4){return function(_0x35ba7b){try{jsonpatch['apply'](_0x35ba7b,_0x3bf0d4,!![]);}catch(_0x95db4e){return BPromise[_0x86cf('0x1c')](_0x95db4e);}return _0x35ba7b['save']();};}function saveUpdates(_0x451b04,_0x128f09){return function(_0x4f5700){if(_0x4f5700){return _0x4f5700[_0x86cf('0x1d')](_0x451b04)['then'](function(_0x3cee7d){return _0x3cee7d;});}return null;};}function removeEntity(_0x41e99c,_0x44a8b8){return function(_0xcc4a54){if(_0xcc4a54){return _0xcc4a54['destroy']()[_0x86cf('0x1e')](function(){var _0x98fe28=_0xcc4a54[_0x86cf('0x1f')]({'plain':!![]});var _0xf66ce6=_0x86cf('0x20');return db[_0x86cf('0x21')][_0x86cf('0x22')]({'where':{'type':_0xf66ce6,'resourceId':_0x98fe28['id']}})['then'](function(){return _0xcc4a54;});})[_0x86cf('0x1e')](function(){_0x41e99c['status'](0xcc)[_0x86cf('0x17')]();});}};}function handleEntityNotFound(_0x4f11d0,_0x4a6314){return function(_0x489c1b){if(!_0x489c1b){_0x4f11d0['sendStatus'](0x194);}return _0x489c1b;};}function handleError(_0x261077,_0x41c294){_0x41c294=_0x41c294||0x1f4;return function(_0x480430){logger['error'](_0x480430[_0x86cf('0x23')]);if(_0x480430['name']){delete _0x480430['name'];}_0x261077[_0x86cf('0x16')](_0x41c294)[_0x86cf('0x24')](_0x480430);};}exports[_0x86cf('0x25')]=function(_0x575476,_0x15088c){var _0x38831c={},_0x535dd4={},_0x513eb9={'count':0x0,'rows':[]};var _0x2635ae=db[_0x86cf('0x26')][_0x86cf('0x27')];_0x535dd4[_0x86cf('0x28')]=_['keys'](_0x2635ae);var _0x3c96a6={'dateStart':_0x575476[_0x86cf('0x29')][_0x86cf('0x2a')],'dateEnd':_0x575476['query'][_0x86cf('0x2b')]};delete _0x575476['query']['dateStart'];delete _0x575476[_0x86cf('0x29')][_0x86cf('0x2b')];_0x535dd4['query']=_[_0x86cf('0x2c')](_0x575476['query']);_0x535dd4['filters']=_['intersection'](_0x535dd4[_0x86cf('0x28')],_0x535dd4[_0x86cf('0x29')]);_0x38831c[_0x86cf('0x2d')]=_[_0x86cf('0x2e')](_0x535dd4[_0x86cf('0x28')],qs[_0x86cf('0x2f')](_0x575476[_0x86cf('0x29')]['fields']));_0x38831c[_0x86cf('0x2d')]=_0x38831c[_0x86cf('0x2d')][_0x86cf('0x30')]?_0x38831c[_0x86cf('0x2d')]:_0x535dd4[_0x86cf('0x28')];if(!_0x575476[_0x86cf('0x29')]['hasOwnProperty'](_0x86cf('0x31'))){_0x38831c[_0x86cf('0x1b')]=qs[_0x86cf('0x1b')](_0x575476[_0x86cf('0x29')][_0x86cf('0x1b')]);_0x38831c[_0x86cf('0x1a')]=qs[_0x86cf('0x1a')](_0x575476[_0x86cf('0x29')][_0x86cf('0x1a')]);}_0x38831c[_0x86cf('0x32')]=qs[_0x86cf('0x33')](_0x575476[_0x86cf('0x29')][_0x86cf('0x33')]);_0x38831c[_0x86cf('0x34')]=qs['filters'](_[_0x86cf('0x35')](_0x575476[_0x86cf('0x29')],_0x535dd4[_0x86cf('0x36')]));if(_0x3c96a6[_0x86cf('0x2a')]){if(_0x3c96a6['dateEnd']){_0x3c96a6[_0x86cf('0x2b')]=moment(_0x3c96a6[_0x86cf('0x2b')])['add'](0x1,_0x86cf('0x37'));}else{_0x3c96a6['dateEnd']=moment(_0x3c96a6[_0x86cf('0x2a')])[_0x86cf('0x38')](0x1,_0x86cf('0x37'));}_[_0x86cf('0x39')](_0x38831c[_0x86cf('0x34')],{'createdAt':{'$gte':_0x3c96a6[_0x86cf('0x2a')],'$lte':_0x3c96a6['dateEnd']}});}if(_0x575476[_0x86cf('0x29')][_0x86cf('0x3a')]){_0x38831c[_0x86cf('0x34')]=_[_0x86cf('0x39')](_0x38831c[_0x86cf('0x34')],{'$or':_[_0x86cf('0x3b')](_0x2635ae,function(_0x1844ee){if(_0x1844ee[_0x86cf('0x3c')][_0x86cf('0x3d')]!==_0x86cf('0x3e')){var _0x4a6807={};_0x4a6807[_0x1844ee[_0x86cf('0x3f')]]={'$like':'%'+_0x575476[_0x86cf('0x29')]['filter']+'%'};return _0x4a6807;}})});}_0x38831c=_[_0x86cf('0x39')]({},_0x38831c,_0x575476[_0x86cf('0x40')]);var _0x4e94bb={'where':_0x38831c[_0x86cf('0x34')]};return db[_0x86cf('0x26')][_0x86cf('0x19')](_0x4e94bb)['then'](function(_0x4a14ef){_0x513eb9[_0x86cf('0x19')]=_0x4a14ef;if(_0x575476[_0x86cf('0x29')][_0x86cf('0x41')]){_0x38831c[_0x86cf('0x42')]=[{'all':!![]}];}return db[_0x86cf('0x26')][_0x86cf('0x43')](_0x38831c);})['then'](function(_0x2319a2){_0x513eb9[_0x86cf('0x44')]=_0x2319a2;return _0x513eb9;})[_0x86cf('0x1e')](respondWithFilteredResult(_0x15088c,_0x38831c))[_0x86cf('0x45')](handleError(_0x15088c,null));};exports[_0x86cf('0x46')]=function(_0x17ceb6,_0x105c90){var _0x2ec028={'raw':!![],'where':{'id':_0x17ceb6[_0x86cf('0x47')]['id']}},_0x465996={};_0x465996['model']=_[_0x86cf('0x2c')](db[_0x86cf('0x26')][_0x86cf('0x27')]);_0x465996[_0x86cf('0x29')]=_[_0x86cf('0x2c')](_0x17ceb6[_0x86cf('0x29')]);_0x465996['filters']=_['intersection'](_0x465996[_0x86cf('0x28')],_0x465996['query']);_0x2ec028[_0x86cf('0x2d')]=_[_0x86cf('0x2e')](_0x465996['model'],qs[_0x86cf('0x2f')](_0x17ceb6[_0x86cf('0x29')][_0x86cf('0x2f')]));_0x2ec028['attributes']=_0x2ec028['attributes'][_0x86cf('0x30')]?_0x2ec028[_0x86cf('0x2d')]:_0x465996['model'];if(_0x17ceb6[_0x86cf('0x29')]['includeAll']){_0x2ec028[_0x86cf('0x42')]=[{'all':!![]}];}_0x2ec028=_[_0x86cf('0x39')]({},_0x2ec028,_0x17ceb6[_0x86cf('0x40')]);return db[_0x86cf('0x26')][_0x86cf('0x48')](_0x2ec028)[_0x86cf('0x1e')](handleEntityNotFound(_0x105c90,null))[_0x86cf('0x1e')](respondWithResult(_0x105c90,null))[_0x86cf('0x45')](handleError(_0x105c90,null));};exports[_0x86cf('0x49')]=function(_0x2756bd,_0xadffbc){return db[_0x86cf('0x26')][_0x86cf('0x49')](_0x2756bd[_0x86cf('0x4a')],{})['then'](function(_0x3dc6d8){var _0x1ae81a=_0x2756bd[_0x86cf('0x4b')][_0x86cf('0x1f')]({'plain':!![]});if(!_0x1ae81a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ae81a[_0x86cf('0x4c')]==='user'){var _0x1beb52=_0x3dc6d8[_0x86cf('0x1f')]({'plain':!![]});var _0x40f36f=_0x86cf('0x4d');return db[_0x86cf('0x4e')]['find']({'where':{'name':_0x40f36f,'userProfileId':_0x1ae81a[_0x86cf('0x4f')]},'raw':!![]})[_0x86cf('0x1e')](function(_0xf02a81){if(_0xf02a81&&_0xf02a81[_0x86cf('0x50')]===0x0){return db[_0x86cf('0x21')][_0x86cf('0x49')]({'name':_0x1beb52[_0x86cf('0x51')],'resourceId':_0x1beb52['id'],'type':_0x86cf('0x20'),'sectionId':_0xf02a81['id']},{})[_0x86cf('0x1e')](function(){return _0x3dc6d8;});}else{return _0x3dc6d8;}})[_0x86cf('0x45')](function(_0x40ec7a){logger[_0x86cf('0x52')](_0x86cf('0x53'),_0x40ec7a);throw _0x40ec7a;});}return _0x3dc6d8;})[_0x86cf('0x1e')](respondWithResult(_0xadffbc,0xc9))['catch'](handleError(_0xadffbc,null));};exports[_0x86cf('0x1d')]=function(_0x27b1af,_0x5a7951){if(_0x27b1af['body']['id']){delete _0x27b1af[_0x86cf('0x4a')]['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x27b1af[_0x86cf('0x47')]['id']}})[_0x86cf('0x1e')](handleEntityNotFound(_0x5a7951,null))[_0x86cf('0x1e')](saveUpdates(_0x27b1af[_0x86cf('0x4a')],null))[_0x86cf('0x1e')](respondWithResult(_0x5a7951,null))[_0x86cf('0x45')](handleError(_0x5a7951,null));};exports[_0x86cf('0x22')]=function(_0x1345e4,_0x162f44){return db[_0x86cf('0x26')]['find']({'where':{'id':_0x1345e4[_0x86cf('0x47')]['id']}})[_0x86cf('0x1e')](handleEntityNotFound(_0x162f44,null))[_0x86cf('0x1e')](removeEntity(_0x162f44,null))['catch'](handleError(_0x162f44,null));};exports['preview']=function(_0x5bdb75,_0x556749){var _0x46be01=0xa;var _0x35c603=[_0x86cf('0x54'),_0x86cf('0x55'),_0x86cf('0x56'),'outer_join',_0x86cf('0x57')];var _0x615e11={'SUM':_0x86cf('0x58'),'COUNT':_0x86cf('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86cf('0x5a'),'MIN':'MIN(%s)','AVG':_0x86cf('0x5b'),'GROUP_CONCAT':_0x86cf('0x5c'),'GROUP_CONCAT ASC':_0x86cf('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x39b11a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x86cf('0x5e')};var _0x13a8c8=function(_0x5d8e2b){return!_[_0x86cf('0x5f')](['IS\x20NULL',_0x86cf('0x60'),_0x86cf('0x61'),_0x86cf('0x62')],_0x5d8e2b);};var _0x391ced=function(_0x2f5d5b){if(!_0x2f5d5b||!_0x2f5d5b[_0x86cf('0x63')][_0x86cf('0x30')]){return'';}for(var _0x32172e='(',_0x2d78e2=0x0;_0x2d78e2<_0x2f5d5b[_0x86cf('0x63')][_0x86cf('0x30')];_0x2d78e2+=0x1){_0x2d78e2>0x0&&(_0x32172e+='\x20'+_0x2f5d5b[_0x86cf('0x64')]+'\x20');_0x32172e+=_0x2f5d5b['rules'][_0x2d78e2][_0x86cf('0x65')]?_0x391ced(_0x2f5d5b['rules'][_0x2d78e2][_0x86cf('0x65')]):_0x2f5d5b[_0x86cf('0x63')][_0x2d78e2][_0x86cf('0x3f')]+'\x20'+_0x2f5d5b[_0x86cf('0x63')][_0x2d78e2][_0x86cf('0x66')]+(_0x13a8c8(_0x2f5d5b[_0x86cf('0x63')][_0x2d78e2][_0x86cf('0x66')])?'\x20'+_0x2f5d5b[_0x86cf('0x63')][_0x2d78e2][_0x86cf('0x67')]:'');}return _0x32172e+')';};var _0x49a3d5={'where':{'id':_0x5bdb75[_0x86cf('0x47')]['id']}},_0x334161,_0x1306ec,_0x344906,_0x59b6f2,_0x259e7f;_0x49a3d5=_['merge']({},_0x49a3d5,_0x5bdb75[_0x86cf('0x40')]);return db['AnalyticDefaultReport'][_0x86cf('0x48')](_0x49a3d5)[_0x86cf('0x1e')](function(_0x384a13){if(_0x384a13){_0x334161=_0x384a13;return _0x384a13[_0x86cf('0x68')]();}return null;})[_0x86cf('0x1e')](function(_0x11675e){if(_0x11675e){if(!_0x11675e[_0x86cf('0x30')]){throw new db[(_0x86cf('0x69'))][(_0x86cf('0x6a'))](_0x86cf('0x6b'),0x193);}_0x1306ec=_0x11675e;return db['AnalyticMetric'][_0x86cf('0x43')]({'raw':!![]});}return null;})[_0x86cf('0x1e')](function(_0x3e2be5){if(_0x3e2be5){_0x344906=_[_0x86cf('0x6c')](_0x3e2be5,'id');var _0x7b1ea9;var _0x27ba64=squel[_0x86cf('0x6d')]();_0x27ba64[_0x86cf('0x6e')](_0x334161['table']);for(var _0x2459ab=0x0;_0x2459ab<_0x1306ec[_0x86cf('0x30')];_0x2459ab+=0x1){_0x7b1ea9=_0x1306ec[_0x2459ab][_0x86cf('0x6f')]?_0x344906[_0x1306ec[_0x2459ab][_0x86cf('0x6f')]][_0x86cf('0x70')]:_0x1306ec[_0x2459ab]['field'];_0x7b1ea9=_0x1306ec[_0x2459ab][_0x86cf('0x71')]?_[_0x86cf('0x72')](_0x615e11[_0x1306ec[_0x2459ab][_0x86cf('0x71')]],'%s',_0x7b1ea9):_0x7b1ea9;_0x7b1ea9=_0x1306ec[_0x2459ab]['format']?_[_0x86cf('0x72')](_0x39b11a[_0x1306ec[_0x2459ab][_0x86cf('0x73')]],'%s',_0x7b1ea9):_0x7b1ea9;if(_0x1306ec[_0x2459ab][_0x86cf('0x74')]){_0x27ba64[_0x86cf('0x65')](_0x7b1ea9);}_0x1306ec[_0x2459ab][_0x86cf('0x75')]&&_0x27ba64[_0x86cf('0x32')](_0x7b1ea9,_0x1306ec[_0x2459ab][_0x86cf('0x75')]===_0x86cf('0x76')?![]:!![]);_0x27ba64[_0x86cf('0x3f')](_0x7b1ea9,_0x1306ec[_0x2459ab]['alias']||_0x7b1ea9);}if(_0x334161['joins']){_0x334161[_0x86cf('0x77')]=JSON[_0x86cf('0x78')](_0x334161[_0x86cf('0x77')]);for(var _0x19c7ca=0x0;_0x19c7ca<_0x334161[_0x86cf('0x77')]['length'];_0x19c7ca+=0x1){if(_0x334161[_0x86cf('0x77')][_0x19c7ca][_0x86cf('0x3c')]&&_[_0x86cf('0x5f')](_0x35c603,_0x334161[_0x86cf('0x77')][_0x19c7ca][_0x86cf('0x3c')])&&_0x334161[_0x86cf('0x77')][_0x19c7ca][_0x86cf('0x79')]&&_0x334161[_0x86cf('0x77')][_0x19c7ca][_0x86cf('0x7a')]&&_0x334161[_0x86cf('0x77')][_0x19c7ca]['foreignKey']){_0x27ba64[_0x334161[_0x86cf('0x77')][_0x19c7ca]['type']](_0x334161[_0x86cf('0x77')][_0x19c7ca][_0x86cf('0x7a')],null,util[_0x86cf('0x73')](_0x86cf('0x7b'),_0x334161[_0x86cf('0x7c')],_0x334161[_0x86cf('0x77')][_0x19c7ca][_0x86cf('0x79')],_0x334161[_0x86cf('0x77')][_0x19c7ca]['foreignTable'],_0x334161[_0x86cf('0x77')][_0x19c7ca][_0x86cf('0x7d')]));}}}if(_0x334161[_0x86cf('0x7e')]){_0x334161[_0x86cf('0x7e')]=JSON[_0x86cf('0x78')](_0x334161['conditions']);_0x27ba64[_0x86cf('0x34')](_0x391ced(_0x334161[_0x86cf('0x7e')][_0x86cf('0x65')]));}_0x259e7f=_0x27ba64[_0x86cf('0x7f')]();_0x27ba64[_0x86cf('0x1b')](_0x46be01);_0x27ba64[_0x86cf('0x1a')](0x0);logger[_0x86cf('0x80')](_0x86cf('0x81'),_0x27ba64[_0x86cf('0x82')]());return db[_0x86cf('0x83')][_0x86cf('0x29')](_0x27ba64['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x86cf('0x1e')](respondWithResult(_0x556749,null))[_0x86cf('0x45')](handleError(_0x556749,null));};function runReport(_0x24d9f3,_0x13f32,_0x2fac7e){var _0x2d7f8d=_0x13f32[_0x86cf('0x51')];var _0x248ac5=0xa;var _0x46749f=['join',_0x86cf('0x55'),_0x86cf('0x56'),_0x86cf('0x84'),_0x86cf('0x57')];var _0x1543bc={'SUM':'SUM(%s)','COUNT':_0x86cf('0x59'),'COUNT DISTINCT':_0x86cf('0x85'),'MAX':_0x86cf('0x5a'),'MIN':_0x86cf('0x86'),'AVG':_0x86cf('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86cf('0x5d'),'GROUP_CONCAT DESC':_0x86cf('0x87')};var _0x36f622={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86cf('0x88'),'HOUR':_0x86cf('0x89'),'ROUND':_0x86cf('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x216da0=function(_0x57ce44){return!_[_0x86cf('0x5f')]([_0x86cf('0x8b'),_0x86cf('0x60'),_0x86cf('0x61'),'IS\x20NOT\x20EMPTY'],_0x57ce44);};var _0x38e86a=function(_0x42a7f4){if(!_0x42a7f4||!_0x42a7f4['rules']['length']){return'';}for(var _0x34dd45='(',_0xf37646=0x0;_0xf37646<_0x42a7f4[_0x86cf('0x63')][_0x86cf('0x30')];_0xf37646+=0x1){_0xf37646>0x0&&(_0x34dd45+='\x20'+_0x42a7f4[_0x86cf('0x64')]+'\x20');_0x34dd45+=_0x42a7f4[_0x86cf('0x63')][_0xf37646][_0x86cf('0x65')]?_0x38e86a(_0x42a7f4[_0x86cf('0x63')][_0xf37646][_0x86cf('0x65')]):_0x42a7f4[_0x86cf('0x63')][_0xf37646]['field']+'\x20'+_0x42a7f4['rules'][_0xf37646][_0x86cf('0x66')]+(_0x216da0(_0x42a7f4[_0x86cf('0x63')][_0xf37646][_0x86cf('0x66')])?'\x20'+_0x42a7f4['rules'][_0xf37646][_0x86cf('0x67')]:'');}return _0x34dd45+')';};var _0x56997a={'where':{'id':_0x24d9f3['id']}},_0x3365a1,_0x2a26e8,_0x48f4a8,_0x3c95e2,_0x5e0d27;_0x56997a=_['merge']({},_0x56997a,_0x2fac7e);return db[_0x86cf('0x26')]['find'](_0x56997a)[_0x86cf('0x1e')](function(_0x5871bc){if(_0x5871bc){_0x3365a1=_0x5871bc;return _0x5871bc[_0x86cf('0x68')]();}return null;})[_0x86cf('0x1e')](function(_0x28d331){if(_0x28d331){if(!_0x28d331[_0x86cf('0x30')]){throw new db[(_0x86cf('0x69'))][(_0x86cf('0x6a'))](_0x86cf('0x6b'),0x193);}_0x2a26e8=_0x28d331;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x4ce976){if(_0x4ce976){_0x48f4a8=_['keyBy'](_0x4ce976,'id');var _0x3e40e8;var _0x578b1d=squel['select']();_0x578b1d[_0x86cf('0x6e')](_0x3365a1['table']);for(var _0x265746=0x0;_0x265746<_0x2a26e8['length'];_0x265746+=0x1){_0x3e40e8=_0x2a26e8[_0x265746][_0x86cf('0x6f')]?_0x48f4a8[_0x2a26e8[_0x265746][_0x86cf('0x6f')]]['metric']:_0x2a26e8[_0x265746][_0x86cf('0x3f')];_0x3e40e8=_0x2a26e8[_0x265746]['function']?_['replace'](_0x1543bc[_0x2a26e8[_0x265746][_0x86cf('0x71')]],'%s',_0x3e40e8):_0x3e40e8;_0x3e40e8=_0x2a26e8[_0x265746]['format']?_[_0x86cf('0x72')](_0x36f622[_0x2a26e8[_0x265746]['format']],'%s',_0x3e40e8):_0x3e40e8;if(_0x2a26e8[_0x265746]['groupBy']){_0x578b1d[_0x86cf('0x65')](_0x3e40e8);}_0x2a26e8[_0x265746][_0x86cf('0x75')]&&_0x578b1d[_0x86cf('0x32')](_0x3e40e8,_0x2a26e8[_0x265746][_0x86cf('0x75')]===_0x86cf('0x76')?![]:!![]);_0x578b1d[_0x86cf('0x3f')](_0x3e40e8,_0x2a26e8[_0x265746]['alias']||_0x3e40e8);}if(_0x3365a1['joins']){_0x3365a1[_0x86cf('0x77')]=JSON['parse'](_0x3365a1['joins']);for(var _0x4d882f=0x0;_0x4d882f<_0x3365a1[_0x86cf('0x77')][_0x86cf('0x30')];_0x4d882f+=0x1){if(_0x3365a1[_0x86cf('0x77')][_0x4d882f][_0x86cf('0x3c')]&&_[_0x86cf('0x5f')](_0x46749f,_0x3365a1[_0x86cf('0x77')][_0x4d882f]['type'])&&_0x3365a1['joins'][_0x4d882f]['parentKey']&&_0x3365a1[_0x86cf('0x77')][_0x4d882f][_0x86cf('0x7a')]&&_0x3365a1['joins'][_0x4d882f][_0x86cf('0x7d')]){_0x578b1d[_0x3365a1[_0x86cf('0x77')][_0x4d882f][_0x86cf('0x3c')]](_0x3365a1[_0x86cf('0x77')][_0x4d882f][_0x86cf('0x7a')],null,util[_0x86cf('0x73')](_0x86cf('0x7b'),_0x3365a1[_0x86cf('0x7c')],_0x3365a1[_0x86cf('0x77')][_0x4d882f]['parentKey'],_0x3365a1['joins'][_0x4d882f][_0x86cf('0x7a')],_0x3365a1[_0x86cf('0x77')][_0x4d882f][_0x86cf('0x7d')]));}}}if(_0x3365a1[_0x86cf('0x7e')]){_0x3365a1[_0x86cf('0x7e')]=JSON[_0x86cf('0x78')](_0x3365a1[_0x86cf('0x7e')]);_0x578b1d['where'](_0x38e86a(_0x3365a1[_0x86cf('0x7e')][_0x86cf('0x65')]));}_0x5e0d27=_0x578b1d[_0x86cf('0x7f')]();_0x578b1d[_0x86cf('0x1b')](_0x248ac5);_0x578b1d[_0x86cf('0x1a')](0x0);logger[_0x86cf('0x80')](_0x86cf('0x81'),_0x578b1d[_0x86cf('0x82')]());return db[_0x86cf('0x83')][_0x86cf('0x29')](_0x578b1d[_0x86cf('0x82')](),{'type':db[_0x86cf('0x83')][_0x86cf('0x8c')][_0x86cf('0x8d')]});}})[_0x86cf('0x1e')](function(_0x2c3fbe){if(!_0x2c3fbe['length']){throw new db[(_0x86cf('0x69'))]['ValidationErrorItem'](_0x86cf('0x8e'),0xcc);}if(_0x13f32[_0x86cf('0x8f')]===_0x86cf('0x90')){return null;}var _0x32f09a=_[_0x86cf('0x39')](_0x13f32,{'name':_0x13f32[_0x86cf('0x91')]||_0x13f32[_0x86cf('0x51')]||_0x3365a1['name'],'basename':_0x2d7f8d,'savename':util[_0x86cf('0x73')](_0x86cf('0x92'),_0x13f32[_0x86cf('0x51')]||_0x3365a1[_0x86cf('0x51')],require(_0x86cf('0x93'))[_0x86cf('0x94')](0x4),_0x13f32[_0x86cf('0x8f')]||'csv'),'reportId':_0x3365a1['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x86cf('0x49')](_0x32f09a,{'raw':!![]});})[_0x86cf('0x1e')](function(_0x54c167){if(_0x3365a1[_0x86cf('0x7c')]===_0x86cf('0x95')){_0x5e0d27[_0x86cf('0x34')](_0x3365a1[_0x86cf('0x7c')]+_0x86cf('0x96'),_0x13f32[_0x86cf('0x97')],_0x13f32[_0x86cf('0x98')]);}else{_0x5e0d27[_0x86cf('0x34')](_0x3365a1['table']+_0x86cf('0x99'),_0x13f32[_0x86cf('0x97')],_0x13f32['endDate']);}if(_0x54c167){logger[_0x86cf('0x9a')](_0x86cf('0x9b'),_0x5e0d27['toString']());require(_0x86cf('0x9c'))['fork'](path[_0x86cf('0x54')](__dirname,_0x86cf('0x9d'),_0x54c167['output']),[_0x54c167['id'],_0x5e0d27[_0x86cf('0x82')](),path[_0x86cf('0x54')](__dirname,_0x86cf('0x9e'),_0x54c167[_0x86cf('0x9f')]),_0x2d7f8d]);return _0x54c167;}else{var _0x27729c=squel[_0x86cf('0x6d')]();_0x27729c[_0x86cf('0x6e')]('('+_0x5e0d27[_0x86cf('0x82')]()+')',_0x86cf('0xa0'));_0x27729c[_0x86cf('0x3f')](_0x86cf('0xa1'),_0x86cf('0x19'));_0x5e0d27[_0x86cf('0x1b')](_0x13f32[_0x86cf('0x1b')]||_0x248ac5);_0x5e0d27[_0x86cf('0x1a')](_0x13f32['offset']||0x0);return db[_0x86cf('0x83')]['query'](_0x27729c[_0x86cf('0x82')](),{'type':db[_0x86cf('0x83')][_0x86cf('0x8c')]['SELECT']})['then'](function(_0x179215){if(!_0x179215[_0x86cf('0x30')]){_0x3c95e2=0x0;}else{_0x3c95e2=_0x179215[0x0][_0x86cf('0x19')]||0x0;}return db[_0x86cf('0x83')][_0x86cf('0x29')](_0x5e0d27[_0x86cf('0x82')](),{'type':db[_0x86cf('0x83')][_0x86cf('0x8c')][_0x86cf('0x8d')]});})[_0x86cf('0x1e')](function(_0x380dc0){return{'rows':_0x380dc0||[],'count':_0x3c95e2};});}});}exports['run']=function(_0x5ce205,_0x415c24){return runReport(_0x5ce205[_0x86cf('0x47')],_0x5ce205[_0x86cf('0x29')],_0x5ce205['options'])[_0x86cf('0x1e')](respondWithResult(_0x415c24,null))[_0x86cf('0x45')](handleError(_0x415c24,null));};exports[_0x86cf('0xa2')]=runReport;exports[_0x86cf('0x29')]=function(_0x415572,_0x15318f){var _0x472fad=0xa;var _0x113851=[_0x86cf('0x54'),_0x86cf('0x55'),_0x86cf('0x56'),_0x86cf('0x84'),_0x86cf('0x57')];var _0xbd26aa={'SUM':_0x86cf('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x86cf('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86cf('0x5d'),'GROUP_CONCAT DESC':_0x86cf('0x87')};var _0x3dd7b8={'SEC_TO_TIME':_0x86cf('0xa3'),'DATE':_0x86cf('0x88'),'HOUR':_0x86cf('0x89'),'ROUND':_0x86cf('0x8a'),'UNIX_TIMESTAMP':_0x86cf('0x5e')};var _0x39b3a5=function(_0x306c2c){return!_[_0x86cf('0x5f')]([_0x86cf('0x8b'),'IS\x20NOT\x20NULL',_0x86cf('0x61'),_0x86cf('0x62')],_0x306c2c);};var _0x453c19=function(_0x135833){if(!_0x135833||!_0x135833[_0x86cf('0x63')][_0x86cf('0x30')]){return'';}for(var _0x10c6d6='(',_0x2cb7fb=0x0;_0x2cb7fb<_0x135833['rules']['length'];_0x2cb7fb+=0x1){_0x2cb7fb>0x0&&(_0x10c6d6+='\x20'+_0x135833['operator']+'\x20');_0x10c6d6+=_0x135833[_0x86cf('0x63')][_0x2cb7fb][_0x86cf('0x65')]?_0x453c19(_0x135833['rules'][_0x2cb7fb][_0x86cf('0x65')]):_0x135833[_0x86cf('0x63')][_0x2cb7fb][_0x86cf('0x3f')]+'\x20'+_0x135833[_0x86cf('0x63')][_0x2cb7fb][_0x86cf('0x66')]+(_0x39b3a5(_0x135833[_0x86cf('0x63')][_0x2cb7fb][_0x86cf('0x66')])?'\x20'+_0x135833[_0x86cf('0x63')][_0x2cb7fb]['value']:'');}return _0x10c6d6+')';};var _0x25a404={'where':{'id':_0x415572['params']['id']}},_0x11c207,_0x178e2a,_0x3341ca,_0x56fa92,_0x187f9e;_0x25a404=_['merge']({},_0x25a404,_0x415572[_0x86cf('0x40')]);return db[_0x86cf('0x26')][_0x86cf('0x48')](_0x25a404)[_0x86cf('0x1e')](function(_0x1825aa){if(_0x1825aa){_0x11c207=_0x1825aa;return _0x1825aa['getFields']();}return null;})[_0x86cf('0x1e')](function(_0xee205f){if(_0xee205f){if(!_0xee205f[_0x86cf('0x30')]){throw new db['Sequelize']['ValidationErrorItem'](_0x86cf('0x6b'),0x193);}_0x178e2a=_0xee205f;return db[_0x86cf('0xa4')]['findAll']({'raw':!![]});}return null;})[_0x86cf('0x1e')](function(_0x144337){if(_0x144337){_0x3341ca=_[_0x86cf('0x6c')](_0x144337,'id');var _0x206fb7;var _0x3d8ffa=squel['select']();_0x3d8ffa[_0x86cf('0x6e')](_0x11c207[_0x86cf('0x7c')]);for(var _0x4d804e=0x0;_0x4d804e<_0x178e2a[_0x86cf('0x30')];_0x4d804e+=0x1){_0x206fb7=_0x178e2a[_0x4d804e]['MetricId']?_0x3341ca[_0x178e2a[_0x4d804e]['MetricId']][_0x86cf('0x70')]:_0x178e2a[_0x4d804e][_0x86cf('0x3f')];_0x206fb7=_0x178e2a[_0x4d804e][_0x86cf('0x71')]?_[_0x86cf('0x72')](_0xbd26aa[_0x178e2a[_0x4d804e][_0x86cf('0x71')]],'%s',_0x206fb7):_0x206fb7;_0x206fb7=_0x178e2a[_0x4d804e][_0x86cf('0x73')]?_[_0x86cf('0x72')](_0x3dd7b8[_0x178e2a[_0x4d804e][_0x86cf('0x73')]],'%s',_0x206fb7):_0x206fb7;if(_0x178e2a[_0x4d804e][_0x86cf('0x74')]){_0x3d8ffa['group'](_0x206fb7);}_0x178e2a[_0x4d804e]['orderBy']&&_0x3d8ffa[_0x86cf('0x32')](_0x206fb7,_0x178e2a[_0x4d804e][_0x86cf('0x75')]==='DESC'?![]:!![]);_0x3d8ffa['field'](_0x206fb7,_0x178e2a[_0x4d804e][_0x86cf('0xa5')]||_0x206fb7);}if(_0x11c207[_0x86cf('0x77')]){_0x11c207[_0x86cf('0x77')]=JSON['parse'](_0x11c207['joins']);for(var _0x20dd82=0x0;_0x20dd82<_0x11c207[_0x86cf('0x77')][_0x86cf('0x30')];_0x20dd82+=0x1){if(_0x11c207[_0x86cf('0x77')][_0x20dd82][_0x86cf('0x3c')]&&_[_0x86cf('0x5f')](_0x113851,_0x11c207['joins'][_0x20dd82][_0x86cf('0x3c')])&&_0x11c207['joins'][_0x20dd82]['parentKey']&&_0x11c207[_0x86cf('0x77')][_0x20dd82][_0x86cf('0x7a')]&&_0x11c207[_0x86cf('0x77')][_0x20dd82]['foreignKey']){_0x3d8ffa[_0x11c207['joins'][_0x20dd82][_0x86cf('0x3c')]](_0x11c207[_0x86cf('0x77')][_0x20dd82][_0x86cf('0x7a')],null,util[_0x86cf('0x73')](_0x86cf('0x7b'),_0x11c207['table'],_0x11c207['joins'][_0x20dd82][_0x86cf('0x79')],_0x11c207['joins'][_0x20dd82][_0x86cf('0x7a')],_0x11c207[_0x86cf('0x77')][_0x20dd82]['foreignKey']));}}}if(_0x11c207['conditions']){_0x11c207[_0x86cf('0x7e')]=JSON[_0x86cf('0x78')](_0x11c207[_0x86cf('0x7e')]);_0x3d8ffa[_0x86cf('0x34')](_0x453c19(_0x11c207['conditions']['group']));}_0x187f9e=_0x3d8ffa['clone']();_0x3d8ffa['limit'](_0x472fad);_0x3d8ffa[_0x86cf('0x1a')](0x0);logger[_0x86cf('0x80')]('Limited\x20Query:',_0x3d8ffa[_0x86cf('0x82')]());return db['sequelize'][_0x86cf('0x29')](_0x3d8ffa[_0x86cf('0x82')](),{'type':db['sequelize'][_0x86cf('0x8c')][_0x86cf('0x8d')]});}})[_0x86cf('0x1e')](function(){return{'sql':_0x187f9e[_0x86cf('0x82')]()};})[_0x86cf('0x1e')](respondWithResult(_0x15318f,null))[_0x86cf('0x45')](handleError(_0x15318f,null));};
\ No newline at end of file
+var _0x1db8=['end','json','count','offset','status','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','stack','name','send','index','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','add','day','merge','where','filter','field','options','include','AnalyticDefaultReport','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','group','condition','getFields','Sequelize','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','outer_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20EMPTY','operator','value','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','QueryTypes','No\x20available\x20data','web','fullPath','generate','csv','cdr','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','output','../../files/reports','savename','COUNT(*)','run','COUNT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','IS\x20NOT\x20EMPTY','%s.%s\x20=\x20%s.%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5189b5,_0x129c83){var _0x29203f=function(_0xd8b9f9){while(--_0xd8b9f9){_0x5189b5['push'](_0x5189b5['shift']());}};_0x29203f(++_0x129c83);}(_0x1db8,0x1c9));var _0x81db=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1db8[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x81db('0x0'));var emlformat=require(_0x81db('0x1'));var rimraf=require(_0x81db('0x2'));var zipdir=require(_0x81db('0x3'));var jsonpatch=require(_0x81db('0x4'));var rp=require('request-promise');var moment=require(_0x81db('0x5'));var BPromise=require(_0x81db('0x6'));var Mustache=require(_0x81db('0x7'));var util=require(_0x81db('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x81db('0x9'));var fs=require('fs');var _=require(_0x81db('0xa'));var squel=require(_0x81db('0xb'));var crypto=require(_0x81db('0xc'));var jsforce=require(_0x81db('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x81db('0xe'));var querystring=require(_0x81db('0xf'));var Papa=require(_0x81db('0x10'));var Redis=require(_0x81db('0x11'));var qs=require(_0x81db('0x12'));var logger=require(_0x81db('0x13'))(_0x81db('0x14'));var utils=require(_0x81db('0x15'));var config=require(_0x81db('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30d6df,_0x1e903c){_0x1e903c=_0x1e903c||0xcc;return function(_0x495f79){if(_0x495f79){return _0x30d6df['sendStatus'](_0x1e903c);}return _0x30d6df['status'](_0x1e903c)[_0x81db('0x17')]();};}function respondWithResult(_0x11b0cb,_0x46be43){_0x46be43=_0x46be43||0xc8;return function(_0x1cfe65){if(_0x1cfe65){return _0x11b0cb['status'](_0x46be43)[_0x81db('0x18')](_0x1cfe65);}};}function respondWithFilteredResult(_0x3cfb3b,_0x16b388){return function(_0x56e2e5){if(_0x56e2e5){var _0x97ffa7=_0x56e2e5[_0x81db('0x19')],_0x444164=_0x16b388[_0x81db('0x1a')],_0x583efe=_0x16b388[_0x81db('0x1a')]+_0x16b388['limit'],_0x50f7ce;if(_0x583efe>=_0x97ffa7){_0x583efe=_0x97ffa7;_0x50f7ce=0xc8;}else{_0x50f7ce=0xce;}_0x3cfb3b[_0x81db('0x1b')](_0x50f7ce);return _0x3cfb3b['set'](_0x81db('0x1c'),_0x444164+'-'+_0x583efe+'/'+_0x97ffa7)[_0x81db('0x18')](_0x56e2e5);}return null;};}function patchUpdates(_0x4a1447){return function(_0x151ffa){try{jsonpatch[_0x81db('0x1d')](_0x151ffa,_0x4a1447,!![]);}catch(_0x28676b){return BPromise[_0x81db('0x1e')](_0x28676b);}return _0x151ffa['save']();};}function saveUpdates(_0x36908a,_0x1b25f2){return function(_0x14b2e6){if(_0x14b2e6){return _0x14b2e6[_0x81db('0x1f')](_0x36908a)[_0x81db('0x20')](function(_0x209747){return _0x209747;});}return null;};}function removeEntity(_0x2b0e46,_0x1df348){return function(_0x4f9bd0){if(_0x4f9bd0){return _0x4f9bd0[_0x81db('0x21')]()[_0x81db('0x20')](function(){var _0xa2294b=_0x4f9bd0[_0x81db('0x22')]({'plain':!![]});var _0x460a4c=_0x81db('0x23');return db[_0x81db('0x24')][_0x81db('0x21')]({'where':{'type':_0x460a4c,'resourceId':_0xa2294b['id']}})[_0x81db('0x20')](function(){return _0x4f9bd0;});})[_0x81db('0x20')](function(){_0x2b0e46[_0x81db('0x1b')](0xcc)[_0x81db('0x17')]();});}};}function handleEntityNotFound(_0x2e2d39,_0x266b4f){return function(_0x3a38ae){if(!_0x3a38ae){_0x2e2d39['sendStatus'](0x194);}return _0x3a38ae;};}function handleError(_0x51a0a1,_0x3d6d96){_0x3d6d96=_0x3d6d96||0x1f4;return function(_0x57f287){logger['error'](_0x57f287[_0x81db('0x25')]);if(_0x57f287[_0x81db('0x26')]){delete _0x57f287[_0x81db('0x26')];}_0x51a0a1['status'](_0x3d6d96)[_0x81db('0x27')](_0x57f287);};}exports[_0x81db('0x28')]=function(_0x4f4229,_0x32a494){var _0x1501f1={},_0xcc44c6={},_0xaa9a0f={'count':0x0,'rows':[]};var _0x41fae1=db['AnalyticDefaultReport']['rawAttributes'];_0xcc44c6[_0x81db('0x29')]=_[_0x81db('0x2a')](_0x41fae1);var _0x497c62={'dateStart':_0x4f4229[_0x81db('0x2b')][_0x81db('0x2c')],'dateEnd':_0x4f4229[_0x81db('0x2b')][_0x81db('0x2d')]};delete _0x4f4229[_0x81db('0x2b')][_0x81db('0x2c')];delete _0x4f4229['query'][_0x81db('0x2d')];_0xcc44c6[_0x81db('0x2b')]=_[_0x81db('0x2a')](_0x4f4229[_0x81db('0x2b')]);_0xcc44c6[_0x81db('0x2e')]=_[_0x81db('0x2f')](_0xcc44c6['model'],_0xcc44c6[_0x81db('0x2b')]);_0x1501f1[_0x81db('0x30')]=_[_0x81db('0x2f')](_0xcc44c6['model'],qs[_0x81db('0x31')](_0x4f4229[_0x81db('0x2b')][_0x81db('0x31')]));_0x1501f1[_0x81db('0x30')]=_0x1501f1[_0x81db('0x30')][_0x81db('0x32')]?_0x1501f1['attributes']:_0xcc44c6[_0x81db('0x29')];if(!_0x4f4229[_0x81db('0x2b')]['hasOwnProperty'](_0x81db('0x33'))){_0x1501f1[_0x81db('0x34')]=qs[_0x81db('0x34')](_0x4f4229[_0x81db('0x2b')][_0x81db('0x34')]);_0x1501f1[_0x81db('0x1a')]=qs[_0x81db('0x1a')](_0x4f4229[_0x81db('0x2b')][_0x81db('0x1a')]);}_0x1501f1[_0x81db('0x35')]=qs[_0x81db('0x36')](_0x4f4229[_0x81db('0x2b')][_0x81db('0x36')]);_0x1501f1['where']=qs['filters'](_['pick'](_0x4f4229[_0x81db('0x2b')],_0xcc44c6[_0x81db('0x2e')]));if(_0x497c62[_0x81db('0x2c')]){if(_0x497c62[_0x81db('0x2d')]){_0x497c62[_0x81db('0x2d')]=moment(_0x497c62[_0x81db('0x2d')])[_0x81db('0x37')](0x1,_0x81db('0x38'));}else{_0x497c62['dateEnd']=moment(_0x497c62[_0x81db('0x2c')])[_0x81db('0x37')](0x1,_0x81db('0x38'));}_[_0x81db('0x39')](_0x1501f1[_0x81db('0x3a')],{'createdAt':{'$gte':_0x497c62[_0x81db('0x2c')],'$lte':_0x497c62[_0x81db('0x2d')]}});}if(_0x4f4229[_0x81db('0x2b')][_0x81db('0x3b')]){_0x1501f1['where']=_[_0x81db('0x39')](_0x1501f1[_0x81db('0x3a')],{'$or':_['map'](_0x41fae1,function(_0xea53a4){if(_0xea53a4['type']['key']!=='VIRTUAL'){var _0x5d42a2={};_0x5d42a2[_0xea53a4[_0x81db('0x3c')]]={'$like':'%'+_0x4f4229[_0x81db('0x2b')]['filter']+'%'};return _0x5d42a2;}})});}_0x1501f1=_[_0x81db('0x39')]({},_0x1501f1,_0x4f4229[_0x81db('0x3d')]);var _0x26b013={'where':_0x1501f1[_0x81db('0x3a')]};return db['AnalyticDefaultReport'][_0x81db('0x19')](_0x26b013)[_0x81db('0x20')](function(_0x3026c4){_0xaa9a0f[_0x81db('0x19')]=_0x3026c4;if(_0x4f4229[_0x81db('0x2b')]['includeAll']){_0x1501f1[_0x81db('0x3e')]=[{'all':!![]}];}return db[_0x81db('0x3f')][_0x81db('0x40')](_0x1501f1);})[_0x81db('0x20')](function(_0x26a356){_0xaa9a0f[_0x81db('0x41')]=_0x26a356;return _0xaa9a0f;})[_0x81db('0x20')](respondWithFilteredResult(_0x32a494,_0x1501f1))[_0x81db('0x42')](handleError(_0x32a494,null));};exports[_0x81db('0x43')]=function(_0x4d2dc8,_0x1fffd9){var _0x4e3bbb={'raw':!![],'where':{'id':_0x4d2dc8[_0x81db('0x44')]['id']}},_0x2a450c={};_0x2a450c[_0x81db('0x29')]=_[_0x81db('0x2a')](db[_0x81db('0x3f')][_0x81db('0x45')]);_0x2a450c[_0x81db('0x2b')]=_[_0x81db('0x2a')](_0x4d2dc8[_0x81db('0x2b')]);_0x2a450c['filters']=_['intersection'](_0x2a450c['model'],_0x2a450c[_0x81db('0x2b')]);_0x4e3bbb[_0x81db('0x30')]=_[_0x81db('0x2f')](_0x2a450c[_0x81db('0x29')],qs['fields'](_0x4d2dc8[_0x81db('0x2b')][_0x81db('0x31')]));_0x4e3bbb['attributes']=_0x4e3bbb[_0x81db('0x30')][_0x81db('0x32')]?_0x4e3bbb[_0x81db('0x30')]:_0x2a450c[_0x81db('0x29')];if(_0x4d2dc8[_0x81db('0x2b')]['includeAll']){_0x4e3bbb['include']=[{'all':!![]}];}_0x4e3bbb=_[_0x81db('0x39')]({},_0x4e3bbb,_0x4d2dc8['options']);return db[_0x81db('0x3f')][_0x81db('0x46')](_0x4e3bbb)[_0x81db('0x20')](handleEntityNotFound(_0x1fffd9,null))[_0x81db('0x20')](respondWithResult(_0x1fffd9,null))[_0x81db('0x42')](handleError(_0x1fffd9,null));};exports[_0x81db('0x47')]=function(_0x5d581d,_0xef6ff6){return db[_0x81db('0x3f')]['create'](_0x5d581d[_0x81db('0x48')],{})[_0x81db('0x20')](function(_0x15f97c){var _0x1f9bb2=_0x5d581d[_0x81db('0x49')]['get']({'plain':!![]});if(!_0x1f9bb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f9bb2[_0x81db('0x4a')]===_0x81db('0x49')){var _0x1b1329=_0x15f97c[_0x81db('0x22')]({'plain':!![]});var _0x2447a5=_0x81db('0x4b');return db[_0x81db('0x4c')][_0x81db('0x46')]({'where':{'name':_0x2447a5,'userProfileId':_0x1f9bb2[_0x81db('0x4d')]},'raw':!![]})[_0x81db('0x20')](function(_0x427dc6){if(_0x427dc6&&_0x427dc6[_0x81db('0x4e')]===0x0){return db[_0x81db('0x24')][_0x81db('0x47')]({'name':_0x1b1329['name'],'resourceId':_0x1b1329['id'],'type':_0x81db('0x23'),'sectionId':_0x427dc6['id']},{})['then'](function(){return _0x15f97c;});}else{return _0x15f97c;}})[_0x81db('0x42')](function(_0x120bf2){logger[_0x81db('0x4f')](_0x81db('0x50'),_0x120bf2);throw _0x120bf2;});}return _0x15f97c;})[_0x81db('0x20')](respondWithResult(_0xef6ff6,0xc9))[_0x81db('0x42')](handleError(_0xef6ff6,null));};exports[_0x81db('0x1f')]=function(_0x5dae92,_0x4b4842){if(_0x5dae92[_0x81db('0x48')]['id']){delete _0x5dae92[_0x81db('0x48')]['id'];}return db['AnalyticDefaultReport'][_0x81db('0x46')]({'where':{'id':_0x5dae92[_0x81db('0x44')]['id']}})[_0x81db('0x20')](handleEntityNotFound(_0x4b4842,null))[_0x81db('0x20')](saveUpdates(_0x5dae92[_0x81db('0x48')],null))[_0x81db('0x20')](respondWithResult(_0x4b4842,null))[_0x81db('0x42')](handleError(_0x4b4842,null));};exports[_0x81db('0x21')]=function(_0x22ed4c,_0x335194){return db[_0x81db('0x3f')][_0x81db('0x46')]({'where':{'id':_0x22ed4c[_0x81db('0x44')]['id']}})[_0x81db('0x20')](handleEntityNotFound(_0x335194,null))['then'](removeEntity(_0x335194,null))['catch'](handleError(_0x335194,null));};exports[_0x81db('0x51')]=function(_0x51b1bd,_0x44aeca){var _0x1c0dba=0xa;var _0x10599b=[_0x81db('0x52'),_0x81db('0x53'),_0x81db('0x54'),'outer_join',_0x81db('0x55')];var _0x3682a7={'SUM':_0x81db('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x81db('0x57'),'MAX':_0x81db('0x58'),'MIN':_0x81db('0x59'),'AVG':_0x81db('0x5a'),'GROUP_CONCAT':_0x81db('0x5b'),'GROUP_CONCAT ASC':_0x81db('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x467b0b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x81db('0x5d'),'UNIX_TIMESTAMP':_0x81db('0x5e')};var _0x2b3f9e=function(_0x2b4c48){return!_[_0x81db('0x5f')]([_0x81db('0x60'),_0x81db('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2b4c48);};var _0x5aa110=function(_0x30375e){if(!_0x30375e||!_0x30375e[_0x81db('0x62')][_0x81db('0x32')]){return'';}for(var _0x3578a4='(',_0x49de55=0x0;_0x49de55<_0x30375e['rules'][_0x81db('0x32')];_0x49de55+=0x1){_0x49de55>0x0&&(_0x3578a4+='\x20'+_0x30375e['operator']+'\x20');_0x3578a4+=_0x30375e[_0x81db('0x62')][_0x49de55][_0x81db('0x63')]?_0x5aa110(_0x30375e[_0x81db('0x62')][_0x49de55][_0x81db('0x63')]):_0x30375e[_0x81db('0x62')][_0x49de55][_0x81db('0x3c')]+'\x20'+_0x30375e[_0x81db('0x62')][_0x49de55][_0x81db('0x64')]+(_0x2b3f9e(_0x30375e[_0x81db('0x62')][_0x49de55][_0x81db('0x64')])?'\x20'+_0x30375e[_0x81db('0x62')][_0x49de55]['value']:'');}return _0x3578a4+')';};var _0x32a7eb={'where':{'id':_0x51b1bd['params']['id']}},_0x3df23a,_0x2422c0,_0x54f98c,_0x920a55,_0x5cea20;_0x32a7eb=_[_0x81db('0x39')]({},_0x32a7eb,_0x51b1bd[_0x81db('0x3d')]);return db['AnalyticDefaultReport'][_0x81db('0x46')](_0x32a7eb)[_0x81db('0x20')](function(_0x29340e){if(_0x29340e){_0x3df23a=_0x29340e;return _0x29340e[_0x81db('0x65')]();}return null;})[_0x81db('0x20')](function(_0x26f687){if(_0x26f687){if(!_0x26f687['length']){throw new db[(_0x81db('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2422c0=_0x26f687;return db[_0x81db('0x67')][_0x81db('0x40')]({'raw':!![]});}return null;})['then'](function(_0x631396){if(_0x631396){_0x54f98c=_['keyBy'](_0x631396,'id');var _0x24d8fd;var _0x3c4717=squel[_0x81db('0x68')]();_0x3c4717[_0x81db('0x69')](_0x3df23a['table']);for(var _0x44b392=0x0;_0x44b392<_0x2422c0[_0x81db('0x32')];_0x44b392+=0x1){_0x24d8fd=_0x2422c0[_0x44b392][_0x81db('0x6a')]?_0x54f98c[_0x2422c0[_0x44b392][_0x81db('0x6a')]][_0x81db('0x6b')]:_0x2422c0[_0x44b392]['field'];_0x24d8fd=_0x2422c0[_0x44b392][_0x81db('0x6c')]?_[_0x81db('0x6d')](_0x3682a7[_0x2422c0[_0x44b392][_0x81db('0x6c')]],'%s',_0x24d8fd):_0x24d8fd;_0x24d8fd=_0x2422c0[_0x44b392][_0x81db('0x6e')]?_[_0x81db('0x6d')](_0x467b0b[_0x2422c0[_0x44b392][_0x81db('0x6e')]],'%s',_0x24d8fd):_0x24d8fd;if(_0x2422c0[_0x44b392][_0x81db('0x6f')]){_0x3c4717[_0x81db('0x63')](_0x24d8fd);}_0x2422c0[_0x44b392][_0x81db('0x70')]&&_0x3c4717['order'](_0x24d8fd,_0x2422c0[_0x44b392]['orderBy']===_0x81db('0x71')?![]:!![]);_0x3c4717[_0x81db('0x3c')](_0x24d8fd,_0x2422c0[_0x44b392][_0x81db('0x72')]||_0x24d8fd);}if(_0x3df23a[_0x81db('0x73')]){_0x3df23a[_0x81db('0x73')]=JSON[_0x81db('0x74')](_0x3df23a['joins']);for(var _0xfa00d1=0x0;_0xfa00d1<_0x3df23a['joins'][_0x81db('0x32')];_0xfa00d1+=0x1){if(_0x3df23a['joins'][_0xfa00d1][_0x81db('0x75')]&&_[_0x81db('0x5f')](_0x10599b,_0x3df23a[_0x81db('0x73')][_0xfa00d1][_0x81db('0x75')])&&_0x3df23a[_0x81db('0x73')][_0xfa00d1][_0x81db('0x76')]&&_0x3df23a[_0x81db('0x73')][_0xfa00d1][_0x81db('0x77')]&&_0x3df23a['joins'][_0xfa00d1][_0x81db('0x78')]){_0x3c4717[_0x3df23a[_0x81db('0x73')][_0xfa00d1]['type']](_0x3df23a['joins'][_0xfa00d1]['foreignTable'],null,util[_0x81db('0x6e')]('%s.%s\x20=\x20%s.%s',_0x3df23a['table'],_0x3df23a['joins'][_0xfa00d1][_0x81db('0x76')],_0x3df23a[_0x81db('0x73')][_0xfa00d1]['foreignTable'],_0x3df23a[_0x81db('0x73')][_0xfa00d1]['foreignKey']));}}}if(_0x3df23a['conditions']){_0x3df23a[_0x81db('0x79')]=JSON[_0x81db('0x74')](_0x3df23a[_0x81db('0x79')]);_0x3c4717[_0x81db('0x3a')](_0x5aa110(_0x3df23a[_0x81db('0x79')]['group']));}_0x5cea20=_0x3c4717[_0x81db('0x7a')]();_0x3c4717[_0x81db('0x34')](_0x1c0dba);_0x3c4717[_0x81db('0x1a')](0x0);logger[_0x81db('0x7b')](_0x81db('0x7c'),_0x3c4717[_0x81db('0x7d')]());return db[_0x81db('0x7e')][_0x81db('0x2b')](_0x3c4717[_0x81db('0x7d')](),{'type':db[_0x81db('0x7e')]['QueryTypes'][_0x81db('0x7f')]});}})['then'](respondWithResult(_0x44aeca,null))[_0x81db('0x42')](handleError(_0x44aeca,null));};function runReport(_0x4d0f49,_0x4ce9b6,_0x5c67ea){var _0x4a50cb=_0x4ce9b6[_0x81db('0x26')];var _0x33fb99=0xa;var _0x37fc0c=['join',_0x81db('0x53'),'right_join',_0x81db('0x80'),'cross_join'];var _0x5247c4={'SUM':_0x81db('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x81db('0x58'),'MIN':_0x81db('0x59'),'AVG':_0x81db('0x5a'),'GROUP_CONCAT':_0x81db('0x5b'),'GROUP_CONCAT ASC':_0x81db('0x5c'),'GROUP_CONCAT DESC':_0x81db('0x81')};var _0x112d79={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x81db('0x82'),'HOUR':'HOUR(%s)','ROUND':_0x81db('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c7580=function(_0x440382){return!_['includes']([_0x81db('0x60'),_0x81db('0x61'),_0x81db('0x83'),'IS\x20NOT\x20EMPTY'],_0x440382);};var _0xd9d52e=function(_0x511405){if(!_0x511405||!_0x511405[_0x81db('0x62')][_0x81db('0x32')]){return'';}for(var _0x12efdc='(',_0x572b2e=0x0;_0x572b2e<_0x511405[_0x81db('0x62')][_0x81db('0x32')];_0x572b2e+=0x1){_0x572b2e>0x0&&(_0x12efdc+='\x20'+_0x511405[_0x81db('0x84')]+'\x20');_0x12efdc+=_0x511405[_0x81db('0x62')][_0x572b2e][_0x81db('0x63')]?_0xd9d52e(_0x511405['rules'][_0x572b2e][_0x81db('0x63')]):_0x511405['rules'][_0x572b2e]['field']+'\x20'+_0x511405['rules'][_0x572b2e][_0x81db('0x64')]+(_0x1c7580(_0x511405[_0x81db('0x62')][_0x572b2e][_0x81db('0x64')])?'\x20'+_0x511405[_0x81db('0x62')][_0x572b2e][_0x81db('0x85')]:'');}return _0x12efdc+')';};var _0x21d3c9={'where':{'id':_0x4d0f49['id']}},_0x6c3c84,_0x4933ef,_0x3bae34,_0x514bbb,_0x495069;_0x21d3c9=_[_0x81db('0x39')]({},_0x21d3c9,_0x5c67ea);return db[_0x81db('0x3f')]['find'](_0x21d3c9)[_0x81db('0x20')](function(_0x3e07a5){if(_0x3e07a5){_0x6c3c84=_0x3e07a5;return _0x3e07a5[_0x81db('0x65')]();}return null;})[_0x81db('0x20')](function(_0x5dcdb8){if(_0x5dcdb8){if(!_0x5dcdb8[_0x81db('0x32')]){throw new db[(_0x81db('0x66'))]['ValidationErrorItem'](_0x81db('0x86'),0x193);}_0x4933ef=_0x5dcdb8;return db['AnalyticMetric'][_0x81db('0x40')]({'raw':!![]});}return null;})[_0x81db('0x20')](function(_0x34ace8){if(_0x34ace8){_0x3bae34=_[_0x81db('0x87')](_0x34ace8,'id');var _0x2d98ec;var _0x12903d=squel[_0x81db('0x68')]();_0x12903d[_0x81db('0x69')](_0x6c3c84[_0x81db('0x88')]);for(var _0x239d88=0x0;_0x239d88<_0x4933ef['length'];_0x239d88+=0x1){_0x2d98ec=_0x4933ef[_0x239d88]['MetricId']?_0x3bae34[_0x4933ef[_0x239d88][_0x81db('0x6a')]][_0x81db('0x6b')]:_0x4933ef[_0x239d88][_0x81db('0x3c')];_0x2d98ec=_0x4933ef[_0x239d88][_0x81db('0x6c')]?_[_0x81db('0x6d')](_0x5247c4[_0x4933ef[_0x239d88][_0x81db('0x6c')]],'%s',_0x2d98ec):_0x2d98ec;_0x2d98ec=_0x4933ef[_0x239d88][_0x81db('0x6e')]?_[_0x81db('0x6d')](_0x112d79[_0x4933ef[_0x239d88][_0x81db('0x6e')]],'%s',_0x2d98ec):_0x2d98ec;if(_0x4933ef[_0x239d88]['groupBy']){_0x12903d['group'](_0x2d98ec);}_0x4933ef[_0x239d88]['orderBy']&&_0x12903d['order'](_0x2d98ec,_0x4933ef[_0x239d88][_0x81db('0x70')]===_0x81db('0x71')?![]:!![]);_0x12903d[_0x81db('0x3c')](_0x2d98ec,_0x4933ef[_0x239d88]['alias']||_0x2d98ec);}if(_0x6c3c84[_0x81db('0x73')]){_0x6c3c84[_0x81db('0x73')]=JSON['parse'](_0x6c3c84[_0x81db('0x73')]);for(var _0x3687e1=0x0;_0x3687e1<_0x6c3c84[_0x81db('0x73')][_0x81db('0x32')];_0x3687e1+=0x1){if(_0x6c3c84[_0x81db('0x73')][_0x3687e1][_0x81db('0x75')]&&_[_0x81db('0x5f')](_0x37fc0c,_0x6c3c84['joins'][_0x3687e1][_0x81db('0x75')])&&_0x6c3c84['joins'][_0x3687e1]['parentKey']&&_0x6c3c84[_0x81db('0x73')][_0x3687e1][_0x81db('0x77')]&&_0x6c3c84['joins'][_0x3687e1]['foreignKey']){_0x12903d[_0x6c3c84[_0x81db('0x73')][_0x3687e1]['type']](_0x6c3c84[_0x81db('0x73')][_0x3687e1][_0x81db('0x77')],null,util[_0x81db('0x6e')]('%s.%s\x20=\x20%s.%s',_0x6c3c84[_0x81db('0x88')],_0x6c3c84[_0x81db('0x73')][_0x3687e1][_0x81db('0x76')],_0x6c3c84[_0x81db('0x73')][_0x3687e1][_0x81db('0x77')],_0x6c3c84[_0x81db('0x73')][_0x3687e1][_0x81db('0x78')]));}}}if(_0x6c3c84['conditions']){_0x6c3c84['conditions']=JSON['parse'](_0x6c3c84[_0x81db('0x79')]);_0x12903d[_0x81db('0x3a')](_0xd9d52e(_0x6c3c84[_0x81db('0x79')][_0x81db('0x63')]));}_0x495069=_0x12903d[_0x81db('0x7a')]();_0x12903d[_0x81db('0x34')](_0x33fb99);_0x12903d['offset'](0x0);logger[_0x81db('0x7b')](_0x81db('0x7c'),_0x12903d[_0x81db('0x7d')]());return db[_0x81db('0x7e')]['query'](_0x12903d['toString'](),{'type':db[_0x81db('0x7e')][_0x81db('0x89')][_0x81db('0x7f')]});}})['then'](function(_0x2fbf33){if(!_0x2fbf33[_0x81db('0x32')]){throw new db[(_0x81db('0x66'))]['ValidationErrorItem'](_0x81db('0x8a'),0xcc);}if(_0x4ce9b6['output']===_0x81db('0x8b')){return null;}var _0x1b01cc=_[_0x81db('0x39')](_0x4ce9b6,{'name':_0x4ce9b6[_0x81db('0x8c')]||_0x4ce9b6[_0x81db('0x26')]||_0x6c3c84[_0x81db('0x26')],'basename':_0x4a50cb,'savename':util[_0x81db('0x6e')]('%s-%s.%s',_0x4ce9b6[_0x81db('0x26')]||_0x6c3c84[_0x81db('0x26')],require('randomstring')[_0x81db('0x8d')](0x4),_0x4ce9b6['output']||_0x81db('0x8e')),'reportId':_0x6c3c84['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x81db('0x47')](_0x1b01cc,{'raw':!![]});})[_0x81db('0x20')](function(_0x8cfff9){if(_0x6c3c84[_0x81db('0x88')]===_0x81db('0x8f')){_0x495069[_0x81db('0x3a')](_0x6c3c84['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4ce9b6[_0x81db('0x90')],_0x4ce9b6[_0x81db('0x91')]);}else{_0x495069[_0x81db('0x3a')](_0x6c3c84['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4ce9b6['startDate'],_0x4ce9b6[_0x81db('0x91')]);}if(_0x8cfff9){logger[_0x81db('0x92')](_0x81db('0x93'),_0x495069[_0x81db('0x7d')]());require(_0x81db('0x94'))['fork'](path[_0x81db('0x52')](__dirname,_0x81db('0x95'),_0x8cfff9[_0x81db('0x96')]),[_0x8cfff9['id'],_0x495069['toString'](),path[_0x81db('0x52')](__dirname,_0x81db('0x97'),_0x8cfff9[_0x81db('0x98')]),_0x4a50cb]);return _0x8cfff9;}else{var _0x17aaa1=squel[_0x81db('0x68')]();_0x17aaa1[_0x81db('0x69')]('('+_0x495069[_0x81db('0x7d')]()+')','countTable');_0x17aaa1[_0x81db('0x3c')](_0x81db('0x99'),'count');_0x495069['limit'](_0x4ce9b6[_0x81db('0x34')]||_0x33fb99);_0x495069['offset'](_0x4ce9b6[_0x81db('0x1a')]||0x0);return db[_0x81db('0x7e')][_0x81db('0x2b')](_0x17aaa1[_0x81db('0x7d')](),{'type':db['sequelize']['QueryTypes'][_0x81db('0x7f')]})['then'](function(_0x44e96a){if(!_0x44e96a[_0x81db('0x32')]){_0x514bbb=0x0;}else{_0x514bbb=_0x44e96a[0x0][_0x81db('0x19')]||0x0;}return db[_0x81db('0x7e')][_0x81db('0x2b')](_0x495069[_0x81db('0x7d')](),{'type':db[_0x81db('0x7e')][_0x81db('0x89')][_0x81db('0x7f')]});})[_0x81db('0x20')](function(_0x437af2){return{'rows':_0x437af2||[],'count':_0x514bbb};});}});}exports[_0x81db('0x9a')]=function(_0x4eb2c1,_0x14fa98){return runReport(_0x4eb2c1[_0x81db('0x44')],_0x4eb2c1[_0x81db('0x2b')],_0x4eb2c1[_0x81db('0x3d')])[_0x81db('0x20')](respondWithResult(_0x14fa98,null))[_0x81db('0x42')](handleError(_0x14fa98,null));};exports['runReport']=runReport;exports[_0x81db('0x2b')]=function(_0x431d2e,_0x5eac11){var _0x3d5f3d=0xa;var _0x72adf5=['join',_0x81db('0x53'),'right_join',_0x81db('0x80'),_0x81db('0x55')];var _0x295e54={'SUM':_0x81db('0x56'),'COUNT':_0x81db('0x9b'),'COUNT DISTINCT':_0x81db('0x57'),'MAX':'MAX(%s)','MIN':_0x81db('0x59'),'AVG':_0x81db('0x5a'),'GROUP_CONCAT':_0x81db('0x5b'),'GROUP_CONCAT ASC':_0x81db('0x5c'),'GROUP_CONCAT DESC':_0x81db('0x81')};var _0x3e2b76={'SEC_TO_TIME':_0x81db('0x9c'),'DATE':_0x81db('0x82'),'HOUR':_0x81db('0x9d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5eda4a=function(_0x4f34f8){return!_[_0x81db('0x5f')](['IS\x20NULL',_0x81db('0x61'),_0x81db('0x83'),_0x81db('0x9e')],_0x4f34f8);};var _0x49ce80=function(_0x1f7a89){if(!_0x1f7a89||!_0x1f7a89[_0x81db('0x62')]['length']){return'';}for(var _0x4f16b4='(',_0x5ad8a6=0x0;_0x5ad8a6<_0x1f7a89[_0x81db('0x62')][_0x81db('0x32')];_0x5ad8a6+=0x1){_0x5ad8a6>0x0&&(_0x4f16b4+='\x20'+_0x1f7a89[_0x81db('0x84')]+'\x20');_0x4f16b4+=_0x1f7a89[_0x81db('0x62')][_0x5ad8a6][_0x81db('0x63')]?_0x49ce80(_0x1f7a89[_0x81db('0x62')][_0x5ad8a6]['group']):_0x1f7a89[_0x81db('0x62')][_0x5ad8a6][_0x81db('0x3c')]+'\x20'+_0x1f7a89[_0x81db('0x62')][_0x5ad8a6]['condition']+(_0x5eda4a(_0x1f7a89['rules'][_0x5ad8a6][_0x81db('0x64')])?'\x20'+_0x1f7a89['rules'][_0x5ad8a6][_0x81db('0x85')]:'');}return _0x4f16b4+')';};var _0x528a4c={'where':{'id':_0x431d2e['params']['id']}},_0x441c18,_0x2193cd,_0x55c22c,_0x1f78ad,_0x4a9428;_0x528a4c=_[_0x81db('0x39')]({},_0x528a4c,_0x431d2e[_0x81db('0x3d')]);return db[_0x81db('0x3f')][_0x81db('0x46')](_0x528a4c)[_0x81db('0x20')](function(_0x1edfa1){if(_0x1edfa1){_0x441c18=_0x1edfa1;return _0x1edfa1['getFields']();}return null;})[_0x81db('0x20')](function(_0x440f60){if(_0x440f60){if(!_0x440f60[_0x81db('0x32')]){throw new db[(_0x81db('0x66'))]['ValidationErrorItem'](_0x81db('0x86'),0x193);}_0x2193cd=_0x440f60;return db[_0x81db('0x67')][_0x81db('0x40')]({'raw':!![]});}return null;})[_0x81db('0x20')](function(_0x110841){if(_0x110841){_0x55c22c=_[_0x81db('0x87')](_0x110841,'id');var _0x4b678d;var _0x39cc66=squel[_0x81db('0x68')]();_0x39cc66['from'](_0x441c18['table']);for(var _0x194688=0x0;_0x194688<_0x2193cd[_0x81db('0x32')];_0x194688+=0x1){_0x4b678d=_0x2193cd[_0x194688]['MetricId']?_0x55c22c[_0x2193cd[_0x194688][_0x81db('0x6a')]][_0x81db('0x6b')]:_0x2193cd[_0x194688][_0x81db('0x3c')];_0x4b678d=_0x2193cd[_0x194688][_0x81db('0x6c')]?_['replace'](_0x295e54[_0x2193cd[_0x194688]['function']],'%s',_0x4b678d):_0x4b678d;_0x4b678d=_0x2193cd[_0x194688][_0x81db('0x6e')]?_[_0x81db('0x6d')](_0x3e2b76[_0x2193cd[_0x194688][_0x81db('0x6e')]],'%s',_0x4b678d):_0x4b678d;if(_0x2193cd[_0x194688][_0x81db('0x6f')]){_0x39cc66[_0x81db('0x63')](_0x4b678d);}_0x2193cd[_0x194688][_0x81db('0x70')]&&_0x39cc66[_0x81db('0x35')](_0x4b678d,_0x2193cd[_0x194688][_0x81db('0x70')]===_0x81db('0x71')?![]:!![]);_0x39cc66[_0x81db('0x3c')](_0x4b678d,_0x2193cd[_0x194688]['alias']||_0x4b678d);}if(_0x441c18['joins']){_0x441c18[_0x81db('0x73')]=JSON[_0x81db('0x74')](_0x441c18[_0x81db('0x73')]);for(var _0x2a8198=0x0;_0x2a8198<_0x441c18['joins'][_0x81db('0x32')];_0x2a8198+=0x1){if(_0x441c18[_0x81db('0x73')][_0x2a8198]['type']&&_['includes'](_0x72adf5,_0x441c18[_0x81db('0x73')][_0x2a8198][_0x81db('0x75')])&&_0x441c18[_0x81db('0x73')][_0x2a8198][_0x81db('0x76')]&&_0x441c18[_0x81db('0x73')][_0x2a8198][_0x81db('0x77')]&&_0x441c18[_0x81db('0x73')][_0x2a8198][_0x81db('0x78')]){_0x39cc66[_0x441c18[_0x81db('0x73')][_0x2a8198]['type']](_0x441c18[_0x81db('0x73')][_0x2a8198]['foreignTable'],null,util[_0x81db('0x6e')](_0x81db('0x9f'),_0x441c18[_0x81db('0x88')],_0x441c18[_0x81db('0x73')][_0x2a8198][_0x81db('0x76')],_0x441c18[_0x81db('0x73')][_0x2a8198][_0x81db('0x77')],_0x441c18[_0x81db('0x73')][_0x2a8198][_0x81db('0x78')]));}}}if(_0x441c18['conditions']){_0x441c18[_0x81db('0x79')]=JSON['parse'](_0x441c18['conditions']);_0x39cc66['where'](_0x49ce80(_0x441c18[_0x81db('0x79')]['group']));}_0x4a9428=_0x39cc66[_0x81db('0x7a')]();_0x39cc66[_0x81db('0x34')](_0x3d5f3d);_0x39cc66[_0x81db('0x1a')](0x0);logger['debug'](_0x81db('0x7c'),_0x39cc66[_0x81db('0x7d')]());return db[_0x81db('0x7e')][_0x81db('0x2b')](_0x39cc66[_0x81db('0x7d')](),{'type':db[_0x81db('0x7e')]['QueryTypes'][_0x81db('0x7f')]});}})[_0x81db('0x20')](function(){return{'sql':_0x4a9428['toString']()};})[_0x81db('0x20')](respondWithResult(_0x5eac11,null))[_0x81db('0x42')](handleError(_0x5eac11,null));};
\ No newline at end of file
index 50a596c..b503ee8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x651c=['request-promise','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x651c,0xcd));var _0xc651=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x651c[_0x1a3e23];return _0x5ee0d8;};'use strict';var _=require('lodash');var util=require(_0xc651('0x0'));var logger=require(_0xc651('0x1'))(_0xc651('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc651('0x3'));var attributes=require(_0xc651('0x4'));module['exports']=function(_0x355ad6,_0x58124a){return _0x355ad6[_0xc651('0x5')](_0xc651('0x6'),attributes,{'tableName':_0xc651('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x43b7=['moment','bluebird','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','api'];(function(_0x1c018b,_0x20b55a){var _0x2b8c90=function(_0x2663e5){while(--_0x2663e5){_0x1c018b['push'](_0x1c018b['shift']());}};_0x2b8c90(++_0x20b55a);}(_0x43b7,0xd8));var _0x743b=function(_0x291742,_0x1db208){_0x291742=_0x291742-0x0;var _0x572d16=_0x43b7[_0x291742];return _0x572d16;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x743b('0x0'));var moment=require(_0x743b('0x1'));var BPromise=require(_0x743b('0x2'));var rp=require('request-promise');var attributes=require(_0x743b('0x3'));module[_0x743b('0x4')]=function(_0x2dbbd0,_0x4d95f8){return _0x2dbbd0['define'](_0x743b('0x5'),attributes,{'tableName':_0x743b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ca61c6e..534309a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x410a8d,_0x287518){var _0x217d64=function(_0xa18f5b){while(--_0xa18f5b){_0x410a8d['push'](_0x410a8d['shift']());}};_0x217d64(++_0x287518);}(_0x34e8,0x12c));var _0x834e=function(_0x43443f,_0x498658){_0x43443f=_0x43443f-0x0;var _0x5b60dd=_0x34e8[_0x43443f];return _0x5b60dd;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}
\ No newline at end of file
+var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','AnalyticDefaultReport,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x4cb545,_0x20d740){var _0xcf0eed=function(_0x1cceb5){while(--_0x1cceb5){_0x4cb545['push'](_0x4cb545['shift']());}};_0xcf0eed(++_0x20d740);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
index 15c2b72..933667f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a37=['query','post','create','delete','util','path','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/preview','run','/:id/query'];(function(_0x234869,_0x25ce29){var _0xdc5c37=function(_0x1bb15a){while(--_0x1bb15a){_0x234869['push'](_0x234869['shift']());}};_0xdc5c37(++_0x25ce29);}(_0x2a37,0x8c));var _0x72a3=function(_0x571dee,_0x45f87a){_0x571dee=_0x571dee-0x0;var _0x4c7672=_0x2a37[_0x571dee];return _0x4c7672;};'use strict';var multer=require('multer');var util=require(_0x72a3('0x0'));var path=require(_0x72a3('0x1'));var timeout=require('connect-timeout');var express=require(_0x72a3('0x2'));var router=express['Router']();var auth=require(_0x72a3('0x3'));var interaction=require(_0x72a3('0x4'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x72a3('0x5')](),controller[_0x72a3('0x6')]);router[_0x72a3('0x7')](_0x72a3('0x8'),auth[_0x72a3('0x5')](),controller[_0x72a3('0x9')]);router[_0x72a3('0x7')](_0x72a3('0xa'),auth[_0x72a3('0x5')](),controller['preview']);router[_0x72a3('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0x72a3('0xb')]);router[_0x72a3('0x7')](_0x72a3('0xc'),auth[_0x72a3('0x5')](),controller[_0x72a3('0xd')]);router[_0x72a3('0xe')]('/',auth['isAuthenticated'](),controller[_0x72a3('0xf')]);router['put']('/:id',auth[_0x72a3('0x5')](),controller['update']);router[_0x72a3('0x10')](_0x72a3('0x8'),auth[_0x72a3('0x5')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x641c=['put','update','destroy','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/preview','/:id/run','run','/:id/query','query','post','create'];(function(_0x22ec0a,_0x4a4e15){var _0x46ea22=function(_0x2153f1){while(--_0x2153f1){_0x22ec0a['push'](_0x22ec0a['shift']());}};_0x46ea22(++_0x4a4e15);}(_0x641c,0x67));var _0xc641=function(_0x3d24ce,_0x129987){_0x3d24ce=_0x3d24ce-0x0;var _0x1c1388=_0x641c[_0x3d24ce];return _0x1c1388;};'use strict';var multer=require(_0xc641('0x0'));var util=require(_0xc641('0x1'));var path=require(_0xc641('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xc641('0x3'));var interaction=require(_0xc641('0x4'));var config=require(_0xc641('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0xc641('0x6')]('/',auth[_0xc641('0x7')](),controller[_0xc641('0x8')]);router[_0xc641('0x6')](_0xc641('0x9'),auth[_0xc641('0x7')](),controller['show']);router[_0xc641('0x6')](_0xc641('0xa'),auth[_0xc641('0x7')](),controller['preview']);router['get'](_0xc641('0xb'),auth[_0xc641('0x7')](),controller[_0xc641('0xc')]);router[_0xc641('0x6')](_0xc641('0xd'),auth[_0xc641('0x7')](),controller[_0xc641('0xe')]);router[_0xc641('0xf')]('/',auth[_0xc641('0x7')](),controller[_0xc641('0x10')]);router[_0xc641('0x11')](_0xc641('0x9'),auth[_0xc641('0x7')](),controller[_0xc641('0x12')]);router['delete']('/:id',auth[_0xc641('0x7')](),controller[_0xc641('0x13')]);module['exports']=router;
\ No newline at end of file
index d0674fe..d8b2607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb381=['scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual'];(function(_0x509316,_0x3b5d9d){var _0x53ac3b=function(_0x1bfa43){while(--_0x1bfa43){_0x509316['push'](_0x509316['shift']());}};_0x53ac3b(++_0x3b5d9d);}(_0xb381,0x1d7));var _0x1b38=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb381[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1b38('0x0'));module[_0x1b38('0x1')]={'name':{'type':Sequelize[_0x1b38('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1b38('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1b38('0x3')](_0x1b38('0x4'),_0x1b38('0x5'),_0x1b38('0x6')),'allowNull':![],'defaultValue':_0x1b38('0x4')},'savename':{'type':Sequelize[_0x1b38('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1b38('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x1b38('0x3')](_0x1b38('0x8'),_0x1b38('0x9')),'allowNull':![],'defaultValue':_0x1b38('0x8')},'reportId':{'type':Sequelize[_0x1b38('0xa')](0xb)[_0x1b38('0xb')]},'reportType':{'type':Sequelize[_0x1b38('0x2')]}};
\ No newline at end of file
+var _0x7518=['UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading','ENUM','scheduled'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x7518,0x182));var _0x8751=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x7518[_0x5cd51d];return _0x444608;};'use strict';var Sequelize=require(_0x8751('0x0'));var moment=require(_0x8751('0x1'));module[_0x8751('0x2')]={'name':{'type':Sequelize[_0x8751('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8751('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8751('0x4'),_0x8751('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x8751('0x4')},'savename':{'type':Sequelize[_0x8751('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8751('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8751('0x3')],'defaultValue':_0x8751('0x7')},'type':{'type':Sequelize[_0x8751('0x8')]('manual',_0x8751('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8751('0xa')]},'reportType':{'type':Sequelize[_0x8751('0x3')]}};
\ No newline at end of file
index f7748de..68dd88c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee6=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','error','stack','send','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','day','add','filter','merge','type','key','VIRTUAL','field','options','AnalyticExtractedReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','existsSync','join','root','savename','Sequelize','ValidationError','exists','server/files/reports','%s.%s','output','toLowerCase','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x1ad8a5,_0x27a970){var _0x491915=function(_0x5ac715){while(--_0x5ac715){_0x1ad8a5['push'](_0x1ad8a5['shift']());}};_0x491915(++_0x27a970);}(_0xaee6,0x1d9));var _0x6aee=function(_0x25643d,_0xaf8d77){_0x25643d=_0x25643d-0x0;var _0x9eb397=_0xaee6[_0x25643d];return _0x9eb397;};'use strict';var pdf=require(_0x6aee('0x0'));var emlformat=require(_0x6aee('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6aee('0x2'));var rp=require(_0x6aee('0x3'));var moment=require('moment');var BPromise=require(_0x6aee('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6aee('0x5'));var sox=require(_0x6aee('0x6'));var csv=require(_0x6aee('0x7'));var ejs=require(_0x6aee('0x8'));var fs=require('fs');var _=require(_0x6aee('0x9'));var squel=require(_0x6aee('0xa'));var crypto=require(_0x6aee('0xb'));var jsforce=require(_0x6aee('0xc'));var deskjs=require(_0x6aee('0xd'));var toCsv=require(_0x6aee('0x7'));var querystring=require(_0x6aee('0xe'));var Papa=require(_0x6aee('0xf'));var Redis=require(_0x6aee('0x10'));var qs=require(_0x6aee('0x11'));var logger=require(_0x6aee('0x12'))(_0x6aee('0x13'));var utils=require(_0x6aee('0x14'));var config=require(_0x6aee('0x15'));var db=require(_0x6aee('0x16'))['db'];function respondWithStatusCode(_0x1c50a8,_0x600d2d){_0x600d2d=_0x600d2d||0xcc;return function(_0x557253){if(_0x557253){return _0x1c50a8[_0x6aee('0x17')](_0x600d2d);}return _0x1c50a8[_0x6aee('0x18')](_0x600d2d)[_0x6aee('0x19')]();};}function respondWithResult(_0x4bf6e2,_0x2b68fc){_0x2b68fc=_0x2b68fc||0xc8;return function(_0x26b64f){if(_0x26b64f){return _0x4bf6e2['status'](_0x2b68fc)[_0x6aee('0x1a')](_0x26b64f);}};}function respondWithFilteredResult(_0x4c947c,_0x381d58){return function(_0x857c79){if(_0x857c79){var _0x2bbe0a=_0x857c79[_0x6aee('0x1b')],_0x577fcd=_0x381d58['offset'],_0x4b737d=_0x381d58[_0x6aee('0x1c')]+_0x381d58[_0x6aee('0x1d')],_0x4c4254;if(_0x4b737d>=_0x2bbe0a){_0x4b737d=_0x2bbe0a;_0x4c4254=0xc8;}else{_0x4c4254=0xce;}_0x4c947c['status'](_0x4c4254);return _0x4c947c[_0x6aee('0x1e')](_0x6aee('0x1f'),_0x577fcd+'-'+_0x4b737d+'/'+_0x2bbe0a)[_0x6aee('0x1a')](_0x857c79);}return null;};}function patchUpdates(_0x160448){return function(_0x55da30){try{jsonpatch[_0x6aee('0x20')](_0x55da30,_0x160448,!![]);}catch(_0x26bb37){return BPromise[_0x6aee('0x21')](_0x26bb37);}return _0x55da30[_0x6aee('0x22')]();};}function saveUpdates(_0x106eed,_0x288ec3){return function(_0x3c92f8){if(_0x3c92f8){return _0x3c92f8[_0x6aee('0x23')](_0x106eed)[_0x6aee('0x24')](function(_0xfdda7f){return _0xfdda7f;});}return null;};}function removeEntity(_0x66cad6,_0x4da6ad){return function(_0x8463a7){if(_0x8463a7){return _0x8463a7[_0x6aee('0x25')]()[_0x6aee('0x24')](function(){var _0x500cb1=_0x8463a7[_0x6aee('0x26')]({'plain':!![]});var _0x58e9cd=_0x6aee('0x27');return db['UserProfileResource'][_0x6aee('0x25')]({'where':{'type':_0x58e9cd,'resourceId':_0x500cb1['id']}})['then'](function(){return _0x8463a7;});})[_0x6aee('0x24')](function(){_0x66cad6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc3223,_0x1afa01){return function(_0x66454){if(!_0x66454){_0xbc3223[_0x6aee('0x17')](0x194);}return _0x66454;};}function handleError(_0x3c1ecb,_0x9d161){_0x9d161=_0x9d161||0x1f4;return function(_0x5724d7){logger[_0x6aee('0x28')](_0x5724d7[_0x6aee('0x29')]);if(_0x5724d7['name']){delete _0x5724d7['name'];}_0x3c1ecb[_0x6aee('0x18')](_0x9d161)[_0x6aee('0x2a')](_0x5724d7);};}exports['index']=function(_0x90b2dc,_0x4c03e3){var _0x386ad3={},_0x3611d4={},_0xd17624={'count':0x0,'rows':[]};var _0x316e9c=db['AnalyticExtractedReport'][_0x6aee('0x2b')];_0x3611d4[_0x6aee('0x2c')]=_[_0x6aee('0x2d')](_0x316e9c);var _0x3534b0={'dateStart':_0x90b2dc['query'][_0x6aee('0x2e')],'dateEnd':_0x90b2dc[_0x6aee('0x2f')][_0x6aee('0x30')]};delete _0x90b2dc['query'][_0x6aee('0x2e')];delete _0x90b2dc[_0x6aee('0x2f')][_0x6aee('0x30')];_0x3611d4[_0x6aee('0x2f')]=_[_0x6aee('0x2d')](_0x90b2dc[_0x6aee('0x2f')]);_0x3611d4[_0x6aee('0x31')]=_[_0x6aee('0x32')](_0x3611d4[_0x6aee('0x2c')],_0x3611d4['query']);_0x386ad3[_0x6aee('0x33')]=_['intersection'](_0x3611d4[_0x6aee('0x2c')],qs[_0x6aee('0x34')](_0x90b2dc[_0x6aee('0x2f')]['fields']));_0x386ad3['attributes']=_0x386ad3[_0x6aee('0x33')][_0x6aee('0x35')]?_0x386ad3[_0x6aee('0x33')]:_0x3611d4[_0x6aee('0x2c')];if(!_0x90b2dc['query'][_0x6aee('0x36')](_0x6aee('0x37'))){_0x386ad3[_0x6aee('0x1d')]=qs['limit'](_0x90b2dc[_0x6aee('0x2f')][_0x6aee('0x1d')]);_0x386ad3['offset']=qs[_0x6aee('0x1c')](_0x90b2dc['query'][_0x6aee('0x1c')]);}_0x386ad3['order']=qs[_0x6aee('0x38')](_0x90b2dc['query'][_0x6aee('0x38')]);_0x386ad3[_0x6aee('0x39')]=qs[_0x6aee('0x31')](_[_0x6aee('0x3a')](_0x90b2dc['query'],_0x3611d4[_0x6aee('0x31')]));if(_0x3534b0[_0x6aee('0x2e')]){if(_0x3534b0['dateEnd']){_0x3534b0['dateEnd']=moment(_0x3534b0[_0x6aee('0x30')])['add'](0x1,_0x6aee('0x3b'));}else{_0x3534b0['dateEnd']=moment(_0x3534b0['dateStart'])[_0x6aee('0x3c')](0x1,_0x6aee('0x3b'));}_['merge'](_0x386ad3[_0x6aee('0x39')],{'createdAt':{'$gte':_0x3534b0['dateStart'],'$lte':_0x3534b0[_0x6aee('0x30')]}});}if(_0x90b2dc[_0x6aee('0x2f')][_0x6aee('0x3d')]){_0x386ad3[_0x6aee('0x39')]=_[_0x6aee('0x3e')](_0x386ad3[_0x6aee('0x39')],{'$or':_['map'](_0x316e9c,function(_0x383fe4){if(_0x383fe4[_0x6aee('0x3f')][_0x6aee('0x40')]!==_0x6aee('0x41')){var _0x1bb783={};_0x1bb783[_0x383fe4[_0x6aee('0x42')]]={'$like':'%'+_0x90b2dc[_0x6aee('0x2f')]['filter']+'%'};return _0x1bb783;}})});}_0x386ad3=_[_0x6aee('0x3e')]({},_0x386ad3,_0x90b2dc[_0x6aee('0x43')]);var _0x1536a6={'where':_0x386ad3[_0x6aee('0x39')]};return db[_0x6aee('0x44')][_0x6aee('0x1b')](_0x1536a6)[_0x6aee('0x24')](function(_0x18461e){_0xd17624[_0x6aee('0x1b')]=_0x18461e;if(_0x90b2dc[_0x6aee('0x2f')]['includeAll']){_0x386ad3[_0x6aee('0x45')]=[{'all':!![]}];}return db[_0x6aee('0x44')][_0x6aee('0x46')](_0x386ad3);})[_0x6aee('0x24')](function(_0x262659){_0xd17624[_0x6aee('0x47')]=_0x262659;return _0xd17624;})[_0x6aee('0x24')](respondWithFilteredResult(_0x4c03e3,_0x386ad3))[_0x6aee('0x48')](handleError(_0x4c03e3,null));};exports[_0x6aee('0x49')]=function(_0x44084e,_0x546c14){var _0x54ae54={'raw':!![],'where':{'id':_0x44084e[_0x6aee('0x4a')]['id']}},_0xeb020a={};_0xeb020a[_0x6aee('0x2c')]=_[_0x6aee('0x2d')](db[_0x6aee('0x44')][_0x6aee('0x2b')]);_0xeb020a[_0x6aee('0x2f')]=_[_0x6aee('0x2d')](_0x44084e['query']);_0xeb020a['filters']=_['intersection'](_0xeb020a[_0x6aee('0x2c')],_0xeb020a[_0x6aee('0x2f')]);_0x54ae54[_0x6aee('0x33')]=_[_0x6aee('0x32')](_0xeb020a[_0x6aee('0x2c')],qs[_0x6aee('0x34')](_0x44084e[_0x6aee('0x2f')][_0x6aee('0x34')]));_0x54ae54[_0x6aee('0x33')]=_0x54ae54[_0x6aee('0x33')][_0x6aee('0x35')]?_0x54ae54[_0x6aee('0x33')]:_0xeb020a[_0x6aee('0x2c')];if(_0x44084e['query'][_0x6aee('0x4b')]){_0x54ae54['include']=[{'all':!![]}];}_0x54ae54=_[_0x6aee('0x3e')]({},_0x54ae54,_0x44084e[_0x6aee('0x43')]);return db[_0x6aee('0x44')][_0x6aee('0x4c')](_0x54ae54)[_0x6aee('0x24')](handleEntityNotFound(_0x546c14,null))[_0x6aee('0x24')](respondWithResult(_0x546c14,null))[_0x6aee('0x48')](handleError(_0x546c14,null));};exports[_0x6aee('0x4d')]=function(_0x12e48b,_0x3dd455){return db[_0x6aee('0x44')][_0x6aee('0x4d')](_0x12e48b[_0x6aee('0x4e')],{})['then'](function(_0x40f5b5){var _0x35b993=_0x12e48b[_0x6aee('0x4f')][_0x6aee('0x26')]({'plain':!![]});if(!_0x35b993)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35b993[_0x6aee('0x50')]===_0x6aee('0x4f')){var _0x4c4504=_0x40f5b5[_0x6aee('0x26')]({'plain':!![]});var _0x35a5aa=_0x6aee('0x27');return db[_0x6aee('0x51')][_0x6aee('0x4c')]({'where':{'name':_0x35a5aa,'userProfileId':_0x35b993[_0x6aee('0x52')]},'raw':!![]})[_0x6aee('0x24')](function(_0x488556){if(_0x488556&&_0x488556[_0x6aee('0x53')]===0x0){return db[_0x6aee('0x54')][_0x6aee('0x4d')]({'name':_0x4c4504[_0x6aee('0x55')],'resourceId':_0x4c4504['id'],'type':_0x488556[_0x6aee('0x55')],'sectionId':_0x488556['id']},{})[_0x6aee('0x24')](function(){return _0x40f5b5;});}else{return _0x40f5b5;}})[_0x6aee('0x48')](function(_0x1e8097){logger[_0x6aee('0x28')](_0x6aee('0x56'),_0x1e8097);throw _0x1e8097;});}return _0x40f5b5;})[_0x6aee('0x24')](respondWithResult(_0x3dd455,0xc9))[_0x6aee('0x48')](handleError(_0x3dd455,null));};exports[_0x6aee('0x23')]=function(_0x430d33,_0x33214b){if(_0x430d33[_0x6aee('0x4e')]['id']){delete _0x430d33[_0x6aee('0x4e')]['id'];}return db[_0x6aee('0x44')]['find']({'where':{'id':_0x430d33['params']['id']}})[_0x6aee('0x24')](handleEntityNotFound(_0x33214b,null))[_0x6aee('0x24')](saveUpdates(_0x430d33[_0x6aee('0x4e')],null))[_0x6aee('0x24')](respondWithResult(_0x33214b,null))[_0x6aee('0x48')](handleError(_0x33214b,null));};exports[_0x6aee('0x25')]=function(_0x356cd6,_0x5fb572){return db[_0x6aee('0x44')][_0x6aee('0x4c')]({'where':{'id':_0x356cd6[_0x6aee('0x4a')]['id']}})[_0x6aee('0x24')](handleEntityNotFound(_0x5fb572,null))[_0x6aee('0x24')](removeEntity(_0x5fb572,null))[_0x6aee('0x48')](handleError(_0x5fb572,null));};exports[_0x6aee('0x57')]=function(_0x3d7871,_0x5c2a12,_0x569a8d){return db[_0x6aee('0x44')]['find']({'where':{'id':_0x3d7871[_0x6aee('0x4a')]['id']},'attributes':[_0x6aee('0x55'),_0x6aee('0x58'),'savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x5c2a12,null))[_0x6aee('0x24')](function(_0x175f9b){if(_0x175f9b){if(!fs[_0x6aee('0x59')](path[_0x6aee('0x5a')](config[_0x6aee('0x5b')],'server/files/reports',_0x175f9b[_0x6aee('0x5c')]))){throw new db[(_0x6aee('0x5d'))][(_0x6aee('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3d7871['query'][_0x6aee('0x5f')]){return _0x5c2a12[_0x6aee('0x17')](0xc8);}return _0x5c2a12[_0x6aee('0x57')](path[_0x6aee('0x5a')](config[_0x6aee('0x5b')],_0x6aee('0x60'),_0x175f9b['savename']),util['format'](_0x6aee('0x61'),_0x175f9b[_0x6aee('0x58')]||_0x175f9b[_0x6aee('0x55')],_0x175f9b[_0x6aee('0x62')][_0x6aee('0x63')]()));}})[_0x6aee('0x48')](handleError(_0x5c2a12,null));};
\ No newline at end of file
+var _0x7ee6=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','ExtractedReports','error','name','send','index','AnalyticExtractedReport','model','keys','query','dateStart','dateEnd','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','add','day','filter','merge','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','exists','format','%s.%s','basename','toLowerCase','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs'];(function(_0x54bb52,_0x219bdf){var _0x56bb73=function(_0x31590a){while(--_0x31590a){_0x54bb52['push'](_0x54bb52['shift']());}};_0x56bb73(++_0x219bdf);}(_0x7ee6,0x112));var _0x67ee=function(_0x25e430,_0x2f5406){_0x25e430=_0x25e430-0x0;var _0x2d9c41=_0x7ee6[_0x25e430];return _0x2d9c41;};'use strict';var pdf=require(_0x67ee('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x67ee('0x1'));var jsonpatch=require(_0x67ee('0x2'));var rp=require(_0x67ee('0x3'));var moment=require(_0x67ee('0x4'));var BPromise=require(_0x67ee('0x5'));var Mustache=require(_0x67ee('0x6'));var util=require('util');var path=require(_0x67ee('0x7'));var sox=require('sox');var csv=require(_0x67ee('0x8'));var ejs=require(_0x67ee('0x9'));var fs=require('fs');var _=require(_0x67ee('0xa'));var squel=require(_0x67ee('0xb'));var crypto=require(_0x67ee('0xc'));var jsforce=require(_0x67ee('0xd'));var deskjs=require(_0x67ee('0xe'));var toCsv=require(_0x67ee('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x67ee('0xf'));var qs=require(_0x67ee('0x10'));var logger=require(_0x67ee('0x11'))(_0x67ee('0x12'));var utils=require(_0x67ee('0x13'));var config=require(_0x67ee('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe9e94a,_0xecd8d){_0xecd8d=_0xecd8d||0xcc;return function(_0x5dbc47){if(_0x5dbc47){return _0xe9e94a[_0x67ee('0x15')](_0xecd8d);}return _0xe9e94a[_0x67ee('0x16')](_0xecd8d)[_0x67ee('0x17')]();};}function respondWithResult(_0xf67434,_0x48efb2){_0x48efb2=_0x48efb2||0xc8;return function(_0x55eb80){if(_0x55eb80){return _0xf67434['status'](_0x48efb2)[_0x67ee('0x18')](_0x55eb80);}};}function respondWithFilteredResult(_0x47f8a5,_0x23eb03){return function(_0xcf0200){if(_0xcf0200){var _0x5f08b7=_0xcf0200['count'],_0x2deab5=_0x23eb03[_0x67ee('0x19')],_0x52dcc1=_0x23eb03[_0x67ee('0x19')]+_0x23eb03[_0x67ee('0x1a')],_0x49b8f0;if(_0x52dcc1>=_0x5f08b7){_0x52dcc1=_0x5f08b7;_0x49b8f0=0xc8;}else{_0x49b8f0=0xce;}_0x47f8a5['status'](_0x49b8f0);return _0x47f8a5[_0x67ee('0x1b')](_0x67ee('0x1c'),_0x2deab5+'-'+_0x52dcc1+'/'+_0x5f08b7)[_0x67ee('0x18')](_0xcf0200);}return null;};}function patchUpdates(_0x55c550){return function(_0x216c73){try{jsonpatch[_0x67ee('0x1d')](_0x216c73,_0x55c550,!![]);}catch(_0x1b2b7f){return BPromise[_0x67ee('0x1e')](_0x1b2b7f);}return _0x216c73['save']();};}function saveUpdates(_0x242af2,_0x3191d0){return function(_0x4a9920){if(_0x4a9920){return _0x4a9920['update'](_0x242af2)[_0x67ee('0x1f')](function(_0x2b7df8){return _0x2b7df8;});}return null;};}function removeEntity(_0x519e70,_0x31b721){return function(_0x35e18c){if(_0x35e18c){return _0x35e18c[_0x67ee('0x20')]()[_0x67ee('0x1f')](function(){var _0x2668d6=_0x35e18c[_0x67ee('0x21')]({'plain':!![]});var _0x45985b=_0x67ee('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x45985b,'resourceId':_0x2668d6['id']}})[_0x67ee('0x1f')](function(){return _0x35e18c;});})['then'](function(){_0x519e70['status'](0xcc)[_0x67ee('0x17')]();});}};}function handleEntityNotFound(_0x4a1874,_0x101f07){return function(_0x39b1c0){if(!_0x39b1c0){_0x4a1874[_0x67ee('0x15')](0x194);}return _0x39b1c0;};}function handleError(_0x505f95,_0x2ad369){_0x2ad369=_0x2ad369||0x1f4;return function(_0x1ef346){logger[_0x67ee('0x23')](_0x1ef346['stack']);if(_0x1ef346['name']){delete _0x1ef346[_0x67ee('0x24')];}_0x505f95[_0x67ee('0x16')](_0x2ad369)[_0x67ee('0x25')](_0x1ef346);};}exports[_0x67ee('0x26')]=function(_0x3d9108,_0x142feb){var _0x3278a6={},_0x2586fd={},_0x58652d={'count':0x0,'rows':[]};var _0x5258e3=db[_0x67ee('0x27')]['rawAttributes'];_0x2586fd[_0x67ee('0x28')]=_[_0x67ee('0x29')](_0x5258e3);var _0x29898a={'dateStart':_0x3d9108[_0x67ee('0x2a')][_0x67ee('0x2b')],'dateEnd':_0x3d9108[_0x67ee('0x2a')][_0x67ee('0x2c')]};delete _0x3d9108[_0x67ee('0x2a')][_0x67ee('0x2b')];delete _0x3d9108[_0x67ee('0x2a')][_0x67ee('0x2c')];_0x2586fd['query']=_[_0x67ee('0x29')](_0x3d9108[_0x67ee('0x2a')]);_0x2586fd['filters']=_['intersection'](_0x2586fd['model'],_0x2586fd[_0x67ee('0x2a')]);_0x3278a6[_0x67ee('0x2d')]=_[_0x67ee('0x2e')](_0x2586fd[_0x67ee('0x28')],qs[_0x67ee('0x2f')](_0x3d9108[_0x67ee('0x2a')]['fields']));_0x3278a6['attributes']=_0x3278a6[_0x67ee('0x2d')][_0x67ee('0x30')]?_0x3278a6[_0x67ee('0x2d')]:_0x2586fd[_0x67ee('0x28')];if(!_0x3d9108[_0x67ee('0x2a')][_0x67ee('0x31')]('nolimit')){_0x3278a6[_0x67ee('0x1a')]=qs[_0x67ee('0x1a')](_0x3d9108[_0x67ee('0x2a')][_0x67ee('0x1a')]);_0x3278a6[_0x67ee('0x19')]=qs['offset'](_0x3d9108[_0x67ee('0x2a')]['offset']);}_0x3278a6[_0x67ee('0x32')]=qs['sort'](_0x3d9108[_0x67ee('0x2a')]['sort']);_0x3278a6[_0x67ee('0x33')]=qs[_0x67ee('0x34')](_[_0x67ee('0x35')](_0x3d9108[_0x67ee('0x2a')],_0x2586fd[_0x67ee('0x34')]));if(_0x29898a['dateStart']){if(_0x29898a['dateEnd']){_0x29898a[_0x67ee('0x2c')]=moment(_0x29898a['dateEnd'])[_0x67ee('0x36')](0x1,_0x67ee('0x37'));}else{_0x29898a['dateEnd']=moment(_0x29898a[_0x67ee('0x2b')])['add'](0x1,_0x67ee('0x37'));}_['merge'](_0x3278a6['where'],{'createdAt':{'$gte':_0x29898a['dateStart'],'$lte':_0x29898a['dateEnd']}});}if(_0x3d9108[_0x67ee('0x2a')][_0x67ee('0x38')]){_0x3278a6[_0x67ee('0x33')]=_[_0x67ee('0x39')](_0x3278a6[_0x67ee('0x33')],{'$or':_['map'](_0x5258e3,function(_0x3f7cb6){if(_0x3f7cb6[_0x67ee('0x3a')][_0x67ee('0x3b')]!==_0x67ee('0x3c')){var _0x323f6d={};_0x323f6d[_0x3f7cb6[_0x67ee('0x3d')]]={'$like':'%'+_0x3d9108[_0x67ee('0x2a')][_0x67ee('0x38')]+'%'};return _0x323f6d;}})});}_0x3278a6=_['merge']({},_0x3278a6,_0x3d9108['options']);var _0x15034b={'where':_0x3278a6['where']};return db[_0x67ee('0x27')]['count'](_0x15034b)[_0x67ee('0x1f')](function(_0x3aade7){_0x58652d[_0x67ee('0x3e')]=_0x3aade7;if(_0x3d9108[_0x67ee('0x2a')][_0x67ee('0x3f')]){_0x3278a6[_0x67ee('0x40')]=[{'all':!![]}];}return db[_0x67ee('0x27')][_0x67ee('0x41')](_0x3278a6);})[_0x67ee('0x1f')](function(_0x4673af){_0x58652d[_0x67ee('0x42')]=_0x4673af;return _0x58652d;})['then'](respondWithFilteredResult(_0x142feb,_0x3278a6))[_0x67ee('0x43')](handleError(_0x142feb,null));};exports[_0x67ee('0x44')]=function(_0x502fa9,_0x5dcaef){var _0x262876={'raw':!![],'where':{'id':_0x502fa9[_0x67ee('0x45')]['id']}},_0xc56e42={};_0xc56e42['model']=_['keys'](db['AnalyticExtractedReport'][_0x67ee('0x46')]);_0xc56e42['query']=_['keys'](_0x502fa9[_0x67ee('0x2a')]);_0xc56e42[_0x67ee('0x34')]=_[_0x67ee('0x2e')](_0xc56e42[_0x67ee('0x28')],_0xc56e42[_0x67ee('0x2a')]);_0x262876[_0x67ee('0x2d')]=_['intersection'](_0xc56e42['model'],qs[_0x67ee('0x2f')](_0x502fa9[_0x67ee('0x2a')][_0x67ee('0x2f')]));_0x262876[_0x67ee('0x2d')]=_0x262876[_0x67ee('0x2d')][_0x67ee('0x30')]?_0x262876[_0x67ee('0x2d')]:_0xc56e42['model'];if(_0x502fa9[_0x67ee('0x2a')]['includeAll']){_0x262876['include']=[{'all':!![]}];}_0x262876=_[_0x67ee('0x39')]({},_0x262876,_0x502fa9[_0x67ee('0x47')]);return db[_0x67ee('0x27')][_0x67ee('0x48')](_0x262876)[_0x67ee('0x1f')](handleEntityNotFound(_0x5dcaef,null))[_0x67ee('0x1f')](respondWithResult(_0x5dcaef,null))[_0x67ee('0x43')](handleError(_0x5dcaef,null));};exports[_0x67ee('0x49')]=function(_0x4758f0,_0x5e974f){return db[_0x67ee('0x27')][_0x67ee('0x49')](_0x4758f0[_0x67ee('0x4a')],{})[_0x67ee('0x1f')](function(_0x564d7b){var _0x3ba40e=_0x4758f0[_0x67ee('0x4b')]['get']({'plain':!![]});if(!_0x3ba40e)throw new Error(_0x67ee('0x4c'));if(_0x3ba40e['role']===_0x67ee('0x4b')){var _0x4f85d1=_0x564d7b[_0x67ee('0x21')]({'plain':!![]});var _0x50f9d9=_0x67ee('0x22');return db[_0x67ee('0x4d')][_0x67ee('0x48')]({'where':{'name':_0x50f9d9,'userProfileId':_0x3ba40e[_0x67ee('0x4e')]},'raw':!![]})[_0x67ee('0x1f')](function(_0x296cb1){if(_0x296cb1&&_0x296cb1[_0x67ee('0x4f')]===0x0){return db[_0x67ee('0x50')]['create']({'name':_0x4f85d1['name'],'resourceId':_0x4f85d1['id'],'type':_0x296cb1[_0x67ee('0x24')],'sectionId':_0x296cb1['id']},{})['then'](function(){return _0x564d7b;});}else{return _0x564d7b;}})[_0x67ee('0x43')](function(_0xb7382){logger[_0x67ee('0x23')](_0x67ee('0x51'),_0xb7382);throw _0xb7382;});}return _0x564d7b;})[_0x67ee('0x1f')](respondWithResult(_0x5e974f,0xc9))[_0x67ee('0x43')](handleError(_0x5e974f,null));};exports[_0x67ee('0x52')]=function(_0x3466b2,_0x14fc59){if(_0x3466b2[_0x67ee('0x4a')]['id']){delete _0x3466b2[_0x67ee('0x4a')]['id'];}return db[_0x67ee('0x27')][_0x67ee('0x48')]({'where':{'id':_0x3466b2[_0x67ee('0x45')]['id']}})['then'](handleEntityNotFound(_0x14fc59,null))[_0x67ee('0x1f')](saveUpdates(_0x3466b2[_0x67ee('0x4a')],null))['then'](respondWithResult(_0x14fc59,null))[_0x67ee('0x43')](handleError(_0x14fc59,null));};exports[_0x67ee('0x20')]=function(_0x2d07b4,_0x2d7b32){return db[_0x67ee('0x27')][_0x67ee('0x48')]({'where':{'id':_0x2d07b4[_0x67ee('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d7b32,null))[_0x67ee('0x1f')](removeEntity(_0x2d7b32,null))[_0x67ee('0x43')](handleError(_0x2d7b32,null));};exports[_0x67ee('0x53')]=function(_0x3850fc,_0x182a89,_0x3686b4){return db[_0x67ee('0x27')][_0x67ee('0x48')]({'where':{'id':_0x3850fc['params']['id']},'attributes':[_0x67ee('0x24'),'basename','savename',_0x67ee('0x54')],'raw':!![]})[_0x67ee('0x1f')](handleEntityNotFound(_0x182a89,null))['then'](function(_0x339a52){if(_0x339a52){if(!fs[_0x67ee('0x55')](path[_0x67ee('0x56')](config[_0x67ee('0x57')],_0x67ee('0x58'),_0x339a52[_0x67ee('0x59')]))){throw new db[(_0x67ee('0x5a'))][(_0x67ee('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3850fc[_0x67ee('0x2a')][_0x67ee('0x5c')]){return _0x182a89[_0x67ee('0x15')](0xc8);}return _0x182a89[_0x67ee('0x53')](path[_0x67ee('0x56')](config[_0x67ee('0x57')],'server/files/reports',_0x339a52[_0x67ee('0x59')]),util[_0x67ee('0x5d')](_0x67ee('0x5e'),_0x339a52[_0x67ee('0x5f')]||_0x339a52[_0x67ee('0x24')],_0x339a52[_0x67ee('0x54')][_0x67ee('0x60')]()));}})[_0x67ee('0x43')](handleError(_0x182a89,null));};
\ No newline at end of file
index bea1841..e5a9026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf93d=['../../config/logger','api','moment','bluebird','request-promise','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','util'];(function(_0x55d608,_0x2e9858){var _0x27ff79=function(_0x49f47c){while(--_0x49f47c){_0x55d608['push'](_0x55d608['shift']());}};_0x27ff79(++_0x2e9858);}(_0xf93d,0x11f));var _0xdf93=function(_0x5d5b72,_0x305ffa){_0x5d5b72=_0x5d5b72-0x0;var _0x4dcfc8=_0xf93d[_0x5d5b72];return _0x4dcfc8;};'use strict';var _=require('lodash');var util=require(_0xdf93('0x0'));var logger=require(_0xdf93('0x1'))(_0xdf93('0x2'));var moment=require(_0xdf93('0x3'));var BPromise=require(_0xdf93('0x4'));var rp=require(_0xdf93('0x5'));var attributes=require(_0xdf93('0x6'));module[_0xdf93('0x7')]=function(_0x4777cc,_0x209bb5){return _0x4777cc['define']('AnalyticExtractedReport',attributes,{'tableName':_0xdf93('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x24cf=['../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x2245c7,_0x47951d){var _0x267daa=function(_0x21db85){while(--_0x21db85){_0x2245c7['push'](_0x2245c7['shift']());}};_0x267daa(++_0x47951d);}(_0x24cf,0x1d5));var _0xf24c=function(_0x4c708a,_0x39014b){_0x4c708a=_0x4c708a-0x0;var _0x4cc698=_0x24cf[_0x4c708a];return _0x4cc698;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf24c('0x0'))(_0xf24c('0x1'));var moment=require(_0xf24c('0x2'));var BPromise=require(_0xf24c('0x3'));var rp=require(_0xf24c('0x4'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf24c('0x5')]=function(_0x417bb2,_0x1eafb4){return _0x417bb2[_0xf24c('0x6')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 05f429d..dc67a12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e68=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','util','moment','bluebird'];(function(_0x562563,_0x2dc2ec){var _0x47c128=function(_0x5d73d9){while(--_0x5d73d9){_0x562563['push'](_0x562563['shift']());}};_0x47c128(++_0x2dc2ec);}(_0x5e68,0x81));var _0x85e6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5e68[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x85e6('0x0'));var moment=require(_0x85e6('0x1'));var BPromise=require(_0x85e6('0x2'));var rs=require(_0x85e6('0x3'));var fs=require('fs');var Redis=require(_0x85e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x85e6('0x5'));var logger=require(_0x85e6('0x6'))(_0x85e6('0x7'));var config=require(_0x85e6('0x8'));var jayson=require(_0x85e6('0x9'));var client=jayson[_0x85e6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33710f,_0x50e3ad,_0x6ae173){return new BPromise(function(_0x520f9f,_0x2f9b90){return client[_0x85e6('0xb')](_0x33710f,_0x6ae173)['then'](function(_0x1bbfbe){logger[_0x85e6('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x50e3ad,_0x85e6('0xd'));logger[_0x85e6('0xe')](_0x85e6('0xf'),_0x50e3ad,_0x85e6('0xd'),JSON[_0x85e6('0x10')](_0x1bbfbe));if(_0x1bbfbe[_0x85e6('0x11')]){if(_0x1bbfbe[_0x85e6('0x11')][_0x85e6('0x12')]===0x1f4){logger['error'](_0x85e6('0x13'),_0x50e3ad,_0x1bbfbe[_0x85e6('0x11')][_0x85e6('0x14')]);return _0x2f9b90(_0x1bbfbe[_0x85e6('0x11')]['message']);}logger['error'](_0x85e6('0x13'),_0x50e3ad,_0x1bbfbe['error']['message']);return _0x520f9f(_0x1bbfbe['error'][_0x85e6('0x14')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x50e3ad,_0x85e6('0xd'));_0x520f9f(_0x1bbfbe['result'][_0x85e6('0x14')]);}})[_0x85e6('0x15')](function(_0x3bdd73){logger['error'](_0x85e6('0x13'),_0x50e3ad,_0x3bdd73);_0x2f9b90(_0x3bdd73);});});}
\ No newline at end of file
+var _0x2828=['ioredis','../../mysqldb','../../config/utils','client','http','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x1dbbc7,_0x2b4c1e){var _0x242f53=function(_0x2bfc79){while(--_0x2bfc79){_0x1dbbc7['push'](_0x1dbbc7['shift']());}};_0x242f53(++_0x2b4c1e);}(_0x2828,0xcd));var _0x8282=function(_0x5a306a,_0x3bdfdf){_0x5a306a=_0x5a306a-0x0;var _0x5ec858=_0x2828[_0x5a306a];return _0x5ec858;};'use strict';var _=require(_0x8282('0x0'));var util=require(_0x8282('0x1'));var moment=require('moment');var BPromise=require(_0x8282('0x2'));var rs=require(_0x8282('0x3'));var fs=require('fs');var Redis=require(_0x8282('0x4'));var db=require(_0x8282('0x5'))['db'];var utils=require(_0x8282('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8282('0x7')][_0x8282('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf5ffee,_0xccdf8e,_0x148ef0){return new BPromise(function(_0x11c927,_0x25c603){return client[_0x8282('0x9')](_0xf5ffee,_0x148ef0)['then'](function(_0xa9f4f7){logger[_0x8282('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xccdf8e,_0x8282('0xb'));logger[_0x8282('0xc')](_0x8282('0xd'),_0xccdf8e,_0x8282('0xb'),JSON['stringify'](_0xa9f4f7));if(_0xa9f4f7['error']){if(_0xa9f4f7[_0x8282('0xe')]['code']===0x1f4){logger[_0x8282('0xe')](_0x8282('0xf'),_0xccdf8e,_0xa9f4f7[_0x8282('0xe')]['message']);return _0x25c603(_0xa9f4f7[_0x8282('0xe')]['message']);}logger[_0x8282('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xccdf8e,_0xa9f4f7[_0x8282('0xe')]['message']);return _0x11c927(_0xa9f4f7['error'][_0x8282('0x10')]);}else{logger[_0x8282('0xa')](_0x8282('0xf'),_0xccdf8e,_0x8282('0xb'));_0x11c927(_0xa9f4f7[_0x8282('0x11')]['message']);}})[_0x8282('0x12')](function(_0x2e5168){logger[_0x8282('0xe')](_0x8282('0xf'),_0xccdf8e,_0x2e5168);_0x25c603(_0x2e5168);});});}
\ No newline at end of file
index 4aeba23..23914de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dec=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','download','create','put','update','delete','exports'];(function(_0x13b4ad,_0x15e3ef){var _0x3c3c91=function(_0x3c9d88){while(--_0x3c9d88){_0x13b4ad['push'](_0x13b4ad['shift']());}};_0x3c3c91(++_0x15e3ef);}(_0x0dec,0x98));var _0xc0de=function(_0x464b5d,_0x1edac1){_0x464b5d=_0x464b5d-0x0;var _0xa8f57d=_0x0dec[_0x464b5d];return _0xa8f57d;};'use strict';var multer=require('multer');var util=require(_0xc0de('0x0'));var path=require(_0xc0de('0x1'));var timeout=require(_0xc0de('0x2'));var express=require(_0xc0de('0x3'));var router=express[_0xc0de('0x4')]();var auth=require(_0xc0de('0x5'));var interaction=require(_0xc0de('0x6'));var config=require(_0xc0de('0x7'));var controller=require(_0xc0de('0x8'));router[_0xc0de('0x9')]('/',auth[_0xc0de('0xa')](),controller[_0xc0de('0xb')]);router['get'](_0xc0de('0xc'),auth[_0xc0de('0xa')](),controller['show']);router[_0xc0de('0x9')]('/:id/download',auth[_0xc0de('0xa')](),controller[_0xc0de('0xd')]);router['post']('/',auth[_0xc0de('0xa')](),controller[_0xc0de('0xe')]);router[_0xc0de('0xf')](_0xc0de('0xc'),auth['isAuthenticated'](),controller[_0xc0de('0x10')]);router[_0xc0de('0x11')](_0xc0de('0xc'),auth[_0xc0de('0xa')](),controller['destroy']);module[_0xc0de('0x12')]=router;
\ No newline at end of file
+var _0xea4d=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','delete'];(function(_0x4906a6,_0x5225ec){var _0x2f2c9b=function(_0x39a3f0){while(--_0x39a3f0){_0x4906a6['push'](_0x4906a6['shift']());}};_0x2f2c9b(++_0x5225ec);}(_0xea4d,0xa2));var _0xdea4=function(_0x3987f7,_0x28a63c){_0x3987f7=_0x3987f7-0x0;var _0x5430d7=_0xea4d[_0x3987f7];return _0x5430d7;};'use strict';var multer=require('multer');var util=require(_0xdea4('0x0'));var path=require(_0xdea4('0x1'));var timeout=require(_0xdea4('0x2'));var express=require(_0xdea4('0x3'));var router=express[_0xdea4('0x4')]();var auth=require(_0xdea4('0x5'));var interaction=require(_0xdea4('0x6'));var config=require('../../config/environment');var controller=require(_0xdea4('0x7'));router[_0xdea4('0x8')]('/',auth[_0xdea4('0x9')](),controller[_0xdea4('0xa')]);router[_0xdea4('0x8')](_0xdea4('0xb'),auth['isAuthenticated'](),controller[_0xdea4('0xc')]);router[_0xdea4('0x8')]('/:id/download',auth[_0xdea4('0x9')](),controller[_0xdea4('0xd')]);router[_0xdea4('0xe')]('/',auth[_0xdea4('0x9')](),controller[_0xdea4('0xf')]);router[_0xdea4('0x10')](_0xdea4('0xb'),auth[_0xdea4('0x9')](),controller['update']);router[_0xdea4('0x11')](_0xdea4('0xb'),auth[_0xdea4('0x9')](),controller[_0xdea4('0x12')]);module[_0xdea4('0x13')]=router;
\ No newline at end of file
index 0ea9d1d..243f585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8391=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x2f2ed0,_0x1c6435){var _0x250b0d=function(_0x1909c1){while(--_0x1909c1){_0x2f2ed0['push'](_0x2f2ed0['shift']());}};_0x250b0d(++_0x1c6435);}(_0x8391,0x8c));var _0x1839=function(_0x562650,_0x2380e8){_0x562650=_0x562650-0x0;var _0x164aec=_0x8391[_0x562650];return _0x164aec;};'use strict';var Sequelize=require(_0x1839('0x0'));module['exports']={'field':{'type':Sequelize[_0x1839('0x1')]},'alias':{'type':Sequelize[_0x1839('0x2')]},'function':{'type':Sequelize[_0x1839('0x2')]},'format':{'type':Sequelize[_0x1839('0x2')]},'groupBy':{'type':Sequelize[_0x1839('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1839('0x2')]},'custom':{'type':Sequelize[_0x1839('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7f9c=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4460ba,_0x4c163c){var _0x153d02=function(_0x31943){while(--_0x31943){_0x4460ba['push'](_0x4460ba['shift']());}};_0x153d02(++_0x4c163c);}(_0x7f9c,0x12d));var _0xc7f9=function(_0x2a02f6,_0x20984d){_0x2a02f6=_0x2a02f6-0x0;var _0x366a8e=_0x7f9c[_0x2a02f6];return _0x366a8e;};'use strict';var Sequelize=require(_0xc7f9('0x0'));module[_0xc7f9('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xc7f9('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xc7f9('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc7f9('0x2')]},'custom':{'type':Sequelize[_0xc7f9('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 28de0cf..b0769bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b5f=['dateEnd','intersection','attributes','fields','hasOwnProperty','order','where','filters','pick','add','day','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','rows','catch','show','params','include','find','create','body','bulkCreate','bulkDestroy','ids','sequelize','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','error','name','send','index','AnalyticFieldReport','rawAttributes','model','keys','query','dateStart'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x1b5f,0x1a7));var _0xf1b5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b5f[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf1b5('0x0'));var rimraf=require(_0xf1b5('0x1'));var zipdir=require(_0xf1b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1b5('0x3'));var moment=require(_0xf1b5('0x4'));var BPromise=require(_0xf1b5('0x5'));var Mustache=require(_0xf1b5('0x6'));var util=require(_0xf1b5('0x7'));var path=require(_0xf1b5('0x8'));var sox=require(_0xf1b5('0x9'));var csv=require(_0xf1b5('0xa'));var ejs=require(_0xf1b5('0xb'));var fs=require('fs');var _=require(_0xf1b5('0xc'));var squel=require(_0xf1b5('0xd'));var crypto=require(_0xf1b5('0xe'));var jsforce=require(_0xf1b5('0xf'));var deskjs=require(_0xf1b5('0x10'));var toCsv=require(_0xf1b5('0xa'));var querystring=require('querystring');var Papa=require(_0xf1b5('0x11'));var Redis=require('ioredis');var qs=require(_0xf1b5('0x12'));var logger=require(_0xf1b5('0x13'))(_0xf1b5('0x14'));var utils=require('../../config/utils');var config=require(_0xf1b5('0x15'));var db=require(_0xf1b5('0x16'))['db'];function respondWithStatusCode(_0x3e825b,_0x1b3453){_0x1b3453=_0x1b3453||0xcc;return function(_0x29a583){if(_0x29a583){return _0x3e825b[_0xf1b5('0x17')](_0x1b3453);}return _0x3e825b[_0xf1b5('0x18')](_0x1b3453)[_0xf1b5('0x19')]();};}function respondWithResult(_0x1e9bde,_0x47f266){_0x47f266=_0x47f266||0xc8;return function(_0x47dea9){if(_0x47dea9){return _0x1e9bde[_0xf1b5('0x18')](_0x47f266)[_0xf1b5('0x1a')](_0x47dea9);}};}function respondWithFilteredResult(_0x1e6de1,_0x3bf7ac){return function(_0x244ec1){if(_0x244ec1){var _0x32d69a=_0x244ec1[_0xf1b5('0x1b')],_0x23a396=_0x3bf7ac[_0xf1b5('0x1c')],_0x41ad0a=_0x3bf7ac['offset']+_0x3bf7ac[_0xf1b5('0x1d')],_0x537e11;if(_0x41ad0a>=_0x32d69a){_0x41ad0a=_0x32d69a;_0x537e11=0xc8;}else{_0x537e11=0xce;}_0x1e6de1[_0xf1b5('0x18')](_0x537e11);return _0x1e6de1[_0xf1b5('0x1e')]('Content-Range',_0x23a396+'-'+_0x41ad0a+'/'+_0x32d69a)['json'](_0x244ec1);}return null;};}function patchUpdates(_0x34ffb5){return function(_0x280e89){try{jsonpatch[_0xf1b5('0x1f')](_0x280e89,_0x34ffb5,!![]);}catch(_0x12ad74){return BPromise['reject'](_0x12ad74);}return _0x280e89[_0xf1b5('0x20')]();};}function saveUpdates(_0x1a4a8b,_0x5c037a){return function(_0x397732){if(_0x397732){return _0x397732['update'](_0x1a4a8b)[_0xf1b5('0x21')](function(_0x5908c8){return _0x5908c8;});}return null;};}function removeEntity(_0x17a4ae,_0x54c3d8){return function(_0x2c4224){if(_0x2c4224){return _0x2c4224[_0xf1b5('0x22')]()[_0xf1b5('0x21')](function(){_0x17a4ae[_0xf1b5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44309d,_0x454659){return function(_0x3b2975){if(!_0x3b2975){_0x44309d[_0xf1b5('0x17')](0x194);}return _0x3b2975;};}function handleError(_0x4154af,_0x24cbd4){_0x24cbd4=_0x24cbd4||0x1f4;return function(_0xdafd96){logger[_0xf1b5('0x23')](_0xdafd96['stack']);if(_0xdafd96['name']){delete _0xdafd96[_0xf1b5('0x24')];}_0x4154af['status'](_0x24cbd4)[_0xf1b5('0x25')](_0xdafd96);};}exports[_0xf1b5('0x26')]=function(_0x49d584,_0x19ee13){var _0x2e3896={},_0x5c1e5c={},_0x3827a5={'count':0x0,'rows':[]};var _0x8f6689=db[_0xf1b5('0x27')][_0xf1b5('0x28')];_0x5c1e5c[_0xf1b5('0x29')]=_[_0xf1b5('0x2a')](_0x8f6689);var _0x171d08={'dateStart':_0x49d584[_0xf1b5('0x2b')][_0xf1b5('0x2c')],'dateEnd':_0x49d584['query'][_0xf1b5('0x2d')]};delete _0x49d584['query'][_0xf1b5('0x2c')];delete _0x49d584[_0xf1b5('0x2b')][_0xf1b5('0x2d')];_0x5c1e5c['query']=_[_0xf1b5('0x2a')](_0x49d584['query']);_0x5c1e5c['filters']=_[_0xf1b5('0x2e')](_0x5c1e5c[_0xf1b5('0x29')],_0x5c1e5c[_0xf1b5('0x2b')]);_0x2e3896[_0xf1b5('0x2f')]=_['intersection'](_0x5c1e5c[_0xf1b5('0x29')],qs[_0xf1b5('0x30')](_0x49d584[_0xf1b5('0x2b')]['fields']));_0x2e3896[_0xf1b5('0x2f')]=_0x2e3896[_0xf1b5('0x2f')]['length']?_0x2e3896[_0xf1b5('0x2f')]:_0x5c1e5c['model'];if(!_0x49d584[_0xf1b5('0x2b')][_0xf1b5('0x31')]('nolimit')){_0x2e3896[_0xf1b5('0x1d')]=qs[_0xf1b5('0x1d')](_0x49d584[_0xf1b5('0x2b')][_0xf1b5('0x1d')]);_0x2e3896[_0xf1b5('0x1c')]=qs['offset'](_0x49d584['query'][_0xf1b5('0x1c')]);}_0x2e3896[_0xf1b5('0x32')]=qs['sort'](_0x49d584[_0xf1b5('0x2b')]['sort']);_0x2e3896[_0xf1b5('0x33')]=qs[_0xf1b5('0x34')](_[_0xf1b5('0x35')](_0x49d584[_0xf1b5('0x2b')],_0x5c1e5c[_0xf1b5('0x34')]));if(_0x171d08[_0xf1b5('0x2c')]){if(_0x171d08['dateEnd']){_0x171d08[_0xf1b5('0x2d')]=moment(_0x171d08[_0xf1b5('0x2d')])[_0xf1b5('0x36')](0x1,_0xf1b5('0x37'));}else{_0x171d08['dateEnd']=moment(_0x171d08[_0xf1b5('0x2c')])[_0xf1b5('0x36')](0x1,_0xf1b5('0x37'));}_['merge'](_0x2e3896[_0xf1b5('0x33')],{'createdAt':{'$gte':_0x171d08[_0xf1b5('0x2c')],'$lte':_0x171d08[_0xf1b5('0x2d')]}});}if(_0x49d584[_0xf1b5('0x2b')][_0xf1b5('0x38')]){_0x2e3896[_0xf1b5('0x33')]=_[_0xf1b5('0x39')](_0x2e3896[_0xf1b5('0x33')],{'$or':_[_0xf1b5('0x3a')](_0x8f6689,function(_0x12c18f){if(_0x12c18f[_0xf1b5('0x3b')][_0xf1b5('0x3c')]!==_0xf1b5('0x3d')){var _0x36fbaa={};_0x36fbaa[_0x12c18f[_0xf1b5('0x3e')]]={'$like':'%'+_0x49d584[_0xf1b5('0x2b')][_0xf1b5('0x38')]+'%'};return _0x36fbaa;}})});}_0x2e3896=_[_0xf1b5('0x39')]({},_0x2e3896,_0x49d584[_0xf1b5('0x3f')]);var _0x3caf8d={'where':_0x2e3896[_0xf1b5('0x33')]};return db['AnalyticFieldReport']['count'](_0x3caf8d)[_0xf1b5('0x21')](function(_0x2cb7ae){_0x3827a5[_0xf1b5('0x1b')]=_0x2cb7ae;if(_0x49d584[_0xf1b5('0x2b')][_0xf1b5('0x40')]){_0x2e3896['include']=[{'all':!![]}];}return db[_0xf1b5('0x27')]['findAll'](_0x2e3896);})[_0xf1b5('0x21')](function(_0x497f0b){_0x3827a5[_0xf1b5('0x41')]=_0x497f0b;return _0x3827a5;})[_0xf1b5('0x21')](respondWithFilteredResult(_0x19ee13,_0x2e3896))[_0xf1b5('0x42')](handleError(_0x19ee13,null));};exports[_0xf1b5('0x43')]=function(_0x309caf,_0xe17bb1){var _0x3877b3={'raw':![],'where':{'id':_0x309caf[_0xf1b5('0x44')]['id']}},_0x4a61bc={};_0x4a61bc[_0xf1b5('0x29')]=_[_0xf1b5('0x2a')](db[_0xf1b5('0x27')][_0xf1b5('0x28')]);_0x4a61bc[_0xf1b5('0x2b')]=_[_0xf1b5('0x2a')](_0x309caf['query']);_0x4a61bc['filters']=_[_0xf1b5('0x2e')](_0x4a61bc[_0xf1b5('0x29')],_0x4a61bc[_0xf1b5('0x2b')]);_0x3877b3[_0xf1b5('0x2f')]=_['intersection'](_0x4a61bc[_0xf1b5('0x29')],qs['fields'](_0x309caf['query'][_0xf1b5('0x30')]));_0x3877b3[_0xf1b5('0x2f')]=_0x3877b3[_0xf1b5('0x2f')]['length']?_0x3877b3[_0xf1b5('0x2f')]:_0x4a61bc['model'];if(_0x309caf[_0xf1b5('0x2b')][_0xf1b5('0x40')]){_0x3877b3[_0xf1b5('0x45')]=[{'all':!![]}];}_0x3877b3=_[_0xf1b5('0x39')]({},_0x3877b3,_0x309caf[_0xf1b5('0x3f')]);return db['AnalyticFieldReport'][_0xf1b5('0x46')](_0x3877b3)['then'](handleEntityNotFound(_0xe17bb1,null))[_0xf1b5('0x21')](respondWithResult(_0xe17bb1,null))[_0xf1b5('0x42')](handleError(_0xe17bb1,null));};exports[_0xf1b5('0x47')]=function(_0x364c92,_0x5a2fe1){return db[_0xf1b5('0x27')][_0xf1b5('0x47')](_0x364c92[_0xf1b5('0x48')],{})[_0xf1b5('0x21')](respondWithResult(_0x5a2fe1,0xc9))[_0xf1b5('0x42')](handleError(_0x5a2fe1,null));};exports[_0xf1b5('0x49')]=function(_0x3dd196,_0x380059){return db[_0xf1b5('0x27')][_0xf1b5('0x49')](_0x3dd196['body'],{'raw':![],'individualHooks':!![]})[_0xf1b5('0x21')](respondWithResult(_0x380059,0xc9))['catch'](handleError(_0x380059,null));};exports['update']=function(_0x332cee,_0x53b563){if(_0x332cee[_0xf1b5('0x48')]['id']){delete _0x332cee[_0xf1b5('0x48')]['id'];}return db[_0xf1b5('0x27')]['find']({'where':{'id':_0x332cee[_0xf1b5('0x44')]['id']}})[_0xf1b5('0x21')](handleEntityNotFound(_0x53b563,null))[_0xf1b5('0x21')](saveUpdates(_0x332cee[_0xf1b5('0x48')],null))[_0xf1b5('0x21')](respondWithResult(_0x53b563,null))[_0xf1b5('0x42')](handleError(_0x53b563,null));};exports[_0xf1b5('0x22')]=function(_0x20dfa6,_0x35d25c){return db[_0xf1b5('0x27')]['find']({'where':{'id':_0x20dfa6['params']['id']}})[_0xf1b5('0x21')](handleEntityNotFound(_0x35d25c,null))[_0xf1b5('0x21')](removeEntity(_0x35d25c,null))['catch'](handleError(_0x35d25c,null));};exports[_0xf1b5('0x4a')]=function(_0x229c0d,_0x23083b){return db[_0xf1b5('0x27')][_0xf1b5('0x22')]({'where':{'id':_0x229c0d[_0xf1b5('0x2b')][_0xf1b5('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xf1b5('0x21')](respondWithResult(_0x23083b,0xcc))[_0xf1b5('0x42')](handleError(_0x23083b,null));};exports['addFields']=function(_0x588433,_0x47c919,_0x8937f7){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x588433[_0xf1b5('0x44')]['id']}})['then'](handleEntityNotFound(_0x47c919,null))['then'](function(_0xd123e7){if(_0xd123e7){return db[_0xf1b5('0x4c')]['transaction'](function(_0x1b4810){return db[_0xf1b5('0x27')]['destroy']({'where':{'CustomReportId':_0x588433['params']['id']},'transaction':_0x1b4810})[_0xf1b5('0x21')](function(_0x24b068){var _0x4b5f31=_[_0xf1b5('0x3a')](_0x588433[_0xf1b5('0x48')],function(_0xcfbd3b){delete _0xcfbd3b['id'];_0xcfbd3b['CustomReportId']=_0x588433[_0xf1b5('0x44')]['id'];return _0xcfbd3b;});return db['AnalyticFieldReport'][_0xf1b5('0x49')](_0x4b5f31,{'transaction':_0x1b4810});});})[_0xf1b5('0x21')](function(){return db[_0xf1b5('0x27')][_0xf1b5('0x4d')]({'where':{'CustomReportId':_0x588433['params']['id']}});});}})[_0xf1b5('0x21')](respondWithResult(_0x47c919,null))[_0xf1b5('0x42')](handleError(_0x47c919,null));};
\ No newline at end of file
+var _0xe0fe=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','index','AnalyticFieldReport','keys','query','dateStart','filters','intersection','model','attributes','fields','length','offset','order','sort','dateEnd','add','day','merge','filter','where','type','key','VIRTUAL','options','count','findAll','catch','show','rawAttributes','includeAll','find','create','body','bulkCreate','params','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','map','eml-format','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0fe,0xdf));var _0xee0f=function(_0x277b70,_0x575b23){_0x277b70=_0x277b70-0x0;var _0x4c0ec8=_0xe0fe[_0x277b70];return _0x4c0ec8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xee0f('0x0'));var rimraf=require(_0xee0f('0x1'));var zipdir=require(_0xee0f('0x2'));var jsonpatch=require(_0xee0f('0x3'));var rp=require(_0xee0f('0x4'));var moment=require(_0xee0f('0x5'));var BPromise=require(_0xee0f('0x6'));var Mustache=require('mustache');var util=require(_0xee0f('0x7'));var path=require(_0xee0f('0x8'));var sox=require('sox');var csv=require(_0xee0f('0x9'));var ejs=require(_0xee0f('0xa'));var fs=require('fs');var _=require(_0xee0f('0xb'));var squel=require(_0xee0f('0xc'));var crypto=require(_0xee0f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xee0f('0x9'));var querystring=require(_0xee0f('0xe'));var Papa=require('papaparse');var Redis=require(_0xee0f('0xf'));var qs=require(_0xee0f('0x10'));var logger=require('../../config/logger')(_0xee0f('0x11'));var utils=require(_0xee0f('0x12'));var config=require('../../config/environment');var db=require(_0xee0f('0x13'))['db'];function respondWithStatusCode(_0x5acbbd,_0x74a80e){_0x74a80e=_0x74a80e||0xcc;return function(_0x16898a){if(_0x16898a){return _0x5acbbd[_0xee0f('0x14')](_0x74a80e);}return _0x5acbbd[_0xee0f('0x15')](_0x74a80e)['end']();};}function respondWithResult(_0x211a59,_0x168638){_0x168638=_0x168638||0xc8;return function(_0x4e6917){if(_0x4e6917){return _0x211a59['status'](_0x168638)[_0xee0f('0x16')](_0x4e6917);}};}function respondWithFilteredResult(_0x2e6b91,_0x25b574){return function(_0x416da5){if(_0x416da5){var _0x49a848=_0x416da5['count'],_0x4b5a92=_0x25b574['offset'],_0xd44242=_0x25b574['offset']+_0x25b574[_0xee0f('0x17')],_0x6a10dd;if(_0xd44242>=_0x49a848){_0xd44242=_0x49a848;_0x6a10dd=0xc8;}else{_0x6a10dd=0xce;}_0x2e6b91[_0xee0f('0x15')](_0x6a10dd);return _0x2e6b91[_0xee0f('0x18')](_0xee0f('0x19'),_0x4b5a92+'-'+_0xd44242+'/'+_0x49a848)[_0xee0f('0x16')](_0x416da5);}return null;};}function patchUpdates(_0x252ab5){return function(_0x588f09){try{jsonpatch[_0xee0f('0x1a')](_0x588f09,_0x252ab5,!![]);}catch(_0x3701fe){return BPromise['reject'](_0x3701fe);}return _0x588f09['save']();};}function saveUpdates(_0x262e89,_0x5abaa6){return function(_0x2b8a21){if(_0x2b8a21){return _0x2b8a21[_0xee0f('0x1b')](_0x262e89)[_0xee0f('0x1c')](function(_0xc4d978){return _0xc4d978;});}return null;};}function removeEntity(_0x14a44f,_0x2fa117){return function(_0x5089ad){if(_0x5089ad){return _0x5089ad[_0xee0f('0x1d')]()['then'](function(){_0x14a44f[_0xee0f('0x15')](0xcc)[_0xee0f('0x1e')]();});}};}function handleEntityNotFound(_0x32b9ce,_0x12b78e){return function(_0x4bd0ce){if(!_0x4bd0ce){_0x32b9ce[_0xee0f('0x14')](0x194);}return _0x4bd0ce;};}function handleError(_0x1ab6db,_0x40615c){_0x40615c=_0x40615c||0x1f4;return function(_0x369da1){logger[_0xee0f('0x1f')](_0x369da1[_0xee0f('0x20')]);if(_0x369da1[_0xee0f('0x21')]){delete _0x369da1[_0xee0f('0x21')];}_0x1ab6db['status'](_0x40615c)['send'](_0x369da1);};}exports[_0xee0f('0x22')]=function(_0x449c8d,_0x4173bf){var _0x1448d5={},_0x3897ab={},_0x32298c={'count':0x0,'rows':[]};var _0x2049e5=db[_0xee0f('0x23')]['rawAttributes'];_0x3897ab['model']=_[_0xee0f('0x24')](_0x2049e5);var _0x428b7e={'dateStart':_0x449c8d[_0xee0f('0x25')]['dateStart'],'dateEnd':_0x449c8d['query']['dateEnd']};delete _0x449c8d[_0xee0f('0x25')][_0xee0f('0x26')];delete _0x449c8d['query']['dateEnd'];_0x3897ab[_0xee0f('0x25')]=_[_0xee0f('0x24')](_0x449c8d['query']);_0x3897ab[_0xee0f('0x27')]=_[_0xee0f('0x28')](_0x3897ab[_0xee0f('0x29')],_0x3897ab[_0xee0f('0x25')]);_0x1448d5[_0xee0f('0x2a')]=_[_0xee0f('0x28')](_0x3897ab[_0xee0f('0x29')],qs[_0xee0f('0x2b')](_0x449c8d[_0xee0f('0x25')][_0xee0f('0x2b')]));_0x1448d5[_0xee0f('0x2a')]=_0x1448d5[_0xee0f('0x2a')][_0xee0f('0x2c')]?_0x1448d5[_0xee0f('0x2a')]:_0x3897ab[_0xee0f('0x29')];if(!_0x449c8d[_0xee0f('0x25')]['hasOwnProperty']('nolimit')){_0x1448d5[_0xee0f('0x17')]=qs[_0xee0f('0x17')](_0x449c8d[_0xee0f('0x25')][_0xee0f('0x17')]);_0x1448d5[_0xee0f('0x2d')]=qs['offset'](_0x449c8d[_0xee0f('0x25')][_0xee0f('0x2d')]);}_0x1448d5[_0xee0f('0x2e')]=qs[_0xee0f('0x2f')](_0x449c8d[_0xee0f('0x25')][_0xee0f('0x2f')]);_0x1448d5['where']=qs[_0xee0f('0x27')](_['pick'](_0x449c8d[_0xee0f('0x25')],_0x3897ab['filters']));if(_0x428b7e[_0xee0f('0x26')]){if(_0x428b7e[_0xee0f('0x30')]){_0x428b7e[_0xee0f('0x30')]=moment(_0x428b7e[_0xee0f('0x30')])[_0xee0f('0x31')](0x1,_0xee0f('0x32'));}else{_0x428b7e[_0xee0f('0x30')]=moment(_0x428b7e[_0xee0f('0x26')])[_0xee0f('0x31')](0x1,_0xee0f('0x32'));}_[_0xee0f('0x33')](_0x1448d5['where'],{'createdAt':{'$gte':_0x428b7e['dateStart'],'$lte':_0x428b7e[_0xee0f('0x30')]}});}if(_0x449c8d['query'][_0xee0f('0x34')]){_0x1448d5[_0xee0f('0x35')]=_[_0xee0f('0x33')](_0x1448d5[_0xee0f('0x35')],{'$or':_['map'](_0x2049e5,function(_0x5b4bff){if(_0x5b4bff[_0xee0f('0x36')][_0xee0f('0x37')]!==_0xee0f('0x38')){var _0x4e7f98={};_0x4e7f98[_0x5b4bff['field']]={'$like':'%'+_0x449c8d[_0xee0f('0x25')]['filter']+'%'};return _0x4e7f98;}})});}_0x1448d5=_[_0xee0f('0x33')]({},_0x1448d5,_0x449c8d[_0xee0f('0x39')]);var _0x1af334={'where':_0x1448d5[_0xee0f('0x35')]};return db['AnalyticFieldReport'][_0xee0f('0x3a')](_0x1af334)['then'](function(_0x4c9517){_0x32298c['count']=_0x4c9517;if(_0x449c8d['query']['includeAll']){_0x1448d5['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xee0f('0x3b')](_0x1448d5);})[_0xee0f('0x1c')](function(_0x52d439){_0x32298c['rows']=_0x52d439;return _0x32298c;})[_0xee0f('0x1c')](respondWithFilteredResult(_0x4173bf,_0x1448d5))[_0xee0f('0x3c')](handleError(_0x4173bf,null));};exports[_0xee0f('0x3d')]=function(_0x4ff454,_0x472024){var _0x1482d8={'raw':![],'where':{'id':_0x4ff454['params']['id']}},_0xe36bb7={};_0xe36bb7[_0xee0f('0x29')]=_[_0xee0f('0x24')](db['AnalyticFieldReport'][_0xee0f('0x3e')]);_0xe36bb7[_0xee0f('0x25')]=_[_0xee0f('0x24')](_0x4ff454[_0xee0f('0x25')]);_0xe36bb7[_0xee0f('0x27')]=_[_0xee0f('0x28')](_0xe36bb7[_0xee0f('0x29')],_0xe36bb7[_0xee0f('0x25')]);_0x1482d8['attributes']=_[_0xee0f('0x28')](_0xe36bb7[_0xee0f('0x29')],qs[_0xee0f('0x2b')](_0x4ff454['query']['fields']));_0x1482d8[_0xee0f('0x2a')]=_0x1482d8['attributes'][_0xee0f('0x2c')]?_0x1482d8[_0xee0f('0x2a')]:_0xe36bb7[_0xee0f('0x29')];if(_0x4ff454[_0xee0f('0x25')][_0xee0f('0x3f')]){_0x1482d8['include']=[{'all':!![]}];}_0x1482d8=_['merge']({},_0x1482d8,_0x4ff454[_0xee0f('0x39')]);return db[_0xee0f('0x23')][_0xee0f('0x40')](_0x1482d8)[_0xee0f('0x1c')](handleEntityNotFound(_0x472024,null))[_0xee0f('0x1c')](respondWithResult(_0x472024,null))['catch'](handleError(_0x472024,null));};exports[_0xee0f('0x41')]=function(_0x2bb565,_0x16d4ee){return db[_0xee0f('0x23')][_0xee0f('0x41')](_0x2bb565[_0xee0f('0x42')],{})['then'](respondWithResult(_0x16d4ee,0xc9))['catch'](handleError(_0x16d4ee,null));};exports[_0xee0f('0x43')]=function(_0x2656d2,_0x4b55bd){return db['AnalyticFieldReport'][_0xee0f('0x43')](_0x2656d2[_0xee0f('0x42')],{'raw':![],'individualHooks':!![]})[_0xee0f('0x1c')](respondWithResult(_0x4b55bd,0xc9))[_0xee0f('0x3c')](handleError(_0x4b55bd,null));};exports[_0xee0f('0x1b')]=function(_0x4797ab,_0x3d8448){if(_0x4797ab['body']['id']){delete _0x4797ab[_0xee0f('0x42')]['id'];}return db[_0xee0f('0x23')]['find']({'where':{'id':_0x4797ab[_0xee0f('0x44')]['id']}})[_0xee0f('0x1c')](handleEntityNotFound(_0x3d8448,null))[_0xee0f('0x1c')](saveUpdates(_0x4797ab['body'],null))['then'](respondWithResult(_0x3d8448,null))['catch'](handleError(_0x3d8448,null));};exports[_0xee0f('0x1d')]=function(_0x5a8c4b,_0x489134){return db[_0xee0f('0x23')][_0xee0f('0x40')]({'where':{'id':_0x5a8c4b[_0xee0f('0x44')]['id']}})[_0xee0f('0x1c')](handleEntityNotFound(_0x489134,null))['then'](removeEntity(_0x489134,null))['catch'](handleError(_0x489134,null));};exports[_0xee0f('0x45')]=function(_0x4000ac,_0x4ce1ad){return db['AnalyticFieldReport'][_0xee0f('0x1d')]({'where':{'id':_0x4000ac['query'][_0xee0f('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4ce1ad,0xcc))['catch'](handleError(_0x4ce1ad,null));};exports['addFields']=function(_0x1fcd2e,_0x357e3f,_0x138cfd){return db[_0xee0f('0x47')]['findOne']({'where':{'id':_0x1fcd2e[_0xee0f('0x44')]['id']}})[_0xee0f('0x1c')](handleEntityNotFound(_0x357e3f,null))['then'](function(_0x5b5029){if(_0x5b5029){return db[_0xee0f('0x48')][_0xee0f('0x49')](function(_0x3b3934){return db['AnalyticFieldReport'][_0xee0f('0x1d')]({'where':{'CustomReportId':_0x1fcd2e[_0xee0f('0x44')]['id']},'transaction':_0x3b3934})[_0xee0f('0x1c')](function(_0x8ec8f6){var _0x339761=_[_0xee0f('0x4a')](_0x1fcd2e[_0xee0f('0x42')],function(_0x1495b1){delete _0x1495b1['id'];_0x1495b1['CustomReportId']=_0x1fcd2e[_0xee0f('0x44')]['id'];return _0x1495b1;});return db[_0xee0f('0x23')][_0xee0f('0x43')](_0x339761,{'transaction':_0x3b3934});});})['then'](function(){return db['AnalyticFieldReport'][_0xee0f('0x3b')]({'where':{'CustomReportId':_0x1fcd2e['params']['id']}});});}})[_0xee0f('0x1c')](respondWithResult(_0x357e3f,null))[_0xee0f('0x3c')](handleError(_0x357e3f,null));};
\ No newline at end of file
index 3ded914..7233a09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7130=['define','AnalyticFieldReport','lodash','util','../../config/logger','api','bluebird','./analyticFieldReport.attributes','exports'];(function(_0x13402f,_0x493bde){var _0x56ee8c=function(_0xcbf2ad){while(--_0xcbf2ad){_0x13402f['push'](_0x13402f['shift']());}};_0x56ee8c(++_0x493bde);}(_0x7130,0x6e));var _0x0713=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7130[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x0713('0x0'));var util=require(_0x0713('0x1'));var logger=require(_0x0713('0x2'))(_0x0713('0x3'));var moment=require('moment');var BPromise=require(_0x0713('0x4'));var rp=require('request-promise');var attributes=require(_0x0713('0x5'));module[_0x0713('0x6')]=function(_0x3c72e3,_0x2b16ae){return _0x3c72e3[_0x0713('0x7')](_0x0713('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2fd9=['lodash','util','moment','./analyticFieldReport.attributes','exports','analytics_report_fields'];(function(_0x3ec0f3,_0xda8dd){var _0x993a12=function(_0x11175d){while(--_0x11175d){_0x3ec0f3['push'](_0x3ec0f3['shift']());}};_0x993a12(++_0xda8dd);}(_0x2fd9,0x19e));var _0x92fd=function(_0x500f5d,_0x5433a3){_0x500f5d=_0x500f5d-0x0;var _0x1f7498=_0x2fd9[_0x500f5d];return _0x1f7498;};'use strict';var _=require(_0x92fd('0x0'));var util=require(_0x92fd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x92fd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x92fd('0x3'));module[_0x92fd('0x4')]=function(_0x16b77b,_0x2ddac7){return _0x16b77b['define']('AnalyticFieldReport',attributes,{'tableName':_0x92fd('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6bb8aa4..d0e8871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c32=['request','info','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x399d35,_0x3aa411){var _0x5996fd=function(_0x72c33){while(--_0x72c33){_0x399d35['push'](_0x399d35['shift']());}};_0x5996fd(++_0x3aa411);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var moment=require(_0x26c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x26c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26c3('0x3'))['db'];var utils=require(_0x26c3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x26c3('0x5'));var jayson=require(_0x26c3('0x6'));var client=jayson[_0x26c3('0x7')][_0x26c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17bc12,_0x2756e5,_0x438a89){return new BPromise(function(_0x11ed3d,_0x2134b8){return client[_0x26c3('0x9')](_0x17bc12,_0x438a89)['then'](function(_0x561496){logger[_0x26c3('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'));logger[_0x26c3('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'),JSON[_0x26c3('0xd')](_0x561496));if(_0x561496[_0x26c3('0xe')]){if(_0x561496[_0x26c3('0xe')][_0x26c3('0xf')]===0x1f4){logger['error'](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);return _0x2134b8(_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);}logger[_0x26c3('0xe')](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')]['message']);return _0x11ed3d(_0x561496['error'][_0x26c3('0x11')]);}else{logger[_0x26c3('0xa')](_0x26c3('0x10'),_0x2756e5,_0x26c3('0xb'));_0x11ed3d(_0x561496[_0x26c3('0x12')][_0x26c3('0x11')]);}})['catch'](function(_0x2edaca){logger[_0x26c3('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2756e5,_0x2edaca);_0x2134b8(_0x2edaca);});});}
\ No newline at end of file
+var _0xb182=['message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4cd425,_0x130002){var _0x4b97af=function(_0x81858f){while(--_0x81858f){_0x4cd425['push'](_0x4cd425['shift']());}};_0x4b97af(++_0x130002);}(_0xb182,0x121));var _0x2b18=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0xb182[_0x15cdcb];return _0x37b069;};'use strict';var _=require('lodash');var util=require(_0x2b18('0x0'));var moment=require(_0x2b18('0x1'));var BPromise=require(_0x2b18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b18('0x3'))['db'];var utils=require(_0x2b18('0x4'));var logger=require(_0x2b18('0x5'))('rpc');var config=require(_0x2b18('0x6'));var jayson=require(_0x2b18('0x7'));var client=jayson[_0x2b18('0x8')][_0x2b18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3444c2,_0x25a701,_0xcfa0){return new BPromise(function(_0x5d08d8,_0x264ae2){return client[_0x2b18('0xa')](_0x3444c2,_0xcfa0)[_0x2b18('0xb')](function(_0x1600e){logger[_0x2b18('0xc')](_0x2b18('0xd'),_0x25a701,_0x2b18('0xe'));logger[_0x2b18('0xf')](_0x2b18('0x10'),_0x25a701,_0x2b18('0xe'),JSON[_0x2b18('0x11')](_0x1600e));if(_0x1600e[_0x2b18('0x12')]){if(_0x1600e[_0x2b18('0x12')]['code']===0x1f4){logger[_0x2b18('0x12')](_0x2b18('0xd'),_0x25a701,_0x1600e['error']['message']);return _0x264ae2(_0x1600e[_0x2b18('0x12')][_0x2b18('0x13')]);}logger[_0x2b18('0x12')](_0x2b18('0xd'),_0x25a701,_0x1600e[_0x2b18('0x12')][_0x2b18('0x13')]);return _0x5d08d8(_0x1600e[_0x2b18('0x12')][_0x2b18('0x13')]);}else{logger['info'](_0x2b18('0xd'),_0x25a701,_0x2b18('0xe'));_0x5d08d8(_0x1600e[_0x2b18('0x14')]['message']);}})[_0x2b18('0x15')](function(_0x52754f){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x25a701,_0x52754f);_0x264ae2(_0x52754f);});});}
\ No newline at end of file
index 16cfe76..260b2f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd404=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','bulkCreate','/:id/create_many','addFields','put','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','connect-timeout'];(function(_0x232866,_0x14b805){var _0x5cba7e=function(_0x47e953){while(--_0x47e953){_0x232866['push'](_0x232866['shift']());}};_0x5cba7e(++_0x14b805);}(_0xd404,0x15b));var _0x4d40=function(_0x53d0fb,_0x59b722){_0x53d0fb=_0x53d0fb-0x0;var _0x5633e8=_0xd404[_0x53d0fb];return _0x5633e8;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var auth=require(_0x4d40('0x4'));var interaction=require(_0x4d40('0x5'));var config=require(_0x4d40('0x6'));var controller=require(_0x4d40('0x7'));router[_0x4d40('0x8')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xa')]);router[_0x4d40('0x8')](_0x4d40('0xb'),auth['isAuthenticated'](),controller[_0x4d40('0xc')]);router[_0x4d40('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d40('0xe')]);router['post']('/create_many',auth[_0x4d40('0x9')](),controller[_0x4d40('0xf')]);router[_0x4d40('0xd')](_0x4d40('0x10'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x11')]);router[_0x4d40('0x12')](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x13')]);router[_0x4d40('0x14')](_0x4d40('0x15'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x16')]);router['delete'](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x17')]);module[_0x4d40('0x18')]=router;
\ No newline at end of file
+var _0x2bc6=['get','index','/:id','isAuthenticated','show','post','create','/create_many','/:id/create_many','put','update','delete','/destroy_many','destroy','exports','multer','util','path','../../components/interaction/service','./analyticFieldReport.controller'];(function(_0x46146d,_0x1ea821){var _0x2a408b=function(_0x8322c5){while(--_0x8322c5){_0x46146d['push'](_0x46146d['shift']());}};_0x2a408b(++_0x1ea821);}(_0x2bc6,0x163));var _0x62bc=function(_0x360bb1,_0x128f2f){_0x360bb1=_0x360bb1-0x0;var _0x28c4d3=_0x2bc6[_0x360bb1];return _0x28c4d3;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x62bc('0x3'));var config=require('../../config/environment');var controller=require(_0x62bc('0x4'));router[_0x62bc('0x5')]('/',auth['isAuthenticated'](),controller[_0x62bc('0x6')]);router[_0x62bc('0x5')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller[_0x62bc('0x9')]);router[_0x62bc('0xa')]('/',auth['isAuthenticated'](),controller[_0x62bc('0xb')]);router[_0x62bc('0xa')](_0x62bc('0xc'),auth[_0x62bc('0x8')](),controller['bulkCreate']);router[_0x62bc('0xa')](_0x62bc('0xd'),auth[_0x62bc('0x8')](),controller['addFields']);router[_0x62bc('0xe')](_0x62bc('0x7'),auth[_0x62bc('0x8')](),controller[_0x62bc('0xf')]);router[_0x62bc('0x10')](_0x62bc('0x11'),auth[_0x62bc('0x8')](),controller['bulkDestroy']);router[_0x62bc('0x10')](_0x62bc('0x7'),auth['isAuthenticated'](),controller[_0x62bc('0x12')]);module[_0x62bc('0x13')]=router;
\ No newline at end of file
index 74b8920..ce75f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8353=['STRING','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8353,0x1bc));var _0x3835=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x8353[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3835('0x0')],'allowNull':![],'unique':_0x3835('0x1')},'table':{'type':Sequelize[_0x3835('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x3835('0x0')]}};
\ No newline at end of file
+var _0xaa66=['name','STRING','sequelize'];(function(_0x4bfb94,_0x57e844){var _0x55bde6=function(_0x2ea3c1){while(--_0x2ea3c1){_0x4bfb94['push'](_0x4bfb94['shift']());}};_0x55bde6(++_0x57e844);}(_0xaa66,0x1d0));var _0x6aa6=function(_0x56122e,_0x5c6033){_0x56122e=_0x56122e-0x0;var _0x5b2382=_0xaa66[_0x56122e];return _0x5b2382;};'use strict';var Sequelize=require(_0x6aa6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6aa6('0x1')},'table':{'type':Sequelize[_0x6aa6('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x6aa6('0x2')]}};
\ No newline at end of file
index 98aeec5..169ec05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7574=['lodash','squel','crypto','jsforce','ioredis','../../config/logger','api','../../mysqldb','status','end','json','count','limit','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','sendStatus','error','stack','name','index','AnalyticMetric','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','add','day','merge','filter','type','key','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0xd74a4f,_0x547876){var _0x3a488a=function(_0x488b88){while(--_0x488b88){_0xd74a4f['push'](_0xd74a4f['shift']());}};_0x3a488a(++_0x547876);}(_0x7574,0x93));var _0x4757=function(_0x421f2e,_0x350302){_0x421f2e=_0x421f2e-0x0;var _0x3ea9f5=_0x7574[_0x421f2e];return _0x3ea9f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4757('0x0'));var rimraf=require(_0x4757('0x1'));var zipdir=require(_0x4757('0x2'));var jsonpatch=require(_0x4757('0x3'));var rp=require('request-promise');var moment=require(_0x4757('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4757('0x5'));var util=require(_0x4757('0x6'));var path=require(_0x4757('0x7'));var sox=require(_0x4757('0x8'));var csv=require(_0x4757('0x9'));var ejs=require(_0x4757('0xa'));var fs=require('fs');var _=require(_0x4757('0xb'));var squel=require(_0x4757('0xc'));var crypto=require(_0x4757('0xd'));var jsforce=require(_0x4757('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4757('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4757('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x4757('0x10'))(_0x4757('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4757('0x12'))['db'];function respondWithStatusCode(_0x552677,_0x52d6de){_0x52d6de=_0x52d6de||0xcc;return function(_0x260e7c){if(_0x260e7c){return _0x552677['sendStatus'](_0x52d6de);}return _0x552677[_0x4757('0x13')](_0x52d6de)[_0x4757('0x14')]();};}function respondWithResult(_0xc7b8a3,_0x13b833){_0x13b833=_0x13b833||0xc8;return function(_0x11e68f){if(_0x11e68f){return _0xc7b8a3[_0x4757('0x13')](_0x13b833)[_0x4757('0x15')](_0x11e68f);}};}function respondWithFilteredResult(_0x223d8e,_0x47c977){return function(_0x43c6ad){if(_0x43c6ad){var _0x530192=_0x43c6ad[_0x4757('0x16')],_0xcd75b=_0x47c977['offset'],_0x4cd612=_0x47c977['offset']+_0x47c977[_0x4757('0x17')],_0x5298a3;if(_0x4cd612>=_0x530192){_0x4cd612=_0x530192;_0x5298a3=0xc8;}else{_0x5298a3=0xce;}_0x223d8e[_0x4757('0x13')](_0x5298a3);return _0x223d8e[_0x4757('0x18')](_0x4757('0x19'),_0xcd75b+'-'+_0x4cd612+'/'+_0x530192)[_0x4757('0x15')](_0x43c6ad);}return null;};}function patchUpdates(_0x3f9860){return function(_0x23330d){try{jsonpatch['apply'](_0x23330d,_0x3f9860,!![]);}catch(_0xcab545){return BPromise[_0x4757('0x1a')](_0xcab545);}return _0x23330d[_0x4757('0x1b')]();};}function saveUpdates(_0x51fba9,_0xce0bf7){return function(_0xeff675){if(_0xeff675){return _0xeff675[_0x4757('0x1c')](_0x51fba9)[_0x4757('0x1d')](function(_0x311bb9){return _0x311bb9;});}return null;};}function removeEntity(_0x1d22f0,_0x303a3f){return function(_0x448b37){if(_0x448b37){return _0x448b37['destroy']()['then'](function(){var _0x42cef6=_0x448b37[_0x4757('0x1e')]({'plain':!![]});var _0x42ae32=_0x4757('0x1f');return db[_0x4757('0x20')][_0x4757('0x21')]({'where':{'type':_0x42ae32,'resourceId':_0x42cef6['id']}})[_0x4757('0x1d')](function(){return _0x448b37;});})[_0x4757('0x1d')](function(){_0x1d22f0[_0x4757('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41df61,_0x2fecdc){return function(_0x271e68){if(!_0x271e68){_0x41df61[_0x4757('0x22')](0x194);}return _0x271e68;};}function handleError(_0x1accf1,_0x476d2a){_0x476d2a=_0x476d2a||0x1f4;return function(_0x4e78d8){logger[_0x4757('0x23')](_0x4e78d8[_0x4757('0x24')]);if(_0x4e78d8['name']){delete _0x4e78d8[_0x4757('0x25')];}_0x1accf1['status'](_0x476d2a)['send'](_0x4e78d8);};}exports[_0x4757('0x26')]=function(_0x301fc6,_0x517932){var _0x31c98d={},_0x11c9a5={},_0x525053={'count':0x0,'rows':[]};var _0x3e1f52=db[_0x4757('0x27')][_0x4757('0x28')];_0x11c9a5[_0x4757('0x29')]=_[_0x4757('0x2a')](_0x3e1f52);var _0x5010d7={'dateStart':_0x301fc6[_0x4757('0x2b')][_0x4757('0x2c')],'dateEnd':_0x301fc6[_0x4757('0x2b')][_0x4757('0x2d')]};delete _0x301fc6[_0x4757('0x2b')][_0x4757('0x2c')];delete _0x301fc6[_0x4757('0x2b')][_0x4757('0x2d')];_0x11c9a5[_0x4757('0x2b')]=_[_0x4757('0x2a')](_0x301fc6[_0x4757('0x2b')]);_0x11c9a5[_0x4757('0x2e')]=_['intersection'](_0x11c9a5[_0x4757('0x29')],_0x11c9a5[_0x4757('0x2b')]);_0x31c98d[_0x4757('0x2f')]=_[_0x4757('0x30')](_0x11c9a5[_0x4757('0x29')],qs[_0x4757('0x31')](_0x301fc6[_0x4757('0x2b')]['fields']));_0x31c98d['attributes']=_0x31c98d[_0x4757('0x2f')][_0x4757('0x32')]?_0x31c98d['attributes']:_0x11c9a5[_0x4757('0x29')];if(!_0x301fc6[_0x4757('0x2b')][_0x4757('0x33')](_0x4757('0x34'))){_0x31c98d[_0x4757('0x17')]=qs['limit'](_0x301fc6[_0x4757('0x2b')][_0x4757('0x17')]);_0x31c98d[_0x4757('0x35')]=qs[_0x4757('0x35')](_0x301fc6[_0x4757('0x2b')]['offset']);}_0x31c98d['order']=qs[_0x4757('0x36')](_0x301fc6[_0x4757('0x2b')][_0x4757('0x36')]);_0x31c98d[_0x4757('0x37')]=qs[_0x4757('0x2e')](_[_0x4757('0x38')](_0x301fc6[_0x4757('0x2b')],_0x11c9a5['filters']));if(_0x5010d7[_0x4757('0x2c')]){if(_0x5010d7[_0x4757('0x2d')]){_0x5010d7[_0x4757('0x2d')]=moment(_0x5010d7[_0x4757('0x2d')])[_0x4757('0x39')](0x1,_0x4757('0x3a'));}else{_0x5010d7[_0x4757('0x2d')]=moment(_0x5010d7['dateStart'])[_0x4757('0x39')](0x1,'day');}_[_0x4757('0x3b')](_0x31c98d[_0x4757('0x37')],{'createdAt':{'$gte':_0x5010d7[_0x4757('0x2c')],'$lte':_0x5010d7[_0x4757('0x2d')]}});}if(_0x301fc6[_0x4757('0x2b')][_0x4757('0x3c')]){_0x31c98d[_0x4757('0x37')]=_[_0x4757('0x3b')](_0x31c98d[_0x4757('0x37')],{'$or':_['map'](_0x3e1f52,function(_0x171e50){if(_0x171e50[_0x4757('0x3d')][_0x4757('0x3e')]!==_0x4757('0x3f')){var _0x2a598e={};_0x2a598e[_0x171e50['field']]={'$like':'%'+_0x301fc6[_0x4757('0x2b')][_0x4757('0x3c')]+'%'};return _0x2a598e;}})});}_0x31c98d=_[_0x4757('0x3b')]({},_0x31c98d,_0x301fc6['options']);var _0x2cc620={'where':_0x31c98d['where']};return db[_0x4757('0x27')]['count'](_0x2cc620)[_0x4757('0x1d')](function(_0x580880){_0x525053[_0x4757('0x16')]=_0x580880;if(_0x301fc6[_0x4757('0x2b')][_0x4757('0x40')]){_0x31c98d[_0x4757('0x41')]=[{'all':!![]}];}return db[_0x4757('0x27')]['findAll'](_0x31c98d);})[_0x4757('0x1d')](function(_0x423635){_0x525053[_0x4757('0x42')]=_0x423635;return _0x525053;})['then'](respondWithFilteredResult(_0x517932,_0x31c98d))[_0x4757('0x43')](handleError(_0x517932,null));};exports[_0x4757('0x44')]=function(_0x46c5ff,_0x140eef){var _0x2619be={'raw':!![],'where':{'id':_0x46c5ff[_0x4757('0x45')]['id']}},_0x82df03={};_0x82df03[_0x4757('0x29')]=_[_0x4757('0x2a')](db[_0x4757('0x27')][_0x4757('0x28')]);_0x82df03['query']=_['keys'](_0x46c5ff[_0x4757('0x2b')]);_0x82df03['filters']=_[_0x4757('0x30')](_0x82df03[_0x4757('0x29')],_0x82df03['query']);_0x2619be[_0x4757('0x2f')]=_[_0x4757('0x30')](_0x82df03[_0x4757('0x29')],qs[_0x4757('0x31')](_0x46c5ff[_0x4757('0x2b')]['fields']));_0x2619be['attributes']=_0x2619be[_0x4757('0x2f')][_0x4757('0x32')]?_0x2619be[_0x4757('0x2f')]:_0x82df03[_0x4757('0x29')];if(_0x46c5ff['query'][_0x4757('0x40')]){_0x2619be[_0x4757('0x41')]=[{'all':!![]}];}_0x2619be=_[_0x4757('0x3b')]({},_0x2619be,_0x46c5ff['options']);return db['AnalyticMetric'][_0x4757('0x46')](_0x2619be)[_0x4757('0x1d')](handleEntityNotFound(_0x140eef,null))[_0x4757('0x1d')](respondWithResult(_0x140eef,null))[_0x4757('0x43')](handleError(_0x140eef,null));};exports[_0x4757('0x47')]=function(_0x4abefd,_0x237fd7){return db[_0x4757('0x27')][_0x4757('0x47')](_0x4abefd['body'],{})[_0x4757('0x1d')](function(_0x5e3ca3){var _0xc265c=_0x4abefd[_0x4757('0x48')][_0x4757('0x1e')]({'plain':!![]});if(!_0xc265c)throw new Error(_0x4757('0x49'));if(_0xc265c[_0x4757('0x4a')]===_0x4757('0x48')){var _0x280719=_0x5e3ca3[_0x4757('0x1e')]({'plain':!![]});var _0x3a43ef='Metrics';return db['UserProfileSection'][_0x4757('0x46')]({'where':{'name':_0x3a43ef,'userProfileId':_0xc265c[_0x4757('0x4b')]},'raw':!![]})[_0x4757('0x1d')](function(_0x31214c){if(_0x31214c&&_0x31214c[_0x4757('0x4c')]===0x0){return db['UserProfileResource'][_0x4757('0x47')]({'name':_0x280719[_0x4757('0x25')],'resourceId':_0x280719['id'],'type':_0x31214c['name'],'sectionId':_0x31214c['id']},{})['then'](function(){return _0x5e3ca3;});}else{return _0x5e3ca3;}})[_0x4757('0x43')](function(_0x3359fe){logger[_0x4757('0x23')](_0x4757('0x4d'),_0x3359fe);throw _0x3359fe;});}return _0x5e3ca3;})['then'](respondWithResult(_0x237fd7,0xc9))[_0x4757('0x43')](handleError(_0x237fd7,null));};exports[_0x4757('0x1c')]=function(_0x1402b6,_0x589ae7){if(_0x1402b6[_0x4757('0x4e')]['id']){delete _0x1402b6[_0x4757('0x4e')]['id'];}return db['AnalyticMetric'][_0x4757('0x46')]({'where':{'id':_0x1402b6[_0x4757('0x45')]['id']}})[_0x4757('0x1d')](handleEntityNotFound(_0x589ae7,null))['then'](saveUpdates(_0x1402b6[_0x4757('0x4e')],null))[_0x4757('0x1d')](respondWithResult(_0x589ae7,null))['catch'](handleError(_0x589ae7,null));};exports['destroy']=function(_0x54a8c8,_0x526645){return db[_0x4757('0x27')]['find']({'where':{'id':_0x54a8c8[_0x4757('0x45')]['id']}})[_0x4757('0x1d')](handleEntityNotFound(_0x526645,null))[_0x4757('0x1d')](removeEntity(_0x526645,null))[_0x4757('0x43')](handleError(_0x526645,null));};
\ No newline at end of file
+var _0x557b=['UserProfileResource','error','name','index','AnalyticMetric','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','add','day','merge','filter','map','field','options','count','findAll','rows','catch','show','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x582c4a,_0x431151){var _0x45dd76=function(_0xde00f4){while(--_0xde00f4){_0x582c4a['push'](_0x582c4a['shift']());}};_0x45dd76(++_0x431151);}(_0x557b,0x1cd));var _0xb557=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x557b[_0x138f59];return _0x3d114d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb557('0x0'));var rimraf=require(_0xb557('0x1'));var zipdir=require(_0xb557('0x2'));var jsonpatch=require(_0xb557('0x3'));var rp=require('request-promise');var moment=require(_0xb557('0x4'));var BPromise=require(_0xb557('0x5'));var Mustache=require(_0xb557('0x6'));var util=require(_0xb557('0x7'));var path=require(_0xb557('0x8'));var sox=require(_0xb557('0x9'));var csv=require(_0xb557('0xa'));var ejs=require(_0xb557('0xb'));var fs=require('fs');var _=require(_0xb557('0xc'));var squel=require('squel');var crypto=require(_0xb557('0xd'));var jsforce=require(_0xb557('0xe'));var deskjs=require(_0xb557('0xf'));var toCsv=require(_0xb557('0xa'));var querystring=require('querystring');var Papa=require(_0xb557('0x10'));var Redis=require(_0xb557('0x11'));var qs=require(_0xb557('0x12'));var logger=require(_0xb557('0x13'))(_0xb557('0x14'));var utils=require(_0xb557('0x15'));var config=require(_0xb557('0x16'));var db=require(_0xb557('0x17'))['db'];function respondWithStatusCode(_0x6eb0d1,_0x474847){_0x474847=_0x474847||0xcc;return function(_0x108ca5){if(_0x108ca5){return _0x6eb0d1[_0xb557('0x18')](_0x474847);}return _0x6eb0d1[_0xb557('0x19')](_0x474847)[_0xb557('0x1a')]();};}function respondWithResult(_0x166fa0,_0x30ddf1){_0x30ddf1=_0x30ddf1||0xc8;return function(_0x458360){if(_0x458360){return _0x166fa0[_0xb557('0x19')](_0x30ddf1)['json'](_0x458360);}};}function respondWithFilteredResult(_0x4b68c3,_0x33b31e){return function(_0x4406d6){if(_0x4406d6){var _0xcb649e=_0x4406d6['count'],_0x34a5d2=_0x33b31e['offset'],_0x27a46d=_0x33b31e[_0xb557('0x1b')]+_0x33b31e['limit'],_0x2e5c3a;if(_0x27a46d>=_0xcb649e){_0x27a46d=_0xcb649e;_0x2e5c3a=0xc8;}else{_0x2e5c3a=0xce;}_0x4b68c3[_0xb557('0x19')](_0x2e5c3a);return _0x4b68c3[_0xb557('0x1c')](_0xb557('0x1d'),_0x34a5d2+'-'+_0x27a46d+'/'+_0xcb649e)['json'](_0x4406d6);}return null;};}function patchUpdates(_0x1fb8b9){return function(_0xdabfdc){try{jsonpatch[_0xb557('0x1e')](_0xdabfdc,_0x1fb8b9,!![]);}catch(_0x488f2){return BPromise[_0xb557('0x1f')](_0x488f2);}return _0xdabfdc[_0xb557('0x20')]();};}function saveUpdates(_0x34d8d1,_0x32ee45){return function(_0x6bce0a){if(_0x6bce0a){return _0x6bce0a[_0xb557('0x21')](_0x34d8d1)[_0xb557('0x22')](function(_0x142439){return _0x142439;});}return null;};}function removeEntity(_0x197224,_0xfd3967){return function(_0x38819a){if(_0x38819a){return _0x38819a[_0xb557('0x23')]()[_0xb557('0x22')](function(){var _0x2b3e0a=_0x38819a[_0xb557('0x24')]({'plain':!![]});var _0x5047ec='Metrics';return db[_0xb557('0x25')][_0xb557('0x23')]({'where':{'type':_0x5047ec,'resourceId':_0x2b3e0a['id']}})[_0xb557('0x22')](function(){return _0x38819a;});})['then'](function(){_0x197224[_0xb557('0x19')](0xcc)[_0xb557('0x1a')]();});}};}function handleEntityNotFound(_0x389097,_0x46084b){return function(_0x3c9118){if(!_0x3c9118){_0x389097[_0xb557('0x18')](0x194);}return _0x3c9118;};}function handleError(_0x1ea663,_0x546a74){_0x546a74=_0x546a74||0x1f4;return function(_0x5c1118){logger[_0xb557('0x26')](_0x5c1118['stack']);if(_0x5c1118[_0xb557('0x27')]){delete _0x5c1118[_0xb557('0x27')];}_0x1ea663[_0xb557('0x19')](_0x546a74)['send'](_0x5c1118);};}exports[_0xb557('0x28')]=function(_0x34d4dd,_0x57abe2){var _0x46aac0={},_0x24fd4c={},_0x5bcf3d={'count':0x0,'rows':[]};var _0x39020a=db[_0xb557('0x29')][_0xb557('0x2a')];_0x24fd4c[_0xb557('0x2b')]=_[_0xb557('0x2c')](_0x39020a);var _0x3b4661={'dateStart':_0x34d4dd[_0xb557('0x2d')]['dateStart'],'dateEnd':_0x34d4dd[_0xb557('0x2d')][_0xb557('0x2e')]};delete _0x34d4dd['query'][_0xb557('0x2f')];delete _0x34d4dd[_0xb557('0x2d')][_0xb557('0x2e')];_0x24fd4c['query']=_['keys'](_0x34d4dd[_0xb557('0x2d')]);_0x24fd4c[_0xb557('0x30')]=_[_0xb557('0x31')](_0x24fd4c[_0xb557('0x2b')],_0x24fd4c[_0xb557('0x2d')]);_0x46aac0[_0xb557('0x32')]=_['intersection'](_0x24fd4c[_0xb557('0x2b')],qs[_0xb557('0x33')](_0x34d4dd[_0xb557('0x2d')]['fields']));_0x46aac0['attributes']=_0x46aac0[_0xb557('0x32')][_0xb557('0x34')]?_0x46aac0[_0xb557('0x32')]:_0x24fd4c[_0xb557('0x2b')];if(!_0x34d4dd[_0xb557('0x2d')][_0xb557('0x35')]('nolimit')){_0x46aac0[_0xb557('0x36')]=qs[_0xb557('0x36')](_0x34d4dd[_0xb557('0x2d')][_0xb557('0x36')]);_0x46aac0[_0xb557('0x1b')]=qs[_0xb557('0x1b')](_0x34d4dd[_0xb557('0x2d')][_0xb557('0x1b')]);}_0x46aac0[_0xb557('0x37')]=qs[_0xb557('0x38')](_0x34d4dd[_0xb557('0x2d')]['sort']);_0x46aac0[_0xb557('0x39')]=qs['filters'](_[_0xb557('0x3a')](_0x34d4dd[_0xb557('0x2d')],_0x24fd4c[_0xb557('0x30')]));if(_0x3b4661[_0xb557('0x2f')]){if(_0x3b4661[_0xb557('0x2e')]){_0x3b4661[_0xb557('0x2e')]=moment(_0x3b4661[_0xb557('0x2e')])[_0xb557('0x3b')](0x1,_0xb557('0x3c'));}else{_0x3b4661['dateEnd']=moment(_0x3b4661['dateStart'])[_0xb557('0x3b')](0x1,_0xb557('0x3c'));}_[_0xb557('0x3d')](_0x46aac0['where'],{'createdAt':{'$gte':_0x3b4661[_0xb557('0x2f')],'$lte':_0x3b4661[_0xb557('0x2e')]}});}if(_0x34d4dd[_0xb557('0x2d')][_0xb557('0x3e')]){_0x46aac0[_0xb557('0x39')]=_[_0xb557('0x3d')](_0x46aac0[_0xb557('0x39')],{'$or':_[_0xb557('0x3f')](_0x39020a,function(_0x491107){if(_0x491107['type']['key']!=='VIRTUAL'){var _0x4d25c8={};_0x4d25c8[_0x491107[_0xb557('0x40')]]={'$like':'%'+_0x34d4dd[_0xb557('0x2d')][_0xb557('0x3e')]+'%'};return _0x4d25c8;}})});}_0x46aac0=_['merge']({},_0x46aac0,_0x34d4dd[_0xb557('0x41')]);var _0x21169a={'where':_0x46aac0['where']};return db['AnalyticMetric']['count'](_0x21169a)[_0xb557('0x22')](function(_0x1a1aab){_0x5bcf3d[_0xb557('0x42')]=_0x1a1aab;if(_0x34d4dd[_0xb557('0x2d')]['includeAll']){_0x46aac0['include']=[{'all':!![]}];}return db[_0xb557('0x29')][_0xb557('0x43')](_0x46aac0);})[_0xb557('0x22')](function(_0x351404){_0x5bcf3d[_0xb557('0x44')]=_0x351404;return _0x5bcf3d;})[_0xb557('0x22')](respondWithFilteredResult(_0x57abe2,_0x46aac0))[_0xb557('0x45')](handleError(_0x57abe2,null));};exports[_0xb557('0x46')]=function(_0x53cb77,_0x14ac07){var _0x5776b2={'raw':!![],'where':{'id':_0x53cb77[_0xb557('0x47')]['id']}},_0x363aa0={};_0x363aa0[_0xb557('0x2b')]=_[_0xb557('0x2c')](db[_0xb557('0x29')][_0xb557('0x2a')]);_0x363aa0[_0xb557('0x2d')]=_[_0xb557('0x2c')](_0x53cb77[_0xb557('0x2d')]);_0x363aa0[_0xb557('0x30')]=_[_0xb557('0x31')](_0x363aa0[_0xb557('0x2b')],_0x363aa0[_0xb557('0x2d')]);_0x5776b2[_0xb557('0x32')]=_['intersection'](_0x363aa0['model'],qs[_0xb557('0x33')](_0x53cb77[_0xb557('0x2d')][_0xb557('0x33')]));_0x5776b2[_0xb557('0x32')]=_0x5776b2[_0xb557('0x32')][_0xb557('0x34')]?_0x5776b2[_0xb557('0x32')]:_0x363aa0[_0xb557('0x2b')];if(_0x53cb77[_0xb557('0x2d')][_0xb557('0x48')]){_0x5776b2[_0xb557('0x49')]=[{'all':!![]}];}_0x5776b2=_['merge']({},_0x5776b2,_0x53cb77[_0xb557('0x41')]);return db[_0xb557('0x29')][_0xb557('0x4a')](_0x5776b2)['then'](handleEntityNotFound(_0x14ac07,null))[_0xb557('0x22')](respondWithResult(_0x14ac07,null))['catch'](handleError(_0x14ac07,null));};exports[_0xb557('0x4b')]=function(_0x4964ff,_0x2d6ae3){return db[_0xb557('0x29')][_0xb557('0x4b')](_0x4964ff[_0xb557('0x4c')],{})[_0xb557('0x22')](function(_0xbf8209){var _0x84fd3=_0x4964ff['user'][_0xb557('0x24')]({'plain':!![]});if(!_0x84fd3)throw new Error(_0xb557('0x4d'));if(_0x84fd3[_0xb557('0x4e')]===_0xb557('0x4f')){var _0x193125=_0xbf8209['get']({'plain':!![]});var _0x220277=_0xb557('0x50');return db[_0xb557('0x51')][_0xb557('0x4a')]({'where':{'name':_0x220277,'userProfileId':_0x84fd3['userProfileId']},'raw':!![]})[_0xb557('0x22')](function(_0x153b67){if(_0x153b67&&_0x153b67['autoAssociation']===0x0){return db[_0xb557('0x25')][_0xb557('0x4b')]({'name':_0x193125[_0xb557('0x27')],'resourceId':_0x193125['id'],'type':_0x153b67[_0xb557('0x27')],'sectionId':_0x153b67['id']},{})['then'](function(){return _0xbf8209;});}else{return _0xbf8209;}})[_0xb557('0x45')](function(_0x13a390){logger[_0xb557('0x26')](_0xb557('0x52'),_0x13a390);throw _0x13a390;});}return _0xbf8209;})['then'](respondWithResult(_0x2d6ae3,0xc9))['catch'](handleError(_0x2d6ae3,null));};exports[_0xb557('0x21')]=function(_0x40dd9f,_0x4d81af){if(_0x40dd9f[_0xb557('0x4c')]['id']){delete _0x40dd9f[_0xb557('0x4c')]['id'];}return db[_0xb557('0x29')][_0xb557('0x4a')]({'where':{'id':_0x40dd9f[_0xb557('0x47')]['id']}})[_0xb557('0x22')](handleEntityNotFound(_0x4d81af,null))[_0xb557('0x22')](saveUpdates(_0x40dd9f[_0xb557('0x4c')],null))[_0xb557('0x22')](respondWithResult(_0x4d81af,null))[_0xb557('0x45')](handleError(_0x4d81af,null));};exports['destroy']=function(_0x1d06fd,_0x47c273){return db[_0xb557('0x29')][_0xb557('0x4a')]({'where':{'id':_0x1d06fd[_0xb557('0x47')]['id']}})[_0xb557('0x22')](handleEntityNotFound(_0x47c273,null))[_0xb557('0x22')](removeEntity(_0x47c273,null))['catch'](handleError(_0x47c273,null));};
\ No newline at end of file
index 2bb1ef3..006c61a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41aa=['bluebird','request-promise','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x3a59c3,_0x4ae47e){var _0x9c93e9=function(_0x2cd848){while(--_0x2cd848){_0x3a59c3['push'](_0x3a59c3['shift']());}};_0x9c93e9(++_0x4ae47e);}(_0x41aa,0x101));var _0xa41a=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x41aa[_0x111e94];return _0x3de107;};'use strict';var _=require(_0xa41a('0x0'));var util=require(_0xa41a('0x1'));var logger=require(_0xa41a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa41a('0x3'));var rp=require(_0xa41a('0x4'));var attributes=require(_0xa41a('0x5'));module[_0xa41a('0x6')]=function(_0xb98d20,_0x85a54){return _0xb98d20[_0xa41a('0x7')](_0xa41a('0x8'),attributes,{'tableName':_0xa41a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9988=['api','request-promise','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','../../config/logger'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x9988,0x1ae));var _0x8998=function(_0x45397c,_0x24c4f5){_0x45397c=_0x45397c-0x0;var _0x41c704=_0x9988[_0x45397c];return _0x41c704;};'use strict';var _=require(_0x8998('0x0'));var util=require('util');var logger=require(_0x8998('0x1'))(_0x8998('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8998('0x3'));var attributes=require(_0x8998('0x4'));module[_0x8998('0x5')]=function(_0x508e54,_0x3c94cb){return _0x508e54[_0x8998('0x6')](_0x8998('0x7'),attributes,{'tableName':_0x8998('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7d47134..2c22cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb5d=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xeb5d[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var moment=require(_0xdeb5('0x1'));var BPromise=require(_0xdeb5('0x2'));var rs=require(_0xdeb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdeb5('0x4'));var logger=require(_0xdeb5('0x5'))('rpc');var config=require(_0xdeb5('0x6'));var jayson=require(_0xdeb5('0x7'));var client=jayson[_0xdeb5('0x8')][_0xdeb5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120329,_0x12484b,_0x328d6b){return new BPromise(function(_0x35c086,_0x2c8509){return client[_0xdeb5('0xa')](_0x120329,_0x328d6b)[_0xdeb5('0xb')](function(_0x2114ba){logger[_0xdeb5('0xc')](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));logger[_0xdeb5('0xf')](_0xdeb5('0x10'),_0x12484b,'request\x20sent',JSON[_0xdeb5('0x11')](_0x2114ba));if(_0x2114ba[_0xdeb5('0x12')]){if(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x13')]===0x1f4){logger[_0xdeb5('0x12')](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x2c8509(_0x2114ba['error'][_0xdeb5('0x14')]);}logger['error'](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x35c086(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);}else{logger['info'](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));_0x35c086(_0x2114ba['result'][_0xdeb5('0x14')]);}})[_0xdeb5('0x15')](function(_0x3521b2){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x12484b,_0x3521b2);_0x2c8509(_0x3521b2);});});}
\ No newline at end of file
+var _0x3a5e=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s'];(function(_0x5cf99f,_0x450e05){var _0xeedf3a=function(_0x21f600){while(--_0x21f600){_0x5cf99f['push'](_0x5cf99f['shift']());}};_0xeedf3a(++_0x450e05);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x3db2cd,_0x492cf8){_0x3db2cd=_0x3db2cd-0x0;var _0x13525e=_0x3a5e[_0x3db2cd];return _0x13525e;};'use strict';var _=require(_0xe3a5('0x0'));var util=require(_0xe3a5('0x1'));var moment=require(_0xe3a5('0x2'));var BPromise=require(_0xe3a5('0x3'));var rs=require(_0xe3a5('0x4'));var fs=require('fs');var Redis=require(_0xe3a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3a5('0x6'));var logger=require(_0xe3a5('0x7'))(_0xe3a5('0x8'));var config=require(_0xe3a5('0x9'));var jayson=require(_0xe3a5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ad90a,_0x4ff682,_0x8b22ec){return new BPromise(function(_0x32fab4,_0x2d133b){return client[_0xe3a5('0xb')](_0x3ad90a,_0x8b22ec)[_0xe3a5('0xc')](function(_0x2c37d1){logger[_0xe3a5('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x4ff682,_0xe3a5('0xe'));logger[_0xe3a5('0xf')](_0xe3a5('0x10'),_0x4ff682,_0xe3a5('0xe'),JSON['stringify'](_0x2c37d1));if(_0x2c37d1[_0xe3a5('0x11')]){if(_0x2c37d1[_0xe3a5('0x11')][_0xe3a5('0x12')]===0x1f4){logger[_0xe3a5('0x11')](_0xe3a5('0x13'),_0x4ff682,_0x2c37d1[_0xe3a5('0x11')]['message']);return _0x2d133b(_0x2c37d1[_0xe3a5('0x11')][_0xe3a5('0x14')]);}logger[_0xe3a5('0x11')](_0xe3a5('0x13'),_0x4ff682,_0x2c37d1[_0xe3a5('0x11')][_0xe3a5('0x14')]);return _0x32fab4(_0x2c37d1[_0xe3a5('0x11')][_0xe3a5('0x14')]);}else{logger[_0xe3a5('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x4ff682,'request\x20sent');_0x32fab4(_0x2c37d1[_0xe3a5('0x15')][_0xe3a5('0x14')]);}})['catch'](function(_0x40f0be){logger[_0xe3a5('0x11')](_0xe3a5('0x13'),_0x4ff682,_0x40f0be);_0x2d133b(_0x40f0be);});});}
\ No newline at end of file
index 6232fed..dd4a574 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b12=['index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x478708,_0x816b6c){var _0x5c4bf0=function(_0x296658){while(--_0x296658){_0x478708['push'](_0x478708['shift']());}};_0x5c4bf0(++_0x816b6c);}(_0x5b12,0xa3));var _0x25b1=function(_0x5a1f44,_0x450078){_0x5a1f44=_0x5a1f44-0x0;var _0x4151a7=_0x5b12[_0x5a1f44];return _0x4151a7;};'use strict';var multer=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var path=require(_0x25b1('0x2'));var timeout=require('connect-timeout');var express=require(_0x25b1('0x3'));var router=express['Router']();var auth=require(_0x25b1('0x4'));var interaction=require(_0x25b1('0x5'));var config=require('../../config/environment');var controller=require(_0x25b1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x25b1('0x7')]);router['get']('/:id',auth[_0x25b1('0x8')](),controller[_0x25b1('0x9')]);router[_0x25b1('0xa')]('/',auth[_0x25b1('0x8')](),controller[_0x25b1('0xb')]);router[_0x25b1('0xc')](_0x25b1('0xd'),auth[_0x25b1('0x8')](),controller['update']);router[_0x25b1('0xe')](_0x25b1('0xd'),auth[_0x25b1('0x8')](),controller[_0x25b1('0xf')]);module[_0x25b1('0x10')]=router;
\ No newline at end of file
+var _0xcae2=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy'];(function(_0x459c7d,_0x1771b5){var _0x2e676f=function(_0x1e31e0){while(--_0x1e31e0){_0x459c7d['push'](_0x459c7d['shift']());}};_0x2e676f(++_0x1771b5);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var path=require(_0x2cae('0x2'));var timeout=require(_0x2cae('0x3'));var express=require(_0x2cae('0x4'));var router=express[_0x2cae('0x5')]();var auth=require(_0x2cae('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2cae('0x7'));var controller=require(_0x2cae('0x8'));router[_0x2cae('0x9')]('/',auth[_0x2cae('0xa')](),controller['index']);router[_0x2cae('0x9')](_0x2cae('0xb'),auth[_0x2cae('0xa')](),controller[_0x2cae('0xc')]);router[_0x2cae('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x2cae('0xa')](),controller[_0x2cae('0xe')]);router[_0x2cae('0xf')](_0x2cae('0xb'),auth[_0x2cae('0xa')](),controller[_0x2cae('0x10')]);module['exports']=router;
\ No newline at end of file
index ccc4e7a..8352a86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc7b=['sequelize','exports'];(function(_0x37fd9d,_0x227b47){var _0x45d964=function(_0x463ce8){while(--_0x463ce8){_0x37fd9d['push'](_0x37fd9d['shift']());}};_0x45d964(++_0x227b47);}(_0xbc7b,0x1a0));var _0xbbc7=function(_0x334c37,_0x396a01){_0x334c37=_0x334c37-0x0;var _0x5ab859=_0xbc7b[_0x334c37];return _0x5ab859;};'use strict';var Sequelize=require(_0xbbc7('0x0'));module[_0xbbc7('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xa3c4=['TEXT','sequelize','exports'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0xa3c4,0x1db));var _0x4a3c=function(_0x987a44,_0x2d3a38){_0x987a44=_0x987a44-0x0;var _0x5a3dbf=_0xa3c4[_0x987a44];return _0x5a3dbf;};'use strict';var Sequelize=require(_0x4a3c('0x0'));module[_0x4a3c('0x1')]={'tree':{'type':Sequelize[_0x4a3c('0x2')],'allowNull':![]}};
\ No newline at end of file
index 2dd2a84..fded752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf290=['body','destroy','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','error','name','send','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','day','merge','map','key','VIRTUAL','field','filter','options','AnalyticTreeReport','count','includeAll','include','findAll','rows','show','params','fields','length','catch','create'];(function(_0x5bdb83,_0x3605de){var _0x1986bb=function(_0x2d6e94){while(--_0x2d6e94){_0x5bdb83['push'](_0x5bdb83['shift']());}};_0x1986bb(++_0x3605de);}(_0xf290,0xde));var _0x0f29=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0xf290[_0x142ec2];return _0x45ef4e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0f29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f29('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f29('0x2'));var moment=require(_0x0f29('0x3'));var BPromise=require(_0x0f29('0x4'));var Mustache=require(_0x0f29('0x5'));var util=require(_0x0f29('0x6'));var path=require('path');var sox=require(_0x0f29('0x7'));var csv=require('to-csv');var ejs=require(_0x0f29('0x8'));var fs=require('fs');var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0xe'));var querystring=require(_0x0f29('0xf'));var Papa=require(_0x0f29('0x10'));var Redis=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var logger=require(_0x0f29('0x13'))(_0x0f29('0x14'));var utils=require(_0x0f29('0x15'));var config=require(_0x0f29('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38eb8f,_0x5f4796){_0x5f4796=_0x5f4796||0xcc;return function(_0xc11f21){if(_0xc11f21){return _0x38eb8f[_0x0f29('0x17')](_0x5f4796);}return _0x38eb8f[_0x0f29('0x18')](_0x5f4796)[_0x0f29('0x19')]();};}function respondWithResult(_0x195424,_0x2d2573){_0x2d2573=_0x2d2573||0xc8;return function(_0x5519cf){if(_0x5519cf){return _0x195424[_0x0f29('0x18')](_0x2d2573)[_0x0f29('0x1a')](_0x5519cf);}};}function respondWithFilteredResult(_0x2bb7b8,_0x368984){return function(_0x234856){if(_0x234856){var _0x2ed9c5=_0x234856['count'],_0x1c518=_0x368984[_0x0f29('0x1b')],_0x69df36=_0x368984[_0x0f29('0x1b')]+_0x368984[_0x0f29('0x1c')],_0x547404;if(_0x69df36>=_0x2ed9c5){_0x69df36=_0x2ed9c5;_0x547404=0xc8;}else{_0x547404=0xce;}_0x2bb7b8[_0x0f29('0x18')](_0x547404);return _0x2bb7b8['set'](_0x0f29('0x1d'),_0x1c518+'-'+_0x69df36+'/'+_0x2ed9c5)['json'](_0x234856);}return null;};}function patchUpdates(_0x17b994){return function(_0x4ca5e8){try{jsonpatch['apply'](_0x4ca5e8,_0x17b994,!![]);}catch(_0x5eb0cf){return BPromise[_0x0f29('0x1e')](_0x5eb0cf);}return _0x4ca5e8[_0x0f29('0x1f')]();};}function saveUpdates(_0x13e8ff,_0x128337){return function(_0x21eea0){if(_0x21eea0){return _0x21eea0[_0x0f29('0x20')](_0x13e8ff)[_0x0f29('0x21')](function(_0x4888b6){return _0x4888b6;});}return null;};}function removeEntity(_0x49d954,_0x5a5a03){return function(_0x5ab592){if(_0x5ab592){return _0x5ab592['destroy']()['then'](function(){_0x49d954[_0x0f29('0x18')](0xcc)[_0x0f29('0x19')]();});}};}function handleEntityNotFound(_0x563d15,_0x1ac33e){return function(_0x1840e0){if(!_0x1840e0){_0x563d15[_0x0f29('0x17')](0x194);}return _0x1840e0;};}function handleError(_0x3402dc,_0x29ca73){_0x29ca73=_0x29ca73||0x1f4;return function(_0x568ad9){logger[_0x0f29('0x22')](_0x568ad9['stack']);if(_0x568ad9[_0x0f29('0x23')]){delete _0x568ad9[_0x0f29('0x23')];}_0x3402dc[_0x0f29('0x18')](_0x29ca73)[_0x0f29('0x24')](_0x568ad9);};}exports['index']=function(_0x13a2c7,_0x540d72){var _0x58b201={},_0x92876={},_0x5c0202={'count':0x0,'rows':[]};var _0x5bfcac=db['AnalyticTreeReport']['rawAttributes'];_0x92876[_0x0f29('0x25')]=_[_0x0f29('0x26')](_0x5bfcac);var _0x4cc5a0={'dateStart':_0x13a2c7[_0x0f29('0x27')][_0x0f29('0x28')],'dateEnd':_0x13a2c7[_0x0f29('0x27')]['dateEnd']};delete _0x13a2c7['query'][_0x0f29('0x28')];delete _0x13a2c7['query'][_0x0f29('0x29')];_0x92876['query']=_['keys'](_0x13a2c7[_0x0f29('0x27')]);_0x92876[_0x0f29('0x2a')]=_[_0x0f29('0x2b')](_0x92876[_0x0f29('0x25')],_0x92876['query']);_0x58b201['attributes']=_[_0x0f29('0x2b')](_0x92876['model'],qs['fields'](_0x13a2c7[_0x0f29('0x27')]['fields']));_0x58b201[_0x0f29('0x2c')]=_0x58b201['attributes']['length']?_0x58b201[_0x0f29('0x2c')]:_0x92876[_0x0f29('0x25')];if(!_0x13a2c7[_0x0f29('0x27')][_0x0f29('0x2d')](_0x0f29('0x2e'))){_0x58b201['limit']=qs[_0x0f29('0x1c')](_0x13a2c7['query'][_0x0f29('0x1c')]);_0x58b201[_0x0f29('0x1b')]=qs[_0x0f29('0x1b')](_0x13a2c7[_0x0f29('0x27')]['offset']);}_0x58b201[_0x0f29('0x2f')]=qs[_0x0f29('0x30')](_0x13a2c7['query'][_0x0f29('0x30')]);_0x58b201[_0x0f29('0x31')]=qs['filters'](_['pick'](_0x13a2c7[_0x0f29('0x27')],_0x92876[_0x0f29('0x2a')]));if(_0x4cc5a0[_0x0f29('0x28')]){if(_0x4cc5a0[_0x0f29('0x29')]){_0x4cc5a0[_0x0f29('0x29')]=moment(_0x4cc5a0[_0x0f29('0x29')])['add'](0x1,_0x0f29('0x32'));}else{_0x4cc5a0['dateEnd']=moment(_0x4cc5a0[_0x0f29('0x28')])['add'](0x1,_0x0f29('0x32'));}_[_0x0f29('0x33')](_0x58b201[_0x0f29('0x31')],{'createdAt':{'$gte':_0x4cc5a0['dateStart'],'$lte':_0x4cc5a0['dateEnd']}});}if(_0x13a2c7[_0x0f29('0x27')]['filter']){_0x58b201[_0x0f29('0x31')]=_[_0x0f29('0x33')](_0x58b201[_0x0f29('0x31')],{'$or':_[_0x0f29('0x34')](_0x5bfcac,function(_0x9ae45d){if(_0x9ae45d['type'][_0x0f29('0x35')]!==_0x0f29('0x36')){var _0x42872b={};_0x42872b[_0x9ae45d[_0x0f29('0x37')]]={'$like':'%'+_0x13a2c7[_0x0f29('0x27')][_0x0f29('0x38')]+'%'};return _0x42872b;}})});}_0x58b201=_[_0x0f29('0x33')]({},_0x58b201,_0x13a2c7[_0x0f29('0x39')]);var _0x250b20={'where':_0x58b201['where']};return db[_0x0f29('0x3a')][_0x0f29('0x3b')](_0x250b20)[_0x0f29('0x21')](function(_0x11b1dc){_0x5c0202['count']=_0x11b1dc;if(_0x13a2c7[_0x0f29('0x27')][_0x0f29('0x3c')]){_0x58b201[_0x0f29('0x3d')]=[{'all':!![]}];}return db[_0x0f29('0x3a')][_0x0f29('0x3e')](_0x58b201);})['then'](function(_0x410c59){_0x5c0202[_0x0f29('0x3f')]=_0x410c59;return _0x5c0202;})[_0x0f29('0x21')](respondWithFilteredResult(_0x540d72,_0x58b201))['catch'](handleError(_0x540d72,null));};exports[_0x0f29('0x40')]=function(_0x284279,_0x3a6479){var _0x338412={'raw':!![],'where':{'id':_0x284279[_0x0f29('0x41')]['id']}},_0x35f753={};_0x35f753[_0x0f29('0x25')]=_[_0x0f29('0x26')](db['AnalyticTreeReport']['rawAttributes']);_0x35f753['query']=_[_0x0f29('0x26')](_0x284279[_0x0f29('0x27')]);_0x35f753[_0x0f29('0x2a')]=_[_0x0f29('0x2b')](_0x35f753[_0x0f29('0x25')],_0x35f753[_0x0f29('0x27')]);_0x338412['attributes']=_[_0x0f29('0x2b')](_0x35f753['model'],qs[_0x0f29('0x42')](_0x284279['query'][_0x0f29('0x42')]));_0x338412[_0x0f29('0x2c')]=_0x338412[_0x0f29('0x2c')][_0x0f29('0x43')]?_0x338412[_0x0f29('0x2c')]:_0x35f753['model'];if(_0x284279[_0x0f29('0x27')][_0x0f29('0x3c')]){_0x338412[_0x0f29('0x3d')]=[{'all':!![]}];}_0x338412=_['merge']({},_0x338412,_0x284279[_0x0f29('0x39')]);return db['AnalyticTreeReport']['find'](_0x338412)[_0x0f29('0x21')](handleEntityNotFound(_0x3a6479,null))[_0x0f29('0x21')](respondWithResult(_0x3a6479,null))[_0x0f29('0x44')](handleError(_0x3a6479,null));};exports[_0x0f29('0x45')]=function(_0x20aa53,_0x335435){return db['AnalyticTreeReport'][_0x0f29('0x45')](_0x20aa53[_0x0f29('0x46')],{})[_0x0f29('0x21')](respondWithResult(_0x335435,0xc9))[_0x0f29('0x44')](handleError(_0x335435,null));};exports[_0x0f29('0x20')]=function(_0x3679da,_0xda5aa7){if(_0x3679da[_0x0f29('0x46')]['id']){delete _0x3679da[_0x0f29('0x46')]['id'];}return db[_0x0f29('0x3a')]['find']({'where':{'id':_0x3679da['params']['id']}})[_0x0f29('0x21')](handleEntityNotFound(_0xda5aa7,null))[_0x0f29('0x21')](saveUpdates(_0x3679da[_0x0f29('0x46')],null))[_0x0f29('0x21')](respondWithResult(_0xda5aa7,null))['catch'](handleError(_0xda5aa7,null));};exports[_0x0f29('0x47')]=function(_0xd624ad,_0x32102f){return db[_0x0f29('0x3a')][_0x0f29('0x48')]({'where':{'id':_0xd624ad[_0x0f29('0x41')]['id']}})[_0x0f29('0x21')](handleEntityNotFound(_0x32102f,null))['then'](removeEntity(_0x32102f,null))[_0x0f29('0x44')](handleError(_0x32102f,null));};
\ No newline at end of file
+var _0xd3d1=['html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','error','name','send','index','rawAttributes','keys','dateStart','query','dateEnd','filters','intersection','attributes','model','fields','hasOwnProperty','where','pick','add','day','merge','filter','type','VIRTUAL','field','AnalyticTreeReport','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','update'];(function(_0x483f7a,_0x467438){var _0xa5a442=function(_0x5d6acc){while(--_0x5d6acc){_0x483f7a['push'](_0x483f7a['shift']());}};_0xa5a442(++_0x467438);}(_0xd3d1,0x172));var _0x1d3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd3d1[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x1d3d('0x0'));var emlformat=require(_0x1d3d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d3d('0x2'));var rp=require(_0x1d3d('0x3'));var moment=require(_0x1d3d('0x4'));var BPromise=require(_0x1d3d('0x5'));var Mustache=require(_0x1d3d('0x6'));var util=require(_0x1d3d('0x7'));var path=require(_0x1d3d('0x8'));var sox=require(_0x1d3d('0x9'));var csv=require(_0x1d3d('0xa'));var ejs=require(_0x1d3d('0xb'));var fs=require('fs');var _=require(_0x1d3d('0xc'));var squel=require(_0x1d3d('0xd'));var crypto=require(_0x1d3d('0xe'));var jsforce=require(_0x1d3d('0xf'));var deskjs=require(_0x1d3d('0x10'));var toCsv=require(_0x1d3d('0xa'));var querystring=require(_0x1d3d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d3d('0x12'));var qs=require(_0x1d3d('0x13'));var logger=require(_0x1d3d('0x14'))(_0x1d3d('0x15'));var utils=require(_0x1d3d('0x16'));var config=require(_0x1d3d('0x17'));var db=require(_0x1d3d('0x18'))['db'];function respondWithStatusCode(_0x2fa11e,_0x3b3913){_0x3b3913=_0x3b3913||0xcc;return function(_0x3cffa5){if(_0x3cffa5){return _0x2fa11e[_0x1d3d('0x19')](_0x3b3913);}return _0x2fa11e['status'](_0x3b3913)[_0x1d3d('0x1a')]();};}function respondWithResult(_0x2e375f,_0x494b82){_0x494b82=_0x494b82||0xc8;return function(_0x4dd753){if(_0x4dd753){return _0x2e375f[_0x1d3d('0x1b')](_0x494b82)[_0x1d3d('0x1c')](_0x4dd753);}};}function respondWithFilteredResult(_0x1a8035,_0x59b907){return function(_0x4098a9){if(_0x4098a9){var _0x4dcc22=_0x4098a9[_0x1d3d('0x1d')],_0x1d54f3=_0x59b907[_0x1d3d('0x1e')],_0x33e7d9=_0x59b907[_0x1d3d('0x1e')]+_0x59b907[_0x1d3d('0x1f')],_0x3491e4;if(_0x33e7d9>=_0x4dcc22){_0x33e7d9=_0x4dcc22;_0x3491e4=0xc8;}else{_0x3491e4=0xce;}_0x1a8035['status'](_0x3491e4);return _0x1a8035['set'](_0x1d3d('0x20'),_0x1d54f3+'-'+_0x33e7d9+'/'+_0x4dcc22)[_0x1d3d('0x1c')](_0x4098a9);}return null;};}function patchUpdates(_0x50bab4){return function(_0x3b9174){try{jsonpatch['apply'](_0x3b9174,_0x50bab4,!![]);}catch(_0x1eade8){return BPromise[_0x1d3d('0x21')](_0x1eade8);}return _0x3b9174[_0x1d3d('0x22')]();};}function saveUpdates(_0x2d6dfb,_0x5a6772){return function(_0x2b77ee){if(_0x2b77ee){return _0x2b77ee['update'](_0x2d6dfb)['then'](function(_0x108005){return _0x108005;});}return null;};}function removeEntity(_0x2bfac3,_0x43b14b){return function(_0x344a03){if(_0x344a03){return _0x344a03[_0x1d3d('0x23')]()[_0x1d3d('0x24')](function(){_0x2bfac3[_0x1d3d('0x1b')](0xcc)[_0x1d3d('0x1a')]();});}};}function handleEntityNotFound(_0x270b90,_0x18f234){return function(_0x1610a6){if(!_0x1610a6){_0x270b90['sendStatus'](0x194);}return _0x1610a6;};}function handleError(_0xfc3606,_0x72868d){_0x72868d=_0x72868d||0x1f4;return function(_0x4a48c5){logger[_0x1d3d('0x25')](_0x4a48c5['stack']);if(_0x4a48c5[_0x1d3d('0x26')]){delete _0x4a48c5[_0x1d3d('0x26')];}_0xfc3606[_0x1d3d('0x1b')](_0x72868d)[_0x1d3d('0x27')](_0x4a48c5);};}exports[_0x1d3d('0x28')]=function(_0x16d032,_0x2b8074){var _0x298fd3={},_0x2294ee={},_0x2df7b7={'count':0x0,'rows':[]};var _0x172dbd=db['AnalyticTreeReport'][_0x1d3d('0x29')];_0x2294ee['model']=_[_0x1d3d('0x2a')](_0x172dbd);var _0x2bcc2={'dateStart':_0x16d032['query'][_0x1d3d('0x2b')],'dateEnd':_0x16d032[_0x1d3d('0x2c')][_0x1d3d('0x2d')]};delete _0x16d032[_0x1d3d('0x2c')]['dateStart'];delete _0x16d032[_0x1d3d('0x2c')][_0x1d3d('0x2d')];_0x2294ee['query']=_[_0x1d3d('0x2a')](_0x16d032['query']);_0x2294ee[_0x1d3d('0x2e')]=_[_0x1d3d('0x2f')](_0x2294ee['model'],_0x2294ee[_0x1d3d('0x2c')]);_0x298fd3[_0x1d3d('0x30')]=_[_0x1d3d('0x2f')](_0x2294ee[_0x1d3d('0x31')],qs[_0x1d3d('0x32')](_0x16d032[_0x1d3d('0x2c')][_0x1d3d('0x32')]));_0x298fd3[_0x1d3d('0x30')]=_0x298fd3[_0x1d3d('0x30')]['length']?_0x298fd3[_0x1d3d('0x30')]:_0x2294ee[_0x1d3d('0x31')];if(!_0x16d032[_0x1d3d('0x2c')][_0x1d3d('0x33')]('nolimit')){_0x298fd3['limit']=qs[_0x1d3d('0x1f')](_0x16d032[_0x1d3d('0x2c')]['limit']);_0x298fd3[_0x1d3d('0x1e')]=qs[_0x1d3d('0x1e')](_0x16d032[_0x1d3d('0x2c')][_0x1d3d('0x1e')]);}_0x298fd3['order']=qs['sort'](_0x16d032[_0x1d3d('0x2c')]['sort']);_0x298fd3[_0x1d3d('0x34')]=qs[_0x1d3d('0x2e')](_[_0x1d3d('0x35')](_0x16d032[_0x1d3d('0x2c')],_0x2294ee[_0x1d3d('0x2e')]));if(_0x2bcc2[_0x1d3d('0x2b')]){if(_0x2bcc2[_0x1d3d('0x2d')]){_0x2bcc2[_0x1d3d('0x2d')]=moment(_0x2bcc2['dateEnd'])[_0x1d3d('0x36')](0x1,'day');}else{_0x2bcc2[_0x1d3d('0x2d')]=moment(_0x2bcc2[_0x1d3d('0x2b')])['add'](0x1,_0x1d3d('0x37'));}_[_0x1d3d('0x38')](_0x298fd3[_0x1d3d('0x34')],{'createdAt':{'$gte':_0x2bcc2[_0x1d3d('0x2b')],'$lte':_0x2bcc2['dateEnd']}});}if(_0x16d032['query'][_0x1d3d('0x39')]){_0x298fd3['where']=_[_0x1d3d('0x38')](_0x298fd3[_0x1d3d('0x34')],{'$or':_['map'](_0x172dbd,function(_0x1ad7a6){if(_0x1ad7a6[_0x1d3d('0x3a')]['key']!==_0x1d3d('0x3b')){var _0x40f8ca={};_0x40f8ca[_0x1ad7a6[_0x1d3d('0x3c')]]={'$like':'%'+_0x16d032[_0x1d3d('0x2c')][_0x1d3d('0x39')]+'%'};return _0x40f8ca;}})});}_0x298fd3=_[_0x1d3d('0x38')]({},_0x298fd3,_0x16d032['options']);var _0x28be51={'where':_0x298fd3[_0x1d3d('0x34')]};return db[_0x1d3d('0x3d')][_0x1d3d('0x1d')](_0x28be51)[_0x1d3d('0x24')](function(_0x5f007e){_0x2df7b7[_0x1d3d('0x1d')]=_0x5f007e;if(_0x16d032[_0x1d3d('0x2c')][_0x1d3d('0x3e')]){_0x298fd3[_0x1d3d('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x1d3d('0x40')](_0x298fd3);})[_0x1d3d('0x24')](function(_0x1597fa){_0x2df7b7[_0x1d3d('0x41')]=_0x1597fa;return _0x2df7b7;})[_0x1d3d('0x24')](respondWithFilteredResult(_0x2b8074,_0x298fd3))['catch'](handleError(_0x2b8074,null));};exports['show']=function(_0x229f48,_0xa58235){var _0xca972={'raw':!![],'where':{'id':_0x229f48[_0x1d3d('0x42')]['id']}},_0x66efd={};_0x66efd['model']=_[_0x1d3d('0x2a')](db['AnalyticTreeReport'][_0x1d3d('0x29')]);_0x66efd[_0x1d3d('0x2c')]=_[_0x1d3d('0x2a')](_0x229f48[_0x1d3d('0x2c')]);_0x66efd['filters']=_[_0x1d3d('0x2f')](_0x66efd[_0x1d3d('0x31')],_0x66efd[_0x1d3d('0x2c')]);_0xca972[_0x1d3d('0x30')]=_[_0x1d3d('0x2f')](_0x66efd[_0x1d3d('0x31')],qs[_0x1d3d('0x32')](_0x229f48['query'][_0x1d3d('0x32')]));_0xca972['attributes']=_0xca972[_0x1d3d('0x30')][_0x1d3d('0x43')]?_0xca972['attributes']:_0x66efd[_0x1d3d('0x31')];if(_0x229f48['query'][_0x1d3d('0x3e')]){_0xca972['include']=[{'all':!![]}];}_0xca972=_[_0x1d3d('0x38')]({},_0xca972,_0x229f48[_0x1d3d('0x44')]);return db[_0x1d3d('0x3d')][_0x1d3d('0x45')](_0xca972)[_0x1d3d('0x24')](handleEntityNotFound(_0xa58235,null))[_0x1d3d('0x24')](respondWithResult(_0xa58235,null))[_0x1d3d('0x46')](handleError(_0xa58235,null));};exports[_0x1d3d('0x47')]=function(_0x59e88a,_0x5899cc){return db['AnalyticTreeReport'][_0x1d3d('0x47')](_0x59e88a[_0x1d3d('0x48')],{})[_0x1d3d('0x24')](respondWithResult(_0x5899cc,0xc9))[_0x1d3d('0x46')](handleError(_0x5899cc,null));};exports[_0x1d3d('0x49')]=function(_0x3e5636,_0x47beed){if(_0x3e5636['body']['id']){delete _0x3e5636['body']['id'];}return db['AnalyticTreeReport'][_0x1d3d('0x45')]({'where':{'id':_0x3e5636[_0x1d3d('0x42')]['id']}})[_0x1d3d('0x24')](handleEntityNotFound(_0x47beed,null))[_0x1d3d('0x24')](saveUpdates(_0x3e5636[_0x1d3d('0x48')],null))[_0x1d3d('0x24')](respondWithResult(_0x47beed,null))[_0x1d3d('0x46')](handleError(_0x47beed,null));};exports[_0x1d3d('0x23')]=function(_0x3792ab,_0x445cb0){return db[_0x1d3d('0x3d')][_0x1d3d('0x45')]({'where':{'id':_0x3792ab[_0x1d3d('0x42')]['id']}})[_0x1d3d('0x24')](handleEntityNotFound(_0x445cb0,null))[_0x1d3d('0x24')](removeEntity(_0x445cb0,null))['catch'](handleError(_0x445cb0,null));};
\ No newline at end of file
index 7c4631e..0676cca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfef6=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','request-promise'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfef6,0xe1));var _0x6fef=function(_0x2d3145,_0x2e57e3){_0x2d3145=_0x2d3145-0x0;var _0x1d0d68=_0xfef6[_0x2d3145];return _0x1d0d68;};'use strict';var _=require(_0x6fef('0x0'));var util=require(_0x6fef('0x1'));var logger=require('../../config/logger')(_0x6fef('0x2'));var moment=require(_0x6fef('0x3'));var BPromise=require('bluebird');var rp=require(_0x6fef('0x4'));var attributes=require(_0x6fef('0x5'));module[_0x6fef('0x6')]=function(_0x3b0496,_0x20928a){return _0x3b0496[_0x6fef('0x7')](_0x6fef('0x8'),attributes,{'tableName':_0x6fef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5ca=['analytics_report_trees','../../config/logger','api','request-promise','define','AnalyticTreeReport'];(function(_0x2a50cd,_0x10186f){var _0x37f367=function(_0x17326e){while(--_0x17326e){_0x2a50cd['push'](_0x2a50cd['shift']());}};_0x37f367(++_0x10186f);}(_0xd5ca,0x7f));var _0xad5c=function(_0x3fdf28,_0x45aafa){_0x3fdf28=_0x3fdf28-0x0;var _0x2d67ba=_0xd5ca[_0x3fdf28];return _0x2d67ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xad5c('0x0'))(_0xad5c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad5c('0x2'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x1c7706,_0x5f168f){return _0x1c7706[_0xad5c('0x3')](_0xad5c('0x4'),attributes,{'tableName':_0xad5c('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77a95a2..a96215d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f51=['request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x156386,_0x1d838e){var _0x1fa0fe=function(_0x1fd63f){while(--_0x1fd63f){_0x156386['push'](_0x156386['shift']());}};_0x1fa0fe(++_0x1d838e);}(_0x7f51,0x1f0));var _0x17f5=function(_0x578ce8,_0x1a6f16){_0x578ce8=_0x578ce8-0x0;var _0xff5357=_0x7f51[_0x578ce8];return _0xff5357;};'use strict';var _=require(_0x17f5('0x0'));var util=require(_0x17f5('0x1'));var moment=require(_0x17f5('0x2'));var BPromise=require(_0x17f5('0x3'));var rs=require(_0x17f5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17f5('0x5'))['db'];var utils=require(_0x17f5('0x6'));var logger=require('../../config/logger')(_0x17f5('0x7'));var config=require(_0x17f5('0x8'));var jayson=require(_0x17f5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b90ee,_0x2b95b7,_0x3b2c04){return new BPromise(function(_0x4b362f,_0x3e09d1){return client[_0x17f5('0xa')](_0x5b90ee,_0x3b2c04)[_0x17f5('0xb')](function(_0x22cb60){logger[_0x17f5('0xc')](_0x17f5('0xd'),_0x2b95b7,_0x17f5('0xe'));logger[_0x17f5('0xf')](_0x17f5('0x10'),_0x2b95b7,_0x17f5('0xe'),JSON[_0x17f5('0x11')](_0x22cb60));if(_0x22cb60[_0x17f5('0x12')]){if(_0x22cb60[_0x17f5('0x12')][_0x17f5('0x13')]===0x1f4){logger['error'](_0x17f5('0xd'),_0x2b95b7,_0x22cb60['error'][_0x17f5('0x14')]);return _0x3e09d1(_0x22cb60['error']['message']);}logger[_0x17f5('0x12')](_0x17f5('0xd'),_0x2b95b7,_0x22cb60[_0x17f5('0x12')][_0x17f5('0x14')]);return _0x4b362f(_0x22cb60[_0x17f5('0x12')]['message']);}else{logger[_0x17f5('0xc')](_0x17f5('0xd'),_0x2b95b7,_0x17f5('0xe'));_0x4b362f(_0x22cb60['result'][_0x17f5('0x14')]);}})[_0x17f5('0x15')](function(_0x530bbd){logger['error'](_0x17f5('0xd'),_0x2b95b7,_0x530bbd);_0x3e09d1(_0x530bbd);});});}
\ No newline at end of file
+var _0xda3c=['AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent'];(function(_0x32800c,_0x1d8e18){var _0x672d72=function(_0x8de39f){while(--_0x8de39f){_0x32800c['push'](_0x32800c['shift']());}};_0x672d72(++_0x1d8e18);}(_0xda3c,0x197));var _0xcda3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xda3c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcda3('0x0'));var util=require(_0xcda3('0x1'));var moment=require(_0xcda3('0x2'));var BPromise=require(_0xcda3('0x3'));var rs=require(_0xcda3('0x4'));var fs=require('fs');var Redis=require(_0xcda3('0x5'));var db=require(_0xcda3('0x6'))['db'];var utils=require(_0xcda3('0x7'));var logger=require(_0xcda3('0x8'))(_0xcda3('0x9'));var config=require(_0xcda3('0xa'));var jayson=require(_0xcda3('0xb'));var client=jayson['client'][_0xcda3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30bd6e,_0x27c9f1,_0x42cc8e){return new BPromise(function(_0xa601a3,_0x430abc){return client[_0xcda3('0xd')](_0x30bd6e,_0x42cc8e)[_0xcda3('0xe')](function(_0x2475ca){logger[_0xcda3('0xf')](_0xcda3('0x10'),_0x27c9f1,_0xcda3('0x11'));logger['debug'](_0xcda3('0x12'),_0x27c9f1,_0xcda3('0x11'),JSON[_0xcda3('0x13')](_0x2475ca));if(_0x2475ca['error']){if(_0x2475ca[_0xcda3('0x14')][_0xcda3('0x15')]===0x1f4){logger[_0xcda3('0x14')](_0xcda3('0x10'),_0x27c9f1,_0x2475ca[_0xcda3('0x14')][_0xcda3('0x16')]);return _0x430abc(_0x2475ca['error'][_0xcda3('0x16')]);}logger['error'](_0xcda3('0x10'),_0x27c9f1,_0x2475ca[_0xcda3('0x14')][_0xcda3('0x16')]);return _0xa601a3(_0x2475ca[_0xcda3('0x14')][_0xcda3('0x16')]);}else{logger[_0xcda3('0xf')](_0xcda3('0x10'),_0x27c9f1,_0xcda3('0x11'));_0xa601a3(_0x2475ca[_0xcda3('0x17')][_0xcda3('0x16')]);}})[_0xcda3('0x18')](function(_0x50846a){logger['error'](_0xcda3('0x10'),_0x27c9f1,_0x50846a);_0x430abc(_0x50846a);});});}
\ No newline at end of file
index 23564f0..be1c4f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35cb=['index','post','create','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x2c86dc,_0x10715c){var _0x15a71c=function(_0x4e1dee){while(--_0x4e1dee){_0x2c86dc['push'](_0x2c86dc['shift']());}};_0x15a71c(++_0x10715c);}(_0x35cb,0x1a6));var _0xb35c=function(_0x513337,_0x51c303){_0x513337=_0x513337-0x0;var _0x3e267e=_0x35cb[_0x513337];return _0x3e267e;};'use strict';var multer=require(_0xb35c('0x0'));var util=require(_0xb35c('0x1'));var path=require(_0xb35c('0x2'));var timeout=require(_0xb35c('0x3'));var express=require(_0xb35c('0x4'));var router=express[_0xb35c('0x5')]();var auth=require(_0xb35c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb35c('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xb35c('0x8')]('/',auth[_0xb35c('0x9')](),controller[_0xb35c('0xa')]);router['get']('/:id',auth[_0xb35c('0x9')](),controller['show']);router[_0xb35c('0xb')]('/',auth[_0xb35c('0x9')](),controller[_0xb35c('0xc')]);router[_0xb35c('0xd')](_0xb35c('0xe'),auth[_0xb35c('0x9')](),controller['update']);router['delete'](_0xb35c('0xe'),auth[_0xb35c('0x9')](),controller[_0xb35c('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x4931=['connect-timeout','express','Router','./analyticTreeReport.controller','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3284e7,_0x4a8fc6){var _0xf4f798=function(_0x5ad141){while(--_0x5ad141){_0x3284e7['push'](_0x3284e7['shift']());}};_0xf4f798(++_0x4a8fc6);}(_0x4931,0xfc));var _0x1493=function(_0x466f91,_0xd9d3a6){_0x466f91=_0x466f91-0x0;var _0x106787=_0x4931[_0x466f91];return _0x106787;};'use strict';var multer=require(_0x1493('0x0'));var util=require(_0x1493('0x1'));var path=require(_0x1493('0x2'));var timeout=require(_0x1493('0x3'));var express=require(_0x1493('0x4'));var router=express[_0x1493('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1493('0x6'));router['get']('/',auth[_0x1493('0x7')](),controller[_0x1493('0x8')]);router['get'](_0x1493('0x9'),auth['isAuthenticated'](),controller[_0x1493('0xa')]);router[_0x1493('0xb')]('/',auth[_0x1493('0x7')](),controller[_0x1493('0xc')]);router[_0x1493('0xd')](_0x1493('0x9'),auth[_0x1493('0x7')](),controller['update']);router[_0x1493('0xe')](_0x1493('0x9'),auth[_0x1493('0x7')](),controller[_0x1493('0xf')]);module[_0x1493('0x10')]=router;
\ No newline at end of file
index 74d6387..9b913a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x477c=['exports','STRING','sequelize'];(function(_0x3050b3,_0x275b37){var _0x5e5b35=function(_0x3c3b5b){while(--_0x3c3b5b){_0x3050b3['push'](_0x3050b3['shift']());}};_0x5e5b35(++_0x275b37);}(_0x477c,0xfb));var _0xc477=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x477c[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xc477('0x0'));module[_0xc477('0x1')]={'name':{'type':Sequelize[_0xc477('0x2')]},'basename':{'type':Sequelize[_0xc477('0x2')]},'type':{'type':Sequelize[_0xc477('0x2')]}};
\ No newline at end of file
+var _0xc015=['sequelize','STRING'];(function(_0xb7bc3f,_0x29a96){var _0x195a40=function(_0x4d8c98){while(--_0x4d8c98){_0xb7bc3f['push'](_0xb7bc3f['shift']());}};_0x195a40(++_0x29a96);}(_0xc015,0xfa));var _0x5c01=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0xc015[_0x3cfb0d];return _0x3486b4;};'use strict';var Sequelize=require(_0x5c01('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c01('0x1')]},'basename':{'type':Sequelize[_0x5c01('0x1')]},'type':{'type':Sequelize[_0x5c01('0x1')]}};
\ No newline at end of file
index 6dbfb69..4ba7a1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1507=['findAll','then','rows','catch','params','find','body','file','originalname','basename','filename','type','mimetype','create','download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','index','rawAttributes','model','query','dateStart','dateEnd','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','add','day','merge','filter','map','VIRTUAL','options','includeAll','include','Attachment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x1507,0x15b));var _0x7150=function(_0x151dee,_0x3f620f){_0x151dee=_0x151dee-0x0;var _0x36879b=_0x1507[_0x151dee];return _0x36879b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7150('0x0'));var rimraf=require(_0x7150('0x1'));var zipdir=require(_0x7150('0x2'));var jsonpatch=require(_0x7150('0x3'));var rp=require(_0x7150('0x4'));var moment=require(_0x7150('0x5'));var BPromise=require(_0x7150('0x6'));var Mustache=require(_0x7150('0x7'));var util=require(_0x7150('0x8'));var path=require(_0x7150('0x9'));var sox=require(_0x7150('0xa'));var csv=require(_0x7150('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7150('0xc'));var squel=require(_0x7150('0xd'));var crypto=require(_0x7150('0xe'));var jsforce=require(_0x7150('0xf'));var deskjs=require(_0x7150('0x10'));var toCsv=require(_0x7150('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x7150('0x11'))(_0x7150('0x12'));var utils=require(_0x7150('0x13'));var config=require('../../config/environment');var db=require(_0x7150('0x14'))['db'];function respondWithStatusCode(_0x43a98e,_0x4fbbe0){_0x4fbbe0=_0x4fbbe0||0xcc;return function(_0xad16f2){if(_0xad16f2){return _0x43a98e[_0x7150('0x15')](_0x4fbbe0);}return _0x43a98e['status'](_0x4fbbe0)[_0x7150('0x16')]();};}function respondWithResult(_0x15d368,_0x3c8746){_0x3c8746=_0x3c8746||0xc8;return function(_0x5b491c){if(_0x5b491c){return _0x15d368['status'](_0x3c8746)[_0x7150('0x17')](_0x5b491c);}};}function respondWithFilteredResult(_0x3b0688,_0x5c1fd5){return function(_0xd1511c){if(_0xd1511c){var _0x171ddf=_0xd1511c[_0x7150('0x18')],_0x542d36=_0x5c1fd5[_0x7150('0x19')],_0x292f07=_0x5c1fd5[_0x7150('0x19')]+_0x5c1fd5[_0x7150('0x1a')],_0x1caed9;if(_0x292f07>=_0x171ddf){_0x292f07=_0x171ddf;_0x1caed9=0xc8;}else{_0x1caed9=0xce;}_0x3b0688['status'](_0x1caed9);return _0x3b0688[_0x7150('0x1b')](_0x7150('0x1c'),_0x542d36+'-'+_0x292f07+'/'+_0x171ddf)[_0x7150('0x17')](_0xd1511c);}return null;};}function patchUpdates(_0x57eb30){return function(_0x124dea){try{jsonpatch[_0x7150('0x1d')](_0x124dea,_0x57eb30,!![]);}catch(_0x4b5102){return BPromise[_0x7150('0x1e')](_0x4b5102);}return _0x124dea[_0x7150('0x1f')]();};}function saveUpdates(_0x164e08,_0x1e0c30){return function(_0x5af47a){if(_0x5af47a){return _0x5af47a[_0x7150('0x20')](_0x164e08)['then'](function(_0x2e7dc4){return _0x2e7dc4;});}return null;};}function removeEntity(_0x43c55b,_0x33edfc){return function(_0x52b368){if(_0x52b368){return _0x52b368[_0x7150('0x21')]()['then'](function(){_0x43c55b[_0x7150('0x22')](0xcc)[_0x7150('0x16')]();});}};}function handleEntityNotFound(_0x549b54,_0x18d554){return function(_0x468138){if(!_0x468138){_0x549b54[_0x7150('0x15')](0x194);}return _0x468138;};}function handleError(_0x517b6a,_0x48ffac){_0x48ffac=_0x48ffac||0x1f4;return function(_0x155a3d){logger['error'](_0x155a3d[_0x7150('0x23')]);if(_0x155a3d[_0x7150('0x24')]){delete _0x155a3d['name'];}_0x517b6a['status'](_0x48ffac)['send'](_0x155a3d);};}exports[_0x7150('0x25')]=function(_0x524930,_0x3633f7){var _0x317f91={},_0xfd73a3={},_0x4ff620={'count':0x0,'rows':[]};var _0x353902=db['Attachment'][_0x7150('0x26')];_0xfd73a3[_0x7150('0x27')]=_['keys'](_0x353902);var _0x14b889={'dateStart':_0x524930[_0x7150('0x28')][_0x7150('0x29')],'dateEnd':_0x524930[_0x7150('0x28')][_0x7150('0x2a')]};delete _0x524930[_0x7150('0x28')][_0x7150('0x29')];delete _0x524930[_0x7150('0x28')][_0x7150('0x2a')];_0xfd73a3[_0x7150('0x28')]=_[_0x7150('0x2b')](_0x524930[_0x7150('0x28')]);_0xfd73a3[_0x7150('0x2c')]=_['intersection'](_0xfd73a3['model'],_0xfd73a3['query']);_0x317f91[_0x7150('0x2d')]=_[_0x7150('0x2e')](_0xfd73a3['model'],qs[_0x7150('0x2f')](_0x524930[_0x7150('0x28')][_0x7150('0x2f')]));_0x317f91['attributes']=_0x317f91[_0x7150('0x2d')][_0x7150('0x30')]?_0x317f91[_0x7150('0x2d')]:_0xfd73a3[_0x7150('0x27')];if(!_0x524930[_0x7150('0x28')]['hasOwnProperty']('nolimit')){_0x317f91[_0x7150('0x1a')]=qs[_0x7150('0x1a')](_0x524930['query'][_0x7150('0x1a')]);_0x317f91[_0x7150('0x19')]=qs['offset'](_0x524930['query'][_0x7150('0x19')]);}_0x317f91[_0x7150('0x31')]=qs[_0x7150('0x32')](_0x524930[_0x7150('0x28')]['sort']);_0x317f91[_0x7150('0x33')]=qs[_0x7150('0x2c')](_[_0x7150('0x34')](_0x524930[_0x7150('0x28')],_0xfd73a3[_0x7150('0x2c')]));if(_0x14b889['dateStart']){if(_0x14b889[_0x7150('0x2a')]){_0x14b889[_0x7150('0x2a')]=moment(_0x14b889[_0x7150('0x2a')])[_0x7150('0x35')](0x1,_0x7150('0x36'));}else{_0x14b889[_0x7150('0x2a')]=moment(_0x14b889[_0x7150('0x29')])['add'](0x1,_0x7150('0x36'));}_[_0x7150('0x37')](_0x317f91[_0x7150('0x33')],{'createdAt':{'$gte':_0x14b889[_0x7150('0x29')],'$lte':_0x14b889[_0x7150('0x2a')]}});}if(_0x524930[_0x7150('0x28')][_0x7150('0x38')]){_0x317f91[_0x7150('0x33')]=_[_0x7150('0x37')](_0x317f91[_0x7150('0x33')],{'$or':_[_0x7150('0x39')](_0x353902,function(_0x27f829){if(_0x27f829['type']['key']!==_0x7150('0x3a')){var _0x5df998={};_0x5df998[_0x27f829['field']]={'$like':'%'+_0x524930[_0x7150('0x28')]['filter']+'%'};return _0x5df998;}})});}_0x317f91=_[_0x7150('0x37')]({},_0x317f91,_0x524930[_0x7150('0x3b')]);var _0x2d0903={'where':_0x317f91[_0x7150('0x33')]};return db['Attachment'][_0x7150('0x18')](_0x2d0903)['then'](function(_0x2b7b55){_0x4ff620[_0x7150('0x18')]=_0x2b7b55;if(_0x524930['query'][_0x7150('0x3c')]){_0x317f91[_0x7150('0x3d')]=[{'all':!![]}];}return db[_0x7150('0x3e')][_0x7150('0x3f')](_0x317f91);})[_0x7150('0x40')](function(_0x5e3af5){_0x4ff620[_0x7150('0x41')]=_0x5e3af5;return _0x4ff620;})[_0x7150('0x40')](respondWithFilteredResult(_0x3633f7,_0x317f91))[_0x7150('0x42')](handleError(_0x3633f7,null));};exports['show']=function(_0x2128ef,_0x5d91a2){var _0x85287b={'raw':!![],'where':{'id':_0x2128ef[_0x7150('0x43')]['id']}},_0x2ad8e0={};_0x2ad8e0[_0x7150('0x27')]=_['keys'](db['Attachment'][_0x7150('0x26')]);_0x2ad8e0[_0x7150('0x28')]=_[_0x7150('0x2b')](_0x2128ef[_0x7150('0x28')]);_0x2ad8e0[_0x7150('0x2c')]=_[_0x7150('0x2e')](_0x2ad8e0[_0x7150('0x27')],_0x2ad8e0[_0x7150('0x28')]);_0x85287b[_0x7150('0x2d')]=_[_0x7150('0x2e')](_0x2ad8e0[_0x7150('0x27')],qs[_0x7150('0x2f')](_0x2128ef[_0x7150('0x28')][_0x7150('0x2f')]));_0x85287b[_0x7150('0x2d')]=_0x85287b[_0x7150('0x2d')]['length']?_0x85287b[_0x7150('0x2d')]:_0x2ad8e0[_0x7150('0x27')];if(_0x2128ef[_0x7150('0x28')][_0x7150('0x3c')]){_0x85287b[_0x7150('0x3d')]=[{'all':!![]}];}_0x85287b=_['merge']({},_0x85287b,_0x2128ef[_0x7150('0x3b')]);return db[_0x7150('0x3e')][_0x7150('0x44')](_0x85287b)['then'](handleEntityNotFound(_0x5d91a2,null))[_0x7150('0x40')](respondWithResult(_0x5d91a2,null))['catch'](handleError(_0x5d91a2,null));};exports[_0x7150('0x20')]=function(_0x357428,_0x176f1a){if(_0x357428[_0x7150('0x45')]['id']){delete _0x357428[_0x7150('0x45')]['id'];}return db[_0x7150('0x3e')]['find']({'where':{'id':_0x357428[_0x7150('0x43')]['id']}})[_0x7150('0x40')](handleEntityNotFound(_0x176f1a,null))[_0x7150('0x40')](saveUpdates(_0x357428[_0x7150('0x45')],null))[_0x7150('0x40')](respondWithResult(_0x176f1a,null))[_0x7150('0x42')](handleError(_0x176f1a,null));};exports['destroy']=function(_0x35b014,_0x1cfc7d){return db[_0x7150('0x3e')][_0x7150('0x44')]({'where':{'id':_0x35b014['params']['id']}})[_0x7150('0x40')](handleEntityNotFound(_0x1cfc7d,null))[_0x7150('0x40')](removeEntity(_0x1cfc7d,null))['catch'](handleError(_0x1cfc7d,null));};exports['create']=function(_0x488e2f,_0x2b88c9,_0x3ae73b){_0x488e2f['body'][_0x7150('0x24')]=_0x488e2f[_0x7150('0x46')][_0x7150('0x47')];_0x488e2f[_0x7150('0x45')][_0x7150('0x48')]=_0x488e2f['file'][_0x7150('0x49')];_0x488e2f[_0x7150('0x45')][_0x7150('0x4a')]=_0x488e2f[_0x7150('0x46')][_0x7150('0x4b')];return db[_0x7150('0x3e')][_0x7150('0x4c')](_0x488e2f[_0x7150('0x45')])[_0x7150('0x40')](respondWithResult(_0x2b88c9,0xc9))[_0x7150('0x42')](handleError(_0x2b88c9,null));};exports[_0x7150('0x4d')]=function(_0x6d8916,_0x4191cf,_0x256558){return db['Attachment'][_0x7150('0x4e')]({'where':{'id':_0x6d8916[_0x7150('0x43')]['id']},'raw':!![]})[_0x7150('0x40')](handleEntityNotFound(_0x4191cf,null))[_0x7150('0x40')](function(_0x4b3cda){if(_0x4b3cda){return _0x4191cf[_0x7150('0x4d')](path[_0x7150('0x4f')](config[_0x7150('0x50')],_0x7150('0x51'),_0x4b3cda[_0x7150('0x48')]));}})['catch'](handleError(_0x4191cf,null));};
\ No newline at end of file
+var _0xbb9f=['server/files/attachments/','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','index','rawAttributes','keys','query','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','dateStart','add','day','merge','where','type','key','filter','options','Attachment','count','include','findAll','show','includeAll','find','body','params','catch','file','originalname','basename','filename','mimetype','create','download','findOne','join','root'];(function(_0x98c64,_0x5d246d){var _0x1201e8=function(_0x4b6f3e){while(--_0x4b6f3e){_0x98c64['push'](_0x98c64['shift']());}};_0x1201e8(++_0x5d246d);}(_0xbb9f,0xfd));var _0xfbb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb9f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xfbb9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfbb9('0x1'));var jsonpatch=require(_0xfbb9('0x2'));var rp=require(_0xfbb9('0x3'));var moment=require(_0xfbb9('0x4'));var BPromise=require(_0xfbb9('0x5'));var Mustache=require(_0xfbb9('0x6'));var util=require('util');var path=require(_0xfbb9('0x7'));var sox=require(_0xfbb9('0x8'));var csv=require(_0xfbb9('0x9'));var ejs=require(_0xfbb9('0xa'));var fs=require('fs');var _=require(_0xfbb9('0xb'));var squel=require(_0xfbb9('0xc'));var crypto=require(_0xfbb9('0xd'));var jsforce=require(_0xfbb9('0xe'));var deskjs=require(_0xfbb9('0xf'));var toCsv=require(_0xfbb9('0x9'));var querystring=require(_0xfbb9('0x10'));var Papa=require('papaparse');var Redis=require(_0xfbb9('0x11'));var qs=require(_0xfbb9('0x12'));var logger=require(_0xfbb9('0x13'))(_0xfbb9('0x14'));var utils=require('../../config/utils');var config=require(_0xfbb9('0x15'));var db=require(_0xfbb9('0x16'))['db'];function respondWithStatusCode(_0x3e0bff,_0x1ff99e){_0x1ff99e=_0x1ff99e||0xcc;return function(_0x3234f5){if(_0x3234f5){return _0x3e0bff[_0xfbb9('0x17')](_0x1ff99e);}return _0x3e0bff['status'](_0x1ff99e)[_0xfbb9('0x18')]();};}function respondWithResult(_0x53f7f2,_0x38d71f){_0x38d71f=_0x38d71f||0xc8;return function(_0x17b8cf){if(_0x17b8cf){return _0x53f7f2[_0xfbb9('0x19')](_0x38d71f)[_0xfbb9('0x1a')](_0x17b8cf);}};}function respondWithFilteredResult(_0x5d3f3c,_0x9a483e){return function(_0x343d08){if(_0x343d08){var _0x4df042=_0x343d08['count'],_0x4578e5=_0x9a483e[_0xfbb9('0x1b')],_0x155814=_0x9a483e[_0xfbb9('0x1b')]+_0x9a483e[_0xfbb9('0x1c')],_0x3ec4da;if(_0x155814>=_0x4df042){_0x155814=_0x4df042;_0x3ec4da=0xc8;}else{_0x3ec4da=0xce;}_0x5d3f3c[_0xfbb9('0x19')](_0x3ec4da);return _0x5d3f3c[_0xfbb9('0x1d')]('Content-Range',_0x4578e5+'-'+_0x155814+'/'+_0x4df042)[_0xfbb9('0x1a')](_0x343d08);}return null;};}function patchUpdates(_0x3d51be){return function(_0x30085d){try{jsonpatch[_0xfbb9('0x1e')](_0x30085d,_0x3d51be,!![]);}catch(_0x47cbf6){return BPromise[_0xfbb9('0x1f')](_0x47cbf6);}return _0x30085d['save']();};}function saveUpdates(_0x27a203,_0x2bd311){return function(_0x2d707f){if(_0x2d707f){return _0x2d707f[_0xfbb9('0x20')](_0x27a203)[_0xfbb9('0x21')](function(_0x112e64){return _0x112e64;});}return null;};}function removeEntity(_0x393007,_0x3c7255){return function(_0x46999c){if(_0x46999c){return _0x46999c[_0xfbb9('0x22')]()[_0xfbb9('0x21')](function(){_0x393007[_0xfbb9('0x19')](0xcc)[_0xfbb9('0x18')]();});}};}function handleEntityNotFound(_0x543e60,_0x5ce985){return function(_0x477d8e){if(!_0x477d8e){_0x543e60[_0xfbb9('0x17')](0x194);}return _0x477d8e;};}function handleError(_0x3fabcf,_0x3612e6){_0x3612e6=_0x3612e6||0x1f4;return function(_0x2dfab6){logger[_0xfbb9('0x23')](_0x2dfab6[_0xfbb9('0x24')]);if(_0x2dfab6[_0xfbb9('0x25')]){delete _0x2dfab6[_0xfbb9('0x25')];}_0x3fabcf[_0xfbb9('0x19')](_0x3612e6)['send'](_0x2dfab6);};}exports[_0xfbb9('0x26')]=function(_0x18e2c1,_0x3ceeeb){var _0x8b0e22={},_0x5e69be={},_0xfb339e={'count':0x0,'rows':[]};var _0x2ff0de=db['Attachment'][_0xfbb9('0x27')];_0x5e69be['model']=_[_0xfbb9('0x28')](_0x2ff0de);var _0x377ce7={'dateStart':_0x18e2c1[_0xfbb9('0x29')]['dateStart'],'dateEnd':_0x18e2c1[_0xfbb9('0x29')][_0xfbb9('0x2a')]};delete _0x18e2c1[_0xfbb9('0x29')]['dateStart'];delete _0x18e2c1['query'][_0xfbb9('0x2a')];_0x5e69be[_0xfbb9('0x29')]=_['keys'](_0x18e2c1[_0xfbb9('0x29')]);_0x5e69be[_0xfbb9('0x2b')]=_[_0xfbb9('0x2c')](_0x5e69be[_0xfbb9('0x2d')],_0x5e69be[_0xfbb9('0x29')]);_0x8b0e22[_0xfbb9('0x2e')]=_[_0xfbb9('0x2c')](_0x5e69be[_0xfbb9('0x2d')],qs[_0xfbb9('0x2f')](_0x18e2c1[_0xfbb9('0x29')][_0xfbb9('0x2f')]));_0x8b0e22['attributes']=_0x8b0e22['attributes'][_0xfbb9('0x30')]?_0x8b0e22[_0xfbb9('0x2e')]:_0x5e69be[_0xfbb9('0x2d')];if(!_0x18e2c1['query'][_0xfbb9('0x31')](_0xfbb9('0x32'))){_0x8b0e22[_0xfbb9('0x1c')]=qs[_0xfbb9('0x1c')](_0x18e2c1['query'][_0xfbb9('0x1c')]);_0x8b0e22[_0xfbb9('0x1b')]=qs['offset'](_0x18e2c1['query'][_0xfbb9('0x1b')]);}_0x8b0e22[_0xfbb9('0x33')]=qs[_0xfbb9('0x34')](_0x18e2c1[_0xfbb9('0x29')][_0xfbb9('0x34')]);_0x8b0e22['where']=qs[_0xfbb9('0x2b')](_[_0xfbb9('0x35')](_0x18e2c1[_0xfbb9('0x29')],_0x5e69be[_0xfbb9('0x2b')]));if(_0x377ce7['dateStart']){if(_0x377ce7[_0xfbb9('0x2a')]){_0x377ce7[_0xfbb9('0x2a')]=moment(_0x377ce7[_0xfbb9('0x2a')])['add'](0x1,'day');}else{_0x377ce7['dateEnd']=moment(_0x377ce7[_0xfbb9('0x36')])[_0xfbb9('0x37')](0x1,_0xfbb9('0x38'));}_[_0xfbb9('0x39')](_0x8b0e22[_0xfbb9('0x3a')],{'createdAt':{'$gte':_0x377ce7[_0xfbb9('0x36')],'$lte':_0x377ce7[_0xfbb9('0x2a')]}});}if(_0x18e2c1[_0xfbb9('0x29')]['filter']){_0x8b0e22[_0xfbb9('0x3a')]=_['merge'](_0x8b0e22['where'],{'$or':_['map'](_0x2ff0de,function(_0xa0822f){if(_0xa0822f[_0xfbb9('0x3b')][_0xfbb9('0x3c')]!=='VIRTUAL'){var _0x18ad7b={};_0x18ad7b[_0xa0822f['field']]={'$like':'%'+_0x18e2c1['query'][_0xfbb9('0x3d')]+'%'};return _0x18ad7b;}})});}_0x8b0e22=_['merge']({},_0x8b0e22,_0x18e2c1[_0xfbb9('0x3e')]);var _0x31f130={'where':_0x8b0e22['where']};return db[_0xfbb9('0x3f')][_0xfbb9('0x40')](_0x31f130)['then'](function(_0x34789b){_0xfb339e[_0xfbb9('0x40')]=_0x34789b;if(_0x18e2c1[_0xfbb9('0x29')]['includeAll']){_0x8b0e22[_0xfbb9('0x41')]=[{'all':!![]}];}return db[_0xfbb9('0x3f')][_0xfbb9('0x42')](_0x8b0e22);})[_0xfbb9('0x21')](function(_0x46f9a6){_0xfb339e['rows']=_0x46f9a6;return _0xfb339e;})[_0xfbb9('0x21')](respondWithFilteredResult(_0x3ceeeb,_0x8b0e22))['catch'](handleError(_0x3ceeeb,null));};exports[_0xfbb9('0x43')]=function(_0xbd81e2,_0x2b0526){var _0x39f813={'raw':!![],'where':{'id':_0xbd81e2['params']['id']}},_0x49c474={};_0x49c474[_0xfbb9('0x2d')]=_[_0xfbb9('0x28')](db[_0xfbb9('0x3f')][_0xfbb9('0x27')]);_0x49c474['query']=_[_0xfbb9('0x28')](_0xbd81e2[_0xfbb9('0x29')]);_0x49c474[_0xfbb9('0x2b')]=_[_0xfbb9('0x2c')](_0x49c474[_0xfbb9('0x2d')],_0x49c474[_0xfbb9('0x29')]);_0x39f813['attributes']=_['intersection'](_0x49c474[_0xfbb9('0x2d')],qs['fields'](_0xbd81e2['query'][_0xfbb9('0x2f')]));_0x39f813[_0xfbb9('0x2e')]=_0x39f813[_0xfbb9('0x2e')][_0xfbb9('0x30')]?_0x39f813['attributes']:_0x49c474['model'];if(_0xbd81e2[_0xfbb9('0x29')][_0xfbb9('0x44')]){_0x39f813[_0xfbb9('0x41')]=[{'all':!![]}];}_0x39f813=_[_0xfbb9('0x39')]({},_0x39f813,_0xbd81e2[_0xfbb9('0x3e')]);return db['Attachment'][_0xfbb9('0x45')](_0x39f813)[_0xfbb9('0x21')](handleEntityNotFound(_0x2b0526,null))[_0xfbb9('0x21')](respondWithResult(_0x2b0526,null))['catch'](handleError(_0x2b0526,null));};exports[_0xfbb9('0x20')]=function(_0xe7b1eb,_0x55e737){if(_0xe7b1eb['body']['id']){delete _0xe7b1eb[_0xfbb9('0x46')]['id'];}return db['Attachment'][_0xfbb9('0x45')]({'where':{'id':_0xe7b1eb[_0xfbb9('0x47')]['id']}})[_0xfbb9('0x21')](handleEntityNotFound(_0x55e737,null))[_0xfbb9('0x21')](saveUpdates(_0xe7b1eb[_0xfbb9('0x46')],null))[_0xfbb9('0x21')](respondWithResult(_0x55e737,null))[_0xfbb9('0x48')](handleError(_0x55e737,null));};exports['destroy']=function(_0x2f232e,_0x326266){return db[_0xfbb9('0x3f')]['find']({'where':{'id':_0x2f232e[_0xfbb9('0x47')]['id']}})[_0xfbb9('0x21')](handleEntityNotFound(_0x326266,null))[_0xfbb9('0x21')](removeEntity(_0x326266,null))[_0xfbb9('0x48')](handleError(_0x326266,null));};exports['create']=function(_0xb8598,_0x5d6f54,_0x3531bd){_0xb8598[_0xfbb9('0x46')][_0xfbb9('0x25')]=_0xb8598[_0xfbb9('0x49')][_0xfbb9('0x4a')];_0xb8598[_0xfbb9('0x46')][_0xfbb9('0x4b')]=_0xb8598[_0xfbb9('0x49')][_0xfbb9('0x4c')];_0xb8598[_0xfbb9('0x46')][_0xfbb9('0x3b')]=_0xb8598['file'][_0xfbb9('0x4d')];return db[_0xfbb9('0x3f')][_0xfbb9('0x4e')](_0xb8598[_0xfbb9('0x46')])[_0xfbb9('0x21')](respondWithResult(_0x5d6f54,0xc9))[_0xfbb9('0x48')](handleError(_0x5d6f54,null));};exports[_0xfbb9('0x4f')]=function(_0x25708b,_0x4f182d,_0x4b0b8a){return db[_0xfbb9('0x3f')][_0xfbb9('0x50')]({'where':{'id':_0x25708b[_0xfbb9('0x47')]['id']},'raw':!![]})[_0xfbb9('0x21')](handleEntityNotFound(_0x4f182d,null))[_0xfbb9('0x21')](function(_0x3c66a3){if(_0x3c66a3){return _0x4f182d['download'](path[_0xfbb9('0x51')](config[_0xfbb9('0x52')],_0xfbb9('0x53'),_0x3c66a3[_0xfbb9('0x4b')]));}})[_0xfbb9('0x48')](handleError(_0x4f182d,null));};
\ No newline at end of file
index c3a0aa4..57c175a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['bluebird','request-promise','exports','define','Attachment','attachments','lodash','util'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x55ca,0x126));var _0xa55c=function(_0x332c1b,_0x28d711){_0x332c1b=_0x332c1b-0x0;var _0x21b49b=_0x55ca[_0x332c1b];return _0x21b49b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var attributes=require('./attachment.attributes');module[_0xa55c('0x4')]=function(_0x2db02a,_0xcb02e3){return _0x2db02a[_0xa55c('0x5')](_0xa55c('0x6'),attributes,{'tableName':_0xa55c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cb9=['exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','./attachment.attributes'];(function(_0x8426a0,_0x183ad8){var _0x4f71e3=function(_0x3df1bb){while(--_0x3df1bb){_0x8426a0['push'](_0x8426a0['shift']());}};_0x4f71e3(++_0x183ad8);}(_0x1cb9,0x14e));var _0x91cb=function(_0x12925e,_0x5db9b3){_0x12925e=_0x12925e-0x0;var _0x237b32=_0x1cb9[_0x12925e];return _0x237b32;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var attributes=require(_0x91cb('0x5'));module[_0x91cb('0x6')]=function(_0x5652cd,_0x17c21c){return _0x5652cd[_0x91cb('0x7')](_0x91cb('0x8'),attributes,{'tableName':_0x91cb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0e10f74..ee3815d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cc8=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Attachment,\x20%s,\x20%s'];(function(_0x15d203,_0x5b93ba){var _0x350cf6=function(_0x32335b){while(--_0x32335b){_0x15d203['push'](_0x15d203['shift']());}};_0x350cf6(++_0x5b93ba);}(_0x8cc8,0x177));var _0x88cc=function(_0x2c53ce,_0x4fed5a){_0x2c53ce=_0x2c53ce-0x0;var _0x59897d=_0x8cc8[_0x2c53ce];return _0x59897d;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var moment=require(_0x88cc('0x2'));var BPromise=require(_0x88cc('0x3'));var rs=require(_0x88cc('0x4'));var fs=require('fs');var Redis=require(_0x88cc('0x5'));var db=require(_0x88cc('0x6'))['db'];var utils=require(_0x88cc('0x7'));var logger=require(_0x88cc('0x8'))(_0x88cc('0x9'));var config=require(_0x88cc('0xa'));var jayson=require(_0x88cc('0xb'));var client=jayson[_0x88cc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58bdd5,_0x3d35ed,_0x2db13a){return new BPromise(function(_0x219585,_0x4471b0){return client['request'](_0x58bdd5,_0x2db13a)[_0x88cc('0xd')](function(_0x2e77ae){logger['info'](_0x88cc('0xe'),_0x3d35ed,'request\x20sent');logger[_0x88cc('0xf')](_0x88cc('0x10'),_0x3d35ed,_0x88cc('0x11'),JSON[_0x88cc('0x12')](_0x2e77ae));if(_0x2e77ae['error']){if(_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x14')]===0x1f4){logger[_0x88cc('0x13')](_0x88cc('0xe'),_0x3d35ed,_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);return _0x4471b0(_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);}logger['error'](_0x88cc('0xe'),_0x3d35ed,_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);return _0x219585(_0x2e77ae[_0x88cc('0x13')][_0x88cc('0x15')]);}else{logger[_0x88cc('0x16')]('Attachment,\x20%s,\x20%s',_0x3d35ed,_0x88cc('0x11'));_0x219585(_0x2e77ae[_0x88cc('0x17')][_0x88cc('0x15')]);}})[_0x88cc('0x18')](function(_0x13ff73){logger['error'](_0x88cc('0xe'),_0x3d35ed,_0x13ff73);_0x4471b0(_0x13ff73);});});}exports[_0x88cc('0x19')]=function(_0x34fb65){var _0x3a6289=this;return new Promise(function(_0x33144a,_0x4a377a){return db[_0x88cc('0x1a')][_0x88cc('0x1b')](_0x34fb65['body'],{'raw':_0x34fb65[_0x88cc('0x1c')]?_0x34fb65['options'][_0x88cc('0x1d')]===undefined?!![]:![]:!![]})[_0x88cc('0xd')](function(_0x50cdaf){logger[_0x88cc('0x16')](_0x88cc('0x19'),_0x34fb65);logger[_0x88cc('0xf')](_0x88cc('0x19'),_0x34fb65,JSON[_0x88cc('0x12')](_0x50cdaf));_0x33144a(_0x50cdaf);})[_0x88cc('0x18')](function(_0x4e5edb){logger[_0x88cc('0x13')](_0x88cc('0x19'),_0x4e5edb[_0x88cc('0x15')],_0x34fb65);_0x4a377a(_0x3a6289[_0x88cc('0x13')](0x1f4,_0x4e5edb[_0x88cc('0x15')]));});});};
\ No newline at end of file
+var _0x905b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateAttachment','Attachment','create','options','raw','stringify','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x4687ab,_0xd558c4){var _0x52dbbf=function(_0x39bbf0){while(--_0x39bbf0){_0x4687ab['push'](_0x4687ab['shift']());}};_0x52dbbf(++_0xd558c4);}(_0x905b,0x87));var _0xb905=function(_0x55eb7c,_0x12e69e){_0x55eb7c=_0x55eb7c-0x0;var _0x24cefc=_0x905b[_0x55eb7c];return _0x24cefc;};'use strict';var _=require(_0xb905('0x0'));var util=require(_0xb905('0x1'));var moment=require(_0xb905('0x2'));var BPromise=require(_0xb905('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb905('0x4'))['db'];var utils=require(_0xb905('0x5'));var logger=require(_0xb905('0x6'))(_0xb905('0x7'));var config=require('../../config/environment');var jayson=require(_0xb905('0x8'));var client=jayson[_0xb905('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7a7f,_0x5e9f35,_0x161afa){return new BPromise(function(_0x9533dd,_0x104cc1){return client[_0xb905('0xa')](_0x5d7a7f,_0x161afa)[_0xb905('0xb')](function(_0x304b3a){logger[_0xb905('0xc')](_0xb905('0xd'),_0x5e9f35,'request\x20sent');logger[_0xb905('0xe')](_0xb905('0xf'),_0x5e9f35,_0xb905('0x10'),JSON['stringify'](_0x304b3a));if(_0x304b3a[_0xb905('0x11')]){if(_0x304b3a[_0xb905('0x11')][_0xb905('0x12')]===0x1f4){logger['error'](_0xb905('0xd'),_0x5e9f35,_0x304b3a['error'][_0xb905('0x13')]);return _0x104cc1(_0x304b3a[_0xb905('0x11')][_0xb905('0x13')]);}logger['error'](_0xb905('0xd'),_0x5e9f35,_0x304b3a[_0xb905('0x11')]['message']);return _0x9533dd(_0x304b3a[_0xb905('0x11')]['message']);}else{logger[_0xb905('0xc')](_0xb905('0xd'),_0x5e9f35,_0xb905('0x10'));_0x9533dd(_0x304b3a[_0xb905('0x14')][_0xb905('0x13')]);}})[_0xb905('0x15')](function(_0x5b9bdb){logger['error'](_0xb905('0xd'),_0x5e9f35,_0x5b9bdb);_0x104cc1(_0x5b9bdb);});});}exports[_0xb905('0x16')]=function(_0x2f062a){var _0x4e2c35=this;return new Promise(function(_0x356d3e,_0x186bc1){return db[_0xb905('0x17')][_0xb905('0x18')](_0x2f062a['body'],{'raw':_0x2f062a['options']?_0x2f062a[_0xb905('0x19')][_0xb905('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x96703a){logger['info'](_0xb905('0x16'),_0x2f062a);logger[_0xb905('0xe')](_0xb905('0x16'),_0x2f062a,JSON[_0xb905('0x1b')](_0x96703a));_0x356d3e(_0x96703a);})[_0xb905('0x15')](function(_0x15ab89){logger[_0xb905('0x11')](_0xb905('0x16'),_0x15ab89[_0xb905('0x13')],_0x2f062a);_0x186bc1(_0x4e2c35[_0xb905('0x11')](0x1f4,_0x15ab89[_0xb905('0x13')]));});});};
\ No newline at end of file
index 77dc62a..4af1adf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x894f=['originalname','replace','post','single','file','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x894f,0x14d));var _0xf894=function(_0x3a6673,_0x5eee9e){_0x3a6673=_0x3a6673-0x0;var _0x48aad1=_0x894f[_0x3a6673];return _0x48aad1;};'use strict';var multer=require(_0xf894('0x0'));var util=require(_0xf894('0x1'));var path=require(_0xf894('0x2'));var timeout=require(_0xf894('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf894('0x4'));var interaction=require(_0xf894('0x5'));var config=require('../../config/environment');var controller=require('./attachment.controller');router[_0xf894('0x6')]('/',auth[_0xf894('0x7')](),controller['index']);router['get'](_0xf894('0x8'),auth[_0xf894('0x7')](),controller['show']);router[_0xf894('0x6')](_0xf894('0x9'),auth[_0xf894('0x7')](),controller[_0xf894('0xa')]);var upload=multer({'storage':multer[_0xf894('0xb')]({'destination':function(_0x25b554,_0x2057b5,_0x420296){_0x420296(null,path[_0xf894('0xc')](config[_0xf894('0xd')],_0xf894('0xe')));},'filename':function(_0x3cc8e7,_0x39fbc4,_0x7d635b){_0x7d635b(null,util[_0xf894('0xf')](_0xf894('0x10'),Date[_0xf894('0x11')](),_0x39fbc4[_0xf894('0x12')][_0xf894('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf894('0x14')]('/',upload[_0xf894('0x15')](_0xf894('0x16')),controller['create']);router[_0xf894('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xf894('0x18')]);router[_0xf894('0x19')](_0xf894('0x8'),auth[_0xf894('0x7')](),controller[_0xf894('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0xa101=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./attachment.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','post','single','create','update','delete','exports'];(function(_0x2e549b,_0x4749cd){var _0x431196=function(_0x37b752){while(--_0x37b752){_0x2e549b['push'](_0x2e549b['shift']());}};_0x431196(++_0x4749cd);}(_0xa101,0x15f));var _0x1a10=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0xa101[_0x810025];return _0x4dbc81;};'use strict';var multer=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var path=require('path');var timeout=require(_0x1a10('0x2'));var express=require(_0x1a10('0x3'));var router=express['Router']();var auth=require(_0x1a10('0x4'));var interaction=require(_0x1a10('0x5'));var config=require('../../config/environment');var controller=require(_0x1a10('0x6'));router[_0x1a10('0x7')]('/',auth[_0x1a10('0x8')](),controller[_0x1a10('0x9')]);router[_0x1a10('0x7')](_0x1a10('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1a10('0x7')](_0x1a10('0xb'),auth[_0x1a10('0x8')](),controller[_0x1a10('0xc')]);var upload=multer({'storage':multer[_0x1a10('0xd')]({'destination':function(_0x36e16b,_0x6d687d,_0x501792){_0x501792(null,path[_0x1a10('0xe')](config[_0x1a10('0xf')],_0x1a10('0x10')));},'filename':function(_0x5833e9,_0x3f46b6,_0x8496b4){_0x8496b4(null,util[_0x1a10('0x11')]('%s-%s',Date[_0x1a10('0x12')](),_0x3f46b6[_0x1a10('0x13')][_0x1a10('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1a10('0x15')]('/',upload[_0x1a10('0x16')]('file'),controller[_0x1a10('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1a10('0x18')]);router[_0x1a10('0x19')](_0x1a10('0xa'),auth[_0x1a10('0x8')](),controller['destroy']);module[_0x1a10('0x1a')]=router;
\ No newline at end of file
index 966888f..8b001f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6af5=['google','/login','profile','email','callback','use','clientID','clientSecret','callbackURL','User','map','emails','value','admin','user','agent','then','User\x20email\x20not\x20found!','catch','passport','passport-google-oauth20','../../config/environment','../../components/auth/service','signToken','login','authenticate'];(function(_0x1d61b5,_0x27993b){var _0xe435c2=function(_0x2ab19b){while(--_0x2ab19b){_0x1d61b5['push'](_0x1d61b5['shift']());}};_0xe435c2(++_0x27993b);}(_0x6af5,0x7b));var _0x56af=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x6af5[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var passport=require(_0x56af('0x0'));var GoogleStrategy=require(_0x56af('0x1'))['Strategy'];var db=require('../../mysqldb')['db'];var config=require(_0x56af('0x2'));var signToken=require(_0x56af('0x3'))[_0x56af('0x4')];exports[_0x56af('0x5')]=passport[_0x56af('0x6')](_0x56af('0x7'),{'failureRedirect':_0x56af('0x8'),'scope':[_0x56af('0x9'),_0x56af('0xa')],'session':![]});exports[_0x56af('0xb')]=passport[_0x56af('0x6')](_0x56af('0x7'),{'failureRedirect':'/login','session':![]});passport[_0x56af('0xc')](new GoogleStrategy({'clientID':config[_0x56af('0x7')]?config[_0x56af('0x7')][_0x56af('0xd')]:'id','clientSecret':config[_0x56af('0x7')]?config['google'][_0x56af('0xe')]:'secret','callbackURL':config[_0x56af('0x7')]?config[_0x56af('0x7')][_0x56af('0xf')]:''},function(_0xbd31d5,_0x2ed73b,_0x2efb0d,_0xf0671f){db[_0x56af('0x10')]['find']({'where':{'email':_[_0x56af('0x11')](_0x2efb0d[_0x56af('0x12')],_0x56af('0x13')),'role':{'$or':[_0x56af('0x14'),_0x56af('0x15'),_0x56af('0x16')]}}})[_0x56af('0x17')](function(_0x54927c){if(_0x54927c){return _0xf0671f(null,_0x54927c);}_0xf0671f(_0x56af('0x18'));})[_0x56af('0x19')](function(_0x12473a){_0xf0671f(_0x12473a);});}));
\ No newline at end of file
+var _0xff1c=['find','map','emails','user','agent','User\x20email\x20not\x20found!','catch','lodash','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','authenticate','google','/login','profile','email','use','clientSecret','callbackURL','User'];(function(_0x14d30f,_0x3ee1ba){var _0x43d50c=function(_0x2b1268){while(--_0x2b1268){_0x14d30f['push'](_0x14d30f['shift']());}};_0x43d50c(++_0x3ee1ba);}(_0xff1c,0xdf));var _0xcff1=function(_0x575d5d,_0x59017){_0x575d5d=_0x575d5d-0x0;var _0x200d0f=_0xff1c[_0x575d5d];return _0x200d0f;};'use strict';var _=require(_0xcff1('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xcff1('0x1'))[_0xcff1('0x2')];var db=require(_0xcff1('0x3'))['db'];var config=require(_0xcff1('0x4'));var signToken=require(_0xcff1('0x5'))[_0xcff1('0x6')];exports[_0xcff1('0x7')]=passport[_0xcff1('0x8')](_0xcff1('0x9'),{'failureRedirect':_0xcff1('0xa'),'scope':[_0xcff1('0xb'),_0xcff1('0xc')],'session':![]});exports['callback']=passport[_0xcff1('0x8')]('google',{'failureRedirect':'/login','session':![]});passport[_0xcff1('0xd')](new GoogleStrategy({'clientID':config[_0xcff1('0x9')]?config['google']['clientID']:'id','clientSecret':config[_0xcff1('0x9')]?config[_0xcff1('0x9')][_0xcff1('0xe')]:'secret','callbackURL':config['google']?config[_0xcff1('0x9')][_0xcff1('0xf')]:''},function(_0x3bf230,_0x5694cb,_0x15efee,_0x3625b1){db[_0xcff1('0x10')][_0xcff1('0x11')]({'where':{'email':_[_0xcff1('0x12')](_0x15efee[_0xcff1('0x13')],'value'),'role':{'$or':['admin',_0xcff1('0x14'),_0xcff1('0x15')]}}})['then'](function(_0x3880da){if(_0x3880da){return _0x3625b1(null,_0x3880da);}_0x3625b1(_0xcff1('0x16'));})[_0xcff1('0x17')](function(_0x4a9a62){_0x3625b1(_0x4a9a62);});}));
\ No newline at end of file
index a833a46..d65436b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ae=['get','/callback','callback','exports','express','Router','./authGoogle.controller'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x90ae,0xf2));var _0xe90a=function(_0x56aa9c,_0x49b688){_0x56aa9c=_0x56aa9c-0x0;var _0xed2db1=_0x90ae[_0x56aa9c];return _0xed2db1;};'use strict';var express=require(_0xe90a('0x0'));var passport=require('passport');var router=express[_0xe90a('0x1')]();var controller=require(_0xe90a('0x2'));var setTokenCookie=require('../../components/auth/service')['setTokenCookie'];router[_0xe90a('0x3')]('/',controller['login']);router['get'](_0xe90a('0x4'),controller[_0xe90a('0x5')],setTokenCookie);module[_0xe90a('0x6')]=router;
\ No newline at end of file
+var _0xcf48=['./authGoogle.controller','login','/callback','callback','exports','passport','Router'];(function(_0x4ca766,_0x3f2075){var _0x2077f2=function(_0x2fb25e){while(--_0x2fb25e){_0x4ca766['push'](_0x4ca766['shift']());}};_0x2077f2(++_0x3f2075);}(_0xcf48,0x124));var _0x8cf4=function(_0x108854,_0x2c1391){_0x108854=_0x108854-0x0;var _0x2ab675=_0xcf48[_0x108854];return _0x2ab675;};'use strict';var express=require('express');var passport=require(_0x8cf4('0x0'));var router=express[_0x8cf4('0x1')]();var controller=require(_0x8cf4('0x2'));var setTokenCookie=require('../../components/auth/service')['setTokenCookie'];router['get']('/',controller[_0x8cf4('0x3')]);router['get'](_0x8cf4('0x4'),controller[_0x8cf4('0x5')],setTokenCookie);module[_0x8cf4('0x6')]=router;
\ No newline at end of file
index ed57a52..5e47750 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8683=['generate','trim','This\x20email\x20is\x20not\x20registered.','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','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','api','randomstring','../../mysqldb','signToken','client','http','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','user','name','authenticate','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','body'];(function(_0x180bd3,_0x240488){var _0x2c7250=function(_0x949746){while(--_0x949746){_0x180bd3['push'](_0x180bd3['shift']());}};_0x2c7250(++_0x240488);}(_0x8683,0xec));var _0x3868=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8683[_0x2b4411];return _0x8e41ef;};'use strict';var util=require('util');var passport=require(_0x3868('0x0'));var LocalStrategy=require(_0x3868('0x1'))[_0x3868('0x2')];var BPromise=require('bluebird');var jayson=require(_0x3868('0x3'));var _=require(_0x3868('0x4'));var logger=require('../../config/logger')(_0x3868('0x5'));var rs=require(_0x3868('0x6'));var db=require(_0x3868('0x7'))['db'];var signToken=require('../../components/auth/service')[_0x3868('0x8')];var client=jayson[_0x3868('0x9')][_0x3868('0xa')]({'port':0x232b});var getLicense=function(_0x4f87ad){return new BPromise(function(_0x4f73f2,_0x5d4607){var _0x451d23=0x0;_0x4f87ad['role']!==_0x3868('0xb')&&_0x4f73f2(_0x4f87ad);return db[_0x3868('0xc')][_0x3868('0xd')]({'where':{'role':_0x3868('0xb'),'online':!![],'id':{'$ne':_0x4f87ad['id']}}})[_0x3868('0xe')](function(_0x6fdd52){_0x451d23=_0x6fdd52;return require('../../config/license/util')[_0x3868('0xf')]();})[_0x3868('0xe')](function(_0x27ffa5){if(_0x27ffa5&&_0x27ffa5['agents']&&_0x451d23>=_0x27ffa5[_0x3868('0x10')]){return _0x5d4607({'message':_0x3868('0x11')});}return _0x4f73f2(_0x4f87ad);})[_0x3868('0x12')](function(_0x5b9ec0){return _0x5d4607(_0x5b9ec0);});});};function localAuthenticate(_0x17929f,_0x470610,_0x4765f5,_0x13c26f){_0x17929f[_0x3868('0x13')]({'where':{'name':_0x470610,'role':{'$or':[_0x3868('0x14'),_0x3868('0x15'),'agent']}}})[_0x3868('0xe')](function(_0x3593d1){if(!_0x3593d1||_0x3593d1&&_0x3593d1[_0x3868('0x16')]!==_0x470610){return _0x13c26f(null,![],{'message':'This\x20name\x20is\x20not\x20registered'});}return getLicense(_0x3593d1);})['then'](function(_0x3d2ef2){_0x3d2ef2[_0x3868('0x17')](_0x4765f5,function(_0xf1e117,_0x44f2df){if(_0xf1e117){return _0x13c26f(_0xf1e117);}if(!_0x44f2df){return _0x13c26f(null,![],{'message':'This\x20password\x20is\x20not\x20correct'});}else{return _0x13c26f(null,_0x3d2ef2);}});})[_0x3868('0x12')](function(_0xdc5cde){_0x13c26f(_0xdc5cde);});}function sendServiceMail(_0x4a24f3){return db[_0x3868('0x18')][_0x3868('0x13')]({'where':{'service':!![]},'attributes':['id',_0x3868('0x16'),_0x3868('0x19')],'include':[{'model':db['MailServerOut'],'as':_0x3868('0x1a')}]})[_0x3868('0xe')](function(_0x56def3){if(!_0x56def3){throw new Error(_0x3868('0x1b'));}var _0x115f1d={'tls':{'rejectUnauthorized':![]}};if(_0x56def3[_0x3868('0x1a')][_0x3868('0x1c')]){_0x115f1d[_0x3868('0x1c')]=_0x56def3[_0x3868('0x1a')]['service'];}else{_0x115f1d[_0x3868('0x1d')]=_0x56def3[_0x3868('0x1a')][_0x3868('0x1d')];_0x115f1d[_0x3868('0x1e')]=_0x56def3[_0x3868('0x1a')][_0x3868('0x1e')];_0x115f1d[_0x3868('0x1f')]=_0x56def3[_0x3868('0x1a')]['secure'];}if(_0x56def3['Smtp'][_0x3868('0x20')]){_0x115f1d[_0x3868('0x21')]={'user':_0x56def3[_0x3868('0x1a')]['user'],'pass':_0x56def3['Smtp']['pass']};}var _0xf2ae46={'account':_0x115f1d,'message':_[_0x3868('0x22')]({'from':util[_0x3868('0x23')](_0x3868('0x24'),_0x56def3[_0x3868('0x16')],_0x56def3['email']||_0x56def3[_0x3868('0x1a')]['user'])},_0x4a24f3)};return client['request'](_0x3868('0x25'),_0xf2ae46);})[_0x3868('0xe')](function(_0x21fbd9){if(_0x21fbd9[_0x3868('0x26')]){throw new Error(util[_0x3868('0x23')](_0x3868('0x27'),_0x21fbd9['error'][_0x3868('0x28')]||JSON[_0x3868('0x29')](_0x21fbd9[_0x3868('0x26')])));}return!![];});}function handleError(_0x510bd0,_0x17bb4e,_0x28fe8f){return _0x510bd0[_0x3868('0x2a')](_0x17bb4e||0x1f4)[_0x3868('0x2b')]({'message':_0x28fe8f?_0x28fe8f[_0x3868('0x28')]||_0x28fe8f:''});}exports[_0x3868('0x2c')]=function(_0x19bfa3,_0x2b53f9,_0x5cd57f){passport[_0x3868('0x17')](_0x3868('0x2d'),function(_0x18fa95,_0x18223e,_0x335c14){var _0x3aee64=_0x18fa95||_0x335c14;if(_0x3aee64){return handleError(_0x2b53f9,0x191,_0x3aee64);}if(!_0x18223e){return handleError(_0x2b53f9,0x194,{'message':_0x3868('0x2e')});}var _0x513673=signToken(_0x18223e['id'],_0x18223e[_0x3868('0x2f')]);_0x2b53f9[_0x3868('0x30')]({'id':_0x18223e['id'],'token':_0x513673,'statusCall':'','isAlreadyLogged':_0x18223e[_0x3868('0x31')]});})(_0x19bfa3,_0x2b53f9,_0x5cd57f);};exports[_0x3868('0x32')]=function(_0x42b153,_0x1c4657,_0x5ce9ef){if(!_0x42b153[_0x3868('0x33')][_0x3868('0x19')]){return handleError(_0x1c4657,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x58f5a5=rs[_0x3868('0x34')]();_0x42b153[_0x3868('0x33')][_0x3868('0x19')]=_0x42b153[_0x3868('0x33')][_0x3868('0x19')][_0x3868('0x35')]()['toLowerCase']();return db[_0x3868('0xc')][_0x3868('0x13')]({'where':{'email':_0x42b153[_0x3868('0x33')]['email']}})['then'](function(_0x3e0718){if(!_0x3e0718){throw new Error(_0x3868('0x36'));}_0x3e0718['resetPasswordToken']=_0x58f5a5;_0x3e0718['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x3e0718[_0x3868('0x37')]();})[_0x3868('0xe')](function(){return sendServiceMail({'to':_0x42b153[_0x3868('0x33')][_0x3868('0x19')],'subject':_0x3868('0x38'),'text':_0x3868('0x39')+_0x3868('0x3a')+'http://'+_0x42b153[_0x3868('0x3b')][_0x3868('0x1d')]+_0x3868('0x3c')+_0x58f5a5+'\x0a\x0a'+_0x3868('0x3d')});})[_0x3868('0xe')](function(){_0x1c4657['status'](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x3868('0x12')](function(_0x537f66){return handleError(_0x1c4657,0x1f4,_0x537f66);});};exports[_0x3868('0x3e')]=function(_0x22d7c4,_0x3438ac,_0x2e0500){return db['User']['find']({'where':{'resetPasswordToken':_0x22d7c4[_0x3868('0x3f')][_0x3868('0x40')],'resetPasswordExpires':{'$gt':Date[_0x3868('0x41')]()}}})[_0x3868('0xe')](function(_0x50fd6d){if(!_0x50fd6d){throw new Error(_0x3868('0x42'));}_0x50fd6d['password']=_0x22d7c4['body'][_0x3868('0x43')];_0x50fd6d[_0x3868('0x44')]=null;_0x50fd6d[_0x3868('0x45')]=null;return _0x50fd6d[_0x3868('0x37')]();})[_0x3868('0xe')](function(){_0x3438ac['status'](0xc8)[_0x3868('0x2b')]({'message':_0x3868('0x46')});})[_0x3868('0x12')](function(_0x135868){return handleError(_0x3438ac,0x1f4,_0x135868);});};passport[_0x3868('0x47')](new LocalStrategy({'usernameField':_0x3868('0x16'),'passwordField':_0x3868('0x43')},function(_0x14a1f8,_0x4a2c80,_0x4bd01c){return localAuthenticate(db[_0x3868('0xc')],_0x14a1f8,_0x4a2c80,_0x4bd01c);}));
\ No newline at end of file
+var _0xc7b4=['agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','admin','user','name','This\x20name\x20is\x20not\x20registered','authenticate','This\x20password\x20is\x20not\x20correct','MailAccount','email','Smtp','service','port','secure','authentication','auth','merge','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','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','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','Password\x20reset!','util','passport-local','Strategy','bluebird','../../config/logger','randomstring','../../mysqldb','client','role','agent','User','count','then','../../config/license/util','getLicense'];(function(_0xa5bf7b,_0x56549d){var _0x2ead44=function(_0x38c448){while(--_0x38c448){_0xa5bf7b['push'](_0xa5bf7b['shift']());}};_0x2ead44(++_0x56549d);}(_0xc7b4,0x1cd));var _0x4c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x4c7b('0x0'));var passport=require('passport');var LocalStrategy=require(_0x4c7b('0x1'))[_0x4c7b('0x2')];var BPromise=require(_0x4c7b('0x3'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x4c7b('0x4'))('api');var rs=require(_0x4c7b('0x5'));var db=require(_0x4c7b('0x6'))['db'];var signToken=require('../../components/auth/service')['signToken'];var client=jayson[_0x4c7b('0x7')]['http']({'port':0x232b});var getLicense=function(_0x1fc67e){return new BPromise(function(_0x1d71c3,_0x515104){var _0xcd29b1=0x0;_0x1fc67e[_0x4c7b('0x8')]!==_0x4c7b('0x9')&&_0x1d71c3(_0x1fc67e);return db[_0x4c7b('0xa')][_0x4c7b('0xb')]({'where':{'role':_0x4c7b('0x9'),'online':!![],'id':{'$ne':_0x1fc67e['id']}}})[_0x4c7b('0xc')](function(_0x9c4421){_0xcd29b1=_0x9c4421;return require(_0x4c7b('0xd'))[_0x4c7b('0xe')]();})[_0x4c7b('0xc')](function(_0x4872c9){if(_0x4872c9&&_0x4872c9['agents']&&_0xcd29b1>=_0x4872c9[_0x4c7b('0xf')]){return _0x515104({'message':_0x4c7b('0x10')});}return _0x1d71c3(_0x1fc67e);})[_0x4c7b('0x11')](function(_0x8facce){return _0x515104(_0x8facce);});});};function localAuthenticate(_0xf176f,_0x4b9391,_0x3df964,_0xdc329d){_0xf176f[_0x4c7b('0x12')]({'where':{'name':_0x4b9391,'role':{'$or':[_0x4c7b('0x13'),_0x4c7b('0x14'),_0x4c7b('0x9')]}}})['then'](function(_0x3820a0){if(!_0x3820a0||_0x3820a0&&_0x3820a0[_0x4c7b('0x15')]!==_0x4b9391){return _0xdc329d(null,![],{'message':_0x4c7b('0x16')});}return getLicense(_0x3820a0);})[_0x4c7b('0xc')](function(_0x1b947b){_0x1b947b[_0x4c7b('0x17')](_0x3df964,function(_0x5dbf68,_0x45909c){if(_0x5dbf68){return _0xdc329d(_0x5dbf68);}if(!_0x45909c){return _0xdc329d(null,![],{'message':_0x4c7b('0x18')});}else{return _0xdc329d(null,_0x1b947b);}});})['catch'](function(_0x31eb05){_0xdc329d(_0x31eb05);});}function sendServiceMail(_0x3a0c69){return db[_0x4c7b('0x19')][_0x4c7b('0x12')]({'where':{'service':!![]},'attributes':['id',_0x4c7b('0x15'),_0x4c7b('0x1a')],'include':[{'model':db['MailServerOut'],'as':_0x4c7b('0x1b')}]})[_0x4c7b('0xc')](function(_0x2584c3){if(!_0x2584c3){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5e5085={'tls':{'rejectUnauthorized':![]}};if(_0x2584c3[_0x4c7b('0x1b')][_0x4c7b('0x1c')]){_0x5e5085[_0x4c7b('0x1c')]=_0x2584c3['Smtp'][_0x4c7b('0x1c')];}else{_0x5e5085['host']=_0x2584c3[_0x4c7b('0x1b')]['host'];_0x5e5085[_0x4c7b('0x1d')]=_0x2584c3[_0x4c7b('0x1b')][_0x4c7b('0x1d')];_0x5e5085[_0x4c7b('0x1e')]=_0x2584c3[_0x4c7b('0x1b')][_0x4c7b('0x1e')];}if(_0x2584c3[_0x4c7b('0x1b')][_0x4c7b('0x1f')]){_0x5e5085[_0x4c7b('0x20')]={'user':_0x2584c3['Smtp']['user'],'pass':_0x2584c3[_0x4c7b('0x1b')]['pass']};}var _0x10a19f={'account':_0x5e5085,'message':_[_0x4c7b('0x21')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x2584c3[_0x4c7b('0x15')],_0x2584c3[_0x4c7b('0x1a')]||_0x2584c3[_0x4c7b('0x1b')][_0x4c7b('0x14')])},_0x3a0c69)};return client['request'](_0x4c7b('0x22'),_0x10a19f);})[_0x4c7b('0xc')](function(_0x5932e9){if(_0x5932e9[_0x4c7b('0x23')]){throw new Error(util[_0x4c7b('0x24')](_0x4c7b('0x25'),_0x5932e9[_0x4c7b('0x23')]['message']||JSON[_0x4c7b('0x26')](_0x5932e9[_0x4c7b('0x23')])));}return!![];});}function handleError(_0x1a3a76,_0x3d5c36,_0x3507f4){return _0x1a3a76[_0x4c7b('0x27')](_0x3d5c36||0x1f4)[_0x4c7b('0x28')]({'message':_0x3507f4?_0x3507f4['message']||_0x3507f4:''});}exports['login']=function(_0x3f5cd8,_0x482b35,_0x2e664b){passport[_0x4c7b('0x17')]('local',function(_0x1b9b0c,_0x5eacda,_0x1edbc1){var _0x4148e5=_0x1b9b0c||_0x1edbc1;if(_0x4148e5){return handleError(_0x482b35,0x191,_0x4148e5);}if(!_0x5eacda){return handleError(_0x482b35,0x194,{'message':_0x4c7b('0x29')});}var _0x20037b=signToken(_0x5eacda['id'],_0x5eacda[_0x4c7b('0x8')]);_0x482b35[_0x4c7b('0x2a')]({'id':_0x5eacda['id'],'token':_0x20037b,'statusCall':'','isAlreadyLogged':_0x5eacda[_0x4c7b('0x2b')]});})(_0x3f5cd8,_0x482b35,_0x2e664b);};exports[_0x4c7b('0x2c')]=function(_0x5a7a10,_0x7823be,_0x1baf82){if(!_0x5a7a10[_0x4c7b('0x2d')][_0x4c7b('0x1a')]){return handleError(_0x7823be,0x1f4,{'message':_0x4c7b('0x2e')});}var _0x49f941=rs[_0x4c7b('0x2f')]();_0x5a7a10[_0x4c7b('0x2d')][_0x4c7b('0x1a')]=_0x5a7a10[_0x4c7b('0x2d')][_0x4c7b('0x1a')][_0x4c7b('0x30')]()[_0x4c7b('0x31')]();return db[_0x4c7b('0xa')][_0x4c7b('0x12')]({'where':{'email':_0x5a7a10['body'][_0x4c7b('0x1a')]}})['then'](function(_0x12575e){if(!_0x12575e){throw new Error(_0x4c7b('0x32'));}_0x12575e[_0x4c7b('0x33')]=_0x49f941;_0x12575e[_0x4c7b('0x34')]=Date[_0x4c7b('0x35')]()+0x36ee80;return _0x12575e[_0x4c7b('0x36')]();})[_0x4c7b('0xc')](function(){return sendServiceMail({'to':_0x5a7a10[_0x4c7b('0x2d')]['email'],'subject':_0x4c7b('0x37'),'text':_0x4c7b('0x38')+_0x4c7b('0x39')+'http://'+_0x5a7a10[_0x4c7b('0x3a')]['host']+_0x4c7b('0x3b')+_0x49f941+'\x0a\x0a'+_0x4c7b('0x3c')});})['then'](function(){_0x7823be[_0x4c7b('0x27')](0xc8)[_0x4c7b('0x28')]({'message':_0x4c7b('0x3d')});})['catch'](function(_0x4c77b1){return handleError(_0x7823be,0x1f4,_0x4c77b1);});};exports[_0x4c7b('0x3e')]=function(_0x2542c3,_0x36af13,_0x311640){return db[_0x4c7b('0xa')][_0x4c7b('0x12')]({'where':{'resetPasswordToken':_0x2542c3[_0x4c7b('0x3f')][_0x4c7b('0x40')],'resetPasswordExpires':{'$gt':Date[_0x4c7b('0x35')]()}}})[_0x4c7b('0xc')](function(_0x30b733){if(!_0x30b733){throw new Error(_0x4c7b('0x41'));}_0x30b733[_0x4c7b('0x42')]=_0x2542c3[_0x4c7b('0x2d')][_0x4c7b('0x42')];_0x30b733[_0x4c7b('0x33')]=null;_0x30b733['resetPasswordExpires']=null;return _0x30b733[_0x4c7b('0x36')]();})[_0x4c7b('0xc')](function(){_0x36af13[_0x4c7b('0x27')](0xc8)['send']({'message':_0x4c7b('0x43')});})[_0x4c7b('0x11')](function(_0x6433a6){return handleError(_0x36af13,0x1f4,_0x6433a6);});};passport['use'](new LocalStrategy({'usernameField':_0x4c7b('0x15'),'passwordField':_0x4c7b('0x42')},function(_0x559207,_0x487a03,_0x44fca8){return localAuthenticate(db[_0x4c7b('0xa')],_0x559207,_0x487a03,_0x44fca8);}));
\ No newline at end of file
index ee25053..21c7201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d06=['login','/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','post'];(function(_0x4c1278,_0x56493a){var _0x2fa483=function(_0xd52dbc){while(--_0xd52dbc){_0x4c1278['push'](_0x4c1278['shift']());}};_0x2fa483(++_0x56493a);}(_0x2d06,0x68));var _0x62d0=function(_0x27f36c,_0x48de51){_0x27f36c=_0x27f36c-0x0;var _0x3cdebe=_0x2d06[_0x27f36c];return _0x3cdebe;};'use strict';var express=require(_0x62d0('0x0'));var router=express[_0x62d0('0x1')]();var controller=require(_0x62d0('0x2'));router[_0x62d0('0x3')]('/',controller[_0x62d0('0x4')]);router['post'](_0x62d0('0x5'),controller[_0x62d0('0x6')]);router[_0x62d0('0x3')](_0x62d0('0x7'),controller['reset']);module[_0x62d0('0x8')]=router;
\ No newline at end of file
+var _0x5db3=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','Router'];(function(_0x4af85d,_0x5244c3){var _0x279069=function(_0x174eaf){while(--_0x174eaf){_0x4af85d['push'](_0x4af85d['shift']());}};_0x279069(++_0x5244c3);}(_0x5db3,0x6f));var _0x35db=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0x5db3[_0xe51596];return _0x22c705;};'use strict';var express=require('express');var router=express[_0x35db('0x0')]();var controller=require(_0x35db('0x1'));router[_0x35db('0x2')]('/',controller[_0x35db('0x3')]);router[_0x35db('0x2')](_0x35db('0x4'),controller[_0x35db('0x5')]);router['post'](_0x35db('0x6'),controller['reset']);module['exports']=router;
\ No newline at end of file
index 806f1a2..a963ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad6b=['BOOLEAN','sequelize','exports','STRING'];(function(_0x44741c,_0x5b24e0){var _0x353e12=function(_0x379218){while(--_0x379218){_0x44741c['push'](_0x44741c['shift']());}};_0x353e12(++_0x5b24e0);}(_0xad6b,0x159));var _0xbad6=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xad6b[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0xbad6('0x0'));module[_0xbad6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xbad6('0x2')]},'description':{'type':Sequelize[_0xbad6('0x2')]},'status':{'type':Sequelize[_0xbad6('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x4910=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4910,0x1d9));var _0x0491=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4910[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x0491('0x0'));module[_0x0491('0x1')]={'name':{'type':Sequelize[_0x0491('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0491('0x2')]},'status':{'type':Sequelize[_0x0491('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0491('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 9ccd728..9f6a22b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dfd=['include','options','find','create','body','update','params','addConditions','Condition','omit','findOne','getConditions','addActions','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','then','stack','name','send','index','Automation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','dateStart','dateEnd','day','add','merge','where','filter','map','type','VIRTUAL','field','count','includeAll','findAll','rows','catch','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd7df('0x0'));var emlformat=require(_0xd7df('0x1'));var rimraf=require(_0xd7df('0x2'));var zipdir=require(_0xd7df('0x3'));var jsonpatch=require(_0xd7df('0x4'));var rp=require(_0xd7df('0x5'));var moment=require(_0xd7df('0x6'));var BPromise=require(_0xd7df('0x7'));var Mustache=require(_0xd7df('0x8'));var util=require(_0xd7df('0x9'));var path=require(_0xd7df('0xa'));var sox=require(_0xd7df('0xb'));var csv=require(_0xd7df('0xc'));var ejs=require(_0xd7df('0xd'));var fs=require('fs');var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xc'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var qs=require(_0xd7df('0x14'));var logger=require('../../config/logger')(_0xd7df('0x15'));var utils=require('../../config/utils');var config=require(_0xd7df('0x16'));var db=require(_0xd7df('0x17'))['db'];function respondWithStatusCode(_0x28d358,_0x18d8f8){_0x18d8f8=_0x18d8f8||0xcc;return function(_0x17497b){if(_0x17497b){return _0x28d358[_0xd7df('0x18')](_0x18d8f8);}return _0x28d358[_0xd7df('0x19')](_0x18d8f8)[_0xd7df('0x1a')]();};}function respondWithResult(_0x7ba3c,_0x4d6f17){_0x4d6f17=_0x4d6f17||0xc8;return function(_0xa70589){if(_0xa70589){return _0x7ba3c[_0xd7df('0x19')](_0x4d6f17)[_0xd7df('0x1b')](_0xa70589);}};}function respondWithFilteredResult(_0x196632,_0x3b2559){return function(_0x202833){if(_0x202833){var _0x31f557=_0x202833['count'],_0x57b8be=_0x3b2559[_0xd7df('0x1c')],_0x4c5cf=_0x3b2559[_0xd7df('0x1c')]+_0x3b2559['limit'],_0x23cdbc;if(_0x4c5cf>=_0x31f557){_0x4c5cf=_0x31f557;_0x23cdbc=0xc8;}else{_0x23cdbc=0xce;}_0x196632[_0xd7df('0x19')](_0x23cdbc);return _0x196632[_0xd7df('0x1d')](_0xd7df('0x1e'),_0x57b8be+'-'+_0x4c5cf+'/'+_0x31f557)['json'](_0x202833);}return null;};}function patchUpdates(_0x40167d){return function(_0x471621){try{jsonpatch[_0xd7df('0x1f')](_0x471621,_0x40167d,!![]);}catch(_0x5ba653){return BPromise[_0xd7df('0x20')](_0x5ba653);}return _0x471621[_0xd7df('0x21')]();};}function saveUpdates(_0x4e1985,_0x5acb0a){return function(_0x4188af){if(_0x4188af){return _0x4188af['update'](_0x4e1985)[_0xd7df('0x22')](function(_0x5ab737){return _0x5ab737;});}return null;};}function removeEntity(_0x3ae7c3,_0x342b54){return function(_0x4eabb8){if(_0x4eabb8){return _0x4eabb8['destroy']()[_0xd7df('0x22')](function(){_0x3ae7c3['status'](0xcc)[_0xd7df('0x1a')]();});}};}function handleEntityNotFound(_0x379e4a,_0x40e7af){return function(_0x29f354){if(!_0x29f354){_0x379e4a[_0xd7df('0x18')](0x194);}return _0x29f354;};}function handleError(_0xa80cbf,_0x1e3bf3){_0x1e3bf3=_0x1e3bf3||0x1f4;return function(_0x5e5c1a){logger['error'](_0x5e5c1a[_0xd7df('0x23')]);if(_0x5e5c1a[_0xd7df('0x24')]){delete _0x5e5c1a[_0xd7df('0x24')];}_0xa80cbf[_0xd7df('0x19')](_0x1e3bf3)[_0xd7df('0x25')](_0x5e5c1a);};}exports[_0xd7df('0x26')]=function(_0x373359,_0x2b6fde){var _0x163904={},_0x5c4d17={},_0xe53f53={'count':0x0,'rows':[]};var _0x132fd1=db[_0xd7df('0x27')][_0xd7df('0x28')];_0x5c4d17[_0xd7df('0x29')]=_[_0xd7df('0x2a')](_0x132fd1);var _0x3f78fa={'dateStart':_0x373359[_0xd7df('0x2b')]['dateStart'],'dateEnd':_0x373359['query']['dateEnd']};delete _0x373359['query']['dateStart'];delete _0x373359[_0xd7df('0x2b')]['dateEnd'];_0x5c4d17[_0xd7df('0x2b')]=_[_0xd7df('0x2a')](_0x373359['query']);_0x5c4d17[_0xd7df('0x2c')]=_[_0xd7df('0x2d')](_0x5c4d17['model'],_0x5c4d17[_0xd7df('0x2b')]);_0x163904[_0xd7df('0x2e')]=_[_0xd7df('0x2d')](_0x5c4d17[_0xd7df('0x29')],qs[_0xd7df('0x2f')](_0x373359[_0xd7df('0x2b')]['fields']));_0x163904[_0xd7df('0x2e')]=_0x163904[_0xd7df('0x2e')][_0xd7df('0x30')]?_0x163904[_0xd7df('0x2e')]:_0x5c4d17[_0xd7df('0x29')];if(!_0x373359[_0xd7df('0x2b')][_0xd7df('0x31')](_0xd7df('0x32'))){_0x163904[_0xd7df('0x33')]=qs[_0xd7df('0x33')](_0x373359[_0xd7df('0x2b')]['limit']);_0x163904['offset']=qs[_0xd7df('0x1c')](_0x373359['query'][_0xd7df('0x1c')]);}_0x163904[_0xd7df('0x34')]=qs[_0xd7df('0x35')](_0x373359[_0xd7df('0x2b')]['sort']);_0x163904['where']=qs['filters'](_[_0xd7df('0x36')](_0x373359[_0xd7df('0x2b')],_0x5c4d17['filters']));if(_0x3f78fa[_0xd7df('0x37')]){if(_0x3f78fa[_0xd7df('0x38')]){_0x3f78fa[_0xd7df('0x38')]=moment(_0x3f78fa[_0xd7df('0x38')])['add'](0x1,_0xd7df('0x39'));}else{_0x3f78fa[_0xd7df('0x38')]=moment(_0x3f78fa['dateStart'])[_0xd7df('0x3a')](0x1,'day');}_[_0xd7df('0x3b')](_0x163904[_0xd7df('0x3c')],{'createdAt':{'$gte':_0x3f78fa[_0xd7df('0x37')],'$lte':_0x3f78fa['dateEnd']}});}if(_0x373359[_0xd7df('0x2b')][_0xd7df('0x3d')]){_0x163904[_0xd7df('0x3c')]=_[_0xd7df('0x3b')](_0x163904['where'],{'$or':_[_0xd7df('0x3e')](_0x132fd1,function(_0x230857){if(_0x230857[_0xd7df('0x3f')]['key']!==_0xd7df('0x40')){var _0x207852={};_0x207852[_0x230857[_0xd7df('0x41')]]={'$like':'%'+_0x373359['query'][_0xd7df('0x3d')]+'%'};return _0x207852;}})});}_0x163904=_[_0xd7df('0x3b')]({},_0x163904,_0x373359['options']);var _0x4b2561={'where':_0x163904[_0xd7df('0x3c')]};return db[_0xd7df('0x27')][_0xd7df('0x42')](_0x4b2561)['then'](function(_0x5e8cd0){_0xe53f53[_0xd7df('0x42')]=_0x5e8cd0;if(_0x373359['query'][_0xd7df('0x43')]){_0x163904['include']=[{'all':!![]}];}return db['Automation'][_0xd7df('0x44')](_0x163904);})['then'](function(_0x18ef10){_0xe53f53[_0xd7df('0x45')]=_0x18ef10;return _0xe53f53;})[_0xd7df('0x22')](respondWithFilteredResult(_0x2b6fde,_0x163904))[_0xd7df('0x46')](handleError(_0x2b6fde,null));};exports[_0xd7df('0x47')]=function(_0x236b25,_0x1ab88){var _0x19c5d8={'raw':![],'where':{'id':_0x236b25['params']['id']}},_0x183ca7={};_0x183ca7[_0xd7df('0x29')]=_['keys'](db[_0xd7df('0x27')][_0xd7df('0x28')]);_0x183ca7[_0xd7df('0x2b')]=_[_0xd7df('0x2a')](_0x236b25[_0xd7df('0x2b')]);_0x183ca7[_0xd7df('0x2c')]=_[_0xd7df('0x2d')](_0x183ca7[_0xd7df('0x29')],_0x183ca7[_0xd7df('0x2b')]);_0x19c5d8['attributes']=_[_0xd7df('0x2d')](_0x183ca7[_0xd7df('0x29')],qs['fields'](_0x236b25['query'][_0xd7df('0x2f')]));_0x19c5d8[_0xd7df('0x2e')]=_0x19c5d8[_0xd7df('0x2e')]['length']?_0x19c5d8['attributes']:_0x183ca7[_0xd7df('0x29')];if(_0x236b25['query'][_0xd7df('0x43')]){_0x19c5d8[_0xd7df('0x48')]=[{'all':!![]}];}_0x19c5d8=_[_0xd7df('0x3b')]({},_0x19c5d8,_0x236b25[_0xd7df('0x49')]);return db[_0xd7df('0x27')][_0xd7df('0x4a')](_0x19c5d8)[_0xd7df('0x22')](handleEntityNotFound(_0x1ab88,null))[_0xd7df('0x22')](respondWithResult(_0x1ab88,null))[_0xd7df('0x46')](handleError(_0x1ab88,null));};exports[_0xd7df('0x4b')]=function(_0x1fd63a,_0x3a7c84){return db['Automation'][_0xd7df('0x4b')](_0x1fd63a[_0xd7df('0x4c')],{})[_0xd7df('0x22')](respondWithResult(_0x3a7c84,0xc9))[_0xd7df('0x46')](handleError(_0x3a7c84,null));};exports[_0xd7df('0x4d')]=function(_0x5c3281,_0x2f7b83){if(_0x5c3281[_0xd7df('0x4c')]['id']){delete _0x5c3281[_0xd7df('0x4c')]['id'];}return db['Automation'][_0xd7df('0x4a')]({'where':{'id':_0x5c3281['params']['id']}})[_0xd7df('0x22')](handleEntityNotFound(_0x2f7b83,null))[_0xd7df('0x22')](saveUpdates(_0x5c3281[_0xd7df('0x4c')],null))[_0xd7df('0x22')](respondWithResult(_0x2f7b83,null))[_0xd7df('0x46')](handleError(_0x2f7b83,null));};exports['destroy']=function(_0x4abe81,_0x53ec02){return db[_0xd7df('0x27')]['find']({'where':{'id':_0x4abe81[_0xd7df('0x4e')]['id']}})[_0xd7df('0x22')](handleEntityNotFound(_0x53ec02,null))[_0xd7df('0x22')](removeEntity(_0x53ec02,null))[_0xd7df('0x46')](handleError(_0x53ec02,null));};exports[_0xd7df('0x4f')]=function(_0x418da,_0xf72803,_0xb054d7){return db[_0xd7df('0x50')][_0xd7df('0x4a')]({'where':{'id':_0x418da[_0xd7df('0x4e')]['id']}})[_0xd7df('0x22')](handleEntityNotFound(_0xf72803,null))[_0xd7df('0x22')](function(_0x109707){if(_0x109707){return _0x109707[_0xd7df('0x4f')](_0x418da[_0xd7df('0x4c')]['ids'],_[_0xd7df('0x51')](_0x418da[_0xd7df('0x4c')],['ids','id'])||{});}})['then'](respondWithResult(_0xf72803,null))[_0xd7df('0x46')](handleError(_0xf72803,null));};exports['getConditions']=function(_0x34abbb,_0x4fb55a,_0x1f34c2){var _0x28151a={};var _0x228ed7={};var _0x58223d;var _0x488333;return db['Automation'][_0xd7df('0x52')]({'where':{'id':_0x34abbb[_0xd7df('0x4e')]['id']}})[_0xd7df('0x22')](handleEntityNotFound(_0x4fb55a,null))[_0xd7df('0x22')](function(_0x41249b){if(_0x41249b){_0x58223d=_0x41249b;_0x228ed7[_0xd7df('0x29')]=_['keys'](db[_0xd7df('0x50')][_0xd7df('0x28')]);_0x228ed7[_0xd7df('0x2b')]=_[_0xd7df('0x2a')](_0x34abbb[_0xd7df('0x2b')]);_0x228ed7[_0xd7df('0x2c')]=_[_0xd7df('0x2d')](_0x228ed7[_0xd7df('0x29')],_0x228ed7[_0xd7df('0x2b')]);_0x28151a[_0xd7df('0x2e')]=_[_0xd7df('0x2d')](_0x228ed7[_0xd7df('0x29')],qs[_0xd7df('0x2f')](_0x34abbb[_0xd7df('0x2b')][_0xd7df('0x2f')]));_0x28151a[_0xd7df('0x2e')]=_0x28151a[_0xd7df('0x2e')][_0xd7df('0x30')]?_0x28151a[_0xd7df('0x2e')]:_0x228ed7[_0xd7df('0x29')];_0x28151a[_0xd7df('0x34')]=qs[_0xd7df('0x35')](_0x34abbb[_0xd7df('0x2b')][_0xd7df('0x35')]);_0x28151a[_0xd7df('0x3c')]=qs[_0xd7df('0x2c')](_['pick'](_0x34abbb['query'],_0x228ed7[_0xd7df('0x2c')]));if(_0x34abbb[_0xd7df('0x2b')][_0xd7df('0x3d')]){_0x28151a['where']=_[_0xd7df('0x3b')](_0x28151a[_0xd7df('0x3c')],{'$or':_[_0xd7df('0x3e')](_0x28151a[_0xd7df('0x2e')],function(_0x5b8ea7){var _0x286702={};_0x286702[_0x5b8ea7]={'$like':'%'+_0x34abbb[_0xd7df('0x2b')][_0xd7df('0x3d')]+'%'};return _0x286702;})});}_0x28151a=_[_0xd7df('0x3b')]({},_0x28151a,_0x34abbb[_0xd7df('0x49')]);return _0x58223d[_0xd7df('0x53')](_0x28151a);}})[_0xd7df('0x22')](function(_0x2fdad0){if(_0x2fdad0){_0x488333=_0x2fdad0['length'];if(!_0x34abbb[_0xd7df('0x2b')][_0xd7df('0x31')]('nolimit')){_0x28151a['limit']=qs['limit'](_0x34abbb[_0xd7df('0x2b')][_0xd7df('0x33')]);_0x28151a[_0xd7df('0x1c')]=qs[_0xd7df('0x1c')](_0x34abbb['query'][_0xd7df('0x1c')]);}return _0x58223d[_0xd7df('0x53')](_0x28151a);}})[_0xd7df('0x22')](function(_0x111aa2){if(_0x111aa2){return _0x111aa2?{'count':_0x488333,'rows':_0x111aa2}:null;}})[_0xd7df('0x22')](respondWithResult(_0x4fb55a,null))[_0xd7df('0x46')](handleError(_0x4fb55a,null));};exports[_0xd7df('0x54')]=function(_0x551476,_0x535925,_0x40d5c9){return db['Action'][_0xd7df('0x4a')]({'where':{'id':_0x551476[_0xd7df('0x4e')]['id']}})[_0xd7df('0x22')](handleEntityNotFound(_0x535925,null))['then'](function(_0x4ebe31){if(_0x4ebe31){return _0x4ebe31[_0xd7df('0x54')](_0x551476[_0xd7df('0x4c')]['ids'],_[_0xd7df('0x51')](_0x551476[_0xd7df('0x4c')],['ids','id'])||{});}})[_0xd7df('0x22')](respondWithResult(_0x535925,null))[_0xd7df('0x46')](handleError(_0x535925,null));};exports['getActions']=function(_0x189e38,_0x519f72,_0x56f55d){var _0x1d0ad3={};var _0x1394de={};var _0x387c46;var _0x11ef01;return db[_0xd7df('0x27')][_0xd7df('0x52')]({'where':{'id':_0x189e38['params']['id']}})['then'](handleEntityNotFound(_0x519f72,null))[_0xd7df('0x22')](function(_0x3febfa){if(_0x3febfa){_0x387c46=_0x3febfa;_0x1394de[_0xd7df('0x29')]=_[_0xd7df('0x2a')](db[_0xd7df('0x55')][_0xd7df('0x28')]);_0x1394de[_0xd7df('0x2b')]=_[_0xd7df('0x2a')](_0x189e38[_0xd7df('0x2b')]);_0x1394de['filters']=_[_0xd7df('0x2d')](_0x1394de[_0xd7df('0x29')],_0x1394de['query']);_0x1d0ad3[_0xd7df('0x2e')]=_[_0xd7df('0x2d')](_0x1394de[_0xd7df('0x29')],qs[_0xd7df('0x2f')](_0x189e38['query']['fields']));_0x1d0ad3['attributes']=_0x1d0ad3[_0xd7df('0x2e')]['length']?_0x1d0ad3[_0xd7df('0x2e')]:_0x1394de[_0xd7df('0x29')];_0x1d0ad3[_0xd7df('0x34')]=qs[_0xd7df('0x35')](_0x189e38[_0xd7df('0x2b')][_0xd7df('0x35')]);_0x1d0ad3['where']=qs[_0xd7df('0x2c')](_[_0xd7df('0x36')](_0x189e38[_0xd7df('0x2b')],_0x1394de['filters']));if(_0x189e38[_0xd7df('0x2b')][_0xd7df('0x3d')]){_0x1d0ad3['where']=_[_0xd7df('0x3b')](_0x1d0ad3[_0xd7df('0x3c')],{'$or':_[_0xd7df('0x3e')](_0x1d0ad3[_0xd7df('0x2e')],function(_0x1d122a){var _0x11c2e2={};_0x11c2e2[_0x1d122a]={'$like':'%'+_0x189e38[_0xd7df('0x2b')]['filter']+'%'};return _0x11c2e2;})});}_0x1d0ad3=_[_0xd7df('0x3b')]({},_0x1d0ad3,_0x189e38[_0xd7df('0x49')]);return _0x387c46[_0xd7df('0x56')](_0x1d0ad3);}})[_0xd7df('0x22')](function(_0x5a8270){if(_0x5a8270){_0x11ef01=_0x5a8270['length'];if(!_0x189e38[_0xd7df('0x2b')][_0xd7df('0x31')](_0xd7df('0x32'))){_0x1d0ad3[_0xd7df('0x33')]=qs[_0xd7df('0x33')](_0x189e38['query'][_0xd7df('0x33')]);_0x1d0ad3['offset']=qs['offset'](_0x189e38[_0xd7df('0x2b')][_0xd7df('0x1c')]);}return _0x387c46[_0xd7df('0x56')](_0x1d0ad3);}})[_0xd7df('0x22')](function(_0x30c401){if(_0x30c401){return _0x30c401?{'count':_0x11ef01,'rows':_0x30c401}:null;}})[_0xd7df('0x22')](respondWithResult(_0x519f72,null))['catch'](handleError(_0x519f72,null));};
\ No newline at end of file
+var _0x3e74=['jsforce','desk.js','papaparse','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','fields','attributes','length','add','day','merge','where','filter','key','VIRTUAL','field','Automation','count','include','findAll','rows','catch','params','includeAll','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','order','sort','pick','map','hasOwnProperty','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0xb1f507,_0x19b868){var _0x1daae4=function(_0x3bedf5){while(--_0x3bedf5){_0xb1f507['push'](_0xb1f507['shift']());}};_0x1daae4(++_0x19b868);}(_0x3e74,0x175));var _0x43e7=function(_0x4c752a,_0x3e783e){_0x4c752a=_0x4c752a-0x0;var _0x2f4473=_0x3e74[_0x4c752a];return _0x2f4473;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0xf'))(_0x43e7('0x10'));var utils=require('../../config/utils');var config=require(_0x43e7('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7c520,_0x37302c){_0x37302c=_0x37302c||0xcc;return function(_0x4ebc8e){if(_0x4ebc8e){return _0xf7c520[_0x43e7('0x12')](_0x37302c);}return _0xf7c520[_0x43e7('0x13')](_0x37302c)[_0x43e7('0x14')]();};}function respondWithResult(_0x3bb83f,_0x4e008c){_0x4e008c=_0x4e008c||0xc8;return function(_0x583d85){if(_0x583d85){return _0x3bb83f[_0x43e7('0x13')](_0x4e008c)[_0x43e7('0x15')](_0x583d85);}};}function respondWithFilteredResult(_0x44b0bd,_0x51b974){return function(_0x5e641c){if(_0x5e641c){var _0x16849c=_0x5e641c['count'],_0x14c146=_0x51b974['offset'],_0x203378=_0x51b974[_0x43e7('0x16')]+_0x51b974[_0x43e7('0x17')],_0x328445;if(_0x203378>=_0x16849c){_0x203378=_0x16849c;_0x328445=0xc8;}else{_0x328445=0xce;}_0x44b0bd[_0x43e7('0x13')](_0x328445);return _0x44b0bd['set']('Content-Range',_0x14c146+'-'+_0x203378+'/'+_0x16849c)[_0x43e7('0x15')](_0x5e641c);}return null;};}function patchUpdates(_0x1ca758){return function(_0x9037d3){try{jsonpatch[_0x43e7('0x18')](_0x9037d3,_0x1ca758,!![]);}catch(_0x3776f5){return BPromise[_0x43e7('0x19')](_0x3776f5);}return _0x9037d3[_0x43e7('0x1a')]();};}function saveUpdates(_0x1441ef,_0x2377a3){return function(_0xab63cf){if(_0xab63cf){return _0xab63cf[_0x43e7('0x1b')](_0x1441ef)[_0x43e7('0x1c')](function(_0x4b5d64){return _0x4b5d64;});}return null;};}function removeEntity(_0xef1a5a,_0x3c6625){return function(_0x4b386b){if(_0x4b386b){return _0x4b386b[_0x43e7('0x1d')]()[_0x43e7('0x1c')](function(){_0xef1a5a[_0x43e7('0x13')](0xcc)[_0x43e7('0x14')]();});}};}function handleEntityNotFound(_0x4077fb,_0x2f4cb4){return function(_0x54a9e7){if(!_0x54a9e7){_0x4077fb[_0x43e7('0x12')](0x194);}return _0x54a9e7;};}function handleError(_0x4eea52,_0x4c9df3){_0x4c9df3=_0x4c9df3||0x1f4;return function(_0x47204e){logger[_0x43e7('0x1e')](_0x47204e['stack']);if(_0x47204e[_0x43e7('0x1f')]){delete _0x47204e['name'];}_0x4eea52[_0x43e7('0x13')](_0x4c9df3)['send'](_0x47204e);};}exports[_0x43e7('0x20')]=function(_0x1b5f50,_0x20888b){var _0x405f85={},_0x51f4d7={},_0x52b7b3={'count':0x0,'rows':[]};var _0x805b54=db['Automation'][_0x43e7('0x21')];_0x51f4d7[_0x43e7('0x22')]=_[_0x43e7('0x23')](_0x805b54);var _0xb1fc63={'dateStart':_0x1b5f50['query'][_0x43e7('0x24')],'dateEnd':_0x1b5f50[_0x43e7('0x25')][_0x43e7('0x26')]};delete _0x1b5f50[_0x43e7('0x25')][_0x43e7('0x24')];delete _0x1b5f50[_0x43e7('0x25')][_0x43e7('0x26')];_0x51f4d7[_0x43e7('0x25')]=_[_0x43e7('0x23')](_0x1b5f50[_0x43e7('0x25')]);_0x51f4d7[_0x43e7('0x27')]=_[_0x43e7('0x28')](_0x51f4d7[_0x43e7('0x22')],_0x51f4d7[_0x43e7('0x25')]);_0x405f85['attributes']=_[_0x43e7('0x28')](_0x51f4d7[_0x43e7('0x22')],qs[_0x43e7('0x29')](_0x1b5f50[_0x43e7('0x25')][_0x43e7('0x29')]));_0x405f85['attributes']=_0x405f85[_0x43e7('0x2a')][_0x43e7('0x2b')]?_0x405f85[_0x43e7('0x2a')]:_0x51f4d7[_0x43e7('0x22')];if(!_0x1b5f50['query']['hasOwnProperty']('nolimit')){_0x405f85[_0x43e7('0x17')]=qs[_0x43e7('0x17')](_0x1b5f50[_0x43e7('0x25')][_0x43e7('0x17')]);_0x405f85[_0x43e7('0x16')]=qs[_0x43e7('0x16')](_0x1b5f50['query']['offset']);}_0x405f85['order']=qs['sort'](_0x1b5f50['query']['sort']);_0x405f85['where']=qs[_0x43e7('0x27')](_['pick'](_0x1b5f50[_0x43e7('0x25')],_0x51f4d7[_0x43e7('0x27')]));if(_0xb1fc63[_0x43e7('0x24')]){if(_0xb1fc63[_0x43e7('0x26')]){_0xb1fc63[_0x43e7('0x26')]=moment(_0xb1fc63[_0x43e7('0x26')])[_0x43e7('0x2c')](0x1,'day');}else{_0xb1fc63['dateEnd']=moment(_0xb1fc63['dateStart'])[_0x43e7('0x2c')](0x1,_0x43e7('0x2d'));}_[_0x43e7('0x2e')](_0x405f85[_0x43e7('0x2f')],{'createdAt':{'$gte':_0xb1fc63[_0x43e7('0x24')],'$lte':_0xb1fc63[_0x43e7('0x26')]}});}if(_0x1b5f50[_0x43e7('0x25')][_0x43e7('0x30')]){_0x405f85['where']=_[_0x43e7('0x2e')](_0x405f85[_0x43e7('0x2f')],{'$or':_['map'](_0x805b54,function(_0x2d54c1){if(_0x2d54c1['type'][_0x43e7('0x31')]!==_0x43e7('0x32')){var _0x1c6f45={};_0x1c6f45[_0x2d54c1[_0x43e7('0x33')]]={'$like':'%'+_0x1b5f50[_0x43e7('0x25')][_0x43e7('0x30')]+'%'};return _0x1c6f45;}})});}_0x405f85=_['merge']({},_0x405f85,_0x1b5f50['options']);var _0x30dfa9={'where':_0x405f85[_0x43e7('0x2f')]};return db[_0x43e7('0x34')][_0x43e7('0x35')](_0x30dfa9)[_0x43e7('0x1c')](function(_0x4a4a85){_0x52b7b3[_0x43e7('0x35')]=_0x4a4a85;if(_0x1b5f50[_0x43e7('0x25')]['includeAll']){_0x405f85[_0x43e7('0x36')]=[{'all':!![]}];}return db['Automation'][_0x43e7('0x37')](_0x405f85);})['then'](function(_0x3d81ae){_0x52b7b3[_0x43e7('0x38')]=_0x3d81ae;return _0x52b7b3;})[_0x43e7('0x1c')](respondWithFilteredResult(_0x20888b,_0x405f85))[_0x43e7('0x39')](handleError(_0x20888b,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':![],'where':{'id':_0x47d6a1[_0x43e7('0x3a')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['Automation'][_0x43e7('0x21')]);_0xe979b5['query']=_[_0x43e7('0x23')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x28')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x25')]);_0x40c509[_0x43e7('0x2a')]=_[_0x43e7('0x28')](_0xe979b5[_0x43e7('0x22')],qs['fields'](_0x47d6a1[_0x43e7('0x25')][_0x43e7('0x29')]));_0x40c509[_0x43e7('0x2a')]=_0x40c509[_0x43e7('0x2a')][_0x43e7('0x2b')]?_0x40c509[_0x43e7('0x2a')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x3b')]){_0x40c509[_0x43e7('0x36')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x2e')]({},_0x40c509,_0x47d6a1['options']);return db['Automation']['find'](_0x40c509)[_0x43e7('0x1c')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x1c')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x3c')]=function(_0x47686e,_0x3c96fe){return db['Automation']['create'](_0x47686e['body'],{})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x39')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x1b')]=function(_0x52fea5,_0x23e7cb){if(_0x52fea5[_0x43e7('0x3d')]['id']){delete _0x52fea5[_0x43e7('0x3d')]['id'];}return db[_0x43e7('0x34')]['find']({'where':{'id':_0x52fea5[_0x43e7('0x3a')]['id']}})['then'](handleEntityNotFound(_0x23e7cb,null))['then'](saveUpdates(_0x52fea5[_0x43e7('0x3d')],null))[_0x43e7('0x1c')](respondWithResult(_0x23e7cb,null))[_0x43e7('0x39')](handleError(_0x23e7cb,null));};exports[_0x43e7('0x1d')]=function(_0x13503c,_0x2351cf){return db[_0x43e7('0x34')][_0x43e7('0x3e')]({'where':{'id':_0x13503c[_0x43e7('0x3a')]['id']}})[_0x43e7('0x1c')](handleEntityNotFound(_0x2351cf,null))['then'](removeEntity(_0x2351cf,null))[_0x43e7('0x39')](handleError(_0x2351cf,null));};exports[_0x43e7('0x3f')]=function(_0x499c03,_0x39e3ca,_0x4e6f6d){return db[_0x43e7('0x40')][_0x43e7('0x3e')]({'where':{'id':_0x499c03[_0x43e7('0x3a')]['id']}})[_0x43e7('0x1c')](handleEntityNotFound(_0x39e3ca,null))[_0x43e7('0x1c')](function(_0x5e5556){if(_0x5e5556){return _0x5e5556['addConditions'](_0x499c03[_0x43e7('0x3d')][_0x43e7('0x41')],_[_0x43e7('0x42')](_0x499c03[_0x43e7('0x3d')],[_0x43e7('0x41'),'id'])||{});}})[_0x43e7('0x1c')](respondWithResult(_0x39e3ca,null))[_0x43e7('0x39')](handleError(_0x39e3ca,null));};exports[_0x43e7('0x43')]=function(_0x26d86c,_0x24e758,_0x312306){var _0x4ace49={};var _0x1ec35a={};var _0x2da2f3;var _0x50a3fa;return db[_0x43e7('0x34')][_0x43e7('0x44')]({'where':{'id':_0x26d86c[_0x43e7('0x3a')]['id']}})['then'](handleEntityNotFound(_0x24e758,null))['then'](function(_0x459c13){if(_0x459c13){_0x2da2f3=_0x459c13;_0x1ec35a[_0x43e7('0x22')]=_['keys'](db[_0x43e7('0x40')]['rawAttributes']);_0x1ec35a['query']=_[_0x43e7('0x23')](_0x26d86c[_0x43e7('0x25')]);_0x1ec35a[_0x43e7('0x27')]=_[_0x43e7('0x28')](_0x1ec35a[_0x43e7('0x22')],_0x1ec35a['query']);_0x4ace49[_0x43e7('0x2a')]=_[_0x43e7('0x28')](_0x1ec35a['model'],qs[_0x43e7('0x29')](_0x26d86c[_0x43e7('0x25')][_0x43e7('0x29')]));_0x4ace49['attributes']=_0x4ace49['attributes']['length']?_0x4ace49[_0x43e7('0x2a')]:_0x1ec35a[_0x43e7('0x22')];_0x4ace49[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x26d86c['query']['sort']);_0x4ace49[_0x43e7('0x2f')]=qs[_0x43e7('0x27')](_[_0x43e7('0x47')](_0x26d86c[_0x43e7('0x25')],_0x1ec35a['filters']));if(_0x26d86c[_0x43e7('0x25')][_0x43e7('0x30')]){_0x4ace49[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x4ace49[_0x43e7('0x2f')],{'$or':_[_0x43e7('0x48')](_0x4ace49[_0x43e7('0x2a')],function(_0x46748f){var _0x406155={};_0x406155[_0x46748f]={'$like':'%'+_0x26d86c[_0x43e7('0x25')][_0x43e7('0x30')]+'%'};return _0x406155;})});}_0x4ace49=_['merge']({},_0x4ace49,_0x26d86c['options']);return _0x2da2f3[_0x43e7('0x43')](_0x4ace49);}})['then'](function(_0x501616){if(_0x501616){_0x50a3fa=_0x501616['length'];if(!_0x26d86c[_0x43e7('0x25')][_0x43e7('0x49')]('nolimit')){_0x4ace49[_0x43e7('0x17')]=qs[_0x43e7('0x17')](_0x26d86c[_0x43e7('0x25')]['limit']);_0x4ace49[_0x43e7('0x16')]=qs[_0x43e7('0x16')](_0x26d86c[_0x43e7('0x25')][_0x43e7('0x16')]);}return _0x2da2f3[_0x43e7('0x43')](_0x4ace49);}})[_0x43e7('0x1c')](function(_0x1e02fa){if(_0x1e02fa){return _0x1e02fa?{'count':_0x50a3fa,'rows':_0x1e02fa}:null;}})['then'](respondWithResult(_0x24e758,null))[_0x43e7('0x39')](handleError(_0x24e758,null));};exports[_0x43e7('0x4a')]=function(_0x415f26,_0x549f4e,_0x56b06d){return db[_0x43e7('0x4b')]['find']({'where':{'id':_0x415f26['params']['id']}})[_0x43e7('0x1c')](handleEntityNotFound(_0x549f4e,null))[_0x43e7('0x1c')](function(_0x5b5833){if(_0x5b5833){return _0x5b5833[_0x43e7('0x4a')](_0x415f26[_0x43e7('0x3d')][_0x43e7('0x41')],_[_0x43e7('0x42')](_0x415f26[_0x43e7('0x3d')],[_0x43e7('0x41'),'id'])||{});}})[_0x43e7('0x1c')](respondWithResult(_0x549f4e,null))['catch'](handleError(_0x549f4e,null));};exports[_0x43e7('0x4c')]=function(_0x1bb7ad,_0x4e5956,_0x418213){var _0x5c2c5f={};var _0x26ee52={};var _0x248936;var _0x37301b;return db[_0x43e7('0x34')]['findOne']({'where':{'id':_0x1bb7ad[_0x43e7('0x3a')]['id']}})[_0x43e7('0x1c')](handleEntityNotFound(_0x4e5956,null))[_0x43e7('0x1c')](function(_0x556001){if(_0x556001){_0x248936=_0x556001;_0x26ee52[_0x43e7('0x22')]=_[_0x43e7('0x23')](db[_0x43e7('0x4b')][_0x43e7('0x21')]);_0x26ee52[_0x43e7('0x25')]=_['keys'](_0x1bb7ad[_0x43e7('0x25')]);_0x26ee52[_0x43e7('0x27')]=_[_0x43e7('0x28')](_0x26ee52[_0x43e7('0x22')],_0x26ee52[_0x43e7('0x25')]);_0x5c2c5f[_0x43e7('0x2a')]=_[_0x43e7('0x28')](_0x26ee52['model'],qs['fields'](_0x1bb7ad[_0x43e7('0x25')]['fields']));_0x5c2c5f['attributes']=_0x5c2c5f['attributes'][_0x43e7('0x2b')]?_0x5c2c5f[_0x43e7('0x2a')]:_0x26ee52[_0x43e7('0x22')];_0x5c2c5f[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x1bb7ad[_0x43e7('0x25')]['sort']);_0x5c2c5f[_0x43e7('0x2f')]=qs[_0x43e7('0x27')](_[_0x43e7('0x47')](_0x1bb7ad['query'],_0x26ee52[_0x43e7('0x27')]));if(_0x1bb7ad[_0x43e7('0x25')][_0x43e7('0x30')]){_0x5c2c5f[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x5c2c5f[_0x43e7('0x2f')],{'$or':_[_0x43e7('0x48')](_0x5c2c5f[_0x43e7('0x2a')],function(_0x57b4b4){var _0x52c757={};_0x52c757[_0x57b4b4]={'$like':'%'+_0x1bb7ad['query'][_0x43e7('0x30')]+'%'};return _0x52c757;})});}_0x5c2c5f=_[_0x43e7('0x2e')]({},_0x5c2c5f,_0x1bb7ad['options']);return _0x248936[_0x43e7('0x4c')](_0x5c2c5f);}})[_0x43e7('0x1c')](function(_0x41a18f){if(_0x41a18f){_0x37301b=_0x41a18f[_0x43e7('0x2b')];if(!_0x1bb7ad['query']['hasOwnProperty']('nolimit')){_0x5c2c5f[_0x43e7('0x17')]=qs[_0x43e7('0x17')](_0x1bb7ad['query']['limit']);_0x5c2c5f[_0x43e7('0x16')]=qs[_0x43e7('0x16')](_0x1bb7ad[_0x43e7('0x25')]['offset']);}return _0x248936[_0x43e7('0x4c')](_0x5c2c5f);}})[_0x43e7('0x1c')](function(_0x401654){if(_0x401654){return _0x401654?{'count':_0x37301b,'rows':_0x401654}:null;}})[_0x43e7('0x1c')](respondWithResult(_0x4e5956,null))['catch'](handleError(_0x4e5956,null));};
\ No newline at end of file
index ed4543f..9c5daea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x160c=['bluebird','request-promise','./automation.attributes','exports','define','tools_automations','lodash','util'];(function(_0x2d7fd2,_0x34987e){var _0x41cb8b=function(_0xeea652){while(--_0xeea652){_0x2d7fd2['push'](_0x2d7fd2['shift']());}};_0x41cb8b(++_0x34987e);}(_0x160c,0xde));var _0xc160=function(_0x5a77a2,_0xe62a5b){_0x5a77a2=_0x5a77a2-0x0;var _0xe4624e=_0x160c[_0x5a77a2];return _0xe4624e;};'use strict';var _=require(_0xc160('0x0'));var util=require(_0xc160('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc160('0x2'));var rp=require(_0xc160('0x3'));var attributes=require(_0xc160('0x4'));module[_0xc160('0x5')]=function(_0x48fa88,_0x39dc10){return _0x48fa88[_0xc160('0x6')]('Automation',attributes,{'tableName':_0xc160('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2099=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./automation.attributes','define','Automation'];(function(_0x881b82,_0xf8b26){var _0x21a818=function(_0x243d6e){while(--_0x243d6e){_0x881b82['push'](_0x881b82['shift']());}};_0x21a818(++_0xf8b26);}(_0x2099,0x140));var _0x9209=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2099[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x9209('0x0'));var util=require(_0x9209('0x1'));var logger=require(_0x9209('0x2'))(_0x9209('0x3'));var moment=require(_0x9209('0x4'));var BPromise=require(_0x9209('0x5'));var rp=require(_0x9209('0x6'));var attributes=require(_0x9209('0x7'));module['exports']=function(_0x2c7322,_0x41950c){return _0x2c7322[_0x9209('0x8')](_0x9209('0x9'),attributes,{'tableName':_0x9209('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6c82acd..e180c35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa46e=['request','then','request\x20sent','debug','stringify','error','code','message','Automation,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http'];(function(_0x45e505,_0x1bf5b3){var _0x52001f=function(_0x12114b){while(--_0x12114b){_0x45e505['push'](_0x45e505['shift']());}};_0x52001f(++_0x1bf5b3);}(_0xa46e,0x8a));var _0xea46=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0xa46e[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('Automation,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('Automation,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('Automation,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}
\ No newline at end of file
+var _0x3079=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util'];(function(_0x3193f9,_0x2c0bb2){var _0x1a6c56=function(_0x13861){while(--_0x13861){_0x3193f9['push'](_0x3193f9['shift']());}};_0x1a6c56(++_0x2c0bb2);}(_0x3079,0x110));var _0x9307=function(_0x4ac6bf,_0x5a575c){_0x4ac6bf=_0x4ac6bf-0x0;var _0x512540=_0x3079[_0x4ac6bf];return _0x512540;};'use strict';var _=require('lodash');var util=require(_0x9307('0x0'));var moment=require(_0x9307('0x1'));var BPromise=require(_0x9307('0x2'));var rs=require(_0x9307('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9307('0x4'))['db'];var utils=require(_0x9307('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9307('0x6'));var jayson=require(_0x9307('0x7'));var client=jayson[_0x9307('0x8')][_0x9307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x215470,_0x4e6f60,_0x4dc532){return new BPromise(function(_0x3120da,_0x4ca523){return client[_0x9307('0xa')](_0x215470,_0x4dc532)[_0x9307('0xb')](function(_0x5e2560){logger[_0x9307('0xc')](_0x9307('0xd'),_0x4e6f60,_0x9307('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x4e6f60,_0x9307('0xe'),JSON[_0x9307('0xf')](_0x5e2560));if(_0x5e2560[_0x9307('0x10')]){if(_0x5e2560[_0x9307('0x10')][_0x9307('0x11')]===0x1f4){logger[_0x9307('0x10')]('Automation,\x20%s,\x20%s',_0x4e6f60,_0x5e2560[_0x9307('0x10')][_0x9307('0x12')]);return _0x4ca523(_0x5e2560['error']['message']);}logger[_0x9307('0x10')](_0x9307('0xd'),_0x4e6f60,_0x5e2560['error'][_0x9307('0x12')]);return _0x3120da(_0x5e2560[_0x9307('0x10')]['message']);}else{logger[_0x9307('0xc')](_0x9307('0xd'),_0x4e6f60,'request\x20sent');_0x3120da(_0x5e2560[_0x9307('0x13')][_0x9307('0x12')]);}})[_0x9307('0x14')](function(_0x5b6ac6){logger[_0x9307('0x10')](_0x9307('0xd'),_0x4e6f60,_0x5b6ac6);_0x4ca523(_0x5b6ac6);});});}
\ No newline at end of file
index 17a2038..30cab38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e11=['/:id','show','/:id/conditions','isAuthenticated','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index'];(function(_0x4429de,_0x2672ba){var _0x2a52d7=function(_0x3bc6c7){while(--_0x3bc6c7){_0x4429de['push'](_0x4429de['shift']());}};_0x2a52d7(++_0x2672ba);}(_0x5e11,0x1a6));var _0x15e1=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x5e11[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0x15e1('0x0'));var util=require('util');var path=require(_0x15e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x15e1('0x2'));var router=express[_0x15e1('0x3')]();var auth=require(_0x15e1('0x4'));var interaction=require(_0x15e1('0x5'));var config=require(_0x15e1('0x6'));var controller=require(_0x15e1('0x7'));router[_0x15e1('0x8')]('/',auth['isAuthenticated'](),controller[_0x15e1('0x9')]);router[_0x15e1('0x8')](_0x15e1('0xa'),auth['isAuthenticated'](),controller[_0x15e1('0xb')]);router[_0x15e1('0x8')](_0x15e1('0xc'),auth[_0x15e1('0xd')](),controller['getConditions']);router[_0x15e1('0x8')]('/:id/actions',auth[_0x15e1('0xd')](),controller[_0x15e1('0xe')]);router[_0x15e1('0xf')]('/',auth['isAuthenticated'](),controller[_0x15e1('0x10')]);router[_0x15e1('0xf')](_0x15e1('0xc'),auth['isAuthenticated'](),controller[_0x15e1('0x11')]);router[_0x15e1('0xf')]('/:id/actions',auth[_0x15e1('0xd')](),controller[_0x15e1('0x12')]);router[_0x15e1('0x13')](_0x15e1('0xa'),auth[_0x15e1('0xd')](),controller[_0x15e1('0x14')]);router[_0x15e1('0x15')](_0x15e1('0xa'),auth[_0x15e1('0xd')](),controller[_0x15e1('0x16')]);module[_0x15e1('0x17')]=router;
\ No newline at end of file
+var _0x4ba3=['delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update'];(function(_0x98075,_0x4e13c4){var _0x2ca821=function(_0x171470){while(--_0x171470){_0x98075['push'](_0x98075['shift']());}};_0x2ca821(++_0x4e13c4);}(_0x4ba3,0xe9));var _0x34ba=function(_0x25dbd4,_0x359199){_0x25dbd4=_0x25dbd4-0x0;var _0x55ca7e=_0x4ba3[_0x25dbd4];return _0x55ca7e;};'use strict';var multer=require(_0x34ba('0x0'));var util=require(_0x34ba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x34ba('0x2'));var router=express[_0x34ba('0x3')]();var auth=require(_0x34ba('0x4'));var interaction=require(_0x34ba('0x5'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x34ba('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x34ba('0x6')](_0x34ba('0x7'),auth[_0x34ba('0x8')](),controller[_0x34ba('0x9')]);router[_0x34ba('0x6')](_0x34ba('0xa'),auth[_0x34ba('0x8')](),controller[_0x34ba('0xb')]);router['get'](_0x34ba('0xc'),auth[_0x34ba('0x8')](),controller[_0x34ba('0xd')]);router[_0x34ba('0xe')]('/',auth['isAuthenticated'](),controller[_0x34ba('0xf')]);router[_0x34ba('0xe')](_0x34ba('0xa'),auth[_0x34ba('0x8')](),controller[_0x34ba('0x10')]);router[_0x34ba('0xe')](_0x34ba('0xc'),auth[_0x34ba('0x8')](),controller[_0x34ba('0x11')]);router[_0x34ba('0x12')](_0x34ba('0x7'),auth['isAuthenticated'](),controller[_0x34ba('0x13')]);router[_0x34ba('0x14')](_0x34ba('0x7'),auth[_0x34ba('0x8')](),controller[_0x34ba('0x15')]);module[_0x34ba('0x16')]=router;
\ No newline at end of file
index 4610799..1075ee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a5=['ASC','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x523a3a,_0x40bb6c){var _0x136cab=function(_0xb2f112){while(--_0xb2f112){_0x523a3a['push'](_0x523a3a['shift']());}};_0x136cab(++_0x40bb6c);}(_0xb7a5,0x1c2));var _0x5b7a=function(_0x38e13c,_0x67091d){_0x38e13c=_0x38e13c-0x0;var _0x5db840=_0xb7a5[_0x38e13c];return _0x5db840;};'use strict';var Sequelize=require(_0x5b7a('0x0'));module[_0x5b7a('0x1')]={'name':{'type':Sequelize[_0x5b7a('0x2')],'unique':_0x5b7a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5b7a('0x4')](_0x5b7a('0x5')),'allowNull':![],'defaultValue':_0x5b7a('0x5')},'description':{'type':Sequelize[_0x5b7a('0x2')]},'active':{'type':Sequelize[_0x5b7a('0x6')],'defaultValue':0x0,'comment':_0x5b7a('0x7')},'limitCalls':{'type':Sequelize[_0x5b7a('0x8')](0x4)[_0x5b7a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5b7a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5b7a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5b7a('0x8')](0x3)[_0x5b7a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x5b7a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5b7a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5b7a('0x8')](0x5)[_0x5b7a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b7a('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5b7a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x5b7a('0x8')](0x5)[_0x5b7a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b7a('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5b7a('0x8')](0x3)[_0x5b7a('0x9')],'defaultValue':0x3,'comment':_0x5b7a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5b7a('0x8')](0x5)[_0x5b7a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5b7a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5b7a('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5b7a('0xf')},'dialTimezone':{'type':Sequelize[_0x5b7a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5b7a('0x2')],'defaultValue':_0x5b7a('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x5b7a('0x4')](_0x5b7a('0x11'),_0x5b7a('0x12'),_0x5b7a('0x13')),'defaultValue':_0x5b7a('0x11')},'dialAMDActive':{'type':Sequelize[_0x5b7a('0x6')],'defaultValue':0x0,'comment':_0x5b7a('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x5b7a('0x8')](0x9)[_0x5b7a('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5b7a('0x8')](0x9)[_0x5b7a('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5b7a('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5b7a('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5b7a('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5b7a('0x8')](0x9)[_0x5b7a('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5b7a('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x5b7a('0x8')](0x9)[_0x5b7a('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5b7a('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5b7a('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x5b7a('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5b7a('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5b7a('0x8')](0x5)[_0x5b7a('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5b7a('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5b7a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5b7a('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5b7a('0x4')](_0x5b7a('0x1d'),_0x5b7a('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x5b7a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5b7a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x5b7a('0x8')](0x3)[_0x5b7a('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5b7a('0x1f')}};
\ No newline at end of file
+var _0x4beb=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','STRING','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.'];(function(_0x245530,_0x502f03){var _0x15aaeb=function(_0x16198e){while(--_0x16198e){_0x245530['push'](_0x245530['shift']());}};_0x15aaeb(++_0x502f03);}(_0x4beb,0x19d));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb4be('0x0')],'unique':_0xb4be('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb4be('0x2')](_0xb4be('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xb4be('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xb4be('0x4')](0x4)[_0xb4be('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb4be('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb4be('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xb4be('0x4')](0x3)[_0xb4be('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb4be('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb4be('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb4be('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb4be('0x4')](0x5)[_0xb4be('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb4be('0x4')](0x3)[_0xb4be('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb4be('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb4be('0x4')](0x5)[_0xb4be('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb4be('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb4be('0x4')](0x3)[_0xb4be('0x5')],'defaultValue':0x3,'comment':_0xb4be('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb4be('0x4')](0x5)[_0xb4be('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb4be('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb4be('0x4')](0x3)[_0xb4be('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb4be('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb4be('0x0')],'defaultValue':_0xb4be('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xb4be('0x2')](_0xb4be('0xf'),_0xb4be('0x10'),'onlyIfOpen'),'defaultValue':_0xb4be('0xf')},'dialAMDActive':{'type':Sequelize[_0xb4be('0x11')],'defaultValue':0x0,'comment':_0xb4be('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xb4be('0x4')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb4be('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xb4be('0x4')](0x9)[_0xb4be('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb4be('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb4be('0x4')](0x9)[_0xb4be('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb4be('0x4')](0x9)[_0xb4be('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb4be('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xb4be('0x4')](0x9)[_0xb4be('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb4be('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb4be('0x4')](0x9)[_0xb4be('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb4be('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb4be('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb4be('0x4')](0x5)[_0xb4be('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb4be('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb4be('0x4')](0x9)[_0xb4be('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb4be('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb4be('0x2')](_0xb4be('0x1a'),_0xb4be('0x1b')),'defaultValue':_0xb4be('0x1a')},'dialPrefix':{'type':Sequelize[_0xb4be('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb4be('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb4be('0x1c')},'dialCutDigit':{'type':Sequelize[_0xb4be('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb4be('0x1d')}};
\ No newline at end of file
index ce8cf4d..a1136ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9505=['filter','map','type','key','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','CampaignId\x20=\x20?','from','cm_hopper','onlyIfOpen','insert','CmListId','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','name','send','index','Campaign','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','add','day','merge'];(function(_0x251cbb,_0x6def1b){var _0x2293c5=function(_0x32f26d){while(--_0x32f26d){_0x251cbb['push'](_0x251cbb['shift']());}};_0x2293c5(++_0x6def1b);}(_0x9505,0x1e5));var _0x5950=function(_0x50a0f0,_0x45f145){_0x50a0f0=_0x50a0f0-0x0;var _0x3eb816=_0x9505[_0x50a0f0];return _0x3eb816;};'use strict';var pdf=require(_0x5950('0x0'));var emlformat=require(_0x5950('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5950('0x2'));var jsonpatch=require(_0x5950('0x3'));var rp=require(_0x5950('0x4'));var moment=require(_0x5950('0x5'));var BPromise=require(_0x5950('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5950('0x7'));var sox=require(_0x5950('0x8'));var csv=require(_0x5950('0x9'));var ejs=require(_0x5950('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5950('0xb'));var jsforce=require(_0x5950('0xc'));var deskjs=require(_0x5950('0xd'));var toCsv=require(_0x5950('0x9'));var querystring=require(_0x5950('0xe'));var Papa=require(_0x5950('0xf'));var Redis=require(_0x5950('0x10'));var qs=require(_0x5950('0x11'));var logger=require(_0x5950('0x12'))('api');var utils=require(_0x5950('0x13'));var config=require(_0x5950('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a6098,_0x2841ac){_0x2841ac=_0x2841ac||0xcc;return function(_0x1667b2){if(_0x1667b2){return _0x5a6098[_0x5950('0x15')](_0x2841ac);}return _0x5a6098[_0x5950('0x16')](_0x2841ac)[_0x5950('0x17')]();};}function respondWithResult(_0x2bf7ae,_0x17c263){_0x17c263=_0x17c263||0xc8;return function(_0x38d757){if(_0x38d757){return _0x2bf7ae[_0x5950('0x16')](_0x17c263)[_0x5950('0x18')](_0x38d757);}};}function respondWithFilteredResult(_0x40fe84,_0x3ace79){return function(_0xaed862){if(_0xaed862){var _0x3f1b9b=_0xaed862[_0x5950('0x19')],_0x5e9dd5=_0x3ace79[_0x5950('0x1a')],_0xa6c598=_0x3ace79[_0x5950('0x1a')]+_0x3ace79[_0x5950('0x1b')],_0x4ad4d8;if(_0xa6c598>=_0x3f1b9b){_0xa6c598=_0x3f1b9b;_0x4ad4d8=0xc8;}else{_0x4ad4d8=0xce;}_0x40fe84['status'](_0x4ad4d8);return _0x40fe84['set'](_0x5950('0x1c'),_0x5e9dd5+'-'+_0xa6c598+'/'+_0x3f1b9b)[_0x5950('0x18')](_0xaed862);}return null;};}function patchUpdates(_0x3a7821){return function(_0x5a9530){try{jsonpatch[_0x5950('0x1d')](_0x5a9530,_0x3a7821,!![]);}catch(_0x483aaf){return BPromise['reject'](_0x483aaf);}return _0x5a9530[_0x5950('0x1e')]();};}function saveUpdates(_0x2ada72,_0x1ad343){return function(_0x5bd90e){if(_0x5bd90e){return _0x5bd90e[_0x5950('0x1f')](_0x2ada72)[_0x5950('0x20')](function(_0x4aa0c2){return _0x4aa0c2;});}return null;};}function removeEntity(_0x521018,_0x53fdfe){return function(_0x4af433){if(_0x4af433){return _0x4af433[_0x5950('0x21')]()[_0x5950('0x20')](function(){var _0x66c416=_0x4af433[_0x5950('0x22')]({'plain':!![]});var _0x5e2c98=_0x5950('0x23');return db[_0x5950('0x24')][_0x5950('0x21')]({'where':{'type':_0x5e2c98,'resourceId':_0x66c416['id']}})[_0x5950('0x20')](function(){return _0x4af433;});})[_0x5950('0x20')](function(){_0x521018[_0x5950('0x16')](0xcc)[_0x5950('0x17')]();});}};}function handleEntityNotFound(_0x4b64a2,_0x4d9317){return function(_0x1b2265){if(!_0x1b2265){_0x4b64a2[_0x5950('0x15')](0x194);}return _0x1b2265;};}function handleError(_0x545354,_0xfa0238){_0xfa0238=_0xfa0238||0x1f4;return function(_0x128241){logger['error'](_0x128241['stack']);if(_0x128241['name']){delete _0x128241[_0x5950('0x25')];}_0x545354[_0x5950('0x16')](_0xfa0238)[_0x5950('0x26')](_0x128241);};}exports[_0x5950('0x27')]=function(_0x3923dd,_0x170084){var _0x2ff8a3={},_0x2dfd08={},_0x179b24={'count':0x0,'rows':[]};var _0x3a3cc0=db[_0x5950('0x28')][_0x5950('0x29')];_0x2dfd08[_0x5950('0x2a')]=_[_0x5950('0x2b')](_0x3a3cc0);var _0x1670ae={'dateStart':_0x3923dd[_0x5950('0x2c')][_0x5950('0x2d')],'dateEnd':_0x3923dd[_0x5950('0x2c')][_0x5950('0x2e')]};delete _0x3923dd[_0x5950('0x2c')][_0x5950('0x2d')];delete _0x3923dd[_0x5950('0x2c')][_0x5950('0x2e')];_0x2dfd08[_0x5950('0x2c')]=_[_0x5950('0x2b')](_0x3923dd[_0x5950('0x2c')]);_0x2dfd08[_0x5950('0x2f')]=_[_0x5950('0x30')](_0x2dfd08['model'],_0x2dfd08[_0x5950('0x2c')]);_0x2ff8a3[_0x5950('0x31')]=_[_0x5950('0x30')](_0x2dfd08[_0x5950('0x2a')],qs[_0x5950('0x32')](_0x3923dd['query']['fields']));_0x2ff8a3[_0x5950('0x31')]=_0x2ff8a3[_0x5950('0x31')]['length']?_0x2ff8a3[_0x5950('0x31')]:_0x2dfd08['model'];if(!_0x3923dd[_0x5950('0x2c')][_0x5950('0x33')](_0x5950('0x34'))){_0x2ff8a3['limit']=qs[_0x5950('0x1b')](_0x3923dd['query'][_0x5950('0x1b')]);_0x2ff8a3[_0x5950('0x1a')]=qs[_0x5950('0x1a')](_0x3923dd[_0x5950('0x2c')]['offset']);}_0x2ff8a3[_0x5950('0x35')]=qs[_0x5950('0x36')](_0x3923dd[_0x5950('0x2c')]['sort']);_0x2ff8a3[_0x5950('0x37')]=qs[_0x5950('0x2f')](_['pick'](_0x3923dd['query'],_0x2dfd08['filters']));if(_0x1670ae[_0x5950('0x2d')]){if(_0x1670ae[_0x5950('0x2e')]){_0x1670ae[_0x5950('0x2e')]=moment(_0x1670ae[_0x5950('0x2e')])[_0x5950('0x38')](0x1,'day');}else{_0x1670ae['dateEnd']=moment(_0x1670ae['dateStart'])['add'](0x1,_0x5950('0x39'));}_[_0x5950('0x3a')](_0x2ff8a3[_0x5950('0x37')],{'createdAt':{'$gte':_0x1670ae[_0x5950('0x2d')],'$lte':_0x1670ae['dateEnd']}});}if(_0x3923dd[_0x5950('0x2c')][_0x5950('0x3b')]){_0x2ff8a3['where']=_[_0x5950('0x3a')](_0x2ff8a3[_0x5950('0x37')],{'$or':_[_0x5950('0x3c')](_0x3a3cc0,function(_0x2c4bf3){if(_0x2c4bf3[_0x5950('0x3d')][_0x5950('0x3e')]!==_0x5950('0x3f')){var _0x48eba5={};_0x48eba5[_0x2c4bf3[_0x5950('0x40')]]={'$like':'%'+_0x3923dd['query'][_0x5950('0x3b')]+'%'};return _0x48eba5;}})});}_0x2ff8a3=_[_0x5950('0x3a')]({},_0x2ff8a3,_0x3923dd['options']);var _0x319fe5={'where':_0x2ff8a3[_0x5950('0x37')]};return db[_0x5950('0x28')][_0x5950('0x19')](_0x319fe5)['then'](function(_0x18d31f){_0x179b24[_0x5950('0x19')]=_0x18d31f;if(_0x3923dd[_0x5950('0x2c')][_0x5950('0x41')]){_0x2ff8a3['include']=[{'all':!![]}];}return db[_0x5950('0x28')][_0x5950('0x42')](_0x2ff8a3);})[_0x5950('0x20')](function(_0x514c85){_0x179b24[_0x5950('0x43')]=_0x514c85;return _0x179b24;})['then'](respondWithFilteredResult(_0x170084,_0x2ff8a3))[_0x5950('0x44')](handleError(_0x170084,null));};exports[_0x5950('0x45')]=function(_0xbfcd95,_0x1cca0e){var _0x391a01={'raw':![],'where':{'id':_0xbfcd95[_0x5950('0x46')]['id']}},_0x3d5094={};_0x3d5094['model']=_[_0x5950('0x2b')](db[_0x5950('0x28')][_0x5950('0x29')]);_0x3d5094[_0x5950('0x2c')]=_[_0x5950('0x2b')](_0xbfcd95['query']);_0x3d5094['filters']=_[_0x5950('0x30')](_0x3d5094[_0x5950('0x2a')],_0x3d5094[_0x5950('0x2c')]);_0x391a01['attributes']=_[_0x5950('0x30')](_0x3d5094[_0x5950('0x2a')],qs[_0x5950('0x32')](_0xbfcd95['query']['fields']));_0x391a01['attributes']=_0x391a01[_0x5950('0x31')][_0x5950('0x47')]?_0x391a01[_0x5950('0x31')]:_0x3d5094[_0x5950('0x2a')];if(_0xbfcd95[_0x5950('0x2c')][_0x5950('0x41')]){_0x391a01[_0x5950('0x48')]=[{'all':!![]}];}_0x391a01=_[_0x5950('0x3a')]({},_0x391a01,_0xbfcd95[_0x5950('0x49')]);return db['Campaign'][_0x5950('0x4a')](_0x391a01)[_0x5950('0x20')](handleEntityNotFound(_0x1cca0e,null))[_0x5950('0x20')](respondWithResult(_0x1cca0e,null))[_0x5950('0x44')](handleError(_0x1cca0e,null));};exports[_0x5950('0x4b')]=function(_0xf4c16b,_0x28e4c7){return db[_0x5950('0x28')][_0x5950('0x4b')](_0xf4c16b[_0x5950('0x4c')],{})['then'](function(_0x5aaa8){var _0x168829=_0xf4c16b[_0x5950('0x4d')][_0x5950('0x22')]({'plain':!![]});if(!_0x168829)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x168829['role']===_0x5950('0x4d')){var _0x3a596b=_0x5aaa8['get']({'plain':!![]});var _0x2aff57=_0x5950('0x23');return db[_0x5950('0x4e')][_0x5950('0x4a')]({'where':{'name':_0x2aff57,'userProfileId':_0x168829[_0x5950('0x4f')]},'raw':!![]})[_0x5950('0x20')](function(_0x4ed038){if(_0x4ed038&&_0x4ed038[_0x5950('0x50')]===0x0){return db[_0x5950('0x24')]['create']({'name':_0x3a596b[_0x5950('0x25')],'resourceId':_0x3a596b['id'],'type':_0x4ed038[_0x5950('0x25')],'sectionId':_0x4ed038['id']},{})[_0x5950('0x20')](function(){return _0x5aaa8;});}else{return _0x5aaa8;}})['catch'](function(_0x58b98a){logger[_0x5950('0x51')](_0x5950('0x52'),_0x58b98a);throw _0x58b98a;});}return _0x5aaa8;})[_0x5950('0x20')](respondWithResult(_0x28e4c7,0xc9))[_0x5950('0x44')](handleError(_0x28e4c7,null));};exports[_0x5950('0x53')]=function(_0xb71095,_0x2f824e){var _0xcad9ef={'raw':![],'where':{'id':_0xb71095[_0x5950('0x46')]['id']}},_0x4e34b4={};_0x4e34b4[_0x5950('0x2a')]=_[_0x5950('0x2b')](db[_0x5950('0x28')][_0x5950('0x29')]);_0xcad9ef[_0x5950('0x31')]=_[_0x5950('0x30')](_0x4e34b4['model'],qs[_0x5950('0x32')](_0xb71095['query'][_0x5950('0x32')]));_0xcad9ef['attributes']=_0xcad9ef[_0x5950('0x31')][_0x5950('0x47')]?_0xcad9ef['attributes']:_0x4e34b4[_0x5950('0x2a')];if(_0xb71095['query'][_0x5950('0x41')]){_0xcad9ef[_0x5950('0x48')]=[{'all':!![]}];}_0xcad9ef=_['merge']({},_0xcad9ef,_0xb71095['options']);return db[_0x5950('0x28')][_0x5950('0x4a')](_0xcad9ef)[_0x5950('0x20')](handleEntityNotFound(_0x2f824e,null))[_0x5950('0x20')](function(_0x3468cb){if(_0x3468cb){var _0x2ae261=_0x3468cb[_0x5950('0x22')]({'plain':!![]});_0x2ae261=qs[_0x5950('0x54')](_0x2ae261,['id','createdAt','updatedAt']);_0xb71095[_0x5950('0x4c')]=_['omit'](_0xb71095[_0x5950('0x4c')],['id',_0x5950('0x55'),_0x5950('0x56')]);return db[_0x5950('0x28')][_0x5950('0x4b')](_['merge'](_0x2ae261,_0xb71095[_0x5950('0x4c')]),{'include':_0xb71095[_0x5950('0x2c')][_0x5950('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x550078){var _0x3a658a=_0xb71095['user'][_0x5950('0x22')]({'plain':!![]});if(!_0x3a658a)throw new Error(_0x5950('0x57'));if(_0x3a658a['role']===_0x5950('0x4d')){var _0x1a2792=_0x550078[_0x5950('0x22')]({'plain':!![]});var _0x1740cd=_0x5950('0x23');return db[_0x5950('0x4e')]['find']({'where':{'name':_0x1740cd,'userProfileId':_0x3a658a[_0x5950('0x4f')]},'raw':!![]})[_0x5950('0x20')](function(_0x84770e){if(_0x84770e&&_0x84770e['autoAssociation']===0x0){return db['UserProfileResource'][_0x5950('0x4b')]({'name':_0x1a2792[_0x5950('0x25')],'resourceId':_0x1a2792['id'],'type':_0x84770e[_0x5950('0x25')],'sectionId':_0x84770e['id']},{})[_0x5950('0x20')](function(){return _0x550078;});}else{return _0x550078;}})[_0x5950('0x44')](function(_0x245738){logger['error'](_0x5950('0x52'),_0x245738);throw _0x245738;});}return _0x550078;});}})[_0x5950('0x20')](respondWithResult(_0x2f824e,0xc9))[_0x5950('0x44')](handleError(_0x2f824e,null));};exports[_0x5950('0x1f')]=function(_0x5f036e,_0x1a760a){if(_0x5f036e[_0x5950('0x4c')]['id']){delete _0x5f036e['body']['id'];}return db[_0x5950('0x28')]['find']({'where':{'id':_0x5f036e[_0x5950('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a760a,null))[_0x5950('0x20')](saveUpdates(_0x5f036e[_0x5950('0x4c')],null))['then'](respondWithResult(_0x1a760a,null))[_0x5950('0x44')](handleError(_0x1a760a,null));};exports[_0x5950('0x21')]=function(_0x2ed236,_0x5738b5){return db[_0x5950('0x28')][_0x5950('0x4a')]({'where':{'id':_0x2ed236[_0x5950('0x46')]['id']}})[_0x5950('0x20')](handleEntityNotFound(_0x5738b5,null))[_0x5950('0x20')](removeEntity(_0x5738b5,null))[_0x5950('0x44')](handleError(_0x5738b5,null));};exports[_0x5950('0x58')]=function(_0x192dbc,_0x58ba24,_0x4217e9){var _0x21529d={'raw':!![],'where':{}};var _0x44adf3={};var _0x3e8303={'count':0x0,'rows':[]};return db['Campaign'][_0x5950('0x59')]({'where':{'id':_0x192dbc[_0x5950('0x46')]['id']}})[_0x5950('0x20')](handleEntityNotFound(_0x58ba24,null))[_0x5950('0x20')](function(_0x5a7f13){if(_0x5a7f13){_0x44adf3['model']=_[_0x5950('0x2b')](db['CmHopper'][_0x5950('0x29')]);_0x44adf3[_0x5950('0x2c')]=_[_0x5950('0x2b')](_0x192dbc[_0x5950('0x2c')]);_0x44adf3[_0x5950('0x2f')]=_['intersection'](_0x44adf3[_0x5950('0x2a')],_0x44adf3[_0x5950('0x2c')]);_0x21529d['attributes']=_['intersection'](_0x44adf3[_0x5950('0x2a')],qs[_0x5950('0x32')](_0x192dbc[_0x5950('0x2c')][_0x5950('0x32')]));_0x21529d[_0x5950('0x31')]=_0x21529d['attributes'][_0x5950('0x47')]?_0x21529d[_0x5950('0x31')]:_0x44adf3[_0x5950('0x2a')];if(!_0x192dbc[_0x5950('0x2c')][_0x5950('0x33')](_0x5950('0x34'))){_0x21529d[_0x5950('0x1b')]=qs[_0x5950('0x1b')](_0x192dbc['query']['limit']);_0x21529d[_0x5950('0x1a')]=qs[_0x5950('0x1a')](_0x192dbc[_0x5950('0x2c')][_0x5950('0x1a')]);}_0x21529d[_0x5950('0x35')]=qs['sort'](_0x192dbc['query'][_0x5950('0x36')]);_0x21529d[_0x5950('0x37')]=qs['filters'](_[_0x5950('0x5a')](_0x192dbc[_0x5950('0x2c')],_0x44adf3[_0x5950('0x2f')]));_0x21529d[_0x5950('0x37')][_0x5950('0x5b')]=_0x5a7f13['id'];if(_0x192dbc['query'][_0x5950('0x3b')]){_0x21529d['where']=_['merge'](_0x21529d[_0x5950('0x37')],{'$or':_[_0x5950('0x3c')](_0x21529d[_0x5950('0x31')],function(_0x51c557){var _0x26b518={};_0x26b518[_0x51c557]={'$like':'%'+_0x192dbc[_0x5950('0x2c')][_0x5950('0x3b')]+'%'};return _0x26b518;})});}_0x21529d=_['merge']({},_0x21529d,_0x192dbc[_0x5950('0x49')]);return db[_0x5950('0x5c')][_0x5950('0x19')]({'where':_0x21529d[_0x5950('0x37')]})[_0x5950('0x20')](function(_0x1ed845){_0x3e8303[_0x5950('0x19')]=_0x1ed845;if(_0x192dbc[_0x5950('0x2c')]['includeAll']){_0x21529d[_0x5950('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0x5950('0x42')](_0x21529d);})[_0x5950('0x20')](function(_0x3c100d){_0x3e8303[_0x5950('0x43')]=_0x3c100d;return _0x3e8303;});}})[_0x5950('0x20')](respondWithFilteredResult(_0x58ba24,_0x21529d))[_0x5950('0x44')](handleError(_0x58ba24,null));};exports[_0x5950('0x5d')]=function(_0x56282a,_0x4796bf,_0x705afc){var _0x305172={'raw':!![],'where':{}};var _0x46d974={};var _0x4942d2={'count':0x0,'rows':[]};return db[_0x5950('0x28')][_0x5950('0x59')]({'where':{'id':_0x56282a['params']['id']}})['then'](handleEntityNotFound(_0x4796bf,null))[_0x5950('0x20')](function(_0x39189a){if(_0x39189a){_0x46d974[_0x5950('0x2a')]=_[_0x5950('0x2b')](db[_0x5950('0x5e')]['rawAttributes']);_0x46d974['query']=_[_0x5950('0x2b')](_0x56282a['query']);_0x46d974[_0x5950('0x2f')]=_['intersection'](_0x46d974['model'],_0x46d974[_0x5950('0x2c')]);_0x305172['attributes']=_[_0x5950('0x30')](_0x46d974['model'],qs[_0x5950('0x32')](_0x56282a['query'][_0x5950('0x32')]));_0x305172[_0x5950('0x31')]=_0x305172[_0x5950('0x31')][_0x5950('0x47')]?_0x305172['attributes']:_0x46d974[_0x5950('0x2a')];if(!_0x56282a[_0x5950('0x2c')]['hasOwnProperty'](_0x5950('0x34'))){_0x305172['limit']=qs[_0x5950('0x1b')](_0x56282a[_0x5950('0x2c')]['limit']);_0x305172[_0x5950('0x1a')]=qs['offset'](_0x56282a['query']['offset']);}_0x305172[_0x5950('0x35')]=qs[_0x5950('0x36')](_0x56282a[_0x5950('0x2c')][_0x5950('0x36')]);_0x305172[_0x5950('0x37')]=qs[_0x5950('0x2f')](_['pick'](_0x56282a['query'],_0x46d974[_0x5950('0x2f')]));_0x305172['where'][_0x5950('0x5b')]=_0x39189a['id'];if(_0x56282a['query'][_0x5950('0x3b')]){_0x305172[_0x5950('0x37')]=_[_0x5950('0x3a')](_0x305172['where'],{'$or':_[_0x5950('0x3c')](_0x305172[_0x5950('0x31')],function(_0x15534a){var _0x4ae727={};_0x4ae727[_0x15534a]={'$like':'%'+_0x56282a[_0x5950('0x2c')]['filter']+'%'};return _0x4ae727;})});}_0x305172=_[_0x5950('0x3a')]({},_0x305172,_0x56282a[_0x5950('0x49')]);return db[_0x5950('0x5e')][_0x5950('0x19')]({'where':_0x305172['where']})['then'](function(_0x2045f7){_0x4942d2[_0x5950('0x19')]=_0x2045f7;if(_0x56282a[_0x5950('0x2c')][_0x5950('0x41')]){_0x305172[_0x5950('0x48')]=[{'all':!![]}];}return db[_0x5950('0x5e')]['findAll'](_0x305172);})['then'](function(_0x24a802){_0x4942d2[_0x5950('0x43')]=_0x24a802;return _0x4942d2;});}})['then'](respondWithFilteredResult(_0x4796bf,_0x305172))[_0x5950('0x44')](handleError(_0x4796bf,null));};exports[_0x5950('0x5f')]=function(_0x38ffea,_0x36c841,_0xc5de0d){var _0x1015a0={'raw':!![],'where':{}};var _0x2ac5c4={};var _0x15ff36={'count':0x0,'rows':[]};return db['Campaign'][_0x5950('0x59')]({'where':{'id':_0x38ffea[_0x5950('0x46')]['id']}})['then'](handleEntityNotFound(_0x36c841,null))['then'](function(_0x24f8c4){if(_0x24f8c4){_0x2ac5c4['model']=_[_0x5950('0x2b')](db[_0x5950('0x60')][_0x5950('0x29')]);_0x2ac5c4[_0x5950('0x2c')]=_['keys'](_0x38ffea[_0x5950('0x2c')]);_0x2ac5c4[_0x5950('0x2f')]=_['intersection'](_0x2ac5c4[_0x5950('0x2a')],_0x2ac5c4[_0x5950('0x2c')]);_0x1015a0['attributes']=_['intersection'](_0x2ac5c4[_0x5950('0x2a')],qs[_0x5950('0x32')](_0x38ffea[_0x5950('0x2c')][_0x5950('0x32')]));_0x1015a0['attributes']=_0x1015a0[_0x5950('0x31')]['length']?_0x1015a0[_0x5950('0x31')]:_0x2ac5c4['model'];if(!_0x38ffea[_0x5950('0x2c')]['hasOwnProperty'](_0x5950('0x34'))){_0x1015a0[_0x5950('0x1b')]=qs[_0x5950('0x1b')](_0x38ffea[_0x5950('0x2c')][_0x5950('0x1b')]);_0x1015a0['offset']=qs[_0x5950('0x1a')](_0x38ffea['query'][_0x5950('0x1a')]);}_0x1015a0[_0x5950('0x35')]=qs[_0x5950('0x36')](_0x38ffea[_0x5950('0x2c')][_0x5950('0x36')]);_0x1015a0[_0x5950('0x37')]=qs[_0x5950('0x2f')](_[_0x5950('0x5a')](_0x38ffea[_0x5950('0x2c')],_0x2ac5c4['filters']));_0x1015a0[_0x5950('0x37')][_0x5950('0x5b')]=_0x24f8c4['id'];if(_0x38ffea['query']['filter']){_0x1015a0['where']=_[_0x5950('0x3a')](_0x1015a0[_0x5950('0x37')],{'$or':_[_0x5950('0x3c')](_0x1015a0[_0x5950('0x31')],function(_0x586d5d){var _0x4e8fec={};_0x4e8fec[_0x586d5d]={'$like':'%'+_0x38ffea['query'][_0x5950('0x3b')]+'%'};return _0x4e8fec;})});}_0x1015a0=_['merge']({},_0x1015a0,_0x38ffea['options']);return db[_0x5950('0x60')][_0x5950('0x19')]({'where':_0x1015a0[_0x5950('0x37')]})['then'](function(_0x1c91b9){_0x15ff36[_0x5950('0x19')]=_0x1c91b9;if(_0x38ffea['query'][_0x5950('0x41')]){_0x1015a0[_0x5950('0x48')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x5950('0x42')](_0x1015a0);})['then'](function(_0x1b9dcd){_0x15ff36[_0x5950('0x43')]=_0x1b9dcd;return _0x15ff36;});}})[_0x5950('0x20')](respondWithFilteredResult(_0x36c841,_0x1015a0))[_0x5950('0x44')](handleError(_0x36c841,null));};exports[_0x5950('0x61')]=function(_0x44ab55,_0xa17433,_0x4e1270){var _0x1f1faa={'raw':!![],'where':{}};var _0x1d5122={};var _0x5aeb0c={'count':0x0,'rows':[]};return db[_0x5950('0x28')][_0x5950('0x59')]({'where':{'id':_0x44ab55[_0x5950('0x46')]['id']}})[_0x5950('0x20')](handleEntityNotFound(_0xa17433,null))['then'](function(_0xf3ce8a){if(_0xf3ce8a){_0x1d5122[_0x5950('0x2a')]=_[_0x5950('0x2b')](db[_0x5950('0x62')][_0x5950('0x29')]);_0x1d5122[_0x5950('0x2c')]=_[_0x5950('0x2b')](_0x44ab55[_0x5950('0x2c')]);_0x1d5122[_0x5950('0x2f')]=_[_0x5950('0x30')](_0x1d5122[_0x5950('0x2a')],_0x1d5122[_0x5950('0x2c')]);_0x1f1faa['attributes']=_[_0x5950('0x30')](_0x1d5122[_0x5950('0x2a')],qs[_0x5950('0x32')](_0x44ab55[_0x5950('0x2c')][_0x5950('0x32')]));_0x1f1faa[_0x5950('0x31')]=_0x1f1faa[_0x5950('0x31')][_0x5950('0x47')]?_0x1f1faa[_0x5950('0x31')]:_0x1d5122[_0x5950('0x2a')];if(!_0x44ab55[_0x5950('0x2c')][_0x5950('0x33')]('nolimit')){_0x1f1faa[_0x5950('0x1b')]=qs[_0x5950('0x1b')](_0x44ab55[_0x5950('0x2c')][_0x5950('0x1b')]);_0x1f1faa[_0x5950('0x1a')]=qs[_0x5950('0x1a')](_0x44ab55[_0x5950('0x2c')][_0x5950('0x1a')]);}_0x1f1faa[_0x5950('0x35')]=qs['sort'](_0x44ab55[_0x5950('0x2c')][_0x5950('0x36')]);_0x1f1faa[_0x5950('0x37')]=qs[_0x5950('0x2f')](_[_0x5950('0x5a')](_0x44ab55['query'],_0x1d5122[_0x5950('0x2f')]));_0x1f1faa[_0x5950('0x37')][_0x5950('0x5b')]=_0xf3ce8a['id'];if(_0x44ab55['query']['filter']){_0x1f1faa['where']=_[_0x5950('0x3a')](_0x1f1faa['where'],{'$or':_[_0x5950('0x3c')](_0x1f1faa[_0x5950('0x31')],function(_0x3ca708){var _0x9468fd={};_0x9468fd[_0x3ca708]={'$like':'%'+_0x44ab55['query'][_0x5950('0x3b')]+'%'};return _0x9468fd;})});}_0x1f1faa=_[_0x5950('0x3a')]({},_0x1f1faa,_0x44ab55[_0x5950('0x49')]);return db[_0x5950('0x62')]['count']({'where':_0x1f1faa[_0x5950('0x37')]})[_0x5950('0x20')](function(_0xeddce5){_0x5aeb0c[_0x5950('0x19')]=_0xeddce5;if(_0x44ab55[_0x5950('0x2c')][_0x5950('0x41')]){_0x1f1faa['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x5950('0x42')](_0x1f1faa);})[_0x5950('0x20')](function(_0xbf168f){_0x5aeb0c['rows']=_0xbf168f;return _0x5aeb0c;});}})['then'](respondWithFilteredResult(_0xa17433,_0x1f1faa))['catch'](handleError(_0xa17433,null));};exports[_0x5950('0x63')]=function(_0x31a32e,_0x34ebf4,_0x4810c5){var _0x126230={};var _0x27c627={};var _0x5578a0;var _0x17419f;return db[_0x5950('0x28')][_0x5950('0x59')]({'where':{'id':_0x31a32e[_0x5950('0x46')]['id']}})['then'](handleEntityNotFound(_0x34ebf4,null))['then'](function(_0x105270){if(_0x105270){_0x5578a0=_0x105270;_0x27c627[_0x5950('0x2a')]=_[_0x5950('0x2b')](db['CmList']['rawAttributes']);_0x27c627[_0x5950('0x2c')]=_[_0x5950('0x2b')](_0x31a32e[_0x5950('0x2c')]);_0x27c627['filters']=_[_0x5950('0x30')](_0x27c627[_0x5950('0x2a')],_0x27c627['query']);_0x126230['attributes']=_[_0x5950('0x30')](_0x27c627[_0x5950('0x2a')],qs[_0x5950('0x32')](_0x31a32e[_0x5950('0x2c')][_0x5950('0x32')]));_0x126230[_0x5950('0x31')]=_0x126230[_0x5950('0x31')][_0x5950('0x47')]?_0x126230[_0x5950('0x31')]:_0x27c627[_0x5950('0x2a')];_0x126230[_0x5950('0x35')]=qs[_0x5950('0x36')](_0x31a32e[_0x5950('0x2c')][_0x5950('0x36')]);_0x126230[_0x5950('0x37')]=qs[_0x5950('0x2f')](_[_0x5950('0x5a')](_0x31a32e[_0x5950('0x2c')],_0x27c627[_0x5950('0x2f')]));if(_0x31a32e['query'][_0x5950('0x3b')]){_0x126230[_0x5950('0x37')]=_[_0x5950('0x3a')](_0x126230[_0x5950('0x37')],{'$or':_[_0x5950('0x3c')](_0x126230[_0x5950('0x31')],function(_0x352255){var _0x1e2c08={};_0x1e2c08[_0x352255]={'$like':'%'+_0x31a32e['query']['filter']+'%'};return _0x1e2c08;})});}_0x126230=_[_0x5950('0x3a')]({},_0x126230,_0x31a32e['options']);return _0x5578a0[_0x5950('0x63')](_0x126230);}})[_0x5950('0x20')](function(_0x1cf0cd){if(_0x1cf0cd){_0x17419f=_0x1cf0cd[_0x5950('0x47')];if(!_0x31a32e[_0x5950('0x2c')][_0x5950('0x33')](_0x5950('0x34'))){_0x126230[_0x5950('0x1b')]=qs[_0x5950('0x1b')](_0x31a32e[_0x5950('0x2c')][_0x5950('0x1b')]);_0x126230[_0x5950('0x1a')]=qs[_0x5950('0x1a')](_0x31a32e['query'][_0x5950('0x1a')]);}return _0x5578a0[_0x5950('0x63')](_0x126230);}})[_0x5950('0x20')](function(_0x2f5f1d){if(_0x2f5f1d){return _0x2f5f1d?{'count':_0x17419f,'rows':_0x2f5f1d}:null;}})['then'](respondWithResult(_0x34ebf4,null))[_0x5950('0x44')](handleError(_0x34ebf4,null));};exports[_0x5950('0x64')]=function(_0x1de1bf,_0x318ebb,_0x4b0609){var _0x4ab97e,_0x388222;return db[_0x5950('0x28')][_0x5950('0x4a')]({'where':{'id':_0x1de1bf[_0x5950('0x46')]['id']}})[_0x5950('0x20')](handleEntityNotFound(_0x318ebb,null))[_0x5950('0x20')](function(_0x313630){if(_0x313630){_0x388222=_0x313630;return _0x313630[_0x5950('0x64')](_0x1de1bf[_0x5950('0x4c')][_0x5950('0x65')],_[_0x5950('0x54')](_0x1de1bf[_0x5950('0x4c')],[_0x5950('0x65'),'id'])||{});}return null;})['spread'](function(_0x8181f7){var _0x27f990;_0x4ab97e=_0x8181f7||[];var _0xbacda6=[];if(_0x8181f7){for(var _0x39aaa0=0x0;_0x39aaa0<_0x8181f7[_0x5950('0x47')];_0x39aaa0+=0x1){var _0x388437=_0x8181f7[_0x39aaa0][_0x5950('0x22')]({'plain':!![]});_0x388222[_0x5950('0x66')]=_0x1de1bf[_0x5950('0x4c')]['dialCheckDuplicateType']?_0x1de1bf[_0x5950('0x4c')][_0x5950('0x66')]:_0x388222[_0x5950('0x66')];switch(_0x388222[_0x5950('0x66')]){case _0x5950('0x67'):_0x27f990=squel['insert']()[_0x5950('0x68')]('cm_hopper')[_0x5950('0x69')]([_0x5950('0x6a'),_0x5950('0x6b'),_0x5950('0x6c'),_0x5950('0x6d'),'CampaignId','createdAt',_0x5950('0x56')],squel[_0x5950('0x6e')]()[_0x5950('0x40')](_0x5950('0x6a'),_0x5950('0x6a'))[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x6b'))[_0x5950('0x40')]('id',_0x5950('0x6c'))[_0x5950('0x40')](_0x388437['CmListId'][_0x5950('0x70')](),_0x5950('0x6d'))['field'](_0x1de1bf['params']['id'][_0x5950('0x70')](),_0x5950('0x5b'))[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x55'))[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x56'))['from'](_0x5950('0x71'))[_0x5950('0x37')](_0x5950('0x72'))[_0x5950('0x37')](_0x5950('0x73'),_0x388437['CmListId'][_0x5950('0x70')]())['where'](_0x5950('0x74'))['where'](_0x5950('0x75'),squel[_0x5950('0x6e')]()[_0x5950('0x40')](_0x5950('0x76'))['from'](_0x5950('0x77'))[_0x5950('0x37')](_0x5950('0x78'),_0x1de1bf[_0x5950('0x46')]['id'][_0x5950('0x70')]()))[_0x5950('0x37')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5950('0x6a'))[_0x5950('0x79')](_0x5950('0x7a'))[_0x5950('0x37')]('CampaignId\x20=\x20?',_0x1de1bf[_0x5950('0x46')]['id']['toString']())))[_0x5950('0x70')]();break;case _0x5950('0x7b'):_0x27f990=squel[_0x5950('0x7c')]()[_0x5950('0x68')](_0x5950('0x7a'))[_0x5950('0x69')]([_0x5950('0x6a'),_0x5950('0x6b'),_0x5950('0x6c'),'ListId',_0x5950('0x5b'),_0x5950('0x55'),_0x5950('0x56')],squel[_0x5950('0x6e')]()['field'](_0x5950('0x6a'),_0x5950('0x6a'))[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x6b'))['field']('id','ContactId')[_0x5950('0x40')](_0x388437[_0x5950('0x7d')]['toString'](),'ListId')[_0x5950('0x40')](_0x1de1bf[_0x5950('0x46')]['id'][_0x5950('0x70')](),'CampaignId')[_0x5950('0x40')]('NOW()',_0x5950('0x55'))['field'](_0x5950('0x6f'),'updatedAt')[_0x5950('0x79')]('cm_contacts')['where'](_0x5950('0x72'))[_0x5950('0x37')]('ListId\x20=\x20?',_0x388437['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x5950('0x37')](_0x5950('0x75'),squel[_0x5950('0x6e')]()['field']('phone')[_0x5950('0x79')]('cm_hopper')[_0x5950('0x37')](_0x5950('0x78'),_0x1de1bf[_0x5950('0x46')]['id']['toString']())))[_0x5950('0x70')]();break;default:_0x27f990=squel[_0x5950('0x7c')]()[_0x5950('0x68')](_0x5950('0x7a'))[_0x5950('0x69')]([_0x5950('0x6a'),_0x5950('0x6b'),_0x5950('0x6c'),'ListId',_0x5950('0x5b'),_0x5950('0x55'),_0x5950('0x56')],squel[_0x5950('0x6e')]()[_0x5950('0x40')](_0x5950('0x6a'),'phone')[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x6b'))[_0x5950('0x40')]('id',_0x5950('0x6c'))[_0x5950('0x40')](_0x388437['CmListId'][_0x5950('0x70')](),_0x5950('0x6d'))[_0x5950('0x40')](_0x1de1bf[_0x5950('0x46')]['id'][_0x5950('0x70')](),_0x5950('0x5b'))[_0x5950('0x40')]('NOW()',_0x5950('0x55'))[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x56'))[_0x5950('0x79')]('cm_contacts')[_0x5950('0x37')]('deletedAt\x20IS\x20NULL')[_0x5950('0x37')](_0x5950('0x73'),_0x388437['CmListId'][_0x5950('0x70')]())[_0x5950('0x37')](_0x5950('0x74')))[_0x5950('0x70')]();}_0xbacda6[_0x5950('0x7e')](db[_0x5950('0x7f')][_0x5950('0x2c')](_0x27f990));}return BPromise[_0x5950('0x80')](_0xbacda6);}})[_0x5950('0x20')](function(){return _0x4ab97e;})['then'](respondWithResult(_0x318ebb,null))[_0x5950('0x44')](handleError(_0x318ebb,null));};exports[_0x5950('0x81')]=function(_0x2f52bd,_0x2f0a1e,_0x205abb){var _0x52e7e6;return db['Campaign'][_0x5950('0x4a')]({'where':{'id':_0x2f52bd[_0x5950('0x46')]['id']}})[_0x5950('0x20')](handleEntityNotFound(_0x2f0a1e,null))[_0x5950('0x20')](function(_0x4114c0){if(_0x4114c0){return _0x4114c0[_0x5950('0x81')](_0x2f52bd[_0x5950('0x2c')][_0x5950('0x65')]);}})[_0x5950('0x20')](function(_0x3849e4){if(_0x3849e4){_0x52e7e6=_0x3849e4;return db[_0x5950('0x5c')][_0x5950('0x21')]({'where':{'ListId':_0x2f52bd['query']['ids'],'CampaignId':_0x2f52bd[_0x5950('0x46')]['id']}})[_0x5950('0x20')](function(){return _0x52e7e6;});}})['then'](respondWithStatusCode(_0x2f0a1e,null))[_0x5950('0x44')](handleError(_0x2f0a1e,null));};exports[_0x5950('0x82')]=function(_0x8ee4aa,_0x412bed,_0x31320e){var _0x354f6e={'raw':!![],'where':{}};var _0x4c43ed={};var _0xf9ce4a={'count':0x0,'rows':[]};return db[_0x5950('0x28')][_0x5950('0x59')]({'where':{'id':_0x8ee4aa[_0x5950('0x46')]['id']}})[_0x5950('0x20')](handleEntityNotFound(_0x412bed,null))[_0x5950('0x20')](function(_0x4e21c8){if(_0x4e21c8){_0x4c43ed['model']=_[_0x5950('0x2b')](db[_0x5950('0x83')]['rawAttributes']);_0x4c43ed[_0x5950('0x2c')]=_[_0x5950('0x2b')](_0x8ee4aa[_0x5950('0x2c')]);_0x4c43ed[_0x5950('0x2f')]=_[_0x5950('0x30')](_0x4c43ed[_0x5950('0x2a')],_0x4c43ed[_0x5950('0x2c')]);_0x354f6e[_0x5950('0x31')]=_[_0x5950('0x30')](_0x4c43ed['model'],qs[_0x5950('0x32')](_0x8ee4aa[_0x5950('0x2c')][_0x5950('0x32')]));_0x354f6e[_0x5950('0x31')]=_0x354f6e[_0x5950('0x31')][_0x5950('0x47')]?_0x354f6e['attributes']:_0x4c43ed[_0x5950('0x2a')];if(!_0x8ee4aa[_0x5950('0x2c')][_0x5950('0x33')]('nolimit')){_0x354f6e[_0x5950('0x1b')]=qs[_0x5950('0x1b')](_0x8ee4aa[_0x5950('0x2c')]['limit']);_0x354f6e[_0x5950('0x1a')]=qs[_0x5950('0x1a')](_0x8ee4aa['query'][_0x5950('0x1a')]);}_0x354f6e[_0x5950('0x35')]=qs[_0x5950('0x36')](_0x8ee4aa[_0x5950('0x2c')][_0x5950('0x36')]);_0x354f6e[_0x5950('0x37')]=qs[_0x5950('0x2f')](_['pick'](_0x8ee4aa[_0x5950('0x2c')],_0x4c43ed[_0x5950('0x2f')]));_0x354f6e[_0x5950('0x37')][_0x5950('0x5b')]=_0x4e21c8['id'];if(_0x8ee4aa[_0x5950('0x2c')][_0x5950('0x3b')]){_0x354f6e[_0x5950('0x37')]=_[_0x5950('0x3a')](_0x354f6e['where'],{'$or':_['map'](_0x354f6e['attributes'],function(_0x17ec98){var _0x179229={};_0x179229[_0x17ec98]={'$like':'%'+_0x8ee4aa['query'][_0x5950('0x3b')]+'%'};return _0x179229;})});}_0x354f6e=_[_0x5950('0x3a')]({},_0x354f6e,_0x8ee4aa[_0x5950('0x49')]);return db[_0x5950('0x83')][_0x5950('0x19')]({'where':_0x354f6e[_0x5950('0x37')]})[_0x5950('0x20')](function(_0x1a8e8a){_0xf9ce4a[_0x5950('0x19')]=_0x1a8e8a;if(_0x8ee4aa[_0x5950('0x2c')]['includeAll']){_0x354f6e['include']=[{'all':!![]}];}return db[_0x5950('0x83')][_0x5950('0x42')](_0x354f6e);})['then'](function(_0x7bab23){_0xf9ce4a[_0x5950('0x43')]=_0x7bab23;return _0xf9ce4a;});}})[_0x5950('0x20')](respondWithFilteredResult(_0x412bed,_0x354f6e))[_0x5950('0x44')](handleError(_0x412bed,null));};exports[_0x5950('0x84')]=function(_0x201116,_0x3fe6e1,_0xcfd5d3){var _0x4ddf72,_0xfbef9a;return db[_0x5950('0x28')][_0x5950('0x4a')]({'where':{'id':_0x201116['params']['id']}})[_0x5950('0x20')](handleEntityNotFound(_0x3fe6e1,null))[_0x5950('0x20')](function(_0x57c4e6){if(_0x57c4e6){_0xfbef9a=_0x57c4e6;return _0x57c4e6[_0x5950('0x84')](_0x201116['body'][_0x5950('0x65')],_['omit'](_0x201116['body'],['ids','id'])||{});}return null;})[_0x5950('0x85')](function(_0x20b13a){var _0x4505c2;_0x4ddf72=_0x20b13a||[];var _0x510688=[];if(_0x20b13a){for(var _0x550503=0x0;_0x550503<_0x20b13a[_0x5950('0x47')];_0x550503+=0x1){var _0x572e53=_0x20b13a[_0x550503][_0x5950('0x22')]({'plain':!![]});_0x4505c2=squel[_0x5950('0x7c')]()['into'](_0x5950('0x86'))[_0x5950('0x69')](['phone',_0x5950('0x6c'),_0x5950('0x6d'),_0x5950('0x5b'),_0x5950('0x55'),_0x5950('0x56')],squel[_0x5950('0x6e')]()[_0x5950('0x40')](_0x5950('0x6a'),_0x5950('0x6a'))['field']('id',_0x5950('0x6c'))[_0x5950('0x40')](_0x572e53['CmListId']['toString'](),'ListId')[_0x5950('0x40')](_0x201116[_0x5950('0x46')]['id'][_0x5950('0x70')](),'CampaignId')[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x55'))[_0x5950('0x40')](_0x5950('0x6f'),_0x5950('0x56'))[_0x5950('0x79')](_0x5950('0x71'))[_0x5950('0x37')](_0x5950('0x72'))[_0x5950('0x37')]('ListId\x20=\x20?',_0x572e53[_0x5950('0x7d')]['toString']())[_0x5950('0x37')](_0x5950('0x74')))[_0x5950('0x70')]();_0x510688[_0x5950('0x7e')](db['sequelize']['query'](_0x4505c2));}return BPromise[_0x5950('0x80')](_0x510688);}})[_0x5950('0x20')](function(){return _0x4ddf72;})[_0x5950('0x20')](respondWithResult(_0x3fe6e1,null))[_0x5950('0x44')](handleError(_0x3fe6e1,null));};exports[_0x5950('0x87')]=function(_0x1e8f61,_0xf9daa1,_0x550ef1){var _0x377533;return db[_0x5950('0x28')][_0x5950('0x4a')]({'where':{'id':_0x1e8f61['params']['id']}})[_0x5950('0x20')](handleEntityNotFound(_0xf9daa1,null))[_0x5950('0x20')](function(_0xc03b28){if(_0xc03b28){return _0xc03b28[_0x5950('0x87')](_0x1e8f61[_0x5950('0x2c')][_0x5950('0x65')]);}})[_0x5950('0x20')](function(_0x1dcfe3){if(_0x1dcfe3){_0x377533=_0x1dcfe3;return db[_0x5950('0x62')][_0x5950('0x21')]({'where':{'ListId':_0x1e8f61[_0x5950('0x2c')][_0x5950('0x65')],'CampaignId':_0x1e8f61[_0x5950('0x46')]['id']}})[_0x5950('0x20')](function(){return _0x377533;});}})[_0x5950('0x20')](respondWithStatusCode(_0xf9daa1,null))['catch'](handleError(_0xf9daa1,null));};
\ No newline at end of file
+var _0xabce=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','then','error','stack','name','send','Campaign','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','nolimit','offset','order','sort','where','day','add','merge','filter','type','key','field','include','findAll','rows','length','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','createdAt','omit','body','updatedAt','role','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','filters','map','getHopperHistories','CmHopperHistory','pick','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','phone','scheduledAt','select','ContactId','CmListId','toString','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','onlyIfOpen','insert','into','fromQuery','ListId','cm_contacts','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','desk.js'];(function(_0x44e5a1,_0x36ca22){var _0x214b0=function(_0x3e3f5d){while(--_0x3e3f5d){_0x44e5a1['push'](_0x44e5a1['shift']());}};_0x214b0(++_0x36ca22);}(_0xabce,0x103));var _0xeabc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xabce[_0xdc37a1];return _0x99b4fe;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var qs=require(_0xeabc('0x10'));var logger=require(_0xeabc('0x11'))(_0xeabc('0x12'));var utils=require(_0xeabc('0x13'));var config=require(_0xeabc('0x14'));var db=require(_0xeabc('0x15'))['db'];function respondWithStatusCode(_0xf0d9c0,_0x7be90){_0x7be90=_0x7be90||0xcc;return function(_0x1c7eb0){if(_0x1c7eb0){return _0xf0d9c0[_0xeabc('0x16')](_0x7be90);}return _0xf0d9c0[_0xeabc('0x17')](_0x7be90)[_0xeabc('0x18')]();};}function respondWithResult(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xc8;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x17')](_0x53df9c)[_0xeabc('0x19')](_0x235c2d);}};}function respondWithFilteredResult(_0x55f0de,_0x5f4ee8){return function(_0x3170ea){if(_0x3170ea){var _0x3ae954=_0x3170ea[_0xeabc('0x1a')],_0x326bac=_0x5f4ee8['offset'],_0x53d5cb=_0x5f4ee8['offset']+_0x5f4ee8[_0xeabc('0x1b')],_0xf913d7;if(_0x53d5cb>=_0x3ae954){_0x53d5cb=_0x3ae954;_0xf913d7=0xc8;}else{_0xf913d7=0xce;}_0x55f0de['status'](_0xf913d7);return _0x55f0de[_0xeabc('0x1c')](_0xeabc('0x1d'),_0x326bac+'-'+_0x53d5cb+'/'+_0x3ae954)[_0xeabc('0x19')](_0x3170ea);}return null;};}function patchUpdates(_0x16f08b){return function(_0x31dd53){try{jsonpatch[_0xeabc('0x1e')](_0x31dd53,_0x16f08b,!![]);}catch(_0x384be5){return BPromise[_0xeabc('0x1f')](_0x384be5);}return _0x31dd53['save']();};}function saveUpdates(_0x1253e4,_0x4d68ea){return function(_0x31201a){if(_0x31201a){return _0x31201a[_0xeabc('0x20')](_0x1253e4)['then'](function(_0x28063a){return _0x28063a;});}return null;};}function removeEntity(_0x41d67a,_0x254590){return function(_0x184e60){if(_0x184e60){return _0x184e60[_0xeabc('0x21')]()['then'](function(){var _0xecdbf=_0x184e60[_0xeabc('0x22')]({'plain':!![]});var _0x91ab00='IvrCampaigns';return db[_0xeabc('0x23')][_0xeabc('0x21')]({'where':{'type':_0x91ab00,'resourceId':_0xecdbf['id']}})[_0xeabc('0x24')](function(){return _0x184e60;});})[_0xeabc('0x24')](function(){_0x41d67a['status'](0xcc)[_0xeabc('0x18')]();});}};}function handleEntityNotFound(_0x480440,_0x27dbaf){return function(_0x4d4e29){if(!_0x4d4e29){_0x480440[_0xeabc('0x16')](0x194);}return _0x4d4e29;};}function handleError(_0x12acbd,_0x269621){_0x269621=_0x269621||0x1f4;return function(_0x3f194e){logger[_0xeabc('0x25')](_0x3f194e[_0xeabc('0x26')]);if(_0x3f194e[_0xeabc('0x27')]){delete _0x3f194e['name'];}_0x12acbd['status'](_0x269621)[_0xeabc('0x28')](_0x3f194e);};}exports['index']=function(_0x3c1b5b,_0x2b342c){var _0x48fb52={},_0x2163e6={},_0x38572d={'count':0x0,'rows':[]};var _0x2b568f=db[_0xeabc('0x29')][_0xeabc('0x2a')];_0x2163e6[_0xeabc('0x2b')]=_[_0xeabc('0x2c')](_0x2b568f);var _0x38dc0a={'dateStart':_0x3c1b5b[_0xeabc('0x2d')]['dateStart'],'dateEnd':_0x3c1b5b[_0xeabc('0x2d')]['dateEnd']};delete _0x3c1b5b[_0xeabc('0x2d')][_0xeabc('0x2e')];delete _0x3c1b5b[_0xeabc('0x2d')][_0xeabc('0x2f')];_0x2163e6[_0xeabc('0x2d')]=_[_0xeabc('0x2c')](_0x3c1b5b[_0xeabc('0x2d')]);_0x2163e6['filters']=_[_0xeabc('0x30')](_0x2163e6[_0xeabc('0x2b')],_0x2163e6[_0xeabc('0x2d')]);_0x48fb52['attributes']=_[_0xeabc('0x30')](_0x2163e6[_0xeabc('0x2b')],qs[_0xeabc('0x31')](_0x3c1b5b['query'][_0xeabc('0x31')]));_0x48fb52[_0xeabc('0x32')]=_0x48fb52[_0xeabc('0x32')]['length']?_0x48fb52[_0xeabc('0x32')]:_0x2163e6[_0xeabc('0x2b')];if(!_0x3c1b5b['query']['hasOwnProperty'](_0xeabc('0x33'))){_0x48fb52[_0xeabc('0x1b')]=qs['limit'](_0x3c1b5b[_0xeabc('0x2d')][_0xeabc('0x1b')]);_0x48fb52[_0xeabc('0x34')]=qs[_0xeabc('0x34')](_0x3c1b5b[_0xeabc('0x2d')]['offset']);}_0x48fb52[_0xeabc('0x35')]=qs['sort'](_0x3c1b5b[_0xeabc('0x2d')][_0xeabc('0x36')]);_0x48fb52[_0xeabc('0x37')]=qs['filters'](_['pick'](_0x3c1b5b[_0xeabc('0x2d')],_0x2163e6['filters']));if(_0x38dc0a[_0xeabc('0x2e')]){if(_0x38dc0a['dateEnd']){_0x38dc0a['dateEnd']=moment(_0x38dc0a['dateEnd'])['add'](0x1,_0xeabc('0x38'));}else{_0x38dc0a['dateEnd']=moment(_0x38dc0a[_0xeabc('0x2e')])[_0xeabc('0x39')](0x1,'day');}_[_0xeabc('0x3a')](_0x48fb52['where'],{'createdAt':{'$gte':_0x38dc0a[_0xeabc('0x2e')],'$lte':_0x38dc0a['dateEnd']}});}if(_0x3c1b5b[_0xeabc('0x2d')][_0xeabc('0x3b')]){_0x48fb52[_0xeabc('0x37')]=_['merge'](_0x48fb52['where'],{'$or':_['map'](_0x2b568f,function(_0x46056c){if(_0x46056c[_0xeabc('0x3c')][_0xeabc('0x3d')]!=='VIRTUAL'){var _0x4f1897={};_0x4f1897[_0x46056c[_0xeabc('0x3e')]]={'$like':'%'+_0x3c1b5b[_0xeabc('0x2d')]['filter']+'%'};return _0x4f1897;}})});}_0x48fb52=_[_0xeabc('0x3a')]({},_0x48fb52,_0x3c1b5b['options']);var _0xf8a5dd={'where':_0x48fb52['where']};return db['Campaign']['count'](_0xf8a5dd)[_0xeabc('0x24')](function(_0x37c926){_0x38572d[_0xeabc('0x1a')]=_0x37c926;if(_0x3c1b5b[_0xeabc('0x2d')]['includeAll']){_0x48fb52[_0xeabc('0x3f')]=[{'all':!![]}];}return db['Campaign'][_0xeabc('0x40')](_0x48fb52);})[_0xeabc('0x24')](function(_0x3a7807){_0x38572d[_0xeabc('0x41')]=_0x3a7807;return _0x38572d;})[_0xeabc('0x24')](respondWithFilteredResult(_0x2b342c,_0x48fb52))['catch'](handleError(_0x2b342c,null));};exports['show']=function(_0x12ad6b,_0x56b132){var _0x1a957e={'raw':![],'where':{'id':_0x12ad6b['params']['id']}},_0x2cdf59={};_0x2cdf59[_0xeabc('0x2b')]=_[_0xeabc('0x2c')](db[_0xeabc('0x29')][_0xeabc('0x2a')]);_0x2cdf59[_0xeabc('0x2d')]=_[_0xeabc('0x2c')](_0x12ad6b[_0xeabc('0x2d')]);_0x2cdf59['filters']=_[_0xeabc('0x30')](_0x2cdf59[_0xeabc('0x2b')],_0x2cdf59[_0xeabc('0x2d')]);_0x1a957e[_0xeabc('0x32')]=_[_0xeabc('0x30')](_0x2cdf59[_0xeabc('0x2b')],qs[_0xeabc('0x31')](_0x12ad6b[_0xeabc('0x2d')][_0xeabc('0x31')]));_0x1a957e[_0xeabc('0x32')]=_0x1a957e['attributes'][_0xeabc('0x42')]?_0x1a957e[_0xeabc('0x32')]:_0x2cdf59[_0xeabc('0x2b')];if(_0x12ad6b[_0xeabc('0x2d')][_0xeabc('0x43')]){_0x1a957e[_0xeabc('0x3f')]=[{'all':!![]}];}_0x1a957e=_[_0xeabc('0x3a')]({},_0x1a957e,_0x12ad6b['options']);return db[_0xeabc('0x29')][_0xeabc('0x44')](_0x1a957e)[_0xeabc('0x24')](handleEntityNotFound(_0x56b132,null))[_0xeabc('0x24')](respondWithResult(_0x56b132,null))[_0xeabc('0x45')](handleError(_0x56b132,null));};exports['create']=function(_0x305946,_0x2b2b9c){return db[_0xeabc('0x29')][_0xeabc('0x46')](_0x305946['body'],{})[_0xeabc('0x24')](function(_0x1b3aa4){var _0x568847=_0x305946[_0xeabc('0x47')]['get']({'plain':!![]});if(!_0x568847)throw new Error(_0xeabc('0x48'));if(_0x568847['role']===_0xeabc('0x47')){var _0x2ec94c=_0x1b3aa4[_0xeabc('0x22')]({'plain':!![]});var _0x1524c3=_0xeabc('0x49');return db[_0xeabc('0x4a')][_0xeabc('0x44')]({'where':{'name':_0x1524c3,'userProfileId':_0x568847[_0xeabc('0x4b')]},'raw':!![]})[_0xeabc('0x24')](function(_0x6423f3){if(_0x6423f3&&_0x6423f3['autoAssociation']===0x0){return db[_0xeabc('0x23')][_0xeabc('0x46')]({'name':_0x2ec94c[_0xeabc('0x27')],'resourceId':_0x2ec94c['id'],'type':_0x6423f3[_0xeabc('0x27')],'sectionId':_0x6423f3['id']},{})['then'](function(){return _0x1b3aa4;});}else{return _0x1b3aa4;}})[_0xeabc('0x45')](function(_0x392913){logger[_0xeabc('0x25')](_0xeabc('0x4c'),_0x392913);throw _0x392913;});}return _0x1b3aa4;})['then'](respondWithResult(_0x2b2b9c,0xc9))[_0xeabc('0x45')](handleError(_0x2b2b9c,null));};exports[_0xeabc('0x4d')]=function(_0x3a1b84,_0xa55cce){var _0x33f1c1={'raw':![],'where':{'id':_0x3a1b84[_0xeabc('0x4e')]['id']}},_0x3b5e94={};_0x3b5e94[_0xeabc('0x2b')]=_[_0xeabc('0x2c')](db['Campaign'][_0xeabc('0x2a')]);_0x33f1c1['attributes']=_['intersection'](_0x3b5e94['model'],qs[_0xeabc('0x31')](_0x3a1b84[_0xeabc('0x2d')][_0xeabc('0x31')]));_0x33f1c1[_0xeabc('0x32')]=_0x33f1c1[_0xeabc('0x32')][_0xeabc('0x42')]?_0x33f1c1['attributes']:_0x3b5e94[_0xeabc('0x2b')];if(_0x3a1b84[_0xeabc('0x2d')][_0xeabc('0x43')]){_0x33f1c1[_0xeabc('0x3f')]=[{'all':!![]}];}_0x33f1c1=_[_0xeabc('0x3a')]({},_0x33f1c1,_0x3a1b84[_0xeabc('0x4f')]);return db[_0xeabc('0x29')][_0xeabc('0x44')](_0x33f1c1)['then'](handleEntityNotFound(_0xa55cce,null))['then'](function(_0x180e62){if(_0x180e62){var _0x340520=_0x180e62[_0xeabc('0x22')]({'plain':!![]});_0x340520=qs['omit'](_0x340520,['id',_0xeabc('0x50'),'updatedAt']);_0x3a1b84['body']=_[_0xeabc('0x51')](_0x3a1b84[_0xeabc('0x52')],['id',_0xeabc('0x50'),_0xeabc('0x53')]);return db[_0xeabc('0x29')][_0xeabc('0x46')](_['merge'](_0x340520,_0x3a1b84[_0xeabc('0x52')]),{'include':_0x3a1b84[_0xeabc('0x2d')][_0xeabc('0x43')]?[{'all':!![]}]:undefined})[_0xeabc('0x24')](function(_0x11cc1f){var _0x514787=_0x3a1b84['user'][_0xeabc('0x22')]({'plain':!![]});if(!_0x514787)throw new Error(_0xeabc('0x48'));if(_0x514787[_0xeabc('0x54')]===_0xeabc('0x47')){var _0x1b61a8=_0x11cc1f[_0xeabc('0x22')]({'plain':!![]});var _0x2d42e1=_0xeabc('0x49');return db[_0xeabc('0x4a')]['find']({'where':{'name':_0x2d42e1,'userProfileId':_0x514787[_0xeabc('0x4b')]},'raw':!![]})['then'](function(_0x404846){if(_0x404846&&_0x404846[_0xeabc('0x55')]===0x0){return db[_0xeabc('0x23')][_0xeabc('0x46')]({'name':_0x1b61a8[_0xeabc('0x27')],'resourceId':_0x1b61a8['id'],'type':_0x404846[_0xeabc('0x27')],'sectionId':_0x404846['id']},{})[_0xeabc('0x24')](function(){return _0x11cc1f;});}else{return _0x11cc1f;}})[_0xeabc('0x45')](function(_0x5d4bc2){logger[_0xeabc('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d4bc2);throw _0x5d4bc2;});}return _0x11cc1f;});}})[_0xeabc('0x24')](respondWithResult(_0xa55cce,0xc9))[_0xeabc('0x45')](handleError(_0xa55cce,null));};exports[_0xeabc('0x20')]=function(_0x41cad5,_0x5b4430){if(_0x41cad5[_0xeabc('0x52')]['id']){delete _0x41cad5['body']['id'];}return db['Campaign'][_0xeabc('0x44')]({'where':{'id':_0x41cad5[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x5b4430,null))[_0xeabc('0x24')](saveUpdates(_0x41cad5['body'],null))['then'](respondWithResult(_0x5b4430,null))[_0xeabc('0x45')](handleError(_0x5b4430,null));};exports['destroy']=function(_0x529b27,_0x44c0a6){return db['Campaign']['find']({'where':{'id':_0x529b27[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x44c0a6,null))['then'](removeEntity(_0x44c0a6,null))['catch'](handleError(_0x44c0a6,null));};exports[_0xeabc('0x56')]=function(_0x5d183a,_0x238e2d,_0x15ca17){var _0x4c84a9={'raw':!![],'where':{}};var _0x5d6477={};var _0x24365a={'count':0x0,'rows':[]};return db[_0xeabc('0x29')][_0xeabc('0x57')]({'where':{'id':_0x5d183a[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x238e2d,null))['then'](function(_0x53f578){if(_0x53f578){_0x5d6477[_0xeabc('0x2b')]=_['keys'](db[_0xeabc('0x58')]['rawAttributes']);_0x5d6477[_0xeabc('0x2d')]=_['keys'](_0x5d183a[_0xeabc('0x2d')]);_0x5d6477['filters']=_[_0xeabc('0x30')](_0x5d6477[_0xeabc('0x2b')],_0x5d6477[_0xeabc('0x2d')]);_0x4c84a9[_0xeabc('0x32')]=_['intersection'](_0x5d6477[_0xeabc('0x2b')],qs['fields'](_0x5d183a[_0xeabc('0x2d')][_0xeabc('0x31')]));_0x4c84a9[_0xeabc('0x32')]=_0x4c84a9[_0xeabc('0x32')][_0xeabc('0x42')]?_0x4c84a9['attributes']:_0x5d6477[_0xeabc('0x2b')];if(!_0x5d183a[_0xeabc('0x2d')][_0xeabc('0x59')](_0xeabc('0x33'))){_0x4c84a9['limit']=qs[_0xeabc('0x1b')](_0x5d183a[_0xeabc('0x2d')][_0xeabc('0x1b')]);_0x4c84a9[_0xeabc('0x34')]=qs['offset'](_0x5d183a[_0xeabc('0x2d')][_0xeabc('0x34')]);}_0x4c84a9[_0xeabc('0x35')]=qs[_0xeabc('0x36')](_0x5d183a['query']['sort']);_0x4c84a9[_0xeabc('0x37')]=qs['filters'](_['pick'](_0x5d183a[_0xeabc('0x2d')],_0x5d6477[_0xeabc('0x5a')]));_0x4c84a9[_0xeabc('0x37')]['CampaignId']=_0x53f578['id'];if(_0x5d183a[_0xeabc('0x2d')][_0xeabc('0x3b')]){_0x4c84a9['where']=_[_0xeabc('0x3a')](_0x4c84a9[_0xeabc('0x37')],{'$or':_[_0xeabc('0x5b')](_0x4c84a9[_0xeabc('0x32')],function(_0x2ece2c){var _0x4bf9d8={};_0x4bf9d8[_0x2ece2c]={'$like':'%'+_0x5d183a[_0xeabc('0x2d')]['filter']+'%'};return _0x4bf9d8;})});}_0x4c84a9=_['merge']({},_0x4c84a9,_0x5d183a['options']);return db[_0xeabc('0x58')][_0xeabc('0x1a')]({'where':_0x4c84a9[_0xeabc('0x37')]})[_0xeabc('0x24')](function(_0x33fa74){_0x24365a['count']=_0x33fa74;if(_0x5d183a[_0xeabc('0x2d')]['includeAll']){_0x4c84a9[_0xeabc('0x3f')]=[{'all':!![]}];}return db[_0xeabc('0x58')]['findAll'](_0x4c84a9);})[_0xeabc('0x24')](function(_0x4d7821){_0x24365a['rows']=_0x4d7821;return _0x24365a;});}})[_0xeabc('0x24')](respondWithFilteredResult(_0x238e2d,_0x4c84a9))[_0xeabc('0x45')](handleError(_0x238e2d,null));};exports[_0xeabc('0x5c')]=function(_0x3acb88,_0x3c6a49,_0x4dfc4b){var _0x399735={'raw':!![],'where':{}};var _0x1b3ff1={};var _0x33e5fb={'count':0x0,'rows':[]};return db[_0xeabc('0x29')][_0xeabc('0x57')]({'where':{'id':_0x3acb88[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x3c6a49,null))[_0xeabc('0x24')](function(_0x41cffc){if(_0x41cffc){_0x1b3ff1[_0xeabc('0x2b')]=_['keys'](db[_0xeabc('0x5d')][_0xeabc('0x2a')]);_0x1b3ff1[_0xeabc('0x2d')]=_['keys'](_0x3acb88['query']);_0x1b3ff1[_0xeabc('0x5a')]=_[_0xeabc('0x30')](_0x1b3ff1[_0xeabc('0x2b')],_0x1b3ff1[_0xeabc('0x2d')]);_0x399735[_0xeabc('0x32')]=_['intersection'](_0x1b3ff1[_0xeabc('0x2b')],qs['fields'](_0x3acb88['query'][_0xeabc('0x31')]));_0x399735[_0xeabc('0x32')]=_0x399735['attributes'][_0xeabc('0x42')]?_0x399735[_0xeabc('0x32')]:_0x1b3ff1[_0xeabc('0x2b')];if(!_0x3acb88[_0xeabc('0x2d')][_0xeabc('0x59')](_0xeabc('0x33'))){_0x399735[_0xeabc('0x1b')]=qs[_0xeabc('0x1b')](_0x3acb88[_0xeabc('0x2d')][_0xeabc('0x1b')]);_0x399735[_0xeabc('0x34')]=qs['offset'](_0x3acb88[_0xeabc('0x2d')]['offset']);}_0x399735[_0xeabc('0x35')]=qs[_0xeabc('0x36')](_0x3acb88[_0xeabc('0x2d')][_0xeabc('0x36')]);_0x399735[_0xeabc('0x37')]=qs[_0xeabc('0x5a')](_[_0xeabc('0x5e')](_0x3acb88[_0xeabc('0x2d')],_0x1b3ff1[_0xeabc('0x5a')]));_0x399735[_0xeabc('0x37')][_0xeabc('0x5f')]=_0x41cffc['id'];if(_0x3acb88['query'][_0xeabc('0x3b')]){_0x399735[_0xeabc('0x37')]=_[_0xeabc('0x3a')](_0x399735[_0xeabc('0x37')],{'$or':_['map'](_0x399735[_0xeabc('0x32')],function(_0x180f99){var _0x580661={};_0x580661[_0x180f99]={'$like':'%'+_0x3acb88[_0xeabc('0x2d')][_0xeabc('0x3b')]+'%'};return _0x580661;})});}_0x399735=_['merge']({},_0x399735,_0x3acb88['options']);return db['CmHopperHistory']['count']({'where':_0x399735[_0xeabc('0x37')]})[_0xeabc('0x24')](function(_0x186fbe){_0x33e5fb[_0xeabc('0x1a')]=_0x186fbe;if(_0x3acb88[_0xeabc('0x2d')][_0xeabc('0x43')]){_0x399735[_0xeabc('0x3f')]=[{'all':!![]}];}return db[_0xeabc('0x5d')][_0xeabc('0x40')](_0x399735);})[_0xeabc('0x24')](function(_0x5421b9){_0x33e5fb[_0xeabc('0x41')]=_0x5421b9;return _0x33e5fb;});}})[_0xeabc('0x24')](respondWithFilteredResult(_0x3c6a49,_0x399735))['catch'](handleError(_0x3c6a49,null));};exports[_0xeabc('0x60')]=function(_0x32063c,_0x44ae3b,_0x4c4ee3){var _0x1f3198={'raw':!![],'where':{}};var _0x488120={};var _0x425e5c={'count':0x0,'rows':[]};return db[_0xeabc('0x29')][_0xeabc('0x57')]({'where':{'id':_0x32063c[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x44ae3b,null))['then'](function(_0x53a5bc){if(_0x53a5bc){_0x488120['model']=_['keys'](db[_0xeabc('0x61')][_0xeabc('0x2a')]);_0x488120[_0xeabc('0x2d')]=_['keys'](_0x32063c[_0xeabc('0x2d')]);_0x488120[_0xeabc('0x5a')]=_[_0xeabc('0x30')](_0x488120[_0xeabc('0x2b')],_0x488120[_0xeabc('0x2d')]);_0x1f3198[_0xeabc('0x32')]=_[_0xeabc('0x30')](_0x488120[_0xeabc('0x2b')],qs[_0xeabc('0x31')](_0x32063c[_0xeabc('0x2d')][_0xeabc('0x31')]));_0x1f3198[_0xeabc('0x32')]=_0x1f3198['attributes']['length']?_0x1f3198[_0xeabc('0x32')]:_0x488120['model'];if(!_0x32063c[_0xeabc('0x2d')][_0xeabc('0x59')](_0xeabc('0x33'))){_0x1f3198['limit']=qs[_0xeabc('0x1b')](_0x32063c[_0xeabc('0x2d')][_0xeabc('0x1b')]);_0x1f3198['offset']=qs['offset'](_0x32063c[_0xeabc('0x2d')][_0xeabc('0x34')]);}_0x1f3198[_0xeabc('0x35')]=qs[_0xeabc('0x36')](_0x32063c[_0xeabc('0x2d')][_0xeabc('0x36')]);_0x1f3198['where']=qs['filters'](_[_0xeabc('0x5e')](_0x32063c[_0xeabc('0x2d')],_0x488120[_0xeabc('0x5a')]));_0x1f3198[_0xeabc('0x37')]['CampaignId']=_0x53a5bc['id'];if(_0x32063c['query']['filter']){_0x1f3198[_0xeabc('0x37')]=_['merge'](_0x1f3198[_0xeabc('0x37')],{'$or':_['map'](_0x1f3198[_0xeabc('0x32')],function(_0x50007b){var _0x6e6ab2={};_0x6e6ab2[_0x50007b]={'$like':'%'+_0x32063c[_0xeabc('0x2d')][_0xeabc('0x3b')]+'%'};return _0x6e6ab2;})});}_0x1f3198=_[_0xeabc('0x3a')]({},_0x1f3198,_0x32063c[_0xeabc('0x4f')]);return db['CmHopperFinal'][_0xeabc('0x1a')]({'where':_0x1f3198[_0xeabc('0x37')]})[_0xeabc('0x24')](function(_0x52a885){_0x425e5c[_0xeabc('0x1a')]=_0x52a885;if(_0x32063c[_0xeabc('0x2d')][_0xeabc('0x43')]){_0x1f3198[_0xeabc('0x3f')]=[{'all':!![]}];}return db[_0xeabc('0x61')]['findAll'](_0x1f3198);})[_0xeabc('0x24')](function(_0x418728){_0x425e5c['rows']=_0x418728;return _0x425e5c;});}})[_0xeabc('0x24')](respondWithFilteredResult(_0x44ae3b,_0x1f3198))[_0xeabc('0x45')](handleError(_0x44ae3b,null));};exports['getHopperBlacks']=function(_0x807eb9,_0x282fd4,_0x124d76){var _0x307d26={'raw':!![],'where':{}};var _0xfcc0={};var _0xe102c={'count':0x0,'rows':[]};return db[_0xeabc('0x29')][_0xeabc('0x57')]({'where':{'id':_0x807eb9[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x282fd4,null))[_0xeabc('0x24')](function(_0x3601f4){if(_0x3601f4){_0xfcc0[_0xeabc('0x2b')]=_['keys'](db['CmHopperBlack'][_0xeabc('0x2a')]);_0xfcc0[_0xeabc('0x2d')]=_[_0xeabc('0x2c')](_0x807eb9[_0xeabc('0x2d')]);_0xfcc0['filters']=_[_0xeabc('0x30')](_0xfcc0['model'],_0xfcc0['query']);_0x307d26['attributes']=_['intersection'](_0xfcc0['model'],qs['fields'](_0x807eb9[_0xeabc('0x2d')][_0xeabc('0x31')]));_0x307d26[_0xeabc('0x32')]=_0x307d26[_0xeabc('0x32')][_0xeabc('0x42')]?_0x307d26[_0xeabc('0x32')]:_0xfcc0[_0xeabc('0x2b')];if(!_0x807eb9[_0xeabc('0x2d')][_0xeabc('0x59')]('nolimit')){_0x307d26[_0xeabc('0x1b')]=qs[_0xeabc('0x1b')](_0x807eb9[_0xeabc('0x2d')][_0xeabc('0x1b')]);_0x307d26[_0xeabc('0x34')]=qs[_0xeabc('0x34')](_0x807eb9[_0xeabc('0x2d')]['offset']);}_0x307d26[_0xeabc('0x35')]=qs['sort'](_0x807eb9[_0xeabc('0x2d')][_0xeabc('0x36')]);_0x307d26['where']=qs[_0xeabc('0x5a')](_['pick'](_0x807eb9[_0xeabc('0x2d')],_0xfcc0[_0xeabc('0x5a')]));_0x307d26[_0xeabc('0x37')][_0xeabc('0x5f')]=_0x3601f4['id'];if(_0x807eb9[_0xeabc('0x2d')][_0xeabc('0x3b')]){_0x307d26[_0xeabc('0x37')]=_[_0xeabc('0x3a')](_0x307d26[_0xeabc('0x37')],{'$or':_['map'](_0x307d26['attributes'],function(_0x451648){var _0x44e6be={};_0x44e6be[_0x451648]={'$like':'%'+_0x807eb9['query'][_0xeabc('0x3b')]+'%'};return _0x44e6be;})});}_0x307d26=_['merge']({},_0x307d26,_0x807eb9[_0xeabc('0x4f')]);return db[_0xeabc('0x62')][_0xeabc('0x1a')]({'where':_0x307d26[_0xeabc('0x37')]})[_0xeabc('0x24')](function(_0x16b9f7){_0xe102c['count']=_0x16b9f7;if(_0x807eb9[_0xeabc('0x2d')]['includeAll']){_0x307d26[_0xeabc('0x3f')]=[{'all':!![]}];}return db[_0xeabc('0x62')][_0xeabc('0x40')](_0x307d26);})[_0xeabc('0x24')](function(_0x4b1f0f){_0xe102c[_0xeabc('0x41')]=_0x4b1f0f;return _0xe102c;});}})[_0xeabc('0x24')](respondWithFilteredResult(_0x282fd4,_0x307d26))[_0xeabc('0x45')](handleError(_0x282fd4,null));};exports['getLists']=function(_0x13601f,_0x40f9a9,_0xf4ebc4){var _0x53dd5c={};var _0x4d8faa={};var _0x584783;var _0x49b434;return db[_0xeabc('0x29')][_0xeabc('0x57')]({'where':{'id':_0x13601f['params']['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x40f9a9,null))[_0xeabc('0x24')](function(_0x2695a4){if(_0x2695a4){_0x584783=_0x2695a4;_0x4d8faa[_0xeabc('0x2b')]=_[_0xeabc('0x2c')](db[_0xeabc('0x63')][_0xeabc('0x2a')]);_0x4d8faa[_0xeabc('0x2d')]=_[_0xeabc('0x2c')](_0x13601f['query']);_0x4d8faa[_0xeabc('0x5a')]=_['intersection'](_0x4d8faa[_0xeabc('0x2b')],_0x4d8faa[_0xeabc('0x2d')]);_0x53dd5c[_0xeabc('0x32')]=_[_0xeabc('0x30')](_0x4d8faa[_0xeabc('0x2b')],qs[_0xeabc('0x31')](_0x13601f[_0xeabc('0x2d')]['fields']));_0x53dd5c[_0xeabc('0x32')]=_0x53dd5c['attributes'][_0xeabc('0x42')]?_0x53dd5c['attributes']:_0x4d8faa[_0xeabc('0x2b')];_0x53dd5c[_0xeabc('0x35')]=qs[_0xeabc('0x36')](_0x13601f[_0xeabc('0x2d')][_0xeabc('0x36')]);_0x53dd5c['where']=qs[_0xeabc('0x5a')](_[_0xeabc('0x5e')](_0x13601f[_0xeabc('0x2d')],_0x4d8faa[_0xeabc('0x5a')]));if(_0x13601f[_0xeabc('0x2d')]['filter']){_0x53dd5c[_0xeabc('0x37')]=_[_0xeabc('0x3a')](_0x53dd5c[_0xeabc('0x37')],{'$or':_[_0xeabc('0x5b')](_0x53dd5c[_0xeabc('0x32')],function(_0x5a00f3){var _0x29acac={};_0x29acac[_0x5a00f3]={'$like':'%'+_0x13601f['query'][_0xeabc('0x3b')]+'%'};return _0x29acac;})});}_0x53dd5c=_[_0xeabc('0x3a')]({},_0x53dd5c,_0x13601f[_0xeabc('0x4f')]);return _0x584783[_0xeabc('0x64')](_0x53dd5c);}})[_0xeabc('0x24')](function(_0x12b0f6){if(_0x12b0f6){_0x49b434=_0x12b0f6[_0xeabc('0x42')];if(!_0x13601f[_0xeabc('0x2d')][_0xeabc('0x59')](_0xeabc('0x33'))){_0x53dd5c['limit']=qs[_0xeabc('0x1b')](_0x13601f[_0xeabc('0x2d')][_0xeabc('0x1b')]);_0x53dd5c[_0xeabc('0x34')]=qs['offset'](_0x13601f[_0xeabc('0x2d')]['offset']);}return _0x584783['getLists'](_0x53dd5c);}})[_0xeabc('0x24')](function(_0x43ecd6){if(_0x43ecd6){return _0x43ecd6?{'count':_0x49b434,'rows':_0x43ecd6}:null;}})[_0xeabc('0x24')](respondWithResult(_0x40f9a9,null))['catch'](handleError(_0x40f9a9,null));};exports[_0xeabc('0x65')]=function(_0x2f4d12,_0x136402,_0x75bfe2){var _0x2d7fe5,_0x5b85e9;return db[_0xeabc('0x29')][_0xeabc('0x44')]({'where':{'id':_0x2f4d12['params']['id']}})['then'](handleEntityNotFound(_0x136402,null))[_0xeabc('0x24')](function(_0x3500b5){if(_0x3500b5){_0x5b85e9=_0x3500b5;return _0x3500b5[_0xeabc('0x65')](_0x2f4d12[_0xeabc('0x52')][_0xeabc('0x66')],_[_0xeabc('0x51')](_0x2f4d12[_0xeabc('0x52')],[_0xeabc('0x66'),'id'])||{});}return null;})[_0xeabc('0x67')](function(_0x5b934b){var _0x21c67a;_0x2d7fe5=_0x5b934b||[];var _0x5411f2=[];if(_0x5b934b){for(var _0x141d17=0x0;_0x141d17<_0x5b934b['length'];_0x141d17+=0x1){var _0x3d79d8=_0x5b934b[_0x141d17][_0xeabc('0x22')]({'plain':!![]});_0x5b85e9[_0xeabc('0x68')]=_0x2f4d12[_0xeabc('0x52')][_0xeabc('0x68')]?_0x2f4d12[_0xeabc('0x52')][_0xeabc('0x68')]:_0x5b85e9[_0xeabc('0x68')];switch(_0x5b85e9[_0xeabc('0x68')]){case _0xeabc('0x69'):_0x21c67a=squel['insert']()['into'](_0xeabc('0x6a'))['fromQuery']([_0xeabc('0x6b'),_0xeabc('0x6c'),'ContactId','ListId',_0xeabc('0x5f'),'createdAt','updatedAt'],squel[_0xeabc('0x6d')]()['field']('phone',_0xeabc('0x6b'))[_0xeabc('0x3e')]('NOW()',_0xeabc('0x6c'))[_0xeabc('0x3e')]('id',_0xeabc('0x6e'))['field'](_0x3d79d8[_0xeabc('0x6f')][_0xeabc('0x70')](),'ListId')[_0xeabc('0x3e')](_0x2f4d12[_0xeabc('0x4e')]['id'][_0xeabc('0x70')](),_0xeabc('0x5f'))['field'](_0xeabc('0x71'),'createdAt')[_0xeabc('0x3e')](_0xeabc('0x71'),_0xeabc('0x53'))['from']('cm_contacts')[_0xeabc('0x37')](_0xeabc('0x72'))[_0xeabc('0x37')](_0xeabc('0x73'),_0x3d79d8[_0xeabc('0x6f')][_0xeabc('0x70')]())[_0xeabc('0x37')](_0xeabc('0x74'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xeabc('0x6d')]()['field'](_0xeabc('0x75'))['from'](_0xeabc('0x76'))[_0xeabc('0x37')](_0xeabc('0x77'),_0x2f4d12[_0xeabc('0x4e')]['id'][_0xeabc('0x70')]()))[_0xeabc('0x37')](_0xeabc('0x78'),squel[_0xeabc('0x6d')]()['field'](_0xeabc('0x6b'))[_0xeabc('0x79')](_0xeabc('0x6a'))[_0xeabc('0x37')](_0xeabc('0x77'),_0x2f4d12[_0xeabc('0x4e')]['id'][_0xeabc('0x70')]())))[_0xeabc('0x70')]();break;case _0xeabc('0x7a'):_0x21c67a=squel[_0xeabc('0x7b')]()[_0xeabc('0x7c')](_0xeabc('0x6a'))[_0xeabc('0x7d')](['phone',_0xeabc('0x6c'),_0xeabc('0x6e'),_0xeabc('0x7e'),_0xeabc('0x5f'),_0xeabc('0x50'),_0xeabc('0x53')],squel[_0xeabc('0x6d')]()[_0xeabc('0x3e')](_0xeabc('0x6b'),_0xeabc('0x6b'))['field'](_0xeabc('0x71'),_0xeabc('0x6c'))['field']('id','ContactId')[_0xeabc('0x3e')](_0x3d79d8[_0xeabc('0x6f')][_0xeabc('0x70')](),'ListId')[_0xeabc('0x3e')](_0x2f4d12[_0xeabc('0x4e')]['id'][_0xeabc('0x70')](),'CampaignId')[_0xeabc('0x3e')](_0xeabc('0x71'),_0xeabc('0x50'))['field'](_0xeabc('0x71'),_0xeabc('0x53'))['from'](_0xeabc('0x7f'))['where'](_0xeabc('0x72'))[_0xeabc('0x37')]('ListId\x20=\x20?',_0x3d79d8['CmListId']['toString']())[_0xeabc('0x37')](_0xeabc('0x74'))[_0xeabc('0x37')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xeabc('0x6b'))[_0xeabc('0x79')]('cm_hopper')[_0xeabc('0x37')](_0xeabc('0x77'),_0x2f4d12[_0xeabc('0x4e')]['id'][_0xeabc('0x70')]())))[_0xeabc('0x70')]();break;default:_0x21c67a=squel[_0xeabc('0x7b')]()[_0xeabc('0x7c')]('cm_hopper')['fromQuery'](['phone',_0xeabc('0x6c'),_0xeabc('0x6e'),_0xeabc('0x7e'),_0xeabc('0x5f'),_0xeabc('0x50'),'updatedAt'],squel[_0xeabc('0x6d')]()['field'](_0xeabc('0x6b'),_0xeabc('0x6b'))[_0xeabc('0x3e')](_0xeabc('0x71'),_0xeabc('0x6c'))[_0xeabc('0x3e')]('id',_0xeabc('0x6e'))[_0xeabc('0x3e')](_0x3d79d8[_0xeabc('0x6f')][_0xeabc('0x70')](),'ListId')[_0xeabc('0x3e')](_0x2f4d12[_0xeabc('0x4e')]['id']['toString'](),_0xeabc('0x5f'))['field'](_0xeabc('0x71'),_0xeabc('0x50'))[_0xeabc('0x3e')](_0xeabc('0x71'),'updatedAt')[_0xeabc('0x79')](_0xeabc('0x7f'))[_0xeabc('0x37')](_0xeabc('0x72'))[_0xeabc('0x37')]('ListId\x20=\x20?',_0x3d79d8[_0xeabc('0x6f')][_0xeabc('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xeabc('0x70')]();}_0x5411f2[_0xeabc('0x80')](db['sequelize'][_0xeabc('0x2d')](_0x21c67a));}return BPromise[_0xeabc('0x81')](_0x5411f2);}})['then'](function(){return _0x2d7fe5;})['then'](respondWithResult(_0x136402,null))[_0xeabc('0x45')](handleError(_0x136402,null));};exports['removeLists']=function(_0x47d730,_0x439ccb,_0x127a4a){var _0x5d2232;return db['Campaign'][_0xeabc('0x44')]({'where':{'id':_0x47d730[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x439ccb,null))[_0xeabc('0x24')](function(_0x118c4c){if(_0x118c4c){return _0x118c4c[_0xeabc('0x82')](_0x47d730[_0xeabc('0x2d')][_0xeabc('0x66')]);}})[_0xeabc('0x24')](function(_0x4813be){if(_0x4813be){_0x5d2232=_0x4813be;return db['CmHopper'][_0xeabc('0x21')]({'where':{'ListId':_0x47d730[_0xeabc('0x2d')][_0xeabc('0x66')],'CampaignId':_0x47d730['params']['id']}})[_0xeabc('0x24')](function(){return _0x5d2232;});}})[_0xeabc('0x24')](respondWithStatusCode(_0x439ccb,null))[_0xeabc('0x45')](handleError(_0x439ccb,null));};exports[_0xeabc('0x83')]=function(_0x281293,_0x1ca6d2,_0x2f5ab8){var _0x800c05={'raw':!![],'where':{}};var _0x1c77a0={};var _0x10f354={'count':0x0,'rows':[]};return db[_0xeabc('0x29')][_0xeabc('0x57')]({'where':{'id':_0x281293['params']['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x1ca6d2,null))[_0xeabc('0x24')](function(_0x3b2654){if(_0x3b2654){_0x1c77a0['model']=_[_0xeabc('0x2c')](db[_0xeabc('0x63')]['rawAttributes']);_0x1c77a0[_0xeabc('0x2d')]=_['keys'](_0x281293[_0xeabc('0x2d')]);_0x1c77a0[_0xeabc('0x5a')]=_[_0xeabc('0x30')](_0x1c77a0[_0xeabc('0x2b')],_0x1c77a0[_0xeabc('0x2d')]);_0x800c05[_0xeabc('0x32')]=_[_0xeabc('0x30')](_0x1c77a0[_0xeabc('0x2b')],qs[_0xeabc('0x31')](_0x281293['query'][_0xeabc('0x31')]));_0x800c05['attributes']=_0x800c05['attributes'][_0xeabc('0x42')]?_0x800c05[_0xeabc('0x32')]:_0x1c77a0[_0xeabc('0x2b')];if(!_0x281293[_0xeabc('0x2d')][_0xeabc('0x59')](_0xeabc('0x33'))){_0x800c05[_0xeabc('0x1b')]=qs[_0xeabc('0x1b')](_0x281293[_0xeabc('0x2d')][_0xeabc('0x1b')]);_0x800c05[_0xeabc('0x34')]=qs['offset'](_0x281293['query'][_0xeabc('0x34')]);}_0x800c05[_0xeabc('0x35')]=qs['sort'](_0x281293[_0xeabc('0x2d')][_0xeabc('0x36')]);_0x800c05['where']=qs['filters'](_[_0xeabc('0x5e')](_0x281293['query'],_0x1c77a0['filters']));_0x800c05['where'][_0xeabc('0x5f')]=_0x3b2654['id'];if(_0x281293[_0xeabc('0x2d')]['filter']){_0x800c05['where']=_[_0xeabc('0x3a')](_0x800c05['where'],{'$or':_[_0xeabc('0x5b')](_0x800c05['attributes'],function(_0x5c7fb3){var _0x2a8803={};_0x2a8803[_0x5c7fb3]={'$like':'%'+_0x281293[_0xeabc('0x2d')][_0xeabc('0x3b')]+'%'};return _0x2a8803;})});}_0x800c05=_[_0xeabc('0x3a')]({},_0x800c05,_0x281293[_0xeabc('0x4f')]);return db[_0xeabc('0x63')][_0xeabc('0x1a')]({'where':_0x800c05[_0xeabc('0x37')]})[_0xeabc('0x24')](function(_0x23fab7){_0x10f354[_0xeabc('0x1a')]=_0x23fab7;if(_0x281293[_0xeabc('0x2d')][_0xeabc('0x43')]){_0x800c05['include']=[{'all':!![]}];}return db[_0xeabc('0x63')]['findAll'](_0x800c05);})[_0xeabc('0x24')](function(_0x539d5b){_0x10f354[_0xeabc('0x41')]=_0x539d5b;return _0x10f354;});}})[_0xeabc('0x24')](respondWithFilteredResult(_0x1ca6d2,_0x800c05))[_0xeabc('0x45')](handleError(_0x1ca6d2,null));};exports['addBlackLists']=function(_0xfe5c86,_0x502c08,_0xc07a46){var _0x2decda,_0x1d2f4b;return db[_0xeabc('0x29')][_0xeabc('0x44')]({'where':{'id':_0xfe5c86['params']['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x502c08,null))[_0xeabc('0x24')](function(_0x1e890a){if(_0x1e890a){_0x1d2f4b=_0x1e890a;return _0x1e890a[_0xeabc('0x84')](_0xfe5c86[_0xeabc('0x52')][_0xeabc('0x66')],_[_0xeabc('0x51')](_0xfe5c86[_0xeabc('0x52')],[_0xeabc('0x66'),'id'])||{});}return null;})['spread'](function(_0x53e0c1){var _0x44ebc1;_0x2decda=_0x53e0c1||[];var _0x21dd48=[];if(_0x53e0c1){for(var _0xd5b3f6=0x0;_0xd5b3f6<_0x53e0c1[_0xeabc('0x42')];_0xd5b3f6+=0x1){var _0x517172=_0x53e0c1[_0xd5b3f6][_0xeabc('0x22')]({'plain':!![]});_0x44ebc1=squel[_0xeabc('0x7b')]()[_0xeabc('0x7c')](_0xeabc('0x85'))['fromQuery']([_0xeabc('0x6b'),_0xeabc('0x6e'),_0xeabc('0x7e'),'CampaignId','createdAt',_0xeabc('0x53')],squel[_0xeabc('0x6d')]()[_0xeabc('0x3e')](_0xeabc('0x6b'),_0xeabc('0x6b'))[_0xeabc('0x3e')]('id',_0xeabc('0x6e'))[_0xeabc('0x3e')](_0x517172['CmListId']['toString'](),_0xeabc('0x7e'))[_0xeabc('0x3e')](_0xfe5c86[_0xeabc('0x4e')]['id']['toString'](),_0xeabc('0x5f'))[_0xeabc('0x3e')](_0xeabc('0x71'),_0xeabc('0x50'))[_0xeabc('0x3e')]('NOW()',_0xeabc('0x53'))[_0xeabc('0x79')](_0xeabc('0x7f'))[_0xeabc('0x37')](_0xeabc('0x72'))[_0xeabc('0x37')](_0xeabc('0x73'),_0x517172[_0xeabc('0x6f')][_0xeabc('0x70')]())[_0xeabc('0x37')](_0xeabc('0x74')))[_0xeabc('0x70')]();_0x21dd48['push'](db[_0xeabc('0x86')][_0xeabc('0x2d')](_0x44ebc1));}return BPromise[_0xeabc('0x81')](_0x21dd48);}})['then'](function(){return _0x2decda;})[_0xeabc('0x24')](respondWithResult(_0x502c08,null))[_0xeabc('0x45')](handleError(_0x502c08,null));};exports['removeBlackLists']=function(_0x34ac5e,_0x311c56,_0x56c1ac){var _0x50a723;return db[_0xeabc('0x29')][_0xeabc('0x44')]({'where':{'id':_0x34ac5e[_0xeabc('0x4e')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x311c56,null))[_0xeabc('0x24')](function(_0x36bb75){if(_0x36bb75){return _0x36bb75[_0xeabc('0x87')](_0x34ac5e[_0xeabc('0x2d')]['ids']);}})['then'](function(_0x425ec2){if(_0x425ec2){_0x50a723=_0x425ec2;return db[_0xeabc('0x62')][_0xeabc('0x21')]({'where':{'ListId':_0x34ac5e[_0xeabc('0x2d')]['ids'],'CampaignId':_0x34ac5e['params']['id']}})[_0xeabc('0x24')](function(){return _0x50a723;});}})[_0xeabc('0x24')](respondWithStatusCode(_0x311c56,null))[_0xeabc('0x45')](handleError(_0x311c56,null));};
\ No newline at end of file
index da263e1..92dfcc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13ec=['../../config/logger','api','moment','bluebird','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5853ec,_0x9127a7){var _0xdb27f7=function(_0x321adb){while(--_0x321adb){_0x5853ec['push'](_0x5853ec['shift']());}};_0xdb27f7(++_0x9127a7);}(_0x13ec,0x15c));var _0xc13e=function(_0xe26ab9,_0x19d0f8){_0xe26ab9=_0xe26ab9-0x0;var _0xda543b=_0x13ec[_0xe26ab9];return _0xda543b;};'use strict';var _=require(_0xc13e('0x0'));var util=require(_0xc13e('0x1'));var logger=require(_0xc13e('0x2'))(_0xc13e('0x3'));var moment=require(_0xc13e('0x4'));var BPromise=require(_0xc13e('0x5'));var rp=require('request-promise');var attributes=require(_0xc13e('0x6'));module[_0xc13e('0x7')]=function(_0xe8c7ad,_0x31b7d8){return _0xe8c7ad['define'](_0xc13e('0x8'),attributes,{'tableName':_0xc13e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x885b=['../../config/logger','api','bluebird','request-promise','exports','Campaign','campaigns','lodash','util'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x885b,0x73));var _0xb885=function(_0x14b09b,_0x2db9da){_0x14b09b=_0x14b09b-0x0;var _0x510ab1=_0x885b[_0x14b09b];return _0x510ab1;};'use strict';var _=require(_0xb885('0x0'));var util=require(_0xb885('0x1'));var logger=require(_0xb885('0x2'))(_0xb885('0x3'));var moment=require('moment');var BPromise=require(_0xb885('0x4'));var rp=require(_0xb885('0x5'));var attributes=require('./campaign.attributes');module[_0xb885('0x6')]=function(_0xa0319f,_0x5eb2ba){return _0xa0319f['define'](_0xb885('0x7'),attributes,{'tableName':_0xb885('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a0e2f1a..91159b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd274=['jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x7f365f,_0x3d79ba){var _0x5a530c=function(_0x23dbfb){while(--_0x23dbfb){_0x7f365f['push'](_0x7f365f['shift']());}};_0x5a530c(++_0x3d79ba);}(_0xd274,0x18d));var _0x4d27=function(_0x326cb1,_0x329809){_0x326cb1=_0x326cb1-0x0;var _0x55cb4b=_0xd274[_0x326cb1];return _0x55cb4b;};'use strict';var _=require(_0x4d27('0x0'));var util=require('util');var moment=require(_0x4d27('0x1'));var BPromise=require(_0x4d27('0x2'));var rs=require(_0x4d27('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d27('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d27('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4d27('0x6'));var client=jayson[_0x4d27('0x7')][_0x4d27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5179b1,_0x1a8a3d,_0x33bdaa){return new BPromise(function(_0x1758c8,_0x7289b7){return client[_0x4d27('0x9')](_0x5179b1,_0x33bdaa)['then'](function(_0x465872){logger['info'](_0x4d27('0xa'),_0x1a8a3d,'request\x20sent');logger['debug'](_0x4d27('0xb'),_0x1a8a3d,_0x4d27('0xc'),JSON[_0x4d27('0xd')](_0x465872));if(_0x465872[_0x4d27('0xe')]){if(_0x465872[_0x4d27('0xe')][_0x4d27('0xf')]===0x1f4){logger['error'](_0x4d27('0xa'),_0x1a8a3d,_0x465872['error'][_0x4d27('0x10')]);return _0x7289b7(_0x465872[_0x4d27('0xe')][_0x4d27('0x10')]);}logger[_0x4d27('0xe')](_0x4d27('0xa'),_0x1a8a3d,_0x465872[_0x4d27('0xe')][_0x4d27('0x10')]);return _0x1758c8(_0x465872[_0x4d27('0xe')][_0x4d27('0x10')]);}else{logger[_0x4d27('0x11')]('Campaign,\x20%s,\x20%s',_0x1a8a3d,_0x4d27('0xc'));_0x1758c8(_0x465872['result'][_0x4d27('0x10')]);}})['catch'](function(_0xd1a5dc){logger[_0x4d27('0xe')](_0x4d27('0xa'),_0x1a8a3d,_0xd1a5dc);_0x7289b7(_0xd1a5dc);});});}exports[_0x4d27('0x12')]=function(_0x52a201){var _0x2e27db=this;return new Promise(function(_0x4b6eea,_0x4ec692){return db[_0x4d27('0x13')][_0x4d27('0x14')]({'raw':_0x52a201[_0x4d27('0x15')]?_0x52a201[_0x4d27('0x15')][_0x4d27('0x16')]===undefined?!![]:![]:!![],'where':_0x52a201[_0x4d27('0x15')]?_0x52a201['options'][_0x4d27('0x17')]||null:null,'attributes':_0x52a201['options']?_0x52a201[_0x4d27('0x15')][_0x4d27('0x18')]||null:null,'limit':_0x52a201['options']?_0x52a201[_0x4d27('0x15')][_0x4d27('0x19')]||null:null,'include':_0x52a201[_0x4d27('0x15')]?_0x52a201[_0x4d27('0x15')][_0x4d27('0x1a')]?_[_0x4d27('0x1b')](_0x52a201[_0x4d27('0x15')][_0x4d27('0x1a')],function(_0x345887){return{'model':db[_0x345887['model']],'as':_0x345887['as'],'attributes':_0x345887[_0x4d27('0x18')],'include':_0x345887['include']?_[_0x4d27('0x1b')](_0x345887[_0x4d27('0x1a')],function(_0x5db209){return{'model':db[_0x5db209['model']],'as':_0x5db209['as'],'attributes':_0x5db209['attributes'],'include':_0x5db209[_0x4d27('0x1a')]?_[_0x4d27('0x1b')](_0x5db209[_0x4d27('0x1a')],function(_0x215e52){return{'model':db[_0x215e52[_0x4d27('0x1c')]],'as':_0x215e52['as'],'attributes':_0x215e52[_0x4d27('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4d27('0x1d')](function(_0x4e4d9c){logger[_0x4d27('0x11')](_0x4d27('0x12'),_0x52a201);logger[_0x4d27('0x1e')](_0x4d27('0x12'),_0x52a201,JSON[_0x4d27('0xd')](_0x4e4d9c));_0x4b6eea(_0x4e4d9c);})['catch'](function(_0x2b038d){logger[_0x4d27('0xe')](_0x4d27('0x12'),_0x2b038d[_0x4d27('0x10')],_0x52a201);_0x4ec692(_0x2e27db[_0x4d27('0xe')](0x1f4,_0x2b038d[_0x4d27('0x10')]));});});};
\ No newline at end of file
+var _0xe022=['stringify','error','code','message','result','catch','GetCampaign','findAll','options','raw','where','limit','include','map','model','attributes','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s'];(function(_0x269d3f,_0x2f4246){var _0x9331c6=function(_0x1be24a){while(--_0x1be24a){_0x269d3f['push'](_0x269d3f['shift']());}};_0x9331c6(++_0x2f4246);}(_0xe022,0xff));var _0x2e02=function(_0x1d561c,_0x3e0fa1){_0x1d561c=_0x1d561c-0x0;var _0x539d15=_0xe022[_0x1d561c];return _0x539d15;};'use strict';var _=require(_0x2e02('0x0'));var util=require(_0x2e02('0x1'));var moment=require('moment');var BPromise=require(_0x2e02('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e02('0x3'));var db=require(_0x2e02('0x4'))['db'];var utils=require(_0x2e02('0x5'));var logger=require(_0x2e02('0x6'))(_0x2e02('0x7'));var config=require(_0x2e02('0x8'));var jayson=require(_0x2e02('0x9'));var client=jayson[_0x2e02('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x583384,_0x3d0d4e,_0xb0b5bf){return new BPromise(function(_0x49fa5b,_0x584a8b){return client[_0x2e02('0xb')](_0x583384,_0xb0b5bf)[_0x2e02('0xc')](function(_0x2a9125){logger[_0x2e02('0xd')](_0x2e02('0xe'),_0x3d0d4e,_0x2e02('0xf'));logger['debug'](_0x2e02('0x10'),_0x3d0d4e,'request\x20sent',JSON[_0x2e02('0x11')](_0x2a9125));if(_0x2a9125['error']){if(_0x2a9125[_0x2e02('0x12')][_0x2e02('0x13')]===0x1f4){logger[_0x2e02('0x12')](_0x2e02('0xe'),_0x3d0d4e,_0x2a9125[_0x2e02('0x12')][_0x2e02('0x14')]);return _0x584a8b(_0x2a9125[_0x2e02('0x12')][_0x2e02('0x14')]);}logger[_0x2e02('0x12')]('Campaign,\x20%s,\x20%s',_0x3d0d4e,_0x2a9125[_0x2e02('0x12')]['message']);return _0x49fa5b(_0x2a9125[_0x2e02('0x12')][_0x2e02('0x14')]);}else{logger[_0x2e02('0xd')]('Campaign,\x20%s,\x20%s',_0x3d0d4e,'request\x20sent');_0x49fa5b(_0x2a9125[_0x2e02('0x15')]['message']);}})[_0x2e02('0x16')](function(_0x21dfba){logger[_0x2e02('0x12')](_0x2e02('0xe'),_0x3d0d4e,_0x21dfba);_0x584a8b(_0x21dfba);});});}exports[_0x2e02('0x17')]=function(_0x550c96){var _0x24a40c=this;return new Promise(function(_0x3c6f11,_0x5d0f31){return db['Campaign'][_0x2e02('0x18')]({'raw':_0x550c96[_0x2e02('0x19')]?_0x550c96[_0x2e02('0x19')][_0x2e02('0x1a')]===undefined?!![]:![]:!![],'where':_0x550c96[_0x2e02('0x19')]?_0x550c96[_0x2e02('0x19')][_0x2e02('0x1b')]||null:null,'attributes':_0x550c96[_0x2e02('0x19')]?_0x550c96['options']['attributes']||null:null,'limit':_0x550c96[_0x2e02('0x19')]?_0x550c96['options'][_0x2e02('0x1c')]||null:null,'include':_0x550c96[_0x2e02('0x19')]?_0x550c96[_0x2e02('0x19')][_0x2e02('0x1d')]?_[_0x2e02('0x1e')](_0x550c96[_0x2e02('0x19')][_0x2e02('0x1d')],function(_0x9663f6){return{'model':db[_0x9663f6[_0x2e02('0x1f')]],'as':_0x9663f6['as'],'attributes':_0x9663f6[_0x2e02('0x20')],'include':_0x9663f6['include']?_[_0x2e02('0x1e')](_0x9663f6['include'],function(_0x40c0c8){return{'model':db[_0x40c0c8['model']],'as':_0x40c0c8['as'],'attributes':_0x40c0c8[_0x2e02('0x20')],'include':_0x40c0c8[_0x2e02('0x1d')]?_[_0x2e02('0x1e')](_0x40c0c8[_0x2e02('0x1d')],function(_0xd386a4){return{'model':db[_0xd386a4[_0x2e02('0x1f')]],'as':_0xd386a4['as'],'attributes':_0xd386a4[_0x2e02('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2e02('0xc')](function(_0x36e302){logger['info'](_0x2e02('0x17'),_0x550c96);logger[_0x2e02('0x21')](_0x2e02('0x17'),_0x550c96,JSON['stringify'](_0x36e302));_0x3c6f11(_0x36e302);})[_0x2e02('0x16')](function(_0x39f0b3){logger[_0x2e02('0x12')]('GetCampaign',_0x39f0b3[_0x2e02('0x14')],_0x550c96);_0x5d0f31(_0x24a40c['error'](0x1f4,_0x39f0b3[_0x2e02('0x14')]));});});};
\ No newline at end of file
index 40320ab..682719a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce22=['getHopperFinals','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','clone','addLists','/:id/blacklists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x168c01,_0x18b611){var _0x25db26=function(_0xbf833e){while(--_0xbf833e){_0x168c01['push'](_0x168c01['shift']());}};_0x25db26(++_0x18b611);}(_0xce22,0x17c));var _0x2ce2=function(_0x24f83b,_0x343a9c){_0x24f83b=_0x24f83b-0x0;var _0x561bf9=_0xce22[_0x24f83b];return _0x561bf9;};'use strict';var multer=require(_0x2ce2('0x0'));var util=require(_0x2ce2('0x1'));var path=require('path');var timeout=require(_0x2ce2('0x2'));var express=require(_0x2ce2('0x3'));var router=express[_0x2ce2('0x4')]();var auth=require(_0x2ce2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x2ce2('0x6')]('/',auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x8')]);router[_0x2ce2('0x6')](_0x2ce2('0x9'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0xa')]);router[_0x2ce2('0x6')](_0x2ce2('0xb'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0xc')]);router[_0x2ce2('0x6')](_0x2ce2('0xd'),auth['isAuthenticated'](),controller[_0x2ce2('0xe')]);router[_0x2ce2('0x6')](_0x2ce2('0xf'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x10')]);router[_0x2ce2('0x6')]('/:id/hopper_black',auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x11')]);router[_0x2ce2('0x6')](_0x2ce2('0x12'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x13')]);router['get']('/:id/blacklists',auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x14')]);router['post']('/',auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x15')]);router[_0x2ce2('0x16')](_0x2ce2('0x17'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x18')]);router['post'](_0x2ce2('0x12'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x19')]);router[_0x2ce2('0x16')](_0x2ce2('0x1a'),auth[_0x2ce2('0x7')](),controller['addBlackLists']);router[_0x2ce2('0x1b')](_0x2ce2('0x9'),auth[_0x2ce2('0x7')](),controller['update']);router[_0x2ce2('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x2ce2('0x1d')]);router[_0x2ce2('0x1c')](_0x2ce2('0x12'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x1e')]);router['delete'](_0x2ce2('0x1a'),auth[_0x2ce2('0x7')](),controller[_0x2ce2('0x1f')]);module[_0x2ce2('0x20')]=router;
\ No newline at end of file
+var _0x3200=['delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update'];(function(_0x1141c2,_0x2274a5){var _0x1164a7=function(_0x5ec35f){while(--_0x5ec35f){_0x1141c2['push'](_0x1141c2['shift']());}};_0x1164a7(++_0x2274a5);}(_0x3200,0x159));var _0x0320=function(_0x1fc71b,_0x1da73f){_0x1fc71b=_0x1fc71b-0x0;var _0x1ae186=_0x3200[_0x1fc71b];return _0x1ae186;};'use strict';var multer=require(_0x0320('0x0'));var util=require(_0x0320('0x1'));var path=require(_0x0320('0x2'));var timeout=require('connect-timeout');var express=require(_0x0320('0x3'));var router=express[_0x0320('0x4')]();var auth=require(_0x0320('0x5'));var interaction=require(_0x0320('0x6'));var config=require(_0x0320('0x7'));var controller=require(_0x0320('0x8'));router[_0x0320('0x9')]('/',auth[_0x0320('0xa')](),controller[_0x0320('0xb')]);router[_0x0320('0x9')]('/:id',auth[_0x0320('0xa')](),controller['show']);router[_0x0320('0x9')](_0x0320('0xc'),auth['isAuthenticated'](),controller[_0x0320('0xd')]);router['get']('/:id/hopper_histories',auth[_0x0320('0xa')](),controller[_0x0320('0xe')]);router['get'](_0x0320('0xf'),auth[_0x0320('0xa')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x0320('0xa')](),controller[_0x0320('0x10')]);router['get'](_0x0320('0x11'),auth[_0x0320('0xa')](),controller[_0x0320('0x12')]);router[_0x0320('0x9')](_0x0320('0x13'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x0320('0x14')]('/',auth[_0x0320('0xa')](),controller[_0x0320('0x15')]);router[_0x0320('0x14')](_0x0320('0x16'),auth[_0x0320('0xa')](),controller[_0x0320('0x17')]);router[_0x0320('0x14')](_0x0320('0x11'),auth[_0x0320('0xa')](),controller[_0x0320('0x18')]);router[_0x0320('0x14')](_0x0320('0x13'),auth[_0x0320('0xa')](),controller[_0x0320('0x19')]);router[_0x0320('0x1a')](_0x0320('0x1b'),auth[_0x0320('0xa')](),controller[_0x0320('0x1c')]);router[_0x0320('0x1d')](_0x0320('0x1b'),auth['isAuthenticated'](),controller[_0x0320('0x1e')]);router[_0x0320('0x1d')](_0x0320('0x11'),auth[_0x0320('0xa')](),controller[_0x0320('0x1f')]);router[_0x0320('0x1d')](_0x0320('0x13'),auth['isAuthenticated'](),controller[_0x0320('0x20')]);module[_0x0320('0x21')]=router;
\ No newline at end of file
index f1aa3f3..64f578c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf466=['getDataValue','key','sequelize','TEXT','STRING','VIRTUAL'];(function(_0x23a250,_0x37c274){var _0x286c5d=function(_0x4900df){while(--_0x4900df){_0x23a250['push'](_0x23a250['shift']());}};_0x286c5d(++_0x37c274);}(_0xf466,0x1d6));var _0x6f46=function(_0x5013bd,_0x4d4b8d){_0x5013bd=_0x5013bd-0x0;var _0x5d3e13=_0xf466[_0x5013bd];return _0x5d3e13;};'use strict';var Sequelize=require(_0x6f46('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6f46('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6f46('0x2')]},'name':{'type':Sequelize[_0x6f46('0x3')],'get':function(){return this[_0x6f46('0x4')](_0x6f46('0x5'));}}};
\ No newline at end of file
+var _0x63b9=['STRING','TEXT','getDataValue'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x63b9,0x1f2));var _0x963b=function(_0x35323a,_0x42aa22){_0x35323a=_0x35323a-0x0;var _0x2e52f7=_0x63b9[_0x35323a];return _0x2e52f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x963b('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x963b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x963b('0x0')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x963b('0x2')]('key');}}};
\ No newline at end of file
index e3b20b1..b20a45e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b6c=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','end','sendStatus','error','name','send','index','CannedAnswer','model','query','dateEnd','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','dateStart','add','day','merge','filter','map','type','key','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf'];(function(_0x4fe199,_0x555f3f){var _0x371035=function(_0x437e14){while(--_0x437e14){_0x4fe199['push'](_0x4fe199['shift']());}};_0x371035(++_0x555f3f);}(_0x4b6c,0xb3));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc4b6('0x0'));var emlformat=require(_0xc4b6('0x1'));var rimraf=require(_0xc4b6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc4b6('0x3'));var moment=require(_0xc4b6('0x4'));var BPromise=require(_0xc4b6('0x5'));var Mustache=require(_0xc4b6('0x6'));var util=require(_0xc4b6('0x7'));var path=require(_0xc4b6('0x8'));var sox=require(_0xc4b6('0x9'));var csv=require(_0xc4b6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc4b6('0xb'));var squel=require(_0xc4b6('0xc'));var crypto=require(_0xc4b6('0xd'));var jsforce=require(_0xc4b6('0xe'));var deskjs=require(_0xc4b6('0xf'));var toCsv=require(_0xc4b6('0xa'));var querystring=require('querystring');var Papa=require(_0xc4b6('0x10'));var Redis=require('ioredis');var qs=require(_0xc4b6('0x11'));var logger=require(_0xc4b6('0x12'))(_0xc4b6('0x13'));var utils=require(_0xc4b6('0x14'));var config=require(_0xc4b6('0x15'));var db=require(_0xc4b6('0x16'))['db'];function respondWithStatusCode(_0x241cff,_0x4b1881){_0x4b1881=_0x4b1881||0xcc;return function(_0x156859){if(_0x156859){return _0x241cff['sendStatus'](_0x4b1881);}return _0x241cff[_0xc4b6('0x17')](_0x4b1881)['end']();};}function respondWithResult(_0x3bf523,_0x2db256){_0x2db256=_0x2db256||0xc8;return function(_0x3a068a){if(_0x3a068a){return _0x3bf523[_0xc4b6('0x17')](_0x2db256)['json'](_0x3a068a);}};}function respondWithFilteredResult(_0x5cb16a,_0x184714){return function(_0x1dc1b6){if(_0x1dc1b6){var _0x3ef059=_0x1dc1b6[_0xc4b6('0x18')],_0x2453ad=_0x184714[_0xc4b6('0x19')],_0x5a365f=_0x184714[_0xc4b6('0x19')]+_0x184714[_0xc4b6('0x1a')],_0x475dbd;if(_0x5a365f>=_0x3ef059){_0x5a365f=_0x3ef059;_0x475dbd=0xc8;}else{_0x475dbd=0xce;}_0x5cb16a['status'](_0x475dbd);return _0x5cb16a[_0xc4b6('0x1b')](_0xc4b6('0x1c'),_0x2453ad+'-'+_0x5a365f+'/'+_0x3ef059)['json'](_0x1dc1b6);}return null;};}function patchUpdates(_0x1512f7){return function(_0x584abe){try{jsonpatch['apply'](_0x584abe,_0x1512f7,!![]);}catch(_0x422b63){return BPromise[_0xc4b6('0x1d')](_0x422b63);}return _0x584abe[_0xc4b6('0x1e')]();};}function saveUpdates(_0x29e173,_0x4a8c7e){return function(_0x195dba){if(_0x195dba){return _0x195dba[_0xc4b6('0x1f')](_0x29e173)[_0xc4b6('0x20')](function(_0x26ecab){return _0x26ecab;});}return null;};}function removeEntity(_0x159ffd,_0x301a4b){return function(_0x52cfa7){if(_0x52cfa7){return _0x52cfa7[_0xc4b6('0x21')]()[_0xc4b6('0x20')](function(){var _0x234a26=_0x52cfa7['get']({'plain':!![]});var _0x57da33=_0xc4b6('0x22');return db[_0xc4b6('0x23')][_0xc4b6('0x21')]({'where':{'type':_0x57da33,'resourceId':_0x234a26['id']}})[_0xc4b6('0x20')](function(){return _0x52cfa7;});})['then'](function(){_0x159ffd[_0xc4b6('0x17')](0xcc)[_0xc4b6('0x24')]();});}};}function handleEntityNotFound(_0x413ccf,_0x14bbe4){return function(_0x36b3f5){if(!_0x36b3f5){_0x413ccf[_0xc4b6('0x25')](0x194);}return _0x36b3f5;};}function handleError(_0x16dcec,_0x343ee9){_0x343ee9=_0x343ee9||0x1f4;return function(_0x2d03c8){logger[_0xc4b6('0x26')](_0x2d03c8['stack']);if(_0x2d03c8[_0xc4b6('0x27')]){delete _0x2d03c8[_0xc4b6('0x27')];}_0x16dcec['status'](_0x343ee9)[_0xc4b6('0x28')](_0x2d03c8);};}exports[_0xc4b6('0x29')]=function(_0x5cf433,_0x582a63){var _0x18d353={},_0x80df18={},_0x16d245={'count':0x0,'rows':[]};var _0x97bcc4=db[_0xc4b6('0x2a')]['rawAttributes'];_0x80df18[_0xc4b6('0x2b')]=_['keys'](_0x97bcc4);var _0x419e63={'dateStart':_0x5cf433[_0xc4b6('0x2c')]['dateStart'],'dateEnd':_0x5cf433[_0xc4b6('0x2c')]['dateEnd']};delete _0x5cf433['query']['dateStart'];delete _0x5cf433['query'][_0xc4b6('0x2d')];_0x80df18[_0xc4b6('0x2c')]=_[_0xc4b6('0x2e')](_0x5cf433[_0xc4b6('0x2c')]);_0x80df18['filters']=_[_0xc4b6('0x2f')](_0x80df18[_0xc4b6('0x2b')],_0x80df18[_0xc4b6('0x2c')]);_0x18d353[_0xc4b6('0x30')]=_[_0xc4b6('0x2f')](_0x80df18[_0xc4b6('0x2b')],qs[_0xc4b6('0x31')](_0x5cf433[_0xc4b6('0x2c')][_0xc4b6('0x31')]));_0x18d353[_0xc4b6('0x30')]=_0x18d353[_0xc4b6('0x30')]['length']?_0x18d353[_0xc4b6('0x30')]:_0x80df18[_0xc4b6('0x2b')];if(!_0x5cf433[_0xc4b6('0x2c')]['hasOwnProperty'](_0xc4b6('0x32'))){_0x18d353[_0xc4b6('0x1a')]=qs[_0xc4b6('0x1a')](_0x5cf433[_0xc4b6('0x2c')][_0xc4b6('0x1a')]);_0x18d353[_0xc4b6('0x19')]=qs['offset'](_0x5cf433['query']['offset']);}_0x18d353[_0xc4b6('0x33')]=qs[_0xc4b6('0x34')](_0x5cf433[_0xc4b6('0x2c')][_0xc4b6('0x34')]);_0x18d353[_0xc4b6('0x35')]=qs['filters'](_[_0xc4b6('0x36')](_0x5cf433[_0xc4b6('0x2c')],_0x80df18[_0xc4b6('0x37')]));if(_0x419e63[_0xc4b6('0x38')]){if(_0x419e63[_0xc4b6('0x2d')]){_0x419e63['dateEnd']=moment(_0x419e63[_0xc4b6('0x2d')])[_0xc4b6('0x39')](0x1,_0xc4b6('0x3a'));}else{_0x419e63[_0xc4b6('0x2d')]=moment(_0x419e63[_0xc4b6('0x38')])[_0xc4b6('0x39')](0x1,'day');}_[_0xc4b6('0x3b')](_0x18d353['where'],{'createdAt':{'$gte':_0x419e63[_0xc4b6('0x38')],'$lte':_0x419e63[_0xc4b6('0x2d')]}});}if(_0x5cf433['query'][_0xc4b6('0x3c')]){_0x18d353[_0xc4b6('0x35')]=_[_0xc4b6('0x3b')](_0x18d353['where'],{'$or':_[_0xc4b6('0x3d')](_0x97bcc4,function(_0x13fe2c){if(_0x13fe2c[_0xc4b6('0x3e')][_0xc4b6('0x3f')]!=='VIRTUAL'){var _0x12b091={};_0x12b091[_0x13fe2c[_0xc4b6('0x40')]]={'$like':'%'+_0x5cf433['query']['filter']+'%'};return _0x12b091;}})});}_0x18d353=_['merge']({},_0x18d353,_0x5cf433[_0xc4b6('0x41')]);var _0x15d976={'where':_0x18d353[_0xc4b6('0x35')]};return db[_0xc4b6('0x2a')][_0xc4b6('0x18')](_0x15d976)['then'](function(_0x47a128){_0x16d245['count']=_0x47a128;if(_0x5cf433[_0xc4b6('0x2c')][_0xc4b6('0x42')]){_0x18d353[_0xc4b6('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc4b6('0x44')](_0x18d353);})['then'](function(_0xa1460e){_0x16d245[_0xc4b6('0x45')]=_0xa1460e;return _0x16d245;})[_0xc4b6('0x20')](respondWithFilteredResult(_0x582a63,_0x18d353))['catch'](handleError(_0x582a63,null));};exports[_0xc4b6('0x46')]=function(_0x5d956f,_0x7166da){var _0x2a1f29={'raw':!![],'where':{'id':_0x5d956f[_0xc4b6('0x47')]['id']}},_0x12f04c={};_0x12f04c[_0xc4b6('0x2b')]=_[_0xc4b6('0x2e')](db['CannedAnswer'][_0xc4b6('0x48')]);_0x12f04c[_0xc4b6('0x2c')]=_[_0xc4b6('0x2e')](_0x5d956f['query']);_0x12f04c[_0xc4b6('0x37')]=_[_0xc4b6('0x2f')](_0x12f04c[_0xc4b6('0x2b')],_0x12f04c[_0xc4b6('0x2c')]);_0x2a1f29[_0xc4b6('0x30')]=_[_0xc4b6('0x2f')](_0x12f04c[_0xc4b6('0x2b')],qs[_0xc4b6('0x31')](_0x5d956f[_0xc4b6('0x2c')][_0xc4b6('0x31')]));_0x2a1f29[_0xc4b6('0x30')]=_0x2a1f29[_0xc4b6('0x30')]['length']?_0x2a1f29[_0xc4b6('0x30')]:_0x12f04c[_0xc4b6('0x2b')];if(_0x5d956f[_0xc4b6('0x2c')][_0xc4b6('0x42')]){_0x2a1f29[_0xc4b6('0x43')]=[{'all':!![]}];}_0x2a1f29=_[_0xc4b6('0x3b')]({},_0x2a1f29,_0x5d956f[_0xc4b6('0x41')]);return db[_0xc4b6('0x2a')][_0xc4b6('0x49')](_0x2a1f29)[_0xc4b6('0x20')](handleEntityNotFound(_0x7166da,null))[_0xc4b6('0x20')](respondWithResult(_0x7166da,null))[_0xc4b6('0x4a')](handleError(_0x7166da,null));};exports[_0xc4b6('0x1f')]=function(_0x3136e5,_0x18a61b){if(_0x3136e5[_0xc4b6('0x4b')]['id']){delete _0x3136e5[_0xc4b6('0x4b')]['id'];}return db[_0xc4b6('0x2a')][_0xc4b6('0x49')]({'where':{'id':_0x3136e5[_0xc4b6('0x47')]['id']}})[_0xc4b6('0x20')](handleEntityNotFound(_0x18a61b,null))[_0xc4b6('0x20')](saveUpdates(_0x3136e5['body'],null))['then'](respondWithResult(_0x18a61b,null))[_0xc4b6('0x4a')](handleError(_0x18a61b,null));};exports[_0xc4b6('0x21')]=function(_0x51b3a0,_0x887365){return db[_0xc4b6('0x2a')][_0xc4b6('0x49')]({'where':{'id':_0x51b3a0[_0xc4b6('0x47')]['id']}})[_0xc4b6('0x20')](handleEntityNotFound(_0x887365,null))[_0xc4b6('0x20')](removeEntity(_0x887365,null))[_0xc4b6('0x4a')](handleError(_0x887365,null));};exports['create']=function(_0x3efdcc,_0x5a91c5){var _0x2ff943={'key':_0x3efdcc['body'][_0xc4b6('0x3f')]};if(_0x3efdcc[_0xc4b6('0x4b')][_0xc4b6('0x4c')]){_0x2ff943[_0xc4b6('0x4c')]=_0x3efdcc[_0xc4b6('0x4b')][_0xc4b6('0x4c')];}else if(_0x3efdcc[_0xc4b6('0x4b')][_0xc4b6('0x4d')]){_0x2ff943[_0xc4b6('0x4d')]=_0x3efdcc[_0xc4b6('0x4b')][_0xc4b6('0x4d')];}else if(_0x3efdcc[_0xc4b6('0x4b')]['OpenchannelAccountId']){_0x2ff943['OpenchannelAccountId']=_0x3efdcc[_0xc4b6('0x4b')][_0xc4b6('0x4e')];}else if(_0x3efdcc[_0xc4b6('0x4b')][_0xc4b6('0x4f')]){_0x2ff943[_0xc4b6('0x4f')]=_0x3efdcc['body'][_0xc4b6('0x4f')];}return db[_0xc4b6('0x2a')]['find']({'where':_0x2ff943})[_0xc4b6('0x20')](function(_0x372e85){if(_0x372e85){throw new db[(_0xc4b6('0x50'))][(_0xc4b6('0x51'))](_0xc4b6('0x52'));}return db[_0xc4b6('0x2a')][_0xc4b6('0x53')](_0x3efdcc['body']);})[_0xc4b6('0x20')](function(_0x57d2e2){var _0x1e061f=_0x3efdcc[_0xc4b6('0x54')][_0xc4b6('0x55')]({'plain':!![]});if(!_0x1e061f)throw new Error(_0xc4b6('0x56'));if(_0x1e061f['role']===_0xc4b6('0x54')){var _0x21a30c=_0x57d2e2[_0xc4b6('0x55')]({'plain':!![]});return db['UserProfileSection'][_0xc4b6('0x49')]({'where':{'name':_0xc4b6('0x22'),'userProfileId':_0x1e061f[_0xc4b6('0x57')]},'raw':!![]})[_0xc4b6('0x20')](function(_0x1245dd){if(_0x1245dd&&_0x1245dd[_0xc4b6('0x58')]===0x0){return db['UserProfileResource'][_0xc4b6('0x53')]({'name':_0x21a30c[_0xc4b6('0x27')],'resourceId':_0x21a30c['id'],'type':_0x1245dd['name'],'sectionId':_0x1245dd['id']},{})[_0xc4b6('0x20')](function(){return _0x57d2e2;});}else{return _0x57d2e2;}})[_0xc4b6('0x4a')](function(_0x27ae82){logger['error'](_0xc4b6('0x59'),_0x27ae82);throw _0x27ae82;});}return _0x57d2e2;})[_0xc4b6('0x20')](respondWithResult(_0x5a91c5,0xc9))[_0xc4b6('0x4a')](handleError(_0x5a91c5,null));};
\ No newline at end of file
+var _0x3027=['where','filters','pick','add','filter','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','merge','catch','body','find','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','end','error','name','send','index','CannedAnswer','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3027,0x12a));var _0x7302=function(_0x4290fd,_0x53b79d){_0x4290fd=_0x4290fd-0x0;var _0x5eab7a=_0x3027[_0x4290fd];return _0x5eab7a;};'use strict';var pdf=require(_0x7302('0x0'));var emlformat=require(_0x7302('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7302('0x2'));var rp=require('request-promise');var moment=require(_0x7302('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7302('0x4'));var path=require(_0x7302('0x5'));var sox=require(_0x7302('0x6'));var csv=require(_0x7302('0x7'));var ejs=require(_0x7302('0x8'));var fs=require('fs');var _=require(_0x7302('0x9'));var squel=require(_0x7302('0xa'));var crypto=require(_0x7302('0xb'));var jsforce=require(_0x7302('0xc'));var deskjs=require(_0x7302('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7302('0xe'));var Papa=require(_0x7302('0xf'));var Redis=require(_0x7302('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x7302('0x11'));var config=require(_0x7302('0x12'));var db=require(_0x7302('0x13'))['db'];function respondWithStatusCode(_0x4b962a,_0x530bd8){_0x530bd8=_0x530bd8||0xcc;return function(_0x2f4e46){if(_0x2f4e46){return _0x4b962a[_0x7302('0x14')](_0x530bd8);}return _0x4b962a[_0x7302('0x15')](_0x530bd8)['end']();};}function respondWithResult(_0x2bce79,_0x487e42){_0x487e42=_0x487e42||0xc8;return function(_0x102528){if(_0x102528){return _0x2bce79[_0x7302('0x15')](_0x487e42)[_0x7302('0x16')](_0x102528);}};}function respondWithFilteredResult(_0x12e4e8,_0x5d7869){return function(_0x3a0a42){if(_0x3a0a42){var _0x37c099=_0x3a0a42['count'],_0x2352f4=_0x5d7869[_0x7302('0x17')],_0x1741a4=_0x5d7869[_0x7302('0x17')]+_0x5d7869[_0x7302('0x18')],_0x22d918;if(_0x1741a4>=_0x37c099){_0x1741a4=_0x37c099;_0x22d918=0xc8;}else{_0x22d918=0xce;}_0x12e4e8[_0x7302('0x15')](_0x22d918);return _0x12e4e8['set'](_0x7302('0x19'),_0x2352f4+'-'+_0x1741a4+'/'+_0x37c099)[_0x7302('0x16')](_0x3a0a42);}return null;};}function patchUpdates(_0x56e77e){return function(_0x24ac9e){try{jsonpatch[_0x7302('0x1a')](_0x24ac9e,_0x56e77e,!![]);}catch(_0x352bc5){return BPromise[_0x7302('0x1b')](_0x352bc5);}return _0x24ac9e[_0x7302('0x1c')]();};}function saveUpdates(_0x1b35d6,_0x38633d){return function(_0x5417f8){if(_0x5417f8){return _0x5417f8[_0x7302('0x1d')](_0x1b35d6)[_0x7302('0x1e')](function(_0x5990ff){return _0x5990ff;});}return null;};}function removeEntity(_0x26014f,_0x1ce7e7){return function(_0x338948){if(_0x338948){return _0x338948[_0x7302('0x1f')]()[_0x7302('0x1e')](function(){var _0x49b111=_0x338948['get']({'plain':!![]});var _0xb233b8=_0x7302('0x20');return db[_0x7302('0x21')][_0x7302('0x1f')]({'where':{'type':_0xb233b8,'resourceId':_0x49b111['id']}})['then'](function(){return _0x338948;});})['then'](function(){_0x26014f[_0x7302('0x15')](0xcc)[_0x7302('0x22')]();});}};}function handleEntityNotFound(_0x52344a,_0x317f4b){return function(_0x5b9e7a){if(!_0x5b9e7a){_0x52344a['sendStatus'](0x194);}return _0x5b9e7a;};}function handleError(_0x38752d,_0x921fcd){_0x921fcd=_0x921fcd||0x1f4;return function(_0x3fa95b){logger[_0x7302('0x23')](_0x3fa95b['stack']);if(_0x3fa95b[_0x7302('0x24')]){delete _0x3fa95b[_0x7302('0x24')];}_0x38752d[_0x7302('0x15')](_0x921fcd)[_0x7302('0x25')](_0x3fa95b);};}exports[_0x7302('0x26')]=function(_0x29c795,_0xf8a35f){var _0x4ee063={},_0x566f1e={},_0x5d4c0f={'count':0x0,'rows':[]};var _0x4ff275=db[_0x7302('0x27')][_0x7302('0x28')];_0x566f1e[_0x7302('0x29')]=_[_0x7302('0x2a')](_0x4ff275);var _0x30ef32={'dateStart':_0x29c795[_0x7302('0x2b')][_0x7302('0x2c')],'dateEnd':_0x29c795[_0x7302('0x2b')]['dateEnd']};delete _0x29c795['query'][_0x7302('0x2c')];delete _0x29c795['query'][_0x7302('0x2d')];_0x566f1e[_0x7302('0x2b')]=_['keys'](_0x29c795[_0x7302('0x2b')]);_0x566f1e['filters']=_[_0x7302('0x2e')](_0x566f1e['model'],_0x566f1e[_0x7302('0x2b')]);_0x4ee063[_0x7302('0x2f')]=_[_0x7302('0x2e')](_0x566f1e[_0x7302('0x29')],qs[_0x7302('0x30')](_0x29c795[_0x7302('0x2b')][_0x7302('0x30')]));_0x4ee063[_0x7302('0x2f')]=_0x4ee063[_0x7302('0x2f')][_0x7302('0x31')]?_0x4ee063['attributes']:_0x566f1e[_0x7302('0x29')];if(!_0x29c795[_0x7302('0x2b')][_0x7302('0x32')](_0x7302('0x33'))){_0x4ee063[_0x7302('0x18')]=qs['limit'](_0x29c795[_0x7302('0x2b')][_0x7302('0x18')]);_0x4ee063[_0x7302('0x17')]=qs['offset'](_0x29c795[_0x7302('0x2b')][_0x7302('0x17')]);}_0x4ee063[_0x7302('0x34')]=qs[_0x7302('0x35')](_0x29c795[_0x7302('0x2b')][_0x7302('0x35')]);_0x4ee063[_0x7302('0x36')]=qs[_0x7302('0x37')](_[_0x7302('0x38')](_0x29c795[_0x7302('0x2b')],_0x566f1e[_0x7302('0x37')]));if(_0x30ef32[_0x7302('0x2c')]){if(_0x30ef32[_0x7302('0x2d')]){_0x30ef32[_0x7302('0x2d')]=moment(_0x30ef32[_0x7302('0x2d')])['add'](0x1,'day');}else{_0x30ef32[_0x7302('0x2d')]=moment(_0x30ef32['dateStart'])[_0x7302('0x39')](0x1,'day');}_['merge'](_0x4ee063[_0x7302('0x36')],{'createdAt':{'$gte':_0x30ef32[_0x7302('0x2c')],'$lte':_0x30ef32[_0x7302('0x2d')]}});}if(_0x29c795[_0x7302('0x2b')][_0x7302('0x3a')]){_0x4ee063[_0x7302('0x36')]=_['merge'](_0x4ee063[_0x7302('0x36')],{'$or':_['map'](_0x4ff275,function(_0xf0bab5){if(_0xf0bab5['type']['key']!==_0x7302('0x3b')){var _0x34d734={};_0x34d734[_0xf0bab5[_0x7302('0x3c')]]={'$like':'%'+_0x29c795[_0x7302('0x2b')][_0x7302('0x3a')]+'%'};return _0x34d734;}})});}_0x4ee063=_['merge']({},_0x4ee063,_0x29c795[_0x7302('0x3d')]);var _0x29f895={'where':_0x4ee063[_0x7302('0x36')]};return db[_0x7302('0x27')][_0x7302('0x3e')](_0x29f895)['then'](function(_0x3b6317){_0x5d4c0f['count']=_0x3b6317;if(_0x29c795['query'][_0x7302('0x3f')]){_0x4ee063[_0x7302('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7302('0x41')](_0x4ee063);})[_0x7302('0x1e')](function(_0x39e03b){_0x5d4c0f[_0x7302('0x42')]=_0x39e03b;return _0x5d4c0f;})['then'](respondWithFilteredResult(_0xf8a35f,_0x4ee063))['catch'](handleError(_0xf8a35f,null));};exports[_0x7302('0x43')]=function(_0x45d511,_0xa8f026){var _0x3b6ff3={'raw':!![],'where':{'id':_0x45d511['params']['id']}},_0x21b909={};_0x21b909[_0x7302('0x29')]=_[_0x7302('0x2a')](db[_0x7302('0x27')][_0x7302('0x28')]);_0x21b909['query']=_[_0x7302('0x2a')](_0x45d511['query']);_0x21b909['filters']=_[_0x7302('0x2e')](_0x21b909[_0x7302('0x29')],_0x21b909[_0x7302('0x2b')]);_0x3b6ff3[_0x7302('0x2f')]=_['intersection'](_0x21b909[_0x7302('0x29')],qs[_0x7302('0x30')](_0x45d511[_0x7302('0x2b')]['fields']));_0x3b6ff3[_0x7302('0x2f')]=_0x3b6ff3['attributes'][_0x7302('0x31')]?_0x3b6ff3['attributes']:_0x21b909[_0x7302('0x29')];if(_0x45d511[_0x7302('0x2b')][_0x7302('0x3f')]){_0x3b6ff3[_0x7302('0x40')]=[{'all':!![]}];}_0x3b6ff3=_[_0x7302('0x44')]({},_0x3b6ff3,_0x45d511[_0x7302('0x3d')]);return db[_0x7302('0x27')]['find'](_0x3b6ff3)[_0x7302('0x1e')](handleEntityNotFound(_0xa8f026,null))['then'](respondWithResult(_0xa8f026,null))[_0x7302('0x45')](handleError(_0xa8f026,null));};exports[_0x7302('0x1d')]=function(_0x6b964,_0x1def7d){if(_0x6b964[_0x7302('0x46')]['id']){delete _0x6b964['body']['id'];}return db[_0x7302('0x27')][_0x7302('0x47')]({'where':{'id':_0x6b964[_0x7302('0x48')]['id']}})[_0x7302('0x1e')](handleEntityNotFound(_0x1def7d,null))[_0x7302('0x1e')](saveUpdates(_0x6b964[_0x7302('0x46')],null))['then'](respondWithResult(_0x1def7d,null))['catch'](handleError(_0x1def7d,null));};exports['destroy']=function(_0x5c766f,_0x262621){return db[_0x7302('0x27')][_0x7302('0x47')]({'where':{'id':_0x5c766f[_0x7302('0x48')]['id']}})[_0x7302('0x1e')](handleEntityNotFound(_0x262621,null))[_0x7302('0x1e')](removeEntity(_0x262621,null))[_0x7302('0x45')](handleError(_0x262621,null));};exports[_0x7302('0x49')]=function(_0x22fd13,_0x499813){var _0x441ef5={'key':_0x22fd13[_0x7302('0x46')][_0x7302('0x4a')]};if(_0x22fd13[_0x7302('0x46')][_0x7302('0x4b')]){_0x441ef5[_0x7302('0x4b')]=_0x22fd13[_0x7302('0x46')][_0x7302('0x4b')];}else if(_0x22fd13[_0x7302('0x46')]['SmsAccountId']){_0x441ef5[_0x7302('0x4c')]=_0x22fd13[_0x7302('0x46')][_0x7302('0x4c')];}else if(_0x22fd13[_0x7302('0x46')][_0x7302('0x4d')]){_0x441ef5[_0x7302('0x4d')]=_0x22fd13[_0x7302('0x46')][_0x7302('0x4d')];}else if(_0x22fd13[_0x7302('0x46')]['ChatWebsiteId']){_0x441ef5['ChatWebsiteId']=_0x22fd13[_0x7302('0x46')][_0x7302('0x4e')];}return db[_0x7302('0x27')]['find']({'where':_0x441ef5})[_0x7302('0x1e')](function(_0x233eb8){if(_0x233eb8){throw new db[(_0x7302('0x4f'))]['ValidationError'](_0x7302('0x50'));}return db['CannedAnswer'][_0x7302('0x49')](_0x22fd13[_0x7302('0x46')]);})[_0x7302('0x1e')](function(_0x104794){var _0xbc67de=_0x22fd13[_0x7302('0x51')]['get']({'plain':!![]});if(!_0xbc67de)throw new Error(_0x7302('0x52'));if(_0xbc67de[_0x7302('0x53')]==='user'){var _0x4ef328=_0x104794[_0x7302('0x54')]({'plain':!![]});return db[_0x7302('0x55')][_0x7302('0x47')]({'where':{'name':_0x7302('0x20'),'userProfileId':_0xbc67de['userProfileId']},'raw':!![]})[_0x7302('0x1e')](function(_0x3f7abf){if(_0x3f7abf&&_0x3f7abf[_0x7302('0x56')]===0x0){return db[_0x7302('0x21')][_0x7302('0x49')]({'name':_0x4ef328[_0x7302('0x24')],'resourceId':_0x4ef328['id'],'type':_0x3f7abf['name'],'sectionId':_0x3f7abf['id']},{})[_0x7302('0x1e')](function(){return _0x104794;});}else{return _0x104794;}})[_0x7302('0x45')](function(_0xa13a2a){logger[_0x7302('0x23')](_0x7302('0x57'),_0xa13a2a);throw _0xa13a2a;});}return _0x104794;})[_0x7302('0x1e')](respondWithResult(_0x499813,0xc9))[_0x7302('0x45')](handleError(_0x499813,null));};
\ No newline at end of file
index e682ea1..3eea3b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33b6=['exports','define','CannedAnswer','tools_canned_answers','lodash','api','moment','bluebird','request-promise','./cannedAnswer.attributes'];(function(_0x506679,_0x5344af){var _0x53a5ab=function(_0xe56a97){while(--_0xe56a97){_0x506679['push'](_0x506679['shift']());}};_0x53a5ab(++_0x5344af);}(_0x33b6,0x180));var _0x633b=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0x33b6[_0x4854d6];return _0x3885c0;};'use strict';var _=require(_0x633b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x633b('0x1'));var moment=require(_0x633b('0x2'));var BPromise=require(_0x633b('0x3'));var rp=require(_0x633b('0x4'));var attributes=require(_0x633b('0x5'));module[_0x633b('0x6')]=function(_0x4ccfb3,_0x40dc62){return _0x4ccfb3[_0x633b('0x7')](_0x633b('0x8'),attributes,{'tableName':_0x633b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15ca=['lodash','../../config/logger','moment','request-promise','define','CannedAnswer','tools_canned_answers'];(function(_0x56a3c4,_0x19de32){var _0x406c59=function(_0x3dadae){while(--_0x3dadae){_0x56a3c4['push'](_0x56a3c4['shift']());}};_0x406c59(++_0x19de32);}(_0x15ca,0x188));var _0xa15c=function(_0x46b60b,_0x5220fc){_0x46b60b=_0x46b60b-0x0;var _0x521f11=_0x15ca[_0x46b60b];return _0x521f11;};'use strict';var _=require(_0xa15c('0x0'));var util=require('util');var logger=require(_0xa15c('0x1'))('api');var moment=require(_0xa15c('0x2'));var BPromise=require('bluebird');var rp=require(_0xa15c('0x3'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x19e70d,_0x122bce){return _0x19e70d[_0xa15c('0x4')](_0xa15c('0x5'),attributes,{'tableName':_0xa15c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 026c5ec..8d73322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x630c=['rpc','jayson/promise','request','then','info','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4bd46d,_0x3f80ce){var _0x317b11=function(_0x4000fe){while(--_0x4000fe){_0x4bd46d['push'](_0x4bd46d['shift']());}};_0x317b11(++_0x3f80ce);}(_0x630c,0x1db));var _0xc630=function(_0x2a96d4,_0x2a8ba4){_0x2a96d4=_0x2a96d4-0x0;var _0x48f70c=_0x630c[_0x2a96d4];return _0x48f70c;};'use strict';var _=require(_0xc630('0x0'));var util=require(_0xc630('0x1'));var moment=require(_0xc630('0x2'));var BPromise=require(_0xc630('0x3'));var rs=require(_0xc630('0x4'));var fs=require('fs');var Redis=require(_0xc630('0x5'));var db=require(_0xc630('0x6'))['db'];var utils=require(_0xc630('0x7'));var logger=require(_0xc630('0x8'))(_0xc630('0x9'));var config=require('../../config/environment');var jayson=require(_0xc630('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42ed5a,_0x41accd,_0x14f6e1){return new BPromise(function(_0x1cf8c4,_0x3cdcc0){return client[_0xc630('0xb')](_0x42ed5a,_0x14f6e1)[_0xc630('0xc')](function(_0x3d195c){logger[_0xc630('0xd')](_0xc630('0xe'),_0x41accd,'request\x20sent');logger[_0xc630('0xf')](_0xc630('0x10'),_0x41accd,_0xc630('0x11'),JSON[_0xc630('0x12')](_0x3d195c));if(_0x3d195c[_0xc630('0x13')]){if(_0x3d195c[_0xc630('0x13')]['code']===0x1f4){logger[_0xc630('0x13')](_0xc630('0xe'),_0x41accd,_0x3d195c[_0xc630('0x13')][_0xc630('0x14')]);return _0x3cdcc0(_0x3d195c[_0xc630('0x13')][_0xc630('0x14')]);}logger[_0xc630('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x41accd,_0x3d195c[_0xc630('0x13')][_0xc630('0x14')]);return _0x1cf8c4(_0x3d195c[_0xc630('0x13')]['message']);}else{logger[_0xc630('0xd')](_0xc630('0xe'),_0x41accd,_0xc630('0x11'));_0x1cf8c4(_0x3d195c['result'][_0xc630('0x14')]);}})[_0xc630('0x15')](function(_0x2bdc3b){logger['error'](_0xc630('0xe'),_0x41accd,_0x2bdc3b);_0x3cdcc0(_0x2bdc3b);});});}
\ No newline at end of file
+var _0x36c8=['../../config/environment','jayson/promise','client','http','request','then','CannedAnswer,\x20%s,\x20%s','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x65e216,_0x568bd5){var _0x4e3e06=function(_0x351fc0){while(--_0x351fc0){_0x65e216['push'](_0x65e216['shift']());}};_0x4e3e06(++_0x568bd5);}(_0x36c8,0x1ac));var _0x836c=function(_0x13c738,_0x30dee6){_0x13c738=_0x13c738-0x0;var _0x2248fc=_0x36c8[_0x13c738];return _0x2248fc;};'use strict';var _=require(_0x836c('0x0'));var util=require(_0x836c('0x1'));var moment=require(_0x836c('0x2'));var BPromise=require(_0x836c('0x3'));var rs=require(_0x836c('0x4'));var fs=require('fs');var Redis=require(_0x836c('0x5'));var db=require(_0x836c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x836c('0x7'))(_0x836c('0x8'));var config=require(_0x836c('0x9'));var jayson=require(_0x836c('0xa'));var client=jayson[_0x836c('0xb')][_0x836c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x85c76d,_0x48bc78,_0x13fda8){return new BPromise(function(_0x5b3c4c,_0x411f12){return client[_0x836c('0xd')](_0x85c76d,_0x13fda8)[_0x836c('0xe')](function(_0x2ae060){logger['info'](_0x836c('0xf'),_0x48bc78,'request\x20sent');logger['debug'](_0x836c('0x10'),_0x48bc78,'request\x20sent',JSON[_0x836c('0x11')](_0x2ae060));if(_0x2ae060['error']){if(_0x2ae060['error'][_0x836c('0x12')]===0x1f4){logger['error'](_0x836c('0xf'),_0x48bc78,_0x2ae060['error']['message']);return _0x411f12(_0x2ae060[_0x836c('0x13')][_0x836c('0x14')]);}logger[_0x836c('0x13')](_0x836c('0xf'),_0x48bc78,_0x2ae060[_0x836c('0x13')][_0x836c('0x14')]);return _0x5b3c4c(_0x2ae060[_0x836c('0x13')]['message']);}else{logger[_0x836c('0x15')](_0x836c('0xf'),_0x48bc78,_0x836c('0x16'));_0x5b3c4c(_0x2ae060['result']['message']);}})['catch'](function(_0x54b769){logger[_0x836c('0x13')](_0x836c('0xf'),_0x48bc78,_0x54b769);_0x411f12(_0x54b769);});});}
\ No newline at end of file
index 3bcd446..576809c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36c5=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x5066bc,_0x53217f){var _0x3f8297=function(_0x164afb){while(--_0x164afb){_0x5066bc['push'](_0x5066bc['shift']());}};_0x3f8297(++_0x53217f);}(_0x36c5,0xa4));var _0x536c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x536c('0x0'));var util=require(_0x536c('0x1'));var path=require(_0x536c('0x2'));var timeout=require(_0x536c('0x3'));var express=require('express');var router=express[_0x536c('0x4')]();var auth=require(_0x536c('0x5'));var interaction=require(_0x536c('0x6'));var config=require(_0x536c('0x7'));var controller=require(_0x536c('0x8'));router['get']('/',auth[_0x536c('0x9')](),controller[_0x536c('0xa')]);router[_0x536c('0xb')](_0x536c('0xc'),auth[_0x536c('0x9')](),controller[_0x536c('0xd')]);router[_0x536c('0xe')]('/',auth[_0x536c('0x9')](),controller['create']);router[_0x536c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x536c('0x10')]);router[_0x536c('0x11')](_0x536c('0xc'),auth['isAuthenticated'](),controller[_0x536c('0x12')]);module[_0x536c('0x13')]=router;
\ No newline at end of file
+var _0x2923=['show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x1a20bb,_0x1cb3d8){var _0x275dbd=function(_0x5f53f0){while(--_0x5f53f0){_0x1a20bb['push'](_0x1a20bb['shift']());}};_0x275dbd(++_0x1cb3d8);}(_0x2923,0x127));var _0x3292=function(_0x3fb31a,_0x3c590d){_0x3fb31a=_0x3fb31a-0x0;var _0x1edab2=_0x2923[_0x3fb31a];return _0x1edab2;};'use strict';var multer=require(_0x3292('0x0'));var util=require(_0x3292('0x1'));var path=require('path');var timeout=require(_0x3292('0x2'));var express=require(_0x3292('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3292('0x4'));var controller=require('./cannedAnswer.controller');router[_0x3292('0x5')]('/',auth[_0x3292('0x6')](),controller[_0x3292('0x7')]);router['get'](_0x3292('0x8'),auth[_0x3292('0x6')](),controller[_0x3292('0x9')]);router[_0x3292('0xa')]('/',auth[_0x3292('0x6')](),controller[_0x3292('0xb')]);router['put'](_0x3292('0x8'),auth['isAuthenticated'](),controller[_0x3292('0xc')]);router[_0x3292('0xd')]('/:id',auth[_0x3292('0x6')](),controller[_0x3292('0xe')]);module[_0x3292('0xf')]=router;
\ No newline at end of file
index f5188c5..6c23248 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d1=['INTEGER','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x176be1,_0x395190){var _0x2117df=function(_0x2ba5c6){while(--_0x2ba5c6){_0x176be1['push'](_0x176be1['shift']());}};_0x2117df(++_0x395190);}(_0x89d1,0x1ed));var _0x189d=function(_0xf0733c,_0x488a7e){_0xf0733c=_0xf0733c-0x0;var _0x328901=_0x89d1[_0xf0733c];return _0x328901;};'use strict';var Sequelize=require('sequelize');module[_0x189d('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x189d('0x1')},'clid':{'type':Sequelize[_0x189d('0x2')]},'src':{'type':Sequelize[_0x189d('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x189d('0x2')]},'channel':{'type':Sequelize[_0x189d('0x2')]},'dstchannel':{'type':Sequelize[_0x189d('0x2')]},'lastapp':{'type':Sequelize[_0x189d('0x2')]},'lastdata':{'type':Sequelize[_0x189d('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x189d('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x189d('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x189d('0x2')]},'sequence':{'type':Sequelize[_0x189d('0x2')]},'peeraccount':{'type':Sequelize[_0x189d('0x2')]},'type':{'type':Sequelize[_0x189d('0x2')]},'tag':{'type':Sequelize[_0x189d('0x2')]}};
\ No newline at end of file
+var _0x0d45=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x109b07,_0x2704ae){var _0x2f739e=function(_0x1685c3){while(--_0x1685c3){_0x109b07['push'](_0x109b07['shift']());}};_0x2f739e(++_0x2704ae);}(_0x0d45,0xa9));var _0x50d4=function(_0x473aff,_0x25b085){_0x473aff=_0x473aff-0x0;var _0xc3374c=_0x0d45[_0x473aff];return _0xc3374c;};'use strict';var Sequelize=require(_0x50d4('0x0'));module[_0x50d4('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x50d4('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x50d4('0x3')]},'duration':{'type':Sequelize[_0x50d4('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x50d4('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x50d4('0x3')]},'amaflags':{'type':Sequelize[_0x50d4('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x50d4('0x3')]},'uniqueid':{'type':Sequelize[_0x50d4('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x50d4('0x3')]},'peeraccount':{'type':Sequelize[_0x50d4('0x3')]},'type':{'type':Sequelize[_0x50d4('0x3')]},'tag':{'type':Sequelize[_0x50d4('0x3')]}};
\ No newline at end of file
index e753f17..c94e764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a3=['save','then','destroy','end','error','stack','name','send','index','Cdr','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','add','day','merge','map','VIRTUAL','field','filter','options','includeAll','findAll','catch','params','include','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','sendStatus','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x1b8e4d,_0xac40e8){var _0x462119=function(_0xba9338){while(--_0xba9338){_0x1b8e4d['push'](_0x1b8e4d['shift']());}};_0x462119(++_0xac40e8);}(_0x23a3,0x19d));var _0x323a=function(_0x54ab12,_0x2cc565){_0x54ab12=_0x54ab12-0x0;var _0x5e70a4=_0x23a3[_0x54ab12];return _0x5e70a4;};'use strict';var pdf=require(_0x323a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x323a('0x1'));var zipdir=require(_0x323a('0x2'));var jsonpatch=require(_0x323a('0x3'));var rp=require(_0x323a('0x4'));var moment=require(_0x323a('0x5'));var BPromise=require(_0x323a('0x6'));var Mustache=require(_0x323a('0x7'));var util=require(_0x323a('0x8'));var path=require(_0x323a('0x9'));var sox=require('sox');var csv=require(_0x323a('0xa'));var ejs=require(_0x323a('0xb'));var fs=require('fs');var _=require(_0x323a('0xc'));var squel=require(_0x323a('0xd'));var crypto=require(_0x323a('0xe'));var jsforce=require(_0x323a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x323a('0xa'));var querystring=require(_0x323a('0x10'));var Papa=require(_0x323a('0x11'));var Redis=require(_0x323a('0x12'));var qs=require(_0x323a('0x13'));var logger=require('../../config/logger')(_0x323a('0x14'));var utils=require(_0x323a('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ed4f1,_0x528b1a){_0x528b1a=_0x528b1a||0xcc;return function(_0x254ec3){if(_0x254ec3){return _0x4ed4f1[_0x323a('0x16')](_0x528b1a);}return _0x4ed4f1[_0x323a('0x17')](_0x528b1a)['end']();};}function respondWithResult(_0x4f4cfd,_0x57c3a9){_0x57c3a9=_0x57c3a9||0xc8;return function(_0x1d7519){if(_0x1d7519){return _0x4f4cfd['status'](_0x57c3a9)[_0x323a('0x18')](_0x1d7519);}};}function respondWithFilteredResult(_0x5700f7,_0x55a3c3){return function(_0x2a9443){if(_0x2a9443){var _0xb778b5=_0x2a9443[_0x323a('0x19')],_0x52f567=_0x55a3c3[_0x323a('0x1a')],_0x342208=_0x55a3c3[_0x323a('0x1a')]+_0x55a3c3['limit'],_0x3a7802;if(_0x342208>=_0xb778b5){_0x342208=_0xb778b5;_0x3a7802=0xc8;}else{_0x3a7802=0xce;}_0x5700f7[_0x323a('0x17')](_0x3a7802);return _0x5700f7[_0x323a('0x1b')](_0x323a('0x1c'),_0x52f567+'-'+_0x342208+'/'+_0xb778b5)[_0x323a('0x18')](_0x2a9443);}return null;};}function patchUpdates(_0x3e3d07){return function(_0x50d2f0){try{jsonpatch[_0x323a('0x1d')](_0x50d2f0,_0x3e3d07,!![]);}catch(_0x38f194){return BPromise[_0x323a('0x1e')](_0x38f194);}return _0x50d2f0[_0x323a('0x1f')]();};}function saveUpdates(_0x3c0caf,_0x7ab579){return function(_0xd5c31b){if(_0xd5c31b){return _0xd5c31b['update'](_0x3c0caf)[_0x323a('0x20')](function(_0x544264){return _0x544264;});}return null;};}function removeEntity(_0xd13e03,_0x1f2273){return function(_0x3094cf){if(_0x3094cf){return _0x3094cf[_0x323a('0x21')]()['then'](function(){_0xd13e03['status'](0xcc)[_0x323a('0x22')]();});}};}function handleEntityNotFound(_0xa03088,_0x3abd12){return function(_0x5ce661){if(!_0x5ce661){_0xa03088[_0x323a('0x16')](0x194);}return _0x5ce661;};}function handleError(_0x212a76,_0x575ac4){_0x575ac4=_0x575ac4||0x1f4;return function(_0x6e342a){logger[_0x323a('0x23')](_0x6e342a[_0x323a('0x24')]);if(_0x6e342a[_0x323a('0x25')]){delete _0x6e342a['name'];}_0x212a76['status'](_0x575ac4)[_0x323a('0x26')](_0x6e342a);};}exports[_0x323a('0x27')]=function(_0x16436b,_0x27294f){var _0x5aa56d={},_0x2ae4e0={},_0x1816ef={'count':0x0,'rows':[]};var _0x5a7b2a=db[_0x323a('0x28')][_0x323a('0x29')];_0x2ae4e0[_0x323a('0x2a')]=_[_0x323a('0x2b')](_0x5a7b2a);var _0x1805a9={'dateStart':_0x16436b[_0x323a('0x2c')][_0x323a('0x2d')],'dateEnd':_0x16436b[_0x323a('0x2c')][_0x323a('0x2e')]};delete _0x16436b[_0x323a('0x2c')][_0x323a('0x2d')];delete _0x16436b['query'][_0x323a('0x2e')];_0x2ae4e0[_0x323a('0x2c')]=_[_0x323a('0x2b')](_0x16436b[_0x323a('0x2c')]);_0x2ae4e0[_0x323a('0x2f')]=_[_0x323a('0x30')](_0x2ae4e0[_0x323a('0x2a')],_0x2ae4e0['query']);_0x5aa56d[_0x323a('0x31')]=_[_0x323a('0x30')](_0x2ae4e0[_0x323a('0x2a')],qs[_0x323a('0x32')](_0x16436b[_0x323a('0x2c')][_0x323a('0x32')]));_0x5aa56d[_0x323a('0x31')]=_0x5aa56d['attributes'][_0x323a('0x33')]?_0x5aa56d[_0x323a('0x31')]:_0x2ae4e0[_0x323a('0x2a')];if(!_0x16436b[_0x323a('0x2c')][_0x323a('0x34')]('nolimit')){_0x5aa56d[_0x323a('0x35')]=qs[_0x323a('0x35')](_0x16436b[_0x323a('0x2c')]['limit']);_0x5aa56d[_0x323a('0x1a')]=qs[_0x323a('0x1a')](_0x16436b['query'][_0x323a('0x1a')]);}_0x5aa56d['order']=qs['sort'](_0x16436b[_0x323a('0x2c')][_0x323a('0x36')]);_0x5aa56d[_0x323a('0x37')]=qs['filters'](_['pick'](_0x16436b[_0x323a('0x2c')],_0x2ae4e0[_0x323a('0x2f')]));if(_0x1805a9[_0x323a('0x2d')]){if(_0x1805a9['dateEnd']){_0x1805a9[_0x323a('0x2e')]=moment(_0x1805a9[_0x323a('0x2e')])[_0x323a('0x38')](0x1,_0x323a('0x39'));}else{_0x1805a9[_0x323a('0x2e')]=moment(_0x1805a9[_0x323a('0x2d')])[_0x323a('0x38')](0x1,'day');}_['merge'](_0x5aa56d[_0x323a('0x37')],{'createdAt':{'$gte':_0x1805a9['dateStart'],'$lte':_0x1805a9['dateEnd']}});}if(_0x16436b[_0x323a('0x2c')]['filter']){_0x5aa56d[_0x323a('0x37')]=_[_0x323a('0x3a')](_0x5aa56d[_0x323a('0x37')],{'$or':_[_0x323a('0x3b')](_0x5a7b2a,function(_0x12bb16){if(_0x12bb16['type']['key']!==_0x323a('0x3c')){var _0x252aa4={};_0x252aa4[_0x12bb16[_0x323a('0x3d')]]={'$like':'%'+_0x16436b['query'][_0x323a('0x3e')]+'%'};return _0x252aa4;}})});}_0x5aa56d=_['merge']({},_0x5aa56d,_0x16436b[_0x323a('0x3f')]);var _0x27e909={'where':_0x5aa56d[_0x323a('0x37')]};return db[_0x323a('0x28')]['count'](_0x27e909)[_0x323a('0x20')](function(_0x52cbf3){_0x1816ef[_0x323a('0x19')]=_0x52cbf3;if(_0x16436b[_0x323a('0x2c')][_0x323a('0x40')]){_0x5aa56d['include']=[{'all':!![]}];}return db[_0x323a('0x28')][_0x323a('0x41')](_0x5aa56d);})[_0x323a('0x20')](function(_0x3e9bcd){_0x1816ef['rows']=_0x3e9bcd;return _0x1816ef;})[_0x323a('0x20')](respondWithFilteredResult(_0x27294f,_0x5aa56d))[_0x323a('0x42')](handleError(_0x27294f,null));};exports['show']=function(_0x274846,_0x32a901){var _0x2de980={'raw':!![],'where':{'id':_0x274846[_0x323a('0x43')]['id']}},_0x32b7d6={};_0x32b7d6[_0x323a('0x2a')]=_[_0x323a('0x2b')](db['Cdr'][_0x323a('0x29')]);_0x32b7d6[_0x323a('0x2c')]=_[_0x323a('0x2b')](_0x274846['query']);_0x32b7d6[_0x323a('0x2f')]=_[_0x323a('0x30')](_0x32b7d6[_0x323a('0x2a')],_0x32b7d6[_0x323a('0x2c')]);_0x2de980[_0x323a('0x31')]=_[_0x323a('0x30')](_0x32b7d6[_0x323a('0x2a')],qs[_0x323a('0x32')](_0x274846[_0x323a('0x2c')][_0x323a('0x32')]));_0x2de980['attributes']=_0x2de980[_0x323a('0x31')]['length']?_0x2de980['attributes']:_0x32b7d6[_0x323a('0x2a')];if(_0x274846[_0x323a('0x2c')][_0x323a('0x40')]){_0x2de980[_0x323a('0x44')]=[{'all':!![]}];}_0x2de980=_[_0x323a('0x3a')]({},_0x2de980,_0x274846[_0x323a('0x3f')]);return db[_0x323a('0x28')][_0x323a('0x45')](_0x2de980)['then'](handleEntityNotFound(_0x32a901,null))[_0x323a('0x20')](respondWithResult(_0x32a901,null))[_0x323a('0x42')](handleError(_0x32a901,null));};exports[_0x323a('0x46')]=function(_0x202aaa,_0xca8cbc){return db[_0x323a('0x28')][_0x323a('0x46')](_0x202aaa[_0x323a('0x47')],{})[_0x323a('0x20')](respondWithResult(_0xca8cbc,0xc9))['catch'](handleError(_0xca8cbc,null));};exports[_0x323a('0x48')]=function(_0x1194a2,_0x2445cb){if(_0x1194a2[_0x323a('0x47')]['id']){delete _0x1194a2[_0x323a('0x47')]['id'];}return db['Cdr']['find']({'where':{'id':_0x1194a2['params']['id']}})[_0x323a('0x20')](handleEntityNotFound(_0x2445cb,null))[_0x323a('0x20')](saveUpdates(_0x1194a2[_0x323a('0x47')],null))[_0x323a('0x20')](respondWithResult(_0x2445cb,null))['catch'](handleError(_0x2445cb,null));};exports[_0x323a('0x21')]=function(_0x4cc78c,_0x2eb52d){return db[_0x323a('0x28')]['find']({'where':{'id':_0x4cc78c[_0x323a('0x43')]['id']}})[_0x323a('0x20')](handleEntityNotFound(_0x2eb52d,null))['then'](removeEntity(_0x2eb52d,null))['catch'](handleError(_0x2eb52d,null));};exports[_0x323a('0x49')]=function(_0x1b25e5,_0x3edf33){return db['Cdr'][_0x323a('0x49')]()[_0x323a('0x20')](respondWithResult(_0x3edf33,null))['catch'](handleError(_0x3edf33,null));};
\ No newline at end of file
+var _0x176d=['catch','params','length','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','update','then','destroy','error','stack','name','send','Cdr','rawAttributes','model','query','dateStart','dateEnd','keys','filters','attributes','intersection','fields','hasOwnProperty','order','where','pick','add','day','merge','type','key','VIRTUAL','field','filter','includeAll','include','rows'];(function(_0x4e6e98,_0x179c06){var _0x2ef31a=function(_0x583c65){while(--_0x583c65){_0x4e6e98['push'](_0x4e6e98['shift']());}};_0x2ef31a(++_0x179c06);}(_0x176d,0x1ab));var _0xd176=function(_0x35e17a,_0x25cbbf){_0x35e17a=_0x35e17a-0x0;var _0x59ba73=_0x176d[_0x35e17a];return _0x59ba73;};'use strict';var pdf=require(_0xd176('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd176('0x1'));var jsonpatch=require(_0xd176('0x2'));var rp=require(_0xd176('0x3'));var moment=require(_0xd176('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd176('0x5'));var util=require(_0xd176('0x6'));var path=require('path');var sox=require(_0xd176('0x7'));var csv=require(_0xd176('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd176('0x9'));var squel=require(_0xd176('0xa'));var crypto=require(_0xd176('0xb'));var jsforce=require(_0xd176('0xc'));var deskjs=require(_0xd176('0xd'));var toCsv=require(_0xd176('0x8'));var querystring=require('querystring');var Papa=require(_0xd176('0xe'));var Redis=require('ioredis');var qs=require(_0xd176('0xf'));var logger=require(_0xd176('0x10'))(_0xd176('0x11'));var utils=require(_0xd176('0x12'));var config=require(_0xd176('0x13'));var db=require(_0xd176('0x14'))['db'];function respondWithStatusCode(_0x4911df,_0x4a9859){_0x4a9859=_0x4a9859||0xcc;return function(_0xa53df3){if(_0xa53df3){return _0x4911df[_0xd176('0x15')](_0x4a9859);}return _0x4911df[_0xd176('0x16')](_0x4a9859)[_0xd176('0x17')]();};}function respondWithResult(_0x45a107,_0x52b9df){_0x52b9df=_0x52b9df||0xc8;return function(_0x18514c){if(_0x18514c){return _0x45a107[_0xd176('0x16')](_0x52b9df)['json'](_0x18514c);}};}function respondWithFilteredResult(_0x5490e4,_0x4d3913){return function(_0x104ddf){if(_0x104ddf){var _0x2f4085=_0x104ddf[_0xd176('0x18')],_0x5c04c5=_0x4d3913[_0xd176('0x19')],_0x16b8ab=_0x4d3913[_0xd176('0x19')]+_0x4d3913[_0xd176('0x1a')],_0x8882e6;if(_0x16b8ab>=_0x2f4085){_0x16b8ab=_0x2f4085;_0x8882e6=0xc8;}else{_0x8882e6=0xce;}_0x5490e4[_0xd176('0x16')](_0x8882e6);return _0x5490e4[_0xd176('0x1b')]('Content-Range',_0x5c04c5+'-'+_0x16b8ab+'/'+_0x2f4085)[_0xd176('0x1c')](_0x104ddf);}return null;};}function patchUpdates(_0x143f9f){return function(_0x261c85){try{jsonpatch[_0xd176('0x1d')](_0x261c85,_0x143f9f,!![]);}catch(_0x2934f0){return BPromise['reject'](_0x2934f0);}return _0x261c85['save']();};}function saveUpdates(_0x28104b,_0x12a32f){return function(_0x3a73b9){if(_0x3a73b9){return _0x3a73b9[_0xd176('0x1e')](_0x28104b)[_0xd176('0x1f')](function(_0x3ca6c0){return _0x3ca6c0;});}return null;};}function removeEntity(_0x20355a,_0x588642){return function(_0x1b72df){if(_0x1b72df){return _0x1b72df[_0xd176('0x20')]()[_0xd176('0x1f')](function(){_0x20355a[_0xd176('0x16')](0xcc)[_0xd176('0x17')]();});}};}function handleEntityNotFound(_0x2fcf6f,_0x878dd3){return function(_0x5927f6){if(!_0x5927f6){_0x2fcf6f[_0xd176('0x15')](0x194);}return _0x5927f6;};}function handleError(_0x1c5172,_0x4dbe47){_0x4dbe47=_0x4dbe47||0x1f4;return function(_0x4422e2){logger[_0xd176('0x21')](_0x4422e2[_0xd176('0x22')]);if(_0x4422e2[_0xd176('0x23')]){delete _0x4422e2[_0xd176('0x23')];}_0x1c5172[_0xd176('0x16')](_0x4dbe47)[_0xd176('0x24')](_0x4422e2);};}exports['index']=function(_0x381171,_0x782032){var _0xff7fbc={},_0x50978b={},_0x276d7e={'count':0x0,'rows':[]};var _0x78b501=db[_0xd176('0x25')][_0xd176('0x26')];_0x50978b[_0xd176('0x27')]=_['keys'](_0x78b501);var _0x550fec={'dateStart':_0x381171[_0xd176('0x28')][_0xd176('0x29')],'dateEnd':_0x381171[_0xd176('0x28')][_0xd176('0x2a')]};delete _0x381171[_0xd176('0x28')][_0xd176('0x29')];delete _0x381171['query'][_0xd176('0x2a')];_0x50978b[_0xd176('0x28')]=_[_0xd176('0x2b')](_0x381171[_0xd176('0x28')]);_0x50978b[_0xd176('0x2c')]=_['intersection'](_0x50978b['model'],_0x50978b[_0xd176('0x28')]);_0xff7fbc[_0xd176('0x2d')]=_[_0xd176('0x2e')](_0x50978b[_0xd176('0x27')],qs[_0xd176('0x2f')](_0x381171['query'][_0xd176('0x2f')]));_0xff7fbc['attributes']=_0xff7fbc[_0xd176('0x2d')]['length']?_0xff7fbc['attributes']:_0x50978b[_0xd176('0x27')];if(!_0x381171[_0xd176('0x28')][_0xd176('0x30')]('nolimit')){_0xff7fbc[_0xd176('0x1a')]=qs[_0xd176('0x1a')](_0x381171['query'][_0xd176('0x1a')]);_0xff7fbc[_0xd176('0x19')]=qs[_0xd176('0x19')](_0x381171[_0xd176('0x28')][_0xd176('0x19')]);}_0xff7fbc[_0xd176('0x31')]=qs['sort'](_0x381171[_0xd176('0x28')]['sort']);_0xff7fbc[_0xd176('0x32')]=qs[_0xd176('0x2c')](_[_0xd176('0x33')](_0x381171[_0xd176('0x28')],_0x50978b[_0xd176('0x2c')]));if(_0x550fec[_0xd176('0x29')]){if(_0x550fec[_0xd176('0x2a')]){_0x550fec['dateEnd']=moment(_0x550fec[_0xd176('0x2a')])[_0xd176('0x34')](0x1,_0xd176('0x35'));}else{_0x550fec[_0xd176('0x2a')]=moment(_0x550fec['dateStart'])[_0xd176('0x34')](0x1,_0xd176('0x35'));}_['merge'](_0xff7fbc[_0xd176('0x32')],{'createdAt':{'$gte':_0x550fec[_0xd176('0x29')],'$lte':_0x550fec['dateEnd']}});}if(_0x381171[_0xd176('0x28')]['filter']){_0xff7fbc[_0xd176('0x32')]=_[_0xd176('0x36')](_0xff7fbc[_0xd176('0x32')],{'$or':_['map'](_0x78b501,function(_0xc5c38b){if(_0xc5c38b[_0xd176('0x37')][_0xd176('0x38')]!==_0xd176('0x39')){var _0x349c3a={};_0x349c3a[_0xc5c38b[_0xd176('0x3a')]]={'$like':'%'+_0x381171[_0xd176('0x28')][_0xd176('0x3b')]+'%'};return _0x349c3a;}})});}_0xff7fbc=_[_0xd176('0x36')]({},_0xff7fbc,_0x381171['options']);var _0x453597={'where':_0xff7fbc[_0xd176('0x32')]};return db['Cdr'][_0xd176('0x18')](_0x453597)['then'](function(_0x5c61d8){_0x276d7e[_0xd176('0x18')]=_0x5c61d8;if(_0x381171[_0xd176('0x28')][_0xd176('0x3c')]){_0xff7fbc[_0xd176('0x3d')]=[{'all':!![]}];}return db[_0xd176('0x25')]['findAll'](_0xff7fbc);})[_0xd176('0x1f')](function(_0x2e0642){_0x276d7e[_0xd176('0x3e')]=_0x2e0642;return _0x276d7e;})[_0xd176('0x1f')](respondWithFilteredResult(_0x782032,_0xff7fbc))[_0xd176('0x3f')](handleError(_0x782032,null));};exports['show']=function(_0x1caf65,_0x48dca6){var _0x168dde={'raw':!![],'where':{'id':_0x1caf65[_0xd176('0x40')]['id']}},_0x478cec={};_0x478cec[_0xd176('0x27')]=_[_0xd176('0x2b')](db[_0xd176('0x25')][_0xd176('0x26')]);_0x478cec[_0xd176('0x28')]=_[_0xd176('0x2b')](_0x1caf65[_0xd176('0x28')]);_0x478cec[_0xd176('0x2c')]=_[_0xd176('0x2e')](_0x478cec[_0xd176('0x27')],_0x478cec[_0xd176('0x28')]);_0x168dde[_0xd176('0x2d')]=_[_0xd176('0x2e')](_0x478cec[_0xd176('0x27')],qs[_0xd176('0x2f')](_0x1caf65[_0xd176('0x28')][_0xd176('0x2f')]));_0x168dde[_0xd176('0x2d')]=_0x168dde['attributes'][_0xd176('0x41')]?_0x168dde[_0xd176('0x2d')]:_0x478cec[_0xd176('0x27')];if(_0x1caf65[_0xd176('0x28')][_0xd176('0x3c')]){_0x168dde['include']=[{'all':!![]}];}_0x168dde=_[_0xd176('0x36')]({},_0x168dde,_0x1caf65['options']);return db[_0xd176('0x25')][_0xd176('0x42')](_0x168dde)['then'](handleEntityNotFound(_0x48dca6,null))[_0xd176('0x1f')](respondWithResult(_0x48dca6,null))['catch'](handleError(_0x48dca6,null));};exports[_0xd176('0x43')]=function(_0x5211f1,_0x2a879d){return db[_0xd176('0x25')][_0xd176('0x43')](_0x5211f1[_0xd176('0x44')],{})['then'](respondWithResult(_0x2a879d,0xc9))['catch'](handleError(_0x2a879d,null));};exports[_0xd176('0x1e')]=function(_0x4d7090,_0x18ed64){if(_0x4d7090[_0xd176('0x44')]['id']){delete _0x4d7090['body']['id'];}return db[_0xd176('0x25')]['find']({'where':{'id':_0x4d7090[_0xd176('0x40')]['id']}})[_0xd176('0x1f')](handleEntityNotFound(_0x18ed64,null))[_0xd176('0x1f')](saveUpdates(_0x4d7090[_0xd176('0x44')],null))[_0xd176('0x1f')](respondWithResult(_0x18ed64,null))['catch'](handleError(_0x18ed64,null));};exports[_0xd176('0x20')]=function(_0xd02a7,_0x5abada){return db['Cdr'][_0xd176('0x42')]({'where':{'id':_0xd02a7[_0xd176('0x40')]['id']}})[_0xd176('0x1f')](handleEntityNotFound(_0x5abada,null))['then'](removeEntity(_0x5abada,null))['catch'](handleError(_0x5abada,null));};exports[_0xd176('0x45')]=function(_0x2d7033,_0x1ffef3){return db[_0xd176('0x25')]['describe']()['then'](respondWithResult(_0x1ffef3,null))['catch'](handleError(_0x1ffef3,null));};
\ No newline at end of file
index e15b3b1..1203c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc928=['calldate','disposition','dst','src','uniqueid','lodash','util','api','moment','request-promise','./cdr.attributes','exports','accountcode'];(function(_0x339923,_0xafb4b5){var _0x5008b8=function(_0x425082){while(--_0x425082){_0x339923['push'](_0x339923['shift']());}};_0x5008b8(++_0xafb4b5);}(_0xc928,0x13d));var _0x8c92=function(_0x101524,_0x44d95a){_0x101524=_0x101524-0x0;var _0x1ad131=_0xc928[_0x101524];return _0x1ad131;};'use strict';var _=require(_0x8c92('0x0'));var util=require(_0x8c92('0x1'));var logger=require('../../config/logger')(_0x8c92('0x2'));var moment=require(_0x8c92('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c92('0x4'));var attributes=require(_0x8c92('0x5'));module[_0x8c92('0x6')]=function(_0x4a7600,_0x3878e3){return _0x4a7600['define']('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x8c92('0x7')]},{'name':_0x8c92('0x8'),'fields':[_0x8c92('0x8')]},{'name':_0x8c92('0x9'),'fields':[_0x8c92('0x9')]},{'name':_0x8c92('0xa'),'fields':[_0x8c92('0xa')]},{'name':_0x8c92('0xb'),'fields':['src']},{'name':'uniqueid','fields':[_0x8c92('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x950e=['disposition','src','uniqueid','lodash','../../config/logger','api','moment','bluebird','exports','define','Cdr','cdr','accountcode','calldate'];(function(_0x12d9cf,_0xbe11f4){var _0x56e9fe=function(_0x576abb){while(--_0x576abb){_0x12d9cf['push'](_0x12d9cf['shift']());}};_0x56e9fe(++_0xbe11f4);}(_0x950e,0x1c3));var _0xe950=function(_0x46728b,_0x376bc6){_0x46728b=_0x46728b-0x0;var _0x5aa8e2=_0x950e[_0x46728b];return _0x5aa8e2;};'use strict';var _=require(_0xe950('0x0'));var util=require('util');var logger=require(_0xe950('0x1'))(_0xe950('0x2'));var moment=require(_0xe950('0x3'));var BPromise=require(_0xe950('0x4'));var rp=require('request-promise');var attributes=require('./cdr.attributes');module[_0xe950('0x5')]=function(_0x38b517,_0x43d30a){return _0x38b517[_0xe950('0x6')](_0xe950('0x7'),attributes,{'tableName':_0xe950('0x8'),'paranoid':![],'indexes':[{'name':_0xe950('0x9'),'fields':[_0xe950('0x9')]},{'name':_0xe950('0xa'),'fields':['calldate']},{'name':_0xe950('0xb'),'fields':[_0xe950('0xb')]},{'name':'dst','fields':['dst']},{'name':'src','fields':[_0xe950('0xc')]},{'name':'uniqueid','fields':[_0xe950('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index 5eee55b..7e5c037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd084=['request\x20sent','debug','stringify','error','code','message','info','result','lodash','moment','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s'];(function(_0x8ffcf,_0x331803){var _0x565137=function(_0xf74a2){while(--_0xf74a2){_0x8ffcf['push'](_0x8ffcf['shift']());}};_0x565137(++_0x331803);}(_0xd084,0x138));var _0x4d08=function(_0x27b0c4,_0x17192c){_0x27b0c4=_0x27b0c4-0x0;var _0xb66ebb=_0xd084[_0x27b0c4];return _0xb66ebb;};'use strict';var _=require(_0x4d08('0x0'));var util=require('util');var moment=require(_0x4d08('0x1'));var BPromise=require('bluebird');var rs=require(_0x4d08('0x2'));var fs=require('fs');var Redis=require(_0x4d08('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4d08('0x4'));var config=require('../../config/environment');var jayson=require(_0x4d08('0x5'));var client=jayson[_0x4d08('0x6')][_0x4d08('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fac47,_0x3c4f31,_0x332828){return new BPromise(function(_0x54125f,_0x3a1644){return client[_0x4d08('0x8')](_0x2fac47,_0x332828)[_0x4d08('0x9')](function(_0x1c6f4f){logger['info'](_0x4d08('0xa'),_0x3c4f31,_0x4d08('0xb'));logger[_0x4d08('0xc')]('Cdr,\x20%s,\x20%s,\x20%s',_0x3c4f31,_0x4d08('0xb'),JSON[_0x4d08('0xd')](_0x1c6f4f));if(_0x1c6f4f[_0x4d08('0xe')]){if(_0x1c6f4f[_0x4d08('0xe')][_0x4d08('0xf')]===0x1f4){logger[_0x4d08('0xe')](_0x4d08('0xa'),_0x3c4f31,_0x1c6f4f['error'][_0x4d08('0x10')]);return _0x3a1644(_0x1c6f4f[_0x4d08('0xe')]['message']);}logger[_0x4d08('0xe')](_0x4d08('0xa'),_0x3c4f31,_0x1c6f4f[_0x4d08('0xe')][_0x4d08('0x10')]);return _0x54125f(_0x1c6f4f[_0x4d08('0xe')][_0x4d08('0x10')]);}else{logger[_0x4d08('0x11')](_0x4d08('0xa'),_0x3c4f31,_0x4d08('0xb'));_0x54125f(_0x1c6f4f[_0x4d08('0x12')]['message']);}})['catch'](function(_0x3e90df){logger[_0x4d08('0xe')](_0x4d08('0xa'),_0x3c4f31,_0x3e90df);_0x3a1644(_0x3e90df);});});}
\ No newline at end of file
+var _0x29cd=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util'];(function(_0x5d1e3a,_0x3b1829){var _0x3dca32=function(_0x5278d8){while(--_0x5278d8){_0x5d1e3a['push'](_0x5d1e3a['shift']());}};_0x3dca32(++_0x3b1829);}(_0x29cd,0x1e1));var _0xd29c=function(_0xa34ab2,_0x330c61){_0xa34ab2=_0xa34ab2-0x0;var _0x1b665b=_0x29cd[_0xa34ab2];return _0x1b665b;};'use strict';var _=require(_0xd29c('0x0'));var util=require(_0xd29c('0x1'));var moment=require(_0xd29c('0x2'));var BPromise=require('bluebird');var rs=require(_0xd29c('0x3'));var fs=require('fs');var Redis=require(_0xd29c('0x4'));var db=require(_0xd29c('0x5'))['db'];var utils=require(_0xd29c('0x6'));var logger=require(_0xd29c('0x7'))(_0xd29c('0x8'));var config=require(_0xd29c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd29c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x445982,_0x1039c3,_0x36be6c){return new BPromise(function(_0x43a58a,_0x6624d2){return client[_0xd29c('0xb')](_0x445982,_0x36be6c)['then'](function(_0x43bb01){logger['info'](_0xd29c('0xc'),_0x1039c3,_0xd29c('0xd'));logger['debug'](_0xd29c('0xe'),_0x1039c3,_0xd29c('0xd'),JSON[_0xd29c('0xf')](_0x43bb01));if(_0x43bb01[_0xd29c('0x10')]){if(_0x43bb01[_0xd29c('0x10')]['code']===0x1f4){logger[_0xd29c('0x10')](_0xd29c('0xc'),_0x1039c3,_0x43bb01['error'][_0xd29c('0x11')]);return _0x6624d2(_0x43bb01['error'][_0xd29c('0x11')]);}logger[_0xd29c('0x10')](_0xd29c('0xc'),_0x1039c3,_0x43bb01[_0xd29c('0x10')][_0xd29c('0x11')]);return _0x43a58a(_0x43bb01['error']['message']);}else{logger[_0xd29c('0x12')](_0xd29c('0xc'),_0x1039c3,_0xd29c('0xd'));_0x43a58a(_0x43bb01[_0xd29c('0x13')][_0xd29c('0x11')]);}})[_0xd29c('0x14')](function(_0x55e1eb){logger['error']('Cdr,\x20%s,\x20%s',_0x1039c3,_0x55e1eb);_0x6624d2(_0x55e1eb);});});}
\ No newline at end of file
index 0908d36..c8c8d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceef=['index','/describe','describe','/:id','show','post','create','update','delete','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated'];(function(_0x3217d3,_0xf66fcf){var _0x260f43=function(_0x2b4a34){while(--_0x2b4a34){_0x3217d3['push'](_0x3217d3['shift']());}};_0x260f43(++_0xf66fcf);}(_0xceef,0xdb));var _0xfcee=function(_0x127ed7,_0x18c2c5){_0x127ed7=_0x127ed7-0x0;var _0x17c7bb=_0xceef[_0x127ed7];return _0x17c7bb;};'use strict';var multer=require('multer');var util=require(_0xfcee('0x0'));var path=require('path');var timeout=require(_0xfcee('0x1'));var express=require(_0xfcee('0x2'));var router=express['Router']();var auth=require(_0xfcee('0x3'));var interaction=require(_0xfcee('0x4'));var config=require(_0xfcee('0x5'));var controller=require(_0xfcee('0x6'));router[_0xfcee('0x7')]('/',auth[_0xfcee('0x8')](),controller[_0xfcee('0x9')]);router[_0xfcee('0x7')](_0xfcee('0xa'),auth[_0xfcee('0x8')](),controller[_0xfcee('0xb')]);router[_0xfcee('0x7')](_0xfcee('0xc'),auth[_0xfcee('0x8')](),controller[_0xfcee('0xd')]);router[_0xfcee('0xe')]('/',auth[_0xfcee('0x8')](),controller[_0xfcee('0xf')]);router['put'](_0xfcee('0xc'),auth[_0xfcee('0x8')](),controller[_0xfcee('0x10')]);router[_0xfcee('0x11')](_0xfcee('0xc'),auth[_0xfcee('0x8')](),controller['destroy']);module[_0xfcee('0x12')]=router;
\ No newline at end of file
+var _0x2865=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x27ad3e,_0x15f1a8){var _0x1777bd=function(_0x124f31){while(--_0x124f31){_0x27ad3e['push'](_0x27ad3e['shift']());}};_0x1777bd(++_0x15f1a8);}(_0x2865,0x1b0));var _0x5286=function(_0x3f4242,_0xf8c1e4){_0x3f4242=_0x3f4242-0x0;var _0x1a4183=_0x2865[_0x3f4242];return _0x1a4183;};'use strict';var multer=require('multer');var util=require(_0x5286('0x0'));var path=require(_0x5286('0x1'));var timeout=require(_0x5286('0x2'));var express=require(_0x5286('0x3'));var router=express[_0x5286('0x4')]();var auth=require(_0x5286('0x5'));var interaction=require(_0x5286('0x6'));var config=require(_0x5286('0x7'));var controller=require('./cdr.controller');router['get']('/',auth[_0x5286('0x8')](),controller[_0x5286('0x9')]);router[_0x5286('0xa')](_0x5286('0xb'),auth['isAuthenticated'](),controller[_0x5286('0xc')]);router[_0x5286('0xa')](_0x5286('0xd'),auth[_0x5286('0x8')](),controller[_0x5286('0xe')]);router[_0x5286('0xf')]('/',auth['isAuthenticated'](),controller[_0x5286('0x10')]);router[_0x5286('0x11')](_0x5286('0xd'),auth['isAuthenticated'](),controller[_0x5286('0x12')]);router[_0x5286('0x13')]('/:id',auth[_0x5286('0x8')](),controller[_0x5286('0x14')]);module[_0x5286('0x15')]=router;
\ No newline at end of file
index 578aa53..8bc616a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x435d=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x435d,0x103));var _0xd435=function(_0x4fe271,_0x334cf9){_0x4fe271=_0x4fe271-0x0;var _0x3d3cbc=_0x435d[_0x4fe271];return _0x3d3cbc;};'use strict';var Sequelize=require(_0xd435('0x0'));module[_0xd435('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd435('0x2')],'allowNull':![],'defaultValue':_0xd435('0x3')},'appdata':{'type':Sequelize[_0xd435('0x2')](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd435('0x4')}};
\ No newline at end of file
+var _0xfe7a=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x58a07b,_0x45274f){var _0x5926e0=function(_0x2e4fc4){while(--_0x2e4fc4){_0x58a07b['push'](_0x58a07b['shift']());}};_0x5926e0(++_0x45274f);}(_0xfe7a,0x142));var _0xafe7=function(_0x168a88,_0x3cc193){_0x168a88=_0x168a88-0x0;var _0x40943b=_0xfe7a[_0x168a88];return _0x40943b;};'use strict';var Sequelize=require(_0xafe7('0x0'));module[_0xafe7('0x1')]={'priority':{'type':Sequelize[_0xafe7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xafe7('0x3')],'allowNull':![],'defaultValue':_0xafe7('0x4')},'appdata':{'type':Sequelize[_0xafe7('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xafe7('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 628260f..8b9d467 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa32e=['querystring','ioredis','../../config/utils','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','options','ChatApplication','catch','body','params','find','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x1b7cf6,_0x18fb23){var _0x462edb=function(_0x227c55){while(--_0x227c55){_0x1b7cf6['push'](_0x1b7cf6['shift']());}};_0x462edb(++_0x18fb23);}(_0xa32e,0x8d));var _0xea32=function(_0x43d65d,_0x54d57c){_0x43d65d=_0x43d65d-0x0;var _0x2a5f77=_0xa32e[_0x43d65d];return _0x2a5f77;};'use strict';var pdf=require(_0xea32('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xea32('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea32('0x2'));var rp=require(_0xea32('0x3'));var moment=require(_0xea32('0x4'));var BPromise=require(_0xea32('0x5'));var Mustache=require(_0xea32('0x6'));var util=require('util');var path=require(_0xea32('0x7'));var sox=require(_0xea32('0x8'));var csv=require(_0xea32('0x9'));var ejs=require(_0xea32('0xa'));var fs=require('fs');var _=require(_0xea32('0xb'));var squel=require('squel');var crypto=require(_0xea32('0xc'));var jsforce=require(_0xea32('0xd'));var deskjs=require(_0xea32('0xe'));var toCsv=require(_0xea32('0x9'));var querystring=require(_0xea32('0xf'));var Papa=require('papaparse');var Redis=require(_0xea32('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0xea32('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x373407,_0x4acd89){_0x4acd89=_0x4acd89||0xcc;return function(_0x1b4303){if(_0x1b4303){return _0x373407[_0xea32('0x12')](_0x4acd89);}return _0x373407[_0xea32('0x13')](_0x4acd89)[_0xea32('0x14')]();};}function respondWithResult(_0xf34ec,_0x506876){_0x506876=_0x506876||0xc8;return function(_0x370cc5){if(_0x370cc5){return _0xf34ec[_0xea32('0x13')](_0x506876)['json'](_0x370cc5);}};}function respondWithFilteredResult(_0x1e7e01,_0x533d35){return function(_0x2b7623){if(_0x2b7623){var _0x5e094e=_0x2b7623['count'],_0x15ed65=_0x533d35[_0xea32('0x15')],_0x443995=_0x533d35[_0xea32('0x15')]+_0x533d35[_0xea32('0x16')],_0x151ef9;if(_0x443995>=_0x5e094e){_0x443995=_0x5e094e;_0x151ef9=0xc8;}else{_0x151ef9=0xce;}_0x1e7e01[_0xea32('0x13')](_0x151ef9);return _0x1e7e01[_0xea32('0x17')](_0xea32('0x18'),_0x15ed65+'-'+_0x443995+'/'+_0x5e094e)[_0xea32('0x19')](_0x2b7623);}return null;};}function patchUpdates(_0x4ae23a){return function(_0x51688a){try{jsonpatch[_0xea32('0x1a')](_0x51688a,_0x4ae23a,!![]);}catch(_0x471e62){return BPromise[_0xea32('0x1b')](_0x471e62);}return _0x51688a[_0xea32('0x1c')]();};}function saveUpdates(_0xbfe94e,_0x46676b){return function(_0xb71f48){if(_0xb71f48){return _0xb71f48[_0xea32('0x1d')](_0xbfe94e)[_0xea32('0x1e')](function(_0x23165d){return _0x23165d;});}return null;};}function removeEntity(_0x114b79,_0x139ab1){return function(_0x2cce75){if(_0x2cce75){return _0x2cce75[_0xea32('0x1f')]()[_0xea32('0x1e')](function(){_0x114b79[_0xea32('0x13')](0xcc)[_0xea32('0x14')]();});}};}function handleEntityNotFound(_0x4fe96b,_0x5019a8){return function(_0x180067){if(!_0x180067){_0x4fe96b[_0xea32('0x12')](0x194);}return _0x180067;};}function handleError(_0x2f1559,_0x3783c2){_0x3783c2=_0x3783c2||0x1f4;return function(_0xb1c4e5){logger['error'](_0xb1c4e5['stack']);if(_0xb1c4e5['name']){delete _0xb1c4e5[_0xea32('0x20')];}_0x2f1559[_0xea32('0x13')](_0x3783c2)[_0xea32('0x21')](_0xb1c4e5);};}exports[_0xea32('0x22')]=function(_0x36e85b,_0x1c1966){var _0x5cee51={'raw':!![],'where':{'id':_0x36e85b['params']['id']}},_0x2455eb={};_0x2455eb['model']=_[_0xea32('0x23')](db['ChatApplication'][_0xea32('0x24')]);_0x2455eb[_0xea32('0x25')]=_['keys'](_0x36e85b[_0xea32('0x25')]);_0x2455eb[_0xea32('0x26')]=_[_0xea32('0x27')](_0x2455eb[_0xea32('0x28')],_0x2455eb[_0xea32('0x25')]);_0x5cee51[_0xea32('0x29')]=_['intersection'](_0x2455eb['model'],qs[_0xea32('0x2a')](_0x36e85b['query'][_0xea32('0x2a')]));_0x5cee51['attributes']=_0x5cee51['attributes'][_0xea32('0x2b')]?_0x5cee51[_0xea32('0x29')]:_0x2455eb['model'];if(_0x36e85b[_0xea32('0x25')][_0xea32('0x2c')]){_0x5cee51[_0xea32('0x2d')]=[{'all':!![]}];}_0x5cee51=_['merge']({},_0x5cee51,_0x36e85b[_0xea32('0x2e')]);return db[_0xea32('0x2f')]['find'](_0x5cee51)[_0xea32('0x1e')](handleEntityNotFound(_0x1c1966,null))[_0xea32('0x1e')](respondWithResult(_0x1c1966,null))[_0xea32('0x30')](handleError(_0x1c1966,null));};exports[_0xea32('0x1d')]=function(_0x30d8f0,_0x36fe4a){if(_0x30d8f0[_0xea32('0x31')]['id']){delete _0x30d8f0[_0xea32('0x31')]['id'];}return db[_0xea32('0x2f')]['find']({'where':{'id':_0x30d8f0[_0xea32('0x32')]['id']}})[_0xea32('0x1e')](handleEntityNotFound(_0x36fe4a,null))['then'](saveUpdates(_0x30d8f0[_0xea32('0x31')],null))[_0xea32('0x1e')](respondWithResult(_0x36fe4a,null))[_0xea32('0x30')](handleError(_0x36fe4a,null));};exports[_0xea32('0x1f')]=function(_0x33318d,_0x49e4b3){return db[_0xea32('0x2f')][_0xea32('0x33')]({'where':{'id':_0x33318d[_0xea32('0x32')]['id']}})[_0xea32('0x1e')](handleEntityNotFound(_0x49e4b3,null))[_0xea32('0x1e')](removeEntity(_0x49e4b3,null))[_0xea32('0x30')](handleError(_0x49e4b3,null));};
\ No newline at end of file
+var _0x7789=['update','then','destroy','sendStatus','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','includeAll','include','merge','catch','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','crypto','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0xd057ed,_0x3c3dd6){var _0x1363cf=function(_0x516dff){while(--_0x516dff){_0xd057ed['push'](_0xd057ed['shift']());}};_0x1363cf(++_0x3c3dd6);}(_0x7789,0xeb));var _0x9778=function(_0x5dba5e,_0x5374c1){_0x5dba5e=_0x5dba5e-0x0;var _0x2f2feb=_0x7789[_0x5dba5e];return _0x2f2feb;};'use strict';var pdf=require(_0x9778('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9778('0x1'));var zipdir=require(_0x9778('0x2'));var jsonpatch=require(_0x9778('0x3'));var rp=require(_0x9778('0x4'));var moment=require(_0x9778('0x5'));var BPromise=require(_0x9778('0x6'));var Mustache=require(_0x9778('0x7'));var util=require(_0x9778('0x8'));var path=require('path');var sox=require(_0x9778('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9778('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9778('0xb'));var querystring=require(_0x9778('0xc'));var Papa=require(_0x9778('0xd'));var Redis=require(_0x9778('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x9778('0xf'))(_0x9778('0x10'));var utils=require(_0x9778('0x11'));var config=require('../../config/environment');var db=require(_0x9778('0x12'))['db'];function respondWithStatusCode(_0x31ad02,_0x4df343){_0x4df343=_0x4df343||0xcc;return function(_0x342985){if(_0x342985){return _0x31ad02['sendStatus'](_0x4df343);}return _0x31ad02[_0x9778('0x13')](_0x4df343)[_0x9778('0x14')]();};}function respondWithResult(_0x514bef,_0x1944ef){_0x1944ef=_0x1944ef||0xc8;return function(_0x3e8387){if(_0x3e8387){return _0x514bef['status'](_0x1944ef)[_0x9778('0x15')](_0x3e8387);}};}function respondWithFilteredResult(_0x5ca7b2,_0x527b8e){return function(_0x58c808){if(_0x58c808){var _0x1e661c=_0x58c808[_0x9778('0x16')],_0x3930a3=_0x527b8e['offset'],_0x3d8fdf=_0x527b8e[_0x9778('0x17')]+_0x527b8e[_0x9778('0x18')],_0x58c89b;if(_0x3d8fdf>=_0x1e661c){_0x3d8fdf=_0x1e661c;_0x58c89b=0xc8;}else{_0x58c89b=0xce;}_0x5ca7b2[_0x9778('0x13')](_0x58c89b);return _0x5ca7b2[_0x9778('0x19')](_0x9778('0x1a'),_0x3930a3+'-'+_0x3d8fdf+'/'+_0x1e661c)[_0x9778('0x15')](_0x58c808);}return null;};}function patchUpdates(_0x4fa7b9){return function(_0x474dec){try{jsonpatch[_0x9778('0x1b')](_0x474dec,_0x4fa7b9,!![]);}catch(_0x1143b9){return BPromise[_0x9778('0x1c')](_0x1143b9);}return _0x474dec[_0x9778('0x1d')]();};}function saveUpdates(_0x278c69,_0x1ebe88){return function(_0x4c55e4){if(_0x4c55e4){return _0x4c55e4[_0x9778('0x1e')](_0x278c69)[_0x9778('0x1f')](function(_0x325193){return _0x325193;});}return null;};}function removeEntity(_0x501217,_0xddf2d){return function(_0x26c3b7){if(_0x26c3b7){return _0x26c3b7[_0x9778('0x20')]()[_0x9778('0x1f')](function(){_0x501217['status'](0xcc)[_0x9778('0x14')]();});}};}function handleEntityNotFound(_0x392c45,_0x4d5781){return function(_0x2478fc){if(!_0x2478fc){_0x392c45[_0x9778('0x21')](0x194);}return _0x2478fc;};}function handleError(_0x49e76c,_0xa0dc1a){_0xa0dc1a=_0xa0dc1a||0x1f4;return function(_0x21e374){logger['error'](_0x21e374[_0x9778('0x22')]);if(_0x21e374[_0x9778('0x23')]){delete _0x21e374['name'];}_0x49e76c[_0x9778('0x13')](_0xa0dc1a)[_0x9778('0x24')](_0x21e374);};}exports[_0x9778('0x25')]=function(_0x2bfd9e,_0x46163d){var _0x336655={'raw':!![],'where':{'id':_0x2bfd9e[_0x9778('0x26')]['id']}},_0x3b33a0={};_0x3b33a0[_0x9778('0x27')]=_[_0x9778('0x28')](db[_0x9778('0x29')][_0x9778('0x2a')]);_0x3b33a0[_0x9778('0x2b')]=_[_0x9778('0x28')](_0x2bfd9e[_0x9778('0x2b')]);_0x3b33a0['filters']=_[_0x9778('0x2c')](_0x3b33a0[_0x9778('0x27')],_0x3b33a0['query']);_0x336655[_0x9778('0x2d')]=_[_0x9778('0x2c')](_0x3b33a0[_0x9778('0x27')],qs['fields'](_0x2bfd9e['query'][_0x9778('0x2e')]));_0x336655[_0x9778('0x2d')]=_0x336655['attributes']['length']?_0x336655['attributes']:_0x3b33a0[_0x9778('0x27')];if(_0x2bfd9e[_0x9778('0x2b')][_0x9778('0x2f')]){_0x336655[_0x9778('0x30')]=[{'all':!![]}];}_0x336655=_[_0x9778('0x31')]({},_0x336655,_0x2bfd9e['options']);return db[_0x9778('0x29')]['find'](_0x336655)['then'](handleEntityNotFound(_0x46163d,null))['then'](respondWithResult(_0x46163d,null))[_0x9778('0x32')](handleError(_0x46163d,null));};exports[_0x9778('0x1e')]=function(_0x2355e4,_0x5d8e09){if(_0x2355e4[_0x9778('0x33')]['id']){delete _0x2355e4['body']['id'];}return db[_0x9778('0x29')][_0x9778('0x34')]({'where':{'id':_0x2355e4[_0x9778('0x26')]['id']}})[_0x9778('0x1f')](handleEntityNotFound(_0x5d8e09,null))[_0x9778('0x1f')](saveUpdates(_0x2355e4[_0x9778('0x33')],null))['then'](respondWithResult(_0x5d8e09,null))[_0x9778('0x32')](handleError(_0x5d8e09,null));};exports['destroy']=function(_0x8cdd6e,_0x59114a){return db[_0x9778('0x29')][_0x9778('0x34')]({'where':{'id':_0x8cdd6e[_0x9778('0x26')]['id']}})[_0x9778('0x1f')](handleEntityNotFound(_0x59114a,null))[_0x9778('0x1f')](removeEntity(_0x59114a,null))[_0x9778('0x32')](handleError(_0x59114a,null));};
\ No newline at end of file
index d84698d..4cfcd4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1edc=['chat_applications','lodash','util','api','moment','bluebird','request-promise','exports','ChatApplication'];(function(_0x489017,_0x5af5e2){var _0x11d074=function(_0x264e05){while(--_0x264e05){_0x489017['push'](_0x489017['shift']());}};_0x11d074(++_0x5af5e2);}(_0x1edc,0xbe));var _0xc1ed=function(_0x90ccc9,_0x8e7be5){_0x90ccc9=_0x90ccc9-0x0;var _0x5736f0=_0x1edc[_0x90ccc9];return _0x5736f0;};'use strict';var _=require(_0xc1ed('0x0'));var util=require(_0xc1ed('0x1'));var logger=require('../../config/logger')(_0xc1ed('0x2'));var moment=require(_0xc1ed('0x3'));var BPromise=require(_0xc1ed('0x4'));var rp=require(_0xc1ed('0x5'));var attributes=require('./chatApplication.attributes');module[_0xc1ed('0x6')]=function(_0xfcb185,_0x3b6c04){return _0xfcb185['define'](_0xc1ed('0x7'),attributes,{'tableName':_0xc1ed('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3343=['lodash','api','bluebird','request-promise','./chatApplication.attributes','define','ChatApplication'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x3343,0x17a));var _0x3334=function(_0x303862,_0x20b5ab){_0x303862=_0x303862-0x0;var _0xe6f228=_0x3343[_0x303862];return _0xe6f228;};'use strict';var _=require(_0x3334('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3334('0x1'));var moment=require('moment');var BPromise=require(_0x3334('0x2'));var rp=require(_0x3334('0x3'));var attributes=require(_0x3334('0x4'));module['exports']=function(_0x4152f3,_0x21211b){return _0x4152f3[_0x3334('0x5')](_0x3334('0x6'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c672d5f..5c1a592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8311=['error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','stringify'];(function(_0x5fa1b0,_0x2d0a2e){var _0x5d4c06=function(_0x39f844){while(--_0x39f844){_0x5fa1b0['push'](_0x5fa1b0['shift']());}};_0x5d4c06(++_0x2d0a2e);}(_0x8311,0x6f));var _0x1831=function(_0x36bf8e,_0xc065a2){_0x36bf8e=_0x36bf8e-0x0;var _0x567be4=_0x8311[_0x36bf8e];return _0x567be4;};'use strict';var _=require(_0x1831('0x0'));var util=require(_0x1831('0x1'));var moment=require(_0x1831('0x2'));var BPromise=require('bluebird');var rs=require(_0x1831('0x3'));var fs=require('fs');var Redis=require(_0x1831('0x4'));var db=require(_0x1831('0x5'))['db'];var utils=require(_0x1831('0x6'));var logger=require('../../config/logger')(_0x1831('0x7'));var config=require(_0x1831('0x8'));var jayson=require(_0x1831('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3149bf,_0x3eaba9,_0x5f2c96){return new BPromise(function(_0x409944,_0xe7b55){return client[_0x1831('0xa')](_0x3149bf,_0x5f2c96)[_0x1831('0xb')](function(_0x55f328){logger['info']('ChatApplication,\x20%s,\x20%s',_0x3eaba9,_0x1831('0xc'));logger[_0x1831('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x3eaba9,_0x1831('0xc'),JSON[_0x1831('0xe')](_0x55f328));if(_0x55f328[_0x1831('0xf')]){if(_0x55f328['error'][_0x1831('0x10')]===0x1f4){logger[_0x1831('0xf')](_0x1831('0x11'),_0x3eaba9,_0x55f328['error'][_0x1831('0x12')]);return _0xe7b55(_0x55f328[_0x1831('0xf')][_0x1831('0x12')]);}logger['error'](_0x1831('0x11'),_0x3eaba9,_0x55f328['error']['message']);return _0x409944(_0x55f328['error'][_0x1831('0x12')]);}else{logger['info'](_0x1831('0x11'),_0x3eaba9,_0x1831('0xc'));_0x409944(_0x55f328[_0x1831('0x13')]['message']);}})[_0x1831('0x14')](function(_0x1f1e84){logger[_0x1831('0xf')](_0x1831('0x11'),_0x3eaba9,_0x1f1e84);_0xe7b55(_0x1f1e84);});});}
\ No newline at end of file
+var _0x0d57=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x2044a4,_0x1b1fd3){var _0x1b2d77=function(_0x3a5e02){while(--_0x3a5e02){_0x2044a4['push'](_0x2044a4['shift']());}};_0x1b2d77(++_0x1b1fd3);}(_0x0d57,0x10a));var _0x70d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d57[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70d5('0x0'));var util=require('util');var moment=require(_0x70d5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70d5('0x2'));var db=require(_0x70d5('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x70d5('0x4'));var config=require(_0x70d5('0x5'));var jayson=require(_0x70d5('0x6'));var client=jayson[_0x70d5('0x7')][_0x70d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x101581,_0x59ad17,_0x39a727){return new BPromise(function(_0x5486c1,_0x134e97){return client[_0x70d5('0x9')](_0x101581,_0x39a727)[_0x70d5('0xa')](function(_0x5cb3c6){logger[_0x70d5('0xb')](_0x70d5('0xc'),_0x59ad17,_0x70d5('0xd'));logger['debug'](_0x70d5('0xe'),_0x59ad17,_0x70d5('0xd'),JSON[_0x70d5('0xf')](_0x5cb3c6));if(_0x5cb3c6[_0x70d5('0x10')]){if(_0x5cb3c6['error'][_0x70d5('0x11')]===0x1f4){logger[_0x70d5('0x10')](_0x70d5('0xc'),_0x59ad17,_0x5cb3c6[_0x70d5('0x10')][_0x70d5('0x12')]);return _0x134e97(_0x5cb3c6['error'][_0x70d5('0x12')]);}logger[_0x70d5('0x10')](_0x70d5('0xc'),_0x59ad17,_0x5cb3c6[_0x70d5('0x10')][_0x70d5('0x12')]);return _0x5486c1(_0x5cb3c6['error'][_0x70d5('0x12')]);}else{logger[_0x70d5('0xb')](_0x70d5('0xc'),_0x59ad17,_0x70d5('0xd'));_0x5486c1(_0x5cb3c6[_0x70d5('0x13')][_0x70d5('0x12')]);}})[_0x70d5('0x14')](function(_0x265e50){logger[_0x70d5('0x10')](_0x70d5('0xc'),_0x59ad17,_0x265e50);_0x134e97(_0x265e50);});});}
\ No newline at end of file
index 228a77d..67be251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1354=['put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x2c5255,_0x4340c3){var _0x30d0ea=function(_0x131ba1){while(--_0x131ba1){_0x2c5255['push'](_0x2c5255['shift']());}};_0x30d0ea(++_0x4340c3);}(_0x1354,0x103));var _0x4135=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0x1354[_0x54a2e4];return _0x4742d0;};'use strict';var multer=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var path=require(_0x4135('0x2'));var timeout=require(_0x4135('0x3'));var express=require(_0x4135('0x4'));var router=express[_0x4135('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4135('0x6'));var config=require(_0x4135('0x7'));var controller=require(_0x4135('0x8'));router[_0x4135('0x9')](_0x4135('0xa'),auth[_0x4135('0xb')](),controller[_0x4135('0xc')]);router[_0x4135('0xd')]('/:id',auth[_0x4135('0xb')](),controller['update']);router[_0x4135('0xe')](_0x4135('0xa'),auth[_0x4135('0xb')](),controller['destroy']);module[_0x4135('0xf')]=router;
\ No newline at end of file
+var _0xf8c5=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0xf8c5,0x1b2));var _0x5f8c=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xf8c5[_0x273c39];return _0x46d6b5;};'use strict';var multer=require(_0x5f8c('0x0'));var util=require(_0x5f8c('0x1'));var path=require(_0x5f8c('0x2'));var timeout=require(_0x5f8c('0x3'));var express=require(_0x5f8c('0x4'));var router=express[_0x5f8c('0x5')]();var auth=require(_0x5f8c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5f8c('0x7'));var controller=require(_0x5f8c('0x8'));router[_0x5f8c('0x9')](_0x5f8c('0xa'),auth['isAuthenticated'](),controller[_0x5f8c('0xb')]);router[_0x5f8c('0xc')]('/:id',auth[_0x5f8c('0xd')](),controller[_0x5f8c('0xe')]);router[_0x5f8c('0xf')](_0x5f8c('0xa'),auth[_0x5f8c('0xd')](),controller[_0x5f8c('0x10')]);module[_0x5f8c('0x11')]=router;
\ No newline at end of file
index 6e7cad6..697e488 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd439=['BOOLEAN','exports','STRING'];(function(_0x19fa2e,_0x15755b){var _0x2118ec=function(_0x241bf6){while(--_0x241bf6){_0x19fa2e['push'](_0x19fa2e['shift']());}};_0x2118ec(++_0x15755b);}(_0xd439,0x1f0));var _0x9d43=function(_0xc454b2,_0xb6a5a9){_0xc454b2=_0xc454b2-0x0;var _0x3bb4af=_0xd439[_0xc454b2];return _0x3bb4af;};'use strict';var Sequelize=require('sequelize');module[_0x9d43('0x0')]={'name':{'type':Sequelize[_0x9d43('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9d43('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x41bf=['exports','STRING','BOOLEAN'];(function(_0x346797,_0x411d49){var _0x481532=function(_0x2bcdf0){while(--_0x2bcdf0){_0x346797['push'](_0x346797['shift']());}};_0x481532(++_0x411d49);}(_0x41bf,0xff));var _0xf41b=function(_0x1e9755,_0x5b846e){_0x1e9755=_0x1e9755-0x0;var _0x2293cb=_0x41bf[_0x1e9755];return _0x2293cb;};'use strict';var Sequelize=require('sequelize');module[_0xf41b('0x0')]={'name':{'type':Sequelize[_0xf41b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf41b('0x1')]},'write':{'type':Sequelize[_0xf41b('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index ab160f2..756c27f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['split','format','getMessages','hasOwnProperty','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','count','offset','limit','json','apply','reject','update','destroy','stack','name','index','ChatGroup','rawAttributes','query','dateEnd','dateStart','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','add','day','merge','map','key','VIRTUAL','field','filter','includeAll','include','show','params','options','find','catch','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','getMembers','removeMembers','addMessage','ChatGroupId','$gte'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0xafc4,0x69));var _0x4afc=function(_0x1ea37a,_0x353d8c){_0x1ea37a=_0x1ea37a-0x0;var _0x43088c=_0xafc4[_0x1ea37a];return _0x43088c;};'use strict';var pdf=require(_0x4afc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4afc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4afc('0x2'));var rp=require(_0x4afc('0x3'));var moment=require(_0x4afc('0x4'));var BPromise=require(_0x4afc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4afc('0x6'));var csv=require(_0x4afc('0x7'));var ejs=require(_0x4afc('0x8'));var fs=require('fs');var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x7'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var qs=require(_0x4afc('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4afc('0x11'));var config=require('../../config/environment');var db=require(_0x4afc('0x12'))['db'];config[_0x4afc('0x13')]=_['defaults'](config[_0x4afc('0x13')],{'host':_0x4afc('0x14'),'port':0x18eb});var socket=require(_0x4afc('0x15'))(new Redis(config[_0x4afc('0x13')]));require(_0x4afc('0x16'))[_0x4afc('0x17')](socket);var jayson=require(_0x4afc('0x18'));var client=jayson[_0x4afc('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26f3f1,_0x429fd8,_0x2c636b,_0x1e2c31){return new BPromise(function(_0x5f2dc9,_0x4e32e8){var _0x2452ae=_0x1e2c31||client;return _0x2452ae['request'](_0x26f3f1,_0x2c636b)[_0x4afc('0x1a')](function(_0x24ed6d){logger[_0x4afc('0x1b')](_0x4afc('0x1c'),_0x429fd8,_0x4afc('0x1d'));logger[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x429fd8,_0x4afc('0x1d'),JSON[_0x4afc('0x20')](_0x24ed6d));if(_0x24ed6d[_0x4afc('0x21')]){if(_0x24ed6d[_0x4afc('0x21')]['code']===0x1f4){logger[_0x4afc('0x21')](_0x4afc('0x1c'),_0x429fd8,_0x24ed6d[_0x4afc('0x21')][_0x4afc('0x22')]);return _0x4e32e8(_0x24ed6d['error'][_0x4afc('0x22')]);}logger[_0x4afc('0x21')](_0x4afc('0x1c'),_0x429fd8,_0x24ed6d[_0x4afc('0x21')][_0x4afc('0x22')]);return _0x5f2dc9(_0x24ed6d[_0x4afc('0x21')][_0x4afc('0x22')]);}else{logger['info'](_0x4afc('0x1c'),_0x429fd8,_0x4afc('0x1d'));_0x5f2dc9(_0x24ed6d['result'][_0x4afc('0x22')]);}})['catch'](function(_0x1aa676){logger[_0x4afc('0x21')](_0x4afc('0x1c'),_0x429fd8,_0x1aa676);_0x4e32e8(_0x1aa676);});});}function respondWithStatusCode(_0x2876f2,_0x86dbd4){_0x86dbd4=_0x86dbd4||0xcc;return function(_0x28a86c){if(_0x28a86c){return _0x2876f2[_0x4afc('0x23')](_0x86dbd4);}return _0x2876f2[_0x4afc('0x24')](_0x86dbd4)[_0x4afc('0x25')]();};}function respondWithResult(_0x100220,_0x4e8273){_0x4e8273=_0x4e8273||0xc8;return function(_0x359c07){if(_0x359c07){return _0x100220[_0x4afc('0x24')](_0x4e8273)['json'](_0x359c07);}};}function respondWithFilteredResult(_0xc3952e,_0x244f6c){return function(_0x2d6112){if(_0x2d6112){var _0x4e254d=_0x2d6112[_0x4afc('0x26')],_0x52212d=_0x244f6c['offset'],_0x54433f=_0x244f6c[_0x4afc('0x27')]+_0x244f6c[_0x4afc('0x28')],_0x426e9d;if(_0x54433f>=_0x4e254d){_0x54433f=_0x4e254d;_0x426e9d=0xc8;}else{_0x426e9d=0xce;}_0xc3952e['status'](_0x426e9d);return _0xc3952e['set']('Content-Range',_0x52212d+'-'+_0x54433f+'/'+_0x4e254d)[_0x4afc('0x29')](_0x2d6112);}return null;};}function patchUpdates(_0x34434a){return function(_0x17a43d){try{jsonpatch[_0x4afc('0x2a')](_0x17a43d,_0x34434a,!![]);}catch(_0xc1d91){return BPromise[_0x4afc('0x2b')](_0xc1d91);}return _0x17a43d['save']();};}function saveUpdates(_0x290391,_0x3d1693){return function(_0x1ba6b5){if(_0x1ba6b5){return _0x1ba6b5[_0x4afc('0x2c')](_0x290391)[_0x4afc('0x1a')](function(_0xf95893){return _0xf95893;});}return null;};}function removeEntity(_0xbabe1e,_0x406789){return function(_0x5ac7a8){if(_0x5ac7a8){return _0x5ac7a8[_0x4afc('0x2d')]()['then'](function(){_0xbabe1e['status'](0xcc)[_0x4afc('0x25')]();});}};}function handleEntityNotFound(_0x33ebbc,_0x266f7f){return function(_0x3d4ab5){if(!_0x3d4ab5){_0x33ebbc[_0x4afc('0x23')](0x194);}return _0x3d4ab5;};}function handleError(_0x3f50cc,_0x523520){_0x523520=_0x523520||0x1f4;return function(_0x380f9f){logger[_0x4afc('0x21')](_0x380f9f[_0x4afc('0x2e')]);if(_0x380f9f[_0x4afc('0x2f')]){delete _0x380f9f[_0x4afc('0x2f')];}_0x3f50cc[_0x4afc('0x24')](_0x523520)['send'](_0x380f9f);};}exports[_0x4afc('0x30')]=function(_0x2ddce1,_0x91565d){var _0x283bc2={},_0x499464={},_0x4be1e6={'count':0x0,'rows':[]};var _0x43c341=db[_0x4afc('0x31')][_0x4afc('0x32')];_0x499464['model']=_['keys'](_0x43c341);var _0x391120={'dateStart':_0x2ddce1['query']['dateStart'],'dateEnd':_0x2ddce1[_0x4afc('0x33')][_0x4afc('0x34')]};delete _0x2ddce1[_0x4afc('0x33')][_0x4afc('0x35')];delete _0x2ddce1[_0x4afc('0x33')][_0x4afc('0x34')];_0x499464[_0x4afc('0x33')]=_[_0x4afc('0x36')](_0x2ddce1[_0x4afc('0x33')]);_0x499464[_0x4afc('0x37')]=_[_0x4afc('0x38')](_0x499464[_0x4afc('0x39')],_0x499464[_0x4afc('0x33')]);_0x283bc2[_0x4afc('0x3a')]=_[_0x4afc('0x38')](_0x499464['model'],qs[_0x4afc('0x3b')](_0x2ddce1[_0x4afc('0x33')][_0x4afc('0x3b')]));_0x283bc2[_0x4afc('0x3a')]=_0x283bc2[_0x4afc('0x3a')][_0x4afc('0x3c')]?_0x283bc2[_0x4afc('0x3a')]:_0x499464['model'];if(!_0x2ddce1['query']['hasOwnProperty'](_0x4afc('0x3d'))){_0x283bc2[_0x4afc('0x28')]=qs['limit'](_0x2ddce1[_0x4afc('0x33')][_0x4afc('0x28')]);_0x283bc2[_0x4afc('0x27')]=qs[_0x4afc('0x27')](_0x2ddce1['query'][_0x4afc('0x27')]);}_0x283bc2[_0x4afc('0x3e')]=qs[_0x4afc('0x3f')](_0x2ddce1[_0x4afc('0x33')][_0x4afc('0x3f')]);_0x283bc2[_0x4afc('0x40')]=qs['filters'](_[_0x4afc('0x41')](_0x2ddce1['query'],_0x499464[_0x4afc('0x37')]));if(_0x391120[_0x4afc('0x35')]){if(_0x391120[_0x4afc('0x34')]){_0x391120['dateEnd']=moment(_0x391120['dateEnd'])[_0x4afc('0x42')](0x1,_0x4afc('0x43'));}else{_0x391120[_0x4afc('0x34')]=moment(_0x391120[_0x4afc('0x35')])[_0x4afc('0x42')](0x1,_0x4afc('0x43'));}_[_0x4afc('0x44')](_0x283bc2[_0x4afc('0x40')],{'createdAt':{'$gte':_0x391120['dateStart'],'$lte':_0x391120[_0x4afc('0x34')]}});}if(_0x2ddce1[_0x4afc('0x33')]['filter']){_0x283bc2[_0x4afc('0x40')]=_['merge'](_0x283bc2[_0x4afc('0x40')],{'$or':_[_0x4afc('0x45')](_0x43c341,function(_0x16c6c4){if(_0x16c6c4['type'][_0x4afc('0x46')]!==_0x4afc('0x47')){var _0x1683c1={};_0x1683c1[_0x16c6c4[_0x4afc('0x48')]]={'$like':'%'+_0x2ddce1[_0x4afc('0x33')][_0x4afc('0x49')]+'%'};return _0x1683c1;}})});}_0x283bc2=_['merge']({},_0x283bc2,_0x2ddce1['options']);var _0x4f4e46={'where':_0x283bc2[_0x4afc('0x40')]};return db[_0x4afc('0x31')][_0x4afc('0x26')](_0x4f4e46)[_0x4afc('0x1a')](function(_0xb5cca9){_0x4be1e6[_0x4afc('0x26')]=_0xb5cca9;if(_0x2ddce1[_0x4afc('0x33')][_0x4afc('0x4a')]){_0x283bc2[_0x4afc('0x4b')]=[{'all':!![]}];}return db[_0x4afc('0x31')]['findAll'](_0x283bc2);})[_0x4afc('0x1a')](function(_0x4d7e3f){_0x4be1e6['rows']=_0x4d7e3f;return _0x4be1e6;})[_0x4afc('0x1a')](respondWithFilteredResult(_0x91565d,_0x283bc2))['catch'](handleError(_0x91565d,null));};exports[_0x4afc('0x4c')]=function(_0x355198,_0x2fe2ae){var _0x2cafc3={'raw':!![],'where':{'id':_0x355198[_0x4afc('0x4d')]['id']}},_0x5b27d6={};_0x5b27d6['model']=_[_0x4afc('0x36')](db[_0x4afc('0x31')][_0x4afc('0x32')]);_0x5b27d6[_0x4afc('0x33')]=_[_0x4afc('0x36')](_0x355198[_0x4afc('0x33')]);_0x5b27d6[_0x4afc('0x37')]=_[_0x4afc('0x38')](_0x5b27d6[_0x4afc('0x39')],_0x5b27d6[_0x4afc('0x33')]);_0x2cafc3[_0x4afc('0x3a')]=_[_0x4afc('0x38')](_0x5b27d6['model'],qs[_0x4afc('0x3b')](_0x355198[_0x4afc('0x33')][_0x4afc('0x3b')]));_0x2cafc3[_0x4afc('0x3a')]=_0x2cafc3[_0x4afc('0x3a')][_0x4afc('0x3c')]?_0x2cafc3[_0x4afc('0x3a')]:_0x5b27d6[_0x4afc('0x39')];if(_0x355198[_0x4afc('0x33')][_0x4afc('0x4a')]){_0x2cafc3[_0x4afc('0x4b')]=[{'all':!![]}];}_0x2cafc3=_[_0x4afc('0x44')]({},_0x2cafc3,_0x355198[_0x4afc('0x4e')]);return db['ChatGroup'][_0x4afc('0x4f')](_0x2cafc3)['then'](handleEntityNotFound(_0x2fe2ae,null))[_0x4afc('0x1a')](respondWithResult(_0x2fe2ae,null))[_0x4afc('0x50')](handleError(_0x2fe2ae,null));};exports[_0x4afc('0x51')]=function(_0x2d9f3d,_0x518d6f){return db['ChatGroup'][_0x4afc('0x51')](_0x2d9f3d[_0x4afc('0x52')],{})['then'](respondWithResult(_0x518d6f,0xc9))[_0x4afc('0x50')](handleError(_0x518d6f,null));};exports[_0x4afc('0x2c')]=function(_0xb1c023,_0x2ac06a){if(_0xb1c023[_0x4afc('0x52')]['id']){delete _0xb1c023[_0x4afc('0x52')]['id'];}return db[_0x4afc('0x31')][_0x4afc('0x4f')]({'where':{'id':_0xb1c023[_0x4afc('0x4d')]['id']}})[_0x4afc('0x1a')](handleEntityNotFound(_0x2ac06a,null))[_0x4afc('0x1a')](saveUpdates(_0xb1c023[_0x4afc('0x52')],null))[_0x4afc('0x1a')](respondWithResult(_0x2ac06a,null))[_0x4afc('0x50')](handleError(_0x2ac06a,null));};exports['destroy']=function(_0x42c65e,_0x59fb43){return db[_0x4afc('0x31')][_0x4afc('0x4f')]({'where':{'id':_0x42c65e[_0x4afc('0x4d')]['id']}})[_0x4afc('0x1a')](handleEntityNotFound(_0x59fb43,null))[_0x4afc('0x1a')](removeEntity(_0x59fb43,null))['catch'](handleError(_0x59fb43,null));};exports[_0x4afc('0x53')]=function(_0x323c65,_0x543dce){return db['ChatGroup'][_0x4afc('0x53')]()[_0x4afc('0x1a')](respondWithResult(_0x543dce,null))[_0x4afc('0x50')](handleError(_0x543dce,null));};exports[_0x4afc('0x54')]=function(_0x258fed,_0x193850,_0x37cfa6){return db[_0x4afc('0x55')][_0x4afc('0x26')]({'where':{'ChatGroupId':_0x258fed[_0x4afc('0x4d')]['id'],'ToId':_0x258fed['user']['id'],'read':![]}})['then'](function(_0x458533){return{'id':_[_0x4afc('0x56')](_0x258fed['params']['id']),'count':_0x458533};})[_0x4afc('0x1a')](respondWithResult(_0x193850,null))[_0x4afc('0x50')](handleError(_0x193850,null));};exports['addMembers']=function(_0x56573a,_0x1b49cd,_0x26f4ee){return db[_0x4afc('0x31')]['find']({'where':{'id':_0x56573a[_0x4afc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1b49cd,null))['then'](function(_0x10e5c6){if(_0x10e5c6){return _0x10e5c6[_0x4afc('0x57')](_0x56573a[_0x4afc('0x52')][_0x4afc('0x58')],_[_0x4afc('0x59')](_0x56573a[_0x4afc('0x52')],[_0x4afc('0x58'),'id'])||{});}})[_0x4afc('0x1a')](respondWithResult(_0x1b49cd,null))[_0x4afc('0x50')](handleError(_0x1b49cd,null));};exports['getMembers']=function(_0x25969c,_0x1e8f64,_0x14e13e){var _0x4a014d={};var _0x5d13fe={};var _0x4a8d2c;var _0x3be61e;return db[_0x4afc('0x31')][_0x4afc('0x5a')]({'where':{'id':_0x25969c['params']['id']}})[_0x4afc('0x1a')](handleEntityNotFound(_0x1e8f64,null))['then'](function(_0x55b178){if(_0x55b178){_0x4a8d2c=_0x55b178;_0x5d13fe['model']=_[_0x4afc('0x36')](db[_0x4afc('0x5b')][_0x4afc('0x32')]);_0x5d13fe['query']=_[_0x4afc('0x36')](_0x25969c[_0x4afc('0x33')]);_0x5d13fe[_0x4afc('0x37')]=_['intersection'](_0x5d13fe[_0x4afc('0x39')],_0x5d13fe[_0x4afc('0x33')]);_0x4a014d[_0x4afc('0x3a')]=_[_0x4afc('0x38')](_0x5d13fe[_0x4afc('0x39')],qs['fields'](_0x25969c['query'][_0x4afc('0x3b')]));_0x4a014d[_0x4afc('0x3a')]=_0x4a014d[_0x4afc('0x3a')]['length']?_0x4a014d[_0x4afc('0x3a')]:_0x5d13fe[_0x4afc('0x39')];_0x4a014d[_0x4afc('0x3e')]=qs[_0x4afc('0x3f')](_0x25969c[_0x4afc('0x33')]['sort']);_0x4a014d[_0x4afc('0x40')]=qs[_0x4afc('0x37')](_['pick'](_0x25969c[_0x4afc('0x33')],_0x5d13fe[_0x4afc('0x37')]));if(_0x25969c[_0x4afc('0x33')]['filter']){_0x4a014d[_0x4afc('0x40')]=_[_0x4afc('0x44')](_0x4a014d[_0x4afc('0x40')],{'$or':_[_0x4afc('0x45')](_0x4a014d[_0x4afc('0x3a')],function(_0x3c0339){var _0x43f6e4={};_0x43f6e4[_0x3c0339]={'$like':'%'+_0x25969c[_0x4afc('0x33')]['filter']+'%'};return _0x43f6e4;})});}_0x4a014d=_[_0x4afc('0x44')]({},_0x4a014d,_0x25969c['options']);return _0x4a8d2c['getMembers'](_0x4a014d);}})[_0x4afc('0x1a')](function(_0x340d3e){if(_0x340d3e){_0x3be61e=_0x340d3e[_0x4afc('0x3c')];if(!_0x25969c['query']['hasOwnProperty'](_0x4afc('0x3d'))){_0x4a014d[_0x4afc('0x28')]=qs[_0x4afc('0x28')](_0x25969c[_0x4afc('0x33')][_0x4afc('0x28')]);_0x4a014d[_0x4afc('0x27')]=qs[_0x4afc('0x27')](_0x25969c[_0x4afc('0x33')][_0x4afc('0x27')]);}return _0x4a8d2c[_0x4afc('0x5c')](_0x4a014d);}})[_0x4afc('0x1a')](function(_0x731d9){if(_0x731d9){return _0x731d9?{'count':_0x3be61e,'rows':_0x731d9}:null;}})[_0x4afc('0x1a')](respondWithResult(_0x1e8f64,null))[_0x4afc('0x50')](handleError(_0x1e8f64,null));};exports[_0x4afc('0x5d')]=function(_0x16cf27,_0x4f8b24,_0x2d7d36){var _0x33eeb0;return db[_0x4afc('0x31')][_0x4afc('0x4f')]({'where':{'id':_0x16cf27[_0x4afc('0x4d')]['id']}})[_0x4afc('0x1a')](handleEntityNotFound(_0x4f8b24,null))[_0x4afc('0x1a')](function(_0x158522){if(_0x158522){return _0x158522[_0x4afc('0x5d')](_0x16cf27['query'][_0x4afc('0x58')]);}})[_0x4afc('0x1a')](respondWithStatusCode(_0x4f8b24,null))[_0x4afc('0x50')](handleError(_0x4f8b24,null));};exports[_0x4afc('0x5e')]=function(_0x4b5bd2,_0x1e7e24,_0x56b862){if(_0x4b5bd2[_0x4afc('0x52')]['id']){delete _0x4b5bd2[_0x4afc('0x52')]['id'];}return db[_0x4afc('0x31')][_0x4afc('0x4f')]({'where':{'id':_0x4b5bd2[_0x4afc('0x4d')]['id']}})[_0x4afc('0x1a')](handleEntityNotFound(_0x1e7e24,null))[_0x4afc('0x1a')](function(_0x2b20ad){if(_0x2b20ad){_0x4b5bd2['body'][_0x4afc('0x5f')]=_0x2b20ad['id'];return db[_0x4afc('0x55')]['create'](_0x4b5bd2[_0x4afc('0x52')]);}})[_0x4afc('0x1a')](respondWithResult(_0x1e7e24,null))[_0x4afc('0x50')](handleError(_0x1e7e24,null));};exports['getMessages']=function(_0x1c3d20,_0x3478aa,_0x24553b){var _0x38b143={};var _0x4a6f77={};var _0x1bbe21;var _0x29297c;return db['ChatGroup'][_0x4afc('0x5a')]({'where':{'id':_0x1c3d20[_0x4afc('0x4d')]['id']}})[_0x4afc('0x1a')](handleEntityNotFound(_0x3478aa,null))['then'](function(_0x4c73fd){if(_0x4c73fd){_0x1bbe21=_0x4c73fd;_0x4a6f77[_0x4afc('0x39')]=_[_0x4afc('0x36')](db[_0x4afc('0x55')][_0x4afc('0x32')]);_0x4a6f77[_0x4afc('0x33')]=_[_0x4afc('0x36')](_0x1c3d20[_0x4afc('0x33')]);_0x4a6f77[_0x4afc('0x37')]=_[_0x4afc('0x38')](_0x4a6f77[_0x4afc('0x39')],_0x4a6f77[_0x4afc('0x33')]);_0x38b143[_0x4afc('0x3a')]=_[_0x4afc('0x38')](_0x4a6f77[_0x4afc('0x39')],qs[_0x4afc('0x3b')](_0x1c3d20[_0x4afc('0x33')]['fields']));_0x38b143[_0x4afc('0x3a')]=_0x38b143[_0x4afc('0x3a')]['length']?_0x38b143[_0x4afc('0x3a')]:_0x4a6f77['model'];_0x38b143['order']=qs[_0x4afc('0x3f')](_0x1c3d20['query']['sort']);_0x38b143[_0x4afc('0x40')]=qs['filters'](_[_0x4afc('0x41')](_0x1c3d20['query'],_0x4a6f77[_0x4afc('0x37')]));if(_0x1c3d20[_0x4afc('0x33')][_0x4afc('0x49')]){_0x38b143[_0x4afc('0x40')]=_[_0x4afc('0x44')](_0x38b143['where'],{'$or':_[_0x4afc('0x45')](_0x38b143[_0x4afc('0x3a')],function(_0x4cb780){var _0x4f97a4={};_0x4f97a4[_0x4cb780]={'$like':'%'+_0x1c3d20[_0x4afc('0x33')][_0x4afc('0x49')]+'%'};return _0x4f97a4;})});}if(_0x1c3d20[_0x4afc('0x33')][_0x4afc('0x60')]){var _0x4596ed=_0x1c3d20['query'][_0x4afc('0x60')][_0x4afc('0x61')](',');var _0x2516e4={};_0x2516e4[_0x4596ed[0x0]]={'$gte':moment(_0x4596ed[0x1])[_0x4afc('0x62')]('YYYY-MM-DD\x20HH:mm:ss')};_0x38b143[_0x4afc('0x40')]=_['merge'](_0x38b143[_0x4afc('0x40')],_0x2516e4);}_0x38b143=_[_0x4afc('0x44')]({},_0x38b143,_0x1c3d20[_0x4afc('0x4e')]);return _0x1bbe21[_0x4afc('0x63')](_0x38b143);}})[_0x4afc('0x1a')](function(_0x29c8aa){if(_0x29c8aa){_0x29297c=_0x29c8aa[_0x4afc('0x3c')];if(!_0x1c3d20[_0x4afc('0x33')][_0x4afc('0x64')](_0x4afc('0x3d'))){_0x38b143[_0x4afc('0x28')]=qs['limit'](_0x1c3d20[_0x4afc('0x33')]['limit']);_0x38b143[_0x4afc('0x27')]=qs['offset'](_0x1c3d20['query'][_0x4afc('0x27')]);}return _0x1bbe21['getMessages'](_0x38b143);}})['then'](function(_0x360d43){if(_0x360d43){return _0x360d43?{'count':_0x29297c,'rows':_0x360d43}:null;}})['then'](respondWithResult(_0x3478aa,null))[_0x4afc('0x50')](handleError(_0x3478aa,null));};
\ No newline at end of file
+var _0x31f0=['debug','request\x20sent','stringify','error','code','message','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','model','query','dateStart','dateEnd','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','add','day','merge','filter','type','key','VIRTUAL','field','options','ChatGroup','include','findAll','rows','show','params','intersection','length','includeAll','find','create','body','catch','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','rawAttributes','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','client','http','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x4ff692,_0x1821ed){var _0x3bd1f4=function(_0x4cbd4e){while(--_0x4cbd4e){_0x4ff692['push'](_0x4ff692['shift']());}};_0x3bd1f4(++_0x1821ed);}(_0x31f0,0xb7));var _0x031f=function(_0x306e78,_0x52a7d1){_0x306e78=_0x306e78-0x0;var _0x2327e8=_0x31f0[_0x306e78];return _0x2327e8;};'use strict';var pdf=require(_0x031f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x031f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x031f('0x2'));var rp=require(_0x031f('0x3'));var moment=require(_0x031f('0x4'));var BPromise=require(_0x031f('0x5'));var Mustache=require('mustache');var util=require(_0x031f('0x6'));var path=require(_0x031f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');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 qs=require(_0x031f('0xf'));var logger=require(_0x031f('0x10'))(_0x031f('0x11'));var utils=require(_0x031f('0x12'));var config=require(_0x031f('0x13'));var db=require(_0x031f('0x14'))['db'];config['redis']=_[_0x031f('0x15')](config[_0x031f('0x16')],{'host':_0x031f('0x17'),'port':0x18eb});var socket=require(_0x031f('0x18'))(new Redis(config[_0x031f('0x16')]));require(_0x031f('0x19'))[_0x031f('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x031f('0x1b')][_0x031f('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17a699,_0x2e3dfe,_0x2ea549,_0x57f9c0){return new BPromise(function(_0x4b7011,_0x1f08db){var _0x3a10aa=_0x57f9c0||client;return _0x3a10aa[_0x031f('0x1d')](_0x17a699,_0x2ea549)[_0x031f('0x1e')](function(_0x5196b1){logger[_0x031f('0x1f')](_0x031f('0x20'),_0x2e3dfe,'request\x20sent');logger[_0x031f('0x21')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2e3dfe,_0x031f('0x22'),JSON[_0x031f('0x23')](_0x5196b1));if(_0x5196b1[_0x031f('0x24')]){if(_0x5196b1[_0x031f('0x24')][_0x031f('0x25')]===0x1f4){logger[_0x031f('0x24')](_0x031f('0x20'),_0x2e3dfe,_0x5196b1[_0x031f('0x24')][_0x031f('0x26')]);return _0x1f08db(_0x5196b1[_0x031f('0x24')][_0x031f('0x26')]);}logger['error'](_0x031f('0x20'),_0x2e3dfe,_0x5196b1[_0x031f('0x24')][_0x031f('0x26')]);return _0x4b7011(_0x5196b1['error']['message']);}else{logger[_0x031f('0x1f')]('ChatGroup,\x20%s,\x20%s',_0x2e3dfe,_0x031f('0x22'));_0x4b7011(_0x5196b1['result']['message']);}})['catch'](function(_0x971691){logger[_0x031f('0x24')](_0x031f('0x20'),_0x2e3dfe,_0x971691);_0x1f08db(_0x971691);});});}function respondWithStatusCode(_0x4c8126,_0x494568){_0x494568=_0x494568||0xcc;return function(_0x374b65){if(_0x374b65){return _0x4c8126['sendStatus'](_0x494568);}return _0x4c8126[_0x031f('0x27')](_0x494568)[_0x031f('0x28')]();};}function respondWithResult(_0xfa77b1,_0x567666){_0x567666=_0x567666||0xc8;return function(_0x35af16){if(_0x35af16){return _0xfa77b1[_0x031f('0x27')](_0x567666)['json'](_0x35af16);}};}function respondWithFilteredResult(_0x3847b2,_0x28a617){return function(_0x2403e9){if(_0x2403e9){var _0x5395ea=_0x2403e9[_0x031f('0x29')],_0xa308b=_0x28a617[_0x031f('0x2a')],_0x114e34=_0x28a617[_0x031f('0x2a')]+_0x28a617['limit'],_0xb6ed6c;if(_0x114e34>=_0x5395ea){_0x114e34=_0x5395ea;_0xb6ed6c=0xc8;}else{_0xb6ed6c=0xce;}_0x3847b2[_0x031f('0x27')](_0xb6ed6c);return _0x3847b2[_0x031f('0x2b')](_0x031f('0x2c'),_0xa308b+'-'+_0x114e34+'/'+_0x5395ea)[_0x031f('0x2d')](_0x2403e9);}return null;};}function patchUpdates(_0x428ec4){return function(_0x2d24f0){try{jsonpatch[_0x031f('0x2e')](_0x2d24f0,_0x428ec4,!![]);}catch(_0x87dc07){return BPromise[_0x031f('0x2f')](_0x87dc07);}return _0x2d24f0[_0x031f('0x30')]();};}function saveUpdates(_0x2cf3a8,_0x5ec564){return function(_0xced6ff){if(_0xced6ff){return _0xced6ff[_0x031f('0x31')](_0x2cf3a8)[_0x031f('0x1e')](function(_0x2f2616){return _0x2f2616;});}return null;};}function removeEntity(_0x25a637,_0xb774cf){return function(_0x106994){if(_0x106994){return _0x106994[_0x031f('0x32')]()[_0x031f('0x1e')](function(){_0x25a637[_0x031f('0x27')](0xcc)[_0x031f('0x28')]();});}};}function handleEntityNotFound(_0x17217d,_0x4610fa){return function(_0x564f3b){if(!_0x564f3b){_0x17217d[_0x031f('0x33')](0x194);}return _0x564f3b;};}function handleError(_0xd0ce3b,_0x4d1569){_0x4d1569=_0x4d1569||0x1f4;return function(_0x1cac0c){logger[_0x031f('0x24')](_0x1cac0c['stack']);if(_0x1cac0c[_0x031f('0x34')]){delete _0x1cac0c[_0x031f('0x34')];}_0xd0ce3b[_0x031f('0x27')](_0x4d1569)[_0x031f('0x35')](_0x1cac0c);};}exports['index']=function(_0x495712,_0x36ab13){var _0x555b89={},_0x43ab76={},_0x2aa0aa={'count':0x0,'rows':[]};var _0x43ef89=db['ChatGroup']['rawAttributes'];_0x43ab76[_0x031f('0x36')]=_['keys'](_0x43ef89);var _0x57b9c8={'dateStart':_0x495712[_0x031f('0x37')][_0x031f('0x38')],'dateEnd':_0x495712[_0x031f('0x37')][_0x031f('0x39')]};delete _0x495712[_0x031f('0x37')][_0x031f('0x38')];delete _0x495712[_0x031f('0x37')]['dateEnd'];_0x43ab76[_0x031f('0x37')]=_[_0x031f('0x3a')](_0x495712[_0x031f('0x37')]);_0x43ab76[_0x031f('0x3b')]=_['intersection'](_0x43ab76[_0x031f('0x36')],_0x43ab76[_0x031f('0x37')]);_0x555b89[_0x031f('0x3c')]=_['intersection'](_0x43ab76[_0x031f('0x36')],qs[_0x031f('0x3d')](_0x495712['query'][_0x031f('0x3d')]));_0x555b89[_0x031f('0x3c')]=_0x555b89['attributes']['length']?_0x555b89[_0x031f('0x3c')]:_0x43ab76[_0x031f('0x36')];if(!_0x495712[_0x031f('0x37')][_0x031f('0x3e')](_0x031f('0x3f'))){_0x555b89[_0x031f('0x40')]=qs[_0x031f('0x40')](_0x495712['query'][_0x031f('0x40')]);_0x555b89[_0x031f('0x2a')]=qs['offset'](_0x495712[_0x031f('0x37')]['offset']);}_0x555b89[_0x031f('0x41')]=qs[_0x031f('0x42')](_0x495712['query'][_0x031f('0x42')]);_0x555b89[_0x031f('0x43')]=qs[_0x031f('0x3b')](_['pick'](_0x495712[_0x031f('0x37')],_0x43ab76[_0x031f('0x3b')]));if(_0x57b9c8[_0x031f('0x38')]){if(_0x57b9c8[_0x031f('0x39')]){_0x57b9c8[_0x031f('0x39')]=moment(_0x57b9c8[_0x031f('0x39')])[_0x031f('0x44')](0x1,_0x031f('0x45'));}else{_0x57b9c8[_0x031f('0x39')]=moment(_0x57b9c8['dateStart'])[_0x031f('0x44')](0x1,_0x031f('0x45'));}_[_0x031f('0x46')](_0x555b89[_0x031f('0x43')],{'createdAt':{'$gte':_0x57b9c8[_0x031f('0x38')],'$lte':_0x57b9c8[_0x031f('0x39')]}});}if(_0x495712[_0x031f('0x37')][_0x031f('0x47')]){_0x555b89[_0x031f('0x43')]=_['merge'](_0x555b89[_0x031f('0x43')],{'$or':_['map'](_0x43ef89,function(_0x512937){if(_0x512937[_0x031f('0x48')][_0x031f('0x49')]!==_0x031f('0x4a')){var _0x1dd8ce={};_0x1dd8ce[_0x512937[_0x031f('0x4b')]]={'$like':'%'+_0x495712['query'][_0x031f('0x47')]+'%'};return _0x1dd8ce;}})});}_0x555b89=_[_0x031f('0x46')]({},_0x555b89,_0x495712[_0x031f('0x4c')]);var _0x5bb0be={'where':_0x555b89[_0x031f('0x43')]};return db[_0x031f('0x4d')][_0x031f('0x29')](_0x5bb0be)[_0x031f('0x1e')](function(_0x2c93ea){_0x2aa0aa[_0x031f('0x29')]=_0x2c93ea;if(_0x495712['query']['includeAll']){_0x555b89[_0x031f('0x4e')]=[{'all':!![]}];}return db['ChatGroup'][_0x031f('0x4f')](_0x555b89);})[_0x031f('0x1e')](function(_0x5a29e0){_0x2aa0aa[_0x031f('0x50')]=_0x5a29e0;return _0x2aa0aa;})['then'](respondWithFilteredResult(_0x36ab13,_0x555b89))['catch'](handleError(_0x36ab13,null));};exports[_0x031f('0x51')]=function(_0x48ca85,_0x16bade){var _0x57e9dc={'raw':!![],'where':{'id':_0x48ca85[_0x031f('0x52')]['id']}},_0x11bf43={};_0x11bf43['model']=_[_0x031f('0x3a')](db[_0x031f('0x4d')]['rawAttributes']);_0x11bf43[_0x031f('0x37')]=_['keys'](_0x48ca85[_0x031f('0x37')]);_0x11bf43['filters']=_[_0x031f('0x53')](_0x11bf43[_0x031f('0x36')],_0x11bf43[_0x031f('0x37')]);_0x57e9dc[_0x031f('0x3c')]=_[_0x031f('0x53')](_0x11bf43['model'],qs[_0x031f('0x3d')](_0x48ca85['query'][_0x031f('0x3d')]));_0x57e9dc[_0x031f('0x3c')]=_0x57e9dc['attributes'][_0x031f('0x54')]?_0x57e9dc[_0x031f('0x3c')]:_0x11bf43['model'];if(_0x48ca85[_0x031f('0x37')][_0x031f('0x55')]){_0x57e9dc[_0x031f('0x4e')]=[{'all':!![]}];}_0x57e9dc=_['merge']({},_0x57e9dc,_0x48ca85[_0x031f('0x4c')]);return db['ChatGroup'][_0x031f('0x56')](_0x57e9dc)['then'](handleEntityNotFound(_0x16bade,null))[_0x031f('0x1e')](respondWithResult(_0x16bade,null))['catch'](handleError(_0x16bade,null));};exports[_0x031f('0x57')]=function(_0x27b869,_0x5f5517){return db['ChatGroup'][_0x031f('0x57')](_0x27b869[_0x031f('0x58')],{})['then'](respondWithResult(_0x5f5517,0xc9))[_0x031f('0x59')](handleError(_0x5f5517,null));};exports[_0x031f('0x31')]=function(_0x255003,_0x286d4e){if(_0x255003[_0x031f('0x58')]['id']){delete _0x255003[_0x031f('0x58')]['id'];}return db[_0x031f('0x4d')][_0x031f('0x56')]({'where':{'id':_0x255003['params']['id']}})[_0x031f('0x1e')](handleEntityNotFound(_0x286d4e,null))[_0x031f('0x1e')](saveUpdates(_0x255003[_0x031f('0x58')],null))['then'](respondWithResult(_0x286d4e,null))[_0x031f('0x59')](handleError(_0x286d4e,null));};exports[_0x031f('0x32')]=function(_0x5b2c01,_0xb86dcd){return db[_0x031f('0x4d')][_0x031f('0x56')]({'where':{'id':_0x5b2c01[_0x031f('0x52')]['id']}})['then'](handleEntityNotFound(_0xb86dcd,null))['then'](removeEntity(_0xb86dcd,null))['catch'](handleError(_0xb86dcd,null));};exports['describe']=function(_0x9f76f3,_0xcf8b7){return db['ChatGroup'][_0x031f('0x5a')]()[_0x031f('0x1e')](respondWithResult(_0xcf8b7,null))['catch'](handleError(_0xcf8b7,null));};exports[_0x031f('0x5b')]=function(_0x26ecb0,_0x451c71,_0x22d211){return db[_0x031f('0x5c')][_0x031f('0x29')]({'where':{'ChatGroupId':_0x26ecb0[_0x031f('0x52')]['id'],'ToId':_0x26ecb0[_0x031f('0x5d')]['id'],'read':![]}})[_0x031f('0x1e')](function(_0x557a32){return{'id':_[_0x031f('0x5e')](_0x26ecb0['params']['id']),'count':_0x557a32};})[_0x031f('0x1e')](respondWithResult(_0x451c71,null))[_0x031f('0x59')](handleError(_0x451c71,null));};exports[_0x031f('0x5f')]=function(_0x574f26,_0x4c1b74,_0xdb3d45){return db[_0x031f('0x4d')][_0x031f('0x56')]({'where':{'id':_0x574f26[_0x031f('0x52')]['id']}})['then'](handleEntityNotFound(_0x4c1b74,null))[_0x031f('0x1e')](function(_0x5a181c){if(_0x5a181c){return _0x5a181c['addMembers'](_0x574f26[_0x031f('0x58')]['ids'],_['omit'](_0x574f26[_0x031f('0x58')],[_0x031f('0x60'),'id'])||{});}})[_0x031f('0x1e')](respondWithResult(_0x4c1b74,null))[_0x031f('0x59')](handleError(_0x4c1b74,null));};exports[_0x031f('0x61')]=function(_0x584899,_0x56b573,_0x214eec){var _0x501dbf={};var _0x2b7f85={};var _0xa921b2;var _0x4f5733;return db[_0x031f('0x4d')][_0x031f('0x62')]({'where':{'id':_0x584899[_0x031f('0x52')]['id']}})[_0x031f('0x1e')](handleEntityNotFound(_0x56b573,null))[_0x031f('0x1e')](function(_0x33d9e0){if(_0x33d9e0){_0xa921b2=_0x33d9e0;_0x2b7f85['model']=_['keys'](db[_0x031f('0x63')][_0x031f('0x64')]);_0x2b7f85[_0x031f('0x37')]=_[_0x031f('0x3a')](_0x584899[_0x031f('0x37')]);_0x2b7f85[_0x031f('0x3b')]=_[_0x031f('0x53')](_0x2b7f85['model'],_0x2b7f85['query']);_0x501dbf['attributes']=_['intersection'](_0x2b7f85[_0x031f('0x36')],qs[_0x031f('0x3d')](_0x584899[_0x031f('0x37')]['fields']));_0x501dbf[_0x031f('0x3c')]=_0x501dbf[_0x031f('0x3c')]['length']?_0x501dbf[_0x031f('0x3c')]:_0x2b7f85[_0x031f('0x36')];_0x501dbf[_0x031f('0x41')]=qs[_0x031f('0x42')](_0x584899[_0x031f('0x37')][_0x031f('0x42')]);_0x501dbf[_0x031f('0x43')]=qs['filters'](_['pick'](_0x584899[_0x031f('0x37')],_0x2b7f85['filters']));if(_0x584899[_0x031f('0x37')]['filter']){_0x501dbf[_0x031f('0x43')]=_[_0x031f('0x46')](_0x501dbf[_0x031f('0x43')],{'$or':_['map'](_0x501dbf[_0x031f('0x3c')],function(_0x586315){var _0xa31a3={};_0xa31a3[_0x586315]={'$like':'%'+_0x584899[_0x031f('0x37')][_0x031f('0x47')]+'%'};return _0xa31a3;})});}_0x501dbf=_['merge']({},_0x501dbf,_0x584899[_0x031f('0x4c')]);return _0xa921b2[_0x031f('0x61')](_0x501dbf);}})[_0x031f('0x1e')](function(_0x3e3ff5){if(_0x3e3ff5){_0x4f5733=_0x3e3ff5[_0x031f('0x54')];if(!_0x584899['query']['hasOwnProperty'](_0x031f('0x3f'))){_0x501dbf[_0x031f('0x40')]=qs['limit'](_0x584899[_0x031f('0x37')]['limit']);_0x501dbf[_0x031f('0x2a')]=qs[_0x031f('0x2a')](_0x584899[_0x031f('0x37')][_0x031f('0x2a')]);}return _0xa921b2['getMembers'](_0x501dbf);}})[_0x031f('0x1e')](function(_0x2e25e8){if(_0x2e25e8){return _0x2e25e8?{'count':_0x4f5733,'rows':_0x2e25e8}:null;}})[_0x031f('0x1e')](respondWithResult(_0x56b573,null))['catch'](handleError(_0x56b573,null));};exports[_0x031f('0x65')]=function(_0xfda893,_0x4deefb,_0x379564){var _0x4842a8;return db[_0x031f('0x4d')][_0x031f('0x56')]({'where':{'id':_0xfda893[_0x031f('0x52')]['id']}})[_0x031f('0x1e')](handleEntityNotFound(_0x4deefb,null))[_0x031f('0x1e')](function(_0x596280){if(_0x596280){return _0x596280[_0x031f('0x65')](_0xfda893[_0x031f('0x37')][_0x031f('0x60')]);}})['then'](respondWithStatusCode(_0x4deefb,null))['catch'](handleError(_0x4deefb,null));};exports[_0x031f('0x66')]=function(_0x5bd344,_0x54f02d,_0x152e86){if(_0x5bd344[_0x031f('0x58')]['id']){delete _0x5bd344[_0x031f('0x58')]['id'];}return db[_0x031f('0x4d')][_0x031f('0x56')]({'where':{'id':_0x5bd344[_0x031f('0x52')]['id']}})[_0x031f('0x1e')](handleEntityNotFound(_0x54f02d,null))[_0x031f('0x1e')](function(_0xecbfed){if(_0xecbfed){_0x5bd344[_0x031f('0x58')][_0x031f('0x67')]=_0xecbfed['id'];return db['ChatInternalMessage'][_0x031f('0x57')](_0x5bd344[_0x031f('0x58')]);}})[_0x031f('0x1e')](respondWithResult(_0x54f02d,null))[_0x031f('0x59')](handleError(_0x54f02d,null));};exports['getMessages']=function(_0x6970f5,_0x5329c2,_0x4a40ad){var _0x22ce8a={};var _0x2f4d09={};var _0x528db4;var _0x510bb6;return db[_0x031f('0x4d')][_0x031f('0x62')]({'where':{'id':_0x6970f5[_0x031f('0x52')]['id']}})[_0x031f('0x1e')](handleEntityNotFound(_0x5329c2,null))[_0x031f('0x1e')](function(_0x3f4de6){if(_0x3f4de6){_0x528db4=_0x3f4de6;_0x2f4d09['model']=_[_0x031f('0x3a')](db[_0x031f('0x5c')]['rawAttributes']);_0x2f4d09[_0x031f('0x37')]=_[_0x031f('0x3a')](_0x6970f5[_0x031f('0x37')]);_0x2f4d09[_0x031f('0x3b')]=_[_0x031f('0x53')](_0x2f4d09[_0x031f('0x36')],_0x2f4d09[_0x031f('0x37')]);_0x22ce8a['attributes']=_[_0x031f('0x53')](_0x2f4d09['model'],qs[_0x031f('0x3d')](_0x6970f5[_0x031f('0x37')][_0x031f('0x3d')]));_0x22ce8a['attributes']=_0x22ce8a['attributes']['length']?_0x22ce8a[_0x031f('0x3c')]:_0x2f4d09[_0x031f('0x36')];_0x22ce8a[_0x031f('0x41')]=qs[_0x031f('0x42')](_0x6970f5[_0x031f('0x37')][_0x031f('0x42')]);_0x22ce8a[_0x031f('0x43')]=qs['filters'](_['pick'](_0x6970f5[_0x031f('0x37')],_0x2f4d09[_0x031f('0x3b')]));if(_0x6970f5['query'][_0x031f('0x47')]){_0x22ce8a['where']=_[_0x031f('0x46')](_0x22ce8a[_0x031f('0x43')],{'$or':_['map'](_0x22ce8a[_0x031f('0x3c')],function(_0x37af05){var _0x5e4dff={};_0x5e4dff[_0x37af05]={'$like':'%'+_0x6970f5[_0x031f('0x37')][_0x031f('0x47')]+'%'};return _0x5e4dff;})});}if(_0x6970f5[_0x031f('0x37')]['$gte']){var _0xa9b5e2=_0x6970f5[_0x031f('0x37')][_0x031f('0x68')][_0x031f('0x69')](',');var _0x11165b={};_0x11165b[_0xa9b5e2[0x0]]={'$gte':moment(_0xa9b5e2[0x1])[_0x031f('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x22ce8a[_0x031f('0x43')]=_[_0x031f('0x46')](_0x22ce8a[_0x031f('0x43')],_0x11165b);}_0x22ce8a=_[_0x031f('0x46')]({},_0x22ce8a,_0x6970f5['options']);return _0x528db4[_0x031f('0x6b')](_0x22ce8a);}})[_0x031f('0x1e')](function(_0x51d44a){if(_0x51d44a){_0x510bb6=_0x51d44a[_0x031f('0x54')];if(!_0x6970f5[_0x031f('0x37')][_0x031f('0x3e')](_0x031f('0x3f'))){_0x22ce8a[_0x031f('0x40')]=qs[_0x031f('0x40')](_0x6970f5[_0x031f('0x37')][_0x031f('0x40')]);_0x22ce8a[_0x031f('0x2a')]=qs[_0x031f('0x2a')](_0x6970f5[_0x031f('0x37')][_0x031f('0x2a')]);}return _0x528db4[_0x031f('0x6b')](_0x22ce8a);}})[_0x031f('0x1e')](function(_0x2433ce){if(_0x2433ce){return _0x2433ce?{'count':_0x510bb6,'rows':_0x2433ce}:null;}})['then'](respondWithResult(_0x5329c2,null))[_0x031f('0x59')](handleError(_0x5329c2,null));};
\ No newline at end of file
index 6910f6e..e0a9d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2785=['exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2785,0xda));var _0x5278=function(_0x1a58a9,_0xe32406){_0x1a58a9=_0x1a58a9-0x0;var _0x45449b=_0x2785[_0x1a58a9];return _0x45449b;};'use strict';var EventEmitter=require(_0x5278('0x0'));var ChatGroup=require(_0x5278('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5278('0x2')](0x0);var events={'afterCreate':_0x5278('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x399920){return function(_0x47af05,_0x4d9c98,_0x5676fb){ChatGroupEvents[_0x5278('0x4')](_0x399920+':'+_0x47af05['id'],_0x47af05);ChatGroupEvents['emit'](_0x399920,_0x47af05);_0x5676fb(null);};}for(var e in events){if(events[_0x5278('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x5278('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x8ad9=['ChatGroup','setMaxListeners','update','emit','hook','exports'];(function(_0x365a38,_0x5061fd){var _0x58f0ed=function(_0x3cf612){while(--_0x3cf612){_0x365a38['push'](_0x365a38['shift']());}};_0x58f0ed(++_0x5061fd);}(_0x8ad9,0x126));var _0x98ad=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x8ad9[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x98ad('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x98ad('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x98ad('0x2'),'afterDestroy':'remove'};function emitEvent(_0x971c49){return function(_0x308334,_0x1056f7,_0x1dabbd){ChatGroupEvents[_0x98ad('0x3')](_0x971c49+':'+_0x308334['id'],_0x308334);ChatGroupEvents[_0x98ad('0x3')](_0x971c49,_0x308334);_0x1dabbd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x98ad('0x4')](e,emitEvent(event));}}module[_0x98ad('0x5')]=ChatGroupEvents;
\ No newline at end of file
index df66229..6f9b6cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d9c=['util','../../config/logger','api','moment','bluebird','request-promise','./chatGroup.attributes','exports','define','chat_groups'];(function(_0x4685a7,_0x7acd54){var _0x2e3d34=function(_0x2043a6){while(--_0x2043a6){_0x4685a7['push'](_0x4685a7['shift']());}};_0x2e3d34(++_0x7acd54);}(_0x1d9c,0x104));var _0xc1d9=function(_0x45ee1f,_0x27e290){_0x45ee1f=_0x45ee1f-0x0;var _0x39d604=_0x1d9c[_0x45ee1f];return _0x39d604;};'use strict';var _=require('lodash');var util=require(_0xc1d9('0x0'));var logger=require(_0xc1d9('0x1'))(_0xc1d9('0x2'));var moment=require(_0xc1d9('0x3'));var BPromise=require(_0xc1d9('0x4'));var rp=require(_0xc1d9('0x5'));var attributes=require(_0xc1d9('0x6'));module[_0xc1d9('0x7')]=function(_0x5e2951,_0x1f7714){return _0x5e2951[_0xc1d9('0x8')]('ChatGroup',attributes,{'tableName':_0xc1d9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a88=['exports','ChatGroup','chat_groups','lodash','util','../../config/logger','bluebird','request-promise','./chatGroup.attributes'];(function(_0x75b25d,_0x3fbae3){var _0x3400de=function(_0x380c27){while(--_0x380c27){_0x75b25d['push'](_0x75b25d['shift']());}};_0x3400de(++_0x3fbae3);}(_0x9a88,0x1bc));var _0x89a8=function(_0x1c0bc3,_0x494894){_0x1c0bc3=_0x1c0bc3-0x0;var _0x16e9b0=_0x9a88[_0x1c0bc3];return _0x16e9b0;};'use strict';var _=require(_0x89a8('0x0'));var util=require(_0x89a8('0x1'));var logger=require(_0x89a8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x89a8('0x3'));var rp=require(_0x89a8('0x4'));var attributes=require(_0x89a8('0x5'));module[_0x89a8('0x6')]=function(_0x3a86ab,_0x1451d7){return _0x3a86ab['define'](_0x89a8('0x7'),attributes,{'tableName':_0x89a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7047c15..accba9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e5=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5f2b64,_0x169d36){var _0x3aa473=function(_0xc8d80c){while(--_0xc8d80c){_0x5f2b64['push'](_0x5f2b64['shift']());}};_0x3aa473(++_0x169d36);}(_0x34e5,0x172));var _0x534e=function(_0x119e91,_0x3459f3){_0x119e91=_0x119e91-0x0;var _0x5cc9f7=_0x34e5[_0x119e91];return _0x5cc9f7;};'use strict';var _=require('lodash');var util=require(_0x534e('0x0'));var moment=require('moment');var BPromise=require(_0x534e('0x1'));var rs=require(_0x534e('0x2'));var fs=require('fs');var Redis=require(_0x534e('0x3'));var db=require(_0x534e('0x4'))['db'];var utils=require(_0x534e('0x5'));var logger=require('../../config/logger')(_0x534e('0x6'));var config=require(_0x534e('0x7'));var jayson=require(_0x534e('0x8'));var client=jayson[_0x534e('0x9')][_0x534e('0xa')]({'port':0x232a});config[_0x534e('0xb')]=_[_0x534e('0xc')](config['redis'],{'host':_0x534e('0xd'),'port':0x18eb});var socket=require(_0x534e('0xe'))(new Redis(config[_0x534e('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x2f44a1,_0x4c495c,_0x3eb20c){return new BPromise(function(_0x55509d,_0xb30dd6){return client[_0x534e('0xf')](_0x2f44a1,_0x3eb20c)[_0x534e('0x10')](function(_0x529726){logger[_0x534e('0x11')](_0x534e('0x12'),_0x4c495c,_0x534e('0x13'));logger[_0x534e('0x14')](_0x534e('0x15'),_0x4c495c,'request\x20sent',JSON[_0x534e('0x16')](_0x529726));if(_0x529726[_0x534e('0x17')]){if(_0x529726[_0x534e('0x17')][_0x534e('0x18')]===0x1f4){logger[_0x534e('0x17')](_0x534e('0x12'),_0x4c495c,_0x529726[_0x534e('0x17')][_0x534e('0x19')]);return _0xb30dd6(_0x529726[_0x534e('0x17')]['message']);}logger[_0x534e('0x17')](_0x534e('0x12'),_0x4c495c,_0x529726['error']['message']);return _0x55509d(_0x529726[_0x534e('0x17')][_0x534e('0x19')]);}else{logger[_0x534e('0x11')](_0x534e('0x12'),_0x4c495c,_0x534e('0x13'));_0x55509d(_0x529726[_0x534e('0x1a')][_0x534e('0x19')]);}})['catch'](function(_0x1a7790){logger[_0x534e('0x17')](_0x534e('0x12'),_0x4c495c,_0x1a7790);_0xb30dd6(_0x1a7790);});});}
\ No newline at end of file
+var _0x7a2c=['error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x22ebbc,_0x181874){var _0x1ff2e2=function(_0x56b127){while(--_0x56b127){_0x22ebbc['push'](_0x22ebbc['shift']());}};_0x1ff2e2(++_0x181874);}(_0x7a2c,0x17b));var _0xc7a2=function(_0xe4e8a0,_0x3abe88){_0xe4e8a0=_0xe4e8a0-0x0;var _0x2dda4c=_0x7a2c[_0xe4e8a0];return _0x2dda4c;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var moment=require(_0xc7a2('0x1'));var BPromise=require(_0xc7a2('0x2'));var rs=require(_0xc7a2('0x3'));var fs=require('fs');var Redis=require(_0xc7a2('0x4'));var db=require(_0xc7a2('0x5'))['db'];var utils=require(_0xc7a2('0x6'));var logger=require(_0xc7a2('0x7'))(_0xc7a2('0x8'));var config=require('../../config/environment');var jayson=require(_0xc7a2('0x9'));var client=jayson[_0xc7a2('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xc7a2('0xb')],{'host':_0xc7a2('0xc'),'port':0x18eb});var socket=require(_0xc7a2('0xd'))(new Redis(config[_0xc7a2('0xb')]));require('./chatGroup.socket')[_0xc7a2('0xe')](socket);function respondWithRpcPromise(_0x27aa8c,_0x2cb74c,_0x558839){return new BPromise(function(_0x2c3f86,_0x4a44c7){return client[_0xc7a2('0xf')](_0x27aa8c,_0x558839)[_0xc7a2('0x10')](function(_0x1a9b38){logger['info'](_0xc7a2('0x11'),_0x2cb74c,_0xc7a2('0x12'));logger[_0xc7a2('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2cb74c,_0xc7a2('0x12'),JSON[_0xc7a2('0x14')](_0x1a9b38));if(_0x1a9b38[_0xc7a2('0x15')]){if(_0x1a9b38[_0xc7a2('0x15')][_0xc7a2('0x16')]===0x1f4){logger[_0xc7a2('0x15')](_0xc7a2('0x11'),_0x2cb74c,_0x1a9b38[_0xc7a2('0x15')][_0xc7a2('0x17')]);return _0x4a44c7(_0x1a9b38[_0xc7a2('0x15')][_0xc7a2('0x17')]);}logger[_0xc7a2('0x15')](_0xc7a2('0x11'),_0x2cb74c,_0x1a9b38[_0xc7a2('0x15')][_0xc7a2('0x17')]);return _0x2c3f86(_0x1a9b38['error'][_0xc7a2('0x17')]);}else{logger['info'](_0xc7a2('0x11'),_0x2cb74c,_0xc7a2('0x12'));_0x2c3f86(_0x1a9b38[_0xc7a2('0x18')][_0xc7a2('0x17')]);}})['catch'](function(_0x5a10ab){logger[_0xc7a2('0x15')](_0xc7a2('0x11'),_0x2cb74c,_0x5a10ab);_0x4a44c7(_0x5a10ab);});});}
\ No newline at end of file
index 2fa5cd4..8250db1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e9=['update','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x27fdcc,_0x421cb5){var _0x17c2de=function(_0x2fa372){while(--_0x2fa372){_0x27fdcc['push'](_0x27fdcc['shift']());}};_0x17c2de(++_0x421cb5);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var ChatGroupEvents=require(_0x949e('0x0'));var events=[_0x949e('0x1'),'remove',_0x949e('0x2')];function createListener(_0x1db1b8,_0x259795){return function(_0x5c303a){_0x259795['emit'](_0x1db1b8,_0x5c303a);};}function removeListener(_0x114f65,_0x4c284b){return function(){ChatGroupEvents[_0x949e('0x3')](_0x114f65,_0x4c284b);};}exports[_0x949e('0x4')]=function(_0x360308){for(var _0x56c7b2=0x0,_0x17f649=events[_0x949e('0x5')];_0x56c7b2<_0x17f649;_0x56c7b2++){var _0xfc4f8a=events[_0x56c7b2];var _0x34ee57=createListener(_0x949e('0x6')+_0xfc4f8a,_0x360308);ChatGroupEvents['on'](_0xfc4f8a,_0x34ee57);}};
\ No newline at end of file
+var _0x9d02=['./chatGroup.events','remove','emit','removeListener','register','length','chatGroup:'];(function(_0x4c17a8,_0x9b080d){var _0x4159bf=function(_0x46349b){while(--_0x46349b){_0x4c17a8['push'](_0x4c17a8['shift']());}};_0x4159bf(++_0x9b080d);}(_0x9d02,0x118));var _0x29d0=function(_0x474882,_0x4ec4dc){_0x474882=_0x474882-0x0;var _0x4930f0=_0x9d02[_0x474882];return _0x4930f0;};'use strict';var ChatGroupEvents=require(_0x29d0('0x0'));var events=['save',_0x29d0('0x1'),'update'];function createListener(_0x4519be,_0x48ea60){return function(_0x10d9e4){_0x48ea60[_0x29d0('0x2')](_0x4519be,_0x10d9e4);};}function removeListener(_0x58e99e,_0x33c00f){return function(){ChatGroupEvents[_0x29d0('0x3')](_0x58e99e,_0x33c00f);};}exports[_0x29d0('0x4')]=function(_0x5a9824){for(var _0x5ef279=0x0,_0x5e35b3=events[_0x29d0('0x5')];_0x5ef279<_0x5e35b3;_0x5ef279++){var _0x18a02c=events[_0x5ef279];var _0x4a4019=createListener(_0x29d0('0x6')+_0x18a02c,_0x5a9824);ChatGroupEvents['on'](_0x18a02c,_0x4a4019);}};
\ No newline at end of file
index 5f1088b..5f222fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5aad=['get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','/:id','update','delete','destroy','util','path','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0xc5e1d,_0x654b48){var _0x512549=function(_0x1eea3c){while(--_0x1eea3c){_0xc5e1d['push'](_0xc5e1d['shift']());}};_0x512549(++_0x654b48);}(_0x5aad,0x198));var _0xd5aa=function(_0xf5528b,_0xf00afe){_0xf5528b=_0xf5528b-0x0;var _0x53ba5b=_0x5aad[_0xf5528b];return _0x53ba5b;};'use strict';var multer=require('multer');var util=require(_0xd5aa('0x0'));var path=require(_0xd5aa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd5aa('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5aa('0x3'));var config=require(_0xd5aa('0x4'));var controller=require(_0xd5aa('0x5'));router[_0xd5aa('0x6')]('/',auth[_0xd5aa('0x7')](),controller[_0xd5aa('0x8')]);router['get'](_0xd5aa('0x9'),auth[_0xd5aa('0x7')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd5aa('0xa')]);router[_0xd5aa('0x6')]('/:id/unread',auth[_0xd5aa('0x7')](),controller['getUnread']);router[_0xd5aa('0x6')](_0xd5aa('0xb'),auth['isAuthenticated'](),controller[_0xd5aa('0xc')]);router[_0xd5aa('0x6')](_0xd5aa('0xd'),auth[_0xd5aa('0x7')](),controller[_0xd5aa('0xe')]);router[_0xd5aa('0xf')]('/',auth[_0xd5aa('0x7')](),controller[_0xd5aa('0x10')]);router[_0xd5aa('0xf')]('/:id/members',auth[_0xd5aa('0x7')](),controller[_0xd5aa('0x11')]);router[_0xd5aa('0xf')](_0xd5aa('0xd'),auth[_0xd5aa('0x7')](),controller['addMessage']);router[_0xd5aa('0x12')](_0xd5aa('0x13'),auth[_0xd5aa('0x7')](),controller[_0xd5aa('0x14')]);router[_0xd5aa('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xd5aa('0x16')]);router[_0xd5aa('0x15')](_0xd5aa('0xb'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x9104=['/:id/members','removeMembers','multer','util','path','connect-timeout','express','./chatGroup.controller','/describe','isAuthenticated','get','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete'];(function(_0x11912b,_0x181c20){var _0x338a62=function(_0x2995b9){while(--_0x2995b9){_0x11912b['push'](_0x11912b['shift']());}};_0x338a62(++_0x181c20);}(_0x9104,0x92));var _0x4910=function(_0x17758e,_0x540ccd){_0x17758e=_0x17758e-0x0;var _0x174785=_0x9104[_0x17758e];return _0x174785;};'use strict';var multer=require(_0x4910('0x0'));var util=require(_0x4910('0x1'));var path=require(_0x4910('0x2'));var timeout=require(_0x4910('0x3'));var express=require(_0x4910('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4910('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4910('0x6'),auth[_0x4910('0x7')](),controller['describe']);router[_0x4910('0x8')](_0x4910('0x9'),auth[_0x4910('0x7')](),controller[_0x4910('0xa')]);router[_0x4910('0x8')](_0x4910('0xb'),auth[_0x4910('0x7')](),controller['getUnread']);router[_0x4910('0x8')]('/:id/members',auth[_0x4910('0x7')](),controller[_0x4910('0xc')]);router[_0x4910('0x8')](_0x4910('0xd'),auth[_0x4910('0x7')](),controller[_0x4910('0xe')]);router[_0x4910('0xf')]('/',auth[_0x4910('0x7')](),controller[_0x4910('0x10')]);router[_0x4910('0xf')]('/:id/members',auth['isAuthenticated'](),controller[_0x4910('0x11')]);router[_0x4910('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0x4910('0x12')]);router[_0x4910('0x13')](_0x4910('0x9'),auth[_0x4910('0x7')](),controller[_0x4910('0x14')]);router[_0x4910('0x15')](_0x4910('0x9'),auth[_0x4910('0x7')](),controller['destroy']);router[_0x4910('0x15')](_0x4910('0x16'),auth[_0x4910('0x7')](),controller[_0x4910('0x17')]);module['exports']=router;
\ No newline at end of file
index 1dede39..0faf133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['sequelize','exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','out'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x537004,_0x414ec5){_0x537004=_0x537004-0x0;var _0x2b7a2d=_0x6f7a[_0x537004];return _0x2b7a2d;};'use strict';var Sequelize=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]={'closed':{'type':Sequelize[_0xa6f7('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa6f7('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xa6f7('0x4'),_0xa6f7('0x5')),'defaultValue':_0xa6f7('0x4')},'ratingMessage':{'type':Sequelize[_0xa6f7('0x6')]},'pathTranscript':{'type':Sequelize[_0xa6f7('0x6')]},'mailTranscript':{'type':Sequelize[_0xa6f7('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa6f7('0x8')]},'disposition':{'type':Sequelize[_0xa6f7('0x7')]},'note':{'type':Sequelize[_0xa6f7('0x7')]},'browserName':{'type':Sequelize[_0xa6f7('0x7')]},'browserVersion':{'type':Sequelize[_0xa6f7('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xa6f7('0x7')]},'deviceVendor':{'type':Sequelize[_0xa6f7('0x7')]},'deviceType':{'type':Sequelize[_0xa6f7('0x7')]},'referer':{'type':Sequelize[_0xa6f7('0x7')]},'customerIp':{'type':Sequelize[_0xa6f7('0x7')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0xa6f7('0x8')]},'lastMsgAt':{'type':Sequelize[_0xa6f7('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa6f7('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa74f=['BOOLEAN','star','thumb','TEXT','STRING','DATE','out'];(function(_0x5983cd,_0x18ea39){var _0x4778c2=function(_0x5ca85e){while(--_0x5ca85e){_0x5983cd['push'](_0x5983cd['shift']());}};_0x4778c2(++_0x18ea39);}(_0xa74f,0x9a));var _0xfa74=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0xa74f[_0x46800d];return _0x3824cd;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xfa74('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0xfa74('0x1'),_0xfa74('0x2')),'defaultValue':_0xfa74('0x1')},'ratingMessage':{'type':Sequelize[_0xfa74('0x3')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xfa74('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfa74('0x4')]},'browserName':{'type':Sequelize[_0xfa74('0x4')]},'browserVersion':{'type':Sequelize[_0xfa74('0x4')]},'osName':{'type':Sequelize[_0xfa74('0x4')]},'osVersion':{'type':Sequelize[_0xfa74('0x4')]},'deviceModel':{'type':Sequelize[_0xfa74('0x4')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xfa74('0x4')]},'referer':{'type':Sequelize[_0xfa74('0x4')]},'customerIp':{'type':Sequelize[_0xfa74('0x4')]},'formData':{'type':Sequelize[_0xfa74('0x3')]('long')},'read1stAt':{'type':Sequelize[_0xfa74('0x5')]},'lastMsgAt':{'type':Sequelize[_0xfa74('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfa74('0x6')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfa74('0x4')]}};
\ No newline at end of file
index ae2e890..455d4d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x984b=['host','port','secure','authentication','pass','SendMail','sendMail','email','user','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','keys','ChatInteractionId','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','addTags','setTags','spread','chatInteractionTags:save','removeTags','unix','server','attachments','firstName','Attachment','Letter','1cm','mkdirSync','<h1>Chat\x20Interaction:\x20#%d</h1>','<h2>Date:\x20%s</h2>','toString','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','existsSync','createReadStream','pipe','toFile','interaction-','.pdf','log','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','rawAttributes','query','dateEnd','dateStart','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','filter','map','type','key','field','options','include','tag','push','Tags','distinct','read','ChatMessage','direction','createdAt','includeAll','User','Users','fullname','Contact','Owner','Account','Messages','Tag','color','ChatInteraction','findAll','rows','params','find','body','describe','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Sequelize','ValidationError','Interaction\x20already\x20assigned','closed','closedAt','AbandonInteraction','abandon','originalname','basename','file','mimetype','create','attachmentDownload','findOne','Unauthorized','attachId','download','root','close','mailTranscript','join','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatWebsiteId','CmContact','format','%s%d','System','agentIdentifier','website_alias','agentAlias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x984b,0xee));var _0xb984=function(_0x2d9ce2,_0x8e490e){_0x2d9ce2=_0x2d9ce2-0x0;var _0x1b11b5=_0x984b[_0x2d9ce2];return _0x1b11b5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb984('0x0'));var jsonpatch=require(_0xb984('0x1'));var rp=require(_0xb984('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb984('0x3'));var util=require(_0xb984('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xb984('0x5'));var ejs=require(_0xb984('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb984('0x7'));var crypto=require(_0xb984('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xb984('0x9'));var toCsv=require('to-csv');var querystring=require(_0xb984('0xa'));var Papa=require(_0xb984('0xb'));var Redis=require(_0xb984('0xc'));var qs=require(_0xb984('0xd'));var logger=require(_0xb984('0xe'))(_0xb984('0xf'));var utils=require(_0xb984('0x10'));var config=require(_0xb984('0x11'));var db=require(_0xb984('0x12'))['db'];config[_0xb984('0x13')]=_[_0xb984('0x14')](config[_0xb984('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xb984('0x15'))(new Redis(config['redis']));require(_0xb984('0x16'))[_0xb984('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb984('0x18')][_0xb984('0x19')]({'port':0x232b});var client9004=jayson['client'][_0xb984('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x7a1b60,_0x549791,_0xede12d,_0x4073cb){return new BPromise(function(_0x57365c,_0x6fae41){var _0x5cd1aa=_0x4073cb||client;return _0x5cd1aa[_0xb984('0x1a')](_0x7a1b60,_0xede12d)[_0xb984('0x1b')](function(_0x3238a6){logger[_0xb984('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x549791,_0xb984('0x1d'));logger[_0xb984('0x1e')](_0xb984('0x1f'),_0x549791,_0xb984('0x1d'),JSON[_0xb984('0x20')](_0x3238a6));if(_0x3238a6[_0xb984('0x21')]){if(_0x3238a6['error'][_0xb984('0x22')]===0x1f4){logger[_0xb984('0x21')](_0xb984('0x23'),_0x549791,_0x3238a6[_0xb984('0x21')][_0xb984('0x24')]);return _0x6fae41(_0x3238a6[_0xb984('0x21')]['message']);}logger[_0xb984('0x21')](_0xb984('0x23'),_0x549791,_0x3238a6['error'][_0xb984('0x24')]);return _0x57365c(_0x3238a6[_0xb984('0x21')][_0xb984('0x24')]);}else{logger[_0xb984('0x1c')](_0xb984('0x23'),_0x549791,_0xb984('0x1d'));_0x57365c(_0x3238a6[_0xb984('0x25')]['message']);}})[_0xb984('0x26')](function(_0x25de23){logger[_0xb984('0x21')]('ChatInteraction,\x20%s,\x20%s',_0x549791,_0x25de23);_0x6fae41(_0x25de23);});});}function respondWithStatusCode(_0x2da621,_0x2e806e){_0x2e806e=_0x2e806e||0xcc;return function(_0x1cb2c2){if(_0x1cb2c2){return _0x2da621[_0xb984('0x27')](_0x2e806e);}return _0x2da621[_0xb984('0x28')](_0x2e806e)[_0xb984('0x29')]();};}function respondWithResult(_0x1faa95,_0x4b3da0){_0x4b3da0=_0x4b3da0||0xc8;return function(_0x5d93d9){if(_0x5d93d9){return _0x1faa95[_0xb984('0x28')](_0x4b3da0)[_0xb984('0x2a')](_0x5d93d9);}};}function respondWithFilteredResult(_0x3e254b,_0x2bd0f2){return function(_0x4fb896){if(_0x4fb896){var _0xa44895=_0x4fb896[_0xb984('0x2b')],_0x67e4d3=_0x2bd0f2[_0xb984('0x2c')],_0x476811=_0x2bd0f2[_0xb984('0x2c')]+_0x2bd0f2[_0xb984('0x2d')],_0x482a9f;if(_0x476811>=_0xa44895){_0x476811=_0xa44895;_0x482a9f=0xc8;}else{_0x482a9f=0xce;}_0x3e254b['status'](_0x482a9f);return _0x3e254b['set']('Content-Range',_0x67e4d3+'-'+_0x476811+'/'+_0xa44895)[_0xb984('0x2a')](_0x4fb896);}return null;};}function patchUpdates(_0x23ecf6){return function(_0x58a98c){try{jsonpatch[_0xb984('0x2e')](_0x58a98c,_0x23ecf6,!![]);}catch(_0x2bb03f){return BPromise[_0xb984('0x2f')](_0x2bb03f);}return _0x58a98c[_0xb984('0x30')]();};}function saveUpdates(_0x518bef,_0x4bb6da){return function(_0x315f70){if(_0x315f70){return _0x315f70[_0xb984('0x31')](_0x518bef)[_0xb984('0x1b')](function(_0x135435){return _0x135435;});}return null;};}function removeEntity(_0x4df9e0,_0x44ef84){return function(_0x35b37f){if(_0x35b37f){return _0x35b37f[_0xb984('0x32')]()[_0xb984('0x1b')](function(){_0x4df9e0[_0xb984('0x28')](0xcc)[_0xb984('0x29')]();});}};}function handleEntityNotFound(_0x5f4426,_0x54a293){return function(_0x2f7eca){if(!_0x2f7eca){_0x5f4426[_0xb984('0x27')](0x194);}return _0x2f7eca;};}function handleError(_0x2ed13e,_0x371c6a){_0x371c6a=_0x371c6a||0x1f4;return function(_0x30891c){logger['error'](_0x30891c[_0xb984('0x33')]);if(_0x30891c[_0xb984('0x34')]){delete _0x30891c['name'];}_0x2ed13e['status'](_0x371c6a)[_0xb984('0x35')](_0x30891c);};}exports['index']=function(_0xad9e0c,_0x3acc6a){var _0x5e8d57={},_0x349db9={},_0x4f2f3d={'count':0x0,'rows':[]};var _0x3cfc94=db['ChatInteraction'][_0xb984('0x36')];_0x349db9['model']=_['keys'](_0x3cfc94);var _0xf6d925={'dateStart':_0xad9e0c[_0xb984('0x37')]['dateStart'],'dateEnd':_0xad9e0c[_0xb984('0x37')][_0xb984('0x38')]};delete _0xad9e0c['query'][_0xb984('0x39')];delete _0xad9e0c[_0xb984('0x37')][_0xb984('0x38')];_0x349db9[_0xb984('0x37')]=_['keys'](_0xad9e0c[_0xb984('0x37')]);_0x349db9[_0xb984('0x3a')]=_[_0xb984('0x3b')](_0x349db9[_0xb984('0x3c')],_0x349db9[_0xb984('0x37')]);_0x5e8d57[_0xb984('0x3d')]=_[_0xb984('0x3b')](_0x349db9[_0xb984('0x3c')],qs[_0xb984('0x3e')](_0xad9e0c[_0xb984('0x37')]['fields']));_0x5e8d57[_0xb984('0x3d')]=_0x5e8d57[_0xb984('0x3d')][_0xb984('0x3f')]?_0x5e8d57[_0xb984('0x3d')]:_0x349db9[_0xb984('0x3c')];if(!_0xad9e0c[_0xb984('0x37')][_0xb984('0x40')](_0xb984('0x41'))){_0x5e8d57['limit']=qs['limit'](_0xad9e0c[_0xb984('0x37')]['limit']);_0x5e8d57[_0xb984('0x2c')]=qs[_0xb984('0x2c')](_0xad9e0c[_0xb984('0x37')][_0xb984('0x2c')]);}_0x5e8d57['order']=qs[_0xb984('0x42')](_0xad9e0c[_0xb984('0x37')]['sort']);_0x5e8d57[_0xb984('0x43')]=qs[_0xb984('0x3a')](_[_0xb984('0x44')](_0xad9e0c[_0xb984('0x37')],_0x349db9[_0xb984('0x3a')]));if(_0xf6d925[_0xb984('0x39')]){if(_0xf6d925[_0xb984('0x38')]){_0xf6d925['dateEnd']=moment(_0xf6d925[_0xb984('0x38')])[_0xb984('0x45')](0x1,'day');}else{_0xf6d925['dateEnd']=moment(_0xf6d925[_0xb984('0x39')])[_0xb984('0x45')](0x1,_0xb984('0x46'));}_[_0xb984('0x47')](_0x5e8d57[_0xb984('0x43')],{'createdAt':{'$gte':_0xf6d925['dateStart'],'$lte':_0xf6d925[_0xb984('0x38')]}});}if(_0xad9e0c[_0xb984('0x37')][_0xb984('0x48')]){_0x5e8d57[_0xb984('0x43')]=_[_0xb984('0x47')](_0x5e8d57[_0xb984('0x43')],{'$or':_[_0xb984('0x49')](_0x3cfc94,function(_0x198537){if(_0x198537[_0xb984('0x4a')][_0xb984('0x4b')]!=='VIRTUAL'){var _0x31d09={};_0x31d09[_0x198537[_0xb984('0x4c')]]={'$like':'%'+_0xad9e0c['query'][_0xb984('0x48')]+'%'};return _0x31d09;}})});}_0x5e8d57=_[_0xb984('0x47')]({},_0x5e8d57,_0xad9e0c[_0xb984('0x4d')]);var _0x381039={'where':_0x5e8d57[_0xb984('0x43')]};_0x381039[_0xb984('0x4e')]=[];if(_0xad9e0c[_0xb984('0x37')][_0xb984('0x4f')]){_0x381039[_0xb984('0x4e')][_0xb984('0x50')]({'model':db['Tag'],'as':_0xb984('0x51'),'attributes':['id'],'where':{'id':_0xad9e0c[_0xb984('0x37')][_0xb984('0x4f')]},'required':!![]});_0x381039[_0xb984('0x52')]=!![];}if(_0xad9e0c[_0xb984('0x37')][_0xb984('0x53')]){_0x381039[_0xb984('0x4e')][_0xb984('0x50')]({'model':db[_0xb984('0x54')],'as':'Messages','attributes':['id',_0xb984('0x55'),_0xb984('0x56'),_0xb984('0x53')],'where':{'direction':'in','read':_0xad9e0c['query'][_0xb984('0x53')]||![]},'required':!![]});_0x381039[_0xb984('0x52')]=!![];}return db['ChatInteraction'][_0xb984('0x2b')](_0x381039)['then'](function(_0x364416){_0x4f2f3d[_0xb984('0x2b')]=_0x364416;if(_0xad9e0c['query'][_0xb984('0x57')]){_0x5e8d57[_0xb984('0x4e')]=[{'model':db[_0xb984('0x58')],'as':_0xb984('0x59'),'required':![],'attributes':['id',_0xb984('0x34'),_0xb984('0x5a')]},{'model':db['CmContact'],'as':_0xb984('0x5b'),'required':![]},{'model':db['User'],'as':_0xb984('0x5c'),'attributes':[_0xb984('0x34'),_0xb984('0x5a'),'internal'],'required':![]},{'model':db['ChatWebsite'],'as':_0xb984('0x5d'),'attributes':[_0xb984('0x34'),'key'],'required':![]},{'model':db['ChatMessage'],'as':_0xb984('0x5e'),'attributes':['id',_0xb984('0x55'),_0xb984('0x56'),_0xb984('0x53')],'where':{'direction':'in','read':_0xad9e0c[_0xb984('0x37')][_0xb984('0x53')]||![]},'required':_0xad9e0c['query']['read']||![]},{'model':db[_0xb984('0x5f')],'as':_0xb984('0x51'),'attributes':['id','name',_0xb984('0x60')],'required':_0xad9e0c[_0xb984('0x37')][_0xb984('0x4f')]?!![]:![]},{'model':db[_0xb984('0x5f')],'as':'ThroughTags','attributes':['id','name',_0xb984('0x60')],'through':_0xad9e0c[_0xb984('0x37')][_0xb984('0x4f')]?{'attributes':[],'where':{'TagId':_0xad9e0c[_0xb984('0x37')][_0xb984('0x4f')]||undefined}}:{},'required':_0xad9e0c[_0xb984('0x37')]['tag']?!![]:![]}];}return db[_0xb984('0x61')][_0xb984('0x62')](_0x5e8d57);})[_0xb984('0x1b')](function(_0x345e1d){_0x4f2f3d[_0xb984('0x63')]=_0x345e1d;return _0x4f2f3d;})[_0xb984('0x1b')](respondWithFilteredResult(_0x3acc6a,_0x5e8d57))['catch'](handleError(_0x3acc6a,null));};exports['show']=function(_0x518120,_0x1b596d){var _0x8650a6={'raw':![],'where':{'id':_0x518120[_0xb984('0x64')]['id']}},_0x36ca94={};_0x36ca94[_0xb984('0x3c')]=_['keys'](db[_0xb984('0x61')][_0xb984('0x36')]);_0x36ca94[_0xb984('0x37')]=_['keys'](_0x518120[_0xb984('0x37')]);_0x36ca94[_0xb984('0x3a')]=_['intersection'](_0x36ca94['model'],_0x36ca94[_0xb984('0x37')]);_0x8650a6['attributes']=_['intersection'](_0x36ca94[_0xb984('0x3c')],qs['fields'](_0x518120[_0xb984('0x37')][_0xb984('0x3e')]));_0x8650a6[_0xb984('0x3d')]=_0x8650a6[_0xb984('0x3d')][_0xb984('0x3f')]?_0x8650a6[_0xb984('0x3d')]:_0x36ca94[_0xb984('0x3c')];if(_0x518120[_0xb984('0x37')][_0xb984('0x57')]){_0x8650a6[_0xb984('0x4e')]=[{'all':!![]}];}_0x8650a6=_[_0xb984('0x47')]({},_0x8650a6,_0x518120[_0xb984('0x4d')]);return db['ChatInteraction'][_0xb984('0x65')](_0x8650a6)[_0xb984('0x1b')](handleEntityNotFound(_0x1b596d,null))[_0xb984('0x1b')](respondWithResult(_0x1b596d,null))['catch'](handleError(_0x1b596d,null));};exports['create']=function(_0x2adf1d,_0x285e1e){return db[_0xb984('0x61')]['create'](_0x2adf1d[_0xb984('0x66')],{})[_0xb984('0x1b')](respondWithResult(_0x285e1e,0xc9))[_0xb984('0x26')](handleError(_0x285e1e,null));};exports[_0xb984('0x31')]=function(_0x434c5c,_0x1793e2){if(_0x434c5c[_0xb984('0x66')]['id']){delete _0x434c5c[_0xb984('0x66')]['id'];}return db[_0xb984('0x61')][_0xb984('0x65')]({'where':{'id':_0x434c5c[_0xb984('0x64')]['id']}})[_0xb984('0x1b')](handleEntityNotFound(_0x1793e2,null))[_0xb984('0x1b')](saveUpdates(_0x434c5c[_0xb984('0x66')],null))['then'](respondWithResult(_0x1793e2,null))[_0xb984('0x26')](handleError(_0x1793e2,null));};exports['destroy']=function(_0x2acfc1,_0x486464){return db[_0xb984('0x61')][_0xb984('0x65')]({'where':{'id':_0x2acfc1[_0xb984('0x64')]['id']}})[_0xb984('0x1b')](handleEntityNotFound(_0x486464,null))[_0xb984('0x1b')](removeEntity(_0x486464,null))[_0xb984('0x26')](handleError(_0x486464,null));};exports[_0xb984('0x67')]=function(_0x2319aa,_0x3bc1d3){return db[_0xb984('0x61')][_0xb984('0x67')]()[_0xb984('0x1b')](respondWithResult(_0x3bc1d3,null))[_0xb984('0x26')](handleError(_0x3bc1d3,null));};exports['customUpdate']=function(_0x4886bf,_0x917c53){if(_0x4886bf[_0xb984('0x66')]['id']){delete _0x4886bf[_0xb984('0x66')]['id'];}return db['ChatInteraction'][_0xb984('0x65')]({'where':{'id':_0x4886bf[_0xb984('0x64')]['id']}})['then'](handleEntityNotFound(_0x917c53,null))['then'](saveUpdates(_0x4886bf['body'],null))[_0xb984('0x1b')](respondWithResult(_0x917c53,null))['catch'](handleError(_0x917c53,null));};exports['abandon']=function(_0x56500d,_0x2c4b19,_0x1ecc45){if(_0x56500d[_0xb984('0x66')]['id']){delete _0x56500d[_0xb984('0x66')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x56500d[_0xb984('0x64')]['id']}})[_0xb984('0x1b')](function(_0x3c6050){if(!_0x3c6050){logger[_0xb984('0x21')](_0xb984('0x68'),'abandon',0x194,_0xb984('0x69'));_0x2c4b19[_0xb984('0x27')](0x194);}else{if(_0x3c6050[_0xb984('0x6a')]){throw new db[(_0xb984('0x6b'))][(_0xb984('0x6c'))](_0xb984('0x6d'));}}return _0x3c6050;})['then'](function(_0x1bb691){if(_0x1bb691){return _0x1bb691['update']({'closed':_0x56500d[_0xb984('0x66')][_0xb984('0x6e')],'closedAt':_0x56500d[_0xb984('0x66')][_0xb984('0x6f')],'disposition':_0x56500d[_0xb984('0x66')]['disposition']})[_0xb984('0x1b')](function(_0x203915){return _0x203915;});}})[_0xb984('0x1b')](function(_0x4c4e45){return respondWithRpcPromise(_0xb984('0x70'),_0xb984('0x71'),_0x56500d[_0xb984('0x66')],client9004);})[_0xb984('0x1b')](respondWithResult(_0x2c4b19,null))[_0xb984('0x26')](handleError(_0x2c4b19,null));};exports['attachmentUpload']=function(_0x504d1a,_0x16ad6b,_0x31d101){_0x504d1a[_0xb984('0x66')][_0xb984('0x34')]=_0x504d1a['file'][_0xb984('0x72')];_0x504d1a[_0xb984('0x66')][_0xb984('0x73')]=_0x504d1a[_0xb984('0x74')]['filename'];_0x504d1a[_0xb984('0x66')][_0xb984('0x4a')]=_0x504d1a[_0xb984('0x74')][_0xb984('0x75')];return db['Attachment'][_0xb984('0x76')](_0x504d1a[_0xb984('0x66')])[_0xb984('0x1b')](respondWithResult(_0x16ad6b,0xc9))[_0xb984('0x26')](handleError(_0x16ad6b,null));};exports[_0xb984('0x77')]=function(_0x37c2b0,_0x540ce,_0x355604){return db[_0xb984('0x61')][_0xb984('0x78')]({'where':{'id':_0x37c2b0[_0xb984('0x64')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x540ce,null))[_0xb984('0x1b')](function(_0xa3150f){if(_0xa3150f){if(_0xa3150f[_0xb984('0x6e')]){return _0x540ce[_0xb984('0x28')](0x193)[_0xb984('0x2a')]({'status':0x193,'message':_0xb984('0x79')});}return db['Attachment'][_0xb984('0x78')]({'where':{'id':_0x37c2b0[_0xb984('0x37')][_0xb984('0x7a')]},'raw':!![]})[_0xb984('0x1b')](handleEntityNotFound(_0x540ce,null));}})['then'](function(_0x41a85f){if(_0x41a85f){return _0x540ce[_0xb984('0x7b')](path['join'](config[_0xb984('0x7c')],'server/files/attachments/',_0x41a85f['basename']));}})[_0xb984('0x26')](handleError(_0x540ce,null));};exports[_0xb984('0x7d')]=function(_0x1015fd,_0xc27f82){var _0x168d6c=null;var _0x3ce085=null;var _0x110745=null;var _0x1c588a=null;if(_0x1015fd[_0xb984('0x66')]['id']){delete _0x1015fd['body']['id'];}if(_0x1015fd['body'][_0xb984('0x7e')]){_0x1c588a=path[_0xb984('0x7f')](config[_0xb984('0x7c')],_0xb984('0x80'),util['format'](_0xb984('0x81'),Date[_0xb984('0x82')]()));_0x1015fd[_0xb984('0x66')][_0xb984('0x83')]=_0x1c588a;}return db[_0xb984('0x61')][_0xb984('0x65')]({'where':{'id':_0x1015fd['params']['id']},'include':[{'model':db[_0xb984('0x54')],'as':'Messages','include':[{'model':db[_0xb984('0x58')],'as':'User'}]}]})[_0xb984('0x1b')](handleEntityNotFound(_0xc27f82,null))['then'](saveUpdates(_0x1015fd['body'],null))[_0xb984('0x1b')](function(_0x41fb90){if(_0x41fb90){_0x168d6c=_0x41fb90;return db['ChatWebsite'][_0xb984('0x65')]({'where':{'id':_0x168d6c[_0xb984('0x84')]}});}})[_0xb984('0x1b')](function(_0x3dda0f){if(_0x3dda0f){_0x110745=_0x3dda0f;return db[_0xb984('0x85')]['find']({'where':{'id':_0x168d6c['ContactId']}});}})[_0xb984('0x1b')](function(_0x1b4a3f){if(_0x1b4a3f){_0x3ce085=_0x1b4a3f;if(_0x1c588a){var _0x583ee7=null;for(var _0x42a63d=0x1;_0x42a63d<_0x168d6c[_0xb984('0x5e')][_0xb984('0x3f')];++_0x42a63d){_0x583ee7=_0x168d6c['Messages'][_0x42a63d];var _0x52f937=_0x583ee7['UserId']?util[_0xb984('0x86')](_0xb984('0x87'),_0x110745['agentAlias'],_0x583ee7[_0xb984('0x6a')]):_0xb984('0x88');var _0x328025=_0x1015fd[_0xb984('0x66')]['customer']||util['format']('%s%d','Visitor',_0x583ee7['ContactId']);switch(_0x110745[_0xb984('0x89')]){case _0xb984('0x8a'):_0x52f937=_0x583ee7[_0xb984('0x6a')]?util[_0xb984('0x86')](_0xb984('0x87'),_0x110745[_0xb984('0x8b')],_0x583ee7['UserId']):_0xb984('0x88');break;case'agent_alias':_0x52f937=_0x583ee7['UserId']?_0x583ee7[_0xb984('0x58')]['alias']||_0x583ee7[_0xb984('0x58')][_0xb984('0x5a')]:'System';break;case _0xb984('0x8c'):_0x52f937=_0x583ee7[_0xb984('0x6a')]?_0x583ee7[_0xb984('0x58')][_0xb984('0x5a')]:_0xb984('0x88');break;default:_0x52f937=_0x583ee7[_0xb984('0x6a')]?util[_0xb984('0x86')](_0xb984('0x87'),_0x110745[_0xb984('0x8b')],_0x583ee7[_0xb984('0x6a')]):_0xb984('0x88');}var _0xfe6cc2=util[_0xb984('0x86')]('[%s]\x20%s:\x20%s\x0a',moment(_0x583ee7[_0xb984('0x56')])['format'](_0xb984('0x8d')),_0x583ee7['direction']==='in'?_0x328025:_0x52f937,_0x583ee7[_0xb984('0x66')]);if(!_0x583ee7[_0xb984('0x8e')]){fs[_0xb984('0x8f')](_0x1c588a,_0xfe6cc2);}}return db[_0xb984('0x90')][_0xb984('0x78')]({'where':{'service':!![]},'include':[{'model':db[_0xb984('0x91')],'as':_0xb984('0x92'),'raw':!![]}]});}}})['then'](function(_0x18c666){if(_0x18c666&&_0x18c666[_0xb984('0x92')]&&_0x1015fd[_0xb984('0x66')]){var _0x293fc4={'tls':{'rejectUnauthorized':![]}};if(_0x18c666[_0xb984('0x92')][_0xb984('0x93')]){_0x293fc4[_0xb984('0x93')]=_0x18c666[_0xb984('0x92')][_0xb984('0x93')];}else{_0x293fc4['host']=_0x18c666[_0xb984('0x92')][_0xb984('0x94')];_0x293fc4[_0xb984('0x95')]=_0x18c666[_0xb984('0x92')][_0xb984('0x95')];_0x293fc4[_0xb984('0x96')]=_0x18c666[_0xb984('0x92')][_0xb984('0x96')];}if(_0x18c666[_0xb984('0x92')][_0xb984('0x97')]){_0x293fc4['auth']={'user':_0x18c666[_0xb984('0x92')]['user'],'pass':_0x18c666[_0xb984('0x92')][_0xb984('0x98')]};}return respondWithRpcPromise(_0xb984('0x99'),_0xb984('0x9a'),{'account':_0x293fc4,'message':{'from':util[_0xb984('0x86')]('\x22%s\x22\x20<%s>',_0x18c666[_0xb984('0x34')],_0x18c666[_0xb984('0x9b')]||_0x18c666['Smtp'][_0xb984('0x9c')]),'to':_0x1015fd[_0xb984('0x66')][_0xb984('0x7e')],'subject':'Mail\x20Transcript','text':util[_0xb984('0x86')](_0xb984('0x9d'),_0x1015fd[_0xb984('0x66')][_0xb984('0x7e')]),'attachments':[{'path':_0x1c588a}]}})[_0xb984('0x1b')](function(){return _0x168d6c;})[_0xb984('0x26')](function(_0xc632e7){console[_0xb984('0x21')](_0xc632e7);});}else{return _0x168d6c;}})[_0xb984('0x1b')](respondWithStatusCode(_0xc27f82,0xc8))[_0xb984('0x26')](handleError(_0xc27f82,null));};exports['addMessage']=function(_0x5a8066,_0x595ce0,_0x23a346){return db[_0xb984('0x54')][_0xb984('0x65')]({'where':{'id':_0x5a8066[_0xb984('0x64')]['id']}})['then'](handleEntityNotFound(_0x595ce0,null))['then'](function(_0x4e268a){if(_0x4e268a){return _0x4e268a[_0xb984('0x9e')](_0x5a8066[_0xb984('0x66')]['ids'],_[_0xb984('0x9f')](_0x5a8066['body'],[_0xb984('0xa0'),'id'])||{});}})['then'](respondWithResult(_0x595ce0,null))[_0xb984('0x26')](handleError(_0x595ce0,null));};exports['getMessages']=function(_0xc526a9,_0x118b01,_0x530e08){var _0x2e8fb3={'raw':![],'where':{}};var _0x4e3041={};var _0x3b0e65={'count':0x0,'rows':[]};return db[_0xb984('0x61')][_0xb984('0x78')]({'where':{'id':_0xc526a9[_0xb984('0x64')]['id']}})['then'](handleEntityNotFound(_0x118b01,null))[_0xb984('0x1b')](function(_0x517fac){if(_0x517fac){_0x4e3041[_0xb984('0x3c')]=_[_0xb984('0xa1')](db[_0xb984('0x54')][_0xb984('0x36')]);_0x4e3041[_0xb984('0x37')]=_[_0xb984('0xa1')](_0xc526a9['query']);_0x4e3041[_0xb984('0x3a')]=_[_0xb984('0x3b')](_0x4e3041[_0xb984('0x3c')],_0x4e3041['query']);_0x2e8fb3[_0xb984('0x3d')]=_[_0xb984('0x3b')](_0x4e3041[_0xb984('0x3c')],qs['fields'](_0xc526a9[_0xb984('0x37')][_0xb984('0x3e')]));_0x2e8fb3[_0xb984('0x3d')]=_0x2e8fb3[_0xb984('0x3d')][_0xb984('0x3f')]?_0x2e8fb3[_0xb984('0x3d')]:_0x4e3041[_0xb984('0x3c')];if(!_0xc526a9[_0xb984('0x37')][_0xb984('0x40')]('nolimit')){_0x2e8fb3[_0xb984('0x2d')]=qs[_0xb984('0x2d')](_0xc526a9[_0xb984('0x37')][_0xb984('0x2d')]);_0x2e8fb3[_0xb984('0x2c')]=qs[_0xb984('0x2c')](_0xc526a9['query']['offset']);}_0x2e8fb3['order']=qs['sort'](_0xc526a9['query'][_0xb984('0x42')]);_0x2e8fb3[_0xb984('0x43')]=qs[_0xb984('0x3a')](_[_0xb984('0x44')](_0xc526a9[_0xb984('0x37')],_0x4e3041[_0xb984('0x3a')]));_0x2e8fb3[_0xb984('0x43')][_0xb984('0xa2')]=_0x517fac['id'];if(_0xc526a9[_0xb984('0x37')][_0xb984('0x48')]){_0x2e8fb3[_0xb984('0x43')]=_[_0xb984('0x47')](_0x2e8fb3[_0xb984('0x43')],{'$or':_[_0xb984('0x49')](_0x2e8fb3[_0xb984('0x3d')],function(_0x47229c){var _0x1bdebe={};_0x1bdebe[_0x47229c]={'$like':'%'+_0xc526a9[_0xb984('0x37')][_0xb984('0x48')]+'%'};return _0x1bdebe;})});}if(_0xc526a9[_0xb984('0x37')]['$gte']){var _0x21fa03=_0xc526a9[_0xb984('0x37')]['$gte'][_0xb984('0xa3')](',');var _0x36ffc1={};_0x36ffc1[_0x21fa03[0x0]]={'$gte':moment(_0x21fa03[0x1])[_0xb984('0x86')](_0xb984('0xa4'))};_0x2e8fb3[_0xb984('0x43')]=_[_0xb984('0x47')](_0x2e8fb3[_0xb984('0x43')],_0x36ffc1);}_0x2e8fb3=_[_0xb984('0x47')]({},_0x2e8fb3,_0xc526a9[_0xb984('0x4d')]);return db[_0xb984('0x54')][_0xb984('0x2b')]({'where':_0x2e8fb3[_0xb984('0x43')]})[_0xb984('0x1b')](function(_0x1a4dc6){_0x3b0e65[_0xb984('0x2b')]=_0x1a4dc6;if(_0xc526a9[_0xb984('0x37')][_0xb984('0x57')]){_0x2e8fb3[_0xb984('0x4e')]=[{'all':!![]}];}return db[_0xb984('0x54')][_0xb984('0x62')](_0x2e8fb3);})[_0xb984('0x1b')](function(_0x508c1b){_0x3b0e65[_0xb984('0x63')]=_0x508c1b;return _0x3b0e65;});}})['then'](respondWithFilteredResult(_0x118b01,_0x2e8fb3))['catch'](handleError(_0x118b01,null));};exports[_0xb984('0xa5')]=function(_0xf33075,_0x2ecd8a,_0x4b2996){var _0xe4006f={'where':{}},_0x1bca46={},_0x3860a1={'count':0x0,'rows':[]};return db[_0xb984('0x61')]['findOne']({'where':{'id':_0xf33075[_0xb984('0x64')]['id']}})[_0xb984('0x1b')](handleEntityNotFound(_0x2ecd8a,null))[_0xb984('0x1b')](function(_0x2a4478){if(_0x2a4478){_0x1bca46['model']=_[_0xb984('0xa1')](db['ChatMessage']['rawAttributes']);_0x1bca46[_0xb984('0x37')]=_[_0xb984('0xa1')](_0xf33075['query']);_0x1bca46[_0xb984('0x3a')]=_[_0xb984('0x3b')](_0x1bca46[_0xb984('0x3c')],_0x1bca46[_0xb984('0x37')]);_0xe4006f[_0xb984('0x3d')]=_['intersection'](_0x1bca46['model'],qs['fields'](_0xf33075['query'][_0xb984('0x3e')]));_0xe4006f[_0xb984('0x3d')]=_0xe4006f[_0xb984('0x3d')][_0xb984('0x3f')]?_0xe4006f[_0xb984('0x3d')]:_0x1bca46[_0xb984('0x3c')];if(!_0xf33075[_0xb984('0x37')][_0xb984('0x40')]('nolimit')){_0xe4006f[_0xb984('0x2d')]=qs[_0xb984('0x2d')](_0xf33075[_0xb984('0x37')]['limit']);_0xe4006f[_0xb984('0x2c')]=qs[_0xb984('0x2c')](_0xf33075[_0xb984('0x37')][_0xb984('0x2c')]);}_0xe4006f['order']=qs[_0xb984('0x42')](_0xf33075[_0xb984('0x37')]['sort']);_0xe4006f[_0xb984('0x43')]=qs['filters'](_[_0xb984('0x44')](_0xf33075[_0xb984('0x37')],_0x1bca46[_0xb984('0x3a')]));_0xe4006f[_0xb984('0x43')][_0xb984('0xa2')]=_0x2a4478['id'];if(_0xf33075[_0xb984('0x37')][_0xb984('0x48')]){_0xe4006f[_0xb984('0x43')]=_[_0xb984('0x47')](_0xe4006f['where'],{'$or':_[_0xb984('0x49')](_0xe4006f[_0xb984('0x3d')],function(_0x4342b0){var _0x111ebb={};_0x111ebb[_0x4342b0]={'$like':'%'+_0xf33075['query'][_0xb984('0x48')]+'%'};return _0x111ebb;})});}_0xe4006f['where'][_0xb984('0x8e')]=![];if(_0xf33075[_0xb984('0x37')]['id']){_0xe4006f['where']['id']={'$gt':_0xf33075[_0xb984('0x37')]['id']};}_0xe4006f=_[_0xb984('0x47')]({},_0xe4006f,_0xf33075[_0xb984('0x4d')]);return db[_0xb984('0x54')][_0xb984('0x2b')]({'where':_0xe4006f[_0xb984('0x43')]})[_0xb984('0x1b')](function(_0x243275){_0x3860a1[_0xb984('0x2b')]=_0x243275;_0xe4006f[_0xb984('0x4e')]=[];if(_0xf33075[_0xb984('0x37')]['includeAgent']){_0xe4006f[_0xb984('0x4e')][_0xb984('0x50')]({'model':db[_0xb984('0x58')],'as':_0xb984('0x58'),'attributes':['id',_0xb984('0x5a'),_0xb984('0xa6')]});}if(_0xf33075[_0xb984('0x37')]['includeAll']){_0xe4006f['include']=[{'all':!![]}];}return db[_0xb984('0x54')][_0xb984('0x62')](_0xe4006f);})[_0xb984('0x1b')](function(_0x7903b8){_0x3860a1[_0xb984('0x63')]=_0x7903b8;return _0x3860a1;});}})[_0xb984('0x1b')](respondWithFilteredResult(_0x2ecd8a,_0xe4006f))['catch'](handleError(_0x2ecd8a,null));};exports[_0xb984('0xa7')]=function(_0x2b934d,_0x198376,_0xe6d4e3){return db[_0xb984('0x61')][_0xb984('0x65')]({'where':{'id':_0x2b934d['params']['id']}})['then'](handleEntityNotFound(_0x198376,null))[_0xb984('0x1b')](function(_0x3bfc84){if(_0x3bfc84){return _0x3bfc84[_0xb984('0xa8')](_0x2b934d[_0xb984('0x66')][_0xb984('0xa0')],_[_0xb984('0x9f')](_0x2b934d[_0xb984('0x66')],[_0xb984('0xa0'),'id'])||{})[_0xb984('0xa9')](function(){return db[_0xb984('0x5f')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x2b934d[_0xb984('0x66')][_0xb984('0xa0')]}});})[_0xb984('0x1b')](function(_0x4ef53a){socket['emit'](_0xb984('0xaa'),{'id':Number(_0x2b934d['params']['id']),'tags':_0x4ef53a||[]});return{'id':Number(_0x2b934d['params']['id']),'tags':_0x4ef53a||[]};});}})[_0xb984('0x1b')](respondWithResult(_0x198376,null))[_0xb984('0x26')](handleError(_0x198376,null));};exports[_0xb984('0xab')]=function(_0x4a8494,_0x4a92ad,_0x16d36b){var _0x2c6f94;return db[_0xb984('0x61')]['find']({'where':{'id':_0x4a8494[_0xb984('0x64')]['id']}})[_0xb984('0x1b')](handleEntityNotFound(_0x4a92ad,null))[_0xb984('0x1b')](function(_0x27dc07){if(_0x27dc07){return _0x27dc07[_0xb984('0xab')](_0x4a8494[_0xb984('0x37')]['ids']);}})[_0xb984('0x1b')](respondWithStatusCode(_0x4a92ad,null))[_0xb984('0x26')](handleError(_0x4a92ad,null));};exports[_0xb984('0x7b')]=function(_0x5f1130,_0x10d9eb){var _0x430973=moment()[_0xb984('0xac')]()['toString']();var _0x2d7490=path[_0xb984('0x7f')](config[_0xb984('0x7c')],_0xb984('0xad'),'files','tmp');var _0x1ea1b1=path['join'](config[_0xb984('0x7c')],_0xb984('0xad'),'files',_0xb984('0xae'));var _0x51471c=path[_0xb984('0x7f')](_0x2d7490,_0x430973);var _0x52793a=util['format']('interaction-%s.zip',_0x430973);var _0x371d8a=path[_0xb984('0x7f')](_0x2d7490,_0x52793a);var _0x243fc2=![];return db['ChatInteraction'][_0xb984('0x65')]({'where':{'id':_0x5f1130['params']['id']},'include':[{'model':db[_0xb984('0x54')],'as':_0xb984('0x5e'),'attributes':['id',_0xb984('0x66')],'include':[{'model':db['User'],'as':_0xb984('0x58'),'attributes':['id',_0xb984('0x5a')],'raw':!![]},{'model':db[_0xb984('0x85')],'as':_0xb984('0x5b'),'attributes':['id',_0xb984('0xaf')],'raw':!![]},{'model':db[_0xb984('0xb0')],'as':_0xb984('0xb0'),'raw':!![]}]}]})[_0xb984('0x1b')](handleEntityNotFound(_0x10d9eb,null))['then'](function(_0x190954){if(_0x190954){_0x243fc2=!![];var _0x508b6a='';var _0x1af30d={'format':_0xb984('0xb1'),'border':_0xb984('0xb2')};fs[_0xb984('0xb3')](_0x51471c);_0x508b6a+=util['format'](_0xb984('0xb4'),_0x190954['id']);_0x508b6a+=util['format'](_0xb984('0xb5'),moment()[_0xb984('0x86')]('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')[_0xb984('0xb6')]());_0x508b6a+='<hr>';for(var _0xecd5e=0x1;_0xecd5e<_0x190954[_0xb984('0x5e')][_0xb984('0x3f')];_0xecd5e++){var _0xb47a60=_0x190954[_0xb984('0x5e')][_0xecd5e];_0x508b6a+=_0xb984('0xb7');_0x508b6a+=util[_0xb984('0x86')](_0xb984('0xb8'),_0xb47a60[_0xb984('0x58')]?_0xb47a60[_0xb984('0x58')][_0xb984('0x5a')]:_0xb47a60[_0xb984('0x5b')][_0xb984('0xaf')],_0xb47a60['body']);_0x508b6a+=_0xb984('0xb9');if(_0xb47a60['Attachment']){var _0x1657b9=_0xb47a60[_0xb984('0xb0')];var _0x4fbdcf=path['join'](_0x1ea1b1,_0x1657b9[_0xb984('0x73')]);if(fs[_0xb984('0xba')](_0x4fbdcf)){fs[_0xb984('0xbb')](_0x4fbdcf)[_0xb984('0xbc')](fs['createWriteStream'](path[_0xb984('0x7f')](_0x51471c,_0x1657b9[_0xb984('0x73')])));}}}return new BPromise(function(_0x309f1b,_0x537408){pdf[_0xb984('0x76')](_0x508b6a,_0x1af30d)[_0xb984('0xbd')](path[_0xb984('0x7f')](_0x51471c,_0xb984('0xbe')+_0x430973+_0xb984('0xbf')),function(_0x54ea8e,_0x2503e3){if(_0x54ea8e)return _0x537408(_0x54ea8e);_0x309f1b(_0x2503e3);});});}})[_0xb984('0x1b')](function(){if(_0x243fc2){return new BPromise(function(_0x466bcc,_0x112c21){zipdir(_0x51471c,{'saveTo':_0x371d8a},function(_0x199caf,_0xa3db63){if(_0x199caf)return _0x112c21(_0x199caf);return _0x466bcc(_0xa3db63);});});}})[_0xb984('0x1b')](function(){if(_0x243fc2){return new BPromise(function(_0x3489fe,_0xe52d78){rimraf(_0x51471c,function(_0x4a0c70){if(_0x4a0c70)_0xe52d78(_0x4a0c70);return _0x3489fe();});});}})[_0xb984('0x1b')](function(){if(_0x243fc2){return _0x10d9eb[_0xb984('0x7b')](_0x371d8a,_0x52793a,function(_0x569f7e){if(_0x569f7e){console[_0xb984('0xc0')]('err',_0x569f7e);}else{fs['unlinkSync'](_0x371d8a);}});}else{return _0x10d9eb[_0xb984('0x27')](0xc8);}})[_0xb984('0x26')](handleError(_0x10d9eb,null));};
\ No newline at end of file
+var _0xc978=['toString','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','existsSync','createReadStream','pipe','createWriteStream','.pdf','log','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','Content-Range','apply','destroy','stack','name','send','index','ChatInteraction','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','key','field','filter','options','include','tag','push','Tag','Tags','distinct','read','ChatMessage','Messages','direction','createdAt','count','includeAll','CmContact','Contact','User','Owner','fullname','internal','ChatWebsite','color','ThroughTags','findAll','show','find','create','body','update','params','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Sequelize','ValidationError','Interaction\x20already\x20assigned','closed','closedAt','AbandonInteraction','attachmentUpload','file','basename','type','mimetype','Attachment','findOne','Unauthorized','attachId','download','join','close','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatWebsiteId','%s%d','agentAlias','System','customer','Visitor','ContactId','agentIdentifier','website_alias','UserId','agent_alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','Smtp','service','host','port','secure','user','SendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','ChatInteractionId','includeAgent','rows','addTags','spread','emit','removeTags','unix','server','files','tmp','interaction-%s.zip','Letter','mkdirSync','<h2>Date:\x20%s</h2>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x8c97('0x0'));var emlformat=require(_0x8c97('0x1'));var rimraf=require(_0x8c97('0x2'));var zipdir=require(_0x8c97('0x3'));var jsonpatch=require(_0x8c97('0x4'));var rp=require(_0x8c97('0x5'));var moment=require('moment');var BPromise=require(_0x8c97('0x6'));var Mustache=require(_0x8c97('0x7'));var util=require(_0x8c97('0x8'));var path=require(_0x8c97('0x9'));var sox=require(_0x8c97('0xa'));var csv=require(_0x8c97('0xb'));var ejs=require(_0x8c97('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c97('0xd'));var crypto=require(_0x8c97('0xe'));var jsforce=require(_0x8c97('0xf'));var deskjs=require(_0x8c97('0x10'));var toCsv=require(_0x8c97('0xb'));var querystring=require(_0x8c97('0x11'));var Papa=require(_0x8c97('0x12'));var Redis=require('ioredis');var qs=require(_0x8c97('0x13'));var logger=require(_0x8c97('0x14'))(_0x8c97('0x15'));var utils=require(_0x8c97('0x16'));var config=require(_0x8c97('0x17'));var db=require(_0x8c97('0x18'))['db'];config[_0x8c97('0x19')]=_[_0x8c97('0x1a')](config[_0x8c97('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8c97('0x1b'))(new Redis(config[_0x8c97('0x19')]));require('./chatInteraction.socket')[_0x8c97('0x1c')](socket);var jayson=require(_0x8c97('0x1d'));var client=jayson['client'][_0x8c97('0x1e')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x57902c,_0x2d9aae,_0xab3812,_0x17065f){return new BPromise(function(_0xd0e5aa,_0x24a2a5){var _0x29767b=_0x17065f||client;return _0x29767b[_0x8c97('0x1f')](_0x57902c,_0xab3812)[_0x8c97('0x20')](function(_0x5ae85f){logger['info'](_0x8c97('0x21'),_0x2d9aae,_0x8c97('0x22'));logger[_0x8c97('0x23')](_0x8c97('0x24'),_0x2d9aae,_0x8c97('0x22'),JSON[_0x8c97('0x25')](_0x5ae85f));if(_0x5ae85f[_0x8c97('0x26')]){if(_0x5ae85f[_0x8c97('0x26')][_0x8c97('0x27')]===0x1f4){logger[_0x8c97('0x26')](_0x8c97('0x21'),_0x2d9aae,_0x5ae85f[_0x8c97('0x26')][_0x8c97('0x28')]);return _0x24a2a5(_0x5ae85f[_0x8c97('0x26')][_0x8c97('0x28')]);}logger[_0x8c97('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x2d9aae,_0x5ae85f[_0x8c97('0x26')][_0x8c97('0x28')]);return _0xd0e5aa(_0x5ae85f[_0x8c97('0x26')]['message']);}else{logger['info'](_0x8c97('0x21'),_0x2d9aae,'request\x20sent');_0xd0e5aa(_0x5ae85f[_0x8c97('0x29')][_0x8c97('0x28')]);}})[_0x8c97('0x2a')](function(_0x13a9de){logger[_0x8c97('0x26')](_0x8c97('0x21'),_0x2d9aae,_0x13a9de);_0x24a2a5(_0x13a9de);});});}function respondWithStatusCode(_0x18c81a,_0x5132c5){_0x5132c5=_0x5132c5||0xcc;return function(_0x4c6c1b){if(_0x4c6c1b){return _0x18c81a[_0x8c97('0x2b')](_0x5132c5);}return _0x18c81a[_0x8c97('0x2c')](_0x5132c5)[_0x8c97('0x2d')]();};}function respondWithResult(_0x50d003,_0x49b7fa){_0x49b7fa=_0x49b7fa||0xc8;return function(_0x25ef83){if(_0x25ef83){return _0x50d003[_0x8c97('0x2c')](_0x49b7fa)[_0x8c97('0x2e')](_0x25ef83);}};}function respondWithFilteredResult(_0x1609de,_0x34f8be){return function(_0x248f0b){if(_0x248f0b){var _0x5c5f5e=_0x248f0b['count'],_0x443dfd=_0x34f8be[_0x8c97('0x2f')],_0x509520=_0x34f8be[_0x8c97('0x2f')]+_0x34f8be['limit'],_0x2e8b90;if(_0x509520>=_0x5c5f5e){_0x509520=_0x5c5f5e;_0x2e8b90=0xc8;}else{_0x2e8b90=0xce;}_0x1609de[_0x8c97('0x2c')](_0x2e8b90);return _0x1609de['set'](_0x8c97('0x30'),_0x443dfd+'-'+_0x509520+'/'+_0x5c5f5e)[_0x8c97('0x2e')](_0x248f0b);}return null;};}function patchUpdates(_0x4e26a4){return function(_0x2ebba4){try{jsonpatch[_0x8c97('0x31')](_0x2ebba4,_0x4e26a4,!![]);}catch(_0x3644dd){return BPromise['reject'](_0x3644dd);}return _0x2ebba4['save']();};}function saveUpdates(_0x12a7d0,_0x26d5dc){return function(_0x2575d0){if(_0x2575d0){return _0x2575d0['update'](_0x12a7d0)[_0x8c97('0x20')](function(_0x5db7a4){return _0x5db7a4;});}return null;};}function removeEntity(_0x4a4d53,_0x27f76d){return function(_0x3d99b7){if(_0x3d99b7){return _0x3d99b7[_0x8c97('0x32')]()[_0x8c97('0x20')](function(){_0x4a4d53[_0x8c97('0x2c')](0xcc)[_0x8c97('0x2d')]();});}};}function handleEntityNotFound(_0x48f387,_0x35ca85){return function(_0x3168ba){if(!_0x3168ba){_0x48f387[_0x8c97('0x2b')](0x194);}return _0x3168ba;};}function handleError(_0x5c02ee,_0x28d869){_0x28d869=_0x28d869||0x1f4;return function(_0x40a4e5){logger[_0x8c97('0x26')](_0x40a4e5[_0x8c97('0x33')]);if(_0x40a4e5['name']){delete _0x40a4e5[_0x8c97('0x34')];}_0x5c02ee[_0x8c97('0x2c')](_0x28d869)[_0x8c97('0x35')](_0x40a4e5);};}exports[_0x8c97('0x36')]=function(_0x44df10,_0x1166f1){var _0x5946d7={},_0x473d52={},_0x441612={'count':0x0,'rows':[]};var _0x2beaaf=db[_0x8c97('0x37')][_0x8c97('0x38')];_0x473d52[_0x8c97('0x39')]=_[_0x8c97('0x3a')](_0x2beaaf);var _0x4639e2={'dateStart':_0x44df10[_0x8c97('0x3b')]['dateStart'],'dateEnd':_0x44df10[_0x8c97('0x3b')][_0x8c97('0x3c')]};delete _0x44df10[_0x8c97('0x3b')][_0x8c97('0x3d')];delete _0x44df10[_0x8c97('0x3b')][_0x8c97('0x3c')];_0x473d52['query']=_[_0x8c97('0x3a')](_0x44df10[_0x8c97('0x3b')]);_0x473d52[_0x8c97('0x3e')]=_[_0x8c97('0x3f')](_0x473d52[_0x8c97('0x39')],_0x473d52[_0x8c97('0x3b')]);_0x5946d7[_0x8c97('0x40')]=_[_0x8c97('0x3f')](_0x473d52[_0x8c97('0x39')],qs[_0x8c97('0x41')](_0x44df10[_0x8c97('0x3b')][_0x8c97('0x41')]));_0x5946d7[_0x8c97('0x40')]=_0x5946d7[_0x8c97('0x40')][_0x8c97('0x42')]?_0x5946d7[_0x8c97('0x40')]:_0x473d52[_0x8c97('0x39')];if(!_0x44df10[_0x8c97('0x3b')][_0x8c97('0x43')](_0x8c97('0x44'))){_0x5946d7['limit']=qs[_0x8c97('0x45')](_0x44df10[_0x8c97('0x3b')][_0x8c97('0x45')]);_0x5946d7[_0x8c97('0x2f')]=qs[_0x8c97('0x2f')](_0x44df10[_0x8c97('0x3b')]['offset']);}_0x5946d7[_0x8c97('0x46')]=qs[_0x8c97('0x47')](_0x44df10[_0x8c97('0x3b')][_0x8c97('0x47')]);_0x5946d7[_0x8c97('0x48')]=qs[_0x8c97('0x3e')](_[_0x8c97('0x49')](_0x44df10[_0x8c97('0x3b')],_0x473d52[_0x8c97('0x3e')]));if(_0x4639e2['dateStart']){if(_0x4639e2[_0x8c97('0x3c')]){_0x4639e2[_0x8c97('0x3c')]=moment(_0x4639e2[_0x8c97('0x3c')])[_0x8c97('0x4a')](0x1,_0x8c97('0x4b'));}else{_0x4639e2['dateEnd']=moment(_0x4639e2['dateStart'])[_0x8c97('0x4a')](0x1,'day');}_[_0x8c97('0x4c')](_0x5946d7[_0x8c97('0x48')],{'createdAt':{'$gte':_0x4639e2['dateStart'],'$lte':_0x4639e2[_0x8c97('0x3c')]}});}if(_0x44df10[_0x8c97('0x3b')]['filter']){_0x5946d7['where']=_[_0x8c97('0x4c')](_0x5946d7[_0x8c97('0x48')],{'$or':_['map'](_0x2beaaf,function(_0x52f6bb){if(_0x52f6bb['type'][_0x8c97('0x4d')]!=='VIRTUAL'){var _0x5e78f2={};_0x5e78f2[_0x52f6bb[_0x8c97('0x4e')]]={'$like':'%'+_0x44df10[_0x8c97('0x3b')][_0x8c97('0x4f')]+'%'};return _0x5e78f2;}})});}_0x5946d7=_[_0x8c97('0x4c')]({},_0x5946d7,_0x44df10[_0x8c97('0x50')]);var _0x19e586={'where':_0x5946d7['where']};_0x19e586[_0x8c97('0x51')]=[];if(_0x44df10[_0x8c97('0x3b')][_0x8c97('0x52')]){_0x19e586[_0x8c97('0x51')][_0x8c97('0x53')]({'model':db[_0x8c97('0x54')],'as':_0x8c97('0x55'),'attributes':['id'],'where':{'id':_0x44df10[_0x8c97('0x3b')][_0x8c97('0x52')]},'required':!![]});_0x19e586[_0x8c97('0x56')]=!![];}if(_0x44df10[_0x8c97('0x3b')][_0x8c97('0x57')]){_0x19e586[_0x8c97('0x51')]['push']({'model':db[_0x8c97('0x58')],'as':_0x8c97('0x59'),'attributes':['id',_0x8c97('0x5a'),_0x8c97('0x5b'),_0x8c97('0x57')],'where':{'direction':'in','read':_0x44df10[_0x8c97('0x3b')][_0x8c97('0x57')]||![]},'required':!![]});_0x19e586[_0x8c97('0x56')]=!![];}return db[_0x8c97('0x37')][_0x8c97('0x5c')](_0x19e586)[_0x8c97('0x20')](function(_0x35bdc6){_0x441612['count']=_0x35bdc6;if(_0x44df10[_0x8c97('0x3b')][_0x8c97('0x5d')]){_0x5946d7[_0x8c97('0x51')]=[{'model':db['User'],'as':'Users','required':![],'attributes':['id',_0x8c97('0x34'),'fullname']},{'model':db[_0x8c97('0x5e')],'as':_0x8c97('0x5f'),'required':![]},{'model':db[_0x8c97('0x60')],'as':_0x8c97('0x61'),'attributes':[_0x8c97('0x34'),_0x8c97('0x62'),_0x8c97('0x63')],'required':![]},{'model':db[_0x8c97('0x64')],'as':'Account','attributes':[_0x8c97('0x34'),_0x8c97('0x4d')],'required':![]},{'model':db[_0x8c97('0x58')],'as':_0x8c97('0x59'),'attributes':['id','direction',_0x8c97('0x5b'),'read'],'where':{'direction':'in','read':_0x44df10['query']['read']||![]},'required':_0x44df10[_0x8c97('0x3b')]['read']||![]},{'model':db[_0x8c97('0x54')],'as':_0x8c97('0x55'),'attributes':['id',_0x8c97('0x34'),_0x8c97('0x65')],'required':_0x44df10[_0x8c97('0x3b')][_0x8c97('0x52')]?!![]:![]},{'model':db[_0x8c97('0x54')],'as':_0x8c97('0x66'),'attributes':['id',_0x8c97('0x34'),_0x8c97('0x65')],'through':_0x44df10['query']['tag']?{'attributes':[],'where':{'TagId':_0x44df10[_0x8c97('0x3b')]['tag']||undefined}}:{},'required':_0x44df10[_0x8c97('0x3b')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x8c97('0x67')](_0x5946d7);})[_0x8c97('0x20')](function(_0x50aae4){_0x441612['rows']=_0x50aae4;return _0x441612;})[_0x8c97('0x20')](respondWithFilteredResult(_0x1166f1,_0x5946d7))[_0x8c97('0x2a')](handleError(_0x1166f1,null));};exports[_0x8c97('0x68')]=function(_0x2f49e3,_0x583527){var _0x45b45c={'raw':![],'where':{'id':_0x2f49e3['params']['id']}},_0x5e8595={};_0x5e8595[_0x8c97('0x39')]=_['keys'](db[_0x8c97('0x37')][_0x8c97('0x38')]);_0x5e8595[_0x8c97('0x3b')]=_[_0x8c97('0x3a')](_0x2f49e3[_0x8c97('0x3b')]);_0x5e8595['filters']=_[_0x8c97('0x3f')](_0x5e8595[_0x8c97('0x39')],_0x5e8595['query']);_0x45b45c[_0x8c97('0x40')]=_[_0x8c97('0x3f')](_0x5e8595['model'],qs[_0x8c97('0x41')](_0x2f49e3[_0x8c97('0x3b')][_0x8c97('0x41')]));_0x45b45c[_0x8c97('0x40')]=_0x45b45c[_0x8c97('0x40')]['length']?_0x45b45c[_0x8c97('0x40')]:_0x5e8595['model'];if(_0x2f49e3[_0x8c97('0x3b')]['includeAll']){_0x45b45c[_0x8c97('0x51')]=[{'all':!![]}];}_0x45b45c=_[_0x8c97('0x4c')]({},_0x45b45c,_0x2f49e3[_0x8c97('0x50')]);return db[_0x8c97('0x37')][_0x8c97('0x69')](_0x45b45c)[_0x8c97('0x20')](handleEntityNotFound(_0x583527,null))[_0x8c97('0x20')](respondWithResult(_0x583527,null))[_0x8c97('0x2a')](handleError(_0x583527,null));};exports[_0x8c97('0x6a')]=function(_0x5da113,_0x16ecda){return db[_0x8c97('0x37')][_0x8c97('0x6a')](_0x5da113[_0x8c97('0x6b')],{})[_0x8c97('0x20')](respondWithResult(_0x16ecda,0xc9))[_0x8c97('0x2a')](handleError(_0x16ecda,null));};exports[_0x8c97('0x6c')]=function(_0x5ca555,_0x5b357e){if(_0x5ca555[_0x8c97('0x6b')]['id']){delete _0x5ca555[_0x8c97('0x6b')]['id'];}return db[_0x8c97('0x37')][_0x8c97('0x69')]({'where':{'id':_0x5ca555['params']['id']}})[_0x8c97('0x20')](handleEntityNotFound(_0x5b357e,null))['then'](saveUpdates(_0x5ca555[_0x8c97('0x6b')],null))[_0x8c97('0x20')](respondWithResult(_0x5b357e,null))[_0x8c97('0x2a')](handleError(_0x5b357e,null));};exports[_0x8c97('0x32')]=function(_0x3ee0be,_0x1b0f58){return db[_0x8c97('0x37')][_0x8c97('0x69')]({'where':{'id':_0x3ee0be[_0x8c97('0x6d')]['id']}})['then'](handleEntityNotFound(_0x1b0f58,null))[_0x8c97('0x20')](removeEntity(_0x1b0f58,null))[_0x8c97('0x2a')](handleError(_0x1b0f58,null));};exports[_0x8c97('0x6e')]=function(_0x24eda1,_0x374c95){return db[_0x8c97('0x37')]['describe']()[_0x8c97('0x20')](respondWithResult(_0x374c95,null))['catch'](handleError(_0x374c95,null));};exports[_0x8c97('0x6f')]=function(_0x5b733f,_0x41fd8d){if(_0x5b733f[_0x8c97('0x6b')]['id']){delete _0x5b733f[_0x8c97('0x6b')]['id'];}return db[_0x8c97('0x37')]['find']({'where':{'id':_0x5b733f[_0x8c97('0x6d')]['id']}})['then'](handleEntityNotFound(_0x41fd8d,null))['then'](saveUpdates(_0x5b733f['body'],null))['then'](respondWithResult(_0x41fd8d,null))[_0x8c97('0x2a')](handleError(_0x41fd8d,null));};exports[_0x8c97('0x70')]=function(_0x23dbaa,_0x79a956,_0x1804ce){if(_0x23dbaa['body']['id']){delete _0x23dbaa['body']['id'];}return db[_0x8c97('0x37')][_0x8c97('0x69')]({'where':{'id':_0x23dbaa[_0x8c97('0x6d')]['id']}})[_0x8c97('0x20')](function(_0x1f83fe){if(!_0x1f83fe){logger[_0x8c97('0x26')](_0x8c97('0x71'),_0x8c97('0x70'),0x194,'entity\x20not\x20found');_0x79a956['sendStatus'](0x194);}else{if(_0x1f83fe['UserId']){throw new db[(_0x8c97('0x72'))][(_0x8c97('0x73'))](_0x8c97('0x74'));}}return _0x1f83fe;})[_0x8c97('0x20')](function(_0x5e104a){if(_0x5e104a){return _0x5e104a[_0x8c97('0x6c')]({'closed':_0x23dbaa['body'][_0x8c97('0x75')],'closedAt':_0x23dbaa['body'][_0x8c97('0x76')],'disposition':_0x23dbaa[_0x8c97('0x6b')]['disposition']})[_0x8c97('0x20')](function(_0x2796fc){return _0x2796fc;});}})[_0x8c97('0x20')](function(_0x122555){return respondWithRpcPromise(_0x8c97('0x77'),_0x8c97('0x70'),_0x23dbaa[_0x8c97('0x6b')],client9004);})['then'](respondWithResult(_0x79a956,null))[_0x8c97('0x2a')](handleError(_0x79a956,null));};exports[_0x8c97('0x78')]=function(_0x349d7e,_0x5ebc94,_0x1eef34){_0x349d7e[_0x8c97('0x6b')][_0x8c97('0x34')]=_0x349d7e[_0x8c97('0x79')]['originalname'];_0x349d7e[_0x8c97('0x6b')][_0x8c97('0x7a')]=_0x349d7e[_0x8c97('0x79')]['filename'];_0x349d7e['body'][_0x8c97('0x7b')]=_0x349d7e[_0x8c97('0x79')][_0x8c97('0x7c')];return db[_0x8c97('0x7d')][_0x8c97('0x6a')](_0x349d7e[_0x8c97('0x6b')])[_0x8c97('0x20')](respondWithResult(_0x5ebc94,0xc9))[_0x8c97('0x2a')](handleError(_0x5ebc94,null));};exports['attachmentDownload']=function(_0x57274e,_0x14be10,_0xe3530c){return db['ChatInteraction'][_0x8c97('0x7e')]({'where':{'id':_0x57274e[_0x8c97('0x6d')]['id']},'raw':!![]})[_0x8c97('0x20')](handleEntityNotFound(_0x14be10,null))['then'](function(_0x4e2fb5){if(_0x4e2fb5){if(_0x4e2fb5[_0x8c97('0x75')]){return _0x14be10[_0x8c97('0x2c')](0x193)['json']({'status':0x193,'message':_0x8c97('0x7f')});}return db[_0x8c97('0x7d')][_0x8c97('0x7e')]({'where':{'id':_0x57274e[_0x8c97('0x3b')][_0x8c97('0x80')]},'raw':!![]})[_0x8c97('0x20')](handleEntityNotFound(_0x14be10,null));}})['then'](function(_0x427bd1){if(_0x427bd1){return _0x14be10[_0x8c97('0x81')](path[_0x8c97('0x82')](config['root'],'server/files/attachments/',_0x427bd1[_0x8c97('0x7a')]));}})[_0x8c97('0x2a')](handleError(_0x14be10,null));};exports[_0x8c97('0x83')]=function(_0x573069,_0x5e9bad){var _0x18c1e0=null;var _0x110b25=null;var _0x301ea3=null;var _0x5819e0=null;if(_0x573069[_0x8c97('0x6b')]['id']){delete _0x573069['body']['id'];}if(_0x573069[_0x8c97('0x6b')]['mailTranscript']){_0x5819e0=path['join'](config[_0x8c97('0x84')],_0x8c97('0x85'),util[_0x8c97('0x86')](_0x8c97('0x87'),Date[_0x8c97('0x88')]()));_0x573069[_0x8c97('0x6b')][_0x8c97('0x89')]=_0x5819e0;}return db[_0x8c97('0x37')][_0x8c97('0x69')]({'where':{'id':_0x573069[_0x8c97('0x6d')]['id']},'include':[{'model':db[_0x8c97('0x58')],'as':_0x8c97('0x59'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x8c97('0x20')](handleEntityNotFound(_0x5e9bad,null))[_0x8c97('0x20')](saveUpdates(_0x573069[_0x8c97('0x6b')],null))[_0x8c97('0x20')](function(_0x2d2aa9){if(_0x2d2aa9){_0x18c1e0=_0x2d2aa9;return db[_0x8c97('0x64')][_0x8c97('0x69')]({'where':{'id':_0x18c1e0[_0x8c97('0x8a')]}});}})[_0x8c97('0x20')](function(_0x3ff012){if(_0x3ff012){_0x301ea3=_0x3ff012;return db[_0x8c97('0x5e')][_0x8c97('0x69')]({'where':{'id':_0x18c1e0['ContactId']}});}})[_0x8c97('0x20')](function(_0x2f7f76){if(_0x2f7f76){_0x110b25=_0x2f7f76;if(_0x5819e0){var _0x39ee26=null;for(var _0x2ef37f=0x1;_0x2ef37f<_0x18c1e0[_0x8c97('0x59')][_0x8c97('0x42')];++_0x2ef37f){_0x39ee26=_0x18c1e0[_0x8c97('0x59')][_0x2ef37f];var _0x991d57=_0x39ee26['UserId']?util['format'](_0x8c97('0x8b'),_0x301ea3[_0x8c97('0x8c')],_0x39ee26['UserId']):_0x8c97('0x8d');var _0x10f363=_0x573069[_0x8c97('0x6b')][_0x8c97('0x8e')]||util[_0x8c97('0x86')](_0x8c97('0x8b'),_0x8c97('0x8f'),_0x39ee26[_0x8c97('0x90')]);switch(_0x301ea3[_0x8c97('0x91')]){case _0x8c97('0x92'):_0x991d57=_0x39ee26[_0x8c97('0x93')]?util[_0x8c97('0x86')](_0x8c97('0x8b'),_0x301ea3[_0x8c97('0x8c')],_0x39ee26[_0x8c97('0x93')]):_0x8c97('0x8d');break;case _0x8c97('0x94'):_0x991d57=_0x39ee26[_0x8c97('0x93')]?_0x39ee26[_0x8c97('0x60')]['alias']||_0x39ee26[_0x8c97('0x60')]['fullname']:'System';break;case'agent_fullname':_0x991d57=_0x39ee26['UserId']?_0x39ee26[_0x8c97('0x60')][_0x8c97('0x62')]:_0x8c97('0x8d');break;default:_0x991d57=_0x39ee26['UserId']?util[_0x8c97('0x86')](_0x8c97('0x8b'),_0x301ea3[_0x8c97('0x8c')],_0x39ee26['UserId']):_0x8c97('0x8d');}var _0x1ddd18=util[_0x8c97('0x86')](_0x8c97('0x95'),moment(_0x39ee26[_0x8c97('0x5b')])[_0x8c97('0x86')](_0x8c97('0x96')),_0x39ee26[_0x8c97('0x5a')]==='in'?_0x10f363:_0x991d57,_0x39ee26[_0x8c97('0x6b')]);if(!_0x39ee26[_0x8c97('0x97')]){fs['appendFileSync'](_0x5819e0,_0x1ddd18);}}return db[_0x8c97('0x98')][_0x8c97('0x7e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8c97('0x99'),'raw':!![]}]});}}})[_0x8c97('0x20')](function(_0xed8d5c){if(_0xed8d5c&&_0xed8d5c['Smtp']&&_0x573069[_0x8c97('0x6b')]){var _0x4f0a11={'tls':{'rejectUnauthorized':![]}};if(_0xed8d5c[_0x8c97('0x99')][_0x8c97('0x9a')]){_0x4f0a11[_0x8c97('0x9a')]=_0xed8d5c[_0x8c97('0x99')][_0x8c97('0x9a')];}else{_0x4f0a11[_0x8c97('0x9b')]=_0xed8d5c[_0x8c97('0x99')][_0x8c97('0x9b')];_0x4f0a11['port']=_0xed8d5c[_0x8c97('0x99')][_0x8c97('0x9c')];_0x4f0a11[_0x8c97('0x9d')]=_0xed8d5c[_0x8c97('0x99')][_0x8c97('0x9d')];}if(_0xed8d5c[_0x8c97('0x99')]['authentication']){_0x4f0a11['auth']={'user':_0xed8d5c[_0x8c97('0x99')][_0x8c97('0x9e')],'pass':_0xed8d5c[_0x8c97('0x99')]['pass']};}return respondWithRpcPromise(_0x8c97('0x9f'),'sendMail',{'account':_0x4f0a11,'message':{'from':util[_0x8c97('0x86')]('\x22%s\x22\x20<%s>',_0xed8d5c['name'],_0xed8d5c['email']||_0xed8d5c[_0x8c97('0x99')]['user']),'to':_0x573069[_0x8c97('0x6b')][_0x8c97('0xa0')],'subject':_0x8c97('0xa1'),'text':util[_0x8c97('0x86')](_0x8c97('0xa2'),_0x573069['body'][_0x8c97('0xa0')]),'attachments':[{'path':_0x5819e0}]}})[_0x8c97('0x20')](function(){return _0x18c1e0;})[_0x8c97('0x2a')](function(_0x3faabb){console['error'](_0x3faabb);});}else{return _0x18c1e0;}})[_0x8c97('0x20')](respondWithStatusCode(_0x5e9bad,0xc8))[_0x8c97('0x2a')](handleError(_0x5e9bad,null));};exports['addMessage']=function(_0x171daa,_0x3711b8,_0x2ae388){return db[_0x8c97('0x58')][_0x8c97('0x69')]({'where':{'id':_0x171daa['params']['id']}})[_0x8c97('0x20')](handleEntityNotFound(_0x3711b8,null))['then'](function(_0x22a1e1){if(_0x22a1e1){return _0x22a1e1['addMessage'](_0x171daa[_0x8c97('0x6b')][_0x8c97('0xa3')],_[_0x8c97('0xa4')](_0x171daa[_0x8c97('0x6b')],[_0x8c97('0xa3'),'id'])||{});}})[_0x8c97('0x20')](respondWithResult(_0x3711b8,null))['catch'](handleError(_0x3711b8,null));};exports[_0x8c97('0xa5')]=function(_0x38a47c,_0x54429b,_0x1382db){var _0x13c599={'raw':![],'where':{}};var _0x5367ba={};var _0x15b85c={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8c97('0x7e')]({'where':{'id':_0x38a47c['params']['id']}})[_0x8c97('0x20')](handleEntityNotFound(_0x54429b,null))['then'](function(_0x4f0922){if(_0x4f0922){_0x5367ba[_0x8c97('0x39')]=_['keys'](db[_0x8c97('0x58')][_0x8c97('0x38')]);_0x5367ba['query']=_['keys'](_0x38a47c[_0x8c97('0x3b')]);_0x5367ba['filters']=_[_0x8c97('0x3f')](_0x5367ba[_0x8c97('0x39')],_0x5367ba['query']);_0x13c599[_0x8c97('0x40')]=_['intersection'](_0x5367ba['model'],qs[_0x8c97('0x41')](_0x38a47c['query'][_0x8c97('0x41')]));_0x13c599[_0x8c97('0x40')]=_0x13c599['attributes'][_0x8c97('0x42')]?_0x13c599[_0x8c97('0x40')]:_0x5367ba[_0x8c97('0x39')];if(!_0x38a47c[_0x8c97('0x3b')][_0x8c97('0x43')](_0x8c97('0x44'))){_0x13c599[_0x8c97('0x45')]=qs[_0x8c97('0x45')](_0x38a47c[_0x8c97('0x3b')][_0x8c97('0x45')]);_0x13c599[_0x8c97('0x2f')]=qs[_0x8c97('0x2f')](_0x38a47c[_0x8c97('0x3b')][_0x8c97('0x2f')]);}_0x13c599[_0x8c97('0x46')]=qs['sort'](_0x38a47c[_0x8c97('0x3b')][_0x8c97('0x47')]);_0x13c599['where']=qs['filters'](_['pick'](_0x38a47c[_0x8c97('0x3b')],_0x5367ba[_0x8c97('0x3e')]));_0x13c599[_0x8c97('0x48')]['ChatInteractionId']=_0x4f0922['id'];if(_0x38a47c[_0x8c97('0x3b')][_0x8c97('0x4f')]){_0x13c599[_0x8c97('0x48')]=_[_0x8c97('0x4c')](_0x13c599[_0x8c97('0x48')],{'$or':_['map'](_0x13c599[_0x8c97('0x40')],function(_0x1a1774){var _0x12bc6b={};_0x12bc6b[_0x1a1774]={'$like':'%'+_0x38a47c[_0x8c97('0x3b')][_0x8c97('0x4f')]+'%'};return _0x12bc6b;})});}if(_0x38a47c['query'][_0x8c97('0xa6')]){var _0xb94b86=_0x38a47c[_0x8c97('0x3b')][_0x8c97('0xa6')]['split'](',');var _0x446df3={};_0x446df3[_0xb94b86[0x0]]={'$gte':moment(_0xb94b86[0x1])[_0x8c97('0x86')](_0x8c97('0xa7'))};_0x13c599[_0x8c97('0x48')]=_[_0x8c97('0x4c')](_0x13c599[_0x8c97('0x48')],_0x446df3);}_0x13c599=_['merge']({},_0x13c599,_0x38a47c[_0x8c97('0x50')]);return db['ChatMessage'][_0x8c97('0x5c')]({'where':_0x13c599[_0x8c97('0x48')]})[_0x8c97('0x20')](function(_0x2f9dd1){_0x15b85c[_0x8c97('0x5c')]=_0x2f9dd1;if(_0x38a47c[_0x8c97('0x3b')][_0x8c97('0x5d')]){_0x13c599['include']=[{'all':!![]}];}return db[_0x8c97('0x58')]['findAll'](_0x13c599);})[_0x8c97('0x20')](function(_0x222448){_0x15b85c['rows']=_0x222448;return _0x15b85c;});}})['then'](respondWithFilteredResult(_0x54429b,_0x13c599))['catch'](handleError(_0x54429b,null));};exports[_0x8c97('0xa8')]=function(_0x5e1985,_0x1ada0d,_0x1d40ce){var _0x4bc6f4={'where':{}},_0x5bb12a={},_0x3c4ce1={'count':0x0,'rows':[]};return db[_0x8c97('0x37')][_0x8c97('0x7e')]({'where':{'id':_0x5e1985[_0x8c97('0x6d')]['id']}})[_0x8c97('0x20')](handleEntityNotFound(_0x1ada0d,null))[_0x8c97('0x20')](function(_0x29f39e){if(_0x29f39e){_0x5bb12a[_0x8c97('0x39')]=_[_0x8c97('0x3a')](db[_0x8c97('0x58')][_0x8c97('0x38')]);_0x5bb12a[_0x8c97('0x3b')]=_[_0x8c97('0x3a')](_0x5e1985[_0x8c97('0x3b')]);_0x5bb12a[_0x8c97('0x3e')]=_[_0x8c97('0x3f')](_0x5bb12a[_0x8c97('0x39')],_0x5bb12a[_0x8c97('0x3b')]);_0x4bc6f4[_0x8c97('0x40')]=_[_0x8c97('0x3f')](_0x5bb12a[_0x8c97('0x39')],qs[_0x8c97('0x41')](_0x5e1985['query']['fields']));_0x4bc6f4['attributes']=_0x4bc6f4[_0x8c97('0x40')][_0x8c97('0x42')]?_0x4bc6f4[_0x8c97('0x40')]:_0x5bb12a[_0x8c97('0x39')];if(!_0x5e1985['query'][_0x8c97('0x43')](_0x8c97('0x44'))){_0x4bc6f4['limit']=qs[_0x8c97('0x45')](_0x5e1985[_0x8c97('0x3b')]['limit']);_0x4bc6f4[_0x8c97('0x2f')]=qs[_0x8c97('0x2f')](_0x5e1985[_0x8c97('0x3b')][_0x8c97('0x2f')]);}_0x4bc6f4['order']=qs[_0x8c97('0x47')](_0x5e1985[_0x8c97('0x3b')][_0x8c97('0x47')]);_0x4bc6f4[_0x8c97('0x48')]=qs[_0x8c97('0x3e')](_[_0x8c97('0x49')](_0x5e1985[_0x8c97('0x3b')],_0x5bb12a[_0x8c97('0x3e')]));_0x4bc6f4[_0x8c97('0x48')][_0x8c97('0xa9')]=_0x29f39e['id'];if(_0x5e1985['query'][_0x8c97('0x4f')]){_0x4bc6f4[_0x8c97('0x48')]=_[_0x8c97('0x4c')](_0x4bc6f4[_0x8c97('0x48')],{'$or':_['map'](_0x4bc6f4[_0x8c97('0x40')],function(_0x57309c){var _0x35d7a1={};_0x35d7a1[_0x57309c]={'$like':'%'+_0x5e1985[_0x8c97('0x3b')][_0x8c97('0x4f')]+'%'};return _0x35d7a1;})});}_0x4bc6f4[_0x8c97('0x48')][_0x8c97('0x97')]=![];if(_0x5e1985[_0x8c97('0x3b')]['id']){_0x4bc6f4['where']['id']={'$gt':_0x5e1985[_0x8c97('0x3b')]['id']};}_0x4bc6f4=_[_0x8c97('0x4c')]({},_0x4bc6f4,_0x5e1985[_0x8c97('0x50')]);return db[_0x8c97('0x58')][_0x8c97('0x5c')]({'where':_0x4bc6f4[_0x8c97('0x48')]})['then'](function(_0x580af5){_0x3c4ce1[_0x8c97('0x5c')]=_0x580af5;_0x4bc6f4[_0x8c97('0x51')]=[];if(_0x5e1985['query'][_0x8c97('0xaa')]){_0x4bc6f4[_0x8c97('0x51')][_0x8c97('0x53')]({'model':db['User'],'as':_0x8c97('0x60'),'attributes':['id',_0x8c97('0x62'),'alias']});}if(_0x5e1985[_0x8c97('0x3b')][_0x8c97('0x5d')]){_0x4bc6f4[_0x8c97('0x51')]=[{'all':!![]}];}return db[_0x8c97('0x58')][_0x8c97('0x67')](_0x4bc6f4);})['then'](function(_0x3ec198){_0x3c4ce1[_0x8c97('0xab')]=_0x3ec198;return _0x3c4ce1;});}})['then'](respondWithFilteredResult(_0x1ada0d,_0x4bc6f4))[_0x8c97('0x2a')](handleError(_0x1ada0d,null));};exports[_0x8c97('0xac')]=function(_0x5d4433,_0xafbbb7,_0x2daffd){return db[_0x8c97('0x37')][_0x8c97('0x69')]({'where':{'id':_0x5d4433[_0x8c97('0x6d')]['id']}})[_0x8c97('0x20')](handleEntityNotFound(_0xafbbb7,null))['then'](function(_0x3b7254){if(_0x3b7254){return _0x3b7254['setTags'](_0x5d4433[_0x8c97('0x6b')][_0x8c97('0xa3')],_[_0x8c97('0xa4')](_0x5d4433[_0x8c97('0x6b')],[_0x8c97('0xa3'),'id'])||{})[_0x8c97('0xad')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x8c97('0x65')],'where':{'id':_0x5d4433['body'][_0x8c97('0xa3')]}});})['then'](function(_0x2875b7){socket[_0x8c97('0xae')]('chatInteractionTags:save',{'id':Number(_0x5d4433[_0x8c97('0x6d')]['id']),'tags':_0x2875b7||[]});return{'id':Number(_0x5d4433[_0x8c97('0x6d')]['id']),'tags':_0x2875b7||[]};});}})[_0x8c97('0x20')](respondWithResult(_0xafbbb7,null))[_0x8c97('0x2a')](handleError(_0xafbbb7,null));};exports[_0x8c97('0xaf')]=function(_0x498d60,_0x136e06,_0x5662f3){var _0x46ee81;return db[_0x8c97('0x37')][_0x8c97('0x69')]({'where':{'id':_0x498d60[_0x8c97('0x6d')]['id']}})['then'](handleEntityNotFound(_0x136e06,null))[_0x8c97('0x20')](function(_0x557f02){if(_0x557f02){return _0x557f02[_0x8c97('0xaf')](_0x498d60[_0x8c97('0x3b')][_0x8c97('0xa3')]);}})[_0x8c97('0x20')](respondWithStatusCode(_0x136e06,null))[_0x8c97('0x2a')](handleError(_0x136e06,null));};exports[_0x8c97('0x81')]=function(_0x1155e6,_0x46c546){var _0x5c1829=moment()[_0x8c97('0xb0')]()['toString']();var _0x30de24=path[_0x8c97('0x82')](config[_0x8c97('0x84')],_0x8c97('0xb1'),_0x8c97('0xb2'),_0x8c97('0xb3'));var _0x34c05b=path[_0x8c97('0x82')](config[_0x8c97('0x84')],'server',_0x8c97('0xb2'),'attachments');var _0x29331f=path[_0x8c97('0x82')](_0x30de24,_0x5c1829);var _0x10edab=util[_0x8c97('0x86')](_0x8c97('0xb4'),_0x5c1829);var _0x56dfd5=path[_0x8c97('0x82')](_0x30de24,_0x10edab);var _0x4e652c=![];return db[_0x8c97('0x37')][_0x8c97('0x69')]({'where':{'id':_0x1155e6[_0x8c97('0x6d')]['id']},'include':[{'model':db[_0x8c97('0x58')],'as':_0x8c97('0x59'),'attributes':['id','body'],'include':[{'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db[_0x8c97('0x5e')],'as':'Contact','attributes':['id','firstName'],'raw':!![]},{'model':db[_0x8c97('0x7d')],'as':_0x8c97('0x7d'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x46c546,null))[_0x8c97('0x20')](function(_0x3e16a1){if(_0x3e16a1){_0x4e652c=!![];var _0x24baa7='';var _0x49253e={'format':_0x8c97('0xb5'),'border':'1cm'};fs[_0x8c97('0xb6')](_0x29331f);_0x24baa7+=util['format']('<h1>Chat\x20Interaction:\x20#%d</h1>',_0x3e16a1['id']);_0x24baa7+=util[_0x8c97('0x86')](_0x8c97('0xb7'),moment()[_0x8c97('0x86')](_0x8c97('0xb8'))[_0x8c97('0xb9')]());_0x24baa7+='<hr>';for(var _0x4570f8=0x1;_0x4570f8<_0x3e16a1[_0x8c97('0x59')][_0x8c97('0x42')];_0x4570f8++){var _0x39f286=_0x3e16a1['Messages'][_0x4570f8];_0x24baa7+=_0x8c97('0xba');_0x24baa7+=util[_0x8c97('0x86')](_0x8c97('0xbb'),_0x39f286['User']?_0x39f286[_0x8c97('0x60')]['fullname']:_0x39f286[_0x8c97('0x5f')]['firstName'],_0x39f286['body']);_0x24baa7+=_0x8c97('0xbc');if(_0x39f286[_0x8c97('0x7d')]){var _0x5e1d8d=_0x39f286[_0x8c97('0x7d')];var _0xad99b7=path[_0x8c97('0x82')](_0x34c05b,_0x5e1d8d[_0x8c97('0x7a')]);if(fs[_0x8c97('0xbd')](_0xad99b7)){fs[_0x8c97('0xbe')](_0xad99b7)[_0x8c97('0xbf')](fs[_0x8c97('0xc0')](path['join'](_0x29331f,_0x5e1d8d[_0x8c97('0x7a')])));}}}return new BPromise(function(_0x3c0f98,_0x1108dc){pdf[_0x8c97('0x6a')](_0x24baa7,_0x49253e)['toFile'](path[_0x8c97('0x82')](_0x29331f,'interaction-'+_0x5c1829+_0x8c97('0xc1')),function(_0x52df82,_0x4b6718){if(_0x52df82)return _0x1108dc(_0x52df82);_0x3c0f98(_0x4b6718);});});}})[_0x8c97('0x20')](function(){if(_0x4e652c){return new BPromise(function(_0x2decab,_0x32ebdb){zipdir(_0x29331f,{'saveTo':_0x56dfd5},function(_0x46e05d,_0x3932ca){if(_0x46e05d)return _0x32ebdb(_0x46e05d);return _0x2decab(_0x3932ca);});});}})[_0x8c97('0x20')](function(){if(_0x4e652c){return new BPromise(function(_0x17fddd,_0x331ebd){rimraf(_0x29331f,function(_0x45bba1){if(_0x45bba1)_0x331ebd(_0x45bba1);return _0x17fddd();});});}})[_0x8c97('0x20')](function(){if(_0x4e652c){return _0x46c546[_0x8c97('0x81')](_0x56dfd5,_0x10edab,function(_0x16bf75){if(_0x16bf75){console[_0x8c97('0xc2')]('err',_0x16bf75);}else{fs['unlinkSync'](_0x56dfd5);}});}else{return _0x46c546[_0x8c97('0x2b')](0xc8);}})[_0x8c97('0x2a')](handleError(_0x46c546,null));};
\ No newline at end of file
index 73e1c38..26ed8ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd64=['remove','emit','hasOwnProperty','hook','events','ChatInteraction','setMaxListeners','save','update'];(function(_0x1f792c,_0x22efd4){var _0x19aa04=function(_0x4913b9){while(--_0x4913b9){_0x1f792c['push'](_0x1f792c['shift']());}};_0x19aa04(++_0x22efd4);}(_0xdd64,0xa6));var _0x4dd6=function(_0x4132fc,_0x1cb9ca){_0x4132fc=_0x4132fc-0x0;var _0x5f3845=_0xdd64[_0x4132fc];return _0x5f3845;};'use strict';var EventEmitter=require(_0x4dd6('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x4dd6('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4dd6('0x2')](0x0);var events={'afterCreate':_0x4dd6('0x3'),'afterUpdate':_0x4dd6('0x4'),'afterDestroy':_0x4dd6('0x5')};function emitEvent(_0x2fe80b){return function(_0x53ca15,_0x4f6472,_0x27c41a){ChatInteractionEvents[_0x4dd6('0x6')](_0x2fe80b+':'+_0x53ca15['id'],_0x53ca15);ChatInteractionEvents[_0x4dd6('0x6')](_0x2fe80b,_0x53ca15);_0x27c41a(null);};}for(var e in events){if(events[_0x4dd6('0x7')](e)){var event=events[e];ChatInteraction[_0x4dd6('0x8')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x6533=['../../mysqldb','ChatInteraction','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x149701,_0xa97e3c){var _0x5adcb1=function(_0x56fc0c){while(--_0x56fc0c){_0x149701['push'](_0x149701['shift']());}};_0x5adcb1(++_0xa97e3c);}(_0x6533,0x10d));var _0x3653=function(_0x44d505,_0x20e243){_0x44d505=_0x44d505-0x0;var _0x33f574=_0x6533[_0x44d505];return _0x33f574;};'use strict';var EventEmitter=require(_0x3653('0x0'));var ChatInteraction=require(_0x3653('0x1'))['db'][_0x3653('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3653('0x3')](0x0);var events={'afterCreate':_0x3653('0x4'),'afterUpdate':_0x3653('0x5'),'afterDestroy':'remove'};function emitEvent(_0xa0533b){return function(_0x3ee99,_0x346b2d,_0x25d9a8){ChatInteractionEvents[_0x3653('0x6')](_0xa0533b+':'+_0x3ee99['id'],_0x3ee99);ChatInteractionEvents['emit'](_0xa0533b,_0x3ee99);_0x25d9a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x3653('0x7')](e,emitEvent(event));}}module[_0x3653('0x8')]=ChatInteractionEvents;
\ No newline at end of file
index dc97e4f..53a5055 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf1d=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','./chatInteraction.attributes','exports'];(function(_0x32b668,_0x3755a9){var _0x3916d2=function(_0x29b02c){while(--_0x29b02c){_0x32b668['push'](_0x32b668['shift']());}};_0x3916d2(++_0x3755a9);}(_0xdf1d,0x12f));var _0xddf1=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xdf1d[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xddf1('0x0'));var util=require(_0xddf1('0x1'));var logger=require(_0xddf1('0x2'))('api');var moment=require('moment');var BPromise=require(_0xddf1('0x3'));var rp=require(_0xddf1('0x4'));var attributes=require(_0xddf1('0x5'));module[_0xddf1('0x6')]=function(_0x25602f,_0x348844){return _0x25602f[_0xddf1('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xddf1('0x8'),'collate':_0xddf1('0x9')});};
\ No newline at end of file
+var _0xdf83=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','./chatInteraction.attributes','exports'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xdf83,0xbe));var _0x3df8=function(_0x54a6c9,_0x15da10){_0x54a6c9=_0x54a6c9-0x0;var _0x3ad256=_0xdf83[_0x54a6c9];return _0x3ad256;};'use strict';var _=require(_0x3df8('0x0'));var util=require(_0x3df8('0x1'));var logger=require('../../config/logger')(_0x3df8('0x2'));var moment=require(_0x3df8('0x3'));var BPromise=require(_0x3df8('0x4'));var rp=require(_0x3df8('0x5'));var attributes=require(_0x3df8('0x6'));module[_0x3df8('0x7')]=function(_0x426e33,_0x5cde5b){return _0x426e33[_0x3df8('0x8')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3df8('0x9'),'collate':_0x3df8('0xa')});};
\ No newline at end of file
index 061bbf2..e9476a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bac=['ChatInteraction,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0x5b0023,_0x3f31c7){var _0x4b0bb0=function(_0x1c5a24){while(--_0x1c5a24){_0x5b0023['push'](_0x5b0023['shift']());}};_0x4b0bb0(++_0x3f31c7);}(_0x4bac,0xaa));var _0xc4ba=function(_0x5d46bb,_0x2c3bd4){_0x5d46bb=_0x5d46bb-0x0;var _0x3a0302=_0x4bac[_0x5d46bb];return _0x3a0302;};'use strict';var _=require(_0xc4ba('0x0'));var util=require(_0xc4ba('0x1'));var moment=require(_0xc4ba('0x2'));var BPromise=require('bluebird');var rs=require(_0xc4ba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc4ba('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc4ba('0x5'));var config=require(_0xc4ba('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc4ba('0x7')][_0xc4ba('0x8')]({'port':0x232a});config[_0xc4ba('0x9')]=_['defaults'](config[_0xc4ba('0x9')],{'host':_0xc4ba('0xa'),'port':0x18eb});var socket=require(_0xc4ba('0xb'))(new Redis(config[_0xc4ba('0x9')]));require('./chatInteraction.socket')[_0xc4ba('0xc')](socket);function respondWithRpcPromise(_0x19cb95,_0x28693b,_0x52fb0f){return new BPromise(function(_0x58d3c4,_0x5eb474){return client['request'](_0x19cb95,_0x52fb0f)[_0xc4ba('0xd')](function(_0x329d40){logger[_0xc4ba('0xe')](_0xc4ba('0xf'),_0x28693b,'request\x20sent');logger[_0xc4ba('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x28693b,'request\x20sent',JSON['stringify'](_0x329d40));if(_0x329d40['error']){if(_0x329d40[_0xc4ba('0x11')][_0xc4ba('0x12')]===0x1f4){logger[_0xc4ba('0x11')](_0xc4ba('0xf'),_0x28693b,_0x329d40[_0xc4ba('0x11')]['message']);return _0x5eb474(_0x329d40['error'][_0xc4ba('0x13')]);}logger[_0xc4ba('0x11')](_0xc4ba('0xf'),_0x28693b,_0x329d40['error']['message']);return _0x58d3c4(_0x329d40[_0xc4ba('0x11')]['message']);}else{logger[_0xc4ba('0xe')](_0xc4ba('0xf'),_0x28693b,_0xc4ba('0x14'));_0x58d3c4(_0x329d40[_0xc4ba('0x15')]['message']);}})['catch'](function(_0x3e9198){logger[_0xc4ba('0x11')](_0xc4ba('0xf'),_0x28693b,_0x3e9198);_0x5eb474(_0x3e9198);});});}exports[_0xc4ba('0x16')]=function(_0x681d8c){var _0x3952a9=this;return new Promise(function(_0x15d615,_0x16a1a9){return db[_0xc4ba('0x17')][_0xc4ba('0x18')](_0x681d8c[_0xc4ba('0x19')],{'raw':_0x681d8c[_0xc4ba('0x1a')]?_0x681d8c[_0xc4ba('0x1a')][_0xc4ba('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x681d8c[_0xc4ba('0x1a')]?_0x681d8c[_0xc4ba('0x1a')]['where']||null:null,'attributes':_0x681d8c['options']?_0x681d8c['options'][_0xc4ba('0x1c')]||null:null,'limit':_0x681d8c[_0xc4ba('0x1a')]?_0x681d8c[_0xc4ba('0x1a')]['limit']||null:null})[_0xc4ba('0xd')](function(_0x3e6a85){logger['info']('UpdateChatInteraction',_0x681d8c);logger[_0xc4ba('0x10')](_0xc4ba('0x16'),_0x681d8c,JSON[_0xc4ba('0x1d')](_0x3e6a85));_0x15d615(_0x3e6a85);})[_0xc4ba('0x1e')](function(_0x21eb96){logger[_0xc4ba('0x11')](_0xc4ba('0x16'),_0x21eb96[_0xc4ba('0x13')],_0x681d8c);_0x16a1a9(_0x3952a9[_0xc4ba('0x11')](0x1f4,_0x21eb96[_0xc4ba('0x13')]));});});};exports[_0xc4ba('0x1f')]=function(_0x35ed09){return new Promise(function(_0x5407ad,_0x4228a3){return db[_0xc4ba('0x17')][_0xc4ba('0x20')]({'where':_0x35ed09[_0xc4ba('0x1a')]?_0x35ed09[_0xc4ba('0x1a')]['where']||null:null})[_0xc4ba('0xd')](function(_0x2be6a4){if(_0x2be6a4){return _0x2be6a4[_0xc4ba('0x21')](_0x35ed09['body'][_0xc4ba('0x22')],_[_0xc4ba('0x23')](_0x35ed09[_0xc4ba('0x19')],[_0xc4ba('0x22'),'id'])||{});}})['spread'](function(_0x5cd2ad){logger['info'](_0xc4ba('0x24'),_0x35ed09);logger[_0xc4ba('0x10')](_0xc4ba('0x24'),_0x35ed09,JSON[_0xc4ba('0x1d')](_0x5cd2ad));_0x5407ad(_0x5cd2ad);})[_0xc4ba('0x1e')](function(_0x566fa9){logger['error']('AddTags',_0x566fa9[_0xc4ba('0x13')],_0x35ed09);_0x4228a3(_this['error'](0x1f4,_0x566fa9['message']));});});};
\ No newline at end of file
+var _0x0b0a=['catch','AddTagsToChatInteraction','ChatInteraction','find','where','addTags','body','ids','omit','spread','AddTags','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','options','raw','attributes','limit','info'];(function(_0x4c9a60,_0x128bd8){var _0x611054=function(_0x33af46){while(--_0x33af46){_0x4c9a60['push'](_0x4c9a60['shift']());}};_0x611054(++_0x128bd8);}(_0x0b0a,0x86));var _0xa0b0=function(_0x135cf6,_0x15285a){_0x135cf6=_0x135cf6-0x0;var _0x52bf11=_0x0b0a[_0x135cf6];return _0x52bf11;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa0b0('0x0'));var BPromise=require('bluebird');var rs=require(_0xa0b0('0x1'));var fs=require('fs');var Redis=require(_0xa0b0('0x2'));var db=require(_0xa0b0('0x3'))['db'];var utils=require(_0xa0b0('0x4'));var logger=require('../../config/logger')(_0xa0b0('0x5'));var config=require('../../config/environment');var jayson=require(_0xa0b0('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xa0b0('0x7')]=_[_0xa0b0('0x8')](config['redis'],{'host':_0xa0b0('0x9'),'port':0x18eb});var socket=require(_0xa0b0('0xa'))(new Redis(config['redis']));require(_0xa0b0('0xb'))[_0xa0b0('0xc')](socket);function respondWithRpcPromise(_0x39c9b9,_0x45620c,_0x445f11){return new BPromise(function(_0x3f469d,_0x479b26){return client[_0xa0b0('0xd')](_0x39c9b9,_0x445f11)[_0xa0b0('0xe')](function(_0x7f26ff){logger['info'](_0xa0b0('0xf'),_0x45620c,_0xa0b0('0x10'));logger[_0xa0b0('0x11')](_0xa0b0('0x12'),_0x45620c,_0xa0b0('0x10'),JSON[_0xa0b0('0x13')](_0x7f26ff));if(_0x7f26ff[_0xa0b0('0x14')]){if(_0x7f26ff[_0xa0b0('0x14')][_0xa0b0('0x15')]===0x1f4){logger[_0xa0b0('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x45620c,_0x7f26ff[_0xa0b0('0x14')]['message']);return _0x479b26(_0x7f26ff[_0xa0b0('0x14')]['message']);}logger[_0xa0b0('0x14')](_0xa0b0('0xf'),_0x45620c,_0x7f26ff['error'][_0xa0b0('0x16')]);return _0x3f469d(_0x7f26ff[_0xa0b0('0x14')][_0xa0b0('0x16')]);}else{logger['info'](_0xa0b0('0xf'),_0x45620c,_0xa0b0('0x10'));_0x3f469d(_0x7f26ff[_0xa0b0('0x17')][_0xa0b0('0x16')]);}})['catch'](function(_0x351e3a){logger[_0xa0b0('0x14')](_0xa0b0('0xf'),_0x45620c,_0x351e3a);_0x479b26(_0x351e3a);});});}exports[_0xa0b0('0x18')]=function(_0x37b992){var _0x4064d3=this;return new Promise(function(_0x687297,_0x1de84a){return db['ChatInteraction']['update'](_0x37b992['body'],{'raw':_0x37b992[_0xa0b0('0x19')]?_0x37b992['options'][_0xa0b0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37b992[_0xa0b0('0x19')]?_0x37b992['options']['where']||null:null,'attributes':_0x37b992[_0xa0b0('0x19')]?_0x37b992['options'][_0xa0b0('0x1b')]||null:null,'limit':_0x37b992[_0xa0b0('0x19')]?_0x37b992[_0xa0b0('0x19')][_0xa0b0('0x1c')]||null:null})[_0xa0b0('0xe')](function(_0x5674ac){logger[_0xa0b0('0x1d')]('UpdateChatInteraction',_0x37b992);logger['debug']('UpdateChatInteraction',_0x37b992,JSON[_0xa0b0('0x13')](_0x5674ac));_0x687297(_0x5674ac);})[_0xa0b0('0x1e')](function(_0xfb350d){logger['error'](_0xa0b0('0x18'),_0xfb350d[_0xa0b0('0x16')],_0x37b992);_0x1de84a(_0x4064d3[_0xa0b0('0x14')](0x1f4,_0xfb350d[_0xa0b0('0x16')]));});});};exports[_0xa0b0('0x1f')]=function(_0x1d2e1f){return new Promise(function(_0x2a7c60,_0x511e35){return db[_0xa0b0('0x20')][_0xa0b0('0x21')]({'where':_0x1d2e1f[_0xa0b0('0x19')]?_0x1d2e1f['options'][_0xa0b0('0x22')]||null:null})[_0xa0b0('0xe')](function(_0x32fe53){if(_0x32fe53){return _0x32fe53[_0xa0b0('0x23')](_0x1d2e1f[_0xa0b0('0x24')][_0xa0b0('0x25')],_[_0xa0b0('0x26')](_0x1d2e1f[_0xa0b0('0x24')],['ids','id'])||{});}})[_0xa0b0('0x27')](function(_0x42ee7e){logger[_0xa0b0('0x1d')](_0xa0b0('0x28'),_0x1d2e1f);logger['debug'](_0xa0b0('0x28'),_0x1d2e1f,JSON[_0xa0b0('0x13')](_0x42ee7e));_0x2a7c60(_0x42ee7e);})[_0xa0b0('0x1e')](function(_0xb4a583){logger[_0xa0b0('0x14')](_0xa0b0('0x28'),_0xb4a583[_0xa0b0('0x16')],_0x1d2e1f);_0x511e35(_this[_0xa0b0('0x14')](0x1f4,_0xb4a583[_0xa0b0('0x16')]));});});};
\ No newline at end of file
index a95b4e2..beb8154 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa09=['./chatInteraction.events','save','remove','update','emit','length','chatInteraction:'];(function(_0xb40147,_0x451b88){var _0x10f394=function(_0x3e4605){while(--_0x3e4605){_0xb40147['push'](_0xb40147['shift']());}};_0x10f394(++_0x451b88);}(_0xfa09,0x1d5));var _0x9fa0=function(_0x2b7023,_0x4c5587){_0x2b7023=_0x2b7023-0x0;var _0x10c3c5=_0xfa09[_0x2b7023];return _0x10c3c5;};'use strict';var ChatInteractionEvents=require(_0x9fa0('0x0'));var events=[_0x9fa0('0x1'),_0x9fa0('0x2'),_0x9fa0('0x3')];function createListener(_0x1b5889,_0x26074f){return function(_0x3edc9a){_0x26074f[_0x9fa0('0x4')](_0x1b5889,_0x3edc9a);};}function removeListener(_0x23997b,_0x5e989d){return function(){ChatInteractionEvents['removeListener'](_0x23997b,_0x5e989d);};}exports['register']=function(_0x2fe633){for(var _0x22c9e7=0x0,_0x50b3a8=events[_0x9fa0('0x5')];_0x22c9e7<_0x50b3a8;_0x22c9e7++){var _0x595b09=events[_0x22c9e7];var _0x5cd6cb=createListener(_0x9fa0('0x6')+_0x595b09,_0x2fe633);ChatInteractionEvents['on'](_0x595b09,_0x5cd6cb);}};
\ No newline at end of file
+var _0xf6e9=['chatInteraction:','remove','removeListener','length'];(function(_0x40b2eb,_0xd15c9f){var _0x3f9210=function(_0xaa28ac){while(--_0xaa28ac){_0x40b2eb['push'](_0x40b2eb['shift']());}};_0x3f9210(++_0xd15c9f);}(_0xf6e9,0xd1));var _0x9f6e=function(_0xc290e2,_0x51d407){_0xc290e2=_0xc290e2-0x0;var _0x1fda2d=_0xf6e9[_0xc290e2];return _0x1fda2d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x9f6e('0x0'),'update'];function createListener(_0x356fca,_0x59f861){return function(_0x31de73){_0x59f861['emit'](_0x356fca,_0x31de73);};}function removeListener(_0x122795,_0xcf51c4){return function(){ChatInteractionEvents[_0x9f6e('0x1')](_0x122795,_0xcf51c4);};}exports['register']=function(_0x458a7b){for(var _0x2781fc=0x0,_0x30f241=events[_0x9f6e('0x2')];_0x2781fc<_0x30f241;_0x2781fc++){var _0x5ee798=events[_0x2781fc];var _0x1aa255=createListener(_0x9f6e('0x3')+_0x5ee798,_0x458a7b);ChatInteractionEvents['on'](_0x5ee798,_0x1aa255);}};
\ No newline at end of file
index 4ede0e9..7e722cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['addMessage','/:id/tags','tracked','chat','put','chatinteraction:update','update','/:id/custom_update','/:id/close','close','destroy','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/download','post','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x757a,0xde));var _0xa757=function(_0x391e04,_0x1c9747){_0x391e04=_0x391e04-0x0;var _0x44e5e8=_0x757a[_0x391e04];return _0x44e5e8;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa757('0x2'));var interaction=require(_0xa757('0x3'));var config=require(_0xa757('0x4'));var controller=require(_0xa757('0x5'));router[_0xa757('0x6')]('/',auth[_0xa757('0x7')](),controller['index']);router[_0xa757('0x6')](_0xa757('0x8'),auth['isAuthenticated'](),controller[_0xa757('0x9')]);router[_0xa757('0x6')](_0xa757('0xa'),auth[_0xa757('0xb')](),controller[_0xa757('0xc')]);router['get'](_0xa757('0xd'),auth[_0xa757('0xb')](),controller[_0xa757('0xe')]);router[_0xa757('0x6')](_0xa757('0xf'),auth[_0xa757('0x7')](),controller[_0xa757('0x10')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0xa757('0x11'),auth['isAuthenticated'](),controller['download']);router[_0xa757('0x12')]('/',auth['isAuthenticated'](),controller['create']);var upload=multer({'storage':multer[_0xa757('0x13')]({'destination':function(_0x1b670e,_0x355f0a,_0x4a0c38){_0x4a0c38(null,path[_0xa757('0x14')](config[_0xa757('0x15')],_0xa757('0x16')));},'filename':function(_0x2f7947,_0x185011,_0x3df1f9){_0x3df1f9(null,util['format'](_0xa757('0x17'),Date[_0xa757('0x18')](),_0x185011[_0xa757('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa757('0x1a'),upload[_0xa757('0x1b')](_0xa757('0x1c')),controller[_0xa757('0x1d')]);router[_0xa757('0x12')](_0xa757('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xa757('0x1e')]);router['post'](_0xa757('0x1f'),auth[_0xa757('0x7')](),interaction[_0xa757('0x20')](_0xa757('0x21'),'chatinteraction:addtags'),controller['addTags']);router[_0xa757('0x22')](_0xa757('0xa'),auth[_0xa757('0x7')](),interaction[_0xa757('0x20')](_0xa757('0x21'),_0xa757('0x23')),controller[_0xa757('0x24')]);router[_0xa757('0x22')](_0xa757('0x25'),controller['customUpdate']);router[_0xa757('0x22')]('/:id/abandon',auth[_0xa757('0xb')](),controller['abandon']);router[_0xa757('0x22')](_0xa757('0x26'),controller[_0xa757('0x27')]);router['delete'](_0xa757('0xa'),auth[_0xa757('0x7')](),interaction[_0xa757('0x20')](_0xa757('0x21'),'chatinteraction:destroy'),controller[_0xa757('0x28')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xa757('0x29')]=router;
\ No newline at end of file
+var _0x8603=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','update','/:id/custom_update','customUpdate','/:id/close','close','chatinteraction:destroy','destroy','delete','exports'];(function(_0x33e5d1,_0x55e417){var _0x418fe0=function(_0x4ce8b8){while(--_0x4ce8b8){_0x33e5d1['push'](_0x33e5d1['shift']());}};_0x418fe0(++_0x55e417);}(_0x8603,0x190));var _0x3860=function(_0xaadc70,_0x2c050d){_0xaadc70=_0xaadc70-0x0;var _0x3ac647=_0x8603[_0xaadc70];return _0x3ac647;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./chatInteraction.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller[_0x3860('0xb')]);router[_0x3860('0x6')]('/:id/attachment_download',auth[_0x3860('0xc')](),controller[_0x3860('0xd')]);router['get'](_0x3860('0xe'),auth[_0x3860('0x9')](),controller['getMessages']);router[_0x3860('0x6')](_0x3860('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x3860('0x10')]);router[_0x3860('0x6')](_0x3860('0x11'),auth[_0x3860('0x9')](),controller[_0x3860('0x12')]);router[_0x3860('0x13')]('/',auth[_0x3860('0x9')](),controller[_0x3860('0x14')]);var upload=multer({'storage':multer[_0x3860('0x15')]({'destination':function(_0x46264d,_0x54dbc3,_0x3d861d){_0x3d861d(null,path[_0x3860('0x16')](config[_0x3860('0x17')],_0x3860('0x18')));},'filename':function(_0x1055b3,_0xfa0c9a,_0x2d8a3a){_0x2d8a3a(null,util[_0x3860('0x19')](_0x3860('0x1a'),Date[_0x3860('0x1b')](),_0xfa0c9a[_0x3860('0x1c')][_0x3860('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x3860('0x1e')](_0x3860('0x1f')),controller[_0x3860('0x20')]);router['post'](_0x3860('0xe'),auth[_0x3860('0xc')](),controller[_0x3860('0x21')]);router[_0x3860('0x13')](_0x3860('0x22'),auth[_0x3860('0x9')](),interaction[_0x3860('0x23')](_0x3860('0x24'),_0x3860('0x25')),controller[_0x3860('0x26')]);router[_0x3860('0x27')](_0x3860('0x28'),auth[_0x3860('0x9')](),interaction[_0x3860('0x23')](_0x3860('0x24'),'chatinteraction:update'),controller[_0x3860('0x29')]);router[_0x3860('0x27')](_0x3860('0x2a'),controller[_0x3860('0x2b')]);router[_0x3860('0x27')]('/:id/abandon',auth[_0x3860('0xc')](),controller['abandon']);router['put'](_0x3860('0x2c'),controller[_0x3860('0x2d')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x3860('0x23')](_0x3860('0x24'),_0x3860('0x2e')),controller[_0x3860('0x2f')]);router[_0x3860('0x30')](_0x3860('0x22'),auth['isAuthenticated'](),controller['removeTags']);module[_0x3860('0x31')]=router;
\ No newline at end of file
index 7504ef6..92f92a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8af6=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x50667a,_0x86eb28){var _0x4987e5=function(_0x4482b1){while(--_0x4482b1){_0x50667a['push'](_0x50667a['shift']());}};_0x4987e5(++_0x86eb28);}(_0x8af6,0x76));var _0x68af=function(_0x5ba5da,_0x5d2f8c){_0x5ba5da=_0x5ba5da-0x0;var _0xe8423=_0x8af6[_0x5ba5da];return _0xe8423;};'use strict';var Sequelize=require(_0x68af('0x0'));module[_0x68af('0x1')]={'body':{'type':Sequelize[_0x68af('0x2')](_0x68af('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x68af('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x68af('0x5')]}};
\ No newline at end of file
+var _0x9b0d=['TEXT','medium','BOOLEAN','exports'];(function(_0xad61b5,_0x48e93c){var _0x1852ff=function(_0x22ef81){while(--_0x22ef81){_0xad61b5['push'](_0xad61b5['shift']());}};_0x1852ff(++_0x48e93c);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x5e847b,_0x17634e){_0x5e847b=_0x5e847b-0x0;var _0x1440b1=_0x9b0d[_0x5e847b];return _0x1440b1;};'use strict';var Sequelize=require('sequelize');module[_0xd9b0('0x0')]={'body':{'type':Sequelize[_0xd9b0('0x1')](_0xd9b0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd9b0('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 87c6a38..3a56379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16f8=['sort','where','pick','add','day','merge','filter','type','key','field','includeAll','include','rows','catch','params','find','create','body','update','destroy','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','internal','online','lastLoginAt','allowmessenger','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','ChatInternalMessage','rawAttributes','model','keys','query','dateEnd','dateStart','filters','attributes','intersection','fields','length','hasOwnProperty','limit'];(function(_0x171d07,_0x59c974){var _0x135563=function(_0x2aea19){while(--_0x2aea19){_0x171d07['push'](_0x171d07['shift']());}};_0x135563(++_0x59c974);}(_0x16f8,0x10b));var _0x816f=function(_0x18696a,_0x31130f){_0x18696a=_0x18696a-0x0;var _0x45ada5=_0x16f8[_0x18696a];return _0x45ada5;};'use strict';var pdf=require(_0x816f('0x0'));var emlformat=require(_0x816f('0x1'));var rimraf=require(_0x816f('0x2'));var zipdir=require(_0x816f('0x3'));var jsonpatch=require(_0x816f('0x4'));var rp=require(_0x816f('0x5'));var moment=require(_0x816f('0x6'));var BPromise=require(_0x816f('0x7'));var Mustache=require(_0x816f('0x8'));var util=require(_0x816f('0x9'));var path=require(_0x816f('0xa'));var sox=require('sox');var csv=require(_0x816f('0xb'));var ejs=require(_0x816f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x816f('0xd'));var jsforce=require(_0x816f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x816f('0xb'));var querystring=require(_0x816f('0xf'));var Papa=require(_0x816f('0x10'));var Redis=require('ioredis');var qs=require(_0x816f('0x11'));var logger=require(_0x816f('0x12'))(_0x816f('0x13'));var utils=require(_0x816f('0x14'));var config=require('../../config/environment');var db=require(_0x816f('0x15'))['db'];config[_0x816f('0x16')]=_[_0x816f('0x17')](config[_0x816f('0x16')],{'host':_0x816f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x816f('0x16')]));require(_0x816f('0x19'))[_0x816f('0x1a')](socket);function respondWithStatusCode(_0x373e56,_0x21fd75){_0x21fd75=_0x21fd75||0xcc;return function(_0x82a19b){if(_0x82a19b){return _0x373e56['sendStatus'](_0x21fd75);}return _0x373e56[_0x816f('0x1b')](_0x21fd75)[_0x816f('0x1c')]();};}function respondWithResult(_0x4320e0,_0x4c3110){_0x4c3110=_0x4c3110||0xc8;return function(_0x4897ee){if(_0x4897ee){return _0x4320e0[_0x816f('0x1b')](_0x4c3110)[_0x816f('0x1d')](_0x4897ee);}};}function respondWithFilteredResult(_0x2159b2,_0x42f2cf){return function(_0x16b06b){if(_0x16b06b){var _0x44f474=_0x16b06b[_0x816f('0x1e')],_0x21f9f8=_0x42f2cf[_0x816f('0x1f')],_0x12f172=_0x42f2cf[_0x816f('0x1f')]+_0x42f2cf['limit'],_0x1fd9f7;if(_0x12f172>=_0x44f474){_0x12f172=_0x44f474;_0x1fd9f7=0xc8;}else{_0x1fd9f7=0xce;}_0x2159b2['status'](_0x1fd9f7);return _0x2159b2[_0x816f('0x20')](_0x816f('0x21'),_0x21f9f8+'-'+_0x12f172+'/'+_0x44f474)[_0x816f('0x1d')](_0x16b06b);}return null;};}function patchUpdates(_0x13c5af){return function(_0x1031d4){try{jsonpatch[_0x816f('0x22')](_0x1031d4,_0x13c5af,!![]);}catch(_0x1a85bd){return BPromise[_0x816f('0x23')](_0x1a85bd);}return _0x1031d4[_0x816f('0x24')]();};}function saveUpdates(_0x5ee24e,_0x4c7352){return function(_0x217368){if(_0x217368){return _0x217368['update'](_0x5ee24e)['then'](function(_0x5d216a){return _0x5d216a;});}return null;};}function removeEntity(_0x13f4ca,_0x4be156){return function(_0x5aefe8){if(_0x5aefe8){return _0x5aefe8['destroy']()[_0x816f('0x25')](function(){_0x13f4ca['status'](0xcc)[_0x816f('0x1c')]();});}};}function handleEntityNotFound(_0x10223a,_0x21e229){return function(_0x3def86){if(!_0x3def86){_0x10223a[_0x816f('0x26')](0x194);}return _0x3def86;};}function handleError(_0x9ca82,_0x57217b){_0x57217b=_0x57217b||0x1f4;return function(_0x927bde){logger['error'](_0x927bde[_0x816f('0x27')]);if(_0x927bde['name']){delete _0x927bde[_0x816f('0x28')];}_0x9ca82[_0x816f('0x1b')](_0x57217b)[_0x816f('0x29')](_0x927bde);};}exports[_0x816f('0x2a')]=function(_0x4444d4,_0x2e34fd){var _0x4d85d7={},_0x4a7fa9={},_0x543164={'count':0x0,'rows':[]};var _0xd84a74=db[_0x816f('0x2b')][_0x816f('0x2c')];_0x4a7fa9[_0x816f('0x2d')]=_[_0x816f('0x2e')](_0xd84a74);var _0x421b70={'dateStart':_0x4444d4['query']['dateStart'],'dateEnd':_0x4444d4[_0x816f('0x2f')][_0x816f('0x30')]};delete _0x4444d4[_0x816f('0x2f')][_0x816f('0x31')];delete _0x4444d4[_0x816f('0x2f')][_0x816f('0x30')];_0x4a7fa9[_0x816f('0x2f')]=_[_0x816f('0x2e')](_0x4444d4['query']);_0x4a7fa9[_0x816f('0x32')]=_['intersection'](_0x4a7fa9[_0x816f('0x2d')],_0x4a7fa9['query']);_0x4d85d7[_0x816f('0x33')]=_[_0x816f('0x34')](_0x4a7fa9['model'],qs[_0x816f('0x35')](_0x4444d4[_0x816f('0x2f')][_0x816f('0x35')]));_0x4d85d7['attributes']=_0x4d85d7['attributes'][_0x816f('0x36')]?_0x4d85d7[_0x816f('0x33')]:_0x4a7fa9[_0x816f('0x2d')];if(!_0x4444d4[_0x816f('0x2f')][_0x816f('0x37')]('nolimit')){_0x4d85d7[_0x816f('0x38')]=qs[_0x816f('0x38')](_0x4444d4[_0x816f('0x2f')]['limit']);_0x4d85d7[_0x816f('0x1f')]=qs[_0x816f('0x1f')](_0x4444d4[_0x816f('0x2f')][_0x816f('0x1f')]);}_0x4d85d7['order']=qs[_0x816f('0x39')](_0x4444d4[_0x816f('0x2f')][_0x816f('0x39')]);_0x4d85d7[_0x816f('0x3a')]=qs['filters'](_[_0x816f('0x3b')](_0x4444d4['query'],_0x4a7fa9[_0x816f('0x32')]));if(_0x421b70[_0x816f('0x31')]){if(_0x421b70['dateEnd']){_0x421b70[_0x816f('0x30')]=moment(_0x421b70['dateEnd'])[_0x816f('0x3c')](0x1,_0x816f('0x3d'));}else{_0x421b70[_0x816f('0x30')]=moment(_0x421b70[_0x816f('0x31')])[_0x816f('0x3c')](0x1,_0x816f('0x3d'));}_[_0x816f('0x3e')](_0x4d85d7[_0x816f('0x3a')],{'createdAt':{'$gte':_0x421b70[_0x816f('0x31')],'$lte':_0x421b70[_0x816f('0x30')]}});}if(_0x4444d4[_0x816f('0x2f')][_0x816f('0x3f')]){_0x4d85d7[_0x816f('0x3a')]=_[_0x816f('0x3e')](_0x4d85d7[_0x816f('0x3a')],{'$or':_['map'](_0xd84a74,function(_0x1c17a8){if(_0x1c17a8[_0x816f('0x40')][_0x816f('0x41')]!=='VIRTUAL'){var _0x25c801={};_0x25c801[_0x1c17a8[_0x816f('0x42')]]={'$like':'%'+_0x4444d4[_0x816f('0x2f')]['filter']+'%'};return _0x25c801;}})});}_0x4d85d7=_[_0x816f('0x3e')]({},_0x4d85d7,_0x4444d4['options']);var _0x3f9dec={'where':_0x4d85d7['where']};return db['ChatInternalMessage'][_0x816f('0x1e')](_0x3f9dec)[_0x816f('0x25')](function(_0x53ef66){_0x543164['count']=_0x53ef66;if(_0x4444d4[_0x816f('0x2f')][_0x816f('0x43')]){_0x4d85d7[_0x816f('0x44')]=[{'all':!![]}];}return db[_0x816f('0x2b')]['findAll'](_0x4d85d7);})[_0x816f('0x25')](function(_0x21ca8b){_0x543164[_0x816f('0x45')]=_0x21ca8b;return _0x543164;})['then'](respondWithFilteredResult(_0x2e34fd,_0x4d85d7))[_0x816f('0x46')](handleError(_0x2e34fd,null));};exports['show']=function(_0x374093,_0x288e09){var _0x42315a={'raw':!![],'where':{'id':_0x374093[_0x816f('0x47')]['id']}},_0x2c01a7={};_0x2c01a7['model']=_[_0x816f('0x2e')](db['ChatInternalMessage'][_0x816f('0x2c')]);_0x2c01a7[_0x816f('0x2f')]=_['keys'](_0x374093[_0x816f('0x2f')]);_0x2c01a7[_0x816f('0x32')]=_['intersection'](_0x2c01a7[_0x816f('0x2d')],_0x2c01a7[_0x816f('0x2f')]);_0x42315a['attributes']=_[_0x816f('0x34')](_0x2c01a7[_0x816f('0x2d')],qs['fields'](_0x374093[_0x816f('0x2f')][_0x816f('0x35')]));_0x42315a[_0x816f('0x33')]=_0x42315a[_0x816f('0x33')][_0x816f('0x36')]?_0x42315a['attributes']:_0x2c01a7[_0x816f('0x2d')];if(_0x374093[_0x816f('0x2f')]['includeAll']){_0x42315a['include']=[{'all':!![]}];}_0x42315a=_[_0x816f('0x3e')]({},_0x42315a,_0x374093['options']);return db[_0x816f('0x2b')][_0x816f('0x48')](_0x42315a)['then'](handleEntityNotFound(_0x288e09,null))[_0x816f('0x25')](respondWithResult(_0x288e09,null))[_0x816f('0x46')](handleError(_0x288e09,null));};exports['create']=function(_0x40f173,_0x3b1939){return db['ChatInternalMessage'][_0x816f('0x49')](_0x40f173[_0x816f('0x4a')],{})[_0x816f('0x25')](respondWithResult(_0x3b1939,0xc9))[_0x816f('0x46')](handleError(_0x3b1939,null));};exports[_0x816f('0x4b')]=function(_0x404da7,_0x1823dd){if(_0x404da7[_0x816f('0x4a')]['id']){delete _0x404da7[_0x816f('0x4a')]['id'];}return db[_0x816f('0x2b')][_0x816f('0x48')]({'where':{'id':_0x404da7[_0x816f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1823dd,null))[_0x816f('0x25')](saveUpdates(_0x404da7['body'],null))[_0x816f('0x25')](respondWithResult(_0x1823dd,null))[_0x816f('0x46')](handleError(_0x1823dd,null));};exports[_0x816f('0x4c')]=function(_0x3b4eaf,_0x2a9475){return db[_0x816f('0x2b')][_0x816f('0x48')]({'where':{'id':_0x3b4eaf[_0x816f('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a9475,null))[_0x816f('0x25')](removeEntity(_0x2a9475,null))[_0x816f('0x46')](handleError(_0x2a9475,null));};exports[_0x816f('0x4d')]=function(_0x2300a2,_0x54eb73){return db[_0x816f('0x2b')]['describe']()[_0x816f('0x25')](respondWithResult(_0x54eb73,null))[_0x816f('0x46')](handleError(_0x54eb73,null));};function wrapUser(_0x3aca65){return function(_0x29752b){var _0x33d7ed=_0x3aca65[_0x816f('0x4e')]({'plain':!![]});_0x33d7ed[_0x816f('0x4f')]=[];if(_0x29752b){_0x33d7ed[_0x816f('0x50')]=_0x29752b[_0x816f('0x51')];_0x33d7ed['lastMessage']=_0x29752b;}else{_0x33d7ed[_0x816f('0x50')]=moment(0x0)[_0x816f('0x52')](_0x816f('0x53'));_0x33d7ed['lastMessage']={};}return _0x33d7ed;};}exports[_0x816f('0x54')]=function(_0x582f17,_0x4d68b7,_0x1b65dc){var _0xbc4bc8=[];return db[_0x816f('0x55')]['findAll']({'where':{'role':[_0x816f('0x56'),_0x816f('0x57'),'user']},'attributes':['id','fullname','name',_0x816f('0x58'),'userpic',_0x816f('0x59'),_0x816f('0x5a'),_0x816f('0x5b'),_0x816f('0x5c'),'showWebBar'],'order':qs[_0x816f('0x39')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name',_0x816f('0x40')],'through':{'attributes':[]}}]})[_0x816f('0x25')](function(_0x16bef5){if(_0x16bef5){var _0x2e6fa3=_0x582f17[_0x816f('0x5d')][_0x816f('0x4e')]({'plain':!![]});if(!_0x2e6fa3)throw new Error(_0x816f('0x5e'));if(_0x2e6fa3[_0x816f('0x58')]===_0x816f('0x5d')){return db[_0x816f('0x5f')][_0x816f('0x48')]({'where':{'name':_0x816f('0x60'),'userProfileId':_0x2e6fa3[_0x816f('0x61')]},'raw':!![]})[_0x816f('0x25')](function(_0x3fedf2){if(_0x3fedf2){if(_0x3fedf2[_0x816f('0x62')]===0x0){return db[_0x816f('0x63')]['findAll']({'where':{'sectionId':_0x3fedf2['id']},'raw':!![]})[_0x816f('0x25')](function(_0x5179ec){var _0x335ca8=[];if(_[_0x816f('0x64')](_0x5179ec)){_0x335ca8=_[_0x816f('0x3f')](_0x16bef5,function(_0x892bf3){if(_0x892bf3['role']!=='agent'){return _0x892bf3;}});return _0x335ca8;}else{for(var _0x549eb6=0x0;_0x549eb6<_0x16bef5[_0x816f('0x36')];_0x549eb6++){var _0x3c5742=_0x16bef5[_0x549eb6];if(_0x3c5742[_0x816f('0x58')]===_0x816f('0x56')){var _0x42ab1d=_['find'](_0x5179ec,function(_0x13ba12){return _0x13ba12[_0x816f('0x65')]===_0x3c5742['id'];});if(_0x42ab1d)_0x335ca8[_0x816f('0x66')](_0x3c5742);}else{_0x335ca8['push'](_0x3c5742);}}return _0x335ca8;}});}else{return _0x16bef5;}}else{var _0x21ede5=_[_0x816f('0x3f')](_0x16bef5,function(_0x32bbcc){if(_0x32bbcc[_0x816f('0x58')]!==_0x816f('0x56')){return _0x32bbcc;}});return _0x21ede5;}});}else{return _0x16bef5;}}})['then'](function(_0x572ea7){var _0x27600c=[];if(_0x572ea7){_0xbc4bc8=_0x572ea7;for(var _0x523a69=0x0;_0x523a69<_0x572ea7['length'];_0x523a69+=0x1){_0xbc4bc8[_0x523a69]['messages']=[];_0x27600c[_0x816f('0x66')](db[_0x816f('0x2b')][_0x816f('0x48')]({'where':{'FromId':[_0x582f17[_0x816f('0x5d')]['id'],_0x572ea7[_0x523a69]['id']],'ToId':[_0x582f17['user']['id'],_0x572ea7[_0x523a69]['id']],'ChatGroupId':null},'attributes':['id',_0x816f('0x51'),_0x816f('0x67'),_0x816f('0x68'),_0x816f('0x69'),_0x816f('0x4a')],'order':qs['sort'](_0x816f('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x572ea7[_0x523a69])));}return BPromise[_0x816f('0x6b')](_0x27600c);}return[];})[_0x816f('0x25')](function(_0xdcd8de){return{'rows':_0xdcd8de,'count':_0xdcd8de[_0x816f('0x36')]};})[_0x816f('0x25')](respondWithResult(_0x4d68b7,null))[_0x816f('0x46')](handleError(_0x4d68b7,null));};
\ No newline at end of file
+var _0x9588=['defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','json','count','offset','Content-Range','reject','save','then','end','sendStatus','error','name','send','index','ChatInternalMessage','rawAttributes','keys','dateStart','dateEnd','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','add','day','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','catch','create','update','body','params','destroy','describe','get','messages','lastMessageAt','lastMessage','getUsers','agent','admin','fullname','role','userpic','online','lastLoginAt','-online','VoiceQueues','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x38f2c7,_0x5e3a18){var _0x23a13f=function(_0x27d084){while(--_0x27d084){_0x38f2c7['push'](_0x38f2c7['shift']());}};_0x23a13f(++_0x5e3a18);}(_0x9588,0xc6));var _0x8958=function(_0xbe67da,_0x240a62){_0xbe67da=_0xbe67da-0x0;var _0x2ce611=_0x9588[_0xbe67da];return _0x2ce611;};'use strict';var pdf=require(_0x8958('0x0'));var emlformat=require(_0x8958('0x1'));var rimraf=require(_0x8958('0x2'));var zipdir=require(_0x8958('0x3'));var jsonpatch=require(_0x8958('0x4'));var rp=require(_0x8958('0x5'));var moment=require(_0x8958('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8958('0x7'));var util=require('util');var path=require(_0x8958('0x8'));var sox=require(_0x8958('0x9'));var csv=require('to-csv');var ejs=require(_0x8958('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8958('0xb'));var crypto=require(_0x8958('0xc'));var jsforce=require(_0x8958('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8958('0xe'));var Papa=require(_0x8958('0xf'));var Redis=require(_0x8958('0x10'));var qs=require(_0x8958('0x11'));var logger=require(_0x8958('0x12'))(_0x8958('0x13'));var utils=require(_0x8958('0x14'));var config=require('../../config/environment');var db=require(_0x8958('0x15'))['db'];config['redis']=_[_0x8958('0x16')](config[_0x8958('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8958('0x18'))(new Redis(config[_0x8958('0x17')]));require(_0x8958('0x19'))[_0x8958('0x1a')](socket);function respondWithStatusCode(_0x53e5e0,_0x331666){_0x331666=_0x331666||0xcc;return function(_0x2c209a){if(_0x2c209a){return _0x53e5e0['sendStatus'](_0x331666);}return _0x53e5e0['status'](_0x331666)['end']();};}function respondWithResult(_0x460071,_0x9060a6){_0x9060a6=_0x9060a6||0xc8;return function(_0x178d85){if(_0x178d85){return _0x460071[_0x8958('0x1b')](_0x9060a6)[_0x8958('0x1c')](_0x178d85);}};}function respondWithFilteredResult(_0x8edb99,_0x835dac){return function(_0x5c3401){if(_0x5c3401){var _0x1df426=_0x5c3401[_0x8958('0x1d')],_0x4bb587=_0x835dac[_0x8958('0x1e')],_0x1a42c9=_0x835dac[_0x8958('0x1e')]+_0x835dac['limit'],_0xe94627;if(_0x1a42c9>=_0x1df426){_0x1a42c9=_0x1df426;_0xe94627=0xc8;}else{_0xe94627=0xce;}_0x8edb99[_0x8958('0x1b')](_0xe94627);return _0x8edb99['set'](_0x8958('0x1f'),_0x4bb587+'-'+_0x1a42c9+'/'+_0x1df426)['json'](_0x5c3401);}return null;};}function patchUpdates(_0x4fc4b9){return function(_0x339164){try{jsonpatch['apply'](_0x339164,_0x4fc4b9,!![]);}catch(_0x5e01d0){return BPromise[_0x8958('0x20')](_0x5e01d0);}return _0x339164[_0x8958('0x21')]();};}function saveUpdates(_0x2af1d3,_0x50035b){return function(_0x177a6f){if(_0x177a6f){return _0x177a6f['update'](_0x2af1d3)[_0x8958('0x22')](function(_0x63d399){return _0x63d399;});}return null;};}function removeEntity(_0x419b34,_0x3c3e14){return function(_0x11bd9b){if(_0x11bd9b){return _0x11bd9b['destroy']()[_0x8958('0x22')](function(){_0x419b34[_0x8958('0x1b')](0xcc)[_0x8958('0x23')]();});}};}function handleEntityNotFound(_0x297128,_0x3949f7){return function(_0x27e0e0){if(!_0x27e0e0){_0x297128[_0x8958('0x24')](0x194);}return _0x27e0e0;};}function handleError(_0x23e095,_0x291039){_0x291039=_0x291039||0x1f4;return function(_0x4aa5e2){logger[_0x8958('0x25')](_0x4aa5e2['stack']);if(_0x4aa5e2[_0x8958('0x26')]){delete _0x4aa5e2[_0x8958('0x26')];}_0x23e095['status'](_0x291039)[_0x8958('0x27')](_0x4aa5e2);};}exports[_0x8958('0x28')]=function(_0x4030c0,_0x35a756){var _0x30e80b={},_0x2eee0e={},_0x4e62f6={'count':0x0,'rows':[]};var _0x1b279c=db[_0x8958('0x29')][_0x8958('0x2a')];_0x2eee0e['model']=_[_0x8958('0x2b')](_0x1b279c);var _0x505479={'dateStart':_0x4030c0['query'][_0x8958('0x2c')],'dateEnd':_0x4030c0['query'][_0x8958('0x2d')]};delete _0x4030c0[_0x8958('0x2e')][_0x8958('0x2c')];delete _0x4030c0[_0x8958('0x2e')][_0x8958('0x2d')];_0x2eee0e[_0x8958('0x2e')]=_[_0x8958('0x2b')](_0x4030c0[_0x8958('0x2e')]);_0x2eee0e[_0x8958('0x2f')]=_[_0x8958('0x30')](_0x2eee0e[_0x8958('0x31')],_0x2eee0e[_0x8958('0x2e')]);_0x30e80b[_0x8958('0x32')]=_[_0x8958('0x30')](_0x2eee0e['model'],qs[_0x8958('0x33')](_0x4030c0[_0x8958('0x2e')][_0x8958('0x33')]));_0x30e80b[_0x8958('0x32')]=_0x30e80b['attributes'][_0x8958('0x34')]?_0x30e80b[_0x8958('0x32')]:_0x2eee0e[_0x8958('0x31')];if(!_0x4030c0['query']['hasOwnProperty'](_0x8958('0x35'))){_0x30e80b['limit']=qs[_0x8958('0x36')](_0x4030c0[_0x8958('0x2e')][_0x8958('0x36')]);_0x30e80b['offset']=qs['offset'](_0x4030c0[_0x8958('0x2e')]['offset']);}_0x30e80b[_0x8958('0x37')]=qs[_0x8958('0x38')](_0x4030c0[_0x8958('0x2e')][_0x8958('0x38')]);_0x30e80b[_0x8958('0x39')]=qs[_0x8958('0x2f')](_['pick'](_0x4030c0[_0x8958('0x2e')],_0x2eee0e[_0x8958('0x2f')]));if(_0x505479[_0x8958('0x2c')]){if(_0x505479[_0x8958('0x2d')]){_0x505479[_0x8958('0x2d')]=moment(_0x505479[_0x8958('0x2d')])[_0x8958('0x3a')](0x1,_0x8958('0x3b'));}else{_0x505479['dateEnd']=moment(_0x505479[_0x8958('0x2c')])[_0x8958('0x3a')](0x1,_0x8958('0x3b'));}_['merge'](_0x30e80b[_0x8958('0x39')],{'createdAt':{'$gte':_0x505479['dateStart'],'$lte':_0x505479[_0x8958('0x2d')]}});}if(_0x4030c0[_0x8958('0x2e')][_0x8958('0x3c')]){_0x30e80b[_0x8958('0x39')]=_[_0x8958('0x3d')](_0x30e80b['where'],{'$or':_[_0x8958('0x3e')](_0x1b279c,function(_0x46dd30){if(_0x46dd30[_0x8958('0x3f')][_0x8958('0x40')]!==_0x8958('0x41')){var _0x35f6a3={};_0x35f6a3[_0x46dd30[_0x8958('0x42')]]={'$like':'%'+_0x4030c0[_0x8958('0x2e')][_0x8958('0x3c')]+'%'};return _0x35f6a3;}})});}_0x30e80b=_[_0x8958('0x3d')]({},_0x30e80b,_0x4030c0[_0x8958('0x43')]);var _0x58eae2={'where':_0x30e80b[_0x8958('0x39')]};return db[_0x8958('0x29')][_0x8958('0x1d')](_0x58eae2)['then'](function(_0x3daa15){_0x4e62f6[_0x8958('0x1d')]=_0x3daa15;if(_0x4030c0[_0x8958('0x2e')][_0x8958('0x44')]){_0x30e80b[_0x8958('0x45')]=[{'all':!![]}];}return db[_0x8958('0x29')][_0x8958('0x46')](_0x30e80b);})[_0x8958('0x22')](function(_0x32bd62){_0x4e62f6[_0x8958('0x47')]=_0x32bd62;return _0x4e62f6;})[_0x8958('0x22')](respondWithFilteredResult(_0x35a756,_0x30e80b))['catch'](handleError(_0x35a756,null));};exports[_0x8958('0x48')]=function(_0x484c5f,_0x15f462){var _0x3f139d={'raw':!![],'where':{'id':_0x484c5f['params']['id']}},_0x56e777={};_0x56e777[_0x8958('0x31')]=_[_0x8958('0x2b')](db[_0x8958('0x29')][_0x8958('0x2a')]);_0x56e777[_0x8958('0x2e')]=_['keys'](_0x484c5f[_0x8958('0x2e')]);_0x56e777[_0x8958('0x2f')]=_[_0x8958('0x30')](_0x56e777['model'],_0x56e777['query']);_0x3f139d[_0x8958('0x32')]=_['intersection'](_0x56e777[_0x8958('0x31')],qs[_0x8958('0x33')](_0x484c5f['query'][_0x8958('0x33')]));_0x3f139d[_0x8958('0x32')]=_0x3f139d[_0x8958('0x32')][_0x8958('0x34')]?_0x3f139d[_0x8958('0x32')]:_0x56e777['model'];if(_0x484c5f['query'][_0x8958('0x44')]){_0x3f139d[_0x8958('0x45')]=[{'all':!![]}];}_0x3f139d=_['merge']({},_0x3f139d,_0x484c5f[_0x8958('0x43')]);return db[_0x8958('0x29')][_0x8958('0x49')](_0x3f139d)[_0x8958('0x22')](handleEntityNotFound(_0x15f462,null))[_0x8958('0x22')](respondWithResult(_0x15f462,null))[_0x8958('0x4a')](handleError(_0x15f462,null));};exports[_0x8958('0x4b')]=function(_0x7ea867,_0x189d79){return db[_0x8958('0x29')][_0x8958('0x4b')](_0x7ea867['body'],{})[_0x8958('0x22')](respondWithResult(_0x189d79,0xc9))[_0x8958('0x4a')](handleError(_0x189d79,null));};exports[_0x8958('0x4c')]=function(_0x133383,_0x545f0c){if(_0x133383[_0x8958('0x4d')]['id']){delete _0x133383[_0x8958('0x4d')]['id'];}return db[_0x8958('0x29')]['find']({'where':{'id':_0x133383[_0x8958('0x4e')]['id']}})['then'](handleEntityNotFound(_0x545f0c,null))[_0x8958('0x22')](saveUpdates(_0x133383[_0x8958('0x4d')],null))[_0x8958('0x22')](respondWithResult(_0x545f0c,null))[_0x8958('0x4a')](handleError(_0x545f0c,null));};exports[_0x8958('0x4f')]=function(_0x32ad2d,_0x72ae5a){return db[_0x8958('0x29')][_0x8958('0x49')]({'where':{'id':_0x32ad2d[_0x8958('0x4e')]['id']}})[_0x8958('0x22')](handleEntityNotFound(_0x72ae5a,null))[_0x8958('0x22')](removeEntity(_0x72ae5a,null))[_0x8958('0x4a')](handleError(_0x72ae5a,null));};exports[_0x8958('0x50')]=function(_0x32a8fc,_0x596632){return db[_0x8958('0x29')][_0x8958('0x50')]()[_0x8958('0x22')](respondWithResult(_0x596632,null))[_0x8958('0x4a')](handleError(_0x596632,null));};function wrapUser(_0x189a76){return function(_0x25b1ea){var _0x177962=_0x189a76[_0x8958('0x51')]({'plain':!![]});_0x177962[_0x8958('0x52')]=[];if(_0x25b1ea){_0x177962[_0x8958('0x53')]=_0x25b1ea['createdAt'];_0x177962['lastMessage']=_0x25b1ea;}else{_0x177962[_0x8958('0x53')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x177962[_0x8958('0x54')]={};}return _0x177962;};}exports[_0x8958('0x55')]=function(_0x428dd9,_0x4ccbe7,_0x53d335){var _0x2fde5b=[];return db['User'][_0x8958('0x46')]({'where':{'role':[_0x8958('0x56'),_0x8958('0x57'),'user']},'attributes':['id',_0x8958('0x58'),_0x8958('0x26'),_0x8958('0x59'),_0x8958('0x5a'),'internal',_0x8958('0x5b'),_0x8958('0x5c'),'allowmessenger','showWebBar'],'order':qs[_0x8958('0x38')](_0x8958('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x8958('0x5e'),'attributes':['id',_0x8958('0x26'),'type'],'through':{'attributes':[]}}]})[_0x8958('0x22')](function(_0x4df86e){if(_0x4df86e){var _0x21860c=_0x428dd9[_0x8958('0x5f')][_0x8958('0x51')]({'plain':!![]});if(!_0x21860c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21860c[_0x8958('0x59')]==='user'){return db[_0x8958('0x60')]['find']({'where':{'name':_0x8958('0x61'),'userProfileId':_0x21860c[_0x8958('0x62')]},'raw':!![]})[_0x8958('0x22')](function(_0x4aa838){if(_0x4aa838){if(_0x4aa838[_0x8958('0x63')]===0x0){return db[_0x8958('0x64')]['findAll']({'where':{'sectionId':_0x4aa838['id']},'raw':!![]})['then'](function(_0x897000){var _0x2376d4=[];if(_[_0x8958('0x65')](_0x897000)){_0x2376d4=_['filter'](_0x4df86e,function(_0x2db1dd){if(_0x2db1dd['role']!=='agent'){return _0x2db1dd;}});return _0x2376d4;}else{for(var _0x16f046=0x0;_0x16f046<_0x4df86e['length'];_0x16f046++){var _0x52feb3=_0x4df86e[_0x16f046];if(_0x52feb3[_0x8958('0x59')]===_0x8958('0x56')){var _0x1e5028=_[_0x8958('0x49')](_0x897000,function(_0x38c088){return _0x38c088[_0x8958('0x66')]===_0x52feb3['id'];});if(_0x1e5028)_0x2376d4[_0x8958('0x67')](_0x52feb3);}else{_0x2376d4[_0x8958('0x67')](_0x52feb3);}}return _0x2376d4;}});}else{return _0x4df86e;}}else{var _0x537911=_[_0x8958('0x3c')](_0x4df86e,function(_0x1b5bb7){if(_0x1b5bb7[_0x8958('0x59')]!==_0x8958('0x56')){return _0x1b5bb7;}});return _0x537911;}});}else{return _0x4df86e;}}})['then'](function(_0x2eca4a){var _0xbaffca=[];if(_0x2eca4a){_0x2fde5b=_0x2eca4a;for(var _0x4c9ca9=0x0;_0x4c9ca9<_0x2eca4a[_0x8958('0x34')];_0x4c9ca9+=0x1){_0x2fde5b[_0x4c9ca9][_0x8958('0x52')]=[];_0xbaffca[_0x8958('0x67')](db[_0x8958('0x29')][_0x8958('0x49')]({'where':{'FromId':[_0x428dd9[_0x8958('0x5f')]['id'],_0x2eca4a[_0x4c9ca9]['id']],'ToId':[_0x428dd9[_0x8958('0x5f')]['id'],_0x2eca4a[_0x4c9ca9]['id']],'ChatGroupId':null},'attributes':['id',_0x8958('0x68'),_0x8958('0x69'),_0x8958('0x6a'),_0x8958('0x6b'),'body'],'order':qs[_0x8958('0x38')](_0x8958('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8958('0x22')](wrapUser(_0x2eca4a[_0x4c9ca9])));}return BPromise[_0x8958('0x6d')](_0xbaffca);}return[];})[_0x8958('0x22')](function(_0x167591){return{'rows':_0x167591,'count':_0x167591['length']};})[_0x8958('0x22')](respondWithResult(_0x4ccbe7,null))[_0x8958('0x4a')](handleError(_0x4ccbe7,null));};
\ No newline at end of file
index 25fc434..656f9f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f65=['save','update','emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x4b0a5a,_0x49f7ab){var _0x12d259=function(_0x3cc158){while(--_0x3cc158){_0x4b0a5a['push'](_0x4b0a5a['shift']());}};_0x12d259(++_0x49f7ab);}(_0x2f65,0xcd));var _0x52f6=function(_0x2d3488,_0x59d1fd){_0x2d3488=_0x2d3488-0x0;var _0x40c164=_0x2f65[_0x2d3488];return _0x40c164;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x52f6('0x0'))['db'][_0x52f6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x52f6('0x2')](0x0);var events={'afterCreate':_0x52f6('0x3'),'afterUpdate':_0x52f6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ab633){return function(_0x541b96,_0x5bd7fb,_0xed5f9c){ChatInternalMessageEvents[_0x52f6('0x5')](_0x1ab633+':'+_0x541b96['id'],_0x541b96);ChatInternalMessageEvents[_0x52f6('0x5')](_0x1ab633,_0x541b96);_0xed5f9c(null);};}for(var e in events){if(events[_0x52f6('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x52f6('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x8c35=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','save','remove'];(function(_0x4c0fd1,_0x518fc3){var _0x2459da=function(_0x3f0100){while(--_0x3f0100){_0x4c0fd1['push'](_0x4c0fd1['shift']());}};_0x2459da(++_0x518fc3);}(_0x8c35,0x1cb));var _0x58c3=function(_0x2bc533,_0x1af01d){_0x2bc533=_0x2bc533-0x0;var _0x35183c=_0x8c35[_0x2bc533];return _0x35183c;};'use strict';var EventEmitter=require(_0x58c3('0x0'));var ChatInternalMessage=require(_0x58c3('0x1'))['db'][_0x58c3('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x58c3('0x3'),'afterUpdate':'update','afterDestroy':_0x58c3('0x4')};function emitEvent(_0x43bf05){return function(_0xae785,_0x370107,_0x20a9a7){ChatInternalMessageEvents[_0x58c3('0x5')](_0x43bf05+':'+_0xae785['id'],_0xae785);ChatInternalMessageEvents[_0x58c3('0x5')](_0x43bf05,_0xae785);_0x20a9a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x58c3('0x6')](e,emitEvent(event));}}module[_0x58c3('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
index 7f01e02..f68570c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x049c=['request-promise','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x9714c8,_0x5020b5){var _0xf4e3f8=function(_0x28bb39){while(--_0x28bb39){_0x9714c8['push'](_0x9714c8['shift']());}};_0xf4e3f8(++_0x5020b5);}(_0x049c,0xae));var _0xc049=function(_0x2bd687,_0x29a9d7){_0x2bd687=_0x2bd687-0x0;var _0x42f8eb=_0x049c[_0x2bd687];return _0x42f8eb;};'use strict';var _=require(_0xc049('0x0'));var util=require(_0xc049('0x1'));var logger=require(_0xc049('0x2'))(_0xc049('0x3'));var moment=require(_0xc049('0x4'));var BPromise=require(_0xc049('0x5'));var rp=require(_0xc049('0x6'));var attributes=require(_0xc049('0x7'));module[_0xc049('0x8')]=function(_0x44b3ee,_0x310558){return _0x44b3ee['define'](_0xc049('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc049('0xa'),'collate':_0xc049('0xb')});};
\ No newline at end of file
+var _0x975b=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x975b,0x1c9));var _0xb975=function(_0x19b9a6,_0x3e01e2){_0x19b9a6=_0x19b9a6-0x0;var _0x348fc9=_0x975b[_0x19b9a6];return _0x348fc9;};'use strict';var _=require(_0xb975('0x0'));var util=require(_0xb975('0x1'));var logger=require(_0xb975('0x2'))(_0xb975('0x3'));var moment=require(_0xb975('0x4'));var BPromise=require(_0xb975('0x5'));var rp=require(_0xb975('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0xb975('0x7')]=function(_0xfb173,_0x2007e4){return _0xfb173[_0xb975('0x8')](_0xb975('0x9'),attributes,{'tableName':_0xb975('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb975('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index c68319f..250e4f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7985=['socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x2c3807,_0x1e33d3){var _0x456781=function(_0x574ef1){while(--_0x574ef1){_0x2c3807['push'](_0x2c3807['shift']());}};_0x456781(++_0x1e33d3);}(_0x7985,0x15f));var _0x5798=function(_0xa59345,_0x86f01c){_0xa59345=_0xa59345-0x0;var _0x22fc32=_0x7985[_0xa59345];return _0x22fc32;};'use strict';var _=require(_0x5798('0x0'));var util=require(_0x5798('0x1'));var moment=require(_0x5798('0x2'));var BPromise=require(_0x5798('0x3'));var rs=require(_0x5798('0x4'));var fs=require('fs');var Redis=require(_0x5798('0x5'));var db=require(_0x5798('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5798('0x7'))(_0x5798('0x8'));var config=require(_0x5798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5798('0xa')][_0x5798('0xb')]({'port':0x232a});config[_0x5798('0xc')]=_['defaults'](config[_0x5798('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5798('0xd'))(new Redis(config[_0x5798('0xc')]));require(_0x5798('0xe'))[_0x5798('0xf')](socket);function respondWithRpcPromise(_0xa8154a,_0x4f37d4,_0x233d9f){return new BPromise(function(_0x227590,_0x420b85){return client[_0x5798('0x10')](_0xa8154a,_0x233d9f)[_0x5798('0x11')](function(_0x5d171f){logger[_0x5798('0x12')](_0x5798('0x13'),_0x4f37d4,_0x5798('0x14'));logger[_0x5798('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4f37d4,_0x5798('0x14'),JSON['stringify'](_0x5d171f));if(_0x5d171f[_0x5798('0x16')]){if(_0x5d171f[_0x5798('0x16')][_0x5798('0x17')]===0x1f4){logger['error'](_0x5798('0x13'),_0x4f37d4,_0x5d171f[_0x5798('0x16')]['message']);return _0x420b85(_0x5d171f['error']['message']);}logger[_0x5798('0x16')](_0x5798('0x13'),_0x4f37d4,_0x5d171f[_0x5798('0x16')]['message']);return _0x227590(_0x5d171f[_0x5798('0x16')][_0x5798('0x18')]);}else{logger['info'](_0x5798('0x13'),_0x4f37d4,_0x5798('0x14'));_0x227590(_0x5d171f[_0x5798('0x19')][_0x5798('0x18')]);}})['catch'](function(_0x15b910){logger['error'](_0x5798('0x13'),_0x4f37d4,_0x15b910);_0x420b85(_0x15b910);});});}
\ No newline at end of file
+var _0x9e0d=['request','then','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x9e0d,0x12b));var _0xd9e0=function(_0x3ecdb6,_0x12bb5e){_0x3ecdb6=_0x3ecdb6-0x0;var _0x101a4c=_0x9e0d[_0x3ecdb6];return _0x101a4c;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require(_0xd9e0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd9e0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd9e0('0x7')]['http']({'port':0x232a});config[_0xd9e0('0x8')]=_[_0xd9e0('0x9')](config[_0xd9e0('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd9e0('0xa'))(new Redis(config[_0xd9e0('0x8')]));require(_0xd9e0('0xb'))[_0xd9e0('0xc')](socket);function respondWithRpcPromise(_0x475c56,_0x1ed2a7,_0x1a8671){return new BPromise(function(_0x3b5629,_0x349d94){return client[_0xd9e0('0xd')](_0x475c56,_0x1a8671)[_0xd9e0('0xe')](function(_0x3ada73){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x1ed2a7,_0xd9e0('0xf'));logger[_0xd9e0('0x10')](_0xd9e0('0x11'),_0x1ed2a7,'request\x20sent',JSON['stringify'](_0x3ada73));if(_0x3ada73['error']){if(_0x3ada73[_0xd9e0('0x12')]['code']===0x1f4){logger['error'](_0xd9e0('0x13'),_0x1ed2a7,_0x3ada73['error']['message']);return _0x349d94(_0x3ada73[_0xd9e0('0x12')]['message']);}logger[_0xd9e0('0x12')](_0xd9e0('0x13'),_0x1ed2a7,_0x3ada73[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3b5629(_0x3ada73['error'][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0x15')](_0xd9e0('0x13'),_0x1ed2a7,'request\x20sent');_0x3b5629(_0x3ada73[_0xd9e0('0x16')][_0xd9e0('0x14')]);}})[_0xd9e0('0x17')](function(_0x1aab7b){logger[_0xd9e0('0x12')](_0xd9e0('0x13'),_0x1ed2a7,_0x1aab7b);_0x349d94(_0x1aab7b);});});}
\ No newline at end of file
index b84609c..8ad9745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa780=['emit','removeListener','register','save','remove','update'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0xa780,0x153));var _0x0a78=function(_0x3d49aa,_0x88cf19){_0x3d49aa=_0x3d49aa-0x0;var _0x568230=_0xa780[_0x3d49aa];return _0x568230;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x0a78('0x0'),_0x0a78('0x1'),_0x0a78('0x2')];function createListener(_0x1ff7ee,_0x54db45){return function(_0x10edcc){_0x54db45[_0x0a78('0x3')](_0x1ff7ee,_0x10edcc);};}function removeListener(_0x2294c2,_0x526885){return function(){ChatInternalMessageEvents[_0x0a78('0x4')](_0x2294c2,_0x526885);};}exports[_0x0a78('0x5')]=function(_0x2e3d86){for(var _0x3c240e=0x0,_0x3d2253=events['length'];_0x3c240e<_0x3d2253;_0x3c240e++){var _0x377696=events[_0x3c240e];var _0x56c3cf=createListener('chatInternalMessage:'+_0x377696,_0x2e3d86);ChatInternalMessageEvents['on'](_0x377696,_0x56c3cf);}};
\ No newline at end of file
+var _0x859c=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x5c05ab,_0x4da7c0){var _0x429b3b=function(_0xdbc0be){while(--_0xdbc0be){_0x5c05ab['push'](_0x5c05ab['shift']());}};_0x429b3b(++_0x4da7c0);}(_0x859c,0x1c7));var _0xc859=function(_0x4e31b4,_0x319bb5){_0x4e31b4=_0x4e31b4-0x0;var _0x57b16e=_0x859c[_0x4e31b4];return _0x57b16e;};'use strict';var ChatInternalMessageEvents=require(_0xc859('0x0'));var events=['save',_0xc859('0x1'),_0xc859('0x2')];function createListener(_0x28cfba,_0x56dfa1){return function(_0x4de7dd){_0x56dfa1[_0xc859('0x3')](_0x28cfba,_0x4de7dd);};}function removeListener(_0x4e5977,_0x34ded1){return function(){ChatInternalMessageEvents[_0xc859('0x4')](_0x4e5977,_0x34ded1);};}exports[_0xc859('0x5')]=function(_0x599c1c){for(var _0x56391a=0x0,_0x10930d=events[_0xc859('0x6')];_0x56391a<_0x10930d;_0x56391a++){var _0x535b12=events[_0x56391a];var _0x5e74de=createListener(_0xc859('0x7')+_0x535b12,_0x599c1c);ChatInternalMessageEvents['on'](_0x535b12,_0x5e74de);}};
\ No newline at end of file
index 3ac7b8f..90b300c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe666=['update','delete','exports','multer','connect-timeout','Router','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','getUsers','/:id','post','put'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe666,0x189));var _0x6e66=function(_0x59166d,_0x415c2d){_0x59166d=_0x59166d-0x0;var _0x2184e1=_0xe666[_0x59166d];return _0x2184e1;};'use strict';var multer=require(_0x6e66('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6e66('0x1'));var express=require('express');var router=express[_0x6e66('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e66('0x3'));var config=require('../../config/environment');var controller=require(_0x6e66('0x4'));router[_0x6e66('0x5')]('/',auth[_0x6e66('0x6')](),controller[_0x6e66('0x7')]);router[_0x6e66('0x5')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/users',auth[_0x6e66('0x6')](),controller[_0x6e66('0x8')]);router[_0x6e66('0x5')](_0x6e66('0x9'),auth[_0x6e66('0x6')](),controller['show']);router[_0x6e66('0xa')]('/',auth[_0x6e66('0x6')](),controller['create']);router[_0x6e66('0xb')]('/:id',controller[_0x6e66('0xc')]);router[_0x6e66('0xd')](_0x6e66('0x9'),auth[_0x6e66('0x6')](),controller['destroy']);module[_0x6e66('0xe')]=router;
\ No newline at end of file
+var _0x995a=['express','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','getUsers','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout'];(function(_0x2e6299,_0x2f20dc){var _0x3098ff=function(_0x5557ca){while(--_0x5557ca){_0x2e6299['push'](_0x2e6299['shift']());}};_0x3098ff(++_0x2f20dc);}(_0x995a,0x176));var _0xa995=function(_0x5478d5,_0x2d0139){_0x5478d5=_0x5478d5-0x0;var _0x4e8de7=_0x995a[_0x5478d5];return _0x4e8de7;};'use strict';var multer=require(_0xa995('0x0'));var util=require(_0xa995('0x1'));var path=require(_0xa995('0x2'));var timeout=require(_0xa995('0x3'));var express=require(_0xa995('0x4'));var router=express[_0xa995('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa995('0x6'));var config=require(_0xa995('0x7'));var controller=require(_0xa995('0x8'));router[_0xa995('0x9')]('/',auth['isAuthenticated'](),controller[_0xa995('0xa')]);router[_0xa995('0x9')](_0xa995('0xb'),auth[_0xa995('0xc')](),controller[_0xa995('0xd')]);router[_0xa995('0x9')]('/users',auth[_0xa995('0xc')](),controller[_0xa995('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa995('0xf')]('/',auth[_0xa995('0xc')](),controller[_0xa995('0x10')]);router[_0xa995('0x11')](_0xa995('0x12'),controller[_0xa995('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa995('0x14')]);module['exports']=router;
\ No newline at end of file
index 11b379a..fc0b66d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd7=['medium','BOOLEAN','ENUM','DATE','sequelize','exports','TEXT'];(function(_0x42f5eb,_0x160eb1){var _0x27afd0=function(_0x48b798){while(--_0x48b798){_0x42f5eb['push'](_0x42f5eb['shift']());}};_0x27afd0(++_0x160eb1);}(_0x2bd7,0x1d9));var _0x72bd=function(_0x5caf9c,_0x573d14){_0x5caf9c=_0x5caf9c-0x0;var _0x502a20=_0x2bd7[_0x5caf9c];return _0x502a20;};'use strict';var Sequelize=require(_0x72bd('0x0'));module[_0x72bd('0x1')]={'body':{'type':Sequelize[_0x72bd('0x2')](_0x72bd('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x72bd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x72bd('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x72bd('0x6')]}};
\ No newline at end of file
+var _0x63ba=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63ba,0xa1));var _0xa63b=function(_0x1d483f,_0x47a0e0){_0x1d483f=_0x1d483f-0x0;var _0x41b378=_0x63ba[_0x1d483f];return _0x41b378;};'use strict';var Sequelize=require(_0xa63b('0x0'));module[_0xa63b('0x1')]={'body':{'type':Sequelize[_0xa63b('0x2')](_0xa63b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa63b('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa63b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa63b('0x5')]('in',_0xa63b('0x6')),'defaultValue':_0xa63b('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 962770e..a1943e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7278=['desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','ChatMessage','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','filter','type','key','VIRTUAL','field','options','includeAll','show','params','include','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','stringify','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','parse','chat-interactions','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x57a292,_0x8a4ea4){var _0x1c30f8=function(_0x210019){while(--_0x210019){_0x57a292['push'](_0x57a292['shift']());}};_0x1c30f8(++_0x8a4ea4);}(_0x7278,0x161));var _0x8727=function(_0x3026e0,_0x347052){_0x3026e0=_0x3026e0-0x0;var _0xf19758=_0x7278[_0x3026e0];return _0xf19758;};'use strict';var pdf=require(_0x8727('0x0'));var emlformat=require(_0x8727('0x1'));var rimraf=require(_0x8727('0x2'));var zipdir=require(_0x8727('0x3'));var jsonpatch=require(_0x8727('0x4'));var rp=require('request-promise');var moment=require(_0x8727('0x5'));var BPromise=require(_0x8727('0x6'));var Mustache=require(_0x8727('0x7'));var util=require(_0x8727('0x8'));var path=require(_0x8727('0x9'));var sox=require(_0x8727('0xa'));var csv=require(_0x8727('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8727('0xc'));var squel=require(_0x8727('0xd'));var crypto=require(_0x8727('0xe'));var jsforce=require(_0x8727('0xf'));var deskjs=require(_0x8727('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8727('0x11'));var qs=require(_0x8727('0x12'));var logger=require(_0x8727('0x13'))(_0x8727('0x14'));var utils=require(_0x8727('0x15'));var config=require(_0x8727('0x16'));var db=require(_0x8727('0x17'))['db'];config[_0x8727('0x18')]=_['defaults'](config[_0x8727('0x18')],{'host':_0x8727('0x19'),'port':0x18eb});var socket=require(_0x8727('0x1a'))(new Redis(config['redis']));require(_0x8727('0x1b'))[_0x8727('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8727('0x1d')][_0x8727('0x1e')]({'port':0x232c});var client9002=jayson[_0x8727('0x1d')][_0x8727('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2ea789,_0x3d84db,_0x3865e9,_0x1916f7){return new BPromise(function(_0x11c828,_0x88857c){var _0x4842a0=_0x1916f7||client;return _0x4842a0[_0x8727('0x1f')](_0x2ea789,_0x3865e9)[_0x8727('0x20')](function(_0x16d1b7){logger[_0x8727('0x21')](_0x8727('0x22'),_0x3d84db,_0x8727('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3d84db,_0x8727('0x23'),JSON['stringify'](_0x16d1b7));if(_0x16d1b7[_0x8727('0x24')]){if(_0x16d1b7[_0x8727('0x24')][_0x8727('0x25')]===0x1f4){logger[_0x8727('0x24')](_0x8727('0x22'),_0x3d84db,_0x16d1b7['error'][_0x8727('0x26')]);return _0x88857c(_0x16d1b7[_0x8727('0x24')][_0x8727('0x26')]);}logger[_0x8727('0x24')](_0x8727('0x22'),_0x3d84db,_0x16d1b7[_0x8727('0x24')][_0x8727('0x26')]);return _0x11c828(_0x16d1b7[_0x8727('0x24')][_0x8727('0x26')]);}else{logger[_0x8727('0x21')](_0x8727('0x22'),_0x3d84db,_0x8727('0x23'));_0x11c828(_0x16d1b7['result'][_0x8727('0x26')]);}})[_0x8727('0x27')](function(_0x4c468d){logger['error'](_0x8727('0x22'),_0x3d84db,_0x4c468d);_0x88857c(_0x4c468d);});});}function respondWithStatusCode(_0x318684,_0x15e8bf){_0x15e8bf=_0x15e8bf||0xcc;return function(_0x5de6fa){if(_0x5de6fa){return _0x318684[_0x8727('0x28')](_0x15e8bf);}return _0x318684[_0x8727('0x29')](_0x15e8bf)[_0x8727('0x2a')]();};}function respondWithResult(_0x440ff5,_0x2c8cd5){_0x2c8cd5=_0x2c8cd5||0xc8;return function(_0xf33348){if(_0xf33348){return _0x440ff5[_0x8727('0x29')](_0x2c8cd5)[_0x8727('0x2b')](_0xf33348);}};}function respondWithFilteredResult(_0x5d03f2,_0x243f15){return function(_0x307055){if(_0x307055){var _0x54034d=_0x307055[_0x8727('0x2c')],_0x23325f=_0x243f15[_0x8727('0x2d')],_0x163989=_0x243f15[_0x8727('0x2d')]+_0x243f15['limit'],_0x3ecd6a;if(_0x163989>=_0x54034d){_0x163989=_0x54034d;_0x3ecd6a=0xc8;}else{_0x3ecd6a=0xce;}_0x5d03f2[_0x8727('0x29')](_0x3ecd6a);return _0x5d03f2['set'](_0x8727('0x2e'),_0x23325f+'-'+_0x163989+'/'+_0x54034d)['json'](_0x307055);}return null;};}function patchUpdates(_0x44ed83){return function(_0x391d60){try{jsonpatch[_0x8727('0x2f')](_0x391d60,_0x44ed83,!![]);}catch(_0x2322ab){return BPromise[_0x8727('0x30')](_0x2322ab);}return _0x391d60[_0x8727('0x31')]();};}function saveUpdates(_0x382be3,_0x4b6162){return function(_0x3ac06a){if(_0x3ac06a){return _0x3ac06a[_0x8727('0x32')](_0x382be3)[_0x8727('0x20')](function(_0x1b047a){return _0x1b047a;});}return null;};}function removeEntity(_0x3374e8,_0x180674){return function(_0x1626ff){if(_0x1626ff){return _0x1626ff[_0x8727('0x33')]()[_0x8727('0x20')](function(){_0x3374e8[_0x8727('0x29')](0xcc)[_0x8727('0x2a')]();});}};}function handleEntityNotFound(_0x184905,_0x54bff3){return function(_0x4a0467){if(!_0x4a0467){_0x184905[_0x8727('0x28')](0x194);}return _0x4a0467;};}function handleError(_0x3fac76,_0x38a61f){_0x38a61f=_0x38a61f||0x1f4;return function(_0x477ae2){logger['error'](_0x477ae2[_0x8727('0x34')]);if(_0x477ae2[_0x8727('0x35')]){delete _0x477ae2[_0x8727('0x35')];}_0x3fac76[_0x8727('0x29')](_0x38a61f)[_0x8727('0x36')](_0x477ae2);};}exports['index']=function(_0x30212d,_0x3c1007){var _0x8e9de8={},_0x1b0e88={},_0x25a2f8={'count':0x0,'rows':[]};var _0x3b1022=db[_0x8727('0x37')][_0x8727('0x38')];_0x1b0e88[_0x8727('0x39')]=_[_0x8727('0x3a')](_0x3b1022);var _0x396f12={'dateStart':_0x30212d[_0x8727('0x3b')]['dateStart'],'dateEnd':_0x30212d[_0x8727('0x3b')][_0x8727('0x3c')]};delete _0x30212d[_0x8727('0x3b')][_0x8727('0x3d')];delete _0x30212d[_0x8727('0x3b')][_0x8727('0x3c')];_0x1b0e88[_0x8727('0x3b')]=_[_0x8727('0x3a')](_0x30212d[_0x8727('0x3b')]);_0x1b0e88[_0x8727('0x3e')]=_[_0x8727('0x3f')](_0x1b0e88[_0x8727('0x39')],_0x1b0e88[_0x8727('0x3b')]);_0x8e9de8[_0x8727('0x40')]=_['intersection'](_0x1b0e88[_0x8727('0x39')],qs[_0x8727('0x41')](_0x30212d[_0x8727('0x3b')]['fields']));_0x8e9de8[_0x8727('0x40')]=_0x8e9de8[_0x8727('0x40')][_0x8727('0x42')]?_0x8e9de8[_0x8727('0x40')]:_0x1b0e88['model'];if(!_0x30212d[_0x8727('0x3b')][_0x8727('0x43')](_0x8727('0x44'))){_0x8e9de8[_0x8727('0x45')]=qs[_0x8727('0x45')](_0x30212d[_0x8727('0x3b')][_0x8727('0x45')]);_0x8e9de8[_0x8727('0x2d')]=qs[_0x8727('0x2d')](_0x30212d[_0x8727('0x3b')]['offset']);}_0x8e9de8[_0x8727('0x46')]=qs[_0x8727('0x47')](_0x30212d[_0x8727('0x3b')][_0x8727('0x47')]);_0x8e9de8[_0x8727('0x48')]=qs['filters'](_[_0x8727('0x49')](_0x30212d[_0x8727('0x3b')],_0x1b0e88[_0x8727('0x3e')]));if(_0x396f12['dateStart']){if(_0x396f12[_0x8727('0x3c')]){_0x396f12[_0x8727('0x3c')]=moment(_0x396f12[_0x8727('0x3c')])[_0x8727('0x4a')](0x1,_0x8727('0x4b'));}else{_0x396f12[_0x8727('0x3c')]=moment(_0x396f12['dateStart'])[_0x8727('0x4a')](0x1,_0x8727('0x4b'));}_[_0x8727('0x4c')](_0x8e9de8['where'],{'createdAt':{'$gte':_0x396f12[_0x8727('0x3d')],'$lte':_0x396f12[_0x8727('0x3c')]}});}if(_0x30212d[_0x8727('0x3b')][_0x8727('0x4d')]){_0x8e9de8[_0x8727('0x48')]=_[_0x8727('0x4c')](_0x8e9de8[_0x8727('0x48')],{'$or':_['map'](_0x3b1022,function(_0x24196a){if(_0x24196a[_0x8727('0x4e')][_0x8727('0x4f')]!==_0x8727('0x50')){var _0x152de6={};_0x152de6[_0x24196a[_0x8727('0x51')]]={'$like':'%'+_0x30212d[_0x8727('0x3b')]['filter']+'%'};return _0x152de6;}})});}_0x8e9de8=_[_0x8727('0x4c')]({},_0x8e9de8,_0x30212d[_0x8727('0x52')]);var _0x3aa0fd={'where':_0x8e9de8['where']};return db[_0x8727('0x37')][_0x8727('0x2c')](_0x3aa0fd)[_0x8727('0x20')](function(_0x4367e8){_0x25a2f8[_0x8727('0x2c')]=_0x4367e8;if(_0x30212d[_0x8727('0x3b')][_0x8727('0x53')]){_0x8e9de8['include']=[{'all':!![]}];}return db[_0x8727('0x37')]['findAll'](_0x8e9de8);})[_0x8727('0x20')](function(_0x19a0ab){_0x25a2f8['rows']=_0x19a0ab;return _0x25a2f8;})[_0x8727('0x20')](respondWithFilteredResult(_0x3c1007,_0x8e9de8))[_0x8727('0x27')](handleError(_0x3c1007,null));};exports[_0x8727('0x54')]=function(_0x5436a3,_0x496966){var _0x13f70f={'raw':!![],'where':{'id':_0x5436a3[_0x8727('0x55')]['id']}},_0x1486ca={};_0x1486ca['model']=_[_0x8727('0x3a')](db[_0x8727('0x37')][_0x8727('0x38')]);_0x1486ca[_0x8727('0x3b')]=_[_0x8727('0x3a')](_0x5436a3[_0x8727('0x3b')]);_0x1486ca[_0x8727('0x3e')]=_[_0x8727('0x3f')](_0x1486ca['model'],_0x1486ca[_0x8727('0x3b')]);_0x13f70f[_0x8727('0x40')]=_[_0x8727('0x3f')](_0x1486ca[_0x8727('0x39')],qs['fields'](_0x5436a3[_0x8727('0x3b')][_0x8727('0x41')]));_0x13f70f[_0x8727('0x40')]=_0x13f70f[_0x8727('0x40')][_0x8727('0x42')]?_0x13f70f[_0x8727('0x40')]:_0x1486ca[_0x8727('0x39')];if(_0x5436a3[_0x8727('0x3b')]['includeAll']){_0x13f70f[_0x8727('0x56')]=[{'all':!![]}];}_0x13f70f=_[_0x8727('0x4c')]({},_0x13f70f,_0x5436a3[_0x8727('0x52')]);return db['ChatMessage'][_0x8727('0x57')](_0x13f70f)['then'](handleEntityNotFound(_0x496966,null))[_0x8727('0x20')](respondWithResult(_0x496966,null))['catch'](handleError(_0x496966,null));};exports[_0x8727('0x58')]=function(_0x273bd6,_0x5f4908){return db[_0x8727('0x37')][_0x8727('0x58')](_0x273bd6[_0x8727('0x59')],{})['then'](respondWithResult(_0x5f4908,0xc9))['catch'](handleError(_0x5f4908,null));};exports['update']=function(_0x5c4240,_0x3ac29a){if(_0x5c4240[_0x8727('0x59')]['id']){delete _0x5c4240[_0x8727('0x59')]['id'];}return db[_0x8727('0x37')][_0x8727('0x57')]({'where':{'id':_0x5c4240['params']['id']}})['then'](handleEntityNotFound(_0x3ac29a,null))[_0x8727('0x20')](saveUpdates(_0x5c4240[_0x8727('0x59')],null))[_0x8727('0x20')](respondWithResult(_0x3ac29a,null))[_0x8727('0x27')](handleError(_0x3ac29a,null));};exports[_0x8727('0x33')]=function(_0x11b2cf,_0x2a7586){return db[_0x8727('0x37')][_0x8727('0x57')]({'where':{'id':_0x11b2cf[_0x8727('0x55')]['id']}})[_0x8727('0x20')](handleEntityNotFound(_0x2a7586,null))[_0x8727('0x20')](removeEntity(_0x2a7586,null))['catch'](handleError(_0x2a7586,null));};exports[_0x8727('0x5a')]=function(_0x14fe27,_0x5af1b2){return db['ChatMessage']['describe']()['then'](respondWithResult(_0x5af1b2,null))[_0x8727('0x27')](handleError(_0x5af1b2,null));};var interaction_log=require(_0x8727('0x13'))('chat-interactions');exports[_0x8727('0x5b')]=function(_0x39d962,_0x104e96,_0x28d5fa){var _0x16a11b={'channel':'chat'};if(_0x39d962[_0x8727('0x59')]['id']){delete _0x39d962[_0x8727('0x59')]['id'];}_0x39d962[_0x8727('0x59')][_0x8727('0x5c')]=!![];_0x39d962[_0x8727('0x59')][_0x8727('0x5d')]=moment()[_0x8727('0x5e')](_0x8727('0x5f'));_0x39d962[_0x8727('0x59')]['UserId']=_0x39d962[_0x8727('0x59')][_0x8727('0x60')]||_0x39d962[_0x8727('0x61')]['id'];return db['ChatMessage'][_0x8727('0x57')]({'where':{'id':_0x39d962['params']['id'],'UserId':null},'include':[{'model':db[_0x8727('0x62')],'as':_0x8727('0x63')}]})[_0x8727('0x20')](handleEntityNotFound(_0x104e96,null))[_0x8727('0x20')](saveUpdates(_0x39d962[_0x8727('0x59')],null))['then'](function(_0x53dffb){if(_0x53dffb){_0x16a11b[_0x8727('0x26')]=_0x53dffb[_0x8727('0x64')]({'plain':!![]});return db[_0x8727('0x65')][_0x8727('0x57')]({'where':{'id':_0x53dffb[_0x8727('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x104e96,null))[_0x8727('0x20')](function(_0x56a275){if(_0x56a275){return _0x56a275[_0x8727('0x32')]({'UserId':_0x39d962['body']['UserId'],'read1stAt':_[_0x8727('0x67')](_0x56a275[_0x8727('0x68')])?moment()[_0x8727('0x5e')](_0x8727('0x5f')):undefined});}return null;})[_0x8727('0x20')](function(_0x5c0c1b){if(_0x5c0c1b){_0x16a11b['interaction']=_0x5c0c1b[_0x8727('0x64')]({'plain':!![]});interaction_log[_0x8727('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39d962[_0x8727('0x61')]['id'],_0x39d962[_0x8727('0x61')][_0x8727('0x35')],_0x39d962[_0x8727('0x61')]['role'],_0x16a11b[_0x8727('0x69')]['id'],_0x39d962[_0x8727('0x59')]?JSON[_0x8727('0x6a')](_0x39d962[_0x8727('0x59')]):_0x8727('0x6b'));return respondWithRpcPromise(_0x8727('0x6c'),_0x8727('0x6d'),_0x16a11b);}return null;})['then'](function(_0x52bf43){if(_0x52bf43){if(_0x39d962['body'][_0x8727('0x6e')]){_0x16a11b[_0x8727('0x26')][_0x8727('0x6f')]=util[_0x8727('0x5e')](_0x8727('0x70'),_0x39d962[_0x8727('0x61')][_0x8727('0x35')]);_0x16a11b[_0x8727('0x26')][_0x8727('0x71')]=_0x16a11b[_0x8727('0x71')];_0x16a11b[_0x8727('0x26')][_0x8727('0x72')]=_0x8727('0x5b');return respondWithRpcPromise(_0x8727('0x73'),_0x8727('0x73'),{'event':'acceptmessage','message':_['merge'](_0x16a11b['message'],JSON[_0x8727('0x74')](_0x16a11b[_0x8727('0x69')]['formData']))},client9002)[_0x8727('0x20')](function(){return _0x16a11b;});}return _0x16a11b;}return null;})[_0x8727('0x20')](respondWithResult(_0x104e96,null))[_0x8727('0x27')](handleError(_0x104e96,null));};var interaction_log=require('../../config/logger')(_0x8727('0x75'));exports['reject']=function(_0x14f46d,_0x1b9a1c,_0x223f88){var _0x4b1205={'agent':{},'channel':'chat'};if(_0x14f46d[_0x8727('0x59')]['id']){delete _0x14f46d[_0x8727('0x59')]['id'];}_0x14f46d[_0x8727('0x59')][_0x8727('0x60')]=_0x14f46d[_0x8727('0x59')][_0x8727('0x60')]||_0x14f46d[_0x8727('0x61')]['id'];_0x4b1205[_0x8727('0x76')]['id']=_0x14f46d['body']['UserId'];return db['ChatMessage'][_0x8727('0x57')]({'where':{'id':_0x14f46d[_0x8727('0x55')]['id'],'UserId':null}})[_0x8727('0x20')](handleEntityNotFound(_0x1b9a1c,null))['then'](function(_0x1da476){if(_0x1da476){_0x4b1205[_0x8727('0x26')]=_0x1da476['get']({'plain':!![]});return db[_0x8727('0x65')][_0x8727('0x57')]({'where':{'id':_0x1da476[_0x8727('0x66')]}});}return null;})[_0x8727('0x20')](handleEntityNotFound(_0x1b9a1c,null))[_0x8727('0x20')](function(_0x3ed2dc){if(_0x3ed2dc){_0x4b1205[_0x8727('0x69')]=_0x3ed2dc[_0x8727('0x64')]({'plain':!![]});interaction_log[_0x8727('0x21')](_0x8727('0x77'),_0x14f46d['user']['id'],_0x14f46d[_0x8727('0x61')][_0x8727('0x35')],_0x14f46d[_0x8727('0x61')][_0x8727('0x78')],_0x4b1205[_0x8727('0x69')]['id'],_0x14f46d[_0x8727('0x59')]?JSON[_0x8727('0x6a')](_0x14f46d[_0x8727('0x59')]):_0x8727('0x6b'));return respondWithRpcPromise(_0x8727('0x79'),_0x8727('0x7a'),_0x4b1205);}return null;})[_0x8727('0x20')](function(_0x53ff95){if(_0x53ff95){_0x53ff95[_0x8727('0x26')][_0x8727('0x6f')]=util['format']('SIP/%s',_0x14f46d[_0x8727('0x61')][_0x8727('0x35')]);_0x53ff95[_0x8727('0x26')][_0x8727('0x71')]=_0x4b1205[_0x8727('0x71')];_0x53ff95['message'][_0x8727('0x72')]=_0x8727('0x30');respondWithRpcPromise('EventManager',_0x8727('0x73'),{'event':'rejectmessage','message':_0x53ff95[_0x8727('0x26')]},client9002);return _0x4b1205;}return null;})[_0x8727('0x20')](respondWithResult(_0x1b9a1c,null))['catch'](handleError(_0x1b9a1c,null));};
\ No newline at end of file
+var _0x90b1=['end','json','count','offset','limit','set','reject','update','then','status','sendStatus','name','index','ChatMessage','rawAttributes','keys','query','dateEnd','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','dateStart','add','day','merge','filter','map','type','key','field','options','includeAll','findAll','rows','params','length','find','create','body','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteractionId','isNil','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat','agent','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x39872b,_0x343e6b){var _0x55fa18=function(_0x217c7f){while(--_0x217c7f){_0x39872b['push'](_0x39872b['shift']());}};_0x55fa18(++_0x343e6b);}(_0x90b1,0x1bb));var _0x190b=function(_0x317c38,_0x9d154d){_0x317c38=_0x317c38-0x0;var _0x304c05=_0x90b1[_0x317c38];return _0x304c05;};'use strict';var pdf=require(_0x190b('0x0'));var emlformat=require(_0x190b('0x1'));var rimraf=require(_0x190b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x190b('0x3'));var moment=require(_0x190b('0x4'));var BPromise=require(_0x190b('0x5'));var Mustache=require(_0x190b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x190b('0x7'));var fs=require('fs');var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var qs=require(_0x190b('0x10'));var logger=require(_0x190b('0x11'))(_0x190b('0x12'));var utils=require(_0x190b('0x13'));var config=require(_0x190b('0x14'));var db=require(_0x190b('0x15'))['db'];config['redis']=_[_0x190b('0x16')](config[_0x190b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x190b('0x18'))(new Redis(config[_0x190b('0x17')]));require(_0x190b('0x19'))[_0x190b('0x1a')](socket);var jayson=require(_0x190b('0x1b'));var client=jayson[_0x190b('0x1c')][_0x190b('0x1d')]({'port':0x232c});var client9002=jayson[_0x190b('0x1c')][_0x190b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x441e58,_0x186941,_0x1a046f,_0xab346){return new BPromise(function(_0x3e8781,_0x3fbfc3){var _0x121867=_0xab346||client;return _0x121867[_0x190b('0x1e')](_0x441e58,_0x1a046f)['then'](function(_0x428fec){logger['info'](_0x190b('0x1f'),_0x186941,_0x190b('0x20'));logger[_0x190b('0x21')](_0x190b('0x22'),_0x186941,'request\x20sent',JSON[_0x190b('0x23')](_0x428fec));if(_0x428fec[_0x190b('0x24')]){if(_0x428fec[_0x190b('0x24')][_0x190b('0x25')]===0x1f4){logger[_0x190b('0x24')](_0x190b('0x1f'),_0x186941,_0x428fec['error'][_0x190b('0x26')]);return _0x3fbfc3(_0x428fec[_0x190b('0x24')]['message']);}logger[_0x190b('0x24')]('ChatMessage,\x20%s,\x20%s',_0x186941,_0x428fec['error'][_0x190b('0x26')]);return _0x3e8781(_0x428fec[_0x190b('0x24')][_0x190b('0x26')]);}else{logger['info'](_0x190b('0x1f'),_0x186941,_0x190b('0x20'));_0x3e8781(_0x428fec[_0x190b('0x27')][_0x190b('0x26')]);}})[_0x190b('0x28')](function(_0x3ad3a5){logger[_0x190b('0x24')]('ChatMessage,\x20%s,\x20%s',_0x186941,_0x3ad3a5);_0x3fbfc3(_0x3ad3a5);});});}function respondWithStatusCode(_0x55b1f5,_0x262a63){_0x262a63=_0x262a63||0xcc;return function(_0x1a5f86){if(_0x1a5f86){return _0x55b1f5['sendStatus'](_0x262a63);}return _0x55b1f5['status'](_0x262a63)[_0x190b('0x29')]();};}function respondWithResult(_0x4e2a93,_0x328e5e){_0x328e5e=_0x328e5e||0xc8;return function(_0x3b6aaf){if(_0x3b6aaf){return _0x4e2a93['status'](_0x328e5e)[_0x190b('0x2a')](_0x3b6aaf);}};}function respondWithFilteredResult(_0x1deea6,_0x5c89ab){return function(_0xa9d6f7){if(_0xa9d6f7){var _0x2c47ae=_0xa9d6f7[_0x190b('0x2b')],_0x359b4a=_0x5c89ab['offset'],_0x494f3f=_0x5c89ab[_0x190b('0x2c')]+_0x5c89ab[_0x190b('0x2d')],_0x536d7b;if(_0x494f3f>=_0x2c47ae){_0x494f3f=_0x2c47ae;_0x536d7b=0xc8;}else{_0x536d7b=0xce;}_0x1deea6['status'](_0x536d7b);return _0x1deea6[_0x190b('0x2e')]('Content-Range',_0x359b4a+'-'+_0x494f3f+'/'+_0x2c47ae)[_0x190b('0x2a')](_0xa9d6f7);}return null;};}function patchUpdates(_0x4ff5a6){return function(_0x19600d){try{jsonpatch['apply'](_0x19600d,_0x4ff5a6,!![]);}catch(_0xc789e5){return BPromise[_0x190b('0x2f')](_0xc789e5);}return _0x19600d['save']();};}function saveUpdates(_0x1998a7,_0x15fed4){return function(_0x107b6f){if(_0x107b6f){return _0x107b6f[_0x190b('0x30')](_0x1998a7)[_0x190b('0x31')](function(_0x360d04){return _0x360d04;});}return null;};}function removeEntity(_0x309065,_0x248919){return function(_0x599da4){if(_0x599da4){return _0x599da4['destroy']()[_0x190b('0x31')](function(){_0x309065[_0x190b('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51dea7,_0x2dcd39){return function(_0x3e4dd8){if(!_0x3e4dd8){_0x51dea7[_0x190b('0x33')](0x194);}return _0x3e4dd8;};}function handleError(_0x3b6f3f,_0x228c73){_0x228c73=_0x228c73||0x1f4;return function(_0x5bda80){logger['error'](_0x5bda80['stack']);if(_0x5bda80[_0x190b('0x34')]){delete _0x5bda80[_0x190b('0x34')];}_0x3b6f3f[_0x190b('0x32')](_0x228c73)['send'](_0x5bda80);};}exports[_0x190b('0x35')]=function(_0x5e773c,_0x2e468b){var _0x5a9669={},_0x2a8260={},_0x540966={'count':0x0,'rows':[]};var _0x4f12db=db[_0x190b('0x36')][_0x190b('0x37')];_0x2a8260['model']=_[_0x190b('0x38')](_0x4f12db);var _0xfd0d62={'dateStart':_0x5e773c[_0x190b('0x39')]['dateStart'],'dateEnd':_0x5e773c[_0x190b('0x39')][_0x190b('0x3a')]};delete _0x5e773c['query']['dateStart'];delete _0x5e773c[_0x190b('0x39')]['dateEnd'];_0x2a8260[_0x190b('0x39')]=_[_0x190b('0x38')](_0x5e773c[_0x190b('0x39')]);_0x2a8260[_0x190b('0x3b')]=_['intersection'](_0x2a8260[_0x190b('0x3c')],_0x2a8260['query']);_0x5a9669[_0x190b('0x3d')]=_[_0x190b('0x3e')](_0x2a8260['model'],qs[_0x190b('0x3f')](_0x5e773c[_0x190b('0x39')][_0x190b('0x3f')]));_0x5a9669['attributes']=_0x5a9669[_0x190b('0x3d')]['length']?_0x5a9669['attributes']:_0x2a8260['model'];if(!_0x5e773c[_0x190b('0x39')][_0x190b('0x40')](_0x190b('0x41'))){_0x5a9669[_0x190b('0x2d')]=qs['limit'](_0x5e773c['query'][_0x190b('0x2d')]);_0x5a9669['offset']=qs[_0x190b('0x2c')](_0x5e773c[_0x190b('0x39')]['offset']);}_0x5a9669[_0x190b('0x42')]=qs[_0x190b('0x43')](_0x5e773c[_0x190b('0x39')]['sort']);_0x5a9669[_0x190b('0x44')]=qs[_0x190b('0x3b')](_['pick'](_0x5e773c[_0x190b('0x39')],_0x2a8260['filters']));if(_0xfd0d62[_0x190b('0x45')]){if(_0xfd0d62[_0x190b('0x3a')]){_0xfd0d62[_0x190b('0x3a')]=moment(_0xfd0d62['dateEnd'])[_0x190b('0x46')](0x1,'day');}else{_0xfd0d62[_0x190b('0x3a')]=moment(_0xfd0d62[_0x190b('0x45')])[_0x190b('0x46')](0x1,_0x190b('0x47'));}_[_0x190b('0x48')](_0x5a9669[_0x190b('0x44')],{'createdAt':{'$gte':_0xfd0d62[_0x190b('0x45')],'$lte':_0xfd0d62['dateEnd']}});}if(_0x5e773c[_0x190b('0x39')][_0x190b('0x49')]){_0x5a9669[_0x190b('0x44')]=_['merge'](_0x5a9669[_0x190b('0x44')],{'$or':_[_0x190b('0x4a')](_0x4f12db,function(_0x51af04){if(_0x51af04[_0x190b('0x4b')][_0x190b('0x4c')]!=='VIRTUAL'){var _0x1f2262={};_0x1f2262[_0x51af04[_0x190b('0x4d')]]={'$like':'%'+_0x5e773c[_0x190b('0x39')]['filter']+'%'};return _0x1f2262;}})});}_0x5a9669=_[_0x190b('0x48')]({},_0x5a9669,_0x5e773c[_0x190b('0x4e')]);var _0x2b0a3a={'where':_0x5a9669['where']};return db['ChatMessage'][_0x190b('0x2b')](_0x2b0a3a)[_0x190b('0x31')](function(_0x2826c4){_0x540966[_0x190b('0x2b')]=_0x2826c4;if(_0x5e773c[_0x190b('0x39')][_0x190b('0x4f')]){_0x5a9669['include']=[{'all':!![]}];}return db[_0x190b('0x36')][_0x190b('0x50')](_0x5a9669);})[_0x190b('0x31')](function(_0x5bb07a){_0x540966[_0x190b('0x51')]=_0x5bb07a;return _0x540966;})[_0x190b('0x31')](respondWithFilteredResult(_0x2e468b,_0x5a9669))[_0x190b('0x28')](handleError(_0x2e468b,null));};exports['show']=function(_0xbc6757,_0x13781a){var _0x181c53={'raw':!![],'where':{'id':_0xbc6757[_0x190b('0x52')]['id']}},_0x3256c0={};_0x3256c0[_0x190b('0x3c')]=_[_0x190b('0x38')](db[_0x190b('0x36')][_0x190b('0x37')]);_0x3256c0[_0x190b('0x39')]=_[_0x190b('0x38')](_0xbc6757['query']);_0x3256c0[_0x190b('0x3b')]=_['intersection'](_0x3256c0[_0x190b('0x3c')],_0x3256c0[_0x190b('0x39')]);_0x181c53['attributes']=_[_0x190b('0x3e')](_0x3256c0[_0x190b('0x3c')],qs[_0x190b('0x3f')](_0xbc6757[_0x190b('0x39')][_0x190b('0x3f')]));_0x181c53[_0x190b('0x3d')]=_0x181c53[_0x190b('0x3d')][_0x190b('0x53')]?_0x181c53['attributes']:_0x3256c0[_0x190b('0x3c')];if(_0xbc6757[_0x190b('0x39')][_0x190b('0x4f')]){_0x181c53['include']=[{'all':!![]}];}_0x181c53=_[_0x190b('0x48')]({},_0x181c53,_0xbc6757['options']);return db['ChatMessage'][_0x190b('0x54')](_0x181c53)[_0x190b('0x31')](handleEntityNotFound(_0x13781a,null))[_0x190b('0x31')](respondWithResult(_0x13781a,null))[_0x190b('0x28')](handleError(_0x13781a,null));};exports[_0x190b('0x55')]=function(_0x20314b,_0x1383e5){return db[_0x190b('0x36')][_0x190b('0x55')](_0x20314b[_0x190b('0x56')],{})[_0x190b('0x31')](respondWithResult(_0x1383e5,0xc9))[_0x190b('0x28')](handleError(_0x1383e5,null));};exports[_0x190b('0x30')]=function(_0x142f7f,_0x5a42b1){if(_0x142f7f[_0x190b('0x56')]['id']){delete _0x142f7f[_0x190b('0x56')]['id'];}return db[_0x190b('0x36')][_0x190b('0x54')]({'where':{'id':_0x142f7f['params']['id']}})['then'](handleEntityNotFound(_0x5a42b1,null))[_0x190b('0x31')](saveUpdates(_0x142f7f[_0x190b('0x56')],null))['then'](respondWithResult(_0x5a42b1,null))[_0x190b('0x28')](handleError(_0x5a42b1,null));};exports['destroy']=function(_0x313f29,_0x1aae8e){return db[_0x190b('0x36')]['find']({'where':{'id':_0x313f29[_0x190b('0x52')]['id']}})[_0x190b('0x31')](handleEntityNotFound(_0x1aae8e,null))[_0x190b('0x31')](removeEntity(_0x1aae8e,null))[_0x190b('0x28')](handleError(_0x1aae8e,null));};exports[_0x190b('0x57')]=function(_0x12724e,_0x557f1b){return db[_0x190b('0x36')][_0x190b('0x57')]()['then'](respondWithResult(_0x557f1b,null))['catch'](handleError(_0x557f1b,null));};var interaction_log=require(_0x190b('0x11'))(_0x190b('0x58'));exports[_0x190b('0x59')]=function(_0x2a4db8,_0x4af037,_0x404574){var _0x43003f={'channel':'chat'};if(_0x2a4db8[_0x190b('0x56')]['id']){delete _0x2a4db8[_0x190b('0x56')]['id'];}_0x2a4db8[_0x190b('0x56')][_0x190b('0x5a')]=!![];_0x2a4db8[_0x190b('0x56')][_0x190b('0x5b')]=moment()[_0x190b('0x5c')](_0x190b('0x5d'));_0x2a4db8['body'][_0x190b('0x5e')]=_0x2a4db8['body']['UserId']||_0x2a4db8[_0x190b('0x5f')]['id'];return db[_0x190b('0x36')][_0x190b('0x54')]({'where':{'id':_0x2a4db8['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x190b('0x60')}]})[_0x190b('0x31')](handleEntityNotFound(_0x4af037,null))[_0x190b('0x31')](saveUpdates(_0x2a4db8[_0x190b('0x56')],null))[_0x190b('0x31')](function(_0x1b8cdf){if(_0x1b8cdf){_0x43003f[_0x190b('0x26')]=_0x1b8cdf[_0x190b('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x190b('0x54')]({'where':{'id':_0x1b8cdf[_0x190b('0x62')]}});}return null;})[_0x190b('0x31')](handleEntityNotFound(_0x4af037,null))[_0x190b('0x31')](function(_0x172f19){if(_0x172f19){return _0x172f19['update']({'UserId':_0x2a4db8[_0x190b('0x56')][_0x190b('0x5e')],'read1stAt':_[_0x190b('0x63')](_0x172f19['read1stAt'])?moment()[_0x190b('0x5c')](_0x190b('0x5d')):undefined});}return null;})[_0x190b('0x31')](function(_0x2b0362){if(_0x2b0362){_0x43003f['interaction']=_0x2b0362[_0x190b('0x61')]({'plain':!![]});interaction_log[_0x190b('0x64')](_0x190b('0x65'),_0x2a4db8[_0x190b('0x5f')]['id'],_0x2a4db8['user'][_0x190b('0x34')],_0x2a4db8['user'][_0x190b('0x66')],_0x43003f[_0x190b('0x67')]['id'],_0x2a4db8[_0x190b('0x56')]?JSON[_0x190b('0x23')](_0x2a4db8['body']):_0x190b('0x68'));return respondWithRpcPromise('AcceptMessage',_0x190b('0x69'),_0x43003f);}return null;})['then'](function(_0x49b60c){if(_0x49b60c){if(_0x2a4db8[_0x190b('0x56')]['manual']){_0x43003f[_0x190b('0x26')][_0x190b('0x6a')]=util[_0x190b('0x5c')](_0x190b('0x6b'),_0x2a4db8[_0x190b('0x5f')]['name']);_0x43003f[_0x190b('0x26')][_0x190b('0x6c')]=_0x43003f[_0x190b('0x6c')];_0x43003f['message'][_0x190b('0x6d')]=_0x190b('0x59');return respondWithRpcPromise('EventManager',_0x190b('0x6e'),{'event':_0x190b('0x6f'),'message':_[_0x190b('0x48')](_0x43003f['message'],JSON[_0x190b('0x70')](_0x43003f[_0x190b('0x67')][_0x190b('0x71')]))},client9002)[_0x190b('0x31')](function(){return _0x43003f;});}return _0x43003f;}return null;})['then'](respondWithResult(_0x4af037,null))[_0x190b('0x28')](handleError(_0x4af037,null));};var interaction_log=require(_0x190b('0x11'))(_0x190b('0x58'));exports['reject']=function(_0x1bc4f0,_0x31c72c,_0x2d969f){var _0x49bd3b={'agent':{},'channel':_0x190b('0x72')};if(_0x1bc4f0[_0x190b('0x56')]['id']){delete _0x1bc4f0[_0x190b('0x56')]['id'];}_0x1bc4f0[_0x190b('0x56')][_0x190b('0x5e')]=_0x1bc4f0['body']['UserId']||_0x1bc4f0[_0x190b('0x5f')]['id'];_0x49bd3b[_0x190b('0x73')]['id']=_0x1bc4f0['body'][_0x190b('0x5e')];return db[_0x190b('0x36')]['find']({'where':{'id':_0x1bc4f0['params']['id'],'UserId':null}})[_0x190b('0x31')](handleEntityNotFound(_0x31c72c,null))[_0x190b('0x31')](function(_0x4f1935){if(_0x4f1935){_0x49bd3b['message']=_0x4f1935[_0x190b('0x61')]({'plain':!![]});return db[_0x190b('0x74')][_0x190b('0x54')]({'where':{'id':_0x4f1935[_0x190b('0x62')]}});}return null;})[_0x190b('0x31')](handleEntityNotFound(_0x31c72c,null))['then'](function(_0x5c9258){if(_0x5c9258){_0x49bd3b[_0x190b('0x67')]=_0x5c9258['get']({'plain':!![]});interaction_log[_0x190b('0x64')](_0x190b('0x75'),_0x1bc4f0[_0x190b('0x5f')]['id'],_0x1bc4f0[_0x190b('0x5f')][_0x190b('0x34')],_0x1bc4f0[_0x190b('0x5f')][_0x190b('0x66')],_0x49bd3b[_0x190b('0x67')]['id'],_0x1bc4f0[_0x190b('0x56')]?JSON[_0x190b('0x23')](_0x1bc4f0[_0x190b('0x56')]):'null');return respondWithRpcPromise(_0x190b('0x76'),_0x190b('0x77'),_0x49bd3b);}return null;})[_0x190b('0x31')](function(_0x517e9c){if(_0x517e9c){_0x517e9c['message'][_0x190b('0x6a')]=util[_0x190b('0x5c')]('SIP/%s',_0x1bc4f0[_0x190b('0x5f')][_0x190b('0x34')]);_0x517e9c[_0x190b('0x26')]['channel']=_0x49bd3b[_0x190b('0x6c')];_0x517e9c[_0x190b('0x26')]['event']=_0x190b('0x2f');respondWithRpcPromise(_0x190b('0x6e'),'EventManager',{'event':_0x190b('0x78'),'message':_0x517e9c['message']},client9002);return _0x49bd3b;}return null;})['then'](respondWithResult(_0x31c72c,null))['catch'](handleError(_0x31c72c,null));};
\ No newline at end of file
index 26c78b7..701c3d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a39=['exports','events','ChatMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x44ea05,_0x360d3f){var _0x25856b=function(_0x5602b8){while(--_0x5602b8){_0x44ea05['push'](_0x44ea05['shift']());}};_0x25856b(++_0x360d3f);}(_0x4a39,0x9b));var _0x94a3=function(_0x3a2b1d,_0x190499){_0x3a2b1d=_0x3a2b1d-0x0;var _0xebbef2=_0x4a39[_0x3a2b1d];return _0xebbef2;};'use strict';var EventEmitter=require(_0x94a3('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x94a3('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x94a3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x94a3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1f10f6){return function(_0x2c874b,_0x28b718,_0x1f8a5f){ChatMessageEvents['emit'](_0x1f10f6+':'+_0x2c874b['id'],_0x2c874b);ChatMessageEvents[_0x94a3('0x4')](_0x1f10f6,_0x2c874b);_0x1f8a5f(null);};}for(var e in events){if(events[_0x94a3('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x94a3('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x87a4=['exports','events','../../mysqldb','save','update','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87a4,0x12e));var _0x487a=function(_0x220b0c,_0x182b86){_0x220b0c=_0x220b0c-0x0;var _0x2f9d9f=_0x87a4[_0x220b0c];return _0x2f9d9f;};'use strict';var EventEmitter=require(_0x487a('0x0'));var ChatMessage=require(_0x487a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x487a('0x2'),'afterUpdate':_0x487a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x57095a){return function(_0x4d93b9,_0x1c87b9,_0x342d47){ChatMessageEvents[_0x487a('0x4')](_0x57095a+':'+_0x4d93b9['id'],_0x4d93b9);ChatMessageEvents[_0x487a('0x4')](_0x57095a,_0x4d93b9);_0x342d47(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x487a('0x5')](e,emitEvent(event));}}module[_0x487a('0x6')]=ChatMessageEvents;
\ No newline at end of file
index 76470ed..eb6d965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ef2=['chat_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteractionId','then','update','createdAt','body','catch','error','utf8mb4','lodash','bluebird','./chatMessage.attributes','define','ChatMessage'];(function(_0xbeb8d4,_0x12ce7b){var _0x502886=function(_0x5b507c){while(--_0x5b507c){_0xbeb8d4['push'](_0xbeb8d4['shift']());}};_0x502886(++_0x12ce7b);}(_0x1ef2,0xed));var _0x21ef=function(_0x349e64,_0x5b208f){_0x349e64=_0x349e64-0x0;var _0x196dea=_0x1ef2[_0x349e64];return _0x196dea;};'use strict';var _=require(_0x21ef('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x21ef('0x1'));var rp=require('request-promise');var attributes=require(_0x21ef('0x2'));module['exports']=function(_0x33f216,_0x2e84b2){return _0x33f216[_0x21ef('0x3')](_0x21ef('0x4'),attributes,{'tableName':_0x21ef('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5555bc,_0x995aa0,_0x6f1a2b){var _0x30c23a=_0x33f216[_0x21ef('0x6')];var _0x3b7344=_0x5555bc[_0x21ef('0x7')]({'plain':!![]});if(_0x3b7344[_0x21ef('0x8')][_0x21ef('0x9')]()==='in'||_0x3b7344[_0x21ef('0x8')][_0x21ef('0x9')]()===_0x21ef('0xa')&&!_0x3b7344[_0x21ef('0xb')]&&!_[_0x21ef('0xc')](_0x3b7344[_0x21ef('0xd')])){_0x30c23a['ChatInteraction']['findOne']({'where':{'id':_0x3b7344[_0x21ef('0xe')]}})[_0x21ef('0xf')](function(_0x5c68ca){if(_0x5c68ca){_0x5c68ca[_0x21ef('0x10')]({'lastMsgAt':_0x3b7344[_0x21ef('0x11')],'lastMsgDirection':_0x3b7344[_0x21ef('0x8')][_0x21ef('0x9')](),'lastMsgBody':_0x3b7344[_0x21ef('0x12')]});}})[_0x21ef('0x13')](function(_0x4ee185){console[_0x21ef('0x14')](_0x4ee185);});}_0x6f1a2b();}},'charset':_0x21ef('0x15'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5746=['then','update','body','catch','error','utf8mb4','lodash','util','api','bluebird','exports','define','ChatMessage','chat_messages','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','ChatInteractionId'];(function(_0x4b7420,_0x3001d5){var _0x243c21=function(_0x4800a0){while(--_0x4800a0){_0x4b7420['push'](_0x4b7420['shift']());}};_0x243c21(++_0x3001d5);}(_0x5746,0x176));var _0x6574=function(_0x4d49ee,_0x40843a){_0x4d49ee=_0x4d49ee-0x0;var _0xce9e7d=_0x5746[_0x4d49ee];return _0xce9e7d;};'use strict';var _=require(_0x6574('0x0'));var util=require(_0x6574('0x1'));var logger=require('../../config/logger')(_0x6574('0x2'));var moment=require('moment');var BPromise=require(_0x6574('0x3'));var rp=require('request-promise');var attributes=require('./chatMessage.attributes');module[_0x6574('0x4')]=function(_0x5adeda,_0x43f18b){return _0x5adeda[_0x6574('0x5')](_0x6574('0x6'),attributes,{'tableName':_0x6574('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x407b74,_0x177860,_0x12a18a){var _0x12b197=_0x5adeda[_0x6574('0x8')];var _0x461028=_0x407b74[_0x6574('0x9')]({'plain':!![]});if(_0x461028[_0x6574('0xa')][_0x6574('0xb')]()==='in'||_0x461028[_0x6574('0xa')][_0x6574('0xb')]()===_0x6574('0xc')&&!_0x461028['secret']&&!_[_0x6574('0xd')](_0x461028[_0x6574('0xe')])){_0x12b197[_0x6574('0xf')]['findOne']({'where':{'id':_0x461028[_0x6574('0x10')]}})[_0x6574('0x11')](function(_0x4279f6){if(_0x4279f6){_0x4279f6[_0x6574('0x12')]({'lastMsgAt':_0x461028['createdAt'],'lastMsgDirection':_0x461028[_0x6574('0xa')][_0x6574('0xb')](),'lastMsgBody':_0x461028[_0x6574('0x13')]});}})[_0x6574('0x14')](function(_0x471067){console[_0x6574('0x15')](_0x471067);});}_0x12a18a();}},'charset':_0x6574('0x16'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 49925e3..c992e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde63=['code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x14d3cb,_0x3c5f7c){var _0x204ed1=function(_0x31cbf8){while(--_0x31cbf8){_0x14d3cb['push'](_0x14d3cb['shift']());}};_0x204ed1(++_0x3c5f7c);}(_0xde63,0x155));var _0x3de6=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0xde63[_0x26efac];return _0x8482e4;};'use strict';var _=require(_0x3de6('0x0'));var util=require('util');var moment=require(_0x3de6('0x1'));var BPromise=require(_0x3de6('0x2'));var rs=require(_0x3de6('0x3'));var fs=require('fs');var Redis=require(_0x3de6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3de6('0x5'))(_0x3de6('0x6'));var config=require(_0x3de6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3de6('0x8')][_0x3de6('0x9')]({'port':0x232a});config[_0x3de6('0xa')]=_['defaults'](config[_0x3de6('0xa')],{'host':_0x3de6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3de6('0xa')]));require(_0x3de6('0xc'))[_0x3de6('0xd')](socket);function respondWithRpcPromise(_0x38de91,_0x116684,_0x124a93){return new BPromise(function(_0x195d58,_0x3a7ab){return client[_0x3de6('0xe')](_0x38de91,_0x124a93)[_0x3de6('0xf')](function(_0x3b378a){logger['info'](_0x3de6('0x10'),_0x116684,'request\x20sent');logger[_0x3de6('0x11')](_0x3de6('0x12'),_0x116684,_0x3de6('0x13'),JSON[_0x3de6('0x14')](_0x3b378a));if(_0x3b378a[_0x3de6('0x15')]){if(_0x3b378a[_0x3de6('0x15')][_0x3de6('0x16')]===0x1f4){logger[_0x3de6('0x15')](_0x3de6('0x10'),_0x116684,_0x3b378a[_0x3de6('0x15')][_0x3de6('0x17')]);return _0x3a7ab(_0x3b378a[_0x3de6('0x15')][_0x3de6('0x17')]);}logger[_0x3de6('0x15')](_0x3de6('0x10'),_0x116684,_0x3b378a[_0x3de6('0x15')][_0x3de6('0x17')]);return _0x195d58(_0x3b378a['error'][_0x3de6('0x17')]);}else{logger['info'](_0x3de6('0x10'),_0x116684,'request\x20sent');_0x195d58(_0x3b378a[_0x3de6('0x18')][_0x3de6('0x17')]);}})['catch'](function(_0x1e8de0){logger[_0x3de6('0x15')]('ChatMessage,\x20%s,\x20%s',_0x116684,_0x1e8de0);_0x3a7ab(_0x1e8de0);});});}exports[_0x3de6('0x19')]=function(_0x4f447f){var _0x4a26ae=this;return new Promise(function(_0x444792,_0x5fcb80){return db[_0x3de6('0x1a')][_0x3de6('0x1b')](_0x4f447f[_0x3de6('0x1c')],{'raw':_0x4f447f[_0x3de6('0x1d')]?_0x4f447f[_0x3de6('0x1d')][_0x3de6('0x1e')]===undefined?!![]:![]:!![]})[_0x3de6('0xf')](function(_0x222b32){logger[_0x3de6('0x1f')]('CreateChatMessage',_0x4f447f);logger['debug'](_0x3de6('0x19'),_0x4f447f,JSON[_0x3de6('0x14')](_0x222b32));_0x444792(_0x222b32);})[_0x3de6('0x20')](function(_0x174ce0){logger[_0x3de6('0x15')]('CreateChatMessage',_0x174ce0[_0x3de6('0x17')],_0x4f447f);_0x5fcb80(_0x4a26ae[_0x3de6('0x15')](0x1f4,_0x174ce0[_0x3de6('0x17')]));});});};
\ No newline at end of file
+var _0xa927=['then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw'];(function(_0x3acd55,_0x3364e2){var _0x56ab7a=function(_0x4d8dea){while(--_0x4d8dea){_0x3acd55['push'](_0x3acd55['shift']());}};_0x56ab7a(++_0x3364e2);}(_0xa927,0x1ec));var _0x7a92=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa927[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x7a92('0x0'));var util=require(_0x7a92('0x1'));var moment=require(_0x7a92('0x2'));var BPromise=require(_0x7a92('0x3'));var rs=require(_0x7a92('0x4'));var fs=require('fs');var Redis=require(_0x7a92('0x5'));var db=require(_0x7a92('0x6'))['db'];var utils=require(_0x7a92('0x7'));var logger=require('../../config/logger')(_0x7a92('0x8'));var config=require(_0x7a92('0x9'));var jayson=require(_0x7a92('0xa'));var client=jayson[_0x7a92('0xb')][_0x7a92('0xc')]({'port':0x232a});config[_0x7a92('0xd')]=_[_0x7a92('0xe')](config[_0x7a92('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a92('0xd')]));require(_0x7a92('0xf'))[_0x7a92('0x10')](socket);function respondWithRpcPromise(_0x172448,_0x220585,_0x20e933){return new BPromise(function(_0x316730,_0x515dde){return client[_0x7a92('0x11')](_0x172448,_0x20e933)['then'](function(_0x41eb36){logger[_0x7a92('0x12')](_0x7a92('0x13'),_0x220585,'request\x20sent');logger['debug'](_0x7a92('0x14'),_0x220585,_0x7a92('0x15'),JSON[_0x7a92('0x16')](_0x41eb36));if(_0x41eb36[_0x7a92('0x17')]){if(_0x41eb36[_0x7a92('0x17')][_0x7a92('0x18')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x220585,_0x41eb36['error'][_0x7a92('0x19')]);return _0x515dde(_0x41eb36[_0x7a92('0x17')][_0x7a92('0x19')]);}logger[_0x7a92('0x17')](_0x7a92('0x13'),_0x220585,_0x41eb36[_0x7a92('0x17')]['message']);return _0x316730(_0x41eb36[_0x7a92('0x17')][_0x7a92('0x19')]);}else{logger[_0x7a92('0x12')](_0x7a92('0x13'),_0x220585,'request\x20sent');_0x316730(_0x41eb36['result'][_0x7a92('0x19')]);}})[_0x7a92('0x1a')](function(_0x40594a){logger[_0x7a92('0x17')](_0x7a92('0x13'),_0x220585,_0x40594a);_0x515dde(_0x40594a);});});}exports[_0x7a92('0x1b')]=function(_0x108959){var _0x348ce8=this;return new Promise(function(_0x3f4017,_0x131d1a){return db[_0x7a92('0x1c')][_0x7a92('0x1d')](_0x108959[_0x7a92('0x1e')],{'raw':_0x108959[_0x7a92('0x1f')]?_0x108959[_0x7a92('0x1f')][_0x7a92('0x20')]===undefined?!![]:![]:!![]})[_0x7a92('0x21')](function(_0x59e4ec){logger['info'](_0x7a92('0x1b'),_0x108959);logger[_0x7a92('0x22')](_0x7a92('0x1b'),_0x108959,JSON['stringify'](_0x59e4ec));_0x3f4017(_0x59e4ec);})['catch'](function(_0x13334b){logger[_0x7a92('0x17')](_0x7a92('0x1b'),_0x13334b[_0x7a92('0x19')],_0x108959);_0x131d1a(_0x348ce8[_0x7a92('0x17')](0x1f4,_0x13334b[_0x7a92('0x19')]));});});};
\ No newline at end of file
index b5c404d..3d87c5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['removeListener','register','./chatMessage.events','save'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x55ca,0x126));var _0xa55c=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0x55ca[_0x3c3e72];return _0x48a7e5;};'use strict';var ChatMessageEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){ChatMessageEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('chatMessage:'+_0x2121fd,_0x3c97c8);ChatMessageEvents['on'](_0x2121fd,_0x2537f0);}};
\ No newline at end of file
+var _0x34e8=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0x34e8,0x12c));var _0x834e=function(_0xe3da05,_0x206596){_0xe3da05=_0xe3da05-0x0;var _0x6970dd=_0x34e8[_0xe3da05];return _0x6970dd;};'use strict';var ChatMessageEvents=require(_0x834e('0x0'));var events=[_0x834e('0x1'),_0x834e('0x2'),_0x834e('0x3')];function createListener(_0x530939,_0x832422){return function(_0x21e2e0){_0x832422[_0x834e('0x4')](_0x530939,_0x21e2e0);};}function removeListener(_0x31bf20,_0x289ef2){return function(){ChatMessageEvents[_0x834e('0x5')](_0x31bf20,_0x289ef2);};}exports[_0x834e('0x6')]=function(_0x4a2018){for(var _0x858aa1=0x0,_0x52056d=events[_0x834e('0x7')];_0x858aa1<_0x52056d;_0x858aa1++){var _0x3cc2e3=events[_0x858aa1];var _0x3a3ef6=createListener(_0x834e('0x8')+_0x3cc2e3,_0x4a2018);ChatMessageEvents['on'](_0x3cc2e3,_0x3a3ef6);}};
\ No newline at end of file
index 0490720..b8dd100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4050=['../../components/interaction/service','../../config/environment','./chatMessage.controller','index','/describe','isAuthenticated','get','/:id','show','post','tracked','chatmessage:create','create','put','update','accept','reject','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4050,0x1dc));var _0x0405=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x4050[_0x24237f];return _0x48298e;};'use strict';var multer=require('multer');var util=require(_0x0405('0x0'));var path=require(_0x0405('0x1'));var timeout=require(_0x0405('0x2'));var express=require('express');var router=express[_0x0405('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0405('0x4'));var config=require(_0x0405('0x5'));var controller=require(_0x0405('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0405('0x7')]);router['get'](_0x0405('0x8'),auth[_0x0405('0x9')](),controller['describe']);router[_0x0405('0xa')](_0x0405('0xb'),auth[_0x0405('0x9')](),controller[_0x0405('0xc')]);router[_0x0405('0xd')]('/',auth['isAuthenticated'](),interaction[_0x0405('0xe')]('chat',_0x0405('0xf')),controller[_0x0405('0x10')]);router[_0x0405('0x11')](_0x0405('0xb'),controller[_0x0405('0x12')]);router[_0x0405('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x0405('0x13')]);router[_0x0405('0x11')]('/:id/reject',auth[_0x0405('0x9')](),controller[_0x0405('0x14')]);router[_0x0405('0x15')](_0x0405('0xb'),auth[_0x0405('0x9')](),controller[_0x0405('0x16')]);module[_0x0405('0x17')]=router;
\ No newline at end of file
+var _0x667b=['/describe','isAuthenticated','describe','show','post','tracked','chat','create','/:id','put','/:id/accept','/:id/reject','reject','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','index','get'];(function(_0xa0039,_0x3d17bb){var _0xd850b9=function(_0x3fd002){while(--_0x3fd002){_0xa0039['push'](_0xa0039['shift']());}};_0xd850b9(++_0x3d17bb);}(_0x667b,0xde));var _0xb667=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0x667b[_0x705b98];return _0x47b72f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb667('0x0'));var timeout=require(_0xb667('0x1'));var express=require('express');var router=express[_0xb667('0x2')]();var auth=require(_0xb667('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb667('0x4'));var controller=require(_0xb667('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xb667('0x6')]);router[_0xb667('0x7')](_0xb667('0x8'),auth[_0xb667('0x9')](),controller[_0xb667('0xa')]);router['get']('/:id',auth[_0xb667('0x9')](),controller[_0xb667('0xb')]);router[_0xb667('0xc')]('/',auth[_0xb667('0x9')](),interaction[_0xb667('0xd')](_0xb667('0xe'),'chatmessage:create'),controller[_0xb667('0xf')]);router['put'](_0xb667('0x10'),controller['update']);router[_0xb667('0x11')](_0xb667('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0xb667('0x13'),auth['isAuthenticated'](),controller[_0xb667('0x14')]);router[_0xb667('0x15')](_0xb667('0x10'),auth[_0xb667('0x9')](),controller['destroy']);module[_0xb667('0x16')]=router;
\ No newline at end of file
index 8cf2823..89f525b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e75=['medium','sequelize','exports'];(function(_0x49dd60,_0x146186){var _0xe61ed1=function(_0x18832){while(--_0x18832){_0x49dd60['push'](_0x49dd60['shift']());}};_0xe61ed1(++_0x146186);}(_0x9e75,0xb5));var _0x59e7=function(_0x1c367c,_0x5b5abd){_0x1c367c=_0x1c367c-0x0;var _0x314da0=_0x9e75[_0x1c367c];return _0x314da0;};'use strict';var Sequelize=require(_0x59e7('0x0'));module[_0x59e7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x59e7('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xaf85=['medium','exports'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xaf85,0x1e3));var _0x5af8=function(_0x216c2f,_0xaf2d0e){_0x216c2f=_0x216c2f-0x0;var _0x1b6b9a=_0xaf85[_0x216c2f];return _0x1b6b9a;};'use strict';var Sequelize=require('sequelize');module[_0x5af8('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5af8('0x1')),'allowNull':![]}};
\ No newline at end of file
index c0fc36b..72ad848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x522e=['options','count','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','ChatOfflineMessage','rawAttributes','dateStart','query','dateEnd','keys','intersection','attributes','model','fields','nolimit','limit','order','sort','where','pick','filters','add','day','merge','filter','key','VIRTUAL','field'];(function(_0x4e68aa,_0x77632d){var _0xfe0a56=function(_0xd7b460){while(--_0xd7b460){_0x4e68aa['push'](_0x4e68aa['shift']());}};_0xfe0a56(++_0x77632d);}(_0x522e,0x9c));var _0xe522=function(_0x9c3f86,_0x72819e){_0x9c3f86=_0x9c3f86-0x0;var _0x4cac3c=_0x522e[_0x9c3f86];return _0x4cac3c;};'use strict';var pdf=require(_0xe522('0x0'));var emlformat=require(_0xe522('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe522('0x2'));var jsonpatch=require(_0xe522('0x3'));var rp=require(_0xe522('0x4'));var moment=require('moment');var BPromise=require(_0xe522('0x5'));var Mustache=require(_0xe522('0x6'));var util=require(_0xe522('0x7'));var path=require(_0xe522('0x8'));var sox=require('sox');var csv=require(_0xe522('0x9'));var ejs=require(_0xe522('0xa'));var fs=require('fs');var _=require(_0xe522('0xb'));var squel=require('squel');var crypto=require(_0xe522('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe522('0xd'));var Papa=require('papaparse');var Redis=require(_0xe522('0xe'));var qs=require(_0xe522('0xf'));var logger=require('../../config/logger')(_0xe522('0x10'));var utils=require(_0xe522('0x11'));var config=require(_0xe522('0x12'));var db=require(_0xe522('0x13'))['db'];function respondWithStatusCode(_0x579e97,_0x4e0bc7){_0x4e0bc7=_0x4e0bc7||0xcc;return function(_0x4abf1a){if(_0x4abf1a){return _0x579e97['sendStatus'](_0x4e0bc7);}return _0x579e97[_0xe522('0x14')](_0x4e0bc7)[_0xe522('0x15')]();};}function respondWithResult(_0x145ae2,_0x54278e){_0x54278e=_0x54278e||0xc8;return function(_0x5494db){if(_0x5494db){return _0x145ae2['status'](_0x54278e)[_0xe522('0x16')](_0x5494db);}};}function respondWithFilteredResult(_0x6086b5,_0x19705e){return function(_0x2686bd){if(_0x2686bd){var _0x6c170d=_0x2686bd['count'],_0x180dfd=_0x19705e[_0xe522('0x17')],_0x27935e=_0x19705e[_0xe522('0x17')]+_0x19705e['limit'],_0x1c64cf;if(_0x27935e>=_0x6c170d){_0x27935e=_0x6c170d;_0x1c64cf=0xc8;}else{_0x1c64cf=0xce;}_0x6086b5['status'](_0x1c64cf);return _0x6086b5['set'](_0xe522('0x18'),_0x180dfd+'-'+_0x27935e+'/'+_0x6c170d)[_0xe522('0x16')](_0x2686bd);}return null;};}function patchUpdates(_0x381fa3){return function(_0xa4e16e){try{jsonpatch[_0xe522('0x19')](_0xa4e16e,_0x381fa3,!![]);}catch(_0x308605){return BPromise[_0xe522('0x1a')](_0x308605);}return _0xa4e16e[_0xe522('0x1b')]();};}function saveUpdates(_0x1d091a,_0x5708cc){return function(_0xc02507){if(_0xc02507){return _0xc02507[_0xe522('0x1c')](_0x1d091a)[_0xe522('0x1d')](function(_0x224034){return _0x224034;});}return null;};}function removeEntity(_0x581d65,_0x234392){return function(_0x4349d9){if(_0x4349d9){return _0x4349d9[_0xe522('0x1e')]()[_0xe522('0x1d')](function(){_0x581d65['status'](0xcc)[_0xe522('0x15')]();});}};}function handleEntityNotFound(_0x23137f,_0x39145d){return function(_0x126add){if(!_0x126add){_0x23137f[_0xe522('0x1f')](0x194);}return _0x126add;};}function handleError(_0x3297da,_0x211bea){_0x211bea=_0x211bea||0x1f4;return function(_0x137844){logger[_0xe522('0x20')](_0x137844[_0xe522('0x21')]);if(_0x137844[_0xe522('0x22')]){delete _0x137844['name'];}_0x3297da[_0xe522('0x14')](_0x211bea)['send'](_0x137844);};}exports[_0xe522('0x23')]=function(_0x25d384,_0x412b64){var _0x5da123={},_0x24613b={},_0x2f53ed={'count':0x0,'rows':[]};var _0x20cd84=db[_0xe522('0x24')][_0xe522('0x25')];_0x24613b['model']=_['keys'](_0x20cd84);var _0x2b709f={'dateStart':_0x25d384['query'][_0xe522('0x26')],'dateEnd':_0x25d384[_0xe522('0x27')][_0xe522('0x28')]};delete _0x25d384['query'][_0xe522('0x26')];delete _0x25d384[_0xe522('0x27')][_0xe522('0x28')];_0x24613b[_0xe522('0x27')]=_[_0xe522('0x29')](_0x25d384['query']);_0x24613b['filters']=_[_0xe522('0x2a')](_0x24613b['model'],_0x24613b[_0xe522('0x27')]);_0x5da123[_0xe522('0x2b')]=_[_0xe522('0x2a')](_0x24613b[_0xe522('0x2c')],qs[_0xe522('0x2d')](_0x25d384[_0xe522('0x27')]['fields']));_0x5da123[_0xe522('0x2b')]=_0x5da123[_0xe522('0x2b')]['length']?_0x5da123['attributes']:_0x24613b[_0xe522('0x2c')];if(!_0x25d384[_0xe522('0x27')]['hasOwnProperty'](_0xe522('0x2e'))){_0x5da123[_0xe522('0x2f')]=qs['limit'](_0x25d384[_0xe522('0x27')][_0xe522('0x2f')]);_0x5da123['offset']=qs[_0xe522('0x17')](_0x25d384[_0xe522('0x27')][_0xe522('0x17')]);}_0x5da123[_0xe522('0x30')]=qs[_0xe522('0x31')](_0x25d384['query'][_0xe522('0x31')]);_0x5da123[_0xe522('0x32')]=qs['filters'](_[_0xe522('0x33')](_0x25d384[_0xe522('0x27')],_0x24613b[_0xe522('0x34')]));if(_0x2b709f['dateStart']){if(_0x2b709f[_0xe522('0x28')]){_0x2b709f[_0xe522('0x28')]=moment(_0x2b709f[_0xe522('0x28')])[_0xe522('0x35')](0x1,_0xe522('0x36'));}else{_0x2b709f[_0xe522('0x28')]=moment(_0x2b709f[_0xe522('0x26')])[_0xe522('0x35')](0x1,_0xe522('0x36'));}_[_0xe522('0x37')](_0x5da123[_0xe522('0x32')],{'createdAt':{'$gte':_0x2b709f['dateStart'],'$lte':_0x2b709f['dateEnd']}});}if(_0x25d384['query'][_0xe522('0x38')]){_0x5da123[_0xe522('0x32')]=_[_0xe522('0x37')](_0x5da123[_0xe522('0x32')],{'$or':_['map'](_0x20cd84,function(_0x24ef5c){if(_0x24ef5c['type'][_0xe522('0x39')]!==_0xe522('0x3a')){var _0x376d93={};_0x376d93[_0x24ef5c[_0xe522('0x3b')]]={'$like':'%'+_0x25d384['query'][_0xe522('0x38')]+'%'};return _0x376d93;}})});}_0x5da123=_[_0xe522('0x37')]({},_0x5da123,_0x25d384[_0xe522('0x3c')]);var _0xe313b5={'where':_0x5da123[_0xe522('0x32')]};return db['ChatOfflineMessage'][_0xe522('0x3d')](_0xe313b5)[_0xe522('0x1d')](function(_0xc8644){_0x2f53ed['count']=_0xc8644;if(_0x25d384['query'][_0xe522('0x3e')]){_0x5da123[_0xe522('0x3f')]=[{'all':!![]}];}return db[_0xe522('0x24')]['findAll'](_0x5da123);})[_0xe522('0x1d')](function(_0x8c86ab){_0x2f53ed[_0xe522('0x40')]=_0x8c86ab;return _0x2f53ed;})[_0xe522('0x1d')](respondWithFilteredResult(_0x412b64,_0x5da123))[_0xe522('0x41')](handleError(_0x412b64,null));};exports[_0xe522('0x42')]=function(_0x55cde3,_0x287a6b){var _0x34fdc2={'raw':!![],'where':{'id':_0x55cde3[_0xe522('0x43')]['id']}},_0x2dec07={};_0x2dec07['model']=_[_0xe522('0x29')](db[_0xe522('0x24')][_0xe522('0x25')]);_0x2dec07['query']=_[_0xe522('0x29')](_0x55cde3[_0xe522('0x27')]);_0x2dec07['filters']=_[_0xe522('0x2a')](_0x2dec07['model'],_0x2dec07[_0xe522('0x27')]);_0x34fdc2['attributes']=_[_0xe522('0x2a')](_0x2dec07[_0xe522('0x2c')],qs[_0xe522('0x2d')](_0x55cde3[_0xe522('0x27')][_0xe522('0x2d')]));_0x34fdc2[_0xe522('0x2b')]=_0x34fdc2[_0xe522('0x2b')]['length']?_0x34fdc2[_0xe522('0x2b')]:_0x2dec07[_0xe522('0x2c')];if(_0x55cde3[_0xe522('0x27')][_0xe522('0x3e')]){_0x34fdc2[_0xe522('0x3f')]=[{'all':!![]}];}_0x34fdc2=_[_0xe522('0x37')]({},_0x34fdc2,_0x55cde3['options']);return db['ChatOfflineMessage'][_0xe522('0x44')](_0x34fdc2)[_0xe522('0x1d')](handleEntityNotFound(_0x287a6b,null))[_0xe522('0x1d')](respondWithResult(_0x287a6b,null))[_0xe522('0x41')](handleError(_0x287a6b,null));};exports[_0xe522('0x45')]=function(_0x583185,_0x39301b){return db[_0xe522('0x24')][_0xe522('0x45')](_0x583185[_0xe522('0x46')],{})[_0xe522('0x1d')](respondWithResult(_0x39301b,0xc9))[_0xe522('0x41')](handleError(_0x39301b,null));};exports['update']=function(_0x1819bf,_0x2382f1){if(_0x1819bf[_0xe522('0x46')]['id']){delete _0x1819bf['body']['id'];}return db[_0xe522('0x24')][_0xe522('0x44')]({'where':{'id':_0x1819bf[_0xe522('0x43')]['id']}})['then'](handleEntityNotFound(_0x2382f1,null))['then'](saveUpdates(_0x1819bf[_0xe522('0x46')],null))['then'](respondWithResult(_0x2382f1,null))[_0xe522('0x41')](handleError(_0x2382f1,null));};exports[_0xe522('0x1e')]=function(_0x9a760,_0x475cc2){return db[_0xe522('0x24')][_0xe522('0x44')]({'where':{'id':_0x9a760[_0xe522('0x43')]['id']}})[_0xe522('0x1d')](handleEntityNotFound(_0x475cc2,null))[_0xe522('0x1d')](removeEntity(_0x475cc2,null))[_0xe522('0x41')](handleError(_0x475cc2,null));};exports[_0xe522('0x47')]=function(_0x48d4c7,_0x390923){return db['ChatOfflineMessage']['describe']()[_0xe522('0x1d')](respondWithResult(_0x390923,null))['catch'](handleError(_0x390923,null));};
\ No newline at end of file
+var _0x7196=['dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','add','day','where','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','create','body','update','destroy','find','describe','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','apply','reject','save','then','sendStatus','error','stack','name','send','ChatOfflineMessage','model','query'];(function(_0x1c499a,_0x31892f){var _0x372745=function(_0x2f3ded){while(--_0x2f3ded){_0x1c499a['push'](_0x1c499a['shift']());}};_0x372745(++_0x31892f);}(_0x7196,0xb4));var _0x6719=function(_0x289a59,_0x54ff6c){_0x289a59=_0x289a59-0x0;var _0x2647af=_0x7196[_0x289a59];return _0x2647af;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6719('0x0'));var jsonpatch=require(_0x6719('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6719('0x2'));var Mustache=require(_0x6719('0x3'));var util=require('util');var path=require(_0x6719('0x4'));var sox=require(_0x6719('0x5'));var csv=require(_0x6719('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6719('0x7'));var crypto=require(_0x6719('0x8'));var jsforce=require(_0x6719('0x9'));var deskjs=require(_0x6719('0xa'));var toCsv=require(_0x6719('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6719('0xb'));var qs=require(_0x6719('0xc'));var logger=require(_0x6719('0xd'))('api');var utils=require(_0x6719('0xe'));var config=require(_0x6719('0xf'));var db=require(_0x6719('0x10'))['db'];function respondWithStatusCode(_0x3edbf2,_0x4b9ae6){_0x4b9ae6=_0x4b9ae6||0xcc;return function(_0xb1e62d){if(_0xb1e62d){return _0x3edbf2['sendStatus'](_0x4b9ae6);}return _0x3edbf2['status'](_0x4b9ae6)[_0x6719('0x11')]();};}function respondWithResult(_0x2e4531,_0x17b9a9){_0x17b9a9=_0x17b9a9||0xc8;return function(_0x19564c){if(_0x19564c){return _0x2e4531[_0x6719('0x12')](_0x17b9a9)[_0x6719('0x13')](_0x19564c);}};}function respondWithFilteredResult(_0x1756a5,_0x588991){return function(_0x2da607){if(_0x2da607){var _0x50c9b5=_0x2da607[_0x6719('0x14')],_0x42db03=_0x588991[_0x6719('0x15')],_0x3c8fc0=_0x588991[_0x6719('0x15')]+_0x588991[_0x6719('0x16')],_0x47d740;if(_0x3c8fc0>=_0x50c9b5){_0x3c8fc0=_0x50c9b5;_0x47d740=0xc8;}else{_0x47d740=0xce;}_0x1756a5[_0x6719('0x12')](_0x47d740);return _0x1756a5[_0x6719('0x17')]('Content-Range',_0x42db03+'-'+_0x3c8fc0+'/'+_0x50c9b5)[_0x6719('0x13')](_0x2da607);}return null;};}function patchUpdates(_0x5741d1){return function(_0x4605ad){try{jsonpatch[_0x6719('0x18')](_0x4605ad,_0x5741d1,!![]);}catch(_0x3015b8){return BPromise[_0x6719('0x19')](_0x3015b8);}return _0x4605ad[_0x6719('0x1a')]();};}function saveUpdates(_0x1df81d,_0xf3df77){return function(_0x501c33){if(_0x501c33){return _0x501c33['update'](_0x1df81d)[_0x6719('0x1b')](function(_0x2111a5){return _0x2111a5;});}return null;};}function removeEntity(_0x5a9fdb,_0x48de83){return function(_0x441ad6){if(_0x441ad6){return _0x441ad6['destroy']()[_0x6719('0x1b')](function(){_0x5a9fdb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x434cf3,_0x25ee09){return function(_0x479b34){if(!_0x479b34){_0x434cf3[_0x6719('0x1c')](0x194);}return _0x479b34;};}function handleError(_0x52aba4,_0x28c5da){_0x28c5da=_0x28c5da||0x1f4;return function(_0x18a324){logger[_0x6719('0x1d')](_0x18a324[_0x6719('0x1e')]);if(_0x18a324[_0x6719('0x1f')]){delete _0x18a324[_0x6719('0x1f')];}_0x52aba4[_0x6719('0x12')](_0x28c5da)[_0x6719('0x20')](_0x18a324);};}exports['index']=function(_0x212bd4,_0x535038){var _0x4f449e={},_0x5bb252={},_0x374e01={'count':0x0,'rows':[]};var _0x2dd81e=db[_0x6719('0x21')]['rawAttributes'];_0x5bb252[_0x6719('0x22')]=_['keys'](_0x2dd81e);var _0x154d69={'dateStart':_0x212bd4[_0x6719('0x23')][_0x6719('0x24')],'dateEnd':_0x212bd4['query'][_0x6719('0x25')]};delete _0x212bd4[_0x6719('0x23')][_0x6719('0x24')];delete _0x212bd4[_0x6719('0x23')][_0x6719('0x25')];_0x5bb252[_0x6719('0x23')]=_[_0x6719('0x26')](_0x212bd4['query']);_0x5bb252[_0x6719('0x27')]=_[_0x6719('0x28')](_0x5bb252['model'],_0x5bb252[_0x6719('0x23')]);_0x4f449e[_0x6719('0x29')]=_[_0x6719('0x28')](_0x5bb252[_0x6719('0x22')],qs[_0x6719('0x2a')](_0x212bd4[_0x6719('0x23')][_0x6719('0x2a')]));_0x4f449e[_0x6719('0x29')]=_0x4f449e[_0x6719('0x29')][_0x6719('0x2b')]?_0x4f449e[_0x6719('0x29')]:_0x5bb252[_0x6719('0x22')];if(!_0x212bd4['query'][_0x6719('0x2c')](_0x6719('0x2d'))){_0x4f449e[_0x6719('0x16')]=qs[_0x6719('0x16')](_0x212bd4['query'][_0x6719('0x16')]);_0x4f449e[_0x6719('0x15')]=qs['offset'](_0x212bd4['query'][_0x6719('0x15')]);}_0x4f449e['order']=qs[_0x6719('0x2e')](_0x212bd4['query'][_0x6719('0x2e')]);_0x4f449e['where']=qs['filters'](_[_0x6719('0x2f')](_0x212bd4[_0x6719('0x23')],_0x5bb252['filters']));if(_0x154d69[_0x6719('0x24')]){if(_0x154d69[_0x6719('0x25')]){_0x154d69[_0x6719('0x25')]=moment(_0x154d69['dateEnd'])[_0x6719('0x30')](0x1,_0x6719('0x31'));}else{_0x154d69[_0x6719('0x25')]=moment(_0x154d69['dateStart'])[_0x6719('0x30')](0x1,_0x6719('0x31'));}_['merge'](_0x4f449e[_0x6719('0x32')],{'createdAt':{'$gte':_0x154d69[_0x6719('0x24')],'$lte':_0x154d69['dateEnd']}});}if(_0x212bd4[_0x6719('0x23')]['filter']){_0x4f449e[_0x6719('0x32')]=_['merge'](_0x4f449e[_0x6719('0x32')],{'$or':_['map'](_0x2dd81e,function(_0x17b1f4){if(_0x17b1f4[_0x6719('0x33')][_0x6719('0x34')]!==_0x6719('0x35')){var _0x539934={};_0x539934[_0x17b1f4[_0x6719('0x36')]]={'$like':'%'+_0x212bd4[_0x6719('0x23')][_0x6719('0x37')]+'%'};return _0x539934;}})});}_0x4f449e=_['merge']({},_0x4f449e,_0x212bd4[_0x6719('0x38')]);var _0x24f446={'where':_0x4f449e[_0x6719('0x32')]};return db[_0x6719('0x21')][_0x6719('0x14')](_0x24f446)[_0x6719('0x1b')](function(_0x1252ef){_0x374e01[_0x6719('0x14')]=_0x1252ef;if(_0x212bd4[_0x6719('0x23')][_0x6719('0x39')]){_0x4f449e[_0x6719('0x3a')]=[{'all':!![]}];}return db[_0x6719('0x21')][_0x6719('0x3b')](_0x4f449e);})[_0x6719('0x1b')](function(_0x55e2fc){_0x374e01[_0x6719('0x3c')]=_0x55e2fc;return _0x374e01;})[_0x6719('0x1b')](respondWithFilteredResult(_0x535038,_0x4f449e))[_0x6719('0x3d')](handleError(_0x535038,null));};exports[_0x6719('0x3e')]=function(_0x523394,_0x49b4b6){var _0x5c2b4a={'raw':!![],'where':{'id':_0x523394[_0x6719('0x3f')]['id']}},_0x2a379b={};_0x2a379b[_0x6719('0x22')]=_[_0x6719('0x26')](db[_0x6719('0x21')][_0x6719('0x40')]);_0x2a379b['query']=_[_0x6719('0x26')](_0x523394[_0x6719('0x23')]);_0x2a379b['filters']=_[_0x6719('0x28')](_0x2a379b[_0x6719('0x22')],_0x2a379b['query']);_0x5c2b4a[_0x6719('0x29')]=_[_0x6719('0x28')](_0x2a379b['model'],qs['fields'](_0x523394['query'][_0x6719('0x2a')]));_0x5c2b4a['attributes']=_0x5c2b4a[_0x6719('0x29')]['length']?_0x5c2b4a[_0x6719('0x29')]:_0x2a379b[_0x6719('0x22')];if(_0x523394['query'][_0x6719('0x39')]){_0x5c2b4a[_0x6719('0x3a')]=[{'all':!![]}];}_0x5c2b4a=_[_0x6719('0x41')]({},_0x5c2b4a,_0x523394[_0x6719('0x38')]);return db[_0x6719('0x21')]['find'](_0x5c2b4a)['then'](handleEntityNotFound(_0x49b4b6,null))[_0x6719('0x1b')](respondWithResult(_0x49b4b6,null))[_0x6719('0x3d')](handleError(_0x49b4b6,null));};exports['create']=function(_0x177b01,_0x3ccc66){return db[_0x6719('0x21')][_0x6719('0x42')](_0x177b01[_0x6719('0x43')],{})[_0x6719('0x1b')](respondWithResult(_0x3ccc66,0xc9))['catch'](handleError(_0x3ccc66,null));};exports[_0x6719('0x44')]=function(_0x4d639a,_0x19e6a1){if(_0x4d639a[_0x6719('0x43')]['id']){delete _0x4d639a[_0x6719('0x43')]['id'];}return db[_0x6719('0x21')]['find']({'where':{'id':_0x4d639a['params']['id']}})[_0x6719('0x1b')](handleEntityNotFound(_0x19e6a1,null))['then'](saveUpdates(_0x4d639a[_0x6719('0x43')],null))[_0x6719('0x1b')](respondWithResult(_0x19e6a1,null))[_0x6719('0x3d')](handleError(_0x19e6a1,null));};exports[_0x6719('0x45')]=function(_0x33d98f,_0x2f67bc){return db[_0x6719('0x21')][_0x6719('0x46')]({'where':{'id':_0x33d98f['params']['id']}})[_0x6719('0x1b')](handleEntityNotFound(_0x2f67bc,null))[_0x6719('0x1b')](removeEntity(_0x2f67bc,null))['catch'](handleError(_0x2f67bc,null));};exports[_0x6719('0x47')]=function(_0x294693,_0x371c07){return db[_0x6719('0x21')]['describe']()['then'](respondWithResult(_0x371c07,null))[_0x6719('0x3d')](handleError(_0x371c07,null));};
\ No newline at end of file
index bac4f53..8759d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ea=['exports','define','ChatOfflineMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','./chatOfflineMessage.attributes'];(function(_0x14fd3e,_0x1949ae){var _0x3958d5=function(_0x280aaf){while(--_0x280aaf){_0x14fd3e['push'](_0x14fd3e['shift']());}};_0x3958d5(++_0x1949ae);}(_0x42ea,0xf6));var _0xa42e=function(_0x14a1c8,_0x43ab19){_0x14a1c8=_0x14a1c8-0x0;var _0x477e9e=_0x42ea[_0x14a1c8];return _0x477e9e;};'use strict';var _=require(_0xa42e('0x0'));var util=require(_0xa42e('0x1'));var logger=require(_0xa42e('0x2'))(_0xa42e('0x3'));var moment=require('moment');var BPromise=require(_0xa42e('0x4'));var rp=require(_0xa42e('0x5'));var attributes=require(_0xa42e('0x6'));module[_0xa42e('0x7')]=function(_0x129562,_0xf312e4){return _0x129562[_0xa42e('0x8')](_0xa42e('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa42e('0xa')});};
\ No newline at end of file
+var _0x1b18=['lodash','util','../../config/logger','api','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4'];(function(_0x2eeb23,_0x1ba72a){var _0x47fce3=function(_0x5d1762){while(--_0x5d1762){_0x2eeb23['push'](_0x2eeb23['shift']());}};_0x47fce3(++_0x1ba72a);}(_0x1b18,0x1cb));var _0x81b1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1b18[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x81b1('0x0'));var util=require(_0x81b1('0x1'));var logger=require(_0x81b1('0x2'))(_0x81b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x81b1('0x4'));module[_0x81b1('0x5')]=function(_0x212580,_0x462c6f){return _0x212580[_0x81b1('0x6')]('ChatOfflineMessage',attributes,{'tableName':_0x81b1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x81b1('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 166b86d..3f9f6da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa876=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash'];(function(_0x447b23,_0x49c577){var _0x2f37c7=function(_0x19d049){while(--_0x19d049){_0x447b23['push'](_0x447b23['shift']());}};_0x2f37c7(++_0x49c577);}(_0xa876,0x84));var _0x6a87=function(_0x3cfeff,_0x1dbdfc){_0x3cfeff=_0x3cfeff-0x0;var _0x21caac=_0xa876[_0x3cfeff];return _0x21caac;};'use strict';var _=require(_0x6a87('0x0'));var util=require(_0x6a87('0x1'));var moment=require(_0x6a87('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a87('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a87('0x4'));var logger=require(_0x6a87('0x5'))(_0x6a87('0x6'));var config=require(_0x6a87('0x7'));var jayson=require(_0x6a87('0x8'));var client=jayson[_0x6a87('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x126eb0,_0x2fef5e,_0x4d46c0){return new BPromise(function(_0x192635,_0x329c9f){return client[_0x6a87('0xa')](_0x126eb0,_0x4d46c0)[_0x6a87('0xb')](function(_0x4f51c2){logger[_0x6a87('0xc')](_0x6a87('0xd'),_0x2fef5e,_0x6a87('0xe'));logger[_0x6a87('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x2fef5e,'request\x20sent',JSON['stringify'](_0x4f51c2));if(_0x4f51c2[_0x6a87('0x10')]){if(_0x4f51c2['error']['code']===0x1f4){logger['error'](_0x6a87('0xd'),_0x2fef5e,_0x4f51c2[_0x6a87('0x10')][_0x6a87('0x11')]);return _0x329c9f(_0x4f51c2['error'][_0x6a87('0x11')]);}logger[_0x6a87('0x10')](_0x6a87('0xd'),_0x2fef5e,_0x4f51c2['error'][_0x6a87('0x11')]);return _0x192635(_0x4f51c2[_0x6a87('0x10')][_0x6a87('0x11')]);}else{logger[_0x6a87('0xc')](_0x6a87('0xd'),_0x2fef5e,_0x6a87('0xe'));_0x192635(_0x4f51c2[_0x6a87('0x12')][_0x6a87('0x11')]);}})['catch'](function(_0x2098e5){logger[_0x6a87('0x10')](_0x6a87('0xd'),_0x2fef5e,_0x2098e5);_0x329c9f(_0x2098e5);});});}
\ No newline at end of file
+var _0x1623=['ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','debug','request\x20sent','error','code'];(function(_0x2321b3,_0x406d80){var _0x4ce167=function(_0x392344){while(--_0x392344){_0x2321b3['push'](_0x2321b3['shift']());}};_0x4ce167(++_0x406d80);}(_0x1623,0x89));var _0x3162=function(_0x13a3c4,_0x50a2b9){_0x13a3c4=_0x13a3c4-0x0;var _0x3ba3de=_0x1623[_0x13a3c4];return _0x3ba3de;};'use strict';var _=require('lodash');var util=require(_0x3162('0x0'));var moment=require(_0x3162('0x1'));var BPromise=require('bluebird');var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3162('0x3'))['db'];var utils=require(_0x3162('0x4'));var logger=require('../../config/logger')(_0x3162('0x5'));var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46302f,_0x15b674,_0x5b05f3){return new BPromise(function(_0x14dde8,_0x395340){return client[_0x3162('0x9')](_0x46302f,_0x5b05f3)['then'](function(_0xf9291){logger[_0x3162('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x15b674,'request\x20sent');logger[_0x3162('0xb')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x15b674,_0x3162('0xc'),JSON['stringify'](_0xf9291));if(_0xf9291[_0x3162('0xd')]){if(_0xf9291[_0x3162('0xd')][_0x3162('0xe')]===0x1f4){logger[_0x3162('0xd')](_0x3162('0xf'),_0x15b674,_0xf9291['error'][_0x3162('0x10')]);return _0x395340(_0xf9291['error'][_0x3162('0x10')]);}logger['error'](_0x3162('0xf'),_0x15b674,_0xf9291[_0x3162('0xd')][_0x3162('0x10')]);return _0x14dde8(_0xf9291[_0x3162('0xd')][_0x3162('0x10')]);}else{logger[_0x3162('0xa')](_0x3162('0xf'),_0x15b674,_0x3162('0xc'));_0x14dde8(_0xf9291[_0x3162('0x11')][_0x3162('0x10')]);}})[_0x3162('0x12')](function(_0x2e157b){logger[_0x3162('0xd')](_0x3162('0xf'),_0x15b674,_0x2e157b);_0x395340(_0x2e157b);});});}
\ No newline at end of file
index bc568e7..8e20c89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf323=['./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29cfcb,_0x5cce76){var _0x1b1abf=function(_0x1b58f3){while(--_0x1b58f3){_0x29cfcb['push'](_0x29cfcb['shift']());}};_0x1b1abf(++_0x5cce76);}(_0xf323,0x1c6));var _0x3f32=function(_0x1147fb,_0x17f94c){_0x1147fb=_0x1147fb-0x0;var _0x132438=_0xf323[_0x1147fb];return _0x132438;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3f32('0x0'));var timeout=require(_0x3f32('0x1'));var express=require('express');var router=express[_0x3f32('0x2')]();var auth=require(_0x3f32('0x3'));var interaction=require(_0x3f32('0x4'));var config=require(_0x3f32('0x5'));var controller=require(_0x3f32('0x6'));router['get']('/',auth[_0x3f32('0x7')](),controller[_0x3f32('0x8')]);router[_0x3f32('0x9')](_0x3f32('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3f32('0x9')](_0x3f32('0xb'),auth[_0x3f32('0x7')](),controller[_0x3f32('0xc')]);router[_0x3f32('0xd')]('/',auth[_0x3f32('0x7')](),controller[_0x3f32('0xe')]);router[_0x3f32('0xf')]('/:id',auth[_0x3f32('0x7')](),controller[_0x3f32('0x10')]);router[_0x3f32('0x11')]('/:id',auth[_0x3f32('0x7')](),controller[_0x3f32('0x12')]);module[_0x3f32('0x13')]=router;
\ No newline at end of file
+var _0xac95=['show','post','put','update','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0x203b9d,_0x6695e8){var _0x5c44bf=function(_0x58089e){while(--_0x58089e){_0x203b9d['push'](_0x203b9d['shift']());}};_0x5c44bf(++_0x6695e8);}(_0xac95,0xa8));var _0x5ac9=function(_0x2f569c,_0x4413d9){_0x2f569c=_0x2f569c-0x0;var _0x440708=_0xac95[_0x2f569c];return _0x440708;};'use strict';var multer=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var path=require(_0x5ac9('0x2'));var timeout=require(_0x5ac9('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x5ac9('0x4'));var interaction=require(_0x5ac9('0x5'));var config=require('../../config/environment');var controller=require(_0x5ac9('0x6'));router[_0x5ac9('0x7')]('/',auth['isAuthenticated'](),controller[_0x5ac9('0x8')]);router[_0x5ac9('0x7')](_0x5ac9('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x5ac9('0x7')](_0x5ac9('0xa'),auth[_0x5ac9('0xb')](),controller[_0x5ac9('0xc')]);router[_0x5ac9('0xd')]('/',auth[_0x5ac9('0xb')](),controller['create']);router[_0x5ac9('0xe')](_0x5ac9('0xa'),auth['isAuthenticated'](),controller[_0x5ac9('0xf')]);router['delete'](_0x5ac9('0xa'),auth['isAuthenticated'](),controller[_0x5ac9('0x10')]);module[_0x5ac9('0x11')]=router;
\ No newline at end of file
index 2acd401..c0db9a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb839=['INTEGER','STRING','ENUM','mouseOver'];(function(_0x49c724,_0x48c3e4){var _0x40ba33=function(_0x2ea53a){while(--_0x2ea53a){_0x49c724['push'](_0x49c724['shift']());}};_0x40ba33(++_0x48c3e4);}(_0xb839,0x11d));var _0x9b83=function(_0x372a07,_0xe146f2){_0x372a07=_0x372a07-0x0;var _0x3db461=_0xb839[_0x372a07];return _0x3db461;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9b83('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x9b83('0x1')](_0x9b83('0x2'),'timeout'),'defaultValue':_0x9b83('0x2')},'selector':{'type':Sequelize[_0x9b83('0x0')]},'timeout':{'type':Sequelize[_0x9b83('0x3')]}};
\ No newline at end of file
+var _0x96f2=['INTEGER','sequelize','STRING','ENUM','mouseOver'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x96f2,0xb0));var _0x296f=function(_0x140c6a,_0x29ab34){_0x140c6a=_0x140c6a-0x0;var _0x15f4dd=_0x96f2[_0x140c6a];return _0x15f4dd;};'use strict';var Sequelize=require(_0x296f('0x0'));module['exports']={'name':{'type':Sequelize[_0x296f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x296f('0x2')](_0x296f('0x3'),'timeout'),'defaultValue':_0x296f('0x3')},'selector':{'type':Sequelize[_0x296f('0x1')]},'timeout':{'type':Sequelize[_0x296f('0x4')]}};
\ No newline at end of file
index 5c232e7..9059973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef6d=['sendStatus','end','status','count','json','reject','update','then','destroy','error','stack','name','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','fields','includeAll','include','merge','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x570a5d,_0x5aefc3){var _0x1bedf8=function(_0x3d1e1d){while(--_0x3d1e1d){_0x570a5d['push'](_0x570a5d['shift']());}};_0x1bedf8(++_0x5aefc3);}(_0xef6d,0x1df));var _0xdef6=function(_0x16451c,_0x52fdb2){_0x16451c=_0x16451c-0x0;var _0x28dc55=_0xef6d[_0x16451c];return _0x28dc55;};'use strict';var pdf=require(_0xdef6('0x0'));var emlformat=require(_0xdef6('0x1'));var rimraf=require(_0xdef6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdef6('0x3'));var moment=require(_0xdef6('0x4'));var BPromise=require(_0xdef6('0x5'));var Mustache=require(_0xdef6('0x6'));var util=require(_0xdef6('0x7'));var path=require('path');var sox=require(_0xdef6('0x8'));var csv=require(_0xdef6('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdef6('0xa'));var squel=require('squel');var crypto=require(_0xdef6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdef6('0xc'));var toCsv=require(_0xdef6('0x9'));var querystring=require(_0xdef6('0xd'));var Papa=require(_0xdef6('0xe'));var Redis=require(_0xdef6('0xf'));var qs=require(_0xdef6('0x10'));var logger=require(_0xdef6('0x11'))(_0xdef6('0x12'));var utils=require(_0xdef6('0x13'));var config=require('../../config/environment');var db=require(_0xdef6('0x14'))['db'];function respondWithStatusCode(_0x588562,_0x36d721){_0x36d721=_0x36d721||0xcc;return function(_0x53f545){if(_0x53f545){return _0x588562[_0xdef6('0x15')](_0x36d721);}return _0x588562['status'](_0x36d721)[_0xdef6('0x16')]();};}function respondWithResult(_0x2dc505,_0x3b3b50){_0x3b3b50=_0x3b3b50||0xc8;return function(_0x223041){if(_0x223041){return _0x2dc505[_0xdef6('0x17')](_0x3b3b50)['json'](_0x223041);}};}function respondWithFilteredResult(_0x45452f,_0x3a0e12){return function(_0x42f4cc){if(_0x42f4cc){var _0x5be9ad=_0x42f4cc[_0xdef6('0x18')],_0x18b002=_0x3a0e12['offset'],_0x3f6521=_0x3a0e12['offset']+_0x3a0e12['limit'],_0x347796;if(_0x3f6521>=_0x5be9ad){_0x3f6521=_0x5be9ad;_0x347796=0xc8;}else{_0x347796=0xce;}_0x45452f[_0xdef6('0x17')](_0x347796);return _0x45452f['set']('Content-Range',_0x18b002+'-'+_0x3f6521+'/'+_0x5be9ad)[_0xdef6('0x19')](_0x42f4cc);}return null;};}function patchUpdates(_0x44dfae){return function(_0x233275){try{jsonpatch['apply'](_0x233275,_0x44dfae,!![]);}catch(_0x5af81b){return BPromise[_0xdef6('0x1a')](_0x5af81b);}return _0x233275['save']();};}function saveUpdates(_0x1e06f9,_0x11c24e){return function(_0x4d2ce5){if(_0x4d2ce5){return _0x4d2ce5[_0xdef6('0x1b')](_0x1e06f9)[_0xdef6('0x1c')](function(_0x1cdc07){return _0x1cdc07;});}return null;};}function removeEntity(_0x3c6da5,_0x2f7508){return function(_0xbd6e30){if(_0xbd6e30){return _0xbd6e30[_0xdef6('0x1d')]()[_0xdef6('0x1c')](function(){_0x3c6da5[_0xdef6('0x17')](0xcc)[_0xdef6('0x16')]();});}};}function handleEntityNotFound(_0x53f18e,_0x31d8d4){return function(_0x1b0490){if(!_0x1b0490){_0x53f18e[_0xdef6('0x15')](0x194);}return _0x1b0490;};}function handleError(_0x3c55fa,_0x2ecceb){_0x2ecceb=_0x2ecceb||0x1f4;return function(_0x1b87a6){logger[_0xdef6('0x1e')](_0x1b87a6[_0xdef6('0x1f')]);if(_0x1b87a6[_0xdef6('0x20')]){delete _0x1b87a6['name'];}_0x3c55fa[_0xdef6('0x17')](_0x2ecceb)['send'](_0x1b87a6);};}exports['show']=function(_0x555f30,_0x5904fa){var _0x456017={'raw':!![],'where':{'id':_0x555f30[_0xdef6('0x21')]['id']}},_0x1d908b={};_0x1d908b['model']=_[_0xdef6('0x22')](db[_0xdef6('0x23')]['rawAttributes']);_0x1d908b[_0xdef6('0x24')]=_[_0xdef6('0x22')](_0x555f30[_0xdef6('0x24')]);_0x1d908b[_0xdef6('0x25')]=_[_0xdef6('0x26')](_0x1d908b[_0xdef6('0x27')],_0x1d908b[_0xdef6('0x24')]);_0x456017[_0xdef6('0x28')]=_['intersection'](_0x1d908b[_0xdef6('0x27')],qs[_0xdef6('0x29')](_0x555f30[_0xdef6('0x24')][_0xdef6('0x29')]));_0x456017[_0xdef6('0x28')]=_0x456017[_0xdef6('0x28')]['length']?_0x456017[_0xdef6('0x28')]:_0x1d908b['model'];if(_0x555f30[_0xdef6('0x24')][_0xdef6('0x2a')]){_0x456017[_0xdef6('0x2b')]=[{'all':!![]}];}_0x456017=_[_0xdef6('0x2c')]({},_0x456017,_0x555f30[_0xdef6('0x2d')]);return db[_0xdef6('0x23')]['find'](_0x456017)[_0xdef6('0x1c')](handleEntityNotFound(_0x5904fa,null))[_0xdef6('0x1c')](respondWithResult(_0x5904fa,null))[_0xdef6('0x2e')](handleError(_0x5904fa,null));};exports['create']=function(_0x320bc8,_0xc03b9d){return db[_0xdef6('0x23')][_0xdef6('0x2f')](_0x320bc8[_0xdef6('0x30')],{})[_0xdef6('0x1c')](respondWithResult(_0xc03b9d,0xc9))[_0xdef6('0x2e')](handleError(_0xc03b9d,null));};exports[_0xdef6('0x1b')]=function(_0x4118fe,_0x46b3f3){if(_0x4118fe[_0xdef6('0x30')]['id']){delete _0x4118fe['body']['id'];}return db[_0xdef6('0x23')][_0xdef6('0x31')]({'where':{'id':_0x4118fe[_0xdef6('0x21')]['id']}})['then'](handleEntityNotFound(_0x46b3f3,null))[_0xdef6('0x1c')](saveUpdates(_0x4118fe[_0xdef6('0x30')],null))[_0xdef6('0x1c')](respondWithResult(_0x46b3f3,null))[_0xdef6('0x2e')](handleError(_0x46b3f3,null));};exports[_0xdef6('0x1d')]=function(_0x323aa9,_0x473ff8){return db[_0xdef6('0x23')][_0xdef6('0x31')]({'where':{'id':_0x323aa9['params']['id']}})[_0xdef6('0x1c')](handleEntityNotFound(_0x473ff8,null))[_0xdef6('0x1c')](removeEntity(_0x473ff8,null))[_0xdef6('0x2e')](handleError(_0x473ff8,null));};
\ No newline at end of file
+var _0x0828=['model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','params'];(function(_0x25b656,_0x2aa453){var _0x421832=function(_0x577bf4){while(--_0x577bf4){_0x25b656['push'](_0x25b656['shift']());}};_0x421832(++_0x2aa453);}(_0x0828,0x17d));var _0x8082=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0828[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0x8082('0x0'));var emlformat=require(_0x8082('0x1'));var rimraf=require(_0x8082('0x2'));var zipdir=require(_0x8082('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8082('0x4'));var moment=require(_0x8082('0x5'));var BPromise=require(_0x8082('0x6'));var Mustache=require('mustache');var util=require(_0x8082('0x7'));var path=require(_0x8082('0x8'));var sox=require('sox');var csv=require(_0x8082('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8082('0xa'));var squel=require('squel');var crypto=require(_0x8082('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8082('0xc'));var toCsv=require(_0x8082('0x9'));var querystring=require(_0x8082('0xd'));var Papa=require('papaparse');var Redis=require(_0x8082('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x8082('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8082('0x10'))['db'];function respondWithStatusCode(_0xf8d2ec,_0x4485a3){_0x4485a3=_0x4485a3||0xcc;return function(_0x432186){if(_0x432186){return _0xf8d2ec[_0x8082('0x11')](_0x4485a3);}return _0xf8d2ec[_0x8082('0x12')](_0x4485a3)[_0x8082('0x13')]();};}function respondWithResult(_0x45710e,_0x45e577){_0x45e577=_0x45e577||0xc8;return function(_0x3f47c7){if(_0x3f47c7){return _0x45710e[_0x8082('0x12')](_0x45e577)[_0x8082('0x14')](_0x3f47c7);}};}function respondWithFilteredResult(_0x2c41af,_0x37d6b3){return function(_0x5f1b84){if(_0x5f1b84){var _0x1b04c5=_0x5f1b84[_0x8082('0x15')],_0x39b9c1=_0x37d6b3[_0x8082('0x16')],_0x29f4ff=_0x37d6b3[_0x8082('0x16')]+_0x37d6b3[_0x8082('0x17')],_0x1b548b;if(_0x29f4ff>=_0x1b04c5){_0x29f4ff=_0x1b04c5;_0x1b548b=0xc8;}else{_0x1b548b=0xce;}_0x2c41af[_0x8082('0x12')](_0x1b548b);return _0x2c41af[_0x8082('0x18')](_0x8082('0x19'),_0x39b9c1+'-'+_0x29f4ff+'/'+_0x1b04c5)[_0x8082('0x14')](_0x5f1b84);}return null;};}function patchUpdates(_0x35fd32){return function(_0x4ad30b){try{jsonpatch[_0x8082('0x1a')](_0x4ad30b,_0x35fd32,!![]);}catch(_0x531ec1){return BPromise[_0x8082('0x1b')](_0x531ec1);}return _0x4ad30b['save']();};}function saveUpdates(_0x4ecd3e,_0x5aef1c){return function(_0x2b7c94){if(_0x2b7c94){return _0x2b7c94[_0x8082('0x1c')](_0x4ecd3e)['then'](function(_0x1b45c6){return _0x1b45c6;});}return null;};}function removeEntity(_0x2de1c8,_0x44356c){return function(_0x53b0cd){if(_0x53b0cd){return _0x53b0cd['destroy']()[_0x8082('0x1d')](function(){_0x2de1c8[_0x8082('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d2edc,_0x59df2f){return function(_0x1cd04a){if(!_0x1cd04a){_0x2d2edc[_0x8082('0x11')](0x194);}return _0x1cd04a;};}function handleError(_0x2dfb75,_0x47cea3){_0x47cea3=_0x47cea3||0x1f4;return function(_0x193646){logger[_0x8082('0x1e')](_0x193646[_0x8082('0x1f')]);if(_0x193646[_0x8082('0x20')]){delete _0x193646[_0x8082('0x20')];}_0x2dfb75[_0x8082('0x12')](_0x47cea3)[_0x8082('0x21')](_0x193646);};}exports['show']=function(_0x313d4b,_0x23073d){var _0x27ead3={'raw':!![],'where':{'id':_0x313d4b[_0x8082('0x22')]['id']}},_0x39c5b6={};_0x39c5b6[_0x8082('0x23')]=_[_0x8082('0x24')](db[_0x8082('0x25')]['rawAttributes']);_0x39c5b6[_0x8082('0x26')]=_[_0x8082('0x24')](_0x313d4b[_0x8082('0x26')]);_0x39c5b6[_0x8082('0x27')]=_[_0x8082('0x28')](_0x39c5b6['model'],_0x39c5b6[_0x8082('0x26')]);_0x27ead3[_0x8082('0x29')]=_['intersection'](_0x39c5b6[_0x8082('0x23')],qs[_0x8082('0x2a')](_0x313d4b['query'][_0x8082('0x2a')]));_0x27ead3['attributes']=_0x27ead3[_0x8082('0x29')][_0x8082('0x2b')]?_0x27ead3[_0x8082('0x29')]:_0x39c5b6[_0x8082('0x23')];if(_0x313d4b[_0x8082('0x26')][_0x8082('0x2c')]){_0x27ead3['include']=[{'all':!![]}];}_0x27ead3=_[_0x8082('0x2d')]({},_0x27ead3,_0x313d4b[_0x8082('0x2e')]);return db[_0x8082('0x25')][_0x8082('0x2f')](_0x27ead3)[_0x8082('0x1d')](handleEntityNotFound(_0x23073d,null))[_0x8082('0x1d')](respondWithResult(_0x23073d,null))[_0x8082('0x30')](handleError(_0x23073d,null));};exports[_0x8082('0x31')]=function(_0x4df2ea,_0x2b150b){return db[_0x8082('0x25')][_0x8082('0x31')](_0x4df2ea[_0x8082('0x32')],{})[_0x8082('0x1d')](respondWithResult(_0x2b150b,0xc9))[_0x8082('0x30')](handleError(_0x2b150b,null));};exports['update']=function(_0x2534a5,_0x486000){if(_0x2534a5[_0x8082('0x32')]['id']){delete _0x2534a5[_0x8082('0x32')]['id'];}return db[_0x8082('0x25')]['find']({'where':{'id':_0x2534a5[_0x8082('0x22')]['id']}})[_0x8082('0x1d')](handleEntityNotFound(_0x486000,null))[_0x8082('0x1d')](saveUpdates(_0x2534a5[_0x8082('0x32')],null))['then'](respondWithResult(_0x486000,null))['catch'](handleError(_0x486000,null));};exports[_0x8082('0x33')]=function(_0x128cb4,_0x16e269){return db[_0x8082('0x25')][_0x8082('0x2f')]({'where':{'id':_0x128cb4[_0x8082('0x22')]['id']}})[_0x8082('0x1d')](handleEntityNotFound(_0x16e269,null))[_0x8082('0x1d')](removeEntity(_0x16e269,null))['catch'](handleError(_0x16e269,null));};
\ No newline at end of file
index d540d42..b05ad42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','moment','bluebird','request-promise','./chatProactiveAction.attributes'];(function(_0x1474f5,_0x343679){var _0x3c901f=function(_0x2df6de){while(--_0x2df6de){_0x1474f5['push'](_0x1474f5['shift']());}};_0x3c901f(++_0x343679);}(_0x57ca,0x108));var _0xa57c=function(_0x3de2e7,_0x39aa2b){_0x3de2e7=_0x3de2e7-0x0;var _0x116f34=_0x57ca[_0x3de2e7];return _0x116f34;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var attributes=require(_0xa57c('0x5'));module[_0xa57c('0x6')]=function(_0x48be2d,_0x40ba22){return _0x48be2d[_0xa57c('0x7')](_0xa57c('0x8'),attributes,{'tableName':_0xa57c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14a0=['api','moment','bluebird','request-promise','./chatProactiveAction.attributes','define','ChatProactiveAction','util','../../config/logger'];(function(_0x14f64b,_0x581e88){var _0x1914cc=function(_0x3fe70c){while(--_0x3fe70c){_0x14f64b['push'](_0x14f64b['shift']());}};_0x1914cc(++_0x581e88);}(_0x14a0,0x8e));var _0x014a=function(_0x4d18e8,_0x4f8aef){_0x4d18e8=_0x4d18e8-0x0;var _0x1cd247=_0x14a0[_0x4d18e8];return _0x1cd247;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var attributes=require(_0x014a('0x6'));module['exports']=function(_0x57a522,_0x1730a5){return _0x57a522[_0x014a('0x7')](_0x014a('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 559c707..88b2dc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0x1aa616,_0x31754c){var _0x31f9b6=function(_0x78fff7){while(--_0x78fff7){_0x1aa616['push'](_0x1aa616['shift']());}};_0x31f9b6(++_0x31754c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0x5ea8f3,_0x54b0d9){var _0x4f493a=function(_0x2707f0){while(--_0x2707f0){_0x5ea8f3['push'](_0x5ea8f3['shift']());}};_0x4f493a(++_0x54b0d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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
index 2d46744..e8bc910 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9563=['show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x9563,0x1e7));var _0x3956=function(_0x4141c7,_0x556bd5){_0x4141c7=_0x4141c7-0x0;var _0x1f0db2=_0x9563[_0x4141c7];return _0x1f0db2;};'use strict';var multer=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var path=require('path');var timeout=require(_0x3956('0x2'));var express=require(_0x3956('0x3'));var router=express[_0x3956('0x4')]();var auth=require(_0x3956('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3956('0x6'));router['get'](_0x3956('0x7'),auth[_0x3956('0x8')](),controller[_0x3956('0x9')]);router[_0x3956('0xa')]('/',auth['isAuthenticated'](),controller[_0x3956('0xb')]);router[_0x3956('0xc')](_0x3956('0x7'),auth[_0x3956('0x8')](),controller[_0x3956('0xd')]);router['delete']('/:id',auth[_0x3956('0x8')](),controller[_0x3956('0xe')]);module[_0x3956('0xf')]=router;
\ No newline at end of file
+var _0xd509=['isAuthenticated','post','create','put','update','exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x500a1f,_0x14745f){var _0x2f5bd7=function(_0x2d7ca7){while(--_0x2d7ca7){_0x500a1f['push'](_0x500a1f['shift']());}};_0x2f5bd7(++_0x14745f);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d50('0x0'));var timeout=require(_0x9d50('0x1'));var express=require(_0x9d50('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9d50('0x3'));var config=require(_0x9d50('0x4'));var controller=require('./chatProactiveAction.controller');router[_0x9d50('0x5')](_0x9d50('0x6'),auth[_0x9d50('0x7')](),controller['show']);router[_0x9d50('0x8')]('/',auth['isAuthenticated'](),controller[_0x9d50('0x9')]);router[_0x9d50('0xa')](_0x9d50('0x6'),auth[_0x9d50('0x7')](),controller[_0x9d50('0xb')]);router['delete'](_0x9d50('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0x9d50('0xc')]=router;
\ No newline at end of file
index 836a665..bf13fb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed2c=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xed2c,0xf1));var _0xced2=function(_0x1ac33a,_0x52f6f8){_0x1ac33a=_0x1ac33a-0x0;var _0x3b6b87=_0xed2c[_0x1ac33a];return _0x3b6b87;};'use strict';var Sequelize=require(_0xced2('0x0'));module[_0xced2('0x1')]={'name':{'type':Sequelize[_0xced2('0x2')],'unique':_0xced2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xced2('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xced2('0x4')](_0xced2('0x5'),'beepall',_0xced2('0x6'))}};
\ No newline at end of file
+var _0x9964=['rrmemory','roundrobin','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x2ab1dc,_0xe1f516){var _0xc5556a=function(_0x57e58b){while(--_0x57e58b){_0x2ab1dc['push'](_0x2ab1dc['shift']());}};_0xc5556a(++_0xe1f516);}(_0x9964,0x79));var _0x4996=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0x9964[_0x286bfb];return _0x52b683;};'use strict';var Sequelize=require(_0x4996('0x0'));module[_0x4996('0x1')]={'name':{'type':Sequelize[_0x4996('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4996('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4996('0x4')](_0x4996('0x5'),'beepall',_0x4996('0x6'))}};
\ No newline at end of file
index 4473de1..a1e9857 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4645=['../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','index','rawAttributes','model','dateStart','dateEnd','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','map','type','key','VIRTUAL','field','filter','ChatQueue','includeAll','include','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','options','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','chatPause','createdAt','Team','getTeams','addTeams','findAll','ids','Agents','union','addAgents','penalty','removeTeams','removeAgents','omit','spread','userChatQueue:save','isArray','emit','userChatQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils'];(function(_0x57252a,_0x1ceae9){var _0x2733a8=function(_0x1b8611){while(--_0x1b8611){_0x57252a['push'](_0x57252a['shift']());}};_0x2733a8(++_0x1ceae9);}(_0x4645,0x16f));var _0x5464=function(_0x2bf208,_0xeeadc3){_0x2bf208=_0x2bf208-0x0;var _0x5908b2=_0x4645[_0x2bf208];return _0x5908b2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5464('0x0'));var rimraf=require(_0x5464('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5464('0x2'));var rp=require(_0x5464('0x3'));var moment=require(_0x5464('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5464('0x5'));var util=require(_0x5464('0x6'));var path=require(_0x5464('0x7'));var sox=require('sox');var csv=require(_0x5464('0x8'));var ejs=require(_0x5464('0x9'));var fs=require('fs');var _=require(_0x5464('0xa'));var squel=require(_0x5464('0xb'));var crypto=require('crypto');var jsforce=require(_0x5464('0xc'));var deskjs=require(_0x5464('0xd'));var toCsv=require(_0x5464('0x8'));var querystring=require(_0x5464('0xe'));var Papa=require(_0x5464('0xf'));var Redis=require(_0x5464('0x10'));var qs=require(_0x5464('0x11'));var logger=require(_0x5464('0x12'))('api');var utils=require(_0x5464('0x13'));var config=require(_0x5464('0x14'));var db=require(_0x5464('0x15'))['db'];config[_0x5464('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5464('0x17'))(new Redis(config['redis']));require(_0x5464('0x18'))[_0x5464('0x19')](socket);var jayson=require(_0x5464('0x1a'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4be8c8,_0x307897,_0x54cd9a,_0x58788d){return new BPromise(function(_0x3b76e0,_0x32c4cf){var _0x49c56a=_0x58788d||client;return _0x49c56a['request'](_0x4be8c8,_0x54cd9a)[_0x5464('0x1b')](function(_0x35b53b){logger[_0x5464('0x1c')](_0x5464('0x1d'),_0x307897,_0x5464('0x1e'));logger['debug'](_0x5464('0x1f'),_0x307897,_0x5464('0x1e'),JSON[_0x5464('0x20')](_0x35b53b));if(_0x35b53b[_0x5464('0x21')]){if(_0x35b53b[_0x5464('0x21')]['code']===0x1f4){logger[_0x5464('0x21')]('ChatQueue,\x20%s,\x20%s',_0x307897,_0x35b53b[_0x5464('0x21')][_0x5464('0x22')]);return _0x32c4cf(_0x35b53b[_0x5464('0x21')][_0x5464('0x22')]);}logger['error'](_0x5464('0x1d'),_0x307897,_0x35b53b[_0x5464('0x21')]['message']);return _0x3b76e0(_0x35b53b[_0x5464('0x21')][_0x5464('0x22')]);}else{logger[_0x5464('0x1c')](_0x5464('0x1d'),_0x307897,_0x5464('0x1e'));_0x3b76e0(_0x35b53b[_0x5464('0x23')][_0x5464('0x22')]);}})[_0x5464('0x24')](function(_0x5c9e9a){logger['error'](_0x5464('0x1d'),_0x307897,_0x5c9e9a);_0x32c4cf(_0x5c9e9a);});});}function respondWithStatusCode(_0x20c07b,_0x4e37ef){_0x4e37ef=_0x4e37ef||0xcc;return function(_0x12be39){if(_0x12be39){return _0x20c07b['sendStatus'](_0x4e37ef);}return _0x20c07b[_0x5464('0x25')](_0x4e37ef)['end']();};}function respondWithResult(_0x58df09,_0x395e8c){_0x395e8c=_0x395e8c||0xc8;return function(_0xcc1db5){if(_0xcc1db5){return _0x58df09[_0x5464('0x25')](_0x395e8c)[_0x5464('0x26')](_0xcc1db5);}};}function respondWithFilteredResult(_0x31c153,_0x20274d){return function(_0x29c826){if(_0x29c826){var _0x5e4a55=_0x29c826[_0x5464('0x27')],_0x52e40e=_0x20274d[_0x5464('0x28')],_0x251592=_0x20274d['offset']+_0x20274d[_0x5464('0x29')],_0x5d3754;if(_0x251592>=_0x5e4a55){_0x251592=_0x5e4a55;_0x5d3754=0xc8;}else{_0x5d3754=0xce;}_0x31c153['status'](_0x5d3754);return _0x31c153[_0x5464('0x2a')](_0x5464('0x2b'),_0x52e40e+'-'+_0x251592+'/'+_0x5e4a55)[_0x5464('0x26')](_0x29c826);}return null;};}function patchUpdates(_0x206354){return function(_0x469022){try{jsonpatch['apply'](_0x469022,_0x206354,!![]);}catch(_0x4e4dc7){return BPromise[_0x5464('0x2c')](_0x4e4dc7);}return _0x469022['save']();};}function saveUpdates(_0x87f1b6,_0x1a03b3){return function(_0x219d87){if(_0x219d87){return _0x219d87[_0x5464('0x2d')](_0x87f1b6)[_0x5464('0x1b')](function(_0x25615a){return _0x25615a;});}return null;};}function removeEntity(_0x130278,_0x473423){return function(_0x2d81c6){if(_0x2d81c6){return _0x2d81c6[_0x5464('0x2e')]()[_0x5464('0x1b')](function(){var _0x4035fd=_0x2d81c6[_0x5464('0x2f')]({'plain':!![]});var _0x20962d=_0x5464('0x30');return db[_0x5464('0x31')][_0x5464('0x2e')]({'where':{'type':_0x20962d,'resourceId':_0x4035fd['id']}})[_0x5464('0x1b')](function(){return _0x2d81c6;});})[_0x5464('0x1b')](function(){_0x130278[_0x5464('0x25')](0xcc)[_0x5464('0x32')]();});}};}function handleEntityNotFound(_0x5ac9d3,_0x19c898){return function(_0xb6e21c){if(!_0xb6e21c){_0x5ac9d3['sendStatus'](0x194);}return _0xb6e21c;};}function handleError(_0x5e37d1,_0x3423a9){_0x3423a9=_0x3423a9||0x1f4;return function(_0x272a3c){logger['error'](_0x272a3c[_0x5464('0x33')]);if(_0x272a3c[_0x5464('0x34')]){delete _0x272a3c[_0x5464('0x34')];}_0x5e37d1[_0x5464('0x25')](_0x3423a9)['send'](_0x272a3c);};}exports[_0x5464('0x35')]=function(_0x3b3dbe,_0x12d9e6){var _0x44ace7={},_0x26724e={},_0x4ba8f6={'count':0x0,'rows':[]};var _0x2d9270=db['ChatQueue'][_0x5464('0x36')];_0x26724e[_0x5464('0x37')]=_['keys'](_0x2d9270);var _0x336abf={'dateStart':_0x3b3dbe['query'][_0x5464('0x38')],'dateEnd':_0x3b3dbe['query'][_0x5464('0x39')]};delete _0x3b3dbe[_0x5464('0x3a')][_0x5464('0x38')];delete _0x3b3dbe[_0x5464('0x3a')][_0x5464('0x39')];_0x26724e[_0x5464('0x3a')]=_[_0x5464('0x3b')](_0x3b3dbe[_0x5464('0x3a')]);_0x26724e[_0x5464('0x3c')]=_[_0x5464('0x3d')](_0x26724e[_0x5464('0x37')],_0x26724e[_0x5464('0x3a')]);_0x44ace7[_0x5464('0x3e')]=_['intersection'](_0x26724e[_0x5464('0x37')],qs[_0x5464('0x3f')](_0x3b3dbe[_0x5464('0x3a')][_0x5464('0x3f')]));_0x44ace7[_0x5464('0x3e')]=_0x44ace7[_0x5464('0x3e')][_0x5464('0x40')]?_0x44ace7['attributes']:_0x26724e[_0x5464('0x37')];if(!_0x3b3dbe[_0x5464('0x3a')][_0x5464('0x41')](_0x5464('0x42'))){_0x44ace7['limit']=qs['limit'](_0x3b3dbe[_0x5464('0x3a')][_0x5464('0x29')]);_0x44ace7[_0x5464('0x28')]=qs['offset'](_0x3b3dbe[_0x5464('0x3a')][_0x5464('0x28')]);}_0x44ace7[_0x5464('0x43')]=qs[_0x5464('0x44')](_0x3b3dbe['query'][_0x5464('0x44')]);_0x44ace7['where']=qs['filters'](_[_0x5464('0x45')](_0x3b3dbe[_0x5464('0x3a')],_0x26724e[_0x5464('0x3c')]));if(_0x336abf[_0x5464('0x38')]){if(_0x336abf['dateEnd']){_0x336abf[_0x5464('0x39')]=moment(_0x336abf[_0x5464('0x39')])[_0x5464('0x46')](0x1,_0x5464('0x47'));}else{_0x336abf[_0x5464('0x39')]=moment(_0x336abf[_0x5464('0x38')])[_0x5464('0x46')](0x1,'day');}_[_0x5464('0x48')](_0x44ace7['where'],{'createdAt':{'$gte':_0x336abf[_0x5464('0x38')],'$lte':_0x336abf[_0x5464('0x39')]}});}if(_0x3b3dbe[_0x5464('0x3a')]['filter']){_0x44ace7['where']=_[_0x5464('0x48')](_0x44ace7[_0x5464('0x49')],{'$or':_[_0x5464('0x4a')](_0x2d9270,function(_0x2daca2){if(_0x2daca2[_0x5464('0x4b')][_0x5464('0x4c')]!==_0x5464('0x4d')){var _0x8b4c07={};_0x8b4c07[_0x2daca2[_0x5464('0x4e')]]={'$like':'%'+_0x3b3dbe[_0x5464('0x3a')][_0x5464('0x4f')]+'%'};return _0x8b4c07;}})});}_0x44ace7=_[_0x5464('0x48')]({},_0x44ace7,_0x3b3dbe['options']);var _0x590fc3={'where':_0x44ace7[_0x5464('0x49')]};return db[_0x5464('0x50')][_0x5464('0x27')](_0x590fc3)[_0x5464('0x1b')](function(_0x478214){_0x4ba8f6['count']=_0x478214;if(_0x3b3dbe['query'][_0x5464('0x51')]){_0x44ace7[_0x5464('0x52')]=[{'all':!![]}];}return db[_0x5464('0x50')]['findAll'](_0x44ace7);})[_0x5464('0x1b')](function(_0x2ef41f){_0x4ba8f6[_0x5464('0x53')]=_0x2ef41f;return _0x4ba8f6;})[_0x5464('0x1b')](respondWithFilteredResult(_0x12d9e6,_0x44ace7))['catch'](handleError(_0x12d9e6,null));};exports[_0x5464('0x54')]=function(_0x493cdc,_0x410bb4){var _0x4c36bf={'raw':!![],'where':{'id':_0x493cdc[_0x5464('0x55')]['id']}},_0x1465f1={};_0x1465f1[_0x5464('0x37')]=_['keys'](db[_0x5464('0x50')][_0x5464('0x36')]);_0x1465f1[_0x5464('0x3a')]=_[_0x5464('0x3b')](_0x493cdc[_0x5464('0x3a')]);_0x1465f1[_0x5464('0x3c')]=_[_0x5464('0x3d')](_0x1465f1[_0x5464('0x37')],_0x1465f1[_0x5464('0x3a')]);_0x4c36bf[_0x5464('0x3e')]=_[_0x5464('0x3d')](_0x1465f1[_0x5464('0x37')],qs[_0x5464('0x3f')](_0x493cdc['query'][_0x5464('0x3f')]));_0x4c36bf['attributes']=_0x4c36bf[_0x5464('0x3e')][_0x5464('0x40')]?_0x4c36bf['attributes']:_0x1465f1[_0x5464('0x37')];if(_0x493cdc[_0x5464('0x3a')]['includeAll']){_0x4c36bf['include']=[{'all':!![]}];}_0x4c36bf=_[_0x5464('0x48')]({},_0x4c36bf,_0x493cdc['options']);return db['ChatQueue'][_0x5464('0x56')](_0x4c36bf)[_0x5464('0x1b')](handleEntityNotFound(_0x410bb4,null))[_0x5464('0x1b')](respondWithResult(_0x410bb4,null))['catch'](handleError(_0x410bb4,null));};exports[_0x5464('0x57')]=function(_0xf9674d,_0x5820c0){return db[_0x5464('0x50')][_0x5464('0x57')](_0xf9674d[_0x5464('0x58')],{})[_0x5464('0x1b')](function(_0xb6a137){var _0x3b4d42=_0xf9674d['user'][_0x5464('0x2f')]({'plain':!![]});if(!_0x3b4d42)throw new Error(_0x5464('0x59'));if(_0x3b4d42[_0x5464('0x5a')]==='user'){var _0x55a4ad=_0xb6a137[_0x5464('0x2f')]({'plain':!![]});var _0x4a153b=_0x5464('0x30');return db[_0x5464('0x5b')][_0x5464('0x56')]({'where':{'name':_0x4a153b,'userProfileId':_0x3b4d42[_0x5464('0x5c')]},'raw':!![]})[_0x5464('0x1b')](function(_0x50da79){if(_0x50da79&&_0x50da79[_0x5464('0x5d')]===0x0){return db[_0x5464('0x31')][_0x5464('0x57')]({'name':_0x55a4ad[_0x5464('0x34')],'resourceId':_0x55a4ad['id'],'type':_0x50da79[_0x5464('0x34')],'sectionId':_0x50da79['id']},{})[_0x5464('0x1b')](function(){return _0xb6a137;});}else{return _0xb6a137;}})['catch'](function(_0x252006){logger[_0x5464('0x21')](_0x5464('0x5e'),_0x252006);throw _0x252006;});}return _0xb6a137;})[_0x5464('0x1b')](respondWithResult(_0x5820c0,0xc9))[_0x5464('0x24')](handleError(_0x5820c0,null));};exports['update']=function(_0x152a01,_0x30cd1e){if(_0x152a01[_0x5464('0x58')]['id']){delete _0x152a01['body']['id'];}return db[_0x5464('0x50')][_0x5464('0x56')]({'where':{'id':_0x152a01[_0x5464('0x55')]['id']}})[_0x5464('0x1b')](handleEntityNotFound(_0x30cd1e,null))[_0x5464('0x1b')](saveUpdates(_0x152a01[_0x5464('0x58')],null))[_0x5464('0x1b')](respondWithResult(_0x30cd1e,null))[_0x5464('0x24')](handleError(_0x30cd1e,null));};exports[_0x5464('0x2e')]=function(_0x4cb78f,_0x1c2ff1){return db[_0x5464('0x50')][_0x5464('0x56')]({'where':{'id':_0x4cb78f[_0x5464('0x55')]['id']}})[_0x5464('0x1b')](handleEntityNotFound(_0x1c2ff1,null))[_0x5464('0x1b')](removeEntity(_0x1c2ff1,null))[_0x5464('0x24')](handleError(_0x1c2ff1,null));};exports[_0x5464('0x5f')]=function(_0x23624f,_0x343a50){return db[_0x5464('0x50')][_0x5464('0x5f')]()[_0x5464('0x1b')](respondWithResult(_0x343a50,null))[_0x5464('0x24')](handleError(_0x343a50,null));};exports[_0x5464('0x60')]=function(_0x426f5f,_0x11b11f,_0x58515f){var _0x4dbb67={'raw':!![],'where':{}},_0x322942={},_0x289bb9;return db['ChatQueue'][_0x5464('0x61')]({'where':{'id':_0x426f5f[_0x5464('0x55')]['id']}})[_0x5464('0x1b')](handleEntityNotFound(_0x11b11f,null))[_0x5464('0x1b')](function(_0x5037f4){if(_0x5037f4){_0x289bb9=_0x5037f4['get']({'plain':!![]});_0x322942[_0x5464('0x37')]=_[_0x5464('0x3b')](db[_0x5464('0x62')][_0x5464('0x36')]);_0x322942[_0x5464('0x3a')]=_[_0x5464('0x3b')](_0x426f5f[_0x5464('0x3a')]);_0x322942[_0x5464('0x3c')]=_['intersection'](_0x322942[_0x5464('0x37')],_0x322942[_0x5464('0x3a')]);_0x4dbb67[_0x5464('0x3e')]=_[_0x5464('0x3d')](_0x322942[_0x5464('0x37')],qs[_0x5464('0x3f')](_0x426f5f['query'][_0x5464('0x3f')]));_0x4dbb67[_0x5464('0x3e')]=_0x4dbb67[_0x5464('0x3e')][_0x5464('0x40')]?_0x4dbb67['attributes']:_0x322942['model'];if(!_0x426f5f[_0x5464('0x3a')][_0x5464('0x41')]('nolimit')){_0x4dbb67[_0x5464('0x29')]=qs[_0x5464('0x29')](_0x426f5f[_0x5464('0x3a')][_0x5464('0x29')]);_0x4dbb67[_0x5464('0x28')]=qs['offset'](_0x426f5f[_0x5464('0x3a')][_0x5464('0x28')]);}_0x4dbb67[_0x5464('0x43')]=qs['sort'](_0x426f5f[_0x5464('0x3a')]['sort']);_0x4dbb67[_0x5464('0x49')]=qs[_0x5464('0x3c')](_[_0x5464('0x45')](_0x426f5f[_0x5464('0x3a')],_0x322942['filters']));_0x4dbb67[_0x5464('0x49')][_0x5464('0x63')]=_0x5037f4['id'];if(_0x426f5f[_0x5464('0x3a')]['filter']){_0x4dbb67[_0x5464('0x49')]=_[_0x5464('0x48')](_0x4dbb67[_0x5464('0x49')],{'$or':_[_0x5464('0x4a')](_0x4dbb67[_0x5464('0x3e')],function(_0xee0f99){var _0x1be251={};_0x1be251[_0xee0f99]={'$like':'%'+_0x426f5f['query'][_0x5464('0x4f')]+'%'};return _0x1be251;})});}_0x4dbb67=_['merge']({},_0x4dbb67,_0x426f5f[_0x5464('0x64')]);return db[_0x5464('0x62')]['findAll'](_0x4dbb67);}})[_0x5464('0x1b')](function(_0x850a0b){if(_0x850a0b){return db[_0x5464('0x65')][_0x5464('0x66')]({'where':{'id':_['map'](_0x850a0b,_0x5464('0x67')),'role':_0x5464('0x68')},'attributes':['id',_0x5464('0x34'),'chatPause',_0x5464('0x69'),'createdAt']});}})[_0x5464('0x1b')](function(_0xf04098){if(_0xf04098){return{'count':_0xf04098[_0x5464('0x27')],'rows':_[_0x5464('0x4a')](_0xf04098[_0x5464('0x53')],function(_0x1395cf){return{'membername':_0x1395cf[_0x5464('0x34')],'UserId':_0x1395cf['id'],'queue_name':_0x289bb9['name'],'ChatQueueId':_0x289bb9['id'],'interface':util[_0x5464('0x6a')](_0x5464('0x6b'),_0x5464('0x6c'),_0x1395cf[_0x5464('0x34')]),'penalty':0x0,'paused':_0x1395cf[_0x5464('0x6d')],'createdAt':_0x1395cf[_0x5464('0x6e')],'updatedAt':_0x1395cf[_0x5464('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x11b11f,_0x4dbb67))[_0x5464('0x24')](handleError(_0x11b11f,null));};exports['getTeams']=function(_0x4c315f,_0x48633a,_0x32814e){var _0x5250c2={};var _0x16e7fb={};var _0x25a979;var _0x25e7f8;return db[_0x5464('0x50')]['findOne']({'where':{'id':_0x4c315f[_0x5464('0x55')]['id']}})[_0x5464('0x1b')](handleEntityNotFound(_0x48633a,null))[_0x5464('0x1b')](function(_0x203f4d){if(_0x203f4d){_0x25a979=_0x203f4d;_0x16e7fb[_0x5464('0x37')]=_[_0x5464('0x3b')](db[_0x5464('0x6f')][_0x5464('0x36')]);_0x16e7fb[_0x5464('0x3a')]=_['keys'](_0x4c315f[_0x5464('0x3a')]);_0x16e7fb[_0x5464('0x3c')]=_['intersection'](_0x16e7fb['model'],_0x16e7fb['query']);_0x5250c2[_0x5464('0x3e')]=_[_0x5464('0x3d')](_0x16e7fb['model'],qs[_0x5464('0x3f')](_0x4c315f['query'][_0x5464('0x3f')]));_0x5250c2['attributes']=_0x5250c2[_0x5464('0x3e')][_0x5464('0x40')]?_0x5250c2[_0x5464('0x3e')]:_0x16e7fb[_0x5464('0x37')];_0x5250c2[_0x5464('0x43')]=qs[_0x5464('0x44')](_0x4c315f['query'][_0x5464('0x44')]);_0x5250c2[_0x5464('0x49')]=qs['filters'](_[_0x5464('0x45')](_0x4c315f[_0x5464('0x3a')],_0x16e7fb[_0x5464('0x3c')]));if(_0x4c315f['query'][_0x5464('0x4f')]){_0x5250c2[_0x5464('0x49')]=_[_0x5464('0x48')](_0x5250c2['where'],{'$or':_[_0x5464('0x4a')](_0x5250c2[_0x5464('0x3e')],function(_0x396d9f){var _0x4178dc={};_0x4178dc[_0x396d9f]={'$like':'%'+_0x4c315f[_0x5464('0x3a')][_0x5464('0x4f')]+'%'};return _0x4178dc;})});}_0x5250c2=_[_0x5464('0x48')]({},_0x5250c2,_0x4c315f['options']);return _0x25a979[_0x5464('0x70')](_0x5250c2);}})[_0x5464('0x1b')](function(_0x55762a){if(_0x55762a){_0x25e7f8=_0x55762a[_0x5464('0x40')];if(!_0x4c315f[_0x5464('0x3a')][_0x5464('0x41')](_0x5464('0x42'))){_0x5250c2[_0x5464('0x29')]=qs[_0x5464('0x29')](_0x4c315f[_0x5464('0x3a')][_0x5464('0x29')]);_0x5250c2[_0x5464('0x28')]=qs[_0x5464('0x28')](_0x4c315f[_0x5464('0x3a')][_0x5464('0x28')]);}return _0x25a979[_0x5464('0x70')](_0x5250c2);}})[_0x5464('0x1b')](function(_0x3951e7){if(_0x3951e7){return _0x3951e7?{'count':_0x25e7f8,'rows':_0x3951e7}:null;}})[_0x5464('0x1b')](respondWithResult(_0x48633a,null))[_0x5464('0x24')](handleError(_0x48633a,null));};exports[_0x5464('0x71')]=function(_0x108da2,_0x46fcf5,_0x35235a){var _0x4513ab=[];var _0x3cc8d5;return db[_0x5464('0x6f')][_0x5464('0x72')]({'where':{'id':_0x108da2[_0x5464('0x58')][_0x5464('0x73')]},'attributes':['id'],'include':[{'model':db[_0x5464('0x65')],'as':_0x5464('0x74'),'attributes':['id'],'raw':!![]}]})[_0x5464('0x1b')](function(_0x3cd133){if(_0x3cd133){for(var _0x4f324d=0x0;_0x4f324d<_0x3cd133[_0x5464('0x40')];_0x4f324d+=0x1){for(var _0x18bf28=0x0;_0x18bf28<_0x3cd133[_0x4f324d]['Agents'][_0x5464('0x40')];_0x18bf28+=0x1){_0x4513ab=_[_0x5464('0x75')](_0x4513ab,[_0x3cd133[_0x4f324d][_0x5464('0x74')][_0x18bf28]['id']]);}}return _0x4513ab;}})[_0x5464('0x1b')](function(_0x555a5b){if(_0x555a5b){return db[_0x5464('0x50')][_0x5464('0x56')]({'where':{'id':_0x108da2['params']['id']}});}})['then'](function(_0x2eb8f2){if(_0x2eb8f2){_0x3cc8d5=_0x2eb8f2;return _0x3cc8d5[_0x5464('0x76')](_0x4513ab,{'penalty':_0x108da2[_0x5464('0x58')][_0x5464('0x77')]});}})[_0x5464('0x1b')](function(_0x47c40a){if(_0x47c40a){return _0x3cc8d5[_0x5464('0x71')](_0x108da2[_0x5464('0x58')]['ids']);}})[_0x5464('0x1b')](handleEntityNotFound(_0x46fcf5,null))[_0x5464('0x1b')](respondWithStatusCode(_0x46fcf5,null))['catch'](handleError(_0x46fcf5,null));};exports[_0x5464('0x78')]=function(_0x5f4a27,_0x15f03c,_0x2f4c83){var _0x33392a=[];var _0x491011;return db[_0x5464('0x6f')][_0x5464('0x72')]({'where':{'id':_0x5f4a27[_0x5464('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5464('0x65')],'as':_0x5464('0x74'),'attributes':['id'],'raw':!![]}]})[_0x5464('0x1b')](function(_0x20bdf5){if(_0x20bdf5){for(var _0x4585ee=0x0;_0x4585ee<_0x20bdf5['length'];_0x4585ee+=0x1){for(var _0x1a8791=0x0;_0x1a8791<_0x20bdf5[_0x4585ee][_0x5464('0x74')]['length'];_0x1a8791+=0x1){_0x33392a=_['union'](_0x33392a,[_0x20bdf5[_0x4585ee][_0x5464('0x74')][_0x1a8791]['id']]);}}return _0x33392a;}})[_0x5464('0x1b')](function(_0x5b111f){if(_0x5b111f){return db['ChatQueue'][_0x5464('0x56')]({'where':{'id':_0x5f4a27[_0x5464('0x55')]['id']}});}})[_0x5464('0x1b')](function(_0x4068b1){if(_0x4068b1){_0x491011=_0x4068b1;return _0x491011[_0x5464('0x79')](_0x33392a);}})['then'](function(_0x53aac5){if(_0x491011){return _0x491011['removeTeams'](_0x5f4a27[_0x5464('0x3a')][_0x5464('0x73')]);}})['then'](handleEntityNotFound(_0x15f03c,null))['then'](respondWithStatusCode(_0x15f03c,null))[_0x5464('0x24')](handleError(_0x15f03c,null));};exports[_0x5464('0x76')]=function(_0x5734ad,_0x569106,_0x2b82c8){return db[_0x5464('0x50')][_0x5464('0x56')]({'where':{'id':_0x5734ad[_0x5464('0x55')]['id']}})['then'](handleEntityNotFound(_0x569106,null))[_0x5464('0x1b')](function(_0x292703){if(_0x292703){return _0x292703['addAgents'](_0x5734ad[_0x5464('0x58')][_0x5464('0x73')],_[_0x5464('0x7a')](_0x5734ad[_0x5464('0x58')],['ids','id'])||{})[_0x5464('0x7b')](function(_0x3f3a7b){for(var _0x3701b3=0x0;_0x3701b3<_0x5734ad[_0x5464('0x58')][_0x5464('0x73')][_0x5464('0x40')];_0x3701b3+=0x1){socket['emit'](_0x5464('0x7c'),{'UserId':_0x5734ad['body'][_0x5464('0x73')][_0x3701b3],'ChatQueueId':_0x5734ad['params']['id']});}return _0x3f3a7b;});}})[_0x5464('0x1b')](respondWithResult(_0x569106,null))[_0x5464('0x24')](handleError(_0x569106,null));};exports[_0x5464('0x79')]=function(_0x5919a7,_0x52382c,_0x37d252){var _0x4d0908;return db[_0x5464('0x50')]['find']({'where':{'id':_0x5919a7['params']['id']}})[_0x5464('0x1b')](handleEntityNotFound(_0x52382c,null))[_0x5464('0x1b')](function(_0x36c60f){if(_0x36c60f){return _0x36c60f[_0x5464('0x79')](_0x5919a7['query'][_0x5464('0x73')])[_0x5464('0x1b')](function(_0x557d44){if(_[_0x5464('0x7d')](_0x5919a7[_0x5464('0x3a')][_0x5464('0x73')])){for(var _0x24edcf=0x0;_0x24edcf<_0x5919a7[_0x5464('0x3a')][_0x5464('0x73')][_0x5464('0x40')];_0x24edcf+=0x1){socket[_0x5464('0x7e')]('userChatQueue:remove',{'UserId':_0x5919a7[_0x5464('0x3a')][_0x5464('0x73')][_0x24edcf],'ChatQueueId':_0x5919a7[_0x5464('0x55')]['id']});}}else{socket['emit'](_0x5464('0x7f'),{'UserId':_0x5919a7['query'][_0x5464('0x73')],'ChatQueueId':_0x5919a7[_0x5464('0x55')]['id']});}});}})[_0x5464('0x1b')](respondWithStatusCode(_0x52382c,null))[_0x5464('0x24')](handleError(_0x52382c,null));};exports[_0x5464('0x80')]=function(_0x1f9ce7,_0x3e2b8d,_0x505944){var _0xd765fa={};var _0x4ab675={};var _0x4fbb89;var _0x1d29cf;return db['ChatQueue']['findOne']({'where':{'id':_0x1f9ce7[_0x5464('0x55')]['id']}})[_0x5464('0x1b')](handleEntityNotFound(_0x3e2b8d,null))[_0x5464('0x1b')](function(_0x2e2e93){if(_0x2e2e93){_0x4fbb89=_0x2e2e93;_0x4ab675[_0x5464('0x37')]=_[_0x5464('0x3b')](db[_0x5464('0x65')][_0x5464('0x36')]);_0x4ab675[_0x5464('0x3a')]=_[_0x5464('0x3b')](_0x1f9ce7[_0x5464('0x3a')]);_0x4ab675[_0x5464('0x3c')]=_[_0x5464('0x3d')](_0x4ab675[_0x5464('0x37')],_0x4ab675['query']);_0xd765fa['attributes']=_[_0x5464('0x3d')](_0x4ab675[_0x5464('0x37')],qs[_0x5464('0x3f')](_0x1f9ce7['query'][_0x5464('0x3f')]));_0xd765fa[_0x5464('0x3e')]=_0xd765fa[_0x5464('0x3e')][_0x5464('0x40')]?_0xd765fa['attributes']:_0x4ab675[_0x5464('0x37')];_0xd765fa[_0x5464('0x43')]=qs['sort'](_0x1f9ce7[_0x5464('0x3a')]['sort']);_0xd765fa[_0x5464('0x49')]=qs['filters'](_[_0x5464('0x45')](_0x1f9ce7[_0x5464('0x3a')],_0x4ab675[_0x5464('0x3c')]));if(_0x1f9ce7[_0x5464('0x3a')]['filter']){_0xd765fa[_0x5464('0x49')]=_[_0x5464('0x48')](_0xd765fa[_0x5464('0x49')],{'$or':_['map'](_0xd765fa[_0x5464('0x3e')],function(_0x597aff){var _0x4de5f8={};_0x4de5f8[_0x597aff]={'$like':'%'+_0x1f9ce7[_0x5464('0x3a')][_0x5464('0x4f')]+'%'};return _0x4de5f8;})});}_0xd765fa=_[_0x5464('0x48')]({},_0xd765fa,_0x1f9ce7['options']);return _0x4fbb89[_0x5464('0x80')](_0xd765fa);}})[_0x5464('0x1b')](function(_0x4b5404){if(_0x4b5404){_0x1d29cf=_0x4b5404['length'];if(!_0x1f9ce7[_0x5464('0x3a')][_0x5464('0x41')](_0x5464('0x42'))){_0xd765fa['limit']=qs[_0x5464('0x29')](_0x1f9ce7[_0x5464('0x3a')][_0x5464('0x29')]);_0xd765fa[_0x5464('0x28')]=qs[_0x5464('0x28')](_0x1f9ce7[_0x5464('0x3a')][_0x5464('0x28')]);}return _0x4fbb89['getAgents'](_0xd765fa);}})[_0x5464('0x1b')](function(_0x4c2ba0){if(_0x4c2ba0){return _0x4c2ba0?{'count':_0x1d29cf,'rows':_0x4c2ba0}:null;}})[_0x5464('0x1b')](respondWithResult(_0x3e2b8d,null))[_0x5464('0x24')](handleError(_0x3e2b8d,null));};
\ No newline at end of file
+var _0x593f=['stringify','error','message','info','result','sendStatus','json','count','offset','set','apply','save','update','get','destroy','status','end','stack','name','index','ChatQueue','rawAttributes','query','dateStart','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','dateEnd','add','day','merge','filter','map','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','rows','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','union','addAgents','penalty','removeTeams','User','removeAgents','spread','userChatQueue:save','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x593f,0xd8));var _0xf593=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x593f[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf593('0x0'));var rimraf=require(_0xf593('0x1'));var zipdir=require(_0xf593('0x2'));var jsonpatch=require(_0xf593('0x3'));var rp=require(_0xf593('0x4'));var moment=require('moment');var BPromise=require(_0xf593('0x5'));var Mustache=require(_0xf593('0x6'));var util=require(_0xf593('0x7'));var path=require(_0xf593('0x8'));var sox=require('sox');var csv=require(_0xf593('0x9'));var ejs=require(_0xf593('0xa'));var fs=require('fs');var _=require(_0xf593('0xb'));var squel=require(_0xf593('0xc'));var crypto=require(_0xf593('0xd'));var jsforce=require(_0xf593('0xe'));var deskjs=require(_0xf593('0xf'));var toCsv=require(_0xf593('0x9'));var querystring=require(_0xf593('0x10'));var Papa=require(_0xf593('0x11'));var Redis=require(_0xf593('0x12'));var qs=require(_0xf593('0x13'));var logger=require(_0xf593('0x14'))('api');var utils=require(_0xf593('0x15'));var config=require(_0xf593('0x16'));var db=require(_0xf593('0x17'))['db'];config[_0xf593('0x18')]=_['defaults'](config[_0xf593('0x18')],{'host':_0xf593('0x19'),'port':0x18eb});var socket=require(_0xf593('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xf593('0x1b')](socket);var jayson=require(_0xf593('0x1c'));var client=jayson[_0xf593('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0xec254d,_0x2959d4,_0x280b98,_0x1dbf61){return new BPromise(function(_0x16efd8,_0x2e1c16){var _0x3a555e=_0x1dbf61||client;return _0x3a555e[_0xf593('0x1e')](_0xec254d,_0x280b98)[_0xf593('0x1f')](function(_0x5f21fd){logger['info'](_0xf593('0x20'),_0x2959d4,_0xf593('0x21'));logger[_0xf593('0x22')](_0xf593('0x23'),_0x2959d4,_0xf593('0x21'),JSON[_0xf593('0x24')](_0x5f21fd));if(_0x5f21fd[_0xf593('0x25')]){if(_0x5f21fd[_0xf593('0x25')]['code']===0x1f4){logger[_0xf593('0x25')](_0xf593('0x20'),_0x2959d4,_0x5f21fd[_0xf593('0x25')][_0xf593('0x26')]);return _0x2e1c16(_0x5f21fd[_0xf593('0x25')]['message']);}logger[_0xf593('0x25')](_0xf593('0x20'),_0x2959d4,_0x5f21fd[_0xf593('0x25')]['message']);return _0x16efd8(_0x5f21fd['error']['message']);}else{logger[_0xf593('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2959d4,_0xf593('0x21'));_0x16efd8(_0x5f21fd[_0xf593('0x28')][_0xf593('0x26')]);}})['catch'](function(_0x1bdd64){logger[_0xf593('0x25')](_0xf593('0x20'),_0x2959d4,_0x1bdd64);_0x2e1c16(_0x1bdd64);});});}function respondWithStatusCode(_0x58c505,_0x1e2706){_0x1e2706=_0x1e2706||0xcc;return function(_0x236126){if(_0x236126){return _0x58c505[_0xf593('0x29')](_0x1e2706);}return _0x58c505['status'](_0x1e2706)['end']();};}function respondWithResult(_0x4b0317,_0x42457d){_0x42457d=_0x42457d||0xc8;return function(_0x594e2c){if(_0x594e2c){return _0x4b0317['status'](_0x42457d)[_0xf593('0x2a')](_0x594e2c);}};}function respondWithFilteredResult(_0x58bc06,_0x2d5772){return function(_0x52ca53){if(_0x52ca53){var _0x36b78f=_0x52ca53[_0xf593('0x2b')],_0x11c57e=_0x2d5772[_0xf593('0x2c')],_0x2eff94=_0x2d5772[_0xf593('0x2c')]+_0x2d5772['limit'],_0x4039d8;if(_0x2eff94>=_0x36b78f){_0x2eff94=_0x36b78f;_0x4039d8=0xc8;}else{_0x4039d8=0xce;}_0x58bc06['status'](_0x4039d8);return _0x58bc06[_0xf593('0x2d')]('Content-Range',_0x11c57e+'-'+_0x2eff94+'/'+_0x36b78f)[_0xf593('0x2a')](_0x52ca53);}return null;};}function patchUpdates(_0x1cb5c2){return function(_0x5d9bb4){try{jsonpatch[_0xf593('0x2e')](_0x5d9bb4,_0x1cb5c2,!![]);}catch(_0xd03f19){return BPromise['reject'](_0xd03f19);}return _0x5d9bb4[_0xf593('0x2f')]();};}function saveUpdates(_0x2a3bc4,_0x5f1d29){return function(_0x47825a){if(_0x47825a){return _0x47825a[_0xf593('0x30')](_0x2a3bc4)[_0xf593('0x1f')](function(_0x51cd75){return _0x51cd75;});}return null;};}function removeEntity(_0x5c6f57,_0x2f2aae){return function(_0x1fe11a){if(_0x1fe11a){return _0x1fe11a['destroy']()[_0xf593('0x1f')](function(){var _0x33e2e4=_0x1fe11a[_0xf593('0x31')]({'plain':!![]});var _0x2e3131='ChatQueues';return db['UserProfileResource'][_0xf593('0x32')]({'where':{'type':_0x2e3131,'resourceId':_0x33e2e4['id']}})[_0xf593('0x1f')](function(){return _0x1fe11a;});})['then'](function(){_0x5c6f57[_0xf593('0x33')](0xcc)[_0xf593('0x34')]();});}};}function handleEntityNotFound(_0x37de09,_0xada7cd){return function(_0x5228b6){if(!_0x5228b6){_0x37de09[_0xf593('0x29')](0x194);}return _0x5228b6;};}function handleError(_0x2b1e81,_0x1b32cd){_0x1b32cd=_0x1b32cd||0x1f4;return function(_0x4c62ef){logger[_0xf593('0x25')](_0x4c62ef[_0xf593('0x35')]);if(_0x4c62ef[_0xf593('0x36')]){delete _0x4c62ef[_0xf593('0x36')];}_0x2b1e81['status'](_0x1b32cd)['send'](_0x4c62ef);};}exports[_0xf593('0x37')]=function(_0x1ac9ef,_0x130819){var _0x2f46d4={},_0x34a1ac={},_0x411b6e={'count':0x0,'rows':[]};var _0x54561b=db[_0xf593('0x38')][_0xf593('0x39')];_0x34a1ac['model']=_['keys'](_0x54561b);var _0x589c12={'dateStart':_0x1ac9ef[_0xf593('0x3a')][_0xf593('0x3b')],'dateEnd':_0x1ac9ef[_0xf593('0x3a')]['dateEnd']};delete _0x1ac9ef[_0xf593('0x3a')][_0xf593('0x3b')];delete _0x1ac9ef[_0xf593('0x3a')]['dateEnd'];_0x34a1ac[_0xf593('0x3a')]=_['keys'](_0x1ac9ef[_0xf593('0x3a')]);_0x34a1ac[_0xf593('0x3c')]=_['intersection'](_0x34a1ac[_0xf593('0x3d')],_0x34a1ac[_0xf593('0x3a')]);_0x2f46d4[_0xf593('0x3e')]=_[_0xf593('0x3f')](_0x34a1ac[_0xf593('0x3d')],qs['fields'](_0x1ac9ef['query'][_0xf593('0x40')]));_0x2f46d4[_0xf593('0x3e')]=_0x2f46d4[_0xf593('0x3e')][_0xf593('0x41')]?_0x2f46d4[_0xf593('0x3e')]:_0x34a1ac[_0xf593('0x3d')];if(!_0x1ac9ef[_0xf593('0x3a')][_0xf593('0x42')](_0xf593('0x43'))){_0x2f46d4['limit']=qs[_0xf593('0x44')](_0x1ac9ef[_0xf593('0x3a')][_0xf593('0x44')]);_0x2f46d4[_0xf593('0x2c')]=qs[_0xf593('0x2c')](_0x1ac9ef[_0xf593('0x3a')][_0xf593('0x2c')]);}_0x2f46d4[_0xf593('0x45')]=qs[_0xf593('0x46')](_0x1ac9ef[_0xf593('0x3a')]['sort']);_0x2f46d4[_0xf593('0x47')]=qs[_0xf593('0x3c')](_[_0xf593('0x48')](_0x1ac9ef[_0xf593('0x3a')],_0x34a1ac[_0xf593('0x3c')]));if(_0x589c12['dateStart']){if(_0x589c12[_0xf593('0x49')]){_0x589c12[_0xf593('0x49')]=moment(_0x589c12[_0xf593('0x49')])['add'](0x1,'day');}else{_0x589c12[_0xf593('0x49')]=moment(_0x589c12[_0xf593('0x3b')])[_0xf593('0x4a')](0x1,_0xf593('0x4b'));}_[_0xf593('0x4c')](_0x2f46d4['where'],{'createdAt':{'$gte':_0x589c12[_0xf593('0x3b')],'$lte':_0x589c12[_0xf593('0x49')]}});}if(_0x1ac9ef[_0xf593('0x3a')][_0xf593('0x4d')]){_0x2f46d4['where']=_[_0xf593('0x4c')](_0x2f46d4[_0xf593('0x47')],{'$or':_[_0xf593('0x4e')](_0x54561b,function(_0x128c65){if(_0x128c65['type'][_0xf593('0x4f')]!==_0xf593('0x50')){var _0x5c20da={};_0x5c20da[_0x128c65['field']]={'$like':'%'+_0x1ac9ef[_0xf593('0x3a')][_0xf593('0x4d')]+'%'};return _0x5c20da;}})});}_0x2f46d4=_[_0xf593('0x4c')]({},_0x2f46d4,_0x1ac9ef[_0xf593('0x51')]);var _0x12ed66={'where':_0x2f46d4[_0xf593('0x47')]};return db[_0xf593('0x38')][_0xf593('0x2b')](_0x12ed66)[_0xf593('0x1f')](function(_0x36fb4a){_0x411b6e[_0xf593('0x2b')]=_0x36fb4a;if(_0x1ac9ef['query'][_0xf593('0x52')]){_0x2f46d4[_0xf593('0x53')]=[{'all':!![]}];}return db[_0xf593('0x38')][_0xf593('0x54')](_0x2f46d4);})[_0xf593('0x1f')](function(_0x1c6f32){_0x411b6e['rows']=_0x1c6f32;return _0x411b6e;})[_0xf593('0x1f')](respondWithFilteredResult(_0x130819,_0x2f46d4))[_0xf593('0x55')](handleError(_0x130819,null));};exports[_0xf593('0x56')]=function(_0x2a3990,_0xa1a6c5){var _0x538f16={'raw':!![],'where':{'id':_0x2a3990[_0xf593('0x57')]['id']}},_0x67bada={};_0x67bada[_0xf593('0x3d')]=_[_0xf593('0x58')](db['ChatQueue']['rawAttributes']);_0x67bada[_0xf593('0x3a')]=_[_0xf593('0x58')](_0x2a3990[_0xf593('0x3a')]);_0x67bada[_0xf593('0x3c')]=_['intersection'](_0x67bada[_0xf593('0x3d')],_0x67bada[_0xf593('0x3a')]);_0x538f16[_0xf593('0x3e')]=_['intersection'](_0x67bada[_0xf593('0x3d')],qs['fields'](_0x2a3990[_0xf593('0x3a')][_0xf593('0x40')]));_0x538f16['attributes']=_0x538f16[_0xf593('0x3e')][_0xf593('0x41')]?_0x538f16[_0xf593('0x3e')]:_0x67bada[_0xf593('0x3d')];if(_0x2a3990[_0xf593('0x3a')]['includeAll']){_0x538f16['include']=[{'all':!![]}];}_0x538f16=_['merge']({},_0x538f16,_0x2a3990[_0xf593('0x51')]);return db[_0xf593('0x38')]['find'](_0x538f16)[_0xf593('0x1f')](handleEntityNotFound(_0xa1a6c5,null))['then'](respondWithResult(_0xa1a6c5,null))[_0xf593('0x55')](handleError(_0xa1a6c5,null));};exports[_0xf593('0x59')]=function(_0x333759,_0x56d798){return db[_0xf593('0x38')][_0xf593('0x59')](_0x333759[_0xf593('0x5a')],{})[_0xf593('0x1f')](function(_0x52b52c){var _0x49ee14=_0x333759['user'][_0xf593('0x31')]({'plain':!![]});if(!_0x49ee14)throw new Error(_0xf593('0x5b'));if(_0x49ee14[_0xf593('0x5c')]==='user'){var _0x196ccf=_0x52b52c[_0xf593('0x31')]({'plain':!![]});var _0x598d2d='ChatQueues';return db['UserProfileSection'][_0xf593('0x5d')]({'where':{'name':_0x598d2d,'userProfileId':_0x49ee14[_0xf593('0x5e')]},'raw':!![]})[_0xf593('0x1f')](function(_0x3cb5f8){if(_0x3cb5f8&&_0x3cb5f8[_0xf593('0x5f')]===0x0){return db[_0xf593('0x60')]['create']({'name':_0x196ccf[_0xf593('0x36')],'resourceId':_0x196ccf['id'],'type':_0x3cb5f8['name'],'sectionId':_0x3cb5f8['id']},{})[_0xf593('0x1f')](function(){return _0x52b52c;});}else{return _0x52b52c;}})['catch'](function(_0x18bd2e){logger['error'](_0xf593('0x61'),_0x18bd2e);throw _0x18bd2e;});}return _0x52b52c;})[_0xf593('0x1f')](respondWithResult(_0x56d798,0xc9))['catch'](handleError(_0x56d798,null));};exports[_0xf593('0x30')]=function(_0x2b7345,_0x5dfd8f){if(_0x2b7345[_0xf593('0x5a')]['id']){delete _0x2b7345[_0xf593('0x5a')]['id'];}return db[_0xf593('0x38')][_0xf593('0x5d')]({'where':{'id':_0x2b7345[_0xf593('0x57')]['id']}})[_0xf593('0x1f')](handleEntityNotFound(_0x5dfd8f,null))[_0xf593('0x1f')](saveUpdates(_0x2b7345[_0xf593('0x5a')],null))[_0xf593('0x1f')](respondWithResult(_0x5dfd8f,null))['catch'](handleError(_0x5dfd8f,null));};exports['destroy']=function(_0x30b7af,_0x2a3cb4){return db['ChatQueue'][_0xf593('0x5d')]({'where':{'id':_0x30b7af[_0xf593('0x57')]['id']}})[_0xf593('0x1f')](handleEntityNotFound(_0x2a3cb4,null))[_0xf593('0x1f')](removeEntity(_0x2a3cb4,null))[_0xf593('0x55')](handleError(_0x2a3cb4,null));};exports[_0xf593('0x62')]=function(_0x556e91,_0x5a2fca){return db[_0xf593('0x38')][_0xf593('0x62')]()[_0xf593('0x1f')](respondWithResult(_0x5a2fca,null))[_0xf593('0x55')](handleError(_0x5a2fca,null));};exports[_0xf593('0x63')]=function(_0xa5059d,_0x2822af,_0x4785ff){var _0x767133={'raw':!![],'where':{}},_0x156c4f={},_0x8a2f24;return db['ChatQueue'][_0xf593('0x64')]({'where':{'id':_0xa5059d['params']['id']}})['then'](handleEntityNotFound(_0x2822af,null))[_0xf593('0x1f')](function(_0x83571){if(_0x83571){_0x8a2f24=_0x83571[_0xf593('0x31')]({'plain':!![]});_0x156c4f[_0xf593('0x3d')]=_[_0xf593('0x58')](db[_0xf593('0x65')][_0xf593('0x39')]);_0x156c4f[_0xf593('0x3a')]=_[_0xf593('0x58')](_0xa5059d[_0xf593('0x3a')]);_0x156c4f[_0xf593('0x3c')]=_[_0xf593('0x3f')](_0x156c4f['model'],_0x156c4f[_0xf593('0x3a')]);_0x767133['attributes']=_[_0xf593('0x3f')](_0x156c4f[_0xf593('0x3d')],qs[_0xf593('0x40')](_0xa5059d[_0xf593('0x3a')]['fields']));_0x767133[_0xf593('0x3e')]=_0x767133[_0xf593('0x3e')][_0xf593('0x41')]?_0x767133[_0xf593('0x3e')]:_0x156c4f[_0xf593('0x3d')];if(!_0xa5059d[_0xf593('0x3a')][_0xf593('0x42')](_0xf593('0x43'))){_0x767133[_0xf593('0x44')]=qs[_0xf593('0x44')](_0xa5059d[_0xf593('0x3a')][_0xf593('0x44')]);_0x767133['offset']=qs[_0xf593('0x2c')](_0xa5059d[_0xf593('0x3a')][_0xf593('0x2c')]);}_0x767133[_0xf593('0x45')]=qs[_0xf593('0x46')](_0xa5059d[_0xf593('0x3a')]['sort']);_0x767133[_0xf593('0x47')]=qs['filters'](_[_0xf593('0x48')](_0xa5059d[_0xf593('0x3a')],_0x156c4f[_0xf593('0x3c')]));_0x767133['where'][_0xf593('0x66')]=_0x83571['id'];if(_0xa5059d['query'][_0xf593('0x4d')]){_0x767133[_0xf593('0x47')]=_['merge'](_0x767133[_0xf593('0x47')],{'$or':_[_0xf593('0x4e')](_0x767133[_0xf593('0x3e')],function(_0x16349e){var _0x45ac79={};_0x45ac79[_0x16349e]={'$like':'%'+_0xa5059d['query'][_0xf593('0x4d')]+'%'};return _0x45ac79;})});}_0x767133=_[_0xf593('0x4c')]({},_0x767133,_0xa5059d['options']);return db[_0xf593('0x65')][_0xf593('0x54')](_0x767133);}})[_0xf593('0x1f')](function(_0x412707){if(_0x412707){return db['User'][_0xf593('0x67')]({'where':{'id':_[_0xf593('0x4e')](_0x412707,_0xf593('0x68')),'role':_0xf593('0x69')},'attributes':['id','name',_0xf593('0x6a'),_0xf593('0x6b'),'createdAt']});}})[_0xf593('0x1f')](function(_0x5a5ee1){if(_0x5a5ee1){return{'count':_0x5a5ee1[_0xf593('0x2b')],'rows':_['map'](_0x5a5ee1[_0xf593('0x6c')],function(_0x1cb05e){return{'membername':_0x1cb05e[_0xf593('0x36')],'UserId':_0x1cb05e['id'],'queue_name':_0x8a2f24[_0xf593('0x36')],'ChatQueueId':_0x8a2f24['id'],'interface':util['format'](_0xf593('0x6d'),_0xf593('0x6e'),_0x1cb05e[_0xf593('0x36')]),'penalty':0x0,'paused':_0x1cb05e[_0xf593('0x6a')],'createdAt':_0x1cb05e['createdAt'],'updatedAt':_0x1cb05e[_0xf593('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf593('0x1f')](respondWithFilteredResult(_0x2822af,_0x767133))[_0xf593('0x55')](handleError(_0x2822af,null));};exports['getTeams']=function(_0x4af3ca,_0xa6ef75,_0x2ad278){var _0x523e9a={};var _0x2e9624={};var _0x61ff2;var _0x5b03aa;return db[_0xf593('0x38')][_0xf593('0x64')]({'where':{'id':_0x4af3ca[_0xf593('0x57')]['id']}})['then'](handleEntityNotFound(_0xa6ef75,null))[_0xf593('0x1f')](function(_0x24f055){if(_0x24f055){_0x61ff2=_0x24f055;_0x2e9624[_0xf593('0x3d')]=_[_0xf593('0x58')](db[_0xf593('0x6f')][_0xf593('0x39')]);_0x2e9624[_0xf593('0x3a')]=_['keys'](_0x4af3ca['query']);_0x2e9624['filters']=_[_0xf593('0x3f')](_0x2e9624[_0xf593('0x3d')],_0x2e9624['query']);_0x523e9a[_0xf593('0x3e')]=_['intersection'](_0x2e9624[_0xf593('0x3d')],qs['fields'](_0x4af3ca[_0xf593('0x3a')][_0xf593('0x40')]));_0x523e9a[_0xf593('0x3e')]=_0x523e9a[_0xf593('0x3e')][_0xf593('0x41')]?_0x523e9a['attributes']:_0x2e9624[_0xf593('0x3d')];_0x523e9a['order']=qs[_0xf593('0x46')](_0x4af3ca[_0xf593('0x3a')][_0xf593('0x46')]);_0x523e9a[_0xf593('0x47')]=qs[_0xf593('0x3c')](_['pick'](_0x4af3ca[_0xf593('0x3a')],_0x2e9624[_0xf593('0x3c')]));if(_0x4af3ca[_0xf593('0x3a')]['filter']){_0x523e9a[_0xf593('0x47')]=_[_0xf593('0x4c')](_0x523e9a[_0xf593('0x47')],{'$or':_[_0xf593('0x4e')](_0x523e9a['attributes'],function(_0x101b24){var _0x8419e1={};_0x8419e1[_0x101b24]={'$like':'%'+_0x4af3ca[_0xf593('0x3a')][_0xf593('0x4d')]+'%'};return _0x8419e1;})});}_0x523e9a=_['merge']({},_0x523e9a,_0x4af3ca['options']);return _0x61ff2[_0xf593('0x70')](_0x523e9a);}})[_0xf593('0x1f')](function(_0x1d4d9b){if(_0x1d4d9b){_0x5b03aa=_0x1d4d9b[_0xf593('0x41')];if(!_0x4af3ca[_0xf593('0x3a')][_0xf593('0x42')](_0xf593('0x43'))){_0x523e9a['limit']=qs['limit'](_0x4af3ca[_0xf593('0x3a')][_0xf593('0x44')]);_0x523e9a['offset']=qs[_0xf593('0x2c')](_0x4af3ca['query']['offset']);}return _0x61ff2[_0xf593('0x70')](_0x523e9a);}})[_0xf593('0x1f')](function(_0x324cc6){if(_0x324cc6){return _0x324cc6?{'count':_0x5b03aa,'rows':_0x324cc6}:null;}})[_0xf593('0x1f')](respondWithResult(_0xa6ef75,null))['catch'](handleError(_0xa6ef75,null));};exports[_0xf593('0x71')]=function(_0x43e0e4,_0x4179e3,_0x1c5b6a){var _0x34203b=[];var _0x4235d1;return db[_0xf593('0x6f')][_0xf593('0x54')]({'where':{'id':_0x43e0e4['body'][_0xf593('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf593('0x1f')](function(_0xbffff7){if(_0xbffff7){for(var _0x3d1b16=0x0;_0x3d1b16<_0xbffff7['length'];_0x3d1b16+=0x1){for(var _0x251a37=0x0;_0x251a37<_0xbffff7[_0x3d1b16][_0xf593('0x73')][_0xf593('0x41')];_0x251a37+=0x1){_0x34203b=_[_0xf593('0x74')](_0x34203b,[_0xbffff7[_0x3d1b16][_0xf593('0x73')][_0x251a37]['id']]);}}return _0x34203b;}})[_0xf593('0x1f')](function(_0x5cc5af){if(_0x5cc5af){return db[_0xf593('0x38')][_0xf593('0x5d')]({'where':{'id':_0x43e0e4[_0xf593('0x57')]['id']}});}})[_0xf593('0x1f')](function(_0x478e27){if(_0x478e27){_0x4235d1=_0x478e27;return _0x4235d1[_0xf593('0x75')](_0x34203b,{'penalty':_0x43e0e4['body'][_0xf593('0x76')]});}})[_0xf593('0x1f')](function(_0x2cea04){if(_0x2cea04){return _0x4235d1[_0xf593('0x71')](_0x43e0e4['body'][_0xf593('0x72')]);}})['then'](handleEntityNotFound(_0x4179e3,null))['then'](respondWithStatusCode(_0x4179e3,null))[_0xf593('0x55')](handleError(_0x4179e3,null));};exports[_0xf593('0x77')]=function(_0x150827,_0x48ef3e,_0x2ebd7f){var _0x2865ac=[];var _0x539448;return db['Team'][_0xf593('0x54')]({'where':{'id':_0x150827[_0xf593('0x3a')][_0xf593('0x72')]},'attributes':['id'],'include':[{'model':db[_0xf593('0x78')],'as':_0xf593('0x73'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x58a1e7){if(_0x58a1e7){for(var _0x2269c9=0x0;_0x2269c9<_0x58a1e7['length'];_0x2269c9+=0x1){for(var _0x275f7d=0x0;_0x275f7d<_0x58a1e7[_0x2269c9]['Agents'][_0xf593('0x41')];_0x275f7d+=0x1){_0x2865ac=_[_0xf593('0x74')](_0x2865ac,[_0x58a1e7[_0x2269c9][_0xf593('0x73')][_0x275f7d]['id']]);}}return _0x2865ac;}})[_0xf593('0x1f')](function(_0x169659){if(_0x169659){return db['ChatQueue'][_0xf593('0x5d')]({'where':{'id':_0x150827[_0xf593('0x57')]['id']}});}})[_0xf593('0x1f')](function(_0x5ac2dc){if(_0x5ac2dc){_0x539448=_0x5ac2dc;return _0x539448[_0xf593('0x79')](_0x2865ac);}})[_0xf593('0x1f')](function(_0x3459e0){if(_0x539448){return _0x539448[_0xf593('0x77')](_0x150827[_0xf593('0x3a')]['ids']);}})[_0xf593('0x1f')](handleEntityNotFound(_0x48ef3e,null))[_0xf593('0x1f')](respondWithStatusCode(_0x48ef3e,null))[_0xf593('0x55')](handleError(_0x48ef3e,null));};exports[_0xf593('0x75')]=function(_0x2946fd,_0x11a9f7,_0x5a4620){return db[_0xf593('0x38')][_0xf593('0x5d')]({'where':{'id':_0x2946fd[_0xf593('0x57')]['id']}})[_0xf593('0x1f')](handleEntityNotFound(_0x11a9f7,null))[_0xf593('0x1f')](function(_0x8efa62){if(_0x8efa62){return _0x8efa62[_0xf593('0x75')](_0x2946fd[_0xf593('0x5a')]['ids'],_['omit'](_0x2946fd[_0xf593('0x5a')],[_0xf593('0x72'),'id'])||{})[_0xf593('0x7a')](function(_0x26318f){for(var _0x1f93a7=0x0;_0x1f93a7<_0x2946fd[_0xf593('0x5a')][_0xf593('0x72')]['length'];_0x1f93a7+=0x1){socket['emit'](_0xf593('0x7b'),{'UserId':_0x2946fd['body'][_0xf593('0x72')][_0x1f93a7],'ChatQueueId':_0x2946fd['params']['id']});}return _0x26318f;});}})['then'](respondWithResult(_0x11a9f7,null))['catch'](handleError(_0x11a9f7,null));};exports['removeAgents']=function(_0x3f2bb2,_0x46f93b,_0x35bfeb){var _0xc68ed5;return db[_0xf593('0x38')][_0xf593('0x5d')]({'where':{'id':_0x3f2bb2[_0xf593('0x57')]['id']}})[_0xf593('0x1f')](handleEntityNotFound(_0x46f93b,null))[_0xf593('0x1f')](function(_0x1eca12){if(_0x1eca12){return _0x1eca12[_0xf593('0x79')](_0x3f2bb2[_0xf593('0x3a')][_0xf593('0x72')])['then'](function(_0x487ad6){if(_['isArray'](_0x3f2bb2[_0xf593('0x3a')]['ids'])){for(var _0xee971c=0x0;_0xee971c<_0x3f2bb2[_0xf593('0x3a')][_0xf593('0x72')][_0xf593('0x41')];_0xee971c+=0x1){socket[_0xf593('0x7c')]('userChatQueue:remove',{'UserId':_0x3f2bb2[_0xf593('0x3a')][_0xf593('0x72')][_0xee971c],'ChatQueueId':_0x3f2bb2[_0xf593('0x57')]['id']});}}else{socket[_0xf593('0x7c')]('userChatQueue:remove',{'UserId':_0x3f2bb2[_0xf593('0x3a')][_0xf593('0x72')],'ChatQueueId':_0x3f2bb2[_0xf593('0x57')]['id']});}});}})[_0xf593('0x1f')](respondWithStatusCode(_0x46f93b,null))[_0xf593('0x55')](handleError(_0x46f93b,null));};exports[_0xf593('0x7d')]=function(_0x515847,_0x338900,_0x15f5bb){var _0xd76192={};var _0xe5b303={};var _0x152f89;var _0x176513;return db[_0xf593('0x38')][_0xf593('0x64')]({'where':{'id':_0x515847[_0xf593('0x57')]['id']}})['then'](handleEntityNotFound(_0x338900,null))['then'](function(_0x1f82b7){if(_0x1f82b7){_0x152f89=_0x1f82b7;_0xe5b303[_0xf593('0x3d')]=_[_0xf593('0x58')](db[_0xf593('0x78')][_0xf593('0x39')]);_0xe5b303[_0xf593('0x3a')]=_[_0xf593('0x58')](_0x515847['query']);_0xe5b303[_0xf593('0x3c')]=_[_0xf593('0x3f')](_0xe5b303[_0xf593('0x3d')],_0xe5b303[_0xf593('0x3a')]);_0xd76192[_0xf593('0x3e')]=_[_0xf593('0x3f')](_0xe5b303[_0xf593('0x3d')],qs[_0xf593('0x40')](_0x515847[_0xf593('0x3a')][_0xf593('0x40')]));_0xd76192[_0xf593('0x3e')]=_0xd76192[_0xf593('0x3e')][_0xf593('0x41')]?_0xd76192[_0xf593('0x3e')]:_0xe5b303[_0xf593('0x3d')];_0xd76192[_0xf593('0x45')]=qs[_0xf593('0x46')](_0x515847['query'][_0xf593('0x46')]);_0xd76192[_0xf593('0x47')]=qs[_0xf593('0x3c')](_[_0xf593('0x48')](_0x515847[_0xf593('0x3a')],_0xe5b303[_0xf593('0x3c')]));if(_0x515847[_0xf593('0x3a')][_0xf593('0x4d')]){_0xd76192[_0xf593('0x47')]=_[_0xf593('0x4c')](_0xd76192[_0xf593('0x47')],{'$or':_[_0xf593('0x4e')](_0xd76192['attributes'],function(_0x45057f){var _0x18a744={};_0x18a744[_0x45057f]={'$like':'%'+_0x515847[_0xf593('0x3a')][_0xf593('0x4d')]+'%'};return _0x18a744;})});}_0xd76192=_[_0xf593('0x4c')]({},_0xd76192,_0x515847[_0xf593('0x51')]);return _0x152f89[_0xf593('0x7d')](_0xd76192);}})[_0xf593('0x1f')](function(_0x11edcd){if(_0x11edcd){_0x176513=_0x11edcd[_0xf593('0x41')];if(!_0x515847[_0xf593('0x3a')]['hasOwnProperty'](_0xf593('0x43'))){_0xd76192[_0xf593('0x44')]=qs['limit'](_0x515847['query'][_0xf593('0x44')]);_0xd76192['offset']=qs[_0xf593('0x2c')](_0x515847[_0xf593('0x3a')][_0xf593('0x2c')]);}return _0x152f89[_0xf593('0x7d')](_0xd76192);}})[_0xf593('0x1f')](function(_0x189b25){if(_0x189b25){return _0x189b25?{'count':_0x176513,'rows':_0x189b25}:null;}})[_0xf593('0x1f')](respondWithResult(_0x338900,null))[_0xf593('0x55')](handleError(_0x338900,null));};
\ No newline at end of file
index 864042b..c0df179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa4=['../../mysqldb','ChatQueue','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x11db8c,_0x1979b2){var _0x4f7cda=function(_0x291b4a){while(--_0x291b4a){_0x11db8c['push'](_0x11db8c['shift']());}};_0x4f7cda(++_0x1979b2);}(_0xcaa4,0x1b7));var _0x4caa=function(_0x3c112d,_0x29fbd9){_0x3c112d=_0x3c112d-0x0;var _0x231b78=_0xcaa4[_0x3c112d];return _0x231b78;};'use strict';var EventEmitter=require(_0x4caa('0x0'));var ChatQueue=require(_0x4caa('0x1'))['db'][_0x4caa('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4caa('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4caa('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b85c8){return function(_0xf107dc,_0xe49a4e,_0x160036){ChatQueueEvents[_0x4caa('0x5')](_0x3b85c8+':'+_0xf107dc['id'],_0xf107dc);ChatQueueEvents[_0x4caa('0x5')](_0x3b85c8,_0xf107dc);_0x160036(null);};}for(var e in events){if(events[_0x4caa('0x6')](e)){var event=events[e];ChatQueue[_0x4caa('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x25e1=['emit','hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x25e1,0x1d0));var _0x125e=function(_0xc51b18,_0x1b7832){_0xc51b18=_0xc51b18-0x0;var _0x57c74b=_0x25e1[_0xc51b18];return _0x57c74b;};'use strict';var EventEmitter=require(_0x125e('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x125e('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x125e('0x2')](0x0);var events={'afterCreate':_0x125e('0x3'),'afterUpdate':_0x125e('0x4'),'afterDestroy':_0x125e('0x5')};function emitEvent(_0x8251a5){return function(_0x467812,_0x76eb08,_0x2d6b35){ChatQueueEvents[_0x125e('0x6')](_0x8251a5+':'+_0x467812['id'],_0x467812);ChatQueueEvents[_0x125e('0x6')](_0x8251a5,_0x467812);_0x2d6b35(null);};}for(var e in events){if(events[_0x125e('0x7')](e)){var event=events[e];ChatQueue[_0x125e('0x8')](e,emitEvent(event));}}module[_0x125e('0x9')]=ChatQueueEvents;
\ No newline at end of file
index ae447bc..15e7dac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6334=['bluebird','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x454087,_0xb66160){var _0x11a9ab=function(_0x2c309e){while(--_0x2c309e){_0x454087['push'](_0x454087['shift']());}};_0x11a9ab(++_0xb66160);}(_0x6334,0x119));var _0x4633=function(_0x3f2ecf,_0x4ccad6){_0x3f2ecf=_0x3f2ecf-0x0;var _0xa6dd7e=_0x6334[_0x3f2ecf];return _0xa6dd7e;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require('request-promise');var attributes=require(_0x4633('0x6'));module[_0x4633('0x7')]=function(_0x2a2b3c,_0x3572d1){return _0x2a2b3c[_0x4633('0x8')](_0x4633('0x9'),attributes,{'tableName':_0x4633('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x81bd=['request-promise','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x915908,_0x333bc8){var _0x26a3ea=function(_0x4def06){while(--_0x4def06){_0x915908['push'](_0x915908['shift']());}};_0x26a3ea(++_0x333bc8);}(_0x81bd,0x7c));var _0xd81b=function(_0x49cee9,_0x28e9de){_0x49cee9=_0x49cee9-0x0;var _0x5c896d=_0x81bd[_0x49cee9];return _0x5c896d;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var attributes=require('./chatQueue.attributes');module[_0xd81b('0x7')]=function(_0x2c3d9e,_0x1b6cfe){return _0x2c3d9e['define'](_0xd81b('0x8'),attributes,{'tableName':_0xd81b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1e6f18f..6352347 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa10f=['GetChatQueue','catch','ChatQueue','find','raw','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','findAll','options','where','include','map','model','attributes','debug'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa10f,0x110));var _0xfa10=function(_0x5552a5,_0x2ccd4a){_0x5552a5=_0x5552a5-0x0;var _0x4bdd6f=_0xa10f[_0x5552a5];return _0x4bdd6f;};'use strict';var _=require(_0xfa10('0x0'));var util=require('util');var moment=require(_0xfa10('0x1'));var BPromise=require(_0xfa10('0x2'));var rs=require(_0xfa10('0x3'));var fs=require('fs');var Redis=require(_0xfa10('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfa10('0x5'));var jayson=require(_0xfa10('0x6'));var client=jayson[_0xfa10('0x7')][_0xfa10('0x8')]({'port':0x232a});config[_0xfa10('0x9')]=_[_0xfa10('0xa')](config[_0xfa10('0x9')],{'host':_0xfa10('0xb'),'port':0x18eb});var socket=require(_0xfa10('0xc'))(new Redis(config['redis']));require(_0xfa10('0xd'))['register'](socket);function respondWithRpcPromise(_0x54b813,_0x2c579e,_0x1e4b17){return new BPromise(function(_0x50a277,_0x4f30dd){return client[_0xfa10('0xe')](_0x54b813,_0x1e4b17)[_0xfa10('0xf')](function(_0x5b0f5f){logger[_0xfa10('0x10')](_0xfa10('0x11'),_0x2c579e,_0xfa10('0x12'));logger['debug'](_0xfa10('0x13'),_0x2c579e,_0xfa10('0x12'),JSON[_0xfa10('0x14')](_0x5b0f5f));if(_0x5b0f5f[_0xfa10('0x15')]){if(_0x5b0f5f[_0xfa10('0x15')]['code']===0x1f4){logger[_0xfa10('0x15')](_0xfa10('0x11'),_0x2c579e,_0x5b0f5f['error']['message']);return _0x4f30dd(_0x5b0f5f['error']['message']);}logger['error'](_0xfa10('0x11'),_0x2c579e,_0x5b0f5f['error'][_0xfa10('0x16')]);return _0x50a277(_0x5b0f5f[_0xfa10('0x15')][_0xfa10('0x16')]);}else{logger[_0xfa10('0x10')](_0xfa10('0x11'),_0x2c579e,_0xfa10('0x12'));_0x50a277(_0x5b0f5f[_0xfa10('0x17')][_0xfa10('0x16')]);}})['catch'](function(_0x263330){logger['error'](_0xfa10('0x11'),_0x2c579e,_0x263330);_0x4f30dd(_0x263330);});});}exports['GetChatQueue']=function(_0xf8db77){var _0x47b190=this;return new Promise(function(_0x43bff6,_0x321923){return db['ChatQueue'][_0xfa10('0x18')]({'raw':_0xf8db77[_0xfa10('0x19')]?_0xf8db77['options']['raw']===undefined?!![]:![]:!![],'where':_0xf8db77[_0xfa10('0x19')]?_0xf8db77[_0xfa10('0x19')][_0xfa10('0x1a')]||null:null,'attributes':_0xf8db77['options']?_0xf8db77['options']['attributes']||null:null,'limit':_0xf8db77['options']?_0xf8db77[_0xfa10('0x19')]['limit']||null:null,'include':_0xf8db77[_0xfa10('0x19')]?_0xf8db77[_0xfa10('0x19')][_0xfa10('0x1b')]?_[_0xfa10('0x1c')](_0xf8db77[_0xfa10('0x19')][_0xfa10('0x1b')],function(_0x20c92b){return{'model':db[_0x20c92b[_0xfa10('0x1d')]],'as':_0x20c92b['as'],'attributes':_0x20c92b[_0xfa10('0x1e')],'include':_0x20c92b[_0xfa10('0x1b')]?_[_0xfa10('0x1c')](_0x20c92b['include'],function(_0x401de7){return{'model':db[_0x401de7[_0xfa10('0x1d')]],'as':_0x401de7['as'],'attributes':_0x401de7[_0xfa10('0x1e')],'include':_0x401de7[_0xfa10('0x1b')]?_[_0xfa10('0x1c')](_0x401de7[_0xfa10('0x1b')],function(_0x16e2b4){return{'model':db[_0x16e2b4[_0xfa10('0x1d')]],'as':_0x16e2b4['as'],'attributes':_0x16e2b4[_0xfa10('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d5f6a){logger['info']('GetChatQueue',_0xf8db77);logger[_0xfa10('0x1f')](_0xfa10('0x20'),_0xf8db77,JSON[_0xfa10('0x14')](_0x3d5f6a));_0x43bff6(_0x3d5f6a);})[_0xfa10('0x21')](function(_0x6d6f13){logger['error'](_0xfa10('0x20'),_0x6d6f13[_0xfa10('0x16')],_0xf8db77);_0x321923(_0x47b190[_0xfa10('0x15')](0x1f4,_0x6d6f13[_0xfa10('0x16')]));});});};exports['ShowChatQueue']=function(_0xc7e6ab){var _0x28e33f=this;return new Promise(function(_0xb30315,_0x5a253c){return db[_0xfa10('0x22')][_0xfa10('0x23')]({'raw':_0xc7e6ab[_0xfa10('0x19')]?_0xc7e6ab[_0xfa10('0x19')][_0xfa10('0x24')]===undefined?!![]:![]:!![],'where':_0xc7e6ab[_0xfa10('0x19')]?_0xc7e6ab['options'][_0xfa10('0x1a')]||null:null,'attributes':_0xc7e6ab[_0xfa10('0x19')]?_0xc7e6ab['options'][_0xfa10('0x1e')]||null:null,'include':_0xc7e6ab[_0xfa10('0x19')]?_0xc7e6ab[_0xfa10('0x19')]['include']?_['map'](_0xc7e6ab['options'][_0xfa10('0x1b')],function(_0x4f9260){return{'model':db[_0x4f9260[_0xfa10('0x1d')]],'as':_0x4f9260['as'],'attributes':_0x4f9260[_0xfa10('0x1e')],'include':_0x4f9260[_0xfa10('0x1b')]?_[_0xfa10('0x1c')](_0x4f9260[_0xfa10('0x1b')],function(_0x4dceea){return{'model':db[_0x4dceea[_0xfa10('0x1d')]],'as':_0x4dceea['as'],'attributes':_0x4dceea[_0xfa10('0x1e')],'include':_0x4dceea['include']?_['map'](_0x4dceea[_0xfa10('0x1b')],function(_0x38b000){return{'model':db[_0x38b000[_0xfa10('0x1d')]],'as':_0x38b000['as'],'attributes':_0x38b000['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa10('0xf')](function(_0x34755f){logger[_0xfa10('0x10')](_0xfa10('0x25'),_0xc7e6ab);logger['debug'](_0xfa10('0x25'),_0xc7e6ab,JSON[_0xfa10('0x14')](_0x34755f));_0xb30315(_0x34755f);})['catch'](function(_0x4981ca){logger[_0xfa10('0x15')](_0xfa10('0x25'),_0x4981ca['message'],_0xc7e6ab);_0x5a253c(_0x28e33f[_0xfa10('0x15')](0x1f4,_0x4981ca[_0xfa10('0x16')]));});});};
\ No newline at end of file
+var _0xc610=['message','info','catch','GetChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','ChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x4be687,_0xe630cc){var _0x42156f=function(_0x5ae44b){while(--_0x5ae44b){_0x4be687['push'](_0x4be687['shift']());}};_0x42156f(++_0xe630cc);}(_0xc610,0x1d3));var _0x0c61=function(_0x256027,_0x572634){_0x256027=_0x256027-0x0;var _0xf4cfa2=_0xc610[_0x256027];return _0xf4cfa2;};'use strict';var _=require(_0x0c61('0x0'));var util=require(_0x0c61('0x1'));var moment=require(_0x0c61('0x2'));var BPromise=require(_0x0c61('0x3'));var rs=require(_0x0c61('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c61('0x5'))['db'];var utils=require(_0x0c61('0x6'));var logger=require(_0x0c61('0x7'))(_0x0c61('0x8'));var config=require(_0x0c61('0x9'));var jayson=require(_0x0c61('0xa'));var client=jayson[_0x0c61('0xb')]['http']({'port':0x232a});config[_0x0c61('0xc')]=_[_0x0c61('0xd')](config[_0x0c61('0xc')],{'host':_0x0c61('0xe'),'port':0x18eb});var socket=require(_0x0c61('0xf'))(new Redis(config[_0x0c61('0xc')]));require(_0x0c61('0x10'))['register'](socket);function respondWithRpcPromise(_0x15b4ef,_0x47da19,_0x351302){return new BPromise(function(_0x1f3261,_0x2e784e){return client[_0x0c61('0x11')](_0x15b4ef,_0x351302)[_0x0c61('0x12')](function(_0x276e33){logger['info'](_0x0c61('0x13'),_0x47da19,'request\x20sent');logger[_0x0c61('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x47da19,_0x0c61('0x15'),JSON[_0x0c61('0x16')](_0x276e33));if(_0x276e33[_0x0c61('0x17')]){if(_0x276e33['error'][_0x0c61('0x18')]===0x1f4){logger['error'](_0x0c61('0x13'),_0x47da19,_0x276e33[_0x0c61('0x17')][_0x0c61('0x19')]);return _0x2e784e(_0x276e33[_0x0c61('0x17')]['message']);}logger[_0x0c61('0x17')]('ChatQueue,\x20%s,\x20%s',_0x47da19,_0x276e33['error'][_0x0c61('0x19')]);return _0x1f3261(_0x276e33[_0x0c61('0x17')][_0x0c61('0x19')]);}else{logger[_0x0c61('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x47da19,_0x0c61('0x15'));_0x1f3261(_0x276e33['result'][_0x0c61('0x19')]);}})[_0x0c61('0x1b')](function(_0x49f3a0){logger['error'](_0x0c61('0x13'),_0x47da19,_0x49f3a0);_0x2e784e(_0x49f3a0);});});}exports[_0x0c61('0x1c')]=function(_0x1f6e45){var _0x55665f=this;return new Promise(function(_0x50f543,_0x5796c2){return db['ChatQueue'][_0x0c61('0x1d')]({'raw':_0x1f6e45[_0x0c61('0x1e')]?_0x1f6e45['options'][_0x0c61('0x1f')]===undefined?!![]:![]:!![],'where':_0x1f6e45[_0x0c61('0x1e')]?_0x1f6e45[_0x0c61('0x1e')][_0x0c61('0x20')]||null:null,'attributes':_0x1f6e45[_0x0c61('0x1e')]?_0x1f6e45[_0x0c61('0x1e')]['attributes']||null:null,'limit':_0x1f6e45[_0x0c61('0x1e')]?_0x1f6e45[_0x0c61('0x1e')][_0x0c61('0x21')]||null:null,'include':_0x1f6e45['options']?_0x1f6e45[_0x0c61('0x1e')][_0x0c61('0x22')]?_[_0x0c61('0x23')](_0x1f6e45[_0x0c61('0x1e')][_0x0c61('0x22')],function(_0x25d825){return{'model':db[_0x25d825[_0x0c61('0x24')]],'as':_0x25d825['as'],'attributes':_0x25d825[_0x0c61('0x25')],'include':_0x25d825[_0x0c61('0x22')]?_[_0x0c61('0x23')](_0x25d825[_0x0c61('0x22')],function(_0x561dd7){return{'model':db[_0x561dd7[_0x0c61('0x24')]],'as':_0x561dd7['as'],'attributes':_0x561dd7['attributes'],'include':_0x561dd7[_0x0c61('0x22')]?_['map'](_0x561dd7[_0x0c61('0x22')],function(_0x44b322){return{'model':db[_0x44b322[_0x0c61('0x24')]],'as':_0x44b322['as'],'attributes':_0x44b322['attributes']};}):[]};}):[]};}):[]:[]})[_0x0c61('0x12')](function(_0x4f294c){logger[_0x0c61('0x1a')]('GetChatQueue',_0x1f6e45);logger[_0x0c61('0x14')]('GetChatQueue',_0x1f6e45,JSON['stringify'](_0x4f294c));_0x50f543(_0x4f294c);})['catch'](function(_0x3ec0b8){logger[_0x0c61('0x17')](_0x0c61('0x1c'),_0x3ec0b8[_0x0c61('0x19')],_0x1f6e45);_0x5796c2(_0x55665f[_0x0c61('0x17')](0x1f4,_0x3ec0b8[_0x0c61('0x19')]));});});};exports['ShowChatQueue']=function(_0x19352e){var _0xb3f3ed=this;return new Promise(function(_0x5c194f,_0x280c44){return db[_0x0c61('0x26')][_0x0c61('0x27')]({'raw':_0x19352e[_0x0c61('0x1e')]?_0x19352e[_0x0c61('0x1e')][_0x0c61('0x1f')]===undefined?!![]:![]:!![],'where':_0x19352e[_0x0c61('0x1e')]?_0x19352e[_0x0c61('0x1e')][_0x0c61('0x20')]||null:null,'attributes':_0x19352e[_0x0c61('0x1e')]?_0x19352e[_0x0c61('0x1e')]['attributes']||null:null,'include':_0x19352e[_0x0c61('0x1e')]?_0x19352e['options'][_0x0c61('0x22')]?_['map'](_0x19352e[_0x0c61('0x1e')][_0x0c61('0x22')],function(_0x2cc0be){return{'model':db[_0x2cc0be['model']],'as':_0x2cc0be['as'],'attributes':_0x2cc0be['attributes'],'include':_0x2cc0be[_0x0c61('0x22')]?_['map'](_0x2cc0be[_0x0c61('0x22')],function(_0x5b5f57){return{'model':db[_0x5b5f57[_0x0c61('0x24')]],'as':_0x5b5f57['as'],'attributes':_0x5b5f57[_0x0c61('0x25')],'include':_0x5b5f57[_0x0c61('0x22')]?_['map'](_0x5b5f57[_0x0c61('0x22')],function(_0x21d6ff){return{'model':db[_0x21d6ff[_0x0c61('0x24')]],'as':_0x21d6ff['as'],'attributes':_0x21d6ff[_0x0c61('0x25')]};}):[]};}):[]};}):[]:[]})[_0x0c61('0x12')](function(_0x9cf8f0){logger['info'](_0x0c61('0x28'),_0x19352e);logger['debug'](_0x0c61('0x28'),_0x19352e,JSON[_0x0c61('0x16')](_0x9cf8f0));_0x5c194f(_0x9cf8f0);})[_0x0c61('0x1b')](function(_0x323427){logger[_0x0c61('0x17')]('ShowChatQueue',_0x323427['message'],_0x19352e);_0x280c44(_0xb3f3ed[_0x0c61('0x17')](0x1f4,_0x323427['message']));});});};
\ No newline at end of file
index 1d6d33c..66d627f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var ChatQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){ChatQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index dca81b8..af3f21c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ec=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','isAuthenticated','index','get','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','/:id','delete','exports'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x55ec,0x1a0));var _0xc55e=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x55ec[_0x427352];return _0x23e0e6;};'use strict';var multer=require(_0xc55e('0x0'));var util=require(_0xc55e('0x1'));var path=require(_0xc55e('0x2'));var timeout=require(_0xc55e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc55e('0x4'));var interaction=require(_0xc55e('0x5'));var config=require('../../config/environment');var controller=require(_0xc55e('0x6'));router['get']('/',auth[_0xc55e('0x7')](),controller[_0xc55e('0x8')]);router[_0xc55e('0x9')](_0xc55e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xc55e('0x9')]('/:id',auth[_0xc55e('0x7')](),controller[_0xc55e('0xb')]);router['get'](_0xc55e('0xc'),auth['isAuthenticated'](),controller[_0xc55e('0xd')]);router[_0xc55e('0x9')](_0xc55e('0xe'),auth[_0xc55e('0x7')](),controller[_0xc55e('0xf')]);router[_0xc55e('0x9')](_0xc55e('0x10'),auth[_0xc55e('0x7')](),controller[_0xc55e('0x11')]);router['post']('/',auth[_0xc55e('0x7')](),controller[_0xc55e('0x12')]);router[_0xc55e('0x13')]('/:id/teams',auth[_0xc55e('0x7')](),controller[_0xc55e('0x14')]);router[_0xc55e('0x13')](_0xc55e('0x10'),auth['isAuthenticated'](),controller[_0xc55e('0x15')]);router[_0xc55e('0x16')](_0xc55e('0x17'),auth[_0xc55e('0x7')](),controller['update']);router[_0xc55e('0x18')](_0xc55e('0x17'),auth[_0xc55e('0x7')](),controller['destroy']);router[_0xc55e('0x18')](_0xc55e('0xe'),auth[_0xc55e('0x7')](),controller['removeTeams']);router[_0xc55e('0x18')]('/:id/users',auth[_0xc55e('0x7')](),controller['removeAgents']);module[_0xc55e('0x19')]=router;
\ No newline at end of file
+var _0x2b95=['isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','put','update','delete','destroy','removeTeams','removeAgents','exports','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get'];(function(_0x151418,_0x2cbffa){var _0x40e29a=function(_0xec4d7){while(--_0xec4d7){_0x151418['push'](_0x151418['shift']());}};_0x40e29a(++_0x2cbffa);}(_0x2b95,0x6e));var _0x52b9=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x2b95[_0xf2628e];return _0x13863a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x52b9('0x0'));var interaction=require(_0x52b9('0x1'));var config=require(_0x52b9('0x2'));var controller=require(_0x52b9('0x3'));router[_0x52b9('0x4')]('/',auth[_0x52b9('0x5')](),controller['index']);router[_0x52b9('0x4')](_0x52b9('0x6'),auth[_0x52b9('0x5')](),controller[_0x52b9('0x7')]);router[_0x52b9('0x4')](_0x52b9('0x8'),auth['isAuthenticated'](),controller['show']);router['get'](_0x52b9('0x9'),auth[_0x52b9('0x5')](),controller[_0x52b9('0xa')]);router[_0x52b9('0x4')](_0x52b9('0xb'),auth['isAuthenticated'](),controller[_0x52b9('0xc')]);router['get']('/:id/users',auth[_0x52b9('0x5')](),controller[_0x52b9('0xd')]);router[_0x52b9('0xe')]('/',auth[_0x52b9('0x5')](),controller[_0x52b9('0xf')]);router[_0x52b9('0xe')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x52b9('0xe')]('/:id/users',auth[_0x52b9('0x5')](),controller['addAgents']);router[_0x52b9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x52b9('0x11')]);router[_0x52b9('0x12')]('/:id',auth[_0x52b9('0x5')](),controller[_0x52b9('0x13')]);router['delete'](_0x52b9('0xb'),auth[_0x52b9('0x5')](),controller[_0x52b9('0x14')]);router[_0x52b9('0x12')]('/:id/users',auth[_0x52b9('0x5')](),controller[_0x52b9('0x15')]);module[_0x52b9('0x16')]=router;
\ No newline at end of file
index baede38..6e65dbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7de=['STRING','DATE','moment','sequelize','exports'];(function(_0x5aa992,_0x559ebb){var _0x2e2d59=function(_0x1e2e35){while(--_0x1e2e35){_0x5aa992['push'](_0x5aa992['shift']());}};_0x2e2d59(++_0x559ebb);}(_0xf7de,0x8e));var _0xef7d=function(_0x584ae8,_0x5b82b0){_0x584ae8=_0x584ae8-0x0;var _0xa7b607=_0xf7de[_0x584ae8];return _0xa7b607;};'use strict';var moment=require(_0xef7d('0x0'));var Sequelize=require(_0xef7d('0x1'));module[_0xef7d('0x2')]={'uniqueid':{'type':Sequelize[_0xef7d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xef7d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xef7d('0x4')]},'exitAt':{'type':Sequelize[_0xef7d('0x4')]},'reason':{'type':Sequelize[_0xef7d('0x3')]}};
\ No newline at end of file
+var _0x1ac2=['DATE','STRING','moment','exports'];(function(_0x70599,_0x509827){var _0x13943a=function(_0x4b5fa3){while(--_0x4b5fa3){_0x70599['push'](_0x70599['shift']());}};_0x13943a(++_0x509827);}(_0x1ac2,0x1d2));var _0x21ac=function(_0x1daf88,_0x38cd7d){_0x1daf88=_0x1daf88-0x0;var _0x2a40b5=_0x1ac2[_0x1daf88];return _0x2a40b5;};'use strict';var moment=require(_0x21ac('0x0'));var Sequelize=require('sequelize');module[_0x21ac('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x21ac('0x2')]},'acceptAt':{'type':Sequelize[_0x21ac('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x21ac('0x3')]}};
\ No newline at end of file
index acd47c4..ff2ea9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8794=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','error','stack','send','index','ChatQueueReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','update','body','destroy','params','html-pdf','eml-format'];(function(_0x1d9cd0,_0x11933b){var _0x43fed4=function(_0x2adc2d){while(--_0x2adc2d){_0x1d9cd0['push'](_0x1d9cd0['shift']());}};_0x43fed4(++_0x11933b);}(_0x8794,0x1cc));var _0x4879=function(_0x3fa7ad,_0x182b55){_0x3fa7ad=_0x3fa7ad-0x0;var _0x59491f=_0x8794[_0x3fa7ad];return _0x59491f;};'use strict';var pdf=require(_0x4879('0x0'));var emlformat=require(_0x4879('0x1'));var rimraf=require(_0x4879('0x2'));var zipdir=require(_0x4879('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4879('0x4'));var moment=require(_0x4879('0x5'));var BPromise=require(_0x4879('0x6'));var Mustache=require(_0x4879('0x7'));var util=require('util');var path=require(_0x4879('0x8'));var sox=require(_0x4879('0x9'));var csv=require('to-csv');var ejs=require(_0x4879('0xa'));var fs=require('fs');var _=require(_0x4879('0xb'));var squel=require(_0x4879('0xc'));var crypto=require('crypto');var jsforce=require(_0x4879('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4879('0xe'));var querystring=require(_0x4879('0xf'));var Papa=require(_0x4879('0x10'));var Redis=require(_0x4879('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x4879('0x12'))(_0x4879('0x13'));var utils=require(_0x4879('0x14'));var config=require(_0x4879('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x283e77,_0x44920e){_0x44920e=_0x44920e||0xcc;return function(_0x298718){if(_0x298718){return _0x283e77[_0x4879('0x16')](_0x44920e);}return _0x283e77[_0x4879('0x17')](_0x44920e)[_0x4879('0x18')]();};}function respondWithResult(_0xe2e7b5,_0x413b56){_0x413b56=_0x413b56||0xc8;return function(_0x3321f0){if(_0x3321f0){return _0xe2e7b5[_0x4879('0x17')](_0x413b56)[_0x4879('0x19')](_0x3321f0);}};}function respondWithFilteredResult(_0x2fcba4,_0x50a8e7){return function(_0x344bc0){if(_0x344bc0){var _0x134517=_0x344bc0[_0x4879('0x1a')],_0x3bd1b0=_0x50a8e7[_0x4879('0x1b')],_0x4ebb46=_0x50a8e7[_0x4879('0x1b')]+_0x50a8e7['limit'],_0x5d7100;if(_0x4ebb46>=_0x134517){_0x4ebb46=_0x134517;_0x5d7100=0xc8;}else{_0x5d7100=0xce;}_0x2fcba4[_0x4879('0x17')](_0x5d7100);return _0x2fcba4[_0x4879('0x1c')]('Content-Range',_0x3bd1b0+'-'+_0x4ebb46+'/'+_0x134517)[_0x4879('0x19')](_0x344bc0);}return null;};}function patchUpdates(_0x5d9ce5){return function(_0x59bf63){try{jsonpatch[_0x4879('0x1d')](_0x59bf63,_0x5d9ce5,!![]);}catch(_0x242faa){return BPromise[_0x4879('0x1e')](_0x242faa);}return _0x59bf63[_0x4879('0x1f')]();};}function saveUpdates(_0x53573a,_0x5c18a5){return function(_0x24cc4a){if(_0x24cc4a){return _0x24cc4a['update'](_0x53573a)['then'](function(_0x3f48f1){return _0x3f48f1;});}return null;};}function removeEntity(_0x279943,_0x325c4d){return function(_0x5bc976){if(_0x5bc976){return _0x5bc976['destroy']()[_0x4879('0x20')](function(){_0x279943[_0x4879('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0e0a,_0x38011a){return function(_0x3344fe){if(!_0x3344fe){_0x5d0e0a[_0x4879('0x16')](0x194);}return _0x3344fe;};}function handleError(_0x3783ab,_0x44c795){_0x44c795=_0x44c795||0x1f4;return function(_0x21e047){logger[_0x4879('0x21')](_0x21e047[_0x4879('0x22')]);if(_0x21e047['name']){delete _0x21e047['name'];}_0x3783ab[_0x4879('0x17')](_0x44c795)[_0x4879('0x23')](_0x21e047);};}exports[_0x4879('0x24')]=function(_0x5ea431,_0x35a7d3){var _0x46712e={},_0x5c1f5f={},_0x56e3cf={'count':0x0,'rows':[]};var _0x352e0e=db[_0x4879('0x25')][_0x4879('0x26')];_0x5c1f5f[_0x4879('0x27')]=_[_0x4879('0x28')](_0x352e0e);var _0x574993={'dateStart':_0x5ea431[_0x4879('0x29')][_0x4879('0x2a')],'dateEnd':_0x5ea431[_0x4879('0x29')][_0x4879('0x2b')]};delete _0x5ea431[_0x4879('0x29')][_0x4879('0x2a')];delete _0x5ea431[_0x4879('0x29')]['dateEnd'];_0x5c1f5f[_0x4879('0x29')]=_[_0x4879('0x28')](_0x5ea431[_0x4879('0x29')]);_0x5c1f5f[_0x4879('0x2c')]=_[_0x4879('0x2d')](_0x5c1f5f[_0x4879('0x27')],_0x5c1f5f[_0x4879('0x29')]);_0x46712e[_0x4879('0x2e')]=_[_0x4879('0x2d')](_0x5c1f5f[_0x4879('0x27')],qs[_0x4879('0x2f')](_0x5ea431[_0x4879('0x29')][_0x4879('0x2f')]));_0x46712e[_0x4879('0x2e')]=_0x46712e[_0x4879('0x2e')][_0x4879('0x30')]?_0x46712e['attributes']:_0x5c1f5f['model'];if(!_0x5ea431[_0x4879('0x29')][_0x4879('0x31')](_0x4879('0x32'))){_0x46712e[_0x4879('0x33')]=qs[_0x4879('0x33')](_0x5ea431[_0x4879('0x29')][_0x4879('0x33')]);_0x46712e['offset']=qs['offset'](_0x5ea431[_0x4879('0x29')]['offset']);}_0x46712e[_0x4879('0x34')]=qs['sort'](_0x5ea431[_0x4879('0x29')]['sort']);_0x46712e[_0x4879('0x35')]=qs[_0x4879('0x2c')](_[_0x4879('0x36')](_0x5ea431['query'],_0x5c1f5f[_0x4879('0x2c')]));if(_0x574993[_0x4879('0x2a')]){if(_0x574993[_0x4879('0x2b')]){_0x574993[_0x4879('0x2b')]=moment(_0x574993['dateEnd'])[_0x4879('0x37')](0x1,'day');}else{_0x574993[_0x4879('0x2b')]=moment(_0x574993['dateStart'])[_0x4879('0x37')](0x1,_0x4879('0x38'));}_[_0x4879('0x39')](_0x46712e[_0x4879('0x35')],{'createdAt':{'$gte':_0x574993[_0x4879('0x2a')],'$lte':_0x574993[_0x4879('0x2b')]}});}if(_0x5ea431[_0x4879('0x29')][_0x4879('0x3a')]){_0x46712e[_0x4879('0x35')]=_[_0x4879('0x39')](_0x46712e[_0x4879('0x35')],{'$or':_[_0x4879('0x3b')](_0x352e0e,function(_0x14e15f){if(_0x14e15f[_0x4879('0x3c')][_0x4879('0x3d')]!==_0x4879('0x3e')){var _0x1cc12f={};_0x1cc12f[_0x14e15f[_0x4879('0x3f')]]={'$like':'%'+_0x5ea431[_0x4879('0x29')]['filter']+'%'};return _0x1cc12f;}})});}_0x46712e=_[_0x4879('0x39')]({},_0x46712e,_0x5ea431[_0x4879('0x40')]);var _0x2fff4d={'where':_0x46712e[_0x4879('0x35')]};return db[_0x4879('0x25')][_0x4879('0x1a')](_0x2fff4d)[_0x4879('0x20')](function(_0xdd01a0){_0x56e3cf[_0x4879('0x1a')]=_0xdd01a0;if(_0x5ea431[_0x4879('0x29')][_0x4879('0x41')]){_0x46712e[_0x4879('0x42')]=[{'all':!![]}];}return db[_0x4879('0x25')][_0x4879('0x43')](_0x46712e);})[_0x4879('0x20')](function(_0x316269){_0x56e3cf[_0x4879('0x44')]=_0x316269;return _0x56e3cf;})[_0x4879('0x20')](respondWithFilteredResult(_0x35a7d3,_0x46712e))[_0x4879('0x45')](handleError(_0x35a7d3,null));};exports[_0x4879('0x46')]=function(_0x1e8c4f,_0x1cbc09){var _0x523e6c={'raw':!![],'where':{'id':_0x1e8c4f['params']['id']}},_0xf463d9={};_0xf463d9[_0x4879('0x27')]=_[_0x4879('0x28')](db[_0x4879('0x25')][_0x4879('0x26')]);_0xf463d9[_0x4879('0x29')]=_[_0x4879('0x28')](_0x1e8c4f[_0x4879('0x29')]);_0xf463d9[_0x4879('0x2c')]=_[_0x4879('0x2d')](_0xf463d9['model'],_0xf463d9[_0x4879('0x29')]);_0x523e6c['attributes']=_[_0x4879('0x2d')](_0xf463d9[_0x4879('0x27')],qs[_0x4879('0x2f')](_0x1e8c4f[_0x4879('0x29')]['fields']));_0x523e6c[_0x4879('0x2e')]=_0x523e6c[_0x4879('0x2e')][_0x4879('0x30')]?_0x523e6c[_0x4879('0x2e')]:_0xf463d9[_0x4879('0x27')];if(_0x1e8c4f[_0x4879('0x29')][_0x4879('0x41')]){_0x523e6c[_0x4879('0x42')]=[{'all':!![]}];}_0x523e6c=_[_0x4879('0x39')]({},_0x523e6c,_0x1e8c4f[_0x4879('0x40')]);return db['ChatQueueReport'][_0x4879('0x47')](_0x523e6c)['then'](handleEntityNotFound(_0x1cbc09,null))[_0x4879('0x20')](respondWithResult(_0x1cbc09,null))[_0x4879('0x45')](handleError(_0x1cbc09,null));};exports[_0x4879('0x48')]=function(_0x1d2c48,_0x180c19){return db[_0x4879('0x25')]['create'](_0x1d2c48['body'],{})[_0x4879('0x20')](respondWithResult(_0x180c19,0xc9))[_0x4879('0x45')](handleError(_0x180c19,null));};exports[_0x4879('0x49')]=function(_0x47fdcd,_0x4a416e){if(_0x47fdcd[_0x4879('0x4a')]['id']){delete _0x47fdcd[_0x4879('0x4a')]['id'];}return db[_0x4879('0x25')][_0x4879('0x47')]({'where':{'id':_0x47fdcd['params']['id']}})[_0x4879('0x20')](handleEntityNotFound(_0x4a416e,null))[_0x4879('0x20')](saveUpdates(_0x47fdcd[_0x4879('0x4a')],null))[_0x4879('0x20')](respondWithResult(_0x4a416e,null))[_0x4879('0x45')](handleError(_0x4a416e,null));};exports[_0x4879('0x4b')]=function(_0x2b93fc,_0x38d762){return db['ChatQueueReport'][_0x4879('0x47')]({'where':{'id':_0x2b93fc[_0x4879('0x4c')]['id']}})[_0x4879('0x20')](handleEntityNotFound(_0x38d762,null))['then'](removeEntity(_0x38d762,null))[_0x4879('0x45')](handleError(_0x38d762,null));};exports['describe']=function(_0x49093d,_0x291d9a){return db[_0x4879('0x25')]['describe']()[_0x4879('0x20')](respondWithResult(_0x291d9a,null))['catch'](handleError(_0x291d9a,null));};
\ No newline at end of file
+var _0xc51c=['merge','dateStart','map','type','key','field','filter','options','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','keys','query','dateEnd','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','add','day'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xc51c,0x1da));var _0xcc51=function(_0x2d0362,_0x52b1c0){_0x2d0362=_0x2d0362-0x0;var _0x171a2f=_0xc51c[_0x2d0362];return _0x171a2f;};'use strict';var pdf=require(_0xcc51('0x0'));var emlformat=require(_0xcc51('0x1'));var rimraf=require(_0xcc51('0x2'));var zipdir=require(_0xcc51('0x3'));var jsonpatch=require(_0xcc51('0x4'));var rp=require(_0xcc51('0x5'));var moment=require('moment');var BPromise=require(_0xcc51('0x6'));var Mustache=require(_0xcc51('0x7'));var util=require(_0xcc51('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcc51('0x9'));var ejs=require(_0xcc51('0xa'));var fs=require('fs');var _=require(_0xcc51('0xb'));var squel=require('squel');var crypto=require(_0xcc51('0xc'));var jsforce=require(_0xcc51('0xd'));var deskjs=require(_0xcc51('0xe'));var toCsv=require(_0xcc51('0x9'));var querystring=require(_0xcc51('0xf'));var Papa=require(_0xcc51('0x10'));var Redis=require(_0xcc51('0x11'));var qs=require(_0xcc51('0x12'));var logger=require(_0xcc51('0x13'))(_0xcc51('0x14'));var utils=require('../../config/utils');var config=require(_0xcc51('0x15'));var db=require(_0xcc51('0x16'))['db'];function respondWithStatusCode(_0x44ac5a,_0xe34b20){_0xe34b20=_0xe34b20||0xcc;return function(_0x52da15){if(_0x52da15){return _0x44ac5a['sendStatus'](_0xe34b20);}return _0x44ac5a[_0xcc51('0x17')](_0xe34b20)[_0xcc51('0x18')]();};}function respondWithResult(_0x147e64,_0x292118){_0x292118=_0x292118||0xc8;return function(_0x573a0e){if(_0x573a0e){return _0x147e64[_0xcc51('0x17')](_0x292118)['json'](_0x573a0e);}};}function respondWithFilteredResult(_0x4b0941,_0x490bf3){return function(_0xdd1543){if(_0xdd1543){var _0x12c34b=_0xdd1543[_0xcc51('0x19')],_0x34c0a0=_0x490bf3[_0xcc51('0x1a')],_0x54a2d=_0x490bf3[_0xcc51('0x1a')]+_0x490bf3[_0xcc51('0x1b')],_0x431fc7;if(_0x54a2d>=_0x12c34b){_0x54a2d=_0x12c34b;_0x431fc7=0xc8;}else{_0x431fc7=0xce;}_0x4b0941[_0xcc51('0x17')](_0x431fc7);return _0x4b0941[_0xcc51('0x1c')](_0xcc51('0x1d'),_0x34c0a0+'-'+_0x54a2d+'/'+_0x12c34b)['json'](_0xdd1543);}return null;};}function patchUpdates(_0x5c6982){return function(_0x27690e){try{jsonpatch['apply'](_0x27690e,_0x5c6982,!![]);}catch(_0x4af4c8){return BPromise[_0xcc51('0x1e')](_0x4af4c8);}return _0x27690e[_0xcc51('0x1f')]();};}function saveUpdates(_0x374efb,_0x32f691){return function(_0x255bc4){if(_0x255bc4){return _0x255bc4['update'](_0x374efb)[_0xcc51('0x20')](function(_0x47acb8){return _0x47acb8;});}return null;};}function removeEntity(_0x21b16c,_0x567b16){return function(_0x2bcc57){if(_0x2bcc57){return _0x2bcc57[_0xcc51('0x21')]()[_0xcc51('0x20')](function(){_0x21b16c[_0xcc51('0x17')](0xcc)[_0xcc51('0x18')]();});}};}function handleEntityNotFound(_0x4fe94e,_0xa0e982){return function(_0x1ebd35){if(!_0x1ebd35){_0x4fe94e[_0xcc51('0x22')](0x194);}return _0x1ebd35;};}function handleError(_0x2c7fb5,_0x3f2cef){_0x3f2cef=_0x3f2cef||0x1f4;return function(_0x458165){logger[_0xcc51('0x23')](_0x458165[_0xcc51('0x24')]);if(_0x458165[_0xcc51('0x25')]){delete _0x458165['name'];}_0x2c7fb5[_0xcc51('0x17')](_0x3f2cef)[_0xcc51('0x26')](_0x458165);};}exports[_0xcc51('0x27')]=function(_0x133da1,_0x228cef){var _0x1c29f6={},_0x2d7b68={},_0x4be1ed={'count':0x0,'rows':[]};var _0x2294b0=db[_0xcc51('0x28')][_0xcc51('0x29')];_0x2d7b68['model']=_[_0xcc51('0x2a')](_0x2294b0);var _0x2a7d50={'dateStart':_0x133da1['query']['dateStart'],'dateEnd':_0x133da1[_0xcc51('0x2b')]['dateEnd']};delete _0x133da1[_0xcc51('0x2b')]['dateStart'];delete _0x133da1[_0xcc51('0x2b')][_0xcc51('0x2c')];_0x2d7b68[_0xcc51('0x2b')]=_[_0xcc51('0x2a')](_0x133da1[_0xcc51('0x2b')]);_0x2d7b68[_0xcc51('0x2d')]=_['intersection'](_0x2d7b68[_0xcc51('0x2e')],_0x2d7b68[_0xcc51('0x2b')]);_0x1c29f6[_0xcc51('0x2f')]=_[_0xcc51('0x30')](_0x2d7b68[_0xcc51('0x2e')],qs[_0xcc51('0x31')](_0x133da1[_0xcc51('0x2b')]['fields']));_0x1c29f6[_0xcc51('0x2f')]=_0x1c29f6[_0xcc51('0x2f')][_0xcc51('0x32')]?_0x1c29f6['attributes']:_0x2d7b68['model'];if(!_0x133da1['query'][_0xcc51('0x33')](_0xcc51('0x34'))){_0x1c29f6[_0xcc51('0x1b')]=qs[_0xcc51('0x1b')](_0x133da1['query']['limit']);_0x1c29f6[_0xcc51('0x1a')]=qs[_0xcc51('0x1a')](_0x133da1[_0xcc51('0x2b')][_0xcc51('0x1a')]);}_0x1c29f6[_0xcc51('0x35')]=qs['sort'](_0x133da1[_0xcc51('0x2b')]['sort']);_0x1c29f6[_0xcc51('0x36')]=qs[_0xcc51('0x2d')](_[_0xcc51('0x37')](_0x133da1[_0xcc51('0x2b')],_0x2d7b68['filters']));if(_0x2a7d50['dateStart']){if(_0x2a7d50[_0xcc51('0x2c')]){_0x2a7d50[_0xcc51('0x2c')]=moment(_0x2a7d50[_0xcc51('0x2c')])[_0xcc51('0x38')](0x1,'day');}else{_0x2a7d50['dateEnd']=moment(_0x2a7d50['dateStart'])[_0xcc51('0x38')](0x1,_0xcc51('0x39'));}_[_0xcc51('0x3a')](_0x1c29f6['where'],{'createdAt':{'$gte':_0x2a7d50[_0xcc51('0x3b')],'$lte':_0x2a7d50[_0xcc51('0x2c')]}});}if(_0x133da1[_0xcc51('0x2b')]['filter']){_0x1c29f6['where']=_[_0xcc51('0x3a')](_0x1c29f6['where'],{'$or':_[_0xcc51('0x3c')](_0x2294b0,function(_0x3c0bb1){if(_0x3c0bb1[_0xcc51('0x3d')][_0xcc51('0x3e')]!=='VIRTUAL'){var _0x542927={};_0x542927[_0x3c0bb1[_0xcc51('0x3f')]]={'$like':'%'+_0x133da1['query'][_0xcc51('0x40')]+'%'};return _0x542927;}})});}_0x1c29f6=_['merge']({},_0x1c29f6,_0x133da1[_0xcc51('0x41')]);var _0x5cfc9e={'where':_0x1c29f6[_0xcc51('0x36')]};return db['ChatQueueReport']['count'](_0x5cfc9e)[_0xcc51('0x20')](function(_0x314bc4){_0x4be1ed[_0xcc51('0x19')]=_0x314bc4;if(_0x133da1[_0xcc51('0x2b')][_0xcc51('0x42')]){_0x1c29f6[_0xcc51('0x43')]=[{'all':!![]}];}return db[_0xcc51('0x28')]['findAll'](_0x1c29f6);})['then'](function(_0x33f9f8){_0x4be1ed[_0xcc51('0x44')]=_0x33f9f8;return _0x4be1ed;})[_0xcc51('0x20')](respondWithFilteredResult(_0x228cef,_0x1c29f6))[_0xcc51('0x45')](handleError(_0x228cef,null));};exports[_0xcc51('0x46')]=function(_0x10100f,_0x243d31){var _0x4d96d4={'raw':!![],'where':{'id':_0x10100f[_0xcc51('0x47')]['id']}},_0x2b7cab={};_0x2b7cab['model']=_[_0xcc51('0x2a')](db[_0xcc51('0x28')][_0xcc51('0x29')]);_0x2b7cab[_0xcc51('0x2b')]=_['keys'](_0x10100f['query']);_0x2b7cab[_0xcc51('0x2d')]=_[_0xcc51('0x30')](_0x2b7cab['model'],_0x2b7cab[_0xcc51('0x2b')]);_0x4d96d4['attributes']=_['intersection'](_0x2b7cab[_0xcc51('0x2e')],qs[_0xcc51('0x31')](_0x10100f[_0xcc51('0x2b')][_0xcc51('0x31')]));_0x4d96d4[_0xcc51('0x2f')]=_0x4d96d4[_0xcc51('0x2f')][_0xcc51('0x32')]?_0x4d96d4[_0xcc51('0x2f')]:_0x2b7cab[_0xcc51('0x2e')];if(_0x10100f[_0xcc51('0x2b')][_0xcc51('0x42')]){_0x4d96d4[_0xcc51('0x43')]=[{'all':!![]}];}_0x4d96d4=_['merge']({},_0x4d96d4,_0x10100f[_0xcc51('0x41')]);return db[_0xcc51('0x28')][_0xcc51('0x48')](_0x4d96d4)[_0xcc51('0x20')](handleEntityNotFound(_0x243d31,null))[_0xcc51('0x20')](respondWithResult(_0x243d31,null))[_0xcc51('0x45')](handleError(_0x243d31,null));};exports[_0xcc51('0x49')]=function(_0x65ef8c,_0x50fcaa){return db[_0xcc51('0x28')][_0xcc51('0x49')](_0x65ef8c['body'],{})['then'](respondWithResult(_0x50fcaa,0xc9))[_0xcc51('0x45')](handleError(_0x50fcaa,null));};exports['update']=function(_0x5c64eb,_0xc94e0a){if(_0x5c64eb[_0xcc51('0x4a')]['id']){delete _0x5c64eb[_0xcc51('0x4a')]['id'];}return db[_0xcc51('0x28')]['find']({'where':{'id':_0x5c64eb['params']['id']}})['then'](handleEntityNotFound(_0xc94e0a,null))[_0xcc51('0x20')](saveUpdates(_0x5c64eb[_0xcc51('0x4a')],null))['then'](respondWithResult(_0xc94e0a,null))[_0xcc51('0x45')](handleError(_0xc94e0a,null));};exports[_0xcc51('0x21')]=function(_0x3218b9,_0x4e98ea){return db[_0xcc51('0x28')][_0xcc51('0x48')]({'where':{'id':_0x3218b9[_0xcc51('0x47')]['id']}})[_0xcc51('0x20')](handleEntityNotFound(_0x4e98ea,null))[_0xcc51('0x20')](removeEntity(_0x4e98ea,null))[_0xcc51('0x45')](handleError(_0x4e98ea,null));};exports[_0xcc51('0x4b')]=function(_0x16ffbc,_0x34c65e){return db[_0xcc51('0x28')][_0xcc51('0x4b')]()[_0xcc51('0x20')](respondWithResult(_0x34c65e,null))[_0xcc51('0x45')](handleError(_0x34c65e,null));};
\ No newline at end of file
index 02b61b9..a090189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','./chatQueueReport.attributes','exports','define'];(function(_0x5cd62f,_0x3c0bf5){var _0x45fd3a=function(_0x5931ae){while(--_0x5931ae){_0x5cd62f['push'](_0x5cd62f['shift']());}};_0x45fd3a(++_0x3c0bf5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 attributes=require(_0x7995('0x6'));module[_0x7995('0x7')]=function(_0x576d89,_0x744bea){return _0x576d89[_0x7995('0x8')](_0x7995('0x9'),attributes,{'tableName':_0x7995('0xa'),'paranoid':![],'indexes':[{'name':_0x7995('0xb'),'fields':[_0x7995('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x34e8=['define','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','./chatQueueReport.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x34e8,0x12c));var _0x834e=function(_0x1eb746,_0x5511df){_0x1eb746=_0x1eb746-0x0;var _0x247e5e=_0x34e8[_0x1eb746];return _0x247e5e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var attributes=require(_0x834e('0x6'));module[_0x834e('0x7')]=function(_0x289ef2,_0x19a3e0){return _0x289ef2[_0x834e('0x8')]('ChatQueueReport',attributes,{'tableName':_0x834e('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x834e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index b5c1150..61bcb6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f6e=['limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','update','where','attributes'];(function(_0x1a54ac,_0x1b295e){var _0x218eac=function(_0x1f94cd){while(--_0x1f94cd){_0x1a54ac['push'](_0x1a54ac['shift']());}};_0x218eac(++_0x1b295e);}(_0x7f6e,0x1dd));var _0xe7f6=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7f6e[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xe7f6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe7f6('0x1'));var fs=require('fs');var Redis=require(_0xe7f6('0x2'));var db=require(_0xe7f6('0x3'))['db'];var utils=require(_0xe7f6('0x4'));var logger=require(_0xe7f6('0x5'))(_0xe7f6('0x6'));var config=require(_0xe7f6('0x7'));var jayson=require(_0xe7f6('0x8'));var client=jayson[_0xe7f6('0x9')][_0xe7f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e14cd,_0x49920f,_0x23f4be){return new BPromise(function(_0x5cf724,_0x3e6225){return client[_0xe7f6('0xb')](_0x5e14cd,_0x23f4be)[_0xe7f6('0xc')](function(_0x4856cf){logger['info'](_0xe7f6('0xd'),_0x49920f,'request\x20sent');logger['debug'](_0xe7f6('0xe'),_0x49920f,_0xe7f6('0xf'),JSON[_0xe7f6('0x10')](_0x4856cf));if(_0x4856cf[_0xe7f6('0x11')]){if(_0x4856cf[_0xe7f6('0x11')][_0xe7f6('0x12')]===0x1f4){logger[_0xe7f6('0x11')](_0xe7f6('0xd'),_0x49920f,_0x4856cf[_0xe7f6('0x11')]['message']);return _0x3e6225(_0x4856cf[_0xe7f6('0x11')][_0xe7f6('0x13')]);}logger[_0xe7f6('0x11')](_0xe7f6('0xd'),_0x49920f,_0x4856cf[_0xe7f6('0x11')][_0xe7f6('0x13')]);return _0x5cf724(_0x4856cf[_0xe7f6('0x11')][_0xe7f6('0x13')]);}else{logger[_0xe7f6('0x14')](_0xe7f6('0xd'),_0x49920f,_0xe7f6('0xf'));_0x5cf724(_0x4856cf[_0xe7f6('0x15')][_0xe7f6('0x13')]);}})[_0xe7f6('0x16')](function(_0x175be8){logger[_0xe7f6('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x49920f,_0x175be8);_0x3e6225(_0x175be8);});});}exports['CreateChatQueueReport']=function(_0x2fa50e){var _0x2b747f=this;return new Promise(function(_0x2e2de2,_0x3edd63){return db[_0xe7f6('0x17')][_0xe7f6('0x18')](_0x2fa50e['body'],{'raw':_0x2fa50e[_0xe7f6('0x19')]?_0x2fa50e[_0xe7f6('0x19')][_0xe7f6('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5ac6f5){logger[_0xe7f6('0x14')](_0xe7f6('0x1b'),_0x2fa50e);logger[_0xe7f6('0x1c')]('CreateChatQueueReport',_0x2fa50e,JSON[_0xe7f6('0x10')](_0x5ac6f5));_0x2e2de2(_0x5ac6f5);})['catch'](function(_0x10fb18){logger[_0xe7f6('0x11')](_0xe7f6('0x1b'),_0x10fb18[_0xe7f6('0x13')],_0x2fa50e);_0x3edd63(_0x2b747f[_0xe7f6('0x11')](0x1f4,_0x10fb18['message']));});});};exports[_0xe7f6('0x1d')]=function(_0x1c174b){var _0x2b2c89=this;return new Promise(function(_0x267a35,_0x462c85){return db[_0xe7f6('0x17')][_0xe7f6('0x1e')](_0x1c174b['body'],{'raw':_0x1c174b[_0xe7f6('0x19')]?_0x1c174b[_0xe7f6('0x19')][_0xe7f6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c174b[_0xe7f6('0x19')]?_0x1c174b[_0xe7f6('0x19')][_0xe7f6('0x1f')]||null:null,'attributes':_0x1c174b[_0xe7f6('0x19')]?_0x1c174b[_0xe7f6('0x19')][_0xe7f6('0x20')]||null:null,'limit':_0x1c174b['options']?_0x1c174b[_0xe7f6('0x19')][_0xe7f6('0x21')]||null:null})[_0xe7f6('0xc')](function(_0x32afd0){logger['info'](_0xe7f6('0x1d'),_0x1c174b);logger[_0xe7f6('0x1c')](_0xe7f6('0x1d'),_0x1c174b,JSON['stringify'](_0x32afd0));_0x267a35(_0x32afd0);})[_0xe7f6('0x16')](function(_0x1cb158){logger['error']('UpdateChatQueueReport',_0x1cb158['message'],_0x1c174b);_0x462c85(_0x2b2c89[_0xe7f6('0x11')](0x1f4,_0x1cb158[_0xe7f6('0x13')]));});});};
\ No newline at end of file
+var _0x310c=['CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x36fc1f,_0x27c1c8){var _0x371281=function(_0x2764fc){while(--_0x2764fc){_0x36fc1f['push'](_0x36fc1f['shift']());}};_0x371281(++_0x27c1c8);}(_0x310c,0x19c));var _0xc310=function(_0x4d051f,_0x171eb3){_0x4d051f=_0x4d051f-0x0;var _0x467531=_0x310c[_0x4d051f];return _0x467531;};'use strict';var _=require(_0xc310('0x0'));var util=require(_0xc310('0x1'));var moment=require(_0xc310('0x2'));var BPromise=require(_0xc310('0x3'));var rs=require(_0xc310('0x4'));var fs=require('fs');var Redis=require(_0xc310('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc310('0x6'));var config=require(_0xc310('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc310('0x8')][_0xc310('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2310e9,_0x2d5834,_0xcdc8d9){return new BPromise(function(_0x8d0613,_0x15c76f){return client[_0xc310('0xa')](_0x2310e9,_0xcdc8d9)[_0xc310('0xb')](function(_0x4fcd9b){logger[_0xc310('0xc')](_0xc310('0xd'),_0x2d5834,_0xc310('0xe'));logger[_0xc310('0xf')](_0xc310('0x10'),_0x2d5834,_0xc310('0xe'),JSON[_0xc310('0x11')](_0x4fcd9b));if(_0x4fcd9b[_0xc310('0x12')]){if(_0x4fcd9b['error'][_0xc310('0x13')]===0x1f4){logger['error'](_0xc310('0xd'),_0x2d5834,_0x4fcd9b[_0xc310('0x12')][_0xc310('0x14')]);return _0x15c76f(_0x4fcd9b['error'][_0xc310('0x14')]);}logger[_0xc310('0x12')](_0xc310('0xd'),_0x2d5834,_0x4fcd9b['error'][_0xc310('0x14')]);return _0x8d0613(_0x4fcd9b[_0xc310('0x12')][_0xc310('0x14')]);}else{logger[_0xc310('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x2d5834,_0xc310('0xe'));_0x8d0613(_0x4fcd9b['result'][_0xc310('0x14')]);}})[_0xc310('0x15')](function(_0x52a947){logger['error'](_0xc310('0xd'),_0x2d5834,_0x52a947);_0x15c76f(_0x52a947);});});}exports[_0xc310('0x16')]=function(_0x2a581e){var _0x34a075=this;return new Promise(function(_0x1aa548,_0xae3312){return db[_0xc310('0x17')][_0xc310('0x18')](_0x2a581e['body'],{'raw':_0x2a581e[_0xc310('0x19')]?_0x2a581e[_0xc310('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xc310('0xb')](function(_0x1211d1){logger[_0xc310('0xc')](_0xc310('0x16'),_0x2a581e);logger['debug'](_0xc310('0x16'),_0x2a581e,JSON['stringify'](_0x1211d1));_0x1aa548(_0x1211d1);})[_0xc310('0x15')](function(_0x51b36e){logger[_0xc310('0x12')](_0xc310('0x16'),_0x51b36e[_0xc310('0x14')],_0x2a581e);_0xae3312(_0x34a075[_0xc310('0x12')](0x1f4,_0x51b36e[_0xc310('0x14')]));});});};exports[_0xc310('0x1a')]=function(_0x323446){var _0x2cdf46=this;return new Promise(function(_0xb0eec1,_0x1913ae){return db[_0xc310('0x17')]['update'](_0x323446[_0xc310('0x1b')],{'raw':_0x323446[_0xc310('0x19')]?_0x323446[_0xc310('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x323446['options']?_0x323446['options'][_0xc310('0x1c')]||null:null,'attributes':_0x323446[_0xc310('0x19')]?_0x323446['options'][_0xc310('0x1d')]||null:null,'limit':_0x323446[_0xc310('0x19')]?_0x323446[_0xc310('0x19')][_0xc310('0x1e')]||null:null})[_0xc310('0xb')](function(_0x5984b0){logger['info'](_0xc310('0x1a'),_0x323446);logger['debug'](_0xc310('0x1a'),_0x323446,JSON['stringify'](_0x5984b0));_0xb0eec1(_0x5984b0);})[_0xc310('0x15')](function(_0x21b0f0){logger[_0xc310('0x12')](_0xc310('0x1a'),_0x21b0f0['message'],_0x323446);_0x1913ae(_0x2cdf46[_0xc310('0x12')](0x1f4,_0x21b0f0[_0xc310('0x14')]));});});};
\ No newline at end of file
index d12f007..32a5208 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf50b=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','show','create','put','/:id','update','delete'];(function(_0x26437e,_0x1d30dc){var _0x2a5c31=function(_0x3d642d){while(--_0x3d642d){_0x26437e['push'](_0x26437e['shift']());}};_0x2a5c31(++_0x1d30dc);}(_0xf50b,0x1e2));var _0xbf50=function(_0x45bf13,_0x102b9a){_0x45bf13=_0x45bf13-0x0;var _0x43a35a=_0xf50b[_0x45bf13];return _0x43a35a;};'use strict';var multer=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var path=require(_0xbf50('0x2'));var timeout=require(_0xbf50('0x3'));var express=require(_0xbf50('0x4'));var router=express['Router']();var auth=require(_0xbf50('0x5'));var interaction=require(_0xbf50('0x6'));var config=require(_0xbf50('0x7'));var controller=require(_0xbf50('0x8'));router[_0xbf50('0x9')]('/',auth[_0xbf50('0xa')](),controller['index']);router['get']('/describe',auth[_0xbf50('0xa')](),controller[_0xbf50('0xb')]);router['get']('/:id',auth[_0xbf50('0xa')](),controller[_0xbf50('0xc')]);router['post']('/',auth[_0xbf50('0xa')](),controller[_0xbf50('0xd')]);router[_0xbf50('0xe')](_0xbf50('0xf'),auth[_0xbf50('0xa')](),controller[_0xbf50('0x10')]);router[_0xbf50('0x11')]('/:id',auth[_0xbf50('0xa')](),controller[_0xbf50('0x12')]);module[_0xbf50('0x13')]=router;
\ No newline at end of file
+var _0x342b=['../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0x342b,0x19d));var _0xb342=function(_0x4d08f8,_0x27e49d){_0x4d08f8=_0x4d08f8-0x0;var _0x5b0dae=_0x342b[_0x4d08f8];return _0x5b0dae;};'use strict';var multer=require(_0xb342('0x0'));var util=require(_0xb342('0x1'));var path=require(_0xb342('0x2'));var timeout=require('connect-timeout');var express=require(_0xb342('0x3'));var router=express[_0xb342('0x4')]();var auth=require(_0xb342('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb342('0x6'));var controller=require(_0xb342('0x7'));router[_0xb342('0x8')]('/',auth[_0xb342('0x9')](),controller[_0xb342('0xa')]);router['get'](_0xb342('0xb'),auth[_0xb342('0x9')](),controller[_0xb342('0xc')]);router[_0xb342('0x8')](_0xb342('0xd'),auth[_0xb342('0x9')](),controller[_0xb342('0xe')]);router[_0xb342('0xf')]('/',auth[_0xb342('0x9')](),controller[_0xb342('0x10')]);router[_0xb342('0x11')](_0xb342('0xd'),auth[_0xb342('0x9')](),controller[_0xb342('0x12')]);router[_0xb342('0x13')]('/:id',auth[_0xb342('0x9')](),controller[_0xb342('0x14')]);module[_0xb342('0x15')]=router;
\ No newline at end of file
index a7ac652..0548959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8c0=['exports','ENUM','account','agent','queue','DATE','moment'];(function(_0x381807,_0xd8fed2){var _0x4bd8d0=function(_0x21b27f){while(--_0x21b27f){_0x381807['push'](_0x381807['shift']());}};_0x4bd8d0(++_0xd8fed2);}(_0xc8c0,0x1db));var _0x0c8c=function(_0x16389e,_0x3027d0){_0x16389e=_0x16389e-0x0;var _0x1afa8a=_0xc8c0[_0x16389e];return _0x1afa8a;};'use strict';var moment=require(_0x0c8c('0x0'));var Sequelize=require('sequelize');module[_0x0c8c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0c8c('0x2')](_0x0c8c('0x3'),_0x0c8c('0x4'),_0x0c8c('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x0c8c('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x00ce=['STRING','account','agent','queue','NOW','moment','sequelize'];(function(_0x36afb0,_0x5331ac){var _0x3ac58c=function(_0x3dda7c){while(--_0x3dda7c){_0x36afb0['push'](_0x36afb0['shift']());}};_0x3ac58c(++_0x5331ac);}(_0x00ce,0x12b));var _0xe00c=function(_0x2e9dae,_0x12d560){_0x2e9dae=_0x2e9dae-0x0;var _0x3756f5=_0x00ce[_0x2e9dae];return _0x3756f5;};'use strict';var moment=require(_0xe00c('0x0'));var Sequelize=require(_0xe00c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe00c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe00c('0x3'),_0xe00c('0x4'),_0xe00c('0x5')),'allowNull':![],'defaultValue':_0xe00c('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xe00c('0x6')]}};
\ No newline at end of file
index bde7097..b7dc7ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf95b=['pick','add','day','merge','where','filter','map','type','key','VIRTUAL','field','options','findAll','rows','params','keys','includeAll','include','find','catch','create','body','update','describe','html-pdf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','name','send','index','ChatTransferReport','rawAttributes','model','query','dateStart','dateEnd','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x22d2a8,_0x34224b){var _0x4c6392=function(_0x3ddcc5){while(--_0x3ddcc5){_0x22d2a8['push'](_0x22d2a8['shift']());}};_0x4c6392(++_0x34224b);}(_0xf95b,0x185));var _0xbf95=function(_0x5f20b3,_0x1fba4d){_0x5f20b3=_0x5f20b3-0x0;var _0x20e8bb=_0xf95b[_0x5f20b3];return _0x20e8bb;};'use strict';var pdf=require(_0xbf95('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbf95('0x1'));var rp=require(_0xbf95('0x2'));var moment=require('moment');var BPromise=require(_0xbf95('0x3'));var Mustache=require('mustache');var util=require(_0xbf95('0x4'));var path=require(_0xbf95('0x5'));var sox=require(_0xbf95('0x6'));var csv=require(_0xbf95('0x7'));var ejs=require(_0xbf95('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbf95('0x9'));var crypto=require('crypto');var jsforce=require(_0xbf95('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbf95('0x7'));var querystring=require(_0xbf95('0xb'));var Papa=require(_0xbf95('0xc'));var Redis=require(_0xbf95('0xd'));var qs=require(_0xbf95('0xe'));var logger=require(_0xbf95('0xf'))(_0xbf95('0x10'));var utils=require(_0xbf95('0x11'));var config=require(_0xbf95('0x12'));var db=require(_0xbf95('0x13'))['db'];function respondWithStatusCode(_0x53c2a6,_0x132092){_0x132092=_0x132092||0xcc;return function(_0x59447a){if(_0x59447a){return _0x53c2a6['sendStatus'](_0x132092);}return _0x53c2a6['status'](_0x132092)[_0xbf95('0x14')]();};}function respondWithResult(_0x1436b7,_0xaedd02){_0xaedd02=_0xaedd02||0xc8;return function(_0x2ac1cf){if(_0x2ac1cf){return _0x1436b7[_0xbf95('0x15')](_0xaedd02)[_0xbf95('0x16')](_0x2ac1cf);}};}function respondWithFilteredResult(_0x3f5785,_0x52e6b5){return function(_0x3f24d0){if(_0x3f24d0){var _0x5430ef=_0x3f24d0[_0xbf95('0x17')],_0x29d2e4=_0x52e6b5[_0xbf95('0x18')],_0x31c2b1=_0x52e6b5[_0xbf95('0x18')]+_0x52e6b5[_0xbf95('0x19')],_0x342481;if(_0x31c2b1>=_0x5430ef){_0x31c2b1=_0x5430ef;_0x342481=0xc8;}else{_0x342481=0xce;}_0x3f5785['status'](_0x342481);return _0x3f5785['set'](_0xbf95('0x1a'),_0x29d2e4+'-'+_0x31c2b1+'/'+_0x5430ef)[_0xbf95('0x16')](_0x3f24d0);}return null;};}function patchUpdates(_0x28b574){return function(_0x3d123){try{jsonpatch['apply'](_0x3d123,_0x28b574,!![]);}catch(_0x597fb0){return BPromise[_0xbf95('0x1b')](_0x597fb0);}return _0x3d123[_0xbf95('0x1c')]();};}function saveUpdates(_0xba8f7b,_0x2d099f){return function(_0x4096db){if(_0x4096db){return _0x4096db['update'](_0xba8f7b)['then'](function(_0x38bc79){return _0x38bc79;});}return null;};}function removeEntity(_0x421b63,_0xc1c52c){return function(_0x523a84){if(_0x523a84){return _0x523a84[_0xbf95('0x1d')]()[_0xbf95('0x1e')](function(){_0x421b63['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50fb3c,_0x52ed81){return function(_0x444904){if(!_0x444904){_0x50fb3c['sendStatus'](0x194);}return _0x444904;};}function handleError(_0xa6a4b1,_0x566098){_0x566098=_0x566098||0x1f4;return function(_0x363c98){logger['error'](_0x363c98['stack']);if(_0x363c98[_0xbf95('0x1f')]){delete _0x363c98['name'];}_0xa6a4b1[_0xbf95('0x15')](_0x566098)[_0xbf95('0x20')](_0x363c98);};}exports[_0xbf95('0x21')]=function(_0x1a6b25,_0x2ec9d3){var _0x415b1e={},_0x14c48d={},_0xa5bbd4={'count':0x0,'rows':[]};var _0x1fb776=db[_0xbf95('0x22')][_0xbf95('0x23')];_0x14c48d[_0xbf95('0x24')]=_['keys'](_0x1fb776);var _0x49b9b4={'dateStart':_0x1a6b25[_0xbf95('0x25')][_0xbf95('0x26')],'dateEnd':_0x1a6b25[_0xbf95('0x25')][_0xbf95('0x27')]};delete _0x1a6b25['query'][_0xbf95('0x26')];delete _0x1a6b25[_0xbf95('0x25')][_0xbf95('0x27')];_0x14c48d[_0xbf95('0x25')]=_['keys'](_0x1a6b25[_0xbf95('0x25')]);_0x14c48d['filters']=_['intersection'](_0x14c48d['model'],_0x14c48d[_0xbf95('0x25')]);_0x415b1e[_0xbf95('0x28')]=_[_0xbf95('0x29')](_0x14c48d[_0xbf95('0x24')],qs[_0xbf95('0x2a')](_0x1a6b25[_0xbf95('0x25')]['fields']));_0x415b1e[_0xbf95('0x28')]=_0x415b1e[_0xbf95('0x28')][_0xbf95('0x2b')]?_0x415b1e[_0xbf95('0x28')]:_0x14c48d[_0xbf95('0x24')];if(!_0x1a6b25[_0xbf95('0x25')][_0xbf95('0x2c')](_0xbf95('0x2d'))){_0x415b1e[_0xbf95('0x19')]=qs[_0xbf95('0x19')](_0x1a6b25[_0xbf95('0x25')]['limit']);_0x415b1e[_0xbf95('0x18')]=qs[_0xbf95('0x18')](_0x1a6b25['query'][_0xbf95('0x18')]);}_0x415b1e[_0xbf95('0x2e')]=qs[_0xbf95('0x2f')](_0x1a6b25[_0xbf95('0x25')][_0xbf95('0x2f')]);_0x415b1e['where']=qs[_0xbf95('0x30')](_[_0xbf95('0x31')](_0x1a6b25['query'],_0x14c48d[_0xbf95('0x30')]));if(_0x49b9b4[_0xbf95('0x26')]){if(_0x49b9b4['dateEnd']){_0x49b9b4['dateEnd']=moment(_0x49b9b4[_0xbf95('0x27')])[_0xbf95('0x32')](0x1,_0xbf95('0x33'));}else{_0x49b9b4[_0xbf95('0x27')]=moment(_0x49b9b4[_0xbf95('0x26')])['add'](0x1,_0xbf95('0x33'));}_[_0xbf95('0x34')](_0x415b1e[_0xbf95('0x35')],{'createdAt':{'$gte':_0x49b9b4[_0xbf95('0x26')],'$lte':_0x49b9b4[_0xbf95('0x27')]}});}if(_0x1a6b25[_0xbf95('0x25')][_0xbf95('0x36')]){_0x415b1e[_0xbf95('0x35')]=_['merge'](_0x415b1e[_0xbf95('0x35')],{'$or':_[_0xbf95('0x37')](_0x1fb776,function(_0x4324bd){if(_0x4324bd[_0xbf95('0x38')][_0xbf95('0x39')]!==_0xbf95('0x3a')){var _0x5954fd={};_0x5954fd[_0x4324bd[_0xbf95('0x3b')]]={'$like':'%'+_0x1a6b25[_0xbf95('0x25')]['filter']+'%'};return _0x5954fd;}})});}_0x415b1e=_[_0xbf95('0x34')]({},_0x415b1e,_0x1a6b25[_0xbf95('0x3c')]);var _0x4cfdc4={'where':_0x415b1e['where']};return db[_0xbf95('0x22')][_0xbf95('0x17')](_0x4cfdc4)[_0xbf95('0x1e')](function(_0x9efb5b){_0xa5bbd4['count']=_0x9efb5b;if(_0x1a6b25[_0xbf95('0x25')]['includeAll']){_0x415b1e['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xbf95('0x3d')](_0x415b1e);})['then'](function(_0x5adfba){_0xa5bbd4[_0xbf95('0x3e')]=_0x5adfba;return _0xa5bbd4;})['then'](respondWithFilteredResult(_0x2ec9d3,_0x415b1e))['catch'](handleError(_0x2ec9d3,null));};exports['show']=function(_0x116e98,_0x136864){var _0x31fb89={'raw':!![],'where':{'id':_0x116e98[_0xbf95('0x3f')]['id']}},_0x2cfa98={};_0x2cfa98['model']=_['keys'](db['ChatTransferReport'][_0xbf95('0x23')]);_0x2cfa98['query']=_[_0xbf95('0x40')](_0x116e98['query']);_0x2cfa98['filters']=_['intersection'](_0x2cfa98[_0xbf95('0x24')],_0x2cfa98[_0xbf95('0x25')]);_0x31fb89[_0xbf95('0x28')]=_['intersection'](_0x2cfa98[_0xbf95('0x24')],qs['fields'](_0x116e98[_0xbf95('0x25')]['fields']));_0x31fb89[_0xbf95('0x28')]=_0x31fb89['attributes']['length']?_0x31fb89[_0xbf95('0x28')]:_0x2cfa98[_0xbf95('0x24')];if(_0x116e98[_0xbf95('0x25')][_0xbf95('0x41')]){_0x31fb89[_0xbf95('0x42')]=[{'all':!![]}];}_0x31fb89=_['merge']({},_0x31fb89,_0x116e98['options']);return db['ChatTransferReport'][_0xbf95('0x43')](_0x31fb89)['then'](handleEntityNotFound(_0x136864,null))[_0xbf95('0x1e')](respondWithResult(_0x136864,null))[_0xbf95('0x44')](handleError(_0x136864,null));};exports[_0xbf95('0x45')]=function(_0x18c07a,_0x3afa50){return db[_0xbf95('0x22')][_0xbf95('0x45')](_0x18c07a[_0xbf95('0x46')],{})[_0xbf95('0x1e')](respondWithResult(_0x3afa50,0xc9))[_0xbf95('0x44')](handleError(_0x3afa50,null));};exports[_0xbf95('0x47')]=function(_0x149c3d,_0x3c0729){if(_0x149c3d[_0xbf95('0x46')]['id']){delete _0x149c3d['body']['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x149c3d[_0xbf95('0x3f')]['id']}})[_0xbf95('0x1e')](handleEntityNotFound(_0x3c0729,null))[_0xbf95('0x1e')](saveUpdates(_0x149c3d[_0xbf95('0x46')],null))['then'](respondWithResult(_0x3c0729,null))[_0xbf95('0x44')](handleError(_0x3c0729,null));};exports[_0xbf95('0x1d')]=function(_0x185870,_0xe29c95){return db[_0xbf95('0x22')]['find']({'where':{'id':_0x185870['params']['id']}})[_0xbf95('0x1e')](handleEntityNotFound(_0xe29c95,null))[_0xbf95('0x1e')](removeEntity(_0xe29c95,null))[_0xbf95('0x44')](handleError(_0xe29c95,null));};exports[_0xbf95('0x48')]=function(_0x10dbdd,_0x3e70ac){return db[_0xbf95('0x22')][_0xbf95('0x48')]()[_0xbf95('0x1e')](respondWithResult(_0x3e70ac,null))[_0xbf95('0x44')](handleError(_0x3e70ac,null));};
\ No newline at end of file
+var _0x6d0b=['findAll','rows','catch','show','options','find','create','body','params','describe','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','sox','lodash','squel','desk.js','to-csv','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','type','key','VIRTUAL','includeAll'];(function(_0x53770a,_0x29c0ad){var _0x28a05b=function(_0x203a30){while(--_0x203a30){_0x53770a['push'](_0x53770a['shift']());}};_0x28a05b(++_0x29c0ad);}(_0x6d0b,0x126));var _0xb6d0=function(_0x98aaef,_0x3de5ca){_0x98aaef=_0x98aaef-0x0;var _0xbffb8=_0x6d0b[_0x98aaef];return _0xbffb8;};'use strict';var pdf=require(_0xb6d0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb6d0('0x1'));var zipdir=require(_0xb6d0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6d0('0x3'));var moment=require('moment');var BPromise=require(_0xb6d0('0x4'));var Mustache=require('mustache');var util=require(_0xb6d0('0x5'));var path=require(_0xb6d0('0x6'));var sox=require(_0xb6d0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb6d0('0x8'));var squel=require(_0xb6d0('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb6d0('0xa'));var toCsv=require(_0xb6d0('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb6d0('0xc'));var qs=require('../../components/parsers/qs');var logger=require(_0xb6d0('0xd'))(_0xb6d0('0xe'));var utils=require(_0xb6d0('0xf'));var config=require(_0xb6d0('0x10'));var db=require(_0xb6d0('0x11'))['db'];function respondWithStatusCode(_0x233a60,_0x50d7c1){_0x50d7c1=_0x50d7c1||0xcc;return function(_0x9e9481){if(_0x9e9481){return _0x233a60[_0xb6d0('0x12')](_0x50d7c1);}return _0x233a60[_0xb6d0('0x13')](_0x50d7c1)[_0xb6d0('0x14')]();};}function respondWithResult(_0x5e94f2,_0x2f8c8d){_0x2f8c8d=_0x2f8c8d||0xc8;return function(_0x3d1503){if(_0x3d1503){return _0x5e94f2[_0xb6d0('0x13')](_0x2f8c8d)['json'](_0x3d1503);}};}function respondWithFilteredResult(_0x225fcc,_0x36bf09){return function(_0x5180a0){if(_0x5180a0){var _0x240e27=_0x5180a0[_0xb6d0('0x15')],_0x44899c=_0x36bf09[_0xb6d0('0x16')],_0x564876=_0x36bf09['offset']+_0x36bf09[_0xb6d0('0x17')],_0x2286cf;if(_0x564876>=_0x240e27){_0x564876=_0x240e27;_0x2286cf=0xc8;}else{_0x2286cf=0xce;}_0x225fcc[_0xb6d0('0x13')](_0x2286cf);return _0x225fcc[_0xb6d0('0x18')](_0xb6d0('0x19'),_0x44899c+'-'+_0x564876+'/'+_0x240e27)['json'](_0x5180a0);}return null;};}function patchUpdates(_0x1b18b6){return function(_0x29ced0){try{jsonpatch['apply'](_0x29ced0,_0x1b18b6,!![]);}catch(_0x1cc3b0){return BPromise[_0xb6d0('0x1a')](_0x1cc3b0);}return _0x29ced0[_0xb6d0('0x1b')]();};}function saveUpdates(_0x3ba197,_0x5618a2){return function(_0xda3ae1){if(_0xda3ae1){return _0xda3ae1[_0xb6d0('0x1c')](_0x3ba197)[_0xb6d0('0x1d')](function(_0x48fb16){return _0x48fb16;});}return null;};}function removeEntity(_0x3f3e5b,_0x16bc7d){return function(_0x1e4bb6){if(_0x1e4bb6){return _0x1e4bb6[_0xb6d0('0x1e')]()['then'](function(){_0x3f3e5b[_0xb6d0('0x13')](0xcc)[_0xb6d0('0x14')]();});}};}function handleEntityNotFound(_0x3b0449,_0x3b5e69){return function(_0x2ca10b){if(!_0x2ca10b){_0x3b0449[_0xb6d0('0x12')](0x194);}return _0x2ca10b;};}function handleError(_0x53b5d2,_0x10ea59){_0x10ea59=_0x10ea59||0x1f4;return function(_0x457de5){logger[_0xb6d0('0x1f')](_0x457de5[_0xb6d0('0x20')]);if(_0x457de5[_0xb6d0('0x21')]){delete _0x457de5[_0xb6d0('0x21')];}_0x53b5d2[_0xb6d0('0x13')](_0x10ea59)[_0xb6d0('0x22')](_0x457de5);};}exports[_0xb6d0('0x23')]=function(_0x18f165,_0x33dc10){var _0x581acd={},_0xdc4647={},_0x497171={'count':0x0,'rows':[]};var _0x1896a6=db[_0xb6d0('0x24')][_0xb6d0('0x25')];_0xdc4647[_0xb6d0('0x26')]=_[_0xb6d0('0x27')](_0x1896a6);var _0x57e412={'dateStart':_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x29')],'dateEnd':_0x18f165['query'][_0xb6d0('0x2a')]};delete _0x18f165[_0xb6d0('0x28')][_0xb6d0('0x29')];delete _0x18f165['query'][_0xb6d0('0x2a')];_0xdc4647[_0xb6d0('0x28')]=_[_0xb6d0('0x27')](_0x18f165[_0xb6d0('0x28')]);_0xdc4647[_0xb6d0('0x2b')]=_[_0xb6d0('0x2c')](_0xdc4647[_0xb6d0('0x26')],_0xdc4647['query']);_0x581acd[_0xb6d0('0x2d')]=_[_0xb6d0('0x2c')](_0xdc4647['model'],qs[_0xb6d0('0x2e')](_0x18f165['query'][_0xb6d0('0x2e')]));_0x581acd[_0xb6d0('0x2d')]=_0x581acd[_0xb6d0('0x2d')][_0xb6d0('0x2f')]?_0x581acd[_0xb6d0('0x2d')]:_0xdc4647['model'];if(!_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x30')]('nolimit')){_0x581acd['limit']=qs[_0xb6d0('0x17')](_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x17')]);_0x581acd[_0xb6d0('0x16')]=qs['offset'](_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x16')]);}_0x581acd[_0xb6d0('0x31')]=qs['sort'](_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x32')]);_0x581acd[_0xb6d0('0x33')]=qs[_0xb6d0('0x2b')](_[_0xb6d0('0x34')](_0x18f165['query'],_0xdc4647[_0xb6d0('0x2b')]));if(_0x57e412['dateStart']){if(_0x57e412[_0xb6d0('0x2a')]){_0x57e412[_0xb6d0('0x2a')]=moment(_0x57e412[_0xb6d0('0x2a')])[_0xb6d0('0x35')](0x1,_0xb6d0('0x36'));}else{_0x57e412[_0xb6d0('0x2a')]=moment(_0x57e412['dateStart'])[_0xb6d0('0x35')](0x1,'day');}_[_0xb6d0('0x37')](_0x581acd[_0xb6d0('0x33')],{'createdAt':{'$gte':_0x57e412[_0xb6d0('0x29')],'$lte':_0x57e412[_0xb6d0('0x2a')]}});}if(_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x38')]){_0x581acd['where']=_[_0xb6d0('0x37')](_0x581acd['where'],{'$or':_['map'](_0x1896a6,function(_0x29565d){if(_0x29565d[_0xb6d0('0x39')][_0xb6d0('0x3a')]!==_0xb6d0('0x3b')){var _0x349fc7={};_0x349fc7[_0x29565d['field']]={'$like':'%'+_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x38')]+'%'};return _0x349fc7;}})});}_0x581acd=_[_0xb6d0('0x37')]({},_0x581acd,_0x18f165['options']);var _0x35e8b5={'where':_0x581acd[_0xb6d0('0x33')]};return db[_0xb6d0('0x24')][_0xb6d0('0x15')](_0x35e8b5)['then'](function(_0xb8ad12){_0x497171[_0xb6d0('0x15')]=_0xb8ad12;if(_0x18f165[_0xb6d0('0x28')][_0xb6d0('0x3c')]){_0x581acd['include']=[{'all':!![]}];}return db[_0xb6d0('0x24')][_0xb6d0('0x3d')](_0x581acd);})[_0xb6d0('0x1d')](function(_0x1489a8){_0x497171[_0xb6d0('0x3e')]=_0x1489a8;return _0x497171;})[_0xb6d0('0x1d')](respondWithFilteredResult(_0x33dc10,_0x581acd))[_0xb6d0('0x3f')](handleError(_0x33dc10,null));};exports[_0xb6d0('0x40')]=function(_0x5a457b,_0x5411a0){var _0x41c041={'raw':!![],'where':{'id':_0x5a457b['params']['id']}},_0x268edf={};_0x268edf['model']=_[_0xb6d0('0x27')](db[_0xb6d0('0x24')][_0xb6d0('0x25')]);_0x268edf[_0xb6d0('0x28')]=_[_0xb6d0('0x27')](_0x5a457b[_0xb6d0('0x28')]);_0x268edf[_0xb6d0('0x2b')]=_['intersection'](_0x268edf[_0xb6d0('0x26')],_0x268edf[_0xb6d0('0x28')]);_0x41c041['attributes']=_[_0xb6d0('0x2c')](_0x268edf[_0xb6d0('0x26')],qs['fields'](_0x5a457b[_0xb6d0('0x28')][_0xb6d0('0x2e')]));_0x41c041[_0xb6d0('0x2d')]=_0x41c041[_0xb6d0('0x2d')]['length']?_0x41c041[_0xb6d0('0x2d')]:_0x268edf[_0xb6d0('0x26')];if(_0x5a457b[_0xb6d0('0x28')]['includeAll']){_0x41c041['include']=[{'all':!![]}];}_0x41c041=_[_0xb6d0('0x37')]({},_0x41c041,_0x5a457b[_0xb6d0('0x41')]);return db['ChatTransferReport'][_0xb6d0('0x42')](_0x41c041)[_0xb6d0('0x1d')](handleEntityNotFound(_0x5411a0,null))[_0xb6d0('0x1d')](respondWithResult(_0x5411a0,null))[_0xb6d0('0x3f')](handleError(_0x5411a0,null));};exports['create']=function(_0x341a71,_0x3744f0){return db[_0xb6d0('0x24')][_0xb6d0('0x43')](_0x341a71['body'],{})[_0xb6d0('0x1d')](respondWithResult(_0x3744f0,0xc9))['catch'](handleError(_0x3744f0,null));};exports['update']=function(_0x2f9f10,_0x44de7e){if(_0x2f9f10['body']['id']){delete _0x2f9f10[_0xb6d0('0x44')]['id'];}return db[_0xb6d0('0x24')][_0xb6d0('0x42')]({'where':{'id':_0x2f9f10[_0xb6d0('0x45')]['id']}})[_0xb6d0('0x1d')](handleEntityNotFound(_0x44de7e,null))[_0xb6d0('0x1d')](saveUpdates(_0x2f9f10['body'],null))[_0xb6d0('0x1d')](respondWithResult(_0x44de7e,null))[_0xb6d0('0x3f')](handleError(_0x44de7e,null));};exports[_0xb6d0('0x1e')]=function(_0x4ae81d,_0x56921d){return db[_0xb6d0('0x24')][_0xb6d0('0x42')]({'where':{'id':_0x4ae81d[_0xb6d0('0x45')]['id']}})[_0xb6d0('0x1d')](handleEntityNotFound(_0x56921d,null))[_0xb6d0('0x1d')](removeEntity(_0x56921d,null))[_0xb6d0('0x3f')](handleError(_0x56921d,null));};exports[_0xb6d0('0x46')]=function(_0x141d2e,_0x11d528){return db['ChatTransferReport'][_0xb6d0('0x46')]()['then'](respondWithResult(_0x11d528,null))[_0xb6d0('0x3f')](handleError(_0x11d528,null));};
\ No newline at end of file
index 3445908..fd89ed8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d96=['report_chat_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','./chatTransferReport.attributes','define','ChatTransferReport'];(function(_0x4b8ef3,_0x2cc187){var _0x12f5d7=function(_0x24b55b){while(--_0x24b55b){_0x4b8ef3['push'](_0x4b8ef3['shift']());}};_0x12f5d7(++_0x2cc187);}(_0x2d96,0x107));var _0x62d9=function(_0x2939de,_0x3b948c){_0x2939de=_0x2939de-0x0;var _0x36bdc6=_0x2d96[_0x2939de];return _0x36bdc6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x62d9('0x0'))(_0x62d9('0x1'));var moment=require('moment');var BPromise=require(_0x62d9('0x2'));var rp=require(_0x62d9('0x3'));var attributes=require(_0x62d9('0x4'));module['exports']=function(_0x403fbf,_0xb52704){return _0x403fbf[_0x62d9('0x5')](_0x62d9('0x6'),attributes,{'tableName':_0x62d9('0x7'),'paranoid':![],'indexes':[{'name':_0x62d9('0x8'),'fields':[_0x62d9('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x314c=['bluebird','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x151e0b,_0x3bec86){var _0x5d4a5c=function(_0x1567f4){while(--_0x1567f4){_0x151e0b['push'](_0x151e0b['shift']());}};_0x5d4a5c(++_0x3bec86);}(_0x314c,0x128));var _0xc314=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x314c[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0xc314('0x0'));var util=require(_0xc314('0x1'));var logger=require(_0xc314('0x2'))(_0xc314('0x3'));var moment=require('moment');var BPromise=require(_0xc314('0x4'));var rp=require('request-promise');var attributes=require(_0xc314('0x5'));module[_0xc314('0x6')]=function(_0x52d94c,_0x349627){return _0x52d94c[_0xc314('0x7')](_0xc314('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc314('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 7a878ea..e71e0f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2285=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x42bd43,_0x59fb77){var _0x421e88=function(_0x485e11){while(--_0x485e11){_0x42bd43['push'](_0x42bd43['shift']());}};_0x421e88(++_0x59fb77);}(_0x2285,0x177));var _0x5228=function(_0x53832d,_0x49cec2){_0x53832d=_0x53832d-0x0;var _0x20efe2=_0x2285[_0x53832d];return _0x20efe2;};'use strict';var _=require('lodash');var util=require(_0x5228('0x0'));var moment=require(_0x5228('0x1'));var BPromise=require(_0x5228('0x2'));var rs=require(_0x5228('0x3'));var fs=require('fs');var Redis=require(_0x5228('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5228('0x5'));var logger=require(_0x5228('0x6'))('rpc');var config=require(_0x5228('0x7'));var jayson=require(_0x5228('0x8'));var client=jayson[_0x5228('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b2db,_0x156977,_0x192393){return new BPromise(function(_0x322b86,_0x81c9c6){return client[_0x5228('0xa')](_0x18b2db,_0x192393)[_0x5228('0xb')](function(_0xbd1b8d){logger[_0x5228('0xc')](_0x5228('0xd'),_0x156977,'request\x20sent');logger[_0x5228('0xe')](_0x5228('0xf'),_0x156977,_0x5228('0x10'),JSON[_0x5228('0x11')](_0xbd1b8d));if(_0xbd1b8d['error']){if(_0xbd1b8d[_0x5228('0x12')][_0x5228('0x13')]===0x1f4){logger[_0x5228('0x12')](_0x5228('0xd'),_0x156977,_0xbd1b8d['error'][_0x5228('0x14')]);return _0x81c9c6(_0xbd1b8d[_0x5228('0x12')][_0x5228('0x14')]);}logger[_0x5228('0x12')](_0x5228('0xd'),_0x156977,_0xbd1b8d[_0x5228('0x12')]['message']);return _0x322b86(_0xbd1b8d[_0x5228('0x12')][_0x5228('0x14')]);}else{logger['info'](_0x5228('0xd'),_0x156977,_0x5228('0x10'));_0x322b86(_0xbd1b8d['result'][_0x5228('0x14')]);}})[_0x5228('0x15')](function(_0x1c4121){logger[_0x5228('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x156977,_0x1c4121);_0x81c9c6(_0x1c4121);});});}
\ No newline at end of file
+var _0xa62c=['request','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3a48f9,_0x3a4581){var _0x303f3f=function(_0x4275bb){while(--_0x4275bb){_0x3a48f9['push'](_0x3a48f9['shift']());}};_0x303f3f(++_0x3a4581);}(_0xa62c,0x70));var _0xca62=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xa62c[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0xca62('0x0'));var util=require(_0xca62('0x1'));var moment=require(_0xca62('0x2'));var BPromise=require(_0xca62('0x3'));var rs=require(_0xca62('0x4'));var fs=require('fs');var Redis=require(_0xca62('0x5'));var db=require(_0xca62('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xca62('0x7'))(_0xca62('0x8'));var config=require(_0xca62('0x9'));var jayson=require(_0xca62('0xa'));var client=jayson[_0xca62('0xb')][_0xca62('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x310378,_0x4584ab,_0x5da9b9){return new BPromise(function(_0x2160c4,_0xd7f11b){return client[_0xca62('0xd')](_0x310378,_0x5da9b9)['then'](function(_0x29fce7){logger[_0xca62('0xe')](_0xca62('0xf'),_0x4584ab,'request\x20sent');logger[_0xca62('0x10')](_0xca62('0x11'),_0x4584ab,_0xca62('0x12'),JSON[_0xca62('0x13')](_0x29fce7));if(_0x29fce7[_0xca62('0x14')]){if(_0x29fce7[_0xca62('0x14')][_0xca62('0x15')]===0x1f4){logger[_0xca62('0x14')](_0xca62('0xf'),_0x4584ab,_0x29fce7['error'][_0xca62('0x16')]);return _0xd7f11b(_0x29fce7[_0xca62('0x14')][_0xca62('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4584ab,_0x29fce7['error'][_0xca62('0x16')]);return _0x2160c4(_0x29fce7['error'][_0xca62('0x16')]);}else{logger[_0xca62('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x4584ab,'request\x20sent');_0x2160c4(_0x29fce7[_0xca62('0x17')][_0xca62('0x16')]);}})[_0xca62('0x18')](function(_0x5512c2){logger[_0xca62('0x14')](_0xca62('0xf'),_0x4584ab,_0x5512c2);_0xd7f11b(_0x5512c2);});});}
\ No newline at end of file
index 8d6293a..7e6c21f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d2=['delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','post','create','put','update'];(function(_0x4471f5,_0x4c8ac8){var _0x5a7082=function(_0x299d14){while(--_0x299d14){_0x4471f5['push'](_0x4471f5['shift']());}};_0x5a7082(++_0x4c8ac8);}(_0xc7d2,0x16b));var _0x2c7d=function(_0x58da8a,_0x1c0584){_0x58da8a=_0x58da8a-0x0;var _0x5ba3a3=_0xc7d2[_0x58da8a];return _0x5ba3a3;};'use strict';var multer=require(_0x2c7d('0x0'));var util=require(_0x2c7d('0x1'));var path=require(_0x2c7d('0x2'));var timeout=require(_0x2c7d('0x3'));var express=require(_0x2c7d('0x4'));var router=express[_0x2c7d('0x5')]();var auth=require(_0x2c7d('0x6'));var interaction=require(_0x2c7d('0x7'));var config=require(_0x2c7d('0x8'));var controller=require('./chatTransferReport.controller');router[_0x2c7d('0x9')]('/',auth[_0x2c7d('0xa')](),controller['index']);router[_0x2c7d('0x9')](_0x2c7d('0xb'),auth[_0x2c7d('0xa')](),controller[_0x2c7d('0xc')]);router[_0x2c7d('0x9')]('/:id',auth[_0x2c7d('0xa')](),controller['show']);router[_0x2c7d('0xd')]('/',auth[_0x2c7d('0xa')](),controller[_0x2c7d('0xe')]);router[_0x2c7d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2c7d('0x10')]);router[_0x2c7d('0x11')](_0x2c7d('0x12'),auth[_0x2c7d('0xa')](),controller['destroy']);module[_0x2c7d('0x13')]=router;
\ No newline at end of file
+var _0x1a61=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1ad585,_0x2b92b3){var _0x3c0732=function(_0x424334){while(--_0x424334){_0x1ad585['push'](_0x1ad585['shift']());}};_0x3c0732(++_0x2b92b3);}(_0x1a61,0xf1));var _0x11a6=function(_0x482644,_0x572092){_0x482644=_0x482644-0x0;var _0x49969e=_0x1a61[_0x482644];return _0x49969e;};'use strict';var multer=require('multer');var util=require(_0x11a6('0x0'));var path=require(_0x11a6('0x1'));var timeout=require(_0x11a6('0x2'));var express=require(_0x11a6('0x3'));var router=express['Router']();var auth=require(_0x11a6('0x4'));var interaction=require(_0x11a6('0x5'));var config=require(_0x11a6('0x6'));var controller=require('./chatTransferReport.controller');router[_0x11a6('0x7')]('/',auth[_0x11a6('0x8')](),controller['index']);router[_0x11a6('0x7')](_0x11a6('0x9'),auth[_0x11a6('0x8')](),controller[_0x11a6('0xa')]);router['get'](_0x11a6('0xb'),auth['isAuthenticated'](),controller[_0x11a6('0xc')]);router[_0x11a6('0xd')]('/',auth[_0x11a6('0x8')](),controller[_0x11a6('0xe')]);router[_0x11a6('0xf')](_0x11a6('0xb'),auth['isAuthenticated'](),controller[_0x11a6('0x10')]);router[_0x11a6('0x11')]('/:id',auth[_0x11a6('0x8')](),controller[_0x11a6('0x12')]);module[_0x11a6('0x13')]=router;
\ No newline at end of file
index 321b741..106cccb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf79=['exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','sequelize','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf79,0xe4));var _0x9af7=function(_0x40d2f1,_0xd2a835){_0x40d2f1=_0x40d2f1-0x0;var _0x41e7d1=_0xaf79[_0x40d2f1];return _0x41e7d1;};'use strict';var Sequelize=require(_0x9af7('0x0'));var rs=require(_0x9af7('0x1'));module[_0x9af7('0x2')]={'name':{'type':Sequelize[_0x9af7('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x9af7('0x3')],'allowNull':![],'unique':_0x9af7('0x4')},'description':{'type':Sequelize[_0x9af7('0x3')]},'mapKey':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x5')},'mapKeyOffline':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x9af7('0x6')},'customerAlias':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9af7('0x3')],'allowNull':![],'defaultValue':_0x9af7('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9af7('0x3')],'allowNull':![],'defaultValue':_0x9af7('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9af7('0x3')],'allowNull':![],'defaultValue':_0x9af7('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9af7('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9af7('0xa')]('rounded',_0x9af7('0xb')),'defaultValue':_0x9af7('0xc')},'header_online':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0xd')},'start_chat_button':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9af7('0xf')},'header_offline':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x10')},'download_transcript':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9af7('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9af7('0x13')]},'closingQuestion':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x14')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x15')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9af7('0x16')},'placeholderMessage':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x17')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9af7('0x18')},'closingMessageButton':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0xf')},'skipMessageButton':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x19')},'conditionAgreement':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0x9af7('0x1a'),_0x9af7('0x1b')),'defaultValue':_0x9af7('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x9af7('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9af7('0x13')],'defaultValue':function(){return JSON[_0x9af7('0x1c')]({'items':[{'type':_0x9af7('0x1d'),'variable':null,'config':{'placeholder':_0x9af7('0x1e'),'type':_0x9af7('0x1f'),'required':!![]},'props':{'title':_0x9af7('0x1e'),'helpText':''}},{'type':_0x9af7('0x1d'),'props':{'title':_0x9af7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9af7('0x5'),'type':_0x9af7('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9af7('0x20')](_0x9af7('0x21'))?JSON[_0x9af7('0x22')](this['getDataValue'](_0x9af7('0x21'))):{};},'set':function(_0x5c587f){return this['setDataValue'](_0x9af7('0x21'),JSON[_0x9af7('0x1c')](_0x5c587f));}},'offlineForm':{'type':Sequelize[_0x9af7('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9af7('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9af7('0x5'),'type':_0x9af7('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x9af7('0x23')},'props':{'title':_0x9af7('0x23'),'helpText':_0x9af7('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x9af7('0x20')](_0x9af7('0x25'))?JSON[_0x9af7('0x22')](this[_0x9af7('0x20')](_0x9af7('0x25'))):{};},'set':function(_0x5c29b9){return this['setDataValue'](_0x9af7('0x25'),JSON[_0x9af7('0x1c')](_0x5c29b9));}},'token':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9af7('0x3')]},'forwardOffline':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9af7('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x27')},'offlineMessageBody':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x28')},'skipUnmanaged':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0x19')},'sendUnmanaged':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':_0x9af7('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9af7('0x13')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9af7('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9af7('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x9af7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x9af7('0x2a')},'verticalAlignment':{'type':Sequelize[_0x9af7('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x9af7('0x2b')},'defaultTitle':{'type':Sequelize[_0x9af7('0x3')]},'customerAvatar':{'type':Sequelize[_0x9af7('0x13')]},'showCustomerAvatar':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9af7('0x3')],'allowNull':![],'defaultValue':_0x9af7('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9af7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9af7('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9af7('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x9af7('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xc6ac=['generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','thumb','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2bbe2b,_0x1dae53){_0x2bbe2b=_0x2bbe2b-0x0;var _0x4f9675=_0xc6ac[_0x2bbe2b];return _0x4f9675;};'use strict';var Sequelize=require(_0xcc6a('0x0'));var rs=require(_0xcc6a('0x1'));module[_0xcc6a('0x2')]={'name':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![],'unique':_0xcc6a('0x4')},'description':{'type':Sequelize[_0xcc6a('0x3')]},'mapKey':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x5')},'mapKeyOffline':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x5')},'key':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![],'defaultValue':_0xcc6a('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![],'defaultValue':_0xcc6a('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xcc6a('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xcc6a('0x3')]},'animation':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xcc6a('0xb'),_0xcc6a('0xc')),'defaultValue':_0xcc6a('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xcc6a('0xd')},'start_chat_button':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0xf')},'download_transcript':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xcc6a('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xcc6a('0x11')]},'closingQuestion':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x14')},'closingMessage':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x15')},'closingMessageButton':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x16')},'skipMessageButton':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x17')},'conditionAgreement':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0xcc6a('0x18'),_0xcc6a('0x19')),'defaultValue':_0xcc6a('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xcc6a('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xcc6a('0x11')],'defaultValue':function(){return JSON[_0xcc6a('0x1a')]({'items':[{'type':_0xcc6a('0x1b'),'variable':null,'config':{'placeholder':_0xcc6a('0x1c'),'type':_0xcc6a('0x1d'),'required':!![]},'props':{'title':_0xcc6a('0x1c'),'helpText':''}},{'type':_0xcc6a('0x1b'),'props':{'title':_0xcc6a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xcc6a('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xcc6a('0x1e')](_0xcc6a('0x1f'))?JSON['parse'](this[_0xcc6a('0x1e')](_0xcc6a('0x1f'))):{};},'set':function(_0x3a00e5){return this[_0xcc6a('0x20')](_0xcc6a('0x1f'),JSON[_0xcc6a('0x1a')](_0x3a00e5));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xcc6a('0x1a')]({'items':[{'type':_0xcc6a('0x1b'),'props':{'title':_0xcc6a('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xcc6a('0x5')},'variable':null},{'type':_0xcc6a('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0xcc6a('0x22'),'helpText':_0xcc6a('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xcc6a('0x1e')](_0xcc6a('0x24'))?JSON['parse'](this[_0xcc6a('0x1e')](_0xcc6a('0x24'))):{};},'set':function(_0x2c6d88){return this['setDataValue'](_0xcc6a('0x24'),JSON['stringify'](_0x2c6d88));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xcc6a('0x25')]();}},'autoclose':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xcc6a('0x3')]},'forwardOffline':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x26')},'waitingMessage':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x27')},'offlineMessageSubject':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x28')},'offlineMessageBody':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x17')},'sendUnmanaged':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x16')},'enableCustomerAttachment':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xcc6a('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xcc6a('0x2b');}},'notificationSound':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x2c')},'verticalAlignment':{'type':Sequelize[_0xcc6a('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xcc6a('0x2d')},'defaultTitle':{'type':Sequelize[_0xcc6a('0x3')]},'customerAvatar':{'type':Sequelize[_0xcc6a('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xcc6a('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xcc6a('0x3')],'allowNull':![],'defaultValue':_0xcc6a('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcc6a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcc6a('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcc6a('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xcc6a('0x3')],'defaultValue':_0xcc6a('0x2f')},'systemAvatar':{'type':Sequelize[_0xcc6a('0x11')]}};
\ No newline at end of file
index 1eaf1c5..01dc722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb64f=['list','orderBy','priority','asc','ListId','contact','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','Start','startRouting','EventManager','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','email','offlineMessageSubject','addInteraction','omit','Owner','fullname','internal','Tag','Tags','tag','timezone','iftime\x20%s,%s','iftime\x20%s','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.js','utf8','remote','x-real-ip','alignment','verticalAlignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','User','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','ChatWebsite','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','add','day','merge','where','filter','type','key','field','includeAll','include','findAll','rows','show','params','options','find','create','body','user','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','nolimit','map','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','file','filename','agentAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','../../config/license/util','isNil','sitepic','existsSync','server/files/images/logos/','download','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications'];(function(_0x41de6c,_0x313128){var _0x231c66=function(_0x474c22){while(--_0x474c22){_0x41de6c['push'](_0x41de6c['shift']());}};_0x231c66(++_0x313128);}(_0xb64f,0x186));var _0xfb64=function(_0x2da45d,_0x35397b){_0x2da45d=_0x2da45d-0x0;var _0x1012a0=_0xb64f[_0x2da45d];return _0x1012a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfb64('0x0'));var rimraf=require(_0xfb64('0x1'));var zipdir=require(_0xfb64('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb64('0x3'));var moment=require('moment');var BPromise=require(_0xfb64('0x4'));var Mustache=require(_0xfb64('0x5'));var util=require('util');var path=require(_0xfb64('0x6'));var sox=require(_0xfb64('0x7'));var csv=require(_0xfb64('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfb64('0x9'));var squel=require(_0xfb64('0xa'));var crypto=require(_0xfb64('0xb'));var jsforce=require(_0xfb64('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfb64('0x8'));var querystring=require(_0xfb64('0xd'));var Papa=require(_0xfb64('0xe'));var Redis=require(_0xfb64('0xf'));var qs=require(_0xfb64('0x10'));var logger=require(_0xfb64('0x11'))(_0xfb64('0x12'));var utils=require('../../config/utils');var config=require(_0xfb64('0x13'));var db=require(_0xfb64('0x14'))['db'];config[_0xfb64('0x15')]=_['defaults'](config[_0xfb64('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb64('0x16'))(new Redis(config['redis']));require(_0xfb64('0x17'))[_0xfb64('0x18')](socket);var jayson=require(_0xfb64('0x19'));var client=jayson[_0xfb64('0x1a')][_0xfb64('0x1b')]({'port':0x232c});var client9002=jayson[_0xfb64('0x1a')][_0xfb64('0x1b')]({'port':0x232a});var client9003=jayson[_0xfb64('0x1a')]['http']({'port':0x232b});function respondWithRpcPromise(_0x54f51d,_0x586e55,_0x5ca9cc,_0x305e43){return new BPromise(function(_0x2eb850,_0xca0da9){var _0x1719f8=_0x305e43||client;return _0x1719f8[_0xfb64('0x1c')](_0x54f51d,_0x5ca9cc)['then'](function(_0x2e74da){logger[_0xfb64('0x1d')](_0xfb64('0x1e'),_0x586e55,_0xfb64('0x1f'));logger['debug'](_0xfb64('0x20'),_0x586e55,_0xfb64('0x1f'),JSON[_0xfb64('0x21')](_0x2e74da));if(_0x2e74da['error']){if(_0x2e74da[_0xfb64('0x22')][_0xfb64('0x23')]===0x1f4){logger[_0xfb64('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x586e55,_0x2e74da['error'][_0xfb64('0x24')]);return _0xca0da9(_0x2e74da[_0xfb64('0x22')][_0xfb64('0x24')]);}logger[_0xfb64('0x22')](_0xfb64('0x1e'),_0x586e55,_0x2e74da[_0xfb64('0x22')][_0xfb64('0x24')]);return _0x2eb850(_0x2e74da[_0xfb64('0x22')][_0xfb64('0x24')]);}else{logger[_0xfb64('0x1d')](_0xfb64('0x1e'),_0x586e55,_0xfb64('0x1f'));_0x2eb850(_0x2e74da['result']['message']);}})[_0xfb64('0x25')](function(_0x110f3b){logger[_0xfb64('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x586e55,_0x110f3b);_0xca0da9(_0x110f3b);});});}function respondWithStatusCode(_0xdc9637,_0x3b08a3){_0x3b08a3=_0x3b08a3||0xcc;return function(_0x397a37){if(_0x397a37){return _0xdc9637[_0xfb64('0x26')](_0x3b08a3);}return _0xdc9637['status'](_0x3b08a3)[_0xfb64('0x27')]();};}function respondWithResult(_0x3912fb,_0x59f6a6){_0x59f6a6=_0x59f6a6||0xc8;return function(_0x4cb8ce){if(_0x4cb8ce){return _0x3912fb[_0xfb64('0x28')](_0x59f6a6)[_0xfb64('0x29')](_0x4cb8ce);}};}function respondWithFilteredResult(_0x59a4d9,_0x3f4e23){return function(_0x319bb1){if(_0x319bb1){var _0x300a39=_0x319bb1[_0xfb64('0x2a')],_0x1375ce=_0x3f4e23['offset'],_0x260cc2=_0x3f4e23[_0xfb64('0x2b')]+_0x3f4e23['limit'],_0x57887c;if(_0x260cc2>=_0x300a39){_0x260cc2=_0x300a39;_0x57887c=0xc8;}else{_0x57887c=0xce;}_0x59a4d9[_0xfb64('0x28')](_0x57887c);return _0x59a4d9[_0xfb64('0x2c')](_0xfb64('0x2d'),_0x1375ce+'-'+_0x260cc2+'/'+_0x300a39)[_0xfb64('0x29')](_0x319bb1);}return null;};}function patchUpdates(_0x3b093d){return function(_0x43393c){try{jsonpatch[_0xfb64('0x2e')](_0x43393c,_0x3b093d,!![]);}catch(_0x359283){return BPromise[_0xfb64('0x2f')](_0x359283);}return _0x43393c[_0xfb64('0x30')]();};}function saveUpdates(_0xfa607e,_0x2b6fd2){return function(_0x3c9267){if(_0x3c9267){return _0x3c9267['update'](_0xfa607e)[_0xfb64('0x31')](function(_0x40811d){return _0x40811d;});}return null;};}function removeEntity(_0x35c5fd,_0x77b1b3){return function(_0x280e6a){if(_0x280e6a){return _0x280e6a[_0xfb64('0x32')]()[_0xfb64('0x31')](function(){var _0x2adcab=_0x280e6a['get']({'plain':!![]});var _0x36f3b5=_0xfb64('0x33');return db[_0xfb64('0x34')][_0xfb64('0x32')]({'where':{'type':_0x36f3b5,'resourceId':_0x2adcab['id']}})[_0xfb64('0x31')](function(){return _0x280e6a;});})[_0xfb64('0x31')](function(){_0x35c5fd['status'](0xcc)[_0xfb64('0x27')]();});}};}function handleEntityNotFound(_0x35bd51,_0xff8fff){return function(_0x3d47a3){if(!_0x3d47a3){_0x35bd51[_0xfb64('0x26')](0x194);}return _0x3d47a3;};}function handleError(_0x4b8a88,_0x3b4655){_0x3b4655=_0x3b4655||0x1f4;return function(_0x2c252e){logger[_0xfb64('0x22')](_0x2c252e[_0xfb64('0x35')]);if(_0x2c252e[_0xfb64('0x36')]){delete _0x2c252e[_0xfb64('0x36')];}_0x4b8a88['status'](_0x3b4655)[_0xfb64('0x37')](_0x2c252e);};}exports[_0xfb64('0x38')]=function(_0x5754f3,_0x4cd047){var _0xa24ea2={},_0x30efd9={},_0x45836f={'count':0x0,'rows':[]};var _0x714126=db[_0xfb64('0x39')][_0xfb64('0x3a')];_0x30efd9[_0xfb64('0x3b')]=_[_0xfb64('0x3c')](_0x714126);var _0x4713ff={'dateStart':_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x3e')],'dateEnd':_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x3f')]};delete _0x5754f3[_0xfb64('0x3d')][_0xfb64('0x3e')];delete _0x5754f3[_0xfb64('0x3d')][_0xfb64('0x3f')];_0x30efd9['query']=_[_0xfb64('0x3c')](_0x5754f3[_0xfb64('0x3d')]);_0x30efd9[_0xfb64('0x40')]=_['intersection'](_0x30efd9['model'],_0x30efd9[_0xfb64('0x3d')]);_0xa24ea2['attributes']=_[_0xfb64('0x41')](_0x30efd9['model'],qs[_0xfb64('0x42')](_0x5754f3['query'][_0xfb64('0x42')]));_0xa24ea2[_0xfb64('0x43')]=_0xa24ea2[_0xfb64('0x43')][_0xfb64('0x44')]?_0xa24ea2[_0xfb64('0x43')]:_0x30efd9['model'];if(!_0x5754f3['query'][_0xfb64('0x45')]('nolimit')){_0xa24ea2[_0xfb64('0x46')]=qs[_0xfb64('0x46')](_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x46')]);_0xa24ea2['offset']=qs[_0xfb64('0x2b')](_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x2b')]);}_0xa24ea2[_0xfb64('0x47')]=qs[_0xfb64('0x48')](_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x48')]);_0xa24ea2['where']=qs['filters'](_[_0xfb64('0x49')](_0x5754f3[_0xfb64('0x3d')],_0x30efd9[_0xfb64('0x40')]));if(_0x4713ff['dateStart']){if(_0x4713ff['dateEnd']){_0x4713ff[_0xfb64('0x3f')]=moment(_0x4713ff[_0xfb64('0x3f')])[_0xfb64('0x4a')](0x1,_0xfb64('0x4b'));}else{_0x4713ff[_0xfb64('0x3f')]=moment(_0x4713ff[_0xfb64('0x3e')])[_0xfb64('0x4a')](0x1,'day');}_[_0xfb64('0x4c')](_0xa24ea2[_0xfb64('0x4d')],{'createdAt':{'$gte':_0x4713ff[_0xfb64('0x3e')],'$lte':_0x4713ff[_0xfb64('0x3f')]}});}if(_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x4e')]){_0xa24ea2[_0xfb64('0x4d')]=_[_0xfb64('0x4c')](_0xa24ea2['where'],{'$or':_['map'](_0x714126,function(_0x4c694c){if(_0x4c694c[_0xfb64('0x4f')][_0xfb64('0x50')]!=='VIRTUAL'){var _0xfe6965={};_0xfe6965[_0x4c694c[_0xfb64('0x51')]]={'$like':'%'+_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x4e')]+'%'};return _0xfe6965;}})});}_0xa24ea2=_[_0xfb64('0x4c')]({},_0xa24ea2,_0x5754f3['options']);var _0x25c240={'where':_0xa24ea2[_0xfb64('0x4d')]};return db[_0xfb64('0x39')]['count'](_0x25c240)[_0xfb64('0x31')](function(_0x126c6f){_0x45836f[_0xfb64('0x2a')]=_0x126c6f;if(_0x5754f3[_0xfb64('0x3d')][_0xfb64('0x52')]){_0xa24ea2[_0xfb64('0x53')]=[{'all':!![]}];}return db[_0xfb64('0x39')][_0xfb64('0x54')](_0xa24ea2);})[_0xfb64('0x31')](function(_0x355826){_0x45836f[_0xfb64('0x55')]=_0x355826;return _0x45836f;})[_0xfb64('0x31')](respondWithFilteredResult(_0x4cd047,_0xa24ea2))[_0xfb64('0x25')](handleError(_0x4cd047,null));};exports[_0xfb64('0x56')]=function(_0x58c940,_0x20c7e5){var _0x57fd0e={'raw':![],'where':{'id':_0x58c940[_0xfb64('0x57')]['id']}},_0x3f6e30={};_0x3f6e30[_0xfb64('0x3b')]=_['keys'](db[_0xfb64('0x39')][_0xfb64('0x3a')]);_0x3f6e30[_0xfb64('0x3d')]=_[_0xfb64('0x3c')](_0x58c940[_0xfb64('0x3d')]);_0x3f6e30[_0xfb64('0x40')]=_[_0xfb64('0x41')](_0x3f6e30[_0xfb64('0x3b')],_0x3f6e30[_0xfb64('0x3d')]);_0x57fd0e['attributes']=_[_0xfb64('0x41')](_0x3f6e30['model'],qs[_0xfb64('0x42')](_0x58c940[_0xfb64('0x3d')][_0xfb64('0x42')]));_0x57fd0e[_0xfb64('0x43')]=_0x57fd0e['attributes'][_0xfb64('0x44')]?_0x57fd0e[_0xfb64('0x43')]:_0x3f6e30['model'];if(_0x58c940['query'][_0xfb64('0x52')]){_0x57fd0e[_0xfb64('0x53')]=[{'all':!![]}];}_0x57fd0e=_[_0xfb64('0x4c')]({},_0x57fd0e,_0x58c940[_0xfb64('0x58')]);return db[_0xfb64('0x39')][_0xfb64('0x59')](_0x57fd0e)[_0xfb64('0x31')](handleEntityNotFound(_0x20c7e5,null))[_0xfb64('0x31')](respondWithResult(_0x20c7e5,null))[_0xfb64('0x25')](handleError(_0x20c7e5,null));};exports[_0xfb64('0x5a')]=function(_0x2f156a,_0x3b17d2){return db[_0xfb64('0x39')][_0xfb64('0x5a')](_0x2f156a[_0xfb64('0x5b')],{})[_0xfb64('0x31')](function(_0x5ddf08){var _0x4025ec=_0x2f156a[_0xfb64('0x5c')][_0xfb64('0x5d')]({'plain':!![]});if(!_0x4025ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4025ec[_0xfb64('0x5e')]==='user'){var _0x3c5cf7=_0x5ddf08[_0xfb64('0x5d')]({'plain':!![]});var _0x2a6857='ChatWebsites';return db['UserProfileSection'][_0xfb64('0x59')]({'where':{'name':_0x2a6857,'userProfileId':_0x4025ec[_0xfb64('0x5f')]},'raw':!![]})[_0xfb64('0x31')](function(_0x456f0a){if(_0x456f0a&&_0x456f0a['autoAssociation']===0x0){return db[_0xfb64('0x34')]['create']({'name':_0x3c5cf7[_0xfb64('0x36')],'resourceId':_0x3c5cf7['id'],'type':_0x456f0a[_0xfb64('0x36')],'sectionId':_0x456f0a['id']},{})[_0xfb64('0x31')](function(){return _0x5ddf08;});}else{return _0x5ddf08;}})['catch'](function(_0x4e356d){logger[_0xfb64('0x22')](_0xfb64('0x60'),_0x4e356d);throw _0x4e356d;});}return _0x5ddf08;})[_0xfb64('0x31')](respondWithResult(_0x3b17d2,0xc9))[_0xfb64('0x25')](handleError(_0x3b17d2,null));};exports[_0xfb64('0x61')]=function(_0x2f0fd2,_0x3fd697){if(_0x2f0fd2[_0xfb64('0x5b')]['id']){delete _0x2f0fd2[_0xfb64('0x5b')]['id'];}return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x2f0fd2[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x3fd697,null))[_0xfb64('0x31')](saveUpdates(_0x2f0fd2[_0xfb64('0x5b')],null))['then'](respondWithResult(_0x3fd697,null))[_0xfb64('0x25')](handleError(_0x3fd697,null));};exports[_0xfb64('0x32')]=function(_0x51298b,_0x2e189f){return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x51298b[_0xfb64('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e189f,null))[_0xfb64('0x31')](removeEntity(_0x2e189f,null))[_0xfb64('0x25')](handleError(_0x2e189f,null));};exports[_0xfb64('0x62')]=function(_0x39a725,_0x51725d){return db['ChatWebsite'][_0xfb64('0x62')]()[_0xfb64('0x31')](respondWithResult(_0x51725d,null))[_0xfb64('0x25')](handleError(_0x51725d,null));};exports[_0xfb64('0x63')]=function(_0x33dc9d,_0x4866c0,_0x2ca348){if(_0x33dc9d['body']['id']){delete _0x33dc9d[_0xfb64('0x5b')]['id'];}return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x33dc9d[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x4866c0,null))[_0xfb64('0x31')](function(_0x3776c1){if(_0x3776c1){_0x33dc9d[_0xfb64('0x5b')][_0xfb64('0x64')]=_0x3776c1['id'];return db['Disposition'][_0xfb64('0x5a')](_0x33dc9d[_0xfb64('0x5b')]);}})['then'](respondWithResult(_0x4866c0,null))[_0xfb64('0x25')](handleError(_0x4866c0,null));};exports[_0xfb64('0x65')]=function(_0x124e2f,_0x202b59,_0x5a7ee5){var _0x314d7d={'raw':![],'where':{}};var _0x16d2ed={};var _0x29bce5={'count':0x0,'rows':[]};return db[_0xfb64('0x39')][_0xfb64('0x66')]({'where':{'id':_0x124e2f[_0xfb64('0x57')]['id']}})['then'](handleEntityNotFound(_0x202b59,null))[_0xfb64('0x31')](function(_0x4dae2f){if(_0x4dae2f){_0x16d2ed['model']=_[_0xfb64('0x3c')](db[_0xfb64('0x67')][_0xfb64('0x3a')]);_0x16d2ed[_0xfb64('0x3d')]=_['keys'](_0x124e2f[_0xfb64('0x3d')]);_0x16d2ed[_0xfb64('0x40')]=_[_0xfb64('0x41')](_0x16d2ed[_0xfb64('0x3b')],_0x16d2ed[_0xfb64('0x3d')]);_0x314d7d[_0xfb64('0x43')]=_[_0xfb64('0x41')](_0x16d2ed[_0xfb64('0x3b')],qs['fields'](_0x124e2f[_0xfb64('0x3d')][_0xfb64('0x42')]));_0x314d7d[_0xfb64('0x43')]=_0x314d7d[_0xfb64('0x43')][_0xfb64('0x44')]?_0x314d7d[_0xfb64('0x43')]:_0x16d2ed['model'];if(!_0x124e2f[_0xfb64('0x3d')][_0xfb64('0x45')](_0xfb64('0x68'))){_0x314d7d[_0xfb64('0x46')]=qs[_0xfb64('0x46')](_0x124e2f['query'][_0xfb64('0x46')]);_0x314d7d[_0xfb64('0x2b')]=qs['offset'](_0x124e2f[_0xfb64('0x3d')][_0xfb64('0x2b')]);}_0x314d7d[_0xfb64('0x47')]=qs['sort'](_0x124e2f['query'][_0xfb64('0x48')]);_0x314d7d[_0xfb64('0x4d')]=qs[_0xfb64('0x40')](_[_0xfb64('0x49')](_0x124e2f['query'],_0x16d2ed[_0xfb64('0x40')]));_0x314d7d[_0xfb64('0x4d')]['ChatWebsiteId']=_0x4dae2f['id'];if(_0x124e2f[_0xfb64('0x3d')]['filter']){_0x314d7d[_0xfb64('0x4d')]=_[_0xfb64('0x4c')](_0x314d7d[_0xfb64('0x4d')],{'$or':_[_0xfb64('0x69')](_0x314d7d[_0xfb64('0x43')],function(_0xe9775f){var _0x5f0f41={};_0x5f0f41[_0xe9775f]={'$like':'%'+_0x124e2f[_0xfb64('0x3d')][_0xfb64('0x4e')]+'%'};return _0x5f0f41;})});}_0x314d7d=_[_0xfb64('0x4c')]({},_0x314d7d,_0x124e2f[_0xfb64('0x58')]);return db['Disposition']['count']({'where':_0x314d7d[_0xfb64('0x4d')]})['then'](function(_0x3a8713){_0x29bce5[_0xfb64('0x2a')]=_0x3a8713;if(_0x124e2f['query'][_0xfb64('0x52')]){_0x314d7d[_0xfb64('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xfb64('0x54')](_0x314d7d);})[_0xfb64('0x31')](function(_0x4b9510){_0x29bce5['rows']=_0x4b9510;return _0x29bce5;});}})[_0xfb64('0x31')](respondWithFilteredResult(_0x202b59,_0x314d7d))[_0xfb64('0x25')](handleError(_0x202b59,null));};exports[_0xfb64('0x6a')]=function(_0x37dd5f,_0x5f1174,_0x350495){var _0x4da56e;return db[_0xfb64('0x39')]['find']({'where':{'id':_0x37dd5f[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x5f1174,null))['then'](function(_0x3f570e){if(_0x3f570e){return _0x3f570e[_0xfb64('0x6a')](_0x37dd5f[_0xfb64('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x5f1174,null))[_0xfb64('0x25')](handleError(_0x5f1174,null));};exports['addAnswer']=function(_0x14af0e,_0x20bb2b,_0x50fcd6){if(_0x14af0e[_0xfb64('0x5b')]['id']){delete _0x14af0e[_0xfb64('0x5b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x14af0e[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x20bb2b,null))[_0xfb64('0x31')](function(_0x347a7f){if(_0x347a7f){_0x14af0e[_0xfb64('0x5b')][_0xfb64('0x64')]=_0x347a7f['id'];return db[_0xfb64('0x6b')][_0xfb64('0x5a')](_0x14af0e['body']);}})[_0xfb64('0x31')](respondWithResult(_0x20bb2b,null))[_0xfb64('0x25')](handleError(_0x20bb2b,null));};exports[_0xfb64('0x6c')]=function(_0x4b7331,_0x54643f,_0x28f61c){var _0x55e7c4={'raw':![],'where':{}};var _0x54ab68={};var _0x41c738={'count':0x0,'rows':[]};return db[_0xfb64('0x39')]['findOne']({'where':{'id':_0x4b7331[_0xfb64('0x57')]['id']}})['then'](handleEntityNotFound(_0x54643f,null))[_0xfb64('0x31')](function(_0x3cdf9a){if(_0x3cdf9a){_0x54ab68[_0xfb64('0x3b')]=_['keys'](db[_0xfb64('0x6b')][_0xfb64('0x3a')]);_0x54ab68[_0xfb64('0x3d')]=_[_0xfb64('0x3c')](_0x4b7331[_0xfb64('0x3d')]);_0x54ab68[_0xfb64('0x40')]=_[_0xfb64('0x41')](_0x54ab68[_0xfb64('0x3b')],_0x54ab68[_0xfb64('0x3d')]);_0x55e7c4[_0xfb64('0x43')]=_[_0xfb64('0x41')](_0x54ab68[_0xfb64('0x3b')],qs[_0xfb64('0x42')](_0x4b7331[_0xfb64('0x3d')][_0xfb64('0x42')]));_0x55e7c4[_0xfb64('0x43')]=_0x55e7c4[_0xfb64('0x43')][_0xfb64('0x44')]?_0x55e7c4['attributes']:_0x54ab68[_0xfb64('0x3b')];if(!_0x4b7331[_0xfb64('0x3d')][_0xfb64('0x45')](_0xfb64('0x68'))){_0x55e7c4[_0xfb64('0x46')]=qs['limit'](_0x4b7331[_0xfb64('0x3d')][_0xfb64('0x46')]);_0x55e7c4['offset']=qs[_0xfb64('0x2b')](_0x4b7331[_0xfb64('0x3d')][_0xfb64('0x2b')]);}_0x55e7c4[_0xfb64('0x47')]=qs[_0xfb64('0x48')](_0x4b7331[_0xfb64('0x3d')]['sort']);_0x55e7c4['where']=qs['filters'](_[_0xfb64('0x49')](_0x4b7331[_0xfb64('0x3d')],_0x54ab68[_0xfb64('0x40')]));_0x55e7c4[_0xfb64('0x4d')]['ChatWebsiteId']=_0x3cdf9a['id'];if(_0x4b7331[_0xfb64('0x3d')]['filter']){_0x55e7c4['where']=_[_0xfb64('0x4c')](_0x55e7c4[_0xfb64('0x4d')],{'$or':_[_0xfb64('0x69')](_0x55e7c4[_0xfb64('0x43')],function(_0x519ab6){var _0xe5ebc1={};_0xe5ebc1[_0x519ab6]={'$like':'%'+_0x4b7331[_0xfb64('0x3d')][_0xfb64('0x4e')]+'%'};return _0xe5ebc1;})});}_0x55e7c4=_[_0xfb64('0x4c')]({},_0x55e7c4,_0x4b7331[_0xfb64('0x58')]);return db['CannedAnswer'][_0xfb64('0x2a')]({'where':_0x55e7c4[_0xfb64('0x4d')]})[_0xfb64('0x31')](function(_0xac1c9c){_0x41c738[_0xfb64('0x2a')]=_0xac1c9c;if(_0x4b7331[_0xfb64('0x3d')][_0xfb64('0x52')]){_0x55e7c4[_0xfb64('0x53')]=[{'all':!![]}];}return db[_0xfb64('0x6b')]['findAll'](_0x55e7c4);})[_0xfb64('0x31')](function(_0x515652){_0x41c738[_0xfb64('0x55')]=_0x515652;return _0x41c738;});}})[_0xfb64('0x31')](respondWithFilteredResult(_0x54643f,_0x55e7c4))[_0xfb64('0x25')](handleError(_0x54643f,null));};exports[_0xfb64('0x6d')]=function(_0x52fc38,_0x154e36,_0x2fe6cd){var _0x38ad32;return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x52fc38[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x154e36,null))['then'](function(_0x45d17d){if(_0x45d17d){return _0x45d17d['removeAnswers'](_0x52fc38['query'][_0xfb64('0x6e')]);}})[_0xfb64('0x31')](respondWithStatusCode(_0x154e36,null))['catch'](handleError(_0x154e36,null));};exports[_0xfb64('0x6f')]=function(_0x3581a8,_0x2ecd60,_0x4b2aeb){_0x3581a8[_0xfb64('0x5b')]['sitepic']=_0x3581a8[_0xfb64('0x70')][_0xfb64('0x71')];return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x3581a8[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x2ecd60,null))[_0xfb64('0x31')](saveUpdates(_0x3581a8[_0xfb64('0x5b')],null))['then'](respondWithResult(_0x2ecd60,null))[_0xfb64('0x25')](handleError(_0x2ecd60,null));};exports['addAvatar']=function(_0x1ef221,_0x10e206,_0x259245){_0x1ef221[_0xfb64('0x5b')][_0xfb64('0x72')]=_0x1ef221[_0xfb64('0x70')][_0xfb64('0x71')];return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x1ef221[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x10e206,null))[_0xfb64('0x31')](saveUpdates(_0x1ef221['body'],null))['then'](respondWithResult(_0x10e206,null))[_0xfb64('0x25')](handleError(_0x10e206,null));};exports['addCustomerAvatar']=function(_0x4b9088,_0x143901,_0x14f401){_0x4b9088[_0xfb64('0x5b')][_0xfb64('0x73')]=_0x4b9088[_0xfb64('0x70')][_0xfb64('0x71')];return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x4b9088[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x143901,null))[_0xfb64('0x31')](saveUpdates(_0x4b9088['body'],null))[_0xfb64('0x31')](respondWithResult(_0x143901,null))[_0xfb64('0x25')](handleError(_0x143901,null));};exports[_0xfb64('0x74')]=function(_0x35e4b2,_0x32d90b,_0x39e014){_0x35e4b2[_0xfb64('0x5b')]['systemAvatar']=_0x35e4b2[_0xfb64('0x70')]['filename'];return db['ChatWebsite'][_0xfb64('0x59')]({'where':{'id':_0x35e4b2[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x32d90b,null))[_0xfb64('0x31')](saveUpdates(_0x35e4b2[_0xfb64('0x5b')],null))['then'](respondWithResult(_0x32d90b,null))['catch'](handleError(_0x32d90b,null));};exports[_0xfb64('0x75')]=function(_0x273f66,_0x65652b,_0x1799c7){var _0xf198ae=path[_0xfb64('0x76')](config[_0xfb64('0x77')],'server/files/images/logos/default_logo.png');var _0x1e17a1={'where':{'id':_0x273f66[_0xfb64('0x57')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x21be13=![];return require(_0xfb64('0x78'))['getLicense']()[_0xfb64('0x31')](function(_0xa5e2fb){if(_0xa5e2fb){_0x21be13=_0xa5e2fb['custom'];}})[_0xfb64('0x31')](function(){return db[_0xfb64('0x39')][_0xfb64('0x59')](_0x1e17a1);})[_0xfb64('0x31')](handleEntityNotFound(_0x65652b,null))['then'](function(_0x2dcf49){if(_0x2dcf49){if(!_[_0xfb64('0x79')](_0x2dcf49[_0xfb64('0x7a')])){if(fs[_0xfb64('0x7b')](path[_0xfb64('0x76')](config['root'],_0xfb64('0x7c'),_0x2dcf49[_0xfb64('0x7a')]))&&_0x21be13){_0xf198ae=path[_0xfb64('0x76')](config[_0xfb64('0x77')],_0xfb64('0x7c'),_0x2dcf49[_0xfb64('0x7a')]);}}return _0x65652b[_0xfb64('0x7d')](_0xf198ae);}})[_0xfb64('0x25')](handleError(_0x65652b,null));};exports['getAvatar']=function(_0x1c1d61,_0x42e0ff,_0x542859){var _0xf9039a=path[_0xfb64('0x76')](config[_0xfb64('0x77')],'server/files/images/avatars/default_avatar.png');var _0x1cb3d8={'where':{'id':_0x1c1d61[_0xfb64('0x57')]['id']},'attributes':['id',_0xfb64('0x72')],'raw':!![]};return db[_0xfb64('0x39')][_0xfb64('0x59')](_0x1cb3d8)['then'](handleEntityNotFound(_0x42e0ff,null))[_0xfb64('0x31')](function(_0x4e7548){if(_0x4e7548){if(!_[_0xfb64('0x79')](_0x4e7548['agentAvatar'])){if(fs[_0xfb64('0x7b')](path['join'](config['root'],_0xfb64('0x7e'),_0x4e7548[_0xfb64('0x72')]))){_0xf9039a=path['join'](config['root'],_0xfb64('0x7e'),_0x4e7548[_0xfb64('0x72')]);}}return _0x42e0ff[_0xfb64('0x7d')](_0xf9039a);}})['catch'](handleError(_0x42e0ff,null));};exports['getCustomerAvatar']=function(_0x1dcc16,_0x238778,_0x2f639c){var _0x3f54d1=path[_0xfb64('0x76')](config[_0xfb64('0x77')],'server/files/images/avatars/customer_avatar.png');var _0x38d12b={'where':{'id':_0x1dcc16[_0xfb64('0x57')]['id']},'attributes':['id',_0xfb64('0x73'),_0xfb64('0x7f')],'raw':!![]};return db['ChatWebsite']['find'](_0x38d12b)[_0xfb64('0x31')](handleEntityNotFound(_0x238778,null))[_0xfb64('0x31')](function(_0x4ffdcf){if(_0x4ffdcf){if(!_[_0xfb64('0x79')](_0x4ffdcf[_0xfb64('0x73')])){if(fs[_0xfb64('0x7b')](path[_0xfb64('0x76')](config[_0xfb64('0x77')],_0xfb64('0x7e'),_0x4ffdcf[_0xfb64('0x73')]))&&_0x4ffdcf['showCustomerAvatar']){_0x3f54d1=path[_0xfb64('0x76')](config['root'],_0xfb64('0x7e'),_0x4ffdcf[_0xfb64('0x73')]);}}return _0x238778[_0xfb64('0x7d')](_0x3f54d1);}})[_0xfb64('0x25')](handleError(_0x238778,null));};exports[_0xfb64('0x80')]=function(_0x59e5f3,_0x3ce684,_0x5b628a){var _0x53e5a5=path[_0xfb64('0x76')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x5c00ae={'where':{'id':_0x59e5f3[_0xfb64('0x57')]['id']},'attributes':['id',_0xfb64('0x81')],'raw':!![]};return db[_0xfb64('0x39')][_0xfb64('0x59')](_0x5c00ae)[_0xfb64('0x31')](handleEntityNotFound(_0x3ce684,null))[_0xfb64('0x31')](function(_0x3bcc99){if(_0x3bcc99){if(!_['isNil'](_0x3bcc99['systemAvatar'])){if(fs[_0xfb64('0x7b')](path['join'](config[_0xfb64('0x77')],_0xfb64('0x7e'),_0x3bcc99[_0xfb64('0x81')]))){_0x53e5a5=path[_0xfb64('0x76')](config['root'],_0xfb64('0x7e'),_0x3bcc99[_0xfb64('0x81')]);}}return _0x3ce684[_0xfb64('0x7d')](_0x53e5a5);}})[_0xfb64('0x25')](handleError(_0x3ce684,null));};exports[_0xfb64('0x82')]=function(_0x3cede0,_0x4b44e5,_0x575947){var _0x2a752d=require(_0xfb64('0x83'));var _0x5ac2bd=new _0x2a752d();var _0xef7e5f=_0x5ac2bd[_0xfb64('0x84')](_0x3cede0[_0xfb64('0x85')][_0xfb64('0x86')])['getResult']();var _0x1ecf59={'body':_0x3cede0[_0xfb64('0x5b')],'channel':'chat'};var _0x312558=[];var _0x312377=[];var _0x10e7b5={};var _0x50ca7a=![];return db[_0xfb64('0x87')][_0xfb64('0x62')]()[_0xfb64('0x31')](function(_0xc28bd3){if(!_0xc28bd3){throw new db[(_0xfb64('0x88'))][(_0xfb64('0x89'))](_0xfb64('0x8a'));}_0x312558=_[_0xfb64('0x8b')](_[_0xfb64('0x3c')](_0xc28bd3),[_0xfb64('0x8c'),_0xfb64('0x8d')]);_0x312377=_[_0xfb64('0x8b')](_[_0xfb64('0x3c')](_0xc28bd3),['createdAt',_0xfb64('0x8d'),_0xfb64('0x8e'),'ListId']);if(_0x3cede0[_0xfb64('0x5b')]['id']){delete _0x3cede0[_0xfb64('0x5b')]['id'];}if(_[_0xfb64('0x79')](_0x3cede0[_0xfb64('0x5b')]['from'])){throw new db[(_0xfb64('0x88'))]['ValidationError'](_0xfb64('0x8f'));}if(_[_0xfb64('0x79')](_0x3cede0['body'][_0xfb64('0x5b')])||_0x3cede0['body'][_0xfb64('0x5b')]===''){throw new db['Sequelize']['ValidationError'](_0xfb64('0x90'));}if(_[_0xfb64('0x79')](_0x3cede0[_0xfb64('0x5b')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xfb64('0x91')+_0x312377);}if(!_[_0xfb64('0x92')](_0x312377,_0x3cede0[_0xfb64('0x5b')][_0xfb64('0x93')])){throw new db[(_0xfb64('0x88'))][(_0xfb64('0x89'))](_0xfb64('0x94')+_0x312377);}_0x10e7b5[_0x3cede0['body'][_0xfb64('0x93')]]=_0x3cede0[_0xfb64('0x5b')][_0xfb64('0x95')];})[_0xfb64('0x31')](function(){return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x3cede0[_0xfb64('0x57')]['id']},'include':[{'model':db[_0xfb64('0x96')],'as':_0xfb64('0x97'),'include':[{'model':db['CmContact'],'as':_0xfb64('0x98'),'where':_0x10e7b5,'limit':0x1,'order':[[_0xfb64('0x8d'),_0xfb64('0x99')]]}]},{'model':db[_0xfb64('0x9a')],'as':_0xfb64('0x9b')}]});})[_0xfb64('0x31')](handleEntityNotFound(_0x4b44e5,null))['then'](function(_0x181f63){if(_0x181f63&&_0x181f63[_0xfb64('0x97')]){_0x1ecf59[_0xfb64('0x9c')]=_0x181f63;_0x1ecf59[_0xfb64('0x9d')]=_0x181f63[_0xfb64('0x9b')];_0x1ecf59[_0xfb64('0x9e')]=_0x181f63[_0xfb64('0x97')];_0x1ecf59[_0xfb64('0x9d')]=_[_0xfb64('0x9f')](_0x1ecf59[_0xfb64('0x9d')],[_0xfb64('0xa0')],[_0xfb64('0xa1')]);if(_0x1ecf59[_0xfb64('0x9c')]['Applications']){delete _0x1ecf59[_0xfb64('0x9c')][_0xfb64('0x9b')];}if(_0x1ecf59[_0xfb64('0x9c')][_0xfb64('0x97')]&&_0x1ecf59[_0xfb64('0x9c')][_0xfb64('0x97')][_0xfb64('0x98')][_0xfb64('0x44')]){return _0x1ecf59[_0xfb64('0x9c')]['List']['Contacts'][0x0];}var _0x48f7a2=_['defaults'](_0x3cede0[_0xfb64('0x5b')],{'firstName':_0x3cede0['body'][_0xfb64('0x95')],'ListId':_0x181f63[_0xfb64('0xa2')]});_0x48f7a2[_0x3cede0[_0xfb64('0x5b')][_0xfb64('0x93')]]=_0x3cede0[_0xfb64('0x5b')]['from'];return db[_0xfb64('0x87')][_0xfb64('0x5a')](_0x48f7a2,{'fields':_0x312558,'raw':!![]});}})['then'](handleEntityNotFound(_0x4b44e5,null))[_0xfb64('0x31')](function(_0x297bbf){_0x1ecf59[_0xfb64('0xa3')]=_0x297bbf;if(_0x297bbf){var _0x55c2c7={'ContactId':_0x297bbf['id'],'ChatWebsiteId':_0x3cede0[_0xfb64('0x57')]['id'],'from':(_0x297bbf[_0xfb64('0xa4')]||'')+'\x20'+(_0x297bbf[_0xfb64('0xa5')]||''),'customerIp':_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xa6')],'referer':_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xa7')],'browserName':_0xef7e5f['browser']['name']&&_0xef7e5f[_0xfb64('0xa8')][_0xfb64('0xa9')]?util[_0xfb64('0xaa')](_0xfb64('0xab'),_0xef7e5f[_0xfb64('0xa8')][_0xfb64('0x36')],_0xef7e5f[_0xfb64('0xa8')][_0xfb64('0xa9')]):'unknown','browserVersion':_0xef7e5f[_0xfb64('0xa8')][_0xfb64('0xa9')]||_0xfb64('0xac'),'osName':util[_0xfb64('0xaa')](_0xfb64('0xab'),_0xef7e5f['os'][_0xfb64('0x36')],_0xef7e5f['os'][_0xfb64('0xa9')]),'osVersion':_0xef7e5f['os'][_0xfb64('0xa9')],'deviceModel':_0xef7e5f[_0xfb64('0xad')]['model']&&_0xef7e5f[_0xfb64('0xad')][_0xfb64('0xae')]?util['format'](_0xfb64('0xaf'),_0xef7e5f[_0xfb64('0xad')][_0xfb64('0x3b')],_0xef7e5f['device'][_0xfb64('0xae')],_0xef7e5f['device'][_0xfb64('0x4f')]):null,'deviceVendor':_0xef7e5f[_0xfb64('0xad')]['vendor'],'deviceType':_0xef7e5f[_0xfb64('0xad')]['type'],'formData':JSON['stringify'](_0x3cede0['body'])};var _0x13fc50={'ChatWebsiteId':_0x3cede0[_0xfb64('0x57')]['id'],'closed':![]};if(_0x3cede0['body']['threadId']){_0x13fc50[_0xfb64('0xb0')]=_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xb0')];return db[_0xfb64('0xb1')][_0xfb64('0x59')]({'where':_0x13fc50})[_0xfb64('0x31')](function(_0x361543){if(_0x361543){return[_0x361543,![]];}_0x55c2c7[_0xfb64('0xb0')]=_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xb0')];_0x55c2c7[_0xfb64('0xb2')]=_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xb2')];return db[_0xfb64('0xb1')][_0xfb64('0x5a')](_0x55c2c7)[_0xfb64('0x31')](function(_0x108626){return[_0x108626,!![]];});});}_0x13fc50['ContactId']=_0x297bbf['id'];if(_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xb3')]&&_0x3cede0['body'][_0xfb64('0xb3')]['id']){_0x13fc50['id']=_0x3cede0['body'][_0xfb64('0xb3')]['id'];return db[_0xfb64('0xb1')][_0xfb64('0x59')]({'where':_0x13fc50})[_0xfb64('0x31')](function(_0x5b712a){if(_0x5b712a){return[_0x5b712a,![]];}return db[_0xfb64('0xb1')][_0xfb64('0x5a')](_0x55c2c7)[_0xfb64('0x31')](function(_0x583ccb){return[_0x583ccb,!![]];});});}return db[_0xfb64('0xb1')][_0xfb64('0x5a')](_0x55c2c7)['then'](function(_0x2cd2bb){return[_0x2cd2bb,!![]];});}})[_0xfb64('0xb4')](function(_0x5c7a70,_0x12912c){if(_0x5c7a70){_0x50ca7a=_0x12912c;if(!_0x12912c){var _0x320129={'from':(_0x1ecf59['contact']['firstName']||'')+'\x20'+(_0x1ecf59[_0xfb64('0xa3')][_0xfb64('0xa5')]||'')};if(_0x3cede0['body'][_0xfb64('0xb0')]&&_0x3cede0['body'][_0xfb64('0xb5')]&&_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xb0')]!=_0x3cede0[_0xfb64('0x5b')]['messageId']){_0x320129[_0xfb64('0xb0')]=_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xb5')];}return _0x5c7a70[_0xfb64('0x61')](_0x320129);}else{return _0x5c7a70;}}})[_0xfb64('0x31')](function(_0x215d18){_0x1ecf59[_0xfb64('0xb3')]=_0x215d18[_0xfb64('0x5d')]({'plain':!![]});_0x1ecf59[_0xfb64('0xb3')][_0xfb64('0xb6')]=_0x50ca7a;if(_0x1ecf59[_0xfb64('0xb3')][_0xfb64('0xb6')]){if(_0x1ecf59[_0xfb64('0x9c')][_0xfb64('0xb7')]){_0x1ecf59[_0xfb64('0x9d')][_0xfb64('0xb8')]({'id':0x0,'priority':_0x1ecf59[_0xfb64('0x9d')][_0xfb64('0x44')]+0x1,'app':_0xfb64('0xb9'),'appdata':_0xfb64('0xba'),'interval':_0xfb64('0xbb')});}}return db[_0xfb64('0xbc')][_0xfb64('0x5a')]({'body':_0x3cede0[_0xfb64('0x5b')][_0xfb64('0x5b')],'ChatWebsiteId':_0x3cede0[_0xfb64('0x57')]['id'],'ChatInteractionId':_0x215d18['id'],'direction':'in','ContactId':_0x1ecf59[_0xfb64('0xa3')]['id'],'AttachmentId':_0x3cede0[_0xfb64('0x5b')][_0xfb64('0xbd')]});})[_0xfb64('0x31')](function(_0x1f360c){_0x1ecf59['message']=_0x1f360c;if(_0x1ecf59[_0xfb64('0xb3')][_0xfb64('0xbe')]){return db['User'][_0xfb64('0x59')]({'attributes':['id',_0xfb64('0x36')],'where':{'id':_0x1ecf59['interaction']['UserId']}})[_0xfb64('0x31')](function(_0x5b2c95){if(_0x5b2c95){_0x1ecf59['applications'][_0xfb64('0xbf')]({'id':0x0,'priority':0x0,'app':_0xfb64('0xc0'),'appdata':_0x5b2c95[_0xfb64('0x36')]+','+(_0x1ecf59[_0xfb64('0x9c')]['waitForTheAssignedAgent']||0xa),'interval':_0xfb64('0xbb')});_0x1ecf59['forcedOwnership']=!![];}return respondWithRpcPromise(_0xfb64('0xc1'),_0xfb64('0xc2'),_0x1ecf59);});}return respondWithRpcPromise(_0xfb64('0xc1'),'startRouting',_0x1ecf59);})[_0xfb64('0x31')](function(_0xc106e7){respondWithRpcPromise(_0xfb64('0xc3'),_0xfb64('0xc3'),{'event':'notify','message':_0xc106e7},client9002);return _0xc106e7;})[_0xfb64('0x31')](respondWithResult(_0x4b44e5,null))['catch'](handleError(_0x4b44e5,null));};exports['offline']=function(_0x5965af,_0x144446,_0x3b2e21){var _0x5dc81d,_0x114a17,_0x55e040;var _0x4b3a0a=[];var _0x310dc2=[];var _0x593ff0={};return db['CmContact'][_0xfb64('0x62')]()[_0xfb64('0x31')](function(_0x56c107){if(!_0x56c107){throw new db[(_0xfb64('0x88'))]['ValidationError'](_0xfb64('0x8a'));}_0x310dc2=_[_0xfb64('0x8b')](_[_0xfb64('0x3c')](_0x56c107),[_0xfb64('0x8c'),_0xfb64('0x8d')]);_0x4b3a0a=_[_0xfb64('0x8b')](_[_0xfb64('0x3c')](_0x56c107),['createdAt',_0xfb64('0x8d'),_0xfb64('0x8e'),'ListId']);if(_0x5965af['body']['id']){delete _0x5965af['body']['id'];}if(_[_0xfb64('0x79')](_0x5965af['body'][_0xfb64('0x95')])){throw _0x144446['status'](0x1f4)[_0xfb64('0x37')](new db['Sequelize'][(_0xfb64('0x89'))](_0xfb64('0x8f')));}if(_[_0xfb64('0x79')](_0x5965af[_0xfb64('0x5b')]['body'])||_0x5965af['body'][_0xfb64('0x5b')]===''){throw _0x144446[_0xfb64('0x28')](0x1f4)[_0xfb64('0x37')](new db['Sequelize'][(_0xfb64('0x89'))](_0xfb64('0x90')));}if(_[_0xfb64('0x79')](_0x5965af[_0xfb64('0x5b')][_0xfb64('0xc4')])){throw _0x144446[_0xfb64('0x28')](0x1f4)[_0xfb64('0x37')](new db[(_0xfb64('0x88'))][(_0xfb64('0x89'))](_0xfb64('0xc5')+_0x4b3a0a));}if(!_[_0xfb64('0x92')](_0x4b3a0a,_0x5965af[_0xfb64('0x5b')][_0xfb64('0xc4')])){throw _0x144446[_0xfb64('0x28')](0x1f4)['send'](new db[(_0xfb64('0x88'))][(_0xfb64('0x89'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b3a0a));}_0x593ff0[_0x5965af[_0xfb64('0x5b')][_0xfb64('0xc4')]]=_0x5965af[_0xfb64('0x5b')][_0xfb64('0x95')];})[_0xfb64('0x31')](function(){return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x5965af[_0xfb64('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0xfb64('0x31')](handleEntityNotFound(_0x144446,null))[_0xfb64('0x31')](function(_0x1ce5e1){if(_0x1ce5e1&&_0x1ce5e1[_0xfb64('0x97')]){_0x114a17=_0x1ce5e1;var _0x561c45=_[_0xfb64('0xc6')](_0x5965af[_0xfb64('0x5b')],{'firstName':_0x5965af[_0xfb64('0x5b')][_0xfb64('0x95')],'phone':_0x5965af[_0xfb64('0x5b')][_0xfb64('0x95')],'ListId':_0x1ce5e1['ListId']});_0x561c45[_0x5965af[_0xfb64('0x5b')][_0xfb64('0xc4')]]=_0x5965af[_0xfb64('0x5b')][_0xfb64('0x95')];return db[_0xfb64('0x87')][_0xfb64('0xc7')]({'where':_0x593ff0,'defaults':_0x561c45});}})[_0xfb64('0xb4')](function(_0x26bfd2){if(_0x26bfd2){_0x55e040=_0x26bfd2;var _0x4b877d=fs[_0xfb64('0xc8')](path['join'](config['root'],_0xfb64('0xc9')),'utf8');var _0x630250=ejs[_0xfb64('0xca')](_0x4b877d,{'body':_[_0xfb64('0xcb')](_0x5965af[_0xfb64('0x5b')][_0xfb64('0x5b')]),'bodyTitle':_0x114a17[_0xfb64('0xcc')]});return db[_0xfb64('0xcd')][_0xfb64('0x5a')]({'body':_0x630250,'ContactId':_0x26bfd2['id'],'ChatWebsiteId':_0x114a17['id']});}})[_0xfb64('0x31')](function(_0x794f63){if(_0x794f63){_0x5dc81d=_0x794f63;return db[_0xfb64('0xce')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfb64('0xcf')],'as':_0xfb64('0xd0'),'raw':!![]}]});}})[_0xfb64('0x31')](function(_0x1bd396){if(_0x1bd396&&_0x1bd396['Smtp']&&_0x114a17['forwardOfflineAddress']){var _0x1730de={'tls':{'rejectUnauthorized':![]}};if(_0x1bd396['Smtp']['service']){_0x1730de[_0xfb64('0xd1')]=_0x1bd396[_0xfb64('0xd0')]['service'];}else{_0x1730de[_0xfb64('0xd2')]=_0x1bd396[_0xfb64('0xd0')]['host'];_0x1730de[_0xfb64('0xd3')]=_0x1bd396[_0xfb64('0xd0')]['port'];_0x1730de[_0xfb64('0xd4')]=_0x1bd396[_0xfb64('0xd0')][_0xfb64('0xd4')];}if(_0x1bd396[_0xfb64('0xd0')][_0xfb64('0xd5')]){_0x1730de[_0xfb64('0xd6')]={'user':_0x1bd396['Smtp'][_0xfb64('0x5c')],'pass':_0x1bd396[_0xfb64('0xd0')][_0xfb64('0xd7')]};}return respondWithRpcPromise('SendMail',_0xfb64('0xd8'),{'account':_0x1730de,'message':{'from':util[_0xfb64('0xaa')]('\x22%s\x22\x20<%s>',_0x1bd396['name'],_0x1bd396[_0xfb64('0xd9')]||_0x1bd396['Smtp'][_0xfb64('0x5c')]),'to':_0x114a17['forwardOfflineAddress'],'subject':_0x114a17[_0xfb64('0xda')],'text':_0x5dc81d[_0xfb64('0x5b')]}},client9003)['then'](function(){return _0x5dc81d;})[_0xfb64('0x25')](function(_0x16c8f3){console[_0xfb64('0x22')](_0x16c8f3);});}})[_0xfb64('0x31')](function(){if(_0x5dc81d){return _0x5dc81d;}})[_0xfb64('0x31')](respondWithResult(_0x144446,null))[_0xfb64('0x25')](handleError(_0x144446,null));};exports['addInteraction']=function(_0x32910d,_0x2fcba3,_0x443d9d){return db[_0xfb64('0xb1')][_0xfb64('0x59')]({'where':{'id':_0x32910d[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x2fcba3,null))[_0xfb64('0x31')](function(_0xdcca62){if(_0xdcca62){return _0xdcca62[_0xfb64('0xdb')](_0x32910d[_0xfb64('0x5b')][_0xfb64('0x6e')],_[_0xfb64('0xdc')](_0x32910d[_0xfb64('0x5b')],[_0xfb64('0x6e'),'id'])||{});}})[_0xfb64('0x31')](respondWithResult(_0x2fcba3,null))[_0xfb64('0x25')](handleError(_0x2fcba3,null));};exports['getInteractions']=function(_0x35f1fb,_0xcb7714,_0xaf5ab3){var _0x5732ff={'raw':![],'where':{}};var _0x52213f={};var _0x19ed35={'count':0x0,'rows':[]};return db[_0xfb64('0x39')][_0xfb64('0x66')]({'where':{'id':_0x35f1fb[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0xcb7714,null))[_0xfb64('0x31')](function(_0x58037d){if(_0x58037d){_0x52213f[_0xfb64('0x3b')]=_[_0xfb64('0x3c')](db['ChatInteraction'][_0xfb64('0x3a')]);_0x52213f[_0xfb64('0x3d')]=_[_0xfb64('0x3c')](_0x35f1fb[_0xfb64('0x3d')]);_0x52213f['filters']=_[_0xfb64('0x41')](_0x52213f[_0xfb64('0x3b')],_0x52213f['query']);_0x5732ff[_0xfb64('0x43')]=_[_0xfb64('0x41')](_0x52213f[_0xfb64('0x3b')],qs[_0xfb64('0x42')](_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0x42')]));_0x5732ff['attributes']=_0x5732ff[_0xfb64('0x43')]['length']?_0x5732ff[_0xfb64('0x43')]:_0x52213f[_0xfb64('0x3b')];if(!_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0x45')]('nolimit')){_0x5732ff[_0xfb64('0x46')]=qs[_0xfb64('0x46')](_0x35f1fb['query'][_0xfb64('0x46')]);_0x5732ff[_0xfb64('0x2b')]=qs['offset'](_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0x2b')]);}_0x5732ff['order']=qs['sort'](_0x35f1fb['query'][_0xfb64('0x48')]);_0x5732ff[_0xfb64('0x4d')]=qs[_0xfb64('0x40')](_[_0xfb64('0x49')](_0x35f1fb[_0xfb64('0x3d')],_0x52213f[_0xfb64('0x40')]));_0x5732ff[_0xfb64('0x4d')][_0xfb64('0x64')]=_0x58037d['id'];if(_0x35f1fb[_0xfb64('0x3d')]['filter']){_0x5732ff[_0xfb64('0x4d')]=_[_0xfb64('0x4c')](_0x5732ff[_0xfb64('0x4d')],{'$or':_[_0xfb64('0x69')](_0x5732ff[_0xfb64('0x43')],function(_0x360756){var _0x2849fa={};_0x2849fa[_0x360756]={'$like':'%'+_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0x4e')]+'%'};return _0x2849fa;})});}_0x5732ff=_['merge']({},_0x5732ff,_0x35f1fb[_0xfb64('0x58')]);return db[_0xfb64('0xb1')]['count']({'where':_0x5732ff[_0xfb64('0x4d')]})['then'](function(_0x587196){_0x19ed35[_0xfb64('0x2a')]=_0x587196;if(_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0x52')]){_0x5732ff[_0xfb64('0x53')]=[{'model':db[_0xfb64('0x87')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xfb64('0xdd'),'attributes':[_0xfb64('0x36'),_0xfb64('0xde'),_0xfb64('0xdf')],'required':![]},{'model':db[_0xfb64('0xe0')],'as':_0xfb64('0xe1'),'attributes':['id',_0xfb64('0x36'),'color'],'where':_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0xe2')]?{'id':_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0xe2')]}:undefined,'required':_0x35f1fb[_0xfb64('0x3d')][_0xfb64('0xe2')]?!![]:![]}];}return db['ChatInteraction'][_0xfb64('0x54')](_0x5732ff);})[_0xfb64('0x31')](function(_0x111d51){_0x19ed35[_0xfb64('0x55')]=_0x111d51;return _0x19ed35;});}})['then'](respondWithFilteredResult(_0xcb7714,_0x5732ff))[_0xfb64('0x25')](handleError(_0xcb7714,null));};function iftimePromise(_0x58f02b,_0x4ec58e){return respondWithRpcPromise('Command','getSnippet',{'command':_0x4ec58e[_0xfb64('0xe3')]?util['format'](_0xfb64('0xe4'),_0x58f02b['interval'],_0x4ec58e[_0xfb64('0xe3')]):util[_0xfb64('0xaa')](_0xfb64('0xe5'),_0x58f02b[_0xfb64('0xe6')])},client9002)[_0xfb64('0x31')](function(_0x5b03b7){var _0x277f72=_0x5b03b7&&_0x5b03b7['indexOf']('true')>=0x0?!![]:![];logger[_0xfb64('0x1d')](_0xfb64('0xe7'),_0x4ec58e['id'],_0x58f02b['id'],_0x58f02b[_0xfb64('0xe6')],_0x277f72?_0xfb64('0xe8'):_0xfb64('0xe9'),_0x4ec58e[_0xfb64('0xe3')]?_0x4ec58e[_0xfb64('0xe3')]:_0xfb64('0xea'));return _0x277f72;})['catch'](function(_0x39e14d){logger['error'](_0xfb64('0xe7'),_0x4ec58e['id'],_0x58f02b['id'],_0x58f02b[_0xfb64('0xe6')],util['inspect'](_0x39e14d,{'showHidden':![],'depth':null}),_0x4ec58e[_0xfb64('0xe3')]?_0x4ec58e['timezone']:'No\x20timezone');return![];});}exports[_0xfb64('0xeb')]=function(_0x5df71f,_0x518bb7,_0x40a7d9){var _0x35acb6=0x0;var _0x4ab71e=0x0;var _0x43a855=![];var _0x5d639e;var _0x4cb9e3;return db['ChatWebsite'][_0xfb64('0x59')]({'where':{'id':_0x5df71f['params']['id']},'include':[{'model':db['Interval'],'as':_0xfb64('0xec'),'include':[{'model':db[_0xfb64('0xec')],'as':_0xfb64('0xed'),'attributes':['id',_0xfb64('0xe6')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x518bb7,null))[_0xfb64('0x31')](function(_0x15b2cf){if(_0x15b2cf){_0x5d639e=_0x15b2cf;return _0x15b2cf[_0xfb64('0xee')]({'raw':!![]});}})[_0xfb64('0x31')](function(_0x22eaa2){if(_0x5d639e){if(_0x22eaa2){_0x4cb9e3=_0x22eaa2;}}return require('../../config/license/util')[_0xfb64('0xef')]();})[_0xfb64('0x31')](function(_0x1a5cb5){if(_0x1a5cb5){_0x4ab71e=_0x1a5cb5[_0xfb64('0xf0')];_0x43a855=_0x1a5cb5['custom'];}})['then'](function(){return db['ChatInteraction'][_0xfb64('0x2a')]({'where':{'closed':![]}});})['then'](function(_0x1ab2a2){_0x35acb6=_0x1ab2a2;if(_0x4ab71e&&_0x1ab2a2>_0x4ab71e){return db[_0xfb64('0xf1')][_0xfb64('0x66')]({'where':{'id':0x1}})['then'](function(_0x65010d){if(_0x65010d){_0x65010d[_0xfb64('0xf2')](_0xfb64('0xf3'));}});}})['then'](function(){if(_0x5d639e[_0xfb64('0xec')]&&_0x5d639e[_0xfb64('0xec')][_0xfb64('0xed')]){var _0x2efa3e=[];for(var _0x36781e=0x0;_0x36781e<_0x5d639e['Interval'][_0xfb64('0xed')][_0xfb64('0x44')];_0x36781e++){var _0x4adaaa=_0x5d639e[_0xfb64('0xec')]['Intervals'][_0x36781e][_0xfb64('0x5d')]({'plain':!![]});_0x2efa3e[_0xfb64('0xb8')](iftimePromise(_0x4adaaa,_0x5d639e));}return BPromise[_0xfb64('0xf4')](_0x2efa3e)[_0xfb64('0x31')](function(_0x6c27cc){return _['some'](_0x6c27cc);});}else{return!![];}})[_0xfb64('0x31')](function(_0x2a1184){var _0x58de2f=fs['readFileSync'](path[_0xfb64('0x76')](config[_0xfb64('0x77')],_0xfb64('0xf5')),_0xfb64('0xf6'));var _0x5258e4={'remote':_0x5d639e[_0xfb64('0xf7')],'query':querystring[_0xfb64('0x21')](_[_0xfb64('0x4c')](_0x5d639e[_0xfb64('0x5d')]({'plain':!![]}),{'customerIp':_0x5df71f['headers']['x-forwarded-for']||_0x5df71f['headers'][_0xfb64('0xf8')]||_0x5df71f['connection']['remoteAddress']||_0x5df71f['ip'],'referer':_0x5df71f[_0xfb64('0x85')][_0xfb64('0xa7')],'openedInteractions':_0x35acb6,'maxInteractions':_0x4ab71e,'virtual':_0x43a855['virtual'],'online':_0x2a1184,'custom':_0x43a855}))['replace'](/'/g,'\x5c\x27')};_0x518bb7[_0xfb64('0x37')](ejs[_0xfb64('0xca')](Mustache[_0xfb64('0xca')](_0x58de2f,_0x5258e4),{'proactiveActions':_0x4cb9e3,'alignment':_0x5d639e[_0xfb64('0xf9')],'verticalAlignment':_0x5d639e[_0xfb64('0xfa')]}));})['catch'](handleError(_0x518bb7,null));};exports[_0xfb64('0xfb')]=function(_0x518220,_0x29c08b,_0x1c6e88){return db[_0xfb64('0x39')][_0xfb64('0x66')]({'where':{'id':_0x518220[_0xfb64('0x57')]['id']}})['then'](handleEntityNotFound(_0x29c08b,null))[_0xfb64('0x31')](function(_0x260e50){if(_0x260e50){return db[_0xfb64('0xfc')][_0xfb64('0xfd')](function(_0x48453d){return db['ChatApplication'][_0xfb64('0x32')]({'where':{'ChatWebsiteId':_0x518220[_0xfb64('0x57')]['id']},'transaction':_0x48453d})[_0xfb64('0x31')](function(_0x1619d4){var _0xbe3fd7=_[_0xfb64('0x69')](_0x518220[_0xfb64('0x5b')],function(_0x413427){_0x413427[_0xfb64('0x64')]=_0x518220['params']['id'];return _0x413427;});return db[_0xfb64('0x9a')][_0xfb64('0xfe')](_0xbe3fd7,{'transaction':_0x48453d});});})[_0xfb64('0x31')](function(){return db[_0xfb64('0x9a')][_0xfb64('0xff')]({'where':{'ChatWebsiteId':_0x518220[_0xfb64('0x57')]['id']},'order':_0xfb64('0xa0')});});}})[_0xfb64('0x31')](respondWithResult(_0x29c08b,null))[_0xfb64('0x25')](handleError(_0x29c08b,null));};exports[_0xfb64('0x100')]=function(_0x52cfef,_0x2ee97f,_0x57c772){var _0x33518c={};var _0x9b0de1={};var _0x187fc3;var _0x5d781c;return db[_0xfb64('0x39')]['findOne']({'where':{'id':_0x52cfef['params']['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x2ee97f,null))[_0xfb64('0x31')](function(_0x2e9249){if(_0x2e9249){_0x187fc3=_0x2e9249;_0x9b0de1[_0xfb64('0x3b')]=_[_0xfb64('0x3c')](db['ChatApplication'][_0xfb64('0x3a')]);_0x9b0de1['query']=_[_0xfb64('0x3c')](_0x52cfef[_0xfb64('0x3d')]);_0x9b0de1['filters']=_['intersection'](_0x9b0de1[_0xfb64('0x3b')],_0x9b0de1[_0xfb64('0x3d')]);_0x33518c[_0xfb64('0x43')]=_[_0xfb64('0x41')](_0x9b0de1[_0xfb64('0x3b')],qs[_0xfb64('0x42')](_0x52cfef[_0xfb64('0x3d')][_0xfb64('0x42')]));_0x33518c['attributes']=_0x33518c['attributes'][_0xfb64('0x44')]?_0x33518c[_0xfb64('0x43')]:_0x9b0de1[_0xfb64('0x3b')];_0x33518c[_0xfb64('0x47')]=qs['sort'](_0x52cfef[_0xfb64('0x3d')][_0xfb64('0x48')]);_0x33518c[_0xfb64('0x4d')]=qs[_0xfb64('0x40')](_[_0xfb64('0x49')](_0x52cfef['query'],_0x9b0de1['filters']));if(_0x52cfef[_0xfb64('0x3d')]['filter']){_0x33518c[_0xfb64('0x4d')]=_[_0xfb64('0x4c')](_0x33518c[_0xfb64('0x4d')],{'$or':_[_0xfb64('0x69')](_0x33518c['attributes'],function(_0x3f31f3){var _0x56cc49={};_0x56cc49[_0x3f31f3]={'$like':'%'+_0x52cfef[_0xfb64('0x3d')][_0xfb64('0x4e')]+'%'};return _0x56cc49;})});}_0x33518c=_['merge']({},_0x33518c,_0x52cfef['options']);return _0x187fc3[_0xfb64('0x100')](_0x33518c);}})[_0xfb64('0x31')](function(_0xe9588f){if(_0xe9588f){_0x5d781c=_0xe9588f['length'];if(!_0x52cfef[_0xfb64('0x3d')][_0xfb64('0x45')](_0xfb64('0x68'))){_0x33518c[_0xfb64('0x46')]=qs[_0xfb64('0x46')](_0x52cfef['query']['limit']);_0x33518c['offset']=qs[_0xfb64('0x2b')](_0x52cfef[_0xfb64('0x3d')][_0xfb64('0x2b')]);}return _0x187fc3[_0xfb64('0x100')](_0x33518c);}})['then'](function(_0xe6907c){if(_0xe6907c){return _0xe6907c?{'count':_0x5d781c,'rows':_0xe6907c}:null;}})['then'](respondWithResult(_0x2ee97f,null))['catch'](handleError(_0x2ee97f,null));};exports['addProactiveActions']=function(_0x30656f,_0x423857,_0x3896a0){return db[_0xfb64('0x101')][_0xfb64('0x59')]({'where':{'id':_0x30656f['params']['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x423857,null))[_0xfb64('0x31')](function(_0x438d04){if(_0x438d04){return _0x438d04[_0xfb64('0x102')](_0x30656f[_0xfb64('0x5b')]['ids'],_[_0xfb64('0xdc')](_0x30656f['body'],[_0xfb64('0x6e'),'id'])||{});}})[_0xfb64('0x31')](respondWithResult(_0x423857,null))[_0xfb64('0x25')](handleError(_0x423857,null));};exports[_0xfb64('0xee')]=function(_0x3f5a46,_0x597663,_0x25346d){var _0x1c87f4={};var _0x36fb01={};var _0x37ff78;var _0x931392;return db['ChatWebsite'][_0xfb64('0x66')]({'where':{'id':_0x3f5a46[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x597663,null))[_0xfb64('0x31')](function(_0x11e38d){if(_0x11e38d){_0x37ff78=_0x11e38d;_0x36fb01[_0xfb64('0x3b')]=_[_0xfb64('0x3c')](db['ChatProactiveAction']['rawAttributes']);_0x36fb01[_0xfb64('0x3d')]=_[_0xfb64('0x3c')](_0x3f5a46[_0xfb64('0x3d')]);_0x36fb01['filters']=_[_0xfb64('0x41')](_0x36fb01['model'],_0x36fb01[_0xfb64('0x3d')]);_0x1c87f4[_0xfb64('0x43')]=_[_0xfb64('0x41')](_0x36fb01[_0xfb64('0x3b')],qs[_0xfb64('0x42')](_0x3f5a46[_0xfb64('0x3d')][_0xfb64('0x42')]));_0x1c87f4[_0xfb64('0x43')]=_0x1c87f4[_0xfb64('0x43')][_0xfb64('0x44')]?_0x1c87f4[_0xfb64('0x43')]:_0x36fb01['model'];_0x1c87f4['order']=qs['sort'](_0x3f5a46['query'][_0xfb64('0x48')]);_0x1c87f4[_0xfb64('0x4d')]=qs[_0xfb64('0x40')](_[_0xfb64('0x49')](_0x3f5a46[_0xfb64('0x3d')],_0x36fb01['filters']));if(_0x3f5a46[_0xfb64('0x3d')]['filter']){_0x1c87f4['where']=_[_0xfb64('0x4c')](_0x1c87f4[_0xfb64('0x4d')],{'$or':_[_0xfb64('0x69')](_0x1c87f4[_0xfb64('0x43')],function(_0x1b0095){var _0xd3d3f={};_0xd3d3f[_0x1b0095]={'$like':'%'+_0x3f5a46[_0xfb64('0x3d')][_0xfb64('0x4e')]+'%'};return _0xd3d3f;})});}_0x1c87f4=_[_0xfb64('0x4c')]({},_0x1c87f4,_0x3f5a46['options']);return _0x37ff78[_0xfb64('0xee')](_0x1c87f4);}})['then'](function(_0x38d5e8){if(_0x38d5e8){_0x931392=_0x38d5e8[_0xfb64('0x44')];if(!_0x3f5a46['query'][_0xfb64('0x45')](_0xfb64('0x68'))){_0x1c87f4[_0xfb64('0x46')]=qs[_0xfb64('0x46')](_0x3f5a46[_0xfb64('0x3d')][_0xfb64('0x46')]);_0x1c87f4[_0xfb64('0x2b')]=qs[_0xfb64('0x2b')](_0x3f5a46[_0xfb64('0x3d')][_0xfb64('0x2b')]);}return _0x37ff78[_0xfb64('0xee')](_0x1c87f4);}})[_0xfb64('0x31')](function(_0x49f2f4){if(_0x49f2f4){return _0x49f2f4?{'count':_0x931392,'rows':_0x49f2f4}:null;}})[_0xfb64('0x31')](respondWithResult(_0x597663,null))[_0xfb64('0x25')](handleError(_0x597663,null));};exports['getFields']=function(_0x3b7465,_0x30f0da,_0x43d1c6){var _0x2fb19e=_0x3b7465['query'][_0xfb64('0x103')]===_0xfb64('0x104')?_0xfb64('0x105'):_0xfb64('0x106');return db[_0xfb64('0x39')][_0xfb64('0x59')]({'attributes':['id',_0x2fb19e],'where':{'id':_0x3b7465[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x30f0da,null))[_0xfb64('0x31')](function(_0x476357){if(_0x476357){var _0x11b62c=_0x476357[_0x2fb19e];var _0x5a37b0=_0x11b62c&&_0x11b62c[_0xfb64('0x107')]?_0x11b62c[_0xfb64('0x107')]:[];_0x30f0da[_0xfb64('0x37')]({'fromKey':_[_0xfb64('0x79')](_0x11b62c[_0xfb64('0x108')])?undefined:_0x11b62c['fromKey'],'count':_0x5a37b0['length'],'rows':_0x5a37b0});}})[_0xfb64('0x25')](handleError(_0x30f0da,null));};exports[_0xfb64('0x109')]=function(_0x14ebcc,_0x2687dd,_0xb6fd7a){var _0x53235c={'raw':!![],'where':{}};var _0x3531c3={};var _0x414891={'count':0x0,'rows':[]};return db[_0xfb64('0x39')][_0xfb64('0x66')]({'where':{'id':_0x14ebcc['params']['id']}})['then'](handleEntityNotFound(_0x2687dd,null))[_0xfb64('0x31')](function(_0x22fce8){if(_0x22fce8){_0x3531c3[_0xfb64('0x3b')]=_[_0xfb64('0x3c')](db['ChatOfflineMessage'][_0xfb64('0x3a')]);_0x3531c3[_0xfb64('0x3d')]=_[_0xfb64('0x3c')](_0x14ebcc[_0xfb64('0x3d')]);_0x3531c3[_0xfb64('0x40')]=_[_0xfb64('0x41')](_0x3531c3['model'],_0x3531c3[_0xfb64('0x3d')]);_0x53235c[_0xfb64('0x43')]=_[_0xfb64('0x41')](_0x3531c3[_0xfb64('0x3b')],qs[_0xfb64('0x42')](_0x14ebcc['query'][_0xfb64('0x42')]));_0x53235c[_0xfb64('0x43')]=_0x53235c['attributes'][_0xfb64('0x44')]?_0x53235c[_0xfb64('0x43')]:_0x3531c3['model'];if(!_0x14ebcc[_0xfb64('0x3d')][_0xfb64('0x45')](_0xfb64('0x68'))){_0x53235c[_0xfb64('0x46')]=qs[_0xfb64('0x46')](_0x14ebcc[_0xfb64('0x3d')][_0xfb64('0x46')]);_0x53235c['offset']=qs[_0xfb64('0x2b')](_0x14ebcc[_0xfb64('0x3d')][_0xfb64('0x2b')]);}_0x53235c[_0xfb64('0x47')]=qs[_0xfb64('0x48')](_0x14ebcc[_0xfb64('0x3d')][_0xfb64('0x48')]);_0x53235c[_0xfb64('0x4d')]=qs['filters'](_[_0xfb64('0x49')](_0x14ebcc[_0xfb64('0x3d')],_0x3531c3[_0xfb64('0x40')]));_0x53235c[_0xfb64('0x4d')][_0xfb64('0x64')]=_0x22fce8['id'];if(_0x14ebcc[_0xfb64('0x3d')]['filter']){_0x53235c['where']=_[_0xfb64('0x4c')](_0x53235c['where'],{'$or':_['map'](_0x53235c[_0xfb64('0x43')],function(_0x384e4e){var _0x231bef={};_0x231bef[_0x384e4e]={'$like':'%'+_0x14ebcc['query'][_0xfb64('0x4e')]+'%'};return _0x231bef;})});}_0x53235c=_[_0xfb64('0x4c')]({},_0x53235c,_0x14ebcc[_0xfb64('0x58')]);return db['ChatOfflineMessage'][_0xfb64('0x2a')]({'where':_0x53235c[_0xfb64('0x4d')]})['then'](function(_0x66170b){_0x414891[_0xfb64('0x2a')]=_0x66170b;if(_0x14ebcc[_0xfb64('0x3d')]['includeAll']){_0x53235c['include']=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xfb64('0x54')](_0x53235c);})[_0xfb64('0x31')](function(_0x1a098d){_0x414891[_0xfb64('0x55')]=_0x1a098d;return _0x414891;});}})['then'](respondWithFilteredResult(_0x2687dd,_0x53235c))[_0xfb64('0x25')](handleError(_0x2687dd,null));};exports[_0xfb64('0x10a')]=function(_0x4ecbaa,_0x48e0e6,_0x21bfc5){return db[_0xfb64('0x39')]['find']({'where':{'id':_0x4ecbaa[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x48e0e6,null))[_0xfb64('0x31')](function(_0x2ada06){if(_0x2ada06){return _0x2ada06['addAgents'](_0x4ecbaa[_0xfb64('0x5b')][_0xfb64('0x6e')],_[_0xfb64('0xdc')](_0x4ecbaa[_0xfb64('0x5b')],[_0xfb64('0x6e'),'id'])||{})[_0xfb64('0xb4')](function(_0x15f2a0){for(var _0x51e4f8=0x0;_0x51e4f8<_0x4ecbaa[_0xfb64('0x5b')][_0xfb64('0x6e')]['length'];_0x51e4f8+=0x1){socket['emit'](_0xfb64('0x10b'),{'UserId':_0x4ecbaa['body'][_0xfb64('0x6e')][_0x51e4f8],'ChatWebsiteId':_0x4ecbaa[_0xfb64('0x57')]['id']});}return _0x15f2a0;});}})[_0xfb64('0x31')](respondWithResult(_0x48e0e6,null))[_0xfb64('0x25')](handleError(_0x48e0e6,null));};exports[_0xfb64('0x10c')]=function(_0x404930,_0x52f913,_0x753760){var _0x387527;return db[_0xfb64('0x39')][_0xfb64('0x59')]({'where':{'id':_0x404930[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0x52f913,null))[_0xfb64('0x31')](function(_0x3bbe2d){if(_0x3bbe2d){return _0x3bbe2d[_0xfb64('0x10c')](_0x404930[_0xfb64('0x3d')]['ids'])[_0xfb64('0x31')](function(_0x1247a7){if(_[_0xfb64('0x10d')](_0x404930[_0xfb64('0x3d')][_0xfb64('0x6e')])){for(var _0x3da64f=0x0;_0x3da64f<_0x404930['query']['ids'][_0xfb64('0x44')];_0x3da64f+=0x1){socket['emit'](_0xfb64('0x10e'),{'UserId':_0x404930[_0xfb64('0x3d')][_0xfb64('0x6e')][_0x3da64f],'ChatWebsiteId':_0x404930[_0xfb64('0x57')]['id']});}}else{socket[_0xfb64('0x10f')](_0xfb64('0x10e'),{'UserId':_0x404930[_0xfb64('0x3d')]['ids'],'ChatWebsiteId':_0x404930['params']['id']});}});}})[_0xfb64('0x31')](respondWithStatusCode(_0x52f913,null))[_0xfb64('0x25')](handleError(_0x52f913,null));};exports[_0xfb64('0x110')]=function(_0x5cd77b,_0xb84efc,_0x4fbc83){var _0x51da64={};var _0x1dd00b={};var _0x22b7c5;var _0x40f091;return db[_0xfb64('0x39')][_0xfb64('0x66')]({'where':{'id':_0x5cd77b[_0xfb64('0x57')]['id']}})[_0xfb64('0x31')](handleEntityNotFound(_0xb84efc,null))[_0xfb64('0x31')](function(_0x5a9f5e){if(_0x5a9f5e){_0x22b7c5=_0x5a9f5e;_0x1dd00b[_0xfb64('0x3b')]=_[_0xfb64('0x3c')](db[_0xfb64('0x111')][_0xfb64('0x3a')]);_0x1dd00b['query']=_['keys'](_0x5cd77b[_0xfb64('0x3d')]);_0x1dd00b[_0xfb64('0x40')]=_[_0xfb64('0x41')](_0x1dd00b[_0xfb64('0x3b')],_0x1dd00b['query']);_0x51da64[_0xfb64('0x43')]=_[_0xfb64('0x41')](_0x1dd00b[_0xfb64('0x3b')],qs[_0xfb64('0x42')](_0x5cd77b[_0xfb64('0x3d')][_0xfb64('0x42')]));_0x51da64['attributes']=_0x51da64[_0xfb64('0x43')][_0xfb64('0x44')]?_0x51da64[_0xfb64('0x43')]:_0x1dd00b[_0xfb64('0x3b')];_0x51da64[_0xfb64('0x47')]=qs[_0xfb64('0x48')](_0x5cd77b[_0xfb64('0x3d')][_0xfb64('0x48')]);_0x51da64[_0xfb64('0x4d')]=qs[_0xfb64('0x40')](_['pick'](_0x5cd77b['query'],_0x1dd00b['filters']));if(_0x5cd77b['query'][_0xfb64('0x4e')]){_0x51da64[_0xfb64('0x4d')]=_['merge'](_0x51da64[_0xfb64('0x4d')],{'$or':_[_0xfb64('0x69')](_0x51da64[_0xfb64('0x43')],function(_0x2aad0e){var _0x532937={};_0x532937[_0x2aad0e]={'$like':'%'+_0x5cd77b['query'][_0xfb64('0x4e')]+'%'};return _0x532937;})});}_0x51da64=_[_0xfb64('0x4c')]({},_0x51da64,_0x5cd77b[_0xfb64('0x58')]);return _0x22b7c5[_0xfb64('0x110')](_0x51da64);}})['then'](function(_0x449535){if(_0x449535){_0x40f091=_0x449535[_0xfb64('0x44')];if(!_0x5cd77b[_0xfb64('0x3d')][_0xfb64('0x45')](_0xfb64('0x68'))){_0x51da64[_0xfb64('0x46')]=qs['limit'](_0x5cd77b['query'][_0xfb64('0x46')]);_0x51da64['offset']=qs[_0xfb64('0x2b')](_0x5cd77b[_0xfb64('0x3d')][_0xfb64('0x2b')]);}return _0x22b7c5[_0xfb64('0x110')](_0x51da64);}})[_0xfb64('0x31')](function(_0x3be72e){if(_0x3be72e){return _0x3be72e?{'count':_0x40f091,'rows':_0x3be72e}:null;}})[_0xfb64('0x31')](respondWithResult(_0xb84efc,null))[_0xfb64('0x25')](handleError(_0xb84efc,null));};
\ No newline at end of file
+var _0x12ac=['from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','applications','Applications','list','orderBy','account','contact','firstName','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','createdAt','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','findOrCreate','utf8','render','toPairs','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','virtual','custom','License','increment','chatLicenseExceeded','Intervals','readFileSync','server/files/chat/iframe.js','remote','x-real-ip','alignment','verticalAlignment','sequelize','transaction','findAndCountAll','priority','getApplications','addProactiveActions','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','count','offset','set','Content-Range','apply','reject','update','destroy','get','ChatWebsites','end','stack','name','index','ChatWebsite','model','keys','query','dateEnd','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','where','pick','add','day','dateStart','filter','map','type','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','filters','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','length','sort','merge','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','join','sitepic','../../config/license/util','isNil','existsSync','server/files/images/logos/','root','download','getAvatar','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','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','CompanyId','ListId','from'];(function(_0x101d51,_0xf7af1b){var _0x407e9e=function(_0x1b1e87){while(--_0x1b1e87){_0x101d51['push'](_0x101d51['shift']());}};_0x407e9e(++_0xf7af1b);}(_0x12ac,0x7c));var _0xc12a=function(_0x2ddcee,_0x49d784){_0x2ddcee=_0x2ddcee-0x0;var _0x2cd13a=_0x12ac[_0x2ddcee];return _0x2cd13a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc12a('0x0'));var rimraf=require(_0xc12a('0x1'));var zipdir=require(_0xc12a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc12a('0x3'));var moment=require(_0xc12a('0x4'));var BPromise=require(_0xc12a('0x5'));var Mustache=require(_0xc12a('0x6'));var util=require(_0xc12a('0x7'));var path=require('path');var sox=require(_0xc12a('0x8'));var csv=require('to-csv');var ejs=require(_0xc12a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc12a('0xa'));var crypto=require(_0xc12a('0xb'));var jsforce=require(_0xc12a('0xc'));var deskjs=require(_0xc12a('0xd'));var toCsv=require(_0xc12a('0xe'));var querystring=require(_0xc12a('0xf'));var Papa=require(_0xc12a('0x10'));var Redis=require(_0xc12a('0x11'));var qs=require(_0xc12a('0x12'));var logger=require(_0xc12a('0x13'))(_0xc12a('0x14'));var utils=require('../../config/utils');var config=require(_0xc12a('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc12a('0x16')](config[_0xc12a('0x17')],{'host':_0xc12a('0x18'),'port':0x18eb});var socket=require(_0xc12a('0x19'))(new Redis(config[_0xc12a('0x17')]));require(_0xc12a('0x1a'))[_0xc12a('0x1b')](socket);var jayson=require(_0xc12a('0x1c'));var client=jayson['client'][_0xc12a('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xc12a('0x1d')]({'port':0x232a});var client9003=jayson[_0xc12a('0x1e')]['http']({'port':0x232b});function respondWithRpcPromise(_0x5116c4,_0x467a14,_0x2e7a39,_0x28571b){return new BPromise(function(_0x526923,_0x387682){var _0x1a4499=_0x28571b||client;return _0x1a4499[_0xc12a('0x1f')](_0x5116c4,_0x2e7a39)[_0xc12a('0x20')](function(_0x7b4ba8){logger[_0xc12a('0x21')](_0xc12a('0x22'),_0x467a14,'request\x20sent');logger[_0xc12a('0x23')](_0xc12a('0x24'),_0x467a14,_0xc12a('0x25'),JSON[_0xc12a('0x26')](_0x7b4ba8));if(_0x7b4ba8[_0xc12a('0x27')]){if(_0x7b4ba8[_0xc12a('0x27')][_0xc12a('0x28')]===0x1f4){logger[_0xc12a('0x27')](_0xc12a('0x22'),_0x467a14,_0x7b4ba8[_0xc12a('0x27')][_0xc12a('0x29')]);return _0x387682(_0x7b4ba8[_0xc12a('0x27')][_0xc12a('0x29')]);}logger[_0xc12a('0x27')](_0xc12a('0x22'),_0x467a14,_0x7b4ba8[_0xc12a('0x27')][_0xc12a('0x29')]);return _0x526923(_0x7b4ba8[_0xc12a('0x27')][_0xc12a('0x29')]);}else{logger[_0xc12a('0x21')](_0xc12a('0x22'),_0x467a14,'request\x20sent');_0x526923(_0x7b4ba8['result'][_0xc12a('0x29')]);}})['catch'](function(_0x1b6f44){logger[_0xc12a('0x27')](_0xc12a('0x22'),_0x467a14,_0x1b6f44);_0x387682(_0x1b6f44);});});}function respondWithStatusCode(_0x7f71aa,_0x1f2ee3){_0x1f2ee3=_0x1f2ee3||0xcc;return function(_0x3781ea){if(_0x3781ea){return _0x7f71aa['sendStatus'](_0x1f2ee3);}return _0x7f71aa['status'](_0x1f2ee3)['end']();};}function respondWithResult(_0x4c067a,_0x3c4149){_0x3c4149=_0x3c4149||0xc8;return function(_0xbe9dd0){if(_0xbe9dd0){return _0x4c067a[_0xc12a('0x2a')](_0x3c4149)['json'](_0xbe9dd0);}};}function respondWithFilteredResult(_0x339350,_0x20f584){return function(_0x4dff8e){if(_0x4dff8e){var _0x472b7b=_0x4dff8e[_0xc12a('0x2b')],_0x41830c=_0x20f584[_0xc12a('0x2c')],_0x46c072=_0x20f584[_0xc12a('0x2c')]+_0x20f584['limit'],_0x34d14e;if(_0x46c072>=_0x472b7b){_0x46c072=_0x472b7b;_0x34d14e=0xc8;}else{_0x34d14e=0xce;}_0x339350[_0xc12a('0x2a')](_0x34d14e);return _0x339350[_0xc12a('0x2d')](_0xc12a('0x2e'),_0x41830c+'-'+_0x46c072+'/'+_0x472b7b)['json'](_0x4dff8e);}return null;};}function patchUpdates(_0x41f1f1){return function(_0x3f04a0){try{jsonpatch[_0xc12a('0x2f')](_0x3f04a0,_0x41f1f1,!![]);}catch(_0x80cd0a){return BPromise[_0xc12a('0x30')](_0x80cd0a);}return _0x3f04a0['save']();};}function saveUpdates(_0x2d0b64,_0x313334){return function(_0x5a89f8){if(_0x5a89f8){return _0x5a89f8[_0xc12a('0x31')](_0x2d0b64)[_0xc12a('0x20')](function(_0x5dca9e){return _0x5dca9e;});}return null;};}function removeEntity(_0xde44b,_0x1ae8a8){return function(_0xa833cf){if(_0xa833cf){return _0xa833cf[_0xc12a('0x32')]()[_0xc12a('0x20')](function(){var _0x39459c=_0xa833cf[_0xc12a('0x33')]({'plain':!![]});var _0xe7a9a0=_0xc12a('0x34');return db['UserProfileResource'][_0xc12a('0x32')]({'where':{'type':_0xe7a9a0,'resourceId':_0x39459c['id']}})['then'](function(){return _0xa833cf;});})[_0xc12a('0x20')](function(){_0xde44b[_0xc12a('0x2a')](0xcc)[_0xc12a('0x35')]();});}};}function handleEntityNotFound(_0x25833c,_0x104589){return function(_0x3616ab){if(!_0x3616ab){_0x25833c['sendStatus'](0x194);}return _0x3616ab;};}function handleError(_0x1498b6,_0x5a451c){_0x5a451c=_0x5a451c||0x1f4;return function(_0x18efb0){logger[_0xc12a('0x27')](_0x18efb0[_0xc12a('0x36')]);if(_0x18efb0[_0xc12a('0x37')]){delete _0x18efb0[_0xc12a('0x37')];}_0x1498b6[_0xc12a('0x2a')](_0x5a451c)['send'](_0x18efb0);};}exports[_0xc12a('0x38')]=function(_0x43d137,_0x2eddaf){var _0x2e7d40={},_0x5838fc={},_0x4c4578={'count':0x0,'rows':[]};var _0xefcd23=db[_0xc12a('0x39')]['rawAttributes'];_0x5838fc[_0xc12a('0x3a')]=_[_0xc12a('0x3b')](_0xefcd23);var _0xbd3985={'dateStart':_0x43d137[_0xc12a('0x3c')]['dateStart'],'dateEnd':_0x43d137[_0xc12a('0x3c')][_0xc12a('0x3d')]};delete _0x43d137[_0xc12a('0x3c')]['dateStart'];delete _0x43d137[_0xc12a('0x3c')][_0xc12a('0x3d')];_0x5838fc[_0xc12a('0x3c')]=_[_0xc12a('0x3b')](_0x43d137[_0xc12a('0x3c')]);_0x5838fc['filters']=_['intersection'](_0x5838fc[_0xc12a('0x3a')],_0x5838fc[_0xc12a('0x3c')]);_0x2e7d40[_0xc12a('0x3e')]=_[_0xc12a('0x3f')](_0x5838fc[_0xc12a('0x3a')],qs['fields'](_0x43d137['query'][_0xc12a('0x40')]));_0x2e7d40['attributes']=_0x2e7d40[_0xc12a('0x3e')]['length']?_0x2e7d40[_0xc12a('0x3e')]:_0x5838fc[_0xc12a('0x3a')];if(!_0x43d137[_0xc12a('0x3c')][_0xc12a('0x41')](_0xc12a('0x42'))){_0x2e7d40['limit']=qs[_0xc12a('0x43')](_0x43d137[_0xc12a('0x3c')][_0xc12a('0x43')]);_0x2e7d40[_0xc12a('0x2c')]=qs[_0xc12a('0x2c')](_0x43d137['query'][_0xc12a('0x2c')]);}_0x2e7d40[_0xc12a('0x44')]=qs['sort'](_0x43d137[_0xc12a('0x3c')]['sort']);_0x2e7d40[_0xc12a('0x45')]=qs['filters'](_[_0xc12a('0x46')](_0x43d137[_0xc12a('0x3c')],_0x5838fc['filters']));if(_0xbd3985['dateStart']){if(_0xbd3985[_0xc12a('0x3d')]){_0xbd3985[_0xc12a('0x3d')]=moment(_0xbd3985[_0xc12a('0x3d')])[_0xc12a('0x47')](0x1,_0xc12a('0x48'));}else{_0xbd3985[_0xc12a('0x3d')]=moment(_0xbd3985[_0xc12a('0x49')])[_0xc12a('0x47')](0x1,_0xc12a('0x48'));}_['merge'](_0x2e7d40[_0xc12a('0x45')],{'createdAt':{'$gte':_0xbd3985[_0xc12a('0x49')],'$lte':_0xbd3985[_0xc12a('0x3d')]}});}if(_0x43d137['query'][_0xc12a('0x4a')]){_0x2e7d40[_0xc12a('0x45')]=_['merge'](_0x2e7d40[_0xc12a('0x45')],{'$or':_[_0xc12a('0x4b')](_0xefcd23,function(_0x22a7b0){if(_0x22a7b0[_0xc12a('0x4c')]['key']!==_0xc12a('0x4d')){var _0x2b040d={};_0x2b040d[_0x22a7b0['field']]={'$like':'%'+_0x43d137[_0xc12a('0x3c')]['filter']+'%'};return _0x2b040d;}})});}_0x2e7d40=_['merge']({},_0x2e7d40,_0x43d137['options']);var _0x12d620={'where':_0x2e7d40[_0xc12a('0x45')]};return db[_0xc12a('0x39')][_0xc12a('0x2b')](_0x12d620)['then'](function(_0x583ff5){_0x4c4578[_0xc12a('0x2b')]=_0x583ff5;if(_0x43d137[_0xc12a('0x3c')][_0xc12a('0x4e')]){_0x2e7d40[_0xc12a('0x4f')]=[{'all':!![]}];}return db[_0xc12a('0x39')][_0xc12a('0x50')](_0x2e7d40);})[_0xc12a('0x20')](function(_0x3d721f){_0x4c4578[_0xc12a('0x51')]=_0x3d721f;return _0x4c4578;})[_0xc12a('0x20')](respondWithFilteredResult(_0x2eddaf,_0x2e7d40))['catch'](handleError(_0x2eddaf,null));};exports['show']=function(_0x41186b,_0x3dd74b){var _0x181a77={'raw':![],'where':{'id':_0x41186b[_0xc12a('0x52')]['id']}},_0x3cd6f1={};_0x3cd6f1[_0xc12a('0x3a')]=_['keys'](db[_0xc12a('0x39')][_0xc12a('0x53')]);_0x3cd6f1['query']=_[_0xc12a('0x3b')](_0x41186b[_0xc12a('0x3c')]);_0x3cd6f1[_0xc12a('0x54')]=_[_0xc12a('0x3f')](_0x3cd6f1[_0xc12a('0x3a')],_0x3cd6f1[_0xc12a('0x3c')]);_0x181a77[_0xc12a('0x3e')]=_[_0xc12a('0x3f')](_0x3cd6f1[_0xc12a('0x3a')],qs[_0xc12a('0x40')](_0x41186b[_0xc12a('0x3c')][_0xc12a('0x40')]));_0x181a77[_0xc12a('0x3e')]=_0x181a77[_0xc12a('0x3e')]['length']?_0x181a77[_0xc12a('0x3e')]:_0x3cd6f1[_0xc12a('0x3a')];if(_0x41186b['query'][_0xc12a('0x4e')]){_0x181a77[_0xc12a('0x4f')]=[{'all':!![]}];}_0x181a77=_['merge']({},_0x181a77,_0x41186b[_0xc12a('0x55')]);return db[_0xc12a('0x39')][_0xc12a('0x56')](_0x181a77)[_0xc12a('0x20')](handleEntityNotFound(_0x3dd74b,null))[_0xc12a('0x20')](respondWithResult(_0x3dd74b,null))[_0xc12a('0x57')](handleError(_0x3dd74b,null));};exports['create']=function(_0x440a7d,_0xf04f3a){return db['ChatWebsite'][_0xc12a('0x58')](_0x440a7d[_0xc12a('0x59')],{})[_0xc12a('0x20')](function(_0x365f8b){var _0x574a3c=_0x440a7d[_0xc12a('0x5a')]['get']({'plain':!![]});if(!_0x574a3c)throw new Error(_0xc12a('0x5b'));if(_0x574a3c[_0xc12a('0x5c')]===_0xc12a('0x5a')){var _0x1a4872=_0x365f8b[_0xc12a('0x33')]({'plain':!![]});var _0x7191f3=_0xc12a('0x34');return db[_0xc12a('0x5d')]['find']({'where':{'name':_0x7191f3,'userProfileId':_0x574a3c[_0xc12a('0x5e')]},'raw':!![]})[_0xc12a('0x20')](function(_0x42d43c){if(_0x42d43c&&_0x42d43c[_0xc12a('0x5f')]===0x0){return db[_0xc12a('0x60')][_0xc12a('0x58')]({'name':_0x1a4872[_0xc12a('0x37')],'resourceId':_0x1a4872['id'],'type':_0x42d43c['name'],'sectionId':_0x42d43c['id']},{})[_0xc12a('0x20')](function(){return _0x365f8b;});}else{return _0x365f8b;}})[_0xc12a('0x57')](function(_0x4c6f77){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c6f77);throw _0x4c6f77;});}return _0x365f8b;})[_0xc12a('0x20')](respondWithResult(_0xf04f3a,0xc9))[_0xc12a('0x57')](handleError(_0xf04f3a,null));};exports[_0xc12a('0x31')]=function(_0x243c39,_0x13d954){if(_0x243c39[_0xc12a('0x59')]['id']){delete _0x243c39[_0xc12a('0x59')]['id'];}return db[_0xc12a('0x39')]['find']({'where':{'id':_0x243c39[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x13d954,null))['then'](saveUpdates(_0x243c39['body'],null))[_0xc12a('0x20')](respondWithResult(_0x13d954,null))[_0xc12a('0x57')](handleError(_0x13d954,null));};exports['destroy']=function(_0x53a527,_0x45b206){return db[_0xc12a('0x39')]['find']({'where':{'id':_0x53a527[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x45b206,null))['then'](removeEntity(_0x45b206,null))['catch'](handleError(_0x45b206,null));};exports[_0xc12a('0x61')]=function(_0x3259ee,_0x46dad3){return db[_0xc12a('0x39')][_0xc12a('0x61')]()['then'](respondWithResult(_0x46dad3,null))['catch'](handleError(_0x46dad3,null));};exports[_0xc12a('0x62')]=function(_0x4ceca5,_0x1cef39,_0x5c3bec){if(_0x4ceca5[_0xc12a('0x59')]['id']){delete _0x4ceca5[_0xc12a('0x59')]['id'];}return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x4ceca5[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x1cef39,null))['then'](function(_0x168e21){if(_0x168e21){_0x4ceca5[_0xc12a('0x59')][_0xc12a('0x63')]=_0x168e21['id'];return db[_0xc12a('0x64')]['create'](_0x4ceca5['body']);}})[_0xc12a('0x20')](respondWithResult(_0x1cef39,null))[_0xc12a('0x57')](handleError(_0x1cef39,null));};exports[_0xc12a('0x65')]=function(_0x46ed99,_0x544ae5,_0x11c9db){var _0x4c272a={'raw':![],'where':{}};var _0x866837={};var _0x35ec37={'count':0x0,'rows':[]};return db[_0xc12a('0x39')][_0xc12a('0x66')]({'where':{'id':_0x46ed99[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x544ae5,null))['then'](function(_0x2e694a){if(_0x2e694a){_0x866837['model']=_['keys'](db[_0xc12a('0x64')]['rawAttributes']);_0x866837['query']=_[_0xc12a('0x3b')](_0x46ed99[_0xc12a('0x3c')]);_0x866837[_0xc12a('0x54')]=_[_0xc12a('0x3f')](_0x866837[_0xc12a('0x3a')],_0x866837[_0xc12a('0x3c')]);_0x4c272a['attributes']=_[_0xc12a('0x3f')](_0x866837[_0xc12a('0x3a')],qs[_0xc12a('0x40')](_0x46ed99[_0xc12a('0x3c')]['fields']));_0x4c272a[_0xc12a('0x3e')]=_0x4c272a[_0xc12a('0x3e')][_0xc12a('0x67')]?_0x4c272a[_0xc12a('0x3e')]:_0x866837['model'];if(!_0x46ed99[_0xc12a('0x3c')]['hasOwnProperty'](_0xc12a('0x42'))){_0x4c272a['limit']=qs[_0xc12a('0x43')](_0x46ed99[_0xc12a('0x3c')][_0xc12a('0x43')]);_0x4c272a[_0xc12a('0x2c')]=qs[_0xc12a('0x2c')](_0x46ed99[_0xc12a('0x3c')][_0xc12a('0x2c')]);}_0x4c272a['order']=qs[_0xc12a('0x68')](_0x46ed99[_0xc12a('0x3c')]['sort']);_0x4c272a[_0xc12a('0x45')]=qs[_0xc12a('0x54')](_['pick'](_0x46ed99[_0xc12a('0x3c')],_0x866837[_0xc12a('0x54')]));_0x4c272a[_0xc12a('0x45')][_0xc12a('0x63')]=_0x2e694a['id'];if(_0x46ed99[_0xc12a('0x3c')][_0xc12a('0x4a')]){_0x4c272a[_0xc12a('0x45')]=_[_0xc12a('0x69')](_0x4c272a[_0xc12a('0x45')],{'$or':_[_0xc12a('0x4b')](_0x4c272a[_0xc12a('0x3e')],function(_0x4dad7d){var _0x1c4916={};_0x1c4916[_0x4dad7d]={'$like':'%'+_0x46ed99[_0xc12a('0x3c')][_0xc12a('0x4a')]+'%'};return _0x1c4916;})});}_0x4c272a=_[_0xc12a('0x69')]({},_0x4c272a,_0x46ed99['options']);return db[_0xc12a('0x64')][_0xc12a('0x2b')]({'where':_0x4c272a[_0xc12a('0x45')]})[_0xc12a('0x20')](function(_0x1d7cd7){_0x35ec37[_0xc12a('0x2b')]=_0x1d7cd7;if(_0x46ed99[_0xc12a('0x3c')][_0xc12a('0x4e')]){_0x4c272a[_0xc12a('0x4f')]=[{'all':!![]}];}return db[_0xc12a('0x64')][_0xc12a('0x50')](_0x4c272a);})[_0xc12a('0x20')](function(_0x240ffb){_0x35ec37[_0xc12a('0x51')]=_0x240ffb;return _0x35ec37;});}})[_0xc12a('0x20')](respondWithFilteredResult(_0x544ae5,_0x4c272a))['catch'](handleError(_0x544ae5,null));};exports['removeDispositions']=function(_0x4fff13,_0x256183,_0x8ff0e5){var _0x34bcbb;return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x4fff13['params']['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x256183,null))[_0xc12a('0x20')](function(_0x27edc4){if(_0x27edc4){return _0x27edc4[_0xc12a('0x6a')](_0x4fff13[_0xc12a('0x3c')][_0xc12a('0x6b')]);}})[_0xc12a('0x20')](respondWithStatusCode(_0x256183,null))['catch'](handleError(_0x256183,null));};exports[_0xc12a('0x6c')]=function(_0x483ab4,_0x38dc58,_0xd3b8ee){if(_0x483ab4[_0xc12a('0x59')]['id']){delete _0x483ab4[_0xc12a('0x59')]['id'];}return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x483ab4[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x38dc58,null))['then'](function(_0x4a72b2){if(_0x4a72b2){_0x483ab4[_0xc12a('0x59')][_0xc12a('0x63')]=_0x4a72b2['id'];return db[_0xc12a('0x6d')][_0xc12a('0x58')](_0x483ab4[_0xc12a('0x59')]);}})[_0xc12a('0x20')](respondWithResult(_0x38dc58,null))[_0xc12a('0x57')](handleError(_0x38dc58,null));};exports['getAnswers']=function(_0x1bcf44,_0x38a14b,_0x42b3b5){var _0x2371ba={'raw':![],'where':{}};var _0x36b97a={};var _0x2094e1={'count':0x0,'rows':[]};return db[_0xc12a('0x39')]['findOne']({'where':{'id':_0x1bcf44[_0xc12a('0x52')]['id']}})['then'](handleEntityNotFound(_0x38a14b,null))[_0xc12a('0x20')](function(_0x3fd0f2){if(_0x3fd0f2){_0x36b97a[_0xc12a('0x3a')]=_['keys'](db[_0xc12a('0x6d')][_0xc12a('0x53')]);_0x36b97a[_0xc12a('0x3c')]=_[_0xc12a('0x3b')](_0x1bcf44['query']);_0x36b97a[_0xc12a('0x54')]=_['intersection'](_0x36b97a[_0xc12a('0x3a')],_0x36b97a[_0xc12a('0x3c')]);_0x2371ba[_0xc12a('0x3e')]=_[_0xc12a('0x3f')](_0x36b97a[_0xc12a('0x3a')],qs['fields'](_0x1bcf44[_0xc12a('0x3c')][_0xc12a('0x40')]));_0x2371ba[_0xc12a('0x3e')]=_0x2371ba[_0xc12a('0x3e')][_0xc12a('0x67')]?_0x2371ba[_0xc12a('0x3e')]:_0x36b97a['model'];if(!_0x1bcf44[_0xc12a('0x3c')][_0xc12a('0x41')](_0xc12a('0x42'))){_0x2371ba[_0xc12a('0x43')]=qs[_0xc12a('0x43')](_0x1bcf44[_0xc12a('0x3c')][_0xc12a('0x43')]);_0x2371ba[_0xc12a('0x2c')]=qs[_0xc12a('0x2c')](_0x1bcf44['query'][_0xc12a('0x2c')]);}_0x2371ba[_0xc12a('0x44')]=qs[_0xc12a('0x68')](_0x1bcf44[_0xc12a('0x3c')][_0xc12a('0x68')]);_0x2371ba[_0xc12a('0x45')]=qs[_0xc12a('0x54')](_[_0xc12a('0x46')](_0x1bcf44[_0xc12a('0x3c')],_0x36b97a['filters']));_0x2371ba[_0xc12a('0x45')][_0xc12a('0x63')]=_0x3fd0f2['id'];if(_0x1bcf44[_0xc12a('0x3c')][_0xc12a('0x4a')]){_0x2371ba[_0xc12a('0x45')]=_[_0xc12a('0x69')](_0x2371ba[_0xc12a('0x45')],{'$or':_['map'](_0x2371ba[_0xc12a('0x3e')],function(_0x31f054){var _0xbb5124={};_0xbb5124[_0x31f054]={'$like':'%'+_0x1bcf44[_0xc12a('0x3c')][_0xc12a('0x4a')]+'%'};return _0xbb5124;})});}_0x2371ba=_[_0xc12a('0x69')]({},_0x2371ba,_0x1bcf44[_0xc12a('0x55')]);return db[_0xc12a('0x6d')]['count']({'where':_0x2371ba[_0xc12a('0x45')]})[_0xc12a('0x20')](function(_0x3c6b9b){_0x2094e1[_0xc12a('0x2b')]=_0x3c6b9b;if(_0x1bcf44[_0xc12a('0x3c')][_0xc12a('0x4e')]){_0x2371ba['include']=[{'all':!![]}];}return db[_0xc12a('0x6d')][_0xc12a('0x50')](_0x2371ba);})['then'](function(_0x438587){_0x2094e1[_0xc12a('0x51')]=_0x438587;return _0x2094e1;});}})['then'](respondWithFilteredResult(_0x38a14b,_0x2371ba))['catch'](handleError(_0x38a14b,null));};exports[_0xc12a('0x6e')]=function(_0x352e02,_0x2c62b8,_0x15eea0){var _0x18066f;return db['ChatWebsite'][_0xc12a('0x56')]({'where':{'id':_0x352e02[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x2c62b8,null))[_0xc12a('0x20')](function(_0x53cf7b){if(_0x53cf7b){return _0x53cf7b['removeAnswers'](_0x352e02[_0xc12a('0x3c')][_0xc12a('0x6b')]);}})[_0xc12a('0x20')](respondWithStatusCode(_0x2c62b8,null))[_0xc12a('0x57')](handleError(_0x2c62b8,null));};exports[_0xc12a('0x6f')]=function(_0x142b1a,_0xa34101,_0x231cd5){_0x142b1a[_0xc12a('0x59')]['sitepic']=_0x142b1a[_0xc12a('0x70')][_0xc12a('0x71')];return db['ChatWebsite'][_0xc12a('0x56')]({'where':{'id':_0x142b1a[_0xc12a('0x52')]['id']}})['then'](handleEntityNotFound(_0xa34101,null))[_0xc12a('0x20')](saveUpdates(_0x142b1a[_0xc12a('0x59')],null))[_0xc12a('0x20')](respondWithResult(_0xa34101,null))['catch'](handleError(_0xa34101,null));};exports[_0xc12a('0x72')]=function(_0x211e36,_0x512b42,_0x21d071){_0x211e36['body'][_0xc12a('0x73')]=_0x211e36[_0xc12a('0x70')][_0xc12a('0x71')];return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x211e36['params']['id']}})['then'](handleEntityNotFound(_0x512b42,null))[_0xc12a('0x20')](saveUpdates(_0x211e36['body'],null))['then'](respondWithResult(_0x512b42,null))['catch'](handleError(_0x512b42,null));};exports['addCustomerAvatar']=function(_0x1771a4,_0x4b699e,_0x3eea74){_0x1771a4['body']['customerAvatar']=_0x1771a4['file'][_0xc12a('0x71')];return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x1771a4[_0xc12a('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b699e,null))[_0xc12a('0x20')](saveUpdates(_0x1771a4[_0xc12a('0x59')],null))[_0xc12a('0x20')](respondWithResult(_0x4b699e,null))[_0xc12a('0x57')](handleError(_0x4b699e,null));};exports[_0xc12a('0x74')]=function(_0x348415,_0x1e8d6f,_0x101e9b){_0x348415[_0xc12a('0x59')][_0xc12a('0x75')]=_0x348415['file'][_0xc12a('0x71')];return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x348415[_0xc12a('0x52')]['id']}})['then'](handleEntityNotFound(_0x1e8d6f,null))[_0xc12a('0x20')](saveUpdates(_0x348415[_0xc12a('0x59')],null))[_0xc12a('0x20')](respondWithResult(_0x1e8d6f,null))[_0xc12a('0x57')](handleError(_0x1e8d6f,null));};exports[_0xc12a('0x76')]=function(_0x3a8ad6,_0xd81ea5,_0x423709){var _0x3ca6b1=path[_0xc12a('0x77')](config['root'],'server/files/images/logos/default_logo.png');var _0x4a0124={'where':{'id':_0x3a8ad6[_0xc12a('0x52')]['id']},'attributes':['id',_0xc12a('0x78')],'raw':!![]};var _0x1282fa=![];return require(_0xc12a('0x79'))['getLicense']()[_0xc12a('0x20')](function(_0x3efd3f){if(_0x3efd3f){_0x1282fa=_0x3efd3f['custom'];}})[_0xc12a('0x20')](function(){return db[_0xc12a('0x39')][_0xc12a('0x56')](_0x4a0124);})['then'](handleEntityNotFound(_0xd81ea5,null))['then'](function(_0x3f7929){if(_0x3f7929){if(!_[_0xc12a('0x7a')](_0x3f7929[_0xc12a('0x78')])){if(fs[_0xc12a('0x7b')](path['join'](config['root'],_0xc12a('0x7c'),_0x3f7929[_0xc12a('0x78')]))&&_0x1282fa){_0x3ca6b1=path['join'](config[_0xc12a('0x7d')],_0xc12a('0x7c'),_0x3f7929['sitepic']);}}return _0xd81ea5[_0xc12a('0x7e')](_0x3ca6b1);}})[_0xc12a('0x57')](handleError(_0xd81ea5,null));};exports[_0xc12a('0x7f')]=function(_0xdab934,_0x567e13,_0x51020a){var _0x240305=path[_0xc12a('0x77')](config[_0xc12a('0x7d')],_0xc12a('0x80'));var _0xe41c50={'where':{'id':_0xdab934[_0xc12a('0x52')]['id']},'attributes':['id',_0xc12a('0x73')],'raw':!![]};return db['ChatWebsite'][_0xc12a('0x56')](_0xe41c50)[_0xc12a('0x20')](handleEntityNotFound(_0x567e13,null))[_0xc12a('0x20')](function(_0xbc85de){if(_0xbc85de){if(!_[_0xc12a('0x7a')](_0xbc85de[_0xc12a('0x73')])){if(fs[_0xc12a('0x7b')](path[_0xc12a('0x77')](config[_0xc12a('0x7d')],_0xc12a('0x81'),_0xbc85de[_0xc12a('0x73')]))){_0x240305=path[_0xc12a('0x77')](config['root'],_0xc12a('0x81'),_0xbc85de[_0xc12a('0x73')]);}}return _0x567e13[_0xc12a('0x7e')](_0x240305);}})['catch'](handleError(_0x567e13,null));};exports[_0xc12a('0x82')]=function(_0x52caac,_0x2984ea,_0x12d89f){var _0x52049d=path[_0xc12a('0x77')](config[_0xc12a('0x7d')],_0xc12a('0x83'));var _0x1ae8a3={'where':{'id':_0x52caac[_0xc12a('0x52')]['id']},'attributes':['id',_0xc12a('0x84'),_0xc12a('0x85')],'raw':!![]};return db[_0xc12a('0x39')][_0xc12a('0x56')](_0x1ae8a3)['then'](handleEntityNotFound(_0x2984ea,null))['then'](function(_0xac84bd){if(_0xac84bd){if(!_[_0xc12a('0x7a')](_0xac84bd[_0xc12a('0x84')])){if(fs[_0xc12a('0x7b')](path['join'](config[_0xc12a('0x7d')],_0xc12a('0x81'),_0xac84bd[_0xc12a('0x84')]))&&_0xac84bd[_0xc12a('0x85')]){_0x52049d=path[_0xc12a('0x77')](config[_0xc12a('0x7d')],_0xc12a('0x81'),_0xac84bd['customerAvatar']);}}return _0x2984ea[_0xc12a('0x7e')](_0x52049d);}})[_0xc12a('0x57')](handleError(_0x2984ea,null));};exports[_0xc12a('0x86')]=function(_0x27f4ef,_0x25586e,_0x431aed){var _0x36ab69=path[_0xc12a('0x77')](config[_0xc12a('0x7d')],_0xc12a('0x87'));var _0x1443b5={'where':{'id':_0x27f4ef[_0xc12a('0x52')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0xc12a('0x56')](_0x1443b5)[_0xc12a('0x20')](handleEntityNotFound(_0x25586e,null))[_0xc12a('0x20')](function(_0x1b0aee){if(_0x1b0aee){if(!_['isNil'](_0x1b0aee['systemAvatar'])){if(fs['existsSync'](path[_0xc12a('0x77')](config[_0xc12a('0x7d')],_0xc12a('0x81'),_0x1b0aee[_0xc12a('0x75')]))){_0x36ab69=path[_0xc12a('0x77')](config['root'],'server/files/images/avatars/',_0x1b0aee[_0xc12a('0x75')]);}}return _0x25586e[_0xc12a('0x7e')](_0x36ab69);}})[_0xc12a('0x57')](handleError(_0x25586e,null));};exports[_0xc12a('0x88')]=function(_0x8000e7,_0xccd3de,_0x562a6b){var _0x25ab82=require('user-agent-parser');var _0x42cb70=new _0x25ab82();var _0x527773=_0x42cb70[_0xc12a('0x89')](_0x8000e7[_0xc12a('0x8a')][_0xc12a('0x8b')])[_0xc12a('0x8c')]();var _0x4ba298={'body':_0x8000e7[_0xc12a('0x59')],'channel':_0xc12a('0x8d')};var _0x5a09e3=[];var _0xf2c1ad=[];var _0x4e3283={};var _0x39aa93=![];return db[_0xc12a('0x8e')]['describe']()[_0xc12a('0x20')](function(_0x5b7089){if(!_0x5b7089){throw new db[(_0xc12a('0x8f'))][(_0xc12a('0x90'))](_0xc12a('0x91'));}_0x5a09e3=_['difference'](_[_0xc12a('0x3b')](_0x5b7089),['createdAt',_0xc12a('0x92')]);_0xf2c1ad=_[_0xc12a('0x93')](_[_0xc12a('0x3b')](_0x5b7089),['createdAt',_0xc12a('0x92'),_0xc12a('0x94'),_0xc12a('0x95')]);if(_0x8000e7[_0xc12a('0x59')]['id']){delete _0x8000e7[_0xc12a('0x59')]['id'];}if(_[_0xc12a('0x7a')](_0x8000e7[_0xc12a('0x59')][_0xc12a('0x96')])){throw new db[(_0xc12a('0x8f'))][(_0xc12a('0x90'))](_0xc12a('0x97'));}if(_[_0xc12a('0x7a')](_0x8000e7[_0xc12a('0x59')][_0xc12a('0x59')])||_0x8000e7[_0xc12a('0x59')]['body']===''){throw new db['Sequelize'][(_0xc12a('0x90'))](_0xc12a('0x98'));}if(_[_0xc12a('0x7a')](_0x8000e7[_0xc12a('0x59')][_0xc12a('0x99')])){throw new db[(_0xc12a('0x8f'))][(_0xc12a('0x90'))](_0xc12a('0x9a')+_0xf2c1ad);}if(!_[_0xc12a('0x9b')](_0xf2c1ad,_0x8000e7[_0xc12a('0x59')][_0xc12a('0x99')])){throw new db[(_0xc12a('0x8f'))][(_0xc12a('0x90'))](_0xc12a('0x9c')+_0xf2c1ad);}_0x4e3283[_0x8000e7[_0xc12a('0x59')][_0xc12a('0x99')]]=_0x8000e7['body']['from'];})[_0xc12a('0x20')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x8000e7[_0xc12a('0x52')]['id']},'include':[{'model':db[_0xc12a('0x9d')],'as':_0xc12a('0x9e'),'include':[{'model':db['CmContact'],'as':_0xc12a('0x9f'),'where':_0x4e3283,'limit':0x1,'order':[[_0xc12a('0x92'),_0xc12a('0xa0')]]}]},{'model':db[_0xc12a('0xa1')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0xccd3de,null))[_0xc12a('0x20')](function(_0x280e3e){if(_0x280e3e&&_0x280e3e['List']){_0x4ba298['account']=_0x280e3e;_0x4ba298[_0xc12a('0xa2')]=_0x280e3e[_0xc12a('0xa3')];_0x4ba298[_0xc12a('0xa4')]=_0x280e3e[_0xc12a('0x9e')];_0x4ba298[_0xc12a('0xa2')]=_[_0xc12a('0xa5')](_0x4ba298[_0xc12a('0xa2')],['priority'],['asc']);if(_0x4ba298[_0xc12a('0xa6')][_0xc12a('0xa3')]){delete _0x4ba298[_0xc12a('0xa6')]['Applications'];}if(_0x4ba298['account'][_0xc12a('0x9e')]&&_0x4ba298[_0xc12a('0xa6')][_0xc12a('0x9e')][_0xc12a('0x9f')][_0xc12a('0x67')]){return _0x4ba298[_0xc12a('0xa6')][_0xc12a('0x9e')][_0xc12a('0x9f')][0x0];}var _0x24664a=_[_0xc12a('0x16')](_0x8000e7['body'],{'firstName':_0x8000e7[_0xc12a('0x59')]['from'],'ListId':_0x280e3e[_0xc12a('0x95')]});_0x24664a[_0x8000e7[_0xc12a('0x59')]['mapKey']]=_0x8000e7['body'][_0xc12a('0x96')];return db[_0xc12a('0x8e')]['create'](_0x24664a,{'fields':_0x5a09e3,'raw':!![]});}})[_0xc12a('0x20')](handleEntityNotFound(_0xccd3de,null))[_0xc12a('0x20')](function(_0x2b8a3b){_0x4ba298[_0xc12a('0xa7')]=_0x2b8a3b;if(_0x2b8a3b){var _0x485c68={'ContactId':_0x2b8a3b['id'],'ChatWebsiteId':_0x8000e7['params']['id'],'from':(_0x2b8a3b[_0xc12a('0xa8')]||'')+'\x20'+(_0x2b8a3b['lastName']||''),'customerIp':_0x8000e7[_0xc12a('0x59')]['customerIp'],'referer':_0x8000e7[_0xc12a('0x59')][_0xc12a('0xa9')],'browserName':_0x527773[_0xc12a('0xaa')][_0xc12a('0x37')]&&_0x527773[_0xc12a('0xaa')][_0xc12a('0xab')]?util[_0xc12a('0xac')](_0xc12a('0xad'),_0x527773[_0xc12a('0xaa')]['name'],_0x527773[_0xc12a('0xaa')][_0xc12a('0xab')]):'unknown','browserVersion':_0x527773[_0xc12a('0xaa')][_0xc12a('0xab')]||_0xc12a('0xae'),'osName':util[_0xc12a('0xac')](_0xc12a('0xad'),_0x527773['os'][_0xc12a('0x37')],_0x527773['os']['version']),'osVersion':_0x527773['os']['version'],'deviceModel':_0x527773['device'][_0xc12a('0x3a')]&&_0x527773['device']['vendor']?util['format']('%s\x20%s\x20%s',_0x527773['device']['model'],_0x527773[_0xc12a('0xaf')][_0xc12a('0xb0')],_0x527773[_0xc12a('0xaf')][_0xc12a('0x4c')]):null,'deviceVendor':_0x527773[_0xc12a('0xaf')]['vendor'],'deviceType':_0x527773[_0xc12a('0xaf')][_0xc12a('0x4c')],'formData':JSON[_0xc12a('0x26')](_0x8000e7['body'])};var _0x148dd2={'ChatWebsiteId':_0x8000e7['params']['id'],'closed':![]};if(_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb1')]){_0x148dd2[_0xc12a('0xb1')]=_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb1')];return db[_0xc12a('0xb2')][_0xc12a('0x56')]({'where':_0x148dd2})[_0xc12a('0x20')](function(_0x417123){if(_0x417123){return[_0x417123,![]];}_0x485c68[_0xc12a('0xb1')]=_0x8000e7['body'][_0xc12a('0xb1')];_0x485c68['externalUrl']=_0x8000e7[_0xc12a('0x59')]['externalUrl'];return db[_0xc12a('0xb2')][_0xc12a('0x58')](_0x485c68)[_0xc12a('0x20')](function(_0x12b2cf){return[_0x12b2cf,!![]];});});}_0x148dd2[_0xc12a('0xb3')]=_0x2b8a3b['id'];if(_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb4')]&&_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb4')]['id']){_0x148dd2['id']=_0x8000e7['body']['interaction']['id'];return db[_0xc12a('0xb2')][_0xc12a('0x56')]({'where':_0x148dd2})[_0xc12a('0x20')](function(_0xb2205c){if(_0xb2205c){return[_0xb2205c,![]];}return db['ChatInteraction'][_0xc12a('0x58')](_0x485c68)[_0xc12a('0x20')](function(_0x4e9755){return[_0x4e9755,!![]];});});}return db[_0xc12a('0xb2')][_0xc12a('0x58')](_0x485c68)[_0xc12a('0x20')](function(_0x43f6fa){return[_0x43f6fa,!![]];});}})[_0xc12a('0xb5')](function(_0x39e517,_0x26d5c4){if(_0x39e517){_0x39aa93=_0x26d5c4;if(!_0x26d5c4){var _0x4b0530={'from':(_0x4ba298[_0xc12a('0xa7')][_0xc12a('0xa8')]||'')+'\x20'+(_0x4ba298[_0xc12a('0xa7')]['lastName']||'')};if(_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb1')]&&_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb6')]&&_0x8000e7['body'][_0xc12a('0xb1')]!=_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb6')]){_0x4b0530[_0xc12a('0xb1')]=_0x8000e7[_0xc12a('0x59')][_0xc12a('0xb6')];}return _0x39e517[_0xc12a('0x31')](_0x4b0530);}else{return _0x39e517;}}})['then'](function(_0x335a4a){_0x4ba298[_0xc12a('0xb4')]=_0x335a4a[_0xc12a('0x33')]({'plain':!![]});_0x4ba298[_0xc12a('0xb4')][_0xc12a('0xb7')]=_0x39aa93;if(_0x4ba298[_0xc12a('0xb4')]['created']){if(_0x4ba298[_0xc12a('0xa6')][_0xc12a('0xb8')]){_0x4ba298[_0xc12a('0xa2')][_0xc12a('0xb9')]({'id':0x0,'priority':_0x4ba298[_0xc12a('0xa2')][_0xc12a('0x67')]+0x1,'app':_0xc12a('0xba'),'appdata':_0xc12a('0xbb'),'interval':'*,*,*,*'});}}return db[_0xc12a('0xbc')][_0xc12a('0x58')]({'body':_0x8000e7[_0xc12a('0x59')][_0xc12a('0x59')],'ChatWebsiteId':_0x8000e7[_0xc12a('0x52')]['id'],'ChatInteractionId':_0x335a4a['id'],'direction':'in','ContactId':_0x4ba298[_0xc12a('0xa7')]['id'],'AttachmentId':_0x8000e7['body'][_0xc12a('0xbd')]});})['then'](function(_0x1cf295){_0x4ba298[_0xc12a('0x29')]=_0x1cf295;if(_0x4ba298[_0xc12a('0xb4')][_0xc12a('0xbe')]){return db[_0xc12a('0xbf')][_0xc12a('0x56')]({'attributes':['id','name'],'where':{'id':_0x4ba298['interaction'][_0xc12a('0xbe')]}})[_0xc12a('0x20')](function(_0x9c26d9){if(_0x9c26d9){_0x4ba298[_0xc12a('0xa2')][_0xc12a('0xc0')]({'id':0x0,'priority':0x0,'app':_0xc12a('0xc1'),'appdata':_0x9c26d9[_0xc12a('0x37')]+','+(_0x4ba298['account'][_0xc12a('0xc2')]||0xa),'interval':_0xc12a('0xc3')});_0x4ba298[_0xc12a('0xc4')]=!![];}return respondWithRpcPromise(_0xc12a('0xc5'),_0xc12a('0xc6'),_0x4ba298);});}return respondWithRpcPromise(_0xc12a('0xc5'),_0xc12a('0xc6'),_0x4ba298);})[_0xc12a('0x20')](function(_0x3e502b){respondWithRpcPromise(_0xc12a('0xc7'),_0xc12a('0xc7'),{'event':'notify','message':_0x3e502b},client9002);return _0x3e502b;})[_0xc12a('0x20')](respondWithResult(_0xccd3de,null))[_0xc12a('0x57')](handleError(_0xccd3de,null));};exports['offline']=function(_0x43d0b1,_0x5d9793,_0x30ce31){var _0x398481,_0x4f9bce,_0x1652a1;var _0x7a13b6=[];var _0xa9256c=[];var _0x4c66e6={};return db[_0xc12a('0x8e')][_0xc12a('0x61')]()[_0xc12a('0x20')](function(_0xad93b5){if(!_0xad93b5){throw new db[(_0xc12a('0x8f'))][(_0xc12a('0x90'))]('no\x20available\x20attributes');}_0xa9256c=_[_0xc12a('0x93')](_[_0xc12a('0x3b')](_0xad93b5),[_0xc12a('0xc8'),_0xc12a('0x92')]);_0x7a13b6=_[_0xc12a('0x93')](_[_0xc12a('0x3b')](_0xad93b5),[_0xc12a('0xc8'),'updatedAt',_0xc12a('0x94'),_0xc12a('0x95')]);if(_0x43d0b1[_0xc12a('0x59')]['id']){delete _0x43d0b1['body']['id'];}if(_[_0xc12a('0x7a')](_0x43d0b1[_0xc12a('0x59')][_0xc12a('0x96')])){throw _0x5d9793['status'](0x1f4)[_0xc12a('0xc9')](new db[(_0xc12a('0x8f'))][(_0xc12a('0x90'))](_0xc12a('0x97')));}if(_['isNil'](_0x43d0b1[_0xc12a('0x59')][_0xc12a('0x59')])||_0x43d0b1['body'][_0xc12a('0x59')]===''){throw _0x5d9793[_0xc12a('0x2a')](0x1f4)[_0xc12a('0xc9')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xc12a('0x7a')](_0x43d0b1[_0xc12a('0x59')]['mapKeyOffline'])){throw _0x5d9793[_0xc12a('0x2a')](0x1f4)[_0xc12a('0xc9')](new db[(_0xc12a('0x8f'))]['ValidationError'](_0xc12a('0xca')+_0x7a13b6));}if(!_['includes'](_0x7a13b6,_0x43d0b1[_0xc12a('0x59')]['mapKeyOffline'])){throw _0x5d9793[_0xc12a('0x2a')](0x1f4)[_0xc12a('0xc9')](new db[(_0xc12a('0x8f'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7a13b6));}_0x4c66e6[_0x43d0b1[_0xc12a('0x59')]['mapKeyOffline']]=_0x43d0b1[_0xc12a('0x59')][_0xc12a('0x96')];})[_0xc12a('0x20')](function(){return db[_0xc12a('0x39')]['find']({'where':{'id':_0x43d0b1[_0xc12a('0x52')]['id']},'include':[{'model':db[_0xc12a('0x9d')],'as':_0xc12a('0x9e')}]});})[_0xc12a('0x20')](handleEntityNotFound(_0x5d9793,null))[_0xc12a('0x20')](function(_0x4b8664){if(_0x4b8664&&_0x4b8664[_0xc12a('0x9e')]){_0x4f9bce=_0x4b8664;var _0x28d95e=_['defaults'](_0x43d0b1[_0xc12a('0x59')],{'firstName':_0x43d0b1[_0xc12a('0x59')]['from'],'phone':_0x43d0b1['body'][_0xc12a('0x96')],'ListId':_0x4b8664[_0xc12a('0x95')]});_0x28d95e[_0x43d0b1[_0xc12a('0x59')][_0xc12a('0xcb')]]=_0x43d0b1[_0xc12a('0x59')][_0xc12a('0x96')];return db[_0xc12a('0x8e')][_0xc12a('0xcc')]({'where':_0x4c66e6,'defaults':_0x28d95e});}})['spread'](function(_0x2c2e45){if(_0x2c2e45){_0x1652a1=_0x2c2e45;var _0x5ca5c7=fs['readFileSync'](path[_0xc12a('0x77')](config[_0xc12a('0x7d')],'server/files/templates/chatOfflineMessage.ejs'),_0xc12a('0xcd'));var _0x7fb407=ejs[_0xc12a('0xce')](_0x5ca5c7,{'body':_[_0xc12a('0xcf')](_0x43d0b1[_0xc12a('0x59')][_0xc12a('0x59')]),'bodyTitle':_0x4f9bce['offlineMessageBody']});return db[_0xc12a('0xd0')][_0xc12a('0x58')]({'body':_0x7fb407,'ContactId':_0x2c2e45['id'],'ChatWebsiteId':_0x4f9bce['id']});}})[_0xc12a('0x20')](function(_0x5cfce0){if(_0x5cfce0){_0x398481=_0x5cfce0;return db[_0xc12a('0xd1')][_0xc12a('0x66')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xc12a('0xd2'),'raw':!![]}]});}})[_0xc12a('0x20')](function(_0x5090b1){if(_0x5090b1&&_0x5090b1['Smtp']&&_0x4f9bce[_0xc12a('0xd3')]){var _0x194612={'tls':{'rejectUnauthorized':![]}};if(_0x5090b1[_0xc12a('0xd2')][_0xc12a('0xd4')]){_0x194612['service']=_0x5090b1['Smtp'][_0xc12a('0xd4')];}else{_0x194612[_0xc12a('0xd5')]=_0x5090b1[_0xc12a('0xd2')][_0xc12a('0xd5')];_0x194612[_0xc12a('0xd6')]=_0x5090b1[_0xc12a('0xd2')][_0xc12a('0xd6')];_0x194612[_0xc12a('0xd7')]=_0x5090b1[_0xc12a('0xd2')][_0xc12a('0xd7')];}if(_0x5090b1[_0xc12a('0xd2')]['authentication']){_0x194612[_0xc12a('0xd8')]={'user':_0x5090b1[_0xc12a('0xd2')][_0xc12a('0x5a')],'pass':_0x5090b1[_0xc12a('0xd2')]['pass']};}return respondWithRpcPromise(_0xc12a('0xd9'),_0xc12a('0xda'),{'account':_0x194612,'message':{'from':util[_0xc12a('0xac')](_0xc12a('0xdb'),_0x5090b1[_0xc12a('0x37')],_0x5090b1[_0xc12a('0xdc')]||_0x5090b1['Smtp'][_0xc12a('0x5a')]),'to':_0x4f9bce[_0xc12a('0xd3')],'subject':_0x4f9bce[_0xc12a('0xdd')],'text':_0x398481[_0xc12a('0x59')]}},client9003)[_0xc12a('0x20')](function(){return _0x398481;})[_0xc12a('0x57')](function(_0x498f34){console[_0xc12a('0x27')](_0x498f34);});}})['then'](function(){if(_0x398481){return _0x398481;}})['then'](respondWithResult(_0x5d9793,null))['catch'](handleError(_0x5d9793,null));};exports['addInteraction']=function(_0x2aff62,_0x2d2ba8,_0x59dc35){return db[_0xc12a('0xb2')]['find']({'where':{'id':_0x2aff62['params']['id']}})['then'](handleEntityNotFound(_0x2d2ba8,null))[_0xc12a('0x20')](function(_0x5e31d6){if(_0x5e31d6){return _0x5e31d6['addInteraction'](_0x2aff62[_0xc12a('0x59')][_0xc12a('0x6b')],_['omit'](_0x2aff62[_0xc12a('0x59')],[_0xc12a('0x6b'),'id'])||{});}})[_0xc12a('0x20')](respondWithResult(_0x2d2ba8,null))[_0xc12a('0x57')](handleError(_0x2d2ba8,null));};exports['getInteractions']=function(_0x1a4a9c,_0x2f5fda,_0x3a5b46){var _0xaf007b={'raw':![],'where':{}};var _0x372642={};var _0x52f37f={'count':0x0,'rows':[]};return db[_0xc12a('0x39')][_0xc12a('0x66')]({'where':{'id':_0x1a4a9c['params']['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x2f5fda,null))[_0xc12a('0x20')](function(_0x2cf512){if(_0x2cf512){_0x372642[_0xc12a('0x3a')]=_[_0xc12a('0x3b')](db[_0xc12a('0xb2')][_0xc12a('0x53')]);_0x372642['query']=_[_0xc12a('0x3b')](_0x1a4a9c['query']);_0x372642[_0xc12a('0x54')]=_[_0xc12a('0x3f')](_0x372642[_0xc12a('0x3a')],_0x372642[_0xc12a('0x3c')]);_0xaf007b[_0xc12a('0x3e')]=_[_0xc12a('0x3f')](_0x372642[_0xc12a('0x3a')],qs[_0xc12a('0x40')](_0x1a4a9c['query'][_0xc12a('0x40')]));_0xaf007b[_0xc12a('0x3e')]=_0xaf007b['attributes'][_0xc12a('0x67')]?_0xaf007b['attributes']:_0x372642[_0xc12a('0x3a')];if(!_0x1a4a9c[_0xc12a('0x3c')][_0xc12a('0x41')](_0xc12a('0x42'))){_0xaf007b[_0xc12a('0x43')]=qs[_0xc12a('0x43')](_0x1a4a9c[_0xc12a('0x3c')]['limit']);_0xaf007b[_0xc12a('0x2c')]=qs[_0xc12a('0x2c')](_0x1a4a9c[_0xc12a('0x3c')][_0xc12a('0x2c')]);}_0xaf007b[_0xc12a('0x44')]=qs['sort'](_0x1a4a9c['query'][_0xc12a('0x68')]);_0xaf007b[_0xc12a('0x45')]=qs[_0xc12a('0x54')](_[_0xc12a('0x46')](_0x1a4a9c[_0xc12a('0x3c')],_0x372642[_0xc12a('0x54')]));_0xaf007b['where'][_0xc12a('0x63')]=_0x2cf512['id'];if(_0x1a4a9c[_0xc12a('0x3c')][_0xc12a('0x4a')]){_0xaf007b['where']=_[_0xc12a('0x69')](_0xaf007b[_0xc12a('0x45')],{'$or':_[_0xc12a('0x4b')](_0xaf007b['attributes'],function(_0x38a2ee){var _0xdd7964={};_0xdd7964[_0x38a2ee]={'$like':'%'+_0x1a4a9c[_0xc12a('0x3c')][_0xc12a('0x4a')]+'%'};return _0xdd7964;})});}_0xaf007b=_[_0xc12a('0x69')]({},_0xaf007b,_0x1a4a9c[_0xc12a('0x55')]);return db[_0xc12a('0xb2')][_0xc12a('0x2b')]({'where':_0xaf007b[_0xc12a('0x45')]})[_0xc12a('0x20')](function(_0x39554b){_0x52f37f[_0xc12a('0x2b')]=_0x39554b;if(_0x1a4a9c[_0xc12a('0x3c')][_0xc12a('0x4e')]){_0xaf007b[_0xc12a('0x4f')]=[{'model':db[_0xc12a('0x8e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xc12a('0xde'),'attributes':['name',_0xc12a('0xdf'),_0xc12a('0xe0')],'required':![]},{'model':db[_0xc12a('0xe1')],'as':_0xc12a('0xe2'),'attributes':['id',_0xc12a('0x37'),_0xc12a('0xe3')],'where':_0x1a4a9c[_0xc12a('0x3c')][_0xc12a('0xe4')]?{'id':_0x1a4a9c['query'][_0xc12a('0xe4')]}:undefined,'required':_0x1a4a9c['query']['tag']?!![]:![]}];}return db[_0xc12a('0xb2')][_0xc12a('0x50')](_0xaf007b);})[_0xc12a('0x20')](function(_0x596ac8){_0x52f37f[_0xc12a('0x51')]=_0x596ac8;return _0x52f37f;});}})[_0xc12a('0x20')](respondWithFilteredResult(_0x2f5fda,_0xaf007b))[_0xc12a('0x57')](handleError(_0x2f5fda,null));};function iftimePromise(_0x27c9c6,_0x234407){return respondWithRpcPromise(_0xc12a('0xe5'),_0xc12a('0xe6'),{'command':_0x234407[_0xc12a('0xe7')]?util[_0xc12a('0xac')](_0xc12a('0xe8'),_0x27c9c6[_0xc12a('0xe9')],_0x234407[_0xc12a('0xe7')]):util[_0xc12a('0xac')](_0xc12a('0xea'),_0x27c9c6[_0xc12a('0xe9')])},client9002)[_0xc12a('0x20')](function(_0x2a4923){var _0x4fd3ec=_0x2a4923&&_0x2a4923[_0xc12a('0xeb')]('true')>=0x0?!![]:![];logger['info'](_0xc12a('0xec'),_0x234407['id'],_0x27c9c6['id'],_0x27c9c6[_0xc12a('0xe9')],_0x4fd3ec?_0xc12a('0xed'):'OFFLINE',_0x234407[_0xc12a('0xe7')]?_0x234407['timezone']:_0xc12a('0xee'));return _0x4fd3ec;})[_0xc12a('0x57')](function(_0x3afb67){logger[_0xc12a('0x27')](_0xc12a('0xec'),_0x234407['id'],_0x27c9c6['id'],_0x27c9c6[_0xc12a('0xe9')],util[_0xc12a('0xef')](_0x3afb67,{'showHidden':![],'depth':null}),_0x234407[_0xc12a('0xe7')]?_0x234407['timezone']:_0xc12a('0xee'));return![];});}exports[_0xc12a('0xe6')]=function(_0x1784d6,_0x448bd0,_0x9ab508){var _0x174c8e=0x0;var _0x89d19f=0x0;var _0x17e706=![];var _0xdeded7;var _0x2d10c2;return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x1784d6[_0xc12a('0x52')]['id']},'include':[{'model':db['Interval'],'as':_0xc12a('0xf0'),'include':[{'model':db[_0xc12a('0xf0')],'as':'Intervals','attributes':['id',_0xc12a('0xe9')],'raw':!![]}]}]})[_0xc12a('0x20')](handleEntityNotFound(_0x448bd0,null))[_0xc12a('0x20')](function(_0x1457af){if(_0x1457af){_0xdeded7=_0x1457af;return _0x1457af[_0xc12a('0xf1')]({'raw':!![]});}})[_0xc12a('0x20')](function(_0x3bf0df){if(_0xdeded7){if(_0x3bf0df){_0x2d10c2=_0x3bf0df;}}return require(_0xc12a('0x79'))[_0xc12a('0xf2')]();})['then'](function(_0x59953d){if(_0x59953d){_0x89d19f=_0x59953d[_0xc12a('0xf3')];_0x17e706=_0x59953d[_0xc12a('0xf4')];}})[_0xc12a('0x20')](function(){return db[_0xc12a('0xb2')][_0xc12a('0x2b')]({'where':{'closed':![]}});})[_0xc12a('0x20')](function(_0x5a8378){_0x174c8e=_0x5a8378;if(_0x89d19f&&_0x5a8378>_0x89d19f){return db[_0xc12a('0xf5')][_0xc12a('0x66')]({'where':{'id':0x1}})[_0xc12a('0x20')](function(_0x40ff73){if(_0x40ff73){_0x40ff73[_0xc12a('0xf6')](_0xc12a('0xf7'));}});}})[_0xc12a('0x20')](function(){if(_0xdeded7['Interval']&&_0xdeded7[_0xc12a('0xf0')][_0xc12a('0xf8')]){var _0x412cc8=[];for(var _0x4aeedc=0x0;_0x4aeedc<_0xdeded7[_0xc12a('0xf0')][_0xc12a('0xf8')][_0xc12a('0x67')];_0x4aeedc++){var _0x54afac=_0xdeded7['Interval'][_0xc12a('0xf8')][_0x4aeedc][_0xc12a('0x33')]({'plain':!![]});_0x412cc8['push'](iftimePromise(_0x54afac,_0xdeded7));}return BPromise['all'](_0x412cc8)[_0xc12a('0x20')](function(_0xf7f4cb){return _['some'](_0xf7f4cb);});}else{return!![];}})[_0xc12a('0x20')](function(_0x18e0a3){var _0x5bc9cf=fs[_0xc12a('0xf9')](path['join'](config[_0xc12a('0x7d')],_0xc12a('0xfa')),_0xc12a('0xcd'));var _0x478fb1={'remote':_0xdeded7[_0xc12a('0xfb')],'query':querystring[_0xc12a('0x26')](_['merge'](_0xdeded7[_0xc12a('0x33')]({'plain':!![]}),{'customerIp':_0x1784d6[_0xc12a('0x8a')]['x-forwarded-for']||_0x1784d6[_0xc12a('0x8a')][_0xc12a('0xfc')]||_0x1784d6['connection']['remoteAddress']||_0x1784d6['ip'],'referer':_0x1784d6[_0xc12a('0x8a')][_0xc12a('0xa9')],'openedInteractions':_0x174c8e,'maxInteractions':_0x89d19f,'virtual':_0x17e706[_0xc12a('0xf3')],'online':_0x18e0a3,'custom':_0x17e706}))['replace'](/'/g,'\x5c\x27')};_0x448bd0[_0xc12a('0xc9')](ejs[_0xc12a('0xce')](Mustache[_0xc12a('0xce')](_0x5bc9cf,_0x478fb1),{'proactiveActions':_0x2d10c2,'alignment':_0xdeded7[_0xc12a('0xfd')],'verticalAlignment':_0xdeded7[_0xc12a('0xfe')]}));})[_0xc12a('0x57')](handleError(_0x448bd0,null));};exports['addApplications']=function(_0x4c77b4,_0x419c08,_0x5ab426){return db['ChatWebsite'][_0xc12a('0x66')]({'where':{'id':_0x4c77b4[_0xc12a('0x52')]['id']}})['then'](handleEntityNotFound(_0x419c08,null))[_0xc12a('0x20')](function(_0x20c245){if(_0x20c245){return db[_0xc12a('0xff')][_0xc12a('0x100')](function(_0x3bb772){return db['ChatApplication'][_0xc12a('0x32')]({'where':{'ChatWebsiteId':_0x4c77b4[_0xc12a('0x52')]['id']},'transaction':_0x3bb772})[_0xc12a('0x20')](function(_0x3f2e12){var _0x23a6ce=_[_0xc12a('0x4b')](_0x4c77b4[_0xc12a('0x59')],function(_0x406d3a){_0x406d3a['ChatWebsiteId']=_0x4c77b4[_0xc12a('0x52')]['id'];return _0x406d3a;});return db['ChatApplication']['bulkCreate'](_0x23a6ce,{'transaction':_0x3bb772});});})[_0xc12a('0x20')](function(){return db[_0xc12a('0xa1')][_0xc12a('0x101')]({'where':{'ChatWebsiteId':_0x4c77b4[_0xc12a('0x52')]['id']},'order':_0xc12a('0x102')});});}})[_0xc12a('0x20')](respondWithResult(_0x419c08,null))['catch'](handleError(_0x419c08,null));};exports[_0xc12a('0x103')]=function(_0x145e85,_0x321f5d,_0x336143){var _0x1e3018={};var _0x6c0db1={};var _0x5b6ebf;var _0x3dfbaf;return db[_0xc12a('0x39')][_0xc12a('0x66')]({'where':{'id':_0x145e85[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x321f5d,null))['then'](function(_0x5a97c0){if(_0x5a97c0){_0x5b6ebf=_0x5a97c0;_0x6c0db1[_0xc12a('0x3a')]=_[_0xc12a('0x3b')](db[_0xc12a('0xa1')][_0xc12a('0x53')]);_0x6c0db1[_0xc12a('0x3c')]=_[_0xc12a('0x3b')](_0x145e85['query']);_0x6c0db1[_0xc12a('0x54')]=_[_0xc12a('0x3f')](_0x6c0db1[_0xc12a('0x3a')],_0x6c0db1['query']);_0x1e3018[_0xc12a('0x3e')]=_['intersection'](_0x6c0db1[_0xc12a('0x3a')],qs['fields'](_0x145e85[_0xc12a('0x3c')][_0xc12a('0x40')]));_0x1e3018[_0xc12a('0x3e')]=_0x1e3018[_0xc12a('0x3e')][_0xc12a('0x67')]?_0x1e3018[_0xc12a('0x3e')]:_0x6c0db1[_0xc12a('0x3a')];_0x1e3018[_0xc12a('0x44')]=qs[_0xc12a('0x68')](_0x145e85['query']['sort']);_0x1e3018[_0xc12a('0x45')]=qs['filters'](_[_0xc12a('0x46')](_0x145e85[_0xc12a('0x3c')],_0x6c0db1[_0xc12a('0x54')]));if(_0x145e85['query'][_0xc12a('0x4a')]){_0x1e3018[_0xc12a('0x45')]=_[_0xc12a('0x69')](_0x1e3018['where'],{'$or':_['map'](_0x1e3018[_0xc12a('0x3e')],function(_0x37d80d){var _0x28b99c={};_0x28b99c[_0x37d80d]={'$like':'%'+_0x145e85[_0xc12a('0x3c')][_0xc12a('0x4a')]+'%'};return _0x28b99c;})});}_0x1e3018=_[_0xc12a('0x69')]({},_0x1e3018,_0x145e85[_0xc12a('0x55')]);return _0x5b6ebf[_0xc12a('0x103')](_0x1e3018);}})[_0xc12a('0x20')](function(_0x5ca530){if(_0x5ca530){_0x3dfbaf=_0x5ca530[_0xc12a('0x67')];if(!_0x145e85[_0xc12a('0x3c')][_0xc12a('0x41')](_0xc12a('0x42'))){_0x1e3018['limit']=qs[_0xc12a('0x43')](_0x145e85[_0xc12a('0x3c')][_0xc12a('0x43')]);_0x1e3018[_0xc12a('0x2c')]=qs['offset'](_0x145e85[_0xc12a('0x3c')]['offset']);}return _0x5b6ebf[_0xc12a('0x103')](_0x1e3018);}})[_0xc12a('0x20')](function(_0x3e65bf){if(_0x3e65bf){return _0x3e65bf?{'count':_0x3dfbaf,'rows':_0x3e65bf}:null;}})['then'](respondWithResult(_0x321f5d,null))[_0xc12a('0x57')](handleError(_0x321f5d,null));};exports['addProactiveActions']=function(_0x16f6a3,_0x377908,_0x2fb062){return db['chatProactiveAction'][_0xc12a('0x56')]({'where':{'id':_0x16f6a3[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x377908,null))[_0xc12a('0x20')](function(_0x36e983){if(_0x36e983){return _0x36e983[_0xc12a('0x104')](_0x16f6a3[_0xc12a('0x59')][_0xc12a('0x6b')],_[_0xc12a('0x105')](_0x16f6a3[_0xc12a('0x59')],[_0xc12a('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x377908,null))[_0xc12a('0x57')](handleError(_0x377908,null));};exports[_0xc12a('0xf1')]=function(_0x5c8daa,_0x19dc6c,_0x1e3a8e){var _0x36765e={};var _0x483b00={};var _0x32d031;var _0x5bed87;return db['ChatWebsite'][_0xc12a('0x66')]({'where':{'id':_0x5c8daa[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x19dc6c,null))[_0xc12a('0x20')](function(_0x512ebf){if(_0x512ebf){_0x32d031=_0x512ebf;_0x483b00[_0xc12a('0x3a')]=_['keys'](db['ChatProactiveAction'][_0xc12a('0x53')]);_0x483b00[_0xc12a('0x3c')]=_[_0xc12a('0x3b')](_0x5c8daa[_0xc12a('0x3c')]);_0x483b00[_0xc12a('0x54')]=_[_0xc12a('0x3f')](_0x483b00[_0xc12a('0x3a')],_0x483b00[_0xc12a('0x3c')]);_0x36765e[_0xc12a('0x3e')]=_[_0xc12a('0x3f')](_0x483b00[_0xc12a('0x3a')],qs[_0xc12a('0x40')](_0x5c8daa[_0xc12a('0x3c')]['fields']));_0x36765e[_0xc12a('0x3e')]=_0x36765e[_0xc12a('0x3e')][_0xc12a('0x67')]?_0x36765e['attributes']:_0x483b00[_0xc12a('0x3a')];_0x36765e[_0xc12a('0x44')]=qs[_0xc12a('0x68')](_0x5c8daa['query'][_0xc12a('0x68')]);_0x36765e[_0xc12a('0x45')]=qs[_0xc12a('0x54')](_['pick'](_0x5c8daa[_0xc12a('0x3c')],_0x483b00[_0xc12a('0x54')]));if(_0x5c8daa[_0xc12a('0x3c')][_0xc12a('0x4a')]){_0x36765e[_0xc12a('0x45')]=_[_0xc12a('0x69')](_0x36765e['where'],{'$or':_[_0xc12a('0x4b')](_0x36765e[_0xc12a('0x3e')],function(_0xf61a08){var _0x1ba213={};_0x1ba213[_0xf61a08]={'$like':'%'+_0x5c8daa[_0xc12a('0x3c')][_0xc12a('0x4a')]+'%'};return _0x1ba213;})});}_0x36765e=_[_0xc12a('0x69')]({},_0x36765e,_0x5c8daa['options']);return _0x32d031[_0xc12a('0xf1')](_0x36765e);}})[_0xc12a('0x20')](function(_0x4a9907){if(_0x4a9907){_0x5bed87=_0x4a9907[_0xc12a('0x67')];if(!_0x5c8daa[_0xc12a('0x3c')]['hasOwnProperty']('nolimit')){_0x36765e['limit']=qs[_0xc12a('0x43')](_0x5c8daa['query'][_0xc12a('0x43')]);_0x36765e[_0xc12a('0x2c')]=qs[_0xc12a('0x2c')](_0x5c8daa[_0xc12a('0x3c')][_0xc12a('0x2c')]);}return _0x32d031[_0xc12a('0xf1')](_0x36765e);}})['then'](function(_0x553f56){if(_0x553f56){return _0x553f56?{'count':_0x5bed87,'rows':_0x553f56}:null;}})[_0xc12a('0x20')](respondWithResult(_0x19dc6c,null))[_0xc12a('0x57')](handleError(_0x19dc6c,null));};exports[_0xc12a('0x106')]=function(_0x5557b9,_0x3306ec,_0x36773c){var _0x4638c0=_0x5557b9[_0xc12a('0x3c')][_0xc12a('0x107')]===_0xc12a('0x108')?_0xc12a('0x109'):_0xc12a('0x10a');return db[_0xc12a('0x39')][_0xc12a('0x56')]({'attributes':['id',_0x4638c0],'where':{'id':_0x5557b9[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x3306ec,null))[_0xc12a('0x20')](function(_0x55327b){if(_0x55327b){var _0x57117b=_0x55327b[_0x4638c0];var _0x5b2330=_0x57117b&&_0x57117b[_0xc12a('0x10b')]?_0x57117b[_0xc12a('0x10b')]:[];_0x3306ec[_0xc12a('0xc9')]({'fromKey':_[_0xc12a('0x7a')](_0x57117b[_0xc12a('0x10c')])?undefined:_0x57117b['fromKey'],'count':_0x5b2330[_0xc12a('0x67')],'rows':_0x5b2330});}})[_0xc12a('0x57')](handleError(_0x3306ec,null));};exports[_0xc12a('0x10d')]=function(_0x13802c,_0x12286d,_0x29f95f){var _0x51cf8b={'raw':!![],'where':{}};var _0x309da7={};var _0x2e33b4={'count':0x0,'rows':[]};return db[_0xc12a('0x39')][_0xc12a('0x66')]({'where':{'id':_0x13802c[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x12286d,null))[_0xc12a('0x20')](function(_0x3313ed){if(_0x3313ed){_0x309da7['model']=_['keys'](db['ChatOfflineMessage'][_0xc12a('0x53')]);_0x309da7['query']=_['keys'](_0x13802c[_0xc12a('0x3c')]);_0x309da7[_0xc12a('0x54')]=_[_0xc12a('0x3f')](_0x309da7[_0xc12a('0x3a')],_0x309da7[_0xc12a('0x3c')]);_0x51cf8b[_0xc12a('0x3e')]=_['intersection'](_0x309da7[_0xc12a('0x3a')],qs[_0xc12a('0x40')](_0x13802c[_0xc12a('0x3c')][_0xc12a('0x40')]));_0x51cf8b[_0xc12a('0x3e')]=_0x51cf8b['attributes']['length']?_0x51cf8b['attributes']:_0x309da7[_0xc12a('0x3a')];if(!_0x13802c[_0xc12a('0x3c')][_0xc12a('0x41')](_0xc12a('0x42'))){_0x51cf8b[_0xc12a('0x43')]=qs[_0xc12a('0x43')](_0x13802c[_0xc12a('0x3c')][_0xc12a('0x43')]);_0x51cf8b['offset']=qs[_0xc12a('0x2c')](_0x13802c[_0xc12a('0x3c')][_0xc12a('0x2c')]);}_0x51cf8b[_0xc12a('0x44')]=qs[_0xc12a('0x68')](_0x13802c[_0xc12a('0x3c')][_0xc12a('0x68')]);_0x51cf8b[_0xc12a('0x45')]=qs['filters'](_[_0xc12a('0x46')](_0x13802c[_0xc12a('0x3c')],_0x309da7[_0xc12a('0x54')]));_0x51cf8b[_0xc12a('0x45')][_0xc12a('0x63')]=_0x3313ed['id'];if(_0x13802c['query'][_0xc12a('0x4a')]){_0x51cf8b['where']=_[_0xc12a('0x69')](_0x51cf8b[_0xc12a('0x45')],{'$or':_['map'](_0x51cf8b[_0xc12a('0x3e')],function(_0x3bd0ca){var _0x3f84d9={};_0x3f84d9[_0x3bd0ca]={'$like':'%'+_0x13802c[_0xc12a('0x3c')][_0xc12a('0x4a')]+'%'};return _0x3f84d9;})});}_0x51cf8b=_[_0xc12a('0x69')]({},_0x51cf8b,_0x13802c[_0xc12a('0x55')]);return db[_0xc12a('0xd0')][_0xc12a('0x2b')]({'where':_0x51cf8b['where']})[_0xc12a('0x20')](function(_0x24e703){_0x2e33b4['count']=_0x24e703;if(_0x13802c[_0xc12a('0x3c')][_0xc12a('0x4e')]){_0x51cf8b[_0xc12a('0x4f')]=[{'all':!![]}];}return db[_0xc12a('0xd0')][_0xc12a('0x50')](_0x51cf8b);})['then'](function(_0x311d9f){_0x2e33b4[_0xc12a('0x51')]=_0x311d9f;return _0x2e33b4;});}})[_0xc12a('0x20')](respondWithFilteredResult(_0x12286d,_0x51cf8b))[_0xc12a('0x57')](handleError(_0x12286d,null));};exports[_0xc12a('0x10e')]=function(_0x1d9dcf,_0x575970,_0x2a1ed7){return db[_0xc12a('0x39')]['find']({'where':{'id':_0x1d9dcf[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x575970,null))['then'](function(_0x44f6e1){if(_0x44f6e1){return _0x44f6e1['addAgents'](_0x1d9dcf[_0xc12a('0x59')][_0xc12a('0x6b')],_[_0xc12a('0x105')](_0x1d9dcf['body'],[_0xc12a('0x6b'),'id'])||{})[_0xc12a('0xb5')](function(_0x308245){for(var _0x172bf1=0x0;_0x172bf1<_0x1d9dcf[_0xc12a('0x59')]['ids'][_0xc12a('0x67')];_0x172bf1+=0x1){socket[_0xc12a('0x10f')]('userChatWebsite:save',{'UserId':_0x1d9dcf[_0xc12a('0x59')]['ids'][_0x172bf1],'ChatWebsiteId':_0x1d9dcf[_0xc12a('0x52')]['id']});}return _0x308245;});}})[_0xc12a('0x20')](respondWithResult(_0x575970,null))[_0xc12a('0x57')](handleError(_0x575970,null));};exports[_0xc12a('0x110')]=function(_0x5c6cd1,_0x6c09b4,_0x2dbabb){var _0x1777a9;return db[_0xc12a('0x39')][_0xc12a('0x56')]({'where':{'id':_0x5c6cd1[_0xc12a('0x52')]['id']}})['then'](handleEntityNotFound(_0x6c09b4,null))[_0xc12a('0x20')](function(_0xd185f6){if(_0xd185f6){return _0xd185f6[_0xc12a('0x110')](_0x5c6cd1[_0xc12a('0x3c')]['ids'])[_0xc12a('0x20')](function(_0xf01d96){if(_['isArray'](_0x5c6cd1[_0xc12a('0x3c')]['ids'])){for(var _0x3a49a0=0x0;_0x3a49a0<_0x5c6cd1[_0xc12a('0x3c')][_0xc12a('0x6b')][_0xc12a('0x67')];_0x3a49a0+=0x1){socket[_0xc12a('0x10f')](_0xc12a('0x111'),{'UserId':_0x5c6cd1['query']['ids'][_0x3a49a0],'ChatWebsiteId':_0x5c6cd1['params']['id']});}}else{socket[_0xc12a('0x10f')](_0xc12a('0x111'),{'UserId':_0x5c6cd1[_0xc12a('0x3c')][_0xc12a('0x6b')],'ChatWebsiteId':_0x5c6cd1[_0xc12a('0x52')]['id']});}});}})['then'](respondWithStatusCode(_0x6c09b4,null))[_0xc12a('0x57')](handleError(_0x6c09b4,null));};exports[_0xc12a('0x112')]=function(_0xd187be,_0x4dc864,_0x2442ec){var _0x5b72de={};var _0x5a3dcd={};var _0x27e7ea;var _0x2ee036;return db[_0xc12a('0x39')][_0xc12a('0x66')]({'where':{'id':_0xd187be[_0xc12a('0x52')]['id']}})[_0xc12a('0x20')](handleEntityNotFound(_0x4dc864,null))[_0xc12a('0x20')](function(_0x2a9ce0){if(_0x2a9ce0){_0x27e7ea=_0x2a9ce0;_0x5a3dcd[_0xc12a('0x3a')]=_[_0xc12a('0x3b')](db[_0xc12a('0xbf')][_0xc12a('0x53')]);_0x5a3dcd['query']=_[_0xc12a('0x3b')](_0xd187be[_0xc12a('0x3c')]);_0x5a3dcd[_0xc12a('0x54')]=_[_0xc12a('0x3f')](_0x5a3dcd[_0xc12a('0x3a')],_0x5a3dcd[_0xc12a('0x3c')]);_0x5b72de['attributes']=_[_0xc12a('0x3f')](_0x5a3dcd[_0xc12a('0x3a')],qs[_0xc12a('0x40')](_0xd187be[_0xc12a('0x3c')][_0xc12a('0x40')]));_0x5b72de[_0xc12a('0x3e')]=_0x5b72de[_0xc12a('0x3e')]['length']?_0x5b72de[_0xc12a('0x3e')]:_0x5a3dcd['model'];_0x5b72de[_0xc12a('0x44')]=qs[_0xc12a('0x68')](_0xd187be[_0xc12a('0x3c')][_0xc12a('0x68')]);_0x5b72de[_0xc12a('0x45')]=qs[_0xc12a('0x54')](_[_0xc12a('0x46')](_0xd187be['query'],_0x5a3dcd[_0xc12a('0x54')]));if(_0xd187be[_0xc12a('0x3c')][_0xc12a('0x4a')]){_0x5b72de[_0xc12a('0x45')]=_['merge'](_0x5b72de[_0xc12a('0x45')],{'$or':_[_0xc12a('0x4b')](_0x5b72de['attributes'],function(_0x282b2e){var _0x51833c={};_0x51833c[_0x282b2e]={'$like':'%'+_0xd187be[_0xc12a('0x3c')][_0xc12a('0x4a')]+'%'};return _0x51833c;})});}_0x5b72de=_[_0xc12a('0x69')]({},_0x5b72de,_0xd187be['options']);return _0x27e7ea[_0xc12a('0x112')](_0x5b72de);}})[_0xc12a('0x20')](function(_0x118512){if(_0x118512){_0x2ee036=_0x118512[_0xc12a('0x67')];if(!_0xd187be[_0xc12a('0x3c')]['hasOwnProperty']('nolimit')){_0x5b72de['limit']=qs['limit'](_0xd187be[_0xc12a('0x3c')]['limit']);_0x5b72de[_0xc12a('0x2c')]=qs[_0xc12a('0x2c')](_0xd187be[_0xc12a('0x3c')][_0xc12a('0x2c')]);}return _0x27e7ea['getAgents'](_0x5b72de);}})[_0xc12a('0x20')](function(_0x11ef96){if(_0x11ef96){return _0x11ef96?{'count':_0x2ee036,'rows':_0x11ef96}:null;}})[_0xc12a('0x20')](respondWithResult(_0x4dc864,null))['catch'](handleError(_0x4dc864,null));};
\ No newline at end of file
index 6737c13..1e22724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72bd=['ChatWebsite','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x520331,_0x7820e8){var _0x52cd33=function(_0x17bdc9){while(--_0x17bdc9){_0x520331['push'](_0x520331['shift']());}};_0x52cd33(++_0x7820e8);}(_0x72bd,0xcf));var _0xd72b=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x72bd[_0x5d4607];return _0x5e4a86;};'use strict';var EventEmitter=require(_0xd72b('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xd72b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd72b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd72b('0x3')};function emitEvent(_0x4a85d8){return function(_0x2f0211,_0x3cd5c2,_0x265f26){ChatWebsiteEvents['emit'](_0x4a85d8+':'+_0x2f0211['id'],_0x2f0211);ChatWebsiteEvents[_0xd72b('0x4')](_0x4a85d8,_0x2f0211);_0x265f26(null);};}for(var e in events){if(events[_0xd72b('0x5')](e)){var event=events[e];ChatWebsite[_0xd72b('0x6')](e,emitEvent(event));}}module[_0xd72b('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6c32=['remove','emit','hasOwnProperty','hook','exports','events','ChatWebsite','save'];(function(_0x24c621,_0x32480c){var _0x4046ff=function(_0x2f6ccf){while(--_0x2f6ccf){_0x24c621['push'](_0x24c621['shift']());}};_0x4046ff(++_0x32480c);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x26c3('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x26c3('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26c3('0x2'),'afterUpdate':'update','afterDestroy':_0x26c3('0x3')};function emitEvent(_0x2c29dc){return function(_0x5e8a24,_0x4c2de2,_0x16867a){ChatWebsiteEvents[_0x26c3('0x4')](_0x2c29dc+':'+_0x5e8a24['id'],_0x5e8a24);ChatWebsiteEvents[_0x26c3('0x4')](_0x2c29dc,_0x5e8a24);_0x16867a(null);};}for(var e in events){if(events[_0x26c3('0x5')](e)){var event=events[e];ChatWebsite[_0x26c3('0x6')](e,emitEvent(event));}}module[_0x26c3('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
index a38e252..67c3383 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','moment','bluebird','request-promise'];(function(_0x425795,_0x51fd78){var _0x41753d=function(_0x54be62){while(--_0x54be62){_0x425795['push'](_0x425795['shift']());}};_0x41753d(++_0x51fd78);}(_0x750a,0x140));var _0xa750=function(_0x3e18ab,_0x9e7075){_0x3e18ab=_0x3e18ab-0x0;var _0x33ff3d=_0x750a[_0x3e18ab];return _0x33ff3d;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var rp=require(_0xa750('0x3'));var attributes=require(_0xa750('0x4'));module[_0xa750('0x5')]=function(_0x43d704,_0x562911){return _0x43d704[_0xa750('0x6')](_0xa750('0x7'),attributes,{'tableName':_0xa750('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e35=['moment','bluebird','request-promise','./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','api'];(function(_0x29b856,_0x16ae8a){var _0x4e37d4=function(_0x3140eb){while(--_0x3140eb){_0x29b856['push'](_0x29b856['shift']());}};_0x4e37d4(++_0x16ae8a);}(_0x0e35,0xc2));var _0x50e3=function(_0x55ea30,_0x1d27c2){_0x55ea30=_0x55ea30-0x0;var _0x525a29=_0x0e35[_0x55ea30];return _0x525a29;};'use strict';var _=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var logger=require(_0x50e3('0x2'))(_0x50e3('0x3'));var moment=require(_0x50e3('0x4'));var BPromise=require(_0x50e3('0x5'));var rp=require(_0x50e3('0x6'));var attributes=require(_0x50e3('0x7'));module[_0x50e3('0x8')]=function(_0x344554,_0x5a6200){return _0x344554[_0x50e3('0x9')](_0x50e3('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9dc632b..25dab28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea4c=['socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3b4a81,_0x2400b7){var _0x13fd35=function(_0x561fb2){while(--_0x561fb2){_0x3b4a81['push'](_0x3b4a81['shift']());}};_0x13fd35(++_0x2400b7);}(_0xea4c,0x13b));var _0xcea4=function(_0x472baf,_0x14643f){_0x472baf=_0x472baf-0x0;var _0x5e1a2c=_0xea4c[_0x472baf];return _0x5e1a2c;};'use strict';var _=require(_0xcea4('0x0'));var util=require('util');var moment=require(_0xcea4('0x1'));var BPromise=require(_0xcea4('0x2'));var rs=require(_0xcea4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcea4('0x4'))['db'];var utils=require(_0xcea4('0x5'));var logger=require(_0xcea4('0x6'))(_0xcea4('0x7'));var config=require(_0xcea4('0x8'));var jayson=require(_0xcea4('0x9'));var client=jayson[_0xcea4('0xa')][_0xcea4('0xb')]({'port':0x232a});config[_0xcea4('0xc')]=_[_0xcea4('0xd')](config['redis'],{'host':_0xcea4('0xe'),'port':0x18eb});var socket=require(_0xcea4('0xf'))(new Redis(config[_0xcea4('0xc')]));require('./chatWebsite.socket')[_0xcea4('0x10')](socket);function respondWithRpcPromise(_0x9a2da6,_0x1215f6,_0x3186da){return new BPromise(function(_0x356475,_0x173081){return client[_0xcea4('0x11')](_0x9a2da6,_0x3186da)[_0xcea4('0x12')](function(_0x14688f){logger[_0xcea4('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1215f6,_0xcea4('0x14'));logger[_0xcea4('0x15')](_0xcea4('0x16'),_0x1215f6,_0xcea4('0x14'),JSON[_0xcea4('0x17')](_0x14688f));if(_0x14688f['error']){if(_0x14688f[_0xcea4('0x18')][_0xcea4('0x19')]===0x1f4){logger[_0xcea4('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x1215f6,_0x14688f[_0xcea4('0x18')]['message']);return _0x173081(_0x14688f[_0xcea4('0x18')][_0xcea4('0x1a')]);}logger[_0xcea4('0x18')](_0xcea4('0x1b'),_0x1215f6,_0x14688f[_0xcea4('0x18')][_0xcea4('0x1a')]);return _0x356475(_0x14688f[_0xcea4('0x18')]['message']);}else{logger[_0xcea4('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1215f6,_0xcea4('0x14'));_0x356475(_0x14688f[_0xcea4('0x1c')][_0xcea4('0x1a')]);}})[_0xcea4('0x1d')](function(_0x3e7536){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1215f6,_0x3e7536);_0x173081(_0x3e7536);});});}
\ No newline at end of file
+var _0x39c4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','util','randomstring','ioredis'];(function(_0xc2444b,_0x11aca4){var _0x2b935e=function(_0x180fc4){while(--_0x180fc4){_0xc2444b['push'](_0xc2444b['shift']());}};_0x2b935e(++_0x11aca4);}(_0x39c4,0x174));var _0x439c=function(_0x1e079a,_0x2f1536){_0x1e079a=_0x1e079a-0x0;var _0x7b0f74=_0x39c4[_0x1e079a];return _0x7b0f74;};'use strict';var _=require('lodash');var util=require(_0x439c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x439c('0x1'));var fs=require('fs');var Redis=require(_0x439c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x439c('0x3'))(_0x439c('0x4'));var config=require(_0x439c('0x5'));var jayson=require(_0x439c('0x6'));var client=jayson[_0x439c('0x7')][_0x439c('0x8')]({'port':0x232a});config[_0x439c('0x9')]=_[_0x439c('0xa')](config[_0x439c('0x9')],{'host':_0x439c('0xb'),'port':0x18eb});var socket=require(_0x439c('0xc'))(new Redis(config[_0x439c('0x9')]));require(_0x439c('0xd'))[_0x439c('0xe')](socket);function respondWithRpcPromise(_0x237e38,_0x4c0ff4,_0x1a0c8d){return new BPromise(function(_0x1c89d8,_0x336c6d){return client[_0x439c('0xf')](_0x237e38,_0x1a0c8d)[_0x439c('0x10')](function(_0x283256){logger[_0x439c('0x11')](_0x439c('0x12'),_0x4c0ff4,_0x439c('0x13'));logger[_0x439c('0x14')](_0x439c('0x15'),_0x4c0ff4,_0x439c('0x13'),JSON['stringify'](_0x283256));if(_0x283256[_0x439c('0x16')]){if(_0x283256['error']['code']===0x1f4){logger[_0x439c('0x16')](_0x439c('0x12'),_0x4c0ff4,_0x283256[_0x439c('0x16')][_0x439c('0x17')]);return _0x336c6d(_0x283256[_0x439c('0x16')]['message']);}logger['error'](_0x439c('0x12'),_0x4c0ff4,_0x283256['error'][_0x439c('0x17')]);return _0x1c89d8(_0x283256[_0x439c('0x16')][_0x439c('0x17')]);}else{logger['info'](_0x439c('0x12'),_0x4c0ff4,_0x439c('0x13'));_0x1c89d8(_0x283256[_0x439c('0x18')][_0x439c('0x17')]);}})['catch'](function(_0x4184d6){logger[_0x439c('0x16')](_0x439c('0x12'),_0x4c0ff4,_0x4184d6);_0x336c6d(_0x4184d6);});});}
\ No newline at end of file
index 2f8a118..fa0fd69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc338=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x643169,_0x430fdf){var _0x1fe66b=function(_0x5bc406){while(--_0x5bc406){_0x643169['push'](_0x643169['shift']());}};_0x1fe66b(++_0x430fdf);}(_0xc338,0x156));var _0x8c33=function(_0x59c3cc,_0x46a6ff){_0x59c3cc=_0x59c3cc-0x0;var _0xb4c3e2=_0xc338[_0x59c3cc];return _0xb4c3e2;};'use strict';var ChatWebsiteEvents=require(_0x8c33('0x0'));var events=[_0x8c33('0x1'),_0x8c33('0x2'),'update'];function createListener(_0x2c6800,_0x363a1e){return function(_0x12da0f){_0x363a1e[_0x8c33('0x3')](_0x2c6800,_0x12da0f);};}function removeListener(_0x59de3,_0x455112){return function(){ChatWebsiteEvents[_0x8c33('0x4')](_0x59de3,_0x455112);};}exports[_0x8c33('0x5')]=function(_0x56f1cf){for(var _0x9d0c37=0x0,_0x57d154=events[_0x8c33('0x6')];_0x9d0c37<_0x57d154;_0x9d0c37++){var _0x3430fc=events[_0x9d0c37];var _0x51c6ae=createListener(_0x8c33('0x7')+_0x3430fc,_0x56f1cf);ChatWebsiteEvents['on'](_0x3430fc,_0x51c6ae);}};
\ No newline at end of file
+var _0xab91=['register','length','chatWebsite:','./chatWebsite.events','save','update','emit'];(function(_0x578257,_0x56af59){var _0x2833d3=function(_0x9ab6d9){while(--_0x9ab6d9){_0x578257['push'](_0x578257['shift']());}};_0x2833d3(++_0x56af59);}(_0xab91,0x199));var _0x1ab9=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xab91[_0x4ea413];return _0x51cf25;};'use strict';var ChatWebsiteEvents=require(_0x1ab9('0x0'));var events=[_0x1ab9('0x1'),'remove',_0x1ab9('0x2')];function createListener(_0x1a5bdc,_0x375d52){return function(_0x231234){_0x375d52[_0x1ab9('0x3')](_0x1a5bdc,_0x231234);};}function removeListener(_0x2c8600,_0x270ead){return function(){ChatWebsiteEvents['removeListener'](_0x2c8600,_0x270ead);};}exports[_0x1ab9('0x4')]=function(_0x42d4fe){for(var _0x32961b=0x0,_0xde8877=events[_0x1ab9('0x5')];_0x32961b<_0xde8877;_0x32961b++){var _0x408167=events[_0x32961b];var _0x5c2115=createListener(_0x1ab9('0x6')+_0x408167,_0x42d4fe);ChatWebsiteEvents['on'](_0x408167,_0x5c2115);}};
\ No newline at end of file
index ad716a3..c801efd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c1=['file','addLogo','join','server/files/images/avatars/','format','addAvatar','root','/:id/notify','notify','/:id/offline','offline','/:id/proactive_actions','addProactiveActions','put','destroy','removeDispositions','/:id/canned_answers','removeAnswers','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','single'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xe0c1,0x10f));var _0x1e0c=function(_0x53b906,_0x238c0d){_0x53b906=_0x53b906-0x0;var _0x3d5a6b=_0xe0c1[_0x53b906];return _0x3d5a6b;};'use strict';var multer=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var path=require(_0x1e0c('0x2'));var timeout=require(_0x1e0c('0x3'));var express=require(_0x1e0c('0x4'));var router=express[_0x1e0c('0x5')]();var auth=require(_0x1e0c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1e0c('0x7')](_0x1e0c('0x8'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0xa')]);router[_0x1e0c('0x7')](_0x1e0c('0xb'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0xc')]);router['get'](_0x1e0c('0xd'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0xe')]);router[_0x1e0c('0x7')]('/:id/canned_answers',auth[_0x1e0c('0x9')](),controller[_0x1e0c('0xf')]);router[_0x1e0c('0x7')]('/:id/logo',controller[_0x1e0c('0x10')]);router['get'](_0x1e0c('0x11'),controller[_0x1e0c('0x12')]);router[_0x1e0c('0x7')](_0x1e0c('0x13'),controller[_0x1e0c('0x14')]);router[_0x1e0c('0x7')](_0x1e0c('0x15'),controller[_0x1e0c('0x16')]);router[_0x1e0c('0x7')](_0x1e0c('0x17'),auth['isAuthenticated'](),controller[_0x1e0c('0x18')]);router['get'](_0x1e0c('0x19'),controller[_0x1e0c('0x1a')]);router[_0x1e0c('0x7')](_0x1e0c('0x1b'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x1c')]);router[_0x1e0c('0x7')]('/:id/proactive_actions',auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x1d')]);router[_0x1e0c('0x7')](_0x1e0c('0x1e'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x1f')]);router[_0x1e0c('0x7')](_0x1e0c('0x20'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x21')]);router[_0x1e0c('0x22')]('/',auth[_0x1e0c('0x9')](),controller['create']);router['post'](_0x1e0c('0xd'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x23')]);router[_0x1e0c('0x22')]('/:id/canned_answers',auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x24')]);var upload=multer({'storage':multer[_0x1e0c('0x25')]({'destination':function(_0x1cf772,_0x3d5f10,_0x1697a4){_0x1697a4(null,path['join'](config['root'],_0x1e0c('0x26')));},'filename':function(_0x3867c6,_0x4296b5,_0x46eb21){_0x46eb21(null,util['format'](_0x1e0c('0x27'),Date[_0x1e0c('0x28')](),_0x4296b5[_0x1e0c('0x29')]));}})});router['post'](_0x1e0c('0x2a'),upload[_0x1e0c('0x2b')](_0x1e0c('0x2c')),controller[_0x1e0c('0x2d')]);var upload=multer({'storage':multer[_0x1e0c('0x25')]({'destination':function(_0x4e0cea,_0x6ffd65,_0x582a18){_0x582a18(null,path[_0x1e0c('0x2e')](config['root'],_0x1e0c('0x2f')));},'filename':function(_0x11f42a,_0x36c0cb,_0x28422a){_0x28422a(null,util[_0x1e0c('0x30')]('%s-%s',Date[_0x1e0c('0x28')](),_0x36c0cb[_0x1e0c('0x29')]));}})});router['post']('/:id/avatar',upload[_0x1e0c('0x2b')]('file'),controller[_0x1e0c('0x31')]);var upload=multer({'storage':multer[_0x1e0c('0x25')]({'destination':function(_0xca3b86,_0x47424e,_0xa7bb00){_0xa7bb00(null,path[_0x1e0c('0x2e')](config[_0x1e0c('0x32')],_0x1e0c('0x2f')));},'filename':function(_0x1f3273,_0x12675a,_0x533b9c){_0x533b9c(null,util[_0x1e0c('0x30')]('%s-%s',Date[_0x1e0c('0x28')](),_0x12675a['originalname']));}})});router[_0x1e0c('0x22')]('/:id/customer_avatar',upload[_0x1e0c('0x2b')](_0x1e0c('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c92f2,_0x17bb3e,_0x5ee462){_0x5ee462(null,path['join'](config[_0x1e0c('0x32')],_0x1e0c('0x2f')));},'filename':function(_0x14fa00,_0x249e81,_0x293bef){_0x293bef(null,util[_0x1e0c('0x30')]('%s-%s',Date[_0x1e0c('0x28')](),_0x249e81[_0x1e0c('0x29')]));}})});router[_0x1e0c('0x22')](_0x1e0c('0x15'),upload[_0x1e0c('0x2b')](_0x1e0c('0x2c')),controller['addSystemAvatar']);router[_0x1e0c('0x22')](_0x1e0c('0x33'),controller[_0x1e0c('0x34')]);router[_0x1e0c('0x22')](_0x1e0c('0x35'),controller[_0x1e0c('0x36')]);router['post'](_0x1e0c('0x17'),auth[_0x1e0c('0x9')](),controller['addInteraction']);router[_0x1e0c('0x22')](_0x1e0c('0x1b'),auth['isAuthenticated'](),controller['addApplications']);router[_0x1e0c('0x22')](_0x1e0c('0x37'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x38')]);router['post']('/:id/users',auth[_0x1e0c('0x9')](),controller['addAgents']);router[_0x1e0c('0x39')](_0x1e0c('0xb'),auth[_0x1e0c('0x9')](),controller['update']);router['delete'](_0x1e0c('0xb'),auth['isAuthenticated'](),controller[_0x1e0c('0x3a')]);router['delete'](_0x1e0c('0xd'),auth['isAuthenticated'](),controller[_0x1e0c('0x3b')]);router['delete'](_0x1e0c('0x3c'),auth[_0x1e0c('0x9')](),controller[_0x1e0c('0x3d')]);router[_0x1e0c('0x3e')](_0x1e0c('0x20'),auth[_0x1e0c('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xaa37=['getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','post','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','server/files/images/avatars/','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x4e1e19,_0x565eca){var _0x42723e=function(_0x35ef78){while(--_0x35ef78){_0x4e1e19['push'](_0x4e1e19['shift']());}};_0x42723e(++_0x565eca);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xaa37[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var auth=require(_0x7aa3('0x5'));var interaction=require(_0x7aa3('0x6'));var config=require(_0x7aa3('0x7'));var controller=require(_0x7aa3('0x8'));router[_0x7aa3('0x9')]('/',auth[_0x7aa3('0xa')](),controller['index']);router[_0x7aa3('0x9')](_0x7aa3('0xb'),auth['isAuthenticated'](),controller[_0x7aa3('0xc')]);router[_0x7aa3('0x9')](_0x7aa3('0xd'),auth['isAuthenticated'](),controller[_0x7aa3('0xe')]);router[_0x7aa3('0x9')](_0x7aa3('0xf'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x10')]);router[_0x7aa3('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7aa3('0x11')]);router['get'](_0x7aa3('0x12'),controller[_0x7aa3('0x13')]);router['get'](_0x7aa3('0x14'),controller[_0x7aa3('0x15')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x7aa3('0x9')](_0x7aa3('0x16'),controller[_0x7aa3('0x17')]);router[_0x7aa3('0x9')](_0x7aa3('0x18'),auth['isAuthenticated'](),controller[_0x7aa3('0x19')]);router[_0x7aa3('0x9')](_0x7aa3('0x1a'),controller[_0x7aa3('0x1b')]);router['get']('/:id/applications',auth[_0x7aa3('0xa')](),controller['getApplications']);router[_0x7aa3('0x9')](_0x7aa3('0x1c'),auth['isAuthenticated'](),controller[_0x7aa3('0x1d')]);router[_0x7aa3('0x9')](_0x7aa3('0x1e'),controller[_0x7aa3('0x1f')]);router[_0x7aa3('0x9')]('/:id/offline_messages',auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x20')]);router[_0x7aa3('0x9')](_0x7aa3('0x21'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x22')]);router['post']('/',auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x23')]);router[_0x7aa3('0x24')](_0x7aa3('0xf'),auth[_0x7aa3('0xa')](),controller['addDisposition']);router[_0x7aa3('0x24')](_0x7aa3('0x25'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x26')]);var upload=multer({'storage':multer[_0x7aa3('0x27')]({'destination':function(_0x10887d,_0x25bc1f,_0x40645e){_0x40645e(null,path[_0x7aa3('0x28')](config[_0x7aa3('0x29')],_0x7aa3('0x2a')));},'filename':function(_0x1c5fef,_0x1f1d82,_0x49b7b0){_0x49b7b0(null,util[_0x7aa3('0x2b')](_0x7aa3('0x2c'),Date[_0x7aa3('0x2d')](),_0x1f1d82[_0x7aa3('0x2e')]));}})});router[_0x7aa3('0x24')](_0x7aa3('0x12'),upload['single'](_0x7aa3('0x2f')),controller[_0x7aa3('0x30')]);var upload=multer({'storage':multer[_0x7aa3('0x27')]({'destination':function(_0x4802a0,_0x409194,_0x25c611){_0x25c611(null,path['join'](config[_0x7aa3('0x29')],_0x7aa3('0x31')));},'filename':function(_0x1d6ec8,_0x34cf01,_0x370e46){_0x370e46(null,util[_0x7aa3('0x2b')](_0x7aa3('0x2c'),Date[_0x7aa3('0x2d')](),_0x34cf01[_0x7aa3('0x2e')]));}})});router[_0x7aa3('0x24')](_0x7aa3('0x14'),upload[_0x7aa3('0x32')](_0x7aa3('0x2f')),controller[_0x7aa3('0x33')]);var upload=multer({'storage':multer[_0x7aa3('0x27')]({'destination':function(_0x1e5b7b,_0x2af928,_0x25935c){_0x25935c(null,path[_0x7aa3('0x28')](config[_0x7aa3('0x29')],_0x7aa3('0x31')));},'filename':function(_0x508da6,_0x295b73,_0x429dcc){_0x429dcc(null,util[_0x7aa3('0x2b')](_0x7aa3('0x2c'),Date[_0x7aa3('0x2d')](),_0x295b73[_0x7aa3('0x2e')]));}})});router[_0x7aa3('0x24')](_0x7aa3('0x34'),upload[_0x7aa3('0x32')](_0x7aa3('0x2f')),controller[_0x7aa3('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d6125,_0x2ea871,_0x187f2d){_0x187f2d(null,path[_0x7aa3('0x28')](config[_0x7aa3('0x29')],_0x7aa3('0x31')));},'filename':function(_0x1c8d0e,_0x112359,_0x38eadd){_0x38eadd(null,util[_0x7aa3('0x2b')](_0x7aa3('0x2c'),Date[_0x7aa3('0x2d')](),_0x112359[_0x7aa3('0x2e')]));}})});router[_0x7aa3('0x24')]('/:id/system_avatar',upload[_0x7aa3('0x32')](_0x7aa3('0x2f')),controller[_0x7aa3('0x36')]);router[_0x7aa3('0x24')]('/:id/notify',controller[_0x7aa3('0x37')]);router['post'](_0x7aa3('0x38'),controller[_0x7aa3('0x39')]);router[_0x7aa3('0x24')](_0x7aa3('0x18'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x3a')]);router[_0x7aa3('0x24')](_0x7aa3('0x3b'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x3c')]);router['post'](_0x7aa3('0x1c'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x3d')]);router[_0x7aa3('0x24')](_0x7aa3('0x21'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x3e')]);router[_0x7aa3('0x3f')](_0x7aa3('0xd'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x40')]);router[_0x7aa3('0x41')](_0x7aa3('0xd'),auth[_0x7aa3('0xa')](),controller['destroy']);router[_0x7aa3('0x41')](_0x7aa3('0xf'),auth['isAuthenticated'](),controller[_0x7aa3('0x42')]);router[_0x7aa3('0x41')]('/:id/canned_answers',auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x43')]);router[_0x7aa3('0x41')](_0x7aa3('0x21'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7aa3('0x44')]=router;
\ No newline at end of file
index 1a1c52a..87a5519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7422=['STRING','name','exports'];(function(_0x497642,_0x55c481){var _0x351a14=function(_0xcc4e3b){while(--_0xcc4e3b){_0x497642['push'](_0x497642['shift']());}};_0x351a14(++_0x55c481);}(_0x7422,0x1d6));var _0x2742=function(_0x4a3240,_0x79bab9){_0x4a3240=_0x4a3240-0x0;var _0x2de249=_0x7422[_0x4a3240];return _0x2de249;};'use strict';var Sequelize=require('sequelize');module[_0x2742('0x0')]={'name':{'type':Sequelize[_0x2742('0x1')],'unique':_0x2742('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2742('0x1')]},'companyId':{'type':Sequelize[_0x2742('0x1')]},'website':{'type':Sequelize[_0x2742('0x1')]},'phone':{'type':Sequelize[_0x2742('0x1')]},'fax':{'type':Sequelize[_0x2742('0x1')]},'type':{'type':Sequelize[_0x2742('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2742('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2742('0x1')]},'email':{'type':Sequelize[_0x2742('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2742('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x2742('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x2742('0x1')]},'description':{'type':Sequelize[_0x2742('0x1')]}};
\ No newline at end of file
+var _0x5c43=['exports','STRING','name','sequelize'];(function(_0x249eb3,_0x260a75){var _0x4a1d96=function(_0x1e9560){while(--_0x1e9560){_0x249eb3['push'](_0x249eb3['shift']());}};_0x4a1d96(++_0x260a75);}(_0x5c43,0x187));var _0x35c4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c43[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x35c4('0x0'));module[_0x35c4('0x1')]={'name':{'type':Sequelize[_0x35c4('0x2')],'unique':_0x35c4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x35c4('0x2')]},'companyId':{'type':Sequelize[_0x35c4('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x35c4('0x2')]},'street':{'type':Sequelize[_0x35c4('0x2')]},'postalCode':{'type':Sequelize[_0x35c4('0x2')]},'city':{'type':Sequelize[_0x35c4('0x2')]},'country':{'type':Sequelize[_0x35c4('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x35c4('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x35c4('0x2')]},'sCountry':{'type':Sequelize[_0x35c4('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cb05a6f..29bb978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1bd=['findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','getContacts','CmContact','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','limit','set','apply','reject','save','then','destroy','get','Companies','UserProfileResource','sendStatus','error','name','send','index','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','options','includeAll','CmCompany'];(function(_0x17d928,_0x15f099){var _0x2c812c=function(_0x5e42db){while(--_0x5e42db){_0x17d928['push'](_0x17d928['shift']());}};_0x2c812c(++_0x15f099);}(_0xd1bd,0x117));var _0xdd1b=function(_0x2f0f3c,_0x8a0355){_0x2f0f3c=_0x2f0f3c-0x0;var _0x50a809=_0xd1bd[_0x2f0f3c];return _0x50a809;};'use strict';var pdf=require(_0xdd1b('0x0'));var emlformat=require(_0xdd1b('0x1'));var rimraf=require(_0xdd1b('0x2'));var zipdir=require(_0xdd1b('0x3'));var jsonpatch=require(_0xdd1b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdd1b('0x5'));var Mustache=require(_0xdd1b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd1b('0x7'));var fs=require('fs');var _=require(_0xdd1b('0x8'));var squel=require(_0xdd1b('0x9'));var crypto=require('crypto');var jsforce=require(_0xdd1b('0xa'));var deskjs=require(_0xdd1b('0xb'));var toCsv=require(_0xdd1b('0xc'));var querystring=require(_0xdd1b('0xd'));var Papa=require(_0xdd1b('0xe'));var Redis=require('ioredis');var qs=require(_0xdd1b('0xf'));var logger=require(_0xdd1b('0x10'))('api');var utils=require(_0xdd1b('0x11'));var config=require(_0xdd1b('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13c748,_0x5cd7e4){_0x5cd7e4=_0x5cd7e4||0xcc;return function(_0x1dcbe4){if(_0x1dcbe4){return _0x13c748['sendStatus'](_0x5cd7e4);}return _0x13c748[_0xdd1b('0x13')](_0x5cd7e4)[_0xdd1b('0x14')]();};}function respondWithResult(_0x3592ee,_0x25ef50){_0x25ef50=_0x25ef50||0xc8;return function(_0x52f96a){if(_0x52f96a){return _0x3592ee[_0xdd1b('0x13')](_0x25ef50)['json'](_0x52f96a);}};}function respondWithFilteredResult(_0x386634,_0x56d26c){return function(_0x339cf4){if(_0x339cf4){var _0x1148e2=_0x339cf4[_0xdd1b('0x15')],_0x37c6c2=_0x56d26c[_0xdd1b('0x16')],_0x11e5e1=_0x56d26c[_0xdd1b('0x16')]+_0x56d26c[_0xdd1b('0x17')],_0x92c4cf;if(_0x11e5e1>=_0x1148e2){_0x11e5e1=_0x1148e2;_0x92c4cf=0xc8;}else{_0x92c4cf=0xce;}_0x386634[_0xdd1b('0x13')](_0x92c4cf);return _0x386634[_0xdd1b('0x18')]('Content-Range',_0x37c6c2+'-'+_0x11e5e1+'/'+_0x1148e2)['json'](_0x339cf4);}return null;};}function patchUpdates(_0x5357f4){return function(_0x51f270){try{jsonpatch[_0xdd1b('0x19')](_0x51f270,_0x5357f4,!![]);}catch(_0x11fcee){return BPromise[_0xdd1b('0x1a')](_0x11fcee);}return _0x51f270[_0xdd1b('0x1b')]();};}function saveUpdates(_0x198677,_0x4c073d){return function(_0x4b0264){if(_0x4b0264){return _0x4b0264['update'](_0x198677)[_0xdd1b('0x1c')](function(_0x1e9472){return _0x1e9472;});}return null;};}function removeEntity(_0xb0977a,_0xa68966){return function(_0x22d9c4){if(_0x22d9c4){return _0x22d9c4[_0xdd1b('0x1d')]()[_0xdd1b('0x1c')](function(){var _0x48eb72=_0x22d9c4[_0xdd1b('0x1e')]({'plain':!![]});var _0x3061c2=_0xdd1b('0x1f');return db[_0xdd1b('0x20')][_0xdd1b('0x1d')]({'where':{'type':_0x3061c2,'resourceId':_0x48eb72['id']}})[_0xdd1b('0x1c')](function(){return _0x22d9c4;});})[_0xdd1b('0x1c')](function(){_0xb0977a[_0xdd1b('0x13')](0xcc)[_0xdd1b('0x14')]();});}};}function handleEntityNotFound(_0x4d790a,_0x417540){return function(_0x32721c){if(!_0x32721c){_0x4d790a[_0xdd1b('0x21')](0x194);}return _0x32721c;};}function handleError(_0x6e46d5,_0x327506){_0x327506=_0x327506||0x1f4;return function(_0x5da1e6){logger[_0xdd1b('0x22')](_0x5da1e6['stack']);if(_0x5da1e6[_0xdd1b('0x23')]){delete _0x5da1e6[_0xdd1b('0x23')];}_0x6e46d5['status'](_0x327506)[_0xdd1b('0x24')](_0x5da1e6);};}exports[_0xdd1b('0x25')]=function(_0x3cf2c1,_0x3bb7c8){var _0x4c746c={},_0x4c8ee9={},_0x543c14={'count':0x0,'rows':[]};var _0x2b82fe=db['CmCompany']['rawAttributes'];_0x4c8ee9[_0xdd1b('0x26')]=_[_0xdd1b('0x27')](_0x2b82fe);var _0xc1da13={'dateStart':_0x3cf2c1[_0xdd1b('0x28')][_0xdd1b('0x29')],'dateEnd':_0x3cf2c1['query'][_0xdd1b('0x2a')]};delete _0x3cf2c1[_0xdd1b('0x28')][_0xdd1b('0x29')];delete _0x3cf2c1[_0xdd1b('0x28')][_0xdd1b('0x2a')];_0x4c8ee9[_0xdd1b('0x28')]=_[_0xdd1b('0x27')](_0x3cf2c1[_0xdd1b('0x28')]);_0x4c8ee9[_0xdd1b('0x2b')]=_[_0xdd1b('0x2c')](_0x4c8ee9[_0xdd1b('0x26')],_0x4c8ee9[_0xdd1b('0x28')]);_0x4c746c['attributes']=_[_0xdd1b('0x2c')](_0x4c8ee9[_0xdd1b('0x26')],qs[_0xdd1b('0x2d')](_0x3cf2c1[_0xdd1b('0x28')]['fields']));_0x4c746c[_0xdd1b('0x2e')]=_0x4c746c[_0xdd1b('0x2e')]['length']?_0x4c746c[_0xdd1b('0x2e')]:_0x4c8ee9['model'];if(!_0x3cf2c1[_0xdd1b('0x28')][_0xdd1b('0x2f')](_0xdd1b('0x30'))){_0x4c746c[_0xdd1b('0x17')]=qs[_0xdd1b('0x17')](_0x3cf2c1['query'][_0xdd1b('0x17')]);_0x4c746c[_0xdd1b('0x16')]=qs['offset'](_0x3cf2c1['query'][_0xdd1b('0x16')]);}_0x4c746c[_0xdd1b('0x31')]=qs[_0xdd1b('0x32')](_0x3cf2c1['query']['sort']);_0x4c746c[_0xdd1b('0x33')]=qs[_0xdd1b('0x2b')](_[_0xdd1b('0x34')](_0x3cf2c1['query'],_0x4c8ee9[_0xdd1b('0x2b')]));if(_0xc1da13['dateStart']){if(_0xc1da13[_0xdd1b('0x2a')]){_0xc1da13[_0xdd1b('0x2a')]=moment(_0xc1da13[_0xdd1b('0x2a')])[_0xdd1b('0x35')](0x1,_0xdd1b('0x36'));}else{_0xc1da13['dateEnd']=moment(_0xc1da13[_0xdd1b('0x29')])[_0xdd1b('0x35')](0x1,'day');}_[_0xdd1b('0x37')](_0x4c746c[_0xdd1b('0x33')],{'createdAt':{'$gte':_0xc1da13['dateStart'],'$lte':_0xc1da13[_0xdd1b('0x2a')]}});}if(_0x3cf2c1[_0xdd1b('0x28')][_0xdd1b('0x38')]){_0x4c746c[_0xdd1b('0x33')]=_[_0xdd1b('0x37')](_0x4c746c[_0xdd1b('0x33')],{'$or':_[_0xdd1b('0x39')](_0x2b82fe,function(_0x39d6b7){if(_0x39d6b7[_0xdd1b('0x3a')][_0xdd1b('0x3b')]!==_0xdd1b('0x3c')){var _0x33c276={};_0x33c276[_0x39d6b7[_0xdd1b('0x3d')]]={'$like':'%'+_0x3cf2c1[_0xdd1b('0x28')][_0xdd1b('0x38')]+'%'};return _0x33c276;}})});}_0x4c746c=_[_0xdd1b('0x37')]({},_0x4c746c,_0x3cf2c1[_0xdd1b('0x3e')]);var _0x2e325e={'where':_0x4c746c[_0xdd1b('0x33')]};return db['CmCompany'][_0xdd1b('0x15')](_0x2e325e)[_0xdd1b('0x1c')](function(_0x2dd54b){_0x543c14[_0xdd1b('0x15')]=_0x2dd54b;if(_0x3cf2c1['query'][_0xdd1b('0x3f')]){_0x4c746c['include']=[{'all':!![]}];}return db[_0xdd1b('0x40')][_0xdd1b('0x41')](_0x4c746c);})[_0xdd1b('0x1c')](function(_0x22b02f){_0x543c14[_0xdd1b('0x42')]=_0x22b02f;return _0x543c14;})['then'](respondWithFilteredResult(_0x3bb7c8,_0x4c746c))[_0xdd1b('0x43')](handleError(_0x3bb7c8,null));};exports[_0xdd1b('0x44')]=function(_0x15c92b,_0x275bb6){var _0x23c154={'raw':![],'where':{'id':_0x15c92b[_0xdd1b('0x45')]['id']}},_0x286153={};_0x286153[_0xdd1b('0x26')]=_[_0xdd1b('0x27')](db[_0xdd1b('0x40')][_0xdd1b('0x46')]);_0x286153[_0xdd1b('0x28')]=_['keys'](_0x15c92b[_0xdd1b('0x28')]);_0x286153[_0xdd1b('0x2b')]=_[_0xdd1b('0x2c')](_0x286153[_0xdd1b('0x26')],_0x286153[_0xdd1b('0x28')]);_0x23c154[_0xdd1b('0x2e')]=_[_0xdd1b('0x2c')](_0x286153[_0xdd1b('0x26')],qs[_0xdd1b('0x2d')](_0x15c92b[_0xdd1b('0x28')][_0xdd1b('0x2d')]));_0x23c154[_0xdd1b('0x2e')]=_0x23c154['attributes'][_0xdd1b('0x47')]?_0x23c154[_0xdd1b('0x2e')]:_0x286153[_0xdd1b('0x26')];if(_0x15c92b[_0xdd1b('0x28')]['includeAll']){_0x23c154['include']=[{'all':!![]}];}_0x23c154=_[_0xdd1b('0x37')]({},_0x23c154,_0x15c92b['options']);return db[_0xdd1b('0x40')][_0xdd1b('0x48')](_0x23c154)[_0xdd1b('0x1c')](handleEntityNotFound(_0x275bb6,null))[_0xdd1b('0x1c')](respondWithResult(_0x275bb6,null))[_0xdd1b('0x43')](handleError(_0x275bb6,null));};exports[_0xdd1b('0x49')]=function(_0x114a84,_0x3ef418){return db[_0xdd1b('0x40')][_0xdd1b('0x49')](_0x114a84[_0xdd1b('0x4a')],{})[_0xdd1b('0x1c')](function(_0x3f13ad){var _0x52f9ae=_0x114a84[_0xdd1b('0x4b')][_0xdd1b('0x1e')]({'plain':!![]});if(!_0x52f9ae)throw new Error(_0xdd1b('0x4c'));if(_0x52f9ae[_0xdd1b('0x4d')]==='user'){var _0x2452ba=_0x3f13ad[_0xdd1b('0x1e')]({'plain':!![]});var _0x5dd24e=_0xdd1b('0x1f');return db['UserProfileSection'][_0xdd1b('0x48')]({'where':{'name':_0x5dd24e,'userProfileId':_0x52f9ae[_0xdd1b('0x4e')]},'raw':!![]})[_0xdd1b('0x1c')](function(_0x3dd9c5){if(_0x3dd9c5&&_0x3dd9c5[_0xdd1b('0x4f')]===0x0){return db[_0xdd1b('0x20')][_0xdd1b('0x49')]({'name':_0x2452ba['name'],'resourceId':_0x2452ba['id'],'type':_0x3dd9c5[_0xdd1b('0x23')],'sectionId':_0x3dd9c5['id']},{})[_0xdd1b('0x1c')](function(){return _0x3f13ad;});}else{return _0x3f13ad;}})[_0xdd1b('0x43')](function(_0x240870){logger[_0xdd1b('0x22')](_0xdd1b('0x50'),_0x240870);throw _0x240870;});}return _0x3f13ad;})['then'](respondWithResult(_0x3ef418,0xc9))[_0xdd1b('0x43')](handleError(_0x3ef418,null));};exports[_0xdd1b('0x51')]=function(_0x12b6f7,_0x6d0f9e){if(_0x12b6f7[_0xdd1b('0x4a')]['id']){delete _0x12b6f7[_0xdd1b('0x4a')]['id'];}return db['CmCompany'][_0xdd1b('0x48')]({'where':{'id':_0x12b6f7[_0xdd1b('0x45')]['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x6d0f9e,null))[_0xdd1b('0x1c')](saveUpdates(_0x12b6f7[_0xdd1b('0x4a')],null))['then'](respondWithResult(_0x6d0f9e,null))[_0xdd1b('0x43')](handleError(_0x6d0f9e,null));};exports[_0xdd1b('0x1d')]=function(_0x1ff416,_0x36199c){return db[_0xdd1b('0x40')]['find']({'where':{'id':_0x1ff416['params']['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x36199c,null))['then'](removeEntity(_0x36199c,null))[_0xdd1b('0x43')](handleError(_0x36199c,null));};exports[_0xdd1b('0x52')]=function(_0x26d516,_0x19a445,_0x344140){return db['CmContact']['find']({'where':{'id':_0x26d516['params']['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x19a445,null))[_0xdd1b('0x1c')](function(_0x5d1974){if(_0x5d1974){return _0x5d1974[_0xdd1b('0x52')](_0x26d516['body'][_0xdd1b('0x53')],_['omit'](_0x26d516[_0xdd1b('0x4a')],[_0xdd1b('0x53'),'id'])||{});}})[_0xdd1b('0x1c')](respondWithResult(_0x19a445,null))[_0xdd1b('0x43')](handleError(_0x19a445,null));};exports[_0xdd1b('0x54')]=function(_0x4d6089,_0x31ce48,_0x23d01e){var _0x1b62a1={};var _0x10351a={};var _0x11516c;var _0x5cd3ae;return db['CmCompany']['findOne']({'where':{'id':_0x4d6089[_0xdd1b('0x45')]['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x31ce48,null))['then'](function(_0x4d9d39){if(_0x4d9d39){_0x11516c=_0x4d9d39;_0x10351a[_0xdd1b('0x26')]=_['keys'](db[_0xdd1b('0x55')][_0xdd1b('0x46')]);_0x10351a[_0xdd1b('0x28')]=_[_0xdd1b('0x27')](_0x4d6089[_0xdd1b('0x28')]);_0x10351a[_0xdd1b('0x2b')]=_['intersection'](_0x10351a[_0xdd1b('0x26')],_0x10351a['query']);_0x1b62a1[_0xdd1b('0x2e')]=_[_0xdd1b('0x2c')](_0x10351a[_0xdd1b('0x26')],qs[_0xdd1b('0x2d')](_0x4d6089['query'][_0xdd1b('0x2d')]));_0x1b62a1['attributes']=_0x1b62a1['attributes'][_0xdd1b('0x47')]?_0x1b62a1['attributes']:_0x10351a[_0xdd1b('0x26')];_0x1b62a1[_0xdd1b('0x31')]=qs['sort'](_0x4d6089[_0xdd1b('0x28')]['sort']);_0x1b62a1[_0xdd1b('0x33')]=qs[_0xdd1b('0x2b')](_[_0xdd1b('0x34')](_0x4d6089[_0xdd1b('0x28')],_0x10351a[_0xdd1b('0x2b')]));if(_0x4d6089[_0xdd1b('0x28')][_0xdd1b('0x38')]){_0x1b62a1[_0xdd1b('0x33')]=_[_0xdd1b('0x37')](_0x1b62a1[_0xdd1b('0x33')],{'$or':_[_0xdd1b('0x39')](_0x1b62a1[_0xdd1b('0x2e')],function(_0x499168){var _0x17cc4c={};_0x17cc4c[_0x499168]={'$like':'%'+_0x4d6089[_0xdd1b('0x28')][_0xdd1b('0x38')]+'%'};return _0x17cc4c;})});}_0x1b62a1=_[_0xdd1b('0x37')]({},_0x1b62a1,_0x4d6089[_0xdd1b('0x3e')]);return _0x11516c[_0xdd1b('0x54')](_0x1b62a1);}})['then'](function(_0x2a88dc){if(_0x2a88dc){_0x5cd3ae=_0x2a88dc[_0xdd1b('0x47')];if(!_0x4d6089[_0xdd1b('0x28')][_0xdd1b('0x2f')](_0xdd1b('0x30'))){_0x1b62a1[_0xdd1b('0x17')]=qs[_0xdd1b('0x17')](_0x4d6089[_0xdd1b('0x28')]['limit']);_0x1b62a1[_0xdd1b('0x16')]=qs[_0xdd1b('0x16')](_0x4d6089[_0xdd1b('0x28')][_0xdd1b('0x16')]);}return _0x11516c[_0xdd1b('0x54')](_0x1b62a1);}})[_0xdd1b('0x1c')](function(_0x5e23de){if(_0x5e23de){return _0x5e23de?{'count':_0x5cd3ae,'rows':_0x5e23de}:null;}})['then'](respondWithResult(_0x31ce48,null))[_0xdd1b('0x43')](handleError(_0x31ce48,null));};
\ No newline at end of file
+var _0x9608=['json','count','offset','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','stack','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','day','where','filter','merge','map','type','key','VIRTUAL','field','include','CmCompany','catch','show','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','omit','findOne','order','pick','getContacts','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9608,0xf8));var _0x8960=function(_0x542c37,_0xa2642e){_0x542c37=_0x542c37-0x0;var _0x2bcf72=_0x9608[_0x542c37];return _0x2bcf72;};'use strict';var pdf=require(_0x8960('0x0'));var emlformat=require(_0x8960('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8960('0x2'));var rp=require(_0x8960('0x3'));var moment=require(_0x8960('0x4'));var BPromise=require(_0x8960('0x5'));var Mustache=require(_0x8960('0x6'));var util=require(_0x8960('0x7'));var path=require(_0x8960('0x8'));var sox=require(_0x8960('0x9'));var csv=require(_0x8960('0xa'));var ejs=require(_0x8960('0xb'));var fs=require('fs');var _=require(_0x8960('0xc'));var squel=require('squel');var crypto=require(_0x8960('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8960('0xe'));var toCsv=require(_0x8960('0xa'));var querystring=require(_0x8960('0xf'));var Papa=require(_0x8960('0x10'));var Redis=require('ioredis');var qs=require(_0x8960('0x11'));var logger=require(_0x8960('0x12'))(_0x8960('0x13'));var utils=require('../../config/utils');var config=require(_0x8960('0x14'));var db=require(_0x8960('0x15'))['db'];function respondWithStatusCode(_0x1ec2bc,_0x48bf60){_0x48bf60=_0x48bf60||0xcc;return function(_0x4202cc){if(_0x4202cc){return _0x1ec2bc[_0x8960('0x16')](_0x48bf60);}return _0x1ec2bc[_0x8960('0x17')](_0x48bf60)[_0x8960('0x18')]();};}function respondWithResult(_0x1513bd,_0x5602b1){_0x5602b1=_0x5602b1||0xc8;return function(_0x4b5827){if(_0x4b5827){return _0x1513bd['status'](_0x5602b1)[_0x8960('0x19')](_0x4b5827);}};}function respondWithFilteredResult(_0x13f9d6,_0x48ea17){return function(_0x4aa117){if(_0x4aa117){var _0x492a65=_0x4aa117[_0x8960('0x1a')],_0x4f1140=_0x48ea17[_0x8960('0x1b')],_0x339a45=_0x48ea17[_0x8960('0x1b')]+_0x48ea17['limit'],_0x215354;if(_0x339a45>=_0x492a65){_0x339a45=_0x492a65;_0x215354=0xc8;}else{_0x215354=0xce;}_0x13f9d6[_0x8960('0x17')](_0x215354);return _0x13f9d6['set'](_0x8960('0x1c'),_0x4f1140+'-'+_0x339a45+'/'+_0x492a65)['json'](_0x4aa117);}return null;};}function patchUpdates(_0x1569c2){return function(_0x17746a){try{jsonpatch[_0x8960('0x1d')](_0x17746a,_0x1569c2,!![]);}catch(_0xe660d8){return BPromise[_0x8960('0x1e')](_0xe660d8);}return _0x17746a[_0x8960('0x1f')]();};}function saveUpdates(_0x3cff42,_0x47ace0){return function(_0x5c3a9e){if(_0x5c3a9e){return _0x5c3a9e[_0x8960('0x20')](_0x3cff42)['then'](function(_0x321be0){return _0x321be0;});}return null;};}function removeEntity(_0x4ab57d,_0x38864e){return function(_0x53c971){if(_0x53c971){return _0x53c971[_0x8960('0x21')]()[_0x8960('0x22')](function(){var _0x4e87ce=_0x53c971[_0x8960('0x23')]({'plain':!![]});var _0x161688=_0x8960('0x24');return db[_0x8960('0x25')][_0x8960('0x21')]({'where':{'type':_0x161688,'resourceId':_0x4e87ce['id']}})['then'](function(){return _0x53c971;});})['then'](function(){_0x4ab57d['status'](0xcc)[_0x8960('0x18')]();});}};}function handleEntityNotFound(_0x2485cf,_0x2a890b){return function(_0x5d965f){if(!_0x5d965f){_0x2485cf[_0x8960('0x16')](0x194);}return _0x5d965f;};}function handleError(_0x26bc68,_0x3077ad){_0x3077ad=_0x3077ad||0x1f4;return function(_0x2d67a2){logger['error'](_0x2d67a2[_0x8960('0x26')]);if(_0x2d67a2['name']){delete _0x2d67a2['name'];}_0x26bc68[_0x8960('0x17')](_0x3077ad)[_0x8960('0x27')](_0x2d67a2);};}exports[_0x8960('0x28')]=function(_0x21db90,_0x24bf18){var _0x1ac1ac={},_0x5564ea={},_0x4ca860={'count':0x0,'rows':[]};var _0x5943dc=db['CmCompany'][_0x8960('0x29')];_0x5564ea['model']=_[_0x8960('0x2a')](_0x5943dc);var _0x430566={'dateStart':_0x21db90[_0x8960('0x2b')][_0x8960('0x2c')],'dateEnd':_0x21db90['query'][_0x8960('0x2d')]};delete _0x21db90[_0x8960('0x2b')][_0x8960('0x2c')];delete _0x21db90[_0x8960('0x2b')][_0x8960('0x2d')];_0x5564ea[_0x8960('0x2b')]=_['keys'](_0x21db90[_0x8960('0x2b')]);_0x5564ea[_0x8960('0x2e')]=_[_0x8960('0x2f')](_0x5564ea[_0x8960('0x30')],_0x5564ea[_0x8960('0x2b')]);_0x1ac1ac[_0x8960('0x31')]=_[_0x8960('0x2f')](_0x5564ea[_0x8960('0x30')],qs[_0x8960('0x32')](_0x21db90[_0x8960('0x2b')]['fields']));_0x1ac1ac[_0x8960('0x31')]=_0x1ac1ac['attributes']['length']?_0x1ac1ac[_0x8960('0x31')]:_0x5564ea[_0x8960('0x30')];if(!_0x21db90['query'][_0x8960('0x33')](_0x8960('0x34'))){_0x1ac1ac[_0x8960('0x35')]=qs['limit'](_0x21db90['query']['limit']);_0x1ac1ac[_0x8960('0x1b')]=qs[_0x8960('0x1b')](_0x21db90[_0x8960('0x2b')]['offset']);}_0x1ac1ac['order']=qs[_0x8960('0x36')](_0x21db90['query']['sort']);_0x1ac1ac['where']=qs[_0x8960('0x2e')](_['pick'](_0x21db90[_0x8960('0x2b')],_0x5564ea[_0x8960('0x2e')]));if(_0x430566[_0x8960('0x2c')]){if(_0x430566[_0x8960('0x2d')]){_0x430566['dateEnd']=moment(_0x430566[_0x8960('0x2d')])['add'](0x1,_0x8960('0x37'));}else{_0x430566['dateEnd']=moment(_0x430566[_0x8960('0x2c')])['add'](0x1,_0x8960('0x37'));}_['merge'](_0x1ac1ac[_0x8960('0x38')],{'createdAt':{'$gte':_0x430566['dateStart'],'$lte':_0x430566[_0x8960('0x2d')]}});}if(_0x21db90['query'][_0x8960('0x39')]){_0x1ac1ac[_0x8960('0x38')]=_[_0x8960('0x3a')](_0x1ac1ac['where'],{'$or':_[_0x8960('0x3b')](_0x5943dc,function(_0x38ab21){if(_0x38ab21[_0x8960('0x3c')][_0x8960('0x3d')]!==_0x8960('0x3e')){var _0x24eb33={};_0x24eb33[_0x38ab21[_0x8960('0x3f')]]={'$like':'%'+_0x21db90[_0x8960('0x2b')][_0x8960('0x39')]+'%'};return _0x24eb33;}})});}_0x1ac1ac=_[_0x8960('0x3a')]({},_0x1ac1ac,_0x21db90['options']);var _0x268e8f={'where':_0x1ac1ac['where']};return db['CmCompany'][_0x8960('0x1a')](_0x268e8f)[_0x8960('0x22')](function(_0x23de52){_0x4ca860['count']=_0x23de52;if(_0x21db90['query']['includeAll']){_0x1ac1ac[_0x8960('0x40')]=[{'all':!![]}];}return db[_0x8960('0x41')]['findAll'](_0x1ac1ac);})[_0x8960('0x22')](function(_0x4d80b7){_0x4ca860['rows']=_0x4d80b7;return _0x4ca860;})[_0x8960('0x22')](respondWithFilteredResult(_0x24bf18,_0x1ac1ac))[_0x8960('0x42')](handleError(_0x24bf18,null));};exports[_0x8960('0x43')]=function(_0x45f536,_0x5a87ea){var _0x256951={'raw':![],'where':{'id':_0x45f536['params']['id']}},_0x476550={};_0x476550['model']=_['keys'](db[_0x8960('0x41')][_0x8960('0x29')]);_0x476550[_0x8960('0x2b')]=_['keys'](_0x45f536[_0x8960('0x2b')]);_0x476550['filters']=_['intersection'](_0x476550[_0x8960('0x30')],_0x476550['query']);_0x256951[_0x8960('0x31')]=_[_0x8960('0x2f')](_0x476550['model'],qs[_0x8960('0x32')](_0x45f536['query'][_0x8960('0x32')]));_0x256951[_0x8960('0x31')]=_0x256951[_0x8960('0x31')][_0x8960('0x44')]?_0x256951[_0x8960('0x31')]:_0x476550[_0x8960('0x30')];if(_0x45f536[_0x8960('0x2b')]['includeAll']){_0x256951[_0x8960('0x40')]=[{'all':!![]}];}_0x256951=_[_0x8960('0x3a')]({},_0x256951,_0x45f536[_0x8960('0x45')]);return db['CmCompany'][_0x8960('0x46')](_0x256951)[_0x8960('0x22')](handleEntityNotFound(_0x5a87ea,null))[_0x8960('0x22')](respondWithResult(_0x5a87ea,null))[_0x8960('0x42')](handleError(_0x5a87ea,null));};exports[_0x8960('0x47')]=function(_0x3b9ff8,_0x5167d1){return db[_0x8960('0x41')]['create'](_0x3b9ff8[_0x8960('0x48')],{})['then'](function(_0x56c73a){var _0x1ac533=_0x3b9ff8[_0x8960('0x49')][_0x8960('0x23')]({'plain':!![]});if(!_0x1ac533)throw new Error(_0x8960('0x4a'));if(_0x1ac533[_0x8960('0x4b')]===_0x8960('0x49')){var _0x2eed1d=_0x56c73a[_0x8960('0x23')]({'plain':!![]});var _0x45b7e4=_0x8960('0x24');return db[_0x8960('0x4c')]['find']({'where':{'name':_0x45b7e4,'userProfileId':_0x1ac533[_0x8960('0x4d')]},'raw':!![]})[_0x8960('0x22')](function(_0xc72fc7){if(_0xc72fc7&&_0xc72fc7[_0x8960('0x4e')]===0x0){return db[_0x8960('0x25')][_0x8960('0x47')]({'name':_0x2eed1d[_0x8960('0x4f')],'resourceId':_0x2eed1d['id'],'type':_0xc72fc7[_0x8960('0x4f')],'sectionId':_0xc72fc7['id']},{})[_0x8960('0x22')](function(){return _0x56c73a;});}else{return _0x56c73a;}})['catch'](function(_0x2b580a){logger[_0x8960('0x50')](_0x8960('0x51'),_0x2b580a);throw _0x2b580a;});}return _0x56c73a;})[_0x8960('0x22')](respondWithResult(_0x5167d1,0xc9))[_0x8960('0x42')](handleError(_0x5167d1,null));};exports['update']=function(_0x5040e8,_0x20d089){if(_0x5040e8['body']['id']){delete _0x5040e8[_0x8960('0x48')]['id'];}return db[_0x8960('0x41')][_0x8960('0x46')]({'where':{'id':_0x5040e8[_0x8960('0x52')]['id']}})[_0x8960('0x22')](handleEntityNotFound(_0x20d089,null))[_0x8960('0x22')](saveUpdates(_0x5040e8[_0x8960('0x48')],null))[_0x8960('0x22')](respondWithResult(_0x20d089,null))[_0x8960('0x42')](handleError(_0x20d089,null));};exports[_0x8960('0x21')]=function(_0x59b019,_0x3e3695){return db[_0x8960('0x41')][_0x8960('0x46')]({'where':{'id':_0x59b019['params']['id']}})[_0x8960('0x22')](handleEntityNotFound(_0x3e3695,null))[_0x8960('0x22')](removeEntity(_0x3e3695,null))[_0x8960('0x42')](handleError(_0x3e3695,null));};exports['addContacts']=function(_0x7ffa04,_0x4a8665,_0x198a56){return db[_0x8960('0x53')]['find']({'where':{'id':_0x7ffa04['params']['id']}})['then'](handleEntityNotFound(_0x4a8665,null))[_0x8960('0x22')](function(_0x84d7dc){if(_0x84d7dc){return _0x84d7dc[_0x8960('0x54')](_0x7ffa04[_0x8960('0x48')][_0x8960('0x55')],_[_0x8960('0x56')](_0x7ffa04['body'],[_0x8960('0x55'),'id'])||{});}})['then'](respondWithResult(_0x4a8665,null))[_0x8960('0x42')](handleError(_0x4a8665,null));};exports['getContacts']=function(_0x4c1f02,_0x3619ba,_0x28ab05){var _0x8a2893={};var _0x12b3d9={};var _0x14e849;var _0x27b5cd;return db[_0x8960('0x41')][_0x8960('0x57')]({'where':{'id':_0x4c1f02['params']['id']}})[_0x8960('0x22')](handleEntityNotFound(_0x3619ba,null))['then'](function(_0x6fa754){if(_0x6fa754){_0x14e849=_0x6fa754;_0x12b3d9[_0x8960('0x30')]=_[_0x8960('0x2a')](db[_0x8960('0x53')][_0x8960('0x29')]);_0x12b3d9[_0x8960('0x2b')]=_[_0x8960('0x2a')](_0x4c1f02[_0x8960('0x2b')]);_0x12b3d9[_0x8960('0x2e')]=_['intersection'](_0x12b3d9['model'],_0x12b3d9[_0x8960('0x2b')]);_0x8a2893[_0x8960('0x31')]=_['intersection'](_0x12b3d9['model'],qs['fields'](_0x4c1f02['query'][_0x8960('0x32')]));_0x8a2893['attributes']=_0x8a2893[_0x8960('0x31')]['length']?_0x8a2893[_0x8960('0x31')]:_0x12b3d9[_0x8960('0x30')];_0x8a2893[_0x8960('0x58')]=qs[_0x8960('0x36')](_0x4c1f02[_0x8960('0x2b')][_0x8960('0x36')]);_0x8a2893[_0x8960('0x38')]=qs['filters'](_[_0x8960('0x59')](_0x4c1f02[_0x8960('0x2b')],_0x12b3d9['filters']));if(_0x4c1f02[_0x8960('0x2b')][_0x8960('0x39')]){_0x8a2893[_0x8960('0x38')]=_['merge'](_0x8a2893[_0x8960('0x38')],{'$or':_[_0x8960('0x3b')](_0x8a2893['attributes'],function(_0x2001a0){var _0x482e3a={};_0x482e3a[_0x2001a0]={'$like':'%'+_0x4c1f02[_0x8960('0x2b')]['filter']+'%'};return _0x482e3a;})});}_0x8a2893=_[_0x8960('0x3a')]({},_0x8a2893,_0x4c1f02[_0x8960('0x45')]);return _0x14e849['getContacts'](_0x8a2893);}})[_0x8960('0x22')](function(_0x2ac12e){if(_0x2ac12e){_0x27b5cd=_0x2ac12e['length'];if(!_0x4c1f02[_0x8960('0x2b')][_0x8960('0x33')](_0x8960('0x34'))){_0x8a2893[_0x8960('0x35')]=qs['limit'](_0x4c1f02[_0x8960('0x2b')][_0x8960('0x35')]);_0x8a2893[_0x8960('0x1b')]=qs[_0x8960('0x1b')](_0x4c1f02[_0x8960('0x2b')][_0x8960('0x1b')]);}return _0x14e849[_0x8960('0x5a')](_0x8a2893);}})[_0x8960('0x22')](function(_0x43662f){if(_0x43662f){return _0x43662f?{'count':_0x27b5cd,'rows':_0x43662f}:null;}})[_0x8960('0x22')](respondWithResult(_0x3619ba,null))['catch'](handleError(_0x3619ba,null));};
\ No newline at end of file
index 94160f5..150f9b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74f0=['define','CmCompany','cm_companies','util','moment','bluebird','request-promise','./cmCompany.attributes'];(function(_0x1156ce,_0x50f233){var _0x2b6d72=function(_0x36a033){while(--_0x36a033){_0x1156ce['push'](_0x1156ce['shift']());}};_0x2b6d72(++_0x50f233);}(_0x74f0,0xf3));var _0x074f=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x74f0[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x074f('0x1'));var BPromise=require(_0x074f('0x2'));var rp=require(_0x074f('0x3'));var attributes=require(_0x074f('0x4'));module['exports']=function(_0x51fbdc,_0x3d8d87){return _0x51fbdc[_0x074f('0x5')](_0x074f('0x6'),attributes,{'tableName':_0x074f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6b1=['CmCompany','lodash','../../config/logger','moment','bluebird','./cmCompany.attributes','define'];(function(_0x4be730,_0x341fe4){var _0x54bbe5=function(_0x57aba7){while(--_0x57aba7){_0x4be730['push'](_0x4be730['shift']());}};_0x54bbe5(++_0x341fe4);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xb6b1[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var logger=require(_0x1b6b('0x1'))('api');var moment=require(_0x1b6b('0x2'));var BPromise=require(_0x1b6b('0x3'));var rp=require('request-promise');var attributes=require(_0x1b6b('0x4'));module['exports']=function(_0x2a2c45,_0xb1a61e){return _0x2a2c45[_0x1b6b('0x5')](_0x1b6b('0x6'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cecc93e..59b36cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dbc=['info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x1dbc,0x14d));var _0xc1db=function(_0x5eb1a8,_0x30e664){_0x5eb1a8=_0x5eb1a8-0x0;var _0x14c11c=_0x1dbc[_0x5eb1a8];return _0x14c11c;};'use strict';var _=require('lodash');var util=require(_0xc1db('0x0'));var moment=require(_0xc1db('0x1'));var BPromise=require(_0xc1db('0x2'));var rs=require(_0xc1db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1db('0x4'))['db'];var utils=require(_0xc1db('0x5'));var logger=require(_0xc1db('0x6'))(_0xc1db('0x7'));var config=require(_0xc1db('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc1db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6b630,_0x52ef83,_0x3caedb){return new BPromise(function(_0x4b3434,_0xd0b14f){return client[_0xc1db('0xa')](_0xc6b630,_0x3caedb)[_0xc1db('0xb')](function(_0x455eac){logger[_0xc1db('0xc')]('CmCompany,\x20%s,\x20%s',_0x52ef83,'request\x20sent');logger[_0xc1db('0xd')](_0xc1db('0xe'),_0x52ef83,_0xc1db('0xf'),JSON[_0xc1db('0x10')](_0x455eac));if(_0x455eac[_0xc1db('0x11')]){if(_0x455eac[_0xc1db('0x11')][_0xc1db('0x12')]===0x1f4){logger[_0xc1db('0x11')](_0xc1db('0x13'),_0x52ef83,_0x455eac[_0xc1db('0x11')]['message']);return _0xd0b14f(_0x455eac['error'][_0xc1db('0x14')]);}logger[_0xc1db('0x11')](_0xc1db('0x13'),_0x52ef83,_0x455eac[_0xc1db('0x11')][_0xc1db('0x14')]);return _0x4b3434(_0x455eac[_0xc1db('0x11')][_0xc1db('0x14')]);}else{logger[_0xc1db('0xc')](_0xc1db('0x13'),_0x52ef83,_0xc1db('0xf'));_0x4b3434(_0x455eac[_0xc1db('0x15')][_0xc1db('0x14')]);}})[_0xc1db('0x16')](function(_0x44d7bb){logger[_0xc1db('0x11')](_0xc1db('0x13'),_0x52ef83,_0x44d7bb);_0xd0b14f(_0x44d7bb);});});}
\ No newline at end of file
+var _0xd9fc=['rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4be6bc,_0x390952){var _0x4e8114=function(_0x40ffa1){while(--_0x40ffa1){_0x4be6bc['push'](_0x4be6bc['shift']());}};_0x4e8114(++_0x390952);}(_0xd9fc,0x73));var _0xcd9f=function(_0x131cd2,_0x46c138){_0x131cd2=_0x131cd2-0x0;var _0x19b5a0=_0xd9fc[_0x131cd2];return _0x19b5a0;};'use strict';var _=require(_0xcd9f('0x0'));var util=require(_0xcd9f('0x1'));var moment=require('moment');var BPromise=require(_0xcd9f('0x2'));var rs=require(_0xcd9f('0x3'));var fs=require('fs');var Redis=require(_0xcd9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcd9f('0x5'));var config=require(_0xcd9f('0x6'));var jayson=require(_0xcd9f('0x7'));var client=jayson[_0xcd9f('0x8')][_0xcd9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9acdf2,_0x47b194,_0x57e97a){return new BPromise(function(_0x3b7d41,_0xa739b){return client[_0xcd9f('0xa')](_0x9acdf2,_0x57e97a)['then'](function(_0x1809cf){logger['info'](_0xcd9f('0xb'),_0x47b194,'request\x20sent');logger[_0xcd9f('0xc')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x47b194,_0xcd9f('0xd'),JSON[_0xcd9f('0xe')](_0x1809cf));if(_0x1809cf[_0xcd9f('0xf')]){if(_0x1809cf['error'][_0xcd9f('0x10')]===0x1f4){logger[_0xcd9f('0xf')](_0xcd9f('0xb'),_0x47b194,_0x1809cf[_0xcd9f('0xf')][_0xcd9f('0x11')]);return _0xa739b(_0x1809cf[_0xcd9f('0xf')][_0xcd9f('0x11')]);}logger[_0xcd9f('0xf')](_0xcd9f('0xb'),_0x47b194,_0x1809cf['error']['message']);return _0x3b7d41(_0x1809cf[_0xcd9f('0xf')][_0xcd9f('0x11')]);}else{logger['info'](_0xcd9f('0xb'),_0x47b194,_0xcd9f('0xd'));_0x3b7d41(_0x1809cf[_0xcd9f('0x12')]['message']);}})[_0xcd9f('0x13')](function(_0x5dbd73){logger[_0xcd9f('0xf')](_0xcd9f('0xb'),_0x47b194,_0x5dbd73);_0xa739b(_0x5dbd73);});});}
\ No newline at end of file
index 0208849..ab72547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16f0=['exports','multer','util','path','connect-timeout','express','Router','./cmCompany.controller','get','isAuthenticated','/:id','show','/:id/contacts','getContacts','post','addContacts','put','delete'];(function(_0x3672a1,_0x2c3be3){var _0x12bf45=function(_0x47789b){while(--_0x47789b){_0x3672a1['push'](_0x3672a1['shift']());}};_0x12bf45(++_0x2c3be3);}(_0x16f0,0xa3));var _0x016f=function(_0x35cf84,_0x3fd813){_0x35cf84=_0x35cf84-0x0;var _0x537db8=_0x16f0[_0x35cf84];return _0x537db8;};'use strict';var multer=require(_0x016f('0x0'));var util=require(_0x016f('0x1'));var path=require(_0x016f('0x2'));var timeout=require(_0x016f('0x3'));var express=require(_0x016f('0x4'));var router=express[_0x016f('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x016f('0x6'));router[_0x016f('0x7')]('/',auth[_0x016f('0x8')](),controller['index']);router[_0x016f('0x7')](_0x016f('0x9'),auth[_0x016f('0x8')](),controller[_0x016f('0xa')]);router[_0x016f('0x7')](_0x016f('0xb'),auth[_0x016f('0x8')](),controller[_0x016f('0xc')]);router[_0x016f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x016f('0xd')](_0x016f('0xb'),auth[_0x016f('0x8')](),controller[_0x016f('0xe')]);router[_0x016f('0xf')](_0x016f('0x9'),auth[_0x016f('0x8')](),controller['update']);router[_0x016f('0x10')](_0x016f('0x9'),auth[_0x016f('0x8')](),controller['destroy']);module[_0x016f('0x11')]=router;
\ No newline at end of file
+var _0x97b5=['post','/:id/contacts','addContacts','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getContacts','create'];(function(_0x34f9a6,_0x4bf60b){var _0x5a94a2=function(_0x12e12a){while(--_0x12e12a){_0x34f9a6['push'](_0x34f9a6['shift']());}};_0x5a94a2(++_0x4bf60b);}(_0x97b5,0x137));var _0x597b=function(_0x952f0,_0x2fcd7b){_0x952f0=_0x952f0-0x0;var _0x3786ae=_0x97b5[_0x952f0];return _0x3786ae;};'use strict';var multer=require('multer');var util=require(_0x597b('0x0'));var path=require('path');var timeout=require(_0x597b('0x1'));var express=require('express');var router=express[_0x597b('0x2')]();var auth=require(_0x597b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x597b('0x4'));var controller=require('./cmCompany.controller');router[_0x597b('0x5')]('/',auth[_0x597b('0x6')](),controller[_0x597b('0x7')]);router[_0x597b('0x5')](_0x597b('0x8'),auth[_0x597b('0x6')](),controller[_0x597b('0x9')]);router[_0x597b('0x5')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x597b('0xa')]);router['post']('/',auth[_0x597b('0x6')](),controller[_0x597b('0xb')]);router[_0x597b('0xc')](_0x597b('0xd'),auth[_0x597b('0x6')](),controller[_0x597b('0xe')]);router[_0x597b('0xf')](_0x597b('0x8'),auth[_0x597b('0x6')](),controller['update']);router[_0x597b('0x10')]('/:id',auth[_0x597b('0x6')](),controller[_0x597b('0x11')]);module[_0x597b('0x12')]=router;
\ No newline at end of file
index 37ac4e3..ae8b2f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71f8=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x22d655,_0x3941dd){var _0x257739=function(_0x98136e){while(--_0x98136e){_0x22d655['push'](_0x22d655['shift']());}};_0x257739(++_0x3941dd);}(_0x71f8,0x165));var _0x871f=function(_0x4b2231,_0x379f87){_0x4b2231=_0x4b2231-0x0;var _0xb11ccc=_0x71f8[_0x4b2231];return _0xb11ccc;};'use strict';var _=require(_0x871f('0x0'));var Sequelize=require('sequelize');module[_0x871f('0x1')]={'firstName':{'type':Sequelize[_0x871f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x871f('0x2')]},'street':{'type':Sequelize[_0x871f('0x2')]},'postalCode':{'type':Sequelize[_0x871f('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x871f('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x871f('0x3')]},'phone':{'type':Sequelize[_0x871f('0x2')]},'mobile':{'type':Sequelize[_0x871f('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x871f('0x2')]},'url':{'type':Sequelize[_0x871f('0x2')]},'facebook':{'type':Sequelize[_0x871f('0x2')]},'fb_data':{'type':Sequelize[_0x871f('0x2')]},'twitter':{'type':Sequelize[_0x871f('0x2')]},'skype':{'type':Sequelize[_0x871f('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x871f('0x2')]},'line':{'type':Sequelize[_0x871f('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x871f('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x871f('0x4')](0x2)[_0x871f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x871f('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x2e97=['INTEGER','UNSIGNED','DATE','lodash','sequelize','STRING','TEXT'];(function(_0x466060,_0x550ac4){var _0x29a681=function(_0x2ffd9a){while(--_0x2ffd9a){_0x466060['push'](_0x466060['shift']());}};_0x29a681(++_0x550ac4);}(_0x2e97,0x192));var _0x72e9=function(_0x58ac9b,_0x34477f){_0x58ac9b=_0x58ac9b-0x0;var _0x523cfe=_0x2e97[_0x58ac9b];return _0x523cfe;};'use strict';var _=require(_0x72e9('0x0'));var Sequelize=require(_0x72e9('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x72e9('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x72e9('0x2')]},'street':{'type':Sequelize[_0x72e9('0x2')]},'postalCode':{'type':Sequelize[_0x72e9('0x2')]},'city':{'type':Sequelize[_0x72e9('0x2')]},'country':{'type':Sequelize[_0x72e9('0x2')]},'dateOfBirth':{'type':Sequelize[_0x72e9('0x2')]},'description':{'type':Sequelize[_0x72e9('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x72e9('0x2')]},'email':{'type':Sequelize[_0x72e9('0x2')]},'url':{'type':Sequelize[_0x72e9('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x72e9('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x72e9('0x2')]},'teams':{'type':Sequelize[_0x72e9('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x72e9('0x2')]},'wechat':{'type':Sequelize[_0x72e9('0x2')]},'telegram':{'type':Sequelize[_0x72e9('0x2')]},'UserId':{'type':Sequelize[_0x72e9('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x72e9('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x72e9('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index a644d6d..6f1700b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d77=['mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','./cmContact.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','CmContact','describe','model','query','dateStart','dateEnd','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','filter','map','options','include','tag','push','Tags','distinct','includeAll','Tag','color','findAll','rows','destroy','find','params','catch','columnName','displayName','CmCustomField','alias','body','from','get','mergeWith','isArray','tags','join','CmHopper','CmHopperBlack','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','ChatOfflineMessage','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','create','bulkCreate','duplicates','$or','ListId','findOrCreate','spread','$and','omit','format','cf_%d','pickBy','startsWith','cf_','isEmpty','cm_contacts','setFields','id\x20=\x20?','sequelize','text','phone','findOne','intersection','pick','getTags','setTags','getHoppers','rawAttributes','ContactId','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','meta','User','agent','No\x20ListId\x20specified','binding','firstName','child_process','../../components/import/cm/csv2','stringify','message','exit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8d77,0x150));var _0x78d7=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x8d77[_0x5b78e8];return _0xf2c321;};'use strict';var pdf=require(_0x78d7('0x0'));var emlformat=require(_0x78d7('0x1'));var rimraf=require(_0x78d7('0x2'));var zipdir=require(_0x78d7('0x3'));var jsonpatch=require(_0x78d7('0x4'));var rp=require(_0x78d7('0x5'));var moment=require(_0x78d7('0x6'));var BPromise=require(_0x78d7('0x7'));var Mustache=require(_0x78d7('0x8'));var util=require(_0x78d7('0x9'));var path=require(_0x78d7('0xa'));var sox=require(_0x78d7('0xb'));var csv=require(_0x78d7('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x78d7('0xd'));var squel=require(_0x78d7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x78d7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x78d7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0x78d7('0x11'));var logger=require(_0x78d7('0x12'))(_0x78d7('0x13'));var utils=require('../../config/utils');var config=require(_0x78d7('0x14'));var db=require(_0x78d7('0x15'))['db'];config['redis']=_['defaults'](config[_0x78d7('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78d7('0x16')]));require(_0x78d7('0x17'))[_0x78d7('0x18')](socket);function respondWithStatusCode(_0x1c82c0,_0x3c150f){_0x3c150f=_0x3c150f||0xcc;return function(_0xddd58e){if(_0xddd58e){return _0x1c82c0[_0x78d7('0x19')](_0x3c150f);}return _0x1c82c0[_0x78d7('0x1a')](_0x3c150f)['end']();};}function respondWithResult(_0x51c47b,_0x582865){_0x582865=_0x582865||0xc8;return function(_0x37d21a){if(_0x37d21a){return _0x51c47b[_0x78d7('0x1a')](_0x582865)[_0x78d7('0x1b')](_0x37d21a);}};}function respondWithFilteredResult(_0x30dcf7,_0x1a87a9){return function(_0x191d34){if(_0x191d34){var _0x595908=_0x191d34[_0x78d7('0x1c')],_0x429d63=_0x1a87a9[_0x78d7('0x1d')],_0x5e1e6d=_0x1a87a9[_0x78d7('0x1d')]+_0x1a87a9[_0x78d7('0x1e')],_0x3265ba;if(_0x5e1e6d>=_0x595908){_0x5e1e6d=_0x595908;_0x3265ba=0xc8;}else{_0x3265ba=0xce;}_0x30dcf7['status'](_0x3265ba);return _0x30dcf7[_0x78d7('0x1f')](_0x78d7('0x20'),_0x429d63+'-'+_0x5e1e6d+'/'+_0x595908)[_0x78d7('0x1b')](_0x191d34);}return null;};}function patchUpdates(_0x252848){return function(_0x51e723){try{jsonpatch[_0x78d7('0x21')](_0x51e723,_0x252848,!![]);}catch(_0x14ee26){return BPromise[_0x78d7('0x22')](_0x14ee26);}return _0x51e723[_0x78d7('0x23')]();};}function saveUpdates(_0x26b969,_0x292b97){return function(_0x44a18a){if(_0x44a18a){return _0x44a18a[_0x78d7('0x24')](_0x26b969)[_0x78d7('0x25')](function(_0x5a269b){return _0x5a269b;});}return null;};}function removeEntity(_0x5d8259,_0x358f03){return function(_0x5bf9f6){if(_0x5bf9f6){return _0x5bf9f6['destroy']()[_0x78d7('0x25')](function(){_0x5d8259[_0x78d7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d098c,_0x3b035a){return function(_0x13ed2d){if(!_0x13ed2d){_0x1d098c['sendStatus'](0x194);}return _0x13ed2d;};}function handleError(_0x3a6c7a,_0xa05767){_0xa05767=_0xa05767||0x1f4;return function(_0x15cf4c){logger[_0x78d7('0x26')](_0x15cf4c[_0x78d7('0x27')]);if(_0x15cf4c['name']){delete _0x15cf4c[_0x78d7('0x28')];}_0x3a6c7a['status'](_0xa05767)[_0x78d7('0x29')](_0x15cf4c);};}exports[_0x78d7('0x2a')]=function(_0x1bc095,_0x1042c2){var _0x454553={},_0x28c20f={},_0x2e570d={'count':0x0,'rows':[]};return db[_0x78d7('0x2b')][_0x78d7('0x2c')]()[_0x78d7('0x25')](function(_0x4c5318){_0x28c20f[_0x78d7('0x2d')]=_['keys'](_0x4c5318);var _0x20cf06={'dateStart':_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x2f')],'dateEnd':_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x30')]};delete _0x1bc095[_0x78d7('0x2e')][_0x78d7('0x2f')];delete _0x1bc095[_0x78d7('0x2e')][_0x78d7('0x30')];_0x28c20f[_0x78d7('0x2e')]=_[_0x78d7('0x31')](_0x1bc095[_0x78d7('0x2e')]);_0x28c20f[_0x78d7('0x32')]=_['intersection'](_0x28c20f[_0x78d7('0x2d')],_0x28c20f['query']);_0x454553[_0x78d7('0x33')]=_['intersection'](_0x28c20f['model'],qs['fields'](_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x34')]));_0x454553['attributes']=_0x454553['attributes'][_0x78d7('0x35')]?_0x454553[_0x78d7('0x33')]:_0x28c20f[_0x78d7('0x2d')];if(!_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x36')](_0x78d7('0x37'))){_0x454553['limit']=qs[_0x78d7('0x1e')](_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x1e')]);_0x454553[_0x78d7('0x1d')]=qs[_0x78d7('0x1d')](_0x1bc095[_0x78d7('0x2e')]['offset']);}_0x454553[_0x78d7('0x38')]=qs[_0x78d7('0x39')](_0x1bc095[_0x78d7('0x2e')]['sort']);_0x454553[_0x78d7('0x3a')]=qs[_0x78d7('0x32')](_['pick'](_0x1bc095[_0x78d7('0x2e')],_0x28c20f['filters']));if(_0x20cf06[_0x78d7('0x2f')]){if(_0x20cf06[_0x78d7('0x30')]){_0x20cf06[_0x78d7('0x30')]=moment(_0x20cf06[_0x78d7('0x30')])[_0x78d7('0x3b')](0x1,_0x78d7('0x3c'));}else{_0x20cf06['dateEnd']=moment(_0x20cf06[_0x78d7('0x2f')])['add'](0x1,'day');}_[_0x78d7('0x3d')](_0x454553[_0x78d7('0x3a')],{'createdAt':{'$gte':_0x20cf06['dateStart'],'$lte':_0x20cf06[_0x78d7('0x30')]}});}if(_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x3e')]){_0x454553[_0x78d7('0x3a')]=_[_0x78d7('0x3d')](_0x454553[_0x78d7('0x3a')],{'$or':_[_0x78d7('0x3f')](_0x454553[_0x78d7('0x33')],function(_0x3d1535){var _0x2abe81={};_0x2abe81[_0x3d1535]={'$like':'%'+_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x3e')]+'%'};return _0x2abe81;})});}_0x454553=_['merge']({},_0x454553,_0x1bc095[_0x78d7('0x40')]);var _0x315e15={'where':_0x454553[_0x78d7('0x3a')]};_0x315e15[_0x78d7('0x41')]=[];if(_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x42')]){_0x315e15[_0x78d7('0x41')][_0x78d7('0x43')]({'model':db['Tag'],'as':_0x78d7('0x44'),'attributes':['id'],'where':{'id':_0x1bc095[_0x78d7('0x2e')]['tag']},'required':!![]});_0x315e15[_0x78d7('0x45')]=!![];}return db[_0x78d7('0x2b')]['count'](_0x315e15)[_0x78d7('0x25')](function(_0x194657){_0x2e570d[_0x78d7('0x1c')]=_0x194657;if(_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x46')]){_0x454553[_0x78d7('0x41')]=[{'model':db['Tag'],'as':_0x78d7('0x44'),'attributes':['id',_0x78d7('0x28'),'color'],'required':_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x42')]?!![]:![]},{'model':db[_0x78d7('0x47')],'as':'ThroughTags','attributes':['id',_0x78d7('0x28'),_0x78d7('0x48')],'through':_0x1bc095[_0x78d7('0x2e')][_0x78d7('0x42')]?{'attributes':[],'where':{'TagId':_0x1bc095[_0x78d7('0x2e')]['tag']||undefined}}:{},'required':_0x1bc095['query'][_0x78d7('0x42')]?!![]:![]}];}return db[_0x78d7('0x2b')][_0x78d7('0x49')](_0x454553);})[_0x78d7('0x25')](function(_0x5adbe5){_0x2e570d[_0x78d7('0x4a')]=_0x5adbe5;return _0x2e570d;})['then'](respondWithFilteredResult(_0x1042c2,_0x454553))['catch'](handleError(_0x1042c2,null));});};exports[_0x78d7('0x4b')]=function(_0x2c16da,_0x2b17c7){return db[_0x78d7('0x2b')][_0x78d7('0x4c')]({'where':{'id':_0x2c16da[_0x78d7('0x4d')]['id']}})[_0x78d7('0x25')](handleEntityNotFound(_0x2b17c7,null))[_0x78d7('0x25')](removeEntity(_0x2b17c7,null))[_0x78d7('0x4e')](handleError(_0x2b17c7,null));};exports[_0x78d7('0x2c')]=function(_0x206020,_0x648ce){return db[_0x78d7('0x2b')][_0x78d7('0x2c')]()[_0x78d7('0x25')](function(_0x453725){for(var _0x2022c0=0x0;_0x2022c0<Object[_0x78d7('0x31')](_0x453725)[_0x78d7('0x35')];_0x2022c0++){var _0x4b31b5=Object[_0x78d7('0x31')](_0x453725)[_0x2022c0];if(!_['startsWith'](_0x4b31b5,'cf_')){_0x453725[_0x4b31b5][_0x78d7('0x4f')]=_0x4b31b5;_0x453725[_0x4b31b5][_0x78d7('0x50')]=_0x4b31b5;}}return _0x453725;})[_0x78d7('0x25')](function(_0x3a879a){var _0x1ebc95={'where':{'$or':[{'ListId':_0x206020[_0x78d7('0x2e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x78d7('0x51')][_0x78d7('0x49')](_0x1ebc95)[_0x78d7('0x25')](function(_0x151afe){for(var _0x6ada5f=0x0;_0x6ada5f<_0x151afe[_0x78d7('0x35')];_0x6ada5f++){var _0x83af54='cf_'+_0x151afe[_0x6ada5f]['id'];_0x3a879a[_0x83af54][_0x78d7('0x4f')]=_0x83af54;_0x3a879a[_0x83af54][_0x78d7('0x50')]=_0x151afe[_0x6ada5f][_0x78d7('0x52')];}for(var _0x6ada5f=0x0;_0x6ada5f<Object[_0x78d7('0x31')](_0x3a879a)[_0x78d7('0x35')];_0x6ada5f++){var _0x83af54=Object[_0x78d7('0x31')](_0x3a879a)[_0x6ada5f];if(!_0x3a879a[_0x83af54][_0x78d7('0x36')](_0x78d7('0x4f'))){delete _0x3a879a[_0x83af54];}}return _0x3a879a;});})[_0x78d7('0x25')](respondWithResult(_0x648ce,null))['catch'](handleError(_0x648ce,null));};exports['merge']=function(_0x126054,_0x357dfb){var _0x4af60d;var _0x2bcd49;var _0x3eb9a6;if(_0x126054[_0x78d7('0x53')]['id']){delete _0x126054[_0x78d7('0x53')]['id'];}return db[_0x78d7('0x2b')][_0x78d7('0x49')]({'where':{'id':[_0x126054[_0x78d7('0x53')]['to'],_0x126054[_0x78d7('0x53')][_0x78d7('0x54')]]}})[_0x78d7('0x25')](function(_0x2c7531){if(_0x2c7531){if(_0x2c7531[_0x78d7('0x35')]!==0x2){return null;}_0x2c7531[0x0]=_0x2c7531[0x0][_0x78d7('0x55')]({'plain':!![]});_0x2c7531[0x1]=_0x2c7531[0x1][_0x78d7('0x55')]({'plain':!![]});delete _0x2c7531[0x0]['id'];delete _0x2c7531[0x1]['id'];return _[_0x78d7('0x56')](_0x2c7531[0x0],_0x2c7531[0x1],function(_0x14521d,_0x57f0c7){if(Array['isArray'](_0x57f0c7)&&!_0x57f0c7[_0x78d7('0x35')]){return _0x14521d;}else if(!_0x57f0c7){return _0x14521d;}});}})['then'](handleEntityNotFound(_0x357dfb,null))[_0x78d7('0x25')](function(_0x57fa76){if(_0x57fa76){if(_0x57fa76['tags']&&_[_0x78d7('0x57')](_0x57fa76[_0x78d7('0x58')])){_0x57fa76[_0x78d7('0x58')]=_0x57fa76[_0x78d7('0x58')][_0x78d7('0x59')]();}logger['info']('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x126054[_0x78d7('0x53')]['to'],_0x126054[_0x78d7('0x53')][_0x78d7('0x54')]);return db[_0x78d7('0x5a')]['destroy']({'where':{'ContactId':[_0x126054[_0x78d7('0x53')]['to'],_0x126054[_0x78d7('0x53')][_0x78d7('0x54')]]}})[_0x78d7('0x25')](function(_0x465803){logger['info']('[CmContact][merge][destroy][CmHopper],\x20%s',_0x465803);return db[_0x78d7('0x5b')][_0x78d7('0x4b')]({'where':{'ContactId':[_0x126054['body']['to'],_0x126054['body'][_0x78d7('0x54')]]}})[_0x78d7('0x25')](function(_0x5f120b){logger[_0x78d7('0x5c')](_0x78d7('0x5d'),_0x5f120b);return db[_0x78d7('0x2b')]['create'](_0x57fa76);});});}})['then'](function(_0x3b8af7){if(_0x3b8af7){_0x4af60d=_0x3b8af7;_0x2bcd49={'ContactId':_0x4af60d['id']};_0x3eb9a6={'where':{'ContactId':[_0x126054[_0x78d7('0x53')]['to'],_0x126054[_0x78d7('0x53')][_0x78d7('0x54')]]}};return db['ChatInteraction'][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x5e')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x5f')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db['MailInteraction'][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x60')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db['MailInteraction'][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x60')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})['then'](function(){if(_0x4af60d){return db['SmsInteraction']['update'](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db['SmsMessage']['update'](_0x2bcd49,_0x3eb9a6);}})['then'](function(){if(_0x4af60d){return db[_0x78d7('0x61')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x62')]['update'](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x63')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x64')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x65')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x66')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x67')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})['then'](function(){if(_0x4af60d){return db[_0x78d7('0x68')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x69')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x6a')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x6b')][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})['then'](function(){if(_0x4af60d){return db[_0x78d7('0x6c')]['update'](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db['SmsQueueReport'][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db['JscriptySessionReport'][_0x78d7('0x24')](_0x2bcd49,_0x3eb9a6);}})[_0x78d7('0x25')](function(){if(_0x4af60d){return db[_0x78d7('0x2b')][_0x78d7('0x4b')]({'where':{'id':[_0x126054[_0x78d7('0x53')]['to'],_0x126054[_0x78d7('0x53')][_0x78d7('0x54')]]}});}})['then'](function(){if(_0x4af60d){return _0x4af60d;}})[_0x78d7('0x25')](respondWithResult(_0x357dfb,null))[_0x78d7('0x4e')](handleError(_0x357dfb,null));};exports[_0x78d7('0x6d')]=function(_0x1e15c1,_0x4504d4){return db[_0x78d7('0x2b')][_0x78d7('0x2c')]()[_0x78d7('0x25')](function(_0x18d8a3){if(_0x1e15c1[_0x78d7('0x53')][_0x78d7('0x58')]&&_[_0x78d7('0x57')](_0x1e15c1[_0x78d7('0x53')][_0x78d7('0x58')])){if(_0x1e15c1[_0x78d7('0x53')]['tags']['length']){_0x1e15c1[_0x78d7('0x53')]['tags']=_0x1e15c1[_0x78d7('0x53')][_0x78d7('0x58')][_0x78d7('0x59')](';')+';';}else{_0x1e15c1[_0x78d7('0x53')][_0x78d7('0x58')]=null;}}else{_0x1e15c1[_0x78d7('0x53')][_0x78d7('0x58')]=null;}return db[_0x78d7('0x2b')][_0x78d7('0x6d')](_0x1e15c1[_0x78d7('0x53')],{'fields':_[_0x78d7('0x31')](_0x18d8a3),'raw':!![]});})['then'](respondWithResult(_0x4504d4,0xc9))[_0x78d7('0x4e')](handleError(_0x4504d4,null));};exports[_0x78d7('0x6e')]=function(_0x2d403c,_0x2d5257){var _0x2b261d=[];var _0x35e5a0=0x0;var _0x5f5c14=0x0;var _0x32ef96=0x0;return db[_0x78d7('0x2b')][_0x78d7('0x2c')]()[_0x78d7('0x25')](function(_0x57594d){return BPromise['each'](_0x2d403c[_0x78d7('0x53')],function(_0x8990ee){var _0xe20305={'where':{'$or':[]},'defaults':_0x8990ee,'fields':_[_0x78d7('0x31')](_0x57594d),'raw':!![]};if(_0x8990ee['duplicates']){for(var _0x3a7c5a=0x0;_0x3a7c5a<_0x8990ee[_0x78d7('0x6f')][_0x78d7('0x35')];_0x3a7c5a++){var _0x1f4e13={};_0x1f4e13[_0x8990ee['duplicates'][_0x3a7c5a]]=_0x8990ee[_0x8990ee[_0x78d7('0x6f')][_0x3a7c5a]];_0xe20305[_0x78d7('0x3a')][_0x78d7('0x70')][_0x78d7('0x43')](_0x1f4e13);}_0xe20305[_0x78d7('0x3a')]['ListId']=_0x8990ee[_0x78d7('0x71')];}return db[_0x78d7('0x2b')][_0x78d7('0x72')](_0xe20305)[_0x78d7('0x73')](function(_0x17361e,_0x26d30b){if(_0x26d30b){_0x35e5a0++;}else{_0x32ef96++;}})[_0x78d7('0x4e')](function(_0x1cd4bb){console[_0x78d7('0x26')](_0x1cd4bb);_0x5f5c14++;});});})[_0x78d7('0x25')](function(_0x42b733){if(_0x42b733){return{'success':_0x35e5a0,'failure':_0x5f5c14,'duplicates':_0x32ef96};}})[_0x78d7('0x25')](respondWithResult(_0x2d5257,0xc9))['catch'](handleError(_0x2d5257,null));};exports['show']=function(_0x581b5c,_0x307cec,_0x4dc79f){var _0x2d1b7a;return db[_0x78d7('0x2b')][_0x78d7('0x2c')]()[_0x78d7('0x25')](function(_0x71877e){return db['CmContact'][_0x78d7('0x4c')]({'where':{'id':_0x581b5c[_0x78d7('0x4d')]['id']},'include':[{'model':db[_0x78d7('0x47')],'as':_0x78d7('0x44'),'attributes':['id','name','color'],'required':_0x581b5c[_0x78d7('0x2e')][_0x78d7('0x42')]?!![]:![]}],'attributes':_[_0x78d7('0x31')](_0x71877e)});})[_0x78d7('0x25')](function(_0x310900){_0x2d1b7a=_0x310900[_0x78d7('0x55')]({'plain':!![]});var _0x1c3ce6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x310900&&_0x310900['ListId']){if(_0x310900[_0x78d7('0x71')]){_0x1c3ce6[_0x78d7('0x3a')][_0x78d7('0x74')][_0x78d7('0x43')]({'ListId':{'$ne':_0x310900[_0x78d7('0x71')]}});}}return db[_0x78d7('0x51')][_0x78d7('0x49')](_0x1c3ce6);})['then'](function(_0x5a859a){return _[_0x78d7('0x75')](_0x2d1b7a,_[_0x78d7('0x3f')](_0x5a859a,function(_0x1b1c77){return util[_0x78d7('0x76')](_0x78d7('0x77'),_0x1b1c77['id']);}));})[_0x78d7('0x25')](handleEntityNotFound(_0x307cec,null))[_0x78d7('0x25')](respondWithResult(_0x307cec,null))[_0x78d7('0x4e')](handleError(_0x307cec,null));};exports[_0x78d7('0x24')]=function(_0x22f7db,_0x2dd66e){var _0x57dcd6;if(_0x22f7db[_0x78d7('0x53')]['id']){delete _0x22f7db[_0x78d7('0x53')]['id'];}return db[_0x78d7('0x2b')]['find']({'where':{'id':_0x22f7db['params']['id']}})[_0x78d7('0x25')](handleEntityNotFound(_0x2dd66e,null))[_0x78d7('0x25')](saveUpdates(_0x22f7db[_0x78d7('0x53')],null))['then'](function(_0x2632ed){_0x57dcd6=_0x2632ed;var _0x8452a8={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2632ed&&_0x2632ed[_0x78d7('0x71')]){if(_0x2632ed[_0x78d7('0x71')]){_0x8452a8[_0x78d7('0x3a')][_0x78d7('0x74')]['push']({'ListId':{'$ne':_0x2632ed[_0x78d7('0x71')]}});}}return db[_0x78d7('0x51')][_0x78d7('0x49')](_0x8452a8);})[_0x78d7('0x25')](function(_0x58e243){if(_0x58e243){return _[_0x78d7('0x75')](_[_0x78d7('0x78')](_0x22f7db[_0x78d7('0x53')],function(_0x25878c,_0x546433){return _[_0x78d7('0x79')](_0x546433,_0x78d7('0x7a'));}),_[_0x78d7('0x3f')](_0x58e243,function(_0x3dbc25){return util[_0x78d7('0x76')]('cf_%d',_0x3dbc25['id']);}));}})[_0x78d7('0x25')](function(_0x2f8efd){if(_0x2f8efd&&!_[_0x78d7('0x7b')](_0x2f8efd)){var _0x345a06=squel['update']()['table'](_0x78d7('0x7c'))[_0x78d7('0x7d')](_0x2f8efd)[_0x78d7('0x3a')](_0x78d7('0x7e'),_0x22f7db[_0x78d7('0x4d')]['id'])['toParam']();return db[_0x78d7('0x7f')]['query'](_0x345a06[_0x78d7('0x80')],{'replacements':_0x345a06['values']});}})['then'](function(){if(_0x22f7db[_0x78d7('0x53')][_0x78d7('0x81')]&&_0x57dcd6){return db[_0x78d7('0x5a')][_0x78d7('0x24')]({'phone':_0x22f7db[_0x78d7('0x53')]['phone']},{'where':{'ContactId':_0x57dcd6['id']}});}})[_0x78d7('0x25')](function(){return _0x57dcd6;})[_0x78d7('0x25')](respondWithResult(_0x2dd66e,null))[_0x78d7('0x4e')](handleError(_0x2dd66e,null));};exports['getTags']=function(_0x457ac0,_0x490e4,_0x2fe977){var _0x28cace={};var _0x563fcc={};var _0x20bf7c;var _0x5474f9;return db[_0x78d7('0x2b')][_0x78d7('0x82')]({'where':{'id':_0x457ac0['params']['id']}})[_0x78d7('0x25')](handleEntityNotFound(_0x490e4,null))[_0x78d7('0x25')](function(_0xcabd69){if(_0xcabd69){_0x20bf7c=_0xcabd69;_0x563fcc[_0x78d7('0x2d')]=_[_0x78d7('0x31')](db['Tag']['rawAttributes']);_0x563fcc[_0x78d7('0x2e')]=_['keys'](_0x457ac0['query']);_0x563fcc[_0x78d7('0x32')]=_['intersection'](_0x563fcc[_0x78d7('0x2d')],_0x563fcc[_0x78d7('0x2e')]);_0x28cace['attributes']=_[_0x78d7('0x83')](_0x563fcc[_0x78d7('0x2d')],qs[_0x78d7('0x34')](_0x457ac0[_0x78d7('0x2e')][_0x78d7('0x34')]));_0x28cace[_0x78d7('0x33')]=_0x28cace[_0x78d7('0x33')][_0x78d7('0x35')]?_0x28cace['attributes']:_0x563fcc[_0x78d7('0x2d')];_0x28cace[_0x78d7('0x38')]=qs['sort'](_0x457ac0['query'][_0x78d7('0x39')]);_0x28cace[_0x78d7('0x3a')]=qs['filters'](_[_0x78d7('0x84')](_0x457ac0[_0x78d7('0x2e')],_0x563fcc[_0x78d7('0x32')]));if(_0x457ac0[_0x78d7('0x2e')][_0x78d7('0x3e')]){_0x28cace[_0x78d7('0x3a')]=_[_0x78d7('0x3d')](_0x28cace[_0x78d7('0x3a')],{'$or':_['map'](_0x28cace[_0x78d7('0x33')],function(_0x34079e){var _0x5229e1={};_0x5229e1[_0x34079e]={'$like':'%'+_0x457ac0[_0x78d7('0x2e')][_0x78d7('0x3e')]+'%'};return _0x5229e1;})});}_0x28cace=_['merge']({},_0x28cace,_0x457ac0[_0x78d7('0x40')]);return _0x20bf7c[_0x78d7('0x85')](_0x28cace);}})[_0x78d7('0x25')](function(_0x317ff9){if(_0x317ff9){_0x5474f9=_0x317ff9['length'];if(!_0x457ac0[_0x78d7('0x2e')][_0x78d7('0x36')](_0x78d7('0x37'))){_0x28cace[_0x78d7('0x1e')]=qs[_0x78d7('0x1e')](_0x457ac0[_0x78d7('0x2e')][_0x78d7('0x1e')]);_0x28cace[_0x78d7('0x1d')]=qs['offset'](_0x457ac0[_0x78d7('0x2e')][_0x78d7('0x1d')]);}return _0x20bf7c[_0x78d7('0x85')](_0x28cace);}})[_0x78d7('0x25')](function(_0x2bbc9c){if(_0x2bbc9c){return _0x2bbc9c?{'count':_0x5474f9,'rows':_0x2bbc9c}:null;}})[_0x78d7('0x25')](respondWithResult(_0x490e4,null))[_0x78d7('0x4e')](handleError(_0x490e4,null));};exports[_0x78d7('0x86')]=function(_0x49483e,_0x22f7cc,_0x2904ce){if(_0x49483e['body']['id']){delete _0x49483e['body']['id'];}return db['CmContact'][_0x78d7('0x82')]({'where':{'id':_0x49483e[_0x78d7('0x4d')]['id']}})[_0x78d7('0x25')](handleEntityNotFound(_0x22f7cc,null))[_0x78d7('0x25')](function(_0x37eb30){if(_0x37eb30){return _0x37eb30[_0x78d7('0x86')](_0x49483e[_0x78d7('0x53')]['ids']||[]);}return null;})[_0x78d7('0x25')](respondWithResult(_0x22f7cc,null))[_0x78d7('0x4e')](handleError(_0x22f7cc,null));};exports[_0x78d7('0x87')]=function(_0x34e668,_0x1429a9,_0x4ab12f){var _0x1916e3={'raw':![],'where':{}};var _0x46e1d7={};var _0x58c4c5={'count':0x0,'rows':[]};return db['CmContact'][_0x78d7('0x82')]({'where':{'id':_0x34e668[_0x78d7('0x4d')]['id']}})[_0x78d7('0x25')](handleEntityNotFound(_0x1429a9,null))['then'](function(_0x33e655){if(_0x33e655){_0x46e1d7[_0x78d7('0x2d')]=_[_0x78d7('0x31')](db['CmHopper'][_0x78d7('0x88')]);_0x46e1d7[_0x78d7('0x2e')]=_['keys'](_0x34e668[_0x78d7('0x2e')]);_0x46e1d7[_0x78d7('0x32')]=_[_0x78d7('0x83')](_0x46e1d7[_0x78d7('0x2d')],_0x46e1d7['query']);_0x1916e3[_0x78d7('0x33')]=_['intersection'](_0x46e1d7[_0x78d7('0x2d')],qs[_0x78d7('0x34')](_0x34e668[_0x78d7('0x2e')]['fields']));_0x1916e3['attributes']=_0x1916e3['attributes'][_0x78d7('0x35')]?_0x1916e3[_0x78d7('0x33')]:_0x46e1d7[_0x78d7('0x2d')];if(!_0x34e668['query'][_0x78d7('0x36')](_0x78d7('0x37'))){_0x1916e3['limit']=qs[_0x78d7('0x1e')](_0x34e668[_0x78d7('0x2e')][_0x78d7('0x1e')]);_0x1916e3[_0x78d7('0x1d')]=qs[_0x78d7('0x1d')](_0x34e668[_0x78d7('0x2e')][_0x78d7('0x1d')]);}_0x1916e3['order']=qs[_0x78d7('0x39')](_0x34e668[_0x78d7('0x2e')][_0x78d7('0x39')]);_0x1916e3['where']=qs['filters'](_['pick'](_0x34e668[_0x78d7('0x2e')],_0x46e1d7[_0x78d7('0x32')]));_0x1916e3[_0x78d7('0x3a')][_0x78d7('0x89')]=_0x33e655['id'];if(_0x34e668[_0x78d7('0x2e')]['filter']){_0x1916e3[_0x78d7('0x3a')]=_[_0x78d7('0x3d')](_0x1916e3[_0x78d7('0x3a')],{'$or':_[_0x78d7('0x3f')](_0x1916e3['attributes'],function(_0x1ec331){var _0xc0b4b9={};_0xc0b4b9[_0x1ec331]={'$like':'%'+_0x34e668[_0x78d7('0x2e')][_0x78d7('0x3e')]+'%'};return _0xc0b4b9;})});}_0x1916e3=_[_0x78d7('0x3d')]({},_0x1916e3,_0x34e668['options']);return db[_0x78d7('0x5a')][_0x78d7('0x1c')]({'where':_0x1916e3[_0x78d7('0x3a')]})[_0x78d7('0x25')](function(_0x5309af){_0x58c4c5['count']=_0x5309af;if(_0x34e668['query']['includeAll']){_0x1916e3['include']=[{'all':!![]}];}return db[_0x78d7('0x5a')][_0x78d7('0x49')](_0x1916e3);})[_0x78d7('0x25')](function(_0x476e34){_0x58c4c5[_0x78d7('0x4a')]=_0x476e34;return _0x58c4c5;});}})[_0x78d7('0x25')](respondWithFilteredResult(_0x1429a9,_0x1916e3))['catch'](handleError(_0x1429a9,null));};exports['getHopperHistories']=function(_0x1b6d78,_0xf768f0,_0x109fdf){var _0x5340f1={'raw':!![],'where':{}};var _0x26e291={};var _0x482053={'count':0x0,'rows':[]};return db[_0x78d7('0x2b')][_0x78d7('0x82')]({'where':{'id':_0x1b6d78[_0x78d7('0x4d')]['id']}})[_0x78d7('0x25')](handleEntityNotFound(_0xf768f0,null))[_0x78d7('0x25')](function(_0x2e00d5){if(_0x2e00d5){_0x26e291[_0x78d7('0x2d')]=_[_0x78d7('0x31')](db['CmHopperHistory'][_0x78d7('0x88')]);_0x26e291['query']=_['keys'](_0x1b6d78[_0x78d7('0x2e')]);_0x26e291[_0x78d7('0x32')]=_['intersection'](_0x26e291[_0x78d7('0x2d')],_0x26e291['query']);_0x5340f1[_0x78d7('0x33')]=_['intersection'](_0x26e291[_0x78d7('0x2d')],qs[_0x78d7('0x34')](_0x1b6d78['query']['fields']));_0x5340f1[_0x78d7('0x33')]=_0x5340f1[_0x78d7('0x33')][_0x78d7('0x35')]?_0x5340f1[_0x78d7('0x33')]:_0x26e291[_0x78d7('0x2d')];if(!_0x1b6d78[_0x78d7('0x2e')][_0x78d7('0x36')]('nolimit')){_0x5340f1[_0x78d7('0x1e')]=qs[_0x78d7('0x1e')](_0x1b6d78[_0x78d7('0x2e')][_0x78d7('0x1e')]);_0x5340f1[_0x78d7('0x1d')]=qs[_0x78d7('0x1d')](_0x1b6d78[_0x78d7('0x2e')]['offset']);}_0x5340f1['order']=qs[_0x78d7('0x39')](_0x1b6d78[_0x78d7('0x2e')][_0x78d7('0x39')]);_0x5340f1['where']=qs[_0x78d7('0x32')](_[_0x78d7('0x84')](_0x1b6d78[_0x78d7('0x2e')],_0x26e291[_0x78d7('0x32')]));_0x5340f1[_0x78d7('0x3a')][_0x78d7('0x89')]=_0x2e00d5['id'];if(_0x1b6d78['query']['filter']){_0x5340f1[_0x78d7('0x3a')]=_[_0x78d7('0x3d')](_0x5340f1[_0x78d7('0x3a')],{'$or':_[_0x78d7('0x3f')](_0x5340f1[_0x78d7('0x33')],function(_0x47dbaa){var _0x36e6cb={};_0x36e6cb[_0x47dbaa]={'$like':'%'+_0x1b6d78[_0x78d7('0x2e')]['filter']+'%'};return _0x36e6cb;})});}_0x5340f1=_[_0x78d7('0x3d')]({},_0x5340f1,_0x1b6d78[_0x78d7('0x40')]);return db[_0x78d7('0x66')][_0x78d7('0x1c')]({'where':_0x5340f1[_0x78d7('0x3a')]})['then'](function(_0xc1d079){_0x482053[_0x78d7('0x1c')]=_0xc1d079;if(_0x1b6d78[_0x78d7('0x2e')][_0x78d7('0x46')]){_0x5340f1[_0x78d7('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x5340f1);})[_0x78d7('0x25')](function(_0x599323){_0x482053[_0x78d7('0x4a')]=_0x599323;return _0x482053;});}})['then'](respondWithFilteredResult(_0xf768f0,_0x5340f1))[_0x78d7('0x4e')](handleError(_0xf768f0,null));};exports[_0x78d7('0x8a')]=function(_0x22c76c,_0x4d1d05,_0x4bae36){var _0x337481={'raw':!![],'where':{}};var _0x2ab569={};var _0x450c74={'count':0x0,'rows':[]};return db[_0x78d7('0x2b')][_0x78d7('0x82')]({'where':{'id':_0x22c76c[_0x78d7('0x4d')]['id']}})[_0x78d7('0x25')](handleEntityNotFound(_0x4d1d05,null))[_0x78d7('0x25')](function(_0x201508){if(_0x201508){_0x2ab569['model']=_[_0x78d7('0x31')](db[_0x78d7('0x65')][_0x78d7('0x88')]);_0x2ab569[_0x78d7('0x2e')]=_[_0x78d7('0x31')](_0x22c76c[_0x78d7('0x2e')]);_0x2ab569['filters']=_[_0x78d7('0x83')](_0x2ab569['model'],_0x2ab569[_0x78d7('0x2e')]);_0x337481[_0x78d7('0x33')]=_['intersection'](_0x2ab569[_0x78d7('0x2d')],qs[_0x78d7('0x34')](_0x22c76c[_0x78d7('0x2e')]['fields']));_0x337481[_0x78d7('0x33')]=_0x337481[_0x78d7('0x33')][_0x78d7('0x35')]?_0x337481['attributes']:_0x2ab569[_0x78d7('0x2d')];if(!_0x22c76c['query'][_0x78d7('0x36')](_0x78d7('0x37'))){_0x337481['limit']=qs[_0x78d7('0x1e')](_0x22c76c[_0x78d7('0x2e')][_0x78d7('0x1e')]);_0x337481['offset']=qs[_0x78d7('0x1d')](_0x22c76c['query'][_0x78d7('0x1d')]);}_0x337481[_0x78d7('0x38')]=qs['sort'](_0x22c76c[_0x78d7('0x2e')][_0x78d7('0x39')]);_0x337481[_0x78d7('0x3a')]=qs[_0x78d7('0x32')](_[_0x78d7('0x84')](_0x22c76c[_0x78d7('0x2e')],_0x2ab569[_0x78d7('0x32')]));_0x337481['where']['ContactId']=_0x201508['id'];if(_0x22c76c[_0x78d7('0x2e')][_0x78d7('0x3e')]){_0x337481[_0x78d7('0x3a')]=_[_0x78d7('0x3d')](_0x337481[_0x78d7('0x3a')],{'$or':_[_0x78d7('0x3f')](_0x337481[_0x78d7('0x33')],function(_0x1b96d7){var _0x4682bf={};_0x4682bf[_0x1b96d7]={'$like':'%'+_0x22c76c[_0x78d7('0x2e')][_0x78d7('0x3e')]+'%'};return _0x4682bf;})});}_0x337481=_['merge']({},_0x337481,_0x22c76c[_0x78d7('0x40')]);return db[_0x78d7('0x65')][_0x78d7('0x1c')]({'where':_0x337481[_0x78d7('0x3a')]})[_0x78d7('0x25')](function(_0x5eb286){_0x450c74[_0x78d7('0x1c')]=_0x5eb286;if(_0x22c76c['query'][_0x78d7('0x46')]){_0x337481[_0x78d7('0x41')]=[{'all':!![]}];}return db[_0x78d7('0x65')][_0x78d7('0x49')](_0x337481);})['then'](function(_0x19f5c3){_0x450c74[_0x78d7('0x4a')]=_0x19f5c3;return _0x450c74;});}})[_0x78d7('0x25')](respondWithFilteredResult(_0x4d1d05,_0x337481))['catch'](handleError(_0x4d1d05,null));};exports[_0x78d7('0x8b')]=function(_0x1f6f0b,_0x4fda95,_0x16c36c){var _0x19775e={'raw':!![],'where':{}};var _0x29994e={};var _0x27c83b={'count':0x0,'rows':[]};return db['CmContact'][_0x78d7('0x82')]({'where':{'id':_0x1f6f0b[_0x78d7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4fda95,null))['then'](function(_0x5c29ce){if(_0x5c29ce){_0x29994e[_0x78d7('0x2d')]=_[_0x78d7('0x31')](db['JscriptySessionReport'][_0x78d7('0x88')]);_0x29994e[_0x78d7('0x2e')]=_[_0x78d7('0x31')](_0x1f6f0b['query']);_0x29994e[_0x78d7('0x32')]=_[_0x78d7('0x83')](_0x29994e[_0x78d7('0x2d')],_0x29994e[_0x78d7('0x2e')]);_0x19775e['attributes']=_[_0x78d7('0x83')](_0x29994e['model'],qs[_0x78d7('0x34')](_0x1f6f0b[_0x78d7('0x2e')][_0x78d7('0x34')]));_0x19775e[_0x78d7('0x33')]=_0x19775e[_0x78d7('0x33')][_0x78d7('0x35')]?_0x19775e['attributes']:_0x29994e[_0x78d7('0x2d')];if(!_0x1f6f0b[_0x78d7('0x2e')][_0x78d7('0x36')]('nolimit')){_0x19775e[_0x78d7('0x1e')]=qs[_0x78d7('0x1e')](_0x1f6f0b[_0x78d7('0x2e')]['limit']);_0x19775e[_0x78d7('0x1d')]=qs[_0x78d7('0x1d')](_0x1f6f0b[_0x78d7('0x2e')]['offset']);}_0x19775e[_0x78d7('0x38')]=qs[_0x78d7('0x39')](_0x1f6f0b['query']['sort']);_0x19775e['where']=qs[_0x78d7('0x32')](_[_0x78d7('0x84')](_0x1f6f0b['query'],_0x29994e[_0x78d7('0x32')]));_0x19775e[_0x78d7('0x3a')][_0x78d7('0x89')]=_0x5c29ce['id'];if(_0x1f6f0b['query']['filter']){_0x19775e[_0x78d7('0x3a')]=_[_0x78d7('0x3d')](_0x19775e[_0x78d7('0x3a')],{'$or':_[_0x78d7('0x3f')](_0x19775e['attributes'],function(_0x23d92e){var _0x39d555={};_0x39d555[_0x23d92e]={'$like':'%'+_0x1f6f0b['query'][_0x78d7('0x3e')]+'%'};return _0x39d555;})});}_0x19775e=_[_0x78d7('0x3d')]({},_0x19775e,_0x1f6f0b[_0x78d7('0x40')]);return db['JscriptySessionReport']['count']({'where':_0x19775e[_0x78d7('0x3a')]})[_0x78d7('0x25')](function(_0x3b78b3){_0x27c83b[_0x78d7('0x1c')]=_0x3b78b3;if(_0x1f6f0b[_0x78d7('0x2e')]['includeAll']){_0x19775e[_0x78d7('0x41')]=[{'all':!![]}];}return db[_0x78d7('0x8c')][_0x78d7('0x49')](_0x19775e);})[_0x78d7('0x25')](function(_0x2ba380){_0x27c83b[_0x78d7('0x4a')]=_0x2ba380;return _0x27c83b;});}})[_0x78d7('0x25')](respondWithFilteredResult(_0x4fda95,_0x19775e))['catch'](handleError(_0x4fda95,null));};exports[_0x78d7('0x8d')]=function(_0x1a9d81,_0x8466e8,_0x34633d){try{if(!_0x1a9d81[_0x78d7('0x53')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x1a9d81[_0x78d7('0x53')][_0x78d7('0x8e')]){throw new Error(_0x78d7('0x8f'));}if(!_0x1a9d81[_0x78d7('0x53')][_0x78d7('0x90')]){throw new Error(_0x78d7('0x91'));}if(!_0x1a9d81[_0x78d7('0x53')][_0x78d7('0x92')]){throw new Error(_0x78d7('0x93'));}var _0x950e50=_0x1a9d81[_0x78d7('0x53')][_0x78d7('0x8e')]['split'](',');var _0x214980=_0x1a9d81[_0x78d7('0x53')]['binding_values'][_0x78d7('0x94')](',');if(!_0x950e50[_0x78d7('0x35')]||!_0x214980[_0x78d7('0x35')]||_0x950e50['length']!==_0x214980[_0x78d7('0x35')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x1a9d81['body'][_0x78d7('0x34')]=_['zipObject'](_0x950e50,_0x214980);if(!_0x1a9d81[_0x78d7('0x53')][_0x78d7('0x34')][_0x78d7('0x81')]){throw new Error(_0x78d7('0x95'));}if(!_0x1a9d81[_0x78d7('0x53')]['fields']['firstName']){throw new Error(_0x78d7('0x96'));}var _0x223463=path[_0x78d7('0x59')](config[_0x78d7('0x97')],_0x78d7('0x98'),_0x1a9d81[_0x78d7('0x99')][_0x78d7('0x9a')]);fs[_0x78d7('0x9b')](_0x223463,parseInt(_0x78d7('0x9c'),0x8));var _0x1e8530=require('child_process')[_0x78d7('0x9d')](path[_0x78d7('0x59')](__dirname,_0x78d7('0x9e')),[_0x223463,_0x1a9d81['body'][_0x78d7('0x8e')],_0x1a9d81['body']['binding_values'],_0x1a9d81[_0x78d7('0x53')][_0x78d7('0x71')],_0x1a9d81['body'][_0x78d7('0x9f')],_0x1a9d81[_0x78d7('0x53')][_0x78d7('0x6f')],_0x1a9d81['body'][_0x78d7('0x92')]]);return _0x8466e8[_0x78d7('0x1a')](0xc8)[_0x78d7('0x1b')]({'message':_0x78d7('0xa0'),'pid':_0x1e8530['pid']});}catch(_0x53ff90){return _0x8466e8[_0x78d7('0x1a')](0x1f4)[_0x78d7('0x29')](_0x53ff90);}};exports['upload']=function(_0x34d087,_0x1e6a95,_0xab3879){var _0x3014f6=fs['createReadStream'](_0x34d087[_0x78d7('0x99')]['path']);Papa['parse'](_0x3014f6,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3b068f){return _0x1e6a95[_0x78d7('0x1a')](0xc8)[_0x78d7('0x1b')]({'file':_0x34d087['file'],'fields':_0x3b068f[_0x78d7('0xa1')]['fields']});}});};exports['import']=function(_0x2dcb08,_0x4126a8,_0x54558e){return db[_0x78d7('0xa2')][_0x78d7('0x49')]({'raw':!![],'attributes':['id'],'where':{'role':_0x78d7('0xa3')}})['then'](function(_0x2d751e){var _0x2f5d32=![];if(!_0x2dcb08[_0x78d7('0x53')]['ListId']){throw new Error(_0x78d7('0xa4'));}if(!_0x2dcb08[_0x78d7('0x53')][_0x78d7('0xa5')][_0x78d7('0x81')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2dcb08[_0x78d7('0x53')][_0x78d7('0xa5')][_0x78d7('0xa6')]){throw new Error(_0x78d7('0x96'));}if(!_0x2dcb08['body'][_0x78d7('0x92')]){throw new Error(_0x78d7('0x93'));}var _0x44a4c7=require(_0x78d7('0xa7'))[_0x78d7('0x9d')](path[_0x78d7('0x59')](__dirname,_0x78d7('0xa8')),[_0x2dcb08[_0x78d7('0x4d')]['id'],JSON[_0x78d7('0xa9')](_0x2dcb08[_0x78d7('0x53')]),JSON[_0x78d7('0xa9')](_0x2d751e)]);_0x44a4c7['on'](_0x78d7('0xaa'),function(_0x42f902){_0x2f5d32=!![];return _0x4126a8[_0x78d7('0x1a')](0xc8)[_0x78d7('0x1b')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x44a4c7['pid']});});_0x44a4c7['on'](_0x78d7('0xab'),function(_0x5dd470){if(_0x5dd470&&!_0x2f5d32){return _0x4126a8[_0x78d7('0x1a')](0x1f4)[_0x78d7('0x1b')]({'message':'error\x20child\x20process','pid':_0x44a4c7['pid']});}});})[_0x78d7('0x4e')](handleError(_0x4126a8,null));};
\ No newline at end of file
+var _0x937c=['omit','map','format','cf_%d','$and','pickBy','table','cm_contacts','setFields','id\x20=\x20?','toParam','sequelize','text','values','phone','findOne','rawAttributes','options','getTags','getHoppers','CmHopper','hasOwnProperty','ContactId','getHopperHistories','CmHopperFinal','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','parse','meta','import','agent','No\x20ListId\x20specified','No\x20phone\x20column\x20specified','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./cmContact.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','CmContact','describe','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','day','add','filter','merge','include','push','Tag','Tags','tag','distinct','includeAll','color','ThroughTags','rows','catch','params','startsWith','cf_','columnName','displayName','CmCustomField','findAll','alias','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','create','bulkCreate','each','duplicates','$or','ListId','findOrCreate','show','find'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x937c,0xf1));var _0xc937=function(_0x1dd7eb,_0x13b76a){_0x1dd7eb=_0x1dd7eb-0x0;var _0x3e6f1b=_0x937c[_0x1dd7eb];return _0x3e6f1b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc937('0x0'));var rimraf=require(_0xc937('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc937('0x2'));var rp=require(_0xc937('0x3'));var moment=require('moment');var BPromise=require(_0xc937('0x4'));var Mustache=require(_0xc937('0x5'));var util=require('util');var path=require(_0xc937('0x6'));var sox=require(_0xc937('0x7'));var csv=require(_0xc937('0x8'));var ejs=require(_0xc937('0x9'));var fs=require('fs');var _=require(_0xc937('0xa'));var squel=require('squel');var crypto=require(_0xc937('0xb'));var jsforce=require(_0xc937('0xc'));var deskjs=require(_0xc937('0xd'));var toCsv=require(_0xc937('0x8'));var querystring=require(_0xc937('0xe'));var Papa=require('papaparse');var Redis=require(_0xc937('0xf'));var qs=require(_0xc937('0x10'));var logger=require('../../config/logger')(_0xc937('0x11'));var utils=require(_0xc937('0x12'));var config=require(_0xc937('0x13'));var db=require(_0xc937('0x14'))['db'];config['redis']=_[_0xc937('0x15')](config['redis'],{'host':_0xc937('0x16'),'port':0x18eb});var socket=require(_0xc937('0x17'))(new Redis(config['redis']));require(_0xc937('0x18'))['register'](socket);function respondWithStatusCode(_0x5ec2f2,_0x2c5c90){_0x2c5c90=_0x2c5c90||0xcc;return function(_0x5c5c84){if(_0x5c5c84){return _0x5ec2f2[_0xc937('0x19')](_0x2c5c90);}return _0x5ec2f2[_0xc937('0x1a')](_0x2c5c90)[_0xc937('0x1b')]();};}function respondWithResult(_0xff62bb,_0x363654){_0x363654=_0x363654||0xc8;return function(_0x29a027){if(_0x29a027){return _0xff62bb[_0xc937('0x1a')](_0x363654)[_0xc937('0x1c')](_0x29a027);}};}function respondWithFilteredResult(_0x204888,_0x2be0f6){return function(_0xb7bdbb){if(_0xb7bdbb){var _0x5eeac4=_0xb7bdbb[_0xc937('0x1d')],_0xf1183e=_0x2be0f6[_0xc937('0x1e')],_0x5dc95a=_0x2be0f6['offset']+_0x2be0f6[_0xc937('0x1f')],_0x1a9f28;if(_0x5dc95a>=_0x5eeac4){_0x5dc95a=_0x5eeac4;_0x1a9f28=0xc8;}else{_0x1a9f28=0xce;}_0x204888[_0xc937('0x1a')](_0x1a9f28);return _0x204888[_0xc937('0x20')](_0xc937('0x21'),_0xf1183e+'-'+_0x5dc95a+'/'+_0x5eeac4)[_0xc937('0x1c')](_0xb7bdbb);}return null;};}function patchUpdates(_0x4a399e){return function(_0x30af65){try{jsonpatch[_0xc937('0x22')](_0x30af65,_0x4a399e,!![]);}catch(_0x332247){return BPromise[_0xc937('0x23')](_0x332247);}return _0x30af65[_0xc937('0x24')]();};}function saveUpdates(_0x23ab63,_0x1bfbc4){return function(_0x3f0338){if(_0x3f0338){return _0x3f0338[_0xc937('0x25')](_0x23ab63)[_0xc937('0x26')](function(_0x3ed714){return _0x3ed714;});}return null;};}function removeEntity(_0x5b9729,_0x508bb3){return function(_0x2d9f57){if(_0x2d9f57){return _0x2d9f57[_0xc937('0x27')]()[_0xc937('0x26')](function(){_0x5b9729['status'](0xcc)[_0xc937('0x1b')]();});}};}function handleEntityNotFound(_0x5e98e9,_0x3ba578){return function(_0xf282c4){if(!_0xf282c4){_0x5e98e9[_0xc937('0x19')](0x194);}return _0xf282c4;};}function handleError(_0x5dcf89,_0x5e26f6){_0x5e26f6=_0x5e26f6||0x1f4;return function(_0x42b37b){logger[_0xc937('0x28')](_0x42b37b[_0xc937('0x29')]);if(_0x42b37b[_0xc937('0x2a')]){delete _0x42b37b['name'];}_0x5dcf89['status'](_0x5e26f6)[_0xc937('0x2b')](_0x42b37b);};}exports['index']=function(_0x235d14,_0x533b08){var _0x45642b={},_0xa03c1={},_0x9b27ca={'count':0x0,'rows':[]};return db[_0xc937('0x2c')][_0xc937('0x2d')]()[_0xc937('0x26')](function(_0x32fddb){_0xa03c1[_0xc937('0x2e')]=_[_0xc937('0x2f')](_0x32fddb);var _0xdd1151={'dateStart':_0x235d14[_0xc937('0x30')][_0xc937('0x31')],'dateEnd':_0x235d14[_0xc937('0x30')][_0xc937('0x32')]};delete _0x235d14[_0xc937('0x30')][_0xc937('0x31')];delete _0x235d14[_0xc937('0x30')]['dateEnd'];_0xa03c1[_0xc937('0x30')]=_[_0xc937('0x2f')](_0x235d14[_0xc937('0x30')]);_0xa03c1[_0xc937('0x33')]=_['intersection'](_0xa03c1[_0xc937('0x2e')],_0xa03c1['query']);_0x45642b['attributes']=_[_0xc937('0x34')](_0xa03c1[_0xc937('0x2e')],qs[_0xc937('0x35')](_0x235d14[_0xc937('0x30')][_0xc937('0x35')]));_0x45642b[_0xc937('0x36')]=_0x45642b['attributes'][_0xc937('0x37')]?_0x45642b[_0xc937('0x36')]:_0xa03c1[_0xc937('0x2e')];if(!_0x235d14[_0xc937('0x30')]['hasOwnProperty'](_0xc937('0x38'))){_0x45642b[_0xc937('0x1f')]=qs[_0xc937('0x1f')](_0x235d14[_0xc937('0x30')][_0xc937('0x1f')]);_0x45642b['offset']=qs[_0xc937('0x1e')](_0x235d14[_0xc937('0x30')][_0xc937('0x1e')]);}_0x45642b[_0xc937('0x39')]=qs[_0xc937('0x3a')](_0x235d14[_0xc937('0x30')][_0xc937('0x3a')]);_0x45642b[_0xc937('0x3b')]=qs[_0xc937('0x33')](_[_0xc937('0x3c')](_0x235d14[_0xc937('0x30')],_0xa03c1[_0xc937('0x33')]));if(_0xdd1151[_0xc937('0x31')]){if(_0xdd1151[_0xc937('0x32')]){_0xdd1151[_0xc937('0x32')]=moment(_0xdd1151[_0xc937('0x32')])['add'](0x1,_0xc937('0x3d'));}else{_0xdd1151[_0xc937('0x32')]=moment(_0xdd1151[_0xc937('0x31')])[_0xc937('0x3e')](0x1,_0xc937('0x3d'));}_['merge'](_0x45642b[_0xc937('0x3b')],{'createdAt':{'$gte':_0xdd1151[_0xc937('0x31')],'$lte':_0xdd1151[_0xc937('0x32')]}});}if(_0x235d14[_0xc937('0x30')][_0xc937('0x3f')]){_0x45642b[_0xc937('0x3b')]=_[_0xc937('0x40')](_0x45642b[_0xc937('0x3b')],{'$or':_['map'](_0x45642b[_0xc937('0x36')],function(_0x510e61){var _0x46404f={};_0x46404f[_0x510e61]={'$like':'%'+_0x235d14['query']['filter']+'%'};return _0x46404f;})});}_0x45642b=_['merge']({},_0x45642b,_0x235d14['options']);var _0x42580f={'where':_0x45642b[_0xc937('0x3b')]};_0x42580f[_0xc937('0x41')]=[];if(_0x235d14['query']['tag']){_0x42580f[_0xc937('0x41')][_0xc937('0x42')]({'model':db[_0xc937('0x43')],'as':_0xc937('0x44'),'attributes':['id'],'where':{'id':_0x235d14['query'][_0xc937('0x45')]},'required':!![]});_0x42580f[_0xc937('0x46')]=!![];}return db[_0xc937('0x2c')][_0xc937('0x1d')](_0x42580f)[_0xc937('0x26')](function(_0x249d24){_0x9b27ca[_0xc937('0x1d')]=_0x249d24;if(_0x235d14[_0xc937('0x30')][_0xc937('0x47')]){_0x45642b[_0xc937('0x41')]=[{'model':db['Tag'],'as':_0xc937('0x44'),'attributes':['id',_0xc937('0x2a'),_0xc937('0x48')],'required':_0x235d14[_0xc937('0x30')][_0xc937('0x45')]?!![]:![]},{'model':db[_0xc937('0x43')],'as':_0xc937('0x49'),'attributes':['id',_0xc937('0x2a'),_0xc937('0x48')],'through':_0x235d14['query']['tag']?{'attributes':[],'where':{'TagId':_0x235d14['query']['tag']||undefined}}:{},'required':_0x235d14[_0xc937('0x30')][_0xc937('0x45')]?!![]:![]}];}return db['CmContact']['findAll'](_0x45642b);})[_0xc937('0x26')](function(_0x33a718){_0x9b27ca[_0xc937('0x4a')]=_0x33a718;return _0x9b27ca;})[_0xc937('0x26')](respondWithFilteredResult(_0x533b08,_0x45642b))[_0xc937('0x4b')](handleError(_0x533b08,null));});};exports[_0xc937('0x27')]=function(_0x543dc8,_0x4a0ec8){return db[_0xc937('0x2c')]['find']({'where':{'id':_0x543dc8[_0xc937('0x4c')]['id']}})[_0xc937('0x26')](handleEntityNotFound(_0x4a0ec8,null))[_0xc937('0x26')](removeEntity(_0x4a0ec8,null))[_0xc937('0x4b')](handleError(_0x4a0ec8,null));};exports['describe']=function(_0x450598,_0x6f58e7){return db[_0xc937('0x2c')]['describe']()['then'](function(_0x5fc0aa){for(var _0x5762cf=0x0;_0x5762cf<Object[_0xc937('0x2f')](_0x5fc0aa)[_0xc937('0x37')];_0x5762cf++){var _0xaf9164=Object[_0xc937('0x2f')](_0x5fc0aa)[_0x5762cf];if(!_[_0xc937('0x4d')](_0xaf9164,_0xc937('0x4e'))){_0x5fc0aa[_0xaf9164][_0xc937('0x4f')]=_0xaf9164;_0x5fc0aa[_0xaf9164][_0xc937('0x50')]=_0xaf9164;}}return _0x5fc0aa;})[_0xc937('0x26')](function(_0x205859){var _0x485153={'where':{'$or':[{'ListId':_0x450598[_0xc937('0x30')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xc937('0x51')][_0xc937('0x52')](_0x485153)['then'](function(_0x476ace){for(var _0x24efd1=0x0;_0x24efd1<_0x476ace['length'];_0x24efd1++){var _0x53c6de=_0xc937('0x4e')+_0x476ace[_0x24efd1]['id'];_0x205859[_0x53c6de]['columnName']=_0x53c6de;_0x205859[_0x53c6de][_0xc937('0x50')]=_0x476ace[_0x24efd1][_0xc937('0x53')];}for(var _0x24efd1=0x0;_0x24efd1<Object[_0xc937('0x2f')](_0x205859)[_0xc937('0x37')];_0x24efd1++){var _0x53c6de=Object[_0xc937('0x2f')](_0x205859)[_0x24efd1];if(!_0x205859[_0x53c6de]['hasOwnProperty']('columnName')){delete _0x205859[_0x53c6de];}}return _0x205859;});})['then'](respondWithResult(_0x6f58e7,null))[_0xc937('0x4b')](handleError(_0x6f58e7,null));};exports[_0xc937('0x40')]=function(_0x481b24,_0x54cf22){var _0x5109b0;var _0x3688cc;var _0x2c2d5a;if(_0x481b24[_0xc937('0x54')]['id']){delete _0x481b24[_0xc937('0x54')]['id'];}return db[_0xc937('0x2c')][_0xc937('0x52')]({'where':{'id':[_0x481b24['body']['to'],_0x481b24[_0xc937('0x54')]['from']]}})[_0xc937('0x26')](function(_0x180714){if(_0x180714){if(_0x180714[_0xc937('0x37')]!==0x2){return null;}_0x180714[0x0]=_0x180714[0x0][_0xc937('0x55')]({'plain':!![]});_0x180714[0x1]=_0x180714[0x1][_0xc937('0x55')]({'plain':!![]});delete _0x180714[0x0]['id'];delete _0x180714[0x1]['id'];return _[_0xc937('0x56')](_0x180714[0x0],_0x180714[0x1],function(_0xae0c7,_0x10eba5){if(Array[_0xc937('0x57')](_0x10eba5)&&!_0x10eba5[_0xc937('0x37')]){return _0xae0c7;}else if(!_0x10eba5){return _0xae0c7;}});}})['then'](handleEntityNotFound(_0x54cf22,null))[_0xc937('0x26')](function(_0x5bc5b0){if(_0x5bc5b0){if(_0x5bc5b0[_0xc937('0x58')]&&_[_0xc937('0x57')](_0x5bc5b0[_0xc937('0x58')])){_0x5bc5b0['tags']=_0x5bc5b0[_0xc937('0x58')][_0xc937('0x59')]();}logger[_0xc937('0x5a')](_0xc937('0x5b'),_0x481b24[_0xc937('0x54')]['to'],_0x481b24[_0xc937('0x54')][_0xc937('0x5c')]);return db['CmHopper'][_0xc937('0x27')]({'where':{'ContactId':[_0x481b24[_0xc937('0x54')]['to'],_0x481b24['body'][_0xc937('0x5c')]]}})[_0xc937('0x26')](function(_0x10afd3){logger[_0xc937('0x5a')](_0xc937('0x5d'),_0x10afd3);return db[_0xc937('0x5e')][_0xc937('0x27')]({'where':{'ContactId':[_0x481b24[_0xc937('0x54')]['to'],_0x481b24[_0xc937('0x54')][_0xc937('0x5c')]]}})[_0xc937('0x26')](function(_0x308d46){logger['info']('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x308d46);return db[_0xc937('0x2c')]['create'](_0x5bc5b0);});});}})[_0xc937('0x26')](function(_0x270df9){if(_0x270df9){_0x5109b0=_0x270df9;_0x3688cc={'ContactId':_0x5109b0['id']};_0x2c2d5a={'where':{'ContactId':[_0x481b24[_0xc937('0x54')]['to'],_0x481b24[_0xc937('0x54')]['from']]}};return db['ChatInteraction']['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x5f')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x60')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})['then'](function(){if(_0x5109b0){return db[_0xc937('0x61')]['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x62')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x61')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x62')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x63')]['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x64')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})['then'](function(){if(_0x5109b0){return db[_0xc937('0x65')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x66')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x67')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db['OpenchannelMessage'][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db['CmHopperFinal'][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x68')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})['then'](function(){if(_0x5109b0){return db[_0xc937('0x69')]['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x6a')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x6b')]['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x6c')]['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x6d')]['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db[_0xc937('0x6e')][_0xc937('0x25')](_0x3688cc,_0x2c2d5a);}})['then'](function(){if(_0x5109b0){return db[_0xc937('0x6f')]['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db['JscriptySessionReport']['update'](_0x3688cc,_0x2c2d5a);}})[_0xc937('0x26')](function(){if(_0x5109b0){return db['CmContact']['destroy']({'where':{'id':[_0x481b24[_0xc937('0x54')]['to'],_0x481b24[_0xc937('0x54')]['from']]}});}})[_0xc937('0x26')](function(){if(_0x5109b0){return _0x5109b0;}})[_0xc937('0x26')](respondWithResult(_0x54cf22,null))[_0xc937('0x4b')](handleError(_0x54cf22,null));};exports['create']=function(_0x5a7ee5,_0x14c589){return db[_0xc937('0x2c')]['describe']()[_0xc937('0x26')](function(_0xdbac7e){if(_0x5a7ee5[_0xc937('0x54')]['tags']&&_[_0xc937('0x57')](_0x5a7ee5[_0xc937('0x54')][_0xc937('0x58')])){if(_0x5a7ee5[_0xc937('0x54')]['tags'][_0xc937('0x37')]){_0x5a7ee5['body'][_0xc937('0x58')]=_0x5a7ee5[_0xc937('0x54')][_0xc937('0x58')][_0xc937('0x59')](';')+';';}else{_0x5a7ee5['body'][_0xc937('0x58')]=null;}}else{_0x5a7ee5[_0xc937('0x54')][_0xc937('0x58')]=null;}return db[_0xc937('0x2c')][_0xc937('0x70')](_0x5a7ee5[_0xc937('0x54')],{'fields':_[_0xc937('0x2f')](_0xdbac7e),'raw':!![]});})[_0xc937('0x26')](respondWithResult(_0x14c589,0xc9))[_0xc937('0x4b')](handleError(_0x14c589,null));};exports[_0xc937('0x71')]=function(_0x4e44e8,_0x28d43e){var _0x170383=[];var _0x4816c2=0x0;var _0x461691=0x0;var _0x38771e=0x0;return db['CmContact'][_0xc937('0x2d')]()[_0xc937('0x26')](function(_0x3f6807){return BPromise[_0xc937('0x72')](_0x4e44e8['body'],function(_0x31ecc8){var _0x26f238={'where':{'$or':[]},'defaults':_0x31ecc8,'fields':_[_0xc937('0x2f')](_0x3f6807),'raw':!![]};if(_0x31ecc8[_0xc937('0x73')]){for(var _0x2606e2=0x0;_0x2606e2<_0x31ecc8[_0xc937('0x73')][_0xc937('0x37')];_0x2606e2++){var _0x58e7ce={};_0x58e7ce[_0x31ecc8[_0xc937('0x73')][_0x2606e2]]=_0x31ecc8[_0x31ecc8['duplicates'][_0x2606e2]];_0x26f238['where'][_0xc937('0x74')]['push'](_0x58e7ce);}_0x26f238[_0xc937('0x3b')]['ListId']=_0x31ecc8[_0xc937('0x75')];}return db[_0xc937('0x2c')][_0xc937('0x76')](_0x26f238)['spread'](function(_0x3a45f4,_0x21fee0){if(_0x21fee0){_0x4816c2++;}else{_0x38771e++;}})['catch'](function(_0x5638a3){console['error'](_0x5638a3);_0x461691++;});});})[_0xc937('0x26')](function(_0x4cee13){if(_0x4cee13){return{'success':_0x4816c2,'failure':_0x461691,'duplicates':_0x38771e};}})[_0xc937('0x26')](respondWithResult(_0x28d43e,0xc9))[_0xc937('0x4b')](handleError(_0x28d43e,null));};exports[_0xc937('0x77')]=function(_0x51c87e,_0x5e2a2f,_0x1d5ea0){var _0x2a5936;return db[_0xc937('0x2c')][_0xc937('0x2d')]()['then'](function(_0x2f84cb){return db[_0xc937('0x2c')][_0xc937('0x78')]({'where':{'id':_0x51c87e[_0xc937('0x4c')]['id']},'include':[{'model':db['Tag'],'as':_0xc937('0x44'),'attributes':['id','name',_0xc937('0x48')],'required':_0x51c87e[_0xc937('0x30')][_0xc937('0x45')]?!![]:![]}],'attributes':_['keys'](_0x2f84cb)});})[_0xc937('0x26')](function(_0x127385){_0x2a5936=_0x127385[_0xc937('0x55')]({'plain':!![]});var _0xe2a5b6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x127385&&_0x127385[_0xc937('0x75')]){if(_0x127385['ListId']){_0xe2a5b6[_0xc937('0x3b')]['$and'][_0xc937('0x42')]({'ListId':{'$ne':_0x127385['ListId']}});}}return db[_0xc937('0x51')][_0xc937('0x52')](_0xe2a5b6);})[_0xc937('0x26')](function(_0x4829d4){return _[_0xc937('0x79')](_0x2a5936,_[_0xc937('0x7a')](_0x4829d4,function(_0x269575){return util[_0xc937('0x7b')](_0xc937('0x7c'),_0x269575['id']);}));})['then'](handleEntityNotFound(_0x5e2a2f,null))[_0xc937('0x26')](respondWithResult(_0x5e2a2f,null))[_0xc937('0x4b')](handleError(_0x5e2a2f,null));};exports[_0xc937('0x25')]=function(_0x3fd20d,_0x154af4){var _0x3e3922;if(_0x3fd20d[_0xc937('0x54')]['id']){delete _0x3fd20d[_0xc937('0x54')]['id'];}return db[_0xc937('0x2c')][_0xc937('0x78')]({'where':{'id':_0x3fd20d['params']['id']}})[_0xc937('0x26')](handleEntityNotFound(_0x154af4,null))[_0xc937('0x26')](saveUpdates(_0x3fd20d[_0xc937('0x54')],null))[_0xc937('0x26')](function(_0x518c6a){_0x3e3922=_0x518c6a;var _0x2118f9={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x518c6a&&_0x518c6a['ListId']){if(_0x518c6a[_0xc937('0x75')]){_0x2118f9[_0xc937('0x3b')][_0xc937('0x7d')][_0xc937('0x42')]({'ListId':{'$ne':_0x518c6a[_0xc937('0x75')]}});}}return db[_0xc937('0x51')][_0xc937('0x52')](_0x2118f9);})['then'](function(_0x5521a4){if(_0x5521a4){return _[_0xc937('0x79')](_[_0xc937('0x7e')](_0x3fd20d['body'],function(_0x4b0797,_0x576511){return _[_0xc937('0x4d')](_0x576511,'cf_');}),_[_0xc937('0x7a')](_0x5521a4,function(_0x25d026){return util[_0xc937('0x7b')](_0xc937('0x7c'),_0x25d026['id']);}));}})[_0xc937('0x26')](function(_0x5b0f15){if(_0x5b0f15&&!_['isEmpty'](_0x5b0f15)){var _0x44a406=squel[_0xc937('0x25')]()[_0xc937('0x7f')](_0xc937('0x80'))[_0xc937('0x81')](_0x5b0f15)[_0xc937('0x3b')](_0xc937('0x82'),_0x3fd20d[_0xc937('0x4c')]['id'])[_0xc937('0x83')]();return db[_0xc937('0x84')][_0xc937('0x30')](_0x44a406[_0xc937('0x85')],{'replacements':_0x44a406[_0xc937('0x86')]});}})[_0xc937('0x26')](function(){if(_0x3fd20d[_0xc937('0x54')][_0xc937('0x87')]&&_0x3e3922){return db['CmHopper'][_0xc937('0x25')]({'phone':_0x3fd20d['body'][_0xc937('0x87')]},{'where':{'ContactId':_0x3e3922['id']}});}})['then'](function(){return _0x3e3922;})[_0xc937('0x26')](respondWithResult(_0x154af4,null))[_0xc937('0x4b')](handleError(_0x154af4,null));};exports['getTags']=function(_0x5db0c3,_0x422ec2,_0x485bdd){var _0x23cb58={};var _0x5e4200={};var _0x4b23a7;var _0x5e5899;return db[_0xc937('0x2c')][_0xc937('0x88')]({'where':{'id':_0x5db0c3[_0xc937('0x4c')]['id']}})[_0xc937('0x26')](handleEntityNotFound(_0x422ec2,null))[_0xc937('0x26')](function(_0x950935){if(_0x950935){_0x4b23a7=_0x950935;_0x5e4200[_0xc937('0x2e')]=_[_0xc937('0x2f')](db['Tag'][_0xc937('0x89')]);_0x5e4200[_0xc937('0x30')]=_[_0xc937('0x2f')](_0x5db0c3[_0xc937('0x30')]);_0x5e4200['filters']=_[_0xc937('0x34')](_0x5e4200[_0xc937('0x2e')],_0x5e4200[_0xc937('0x30')]);_0x23cb58[_0xc937('0x36')]=_[_0xc937('0x34')](_0x5e4200['model'],qs[_0xc937('0x35')](_0x5db0c3[_0xc937('0x30')][_0xc937('0x35')]));_0x23cb58[_0xc937('0x36')]=_0x23cb58[_0xc937('0x36')]['length']?_0x23cb58['attributes']:_0x5e4200[_0xc937('0x2e')];_0x23cb58[_0xc937('0x39')]=qs[_0xc937('0x3a')](_0x5db0c3['query'][_0xc937('0x3a')]);_0x23cb58['where']=qs[_0xc937('0x33')](_['pick'](_0x5db0c3[_0xc937('0x30')],_0x5e4200['filters']));if(_0x5db0c3[_0xc937('0x30')][_0xc937('0x3f')]){_0x23cb58[_0xc937('0x3b')]=_[_0xc937('0x40')](_0x23cb58[_0xc937('0x3b')],{'$or':_[_0xc937('0x7a')](_0x23cb58[_0xc937('0x36')],function(_0x4035c9){var _0x3bdfcf={};_0x3bdfcf[_0x4035c9]={'$like':'%'+_0x5db0c3[_0xc937('0x30')][_0xc937('0x3f')]+'%'};return _0x3bdfcf;})});}_0x23cb58=_[_0xc937('0x40')]({},_0x23cb58,_0x5db0c3[_0xc937('0x8a')]);return _0x4b23a7[_0xc937('0x8b')](_0x23cb58);}})[_0xc937('0x26')](function(_0x3b59b5){if(_0x3b59b5){_0x5e5899=_0x3b59b5[_0xc937('0x37')];if(!_0x5db0c3[_0xc937('0x30')]['hasOwnProperty'](_0xc937('0x38'))){_0x23cb58[_0xc937('0x1f')]=qs['limit'](_0x5db0c3[_0xc937('0x30')]['limit']);_0x23cb58[_0xc937('0x1e')]=qs[_0xc937('0x1e')](_0x5db0c3['query'][_0xc937('0x1e')]);}return _0x4b23a7[_0xc937('0x8b')](_0x23cb58);}})[_0xc937('0x26')](function(_0x4ffcfe){if(_0x4ffcfe){return _0x4ffcfe?{'count':_0x5e5899,'rows':_0x4ffcfe}:null;}})['then'](respondWithResult(_0x422ec2,null))[_0xc937('0x4b')](handleError(_0x422ec2,null));};exports['setTags']=function(_0x4c6366,_0x1b953b,_0xb90688){if(_0x4c6366[_0xc937('0x54')]['id']){delete _0x4c6366[_0xc937('0x54')]['id'];}return db[_0xc937('0x2c')][_0xc937('0x88')]({'where':{'id':_0x4c6366['params']['id']}})[_0xc937('0x26')](handleEntityNotFound(_0x1b953b,null))[_0xc937('0x26')](function(_0x195dd3){if(_0x195dd3){return _0x195dd3['setTags'](_0x4c6366[_0xc937('0x54')]['ids']||[]);}return null;})['then'](respondWithResult(_0x1b953b,null))[_0xc937('0x4b')](handleError(_0x1b953b,null));};exports[_0xc937('0x8c')]=function(_0x50bf69,_0x412e53,_0x1cf07d){var _0x13831e={'raw':![],'where':{}};var _0x344ab2={};var _0x8da493={'count':0x0,'rows':[]};return db['CmContact'][_0xc937('0x88')]({'where':{'id':_0x50bf69[_0xc937('0x4c')]['id']}})[_0xc937('0x26')](handleEntityNotFound(_0x412e53,null))[_0xc937('0x26')](function(_0x83b646){if(_0x83b646){_0x344ab2[_0xc937('0x2e')]=_[_0xc937('0x2f')](db[_0xc937('0x8d')][_0xc937('0x89')]);_0x344ab2[_0xc937('0x30')]=_[_0xc937('0x2f')](_0x50bf69[_0xc937('0x30')]);_0x344ab2[_0xc937('0x33')]=_[_0xc937('0x34')](_0x344ab2[_0xc937('0x2e')],_0x344ab2['query']);_0x13831e[_0xc937('0x36')]=_[_0xc937('0x34')](_0x344ab2['model'],qs[_0xc937('0x35')](_0x50bf69[_0xc937('0x30')][_0xc937('0x35')]));_0x13831e[_0xc937('0x36')]=_0x13831e[_0xc937('0x36')]['length']?_0x13831e['attributes']:_0x344ab2['model'];if(!_0x50bf69['query'][_0xc937('0x8e')](_0xc937('0x38'))){_0x13831e[_0xc937('0x1f')]=qs['limit'](_0x50bf69[_0xc937('0x30')][_0xc937('0x1f')]);_0x13831e[_0xc937('0x1e')]=qs[_0xc937('0x1e')](_0x50bf69[_0xc937('0x30')][_0xc937('0x1e')]);}_0x13831e[_0xc937('0x39')]=qs[_0xc937('0x3a')](_0x50bf69[_0xc937('0x30')][_0xc937('0x3a')]);_0x13831e[_0xc937('0x3b')]=qs[_0xc937('0x33')](_[_0xc937('0x3c')](_0x50bf69[_0xc937('0x30')],_0x344ab2[_0xc937('0x33')]));_0x13831e[_0xc937('0x3b')][_0xc937('0x8f')]=_0x83b646['id'];if(_0x50bf69[_0xc937('0x30')][_0xc937('0x3f')]){_0x13831e[_0xc937('0x3b')]=_[_0xc937('0x40')](_0x13831e[_0xc937('0x3b')],{'$or':_[_0xc937('0x7a')](_0x13831e[_0xc937('0x36')],function(_0x3ed064){var _0x30e1cf={};_0x30e1cf[_0x3ed064]={'$like':'%'+_0x50bf69[_0xc937('0x30')]['filter']+'%'};return _0x30e1cf;})});}_0x13831e=_[_0xc937('0x40')]({},_0x13831e,_0x50bf69[_0xc937('0x8a')]);return db[_0xc937('0x8d')][_0xc937('0x1d')]({'where':_0x13831e['where']})[_0xc937('0x26')](function(_0x41cc8f){_0x8da493[_0xc937('0x1d')]=_0x41cc8f;if(_0x50bf69['query'][_0xc937('0x47')]){_0x13831e[_0xc937('0x41')]=[{'all':!![]}];}return db[_0xc937('0x8d')][_0xc937('0x52')](_0x13831e);})['then'](function(_0x114f54){_0x8da493[_0xc937('0x4a')]=_0x114f54;return _0x8da493;});}})['then'](respondWithFilteredResult(_0x412e53,_0x13831e))[_0xc937('0x4b')](handleError(_0x412e53,null));};exports[_0xc937('0x90')]=function(_0x306048,_0x7828ed,_0x256ff4){var _0x159236={'raw':!![],'where':{}};var _0x4c9bcd={};var _0x516b38={'count':0x0,'rows':[]};return db[_0xc937('0x2c')][_0xc937('0x88')]({'where':{'id':_0x306048['params']['id']}})['then'](handleEntityNotFound(_0x7828ed,null))[_0xc937('0x26')](function(_0x18add6){if(_0x18add6){_0x4c9bcd[_0xc937('0x2e')]=_['keys'](db[_0xc937('0x68')]['rawAttributes']);_0x4c9bcd[_0xc937('0x30')]=_['keys'](_0x306048[_0xc937('0x30')]);_0x4c9bcd[_0xc937('0x33')]=_['intersection'](_0x4c9bcd['model'],_0x4c9bcd[_0xc937('0x30')]);_0x159236['attributes']=_[_0xc937('0x34')](_0x4c9bcd[_0xc937('0x2e')],qs[_0xc937('0x35')](_0x306048['query']['fields']));_0x159236[_0xc937('0x36')]=_0x159236['attributes'][_0xc937('0x37')]?_0x159236['attributes']:_0x4c9bcd[_0xc937('0x2e')];if(!_0x306048[_0xc937('0x30')][_0xc937('0x8e')]('nolimit')){_0x159236[_0xc937('0x1f')]=qs[_0xc937('0x1f')](_0x306048['query'][_0xc937('0x1f')]);_0x159236[_0xc937('0x1e')]=qs['offset'](_0x306048[_0xc937('0x30')][_0xc937('0x1e')]);}_0x159236[_0xc937('0x39')]=qs['sort'](_0x306048[_0xc937('0x30')][_0xc937('0x3a')]);_0x159236[_0xc937('0x3b')]=qs['filters'](_[_0xc937('0x3c')](_0x306048[_0xc937('0x30')],_0x4c9bcd[_0xc937('0x33')]));_0x159236[_0xc937('0x3b')][_0xc937('0x8f')]=_0x18add6['id'];if(_0x306048[_0xc937('0x30')][_0xc937('0x3f')]){_0x159236[_0xc937('0x3b')]=_[_0xc937('0x40')](_0x159236[_0xc937('0x3b')],{'$or':_[_0xc937('0x7a')](_0x159236['attributes'],function(_0x1eb94c){var _0x4c047b={};_0x4c047b[_0x1eb94c]={'$like':'%'+_0x306048[_0xc937('0x30')][_0xc937('0x3f')]+'%'};return _0x4c047b;})});}_0x159236=_['merge']({},_0x159236,_0x306048[_0xc937('0x8a')]);return db['CmHopperHistory'][_0xc937('0x1d')]({'where':_0x159236[_0xc937('0x3b')]})[_0xc937('0x26')](function(_0x2dae9d){_0x516b38[_0xc937('0x1d')]=_0x2dae9d;if(_0x306048['query']['includeAll']){_0x159236[_0xc937('0x41')]=[{'all':!![]}];}return db[_0xc937('0x68')][_0xc937('0x52')](_0x159236);})[_0xc937('0x26')](function(_0x11559d){_0x516b38['rows']=_0x11559d;return _0x516b38;});}})['then'](respondWithFilteredResult(_0x7828ed,_0x159236))[_0xc937('0x4b')](handleError(_0x7828ed,null));};exports['getHopperFinals']=function(_0x49f2ce,_0x1b7cbe,_0x48735a){var _0x923be4={'raw':!![],'where':{}};var _0x162dd2={};var _0x410d26={'count':0x0,'rows':[]};return db[_0xc937('0x2c')][_0xc937('0x88')]({'where':{'id':_0x49f2ce[_0xc937('0x4c')]['id']}})[_0xc937('0x26')](handleEntityNotFound(_0x1b7cbe,null))[_0xc937('0x26')](function(_0x1a7edd){if(_0x1a7edd){_0x162dd2['model']=_[_0xc937('0x2f')](db[_0xc937('0x91')][_0xc937('0x89')]);_0x162dd2[_0xc937('0x30')]=_[_0xc937('0x2f')](_0x49f2ce['query']);_0x162dd2[_0xc937('0x33')]=_[_0xc937('0x34')](_0x162dd2[_0xc937('0x2e')],_0x162dd2[_0xc937('0x30')]);_0x923be4['attributes']=_[_0xc937('0x34')](_0x162dd2['model'],qs['fields'](_0x49f2ce[_0xc937('0x30')][_0xc937('0x35')]));_0x923be4[_0xc937('0x36')]=_0x923be4[_0xc937('0x36')]['length']?_0x923be4[_0xc937('0x36')]:_0x162dd2[_0xc937('0x2e')];if(!_0x49f2ce[_0xc937('0x30')][_0xc937('0x8e')]('nolimit')){_0x923be4[_0xc937('0x1f')]=qs['limit'](_0x49f2ce['query'][_0xc937('0x1f')]);_0x923be4[_0xc937('0x1e')]=qs[_0xc937('0x1e')](_0x49f2ce[_0xc937('0x30')]['offset']);}_0x923be4[_0xc937('0x39')]=qs[_0xc937('0x3a')](_0x49f2ce['query'][_0xc937('0x3a')]);_0x923be4['where']=qs[_0xc937('0x33')](_['pick'](_0x49f2ce[_0xc937('0x30')],_0x162dd2[_0xc937('0x33')]));_0x923be4['where']['ContactId']=_0x1a7edd['id'];if(_0x49f2ce[_0xc937('0x30')][_0xc937('0x3f')]){_0x923be4['where']=_['merge'](_0x923be4['where'],{'$or':_[_0xc937('0x7a')](_0x923be4[_0xc937('0x36')],function(_0x5393e1){var _0xd62e8e={};_0xd62e8e[_0x5393e1]={'$like':'%'+_0x49f2ce['query'][_0xc937('0x3f')]+'%'};return _0xd62e8e;})});}_0x923be4=_['merge']({},_0x923be4,_0x49f2ce[_0xc937('0x8a')]);return db['CmHopperFinal'][_0xc937('0x1d')]({'where':_0x923be4[_0xc937('0x3b')]})['then'](function(_0x465d86){_0x410d26[_0xc937('0x1d')]=_0x465d86;if(_0x49f2ce['query']['includeAll']){_0x923be4[_0xc937('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xc937('0x52')](_0x923be4);})[_0xc937('0x26')](function(_0xbc2d6b){_0x410d26[_0xc937('0x4a')]=_0xbc2d6b;return _0x410d26;});}})[_0xc937('0x26')](respondWithFilteredResult(_0x1b7cbe,_0x923be4))[_0xc937('0x4b')](handleError(_0x1b7cbe,null));};exports[_0xc937('0x92')]=function(_0x5724e1,_0x2f7f4f,_0x2dcd70){var _0x261cde={'raw':!![],'where':{}};var _0x872c3b={};var _0x255a29={'count':0x0,'rows':[]};return db[_0xc937('0x2c')][_0xc937('0x88')]({'where':{'id':_0x5724e1[_0xc937('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f7f4f,null))[_0xc937('0x26')](function(_0x4ceb3d){if(_0x4ceb3d){_0x872c3b[_0xc937('0x2e')]=_['keys'](db['JscriptySessionReport'][_0xc937('0x89')]);_0x872c3b[_0xc937('0x30')]=_[_0xc937('0x2f')](_0x5724e1[_0xc937('0x30')]);_0x872c3b[_0xc937('0x33')]=_['intersection'](_0x872c3b['model'],_0x872c3b[_0xc937('0x30')]);_0x261cde['attributes']=_[_0xc937('0x34')](_0x872c3b['model'],qs[_0xc937('0x35')](_0x5724e1[_0xc937('0x30')][_0xc937('0x35')]));_0x261cde[_0xc937('0x36')]=_0x261cde[_0xc937('0x36')]['length']?_0x261cde[_0xc937('0x36')]:_0x872c3b[_0xc937('0x2e')];if(!_0x5724e1['query'][_0xc937('0x8e')](_0xc937('0x38'))){_0x261cde[_0xc937('0x1f')]=qs[_0xc937('0x1f')](_0x5724e1['query']['limit']);_0x261cde[_0xc937('0x1e')]=qs[_0xc937('0x1e')](_0x5724e1[_0xc937('0x30')]['offset']);}_0x261cde[_0xc937('0x39')]=qs[_0xc937('0x3a')](_0x5724e1[_0xc937('0x30')][_0xc937('0x3a')]);_0x261cde[_0xc937('0x3b')]=qs[_0xc937('0x33')](_[_0xc937('0x3c')](_0x5724e1[_0xc937('0x30')],_0x872c3b[_0xc937('0x33')]));_0x261cde[_0xc937('0x3b')][_0xc937('0x8f')]=_0x4ceb3d['id'];if(_0x5724e1[_0xc937('0x30')][_0xc937('0x3f')]){_0x261cde[_0xc937('0x3b')]=_['merge'](_0x261cde[_0xc937('0x3b')],{'$or':_[_0xc937('0x7a')](_0x261cde[_0xc937('0x36')],function(_0x30b5b5){var _0x26493e={};_0x26493e[_0x30b5b5]={'$like':'%'+_0x5724e1[_0xc937('0x30')][_0xc937('0x3f')]+'%'};return _0x26493e;})});}_0x261cde=_[_0xc937('0x40')]({},_0x261cde,_0x5724e1['options']);return db['JscriptySessionReport'][_0xc937('0x1d')]({'where':_0x261cde['where']})[_0xc937('0x26')](function(_0x58beb7){_0x255a29[_0xc937('0x1d')]=_0x58beb7;if(_0x5724e1[_0xc937('0x30')][_0xc937('0x47')]){_0x261cde[_0xc937('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xc937('0x52')](_0x261cde);})['then'](function(_0x438c5c){_0x255a29[_0xc937('0x4a')]=_0x438c5c;return _0x255a29;});}})[_0xc937('0x26')](respondWithFilteredResult(_0x2f7f4f,_0x261cde))[_0xc937('0x4b')](handleError(_0x2f7f4f,null));};exports[_0xc937('0x93')]=function(_0x2dfc7d,_0xbce0a8,_0x4ecfcf){try{if(!_0x2dfc7d[_0xc937('0x54')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x2dfc7d[_0xc937('0x54')][_0xc937('0x94')]){throw new Error(_0xc937('0x95'));}if(!_0x2dfc7d['body'][_0xc937('0x96')]){throw new Error(_0xc937('0x97'));}if(!_0x2dfc7d[_0xc937('0x54')][_0xc937('0x98')]){throw new Error(_0xc937('0x99'));}var _0x46ac45=_0x2dfc7d[_0xc937('0x54')][_0xc937('0x94')]['split'](',');var _0x25007b=_0x2dfc7d['body'][_0xc937('0x96')][_0xc937('0x9a')](',');if(!_0x46ac45[_0xc937('0x37')]||!_0x25007b['length']||_0x46ac45[_0xc937('0x37')]!==_0x25007b['length']){throw new Error(_0xc937('0x9b'));}_0x2dfc7d['body'][_0xc937('0x35')]=_[_0xc937('0x9c')](_0x46ac45,_0x25007b);if(!_0x2dfc7d[_0xc937('0x54')][_0xc937('0x35')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2dfc7d[_0xc937('0x54')]['fields'][_0xc937('0x9d')]){throw new Error(_0xc937('0x9e'));}var _0x4816df=path['join'](config[_0xc937('0x9f')],_0xc937('0xa0'),_0x2dfc7d[_0xc937('0xa1')][_0xc937('0xa2')]);fs['chmodSync'](_0x4816df,parseInt(_0xc937('0xa3'),0x8));var _0x1c0449=require(_0xc937('0xa4'))[_0xc937('0xa5')](path[_0xc937('0x59')](__dirname,_0xc937('0xa6')),[_0x4816df,_0x2dfc7d[_0xc937('0x54')][_0xc937('0x94')],_0x2dfc7d[_0xc937('0x54')][_0xc937('0x96')],_0x2dfc7d[_0xc937('0x54')]['ListId'],_0x2dfc7d['body']['CompanyId'],_0x2dfc7d[_0xc937('0x54')][_0xc937('0x73')],_0x2dfc7d['body'][_0xc937('0x98')]]);return _0xbce0a8[_0xc937('0x1a')](0xc8)[_0xc937('0x1c')]({'message':_0xc937('0xa7'),'pid':_0x1c0449[_0xc937('0xa8')]});}catch(_0x1e4da5){return _0xbce0a8[_0xc937('0x1a')](0x1f4)[_0xc937('0x2b')](_0x1e4da5);}};exports['upload']=function(_0x108be5,_0x1cc52c,_0x25eeb2){var _0xd68160=fs['createReadStream'](_0x108be5['file'][_0xc937('0x6')]);Papa[_0xc937('0xa9')](_0xd68160,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x320aae){return _0x1cc52c[_0xc937('0x1a')](0xc8)[_0xc937('0x1c')]({'file':_0x108be5[_0xc937('0xa1')],'fields':_0x320aae[_0xc937('0xaa')][_0xc937('0x35')]});}});};exports[_0xc937('0xab')]=function(_0x1448f4,_0x1f3ccf,_0x2a1816){return db['User'][_0xc937('0x52')]({'raw':!![],'attributes':['id'],'where':{'role':_0xc937('0xac')}})['then'](function(_0x3e13ec){var _0x51b8d1=![];if(!_0x1448f4[_0xc937('0x54')][_0xc937('0x75')]){throw new Error(_0xc937('0xad'));}if(!_0x1448f4[_0xc937('0x54')]['binding']['phone']){throw new Error(_0xc937('0xae'));}if(!_0x1448f4['body'][_0xc937('0xaf')][_0xc937('0x9d')]){throw new Error(_0xc937('0x9e'));}if(!_0x1448f4[_0xc937('0x54')]['socket_timestamp']){throw new Error(_0xc937('0x99'));}var _0x501978=require(_0xc937('0xa4'))['fork'](path[_0xc937('0x59')](__dirname,'../../components/import/cm/csv2'),[_0x1448f4['params']['id'],JSON[_0xc937('0xb0')](_0x1448f4[_0xc937('0x54')]),JSON['stringify'](_0x3e13ec)]);_0x501978['on'](_0xc937('0xb1'),function(_0x2def35){_0x51b8d1=!![];return _0x1f3ccf[_0xc937('0x1a')](0xc8)['json']({'message':_0xc937('0xb2'),'pid':_0x501978[_0xc937('0xa8')]});});_0x501978['on'](_0xc937('0xb3'),function(_0x46f4da){if(_0x46f4da&&!_0x51b8d1){return _0x1f3ccf[_0xc937('0x1a')](0x1f4)['json']({'message':_0xc937('0xb4'),'pid':_0x501978[_0xc937('0xa8')]});}});})[_0xc937('0x4b')](handleError(_0x1f3ccf,null));};
\ No newline at end of file
index 94f27e1..cc7072e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f36=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x9f36,0x116));var _0x69f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9f36[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x69f3('0x0'));var CmContact=require(_0x69f3('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x69f3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x69f3('0x3'),'afterDestroy':_0x69f3('0x4')};function emitEvent(_0x40d359){return function(_0x30ecb9,_0x429065,_0xd890f1){CmContactEvents[_0x69f3('0x5')](_0x40d359+':'+_0x30ecb9['id'],_0x30ecb9);CmContactEvents[_0x69f3('0x5')](_0x40d359,_0x30ecb9);_0xd890f1(null);};}for(var e in events){if(events[_0x69f3('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x69f3('0x7')]=CmContactEvents;
\ No newline at end of file
+var _0xd7e3=['exports','setMaxListeners','update','remove','hasOwnProperty'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xd7e3,0xec));var _0x3d7e=function(_0x492906,_0x384ae6){_0x492906=_0x492906-0x0;var _0x3fe043=_0xd7e3[_0x492906];return _0x3fe043;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3d7e('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d7e('0x1'),'afterDestroy':_0x3d7e('0x2')};function emitEvent(_0x286f2c){return function(_0x4e1714,_0x3e93e4,_0x2c6dbe){CmContactEvents['emit'](_0x286f2c+':'+_0x4e1714['id'],_0x4e1714);CmContactEvents['emit'](_0x286f2c,_0x4e1714);_0x2c6dbe(null);};}for(var e in events){if(events[_0x3d7e('0x3')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x3d7e('0x4')]=CmContactEvents;
\ No newline at end of file
index 6d9d27b..0c6b748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11c8=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','get','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','Campaign','always','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','moment','bluebird','request-promise','./cmContact.attributes','exports','define','CmContact','phone','error','afterCreate','inspect','findOne','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','isNil','cmContact,\x20afterCreate\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','priority'];(function(_0x513e90,_0x410797){var _0x2ccd64=function(_0x31cf0a){while(--_0x31cf0a){_0x513e90['push'](_0x513e90['shift']());}};_0x2ccd64(++_0x410797);}(_0x11c8,0x19a));var _0x811c=function(_0x54e15b,_0x234bf3){_0x54e15b=_0x54e15b-0x0;var _0xb9713f=_0x11c8[_0x54e15b];return _0xb9713f;};'use strict';var _=require('lodash');var util=require(_0x811c('0x0'));var logger=require(_0x811c('0x1'))('api');var moment=require(_0x811c('0x2'));var BPromise=require(_0x811c('0x3'));var rp=require(_0x811c('0x4'));var attributes=require(_0x811c('0x5'));module[_0x811c('0x6')]=function(_0x432f5b,_0x49a07c){return _0x432f5b[_0x811c('0x7')](_0x811c('0x8'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x811c('0x9'),'fields':[_0x811c('0x9')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13a95a,_0x3e81ac,_0x57a92d){var _0x47b070=_0x432f5b['models'];var _0x5be7fc=_0x13a95a['get']({'plain':!![]});function _0x4ce7c4(){return function(_0x270b6e){logger[_0x811c('0xa')]('cmContact',_0x811c('0xb'),util[_0x811c('0xc')](_0x270b6e,{'showHidden':![],'depth':null}));};}var _0x226dc6=function(_0x33519d){return new BPromise(function(_0x3fdd5c,_0x5959e8){_0x47b070['CmHopper'][_0x811c('0xd')]({'where':{'phone':_0x5be7fc['phone'],'VoiceQueueId':_0x33519d['id']}})[_0x811c('0xe')](function(_0x5f20f7){if(!_['isNil'](_0x5f20f7)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5be7fc[_0x811c('0x9')]+_0x811c('0xf')+_0x33519d['id']);}return _0x47b070[_0x811c('0x10')][_0x811c('0x11')]({'phone':_0x5be7fc[_0x811c('0x9')],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc[_0x811c('0x12')],'priority':_0x5be7fc['priority']?_0x5be7fc['priority']:0x2,'scheduledat':_0x5be7fc[_0x811c('0x13')]?_0x5be7fc[_0x811c('0x13')]:moment()[_0x811c('0x14')](_0x811c('0x15')),'callback':_0x5be7fc[_0x811c('0x16')]?!![]:![],'callbackuniqueid':_0x5be7fc[_0x811c('0x16')]?_0x5be7fc[_0x811c('0x16')]:undefined,'callbackat':_0x5be7fc[_0x811c('0x16')]?moment()[_0x811c('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x33519d['id']});})[_0x811c('0x17')](function(_0x5686f1){_0x5959e8(_0x5686f1);});});};var _0x291660=function(_0x63a81f){return new BPromise(function(_0x53c6d4,_0x2921c){_0x47b070[_0x811c('0x10')][_0x811c('0xd')]({'where':{'phone':_0x5be7fc['phone'],'VoiceQueueId':_0x63a81f['id']}})['then'](function(_0x587c52){if(!_[_0x811c('0x18')](_0x587c52)){throw new Error(_0x811c('0x19')+_0x5be7fc[_0x811c('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x63a81f['id']);}return _0x47b070[_0x811c('0x1a')][_0x811c('0xd')]({'where':{'calleridnum':_0x5be7fc[_0x811c('0x9')],'VoiceQueueId':_0x63a81f['id']}});})[_0x811c('0xe')](function(_0x4e1088){if(!_[_0x811c('0x18')](_0x4e1088)){throw new Error(_0x811c('0x1b')+_0x5be7fc[_0x811c('0x9')]+_0x811c('0x1c')+_0x63a81f['id']);}return _0x47b070[_0x811c('0x10')][_0x811c('0x11')]({'phone':_0x5be7fc['phone'],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc[_0x811c('0x12')],'priority':_0x5be7fc['priority']?_0x5be7fc[_0x811c('0x1d')]:0x2,'scheduledat':_0x5be7fc[_0x811c('0x13')]?_0x5be7fc[_0x811c('0x13')]:moment()[_0x811c('0x14')](_0x811c('0x15')),'callback':_0x5be7fc[_0x811c('0x16')]?!![]:![],'callbackuniqueid':_0x5be7fc['callbackUniqueid']?_0x5be7fc[_0x811c('0x16')]:undefined,'callbackat':_0x5be7fc[_0x811c('0x16')]?moment()[_0x811c('0x14')](_0x811c('0x15')):undefined,'VoiceQueueId':_0x63a81f['id']});})[_0x811c('0x17')](function(_0x18f87a){_0x2921c(_0x18f87a);});});};function _0x4a5baf(){return function(_0x2fde17){logger[_0x811c('0xa')]('cmContact','afterCreate',util[_0x811c('0xc')](_0x2fde17,{'showHidden':![],'depth':null}));};}var _0x38d639=function(_0x1d98d2){return new BPromise(function(_0x5920a5,_0x21d6d5){_0x47b070[_0x811c('0x10')]['findOne']({'where':{'phone':_0x5be7fc['phone'],'CampaignId':_0x1d98d2['id']}})['then'](function(_0x1fd6e8){if(!_[_0x811c('0x18')](_0x1fd6e8)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5be7fc[_0x811c('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1d98d2['id']);}return _0x47b070['CmHopper'][_0x811c('0x11')]({'phone':_0x5be7fc[_0x811c('0x9')],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc[_0x811c('0x12')],'priority':_0x5be7fc[_0x811c('0x1d')]?_0x5be7fc[_0x811c('0x1d')]:0x2,'scheduledat':_0x5be7fc[_0x811c('0x13')]?_0x5be7fc[_0x811c('0x13')]:moment()[_0x811c('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5be7fc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5be7fc[_0x811c('0x16')]?_0x5be7fc[_0x811c('0x16')]:undefined,'callbackat':_0x5be7fc['callbackUniqueid']?moment()[_0x811c('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1d98d2['id']});})[_0x811c('0x17')](function(_0x566ad1){_0x21d6d5(_0x566ad1);});});};var _0x47b7c3=function(_0x3c16fd){return new BPromise(function(_0x4b61d8,_0xf99c00){_0x47b070[_0x811c('0x10')][_0x811c('0xd')]({'where':{'phone':_0x5be7fc['phone'],'CampaignId':_0x3c16fd['id']}})[_0x811c('0xe')](function(_0x5720c1){if(!_['isNil'](_0x5720c1)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5be7fc[_0x811c('0x9')]+_0x811c('0x1e')+_0x3c16fd['id']);}return _0x47b070['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x5be7fc['phone'],'CampaignId':_0x3c16fd['id']}});})[_0x811c('0xe')](function(_0x1ae1e7){if(!_[_0x811c('0x18')](_0x1ae1e7)){throw new Error(_0x811c('0x1b')+_0x5be7fc[_0x811c('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x3c16fd['id']);}return _0x47b070[_0x811c('0x10')]['create']({'phone':_0x5be7fc[_0x811c('0x9')],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc['ListId'],'priority':_0x5be7fc['priority']?_0x5be7fc[_0x811c('0x1d')]:0x2,'scheduledat':_0x5be7fc[_0x811c('0x13')]?_0x5be7fc['scheduledat']:moment()[_0x811c('0x14')](_0x811c('0x15')),'callback':_0x5be7fc[_0x811c('0x16')]?!![]:![],'callbackuniqueid':_0x5be7fc[_0x811c('0x16')]?_0x5be7fc['callbackUniqueid']:undefined,'callbackat':_0x5be7fc[_0x811c('0x16')]?moment()[_0x811c('0x14')](_0x811c('0x15')):undefined,'CampaignId':_0x3c16fd['id']});})['catch'](function(_0x55aa45){_0xf99c00(_0x55aa45);});});};if(_0x5be7fc[_0x811c('0x12')]){_0x47b070[_0x811c('0x1f')][_0x811c('0x20')]({'where':{'type':_0x811c('0x21')},'attributes':['id',_0x811c('0x22')],'include':[{'model':_0x47b070[_0x811c('0x23')],'as':_0x811c('0x24'),'where':{'id':_0x5be7fc['ListId']}}]})[_0x811c('0xe')](function(_0x4a955e){if(_0x4a955e){var _0x568995=[];for(var _0x3c4861=0x0,_0xf2af01;_0x3c4861<_0x4a955e[_0x811c('0x25')];_0x3c4861+=0x1){_0xf2af01=_0x4a955e[_0x3c4861][_0x811c('0x26')]({'plain':!![]});switch(_0xf2af01[_0x811c('0x22')]){case'always':_0x291660(_0xf2af01)['catch'](_0x4ce7c4());break;case _0x811c('0x27'):_0x226dc6(_0xf2af01)['catch'](_0x4ce7c4());break;default:_0x47b070[_0x811c('0x10')]['create']({'phone':_0x5be7fc[_0x811c('0x9')],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc['ListId'],'scheduledat':_0x5be7fc['scheduledat']?_0x5be7fc[_0x811c('0x13')]:moment()[_0x811c('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5be7fc[_0x811c('0x1d')]?_0x5be7fc[_0x811c('0x1d')]:0x2,'callback':_0x5be7fc[_0x811c('0x16')]?!![]:![],'callbackuniqueid':_0x5be7fc[_0x811c('0x16')]?_0x5be7fc[_0x811c('0x16')]:undefined,'callbackat':_0x5be7fc[_0x811c('0x16')]?moment()[_0x811c('0x14')](_0x811c('0x15')):undefined,'VoiceQueueId':_0xf2af01['id']})[_0x811c('0x17')](_0x4ce7c4());}}}})[_0x811c('0xe')](function(){return _0x47b070[_0x811c('0x1f')]['findAll']({'where':{'type':_0x811c('0x21')},'attributes':['id'],'include':[{'model':_0x47b070[_0x811c('0x23')],'as':_0x811c('0x28'),'where':{'id':_0x5be7fc[_0x811c('0x12')]}}]})[_0x811c('0xe')](function(_0x49475d){if(_0x49475d){var _0x53c79f=[];for(var _0x3b99c5=0x0,_0xfaad6;_0x3b99c5<_0x49475d[_0x811c('0x25')];_0x3b99c5+=0x1){_0xfaad6=_0x49475d[_0x3b99c5][_0x811c('0x26')]({'plain':!![]});_0x47b070[_0x811c('0x29')][_0x811c('0x11')]({'phone':_0x5be7fc['phone'],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc[_0x811c('0x12')],'VoiceQueueId':_0xfaad6['id']})[_0x811c('0x17')](function(_0x473daf){logger[_0x811c('0xa')](_0x811c('0x2a'),_0x811c('0xb'),_0x473daf['message']);});}}});})[_0x811c('0xe')](function(){return _0x47b070[_0x811c('0x2b')]['findAll']({'attributes':['id',_0x811c('0x22')],'include':[{'model':_0x47b070[_0x811c('0x23')],'as':_0x811c('0x24'),'where':{'id':_0x5be7fc[_0x811c('0x12')]}}]})[_0x811c('0xe')](function(_0x1c1462){if(_0x1c1462){var _0x95332c=[];for(var _0x3322b0=0x0,_0x267fb5;_0x3322b0<_0x1c1462[_0x811c('0x25')];_0x3322b0+=0x1){_0x267fb5=_0x1c1462[_0x3322b0][_0x811c('0x26')]({'plain':!![]});switch(_0x267fb5[_0x811c('0x22')]){case _0x811c('0x2c'):_0x47b7c3(_0x267fb5)['catch'](_0x4a5baf());break;case _0x811c('0x27'):_0x38d639(_0x267fb5)[_0x811c('0x17')](_0x4a5baf());break;default:_0x47b070[_0x811c('0x10')][_0x811c('0x11')]({'phone':_0x5be7fc['phone'],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc[_0x811c('0x12')],'scheduledat':_0x5be7fc[_0x811c('0x13')]?_0x5be7fc[_0x811c('0x13')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5be7fc['priority']?_0x5be7fc[_0x811c('0x1d')]:0x2,'callback':_0x5be7fc[_0x811c('0x16')]?!![]:![],'callbackuniqueid':_0x5be7fc[_0x811c('0x16')]?_0x5be7fc['callbackUniqueid']:undefined,'callbackat':_0x5be7fc[_0x811c('0x16')]?moment()[_0x811c('0x14')](_0x811c('0x15')):undefined,'CampaignId':_0x267fb5['id']})[_0x811c('0x17')](_0x4a5baf());}}}});})['then'](function(){return _0x47b070['Campaign'][_0x811c('0x20')]({'attributes':['id'],'include':[{'model':_0x47b070[_0x811c('0x23')],'as':_0x811c('0x28'),'where':{'id':_0x5be7fc['ListId']}}]})[_0x811c('0xe')](function(_0xd093c8){if(_0xd093c8){var _0x25a4f2=[];for(var _0x1cc885=0x0,_0x13ddc8;_0x1cc885<_0xd093c8[_0x811c('0x25')];_0x1cc885+=0x1){_0x13ddc8=_0xd093c8[_0x1cc885][_0x811c('0x26')]({'plain':!![]});_0x47b070[_0x811c('0x29')][_0x811c('0x11')]({'phone':_0x5be7fc[_0x811c('0x9')],'ContactId':_0x5be7fc['id'],'ListId':_0x5be7fc[_0x811c('0x12')],'CampaignId':_0x13ddc8['id']})[_0x811c('0x17')](function(_0x676356){logger[_0x811c('0xa')](_0x811c('0x2a'),_0x811c('0xb'),_0x676356['message']);});}}});})[_0x811c('0xe')](function(){_0x57a92d();})[_0x811c('0x17')](function(_0x472770){logger[_0x811c('0xa')](_0x811c('0x2a'),_0x811c('0xb'),_0x472770['message']);_0x57a92d(_0x472770);});}else{_0x57a92d(new Error(_0x811c('0x2d')));}},'afterDestroy':function(_0x3d9568,_0xf45a89,_0x596f18){var _0x5e39ad=_0x432f5b[_0x811c('0x2e')];var _0x499d56=_0x3d9568[_0x811c('0x26')]({'plain':!![]});return _0x5e39ad[_0x811c('0x10')][_0x811c('0x20')]({'raw':!![],'where':{'ListId':_0x499d56['ListId'],'ContactId':_0x499d56['id']}})['then'](function(_0x160366){if(!_[_0x811c('0x2f')](_0x160366)){var _0x5ec119=[];for(var _0x5e15a1=0x0;_0x5e15a1<_0x160366[_0x811c('0x25')];_0x5e15a1+=0x1){var _0x309783=_0x5e39ad[_0x811c('0x10')][_0x811c('0x30')]({'where':{'ListId':_0x160366[_0x5e15a1][_0x811c('0x12')],'ContactId':_0x160366[_0x5e15a1][_0x811c('0x31')],'VoiceQueueId':_0x160366[_0x5e15a1][_0x811c('0x32')],'CampaignId':_0x160366[_0x5e15a1][_0x811c('0x33')]}});_0x5ec119['push'](_0x309783);}return BPromise['all'](_0x5ec119);}})[_0x811c('0xe')](function(_0x18c507){logger[_0x811c('0x34')](_0x811c('0x35'),util[_0x811c('0xc')](_0x18c507,{'showHidden':![],'depth':null}));_0x596f18();})['catch'](function(_0x200e15){logger['error'](_0x811c('0x36'),util[_0x811c('0xc')](_0x200e15,{'showHidden':![],'depth':null}));_0x596f18(_0x200e15);});}}});};
\ No newline at end of file
+var _0x0af5=['push','info','util','../../config/logger','api','moment','bluebird','request-promise','./cmContact.attributes','exports','define','CmContact','phone','models','cmContact','afterCreate','inspect','CmHopper','findOne','then','create','priority','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','scheduledat','error','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','dialCheckDuplicateType','CmList','Lists','length','get','onlyIfOpen','VoiceQueue','findAll','BlackLists','CmHopperBlack','message','Campaign','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId'];(function(_0x468e1e,_0x51bada){var _0x314178=function(_0x30083e){while(--_0x30083e){_0x468e1e['push'](_0x468e1e['shift']());}};_0x314178(++_0x51bada);}(_0x0af5,0x158));var _0x50af=function(_0x40ae62,_0x33f31b){_0x40ae62=_0x40ae62-0x0;var _0x3457b6=_0x0af5[_0x40ae62];return _0x3457b6;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var attributes=require(_0x50af('0x6'));module[_0x50af('0x7')]=function(_0x34e045,_0x1cfefa){return _0x34e045[_0x50af('0x8')](_0x50af('0x9'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':[_0x50af('0xa')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x120038,_0x4dc2b9,_0x49814d){var _0x4770ec=_0x34e045[_0x50af('0xb')];var _0x4c7c19=_0x120038['get']({'plain':!![]});function _0x3ec74c(){return function(_0x8298e8){logger['error'](_0x50af('0xc'),_0x50af('0xd'),util[_0x50af('0xe')](_0x8298e8,{'showHidden':![],'depth':null}));};}var _0x3a4c2f=function(_0x4c0a88){return new BPromise(function(_0x29c082,_0x338967){_0x4770ec[_0x50af('0xf')][_0x50af('0x10')]({'where':{'phone':_0x4c7c19[_0x50af('0xa')],'VoiceQueueId':_0x4c0a88['id']}})[_0x50af('0x11')](function(_0x534589){if(!_['isNil'](_0x534589)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4c7c19[_0x50af('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4c0a88['id']);}return _0x4770ec[_0x50af('0xf')][_0x50af('0x12')]({'phone':_0x4c7c19['phone'],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19['ListId'],'priority':_0x4c7c19[_0x50af('0x13')]?_0x4c7c19[_0x50af('0x13')]:0x2,'scheduledat':_0x4c7c19['scheduledat']?_0x4c7c19['scheduledat']:moment()[_0x50af('0x14')](_0x50af('0x15')),'callback':_0x4c7c19[_0x50af('0x16')]?!![]:![],'callbackuniqueid':_0x4c7c19[_0x50af('0x16')]?_0x4c7c19[_0x50af('0x16')]:undefined,'callbackat':_0x4c7c19[_0x50af('0x16')]?moment()[_0x50af('0x14')](_0x50af('0x15')):undefined,'VoiceQueueId':_0x4c0a88['id']});})[_0x50af('0x17')](function(_0xaee5cf){_0x338967(_0xaee5cf);});});};var _0x5c6f8e=function(_0x3f1dbe){return new BPromise(function(_0x2fbf20,_0x3ee220){_0x4770ec[_0x50af('0xf')]['findOne']({'where':{'phone':_0x4c7c19[_0x50af('0xa')],'VoiceQueueId':_0x3f1dbe['id']}})[_0x50af('0x11')](function(_0x4b5e21){if(!_[_0x50af('0x18')](_0x4b5e21)){throw new Error(_0x50af('0x19')+_0x4c7c19[_0x50af('0xa')]+_0x50af('0x1a')+_0x3f1dbe['id']);}return _0x4770ec[_0x50af('0x1b')][_0x50af('0x10')]({'where':{'calleridnum':_0x4c7c19[_0x50af('0xa')],'VoiceQueueId':_0x3f1dbe['id']}});})['then'](function(_0x76a6b3){if(!_[_0x50af('0x18')](_0x76a6b3)){throw new Error(_0x50af('0x1c')+_0x4c7c19[_0x50af('0xa')]+_0x50af('0x1d')+_0x3f1dbe['id']);}return _0x4770ec[_0x50af('0xf')]['create']({'phone':_0x4c7c19[_0x50af('0xa')],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19[_0x50af('0x1e')],'priority':_0x4c7c19['priority']?_0x4c7c19[_0x50af('0x13')]:0x2,'scheduledat':_0x4c7c19[_0x50af('0x1f')]?_0x4c7c19[_0x50af('0x1f')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4c7c19[_0x50af('0x16')]?!![]:![],'callbackuniqueid':_0x4c7c19[_0x50af('0x16')]?_0x4c7c19[_0x50af('0x16')]:undefined,'callbackat':_0x4c7c19[_0x50af('0x16')]?moment()[_0x50af('0x14')](_0x50af('0x15')):undefined,'VoiceQueueId':_0x3f1dbe['id']});})[_0x50af('0x17')](function(_0x212fc2){_0x3ee220(_0x212fc2);});});};function _0x5122e5(){return function(_0x1a1104){logger[_0x50af('0x20')](_0x50af('0xc'),'afterCreate',util[_0x50af('0xe')](_0x1a1104,{'showHidden':![],'depth':null}));};}var _0x5bd732=function(_0xadca5b){return new BPromise(function(_0x52d65a,_0x4a6ea4){_0x4770ec['CmHopper'][_0x50af('0x10')]({'where':{'phone':_0x4c7c19[_0x50af('0xa')],'CampaignId':_0xadca5b['id']}})[_0x50af('0x11')](function(_0x396eab){if(!_[_0x50af('0x18')](_0x396eab)){throw new Error(_0x50af('0x19')+_0x4c7c19[_0x50af('0xa')]+_0x50af('0x21')+_0xadca5b['id']);}return _0x4770ec[_0x50af('0xf')][_0x50af('0x12')]({'phone':_0x4c7c19['phone'],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19[_0x50af('0x1e')],'priority':_0x4c7c19[_0x50af('0x13')]?_0x4c7c19[_0x50af('0x13')]:0x2,'scheduledat':_0x4c7c19[_0x50af('0x1f')]?_0x4c7c19[_0x50af('0x1f')]:moment()['format'](_0x50af('0x15')),'callback':_0x4c7c19['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4c7c19['callbackUniqueid']?_0x4c7c19['callbackUniqueid']:undefined,'callbackat':_0x4c7c19[_0x50af('0x16')]?moment()[_0x50af('0x14')](_0x50af('0x15')):undefined,'CampaignId':_0xadca5b['id']});})[_0x50af('0x17')](function(_0x5d6cbc){_0x4a6ea4(_0x5d6cbc);});});};var _0x4a2a26=function(_0x4a181c){return new BPromise(function(_0x285944,_0x204071){_0x4770ec[_0x50af('0xf')][_0x50af('0x10')]({'where':{'phone':_0x4c7c19[_0x50af('0xa')],'CampaignId':_0x4a181c['id']}})['then'](function(_0x13f186){if(!_[_0x50af('0x18')](_0x13f186)){throw new Error(_0x50af('0x19')+_0x4c7c19[_0x50af('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4a181c['id']);}return _0x4770ec[_0x50af('0x1b')][_0x50af('0x10')]({'where':{'calleridnum':_0x4c7c19[_0x50af('0xa')],'CampaignId':_0x4a181c['id']}});})[_0x50af('0x11')](function(_0x220fd8){if(!_['isNil'](_0x220fd8)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4c7c19['phone']+_0x50af('0x22')+_0x4a181c['id']);}return _0x4770ec[_0x50af('0xf')][_0x50af('0x12')]({'phone':_0x4c7c19[_0x50af('0xa')],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19[_0x50af('0x1e')],'priority':_0x4c7c19[_0x50af('0x13')]?_0x4c7c19[_0x50af('0x13')]:0x2,'scheduledat':_0x4c7c19[_0x50af('0x1f')]?_0x4c7c19[_0x50af('0x1f')]:moment()[_0x50af('0x14')](_0x50af('0x15')),'callback':_0x4c7c19[_0x50af('0x16')]?!![]:![],'callbackuniqueid':_0x4c7c19[_0x50af('0x16')]?_0x4c7c19[_0x50af('0x16')]:undefined,'callbackat':_0x4c7c19[_0x50af('0x16')]?moment()[_0x50af('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4a181c['id']});})[_0x50af('0x17')](function(_0x2740fd){_0x204071(_0x2740fd);});});};if(_0x4c7c19[_0x50af('0x1e')]){_0x4770ec['VoiceQueue']['findAll']({'where':{'type':_0x50af('0x23')},'attributes':['id',_0x50af('0x24')],'include':[{'model':_0x4770ec[_0x50af('0x25')],'as':_0x50af('0x26'),'where':{'id':_0x4c7c19[_0x50af('0x1e')]}}]})[_0x50af('0x11')](function(_0x37bdfc){if(_0x37bdfc){var _0x3f74bb=[];for(var _0x533d35=0x0,_0x59e451;_0x533d35<_0x37bdfc[_0x50af('0x27')];_0x533d35+=0x1){_0x59e451=_0x37bdfc[_0x533d35][_0x50af('0x28')]({'plain':!![]});switch(_0x59e451['dialCheckDuplicateType']){case'always':_0x5c6f8e(_0x59e451)[_0x50af('0x17')](_0x3ec74c());break;case _0x50af('0x29'):_0x3a4c2f(_0x59e451)[_0x50af('0x17')](_0x3ec74c());break;default:_0x4770ec['CmHopper'][_0x50af('0x12')]({'phone':_0x4c7c19[_0x50af('0xa')],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19[_0x50af('0x1e')],'scheduledat':_0x4c7c19[_0x50af('0x1f')]?_0x4c7c19[_0x50af('0x1f')]:moment()[_0x50af('0x14')](_0x50af('0x15')),'priority':_0x4c7c19[_0x50af('0x13')]?_0x4c7c19[_0x50af('0x13')]:0x2,'callback':_0x4c7c19['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4c7c19[_0x50af('0x16')]?_0x4c7c19[_0x50af('0x16')]:undefined,'callbackat':_0x4c7c19[_0x50af('0x16')]?moment()[_0x50af('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x59e451['id']})['catch'](_0x3ec74c());}}}})['then'](function(){return _0x4770ec[_0x50af('0x2a')][_0x50af('0x2b')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x4770ec[_0x50af('0x25')],'as':_0x50af('0x2c'),'where':{'id':_0x4c7c19[_0x50af('0x1e')]}}]})[_0x50af('0x11')](function(_0x41f029){if(_0x41f029){var _0xb64bed=[];for(var _0x59057e=0x0,_0x5519a7;_0x59057e<_0x41f029[_0x50af('0x27')];_0x59057e+=0x1){_0x5519a7=_0x41f029[_0x59057e][_0x50af('0x28')]({'plain':!![]});_0x4770ec[_0x50af('0x2d')][_0x50af('0x12')]({'phone':_0x4c7c19[_0x50af('0xa')],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19[_0x50af('0x1e')],'VoiceQueueId':_0x5519a7['id']})['catch'](function(_0x37cfd4){logger[_0x50af('0x20')]('cmContact,\x20%s,\x20%s','afterCreate',_0x37cfd4[_0x50af('0x2e')]);});}}});})[_0x50af('0x11')](function(){return _0x4770ec[_0x50af('0x2f')][_0x50af('0x2b')]({'attributes':['id',_0x50af('0x24')],'include':[{'model':_0x4770ec[_0x50af('0x25')],'as':_0x50af('0x26'),'where':{'id':_0x4c7c19[_0x50af('0x1e')]}}]})[_0x50af('0x11')](function(_0x37ce38){if(_0x37ce38){var _0x4b91bd=[];for(var _0x3ddfef=0x0,_0x194ee2;_0x3ddfef<_0x37ce38[_0x50af('0x27')];_0x3ddfef+=0x1){_0x194ee2=_0x37ce38[_0x3ddfef][_0x50af('0x28')]({'plain':!![]});switch(_0x194ee2[_0x50af('0x24')]){case'always':_0x4a2a26(_0x194ee2)['catch'](_0x5122e5());break;case'onlyIfOpen':_0x5bd732(_0x194ee2)[_0x50af('0x17')](_0x5122e5());break;default:_0x4770ec['CmHopper'][_0x50af('0x12')]({'phone':_0x4c7c19[_0x50af('0xa')],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19[_0x50af('0x1e')],'scheduledat':_0x4c7c19[_0x50af('0x1f')]?_0x4c7c19[_0x50af('0x1f')]:moment()['format'](_0x50af('0x15')),'priority':_0x4c7c19[_0x50af('0x13')]?_0x4c7c19[_0x50af('0x13')]:0x2,'callback':_0x4c7c19[_0x50af('0x16')]?!![]:![],'callbackuniqueid':_0x4c7c19[_0x50af('0x16')]?_0x4c7c19[_0x50af('0x16')]:undefined,'callbackat':_0x4c7c19[_0x50af('0x16')]?moment()['format'](_0x50af('0x15')):undefined,'CampaignId':_0x194ee2['id']})['catch'](_0x5122e5());}}}});})[_0x50af('0x11')](function(){return _0x4770ec[_0x50af('0x2f')][_0x50af('0x2b')]({'attributes':['id'],'include':[{'model':_0x4770ec[_0x50af('0x25')],'as':'BlackLists','where':{'id':_0x4c7c19[_0x50af('0x1e')]}}]})[_0x50af('0x11')](function(_0x21590b){if(_0x21590b){var _0x284383=[];for(var _0x1b8f3c=0x0,_0x27b5b7;_0x1b8f3c<_0x21590b['length'];_0x1b8f3c+=0x1){_0x27b5b7=_0x21590b[_0x1b8f3c][_0x50af('0x28')]({'plain':!![]});_0x4770ec[_0x50af('0x2d')][_0x50af('0x12')]({'phone':_0x4c7c19[_0x50af('0xa')],'ContactId':_0x4c7c19['id'],'ListId':_0x4c7c19[_0x50af('0x1e')],'CampaignId':_0x27b5b7['id']})[_0x50af('0x17')](function(_0x3a042a){logger[_0x50af('0x20')](_0x50af('0x30'),_0x50af('0xd'),_0x3a042a[_0x50af('0x2e')]);});}}});})['then'](function(){_0x49814d();})[_0x50af('0x17')](function(_0x2a4d1e){logger[_0x50af('0x20')](_0x50af('0x30'),_0x50af('0xd'),_0x2a4d1e['message']);_0x49814d(_0x2a4d1e);});}else{_0x49814d(new Error(_0x50af('0x31')));}},'afterDestroy':function(_0x3b0ca6,_0x49cd0d,_0x241380){var _0x2d8256=_0x34e045[_0x50af('0xb')];var _0x22883c=_0x3b0ca6[_0x50af('0x28')]({'plain':!![]});return _0x2d8256[_0x50af('0xf')][_0x50af('0x2b')]({'raw':!![],'where':{'ListId':_0x22883c[_0x50af('0x1e')],'ContactId':_0x22883c['id']}})[_0x50af('0x11')](function(_0x41de49){if(!_[_0x50af('0x32')](_0x41de49)){var _0x3cda75=[];for(var _0x27a4e8=0x0;_0x27a4e8<_0x41de49[_0x50af('0x27')];_0x27a4e8+=0x1){var _0x4f25f6=_0x2d8256[_0x50af('0xf')][_0x50af('0x33')]({'where':{'ListId':_0x41de49[_0x27a4e8][_0x50af('0x1e')],'ContactId':_0x41de49[_0x27a4e8][_0x50af('0x34')],'VoiceQueueId':_0x41de49[_0x27a4e8][_0x50af('0x35')],'CampaignId':_0x41de49[_0x27a4e8][_0x50af('0x36')]}});_0x3cda75[_0x50af('0x37')](_0x4f25f6);}return BPromise['all'](_0x3cda75);}})[_0x50af('0x11')](function(_0x2fa7df){logger[_0x50af('0x38')]('[CmContact][afterDestroy][Succesfull]',util[_0x50af('0xe')](_0x2fa7df,{'showHidden':![],'depth':null}));_0x241380();})[_0x50af('0x17')](function(_0x3e615b){logger[_0x50af('0x20')]('[CmContact][afterDestroy][Error]',util[_0x50af('0xe')](_0x3e615b,{'showHidden':![],'depth':null}));_0x241380(_0x3e615b);});}}});};
\ No newline at end of file
index 5b0617a..0933817 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e52=['defaults','redis','localhost','socket.io-emitter','register','request','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowCmContact','CmContact','find','options','raw','attributes','include','map','model','then','CreateCmContact','create','body','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x5e52,0x8e));var _0x25e5=function(_0x36641f,_0x1de996){_0x36641f=_0x36641f-0x0;var _0x264197=_0x5e52[_0x36641f];return _0x264197;};'use strict';var _=require(_0x25e5('0x0'));var util=require(_0x25e5('0x1'));var moment=require(_0x25e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x25e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25e5('0x4'))['db'];var utils=require(_0x25e5('0x5'));var logger=require(_0x25e5('0x6'))('rpc');var config=require(_0x25e5('0x7'));var jayson=require(_0x25e5('0x8'));var client=jayson[_0x25e5('0x9')]['http']({'port':0x232a});config['redis']=_[_0x25e5('0xa')](config[_0x25e5('0xb')],{'host':_0x25e5('0xc'),'port':0x18eb});var socket=require(_0x25e5('0xd'))(new Redis(config['redis']));require('./cmContact.socket')[_0x25e5('0xe')](socket);function respondWithRpcPromise(_0x23334e,_0x18599b,_0x634246){return new BPromise(function(_0x502697,_0x2c49f2){return client[_0x25e5('0xf')](_0x23334e,_0x634246)['then'](function(_0x372e1a){logger[_0x25e5('0x10')](_0x25e5('0x11'),_0x18599b,_0x25e5('0x12'));logger[_0x25e5('0x13')](_0x25e5('0x14'),_0x18599b,_0x25e5('0x12'),JSON[_0x25e5('0x15')](_0x372e1a));if(_0x372e1a['error']){if(_0x372e1a['error']['code']===0x1f4){logger['error']('CmContact,\x20%s,\x20%s',_0x18599b,_0x372e1a[_0x25e5('0x16')][_0x25e5('0x17')]);return _0x2c49f2(_0x372e1a['error'][_0x25e5('0x17')]);}logger[_0x25e5('0x16')](_0x25e5('0x11'),_0x18599b,_0x372e1a[_0x25e5('0x16')]['message']);return _0x502697(_0x372e1a[_0x25e5('0x16')][_0x25e5('0x17')]);}else{logger[_0x25e5('0x10')]('CmContact,\x20%s,\x20%s',_0x18599b,_0x25e5('0x12'));_0x502697(_0x372e1a[_0x25e5('0x18')][_0x25e5('0x17')]);}})['catch'](function(_0xb114cf){logger[_0x25e5('0x16')]('CmContact,\x20%s,\x20%s',_0x18599b,_0xb114cf);_0x2c49f2(_0xb114cf);});});}exports[_0x25e5('0x19')]=function(_0x224189){var _0x7c2977=this;return new Promise(function(_0x8da83e,_0x136712){return db[_0x25e5('0x1a')][_0x25e5('0x1b')]({'raw':_0x224189[_0x25e5('0x1c')]?_0x224189[_0x25e5('0x1c')][_0x25e5('0x1d')]===undefined?!![]:![]:!![],'where':_0x224189['options']?_0x224189[_0x25e5('0x1c')]['where']||null:null,'attributes':_0x224189[_0x25e5('0x1c')]?_0x224189[_0x25e5('0x1c')][_0x25e5('0x1e')]||null:null,'include':_0x224189[_0x25e5('0x1c')]?_0x224189[_0x25e5('0x1c')][_0x25e5('0x1f')]?_['map'](_0x224189['options'][_0x25e5('0x1f')],function(_0x512fd5){return{'model':db[_0x512fd5['model']],'as':_0x512fd5['as'],'attributes':_0x512fd5[_0x25e5('0x1e')],'include':_0x512fd5[_0x25e5('0x1f')]?_[_0x25e5('0x20')](_0x512fd5[_0x25e5('0x1f')],function(_0x256080){return{'model':db[_0x256080['model']],'as':_0x256080['as'],'attributes':_0x256080[_0x25e5('0x1e')],'include':_0x256080[_0x25e5('0x1f')]?_[_0x25e5('0x20')](_0x256080['include'],function(_0x75df7e){return{'model':db[_0x75df7e[_0x25e5('0x21')]],'as':_0x75df7e['as'],'attributes':_0x75df7e['attributes']};}):[]};}):[]};}):[]:[]})[_0x25e5('0x22')](function(_0x3d1950){logger[_0x25e5('0x10')](_0x25e5('0x19'),_0x224189);logger[_0x25e5('0x13')](_0x25e5('0x19'),_0x224189,JSON[_0x25e5('0x15')](_0x3d1950));_0x8da83e(_0x3d1950);})['catch'](function(_0x4f4891){logger['error'](_0x25e5('0x19'),_0x4f4891[_0x25e5('0x17')],_0x224189);_0x136712(_0x7c2977[_0x25e5('0x16')](0x1f4,_0x4f4891['message']));});});};exports[_0x25e5('0x23')]=function(_0x5b6941){var _0x33e0f7=this;return new Promise(function(_0x5b9b25,_0x4f7241){return db[_0x25e5('0x1a')][_0x25e5('0x24')](_0x5b6941[_0x25e5('0x25')],{'raw':_0x5b6941['options']?_0x5b6941['options'][_0x25e5('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1e211d){logger['info'](_0x25e5('0x23'),_0x5b6941);logger[_0x25e5('0x13')]('CreateCmContact',_0x5b6941,JSON[_0x25e5('0x15')](_0x1e211d));_0x5b9b25(_0x1e211d);})['catch'](function(_0x23d8e8){logger[_0x25e5('0x16')](_0x25e5('0x23'),_0x23d8e8[_0x25e5('0x17')],_0x5b6941);_0x4f7241(_0x33e0f7['error'](0x1f4,_0x23d8e8[_0x25e5('0x17')]));});});};
\ No newline at end of file
+var _0x319d=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowCmContact','options','raw','include','model','attributes','map','CmContact','create','body','CreateCmContact','lodash'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x319d,0x109));var _0xd319=function(_0x5b1b07,_0x119df6){_0x5b1b07=_0x5b1b07-0x0;var _0x59fbbc=_0x319d[_0x5b1b07];return _0x59fbbc;};'use strict';var _=require(_0xd319('0x0'));var util=require(_0xd319('0x1'));var moment=require(_0xd319('0x2'));var BPromise=require('bluebird');var rs=require(_0xd319('0x3'));var fs=require('fs');var Redis=require(_0xd319('0x4'));var db=require(_0xd319('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd319('0x6'))(_0xd319('0x7'));var config=require(_0xd319('0x8'));var jayson=require(_0xd319('0x9'));var client=jayson[_0xd319('0xa')][_0xd319('0xb')]({'port':0x232a});config[_0xd319('0xc')]=_[_0xd319('0xd')](config['redis'],{'host':_0xd319('0xe'),'port':0x18eb});var socket=require(_0xd319('0xf'))(new Redis(config[_0xd319('0xc')]));require(_0xd319('0x10'))['register'](socket);function respondWithRpcPromise(_0x4d06f5,_0x67807b,_0x320650){return new BPromise(function(_0x48b950,_0xd91a16){return client['request'](_0x4d06f5,_0x320650)[_0xd319('0x11')](function(_0x51679a){logger[_0xd319('0x12')](_0xd319('0x13'),_0x67807b,_0xd319('0x14'));logger[_0xd319('0x15')]('CmContact,\x20%s,\x20%s,\x20%s',_0x67807b,_0xd319('0x14'),JSON[_0xd319('0x16')](_0x51679a));if(_0x51679a[_0xd319('0x17')]){if(_0x51679a[_0xd319('0x17')]['code']===0x1f4){logger[_0xd319('0x17')](_0xd319('0x13'),_0x67807b,_0x51679a[_0xd319('0x17')][_0xd319('0x18')]);return _0xd91a16(_0x51679a[_0xd319('0x17')][_0xd319('0x18')]);}logger[_0xd319('0x17')]('CmContact,\x20%s,\x20%s',_0x67807b,_0x51679a[_0xd319('0x17')][_0xd319('0x18')]);return _0x48b950(_0x51679a[_0xd319('0x17')][_0xd319('0x18')]);}else{logger['info'](_0xd319('0x13'),_0x67807b,_0xd319('0x14'));_0x48b950(_0x51679a[_0xd319('0x19')]['message']);}})[_0xd319('0x1a')](function(_0x491abd){logger[_0xd319('0x17')]('CmContact,\x20%s,\x20%s',_0x67807b,_0x491abd);_0xd91a16(_0x491abd);});});}exports[_0xd319('0x1b')]=function(_0x1f0191){var _0xf672a8=this;return new Promise(function(_0x51956d,_0x513f48){return db['CmContact']['find']({'raw':_0x1f0191[_0xd319('0x1c')]?_0x1f0191[_0xd319('0x1c')][_0xd319('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f0191[_0xd319('0x1c')]?_0x1f0191[_0xd319('0x1c')]['where']||null:null,'attributes':_0x1f0191[_0xd319('0x1c')]?_0x1f0191[_0xd319('0x1c')]['attributes']||null:null,'include':_0x1f0191[_0xd319('0x1c')]?_0x1f0191[_0xd319('0x1c')][_0xd319('0x1e')]?_['map'](_0x1f0191[_0xd319('0x1c')]['include'],function(_0x396b39){return{'model':db[_0x396b39[_0xd319('0x1f')]],'as':_0x396b39['as'],'attributes':_0x396b39['attributes'],'include':_0x396b39[_0xd319('0x1e')]?_['map'](_0x396b39[_0xd319('0x1e')],function(_0x12bcd2){return{'model':db[_0x12bcd2[_0xd319('0x1f')]],'as':_0x12bcd2['as'],'attributes':_0x12bcd2[_0xd319('0x20')],'include':_0x12bcd2[_0xd319('0x1e')]?_[_0xd319('0x21')](_0x12bcd2[_0xd319('0x1e')],function(_0x262c76){return{'model':db[_0x262c76[_0xd319('0x1f')]],'as':_0x262c76['as'],'attributes':_0x262c76[_0xd319('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x452c48){logger['info'](_0xd319('0x1b'),_0x1f0191);logger[_0xd319('0x15')](_0xd319('0x1b'),_0x1f0191,JSON[_0xd319('0x16')](_0x452c48));_0x51956d(_0x452c48);})[_0xd319('0x1a')](function(_0x2a58ce){logger[_0xd319('0x17')](_0xd319('0x1b'),_0x2a58ce['message'],_0x1f0191);_0x513f48(_0xf672a8['error'](0x1f4,_0x2a58ce[_0xd319('0x18')]));});});};exports['CreateCmContact']=function(_0x1b7553){var _0x1c1fb8=this;return new Promise(function(_0x1b665b,_0x393a5e){return db[_0xd319('0x22')][_0xd319('0x23')](_0x1b7553[_0xd319('0x24')],{'raw':_0x1b7553[_0xd319('0x1c')]?_0x1b7553[_0xd319('0x1c')][_0xd319('0x1d')]===undefined?!![]:![]:!![]})[_0xd319('0x11')](function(_0x1e52e9){logger[_0xd319('0x12')]('CreateCmContact',_0x1b7553);logger[_0xd319('0x15')](_0xd319('0x25'),_0x1b7553,JSON['stringify'](_0x1e52e9));_0x1b665b(_0x1e52e9);})[_0xd319('0x1a')](function(_0x289550){logger[_0xd319('0x17')](_0xd319('0x25'),_0x289550[_0xd319('0x18')],_0x1b7553);_0x393a5e(_0x1c1fb8[_0xd319('0x17')](0x1f4,_0x289550[_0xd319('0x18')]));});});};
\ No newline at end of file
index c1ebe97..fde2bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3561=['cmContact:','./cmContact.events','remove','update','emit','removeListener','register'];(function(_0x23e8af,_0x9af324){var _0x2a9004=function(_0x17ebed){while(--_0x17ebed){_0x23e8af['push'](_0x23e8af['shift']());}};_0x2a9004(++_0x9af324);}(_0x3561,0x94));var _0x1356=function(_0x4fbe0a,_0x976e0c){_0x4fbe0a=_0x4fbe0a-0x0;var _0x1bb629=_0x3561[_0x4fbe0a];return _0x1bb629;};'use strict';var CmContactEvents=require(_0x1356('0x0'));var events=['save',_0x1356('0x1'),_0x1356('0x2')];function createListener(_0x8ef5f,_0x14465e){return function(_0x442fbc){_0x14465e[_0x1356('0x3')](_0x8ef5f,_0x442fbc);};}function removeListener(_0x1634de,_0x116ff0){return function(){CmContactEvents[_0x1356('0x4')](_0x1634de,_0x116ff0);};}exports[_0x1356('0x5')]=function(_0x417d11){for(var _0x36e81f=0x0,_0x45ac56=events['length'];_0x36e81f<_0x45ac56;_0x36e81f++){var _0x105aaf=events[_0x36e81f];var _0x33529f=createListener(_0x1356('0x6')+_0x105aaf,_0x417d11);CmContactEvents['on'](_0x105aaf,_0x33529f);}};
\ No newline at end of file
+var _0x5b20=['remove','update','emit','removeListener','length','cmContact:','./cmContact.events','save'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x5b20,0x86));var _0x05b2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5b20[_0x3e5086];return _0xfeb102;};'use strict';var CmContactEvents=require(_0x05b2('0x0'));var events=[_0x05b2('0x1'),_0x05b2('0x2'),_0x05b2('0x3')];function createListener(_0x34eed0,_0x54e72e){return function(_0x3f63b3){_0x54e72e[_0x05b2('0x4')](_0x34eed0,_0x3f63b3);};}function removeListener(_0x19cb65,_0x1d9490){return function(){CmContactEvents[_0x05b2('0x5')](_0x19cb65,_0x1d9490);};}exports['register']=function(_0x22e0e2){for(var _0x83fd18=0x0,_0x541855=events[_0x05b2('0x6')];_0x83fd18<_0x541855;_0x83fd18++){var _0x43cd94=events[_0x83fd18];var _0x3be69a=createListener(_0x05b2('0x7')+_0x43cd94,_0x22e0e2);CmContactEvents['on'](_0x43cd94,_0x3be69a);}};
\ No newline at end of file
index 9df4991..d1e343f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66da=['file','uploadCsv','diskStorage','%s-%s%s','/upload','upload','/upload/:id','import','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','getJscriptySessions','post','/merge','join','root','server/files/tmp','originalname','replace','format','basename','now','extname','/csv','single'];(function(_0x4fb844,_0x4d497e){var _0x200725=function(_0x1bf3d0){while(--_0x1bf3d0){_0x4fb844['push'](_0x4fb844['shift']());}};_0x200725(++_0x4d497e);}(_0x66da,0x198));var _0xa66d=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x66da[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0xa66d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa66d('0x1'));var express=require(_0xa66d('0x2'));var router=express[_0xa66d('0x3')]();var auth=require(_0xa66d('0x4'));var interaction=require(_0xa66d('0x5'));var config=require('../../config/environment');var controller=require('./cmContact.controller');router[_0xa66d('0x6')]('/',auth[_0xa66d('0x7')](),controller[_0xa66d('0x8')]);router[_0xa66d('0x6')](_0xa66d('0x9'),auth[_0xa66d('0x7')](),controller['describe']);router[_0xa66d('0x6')](_0xa66d('0xa'),auth['isAuthenticated'](),controller[_0xa66d('0xb')]);router[_0xa66d('0x6')](_0xa66d('0xc'),auth[_0xa66d('0x7')](),controller[_0xa66d('0xd')]);router[_0xa66d('0x6')](_0xa66d('0xe'),auth[_0xa66d('0x7')](),controller[_0xa66d('0xf')]);router[_0xa66d('0x6')](_0xa66d('0x10'),auth[_0xa66d('0x7')](),controller['getHopperHistories']);router[_0xa66d('0x6')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xa66d('0x11')]);router[_0xa66d('0x6')]('/:id/jscripty_sessions',auth[_0xa66d('0x7')](),controller[_0xa66d('0x12')]);router[_0xa66d('0x13')](_0xa66d('0x14'),auth[_0xa66d('0x7')](),controller['merge']);router['post']('/',auth[_0xa66d('0x7')](),controller['create']);router[_0xa66d('0x13')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0xa66d('0x13')](_0xa66d('0xc'),auth[_0xa66d('0x7')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4212a8,_0x32f7b9,_0x4d7f05){_0x4d7f05(null,path[_0xa66d('0x15')](config[_0xa66d('0x16')],_0xa66d('0x17')));},'filename':function(_0x4ffd0f,_0x1c0e22,_0x5d254a){_0x1c0e22[_0xa66d('0x18')]=_0x1c0e22[_0xa66d('0x18')][_0xa66d('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5d254a(null,util[_0xa66d('0x1a')]('%s-%s%s',path[_0xa66d('0x1b')](_0x1c0e22[_0xa66d('0x18')],path['extname'](_0x1c0e22[_0xa66d('0x18')])),Date[_0xa66d('0x1c')](),path[_0xa66d('0x1d')](_0x1c0e22[_0xa66d('0x18')])));}})});router[_0xa66d('0x13')](_0xa66d('0x1e'),upload[_0xa66d('0x1f')](_0xa66d('0x20')),controller[_0xa66d('0x21')]);var upload=multer({'storage':multer[_0xa66d('0x22')]({'destination':function(_0x1773c0,_0x56475b,_0x21fd7e){_0x21fd7e(null,path['join'](config[_0xa66d('0x16')],'server/files/tmp'));},'filename':function(_0x304fef,_0x3a80aa,_0xafb712){_0x3a80aa[_0xa66d('0x18')]=_0x3a80aa[_0xa66d('0x18')][_0xa66d('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xafb712(null,util[_0xa66d('0x1a')](_0xa66d('0x23'),path[_0xa66d('0x1b')](_0x3a80aa[_0xa66d('0x18')],path['extname'](_0x3a80aa['originalname'])),Date[_0xa66d('0x1c')](),path[_0xa66d('0x1d')](_0x3a80aa[_0xa66d('0x18')])));}})});router['post'](_0xa66d('0x24'),upload[_0xa66d('0x1f')](_0xa66d('0x20')),controller[_0xa66d('0x25')]);router['post'](_0xa66d('0x26'),auth[_0xa66d('0x7')](),controller[_0xa66d('0x27')]);router[_0xa66d('0x28')](_0xa66d('0xa'),auth[_0xa66d('0x7')](),controller['update']);router[_0xa66d('0x29')](_0xa66d('0xa'),auth[_0xa66d('0x7')](),controller[_0xa66d('0x2a')]);module[_0xa66d('0x2b')]=router;
\ No newline at end of file
+var _0xc240=['post','/:id/tags','setTags','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','basename','extname','now','single','file','replace','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getTags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','/merge','create','/create_many','bulkCreate'];(function(_0x24697e,_0x4149f8){var _0x3e081b=function(_0x5aa1ce){while(--_0x5aa1ce){_0x24697e['push'](_0x24697e['shift']());}};_0x3e081b(++_0x4149f8);}(_0xc240,0xa7));var _0x0c24=function(_0x5a2dac,_0x5f1c81){_0x5a2dac=_0x5a2dac-0x0;var _0x14deec=_0xc240[_0x5a2dac];return _0x14deec;};'use strict';var multer=require(_0x0c24('0x0'));var util=require(_0x0c24('0x1'));var path=require(_0x0c24('0x2'));var timeout=require(_0x0c24('0x3'));var express=require(_0x0c24('0x4'));var router=express['Router']();var auth=require(_0x0c24('0x5'));var interaction=require(_0x0c24('0x6'));var config=require('../../config/environment');var controller=require(_0x0c24('0x7'));router[_0x0c24('0x8')]('/',auth[_0x0c24('0x9')](),controller[_0x0c24('0xa')]);router['get'](_0x0c24('0xb'),auth[_0x0c24('0x9')](),controller[_0x0c24('0xc')]);router[_0x0c24('0x8')](_0x0c24('0xd'),auth[_0x0c24('0x9')](),controller[_0x0c24('0xe')]);router[_0x0c24('0x8')]('/:id/tags',auth[_0x0c24('0x9')](),controller[_0x0c24('0xf')]);router[_0x0c24('0x8')](_0x0c24('0x10'),auth[_0x0c24('0x9')](),controller[_0x0c24('0x11')]);router[_0x0c24('0x8')]('/:id/hopper_histories',auth[_0x0c24('0x9')](),controller[_0x0c24('0x12')]);router['get'](_0x0c24('0x13'),auth[_0x0c24('0x9')](),controller['getHopperFinals']);router['get'](_0x0c24('0x14'),auth['isAuthenticated'](),controller['getJscriptySessions']);router['post'](_0x0c24('0x15'),auth[_0x0c24('0x9')](),controller['merge']);router['post']('/',auth[_0x0c24('0x9')](),controller[_0x0c24('0x16')]);router['post'](_0x0c24('0x17'),auth['isAuthenticated'](),controller[_0x0c24('0x18')]);router[_0x0c24('0x19')](_0x0c24('0x1a'),auth[_0x0c24('0x9')](),controller[_0x0c24('0x1b')]);var upload=multer({'storage':multer[_0x0c24('0x1c')]({'destination':function(_0xad2b45,_0x116c4b,_0x3cc1a9){_0x3cc1a9(null,path[_0x0c24('0x1d')](config[_0x0c24('0x1e')],_0x0c24('0x1f')));},'filename':function(_0x2a6de4,_0x136752,_0x95170b){_0x136752[_0x0c24('0x20')]=_0x136752[_0x0c24('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x95170b(null,util[_0x0c24('0x21')](_0x0c24('0x22'),path[_0x0c24('0x23')](_0x136752[_0x0c24('0x20')],path[_0x0c24('0x24')](_0x136752[_0x0c24('0x20')])),Date[_0x0c24('0x25')](),path[_0x0c24('0x24')](_0x136752[_0x0c24('0x20')])));}})});router[_0x0c24('0x19')]('/csv',upload[_0x0c24('0x26')](_0x0c24('0x27')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x0c24('0x1c')]({'destination':function(_0x1eeafd,_0x19ea41,_0x5a2fd1){_0x5a2fd1(null,path[_0x0c24('0x1d')](config[_0x0c24('0x1e')],_0x0c24('0x1f')));},'filename':function(_0x332d6e,_0x1a63b0,_0x418699){_0x1a63b0[_0x0c24('0x20')]=_0x1a63b0['originalname'][_0x0c24('0x28')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x418699(null,util[_0x0c24('0x21')](_0x0c24('0x22'),path[_0x0c24('0x23')](_0x1a63b0['originalname'],path['extname'](_0x1a63b0[_0x0c24('0x20')])),Date['now'](),path['extname'](_0x1a63b0['originalname'])));}})});router[_0x0c24('0x19')]('/upload',upload[_0x0c24('0x26')](_0x0c24('0x27')),controller['upload']);router[_0x0c24('0x19')](_0x0c24('0x29'),auth[_0x0c24('0x9')](),controller[_0x0c24('0x2a')]);router[_0x0c24('0x2b')](_0x0c24('0xd'),auth[_0x0c24('0x9')](),controller[_0x0c24('0x2c')]);router[_0x0c24('0x2d')](_0x0c24('0xd'),auth[_0x0c24('0x9')](),controller[_0x0c24('0x2e')]);module[_0x0c24('0x2f')]=router;
\ No newline at end of file
index 4e00379..fcf5528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d32=['getDataValue','type','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','name'];(function(_0x43b7f2,_0x3c0e85){var _0x5d6f59=function(_0x290b0d){while(--_0x290b0d){_0x43b7f2['push'](_0x43b7f2['shift']());}};_0x5d6f59(++_0x3c0e85);}(_0x5d32,0x1c9));var _0x25d3=function(_0x4f6f04,_0x59c6ba){_0x4f6f04=_0x4f6f04-0x0;var _0x606b2c=_0x5d32[_0x4f6f04];return _0x606b2c;};'use strict';var Sequelize=require(_0x25d3('0x0'));var _=require(_0x25d3('0x1'));module[_0x25d3('0x2')]={'name':{'type':Sequelize[_0x25d3('0x3')],'get':function(_0x52a2e2){return this['getDataValue'](_0x25d3('0x4'));}},'alias':{'type':Sequelize[_0x25d3('0x5')],'allowNull':![],'set':function(_0x393b74){this[_0x25d3('0x6')]('alias',_0x393b74?_0x393b74:this['getDataValue'](_0x25d3('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x25d3('0x8')](_0x25d3('0x9'))==='select'){return JSON[_0x25d3('0xa')](this[_0x25d3('0x8')](_0x25d3('0xb')));}else{return this[_0x25d3('0x8')]('values');}},'set':function(_0x137b6f){if(Array[_0x25d3('0xc')](_0x137b6f)){this[_0x25d3('0x6')]('values',JSON[_0x25d3('0xd')](_0x137b6f));}else{this[_0x25d3('0x6')]('values',_0x137b6f);}}},'required':{'type':Sequelize[_0x25d3('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0x44ab=['STRING','name','select','values','isArray','setDataValue','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0x44ab,0x73));var _0xb44a=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x44ab[_0x3e6d5d];return _0x238923;};'use strict';var Sequelize=require(_0xb44a('0x0'));var _=require(_0xb44a('0x1'));module[_0xb44a('0x2')]={'name':{'type':Sequelize[_0xb44a('0x3')],'get':function(_0x444ea7){return this[_0xb44a('0x4')]('alias');}},'alias':{'type':Sequelize[_0xb44a('0x5')],'allowNull':![],'set':function(_0x5782ba){this['setDataValue']('alias',_0x5782ba?_0x5782ba:this[_0xb44a('0x4')](_0xb44a('0x6')));}},'type':{'type':Sequelize[_0xb44a('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0xb44a('0x4')]('type')===_0xb44a('0x7')){return JSON['parse'](this['getDataValue'](_0xb44a('0x8')));}else{return this[_0xb44a('0x4')](_0xb44a('0x8'));}},'set':function(_0x5b86ac){if(Array[_0xb44a('0x9')](_0x5b86ac)){this[_0xb44a('0xa')]('values',JSON['stringify'](_0x5b86ac));}else{this[_0xb44a('0xa')](_0xb44a('0x8'),_0x5b86ac);}}},'required':{'type':Sequelize[_0xb44a('0xb')],'defaultValue':![]}};
\ No newline at end of file
index 1c01afc..356e3da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa02b=['update','then','destroy','error','stack','name','send','index','CmCustomField','rawAttributes','differenceBy','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','length','nolimit','sort','add','day','merge','where','filter','map','type','VIRTUAL','field','options','include','findAll','catch','show','params','find','body','transaction','create','Sequelize','TEXT','text','INTEGER','switch','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','lodash','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject'];(function(_0x781772,_0x3af2c6){var _0x3e7517=function(_0xec76f7){while(--_0xec76f7){_0x781772['push'](_0x781772['shift']());}};_0x3e7517(++_0x3af2c6);}(_0xa02b,0x1cf));var _0xba02=function(_0x4a3168,_0x494f38){_0x4a3168=_0x4a3168-0x0;var _0x35c154=_0xa02b[_0x4a3168];return _0x35c154;};'use strict';var pdf=require(_0xba02('0x0'));var emlformat=require(_0xba02('0x1'));var rimraf=require(_0xba02('0x2'));var zipdir=require(_0xba02('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xba02('0x4'));var BPromise=require(_0xba02('0x5'));var Mustache=require('mustache');var util=require(_0xba02('0x6'));var path=require('path');var sox=require(_0xba02('0x7'));var csv=require(_0xba02('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xba02('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba02('0xa'));var deskjs=require(_0xba02('0xb'));var toCsv=require('to-csv');var querystring=require(_0xba02('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0xba02('0xd'));var logger=require(_0xba02('0xe'))(_0xba02('0xf'));var utils=require(_0xba02('0x10'));var config=require(_0xba02('0x11'));var db=require(_0xba02('0x12'))['db'];function respondWithStatusCode(_0x5ea59a,_0x2e6c6e){_0x2e6c6e=_0x2e6c6e||0xcc;return function(_0x3f214e){if(_0x3f214e){return _0x5ea59a[_0xba02('0x13')](_0x2e6c6e);}return _0x5ea59a[_0xba02('0x14')](_0x2e6c6e)[_0xba02('0x15')]();};}function respondWithResult(_0x3079d0,_0x3e826f){_0x3e826f=_0x3e826f||0xc8;return function(_0x126da4){if(_0x126da4){return _0x3079d0[_0xba02('0x14')](_0x3e826f)[_0xba02('0x16')](_0x126da4);}};}function respondWithFilteredResult(_0x592d2e,_0xa729f6){return function(_0x57ce35){if(_0x57ce35){var _0x3a2cef=_0x57ce35[_0xba02('0x17')],_0x155183=_0xa729f6[_0xba02('0x18')],_0x33aaab=_0xa729f6['offset']+_0xa729f6[_0xba02('0x19')],_0x3f89d5;if(_0x33aaab>=_0x3a2cef){_0x33aaab=_0x3a2cef;_0x3f89d5=0xc8;}else{_0x3f89d5=0xce;}_0x592d2e[_0xba02('0x14')](_0x3f89d5);return _0x592d2e[_0xba02('0x1a')](_0xba02('0x1b'),_0x155183+'-'+_0x33aaab+'/'+_0x3a2cef)[_0xba02('0x16')](_0x57ce35);}return null;};}function patchUpdates(_0x1b6307){return function(_0x16c79a){try{jsonpatch['apply'](_0x16c79a,_0x1b6307,!![]);}catch(_0x36a10a){return BPromise[_0xba02('0x1c')](_0x36a10a);}return _0x16c79a['save']();};}function saveUpdates(_0x394604,_0x5d9baa){return function(_0x2e67f6){if(_0x2e67f6){return _0x2e67f6[_0xba02('0x1d')](_0x394604)[_0xba02('0x1e')](function(_0x2abd19){return _0x2abd19;});}return null;};}function removeEntity(_0x108244,_0x4d0e09){return function(_0x83eb0f){if(_0x83eb0f){return _0x83eb0f[_0xba02('0x1f')]()['then'](function(){_0x108244[_0xba02('0x14')](0xcc)[_0xba02('0x15')]();});}};}function handleEntityNotFound(_0xc53d3b,_0x39aad1){return function(_0x3f978c){if(!_0x3f978c){_0xc53d3b[_0xba02('0x13')](0x194);}return _0x3f978c;};}function handleError(_0x3e1ef2,_0x1139b7){_0x1139b7=_0x1139b7||0x1f4;return function(_0x1d99f8){logger[_0xba02('0x20')](_0x1d99f8[_0xba02('0x21')]);if(_0x1d99f8['name']){delete _0x1d99f8[_0xba02('0x22')];}_0x3e1ef2['status'](_0x1139b7)[_0xba02('0x23')](_0x1d99f8);};}exports[_0xba02('0x24')]=function(_0x17f0e1,_0x53eb0f){var _0x489d02={},_0x230761={},_0x166a54={'count':0x0,'rows':[]};var _0x30425b=db[_0xba02('0x25')][_0xba02('0x26')];_0x230761['model']=_[_0xba02('0x27')](_[_0xba02('0x28')](_0x30425b),[_0xba02('0x22')]);var _0x31fa72={'dateStart':_0x17f0e1[_0xba02('0x29')][_0xba02('0x2a')],'dateEnd':_0x17f0e1[_0xba02('0x29')][_0xba02('0x2b')]};delete _0x17f0e1[_0xba02('0x29')][_0xba02('0x2a')];delete _0x17f0e1['query']['dateEnd'];_0x230761[_0xba02('0x29')]=_['keys'](_0x17f0e1['query']);_0x230761[_0xba02('0x2c')]=_[_0xba02('0x2d')](_0x230761['model'],_0x230761[_0xba02('0x29')]);_0x489d02[_0xba02('0x2e')]=_[_0xba02('0x2d')](_0x230761[_0xba02('0x2f')],qs[_0xba02('0x30')](_0x17f0e1[_0xba02('0x29')][_0xba02('0x30')]));_0x489d02[_0xba02('0x2e')]=_0x489d02[_0xba02('0x2e')][_0xba02('0x31')]?_0x489d02[_0xba02('0x2e')]:_0x230761['model'];if(!_0x17f0e1[_0xba02('0x29')]['hasOwnProperty'](_0xba02('0x32'))){_0x489d02['limit']=qs['limit'](_0x17f0e1['query']['limit']);_0x489d02[_0xba02('0x18')]=qs[_0xba02('0x18')](_0x17f0e1[_0xba02('0x29')][_0xba02('0x18')]);}_0x489d02['order']=qs['sort'](_0x17f0e1['query'][_0xba02('0x33')]);_0x489d02['where']=qs['filters'](_['pick'](_0x17f0e1[_0xba02('0x29')],_0x230761[_0xba02('0x2c')]));if(_0x31fa72[_0xba02('0x2a')]){if(_0x31fa72[_0xba02('0x2b')]){_0x31fa72[_0xba02('0x2b')]=moment(_0x31fa72['dateEnd'])[_0xba02('0x34')](0x1,_0xba02('0x35'));}else{_0x31fa72[_0xba02('0x2b')]=moment(_0x31fa72['dateStart'])[_0xba02('0x34')](0x1,_0xba02('0x35'));}_[_0xba02('0x36')](_0x489d02[_0xba02('0x37')],{'createdAt':{'$gte':_0x31fa72['dateStart'],'$lte':_0x31fa72['dateEnd']}});}if(_0x17f0e1['query'][_0xba02('0x38')]){_0x489d02['where']=_[_0xba02('0x36')](_0x489d02[_0xba02('0x37')],{'$or':_[_0xba02('0x39')](_0x30425b,function(_0x501a91){if(_0x501a91[_0xba02('0x3a')]['key']!==_0xba02('0x3b')){var _0x38813f={};_0x38813f[_0x501a91[_0xba02('0x3c')]]={'$like':'%'+_0x17f0e1[_0xba02('0x29')]['filter']+'%'};return _0x38813f;}})});}_0x489d02=_[_0xba02('0x36')]({},_0x489d02,_0x17f0e1[_0xba02('0x3d')]);var _0x506be8={'where':_0x489d02['where']};return db[_0xba02('0x25')][_0xba02('0x17')](_0x506be8)[_0xba02('0x1e')](function(_0x7fb456){_0x166a54[_0xba02('0x17')]=_0x7fb456;if(_0x17f0e1[_0xba02('0x29')]['includeAll']){_0x489d02[_0xba02('0x3e')]=[{'all':!![]}];}return db[_0xba02('0x25')][_0xba02('0x3f')](_0x489d02);})[_0xba02('0x1e')](function(_0x58489c){_0x166a54['rows']=_0x58489c;return _0x166a54;})[_0xba02('0x1e')](respondWithFilteredResult(_0x53eb0f,_0x489d02))[_0xba02('0x40')](handleError(_0x53eb0f,null));};exports[_0xba02('0x41')]=function(_0x34ea52,_0x166729){var _0x2a65ab={'raw':!![],'where':{'id':_0x34ea52[_0xba02('0x42')]['id']}},_0x181848={};_0x181848[_0xba02('0x2f')]=_[_0xba02('0x28')](db[_0xba02('0x25')][_0xba02('0x26')]);_0x181848['query']=_['keys'](_0x34ea52[_0xba02('0x29')]);_0x181848['filters']=_[_0xba02('0x2d')](_0x181848['model'],_0x181848[_0xba02('0x29')]);_0x2a65ab[_0xba02('0x2e')]=_[_0xba02('0x2d')](_0x181848['model'],qs[_0xba02('0x30')](_0x34ea52[_0xba02('0x29')][_0xba02('0x30')]));_0x2a65ab[_0xba02('0x2e')]=_0x2a65ab[_0xba02('0x2e')]['length']?_0x2a65ab['attributes']:_0x181848[_0xba02('0x2f')];if(_0x34ea52['query']['includeAll']){_0x2a65ab[_0xba02('0x3e')]=[{'all':!![]}];}_0x2a65ab=_['merge']({},_0x2a65ab,_0x34ea52[_0xba02('0x3d')]);return db[_0xba02('0x25')][_0xba02('0x43')](_0x2a65ab)[_0xba02('0x1e')](handleEntityNotFound(_0x166729,null))[_0xba02('0x1e')](respondWithResult(_0x166729,null))[_0xba02('0x40')](handleError(_0x166729,null));};exports['update']=function(_0x4112e4,_0x211336){if(_0x4112e4[_0xba02('0x44')]['id']){delete _0x4112e4[_0xba02('0x44')]['id'];}return db['CmCustomField'][_0xba02('0x43')]({'where':{'id':_0x4112e4['params']['id']}})[_0xba02('0x1e')](handleEntityNotFound(_0x211336,null))[_0xba02('0x1e')](saveUpdates(_0x4112e4['body'],null))['then'](respondWithResult(_0x211336,null))[_0xba02('0x40')](handleError(_0x211336,null));};exports[_0xba02('0x1f')]=function(_0x29637b,_0x38c52a){return db[_0xba02('0x25')][_0xba02('0x43')]({'where':{'id':_0x29637b[_0xba02('0x42')]['id']}})[_0xba02('0x1e')](handleEntityNotFound(_0x38c52a,null))['then'](removeEntity(_0x38c52a,null))[_0xba02('0x40')](handleError(_0x38c52a,null));};exports['create']=function(_0x548ef8,_0x1ff299){var _0x162e2f;return db['sequelize'][_0xba02('0x45')](function(_0x3cc7f8){return db[_0xba02('0x25')][_0xba02('0x46')](_0x548ef8['body'],{'transaction':_0x3cc7f8})[_0xba02('0x1e')](function(_0x289843){_0x162e2f=_0x289843;var _0x57c11c={'type':db[_0xba02('0x47')][_0xba02('0x48')],'transaction':_0x3cc7f8};switch(_0x548ef8['body'][_0xba02('0x3a')]){case _0xba02('0x49'):_0x57c11c[_0xba02('0x3a')]=db['Sequelize'][_0xba02('0x48')];break;case'number':_0x57c11c['type']=db[_0xba02('0x47')][_0xba02('0x4a')];break;case _0xba02('0x4b'):_0x57c11c[_0xba02('0x3a')]=db['Sequelize']['BOOLEAN'];_0x57c11c['defaultValue']=![];break;default:}return db[_0xba02('0x4c')][_0xba02('0x4d')][_0xba02('0x4e')](_0xba02('0x4f'),util[_0xba02('0x50')](_0xba02('0x51'),_0x162e2f['id']),_0x57c11c);})[_0xba02('0x1e')](function(){return _0x162e2f;});})[_0xba02('0x1e')](respondWithResult(_0x1ff299,0xc9))['catch'](handleError(_0x1ff299,null));};
\ No newline at end of file
+var _0xb2c9=['BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','CmCustomField','rawAttributes','model','query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','type','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','find','body','create','transaction','Sequelize','number','INTEGER','switch'];(function(_0x54e241,_0x22d434){var _0x265d05=function(_0x4d6e3c){while(--_0x4d6e3c){_0x54e241['push'](_0x54e241['shift']());}};_0x265d05(++_0x22d434);}(_0xb2c9,0xae));var _0x9b2c=function(_0x1a4748,_0x40c46e){_0x1a4748=_0x1a4748-0x0;var _0x28ca99=_0xb2c9[_0x1a4748];return _0x28ca99;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9b2c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9b2c('0x1'));var rp=require(_0x9b2c('0x2'));var moment=require(_0x9b2c('0x3'));var BPromise=require(_0x9b2c('0x4'));var Mustache=require(_0x9b2c('0x5'));var util=require(_0x9b2c('0x6'));var path=require(_0x9b2c('0x7'));var sox=require('sox');var csv=require(_0x9b2c('0x8'));var ejs=require(_0x9b2c('0x9'));var fs=require('fs');var _=require(_0x9b2c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b2c('0xb'));var deskjs=require(_0x9b2c('0xc'));var toCsv=require(_0x9b2c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9b2c('0xd'));var qs=require(_0x9b2c('0xe'));var logger=require(_0x9b2c('0xf'))(_0x9b2c('0x10'));var utils=require(_0x9b2c('0x11'));var config=require('../../config/environment');var db=require(_0x9b2c('0x12'))['db'];function respondWithStatusCode(_0xf49d95,_0x100b78){_0x100b78=_0x100b78||0xcc;return function(_0x41245b){if(_0x41245b){return _0xf49d95['sendStatus'](_0x100b78);}return _0xf49d95[_0x9b2c('0x13')](_0x100b78)[_0x9b2c('0x14')]();};}function respondWithResult(_0x263b24,_0x239dbd){_0x239dbd=_0x239dbd||0xc8;return function(_0x43656b){if(_0x43656b){return _0x263b24[_0x9b2c('0x13')](_0x239dbd)[_0x9b2c('0x15')](_0x43656b);}};}function respondWithFilteredResult(_0x3953b4,_0x6c145c){return function(_0x41fb87){if(_0x41fb87){var _0x2c477f=_0x41fb87[_0x9b2c('0x16')],_0x2032cf=_0x6c145c[_0x9b2c('0x17')],_0x47ee65=_0x6c145c[_0x9b2c('0x17')]+_0x6c145c[_0x9b2c('0x18')],_0x4bbaa4;if(_0x47ee65>=_0x2c477f){_0x47ee65=_0x2c477f;_0x4bbaa4=0xc8;}else{_0x4bbaa4=0xce;}_0x3953b4[_0x9b2c('0x13')](_0x4bbaa4);return _0x3953b4[_0x9b2c('0x19')](_0x9b2c('0x1a'),_0x2032cf+'-'+_0x47ee65+'/'+_0x2c477f)[_0x9b2c('0x15')](_0x41fb87);}return null;};}function patchUpdates(_0x19f45e){return function(_0x3a29c5){try{jsonpatch['apply'](_0x3a29c5,_0x19f45e,!![]);}catch(_0xb3ef0){return BPromise['reject'](_0xb3ef0);}return _0x3a29c5['save']();};}function saveUpdates(_0x96416,_0x22368a){return function(_0x4eef66){if(_0x4eef66){return _0x4eef66[_0x9b2c('0x1b')](_0x96416)[_0x9b2c('0x1c')](function(_0x4f94ab){return _0x4f94ab;});}return null;};}function removeEntity(_0x2e3b35,_0x56a452){return function(_0x355698){if(_0x355698){return _0x355698[_0x9b2c('0x1d')]()[_0x9b2c('0x1c')](function(){_0x2e3b35[_0x9b2c('0x13')](0xcc)[_0x9b2c('0x14')]();});}};}function handleEntityNotFound(_0x39fba0,_0x330e05){return function(_0x4cd878){if(!_0x4cd878){_0x39fba0[_0x9b2c('0x1e')](0x194);}return _0x4cd878;};}function handleError(_0x5ddb94,_0x4cf66f){_0x4cf66f=_0x4cf66f||0x1f4;return function(_0xcdc2bc){logger[_0x9b2c('0x1f')](_0xcdc2bc[_0x9b2c('0x20')]);if(_0xcdc2bc[_0x9b2c('0x21')]){delete _0xcdc2bc['name'];}_0x5ddb94[_0x9b2c('0x13')](_0x4cf66f)[_0x9b2c('0x22')](_0xcdc2bc);};}exports['index']=function(_0x292923,_0x1add58){var _0x309566={},_0x4c5842={},_0x5122e2={'count':0x0,'rows':[]};var _0x5038f5=db[_0x9b2c('0x23')][_0x9b2c('0x24')];_0x4c5842[_0x9b2c('0x25')]=_['differenceBy'](_['keys'](_0x5038f5),[_0x9b2c('0x21')]);var _0xd9fef9={'dateStart':_0x292923[_0x9b2c('0x26')]['dateStart'],'dateEnd':_0x292923['query'][_0x9b2c('0x27')]};delete _0x292923[_0x9b2c('0x26')][_0x9b2c('0x28')];delete _0x292923['query'][_0x9b2c('0x27')];_0x4c5842[_0x9b2c('0x26')]=_[_0x9b2c('0x29')](_0x292923[_0x9b2c('0x26')]);_0x4c5842[_0x9b2c('0x2a')]=_[_0x9b2c('0x2b')](_0x4c5842[_0x9b2c('0x25')],_0x4c5842[_0x9b2c('0x26')]);_0x309566[_0x9b2c('0x2c')]=_[_0x9b2c('0x2b')](_0x4c5842[_0x9b2c('0x25')],qs[_0x9b2c('0x2d')](_0x292923[_0x9b2c('0x26')][_0x9b2c('0x2d')]));_0x309566['attributes']=_0x309566['attributes']['length']?_0x309566[_0x9b2c('0x2c')]:_0x4c5842[_0x9b2c('0x25')];if(!_0x292923['query'][_0x9b2c('0x2e')](_0x9b2c('0x2f'))){_0x309566['limit']=qs['limit'](_0x292923[_0x9b2c('0x26')][_0x9b2c('0x18')]);_0x309566[_0x9b2c('0x17')]=qs[_0x9b2c('0x17')](_0x292923['query'][_0x9b2c('0x17')]);}_0x309566[_0x9b2c('0x30')]=qs[_0x9b2c('0x31')](_0x292923['query']['sort']);_0x309566[_0x9b2c('0x32')]=qs[_0x9b2c('0x2a')](_[_0x9b2c('0x33')](_0x292923[_0x9b2c('0x26')],_0x4c5842[_0x9b2c('0x2a')]));if(_0xd9fef9[_0x9b2c('0x28')]){if(_0xd9fef9[_0x9b2c('0x27')]){_0xd9fef9[_0x9b2c('0x27')]=moment(_0xd9fef9['dateEnd'])[_0x9b2c('0x34')](0x1,_0x9b2c('0x35'));}else{_0xd9fef9[_0x9b2c('0x27')]=moment(_0xd9fef9[_0x9b2c('0x28')])[_0x9b2c('0x34')](0x1,_0x9b2c('0x35'));}_[_0x9b2c('0x36')](_0x309566[_0x9b2c('0x32')],{'createdAt':{'$gte':_0xd9fef9[_0x9b2c('0x28')],'$lte':_0xd9fef9['dateEnd']}});}if(_0x292923['query'][_0x9b2c('0x37')]){_0x309566[_0x9b2c('0x32')]=_[_0x9b2c('0x36')](_0x309566[_0x9b2c('0x32')],{'$or':_['map'](_0x5038f5,function(_0x3db861){if(_0x3db861[_0x9b2c('0x38')]['key']!==_0x9b2c('0x39')){var _0xffe7c4={};_0xffe7c4[_0x3db861[_0x9b2c('0x3a')]]={'$like':'%'+_0x292923[_0x9b2c('0x26')]['filter']+'%'};return _0xffe7c4;}})});}_0x309566=_[_0x9b2c('0x36')]({},_0x309566,_0x292923['options']);var _0x4c6caa={'where':_0x309566[_0x9b2c('0x32')]};return db[_0x9b2c('0x23')]['count'](_0x4c6caa)['then'](function(_0x5d0445){_0x5122e2[_0x9b2c('0x16')]=_0x5d0445;if(_0x292923['query'][_0x9b2c('0x3b')]){_0x309566[_0x9b2c('0x3c')]=[{'all':!![]}];}return db[_0x9b2c('0x23')][_0x9b2c('0x3d')](_0x309566);})[_0x9b2c('0x1c')](function(_0x212184){_0x5122e2[_0x9b2c('0x3e')]=_0x212184;return _0x5122e2;})['then'](respondWithFilteredResult(_0x1add58,_0x309566))[_0x9b2c('0x3f')](handleError(_0x1add58,null));};exports[_0x9b2c('0x40')]=function(_0x275a39,_0x5b24d2){var _0x37c924={'raw':!![],'where':{'id':_0x275a39[_0x9b2c('0x41')]['id']}},_0x13c0b9={};_0x13c0b9[_0x9b2c('0x25')]=_['keys'](db[_0x9b2c('0x23')][_0x9b2c('0x24')]);_0x13c0b9[_0x9b2c('0x26')]=_[_0x9b2c('0x29')](_0x275a39[_0x9b2c('0x26')]);_0x13c0b9['filters']=_[_0x9b2c('0x2b')](_0x13c0b9[_0x9b2c('0x25')],_0x13c0b9[_0x9b2c('0x26')]);_0x37c924[_0x9b2c('0x2c')]=_[_0x9b2c('0x2b')](_0x13c0b9[_0x9b2c('0x25')],qs[_0x9b2c('0x2d')](_0x275a39[_0x9b2c('0x26')][_0x9b2c('0x2d')]));_0x37c924[_0x9b2c('0x2c')]=_0x37c924[_0x9b2c('0x2c')]['length']?_0x37c924[_0x9b2c('0x2c')]:_0x13c0b9[_0x9b2c('0x25')];if(_0x275a39[_0x9b2c('0x26')][_0x9b2c('0x3b')]){_0x37c924[_0x9b2c('0x3c')]=[{'all':!![]}];}_0x37c924=_[_0x9b2c('0x36')]({},_0x37c924,_0x275a39[_0x9b2c('0x42')]);return db[_0x9b2c('0x23')][_0x9b2c('0x43')](_0x37c924)[_0x9b2c('0x1c')](handleEntityNotFound(_0x5b24d2,null))['then'](respondWithResult(_0x5b24d2,null))['catch'](handleError(_0x5b24d2,null));};exports[_0x9b2c('0x1b')]=function(_0x114ed3,_0x502b3b){if(_0x114ed3['body']['id']){delete _0x114ed3[_0x9b2c('0x44')]['id'];}return db[_0x9b2c('0x23')]['find']({'where':{'id':_0x114ed3['params']['id']}})[_0x9b2c('0x1c')](handleEntityNotFound(_0x502b3b,null))[_0x9b2c('0x1c')](saveUpdates(_0x114ed3['body'],null))[_0x9b2c('0x1c')](respondWithResult(_0x502b3b,null))[_0x9b2c('0x3f')](handleError(_0x502b3b,null));};exports[_0x9b2c('0x1d')]=function(_0x493e78,_0x478798){return db[_0x9b2c('0x23')][_0x9b2c('0x43')]({'where':{'id':_0x493e78[_0x9b2c('0x41')]['id']}})[_0x9b2c('0x1c')](handleEntityNotFound(_0x478798,null))[_0x9b2c('0x1c')](removeEntity(_0x478798,null))[_0x9b2c('0x3f')](handleError(_0x478798,null));};exports[_0x9b2c('0x45')]=function(_0x5182e2,_0x1184ee){var _0x1a17d4;return db['sequelize'][_0x9b2c('0x46')](function(_0x544736){return db[_0x9b2c('0x23')]['create'](_0x5182e2[_0x9b2c('0x44')],{'transaction':_0x544736})[_0x9b2c('0x1c')](function(_0xe49595){_0x1a17d4=_0xe49595;var _0x15cd0e={'type':db[_0x9b2c('0x47')]['TEXT'],'transaction':_0x544736};switch(_0x5182e2[_0x9b2c('0x44')][_0x9b2c('0x38')]){case'text':_0x15cd0e[_0x9b2c('0x38')]=db['Sequelize']['TEXT'];break;case _0x9b2c('0x48'):_0x15cd0e[_0x9b2c('0x38')]=db[_0x9b2c('0x47')][_0x9b2c('0x49')];break;case _0x9b2c('0x4a'):_0x15cd0e[_0x9b2c('0x38')]=db['Sequelize'][_0x9b2c('0x4b')];_0x15cd0e[_0x9b2c('0x4c')]=![];break;default:}return db[_0x9b2c('0x4d')][_0x9b2c('0x4e')][_0x9b2c('0x4f')](_0x9b2c('0x50'),util[_0x9b2c('0x51')](_0x9b2c('0x52'),_0x1a17d4['id']),_0x15cd0e);})[_0x9b2c('0x1c')](function(){return _0x1a17d4;});})[_0x9b2c('0x1c')](respondWithResult(_0x1184ee,0xc9))[_0x9b2c('0x3f')](handleError(_0x1184ee,null));};
\ No newline at end of file
index aa5677a..312c66a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c1=['define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','bluebird','request-promise','./cmCustomField.attributes','exports'];(function(_0x4b0ca0,_0x4166f0){var _0x237522=function(_0xa45bba){while(--_0xa45bba){_0x4b0ca0['push'](_0x4b0ca0['shift']());}};_0x237522(++_0x4166f0);}(_0xe0c1,0x1b0));var _0x1e0c=function(_0x56d4cd,_0x539874){_0x56d4cd=_0x56d4cd-0x0;var _0x5e7a48=_0xe0c1[_0x56d4cd];return _0x5e7a48;};'use strict';var _=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var logger=require(_0x1e0c('0x2'))(_0x1e0c('0x3'));var moment=require('moment');var BPromise=require(_0x1e0c('0x4'));var rp=require(_0x1e0c('0x5'));var attributes=require(_0x1e0c('0x6'));module[_0x1e0c('0x7')]=function(_0x38b35c,_0x2ab9fa){return _0x38b35c[_0x1e0c('0x8')](_0x1e0c('0x9'),attributes,{'tableName':_0x1e0c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e1c=['moment','bluebird','request-promise','./cmCustomField.attributes','define','cm_custom_fields','lodash','api'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0x9e1c,0x16e));var _0xc9e1=function(_0x4d6e0c,_0x2b497c){_0x4d6e0c=_0x4d6e0c-0x0;var _0xc6d22=_0x9e1c[_0x4d6e0c];return _0xc6d22;};'use strict';var _=require(_0xc9e1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc9e1('0x1'));var moment=require(_0xc9e1('0x2'));var BPromise=require(_0xc9e1('0x3'));var rp=require(_0xc9e1('0x4'));var attributes=require(_0xc9e1('0x5'));module['exports']=function(_0x58b105,_0x5be4c9){return _0x58b105[_0xc9e1('0x6')]('CmCustomField',attributes,{'tableName':_0xc9e1('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a75394..8dec3e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc224=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2f799b,_0x35fc0c){var _0x1f71be=function(_0x17a5aa){while(--_0x17a5aa){_0x2f799b['push'](_0x2f799b['shift']());}};_0x1f71be(++_0x35fc0c);}(_0xc224,0x15c));var _0x4c22=function(_0x1b90ab,_0x101f79){_0x1b90ab=_0x1b90ab-0x0;var _0xe397f2=_0xc224[_0x1b90ab];return _0xe397f2;};'use strict';var _=require(_0x4c22('0x0'));var util=require(_0x4c22('0x1'));var moment=require(_0x4c22('0x2'));var BPromise=require(_0x4c22('0x3'));var rs=require(_0x4c22('0x4'));var fs=require('fs');var Redis=require(_0x4c22('0x5'));var db=require(_0x4c22('0x6'))['db'];var utils=require(_0x4c22('0x7'));var logger=require('../../config/logger')(_0x4c22('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c22('0x9'));var client=jayson[_0x4c22('0xa')][_0x4c22('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a1f05,_0x20a45c,_0x1a1267){return new BPromise(function(_0x30389a,_0x584797){return client[_0x4c22('0xc')](_0x3a1f05,_0x1a1267)['then'](function(_0x3a31d6){logger['info'](_0x4c22('0xd'),_0x20a45c,_0x4c22('0xe'));logger[_0x4c22('0xf')](_0x4c22('0x10'),_0x20a45c,'request\x20sent',JSON[_0x4c22('0x11')](_0x3a31d6));if(_0x3a31d6[_0x4c22('0x12')]){if(_0x3a31d6['error']['code']===0x1f4){logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x3a31d6[_0x4c22('0x12')][_0x4c22('0x13')]);return _0x584797(_0x3a31d6[_0x4c22('0x12')][_0x4c22('0x13')]);}logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x3a31d6['error'][_0x4c22('0x13')]);return _0x30389a(_0x3a31d6[_0x4c22('0x12')]['message']);}else{logger[_0x4c22('0x14')]('CmCustomField,\x20%s,\x20%s',_0x20a45c,_0x4c22('0xe'));_0x30389a(_0x3a31d6[_0x4c22('0x15')][_0x4c22('0x13')]);}})[_0x4c22('0x16')](function(_0x4229a1){logger[_0x4c22('0x12')](_0x4c22('0xd'),_0x20a45c,_0x4229a1);_0x584797(_0x4229a1);});});}
\ No newline at end of file
+var _0x61c5=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x61c5,0x1e8));var _0x561c=function(_0x56d879,_0x143071){_0x56d879=_0x56d879-0x0;var _0x3ac07d=_0x61c5[_0x56d879];return _0x3ac07d;};'use strict';var _=require(_0x561c('0x0'));var util=require('util');var moment=require(_0x561c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x561c('0x2'));var logger=require(_0x561c('0x3'))(_0x561c('0x4'));var config=require(_0x561c('0x5'));var jayson=require(_0x561c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c5d0c,_0x42574e,_0x1d3b9b){return new BPromise(function(_0x4ff80c,_0x1822d5){return client[_0x561c('0x7')](_0x4c5d0c,_0x1d3b9b)[_0x561c('0x8')](function(_0x58b1b2){logger[_0x561c('0x9')](_0x561c('0xa'),_0x42574e,_0x561c('0xb'));logger[_0x561c('0xc')](_0x561c('0xd'),_0x42574e,_0x561c('0xb'),JSON[_0x561c('0xe')](_0x58b1b2));if(_0x58b1b2[_0x561c('0xf')]){if(_0x58b1b2[_0x561c('0xf')][_0x561c('0x10')]===0x1f4){logger[_0x561c('0xf')](_0x561c('0xa'),_0x42574e,_0x58b1b2['error'][_0x561c('0x11')]);return _0x1822d5(_0x58b1b2[_0x561c('0xf')][_0x561c('0x11')]);}logger[_0x561c('0xf')](_0x561c('0xa'),_0x42574e,_0x58b1b2[_0x561c('0xf')]['message']);return _0x4ff80c(_0x58b1b2[_0x561c('0xf')]['message']);}else{logger[_0x561c('0x9')]('CmCustomField,\x20%s,\x20%s',_0x42574e,_0x561c('0xb'));_0x4ff80c(_0x58b1b2[_0x561c('0x12')][_0x561c('0x11')]);}})[_0x561c('0x13')](function(_0x1c71c4){logger[_0x561c('0xf')](_0x561c('0xa'),_0x42574e,_0x1c71c4);_0x1822d5(_0x1c71c4);});});}
\ No newline at end of file
index df17b45..2228ea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6310=['show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x1dd6e7,_0x1cda2b){var _0xb53aa4=function(_0xd2ac7b){while(--_0xd2ac7b){_0x1dd6e7['push'](_0x1dd6e7['shift']());}};_0xb53aa4(++_0x1cda2b);}(_0x6310,0xa0));var _0x0631=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x6310[_0x1477ef];return _0x164acd;};'use strict';var multer=require(_0x0631('0x0'));var util=require(_0x0631('0x1'));var path=require('path');var timeout=require(_0x0631('0x2'));var express=require(_0x0631('0x3'));var router=express[_0x0631('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0631('0x5'));var config=require('../../config/environment');var controller=require(_0x0631('0x6'));router[_0x0631('0x7')]('/',auth[_0x0631('0x8')](),controller[_0x0631('0x9')]);router[_0x0631('0x7')]('/:id',auth[_0x0631('0x8')](),controller[_0x0631('0xa')]);router[_0x0631('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0631('0xc')](_0x0631('0xd'),auth[_0x0631('0x8')](),controller[_0x0631('0xe')]);router[_0x0631('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0631('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x2967=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x2967,0x16b));var _0x7296=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0x2967[_0x1d7037];return _0x4d6568;};'use strict';var multer=require(_0x7296('0x0'));var util=require(_0x7296('0x1'));var path=require(_0x7296('0x2'));var timeout=require(_0x7296('0x3'));var express=require('express');var router=express[_0x7296('0x4')]();var auth=require(_0x7296('0x5'));var interaction=require(_0x7296('0x6'));var config=require(_0x7296('0x7'));var controller=require('./cmCustomField.controller');router[_0x7296('0x8')]('/',auth['isAuthenticated'](),controller[_0x7296('0x9')]);router[_0x7296('0x8')](_0x7296('0xa'),auth[_0x7296('0xb')](),controller[_0x7296('0xc')]);router[_0x7296('0xd')]('/',auth['isAuthenticated'](),controller[_0x7296('0xe')]);router[_0x7296('0xf')](_0x7296('0xa'),auth[_0x7296('0xb')](),controller[_0x7296('0x10')]);router[_0x7296('0x11')]('/:id',auth[_0x7296('0xb')](),controller[_0x7296('0x12')]);module[_0x7296('0x13')]=router;
\ No newline at end of file
index 7c3c9c7..dcc4a1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf815=['BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','contactListQueue','moment','sequelize','STRING'];(function(_0x1c3918,_0x2fd070){var _0x35874a=function(_0x448104){while(--_0x448104){_0x1c3918['push'](_0x1c3918['shift']());}};_0x35874a(++_0x2fd070);}(_0xf815,0x16e));var _0x5f81=function(_0x20e200,_0x35bee2){_0x20e200=_0x20e200-0x0;var _0x2e257a=_0xf815[_0x20e200];return _0x2e257a;};'use strict';var moment=require(_0x5f81('0x0'));var Sequelize=require(_0x5f81('0x1'));module['exports']={'phone':{'type':Sequelize[_0x5f81('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x5f81('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5f81('0x4')](_0x5f81('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5f81('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5f81('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5f81('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5f81('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5f81('0x7')]},'priority':{'type':Sequelize[_0x5f81('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5f81('0x8')},'ListId':{'type':Sequelize[_0x5f81('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x5f81('0x6')],'unique':_0x5f81('0x8')},'CampaignId':{'type':Sequelize[_0x5f81('0x6')]}};
\ No newline at end of file
+var _0x0e1f=['contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x18474f,_0x51e0f9){var _0xab5297=function(_0x4b2327){while(--_0x4b2327){_0x18474f['push'](_0x18474f['shift']());}};_0xab5297(++_0x51e0f9);}(_0x0e1f,0x1cd));var _0xf0e1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0e1f[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require(_0xf0e1('0x0'));var Sequelize=require(_0xf0e1('0x1'));module[_0xf0e1('0x2')]={'phone':{'type':Sequelize[_0xf0e1('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xf0e1('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf0e1('0x5')],'defaultValue':moment()[_0xf0e1('0x6')](_0xf0e1('0x7'))},'countbusyretry':{'type':Sequelize[_0xf0e1('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf0e1('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf0e1('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf0e1('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf0e1('0x8')],'unique':_0xf0e1('0x9')},'ListId':{'type':Sequelize[_0xf0e1('0x8')],'unique':_0xf0e1('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xf0e1('0x8')],'unique':_0xf0e1('0x9')},'CampaignId':{'type':Sequelize[_0xf0e1('0x8')]}};
\ No newline at end of file
index b0afe7c..fd46fdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d44=['keys','query','dateEnd','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','dateStart','day','add','merge','filter','map','type','VIRTUAL','field','options','CmHopper','include','findAll','rows','catch','show','params','includeAll','find','body','describe','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','lastName','isNil','calleridname','firstName','finally','getPreview','CmContact','outbound','preview','sequelize','transaction','direction','prev','hopperIds','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','LOCK','UPDATE','CmCompany','CmList','List','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','model'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0x2d44,0x6c));var _0x42d4=function(_0x31bc98,_0x4e61dc){_0x31bc98=_0x31bc98-0x0;var _0xf8633=_0x2d44[_0x31bc98];return _0xf8633;};'use strict';var pdf=require(_0x42d4('0x0'));var emlformat=require(_0x42d4('0x1'));var rimraf=require(_0x42d4('0x2'));var zipdir=require(_0x42d4('0x3'));var jsonpatch=require(_0x42d4('0x4'));var rp=require('request-promise');var moment=require(_0x42d4('0x5'));var BPromise=require(_0x42d4('0x6'));var Mustache=require(_0x42d4('0x7'));var util=require('util');var path=require('path');var sox=require(_0x42d4('0x8'));var csv=require(_0x42d4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x42d4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x42d4('0xb'));var deskjs=require(_0x42d4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x42d4('0xd'));var Papa=require(_0x42d4('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x42d4('0xf'))(_0x42d4('0x10'));var utils=require(_0x42d4('0x11'));var config=require(_0x42d4('0x12'));var db=require(_0x42d4('0x13'))['db'];function respondWithStatusCode(_0xf3c80a,_0x5a41ae){_0x5a41ae=_0x5a41ae||0xcc;return function(_0x30c29f){if(_0x30c29f){return _0xf3c80a[_0x42d4('0x14')](_0x5a41ae);}return _0xf3c80a['status'](_0x5a41ae)[_0x42d4('0x15')]();};}function respondWithResult(_0x124556,_0x238d83){_0x238d83=_0x238d83||0xc8;return function(_0x38866b){if(_0x38866b){return _0x124556['status'](_0x238d83)['json'](_0x38866b);}};}function respondWithFilteredResult(_0x45ae4d,_0x3c4cec){return function(_0x378d8e){if(_0x378d8e){var _0x31eaba=_0x378d8e[_0x42d4('0x16')],_0x1d51f9=_0x3c4cec[_0x42d4('0x17')],_0x2b26e1=_0x3c4cec['offset']+_0x3c4cec[_0x42d4('0x18')],_0x483d69;if(_0x2b26e1>=_0x31eaba){_0x2b26e1=_0x31eaba;_0x483d69=0xc8;}else{_0x483d69=0xce;}_0x45ae4d[_0x42d4('0x19')](_0x483d69);return _0x45ae4d[_0x42d4('0x1a')](_0x42d4('0x1b'),_0x1d51f9+'-'+_0x2b26e1+'/'+_0x31eaba)[_0x42d4('0x1c')](_0x378d8e);}return null;};}function patchUpdates(_0x29aad0){return function(_0x559e0e){try{jsonpatch['apply'](_0x559e0e,_0x29aad0,!![]);}catch(_0x1516e5){return BPromise[_0x42d4('0x1d')](_0x1516e5);}return _0x559e0e['save']();};}function saveUpdates(_0x41e291,_0x53cb4c){return function(_0x1a4301){if(_0x1a4301){return _0x1a4301[_0x42d4('0x1e')](_0x41e291)[_0x42d4('0x1f')](function(_0x4a2591){return _0x4a2591;});}return null;};}function removeEntity(_0x3c6d16,_0x1725d5){return function(_0x37d7a4){if(_0x37d7a4){return _0x37d7a4[_0x42d4('0x20')]()[_0x42d4('0x1f')](function(){_0x3c6d16[_0x42d4('0x19')](0xcc)[_0x42d4('0x15')]();});}};}function handleEntityNotFound(_0x106333,_0x4fb0d8){return function(_0x46e17d){if(!_0x46e17d){_0x106333[_0x42d4('0x14')](0x194);}return _0x46e17d;};}function handleError(_0x2495bb,_0x3fc14d){_0x3fc14d=_0x3fc14d||0x1f4;return function(_0xe712c3){logger[_0x42d4('0x21')](_0xe712c3[_0x42d4('0x22')]);if(_0xe712c3[_0x42d4('0x23')]){delete _0xe712c3[_0x42d4('0x23')];}_0x2495bb[_0x42d4('0x19')](_0x3fc14d)[_0x42d4('0x24')](_0xe712c3);};}exports[_0x42d4('0x25')]=function(_0x23ad53,_0x7a5224){var _0x3a510f={},_0x1e59c7={},_0x208246={'count':0x0,'rows':[]};var _0x2be857=db['CmHopper'][_0x42d4('0x26')];_0x1e59c7[_0x42d4('0x27')]=_[_0x42d4('0x28')](_0x2be857);var _0x20b642={'dateStart':_0x23ad53['query']['dateStart'],'dateEnd':_0x23ad53[_0x42d4('0x29')][_0x42d4('0x2a')]};delete _0x23ad53[_0x42d4('0x29')]['dateStart'];delete _0x23ad53['query']['dateEnd'];_0x1e59c7['query']=_[_0x42d4('0x28')](_0x23ad53[_0x42d4('0x29')]);_0x1e59c7[_0x42d4('0x2b')]=_[_0x42d4('0x2c')](_0x1e59c7['model'],_0x1e59c7[_0x42d4('0x29')]);_0x1e59c7['filters']=_[_0x42d4('0x2d')](_0x1e59c7['filters'],[_0x42d4('0x2e'),_0x42d4('0x2f'),_0x42d4('0x30'),_0x42d4('0x31'),_0x42d4('0x32'),_0x42d4('0x33'),_0x42d4('0x34'),_0x42d4('0x35'),_0x42d4('0x36'),_0x42d4('0x37'),_0x42d4('0x38'),_0x42d4('0x39'),_0x42d4('0x3a'),_0x42d4('0x3b'),_0x42d4('0x3c'),'$iLike',_0x42d4('0x3d'),_0x42d4('0x3b'),_0x42d4('0x3e'),_0x42d4('0x3f'),_0x42d4('0x40'),'$any']);_0x3a510f[_0x42d4('0x41')]=_['intersection'](_0x1e59c7[_0x42d4('0x27')],qs[_0x42d4('0x42')](_0x23ad53[_0x42d4('0x29')][_0x42d4('0x42')]));_0x3a510f['attributes']=_0x3a510f['attributes'][_0x42d4('0x43')]?_0x3a510f[_0x42d4('0x41')]:_0x1e59c7['model'];if(!_0x23ad53[_0x42d4('0x29')][_0x42d4('0x44')](_0x42d4('0x45'))){_0x3a510f[_0x42d4('0x18')]=qs[_0x42d4('0x18')](_0x23ad53[_0x42d4('0x29')][_0x42d4('0x18')]);_0x3a510f[_0x42d4('0x17')]=qs[_0x42d4('0x17')](_0x23ad53[_0x42d4('0x29')]['offset']);}_0x3a510f[_0x42d4('0x46')]=qs['sort'](_0x23ad53['query'][_0x42d4('0x47')]);_0x3a510f[_0x42d4('0x48')]=qs[_0x42d4('0x2b')](_[_0x42d4('0x49')](_0x23ad53[_0x42d4('0x29')],_0x1e59c7[_0x42d4('0x2b')]));if(_0x20b642[_0x42d4('0x4a')]){if(_0x20b642['dateEnd']){_0x20b642['dateEnd']=moment(_0x20b642['dateEnd'])['add'](0x1,_0x42d4('0x4b'));}else{_0x20b642[_0x42d4('0x2a')]=moment(_0x20b642['dateStart'])[_0x42d4('0x4c')](0x1,_0x42d4('0x4b'));}_[_0x42d4('0x4d')](_0x3a510f[_0x42d4('0x48')],{'createdAt':{'$gte':_0x20b642['dateStart'],'$lte':_0x20b642[_0x42d4('0x2a')]}});}if(_0x23ad53[_0x42d4('0x29')][_0x42d4('0x4e')]){_0x3a510f['where']=_[_0x42d4('0x4d')](_0x3a510f[_0x42d4('0x48')],{'$or':_[_0x42d4('0x4f')](_0x2be857,function(_0x248d94){if(_0x248d94[_0x42d4('0x50')]['key']!==_0x42d4('0x51')){var _0x2221fc={};_0x2221fc[_0x248d94[_0x42d4('0x52')]]={'$like':'%'+_0x23ad53[_0x42d4('0x29')][_0x42d4('0x4e')]+'%'};return _0x2221fc;}})});}_0x3a510f=_['merge']({},_0x3a510f,_0x23ad53[_0x42d4('0x53')]);var _0x3bc794={'where':_0x3a510f['where']};return db[_0x42d4('0x54')][_0x42d4('0x16')](_0x3bc794)['then'](function(_0x23500e){_0x208246[_0x42d4('0x16')]=_0x23500e;if(_0x23ad53[_0x42d4('0x29')]['includeAll']){_0x3a510f[_0x42d4('0x55')]=[{'all':!![]}];}return db[_0x42d4('0x54')][_0x42d4('0x56')](_0x3a510f);})['then'](function(_0x2a080d){_0x208246[_0x42d4('0x57')]=_0x2a080d;return _0x208246;})[_0x42d4('0x1f')](respondWithFilteredResult(_0x7a5224,_0x3a510f))[_0x42d4('0x58')](handleError(_0x7a5224,null));};exports[_0x42d4('0x59')]=function(_0x2d7cf0,_0x3cf548){var _0xe1239f={'raw':!![],'where':{'id':_0x2d7cf0[_0x42d4('0x5a')]['id']}},_0x180390={};_0x180390[_0x42d4('0x27')]=_[_0x42d4('0x28')](db[_0x42d4('0x54')]['rawAttributes']);_0x180390[_0x42d4('0x29')]=_[_0x42d4('0x28')](_0x2d7cf0[_0x42d4('0x29')]);_0x180390[_0x42d4('0x2b')]=_[_0x42d4('0x2c')](_0x180390[_0x42d4('0x27')],_0x180390[_0x42d4('0x29')]);_0xe1239f[_0x42d4('0x41')]=_[_0x42d4('0x2c')](_0x180390[_0x42d4('0x27')],qs[_0x42d4('0x42')](_0x2d7cf0[_0x42d4('0x29')][_0x42d4('0x42')]));_0xe1239f[_0x42d4('0x41')]=_0xe1239f['attributes']['length']?_0xe1239f['attributes']:_0x180390[_0x42d4('0x27')];if(_0x2d7cf0[_0x42d4('0x29')][_0x42d4('0x5b')]){_0xe1239f[_0x42d4('0x55')]=[{'all':!![]}];}_0xe1239f=_['merge']({},_0xe1239f,_0x2d7cf0['options']);return db[_0x42d4('0x54')][_0x42d4('0x5c')](_0xe1239f)[_0x42d4('0x1f')](handleEntityNotFound(_0x3cf548,null))[_0x42d4('0x1f')](respondWithResult(_0x3cf548,null))[_0x42d4('0x58')](handleError(_0x3cf548,null));};exports['create']=function(_0x47f037,_0x322628){return db[_0x42d4('0x54')]['create'](_0x47f037[_0x42d4('0x5d')],{})[_0x42d4('0x1f')](respondWithResult(_0x322628,0xc9))[_0x42d4('0x58')](handleError(_0x322628,null));};exports[_0x42d4('0x1e')]=function(_0x4aa4ba,_0x1f27d0){if(_0x4aa4ba[_0x42d4('0x5d')]['id']){delete _0x4aa4ba['body']['id'];}return db['CmHopper'][_0x42d4('0x5c')]({'where':{'id':_0x4aa4ba[_0x42d4('0x5a')]['id']}})[_0x42d4('0x1f')](handleEntityNotFound(_0x1f27d0,null))['then'](saveUpdates(_0x4aa4ba[_0x42d4('0x5d')],null))['then'](respondWithResult(_0x1f27d0,null))[_0x42d4('0x58')](handleError(_0x1f27d0,null));};exports['describe']=function(_0x266f19,_0xbc525d){return db[_0x42d4('0x54')][_0x42d4('0x5e')]()[_0x42d4('0x1f')](respondWithResult(_0xbc525d,null))[_0x42d4('0x58')](handleError(_0xbc525d,null));};exports[_0x42d4('0x20')]=function(_0x14cf9c,_0x51da22){var _0x508058;return db[_0x42d4('0x54')]['find']({'where':{'id':_0x14cf9c[_0x42d4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x51da22,null))[_0x42d4('0x1f')](function(_0x44e43d){if(_0x44e43d){return _0x44e43d[_0x42d4('0x20')]()[_0x42d4('0x1f')](function(_0xad926f){return _0xad926f;});}})['then'](function(_0x18af35){_0x508058=_0x18af35;if(_0x18af35){if(_0x18af35['VoiceQueueId']||_0x18af35[_0x42d4('0x5f')]){return db[_0x18af35[_0x42d4('0x60')]?'VoiceQueue':_0x42d4('0x61')][_0x42d4('0x5c')]({'where':{'id':_0x18af35[_0x42d4('0x60')]?_0x18af35[_0x42d4('0x60')]:_0x18af35[_0x42d4('0x5f')]},'attributes':['id',_0x42d4('0x23')],'raw':!![]});}}})[_0x42d4('0x1f')](function(_0x2813e4){var _0x3621f3={};if(_0x2813e4){_[_0x42d4('0x4d')](_0x3621f3,_[_0x42d4('0x62')](_0x508058[_0x42d4('0x63')],[_0x42d4('0x64'),_0x42d4('0x65'),'id']));_0x3621f3['state']=0x15;_0x3621f3[_0x42d4('0x66')]='deleted';_0x3621f3[_0x42d4('0x67')]=_0x2813e4[_0x42d4('0x23')];_0x3621f3[_0x42d4('0x68')]=_0x14cf9c[_0x42d4('0x69')][_0x42d4('0x23')];_0x3621f3[_0x42d4('0x6a')]=_0x14cf9c[_0x42d4('0x69')]['id'];_0x3621f3[_0x42d4('0x6b')]=!![];_0x3621f3[_0x42d4('0x6c')]=moment()[_0x42d4('0x6d')](_0x42d4('0x6e'));_0x3621f3['calleridnum']=_0x508058[_0x42d4('0x6f')];_0x3621f3[_0x42d4('0x70')]=_0x508058[_0x42d4('0x60')]?_0x42d4('0x71'):_0x42d4('0x72');return db['CmContact'][_0x42d4('0x5c')]({'where':{'id':_0x3621f3['ContactId']},'attributes':['firstName',_0x42d4('0x73')]})[_0x42d4('0x1f')](function(_0x511533){if(!_[_0x42d4('0x74')](_0x51da22)&&!_[_0x42d4('0x74')](_0x511533['firstName'])){_0x3621f3[_0x42d4('0x75')]=_0x511533[_0x42d4('0x76')];if(!_[_0x42d4('0x74')](_0x511533['lastName'])){_0x3621f3[_0x42d4('0x75')]+='\x20'+_0x511533[_0x42d4('0x73')];}}})[_0x42d4('0x77')](function(){return db['CmHopperFinal']['create'](_0x3621f3);});}})[_0x42d4('0x1f')](function(){return _0x51da22['status'](0xcc)[_0x42d4('0x15')]();})[_0x42d4('0x58')](handleError(_0x51da22,null));};exports[_0x42d4('0x78')]=function(_0x398944,_0x3a9dca,_0x2e27be){var _0x58ec90=[];return db[_0x42d4('0x79')][_0x42d4('0x5e')]()[_0x42d4('0x1f')](function(_0x15cd10){_0x58ec90=_[_0x42d4('0x28')](_0x15cd10);return _0x398944['user']['getVoiceQueues']({'where':{'type':_0x42d4('0x7a'),'dialActive':!![],'dialMethod':_0x42d4('0x7b')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x15381a){if(_0x15381a&&_0x15381a[_0x42d4('0x43')]){return db[_0x42d4('0x7c')][_0x42d4('0x7d')](function(_0x175829){var _0x3bb158={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x42d4('0x6d')](_0x42d4('0x6e'))},'VoiceQueueId':{'$in':_[_0x42d4('0x4f')](_0x15381a,'id')},'$or':[{'UserId':null},{'UserId':_0x398944['user']['id']}]};var _0x4d19b6=[];if(_0x398944[_0x42d4('0x5d')][_0x42d4('0x7e')]&&_0x398944[_0x42d4('0x5d')][_0x42d4('0x7e')]===_0x42d4('0x7f')){if(!_['isEmpty'](_0x398944[_0x42d4('0x5d')][_0x42d4('0x80')])){_0x3bb158['id']={'$in':_0x398944[_0x42d4('0x5d')][_0x42d4('0x80')]};}_0x4d19b6=[['priority',_0x42d4('0x81')],[_0x42d4('0x82'),_0x15381a[0x0][_0x42d4('0x83')]===_0x42d4('0x81')?_0x42d4('0x84'):_0x42d4('0x81')],db[_0x42d4('0x7c')][_0x42d4('0x85')](_0x42d4('0x86')),['id',_0x42d4('0x84')]];}else{if(!_['isEmpty'](_0x398944[_0x42d4('0x5d')][_0x42d4('0x80')])){_0x3bb158['id']={'$notIn':_0x398944['body']['hopperIds']};}_0x4d19b6=[[_0x42d4('0x87'),_0x42d4('0x84')],['scheduledAt',_0x15381a[0x0][_0x42d4('0x83')]],db['sequelize'][_0x42d4('0x85')](_0x42d4('0x88')),['id',_0x42d4('0x81')]];}return db['CmHopper']['findOne']({'attributes':['id','scheduledat'],'where':_0x3bb158,'order':_0x4d19b6,'transaction':_0x175829,'lock':_0x175829[_0x42d4('0x89')][_0x42d4('0x8a')],'include':[{'model':db[_0x42d4('0x79')],'as':'Contact','attributes':_0x58ec90,'include':[{'model':db[_0x42d4('0x8b')],'as':'Company','attributes':['id',_0x42d4('0x23')]}]},{'model':db[_0x42d4('0x8c')],'as':_0x42d4('0x8d'),'attributes':['id',_0x42d4('0x23')]},{'model':db['VoiceQueue'],'as':_0x42d4('0x8e'),'attributes':['id',_0x42d4('0x23'),_0x42d4('0x8f')]}]})[_0x42d4('0x1f')](function(_0xc76ec7){if(_0xc76ec7){return _0xc76ec7[_0x42d4('0x1e')]({'UserId':_0x398944[_0x42d4('0x69')]['id']},{'transaction':_0x175829});}});});}})[_0x42d4('0x1f')](handleEntityNotFound(_0x3a9dca,null))[_0x42d4('0x1f')](respondWithResult(_0x3a9dca,null))[_0x42d4('0x58')](handleError(_0x3a9dca,null));};exports[_0x42d4('0x90')]=function(_0x4abf64,_0x235a33,_0xa6928d){return _0x4abf64[_0x42d4('0x69')]['getVoiceQueues']({'where':{'type':_0x42d4('0x7a'),'dialActive':!![],'dialMethod':_0x42d4('0x7b')},'attributes':['id'],'raw':!![]})[_0x42d4('0x1f')](function(_0x56b180){if(_0x56b180&&_0x56b180['length']){return db[_0x42d4('0x54')][_0x42d4('0x16')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x42d4('0x6d')](_0x42d4('0x6e'))},'VoiceQueueId':{'$in':_[_0x42d4('0x4f')](_0x56b180,'id')},'$or':[{'UserId':null},{'UserId':_0x4abf64[_0x42d4('0x69')]['id']}]}});}return 0x0;})['then'](function(_0x4adcf5){if(!_[_0x42d4('0x74')](_0x4adcf5)&&_[_0x42d4('0x91')](_0x4adcf5)){return _0x235a33[_0x42d4('0x19')](0xc8)[_0x42d4('0x1c')]({'contacts':_0x4adcf5});}else{logger[_0x42d4('0x21')](_0x42d4('0x92'),_0x42d4('0x90'),0x194,_0x42d4('0x93'));_0x235a33[_0x42d4('0x14')](0x194);}})['catch'](handleError(_0x235a33,null));};
\ No newline at end of file
+var _0xdbdf=['getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','scheduledAt','DESC','ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','reject','save','update','destroy','then','stack','send','index','rawAttributes','model','keys','query','dateEnd','filters','intersection','concat','$and','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','add','day','dateStart','merge','filter','map','type','key','VIRTUAL','field','options','CmHopper','includeAll','include','rows','catch','params','length','create','body','find','describe','VoiceQueueId','CampaignId','Campaign','name','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal'];(function(_0x4418db,_0x1d219f){var _0x4671f2=function(_0x1a6dbb){while(--_0x1a6dbb){_0x4418db['push'](_0x4418db['shift']());}};_0x4671f2(++_0x1d219f);}(_0xdbdf,0x1ec));var _0xfdbd=function(_0xbf15fb,_0xbf8e46){_0xbf15fb=_0xbf15fb-0x0;var _0x2a1941=_0xdbdf[_0xbf15fb];return _0x2a1941;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfdbd('0x0'));var rimraf=require(_0xfdbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdbd('0x2'));var rp=require(_0xfdbd('0x3'));var moment=require(_0xfdbd('0x4'));var BPromise=require(_0xfdbd('0x5'));var Mustache=require('mustache');var util=require(_0xfdbd('0x6'));var path=require('path');var sox=require(_0xfdbd('0x7'));var csv=require(_0xfdbd('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfdbd('0x9'));var squel=require(_0xfdbd('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdbd('0xb'));var deskjs=require(_0xfdbd('0xc'));var toCsv=require(_0xfdbd('0x8'));var querystring=require('querystring');var Papa=require(_0xfdbd('0xd'));var Redis=require(_0xfdbd('0xe'));var qs=require(_0xfdbd('0xf'));var logger=require('../../config/logger')(_0xfdbd('0x10'));var utils=require(_0xfdbd('0x11'));var config=require(_0xfdbd('0x12'));var db=require(_0xfdbd('0x13'))['db'];function respondWithStatusCode(_0x2c99dd,_0x104ad9){_0x104ad9=_0x104ad9||0xcc;return function(_0x45d162){if(_0x45d162){return _0x2c99dd[_0xfdbd('0x14')](_0x104ad9);}return _0x2c99dd[_0xfdbd('0x15')](_0x104ad9)[_0xfdbd('0x16')]();};}function respondWithResult(_0x512bc7,_0x49ee67){_0x49ee67=_0x49ee67||0xc8;return function(_0x11830f){if(_0x11830f){return _0x512bc7[_0xfdbd('0x15')](_0x49ee67)[_0xfdbd('0x17')](_0x11830f);}};}function respondWithFilteredResult(_0x206cd6,_0x2d5e0d){return function(_0x4f851a){if(_0x4f851a){var _0x60895f=_0x4f851a[_0xfdbd('0x18')],_0x443793=_0x2d5e0d['offset'],_0x5acea5=_0x2d5e0d['offset']+_0x2d5e0d[_0xfdbd('0x19')],_0x14ac9c;if(_0x5acea5>=_0x60895f){_0x5acea5=_0x60895f;_0x14ac9c=0xc8;}else{_0x14ac9c=0xce;}_0x206cd6['status'](_0x14ac9c);return _0x206cd6['set'](_0xfdbd('0x1a'),_0x443793+'-'+_0x5acea5+'/'+_0x60895f)['json'](_0x4f851a);}return null;};}function patchUpdates(_0x43b822){return function(_0x47d0c8){try{jsonpatch['apply'](_0x47d0c8,_0x43b822,!![]);}catch(_0x29ee08){return BPromise[_0xfdbd('0x1b')](_0x29ee08);}return _0x47d0c8[_0xfdbd('0x1c')]();};}function saveUpdates(_0x35e1a4,_0x5b8faa){return function(_0x1d8515){if(_0x1d8515){return _0x1d8515[_0xfdbd('0x1d')](_0x35e1a4)['then'](function(_0xefad02){return _0xefad02;});}return null;};}function removeEntity(_0x707261,_0x5bb2bc){return function(_0x5bb287){if(_0x5bb287){return _0x5bb287[_0xfdbd('0x1e')]()[_0xfdbd('0x1f')](function(){_0x707261['status'](0xcc)[_0xfdbd('0x16')]();});}};}function handleEntityNotFound(_0x11c7eb,_0x5dc009){return function(_0x4e8e14){if(!_0x4e8e14){_0x11c7eb[_0xfdbd('0x14')](0x194);}return _0x4e8e14;};}function handleError(_0x2033f9,_0x231a93){_0x231a93=_0x231a93||0x1f4;return function(_0xf79786){logger['error'](_0xf79786[_0xfdbd('0x20')]);if(_0xf79786['name']){delete _0xf79786['name'];}_0x2033f9[_0xfdbd('0x15')](_0x231a93)[_0xfdbd('0x21')](_0xf79786);};}exports[_0xfdbd('0x22')]=function(_0x52bf91,_0x4404b2){var _0x4ce895={},_0x532d87={},_0x3b574c={'count':0x0,'rows':[]};var _0xbda6fa=db['CmHopper'][_0xfdbd('0x23')];_0x532d87[_0xfdbd('0x24')]=_[_0xfdbd('0x25')](_0xbda6fa);var _0x179ffc={'dateStart':_0x52bf91[_0xfdbd('0x26')]['dateStart'],'dateEnd':_0x52bf91['query'][_0xfdbd('0x27')]};delete _0x52bf91[_0xfdbd('0x26')]['dateStart'];delete _0x52bf91[_0xfdbd('0x26')][_0xfdbd('0x27')];_0x532d87[_0xfdbd('0x26')]=_[_0xfdbd('0x25')](_0x52bf91[_0xfdbd('0x26')]);_0x532d87[_0xfdbd('0x28')]=_[_0xfdbd('0x29')](_0x532d87[_0xfdbd('0x24')],_0x532d87[_0xfdbd('0x26')]);_0x532d87['filters']=_[_0xfdbd('0x2a')](_0x532d87[_0xfdbd('0x28')],[_0xfdbd('0x2b'),'$or','$gt',_0xfdbd('0x2c'),_0xfdbd('0x2d'),_0xfdbd('0x2e'),_0xfdbd('0x2f'),'$eq',_0xfdbd('0x30'),_0xfdbd('0x31'),_0xfdbd('0x32'),_0xfdbd('0x33'),'$notIn',_0xfdbd('0x34'),_0xfdbd('0x35'),_0xfdbd('0x36'),_0xfdbd('0x37'),_0xfdbd('0x34'),_0xfdbd('0x38'),_0xfdbd('0x39'),_0xfdbd('0x3a'),_0xfdbd('0x3b')]);_0x4ce895[_0xfdbd('0x3c')]=_[_0xfdbd('0x29')](_0x532d87['model'],qs[_0xfdbd('0x3d')](_0x52bf91[_0xfdbd('0x26')]['fields']));_0x4ce895[_0xfdbd('0x3c')]=_0x4ce895[_0xfdbd('0x3c')]['length']?_0x4ce895['attributes']:_0x532d87[_0xfdbd('0x24')];if(!_0x52bf91[_0xfdbd('0x26')][_0xfdbd('0x3e')](_0xfdbd('0x3f'))){_0x4ce895[_0xfdbd('0x19')]=qs['limit'](_0x52bf91[_0xfdbd('0x26')]['limit']);_0x4ce895['offset']=qs['offset'](_0x52bf91[_0xfdbd('0x26')][_0xfdbd('0x40')]);}_0x4ce895[_0xfdbd('0x41')]=qs[_0xfdbd('0x42')](_0x52bf91[_0xfdbd('0x26')][_0xfdbd('0x42')]);_0x4ce895[_0xfdbd('0x43')]=qs[_0xfdbd('0x28')](_[_0xfdbd('0x44')](_0x52bf91[_0xfdbd('0x26')],_0x532d87['filters']));if(_0x179ffc['dateStart']){if(_0x179ffc[_0xfdbd('0x27')]){_0x179ffc[_0xfdbd('0x27')]=moment(_0x179ffc[_0xfdbd('0x27')])[_0xfdbd('0x45')](0x1,_0xfdbd('0x46'));}else{_0x179ffc[_0xfdbd('0x27')]=moment(_0x179ffc[_0xfdbd('0x47')])[_0xfdbd('0x45')](0x1,_0xfdbd('0x46'));}_[_0xfdbd('0x48')](_0x4ce895[_0xfdbd('0x43')],{'createdAt':{'$gte':_0x179ffc['dateStart'],'$lte':_0x179ffc[_0xfdbd('0x27')]}});}if(_0x52bf91[_0xfdbd('0x26')][_0xfdbd('0x49')]){_0x4ce895[_0xfdbd('0x43')]=_[_0xfdbd('0x48')](_0x4ce895['where'],{'$or':_[_0xfdbd('0x4a')](_0xbda6fa,function(_0x506219){if(_0x506219[_0xfdbd('0x4b')][_0xfdbd('0x4c')]!==_0xfdbd('0x4d')){var _0x4615e7={};_0x4615e7[_0x506219[_0xfdbd('0x4e')]]={'$like':'%'+_0x52bf91[_0xfdbd('0x26')][_0xfdbd('0x49')]+'%'};return _0x4615e7;}})});}_0x4ce895=_[_0xfdbd('0x48')]({},_0x4ce895,_0x52bf91[_0xfdbd('0x4f')]);var _0x2fb847={'where':_0x4ce895[_0xfdbd('0x43')]};return db[_0xfdbd('0x50')][_0xfdbd('0x18')](_0x2fb847)[_0xfdbd('0x1f')](function(_0x58f236){_0x3b574c[_0xfdbd('0x18')]=_0x58f236;if(_0x52bf91[_0xfdbd('0x26')][_0xfdbd('0x51')]){_0x4ce895[_0xfdbd('0x52')]=[{'all':!![]}];}return db[_0xfdbd('0x50')]['findAll'](_0x4ce895);})[_0xfdbd('0x1f')](function(_0x130930){_0x3b574c[_0xfdbd('0x53')]=_0x130930;return _0x3b574c;})['then'](respondWithFilteredResult(_0x4404b2,_0x4ce895))[_0xfdbd('0x54')](handleError(_0x4404b2,null));};exports['show']=function(_0x11c2a9,_0x2d74c5){var _0x38fec5={'raw':!![],'where':{'id':_0x11c2a9[_0xfdbd('0x55')]['id']}},_0x4f7adf={};_0x4f7adf[_0xfdbd('0x24')]=_[_0xfdbd('0x25')](db[_0xfdbd('0x50')][_0xfdbd('0x23')]);_0x4f7adf[_0xfdbd('0x26')]=_['keys'](_0x11c2a9[_0xfdbd('0x26')]);_0x4f7adf[_0xfdbd('0x28')]=_['intersection'](_0x4f7adf[_0xfdbd('0x24')],_0x4f7adf[_0xfdbd('0x26')]);_0x38fec5['attributes']=_[_0xfdbd('0x29')](_0x4f7adf[_0xfdbd('0x24')],qs['fields'](_0x11c2a9[_0xfdbd('0x26')]['fields']));_0x38fec5['attributes']=_0x38fec5[_0xfdbd('0x3c')][_0xfdbd('0x56')]?_0x38fec5[_0xfdbd('0x3c')]:_0x4f7adf[_0xfdbd('0x24')];if(_0x11c2a9[_0xfdbd('0x26')]['includeAll']){_0x38fec5['include']=[{'all':!![]}];}_0x38fec5=_[_0xfdbd('0x48')]({},_0x38fec5,_0x11c2a9['options']);return db[_0xfdbd('0x50')]['find'](_0x38fec5)[_0xfdbd('0x1f')](handleEntityNotFound(_0x2d74c5,null))[_0xfdbd('0x1f')](respondWithResult(_0x2d74c5,null))[_0xfdbd('0x54')](handleError(_0x2d74c5,null));};exports[_0xfdbd('0x57')]=function(_0x29ed69,_0x4a5871){return db[_0xfdbd('0x50')][_0xfdbd('0x57')](_0x29ed69['body'],{})[_0xfdbd('0x1f')](respondWithResult(_0x4a5871,0xc9))['catch'](handleError(_0x4a5871,null));};exports[_0xfdbd('0x1d')]=function(_0x3958af,_0x27da16){if(_0x3958af[_0xfdbd('0x58')]['id']){delete _0x3958af[_0xfdbd('0x58')]['id'];}return db[_0xfdbd('0x50')][_0xfdbd('0x59')]({'where':{'id':_0x3958af[_0xfdbd('0x55')]['id']}})[_0xfdbd('0x1f')](handleEntityNotFound(_0x27da16,null))[_0xfdbd('0x1f')](saveUpdates(_0x3958af['body'],null))[_0xfdbd('0x1f')](respondWithResult(_0x27da16,null))['catch'](handleError(_0x27da16,null));};exports['describe']=function(_0x5ca20f,_0xa24972){return db[_0xfdbd('0x50')][_0xfdbd('0x5a')]()['then'](respondWithResult(_0xa24972,null))[_0xfdbd('0x54')](handleError(_0xa24972,null));};exports[_0xfdbd('0x1e')]=function(_0x23e37a,_0xd64ed3){var _0xb07542;return db['CmHopper'][_0xfdbd('0x59')]({'where':{'id':_0x23e37a[_0xfdbd('0x55')]['id']}})[_0xfdbd('0x1f')](handleEntityNotFound(_0xd64ed3,null))[_0xfdbd('0x1f')](function(_0x80deaf){if(_0x80deaf){return _0x80deaf[_0xfdbd('0x1e')]()['then'](function(_0x1377a7){return _0x1377a7;});}})['then'](function(_0x21a1f3){_0xb07542=_0x21a1f3;if(_0x21a1f3){if(_0x21a1f3[_0xfdbd('0x5b')]||_0x21a1f3[_0xfdbd('0x5c')]){return db[_0x21a1f3[_0xfdbd('0x5b')]?'VoiceQueue':_0xfdbd('0x5d')][_0xfdbd('0x59')]({'where':{'id':_0x21a1f3[_0xfdbd('0x5b')]?_0x21a1f3['VoiceQueueId']:_0x21a1f3[_0xfdbd('0x5c')]},'attributes':['id',_0xfdbd('0x5e')],'raw':!![]});}}})['then'](function(_0x232abf){var _0x49f348={};if(_0x232abf){_[_0xfdbd('0x48')](_0x49f348,_[_0xfdbd('0x5f')](_0xb07542[_0xfdbd('0x60')],[_0xfdbd('0x61'),_0xfdbd('0x62'),'id']));_0x49f348[_0xfdbd('0x63')]=0x15;_0x49f348['statedesc']=_0xfdbd('0x64');_0x49f348[_0xfdbd('0x65')]=_0x232abf[_0xfdbd('0x5e')];_0x49f348[_0xfdbd('0x66')]=_0x23e37a[_0xfdbd('0x67')][_0xfdbd('0x5e')];_0x49f348[_0xfdbd('0x68')]=_0x23e37a[_0xfdbd('0x67')]['id'];_0x49f348['deleted']=!![];_0x49f348[_0xfdbd('0x69')]=moment()[_0xfdbd('0x6a')]('YYYY-MM-DD\x20HH:mm:ss');_0x49f348[_0xfdbd('0x6b')]=_0xb07542[_0xfdbd('0x6c')];_0x49f348[_0xfdbd('0x6d')]=_0xb07542['VoiceQueueId']?_0xfdbd('0x6e'):_0xfdbd('0x6f');return db[_0xfdbd('0x70')][_0xfdbd('0x59')]({'where':{'id':_0x49f348[_0xfdbd('0x71')]},'attributes':['firstName',_0xfdbd('0x72')]})[_0xfdbd('0x1f')](function(_0x10b335){if(!_['isNil'](_0xd64ed3)&&!_[_0xfdbd('0x73')](_0x10b335[_0xfdbd('0x74')])){_0x49f348['calleridname']=_0x10b335['firstName'];if(!_['isNil'](_0x10b335[_0xfdbd('0x72')])){_0x49f348[_0xfdbd('0x75')]+='\x20'+_0x10b335[_0xfdbd('0x72')];}}})[_0xfdbd('0x76')](function(){return db[_0xfdbd('0x77')][_0xfdbd('0x57')](_0x49f348);});}})[_0xfdbd('0x1f')](function(){return _0xd64ed3[_0xfdbd('0x15')](0xcc)[_0xfdbd('0x16')]();})[_0xfdbd('0x54')](handleError(_0xd64ed3,null));};exports[_0xfdbd('0x78')]=function(_0x3f4567,_0x222543,_0x32cc57){var _0x3ee5e4=[];return db[_0xfdbd('0x70')]['describe']()[_0xfdbd('0x1f')](function(_0x5d1cf1){_0x3ee5e4=_[_0xfdbd('0x25')](_0x5d1cf1);return _0x3f4567[_0xfdbd('0x67')]['getVoiceQueues']({'where':{'type':_0xfdbd('0x79'),'dialActive':!![],'dialMethod':_0xfdbd('0x7a')},'attributes':['id',_0xfdbd('0x7b')],'raw':!![]});})[_0xfdbd('0x1f')](function(_0xaedec1){if(_0xaedec1&&_0xaedec1['length']){return db[_0xfdbd('0x7c')][_0xfdbd('0x7d')](function(_0x476140){var _0x25ede4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xfdbd('0x6a')](_0xfdbd('0x7e'))},'VoiceQueueId':{'$in':_[_0xfdbd('0x4a')](_0xaedec1,'id')},'$or':[{'UserId':null},{'UserId':_0x3f4567['user']['id']}]};var _0x4a1665=[];if(_0x3f4567[_0xfdbd('0x58')][_0xfdbd('0x7f')]&&_0x3f4567[_0xfdbd('0x58')][_0xfdbd('0x7f')]===_0xfdbd('0x80')){if(!_[_0xfdbd('0x81')](_0x3f4567[_0xfdbd('0x58')][_0xfdbd('0x82')])){_0x25ede4['id']={'$in':_0x3f4567[_0xfdbd('0x58')][_0xfdbd('0x82')]};}_0x4a1665=[[_0xfdbd('0x83'),'ASC'],[_0xfdbd('0x84'),_0xaedec1[0x0]['dialOrderByScheduledAt']==='ASC'?_0xfdbd('0x85'):_0xfdbd('0x86')],db[_0xfdbd('0x7c')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xfdbd('0x85')]];}else{if(!_[_0xfdbd('0x81')](_0x3f4567[_0xfdbd('0x58')][_0xfdbd('0x82')])){_0x25ede4['id']={'$notIn':_0x3f4567[_0xfdbd('0x58')][_0xfdbd('0x82')]};}_0x4a1665=[['priority',_0xfdbd('0x85')],['scheduledAt',_0xaedec1[0x0][_0xfdbd('0x7b')]],db['sequelize']['literal'](_0xfdbd('0x87')),['id',_0xfdbd('0x86')]];}return db[_0xfdbd('0x50')][_0xfdbd('0x88')]({'attributes':['id',_0xfdbd('0x89')],'where':_0x25ede4,'order':_0x4a1665,'transaction':_0x476140,'lock':_0x476140[_0xfdbd('0x8a')][_0xfdbd('0x8b')],'include':[{'model':db['CmContact'],'as':_0xfdbd('0x8c'),'attributes':_0x3ee5e4,'include':[{'model':db[_0xfdbd('0x8d')],'as':_0xfdbd('0x8e'),'attributes':['id',_0xfdbd('0x5e')]}]},{'model':db[_0xfdbd('0x8f')],'as':_0xfdbd('0x90'),'attributes':['id',_0xfdbd('0x5e')]},{'model':db[_0xfdbd('0x91')],'as':_0xfdbd('0x92'),'attributes':['id',_0xfdbd('0x5e'),_0xfdbd('0x93')]}]})[_0xfdbd('0x1f')](function(_0x368c7c){if(_0x368c7c){return _0x368c7c[_0xfdbd('0x1d')]({'UserId':_0x3f4567['user']['id']},{'transaction':_0x476140});}});});}})['then'](handleEntityNotFound(_0x222543,null))[_0xfdbd('0x1f')](respondWithResult(_0x222543,null))['catch'](handleError(_0x222543,null));};exports[_0xfdbd('0x94')]=function(_0x42e516,_0x19bc96,_0x2ea77c){return _0x42e516[_0xfdbd('0x67')][_0xfdbd('0x95')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xfdbd('0x7a')},'attributes':['id'],'raw':!![]})['then'](function(_0x567db8){if(_0x567db8&&_0x567db8['length']){return db['CmHopper'][_0xfdbd('0x18')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xfdbd('0x6a')](_0xfdbd('0x7e'))},'VoiceQueueId':{'$in':_['map'](_0x567db8,'id')},'$or':[{'UserId':null},{'UserId':_0x42e516[_0xfdbd('0x67')]['id']}]}});}return 0x0;})[_0xfdbd('0x1f')](function(_0xec7ab){if(!_[_0xfdbd('0x73')](_0xec7ab)&&_[_0xfdbd('0x96')](_0xec7ab)){return _0x19bc96[_0xfdbd('0x15')](0xc8)['json']({'contacts':_0xec7ab});}else{logger['error'](_0xfdbd('0x97'),_0xfdbd('0x94'),0x194,_0xfdbd('0x98'));_0x19bc96['sendStatus'](0x194);}})['catch'](handleError(_0x19bc96,null));};
\ No newline at end of file
index 682c5c4..02f7f1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d06=['phone','priority','lodash','../../config/logger','moment','bluebird','request-promise','exports','define','cm_hopper','scheduledat'];(function(_0x40ab30,_0x52da25){var _0x3725cf=function(_0x151b33){while(--_0x151b33){_0x40ab30['push'](_0x40ab30['shift']());}};_0x3725cf(++_0x52da25);}(_0x4d06,0x16d));var _0x64d0=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x4d06[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require(_0x64d0('0x0'));var util=require('util');var logger=require(_0x64d0('0x1'))('api');var moment=require(_0x64d0('0x2'));var BPromise=require(_0x64d0('0x3'));var rp=require(_0x64d0('0x4'));var attributes=require('./cmHopper.attributes');module[_0x64d0('0x5')]=function(_0x2eae68,_0x53007c){return _0x2eae68[_0x64d0('0x6')]('CmHopper',attributes,{'tableName':_0x64d0('0x7'),'paranoid':![],'indexes':[{'name':_0x64d0('0x8'),'fields':[_0x64d0('0x8')]},{'name':_0x64d0('0x9'),'fields':[_0x64d0('0x9')]},{'name':_0x64d0('0xa'),'fields':[_0x64d0('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x886d=['phone','priority','lodash','util','../../config/logger','api','moment','request-promise','define','CmHopper','scheduledat'];(function(_0x444004,_0x2aa5f2){var _0x2fd101=function(_0x385a23){while(--_0x385a23){_0x444004['push'](_0x444004['shift']());}};_0x2fd101(++_0x2aa5f2);}(_0x886d,0x1c5));var _0xd886=function(_0x1ba19c,_0x3975e2){_0x1ba19c=_0x1ba19c-0x0;var _0x4e069b=_0x886d[_0x1ba19c];return _0x4e069b;};'use strict';var _=require(_0xd886('0x0'));var util=require(_0xd886('0x1'));var logger=require(_0xd886('0x2'))(_0xd886('0x3'));var moment=require(_0xd886('0x4'));var BPromise=require('bluebird');var rp=require(_0xd886('0x5'));var attributes=require('./cmHopper.attributes');module['exports']=function(_0x51fdf7,_0x2e140f){return _0x51fdf7[_0xd886('0x6')](_0xd886('0x7'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xd886('0x8'),'fields':[_0xd886('0x8')]},{'name':_0xd886('0x9'),'fields':[_0xd886('0x9')]},{'name':_0xd886('0xa'),'fields':[_0xd886('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 5932522..1ec2992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e3=['`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','UserId','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','limit','include','map','model','attributes','info','GetCmHopper','ShowCmHopper','CmHopper','raw','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','length','push','all','MoveContactManagedDialer','create','destroy','CountReScheduled','COUNT','literal'];(function(_0x30aebd,_0x4d2300){var _0xf1f2bc=function(_0xbeb44f){while(--_0xbeb44f){_0x30aebd['push'](_0x30aebd['shift']());}};_0xf1f2bc(++_0x4d2300);}(_0x50e3,0x180));var _0x350e=function(_0x712f8f,_0x4d1f1b){_0x712f8f=_0x712f8f-0x0;var _0x5a57e9=_0x50e3[_0x712f8f];return _0x5a57e9;};'use strict';var _=require(_0x350e('0x0'));var util=require(_0x350e('0x1'));var moment=require(_0x350e('0x2'));var BPromise=require(_0x350e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x350e('0x4'))['db'];var utils=require(_0x350e('0x5'));var logger=require('../../config/logger')(_0x350e('0x6'));var config=require(_0x350e('0x7'));var jayson=require(_0x350e('0x8'));var client=jayson[_0x350e('0x9')][_0x350e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28c951,_0x4e82cc,_0x342dd0){return new BPromise(function(_0x378629,_0x1b5f89){return client['request'](_0x28c951,_0x342dd0)[_0x350e('0xb')](function(_0x180e85){logger['info'](_0x350e('0xc'),_0x4e82cc,_0x350e('0xd'));logger[_0x350e('0xe')](_0x350e('0xf'),_0x4e82cc,'request\x20sent',JSON[_0x350e('0x10')](_0x180e85));if(_0x180e85['error']){if(_0x180e85[_0x350e('0x11')]['code']===0x1f4){logger['error'](_0x350e('0xc'),_0x4e82cc,_0x180e85[_0x350e('0x11')][_0x350e('0x12')]);return _0x1b5f89(_0x180e85[_0x350e('0x11')][_0x350e('0x12')]);}logger[_0x350e('0x11')]('CmHopper,\x20%s,\x20%s',_0x4e82cc,_0x180e85[_0x350e('0x11')][_0x350e('0x12')]);return _0x378629(_0x180e85['error'][_0x350e('0x12')]);}else{logger['info'](_0x350e('0xc'),_0x4e82cc,'request\x20sent');_0x378629(_0x180e85[_0x350e('0x13')][_0x350e('0x12')]);}})[_0x350e('0x14')](function(_0x490327){logger[_0x350e('0x11')](_0x350e('0xc'),_0x4e82cc,_0x490327);_0x1b5f89(_0x490327);});});}exports['GetCmHopper']=function(_0x214869){var _0xfc0c46=this;return new Promise(function(_0x1c7332,_0x2c3c5c){return db['CmHopper'][_0x350e('0x15')]({'raw':_0x214869['options']?_0x214869[_0x350e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x214869['options']?_0x214869[_0x350e('0x16')][_0x350e('0x17')]||null:null,'attributes':_0x214869['options']?_0x214869[_0x350e('0x16')]['attributes']||null:null,'limit':_0x214869[_0x350e('0x16')]?_0x214869[_0x350e('0x16')][_0x350e('0x18')]||null:null,'include':_0x214869[_0x350e('0x16')]?_0x214869[_0x350e('0x16')][_0x350e('0x19')]?_[_0x350e('0x1a')](_0x214869[_0x350e('0x16')][_0x350e('0x19')],function(_0x435756){return{'model':db[_0x435756[_0x350e('0x1b')]],'as':_0x435756['as'],'attributes':_0x435756[_0x350e('0x1c')],'include':_0x435756[_0x350e('0x19')]?_[_0x350e('0x1a')](_0x435756[_0x350e('0x19')],function(_0x3124f8){return{'model':db[_0x3124f8['model']],'as':_0x3124f8['as'],'attributes':_0x3124f8[_0x350e('0x1c')],'include':_0x3124f8['include']?_[_0x350e('0x1a')](_0x3124f8[_0x350e('0x19')],function(_0x3e3ec5){return{'model':db[_0x3e3ec5[_0x350e('0x1b')]],'as':_0x3e3ec5['as'],'attributes':_0x3e3ec5[_0x350e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3350ff){logger[_0x350e('0x1d')]('GetCmHopper',_0x214869);logger[_0x350e('0xe')]('GetCmHopper',_0x214869,JSON[_0x350e('0x10')](_0x3350ff));_0x1c7332(_0x3350ff);})['catch'](function(_0x36fe78){logger['error'](_0x350e('0x1e'),_0x36fe78['message'],_0x214869);_0x2c3c5c(_0xfc0c46[_0x350e('0x11')](0x1f4,_0x36fe78[_0x350e('0x12')]));});});};exports[_0x350e('0x1f')]=function(_0x2a57e3){var _0x1cdb3c=this;return new Promise(function(_0x2820b4,_0x2380b9){return db[_0x350e('0x20')]['find']({'raw':_0x2a57e3[_0x350e('0x16')]?_0x2a57e3['options'][_0x350e('0x21')]===undefined?!![]:![]:!![],'where':_0x2a57e3[_0x350e('0x16')]?_0x2a57e3['options'][_0x350e('0x17')]||null:null,'attributes':_0x2a57e3['options']?_0x2a57e3[_0x350e('0x16')][_0x350e('0x1c')]||null:null,'include':_0x2a57e3[_0x350e('0x16')]?_0x2a57e3[_0x350e('0x16')][_0x350e('0x19')]?_[_0x350e('0x1a')](_0x2a57e3['options'][_0x350e('0x19')],function(_0x5444e4){return{'model':db[_0x5444e4['model']],'as':_0x5444e4['as'],'attributes':_0x5444e4[_0x350e('0x1c')],'include':_0x5444e4[_0x350e('0x19')]?_[_0x350e('0x1a')](_0x5444e4[_0x350e('0x19')],function(_0x57c292){return{'model':db[_0x57c292[_0x350e('0x1b')]],'as':_0x57c292['as'],'attributes':_0x57c292[_0x350e('0x1c')],'include':_0x57c292[_0x350e('0x19')]?_['map'](_0x57c292[_0x350e('0x19')],function(_0x493edf){return{'model':db[_0x493edf[_0x350e('0x1b')]],'as':_0x493edf['as'],'attributes':_0x493edf[_0x350e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x350e('0xb')](function(_0x5cc3ae){logger[_0x350e('0x1d')](_0x350e('0x1f'),_0x2a57e3);logger[_0x350e('0xe')](_0x350e('0x1f'),_0x2a57e3,JSON[_0x350e('0x10')](_0x5cc3ae));_0x2820b4(_0x5cc3ae);})[_0x350e('0x14')](function(_0x2a0c18){logger[_0x350e('0x11')](_0x350e('0x1f'),_0x2a0c18['message'],_0x2a57e3);_0x2380b9(_0x1cdb3c['error'](0x1f4,_0x2a0c18['message']));});});};exports['CreateCmHopper']=function(_0x2c8305){var _0x5bea7c=this;return new Promise(function(_0x5a4534,_0x432b50){return db[_0x350e('0x20')]['create'](_0x2c8305[_0x350e('0x22')],{'raw':_0x2c8305[_0x350e('0x16')]?_0x2c8305[_0x350e('0x16')][_0x350e('0x21')]===undefined?!![]:![]:!![]})[_0x350e('0xb')](function(_0x4857b3){logger['info'](_0x350e('0x23'),_0x2c8305);logger[_0x350e('0xe')](_0x350e('0x23'),_0x2c8305,JSON['stringify'](_0x4857b3));_0x5a4534(_0x4857b3);})[_0x350e('0x14')](function(_0x47a9e3){logger['error'](_0x350e('0x23'),_0x47a9e3[_0x350e('0x12')],_0x2c8305);_0x432b50(_0x5bea7c[_0x350e('0x11')](0x1f4,_0x47a9e3[_0x350e('0x12')]));});});};exports[_0x350e('0x24')]=function(_0x535ae9){var _0x11071c=this;return new Promise(function(_0x12243a,_0x450900){return db[_0x350e('0x20')][_0x350e('0x25')](_0x535ae9[_0x350e('0x22')],{'raw':_0x535ae9[_0x350e('0x16')]?_0x535ae9[_0x350e('0x16')][_0x350e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x535ae9[_0x350e('0x16')]?_0x535ae9[_0x350e('0x16')][_0x350e('0x17')]||null:null,'attributes':_0x535ae9[_0x350e('0x16')]?_0x535ae9['options']['attributes']||null:null,'limit':_0x535ae9['options']?_0x535ae9[_0x350e('0x16')][_0x350e('0x18')]||null:null})[_0x350e('0xb')](function(_0x3746fb){logger[_0x350e('0x1d')](_0x350e('0x24'),_0x535ae9);logger['debug']('UpdateCmHopper',_0x535ae9,JSON['stringify'](_0x3746fb));_0x12243a(_0x3746fb);})[_0x350e('0x14')](function(_0x341f57){logger['error'](_0x350e('0x24'),_0x341f57[_0x350e('0x12')],_0x535ae9);_0x450900(_0x11071c[_0x350e('0x11')](0x1f4,_0x341f57[_0x350e('0x12')]));});});};exports['DestroyCmHopper']=function(_0xb64fc9){var _0x65fffb=this;return new Promise(function(_0x4cc50b,_0x58ecce){return db[_0x350e('0x20')]['destroy']({'where':_0xb64fc9[_0x350e('0x16')]?_0xb64fc9[_0x350e('0x16')][_0x350e('0x17')]||null:null})['then'](function(_0x12482b){logger[_0x350e('0x1d')]('DestroyCmHopper',_0xb64fc9);logger['debug'](_0x350e('0x26'),_0xb64fc9,JSON[_0x350e('0x10')](_0x12482b));_0x4cc50b(_0x12482b);})[_0x350e('0x14')](function(_0xce3322){logger['error'](_0x350e('0x26'),_0xce3322[_0x350e('0x12')],_0xb64fc9);_0x58ecce(_0x65fffb[_0x350e('0x11')](0x1f4,_0xce3322[_0x350e('0x12')]));});});};exports[_0x350e('0x27')]=function(_0x261e1f){var _0x521ef8=this;return new Promise(function(_0x5380c3,_0x3163f8){return db[_0x350e('0x28')][_0x350e('0x29')]()['then'](function(_0x10e194){return db[_0x350e('0x2a')][_0x350e('0x2b')](function(_0x29b13e){return db['CmHopper'][_0x350e('0x15')]({'where':_0x261e1f[_0x350e('0x16')]?_0x261e1f[_0x350e('0x16')][_0x350e('0x17')]||null:null,'attributes':_0x261e1f[_0x350e('0x16')]?_0x261e1f[_0x350e('0x16')][_0x350e('0x1c')]||null:null,'limit':_0x261e1f[_0x350e('0x16')]?_0x261e1f[_0x350e('0x16')][_0x350e('0x18')]||null:null,'order':_0x261e1f['options']?_0x261e1f['options'][_0x350e('0x2c')]||null:null,'transaction':_0x29b13e,'lock':_0x29b13e[_0x350e('0x2d')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x350e('0x2e'),'attributes':_[_0x350e('0x2f')](_0x10e194)}]})['then'](function(_0x1fd444){var _0x1bf177=[];for(var _0x2af1ce=0x0;_0x2af1ce<_0x1fd444[_0x350e('0x30')];_0x2af1ce+=0x1){_0x1bf177[_0x350e('0x31')](_0x1fd444[_0x2af1ce][_0x350e('0x25')](_0x261e1f[_0x350e('0x22')],{'transaction':_0x29b13e}));}return BPromise[_0x350e('0x32')](_0x1bf177);});})[_0x350e('0xb')](function(_0x4e3422){logger[_0x350e('0x1d')](_0x350e('0x27'),_0x261e1f);logger[_0x350e('0xe')](_0x350e('0x27'),_0x261e1f,JSON[_0x350e('0x10')](_0x4e3422));_0x5380c3(_0x4e3422);})[_0x350e('0x14')](function(_0x59aa9b){logger['error'](_0x350e('0x27'),_0x59aa9b['message'],_0x261e1f);_0x3163f8(_0x521ef8[_0x350e('0x11')](0x1f4,_0x59aa9b[_0x350e('0x12')]));});});});};exports[_0x350e('0x33')]=function(_0x48772c){var _0x2e3216=this;return new Promise(function(_0x25d660,_0x36b8cf){return db[_0x350e('0x2a')][_0x350e('0x2b')](function(_0x1030d8){return db['CmHopperFinal'][_0x350e('0x34')](_0x48772c[_0x350e('0x22')],{'raw':_0x48772c[_0x350e('0x16')]?_0x48772c[_0x350e('0x16')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1030d8})[_0x350e('0xb')](function(){return db[_0x350e('0x20')][_0x350e('0x35')]({'where':_0x48772c[_0x350e('0x16')]?_0x48772c['options'][_0x350e('0x17')]||null:null,'transaction':_0x1030d8});});})[_0x350e('0xb')](function(_0x84701c){logger[_0x350e('0x1d')](_0x350e('0x33'),_0x48772c);logger[_0x350e('0xe')](_0x350e('0x33'),_0x48772c,JSON[_0x350e('0x10')](_0x84701c));_0x25d660(_0x84701c);})[_0x350e('0x14')](function(_0x2b288c){logger[_0x350e('0x11')](_0x350e('0x33'),_0x2b288c[_0x350e('0x12')],_0x48772c);_0x36b8cf(_0x2e3216[_0x350e('0x11')](0x1f4,_0x2b288c[_0x350e('0x12')]));});});};exports[_0x350e('0x36')]=function(_0x2eb799){var _0x2d0ad6=this;return new Promise(function(_0xd4a4c9,_0x32d20c){return db['CmHopper'][_0x350e('0x15')]({'raw':_0x2eb799['options']?_0x2eb799[_0x350e('0x16')][_0x350e('0x21')]===undefined?!![]:![]:!![],'where':_0x2eb799[_0x350e('0x16')]?_0x2eb799['options']['where']||null:null,'attributes':[[db[_0x350e('0x2a')]['fn'](_0x350e('0x37'),db['sequelize']['fn']('IF',db[_0x350e('0x2a')][_0x350e('0x38')](_0x350e('0x39')+util[_0x350e('0x3a')]('\x22%s\x22',moment()[_0x350e('0x3a')](_0x350e('0x3b')))+_0x350e('0x3c')))),'contactsRescheduled']]})[_0x350e('0xb')](function(_0x2aafc2){logger[_0x350e('0x1d')]('CountReScheduled',_0x2eb799);logger[_0x350e('0xe')](_0x350e('0x36'),_0x2eb799,JSON[_0x350e('0x10')](_0x2aafc2));_0xd4a4c9(_0x2aafc2);})[_0x350e('0x14')](function(_0x3b2a24){logger['error'](_0x350e('0x36'),_0x3b2a24[_0x350e('0x12')],_0x2eb799);_0x32d20c(_0x2d0ad6['error'](0x1f4,_0x3b2a24[_0x350e('0x12')]));});});};exports[_0x350e('0x3d')]=function(_0x8c79a7){var _0x4ae0e5=this;return new Promise(function(_0x9489fa,_0x1c43c4){return db[_0x350e('0x28')][_0x350e('0x29')]()['then'](function(_0x48875c){return db[_0x350e('0x2a')][_0x350e('0x2b')](function(_0x94aab3){return db[_0x350e('0x20')][_0x350e('0x15')]({'where':_0x8c79a7[_0x350e('0x16')]?_0x8c79a7[_0x350e('0x16')][_0x350e('0x17')]||null:null,'attributes':_0x8c79a7['options']?_0x8c79a7[_0x350e('0x16')][_0x350e('0x1c')]||null:null,'limit':0x1,'order':_0x8c79a7[_0x350e('0x16')]?_0x8c79a7[_0x350e('0x16')]['order']||null:null,'group':db[_0x350e('0x20')][_0x350e('0x3e')],'transaction':_0x94aab3,'lock':_0x94aab3[_0x350e('0x2d')]['UPDATE'],'include':_0x8c79a7[_0x350e('0x16')]?_0x8c79a7[_0x350e('0x16')][_0x350e('0x19')]?_[_0x350e('0x1a')](_0x8c79a7[_0x350e('0x16')][_0x350e('0x19')],function(_0x49d0b6){return{'model':db[_0x49d0b6[_0x350e('0x1b')]],'as':_0x49d0b6['as'],'attributes':_0x49d0b6[_0x350e('0x1c')],'include':_0x49d0b6[_0x350e('0x19')]?_[_0x350e('0x1a')](_0x49d0b6[_0x350e('0x19')],function(_0x33f8a1){return{'model':db[_0x33f8a1['model']],'as':_0x33f8a1['as'],'attributes':_0x33f8a1[_0x350e('0x1c')],'include':_0x33f8a1[_0x350e('0x19')]?_['map'](_0x33f8a1[_0x350e('0x19')],function(_0x1b74f9){return{'model':db[_0x1b74f9[_0x350e('0x1b')]],'as':_0x1b74f9['as'],'attributes':_0x1b74f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x350e('0xb')](function(_0xd5cc2e){var _0x53044e=[];for(var _0x290d0d=0x0;_0x290d0d<_0xd5cc2e['length'];_0x290d0d+=0x1){_0x53044e[_0x350e('0x31')](_0xd5cc2e[_0x290d0d][_0x350e('0x25')](_0x8c79a7[_0x350e('0x22')],{'transaction':_0x94aab3}));}return BPromise[_0x350e('0x32')](_0x53044e);});})[_0x350e('0xb')](function(_0x4f83ca){logger[_0x350e('0x1d')](_0x350e('0x3d'),_0x8c79a7);logger['debug']('GetContactRecallMe',_0x8c79a7,JSON[_0x350e('0x10')](_0x4f83ca));_0x9489fa(_0x4f83ca);})[_0x350e('0x14')](function(_0x5b7f2c){logger[_0x350e('0x11')](_0x350e('0x3d'),_0x5b7f2c[_0x350e('0x12')],_0x8c79a7);_0x1c43c4(_0x4ae0e5['error'](0x1f4,_0x5b7f2c[_0x350e('0x12')]));});});});};
\ No newline at end of file
+var _0xec29=['body','CreateCmHopper','UpdateCmHopper','update','destroy','DestroyCmHopper','CmContact','describe','limit','order','LOCK','UPDATE','Contact','keys','length','push','all','GetContactDialer','MoveContactManagedDialer','transaction','CmHopperFinal','sequelize','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','CountReScheduled','UserId','GetContactRecallMe','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','include','map','model','ShowCmHopper','find','raw','stringify','create'];(function(_0x1c7a2e,_0xeb606e){var _0x3258d1=function(_0x56f648){while(--_0x56f648){_0x1c7a2e['push'](_0x1c7a2e['shift']());}};_0x3258d1(++_0xeb606e);}(_0xec29,0x9f));var _0x9ec2=function(_0x50a050,_0x3de947){_0x50a050=_0x50a050-0x0;var _0x38dd3b=_0xec29[_0x50a050];return _0x38dd3b;};'use strict';var _=require('lodash');var util=require(_0x9ec2('0x0'));var moment=require(_0x9ec2('0x1'));var BPromise=require(_0x9ec2('0x2'));var rs=require(_0x9ec2('0x3'));var fs=require('fs');var Redis=require(_0x9ec2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ec2('0x5'));var logger=require(_0x9ec2('0x6'))(_0x9ec2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ec2('0x8')][_0x9ec2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e76f5,_0x2102c4,_0x3e067e){return new BPromise(function(_0x209e8,_0x1ab4b9){return client[_0x9ec2('0xa')](_0x1e76f5,_0x3e067e)[_0x9ec2('0xb')](function(_0x100051){logger[_0x9ec2('0xc')](_0x9ec2('0xd'),_0x2102c4,_0x9ec2('0xe'));logger[_0x9ec2('0xf')](_0x9ec2('0x10'),_0x2102c4,_0x9ec2('0xe'),JSON['stringify'](_0x100051));if(_0x100051[_0x9ec2('0x11')]){if(_0x100051[_0x9ec2('0x11')][_0x9ec2('0x12')]===0x1f4){logger[_0x9ec2('0x11')](_0x9ec2('0xd'),_0x2102c4,_0x100051[_0x9ec2('0x11')][_0x9ec2('0x13')]);return _0x1ab4b9(_0x100051[_0x9ec2('0x11')][_0x9ec2('0x13')]);}logger[_0x9ec2('0x11')](_0x9ec2('0xd'),_0x2102c4,_0x100051['error']['message']);return _0x209e8(_0x100051['error']['message']);}else{logger[_0x9ec2('0xc')]('CmHopper,\x20%s,\x20%s',_0x2102c4,'request\x20sent');_0x209e8(_0x100051[_0x9ec2('0x14')]['message']);}})[_0x9ec2('0x15')](function(_0x5971ac){logger[_0x9ec2('0x11')](_0x9ec2('0xd'),_0x2102c4,_0x5971ac);_0x1ab4b9(_0x5971ac);});});}exports[_0x9ec2('0x16')]=function(_0x4af1bb){var _0xff0452=this;return new Promise(function(_0x423ece,_0x4ee573){return db[_0x9ec2('0x17')][_0x9ec2('0x18')]({'raw':_0x4af1bb['options']?_0x4af1bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x4af1bb[_0x9ec2('0x19')]?_0x4af1bb[_0x9ec2('0x19')][_0x9ec2('0x1a')]||null:null,'attributes':_0x4af1bb[_0x9ec2('0x19')]?_0x4af1bb[_0x9ec2('0x19')][_0x9ec2('0x1b')]||null:null,'limit':_0x4af1bb[_0x9ec2('0x19')]?_0x4af1bb['options']['limit']||null:null,'include':_0x4af1bb[_0x9ec2('0x19')]?_0x4af1bb[_0x9ec2('0x19')][_0x9ec2('0x1c')]?_[_0x9ec2('0x1d')](_0x4af1bb[_0x9ec2('0x19')][_0x9ec2('0x1c')],function(_0x454c1e){return{'model':db[_0x454c1e[_0x9ec2('0x1e')]],'as':_0x454c1e['as'],'attributes':_0x454c1e[_0x9ec2('0x1b')],'include':_0x454c1e['include']?_[_0x9ec2('0x1d')](_0x454c1e[_0x9ec2('0x1c')],function(_0xe954c5){return{'model':db[_0xe954c5[_0x9ec2('0x1e')]],'as':_0xe954c5['as'],'attributes':_0xe954c5[_0x9ec2('0x1b')],'include':_0xe954c5[_0x9ec2('0x1c')]?_[_0x9ec2('0x1d')](_0xe954c5[_0x9ec2('0x1c')],function(_0x795697){return{'model':db[_0x795697['model']],'as':_0x795697['as'],'attributes':_0x795697[_0x9ec2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ec2('0xb')](function(_0x4e7e80){logger[_0x9ec2('0xc')](_0x9ec2('0x16'),_0x4af1bb);logger['debug']('GetCmHopper',_0x4af1bb,JSON['stringify'](_0x4e7e80));_0x423ece(_0x4e7e80);})[_0x9ec2('0x15')](function(_0x4ef183){logger[_0x9ec2('0x11')](_0x9ec2('0x16'),_0x4ef183[_0x9ec2('0x13')],_0x4af1bb);_0x4ee573(_0xff0452[_0x9ec2('0x11')](0x1f4,_0x4ef183['message']));});});};exports[_0x9ec2('0x1f')]=function(_0x4904b5){var _0x32b284=this;return new Promise(function(_0x2cb5b1,_0x13e385){return db[_0x9ec2('0x17')][_0x9ec2('0x20')]({'raw':_0x4904b5[_0x9ec2('0x19')]?_0x4904b5['options'][_0x9ec2('0x21')]===undefined?!![]:![]:!![],'where':_0x4904b5[_0x9ec2('0x19')]?_0x4904b5['options'][_0x9ec2('0x1a')]||null:null,'attributes':_0x4904b5[_0x9ec2('0x19')]?_0x4904b5[_0x9ec2('0x19')][_0x9ec2('0x1b')]||null:null,'include':_0x4904b5[_0x9ec2('0x19')]?_0x4904b5[_0x9ec2('0x19')][_0x9ec2('0x1c')]?_[_0x9ec2('0x1d')](_0x4904b5[_0x9ec2('0x19')][_0x9ec2('0x1c')],function(_0xf20f41){return{'model':db[_0xf20f41[_0x9ec2('0x1e')]],'as':_0xf20f41['as'],'attributes':_0xf20f41[_0x9ec2('0x1b')],'include':_0xf20f41['include']?_['map'](_0xf20f41[_0x9ec2('0x1c')],function(_0x35cb89){return{'model':db[_0x35cb89[_0x9ec2('0x1e')]],'as':_0x35cb89['as'],'attributes':_0x35cb89['attributes'],'include':_0x35cb89[_0x9ec2('0x1c')]?_['map'](_0x35cb89[_0x9ec2('0x1c')],function(_0x2a5ae5){return{'model':db[_0x2a5ae5[_0x9ec2('0x1e')]],'as':_0x2a5ae5['as'],'attributes':_0x2a5ae5[_0x9ec2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ec2('0xb')](function(_0x5135ff){logger['info']('ShowCmHopper',_0x4904b5);logger[_0x9ec2('0xf')](_0x9ec2('0x1f'),_0x4904b5,JSON[_0x9ec2('0x22')](_0x5135ff));_0x2cb5b1(_0x5135ff);})[_0x9ec2('0x15')](function(_0x3ab6d6){logger['error'](_0x9ec2('0x1f'),_0x3ab6d6[_0x9ec2('0x13')],_0x4904b5);_0x13e385(_0x32b284[_0x9ec2('0x11')](0x1f4,_0x3ab6d6[_0x9ec2('0x13')]));});});};exports['CreateCmHopper']=function(_0x659711){var _0x17763a=this;return new Promise(function(_0x31378a,_0x18f08a){return db[_0x9ec2('0x17')][_0x9ec2('0x23')](_0x659711[_0x9ec2('0x24')],{'raw':_0x659711[_0x9ec2('0x19')]?_0x659711['options']['raw']===undefined?!![]:![]:!![]})[_0x9ec2('0xb')](function(_0xf3e7df){logger[_0x9ec2('0xc')](_0x9ec2('0x25'),_0x659711);logger[_0x9ec2('0xf')](_0x9ec2('0x25'),_0x659711,JSON[_0x9ec2('0x22')](_0xf3e7df));_0x31378a(_0xf3e7df);})['catch'](function(_0x1ea797){logger[_0x9ec2('0x11')](_0x9ec2('0x25'),_0x1ea797[_0x9ec2('0x13')],_0x659711);_0x18f08a(_0x17763a['error'](0x1f4,_0x1ea797[_0x9ec2('0x13')]));});});};exports[_0x9ec2('0x26')]=function(_0x19fce9){var _0x529519=this;return new Promise(function(_0x1ee243,_0x387d10){return db[_0x9ec2('0x17')][_0x9ec2('0x27')](_0x19fce9[_0x9ec2('0x24')],{'raw':_0x19fce9['options']?_0x19fce9[_0x9ec2('0x19')][_0x9ec2('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19fce9[_0x9ec2('0x19')]?_0x19fce9[_0x9ec2('0x19')][_0x9ec2('0x1a')]||null:null,'attributes':_0x19fce9[_0x9ec2('0x19')]?_0x19fce9[_0x9ec2('0x19')][_0x9ec2('0x1b')]||null:null,'limit':_0x19fce9[_0x9ec2('0x19')]?_0x19fce9[_0x9ec2('0x19')]['limit']||null:null})[_0x9ec2('0xb')](function(_0x1f647b){logger[_0x9ec2('0xc')](_0x9ec2('0x26'),_0x19fce9);logger[_0x9ec2('0xf')]('UpdateCmHopper',_0x19fce9,JSON['stringify'](_0x1f647b));_0x1ee243(_0x1f647b);})[_0x9ec2('0x15')](function(_0x14eb85){logger[_0x9ec2('0x11')](_0x9ec2('0x26'),_0x14eb85['message'],_0x19fce9);_0x387d10(_0x529519[_0x9ec2('0x11')](0x1f4,_0x14eb85[_0x9ec2('0x13')]));});});};exports['DestroyCmHopper']=function(_0x1c3bcc){var _0x55c1a9=this;return new Promise(function(_0x17b75e,_0x5b4d88){return db[_0x9ec2('0x17')][_0x9ec2('0x28')]({'where':_0x1c3bcc[_0x9ec2('0x19')]?_0x1c3bcc[_0x9ec2('0x19')][_0x9ec2('0x1a')]||null:null})[_0x9ec2('0xb')](function(_0xcdb397){logger[_0x9ec2('0xc')](_0x9ec2('0x29'),_0x1c3bcc);logger[_0x9ec2('0xf')](_0x9ec2('0x29'),_0x1c3bcc,JSON[_0x9ec2('0x22')](_0xcdb397));_0x17b75e(_0xcdb397);})[_0x9ec2('0x15')](function(_0x3fcecf){logger[_0x9ec2('0x11')](_0x9ec2('0x29'),_0x3fcecf[_0x9ec2('0x13')],_0x1c3bcc);_0x5b4d88(_0x55c1a9[_0x9ec2('0x11')](0x1f4,_0x3fcecf[_0x9ec2('0x13')]));});});};exports['GetContactDialer']=function(_0x342be7){var _0x225ac2=this;return new Promise(function(_0x53da86,_0xaebc8d){return db[_0x9ec2('0x2a')][_0x9ec2('0x2b')]()[_0x9ec2('0xb')](function(_0x3fdf88){return db['sequelize']['transaction'](function(_0x5e9f4e){return db[_0x9ec2('0x17')][_0x9ec2('0x18')]({'where':_0x342be7[_0x9ec2('0x19')]?_0x342be7[_0x9ec2('0x19')][_0x9ec2('0x1a')]||null:null,'attributes':_0x342be7['options']?_0x342be7[_0x9ec2('0x19')][_0x9ec2('0x1b')]||null:null,'limit':_0x342be7[_0x9ec2('0x19')]?_0x342be7[_0x9ec2('0x19')][_0x9ec2('0x2c')]||null:null,'order':_0x342be7[_0x9ec2('0x19')]?_0x342be7[_0x9ec2('0x19')][_0x9ec2('0x2d')]||null:null,'transaction':_0x5e9f4e,'lock':_0x5e9f4e[_0x9ec2('0x2e')][_0x9ec2('0x2f')],'include':[{'model':db[_0x9ec2('0x2a')],'as':_0x9ec2('0x30'),'attributes':_[_0x9ec2('0x31')](_0x3fdf88)}]})[_0x9ec2('0xb')](function(_0x4ff667){var _0x8ce0d3=[];for(var _0x54912d=0x0;_0x54912d<_0x4ff667[_0x9ec2('0x32')];_0x54912d+=0x1){_0x8ce0d3[_0x9ec2('0x33')](_0x4ff667[_0x54912d][_0x9ec2('0x27')](_0x342be7[_0x9ec2('0x24')],{'transaction':_0x5e9f4e}));}return BPromise[_0x9ec2('0x34')](_0x8ce0d3);});})[_0x9ec2('0xb')](function(_0x43d8dd){logger[_0x9ec2('0xc')](_0x9ec2('0x35'),_0x342be7);logger[_0x9ec2('0xf')](_0x9ec2('0x35'),_0x342be7,JSON[_0x9ec2('0x22')](_0x43d8dd));_0x53da86(_0x43d8dd);})[_0x9ec2('0x15')](function(_0x43e3b1){logger['error'](_0x9ec2('0x35'),_0x43e3b1['message'],_0x342be7);_0xaebc8d(_0x225ac2[_0x9ec2('0x11')](0x1f4,_0x43e3b1['message']));});});});};exports[_0x9ec2('0x36')]=function(_0x49093a){var _0x5b1eca=this;return new Promise(function(_0x3b4a35,_0x981557){return db['sequelize'][_0x9ec2('0x37')](function(_0x54f2e0){return db[_0x9ec2('0x38')][_0x9ec2('0x23')](_0x49093a[_0x9ec2('0x24')],{'raw':_0x49093a[_0x9ec2('0x19')]?_0x49093a[_0x9ec2('0x19')][_0x9ec2('0x21')]===undefined?!![]:![]:!![],'transaction':_0x54f2e0})['then'](function(){return db[_0x9ec2('0x17')]['destroy']({'where':_0x49093a[_0x9ec2('0x19')]?_0x49093a[_0x9ec2('0x19')][_0x9ec2('0x1a')]||null:null,'transaction':_0x54f2e0});});})[_0x9ec2('0xb')](function(_0x2b1bc8){logger['info']('MoveContactManagedDialer',_0x49093a);logger[_0x9ec2('0xf')](_0x9ec2('0x36'),_0x49093a,JSON[_0x9ec2('0x22')](_0x2b1bc8));_0x3b4a35(_0x2b1bc8);})['catch'](function(_0x48261b){logger[_0x9ec2('0x11')]('MoveContactManagedDialer',_0x48261b[_0x9ec2('0x13')],_0x49093a);_0x981557(_0x5b1eca[_0x9ec2('0x11')](0x1f4,_0x48261b[_0x9ec2('0x13')]));});});};exports['CountReScheduled']=function(_0x4f5a83){var _0x1fdfe5=this;return new Promise(function(_0x4fdebb,_0x12ad20){return db[_0x9ec2('0x17')][_0x9ec2('0x18')]({'raw':_0x4f5a83[_0x9ec2('0x19')]?_0x4f5a83[_0x9ec2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f5a83['options']?_0x4f5a83['options']['where']||null:null,'attributes':[[db[_0x9ec2('0x39')]['fn']('COUNT',db[_0x9ec2('0x39')]['fn']('IF',db[_0x9ec2('0x39')][_0x9ec2('0x3a')]('`scheduledat`\x20>=\x20'+util[_0x9ec2('0x3b')]('\x22%s\x22',moment()['format'](_0x9ec2('0x3c')))+_0x9ec2('0x3d')))),'contactsRescheduled']]})[_0x9ec2('0xb')](function(_0x5d3be4){logger[_0x9ec2('0xc')](_0x9ec2('0x3e'),_0x4f5a83);logger[_0x9ec2('0xf')]('CountReScheduled',_0x4f5a83,JSON[_0x9ec2('0x22')](_0x5d3be4));_0x4fdebb(_0x5d3be4);})[_0x9ec2('0x15')](function(_0x229c22){logger[_0x9ec2('0x11')]('CountReScheduled',_0x229c22[_0x9ec2('0x13')],_0x4f5a83);_0x12ad20(_0x1fdfe5[_0x9ec2('0x11')](0x1f4,_0x229c22[_0x9ec2('0x13')]));});});};exports['GetContactRecallMe']=function(_0x252ee2){var _0x1521ad=this;return new Promise(function(_0x385cf5,_0x24cf3e){return db[_0x9ec2('0x2a')][_0x9ec2('0x2b')]()[_0x9ec2('0xb')](function(_0x29d1ee){return db[_0x9ec2('0x39')][_0x9ec2('0x37')](function(_0x9ad767){return db[_0x9ec2('0x17')][_0x9ec2('0x18')]({'where':_0x252ee2[_0x9ec2('0x19')]?_0x252ee2[_0x9ec2('0x19')][_0x9ec2('0x1a')]||null:null,'attributes':_0x252ee2['options']?_0x252ee2[_0x9ec2('0x19')]['attributes']||null:null,'limit':0x1,'order':_0x252ee2['options']?_0x252ee2[_0x9ec2('0x19')][_0x9ec2('0x2d')]||null:null,'group':db[_0x9ec2('0x17')][_0x9ec2('0x3f')],'transaction':_0x9ad767,'lock':_0x9ad767['LOCK'][_0x9ec2('0x2f')],'include':_0x252ee2[_0x9ec2('0x19')]?_0x252ee2[_0x9ec2('0x19')]['include']?_[_0x9ec2('0x1d')](_0x252ee2[_0x9ec2('0x19')][_0x9ec2('0x1c')],function(_0x4099ba){return{'model':db[_0x4099ba[_0x9ec2('0x1e')]],'as':_0x4099ba['as'],'attributes':_0x4099ba['attributes'],'include':_0x4099ba['include']?_[_0x9ec2('0x1d')](_0x4099ba[_0x9ec2('0x1c')],function(_0x1ce683){return{'model':db[_0x1ce683['model']],'as':_0x1ce683['as'],'attributes':_0x1ce683[_0x9ec2('0x1b')],'include':_0x1ce683['include']?_[_0x9ec2('0x1d')](_0x1ce683[_0x9ec2('0x1c')],function(_0x2773b2){return{'model':db[_0x2773b2[_0x9ec2('0x1e')]],'as':_0x2773b2['as'],'attributes':_0x2773b2[_0x9ec2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cb27f){var _0x5bc919=[];for(var _0x114293=0x0;_0x114293<_0x2cb27f[_0x9ec2('0x32')];_0x114293+=0x1){_0x5bc919[_0x9ec2('0x33')](_0x2cb27f[_0x114293][_0x9ec2('0x27')](_0x252ee2['body'],{'transaction':_0x9ad767}));}return BPromise['all'](_0x5bc919);});})[_0x9ec2('0xb')](function(_0x553793){logger[_0x9ec2('0xc')](_0x9ec2('0x40'),_0x252ee2);logger[_0x9ec2('0xf')](_0x9ec2('0x40'),_0x252ee2,JSON[_0x9ec2('0x22')](_0x553793));_0x385cf5(_0x553793);})[_0x9ec2('0x15')](function(_0x29cb29){logger[_0x9ec2('0x11')](_0x9ec2('0x40'),_0x29cb29[_0x9ec2('0x13')],_0x252ee2);_0x24cf3e(_0x1521ad[_0x9ec2('0x11')](0x1f4,_0x29cb29[_0x9ec2('0x13')]));});});});};
\ No newline at end of file
index 7cee96d..98a22ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router;
\ No newline at end of file
+var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x3e6e2c,_0x291f05){var _0x5adc72=function(_0x3be35f){while(--_0x3be35f){_0x3e6e2c['push'](_0x3e6e2c['shift']());}};_0x5adc72(++_0x291f05);}(_0x7a54,0x106));var _0x47a5=function(_0x4523a6,_0x32b692){_0x4523a6=_0x4523a6-0x0;var _0x518600=_0x7a54[_0x4523a6];return _0x518600;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router;
\ No newline at end of file
index 1519383..8353b59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61c3=['contactListQueue','sequelize','exports','STRING','INTEGER'];(function(_0x5c187c,_0x5ce566){var _0x2aa839=function(_0x5b1bff){while(--_0x5b1bff){_0x5c187c['push'](_0x5c187c['shift']());}};_0x2aa839(++_0x5ce566);}(_0x61c3,0x1aa));var _0x361c=function(_0x2dc89d,_0x297dcc){_0x2dc89d=_0x2dc89d-0x0;var _0x247119=_0x61c3[_0x2dc89d];return _0x247119;};'use strict';var moment=require('moment');var Sequelize=require(_0x361c('0x0'));module[_0x361c('0x1')]={'phone':{'type':Sequelize[_0x361c('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x361c('0x3')],'unique':_0x361c('0x4')},'ListId':{'type':Sequelize[_0x361c('0x3')],'unique':_0x361c('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x361c('0x4')}};
\ No newline at end of file
+var _0xde74=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xde74,0x136));var _0x4de7=function(_0x4eda00,_0x5ae365){_0x4eda00=_0x4eda00-0x0;var _0x4b67bd=_0xde74[_0x4eda00];return _0x4b67bd;};'use strict';var moment=require(_0x4de7('0x0'));var Sequelize=require(_0x4de7('0x1'));module[_0x4de7('0x2')]={'phone':{'type':Sequelize[_0x4de7('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4de7('0x4')],'unique':_0x4de7('0x5')},'ListId':{'type':Sequelize[_0x4de7('0x4')],'unique':_0x4de7('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}};
\ No newline at end of file
index f38b8b8..4ebe233 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39a8=['include','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperBlack','model','keys','query','dateEnd','dateStart','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','add','day','where','type','key','field','filter','merge','options','count','includeAll','findAll','rows','catch','params','rawAttributes'];(function(_0x324496,_0x3a4cdd){var _0x899545=function(_0x506ef1){while(--_0x506ef1){_0x324496['push'](_0x324496['shift']());}};_0x899545(++_0x3a4cdd);}(_0x39a8,0x128));var _0x839a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39a8[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x839a('0x0'));var emlformat=require(_0x839a('0x1'));var rimraf=require(_0x839a('0x2'));var zipdir=require(_0x839a('0x3'));var jsonpatch=require(_0x839a('0x4'));var rp=require(_0x839a('0x5'));var moment=require('moment');var BPromise=require(_0x839a('0x6'));var Mustache=require(_0x839a('0x7'));var util=require(_0x839a('0x8'));var path=require(_0x839a('0x9'));var sox=require('sox');var csv=require(_0x839a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x839a('0xb'));var squel=require('squel');var crypto=require(_0x839a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x839a('0xa'));var querystring=require('querystring');var Papa=require(_0x839a('0xd'));var Redis=require(_0x839a('0xe'));var qs=require(_0x839a('0xf'));var logger=require(_0x839a('0x10'))(_0x839a('0x11'));var utils=require(_0x839a('0x12'));var config=require('../../config/environment');var db=require(_0x839a('0x13'))['db'];function respondWithStatusCode(_0x5df659,_0x2a374e){_0x2a374e=_0x2a374e||0xcc;return function(_0x568589){if(_0x568589){return _0x5df659['sendStatus'](_0x2a374e);}return _0x5df659['status'](_0x2a374e)[_0x839a('0x14')]();};}function respondWithResult(_0x21882f,_0x40a466){_0x40a466=_0x40a466||0xc8;return function(_0xca5efd){if(_0xca5efd){return _0x21882f[_0x839a('0x15')](_0x40a466)[_0x839a('0x16')](_0xca5efd);}};}function respondWithFilteredResult(_0x255da6,_0x956bb5){return function(_0x32f66e){if(_0x32f66e){var _0xce0c6f=_0x32f66e['count'],_0x2805e9=_0x956bb5[_0x839a('0x17')],_0x122807=_0x956bb5[_0x839a('0x17')]+_0x956bb5[_0x839a('0x18')],_0x86512e;if(_0x122807>=_0xce0c6f){_0x122807=_0xce0c6f;_0x86512e=0xc8;}else{_0x86512e=0xce;}_0x255da6['status'](_0x86512e);return _0x255da6['set'](_0x839a('0x19'),_0x2805e9+'-'+_0x122807+'/'+_0xce0c6f)[_0x839a('0x16')](_0x32f66e);}return null;};}function patchUpdates(_0xdcd564){return function(_0x4d3dae){try{jsonpatch[_0x839a('0x1a')](_0x4d3dae,_0xdcd564,!![]);}catch(_0x21ee4d){return BPromise[_0x839a('0x1b')](_0x21ee4d);}return _0x4d3dae[_0x839a('0x1c')]();};}function saveUpdates(_0x489107,_0x4087a3){return function(_0x209f0b){if(_0x209f0b){return _0x209f0b[_0x839a('0x1d')](_0x489107)[_0x839a('0x1e')](function(_0x4ce1e2){return _0x4ce1e2;});}return null;};}function removeEntity(_0x44aa7b,_0x418ccb){return function(_0x1da6be){if(_0x1da6be){return _0x1da6be[_0x839a('0x1f')]()[_0x839a('0x1e')](function(){_0x44aa7b[_0x839a('0x15')](0xcc)[_0x839a('0x14')]();});}};}function handleEntityNotFound(_0x357242,_0x567772){return function(_0xc4d8b){if(!_0xc4d8b){_0x357242['sendStatus'](0x194);}return _0xc4d8b;};}function handleError(_0x1de398,_0x4057ce){_0x4057ce=_0x4057ce||0x1f4;return function(_0x4a701f){logger[_0x839a('0x20')](_0x4a701f[_0x839a('0x21')]);if(_0x4a701f[_0x839a('0x22')]){delete _0x4a701f[_0x839a('0x22')];}_0x1de398[_0x839a('0x15')](_0x4057ce)[_0x839a('0x23')](_0x4a701f);};}exports[_0x839a('0x24')]=function(_0x3deeff,_0x33d794){var _0x28b19e={},_0x3627fd={},_0x1b23a8={'count':0x0,'rows':[]};var _0x4359a4=db[_0x839a('0x25')]['rawAttributes'];_0x3627fd[_0x839a('0x26')]=_[_0x839a('0x27')](_0x4359a4);var _0x42a2be={'dateStart':_0x3deeff[_0x839a('0x28')]['dateStart'],'dateEnd':_0x3deeff[_0x839a('0x28')][_0x839a('0x29')]};delete _0x3deeff[_0x839a('0x28')][_0x839a('0x2a')];delete _0x3deeff[_0x839a('0x28')][_0x839a('0x29')];_0x3627fd[_0x839a('0x28')]=_['keys'](_0x3deeff['query']);_0x3627fd['filters']=_[_0x839a('0x2b')](_0x3627fd['model'],_0x3627fd[_0x839a('0x28')]);_0x28b19e[_0x839a('0x2c')]=_[_0x839a('0x2b')](_0x3627fd['model'],qs[_0x839a('0x2d')](_0x3deeff[_0x839a('0x28')][_0x839a('0x2d')]));_0x28b19e['attributes']=_0x28b19e[_0x839a('0x2c')][_0x839a('0x2e')]?_0x28b19e[_0x839a('0x2c')]:_0x3627fd[_0x839a('0x26')];if(!_0x3deeff['query'][_0x839a('0x2f')](_0x839a('0x30'))){_0x28b19e[_0x839a('0x18')]=qs[_0x839a('0x18')](_0x3deeff[_0x839a('0x28')][_0x839a('0x18')]);_0x28b19e[_0x839a('0x17')]=qs[_0x839a('0x17')](_0x3deeff[_0x839a('0x28')][_0x839a('0x17')]);}_0x28b19e[_0x839a('0x31')]=qs[_0x839a('0x32')](_0x3deeff['query'][_0x839a('0x32')]);_0x28b19e['where']=qs[_0x839a('0x33')](_[_0x839a('0x34')](_0x3deeff[_0x839a('0x28')],_0x3627fd['filters']));if(_0x42a2be[_0x839a('0x2a')]){if(_0x42a2be['dateEnd']){_0x42a2be['dateEnd']=moment(_0x42a2be[_0x839a('0x29')])[_0x839a('0x35')](0x1,_0x839a('0x36'));}else{_0x42a2be[_0x839a('0x29')]=moment(_0x42a2be[_0x839a('0x2a')])[_0x839a('0x35')](0x1,_0x839a('0x36'));}_['merge'](_0x28b19e[_0x839a('0x37')],{'createdAt':{'$gte':_0x42a2be[_0x839a('0x2a')],'$lte':_0x42a2be[_0x839a('0x29')]}});}if(_0x3deeff[_0x839a('0x28')]['filter']){_0x28b19e['where']=_['merge'](_0x28b19e[_0x839a('0x37')],{'$or':_['map'](_0x4359a4,function(_0x24ce6b){if(_0x24ce6b[_0x839a('0x38')][_0x839a('0x39')]!=='VIRTUAL'){var _0x2cd3e6={};_0x2cd3e6[_0x24ce6b[_0x839a('0x3a')]]={'$like':'%'+_0x3deeff[_0x839a('0x28')][_0x839a('0x3b')]+'%'};return _0x2cd3e6;}})});}_0x28b19e=_[_0x839a('0x3c')]({},_0x28b19e,_0x3deeff[_0x839a('0x3d')]);var _0x15519f={'where':_0x28b19e[_0x839a('0x37')]};return db[_0x839a('0x25')]['count'](_0x15519f)['then'](function(_0x57c856){_0x1b23a8[_0x839a('0x3e')]=_0x57c856;if(_0x3deeff[_0x839a('0x28')][_0x839a('0x3f')]){_0x28b19e['include']=[{'all':!![]}];}return db[_0x839a('0x25')][_0x839a('0x40')](_0x28b19e);})[_0x839a('0x1e')](function(_0x56b65a){_0x1b23a8[_0x839a('0x41')]=_0x56b65a;return _0x1b23a8;})[_0x839a('0x1e')](respondWithFilteredResult(_0x33d794,_0x28b19e))[_0x839a('0x42')](handleError(_0x33d794,null));};exports['show']=function(_0x4f4f29,_0x5d77ae){var _0x2b3dcd={'raw':!![],'where':{'id':_0x4f4f29[_0x839a('0x43')]['id']}},_0x2a95ab={};_0x2a95ab[_0x839a('0x26')]=_[_0x839a('0x27')](db[_0x839a('0x25')][_0x839a('0x44')]);_0x2a95ab[_0x839a('0x28')]=_['keys'](_0x4f4f29['query']);_0x2a95ab[_0x839a('0x33')]=_[_0x839a('0x2b')](_0x2a95ab[_0x839a('0x26')],_0x2a95ab[_0x839a('0x28')]);_0x2b3dcd[_0x839a('0x2c')]=_[_0x839a('0x2b')](_0x2a95ab[_0x839a('0x26')],qs[_0x839a('0x2d')](_0x4f4f29[_0x839a('0x28')][_0x839a('0x2d')]));_0x2b3dcd[_0x839a('0x2c')]=_0x2b3dcd[_0x839a('0x2c')]['length']?_0x2b3dcd[_0x839a('0x2c')]:_0x2a95ab[_0x839a('0x26')];if(_0x4f4f29[_0x839a('0x28')][_0x839a('0x3f')]){_0x2b3dcd[_0x839a('0x45')]=[{'all':!![]}];}_0x2b3dcd=_[_0x839a('0x3c')]({},_0x2b3dcd,_0x4f4f29[_0x839a('0x3d')]);return db[_0x839a('0x25')]['find'](_0x2b3dcd)[_0x839a('0x1e')](handleEntityNotFound(_0x5d77ae,null))[_0x839a('0x1e')](respondWithResult(_0x5d77ae,null))[_0x839a('0x42')](handleError(_0x5d77ae,null));};exports[_0x839a('0x1d')]=function(_0xf22680,_0x45ae0a){if(_0xf22680[_0x839a('0x46')]['id']){delete _0xf22680['body']['id'];}return db[_0x839a('0x25')][_0x839a('0x47')]({'where':{'id':_0xf22680[_0x839a('0x43')]['id']}})[_0x839a('0x1e')](handleEntityNotFound(_0x45ae0a,null))[_0x839a('0x1e')](saveUpdates(_0xf22680[_0x839a('0x46')],null))['then'](respondWithResult(_0x45ae0a,null))[_0x839a('0x42')](handleError(_0x45ae0a,null));};exports[_0x839a('0x1f')]=function(_0x47a1e1,_0x35532e){return db[_0x839a('0x25')]['find']({'where':{'id':_0x47a1e1[_0x839a('0x43')]['id']}})[_0x839a('0x1e')](handleEntityNotFound(_0x35532e,null))[_0x839a('0x1e')](removeEntity(_0x35532e,null))[_0x839a('0x42')](handleError(_0x35532e,null));};exports[_0x839a('0x48')]=function(_0x633d44,_0x2e71f5){return db[_0x839a('0x25')][_0x839a('0x48')]()['then'](respondWithResult(_0x2e71f5,null))[_0x839a('0x42')](handleError(_0x2e71f5,null));};
\ No newline at end of file
+var _0x0223=['add','day','merge','type','VIRTUAL','field','filter','includeAll','include','findAll','rows','catch','show','options','body','find','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','then','destroy','error','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x4911c9,_0x14ae78){var _0x59b1ec=function(_0x5f10fb){while(--_0x5f10fb){_0x4911c9['push'](_0x4911c9['shift']());}};_0x59b1ec(++_0x14ae78);}(_0x0223,0x136));var _0x3022=function(_0x5bd3f2,_0x49f10b){_0x5bd3f2=_0x5bd3f2-0x0;var _0x444bfb=_0x0223[_0x5bd3f2];return _0x444bfb;};'use strict';var pdf=require(_0x3022('0x0'));var emlformat=require(_0x3022('0x1'));var rimraf=require(_0x3022('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3022('0x3'));var moment=require(_0x3022('0x4'));var BPromise=require(_0x3022('0x5'));var Mustache=require('mustache');var util=require(_0x3022('0x6'));var path=require(_0x3022('0x7'));var sox=require(_0x3022('0x8'));var csv=require(_0x3022('0x9'));var ejs=require(_0x3022('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3022('0xb'));var crypto=require(_0x3022('0xc'));var jsforce=require(_0x3022('0xd'));var deskjs=require(_0x3022('0xe'));var toCsv=require(_0x3022('0x9'));var querystring=require(_0x3022('0xf'));var Papa=require(_0x3022('0x10'));var Redis=require(_0x3022('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x3022('0x12'))(_0x3022('0x13'));var utils=require(_0x3022('0x14'));var config=require('../../config/environment');var db=require(_0x3022('0x15'))['db'];function respondWithStatusCode(_0x1024f8,_0x2e3ad7){_0x2e3ad7=_0x2e3ad7||0xcc;return function(_0x4e1c43){if(_0x4e1c43){return _0x1024f8[_0x3022('0x16')](_0x2e3ad7);}return _0x1024f8[_0x3022('0x17')](_0x2e3ad7)['end']();};}function respondWithResult(_0x34a63f,_0x387f7a){_0x387f7a=_0x387f7a||0xc8;return function(_0x5195b9){if(_0x5195b9){return _0x34a63f['status'](_0x387f7a)[_0x3022('0x18')](_0x5195b9);}};}function respondWithFilteredResult(_0x3df16e,_0x55a550){return function(_0x3e2e7b){if(_0x3e2e7b){var _0x26cb49=_0x3e2e7b[_0x3022('0x19')],_0xb37845=_0x55a550[_0x3022('0x1a')],_0x3eb476=_0x55a550['offset']+_0x55a550[_0x3022('0x1b')],_0x160119;if(_0x3eb476>=_0x26cb49){_0x3eb476=_0x26cb49;_0x160119=0xc8;}else{_0x160119=0xce;}_0x3df16e[_0x3022('0x17')](_0x160119);return _0x3df16e[_0x3022('0x1c')](_0x3022('0x1d'),_0xb37845+'-'+_0x3eb476+'/'+_0x26cb49)[_0x3022('0x18')](_0x3e2e7b);}return null;};}function patchUpdates(_0x329df2){return function(_0x316608){try{jsonpatch[_0x3022('0x1e')](_0x316608,_0x329df2,!![]);}catch(_0x38214f){return BPromise['reject'](_0x38214f);}return _0x316608['save']();};}function saveUpdates(_0x397db8,_0x18f7e3){return function(_0x26111b){if(_0x26111b){return _0x26111b['update'](_0x397db8)[_0x3022('0x1f')](function(_0x53a09c){return _0x53a09c;});}return null;};}function removeEntity(_0x249bb6,_0x5ef027){return function(_0x32ffb1){if(_0x32ffb1){return _0x32ffb1[_0x3022('0x20')]()[_0x3022('0x1f')](function(){_0x249bb6[_0x3022('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cad21,_0x5c648e){return function(_0x537b93){if(!_0x537b93){_0x1cad21['sendStatus'](0x194);}return _0x537b93;};}function handleError(_0x16a656,_0x23ec42){_0x23ec42=_0x23ec42||0x1f4;return function(_0x531e25){logger[_0x3022('0x21')](_0x531e25['stack']);if(_0x531e25[_0x3022('0x22')]){delete _0x531e25[_0x3022('0x22')];}_0x16a656[_0x3022('0x17')](_0x23ec42)[_0x3022('0x23')](_0x531e25);};}exports[_0x3022('0x24')]=function(_0x447546,_0x1af9a4){var _0x45705c={},_0x803b28={},_0x2ac20f={'count':0x0,'rows':[]};var _0x34e526=db[_0x3022('0x25')][_0x3022('0x26')];_0x803b28[_0x3022('0x27')]=_[_0x3022('0x28')](_0x34e526);var _0x58c076={'dateStart':_0x447546[_0x3022('0x29')][_0x3022('0x2a')],'dateEnd':_0x447546['query']['dateEnd']};delete _0x447546[_0x3022('0x29')][_0x3022('0x2a')];delete _0x447546['query'][_0x3022('0x2b')];_0x803b28['query']=_[_0x3022('0x28')](_0x447546[_0x3022('0x29')]);_0x803b28['filters']=_[_0x3022('0x2c')](_0x803b28['model'],_0x803b28[_0x3022('0x29')]);_0x45705c[_0x3022('0x2d')]=_[_0x3022('0x2c')](_0x803b28['model'],qs[_0x3022('0x2e')](_0x447546[_0x3022('0x29')]['fields']));_0x45705c['attributes']=_0x45705c[_0x3022('0x2d')][_0x3022('0x2f')]?_0x45705c[_0x3022('0x2d')]:_0x803b28['model'];if(!_0x447546[_0x3022('0x29')][_0x3022('0x30')](_0x3022('0x31'))){_0x45705c[_0x3022('0x1b')]=qs[_0x3022('0x1b')](_0x447546[_0x3022('0x29')]['limit']);_0x45705c['offset']=qs['offset'](_0x447546[_0x3022('0x29')]['offset']);}_0x45705c[_0x3022('0x32')]=qs['sort'](_0x447546[_0x3022('0x29')][_0x3022('0x33')]);_0x45705c[_0x3022('0x34')]=qs[_0x3022('0x35')](_[_0x3022('0x36')](_0x447546[_0x3022('0x29')],_0x803b28[_0x3022('0x35')]));if(_0x58c076['dateStart']){if(_0x58c076[_0x3022('0x2b')]){_0x58c076[_0x3022('0x2b')]=moment(_0x58c076[_0x3022('0x2b')])[_0x3022('0x37')](0x1,_0x3022('0x38'));}else{_0x58c076[_0x3022('0x2b')]=moment(_0x58c076['dateStart'])[_0x3022('0x37')](0x1,_0x3022('0x38'));}_['merge'](_0x45705c[_0x3022('0x34')],{'createdAt':{'$gte':_0x58c076[_0x3022('0x2a')],'$lte':_0x58c076[_0x3022('0x2b')]}});}if(_0x447546[_0x3022('0x29')]['filter']){_0x45705c['where']=_[_0x3022('0x39')](_0x45705c[_0x3022('0x34')],{'$or':_['map'](_0x34e526,function(_0x159a96){if(_0x159a96[_0x3022('0x3a')]['key']!==_0x3022('0x3b')){var _0x3f4b4b={};_0x3f4b4b[_0x159a96[_0x3022('0x3c')]]={'$like':'%'+_0x447546[_0x3022('0x29')][_0x3022('0x3d')]+'%'};return _0x3f4b4b;}})});}_0x45705c=_[_0x3022('0x39')]({},_0x45705c,_0x447546['options']);var _0x5bcab3={'where':_0x45705c['where']};return db[_0x3022('0x25')][_0x3022('0x19')](_0x5bcab3)[_0x3022('0x1f')](function(_0x587409){_0x2ac20f[_0x3022('0x19')]=_0x587409;if(_0x447546['query'][_0x3022('0x3e')]){_0x45705c[_0x3022('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3022('0x40')](_0x45705c);})['then'](function(_0x4e3403){_0x2ac20f[_0x3022('0x41')]=_0x4e3403;return _0x2ac20f;})[_0x3022('0x1f')](respondWithFilteredResult(_0x1af9a4,_0x45705c))[_0x3022('0x42')](handleError(_0x1af9a4,null));};exports[_0x3022('0x43')]=function(_0x57bdd5,_0x3c60de){var _0x200e01={'raw':!![],'where':{'id':_0x57bdd5['params']['id']}},_0x163477={};_0x163477[_0x3022('0x27')]=_[_0x3022('0x28')](db[_0x3022('0x25')]['rawAttributes']);_0x163477[_0x3022('0x29')]=_[_0x3022('0x28')](_0x57bdd5[_0x3022('0x29')]);_0x163477[_0x3022('0x35')]=_[_0x3022('0x2c')](_0x163477['model'],_0x163477[_0x3022('0x29')]);_0x200e01[_0x3022('0x2d')]=_['intersection'](_0x163477[_0x3022('0x27')],qs[_0x3022('0x2e')](_0x57bdd5['query'][_0x3022('0x2e')]));_0x200e01['attributes']=_0x200e01[_0x3022('0x2d')][_0x3022('0x2f')]?_0x200e01[_0x3022('0x2d')]:_0x163477[_0x3022('0x27')];if(_0x57bdd5[_0x3022('0x29')][_0x3022('0x3e')]){_0x200e01[_0x3022('0x3f')]=[{'all':!![]}];}_0x200e01=_['merge']({},_0x200e01,_0x57bdd5[_0x3022('0x44')]);return db[_0x3022('0x25')]['find'](_0x200e01)[_0x3022('0x1f')](handleEntityNotFound(_0x3c60de,null))[_0x3022('0x1f')](respondWithResult(_0x3c60de,null))[_0x3022('0x42')](handleError(_0x3c60de,null));};exports['update']=function(_0x304495,_0x4be703){if(_0x304495[_0x3022('0x45')]['id']){delete _0x304495['body']['id'];}return db['CmHopperBlack'][_0x3022('0x46')]({'where':{'id':_0x304495[_0x3022('0x47')]['id']}})[_0x3022('0x1f')](handleEntityNotFound(_0x4be703,null))[_0x3022('0x1f')](saveUpdates(_0x304495[_0x3022('0x45')],null))[_0x3022('0x1f')](respondWithResult(_0x4be703,null))[_0x3022('0x42')](handleError(_0x4be703,null));};exports[_0x3022('0x20')]=function(_0xe1ea01,_0x377933){return db['CmHopperBlack'][_0x3022('0x46')]({'where':{'id':_0xe1ea01['params']['id']}})[_0x3022('0x1f')](handleEntityNotFound(_0x377933,null))[_0x3022('0x1f')](removeEntity(_0x377933,null))[_0x3022('0x42')](handleError(_0x377933,null));};exports[_0x3022('0x48')]=function(_0x46d1f6,_0x180d9e){return db['CmHopperBlack'][_0x3022('0x48')]()[_0x3022('0x1f')](respondWithResult(_0x180d9e,null))[_0x3022('0x42')](handleError(_0x180d9e,null));};
\ No newline at end of file
index af7e0b2..fb20243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5458=['exports','define','cm_hopper_black','util','moment','request-promise'];(function(_0x36b444,_0x505b35){var _0x786323=function(_0x146af0){while(--_0x146af0){_0x36b444['push'](_0x36b444['shift']());}};_0x786323(++_0x505b35);}(_0x5458,0xb1));var _0x8545=function(_0x4426df,_0x16ca67){_0x4426df=_0x4426df-0x0;var _0x35f87e=_0x5458[_0x4426df];return _0x35f87e;};'use strict';var _=require('lodash');var util=require(_0x8545('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8545('0x1'));var BPromise=require('bluebird');var rp=require(_0x8545('0x2'));var attributes=require('./cmHopperBlack.attributes');module[_0x8545('0x3')]=function(_0x1254dc,_0x29ad56){return _0x1254dc[_0x8545('0x4')]('CmHopperBlack',attributes,{'tableName':_0x8545('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61f8=['exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','bluebird','./cmHopperBlack.attributes'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x61f8,0x124));var _0x861f=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x61f8[_0x2179f1];return _0x176ec9;};'use strict';var _=require('lodash');var util=require(_0x861f('0x0'));var logger=require(_0x861f('0x1'))(_0x861f('0x2'));var moment=require('moment');var BPromise=require(_0x861f('0x3'));var rp=require('request-promise');var attributes=require(_0x861f('0x4'));module[_0x861f('0x5')]=function(_0x39bc85,_0x21b18d){return _0x39bc85[_0x861f('0x6')](_0x861f('0x7'),attributes,{'tableName':_0x861f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ecfa2de..e3e28f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3df4=['attributes','debug','UpdateCmHopperBlack','update','body','then','DestroyCmHopperBlack','destroy','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','model'];(function(_0x23bcec,_0x2ad358){var _0x5d0dd6=function(_0x3e7a65){while(--_0x3e7a65){_0x23bcec['push'](_0x23bcec['shift']());}};_0x5d0dd6(++_0x2ad358);}(_0x3df4,0x112));var _0x43df=function(_0x449750,_0x434522){_0x449750=_0x449750-0x0;var _0x414c17=_0x3df4[_0x449750];return _0x414c17;};'use strict';var _=require(_0x43df('0x0'));var util=require(_0x43df('0x1'));var moment=require(_0x43df('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43df('0x3'));var db=require(_0x43df('0x4'))['db'];var utils=require(_0x43df('0x5'));var logger=require(_0x43df('0x6'))(_0x43df('0x7'));var config=require(_0x43df('0x8'));var jayson=require(_0x43df('0x9'));var client=jayson['client'][_0x43df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24bf03,_0x53e1ba,_0x488ed5){return new BPromise(function(_0x49b0e9,_0xe26ac){return client['request'](_0x24bf03,_0x488ed5)['then'](function(_0x3a9495){logger[_0x43df('0xb')](_0x43df('0xc'),_0x53e1ba,_0x43df('0xd'));logger['debug'](_0x43df('0xe'),_0x53e1ba,'request\x20sent',JSON[_0x43df('0xf')](_0x3a9495));if(_0x3a9495[_0x43df('0x10')]){if(_0x3a9495[_0x43df('0x10')][_0x43df('0x11')]===0x1f4){logger[_0x43df('0x10')](_0x43df('0xc'),_0x53e1ba,_0x3a9495[_0x43df('0x10')][_0x43df('0x12')]);return _0xe26ac(_0x3a9495[_0x43df('0x10')][_0x43df('0x12')]);}logger[_0x43df('0x10')](_0x43df('0xc'),_0x53e1ba,_0x3a9495[_0x43df('0x10')][_0x43df('0x12')]);return _0x49b0e9(_0x3a9495[_0x43df('0x10')]['message']);}else{logger['info'](_0x43df('0xc'),_0x53e1ba,_0x43df('0xd'));_0x49b0e9(_0x3a9495['result'][_0x43df('0x12')]);}})[_0x43df('0x13')](function(_0x49fcd9){logger[_0x43df('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x53e1ba,_0x49fcd9);_0xe26ac(_0x49fcd9);});});}exports[_0x43df('0x14')]=function(_0x492223){var _0xb81ad0=this;return new Promise(function(_0x466683,_0x7071e1){return db[_0x43df('0x15')][_0x43df('0x16')]({'raw':_0x492223[_0x43df('0x17')]?_0x492223['options'][_0x43df('0x18')]===undefined?!![]:![]:!![],'where':_0x492223[_0x43df('0x17')]?_0x492223[_0x43df('0x17')][_0x43df('0x19')]||null:null,'attributes':_0x492223[_0x43df('0x17')]?_0x492223['options']['attributes']||null:null,'limit':_0x492223['options']?_0x492223[_0x43df('0x17')][_0x43df('0x1a')]||null:null,'include':_0x492223[_0x43df('0x17')]?_0x492223[_0x43df('0x17')][_0x43df('0x1b')]?_[_0x43df('0x1c')](_0x492223[_0x43df('0x17')][_0x43df('0x1b')],function(_0x3f21d6){return{'model':db[_0x3f21d6[_0x43df('0x1d')]],'as':_0x3f21d6['as'],'attributes':_0x3f21d6[_0x43df('0x1e')],'include':_0x3f21d6[_0x43df('0x1b')]?_['map'](_0x3f21d6['include'],function(_0x38577f){return{'model':db[_0x38577f[_0x43df('0x1d')]],'as':_0x38577f['as'],'attributes':_0x38577f['attributes'],'include':_0x38577f[_0x43df('0x1b')]?_[_0x43df('0x1c')](_0x38577f[_0x43df('0x1b')],function(_0x37d316){return{'model':db[_0x37d316[_0x43df('0x1d')]],'as':_0x37d316['as'],'attributes':_0x37d316['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23aade){logger[_0x43df('0xb')]('GetCmHopperBlack',_0x492223);logger[_0x43df('0x1f')](_0x43df('0x14'),_0x492223,JSON[_0x43df('0xf')](_0x23aade));_0x466683(_0x23aade);})[_0x43df('0x13')](function(_0x32a4b9){logger[_0x43df('0x10')](_0x43df('0x14'),_0x32a4b9['message'],_0x492223);_0x7071e1(_0xb81ad0[_0x43df('0x10')](0x1f4,_0x32a4b9[_0x43df('0x12')]));});});};exports[_0x43df('0x20')]=function(_0x1414a2){var _0x5e6342=this;return new Promise(function(_0x248fee,_0x3e7eb5){return db[_0x43df('0x15')][_0x43df('0x21')](_0x1414a2[_0x43df('0x22')],{'raw':_0x1414a2[_0x43df('0x17')]?_0x1414a2[_0x43df('0x17')][_0x43df('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1414a2['options']?_0x1414a2[_0x43df('0x17')][_0x43df('0x19')]||null:null,'attributes':_0x1414a2['options']?_0x1414a2['options'][_0x43df('0x1e')]||null:null,'limit':_0x1414a2[_0x43df('0x17')]?_0x1414a2['options'][_0x43df('0x1a')]||null:null})[_0x43df('0x23')](function(_0x1691c4){logger[_0x43df('0xb')](_0x43df('0x20'),_0x1414a2);logger[_0x43df('0x1f')]('UpdateCmHopperBlack',_0x1414a2,JSON[_0x43df('0xf')](_0x1691c4));_0x248fee(_0x1691c4);})[_0x43df('0x13')](function(_0x392658){logger[_0x43df('0x10')](_0x43df('0x20'),_0x392658[_0x43df('0x12')],_0x1414a2);_0x3e7eb5(_0x5e6342['error'](0x1f4,_0x392658[_0x43df('0x12')]));});});};exports[_0x43df('0x24')]=function(_0xe2b015){var _0x5a9dc5=this;return new Promise(function(_0x455658,_0xbdb95c){return db[_0x43df('0x15')][_0x43df('0x25')]({'where':_0xe2b015[_0x43df('0x17')]?_0xe2b015[_0x43df('0x17')][_0x43df('0x19')]||null:null})['then'](function(_0x11162c){logger[_0x43df('0xb')](_0x43df('0x24'),_0xe2b015);logger['debug'](_0x43df('0x24'),_0xe2b015,JSON[_0x43df('0xf')](_0x11162c));_0x455658(_0x11162c);})['catch'](function(_0x4b1a9d){logger['error'](_0x43df('0x24'),_0x4b1a9d[_0x43df('0x12')],_0xe2b015);_0xbdb95c(_0x5a9dc5[_0x43df('0x10')](0x1f4,_0x4b1a9d[_0x43df('0x12')]));});});};
\ No newline at end of file
+var _0x7005=['include','model','debug','update','body','UpdateCmHopperBlack','stringify','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','map'];(function(_0x349a25,_0x2d5afe){var _0x2ef471=function(_0x55e172){while(--_0x55e172){_0x349a25['push'](_0x349a25['shift']());}};_0x2ef471(++_0x2d5afe);}(_0x7005,0x140));var _0x5700=function(_0x134feb,_0x3289f5){_0x134feb=_0x134feb-0x0;var _0x26c653=_0x7005[_0x134feb];return _0x26c653;};'use strict';var _=require(_0x5700('0x0'));var util=require(_0x5700('0x1'));var moment=require(_0x5700('0x2'));var BPromise=require(_0x5700('0x3'));var rs=require(_0x5700('0x4'));var fs=require('fs');var Redis=require(_0x5700('0x5'));var db=require(_0x5700('0x6'))['db'];var utils=require(_0x5700('0x7'));var logger=require(_0x5700('0x8'))(_0x5700('0x9'));var config=require(_0x5700('0xa'));var jayson=require(_0x5700('0xb'));var client=jayson['client'][_0x5700('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b4d41,_0x48b4aa,_0x5641fd){return new BPromise(function(_0x422595,_0x50f26b){return client[_0x5700('0xd')](_0x1b4d41,_0x5641fd)[_0x5700('0xe')](function(_0x4169d1){logger[_0x5700('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x48b4aa,'request\x20sent');logger['debug'](_0x5700('0x10'),_0x48b4aa,'request\x20sent',JSON['stringify'](_0x4169d1));if(_0x4169d1['error']){if(_0x4169d1[_0x5700('0x11')][_0x5700('0x12')]===0x1f4){logger[_0x5700('0x11')](_0x5700('0x13'),_0x48b4aa,_0x4169d1[_0x5700('0x11')]['message']);return _0x50f26b(_0x4169d1['error'][_0x5700('0x14')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x48b4aa,_0x4169d1[_0x5700('0x11')]['message']);return _0x422595(_0x4169d1[_0x5700('0x11')]['message']);}else{logger[_0x5700('0xf')](_0x5700('0x13'),_0x48b4aa,'request\x20sent');_0x422595(_0x4169d1[_0x5700('0x15')][_0x5700('0x14')]);}})[_0x5700('0x16')](function(_0x552b31){logger[_0x5700('0x11')](_0x5700('0x13'),_0x48b4aa,_0x552b31);_0x50f26b(_0x552b31);});});}exports[_0x5700('0x17')]=function(_0x399d02){var _0x1a5aaf=this;return new Promise(function(_0x3c922a,_0x48c715){return db[_0x5700('0x18')]['findAll']({'raw':_0x399d02[_0x5700('0x19')]?_0x399d02[_0x5700('0x19')][_0x5700('0x1a')]===undefined?!![]:![]:!![],'where':_0x399d02[_0x5700('0x19')]?_0x399d02[_0x5700('0x19')][_0x5700('0x1b')]||null:null,'attributes':_0x399d02[_0x5700('0x19')]?_0x399d02[_0x5700('0x19')][_0x5700('0x1c')]||null:null,'limit':_0x399d02[_0x5700('0x19')]?_0x399d02['options'][_0x5700('0x1d')]||null:null,'include':_0x399d02[_0x5700('0x19')]?_0x399d02[_0x5700('0x19')]['include']?_[_0x5700('0x1e')](_0x399d02[_0x5700('0x19')][_0x5700('0x1f')],function(_0x3b2f07){return{'model':db[_0x3b2f07[_0x5700('0x20')]],'as':_0x3b2f07['as'],'attributes':_0x3b2f07[_0x5700('0x1c')],'include':_0x3b2f07['include']?_[_0x5700('0x1e')](_0x3b2f07['include'],function(_0x2338b1){return{'model':db[_0x2338b1['model']],'as':_0x2338b1['as'],'attributes':_0x2338b1[_0x5700('0x1c')],'include':_0x2338b1[_0x5700('0x1f')]?_['map'](_0x2338b1[_0x5700('0x1f')],function(_0x15408f){return{'model':db[_0x15408f[_0x5700('0x20')]],'as':_0x15408f['as'],'attributes':_0x15408f[_0x5700('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5700('0xe')](function(_0x31fe12){logger['info'](_0x5700('0x17'),_0x399d02);logger[_0x5700('0x21')](_0x5700('0x17'),_0x399d02,JSON['stringify'](_0x31fe12));_0x3c922a(_0x31fe12);})[_0x5700('0x16')](function(_0x171128){logger[_0x5700('0x11')](_0x5700('0x17'),_0x171128[_0x5700('0x14')],_0x399d02);_0x48c715(_0x1a5aaf[_0x5700('0x11')](0x1f4,_0x171128[_0x5700('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x24dc03){var _0x183630=this;return new Promise(function(_0xf421b9,_0x4ba11c){return db[_0x5700('0x18')][_0x5700('0x22')](_0x24dc03[_0x5700('0x23')],{'raw':_0x24dc03['options']?_0x24dc03[_0x5700('0x19')][_0x5700('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24dc03[_0x5700('0x19')]?_0x24dc03[_0x5700('0x19')][_0x5700('0x1b')]||null:null,'attributes':_0x24dc03[_0x5700('0x19')]?_0x24dc03['options'][_0x5700('0x1c')]||null:null,'limit':_0x24dc03[_0x5700('0x19')]?_0x24dc03[_0x5700('0x19')][_0x5700('0x1d')]||null:null})['then'](function(_0x304bee){logger[_0x5700('0xf')]('UpdateCmHopperBlack',_0x24dc03);logger[_0x5700('0x21')](_0x5700('0x24'),_0x24dc03,JSON[_0x5700('0x25')](_0x304bee));_0xf421b9(_0x304bee);})[_0x5700('0x16')](function(_0x135d16){logger['error'](_0x5700('0x24'),_0x135d16[_0x5700('0x14')],_0x24dc03);_0x4ba11c(_0x183630[_0x5700('0x11')](0x1f4,_0x135d16[_0x5700('0x14')]));});});};exports[_0x5700('0x26')]=function(_0x38c043){var _0x6fe30e=this;return new Promise(function(_0x3e6560,_0xa4f127){return db['CmHopperBlack']['destroy']({'where':_0x38c043[_0x5700('0x19')]?_0x38c043[_0x5700('0x19')][_0x5700('0x1b')]||null:null})[_0x5700('0xe')](function(_0x3a70f9){logger[_0x5700('0xf')](_0x5700('0x26'),_0x38c043);logger['debug']('DestroyCmHopperBlack',_0x38c043,JSON[_0x5700('0x25')](_0x3a70f9));_0x3e6560(_0x3a70f9);})[_0x5700('0x16')](function(_0x8b1cf1){logger[_0x5700('0x11')](_0x5700('0x26'),_0x8b1cf1[_0x5700('0x14')],_0x38c043);_0xa4f127(_0x6fe30e[_0x5700('0x11')](0x1f4,_0x8b1cf1['message']));});});};
\ No newline at end of file
index 686e326..bf3eecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4737=['path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy','exports','multer','util'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0x4737,0x141));var _0x7473=function(_0x54bc39,_0x137a8f){_0x54bc39=_0x54bc39-0x0;var _0x29073b=_0x4737[_0x54bc39];return _0x29073b;};'use strict';var multer=require(_0x7473('0x0'));var util=require(_0x7473('0x1'));var path=require(_0x7473('0x2'));var timeout=require(_0x7473('0x3'));var express=require(_0x7473('0x4'));var router=express[_0x7473('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7473('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x7473('0x7')]('/',auth[_0x7473('0x8')](),controller[_0x7473('0x9')]);router['get'](_0x7473('0xa'),auth[_0x7473('0x8')](),controller['describe']);router[_0x7473('0x7')](_0x7473('0xb'),auth[_0x7473('0x8')](),controller[_0x7473('0xc')]);router[_0x7473('0xd')](_0x7473('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7473('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7473('0xf')]);module[_0x7473('0x10')]=router;
\ No newline at end of file
+var _0xe908=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x22fc1d,_0x5b8ee1){var _0x29e032=function(_0x69e18a){while(--_0x69e18a){_0x22fc1d['push'](_0x22fc1d['shift']());}};_0x29e032(++_0x5b8ee1);}(_0xe908,0x1be));var _0x8e90=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xe908[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require(_0x8e90('0x0'));var path=require('path');var timeout=require(_0x8e90('0x1'));var express=require(_0x8e90('0x2'));var router=express[_0x8e90('0x3')]();var auth=require(_0x8e90('0x4'));var interaction=require(_0x8e90('0x5'));var config=require(_0x8e90('0x6'));var controller=require(_0x8e90('0x7'));router[_0x8e90('0x8')]('/',auth[_0x8e90('0x9')](),controller['index']);router['get'](_0x8e90('0xa'),auth['isAuthenticated'](),controller[_0x8e90('0xb')]);router[_0x8e90('0x8')]('/:id',auth[_0x8e90('0x9')](),controller['show']);router['put'](_0x8e90('0xc'),auth[_0x8e90('0x9')](),controller[_0x8e90('0xd')]);router[_0x8e90('0xe')](_0x8e90('0xc'),auth['isAuthenticated'](),controller[_0x8e90('0xf')]);module[_0x8e90('0x10')]=router;
\ No newline at end of file
index 091031d..6ab304d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['STRING','DATE','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','moment','exports','INTEGER'];(function(_0xe13bf9,_0x3db04c){var _0x35d132=function(_0x5270ab){while(--_0x5270ab){_0xe13bf9['push'](_0xe13bf9['shift']());}};_0x35d132(++_0x3db04c);}(_0xae24,0x13c));var _0x4ae2=function(_0x21bd24,_0x18748e){_0x21bd24=_0x21bd24-0x0;var _0x502574=_0xae24[_0x21bd24];return _0x502574;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4ae2('0x0'));module[_0x4ae2('0x1')]={'state':{'type':Sequelize[_0x4ae2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4ae2('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4ae2('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4ae2('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x4ae2('0x3')]},'originatecalleridname':{'type':Sequelize[_0x4ae2('0x3')]},'calleridnum':{'type':Sequelize[_0x4ae2('0x3')]},'calleridname':{'type':Sequelize[_0x4ae2('0x3')]},'starttime':{'type':Sequelize[_0x4ae2('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4ae2('0x4')]},'ringtime':{'type':Sequelize[_0x4ae2('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4ae2('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4ae2('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4ae2('0x3')]},'campaign':{'type':Sequelize[_0x4ae2('0x3')]},'campaigntype':{'type':Sequelize[_0x4ae2('0x3')]},'membername':{'type':Sequelize[_0x4ae2('0x3')]},'reason':{'type':Sequelize[_0x4ae2('0x3')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x5c7915){var _0x48a37d=this['getDataValue'](_0x4ae2('0x5'));if(_0x48a37d&&_0x5c7915){this[_0x4ae2('0x6')](_0x4ae2('0x7'),moment(_0x5c7915)[_0x4ae2('0x8')](moment(_0x48a37d),'seconds'));}return this['setDataValue'](_0x4ae2('0x9'),_0x5c7915);}},'amd':{'type':Sequelize[_0x4ae2('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4ae2('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x4ae2('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x4ae2('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4ae2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4ae2('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x4ae2('0x4')]},'recallme':{'type':Sequelize[_0x4ae2('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x4ae2('0x4')]}};
\ No newline at end of file
+var _0xc944=['setDataValue','diff','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime'];(function(_0x46fd13,_0x200ce9){var _0x4198d1=function(_0x44f35a){while(--_0x44f35a){_0x46fd13['push'](_0x46fd13['shift']());}};_0x4198d1(++_0x200ce9);}(_0xc944,0x9e));var _0x4c94=function(_0xe45b3b,_0xe65c67){_0xe45b3b=_0xe45b3b-0x0;var _0x45f1d2=_0xc944[_0xe45b3b];return _0x45f1d2;};'use strict';var Sequelize=require(_0x4c94('0x0'));var moment=require(_0x4c94('0x1'));module[_0x4c94('0x2')]={'state':{'type':Sequelize[_0x4c94('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x4c94('0x4')]},'scheduledat':{'type':Sequelize[_0x4c94('0x5')]},'countbusyretry':{'type':Sequelize[_0x4c94('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4c94('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4c94('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x4c94('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4c94('0x4')]},'calleridname':{'type':Sequelize[_0x4c94('0x4')]},'starttime':{'type':Sequelize[_0x4c94('0x5')]},'responsetime':{'type':Sequelize[_0x4c94('0x5')]},'answertime':{'type':Sequelize[_0x4c94('0x5')]},'droptime':{'type':Sequelize[_0x4c94('0x5')]},'endtime':{'type':Sequelize[_0x4c94('0x5')]},'ringtime':{'type':Sequelize[_0x4c94('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4c94('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4c94('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4c94('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4c94('0x4')]},'campaigntype':{'type':Sequelize[_0x4c94('0x4')]},'membername':{'type':Sequelize[_0x4c94('0x4')]},'reason':{'type':Sequelize[_0x4c94('0x4')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x4c94('0x5')],'set':function(_0x3e9191){var _0x418cda=this['getDataValue'](_0x4c94('0x6'));if(_0x418cda&&_0x3e9191){this[_0x4c94('0x7')]('followuptime',moment(_0x3e9191)[_0x4c94('0x8')](moment(_0x418cda),'seconds'));}return this[_0x4c94('0x7')](_0x4c94('0x9'),_0x3e9191);}},'amd':{'type':Sequelize[_0x4c94('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x4c94('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x4c94('0x5')]},'callback':{'type':Sequelize[_0x4c94('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4c94('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4c94('0x5')]},'deleted':{'type':Sequelize[_0x4c94('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x4c94('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x4c94('0x5')]}};
\ No newline at end of file
index 7d2c462..7e761a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f89=['rows','show','rawAttributes','includeAll','find','catch','describe','body','uniqueid','params','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','reCallContacts','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','phone','ContactId','ListId','updatedAt','select','ANY_VALUE(calleridnum)','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','cm_hopper_final','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','update','destroy','then','error','stack','name','send','index','query','dateStart','dateEnd','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','day','merge','where','filter','map','type','key','VIRTUAL','field','options','include','CmHopperFinal'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9f89,0x13d));var _0x99f8=function(_0x55a8a0,_0x313c62){_0x55a8a0=_0x55a8a0-0x0;var _0x581017=_0x9f89[_0x55a8a0];return _0x581017;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x99f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99f8('0x1'));var jsonpatch=require(_0x99f8('0x2'));var rp=require(_0x99f8('0x3'));var moment=require(_0x99f8('0x4'));var BPromise=require(_0x99f8('0x5'));var Mustache=require('mustache');var util=require(_0x99f8('0x6'));var path=require(_0x99f8('0x7'));var sox=require(_0x99f8('0x8'));var csv=require(_0x99f8('0x9'));var ejs=require(_0x99f8('0xa'));var fs=require('fs');var _=require(_0x99f8('0xb'));var squel=require(_0x99f8('0xc'));var crypto=require('crypto');var jsforce=require(_0x99f8('0xd'));var deskjs=require(_0x99f8('0xe'));var toCsv=require(_0x99f8('0x9'));var querystring=require(_0x99f8('0xf'));var Papa=require('papaparse');var Redis=require(_0x99f8('0x10'));var qs=require(_0x99f8('0x11'));var logger=require(_0x99f8('0x12'))(_0x99f8('0x13'));var utils=require('../../config/utils');var config=require(_0x99f8('0x14'));var db=require(_0x99f8('0x15'))['db'];function respondWithStatusCode(_0x12259a,_0xcd463c){_0xcd463c=_0xcd463c||0xcc;return function(_0xb4c774){if(_0xb4c774){return _0x12259a[_0x99f8('0x16')](_0xcd463c);}return _0x12259a[_0x99f8('0x17')](_0xcd463c)[_0x99f8('0x18')]();};}function respondWithResult(_0x3262a7,_0x44aa80){_0x44aa80=_0x44aa80||0xc8;return function(_0x244ccd){if(_0x244ccd){return _0x3262a7['status'](_0x44aa80)[_0x99f8('0x19')](_0x244ccd);}};}function respondWithFilteredResult(_0x2dd97e,_0x4973d6){return function(_0x135957){if(_0x135957){var _0x3f8897=_0x135957[_0x99f8('0x1a')],_0x2430c1=_0x4973d6[_0x99f8('0x1b')],_0x237558=_0x4973d6[_0x99f8('0x1b')]+_0x4973d6['limit'],_0x25a8a4;if(_0x237558>=_0x3f8897){_0x237558=_0x3f8897;_0x25a8a4=0xc8;}else{_0x25a8a4=0xce;}_0x2dd97e[_0x99f8('0x17')](_0x25a8a4);return _0x2dd97e[_0x99f8('0x1c')]('Content-Range',_0x2430c1+'-'+_0x237558+'/'+_0x3f8897)[_0x99f8('0x19')](_0x135957);}return null;};}function patchUpdates(_0xa7f114){return function(_0x5b8dd8){try{jsonpatch['apply'](_0x5b8dd8,_0xa7f114,!![]);}catch(_0x341e78){return BPromise[_0x99f8('0x1d')](_0x341e78);}return _0x5b8dd8['save']();};}function saveUpdates(_0x826fca,_0x1b44e2){return function(_0x271d94){if(_0x271d94){return _0x271d94[_0x99f8('0x1e')](_0x826fca)['then'](function(_0x1eb794){return _0x1eb794;});}return null;};}function removeEntity(_0x17c65e,_0x5082ca){return function(_0x29892f){if(_0x29892f){return _0x29892f[_0x99f8('0x1f')]()[_0x99f8('0x20')](function(){_0x17c65e[_0x99f8('0x17')](0xcc)[_0x99f8('0x18')]();});}};}function handleEntityNotFound(_0x2aeb04,_0x1fe817){return function(_0x3412e8){if(!_0x3412e8){_0x2aeb04[_0x99f8('0x16')](0x194);}return _0x3412e8;};}function handleError(_0x3e5ba4,_0x5ecb10){_0x5ecb10=_0x5ecb10||0x1f4;return function(_0x16ea3){logger[_0x99f8('0x21')](_0x16ea3[_0x99f8('0x22')]);if(_0x16ea3[_0x99f8('0x23')]){delete _0x16ea3['name'];}_0x3e5ba4[_0x99f8('0x17')](_0x5ecb10)[_0x99f8('0x24')](_0x16ea3);};}exports[_0x99f8('0x25')]=function(_0x1a15ff,_0x262337){var _0x1e86eb={},_0x5cf6ba={},_0xa6728e={'count':0x0,'rows':[]};var _0x45509e=db['CmHopperFinal']['rawAttributes'];_0x5cf6ba['model']=_['keys'](_0x45509e);var _0x55343e={'dateStart':_0x1a15ff[_0x99f8('0x26')][_0x99f8('0x27')],'dateEnd':_0x1a15ff[_0x99f8('0x26')]['dateEnd']};delete _0x1a15ff['query']['dateStart'];delete _0x1a15ff[_0x99f8('0x26')][_0x99f8('0x28')];_0x5cf6ba[_0x99f8('0x26')]=_[_0x99f8('0x29')](_0x1a15ff[_0x99f8('0x26')]);_0x5cf6ba[_0x99f8('0x2a')]=_[_0x99f8('0x2b')](_0x5cf6ba[_0x99f8('0x2c')],_0x5cf6ba[_0x99f8('0x26')]);_0x1e86eb[_0x99f8('0x2d')]=_[_0x99f8('0x2b')](_0x5cf6ba['model'],qs[_0x99f8('0x2e')](_0x1a15ff['query'][_0x99f8('0x2e')]));_0x1e86eb['attributes']=_0x1e86eb[_0x99f8('0x2d')][_0x99f8('0x2f')]?_0x1e86eb[_0x99f8('0x2d')]:_0x5cf6ba[_0x99f8('0x2c')];if(!_0x1a15ff[_0x99f8('0x26')][_0x99f8('0x30')](_0x99f8('0x31'))){_0x1e86eb['limit']=qs[_0x99f8('0x32')](_0x1a15ff[_0x99f8('0x26')][_0x99f8('0x32')]);_0x1e86eb[_0x99f8('0x1b')]=qs[_0x99f8('0x1b')](_0x1a15ff[_0x99f8('0x26')]['offset']);}_0x1e86eb['order']=qs[_0x99f8('0x33')](_0x1a15ff[_0x99f8('0x26')][_0x99f8('0x33')]);_0x1e86eb['where']=qs[_0x99f8('0x2a')](_['pick'](_0x1a15ff['query'],_0x5cf6ba[_0x99f8('0x2a')]));if(_0x55343e[_0x99f8('0x27')]){if(_0x55343e[_0x99f8('0x28')]){_0x55343e['dateEnd']=moment(_0x55343e[_0x99f8('0x28')])['add'](0x1,'day');}else{_0x55343e['dateEnd']=moment(_0x55343e[_0x99f8('0x27')])['add'](0x1,_0x99f8('0x34'));}_[_0x99f8('0x35')](_0x1e86eb[_0x99f8('0x36')],{'createdAt':{'$gte':_0x55343e[_0x99f8('0x27')],'$lte':_0x55343e[_0x99f8('0x28')]}});}if(_0x1a15ff['query'][_0x99f8('0x37')]){_0x1e86eb[_0x99f8('0x36')]=_[_0x99f8('0x35')](_0x1e86eb[_0x99f8('0x36')],{'$or':_[_0x99f8('0x38')](_0x45509e,function(_0xbcb6aa){if(_0xbcb6aa[_0x99f8('0x39')][_0x99f8('0x3a')]!==_0x99f8('0x3b')){var _0x4c04f8={};_0x4c04f8[_0xbcb6aa[_0x99f8('0x3c')]]={'$like':'%'+_0x1a15ff[_0x99f8('0x26')][_0x99f8('0x37')]+'%'};return _0x4c04f8;}})});}_0x1e86eb=_['merge']({},_0x1e86eb,_0x1a15ff[_0x99f8('0x3d')]);var _0x2c92a9={'where':_0x1e86eb['where']};return db['CmHopperFinal'][_0x99f8('0x1a')](_0x2c92a9)[_0x99f8('0x20')](function(_0x402de4){_0xa6728e['count']=_0x402de4;if(_0x1a15ff['query']['includeAll']){_0x1e86eb[_0x99f8('0x3e')]=[{'all':!![]}];}return db[_0x99f8('0x3f')]['findAll'](_0x1e86eb);})[_0x99f8('0x20')](function(_0x3a9cd5){_0xa6728e[_0x99f8('0x40')]=_0x3a9cd5;return _0xa6728e;})['then'](respondWithFilteredResult(_0x262337,_0x1e86eb))['catch'](handleError(_0x262337,null));};exports[_0x99f8('0x41')]=function(_0x1de3e7,_0x1f2172){var _0x216b59={'raw':!![],'where':{'id':_0x1de3e7['params']['id']}},_0x575273={};_0x575273[_0x99f8('0x2c')]=_['keys'](db[_0x99f8('0x3f')][_0x99f8('0x42')]);_0x575273[_0x99f8('0x26')]=_[_0x99f8('0x29')](_0x1de3e7[_0x99f8('0x26')]);_0x575273['filters']=_[_0x99f8('0x2b')](_0x575273[_0x99f8('0x2c')],_0x575273[_0x99f8('0x26')]);_0x216b59[_0x99f8('0x2d')]=_[_0x99f8('0x2b')](_0x575273[_0x99f8('0x2c')],qs[_0x99f8('0x2e')](_0x1de3e7[_0x99f8('0x26')][_0x99f8('0x2e')]));_0x216b59[_0x99f8('0x2d')]=_0x216b59[_0x99f8('0x2d')]['length']?_0x216b59[_0x99f8('0x2d')]:_0x575273[_0x99f8('0x2c')];if(_0x1de3e7[_0x99f8('0x26')][_0x99f8('0x43')]){_0x216b59['include']=[{'all':!![]}];}_0x216b59=_['merge']({},_0x216b59,_0x1de3e7[_0x99f8('0x3d')]);return db[_0x99f8('0x3f')][_0x99f8('0x44')](_0x216b59)['then'](handleEntityNotFound(_0x1f2172,null))[_0x99f8('0x20')](respondWithResult(_0x1f2172,null))[_0x99f8('0x45')](handleError(_0x1f2172,null));};exports[_0x99f8('0x46')]=function(_0x40d62d,_0x4ac437){return db[_0x99f8('0x3f')][_0x99f8('0x46')]()[_0x99f8('0x20')](respondWithResult(_0x4ac437,null))[_0x99f8('0x45')](handleError(_0x4ac437,null));};exports[_0x99f8('0x1e')]=function(_0x406250,_0x198089){if(_0x406250[_0x99f8('0x47')][_0x99f8('0x48')]){delete _0x406250['body'][_0x99f8('0x48')];}return db[_0x99f8('0x3f')][_0x99f8('0x44')]({'where':{'uniqueid':_0x406250[_0x99f8('0x49')]['id']}})[_0x99f8('0x20')](handleEntityNotFound(_0x198089,null))[_0x99f8('0x20')](saveUpdates(_0x406250[_0x99f8('0x47')],null))['then'](respondWithResult(_0x198089,null))[_0x99f8('0x45')](handleError(_0x198089,null));};exports[_0x99f8('0x4a')]=function(_0x15dfa7,_0x46d5e5,_0x3b5302){return db[_0x99f8('0x3f')][_0x99f8('0x4b')]({'raw':![],'where':{'VoiceQueueId':_0x15dfa7[_0x99f8('0x49')]['id']},'attributes':[[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')](_0x99f8('0x4f')))),'noSuchContacts'],[db[_0x99f8('0x4c')]['fn']('COUNT',db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')](_0x99f8('0x50')))),_0x99f8('0x51')],[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')]['literal'](_0x99f8('0x52')))),_0x99f8('0x53')],[db['sequelize']['fn'](_0x99f8('0x4d'),db['sequelize']['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')](_0x99f8('0x54')))),_0x99f8('0x55')],[db['sequelize']['fn'](_0x99f8('0x4d'),db['sequelize']['fn']('IF',db['sequelize'][_0x99f8('0x4e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x99f8('0x56')],[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x99f8('0x57')],[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x99f8('0x58')]]})[_0x99f8('0x20')](handleEntityNotFound(_0x46d5e5,null))[_0x99f8('0x20')](respondWithResult(_0x46d5e5,null))[_0x99f8('0x45')](handleError(_0x46d5e5,null));};exports[_0x99f8('0x59')]=function(_0x275ed6,_0x4bf763,_0x1019c7){return db[_0x99f8('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x275ed6[_0x99f8('0x49')]['id']},'attributes':[[db[_0x99f8('0x4c')]['fn']('COUNT',db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')](_0x99f8('0x4f')))),_0x99f8('0x5a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x99f8('0x50')))),_0x99f8('0x51')],[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db['sequelize'][_0x99f8('0x4e')](_0x99f8('0x52')))),'busyContacts'],[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),_0x99f8('0x55')],[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')]['literal'](_0x99f8('0x5b')))),_0x99f8('0x56')],[db[_0x99f8('0x4c')]['fn'](_0x99f8('0x4d'),db[_0x99f8('0x4c')]['fn']('IF',db[_0x99f8('0x4c')][_0x99f8('0x4e')](_0x99f8('0x5c')))),_0x99f8('0x57')],[db[_0x99f8('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x99f8('0x58')]]})[_0x99f8('0x20')](handleEntityNotFound(_0x4bf763,null))['then'](respondWithResult(_0x4bf763,null))[_0x99f8('0x45')](handleError(_0x4bf763,null));};exports[_0x99f8('0x5d')]=function(_0x5591e3,_0x3c988c,_0x5ae315){return db[_0x99f8('0x5e')][_0x99f8('0x44')]({'where':{'id':_0x5591e3['params']['id']}})[_0x99f8('0x20')](handleEntityNotFound(_0x3c988c,null))[_0x99f8('0x20')](function(_0x499b37){var _0x24001f;if(_0x499b37){_0x24001f=squel[_0x99f8('0x5f')]()['into'](_0x99f8('0x60'))['fromQuery']([_0x99f8('0x61'),'scheduledAt',_0x99f8('0x62'),_0x99f8('0x63'),'VoiceQueueId','createdAt',_0x99f8('0x64')],squel[_0x99f8('0x65')]()[_0x99f8('0x3c')](_0x99f8('0x66'),_0x99f8('0x61'))[_0x99f8('0x3c')]('NOW()',_0x99f8('0x67'))['field'](_0x99f8('0x68'),_0x99f8('0x62'))[_0x99f8('0x3c')](_0x99f8('0x69'),_0x99f8('0x63'))[_0x99f8('0x3c')](_0x99f8('0x6a'),_0x99f8('0x6b'))[_0x99f8('0x3c')]('NOW()','createdAt')[_0x99f8('0x3c')](_0x99f8('0x6c'),_0x99f8('0x64'))[_0x99f8('0x6d')]('cm_hopper_final')['where'](_0x99f8('0x6e'),_0x5591e3[_0x99f8('0x49')]['id'][_0x99f8('0x6f')]())[_0x99f8('0x36')]('state\x20=\x20?',_0x5591e3['body'][_0x99f8('0x70')][_0x99f8('0x6f')]())[_0x99f8('0x36')](_0x99f8('0x71'))[_0x99f8('0x36')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x99f8('0x65')]()[_0x99f8('0x3c')](_0x99f8('0x61'))['from'](_0x99f8('0x60'))[_0x99f8('0x36')]('VoiceQueueId\x20=\x20?',_0x5591e3[_0x99f8('0x49')]['id'][_0x99f8('0x6f')]()))[_0x99f8('0x36')](_0x99f8('0x72'),squel[_0x99f8('0x65')]()[_0x99f8('0x3c')](_0x99f8('0x73'))[_0x99f8('0x6d')]('cm_hopper_final')[_0x99f8('0x36')](_0x99f8('0x6e'),_0x5591e3[_0x99f8('0x49')]['id'][_0x99f8('0x6f')]())[_0x99f8('0x36')](_0x99f8('0x74')))[_0x99f8('0x75')](_0x99f8('0x62')))[_0x99f8('0x6f')]();return db[_0x99f8('0x4c')][_0x99f8('0x26')](_0x24001f);}return[];})[_0x99f8('0x20')](respondWithResult(_0x3c988c,null))['catch'](handleError(_0x3c988c,null));};exports[_0x99f8('0x76')]=function(_0x107673,_0x6bf41c,_0x296ccb){return db['Campaign'][_0x99f8('0x44')]({'where':{'id':_0x107673[_0x99f8('0x49')]['id']}})['then'](handleEntityNotFound(_0x6bf41c,null))['then'](function(_0x46b208){var _0x1bc197;if(_0x46b208){_0x1bc197=squel[_0x99f8('0x5f')]()[_0x99f8('0x77')](_0x99f8('0x60'))['fromQuery']([_0x99f8('0x61'),_0x99f8('0x67'),_0x99f8('0x62'),_0x99f8('0x63'),_0x99f8('0x78'),'createdAt',_0x99f8('0x64')],squel[_0x99f8('0x65')]()['field'](_0x99f8('0x66'),'phone')[_0x99f8('0x3c')](_0x99f8('0x6c'),_0x99f8('0x67'))[_0x99f8('0x3c')](_0x99f8('0x68'),_0x99f8('0x62'))[_0x99f8('0x3c')](_0x99f8('0x69'),_0x99f8('0x63'))['field'](_0x99f8('0x79'),_0x99f8('0x78'))[_0x99f8('0x3c')](_0x99f8('0x6c'),'createdAt')['field']('NOW()',_0x99f8('0x64'))[_0x99f8('0x6d')]('cm_hopper_final')[_0x99f8('0x36')](_0x99f8('0x7a'),_0x107673['params']['id'][_0x99f8('0x6f')]())[_0x99f8('0x36')](_0x99f8('0x7b'),_0x107673[_0x99f8('0x47')][_0x99f8('0x70')]['toString']())[_0x99f8('0x36')](_0x99f8('0x71'))[_0x99f8('0x36')](_0x99f8('0x72'),squel['select']()['field'](_0x99f8('0x61'))[_0x99f8('0x6d')]('cm_hopper')[_0x99f8('0x36')](_0x99f8('0x7a'),_0x107673['params']['id'][_0x99f8('0x6f')]()))[_0x99f8('0x36')](_0x99f8('0x72'),squel[_0x99f8('0x65')]()[_0x99f8('0x3c')](_0x99f8('0x73'))[_0x99f8('0x6d')](_0x99f8('0x7c'))[_0x99f8('0x36')](_0x99f8('0x7a'),_0x107673[_0x99f8('0x49')]['id'][_0x99f8('0x6f')]())[_0x99f8('0x36')](_0x99f8('0x74')))[_0x99f8('0x75')](_0x99f8('0x62')))[_0x99f8('0x6f')]();return db[_0x99f8('0x4c')][_0x99f8('0x26')](_0x1bc197);}return[];})[_0x99f8('0x20')](respondWithResult(_0x6bf41c,null))[_0x99f8('0x45')](handleError(_0x6bf41c,null));};exports['checkContactHopper']=function(_0x329b93,_0xd9cd18,_0x33a9c8){return db[_0x99f8('0x7d')][_0x99f8('0x7e')]({'where':{'VoiceQueueId':_0x329b93['body'][_0x99f8('0x6b')],'CampaignId':_0x329b93[_0x99f8('0x47')][_0x99f8('0x78')],'ContactId':_0x329b93['body'][_0x99f8('0x62')]}})['then'](handleEntityNotFound(_0xd9cd18,null))[_0x99f8('0x20')](function(_0x2f2506){if(_0x2f2506){return _0x2f2506;}return null;})[_0x99f8('0x20')](respondWithResult(_0xd9cd18,null))[_0x99f8('0x45')](handleError(_0xd9cd18,null));};
\ No newline at end of file
+var _0x3cae=['state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','end','json','offset','limit','status','set','Content-Range','apply','then','sendStatus','error','stack','name','send','CmHopperFinal','rawAttributes','model','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','update','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','dropContacts','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','select','phone','ListId','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final'];(function(_0x5ac6cc,_0x2d124b){var _0x83dab7=function(_0x1effa9){while(--_0x1effa9){_0x5ac6cc['push'](_0x5ac6cc['shift']());}};_0x83dab7(++_0x2d124b);}(_0x3cae,0x117));var _0xe3ca=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x3cae[_0x1b828b];return _0x98da1a;};'use strict';var pdf=require(_0xe3ca('0x0'));var emlformat=require(_0xe3ca('0x1'));var rimraf=require(_0xe3ca('0x2'));var zipdir=require(_0xe3ca('0x3'));var jsonpatch=require(_0xe3ca('0x4'));var rp=require(_0xe3ca('0x5'));var moment=require(_0xe3ca('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xe3ca('0x7'));var util=require(_0xe3ca('0x8'));var path=require('path');var sox=require(_0xe3ca('0x9'));var csv=require('to-csv');var ejs=require(_0xe3ca('0xa'));var fs=require('fs');var _=require(_0xe3ca('0xb'));var squel=require(_0xe3ca('0xc'));var crypto=require('crypto');var jsforce=require(_0xe3ca('0xd'));var deskjs=require(_0xe3ca('0xe'));var toCsv=require(_0xe3ca('0xf'));var querystring=require(_0xe3ca('0x10'));var Papa=require(_0xe3ca('0x11'));var Redis=require(_0xe3ca('0x12'));var qs=require(_0xe3ca('0x13'));var logger=require('../../config/logger')(_0xe3ca('0x14'));var utils=require('../../config/utils');var config=require(_0xe3ca('0x15'));var db=require(_0xe3ca('0x16'))['db'];function respondWithStatusCode(_0x219866,_0x2ea64d){_0x2ea64d=_0x2ea64d||0xcc;return function(_0x74ebf){if(_0x74ebf){return _0x219866['sendStatus'](_0x2ea64d);}return _0x219866['status'](_0x2ea64d)[_0xe3ca('0x17')]();};}function respondWithResult(_0x5f1c02,_0x35b0f1){_0x35b0f1=_0x35b0f1||0xc8;return function(_0xb3af46){if(_0xb3af46){return _0x5f1c02['status'](_0x35b0f1)[_0xe3ca('0x18')](_0xb3af46);}};}function respondWithFilteredResult(_0x3a9455,_0x210c69){return function(_0x6a8907){if(_0x6a8907){var _0x9ef773=_0x6a8907['count'],_0x292251=_0x210c69['offset'],_0x884795=_0x210c69[_0xe3ca('0x19')]+_0x210c69[_0xe3ca('0x1a')],_0x337b6c;if(_0x884795>=_0x9ef773){_0x884795=_0x9ef773;_0x337b6c=0xc8;}else{_0x337b6c=0xce;}_0x3a9455[_0xe3ca('0x1b')](_0x337b6c);return _0x3a9455[_0xe3ca('0x1c')](_0xe3ca('0x1d'),_0x292251+'-'+_0x884795+'/'+_0x9ef773)[_0xe3ca('0x18')](_0x6a8907);}return null;};}function patchUpdates(_0x5bb8d8){return function(_0x2eafde){try{jsonpatch[_0xe3ca('0x1e')](_0x2eafde,_0x5bb8d8,!![]);}catch(_0x180699){return BPromise['reject'](_0x180699);}return _0x2eafde['save']();};}function saveUpdates(_0x47f3fb,_0x21c516){return function(_0x593fd1){if(_0x593fd1){return _0x593fd1['update'](_0x47f3fb)[_0xe3ca('0x1f')](function(_0x1822e4){return _0x1822e4;});}return null;};}function removeEntity(_0xcc7add,_0x149291){return function(_0x2e26aa){if(_0x2e26aa){return _0x2e26aa['destroy']()[_0xe3ca('0x1f')](function(){_0xcc7add[_0xe3ca('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f4740,_0x2d732f){return function(_0x33dc04){if(!_0x33dc04){_0x3f4740[_0xe3ca('0x20')](0x194);}return _0x33dc04;};}function handleError(_0xaf5191,_0x392bdb){_0x392bdb=_0x392bdb||0x1f4;return function(_0x2b571f){logger[_0xe3ca('0x21')](_0x2b571f[_0xe3ca('0x22')]);if(_0x2b571f[_0xe3ca('0x23')]){delete _0x2b571f[_0xe3ca('0x23')];}_0xaf5191['status'](_0x392bdb)[_0xe3ca('0x24')](_0x2b571f);};}exports['index']=function(_0x11ec88,_0x2fffe4){var _0x3de0ef={},_0x452096={},_0x576491={'count':0x0,'rows':[]};var _0x4c01c8=db[_0xe3ca('0x25')][_0xe3ca('0x26')];_0x452096[_0xe3ca('0x27')]=_['keys'](_0x4c01c8);var _0x1dbd98={'dateStart':_0x11ec88[_0xe3ca('0x28')][_0xe3ca('0x29')],'dateEnd':_0x11ec88[_0xe3ca('0x28')]['dateEnd']};delete _0x11ec88['query'][_0xe3ca('0x29')];delete _0x11ec88['query'][_0xe3ca('0x2a')];_0x452096['query']=_['keys'](_0x11ec88[_0xe3ca('0x28')]);_0x452096[_0xe3ca('0x2b')]=_[_0xe3ca('0x2c')](_0x452096[_0xe3ca('0x27')],_0x452096[_0xe3ca('0x28')]);_0x3de0ef['attributes']=_[_0xe3ca('0x2c')](_0x452096['model'],qs['fields'](_0x11ec88[_0xe3ca('0x28')][_0xe3ca('0x2d')]));_0x3de0ef[_0xe3ca('0x2e')]=_0x3de0ef[_0xe3ca('0x2e')][_0xe3ca('0x2f')]?_0x3de0ef[_0xe3ca('0x2e')]:_0x452096[_0xe3ca('0x27')];if(!_0x11ec88[_0xe3ca('0x28')][_0xe3ca('0x30')](_0xe3ca('0x31'))){_0x3de0ef[_0xe3ca('0x1a')]=qs[_0xe3ca('0x1a')](_0x11ec88['query'][_0xe3ca('0x1a')]);_0x3de0ef[_0xe3ca('0x19')]=qs[_0xe3ca('0x19')](_0x11ec88[_0xe3ca('0x28')][_0xe3ca('0x19')]);}_0x3de0ef[_0xe3ca('0x32')]=qs['sort'](_0x11ec88[_0xe3ca('0x28')][_0xe3ca('0x33')]);_0x3de0ef[_0xe3ca('0x34')]=qs[_0xe3ca('0x2b')](_[_0xe3ca('0x35')](_0x11ec88[_0xe3ca('0x28')],_0x452096[_0xe3ca('0x2b')]));if(_0x1dbd98[_0xe3ca('0x29')]){if(_0x1dbd98[_0xe3ca('0x2a')]){_0x1dbd98['dateEnd']=moment(_0x1dbd98[_0xe3ca('0x2a')])[_0xe3ca('0x36')](0x1,'day');}else{_0x1dbd98[_0xe3ca('0x2a')]=moment(_0x1dbd98[_0xe3ca('0x29')])[_0xe3ca('0x36')](0x1,'day');}_[_0xe3ca('0x37')](_0x3de0ef[_0xe3ca('0x34')],{'createdAt':{'$gte':_0x1dbd98['dateStart'],'$lte':_0x1dbd98[_0xe3ca('0x2a')]}});}if(_0x11ec88['query']['filter']){_0x3de0ef[_0xe3ca('0x34')]=_[_0xe3ca('0x37')](_0x3de0ef['where'],{'$or':_[_0xe3ca('0x38')](_0x4c01c8,function(_0x2037d8){if(_0x2037d8[_0xe3ca('0x39')][_0xe3ca('0x3a')]!==_0xe3ca('0x3b')){var _0x2f1dcb={};_0x2f1dcb[_0x2037d8[_0xe3ca('0x3c')]]={'$like':'%'+_0x11ec88[_0xe3ca('0x28')][_0xe3ca('0x3d')]+'%'};return _0x2f1dcb;}})});}_0x3de0ef=_['merge']({},_0x3de0ef,_0x11ec88[_0xe3ca('0x3e')]);var _0x13781d={'where':_0x3de0ef[_0xe3ca('0x34')]};return db[_0xe3ca('0x25')][_0xe3ca('0x3f')](_0x13781d)[_0xe3ca('0x1f')](function(_0x2a0290){_0x576491[_0xe3ca('0x3f')]=_0x2a0290;if(_0x11ec88[_0xe3ca('0x28')][_0xe3ca('0x40')]){_0x3de0ef[_0xe3ca('0x41')]=[{'all':!![]}];}return db[_0xe3ca('0x25')][_0xe3ca('0x42')](_0x3de0ef);})['then'](function(_0x275010){_0x576491[_0xe3ca('0x43')]=_0x275010;return _0x576491;})['then'](respondWithFilteredResult(_0x2fffe4,_0x3de0ef))[_0xe3ca('0x44')](handleError(_0x2fffe4,null));};exports[_0xe3ca('0x45')]=function(_0x8f004d,_0x4df55d){var _0x294797={'raw':!![],'where':{'id':_0x8f004d[_0xe3ca('0x46')]['id']}},_0x1c4706={};_0x1c4706[_0xe3ca('0x27')]=_[_0xe3ca('0x47')](db[_0xe3ca('0x25')][_0xe3ca('0x26')]);_0x1c4706['query']=_[_0xe3ca('0x47')](_0x8f004d[_0xe3ca('0x28')]);_0x1c4706['filters']=_['intersection'](_0x1c4706[_0xe3ca('0x27')],_0x1c4706[_0xe3ca('0x28')]);_0x294797['attributes']=_[_0xe3ca('0x2c')](_0x1c4706[_0xe3ca('0x27')],qs['fields'](_0x8f004d['query'][_0xe3ca('0x2d')]));_0x294797[_0xe3ca('0x2e')]=_0x294797[_0xe3ca('0x2e')][_0xe3ca('0x2f')]?_0x294797[_0xe3ca('0x2e')]:_0x1c4706['model'];if(_0x8f004d[_0xe3ca('0x28')][_0xe3ca('0x40')]){_0x294797[_0xe3ca('0x41')]=[{'all':!![]}];}_0x294797=_[_0xe3ca('0x37')]({},_0x294797,_0x8f004d[_0xe3ca('0x3e')]);return db[_0xe3ca('0x25')][_0xe3ca('0x48')](_0x294797)[_0xe3ca('0x1f')](handleEntityNotFound(_0x4df55d,null))[_0xe3ca('0x1f')](respondWithResult(_0x4df55d,null))['catch'](handleError(_0x4df55d,null));};exports['describe']=function(_0x539d5f,_0x542dfb){return db[_0xe3ca('0x25')][_0xe3ca('0x49')]()['then'](respondWithResult(_0x542dfb,null))['catch'](handleError(_0x542dfb,null));};exports[_0xe3ca('0x4a')]=function(_0x85e897,_0x468a60){if(_0x85e897['body']['uniqueid']){delete _0x85e897[_0xe3ca('0x4b')]['uniqueid'];}return db[_0xe3ca('0x25')][_0xe3ca('0x48')]({'where':{'uniqueid':_0x85e897[_0xe3ca('0x46')]['id']}})[_0xe3ca('0x1f')](handleEntityNotFound(_0x468a60,null))[_0xe3ca('0x1f')](saveUpdates(_0x85e897[_0xe3ca('0x4b')],null))[_0xe3ca('0x1f')](respondWithResult(_0x468a60,null))[_0xe3ca('0x44')](handleError(_0x468a60,null));};exports[_0xe3ca('0x4c')]=function(_0x7cf9dd,_0x187220,_0x51d29f){return db[_0xe3ca('0x25')][_0xe3ca('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x7cf9dd['params']['id']},'attributes':[[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db[_0xe3ca('0x4d')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xe3ca('0x4f')],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db['sequelize']['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')](_0xe3ca('0x51')))),'noAnswerContacts'],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')](_0xe3ca('0x52')))),_0xe3ca('0x53')],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db['sequelize']['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')](_0xe3ca('0x54')))),_0xe3ca('0x55')],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db['sequelize'][_0xe3ca('0x50')](_0xe3ca('0x56')))),'dropContacts'],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0xe3ca('0x50')](_0xe3ca('0x57')))),_0xe3ca('0x58')],[db['sequelize']['fn']('COUNT',db[_0xe3ca('0x4d')]['fn']('IF',db['sequelize'][_0xe3ca('0x50')](_0xe3ca('0x59')))),_0xe3ca('0x5a')]]})[_0xe3ca('0x1f')](handleEntityNotFound(_0x187220,null))[_0xe3ca('0x1f')](respondWithResult(_0x187220,null))[_0xe3ca('0x44')](handleError(_0x187220,null));};exports[_0xe3ca('0x5b')]=function(_0x44a898,_0x1c2856,_0x706d5a){return db['CmHopperFinal'][_0xe3ca('0x42')]({'raw':![],'where':{'CampaignId':_0x44a898[_0xe3ca('0x46')]['id']},'attributes':[[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db['sequelize'][_0xe3ca('0x50')](_0xe3ca('0x5c')))),_0xe3ca('0x4f')],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')](_0xe3ca('0x51')))),_0xe3ca('0x5d')],[db[_0xe3ca('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe3ca('0x4d')]['literal'](_0xe3ca('0x52')))),_0xe3ca('0x53')],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db['sequelize']['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')](_0xe3ca('0x56')))),_0xe3ca('0x5e')],[db['sequelize']['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0xe3ca('0x4d')]['fn'](_0xe3ca('0x4e'),db[_0xe3ca('0x4d')]['fn']('IF',db[_0xe3ca('0x4d')][_0xe3ca('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0xe3ca('0x5a')]]})[_0xe3ca('0x1f')](handleEntityNotFound(_0x1c2856,null))[_0xe3ca('0x1f')](respondWithResult(_0x1c2856,null))[_0xe3ca('0x44')](handleError(_0x1c2856,null));};exports[_0xe3ca('0x5f')]=function(_0x395b3b,_0x2fa297,_0x7c1f3a){return db['VoiceQueue'][_0xe3ca('0x48')]({'where':{'id':_0x395b3b[_0xe3ca('0x46')]['id']}})[_0xe3ca('0x1f')](handleEntityNotFound(_0x2fa297,null))[_0xe3ca('0x1f')](function(_0x3eb265){var _0x31aee4;if(_0x3eb265){_0x31aee4=squel['insert']()[_0xe3ca('0x60')](_0xe3ca('0x61'))[_0xe3ca('0x62')](['phone',_0xe3ca('0x63'),_0xe3ca('0x64'),'ListId',_0xe3ca('0x65'),_0xe3ca('0x66'),_0xe3ca('0x67')],squel[_0xe3ca('0x68')]()[_0xe3ca('0x3c')]('ANY_VALUE(calleridnum)',_0xe3ca('0x69'))[_0xe3ca('0x3c')]('NOW()',_0xe3ca('0x63'))[_0xe3ca('0x3c')]('ANY_VALUE(ContactId)',_0xe3ca('0x64'))[_0xe3ca('0x3c')]('ANY_VALUE(ListId)',_0xe3ca('0x6a'))[_0xe3ca('0x3c')](_0xe3ca('0x6b'),_0xe3ca('0x65'))[_0xe3ca('0x3c')](_0xe3ca('0x6c'),_0xe3ca('0x66'))['field']('NOW()',_0xe3ca('0x67'))[_0xe3ca('0x6d')](_0xe3ca('0x6e'))[_0xe3ca('0x34')]('VoiceQueueId\x20=\x20?',_0x395b3b[_0xe3ca('0x46')]['id']['toString']())[_0xe3ca('0x34')](_0xe3ca('0x6f'),_0x395b3b[_0xe3ca('0x4b')][_0xe3ca('0x70')][_0xe3ca('0x71')]())[_0xe3ca('0x34')](_0xe3ca('0x72'))[_0xe3ca('0x34')](_0xe3ca('0x73'),squel['select']()['field']('phone')[_0xe3ca('0x6d')]('cm_hopper')[_0xe3ca('0x34')]('VoiceQueueId\x20=\x20?',_0x395b3b[_0xe3ca('0x46')]['id']['toString']()))[_0xe3ca('0x34')](_0xe3ca('0x73'),squel[_0xe3ca('0x68')]()[_0xe3ca('0x3c')]('calleridnum')['from'](_0xe3ca('0x6e'))[_0xe3ca('0x34')](_0xe3ca('0x74'),_0x395b3b[_0xe3ca('0x46')]['id'][_0xe3ca('0x71')]())[_0xe3ca('0x34')](_0xe3ca('0x75')))[_0xe3ca('0x76')](_0xe3ca('0x64')))[_0xe3ca('0x71')]();return db['sequelize'][_0xe3ca('0x28')](_0x31aee4);}return[];})[_0xe3ca('0x1f')](respondWithResult(_0x2fa297,null))[_0xe3ca('0x44')](handleError(_0x2fa297,null));};exports[_0xe3ca('0x77')]=function(_0x7aad69,_0x5df0ab,_0x22685d){return db[_0xe3ca('0x78')][_0xe3ca('0x48')]({'where':{'id':_0x7aad69[_0xe3ca('0x46')]['id']}})[_0xe3ca('0x1f')](handleEntityNotFound(_0x5df0ab,null))['then'](function(_0x52ae61){var _0x102169;if(_0x52ae61){_0x102169=squel[_0xe3ca('0x79')]()[_0xe3ca('0x60')](_0xe3ca('0x61'))[_0xe3ca('0x62')](['phone',_0xe3ca('0x63'),_0xe3ca('0x64'),_0xe3ca('0x6a'),_0xe3ca('0x7a'),'createdAt',_0xe3ca('0x67')],squel[_0xe3ca('0x68')]()['field'](_0xe3ca('0x7b'),_0xe3ca('0x69'))[_0xe3ca('0x3c')](_0xe3ca('0x6c'),'scheduledAt')[_0xe3ca('0x3c')]('ANY_VALUE(ContactId)','ContactId')['field']('ANY_VALUE(ListId)','ListId')['field'](_0xe3ca('0x7c'),'CampaignId')[_0xe3ca('0x3c')](_0xe3ca('0x6c'),_0xe3ca('0x66'))[_0xe3ca('0x3c')](_0xe3ca('0x6c'),_0xe3ca('0x67'))[_0xe3ca('0x6d')](_0xe3ca('0x6e'))[_0xe3ca('0x34')]('CampaignId\x20=\x20?',_0x7aad69['params']['id'][_0xe3ca('0x71')]())[_0xe3ca('0x34')](_0xe3ca('0x6f'),_0x7aad69[_0xe3ca('0x4b')][_0xe3ca('0x70')][_0xe3ca('0x71')]())[_0xe3ca('0x34')](_0xe3ca('0x72'))[_0xe3ca('0x34')](_0xe3ca('0x73'),squel['select']()['field'](_0xe3ca('0x69'))[_0xe3ca('0x6d')](_0xe3ca('0x61'))[_0xe3ca('0x34')](_0xe3ca('0x7d'),_0x7aad69[_0xe3ca('0x46')]['id'][_0xe3ca('0x71')]()))['where'](_0xe3ca('0x73'),squel[_0xe3ca('0x68')]()['field'](_0xe3ca('0x7e'))[_0xe3ca('0x6d')](_0xe3ca('0x6e'))[_0xe3ca('0x34')](_0xe3ca('0x7d'),_0x7aad69['params']['id'][_0xe3ca('0x71')]())[_0xe3ca('0x34')]('state\x20=\x204'))[_0xe3ca('0x76')](_0xe3ca('0x64')))[_0xe3ca('0x71')]();return db['sequelize'][_0xe3ca('0x28')](_0x102169);}return[];})[_0xe3ca('0x1f')](respondWithResult(_0x5df0ab,null))[_0xe3ca('0x44')](handleError(_0x5df0ab,null));};exports[_0xe3ca('0x7f')]=function(_0xba752e,_0x4cbae5,_0x57fb60){return db[_0xe3ca('0x80')][_0xe3ca('0x81')]({'where':{'VoiceQueueId':_0xba752e[_0xe3ca('0x4b')][_0xe3ca('0x65')],'CampaignId':_0xba752e[_0xe3ca('0x4b')][_0xe3ca('0x7a')],'ContactId':_0xba752e[_0xe3ca('0x4b')]['ContactId']}})['then'](handleEntityNotFound(_0x4cbae5,null))['then'](function(_0x42bdba){if(_0x42bdba){return _0x42bdba;}return null;})[_0xe3ca('0x1f')](respondWithResult(_0x4cbae5,null))['catch'](handleError(_0x4cbae5,null));};
\ No newline at end of file
index 31e768c..400a868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['util','../../config/logger','moment','bluebird','request-promise','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x57ca,0x108));var _0xa57c=function(_0x202439,_0x586077){_0x202439=_0x202439-0x0;var _0x501291=_0x57ca[_0x202439];return _0x501291;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var attributes=require(_0xa57c('0x5'));module[_0xa57c('0x6')]=function(_0x48be2d,_0x40ba22){return _0x48be2d[_0xa57c('0x7')](_0xa57c('0x8'),attributes,{'tableName':_0xa57c('0x9'),'paranoid':![],'indexes':[{'name':_0xa57c('0xa'),'fields':[_0xa57c('0xa')]},{'name':_0xa57c('0xb'),'fields':[_0xa57c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x66fa=['cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','./cmHopperFinal.attributes','exports','CmHopperFinal'];(function(_0x4e453a,_0x1a4635){var _0x1c10e9=function(_0x21d9e7){while(--_0x21d9e7){_0x4e453a['push'](_0x4e453a['shift']());}};_0x1c10e9(++_0x1a4635);}(_0x66fa,0x117));var _0xa66f=function(_0x1122f1,_0x58eb65){_0x1122f1=_0x1122f1-0x0;var _0x4f6a92=_0x66fa[_0x1122f1];return _0x4f6a92;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var attributes=require(_0xa66f('0x6'));module[_0xa66f('0x7')]=function(_0x3f4904,_0x5ebea5){return _0x3f4904['define'](_0xa66f('0x8'),attributes,{'tableName':_0xa66f('0x9'),'paranoid':![],'indexes':[{'name':_0xa66f('0xa'),'fields':[_0xa66f('0xa')]},{'name':_0xa66f('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 84150e4..7b8675d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde2c=['raw','stringify','CreateCmHopperFinal','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CmHopperFinal','create','body','options'];(function(_0x68deb3,_0x26f914){var _0x5c5788=function(_0x462b2b){while(--_0x462b2b){_0x68deb3['push'](_0x68deb3['shift']());}};_0x5c5788(++_0x26f914);}(_0xde2c,0x7f));var _0xcde2=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0xde2c[_0x1269c6];return _0x4868c7;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('CmHopperFinal,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});}exports['CreateCmHopperFinal']=function(_0x4fd5aa){var _0x4fe586=this;return new Promise(function(_0x2b4468,_0x582e84){return db[_0xcde2('0x18')][_0xcde2('0x19')](_0x4fd5aa[_0xcde2('0x1a')],{'raw':_0x4fd5aa['options']?_0x4fd5aa[_0xcde2('0x1b')][_0xcde2('0x1c')]===undefined?!![]:![]:!![]})[_0xcde2('0xd')](function(_0x3c1d7e){logger[_0xcde2('0x15')]('CreateCmHopperFinal',_0x4fd5aa);logger['debug']('CreateCmHopperFinal',_0x4fd5aa,JSON[_0xcde2('0x1d')](_0x3c1d7e));_0x2b4468(_0x3c1d7e);})[_0xcde2('0x17')](function(_0x2c9562){logger[_0xcde2('0x12')](_0xcde2('0x1e'),_0x2c9562['message'],_0x4fd5aa);_0x582e84(_0x4fe586[_0xcde2('0x12')](0x1f4,_0x2c9562['message']));});});};
\ No newline at end of file
+var _0xa74f=['then','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateCmHopperFinal','CmHopperFinal','body','options','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xa74f,0x9a));var _0xfa74=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xa74f[_0x1b1a3b];return _0x385347;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}exports[_0xfa74('0x13')]=function(_0x51dda1){var _0x4928b6=this;return new Promise(function(_0x31d3c1,_0x25a36b){return db[_0xfa74('0x14')]['create'](_0x51dda1[_0xfa74('0x15')],{'raw':_0x51dda1[_0xfa74('0x16')]?_0x51dda1[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xfa74('0x7')](function(_0x302eb4){logger[_0xfa74('0x8')]('CreateCmHopperFinal',_0x51dda1);logger['debug'](_0xfa74('0x13'),_0x51dda1,JSON[_0xfa74('0xc')](_0x302eb4));_0x31d3c1(_0x302eb4);})[_0xfa74('0x12')](function(_0xeaaa19){logger[_0xfa74('0xd')]('CreateCmHopperFinal',_0xeaaa19['message'],_0x51dda1);_0x25a36b(_0x4928b6[_0xfa74('0xd')](0x1f4,_0xeaaa19['message']));});});};
\ No newline at end of file
index 622b368..0ffc5cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x8')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')]('/voice/queue/moveContacts/:id',auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x12')](_0x7995('0x14'),auth[_0x7995('0x9')](),controller[_0x7995('0x15')]);router[_0x7995('0x12')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x18')]);module[_0x7995('0x19')]=router;
\ No newline at end of file
+var _0x9957=['isAuthenticated','index','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x8')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')]('/voice/queue/moveContacts/:id',auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x12')](_0x7995('0x14'),auth[_0x7995('0x9')](),controller[_0x7995('0x15')]);router[_0x7995('0x12')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x18')]);module[_0x7995('0x19')]=router;
\ No newline at end of file
index 46cb33e..51cc196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86f4=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x19a11f,_0x5fe5f0){var _0x3fa6e7=function(_0x4c3411){while(--_0x4c3411){_0x19a11f['push'](_0x19a11f['shift']());}};_0x3fa6e7(++_0x5fe5f0);}(_0x86f4,0x18a));var _0x486f=function(_0x51dbc5,_0x15bdfa){_0x51dbc5=_0x51dbc5-0x0;var _0x269c75=_0x86f4[_0x51dbc5];return _0x269c75;};'use strict';var Sequelize=require(_0x486f('0x0'));module[_0x486f('0x1')]={'state':{'type':Sequelize[_0x486f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x486f('0x3')]},'scheduledat':{'type':Sequelize[_0x486f('0x4')]},'countbusyretry':{'type':Sequelize[_0x486f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x486f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x486f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x486f('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x486f('0x3')]},'calleridnum':{'type':Sequelize[_0x486f('0x3')]},'calleridname':{'type':Sequelize[_0x486f('0x3')]},'starttime':{'type':Sequelize[_0x486f('0x4')]},'responsetime':{'type':Sequelize[_0x486f('0x4')]},'answertime':{'type':Sequelize[_0x486f('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x486f('0x4')]},'ringtime':{'type':Sequelize[_0x486f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x486f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x486f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x486f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x486f('0x3')]},'campaign':{'type':Sequelize[_0x486f('0x3')]},'campaigntype':{'type':Sequelize[_0x486f('0x3')]},'membername':{'type':Sequelize[_0x486f('0x3')]},'reason':{'type':Sequelize[_0x486f('0x3')]},'amd':{'type':Sequelize[_0x486f('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x486f('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x486f('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x486f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x486f('0x4')]},'recallme':{'type':Sequelize[_0x486f('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x486f('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa23f=['DATE','INTEGER','STRING','BOOLEAN','sequelize','exports'];(function(_0x47b4d6,_0x13b0b3){var _0x317a04=function(_0x15549e){while(--_0x15549e){_0x47b4d6['push'](_0x47b4d6['shift']());}};_0x317a04(++_0x13b0b3);}(_0xa23f,0x7c));var _0xfa23=function(_0x470005,_0x334e2d){_0x470005=_0x470005-0x0;var _0x25a89c=_0xa23f[_0x470005];return _0x25a89c;};'use strict';var Sequelize=require(_0xfa23('0x0'));module[_0xfa23('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xfa23('0x2')]},'countbusyretry':{'type':Sequelize[_0xfa23('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfa23('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfa23('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfa23('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xfa23('0x4')]},'calleridnum':{'type':Sequelize[_0xfa23('0x4')]},'calleridname':{'type':Sequelize[_0xfa23('0x4')]},'starttime':{'type':Sequelize[_0xfa23('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfa23('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfa23('0x2')]},'ringtime':{'type':Sequelize[_0xfa23('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfa23('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfa23('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfa23('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xfa23('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xfa23('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xfa23('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xfa23('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfa23('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xfa23('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xfa23('0x2')]},'edited':{'type':Sequelize[_0xfa23('0x5')],'defaultValue':![]}};
\ No newline at end of file
index e6d75ef..83f151a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa349=['stack','name','send','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','sort','where','add','day','merge','filter','map','type','key','VIRTUAL','field','options','CmHopperHistory','include','findAll','rows','catch','show','params','includeAll','find','create','describe','body','uniqueid','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus'];(function(_0x2bbbed,_0x3ae5f5){var _0xedd48=function(_0x1e683f){while(--_0x1e683f){_0x2bbbed['push'](_0x2bbbed['shift']());}};_0xedd48(++_0x3ae5f5);}(_0xa349,0x72));var _0x9a34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa349[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9a34('0x0'));var emlformat=require(_0x9a34('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9a34('0x2'));var jsonpatch=require(_0x9a34('0x3'));var rp=require(_0x9a34('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9a34('0x5'));var sox=require(_0x9a34('0x6'));var csv=require('to-csv');var ejs=require(_0x9a34('0x7'));var fs=require('fs');var _=require(_0x9a34('0x8'));var squel=require(_0x9a34('0x9'));var crypto=require(_0x9a34('0xa'));var jsforce=require(_0x9a34('0xb'));var deskjs=require(_0x9a34('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9a34('0xd'));var Papa=require(_0x9a34('0xe'));var Redis=require(_0x9a34('0xf'));var qs=require(_0x9a34('0x10'));var logger=require('../../config/logger')(_0x9a34('0x11'));var utils=require(_0x9a34('0x12'));var config=require(_0x9a34('0x13'));var db=require(_0x9a34('0x14'))['db'];function respondWithStatusCode(_0x280262,_0x5bbb12){_0x5bbb12=_0x5bbb12||0xcc;return function(_0x1e133b){if(_0x1e133b){return _0x280262['sendStatus'](_0x5bbb12);}return _0x280262[_0x9a34('0x15')](_0x5bbb12)['end']();};}function respondWithResult(_0x5ce6a1,_0x11098f){_0x11098f=_0x11098f||0xc8;return function(_0x54b9f9){if(_0x54b9f9){return _0x5ce6a1['status'](_0x11098f)['json'](_0x54b9f9);}};}function respondWithFilteredResult(_0x4703d2,_0xb2d453){return function(_0x1354a7){if(_0x1354a7){var _0x6950bd=_0x1354a7[_0x9a34('0x16')],_0xe09525=_0xb2d453['offset'],_0x3f2e18=_0xb2d453[_0x9a34('0x17')]+_0xb2d453[_0x9a34('0x18')],_0x15cb52;if(_0x3f2e18>=_0x6950bd){_0x3f2e18=_0x6950bd;_0x15cb52=0xc8;}else{_0x15cb52=0xce;}_0x4703d2['status'](_0x15cb52);return _0x4703d2[_0x9a34('0x19')](_0x9a34('0x1a'),_0xe09525+'-'+_0x3f2e18+'/'+_0x6950bd)[_0x9a34('0x1b')](_0x1354a7);}return null;};}function patchUpdates(_0x598fbc){return function(_0x2f0762){try{jsonpatch[_0x9a34('0x1c')](_0x2f0762,_0x598fbc,!![]);}catch(_0x12703e){return BPromise[_0x9a34('0x1d')](_0x12703e);}return _0x2f0762[_0x9a34('0x1e')]();};}function saveUpdates(_0x544d7e,_0x17ccc7){return function(_0x4372d8){if(_0x4372d8){return _0x4372d8[_0x9a34('0x1f')](_0x544d7e)[_0x9a34('0x20')](function(_0x439d56){return _0x439d56;});}return null;};}function removeEntity(_0x4b7e5d,_0x340fdb){return function(_0x51a6b6){if(_0x51a6b6){return _0x51a6b6[_0x9a34('0x21')]()[_0x9a34('0x20')](function(){_0x4b7e5d[_0x9a34('0x15')](0xcc)[_0x9a34('0x22')]();});}};}function handleEntityNotFound(_0x289a11,_0x1598ca){return function(_0x28872b){if(!_0x28872b){_0x289a11[_0x9a34('0x23')](0x194);}return _0x28872b;};}function handleError(_0x2c095d,_0x14f22a){_0x14f22a=_0x14f22a||0x1f4;return function(_0x3a61d0){logger['error'](_0x3a61d0[_0x9a34('0x24')]);if(_0x3a61d0['name']){delete _0x3a61d0[_0x9a34('0x25')];}_0x2c095d[_0x9a34('0x15')](_0x14f22a)[_0x9a34('0x26')](_0x3a61d0);};}exports['index']=function(_0x4e6057,_0x296526){var _0x54eba1={},_0x3c8e4c={},_0x13ba21={'count':0x0,'rows':[]};var _0x550742=db['CmHopperHistory'][_0x9a34('0x27')];_0x3c8e4c[_0x9a34('0x28')]=_['keys'](_0x550742);var _0x492ed9={'dateStart':_0x4e6057[_0x9a34('0x29')][_0x9a34('0x2a')],'dateEnd':_0x4e6057[_0x9a34('0x29')][_0x9a34('0x2b')]};delete _0x4e6057['query']['dateStart'];delete _0x4e6057[_0x9a34('0x29')]['dateEnd'];_0x3c8e4c[_0x9a34('0x29')]=_[_0x9a34('0x2c')](_0x4e6057[_0x9a34('0x29')]);_0x3c8e4c[_0x9a34('0x2d')]=_[_0x9a34('0x2e')](_0x3c8e4c[_0x9a34('0x28')],_0x3c8e4c[_0x9a34('0x29')]);_0x54eba1[_0x9a34('0x2f')]=_[_0x9a34('0x2e')](_0x3c8e4c[_0x9a34('0x28')],qs[_0x9a34('0x30')](_0x4e6057[_0x9a34('0x29')][_0x9a34('0x30')]));_0x54eba1['attributes']=_0x54eba1[_0x9a34('0x2f')][_0x9a34('0x31')]?_0x54eba1['attributes']:_0x3c8e4c[_0x9a34('0x28')];if(!_0x4e6057['query']['hasOwnProperty']('nolimit')){_0x54eba1[_0x9a34('0x18')]=qs[_0x9a34('0x18')](_0x4e6057[_0x9a34('0x29')]['limit']);_0x54eba1['offset']=qs[_0x9a34('0x17')](_0x4e6057[_0x9a34('0x29')][_0x9a34('0x17')]);}_0x54eba1['order']=qs['sort'](_0x4e6057['query'][_0x9a34('0x32')]);_0x54eba1[_0x9a34('0x33')]=qs[_0x9a34('0x2d')](_['pick'](_0x4e6057['query'],_0x3c8e4c[_0x9a34('0x2d')]));if(_0x492ed9[_0x9a34('0x2a')]){if(_0x492ed9[_0x9a34('0x2b')]){_0x492ed9[_0x9a34('0x2b')]=moment(_0x492ed9[_0x9a34('0x2b')])[_0x9a34('0x34')](0x1,'day');}else{_0x492ed9[_0x9a34('0x2b')]=moment(_0x492ed9[_0x9a34('0x2a')])['add'](0x1,_0x9a34('0x35'));}_[_0x9a34('0x36')](_0x54eba1[_0x9a34('0x33')],{'createdAt':{'$gte':_0x492ed9[_0x9a34('0x2a')],'$lte':_0x492ed9[_0x9a34('0x2b')]}});}if(_0x4e6057[_0x9a34('0x29')][_0x9a34('0x37')]){_0x54eba1[_0x9a34('0x33')]=_[_0x9a34('0x36')](_0x54eba1[_0x9a34('0x33')],{'$or':_[_0x9a34('0x38')](_0x550742,function(_0x38462a){if(_0x38462a[_0x9a34('0x39')][_0x9a34('0x3a')]!==_0x9a34('0x3b')){var _0x107d4a={};_0x107d4a[_0x38462a[_0x9a34('0x3c')]]={'$like':'%'+_0x4e6057[_0x9a34('0x29')][_0x9a34('0x37')]+'%'};return _0x107d4a;}})});}_0x54eba1=_[_0x9a34('0x36')]({},_0x54eba1,_0x4e6057[_0x9a34('0x3d')]);var _0x5d7e45={'where':_0x54eba1[_0x9a34('0x33')]};return db[_0x9a34('0x3e')][_0x9a34('0x16')](_0x5d7e45)[_0x9a34('0x20')](function(_0x25df2a){_0x13ba21[_0x9a34('0x16')]=_0x25df2a;if(_0x4e6057[_0x9a34('0x29')]['includeAll']){_0x54eba1[_0x9a34('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9a34('0x40')](_0x54eba1);})['then'](function(_0x17abc0){_0x13ba21[_0x9a34('0x41')]=_0x17abc0;return _0x13ba21;})[_0x9a34('0x20')](respondWithFilteredResult(_0x296526,_0x54eba1))[_0x9a34('0x42')](handleError(_0x296526,null));};exports[_0x9a34('0x43')]=function(_0x435944,_0x323980){var _0x395f8f={'raw':!![],'where':{'id':_0x435944[_0x9a34('0x44')]['id']}},_0x3cb40f={};_0x3cb40f[_0x9a34('0x28')]=_[_0x9a34('0x2c')](db[_0x9a34('0x3e')][_0x9a34('0x27')]);_0x3cb40f[_0x9a34('0x29')]=_['keys'](_0x435944[_0x9a34('0x29')]);_0x3cb40f[_0x9a34('0x2d')]=_[_0x9a34('0x2e')](_0x3cb40f[_0x9a34('0x28')],_0x3cb40f[_0x9a34('0x29')]);_0x395f8f[_0x9a34('0x2f')]=_[_0x9a34('0x2e')](_0x3cb40f['model'],qs[_0x9a34('0x30')](_0x435944[_0x9a34('0x29')][_0x9a34('0x30')]));_0x395f8f[_0x9a34('0x2f')]=_0x395f8f['attributes'][_0x9a34('0x31')]?_0x395f8f[_0x9a34('0x2f')]:_0x3cb40f['model'];if(_0x435944['query'][_0x9a34('0x45')]){_0x395f8f[_0x9a34('0x3f')]=[{'all':!![]}];}_0x395f8f=_[_0x9a34('0x36')]({},_0x395f8f,_0x435944[_0x9a34('0x3d')]);return db[_0x9a34('0x3e')][_0x9a34('0x46')](_0x395f8f)[_0x9a34('0x20')](handleEntityNotFound(_0x323980,null))[_0x9a34('0x20')](respondWithResult(_0x323980,null))[_0x9a34('0x42')](handleError(_0x323980,null));};exports[_0x9a34('0x47')]=function(_0x2113e9,_0x21b1b4){return db[_0x9a34('0x3e')]['create'](_0x2113e9['body'],{})[_0x9a34('0x20')](respondWithResult(_0x21b1b4,0xc9))[_0x9a34('0x42')](handleError(_0x21b1b4,null));};exports[_0x9a34('0x48')]=function(_0x56c2cc,_0x50cc6e){return db['CmHopperHistory'][_0x9a34('0x48')]()[_0x9a34('0x20')](respondWithResult(_0x50cc6e,null))[_0x9a34('0x42')](handleError(_0x50cc6e,null));};exports[_0x9a34('0x1f')]=function(_0x21f38c,_0x34b56a){if(_0x21f38c[_0x9a34('0x49')]['uniqueid']){delete _0x21f38c[_0x9a34('0x49')][_0x9a34('0x4a')];}return db[_0x9a34('0x3e')][_0x9a34('0x46')]({'where':{'uniqueid':_0x21f38c['params']['id']}})[_0x9a34('0x20')](handleEntityNotFound(_0x34b56a,null))[_0x9a34('0x20')](saveUpdates(_0x21f38c['body'],null))[_0x9a34('0x20')](respondWithResult(_0x34b56a,null))[_0x9a34('0x42')](handleError(_0x34b56a,null));};
\ No newline at end of file
+var _0xdf11=['model','query','dateStart','dateEnd','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','add','day','merge','filter','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','create','body','describe','uniqueid','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory','rawAttributes'];(function(_0x413f87,_0x515089){var _0x35f540=function(_0xcc02f7){while(--_0xcc02f7){_0x413f87['push'](_0x413f87['shift']());}};_0x35f540(++_0x515089);}(_0xdf11,0xbb));var _0x1df1=function(_0x5dfe66,_0x4a0629){_0x5dfe66=_0x5dfe66-0x0;var _0x2bdeb1=_0xdf11[_0x5dfe66];return _0x2bdeb1;};'use strict';var pdf=require(_0x1df1('0x0'));var emlformat=require(_0x1df1('0x1'));var rimraf=require(_0x1df1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1df1('0x3'));var rp=require(_0x1df1('0x4'));var moment=require(_0x1df1('0x5'));var BPromise=require(_0x1df1('0x6'));var Mustache=require(_0x1df1('0x7'));var util=require(_0x1df1('0x8'));var path=require(_0x1df1('0x9'));var sox=require(_0x1df1('0xa'));var csv=require(_0x1df1('0xb'));var ejs=require(_0x1df1('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1df1('0xd'));var crypto=require(_0x1df1('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1df1('0xb'));var querystring=require(_0x1df1('0xf'));var Papa=require(_0x1df1('0x10'));var Redis=require(_0x1df1('0x11'));var qs=require(_0x1df1('0x12'));var logger=require(_0x1df1('0x13'))(_0x1df1('0x14'));var utils=require(_0x1df1('0x15'));var config=require('../../config/environment');var db=require(_0x1df1('0x16'))['db'];function respondWithStatusCode(_0x1c5415,_0x4042d9){_0x4042d9=_0x4042d9||0xcc;return function(_0x53e593){if(_0x53e593){return _0x1c5415[_0x1df1('0x17')](_0x4042d9);}return _0x1c5415[_0x1df1('0x18')](_0x4042d9)[_0x1df1('0x19')]();};}function respondWithResult(_0x29b148,_0x2b0ee6){_0x2b0ee6=_0x2b0ee6||0xc8;return function(_0x28a393){if(_0x28a393){return _0x29b148[_0x1df1('0x18')](_0x2b0ee6)[_0x1df1('0x1a')](_0x28a393);}};}function respondWithFilteredResult(_0x1f1eca,_0x116afd){return function(_0x1a8ffe){if(_0x1a8ffe){var _0x53b9a0=_0x1a8ffe[_0x1df1('0x1b')],_0x4a536e=_0x116afd['offset'],_0x140e06=_0x116afd[_0x1df1('0x1c')]+_0x116afd[_0x1df1('0x1d')],_0x184043;if(_0x140e06>=_0x53b9a0){_0x140e06=_0x53b9a0;_0x184043=0xc8;}else{_0x184043=0xce;}_0x1f1eca[_0x1df1('0x18')](_0x184043);return _0x1f1eca['set'](_0x1df1('0x1e'),_0x4a536e+'-'+_0x140e06+'/'+_0x53b9a0)[_0x1df1('0x1a')](_0x1a8ffe);}return null;};}function patchUpdates(_0x24fbb6){return function(_0x3e06cd){try{jsonpatch[_0x1df1('0x1f')](_0x3e06cd,_0x24fbb6,!![]);}catch(_0x5244ca){return BPromise[_0x1df1('0x20')](_0x5244ca);}return _0x3e06cd[_0x1df1('0x21')]();};}function saveUpdates(_0x275a5c,_0x36cc40){return function(_0x3611cd){if(_0x3611cd){return _0x3611cd[_0x1df1('0x22')](_0x275a5c)[_0x1df1('0x23')](function(_0x1b9a2f){return _0x1b9a2f;});}return null;};}function removeEntity(_0x41a4fc,_0x29b542){return function(_0x2b6674){if(_0x2b6674){return _0x2b6674[_0x1df1('0x24')]()[_0x1df1('0x23')](function(){_0x41a4fc[_0x1df1('0x18')](0xcc)[_0x1df1('0x19')]();});}};}function handleEntityNotFound(_0x3cb858,_0x4abd55){return function(_0x293584){if(!_0x293584){_0x3cb858[_0x1df1('0x17')](0x194);}return _0x293584;};}function handleError(_0x16822f,_0x267c0f){_0x267c0f=_0x267c0f||0x1f4;return function(_0x27b6e9){logger[_0x1df1('0x25')](_0x27b6e9[_0x1df1('0x26')]);if(_0x27b6e9[_0x1df1('0x27')]){delete _0x27b6e9[_0x1df1('0x27')];}_0x16822f[_0x1df1('0x18')](_0x267c0f)[_0x1df1('0x28')](_0x27b6e9);};}exports[_0x1df1('0x29')]=function(_0x37808e,_0x7d3da9){var _0x470766={},_0x5dda57={},_0x5be54a={'count':0x0,'rows':[]};var _0x4428a3=db[_0x1df1('0x2a')][_0x1df1('0x2b')];_0x5dda57[_0x1df1('0x2c')]=_['keys'](_0x4428a3);var _0x2b7b2c={'dateStart':_0x37808e[_0x1df1('0x2d')][_0x1df1('0x2e')],'dateEnd':_0x37808e[_0x1df1('0x2d')][_0x1df1('0x2f')]};delete _0x37808e[_0x1df1('0x2d')]['dateStart'];delete _0x37808e['query']['dateEnd'];_0x5dda57[_0x1df1('0x2d')]=_[_0x1df1('0x30')](_0x37808e[_0x1df1('0x2d')]);_0x5dda57[_0x1df1('0x31')]=_['intersection'](_0x5dda57[_0x1df1('0x2c')],_0x5dda57['query']);_0x470766[_0x1df1('0x32')]=_[_0x1df1('0x33')](_0x5dda57[_0x1df1('0x2c')],qs[_0x1df1('0x34')](_0x37808e['query'][_0x1df1('0x34')]));_0x470766[_0x1df1('0x32')]=_0x470766[_0x1df1('0x32')][_0x1df1('0x35')]?_0x470766[_0x1df1('0x32')]:_0x5dda57[_0x1df1('0x2c')];if(!_0x37808e[_0x1df1('0x2d')][_0x1df1('0x36')]('nolimit')){_0x470766[_0x1df1('0x1d')]=qs['limit'](_0x37808e['query'][_0x1df1('0x1d')]);_0x470766['offset']=qs['offset'](_0x37808e[_0x1df1('0x2d')]['offset']);}_0x470766[_0x1df1('0x37')]=qs['sort'](_0x37808e[_0x1df1('0x2d')]['sort']);_0x470766[_0x1df1('0x38')]=qs[_0x1df1('0x31')](_['pick'](_0x37808e[_0x1df1('0x2d')],_0x5dda57[_0x1df1('0x31')]));if(_0x2b7b2c[_0x1df1('0x2e')]){if(_0x2b7b2c[_0x1df1('0x2f')]){_0x2b7b2c[_0x1df1('0x2f')]=moment(_0x2b7b2c['dateEnd'])[_0x1df1('0x39')](0x1,_0x1df1('0x3a'));}else{_0x2b7b2c[_0x1df1('0x2f')]=moment(_0x2b7b2c[_0x1df1('0x2e')])['add'](0x1,_0x1df1('0x3a'));}_[_0x1df1('0x3b')](_0x470766[_0x1df1('0x38')],{'createdAt':{'$gte':_0x2b7b2c[_0x1df1('0x2e')],'$lte':_0x2b7b2c[_0x1df1('0x2f')]}});}if(_0x37808e[_0x1df1('0x2d')][_0x1df1('0x3c')]){_0x470766['where']=_['merge'](_0x470766[_0x1df1('0x38')],{'$or':_['map'](_0x4428a3,function(_0x2c1c60){if(_0x2c1c60[_0x1df1('0x3d')][_0x1df1('0x3e')]!==_0x1df1('0x3f')){var _0x215552={};_0x215552[_0x2c1c60[_0x1df1('0x40')]]={'$like':'%'+_0x37808e[_0x1df1('0x2d')][_0x1df1('0x3c')]+'%'};return _0x215552;}})});}_0x470766=_['merge']({},_0x470766,_0x37808e['options']);var _0x36ad20={'where':_0x470766[_0x1df1('0x38')]};return db[_0x1df1('0x2a')][_0x1df1('0x1b')](_0x36ad20)[_0x1df1('0x23')](function(_0x5b0f92){_0x5be54a['count']=_0x5b0f92;if(_0x37808e[_0x1df1('0x2d')][_0x1df1('0x41')]){_0x470766[_0x1df1('0x42')]=[{'all':!![]}];}return db[_0x1df1('0x2a')][_0x1df1('0x43')](_0x470766);})['then'](function(_0xb54ccf){_0x5be54a[_0x1df1('0x44')]=_0xb54ccf;return _0x5be54a;})[_0x1df1('0x23')](respondWithFilteredResult(_0x7d3da9,_0x470766))[_0x1df1('0x45')](handleError(_0x7d3da9,null));};exports[_0x1df1('0x46')]=function(_0x34d24f,_0x5b9aab){var _0x3a925b={'raw':!![],'where':{'id':_0x34d24f[_0x1df1('0x47')]['id']}},_0x74f410={};_0x74f410[_0x1df1('0x2c')]=_[_0x1df1('0x30')](db['CmHopperHistory'][_0x1df1('0x2b')]);_0x74f410[_0x1df1('0x2d')]=_[_0x1df1('0x30')](_0x34d24f[_0x1df1('0x2d')]);_0x74f410[_0x1df1('0x31')]=_['intersection'](_0x74f410['model'],_0x74f410[_0x1df1('0x2d')]);_0x3a925b['attributes']=_[_0x1df1('0x33')](_0x74f410['model'],qs[_0x1df1('0x34')](_0x34d24f[_0x1df1('0x2d')][_0x1df1('0x34')]));_0x3a925b['attributes']=_0x3a925b[_0x1df1('0x32')][_0x1df1('0x35')]?_0x3a925b['attributes']:_0x74f410[_0x1df1('0x2c')];if(_0x34d24f[_0x1df1('0x2d')][_0x1df1('0x41')]){_0x3a925b[_0x1df1('0x42')]=[{'all':!![]}];}_0x3a925b=_[_0x1df1('0x3b')]({},_0x3a925b,_0x34d24f[_0x1df1('0x48')]);return db[_0x1df1('0x2a')]['find'](_0x3a925b)['then'](handleEntityNotFound(_0x5b9aab,null))[_0x1df1('0x23')](respondWithResult(_0x5b9aab,null))[_0x1df1('0x45')](handleError(_0x5b9aab,null));};exports[_0x1df1('0x49')]=function(_0x1a3ec7,_0x46bff0){return db['CmHopperHistory'][_0x1df1('0x49')](_0x1a3ec7[_0x1df1('0x4a')],{})['then'](respondWithResult(_0x46bff0,0xc9))[_0x1df1('0x45')](handleError(_0x46bff0,null));};exports[_0x1df1('0x4b')]=function(_0x717b0e,_0x4a7f8e){return db[_0x1df1('0x2a')][_0x1df1('0x4b')]()['then'](respondWithResult(_0x4a7f8e,null))[_0x1df1('0x45')](handleError(_0x4a7f8e,null));};exports['update']=function(_0x2ffafa,_0x46560a){if(_0x2ffafa[_0x1df1('0x4a')][_0x1df1('0x4c')]){delete _0x2ffafa['body']['uniqueid'];}return db[_0x1df1('0x2a')]['find']({'where':{'uniqueid':_0x2ffafa[_0x1df1('0x47')]['id']}})[_0x1df1('0x23')](handleEntityNotFound(_0x46560a,null))[_0x1df1('0x23')](saveUpdates(_0x2ffafa['body'],null))[_0x1df1('0x23')](respondWithResult(_0x46560a,null))[_0x1df1('0x45')](handleError(_0x46560a,null));};
\ No newline at end of file
index 56431c7..3ec3049 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4190=['uniqueid','lodash','util','moment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0x4190,0x83));var _0x0419=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0x4190[_0xe5b349];return _0x26b0ad;};'use strict';var _=require(_0x0419('0x0'));var util=require(_0x0419('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0419('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x0419('0x3'));module[_0x0419('0x4')]=function(_0x46a47f,_0x723d2e){return _0x46a47f[_0x0419('0x5')](_0x0419('0x6'),attributes,{'tableName':_0x0419('0x7'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0419('0x8')]},{'name':_0x0419('0x9'),'fields':[_0x0419('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xef47=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','endtime','uniqueid','util','../../config/logger','bluebird','request-promise'];(function(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0xef47,0x132));var _0x7ef4=function(_0x3084d2,_0x4a89af){_0x3084d2=_0x3084d2-0x0;var _0x531127=_0xef47[_0x3084d2];return _0x531127;};'use strict';var _=require('lodash');var util=require(_0x7ef4('0x0'));var logger=require(_0x7ef4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7ef4('0x2'));var rp=require(_0x7ef4('0x3'));var attributes=require(_0x7ef4('0x4'));module[_0x7ef4('0x5')]=function(_0x2e4b8f,_0x35e962){return _0x2e4b8f[_0x7ef4('0x6')](_0x7ef4('0x7'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x7ef4('0x8'),'fields':[_0x7ef4('0x8')]},{'name':_0x7ef4('0x9'),'fields':[_0x7ef4('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 894e805..867c435 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe356=['request','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','stringify','catch','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','name','ivrTotalCallsDays','ivrAnswerCallsDay','then','GetCampaignHopperHistory','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3c0348,_0x2e277a){var _0x2a8f9a=function(_0xe5861f){while(--_0xe5861f){_0x3c0348['push'](_0x3c0348['shift']());}};_0x2a8f9a(++_0x2e277a);}(_0xe356,0x1ee));var _0x6e35=function(_0x2e4843,_0x1901b3){_0x2e4843=_0x2e4843-0x0;var _0x42c269=_0xe356[_0x2e4843];return _0x42c269;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var moment=require(_0x6e35('0x2'));var BPromise=require(_0x6e35('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e35('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e35('0x5'));var logger=require(_0x6e35('0x6'))(_0x6e35('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e35('0x8'));var client=jayson[_0x6e35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x389ae2,_0xba948e,_0x114b4c){return new BPromise(function(_0x1da99b,_0x5119fa){return client[_0x6e35('0xa')](_0x389ae2,_0x114b4c)['then'](function(_0x3b3c16){logger['info'](_0x6e35('0xb'),_0xba948e,'request\x20sent');logger['debug'](_0x6e35('0xc'),_0xba948e,_0x6e35('0xd'),JSON['stringify'](_0x3b3c16));if(_0x3b3c16['error']){if(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0xf')]===0x1f4){logger[_0x6e35('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0xba948e,_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);return _0x5119fa(_0x3b3c16[_0x6e35('0xe')]['message']);}logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3b3c16[_0x6e35('0xe')]['message']);return _0x1da99b(_0x3b3c16[_0x6e35('0xe')][_0x6e35('0x10')]);}else{logger[_0x6e35('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0xba948e,_0x6e35('0xd'));_0x1da99b(_0x3b3c16[_0x6e35('0x12')][_0x6e35('0x10')]);}})['catch'](function(_0x3e7e7a){logger[_0x6e35('0xe')](_0x6e35('0xb'),_0xba948e,_0x3e7e7a);_0x5119fa(_0x3e7e7a);});});}exports[_0x6e35('0x13')]=function(_0x58a622){var _0x408504=this;return new Promise(function(_0x2bd771,_0x53e26d){return db[_0x6e35('0x14')][_0x6e35('0x15')](_0x58a622[_0x6e35('0x16')],{'raw':_0x58a622[_0x6e35('0x17')]?_0x58a622[_0x6e35('0x17')][_0x6e35('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x35f44){logger[_0x6e35('0x11')](_0x6e35('0x13'),_0x58a622);logger[_0x6e35('0x19')](_0x6e35('0x13'),_0x58a622,JSON[_0x6e35('0x1a')](_0x35f44));_0x2bd771(_0x35f44);})[_0x6e35('0x1b')](function(_0xa9044f){logger[_0x6e35('0xe')]('CreateCmHopperHistory',_0xa9044f[_0x6e35('0x10')],_0x58a622);_0x53e26d(_0x408504['error'](0x1f4,_0xa9044f['message']));});});};exports[_0x6e35('0x1c')]=function(_0x529510){var _0x7b3d0b=this;return new Promise(function(_0x47f4d9,_0x36a0aa){return db[_0x6e35('0x14')][_0x6e35('0x1d')]({'raw':_0x529510[_0x6e35('0x17')]?_0x529510[_0x6e35('0x17')][_0x6e35('0x18')]===undefined?!![]:![]:!![],'where':_0x529510[_0x6e35('0x17')]?_0x529510[_0x6e35('0x17')][_0x6e35('0x1e')]||null:null,'attributes':[[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')][_0x6e35('0x20')]('id')),_0x6e35('0x21')],[db['sequelize']['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db['sequelize'][_0x6e35('0x22')](_0x6e35('0x24')))),_0x6e35('0x25')],[db['sequelize']['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x6e35('0x26')],[db['sequelize']['fn'](_0x6e35('0x27'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x28')))),_0x6e35('0x29')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x27'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x2a')))),_0x6e35('0x2b')]]})['then'](function(_0x4a7440){logger[_0x6e35('0x11')]('AvgHandleTime',_0x529510);logger[_0x6e35('0x19')](_0x6e35('0x1c'),_0x529510,JSON['stringify'](_0x4a7440));_0x47f4d9(_0x4a7440);})[_0x6e35('0x1b')](function(_0x42b8a7){logger[_0x6e35('0xe')]('AvgHandleTime',_0x42b8a7[_0x6e35('0x10')],_0x529510);_0x36a0aa(_0x7b3d0b[_0x6e35('0xe')](0x1f4,_0x42b8a7[_0x6e35('0x10')]));});});};exports[_0x6e35('0x2c')]=function(_0x2206f1){var _0x243efe=this;return new Promise(function(_0x4e1a2f,_0x401196){return db[_0x6e35('0x14')][_0x6e35('0x1d')]({'raw':_0x2206f1[_0x6e35('0x17')]?_0x2206f1['options'][_0x6e35('0x18')]===undefined?!![]:![]:!![],'where':_0x2206f1['options']?_0x2206f1['options'][_0x6e35('0x1e')]||null:null,'attributes':[[_0x6e35('0x2d'),'name'],[db['sequelize']['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x6e35('0x2e')],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x6e35('0x2f')],[db['sequelize']['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x30')))),_0x6e35('0x31')],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db['sequelize'][_0x6e35('0x22')](_0x6e35('0x32')))),_0x6e35('0x33')],[db['sequelize']['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x34')))),_0x6e35('0x35')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x6e35('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6e35('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x38')))),_0x6e35('0x39')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x3a')))),_0x6e35('0x3b')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x3c')))),_0x6e35('0x3d')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')]['literal'](_0x6e35('0x3e')))),'outboundRejectCallsDay'],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x3f')))),_0x6e35('0x40')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x6e35('0x41')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db[_0x6e35('0x1f')]['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')](_0x6e35('0x42')))),'outboundReCallsDay']],'group':[_0x6e35('0x2d')]})['then'](function(_0x36594f){logger[_0x6e35('0x11')](_0x6e35('0x2c'),_0x2206f1);logger['debug']('GetVoiceQueueHopperHistory',_0x2206f1,JSON[_0x6e35('0x1a')](_0x36594f));_0x4e1a2f(_0x36594f);})[_0x6e35('0x1b')](function(_0x3b52e0){logger[_0x6e35('0xe')]('GetVoiceQueueHopperHistory',_0x3b52e0['message'],_0x2206f1);_0x401196(_0x243efe[_0x6e35('0xe')](0x1f4,_0x3b52e0['message']));});});};exports['GetCampaignHopperHistory']=function(_0x171ecd){var _0x55ee8f=this;return new Promise(function(_0x339672,_0x644eb0){return db[_0x6e35('0x14')][_0x6e35('0x1d')]({'raw':_0x171ecd[_0x6e35('0x17')]?_0x171ecd[_0x6e35('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x171ecd[_0x6e35('0x17')]?_0x171ecd[_0x6e35('0x17')]['where']||null:null,'attributes':[['campaign',_0x6e35('0x43')],[db[_0x6e35('0x1f')]['fn']('COUNT',db[_0x6e35('0x1f')]['col']('id')),_0x6e35('0x44')],[db[_0x6e35('0x1f')]['fn'](_0x6e35('0x23'),db['sequelize']['fn']('IF',db[_0x6e35('0x1f')][_0x6e35('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0x6e35('0x45')]],'group':['campaign']})[_0x6e35('0x46')](function(_0x2d499e){logger[_0x6e35('0x11')](_0x6e35('0x47'),_0x171ecd);logger['debug']('GetCampaignHopperHistory',_0x171ecd,JSON[_0x6e35('0x1a')](_0x2d499e));_0x339672(_0x2d499e);})[_0x6e35('0x1b')](function(_0x17dca4){logger[_0x6e35('0xe')]('GetCampaignHopperHistory',_0x17dca4[_0x6e35('0x10')],_0x171ecd);_0x644eb0(_0x55ee8f[_0x6e35('0xe')](0x1f4,_0x17dca4['message']));});});};
\ No newline at end of file
+var _0x8979=['`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x8979,0x16e));var _0x9897=function(_0x23570a,_0x23f77a){_0x23570a=_0x23570a-0x0;var _0x694730=_0x8979[_0x23570a];return _0x694730;};'use strict';var _=require(_0x9897('0x0'));var util=require(_0x9897('0x1'));var moment=require(_0x9897('0x2'));var BPromise=require('bluebird');var rs=require(_0x9897('0x3'));var fs=require('fs');var Redis=require(_0x9897('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9897('0x5'))('rpc');var config=require(_0x9897('0x6'));var jayson=require(_0x9897('0x7'));var client=jayson['client'][_0x9897('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22b116,_0x59c3bf,_0x379277){return new BPromise(function(_0x37813e,_0x436798){return client[_0x9897('0x9')](_0x22b116,_0x379277)[_0x9897('0xa')](function(_0x33efe3){logger[_0x9897('0xb')](_0x9897('0xc'),_0x59c3bf,_0x9897('0xd'));logger[_0x9897('0xe')](_0x9897('0xf'),_0x59c3bf,_0x9897('0xd'),JSON[_0x9897('0x10')](_0x33efe3));if(_0x33efe3[_0x9897('0x11')]){if(_0x33efe3['error'][_0x9897('0x12')]===0x1f4){logger[_0x9897('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x59c3bf,_0x33efe3['error'][_0x9897('0x13')]);return _0x436798(_0x33efe3[_0x9897('0x11')][_0x9897('0x13')]);}logger[_0x9897('0x11')](_0x9897('0xc'),_0x59c3bf,_0x33efe3[_0x9897('0x11')]['message']);return _0x37813e(_0x33efe3[_0x9897('0x11')]['message']);}else{logger[_0x9897('0xb')](_0x9897('0xc'),_0x59c3bf,_0x9897('0xd'));_0x37813e(_0x33efe3[_0x9897('0x14')][_0x9897('0x13')]);}})[_0x9897('0x15')](function(_0x304a42){logger[_0x9897('0x11')](_0x9897('0xc'),_0x59c3bf,_0x304a42);_0x436798(_0x304a42);});});}exports[_0x9897('0x16')]=function(_0x5ece6c){var _0x2fcc6b=this;return new Promise(function(_0x3c50f8,_0x15b2fc){return db[_0x9897('0x17')][_0x9897('0x18')](_0x5ece6c[_0x9897('0x19')],{'raw':_0x5ece6c[_0x9897('0x1a')]?_0x5ece6c['options'][_0x9897('0x1b')]===undefined?!![]:![]:!![]})[_0x9897('0xa')](function(_0x2f78dd){logger[_0x9897('0xb')](_0x9897('0x16'),_0x5ece6c);logger[_0x9897('0xe')](_0x9897('0x16'),_0x5ece6c,JSON[_0x9897('0x10')](_0x2f78dd));_0x3c50f8(_0x2f78dd);})[_0x9897('0x15')](function(_0x49bfce){logger[_0x9897('0x11')](_0x9897('0x16'),_0x49bfce['message'],_0x5ece6c);_0x15b2fc(_0x2fcc6b[_0x9897('0x11')](0x1f4,_0x49bfce[_0x9897('0x13')]));});});};exports[_0x9897('0x1c')]=function(_0x5821fd){var _0x6b35cf=this;return new Promise(function(_0x2d17ba,_0x2ad25a){return db['CmHopperHistory'][_0x9897('0x1d')]({'raw':_0x5821fd[_0x9897('0x1a')]?_0x5821fd[_0x9897('0x1a')][_0x9897('0x1b')]===undefined?!![]:![]:!![],'where':_0x5821fd[_0x9897('0x1a')]?_0x5821fd[_0x9897('0x1a')][_0x9897('0x1e')]||null:null,'attributes':[[db[_0x9897('0x1f')]['fn']('COUNT',db[_0x9897('0x1f')][_0x9897('0x20')]('id')),_0x9897('0x21')],[db['sequelize']['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db['sequelize'][_0x9897('0x23')](_0x9897('0x24')))),_0x9897('0x25')],[db['sequelize']['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x26')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db['sequelize'][_0x9897('0x23')](_0x9897('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x9897('0x1f')]['fn']('AVG',db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0x9897('0x28'),db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')]['literal'](_0x9897('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x9897('0xa')](function(_0x2e9c85){logger['info'](_0x9897('0x1c'),_0x5821fd);logger[_0x9897('0xe')](_0x9897('0x1c'),_0x5821fd,JSON[_0x9897('0x10')](_0x2e9c85));_0x2d17ba(_0x2e9c85);})[_0x9897('0x15')](function(_0x5c4154){logger[_0x9897('0x11')](_0x9897('0x1c'),_0x5c4154[_0x9897('0x13')],_0x5821fd);_0x2ad25a(_0x6b35cf[_0x9897('0x11')](0x1f4,_0x5c4154['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4c1747){var _0x4a1ab4=this;return new Promise(function(_0x458350,_0x36494b){return db[_0x9897('0x17')][_0x9897('0x1d')]({'raw':_0x4c1747[_0x9897('0x1a')]?_0x4c1747[_0x9897('0x1a')][_0x9897('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c1747[_0x9897('0x1a')]?_0x4c1747['options'][_0x9897('0x1e')]||null:null,'attributes':[[_0x9897('0x2a'),_0x9897('0x2b')],[db['sequelize']['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db['sequelize'][_0x9897('0x23')](_0x9897('0x2c')))),_0x9897('0x2d')],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')]('`state`\x20=\x203,\x201,\x20null'))),_0x9897('0x2e')],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x24')))),_0x9897('0x2f')],[db[_0x9897('0x1f')]['fn']('COUNT',db[_0x9897('0x1f')]['fn']('IF',db['sequelize'][_0x9897('0x23')](_0x9897('0x30')))),_0x9897('0x31')],[db[_0x9897('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x32')))),_0x9897('0x33')],[db['sequelize']['fn'](_0x9897('0x22'),db['sequelize']['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x9897('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x9897('0x23')](_0x9897('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x36')))),_0x9897('0x37')],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x9897('0x23')](_0x9897('0x38')))),_0x9897('0x39')],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db['sequelize'][_0x9897('0x23')](_0x9897('0x3a')))),_0x9897('0x3b')],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db['sequelize']['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x3c')))),_0x9897('0x3d')],[db[_0x9897('0x1f')]['fn']('COUNT',db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),_0x9897('0x3e')],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x3f')))),_0x9897('0x3d')],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db[_0x9897('0x1f')][_0x9897('0x23')](_0x9897('0x40')))),_0x9897('0x41')]],'group':[_0x9897('0x2a')]})[_0x9897('0xa')](function(_0x3a59e1){logger[_0x9897('0xb')](_0x9897('0x42'),_0x4c1747);logger['debug'](_0x9897('0x42'),_0x4c1747,JSON[_0x9897('0x10')](_0x3a59e1));_0x458350(_0x3a59e1);})[_0x9897('0x15')](function(_0x15f3be){logger[_0x9897('0x11')](_0x9897('0x42'),_0x15f3be['message'],_0x4c1747);_0x36494b(_0x4a1ab4[_0x9897('0x11')](0x1f4,_0x15f3be[_0x9897('0x13')]));});});};exports[_0x9897('0x43')]=function(_0xa4b15c){var _0xffcd3f=this;return new Promise(function(_0x38c0a0,_0x4c7d15){return db['CmHopperHistory'][_0x9897('0x1d')]({'raw':_0xa4b15c[_0x9897('0x1a')]?_0xa4b15c[_0x9897('0x1a')][_0x9897('0x1b')]===undefined?!![]:![]:!![],'where':_0xa4b15c[_0x9897('0x1a')]?_0xa4b15c[_0x9897('0x1a')][_0x9897('0x1e')]||null:null,'attributes':[[_0x9897('0x2a'),_0x9897('0x2b')],[db['sequelize']['fn'](_0x9897('0x22'),db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db[_0x9897('0x1f')]['fn'](_0x9897('0x22'),db[_0x9897('0x1f')]['fn']('IF',db['sequelize'][_0x9897('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x9897('0x44')]],'group':[_0x9897('0x2a')]})[_0x9897('0xa')](function(_0x73f4bc){logger[_0x9897('0xb')](_0x9897('0x43'),_0xa4b15c);logger[_0x9897('0xe')](_0x9897('0x43'),_0xa4b15c,JSON['stringify'](_0x73f4bc));_0x38c0a0(_0x73f4bc);})['catch'](function(_0x1cc798){logger[_0x9897('0x11')](_0x9897('0x43'),_0x1cc798['message'],_0xa4b15c);_0x4c7d15(_0xffcd3f[_0x9897('0x11')](0x1f4,_0x1cc798[_0x9897('0x13')]));});});};
\ No newline at end of file
index 31670f9..bbe5b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8819=['create','put','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/:id','post'];(function(_0x95a41,_0x1c72ff){var _0x2ccd48=function(_0x7cc6df){while(--_0x7cc6df){_0x95a41['push'](_0x95a41['shift']());}};_0x2ccd48(++_0x1c72ff);}(_0x8819,0x94));var _0x9881=function(_0x42cf1c,_0xd8d597){_0x42cf1c=_0x42cf1c-0x0;var _0xcd94=_0x8819[_0x42cf1c];return _0xcd94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9881('0x0'));var timeout=require(_0x9881('0x1'));var express=require(_0x9881('0x2'));var router=express[_0x9881('0x3')]();var auth=require(_0x9881('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9881('0x5'));var controller=require(_0x9881('0x6'));router[_0x9881('0x7')]('/',auth[_0x9881('0x8')](),controller[_0x9881('0x9')]);router[_0x9881('0x7')]('/describe',auth[_0x9881('0x8')](),controller['describe']);router['get'](_0x9881('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9881('0xb')]('/',auth['isAuthenticated'](),controller[_0x9881('0xc')]);router[_0x9881('0xd')](_0x9881('0xa'),auth['isAuthenticated'](),controller[_0x9881('0xe')]);module[_0x9881('0xf')]=router;
\ No newline at end of file
+var _0x88d5=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','put','update','exports','multer'];(function(_0x46273d,_0x9de4f1){var _0x36df4a=function(_0x40df71){while(--_0x40df71){_0x46273d['push'](_0x46273d['shift']());}};_0x36df4a(++_0x9de4f1);}(_0x88d5,0x76));var _0x588d=function(_0x22dfb9,_0x2e231c){_0x22dfb9=_0x22dfb9-0x0;var _0x51cbb1=_0x88d5[_0x22dfb9];return _0x51cbb1;};'use strict';var multer=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var path=require(_0x588d('0x2'));var timeout=require(_0x588d('0x3'));var express=require(_0x588d('0x4'));var router=express['Router']();var auth=require(_0x588d('0x5'));var interaction=require(_0x588d('0x6'));var config=require('../../config/environment');var controller=require(_0x588d('0x7'));router[_0x588d('0x8')]('/',auth[_0x588d('0x9')](),controller[_0x588d('0xa')]);router[_0x588d('0x8')](_0x588d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x588d('0x8')](_0x588d('0xc'),auth[_0x588d('0x9')](),controller[_0x588d('0xd')]);router['post']('/',auth[_0x588d('0x9')](),controller['create']);router[_0x588d('0xe')](_0x588d('0xc'),auth['isAuthenticated'](),controller[_0x588d('0xf')]);module[_0x588d('0x10')]=router;
\ No newline at end of file
index df00bcf..3a1f855 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['sequelize','exports','name','STRING'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_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'],'unique':_0xd46e('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd46e('0x3')]},'dialPrefix':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0xe14b=['sequelize','exports','STRING'];(function(_0x1dbbb7,_0x248c19){var _0x156075=function(_0x5ee23f){while(--_0x5ee23f){_0x1dbbb7['push'](_0x1dbbb7['shift']());}};_0x156075(++_0x248c19);}(_0xe14b,0x93));var _0xbe14=function(_0x28e256,_0x4bac13){_0x28e256=_0x28e256-0x0;var _0xe080b9=_0xe14b[_0x28e256];return _0xe080b9;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe14('0x2')]},'dialPrefix':{'type':Sequelize[_0xbe14('0x2')]}};
\ No newline at end of file
index 9d82b1e..8c4eb48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','day','add','merge','where','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','findOne','nolimit','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var qs=require(_0x0a9e('0xf'));var logger=require(_0x0a9e('0x10'))(_0x0a9e('0x11'));var utils=require(_0x0a9e('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x14'),'port':0x18eb});var socket=require(_0x0a9e('0x15'))(new Redis(config[_0x0a9e('0x13')]));require(_0x0a9e('0x16'))[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xcc;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x18')](_0x4283ce);}return _0x5db4b0[_0x0a9e('0x19')](_0x4283ce)[_0x0a9e('0x1a')]();};}function respondWithResult(_0x4d5611,_0x52a03d){_0x52a03d=_0x52a03d||0xc8;return function(_0x22dccb){if(_0x22dccb){return _0x4d5611['status'](_0x52a03d)[_0x0a9e('0x1b')](_0x22dccb);}};}function respondWithFilteredResult(_0x519dfd,_0x16033c){return function(_0x12066b){if(_0x12066b){var _0x48f32d=_0x12066b[_0x0a9e('0x1c')],_0x225616=_0x16033c[_0x0a9e('0x1d')],_0x5a0a06=_0x16033c[_0x0a9e('0x1d')]+_0x16033c[_0x0a9e('0x1e')],_0x459eb1;if(_0x5a0a06>=_0x48f32d){_0x5a0a06=_0x48f32d;_0x459eb1=0xc8;}else{_0x459eb1=0xce;}_0x519dfd[_0x0a9e('0x19')](_0x459eb1);return _0x519dfd[_0x0a9e('0x1f')](_0x0a9e('0x20'),_0x225616+'-'+_0x5a0a06+'/'+_0x48f32d)[_0x0a9e('0x1b')](_0x12066b);}return null;};}function patchUpdates(_0x112016){return function(_0x1c696a){try{jsonpatch[_0x0a9e('0x21')](_0x1c696a,_0x112016,!![]);}catch(_0x4bb1e3){return BPromise[_0x0a9e('0x22')](_0x4bb1e3);}return _0x1c696a[_0x0a9e('0x23')]();};}function saveUpdates(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['update'](_0x53682f)[_0x0a9e('0x24')](function(_0x432e56){return _0x432e56;});}return null;};}function removeEntity(_0x38e7c4,_0x30bae6){return function(_0x4abc77){if(_0x4abc77){return _0x4abc77[_0x0a9e('0x25')]()[_0x0a9e('0x24')](function(){var _0x3b45bc=_0x4abc77[_0x0a9e('0x26')]({'plain':!![]});var _0x370d86=_0x0a9e('0x27');return db[_0x0a9e('0x28')]['destroy']({'where':{'type':_0x370d86,'resourceId':_0x3b45bc['id']}})['then'](function(){return _0x4abc77;});})[_0x0a9e('0x24')](function(){_0x38e7c4[_0x0a9e('0x19')](0xcc)[_0x0a9e('0x1a')]();});}};}function handleEntityNotFound(_0x33161b,_0x526cf3){return function(_0x384319){if(!_0x384319){_0x33161b['sendStatus'](0x194);}return _0x384319;};}function handleError(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0x1f4;return function(_0x1dc186){logger[_0x0a9e('0x29')](_0x1dc186[_0x0a9e('0x2a')]);if(_0x1dc186[_0x0a9e('0x2b')]){delete _0x1dc186[_0x0a9e('0x2b')];}_0x45a1e7[_0x0a9e('0x19')](_0x5bfb33)[_0x0a9e('0x2c')](_0x1dc186);};}exports[_0x0a9e('0x2d')]=function(_0x5a101a,_0x3652a7){var _0x468813={},_0x2b1f27={},_0x2ec755={'count':0x0,'rows':[]};var _0x5c877d=db[_0x0a9e('0x2e')][_0x0a9e('0x2f')];_0x2b1f27[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x5c877d);var _0x58b06f={'dateStart':_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x33')],'dateEnd':_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x34')]};delete _0x5a101a['query'][_0x0a9e('0x33')];delete _0x5a101a['query'][_0x0a9e('0x34')];_0x2b1f27[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x5a101a[_0x0a9e('0x32')]);_0x2b1f27[_0x0a9e('0x35')]=_['intersection'](_0x2b1f27[_0x0a9e('0x30')],_0x2b1f27[_0x0a9e('0x32')]);_0x468813[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x2b1f27[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x468813['attributes']=_0x468813[_0x0a9e('0x36')]['length']?_0x468813[_0x0a9e('0x36')]:_0x2b1f27[_0x0a9e('0x30')];if(!_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x39')]('nolimit')){_0x468813[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x468813['offset']=qs['offset'](_0x5a101a[_0x0a9e('0x32')]['offset']);}_0x468813[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x3b')]);_0x468813['where']=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x5a101a[_0x0a9e('0x32')],_0x2b1f27['filters']));if(_0x58b06f[_0x0a9e('0x33')]){if(_0x58b06f[_0x0a9e('0x34')]){_0x58b06f[_0x0a9e('0x34')]=moment(_0x58b06f['dateEnd'])['add'](0x1,_0x0a9e('0x3d'));}else{_0x58b06f[_0x0a9e('0x34')]=moment(_0x58b06f['dateStart'])[_0x0a9e('0x3e')](0x1,_0x0a9e('0x3d'));}_[_0x0a9e('0x3f')](_0x468813[_0x0a9e('0x40')],{'createdAt':{'$gte':_0x58b06f['dateStart'],'$lte':_0x58b06f['dateEnd']}});}if(_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x41')]){_0x468813['where']=_[_0x0a9e('0x3f')](_0x468813[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x5c877d,function(_0x5b4f5e){if(_0x5b4f5e[_0x0a9e('0x43')][_0x0a9e('0x44')]!==_0x0a9e('0x45')){var _0x43dd5b={};_0x43dd5b[_0x5b4f5e[_0x0a9e('0x46')]]={'$like':'%'+_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x43dd5b;}})});}_0x468813=_[_0x0a9e('0x3f')]({},_0x468813,_0x5a101a[_0x0a9e('0x47')]);var _0x3da2cd={'where':_0x468813[_0x0a9e('0x40')]};return db[_0x0a9e('0x2e')][_0x0a9e('0x1c')](_0x3da2cd)[_0x0a9e('0x24')](function(_0x37f6cc){_0x2ec755['count']=_0x37f6cc;if(_0x5a101a['query'][_0x0a9e('0x48')]){_0x468813[_0x0a9e('0x49')]=[{'all':!![]}];}return db[_0x0a9e('0x2e')][_0x0a9e('0x4a')](_0x468813);})[_0x0a9e('0x24')](function(_0xc9a702){_0x2ec755[_0x0a9e('0x4b')]=_0xc9a702;return _0x2ec755;})[_0x0a9e('0x24')](respondWithFilteredResult(_0x3652a7,_0x468813))[_0x0a9e('0x4c')](handleError(_0x3652a7,null));};exports[_0x0a9e('0x4d')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={'raw':![],'where':{'id':_0x2c2cb0[_0x0a9e('0x4e')]['id']}},_0x117c99={};_0x117c99[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2e')][_0x0a9e('0x2f')]);_0x117c99[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x2c2cb0['query']);_0x117c99[_0x0a9e('0x35')]=_['intersection'](_0x117c99[_0x0a9e('0x30')],_0x117c99[_0x0a9e('0x32')]);_0x5026aa[_0x0a9e('0x36')]=_['intersection'](_0x117c99[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x2c2cb0[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x5026aa[_0x0a9e('0x36')]=_0x5026aa[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x5026aa['attributes']:_0x117c99[_0x0a9e('0x30')];if(_0x2c2cb0[_0x0a9e('0x32')][_0x0a9e('0x48')]){_0x5026aa[_0x0a9e('0x49')]=[{'all':!![]}];}_0x5026aa=_[_0x0a9e('0x3f')]({},_0x5026aa,_0x2c2cb0[_0x0a9e('0x47')]);return db[_0x0a9e('0x2e')][_0x0a9e('0x50')](_0x5026aa)[_0x0a9e('0x24')](handleEntityNotFound(_0x35ed4a,null))['then'](respondWithResult(_0x35ed4a,null))[_0x0a9e('0x4c')](handleError(_0x35ed4a,null));};exports[_0x0a9e('0x51')]=function(_0x4f7240,_0x4ae14b){return db['CmList'][_0x0a9e('0x51')](_0x4f7240[_0x0a9e('0x52')],{})[_0x0a9e('0x24')](function(_0x11545a){var _0x61bb17=_0x4f7240[_0x0a9e('0x53')][_0x0a9e('0x26')]({'plain':!![]});if(!_0x61bb17)throw new Error(_0x0a9e('0x54'));if(_0x61bb17['role']==='user'){var _0x53975a=_0x11545a[_0x0a9e('0x26')]({'plain':!![]});var _0x204173=_0x0a9e('0x27');return db['UserProfileSection'][_0x0a9e('0x50')]({'where':{'name':_0x204173,'userProfileId':_0x61bb17[_0x0a9e('0x55')]},'raw':!![]})['then'](function(_0x5a88da){if(_0x5a88da&&_0x5a88da[_0x0a9e('0x56')]===0x0){return db['UserProfileResource'][_0x0a9e('0x51')]({'name':_0x53975a['name'],'resourceId':_0x53975a['id'],'type':_0x5a88da[_0x0a9e('0x2b')],'sectionId':_0x5a88da['id']},{})[_0x0a9e('0x24')](function(){return _0x11545a;});}else{return _0x11545a;}})[_0x0a9e('0x4c')](function(_0x53613a){logger[_0x0a9e('0x29')](_0x0a9e('0x57'),_0x53613a);throw _0x53613a;});}return _0x11545a;})['then'](respondWithResult(_0x4ae14b,0xc9))['catch'](handleError(_0x4ae14b,null));};exports[_0x0a9e('0x58')]=function(_0x3aedd0,_0x49c095){if(_0x3aedd0[_0x0a9e('0x52')]['id']){delete _0x3aedd0['body']['id'];}return db[_0x0a9e('0x2e')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))['then'](saveUpdates(_0x3aedd0['body'],null))[_0x0a9e('0x24')](respondWithResult(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports[_0x0a9e('0x25')]=function(_0x65432,_0x3cfd00){return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x65432[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x3cfd00,null))[_0x0a9e('0x24')](removeEntity(_0x3cfd00,null))['catch'](handleError(_0x3cfd00,null));};exports[_0x0a9e('0x59')]=function(_0x121cef,_0x2642bb){return db[_0x0a9e('0x2e')][_0x0a9e('0x59')]()[_0x0a9e('0x24')](respondWithResult(_0x2642bb,null))['catch'](handleError(_0x2642bb,null));};exports[_0x0a9e('0x5a')]=function(_0x26bc80,_0x5239ef,_0x3649cc){if(_0x26bc80['body']['id']){delete _0x26bc80[_0x0a9e('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x26bc80['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x5239ef,null))['then'](function(_0x2244d6){if(_0x2244d6){_0x26bc80[_0x0a9e('0x52')][_0x0a9e('0x5b')]=_0x2244d6['id'];return db[_0x0a9e('0x5c')][_0x0a9e('0x51')](_0x26bc80[_0x0a9e('0x52')]);}})['then'](respondWithResult(_0x5239ef,null))[_0x0a9e('0x4c')](handleError(_0x5239ef,null));};exports['getDispositions']=function(_0xca4ade,_0x1f07cb,_0x51aaf7){var _0x5adf8f={'raw':![],'where':{}};var _0x453360={};var _0x156f1c={'count':0x0,'rows':[]};return db[_0x0a9e('0x2e')][_0x0a9e('0x5d')]({'where':{'id':_0xca4ade['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1f07cb,null))[_0x0a9e('0x24')](function(_0x54327c){if(_0x54327c){_0x453360[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x5c')][_0x0a9e('0x2f')]);_0x453360[_0x0a9e('0x32')]=_['keys'](_0xca4ade[_0x0a9e('0x32')]);_0x453360[_0x0a9e('0x35')]=_[_0x0a9e('0x37')](_0x453360['model'],_0x453360[_0x0a9e('0x32')]);_0x5adf8f['attributes']=_['intersection'](_0x453360[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x5adf8f[_0x0a9e('0x36')]=_0x5adf8f[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x5adf8f[_0x0a9e('0x36')]:_0x453360[_0x0a9e('0x30')];if(!_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x5adf8f[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x5adf8f[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xca4ade['query'][_0x0a9e('0x1d')]);}_0x5adf8f[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0xca4ade['query'][_0x0a9e('0x3b')]);_0x5adf8f[_0x0a9e('0x40')]=qs['filters'](_[_0x0a9e('0x3c')](_0xca4ade[_0x0a9e('0x32')],_0x453360[_0x0a9e('0x35')]));_0x5adf8f[_0x0a9e('0x40')][_0x0a9e('0x5b')]=_0x54327c['id'];if(_0xca4ade['query']['filter']){_0x5adf8f['where']=_[_0x0a9e('0x3f')](_0x5adf8f[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x5adf8f[_0x0a9e('0x36')],function(_0x6abd03){var _0x380ab3={};_0x380ab3[_0x6abd03]={'$like':'%'+_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x380ab3;})});}_0x5adf8f=_['merge']({},_0x5adf8f,_0xca4ade[_0x0a9e('0x47')]);return db[_0x0a9e('0x5c')][_0x0a9e('0x1c')]({'where':_0x5adf8f['where']})[_0x0a9e('0x24')](function(_0x583b2e){_0x156f1c[_0x0a9e('0x1c')]=_0x583b2e;if(_0xca4ade[_0x0a9e('0x32')]['includeAll']){_0x5adf8f[_0x0a9e('0x49')]=[{'all':!![]}];}return db[_0x0a9e('0x5c')][_0x0a9e('0x4a')](_0x5adf8f);})[_0x0a9e('0x24')](function(_0x542ece){_0x156f1c[_0x0a9e('0x4b')]=_0x542ece;return _0x156f1c;});}})[_0x0a9e('0x24')](respondWithFilteredResult(_0x1f07cb,_0x5adf8f))[_0x0a9e('0x4c')](handleError(_0x1f07cb,null));};exports[_0x0a9e('0x5f')]=function(_0x5b7fc3,_0x109ccb,_0x3d91db){var _0x2d5506;return db[_0x0a9e('0x2e')]['find']({'where':{'id':_0x5b7fc3[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x109ccb,null))[_0x0a9e('0x24')](function(_0xf410e5){if(_0xf410e5){return _0xf410e5[_0x0a9e('0x5f')](_0x5b7fc3[_0x0a9e('0x32')][_0x0a9e('0x60')]);}})[_0x0a9e('0x24')](respondWithStatusCode(_0x109ccb,null))[_0x0a9e('0x4c')](handleError(_0x109ccb,null));};exports[_0x0a9e('0x61')]=function(_0xc4c230,_0x1f10ef,_0x25744a){return db[_0x0a9e('0x2e')]['find']({'where':{'id':_0xc4c230[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1f10ef,null))[_0x0a9e('0x24')](function(_0x563627){if(_0x563627){var _0x3736e0=[];var _0x33dda0={'success':[],'errors':[]};return db[_0x0a9e('0x62')][_0x0a9e('0x59')]()['then'](function(_0x541e80){if(_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]&&_['isArray'](_0xc4c230[_0x0a9e('0x52')]['tags'])){if(_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]['length']){_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]=_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')][_0x0a9e('0x64')](';')+';';}else{_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]=null;}}else{_0xc4c230['body'][_0x0a9e('0x63')]=null;}if(_0xc4c230[_0x0a9e('0x52')]&&_[_0x0a9e('0x65')](_0xc4c230[_0x0a9e('0x52')])){for(var _0x492543=0x0;_0x492543<_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x4f')];_0x492543+=0x1){_0xc4c230['body'][_0x492543][_0x0a9e('0x5b')]=_0xc4c230['params']['id'];_0x3736e0[_0x0a9e('0x66')](_0xc4c230[_0x0a9e('0x52')][_0x492543]);}return BPromise[_0x0a9e('0x67')](_0x3736e0,function(_0x385d52){return db['CmContact']['create'](_[_0x0a9e('0x68')](_0x385d52,[_0x0a9e('0x60'),'id'])||{},{'fields':_[_0x0a9e('0x31')](_0x541e80),'raw':!![]})['then'](function(_0x3b4a9f){_0x33dda0[_0x0a9e('0x69')]['push'](_0x3b4a9f['dataValues']);})[_0x0a9e('0x4c')](function(_0x56acca){_0x33dda0['errors']['push']({'data':_0x385d52,'error':_0x56acca[_0x0a9e('0x6a')]});});})[_0x0a9e('0x24')](function(_0x9044fe){return _0x33dda0;})[_0x0a9e('0x4c')](function(_0x3c6dd6){return _0x3c6dd6;});}else{_0x1f10ef[_0x0a9e('0x19')](0x190)['json']({'message':_0x0a9e('0x6b')});}});}})['then'](respondWithResult(_0x1f10ef,null))[_0x0a9e('0x4c')](handleError(_0x1f10ef,null));};exports[_0x0a9e('0x6c')]=function(_0x18ad56,_0x4566b0,_0x50f8d7){var _0x46c9ac;return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x18ad56['params']['id']},'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x6e')}]})[_0x0a9e('0x24')](handleEntityNotFound(_0x4566b0,null))[_0x0a9e('0x24')](function(_0x255e49){if(_0x255e49){_0x46c9ac=_0x255e49;return db[_0x0a9e('0x62')][_0x0a9e('0x2f')];}})[_0x0a9e('0x24')](function(_0x509efe){if(_0x509efe){var _0x2645d6={};var _0x3325c5={};_0x3325c5['model']=_[_0x0a9e('0x6f')](_[_0x0a9e('0x31')](_0x509efe),_[_0x0a9e('0x42')](_0x46c9ac['CustomFields'],function(_0x96672f){return util['format'](_0x0a9e('0x70'),_0x96672f['id']);}));_0x3325c5[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x18ad56[_0x0a9e('0x32')]);_0x3325c5[_0x0a9e('0x35')]=_[_0x0a9e('0x37')](_0x3325c5[_0x0a9e('0x30')],_0x3325c5[_0x0a9e('0x32')]);_0x2645d6['attributes']=_[_0x0a9e('0x37')](_0x3325c5[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x2645d6[_0x0a9e('0x36')]=_0x2645d6[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x2645d6[_0x0a9e('0x36')]:_0x3325c5[_0x0a9e('0x30')];if(!_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x2645d6['limit']=qs[_0x0a9e('0x1e')](_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x2645d6[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x18ad56['query'][_0x0a9e('0x1d')]);}_0x2645d6[_0x0a9e('0x3a')]=qs['sort'](_0x18ad56[_0x0a9e('0x32')]['sort']);_0x2645d6[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x18ad56[_0x0a9e('0x32')],_0x3325c5['filters']));_0x2645d6[_0x0a9e('0x71')]=!![];if(_0x18ad56['query'][_0x0a9e('0x41')]){_0x2645d6[_0x0a9e('0x40')]=_['merge'](_0x2645d6[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x2645d6[_0x0a9e('0x36')],function(_0x4ab276){var _0x4c788f={};_0x4c788f[_0x4ab276]={'$like':'%'+_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x4c788f;})});}_0x2645d6=_[_0x0a9e('0x3f')]({},_0x2645d6,_0x18ad56[_0x0a9e('0x47')]);return _0x46c9ac[_0x0a9e('0x6c')](_0x2645d6);}})[_0x0a9e('0x24')](respondWithResult(_0x4566b0,null))[_0x0a9e('0x4c')](handleError(_0x4566b0,null));};exports[_0x0a9e('0x72')]=function(_0x3f8124,_0x586510,_0x3156c7){var _0x517081;return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x3f8124[_0x0a9e('0x4e')]['id']},'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x6e')}]})['then'](handleEntityNotFound(_0x586510,null))[_0x0a9e('0x24')](function(_0x4667bf){if(_0x4667bf){_0x517081=_0x4667bf;return db[_0x0a9e('0x62')][_0x0a9e('0x2f')];}})[_0x0a9e('0x24')](function(_0x5c66ef){if(_0x5c66ef){var _0x4f074c={};var _0x22a3cb={};_0x22a3cb['model']=_[_0x0a9e('0x6f')](_[_0x0a9e('0x31')](_0x5c66ef),_[_0x0a9e('0x42')](_0x517081[_0x0a9e('0x6e')],function(_0x2ad54b){return util[_0x0a9e('0x73')]('cf_%d',_0x2ad54b['id']);}));_0x22a3cb['query']=_[_0x0a9e('0x31')](_0x3f8124['query']);_0x22a3cb[_0x0a9e('0x35')]=_['intersection'](_0x22a3cb[_0x0a9e('0x30')],_0x22a3cb['query']);_0x4f074c['attributes']=_[_0x0a9e('0x37')](_0x22a3cb[_0x0a9e('0x30')],qs['fields'](_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x4f074c[_0x0a9e('0x36')]=_0x4f074c[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x4f074c['attributes']:_0x22a3cb['model'];if(!_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x4f074c[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x3f8124['query'][_0x0a9e('0x1e')]);_0x4f074c[_0x0a9e('0x1d')]=qs['offset'](_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x1d')]);}_0x4f074c[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x3b')]);_0x4f074c[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x3f8124[_0x0a9e('0x32')],_0x22a3cb['filters']));_0x4f074c[_0x0a9e('0x71')]=!![];if(_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x41')]){_0x4f074c[_0x0a9e('0x40')]=_[_0x0a9e('0x3f')](_0x4f074c['where'],{'$or':_['map'](_0x4f074c[_0x0a9e('0x36')],function(_0x16ae1a){var _0x466bbf={};_0x466bbf[_0x16ae1a]={'$like':'%'+_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x466bbf;})});}_0x4f074c=_['merge']({},_0x4f074c,_0x3f8124[_0x0a9e('0x47')]);return _0x517081[_0x0a9e('0x6c')](_0x4f074c);}})[_0x0a9e('0x24')](function(_0x52b661){if(!_[_0x0a9e('0x74')](_0x52b661)){var _0x59aa7b=toCsv(_0x52b661);var _0x2144ca=Date['now']();fs[_0x0a9e('0x75')](util[_0x0a9e('0x73')](_0x0a9e('0x76'),_0x517081['id'],_0x2144ca),_0x59aa7b);_0x586510['setHeader'](_0x0a9e('0x77'),'attachment;\x20filename='+util[_0x0a9e('0x73')](_0x0a9e('0x78'),_0x517081['id'],_0x2144ca));_0x586510[_0x0a9e('0x79')](_0x0a9e('0x7a'),_0x0a9e('0x7b'));return _0x586510[_0x0a9e('0x7c')](util[_0x0a9e('0x73')](_0x0a9e('0x76'),_0x517081['id'],_0x2144ca));}else{return _0x586510[_0x0a9e('0x18')](0xcc);}})[_0x0a9e('0x4c')](handleError(_0x586510,null));};exports[_0x0a9e('0x7d')]=function(_0xc876d4,_0x2415fe,_0x399def){var _0x98c62c;delete _0xc876d4[_0x0a9e('0x52')]['id'];return db['CmList']['findOne']({'where':{'id':_0xc876d4[_0x0a9e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2415fe,null))[_0x0a9e('0x24')](function(_0x3428c9){if(_0x3428c9){return db['sequelize'][_0x0a9e('0x7e')](function(_0xe2b083){return db[_0x0a9e('0x6d')][_0x0a9e('0x51')](_0xc876d4['body'],{'transaction':_0xe2b083})[_0x0a9e('0x24')](function(_0x26cb76){_0x98c62c=_0x26cb76;return _0x3428c9[_0x0a9e('0x7f')](_0x26cb76,{'transaction':_0xe2b083});})[_0x0a9e('0x24')](function(){var _0x5d0e1f={'type':db[_0x0a9e('0x80')][_0x0a9e('0x81')],'transaction':_0xe2b083};switch(_0xc876d4[_0x0a9e('0x52')]['type']){case _0x0a9e('0x82'):_0x5d0e1f[_0x0a9e('0x43')]=db[_0x0a9e('0x80')]['TEXT'];break;case _0x0a9e('0x83'):_0x5d0e1f[_0x0a9e('0x43')]=db[_0x0a9e('0x80')][_0x0a9e('0x84')];break;case _0x0a9e('0x85'):_0x5d0e1f['type']=db[_0x0a9e('0x80')][_0x0a9e('0x86')];_0x5d0e1f['defaultValue']=![];break;default:}return db[_0x0a9e('0x87')][_0x0a9e('0x88')][_0x0a9e('0x89')]('cm_contacts',util['format']('cf_%s',_0x98c62c['id']),_0x5d0e1f);})[_0x0a9e('0x24')](function(){return _0x98c62c;});});}})[_0x0a9e('0x24')](respondWithResult(_0x2415fe,null))['catch'](handleError(_0x2415fe,null));};exports[_0x0a9e('0x8a')]=function(_0x1f78b4,_0x2a8d55,_0x54ce11){var _0x9fc93e={};var _0x30e037={};var _0x213d4e;var _0x30b3b8;return db[_0x0a9e('0x2e')][_0x0a9e('0x5d')]({'where':{'id':_0x1f78b4[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x2a8d55,null))[_0x0a9e('0x24')](function(_0x5a1848){if(_0x5a1848){_0x213d4e=_0x5a1848;_0x30e037[_0x0a9e('0x30')]=_['keys'](db[_0x0a9e('0x6d')][_0x0a9e('0x2f')]);_0x30e037[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x1f78b4[_0x0a9e('0x32')]);_0x30e037[_0x0a9e('0x35')]=_['intersection'](_0x30e037[_0x0a9e('0x30')],_0x30e037[_0x0a9e('0x32')]);_0x9fc93e[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x30e037['model'],qs[_0x0a9e('0x38')](_0x1f78b4[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x9fc93e[_0x0a9e('0x36')]=_0x9fc93e[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x9fc93e[_0x0a9e('0x36')]:_0x30e037[_0x0a9e('0x30')];_0x9fc93e[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x1f78b4['query'][_0x0a9e('0x3b')]);_0x9fc93e[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x1f78b4[_0x0a9e('0x32')],_0x30e037[_0x0a9e('0x35')]));_0x9fc93e[_0x0a9e('0x40')]=_[_0x0a9e('0x3f')](_0x9fc93e['where'],{'$or':[{'ListId':_0x5a1848['id']},{'ListId':null}]});if(_0x1f78b4[_0x0a9e('0x32')][_0x0a9e('0x41')]){_0x9fc93e[_0x0a9e('0x40')]=_['merge'](_0x9fc93e[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x9fc93e[_0x0a9e('0x36')],function(_0x97d5b5){var _0x370b5e={};_0x370b5e[_0x97d5b5]={'$like':'%'+_0x1f78b4[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x370b5e;})});}_0x9fc93e=_[_0x0a9e('0x3f')]({},_0x9fc93e,_0x1f78b4[_0x0a9e('0x47')]);return db[_0x0a9e('0x6d')]['findAndCountAll'](_0x9fc93e);}})[_0x0a9e('0x24')](respondWithResult(_0x2a8d55,null))[_0x0a9e('0x4c')](handleError(_0x2a8d55,null));};exports[_0x0a9e('0x8b')]=function(_0x3db98f,_0x2b624e,_0x3942fd){return db['CmList'][_0x0a9e('0x50')]({'where':{'id':_0x3db98f['params']['id']}})['then'](handleEntityNotFound(_0x2b624e,null))['then'](function(_0x19e4e6){if(_0x19e4e6){return _0x19e4e6[_0x0a9e('0x8b')](_0x3db98f[_0x0a9e('0x52')][_0x0a9e('0x60')],_['omit'](_0x3db98f[_0x0a9e('0x52')],[_0x0a9e('0x60'),'id'])||{})[_0x0a9e('0x8c')](function(_0x1fdb10){for(var _0x2c8d1d=0x0;_0x2c8d1d<_0x3db98f['body']['ids'][_0x0a9e('0x4f')];_0x2c8d1d+=0x1){socket[_0x0a9e('0x8d')](_0x0a9e('0x8e'),{'UserId':_0x3db98f['body'][_0x0a9e('0x60')][_0x2c8d1d],'CmListId':_0x3db98f[_0x0a9e('0x4e')]['id']});}return _0x1fdb10;});}})[_0x0a9e('0x24')](respondWithResult(_0x2b624e,null))['catch'](handleError(_0x2b624e,null));};exports[_0x0a9e('0x8f')]=function(_0x2bf85d,_0x15ba6b,_0x4eda8f){var _0x272291;return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x2bf85d['params']['id']}})['then'](handleEntityNotFound(_0x15ba6b,null))['then'](function(_0x3b04fd){if(_0x3b04fd){return _0x3b04fd[_0x0a9e('0x8f')](_0x2bf85d[_0x0a9e('0x32')][_0x0a9e('0x60')])['then'](function(_0x33f22a){if(_['isArray'](_0x2bf85d[_0x0a9e('0x32')][_0x0a9e('0x60')])){for(var _0x242f23=0x0;_0x242f23<_0x2bf85d['query'][_0x0a9e('0x60')][_0x0a9e('0x4f')];_0x242f23+=0x1){socket[_0x0a9e('0x8d')]('userCmList:remove',{'UserId':_0x2bf85d[_0x0a9e('0x32')]['ids'][_0x242f23],'CmListId':_0x2bf85d[_0x0a9e('0x4e')]['id']});}}else{socket['emit'](_0x0a9e('0x90'),{'UserId':_0x2bf85d['query'][_0x0a9e('0x60')],'CmListId':_0x2bf85d[_0x0a9e('0x4e')]['id']});}});}})[_0x0a9e('0x24')](respondWithStatusCode(_0x15ba6b,null))[_0x0a9e('0x4c')](handleError(_0x15ba6b,null));};exports[_0x0a9e('0x91')]=function(_0x251dd9,_0x1784c1,_0x5acdc9){var _0x35ace3={};var _0x1c9ea2={};var _0x567004;var _0xf4fb77;return db[_0x0a9e('0x2e')]['findOne']({'where':{'id':_0x251dd9[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1784c1,null))[_0x0a9e('0x24')](function(_0x569528){if(_0x569528){_0x567004=_0x569528;_0x1c9ea2[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x92')][_0x0a9e('0x2f')]);_0x1c9ea2[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x251dd9[_0x0a9e('0x32')]);_0x1c9ea2[_0x0a9e('0x35')]=_[_0x0a9e('0x37')](_0x1c9ea2[_0x0a9e('0x30')],_0x1c9ea2['query']);_0x35ace3[_0x0a9e('0x36')]=_['intersection'](_0x1c9ea2[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x35ace3[_0x0a9e('0x36')]=_0x35ace3[_0x0a9e('0x36')]['length']?_0x35ace3[_0x0a9e('0x36')]:_0x1c9ea2[_0x0a9e('0x30')];_0x35ace3[_0x0a9e('0x3a')]=qs['sort'](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x3b')]);_0x35ace3[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x251dd9[_0x0a9e('0x32')],_0x1c9ea2[_0x0a9e('0x35')]));if(_0x251dd9['query'][_0x0a9e('0x41')]){_0x35ace3[_0x0a9e('0x40')]=_[_0x0a9e('0x3f')](_0x35ace3[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x35ace3[_0x0a9e('0x36')],function(_0x8120e){var _0x5d6a48={};_0x5d6a48[_0x8120e]={'$like':'%'+_0x251dd9['query'][_0x0a9e('0x41')]+'%'};return _0x5d6a48;})});}_0x35ace3=_[_0x0a9e('0x3f')]({},_0x35ace3,_0x251dd9[_0x0a9e('0x47')]);return _0x567004[_0x0a9e('0x91')](_0x35ace3);}})[_0x0a9e('0x24')](function(_0x131da8){if(_0x131da8){_0xf4fb77=_0x131da8[_0x0a9e('0x4f')];if(!_0x251dd9['query'][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x35ace3[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x35ace3[_0x0a9e('0x1d')]=qs['offset'](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x1d')]);}return _0x567004[_0x0a9e('0x91')](_0x35ace3);}})['then'](function(_0x2b8ad4){if(_0x2b8ad4){return _0x2b8ad4?{'count':_0xf4fb77,'rows':_0x2b8ad4}:null;}})[_0x0a9e('0x24')](respondWithResult(_0x1784c1,null))[_0x0a9e('0x4c')](handleError(_0x1784c1,null));};
\ No newline at end of file
+var _0xa9e0=['request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','day','add','merge','where','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','findOne','nolimit','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','omit','success','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var qs=require(_0x0a9e('0xf'));var logger=require(_0x0a9e('0x10'))(_0x0a9e('0x11'));var utils=require(_0x0a9e('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x14'),'port':0x18eb});var socket=require(_0x0a9e('0x15'))(new Redis(config[_0x0a9e('0x13')]));require(_0x0a9e('0x16'))[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xcc;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x18')](_0x4283ce);}return _0x5db4b0[_0x0a9e('0x19')](_0x4283ce)[_0x0a9e('0x1a')]();};}function respondWithResult(_0x4d5611,_0x52a03d){_0x52a03d=_0x52a03d||0xc8;return function(_0x22dccb){if(_0x22dccb){return _0x4d5611['status'](_0x52a03d)[_0x0a9e('0x1b')](_0x22dccb);}};}function respondWithFilteredResult(_0x519dfd,_0x16033c){return function(_0x12066b){if(_0x12066b){var _0x48f32d=_0x12066b[_0x0a9e('0x1c')],_0x225616=_0x16033c[_0x0a9e('0x1d')],_0x5a0a06=_0x16033c[_0x0a9e('0x1d')]+_0x16033c[_0x0a9e('0x1e')],_0x459eb1;if(_0x5a0a06>=_0x48f32d){_0x5a0a06=_0x48f32d;_0x459eb1=0xc8;}else{_0x459eb1=0xce;}_0x519dfd[_0x0a9e('0x19')](_0x459eb1);return _0x519dfd[_0x0a9e('0x1f')](_0x0a9e('0x20'),_0x225616+'-'+_0x5a0a06+'/'+_0x48f32d)[_0x0a9e('0x1b')](_0x12066b);}return null;};}function patchUpdates(_0x112016){return function(_0x1c696a){try{jsonpatch[_0x0a9e('0x21')](_0x1c696a,_0x112016,!![]);}catch(_0x4bb1e3){return BPromise[_0x0a9e('0x22')](_0x4bb1e3);}return _0x1c696a[_0x0a9e('0x23')]();};}function saveUpdates(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['update'](_0x53682f)[_0x0a9e('0x24')](function(_0x432e56){return _0x432e56;});}return null;};}function removeEntity(_0x38e7c4,_0x30bae6){return function(_0x4abc77){if(_0x4abc77){return _0x4abc77[_0x0a9e('0x25')]()[_0x0a9e('0x24')](function(){var _0x3b45bc=_0x4abc77[_0x0a9e('0x26')]({'plain':!![]});var _0x370d86=_0x0a9e('0x27');return db[_0x0a9e('0x28')]['destroy']({'where':{'type':_0x370d86,'resourceId':_0x3b45bc['id']}})['then'](function(){return _0x4abc77;});})[_0x0a9e('0x24')](function(){_0x38e7c4[_0x0a9e('0x19')](0xcc)[_0x0a9e('0x1a')]();});}};}function handleEntityNotFound(_0x33161b,_0x526cf3){return function(_0x384319){if(!_0x384319){_0x33161b['sendStatus'](0x194);}return _0x384319;};}function handleError(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0x1f4;return function(_0x1dc186){logger[_0x0a9e('0x29')](_0x1dc186[_0x0a9e('0x2a')]);if(_0x1dc186[_0x0a9e('0x2b')]){delete _0x1dc186[_0x0a9e('0x2b')];}_0x45a1e7[_0x0a9e('0x19')](_0x5bfb33)[_0x0a9e('0x2c')](_0x1dc186);};}exports[_0x0a9e('0x2d')]=function(_0x5a101a,_0x3652a7){var _0x468813={},_0x2b1f27={},_0x2ec755={'count':0x0,'rows':[]};var _0x5c877d=db[_0x0a9e('0x2e')][_0x0a9e('0x2f')];_0x2b1f27[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x5c877d);var _0x58b06f={'dateStart':_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x33')],'dateEnd':_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x34')]};delete _0x5a101a['query'][_0x0a9e('0x33')];delete _0x5a101a['query'][_0x0a9e('0x34')];_0x2b1f27[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x5a101a[_0x0a9e('0x32')]);_0x2b1f27[_0x0a9e('0x35')]=_['intersection'](_0x2b1f27[_0x0a9e('0x30')],_0x2b1f27[_0x0a9e('0x32')]);_0x468813[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x2b1f27[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x468813['attributes']=_0x468813[_0x0a9e('0x36')]['length']?_0x468813[_0x0a9e('0x36')]:_0x2b1f27[_0x0a9e('0x30')];if(!_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x39')]('nolimit')){_0x468813[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x468813['offset']=qs['offset'](_0x5a101a[_0x0a9e('0x32')]['offset']);}_0x468813[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x3b')]);_0x468813['where']=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x5a101a[_0x0a9e('0x32')],_0x2b1f27['filters']));if(_0x58b06f[_0x0a9e('0x33')]){if(_0x58b06f[_0x0a9e('0x34')]){_0x58b06f[_0x0a9e('0x34')]=moment(_0x58b06f['dateEnd'])['add'](0x1,_0x0a9e('0x3d'));}else{_0x58b06f[_0x0a9e('0x34')]=moment(_0x58b06f['dateStart'])[_0x0a9e('0x3e')](0x1,_0x0a9e('0x3d'));}_[_0x0a9e('0x3f')](_0x468813[_0x0a9e('0x40')],{'createdAt':{'$gte':_0x58b06f['dateStart'],'$lte':_0x58b06f['dateEnd']}});}if(_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x41')]){_0x468813['where']=_[_0x0a9e('0x3f')](_0x468813[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x5c877d,function(_0x5b4f5e){if(_0x5b4f5e[_0x0a9e('0x43')][_0x0a9e('0x44')]!==_0x0a9e('0x45')){var _0x43dd5b={};_0x43dd5b[_0x5b4f5e[_0x0a9e('0x46')]]={'$like':'%'+_0x5a101a[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x43dd5b;}})});}_0x468813=_[_0x0a9e('0x3f')]({},_0x468813,_0x5a101a[_0x0a9e('0x47')]);var _0x3da2cd={'where':_0x468813[_0x0a9e('0x40')]};return db[_0x0a9e('0x2e')][_0x0a9e('0x1c')](_0x3da2cd)[_0x0a9e('0x24')](function(_0x37f6cc){_0x2ec755['count']=_0x37f6cc;if(_0x5a101a['query'][_0x0a9e('0x48')]){_0x468813[_0x0a9e('0x49')]=[{'all':!![]}];}return db[_0x0a9e('0x2e')][_0x0a9e('0x4a')](_0x468813);})[_0x0a9e('0x24')](function(_0xc9a702){_0x2ec755[_0x0a9e('0x4b')]=_0xc9a702;return _0x2ec755;})[_0x0a9e('0x24')](respondWithFilteredResult(_0x3652a7,_0x468813))[_0x0a9e('0x4c')](handleError(_0x3652a7,null));};exports[_0x0a9e('0x4d')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={'raw':![],'where':{'id':_0x2c2cb0[_0x0a9e('0x4e')]['id']}},_0x117c99={};_0x117c99[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2e')][_0x0a9e('0x2f')]);_0x117c99[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x2c2cb0['query']);_0x117c99[_0x0a9e('0x35')]=_['intersection'](_0x117c99[_0x0a9e('0x30')],_0x117c99[_0x0a9e('0x32')]);_0x5026aa[_0x0a9e('0x36')]=_['intersection'](_0x117c99[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x2c2cb0[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x5026aa[_0x0a9e('0x36')]=_0x5026aa[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x5026aa['attributes']:_0x117c99[_0x0a9e('0x30')];if(_0x2c2cb0[_0x0a9e('0x32')][_0x0a9e('0x48')]){_0x5026aa[_0x0a9e('0x49')]=[{'all':!![]}];}_0x5026aa=_[_0x0a9e('0x3f')]({},_0x5026aa,_0x2c2cb0[_0x0a9e('0x47')]);return db[_0x0a9e('0x2e')][_0x0a9e('0x50')](_0x5026aa)[_0x0a9e('0x24')](handleEntityNotFound(_0x35ed4a,null))['then'](respondWithResult(_0x35ed4a,null))[_0x0a9e('0x4c')](handleError(_0x35ed4a,null));};exports[_0x0a9e('0x51')]=function(_0x4f7240,_0x4ae14b){return db['CmList'][_0x0a9e('0x51')](_0x4f7240[_0x0a9e('0x52')],{})[_0x0a9e('0x24')](function(_0x11545a){var _0x61bb17=_0x4f7240[_0x0a9e('0x53')][_0x0a9e('0x26')]({'plain':!![]});if(!_0x61bb17)throw new Error(_0x0a9e('0x54'));if(_0x61bb17['role']==='user'){var _0x53975a=_0x11545a[_0x0a9e('0x26')]({'plain':!![]});var _0x204173=_0x0a9e('0x27');return db['UserProfileSection'][_0x0a9e('0x50')]({'where':{'name':_0x204173,'userProfileId':_0x61bb17[_0x0a9e('0x55')]},'raw':!![]})['then'](function(_0x5a88da){if(_0x5a88da&&_0x5a88da[_0x0a9e('0x56')]===0x0){return db['UserProfileResource'][_0x0a9e('0x51')]({'name':_0x53975a['name'],'resourceId':_0x53975a['id'],'type':_0x5a88da[_0x0a9e('0x2b')],'sectionId':_0x5a88da['id']},{})[_0x0a9e('0x24')](function(){return _0x11545a;});}else{return _0x11545a;}})[_0x0a9e('0x4c')](function(_0x53613a){logger[_0x0a9e('0x29')](_0x0a9e('0x57'),_0x53613a);throw _0x53613a;});}return _0x11545a;})['then'](respondWithResult(_0x4ae14b,0xc9))['catch'](handleError(_0x4ae14b,null));};exports[_0x0a9e('0x58')]=function(_0x3aedd0,_0x49c095){if(_0x3aedd0[_0x0a9e('0x52')]['id']){delete _0x3aedd0['body']['id'];}return db[_0x0a9e('0x2e')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))['then'](saveUpdates(_0x3aedd0['body'],null))[_0x0a9e('0x24')](respondWithResult(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports[_0x0a9e('0x25')]=function(_0x65432,_0x3cfd00){return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x65432[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x3cfd00,null))[_0x0a9e('0x24')](removeEntity(_0x3cfd00,null))['catch'](handleError(_0x3cfd00,null));};exports[_0x0a9e('0x59')]=function(_0x121cef,_0x2642bb){return db[_0x0a9e('0x2e')][_0x0a9e('0x59')]()[_0x0a9e('0x24')](respondWithResult(_0x2642bb,null))['catch'](handleError(_0x2642bb,null));};exports[_0x0a9e('0x5a')]=function(_0x26bc80,_0x5239ef,_0x3649cc){if(_0x26bc80['body']['id']){delete _0x26bc80[_0x0a9e('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x26bc80['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x5239ef,null))['then'](function(_0x2244d6){if(_0x2244d6){_0x26bc80[_0x0a9e('0x52')][_0x0a9e('0x5b')]=_0x2244d6['id'];return db[_0x0a9e('0x5c')][_0x0a9e('0x51')](_0x26bc80[_0x0a9e('0x52')]);}})['then'](respondWithResult(_0x5239ef,null))[_0x0a9e('0x4c')](handleError(_0x5239ef,null));};exports['getDispositions']=function(_0xca4ade,_0x1f07cb,_0x51aaf7){var _0x5adf8f={'raw':![],'where':{}};var _0x453360={};var _0x156f1c={'count':0x0,'rows':[]};return db[_0x0a9e('0x2e')][_0x0a9e('0x5d')]({'where':{'id':_0xca4ade['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1f07cb,null))[_0x0a9e('0x24')](function(_0x54327c){if(_0x54327c){_0x453360[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x5c')][_0x0a9e('0x2f')]);_0x453360[_0x0a9e('0x32')]=_['keys'](_0xca4ade[_0x0a9e('0x32')]);_0x453360[_0x0a9e('0x35')]=_[_0x0a9e('0x37')](_0x453360['model'],_0x453360[_0x0a9e('0x32')]);_0x5adf8f['attributes']=_['intersection'](_0x453360[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x5adf8f[_0x0a9e('0x36')]=_0x5adf8f[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x5adf8f[_0x0a9e('0x36')]:_0x453360[_0x0a9e('0x30')];if(!_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x5adf8f[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x5adf8f[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0xca4ade['query'][_0x0a9e('0x1d')]);}_0x5adf8f[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0xca4ade['query'][_0x0a9e('0x3b')]);_0x5adf8f[_0x0a9e('0x40')]=qs['filters'](_[_0x0a9e('0x3c')](_0xca4ade[_0x0a9e('0x32')],_0x453360[_0x0a9e('0x35')]));_0x5adf8f[_0x0a9e('0x40')][_0x0a9e('0x5b')]=_0x54327c['id'];if(_0xca4ade['query']['filter']){_0x5adf8f['where']=_[_0x0a9e('0x3f')](_0x5adf8f[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x5adf8f[_0x0a9e('0x36')],function(_0x6abd03){var _0x380ab3={};_0x380ab3[_0x6abd03]={'$like':'%'+_0xca4ade[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x380ab3;})});}_0x5adf8f=_['merge']({},_0x5adf8f,_0xca4ade[_0x0a9e('0x47')]);return db[_0x0a9e('0x5c')][_0x0a9e('0x1c')]({'where':_0x5adf8f['where']})[_0x0a9e('0x24')](function(_0x583b2e){_0x156f1c[_0x0a9e('0x1c')]=_0x583b2e;if(_0xca4ade[_0x0a9e('0x32')]['includeAll']){_0x5adf8f[_0x0a9e('0x49')]=[{'all':!![]}];}return db[_0x0a9e('0x5c')][_0x0a9e('0x4a')](_0x5adf8f);})[_0x0a9e('0x24')](function(_0x542ece){_0x156f1c[_0x0a9e('0x4b')]=_0x542ece;return _0x156f1c;});}})[_0x0a9e('0x24')](respondWithFilteredResult(_0x1f07cb,_0x5adf8f))[_0x0a9e('0x4c')](handleError(_0x1f07cb,null));};exports[_0x0a9e('0x5f')]=function(_0x5b7fc3,_0x109ccb,_0x3d91db){var _0x2d5506;return db[_0x0a9e('0x2e')]['find']({'where':{'id':_0x5b7fc3[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x109ccb,null))[_0x0a9e('0x24')](function(_0xf410e5){if(_0xf410e5){return _0xf410e5[_0x0a9e('0x5f')](_0x5b7fc3[_0x0a9e('0x32')][_0x0a9e('0x60')]);}})[_0x0a9e('0x24')](respondWithStatusCode(_0x109ccb,null))[_0x0a9e('0x4c')](handleError(_0x109ccb,null));};exports[_0x0a9e('0x61')]=function(_0xc4c230,_0x1f10ef,_0x25744a){return db[_0x0a9e('0x2e')]['find']({'where':{'id':_0xc4c230[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1f10ef,null))[_0x0a9e('0x24')](function(_0x563627){if(_0x563627){var _0x3736e0=[];var _0x33dda0={'success':[],'errors':[]};return db[_0x0a9e('0x62')][_0x0a9e('0x59')]()['then'](function(_0x541e80){if(_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]&&_['isArray'](_0xc4c230[_0x0a9e('0x52')]['tags'])){if(_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]['length']){_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]=_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')][_0x0a9e('0x64')](';')+';';}else{_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x63')]=null;}}else{_0xc4c230['body'][_0x0a9e('0x63')]=null;}if(_0xc4c230[_0x0a9e('0x52')]&&_[_0x0a9e('0x65')](_0xc4c230[_0x0a9e('0x52')])){for(var _0x492543=0x0;_0x492543<_0xc4c230[_0x0a9e('0x52')][_0x0a9e('0x4f')];_0x492543+=0x1){_0xc4c230['body'][_0x492543][_0x0a9e('0x5b')]=_0xc4c230['params']['id'];_0x3736e0[_0x0a9e('0x66')](_0xc4c230[_0x0a9e('0x52')][_0x492543]);}return BPromise[_0x0a9e('0x67')](_0x3736e0,function(_0x385d52){return db['CmContact']['create'](_[_0x0a9e('0x68')](_0x385d52,[_0x0a9e('0x60'),'id'])||{},{'fields':_[_0x0a9e('0x31')](_0x541e80),'raw':!![]})['then'](function(_0x3b4a9f){_0x33dda0[_0x0a9e('0x69')]['push'](_0x3b4a9f['dataValues']);})[_0x0a9e('0x4c')](function(_0x56acca){_0x33dda0['errors']['push']({'data':_0x385d52,'error':_0x56acca[_0x0a9e('0x6a')]});});})[_0x0a9e('0x24')](function(_0x9044fe){return _0x33dda0;})[_0x0a9e('0x4c')](function(_0x3c6dd6){return _0x3c6dd6;});}else{_0x1f10ef[_0x0a9e('0x19')](0x190)['json']({'message':_0x0a9e('0x6b')});}});}})['then'](respondWithResult(_0x1f10ef,null))[_0x0a9e('0x4c')](handleError(_0x1f10ef,null));};exports[_0x0a9e('0x6c')]=function(_0x18ad56,_0x4566b0,_0x50f8d7){var _0x46c9ac;return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x18ad56['params']['id']},'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x6e')}]})[_0x0a9e('0x24')](handleEntityNotFound(_0x4566b0,null))[_0x0a9e('0x24')](function(_0x255e49){if(_0x255e49){_0x46c9ac=_0x255e49;return db[_0x0a9e('0x62')][_0x0a9e('0x2f')];}})[_0x0a9e('0x24')](function(_0x509efe){if(_0x509efe){var _0x2645d6={};var _0x3325c5={};_0x3325c5['model']=_[_0x0a9e('0x6f')](_[_0x0a9e('0x31')](_0x509efe),_[_0x0a9e('0x42')](_0x46c9ac['CustomFields'],function(_0x96672f){return util['format'](_0x0a9e('0x70'),_0x96672f['id']);}));_0x3325c5[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x18ad56[_0x0a9e('0x32')]);_0x3325c5[_0x0a9e('0x35')]=_[_0x0a9e('0x37')](_0x3325c5[_0x0a9e('0x30')],_0x3325c5[_0x0a9e('0x32')]);_0x2645d6['attributes']=_[_0x0a9e('0x37')](_0x3325c5[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x2645d6[_0x0a9e('0x36')]=_0x2645d6[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x2645d6[_0x0a9e('0x36')]:_0x3325c5[_0x0a9e('0x30')];if(!_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x2645d6['limit']=qs[_0x0a9e('0x1e')](_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x2645d6[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x18ad56['query'][_0x0a9e('0x1d')]);}_0x2645d6[_0x0a9e('0x3a')]=qs['sort'](_0x18ad56[_0x0a9e('0x32')]['sort']);_0x2645d6[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x18ad56[_0x0a9e('0x32')],_0x3325c5['filters']));_0x2645d6[_0x0a9e('0x71')]=!![];if(_0x18ad56['query'][_0x0a9e('0x41')]){_0x2645d6[_0x0a9e('0x40')]=_['merge'](_0x2645d6[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x2645d6[_0x0a9e('0x36')],function(_0x4ab276){var _0x4c788f={};_0x4c788f[_0x4ab276]={'$like':'%'+_0x18ad56[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x4c788f;})});}_0x2645d6=_[_0x0a9e('0x3f')]({},_0x2645d6,_0x18ad56[_0x0a9e('0x47')]);return _0x46c9ac[_0x0a9e('0x6c')](_0x2645d6);}})[_0x0a9e('0x24')](respondWithResult(_0x4566b0,null))[_0x0a9e('0x4c')](handleError(_0x4566b0,null));};exports[_0x0a9e('0x72')]=function(_0x3f8124,_0x586510,_0x3156c7){var _0x517081;return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x3f8124[_0x0a9e('0x4e')]['id']},'include':[{'model':db[_0x0a9e('0x6d')],'as':_0x0a9e('0x6e')}]})['then'](handleEntityNotFound(_0x586510,null))[_0x0a9e('0x24')](function(_0x4667bf){if(_0x4667bf){_0x517081=_0x4667bf;return db[_0x0a9e('0x62')][_0x0a9e('0x2f')];}})[_0x0a9e('0x24')](function(_0x5c66ef){if(_0x5c66ef){var _0x4f074c={};var _0x22a3cb={};_0x22a3cb['model']=_[_0x0a9e('0x6f')](_[_0x0a9e('0x31')](_0x5c66ef),_[_0x0a9e('0x42')](_0x517081[_0x0a9e('0x6e')],function(_0x2ad54b){return util[_0x0a9e('0x73')]('cf_%d',_0x2ad54b['id']);}));_0x22a3cb['query']=_[_0x0a9e('0x31')](_0x3f8124['query']);_0x22a3cb[_0x0a9e('0x35')]=_['intersection'](_0x22a3cb[_0x0a9e('0x30')],_0x22a3cb['query']);_0x4f074c['attributes']=_[_0x0a9e('0x37')](_0x22a3cb[_0x0a9e('0x30')],qs['fields'](_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x4f074c[_0x0a9e('0x36')]=_0x4f074c[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x4f074c['attributes']:_0x22a3cb['model'];if(!_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x4f074c[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x3f8124['query'][_0x0a9e('0x1e')]);_0x4f074c[_0x0a9e('0x1d')]=qs['offset'](_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x1d')]);}_0x4f074c[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x3b')]);_0x4f074c[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x3f8124[_0x0a9e('0x32')],_0x22a3cb['filters']));_0x4f074c[_0x0a9e('0x71')]=!![];if(_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x41')]){_0x4f074c[_0x0a9e('0x40')]=_[_0x0a9e('0x3f')](_0x4f074c['where'],{'$or':_['map'](_0x4f074c[_0x0a9e('0x36')],function(_0x16ae1a){var _0x466bbf={};_0x466bbf[_0x16ae1a]={'$like':'%'+_0x3f8124[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x466bbf;})});}_0x4f074c=_['merge']({},_0x4f074c,_0x3f8124[_0x0a9e('0x47')]);return _0x517081[_0x0a9e('0x6c')](_0x4f074c);}})[_0x0a9e('0x24')](function(_0x52b661){if(!_[_0x0a9e('0x74')](_0x52b661)){var _0x59aa7b=toCsv(_0x52b661);var _0x2144ca=Date['now']();fs[_0x0a9e('0x75')](util[_0x0a9e('0x73')](_0x0a9e('0x76'),_0x517081['id'],_0x2144ca),_0x59aa7b);_0x586510['setHeader'](_0x0a9e('0x77'),'attachment;\x20filename='+util[_0x0a9e('0x73')](_0x0a9e('0x78'),_0x517081['id'],_0x2144ca));_0x586510[_0x0a9e('0x79')](_0x0a9e('0x7a'),_0x0a9e('0x7b'));return _0x586510[_0x0a9e('0x7c')](util[_0x0a9e('0x73')](_0x0a9e('0x76'),_0x517081['id'],_0x2144ca));}else{return _0x586510[_0x0a9e('0x18')](0xcc);}})[_0x0a9e('0x4c')](handleError(_0x586510,null));};exports[_0x0a9e('0x7d')]=function(_0xc876d4,_0x2415fe,_0x399def){var _0x98c62c;delete _0xc876d4[_0x0a9e('0x52')]['id'];return db['CmList']['findOne']({'where':{'id':_0xc876d4[_0x0a9e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2415fe,null))[_0x0a9e('0x24')](function(_0x3428c9){if(_0x3428c9){return db['sequelize'][_0x0a9e('0x7e')](function(_0xe2b083){return db[_0x0a9e('0x6d')][_0x0a9e('0x51')](_0xc876d4['body'],{'transaction':_0xe2b083})[_0x0a9e('0x24')](function(_0x26cb76){_0x98c62c=_0x26cb76;return _0x3428c9[_0x0a9e('0x7f')](_0x26cb76,{'transaction':_0xe2b083});})[_0x0a9e('0x24')](function(){var _0x5d0e1f={'type':db[_0x0a9e('0x80')][_0x0a9e('0x81')],'transaction':_0xe2b083};switch(_0xc876d4[_0x0a9e('0x52')]['type']){case _0x0a9e('0x82'):_0x5d0e1f[_0x0a9e('0x43')]=db[_0x0a9e('0x80')]['TEXT'];break;case _0x0a9e('0x83'):_0x5d0e1f[_0x0a9e('0x43')]=db[_0x0a9e('0x80')][_0x0a9e('0x84')];break;case _0x0a9e('0x85'):_0x5d0e1f['type']=db[_0x0a9e('0x80')][_0x0a9e('0x86')];_0x5d0e1f['defaultValue']=![];break;default:}return db[_0x0a9e('0x87')][_0x0a9e('0x88')][_0x0a9e('0x89')]('cm_contacts',util['format']('cf_%s',_0x98c62c['id']),_0x5d0e1f);})[_0x0a9e('0x24')](function(){return _0x98c62c;});});}})[_0x0a9e('0x24')](respondWithResult(_0x2415fe,null))['catch'](handleError(_0x2415fe,null));};exports[_0x0a9e('0x8a')]=function(_0x1f78b4,_0x2a8d55,_0x54ce11){var _0x9fc93e={};var _0x30e037={};var _0x213d4e;var _0x30b3b8;return db[_0x0a9e('0x2e')][_0x0a9e('0x5d')]({'where':{'id':_0x1f78b4[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x2a8d55,null))[_0x0a9e('0x24')](function(_0x5a1848){if(_0x5a1848){_0x213d4e=_0x5a1848;_0x30e037[_0x0a9e('0x30')]=_['keys'](db[_0x0a9e('0x6d')][_0x0a9e('0x2f')]);_0x30e037[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x1f78b4[_0x0a9e('0x32')]);_0x30e037[_0x0a9e('0x35')]=_['intersection'](_0x30e037[_0x0a9e('0x30')],_0x30e037[_0x0a9e('0x32')]);_0x9fc93e[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x30e037['model'],qs[_0x0a9e('0x38')](_0x1f78b4[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x9fc93e[_0x0a9e('0x36')]=_0x9fc93e[_0x0a9e('0x36')][_0x0a9e('0x4f')]?_0x9fc93e[_0x0a9e('0x36')]:_0x30e037[_0x0a9e('0x30')];_0x9fc93e[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x1f78b4['query'][_0x0a9e('0x3b')]);_0x9fc93e[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x1f78b4[_0x0a9e('0x32')],_0x30e037[_0x0a9e('0x35')]));_0x9fc93e[_0x0a9e('0x40')]=_[_0x0a9e('0x3f')](_0x9fc93e['where'],{'$or':[{'ListId':_0x5a1848['id']},{'ListId':null}]});if(_0x1f78b4[_0x0a9e('0x32')][_0x0a9e('0x41')]){_0x9fc93e[_0x0a9e('0x40')]=_['merge'](_0x9fc93e[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x9fc93e[_0x0a9e('0x36')],function(_0x97d5b5){var _0x370b5e={};_0x370b5e[_0x97d5b5]={'$like':'%'+_0x1f78b4[_0x0a9e('0x32')][_0x0a9e('0x41')]+'%'};return _0x370b5e;})});}_0x9fc93e=_[_0x0a9e('0x3f')]({},_0x9fc93e,_0x1f78b4[_0x0a9e('0x47')]);return db[_0x0a9e('0x6d')]['findAndCountAll'](_0x9fc93e);}})[_0x0a9e('0x24')](respondWithResult(_0x2a8d55,null))[_0x0a9e('0x4c')](handleError(_0x2a8d55,null));};exports[_0x0a9e('0x8b')]=function(_0x3db98f,_0x2b624e,_0x3942fd){return db['CmList'][_0x0a9e('0x50')]({'where':{'id':_0x3db98f['params']['id']}})['then'](handleEntityNotFound(_0x2b624e,null))['then'](function(_0x19e4e6){if(_0x19e4e6){return _0x19e4e6[_0x0a9e('0x8b')](_0x3db98f[_0x0a9e('0x52')][_0x0a9e('0x60')],_['omit'](_0x3db98f[_0x0a9e('0x52')],[_0x0a9e('0x60'),'id'])||{})[_0x0a9e('0x8c')](function(_0x1fdb10){for(var _0x2c8d1d=0x0;_0x2c8d1d<_0x3db98f['body']['ids'][_0x0a9e('0x4f')];_0x2c8d1d+=0x1){socket[_0x0a9e('0x8d')](_0x0a9e('0x8e'),{'UserId':_0x3db98f['body'][_0x0a9e('0x60')][_0x2c8d1d],'CmListId':_0x3db98f[_0x0a9e('0x4e')]['id']});}return _0x1fdb10;});}})[_0x0a9e('0x24')](respondWithResult(_0x2b624e,null))['catch'](handleError(_0x2b624e,null));};exports[_0x0a9e('0x8f')]=function(_0x2bf85d,_0x15ba6b,_0x4eda8f){var _0x272291;return db[_0x0a9e('0x2e')][_0x0a9e('0x50')]({'where':{'id':_0x2bf85d['params']['id']}})['then'](handleEntityNotFound(_0x15ba6b,null))['then'](function(_0x3b04fd){if(_0x3b04fd){return _0x3b04fd[_0x0a9e('0x8f')](_0x2bf85d[_0x0a9e('0x32')][_0x0a9e('0x60')])['then'](function(_0x33f22a){if(_['isArray'](_0x2bf85d[_0x0a9e('0x32')][_0x0a9e('0x60')])){for(var _0x242f23=0x0;_0x242f23<_0x2bf85d['query'][_0x0a9e('0x60')][_0x0a9e('0x4f')];_0x242f23+=0x1){socket[_0x0a9e('0x8d')]('userCmList:remove',{'UserId':_0x2bf85d[_0x0a9e('0x32')]['ids'][_0x242f23],'CmListId':_0x2bf85d[_0x0a9e('0x4e')]['id']});}}else{socket['emit'](_0x0a9e('0x90'),{'UserId':_0x2bf85d['query'][_0x0a9e('0x60')],'CmListId':_0x2bf85d[_0x0a9e('0x4e')]['id']});}});}})[_0x0a9e('0x24')](respondWithStatusCode(_0x15ba6b,null))[_0x0a9e('0x4c')](handleError(_0x15ba6b,null));};exports[_0x0a9e('0x91')]=function(_0x251dd9,_0x1784c1,_0x5acdc9){var _0x35ace3={};var _0x1c9ea2={};var _0x567004;var _0xf4fb77;return db[_0x0a9e('0x2e')]['findOne']({'where':{'id':_0x251dd9[_0x0a9e('0x4e')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1784c1,null))[_0x0a9e('0x24')](function(_0x569528){if(_0x569528){_0x567004=_0x569528;_0x1c9ea2[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x92')][_0x0a9e('0x2f')]);_0x1c9ea2[_0x0a9e('0x32')]=_[_0x0a9e('0x31')](_0x251dd9[_0x0a9e('0x32')]);_0x1c9ea2[_0x0a9e('0x35')]=_[_0x0a9e('0x37')](_0x1c9ea2[_0x0a9e('0x30')],_0x1c9ea2['query']);_0x35ace3[_0x0a9e('0x36')]=_['intersection'](_0x1c9ea2[_0x0a9e('0x30')],qs[_0x0a9e('0x38')](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x35ace3[_0x0a9e('0x36')]=_0x35ace3[_0x0a9e('0x36')]['length']?_0x35ace3[_0x0a9e('0x36')]:_0x1c9ea2[_0x0a9e('0x30')];_0x35ace3[_0x0a9e('0x3a')]=qs['sort'](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x3b')]);_0x35ace3[_0x0a9e('0x40')]=qs[_0x0a9e('0x35')](_[_0x0a9e('0x3c')](_0x251dd9[_0x0a9e('0x32')],_0x1c9ea2[_0x0a9e('0x35')]));if(_0x251dd9['query'][_0x0a9e('0x41')]){_0x35ace3[_0x0a9e('0x40')]=_[_0x0a9e('0x3f')](_0x35ace3[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x42')](_0x35ace3[_0x0a9e('0x36')],function(_0x8120e){var _0x5d6a48={};_0x5d6a48[_0x8120e]={'$like':'%'+_0x251dd9['query'][_0x0a9e('0x41')]+'%'};return _0x5d6a48;})});}_0x35ace3=_[_0x0a9e('0x3f')]({},_0x35ace3,_0x251dd9[_0x0a9e('0x47')]);return _0x567004[_0x0a9e('0x91')](_0x35ace3);}})[_0x0a9e('0x24')](function(_0x131da8){if(_0x131da8){_0xf4fb77=_0x131da8[_0x0a9e('0x4f')];if(!_0x251dd9['query'][_0x0a9e('0x39')](_0x0a9e('0x5e'))){_0x35ace3[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x1e')]);_0x35ace3[_0x0a9e('0x1d')]=qs['offset'](_0x251dd9[_0x0a9e('0x32')][_0x0a9e('0x1d')]);}return _0x567004[_0x0a9e('0x91')](_0x35ace3);}})['then'](function(_0x2b8ad4){if(_0x2b8ad4){return _0x2b8ad4?{'count':_0xf4fb77,'rows':_0x2b8ad4}:null;}})[_0x0a9e('0x24')](respondWithResult(_0x1784c1,null))[_0x0a9e('0x4c')](handleError(_0x1784c1,null));};
\ No newline at end of file
index 8bd818c..2a8388a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcde=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3289a8,_0xfa44a4){var _0x5bb3e7=function(_0x1b7d69){while(--_0x1b7d69){_0x3289a8['push'](_0x3289a8['shift']());}};_0x5bb3e7(++_0xfa44a4);}(_0xdcde,0x1e6));var _0xedcd=function(_0x2a960f,_0x5aab73){_0x2a960f=_0x2a960f-0x0;var _0x5027df=_0xdcde[_0x2a960f];return _0x5027df;};'use strict';var EventEmitter=require(_0xedcd('0x0'));var CmList=require(_0xedcd('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xedcd('0x2'),'afterUpdate':'update','afterDestroy':_0xedcd('0x3')};function emitEvent(_0x5200c2){return function(_0x400679,_0x3cf32f,_0x2341bf){CmListEvents[_0xedcd('0x4')](_0x5200c2+':'+_0x400679['id'],_0x400679);CmListEvents['emit'](_0x5200c2,_0x400679);_0x2341bf(null);};}for(var e in events){if(events[_0xedcd('0x5')](e)){var event=events[e];CmList[_0xedcd('0x6')](e,emitEvent(event));}}module[_0xedcd('0x7')]=CmListEvents;
\ No newline at end of file
+var _0xa749=['hasOwnProperty','hook','exports','events','../../mysqldb','CmList','setMaxListeners','update','remove','emit'];(function(_0x82a969,_0x240c7b){var _0x530240=function(_0x5c8538){while(--_0x5c8538){_0x82a969['push'](_0x82a969['shift']());}};_0x530240(++_0x240c7b);}(_0xa749,0x1a7));var _0x9a74=function(_0x2e8aac,_0x36be07){_0x2e8aac=_0x2e8aac-0x0;var _0x50f222=_0xa749[_0x2e8aac];return _0x50f222;};'use strict';var EventEmitter=require(_0x9a74('0x0'));var CmList=require(_0x9a74('0x1'))['db'][_0x9a74('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x9a74('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a74('0x4'),'afterDestroy':_0x9a74('0x5')};function emitEvent(_0x285095){return function(_0xdcca10,_0x34475c,_0x15d83d){CmListEvents[_0x9a74('0x6')](_0x285095+':'+_0xdcca10['id'],_0xdcca10);CmListEvents[_0x9a74('0x6')](_0x285095,_0xdcca10);_0x15d83d(null);};}for(var e in events){if(events[_0x9a74('0x7')](e)){var event=events[e];CmList[_0x9a74('0x8')](e,emitEvent(event));}}module[_0x9a74('0x9')]=CmListEvents;
\ No newline at end of file
index 329b1d3..34bb44f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca0e=['api','moment','bluebird','./cmList.attributes','exports','define','../../config/logger'];(function(_0x41c454,_0x59c6a1){var _0x46bb96=function(_0x3c1b5b){while(--_0x3c1b5b){_0x41c454['push'](_0x41c454['shift']());}};_0x46bb96(++_0x59c6a1);}(_0xca0e,0xca));var _0xeca0=function(_0x3e3a52,_0xc4923c){_0x3e3a52=_0x3e3a52-0x0;var _0x499f85=_0xca0e[_0x3e3a52];return _0x499f85;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeca0('0x0'))(_0xeca0('0x1'));var moment=require(_0xeca0('0x2'));var BPromise=require(_0xeca0('0x3'));var rp=require('request-promise');var attributes=require(_0xeca0('0x4'));module[_0xeca0('0x5')]=function(_0x133e7a,_0x1957da){return _0x133e7a[_0xeca0('0x6')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2453=['../../config/logger','api','moment','bluebird','request-promise','./cmList.attributes','exports','define','cm_lists','lodash'];(function(_0x17b325,_0x2bcf3e){var _0x332c58=function(_0x1a3e93){while(--_0x1a3e93){_0x17b325['push'](_0x17b325['shift']());}};_0x332c58(++_0x2bcf3e);}(_0x2453,0x8b));var _0x3245=function(_0x171c4b,_0x45cfc7){_0x171c4b=_0x171c4b-0x0;var _0x5b592c=_0x2453[_0x171c4b];return _0x5b592c;};'use strict';var _=require(_0x3245('0x0'));var util=require('util');var logger=require(_0x3245('0x1'))(_0x3245('0x2'));var moment=require(_0x3245('0x3'));var BPromise=require(_0x3245('0x4'));var rp=require(_0x3245('0x5'));var attributes=require(_0x3245('0x6'));module[_0x3245('0x7')]=function(_0x589af5,_0x1a31ef){return _0x589af5[_0x3245('0x8')]('CmList',attributes,{'tableName':_0x3245('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d26c8b..aec072d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x040f=['http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x626a5b,_0x1944b2){var _0x333c50=function(_0x52c9cc){while(--_0x52c9cc){_0x626a5b['push'](_0x626a5b['shift']());}};_0x333c50(++_0x1944b2);}(_0x040f,0x93));var _0xf040=function(_0x3b8d58,_0x567981){_0x3b8d58=_0x3b8d58-0x0;var _0x4f14ba=_0x040f[_0x3b8d58];return _0x4f14ba;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf040('0x0'));var BPromise=require('bluebird');var rs=require(_0xf040('0x1'));var fs=require('fs');var Redis=require(_0xf040('0x2'));var db=require(_0xf040('0x3'))['db'];var utils=require(_0xf040('0x4'));var logger=require(_0xf040('0x5'))(_0xf040('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf040('0x7')]({'port':0x232a});config[_0xf040('0x8')]=_[_0xf040('0x9')](config[_0xf040('0x8')],{'host':_0xf040('0xa'),'port':0x18eb});var socket=require(_0xf040('0xb'))(new Redis(config[_0xf040('0x8')]));require(_0xf040('0xc'))['register'](socket);function respondWithRpcPromise(_0x41ff1c,_0x327d71,_0x42db74){return new BPromise(function(_0x454d5a,_0x5a49d3){return client['request'](_0x41ff1c,_0x42db74)[_0xf040('0xd')](function(_0x542a36){logger['info'](_0xf040('0xe'),_0x327d71,_0xf040('0xf'));logger['debug'](_0xf040('0x10'),_0x327d71,_0xf040('0xf'),JSON[_0xf040('0x11')](_0x542a36));if(_0x542a36[_0xf040('0x12')]){if(_0x542a36[_0xf040('0x12')][_0xf040('0x13')]===0x1f4){logger[_0xf040('0x12')](_0xf040('0xe'),_0x327d71,_0x542a36[_0xf040('0x12')][_0xf040('0x14')]);return _0x5a49d3(_0x542a36[_0xf040('0x12')][_0xf040('0x14')]);}logger[_0xf040('0x12')](_0xf040('0xe'),_0x327d71,_0x542a36[_0xf040('0x12')][_0xf040('0x14')]);return _0x454d5a(_0x542a36[_0xf040('0x12')]['message']);}else{logger['info'](_0xf040('0xe'),_0x327d71,_0xf040('0xf'));_0x454d5a(_0x542a36[_0xf040('0x15')][_0xf040('0x14')]);}})['catch'](function(_0x362b43){logger[_0xf040('0x12')](_0xf040('0xe'),_0x327d71,_0x362b43);_0x5a49d3(_0x362b43);});});}
\ No newline at end of file
+var _0x8fb5=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc'];(function(_0x1b5b34,_0x5f0cb0){var _0x1ca3ee=function(_0x34c2e9){while(--_0x34c2e9){_0x1b5b34['push'](_0x1b5b34['shift']());}};_0x1ca3ee(++_0x5f0cb0);}(_0x8fb5,0xc9));var _0x58fb=function(_0x463ab1,_0x46bf6a){_0x463ab1=_0x463ab1-0x0;var _0x349abe=_0x8fb5[_0x463ab1];return _0x349abe;};'use strict';var _=require(_0x58fb('0x0'));var util=require(_0x58fb('0x1'));var moment=require(_0x58fb('0x2'));var BPromise=require('bluebird');var rs=require(_0x58fb('0x3'));var fs=require('fs');var Redis=require(_0x58fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x58fb('0x5'));var logger=require('../../config/logger')(_0x58fb('0x6'));var config=require('../../config/environment');var jayson=require(_0x58fb('0x7'));var client=jayson[_0x58fb('0x8')][_0x58fb('0x9')]({'port':0x232a});config[_0x58fb('0xa')]=_[_0x58fb('0xb')](config['redis'],{'host':_0x58fb('0xc'),'port':0x18eb});var socket=require(_0x58fb('0xd'))(new Redis(config['redis']));require(_0x58fb('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d56ce,_0x117b32,_0x324cd8){return new BPromise(function(_0x2f562c,_0x4f9d4c){return client[_0x58fb('0xf')](_0x5d56ce,_0x324cd8)[_0x58fb('0x10')](function(_0x477bdf){logger[_0x58fb('0x11')](_0x58fb('0x12'),_0x117b32,'request\x20sent');logger[_0x58fb('0x13')](_0x58fb('0x14'),_0x117b32,_0x58fb('0x15'),JSON[_0x58fb('0x16')](_0x477bdf));if(_0x477bdf[_0x58fb('0x17')]){if(_0x477bdf['error']['code']===0x1f4){logger[_0x58fb('0x17')](_0x58fb('0x12'),_0x117b32,_0x477bdf[_0x58fb('0x17')][_0x58fb('0x18')]);return _0x4f9d4c(_0x477bdf['error'][_0x58fb('0x18')]);}logger['error'](_0x58fb('0x12'),_0x117b32,_0x477bdf[_0x58fb('0x17')][_0x58fb('0x18')]);return _0x2f562c(_0x477bdf[_0x58fb('0x17')][_0x58fb('0x18')]);}else{logger['info'](_0x58fb('0x12'),_0x117b32,_0x58fb('0x15'));_0x2f562c(_0x477bdf[_0x58fb('0x19')]['message']);}})['catch'](function(_0x2771b9){logger[_0x58fb('0x17')](_0x58fb('0x12'),_0x117b32,_0x2771b9);_0x4f9d4c(_0x2771b9);});});}
\ No newline at end of file
index c1801a7..d83d8d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5f1=['length','cmList:','./cmList.events','save','remove','update','removeListener','register'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xc5f1,0x16a));var _0x1c5f=function(_0x3f4c9e,_0x8d49b){_0x3f4c9e=_0x3f4c9e-0x0;var _0x5c8dc1=_0xc5f1[_0x3f4c9e];return _0x5c8dc1;};'use strict';var CmListEvents=require(_0x1c5f('0x0'));var events=[_0x1c5f('0x1'),_0x1c5f('0x2'),_0x1c5f('0x3')];function createListener(_0x4ef38d,_0x1b289c){return function(_0x37ab52){_0x1b289c['emit'](_0x4ef38d,_0x37ab52);};}function removeListener(_0x20d5b9,_0x2c8626){return function(){CmListEvents[_0x1c5f('0x4')](_0x20d5b9,_0x2c8626);};}exports[_0x1c5f('0x5')]=function(_0x39ef9b){for(var _0x4eff9d=0x0,_0x2a5e61=events[_0x1c5f('0x6')];_0x4eff9d<_0x2a5e61;_0x4eff9d++){var _0x42a775=events[_0x4eff9d];var _0x29bce0=createListener(_0x1c5f('0x7')+_0x42a775,_0x39ef9b);CmListEvents['on'](_0x42a775,_0x29bce0);}};
\ No newline at end of file
+var _0xa8f4=['save','remove','update','emit','removeListener','length','cmList:'];(function(_0x43102b,_0x10e77e){var _0x12078f=function(_0xda606a){while(--_0xda606a){_0x43102b['push'](_0x43102b['shift']());}};_0x12078f(++_0x10e77e);}(_0xa8f4,0x70));var _0x4a8f=function(_0x1afbda,_0x1b67ad){_0x1afbda=_0x1afbda-0x0;var _0x3c9e51=_0xa8f4[_0x1afbda];return _0x3c9e51;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x4a8f('0x0'),_0x4a8f('0x1'),_0x4a8f('0x2')];function createListener(_0x17cb4a,_0x2f22ba){return function(_0x36e531){_0x2f22ba[_0x4a8f('0x3')](_0x17cb4a,_0x36e531);};}function removeListener(_0x1172d7,_0x13349c){return function(){CmListEvents[_0x4a8f('0x4')](_0x1172d7,_0x13349c);};}exports['register']=function(_0x1ee864){for(var _0x46f711=0x0,_0x15827f=events[_0x4a8f('0x5')];_0x46f711<_0x15827f;_0x46f711++){var _0x31e74f=events[_0x46f711];var _0x12faa7=createListener(_0x4a8f('0x6')+_0x31e74f,_0x1ee864);CmListEvents['on'](_0x31e74f,_0x12faa7);}};
\ No newline at end of file
index 75fc2d4..f907aae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d05=['/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','addDisposition','addContacts','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','util','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','get','/describe','/:id/dispositions','getDispositions'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x2d05,0x1b5));var _0x52d0=function(_0x27ae0b,_0x52a52f){_0x27ae0b=_0x27ae0b-0x0;var _0x57a73e=_0x2d05[_0x27ae0b];return _0x57a73e;};'use strict';var multer=require('multer');var util=require(_0x52d0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x52d0('0x1'));var router=express[_0x52d0('0x2')]();var auth=require(_0x52d0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x52d0('0x4'));var controller=require(_0x52d0('0x5'));router['get']('/',auth[_0x52d0('0x6')](),controller['index']);router[_0x52d0('0x7')](_0x52d0('0x8'),auth[_0x52d0('0x6')](),controller['describe']);router[_0x52d0('0x7')]('/:id',auth[_0x52d0('0x6')](),controller['show']);router[_0x52d0('0x7')](_0x52d0('0x9'),auth[_0x52d0('0x6')](),controller[_0x52d0('0xa')]);router[_0x52d0('0x7')](_0x52d0('0xb'),auth[_0x52d0('0x6')](),controller[_0x52d0('0xc')]);router['get']('/:id/contacts/csv',auth[_0x52d0('0x6')](),controller[_0x52d0('0xd')]);router[_0x52d0('0x7')](_0x52d0('0xe'),auth['isAuthenticated'](),controller[_0x52d0('0xf')]);router[_0x52d0('0x7')](_0x52d0('0x10'),auth[_0x52d0('0x6')](),controller['getAgents']);router[_0x52d0('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x52d0('0x11')](_0x52d0('0x9'),auth['isAuthenticated'](),controller[_0x52d0('0x12')]);router[_0x52d0('0x11')]('/:id/contacts',auth[_0x52d0('0x6')](),controller[_0x52d0('0x13')]);router['post'](_0x52d0('0xe'),auth[_0x52d0('0x6')](),controller['addCustomField']);router[_0x52d0('0x11')](_0x52d0('0x10'),auth[_0x52d0('0x6')](),controller[_0x52d0('0x14')]);router[_0x52d0('0x15')](_0x52d0('0x16'),auth[_0x52d0('0x6')](),controller[_0x52d0('0x17')]);router[_0x52d0('0x18')]('/:id',auth[_0x52d0('0x6')](),controller[_0x52d0('0x19')]);router[_0x52d0('0x18')](_0x52d0('0x9'),auth[_0x52d0('0x6')](),controller[_0x52d0('0x1a')]);router[_0x52d0('0x18')](_0x52d0('0x10'),auth[_0x52d0('0x6')](),controller[_0x52d0('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x14ff=['show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','addDisposition','post','addContacts','addCustomField','addAgents','put','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','/:id','isAuthenticated'];(function(_0x3998aa,_0x597890){var _0x4825f8=function(_0x14d155){while(--_0x14d155){_0x3998aa['push'](_0x3998aa['shift']());}};_0x4825f8(++_0x597890);}(_0x14ff,0x1d4));var _0xf14f=function(_0x42e61b,_0x5d27f1){_0x42e61b=_0x42e61b-0x0;var _0x4caccc=_0x14ff[_0x42e61b];return _0x4caccc;};'use strict';var multer=require(_0xf14f('0x0'));var util=require(_0xf14f('0x1'));var path=require('path');var timeout=require(_0xf14f('0x2'));var express=require('express');var router=express[_0xf14f('0x3')]();var auth=require(_0xf14f('0x4'));var interaction=require(_0xf14f('0x5'));var config=require(_0xf14f('0x6'));var controller=require(_0xf14f('0x7'));router[_0xf14f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf14f('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf14f('0xa'),auth[_0xf14f('0xb')](),controller[_0xf14f('0xc')]);router[_0xf14f('0x8')](_0xf14f('0xd'),auth[_0xf14f('0xb')](),controller[_0xf14f('0xe')]);router['get'](_0xf14f('0xf'),auth['isAuthenticated'](),controller[_0xf14f('0x10')]);router[_0xf14f('0x8')]('/:id/contacts/csv',auth[_0xf14f('0xb')](),controller[_0xf14f('0x11')]);router['get'](_0xf14f('0x12'),auth[_0xf14f('0xb')](),controller[_0xf14f('0x13')]);router[_0xf14f('0x8')](_0xf14f('0x14'),auth[_0xf14f('0xb')](),controller[_0xf14f('0x15')]);router['post']('/',auth[_0xf14f('0xb')](),controller[_0xf14f('0x16')]);router['post'](_0xf14f('0xd'),auth[_0xf14f('0xb')](),controller[_0xf14f('0x17')]);router[_0xf14f('0x18')]('/:id/contacts',auth[_0xf14f('0xb')](),controller[_0xf14f('0x19')]);router[_0xf14f('0x18')](_0xf14f('0x12'),auth[_0xf14f('0xb')](),controller[_0xf14f('0x1a')]);router[_0xf14f('0x18')](_0xf14f('0x14'),auth[_0xf14f('0xb')](),controller[_0xf14f('0x1b')]);router[_0xf14f('0x1c')]('/:id',auth[_0xf14f('0xb')](),controller[_0xf14f('0x1d')]);router[_0xf14f('0x1e')](_0xf14f('0xa'),auth[_0xf14f('0xb')](),controller['destroy']);router[_0xf14f('0x1e')](_0xf14f('0xd'),auth[_0xf14f('0xb')](),controller['removeDispositions']);router[_0xf14f('0x1e')](_0xf14f('0x14'),auth[_0xf14f('0xb')](),controller['removeAgents']);module[_0xf14f('0x1f')]=router;
\ No newline at end of file
index 0b0b9f3..d03cf64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbac3=['sequelize','exports','getDataValue','field','STRING'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0xbac3,0x69));var _0x3bac=function(_0x8d3262,_0x439e73){_0x8d3262=_0x8d3262-0x0;var _0x45561c=_0xbac3[_0x8d3262];return _0x45561c;};'use strict';var Sequelize=require(_0x3bac('0x0'));module[_0x3bac('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5874c5){return this[_0x3bac('0x2')](_0x3bac('0x3'));}},'field':{'type':Sequelize[_0x3bac('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x3bac('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x3bac('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0x480e=['getDataValue','STRING','sequelize','VIRTUAL'];(function(_0x4e3261,_0x5c9dad){var _0x1fd40b=function(_0x11f002){while(--_0x11f002){_0x4e3261['push'](_0x4e3261['shift']());}};_0x1fd40b(++_0x5c9dad);}(_0x480e,0x6e));var _0xe480=function(_0xa6c600,_0x17b0e6){_0xa6c600=_0xa6c600-0x0;var _0x52165e=_0x480e[_0xa6c600];return _0x52165e;};'use strict';var Sequelize=require(_0xe480('0x0'));module['exports']={'name':{'type':Sequelize[_0xe480('0x1')],'get':function(_0x11f56b){return this[_0xe480('0x2')]('field');}},'field':{'type':Sequelize[_0xe480('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xe480('0x3')],'allowNull':![]}};
\ No newline at end of file
index e8a9ef4..6d8c5fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb613=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','end','error','stack','name','send','body','Condition','find','params','destroy','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4a9d83,_0x291512){var _0x3aade5=function(_0x2cbda1){while(--_0x2cbda1){_0x4a9d83['push'](_0x4a9d83['shift']());}};_0x3aade5(++_0x291512);}(_0xb613,0x17c));var _0x3b61=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xb613[_0x25bea7];return _0x175952;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3b61('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3b61('0x1'));var rp=require(_0x3b61('0x2'));var moment=require(_0x3b61('0x3'));var BPromise=require(_0x3b61('0x4'));var Mustache=require(_0x3b61('0x5'));var util=require('util');var path=require(_0x3b61('0x6'));var sox=require('sox');var csv=require(_0x3b61('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3b61('0x8'));var squel=require(_0x3b61('0x9'));var crypto=require(_0x3b61('0xa'));var jsforce=require(_0x3b61('0xb'));var deskjs=require(_0x3b61('0xc'));var toCsv=require(_0x3b61('0x7'));var querystring=require(_0x3b61('0xd'));var Papa=require(_0x3b61('0xe'));var Redis=require(_0x3b61('0xf'));var qs=require(_0x3b61('0x10'));var logger=require(_0x3b61('0x11'))(_0x3b61('0x12'));var utils=require(_0x3b61('0x13'));var config=require(_0x3b61('0x14'));var db=require(_0x3b61('0x15'))['db'];function respondWithStatusCode(_0x59a18,_0x53ca71){_0x53ca71=_0x53ca71||0xcc;return function(_0x1c9c36){if(_0x1c9c36){return _0x59a18[_0x3b61('0x16')](_0x53ca71);}return _0x59a18[_0x3b61('0x17')](_0x53ca71)['end']();};}function respondWithResult(_0x1e1b3d,_0x478af5){_0x478af5=_0x478af5||0xc8;return function(_0x3a5e87){if(_0x3a5e87){return _0x1e1b3d[_0x3b61('0x17')](_0x478af5)[_0x3b61('0x18')](_0x3a5e87);}};}function respondWithFilteredResult(_0x156103,_0xed22be){return function(_0x3421f3){if(_0x3421f3){var _0x42636f=_0x3421f3[_0x3b61('0x19')],_0x49a36e=_0xed22be[_0x3b61('0x1a')],_0x8ca798=_0xed22be[_0x3b61('0x1a')]+_0xed22be[_0x3b61('0x1b')],_0x333f4a;if(_0x8ca798>=_0x42636f){_0x8ca798=_0x42636f;_0x333f4a=0xc8;}else{_0x333f4a=0xce;}_0x156103[_0x3b61('0x17')](_0x333f4a);return _0x156103[_0x3b61('0x1c')](_0x3b61('0x1d'),_0x49a36e+'-'+_0x8ca798+'/'+_0x42636f)[_0x3b61('0x18')](_0x3421f3);}return null;};}function patchUpdates(_0x5b09de){return function(_0x22a058){try{jsonpatch[_0x3b61('0x1e')](_0x22a058,_0x5b09de,!![]);}catch(_0x1b0457){return BPromise['reject'](_0x1b0457);}return _0x22a058[_0x3b61('0x1f')]();};}function saveUpdates(_0x13a0a6,_0xcd646c){return function(_0x144dbc){if(_0x144dbc){return _0x144dbc['update'](_0x13a0a6)[_0x3b61('0x20')](function(_0x433319){return _0x433319;});}return null;};}function removeEntity(_0x1464d9,_0x29d6fa){return function(_0x19f911){if(_0x19f911){return _0x19f911['destroy']()['then'](function(){_0x1464d9[_0x3b61('0x17')](0xcc)[_0x3b61('0x21')]();});}};}function handleEntityNotFound(_0x4355ff,_0x43e56b){return function(_0x58b956){if(!_0x58b956){_0x4355ff[_0x3b61('0x16')](0x194);}return _0x58b956;};}function handleError(_0x42a669,_0x2fe1d9){_0x2fe1d9=_0x2fe1d9||0x1f4;return function(_0xf09e95){logger[_0x3b61('0x22')](_0xf09e95[_0x3b61('0x23')]);if(_0xf09e95[_0x3b61('0x24')]){delete _0xf09e95[_0x3b61('0x24')];}_0x42a669['status'](_0x2fe1d9)[_0x3b61('0x25')](_0xf09e95);};}exports['update']=function(_0x3c97d5,_0x329a27){if(_0x3c97d5['body']['id']){delete _0x3c97d5[_0x3b61('0x26')]['id'];}return db[_0x3b61('0x27')][_0x3b61('0x28')]({'where':{'id':_0x3c97d5[_0x3b61('0x29')]['id']}})['then'](handleEntityNotFound(_0x329a27,null))['then'](saveUpdates(_0x3c97d5['body'],null))[_0x3b61('0x20')](respondWithResult(_0x329a27,null))['catch'](handleError(_0x329a27,null));};exports[_0x3b61('0x2a')]=function(_0x12ba68,_0x220836){return db['Condition'][_0x3b61('0x28')]({'where':{'id':_0x12ba68[_0x3b61('0x29')]['id']}})[_0x3b61('0x20')](handleEntityNotFound(_0x220836,null))[_0x3b61('0x20')](removeEntity(_0x220836,null))[_0x3b61('0x2b')](handleError(_0x220836,null));};
\ No newline at end of file
+var _0x4cd1=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','body','Condition','find','params','catch','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto'];(function(_0x6af885,_0x33b9da){var _0x321e12=function(_0x430240){while(--_0x430240){_0x6af885['push'](_0x6af885['shift']());}};_0x321e12(++_0x33b9da);}(_0x4cd1,0xaa));var _0x14cd=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4cd1[_0x279d37];return _0x530173;};'use strict';var pdf=require(_0x14cd('0x0'));var emlformat=require(_0x14cd('0x1'));var rimraf=require(_0x14cd('0x2'));var zipdir=require(_0x14cd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14cd('0x4'));var moment=require(_0x14cd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x14cd('0x6'));var util=require(_0x14cd('0x7'));var path=require(_0x14cd('0x8'));var sox=require(_0x14cd('0x9'));var csv=require(_0x14cd('0xa'));var ejs=require(_0x14cd('0xb'));var fs=require('fs');var _=require(_0x14cd('0xc'));var squel=require('squel');var crypto=require(_0x14cd('0xd'));var jsforce=require(_0x14cd('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x14cd('0xf'));var Papa=require(_0x14cd('0x10'));var Redis=require(_0x14cd('0x11'));var qs=require(_0x14cd('0x12'));var logger=require(_0x14cd('0x13'))(_0x14cd('0x14'));var utils=require(_0x14cd('0x15'));var config=require('../../config/environment');var db=require(_0x14cd('0x16'))['db'];function respondWithStatusCode(_0x53eb08,_0xedbd80){_0xedbd80=_0xedbd80||0xcc;return function(_0x3f5192){if(_0x3f5192){return _0x53eb08[_0x14cd('0x17')](_0xedbd80);}return _0x53eb08[_0x14cd('0x18')](_0xedbd80)[_0x14cd('0x19')]();};}function respondWithResult(_0x57e032,_0x4d3dfc){_0x4d3dfc=_0x4d3dfc||0xc8;return function(_0x6af7b4){if(_0x6af7b4){return _0x57e032[_0x14cd('0x18')](_0x4d3dfc)[_0x14cd('0x1a')](_0x6af7b4);}};}function respondWithFilteredResult(_0x5c49ae,_0x1a308a){return function(_0x5b3a06){if(_0x5b3a06){var _0x38753b=_0x5b3a06['count'],_0xd98ea8=_0x1a308a[_0x14cd('0x1b')],_0xea1a2=_0x1a308a[_0x14cd('0x1b')]+_0x1a308a[_0x14cd('0x1c')],_0x28dff1;if(_0xea1a2>=_0x38753b){_0xea1a2=_0x38753b;_0x28dff1=0xc8;}else{_0x28dff1=0xce;}_0x5c49ae['status'](_0x28dff1);return _0x5c49ae[_0x14cd('0x1d')](_0x14cd('0x1e'),_0xd98ea8+'-'+_0xea1a2+'/'+_0x38753b)[_0x14cd('0x1a')](_0x5b3a06);}return null;};}function patchUpdates(_0x29a7c4){return function(_0x160a75){try{jsonpatch[_0x14cd('0x1f')](_0x160a75,_0x29a7c4,!![]);}catch(_0x6c5768){return BPromise[_0x14cd('0x20')](_0x6c5768);}return _0x160a75[_0x14cd('0x21')]();};}function saveUpdates(_0x37ee47,_0x65d3b5){return function(_0x280bc3){if(_0x280bc3){return _0x280bc3[_0x14cd('0x22')](_0x37ee47)[_0x14cd('0x23')](function(_0x40b6d6){return _0x40b6d6;});}return null;};}function removeEntity(_0x4b9be5,_0x14df82){return function(_0x3b6097){if(_0x3b6097){return _0x3b6097['destroy']()[_0x14cd('0x23')](function(){_0x4b9be5[_0x14cd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb676c3,_0x26fbe0){return function(_0x18196d){if(!_0x18196d){_0xb676c3[_0x14cd('0x17')](0x194);}return _0x18196d;};}function handleError(_0x31c9ec,_0x543ffe){_0x543ffe=_0x543ffe||0x1f4;return function(_0x3dda16){logger[_0x14cd('0x24')](_0x3dda16[_0x14cd('0x25')]);if(_0x3dda16[_0x14cd('0x26')]){delete _0x3dda16[_0x14cd('0x26')];}_0x31c9ec[_0x14cd('0x18')](_0x543ffe)[_0x14cd('0x27')](_0x3dda16);};}exports[_0x14cd('0x22')]=function(_0x34b265,_0x59a69f){if(_0x34b265[_0x14cd('0x28')]['id']){delete _0x34b265[_0x14cd('0x28')]['id'];}return db[_0x14cd('0x29')][_0x14cd('0x2a')]({'where':{'id':_0x34b265[_0x14cd('0x2b')]['id']}})[_0x14cd('0x23')](handleEntityNotFound(_0x59a69f,null))[_0x14cd('0x23')](saveUpdates(_0x34b265[_0x14cd('0x28')],null))[_0x14cd('0x23')](respondWithResult(_0x59a69f,null))[_0x14cd('0x2c')](handleError(_0x59a69f,null));};exports[_0x14cd('0x2d')]=function(_0xcc08de,_0x52ed88){return db['Condition'][_0x14cd('0x2a')]({'where':{'id':_0xcc08de[_0x14cd('0x2b')]['id']}})[_0x14cd('0x23')](handleEntityNotFound(_0x52ed88,null))[_0x14cd('0x23')](removeEntity(_0x52ed88,null))[_0x14cd('0x2c')](handleError(_0x52ed88,null));};
\ No newline at end of file
index 77b3585..8633555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9acf=['tools_conditions','../../config/logger','api','moment','bluebird','request-promise','./condition.attributes','exports','define'];(function(_0x137c99,_0x1fd49b){var _0x400bf3=function(_0x5b8103){while(--_0x5b8103){_0x137c99['push'](_0x137c99['shift']());}};_0x400bf3(++_0x1fd49b);}(_0x9acf,0xbe));var _0xf9ac=function(_0x498526,_0x2d7c2f){_0x498526=_0x498526-0x0;var _0x2b5dd4=_0x9acf[_0x498526];return _0x2b5dd4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9ac('0x0'))(_0xf9ac('0x1'));var moment=require(_0xf9ac('0x2'));var BPromise=require(_0xf9ac('0x3'));var rp=require(_0xf9ac('0x4'));var attributes=require(_0xf9ac('0x5'));module[_0xf9ac('0x6')]=function(_0x301cd4,_0x23c19f){return _0x301cd4[_0xf9ac('0x7')]('Condition',attributes,{'tableName':_0xf9ac('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33e9=['./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x537a97,_0x4e8805){var _0x3f7672=function(_0x50246a){while(--_0x50246a){_0x537a97['push'](_0x537a97['shift']());}};_0x3f7672(++_0x4e8805);}(_0x33e9,0xcb));var _0x933e=function(_0x1379f5,_0x1a86b4){_0x1379f5=_0x1379f5-0x0;var _0x37f73b=_0x33e9[_0x1379f5];return _0x37f73b;};'use strict';var _=require(_0x933e('0x0'));var util=require(_0x933e('0x1'));var logger=require(_0x933e('0x2'))(_0x933e('0x3'));var moment=require('moment');var BPromise=require(_0x933e('0x4'));var rp=require(_0x933e('0x5'));var attributes=require(_0x933e('0x6'));module[_0x933e('0x7')]=function(_0x27c4ab,_0x450b08){return _0x27c4ab[_0x933e('0x8')](_0x933e('0x9'),attributes,{'tableName':_0x933e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c0865f..160ada6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe51d=['info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x175eab,_0x2ebf07){var _0x4281c8=function(_0x1fbdc5){while(--_0x1fbdc5){_0x175eab['push'](_0x175eab['shift']());}};_0x4281c8(++_0x2ebf07);}(_0xe51d,0xed));var _0xde51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe51d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xde51('0x0'));var util=require(_0xde51('0x1'));var moment=require('moment');var BPromise=require(_0xde51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xde51('0x3'));var logger=require(_0xde51('0x4'))('rpc');var config=require(_0xde51('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xde51('0x6')][_0xde51('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x544bb4,_0xb7fb11,_0x5b3340){return new BPromise(function(_0x36f2d2,_0x56cdd6){return client[_0xde51('0x8')](_0x544bb4,_0x5b3340)[_0xde51('0x9')](function(_0x48368e){logger[_0xde51('0xa')](_0xde51('0xb'),_0xb7fb11,_0xde51('0xc'));logger[_0xde51('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0xb7fb11,'request\x20sent',JSON[_0xde51('0xe')](_0x48368e));if(_0x48368e[_0xde51('0xf')]){if(_0x48368e[_0xde51('0xf')]['code']===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0xb7fb11,_0x48368e['error'][_0xde51('0x10')]);return _0x56cdd6(_0x48368e[_0xde51('0xf')][_0xde51('0x10')]);}logger[_0xde51('0xf')](_0xde51('0xb'),_0xb7fb11,_0x48368e[_0xde51('0xf')][_0xde51('0x10')]);return _0x36f2d2(_0x48368e[_0xde51('0xf')]['message']);}else{logger[_0xde51('0xa')]('Condition,\x20%s,\x20%s',_0xb7fb11,_0xde51('0xc'));_0x36f2d2(_0x48368e[_0xde51('0x11')][_0xde51('0x10')]);}})[_0xde51('0x12')](function(_0x4606d8){logger[_0xde51('0xf')]('Condition,\x20%s,\x20%s',_0xb7fb11,_0x4606d8);_0x56cdd6(_0x4606d8);});});}
\ No newline at end of file
+var _0x197c=['jayson/promise','http','request','then','info','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Condition,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x369a98,_0x32250c){var _0x29565c=function(_0x1a6973){while(--_0x1a6973){_0x369a98['push'](_0x369a98['shift']());}};_0x29565c(++_0x32250c);}(_0x197c,0x1c6));var _0xc197=function(_0x3cebff,_0x20b43d){_0x3cebff=_0x3cebff-0x0;var _0x6e5423=_0x197c[_0x3cebff];return _0x6e5423;};'use strict';var _=require('lodash');var util=require(_0xc197('0x0'));var moment=require(_0xc197('0x1'));var BPromise=require(_0xc197('0x2'));var rs=require(_0xc197('0x3'));var fs=require('fs');var Redis=require(_0xc197('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc197('0x5'))(_0xc197('0x6'));var config=require(_0xc197('0x7'));var jayson=require(_0xc197('0x8'));var client=jayson['client'][_0xc197('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52052c,_0x397670,_0x243a79){return new BPromise(function(_0x4e20cf,_0x519af2){return client[_0xc197('0xa')](_0x52052c,_0x243a79)[_0xc197('0xb')](function(_0x258948){logger[_0xc197('0xc')]('Condition,\x20%s,\x20%s',_0x397670,'request\x20sent');logger[_0xc197('0xd')](_0xc197('0xe'),_0x397670,_0xc197('0xf'),JSON['stringify'](_0x258948));if(_0x258948[_0xc197('0x10')]){if(_0x258948[_0xc197('0x10')][_0xc197('0x11')]===0x1f4){logger[_0xc197('0x10')](_0xc197('0x12'),_0x397670,_0x258948[_0xc197('0x10')][_0xc197('0x13')]);return _0x519af2(_0x258948[_0xc197('0x10')][_0xc197('0x13')]);}logger[_0xc197('0x10')](_0xc197('0x12'),_0x397670,_0x258948[_0xc197('0x10')][_0xc197('0x13')]);return _0x4e20cf(_0x258948[_0xc197('0x10')]['message']);}else{logger[_0xc197('0xc')](_0xc197('0x12'),_0x397670,_0xc197('0xf'));_0x4e20cf(_0x258948[_0xc197('0x14')][_0xc197('0x13')]);}})[_0xc197('0x15')](function(_0x3895d0){logger[_0xc197('0x10')](_0xc197('0x12'),_0x397670,_0x3895d0);_0x519af2(_0x3895d0);});});}
\ No newline at end of file
index 1ad2d63..51a1c9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7afa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','update','delete','destroy','multer','util','path','Router'];(function(_0x265d8d,_0x2ef29f){var _0x210a0a=function(_0x5480f9){while(--_0x5480f9){_0x265d8d['push'](_0x265d8d['shift']());}};_0x210a0a(++_0x2ef29f);}(_0x7afa,0x80));var _0xa7af=function(_0x4c1790,_0x3740c6){_0x4c1790=_0x4c1790-0x0;var _0x5e2295=_0x7afa[_0x4c1790];return _0x5e2295;};'use strict';var multer=require(_0xa7af('0x0'));var util=require(_0xa7af('0x1'));var path=require(_0xa7af('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa7af('0x3')]();var auth=require(_0xa7af('0x4'));var interaction=require(_0xa7af('0x5'));var config=require(_0xa7af('0x6'));var controller=require(_0xa7af('0x7'));router['put']('/:id',auth[_0xa7af('0x8')](),controller[_0xa7af('0x9')]);router[_0xa7af('0xa')]('/:id',auth[_0xa7af('0x8')](),controller[_0xa7af('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0xe597=['express','../../components/interaction/service','./condition.controller','put','isAuthenticated','update','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe597,0xf3));var _0x7e59=function(_0x5b6992,_0x5279c4){_0x5b6992=_0x5b6992-0x0;var _0x3d9b63=_0xe597[_0x5b6992];return _0x3d9b63;};'use strict';var multer=require(_0x7e59('0x0'));var util=require(_0x7e59('0x1'));var path=require(_0x7e59('0x2'));var timeout=require(_0x7e59('0x3'));var express=require(_0x7e59('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7e59('0x5'));var config=require('../../config/environment');var controller=require(_0x7e59('0x6'));router[_0x7e59('0x7')]('/:id',auth[_0x7e59('0x8')](),controller[_0x7e59('0x9')]);router['delete'](_0x7e59('0xa'),auth[_0x7e59('0x8')](),controller[_0x7e59('0xb')]);module[_0x7e59('0xc')]=router;
\ No newline at end of file
index 369d9f6..5aa0da2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f5e=['sequelize','exports','STRING','name'];(function(_0x30b808,_0xd8130b){var _0x25cec0=function(_0x527929){while(--_0x527929){_0x30b808['push'](_0x30b808['shift']());}};_0x25cec0(++_0xd8130b);}(_0x7f5e,0x114));var _0xe7f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f5e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe7f5('0x0'));module[_0xe7f5('0x1')]={'name':{'type':Sequelize[_0xe7f5('0x2')],'allowNull':![],'unique':_0xe7f5('0x3')},'description':{'type':Sequelize[_0xe7f5('0x2')]}};
\ No newline at end of file
+var _0x8691=['name','exports','STRING'];(function(_0x44a503,_0x118746){var _0x5daed1=function(_0xfea531){while(--_0xfea531){_0x44a503['push'](_0x44a503['shift']());}};_0x5daed1(++_0x118746);}(_0x8691,0x10c));var _0x1869=function(_0x4a005e,_0x11451d){_0x4a005e=_0x4a005e-0x0;var _0x20de72=_0x8691[_0x4a005e];return _0x20de72;};'use strict';var Sequelize=require('sequelize');module[_0x1869('0x0')]={'name':{'type':Sequelize[_0x1869('0x1')],'allowNull':![],'unique':_0x1869('0x2')},'description':{'type':Sequelize[_0x1869('0x1')]}};
\ No newline at end of file
index 10a87dd..b099ef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['query','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','dateStart','add','day','merge','map','type','key','filter','Dashboard','count','includeAll','include','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','userProfileId','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','sort','getItems','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','status','end','offset','limit','set','Content-Range','json','save','update','then','CustomDashboards','UserProfileResource','destroy','sendStatus','error','stack','name','send','rawAttributes','keys'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0xcb91[_0x2d61b2];return _0x12df89;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var logger=require(_0x1cb9('0xf'))(_0x1cb9('0x10'));var utils=require(_0x1cb9('0x11'));var config=require('../../config/environment');var db=require(_0x1cb9('0x12'))['db'];config[_0x1cb9('0x13')]=_[_0x1cb9('0x14')](config[_0x1cb9('0x13')],{'host':_0x1cb9('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x1cb9('0x16')](socket);function respondWithStatusCode(_0x282bc6,_0x384496){_0x384496=_0x384496||0xcc;return function(_0x1c714f){if(_0x1c714f){return _0x282bc6['sendStatus'](_0x384496);}return _0x282bc6[_0x1cb9('0x17')](_0x384496)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1b3cd7,_0x8dfa55){_0x8dfa55=_0x8dfa55||0xc8;return function(_0x3e2d11){if(_0x3e2d11){return _0x1b3cd7['status'](_0x8dfa55)['json'](_0x3e2d11);}};}function respondWithFilteredResult(_0xd446a3,_0x3cc765){return function(_0x3904b7){if(_0x3904b7){var _0x3f1376=_0x3904b7['count'],_0x3e21e0=_0x3cc765['offset'],_0xf22920=_0x3cc765[_0x1cb9('0x19')]+_0x3cc765[_0x1cb9('0x1a')],_0x23d3a9;if(_0xf22920>=_0x3f1376){_0xf22920=_0x3f1376;_0x23d3a9=0xc8;}else{_0x23d3a9=0xce;}_0xd446a3[_0x1cb9('0x17')](_0x23d3a9);return _0xd446a3[_0x1cb9('0x1b')](_0x1cb9('0x1c'),_0x3e21e0+'-'+_0xf22920+'/'+_0x3f1376)[_0x1cb9('0x1d')](_0x3904b7);}return null;};}function patchUpdates(_0x24fa1f){return function(_0x4ac422){try{jsonpatch['apply'](_0x4ac422,_0x24fa1f,!![]);}catch(_0x1a5a72){return BPromise['reject'](_0x1a5a72);}return _0x4ac422[_0x1cb9('0x1e')]();};}function saveUpdates(_0x2265ea,_0x523b26){return function(_0x599275){if(_0x599275){return _0x599275[_0x1cb9('0x1f')](_0x2265ea)[_0x1cb9('0x20')](function(_0x103a63){return _0x103a63;});}return null;};}function removeEntity(_0x4601b8,_0x45b8d3){return function(_0x27db16){if(_0x27db16){return _0x27db16['destroy']()['then'](function(){var _0x6c6f61=_0x27db16['get']({'plain':!![]});var _0x10a419=_0x1cb9('0x21');return db[_0x1cb9('0x22')][_0x1cb9('0x23')]({'where':{'type':_0x10a419,'resourceId':_0x6c6f61['id']}})[_0x1cb9('0x20')](function(){return _0x27db16;});})['then'](function(){_0x4601b8[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x4c8d76,_0xd6891c){return function(_0x21effa){if(!_0x21effa){_0x4c8d76[_0x1cb9('0x24')](0x194);}return _0x21effa;};}function handleError(_0x1804fd,_0x406821){_0x406821=_0x406821||0x1f4;return function(_0x21d6f5){logger[_0x1cb9('0x25')](_0x21d6f5[_0x1cb9('0x26')]);if(_0x21d6f5[_0x1cb9('0x27')]){delete _0x21d6f5[_0x1cb9('0x27')];}_0x1804fd['status'](_0x406821)[_0x1cb9('0x28')](_0x21d6f5);};}exports['index']=function(_0x110282,_0x4efebc){var _0x278327={},_0x41011c={},_0x3cd7f5={'count':0x0,'rows':[]};var _0x2038aa=db['Dashboard'][_0x1cb9('0x29')];_0x41011c['model']=_[_0x1cb9('0x2a')](_0x2038aa);var _0x336a98={'dateStart':_0x110282[_0x1cb9('0x2b')]['dateStart'],'dateEnd':_0x110282[_0x1cb9('0x2b')]['dateEnd']};delete _0x110282[_0x1cb9('0x2b')]['dateStart'];delete _0x110282[_0x1cb9('0x2b')][_0x1cb9('0x2c')];_0x41011c[_0x1cb9('0x2b')]=_[_0x1cb9('0x2a')](_0x110282['query']);_0x41011c[_0x1cb9('0x2d')]=_[_0x1cb9('0x2e')](_0x41011c[_0x1cb9('0x2f')],_0x41011c[_0x1cb9('0x2b')]);_0x278327[_0x1cb9('0x30')]=_[_0x1cb9('0x2e')](_0x41011c[_0x1cb9('0x2f')],qs[_0x1cb9('0x31')](_0x110282[_0x1cb9('0x2b')][_0x1cb9('0x31')]));_0x278327[_0x1cb9('0x30')]=_0x278327[_0x1cb9('0x30')][_0x1cb9('0x32')]?_0x278327['attributes']:_0x41011c['model'];if(!_0x110282[_0x1cb9('0x2b')][_0x1cb9('0x33')](_0x1cb9('0x34'))){_0x278327[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0x110282[_0x1cb9('0x2b')][_0x1cb9('0x1a')]);_0x278327[_0x1cb9('0x19')]=qs['offset'](_0x110282[_0x1cb9('0x2b')][_0x1cb9('0x19')]);}_0x278327[_0x1cb9('0x35')]=qs['sort'](_0x110282[_0x1cb9('0x2b')]['sort']);_0x278327[_0x1cb9('0x36')]=qs['filters'](_[_0x1cb9('0x37')](_0x110282[_0x1cb9('0x2b')],_0x41011c[_0x1cb9('0x2d')]));if(_0x336a98[_0x1cb9('0x38')]){if(_0x336a98[_0x1cb9('0x2c')]){_0x336a98[_0x1cb9('0x2c')]=moment(_0x336a98[_0x1cb9('0x2c')])['add'](0x1,'day');}else{_0x336a98[_0x1cb9('0x2c')]=moment(_0x336a98[_0x1cb9('0x38')])[_0x1cb9('0x39')](0x1,_0x1cb9('0x3a'));}_[_0x1cb9('0x3b')](_0x278327[_0x1cb9('0x36')],{'createdAt':{'$gte':_0x336a98[_0x1cb9('0x38')],'$lte':_0x336a98['dateEnd']}});}if(_0x110282[_0x1cb9('0x2b')]['filter']){_0x278327['where']=_['merge'](_0x278327[_0x1cb9('0x36')],{'$or':_[_0x1cb9('0x3c')](_0x2038aa,function(_0x1bf51c){if(_0x1bf51c[_0x1cb9('0x3d')][_0x1cb9('0x3e')]!=='VIRTUAL'){var _0x2a624f={};_0x2a624f[_0x1bf51c['field']]={'$like':'%'+_0x110282[_0x1cb9('0x2b')][_0x1cb9('0x3f')]+'%'};return _0x2a624f;}})});}_0x278327=_[_0x1cb9('0x3b')]({},_0x278327,_0x110282['options']);var _0x238ff6={'where':_0x278327['where']};return db[_0x1cb9('0x40')][_0x1cb9('0x41')](_0x238ff6)['then'](function(_0x5839aa){_0x3cd7f5[_0x1cb9('0x41')]=_0x5839aa;if(_0x110282[_0x1cb9('0x2b')][_0x1cb9('0x42')]){_0x278327[_0x1cb9('0x43')]=[{'all':!![]}];}return db[_0x1cb9('0x40')]['findAll'](_0x278327);})[_0x1cb9('0x20')](function(_0x5594fc){_0x3cd7f5['rows']=_0x5594fc;return _0x3cd7f5;})['then'](respondWithFilteredResult(_0x4efebc,_0x278327))[_0x1cb9('0x44')](handleError(_0x4efebc,null));};exports[_0x1cb9('0x45')]=function(_0x7405ac,_0x11cea5){var _0x116c05={'raw':![],'where':{'id':_0x7405ac[_0x1cb9('0x46')]['id']}},_0x2a8b7f={};_0x2a8b7f[_0x1cb9('0x2f')]=_[_0x1cb9('0x2a')](db[_0x1cb9('0x40')][_0x1cb9('0x29')]);_0x2a8b7f['query']=_[_0x1cb9('0x2a')](_0x7405ac[_0x1cb9('0x2b')]);_0x2a8b7f[_0x1cb9('0x2d')]=_['intersection'](_0x2a8b7f[_0x1cb9('0x2f')],_0x2a8b7f[_0x1cb9('0x2b')]);_0x116c05[_0x1cb9('0x30')]=_[_0x1cb9('0x2e')](_0x2a8b7f[_0x1cb9('0x2f')],qs['fields'](_0x7405ac[_0x1cb9('0x2b')]['fields']));_0x116c05[_0x1cb9('0x30')]=_0x116c05['attributes'][_0x1cb9('0x32')]?_0x116c05[_0x1cb9('0x30')]:_0x2a8b7f[_0x1cb9('0x2f')];if(_0x7405ac[_0x1cb9('0x2b')]['includeAll']){_0x116c05[_0x1cb9('0x43')]=[{'all':!![]}];}_0x116c05=_[_0x1cb9('0x3b')]({},_0x116c05,_0x7405ac[_0x1cb9('0x47')]);return db[_0x1cb9('0x40')][_0x1cb9('0x48')](_0x116c05)[_0x1cb9('0x20')](handleEntityNotFound(_0x11cea5,null))[_0x1cb9('0x20')](respondWithResult(_0x11cea5,null))[_0x1cb9('0x44')](handleError(_0x11cea5,null));};exports[_0x1cb9('0x49')]=function(_0x17f10e,_0x48dd4a){return db['Dashboard'][_0x1cb9('0x49')](_0x17f10e[_0x1cb9('0x4a')],{})[_0x1cb9('0x20')](function(_0x1e073d){var _0x20b253=_0x17f10e[_0x1cb9('0x4b')][_0x1cb9('0x4c')]({'plain':!![]});if(!_0x20b253)throw new Error(_0x1cb9('0x4d'));if(_0x20b253[_0x1cb9('0x4e')]===_0x1cb9('0x4b')){var _0x4a4b87=_0x1e073d[_0x1cb9('0x4c')]({'plain':!![]});var _0x5e773d=_0x1cb9('0x21');return db['UserProfileSection'][_0x1cb9('0x48')]({'where':{'name':_0x5e773d,'userProfileId':_0x20b253['userProfileId']},'raw':!![]})['then'](function(_0x44e918){if(_0x44e918&&_0x44e918[_0x1cb9('0x4f')]===0x0){return db[_0x1cb9('0x22')]['create']({'name':_0x4a4b87[_0x1cb9('0x27')],'resourceId':_0x4a4b87['id'],'type':_0x44e918[_0x1cb9('0x27')],'sectionId':_0x44e918['id']},{})['then'](function(){return _0x1e073d;});}else{return _0x1e073d;}})['catch'](function(_0x398d9d){logger[_0x1cb9('0x25')](_0x1cb9('0x50'),_0x398d9d);throw _0x398d9d;});}return _0x1e073d;})[_0x1cb9('0x20')](respondWithResult(_0x48dd4a,0xc9))[_0x1cb9('0x44')](handleError(_0x48dd4a,null));};exports[_0x1cb9('0x51')]=function(_0x17ce94,_0x5912f9){var _0x345ddd={'raw':![],'where':{'id':_0x17ce94[_0x1cb9('0x46')]['id']}},_0x2607c7={};_0x2607c7['model']=_[_0x1cb9('0x2a')](db[_0x1cb9('0x40')][_0x1cb9('0x29')]);_0x345ddd[_0x1cb9('0x30')]=_[_0x1cb9('0x2e')](_0x2607c7[_0x1cb9('0x2f')],qs['fields'](_0x17ce94[_0x1cb9('0x2b')][_0x1cb9('0x31')]));_0x345ddd[_0x1cb9('0x30')]=_0x345ddd[_0x1cb9('0x30')][_0x1cb9('0x32')]?_0x345ddd[_0x1cb9('0x30')]:_0x2607c7[_0x1cb9('0x2f')];if(_0x17ce94[_0x1cb9('0x2b')][_0x1cb9('0x42')]){_0x345ddd[_0x1cb9('0x43')]=[{'all':!![]}];}_0x345ddd=_[_0x1cb9('0x3b')]({},_0x345ddd,_0x17ce94['options']);return db[_0x1cb9('0x40')][_0x1cb9('0x48')](_0x345ddd)[_0x1cb9('0x20')](handleEntityNotFound(_0x5912f9,null))[_0x1cb9('0x20')](function(_0x4fc66b){if(_0x4fc66b){var _0x4a9cf8=_0x4fc66b[_0x1cb9('0x4c')]({'plain':!![]});_0x4a9cf8=qs[_0x1cb9('0x52')](_0x4a9cf8,['id',_0x1cb9('0x53'),_0x1cb9('0x54')]);_0x17ce94[_0x1cb9('0x4a')]=_[_0x1cb9('0x52')](_0x17ce94[_0x1cb9('0x4a')],['id',_0x1cb9('0x53'),'updatedAt']);return db['Dashboard'][_0x1cb9('0x49')](_['merge'](_0x4a9cf8,_0x17ce94['body']),{'include':_0x17ce94['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x455c40){var _0x3de895=_0x17ce94[_0x1cb9('0x4b')][_0x1cb9('0x4c')]({'plain':!![]});if(!_0x3de895)throw new Error(_0x1cb9('0x4d'));if(_0x3de895[_0x1cb9('0x4e')]==='user'){var _0x27d7ef=_0x455c40[_0x1cb9('0x4c')]({'plain':!![]});var _0x5a72c8='CustomDashboards';return db[_0x1cb9('0x55')][_0x1cb9('0x48')]({'where':{'name':_0x5a72c8,'userProfileId':_0x3de895[_0x1cb9('0x56')]},'raw':!![]})[_0x1cb9('0x20')](function(_0x13ff8b){if(_0x13ff8b&&_0x13ff8b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x27d7ef[_0x1cb9('0x27')],'resourceId':_0x27d7ef['id'],'type':_0x13ff8b[_0x1cb9('0x27')],'sectionId':_0x13ff8b['id']},{})[_0x1cb9('0x20')](function(){return _0x455c40;});}else{return _0x455c40;}})[_0x1cb9('0x44')](function(_0x349f33){logger['error'](_0x1cb9('0x50'),_0x349f33);throw _0x349f33;});}return _0x455c40;});}})[_0x1cb9('0x20')](respondWithResult(_0x5912f9,0xc9))['catch'](handleError(_0x5912f9,null));};exports['update']=function(_0x1d914d,_0x49c03a){if(_0x1d914d[_0x1cb9('0x4a')]['id']){delete _0x1d914d[_0x1cb9('0x4a')]['id'];}return db[_0x1cb9('0x40')][_0x1cb9('0x48')]({'where':{'id':_0x1d914d[_0x1cb9('0x46')]['id']}})[_0x1cb9('0x20')](handleEntityNotFound(_0x49c03a,null))['then'](saveUpdates(_0x1d914d[_0x1cb9('0x4a')],null))[_0x1cb9('0x20')](respondWithResult(_0x49c03a,null))[_0x1cb9('0x44')](handleError(_0x49c03a,null));};exports[_0x1cb9('0x23')]=function(_0x5b5f0d,_0x520d98){return db[_0x1cb9('0x40')][_0x1cb9('0x48')]({'where':{'id':_0x5b5f0d[_0x1cb9('0x46')]['id']}})[_0x1cb9('0x20')](handleEntityNotFound(_0x520d98,null))[_0x1cb9('0x20')](removeEntity(_0x520d98,null))[_0x1cb9('0x44')](handleError(_0x520d98,null));};function widgetAttributes(_0x4f8756){try{switch(_0x4f8756[_0x1cb9('0x3d')]){case'iframe':return[{'name':_0x1cb9('0x57'),'value':_0x4f8756[_0x1cb9('0x57')]||(_0x4f8756['attrs']&&_0x4f8756[_0x1cb9('0x58')][0x0]?_0x4f8756[_0x1cb9('0x58')][0x0][_0x1cb9('0x59')]:undefined)||'https://'}];case _0x1cb9('0x5a'):return[{'name':_0x1cb9('0x5b'),'value':_0x4f8756[_0x1cb9('0x5b')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x0]?_0x4f8756[_0x1cb9('0x58')][0x0]['value']:undefined)||''}];case _0x1cb9('0x5c'):return[{'name':_0x1cb9('0x5d'),'value':_0x4f8756[_0x1cb9('0x5d')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x0]?_0x4f8756[_0x1cb9('0x58')][0x0][_0x1cb9('0x59')]:undefined)||_0x1cb9('0x5e')},{'name':'attrTimezone','value':_0x4f8756[_0x1cb9('0x5f')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756['attrs'][0x1]?_0x4f8756[_0x1cb9('0x58')][0x1]['value']:undefined)||_0x1cb9('0x60')},{'name':'attrFontSize','value':_0x4f8756['attrFontSize']||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x2]?_0x4f8756['attrs'][0x2][_0x1cb9('0x59')]:undefined)||0xc}];case'counter':return[{'name':_0x1cb9('0x61'),'value':_0x4f8756[_0x1cb9('0x61')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x0]?_0x4f8756['attrs'][0x0][_0x1cb9('0x59')]:undefined)||_0x1cb9('0x62')},{'name':_0x1cb9('0x63'),'value':_0x4f8756[_0x1cb9('0x63')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x1]?_0x4f8756['attrs'][0x1][_0x1cb9('0x59')]:undefined)||[]},{'name':_0x1cb9('0x64'),'value':_0x4f8756[_0x1cb9('0x64')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x2]?_0x4f8756[_0x1cb9('0x58')][0x2]['value']:undefined)||0x14}];case _0x1cb9('0x65'):case _0x1cb9('0x66'):return[{'name':'attrSerie1','value':_0x4f8756[_0x1cb9('0x67')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x0]?_0x4f8756[_0x1cb9('0x58')][0x0][_0x1cb9('0x59')]:undefined)||_0x1cb9('0x62')},{'name':_0x1cb9('0x68'),'value':_0x4f8756['attrSerie2']||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756['attrs'][0x1]?_0x4f8756[_0x1cb9('0x58')][0x1][_0x1cb9('0x59')]:undefined)||null},{'name':'attrSerie3','value':_0x4f8756[_0x1cb9('0x69')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x2]?_0x4f8756[_0x1cb9('0x58')][0x2]['value']:undefined)||null},{'name':_0x1cb9('0x63'),'value':_0x4f8756[_0x1cb9('0x63')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756['attrs'][0x3]?_0x4f8756[_0x1cb9('0x58')][0x3][_0x1cb9('0x59')]:undefined)||[]}];case _0x1cb9('0x6a'):return[{'name':_0x1cb9('0x6b'),'type':_0x4f8756[_0x1cb9('0x6c')]||null,'value':_0x4f8756[_0x1cb9('0x6b')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756['attrs'][0x0]?_0x4f8756[_0x1cb9('0x58')][0x0]['value']:undefined)||null},{'name':_0x1cb9('0x6d'),'value':_0x4f8756[_0x1cb9('0x6d')]||(_0x4f8756[_0x1cb9('0x58')]&&_0x4f8756[_0x1cb9('0x58')][0x1]?_0x4f8756['attrs'][0x1][_0x1cb9('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x89d19b){logger['error'](_0x1cb9('0x6e'),JSON[_0x1cb9('0x6f')](_0x89d19b));return[];}}exports[_0x1cb9('0x70')]=function(_0x27532a,_0x453fa3,_0x52a3f1){if(_0x27532a['body']['id']){delete _0x27532a['body']['id'];}return db['Dashboard'][_0x1cb9('0x48')]({'where':{'id':_0x27532a[_0x1cb9('0x46')]['id']}})[_0x1cb9('0x20')](handleEntityNotFound(_0x453fa3,null))[_0x1cb9('0x20')](function(_0x3534b6){if(_0x3534b6){_0x27532a[_0x1cb9('0x4a')][_0x1cb9('0x71')]=_0x3534b6['id'];_0x27532a[_0x1cb9('0x4a')]['attrs']=widgetAttributes(_0x27532a[_0x1cb9('0x4a')]);return db[_0x1cb9('0x72')][_0x1cb9('0x49')](_0x27532a['body']);}})[_0x1cb9('0x20')](respondWithResult(_0x453fa3,null))[_0x1cb9('0x44')](handleError(_0x453fa3,null));};exports['getItems']=function(_0x287441,_0x31cc7c,_0x887adc){var _0x466dc7={};var _0x5cb5e5={};var _0x2c0416;var _0x282ffa;return db['Dashboard']['findOne']({'where':{'id':_0x287441[_0x1cb9('0x46')]['id']}})[_0x1cb9('0x20')](handleEntityNotFound(_0x31cc7c,null))['then'](function(_0x4e45f8){if(_0x4e45f8){_0x2c0416=_0x4e45f8;_0x5cb5e5[_0x1cb9('0x2f')]=_[_0x1cb9('0x2a')](db['DashboardItem']['rawAttributes']);_0x5cb5e5[_0x1cb9('0x2b')]=_['keys'](_0x287441['query']);_0x5cb5e5['filters']=_[_0x1cb9('0x2e')](_0x5cb5e5['model'],_0x5cb5e5[_0x1cb9('0x2b')]);_0x466dc7[_0x1cb9('0x30')]=_[_0x1cb9('0x2e')](_0x5cb5e5['model'],qs[_0x1cb9('0x31')](_0x287441[_0x1cb9('0x2b')][_0x1cb9('0x31')]));_0x466dc7['attributes']=_0x466dc7[_0x1cb9('0x30')][_0x1cb9('0x32')]?_0x466dc7[_0x1cb9('0x30')]:_0x5cb5e5[_0x1cb9('0x2f')];_0x466dc7[_0x1cb9('0x35')]=qs['sort'](_0x287441[_0x1cb9('0x2b')][_0x1cb9('0x73')]);_0x466dc7[_0x1cb9('0x36')]=qs['filters'](_[_0x1cb9('0x37')](_0x287441[_0x1cb9('0x2b')],_0x5cb5e5[_0x1cb9('0x2d')]));if(_0x287441[_0x1cb9('0x2b')][_0x1cb9('0x3f')]){_0x466dc7['where']=_[_0x1cb9('0x3b')](_0x466dc7[_0x1cb9('0x36')],{'$or':_[_0x1cb9('0x3c')](_0x466dc7[_0x1cb9('0x30')],function(_0x2f19e5){var _0x1768b8={};_0x1768b8[_0x2f19e5]={'$like':'%'+_0x287441[_0x1cb9('0x2b')][_0x1cb9('0x3f')]+'%'};return _0x1768b8;})});}_0x466dc7=_[_0x1cb9('0x3b')]({},_0x466dc7,_0x287441[_0x1cb9('0x47')]);return _0x2c0416[_0x1cb9('0x74')](_0x466dc7);}})[_0x1cb9('0x20')](function(_0x2f334c){if(_0x2f334c){_0x282ffa=_0x2f334c[_0x1cb9('0x32')];if(!_0x287441[_0x1cb9('0x2b')][_0x1cb9('0x33')](_0x1cb9('0x34'))){_0x466dc7[_0x1cb9('0x1a')]=qs['limit'](_0x287441['query'][_0x1cb9('0x1a')]);_0x466dc7[_0x1cb9('0x19')]=qs[_0x1cb9('0x19')](_0x287441[_0x1cb9('0x2b')][_0x1cb9('0x19')]);}return _0x2c0416[_0x1cb9('0x74')](_0x466dc7);}})[_0x1cb9('0x20')](function(_0x56251d){if(_0x56251d){return _0x56251d?{'count':_0x282ffa,'rows':_0x56251d}:null;}})['then'](respondWithResult(_0x31cc7c,null))[_0x1cb9('0x44')](handleError(_0x31cc7c,null));};
\ No newline at end of file
+var _0xb43b=['map','type','key','filter','options','count','includeAll','Dashboard','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','CustomDashboards','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','get','omit','createdAt','updatedAt','role','autoAssociation','update','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./dashboard.socket','sendStatus','status','offset','limit','json','apply','reject','then','destroy','UserProfileResource','end','error','stack','name','send','keys','query','dateStart','dateEnd','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','add','day','where','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4364fa,_0x2b48e3){_0x4364fa=_0x4364fa-0x0;var _0x11c977=_0xb43b[_0x4364fa];return _0x11c977;};'use strict';var pdf=require(_0xbb43('0x0'));var emlformat=require(_0xbb43('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb43('0x2'));var jsonpatch=require(_0xbb43('0x3'));var rp=require(_0xbb43('0x4'));var moment=require('moment');var BPromise=require(_0xbb43('0x5'));var Mustache=require(_0xbb43('0x6'));var util=require(_0xbb43('0x7'));var path=require(_0xbb43('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb43('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xbb43('0x11'))(_0xbb43('0x12'));var utils=require(_0xbb43('0x13'));var config=require(_0xbb43('0x14'));var db=require(_0xbb43('0x15'))['db'];config[_0xbb43('0x16')]=_['defaults'](config[_0xbb43('0x16')],{'host':_0xbb43('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbb43('0x18'))['register'](socket);function respondWithStatusCode(_0x593d0b,_0x438591){_0x438591=_0x438591||0xcc;return function(_0x5a509f){if(_0x5a509f){return _0x593d0b[_0xbb43('0x19')](_0x438591);}return _0x593d0b[_0xbb43('0x1a')](_0x438591)['end']();};}function respondWithResult(_0x4a6e18,_0x4d5bcf){_0x4d5bcf=_0x4d5bcf||0xc8;return function(_0x338120){if(_0x338120){return _0x4a6e18[_0xbb43('0x1a')](_0x4d5bcf)['json'](_0x338120);}};}function respondWithFilteredResult(_0x526330,_0x202980){return function(_0x563ce1){if(_0x563ce1){var _0x5923dc=_0x563ce1['count'],_0x2b0797=_0x202980[_0xbb43('0x1b')],_0x8242ab=_0x202980['offset']+_0x202980[_0xbb43('0x1c')],_0x2e3b43;if(_0x8242ab>=_0x5923dc){_0x8242ab=_0x5923dc;_0x2e3b43=0xc8;}else{_0x2e3b43=0xce;}_0x526330[_0xbb43('0x1a')](_0x2e3b43);return _0x526330['set']('Content-Range',_0x2b0797+'-'+_0x8242ab+'/'+_0x5923dc)[_0xbb43('0x1d')](_0x563ce1);}return null;};}function patchUpdates(_0x1b6e69){return function(_0xdb7f2e){try{jsonpatch[_0xbb43('0x1e')](_0xdb7f2e,_0x1b6e69,!![]);}catch(_0x5bcce7){return BPromise[_0xbb43('0x1f')](_0x5bcce7);}return _0xdb7f2e['save']();};}function saveUpdates(_0x3a257d,_0x4bfaca){return function(_0x2f5e31){if(_0x2f5e31){return _0x2f5e31['update'](_0x3a257d)[_0xbb43('0x20')](function(_0x451cbd){return _0x451cbd;});}return null;};}function removeEntity(_0x577ddd,_0x1d0768){return function(_0x4dfb7f){if(_0x4dfb7f){return _0x4dfb7f[_0xbb43('0x21')]()[_0xbb43('0x20')](function(){var _0x16384e=_0x4dfb7f['get']({'plain':!![]});var _0x53f0d5='CustomDashboards';return db[_0xbb43('0x22')][_0xbb43('0x21')]({'where':{'type':_0x53f0d5,'resourceId':_0x16384e['id']}})['then'](function(){return _0x4dfb7f;});})[_0xbb43('0x20')](function(){_0x577ddd[_0xbb43('0x1a')](0xcc)[_0xbb43('0x23')]();});}};}function handleEntityNotFound(_0x3874fb,_0x4ed43f){return function(_0x4b5342){if(!_0x4b5342){_0x3874fb[_0xbb43('0x19')](0x194);}return _0x4b5342;};}function handleError(_0x42800f,_0xa88db0){_0xa88db0=_0xa88db0||0x1f4;return function(_0x8b3205){logger[_0xbb43('0x24')](_0x8b3205[_0xbb43('0x25')]);if(_0x8b3205[_0xbb43('0x26')]){delete _0x8b3205[_0xbb43('0x26')];}_0x42800f['status'](_0xa88db0)[_0xbb43('0x27')](_0x8b3205);};}exports['index']=function(_0x31fbc8,_0x436fd5){var _0x34f5b2={},_0x1880cd={},_0x555b99={'count':0x0,'rows':[]};var _0x157d62=db['Dashboard']['rawAttributes'];_0x1880cd['model']=_[_0xbb43('0x28')](_0x157d62);var _0x573a05={'dateStart':_0x31fbc8[_0xbb43('0x29')][_0xbb43('0x2a')],'dateEnd':_0x31fbc8[_0xbb43('0x29')]['dateEnd']};delete _0x31fbc8[_0xbb43('0x29')][_0xbb43('0x2a')];delete _0x31fbc8[_0xbb43('0x29')][_0xbb43('0x2b')];_0x1880cd[_0xbb43('0x29')]=_[_0xbb43('0x28')](_0x31fbc8[_0xbb43('0x29')]);_0x1880cd[_0xbb43('0x2c')]=_['intersection'](_0x1880cd[_0xbb43('0x2d')],_0x1880cd[_0xbb43('0x29')]);_0x34f5b2[_0xbb43('0x2e')]=_[_0xbb43('0x2f')](_0x1880cd[_0xbb43('0x2d')],qs[_0xbb43('0x30')](_0x31fbc8[_0xbb43('0x29')][_0xbb43('0x30')]));_0x34f5b2[_0xbb43('0x2e')]=_0x34f5b2[_0xbb43('0x2e')][_0xbb43('0x31')]?_0x34f5b2[_0xbb43('0x2e')]:_0x1880cd[_0xbb43('0x2d')];if(!_0x31fbc8[_0xbb43('0x29')][_0xbb43('0x32')](_0xbb43('0x33'))){_0x34f5b2['limit']=qs[_0xbb43('0x1c')](_0x31fbc8[_0xbb43('0x29')]['limit']);_0x34f5b2[_0xbb43('0x1b')]=qs[_0xbb43('0x1b')](_0x31fbc8[_0xbb43('0x29')]['offset']);}_0x34f5b2['order']=qs['sort'](_0x31fbc8[_0xbb43('0x29')][_0xbb43('0x34')]);_0x34f5b2['where']=qs['filters'](_[_0xbb43('0x35')](_0x31fbc8[_0xbb43('0x29')],_0x1880cd[_0xbb43('0x2c')]));if(_0x573a05[_0xbb43('0x2a')]){if(_0x573a05[_0xbb43('0x2b')]){_0x573a05['dateEnd']=moment(_0x573a05[_0xbb43('0x2b')])[_0xbb43('0x36')](0x1,_0xbb43('0x37'));}else{_0x573a05[_0xbb43('0x2b')]=moment(_0x573a05[_0xbb43('0x2a')])['add'](0x1,_0xbb43('0x37'));}_['merge'](_0x34f5b2[_0xbb43('0x38')],{'createdAt':{'$gte':_0x573a05[_0xbb43('0x2a')],'$lte':_0x573a05['dateEnd']}});}if(_0x31fbc8[_0xbb43('0x29')]['filter']){_0x34f5b2[_0xbb43('0x38')]=_[_0xbb43('0x39')](_0x34f5b2[_0xbb43('0x38')],{'$or':_[_0xbb43('0x3a')](_0x157d62,function(_0x5d864a){if(_0x5d864a[_0xbb43('0x3b')][_0xbb43('0x3c')]!=='VIRTUAL'){var _0x3443f8={};_0x3443f8[_0x5d864a['field']]={'$like':'%'+_0x31fbc8[_0xbb43('0x29')][_0xbb43('0x3d')]+'%'};return _0x3443f8;}})});}_0x34f5b2=_[_0xbb43('0x39')]({},_0x34f5b2,_0x31fbc8[_0xbb43('0x3e')]);var _0x37ffb7={'where':_0x34f5b2[_0xbb43('0x38')]};return db['Dashboard'][_0xbb43('0x3f')](_0x37ffb7)['then'](function(_0x307f1e){_0x555b99[_0xbb43('0x3f')]=_0x307f1e;if(_0x31fbc8[_0xbb43('0x29')][_0xbb43('0x40')]){_0x34f5b2['include']=[{'all':!![]}];}return db[_0xbb43('0x41')][_0xbb43('0x42')](_0x34f5b2);})[_0xbb43('0x20')](function(_0x24ba15){_0x555b99[_0xbb43('0x43')]=_0x24ba15;return _0x555b99;})[_0xbb43('0x20')](respondWithFilteredResult(_0x436fd5,_0x34f5b2))[_0xbb43('0x44')](handleError(_0x436fd5,null));};exports[_0xbb43('0x45')]=function(_0x5a662b,_0x2eaece){var _0x8c57af={'raw':![],'where':{'id':_0x5a662b[_0xbb43('0x46')]['id']}},_0x4898b2={};_0x4898b2['model']=_['keys'](db['Dashboard']['rawAttributes']);_0x4898b2[_0xbb43('0x29')]=_['keys'](_0x5a662b[_0xbb43('0x29')]);_0x4898b2['filters']=_[_0xbb43('0x2f')](_0x4898b2[_0xbb43('0x2d')],_0x4898b2[_0xbb43('0x29')]);_0x8c57af['attributes']=_[_0xbb43('0x2f')](_0x4898b2['model'],qs[_0xbb43('0x30')](_0x5a662b[_0xbb43('0x29')][_0xbb43('0x30')]));_0x8c57af[_0xbb43('0x2e')]=_0x8c57af[_0xbb43('0x2e')][_0xbb43('0x31')]?_0x8c57af[_0xbb43('0x2e')]:_0x4898b2['model'];if(_0x5a662b[_0xbb43('0x29')][_0xbb43('0x40')]){_0x8c57af[_0xbb43('0x47')]=[{'all':!![]}];}_0x8c57af=_[_0xbb43('0x39')]({},_0x8c57af,_0x5a662b['options']);return db[_0xbb43('0x41')][_0xbb43('0x48')](_0x8c57af)[_0xbb43('0x20')](handleEntityNotFound(_0x2eaece,null))[_0xbb43('0x20')](respondWithResult(_0x2eaece,null))['catch'](handleError(_0x2eaece,null));};exports[_0xbb43('0x49')]=function(_0x3fdb10,_0x427618){return db['Dashboard'][_0xbb43('0x49')](_0x3fdb10[_0xbb43('0x4a')],{})[_0xbb43('0x20')](function(_0x1dc40a){var _0x3402f2=_0x3fdb10['user']['get']({'plain':!![]});if(!_0x3402f2)throw new Error(_0xbb43('0x4b'));if(_0x3402f2['role']===_0xbb43('0x4c')){var _0xe0cdba=_0x1dc40a['get']({'plain':!![]});var _0x29aea0=_0xbb43('0x4d');return db[_0xbb43('0x4e')][_0xbb43('0x48')]({'where':{'name':_0x29aea0,'userProfileId':_0x3402f2[_0xbb43('0x4f')]},'raw':!![]})['then'](function(_0x124f88){if(_0x124f88&&_0x124f88['autoAssociation']===0x0){return db['UserProfileResource'][_0xbb43('0x49')]({'name':_0xe0cdba[_0xbb43('0x26')],'resourceId':_0xe0cdba['id'],'type':_0x124f88[_0xbb43('0x26')],'sectionId':_0x124f88['id']},{})[_0xbb43('0x20')](function(){return _0x1dc40a;});}else{return _0x1dc40a;}})[_0xbb43('0x44')](function(_0x5db053){logger['error'](_0xbb43('0x50'),_0x5db053);throw _0x5db053;});}return _0x1dc40a;})[_0xbb43('0x20')](respondWithResult(_0x427618,0xc9))[_0xbb43('0x44')](handleError(_0x427618,null));};exports[_0xbb43('0x51')]=function(_0x99cb09,_0x38d540){var _0x44691b={'raw':![],'where':{'id':_0x99cb09[_0xbb43('0x46')]['id']}},_0x14fce0={};_0x14fce0['model']=_[_0xbb43('0x28')](db[_0xbb43('0x41')][_0xbb43('0x52')]);_0x44691b[_0xbb43('0x2e')]=_[_0xbb43('0x2f')](_0x14fce0[_0xbb43('0x2d')],qs[_0xbb43('0x30')](_0x99cb09[_0xbb43('0x29')][_0xbb43('0x30')]));_0x44691b['attributes']=_0x44691b['attributes'][_0xbb43('0x31')]?_0x44691b[_0xbb43('0x2e')]:_0x14fce0[_0xbb43('0x2d')];if(_0x99cb09[_0xbb43('0x29')][_0xbb43('0x40')]){_0x44691b[_0xbb43('0x47')]=[{'all':!![]}];}_0x44691b=_[_0xbb43('0x39')]({},_0x44691b,_0x99cb09['options']);return db[_0xbb43('0x41')]['find'](_0x44691b)['then'](handleEntityNotFound(_0x38d540,null))[_0xbb43('0x20')](function(_0x1f626a){if(_0x1f626a){var _0x3cccea=_0x1f626a[_0xbb43('0x53')]({'plain':!![]});_0x3cccea=qs[_0xbb43('0x54')](_0x3cccea,['id',_0xbb43('0x55'),_0xbb43('0x56')]);_0x99cb09[_0xbb43('0x4a')]=_['omit'](_0x99cb09['body'],['id',_0xbb43('0x55'),_0xbb43('0x56')]);return db[_0xbb43('0x41')][_0xbb43('0x49')](_[_0xbb43('0x39')](_0x3cccea,_0x99cb09[_0xbb43('0x4a')]),{'include':_0x99cb09[_0xbb43('0x29')][_0xbb43('0x40')]?[{'all':!![]}]:undefined})[_0xbb43('0x20')](function(_0x555426){var _0x165936=_0x99cb09[_0xbb43('0x4c')][_0xbb43('0x53')]({'plain':!![]});if(!_0x165936)throw new Error(_0xbb43('0x4b'));if(_0x165936[_0xbb43('0x57')]===_0xbb43('0x4c')){var _0x5745eb=_0x555426[_0xbb43('0x53')]({'plain':!![]});var _0xb48be2=_0xbb43('0x4d');return db[_0xbb43('0x4e')][_0xbb43('0x48')]({'where':{'name':_0xb48be2,'userProfileId':_0x165936['userProfileId']},'raw':!![]})[_0xbb43('0x20')](function(_0x6f04b3){if(_0x6f04b3&&_0x6f04b3[_0xbb43('0x58')]===0x0){return db[_0xbb43('0x22')][_0xbb43('0x49')]({'name':_0x5745eb[_0xbb43('0x26')],'resourceId':_0x5745eb['id'],'type':_0x6f04b3[_0xbb43('0x26')],'sectionId':_0x6f04b3['id']},{})[_0xbb43('0x20')](function(){return _0x555426;});}else{return _0x555426;}})[_0xbb43('0x44')](function(_0x3ab906){logger['error'](_0xbb43('0x50'),_0x3ab906);throw _0x3ab906;});}return _0x555426;});}})['then'](respondWithResult(_0x38d540,0xc9))[_0xbb43('0x44')](handleError(_0x38d540,null));};exports[_0xbb43('0x59')]=function(_0x37d6d7,_0x3dbcd9){if(_0x37d6d7[_0xbb43('0x4a')]['id']){delete _0x37d6d7['body']['id'];}return db['Dashboard'][_0xbb43('0x48')]({'where':{'id':_0x37d6d7[_0xbb43('0x46')]['id']}})['then'](handleEntityNotFound(_0x3dbcd9,null))[_0xbb43('0x20')](saveUpdates(_0x37d6d7[_0xbb43('0x4a')],null))[_0xbb43('0x20')](respondWithResult(_0x3dbcd9,null))[_0xbb43('0x44')](handleError(_0x3dbcd9,null));};exports[_0xbb43('0x21')]=function(_0x298a77,_0x3b89ec){return db[_0xbb43('0x41')][_0xbb43('0x48')]({'where':{'id':_0x298a77[_0xbb43('0x46')]['id']}})[_0xbb43('0x20')](handleEntityNotFound(_0x3b89ec,null))[_0xbb43('0x20')](removeEntity(_0x3b89ec,null))[_0xbb43('0x44')](handleError(_0x3b89ec,null));};function widgetAttributes(_0x26509c){try{switch(_0x26509c['type']){case'iframe':return[{'name':_0xbb43('0x5a'),'value':_0x26509c[_0xbb43('0x5a')]||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c['attrs'][0x0]?_0x26509c[_0xbb43('0x5b')][0x0][_0xbb43('0x5c')]:undefined)||_0xbb43('0x5d')}];case _0xbb43('0x5e'):return[{'name':_0xbb43('0x5f'),'value':_0x26509c['attrPath']||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x0]?_0x26509c[_0xbb43('0x5b')][0x0]['value']:undefined)||''}];case _0xbb43('0x60'):return[{'name':_0xbb43('0x61'),'value':_0x26509c[_0xbb43('0x61')]||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x0]?_0x26509c[_0xbb43('0x5b')][0x0][_0xbb43('0x5c')]:undefined)||_0xbb43('0x62')},{'name':_0xbb43('0x63'),'value':_0x26509c[_0xbb43('0x63')]||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c['attrs'][0x1]?_0x26509c[_0xbb43('0x5b')][0x1][_0xbb43('0x5c')]:undefined)||_0xbb43('0x64')},{'name':_0xbb43('0x65'),'value':_0x26509c[_0xbb43('0x65')]||(_0x26509c['attrs']&&_0x26509c['attrs'][0x2]?_0x26509c['attrs'][0x2][_0xbb43('0x5c')]:undefined)||0xc}];case _0xbb43('0x66'):return[{'name':_0xbb43('0x67'),'value':_0x26509c[_0xbb43('0x67')]||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x0]?_0x26509c[_0xbb43('0x5b')][0x0]['value']:undefined)||_0xbb43('0x68')},{'name':_0xbb43('0x69'),'value':_0x26509c[_0xbb43('0x69')]||(_0x26509c['attrs']&&_0x26509c[_0xbb43('0x5b')][0x1]?_0x26509c['attrs'][0x1][_0xbb43('0x5c')]:undefined)||[]},{'name':'attrFontSize','value':_0x26509c[_0xbb43('0x65')]||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x2]?_0x26509c[_0xbb43('0x5b')][0x2][_0xbb43('0x5c')]:undefined)||0x14}];case _0xbb43('0x6a'):case _0xbb43('0x6b'):return[{'name':_0xbb43('0x6c'),'value':_0x26509c['attrSerie1']||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x0]?_0x26509c['attrs'][0x0][_0xbb43('0x5c')]:undefined)||_0xbb43('0x68')},{'name':_0xbb43('0x6d'),'value':_0x26509c['attrSerie2']||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x1]?_0x26509c[_0xbb43('0x5b')][0x1][_0xbb43('0x5c')]:undefined)||null},{'name':_0xbb43('0x6e'),'value':_0x26509c[_0xbb43('0x6e')]||(_0x26509c['attrs']&&_0x26509c[_0xbb43('0x5b')][0x2]?_0x26509c['attrs'][0x2][_0xbb43('0x5c')]:undefined)||null},{'name':_0xbb43('0x69'),'value':_0x26509c['attrVoiceQueues']||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x3]?_0x26509c['attrs'][0x3]['value']:undefined)||[]}];case _0xbb43('0x6f'):return[{'name':_0xbb43('0x70'),'type':_0x26509c[_0xbb43('0x71')]||null,'value':_0x26509c[_0xbb43('0x70')]||(_0x26509c[_0xbb43('0x5b')]&&_0x26509c[_0xbb43('0x5b')][0x0]?_0x26509c[_0xbb43('0x5b')][0x0][_0xbb43('0x5c')]:undefined)||null},{'name':_0xbb43('0x72'),'value':_0x26509c[_0xbb43('0x72')]||(_0x26509c['attrs']&&_0x26509c[_0xbb43('0x5b')][0x1]?_0x26509c[_0xbb43('0x5b')][0x1][_0xbb43('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x5b2892){logger['error'](_0xbb43('0x73'),JSON[_0xbb43('0x74')](_0x5b2892));return[];}}exports[_0xbb43('0x75')]=function(_0x3c1e5a,_0x529c5a,_0x2814fc){if(_0x3c1e5a['body']['id']){delete _0x3c1e5a[_0xbb43('0x4a')]['id'];}return db[_0xbb43('0x41')][_0xbb43('0x48')]({'where':{'id':_0x3c1e5a['params']['id']}})[_0xbb43('0x20')](handleEntityNotFound(_0x529c5a,null))[_0xbb43('0x20')](function(_0x47b468){if(_0x47b468){_0x3c1e5a['body'][_0xbb43('0x76')]=_0x47b468['id'];_0x3c1e5a[_0xbb43('0x4a')][_0xbb43('0x5b')]=widgetAttributes(_0x3c1e5a[_0xbb43('0x4a')]);return db[_0xbb43('0x77')][_0xbb43('0x49')](_0x3c1e5a[_0xbb43('0x4a')]);}})[_0xbb43('0x20')](respondWithResult(_0x529c5a,null))['catch'](handleError(_0x529c5a,null));};exports[_0xbb43('0x78')]=function(_0x38f6a5,_0xd5dfc8,_0x7d2f5c){var _0x49c2e9={};var _0x430c02={};var _0x58bc68;var _0x48d36b;return db[_0xbb43('0x41')][_0xbb43('0x79')]({'where':{'id':_0x38f6a5[_0xbb43('0x46')]['id']}})['then'](handleEntityNotFound(_0xd5dfc8,null))['then'](function(_0x4ef475){if(_0x4ef475){_0x58bc68=_0x4ef475;_0x430c02[_0xbb43('0x2d')]=_[_0xbb43('0x28')](db[_0xbb43('0x77')][_0xbb43('0x52')]);_0x430c02[_0xbb43('0x29')]=_['keys'](_0x38f6a5[_0xbb43('0x29')]);_0x430c02['filters']=_[_0xbb43('0x2f')](_0x430c02['model'],_0x430c02['query']);_0x49c2e9['attributes']=_[_0xbb43('0x2f')](_0x430c02[_0xbb43('0x2d')],qs['fields'](_0x38f6a5[_0xbb43('0x29')][_0xbb43('0x30')]));_0x49c2e9[_0xbb43('0x2e')]=_0x49c2e9[_0xbb43('0x2e')][_0xbb43('0x31')]?_0x49c2e9[_0xbb43('0x2e')]:_0x430c02[_0xbb43('0x2d')];_0x49c2e9[_0xbb43('0x7a')]=qs[_0xbb43('0x34')](_0x38f6a5[_0xbb43('0x29')][_0xbb43('0x34')]);_0x49c2e9['where']=qs[_0xbb43('0x2c')](_[_0xbb43('0x35')](_0x38f6a5[_0xbb43('0x29')],_0x430c02[_0xbb43('0x2c')]));if(_0x38f6a5[_0xbb43('0x29')][_0xbb43('0x3d')]){_0x49c2e9[_0xbb43('0x38')]=_[_0xbb43('0x39')](_0x49c2e9[_0xbb43('0x38')],{'$or':_[_0xbb43('0x3a')](_0x49c2e9[_0xbb43('0x2e')],function(_0x502b36){var _0x5ea9fb={};_0x5ea9fb[_0x502b36]={'$like':'%'+_0x38f6a5[_0xbb43('0x29')][_0xbb43('0x3d')]+'%'};return _0x5ea9fb;})});}_0x49c2e9=_['merge']({},_0x49c2e9,_0x38f6a5[_0xbb43('0x3e')]);return _0x58bc68['getItems'](_0x49c2e9);}})[_0xbb43('0x20')](function(_0x4683ce){if(_0x4683ce){_0x48d36b=_0x4683ce[_0xbb43('0x31')];if(!_0x38f6a5[_0xbb43('0x29')][_0xbb43('0x32')](_0xbb43('0x33'))){_0x49c2e9['limit']=qs[_0xbb43('0x1c')](_0x38f6a5[_0xbb43('0x29')][_0xbb43('0x1c')]);_0x49c2e9[_0xbb43('0x1b')]=qs[_0xbb43('0x1b')](_0x38f6a5[_0xbb43('0x29')][_0xbb43('0x1b')]);}return _0x58bc68[_0xbb43('0x78')](_0x49c2e9);}})[_0xbb43('0x20')](function(_0x32ce38){if(_0x32ce38){return _0x32ce38?{'count':_0x48d36b,'rows':_0x32ce38}:null;}})[_0xbb43('0x20')](respondWithResult(_0xd5dfc8,null))[_0xbb43('0x44')](handleError(_0xd5dfc8,null));};
\ No newline at end of file
index 00d813c..c637891 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa65e=['hook','exports','../../mysqldb','Dashboard','save','update','remove','emit','hasOwnProperty'];(function(_0x27d513,_0x3123fc){var _0xd370b9=function(_0xfe61f2){while(--_0xfe61f2){_0x27d513['push'](_0x27d513['shift']());}};_0xd370b9(++_0x3123fc);}(_0xa65e,0xd1));var _0xea65=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xa65e[_0x27e811];return _0x1627fa;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xea65('0x0'))['db'][_0xea65('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xea65('0x2'),'afterUpdate':_0xea65('0x3'),'afterDestroy':_0xea65('0x4')};function emitEvent(_0x234b9d){return function(_0x1af138,_0x4c89d9,_0x36337e){DashboardEvents[_0xea65('0x5')](_0x234b9d+':'+_0x1af138['id'],_0x1af138);DashboardEvents[_0xea65('0x5')](_0x234b9d,_0x1af138);_0x36337e(null);};}for(var e in events){if(events[_0xea65('0x6')](e)){var event=events[e];Dashboard[_0xea65('0x7')](e,emitEvent(event));}}module[_0xea65('0x8')]=DashboardEvents;
\ No newline at end of file
+var _0x3c08=['../../mysqldb','Dashboard','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x3c08,0x1b0));var _0x83c0=function(_0x5e34f2,_0x49b050){_0x5e34f2=_0x5e34f2-0x0;var _0x8e9138=_0x3c08[_0x5e34f2];return _0x8e9138;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x83c0('0x0'))['db'][_0x83c0('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x83c0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x83c0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5dcb45){return function(_0x129847,_0x5a6528,_0x3d9d04){DashboardEvents[_0x83c0('0x4')](_0x5dcb45+':'+_0x129847['id'],_0x129847);DashboardEvents[_0x83c0('0x4')](_0x5dcb45,_0x129847);_0x3d9d04(null);};}for(var e in events){if(events[_0x83c0('0x5')](e)){var event=events[e];Dashboard[_0x83c0('0x6')](e,emitEvent(event));}}module[_0x83c0('0x7')]=DashboardEvents;
\ No newline at end of file
index 2753249..717140b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ccd=['define','Dashboard','dashboards','lodash','../../config/logger','api','request-promise','exports'];(function(_0x51dc25,_0x3824ab){var _0x2efbc4=function(_0x4454dd){while(--_0x4454dd){_0x51dc25['push'](_0x51dc25['shift']());}};_0x2efbc4(++_0x3824ab);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var logger=require(_0xd9cc('0x1'))(_0xd9cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd9cc('0x3'));var attributes=require('./dashboard.attributes');module[_0xd9cc('0x4')]=function(_0x296228,_0x425ab8){return _0x296228[_0xd9cc('0x5')](_0xd9cc('0x6'),attributes,{'tableName':_0xd9cc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b0d=['define','Dashboard','dashboards','util','../../config/logger','api','moment','request-promise','./dashboard.attributes','exports'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x28f721,_0x5b3d12){_0x28f721=_0x28f721-0x0;var _0x5698bd=_0x9b0d[_0x28f721];return _0x5698bd;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var logger=require(_0xd9b0('0x1'))(_0xd9b0('0x2'));var moment=require(_0xd9b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9b0('0x4'));var attributes=require(_0xd9b0('0x5'));module[_0xd9b0('0x6')]=function(_0xe33596,_0x4ae1d0){return _0xe33596[_0xd9b0('0x7')](_0xd9b0('0x8'),attributes,{'tableName':_0xd9b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 546b3fe..7b26fc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf71=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xdf71,0x6f));var _0x1df7=function(_0x7f27a0,_0x15d0e0){_0x7f27a0=_0x7f27a0-0x0;var _0x6f8f3b=_0xdf71[_0x7f27a0];return _0x6f8f3b;};'use strict';var _=require(_0x1df7('0x0'));var util=require(_0x1df7('0x1'));var moment=require(_0x1df7('0x2'));var BPromise=require(_0x1df7('0x3'));var rs=require(_0x1df7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1df7('0x5'))['db'];var utils=require(_0x1df7('0x6'));var logger=require(_0x1df7('0x7'))(_0x1df7('0x8'));var config=require(_0x1df7('0x9'));var jayson=require(_0x1df7('0xa'));var client=jayson[_0x1df7('0xb')][_0x1df7('0xc')]({'port':0x232a});config[_0x1df7('0xd')]=_[_0x1df7('0xe')](config['redis'],{'host':_0x1df7('0xf'),'port':0x18eb});var socket=require(_0x1df7('0x10'))(new Redis(config[_0x1df7('0xd')]));require(_0x1df7('0x11'))['register'](socket);function respondWithRpcPromise(_0x59e2e4,_0x590a00,_0x2b42a7){return new BPromise(function(_0x409994,_0x5e3d68){return client['request'](_0x59e2e4,_0x2b42a7)[_0x1df7('0x12')](function(_0x35eabb){logger[_0x1df7('0x13')](_0x1df7('0x14'),_0x590a00,'request\x20sent');logger[_0x1df7('0x15')](_0x1df7('0x16'),_0x590a00,_0x1df7('0x17'),JSON[_0x1df7('0x18')](_0x35eabb));if(_0x35eabb['error']){if(_0x35eabb['error']['code']===0x1f4){logger[_0x1df7('0x19')](_0x1df7('0x14'),_0x590a00,_0x35eabb[_0x1df7('0x19')][_0x1df7('0x1a')]);return _0x5e3d68(_0x35eabb[_0x1df7('0x19')][_0x1df7('0x1a')]);}logger[_0x1df7('0x19')](_0x1df7('0x14'),_0x590a00,_0x35eabb['error'][_0x1df7('0x1a')]);return _0x409994(_0x35eabb['error']['message']);}else{logger[_0x1df7('0x13')](_0x1df7('0x14'),_0x590a00,'request\x20sent');_0x409994(_0x35eabb[_0x1df7('0x1b')][_0x1df7('0x1a')]);}})[_0x1df7('0x1c')](function(_0x1c1f38){logger[_0x1df7('0x19')](_0x1df7('0x14'),_0x590a00,_0x1c1f38);_0x5e3d68(_0x1c1f38);});});}
\ No newline at end of file
+var _0xec28=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','catch','lodash','moment','bluebird'];(function(_0x49127b,_0x5c3180){var _0x119308=function(_0x1688f2){while(--_0x1688f2){_0x49127b['push'](_0x49127b['shift']());}};_0x119308(++_0x5c3180);}(_0xec28,0xd5));var _0x8ec2=function(_0x4d3d50,_0x50f156){_0x4d3d50=_0x4d3d50-0x0;var _0x175e6d=_0xec28[_0x4d3d50];return _0x175e6d;};'use strict';var _=require(_0x8ec2('0x0'));var util=require('util');var moment=require(_0x8ec2('0x1'));var BPromise=require(_0x8ec2('0x2'));var rs=require(_0x8ec2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8ec2('0x4'))(_0x8ec2('0x5'));var config=require(_0x8ec2('0x6'));var jayson=require(_0x8ec2('0x7'));var client=jayson[_0x8ec2('0x8')]['http']({'port':0x232a});config['redis']=_[_0x8ec2('0x9')](config[_0x8ec2('0xa')],{'host':_0x8ec2('0xb'),'port':0x18eb});var socket=require(_0x8ec2('0xc'))(new Redis(config[_0x8ec2('0xa')]));require(_0x8ec2('0xd'))[_0x8ec2('0xe')](socket);function respondWithRpcPromise(_0x443392,_0x41198b,_0x545dfd){return new BPromise(function(_0xfa8b2d,_0x2cf29b){return client[_0x8ec2('0xf')](_0x443392,_0x545dfd)[_0x8ec2('0x10')](function(_0x21ca96){logger[_0x8ec2('0x11')]('Dashboard,\x20%s,\x20%s',_0x41198b,_0x8ec2('0x12'));logger[_0x8ec2('0x13')](_0x8ec2('0x14'),_0x41198b,_0x8ec2('0x12'),JSON[_0x8ec2('0x15')](_0x21ca96));if(_0x21ca96[_0x8ec2('0x16')]){if(_0x21ca96[_0x8ec2('0x16')][_0x8ec2('0x17')]===0x1f4){logger[_0x8ec2('0x16')](_0x8ec2('0x18'),_0x41198b,_0x21ca96['error'][_0x8ec2('0x19')]);return _0x2cf29b(_0x21ca96[_0x8ec2('0x16')][_0x8ec2('0x19')]);}logger[_0x8ec2('0x16')]('Dashboard,\x20%s,\x20%s',_0x41198b,_0x21ca96[_0x8ec2('0x16')][_0x8ec2('0x19')]);return _0xfa8b2d(_0x21ca96[_0x8ec2('0x16')]['message']);}else{logger[_0x8ec2('0x11')](_0x8ec2('0x18'),_0x41198b,_0x8ec2('0x12'));_0xfa8b2d(_0x21ca96['result'][_0x8ec2('0x19')]);}})[_0x8ec2('0x1a')](function(_0xfb1957){logger[_0x8ec2('0x16')](_0x8ec2('0x18'),_0x41198b,_0xfb1957);_0x2cf29b(_0xfb1957);});});}
\ No newline at end of file
index ee3782b..2562adc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcebd=['./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x51a7d5,_0x468b4b){var _0x51d1f8=function(_0x1f1d6d){while(--_0x1f1d6d){_0x51a7d5['push'](_0x51a7d5['shift']());}};_0x51d1f8(++_0x468b4b);}(_0xcebd,0x181));var _0xdceb=function(_0x1aa4a0,_0x348937){_0x1aa4a0=_0x1aa4a0-0x0;var _0x7cf8a5=_0xcebd[_0x1aa4a0];return _0x7cf8a5;};'use strict';var DashboardEvents=require(_0xdceb('0x0'));var events=[_0xdceb('0x1'),_0xdceb('0x2'),_0xdceb('0x3')];function createListener(_0x47d339,_0x515f4c){return function(_0x5a3c48){_0x515f4c[_0xdceb('0x4')](_0x47d339,_0x5a3c48);};}function removeListener(_0x116a7d,_0x5075e2){return function(){DashboardEvents[_0xdceb('0x5')](_0x116a7d,_0x5075e2);};}exports[_0xdceb('0x6')]=function(_0xf56a83){for(var _0x22700c=0x0,_0x4f79d5=events['length'];_0x22700c<_0x4f79d5;_0x22700c++){var _0x157898=events[_0x22700c];var _0x47ecff=createListener('dashboard:'+_0x157898,_0xf56a83);DashboardEvents['on'](_0x157898,_0x47ecff);}};
\ No newline at end of file
+var _0x9239=['register','length','dashboard:','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9239,0x19b));var _0x9923=function(_0x57daed,_0x578bc3){_0x57daed=_0x57daed-0x0;var _0x1b7cce=_0x9239[_0x57daed];return _0x1b7cce;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x9923('0x0'),_0x9923('0x1'),_0x9923('0x2')];function createListener(_0x280d1f,_0x46f37b){return function(_0x270a51){_0x46f37b[_0x9923('0x3')](_0x280d1f,_0x270a51);};}function removeListener(_0x200006,_0x24299b){return function(){DashboardEvents[_0x9923('0x4')](_0x200006,_0x24299b);};}exports[_0x9923('0x5')]=function(_0x5513e8){for(var _0xc2a5de=0x0,_0x59a338=events[_0x9923('0x6')];_0xc2a5de<_0x59a338;_0xc2a5de++){var _0x22703f=events[_0xc2a5de];var _0x2afc95=createListener(_0x9923('0x7')+_0x22703f,_0x5513e8);DashboardEvents['on'](_0x22703f,_0x2afc95);}};
\ No newline at end of file
index 5020ec3..9a049b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf061=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create','clone','put','update','destroy','exports'];(function(_0x4cb095,_0x58da07){var _0x2b565d=function(_0x4d41b3){while(--_0x4d41b3){_0x4cb095['push'](_0x4cb095['shift']());}};_0x2b565d(++_0x58da07);}(_0xf061,0x7e));var _0x1f06=function(_0x1c2cd1,_0x19868b){_0x1c2cd1=_0x1c2cd1-0x0;var _0x573fd0=_0xf061[_0x1c2cd1];return _0x573fd0;};'use strict';var multer=require(_0x1f06('0x0'));var util=require(_0x1f06('0x1'));var path=require(_0x1f06('0x2'));var timeout=require(_0x1f06('0x3'));var express=require(_0x1f06('0x4'));var router=express[_0x1f06('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1f06('0x6'));var config=require(_0x1f06('0x7'));var controller=require('./dashboard.controller');router[_0x1f06('0x8')]('/',auth[_0x1f06('0x9')](),controller[_0x1f06('0xa')]);router[_0x1f06('0x8')](_0x1f06('0xb'),auth[_0x1f06('0x9')](),controller['show']);router[_0x1f06('0x8')](_0x1f06('0xc'),auth[_0x1f06('0x9')](),controller[_0x1f06('0xd')]);router[_0x1f06('0xe')]('/',auth[_0x1f06('0x9')](),controller[_0x1f06('0xf')]);router[_0x1f06('0xe')]('/:id/clone',auth[_0x1f06('0x9')](),controller[_0x1f06('0x10')]);router[_0x1f06('0xe')](_0x1f06('0xc'),auth[_0x1f06('0x9')](),controller['addItem']);router[_0x1f06('0x11')](_0x1f06('0xb'),auth[_0x1f06('0x9')](),controller[_0x1f06('0x12')]);router['delete'](_0x1f06('0xb'),auth['isAuthenticated'](),controller[_0x1f06('0x13')]);module[_0x1f06('0x14')]=router;
\ No newline at end of file
+var _0xb71b=['getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','get','/:id'];(function(_0x44c7a2,_0x449be7){var _0x3efc90=function(_0x114726){while(--_0x114726){_0x44c7a2['push'](_0x44c7a2['shift']());}};_0x3efc90(++_0x449be7);}(_0xb71b,0x16a));var _0xbb71=function(_0x1f72cc,_0x5b6e2d){_0x1f72cc=_0x1f72cc-0x0;var _0x2618f2=_0xb71b[_0x1f72cc];return _0x2618f2;};'use strict';var multer=require(_0xbb71('0x0'));var util=require(_0xbb71('0x1'));var path=require(_0xbb71('0x2'));var timeout=require(_0xbb71('0x3'));var express=require(_0xbb71('0x4'));var router=express[_0xbb71('0x5')]();var auth=require(_0xbb71('0x6'));var interaction=require(_0xbb71('0x7'));var config=require(_0xbb71('0x8'));var controller=require(_0xbb71('0x9'));router['get']('/',auth[_0xbb71('0xa')](),controller['index']);router[_0xbb71('0xb')](_0xbb71('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbb71('0xb')]('/:id/items',auth['isAuthenticated'](),controller[_0xbb71('0xd')]);router[_0xbb71('0xe')]('/',auth[_0xbb71('0xa')](),controller[_0xbb71('0xf')]);router['post'](_0xbb71('0x10'),auth[_0xbb71('0xa')](),controller[_0xbb71('0x11')]);router[_0xbb71('0xe')](_0xbb71('0x12'),auth['isAuthenticated'](),controller[_0xbb71('0x13')]);router[_0xbb71('0x14')](_0xbb71('0xc'),auth['isAuthenticated'](),controller[_0xbb71('0x15')]);router[_0xbb71('0x16')]('/:id',auth[_0xbb71('0xa')](),controller[_0xbb71('0x17')]);module[_0xbb71('0x18')]=router;
\ No newline at end of file
index 29ddd9b..10ac712 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49c6=['attrs','stringify','setDataValue','INTEGER','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x3820d8,_0x44a971){var _0x3b7e3f=function(_0x5c9e5b){while(--_0x5c9e5b){_0x3820d8['push'](_0x3820d8['shift']());}};_0x3b7e3f(++_0x44a971);}(_0x49c6,0x10d));var _0x649c=function(_0x523212,_0x437cc3){_0x523212=_0x523212-0x0;var _0x38c3b2=_0x49c6[_0x523212];return _0x38c3b2;};'use strict';var Sequelize=require(_0x649c('0x0'));var squel=require('squel');var _=require(_0x649c('0x1'));module[_0x649c('0x2')]={'title':{'type':Sequelize[_0x649c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x649c('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x649c('0x4')](_0x649c('0x5')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x649c('0x6')));}catch(_0x4ad947){return[];}},'set':function(_0x467076){try{this['setDataValue'](_0x649c('0x6'),JSON[_0x649c('0x7')](_0x467076));}catch(_0x1b6562){this[_0x649c('0x8')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x649c('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x649c('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x649c('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x649c('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x649c('0x3')]}};
\ No newline at end of file
+var _0xe8d0=['setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','long','parse','attrs','stringify'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xe8d0,0x17d));var _0x0e8d=function(_0x409766,_0x59ea98){_0x409766=_0x409766-0x0;var _0x1ed066=_0xe8d0[_0x409766];return _0x1ed066;};'use strict';var Sequelize=require(_0x0e8d('0x0'));var squel=require(_0x0e8d('0x1'));var _=require(_0x0e8d('0x2'));module[_0x0e8d('0x3')]={'title':{'type':Sequelize[_0x0e8d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x0e8d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x0e8d('0x5')),'get':function(){try{return JSON[_0x0e8d('0x6')](this['getDataValue'](_0x0e8d('0x7')));}catch(_0x4102a4){return[];}},'set':function(_0x3cdad4){try{this['setDataValue']('attrs',JSON[_0x0e8d('0x8')](_0x3cdad4));}catch(_0xf55f50){this[_0x0e8d('0x9')](_0x0e8d('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x0e8d('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x0e8d('0xa')]},'col':{'type':Sequelize[_0x0e8d('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0e8d('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x0e8d('0x4')],'allowNull':![],'defaultValue':_0x0e8d('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x0e8d('0x4')]}};
\ No newline at end of file
index cdb0b36..2b4ff72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['rawAttributes','filters','query','attributes','fields','length','includeAll','merge','options','find','catch','iframe','attrUrl','attrs','https://','custom','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','error','name','send','show','params','model','keys','DashboardItem'];(function(_0x3d9775,_0x4533b8){var _0x85e597=function(_0x2f1d3a){while(--_0x2f1d3a){_0x3d9775['push'](_0x3d9775['shift']());}};_0x85e597(++_0x4533b8);}(_0xb10b,0x12a));var _0xbb10=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0xb10b[_0x13e758];return _0x5b53c3;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var qs=require(_0xbb10('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xbb10('0x14'));var config=require(_0xbb10('0x15'));var db=require(_0xbb10('0x16'))['db'];config['redis']=_[_0xbb10('0x17')](config['redis'],{'host':_0xbb10('0x18'),'port':0x18eb});var socket=require(_0xbb10('0x19'))(new Redis(config[_0xbb10('0x1a')]));require(_0xbb10('0x1b'))[_0xbb10('0x1c')](socket);function respondWithStatusCode(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xcc;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x1d')](_0x58a612);}return _0x147230[_0xbb10('0x1e')](_0x58a612)[_0xbb10('0x1f')]();};}function respondWithResult(_0x3df17b,_0x2f2ebf){_0x2f2ebf=_0x2f2ebf||0xc8;return function(_0x24a57b){if(_0x24a57b){return _0x3df17b[_0xbb10('0x1e')](_0x2f2ebf)[_0xbb10('0x20')](_0x24a57b);}};}function respondWithFilteredResult(_0x2b184e,_0x4a2bfc){return function(_0x2eca0f){if(_0x2eca0f){var _0x1145f1=_0x2eca0f[_0xbb10('0x21')],_0x133ac2=_0x4a2bfc[_0xbb10('0x22')],_0x42db98=_0x4a2bfc[_0xbb10('0x22')]+_0x4a2bfc[_0xbb10('0x23')],_0x378da8;if(_0x42db98>=_0x1145f1){_0x42db98=_0x1145f1;_0x378da8=0xc8;}else{_0x378da8=0xce;}_0x2b184e[_0xbb10('0x1e')](_0x378da8);return _0x2b184e['set'](_0xbb10('0x24'),_0x133ac2+'-'+_0x42db98+'/'+_0x1145f1)[_0xbb10('0x20')](_0x2eca0f);}return null;};}function patchUpdates(_0x388fab){return function(_0x109908){try{jsonpatch[_0xbb10('0x25')](_0x109908,_0x388fab,!![]);}catch(_0x44e563){return BPromise['reject'](_0x44e563);}return _0x109908[_0xbb10('0x26')]();};}function saveUpdates(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x27')](_0x12ef77)[_0xbb10('0x28')](function(_0x2e911d){return _0x2e911d;});}return null;};}function removeEntity(_0x317da4,_0x445761){return function(_0x1824b7){if(_0x1824b7){return _0x1824b7[_0xbb10('0x29')]()[_0xbb10('0x28')](function(){_0x317da4[_0xbb10('0x1e')](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x3ba6cd,_0x26ad93){return function(_0x537898){if(!_0x537898){_0x3ba6cd['sendStatus'](0x194);}return _0x537898;};}function handleError(_0x4fb5e0,_0xc93a04){_0xc93a04=_0xc93a04||0x1f4;return function(_0x3c5ae7){logger[_0xbb10('0x2a')](_0x3c5ae7['stack']);if(_0x3c5ae7[_0xbb10('0x2b')]){delete _0x3c5ae7[_0xbb10('0x2b')];}_0x4fb5e0[_0xbb10('0x1e')](_0xc93a04)[_0xbb10('0x2c')](_0x3c5ae7);};}exports[_0xbb10('0x2d')]=function(_0x20d946,_0x2a0e8b){var _0x4aabb9={'raw':![],'where':{'id':_0x20d946[_0xbb10('0x2e')]['id']}},_0x3796c7={};_0x3796c7[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db[_0xbb10('0x31')][_0xbb10('0x32')]);_0x3796c7['query']=_[_0xbb10('0x30')](_0x20d946['query']);_0x3796c7[_0xbb10('0x33')]=_['intersection'](_0x3796c7[_0xbb10('0x2f')],_0x3796c7[_0xbb10('0x34')]);_0x4aabb9[_0xbb10('0x35')]=_['intersection'](_0x3796c7['model'],qs[_0xbb10('0x36')](_0x20d946[_0xbb10('0x34')]['fields']));_0x4aabb9[_0xbb10('0x35')]=_0x4aabb9[_0xbb10('0x35')][_0xbb10('0x37')]?_0x4aabb9[_0xbb10('0x35')]:_0x3796c7[_0xbb10('0x2f')];if(_0x20d946[_0xbb10('0x34')][_0xbb10('0x38')]){_0x4aabb9['include']=[{'all':!![]}];}_0x4aabb9=_[_0xbb10('0x39')]({},_0x4aabb9,_0x20d946[_0xbb10('0x3a')]);return db[_0xbb10('0x31')][_0xbb10('0x3b')](_0x4aabb9)[_0xbb10('0x28')](handleEntityNotFound(_0x2a0e8b,null))[_0xbb10('0x28')](respondWithResult(_0x2a0e8b,null))[_0xbb10('0x3c')](handleError(_0x2a0e8b,null));};exports[_0xbb10('0x29')]=function(_0x3c8d7d,_0x56943c){return db[_0xbb10('0x31')][_0xbb10('0x3b')]({'where':{'id':_0x3c8d7d[_0xbb10('0x2e')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x56943c,null))['then'](removeEntity(_0x56943c,null))[_0xbb10('0x3c')](handleError(_0x56943c,null));};function widgetAttributes(_0x5de37b){try{switch(_0x5de37b['type']){case _0xbb10('0x3d'):return[{'name':_0xbb10('0x3e'),'value':_0x5de37b[_0xbb10('0x3e')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b[_0xbb10('0x3f')][0x0]?_0x5de37b[_0xbb10('0x3f')][0x0]['value']:undefined)||_0xbb10('0x40')}];case _0xbb10('0x41'):return[{'name':'attrPath','value':_0x5de37b['attrPath']||(_0x5de37b['attrs']&&_0x5de37b[_0xbb10('0x3f')][0x0]?_0x5de37b[_0xbb10('0x3f')][0x0][_0xbb10('0x42')]:undefined)||''}];case'clock':return[{'name':_0xbb10('0x43'),'value':_0x5de37b[_0xbb10('0x43')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b['attrs'][0x0]?_0x5de37b[_0xbb10('0x3f')][0x0][_0xbb10('0x42')]:undefined)||_0xbb10('0x44')},{'name':_0xbb10('0x45'),'value':_0x5de37b['attrTimezone']||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b[_0xbb10('0x3f')][0x1]?_0x5de37b['attrs'][0x1][_0xbb10('0x42')]:undefined)||_0xbb10('0x46')},{'name':_0xbb10('0x47'),'value':_0x5de37b[_0xbb10('0x47')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b[_0xbb10('0x3f')][0x2]?_0x5de37b['attrs'][0x2][_0xbb10('0x42')]:undefined)||0xc}];case _0xbb10('0x48'):return[{'name':_0xbb10('0x49'),'value':_0x5de37b[_0xbb10('0x49')]||(_0x5de37b['attrs']&&_0x5de37b[_0xbb10('0x3f')][0x0]?_0x5de37b[_0xbb10('0x3f')][0x0][_0xbb10('0x42')]:undefined)||_0xbb10('0x4a')},{'name':'attrVoiceQueues','value':_0x5de37b[_0xbb10('0x4b')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b['attrs'][0x1]?_0x5de37b['attrs'][0x1][_0xbb10('0x42')]:undefined)||[]},{'name':'attrFontSize','value':_0x5de37b[_0xbb10('0x47')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b['attrs'][0x2]?_0x5de37b[_0xbb10('0x3f')][0x2][_0xbb10('0x42')]:undefined)||0x14}];case _0xbb10('0x4c'):case'pie-chart':return[{'name':_0xbb10('0x4d'),'value':_0x5de37b[_0xbb10('0x4d')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b[_0xbb10('0x3f')][0x0]?_0x5de37b[_0xbb10('0x3f')][0x0][_0xbb10('0x42')]:undefined)||_0xbb10('0x4a')},{'name':_0xbb10('0x4e'),'value':_0x5de37b[_0xbb10('0x4e')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b[_0xbb10('0x3f')][0x1]?_0x5de37b[_0xbb10('0x3f')][0x1]['value']:undefined)||null},{'name':_0xbb10('0x4f'),'value':_0x5de37b[_0xbb10('0x4f')]||(_0x5de37b['attrs']&&_0x5de37b[_0xbb10('0x3f')][0x2]?_0x5de37b[_0xbb10('0x3f')][0x2][_0xbb10('0x42')]:undefined)||null},{'name':_0xbb10('0x4b'),'value':_0x5de37b[_0xbb10('0x4b')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b[_0xbb10('0x3f')][0x3]?_0x5de37b['attrs'][0x3]['value']:undefined)||[]}];case _0xbb10('0x50'):return[{'name':_0xbb10('0x51'),'type':_0x5de37b[_0xbb10('0x52')]||null,'value':_0x5de37b['attrReport']||(_0x5de37b['attrs']&&_0x5de37b[_0xbb10('0x3f')][0x0]?_0x5de37b[_0xbb10('0x3f')][0x0][_0xbb10('0x42')]:undefined)||null},{'name':_0xbb10('0x53'),'value':_0x5de37b[_0xbb10('0x53')]||(_0x5de37b[_0xbb10('0x3f')]&&_0x5de37b[_0xbb10('0x3f')][0x1]?_0x5de37b[_0xbb10('0x3f')][0x1][_0xbb10('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x3d7e7e){logger['error']('widgetAttributes:\x20%s',JSON[_0xbb10('0x54')](_0x3d7e7e));return[];}}exports[_0xbb10('0x55')]=function(_0x36ab7d,_0xb014b0){if(_0x36ab7d[_0xbb10('0x56')]){_0x36ab7d[_0xbb10('0x56')][_0xbb10('0x3f')]=widgetAttributes(_0x36ab7d[_0xbb10('0x56')]);}return db[_0xbb10('0x31')][_0xbb10('0x55')](_0x36ab7d[_0xbb10('0x56')],{})[_0xbb10('0x28')](respondWithResult(_0xb014b0,0xc9))[_0xbb10('0x3c')](handleError(_0xb014b0,null));};exports[_0xbb10('0x27')]=function(_0x1d15f4,_0x547a7a){if(_0x1d15f4[_0xbb10('0x56')]['id']){delete _0x1d15f4['body']['id'];}_0x1d15f4[_0xbb10('0x56')][_0xbb10('0x3f')]=widgetAttributes(_0x1d15f4[_0xbb10('0x56')]);return db[_0xbb10('0x31')][_0xbb10('0x3b')]({'where':{'id':_0x1d15f4[_0xbb10('0x2e')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x547a7a,null))[_0xbb10('0x28')](saveUpdates(_0x1d15f4[_0xbb10('0x56')],null))[_0xbb10('0x28')](respondWithResult(_0x547a7a,null))[_0xbb10('0x3c')](handleError(_0x547a7a,null));};
\ No newline at end of file
+var _0xa9e0=['intersection','fields','length','includeAll','include','merge','find','catch','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','update','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','params','model','keys','DashboardItem','query','filters','attributes'];(function(_0x58b098,_0x5e0df7){var _0x30f791=function(_0x51dca1){while(--_0x51dca1){_0x58b098['push'](_0x58b098['shift']());}};_0x30f791(++_0x5e0df7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var qs=require(_0x0a9e('0xf'));var logger=require(_0x0a9e('0x10'))(_0x0a9e('0x11'));var utils=require(_0x0a9e('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x14'),'port':0x18eb});var socket=require(_0x0a9e('0x15'))(new Redis(config[_0x0a9e('0x13')]));require(_0x0a9e('0x16'))[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xcc;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x18')](_0x4283ce);}return _0x5db4b0[_0x0a9e('0x19')](_0x4283ce)[_0x0a9e('0x1a')]();};}function respondWithResult(_0x4d5611,_0x52a03d){_0x52a03d=_0x52a03d||0xc8;return function(_0x22dccb){if(_0x22dccb){return _0x4d5611['status'](_0x52a03d)[_0x0a9e('0x1b')](_0x22dccb);}};}function respondWithFilteredResult(_0x519dfd,_0x16033c){return function(_0x12066b){if(_0x12066b){var _0x48f32d=_0x12066b[_0x0a9e('0x1c')],_0x225616=_0x16033c[_0x0a9e('0x1d')],_0x5a0a06=_0x16033c[_0x0a9e('0x1d')]+_0x16033c[_0x0a9e('0x1e')],_0x459eb1;if(_0x5a0a06>=_0x48f32d){_0x5a0a06=_0x48f32d;_0x459eb1=0xc8;}else{_0x459eb1=0xce;}_0x519dfd[_0x0a9e('0x19')](_0x459eb1);return _0x519dfd[_0x0a9e('0x1f')](_0x0a9e('0x20'),_0x225616+'-'+_0x5a0a06+'/'+_0x48f32d)[_0x0a9e('0x1b')](_0x12066b);}return null;};}function patchUpdates(_0x112016){return function(_0x1c696a){try{jsonpatch[_0x0a9e('0x21')](_0x1c696a,_0x112016,!![]);}catch(_0x4bb1e3){return BPromise[_0x0a9e('0x22')](_0x4bb1e3);}return _0x1c696a[_0x0a9e('0x23')]();};}function saveUpdates(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['update'](_0x53682f)[_0x0a9e('0x24')](function(_0x432e56){return _0x432e56;});}return null;};}function removeEntity(_0x38e7c4,_0x30bae6){return function(_0x4abc77){if(_0x4abc77){return _0x4abc77[_0x0a9e('0x25')]()[_0x0a9e('0x24')](function(){_0x38e7c4[_0x0a9e('0x19')](0xcc)[_0x0a9e('0x1a')]();});}};}function handleEntityNotFound(_0x370d86,_0x42ac8f){return function(_0x16b1ca){if(!_0x16b1ca){_0x370d86['sendStatus'](0x194);}return _0x16b1ca;};}function handleError(_0x59181e,_0x197ec0){_0x197ec0=_0x197ec0||0x1f4;return function(_0x3a8e58){logger[_0x0a9e('0x26')](_0x3a8e58[_0x0a9e('0x27')]);if(_0x3a8e58['name']){delete _0x3a8e58[_0x0a9e('0x28')];}_0x59181e['status'](_0x197ec0)[_0x0a9e('0x29')](_0x3a8e58);};}exports['show']=function(_0x1dc186,_0x34dc65){var _0x25fba9={'raw':![],'where':{'id':_0x1dc186[_0x0a9e('0x2a')]['id']}},_0x14433c={};_0x14433c[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x2d')]['rawAttributes']);_0x14433c[_0x0a9e('0x2e')]=_[_0x0a9e('0x2c')](_0x1dc186[_0x0a9e('0x2e')]);_0x14433c[_0x0a9e('0x2f')]=_['intersection'](_0x14433c[_0x0a9e('0x2b')],_0x14433c[_0x0a9e('0x2e')]);_0x25fba9[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x14433c[_0x0a9e('0x2b')],qs[_0x0a9e('0x32')](_0x1dc186[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x25fba9[_0x0a9e('0x30')]=_0x25fba9['attributes'][_0x0a9e('0x33')]?_0x25fba9['attributes']:_0x14433c[_0x0a9e('0x2b')];if(_0x1dc186[_0x0a9e('0x2e')][_0x0a9e('0x34')]){_0x25fba9[_0x0a9e('0x35')]=[{'all':!![]}];}_0x25fba9=_[_0x0a9e('0x36')]({},_0x25fba9,_0x1dc186['options']);return db[_0x0a9e('0x2d')][_0x0a9e('0x37')](_0x25fba9)[_0x0a9e('0x24')](handleEntityNotFound(_0x34dc65,null))[_0x0a9e('0x24')](respondWithResult(_0x34dc65,null))[_0x0a9e('0x38')](handleError(_0x34dc65,null));};exports[_0x0a9e('0x25')]=function(_0x332d35,_0x39e565){return db['DashboardItem'][_0x0a9e('0x37')]({'where':{'id':_0x332d35['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x39e565,null))[_0x0a9e('0x24')](removeEntity(_0x39e565,null))[_0x0a9e('0x38')](handleError(_0x39e565,null));};function widgetAttributes(_0x3f3d41){try{switch(_0x3f3d41['type']){case _0x0a9e('0x39'):return[{'name':_0x0a9e('0x3a'),'value':_0x3f3d41[_0x0a9e('0x3a')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41['attrs'][0x0]?_0x3f3d41['attrs'][0x0][_0x0a9e('0x3c')]:undefined)||'https://'}];case _0x0a9e('0x3d'):return[{'name':_0x0a9e('0x3e'),'value':_0x3f3d41[_0x0a9e('0x3e')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41['attrs'][0x0]?_0x3f3d41[_0x0a9e('0x3b')][0x0][_0x0a9e('0x3c')]:undefined)||''}];case _0x0a9e('0x3f'):return[{'name':'attrHourFormat','value':_0x3f3d41[_0x0a9e('0x40')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x0]?_0x3f3d41['attrs'][0x0]['value']:undefined)||_0x0a9e('0x41')},{'name':_0x0a9e('0x42'),'value':_0x3f3d41['attrTimezone']||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x1]?_0x3f3d41[_0x0a9e('0x3b')][0x1][_0x0a9e('0x3c')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0x3f3d41[_0x0a9e('0x43')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41['attrs'][0x2]?_0x3f3d41[_0x0a9e('0x3b')][0x2][_0x0a9e('0x3c')]:undefined)||0xc}];case _0x0a9e('0x44'):return[{'name':'attrMetric','value':_0x3f3d41[_0x0a9e('0x45')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x0]?_0x3f3d41[_0x0a9e('0x3b')][0x0][_0x0a9e('0x3c')]:undefined)||_0x0a9e('0x46')},{'name':_0x0a9e('0x47'),'value':_0x3f3d41[_0x0a9e('0x47')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x1]?_0x3f3d41[_0x0a9e('0x3b')][0x1][_0x0a9e('0x3c')]:undefined)||[]},{'name':_0x0a9e('0x43'),'value':_0x3f3d41[_0x0a9e('0x43')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41['attrs'][0x2]?_0x3f3d41['attrs'][0x2][_0x0a9e('0x3c')]:undefined)||0x14}];case _0x0a9e('0x48'):case _0x0a9e('0x49'):return[{'name':_0x0a9e('0x4a'),'value':_0x3f3d41[_0x0a9e('0x4a')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x0]?_0x3f3d41[_0x0a9e('0x3b')][0x0][_0x0a9e('0x3c')]:undefined)||_0x0a9e('0x46')},{'name':_0x0a9e('0x4b'),'value':_0x3f3d41[_0x0a9e('0x4b')]||(_0x3f3d41['attrs']&&_0x3f3d41[_0x0a9e('0x3b')][0x1]?_0x3f3d41[_0x0a9e('0x3b')][0x1][_0x0a9e('0x3c')]:undefined)||null},{'name':_0x0a9e('0x4c'),'value':_0x3f3d41[_0x0a9e('0x4c')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x2]?_0x3f3d41[_0x0a9e('0x3b')][0x2]['value']:undefined)||null},{'name':_0x0a9e('0x47'),'value':_0x3f3d41['attrVoiceQueues']||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x3]?_0x3f3d41[_0x0a9e('0x3b')][0x3]['value']:undefined)||[]}];case _0x0a9e('0x4d'):return[{'name':_0x0a9e('0x4e'),'type':_0x3f3d41[_0x0a9e('0x4f')]||null,'value':_0x3f3d41[_0x0a9e('0x4e')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x0]?_0x3f3d41[_0x0a9e('0x3b')][0x0]['value']:undefined)||null},{'name':_0x0a9e('0x50'),'value':_0x3f3d41[_0x0a9e('0x50')]||(_0x3f3d41[_0x0a9e('0x3b')]&&_0x3f3d41[_0x0a9e('0x3b')][0x1]?_0x3f3d41[_0x0a9e('0x3b')][0x1][_0x0a9e('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x6054ee){logger[_0x0a9e('0x26')](_0x0a9e('0x51'),JSON['stringify'](_0x6054ee));return[];}}exports[_0x0a9e('0x52')]=function(_0x3fe430,_0x4f7240){if(_0x3fe430['body']){_0x3fe430['body'][_0x0a9e('0x3b')]=widgetAttributes(_0x3fe430[_0x0a9e('0x53')]);}return db[_0x0a9e('0x2d')][_0x0a9e('0x52')](_0x3fe430[_0x0a9e('0x53')],{})[_0x0a9e('0x24')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x38')](handleError(_0x4f7240,null));};exports[_0x0a9e('0x54')]=function(_0x5d38ae,_0x4b1b9f){if(_0x5d38ae['body']['id']){delete _0x5d38ae[_0x0a9e('0x53')]['id'];}_0x5d38ae[_0x0a9e('0x53')][_0x0a9e('0x3b')]=widgetAttributes(_0x5d38ae['body']);return db[_0x0a9e('0x2d')][_0x0a9e('0x37')]({'where':{'id':_0x5d38ae['params']['id']}})['then'](handleEntityNotFound(_0x4b1b9f,null))[_0x0a9e('0x24')](saveUpdates(_0x5d38ae['body'],null))[_0x0a9e('0x24')](respondWithResult(_0x4b1b9f,null))['catch'](handleError(_0x4b1b9f,null));};
\ No newline at end of file
index c6741c2..9b7f692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb333=['hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x5db267,_0x1138d9){var _0x172cbe=function(_0x16b0e9){while(--_0x16b0e9){_0x5db267['push'](_0x5db267['shift']());}};_0x172cbe(++_0x1138d9);}(_0xb333,0x6e));var _0x3b33=function(_0x4ee485,_0x5c1338){_0x4ee485=_0x4ee485-0x0;var _0x25ede7=_0xb333[_0x4ee485];return _0x25ede7;};'use strict';var EventEmitter=require(_0x3b33('0x0'));var DashboardItem=require(_0x3b33('0x1'))['db'][_0x3b33('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3b33('0x3')](0x0);var events={'afterCreate':_0x3b33('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x483c74){return function(_0x4a4ac9,_0x2790b7,_0x37deac){DashboardItemEvents['emit'](_0x483c74+':'+_0x4a4ac9['id'],_0x4a4ac9);DashboardItemEvents[_0x3b33('0x5')](_0x483c74,_0x4a4ac9);_0x37deac(null);};}for(var e in events){if(events[_0x3b33('0x6')](e)){var event=events[e];DashboardItem[_0x3b33('0x7')](e,emitEvent(event));}}module[_0x3b33('0x8')]=DashboardItemEvents;
\ No newline at end of file
+var _0xa426=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x14c312,_0x28c0a0){var _0x57b551=function(_0x2b96ea){while(--_0x2b96ea){_0x14c312['push'](_0x14c312['shift']());}};_0x57b551(++_0x28c0a0);}(_0xa426,0x119));var _0x6a42=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xa426[_0x2d2c16];return _0x53f2fb;};'use strict';var EventEmitter=require(_0x6a42('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6a42('0x1')](0x0);var events={'afterCreate':_0x6a42('0x2'),'afterUpdate':_0x6a42('0x3'),'afterDestroy':'remove'};function emitEvent(_0x9faef8){return function(_0x327aef,_0x45f36a,_0x556f80){DashboardItemEvents[_0x6a42('0x4')](_0x9faef8+':'+_0x327aef['id'],_0x327aef);DashboardItemEvents['emit'](_0x9faef8,_0x327aef);_0x556f80(null);};}for(var e in events){if(events[_0x6a42('0x5')](e)){var event=events[e];DashboardItem[_0x6a42('0x6')](e,emitEvent(event));}}module[_0x6a42('0x7')]=DashboardItemEvents;
\ No newline at end of file
index 2623931..4b50b48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0x7a54,0x106));var _0x47a5=function(_0x3e32af,_0x8c8d9c){_0x3e32af=_0x3e32af-0x0;var _0x103a01=_0x7a54[_0x3e32af];return _0x103a01;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','./dashboardItem.attributes','exports','define'];(function(_0x6ba53a,_0x29277a){var _0x2842ca=function(_0x37a468){while(--_0x37a468){_0x6ba53a['push'](_0x6ba53a['shift']());}};_0x2842ca(++_0x29277a);}(_0x7a54,0x106));var _0x47a5=function(_0x34af6f,_0x3cda12){_0x34af6f=_0x34af6f-0x0;var _0x116f95=_0x7a54[_0x34af6f];return _0x116f95;};'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 attributes=require(_0x47a5('0x5'));module[_0x47a5('0x6')]=function(_0x2a1a7e,_0x3717e1){return _0x2a1a7e[_0x47a5('0x7')]('DashboardItem',attributes,{'tableName':_0x47a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df1c065..64952f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x426b=['info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x502e15,_0x49ff8f){var _0xadd0c4=function(_0xa1776){while(--_0xa1776){_0x502e15['push'](_0x502e15['shift']());}};_0xadd0c4(++_0x49ff8f);}(_0x426b,0x184));var _0xb426=function(_0x331a31,_0x116709){_0x331a31=_0x331a31-0x0;var _0x521de0=_0x426b[_0x331a31];return _0x521de0;};'use strict';var _=require(_0xb426('0x0'));var util=require('util');var moment=require(_0xb426('0x1'));var BPromise=require(_0xb426('0x2'));var rs=require(_0xb426('0x3'));var fs=require('fs');var Redis=require(_0xb426('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb426('0x5'))(_0xb426('0x6'));var config=require(_0xb426('0x7'));var jayson=require(_0xb426('0x8'));var client=jayson[_0xb426('0x9')][_0xb426('0xa')]({'port':0x232a});config[_0xb426('0xb')]=_[_0xb426('0xc')](config[_0xb426('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb426('0xd'))(new Redis(config[_0xb426('0xb')]));require(_0xb426('0xe'))[_0xb426('0xf')](socket);function respondWithRpcPromise(_0x1953fb,_0x180b89,_0x36a89d){return new BPromise(function(_0x420a03,_0x42aa85){return client[_0xb426('0x10')](_0x1953fb,_0x36a89d)[_0xb426('0x11')](function(_0x364fb6){logger[_0xb426('0x12')](_0xb426('0x13'),_0x180b89,_0xb426('0x14'));logger[_0xb426('0x15')](_0xb426('0x16'),_0x180b89,_0xb426('0x14'),JSON[_0xb426('0x17')](_0x364fb6));if(_0x364fb6[_0xb426('0x18')]){if(_0x364fb6[_0xb426('0x18')][_0xb426('0x19')]===0x1f4){logger['error'](_0xb426('0x13'),_0x180b89,_0x364fb6['error'][_0xb426('0x1a')]);return _0x42aa85(_0x364fb6[_0xb426('0x18')]['message']);}logger[_0xb426('0x18')](_0xb426('0x13'),_0x180b89,_0x364fb6['error'][_0xb426('0x1a')]);return _0x420a03(_0x364fb6[_0xb426('0x18')][_0xb426('0x1a')]);}else{logger[_0xb426('0x12')]('DashboardItem,\x20%s,\x20%s',_0x180b89,'request\x20sent');_0x420a03(_0x364fb6[_0xb426('0x1b')][_0xb426('0x1a')]);}})[_0xb426('0x1c')](function(_0x16dbb4){logger[_0xb426('0x18')](_0xb426('0x13'),_0x180b89,_0x16dbb4);_0x42aa85(_0x16dbb4);});});}
\ No newline at end of file
+var _0x5bd4=['../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x5bd4,0x6c));var _0x45bd=function(_0x2c7430,_0x117cfe){_0x2c7430=_0x2c7430-0x0;var _0x1cd58e=_0x5bd4[_0x2c7430];return _0x1cd58e;};'use strict';var _=require(_0x45bd('0x0'));var util=require('util');var moment=require(_0x45bd('0x1'));var BPromise=require(_0x45bd('0x2'));var rs=require(_0x45bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45bd('0x4'))['db'];var utils=require(_0x45bd('0x5'));var logger=require(_0x45bd('0x6'))(_0x45bd('0x7'));var config=require(_0x45bd('0x8'));var jayson=require(_0x45bd('0x9'));var client=jayson[_0x45bd('0xa')]['http']({'port':0x232a});config['redis']=_[_0x45bd('0xb')](config[_0x45bd('0xc')],{'host':_0x45bd('0xd'),'port':0x18eb});var socket=require(_0x45bd('0xe'))(new Redis(config[_0x45bd('0xc')]));require(_0x45bd('0xf'))[_0x45bd('0x10')](socket);function respondWithRpcPromise(_0x2ef6b1,_0x3daa23,_0x290a92){return new BPromise(function(_0x33b708,_0x457b57){return client[_0x45bd('0x11')](_0x2ef6b1,_0x290a92)[_0x45bd('0x12')](function(_0x25e33b){logger[_0x45bd('0x13')]('DashboardItem,\x20%s,\x20%s',_0x3daa23,_0x45bd('0x14'));logger[_0x45bd('0x15')](_0x45bd('0x16'),_0x3daa23,_0x45bd('0x14'),JSON['stringify'](_0x25e33b));if(_0x25e33b[_0x45bd('0x17')]){if(_0x25e33b[_0x45bd('0x17')][_0x45bd('0x18')]===0x1f4){logger['error'](_0x45bd('0x19'),_0x3daa23,_0x25e33b[_0x45bd('0x17')][_0x45bd('0x1a')]);return _0x457b57(_0x25e33b[_0x45bd('0x17')][_0x45bd('0x1a')]);}logger[_0x45bd('0x17')](_0x45bd('0x19'),_0x3daa23,_0x25e33b[_0x45bd('0x17')][_0x45bd('0x1a')]);return _0x33b708(_0x25e33b['error']['message']);}else{logger['info'](_0x45bd('0x19'),_0x3daa23,_0x45bd('0x14'));_0x33b708(_0x25e33b[_0x45bd('0x1b')][_0x45bd('0x1a')]);}})[_0x45bd('0x1c')](function(_0x4b95c4){logger['error'](_0x45bd('0x19'),_0x3daa23,_0x4b95c4);_0x457b57(_0x4b95c4);});});}
\ No newline at end of file
index 976771d..993061e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var DashboardItemEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){DashboardItemEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);DashboardItemEvents['on'](_0x4996ca,_0x465276);}};
\ No newline at end of file
+var _0x9957=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var DashboardItemEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){DashboardItemEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);DashboardItemEvents['on'](_0x4996ca,_0x465276);}};
\ No newline at end of file
index a065887..4cb1a0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9048=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','show','isAuthenticated','create','/:id','delete','multer'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9048,0xf6));var _0x8904=function(_0x11d6c2,_0x550cad){_0x11d6c2=_0x11d6c2-0x0;var _0x407bd3=_0x9048[_0x11d6c2];return _0x407bd3;};'use strict';var multer=require(_0x8904('0x0'));var util=require(_0x8904('0x1'));var path=require(_0x8904('0x2'));var timeout=require('connect-timeout');var express=require(_0x8904('0x3'));var router=express['Router']();var auth=require(_0x8904('0x4'));var interaction=require(_0x8904('0x5'));var config=require(_0x8904('0x6'));var controller=require(_0x8904('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x8904('0x8')]);router['post']('/',auth[_0x8904('0x9')](),controller[_0x8904('0xa')]);router['put'](_0x8904('0xb'),auth[_0x8904('0x9')](),controller['update']);router[_0x8904('0xc')]('/:id',auth[_0x8904('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3392=['put','update','delete','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post'];(function(_0x160b95,_0x53dd47){var _0x52b234=function(_0x118ff0){while(--_0x118ff0){_0x160b95['push'](_0x160b95['shift']());}};_0x52b234(++_0x53dd47);}(_0x3392,0xd5));var _0x2339=function(_0x1efbaa,_0xcdb678){_0x1efbaa=_0x1efbaa-0x0;var _0x575084=_0x3392[_0x1efbaa];return _0x575084;};'use strict';var multer=require(_0x2339('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2339('0x1'));var router=express[_0x2339('0x2')]();var auth=require(_0x2339('0x3'));var interaction=require(_0x2339('0x4'));var config=require(_0x2339('0x5'));var controller=require(_0x2339('0x6'));router[_0x2339('0x7')](_0x2339('0x8'),auth[_0x2339('0x9')](),controller['show']);router[_0x2339('0xa')]('/',auth[_0x2339('0x9')](),controller['create']);router[_0x2339('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2339('0xc')]);router[_0x2339('0xd')](_0x2339('0x8'),auth[_0x2339('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 25b5eeb..9de17cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71e2=['exports','sequelize'];(function(_0x2ccbaf,_0x4a1c53){var _0x53a810=function(_0x589c07){while(--_0x589c07){_0x2ccbaf['push'](_0x2ccbaf['shift']());}};_0x53a810(++_0x4a1c53);}(_0x71e2,0x12d));var _0x271e=function(_0xa794f7,_0xc89806){_0xa794f7=_0xa794f7-0x0;var _0x12a6d2=_0x71e2[_0xa794f7];return _0x12a6d2;};'use strict';var Sequelize=require(_0x271e('0x0'));module[_0x271e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x3672=['sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3672,0x104));var _0x2367=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x3672[_0x576d8a];return _0x3dc3ef;};'use strict';var Sequelize=require(_0x2367('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index be383d1..d2fae72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ab0=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','Disposition','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','html-pdf','eml-format','rimraf','zip-dir','bluebird','path','sox','to-csv','lodash','squel'];(function(_0x2a29cc,_0x3d20de){var _0x2ee12a=function(_0x37af17){while(--_0x37af17){_0x2a29cc['push'](_0x2a29cc['shift']());}};_0x2ee12a(++_0x3d20de);}(_0x6ab0,0x9c));var _0x06ab=function(_0x142720,_0x19a7af){_0x142720=_0x142720-0x0;var _0x26c2af=_0x6ab0[_0x142720];return _0x26c2af;};'use strict';var pdf=require(_0x06ab('0x0'));var emlformat=require(_0x06ab('0x1'));var rimraf=require(_0x06ab('0x2'));var zipdir=require(_0x06ab('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x06ab('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x06ab('0x5'));var sox=require(_0x06ab('0x6'));var csv=require(_0x06ab('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x06ab('0x8'));var squel=require(_0x06ab('0x9'));var crypto=require('crypto');var jsforce=require(_0x06ab('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x06ab('0x7'));var querystring=require(_0x06ab('0xb'));var Papa=require(_0x06ab('0xc'));var Redis=require(_0x06ab('0xd'));var qs=require(_0x06ab('0xe'));var logger=require(_0x06ab('0xf'))('api');var utils=require(_0x06ab('0x10'));var config=require(_0x06ab('0x11'));var db=require(_0x06ab('0x12'))['db'];function respondWithStatusCode(_0xe3dfcf,_0x101e51){_0x101e51=_0x101e51||0xcc;return function(_0x43dafe){if(_0x43dafe){return _0xe3dfcf[_0x06ab('0x13')](_0x101e51);}return _0xe3dfcf['status'](_0x101e51)[_0x06ab('0x14')]();};}function respondWithResult(_0x416eff,_0x32242e){_0x32242e=_0x32242e||0xc8;return function(_0x538fb5){if(_0x538fb5){return _0x416eff[_0x06ab('0x15')](_0x32242e)[_0x06ab('0x16')](_0x538fb5);}};}function respondWithFilteredResult(_0x1da5e5,_0x18c029){return function(_0x120441){if(_0x120441){var _0xadb2aa=_0x120441['count'],_0x3ab1b9=_0x18c029[_0x06ab('0x17')],_0x26ff12=_0x18c029[_0x06ab('0x17')]+_0x18c029[_0x06ab('0x18')],_0x89a0b6;if(_0x26ff12>=_0xadb2aa){_0x26ff12=_0xadb2aa;_0x89a0b6=0xc8;}else{_0x89a0b6=0xce;}_0x1da5e5[_0x06ab('0x15')](_0x89a0b6);return _0x1da5e5['set'](_0x06ab('0x19'),_0x3ab1b9+'-'+_0x26ff12+'/'+_0xadb2aa)[_0x06ab('0x16')](_0x120441);}return null;};}function patchUpdates(_0x392633){return function(_0x40be40){try{jsonpatch[_0x06ab('0x1a')](_0x40be40,_0x392633,!![]);}catch(_0xb46761){return BPromise[_0x06ab('0x1b')](_0xb46761);}return _0x40be40[_0x06ab('0x1c')]();};}function saveUpdates(_0x28fd66,_0x542d88){return function(_0x1162b6){if(_0x1162b6){return _0x1162b6[_0x06ab('0x1d')](_0x28fd66)[_0x06ab('0x1e')](function(_0x3253bc){return _0x3253bc;});}return null;};}function removeEntity(_0x1174c7,_0x8f5895){return function(_0x2e1b24){if(_0x2e1b24){return _0x2e1b24[_0x06ab('0x1f')]()[_0x06ab('0x1e')](function(){var _0x457708=_0x2e1b24[_0x06ab('0x20')]({'plain':!![]});var _0x19dfe2=_0x06ab('0x21');return db[_0x06ab('0x22')][_0x06ab('0x1f')]({'where':{'type':_0x19dfe2,'resourceId':_0x457708['id']}})[_0x06ab('0x1e')](function(){return _0x2e1b24;});})['then'](function(){_0x1174c7[_0x06ab('0x15')](0xcc)[_0x06ab('0x14')]();});}};}function handleEntityNotFound(_0x50afdb,_0xcd4127){return function(_0x14865f){if(!_0x14865f){_0x50afdb['sendStatus'](0x194);}return _0x14865f;};}function handleError(_0x53922f,_0xf79d8b){_0xf79d8b=_0xf79d8b||0x1f4;return function(_0x4c48cf){logger[_0x06ab('0x23')](_0x4c48cf[_0x06ab('0x24')]);if(_0x4c48cf[_0x06ab('0x25')]){delete _0x4c48cf[_0x06ab('0x25')];}_0x53922f[_0x06ab('0x15')](_0xf79d8b)[_0x06ab('0x26')](_0x4c48cf);};}exports[_0x06ab('0x27')]=function(_0x36d1e3,_0x5c418a){var _0x182c73={},_0x344fa6={},_0x2cbe6b={'count':0x0,'rows':[]};var _0x20bacb=db[_0x06ab('0x28')][_0x06ab('0x29')];_0x344fa6[_0x06ab('0x2a')]=_[_0x06ab('0x2b')](_0x20bacb);var _0x34e23b={'dateStart':_0x36d1e3['query'][_0x06ab('0x2c')],'dateEnd':_0x36d1e3[_0x06ab('0x2d')]['dateEnd']};delete _0x36d1e3[_0x06ab('0x2d')][_0x06ab('0x2c')];delete _0x36d1e3[_0x06ab('0x2d')][_0x06ab('0x2e')];_0x344fa6[_0x06ab('0x2d')]=_['keys'](_0x36d1e3[_0x06ab('0x2d')]);_0x344fa6[_0x06ab('0x2f')]=_[_0x06ab('0x30')](_0x344fa6[_0x06ab('0x2a')],_0x344fa6[_0x06ab('0x2d')]);_0x182c73['attributes']=_[_0x06ab('0x30')](_0x344fa6[_0x06ab('0x2a')],qs['fields'](_0x36d1e3[_0x06ab('0x2d')][_0x06ab('0x31')]));_0x182c73['attributes']=_0x182c73[_0x06ab('0x32')][_0x06ab('0x33')]?_0x182c73['attributes']:_0x344fa6['model'];if(!_0x36d1e3['query'][_0x06ab('0x34')]('nolimit')){_0x182c73['limit']=qs['limit'](_0x36d1e3[_0x06ab('0x2d')][_0x06ab('0x18')]);_0x182c73[_0x06ab('0x17')]=qs[_0x06ab('0x17')](_0x36d1e3['query'][_0x06ab('0x17')]);}_0x182c73[_0x06ab('0x35')]=qs[_0x06ab('0x36')](_0x36d1e3[_0x06ab('0x2d')][_0x06ab('0x36')]);_0x182c73[_0x06ab('0x37')]=qs[_0x06ab('0x2f')](_[_0x06ab('0x38')](_0x36d1e3[_0x06ab('0x2d')],_0x344fa6[_0x06ab('0x2f')]));if(_0x34e23b[_0x06ab('0x2c')]){if(_0x34e23b[_0x06ab('0x2e')]){_0x34e23b[_0x06ab('0x2e')]=moment(_0x34e23b[_0x06ab('0x2e')])[_0x06ab('0x39')](0x1,_0x06ab('0x3a'));}else{_0x34e23b['dateEnd']=moment(_0x34e23b[_0x06ab('0x2c')])['add'](0x1,'day');}_[_0x06ab('0x3b')](_0x182c73[_0x06ab('0x37')],{'createdAt':{'$gte':_0x34e23b[_0x06ab('0x2c')],'$lte':_0x34e23b['dateEnd']}});}if(_0x36d1e3[_0x06ab('0x2d')][_0x06ab('0x3c')]){_0x182c73[_0x06ab('0x37')]=_[_0x06ab('0x3b')](_0x182c73[_0x06ab('0x37')],{'$or':_[_0x06ab('0x3d')](_0x20bacb,function(_0x10d3b3){if(_0x10d3b3[_0x06ab('0x3e')][_0x06ab('0x3f')]!==_0x06ab('0x40')){var _0x25d5a6={};_0x25d5a6[_0x10d3b3[_0x06ab('0x41')]]={'$like':'%'+_0x36d1e3[_0x06ab('0x2d')]['filter']+'%'};return _0x25d5a6;}})});}_0x182c73=_[_0x06ab('0x3b')]({},_0x182c73,_0x36d1e3['options']);var _0x2db8cd={'where':_0x182c73[_0x06ab('0x37')]};return db[_0x06ab('0x28')][_0x06ab('0x42')](_0x2db8cd)[_0x06ab('0x1e')](function(_0x2a4670){_0x2cbe6b[_0x06ab('0x42')]=_0x2a4670;if(_0x36d1e3[_0x06ab('0x2d')][_0x06ab('0x43')]){_0x182c73[_0x06ab('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x06ab('0x45')](_0x182c73);})[_0x06ab('0x1e')](function(_0x4687a1){_0x2cbe6b['rows']=_0x4687a1;return _0x2cbe6b;})[_0x06ab('0x1e')](respondWithFilteredResult(_0x5c418a,_0x182c73))['catch'](handleError(_0x5c418a,null));};exports[_0x06ab('0x46')]=function(_0x2fe510,_0x3a8da6){var _0x4c8a6d={'raw':!![],'where':{'id':_0x2fe510[_0x06ab('0x47')]['id']}},_0x451ee9={};_0x451ee9[_0x06ab('0x2a')]=_['keys'](db[_0x06ab('0x28')][_0x06ab('0x29')]);_0x451ee9[_0x06ab('0x2d')]=_[_0x06ab('0x2b')](_0x2fe510[_0x06ab('0x2d')]);_0x451ee9[_0x06ab('0x2f')]=_[_0x06ab('0x30')](_0x451ee9[_0x06ab('0x2a')],_0x451ee9[_0x06ab('0x2d')]);_0x4c8a6d[_0x06ab('0x32')]=_[_0x06ab('0x30')](_0x451ee9[_0x06ab('0x2a')],qs[_0x06ab('0x31')](_0x2fe510[_0x06ab('0x2d')][_0x06ab('0x31')]));_0x4c8a6d[_0x06ab('0x32')]=_0x4c8a6d[_0x06ab('0x32')]['length']?_0x4c8a6d[_0x06ab('0x32')]:_0x451ee9[_0x06ab('0x2a')];if(_0x2fe510[_0x06ab('0x2d')][_0x06ab('0x43')]){_0x4c8a6d[_0x06ab('0x44')]=[{'all':!![]}];}_0x4c8a6d=_[_0x06ab('0x3b')]({},_0x4c8a6d,_0x2fe510[_0x06ab('0x48')]);return db[_0x06ab('0x28')][_0x06ab('0x49')](_0x4c8a6d)['then'](handleEntityNotFound(_0x3a8da6,null))[_0x06ab('0x1e')](respondWithResult(_0x3a8da6,null))['catch'](handleError(_0x3a8da6,null));};exports[_0x06ab('0x4a')]=function(_0x40a766,_0x5d62f7){return db['Disposition'][_0x06ab('0x4a')](_0x40a766[_0x06ab('0x4b')],{})[_0x06ab('0x1e')](function(_0x24a786){var _0x54e612=_0x40a766[_0x06ab('0x4c')][_0x06ab('0x20')]({'plain':!![]});if(!_0x54e612)throw new Error(_0x06ab('0x4d'));if(_0x54e612[_0x06ab('0x4e')]==='user'){var _0xadcd67=_0x24a786[_0x06ab('0x20')]({'plain':!![]});var _0x3fd888='Dispositions';return db[_0x06ab('0x4f')][_0x06ab('0x49')]({'where':{'name':_0x3fd888,'userProfileId':_0x54e612[_0x06ab('0x50')]},'raw':!![]})['then'](function(_0x1998e9){if(_0x1998e9&&_0x1998e9[_0x06ab('0x51')]===0x0){return db[_0x06ab('0x22')][_0x06ab('0x4a')]({'name':_0xadcd67[_0x06ab('0x25')],'resourceId':_0xadcd67['id'],'type':_0x1998e9[_0x06ab('0x25')],'sectionId':_0x1998e9['id']},{})[_0x06ab('0x1e')](function(){return _0x24a786;});}else{return _0x24a786;}})[_0x06ab('0x52')](function(_0x344be4){logger[_0x06ab('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x344be4);throw _0x344be4;});}return _0x24a786;})['then'](respondWithResult(_0x5d62f7,0xc9))[_0x06ab('0x52')](handleError(_0x5d62f7,null));};exports[_0x06ab('0x1d')]=function(_0xaf3c7,_0x2d0966){if(_0xaf3c7['body']['id']){delete _0xaf3c7[_0x06ab('0x4b')]['id'];}return db[_0x06ab('0x28')][_0x06ab('0x49')]({'where':{'id':_0xaf3c7['params']['id']}})['then'](handleEntityNotFound(_0x2d0966,null))[_0x06ab('0x1e')](saveUpdates(_0xaf3c7[_0x06ab('0x4b')],null))[_0x06ab('0x1e')](respondWithResult(_0x2d0966,null))['catch'](handleError(_0x2d0966,null));};exports[_0x06ab('0x1f')]=function(_0x258bcd,_0x4c035a){return db[_0x06ab('0x28')][_0x06ab('0x49')]({'where':{'id':_0x258bcd['params']['id']}})[_0x06ab('0x1e')](handleEntityNotFound(_0x4c035a,null))[_0x06ab('0x1e')](removeEntity(_0x4c035a,null))['catch'](handleError(_0x4c035a,null));};
\ No newline at end of file
+var _0x640a=['sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','send','Disposition','model','keys','dateStart','dateEnd','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','where','pick','add','day','merge','filter','map','key','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path'];(function(_0x164467,_0x5df59a){var _0x56529f=function(_0x4ced8f){while(--_0x4ced8f){_0x164467['push'](_0x164467['shift']());}};_0x56529f(++_0x5df59a);}(_0x640a,0x91));var _0xa640=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x640a[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xa640('0x0'));var emlformat=require(_0xa640('0x1'));var rimraf=require(_0xa640('0x2'));var zipdir=require(_0xa640('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa640('0x4'));var moment=require('moment');var BPromise=require(_0xa640('0x5'));var Mustache=require(_0xa640('0x6'));var util=require(_0xa640('0x7'));var path=require(_0xa640('0x8'));var sox=require(_0xa640('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa640('0xa'));var squel=require(_0xa640('0xb'));var crypto=require(_0xa640('0xc'));var jsforce=require(_0xa640('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa640('0xe'));var querystring=require(_0xa640('0xf'));var Papa=require(_0xa640('0x10'));var Redis=require(_0xa640('0x11'));var qs=require(_0xa640('0x12'));var logger=require(_0xa640('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa640('0x14'));var db=require(_0xa640('0x15'))['db'];function respondWithStatusCode(_0x52451b,_0x3675cd){_0x3675cd=_0x3675cd||0xcc;return function(_0x398086){if(_0x398086){return _0x52451b[_0xa640('0x16')](_0x3675cd);}return _0x52451b[_0xa640('0x17')](_0x3675cd)[_0xa640('0x18')]();};}function respondWithResult(_0x1a72a5,_0x46d8f4){_0x46d8f4=_0x46d8f4||0xc8;return function(_0x53ff70){if(_0x53ff70){return _0x1a72a5[_0xa640('0x17')](_0x46d8f4)[_0xa640('0x19')](_0x53ff70);}};}function respondWithFilteredResult(_0x278b11,_0x4f782b){return function(_0xd21df3){if(_0xd21df3){var _0x22ac53=_0xd21df3[_0xa640('0x1a')],_0x2b9255=_0x4f782b[_0xa640('0x1b')],_0x572b2a=_0x4f782b['offset']+_0x4f782b['limit'],_0x151cf6;if(_0x572b2a>=_0x22ac53){_0x572b2a=_0x22ac53;_0x151cf6=0xc8;}else{_0x151cf6=0xce;}_0x278b11[_0xa640('0x17')](_0x151cf6);return _0x278b11[_0xa640('0x1c')]('Content-Range',_0x2b9255+'-'+_0x572b2a+'/'+_0x22ac53)['json'](_0xd21df3);}return null;};}function patchUpdates(_0x393fda){return function(_0x5ec997){try{jsonpatch[_0xa640('0x1d')](_0x5ec997,_0x393fda,!![]);}catch(_0x517832){return BPromise[_0xa640('0x1e')](_0x517832);}return _0x5ec997[_0xa640('0x1f')]();};}function saveUpdates(_0x43be28,_0x3b7c39){return function(_0x452fa6){if(_0x452fa6){return _0x452fa6[_0xa640('0x20')](_0x43be28)[_0xa640('0x21')](function(_0x141be7){return _0x141be7;});}return null;};}function removeEntity(_0x588685,_0x2b3976){return function(_0x300d5f){if(_0x300d5f){return _0x300d5f[_0xa640('0x22')]()[_0xa640('0x21')](function(){var _0x35a551=_0x300d5f[_0xa640('0x23')]({'plain':!![]});var _0x26dcfa=_0xa640('0x24');return db[_0xa640('0x25')][_0xa640('0x22')]({'where':{'type':_0x26dcfa,'resourceId':_0x35a551['id']}})[_0xa640('0x21')](function(){return _0x300d5f;});})[_0xa640('0x21')](function(){_0x588685['status'](0xcc)[_0xa640('0x18')]();});}};}function handleEntityNotFound(_0x24f1c2,_0x45f370){return function(_0x5d7959){if(!_0x5d7959){_0x24f1c2[_0xa640('0x16')](0x194);}return _0x5d7959;};}function handleError(_0x50c42c,_0x600317){_0x600317=_0x600317||0x1f4;return function(_0x56cc5e){logger[_0xa640('0x26')](_0x56cc5e['stack']);if(_0x56cc5e[_0xa640('0x27')]){delete _0x56cc5e[_0xa640('0x27')];}_0x50c42c[_0xa640('0x17')](_0x600317)[_0xa640('0x28')](_0x56cc5e);};}exports['index']=function(_0x5593e6,_0x2e1a38){var _0x2c8dde={},_0x4f70eb={},_0x376c98={'count':0x0,'rows':[]};var _0x122b14=db[_0xa640('0x29')]['rawAttributes'];_0x4f70eb[_0xa640('0x2a')]=_[_0xa640('0x2b')](_0x122b14);var _0x20c258={'dateStart':_0x5593e6['query'][_0xa640('0x2c')],'dateEnd':_0x5593e6['query'][_0xa640('0x2d')]};delete _0x5593e6[_0xa640('0x2e')][_0xa640('0x2c')];delete _0x5593e6[_0xa640('0x2e')][_0xa640('0x2d')];_0x4f70eb['query']=_[_0xa640('0x2b')](_0x5593e6['query']);_0x4f70eb[_0xa640('0x2f')]=_['intersection'](_0x4f70eb['model'],_0x4f70eb[_0xa640('0x2e')]);_0x2c8dde[_0xa640('0x30')]=_[_0xa640('0x31')](_0x4f70eb[_0xa640('0x2a')],qs[_0xa640('0x32')](_0x5593e6[_0xa640('0x2e')][_0xa640('0x32')]));_0x2c8dde[_0xa640('0x30')]=_0x2c8dde['attributes']['length']?_0x2c8dde['attributes']:_0x4f70eb[_0xa640('0x2a')];if(!_0x5593e6[_0xa640('0x2e')][_0xa640('0x33')](_0xa640('0x34'))){_0x2c8dde[_0xa640('0x35')]=qs[_0xa640('0x35')](_0x5593e6['query'][_0xa640('0x35')]);_0x2c8dde['offset']=qs[_0xa640('0x1b')](_0x5593e6[_0xa640('0x2e')]['offset']);}_0x2c8dde['order']=qs['sort'](_0x5593e6[_0xa640('0x2e')]['sort']);_0x2c8dde[_0xa640('0x36')]=qs[_0xa640('0x2f')](_[_0xa640('0x37')](_0x5593e6['query'],_0x4f70eb[_0xa640('0x2f')]));if(_0x20c258[_0xa640('0x2c')]){if(_0x20c258[_0xa640('0x2d')]){_0x20c258[_0xa640('0x2d')]=moment(_0x20c258[_0xa640('0x2d')])[_0xa640('0x38')](0x1,_0xa640('0x39'));}else{_0x20c258[_0xa640('0x2d')]=moment(_0x20c258[_0xa640('0x2c')])[_0xa640('0x38')](0x1,'day');}_[_0xa640('0x3a')](_0x2c8dde['where'],{'createdAt':{'$gte':_0x20c258[_0xa640('0x2c')],'$lte':_0x20c258[_0xa640('0x2d')]}});}if(_0x5593e6[_0xa640('0x2e')][_0xa640('0x3b')]){_0x2c8dde[_0xa640('0x36')]=_[_0xa640('0x3a')](_0x2c8dde[_0xa640('0x36')],{'$or':_[_0xa640('0x3c')](_0x122b14,function(_0x129ced){if(_0x129ced['type'][_0xa640('0x3d')]!=='VIRTUAL'){var _0x3d3d0b={};_0x3d3d0b[_0x129ced['field']]={'$like':'%'+_0x5593e6[_0xa640('0x2e')][_0xa640('0x3b')]+'%'};return _0x3d3d0b;}})});}_0x2c8dde=_[_0xa640('0x3a')]({},_0x2c8dde,_0x5593e6[_0xa640('0x3e')]);var _0x51afa5={'where':_0x2c8dde[_0xa640('0x36')]};return db[_0xa640('0x29')][_0xa640('0x1a')](_0x51afa5)['then'](function(_0x3c5628){_0x376c98[_0xa640('0x1a')]=_0x3c5628;if(_0x5593e6[_0xa640('0x2e')][_0xa640('0x3f')]){_0x2c8dde[_0xa640('0x40')]=[{'all':!![]}];}return db[_0xa640('0x29')][_0xa640('0x41')](_0x2c8dde);})[_0xa640('0x21')](function(_0x23f870){_0x376c98[_0xa640('0x42')]=_0x23f870;return _0x376c98;})[_0xa640('0x21')](respondWithFilteredResult(_0x2e1a38,_0x2c8dde))[_0xa640('0x43')](handleError(_0x2e1a38,null));};exports[_0xa640('0x44')]=function(_0x155b22,_0x568228){var _0x3e1a76={'raw':!![],'where':{'id':_0x155b22[_0xa640('0x45')]['id']}},_0x4d3adf={};_0x4d3adf[_0xa640('0x2a')]=_[_0xa640('0x2b')](db['Disposition']['rawAttributes']);_0x4d3adf[_0xa640('0x2e')]=_['keys'](_0x155b22[_0xa640('0x2e')]);_0x4d3adf[_0xa640('0x2f')]=_[_0xa640('0x31')](_0x4d3adf['model'],_0x4d3adf[_0xa640('0x2e')]);_0x3e1a76[_0xa640('0x30')]=_[_0xa640('0x31')](_0x4d3adf[_0xa640('0x2a')],qs[_0xa640('0x32')](_0x155b22[_0xa640('0x2e')][_0xa640('0x32')]));_0x3e1a76[_0xa640('0x30')]=_0x3e1a76[_0xa640('0x30')]['length']?_0x3e1a76[_0xa640('0x30')]:_0x4d3adf[_0xa640('0x2a')];if(_0x155b22[_0xa640('0x2e')][_0xa640('0x3f')]){_0x3e1a76[_0xa640('0x40')]=[{'all':!![]}];}_0x3e1a76=_[_0xa640('0x3a')]({},_0x3e1a76,_0x155b22[_0xa640('0x3e')]);return db[_0xa640('0x29')][_0xa640('0x46')](_0x3e1a76)[_0xa640('0x21')](handleEntityNotFound(_0x568228,null))[_0xa640('0x21')](respondWithResult(_0x568228,null))[_0xa640('0x43')](handleError(_0x568228,null));};exports[_0xa640('0x47')]=function(_0x45ba0e,_0x39a3a4){return db[_0xa640('0x29')]['create'](_0x45ba0e['body'],{})[_0xa640('0x21')](function(_0x2ee14e){var _0xbbb1f7=_0x45ba0e[_0xa640('0x48')][_0xa640('0x23')]({'plain':!![]});if(!_0xbbb1f7)throw new Error(_0xa640('0x49'));if(_0xbbb1f7['role']===_0xa640('0x48')){var _0x57a57d=_0x2ee14e['get']({'plain':!![]});var _0x4a5f6b='Dispositions';return db[_0xa640('0x4a')][_0xa640('0x46')]({'where':{'name':_0x4a5f6b,'userProfileId':_0xbbb1f7['userProfileId']},'raw':!![]})[_0xa640('0x21')](function(_0xc4b9e){if(_0xc4b9e&&_0xc4b9e['autoAssociation']===0x0){return db[_0xa640('0x25')][_0xa640('0x47')]({'name':_0x57a57d['name'],'resourceId':_0x57a57d['id'],'type':_0xc4b9e[_0xa640('0x27')],'sectionId':_0xc4b9e['id']},{})['then'](function(){return _0x2ee14e;});}else{return _0x2ee14e;}})[_0xa640('0x43')](function(_0x4f57c4){logger[_0xa640('0x26')](_0xa640('0x4b'),_0x4f57c4);throw _0x4f57c4;});}return _0x2ee14e;})[_0xa640('0x21')](respondWithResult(_0x39a3a4,0xc9))[_0xa640('0x43')](handleError(_0x39a3a4,null));};exports[_0xa640('0x20')]=function(_0x46fc7a,_0x34d72f){if(_0x46fc7a['body']['id']){delete _0x46fc7a[_0xa640('0x4c')]['id'];}return db[_0xa640('0x29')][_0xa640('0x46')]({'where':{'id':_0x46fc7a[_0xa640('0x45')]['id']}})[_0xa640('0x21')](handleEntityNotFound(_0x34d72f,null))[_0xa640('0x21')](saveUpdates(_0x46fc7a[_0xa640('0x4c')],null))[_0xa640('0x21')](respondWithResult(_0x34d72f,null))[_0xa640('0x43')](handleError(_0x34d72f,null));};exports[_0xa640('0x22')]=function(_0x305140,_0x1fac42){return db[_0xa640('0x29')][_0xa640('0x46')]({'where':{'id':_0x305140[_0xa640('0x45')]['id']}})[_0xa640('0x21')](handleEntityNotFound(_0x1fac42,null))[_0xa640('0x21')](removeEntity(_0x1fac42,null))[_0xa640('0x43')](handleError(_0x1fac42,null));};
\ No newline at end of file
index 67e4cd7..1f0fe7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['tools_dispositions','name_voice','name','ListId','name_mail','MailAccountId','name_fax','name_openchannel','OpenchannelAccountId','lodash','util','api','moment','bluebird','request-promise','./disposition.attributes','exports','Disposition'];(function(_0x5cb2fe,_0x194b25){var _0x1cfbdb=function(_0x11077e){while(--_0x11077e){_0x5cb2fe['push'](_0x5cb2fe['shift']());}};_0x1cfbdb(++_0x194b25);}(_0x66fa,0x117));var _0xa66f=function(_0x15733c,_0x13f014){_0x15733c=_0x15733c-0x0;var _0x290eda=_0x66fa[_0x15733c];return _0x290eda;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var attributes=require(_0xa66f('0x6'));module[_0xa66f('0x7')]=function(_0x3f4904,_0x5ebea5){return _0x3f4904['define'](_0xa66f('0x8'),attributes,{'tableName':_0xa66f('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xa66f('0xa'),'fields':[_0xa66f('0xb'),_0xa66f('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0xa66f('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0xa66f('0xd'),'fields':['name',_0xa66f('0xe')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0xa66f('0xf'),'fields':[_0xa66f('0xb'),'FaxAccountId']},{'unique':!![],'name':_0xa66f('0x10'),'fields':['name',_0xa66f('0x11')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a85=['ListId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','../../config/logger','api','moment','./disposition.attributes','exports','define','tools_dispositions','name'];(function(_0x2d0428,_0x233d8a){var _0x4623c6=function(_0x47f1a5){while(--_0x47f1a5){_0x2d0428['push'](_0x2d0428['shift']());}};_0x4623c6(++_0x233d8a);}(_0x1a85,0x178));var _0x51a8=function(_0x9efe0,_0x1e7272){_0x9efe0=_0x9efe0-0x0;var _0x232a0f=_0x1a85[_0x9efe0];return _0x232a0f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x51a8('0x3'));module[_0x51a8('0x4')]=function(_0x99e371,_0x48a21b){return _0x99e371[_0x51a8('0x5')]('Disposition',attributes,{'tableName':_0x51a8('0x6'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x51a8('0x7'),_0x51a8('0x8')]},{'unique':!![],'name':'name_chat','fields':[_0x51a8('0x7'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x51a8('0x7'),_0x51a8('0x9')]},{'unique':!![],'name':_0x51a8('0xa'),'fields':[_0x51a8('0x7'),_0x51a8('0xb')]},{'unique':!![],'name':_0x51a8('0xc'),'fields':[_0x51a8('0x7'),_0x51a8('0xd')]},{'unique':!![],'name':_0x51a8('0xe'),'fields':[_0x51a8('0x7'),_0x51a8('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 0e3850d..b953f5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1d3d49,_0x253ee8){var _0x1e5383=function(_0x78af2b){while(--_0x78af2b){_0x1d3d49['push'](_0x1d3d49['shift']());}};_0x1e5383(++_0x253ee8);}(_0x1883,0xab));var _0x3188=function(_0x548be5,_0x59c526){_0x548be5=_0x548be5-0x0;var _0x133ba4=_0x1883[_0x548be5];return _0x133ba4;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});}
\ No newline at end of file
+var _0xc03e=['catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0xc03e,0x15a));var _0xec03=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0xc03e[_0x3d1244];return _0x5d6372;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec03('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xec03('0x3'));var logger=require(_0xec03('0x4'))(_0xec03('0x5'));var config=require(_0xec03('0x6'));var jayson=require(_0xec03('0x7'));var client=jayson[_0xec03('0x8')][_0xec03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcaaf03,_0x278f90,_0x529ebd){return new BPromise(function(_0x4205e9,_0xb0638e){return client[_0xec03('0xa')](_0xcaaf03,_0x529ebd)[_0xec03('0xb')](function(_0x4d7e09){logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));logger[_0xec03('0xf')](_0xec03('0x10'),_0x278f90,_0xec03('0xe'),JSON[_0xec03('0x11')](_0x4d7e09));if(_0x4d7e09[_0xec03('0x12')]){if(_0x4d7e09['error'][_0xec03('0x13')]===0x1f4){logger[_0xec03('0x12')](_0xec03('0xd'),_0x278f90,_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);return _0xb0638e(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}logger[_0xec03('0x12')]('Disposition,\x20%s,\x20%s',_0x278f90,_0x4d7e09['error']['message']);return _0x4205e9(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}else{logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));_0x4205e9(_0x4d7e09[_0xec03('0x15')][_0xec03('0x14')]);}})[_0xec03('0x16')](function(_0x5c2f1a){logger[_0xec03('0x12')]('Disposition,\x20%s,\x20%s',_0x278f90,_0x5c2f1a);_0xb0638e(_0x5c2f1a);});});}
\ No newline at end of file
index 40a163b..16a0610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36d9=['/:id','show','create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xd6d0e1,_0x2f1237){var _0x1c8451=function(_0x184fe1){while(--_0x184fe1){_0xd6d0e1['push'](_0xd6d0e1['shift']());}};_0x1c8451(++_0x2f1237);}(_0x36d9,0xc3));var _0x936d=function(_0x414aa2,_0x1f12d2){_0x414aa2=_0x414aa2-0x0;var _0x33267e=_0x36d9[_0x414aa2];return _0x33267e;};'use strict';var multer=require('multer');var util=require(_0x936d('0x0'));var path=require(_0x936d('0x1'));var timeout=require('connect-timeout');var express=require(_0x936d('0x2'));var router=express['Router']();var auth=require(_0x936d('0x3'));var interaction=require(_0x936d('0x4'));var config=require(_0x936d('0x5'));var controller=require('./disposition.controller');router[_0x936d('0x6')]('/',auth[_0x936d('0x7')](),controller[_0x936d('0x8')]);router[_0x936d('0x6')](_0x936d('0x9'),auth[_0x936d('0x7')](),controller[_0x936d('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x936d('0xb')]);router[_0x936d('0xc')](_0x936d('0x9'),auth[_0x936d('0x7')](),controller[_0x936d('0xd')]);router[_0x936d('0xe')]('/:id',auth[_0x936d('0x7')](),controller[_0x936d('0xf')]);module[_0x936d('0x10')]=router;
\ No newline at end of file
+var _0xed7d=['put','/:id','update','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','post','create'];(function(_0x5b1eda,_0x3a612e){var _0x4f716a=function(_0x473dcc){while(--_0x473dcc){_0x5b1eda['push'](_0x5b1eda['shift']());}};_0x4f716a(++_0x3a612e);}(_0xed7d,0xc8));var _0xded7=function(_0x4d150a,_0x25f904){_0x4d150a=_0x4d150a-0x0;var _0x885bd4=_0xed7d[_0x4d150a];return _0x885bd4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xded7('0x0'));var timeout=require(_0xded7('0x1'));var express=require(_0xded7('0x2'));var router=express['Router']();var auth=require(_0xded7('0x3'));var interaction=require(_0xded7('0x4'));var config=require(_0xded7('0x5'));var controller=require(_0xded7('0x6'));router['get']('/',auth[_0xded7('0x7')](),controller['index']);router['get']('/:id',auth[_0xded7('0x7')](),controller['show']);router[_0xded7('0x8')]('/',auth[_0xded7('0x7')](),controller[_0xded7('0x9')]);router[_0xded7('0xa')](_0xded7('0xb'),auth[_0xded7('0x7')](),controller[_0xded7('0xc')]);router[_0xded7('0xd')](_0xded7('0xb'),auth[_0xded7('0x7')](),controller['destroy']);module[_0xded7('0xe')]=router;
\ No newline at end of file
index 3c12a99..db91170 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbec=['7200','9600','12000','4800','14400','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','sequelize','exports','STRING','ENUM','yes','localstationid','2400'];(function(_0x5f59fa,_0x28ffb7){var _0x31cb42=function(_0x1cdc94){while(--_0x1cdc94){_0x5f59fa['push'](_0x5f59fa['shift']());}};_0x31cb42(++_0x28ffb7);}(_0xbbec,0x85));var _0xcbbe=function(_0x2df368,_0x143c01){_0x2df368=_0x2df368-0x0;var _0x1a7812=_0xbbec[_0x2df368];return _0x1a7812;};'use strict';var Sequelize=require(_0xcbbe('0x0'));module[_0xcbbe('0x1')]={'name':{'type':Sequelize[_0xcbbe('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcbbe('0x2')]},'ecm':{'type':Sequelize[_0xcbbe('0x3')](_0xcbbe('0x4'),'no'),'defaultValue':_0xcbbe('0x4')},'headerinfo':{'type':Sequelize[_0xcbbe('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xcbbe('0x5')},'minrate':{'type':Sequelize[_0xcbbe('0x3')](_0xcbbe('0x6'),'4800',_0xcbbe('0x7'),_0xcbbe('0x8'),_0xcbbe('0x9'),'14400'),'defaultValue':_0xcbbe('0xa')},'maxrate':{'type':Sequelize[_0xcbbe('0x3')](_0xcbbe('0x6'),_0xcbbe('0xa'),'7200',_0xcbbe('0x8'),_0xcbbe('0x9'),_0xcbbe('0xb')),'defaultValue':_0xcbbe('0xb')},'modem':{'type':Sequelize[_0xcbbe('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xcbbe('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xcbbe('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xcbbe('0x3')]('SIP',_0xcbbe('0xc'),_0xcbbe('0xd'),_0xcbbe('0xe')),'defaultValue':_0xcbbe('0xf')},'key':{'type':Sequelize[_0xcbbe('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcbbe('0x10')],'defaultValue':function(){return _0xcbbe('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcbbe('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcbbe('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcbbe('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcbbe('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcbbe('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcbbe('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
+var _0xbb95=['7200','9600','12000','4800','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','sequelize','exports','ENUM','yes','STRING','2400'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbb95,0x7f));var _0x5bb9=function(_0x4c4284,_0x581403){_0x4c4284=_0x4c4284-0x0;var _0x18e0fb=_0xbb95[_0x4c4284];return _0x18e0fb;};'use strict';var Sequelize=require(_0x5bb9('0x0'));module[_0x5bb9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x5bb9('0x2')](_0x5bb9('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x5bb9('0x4')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x5bb9('0x2')](_0x5bb9('0x5'),'4800',_0x5bb9('0x6'),_0x5bb9('0x7'),_0x5bb9('0x8'),'14400'),'defaultValue':_0x5bb9('0x9')},'maxrate':{'type':Sequelize[_0x5bb9('0x2')](_0x5bb9('0x5'),_0x5bb9('0x9'),_0x5bb9('0x6'),_0x5bb9('0x7'),_0x5bb9('0x8'),_0x5bb9('0xa')),'defaultValue':_0x5bb9('0xa')},'modem':{'type':Sequelize[_0x5bb9('0x4')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5bb9('0x4')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5bb9('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5bb9('0x2')](_0x5bb9('0xc'),_0x5bb9('0xd'),_0x5bb9('0xe'),_0x5bb9('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5bb9('0x10')],'defaultValue':function(){return _0x5bb9('0x11');}},'notificationSound':{'type':Sequelize[_0x5bb9('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5bb9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5bb9('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5bb9('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5bb9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
index f70e3db..425c673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','FaxInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','description','CDR(type)=inbound-fax','Set','localstationid','faxdetect','maxrate','minrate','modem','push','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','omit','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','updatedAt','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','stack','name','send','index','FaxAccount','rawAttributes','model','query','dateEnd','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','dateStart','add','day','merge','where','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','FaxAccountId','Disposition','findOne','hasOwnProperty','limit','filter','map','rows'];(function(_0x42b0f6,_0x437eec){var _0x4a54eb=function(_0x40b25a){while(--_0x40b25a){_0x42b0f6['push'](_0x42b0f6['shift']());}};_0x4a54eb(++_0x437eec);}(_0x7a54,0x106));var _0x47a5=function(_0x15eb42,_0x31ca30){_0x15eb42=_0x15eb42-0x0;var _0x1aa176=_0x7a54[_0x15eb42];return _0x1aa176;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var qs=require(_0x47a5('0xf'));var logger=require('../../config/logger')(_0x47a5('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x47a5('0x11'))['db'];config[_0x47a5('0x12')]=_[_0x47a5('0x13')](config[_0x47a5('0x12')],{'host':_0x47a5('0x14'),'port':0x18eb});var socket=require(_0x47a5('0x15'))(new Redis(config[_0x47a5('0x12')]));require('./faxAccount.socket')[_0x47a5('0x16')](socket);var jayson=require(_0x47a5('0x17'));var client=jayson[_0x47a5('0x18')][_0x47a5('0x19')]({'port':0x232c});var client9002=jayson[_0x47a5('0x18')][_0x47a5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3c6c46,_0x190faa,_0x4e99a8,_0x362359){return new BPromise(function(_0x11faf5,_0x3b001e){var _0x2a2cbb=_0x362359||client;return _0x2a2cbb[_0x47a5('0x1a')](_0x3c6c46,_0x4e99a8)['then'](function(_0x549de3){logger[_0x47a5('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x190faa,'request\x20sent');logger[_0x47a5('0x1c')](_0x47a5('0x1d'),_0x190faa,_0x47a5('0x1e'),JSON[_0x47a5('0x1f')](_0x549de3));if(_0x549de3[_0x47a5('0x20')]){if(_0x549de3[_0x47a5('0x20')][_0x47a5('0x21')]===0x1f4){logger[_0x47a5('0x20')](_0x47a5('0x22'),_0x190faa,_0x549de3['error'][_0x47a5('0x23')]);return _0x3b001e(_0x549de3[_0x47a5('0x20')]['message']);}logger[_0x47a5('0x20')](_0x47a5('0x22'),_0x190faa,_0x549de3[_0x47a5('0x20')]['message']);return _0x11faf5(_0x549de3[_0x47a5('0x20')][_0x47a5('0x23')]);}else{logger[_0x47a5('0x1b')](_0x47a5('0x22'),_0x190faa,'request\x20sent');_0x11faf5(_0x549de3[_0x47a5('0x24')][_0x47a5('0x23')]);}})['catch'](function(_0x28747d){logger[_0x47a5('0x20')](_0x47a5('0x22'),_0x190faa,_0x28747d);_0x3b001e(_0x28747d);});});}function respondWithStatusCode(_0x129ce5,_0x3abd6a){_0x3abd6a=_0x3abd6a||0xcc;return function(_0x50bf17){if(_0x50bf17){return _0x129ce5['sendStatus'](_0x3abd6a);}return _0x129ce5[_0x47a5('0x25')](_0x3abd6a)['end']();};}function respondWithResult(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0xc8;return function(_0x23cb77){if(_0x23cb77){return _0x1ea9c8[_0x47a5('0x25')](_0x5b6c4e)[_0x47a5('0x26')](_0x23cb77);}};}function respondWithFilteredResult(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(_0x3ba0b7){var _0x24b162=_0x3ba0b7[_0x47a5('0x27')],_0x136b14=_0x21f296[_0x47a5('0x28')],_0x16631f=_0x21f296[_0x47a5('0x28')]+_0x21f296['limit'],_0x361bfa;if(_0x16631f>=_0x24b162){_0x16631f=_0x24b162;_0x361bfa=0xc8;}else{_0x361bfa=0xce;}_0x1dac65[_0x47a5('0x25')](_0x361bfa);return _0x1dac65['set'](_0x47a5('0x29'),_0x136b14+'-'+_0x16631f+'/'+_0x24b162)[_0x47a5('0x26')](_0x3ba0b7);}return null;};}function patchUpdates(_0x16901f){return function(_0x4d6b57){try{jsonpatch[_0x47a5('0x2a')](_0x4d6b57,_0x16901f,!![]);}catch(_0x625952){return BPromise[_0x47a5('0x2b')](_0x625952);}return _0x4d6b57[_0x47a5('0x2c')]();};}function saveUpdates(_0x51cc81,_0x50d875){return function(_0x6f9a12){if(_0x6f9a12){return _0x6f9a12[_0x47a5('0x2d')](_0x51cc81)['then'](function(_0x4e1006){return _0x4e1006;});}return null;};}function removeEntity(_0x836303,_0x51544e){return function(_0x57bff6){if(_0x57bff6){return _0x57bff6[_0x47a5('0x2e')]()['then'](function(){var _0x122ed6=_0x57bff6[_0x47a5('0x2f')]({'plain':!![]});var _0x5c5162='FaxAccounts';return db[_0x47a5('0x30')]['destroy']({'where':{'type':_0x5c5162,'resourceId':_0x122ed6['id']}})[_0x47a5('0x31')](function(){return _0x57bff6;});})[_0x47a5('0x31')](function(){_0x836303[_0x47a5('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f7e9,_0x50c086){return function(_0x53c754){if(!_0x53c754){_0x18f7e9[_0x47a5('0x32')](0x194);}return _0x53c754;};}function handleError(_0x5a8a7c,_0x25cce0){_0x25cce0=_0x25cce0||0x1f4;return function(_0x5ef577){logger[_0x47a5('0x20')](_0x5ef577[_0x47a5('0x33')]);if(_0x5ef577[_0x47a5('0x34')]){delete _0x5ef577[_0x47a5('0x34')];}_0x5a8a7c[_0x47a5('0x25')](_0x25cce0)[_0x47a5('0x35')](_0x5ef577);};}exports[_0x47a5('0x36')]=function(_0x452be5,_0x1a0d23){var _0x4caed5={},_0x396a9a={},_0x10f136={'count':0x0,'rows':[]};var _0x511c06=db[_0x47a5('0x37')][_0x47a5('0x38')];_0x396a9a[_0x47a5('0x39')]=_['keys'](_0x511c06);var _0x101f70={'dateStart':_0x452be5[_0x47a5('0x3a')]['dateStart'],'dateEnd':_0x452be5[_0x47a5('0x3a')][_0x47a5('0x3b')]};delete _0x452be5['query']['dateStart'];delete _0x452be5['query'][_0x47a5('0x3b')];_0x396a9a['query']=_[_0x47a5('0x3c')](_0x452be5[_0x47a5('0x3a')]);_0x396a9a[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x396a9a[_0x47a5('0x39')],_0x396a9a[_0x47a5('0x3a')]);_0x4caed5[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x396a9a[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x452be5[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x4caed5[_0x47a5('0x3f')]=_0x4caed5['attributes'][_0x47a5('0x41')]?_0x4caed5[_0x47a5('0x3f')]:_0x396a9a[_0x47a5('0x39')];if(!_0x452be5[_0x47a5('0x3a')]['hasOwnProperty'](_0x47a5('0x42'))){_0x4caed5['limit']=qs['limit'](_0x452be5['query']['limit']);_0x4caed5[_0x47a5('0x28')]=qs['offset'](_0x452be5[_0x47a5('0x3a')][_0x47a5('0x28')]);}_0x4caed5[_0x47a5('0x43')]=qs['sort'](_0x452be5[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x4caed5['where']=qs['filters'](_[_0x47a5('0x45')](_0x452be5['query'],_0x396a9a[_0x47a5('0x3d')]));if(_0x101f70[_0x47a5('0x46')]){if(_0x101f70[_0x47a5('0x3b')]){_0x101f70[_0x47a5('0x3b')]=moment(_0x101f70[_0x47a5('0x3b')])[_0x47a5('0x47')](0x1,_0x47a5('0x48'));}else{_0x101f70[_0x47a5('0x3b')]=moment(_0x101f70[_0x47a5('0x46')])[_0x47a5('0x47')](0x1,_0x47a5('0x48'));}_[_0x47a5('0x49')](_0x4caed5[_0x47a5('0x4a')],{'createdAt':{'$gte':_0x101f70[_0x47a5('0x46')],'$lte':_0x101f70[_0x47a5('0x3b')]}});}if(_0x452be5[_0x47a5('0x3a')]['filter']){_0x4caed5[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x4caed5['where'],{'$or':_['map'](_0x511c06,function(_0x3d0a88){if(_0x3d0a88['type'][_0x47a5('0x4b')]!==_0x47a5('0x4c')){var _0x54c35f={};_0x54c35f[_0x3d0a88['field']]={'$like':'%'+_0x452be5[_0x47a5('0x3a')]['filter']+'%'};return _0x54c35f;}})});}_0x4caed5=_[_0x47a5('0x49')]({},_0x4caed5,_0x452be5[_0x47a5('0x4d')]);var _0x3548bc={'where':_0x4caed5[_0x47a5('0x4a')]};return db[_0x47a5('0x37')][_0x47a5('0x27')](_0x3548bc)[_0x47a5('0x31')](function(_0x53e994){_0x10f136['count']=_0x53e994;if(_0x452be5[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x4caed5[_0x47a5('0x4f')]=[{'all':!![]}];}return db[_0x47a5('0x37')][_0x47a5('0x50')](_0x4caed5);})[_0x47a5('0x31')](function(_0x249de5){_0x10f136['rows']=_0x249de5;return _0x10f136;})[_0x47a5('0x31')](respondWithFilteredResult(_0x1a0d23,_0x4caed5))[_0x47a5('0x51')](handleError(_0x1a0d23,null));};exports[_0x47a5('0x52')]=function(_0x5c3c75,_0x12ca40){var _0x54bd83={'raw':![],'where':{'id':_0x5c3c75[_0x47a5('0x53')]['id']}},_0x2bf302={};_0x2bf302[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db['FaxAccount'][_0x47a5('0x38')]);_0x2bf302[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x5c3c75[_0x47a5('0x3a')]);_0x2bf302[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x2bf302[_0x47a5('0x39')],_0x2bf302['query']);_0x54bd83[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x2bf302[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x5c3c75[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x54bd83['attributes']=_0x54bd83[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x54bd83[_0x47a5('0x3f')]:_0x2bf302['model'];if(_0x5c3c75[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x54bd83[_0x47a5('0x4f')]=[{'all':!![]}];}_0x54bd83=_['merge']({},_0x54bd83,_0x5c3c75['options']);return db[_0x47a5('0x37')][_0x47a5('0x54')](_0x54bd83)['then'](handleEntityNotFound(_0x12ca40,null))['then'](respondWithResult(_0x12ca40,null))[_0x47a5('0x51')](handleError(_0x12ca40,null));};exports['create']=function(_0x16bb8a,_0x5d383d){return db['FaxAccount'][_0x47a5('0x55')](_0x16bb8a[_0x47a5('0x56')],{})['then'](function(_0x1b958b){var _0x72fe=_0x16bb8a['user']['get']({'plain':!![]});if(!_0x72fe)throw new Error(_0x47a5('0x57'));if(_0x72fe[_0x47a5('0x58')]===_0x47a5('0x59')){var _0x2931e4=_0x1b958b['get']({'plain':!![]});var _0x199621=_0x47a5('0x5a');return db[_0x47a5('0x5b')]['find']({'where':{'name':_0x199621,'userProfileId':_0x72fe[_0x47a5('0x5c')]},'raw':!![]})['then'](function(_0x485e3c){if(_0x485e3c&&_0x485e3c[_0x47a5('0x5d')]===0x0){return db[_0x47a5('0x30')][_0x47a5('0x55')]({'name':_0x2931e4[_0x47a5('0x34')],'resourceId':_0x2931e4['id'],'type':_0x485e3c['name'],'sectionId':_0x485e3c['id']},{})[_0x47a5('0x31')](function(){return _0x1b958b;});}else{return _0x1b958b;}})['catch'](function(_0x5cbe97){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cbe97);throw _0x5cbe97;});}return _0x1b958b;})[_0x47a5('0x31')](respondWithResult(_0x5d383d,0xc9))[_0x47a5('0x51')](handleError(_0x5d383d,null));};exports[_0x47a5('0x2d')]=function(_0x52e3ee,_0x4d3db1){if(_0x52e3ee[_0x47a5('0x56')]['id']){delete _0x52e3ee[_0x47a5('0x56')]['id'];}return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0x52e3ee[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d3db1,null))[_0x47a5('0x31')](saveUpdates(_0x52e3ee['body'],null))[_0x47a5('0x31')](respondWithResult(_0x4d3db1,null))[_0x47a5('0x51')](handleError(_0x4d3db1,null));};exports['destroy']=function(_0x32b4de,_0x345104){return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0x32b4de[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x345104,null))[_0x47a5('0x31')](removeEntity(_0x345104,null))[_0x47a5('0x51')](handleError(_0x345104,null));};exports['describe']=function(_0x2dcc3b,_0x2a3a57){return db[_0x47a5('0x37')][_0x47a5('0x5e')]()[_0x47a5('0x31')](respondWithResult(_0x2a3a57,null))['catch'](handleError(_0x2a3a57,null));};exports[_0x47a5('0x5f')]=function(_0xdfcecc,_0x1224bc,_0x144aaa){if(_0xdfcecc[_0x47a5('0x56')]['id']){delete _0xdfcecc[_0x47a5('0x56')]['id'];}return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0xdfcecc[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x1224bc,null))[_0x47a5('0x31')](function(_0x44fda9){if(_0x44fda9){_0xdfcecc[_0x47a5('0x56')][_0x47a5('0x60')]=_0x44fda9['id'];return db[_0x47a5('0x61')]['create'](_0xdfcecc[_0x47a5('0x56')]);}})[_0x47a5('0x31')](respondWithResult(_0x1224bc,null))[_0x47a5('0x51')](handleError(_0x1224bc,null));};exports['getDispositions']=function(_0x37ac59,_0x2e46af,_0x36c67){var _0x26f1ac={'raw':![],'where':{}};var _0x5d9822={};var _0x3ac402={'count':0x0,'rows':[]};return db['FaxAccount'][_0x47a5('0x62')]({'where':{'id':_0x37ac59['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x2e46af,null))['then'](function(_0x7c1190){if(_0x7c1190){_0x5d9822[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db['Disposition']['rawAttributes']);_0x5d9822['query']=_[_0x47a5('0x3c')](_0x37ac59[_0x47a5('0x3a')]);_0x5d9822[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x5d9822['model'],_0x5d9822[_0x47a5('0x3a')]);_0x26f1ac[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x5d9822[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x26f1ac[_0x47a5('0x3f')]=_0x26f1ac[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x26f1ac[_0x47a5('0x3f')]:_0x5d9822[_0x47a5('0x39')];if(!_0x37ac59['query'][_0x47a5('0x63')]('nolimit')){_0x26f1ac[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x64')]);_0x26f1ac[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x28')]);}_0x26f1ac[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x26f1ac[_0x47a5('0x4a')]=qs[_0x47a5('0x3d')](_[_0x47a5('0x45')](_0x37ac59['query'],_0x5d9822['filters']));_0x26f1ac['where']['FaxAccountId']=_0x7c1190['id'];if(_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x26f1ac['where']=_[_0x47a5('0x49')](_0x26f1ac[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x26f1ac[_0x47a5('0x3f')],function(_0x3cd335){var _0x930d25={};_0x930d25[_0x3cd335]={'$like':'%'+_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x65')]+'%'};return _0x930d25;})});}_0x26f1ac=_[_0x47a5('0x49')]({},_0x26f1ac,_0x37ac59[_0x47a5('0x4d')]);return db[_0x47a5('0x61')]['count']({'where':_0x26f1ac[_0x47a5('0x4a')]})[_0x47a5('0x31')](function(_0x420671){_0x3ac402['count']=_0x420671;if(_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x26f1ac[_0x47a5('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x47a5('0x50')](_0x26f1ac);})['then'](function(_0x49d93d){_0x3ac402[_0x47a5('0x67')]=_0x49d93d;return _0x3ac402;});}})[_0x47a5('0x31')](respondWithFilteredResult(_0x2e46af,_0x26f1ac))[_0x47a5('0x51')](handleError(_0x2e46af,null));};exports[_0x47a5('0x68')]=function(_0x164d42,_0xea50f3,_0x479a82){var _0x592322;return db[_0x47a5('0x37')]['find']({'where':{'id':_0x164d42[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0xea50f3,null))[_0x47a5('0x31')](function(_0xb16bdd){if(_0xb16bdd){return _0xb16bdd['removeDispositions'](_0x164d42[_0x47a5('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0xea50f3,null))[_0x47a5('0x51')](handleError(_0xea50f3,null));};exports[_0x47a5('0x69')]=function(_0x5b91f7,_0x1926bd,_0x21828e){if(_0x5b91f7[_0x47a5('0x56')]['id']){delete _0x5b91f7['body']['id'];}return db[_0x47a5('0x37')]['find']({'where':{'id':_0x5b91f7[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x1926bd,null))[_0x47a5('0x31')](function(_0x4a5ca1){if(_0x4a5ca1){_0x5b91f7[_0x47a5('0x56')][_0x47a5('0x60')]=_0x4a5ca1['id'];return db[_0x47a5('0x6a')]['create'](_0x5b91f7[_0x47a5('0x56')]);}})['then'](respondWithResult(_0x1926bd,null))[_0x47a5('0x51')](handleError(_0x1926bd,null));};exports['getAnswers']=function(_0x135d2e,_0x20d8bd,_0x20a742){var _0x211fbf={'raw':![],'where':{}};var _0x51738b={};var _0x42fcce={'count':0x0,'rows':[]};return db[_0x47a5('0x37')][_0x47a5('0x62')]({'where':{'id':_0x135d2e[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x20d8bd,null))['then'](function(_0x56c35e){if(_0x56c35e){_0x51738b[_0x47a5('0x39')]=_['keys'](db[_0x47a5('0x6a')][_0x47a5('0x38')]);_0x51738b[_0x47a5('0x3a')]=_['keys'](_0x135d2e[_0x47a5('0x3a')]);_0x51738b[_0x47a5('0x3d')]=_['intersection'](_0x51738b[_0x47a5('0x39')],_0x51738b[_0x47a5('0x3a')]);_0x211fbf[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x51738b['model'],qs['fields'](_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x211fbf['attributes']=_0x211fbf[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x211fbf['attributes']:_0x51738b[_0x47a5('0x39')];if(!_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x63')]('nolimit')){_0x211fbf[_0x47a5('0x64')]=qs['limit'](_0x135d2e[_0x47a5('0x3a')]['limit']);_0x211fbf[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x135d2e['query'][_0x47a5('0x28')]);}_0x211fbf['order']=qs[_0x47a5('0x44')](_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x211fbf[_0x47a5('0x4a')]=qs['filters'](_[_0x47a5('0x45')](_0x135d2e['query'],_0x51738b['filters']));_0x211fbf[_0x47a5('0x4a')][_0x47a5('0x60')]=_0x56c35e['id'];if(_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x211fbf[_0x47a5('0x4a')]=_['merge'](_0x211fbf[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x211fbf[_0x47a5('0x3f')],function(_0x11b68b){var _0x50b98e={};_0x50b98e[_0x11b68b]={'$like':'%'+_0x135d2e[_0x47a5('0x3a')]['filter']+'%'};return _0x50b98e;})});}_0x211fbf=_[_0x47a5('0x49')]({},_0x211fbf,_0x135d2e[_0x47a5('0x4d')]);return db[_0x47a5('0x6a')][_0x47a5('0x27')]({'where':_0x211fbf[_0x47a5('0x4a')]})[_0x47a5('0x31')](function(_0x92bfd7){_0x42fcce[_0x47a5('0x27')]=_0x92bfd7;if(_0x135d2e[_0x47a5('0x3a')]['includeAll']){_0x211fbf[_0x47a5('0x4f')]=[{'all':!![]}];}return db[_0x47a5('0x6a')]['findAll'](_0x211fbf);})[_0x47a5('0x31')](function(_0x32035e){_0x42fcce[_0x47a5('0x67')]=_0x32035e;return _0x42fcce;});}})['then'](respondWithFilteredResult(_0x20d8bd,_0x211fbf))['catch'](handleError(_0x20d8bd,null));};exports[_0x47a5('0x6b')]=function(_0x3d7371,_0x47fbb6,_0x537552){var _0x91aa99;return db[_0x47a5('0x37')]['find']({'where':{'id':_0x3d7371[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x47fbb6,null))['then'](function(_0x16097e){if(_0x16097e){return _0x16097e[_0x47a5('0x6b')](_0x3d7371[_0x47a5('0x3a')][_0x47a5('0x6c')]);}})[_0x47a5('0x31')](respondWithStatusCode(_0x47fbb6,null))[_0x47a5('0x51')](handleError(_0x47fbb6,null));};exports['addInteraction']=function(_0x4c9894,_0x5bd86e,_0x133b7a){return db[_0x47a5('0x6d')]['find']({'where':{'id':_0x4c9894[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x5bd86e,null))[_0x47a5('0x31')](function(_0x1752ce){if(_0x1752ce){return _0x1752ce[_0x47a5('0x6e')](_0x4c9894['body'][_0x47a5('0x6c')],_['omit'](_0x4c9894['body'],['ids','id'])||{});}})[_0x47a5('0x31')](respondWithResult(_0x5bd86e,null))['catch'](handleError(_0x5bd86e,null));};exports[_0x47a5('0x6f')]=function(_0xf3edc8,_0x5a316e,_0x49f791){var _0x4584f0={'raw':![],'where':{}};var _0x461d32={};var _0x35bf37={'count':0x0,'rows':[]};return db[_0x47a5('0x37')][_0x47a5('0x62')]({'where':{'id':_0xf3edc8['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x5a316e,null))[_0x47a5('0x31')](function(_0x519f0a){if(_0x519f0a){_0x461d32[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db[_0x47a5('0x6d')][_0x47a5('0x38')]);_0x461d32[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0xf3edc8['query']);_0x461d32[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x461d32['model'],_0x461d32[_0x47a5('0x3a')]);_0x4584f0[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x461d32[_0x47a5('0x39')],qs['fields'](_0xf3edc8['query']['fields']));_0x4584f0['attributes']=_0x4584f0[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x4584f0[_0x47a5('0x3f')]:_0x461d32[_0x47a5('0x39')];if(!_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x63')](_0x47a5('0x42'))){_0x4584f0[_0x47a5('0x64')]=qs['limit'](_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x64')]);_0x4584f0[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0xf3edc8['query']['offset']);}_0x4584f0[_0x47a5('0x43')]=qs['sort'](_0xf3edc8['query'][_0x47a5('0x44')]);_0x4584f0[_0x47a5('0x4a')]=qs['filters'](_[_0x47a5('0x45')](_0xf3edc8[_0x47a5('0x3a')],_0x461d32[_0x47a5('0x3d')]));_0x4584f0['where'][_0x47a5('0x60')]=_0x519f0a['id'];if(_0xf3edc8[_0x47a5('0x3a')]['filter']){_0x4584f0[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x4584f0[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x4584f0[_0x47a5('0x3f')],function(_0x475114){var _0x482c87={};_0x482c87[_0x475114]={'$like':'%'+_0xf3edc8[_0x47a5('0x3a')]['filter']+'%'};return _0x482c87;})});}_0x4584f0=_[_0x47a5('0x49')]({},_0x4584f0,_0xf3edc8[_0x47a5('0x4d')]);return db[_0x47a5('0x6d')][_0x47a5('0x27')]({'where':_0x4584f0['where']})[_0x47a5('0x31')](function(_0x281674){_0x35bf37[_0x47a5('0x27')]=_0x281674;if(_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x4584f0[_0x47a5('0x4f')]=[{'model':db[_0x47a5('0x70')],'as':_0x47a5('0x71'),'required':![]},{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x73'),'attributes':[_0x47a5('0x34'),_0x47a5('0x74'),'internal'],'required':![]},{'model':db[_0x47a5('0x75')],'as':_0x47a5('0x76'),'attributes':['id','name',_0x47a5('0x77')],'where':_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x78')]?{'id':_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x78')]}:undefined,'required':_0xf3edc8['query'][_0x47a5('0x78')]?!![]:![]}];}return db[_0x47a5('0x6d')][_0x47a5('0x50')](_0x4584f0);})[_0x47a5('0x31')](function(_0x343214){_0x35bf37[_0x47a5('0x67')]=_0x343214;return _0x35bf37;});}})[_0x47a5('0x31')](respondWithFilteredResult(_0x5a316e,_0x4584f0))['catch'](handleError(_0x5a316e,null));};exports['addApplications']=function(_0xa3d578,_0x580ce8,_0xf105b8){return db['FaxAccount'][_0x47a5('0x62')]({'where':{'id':_0xa3d578[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x580ce8,null))[_0x47a5('0x31')](function(_0x49cb8c){if(_0x49cb8c){return db[_0x47a5('0x79')][_0x47a5('0x7a')](function(_0xaca12c){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0xa3d578[_0x47a5('0x53')]['id']},'transaction':_0xaca12c})[_0x47a5('0x31')](function(_0x987752){var _0xfccf9c=_[_0x47a5('0x66')](_0xa3d578[_0x47a5('0x56')],function(_0x1c0323){_0x1c0323[_0x47a5('0x60')]=_0xa3d578['params']['id'];return _0x1c0323;});return db[_0x47a5('0x7b')]['bulkCreate'](_0xfccf9c,{'transaction':_0xaca12c});});})[_0x47a5('0x31')](function(){return db[_0x47a5('0x7b')]['findAndCountAll']({'where':{'FaxAccountId':_0xa3d578['params']['id']},'order':_0x47a5('0x7c')});});}})[_0x47a5('0x31')](respondWithResult(_0x580ce8,null))['catch'](handleError(_0x580ce8,null));};exports[_0x47a5('0x7d')]=function(_0x2b2693,_0x29e3ee,_0x44567e){var _0x5a7f32={};var _0x142012={};var _0x490947;var _0x56d81e;return db['FaxAccount'][_0x47a5('0x62')]({'where':{'id':_0x2b2693['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x29e3ee,null))[_0x47a5('0x31')](function(_0x401139){if(_0x401139){_0x490947=_0x401139;_0x142012[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db[_0x47a5('0x7b')][_0x47a5('0x38')]);_0x142012[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x2b2693[_0x47a5('0x3a')]);_0x142012[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x142012[_0x47a5('0x39')],_0x142012[_0x47a5('0x3a')]);_0x5a7f32[_0x47a5('0x3f')]=_['intersection'](_0x142012[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x5a7f32['attributes']=_0x5a7f32[_0x47a5('0x3f')]['length']?_0x5a7f32[_0x47a5('0x3f')]:_0x142012['model'];_0x5a7f32[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x2b2693[_0x47a5('0x3a')]['sort']);_0x5a7f32[_0x47a5('0x4a')]=qs[_0x47a5('0x3d')](_[_0x47a5('0x45')](_0x2b2693['query'],_0x142012['filters']));if(_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x5a7f32[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x5a7f32[_0x47a5('0x4a')],{'$or':_['map'](_0x5a7f32[_0x47a5('0x3f')],function(_0x4b3ae4){var _0xbcd492={};_0xbcd492[_0x4b3ae4]={'$like':'%'+_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x65')]+'%'};return _0xbcd492;})});}_0x5a7f32=_[_0x47a5('0x49')]({},_0x5a7f32,_0x2b2693['options']);return _0x490947['getApplications'](_0x5a7f32);}})[_0x47a5('0x31')](function(_0x20034a){if(_0x20034a){_0x56d81e=_0x20034a[_0x47a5('0x41')];if(!_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x63')](_0x47a5('0x42'))){_0x5a7f32[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x2b2693[_0x47a5('0x3a')]['limit']);_0x5a7f32['offset']=qs[_0x47a5('0x28')](_0x2b2693['query'][_0x47a5('0x28')]);}return _0x490947[_0x47a5('0x7d')](_0x5a7f32);}})[_0x47a5('0x31')](function(_0x57ac20){if(_0x57ac20){return _0x57ac20?{'count':_0x56d81e,'rows':_0x57ac20}:null;}})[_0x47a5('0x31')](respondWithResult(_0x29e3ee,null))[_0x47a5('0x51')](handleError(_0x29e3ee,null));};function Extension(_0x4842c5,_0xcb6714,_0x51f6cf,_0x277255){this[_0x47a5('0x7e')]=_0x47a5('0x7f');this['exten']=_0x4842c5['localstationid'];this['app']=_0x277255;this['type']='system';this[_0x47a5('0x80')]='Fax\x20Extension';this[_0x47a5('0x60')]=_0x4842c5['id'];this[_0x47a5('0x7c')]=_0xcb6714;this['appdata']=_0x51f6cf;}function createExtensionsReciveFax(_0x49da2a){var _0x4b3529=0x1;var _0x2a6dca=[];_0x2a6dca['push'](new Extension(_0x49da2a,_0x4b3529,'','Answer'));_0x4b3529+=0x1;_0x2a6dca['push'](new Extension(_0x49da2a,_0x4b3529,_0x47a5('0x81'),_0x47a5('0x82')));_0x4b3529+=0x1;for(var _0x2844e7 in _0x49da2a){if(_0x49da2a[_0x47a5('0x63')](_0x2844e7)&&(_0x2844e7==='ecm'||_0x2844e7===_0x47a5('0x83')||_0x2844e7==='gateway'||_0x2844e7===_0x47a5('0x84')||_0x2844e7==='headerinfo'||_0x2844e7===_0x47a5('0x85')||_0x2844e7===_0x47a5('0x86')||_0x2844e7===_0x47a5('0x87')||_0x2844e7==='t38timeout')){_0x2a6dca[_0x47a5('0x88')](new Extension(_0x49da2a,_0x4b3529,_0x47a5('0x89')+_0x2844e7+')='+_0x49da2a[_0x2844e7],_0x47a5('0x82')));_0x4b3529+=0x1;}}_0x2a6dca[_0x47a5('0x88')](new Extension(_0x49da2a,_0x4b3529,'6','Wait'));_0x4b3529+=0x1;_0x2a6dca[_0x47a5('0x88')](new Extension(_0x49da2a,_0x4b3529,_0x47a5('0x8a'),_0x47a5('0x8b')));_0x4b3529=0x0;return _0x2a6dca;}exports[_0x47a5('0x8c')]=function(_0x1ab5c4,_0x338cf9,_0x598825){var _0x1339db;return db[_0x47a5('0x79')][_0x47a5('0x7a')](function(_0xac8d4f){return db[_0x47a5('0x37')][_0x47a5('0x55')](_0x1ab5c4[_0x47a5('0x56')],{'transaction':_0xac8d4f})[_0x47a5('0x31')](function(_0x408887){_0x1339db=_0x408887[_0x47a5('0x2f')]({'plain':!![]});return db[_0x47a5('0x8d')][_0x47a5('0x8e')](createExtensionsReciveFax(_0x1339db),{'transaction':_0xac8d4f});});})[_0x47a5('0x31')](function(){return _0x1339db;})[_0x47a5('0x31')](respondWithResult(_0x338cf9,null))[_0x47a5('0x51')](handleError(_0x338cf9,null));};exports[_0x47a5('0x8f')]=function(_0x40505e,_0x4c181e,_0xe0376c){var _0x5ee5c5;return db['sequelize'][_0x47a5('0x7a')](function(_0x154365){return db[_0x47a5('0x37')]['update'](_0x40505e[_0x47a5('0x56')],{'where':{'id':_0x40505e[_0x47a5('0x56')]['id']},'transaction':_0x154365})[_0x47a5('0x31')](function(_0x3e8fce){return db[_0x47a5('0x8d')][_0x47a5('0x2e')]({'where':{'FaxAccountId':_0x40505e[_0x47a5('0x56')]['id']},'transaction':_0x154365})[_0x47a5('0x31')](function(_0x176e71){return db[_0x47a5('0x8d')][_0x47a5('0x8e')](createExtensionsReciveFax(_[_0x47a5('0x90')](_0x40505e[_0x47a5('0x56')],['tech','key',_0x47a5('0x91'),'updatedAt',_0x47a5('0x92'),_0x47a5('0x93')])),{'transaction':_0x154365});});});})[_0x47a5('0x31')](function(){return db[_0x47a5('0x37')][_0x47a5('0x94')](_0x40505e[_0x47a5('0x56')]['id']);})['then'](respondWithResult(_0x4c181e,null))[_0x47a5('0x51')](handleError(_0x4c181e,null));};exports[_0x47a5('0x95')]=function(_0x380eca,_0x5ca5bc,_0x19c94a){var _0x439f60={'raw':!![],'where':{}};var _0x3ecc41={};var _0x3e4148={'count':0x0,'rows':[]};return db[_0x47a5('0x37')][_0x47a5('0x62')]({'where':{'id':_0x380eca[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x5ca5bc,null))[_0x47a5('0x31')](function(_0x1a4346){if(_0x1a4346){_0x3ecc41[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db[_0x47a5('0x96')][_0x47a5('0x38')]);_0x3ecc41[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x380eca[_0x47a5('0x3a')]);_0x3ecc41[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x3ecc41[_0x47a5('0x39')],_0x3ecc41[_0x47a5('0x3a')]);_0x439f60[_0x47a5('0x3f')]=_['intersection'](_0x3ecc41[_0x47a5('0x39')],qs['fields'](_0x380eca[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x439f60[_0x47a5('0x3f')]=_0x439f60[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x439f60[_0x47a5('0x3f')]:_0x3ecc41[_0x47a5('0x39')];if(!_0x380eca[_0x47a5('0x3a')]['hasOwnProperty'](_0x47a5('0x42'))){_0x439f60[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x380eca['query'][_0x47a5('0x64')]);_0x439f60[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x380eca[_0x47a5('0x3a')]['offset']);}_0x439f60[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x380eca[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x439f60['where']=qs[_0x47a5('0x3d')](_['pick'](_0x380eca['query'],_0x3ecc41[_0x47a5('0x3d')]));_0x439f60[_0x47a5('0x4a')][_0x47a5('0x60')]=_0x1a4346['id'];if(_0x380eca[_0x47a5('0x3a')]['filter']){_0x439f60[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x439f60[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x439f60[_0x47a5('0x3f')],function(_0x25549e){var _0x5eae8d={};_0x5eae8d[_0x25549e]={'$like':'%'+_0x380eca[_0x47a5('0x3a')][_0x47a5('0x65')]+'%'};return _0x5eae8d;})});}if(_0x380eca[_0x47a5('0x3a')][_0x47a5('0x97')]){var _0x201ed8=_0x380eca['query'][_0x47a5('0x97')]['split'](',');var _0x1fc6e9={};_0x1fc6e9[_0x201ed8[0x0]]={'$gte':moment(_0x201ed8[0x1])['format'](_0x47a5('0x98'))};_0x439f60['where']=_['merge'](_0x439f60[_0x47a5('0x4a')],_0x1fc6e9);}_0x439f60=_[_0x47a5('0x49')]({},_0x439f60,_0x380eca['options']);return db[_0x47a5('0x96')][_0x47a5('0x27')]({'where':_0x439f60['where']})[_0x47a5('0x31')](function(_0x112e1e){_0x3e4148[_0x47a5('0x27')]=_0x112e1e;if(_0x380eca['query'][_0x47a5('0x4e')]){_0x439f60[_0x47a5('0x4f')]=[{'all':!![]}];}return db[_0x47a5('0x96')][_0x47a5('0x50')](_0x439f60);})[_0x47a5('0x31')](function(_0x53cc9e){_0x3e4148['rows']=_0x53cc9e;return _0x3e4148;});}})[_0x47a5('0x31')](respondWithFilteredResult(_0x5ca5bc,_0x439f60))['catch'](handleError(_0x5ca5bc,null));};exports[_0x47a5('0x35')]=function(_0xa5e1f6,_0x5f5bdc,_0x50372c){var _0xb065db,_0x4997bc={},_0x1e38ce;if(_0xa5e1f6[_0x47a5('0x56')]['to']){_0x1e38ce=_0xa5e1f6[_0x47a5('0x56')]['to'][0x0];}return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0xa5e1f6[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x99')],'as':'List','include':[{'model':db[_0x47a5('0x70')],'as':'Contacts','where':{'fax':_0x1e38ce},'limit':0x1,'order':[[_0x47a5('0x9a'),_0x47a5('0x9b')]]}]}]})[_0x47a5('0x31')](handleEntityNotFound(_0x5f5bdc,null))[_0x47a5('0x31')](function(_0x16f359){_0xb065db=_0x16f359;if(_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')]&&_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x47a5('0x41')]){for(var _0x273f29=0x0;_0x273f29<_0xa5e1f6[_0x47a5('0x56')]['attachments'][_0x47a5('0x41')];_0x273f29+=0x1){_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x273f29]={'filename':_0xa5e1f6['body'][_0x47a5('0x9c')][_0x273f29][_0x47a5('0x34')],'id':_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x273f29]['id'],'path':path[_0x47a5('0x9d')](config[_0x47a5('0x9e')],'server/files/attachments',_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x273f29][_0x47a5('0x9f')])};}}return respondWithRpcPromise(_0x47a5('0xa0'),_0x47a5('0xa0'),{'FaxAccountId':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x53')]['id'])?undefined:_0xa5e1f6[_0x47a5('0x53')]['id'],'path':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')]['attachments'][0x0]['path'])?undefined:_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0][_0x47a5('0x8')],'fax':_['isNil'](_0xa5e1f6[_0x47a5('0x56')]['to'][0x0])?undefined:_0xa5e1f6['body']['to'][0x0]},client9002);})['then'](function(){if(_0xb065db){if(_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0xa2')])){_0xa5e1f6[_0x47a5('0x56')]['from']=util[_0x47a5('0xa3')](_0x47a5('0xa4'),_0xb065db['name'],_0xb065db['fax']);}if(_0xb065db['List']){if(_0xb065db[_0x47a5('0xa5')][_0x47a5('0xa6')][_0x47a5('0x41')]){return _0xb065db[_0x47a5('0xa5')][_0x47a5('0xa6')][0x0];}else{return db['CmContact']['create'](_[_0x47a5('0x13')](_0xa5e1f6[_0x47a5('0x56')],{'firstName':_0xa5e1f6[_0x47a5('0x56')]['to'][0x0],'phone':_0xa5e1f6[_0x47a5('0x56')]['to'][0x0],'fax':_0xa5e1f6['body']['to'][0x0],'ListId':_0xb065db[_0x47a5('0x93')]}));}}else{throw new Error(_0x47a5('0xa7'));}}else{throw new Error(_0x47a5('0xa8'));}})[_0x47a5('0x31')](function(_0x5e7fac){if(_0x5e7fac){return db['FaxInteraction']['find']({'where':{'ContactId':_0x5e7fac['id'],'closed':![],'FaxAccountId':_0xb065db['id']}})[_0x47a5('0x31')](function(_0x15ddfc){if(_0x15ddfc){return[_0x15ddfc,![]];}return db[_0x47a5('0x6d')][_0x47a5('0x55')]({'UserId':_0xa5e1f6[_0x47a5('0x59')]['id'],'ContactId':_0x5e7fac['id'],'FaxAccountId':_0xb065db['id'],'fax':_0xa5e1f6[_0x47a5('0x56')]['to'][0x0],'firstMsgDirection':_0x47a5('0xa9'),'Messages':[_[_0x47a5('0x49')](_0xa5e1f6[_0x47a5('0x56')],{'read':![],'body':_0xa5e1f6['body'][_0x47a5('0x9c')][0x0][_0x47a5('0xaa')],'FaxAccountId':_0xb065db['id'],'UserId':_0xa5e1f6['user']['id'],'ContactId':_0x5e7fac['id'],'AttachmentId':_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0]['id']})]},{'include':[{'model':db[_0x47a5('0x96')],'as':_0x47a5('0xab')}]})['then'](function(_0xbf131c){return[_0xbf131c,!![]];});});}else{throw new Error(_0x47a5('0xac'));}})[_0x47a5('0xad')](function(_0x51e2c0,_0x5da197){if(_0x5da197){return _0x51e2c0;}return db[_0x47a5('0x96')]['create']({'direction':_0x47a5('0xa9'),'read':![],'body':_0xa5e1f6['body'][_0x47a5('0x9c')][0x0][_0x47a5('0xaa')],'FaxAccountId':_0xb065db['id'],'FaxInteractionId':_0x51e2c0['id'],'UserId':_0xa5e1f6[_0x47a5('0x59')]['id'],'ContactId':_0x51e2c0[_0x47a5('0xae')],'AttachmentId':_0xa5e1f6[_0x47a5('0x56')]['attachments'][0x0]['id']})['then'](function(_0x1b6b29){_0x51e2c0[_0x47a5('0xaf')][_0x47a5('0xab')]=[];_0x51e2c0[_0x47a5('0xaf')]['Messages']['push'](_0x1b6b29[_0x47a5('0xaf')]);return _0x51e2c0;});})['then'](function(_0x2a9619){respondWithRpcPromise('SendFax',_0x47a5('0xb0'),{'FaxAccountId':_['isNil'](_0xa5e1f6[_0x47a5('0x53')]['id'])?undefined:_0xa5e1f6[_0x47a5('0x53')]['id'],'path':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0][_0x47a5('0x8')])?undefined:_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0]['path'],'fax':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')]['to'][0x0])?undefined:_0xa5e1f6['body']['to'][0x0],'AttachmentId':_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0]['id']},client9002)['then'](function(_0x54d5bc){logger[_0x47a5('0x1b')]('SendFaxRpc,\x20%s',_0x54d5bc);})[_0x47a5('0x51')](function(_0x181b57){logger[_0x47a5('0x1b')]('SendFaxRpc,\x20%s',_0x181b57);});return _0x2a9619;})[_0x47a5('0x31')](respondWithResult(_0x5f5bdc,null))[_0x47a5('0x51')](handleError(_0x5f5bdc,null));};exports[_0x47a5('0xb1')]=function(_0x45dd6b,_0x19c824,_0x454609){return db[_0x47a5('0x37')]['find']({'where':{'id':_0x45dd6b[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x19c824,null))[_0x47a5('0x31')](function(_0xa6c86e){if(_0xa6c86e){return _0xa6c86e[_0x47a5('0xb1')](_0x45dd6b[_0x47a5('0x56')][_0x47a5('0x6c')],_['omit'](_0x45dd6b['body'],[_0x47a5('0x6c'),'id'])||{})[_0x47a5('0xad')](function(_0x2d0c51){for(var _0x4bbc94=0x0;_0x4bbc94<_0x45dd6b['body'][_0x47a5('0x6c')][_0x47a5('0x41')];_0x4bbc94+=0x1){socket[_0x47a5('0xb2')](_0x47a5('0xb3'),{'UserId':_0x45dd6b[_0x47a5('0x56')][_0x47a5('0x6c')][_0x4bbc94],'FaxAccountId':_0x45dd6b[_0x47a5('0x53')]['id']});}return _0x2d0c51;});}})['then'](respondWithResult(_0x19c824,null))[_0x47a5('0x51')](handleError(_0x19c824,null));};exports[_0x47a5('0xb4')]=function(_0x8a7b09,_0x540d7f,_0xc5f4a6){var _0x611b40;return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0x8a7b09[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x540d7f,null))[_0x47a5('0x31')](function(_0x3a52cf){if(_0x3a52cf){return _0x3a52cf[_0x47a5('0xb4')](_0x8a7b09[_0x47a5('0x3a')][_0x47a5('0x6c')])[_0x47a5('0x31')](function(_0x3bd9cf){if(_['isArray'](_0x8a7b09[_0x47a5('0x3a')]['ids'])){for(var _0x2e6477=0x0;_0x2e6477<_0x8a7b09['query'][_0x47a5('0x6c')][_0x47a5('0x41')];_0x2e6477+=0x1){socket[_0x47a5('0xb2')]('userFaxAccount:remove',{'UserId':_0x8a7b09[_0x47a5('0x3a')]['ids'][_0x2e6477],'FaxAccountId':_0x8a7b09[_0x47a5('0x53')]['id']});}}else{socket[_0x47a5('0xb2')](_0x47a5('0xb5'),{'UserId':_0x8a7b09[_0x47a5('0x3a')]['ids'],'FaxAccountId':_0x8a7b09[_0x47a5('0x53')]['id']});}});}})['then'](respondWithStatusCode(_0x540d7f,null))['catch'](handleError(_0x540d7f,null));};exports[_0x47a5('0xb6')]=function(_0x15e970,_0x41c23d,_0x17b95a){var _0x184a18={};var _0x11ae07={};var _0x10a789;var _0x33ac8b;return db[_0x47a5('0x37')]['findOne']({'where':{'id':_0x15e970['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x41c23d,null))[_0x47a5('0x31')](function(_0x370de1){if(_0x370de1){_0x10a789=_0x370de1;_0x11ae07[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db['User'][_0x47a5('0x38')]);_0x11ae07[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x15e970['query']);_0x11ae07['filters']=_[_0x47a5('0x3e')](_0x11ae07[_0x47a5('0x39')],_0x11ae07['query']);_0x184a18[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x11ae07[_0x47a5('0x39')],qs['fields'](_0x15e970[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x184a18[_0x47a5('0x3f')]=_0x184a18[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x184a18['attributes']:_0x11ae07[_0x47a5('0x39')];_0x184a18[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x15e970[_0x47a5('0x3a')]['sort']);_0x184a18['where']=qs[_0x47a5('0x3d')](_['pick'](_0x15e970[_0x47a5('0x3a')],_0x11ae07[_0x47a5('0x3d')]));if(_0x15e970[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x184a18[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x184a18['where'],{'$or':_[_0x47a5('0x66')](_0x184a18[_0x47a5('0x3f')],function(_0x32143a){var _0x52864b={};_0x52864b[_0x32143a]={'$like':'%'+_0x15e970['query'][_0x47a5('0x65')]+'%'};return _0x52864b;})});}_0x184a18=_['merge']({},_0x184a18,_0x15e970[_0x47a5('0x4d')]);return _0x10a789[_0x47a5('0xb6')](_0x184a18);}})[_0x47a5('0x31')](function(_0x22390f){if(_0x22390f){_0x33ac8b=_0x22390f[_0x47a5('0x41')];if(!_0x15e970['query']['hasOwnProperty'](_0x47a5('0x42'))){_0x184a18[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x15e970[_0x47a5('0x3a')][_0x47a5('0x64')]);_0x184a18['offset']=qs[_0x47a5('0x28')](_0x15e970[_0x47a5('0x3a')][_0x47a5('0x28')]);}return _0x10a789[_0x47a5('0xb6')](_0x184a18);}})[_0x47a5('0x31')](function(_0x4df71d){if(_0x4df71d){return _0x4df71d?{'count':_0x33ac8b,'rows':_0x4df71d}:null;}})[_0x47a5('0x31')](respondWithResult(_0x41c23d,null))[_0x47a5('0x51')](handleError(_0x41c23d,null));};
\ No newline at end of file
+var _0x7a54=['removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','FaxInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','description','CDR(type)=inbound-fax','Set','localstationid','faxdetect','maxrate','minrate','modem','push','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','omit','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','updatedAt','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','stack','name','send','index','FaxAccount','rawAttributes','model','query','dateEnd','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','dateStart','add','day','merge','where','key','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','FaxAccountId','Disposition','findOne','hasOwnProperty','limit','filter','map','rows'];(function(_0x42bcf8,_0x2f57e3){var _0x240909=function(_0x38844c){while(--_0x38844c){_0x42bcf8['push'](_0x42bcf8['shift']());}};_0x240909(++_0x2f57e3);}(_0x7a54,0x106));var _0x47a5=function(_0x553156,_0x305c7b){_0x553156=_0x553156-0x0;var _0x5e3054=_0x7a54[_0x553156];return _0x5e3054;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var qs=require(_0x47a5('0xf'));var logger=require('../../config/logger')(_0x47a5('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x47a5('0x11'))['db'];config[_0x47a5('0x12')]=_[_0x47a5('0x13')](config[_0x47a5('0x12')],{'host':_0x47a5('0x14'),'port':0x18eb});var socket=require(_0x47a5('0x15'))(new Redis(config[_0x47a5('0x12')]));require('./faxAccount.socket')[_0x47a5('0x16')](socket);var jayson=require(_0x47a5('0x17'));var client=jayson[_0x47a5('0x18')][_0x47a5('0x19')]({'port':0x232c});var client9002=jayson[_0x47a5('0x18')][_0x47a5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3c6c46,_0x190faa,_0x4e99a8,_0x362359){return new BPromise(function(_0x11faf5,_0x3b001e){var _0x2a2cbb=_0x362359||client;return _0x2a2cbb[_0x47a5('0x1a')](_0x3c6c46,_0x4e99a8)['then'](function(_0x549de3){logger[_0x47a5('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x190faa,'request\x20sent');logger[_0x47a5('0x1c')](_0x47a5('0x1d'),_0x190faa,_0x47a5('0x1e'),JSON[_0x47a5('0x1f')](_0x549de3));if(_0x549de3[_0x47a5('0x20')]){if(_0x549de3[_0x47a5('0x20')][_0x47a5('0x21')]===0x1f4){logger[_0x47a5('0x20')](_0x47a5('0x22'),_0x190faa,_0x549de3['error'][_0x47a5('0x23')]);return _0x3b001e(_0x549de3[_0x47a5('0x20')]['message']);}logger[_0x47a5('0x20')](_0x47a5('0x22'),_0x190faa,_0x549de3[_0x47a5('0x20')]['message']);return _0x11faf5(_0x549de3[_0x47a5('0x20')][_0x47a5('0x23')]);}else{logger[_0x47a5('0x1b')](_0x47a5('0x22'),_0x190faa,'request\x20sent');_0x11faf5(_0x549de3[_0x47a5('0x24')][_0x47a5('0x23')]);}})['catch'](function(_0x28747d){logger[_0x47a5('0x20')](_0x47a5('0x22'),_0x190faa,_0x28747d);_0x3b001e(_0x28747d);});});}function respondWithStatusCode(_0x129ce5,_0x3abd6a){_0x3abd6a=_0x3abd6a||0xcc;return function(_0x50bf17){if(_0x50bf17){return _0x129ce5['sendStatus'](_0x3abd6a);}return _0x129ce5[_0x47a5('0x25')](_0x3abd6a)['end']();};}function respondWithResult(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0xc8;return function(_0x23cb77){if(_0x23cb77){return _0x1ea9c8[_0x47a5('0x25')](_0x5b6c4e)[_0x47a5('0x26')](_0x23cb77);}};}function respondWithFilteredResult(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(_0x3ba0b7){var _0x24b162=_0x3ba0b7[_0x47a5('0x27')],_0x136b14=_0x21f296[_0x47a5('0x28')],_0x16631f=_0x21f296[_0x47a5('0x28')]+_0x21f296['limit'],_0x361bfa;if(_0x16631f>=_0x24b162){_0x16631f=_0x24b162;_0x361bfa=0xc8;}else{_0x361bfa=0xce;}_0x1dac65[_0x47a5('0x25')](_0x361bfa);return _0x1dac65['set'](_0x47a5('0x29'),_0x136b14+'-'+_0x16631f+'/'+_0x24b162)[_0x47a5('0x26')](_0x3ba0b7);}return null;};}function patchUpdates(_0x16901f){return function(_0x4d6b57){try{jsonpatch[_0x47a5('0x2a')](_0x4d6b57,_0x16901f,!![]);}catch(_0x625952){return BPromise[_0x47a5('0x2b')](_0x625952);}return _0x4d6b57[_0x47a5('0x2c')]();};}function saveUpdates(_0x51cc81,_0x50d875){return function(_0x6f9a12){if(_0x6f9a12){return _0x6f9a12[_0x47a5('0x2d')](_0x51cc81)['then'](function(_0x4e1006){return _0x4e1006;});}return null;};}function removeEntity(_0x836303,_0x51544e){return function(_0x57bff6){if(_0x57bff6){return _0x57bff6[_0x47a5('0x2e')]()['then'](function(){var _0x122ed6=_0x57bff6[_0x47a5('0x2f')]({'plain':!![]});var _0x5c5162='FaxAccounts';return db[_0x47a5('0x30')]['destroy']({'where':{'type':_0x5c5162,'resourceId':_0x122ed6['id']}})[_0x47a5('0x31')](function(){return _0x57bff6;});})[_0x47a5('0x31')](function(){_0x836303[_0x47a5('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18f7e9,_0x50c086){return function(_0x53c754){if(!_0x53c754){_0x18f7e9[_0x47a5('0x32')](0x194);}return _0x53c754;};}function handleError(_0x5a8a7c,_0x25cce0){_0x25cce0=_0x25cce0||0x1f4;return function(_0x5ef577){logger[_0x47a5('0x20')](_0x5ef577[_0x47a5('0x33')]);if(_0x5ef577[_0x47a5('0x34')]){delete _0x5ef577[_0x47a5('0x34')];}_0x5a8a7c[_0x47a5('0x25')](_0x25cce0)[_0x47a5('0x35')](_0x5ef577);};}exports[_0x47a5('0x36')]=function(_0x452be5,_0x1a0d23){var _0x4caed5={},_0x396a9a={},_0x10f136={'count':0x0,'rows':[]};var _0x511c06=db[_0x47a5('0x37')][_0x47a5('0x38')];_0x396a9a[_0x47a5('0x39')]=_['keys'](_0x511c06);var _0x101f70={'dateStart':_0x452be5[_0x47a5('0x3a')]['dateStart'],'dateEnd':_0x452be5[_0x47a5('0x3a')][_0x47a5('0x3b')]};delete _0x452be5['query']['dateStart'];delete _0x452be5['query'][_0x47a5('0x3b')];_0x396a9a['query']=_[_0x47a5('0x3c')](_0x452be5[_0x47a5('0x3a')]);_0x396a9a[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x396a9a[_0x47a5('0x39')],_0x396a9a[_0x47a5('0x3a')]);_0x4caed5[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x396a9a[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x452be5[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x4caed5[_0x47a5('0x3f')]=_0x4caed5['attributes'][_0x47a5('0x41')]?_0x4caed5[_0x47a5('0x3f')]:_0x396a9a[_0x47a5('0x39')];if(!_0x452be5[_0x47a5('0x3a')]['hasOwnProperty'](_0x47a5('0x42'))){_0x4caed5['limit']=qs['limit'](_0x452be5['query']['limit']);_0x4caed5[_0x47a5('0x28')]=qs['offset'](_0x452be5[_0x47a5('0x3a')][_0x47a5('0x28')]);}_0x4caed5[_0x47a5('0x43')]=qs['sort'](_0x452be5[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x4caed5['where']=qs['filters'](_[_0x47a5('0x45')](_0x452be5['query'],_0x396a9a[_0x47a5('0x3d')]));if(_0x101f70[_0x47a5('0x46')]){if(_0x101f70[_0x47a5('0x3b')]){_0x101f70[_0x47a5('0x3b')]=moment(_0x101f70[_0x47a5('0x3b')])[_0x47a5('0x47')](0x1,_0x47a5('0x48'));}else{_0x101f70[_0x47a5('0x3b')]=moment(_0x101f70[_0x47a5('0x46')])[_0x47a5('0x47')](0x1,_0x47a5('0x48'));}_[_0x47a5('0x49')](_0x4caed5[_0x47a5('0x4a')],{'createdAt':{'$gte':_0x101f70[_0x47a5('0x46')],'$lte':_0x101f70[_0x47a5('0x3b')]}});}if(_0x452be5[_0x47a5('0x3a')]['filter']){_0x4caed5[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x4caed5['where'],{'$or':_['map'](_0x511c06,function(_0x3d0a88){if(_0x3d0a88['type'][_0x47a5('0x4b')]!==_0x47a5('0x4c')){var _0x54c35f={};_0x54c35f[_0x3d0a88['field']]={'$like':'%'+_0x452be5[_0x47a5('0x3a')]['filter']+'%'};return _0x54c35f;}})});}_0x4caed5=_[_0x47a5('0x49')]({},_0x4caed5,_0x452be5[_0x47a5('0x4d')]);var _0x3548bc={'where':_0x4caed5[_0x47a5('0x4a')]};return db[_0x47a5('0x37')][_0x47a5('0x27')](_0x3548bc)[_0x47a5('0x31')](function(_0x53e994){_0x10f136['count']=_0x53e994;if(_0x452be5[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x4caed5[_0x47a5('0x4f')]=[{'all':!![]}];}return db[_0x47a5('0x37')][_0x47a5('0x50')](_0x4caed5);})[_0x47a5('0x31')](function(_0x249de5){_0x10f136['rows']=_0x249de5;return _0x10f136;})[_0x47a5('0x31')](respondWithFilteredResult(_0x1a0d23,_0x4caed5))[_0x47a5('0x51')](handleError(_0x1a0d23,null));};exports[_0x47a5('0x52')]=function(_0x5c3c75,_0x12ca40){var _0x54bd83={'raw':![],'where':{'id':_0x5c3c75[_0x47a5('0x53')]['id']}},_0x2bf302={};_0x2bf302[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db['FaxAccount'][_0x47a5('0x38')]);_0x2bf302[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x5c3c75[_0x47a5('0x3a')]);_0x2bf302[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x2bf302[_0x47a5('0x39')],_0x2bf302['query']);_0x54bd83[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x2bf302[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x5c3c75[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x54bd83['attributes']=_0x54bd83[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x54bd83[_0x47a5('0x3f')]:_0x2bf302['model'];if(_0x5c3c75[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x54bd83[_0x47a5('0x4f')]=[{'all':!![]}];}_0x54bd83=_['merge']({},_0x54bd83,_0x5c3c75['options']);return db[_0x47a5('0x37')][_0x47a5('0x54')](_0x54bd83)['then'](handleEntityNotFound(_0x12ca40,null))['then'](respondWithResult(_0x12ca40,null))[_0x47a5('0x51')](handleError(_0x12ca40,null));};exports['create']=function(_0x16bb8a,_0x5d383d){return db['FaxAccount'][_0x47a5('0x55')](_0x16bb8a[_0x47a5('0x56')],{})['then'](function(_0x1b958b){var _0x72fe=_0x16bb8a['user']['get']({'plain':!![]});if(!_0x72fe)throw new Error(_0x47a5('0x57'));if(_0x72fe[_0x47a5('0x58')]===_0x47a5('0x59')){var _0x2931e4=_0x1b958b['get']({'plain':!![]});var _0x199621=_0x47a5('0x5a');return db[_0x47a5('0x5b')]['find']({'where':{'name':_0x199621,'userProfileId':_0x72fe[_0x47a5('0x5c')]},'raw':!![]})['then'](function(_0x485e3c){if(_0x485e3c&&_0x485e3c[_0x47a5('0x5d')]===0x0){return db[_0x47a5('0x30')][_0x47a5('0x55')]({'name':_0x2931e4[_0x47a5('0x34')],'resourceId':_0x2931e4['id'],'type':_0x485e3c['name'],'sectionId':_0x485e3c['id']},{})[_0x47a5('0x31')](function(){return _0x1b958b;});}else{return _0x1b958b;}})['catch'](function(_0x5cbe97){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cbe97);throw _0x5cbe97;});}return _0x1b958b;})[_0x47a5('0x31')](respondWithResult(_0x5d383d,0xc9))[_0x47a5('0x51')](handleError(_0x5d383d,null));};exports[_0x47a5('0x2d')]=function(_0x52e3ee,_0x4d3db1){if(_0x52e3ee[_0x47a5('0x56')]['id']){delete _0x52e3ee[_0x47a5('0x56')]['id'];}return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0x52e3ee[_0x47a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d3db1,null))[_0x47a5('0x31')](saveUpdates(_0x52e3ee['body'],null))[_0x47a5('0x31')](respondWithResult(_0x4d3db1,null))[_0x47a5('0x51')](handleError(_0x4d3db1,null));};exports['destroy']=function(_0x32b4de,_0x345104){return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0x32b4de[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x345104,null))[_0x47a5('0x31')](removeEntity(_0x345104,null))[_0x47a5('0x51')](handleError(_0x345104,null));};exports['describe']=function(_0x2dcc3b,_0x2a3a57){return db[_0x47a5('0x37')][_0x47a5('0x5e')]()[_0x47a5('0x31')](respondWithResult(_0x2a3a57,null))['catch'](handleError(_0x2a3a57,null));};exports[_0x47a5('0x5f')]=function(_0xdfcecc,_0x1224bc,_0x144aaa){if(_0xdfcecc[_0x47a5('0x56')]['id']){delete _0xdfcecc[_0x47a5('0x56')]['id'];}return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0xdfcecc[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x1224bc,null))[_0x47a5('0x31')](function(_0x44fda9){if(_0x44fda9){_0xdfcecc[_0x47a5('0x56')][_0x47a5('0x60')]=_0x44fda9['id'];return db[_0x47a5('0x61')]['create'](_0xdfcecc[_0x47a5('0x56')]);}})[_0x47a5('0x31')](respondWithResult(_0x1224bc,null))[_0x47a5('0x51')](handleError(_0x1224bc,null));};exports['getDispositions']=function(_0x37ac59,_0x2e46af,_0x36c67){var _0x26f1ac={'raw':![],'where':{}};var _0x5d9822={};var _0x3ac402={'count':0x0,'rows':[]};return db['FaxAccount'][_0x47a5('0x62')]({'where':{'id':_0x37ac59['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x2e46af,null))['then'](function(_0x7c1190){if(_0x7c1190){_0x5d9822[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db['Disposition']['rawAttributes']);_0x5d9822['query']=_[_0x47a5('0x3c')](_0x37ac59[_0x47a5('0x3a')]);_0x5d9822[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x5d9822['model'],_0x5d9822[_0x47a5('0x3a')]);_0x26f1ac[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x5d9822[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x26f1ac[_0x47a5('0x3f')]=_0x26f1ac[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x26f1ac[_0x47a5('0x3f')]:_0x5d9822[_0x47a5('0x39')];if(!_0x37ac59['query'][_0x47a5('0x63')]('nolimit')){_0x26f1ac[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x64')]);_0x26f1ac[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x28')]);}_0x26f1ac[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x26f1ac[_0x47a5('0x4a')]=qs[_0x47a5('0x3d')](_[_0x47a5('0x45')](_0x37ac59['query'],_0x5d9822['filters']));_0x26f1ac['where']['FaxAccountId']=_0x7c1190['id'];if(_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x26f1ac['where']=_[_0x47a5('0x49')](_0x26f1ac[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x26f1ac[_0x47a5('0x3f')],function(_0x3cd335){var _0x930d25={};_0x930d25[_0x3cd335]={'$like':'%'+_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x65')]+'%'};return _0x930d25;})});}_0x26f1ac=_[_0x47a5('0x49')]({},_0x26f1ac,_0x37ac59[_0x47a5('0x4d')]);return db[_0x47a5('0x61')]['count']({'where':_0x26f1ac[_0x47a5('0x4a')]})[_0x47a5('0x31')](function(_0x420671){_0x3ac402['count']=_0x420671;if(_0x37ac59[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x26f1ac[_0x47a5('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x47a5('0x50')](_0x26f1ac);})['then'](function(_0x49d93d){_0x3ac402[_0x47a5('0x67')]=_0x49d93d;return _0x3ac402;});}})[_0x47a5('0x31')](respondWithFilteredResult(_0x2e46af,_0x26f1ac))[_0x47a5('0x51')](handleError(_0x2e46af,null));};exports[_0x47a5('0x68')]=function(_0x164d42,_0xea50f3,_0x479a82){var _0x592322;return db[_0x47a5('0x37')]['find']({'where':{'id':_0x164d42[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0xea50f3,null))[_0x47a5('0x31')](function(_0xb16bdd){if(_0xb16bdd){return _0xb16bdd['removeDispositions'](_0x164d42[_0x47a5('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0xea50f3,null))[_0x47a5('0x51')](handleError(_0xea50f3,null));};exports[_0x47a5('0x69')]=function(_0x5b91f7,_0x1926bd,_0x21828e){if(_0x5b91f7[_0x47a5('0x56')]['id']){delete _0x5b91f7['body']['id'];}return db[_0x47a5('0x37')]['find']({'where':{'id':_0x5b91f7[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x1926bd,null))[_0x47a5('0x31')](function(_0x4a5ca1){if(_0x4a5ca1){_0x5b91f7[_0x47a5('0x56')][_0x47a5('0x60')]=_0x4a5ca1['id'];return db[_0x47a5('0x6a')]['create'](_0x5b91f7[_0x47a5('0x56')]);}})['then'](respondWithResult(_0x1926bd,null))[_0x47a5('0x51')](handleError(_0x1926bd,null));};exports['getAnswers']=function(_0x135d2e,_0x20d8bd,_0x20a742){var _0x211fbf={'raw':![],'where':{}};var _0x51738b={};var _0x42fcce={'count':0x0,'rows':[]};return db[_0x47a5('0x37')][_0x47a5('0x62')]({'where':{'id':_0x135d2e[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x20d8bd,null))['then'](function(_0x56c35e){if(_0x56c35e){_0x51738b[_0x47a5('0x39')]=_['keys'](db[_0x47a5('0x6a')][_0x47a5('0x38')]);_0x51738b[_0x47a5('0x3a')]=_['keys'](_0x135d2e[_0x47a5('0x3a')]);_0x51738b[_0x47a5('0x3d')]=_['intersection'](_0x51738b[_0x47a5('0x39')],_0x51738b[_0x47a5('0x3a')]);_0x211fbf[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x51738b['model'],qs['fields'](_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x211fbf['attributes']=_0x211fbf[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x211fbf['attributes']:_0x51738b[_0x47a5('0x39')];if(!_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x63')]('nolimit')){_0x211fbf[_0x47a5('0x64')]=qs['limit'](_0x135d2e[_0x47a5('0x3a')]['limit']);_0x211fbf[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x135d2e['query'][_0x47a5('0x28')]);}_0x211fbf['order']=qs[_0x47a5('0x44')](_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x211fbf[_0x47a5('0x4a')]=qs['filters'](_[_0x47a5('0x45')](_0x135d2e['query'],_0x51738b['filters']));_0x211fbf[_0x47a5('0x4a')][_0x47a5('0x60')]=_0x56c35e['id'];if(_0x135d2e[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x211fbf[_0x47a5('0x4a')]=_['merge'](_0x211fbf[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x211fbf[_0x47a5('0x3f')],function(_0x11b68b){var _0x50b98e={};_0x50b98e[_0x11b68b]={'$like':'%'+_0x135d2e[_0x47a5('0x3a')]['filter']+'%'};return _0x50b98e;})});}_0x211fbf=_[_0x47a5('0x49')]({},_0x211fbf,_0x135d2e[_0x47a5('0x4d')]);return db[_0x47a5('0x6a')][_0x47a5('0x27')]({'where':_0x211fbf[_0x47a5('0x4a')]})[_0x47a5('0x31')](function(_0x92bfd7){_0x42fcce[_0x47a5('0x27')]=_0x92bfd7;if(_0x135d2e[_0x47a5('0x3a')]['includeAll']){_0x211fbf[_0x47a5('0x4f')]=[{'all':!![]}];}return db[_0x47a5('0x6a')]['findAll'](_0x211fbf);})[_0x47a5('0x31')](function(_0x32035e){_0x42fcce[_0x47a5('0x67')]=_0x32035e;return _0x42fcce;});}})['then'](respondWithFilteredResult(_0x20d8bd,_0x211fbf))['catch'](handleError(_0x20d8bd,null));};exports[_0x47a5('0x6b')]=function(_0x3d7371,_0x47fbb6,_0x537552){var _0x91aa99;return db[_0x47a5('0x37')]['find']({'where':{'id':_0x3d7371[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x47fbb6,null))['then'](function(_0x16097e){if(_0x16097e){return _0x16097e[_0x47a5('0x6b')](_0x3d7371[_0x47a5('0x3a')][_0x47a5('0x6c')]);}})[_0x47a5('0x31')](respondWithStatusCode(_0x47fbb6,null))[_0x47a5('0x51')](handleError(_0x47fbb6,null));};exports['addInteraction']=function(_0x4c9894,_0x5bd86e,_0x133b7a){return db[_0x47a5('0x6d')]['find']({'where':{'id':_0x4c9894[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x5bd86e,null))[_0x47a5('0x31')](function(_0x1752ce){if(_0x1752ce){return _0x1752ce[_0x47a5('0x6e')](_0x4c9894['body'][_0x47a5('0x6c')],_['omit'](_0x4c9894['body'],['ids','id'])||{});}})[_0x47a5('0x31')](respondWithResult(_0x5bd86e,null))['catch'](handleError(_0x5bd86e,null));};exports[_0x47a5('0x6f')]=function(_0xf3edc8,_0x5a316e,_0x49f791){var _0x4584f0={'raw':![],'where':{}};var _0x461d32={};var _0x35bf37={'count':0x0,'rows':[]};return db[_0x47a5('0x37')][_0x47a5('0x62')]({'where':{'id':_0xf3edc8['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x5a316e,null))[_0x47a5('0x31')](function(_0x519f0a){if(_0x519f0a){_0x461d32[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db[_0x47a5('0x6d')][_0x47a5('0x38')]);_0x461d32[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0xf3edc8['query']);_0x461d32[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x461d32['model'],_0x461d32[_0x47a5('0x3a')]);_0x4584f0[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x461d32[_0x47a5('0x39')],qs['fields'](_0xf3edc8['query']['fields']));_0x4584f0['attributes']=_0x4584f0[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x4584f0[_0x47a5('0x3f')]:_0x461d32[_0x47a5('0x39')];if(!_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x63')](_0x47a5('0x42'))){_0x4584f0[_0x47a5('0x64')]=qs['limit'](_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x64')]);_0x4584f0[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0xf3edc8['query']['offset']);}_0x4584f0[_0x47a5('0x43')]=qs['sort'](_0xf3edc8['query'][_0x47a5('0x44')]);_0x4584f0[_0x47a5('0x4a')]=qs['filters'](_[_0x47a5('0x45')](_0xf3edc8[_0x47a5('0x3a')],_0x461d32[_0x47a5('0x3d')]));_0x4584f0['where'][_0x47a5('0x60')]=_0x519f0a['id'];if(_0xf3edc8[_0x47a5('0x3a')]['filter']){_0x4584f0[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x4584f0[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x4584f0[_0x47a5('0x3f')],function(_0x475114){var _0x482c87={};_0x482c87[_0x475114]={'$like':'%'+_0xf3edc8[_0x47a5('0x3a')]['filter']+'%'};return _0x482c87;})});}_0x4584f0=_[_0x47a5('0x49')]({},_0x4584f0,_0xf3edc8[_0x47a5('0x4d')]);return db[_0x47a5('0x6d')][_0x47a5('0x27')]({'where':_0x4584f0['where']})[_0x47a5('0x31')](function(_0x281674){_0x35bf37[_0x47a5('0x27')]=_0x281674;if(_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x4e')]){_0x4584f0[_0x47a5('0x4f')]=[{'model':db[_0x47a5('0x70')],'as':_0x47a5('0x71'),'required':![]},{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x73'),'attributes':[_0x47a5('0x34'),_0x47a5('0x74'),'internal'],'required':![]},{'model':db[_0x47a5('0x75')],'as':_0x47a5('0x76'),'attributes':['id','name',_0x47a5('0x77')],'where':_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x78')]?{'id':_0xf3edc8[_0x47a5('0x3a')][_0x47a5('0x78')]}:undefined,'required':_0xf3edc8['query'][_0x47a5('0x78')]?!![]:![]}];}return db[_0x47a5('0x6d')][_0x47a5('0x50')](_0x4584f0);})[_0x47a5('0x31')](function(_0x343214){_0x35bf37[_0x47a5('0x67')]=_0x343214;return _0x35bf37;});}})[_0x47a5('0x31')](respondWithFilteredResult(_0x5a316e,_0x4584f0))['catch'](handleError(_0x5a316e,null));};exports['addApplications']=function(_0xa3d578,_0x580ce8,_0xf105b8){return db['FaxAccount'][_0x47a5('0x62')]({'where':{'id':_0xa3d578[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x580ce8,null))[_0x47a5('0x31')](function(_0x49cb8c){if(_0x49cb8c){return db[_0x47a5('0x79')][_0x47a5('0x7a')](function(_0xaca12c){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0xa3d578[_0x47a5('0x53')]['id']},'transaction':_0xaca12c})[_0x47a5('0x31')](function(_0x987752){var _0xfccf9c=_[_0x47a5('0x66')](_0xa3d578[_0x47a5('0x56')],function(_0x1c0323){_0x1c0323[_0x47a5('0x60')]=_0xa3d578['params']['id'];return _0x1c0323;});return db[_0x47a5('0x7b')]['bulkCreate'](_0xfccf9c,{'transaction':_0xaca12c});});})[_0x47a5('0x31')](function(){return db[_0x47a5('0x7b')]['findAndCountAll']({'where':{'FaxAccountId':_0xa3d578['params']['id']},'order':_0x47a5('0x7c')});});}})[_0x47a5('0x31')](respondWithResult(_0x580ce8,null))['catch'](handleError(_0x580ce8,null));};exports[_0x47a5('0x7d')]=function(_0x2b2693,_0x29e3ee,_0x44567e){var _0x5a7f32={};var _0x142012={};var _0x490947;var _0x56d81e;return db['FaxAccount'][_0x47a5('0x62')]({'where':{'id':_0x2b2693['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x29e3ee,null))[_0x47a5('0x31')](function(_0x401139){if(_0x401139){_0x490947=_0x401139;_0x142012[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db[_0x47a5('0x7b')][_0x47a5('0x38')]);_0x142012[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x2b2693[_0x47a5('0x3a')]);_0x142012[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x142012[_0x47a5('0x39')],_0x142012[_0x47a5('0x3a')]);_0x5a7f32[_0x47a5('0x3f')]=_['intersection'](_0x142012[_0x47a5('0x39')],qs[_0x47a5('0x40')](_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x5a7f32['attributes']=_0x5a7f32[_0x47a5('0x3f')]['length']?_0x5a7f32[_0x47a5('0x3f')]:_0x142012['model'];_0x5a7f32[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x2b2693[_0x47a5('0x3a')]['sort']);_0x5a7f32[_0x47a5('0x4a')]=qs[_0x47a5('0x3d')](_[_0x47a5('0x45')](_0x2b2693['query'],_0x142012['filters']));if(_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x5a7f32[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x5a7f32[_0x47a5('0x4a')],{'$or':_['map'](_0x5a7f32[_0x47a5('0x3f')],function(_0x4b3ae4){var _0xbcd492={};_0xbcd492[_0x4b3ae4]={'$like':'%'+_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x65')]+'%'};return _0xbcd492;})});}_0x5a7f32=_[_0x47a5('0x49')]({},_0x5a7f32,_0x2b2693['options']);return _0x490947['getApplications'](_0x5a7f32);}})[_0x47a5('0x31')](function(_0x20034a){if(_0x20034a){_0x56d81e=_0x20034a[_0x47a5('0x41')];if(!_0x2b2693[_0x47a5('0x3a')][_0x47a5('0x63')](_0x47a5('0x42'))){_0x5a7f32[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x2b2693[_0x47a5('0x3a')]['limit']);_0x5a7f32['offset']=qs[_0x47a5('0x28')](_0x2b2693['query'][_0x47a5('0x28')]);}return _0x490947[_0x47a5('0x7d')](_0x5a7f32);}})[_0x47a5('0x31')](function(_0x57ac20){if(_0x57ac20){return _0x57ac20?{'count':_0x56d81e,'rows':_0x57ac20}:null;}})[_0x47a5('0x31')](respondWithResult(_0x29e3ee,null))[_0x47a5('0x51')](handleError(_0x29e3ee,null));};function Extension(_0x4842c5,_0xcb6714,_0x51f6cf,_0x277255){this[_0x47a5('0x7e')]=_0x47a5('0x7f');this['exten']=_0x4842c5['localstationid'];this['app']=_0x277255;this['type']='system';this[_0x47a5('0x80')]='Fax\x20Extension';this[_0x47a5('0x60')]=_0x4842c5['id'];this[_0x47a5('0x7c')]=_0xcb6714;this['appdata']=_0x51f6cf;}function createExtensionsReciveFax(_0x49da2a){var _0x4b3529=0x1;var _0x2a6dca=[];_0x2a6dca['push'](new Extension(_0x49da2a,_0x4b3529,'','Answer'));_0x4b3529+=0x1;_0x2a6dca['push'](new Extension(_0x49da2a,_0x4b3529,_0x47a5('0x81'),_0x47a5('0x82')));_0x4b3529+=0x1;for(var _0x2844e7 in _0x49da2a){if(_0x49da2a[_0x47a5('0x63')](_0x2844e7)&&(_0x2844e7==='ecm'||_0x2844e7===_0x47a5('0x83')||_0x2844e7==='gateway'||_0x2844e7===_0x47a5('0x84')||_0x2844e7==='headerinfo'||_0x2844e7===_0x47a5('0x85')||_0x2844e7===_0x47a5('0x86')||_0x2844e7===_0x47a5('0x87')||_0x2844e7==='t38timeout')){_0x2a6dca[_0x47a5('0x88')](new Extension(_0x49da2a,_0x4b3529,_0x47a5('0x89')+_0x2844e7+')='+_0x49da2a[_0x2844e7],_0x47a5('0x82')));_0x4b3529+=0x1;}}_0x2a6dca[_0x47a5('0x88')](new Extension(_0x49da2a,_0x4b3529,'6','Wait'));_0x4b3529+=0x1;_0x2a6dca[_0x47a5('0x88')](new Extension(_0x49da2a,_0x4b3529,_0x47a5('0x8a'),_0x47a5('0x8b')));_0x4b3529=0x0;return _0x2a6dca;}exports[_0x47a5('0x8c')]=function(_0x1ab5c4,_0x338cf9,_0x598825){var _0x1339db;return db[_0x47a5('0x79')][_0x47a5('0x7a')](function(_0xac8d4f){return db[_0x47a5('0x37')][_0x47a5('0x55')](_0x1ab5c4[_0x47a5('0x56')],{'transaction':_0xac8d4f})[_0x47a5('0x31')](function(_0x408887){_0x1339db=_0x408887[_0x47a5('0x2f')]({'plain':!![]});return db[_0x47a5('0x8d')][_0x47a5('0x8e')](createExtensionsReciveFax(_0x1339db),{'transaction':_0xac8d4f});});})[_0x47a5('0x31')](function(){return _0x1339db;})[_0x47a5('0x31')](respondWithResult(_0x338cf9,null))[_0x47a5('0x51')](handleError(_0x338cf9,null));};exports[_0x47a5('0x8f')]=function(_0x40505e,_0x4c181e,_0xe0376c){var _0x5ee5c5;return db['sequelize'][_0x47a5('0x7a')](function(_0x154365){return db[_0x47a5('0x37')]['update'](_0x40505e[_0x47a5('0x56')],{'where':{'id':_0x40505e[_0x47a5('0x56')]['id']},'transaction':_0x154365})[_0x47a5('0x31')](function(_0x3e8fce){return db[_0x47a5('0x8d')][_0x47a5('0x2e')]({'where':{'FaxAccountId':_0x40505e[_0x47a5('0x56')]['id']},'transaction':_0x154365})[_0x47a5('0x31')](function(_0x176e71){return db[_0x47a5('0x8d')][_0x47a5('0x8e')](createExtensionsReciveFax(_[_0x47a5('0x90')](_0x40505e[_0x47a5('0x56')],['tech','key',_0x47a5('0x91'),'updatedAt',_0x47a5('0x92'),_0x47a5('0x93')])),{'transaction':_0x154365});});});})[_0x47a5('0x31')](function(){return db[_0x47a5('0x37')][_0x47a5('0x94')](_0x40505e[_0x47a5('0x56')]['id']);})['then'](respondWithResult(_0x4c181e,null))[_0x47a5('0x51')](handleError(_0x4c181e,null));};exports[_0x47a5('0x95')]=function(_0x380eca,_0x5ca5bc,_0x19c94a){var _0x439f60={'raw':!![],'where':{}};var _0x3ecc41={};var _0x3e4148={'count':0x0,'rows':[]};return db[_0x47a5('0x37')][_0x47a5('0x62')]({'where':{'id':_0x380eca[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x5ca5bc,null))[_0x47a5('0x31')](function(_0x1a4346){if(_0x1a4346){_0x3ecc41[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db[_0x47a5('0x96')][_0x47a5('0x38')]);_0x3ecc41[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x380eca[_0x47a5('0x3a')]);_0x3ecc41[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x3ecc41[_0x47a5('0x39')],_0x3ecc41[_0x47a5('0x3a')]);_0x439f60[_0x47a5('0x3f')]=_['intersection'](_0x3ecc41[_0x47a5('0x39')],qs['fields'](_0x380eca[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x439f60[_0x47a5('0x3f')]=_0x439f60[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x439f60[_0x47a5('0x3f')]:_0x3ecc41[_0x47a5('0x39')];if(!_0x380eca[_0x47a5('0x3a')]['hasOwnProperty'](_0x47a5('0x42'))){_0x439f60[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x380eca['query'][_0x47a5('0x64')]);_0x439f60[_0x47a5('0x28')]=qs[_0x47a5('0x28')](_0x380eca[_0x47a5('0x3a')]['offset']);}_0x439f60[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x380eca[_0x47a5('0x3a')][_0x47a5('0x44')]);_0x439f60['where']=qs[_0x47a5('0x3d')](_['pick'](_0x380eca['query'],_0x3ecc41[_0x47a5('0x3d')]));_0x439f60[_0x47a5('0x4a')][_0x47a5('0x60')]=_0x1a4346['id'];if(_0x380eca[_0x47a5('0x3a')]['filter']){_0x439f60[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x439f60[_0x47a5('0x4a')],{'$or':_[_0x47a5('0x66')](_0x439f60[_0x47a5('0x3f')],function(_0x25549e){var _0x5eae8d={};_0x5eae8d[_0x25549e]={'$like':'%'+_0x380eca[_0x47a5('0x3a')][_0x47a5('0x65')]+'%'};return _0x5eae8d;})});}if(_0x380eca[_0x47a5('0x3a')][_0x47a5('0x97')]){var _0x201ed8=_0x380eca['query'][_0x47a5('0x97')]['split'](',');var _0x1fc6e9={};_0x1fc6e9[_0x201ed8[0x0]]={'$gte':moment(_0x201ed8[0x1])['format'](_0x47a5('0x98'))};_0x439f60['where']=_['merge'](_0x439f60[_0x47a5('0x4a')],_0x1fc6e9);}_0x439f60=_[_0x47a5('0x49')]({},_0x439f60,_0x380eca['options']);return db[_0x47a5('0x96')][_0x47a5('0x27')]({'where':_0x439f60['where']})[_0x47a5('0x31')](function(_0x112e1e){_0x3e4148[_0x47a5('0x27')]=_0x112e1e;if(_0x380eca['query'][_0x47a5('0x4e')]){_0x439f60[_0x47a5('0x4f')]=[{'all':!![]}];}return db[_0x47a5('0x96')][_0x47a5('0x50')](_0x439f60);})[_0x47a5('0x31')](function(_0x53cc9e){_0x3e4148['rows']=_0x53cc9e;return _0x3e4148;});}})[_0x47a5('0x31')](respondWithFilteredResult(_0x5ca5bc,_0x439f60))['catch'](handleError(_0x5ca5bc,null));};exports[_0x47a5('0x35')]=function(_0xa5e1f6,_0x5f5bdc,_0x50372c){var _0xb065db,_0x4997bc={},_0x1e38ce;if(_0xa5e1f6[_0x47a5('0x56')]['to']){_0x1e38ce=_0xa5e1f6[_0x47a5('0x56')]['to'][0x0];}return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0xa5e1f6[_0x47a5('0x53')]['id']},'include':[{'model':db[_0x47a5('0x99')],'as':'List','include':[{'model':db[_0x47a5('0x70')],'as':'Contacts','where':{'fax':_0x1e38ce},'limit':0x1,'order':[[_0x47a5('0x9a'),_0x47a5('0x9b')]]}]}]})[_0x47a5('0x31')](handleEntityNotFound(_0x5f5bdc,null))[_0x47a5('0x31')](function(_0x16f359){_0xb065db=_0x16f359;if(_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')]&&_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x47a5('0x41')]){for(var _0x273f29=0x0;_0x273f29<_0xa5e1f6[_0x47a5('0x56')]['attachments'][_0x47a5('0x41')];_0x273f29+=0x1){_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x273f29]={'filename':_0xa5e1f6['body'][_0x47a5('0x9c')][_0x273f29][_0x47a5('0x34')],'id':_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x273f29]['id'],'path':path[_0x47a5('0x9d')](config[_0x47a5('0x9e')],'server/files/attachments',_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][_0x273f29][_0x47a5('0x9f')])};}}return respondWithRpcPromise(_0x47a5('0xa0'),_0x47a5('0xa0'),{'FaxAccountId':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x53')]['id'])?undefined:_0xa5e1f6[_0x47a5('0x53')]['id'],'path':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')]['attachments'][0x0]['path'])?undefined:_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0][_0x47a5('0x8')],'fax':_['isNil'](_0xa5e1f6[_0x47a5('0x56')]['to'][0x0])?undefined:_0xa5e1f6['body']['to'][0x0]},client9002);})['then'](function(){if(_0xb065db){if(_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0xa2')])){_0xa5e1f6[_0x47a5('0x56')]['from']=util[_0x47a5('0xa3')](_0x47a5('0xa4'),_0xb065db['name'],_0xb065db['fax']);}if(_0xb065db['List']){if(_0xb065db[_0x47a5('0xa5')][_0x47a5('0xa6')][_0x47a5('0x41')]){return _0xb065db[_0x47a5('0xa5')][_0x47a5('0xa6')][0x0];}else{return db['CmContact']['create'](_[_0x47a5('0x13')](_0xa5e1f6[_0x47a5('0x56')],{'firstName':_0xa5e1f6[_0x47a5('0x56')]['to'][0x0],'phone':_0xa5e1f6[_0x47a5('0x56')]['to'][0x0],'fax':_0xa5e1f6['body']['to'][0x0],'ListId':_0xb065db[_0x47a5('0x93')]}));}}else{throw new Error(_0x47a5('0xa7'));}}else{throw new Error(_0x47a5('0xa8'));}})[_0x47a5('0x31')](function(_0x5e7fac){if(_0x5e7fac){return db['FaxInteraction']['find']({'where':{'ContactId':_0x5e7fac['id'],'closed':![],'FaxAccountId':_0xb065db['id']}})[_0x47a5('0x31')](function(_0x15ddfc){if(_0x15ddfc){return[_0x15ddfc,![]];}return db[_0x47a5('0x6d')][_0x47a5('0x55')]({'UserId':_0xa5e1f6[_0x47a5('0x59')]['id'],'ContactId':_0x5e7fac['id'],'FaxAccountId':_0xb065db['id'],'fax':_0xa5e1f6[_0x47a5('0x56')]['to'][0x0],'firstMsgDirection':_0x47a5('0xa9'),'Messages':[_[_0x47a5('0x49')](_0xa5e1f6[_0x47a5('0x56')],{'read':![],'body':_0xa5e1f6['body'][_0x47a5('0x9c')][0x0][_0x47a5('0xaa')],'FaxAccountId':_0xb065db['id'],'UserId':_0xa5e1f6['user']['id'],'ContactId':_0x5e7fac['id'],'AttachmentId':_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0]['id']})]},{'include':[{'model':db[_0x47a5('0x96')],'as':_0x47a5('0xab')}]})['then'](function(_0xbf131c){return[_0xbf131c,!![]];});});}else{throw new Error(_0x47a5('0xac'));}})[_0x47a5('0xad')](function(_0x51e2c0,_0x5da197){if(_0x5da197){return _0x51e2c0;}return db[_0x47a5('0x96')]['create']({'direction':_0x47a5('0xa9'),'read':![],'body':_0xa5e1f6['body'][_0x47a5('0x9c')][0x0][_0x47a5('0xaa')],'FaxAccountId':_0xb065db['id'],'FaxInteractionId':_0x51e2c0['id'],'UserId':_0xa5e1f6[_0x47a5('0x59')]['id'],'ContactId':_0x51e2c0[_0x47a5('0xae')],'AttachmentId':_0xa5e1f6[_0x47a5('0x56')]['attachments'][0x0]['id']})['then'](function(_0x1b6b29){_0x51e2c0[_0x47a5('0xaf')][_0x47a5('0xab')]=[];_0x51e2c0[_0x47a5('0xaf')]['Messages']['push'](_0x1b6b29[_0x47a5('0xaf')]);return _0x51e2c0;});})['then'](function(_0x2a9619){respondWithRpcPromise('SendFax',_0x47a5('0xb0'),{'FaxAccountId':_['isNil'](_0xa5e1f6[_0x47a5('0x53')]['id'])?undefined:_0xa5e1f6[_0x47a5('0x53')]['id'],'path':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0][_0x47a5('0x8')])?undefined:_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0]['path'],'fax':_[_0x47a5('0xa1')](_0xa5e1f6[_0x47a5('0x56')]['to'][0x0])?undefined:_0xa5e1f6['body']['to'][0x0],'AttachmentId':_0xa5e1f6[_0x47a5('0x56')][_0x47a5('0x9c')][0x0]['id']},client9002)['then'](function(_0x54d5bc){logger[_0x47a5('0x1b')]('SendFaxRpc,\x20%s',_0x54d5bc);})[_0x47a5('0x51')](function(_0x181b57){logger[_0x47a5('0x1b')]('SendFaxRpc,\x20%s',_0x181b57);});return _0x2a9619;})[_0x47a5('0x31')](respondWithResult(_0x5f5bdc,null))[_0x47a5('0x51')](handleError(_0x5f5bdc,null));};exports[_0x47a5('0xb1')]=function(_0x45dd6b,_0x19c824,_0x454609){return db[_0x47a5('0x37')]['find']({'where':{'id':_0x45dd6b[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x19c824,null))[_0x47a5('0x31')](function(_0xa6c86e){if(_0xa6c86e){return _0xa6c86e[_0x47a5('0xb1')](_0x45dd6b[_0x47a5('0x56')][_0x47a5('0x6c')],_['omit'](_0x45dd6b['body'],[_0x47a5('0x6c'),'id'])||{})[_0x47a5('0xad')](function(_0x2d0c51){for(var _0x4bbc94=0x0;_0x4bbc94<_0x45dd6b['body'][_0x47a5('0x6c')][_0x47a5('0x41')];_0x4bbc94+=0x1){socket[_0x47a5('0xb2')](_0x47a5('0xb3'),{'UserId':_0x45dd6b[_0x47a5('0x56')][_0x47a5('0x6c')][_0x4bbc94],'FaxAccountId':_0x45dd6b[_0x47a5('0x53')]['id']});}return _0x2d0c51;});}})['then'](respondWithResult(_0x19c824,null))[_0x47a5('0x51')](handleError(_0x19c824,null));};exports[_0x47a5('0xb4')]=function(_0x8a7b09,_0x540d7f,_0xc5f4a6){var _0x611b40;return db[_0x47a5('0x37')][_0x47a5('0x54')]({'where':{'id':_0x8a7b09[_0x47a5('0x53')]['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x540d7f,null))[_0x47a5('0x31')](function(_0x3a52cf){if(_0x3a52cf){return _0x3a52cf[_0x47a5('0xb4')](_0x8a7b09[_0x47a5('0x3a')][_0x47a5('0x6c')])[_0x47a5('0x31')](function(_0x3bd9cf){if(_['isArray'](_0x8a7b09[_0x47a5('0x3a')]['ids'])){for(var _0x2e6477=0x0;_0x2e6477<_0x8a7b09['query'][_0x47a5('0x6c')][_0x47a5('0x41')];_0x2e6477+=0x1){socket[_0x47a5('0xb2')]('userFaxAccount:remove',{'UserId':_0x8a7b09[_0x47a5('0x3a')]['ids'][_0x2e6477],'FaxAccountId':_0x8a7b09[_0x47a5('0x53')]['id']});}}else{socket[_0x47a5('0xb2')](_0x47a5('0xb5'),{'UserId':_0x8a7b09[_0x47a5('0x3a')]['ids'],'FaxAccountId':_0x8a7b09[_0x47a5('0x53')]['id']});}});}})['then'](respondWithStatusCode(_0x540d7f,null))['catch'](handleError(_0x540d7f,null));};exports[_0x47a5('0xb6')]=function(_0x15e970,_0x41c23d,_0x17b95a){var _0x184a18={};var _0x11ae07={};var _0x10a789;var _0x33ac8b;return db[_0x47a5('0x37')]['findOne']({'where':{'id':_0x15e970['params']['id']}})[_0x47a5('0x31')](handleEntityNotFound(_0x41c23d,null))[_0x47a5('0x31')](function(_0x370de1){if(_0x370de1){_0x10a789=_0x370de1;_0x11ae07[_0x47a5('0x39')]=_[_0x47a5('0x3c')](db['User'][_0x47a5('0x38')]);_0x11ae07[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x15e970['query']);_0x11ae07['filters']=_[_0x47a5('0x3e')](_0x11ae07[_0x47a5('0x39')],_0x11ae07['query']);_0x184a18[_0x47a5('0x3f')]=_[_0x47a5('0x3e')](_0x11ae07[_0x47a5('0x39')],qs['fields'](_0x15e970[_0x47a5('0x3a')][_0x47a5('0x40')]));_0x184a18[_0x47a5('0x3f')]=_0x184a18[_0x47a5('0x3f')][_0x47a5('0x41')]?_0x184a18['attributes']:_0x11ae07[_0x47a5('0x39')];_0x184a18[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x15e970[_0x47a5('0x3a')]['sort']);_0x184a18['where']=qs[_0x47a5('0x3d')](_['pick'](_0x15e970[_0x47a5('0x3a')],_0x11ae07[_0x47a5('0x3d')]));if(_0x15e970[_0x47a5('0x3a')][_0x47a5('0x65')]){_0x184a18[_0x47a5('0x4a')]=_[_0x47a5('0x49')](_0x184a18['where'],{'$or':_[_0x47a5('0x66')](_0x184a18[_0x47a5('0x3f')],function(_0x32143a){var _0x52864b={};_0x52864b[_0x32143a]={'$like':'%'+_0x15e970['query'][_0x47a5('0x65')]+'%'};return _0x52864b;})});}_0x184a18=_['merge']({},_0x184a18,_0x15e970[_0x47a5('0x4d')]);return _0x10a789[_0x47a5('0xb6')](_0x184a18);}})[_0x47a5('0x31')](function(_0x22390f){if(_0x22390f){_0x33ac8b=_0x22390f[_0x47a5('0x41')];if(!_0x15e970['query']['hasOwnProperty'](_0x47a5('0x42'))){_0x184a18[_0x47a5('0x64')]=qs[_0x47a5('0x64')](_0x15e970[_0x47a5('0x3a')][_0x47a5('0x64')]);_0x184a18['offset']=qs[_0x47a5('0x28')](_0x15e970[_0x47a5('0x3a')][_0x47a5('0x28')]);}return _0x10a789[_0x47a5('0xb6')](_0x184a18);}})[_0x47a5('0x31')](function(_0x4df71d){if(_0x4df71d){return _0x4df71d?{'count':_0x33ac8b,'rows':_0x4df71d}:null;}})[_0x47a5('0x31')](respondWithResult(_0x41c23d,null))[_0x47a5('0x51')](handleError(_0x41c23d,null));};
\ No newline at end of file
index cfe4209..11d45fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a0e=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3ac312,_0x5d3903){var _0x36b673=function(_0x254b25){while(--_0x254b25){_0x3ac312['push'](_0x3ac312['shift']());}};_0x36b673(++_0x5d3903);}(_0x6a0e,0x18e));var _0xe6a0=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x6a0e[_0x47aa64];return _0x549c7a;};'use strict';var EventEmitter=require(_0xe6a0('0x0'));var FaxAccount=require(_0xe6a0('0x1'))['db'][_0xe6a0('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe6a0('0x3')](0x0);var events={'afterCreate':_0xe6a0('0x4'),'afterUpdate':_0xe6a0('0x5'),'afterDestroy':_0xe6a0('0x6')};function emitEvent(_0x51b922){return function(_0x4b25be,_0xae3cf1,_0x128de3){FaxAccountEvents[_0xe6a0('0x7')](_0x51b922+':'+_0x4b25be['id'],_0x4b25be);FaxAccountEvents[_0xe6a0('0x7')](_0x51b922,_0x4b25be);_0x128de3(null);};}for(var e in events){if(events[_0xe6a0('0x8')](e)){var event=events[e];FaxAccount[_0xe6a0('0x9')](e,emitEvent(event));}}module[_0xe6a0('0xa')]=FaxAccountEvents;
\ No newline at end of file
+var _0x8306=['hook','exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x1e6a0a,_0x23f7b8){var _0xc39db8=function(_0x622eaa){while(--_0x622eaa){_0x1e6a0a['push'](_0x1e6a0a['shift']());}};_0xc39db8(++_0x23f7b8);}(_0x8306,0x14c));var _0x6830=function(_0x59c689,_0x762a06){_0x59c689=_0x59c689-0x0;var _0x72beed=_0x8306[_0x59c689];return _0x72beed;};'use strict';var EventEmitter=require(_0x6830('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x6830('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6830('0x2')](0x0);var events={'afterCreate':_0x6830('0x3'),'afterUpdate':_0x6830('0x4'),'afterDestroy':_0x6830('0x5')};function emitEvent(_0x165f65){return function(_0x2c24f1,_0x2483f2,_0x18a739){FaxAccountEvents['emit'](_0x165f65+':'+_0x2c24f1['id'],_0x2c24f1);FaxAccountEvents[_0x6830('0x6')](_0x165f65,_0x2c24f1);_0x18a739(null);};}for(var e in events){if(events[_0x6830('0x7')](e)){var event=events[e];FaxAccount[_0x6830('0x8')](e,emitEvent(event));}}module[_0x6830('0x9')]=FaxAccountEvents;
\ No newline at end of file
index 04e3106..3a3d432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdda7=['moment','bluebird','./faxAccount.attributes','fax_accounts','../../config/logger','api'];(function(_0x4b5f48,_0x1a5676){var _0x407512=function(_0x4bae95){while(--_0x4bae95){_0x4b5f48['push'](_0x4b5f48['shift']());}};_0x407512(++_0x1a5676);}(_0xdda7,0x184));var _0x7dda=function(_0x41f300,_0x5653bd){_0x41f300=_0x41f300-0x0;var _0x1f7767=_0xdda7[_0x41f300];return _0x1f7767;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7dda('0x0'))(_0x7dda('0x1'));var moment=require(_0x7dda('0x2'));var BPromise=require(_0x7dda('0x3'));var rp=require('request-promise');var attributes=require(_0x7dda('0x4'));module['exports']=function(_0x4b5629,_0x2c29a6){return _0x4b5629['define']('FaxAccount',attributes,{'tableName':_0x7dda('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4148=['bluebird','request-promise','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','moment'];(function(_0x236161,_0x454f30){var _0x4a3978=function(_0x3593fe){while(--_0x3593fe){_0x236161['push'](_0x236161['shift']());}};_0x4a3978(++_0x454f30);}(_0x4148,0x75));var _0x8414=function(_0x199c9b,_0xd6e4c3){_0x199c9b=_0x199c9b-0x0;var _0x2f4c42=_0x4148[_0x199c9b];return _0x2f4c42;};'use strict';var _=require(_0x8414('0x0'));var util=require(_0x8414('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8414('0x2'));var BPromise=require(_0x8414('0x3'));var rp=require(_0x8414('0x4'));var attributes=require(_0x8414('0x5'));module[_0x8414('0x6')]=function(_0x488b0e,_0x335d65){return _0x488b0e[_0x8414('0x7')](_0x8414('0x8'),attributes,{'tableName':_0x8414('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 14eb17e..eb66eca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d54=['contact','fax','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','NotifyFaxAccount','body','CmContact','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','from','isNil','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','find','account','CmList','Contacts','DESC','FaxApplication','List','applications','list','orderBy','priority','asc','Applications','ListId','create'];(function(_0x3c54a6,_0x1ddd4e){var _0x41eae1=function(_0x41c930){while(--_0x41c930){_0x3c54a6['push'](_0x3c54a6['shift']());}};_0x41eae1(++_0x1ddd4e);}(_0x4d54,0xc1));var _0x44d5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4d54[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x44d5('0x0'));var util=require('util');var moment=require(_0x44d5('0x1'));var BPromise=require(_0x44d5('0x2'));var rs=require(_0x44d5('0x3'));var fs=require('fs');var Redis=require(_0x44d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x44d5('0x5'));var logger=require(_0x44d5('0x6'))(_0x44d5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x44d5('0x8')]['http']({'port':0x232c});config[_0x44d5('0x9')]=_[_0x44d5('0xa')](config[_0x44d5('0x9')],{'host':_0x44d5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44d5('0x9')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x515284,_0x198cf3,_0x60aea7){return new BPromise(function(_0x1d1574,_0x8a9d4d){return client[_0x44d5('0xc')](_0x515284,_0x60aea7)[_0x44d5('0xd')](function(_0x3b46a2){logger[_0x44d5('0xe')](_0x44d5('0xf'),_0x198cf3,_0x44d5('0x10'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x198cf3,_0x44d5('0x10'),JSON[_0x44d5('0x11')](_0x3b46a2));if(_0x3b46a2['error']){if(_0x3b46a2[_0x44d5('0x12')]['code']===0x1f4){logger['error'](_0x44d5('0xf'),_0x198cf3,_0x3b46a2[_0x44d5('0x12')]['message']);return _0x8a9d4d(_0x3b46a2['error']['message']);}logger[_0x44d5('0x12')](_0x44d5('0xf'),_0x198cf3,_0x3b46a2[_0x44d5('0x12')][_0x44d5('0x13')]);return _0x1d1574(_0x3b46a2[_0x44d5('0x12')]['message']);}else{logger[_0x44d5('0xe')]('FaxAccount,\x20%s,\x20%s',_0x198cf3,_0x44d5('0x10'));_0x1d1574(_0x3b46a2[_0x44d5('0x14')][_0x44d5('0x13')]);}})[_0x44d5('0x15')](function(_0x49c5ba){logger[_0x44d5('0x12')]('FaxAccount,\x20%s,\x20%s',_0x198cf3,_0x49c5ba);_0x8a9d4d(_0x49c5ba);});});}exports[_0x44d5('0x16')]=function(_0x29b8d2){var _0x543bab=this;return new Promise(function(_0x471302,_0x177561){return db[_0x44d5('0x17')][_0x44d5('0x18')]({'raw':_0x29b8d2[_0x44d5('0x19')]?_0x29b8d2[_0x44d5('0x19')][_0x44d5('0x1a')]===undefined?!![]:![]:!![],'where':_0x29b8d2[_0x44d5('0x19')]?_0x29b8d2[_0x44d5('0x19')][_0x44d5('0x1b')]||null:null,'attributes':_0x29b8d2[_0x44d5('0x19')]?_0x29b8d2[_0x44d5('0x19')]['attributes']||null:null,'limit':_0x29b8d2[_0x44d5('0x19')]?_0x29b8d2[_0x44d5('0x19')][_0x44d5('0x1c')]||null:null,'include':_0x29b8d2[_0x44d5('0x19')]?_0x29b8d2[_0x44d5('0x19')][_0x44d5('0x1d')]?_[_0x44d5('0x1e')](_0x29b8d2['options'][_0x44d5('0x1d')],function(_0x588bf6){return{'model':db[_0x588bf6['model']],'as':_0x588bf6['as'],'attributes':_0x588bf6['attributes'],'include':_0x588bf6[_0x44d5('0x1d')]?_[_0x44d5('0x1e')](_0x588bf6[_0x44d5('0x1d')],function(_0x2a7c0d){return{'model':db[_0x2a7c0d[_0x44d5('0x1f')]],'as':_0x2a7c0d['as'],'attributes':_0x2a7c0d[_0x44d5('0x20')],'include':_0x2a7c0d[_0x44d5('0x1d')]?_[_0x44d5('0x1e')](_0x2a7c0d[_0x44d5('0x1d')],function(_0x4762cb){return{'model':db[_0x4762cb[_0x44d5('0x1f')]],'as':_0x4762cb['as'],'attributes':_0x4762cb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2107ff){logger['info'](_0x44d5('0x16'),_0x29b8d2);logger['debug'](_0x44d5('0x16'),_0x29b8d2,JSON['stringify'](_0x2107ff));_0x471302(_0x2107ff);})[_0x44d5('0x15')](function(_0x53e073){logger[_0x44d5('0x12')]('GetFaxAccount',_0x53e073['message'],_0x29b8d2);_0x177561(_0x543bab['error'](0x1f4,_0x53e073[_0x44d5('0x13')]));});});};exports[_0x44d5('0x21')]=function(_0x8b4877,_0x443402,_0x23bd92){var _0x27d5dc=this;return new Promise(function(_0x10b15c,_0x89b4bc){var _0x468029={'body':_0x8b4877[_0x44d5('0x22')],'channel':'fax'};var _0x2b386a=[];var _0x157605=[];var _0x39705f={};return db[_0x44d5('0x23')]['describe']()[_0x44d5('0xd')](function(_0x1ebafb){if(!_0x1ebafb){throw new db[(_0x44d5('0x24'))][(_0x44d5('0x25'))]('no\x20available\x20attributes');}_0x2b386a=_[_0x44d5('0x26')](_[_0x44d5('0x27')](_0x1ebafb),[_0x44d5('0x28'),_0x44d5('0x29')]);_0x157605=_[_0x44d5('0x26')](_[_0x44d5('0x27')](_0x1ebafb),[_0x44d5('0x28'),_0x44d5('0x29'),_0x44d5('0x2a'),'ListId']);if(_0x8b4877['body']['id']){delete _0x8b4877['body']['id'];}if(_['isNil'](_0x8b4877[_0x44d5('0x22')][_0x44d5('0x2b')])){throw new db[(_0x44d5('0x24'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x44d5('0x2c')](_0x8b4877[_0x44d5('0x22')][_0x44d5('0x22')])||_0x8b4877['body'][_0x44d5('0x22')]===''){throw new db[(_0x44d5('0x24'))]['ValidationError'](_0x44d5('0x2d'));}if(_[_0x44d5('0x2c')](_0x8b4877['body'][_0x44d5('0x2e')])){throw new db['Sequelize']['ValidationError'](_0x44d5('0x2f')+_0x157605);}if(!_[_0x44d5('0x30')](_0x157605,_0x8b4877['body'][_0x44d5('0x2e')])){throw new db[(_0x44d5('0x24'))][(_0x44d5('0x25'))](_0x44d5('0x31')+_0x157605);}_0x39705f[_0x8b4877[_0x44d5('0x22')][_0x44d5('0x2e')]]=_0x8b4877[_0x44d5('0x22')][_0x44d5('0x2b')];})[_0x44d5('0xd')](function(){return db[_0x44d5('0x17')][_0x44d5('0x32')]({'where':{'id':_0x8b4877[_0x44d5('0x33')]['id']},'include':[{'model':db[_0x44d5('0x34')],'as':'List','include':[{'model':db[_0x44d5('0x23')],'as':_0x44d5('0x35'),'where':_0x39705f,'limit':0x1,'order':[[_0x44d5('0x29'),_0x44d5('0x36')]]}]},{'model':db[_0x44d5('0x37')],'as':'Applications'}]});})['then'](function(_0x36e0ff){if(_0x36e0ff&&_0x36e0ff[_0x44d5('0x38')]){var _0x3ef99a=_0x36e0ff['get']({'plain':!![]});_0x468029[_0x44d5('0x33')]=_0x3ef99a;_0x468029[_0x44d5('0x39')]=_0x3ef99a['Applications'];_0x468029[_0x44d5('0x3a')]=_0x3ef99a['List'];_0x468029['applications']=_[_0x44d5('0x3b')](_0x468029[_0x44d5('0x39')],[_0x44d5('0x3c')],[_0x44d5('0x3d')]);if(_0x468029[_0x44d5('0x33')][_0x44d5('0x3e')]){delete _0x468029[_0x44d5('0x33')][_0x44d5('0x3e')];}if(_0x468029[_0x44d5('0x33')][_0x44d5('0x38')]&&_0x468029[_0x44d5('0x33')]['List'][_0x44d5('0x35')]['length']){return _0x468029['account'][_0x44d5('0x38')]['Contacts'][0x0];}var _0x4ad0a4=_[_0x44d5('0xa')](_0x8b4877['body'],{'firstName':_0x8b4877[_0x44d5('0x22')][_0x44d5('0x2b')],'ListId':_0x3ef99a[_0x44d5('0x3f')]});_0x4ad0a4[_0x8b4877[_0x44d5('0x22')]['mapKey']]=_0x8b4877[_0x44d5('0x22')][_0x44d5('0x2b')];return db[_0x44d5('0x23')][_0x44d5('0x40')](_0x4ad0a4,{'fields':_0x2b386a,'raw':!![]});}})[_0x44d5('0xd')](function(_0xd778fe){_0x468029[_0x44d5('0x41')]=_0xd778fe;if(_0xd778fe){var _0x5056a8={'ContactId':_0xd778fe['id'],'FaxAccountId':_0x8b4877[_0x44d5('0x33')]['id'],'fax':_0xd778fe[_0x44d5('0x42')]};return db[_0x44d5('0x43')][_0x44d5('0x32')]({'where':{'ContactId':_0xd778fe['id'],'closed':![],'FaxAccountId':_0x8b4877[_0x44d5('0x33')]['id']}})[_0x44d5('0xd')](function(_0x164e6d){if(_0x164e6d){return[_0x164e6d,![]];}return db['FaxInteraction']['create'](_0x5056a8)['then'](function(_0x563bc4){return[_0x563bc4,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x44d5('0x44')](function(_0x5dd818,_0x5ee545){var _0x587dec=_0x5dd818['get']({'plain':!![]});if(_0x5ee545){if(_0x468029[_0x44d5('0x33')][_0x44d5('0x45')]){_0x468029[_0x44d5('0x39')][_0x44d5('0x46')]({'id':0x0,'priority':_0x468029[_0x44d5('0x39')]['length']+0x1,'app':_0x44d5('0x47'),'appdata':_0x44d5('0x48'),'interval':_0x44d5('0x49')});}_0x587dec[_0x44d5('0x4a')]=!![];}else{_0x587dec[_0x44d5('0x4a')]=![];}_0x468029['interaction']=_0x587dec;return db[_0x44d5('0x4b')][_0x44d5('0x40')]({'body':_0x8b4877['body'][_0x44d5('0x22')],'FaxAccountId':_0x8b4877[_0x44d5('0x33')]['id'],'FaxInteractionId':_0x5dd818['id'],'direction':'in','ContactId':_0x5dd818[_0x44d5('0x4c')],'AttachmentId':_0x8b4877['body']['AttachmentId']});})[_0x44d5('0xd')](function(_0x553a4a){_0x468029[_0x44d5('0x13')]=_0x553a4a;if(_0x468029[_0x44d5('0x4d')][_0x44d5('0x4e')]){return db[_0x44d5('0x4f')][_0x44d5('0x32')]({'attributes':['id',_0x44d5('0x50')],'where':{'id':_0x468029[_0x44d5('0x4d')][_0x44d5('0x4e')]}})[_0x44d5('0xd')](function(_0x5a98e6){if(_0x5a98e6){_0x468029[_0x44d5('0x39')][_0x44d5('0x51')]({'id':0x0,'priority':0x0,'app':_0x44d5('0x52'),'appdata':_0x5a98e6[_0x44d5('0x50')]+','+(_0x468029['account'][_0x44d5('0x53')]||0xa),'interval':_0x44d5('0x49')});}return respondWithRpcPromise(_0x44d5('0x54'),_0x44d5('0x55'),_0x468029);});}return respondWithRpcPromise(_0x44d5('0x54'),_0x44d5('0x55'),_0x468029);})[_0x44d5('0xd')](function(_0x1d613f){_0x10b15c(_0x1d613f);})[_0x44d5('0x15')](function(_0x31a551){_0x89b4bc(_0x27d5dc[_0x44d5('0x12')](0x1f4,_0x31a551[_0x44d5('0x13')]));});});};
\ No newline at end of file
+var _0xdab4=['limit','map','include','model','stringify','fax','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','CmContact','DESC','Applications','applications','list','orderBy','Contacts','from','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','unmanaged','created','interaction','FaxMessage','ContactId','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetFaxAccount','findAll','options','where','attributes'];(function(_0xc32a4c,_0x28c58e){var _0x4e8a9e=function(_0x2f7fd1){while(--_0x2f7fd1){_0xc32a4c['push'](_0xc32a4c['shift']());}};_0x4e8a9e(++_0x28c58e);}(_0xdab4,0x92));var _0x4dab=function(_0x33c4bb,_0x398bfc){_0x33c4bb=_0x33c4bb-0x0;var _0x17acba=_0xdab4[_0x33c4bb];return _0x17acba;};'use strict';var _=require(_0x4dab('0x0'));var util=require(_0x4dab('0x1'));var moment=require(_0x4dab('0x2'));var BPromise=require(_0x4dab('0x3'));var rs=require(_0x4dab('0x4'));var fs=require('fs');var Redis=require(_0x4dab('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4dab('0x6'))(_0x4dab('0x7'));var config=require(_0x4dab('0x8'));var jayson=require(_0x4dab('0x9'));var client=jayson[_0x4dab('0xa')]['http']({'port':0x232c});config[_0x4dab('0xb')]=_[_0x4dab('0xc')](config['redis'],{'host':_0x4dab('0xd'),'port':0x18eb});var socket=require(_0x4dab('0xe'))(new Redis(config['redis']));require(_0x4dab('0xf'))[_0x4dab('0x10')](socket);function respondWithRpcPromise(_0x4fa805,_0x4cec93,_0x1392c1){return new BPromise(function(_0x3341e5,_0x244201){return client[_0x4dab('0x11')](_0x4fa805,_0x1392c1)[_0x4dab('0x12')](function(_0x46bb75){logger[_0x4dab('0x13')](_0x4dab('0x14'),_0x4cec93,'request\x20sent');logger[_0x4dab('0x15')](_0x4dab('0x16'),_0x4cec93,_0x4dab('0x17'),JSON['stringify'](_0x46bb75));if(_0x46bb75[_0x4dab('0x18')]){if(_0x46bb75['error'][_0x4dab('0x19')]===0x1f4){logger[_0x4dab('0x18')](_0x4dab('0x14'),_0x4cec93,_0x46bb75[_0x4dab('0x18')]['message']);return _0x244201(_0x46bb75[_0x4dab('0x18')][_0x4dab('0x1a')]);}logger['error'](_0x4dab('0x14'),_0x4cec93,_0x46bb75['error']['message']);return _0x3341e5(_0x46bb75[_0x4dab('0x18')][_0x4dab('0x1a')]);}else{logger[_0x4dab('0x13')]('FaxAccount,\x20%s,\x20%s',_0x4cec93,'request\x20sent');_0x3341e5(_0x46bb75['result'][_0x4dab('0x1a')]);}})['catch'](function(_0x36b752){logger[_0x4dab('0x18')](_0x4dab('0x14'),_0x4cec93,_0x36b752);_0x244201(_0x36b752);});});}exports[_0x4dab('0x1b')]=function(_0x15449e){var _0x40c5c0=this;return new Promise(function(_0x28ac45,_0x1aee21){return db['FaxAccount'][_0x4dab('0x1c')]({'raw':_0x15449e[_0x4dab('0x1d')]?_0x15449e[_0x4dab('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x15449e[_0x4dab('0x1d')]?_0x15449e[_0x4dab('0x1d')][_0x4dab('0x1e')]||null:null,'attributes':_0x15449e[_0x4dab('0x1d')]?_0x15449e['options'][_0x4dab('0x1f')]||null:null,'limit':_0x15449e[_0x4dab('0x1d')]?_0x15449e['options'][_0x4dab('0x20')]||null:null,'include':_0x15449e[_0x4dab('0x1d')]?_0x15449e['options']['include']?_[_0x4dab('0x21')](_0x15449e[_0x4dab('0x1d')][_0x4dab('0x22')],function(_0x3bf208){return{'model':db[_0x3bf208['model']],'as':_0x3bf208['as'],'attributes':_0x3bf208[_0x4dab('0x1f')],'include':_0x3bf208[_0x4dab('0x22')]?_[_0x4dab('0x21')](_0x3bf208[_0x4dab('0x22')],function(_0x3d7d99){return{'model':db[_0x3d7d99[_0x4dab('0x23')]],'as':_0x3d7d99['as'],'attributes':_0x3d7d99[_0x4dab('0x1f')],'include':_0x3d7d99[_0x4dab('0x22')]?_[_0x4dab('0x21')](_0x3d7d99['include'],function(_0x2012ac){return{'model':db[_0x2012ac[_0x4dab('0x23')]],'as':_0x2012ac['as'],'attributes':_0x2012ac[_0x4dab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4dab('0x12')](function(_0x544871){logger[_0x4dab('0x13')](_0x4dab('0x1b'),_0x15449e);logger['debug']('GetFaxAccount',_0x15449e,JSON[_0x4dab('0x24')](_0x544871));_0x28ac45(_0x544871);})['catch'](function(_0x4508cf){logger[_0x4dab('0x18')]('GetFaxAccount',_0x4508cf[_0x4dab('0x1a')],_0x15449e);_0x1aee21(_0x40c5c0[_0x4dab('0x18')](0x1f4,_0x4508cf[_0x4dab('0x1a')]));});});};exports['NotifyFaxAccount']=function(_0x251978,_0x19b5b9,_0x4bc6e5){var _0x417768=this;return new Promise(function(_0x5bc060,_0x1084a2){var _0x26ee3a={'body':_0x251978['body'],'channel':_0x4dab('0x25')};var _0x2aa16d=[];var _0x12f360=[];var _0x58276a={};return db['CmContact'][_0x4dab('0x26')]()[_0x4dab('0x12')](function(_0x30c1e1){if(!_0x30c1e1){throw new db['Sequelize'][(_0x4dab('0x27'))](_0x4dab('0x28'));}_0x2aa16d=_[_0x4dab('0x29')](_[_0x4dab('0x2a')](_0x30c1e1),[_0x4dab('0x2b'),_0x4dab('0x2c')]);_0x12f360=_[_0x4dab('0x29')](_['keys'](_0x30c1e1),['createdAt','updatedAt',_0x4dab('0x2d'),_0x4dab('0x2e')]);if(_0x251978[_0x4dab('0x2f')]['id']){delete _0x251978[_0x4dab('0x2f')]['id'];}if(_['isNil'](_0x251978[_0x4dab('0x2f')]['from'])){throw new db[(_0x4dab('0x30'))]['ValidationError'](_0x4dab('0x31'));}if(_[_0x4dab('0x32')](_0x251978['body'][_0x4dab('0x2f')])||_0x251978[_0x4dab('0x2f')][_0x4dab('0x2f')]===''){throw new db['Sequelize'][(_0x4dab('0x27'))](_0x4dab('0x33'));}if(_[_0x4dab('0x32')](_0x251978[_0x4dab('0x2f')]['mapKey'])){throw new db['Sequelize'][(_0x4dab('0x27'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12f360);}if(!_[_0x4dab('0x34')](_0x12f360,_0x251978[_0x4dab('0x2f')][_0x4dab('0x35')])){throw new db[(_0x4dab('0x30'))]['ValidationError'](_0x4dab('0x36')+_0x12f360);}_0x58276a[_0x251978[_0x4dab('0x2f')]['mapKey']]=_0x251978[_0x4dab('0x2f')]['from'];})[_0x4dab('0x12')](function(){return db[_0x4dab('0x37')][_0x4dab('0x38')]({'where':{'id':_0x251978[_0x4dab('0x39')]['id']},'include':[{'model':db[_0x4dab('0x3a')],'as':_0x4dab('0x3b'),'include':[{'model':db[_0x4dab('0x3c')],'as':'Contacts','where':_0x58276a,'limit':0x1,'order':[[_0x4dab('0x2c'),_0x4dab('0x3d')]]}]},{'model':db['FaxApplication'],'as':_0x4dab('0x3e')}]});})[_0x4dab('0x12')](function(_0x148ab2){if(_0x148ab2&&_0x148ab2[_0x4dab('0x3b')]){var _0x5830a2=_0x148ab2['get']({'plain':!![]});_0x26ee3a[_0x4dab('0x39')]=_0x5830a2;_0x26ee3a[_0x4dab('0x3f')]=_0x5830a2[_0x4dab('0x3e')];_0x26ee3a[_0x4dab('0x40')]=_0x5830a2[_0x4dab('0x3b')];_0x26ee3a[_0x4dab('0x3f')]=_[_0x4dab('0x41')](_0x26ee3a[_0x4dab('0x3f')],['priority'],['asc']);if(_0x26ee3a[_0x4dab('0x39')]['Applications']){delete _0x26ee3a['account'][_0x4dab('0x3e')];}if(_0x26ee3a[_0x4dab('0x39')][_0x4dab('0x3b')]&&_0x26ee3a[_0x4dab('0x39')][_0x4dab('0x3b')][_0x4dab('0x42')]['length']){return _0x26ee3a[_0x4dab('0x39')]['List'][_0x4dab('0x42')][0x0];}var _0x2149d4=_[_0x4dab('0xc')](_0x251978[_0x4dab('0x2f')],{'firstName':_0x251978[_0x4dab('0x2f')][_0x4dab('0x43')],'ListId':_0x5830a2['ListId']});_0x2149d4[_0x251978[_0x4dab('0x2f')]['mapKey']]=_0x251978['body'][_0x4dab('0x43')];return db[_0x4dab('0x3c')][_0x4dab('0x44')](_0x2149d4,{'fields':_0x2aa16d,'raw':!![]});}})[_0x4dab('0x12')](function(_0x4906f1){_0x26ee3a[_0x4dab('0x45')]=_0x4906f1;if(_0x4906f1){var _0x5d3a34={'ContactId':_0x4906f1['id'],'FaxAccountId':_0x251978[_0x4dab('0x39')]['id'],'fax':_0x4906f1[_0x4dab('0x25')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x4906f1['id'],'closed':![],'FaxAccountId':_0x251978[_0x4dab('0x39')]['id']}})[_0x4dab('0x12')](function(_0x2337d5){if(_0x2337d5){return[_0x2337d5,![]];}return db[_0x4dab('0x46')][_0x4dab('0x44')](_0x5d3a34)[_0x4dab('0x12')](function(_0xf8bb8){return[_0xf8bb8,!![]];});});}else{throw new Error(_0x4dab('0x47'));}})[_0x4dab('0x48')](function(_0x196862,_0x3ad0d6){var _0x5b8670=_0x196862[_0x4dab('0x49')]({'plain':!![]});if(_0x3ad0d6){if(_0x26ee3a[_0x4dab('0x39')][_0x4dab('0x4a')]){_0x26ee3a[_0x4dab('0x3f')][_0x4dab('0x4b')]({'id':0x0,'priority':_0x26ee3a['applications']['length']+0x1,'app':'close','appdata':_0x4dab('0x4c'),'interval':'*,*,*,*'});}_0x5b8670[_0x4dab('0x4d')]=!![];}else{_0x5b8670['created']=![];}_0x26ee3a[_0x4dab('0x4e')]=_0x5b8670;return db[_0x4dab('0x4f')][_0x4dab('0x44')]({'body':_0x251978[_0x4dab('0x2f')][_0x4dab('0x2f')],'FaxAccountId':_0x251978[_0x4dab('0x39')]['id'],'FaxInteractionId':_0x196862['id'],'direction':'in','ContactId':_0x196862[_0x4dab('0x50')],'AttachmentId':_0x251978[_0x4dab('0x2f')]['AttachmentId']});})['then'](function(_0xc4ef60){_0x26ee3a[_0x4dab('0x1a')]=_0xc4ef60;if(_0x26ee3a[_0x4dab('0x4e')][_0x4dab('0x51')]){return db['User'][_0x4dab('0x38')]({'attributes':['id','name'],'where':{'id':_0x26ee3a[_0x4dab('0x4e')][_0x4dab('0x51')]}})[_0x4dab('0x12')](function(_0x1375e6){if(_0x1375e6){_0x26ee3a[_0x4dab('0x3f')][_0x4dab('0x52')]({'id':0x0,'priority':0x0,'app':_0x4dab('0x53'),'appdata':_0x1375e6[_0x4dab('0x54')]+','+(_0x26ee3a['account'][_0x4dab('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4dab('0x56'),_0x4dab('0x57'),_0x26ee3a);});}return respondWithRpcPromise(_0x4dab('0x56'),'startRouting',_0x26ee3a);})['then'](function(_0x429037){_0x5bc060(_0x429037);})[_0x4dab('0x58')](function(_0xd72adb){_0x1084a2(_0x417768[_0x4dab('0x18')](0x1f4,_0xd72adb[_0x4dab('0x1a')]));});});};
\ No newline at end of file
index 15d2ee8..07aaf01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x458f=['./faxAccount.events','save','update','emit','register','length','faxAccount:'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0x458f,0x10a));var _0xf458=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x458f[_0x57b54c];return _0x59cc19;};'use strict';var FaxAccountEvents=require(_0xf458('0x0'));var events=[_0xf458('0x1'),'remove',_0xf458('0x2')];function createListener(_0x371855,_0x36183f){return function(_0x2c592b){_0x36183f[_0xf458('0x3')](_0x371855,_0x2c592b);};}function removeListener(_0x309e7b,_0x32ac7b){return function(){FaxAccountEvents['removeListener'](_0x309e7b,_0x32ac7b);};}exports[_0xf458('0x4')]=function(_0xa62360){for(var _0x4ea24f=0x0,_0x4c1c6d=events[_0xf458('0x5')];_0x4ea24f<_0x4c1c6d;_0x4ea24f++){var _0x8a2d17=events[_0x4ea24f];var _0x4f44d1=createListener(_0xf458('0x6')+_0x8a2d17,_0xa62360);FaxAccountEvents['on'](_0x8a2d17,_0x4f44d1);}};
\ No newline at end of file
+var _0xc462=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x1480b4,_0x49d821){var _0x208889=function(_0x3e29f0){while(--_0x3e29f0){_0x1480b4['push'](_0x1480b4['shift']());}};_0x208889(++_0x49d821);}(_0xc462,0x109));var _0x2c46=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xc462[_0x13b02f];return _0x12e9a6;};'use strict';var FaxAccountEvents=require(_0x2c46('0x0'));var events=[_0x2c46('0x1'),_0x2c46('0x2'),_0x2c46('0x3')];function createListener(_0x582bed,_0x394ecd){return function(_0x19460c){_0x394ecd[_0x2c46('0x4')](_0x582bed,_0x19460c);};}function removeListener(_0x4b4640,_0x21943d){return function(){FaxAccountEvents[_0x2c46('0x5')](_0x4b4640,_0x21943d);};}exports[_0x2c46('0x6')]=function(_0x5ca5a4){for(var _0x1e772e=0x0,_0x4ed484=events['length'];_0x1e772e<_0x4ed484;_0x1e772e++){var _0x7f7490=events[_0x1e772e];var _0x3a367a=createListener(_0x2c46('0x7')+_0x7f7490,_0x5ca5a4);FaxAccountEvents['on'](_0x7f7490,_0x3a367a);}};
\ No newline at end of file
index 80e405b..e5142e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde6a=['express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','post','create','addDisposition','addAnswer','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','send','addAgents','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0xde6a,0x126));var _0xade6=function(_0x32d23b,_0x225be7){_0x32d23b=_0x32d23b-0x0;var _0x2b64b1=_0xde6a[_0x32d23b];return _0x2b64b1;};'use strict';var multer=require('multer');var util=require(_0xade6('0x0'));var path=require('path');var timeout=require(_0xade6('0x1'));var express=require(_0xade6('0x2'));var router=express['Router']();var auth=require(_0xade6('0x3'));var interaction=require(_0xade6('0x4'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0xade6('0x5')]('/',auth[_0xade6('0x6')](),controller['index']);router[_0xade6('0x5')](_0xade6('0x7'),auth[_0xade6('0x6')](),controller[_0xade6('0x8')]);router['get'](_0xade6('0x9'),auth[_0xade6('0x6')](),controller[_0xade6('0xa')]);router[_0xade6('0x5')](_0xade6('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xade6('0x5')](_0xade6('0xc'),auth[_0xade6('0x6')](),controller[_0xade6('0xd')]);router['get'](_0xade6('0xe'),auth[_0xade6('0x6')](),controller[_0xade6('0xf')]);router[_0xade6('0x5')](_0xade6('0x10'),auth[_0xade6('0x6')](),controller[_0xade6('0x11')]);router['get'](_0xade6('0x12'),auth[_0xade6('0x6')](),controller['getMessages']);router['get'](_0xade6('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0xade6('0x14')]('/',auth['isAuthenticated'](),controller[_0xade6('0x15')]);router[_0xade6('0x14')](_0xade6('0xb'),auth[_0xade6('0x6')](),controller[_0xade6('0x16')]);router[_0xade6('0x14')](_0xade6('0xc'),auth[_0xade6('0x6')](),controller[_0xade6('0x17')]);router[_0xade6('0x14')](_0xade6('0xe'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xade6('0x14')](_0xade6('0x10'),auth[_0xade6('0x6')](),controller[_0xade6('0x18')]);router[_0xade6('0x14')](_0xade6('0x19'),auth[_0xade6('0x6')](),controller[_0xade6('0x1a')]);router[_0xade6('0x14')](_0xade6('0x1b'),auth[_0xade6('0x6')](),controller['updateAccountApplications']);router[_0xade6('0x14')]('/:id/send',auth[_0xade6('0x6')](),controller[_0xade6('0x1c')]);router[_0xade6('0x14')]('/:id/users',auth[_0xade6('0x6')](),controller[_0xade6('0x1d')]);router[_0xade6('0x1e')]('/:id',auth[_0xade6('0x6')](),controller['update']);router['delete'](_0xade6('0x9'),auth[_0xade6('0x6')](),controller[_0xade6('0x1f')]);router[_0xade6('0x20')](_0xade6('0xb'),auth[_0xade6('0x6')](),controller[_0xade6('0x21')]);router[_0xade6('0x20')](_0xade6('0xc'),auth[_0xade6('0x6')](),controller[_0xade6('0x22')]);router[_0xade6('0x20')](_0xade6('0x13'),auth['isAuthenticated'](),controller[_0xade6('0x23')]);module[_0xade6('0x24')]=router;
\ No newline at end of file
+var _0x6077=['multer','util','path','express','Router','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','post','create','addDisposition','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x831eff,_0x3c447c){var _0x4a3f84=function(_0x1ab33d){while(--_0x1ab33d){_0x831eff['push'](_0x831eff['shift']());}};_0x4a3f84(++_0x3c447c);}(_0x6077,0x1ae));var _0x7607=function(_0x17b28c,_0xea357e){_0x17b28c=_0x17b28c-0x0;var _0x2bc0f9=_0x6077[_0x17b28c];return _0x2bc0f9;};'use strict';var multer=require(_0x7607('0x0'));var util=require(_0x7607('0x1'));var path=require(_0x7607('0x2'));var timeout=require('connect-timeout');var express=require(_0x7607('0x3'));var router=express[_0x7607('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7607('0x5'));var controller=require(_0x7607('0x6'));router[_0x7607('0x7')]('/',auth[_0x7607('0x8')](),controller[_0x7607('0x9')]);router[_0x7607('0x7')](_0x7607('0xa'),auth['isAuthenticated'](),controller[_0x7607('0xb')]);router[_0x7607('0x7')](_0x7607('0xc'),auth[_0x7607('0x8')](),controller[_0x7607('0xd')]);router[_0x7607('0x7')](_0x7607('0xe'),auth[_0x7607('0x8')](),controller[_0x7607('0xf')]);router[_0x7607('0x7')](_0x7607('0x10'),auth[_0x7607('0x8')](),controller['getAnswers']);router['get'](_0x7607('0x11'),auth['isAuthenticated'](),controller[_0x7607('0x12')]);router['get'](_0x7607('0x13'),auth[_0x7607('0x8')](),controller[_0x7607('0x14')]);router[_0x7607('0x7')](_0x7607('0x15'),auth[_0x7607('0x8')](),controller['getMessages']);router['get']('/:id/users',auth[_0x7607('0x8')](),controller['getAgents']);router[_0x7607('0x16')]('/',auth['isAuthenticated'](),controller[_0x7607('0x17')]);router[_0x7607('0x16')](_0x7607('0xe'),auth[_0x7607('0x8')](),controller[_0x7607('0x18')]);router[_0x7607('0x16')](_0x7607('0x10'),auth[_0x7607('0x8')](),controller[_0x7607('0x19')]);router[_0x7607('0x16')](_0x7607('0x11'),auth[_0x7607('0x8')](),controller[_0x7607('0x1a')]);router[_0x7607('0x16')]('/:id/applications',auth[_0x7607('0x8')](),controller[_0x7607('0x1b')]);router[_0x7607('0x16')]('/addaccountapplications',auth[_0x7607('0x8')](),controller[_0x7607('0x1c')]);router[_0x7607('0x16')](_0x7607('0x1d'),auth[_0x7607('0x8')](),controller[_0x7607('0x1e')]);router[_0x7607('0x16')](_0x7607('0x1f'),auth[_0x7607('0x8')](),controller[_0x7607('0x20')]);router[_0x7607('0x16')](_0x7607('0x21'),auth[_0x7607('0x8')](),controller[_0x7607('0x22')]);router[_0x7607('0x23')]('/:id',auth[_0x7607('0x8')](),controller[_0x7607('0x24')]);router[_0x7607('0x25')]('/:id',auth[_0x7607('0x8')](),controller[_0x7607('0x26')]);router[_0x7607('0x25')](_0x7607('0xe'),auth[_0x7607('0x8')](),controller[_0x7607('0x27')]);router[_0x7607('0x25')]('/:id/canned_answers',auth[_0x7607('0x8')](),controller[_0x7607('0x28')]);router[_0x7607('0x25')](_0x7607('0x21'),auth['isAuthenticated'](),controller[_0x7607('0x29')]);module[_0x7607('0x2a')]=router;
\ No newline at end of file
index 4ae6d39..b1ca7b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5520=['STRING','sequelize','exports'];(function(_0xb63cd0,_0x46020d){var _0x55c0b8=function(_0x3b9c95){while(--_0x3b9c95){_0xb63cd0['push'](_0xb63cd0['shift']());}};_0x55c0b8(++_0x46020d);}(_0x5520,0x91));var _0x0552=function(_0x1f6e71,_0x19360b){_0x1f6e71=_0x1f6e71-0x0;var _0x2271aa=_0x5520[_0x1f6e71];return _0x2271aa;};'use strict';var Sequelize=require(_0x0552('0x0'));module[_0x0552('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0552('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0552('0x2')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x0552('0x2')]},'interval':{'type':Sequelize[_0x0552('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x02b5=['exports','STRING','noop','*,*,*,*','sequelize'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x02b5,0x1c1));var _0x502b=function(_0x17db5e,_0x584bd7){_0x17db5e=_0x17db5e-0x0;var _0x4abb15=_0x02b5[_0x17db5e];return _0x4abb15;};'use strict';var Sequelize=require(_0x502b('0x0'));module[_0x502b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x502b('0x2')],'allowNull':![],'defaultValue':_0x502b('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x502b('0x2')],'defaultValue':_0x502b('0x4')}};
\ No newline at end of file
index ac5a112..494e96c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c57=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','api','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','FaxApplication','rawAttributes','model','keys','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','dateStart','add','merge','filter','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','html-pdf','eml-format'];(function(_0x47eac5,_0x29fd1d){var _0x2bdbdb=function(_0x26d0ca){while(--_0x26d0ca){_0x47eac5['push'](_0x47eac5['shift']());}};_0x2bdbdb(++_0x29fd1d);}(_0x4c57,0x122));var _0x74c5=function(_0x52b842,_0x478563){_0x52b842=_0x52b842-0x0;var _0xf7084f=_0x4c57[_0x52b842];return _0xf7084f;};'use strict';var pdf=require(_0x74c5('0x0'));var emlformat=require(_0x74c5('0x1'));var rimraf=require(_0x74c5('0x2'));var zipdir=require(_0x74c5('0x3'));var jsonpatch=require(_0x74c5('0x4'));var rp=require(_0x74c5('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74c5('0x6'));var util=require(_0x74c5('0x7'));var path=require('path');var sox=require(_0x74c5('0x8'));var csv=require(_0x74c5('0x9'));var ejs=require(_0x74c5('0xa'));var fs=require('fs');var _=require(_0x74c5('0xb'));var squel=require(_0x74c5('0xc'));var crypto=require(_0x74c5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x74c5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x74c5('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x74c5('0x10'))['db'];function respondWithStatusCode(_0x5f3f03,_0x269b08){_0x269b08=_0x269b08||0xcc;return function(_0x193f88){if(_0x193f88){return _0x5f3f03['sendStatus'](_0x269b08);}return _0x5f3f03[_0x74c5('0x11')](_0x269b08)[_0x74c5('0x12')]();};}function respondWithResult(_0x25b813,_0x1dc187){_0x1dc187=_0x1dc187||0xc8;return function(_0x1a4d8d){if(_0x1a4d8d){return _0x25b813[_0x74c5('0x11')](_0x1dc187)[_0x74c5('0x13')](_0x1a4d8d);}};}function respondWithFilteredResult(_0x48a3dd,_0x561a11){return function(_0x1f66de){if(_0x1f66de){var _0x43e225=_0x1f66de['count'],_0x1354b5=_0x561a11[_0x74c5('0x14')],_0x288298=_0x561a11[_0x74c5('0x14')]+_0x561a11[_0x74c5('0x15')],_0x43f299;if(_0x288298>=_0x43e225){_0x288298=_0x43e225;_0x43f299=0xc8;}else{_0x43f299=0xce;}_0x48a3dd[_0x74c5('0x11')](_0x43f299);return _0x48a3dd[_0x74c5('0x16')](_0x74c5('0x17'),_0x1354b5+'-'+_0x288298+'/'+_0x43e225)[_0x74c5('0x13')](_0x1f66de);}return null;};}function patchUpdates(_0x39c5c8){return function(_0x28bfb8){try{jsonpatch[_0x74c5('0x18')](_0x28bfb8,_0x39c5c8,!![]);}catch(_0x37d952){return BPromise[_0x74c5('0x19')](_0x37d952);}return _0x28bfb8[_0x74c5('0x1a')]();};}function saveUpdates(_0x4a76cf,_0x59f361){return function(_0x4cc865){if(_0x4cc865){return _0x4cc865['update'](_0x4a76cf)['then'](function(_0x3fad64){return _0x3fad64;});}return null;};}function removeEntity(_0x5e7a58,_0x1fd08a){return function(_0x276411){if(_0x276411){return _0x276411['destroy']()[_0x74c5('0x1b')](function(){_0x5e7a58['status'](0xcc)[_0x74c5('0x12')]();});}};}function handleEntityNotFound(_0x1a3309,_0x4cd79d){return function(_0x4b092a){if(!_0x4b092a){_0x1a3309[_0x74c5('0x1c')](0x194);}return _0x4b092a;};}function handleError(_0x2fdcb1,_0x355410){_0x355410=_0x355410||0x1f4;return function(_0x624825){logger[_0x74c5('0x1d')](_0x624825[_0x74c5('0x1e')]);if(_0x624825['name']){delete _0x624825[_0x74c5('0x1f')];}_0x2fdcb1[_0x74c5('0x11')](_0x355410)[_0x74c5('0x20')](_0x624825);};}exports[_0x74c5('0x21')]=function(_0x506a89,_0x48cd5d){var _0xf9f021={},_0x4cf2af={},_0x2a5a57={'count':0x0,'rows':[]};var _0x573400=db[_0x74c5('0x22')][_0x74c5('0x23')];_0x4cf2af[_0x74c5('0x24')]=_[_0x74c5('0x25')](_0x573400);var _0x11c7e4={'dateStart':_0x506a89[_0x74c5('0x26')]['dateStart'],'dateEnd':_0x506a89[_0x74c5('0x26')][_0x74c5('0x27')]};delete _0x506a89[_0x74c5('0x26')]['dateStart'];delete _0x506a89[_0x74c5('0x26')][_0x74c5('0x27')];_0x4cf2af[_0x74c5('0x26')]=_[_0x74c5('0x25')](_0x506a89[_0x74c5('0x26')]);_0x4cf2af[_0x74c5('0x28')]=_[_0x74c5('0x29')](_0x4cf2af[_0x74c5('0x24')],_0x4cf2af[_0x74c5('0x26')]);_0xf9f021[_0x74c5('0x2a')]=_['intersection'](_0x4cf2af['model'],qs[_0x74c5('0x2b')](_0x506a89[_0x74c5('0x26')][_0x74c5('0x2b')]));_0xf9f021[_0x74c5('0x2a')]=_0xf9f021[_0x74c5('0x2a')][_0x74c5('0x2c')]?_0xf9f021[_0x74c5('0x2a')]:_0x4cf2af[_0x74c5('0x24')];if(!_0x506a89[_0x74c5('0x26')][_0x74c5('0x2d')](_0x74c5('0x2e'))){_0xf9f021[_0x74c5('0x15')]=qs[_0x74c5('0x15')](_0x506a89[_0x74c5('0x26')]['limit']);_0xf9f021[_0x74c5('0x14')]=qs[_0x74c5('0x14')](_0x506a89[_0x74c5('0x26')][_0x74c5('0x14')]);}_0xf9f021[_0x74c5('0x2f')]=qs[_0x74c5('0x30')](_0x506a89[_0x74c5('0x26')][_0x74c5('0x30')]);_0xf9f021[_0x74c5('0x31')]=qs['filters'](_[_0x74c5('0x32')](_0x506a89[_0x74c5('0x26')],_0x4cf2af[_0x74c5('0x28')]));if(_0x11c7e4[_0x74c5('0x33')]){if(_0x11c7e4['dateEnd']){_0x11c7e4[_0x74c5('0x27')]=moment(_0x11c7e4[_0x74c5('0x27')])[_0x74c5('0x34')](0x1,'day');}else{_0x11c7e4[_0x74c5('0x27')]=moment(_0x11c7e4[_0x74c5('0x33')])['add'](0x1,'day');}_[_0x74c5('0x35')](_0xf9f021[_0x74c5('0x31')],{'createdAt':{'$gte':_0x11c7e4[_0x74c5('0x33')],'$lte':_0x11c7e4[_0x74c5('0x27')]}});}if(_0x506a89[_0x74c5('0x26')][_0x74c5('0x36')]){_0xf9f021['where']=_[_0x74c5('0x35')](_0xf9f021[_0x74c5('0x31')],{'$or':_[_0x74c5('0x37')](_0x573400,function(_0x5b7e90){if(_0x5b7e90[_0x74c5('0x38')][_0x74c5('0x39')]!==_0x74c5('0x3a')){var _0x442762={};_0x442762[_0x5b7e90[_0x74c5('0x3b')]]={'$like':'%'+_0x506a89[_0x74c5('0x26')][_0x74c5('0x36')]+'%'};return _0x442762;}})});}_0xf9f021=_[_0x74c5('0x35')]({},_0xf9f021,_0x506a89[_0x74c5('0x3c')]);var _0x9506c6={'where':_0xf9f021['where']};return db[_0x74c5('0x22')][_0x74c5('0x3d')](_0x9506c6)['then'](function(_0x16a1c9){_0x2a5a57[_0x74c5('0x3d')]=_0x16a1c9;if(_0x506a89[_0x74c5('0x26')][_0x74c5('0x3e')]){_0xf9f021[_0x74c5('0x3f')]=[{'all':!![]}];}return db[_0x74c5('0x22')][_0x74c5('0x40')](_0xf9f021);})[_0x74c5('0x1b')](function(_0x27f6cc){_0x2a5a57[_0x74c5('0x41')]=_0x27f6cc;return _0x2a5a57;})[_0x74c5('0x1b')](respondWithFilteredResult(_0x48cd5d,_0xf9f021))[_0x74c5('0x42')](handleError(_0x48cd5d,null));};exports[_0x74c5('0x43')]=function(_0x2674b5,_0x219740){var _0x22fd13={'raw':!![],'where':{'id':_0x2674b5[_0x74c5('0x44')]['id']}},_0x3d2ad0={};_0x3d2ad0[_0x74c5('0x24')]=_['keys'](db[_0x74c5('0x22')][_0x74c5('0x23')]);_0x3d2ad0[_0x74c5('0x26')]=_[_0x74c5('0x25')](_0x2674b5['query']);_0x3d2ad0['filters']=_['intersection'](_0x3d2ad0[_0x74c5('0x24')],_0x3d2ad0[_0x74c5('0x26')]);_0x22fd13[_0x74c5('0x2a')]=_['intersection'](_0x3d2ad0['model'],qs['fields'](_0x2674b5[_0x74c5('0x26')][_0x74c5('0x2b')]));_0x22fd13['attributes']=_0x22fd13[_0x74c5('0x2a')][_0x74c5('0x2c')]?_0x22fd13['attributes']:_0x3d2ad0['model'];if(_0x2674b5['query'][_0x74c5('0x3e')]){_0x22fd13[_0x74c5('0x3f')]=[{'all':!![]}];}_0x22fd13=_[_0x74c5('0x35')]({},_0x22fd13,_0x2674b5['options']);return db[_0x74c5('0x22')]['find'](_0x22fd13)['then'](handleEntityNotFound(_0x219740,null))[_0x74c5('0x1b')](respondWithResult(_0x219740,null))['catch'](handleError(_0x219740,null));};exports['create']=function(_0x1e218c,_0xbf5967){return db[_0x74c5('0x22')][_0x74c5('0x45')](_0x1e218c[_0x74c5('0x46')],{})['then'](respondWithResult(_0xbf5967,0xc9))[_0x74c5('0x42')](handleError(_0xbf5967,null));};exports[_0x74c5('0x47')]=function(_0x4bb310,_0x2e80ab){if(_0x4bb310[_0x74c5('0x46')]['id']){delete _0x4bb310[_0x74c5('0x46')]['id'];}return db[_0x74c5('0x22')]['find']({'where':{'id':_0x4bb310[_0x74c5('0x44')]['id']}})[_0x74c5('0x1b')](handleEntityNotFound(_0x2e80ab,null))['then'](saveUpdates(_0x4bb310[_0x74c5('0x46')],null))[_0x74c5('0x1b')](respondWithResult(_0x2e80ab,null))[_0x74c5('0x42')](handleError(_0x2e80ab,null));};exports['destroy']=function(_0xd38ebe,_0x571071){return db[_0x74c5('0x22')][_0x74c5('0x48')]({'where':{'id':_0xd38ebe[_0x74c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x571071,null))[_0x74c5('0x1b')](removeEntity(_0x571071,null))['catch'](handleError(_0x571071,null));};
\ No newline at end of file
+var _0xa627=['query','dateStart','dateEnd','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','options','where','FaxApplication','includeAll','include','findAll','rows','show','params','fields','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','save','then','error','stack','name','send','rawAttributes','model','keys'];(function(_0x55a8a0,_0x313c62){var _0x581017=function(_0x5cf328){while(--_0x5cf328){_0x55a8a0['push'](_0x55a8a0['shift']());}};_0x581017(++_0x313c62);}(_0xa627,0x6d));var _0x7a62=function(_0x2d73c3,_0x30ec01){_0x2d73c3=_0x2d73c3-0x0;var _0x2a4c75=_0xa627[_0x2d73c3];return _0x2a4c75;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7a62('0x0'));var rimraf=require(_0x7a62('0x1'));var zipdir=require(_0x7a62('0x2'));var jsonpatch=require(_0x7a62('0x3'));var rp=require(_0x7a62('0x4'));var moment=require(_0x7a62('0x5'));var BPromise=require(_0x7a62('0x6'));var Mustache=require(_0x7a62('0x7'));var util=require(_0x7a62('0x8'));var path=require(_0x7a62('0x9'));var sox=require(_0x7a62('0xa'));var csv=require(_0x7a62('0xb'));var ejs=require(_0x7a62('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7a62('0xd'));var crypto=require(_0x7a62('0xe'));var jsforce=require(_0x7a62('0xf'));var deskjs=require(_0x7a62('0x10'));var toCsv=require(_0x7a62('0xb'));var querystring=require(_0x7a62('0x11'));var Papa=require(_0x7a62('0x12'));var Redis=require(_0x7a62('0x13'));var qs=require(_0x7a62('0x14'));var logger=require(_0x7a62('0x15'))(_0x7a62('0x16'));var utils=require(_0x7a62('0x17'));var config=require('../../config/environment');var db=require(_0x7a62('0x18'))['db'];function respondWithStatusCode(_0x37a32f,_0x301edd){_0x301edd=_0x301edd||0xcc;return function(_0x30293b){if(_0x30293b){return _0x37a32f[_0x7a62('0x19')](_0x301edd);}return _0x37a32f[_0x7a62('0x1a')](_0x301edd)[_0x7a62('0x1b')]();};}function respondWithResult(_0x43e1d8,_0x363e79){_0x363e79=_0x363e79||0xc8;return function(_0x267b51){if(_0x267b51){return _0x43e1d8[_0x7a62('0x1a')](_0x363e79)['json'](_0x267b51);}};}function respondWithFilteredResult(_0x5f1a25,_0x2c35d5){return function(_0x35b73c){if(_0x35b73c){var _0x487903=_0x35b73c[_0x7a62('0x1c')],_0xee6ef6=_0x2c35d5[_0x7a62('0x1d')],_0x41edf4=_0x2c35d5[_0x7a62('0x1d')]+_0x2c35d5[_0x7a62('0x1e')],_0x346e40;if(_0x41edf4>=_0x487903){_0x41edf4=_0x487903;_0x346e40=0xc8;}else{_0x346e40=0xce;}_0x5f1a25['status'](_0x346e40);return _0x5f1a25[_0x7a62('0x1f')]('Content-Range',_0xee6ef6+'-'+_0x41edf4+'/'+_0x487903)['json'](_0x35b73c);}return null;};}function patchUpdates(_0x44ad27){return function(_0x3c5729){try{jsonpatch['apply'](_0x3c5729,_0x44ad27,!![]);}catch(_0x4b15f9){return BPromise['reject'](_0x4b15f9);}return _0x3c5729[_0x7a62('0x20')]();};}function saveUpdates(_0x339c5f,_0x3ec2ad){return function(_0x739efc){if(_0x739efc){return _0x739efc['update'](_0x339c5f)[_0x7a62('0x21')](function(_0x308236){return _0x308236;});}return null;};}function removeEntity(_0x3a1afc,_0x40fc5f){return function(_0x2685f8){if(_0x2685f8){return _0x2685f8['destroy']()[_0x7a62('0x21')](function(){_0x3a1afc[_0x7a62('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ca117,_0x8871d8){return function(_0x25f928){if(!_0x25f928){_0x5ca117[_0x7a62('0x19')](0x194);}return _0x25f928;};}function handleError(_0x569e68,_0x5148c0){_0x5148c0=_0x5148c0||0x1f4;return function(_0x2c49fc){logger[_0x7a62('0x22')](_0x2c49fc[_0x7a62('0x23')]);if(_0x2c49fc[_0x7a62('0x24')]){delete _0x2c49fc[_0x7a62('0x24')];}_0x569e68['status'](_0x5148c0)[_0x7a62('0x25')](_0x2c49fc);};}exports['index']=function(_0x289f10,_0x5855c9){var _0x312455={},_0x12561d={},_0x586698={'count':0x0,'rows':[]};var _0x42f865=db['FaxApplication'][_0x7a62('0x26')];_0x12561d[_0x7a62('0x27')]=_[_0x7a62('0x28')](_0x42f865);var _0x3492e5={'dateStart':_0x289f10[_0x7a62('0x29')][_0x7a62('0x2a')],'dateEnd':_0x289f10['query'][_0x7a62('0x2b')]};delete _0x289f10['query'][_0x7a62('0x2a')];delete _0x289f10[_0x7a62('0x29')][_0x7a62('0x2b')];_0x12561d[_0x7a62('0x29')]=_[_0x7a62('0x28')](_0x289f10[_0x7a62('0x29')]);_0x12561d[_0x7a62('0x2c')]=_[_0x7a62('0x2d')](_0x12561d['model'],_0x12561d[_0x7a62('0x29')]);_0x312455[_0x7a62('0x2e')]=_[_0x7a62('0x2d')](_0x12561d['model'],qs['fields'](_0x289f10['query']['fields']));_0x312455[_0x7a62('0x2e')]=_0x312455['attributes'][_0x7a62('0x2f')]?_0x312455['attributes']:_0x12561d['model'];if(!_0x289f10['query'][_0x7a62('0x30')]('nolimit')){_0x312455[_0x7a62('0x1e')]=qs[_0x7a62('0x1e')](_0x289f10[_0x7a62('0x29')][_0x7a62('0x1e')]);_0x312455[_0x7a62('0x1d')]=qs[_0x7a62('0x1d')](_0x289f10[_0x7a62('0x29')][_0x7a62('0x1d')]);}_0x312455[_0x7a62('0x31')]=qs['sort'](_0x289f10['query'][_0x7a62('0x32')]);_0x312455['where']=qs[_0x7a62('0x2c')](_[_0x7a62('0x33')](_0x289f10[_0x7a62('0x29')],_0x12561d['filters']));if(_0x3492e5[_0x7a62('0x2a')]){if(_0x3492e5['dateEnd']){_0x3492e5[_0x7a62('0x2b')]=moment(_0x3492e5['dateEnd'])[_0x7a62('0x34')](0x1,_0x7a62('0x35'));}else{_0x3492e5[_0x7a62('0x2b')]=moment(_0x3492e5[_0x7a62('0x2a')])[_0x7a62('0x34')](0x1,_0x7a62('0x35'));}_[_0x7a62('0x36')](_0x312455['where'],{'createdAt':{'$gte':_0x3492e5[_0x7a62('0x2a')],'$lte':_0x3492e5['dateEnd']}});}if(_0x289f10[_0x7a62('0x29')][_0x7a62('0x37')]){_0x312455['where']=_[_0x7a62('0x36')](_0x312455['where'],{'$or':_[_0x7a62('0x38')](_0x42f865,function(_0x246fec){if(_0x246fec[_0x7a62('0x39')][_0x7a62('0x3a')]!==_0x7a62('0x3b')){var _0x229156={};_0x229156[_0x246fec[_0x7a62('0x3c')]]={'$like':'%'+_0x289f10[_0x7a62('0x29')][_0x7a62('0x37')]+'%'};return _0x229156;}})});}_0x312455=_['merge']({},_0x312455,_0x289f10[_0x7a62('0x3d')]);var _0x26527c={'where':_0x312455[_0x7a62('0x3e')]};return db[_0x7a62('0x3f')][_0x7a62('0x1c')](_0x26527c)[_0x7a62('0x21')](function(_0x432121){_0x586698[_0x7a62('0x1c')]=_0x432121;if(_0x289f10[_0x7a62('0x29')][_0x7a62('0x40')]){_0x312455[_0x7a62('0x41')]=[{'all':!![]}];}return db[_0x7a62('0x3f')][_0x7a62('0x42')](_0x312455);})[_0x7a62('0x21')](function(_0x2856a0){_0x586698[_0x7a62('0x43')]=_0x2856a0;return _0x586698;})[_0x7a62('0x21')](respondWithFilteredResult(_0x5855c9,_0x312455))['catch'](handleError(_0x5855c9,null));};exports[_0x7a62('0x44')]=function(_0x5f472a,_0x1f89d2){var _0x386c27={'raw':!![],'where':{'id':_0x5f472a[_0x7a62('0x45')]['id']}},_0x4bb17e={};_0x4bb17e[_0x7a62('0x27')]=_[_0x7a62('0x28')](db[_0x7a62('0x3f')][_0x7a62('0x26')]);_0x4bb17e['query']=_['keys'](_0x5f472a[_0x7a62('0x29')]);_0x4bb17e['filters']=_[_0x7a62('0x2d')](_0x4bb17e['model'],_0x4bb17e[_0x7a62('0x29')]);_0x386c27['attributes']=_['intersection'](_0x4bb17e[_0x7a62('0x27')],qs[_0x7a62('0x46')](_0x5f472a[_0x7a62('0x29')][_0x7a62('0x46')]));_0x386c27['attributes']=_0x386c27[_0x7a62('0x2e')][_0x7a62('0x2f')]?_0x386c27['attributes']:_0x4bb17e['model'];if(_0x5f472a['query'][_0x7a62('0x40')]){_0x386c27['include']=[{'all':!![]}];}_0x386c27=_['merge']({},_0x386c27,_0x5f472a['options']);return db[_0x7a62('0x3f')]['find'](_0x386c27)[_0x7a62('0x21')](handleEntityNotFound(_0x1f89d2,null))['then'](respondWithResult(_0x1f89d2,null))[_0x7a62('0x47')](handleError(_0x1f89d2,null));};exports[_0x7a62('0x48')]=function(_0x38601c,_0x2acb09){return db[_0x7a62('0x3f')][_0x7a62('0x48')](_0x38601c['body'],{})[_0x7a62('0x21')](respondWithResult(_0x2acb09,0xc9))['catch'](handleError(_0x2acb09,null));};exports['update']=function(_0x3e2ba7,_0x30fc40){if(_0x3e2ba7[_0x7a62('0x49')]['id']){delete _0x3e2ba7[_0x7a62('0x49')]['id'];}return db[_0x7a62('0x3f')]['find']({'where':{'id':_0x3e2ba7[_0x7a62('0x45')]['id']}})['then'](handleEntityNotFound(_0x30fc40,null))[_0x7a62('0x21')](saveUpdates(_0x3e2ba7[_0x7a62('0x49')],null))[_0x7a62('0x21')](respondWithResult(_0x30fc40,null))['catch'](handleError(_0x30fc40,null));};exports[_0x7a62('0x4a')]=function(_0x583662,_0x4569ab){return db[_0x7a62('0x3f')]['find']({'where':{'id':_0x583662[_0x7a62('0x45')]['id']}})[_0x7a62('0x21')](handleEntityNotFound(_0x4569ab,null))[_0x7a62('0x21')](removeEntity(_0x4569ab,null))[_0x7a62('0x47')](handleError(_0x4569ab,null));};
\ No newline at end of file
index 39cd85a..22d6aa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45a4=['api','moment','bluebird','./faxApplication.attributes','exports','FaxApplication','fax_applications','lodash','util'];(function(_0x5b9837,_0x2b11e4){var _0x2f220=function(_0x12e5f3){while(--_0x12e5f3){_0x5b9837['push'](_0x5b9837['shift']());}};_0x2f220(++_0x2b11e4);}(_0x45a4,0x181));var _0x445a=function(_0x3e8bfc,_0x4c480d){_0x3e8bfc=_0x3e8bfc-0x0;var _0x5574f0=_0x45a4[_0x3e8bfc];return _0x5574f0;};'use strict';var _=require(_0x445a('0x0'));var util=require(_0x445a('0x1'));var logger=require('../../config/logger')(_0x445a('0x2'));var moment=require(_0x445a('0x3'));var BPromise=require(_0x445a('0x4'));var rp=require('request-promise');var attributes=require(_0x445a('0x5'));module[_0x445a('0x6')]=function(_0x1e76c8,_0x431f86){return _0x1e76c8['define'](_0x445a('0x7'),attributes,{'tableName':_0x445a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa165=['moment','bluebird','request-promise','exports','define','FaxApplication','fax_applications','util','../../config/logger','api'];(function(_0x4e745b,_0x2445f1){var _0x558519=function(_0x457dd5){while(--_0x457dd5){_0x4e745b['push'](_0x4e745b['shift']());}};_0x558519(++_0x2445f1);}(_0xa165,0x1a1));var _0x5a16=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xa165[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0x5a16('0x0'));var logger=require(_0x5a16('0x1'))(_0x5a16('0x2'));var moment=require(_0x5a16('0x3'));var BPromise=require(_0x5a16('0x4'));var rp=require(_0x5a16('0x5'));var attributes=require('./faxApplication.attributes');module[_0x5a16('0x6')]=function(_0x1dc66f,_0x37f81f){return _0x1dc66f[_0x5a16('0x7')](_0x5a16('0x8'),attributes,{'tableName':_0x5a16('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7717516..0f25b1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa53=['info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then'];(function(_0x2e890e,_0x1a22b7){var _0x5d2b7f=function(_0x464442){while(--_0x464442){_0x2e890e['push'](_0x2e890e['shift']());}};_0x5d2b7f(++_0x1a22b7);}(_0xfa53,0x1a7));var _0x3fa5=function(_0x5cb5ea,_0x374462){_0x5cb5ea=_0x5cb5ea-0x0;var _0x1f9b1c=_0xfa53[_0x5cb5ea];return _0x1f9b1c;};'use strict';var _=require(_0x3fa5('0x0'));var util=require(_0x3fa5('0x1'));var moment=require(_0x3fa5('0x2'));var BPromise=require(_0x3fa5('0x3'));var rs=require(_0x3fa5('0x4'));var fs=require('fs');var Redis=require(_0x3fa5('0x5'));var db=require(_0x3fa5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fa5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3fa5('0x8'));var client=jayson['client'][_0x3fa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f447e,_0x3ba6f3,_0x2193a4){return new BPromise(function(_0x404239,_0x1c2515){return client[_0x3fa5('0xa')](_0x3f447e,_0x2193a4)[_0x3fa5('0xb')](function(_0x427eca){logger[_0x3fa5('0xc')](_0x3fa5('0xd'),_0x3ba6f3,_0x3fa5('0xe'));logger['debug'](_0x3fa5('0xf'),_0x3ba6f3,'request\x20sent',JSON['stringify'](_0x427eca));if(_0x427eca[_0x3fa5('0x10')]){if(_0x427eca['error'][_0x3fa5('0x11')]===0x1f4){logger[_0x3fa5('0x10')]('FaxApplication,\x20%s,\x20%s',_0x3ba6f3,_0x427eca[_0x3fa5('0x10')][_0x3fa5('0x12')]);return _0x1c2515(_0x427eca[_0x3fa5('0x10')][_0x3fa5('0x12')]);}logger['error'](_0x3fa5('0xd'),_0x3ba6f3,_0x427eca[_0x3fa5('0x10')][_0x3fa5('0x12')]);return _0x404239(_0x427eca['error'][_0x3fa5('0x12')]);}else{logger[_0x3fa5('0xc')]('FaxApplication,\x20%s,\x20%s',_0x3ba6f3,_0x3fa5('0xe'));_0x404239(_0x427eca['result']['message']);}})['catch'](function(_0x4ab8f0){logger['error'](_0x3fa5('0xd'),_0x3ba6f3,_0x4ab8f0);_0x1c2515(_0x4ab8f0);});});}exports[_0x3fa5('0x13')]=function(_0x3d07d1){var _0x399052=this;return new Promise(function(_0x298448,_0x230bff){return db[_0x3fa5('0x14')][_0x3fa5('0x15')](_0x3d07d1[_0x3fa5('0x16')],{'raw':_0x3d07d1[_0x3fa5('0x17')]?_0x3d07d1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d07d1[_0x3fa5('0x17')]?_0x3d07d1[_0x3fa5('0x17')][_0x3fa5('0x18')]||null:null,'attributes':_0x3d07d1[_0x3fa5('0x17')]?_0x3d07d1[_0x3fa5('0x17')][_0x3fa5('0x19')]||null:null,'limit':_0x3d07d1[_0x3fa5('0x17')]?_0x3d07d1[_0x3fa5('0x17')][_0x3fa5('0x1a')]||null:null})[_0x3fa5('0xb')](function(_0x45e497){logger[_0x3fa5('0xc')](_0x3fa5('0x13'),_0x3d07d1);logger[_0x3fa5('0x1b')](_0x3fa5('0x13'),_0x3d07d1,JSON['stringify'](_0x45e497));_0x298448(_0x45e497);})[_0x3fa5('0x1c')](function(_0x1dbab9){logger['error']('UpdateFaxApplication',_0x1dbab9[_0x3fa5('0x12')],_0x3d07d1);_0x230bff(_0x399052[_0x3fa5('0x10')](0x1f4,_0x1dbab9[_0x3fa5('0x12')]));});});};
\ No newline at end of file
+var _0xb9e3=['../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update','body','options','raw','attributes','limit','debug','UpdateFaxApplication','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x24004b,_0x37f6d8){var _0x5013e5=function(_0x5ea926){while(--_0x5ea926){_0x24004b['push'](_0x24004b['shift']());}};_0x5013e5(++_0x37f6d8);}(_0xb9e3,0xde));var _0x3b9e=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0xb9e3[_0x5a7dd3];return _0x2f4d07;};'use strict';var _=require(_0x3b9e('0x0'));var util=require('util');var moment=require(_0x3b9e('0x1'));var BPromise=require(_0x3b9e('0x2'));var rs=require(_0x3b9e('0x3'));var fs=require('fs');var Redis=require(_0x3b9e('0x4'));var db=require(_0x3b9e('0x5'))['db'];var utils=require(_0x3b9e('0x6'));var logger=require(_0x3b9e('0x7'))(_0x3b9e('0x8'));var config=require(_0x3b9e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3b9e('0xa')][_0x3b9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a89c2,_0x110de6,_0xd4b359){return new BPromise(function(_0x51ca5a,_0x3eedab){return client[_0x3b9e('0xc')](_0x4a89c2,_0xd4b359)[_0x3b9e('0xd')](function(_0x3cf61b){logger[_0x3b9e('0xe')](_0x3b9e('0xf'),_0x110de6,_0x3b9e('0x10'));logger['debug'](_0x3b9e('0x11'),_0x110de6,_0x3b9e('0x10'),JSON[_0x3b9e('0x12')](_0x3cf61b));if(_0x3cf61b[_0x3b9e('0x13')]){if(_0x3cf61b[_0x3b9e('0x13')][_0x3b9e('0x14')]===0x1f4){logger[_0x3b9e('0x13')](_0x3b9e('0xf'),_0x110de6,_0x3cf61b[_0x3b9e('0x13')][_0x3b9e('0x15')]);return _0x3eedab(_0x3cf61b[_0x3b9e('0x13')][_0x3b9e('0x15')]);}logger[_0x3b9e('0x13')](_0x3b9e('0xf'),_0x110de6,_0x3cf61b[_0x3b9e('0x13')]['message']);return _0x51ca5a(_0x3cf61b[_0x3b9e('0x13')]['message']);}else{logger['info'](_0x3b9e('0xf'),_0x110de6,_0x3b9e('0x10'));_0x51ca5a(_0x3cf61b[_0x3b9e('0x16')][_0x3b9e('0x15')]);}})[_0x3b9e('0x17')](function(_0x584a5b){logger[_0x3b9e('0x13')]('FaxApplication,\x20%s,\x20%s',_0x110de6,_0x584a5b);_0x3eedab(_0x584a5b);});});}exports['UpdateFaxApplication']=function(_0x1d3e7f){var _0x120a2b=this;return new Promise(function(_0x2b7e7e,_0x6d17b2){return db[_0x3b9e('0x18')][_0x3b9e('0x19')](_0x1d3e7f[_0x3b9e('0x1a')],{'raw':_0x1d3e7f['options']?_0x1d3e7f[_0x3b9e('0x1b')][_0x3b9e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d3e7f['options']?_0x1d3e7f['options']['where']||null:null,'attributes':_0x1d3e7f[_0x3b9e('0x1b')]?_0x1d3e7f['options'][_0x3b9e('0x1d')]||null:null,'limit':_0x1d3e7f[_0x3b9e('0x1b')]?_0x1d3e7f[_0x3b9e('0x1b')][_0x3b9e('0x1e')]||null:null})[_0x3b9e('0xd')](function(_0x43c07d){logger[_0x3b9e('0xe')]('UpdateFaxApplication',_0x1d3e7f);logger[_0x3b9e('0x1f')](_0x3b9e('0x20'),_0x1d3e7f,JSON[_0x3b9e('0x12')](_0x43c07d));_0x2b7e7e(_0x43c07d);})[_0x3b9e('0x17')](function(_0x5eb9fb){logger[_0x3b9e('0x13')]('UpdateFaxApplication',_0x5eb9fb[_0x3b9e('0x15')],_0x1d3e7f);_0x6d17b2(_0x120a2b[_0x3b9e('0x13')](0x1f4,_0x5eb9fb['message']));});});};
\ No newline at end of file
index 848be6e..125ab47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f54=['create','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x65ff4f,_0x20c286){var _0x583441=function(_0x1d93c4){while(--_0x1d93c4){_0x65ff4f['push'](_0x65ff4f['shift']());}};_0x583441(++_0x20c286);}(_0x0f54,0xb8));var _0x40f5=function(_0x5b616e,_0x37f146){_0x5b616e=_0x5b616e-0x0;var _0xbac849=_0x0f54[_0x5b616e];return _0xbac849;};'use strict';var multer=require('multer');var util=require(_0x40f5('0x0'));var path=require(_0x40f5('0x1'));var timeout=require(_0x40f5('0x2'));var express=require(_0x40f5('0x3'));var router=express[_0x40f5('0x4')]();var auth=require(_0x40f5('0x5'));var interaction=require(_0x40f5('0x6'));var config=require(_0x40f5('0x7'));var controller=require(_0x40f5('0x8'));router[_0x40f5('0x9')]('/',auth[_0x40f5('0xa')](),controller[_0x40f5('0xb')]);router['get'](_0x40f5('0xc'),auth['isAuthenticated'](),controller[_0x40f5('0xd')]);router['post']('/',auth[_0x40f5('0xa')](),controller[_0x40f5('0xe')]);router['put'](_0x40f5('0xc'),auth[_0x40f5('0xa')](),controller[_0x40f5('0xf')]);router[_0x40f5('0x10')](_0x40f5('0xc'),auth[_0x40f5('0xa')](),controller['destroy']);module[_0x40f5('0x11')]=router;
\ No newline at end of file
+var _0xe3eb=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer'];(function(_0x4e7544,_0x17891b){var _0x1c20ee=function(_0x2c068b){while(--_0x2c068b){_0x4e7544['push'](_0x4e7544['shift']());}};_0x1c20ee(++_0x17891b);}(_0xe3eb,0xa1));var _0xbe3e=function(_0x406edf,_0x158410){_0x406edf=_0x406edf-0x0;var _0x194d77=_0xe3eb[_0x406edf];return _0x194d77;};'use strict';var multer=require(_0xbe3e('0x0'));var util=require(_0xbe3e('0x1'));var path=require(_0xbe3e('0x2'));var timeout=require('connect-timeout');var express=require(_0xbe3e('0x3'));var router=express['Router']();var auth=require(_0xbe3e('0x4'));var interaction=require(_0xbe3e('0x5'));var config=require(_0xbe3e('0x6'));var controller=require(_0xbe3e('0x7'));router['get']('/',auth[_0xbe3e('0x8')](),controller[_0xbe3e('0x9')]);router['get']('/:id',auth[_0xbe3e('0x8')](),controller[_0xbe3e('0xa')]);router[_0xbe3e('0xb')]('/',auth['isAuthenticated'](),controller[_0xbe3e('0xc')]);router[_0xbe3e('0xd')](_0xbe3e('0xe'),auth[_0xbe3e('0x8')](),controller['update']);router[_0xbe3e('0xf')](_0xbe3e('0xe'),auth['isAuthenticated'](),controller[_0xbe3e('0x10')]);module[_0xbe3e('0x11')]=router;
\ No newline at end of file
index c5b923b..782c1a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec9a=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3bd478,_0x1bb19a){var _0x5d4211=function(_0xa26806){while(--_0xa26806){_0x3bd478['push'](_0x3bd478['shift']());}};_0x5d4211(++_0x1bb19a);}(_0xec9a,0xf7));var _0xaec9=function(_0x271caa,_0x485e70){_0x271caa=_0x271caa-0x0;var _0x18a8fa=_0xec9a[_0x271caa];return _0x18a8fa;};'use strict';var Sequelize=require(_0xaec9('0x0'));module['exports']={'closed':{'type':Sequelize[_0xaec9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaec9('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xaec9('0x3')]},'read1stAt':{'type':Sequelize[_0xaec9('0x2')]},'fax':{'type':Sequelize[_0xaec9('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xaec9('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaec9('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xaec9('0x4')]('in',_0xaec9('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x1009=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x594e22,_0x2d4c03){var _0x16c839=function(_0x36df8a){while(--_0x36df8a){_0x594e22['push'](_0x594e22['shift']());}};_0x16c839(++_0x2d4c03);}(_0x1009,0x1a5));var _0x9100=function(_0x35ef46,_0x1f269d){_0x35ef46=_0x35ef46-0x0;var _0x4be9ef=_0x1009[_0x35ef46];return _0x4be9ef;};'use strict';var Sequelize=require(_0x9100('0x0'));module[_0x9100('0x1')]={'closed':{'type':Sequelize[_0x9100('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9100('0x3')]},'disposition':{'type':Sequelize[_0x9100('0x4')]},'note':{'type':Sequelize[_0x9100('0x4')]},'read1stAt':{'type':Sequelize[_0x9100('0x3')]},'fax':{'type':Sequelize[_0x9100('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9100('0x5')]('in',_0x9100('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9100('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9100('0x5')]('in',_0x9100('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 29aab5a..473e239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['params','describe','addMessage','ids','omit','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','faxInteractionTags:save','removeTags','download','toString','join','server','files','attachments','root','interaction-%s.zip','Attachment','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','log','err','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','FaxInteraction','rawAttributes','keys','query','dateStart','dateEnd','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','map','key','VIRTUAL','field','filter','options','include','tag','push','Tag','Tags','distinct','read','FaxMessage','Messages','direction','createdAt','includeAll','User','Users','fullname','CmContact','internal','Account','color','ThroughTags','findAll','catch','show','find','create','body','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var qs=require(_0x0a9e('0xf'));var logger=require(_0x0a9e('0x10'))(_0x0a9e('0x11'));var utils=require(_0x0a9e('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x14'),'port':0x18eb});var socket=require(_0x0a9e('0x15'))(new Redis(config[_0x0a9e('0x13')]));require(_0x0a9e('0x16'))[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xcc;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x18')](_0x4283ce);}return _0x5db4b0[_0x0a9e('0x19')](_0x4283ce)[_0x0a9e('0x1a')]();};}function respondWithResult(_0x4d5611,_0x52a03d){_0x52a03d=_0x52a03d||0xc8;return function(_0x22dccb){if(_0x22dccb){return _0x4d5611['status'](_0x52a03d)[_0x0a9e('0x1b')](_0x22dccb);}};}function respondWithFilteredResult(_0x519dfd,_0x16033c){return function(_0x12066b){if(_0x12066b){var _0x48f32d=_0x12066b[_0x0a9e('0x1c')],_0x225616=_0x16033c[_0x0a9e('0x1d')],_0x5a0a06=_0x16033c[_0x0a9e('0x1d')]+_0x16033c[_0x0a9e('0x1e')],_0x459eb1;if(_0x5a0a06>=_0x48f32d){_0x5a0a06=_0x48f32d;_0x459eb1=0xc8;}else{_0x459eb1=0xce;}_0x519dfd[_0x0a9e('0x19')](_0x459eb1);return _0x519dfd[_0x0a9e('0x1f')](_0x0a9e('0x20'),_0x225616+'-'+_0x5a0a06+'/'+_0x48f32d)[_0x0a9e('0x1b')](_0x12066b);}return null;};}function patchUpdates(_0x112016){return function(_0x1c696a){try{jsonpatch[_0x0a9e('0x21')](_0x1c696a,_0x112016,!![]);}catch(_0x4bb1e3){return BPromise[_0x0a9e('0x22')](_0x4bb1e3);}return _0x1c696a[_0x0a9e('0x23')]();};}function saveUpdates(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['update'](_0x53682f)[_0x0a9e('0x24')](function(_0x432e56){return _0x432e56;});}return null;};}function removeEntity(_0x38e7c4,_0x30bae6){return function(_0x4abc77){if(_0x4abc77){return _0x4abc77[_0x0a9e('0x25')]()[_0x0a9e('0x24')](function(){_0x38e7c4[_0x0a9e('0x19')](0xcc)[_0x0a9e('0x1a')]();});}};}function handleEntityNotFound(_0x370d86,_0x42ac8f){return function(_0x16b1ca){if(!_0x16b1ca){_0x370d86['sendStatus'](0x194);}return _0x16b1ca;};}function handleError(_0x59181e,_0x197ec0){_0x197ec0=_0x197ec0||0x1f4;return function(_0x3a8e58){logger[_0x0a9e('0x26')](_0x3a8e58[_0x0a9e('0x27')]);if(_0x3a8e58['name']){delete _0x3a8e58[_0x0a9e('0x28')];}_0x59181e['status'](_0x197ec0)[_0x0a9e('0x29')](_0x3a8e58);};}exports['index']=function(_0x1dc186,_0x34dc65){var _0x25fba9={},_0x14433c={},_0x140511={'count':0x0,'rows':[]};var _0x1538a4=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x14433c['model']=_[_0x0a9e('0x2c')](_0x1538a4);var _0x468813={'dateStart':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x2e')],'dateEnd':_0x1dc186['query'][_0x0a9e('0x2f')]};delete _0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x2e')];delete _0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x2f')];_0x14433c[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1dc186[_0x0a9e('0x2d')]);_0x14433c[_0x0a9e('0x30')]=_['intersection'](_0x14433c[_0x0a9e('0x31')],_0x14433c['query']);_0x25fba9[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x14433c[_0x0a9e('0x31')],qs[_0x0a9e('0x34')](_0x1dc186[_0x0a9e('0x2d')]['fields']));_0x25fba9[_0x0a9e('0x32')]=_0x25fba9[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x25fba9[_0x0a9e('0x32')]:_0x14433c[_0x0a9e('0x31')];if(!_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x25fba9['limit']=qs[_0x0a9e('0x1e')](_0x1dc186['query'][_0x0a9e('0x1e')]);_0x25fba9[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1dc186[_0x0a9e('0x2d')]['offset']);}_0x25fba9[_0x0a9e('0x38')]=qs[_0x0a9e('0x39')](_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x39')]);_0x25fba9['where']=qs['filters'](_[_0x0a9e('0x3a')](_0x1dc186['query'],_0x14433c[_0x0a9e('0x30')]));if(_0x468813[_0x0a9e('0x2e')]){if(_0x468813[_0x0a9e('0x2f')]){_0x468813[_0x0a9e('0x2f')]=moment(_0x468813['dateEnd'])[_0x0a9e('0x3b')](0x1,_0x0a9e('0x3c'));}else{_0x468813[_0x0a9e('0x2f')]=moment(_0x468813['dateStart'])[_0x0a9e('0x3b')](0x1,_0x0a9e('0x3c'));}_[_0x0a9e('0x3d')](_0x25fba9['where'],{'createdAt':{'$gte':_0x468813['dateStart'],'$lte':_0x468813[_0x0a9e('0x2f')]}});}if(_0x1dc186[_0x0a9e('0x2d')]['filter']){_0x25fba9[_0x0a9e('0x3e')]=_[_0x0a9e('0x3d')](_0x25fba9[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x3f')](_0x1538a4,function(_0x4b38d9){if(_0x4b38d9['type'][_0x0a9e('0x40')]!==_0x0a9e('0x41')){var _0x53f3ee={};_0x53f3ee[_0x4b38d9[_0x0a9e('0x42')]]={'$like':'%'+_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x43')]+'%'};return _0x53f3ee;}})});}_0x25fba9=_['merge']({},_0x25fba9,_0x1dc186[_0x0a9e('0x44')]);var _0x2cfea9={'where':_0x25fba9[_0x0a9e('0x3e')]};_0x2cfea9[_0x0a9e('0x45')]=[];if(_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]){_0x2cfea9[_0x0a9e('0x45')][_0x0a9e('0x47')]({'model':db[_0x0a9e('0x48')],'as':_0x0a9e('0x49'),'attributes':['id'],'where':{'id':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]},'required':!![]});_0x2cfea9[_0x0a9e('0x4a')]=!![];}if(_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]){_0x2cfea9['include']['push']({'model':db[_0x0a9e('0x4c')],'as':_0x0a9e('0x4d'),'attributes':['id',_0x0a9e('0x4e'),_0x0a9e('0x4f'),_0x0a9e('0x4b')],'where':{'direction':'in','read':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]||![]},'required':!![]});_0x2cfea9[_0x0a9e('0x4a')]=!![];}return db[_0x0a9e('0x2a')][_0x0a9e('0x1c')](_0x2cfea9)[_0x0a9e('0x24')](function(_0x35ed4a){_0x140511['count']=_0x35ed4a;if(_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x50')]){_0x25fba9[_0x0a9e('0x45')]=[{'model':db[_0x0a9e('0x51')],'as':_0x0a9e('0x52'),'required':![],'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x53')]},{'model':db[_0x0a9e('0x54')],'as':'Contact','required':![]},{'model':db[_0x0a9e('0x51')],'as':'Owner','attributes':[_0x0a9e('0x28'),_0x0a9e('0x53'),_0x0a9e('0x55')],'required':![]},{'model':db['FaxAccount'],'as':_0x0a9e('0x56'),'attributes':[_0x0a9e('0x28'),_0x0a9e('0x40')],'required':![]},{'model':db[_0x0a9e('0x4c')],'as':_0x0a9e('0x4d'),'attributes':['id',_0x0a9e('0x4e'),_0x0a9e('0x4f'),'read'],'where':{'direction':'in','read':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]||![]},'required':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]||![]},{'model':db[_0x0a9e('0x48')],'as':_0x0a9e('0x49'),'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x57')],'required':_0x1dc186[_0x0a9e('0x2d')]['tag']?!![]:![]},{'model':db[_0x0a9e('0x48')],'as':_0x0a9e('0x58'),'attributes':['id','name','color'],'through':_0x1dc186['query'][_0x0a9e('0x46')]?{'attributes':[],'where':{'TagId':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]||undefined}}:{},'required':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]?!![]:![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x59')](_0x25fba9);})[_0x0a9e('0x24')](function(_0x5d38ae){_0x140511['rows']=_0x5d38ae;return _0x140511;})['then'](respondWithFilteredResult(_0x34dc65,_0x25fba9))[_0x0a9e('0x5a')](handleError(_0x34dc65,null));};exports[_0x0a9e('0x5b')]=function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'raw':![],'where':{'id':_0x14d602['params']['id']}},_0x161aa7={};_0x161aa7['model']=_[_0x0a9e('0x2c')](db['FaxInteraction'][_0x0a9e('0x2b')]);_0x161aa7['query']=_[_0x0a9e('0x2c')](_0x14d602[_0x0a9e('0x2d')]);_0x161aa7[_0x0a9e('0x30')]=_['intersection'](_0x161aa7[_0x0a9e('0x31')],_0x161aa7[_0x0a9e('0x2d')]);_0x2b69d9['attributes']=_['intersection'](_0x161aa7[_0x0a9e('0x31')],qs[_0x0a9e('0x34')](_0x14d602['query'][_0x0a9e('0x34')]));_0x2b69d9['attributes']=_0x2b69d9[_0x0a9e('0x32')]['length']?_0x2b69d9[_0x0a9e('0x32')]:_0x161aa7['model'];if(_0x14d602['query']['includeAll']){_0x2b69d9[_0x0a9e('0x45')]=[{'all':!![]}];}_0x2b69d9=_['merge']({},_0x2b69d9,_0x14d602[_0x0a9e('0x44')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x5c')](_0x2b69d9)[_0x0a9e('0x24')](handleEntityNotFound(_0x5bb3ed,null))[_0x0a9e('0x24')](respondWithResult(_0x5bb3ed,null))[_0x0a9e('0x5a')](handleError(_0x5bb3ed,null));};exports[_0x0a9e('0x5d')]=function(_0x28d814,_0x4e67ab){return db[_0x0a9e('0x2a')][_0x0a9e('0x5d')](_0x28d814[_0x0a9e('0x5e')],{})[_0x0a9e('0x24')](respondWithResult(_0x4e67ab,0xc9))[_0x0a9e('0x5a')](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x5f')]=function(_0x5d86e9,_0x956fbe){if(_0x5d86e9[_0x0a9e('0x5e')]['id']){delete _0x5d86e9['body']['id'];}return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x5d86e9[_0x0a9e('0x60')]['id']}})['then'](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9['body'],null))[_0x0a9e('0x24')](respondWithResult(_0x956fbe,null))['catch'](handleError(_0x956fbe,null));};exports[_0x0a9e('0x25')]=function(_0x1fc70e,_0x261adb){return db[_0x0a9e('0x2a')][_0x0a9e('0x5c')]({'where':{'id':_0x1fc70e[_0x0a9e('0x60')]['id']}})['then'](handleEntityNotFound(_0x261adb,null))[_0x0a9e('0x24')](removeEntity(_0x261adb,null))['catch'](handleError(_0x261adb,null));};exports[_0x0a9e('0x61')]=function(_0x1f07cb,_0x51aaf7){return db['FaxInteraction'][_0x0a9e('0x61')]()[_0x0a9e('0x24')](respondWithResult(_0x51aaf7,null))[_0x0a9e('0x5a')](handleError(_0x51aaf7,null));};exports[_0x0a9e('0x62')]=function(_0x497d91,_0x1d0dc8,_0xe05a5a){return db['FaxMessage'][_0x0a9e('0x5c')]({'where':{'id':_0x497d91[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1d0dc8,null))[_0x0a9e('0x24')](function(_0x401837){if(_0x401837){return _0x401837['addMessage'](_0x497d91[_0x0a9e('0x5e')][_0x0a9e('0x63')],_[_0x0a9e('0x64')](_0x497d91['body'],[_0x0a9e('0x63'),'id'])||{});}})['then'](respondWithResult(_0x1d0dc8,null))['catch'](handleError(_0x1d0dc8,null));};exports[_0x0a9e('0x65')]=function(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39={'raw':![],'where':{}};var _0xc8c264={};var _0x387489={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x66')]({'where':{'id':_0x4556c5[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x24')](function(_0x2bbb86){if(_0x2bbb86){_0xc8c264[_0x0a9e('0x31')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x4c')][_0x0a9e('0x2b')]);_0xc8c264[_0x0a9e('0x2d')]=_['keys'](_0x4556c5[_0x0a9e('0x2d')]);_0xc8c264[_0x0a9e('0x30')]=_[_0x0a9e('0x33')](_0xc8c264['model'],_0xc8c264[_0x0a9e('0x2d')]);_0x186f39[_0x0a9e('0x32')]=_['intersection'](_0xc8c264[_0x0a9e('0x31')],qs[_0x0a9e('0x34')](_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x34')]));_0x186f39[_0x0a9e('0x32')]=_0x186f39['attributes']['length']?_0x186f39['attributes']:_0xc8c264[_0x0a9e('0x31')];if(!_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x186f39[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x1e')]);_0x186f39['offset']=qs[_0x0a9e('0x1d')](_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x1d')]);}_0x186f39['order']=qs[_0x0a9e('0x39')](_0x4556c5['query'][_0x0a9e('0x39')]);_0x186f39[_0x0a9e('0x3e')]=qs['filters'](_[_0x0a9e('0x3a')](_0x4556c5[_0x0a9e('0x2d')],_0xc8c264[_0x0a9e('0x30')]));_0x186f39[_0x0a9e('0x3e')]['FaxInteractionId']=_0x2bbb86['id'];if(_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x43')]){_0x186f39[_0x0a9e('0x3e')]=_[_0x0a9e('0x3d')](_0x186f39['where'],{'$or':_[_0x0a9e('0x3f')](_0x186f39[_0x0a9e('0x32')],function(_0x2d5506){var _0x361b21={};_0x361b21[_0x2d5506]={'$like':'%'+_0x4556c5['query'][_0x0a9e('0x43')]+'%'};return _0x361b21;})});}if(_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x67')]){var _0xf410e5=_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x67')][_0x0a9e('0x68')](',');var _0x3df0e3={};_0x3df0e3[_0xf410e5[0x0]]={'$gte':moment(_0xf410e5[0x1])[_0x0a9e('0x69')](_0x0a9e('0x6a'))};_0x186f39[_0x0a9e('0x3e')]=_[_0x0a9e('0x3d')](_0x186f39[_0x0a9e('0x3e')],_0x3df0e3);}_0x186f39=_[_0x0a9e('0x3d')]({},_0x186f39,_0x4556c5['options']);return db[_0x0a9e('0x4c')][_0x0a9e('0x1c')]({'where':_0x186f39[_0x0a9e('0x3e')]})['then'](function(_0x3736e0){_0x387489[_0x0a9e('0x1c')]=_0x3736e0;if(_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x50')]){_0x186f39['include']=[{'all':!![]}];}return db['FaxMessage'][_0x0a9e('0x59')](_0x186f39);})[_0x0a9e('0x24')](function(_0x4c54fa){_0x387489[_0x0a9e('0x6b')]=_0x4c54fa;return _0x387489;});}})['then'](respondWithFilteredResult(_0x9375fb,_0x186f39))[_0x0a9e('0x5a')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x6c')]=function(_0x5637a1,_0x28a942,_0x41cf12){return db[_0x0a9e('0x2a')][_0x0a9e('0x5c')]({'where':{'id':_0x5637a1[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x28a942,null))[_0x0a9e('0x24')](function(_0x482ca2){if(_0x482ca2){return _0x482ca2[_0x0a9e('0x6d')](_0x5637a1[_0x0a9e('0x5e')][_0x0a9e('0x63')],_[_0x0a9e('0x64')](_0x5637a1['body'],[_0x0a9e('0x63'),'id'])||{})[_0x0a9e('0x6e')](function(){return db['Tag'][_0x0a9e('0x59')]({'attributes':['id','name',_0x0a9e('0x57')],'where':{'id':_0x5637a1[_0x0a9e('0x5e')][_0x0a9e('0x63')]}});})[_0x0a9e('0x24')](function(_0x5af453){socket['emit'](_0x0a9e('0x6f'),{'id':Number(_0x5637a1[_0x0a9e('0x60')]['id']),'tags':_0x5af453||[]});return{'id':Number(_0x5637a1[_0x0a9e('0x60')]['id']),'tags':_0x5af453||[]};});}})['then'](respondWithResult(_0x28a942,null))[_0x0a9e('0x5a')](handleError(_0x28a942,null));};exports[_0x0a9e('0x70')]=function(_0x524e38,_0x4e46b2,_0xf0a802){var _0x56acca;return db['FaxInteraction']['find']({'where':{'id':_0x524e38[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x4e46b2,null))[_0x0a9e('0x24')](function(_0x3bfadf){if(_0x3bfadf){return _0x3bfadf[_0x0a9e('0x70')](_0x524e38[_0x0a9e('0x2d')]['ids']);}})[_0x0a9e('0x24')](respondWithStatusCode(_0x4e46b2,null))['catch'](handleError(_0x4e46b2,null));};exports[_0x0a9e('0x71')]=function(_0x2aabab,_0x18ad56){var _0x4566b0=moment()['unix']()[_0x0a9e('0x72')]();var _0x32f761=path[_0x0a9e('0x73')](config['root'],_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'));var _0x22063c=path[_0x0a9e('0x73')](config[_0x0a9e('0x77')],_0x0a9e('0x74'),_0x0a9e('0x75'),'tmp');var _0x2645d6=path[_0x0a9e('0x73')](_0x22063c,_0x4566b0);var _0x589ff3=util[_0x0a9e('0x69')](_0x0a9e('0x78'),_0x4566b0);var _0x3a1974=path['join'](_0x22063c,_0x589ff3);var _0x96672f=![];return db['FaxInteraction'][_0x0a9e('0x5c')]({'where':{'id':_0x2aabab[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x18ad56,null))[_0x0a9e('0x24')](function(_0x842d6f){if(_0x842d6f){return _0x842d6f[_0x0a9e('0x65')]({'attributes':['id',_0x0a9e('0x5e'),_0x0a9e('0x4f')],'include':[{'model':db['Attachment'],'as':_0x0a9e('0x79')}]});}return[];})[_0x0a9e('0x24')](function(_0x17f692){_0x96672f=_0x17f692[_0x0a9e('0x35')];if(_0x17f692[_0x0a9e('0x35')]){fs[_0x0a9e('0x7a')](_0x2645d6);for(var _0x6803d6=0x0;_0x6803d6<_0x17f692[_0x0a9e('0x35')];_0x6803d6++){var _0x1808ba=_0x17f692[_0x6803d6];var _0x31af8c=_0x1808ba[_0x0a9e('0x79')];if(_0x31af8c){var _0x3754e2=path[_0x0a9e('0x73')](_0x32f761,_0x31af8c['basename']);if(fs[_0x0a9e('0x7b')](_0x3754e2)){fs[_0x0a9e('0x7c')](_0x3754e2)[_0x0a9e('0x7d')](fs[_0x0a9e('0x7e')](path[_0x0a9e('0x73')](_0x2645d6,_0x31af8c['basename'])));}}}}})[_0x0a9e('0x24')](function(){if(_0x96672f){return new BPromise(function(_0x1756c7,_0x5ce99d){zipdir(_0x2645d6,{'saveTo':_0x3a1974},function(_0x23b447,_0x5e725e){if(_0x23b447)return _0x5ce99d(_0x23b447);return _0x1756c7(_0x5e725e);});});}})[_0x0a9e('0x24')](function(){if(_0x96672f){return new BPromise(function(_0x27041d,_0x1d93b1){rimraf(_0x2645d6,function(_0xf8c6c4){if(_0xf8c6c4)_0x1d93b1(_0xf8c6c4);return _0x27041d();});});}})['then'](function(){if(_0x96672f){return _0x18ad56[_0x0a9e('0x71')](_0x3a1974,_0x589ff3,function(_0x4cf72d){if(_0x4cf72d){console[_0x0a9e('0x7f')](_0x0a9e('0x80'),_0x4cf72d);}else{fs['unlinkSync'](_0x3a1974);}});}else{return _0x18ad56[_0x0a9e('0x18')](0xc8);}})[_0x0a9e('0x5a')](handleError(_0x18ad56,null));};
\ No newline at end of file
+var _0xa9e0=['params','describe','addMessage','ids','omit','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','faxInteractionTags:save','removeTags','download','toString','join','server','files','attachments','root','interaction-%s.zip','Attachment','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','log','err','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','FaxInteraction','rawAttributes','keys','query','dateStart','dateEnd','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','map','key','VIRTUAL','field','filter','options','include','tag','push','Tag','Tags','distinct','read','FaxMessage','Messages','direction','createdAt','includeAll','User','Users','fullname','CmContact','internal','Account','color','ThroughTags','findAll','catch','show','find','create','body','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var qs=require(_0x0a9e('0xf'));var logger=require(_0x0a9e('0x10'))(_0x0a9e('0x11'));var utils=require(_0x0a9e('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x0a9e('0x13')],{'host':_0x0a9e('0x14'),'port':0x18eb});var socket=require(_0x0a9e('0x15'))(new Redis(config[_0x0a9e('0x13')]));require(_0x0a9e('0x16'))[_0x0a9e('0x17')](socket);function respondWithStatusCode(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xcc;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x18')](_0x4283ce);}return _0x5db4b0[_0x0a9e('0x19')](_0x4283ce)[_0x0a9e('0x1a')]();};}function respondWithResult(_0x4d5611,_0x52a03d){_0x52a03d=_0x52a03d||0xc8;return function(_0x22dccb){if(_0x22dccb){return _0x4d5611['status'](_0x52a03d)[_0x0a9e('0x1b')](_0x22dccb);}};}function respondWithFilteredResult(_0x519dfd,_0x16033c){return function(_0x12066b){if(_0x12066b){var _0x48f32d=_0x12066b[_0x0a9e('0x1c')],_0x225616=_0x16033c[_0x0a9e('0x1d')],_0x5a0a06=_0x16033c[_0x0a9e('0x1d')]+_0x16033c[_0x0a9e('0x1e')],_0x459eb1;if(_0x5a0a06>=_0x48f32d){_0x5a0a06=_0x48f32d;_0x459eb1=0xc8;}else{_0x459eb1=0xce;}_0x519dfd[_0x0a9e('0x19')](_0x459eb1);return _0x519dfd[_0x0a9e('0x1f')](_0x0a9e('0x20'),_0x225616+'-'+_0x5a0a06+'/'+_0x48f32d)[_0x0a9e('0x1b')](_0x12066b);}return null;};}function patchUpdates(_0x112016){return function(_0x1c696a){try{jsonpatch[_0x0a9e('0x21')](_0x1c696a,_0x112016,!![]);}catch(_0x4bb1e3){return BPromise[_0x0a9e('0x22')](_0x4bb1e3);}return _0x1c696a[_0x0a9e('0x23')]();};}function saveUpdates(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['update'](_0x53682f)[_0x0a9e('0x24')](function(_0x432e56){return _0x432e56;});}return null;};}function removeEntity(_0x38e7c4,_0x30bae6){return function(_0x4abc77){if(_0x4abc77){return _0x4abc77[_0x0a9e('0x25')]()[_0x0a9e('0x24')](function(){_0x38e7c4[_0x0a9e('0x19')](0xcc)[_0x0a9e('0x1a')]();});}};}function handleEntityNotFound(_0x370d86,_0x42ac8f){return function(_0x16b1ca){if(!_0x16b1ca){_0x370d86['sendStatus'](0x194);}return _0x16b1ca;};}function handleError(_0x59181e,_0x197ec0){_0x197ec0=_0x197ec0||0x1f4;return function(_0x3a8e58){logger[_0x0a9e('0x26')](_0x3a8e58[_0x0a9e('0x27')]);if(_0x3a8e58['name']){delete _0x3a8e58[_0x0a9e('0x28')];}_0x59181e['status'](_0x197ec0)[_0x0a9e('0x29')](_0x3a8e58);};}exports['index']=function(_0x1dc186,_0x34dc65){var _0x25fba9={},_0x14433c={},_0x140511={'count':0x0,'rows':[]};var _0x1538a4=db[_0x0a9e('0x2a')][_0x0a9e('0x2b')];_0x14433c['model']=_[_0x0a9e('0x2c')](_0x1538a4);var _0x468813={'dateStart':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x2e')],'dateEnd':_0x1dc186['query'][_0x0a9e('0x2f')]};delete _0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x2e')];delete _0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x2f')];_0x14433c[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1dc186[_0x0a9e('0x2d')]);_0x14433c[_0x0a9e('0x30')]=_['intersection'](_0x14433c[_0x0a9e('0x31')],_0x14433c['query']);_0x25fba9[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x14433c[_0x0a9e('0x31')],qs[_0x0a9e('0x34')](_0x1dc186[_0x0a9e('0x2d')]['fields']));_0x25fba9[_0x0a9e('0x32')]=_0x25fba9[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x25fba9[_0x0a9e('0x32')]:_0x14433c[_0x0a9e('0x31')];if(!_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x25fba9['limit']=qs[_0x0a9e('0x1e')](_0x1dc186['query'][_0x0a9e('0x1e')]);_0x25fba9[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1dc186[_0x0a9e('0x2d')]['offset']);}_0x25fba9[_0x0a9e('0x38')]=qs[_0x0a9e('0x39')](_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x39')]);_0x25fba9['where']=qs['filters'](_[_0x0a9e('0x3a')](_0x1dc186['query'],_0x14433c[_0x0a9e('0x30')]));if(_0x468813[_0x0a9e('0x2e')]){if(_0x468813[_0x0a9e('0x2f')]){_0x468813[_0x0a9e('0x2f')]=moment(_0x468813['dateEnd'])[_0x0a9e('0x3b')](0x1,_0x0a9e('0x3c'));}else{_0x468813[_0x0a9e('0x2f')]=moment(_0x468813['dateStart'])[_0x0a9e('0x3b')](0x1,_0x0a9e('0x3c'));}_[_0x0a9e('0x3d')](_0x25fba9['where'],{'createdAt':{'$gte':_0x468813['dateStart'],'$lte':_0x468813[_0x0a9e('0x2f')]}});}if(_0x1dc186[_0x0a9e('0x2d')]['filter']){_0x25fba9[_0x0a9e('0x3e')]=_[_0x0a9e('0x3d')](_0x25fba9[_0x0a9e('0x3e')],{'$or':_[_0x0a9e('0x3f')](_0x1538a4,function(_0x4b38d9){if(_0x4b38d9['type'][_0x0a9e('0x40')]!==_0x0a9e('0x41')){var _0x53f3ee={};_0x53f3ee[_0x4b38d9[_0x0a9e('0x42')]]={'$like':'%'+_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x43')]+'%'};return _0x53f3ee;}})});}_0x25fba9=_['merge']({},_0x25fba9,_0x1dc186[_0x0a9e('0x44')]);var _0x2cfea9={'where':_0x25fba9[_0x0a9e('0x3e')]};_0x2cfea9[_0x0a9e('0x45')]=[];if(_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]){_0x2cfea9[_0x0a9e('0x45')][_0x0a9e('0x47')]({'model':db[_0x0a9e('0x48')],'as':_0x0a9e('0x49'),'attributes':['id'],'where':{'id':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]},'required':!![]});_0x2cfea9[_0x0a9e('0x4a')]=!![];}if(_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]){_0x2cfea9['include']['push']({'model':db[_0x0a9e('0x4c')],'as':_0x0a9e('0x4d'),'attributes':['id',_0x0a9e('0x4e'),_0x0a9e('0x4f'),_0x0a9e('0x4b')],'where':{'direction':'in','read':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]||![]},'required':!![]});_0x2cfea9[_0x0a9e('0x4a')]=!![];}return db[_0x0a9e('0x2a')][_0x0a9e('0x1c')](_0x2cfea9)[_0x0a9e('0x24')](function(_0x35ed4a){_0x140511['count']=_0x35ed4a;if(_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x50')]){_0x25fba9[_0x0a9e('0x45')]=[{'model':db[_0x0a9e('0x51')],'as':_0x0a9e('0x52'),'required':![],'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x53')]},{'model':db[_0x0a9e('0x54')],'as':'Contact','required':![]},{'model':db[_0x0a9e('0x51')],'as':'Owner','attributes':[_0x0a9e('0x28'),_0x0a9e('0x53'),_0x0a9e('0x55')],'required':![]},{'model':db['FaxAccount'],'as':_0x0a9e('0x56'),'attributes':[_0x0a9e('0x28'),_0x0a9e('0x40')],'required':![]},{'model':db[_0x0a9e('0x4c')],'as':_0x0a9e('0x4d'),'attributes':['id',_0x0a9e('0x4e'),_0x0a9e('0x4f'),'read'],'where':{'direction':'in','read':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]||![]},'required':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x4b')]||![]},{'model':db[_0x0a9e('0x48')],'as':_0x0a9e('0x49'),'attributes':['id',_0x0a9e('0x28'),_0x0a9e('0x57')],'required':_0x1dc186[_0x0a9e('0x2d')]['tag']?!![]:![]},{'model':db[_0x0a9e('0x48')],'as':_0x0a9e('0x58'),'attributes':['id','name','color'],'through':_0x1dc186['query'][_0x0a9e('0x46')]?{'attributes':[],'where':{'TagId':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]||undefined}}:{},'required':_0x1dc186[_0x0a9e('0x2d')][_0x0a9e('0x46')]?!![]:![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x59')](_0x25fba9);})[_0x0a9e('0x24')](function(_0x5d38ae){_0x140511['rows']=_0x5d38ae;return _0x140511;})['then'](respondWithFilteredResult(_0x34dc65,_0x25fba9))[_0x0a9e('0x5a')](handleError(_0x34dc65,null));};exports[_0x0a9e('0x5b')]=function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'raw':![],'where':{'id':_0x14d602['params']['id']}},_0x161aa7={};_0x161aa7['model']=_[_0x0a9e('0x2c')](db['FaxInteraction'][_0x0a9e('0x2b')]);_0x161aa7['query']=_[_0x0a9e('0x2c')](_0x14d602[_0x0a9e('0x2d')]);_0x161aa7[_0x0a9e('0x30')]=_['intersection'](_0x161aa7[_0x0a9e('0x31')],_0x161aa7[_0x0a9e('0x2d')]);_0x2b69d9['attributes']=_['intersection'](_0x161aa7[_0x0a9e('0x31')],qs[_0x0a9e('0x34')](_0x14d602['query'][_0x0a9e('0x34')]));_0x2b69d9['attributes']=_0x2b69d9[_0x0a9e('0x32')]['length']?_0x2b69d9[_0x0a9e('0x32')]:_0x161aa7['model'];if(_0x14d602['query']['includeAll']){_0x2b69d9[_0x0a9e('0x45')]=[{'all':!![]}];}_0x2b69d9=_['merge']({},_0x2b69d9,_0x14d602[_0x0a9e('0x44')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x5c')](_0x2b69d9)[_0x0a9e('0x24')](handleEntityNotFound(_0x5bb3ed,null))[_0x0a9e('0x24')](respondWithResult(_0x5bb3ed,null))[_0x0a9e('0x5a')](handleError(_0x5bb3ed,null));};exports[_0x0a9e('0x5d')]=function(_0x28d814,_0x4e67ab){return db[_0x0a9e('0x2a')][_0x0a9e('0x5d')](_0x28d814[_0x0a9e('0x5e')],{})[_0x0a9e('0x24')](respondWithResult(_0x4e67ab,0xc9))[_0x0a9e('0x5a')](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x5f')]=function(_0x5d86e9,_0x956fbe){if(_0x5d86e9[_0x0a9e('0x5e')]['id']){delete _0x5d86e9['body']['id'];}return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x5d86e9[_0x0a9e('0x60')]['id']}})['then'](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9['body'],null))[_0x0a9e('0x24')](respondWithResult(_0x956fbe,null))['catch'](handleError(_0x956fbe,null));};exports[_0x0a9e('0x25')]=function(_0x1fc70e,_0x261adb){return db[_0x0a9e('0x2a')][_0x0a9e('0x5c')]({'where':{'id':_0x1fc70e[_0x0a9e('0x60')]['id']}})['then'](handleEntityNotFound(_0x261adb,null))[_0x0a9e('0x24')](removeEntity(_0x261adb,null))['catch'](handleError(_0x261adb,null));};exports[_0x0a9e('0x61')]=function(_0x1f07cb,_0x51aaf7){return db['FaxInteraction'][_0x0a9e('0x61')]()[_0x0a9e('0x24')](respondWithResult(_0x51aaf7,null))[_0x0a9e('0x5a')](handleError(_0x51aaf7,null));};exports[_0x0a9e('0x62')]=function(_0x497d91,_0x1d0dc8,_0xe05a5a){return db['FaxMessage'][_0x0a9e('0x5c')]({'where':{'id':_0x497d91[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x1d0dc8,null))[_0x0a9e('0x24')](function(_0x401837){if(_0x401837){return _0x401837['addMessage'](_0x497d91[_0x0a9e('0x5e')][_0x0a9e('0x63')],_[_0x0a9e('0x64')](_0x497d91['body'],[_0x0a9e('0x63'),'id'])||{});}})['then'](respondWithResult(_0x1d0dc8,null))['catch'](handleError(_0x1d0dc8,null));};exports[_0x0a9e('0x65')]=function(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39={'raw':![],'where':{}};var _0xc8c264={};var _0x387489={'count':0x0,'rows':[]};return db[_0x0a9e('0x2a')][_0x0a9e('0x66')]({'where':{'id':_0x4556c5[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x9375fb,null))[_0x0a9e('0x24')](function(_0x2bbb86){if(_0x2bbb86){_0xc8c264[_0x0a9e('0x31')]=_[_0x0a9e('0x2c')](db[_0x0a9e('0x4c')][_0x0a9e('0x2b')]);_0xc8c264[_0x0a9e('0x2d')]=_['keys'](_0x4556c5[_0x0a9e('0x2d')]);_0xc8c264[_0x0a9e('0x30')]=_[_0x0a9e('0x33')](_0xc8c264['model'],_0xc8c264[_0x0a9e('0x2d')]);_0x186f39[_0x0a9e('0x32')]=_['intersection'](_0xc8c264[_0x0a9e('0x31')],qs[_0x0a9e('0x34')](_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x34')]));_0x186f39[_0x0a9e('0x32')]=_0x186f39['attributes']['length']?_0x186f39['attributes']:_0xc8c264[_0x0a9e('0x31')];if(!_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x186f39[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x1e')]);_0x186f39['offset']=qs[_0x0a9e('0x1d')](_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x1d')]);}_0x186f39['order']=qs[_0x0a9e('0x39')](_0x4556c5['query'][_0x0a9e('0x39')]);_0x186f39[_0x0a9e('0x3e')]=qs['filters'](_[_0x0a9e('0x3a')](_0x4556c5[_0x0a9e('0x2d')],_0xc8c264[_0x0a9e('0x30')]));_0x186f39[_0x0a9e('0x3e')]['FaxInteractionId']=_0x2bbb86['id'];if(_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x43')]){_0x186f39[_0x0a9e('0x3e')]=_[_0x0a9e('0x3d')](_0x186f39['where'],{'$or':_[_0x0a9e('0x3f')](_0x186f39[_0x0a9e('0x32')],function(_0x2d5506){var _0x361b21={};_0x361b21[_0x2d5506]={'$like':'%'+_0x4556c5['query'][_0x0a9e('0x43')]+'%'};return _0x361b21;})});}if(_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x67')]){var _0xf410e5=_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x67')][_0x0a9e('0x68')](',');var _0x3df0e3={};_0x3df0e3[_0xf410e5[0x0]]={'$gte':moment(_0xf410e5[0x1])[_0x0a9e('0x69')](_0x0a9e('0x6a'))};_0x186f39[_0x0a9e('0x3e')]=_[_0x0a9e('0x3d')](_0x186f39[_0x0a9e('0x3e')],_0x3df0e3);}_0x186f39=_[_0x0a9e('0x3d')]({},_0x186f39,_0x4556c5['options']);return db[_0x0a9e('0x4c')][_0x0a9e('0x1c')]({'where':_0x186f39[_0x0a9e('0x3e')]})['then'](function(_0x3736e0){_0x387489[_0x0a9e('0x1c')]=_0x3736e0;if(_0x4556c5[_0x0a9e('0x2d')][_0x0a9e('0x50')]){_0x186f39['include']=[{'all':!![]}];}return db['FaxMessage'][_0x0a9e('0x59')](_0x186f39);})[_0x0a9e('0x24')](function(_0x4c54fa){_0x387489[_0x0a9e('0x6b')]=_0x4c54fa;return _0x387489;});}})['then'](respondWithFilteredResult(_0x9375fb,_0x186f39))[_0x0a9e('0x5a')](handleError(_0x9375fb,null));};exports[_0x0a9e('0x6c')]=function(_0x5637a1,_0x28a942,_0x41cf12){return db[_0x0a9e('0x2a')][_0x0a9e('0x5c')]({'where':{'id':_0x5637a1[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x28a942,null))[_0x0a9e('0x24')](function(_0x482ca2){if(_0x482ca2){return _0x482ca2[_0x0a9e('0x6d')](_0x5637a1[_0x0a9e('0x5e')][_0x0a9e('0x63')],_[_0x0a9e('0x64')](_0x5637a1['body'],[_0x0a9e('0x63'),'id'])||{})[_0x0a9e('0x6e')](function(){return db['Tag'][_0x0a9e('0x59')]({'attributes':['id','name',_0x0a9e('0x57')],'where':{'id':_0x5637a1[_0x0a9e('0x5e')][_0x0a9e('0x63')]}});})[_0x0a9e('0x24')](function(_0x5af453){socket['emit'](_0x0a9e('0x6f'),{'id':Number(_0x5637a1[_0x0a9e('0x60')]['id']),'tags':_0x5af453||[]});return{'id':Number(_0x5637a1[_0x0a9e('0x60')]['id']),'tags':_0x5af453||[]};});}})['then'](respondWithResult(_0x28a942,null))[_0x0a9e('0x5a')](handleError(_0x28a942,null));};exports[_0x0a9e('0x70')]=function(_0x524e38,_0x4e46b2,_0xf0a802){var _0x56acca;return db['FaxInteraction']['find']({'where':{'id':_0x524e38[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x4e46b2,null))[_0x0a9e('0x24')](function(_0x3bfadf){if(_0x3bfadf){return _0x3bfadf[_0x0a9e('0x70')](_0x524e38[_0x0a9e('0x2d')]['ids']);}})[_0x0a9e('0x24')](respondWithStatusCode(_0x4e46b2,null))['catch'](handleError(_0x4e46b2,null));};exports[_0x0a9e('0x71')]=function(_0x2aabab,_0x18ad56){var _0x4566b0=moment()['unix']()[_0x0a9e('0x72')]();var _0x32f761=path[_0x0a9e('0x73')](config['root'],_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'));var _0x22063c=path[_0x0a9e('0x73')](config[_0x0a9e('0x77')],_0x0a9e('0x74'),_0x0a9e('0x75'),'tmp');var _0x2645d6=path[_0x0a9e('0x73')](_0x22063c,_0x4566b0);var _0x589ff3=util[_0x0a9e('0x69')](_0x0a9e('0x78'),_0x4566b0);var _0x3a1974=path['join'](_0x22063c,_0x589ff3);var _0x96672f=![];return db['FaxInteraction'][_0x0a9e('0x5c')]({'where':{'id':_0x2aabab[_0x0a9e('0x60')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x18ad56,null))[_0x0a9e('0x24')](function(_0x842d6f){if(_0x842d6f){return _0x842d6f[_0x0a9e('0x65')]({'attributes':['id',_0x0a9e('0x5e'),_0x0a9e('0x4f')],'include':[{'model':db['Attachment'],'as':_0x0a9e('0x79')}]});}return[];})[_0x0a9e('0x24')](function(_0x17f692){_0x96672f=_0x17f692[_0x0a9e('0x35')];if(_0x17f692[_0x0a9e('0x35')]){fs[_0x0a9e('0x7a')](_0x2645d6);for(var _0x6803d6=0x0;_0x6803d6<_0x17f692[_0x0a9e('0x35')];_0x6803d6++){var _0x1808ba=_0x17f692[_0x6803d6];var _0x31af8c=_0x1808ba[_0x0a9e('0x79')];if(_0x31af8c){var _0x3754e2=path[_0x0a9e('0x73')](_0x32f761,_0x31af8c['basename']);if(fs[_0x0a9e('0x7b')](_0x3754e2)){fs[_0x0a9e('0x7c')](_0x3754e2)[_0x0a9e('0x7d')](fs[_0x0a9e('0x7e')](path[_0x0a9e('0x73')](_0x2645d6,_0x31af8c['basename'])));}}}}})[_0x0a9e('0x24')](function(){if(_0x96672f){return new BPromise(function(_0x1756c7,_0x5ce99d){zipdir(_0x2645d6,{'saveTo':_0x3a1974},function(_0x23b447,_0x5e725e){if(_0x23b447)return _0x5ce99d(_0x23b447);return _0x1756c7(_0x5e725e);});});}})[_0x0a9e('0x24')](function(){if(_0x96672f){return new BPromise(function(_0x27041d,_0x1d93b1){rimraf(_0x2645d6,function(_0xf8c6c4){if(_0xf8c6c4)_0x1d93b1(_0xf8c6c4);return _0x27041d();});});}})['then'](function(){if(_0x96672f){return _0x18ad56[_0x0a9e('0x71')](_0x3a1974,_0x589ff3,function(_0x4cf72d){if(_0x4cf72d){console[_0x0a9e('0x7f')](_0x0a9e('0x80'),_0x4cf72d);}else{fs['unlinkSync'](_0x3a1974);}});}else{return _0x18ad56[_0x0a9e('0x18')](0xc8);}})[_0x0a9e('0x5a')](handleError(_0x18ad56,null));};
\ No newline at end of file
index 07f4340..d2247f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','update','remove'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x4fc2,0x111));var _0x24fc=function(_0x275dfa,_0x3312f9){_0x275dfa=_0x275dfa-0x0;var _0x4a008c=_0x4fc2[_0x275dfa];return _0x4a008c;};'use strict';var EventEmitter=require(_0x24fc('0x0'));var FaxInteraction=require(_0x24fc('0x1'))['db'][_0x24fc('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x24fc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x24fc('0x4'),'afterDestroy':_0x24fc('0x5')};function emitEvent(_0x1e7fdf){return function(_0x541ad2,_0x126d90,_0x3772eb){FaxInteractionEvents['emit'](_0x1e7fdf+':'+_0x541ad2['id'],_0x541ad2);FaxInteractionEvents[_0x24fc('0x6')](_0x1e7fdf,_0x541ad2);_0x3772eb(null);};}for(var e in events){if(events[_0x24fc('0x7')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x24fc('0x8')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x0833=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','FaxInteraction'];(function(_0x25681b,_0x204cce){var _0x1cf91a=function(_0x52e97f){while(--_0x52e97f){_0x25681b['push'](_0x25681b['shift']());}};_0x1cf91a(++_0x204cce);}(_0x0833,0x1bd));var _0x3083=function(_0x46428f,_0x3e86af){_0x46428f=_0x46428f-0x0;var _0x1acecb=_0x0833[_0x46428f];return _0x1acecb;};'use strict';var EventEmitter=require(_0x3083('0x0'));var FaxInteraction=require(_0x3083('0x1'))['db'][_0x3083('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x3083('0x3')](0x0);var events={'afterCreate':_0x3083('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4eec30){return function(_0x22717c,_0x58a865,_0xa26470){FaxInteractionEvents[_0x3083('0x5')](_0x4eec30+':'+_0x22717c['id'],_0x22717c);FaxInteractionEvents[_0x3083('0x5')](_0x4eec30,_0x22717c);_0xa26470(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x3083('0x6')](e,emitEvent(event));}}module[_0x3083('0x7')]=FaxInteractionEvents;
\ No newline at end of file
index 9826bf2..4a32697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02d8=['api','request-promise','./faxInteraction.attributes','define','fax_interactions','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02d8,0x139));var _0x802d=function(_0x42aa0f,_0x1fbd4e){_0x42aa0f=_0x42aa0f-0x0;var _0x147477=_0x02d8[_0x42aa0f];return _0x147477;};'use strict';var _=require(_0x802d('0x0'));var util=require(_0x802d('0x1'));var logger=require('../../config/logger')(_0x802d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x802d('0x3'));var attributes=require(_0x802d('0x4'));module['exports']=function(_0x692ba1,_0x15ab8f){return _0x692ba1[_0x802d('0x5')]('FaxInteraction',attributes,{'tableName':_0x802d('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd611=['api','bluebird','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions'];(function(_0x51215f,_0x51317a){var _0x1365d1=function(_0x3e2661){while(--_0x3e2661){_0x51215f['push'](_0x51215f['shift']());}};_0x1365d1(++_0x51317a);}(_0xd611,0x142));var _0x1d61=function(_0x5026d2,_0x170f45){_0x5026d2=_0x5026d2-0x0;var _0xb03eb8=_0xd611[_0x5026d2];return _0xb03eb8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1d61('0x0'));var moment=require('moment');var BPromise=require(_0x1d61('0x1'));var rp=require('request-promise');var attributes=require(_0x1d61('0x2'));module[_0x1d61('0x3')]=function(_0x2bbf9e,_0x546698){return _0x2bbf9e[_0x1d61('0x4')](_0x1d61('0x5'),attributes,{'tableName':_0x1d61('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a0eff91..dbfa354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc61d=['stringify','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','AddTagsToFaxInteraction','find','addTags','omit','spread','AddTags'];(function(_0x144099,_0x2c10ef){var _0x4a8276=function(_0x11e8a3){while(--_0x11e8a3){_0x144099['push'](_0x144099['shift']());}};_0x4a8276(++_0x2c10ef);}(_0xc61d,0x1e1));var _0xdc61=function(_0x740555,_0x5a6b26){_0x740555=_0x740555-0x0;var _0x46c722=_0xc61d[_0x740555];return _0x46c722;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var moment=require(_0xdc61('0x2'));var BPromise=require(_0xdc61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc61('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdc61('0x5'));var config=require(_0xdc61('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdc61('0x7')][_0xdc61('0x8')]({'port':0x232a});config[_0xdc61('0x9')]=_[_0xdc61('0xa')](config[_0xdc61('0x9')],{'host':_0xdc61('0xb'),'port':0x18eb});var socket=require(_0xdc61('0xc'))(new Redis(config[_0xdc61('0x9')]));require(_0xdc61('0xd'))['register'](socket);function respondWithRpcPromise(_0x3473d0,_0x10220b,_0x4604f6){return new BPromise(function(_0x5d9707,_0x42767b){return client[_0xdc61('0xe')](_0x3473d0,_0x4604f6)[_0xdc61('0xf')](function(_0x45219e){logger[_0xdc61('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x10220b,_0xdc61('0x11'));logger[_0xdc61('0x12')](_0xdc61('0x13'),_0x10220b,_0xdc61('0x11'),JSON['stringify'](_0x45219e));if(_0x45219e[_0xdc61('0x14')]){if(_0x45219e[_0xdc61('0x14')][_0xdc61('0x15')]===0x1f4){logger[_0xdc61('0x14')](_0xdc61('0x16'),_0x10220b,_0x45219e[_0xdc61('0x14')][_0xdc61('0x17')]);return _0x42767b(_0x45219e['error'][_0xdc61('0x17')]);}logger[_0xdc61('0x14')](_0xdc61('0x16'),_0x10220b,_0x45219e[_0xdc61('0x14')][_0xdc61('0x17')]);return _0x5d9707(_0x45219e[_0xdc61('0x14')][_0xdc61('0x17')]);}else{logger[_0xdc61('0x10')](_0xdc61('0x16'),_0x10220b,'request\x20sent');_0x5d9707(_0x45219e['result'][_0xdc61('0x17')]);}})[_0xdc61('0x18')](function(_0xbcf21b){logger[_0xdc61('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x10220b,_0xbcf21b);_0x42767b(_0xbcf21b);});});}exports[_0xdc61('0x19')]=function(_0x4a539e){var _0x33d5a1=this;return new Promise(function(_0x1f3c3c,_0x514ae3){return db[_0xdc61('0x1a')][_0xdc61('0x1b')](_0x4a539e[_0xdc61('0x1c')],{'raw':_0x4a539e[_0xdc61('0x1d')]?_0x4a539e[_0xdc61('0x1d')][_0xdc61('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a539e[_0xdc61('0x1d')]?_0x4a539e[_0xdc61('0x1d')]['where']||null:null,'attributes':_0x4a539e['options']?_0x4a539e['options'][_0xdc61('0x1f')]||null:null,'limit':_0x4a539e[_0xdc61('0x1d')]?_0x4a539e['options'][_0xdc61('0x20')]||null:null})[_0xdc61('0xf')](function(_0x53e146){logger[_0xdc61('0x10')](_0xdc61('0x19'),_0x4a539e);logger[_0xdc61('0x12')](_0xdc61('0x19'),_0x4a539e,JSON['stringify'](_0x53e146));_0x1f3c3c(_0x53e146);})[_0xdc61('0x18')](function(_0xa71961){logger[_0xdc61('0x14')](_0xdc61('0x19'),_0xa71961[_0xdc61('0x17')],_0x4a539e);_0x514ae3(_0x33d5a1[_0xdc61('0x14')](0x1f4,_0xa71961[_0xdc61('0x17')]));});});};exports[_0xdc61('0x21')]=function(_0x5b2939){return new Promise(function(_0x5c2220,_0x321b43){return db[_0xdc61('0x1a')][_0xdc61('0x22')]({'where':_0x5b2939[_0xdc61('0x1d')]?_0x5b2939[_0xdc61('0x1d')]['where']||null:null})[_0xdc61('0xf')](function(_0x28b6cc){if(_0x28b6cc){return _0x28b6cc[_0xdc61('0x23')](_0x5b2939[_0xdc61('0x1c')]['ids'],_[_0xdc61('0x24')](_0x5b2939[_0xdc61('0x1c')],['ids','id'])||{});}})[_0xdc61('0x25')](function(_0x5cd572){logger[_0xdc61('0x10')](_0xdc61('0x26'),_0x5b2939);logger[_0xdc61('0x12')](_0xdc61('0x26'),_0x5b2939,JSON[_0xdc61('0x27')](_0x5cd572));_0x5c2220(_0x5cd572);})[_0xdc61('0x18')](function(_0x4994dd){logger[_0xdc61('0x14')](_0xdc61('0x26'),_0x4994dd[_0xdc61('0x17')],_0x5b2939);_0x321b43(_this[_0xdc61('0x14')](0x1f4,_0x4994dd[_0xdc61('0x17')]));});});};
\ No newline at end of file
+var _0x14e2=['catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','AddTagsToFaxInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxInteraction,\x20%s,\x20%s','result'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x14e2,0x119));var _0x214e=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x14e2[_0x1344d6];return _0xf45b24;};'use strict';var _=require(_0x214e('0x0'));var util=require(_0x214e('0x1'));var moment=require('moment');var BPromise=require(_0x214e('0x2'));var rs=require(_0x214e('0x3'));var fs=require('fs');var Redis=require(_0x214e('0x4'));var db=require(_0x214e('0x5'))['db'];var utils=require(_0x214e('0x6'));var logger=require(_0x214e('0x7'))(_0x214e('0x8'));var config=require('../../config/environment');var jayson=require(_0x214e('0x9'));var client=jayson['client'][_0x214e('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x214e('0xb'),'port':0x18eb});var socket=require(_0x214e('0xc'))(new Redis(config[_0x214e('0xd')]));require(_0x214e('0xe'))[_0x214e('0xf')](socket);function respondWithRpcPromise(_0x1193b3,_0x455f6e,_0xca9e40){return new BPromise(function(_0x12d8f7,_0x3a4d32){return client[_0x214e('0x10')](_0x1193b3,_0xca9e40)[_0x214e('0x11')](function(_0x59440a){logger[_0x214e('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x455f6e,_0x214e('0x13'));logger[_0x214e('0x14')](_0x214e('0x15'),_0x455f6e,'request\x20sent',JSON[_0x214e('0x16')](_0x59440a));if(_0x59440a[_0x214e('0x17')]){if(_0x59440a[_0x214e('0x17')]['code']===0x1f4){logger[_0x214e('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x455f6e,_0x59440a[_0x214e('0x17')][_0x214e('0x18')]);return _0x3a4d32(_0x59440a[_0x214e('0x17')]['message']);}logger[_0x214e('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x455f6e,_0x59440a['error'][_0x214e('0x18')]);return _0x12d8f7(_0x59440a[_0x214e('0x17')]['message']);}else{logger[_0x214e('0x12')](_0x214e('0x19'),_0x455f6e,'request\x20sent');_0x12d8f7(_0x59440a[_0x214e('0x1a')][_0x214e('0x18')]);}})[_0x214e('0x1b')](function(_0x3b8c31){logger[_0x214e('0x17')](_0x214e('0x19'),_0x455f6e,_0x3b8c31);_0x3a4d32(_0x3b8c31);});});}exports[_0x214e('0x1c')]=function(_0x26e090){var _0x91151=this;return new Promise(function(_0x2b304f,_0x385df9){return db[_0x214e('0x1d')][_0x214e('0x1e')](_0x26e090[_0x214e('0x1f')],{'raw':_0x26e090[_0x214e('0x20')]?_0x26e090['options'][_0x214e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26e090[_0x214e('0x20')]?_0x26e090[_0x214e('0x20')]['where']||null:null,'attributes':_0x26e090[_0x214e('0x20')]?_0x26e090[_0x214e('0x20')][_0x214e('0x22')]||null:null,'limit':_0x26e090[_0x214e('0x20')]?_0x26e090[_0x214e('0x20')][_0x214e('0x23')]||null:null})[_0x214e('0x11')](function(_0xb4e309){logger[_0x214e('0x12')](_0x214e('0x1c'),_0x26e090);logger[_0x214e('0x14')]('UpdateFaxInteraction',_0x26e090,JSON['stringify'](_0xb4e309));_0x2b304f(_0xb4e309);})[_0x214e('0x1b')](function(_0x474eaa){logger[_0x214e('0x17')](_0x214e('0x1c'),_0x474eaa[_0x214e('0x18')],_0x26e090);_0x385df9(_0x91151[_0x214e('0x17')](0x1f4,_0x474eaa[_0x214e('0x18')]));});});};exports[_0x214e('0x24')]=function(_0x2a6242){return new Promise(function(_0x5a50ea,_0x167da3){return db['FaxInteraction'][_0x214e('0x25')]({'where':_0x2a6242[_0x214e('0x20')]?_0x2a6242[_0x214e('0x20')][_0x214e('0x26')]||null:null})['then'](function(_0x226559){if(_0x226559){return _0x226559[_0x214e('0x27')](_0x2a6242[_0x214e('0x1f')][_0x214e('0x28')],_[_0x214e('0x29')](_0x2a6242[_0x214e('0x1f')],['ids','id'])||{});}})[_0x214e('0x2a')](function(_0x178cbf){logger[_0x214e('0x12')](_0x214e('0x2b'),_0x2a6242);logger[_0x214e('0x14')](_0x214e('0x2b'),_0x2a6242,JSON['stringify'](_0x178cbf));_0x5a50ea(_0x178cbf);})[_0x214e('0x1b')](function(_0x614102){logger[_0x214e('0x17')](_0x214e('0x2b'),_0x614102[_0x214e('0x18')],_0x2a6242);_0x167da3(_this[_0x214e('0x17')](0x1f4,_0x614102[_0x214e('0x18')]));});});};
\ No newline at end of file
index c07f3fe..d86d793 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9189=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x9189,0x1c9));var _0x9918=function(_0x2882d0,_0x5a7129){_0x2882d0=_0x2882d0-0x0;var _0x3519a5=_0x9189[_0x2882d0];return _0x3519a5;};'use strict';var FaxInteractionEvents=require(_0x9918('0x0'));var events=[_0x9918('0x1'),_0x9918('0x2'),_0x9918('0x3')];function createListener(_0x6b5280,_0x4c4fcf){return function(_0x25c0dc){_0x4c4fcf[_0x9918('0x4')](_0x6b5280,_0x25c0dc);};}function removeListener(_0x32d34d,_0x2cd693){return function(){FaxInteractionEvents[_0x9918('0x5')](_0x32d34d,_0x2cd693);};}exports[_0x9918('0x6')]=function(_0x443a20){for(var _0x5ccff5=0x0,_0x3357e7=events[_0x9918('0x7')];_0x5ccff5<_0x3357e7;_0x5ccff5++){var _0x433588=events[_0x5ccff5];var _0x3e68d4=createListener(_0x9918('0x8')+_0x433588,_0x443a20);FaxInteractionEvents['on'](_0x433588,_0x3e68d4);}};
\ No newline at end of file
+var _0xfc0c=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x247c6e,_0xbcd599){var _0x418e33=function(_0x1d24aa){while(--_0x1d24aa){_0x247c6e['push'](_0x247c6e['shift']());}};_0x418e33(++_0xbcd599);}(_0xfc0c,0x9b));var _0xcfc0=function(_0x24a074,_0x24f9e2){_0x24a074=_0x24a074-0x0;var _0x3f1fc3=_0xfc0c[_0x24a074];return _0x3f1fc3;};'use strict';var FaxInteractionEvents=require(_0xcfc0('0x0'));var events=[_0xcfc0('0x1'),_0xcfc0('0x2'),_0xcfc0('0x3')];function createListener(_0x270040,_0x6047d4){return function(_0x372cbd){_0x6047d4[_0xcfc0('0x4')](_0x270040,_0x372cbd);};}function removeListener(_0x374c19,_0x2f64f1){return function(){FaxInteractionEvents[_0xcfc0('0x5')](_0x374c19,_0x2f64f1);};}exports[_0xcfc0('0x6')]=function(_0x527747){for(var _0x45794f=0x0,_0x482cdd=events[_0xcfc0('0x7')];_0x45794f<_0x482cdd;_0x45794f++){var _0x5631ac=events[_0x45794f];var _0x1a66d2=createListener(_0xcfc0('0x8')+_0x5631ac,_0x527747);FaxInteractionEvents['on'](_0x5631ac,_0x1a66d2);}};
\ No newline at end of file
index a746356..5e5a45d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc3e=['put','faxinteraction:update','update','delete','destroy','exports','multer','util','express','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags'];(function(_0x3d2d29,_0x3c56cc){var _0x5a9db4=function(_0x365de0){while(--_0x365de0){_0x3d2d29['push'](_0x3d2d29['shift']());}};_0x5a9db4(++_0x3c56cc);}(_0xfc3e,0xee));var _0xefc3=function(_0x291042,_0x459bb6){_0x291042=_0x291042-0x0;var _0x5b6cd8=_0xfc3e[_0x291042];return _0x5b6cd8;};'use strict';var multer=require(_0xefc3('0x0'));var util=require(_0xefc3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xefc3('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xefc3('0x3'));var config=require(_0xefc3('0x4'));var controller=require(_0xefc3('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xefc3('0x6')]);router['get']('/describe',auth[_0xefc3('0x7')](),controller[_0xefc3('0x8')]);router['get'](_0xefc3('0x9'),auth['isAuthenticated'](),controller[_0xefc3('0xa')]);router['get'](_0xefc3('0xb'),auth[_0xefc3('0x7')](),controller[_0xefc3('0xc')]);router['get'](_0xefc3('0xd'),auth[_0xefc3('0x7')](),controller[_0xefc3('0xe')]);router[_0xefc3('0xf')]('/',auth[_0xefc3('0x7')](),controller[_0xefc3('0x10')]);router[_0xefc3('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0xefc3('0x11')]);router['post'](_0xefc3('0x12'),auth['isAuthenticated'](),interaction[_0xefc3('0x13')](_0xefc3('0x14'),_0xefc3('0x15')),controller[_0xefc3('0x16')]);router[_0xefc3('0x17')](_0xefc3('0x9'),auth['isAuthenticated'](),interaction[_0xefc3('0x13')](_0xefc3('0x14'),_0xefc3('0x18')),controller[_0xefc3('0x19')]);router[_0xefc3('0x1a')](_0xefc3('0x9'),auth[_0xefc3('0x7')](),interaction['tracked'](_0xefc3('0x14'),'faxinteraction:destroy'),controller[_0xefc3('0x1b')]);router[_0xefc3('0x1a')](_0xefc3('0x12'),auth[_0xefc3('0x7')](),controller['removeTags']);module[_0xefc3('0x1c')]=router;
\ No newline at end of file
+var _0x0e5c=['describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x996e9d,_0x591022){var _0x573899=function(_0x4a6932){while(--_0x4a6932){_0x996e9d['push'](_0x996e9d['shift']());}};_0x573899(++_0x591022);}(_0x0e5c,0x1a9));var _0xc0e5=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0x0e5c[_0x4a9beb];return _0x2d4c58;};'use strict';var multer=require(_0xc0e5('0x0'));var util=require(_0xc0e5('0x1'));var path=require(_0xc0e5('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0e5('0x3'));var router=express[_0xc0e5('0x4')]();var auth=require(_0xc0e5('0x5'));var interaction=require(_0xc0e5('0x6'));var config=require(_0xc0e5('0x7'));var controller=require('./faxInteraction.controller');router[_0xc0e5('0x8')]('/',auth[_0xc0e5('0x9')](),controller['index']);router[_0xc0e5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc0e5('0xa')]);router[_0xc0e5('0x8')](_0xc0e5('0xb'),auth[_0xc0e5('0x9')](),controller[_0xc0e5('0xc')]);router['get'](_0xc0e5('0xd'),auth[_0xc0e5('0x9')](),controller[_0xc0e5('0xe')]);router['get']('/:id/download',auth[_0xc0e5('0x9')](),controller[_0xc0e5('0xf')]);router[_0xc0e5('0x10')]('/',auth[_0xc0e5('0x9')](),controller['create']);router[_0xc0e5('0x10')](_0xc0e5('0xd'),auth[_0xc0e5('0x9')](),controller[_0xc0e5('0x11')]);router[_0xc0e5('0x10')](_0xc0e5('0x12'),auth[_0xc0e5('0x9')](),interaction[_0xc0e5('0x13')]('fax','faxinteraction:addtags'),controller[_0xc0e5('0x14')]);router[_0xc0e5('0x15')](_0xc0e5('0xb'),auth[_0xc0e5('0x9')](),interaction[_0xc0e5('0x13')]('fax',_0xc0e5('0x16')),controller[_0xc0e5('0x17')]);router[_0xc0e5('0x18')](_0xc0e5('0xb'),auth[_0xc0e5('0x9')](),interaction['tracked']('fax',_0xc0e5('0x19')),controller[_0xc0e5('0x1a')]);router['delete']('/:id/tags',auth[_0xc0e5('0x9')](),controller[_0xc0e5('0x1b')]);module[_0xc0e5('0x1c')]=router;
\ No newline at end of file
index 8f19db2..1fbf875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9630=['out','DATE','exports','TEXT','BOOLEAN'];(function(_0x55ab4c,_0x3f7787){var _0x59cfd5=function(_0x5648b0){while(--_0x5648b0){_0x55ab4c['push'](_0x55ab4c['shift']());}};_0x59cfd5(++_0x3f7787);}(_0x9630,0xe3));var _0x0963=function(_0xf78f7b,_0x5a3256){_0xf78f7b=_0xf78f7b-0x0;var _0x31b61f=_0x9630[_0xf78f7b];return _0x31b61f;};'use strict';var Sequelize=require('sequelize');module[_0x0963('0x0')]={'body':{'type':Sequelize[_0x0963('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0963('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x0963('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x0963('0x4')]}};
\ No newline at end of file
+var _0xc9b0=['TEXT','DATE','sequelize','exports','medium','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc9b0,0x152));var _0x0c9b=function(_0x18dd06,_0x17d943){_0x18dd06=_0x18dd06-0x0;var _0x476252=_0xc9b0[_0x18dd06];return _0x476252;};'use strict';var Sequelize=require(_0x0c9b('0x0'));module[_0x0c9b('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0c9b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0c9b('0x3')]('in',_0x0c9b('0x4')),'defaultValue':_0x0c9b('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x0c9b('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x0c9b('0x6')]}};
\ No newline at end of file
index 258d027..815b8f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd965=['[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','rejectmessage','create','ContactId','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','keys','query','dateStart','dateEnd','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','day','merge','filter','map','key','VIRTUAL','field','options','FaxMessage','includeAll','include','findAll','rows','show','params','rawAttributes','find','update','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','agent'];(function(_0x3dfdc8,_0x18547d){var _0x4ed744=function(_0x5253aa){while(--_0x5253aa){_0x3dfdc8['push'](_0x3dfdc8['shift']());}};_0x4ed744(++_0x18547d);}(_0xd965,0x128));var _0x5d96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd965[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5d96('0x0'));var emlformat=require(_0x5d96('0x1'));var rimraf=require(_0x5d96('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d96('0x3'));var rp=require(_0x5d96('0x4'));var moment=require(_0x5d96('0x5'));var BPromise=require(_0x5d96('0x6'));var Mustache=require(_0x5d96('0x7'));var util=require(_0x5d96('0x8'));var path=require(_0x5d96('0x9'));var sox=require(_0x5d96('0xa'));var csv=require(_0x5d96('0xb'));var ejs=require(_0x5d96('0xc'));var fs=require('fs');var _=require(_0x5d96('0xd'));var squel=require(_0x5d96('0xe'));var crypto=require('crypto');var jsforce=require(_0x5d96('0xf'));var deskjs=require(_0x5d96('0x10'));var toCsv=require(_0x5d96('0xb'));var querystring=require(_0x5d96('0x11'));var Papa=require('papaparse');var Redis=require(_0x5d96('0x12'));var qs=require(_0x5d96('0x13'));var logger=require('../../config/logger')(_0x5d96('0x14'));var utils=require(_0x5d96('0x15'));var config=require(_0x5d96('0x16'));var db=require('../../mysqldb')['db'];config[_0x5d96('0x17')]=_[_0x5d96('0x18')](config[_0x5d96('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d96('0x19'))(new Redis(config[_0x5d96('0x17')]));require(_0x5d96('0x1a'))[_0x5d96('0x1b')](socket);var jayson=require(_0x5d96('0x1c'));var client=jayson[_0x5d96('0x1d')][_0x5d96('0x1e')]({'port':0x232c});var client9002=jayson[_0x5d96('0x1d')][_0x5d96('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x44d28b,_0x295d1c,_0x2243e6,_0x4700b5){return new BPromise(function(_0x29ad22,_0x4056f6){var _0x50706f=_0x4700b5||client;return _0x50706f[_0x5d96('0x1f')](_0x44d28b,_0x2243e6)['then'](function(_0x38045b){logger[_0x5d96('0x20')](_0x5d96('0x21'),_0x295d1c,_0x5d96('0x22'));logger[_0x5d96('0x23')](_0x5d96('0x24'),_0x295d1c,_0x5d96('0x22'),JSON[_0x5d96('0x25')](_0x38045b));if(_0x38045b[_0x5d96('0x26')]){if(_0x38045b[_0x5d96('0x26')][_0x5d96('0x27')]===0x1f4){logger[_0x5d96('0x26')]('FaxMessage,\x20%s,\x20%s',_0x295d1c,_0x38045b[_0x5d96('0x26')]['message']);return _0x4056f6(_0x38045b[_0x5d96('0x26')][_0x5d96('0x28')]);}logger[_0x5d96('0x26')](_0x5d96('0x21'),_0x295d1c,_0x38045b['error'][_0x5d96('0x28')]);return _0x29ad22(_0x38045b[_0x5d96('0x26')][_0x5d96('0x28')]);}else{logger[_0x5d96('0x20')](_0x5d96('0x21'),_0x295d1c,_0x5d96('0x22'));_0x29ad22(_0x38045b[_0x5d96('0x29')]['message']);}})[_0x5d96('0x2a')](function(_0x54b4be){logger['error'](_0x5d96('0x21'),_0x295d1c,_0x54b4be);_0x4056f6(_0x54b4be);});});}function respondWithStatusCode(_0x2d86a3,_0x537d3d){_0x537d3d=_0x537d3d||0xcc;return function(_0xcc0b1f){if(_0xcc0b1f){return _0x2d86a3[_0x5d96('0x2b')](_0x537d3d);}return _0x2d86a3[_0x5d96('0x2c')](_0x537d3d)['end']();};}function respondWithResult(_0x27b39e,_0x4fb3be){_0x4fb3be=_0x4fb3be||0xc8;return function(_0x450dbe){if(_0x450dbe){return _0x27b39e['status'](_0x4fb3be)[_0x5d96('0x2d')](_0x450dbe);}};}function respondWithFilteredResult(_0x28f715,_0x40a725){return function(_0x4a0f1e){if(_0x4a0f1e){var _0x4efe17=_0x4a0f1e[_0x5d96('0x2e')],_0x23bd84=_0x40a725[_0x5d96('0x2f')],_0x3dd161=_0x40a725['offset']+_0x40a725[_0x5d96('0x30')],_0x1cd331;if(_0x3dd161>=_0x4efe17){_0x3dd161=_0x4efe17;_0x1cd331=0xc8;}else{_0x1cd331=0xce;}_0x28f715[_0x5d96('0x2c')](_0x1cd331);return _0x28f715[_0x5d96('0x31')](_0x5d96('0x32'),_0x23bd84+'-'+_0x3dd161+'/'+_0x4efe17)[_0x5d96('0x2d')](_0x4a0f1e);}return null;};}function patchUpdates(_0x120343){return function(_0x55ed46){try{jsonpatch['apply'](_0x55ed46,_0x120343,!![]);}catch(_0x10feaf){return BPromise[_0x5d96('0x33')](_0x10feaf);}return _0x55ed46[_0x5d96('0x34')]();};}function saveUpdates(_0x42ff2e,_0x5cad43){return function(_0x184176){if(_0x184176){return _0x184176['update'](_0x42ff2e)[_0x5d96('0x35')](function(_0x2de0b5){return _0x2de0b5;});}return null;};}function removeEntity(_0x46b9df,_0x281ed7){return function(_0x854390){if(_0x854390){return _0x854390[_0x5d96('0x36')]()[_0x5d96('0x35')](function(){_0x46b9df[_0x5d96('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13fa16,_0x332780){return function(_0x39f830){if(!_0x39f830){_0x13fa16[_0x5d96('0x2b')](0x194);}return _0x39f830;};}function handleError(_0x415d7c,_0x54ce98){_0x54ce98=_0x54ce98||0x1f4;return function(_0x381dc1){logger['error'](_0x381dc1['stack']);if(_0x381dc1[_0x5d96('0x37')]){delete _0x381dc1[_0x5d96('0x37')];}_0x415d7c[_0x5d96('0x2c')](_0x54ce98)[_0x5d96('0x38')](_0x381dc1);};}exports['index']=function(_0x28755a,_0x3354ac){var _0x24ee09={},_0x4f0ad6={},_0xa55242={'count':0x0,'rows':[]};var _0x3bf1bd=db['FaxMessage']['rawAttributes'];_0x4f0ad6['model']=_[_0x5d96('0x39')](_0x3bf1bd);var _0x27cd35={'dateStart':_0x28755a[_0x5d96('0x3a')][_0x5d96('0x3b')],'dateEnd':_0x28755a[_0x5d96('0x3a')][_0x5d96('0x3c')]};delete _0x28755a[_0x5d96('0x3a')][_0x5d96('0x3b')];delete _0x28755a[_0x5d96('0x3a')][_0x5d96('0x3c')];_0x4f0ad6[_0x5d96('0x3a')]=_[_0x5d96('0x39')](_0x28755a[_0x5d96('0x3a')]);_0x4f0ad6[_0x5d96('0x3d')]=_[_0x5d96('0x3e')](_0x4f0ad6[_0x5d96('0x3f')],_0x4f0ad6[_0x5d96('0x3a')]);_0x24ee09['attributes']=_['intersection'](_0x4f0ad6[_0x5d96('0x3f')],qs[_0x5d96('0x40')](_0x28755a['query']['fields']));_0x24ee09[_0x5d96('0x41')]=_0x24ee09[_0x5d96('0x41')][_0x5d96('0x42')]?_0x24ee09[_0x5d96('0x41')]:_0x4f0ad6[_0x5d96('0x3f')];if(!_0x28755a['query'][_0x5d96('0x43')](_0x5d96('0x44'))){_0x24ee09[_0x5d96('0x30')]=qs['limit'](_0x28755a['query'][_0x5d96('0x30')]);_0x24ee09[_0x5d96('0x2f')]=qs['offset'](_0x28755a[_0x5d96('0x3a')][_0x5d96('0x2f')]);}_0x24ee09[_0x5d96('0x45')]=qs['sort'](_0x28755a[_0x5d96('0x3a')][_0x5d96('0x46')]);_0x24ee09[_0x5d96('0x47')]=qs['filters'](_[_0x5d96('0x48')](_0x28755a[_0x5d96('0x3a')],_0x4f0ad6[_0x5d96('0x3d')]));if(_0x27cd35[_0x5d96('0x3b')]){if(_0x27cd35['dateEnd']){_0x27cd35['dateEnd']=moment(_0x27cd35[_0x5d96('0x3c')])['add'](0x1,_0x5d96('0x49'));}else{_0x27cd35[_0x5d96('0x3c')]=moment(_0x27cd35[_0x5d96('0x3b')])['add'](0x1,'day');}_[_0x5d96('0x4a')](_0x24ee09[_0x5d96('0x47')],{'createdAt':{'$gte':_0x27cd35[_0x5d96('0x3b')],'$lte':_0x27cd35[_0x5d96('0x3c')]}});}if(_0x28755a[_0x5d96('0x3a')][_0x5d96('0x4b')]){_0x24ee09[_0x5d96('0x47')]=_[_0x5d96('0x4a')](_0x24ee09[_0x5d96('0x47')],{'$or':_[_0x5d96('0x4c')](_0x3bf1bd,function(_0x2c961a){if(_0x2c961a['type'][_0x5d96('0x4d')]!==_0x5d96('0x4e')){var _0x3b8a56={};_0x3b8a56[_0x2c961a[_0x5d96('0x4f')]]={'$like':'%'+_0x28755a[_0x5d96('0x3a')][_0x5d96('0x4b')]+'%'};return _0x3b8a56;}})});}_0x24ee09=_['merge']({},_0x24ee09,_0x28755a[_0x5d96('0x50')]);var _0x4d44ae={'where':_0x24ee09['where']};return db[_0x5d96('0x51')][_0x5d96('0x2e')](_0x4d44ae)[_0x5d96('0x35')](function(_0x69f70b){_0xa55242[_0x5d96('0x2e')]=_0x69f70b;if(_0x28755a[_0x5d96('0x3a')][_0x5d96('0x52')]){_0x24ee09[_0x5d96('0x53')]=[{'all':!![]}];}return db[_0x5d96('0x51')][_0x5d96('0x54')](_0x24ee09);})[_0x5d96('0x35')](function(_0x42b4af){_0xa55242[_0x5d96('0x55')]=_0x42b4af;return _0xa55242;})[_0x5d96('0x35')](respondWithFilteredResult(_0x3354ac,_0x24ee09))[_0x5d96('0x2a')](handleError(_0x3354ac,null));};exports[_0x5d96('0x56')]=function(_0x4b18b7,_0x4e3707){var _0x4906b9={'raw':!![],'where':{'id':_0x4b18b7[_0x5d96('0x57')]['id']}},_0x464568={};_0x464568[_0x5d96('0x3f')]=_[_0x5d96('0x39')](db[_0x5d96('0x51')][_0x5d96('0x58')]);_0x464568[_0x5d96('0x3a')]=_[_0x5d96('0x39')](_0x4b18b7[_0x5d96('0x3a')]);_0x464568[_0x5d96('0x3d')]=_['intersection'](_0x464568[_0x5d96('0x3f')],_0x464568[_0x5d96('0x3a')]);_0x4906b9[_0x5d96('0x41')]=_[_0x5d96('0x3e')](_0x464568[_0x5d96('0x3f')],qs[_0x5d96('0x40')](_0x4b18b7[_0x5d96('0x3a')][_0x5d96('0x40')]));_0x4906b9['attributes']=_0x4906b9[_0x5d96('0x41')][_0x5d96('0x42')]?_0x4906b9['attributes']:_0x464568[_0x5d96('0x3f')];if(_0x4b18b7['query'][_0x5d96('0x52')]){_0x4906b9[_0x5d96('0x53')]=[{'all':!![]}];}_0x4906b9=_[_0x5d96('0x4a')]({},_0x4906b9,_0x4b18b7[_0x5d96('0x50')]);return db[_0x5d96('0x51')][_0x5d96('0x59')](_0x4906b9)[_0x5d96('0x35')](handleEntityNotFound(_0x4e3707,null))[_0x5d96('0x35')](respondWithResult(_0x4e3707,null))[_0x5d96('0x2a')](handleError(_0x4e3707,null));};exports[_0x5d96('0x5a')]=function(_0xcebe60,_0xeeeb9){if(_0xcebe60['body']['id']){delete _0xcebe60['body']['id'];}return db[_0x5d96('0x51')][_0x5d96('0x59')]({'where':{'id':_0xcebe60['params']['id']}})[_0x5d96('0x35')](handleEntityNotFound(_0xeeeb9,null))['then'](saveUpdates(_0xcebe60[_0x5d96('0x5b')],null))[_0x5d96('0x35')](respondWithResult(_0xeeeb9,null))[_0x5d96('0x2a')](handleError(_0xeeeb9,null));};exports[_0x5d96('0x36')]=function(_0x4ae4f0,_0x4d4d4f){return db['FaxMessage']['find']({'where':{'id':_0x4ae4f0['params']['id']}})[_0x5d96('0x35')](handleEntityNotFound(_0x4d4d4f,null))[_0x5d96('0x35')](removeEntity(_0x4d4d4f,null))['catch'](handleError(_0x4d4d4f,null));};exports[_0x5d96('0x5c')]=function(_0x827472,_0x8e4228){return db[_0x5d96('0x51')][_0x5d96('0x5c')]()['then'](respondWithResult(_0x8e4228,null))[_0x5d96('0x2a')](handleError(_0x8e4228,null));};var interaction_log=require(_0x5d96('0x5d'))(_0x5d96('0x5e'));exports[_0x5d96('0x5f')]=function(_0x3e9358,_0x6f3338,_0x4dee73){var _0x5f5298={'channel':_0x5d96('0x60')};if(_0x3e9358[_0x5d96('0x5b')]['id']){delete _0x3e9358[_0x5d96('0x5b')]['id'];}_0x3e9358[_0x5d96('0x5b')][_0x5d96('0x61')]=!![];_0x3e9358[_0x5d96('0x5b')][_0x5d96('0x62')]=moment()[_0x5d96('0x63')](_0x5d96('0x64'));_0x3e9358[_0x5d96('0x5b')][_0x5d96('0x65')]=_0x3e9358[_0x5d96('0x5b')][_0x5d96('0x65')]||_0x3e9358[_0x5d96('0x66')]['id'];return db['FaxMessage'][_0x5d96('0x59')]({'where':{'id':_0x3e9358[_0x5d96('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x5d96('0x67')],'as':_0x5d96('0x68')}]})['then'](handleEntityNotFound(_0x6f3338,null))[_0x5d96('0x35')](saveUpdates(_0x3e9358[_0x5d96('0x5b')],null))[_0x5d96('0x35')](function(_0x18ada2){if(_0x18ada2){_0x5f5298[_0x5d96('0x28')]=_0x18ada2[_0x5d96('0x69')]({'plain':!![]});return db[_0x5d96('0x6a')]['find']({'where':{'id':_0x18ada2[_0x5d96('0x6b')]}});}return null;})[_0x5d96('0x35')](handleEntityNotFound(_0x6f3338,null))['then'](function(_0x18bc3d){if(_0x18bc3d){return _0x18bc3d[_0x5d96('0x5a')]({'UserId':_0x3e9358['body'][_0x5d96('0x65')],'read1stAt':_['isNil'](_0x18bc3d[_0x5d96('0x6c')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5d96('0x35')](function(_0x3757a4){if(_0x3757a4){_0x5f5298['interaction']=_0x3757a4[_0x5d96('0x69')]({'plain':!![]});interaction_log[_0x5d96('0x20')](_0x5d96('0x6d'),_0x3e9358[_0x5d96('0x66')]['id'],_0x3e9358[_0x5d96('0x66')][_0x5d96('0x37')],_0x3e9358[_0x5d96('0x66')][_0x5d96('0x6e')],_0x5f5298[_0x5d96('0x6f')]['id'],_0x3e9358['body']?JSON[_0x5d96('0x25')](_0x3e9358[_0x5d96('0x5b')]):_0x5d96('0x70'));return respondWithRpcPromise(_0x5d96('0x71'),_0x5d96('0x72'),_0x5f5298);}return null;})[_0x5d96('0x35')](function(_0x55ca7b){if(_0x55ca7b){if(_0x3e9358['body'][_0x5d96('0x73')]){_0x5f5298[_0x5d96('0x28')]['interface']=util[_0x5d96('0x63')](_0x5d96('0x74'),_0x3e9358[_0x5d96('0x66')][_0x5d96('0x37')]);_0x5f5298['message'][_0x5d96('0x75')]=_0x5f5298[_0x5d96('0x75')];_0x5f5298['message'][_0x5d96('0x76')]=_0x5d96('0x5f');return respondWithRpcPromise(_0x5d96('0x77'),_0x5d96('0x77'),{'event':'acceptmessage','message':_0x5f5298[_0x5d96('0x28')]},client9002)[_0x5d96('0x35')](function(){return _0x5f5298;});}return _0x5f5298;}return null;})[_0x5d96('0x35')](respondWithResult(_0x6f3338,null))[_0x5d96('0x2a')](handleError(_0x6f3338,null));};var interaction_log=require(_0x5d96('0x5d'))(_0x5d96('0x5e'));exports[_0x5d96('0x33')]=function(_0x5d279,_0x1a6ed4,_0x4560e5){var _0x36de56={'agent':{},'channel':_0x5d96('0x60')};if(_0x5d279[_0x5d96('0x5b')]['id']){delete _0x5d279['body']['id'];}_0x5d279[_0x5d96('0x5b')][_0x5d96('0x65')]=_0x5d279[_0x5d96('0x5b')][_0x5d96('0x65')]||_0x5d279[_0x5d96('0x66')]['id'];_0x36de56[_0x5d96('0x78')]['id']=_0x5d279[_0x5d96('0x5b')]['UserId'];return db[_0x5d96('0x51')]['find']({'where':{'id':_0x5d279[_0x5d96('0x57')]['id'],'UserId':null}})[_0x5d96('0x35')](handleEntityNotFound(_0x1a6ed4,null))[_0x5d96('0x35')](function(_0x5ecb70){if(_0x5ecb70){_0x36de56[_0x5d96('0x28')]=_0x5ecb70[_0x5d96('0x69')]({'plain':!![]});return db['FaxInteraction'][_0x5d96('0x59')]({'where':{'id':_0x5ecb70[_0x5d96('0x6b')]}});}return null;})[_0x5d96('0x35')](handleEntityNotFound(_0x1a6ed4,null))[_0x5d96('0x35')](function(_0x8a7988){if(_0x8a7988){_0x36de56[_0x5d96('0x6f')]=_0x8a7988['get']({'plain':!![]});interaction_log[_0x5d96('0x20')](_0x5d96('0x79'),_0x5d279[_0x5d96('0x66')]['id'],_0x5d279['user']['name'],_0x5d279[_0x5d96('0x66')]['role'],_0x36de56[_0x5d96('0x6f')]['id'],_0x5d279[_0x5d96('0x5b')]?JSON['stringify'](_0x5d279[_0x5d96('0x5b')]):_0x5d96('0x70'));return respondWithRpcPromise(_0x5d96('0x7a'),'rejectMessage',_0x36de56);}return null;})['then'](function(_0x9bbaa7){if(_0x9bbaa7){_0x9bbaa7[_0x5d96('0x28')][_0x5d96('0x7b')]=util[_0x5d96('0x63')]('SIP/%s',_0x5d279[_0x5d96('0x66')]['name']);_0x9bbaa7['message']['channel']=_0x36de56[_0x5d96('0x75')];_0x9bbaa7[_0x5d96('0x28')][_0x5d96('0x76')]=_0x5d96('0x33');respondWithRpcPromise(_0x5d96('0x77'),_0x5d96('0x77'),{'event':_0x5d96('0x7c'),'message':_0x9bbaa7[_0x5d96('0x28')]},client9002);return _0x36de56;}return null;})[_0x5d96('0x35')](respondWithResult(_0x1a6ed4,null))['catch'](handleError(_0x1a6ed4,null));};exports[_0x5d96('0x7d')]=function(_0x1e798a,_0x390244){var _0x27a639;return db[_0x5d96('0x51')][_0x5d96('0x7d')](_0x1e798a[_0x5d96('0x5b')],{})[_0x5d96('0x35')](function(_0x47472c){_0x27a639=_0x47472c;return db[_0x5d96('0x67')]['findOne']({'where':{'id':_0x27a639[_0x5d96('0x7e')]}});})[_0x5d96('0x35')](function(_0x52223d){if(_[_0x5d96('0x7f')](_0x52223d)){return;}else{_0x27a639[_0x5d96('0x60')]=_0x52223d[_0x5d96('0x60')];return db[_0x5d96('0x80')]['findOne']({'where':{'id':_0x27a639[_0x5d96('0x81')]}});}})[_0x5d96('0x35')](function(_0xb9a1b0){return respondWithRpcPromise(_0x5d96('0x82'),_0x5d96('0x82'),{'FaxAccountId':_[_0x5d96('0x7f')](_0x1e798a[_0x5d96('0x5b')])?undefined:_0x1e798a[_0x5d96('0x5b')][_0x5d96('0x83')],'path':_[_0x5d96('0x7f')](_0xb9a1b0)?undefined:util[_0x5d96('0x63')](_0x5d96('0x84'),_0xb9a1b0[_0x5d96('0x85')]),'fax':_[_0x5d96('0x7f')](_0x27a639['fax'])?undefined:_0x27a639[_0x5d96('0x60')],'AttachmentId':_0x27a639[_0x5d96('0x81')]},client9002);})['then'](respondWithResult(_0x390244,0xc9))[_0x5d96('0x2a')](handleError(_0x390244,null));};exports[_0x5d96('0x86')]=function(_0x115e2c,_0x2c0c36){var _0x37f407=path[_0x5d96('0x87')](config['root'],_0x5d96('0x88'),_0x5d96('0x89'),_0x5d96('0x8a'));return db[_0x5d96('0x51')][_0x5d96('0x59')]({'where':{'id':_0x115e2c[_0x5d96('0x57')]['id']},'include':[{'model':db[_0x5d96('0x80')],'as':_0x5d96('0x80')}]})[_0x5d96('0x35')](handleEntityNotFound(_0x2c0c36,null))[_0x5d96('0x35')](function(_0x256871){if(_0x256871){return _0x2c0c36[_0x5d96('0x86')](path['join'](_0x37f407,_0x256871[_0x5d96('0x80')]['basename']));}})['catch'](handleError(_0x2c0c36,null));};
\ No newline at end of file
+var _0xa6ee=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','apply','reject','update','destroy','then','name','send','index','FaxMessage','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','day','add','merge','map','type','field','count','includeAll','include','findAll','rows','show','params','rawAttributes','options','body','find','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','EventManager','FaxInteractionId','RejectMessage','rejectMessage','rejectmessage','create','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','join','server','files','attachments','download','basename','html-pdf','eml-format','request-promise','bluebird','mustache','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3b84a8,_0xd456ed){var _0x2c020d=function(_0x46b9e3){while(--_0x46b9e3){_0x3b84a8['push'](_0x3b84a8['shift']());}};_0x2c020d(++_0xd456ed);}(_0xa6ee,0x1ed));var _0xea6e=function(_0x2416fa,_0x5b14af){_0x2416fa=_0x2416fa-0x0;var _0xd410e4=_0xa6ee[_0x2416fa];return _0xd410e4;};'use strict';var pdf=require(_0xea6e('0x0'));var emlformat=require(_0xea6e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xea6e('0x2'));var moment=require('moment');var BPromise=require(_0xea6e('0x3'));var Mustache=require(_0xea6e('0x4'));var util=require('util');var path=require('path');var sox=require(_0xea6e('0x5'));var csv=require('to-csv');var ejs=require(_0xea6e('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xea6e('0x7'));var crypto=require('crypto');var jsforce=require(_0xea6e('0x8'));var deskjs=require(_0xea6e('0x9'));var toCsv=require(_0xea6e('0xa'));var querystring=require(_0xea6e('0xb'));var Papa=require(_0xea6e('0xc'));var Redis=require(_0xea6e('0xd'));var qs=require(_0xea6e('0xe'));var logger=require(_0xea6e('0xf'))(_0xea6e('0x10'));var utils=require(_0xea6e('0x11'));var config=require(_0xea6e('0x12'));var db=require(_0xea6e('0x13'))['db'];config[_0xea6e('0x14')]=_[_0xea6e('0x15')](config['redis'],{'host':_0xea6e('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea6e('0x14')]));require('./faxMessage.socket')[_0xea6e('0x17')](socket);var jayson=require(_0xea6e('0x18'));var client=jayson[_0xea6e('0x19')]['http']({'port':0x232c});var client9002=jayson[_0xea6e('0x19')][_0xea6e('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x40675e,_0x5907c4,_0x2254ac,_0x4bdbde){return new BPromise(function(_0x500c26,_0x442c70){var _0x4e9539=_0x4bdbde||client;return _0x4e9539[_0xea6e('0x1b')](_0x40675e,_0x2254ac)['then'](function(_0x11c34f){logger[_0xea6e('0x1c')]('FaxMessage,\x20%s,\x20%s',_0x5907c4,_0xea6e('0x1d'));logger[_0xea6e('0x1e')](_0xea6e('0x1f'),_0x5907c4,'request\x20sent',JSON[_0xea6e('0x20')](_0x11c34f));if(_0x11c34f[_0xea6e('0x21')]){if(_0x11c34f[_0xea6e('0x21')]['code']===0x1f4){logger[_0xea6e('0x21')](_0xea6e('0x22'),_0x5907c4,_0x11c34f[_0xea6e('0x21')][_0xea6e('0x23')]);return _0x442c70(_0x11c34f[_0xea6e('0x21')][_0xea6e('0x23')]);}logger[_0xea6e('0x21')](_0xea6e('0x22'),_0x5907c4,_0x11c34f[_0xea6e('0x21')][_0xea6e('0x23')]);return _0x500c26(_0x11c34f[_0xea6e('0x21')][_0xea6e('0x23')]);}else{logger[_0xea6e('0x1c')](_0xea6e('0x22'),_0x5907c4,_0xea6e('0x1d'));_0x500c26(_0x11c34f['result'][_0xea6e('0x23')]);}})[_0xea6e('0x24')](function(_0x97c8c){logger[_0xea6e('0x21')](_0xea6e('0x22'),_0x5907c4,_0x97c8c);_0x442c70(_0x97c8c);});});}function respondWithStatusCode(_0x4cc64f,_0x370859){_0x370859=_0x370859||0xcc;return function(_0x1cbde5){if(_0x1cbde5){return _0x4cc64f[_0xea6e('0x25')](_0x370859);}return _0x4cc64f[_0xea6e('0x26')](_0x370859)[_0xea6e('0x27')]();};}function respondWithResult(_0x585e6d,_0x6e43b){_0x6e43b=_0x6e43b||0xc8;return function(_0x2b641b){if(_0x2b641b){return _0x585e6d[_0xea6e('0x26')](_0x6e43b)[_0xea6e('0x28')](_0x2b641b);}};}function respondWithFilteredResult(_0x56bbb9,_0x92702e){return function(_0x347151){if(_0x347151){var _0x2930c8=_0x347151['count'],_0xd6461a=_0x92702e[_0xea6e('0x29')],_0x1df952=_0x92702e['offset']+_0x92702e[_0xea6e('0x2a')],_0x2edc23;if(_0x1df952>=_0x2930c8){_0x1df952=_0x2930c8;_0x2edc23=0xc8;}else{_0x2edc23=0xce;}_0x56bbb9['status'](_0x2edc23);return _0x56bbb9['set']('Content-Range',_0xd6461a+'-'+_0x1df952+'/'+_0x2930c8)[_0xea6e('0x28')](_0x347151);}return null;};}function patchUpdates(_0x35433f){return function(_0x2ecc4a){try{jsonpatch[_0xea6e('0x2b')](_0x2ecc4a,_0x35433f,!![]);}catch(_0x2a55ee){return BPromise[_0xea6e('0x2c')](_0x2a55ee);}return _0x2ecc4a['save']();};}function saveUpdates(_0x2af694,_0x10486c){return function(_0x2d0c5c){if(_0x2d0c5c){return _0x2d0c5c[_0xea6e('0x2d')](_0x2af694)['then'](function(_0x365af8){return _0x365af8;});}return null;};}function removeEntity(_0x122c19,_0x30b202){return function(_0x3dde61){if(_0x3dde61){return _0x3dde61[_0xea6e('0x2e')]()[_0xea6e('0x2f')](function(){_0x122c19[_0xea6e('0x26')](0xcc)[_0xea6e('0x27')]();});}};}function handleEntityNotFound(_0x1b5d3c,_0x3af638){return function(_0x538beb){if(!_0x538beb){_0x1b5d3c[_0xea6e('0x25')](0x194);}return _0x538beb;};}function handleError(_0x1eb578,_0x379ff7){_0x379ff7=_0x379ff7||0x1f4;return function(_0x6bc67f){logger[_0xea6e('0x21')](_0x6bc67f['stack']);if(_0x6bc67f[_0xea6e('0x30')]){delete _0x6bc67f['name'];}_0x1eb578[_0xea6e('0x26')](_0x379ff7)[_0xea6e('0x31')](_0x6bc67f);};}exports[_0xea6e('0x32')]=function(_0x49ab57,_0x49492c){var _0x591a24={},_0x5c8cc0={},_0x598520={'count':0x0,'rows':[]};var _0x30d60f=db[_0xea6e('0x33')]['rawAttributes'];_0x5c8cc0[_0xea6e('0x34')]=_['keys'](_0x30d60f);var _0x298574={'dateStart':_0x49ab57[_0xea6e('0x35')][_0xea6e('0x36')],'dateEnd':_0x49ab57[_0xea6e('0x35')][_0xea6e('0x37')]};delete _0x49ab57[_0xea6e('0x35')][_0xea6e('0x36')];delete _0x49ab57[_0xea6e('0x35')]['dateEnd'];_0x5c8cc0[_0xea6e('0x35')]=_[_0xea6e('0x38')](_0x49ab57['query']);_0x5c8cc0[_0xea6e('0x39')]=_[_0xea6e('0x3a')](_0x5c8cc0['model'],_0x5c8cc0[_0xea6e('0x35')]);_0x591a24[_0xea6e('0x3b')]=_[_0xea6e('0x3a')](_0x5c8cc0[_0xea6e('0x34')],qs[_0xea6e('0x3c')](_0x49ab57[_0xea6e('0x35')]['fields']));_0x591a24['attributes']=_0x591a24[_0xea6e('0x3b')][_0xea6e('0x3d')]?_0x591a24['attributes']:_0x5c8cc0[_0xea6e('0x34')];if(!_0x49ab57[_0xea6e('0x35')][_0xea6e('0x3e')](_0xea6e('0x3f'))){_0x591a24[_0xea6e('0x2a')]=qs[_0xea6e('0x2a')](_0x49ab57[_0xea6e('0x35')][_0xea6e('0x2a')]);_0x591a24[_0xea6e('0x29')]=qs[_0xea6e('0x29')](_0x49ab57[_0xea6e('0x35')][_0xea6e('0x29')]);}_0x591a24[_0xea6e('0x40')]=qs[_0xea6e('0x41')](_0x49ab57['query'][_0xea6e('0x41')]);_0x591a24[_0xea6e('0x42')]=qs[_0xea6e('0x39')](_['pick'](_0x49ab57['query'],_0x5c8cc0['filters']));if(_0x298574['dateStart']){if(_0x298574[_0xea6e('0x37')]){_0x298574[_0xea6e('0x37')]=moment(_0x298574['dateEnd'])['add'](0x1,_0xea6e('0x43'));}else{_0x298574['dateEnd']=moment(_0x298574[_0xea6e('0x36')])[_0xea6e('0x44')](0x1,_0xea6e('0x43'));}_[_0xea6e('0x45')](_0x591a24[_0xea6e('0x42')],{'createdAt':{'$gte':_0x298574[_0xea6e('0x36')],'$lte':_0x298574[_0xea6e('0x37')]}});}if(_0x49ab57['query']['filter']){_0x591a24[_0xea6e('0x42')]=_[_0xea6e('0x45')](_0x591a24[_0xea6e('0x42')],{'$or':_[_0xea6e('0x46')](_0x30d60f,function(_0x52f5c9){if(_0x52f5c9[_0xea6e('0x47')]['key']!=='VIRTUAL'){var _0x5422e0={};_0x5422e0[_0x52f5c9[_0xea6e('0x48')]]={'$like':'%'+_0x49ab57[_0xea6e('0x35')]['filter']+'%'};return _0x5422e0;}})});}_0x591a24=_[_0xea6e('0x45')]({},_0x591a24,_0x49ab57['options']);var _0x32b606={'where':_0x591a24['where']};return db[_0xea6e('0x33')]['count'](_0x32b606)[_0xea6e('0x2f')](function(_0x9a8396){_0x598520[_0xea6e('0x49')]=_0x9a8396;if(_0x49ab57[_0xea6e('0x35')][_0xea6e('0x4a')]){_0x591a24[_0xea6e('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0xea6e('0x4c')](_0x591a24);})['then'](function(_0x4155d3){_0x598520[_0xea6e('0x4d')]=_0x4155d3;return _0x598520;})[_0xea6e('0x2f')](respondWithFilteredResult(_0x49492c,_0x591a24))[_0xea6e('0x24')](handleError(_0x49492c,null));};exports[_0xea6e('0x4e')]=function(_0x23f190,_0x614f9e){var _0x19c65e={'raw':!![],'where':{'id':_0x23f190[_0xea6e('0x4f')]['id']}},_0x5a69fd={};_0x5a69fd[_0xea6e('0x34')]=_['keys'](db['FaxMessage'][_0xea6e('0x50')]);_0x5a69fd[_0xea6e('0x35')]=_[_0xea6e('0x38')](_0x23f190[_0xea6e('0x35')]);_0x5a69fd[_0xea6e('0x39')]=_[_0xea6e('0x3a')](_0x5a69fd[_0xea6e('0x34')],_0x5a69fd['query']);_0x19c65e[_0xea6e('0x3b')]=_['intersection'](_0x5a69fd[_0xea6e('0x34')],qs['fields'](_0x23f190[_0xea6e('0x35')][_0xea6e('0x3c')]));_0x19c65e[_0xea6e('0x3b')]=_0x19c65e[_0xea6e('0x3b')][_0xea6e('0x3d')]?_0x19c65e[_0xea6e('0x3b')]:_0x5a69fd[_0xea6e('0x34')];if(_0x23f190['query'][_0xea6e('0x4a')]){_0x19c65e['include']=[{'all':!![]}];}_0x19c65e=_[_0xea6e('0x45')]({},_0x19c65e,_0x23f190[_0xea6e('0x51')]);return db[_0xea6e('0x33')]['find'](_0x19c65e)[_0xea6e('0x2f')](handleEntityNotFound(_0x614f9e,null))[_0xea6e('0x2f')](respondWithResult(_0x614f9e,null))[_0xea6e('0x24')](handleError(_0x614f9e,null));};exports['update']=function(_0x49afa7,_0x340648){if(_0x49afa7[_0xea6e('0x52')]['id']){delete _0x49afa7[_0xea6e('0x52')]['id'];}return db[_0xea6e('0x33')][_0xea6e('0x53')]({'where':{'id':_0x49afa7[_0xea6e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x340648,null))[_0xea6e('0x2f')](saveUpdates(_0x49afa7[_0xea6e('0x52')],null))['then'](respondWithResult(_0x340648,null))[_0xea6e('0x24')](handleError(_0x340648,null));};exports[_0xea6e('0x2e')]=function(_0x176e3f,_0x1d19d4){return db['FaxMessage'][_0xea6e('0x53')]({'where':{'id':_0x176e3f[_0xea6e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1d19d4,null))[_0xea6e('0x2f')](removeEntity(_0x1d19d4,null))[_0xea6e('0x24')](handleError(_0x1d19d4,null));};exports[_0xea6e('0x54')]=function(_0x14774c,_0x16970c){return db[_0xea6e('0x33')]['describe']()[_0xea6e('0x2f')](respondWithResult(_0x16970c,null))['catch'](handleError(_0x16970c,null));};var interaction_log=require(_0xea6e('0xf'))(_0xea6e('0x55'));exports[_0xea6e('0x56')]=function(_0x2c691c,_0x59439b,_0x5d64c1){var _0x251437={'channel':_0xea6e('0x57')};if(_0x2c691c[_0xea6e('0x52')]['id']){delete _0x2c691c[_0xea6e('0x52')]['id'];}_0x2c691c['body'][_0xea6e('0x58')]=!![];_0x2c691c[_0xea6e('0x52')][_0xea6e('0x59')]=moment()[_0xea6e('0x5a')](_0xea6e('0x5b'));_0x2c691c[_0xea6e('0x52')][_0xea6e('0x5c')]=_0x2c691c[_0xea6e('0x52')]['UserId']||_0x2c691c[_0xea6e('0x5d')]['id'];return db['FaxMessage'][_0xea6e('0x53')]({'where':{'id':_0x2c691c['params']['id'],'UserId':null},'include':[{'model':db[_0xea6e('0x5e')],'as':_0xea6e('0x5f')}]})[_0xea6e('0x2f')](handleEntityNotFound(_0x59439b,null))[_0xea6e('0x2f')](saveUpdates(_0x2c691c[_0xea6e('0x52')],null))[_0xea6e('0x2f')](function(_0x3e9f35){if(_0x3e9f35){_0x251437[_0xea6e('0x23')]=_0x3e9f35[_0xea6e('0x60')]({'plain':!![]});return db[_0xea6e('0x61')]['find']({'where':{'id':_0x3e9f35['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x59439b,null))[_0xea6e('0x2f')](function(_0x43c551){if(_0x43c551){return _0x43c551[_0xea6e('0x2d')]({'UserId':_0x2c691c[_0xea6e('0x52')][_0xea6e('0x5c')],'read1stAt':_['isNil'](_0x43c551[_0xea6e('0x62')])?moment()[_0xea6e('0x5a')](_0xea6e('0x5b')):undefined});}return null;})['then'](function(_0x5bf93e){if(_0x5bf93e){_0x251437[_0xea6e('0x63')]=_0x5bf93e[_0xea6e('0x60')]({'plain':!![]});interaction_log[_0xea6e('0x1c')](_0xea6e('0x64'),_0x2c691c[_0xea6e('0x5d')]['id'],_0x2c691c['user'][_0xea6e('0x30')],_0x2c691c['user'][_0xea6e('0x65')],_0x251437[_0xea6e('0x63')]['id'],_0x2c691c[_0xea6e('0x52')]?JSON[_0xea6e('0x20')](_0x2c691c[_0xea6e('0x52')]):_0xea6e('0x66'));return respondWithRpcPromise('AcceptMessage',_0xea6e('0x67'),_0x251437);}return null;})['then'](function(_0x873d36){if(_0x873d36){if(_0x2c691c['body'][_0xea6e('0x68')]){_0x251437[_0xea6e('0x23')][_0xea6e('0x69')]=util[_0xea6e('0x5a')](_0xea6e('0x6a'),_0x2c691c[_0xea6e('0x5d')]['name']);_0x251437[_0xea6e('0x23')][_0xea6e('0x6b')]=_0x251437[_0xea6e('0x6b')];_0x251437['message']['event']=_0xea6e('0x56');return respondWithRpcPromise(_0xea6e('0x6c'),_0xea6e('0x6c'),{'event':'acceptmessage','message':_0x251437[_0xea6e('0x23')]},client9002)[_0xea6e('0x2f')](function(){return _0x251437;});}return _0x251437;}return null;})[_0xea6e('0x2f')](respondWithResult(_0x59439b,null))[_0xea6e('0x24')](handleError(_0x59439b,null));};var interaction_log=require(_0xea6e('0xf'))(_0xea6e('0x55'));exports[_0xea6e('0x2c')]=function(_0xe69182,_0xbfc1b6,_0x7fc358){var _0x310c28={'agent':{},'channel':_0xea6e('0x57')};if(_0xe69182[_0xea6e('0x52')]['id']){delete _0xe69182[_0xea6e('0x52')]['id'];}_0xe69182[_0xea6e('0x52')][_0xea6e('0x5c')]=_0xe69182[_0xea6e('0x52')][_0xea6e('0x5c')]||_0xe69182[_0xea6e('0x5d')]['id'];_0x310c28['agent']['id']=_0xe69182['body'][_0xea6e('0x5c')];return db[_0xea6e('0x33')][_0xea6e('0x53')]({'where':{'id':_0xe69182[_0xea6e('0x4f')]['id'],'UserId':null}})[_0xea6e('0x2f')](handleEntityNotFound(_0xbfc1b6,null))[_0xea6e('0x2f')](function(_0x210f92){if(_0x210f92){_0x310c28[_0xea6e('0x23')]=_0x210f92[_0xea6e('0x60')]({'plain':!![]});return db[_0xea6e('0x61')][_0xea6e('0x53')]({'where':{'id':_0x210f92[_0xea6e('0x6d')]}});}return null;})[_0xea6e('0x2f')](handleEntityNotFound(_0xbfc1b6,null))['then'](function(_0xef4ffb){if(_0xef4ffb){_0x310c28[_0xea6e('0x63')]=_0xef4ffb[_0xea6e('0x60')]({'plain':!![]});interaction_log[_0xea6e('0x1c')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe69182[_0xea6e('0x5d')]['id'],_0xe69182[_0xea6e('0x5d')][_0xea6e('0x30')],_0xe69182[_0xea6e('0x5d')][_0xea6e('0x65')],_0x310c28['interaction']['id'],_0xe69182['body']?JSON[_0xea6e('0x20')](_0xe69182[_0xea6e('0x52')]):_0xea6e('0x66'));return respondWithRpcPromise(_0xea6e('0x6e'),_0xea6e('0x6f'),_0x310c28);}return null;})[_0xea6e('0x2f')](function(_0x3e6ebe){if(_0x3e6ebe){_0x3e6ebe[_0xea6e('0x23')][_0xea6e('0x69')]=util['format']('SIP/%s',_0xe69182[_0xea6e('0x5d')]['name']);_0x3e6ebe['message'][_0xea6e('0x6b')]=_0x310c28[_0xea6e('0x6b')];_0x3e6ebe['message']['event']=_0xea6e('0x2c');respondWithRpcPromise(_0xea6e('0x6c'),_0xea6e('0x6c'),{'event':_0xea6e('0x70'),'message':_0x3e6ebe[_0xea6e('0x23')]},client9002);return _0x310c28;}return null;})[_0xea6e('0x2f')](respondWithResult(_0xbfc1b6,null))[_0xea6e('0x24')](handleError(_0xbfc1b6,null));};exports[_0xea6e('0x71')]=function(_0x192907,_0x2aeade){var _0x3c27f6;return db[_0xea6e('0x33')][_0xea6e('0x71')](_0x192907[_0xea6e('0x52')],{})['then'](function(_0xf7f56){_0x3c27f6=_0xf7f56;return db[_0xea6e('0x5e')][_0xea6e('0x72')]({'where':{'id':_0x3c27f6['ContactId']}});})[_0xea6e('0x2f')](function(_0x1a0f7a){if(_[_0xea6e('0x73')](_0x1a0f7a)){return;}else{_0x3c27f6[_0xea6e('0x57')]=_0x1a0f7a[_0xea6e('0x57')];return db[_0xea6e('0x74')][_0xea6e('0x72')]({'where':{'id':_0x3c27f6['AttachmentId']}});}})[_0xea6e('0x2f')](function(_0x9457f8){return respondWithRpcPromise(_0xea6e('0x75'),_0xea6e('0x75'),{'FaxAccountId':_[_0xea6e('0x73')](_0x192907[_0xea6e('0x52')])?undefined:_0x192907[_0xea6e('0x52')][_0xea6e('0x76')],'path':_[_0xea6e('0x73')](_0x9457f8)?undefined:util[_0xea6e('0x5a')](_0xea6e('0x77'),_0x9457f8['basename']),'fax':_['isNil'](_0x3c27f6[_0xea6e('0x57')])?undefined:_0x3c27f6[_0xea6e('0x57')],'AttachmentId':_0x3c27f6[_0xea6e('0x78')]},client9002);})[_0xea6e('0x2f')](respondWithResult(_0x2aeade,0xc9))[_0xea6e('0x24')](handleError(_0x2aeade,null));};exports['download']=function(_0x5696e9,_0x4f676c){var _0x5daaea=path[_0xea6e('0x79')](config['root'],_0xea6e('0x7a'),_0xea6e('0x7b'),_0xea6e('0x7c'));return db[_0xea6e('0x33')][_0xea6e('0x53')]({'where':{'id':_0x5696e9[_0xea6e('0x4f')]['id']},'include':[{'model':db[_0xea6e('0x74')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x4f676c,null))[_0xea6e('0x2f')](function(_0xcaaa2e){if(_0xcaaa2e){return _0x4f676c[_0xea6e('0x7d')](path[_0xea6e('0x79')](_0x5daaea,_0xcaaa2e[_0xea6e('0x74')][_0xea6e('0x7e')]));}})[_0xea6e('0x24')](handleError(_0x4f676c,null));};
\ No newline at end of file
index d20f017..d6795e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02c0=['events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x02c0,0x8c));var _0x002c=function(_0x45f825,_0x16b109){_0x45f825=_0x45f825-0x0;var _0x495af4=_0x02c0[_0x45f825];return _0x495af4;};'use strict';var EventEmitter=require(_0x002c('0x0'));var FaxMessage=require(_0x002c('0x1'))['db'][_0x002c('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x002c('0x3')](0x0);var events={'afterCreate':_0x002c('0x4'),'afterUpdate':_0x002c('0x5'),'afterDestroy':_0x002c('0x6')};function emitEvent(_0x4eca0f){return function(_0x48854e,_0x4e5f7,_0x9b54e2){FaxMessageEvents['emit'](_0x4eca0f+':'+_0x48854e['id'],_0x48854e);FaxMessageEvents['emit'](_0x4eca0f,_0x48854e);_0x9b54e2(null);};}for(var e in events){if(events[_0x002c('0x7')](e)){var event=events[e];FaxMessage[_0x002c('0x8')](e,emitEvent(event));}}module[_0x002c('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0x3fd7=['FaxMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x20a800,_0x3b61db){var _0x19347b=function(_0x1ec71b){while(--_0x1ec71b){_0x20a800['push'](_0x20a800['shift']());}};_0x19347b(++_0x3b61db);}(_0x3fd7,0x15d));var _0x73fd=function(_0x3a93d5,_0x7f9e49){_0x3a93d5=_0x3a93d5-0x0;var _0x12c0b1=_0x3fd7[_0x3a93d5];return _0x12c0b1;};'use strict';var EventEmitter=require(_0x73fd('0x0'));var FaxMessage=require(_0x73fd('0x1'))['db'][_0x73fd('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x73fd('0x3'),'afterUpdate':_0x73fd('0x4'),'afterDestroy':_0x73fd('0x5')};function emitEvent(_0x49dc9e){return function(_0x56e871,_0x3cb17b,_0x5ab573){FaxMessageEvents[_0x73fd('0x6')](_0x49dc9e+':'+_0x56e871['id'],_0x56e871);FaxMessageEvents[_0x73fd('0x6')](_0x49dc9e,_0x56e871);_0x5ab573(null);};}for(var e in events){if(events[_0x73fd('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x73fd('0x8')]=FaxMessageEvents;
\ No newline at end of file
index f24f04e..0d59396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf500=['define','FaxMessage','fax_messages','direction','toLowerCase','secret','isNil','UserId','findOne','FaxInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','util','bluebird','request-promise','./faxMessage.attributes','exports'];(function(_0x575f37,_0x3821ca){var _0xe7215b=function(_0x5cb764){while(--_0x5cb764){_0x575f37['push'](_0x575f37['shift']());}};_0xe7215b(++_0x3821ca);}(_0xf500,0x163));var _0x0f50=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xf500[_0x2080a3];return _0x8d7d17;};'use strict';var _=require('lodash');var util=require(_0x0f50('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0f50('0x1'));var rp=require(_0x0f50('0x2'));var attributes=require(_0x0f50('0x3'));module[_0x0f50('0x4')]=function(_0x5d3c93,_0x22ec47){return _0x5d3c93[_0x0f50('0x5')](_0x0f50('0x6'),attributes,{'tableName':_0x0f50('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dc8d2,_0x251d08,_0x32c097){var _0x17538d=_0x5d3c93['models'];var _0x29205f=_0x5dc8d2['get']({'plain':!![]});if(_0x29205f[_0x0f50('0x8')][_0x0f50('0x9')]()==='in'||_0x29205f[_0x0f50('0x8')][_0x0f50('0x9')]()==='out'&&!_0x29205f[_0x0f50('0xa')]&&!_[_0x0f50('0xb')](_0x29205f[_0x0f50('0xc')])){_0x17538d['FaxInteraction'][_0x0f50('0xd')]({'where':{'id':_0x29205f[_0x0f50('0xe')]}})[_0x0f50('0xf')](function(_0x38933f){if(_0x38933f){_0x38933f[_0x0f50('0x10')]({'lastMsgAt':_0x29205f[_0x0f50('0x11')],'lastMsgDirection':_0x29205f[_0x0f50('0x8')][_0x0f50('0x9')](),'lastMsgBody':_0x29205f['body']});}})['catch'](function(_0x1934c0){console[_0x0f50('0x12')](_0x1934c0);});}_0x32c097();}},'charset':'utf8mb4','collate':_0x0f50('0x13')});};
\ No newline at end of file
+var _0x07cd=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','models','direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','body','catch','error'];(function(_0x160e92,_0x45e857){var _0x5ae2b0=function(_0x22f806){while(--_0x22f806){_0x160e92['push'](_0x160e92['shift']());}};_0x5ae2b0(++_0x45e857);}(_0x07cd,0x9e));var _0xd07c=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x07cd[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0xd07c('0x0'));var util=require(_0xd07c('0x1'));var logger=require(_0xd07c('0x2'))(_0xd07c('0x3'));var moment=require(_0xd07c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xd07c('0x5'));module[_0xd07c('0x6')]=function(_0x1f4d21,_0x5aa1ab){return _0x1f4d21[_0xd07c('0x7')](_0xd07c('0x8'),attributes,{'tableName':_0xd07c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x31d974,_0x295612,_0x2a0060){var _0x22ee28=_0x1f4d21[_0xd07c('0xa')];var _0x19235d=_0x31d974['get']({'plain':!![]});if(_0x19235d[_0xd07c('0xb')][_0xd07c('0xc')]()==='in'||_0x19235d[_0xd07c('0xb')]['toLowerCase']()==='out'&&!_0x19235d['secret']&&!_[_0xd07c('0xd')](_0x19235d[_0xd07c('0xe')])){_0x22ee28[_0xd07c('0xf')][_0xd07c('0x10')]({'where':{'id':_0x19235d[_0xd07c('0x11')]}})[_0xd07c('0x12')](function(_0x5aba41){if(_0x5aba41){_0x5aba41[_0xd07c('0x13')]({'lastMsgAt':_0x19235d[_0xd07c('0x14')],'lastMsgDirection':_0x19235d[_0xd07c('0xb')][_0xd07c('0xc')](),'lastMsgBody':_0x19235d[_0xd07c('0x15')]});}})[_0xd07c('0x16')](function(_0x4096e7){console[_0xd07c('0x17')](_0x4096e7);});}_0x2a0060();}},'charset':_0xd07c('0x18'),'collate':_0xd07c('0x19')});};
\ No newline at end of file
index 3f14eb7..c58ea46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08d9=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxMessage,\x20%s,\x20%s','FaxMessage','create','body','options','CreateFaxMessage','debug','UpdateFaxMessage','update','raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x49aab7,_0x1d6397){var _0x587b6f=function(_0x2346ac){while(--_0x2346ac){_0x49aab7['push'](_0x49aab7['shift']());}};_0x587b6f(++_0x1d6397);}(_0x08d9,0xc2));var _0x908d=function(_0x4936fb,_0x10fda9){_0x4936fb=_0x4936fb-0x0;var _0x4430ab=_0x08d9[_0x4936fb];return _0x4430ab;};'use strict';var _=require(_0x908d('0x0'));var util=require('util');var moment=require(_0x908d('0x1'));var BPromise=require('bluebird');var rs=require(_0x908d('0x2'));var fs=require('fs');var Redis=require(_0x908d('0x3'));var db=require(_0x908d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x908d('0x5'));var config=require(_0x908d('0x6'));var jayson=require(_0x908d('0x7'));var client=jayson[_0x908d('0x8')][_0x908d('0x9')]({'port':0x232a});config['redis']=_[_0x908d('0xa')](config[_0x908d('0xb')],{'host':_0x908d('0xc'),'port':0x18eb});var socket=require(_0x908d('0xd'))(new Redis(config[_0x908d('0xb')]));require(_0x908d('0xe'))[_0x908d('0xf')](socket);function respondWithRpcPromise(_0x24113f,_0x41b147,_0x2ac2b7){return new BPromise(function(_0x570b56,_0x938950){return client[_0x908d('0x10')](_0x24113f,_0x2ac2b7)[_0x908d('0x11')](function(_0x114027){logger[_0x908d('0x12')]('FaxMessage,\x20%s,\x20%s',_0x41b147,'request\x20sent');logger['debug'](_0x908d('0x13'),_0x41b147,_0x908d('0x14'),JSON[_0x908d('0x15')](_0x114027));if(_0x114027[_0x908d('0x16')]){if(_0x114027[_0x908d('0x16')][_0x908d('0x17')]===0x1f4){logger[_0x908d('0x16')]('FaxMessage,\x20%s,\x20%s',_0x41b147,_0x114027['error'][_0x908d('0x18')]);return _0x938950(_0x114027[_0x908d('0x16')][_0x908d('0x18')]);}logger[_0x908d('0x16')]('FaxMessage,\x20%s,\x20%s',_0x41b147,_0x114027['error'][_0x908d('0x18')]);return _0x570b56(_0x114027[_0x908d('0x16')][_0x908d('0x18')]);}else{logger[_0x908d('0x12')]('FaxMessage,\x20%s,\x20%s',_0x41b147,_0x908d('0x14'));_0x570b56(_0x114027[_0x908d('0x19')][_0x908d('0x18')]);}})[_0x908d('0x1a')](function(_0x209ffd){logger[_0x908d('0x16')](_0x908d('0x1b'),_0x41b147,_0x209ffd);_0x938950(_0x209ffd);});});}exports['CreateFaxMessage']=function(_0x34a524){var _0x10848a=this;return new Promise(function(_0x46dd69,_0x48ef83){return db[_0x908d('0x1c')][_0x908d('0x1d')](_0x34a524[_0x908d('0x1e')],{'raw':_0x34a524[_0x908d('0x1f')]?_0x34a524[_0x908d('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x908d('0x11')](function(_0x4a0875){logger[_0x908d('0x12')](_0x908d('0x20'),_0x34a524);logger[_0x908d('0x21')](_0x908d('0x20'),_0x34a524,JSON[_0x908d('0x15')](_0x4a0875));_0x46dd69(_0x4a0875);})[_0x908d('0x1a')](function(_0x27dec1){logger[_0x908d('0x16')]('CreateFaxMessage',_0x27dec1[_0x908d('0x18')],_0x34a524);_0x48ef83(_0x10848a[_0x908d('0x16')](0x1f4,_0x27dec1[_0x908d('0x18')]));});});};exports[_0x908d('0x22')]=function(_0x40af96){var _0x56538a=this;return new Promise(function(_0x5cd721,_0x4488e8){return db[_0x908d('0x1c')][_0x908d('0x23')](_0x40af96[_0x908d('0x1e')],{'raw':_0x40af96[_0x908d('0x1f')]?_0x40af96['options'][_0x908d('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40af96[_0x908d('0x1f')]?_0x40af96['options'][_0x908d('0x25')]||null:null,'attributes':_0x40af96[_0x908d('0x1f')]?_0x40af96[_0x908d('0x1f')][_0x908d('0x26')]||null:null,'limit':_0x40af96[_0x908d('0x1f')]?_0x40af96[_0x908d('0x1f')][_0x908d('0x27')]||null:null})[_0x908d('0x11')](function(_0x2b8fa3){logger[_0x908d('0x12')](_0x908d('0x22'),_0x40af96);logger['debug'](_0x908d('0x22'),_0x40af96,JSON[_0x908d('0x15')](_0x2b8fa3));_0x5cd721(_0x2b8fa3);})[_0x908d('0x1a')](function(_0x2d0e55){logger['error'](_0x908d('0x22'),_0x2d0e55[_0x908d('0x18')],_0x40af96);_0x4488e8(_0x56538a[_0x908d('0x16')](0x1f4,_0x2d0e55[_0x908d('0x18')]));});});};
\ No newline at end of file
+var _0xb182=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','where','attributes','limit','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1cbf12,_0x19e24f){var _0xd4143a=function(_0x5e065d){while(--_0x5e065d){_0x1cbf12['push'](_0x1cbf12['shift']());}};_0xd4143a(++_0x19e24f);}(_0xb182,0x121));var _0x2b18=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xb182[_0x556bb1];return _0x45455f;};'use strict';var _=require('lodash');var util=require(_0x2b18('0x0'));var moment=require(_0x2b18('0x1'));var BPromise=require(_0x2b18('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b18('0x3'))['db'];var utils=require(_0x2b18('0x4'));var logger=require(_0x2b18('0x5'))('rpc');var config=require(_0x2b18('0x6'));var jayson=require(_0x2b18('0x7'));var client=jayson[_0x2b18('0x8')][_0x2b18('0x9')]({'port':0x232a});config[_0x2b18('0xa')]=_[_0x2b18('0xb')](config[_0x2b18('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2b18('0xc'))(new Redis(config[_0x2b18('0xa')]));require(_0x2b18('0xd'))[_0x2b18('0xe')](socket);function respondWithRpcPromise(_0x3faf03,_0x1ec42f,_0x1311ad){return new BPromise(function(_0x261b64,_0x440d50){return client[_0x2b18('0xf')](_0x3faf03,_0x1311ad)[_0x2b18('0x10')](function(_0x36bea7){logger[_0x2b18('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1ec42f,_0x2b18('0x12'));logger[_0x2b18('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1ec42f,'request\x20sent',JSON[_0x2b18('0x14')](_0x36bea7));if(_0x36bea7[_0x2b18('0x15')]){if(_0x36bea7[_0x2b18('0x15')][_0x2b18('0x16')]===0x1f4){logger[_0x2b18('0x15')](_0x2b18('0x17'),_0x1ec42f,_0x36bea7[_0x2b18('0x15')][_0x2b18('0x18')]);return _0x440d50(_0x36bea7['error'][_0x2b18('0x18')]);}logger[_0x2b18('0x15')](_0x2b18('0x17'),_0x1ec42f,_0x36bea7['error'][_0x2b18('0x18')]);return _0x261b64(_0x36bea7['error']['message']);}else{logger['info'](_0x2b18('0x17'),_0x1ec42f,_0x2b18('0x12'));_0x261b64(_0x36bea7[_0x2b18('0x19')][_0x2b18('0x18')]);}})[_0x2b18('0x1a')](function(_0x12ff10){logger[_0x2b18('0x15')]('FaxMessage,\x20%s,\x20%s',_0x1ec42f,_0x12ff10);_0x440d50(_0x12ff10);});});}exports[_0x2b18('0x1b')]=function(_0x4068d6){var _0x48e361=this;return new Promise(function(_0x5be6f2,_0x2cef3a){return db[_0x2b18('0x1c')]['create'](_0x4068d6[_0x2b18('0x1d')],{'raw':_0x4068d6[_0x2b18('0x1e')]?_0x4068d6[_0x2b18('0x1e')][_0x2b18('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x1b1635){logger['info'](_0x2b18('0x1b'),_0x4068d6);logger[_0x2b18('0x13')](_0x2b18('0x1b'),_0x4068d6,JSON['stringify'](_0x1b1635));_0x5be6f2(_0x1b1635);})['catch'](function(_0x4d5685){logger[_0x2b18('0x15')](_0x2b18('0x1b'),_0x4d5685[_0x2b18('0x18')],_0x4068d6);_0x2cef3a(_0x48e361[_0x2b18('0x15')](0x1f4,_0x4d5685[_0x2b18('0x18')]));});});};exports[_0x2b18('0x20')]=function(_0x432625){var _0x420ca7=this;return new Promise(function(_0x3b8aaa,_0x4e600b){return db[_0x2b18('0x1c')][_0x2b18('0x21')](_0x432625[_0x2b18('0x1d')],{'raw':_0x432625[_0x2b18('0x1e')]?_0x432625[_0x2b18('0x1e')][_0x2b18('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x432625[_0x2b18('0x1e')]?_0x432625[_0x2b18('0x1e')][_0x2b18('0x22')]||null:null,'attributes':_0x432625[_0x2b18('0x1e')]?_0x432625[_0x2b18('0x1e')][_0x2b18('0x23')]||null:null,'limit':_0x432625[_0x2b18('0x1e')]?_0x432625[_0x2b18('0x1e')][_0x2b18('0x24')]||null:null})[_0x2b18('0x10')](function(_0x407eba){logger[_0x2b18('0x11')](_0x2b18('0x20'),_0x432625);logger[_0x2b18('0x13')](_0x2b18('0x20'),_0x432625,JSON[_0x2b18('0x14')](_0x407eba));_0x3b8aaa(_0x407eba);})['catch'](function(_0x3d1ba0){logger[_0x2b18('0x15')](_0x2b18('0x20'),_0x3d1ba0[_0x2b18('0x18')],_0x432625);_0x4e600b(_0x420ca7['error'](0x1f4,_0x3d1ba0['message']));});});};
\ No newline at end of file
index 99edcae..18ec587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5410=['remove','update','emit','removeListener','length','faxMessage:','save'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x5410,0xa0));var _0x0541=function(_0x38c660,_0x345e6c){_0x38c660=_0x38c660-0x0;var _0x4a85e7=_0x5410[_0x38c660];return _0x4a85e7;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x0541('0x0'),_0x0541('0x1'),_0x0541('0x2')];function createListener(_0x301523,_0x2baa7f){return function(_0x13c7aa){_0x2baa7f[_0x0541('0x3')](_0x301523,_0x13c7aa);};}function removeListener(_0x102a10,_0x1098c3){return function(){FaxMessageEvents[_0x0541('0x4')](_0x102a10,_0x1098c3);};}exports['register']=function(_0x19e8e5){for(var _0x3a199b=0x0,_0x1a79e8=events[_0x0541('0x5')];_0x3a199b<_0x1a79e8;_0x3a199b++){var _0x4903c2=events[_0x3a199b];var _0x1ba982=createListener(_0x0541('0x6')+_0x4903c2,_0x19e8e5);FaxMessageEvents['on'](_0x4903c2,_0x1ba982);}};
\ No newline at end of file
+var _0x6c32=['remove','update','emit','removeListener','register','faxMessage:','./faxMessage.events','save'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var FaxMessageEvents=require(_0x26c3('0x0'));var events=[_0x26c3('0x1'),_0x26c3('0x2'),_0x26c3('0x3')];function createListener(_0x2bbfc4,_0x44fc8c){return function(_0x40cb8e){_0x44fc8c[_0x26c3('0x4')](_0x2bbfc4,_0x40cb8e);};}function removeListener(_0x36528a,_0x49d4a1){return function(){FaxMessageEvents[_0x26c3('0x5')](_0x36528a,_0x49d4a1);};}exports[_0x26c3('0x6')]=function(_0x15ac36){for(var _0x57d915=0x0,_0x187b81=events['length'];_0x57d915<_0x187b81;_0x57d915++){var _0x3dde22=events[_0x57d915];var _0x3ff8e7=createListener(_0x26c3('0x7')+_0x3dde22,_0x15ac36);FaxMessageEvents['on'](_0x3dde22,_0x3ff8e7);}};
\ No newline at end of file
index e4790ba..417d066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7096=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','fax','faxmessage:create','create','put','/:id','update','accept','/:id/reject','reject','destroy','exports','util','connect-timeout'];(function(_0x4014c8,_0x38efb6){var _0x194847=function(_0x83288a){while(--_0x83288a){_0x4014c8['push'](_0x4014c8['shift']());}};_0x194847(++_0x38efb6);}(_0x7096,0x10c));var _0x6709=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x7096[_0x2b7764];return _0x848dcb;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var auth=require(_0x6709('0x3'));var interaction=require(_0x6709('0x4'));var config=require(_0x6709('0x5'));var controller=require(_0x6709('0x6'));router[_0x6709('0x7')]('/',auth[_0x6709('0x8')](),controller[_0x6709('0x9')]);router[_0x6709('0x7')](_0x6709('0xa'),auth[_0x6709('0x8')](),controller[_0x6709('0xb')]);router[_0x6709('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6709('0xc')]);router[_0x6709('0x7')](_0x6709('0xd'),auth[_0x6709('0x8')](),controller[_0x6709('0xe')]);router[_0x6709('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x6709('0x10'),_0x6709('0x11')),controller[_0x6709('0x12')]);router[_0x6709('0x13')](_0x6709('0x14'),auth[_0x6709('0x8')](),controller[_0x6709('0x15')]);router[_0x6709('0x13')]('/:id/accept',auth[_0x6709('0x8')](),controller[_0x6709('0x16')]);router[_0x6709('0x13')](_0x6709('0x17'),auth['isAuthenticated'](),controller[_0x6709('0x18')]);router['delete'](_0x6709('0x14'),auth['isAuthenticated'](),controller[_0x6709('0x19')]);module[_0x6709('0x1a')]=router;
\ No newline at end of file
+var _0x71ab=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax','create','put','/:id/accept','accept','reject','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x9d32ec,_0x40dd6c){var _0x199f3b=function(_0x46504f){while(--_0x46504f){_0x9d32ec['push'](_0x9d32ec['shift']());}};_0x199f3b(++_0x40dd6c);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0x7')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0x7')](_0xb71a('0xe'),auth['isAuthenticated'](),controller[_0xb71a('0xf')]);router['post']('/',auth[_0xb71a('0x8')](),interaction[_0xb71a('0x10')](_0xb71a('0x11'),'faxmessage:create'),controller[_0xb71a('0x12')]);router['put'](_0xb71a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb71a('0x13')](_0xb71a('0x14'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb71a('0x16')]);router[_0xb71a('0x17')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x18')]);module[_0xb71a('0x19')]=router;
\ No newline at end of file
index b06e77e..4f1a02f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07f7=['beepall','roundrobin','INTEGER','sequelize','exports','STRING','name','rrmemory'];(function(_0x31616c,_0x3fbdba){var _0x433895=function(_0x1a1405){while(--_0x1a1405){_0x31616c['push'](_0x31616c['shift']());}};_0x433895(++_0x3fbdba);}(_0x07f7,0x15b));var _0x707f=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x07f7[_0x21f931];return _0x3f083c;};'use strict';var Sequelize=require(_0x707f('0x0'));module[_0x707f('0x1')]={'name':{'type':Sequelize[_0x707f('0x2')],'unique':_0x707f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x707f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x707f('0x4'),_0x707f('0x5'),_0x707f('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x707f('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5a15=['sequelize','exports','rrmemory','beepall','roundrobin','INTEGER'];(function(_0x499ca5,_0x4986cf){var _0x7bfd9c=function(_0x36fe88){while(--_0x36fe88){_0x499ca5['push'](_0x499ca5['shift']());}};_0x7bfd9c(++_0x4986cf);}(_0x5a15,0xae));var _0x55a1=function(_0x301229,_0x167eb2){_0x301229=_0x301229-0x0;var _0x9a0bb5=_0x5a15[_0x301229];return _0x9a0bb5;};'use strict';var Sequelize=require(_0x55a1('0x0'));module[_0x55a1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x55a1('0x2'),_0x55a1('0x3'),_0x55a1('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x55a1('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 9220d61..2bc8a7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30e=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserFaxQueue','pick','map','User','UserId','agent','updatedAt','createdAt','format','%s/%s','faxPause','getTeams','Team','ids','Agents','union','penalty','removeTeams','removeAgents','addAgents','omit','spread','emit','userFaxQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','FaxQueue','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','day','add','merge','filter','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xa30e,0x117));var _0xea30=function(_0x18aaaf,_0x385db6){_0x18aaaf=_0x18aaaf-0x0;var _0x52d892=_0xa30e[_0x18aaaf];return _0x52d892;};'use strict';var pdf=require(_0xea30('0x0'));var emlformat=require(_0xea30('0x1'));var rimraf=require(_0xea30('0x2'));var zipdir=require(_0xea30('0x3'));var jsonpatch=require(_0xea30('0x4'));var rp=require(_0xea30('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea30('0x6'));var path=require(_0xea30('0x7'));var sox=require(_0xea30('0x8'));var csv=require('to-csv');var ejs=require(_0xea30('0x9'));var fs=require('fs');var _=require(_0xea30('0xa'));var squel=require(_0xea30('0xb'));var crypto=require(_0xea30('0xc'));var jsforce=require(_0xea30('0xd'));var deskjs=require(_0xea30('0xe'));var toCsv=require(_0xea30('0xf'));var querystring=require(_0xea30('0x10'));var Papa=require(_0xea30('0x11'));var Redis=require(_0xea30('0x12'));var qs=require(_0xea30('0x13'));var logger=require(_0xea30('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xea30('0x15'));var db=require(_0xea30('0x16'))['db'];config[_0xea30('0x17')]=_[_0xea30('0x18')](config[_0xea30('0x17')],{'host':_0xea30('0x19'),'port':0x18eb});var socket=require(_0xea30('0x1a'))(new Redis(config[_0xea30('0x17')]));require(_0xea30('0x1b'))[_0xea30('0x1c')](socket);function respondWithStatusCode(_0x33eadc,_0x178100){_0x178100=_0x178100||0xcc;return function(_0x3a15fc){if(_0x3a15fc){return _0x33eadc['sendStatus'](_0x178100);}return _0x33eadc[_0xea30('0x1d')](_0x178100)[_0xea30('0x1e')]();};}function respondWithResult(_0x36fbd1,_0x54235a){_0x54235a=_0x54235a||0xc8;return function(_0x27e663){if(_0x27e663){return _0x36fbd1[_0xea30('0x1d')](_0x54235a)[_0xea30('0x1f')](_0x27e663);}};}function respondWithFilteredResult(_0x37498d,_0x3a2824){return function(_0x36212e){if(_0x36212e){var _0x3951f8=_0x36212e[_0xea30('0x20')],_0x598d66=_0x3a2824[_0xea30('0x21')],_0xb37dc8=_0x3a2824[_0xea30('0x21')]+_0x3a2824[_0xea30('0x22')],_0x2e7504;if(_0xb37dc8>=_0x3951f8){_0xb37dc8=_0x3951f8;_0x2e7504=0xc8;}else{_0x2e7504=0xce;}_0x37498d['status'](_0x2e7504);return _0x37498d[_0xea30('0x23')](_0xea30('0x24'),_0x598d66+'-'+_0xb37dc8+'/'+_0x3951f8)[_0xea30('0x1f')](_0x36212e);}return null;};}function patchUpdates(_0x475147){return function(_0x3f9568){try{jsonpatch[_0xea30('0x25')](_0x3f9568,_0x475147,!![]);}catch(_0x21dd56){return BPromise[_0xea30('0x26')](_0x21dd56);}return _0x3f9568['save']();};}function saveUpdates(_0x1f6378,_0x4b63cf){return function(_0x54d817){if(_0x54d817){return _0x54d817['update'](_0x1f6378)[_0xea30('0x27')](function(_0x238e49){return _0x238e49;});}return null;};}function removeEntity(_0x45835b,_0x4345e0){return function(_0x23fc0f){if(_0x23fc0f){return _0x23fc0f['destroy']()[_0xea30('0x27')](function(){var _0xf974=_0x23fc0f[_0xea30('0x28')]({'plain':!![]});var _0x2b7805=_0xea30('0x29');return db[_0xea30('0x2a')][_0xea30('0x2b')]({'where':{'type':_0x2b7805,'resourceId':_0xf974['id']}})['then'](function(){return _0x23fc0f;});})['then'](function(){_0x45835b[_0xea30('0x1d')](0xcc)[_0xea30('0x1e')]();});}};}function handleEntityNotFound(_0xdf66f0,_0x4e02df){return function(_0x203554){if(!_0x203554){_0xdf66f0[_0xea30('0x2c')](0x194);}return _0x203554;};}function handleError(_0x2b5b4c,_0x123402){_0x123402=_0x123402||0x1f4;return function(_0x4a256e){logger['error'](_0x4a256e[_0xea30('0x2d')]);if(_0x4a256e[_0xea30('0x2e')]){delete _0x4a256e[_0xea30('0x2e')];}_0x2b5b4c[_0xea30('0x1d')](_0x123402)[_0xea30('0x2f')](_0x4a256e);};}exports[_0xea30('0x30')]=function(_0x57d9bd,_0x321517){var _0xdcf47e={},_0x35292c={},_0x2e957a={'count':0x0,'rows':[]};var _0x43de29=db[_0xea30('0x31')][_0xea30('0x32')];_0x35292c[_0xea30('0x33')]=_[_0xea30('0x34')](_0x43de29);var _0x5b6ba9={'dateStart':_0x57d9bd['query'][_0xea30('0x35')],'dateEnd':_0x57d9bd[_0xea30('0x36')]['dateEnd']};delete _0x57d9bd['query'][_0xea30('0x35')];delete _0x57d9bd[_0xea30('0x36')][_0xea30('0x37')];_0x35292c[_0xea30('0x36')]=_[_0xea30('0x34')](_0x57d9bd['query']);_0x35292c[_0xea30('0x38')]=_[_0xea30('0x39')](_0x35292c[_0xea30('0x33')],_0x35292c[_0xea30('0x36')]);_0xdcf47e[_0xea30('0x3a')]=_['intersection'](_0x35292c['model'],qs[_0xea30('0x3b')](_0x57d9bd[_0xea30('0x36')][_0xea30('0x3b')]));_0xdcf47e[_0xea30('0x3a')]=_0xdcf47e[_0xea30('0x3a')][_0xea30('0x3c')]?_0xdcf47e[_0xea30('0x3a')]:_0x35292c[_0xea30('0x33')];if(!_0x57d9bd[_0xea30('0x36')][_0xea30('0x3d')](_0xea30('0x3e'))){_0xdcf47e[_0xea30('0x22')]=qs['limit'](_0x57d9bd[_0xea30('0x36')][_0xea30('0x22')]);_0xdcf47e[_0xea30('0x21')]=qs['offset'](_0x57d9bd['query'][_0xea30('0x21')]);}_0xdcf47e[_0xea30('0x3f')]=qs[_0xea30('0x40')](_0x57d9bd[_0xea30('0x36')][_0xea30('0x40')]);_0xdcf47e[_0xea30('0x41')]=qs['filters'](_['pick'](_0x57d9bd[_0xea30('0x36')],_0x35292c[_0xea30('0x38')]));if(_0x5b6ba9['dateStart']){if(_0x5b6ba9[_0xea30('0x37')]){_0x5b6ba9[_0xea30('0x37')]=moment(_0x5b6ba9[_0xea30('0x37')])['add'](0x1,_0xea30('0x42'));}else{_0x5b6ba9[_0xea30('0x37')]=moment(_0x5b6ba9[_0xea30('0x35')])[_0xea30('0x43')](0x1,_0xea30('0x42'));}_[_0xea30('0x44')](_0xdcf47e[_0xea30('0x41')],{'createdAt':{'$gte':_0x5b6ba9[_0xea30('0x35')],'$lte':_0x5b6ba9['dateEnd']}});}if(_0x57d9bd[_0xea30('0x36')][_0xea30('0x45')]){_0xdcf47e[_0xea30('0x41')]=_[_0xea30('0x44')](_0xdcf47e['where'],{'$or':_['map'](_0x43de29,function(_0x413b31){if(_0x413b31[_0xea30('0x46')]['key']!==_0xea30('0x47')){var _0x23f6d3={};_0x23f6d3[_0x413b31[_0xea30('0x48')]]={'$like':'%'+_0x57d9bd[_0xea30('0x36')][_0xea30('0x45')]+'%'};return _0x23f6d3;}})});}_0xdcf47e=_[_0xea30('0x44')]({},_0xdcf47e,_0x57d9bd[_0xea30('0x49')]);var _0x11bde9={'where':_0xdcf47e[_0xea30('0x41')]};return db['FaxQueue']['count'](_0x11bde9)[_0xea30('0x27')](function(_0x3e058c){_0x2e957a['count']=_0x3e058c;if(_0x57d9bd[_0xea30('0x36')][_0xea30('0x4a')]){_0xdcf47e[_0xea30('0x4b')]=[{'all':!![]}];}return db[_0xea30('0x31')][_0xea30('0x4c')](_0xdcf47e);})[_0xea30('0x27')](function(_0x34ae60){_0x2e957a[_0xea30('0x4d')]=_0x34ae60;return _0x2e957a;})[_0xea30('0x27')](respondWithFilteredResult(_0x321517,_0xdcf47e))[_0xea30('0x4e')](handleError(_0x321517,null));};exports[_0xea30('0x4f')]=function(_0x3f93c5,_0x1399fc){var _0x40bdef={'raw':!![],'where':{'id':_0x3f93c5[_0xea30('0x50')]['id']}},_0x55a3f7={};_0x55a3f7['model']=_['keys'](db[_0xea30('0x31')]['rawAttributes']);_0x55a3f7['query']=_[_0xea30('0x34')](_0x3f93c5['query']);_0x55a3f7[_0xea30('0x38')]=_[_0xea30('0x39')](_0x55a3f7[_0xea30('0x33')],_0x55a3f7[_0xea30('0x36')]);_0x40bdef['attributes']=_[_0xea30('0x39')](_0x55a3f7[_0xea30('0x33')],qs[_0xea30('0x3b')](_0x3f93c5[_0xea30('0x36')][_0xea30('0x3b')]));_0x40bdef[_0xea30('0x3a')]=_0x40bdef[_0xea30('0x3a')][_0xea30('0x3c')]?_0x40bdef[_0xea30('0x3a')]:_0x55a3f7[_0xea30('0x33')];if(_0x3f93c5[_0xea30('0x36')][_0xea30('0x4a')]){_0x40bdef['include']=[{'all':!![]}];}_0x40bdef=_['merge']({},_0x40bdef,_0x3f93c5[_0xea30('0x49')]);return db[_0xea30('0x31')][_0xea30('0x51')](_0x40bdef)['then'](handleEntityNotFound(_0x1399fc,null))[_0xea30('0x27')](respondWithResult(_0x1399fc,null))[_0xea30('0x4e')](handleError(_0x1399fc,null));};exports[_0xea30('0x52')]=function(_0x2111bf,_0x39b75f){return db[_0xea30('0x31')][_0xea30('0x52')](_0x2111bf[_0xea30('0x53')],{})[_0xea30('0x27')](function(_0x9780b6){var _0x519b20=_0x2111bf[_0xea30('0x54')]['get']({'plain':!![]});if(!_0x519b20)throw new Error(_0xea30('0x55'));if(_0x519b20[_0xea30('0x56')]==='user'){var _0x20dce6=_0x9780b6[_0xea30('0x28')]({'plain':!![]});var _0x377da4='FaxQueues';return db[_0xea30('0x57')][_0xea30('0x51')]({'where':{'name':_0x377da4,'userProfileId':_0x519b20['userProfileId']},'raw':!![]})[_0xea30('0x27')](function(_0x2a4bfb){if(_0x2a4bfb&&_0x2a4bfb[_0xea30('0x58')]===0x0){return db[_0xea30('0x2a')]['create']({'name':_0x20dce6[_0xea30('0x2e')],'resourceId':_0x20dce6['id'],'type':_0x2a4bfb[_0xea30('0x2e')],'sectionId':_0x2a4bfb['id']},{})['then'](function(){return _0x9780b6;});}else{return _0x9780b6;}})['catch'](function(_0x5db7a3){logger[_0xea30('0x59')](_0xea30('0x5a'),_0x5db7a3);throw _0x5db7a3;});}return _0x9780b6;})['then'](respondWithResult(_0x39b75f,0xc9))[_0xea30('0x4e')](handleError(_0x39b75f,null));};exports[_0xea30('0x5b')]=function(_0x303513,_0x523248){if(_0x303513[_0xea30('0x53')]['id']){delete _0x303513[_0xea30('0x53')]['id'];}return db[_0xea30('0x31')][_0xea30('0x51')]({'where':{'id':_0x303513['params']['id']}})['then'](handleEntityNotFound(_0x523248,null))[_0xea30('0x27')](saveUpdates(_0x303513['body'],null))[_0xea30('0x27')](respondWithResult(_0x523248,null))[_0xea30('0x4e')](handleError(_0x523248,null));};exports['destroy']=function(_0x9fdc7e,_0x32e5bb){return db[_0xea30('0x31')]['find']({'where':{'id':_0x9fdc7e[_0xea30('0x50')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x32e5bb,null))[_0xea30('0x27')](removeEntity(_0x32e5bb,null))[_0xea30('0x4e')](handleError(_0x32e5bb,null));};exports[_0xea30('0x5c')]=function(_0x5e17d7,_0x3af7bd){return db['FaxQueue'][_0xea30('0x5c')]()[_0xea30('0x27')](respondWithResult(_0x3af7bd,null))['catch'](handleError(_0x3af7bd,null));};exports[_0xea30('0x5d')]=function(_0x34d625,_0x19485e,_0x4ea130){var _0x474180={'raw':!![],'where':{}},_0x1fc9e9={},_0x149e53;return db[_0xea30('0x31')][_0xea30('0x5e')]({'where':{'id':_0x34d625['params']['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x19485e,null))[_0xea30('0x27')](function(_0xe72409){if(_0xe72409){_0x149e53=_0xe72409[_0xea30('0x28')]({'plain':!![]});_0x1fc9e9[_0xea30('0x33')]=_[_0xea30('0x34')](db[_0xea30('0x5f')][_0xea30('0x32')]);_0x1fc9e9[_0xea30('0x36')]=_[_0xea30('0x34')](_0x34d625[_0xea30('0x36')]);_0x1fc9e9[_0xea30('0x38')]=_[_0xea30('0x39')](_0x1fc9e9['model'],_0x1fc9e9[_0xea30('0x36')]);_0x474180[_0xea30('0x3a')]=_[_0xea30('0x39')](_0x1fc9e9[_0xea30('0x33')],qs['fields'](_0x34d625[_0xea30('0x36')]['fields']));_0x474180[_0xea30('0x3a')]=_0x474180[_0xea30('0x3a')][_0xea30('0x3c')]?_0x474180[_0xea30('0x3a')]:_0x1fc9e9['model'];if(!_0x34d625[_0xea30('0x36')][_0xea30('0x3d')](_0xea30('0x3e'))){_0x474180['limit']=qs['limit'](_0x34d625[_0xea30('0x36')]['limit']);_0x474180[_0xea30('0x21')]=qs[_0xea30('0x21')](_0x34d625[_0xea30('0x36')][_0xea30('0x21')]);}_0x474180[_0xea30('0x3f')]=qs['sort'](_0x34d625[_0xea30('0x36')][_0xea30('0x40')]);_0x474180[_0xea30('0x41')]=qs[_0xea30('0x38')](_[_0xea30('0x60')](_0x34d625['query'],_0x1fc9e9['filters']));_0x474180[_0xea30('0x41')]['FaxQueueId']=_0xe72409['id'];if(_0x34d625['query'][_0xea30('0x45')]){_0x474180[_0xea30('0x41')]=_[_0xea30('0x44')](_0x474180[_0xea30('0x41')],{'$or':_[_0xea30('0x61')](_0x474180['attributes'],function(_0x40e1c7){var _0x5f06f0={};_0x5f06f0[_0x40e1c7]={'$like':'%'+_0x34d625[_0xea30('0x36')][_0xea30('0x45')]+'%'};return _0x5f06f0;})});}_0x474180=_[_0xea30('0x44')]({},_0x474180,_0x34d625[_0xea30('0x49')]);return db[_0xea30('0x5f')][_0xea30('0x4c')](_0x474180);}})[_0xea30('0x27')](function(_0x41a776){if(_0x41a776){return db[_0xea30('0x62')]['findAndCountAll']({'where':{'id':_[_0xea30('0x61')](_0x41a776,_0xea30('0x63')),'role':_0xea30('0x64')},'attributes':['id','name','faxPause',_0xea30('0x65'),_0xea30('0x66')]});}})['then'](function(_0x51d1e5){if(_0x51d1e5){return{'count':_0x51d1e5[_0xea30('0x20')],'rows':_[_0xea30('0x61')](_0x51d1e5[_0xea30('0x4d')],function(_0x4b3851){return{'membername':_0x4b3851['name'],'UserId':_0x4b3851['id'],'queue_name':_0x149e53[_0xea30('0x2e')],'FaxQueueId':_0x149e53['id'],'interface':util[_0xea30('0x67')](_0xea30('0x68'),'SIP',_0x4b3851['name']),'penalty':0x0,'paused':_0x4b3851[_0xea30('0x69')],'createdAt':_0x4b3851['createdAt'],'updatedAt':_0x4b3851[_0xea30('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x19485e,_0x474180))[_0xea30('0x4e')](handleError(_0x19485e,null));};exports[_0xea30('0x6a')]=function(_0x993968,_0x1a0a1e,_0x13f0de){var _0x26c776={};var _0x3cf9c6={};var _0x53a3e6;var _0x2ed457;return db[_0xea30('0x31')]['findOne']({'where':{'id':_0x993968[_0xea30('0x50')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x1a0a1e,null))[_0xea30('0x27')](function(_0x980942){if(_0x980942){_0x53a3e6=_0x980942;_0x3cf9c6[_0xea30('0x33')]=_[_0xea30('0x34')](db[_0xea30('0x6b')]['rawAttributes']);_0x3cf9c6[_0xea30('0x36')]=_[_0xea30('0x34')](_0x993968[_0xea30('0x36')]);_0x3cf9c6[_0xea30('0x38')]=_[_0xea30('0x39')](_0x3cf9c6[_0xea30('0x33')],_0x3cf9c6[_0xea30('0x36')]);_0x26c776[_0xea30('0x3a')]=_[_0xea30('0x39')](_0x3cf9c6[_0xea30('0x33')],qs['fields'](_0x993968['query']['fields']));_0x26c776[_0xea30('0x3a')]=_0x26c776['attributes']['length']?_0x26c776[_0xea30('0x3a')]:_0x3cf9c6[_0xea30('0x33')];_0x26c776[_0xea30('0x3f')]=qs['sort'](_0x993968[_0xea30('0x36')][_0xea30('0x40')]);_0x26c776[_0xea30('0x41')]=qs[_0xea30('0x38')](_[_0xea30('0x60')](_0x993968['query'],_0x3cf9c6[_0xea30('0x38')]));if(_0x993968[_0xea30('0x36')][_0xea30('0x45')]){_0x26c776[_0xea30('0x41')]=_['merge'](_0x26c776['where'],{'$or':_[_0xea30('0x61')](_0x26c776['attributes'],function(_0x2aa77c){var _0x51ea27={};_0x51ea27[_0x2aa77c]={'$like':'%'+_0x993968[_0xea30('0x36')][_0xea30('0x45')]+'%'};return _0x51ea27;})});}_0x26c776=_[_0xea30('0x44')]({},_0x26c776,_0x993968[_0xea30('0x49')]);return _0x53a3e6['getTeams'](_0x26c776);}})['then'](function(_0x158343){if(_0x158343){_0x2ed457=_0x158343[_0xea30('0x3c')];if(!_0x993968[_0xea30('0x36')][_0xea30('0x3d')]('nolimit')){_0x26c776[_0xea30('0x22')]=qs[_0xea30('0x22')](_0x993968[_0xea30('0x36')][_0xea30('0x22')]);_0x26c776[_0xea30('0x21')]=qs[_0xea30('0x21')](_0x993968[_0xea30('0x36')][_0xea30('0x21')]);}return _0x53a3e6[_0xea30('0x6a')](_0x26c776);}})['then'](function(_0x11180a){if(_0x11180a){return _0x11180a?{'count':_0x2ed457,'rows':_0x11180a}:null;}})[_0xea30('0x27')](respondWithResult(_0x1a0a1e,null))['catch'](handleError(_0x1a0a1e,null));};exports['addTeams']=function(_0x4c4973,_0x181683,_0xc79d4c){var _0x21dedf=[];var _0x24c27a;return db[_0xea30('0x6b')]['findAll']({'where':{'id':_0x4c4973[_0xea30('0x53')][_0xea30('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xea30('0x62')],'as':_0xea30('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xea30('0x27')](function(_0x2f0e25){if(_0x2f0e25){for(var _0x21661e=0x0;_0x21661e<_0x2f0e25[_0xea30('0x3c')];_0x21661e+=0x1){for(var _0x7b8d3d=0x0;_0x7b8d3d<_0x2f0e25[_0x21661e][_0xea30('0x6d')][_0xea30('0x3c')];_0x7b8d3d+=0x1){_0x21dedf=_[_0xea30('0x6e')](_0x21dedf,[_0x2f0e25[_0x21661e][_0xea30('0x6d')][_0x7b8d3d]['id']]);}}return _0x21dedf;}})[_0xea30('0x27')](function(_0xc4a0c1){if(_0xc4a0c1){return db[_0xea30('0x31')]['find']({'where':{'id':_0x4c4973['params']['id']}});}})['then'](function(_0x2c6258){if(_0x2c6258){_0x24c27a=_0x2c6258;return _0x24c27a['addAgents'](_0x21dedf,{'penalty':_0x4c4973[_0xea30('0x53')][_0xea30('0x6f')]});}})[_0xea30('0x27')](function(_0x276d5b){if(_0x276d5b){return _0x24c27a['addTeams'](_0x4c4973[_0xea30('0x53')][_0xea30('0x6c')]);}})[_0xea30('0x27')](handleEntityNotFound(_0x181683,null))[_0xea30('0x27')](respondWithStatusCode(_0x181683,null))[_0xea30('0x4e')](handleError(_0x181683,null));};exports[_0xea30('0x70')]=function(_0x2c679e,_0x415817,_0x45c21a){var _0x13c60b=[];var _0x1ee471;return db[_0xea30('0x6b')]['findAll']({'where':{'id':_0x2c679e[_0xea30('0x36')][_0xea30('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xea30('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xea30('0x27')](function(_0x106b77){if(_0x106b77){for(var _0xa4f99f=0x0;_0xa4f99f<_0x106b77[_0xea30('0x3c')];_0xa4f99f+=0x1){for(var _0x211f25=0x0;_0x211f25<_0x106b77[_0xa4f99f][_0xea30('0x6d')]['length'];_0x211f25+=0x1){_0x13c60b=_[_0xea30('0x6e')](_0x13c60b,[_0x106b77[_0xa4f99f]['Agents'][_0x211f25]['id']]);}}return _0x13c60b;}})[_0xea30('0x27')](function(_0x1cb3df){if(_0x1cb3df){return db[_0xea30('0x31')]['find']({'where':{'id':_0x2c679e[_0xea30('0x50')]['id']}});}})['then'](function(_0x3825cd){if(_0x3825cd){_0x1ee471=_0x3825cd;return _0x1ee471[_0xea30('0x71')](_0x13c60b);}})[_0xea30('0x27')](function(_0x33cd1e){if(_0x1ee471){return _0x1ee471[_0xea30('0x70')](_0x2c679e[_0xea30('0x36')]['ids']);}})['then'](handleEntityNotFound(_0x415817,null))['then'](respondWithStatusCode(_0x415817,null))[_0xea30('0x4e')](handleError(_0x415817,null));};exports[_0xea30('0x72')]=function(_0x180c70,_0x4cd72f,_0x1f20a6){return db[_0xea30('0x31')][_0xea30('0x51')]({'where':{'id':_0x180c70[_0xea30('0x50')]['id']}})['then'](handleEntityNotFound(_0x4cd72f,null))[_0xea30('0x27')](function(_0x42e423){if(_0x42e423){return _0x42e423['addAgents'](_0x180c70[_0xea30('0x53')][_0xea30('0x6c')],_[_0xea30('0x73')](_0x180c70['body'],[_0xea30('0x6c'),'id'])||{})[_0xea30('0x74')](function(_0x4046ee){for(var _0x51aa75=0x0;_0x51aa75<_0x180c70[_0xea30('0x53')][_0xea30('0x6c')][_0xea30('0x3c')];_0x51aa75+=0x1){socket['emit']('userFaxQueue:save',{'UserId':_0x180c70[_0xea30('0x53')]['ids'][_0x51aa75],'FaxQueueId':_0x180c70['params']['id']});}return _0x4046ee;});}})[_0xea30('0x27')](respondWithResult(_0x4cd72f,null))['catch'](handleError(_0x4cd72f,null));};exports['removeAgents']=function(_0xba517f,_0x1ed192,_0x280f4c){var _0x372a1a;return db[_0xea30('0x31')]['find']({'where':{'id':_0xba517f[_0xea30('0x50')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x1ed192,null))[_0xea30('0x27')](function(_0x2cb828){if(_0x2cb828){return _0x2cb828['removeAgents'](_0xba517f[_0xea30('0x36')]['ids'])[_0xea30('0x27')](function(_0x23a939){if(_['isArray'](_0xba517f[_0xea30('0x36')][_0xea30('0x6c')])){for(var _0x4e1d48=0x0;_0x4e1d48<_0xba517f[_0xea30('0x36')][_0xea30('0x6c')]['length'];_0x4e1d48+=0x1){socket[_0xea30('0x75')](_0xea30('0x76'),{'UserId':_0xba517f[_0xea30('0x36')][_0xea30('0x6c')][_0x4e1d48],'FaxQueueId':_0xba517f[_0xea30('0x50')]['id']});}}else{socket[_0xea30('0x75')](_0xea30('0x76'),{'UserId':_0xba517f[_0xea30('0x36')][_0xea30('0x6c')],'FaxQueueId':_0xba517f[_0xea30('0x50')]['id']});}});}})['then'](respondWithStatusCode(_0x1ed192,null))['catch'](handleError(_0x1ed192,null));};exports['getAgents']=function(_0x51b1fc,_0x5ad356,_0x1bca81){var _0xb8af39={};var _0x5d07bf={};var _0x3d46ef;var _0x1d60b8;return db[_0xea30('0x31')][_0xea30('0x5e')]({'where':{'id':_0x51b1fc['params']['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x5ad356,null))['then'](function(_0x5b691c){if(_0x5b691c){_0x3d46ef=_0x5b691c;_0x5d07bf[_0xea30('0x33')]=_[_0xea30('0x34')](db[_0xea30('0x62')][_0xea30('0x32')]);_0x5d07bf[_0xea30('0x36')]=_[_0xea30('0x34')](_0x51b1fc[_0xea30('0x36')]);_0x5d07bf[_0xea30('0x38')]=_[_0xea30('0x39')](_0x5d07bf[_0xea30('0x33')],_0x5d07bf[_0xea30('0x36')]);_0xb8af39[_0xea30('0x3a')]=_[_0xea30('0x39')](_0x5d07bf[_0xea30('0x33')],qs['fields'](_0x51b1fc[_0xea30('0x36')]['fields']));_0xb8af39['attributes']=_0xb8af39[_0xea30('0x3a')]['length']?_0xb8af39['attributes']:_0x5d07bf[_0xea30('0x33')];_0xb8af39[_0xea30('0x3f')]=qs['sort'](_0x51b1fc[_0xea30('0x36')][_0xea30('0x40')]);_0xb8af39[_0xea30('0x41')]=qs[_0xea30('0x38')](_[_0xea30('0x60')](_0x51b1fc[_0xea30('0x36')],_0x5d07bf[_0xea30('0x38')]));if(_0x51b1fc[_0xea30('0x36')][_0xea30('0x45')]){_0xb8af39[_0xea30('0x41')]=_[_0xea30('0x44')](_0xb8af39['where'],{'$or':_['map'](_0xb8af39[_0xea30('0x3a')],function(_0x12d069){var _0x47ce97={};_0x47ce97[_0x12d069]={'$like':'%'+_0x51b1fc['query'][_0xea30('0x45')]+'%'};return _0x47ce97;})});}_0xb8af39=_[_0xea30('0x44')]({},_0xb8af39,_0x51b1fc[_0xea30('0x49')]);return _0x3d46ef[_0xea30('0x77')](_0xb8af39);}})[_0xea30('0x27')](function(_0x556f89){if(_0x556f89){_0x1d60b8=_0x556f89[_0xea30('0x3c')];if(!_0x51b1fc[_0xea30('0x36')][_0xea30('0x3d')](_0xea30('0x3e'))){_0xb8af39[_0xea30('0x22')]=qs[_0xea30('0x22')](_0x51b1fc['query'][_0xea30('0x22')]);_0xb8af39['offset']=qs['offset'](_0x51b1fc[_0xea30('0x36')]['offset']);}return _0x3d46ef[_0xea30('0x77')](_0xb8af39);}})['then'](function(_0x34ffe5){if(_0x34ffe5){return _0x34ffe5?{'count':_0x1d60b8,'rows':_0x34ffe5}:null;}})[_0xea30('0x27')](respondWithResult(_0x5ad356,null))[_0xea30('0x4e')](handleError(_0x5ad356,null));};
\ No newline at end of file
+var _0xb7d1=['findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','rawAttributes','model','keys','query','dateEnd','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','dateStart','add','day','merge','filter','map','type','key','VIRTUAL','options','FaxQueue','includeAll','rows','catch','show','params','fields','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','FaxQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','UserFaxQueue','findAll','User','UserId','agent','updatedAt','createdAt','format','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','union','addAgents','penalty','removeTeams','omit','spread','emit','userFaxQueue:save','removeAgents','isArray','userFaxQueue:remove','getAgents'];(function(_0x45d2d9,_0x431d6f){var _0x439724=function(_0x5aa62c){while(--_0x5aa62c){_0x45d2d9['push'](_0x45d2d9['shift']());}};_0x439724(++_0x431d6f);}(_0xb7d1,0x79));var _0x1b7d=function(_0x597e53,_0x4c6b1b){_0x597e53=_0x597e53-0x0;var _0x2630f7=_0xb7d1[_0x597e53];return _0x2630f7;};'use strict';var pdf=require(_0x1b7d('0x0'));var emlformat=require(_0x1b7d('0x1'));var rimraf=require(_0x1b7d('0x2'));var zipdir=require(_0x1b7d('0x3'));var jsonpatch=require(_0x1b7d('0x4'));var rp=require(_0x1b7d('0x5'));var moment=require('moment');var BPromise=require(_0x1b7d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1b7d('0x7'));var ejs=require(_0x1b7d('0x8'));var fs=require('fs');var _=require(_0x1b7d('0x9'));var squel=require(_0x1b7d('0xa'));var crypto=require(_0x1b7d('0xb'));var jsforce=require(_0x1b7d('0xc'));var deskjs=require(_0x1b7d('0xd'));var toCsv=require(_0x1b7d('0x7'));var querystring=require(_0x1b7d('0xe'));var Papa=require(_0x1b7d('0xf'));var Redis=require('ioredis');var qs=require(_0x1b7d('0x10'));var logger=require(_0x1b7d('0x11'))(_0x1b7d('0x12'));var utils=require(_0x1b7d('0x13'));var config=require(_0x1b7d('0x14'));var db=require(_0x1b7d('0x15'))['db'];config[_0x1b7d('0x16')]=_[_0x1b7d('0x17')](config[_0x1b7d('0x16')],{'host':_0x1b7d('0x18'),'port':0x18eb});var socket=require(_0x1b7d('0x19'))(new Redis(config[_0x1b7d('0x16')]));require(_0x1b7d('0x1a'))['register'](socket);function respondWithStatusCode(_0x3d0bad,_0x381865){_0x381865=_0x381865||0xcc;return function(_0x2c5bfc){if(_0x2c5bfc){return _0x3d0bad[_0x1b7d('0x1b')](_0x381865);}return _0x3d0bad['status'](_0x381865)[_0x1b7d('0x1c')]();};}function respondWithResult(_0xfdd912,_0xc60e2a){_0xc60e2a=_0xc60e2a||0xc8;return function(_0x15ed67){if(_0x15ed67){return _0xfdd912[_0x1b7d('0x1d')](_0xc60e2a)['json'](_0x15ed67);}};}function respondWithFilteredResult(_0x26ad2e,_0x82c937){return function(_0x42d207){if(_0x42d207){var _0x4cb184=_0x42d207[_0x1b7d('0x1e')],_0x395201=_0x82c937[_0x1b7d('0x1f')],_0x1eede2=_0x82c937[_0x1b7d('0x1f')]+_0x82c937[_0x1b7d('0x20')],_0x37979a;if(_0x1eede2>=_0x4cb184){_0x1eede2=_0x4cb184;_0x37979a=0xc8;}else{_0x37979a=0xce;}_0x26ad2e[_0x1b7d('0x1d')](_0x37979a);return _0x26ad2e[_0x1b7d('0x21')](_0x1b7d('0x22'),_0x395201+'-'+_0x1eede2+'/'+_0x4cb184)['json'](_0x42d207);}return null;};}function patchUpdates(_0x1e4fb9){return function(_0x59c132){try{jsonpatch[_0x1b7d('0x23')](_0x59c132,_0x1e4fb9,!![]);}catch(_0x4ab940){return BPromise[_0x1b7d('0x24')](_0x4ab940);}return _0x59c132[_0x1b7d('0x25')]();};}function saveUpdates(_0x4e2283,_0x2e2f99){return function(_0x416174){if(_0x416174){return _0x416174[_0x1b7d('0x26')](_0x4e2283)[_0x1b7d('0x27')](function(_0xbeb7b1){return _0xbeb7b1;});}return null;};}function removeEntity(_0x4c6a88,_0x56d557){return function(_0x2418c2){if(_0x2418c2){return _0x2418c2[_0x1b7d('0x28')]()[_0x1b7d('0x27')](function(){var _0x3a3374=_0x2418c2[_0x1b7d('0x29')]({'plain':!![]});var _0x175d3c='FaxQueues';return db[_0x1b7d('0x2a')]['destroy']({'where':{'type':_0x175d3c,'resourceId':_0x3a3374['id']}})[_0x1b7d('0x27')](function(){return _0x2418c2;});})[_0x1b7d('0x27')](function(){_0x4c6a88['status'](0xcc)[_0x1b7d('0x1c')]();});}};}function handleEntityNotFound(_0x5b3c8a,_0x2d7435){return function(_0x3fca24){if(!_0x3fca24){_0x5b3c8a[_0x1b7d('0x1b')](0x194);}return _0x3fca24;};}function handleError(_0xe990e1,_0x1ba771){_0x1ba771=_0x1ba771||0x1f4;return function(_0x471ce4){logger['error'](_0x471ce4[_0x1b7d('0x2b')]);if(_0x471ce4['name']){delete _0x471ce4[_0x1b7d('0x2c')];}_0xe990e1['status'](_0x1ba771)[_0x1b7d('0x2d')](_0x471ce4);};}exports[_0x1b7d('0x2e')]=function(_0x4b3434,_0x2b4846){var _0x50a1e5={},_0x1211b9={},_0x3fe653={'count':0x0,'rows':[]};var _0x3aea9a=db['FaxQueue'][_0x1b7d('0x2f')];_0x1211b9[_0x1b7d('0x30')]=_[_0x1b7d('0x31')](_0x3aea9a);var _0x5607fd={'dateStart':_0x4b3434[_0x1b7d('0x32')]['dateStart'],'dateEnd':_0x4b3434[_0x1b7d('0x32')][_0x1b7d('0x33')]};delete _0x4b3434[_0x1b7d('0x32')]['dateStart'];delete _0x4b3434['query']['dateEnd'];_0x1211b9[_0x1b7d('0x32')]=_[_0x1b7d('0x31')](_0x4b3434[_0x1b7d('0x32')]);_0x1211b9[_0x1b7d('0x34')]=_[_0x1b7d('0x35')](_0x1211b9['model'],_0x1211b9[_0x1b7d('0x32')]);_0x50a1e5[_0x1b7d('0x36')]=_[_0x1b7d('0x35')](_0x1211b9['model'],qs['fields'](_0x4b3434[_0x1b7d('0x32')]['fields']));_0x50a1e5['attributes']=_0x50a1e5['attributes'][_0x1b7d('0x37')]?_0x50a1e5[_0x1b7d('0x36')]:_0x1211b9[_0x1b7d('0x30')];if(!_0x4b3434[_0x1b7d('0x32')][_0x1b7d('0x38')](_0x1b7d('0x39'))){_0x50a1e5[_0x1b7d('0x20')]=qs[_0x1b7d('0x20')](_0x4b3434['query'][_0x1b7d('0x20')]);_0x50a1e5['offset']=qs[_0x1b7d('0x1f')](_0x4b3434[_0x1b7d('0x32')][_0x1b7d('0x1f')]);}_0x50a1e5[_0x1b7d('0x3a')]=qs['sort'](_0x4b3434[_0x1b7d('0x32')][_0x1b7d('0x3b')]);_0x50a1e5[_0x1b7d('0x3c')]=qs['filters'](_[_0x1b7d('0x3d')](_0x4b3434[_0x1b7d('0x32')],_0x1211b9['filters']));if(_0x5607fd[_0x1b7d('0x3e')]){if(_0x5607fd[_0x1b7d('0x33')]){_0x5607fd[_0x1b7d('0x33')]=moment(_0x5607fd[_0x1b7d('0x33')])[_0x1b7d('0x3f')](0x1,_0x1b7d('0x40'));}else{_0x5607fd[_0x1b7d('0x33')]=moment(_0x5607fd[_0x1b7d('0x3e')])[_0x1b7d('0x3f')](0x1,_0x1b7d('0x40'));}_[_0x1b7d('0x41')](_0x50a1e5[_0x1b7d('0x3c')],{'createdAt':{'$gte':_0x5607fd['dateStart'],'$lte':_0x5607fd[_0x1b7d('0x33')]}});}if(_0x4b3434[_0x1b7d('0x32')][_0x1b7d('0x42')]){_0x50a1e5[_0x1b7d('0x3c')]=_['merge'](_0x50a1e5[_0x1b7d('0x3c')],{'$or':_[_0x1b7d('0x43')](_0x3aea9a,function(_0x5ec043){if(_0x5ec043[_0x1b7d('0x44')][_0x1b7d('0x45')]!==_0x1b7d('0x46')){var _0x557616={};_0x557616[_0x5ec043['field']]={'$like':'%'+_0x4b3434[_0x1b7d('0x32')]['filter']+'%'};return _0x557616;}})});}_0x50a1e5=_[_0x1b7d('0x41')]({},_0x50a1e5,_0x4b3434[_0x1b7d('0x47')]);var _0x2fa759={'where':_0x50a1e5[_0x1b7d('0x3c')]};return db[_0x1b7d('0x48')][_0x1b7d('0x1e')](_0x2fa759)['then'](function(_0xadf092){_0x3fe653[_0x1b7d('0x1e')]=_0xadf092;if(_0x4b3434[_0x1b7d('0x32')][_0x1b7d('0x49')]){_0x50a1e5['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x50a1e5);})['then'](function(_0x2a7f30){_0x3fe653[_0x1b7d('0x4a')]=_0x2a7f30;return _0x3fe653;})['then'](respondWithFilteredResult(_0x2b4846,_0x50a1e5))[_0x1b7d('0x4b')](handleError(_0x2b4846,null));};exports[_0x1b7d('0x4c')]=function(_0x5943d2,_0x3ba700){var _0x45c59f={'raw':!![],'where':{'id':_0x5943d2[_0x1b7d('0x4d')]['id']}},_0x477a12={};_0x477a12['model']=_[_0x1b7d('0x31')](db['FaxQueue'][_0x1b7d('0x2f')]);_0x477a12['query']=_[_0x1b7d('0x31')](_0x5943d2[_0x1b7d('0x32')]);_0x477a12['filters']=_[_0x1b7d('0x35')](_0x477a12['model'],_0x477a12[_0x1b7d('0x32')]);_0x45c59f['attributes']=_['intersection'](_0x477a12[_0x1b7d('0x30')],qs[_0x1b7d('0x4e')](_0x5943d2['query'][_0x1b7d('0x4e')]));_0x45c59f['attributes']=_0x45c59f['attributes'][_0x1b7d('0x37')]?_0x45c59f[_0x1b7d('0x36')]:_0x477a12[_0x1b7d('0x30')];if(_0x5943d2[_0x1b7d('0x32')][_0x1b7d('0x49')]){_0x45c59f[_0x1b7d('0x4f')]=[{'all':!![]}];}_0x45c59f=_[_0x1b7d('0x41')]({},_0x45c59f,_0x5943d2[_0x1b7d('0x47')]);return db['FaxQueue']['find'](_0x45c59f)[_0x1b7d('0x27')](handleEntityNotFound(_0x3ba700,null))[_0x1b7d('0x27')](respondWithResult(_0x3ba700,null))['catch'](handleError(_0x3ba700,null));};exports[_0x1b7d('0x50')]=function(_0x1fa1ca,_0x80338c){return db[_0x1b7d('0x48')][_0x1b7d('0x50')](_0x1fa1ca[_0x1b7d('0x51')],{})[_0x1b7d('0x27')](function(_0x3b501e){var _0x1b6559=_0x1fa1ca['user'][_0x1b7d('0x29')]({'plain':!![]});if(!_0x1b6559)throw new Error(_0x1b7d('0x52'));if(_0x1b6559['role']===_0x1b7d('0x53')){var _0x1028bc=_0x3b501e['get']({'plain':!![]});var _0xf8dd95=_0x1b7d('0x54');return db[_0x1b7d('0x55')]['find']({'where':{'name':_0xf8dd95,'userProfileId':_0x1b6559[_0x1b7d('0x56')]},'raw':!![]})[_0x1b7d('0x27')](function(_0x84a3d8){if(_0x84a3d8&&_0x84a3d8[_0x1b7d('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x1028bc[_0x1b7d('0x2c')],'resourceId':_0x1028bc['id'],'type':_0x84a3d8['name'],'sectionId':_0x84a3d8['id']},{})[_0x1b7d('0x27')](function(){return _0x3b501e;});}else{return _0x3b501e;}})[_0x1b7d('0x4b')](function(_0x5f4e82){logger['error'](_0x1b7d('0x58'),_0x5f4e82);throw _0x5f4e82;});}return _0x3b501e;})[_0x1b7d('0x27')](respondWithResult(_0x80338c,0xc9))[_0x1b7d('0x4b')](handleError(_0x80338c,null));};exports[_0x1b7d('0x26')]=function(_0x524adb,_0x397c20){if(_0x524adb['body']['id']){delete _0x524adb[_0x1b7d('0x51')]['id'];}return db[_0x1b7d('0x48')]['find']({'where':{'id':_0x524adb[_0x1b7d('0x4d')]['id']}})[_0x1b7d('0x27')](handleEntityNotFound(_0x397c20,null))[_0x1b7d('0x27')](saveUpdates(_0x524adb[_0x1b7d('0x51')],null))[_0x1b7d('0x27')](respondWithResult(_0x397c20,null))[_0x1b7d('0x4b')](handleError(_0x397c20,null));};exports[_0x1b7d('0x28')]=function(_0x356c8c,_0x3f9c6e){return db[_0x1b7d('0x48')][_0x1b7d('0x59')]({'where':{'id':_0x356c8c['params']['id']}})['then'](handleEntityNotFound(_0x3f9c6e,null))[_0x1b7d('0x27')](removeEntity(_0x3f9c6e,null))[_0x1b7d('0x4b')](handleError(_0x3f9c6e,null));};exports[_0x1b7d('0x5a')]=function(_0x414e17,_0x1f5fa9){return db[_0x1b7d('0x48')]['describe']()[_0x1b7d('0x27')](respondWithResult(_0x1f5fa9,null))[_0x1b7d('0x4b')](handleError(_0x1f5fa9,null));};exports[_0x1b7d('0x5b')]=function(_0x38f4f4,_0x29a74a,_0x2b9a84){var _0x30c884={'raw':!![],'where':{}},_0x2adf72={},_0x3b683d;return db['FaxQueue']['findOne']({'where':{'id':_0x38f4f4[_0x1b7d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29a74a,null))['then'](function(_0x1b6f52){if(_0x1b6f52){_0x3b683d=_0x1b6f52[_0x1b7d('0x29')]({'plain':!![]});_0x2adf72[_0x1b7d('0x30')]=_['keys'](db['UserFaxQueue'][_0x1b7d('0x2f')]);_0x2adf72[_0x1b7d('0x32')]=_[_0x1b7d('0x31')](_0x38f4f4[_0x1b7d('0x32')]);_0x2adf72[_0x1b7d('0x34')]=_[_0x1b7d('0x35')](_0x2adf72[_0x1b7d('0x30')],_0x2adf72[_0x1b7d('0x32')]);_0x30c884[_0x1b7d('0x36')]=_[_0x1b7d('0x35')](_0x2adf72[_0x1b7d('0x30')],qs[_0x1b7d('0x4e')](_0x38f4f4[_0x1b7d('0x32')][_0x1b7d('0x4e')]));_0x30c884[_0x1b7d('0x36')]=_0x30c884[_0x1b7d('0x36')][_0x1b7d('0x37')]?_0x30c884['attributes']:_0x2adf72[_0x1b7d('0x30')];if(!_0x38f4f4[_0x1b7d('0x32')][_0x1b7d('0x38')](_0x1b7d('0x39'))){_0x30c884[_0x1b7d('0x20')]=qs['limit'](_0x38f4f4[_0x1b7d('0x32')][_0x1b7d('0x20')]);_0x30c884[_0x1b7d('0x1f')]=qs['offset'](_0x38f4f4[_0x1b7d('0x32')][_0x1b7d('0x1f')]);}_0x30c884[_0x1b7d('0x3a')]=qs[_0x1b7d('0x3b')](_0x38f4f4[_0x1b7d('0x32')][_0x1b7d('0x3b')]);_0x30c884[_0x1b7d('0x3c')]=qs['filters'](_['pick'](_0x38f4f4[_0x1b7d('0x32')],_0x2adf72[_0x1b7d('0x34')]));_0x30c884[_0x1b7d('0x3c')]['FaxQueueId']=_0x1b6f52['id'];if(_0x38f4f4[_0x1b7d('0x32')][_0x1b7d('0x42')]){_0x30c884[_0x1b7d('0x3c')]=_[_0x1b7d('0x41')](_0x30c884[_0x1b7d('0x3c')],{'$or':_[_0x1b7d('0x43')](_0x30c884['attributes'],function(_0xb821aa){var _0x328692={};_0x328692[_0xb821aa]={'$like':'%'+_0x38f4f4[_0x1b7d('0x32')][_0x1b7d('0x42')]+'%'};return _0x328692;})});}_0x30c884=_[_0x1b7d('0x41')]({},_0x30c884,_0x38f4f4['options']);return db[_0x1b7d('0x5c')][_0x1b7d('0x5d')](_0x30c884);}})['then'](function(_0x156fa6){if(_0x156fa6){return db[_0x1b7d('0x5e')]['findAndCountAll']({'where':{'id':_[_0x1b7d('0x43')](_0x156fa6,_0x1b7d('0x5f')),'role':_0x1b7d('0x60')},'attributes':['id',_0x1b7d('0x2c'),'faxPause',_0x1b7d('0x61'),_0x1b7d('0x62')]});}})['then'](function(_0x1058f7){if(_0x1058f7){return{'count':_0x1058f7[_0x1b7d('0x1e')],'rows':_[_0x1b7d('0x43')](_0x1058f7['rows'],function(_0x369ecd){return{'membername':_0x369ecd['name'],'UserId':_0x369ecd['id'],'queue_name':_0x3b683d[_0x1b7d('0x2c')],'FaxQueueId':_0x3b683d['id'],'interface':util[_0x1b7d('0x63')]('%s/%s',_0x1b7d('0x64'),_0x369ecd[_0x1b7d('0x2c')]),'penalty':0x0,'paused':_0x369ecd[_0x1b7d('0x65')],'createdAt':_0x369ecd[_0x1b7d('0x62')],'updatedAt':_0x369ecd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1b7d('0x27')](respondWithFilteredResult(_0x29a74a,_0x30c884))['catch'](handleError(_0x29a74a,null));};exports[_0x1b7d('0x66')]=function(_0x486071,_0x2e714e,_0x24447b){var _0xa0b525={};var _0x4c3863={};var _0x284017;var _0x3097bd;return db[_0x1b7d('0x48')]['findOne']({'where':{'id':_0x486071[_0x1b7d('0x4d')]['id']}})[_0x1b7d('0x27')](handleEntityNotFound(_0x2e714e,null))[_0x1b7d('0x27')](function(_0x105027){if(_0x105027){_0x284017=_0x105027;_0x4c3863[_0x1b7d('0x30')]=_[_0x1b7d('0x31')](db[_0x1b7d('0x67')][_0x1b7d('0x2f')]);_0x4c3863[_0x1b7d('0x32')]=_['keys'](_0x486071['query']);_0x4c3863[_0x1b7d('0x34')]=_[_0x1b7d('0x35')](_0x4c3863['model'],_0x4c3863['query']);_0xa0b525[_0x1b7d('0x36')]=_[_0x1b7d('0x35')](_0x4c3863[_0x1b7d('0x30')],qs[_0x1b7d('0x4e')](_0x486071[_0x1b7d('0x32')][_0x1b7d('0x4e')]));_0xa0b525[_0x1b7d('0x36')]=_0xa0b525[_0x1b7d('0x36')]['length']?_0xa0b525[_0x1b7d('0x36')]:_0x4c3863[_0x1b7d('0x30')];_0xa0b525[_0x1b7d('0x3a')]=qs[_0x1b7d('0x3b')](_0x486071[_0x1b7d('0x32')]['sort']);_0xa0b525[_0x1b7d('0x3c')]=qs[_0x1b7d('0x34')](_['pick'](_0x486071[_0x1b7d('0x32')],_0x4c3863[_0x1b7d('0x34')]));if(_0x486071[_0x1b7d('0x32')]['filter']){_0xa0b525[_0x1b7d('0x3c')]=_['merge'](_0xa0b525[_0x1b7d('0x3c')],{'$or':_[_0x1b7d('0x43')](_0xa0b525['attributes'],function(_0x52f124){var _0x1537fe={};_0x1537fe[_0x52f124]={'$like':'%'+_0x486071[_0x1b7d('0x32')][_0x1b7d('0x42')]+'%'};return _0x1537fe;})});}_0xa0b525=_[_0x1b7d('0x41')]({},_0xa0b525,_0x486071[_0x1b7d('0x47')]);return _0x284017[_0x1b7d('0x66')](_0xa0b525);}})[_0x1b7d('0x27')](function(_0xf16279){if(_0xf16279){_0x3097bd=_0xf16279[_0x1b7d('0x37')];if(!_0x486071['query'][_0x1b7d('0x38')]('nolimit')){_0xa0b525[_0x1b7d('0x20')]=qs[_0x1b7d('0x20')](_0x486071[_0x1b7d('0x32')][_0x1b7d('0x20')]);_0xa0b525[_0x1b7d('0x1f')]=qs[_0x1b7d('0x1f')](_0x486071[_0x1b7d('0x32')]['offset']);}return _0x284017['getTeams'](_0xa0b525);}})[_0x1b7d('0x27')](function(_0x20fbd3){if(_0x20fbd3){return _0x20fbd3?{'count':_0x3097bd,'rows':_0x20fbd3}:null;}})[_0x1b7d('0x27')](respondWithResult(_0x2e714e,null))[_0x1b7d('0x4b')](handleError(_0x2e714e,null));};exports[_0x1b7d('0x68')]=function(_0x22b807,_0x561799,_0x36992a){var _0xefa3fd=[];var _0x375842;return db[_0x1b7d('0x67')][_0x1b7d('0x5d')]({'where':{'id':_0x22b807[_0x1b7d('0x51')][_0x1b7d('0x69')]},'attributes':['id'],'include':[{'model':db[_0x1b7d('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](function(_0x146327){if(_0x146327){for(var _0x16f885=0x0;_0x16f885<_0x146327[_0x1b7d('0x37')];_0x16f885+=0x1){for(var _0x563486=0x0;_0x563486<_0x146327[_0x16f885][_0x1b7d('0x6a')][_0x1b7d('0x37')];_0x563486+=0x1){_0xefa3fd=_[_0x1b7d('0x6b')](_0xefa3fd,[_0x146327[_0x16f885][_0x1b7d('0x6a')][_0x563486]['id']]);}}return _0xefa3fd;}})[_0x1b7d('0x27')](function(_0x5cd911){if(_0x5cd911){return db[_0x1b7d('0x48')]['find']({'where':{'id':_0x22b807[_0x1b7d('0x4d')]['id']}});}})['then'](function(_0x49817f){if(_0x49817f){_0x375842=_0x49817f;return _0x375842[_0x1b7d('0x6c')](_0xefa3fd,{'penalty':_0x22b807['body'][_0x1b7d('0x6d')]});}})['then'](function(_0x2c200f){if(_0x2c200f){return _0x375842[_0x1b7d('0x68')](_0x22b807[_0x1b7d('0x51')]['ids']);}})[_0x1b7d('0x27')](handleEntityNotFound(_0x561799,null))[_0x1b7d('0x27')](respondWithStatusCode(_0x561799,null))['catch'](handleError(_0x561799,null));};exports['removeTeams']=function(_0x318f1,_0x16bb02,_0x3e34fe){var _0x361681=[];var _0x27059e;return db[_0x1b7d('0x67')][_0x1b7d('0x5d')]({'where':{'id':_0x318f1[_0x1b7d('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1b7d('0x5e')],'as':_0x1b7d('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x1b7d('0x27')](function(_0x4f92f3){if(_0x4f92f3){for(var _0x556edb=0x0;_0x556edb<_0x4f92f3[_0x1b7d('0x37')];_0x556edb+=0x1){for(var _0x43d674=0x0;_0x43d674<_0x4f92f3[_0x556edb][_0x1b7d('0x6a')][_0x1b7d('0x37')];_0x43d674+=0x1){_0x361681=_['union'](_0x361681,[_0x4f92f3[_0x556edb][_0x1b7d('0x6a')][_0x43d674]['id']]);}}return _0x361681;}})[_0x1b7d('0x27')](function(_0x520c6e){if(_0x520c6e){return db[_0x1b7d('0x48')][_0x1b7d('0x59')]({'where':{'id':_0x318f1[_0x1b7d('0x4d')]['id']}});}})[_0x1b7d('0x27')](function(_0x189a91){if(_0x189a91){_0x27059e=_0x189a91;return _0x27059e['removeAgents'](_0x361681);}})[_0x1b7d('0x27')](function(_0x1f7737){if(_0x27059e){return _0x27059e[_0x1b7d('0x6e')](_0x318f1[_0x1b7d('0x32')][_0x1b7d('0x69')]);}})[_0x1b7d('0x27')](handleEntityNotFound(_0x16bb02,null))[_0x1b7d('0x27')](respondWithStatusCode(_0x16bb02,null))[_0x1b7d('0x4b')](handleError(_0x16bb02,null));};exports['addAgents']=function(_0x2bbdb4,_0x517a9b,_0x4db381){return db[_0x1b7d('0x48')][_0x1b7d('0x59')]({'where':{'id':_0x2bbdb4[_0x1b7d('0x4d')]['id']}})[_0x1b7d('0x27')](handleEntityNotFound(_0x517a9b,null))['then'](function(_0x40377b){if(_0x40377b){return _0x40377b[_0x1b7d('0x6c')](_0x2bbdb4['body']['ids'],_[_0x1b7d('0x6f')](_0x2bbdb4['body'],[_0x1b7d('0x69'),'id'])||{})[_0x1b7d('0x70')](function(_0x2d0249){for(var _0x1a03f8=0x0;_0x1a03f8<_0x2bbdb4[_0x1b7d('0x51')][_0x1b7d('0x69')][_0x1b7d('0x37')];_0x1a03f8+=0x1){socket[_0x1b7d('0x71')](_0x1b7d('0x72'),{'UserId':_0x2bbdb4[_0x1b7d('0x51')][_0x1b7d('0x69')][_0x1a03f8],'FaxQueueId':_0x2bbdb4[_0x1b7d('0x4d')]['id']});}return _0x2d0249;});}})[_0x1b7d('0x27')](respondWithResult(_0x517a9b,null))[_0x1b7d('0x4b')](handleError(_0x517a9b,null));};exports[_0x1b7d('0x73')]=function(_0x48f55e,_0x3cfa01,_0x10494c){var _0x177f25;return db[_0x1b7d('0x48')][_0x1b7d('0x59')]({'where':{'id':_0x48f55e[_0x1b7d('0x4d')]['id']}})[_0x1b7d('0x27')](handleEntityNotFound(_0x3cfa01,null))[_0x1b7d('0x27')](function(_0x1b5c3d){if(_0x1b5c3d){return _0x1b5c3d[_0x1b7d('0x73')](_0x48f55e[_0x1b7d('0x32')][_0x1b7d('0x69')])[_0x1b7d('0x27')](function(_0x34e58d){if(_[_0x1b7d('0x74')](_0x48f55e['query']['ids'])){for(var _0x31bf37=0x0;_0x31bf37<_0x48f55e[_0x1b7d('0x32')][_0x1b7d('0x69')][_0x1b7d('0x37')];_0x31bf37+=0x1){socket[_0x1b7d('0x71')]('userFaxQueue:remove',{'UserId':_0x48f55e[_0x1b7d('0x32')][_0x1b7d('0x69')][_0x31bf37],'FaxQueueId':_0x48f55e[_0x1b7d('0x4d')]['id']});}}else{socket[_0x1b7d('0x71')](_0x1b7d('0x75'),{'UserId':_0x48f55e[_0x1b7d('0x32')]['ids'],'FaxQueueId':_0x48f55e[_0x1b7d('0x4d')]['id']});}});}})[_0x1b7d('0x27')](respondWithStatusCode(_0x3cfa01,null))[_0x1b7d('0x4b')](handleError(_0x3cfa01,null));};exports[_0x1b7d('0x76')]=function(_0x4a8d87,_0x51cf04,_0x35f159){var _0x452ccf={};var _0xf90dc1={};var _0x40a7c7;var _0x4f47c7;return db[_0x1b7d('0x48')][_0x1b7d('0x77')]({'where':{'id':_0x4a8d87[_0x1b7d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x51cf04,null))[_0x1b7d('0x27')](function(_0x1f26fc){if(_0x1f26fc){_0x40a7c7=_0x1f26fc;_0xf90dc1[_0x1b7d('0x30')]=_['keys'](db[_0x1b7d('0x5e')][_0x1b7d('0x2f')]);_0xf90dc1[_0x1b7d('0x32')]=_[_0x1b7d('0x31')](_0x4a8d87[_0x1b7d('0x32')]);_0xf90dc1[_0x1b7d('0x34')]=_[_0x1b7d('0x35')](_0xf90dc1[_0x1b7d('0x30')],_0xf90dc1[_0x1b7d('0x32')]);_0x452ccf[_0x1b7d('0x36')]=_[_0x1b7d('0x35')](_0xf90dc1[_0x1b7d('0x30')],qs[_0x1b7d('0x4e')](_0x4a8d87[_0x1b7d('0x32')][_0x1b7d('0x4e')]));_0x452ccf[_0x1b7d('0x36')]=_0x452ccf['attributes'][_0x1b7d('0x37')]?_0x452ccf[_0x1b7d('0x36')]:_0xf90dc1[_0x1b7d('0x30')];_0x452ccf[_0x1b7d('0x3a')]=qs[_0x1b7d('0x3b')](_0x4a8d87[_0x1b7d('0x32')][_0x1b7d('0x3b')]);_0x452ccf['where']=qs[_0x1b7d('0x34')](_[_0x1b7d('0x3d')](_0x4a8d87[_0x1b7d('0x32')],_0xf90dc1[_0x1b7d('0x34')]));if(_0x4a8d87[_0x1b7d('0x32')][_0x1b7d('0x42')]){_0x452ccf['where']=_[_0x1b7d('0x41')](_0x452ccf[_0x1b7d('0x3c')],{'$or':_[_0x1b7d('0x43')](_0x452ccf[_0x1b7d('0x36')],function(_0x509c9e){var _0x58b650={};_0x58b650[_0x509c9e]={'$like':'%'+_0x4a8d87[_0x1b7d('0x32')][_0x1b7d('0x42')]+'%'};return _0x58b650;})});}_0x452ccf=_[_0x1b7d('0x41')]({},_0x452ccf,_0x4a8d87[_0x1b7d('0x47')]);return _0x40a7c7['getAgents'](_0x452ccf);}})[_0x1b7d('0x27')](function(_0x29de3d){if(_0x29de3d){_0x4f47c7=_0x29de3d[_0x1b7d('0x37')];if(!_0x4a8d87[_0x1b7d('0x32')][_0x1b7d('0x38')](_0x1b7d('0x39'))){_0x452ccf['limit']=qs[_0x1b7d('0x20')](_0x4a8d87[_0x1b7d('0x32')][_0x1b7d('0x20')]);_0x452ccf[_0x1b7d('0x1f')]=qs['offset'](_0x4a8d87[_0x1b7d('0x32')][_0x1b7d('0x1f')]);}return _0x40a7c7[_0x1b7d('0x76')](_0x452ccf);}})[_0x1b7d('0x27')](function(_0x52f123){if(_0x52f123){return _0x52f123?{'count':_0x4f47c7,'rows':_0x52f123}:null;}})[_0x1b7d('0x27')](respondWithResult(_0x51cf04,null))[_0x1b7d('0x4b')](handleError(_0x51cf04,null));};
\ No newline at end of file
index 210bb11..dfe41c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ea=['events','../../mysqldb','FaxQueue','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x49b1e3,_0x52e77b){var _0x4aa95b=function(_0x35026d){while(--_0x35026d){_0x49b1e3['push'](_0x49b1e3['shift']());}};_0x4aa95b(++_0x52e77b);}(_0xd2ea,0x15f));var _0xad2e=function(_0x15c5b8,_0x3b670f){_0x15c5b8=_0x15c5b8-0x0;var _0xd45fe6=_0xd2ea[_0x15c5b8];return _0xd45fe6;};'use strict';var EventEmitter=require(_0xad2e('0x0'));var FaxQueue=require(_0xad2e('0x1'))['db'][_0xad2e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xad2e('0x3')](0x0);var events={'afterCreate':_0xad2e('0x4'),'afterUpdate':'update','afterDestroy':_0xad2e('0x5')};function emitEvent(_0x46a911){return function(_0xcba7cb,_0x3e0741,_0x2afdc4){FaxQueueEvents[_0xad2e('0x6')](_0x46a911+':'+_0xcba7cb['id'],_0xcba7cb);FaxQueueEvents[_0xad2e('0x6')](_0x46a911,_0xcba7cb);_0x2afdc4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xad2e('0x7')](e,emitEvent(event));}}module[_0xad2e('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x7da7=['remove','emit','hook','events','../../mysqldb','FaxQueue','update'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7da7,0x10d));var _0x77da=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0x7da7[_0x575a38];return _0x5a7bdd;};'use strict';var EventEmitter=require(_0x77da('0x0'));var FaxQueue=require(_0x77da('0x1'))['db'][_0x77da('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x77da('0x3'),'afterDestroy':_0x77da('0x4')};function emitEvent(_0x4f60c3){return function(_0x3a9fa6,_0x37b3d9,_0x56458c){FaxQueueEvents[_0x77da('0x5')](_0x4f60c3+':'+_0x3a9fa6['id'],_0x3a9fa6);FaxQueueEvents[_0x77da('0x5')](_0x4f60c3,_0x3a9fa6);_0x56458c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x77da('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index ee00b0c..a5b9b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf30e=['FaxQueue','fax_queues','lodash','util','api','moment','bluebird','request-promise','./faxQueue.attributes','define'];(function(_0x54f56c,_0x5ca2a6){var _0x3efaec=function(_0x2ab434){while(--_0x2ab434){_0x54f56c['push'](_0x54f56c['shift']());}};_0x3efaec(++_0x5ca2a6);}(_0xf30e,0xc0));var _0xef30=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0xf30e[_0x5959c9];return _0x4ffcbc;};'use strict';var _=require(_0xef30('0x0'));var util=require(_0xef30('0x1'));var logger=require('../../config/logger')(_0xef30('0x2'));var moment=require(_0xef30('0x3'));var BPromise=require(_0xef30('0x4'));var rp=require(_0xef30('0x5'));var attributes=require(_0xef30('0x6'));module['exports']=function(_0x35f841,_0x29ba25){return _0x35f841[_0xef30('0x7')](_0xef30('0x8'),attributes,{'tableName':_0xef30('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x549c=['moment','bluebird','request-promise','./faxQueue.attributes','exports','define','FaxQueue','lodash','api'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x549c,0x1ae));var _0xc549=function(_0x165a92,_0x387bdf){_0x165a92=_0x165a92-0x0;var _0x3578a3=_0x549c[_0x165a92];return _0x3578a3;};'use strict';var _=require(_0xc549('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc549('0x1'));var moment=require(_0xc549('0x2'));var BPromise=require(_0xc549('0x3'));var rp=require(_0xc549('0x4'));var attributes=require(_0xc549('0x5'));module[_0xc549('0x6')]=function(_0x3ab567,_0x5c6a7d){return _0x3ab567[_0xc549('0x7')](_0xc549('0x8'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d9ded5..4ee6651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaaf=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','map','include','model','then','debug','find','ShowFaxQueue','moment','bluebird','randomstring'];(function(_0x27b6db,_0x3b0563){var _0x37f60c=function(_0x44caa4){while(--_0x44caa4){_0x27b6db['push'](_0x27b6db['shift']());}};_0x37f60c(++_0x3b0563);}(_0xeaaf,0xbb));var _0xfeaa=function(_0x2903e1,_0x3eb18c){_0x2903e1=_0x2903e1-0x0;var _0x17c019=_0xeaaf[_0x2903e1];return _0x17c019;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfeaa('0x0'));var BPromise=require(_0xfeaa('0x1'));var rs=require(_0xfeaa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfeaa('0x3'))['db'];var utils=require(_0xfeaa('0x4'));var logger=require('../../config/logger')(_0xfeaa('0x5'));var config=require(_0xfeaa('0x6'));var jayson=require(_0xfeaa('0x7'));var client=jayson[_0xfeaa('0x8')][_0xfeaa('0x9')]({'port':0x232a});config[_0xfeaa('0xa')]=_[_0xfeaa('0xb')](config[_0xfeaa('0xa')],{'host':_0xfeaa('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfeaa('0xa')]));require('./faxQueue.socket')[_0xfeaa('0xd')](socket);function respondWithRpcPromise(_0x576585,_0x56d57e,_0x405f12){return new BPromise(function(_0x463fdb,_0x5d0e9a){return client['request'](_0x576585,_0x405f12)['then'](function(_0x584ca8){logger[_0xfeaa('0xe')]('FaxQueue,\x20%s,\x20%s',_0x56d57e,_0xfeaa('0xf'));logger['debug'](_0xfeaa('0x10'),_0x56d57e,'request\x20sent',JSON[_0xfeaa('0x11')](_0x584ca8));if(_0x584ca8[_0xfeaa('0x12')]){if(_0x584ca8[_0xfeaa('0x12')][_0xfeaa('0x13')]===0x1f4){logger[_0xfeaa('0x12')](_0xfeaa('0x14'),_0x56d57e,_0x584ca8[_0xfeaa('0x12')][_0xfeaa('0x15')]);return _0x5d0e9a(_0x584ca8[_0xfeaa('0x12')]['message']);}logger['error'](_0xfeaa('0x14'),_0x56d57e,_0x584ca8[_0xfeaa('0x12')][_0xfeaa('0x15')]);return _0x463fdb(_0x584ca8[_0xfeaa('0x12')][_0xfeaa('0x15')]);}else{logger[_0xfeaa('0xe')](_0xfeaa('0x14'),_0x56d57e,_0xfeaa('0xf'));_0x463fdb(_0x584ca8[_0xfeaa('0x16')][_0xfeaa('0x15')]);}})[_0xfeaa('0x17')](function(_0x324753){logger['error'](_0xfeaa('0x14'),_0x56d57e,_0x324753);_0x5d0e9a(_0x324753);});});}exports[_0xfeaa('0x18')]=function(_0x44de56){var _0x5085bc=this;return new Promise(function(_0x3c685f,_0x5b584e){return db[_0xfeaa('0x19')][_0xfeaa('0x1a')]({'raw':_0x44de56[_0xfeaa('0x1b')]?_0x44de56[_0xfeaa('0x1b')][_0xfeaa('0x1c')]===undefined?!![]:![]:!![],'where':_0x44de56[_0xfeaa('0x1b')]?_0x44de56['options'][_0xfeaa('0x1d')]||null:null,'attributes':_0x44de56[_0xfeaa('0x1b')]?_0x44de56[_0xfeaa('0x1b')][_0xfeaa('0x1e')]||null:null,'limit':_0x44de56[_0xfeaa('0x1b')]?_0x44de56[_0xfeaa('0x1b')]['limit']||null:null,'include':_0x44de56[_0xfeaa('0x1b')]?_0x44de56[_0xfeaa('0x1b')]['include']?_[_0xfeaa('0x1f')](_0x44de56[_0xfeaa('0x1b')][_0xfeaa('0x20')],function(_0x4b0e1e){return{'model':db[_0x4b0e1e['model']],'as':_0x4b0e1e['as'],'attributes':_0x4b0e1e[_0xfeaa('0x1e')],'include':_0x4b0e1e[_0xfeaa('0x20')]?_[_0xfeaa('0x1f')](_0x4b0e1e[_0xfeaa('0x20')],function(_0x251948){return{'model':db[_0x251948[_0xfeaa('0x21')]],'as':_0x251948['as'],'attributes':_0x251948[_0xfeaa('0x1e')],'include':_0x251948[_0xfeaa('0x20')]?_[_0xfeaa('0x1f')](_0x251948[_0xfeaa('0x20')],function(_0x2b7410){return{'model':db[_0x2b7410[_0xfeaa('0x21')]],'as':_0x2b7410['as'],'attributes':_0x2b7410['attributes']};}):[]};}):[]};}):[]:[]})[_0xfeaa('0x22')](function(_0x25fe32){logger[_0xfeaa('0xe')]('GetFaxQueue',_0x44de56);logger[_0xfeaa('0x23')]('GetFaxQueue',_0x44de56,JSON[_0xfeaa('0x11')](_0x25fe32));_0x3c685f(_0x25fe32);})[_0xfeaa('0x17')](function(_0x52bbb1){logger[_0xfeaa('0x12')]('GetFaxQueue',_0x52bbb1[_0xfeaa('0x15')],_0x44de56);_0x5b584e(_0x5085bc[_0xfeaa('0x12')](0x1f4,_0x52bbb1['message']));});});};exports['ShowFaxQueue']=function(_0x48a166){var _0x15f7eb=this;return new Promise(function(_0x5356b5,_0x4b92e4){return db[_0xfeaa('0x19')][_0xfeaa('0x24')]({'raw':_0x48a166[_0xfeaa('0x1b')]?_0x48a166[_0xfeaa('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x48a166['options']?_0x48a166[_0xfeaa('0x1b')][_0xfeaa('0x1d')]||null:null,'attributes':_0x48a166['options']?_0x48a166[_0xfeaa('0x1b')][_0xfeaa('0x1e')]||null:null,'include':_0x48a166[_0xfeaa('0x1b')]?_0x48a166[_0xfeaa('0x1b')][_0xfeaa('0x20')]?_[_0xfeaa('0x1f')](_0x48a166[_0xfeaa('0x1b')][_0xfeaa('0x20')],function(_0x5e55c0){return{'model':db[_0x5e55c0['model']],'as':_0x5e55c0['as'],'attributes':_0x5e55c0['attributes'],'include':_0x5e55c0[_0xfeaa('0x20')]?_[_0xfeaa('0x1f')](_0x5e55c0[_0xfeaa('0x20')],function(_0x328a41){return{'model':db[_0x328a41[_0xfeaa('0x21')]],'as':_0x328a41['as'],'attributes':_0x328a41[_0xfeaa('0x1e')],'include':_0x328a41['include']?_['map'](_0x328a41[_0xfeaa('0x20')],function(_0x4d5f3d){return{'model':db[_0x4d5f3d['model']],'as':_0x4d5f3d['as'],'attributes':_0x4d5f3d[_0xfeaa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfeaa('0x22')](function(_0x12ee16){logger[_0xfeaa('0xe')](_0xfeaa('0x25'),_0x48a166);logger[_0xfeaa('0x23')](_0xfeaa('0x25'),_0x48a166,JSON[_0xfeaa('0x11')](_0x12ee16));_0x5356b5(_0x12ee16);})['catch'](function(_0x24a2d4){logger[_0xfeaa('0x12')]('ShowFaxQueue',_0x24a2d4[_0xfeaa('0x15')],_0x48a166);_0x4b92e4(_0x15f7eb[_0xfeaa('0x12')](0x1f4,_0x24a2d4['message']));});});};
\ No newline at end of file
+var _0x5aa6=['model','info','ShowFaxQueue','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map'];(function(_0x18e99b,_0x3aa182){var _0x3edbd0=function(_0x530868){while(--_0x530868){_0x18e99b['push'](_0x18e99b['shift']());}};_0x3edbd0(++_0x3aa182);}(_0x5aa6,0xad));var _0x65aa=function(_0x17ef2e,_0x1184c5){_0x17ef2e=_0x17ef2e-0x0;var _0x2363ca=_0x5aa6[_0x17ef2e];return _0x2363ca;};'use strict';var _=require(_0x65aa('0x0'));var util=require(_0x65aa('0x1'));var moment=require(_0x65aa('0x2'));var BPromise=require(_0x65aa('0x3'));var rs=require(_0x65aa('0x4'));var fs=require('fs');var Redis=require(_0x65aa('0x5'));var db=require(_0x65aa('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x65aa('0x7'));var config=require(_0x65aa('0x8'));var jayson=require(_0x65aa('0x9'));var client=jayson[_0x65aa('0xa')][_0x65aa('0xb')]({'port':0x232a});config[_0x65aa('0xc')]=_[_0x65aa('0xd')](config[_0x65aa('0xc')],{'host':_0x65aa('0xe'),'port':0x18eb});var socket=require(_0x65aa('0xf'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x65aa('0x10')](socket);function respondWithRpcPromise(_0x5350c2,_0x470539,_0x5e18d5){return new BPromise(function(_0x356b0a,_0x497b32){return client[_0x65aa('0x11')](_0x5350c2,_0x5e18d5)[_0x65aa('0x12')](function(_0x3fb10e){logger['info'](_0x65aa('0x13'),_0x470539,'request\x20sent');logger[_0x65aa('0x14')](_0x65aa('0x15'),_0x470539,_0x65aa('0x16'),JSON['stringify'](_0x3fb10e));if(_0x3fb10e[_0x65aa('0x17')]){if(_0x3fb10e[_0x65aa('0x17')][_0x65aa('0x18')]===0x1f4){logger['error'](_0x65aa('0x13'),_0x470539,_0x3fb10e['error']['message']);return _0x497b32(_0x3fb10e[_0x65aa('0x17')][_0x65aa('0x19')]);}logger[_0x65aa('0x17')](_0x65aa('0x13'),_0x470539,_0x3fb10e[_0x65aa('0x17')][_0x65aa('0x19')]);return _0x356b0a(_0x3fb10e[_0x65aa('0x17')][_0x65aa('0x19')]);}else{logger['info'](_0x65aa('0x13'),_0x470539,_0x65aa('0x16'));_0x356b0a(_0x3fb10e[_0x65aa('0x1a')][_0x65aa('0x19')]);}})[_0x65aa('0x1b')](function(_0x5e631e){logger[_0x65aa('0x17')](_0x65aa('0x13'),_0x470539,_0x5e631e);_0x497b32(_0x5e631e);});});}exports[_0x65aa('0x1c')]=function(_0x33facb){var _0x3c6753=this;return new Promise(function(_0x2eb8a8,_0x364333){return db[_0x65aa('0x1d')][_0x65aa('0x1e')]({'raw':_0x33facb[_0x65aa('0x1f')]?_0x33facb[_0x65aa('0x1f')][_0x65aa('0x20')]===undefined?!![]:![]:!![],'where':_0x33facb[_0x65aa('0x1f')]?_0x33facb[_0x65aa('0x1f')][_0x65aa('0x21')]||null:null,'attributes':_0x33facb['options']?_0x33facb[_0x65aa('0x1f')][_0x65aa('0x22')]||null:null,'limit':_0x33facb[_0x65aa('0x1f')]?_0x33facb[_0x65aa('0x1f')]['limit']||null:null,'include':_0x33facb['options']?_0x33facb[_0x65aa('0x1f')][_0x65aa('0x23')]?_[_0x65aa('0x24')](_0x33facb['options'][_0x65aa('0x23')],function(_0x2f6ba8){return{'model':db[_0x2f6ba8['model']],'as':_0x2f6ba8['as'],'attributes':_0x2f6ba8[_0x65aa('0x22')],'include':_0x2f6ba8[_0x65aa('0x23')]?_[_0x65aa('0x24')](_0x2f6ba8['include'],function(_0xd3296b){return{'model':db[_0xd3296b[_0x65aa('0x25')]],'as':_0xd3296b['as'],'attributes':_0xd3296b['attributes'],'include':_0xd3296b[_0x65aa('0x23')]?_['map'](_0xd3296b[_0x65aa('0x23')],function(_0x46023b){return{'model':db[_0x46023b['model']],'as':_0x46023b['as'],'attributes':_0x46023b[_0x65aa('0x22')]};}):[]};}):[]};}):[]:[]})[_0x65aa('0x12')](function(_0x492ed4){logger[_0x65aa('0x26')](_0x65aa('0x1c'),_0x33facb);logger[_0x65aa('0x14')](_0x65aa('0x1c'),_0x33facb,JSON['stringify'](_0x492ed4));_0x2eb8a8(_0x492ed4);})['catch'](function(_0x49c496){logger[_0x65aa('0x17')](_0x65aa('0x1c'),_0x49c496[_0x65aa('0x19')],_0x33facb);_0x364333(_0x3c6753[_0x65aa('0x17')](0x1f4,_0x49c496['message']));});});};exports[_0x65aa('0x27')]=function(_0x2ee3dc){var _0x46d594=this;return new Promise(function(_0x56b85b,_0x5c43bd){return db['FaxQueue'][_0x65aa('0x28')]({'raw':_0x2ee3dc[_0x65aa('0x1f')]?_0x2ee3dc['options'][_0x65aa('0x20')]===undefined?!![]:![]:!![],'where':_0x2ee3dc[_0x65aa('0x1f')]?_0x2ee3dc['options'][_0x65aa('0x21')]||null:null,'attributes':_0x2ee3dc[_0x65aa('0x1f')]?_0x2ee3dc[_0x65aa('0x1f')][_0x65aa('0x22')]||null:null,'include':_0x2ee3dc['options']?_0x2ee3dc['options']['include']?_['map'](_0x2ee3dc[_0x65aa('0x1f')][_0x65aa('0x23')],function(_0x1f1bbb){return{'model':db[_0x1f1bbb[_0x65aa('0x25')]],'as':_0x1f1bbb['as'],'attributes':_0x1f1bbb['attributes'],'include':_0x1f1bbb[_0x65aa('0x23')]?_[_0x65aa('0x24')](_0x1f1bbb['include'],function(_0x5baceb){return{'model':db[_0x5baceb[_0x65aa('0x25')]],'as':_0x5baceb['as'],'attributes':_0x5baceb[_0x65aa('0x22')],'include':_0x5baceb['include']?_['map'](_0x5baceb['include'],function(_0x183e79){return{'model':db[_0x183e79[_0x65aa('0x25')]],'as':_0x183e79['as'],'attributes':_0x183e79['attributes']};}):[]};}):[]};}):[]:[]})[_0x65aa('0x12')](function(_0xd7b2b5){logger[_0x65aa('0x26')](_0x65aa('0x27'),_0x2ee3dc);logger['debug'](_0x65aa('0x27'),_0x2ee3dc,JSON[_0x65aa('0x29')](_0xd7b2b5));_0x56b85b(_0xd7b2b5);})[_0x65aa('0x1b')](function(_0x1064d3){logger[_0x65aa('0x17')](_0x65aa('0x27'),_0x1064d3[_0x65aa('0x19')],_0x2ee3dc);_0x5c43bd(_0x46d594[_0x65aa('0x17')](0x1f4,_0x1064d3[_0x65aa('0x19')]));});});};
\ No newline at end of file
index 77bcc6d..21c4cb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d14=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3bf28e,_0x296152){var _0x1a53a5=function(_0x151973){while(--_0x151973){_0x3bf28e['push'](_0x3bf28e['shift']());}};_0x1a53a5(++_0x296152);}(_0x4d14,0x161));var _0x44d1=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x4d14[_0x1a0daa];return _0x1dbe15;};'use strict';var FaxQueueEvents=require(_0x44d1('0x0'));var events=[_0x44d1('0x1'),_0x44d1('0x2'),_0x44d1('0x3')];function createListener(_0x125581,_0x9946bc){return function(_0xcc3c26){_0x9946bc[_0x44d1('0x4')](_0x125581,_0xcc3c26);};}function removeListener(_0x57d167,_0x5056ce){return function(){FaxQueueEvents[_0x44d1('0x5')](_0x57d167,_0x5056ce);};}exports[_0x44d1('0x6')]=function(_0xe9b3eb){for(var _0x36b961=0x0,_0x11a8c7=events[_0x44d1('0x7')];_0x36b961<_0x11a8c7;_0x36b961++){var _0x383aac=events[_0x36b961];var _0x6db15c=createListener(_0x44d1('0x8')+_0x383aac,_0xe9b3eb);FaxQueueEvents['on'](_0x383aac,_0x6db15c);}};
\ No newline at end of file
+var _0xdea8=['./faxQueue.events','save','remove','update','emit','removeListener','register','length','faxQueue:'];(function(_0x41bee0,_0x28ca1b){var _0x3922dc=function(_0x271d90){while(--_0x271d90){_0x41bee0['push'](_0x41bee0['shift']());}};_0x3922dc(++_0x28ca1b);}(_0xdea8,0xc6));var _0x8dea=function(_0x483211,_0x40b25b){_0x483211=_0x483211-0x0;var _0x2afe6b=_0xdea8[_0x483211];return _0x2afe6b;};'use strict';var FaxQueueEvents=require(_0x8dea('0x0'));var events=[_0x8dea('0x1'),_0x8dea('0x2'),_0x8dea('0x3')];function createListener(_0x5c0b12,_0x1f927f){return function(_0x1cd4b3){_0x1f927f[_0x8dea('0x4')](_0x5c0b12,_0x1cd4b3);};}function removeListener(_0x3776d1,_0x39e2b9){return function(){FaxQueueEvents[_0x8dea('0x5')](_0x3776d1,_0x39e2b9);};}exports[_0x8dea('0x6')]=function(_0x13cbe3){for(var _0x367c05=0x0,_0x19ecb1=events[_0x8dea('0x7')];_0x367c05<_0x19ecb1;_0x367c05++){var _0x525c2b=events[_0x367c05];var _0x5e6ae0=createListener(_0x8dea('0x8')+_0x525c2b,_0x13cbe3);FaxQueueEvents['on'](_0x525c2b,_0x5e6ae0);}};
\ No newline at end of file
index a43f482..dbce63c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7490=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','removeTeams','exports','multer','util'];(function(_0x1e953d,_0x392216){var _0x48bcf3=function(_0x403562){while(--_0x403562){_0x1e953d['push'](_0x1e953d['shift']());}};_0x48bcf3(++_0x392216);}(_0x7490,0xa0));var _0x0749=function(_0x2d25d7,_0xa1a9f0){_0x2d25d7=_0x2d25d7-0x0;var _0xe8f39=_0x7490[_0x2d25d7];return _0xe8f39;};'use strict';var multer=require(_0x0749('0x0'));var util=require(_0x0749('0x1'));var path=require(_0x0749('0x2'));var timeout=require(_0x0749('0x3'));var express=require('express');var router=express[_0x0749('0x4')]();var auth=require(_0x0749('0x5'));var interaction=require(_0x0749('0x6'));var config=require(_0x0749('0x7'));var controller=require(_0x0749('0x8'));router[_0x0749('0x9')]('/',auth[_0x0749('0xa')](),controller['index']);router[_0x0749('0x9')]('/describe',auth[_0x0749('0xa')](),controller[_0x0749('0xb')]);router[_0x0749('0x9')](_0x0749('0xc'),auth[_0x0749('0xa')](),controller[_0x0749('0xd')]);router[_0x0749('0x9')]('/:id/members',auth[_0x0749('0xa')](),controller[_0x0749('0xe')]);router[_0x0749('0x9')](_0x0749('0xf'),auth[_0x0749('0xa')](),controller[_0x0749('0x10')]);router[_0x0749('0x9')](_0x0749('0x11'),auth[_0x0749('0xa')](),controller[_0x0749('0x12')]);router['post']('/',auth[_0x0749('0xa')](),controller[_0x0749('0x13')]);router[_0x0749('0x14')](_0x0749('0xf'),auth[_0x0749('0xa')](),controller[_0x0749('0x15')]);router['post'](_0x0749('0x11'),auth[_0x0749('0xa')](),controller['addAgents']);router[_0x0749('0x16')](_0x0749('0xc'),auth['isAuthenticated'](),controller[_0x0749('0x17')]);router[_0x0749('0x18')](_0x0749('0xc'),auth[_0x0749('0xa')](),controller['destroy']);router[_0x0749('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0749('0x19')]);router[_0x0749('0x18')](_0x0749('0x11'),auth[_0x0749('0xa')](),controller['removeAgents']);module[_0x0749('0x1a')]=router;
\ No newline at end of file
+var _0xb69f=['/:id','show','/:id/teams','/:id/users','getAgents','create','post','addAgents','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./faxQueue.controller','get','/describe','isAuthenticated'];(function(_0x446f30,_0x3c04c4){var _0x5e7cc2=function(_0x556128){while(--_0x556128){_0x446f30['push'](_0x446f30['shift']());}};_0x5e7cc2(++_0x3c04c4);}(_0xb69f,0x18d));var _0xfb69=function(_0x4ba40,_0x18abbe){_0x4ba40=_0x4ba40-0x0;var _0x52e1f4=_0xb69f[_0x4ba40];return _0x52e1f4;};'use strict';var multer=require(_0xfb69('0x0'));var util=require(_0xfb69('0x1'));var path=require(_0xfb69('0x2'));var timeout=require(_0xfb69('0x3'));var express=require(_0xfb69('0x4'));var router=express[_0xfb69('0x5')]();var auth=require(_0xfb69('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb69('0x7'));router[_0xfb69('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfb69('0x8')](_0xfb69('0x9'),auth[_0xfb69('0xa')](),controller['describe']);router[_0xfb69('0x8')](_0xfb69('0xb'),auth['isAuthenticated'](),controller[_0xfb69('0xc')]);router['get']('/:id/members',auth[_0xfb69('0xa')](),controller['getMembers']);router[_0xfb69('0x8')](_0xfb69('0xd'),auth['isAuthenticated'](),controller['getTeams']);router[_0xfb69('0x8')](_0xfb69('0xe'),auth[_0xfb69('0xa')](),controller[_0xfb69('0xf')]);router['post']('/',auth[_0xfb69('0xa')](),controller[_0xfb69('0x10')]);router[_0xfb69('0x11')](_0xfb69('0xd'),auth['isAuthenticated'](),controller['addTeams']);router[_0xfb69('0x11')](_0xfb69('0xe'),auth['isAuthenticated'](),controller[_0xfb69('0x12')]);router['put']('/:id',auth[_0xfb69('0xa')](),controller[_0xfb69('0x13')]);router[_0xfb69('0x14')]('/:id',auth[_0xfb69('0xa')](),controller[_0xfb69('0x15')]);router[_0xfb69('0x14')](_0xfb69('0xd'),auth[_0xfb69('0xa')](),controller[_0xfb69('0x16')]);router[_0xfb69('0x14')](_0xfb69('0xe'),auth[_0xfb69('0xa')](),controller['removeAgents']);module[_0xfb69('0x17')]=router;
\ No newline at end of file
index 753ea52..16d928f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb531=['STRING','DATE','exports'];(function(_0x47d3ec,_0x54912d){var _0x19d199=function(_0x1b5535){while(--_0x1b5535){_0x47d3ec['push'](_0x47d3ec['shift']());}};_0x19d199(++_0x54912d);}(_0xb531,0x68));var _0x1b53=function(_0x6deddf,_0x3aa7da){_0x6deddf=_0x6deddf-0x0;var _0x53aa93=_0xb531[_0x6deddf];return _0x53aa93;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1b53('0x0')]={'uniqueid':{'type':Sequelize[_0x1b53('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1b53('0x1')]},'joinAt':{'type':Sequelize[_0x1b53('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1b53('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1b53('0x1')]}};
\ No newline at end of file
+var _0x7a3f=['moment','sequelize','STRING','DATE'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x7a3f,0x194));var _0xf7a3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a3f[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xf7a3('0x0'));var Sequelize=require(_0xf7a3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf7a3('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf7a3('0x3')]},'leaveAt':{'type':Sequelize[_0xf7a3('0x3')]},'acceptAt':{'type':Sequelize[_0xf7a3('0x3')]},'exitAt':{'type':Sequelize[_0xf7a3('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b2da14a..702f07b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd28c=['stack','name','send','FaxQueueReport','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','add','day','merge','filter','map','key','field','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','error'];(function(_0x224009,_0x2e44f8){var _0x4a0f8b=function(_0x27d0c4){while(--_0x27d0c4){_0x224009['push'](_0x224009['shift']());}};_0x4a0f8b(++_0x2e44f8);}(_0xd28c,0x72));var _0xcd28=function(_0x3dc4d8,_0x57388c){_0x3dc4d8=_0x3dc4d8-0x0;var _0x214cf7=_0xd28c[_0x3dc4d8];return _0x214cf7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd28('0x0'));var rimraf=require(_0xcd28('0x1'));var zipdir=require(_0xcd28('0x2'));var jsonpatch=require(_0xcd28('0x3'));var rp=require(_0xcd28('0x4'));var moment=require(_0xcd28('0x5'));var BPromise=require(_0xcd28('0x6'));var Mustache=require(_0xcd28('0x7'));var util=require('util');var path=require(_0xcd28('0x8'));var sox=require(_0xcd28('0x9'));var csv=require('to-csv');var ejs=require(_0xcd28('0xa'));var fs=require('fs');var _=require(_0xcd28('0xb'));var squel=require('squel');var crypto=require(_0xcd28('0xc'));var jsforce=require(_0xcd28('0xd'));var deskjs=require(_0xcd28('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcd28('0xf'));var Papa=require(_0xcd28('0x10'));var Redis=require(_0xcd28('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xcd28('0x12'))('api');var utils=require(_0xcd28('0x13'));var config=require('../../config/environment');var db=require(_0xcd28('0x14'))['db'];function respondWithStatusCode(_0x3a394c,_0x21951b){_0x21951b=_0x21951b||0xcc;return function(_0x192898){if(_0x192898){return _0x3a394c[_0xcd28('0x15')](_0x21951b);}return _0x3a394c[_0xcd28('0x16')](_0x21951b)[_0xcd28('0x17')]();};}function respondWithResult(_0x5cd396,_0x1b8b99){_0x1b8b99=_0x1b8b99||0xc8;return function(_0x35e2d4){if(_0x35e2d4){return _0x5cd396['status'](_0x1b8b99)[_0xcd28('0x18')](_0x35e2d4);}};}function respondWithFilteredResult(_0x6d51f7,_0x3e9ff2){return function(_0x4ba994){if(_0x4ba994){var _0x12fae4=_0x4ba994[_0xcd28('0x19')],_0x5c8035=_0x3e9ff2['offset'],_0x3a311b=_0x3e9ff2[_0xcd28('0x1a')]+_0x3e9ff2[_0xcd28('0x1b')],_0x1aae54;if(_0x3a311b>=_0x12fae4){_0x3a311b=_0x12fae4;_0x1aae54=0xc8;}else{_0x1aae54=0xce;}_0x6d51f7['status'](_0x1aae54);return _0x6d51f7[_0xcd28('0x1c')]('Content-Range',_0x5c8035+'-'+_0x3a311b+'/'+_0x12fae4)[_0xcd28('0x18')](_0x4ba994);}return null;};}function patchUpdates(_0x49f4f0){return function(_0x301b78){try{jsonpatch[_0xcd28('0x1d')](_0x301b78,_0x49f4f0,!![]);}catch(_0x155159){return BPromise[_0xcd28('0x1e')](_0x155159);}return _0x301b78['save']();};}function saveUpdates(_0x53b515,_0x1dd17d){return function(_0x360b08){if(_0x360b08){return _0x360b08['update'](_0x53b515)[_0xcd28('0x1f')](function(_0x40348e){return _0x40348e;});}return null;};}function removeEntity(_0xdaa8b9,_0x167b12){return function(_0x5d0a48){if(_0x5d0a48){return _0x5d0a48[_0xcd28('0x20')]()[_0xcd28('0x1f')](function(){_0xdaa8b9[_0xcd28('0x16')](0xcc)[_0xcd28('0x17')]();});}};}function handleEntityNotFound(_0x410149,_0x504d64){return function(_0x2366f9){if(!_0x2366f9){_0x410149[_0xcd28('0x15')](0x194);}return _0x2366f9;};}function handleError(_0x444b1f,_0x54e80e){_0x54e80e=_0x54e80e||0x1f4;return function(_0x3e57d5){logger[_0xcd28('0x21')](_0x3e57d5[_0xcd28('0x22')]);if(_0x3e57d5['name']){delete _0x3e57d5[_0xcd28('0x23')];}_0x444b1f[_0xcd28('0x16')](_0x54e80e)[_0xcd28('0x24')](_0x3e57d5);};}exports['index']=function(_0x153e72,_0x343295){var _0x5d697d={},_0x4d4ccb={},_0x5b4830={'count':0x0,'rows':[]};var _0xb593f1=db[_0xcd28('0x25')]['rawAttributes'];_0x4d4ccb[_0xcd28('0x26')]=_[_0xcd28('0x27')](_0xb593f1);var _0x50ca75={'dateStart':_0x153e72[_0xcd28('0x28')]['dateStart'],'dateEnd':_0x153e72[_0xcd28('0x28')]['dateEnd']};delete _0x153e72['query'][_0xcd28('0x29')];delete _0x153e72['query'][_0xcd28('0x2a')];_0x4d4ccb[_0xcd28('0x28')]=_[_0xcd28('0x27')](_0x153e72[_0xcd28('0x28')]);_0x4d4ccb[_0xcd28('0x2b')]=_[_0xcd28('0x2c')](_0x4d4ccb[_0xcd28('0x26')],_0x4d4ccb[_0xcd28('0x28')]);_0x5d697d['attributes']=_['intersection'](_0x4d4ccb[_0xcd28('0x26')],qs[_0xcd28('0x2d')](_0x153e72[_0xcd28('0x28')][_0xcd28('0x2d')]));_0x5d697d['attributes']=_0x5d697d[_0xcd28('0x2e')][_0xcd28('0x2f')]?_0x5d697d['attributes']:_0x4d4ccb[_0xcd28('0x26')];if(!_0x153e72[_0xcd28('0x28')]['hasOwnProperty'](_0xcd28('0x30'))){_0x5d697d[_0xcd28('0x1b')]=qs[_0xcd28('0x1b')](_0x153e72['query']['limit']);_0x5d697d[_0xcd28('0x1a')]=qs['offset'](_0x153e72[_0xcd28('0x28')]['offset']);}_0x5d697d[_0xcd28('0x31')]=qs['sort'](_0x153e72[_0xcd28('0x28')][_0xcd28('0x32')]);_0x5d697d[_0xcd28('0x33')]=qs[_0xcd28('0x2b')](_[_0xcd28('0x34')](_0x153e72['query'],_0x4d4ccb[_0xcd28('0x2b')]));if(_0x50ca75[_0xcd28('0x29')]){if(_0x50ca75['dateEnd']){_0x50ca75['dateEnd']=moment(_0x50ca75[_0xcd28('0x2a')])[_0xcd28('0x35')](0x1,_0xcd28('0x36'));}else{_0x50ca75[_0xcd28('0x2a')]=moment(_0x50ca75[_0xcd28('0x29')])[_0xcd28('0x35')](0x1,'day');}_[_0xcd28('0x37')](_0x5d697d[_0xcd28('0x33')],{'createdAt':{'$gte':_0x50ca75[_0xcd28('0x29')],'$lte':_0x50ca75['dateEnd']}});}if(_0x153e72[_0xcd28('0x28')][_0xcd28('0x38')]){_0x5d697d['where']=_['merge'](_0x5d697d[_0xcd28('0x33')],{'$or':_[_0xcd28('0x39')](_0xb593f1,function(_0x318e2c){if(_0x318e2c['type'][_0xcd28('0x3a')]!=='VIRTUAL'){var _0xd38a72={};_0xd38a72[_0x318e2c[_0xcd28('0x3b')]]={'$like':'%'+_0x153e72[_0xcd28('0x28')]['filter']+'%'};return _0xd38a72;}})});}_0x5d697d=_[_0xcd28('0x37')]({},_0x5d697d,_0x153e72[_0xcd28('0x3c')]);var _0x3e2047={'where':_0x5d697d[_0xcd28('0x33')]};return db[_0xcd28('0x25')][_0xcd28('0x19')](_0x3e2047)[_0xcd28('0x1f')](function(_0x2da941){_0x5b4830[_0xcd28('0x19')]=_0x2da941;if(_0x153e72[_0xcd28('0x28')][_0xcd28('0x3d')]){_0x5d697d['include']=[{'all':!![]}];}return db[_0xcd28('0x25')][_0xcd28('0x3e')](_0x5d697d);})[_0xcd28('0x1f')](function(_0x1f41f2){_0x5b4830[_0xcd28('0x3f')]=_0x1f41f2;return _0x5b4830;})[_0xcd28('0x1f')](respondWithFilteredResult(_0x343295,_0x5d697d))[_0xcd28('0x40')](handleError(_0x343295,null));};exports[_0xcd28('0x41')]=function(_0x24ac57,_0x5bb0fa){var _0x50946e={'raw':!![],'where':{'id':_0x24ac57[_0xcd28('0x42')]['id']}},_0x3e821c={};_0x3e821c[_0xcd28('0x26')]=_['keys'](db[_0xcd28('0x25')][_0xcd28('0x43')]);_0x3e821c[_0xcd28('0x28')]=_[_0xcd28('0x27')](_0x24ac57['query']);_0x3e821c[_0xcd28('0x2b')]=_['intersection'](_0x3e821c[_0xcd28('0x26')],_0x3e821c[_0xcd28('0x28')]);_0x50946e[_0xcd28('0x2e')]=_['intersection'](_0x3e821c[_0xcd28('0x26')],qs[_0xcd28('0x2d')](_0x24ac57[_0xcd28('0x28')][_0xcd28('0x2d')]));_0x50946e['attributes']=_0x50946e[_0xcd28('0x2e')]['length']?_0x50946e[_0xcd28('0x2e')]:_0x3e821c[_0xcd28('0x26')];if(_0x24ac57[_0xcd28('0x28')]['includeAll']){_0x50946e[_0xcd28('0x44')]=[{'all':!![]}];}_0x50946e=_[_0xcd28('0x37')]({},_0x50946e,_0x24ac57[_0xcd28('0x3c')]);return db['FaxQueueReport'][_0xcd28('0x45')](_0x50946e)['then'](handleEntityNotFound(_0x5bb0fa,null))[_0xcd28('0x1f')](respondWithResult(_0x5bb0fa,null))[_0xcd28('0x40')](handleError(_0x5bb0fa,null));};exports[_0xcd28('0x46')]=function(_0x18e0d2,_0xc28281){return db[_0xcd28('0x25')][_0xcd28('0x46')](_0x18e0d2[_0xcd28('0x47')],{})['then'](respondWithResult(_0xc28281,0xc9))['catch'](handleError(_0xc28281,null));};exports[_0xcd28('0x48')]=function(_0x5cdb1e,_0xaeaeff){if(_0x5cdb1e[_0xcd28('0x47')]['id']){delete _0x5cdb1e[_0xcd28('0x47')]['id'];}return db[_0xcd28('0x25')][_0xcd28('0x45')]({'where':{'id':_0x5cdb1e['params']['id']}})['then'](handleEntityNotFound(_0xaeaeff,null))[_0xcd28('0x1f')](saveUpdates(_0x5cdb1e['body'],null))[_0xcd28('0x1f')](respondWithResult(_0xaeaeff,null))[_0xcd28('0x40')](handleError(_0xaeaeff,null));};exports[_0xcd28('0x20')]=function(_0x2bd0d1,_0x4b4d88){return db[_0xcd28('0x25')][_0xcd28('0x45')]({'where':{'id':_0x2bd0d1[_0xcd28('0x42')]['id']}})[_0xcd28('0x1f')](handleEntityNotFound(_0x4b4d88,null))[_0xcd28('0x1f')](removeEntity(_0x4b4d88,null))[_0xcd28('0x40')](handleError(_0x4b4d88,null));};exports['describe']=function(_0x24459e,_0x5306cb){return db[_0xcd28('0x25')][_0xcd28('0x49')]()[_0xcd28('0x1f')](respondWithResult(_0x5306cb,null))['catch'](handleError(_0x5306cb,null));};
\ No newline at end of file
+var _0x8e41=['apply','reject','save','destroy','then','error','stack','name','send','index','FaxQueueReport','model','query','dateStart','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','dateEnd','add','day','merge','filter','where','map','key','VIRTUAL','field','count','includeAll','findAll','rows','show','params','rawAttributes','catch','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set'];(function(_0x20a655,_0x46d380){var _0x27950f=function(_0x548bd1){while(--_0x548bd1){_0x20a655['push'](_0x20a655['shift']());}};_0x27950f(++_0x46d380);}(_0x8e41,0xff));var _0x18e4=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x8e41[_0x59eefb];return _0x1a49e8;};'use strict';var pdf=require(_0x18e4('0x0'));var emlformat=require(_0x18e4('0x1'));var rimraf=require(_0x18e4('0x2'));var zipdir=require(_0x18e4('0x3'));var jsonpatch=require(_0x18e4('0x4'));var rp=require(_0x18e4('0x5'));var moment=require('moment');var BPromise=require(_0x18e4('0x6'));var Mustache=require(_0x18e4('0x7'));var util=require('util');var path=require(_0x18e4('0x8'));var sox=require('sox');var csv=require(_0x18e4('0x9'));var ejs=require(_0x18e4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x18e4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x18e4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x18e4('0xd'));var Papa=require('papaparse');var Redis=require(_0x18e4('0xe'));var qs=require(_0x18e4('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x18e4('0x10'));var config=require(_0x18e4('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x196c3c,_0x235a7a){_0x235a7a=_0x235a7a||0xcc;return function(_0xba810){if(_0xba810){return _0x196c3c[_0x18e4('0x12')](_0x235a7a);}return _0x196c3c['status'](_0x235a7a)[_0x18e4('0x13')]();};}function respondWithResult(_0x443fae,_0x1bae0b){_0x1bae0b=_0x1bae0b||0xc8;return function(_0x53e73d){if(_0x53e73d){return _0x443fae[_0x18e4('0x14')](_0x1bae0b)[_0x18e4('0x15')](_0x53e73d);}};}function respondWithFilteredResult(_0x18170f,_0x4cd6af){return function(_0x253481){if(_0x253481){var _0xbfcaf=_0x253481['count'],_0x34a42c=_0x4cd6af[_0x18e4('0x16')],_0x312d1e=_0x4cd6af[_0x18e4('0x16')]+_0x4cd6af[_0x18e4('0x17')],_0x1abb9f;if(_0x312d1e>=_0xbfcaf){_0x312d1e=_0xbfcaf;_0x1abb9f=0xc8;}else{_0x1abb9f=0xce;}_0x18170f[_0x18e4('0x14')](_0x1abb9f);return _0x18170f[_0x18e4('0x18')]('Content-Range',_0x34a42c+'-'+_0x312d1e+'/'+_0xbfcaf)['json'](_0x253481);}return null;};}function patchUpdates(_0x18c61c){return function(_0x2dbf25){try{jsonpatch[_0x18e4('0x19')](_0x2dbf25,_0x18c61c,!![]);}catch(_0xc47dd8){return BPromise[_0x18e4('0x1a')](_0xc47dd8);}return _0x2dbf25[_0x18e4('0x1b')]();};}function saveUpdates(_0x47a04c,_0x3692a8){return function(_0x46472f){if(_0x46472f){return _0x46472f['update'](_0x47a04c)['then'](function(_0x47754f){return _0x47754f;});}return null;};}function removeEntity(_0x2c952a,_0x1d1f51){return function(_0x31947d){if(_0x31947d){return _0x31947d[_0x18e4('0x1c')]()[_0x18e4('0x1d')](function(){_0x2c952a[_0x18e4('0x14')](0xcc)[_0x18e4('0x13')]();});}};}function handleEntityNotFound(_0x374a15,_0x1cae8d){return function(_0x22cec7){if(!_0x22cec7){_0x374a15[_0x18e4('0x12')](0x194);}return _0x22cec7;};}function handleError(_0x1f4e55,_0x5ab413){_0x5ab413=_0x5ab413||0x1f4;return function(_0x3adb23){logger[_0x18e4('0x1e')](_0x3adb23[_0x18e4('0x1f')]);if(_0x3adb23[_0x18e4('0x20')]){delete _0x3adb23[_0x18e4('0x20')];}_0x1f4e55[_0x18e4('0x14')](_0x5ab413)[_0x18e4('0x21')](_0x3adb23);};}exports[_0x18e4('0x22')]=function(_0x7c8def,_0x8fefe3){var _0x3d5e88={},_0x23d34b={},_0x2d509a={'count':0x0,'rows':[]};var _0x1b0f73=db[_0x18e4('0x23')]['rawAttributes'];_0x23d34b[_0x18e4('0x24')]=_['keys'](_0x1b0f73);var _0x235017={'dateStart':_0x7c8def[_0x18e4('0x25')][_0x18e4('0x26')],'dateEnd':_0x7c8def[_0x18e4('0x25')]['dateEnd']};delete _0x7c8def[_0x18e4('0x25')][_0x18e4('0x26')];delete _0x7c8def['query']['dateEnd'];_0x23d34b[_0x18e4('0x25')]=_[_0x18e4('0x27')](_0x7c8def[_0x18e4('0x25')]);_0x23d34b[_0x18e4('0x28')]=_['intersection'](_0x23d34b[_0x18e4('0x24')],_0x23d34b[_0x18e4('0x25')]);_0x3d5e88[_0x18e4('0x29')]=_[_0x18e4('0x2a')](_0x23d34b['model'],qs[_0x18e4('0x2b')](_0x7c8def[_0x18e4('0x25')][_0x18e4('0x2b')]));_0x3d5e88[_0x18e4('0x29')]=_0x3d5e88[_0x18e4('0x29')]['length']?_0x3d5e88[_0x18e4('0x29')]:_0x23d34b[_0x18e4('0x24')];if(!_0x7c8def[_0x18e4('0x25')][_0x18e4('0x2c')](_0x18e4('0x2d'))){_0x3d5e88['limit']=qs[_0x18e4('0x17')](_0x7c8def[_0x18e4('0x25')]['limit']);_0x3d5e88['offset']=qs['offset'](_0x7c8def[_0x18e4('0x25')][_0x18e4('0x16')]);}_0x3d5e88['order']=qs[_0x18e4('0x2e')](_0x7c8def[_0x18e4('0x25')][_0x18e4('0x2e')]);_0x3d5e88['where']=qs[_0x18e4('0x28')](_['pick'](_0x7c8def[_0x18e4('0x25')],_0x23d34b[_0x18e4('0x28')]));if(_0x235017['dateStart']){if(_0x235017['dateEnd']){_0x235017[_0x18e4('0x2f')]=moment(_0x235017['dateEnd'])[_0x18e4('0x30')](0x1,_0x18e4('0x31'));}else{_0x235017[_0x18e4('0x2f')]=moment(_0x235017['dateStart'])[_0x18e4('0x30')](0x1,'day');}_[_0x18e4('0x32')](_0x3d5e88['where'],{'createdAt':{'$gte':_0x235017[_0x18e4('0x26')],'$lte':_0x235017[_0x18e4('0x2f')]}});}if(_0x7c8def['query'][_0x18e4('0x33')]){_0x3d5e88[_0x18e4('0x34')]=_[_0x18e4('0x32')](_0x3d5e88[_0x18e4('0x34')],{'$or':_[_0x18e4('0x35')](_0x1b0f73,function(_0x21554d){if(_0x21554d['type'][_0x18e4('0x36')]!==_0x18e4('0x37')){var _0xfc1dea={};_0xfc1dea[_0x21554d[_0x18e4('0x38')]]={'$like':'%'+_0x7c8def[_0x18e4('0x25')][_0x18e4('0x33')]+'%'};return _0xfc1dea;}})});}_0x3d5e88=_[_0x18e4('0x32')]({},_0x3d5e88,_0x7c8def['options']);var _0x25a7cb={'where':_0x3d5e88[_0x18e4('0x34')]};return db['FaxQueueReport'][_0x18e4('0x39')](_0x25a7cb)[_0x18e4('0x1d')](function(_0x229b37){_0x2d509a[_0x18e4('0x39')]=_0x229b37;if(_0x7c8def[_0x18e4('0x25')][_0x18e4('0x3a')]){_0x3d5e88['include']=[{'all':!![]}];}return db[_0x18e4('0x23')][_0x18e4('0x3b')](_0x3d5e88);})['then'](function(_0xb3dde9){_0x2d509a[_0x18e4('0x3c')]=_0xb3dde9;return _0x2d509a;})[_0x18e4('0x1d')](respondWithFilteredResult(_0x8fefe3,_0x3d5e88))['catch'](handleError(_0x8fefe3,null));};exports[_0x18e4('0x3d')]=function(_0x174e20,_0x3b56c5){var _0xad3d01={'raw':!![],'where':{'id':_0x174e20[_0x18e4('0x3e')]['id']}},_0x5bbebc={};_0x5bbebc['model']=_[_0x18e4('0x27')](db[_0x18e4('0x23')][_0x18e4('0x3f')]);_0x5bbebc['query']=_[_0x18e4('0x27')](_0x174e20['query']);_0x5bbebc[_0x18e4('0x28')]=_[_0x18e4('0x2a')](_0x5bbebc[_0x18e4('0x24')],_0x5bbebc[_0x18e4('0x25')]);_0xad3d01[_0x18e4('0x29')]=_[_0x18e4('0x2a')](_0x5bbebc['model'],qs[_0x18e4('0x2b')](_0x174e20[_0x18e4('0x25')][_0x18e4('0x2b')]));_0xad3d01[_0x18e4('0x29')]=_0xad3d01['attributes']['length']?_0xad3d01['attributes']:_0x5bbebc[_0x18e4('0x24')];if(_0x174e20[_0x18e4('0x25')][_0x18e4('0x3a')]){_0xad3d01['include']=[{'all':!![]}];}_0xad3d01=_[_0x18e4('0x32')]({},_0xad3d01,_0x174e20['options']);return db['FaxQueueReport']['find'](_0xad3d01)[_0x18e4('0x1d')](handleEntityNotFound(_0x3b56c5,null))[_0x18e4('0x1d')](respondWithResult(_0x3b56c5,null))[_0x18e4('0x40')](handleError(_0x3b56c5,null));};exports['create']=function(_0x33d354,_0x567a27){return db['FaxQueueReport'][_0x18e4('0x41')](_0x33d354[_0x18e4('0x42')],{})[_0x18e4('0x1d')](respondWithResult(_0x567a27,0xc9))[_0x18e4('0x40')](handleError(_0x567a27,null));};exports[_0x18e4('0x43')]=function(_0x33ffac,_0x50cad4){if(_0x33ffac[_0x18e4('0x42')]['id']){delete _0x33ffac[_0x18e4('0x42')]['id'];}return db[_0x18e4('0x23')][_0x18e4('0x44')]({'where':{'id':_0x33ffac[_0x18e4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x50cad4,null))[_0x18e4('0x1d')](saveUpdates(_0x33ffac['body'],null))['then'](respondWithResult(_0x50cad4,null))[_0x18e4('0x40')](handleError(_0x50cad4,null));};exports[_0x18e4('0x1c')]=function(_0xb461f5,_0x3d6343){return db[_0x18e4('0x23')]['find']({'where':{'id':_0xb461f5[_0x18e4('0x3e')]['id']}})[_0x18e4('0x1d')](handleEntityNotFound(_0x3d6343,null))['then'](removeEntity(_0x3d6343,null))[_0x18e4('0x40')](handleError(_0x3d6343,null));};exports[_0x18e4('0x45')]=function(_0xbaf48e,_0x2c8865){return db[_0x18e4('0x23')][_0x18e4('0x45')]()[_0x18e4('0x1d')](respondWithResult(_0x2c8865,null))[_0x18e4('0x40')](handleError(_0x2c8865,null));};
\ No newline at end of file
index 3f0d685..e15cbcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2095=['bluebird','request-promise','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api','moment'];(function(_0x59a293,_0x33b4b3){var _0xccdddb=function(_0x1d4be4){while(--_0x1d4be4){_0x59a293['push'](_0x59a293['shift']());}};_0xccdddb(++_0x33b4b3);}(_0x2095,0x170));var _0x5209=function(_0x528c8f,_0x4417ab){_0x528c8f=_0x528c8f-0x0;var _0x3b3aa2=_0x2095[_0x528c8f];return _0x3b3aa2;};'use strict';var _=require(_0x5209('0x0'));var util=require(_0x5209('0x1'));var logger=require('../../config/logger')(_0x5209('0x2'));var moment=require(_0x5209('0x3'));var BPromise=require(_0x5209('0x4'));var rp=require(_0x5209('0x5'));var attributes=require(_0x5209('0x6'));module[_0x5209('0x7')]=function(_0x5c7a8d,_0xb38817){return _0x5c7a8d[_0x5209('0x8')](_0x5209('0x9'),attributes,{'tableName':_0x5209('0xa'),'paranoid':![],'indexes':[{'name':_0x5209('0xb'),'fields':[_0x5209('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7239=['../../config/logger','api','bluebird','exports','define','FaxQueueReport','report_fax_queue','uniqueid'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7239,0x88));var _0x9723=function(_0x58fcfe,_0x217c64){_0x58fcfe=_0x58fcfe-0x0;var _0x4c502a=_0x7239[_0x58fcfe];return _0x4c502a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9723('0x0'))(_0x9723('0x1'));var moment=require('moment');var BPromise=require(_0x9723('0x2'));var rp=require('request-promise');var attributes=require('./faxQueueReport.attributes');module[_0x9723('0x3')]=function(_0x2d4660,_0x3a4ee3){return _0x2d4660[_0x9723('0x4')](_0x9723('0x5'),attributes,{'tableName':_0x9723('0x6'),'paranoid':![],'indexes':[{'name':_0x9723('0x7'),'fields':[_0x9723('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
index a01b937..3d00634 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9348=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','FaxQueueReport','create','body','options','then','CreateFaxQueueReport','catch','UpdateFaxQueueReport','update','raw','where','limit','lodash','util','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9348,0x10d));var _0x8934=function(_0x443cef,_0x2cd289){_0x443cef=_0x443cef-0x0;var _0x147c47=_0x9348[_0x443cef];return _0x147c47;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['CreateFaxQueueReport']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')](_0x47f25e[_0x8934('0x18')],{'raw':_0x47f25e[_0x8934('0x19')]?_0x47f25e[_0x8934('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8934('0x1a')](function(_0x5ae49f){logger[_0x8934('0x14')](_0x8934('0x1b'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x1b'),_0x47f25e,JSON[_0x8934('0x10')](_0x5ae49f));_0x2ff9ce(_0x5ae49f);})[_0x8934('0x1c')](function(_0x36fe20){logger['error'](_0x8934('0x1b'),_0x36fe20[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed[_0x8934('0x11')](0x1f4,_0x36fe20[_0x8934('0x13')]));});});};exports[_0x8934('0x1d')]=function(_0x5e593b){var _0x3cf295=this;return new Promise(function(_0x1c15c5,_0x1b5775){return db['FaxQueueReport'][_0x8934('0x1e')](_0x5e593b['body'],{'raw':_0x5e593b[_0x8934('0x19')]?_0x5e593b[_0x8934('0x19')][_0x8934('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e593b['options']?_0x5e593b[_0x8934('0x19')][_0x8934('0x20')]||null:null,'attributes':_0x5e593b[_0x8934('0x19')]?_0x5e593b[_0x8934('0x19')]['attributes']||null:null,'limit':_0x5e593b[_0x8934('0x19')]?_0x5e593b[_0x8934('0x19')][_0x8934('0x21')]||null:null})[_0x8934('0x1a')](function(_0x44972b){logger[_0x8934('0x14')](_0x8934('0x1d'),_0x5e593b);logger[_0x8934('0xd')](_0x8934('0x1d'),_0x5e593b,JSON[_0x8934('0x10')](_0x44972b));_0x1c15c5(_0x44972b);})['catch'](function(_0x1d068c){logger[_0x8934('0x11')]('UpdateFaxQueueReport',_0x1d068c[_0x8934('0x13')],_0x5e593b);_0x1b5775(_0x3cf295[_0x8934('0x11')](0x1f4,_0x1d068c[_0x8934('0x13')]));});});};
\ No newline at end of file
+var _0x2f68=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','FaxQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','UpdateFaxQueueReport','where','attributes','limit','util'];(function(_0x3151ba,_0x5325ef){var _0x4206cd=function(_0x4ec733){while(--_0x4ec733){_0x3151ba['push'](_0x3151ba['shift']());}};_0x4206cd(++_0x5325ef);}(_0x2f68,0x12b));var _0x82f6=function(_0x3685aa,_0xe9bfd0){_0x3685aa=_0x3685aa-0x0;var _0x5dfb2b=_0x2f68[_0x3685aa];return _0x5dfb2b;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require(_0x82f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x82f6('0x5'));var logger=require(_0x82f6('0x6'))(_0x82f6('0x7'));var config=require(_0x82f6('0x8'));var jayson=require(_0x82f6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9ad1f,_0x4fa10f,_0x282bc8){return new BPromise(function(_0x3fd6ef,_0x159ea8){return client['request'](_0x9ad1f,_0x282bc8)[_0x82f6('0xa')](function(_0x415226){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x4fa10f,'request\x20sent');logger[_0x82f6('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x4fa10f,'request\x20sent',JSON[_0x82f6('0xe')](_0x415226));if(_0x415226['error']){if(_0x415226[_0x82f6('0xf')][_0x82f6('0x10')]===0x1f4){logger['error'](_0x82f6('0xc'),_0x4fa10f,_0x415226['error'][_0x82f6('0x11')]);return _0x159ea8(_0x415226['error']['message']);}logger[_0x82f6('0xf')](_0x82f6('0xc'),_0x4fa10f,_0x415226[_0x82f6('0xf')][_0x82f6('0x11')]);return _0x3fd6ef(_0x415226[_0x82f6('0xf')][_0x82f6('0x11')]);}else{logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x4fa10f,_0x82f6('0x12'));_0x3fd6ef(_0x415226[_0x82f6('0x13')][_0x82f6('0x11')]);}})[_0x82f6('0x14')](function(_0x412d1f){logger[_0x82f6('0xf')](_0x82f6('0xc'),_0x4fa10f,_0x412d1f);_0x159ea8(_0x412d1f);});});}exports[_0x82f6('0x15')]=function(_0x59333a){var _0x2a16e2=this;return new Promise(function(_0x39dea8,_0x32b458){return db[_0x82f6('0x16')]['create'](_0x59333a[_0x82f6('0x17')],{'raw':_0x59333a[_0x82f6('0x18')]?_0x59333a[_0x82f6('0x18')][_0x82f6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3abb44){logger[_0x82f6('0xb')]('CreateFaxQueueReport',_0x59333a);logger[_0x82f6('0xd')](_0x82f6('0x15'),_0x59333a,JSON[_0x82f6('0xe')](_0x3abb44));_0x39dea8(_0x3abb44);})['catch'](function(_0x2099dc){logger['error'](_0x82f6('0x15'),_0x2099dc['message'],_0x59333a);_0x32b458(_0x2a16e2[_0x82f6('0xf')](0x1f4,_0x2099dc[_0x82f6('0x11')]));});});};exports[_0x82f6('0x1a')]=function(_0x219101){var _0x390681=this;return new Promise(function(_0x4b9384,_0x6aa93d){return db[_0x82f6('0x16')]['update'](_0x219101[_0x82f6('0x17')],{'raw':_0x219101['options']?_0x219101[_0x82f6('0x18')][_0x82f6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x219101[_0x82f6('0x18')]?_0x219101['options'][_0x82f6('0x1b')]||null:null,'attributes':_0x219101[_0x82f6('0x18')]?_0x219101['options'][_0x82f6('0x1c')]||null:null,'limit':_0x219101[_0x82f6('0x18')]?_0x219101[_0x82f6('0x18')][_0x82f6('0x1d')]||null:null})[_0x82f6('0xa')](function(_0x4fde1b){logger[_0x82f6('0xb')](_0x82f6('0x1a'),_0x219101);logger[_0x82f6('0xd')](_0x82f6('0x1a'),_0x219101,JSON[_0x82f6('0xe')](_0x4fde1b));_0x4b9384(_0x4fde1b);})['catch'](function(_0x18b21a){logger['error'](_0x82f6('0x1a'),_0x18b21a['message'],_0x219101);_0x6aa93d(_0x390681[_0x82f6('0xf')](0x1f4,_0x18b21a['message']));});});};
\ No newline at end of file
index 6572193..7f8a143 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefcd=['/describe','describe','/:id','post','create','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x57ec1a,_0x2b7624){var _0x2159ad=function(_0x4738b4){while(--_0x4738b4){_0x57ec1a['push'](_0x57ec1a['shift']());}};_0x2159ad(++_0x2b7624);}(_0xefcd,0xe0));var _0xdefc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xefcd[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0xdefc('0x0'));var path=require(_0xdefc('0x1'));var timeout=require(_0xdefc('0x2'));var express=require(_0xdefc('0x3'));var router=express['Router']();var auth=require(_0xdefc('0x4'));var interaction=require(_0xdefc('0x5'));var config=require(_0xdefc('0x6'));var controller=require(_0xdefc('0x7'));router[_0xdefc('0x8')]('/',auth[_0xdefc('0x9')](),controller['index']);router[_0xdefc('0x8')](_0xdefc('0xa'),auth[_0xdefc('0x9')](),controller[_0xdefc('0xb')]);router[_0xdefc('0x8')](_0xdefc('0xc'),auth[_0xdefc('0x9')](),controller['show']);router[_0xdefc('0xd')]('/',auth['isAuthenticated'](),controller[_0xdefc('0xe')]);router['put']('/:id',auth[_0xdefc('0x9')](),controller[_0xdefc('0xf')]);router[_0xdefc('0x10')](_0xdefc('0xc'),auth[_0xdefc('0x9')](),controller['destroy']);module[_0xdefc('0x11')]=router;
\ No newline at end of file
+var _0x890b=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x3bc217,_0x3dfc07){var _0x79fac3=function(_0x37dd94){while(--_0x37dd94){_0x3bc217['push'](_0x3bc217['shift']());}};_0x79fac3(++_0x3dfc07);}(_0x890b,0x93));var _0xb890=function(_0xf02b80,_0x44754a){_0xf02b80=_0xf02b80-0x0;var _0x2442be=_0x890b[_0xf02b80];return _0x2442be;};'use strict';var multer=require(_0xb890('0x0'));var util=require(_0xb890('0x1'));var path=require(_0xb890('0x2'));var timeout=require(_0xb890('0x3'));var express=require(_0xb890('0x4'));var router=express[_0xb890('0x5')]();var auth=require(_0xb890('0x6'));var interaction=require(_0xb890('0x7'));var config=require(_0xb890('0x8'));var controller=require('./faxQueueReport.controller');router[_0xb890('0x9')]('/',auth[_0xb890('0xa')](),controller[_0xb890('0xb')]);router[_0xb890('0x9')](_0xb890('0xc'),auth['isAuthenticated'](),controller[_0xb890('0xd')]);router['get'](_0xb890('0xe'),auth[_0xb890('0xa')](),controller[_0xb890('0xf')]);router[_0xb890('0x10')]('/',auth['isAuthenticated'](),controller[_0xb890('0x11')]);router[_0xb890('0x12')]('/:id',auth[_0xb890('0xa')](),controller[_0xb890('0x13')]);router[_0xb890('0x14')](_0xb890('0xe'),auth[_0xb890('0xa')](),controller[_0xb890('0x15')]);module[_0xb890('0x16')]=router;
\ No newline at end of file
index 950650d..8ce89ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x388c=['account','agent','queue','NOW','moment','exports','STRING'];(function(_0x1605b7,_0x13302a){var _0x3c6527=function(_0x3a2240){while(--_0x3a2240){_0x1605b7['push'](_0x1605b7['shift']());}};_0x3c6527(++_0x13302a);}(_0x388c,0xe4));var _0xc388=function(_0x5c70ae,_0x1ccbd6){_0x5c70ae=_0x5c70ae-0x0;var _0x2f6022=_0x388c[_0x5c70ae];return _0x2f6022;};'use strict';var moment=require(_0xc388('0x0'));var Sequelize=require('sequelize');module[_0xc388('0x1')]={'uniqueid':{'type':Sequelize[_0xc388('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc388('0x3'),_0xc388('0x4'),'queue'),'allowNull':![],'defaultValue':_0xc388('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xc388('0x6')]}};
\ No newline at end of file
+var _0x1a37=['ENUM','agent','queue','DATE','moment','sequelize','STRING'];(function(_0x4b62cf,_0x3b3f0e){var _0x549704=function(_0x48072a){while(--_0x48072a){_0x4b62cf['push'](_0x4b62cf['shift']());}};_0x549704(++_0x3b3f0e);}(_0x1a37,0x82));var _0x71a3=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x1a37[_0x397cfb];return _0x15fed9;};'use strict';var moment=require(_0x71a3('0x0'));var Sequelize=require(_0x71a3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x71a3('0x3')]('account',_0x71a3('0x4'),_0x71a3('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x71a3('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 29dd98c..449b5eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['attributes','length','model','nolimit','limit','order','sort','where','filters','dateStart','dateEnd','day','add','merge','filter','map','type','VIRTUAL','field','includeAll','include','catch','show','params','options','find','create','body','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','FaxTransferReport','rawAttributes','keys','query','intersection','fields'];(function(_0x155e04,_0x28cd61){var _0x4590d0=function(_0x3f685b){while(--_0x3f685b){_0x155e04['push'](_0x155e04['shift']());}};_0x4590d0(++_0x28cd61);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var qs=require(_0x0d8b('0xf'));var logger=require(_0x0d8b('0x10'))(_0x0d8b('0x11'));var utils=require(_0x0d8b('0x12'));var config=require('../../config/environment');var db=require(_0x0d8b('0x13'))['db'];function respondWithStatusCode(_0x4e0269,_0x4225c4){_0x4225c4=_0x4225c4||0xcc;return function(_0xc574a3){if(_0xc574a3){return _0x4e0269[_0x0d8b('0x14')](_0x4225c4);}return _0x4e0269[_0x0d8b('0x15')](_0x4225c4)[_0x0d8b('0x16')]();};}function respondWithResult(_0x32bb1a,_0x15dd0f){_0x15dd0f=_0x15dd0f||0xc8;return function(_0x31a8cc){if(_0x31a8cc){return _0x32bb1a[_0x0d8b('0x15')](_0x15dd0f)[_0x0d8b('0x17')](_0x31a8cc);}};}function respondWithFilteredResult(_0x5ad086,_0xe65334){return function(_0x1567ce){if(_0x1567ce){var _0x2d4e1c=_0x1567ce[_0x0d8b('0x18')],_0x4f6f21=_0xe65334[_0x0d8b('0x19')],_0x23eb7b=_0xe65334[_0x0d8b('0x19')]+_0xe65334['limit'],_0xa86349;if(_0x23eb7b>=_0x2d4e1c){_0x23eb7b=_0x2d4e1c;_0xa86349=0xc8;}else{_0xa86349=0xce;}_0x5ad086[_0x0d8b('0x15')](_0xa86349);return _0x5ad086[_0x0d8b('0x1a')](_0x0d8b('0x1b'),_0x4f6f21+'-'+_0x23eb7b+'/'+_0x2d4e1c)[_0x0d8b('0x17')](_0x1567ce);}return null;};}function patchUpdates(_0x333674){return function(_0x18dd2d){try{jsonpatch[_0x0d8b('0x1c')](_0x18dd2d,_0x333674,!![]);}catch(_0xa3612a){return BPromise['reject'](_0xa3612a);}return _0x18dd2d[_0x0d8b('0x1d')]();};}function saveUpdates(_0x23d58f,_0x196c0a){return function(_0x143372){if(_0x143372){return _0x143372[_0x0d8b('0x1e')](_0x23d58f)[_0x0d8b('0x1f')](function(_0x393beb){return _0x393beb;});}return null;};}function removeEntity(_0x352c17,_0x50ec1e){return function(_0x4f0a1a){if(_0x4f0a1a){return _0x4f0a1a[_0x0d8b('0x20')]()['then'](function(){_0x352c17['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x238728,_0x2b924f){return function(_0x214778){if(!_0x214778){_0x238728[_0x0d8b('0x14')](0x194);}return _0x214778;};}function handleError(_0x221071,_0x2c64e2){_0x2c64e2=_0x2c64e2||0x1f4;return function(_0x30980c){logger[_0x0d8b('0x21')](_0x30980c[_0x0d8b('0x22')]);if(_0x30980c['name']){delete _0x30980c[_0x0d8b('0x23')];}_0x221071[_0x0d8b('0x15')](_0x2c64e2)['send'](_0x30980c);};}exports[_0x0d8b('0x24')]=function(_0x4a0ae4,_0x3dd149){var _0x234bdd={},_0xa2af02={},_0x4fe6f9={'count':0x0,'rows':[]};var _0x59a905=db[_0x0d8b('0x25')][_0x0d8b('0x26')];_0xa2af02['model']=_[_0x0d8b('0x27')](_0x59a905);var _0x59aa83={'dateStart':_0x4a0ae4[_0x0d8b('0x28')]['dateStart'],'dateEnd':_0x4a0ae4[_0x0d8b('0x28')]['dateEnd']};delete _0x4a0ae4[_0x0d8b('0x28')]['dateStart'];delete _0x4a0ae4[_0x0d8b('0x28')]['dateEnd'];_0xa2af02[_0x0d8b('0x28')]=_[_0x0d8b('0x27')](_0x4a0ae4[_0x0d8b('0x28')]);_0xa2af02['filters']=_['intersection'](_0xa2af02['model'],_0xa2af02[_0x0d8b('0x28')]);_0x234bdd['attributes']=_[_0x0d8b('0x29')](_0xa2af02['model'],qs['fields'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x2a')]));_0x234bdd[_0x0d8b('0x2b')]=_0x234bdd[_0x0d8b('0x2b')][_0x0d8b('0x2c')]?_0x234bdd[_0x0d8b('0x2b')]:_0xa2af02[_0x0d8b('0x2d')];if(!_0x4a0ae4[_0x0d8b('0x28')]['hasOwnProperty'](_0x0d8b('0x2e'))){_0x234bdd[_0x0d8b('0x2f')]=qs['limit'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x2f')]);_0x234bdd[_0x0d8b('0x19')]=qs['offset'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x19')]);}_0x234bdd[_0x0d8b('0x30')]=qs[_0x0d8b('0x31')](_0x4a0ae4[_0x0d8b('0x28')]['sort']);_0x234bdd[_0x0d8b('0x32')]=qs[_0x0d8b('0x33')](_['pick'](_0x4a0ae4[_0x0d8b('0x28')],_0xa2af02[_0x0d8b('0x33')]));if(_0x59aa83[_0x0d8b('0x34')]){if(_0x59aa83[_0x0d8b('0x35')]){_0x59aa83[_0x0d8b('0x35')]=moment(_0x59aa83['dateEnd'])['add'](0x1,_0x0d8b('0x36'));}else{_0x59aa83['dateEnd']=moment(_0x59aa83['dateStart'])[_0x0d8b('0x37')](0x1,_0x0d8b('0x36'));}_[_0x0d8b('0x38')](_0x234bdd[_0x0d8b('0x32')],{'createdAt':{'$gte':_0x59aa83[_0x0d8b('0x34')],'$lte':_0x59aa83[_0x0d8b('0x35')]}});}if(_0x4a0ae4['query'][_0x0d8b('0x39')]){_0x234bdd[_0x0d8b('0x32')]=_[_0x0d8b('0x38')](_0x234bdd[_0x0d8b('0x32')],{'$or':_[_0x0d8b('0x3a')](_0x59a905,function(_0x1a39ad){if(_0x1a39ad[_0x0d8b('0x3b')]['key']!==_0x0d8b('0x3c')){var _0x34acb5={};_0x34acb5[_0x1a39ad[_0x0d8b('0x3d')]]={'$like':'%'+_0x4a0ae4[_0x0d8b('0x28')]['filter']+'%'};return _0x34acb5;}})});}_0x234bdd=_[_0x0d8b('0x38')]({},_0x234bdd,_0x4a0ae4['options']);var _0x37b26c={'where':_0x234bdd[_0x0d8b('0x32')]};return db[_0x0d8b('0x25')][_0x0d8b('0x18')](_0x37b26c)[_0x0d8b('0x1f')](function(_0x3e632e){_0x4fe6f9[_0x0d8b('0x18')]=_0x3e632e;if(_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x234bdd[_0x0d8b('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x234bdd);})['then'](function(_0x4d0811){_0x4fe6f9['rows']=_0x4d0811;return _0x4fe6f9;})[_0x0d8b('0x1f')](respondWithFilteredResult(_0x3dd149,_0x234bdd))[_0x0d8b('0x40')](handleError(_0x3dd149,null));};exports[_0x0d8b('0x41')]=function(_0x5100cf,_0x4a76a3){var _0x1b216d={'raw':!![],'where':{'id':_0x5100cf[_0x0d8b('0x42')]['id']}},_0x192de1={};_0x192de1['model']=_[_0x0d8b('0x27')](db[_0x0d8b('0x25')]['rawAttributes']);_0x192de1['query']=_[_0x0d8b('0x27')](_0x5100cf['query']);_0x192de1[_0x0d8b('0x33')]=_['intersection'](_0x192de1['model'],_0x192de1[_0x0d8b('0x28')]);_0x1b216d[_0x0d8b('0x2b')]=_['intersection'](_0x192de1['model'],qs['fields'](_0x5100cf['query'][_0x0d8b('0x2a')]));_0x1b216d[_0x0d8b('0x2b')]=_0x1b216d[_0x0d8b('0x2b')]['length']?_0x1b216d[_0x0d8b('0x2b')]:_0x192de1[_0x0d8b('0x2d')];if(_0x5100cf[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x1b216d[_0x0d8b('0x3f')]=[{'all':!![]}];}_0x1b216d=_[_0x0d8b('0x38')]({},_0x1b216d,_0x5100cf[_0x0d8b('0x43')]);return db[_0x0d8b('0x25')][_0x0d8b('0x44')](_0x1b216d)[_0x0d8b('0x1f')](handleEntityNotFound(_0x4a76a3,null))[_0x0d8b('0x1f')](respondWithResult(_0x4a76a3,null))[_0x0d8b('0x40')](handleError(_0x4a76a3,null));};exports[_0x0d8b('0x45')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x25')][_0x0d8b('0x45')](_0x3e569b[_0x0d8b('0x46')],{})[_0x0d8b('0x1f')](respondWithResult(_0x570af8,0xc9))['catch'](handleError(_0x570af8,null));};exports[_0x0d8b('0x1e')]=function(_0x4d8850,_0x5d29ab){if(_0x4d8850[_0x0d8b('0x46')]['id']){delete _0x4d8850[_0x0d8b('0x46')]['id'];}return db[_0x0d8b('0x25')][_0x0d8b('0x44')]({'where':{'id':_0x4d8850['params']['id']}})[_0x0d8b('0x1f')](handleEntityNotFound(_0x5d29ab,null))[_0x0d8b('0x1f')](saveUpdates(_0x4d8850[_0x0d8b('0x46')],null))[_0x0d8b('0x1f')](respondWithResult(_0x5d29ab,null))[_0x0d8b('0x40')](handleError(_0x5d29ab,null));};exports['destroy']=function(_0x5c0824,_0x4e4d5f){return db['FaxTransferReport'][_0x0d8b('0x44')]({'where':{'id':_0x5c0824[_0x0d8b('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e4d5f,null))['then'](removeEntity(_0x4e4d5f,null))[_0x0d8b('0x40')](handleError(_0x4e4d5f,null));};exports[_0x0d8b('0x47')]=function(_0x5c5bd7,_0x5ef6c3){return db[_0x0d8b('0x25')][_0x0d8b('0x47')]()[_0x0d8b('0x1f')](respondWithResult(_0x5ef6c3,null))[_0x0d8b('0x40')](handleError(_0x5ef6c3,null));};
\ No newline at end of file
+var _0xe618=['create','body','update','describe','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','json','apply','save','destroy','then','stack','send','FaxTransferReport','rawAttributes','model','keys','query','dateEnd','dateStart','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','pick','add','day','merge','filter','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find'];(function(_0x3c5998,_0x3c69b3){var _0x1db21a=function(_0x24e4ec){while(--_0x24e4ec){_0x3c5998['push'](_0x3c5998['shift']());}};_0x1db21a(++_0x3c69b3);}(_0xe618,0x1ee));var _0x8e61=function(_0x3182f2,_0x242888){_0x3182f2=_0x3182f2-0x0;var _0x5ed78d=_0xe618[_0x3182f2];return _0x5ed78d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8e61('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e61('0x1'));var moment=require(_0x8e61('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8e61('0x3'));var util=require(_0x8e61('0x4'));var path=require(_0x8e61('0x5'));var sox=require(_0x8e61('0x6'));var csv=require(_0x8e61('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e61('0x8'));var squel=require(_0x8e61('0x9'));var crypto=require(_0x8e61('0xa'));var jsforce=require(_0x8e61('0xb'));var deskjs=require(_0x8e61('0xc'));var toCsv=require(_0x8e61('0x7'));var querystring=require(_0x8e61('0xd'));var Papa=require('papaparse');var Redis=require(_0x8e61('0xe'));var qs=require(_0x8e61('0xf'));var logger=require(_0x8e61('0x10'))(_0x8e61('0x11'));var utils=require('../../config/utils');var config=require(_0x8e61('0x12'));var db=require(_0x8e61('0x13'))['db'];function respondWithStatusCode(_0x11f6e5,_0x418044){_0x418044=_0x418044||0xcc;return function(_0x419909){if(_0x419909){return _0x11f6e5[_0x8e61('0x14')](_0x418044);}return _0x11f6e5[_0x8e61('0x15')](_0x418044)['end']();};}function respondWithResult(_0x4d0918,_0x5d1d9a){_0x5d1d9a=_0x5d1d9a||0xc8;return function(_0x105adb){if(_0x105adb){return _0x4d0918[_0x8e61('0x15')](_0x5d1d9a)['json'](_0x105adb);}};}function respondWithFilteredResult(_0x3874d5,_0x23f6e1){return function(_0xbca4f4){if(_0xbca4f4){var _0x435687=_0xbca4f4[_0x8e61('0x16')],_0x33295d=_0x23f6e1[_0x8e61('0x17')],_0x2496bb=_0x23f6e1[_0x8e61('0x17')]+_0x23f6e1['limit'],_0x210cac;if(_0x2496bb>=_0x435687){_0x2496bb=_0x435687;_0x210cac=0xc8;}else{_0x210cac=0xce;}_0x3874d5[_0x8e61('0x15')](_0x210cac);return _0x3874d5[_0x8e61('0x18')]('Content-Range',_0x33295d+'-'+_0x2496bb+'/'+_0x435687)[_0x8e61('0x19')](_0xbca4f4);}return null;};}function patchUpdates(_0xbb5e78){return function(_0x19fbc8){try{jsonpatch[_0x8e61('0x1a')](_0x19fbc8,_0xbb5e78,!![]);}catch(_0x21e4eb){return BPromise['reject'](_0x21e4eb);}return _0x19fbc8[_0x8e61('0x1b')]();};}function saveUpdates(_0x27cf57,_0x77a1f0){return function(_0x7a648f){if(_0x7a648f){return _0x7a648f['update'](_0x27cf57)['then'](function(_0x40007d){return _0x40007d;});}return null;};}function removeEntity(_0x3e2dd7,_0x2a882e){return function(_0x589d82){if(_0x589d82){return _0x589d82[_0x8e61('0x1c')]()[_0x8e61('0x1d')](function(){_0x3e2dd7[_0x8e61('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4886e8,_0x3cf681){return function(_0x395a8b){if(!_0x395a8b){_0x4886e8[_0x8e61('0x14')](0x194);}return _0x395a8b;};}function handleError(_0x543b22,_0x353268){_0x353268=_0x353268||0x1f4;return function(_0x2b7815){logger['error'](_0x2b7815[_0x8e61('0x1e')]);if(_0x2b7815['name']){delete _0x2b7815['name'];}_0x543b22[_0x8e61('0x15')](_0x353268)[_0x8e61('0x1f')](_0x2b7815);};}exports['index']=function(_0x1ddef8,_0x3494f6){var _0x2d21f9={},_0x27d827={},_0x50e4a9={'count':0x0,'rows':[]};var _0x35e364=db[_0x8e61('0x20')][_0x8e61('0x21')];_0x27d827[_0x8e61('0x22')]=_[_0x8e61('0x23')](_0x35e364);var _0x4cfde6={'dateStart':_0x1ddef8[_0x8e61('0x24')]['dateStart'],'dateEnd':_0x1ddef8[_0x8e61('0x24')][_0x8e61('0x25')]};delete _0x1ddef8[_0x8e61('0x24')][_0x8e61('0x26')];delete _0x1ddef8['query'][_0x8e61('0x25')];_0x27d827[_0x8e61('0x24')]=_[_0x8e61('0x23')](_0x1ddef8[_0x8e61('0x24')]);_0x27d827['filters']=_[_0x8e61('0x27')](_0x27d827[_0x8e61('0x22')],_0x27d827[_0x8e61('0x24')]);_0x2d21f9[_0x8e61('0x28')]=_[_0x8e61('0x27')](_0x27d827['model'],qs[_0x8e61('0x29')](_0x1ddef8['query'][_0x8e61('0x29')]));_0x2d21f9[_0x8e61('0x28')]=_0x2d21f9[_0x8e61('0x28')]['length']?_0x2d21f9['attributes']:_0x27d827['model'];if(!_0x1ddef8[_0x8e61('0x24')][_0x8e61('0x2a')]('nolimit')){_0x2d21f9['limit']=qs['limit'](_0x1ddef8['query'][_0x8e61('0x2b')]);_0x2d21f9['offset']=qs['offset'](_0x1ddef8['query'][_0x8e61('0x17')]);}_0x2d21f9['order']=qs['sort'](_0x1ddef8[_0x8e61('0x24')][_0x8e61('0x2c')]);_0x2d21f9[_0x8e61('0x2d')]=qs[_0x8e61('0x2e')](_[_0x8e61('0x2f')](_0x1ddef8[_0x8e61('0x24')],_0x27d827['filters']));if(_0x4cfde6[_0x8e61('0x26')]){if(_0x4cfde6[_0x8e61('0x25')]){_0x4cfde6[_0x8e61('0x25')]=moment(_0x4cfde6[_0x8e61('0x25')])[_0x8e61('0x30')](0x1,_0x8e61('0x31'));}else{_0x4cfde6[_0x8e61('0x25')]=moment(_0x4cfde6[_0x8e61('0x26')])[_0x8e61('0x30')](0x1,_0x8e61('0x31'));}_[_0x8e61('0x32')](_0x2d21f9[_0x8e61('0x2d')],{'createdAt':{'$gte':_0x4cfde6[_0x8e61('0x26')],'$lte':_0x4cfde6['dateEnd']}});}if(_0x1ddef8['query'][_0x8e61('0x33')]){_0x2d21f9['where']=_[_0x8e61('0x32')](_0x2d21f9[_0x8e61('0x2d')],{'$or':_[_0x8e61('0x34')](_0x35e364,function(_0x250704){if(_0x250704[_0x8e61('0x35')]['key']!==_0x8e61('0x36')){var _0x57838f={};_0x57838f[_0x250704[_0x8e61('0x37')]]={'$like':'%'+_0x1ddef8[_0x8e61('0x24')]['filter']+'%'};return _0x57838f;}})});}_0x2d21f9=_[_0x8e61('0x32')]({},_0x2d21f9,_0x1ddef8[_0x8e61('0x38')]);var _0x4fa1aa={'where':_0x2d21f9[_0x8e61('0x2d')]};return db[_0x8e61('0x20')]['count'](_0x4fa1aa)[_0x8e61('0x1d')](function(_0x1f3fed){_0x50e4a9[_0x8e61('0x16')]=_0x1f3fed;if(_0x1ddef8[_0x8e61('0x24')][_0x8e61('0x39')]){_0x2d21f9[_0x8e61('0x3a')]=[{'all':!![]}];}return db[_0x8e61('0x20')][_0x8e61('0x3b')](_0x2d21f9);})[_0x8e61('0x1d')](function(_0x3b6c83){_0x50e4a9[_0x8e61('0x3c')]=_0x3b6c83;return _0x50e4a9;})[_0x8e61('0x1d')](respondWithFilteredResult(_0x3494f6,_0x2d21f9))[_0x8e61('0x3d')](handleError(_0x3494f6,null));};exports[_0x8e61('0x3e')]=function(_0x3bbf53,_0x484bc7){var _0x4a7eff={'raw':!![],'where':{'id':_0x3bbf53[_0x8e61('0x3f')]['id']}},_0x5a8256={};_0x5a8256[_0x8e61('0x22')]=_[_0x8e61('0x23')](db[_0x8e61('0x20')][_0x8e61('0x21')]);_0x5a8256[_0x8e61('0x24')]=_['keys'](_0x3bbf53['query']);_0x5a8256[_0x8e61('0x2e')]=_[_0x8e61('0x27')](_0x5a8256['model'],_0x5a8256[_0x8e61('0x24')]);_0x4a7eff[_0x8e61('0x28')]=_[_0x8e61('0x27')](_0x5a8256['model'],qs[_0x8e61('0x29')](_0x3bbf53[_0x8e61('0x24')][_0x8e61('0x29')]));_0x4a7eff[_0x8e61('0x28')]=_0x4a7eff[_0x8e61('0x28')][_0x8e61('0x40')]?_0x4a7eff[_0x8e61('0x28')]:_0x5a8256[_0x8e61('0x22')];if(_0x3bbf53[_0x8e61('0x24')][_0x8e61('0x39')]){_0x4a7eff[_0x8e61('0x3a')]=[{'all':!![]}];}_0x4a7eff=_[_0x8e61('0x32')]({},_0x4a7eff,_0x3bbf53['options']);return db['FaxTransferReport'][_0x8e61('0x41')](_0x4a7eff)[_0x8e61('0x1d')](handleEntityNotFound(_0x484bc7,null))[_0x8e61('0x1d')](respondWithResult(_0x484bc7,null))['catch'](handleError(_0x484bc7,null));};exports[_0x8e61('0x42')]=function(_0x4e6c60,_0x273006){return db['FaxTransferReport'][_0x8e61('0x42')](_0x4e6c60[_0x8e61('0x43')],{})[_0x8e61('0x1d')](respondWithResult(_0x273006,0xc9))[_0x8e61('0x3d')](handleError(_0x273006,null));};exports[_0x8e61('0x44')]=function(_0x4e869a,_0x1abb3e){if(_0x4e869a[_0x8e61('0x43')]['id']){delete _0x4e869a[_0x8e61('0x43')]['id'];}return db[_0x8e61('0x20')][_0x8e61('0x41')]({'where':{'id':_0x4e869a[_0x8e61('0x3f')]['id']}})[_0x8e61('0x1d')](handleEntityNotFound(_0x1abb3e,null))[_0x8e61('0x1d')](saveUpdates(_0x4e869a['body'],null))['then'](respondWithResult(_0x1abb3e,null))[_0x8e61('0x3d')](handleError(_0x1abb3e,null));};exports['destroy']=function(_0x2815b6,_0x2b025a){return db[_0x8e61('0x20')][_0x8e61('0x41')]({'where':{'id':_0x2815b6[_0x8e61('0x3f')]['id']}})[_0x8e61('0x1d')](handleEntityNotFound(_0x2b025a,null))['then'](removeEntity(_0x2b025a,null))['catch'](handleError(_0x2b025a,null));};exports[_0x8e61('0x45')]=function(_0x17be96,_0x29895b){return db[_0x8e61('0x20')][_0x8e61('0x45')]()[_0x8e61('0x1d')](respondWithResult(_0x29895b,null))[_0x8e61('0x3d')](handleError(_0x29895b,null));};
\ No newline at end of file
index 739604f..43a7fbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x581e=['moment','bluebird','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api'];(function(_0xb4e663,_0x55a593){var _0x3fa134=function(_0x291d19){while(--_0x291d19){_0xb4e663['push'](_0xb4e663['shift']());}};_0x3fa134(++_0x55a593);}(_0x581e,0x13d));var _0xe581=function(_0x148ada,_0xdd1b6c){_0x148ada=_0x148ada-0x0;var _0xc10203=_0x581e[_0x148ada];return _0xc10203;};'use strict';var _=require(_0xe581('0x0'));var util=require(_0xe581('0x1'));var logger=require('../../config/logger')(_0xe581('0x2'));var moment=require(_0xe581('0x3'));var BPromise=require(_0xe581('0x4'));var rp=require('request-promise');var attributes=require(_0xe581('0x5'));module['exports']=function(_0x46dea0,_0x3dc079){return _0x46dea0[_0xe581('0x6')](_0xe581('0x7'),attributes,{'tableName':_0xe581('0x8'),'paranoid':![],'indexes':[{'name':_0xe581('0x9'),'fields':[_0xe581('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf282=['define','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','./faxTransferReport.attributes'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xf282,0x130));var _0x2f28=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf282[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f28('0x0'))(_0x2f28('0x1'));var moment=require(_0x2f28('0x2'));var BPromise=require(_0x2f28('0x3'));var rp=require(_0x2f28('0x4'));var attributes=require(_0x2f28('0x5'));module['exports']=function(_0x47d18b,_0x328f1d){return _0x47d18b[_0x2f28('0x6')](_0x2f28('0x7'),attributes,{'tableName':_0x2f28('0x8'),'paranoid':![],'indexes':[{'name':_0x2f28('0x9'),'fields':[_0x2f28('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 85449eb..4018eea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc921=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x513f69,_0x591b05){var _0x142bad=function(_0x4a8826){while(--_0x4a8826){_0x513f69['push'](_0x513f69['shift']());}};_0x142bad(++_0x591b05);}(_0xc921,0x70));var _0x1c92=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xc921[_0x235482];return _0x5f5bea;};'use strict';var _=require(_0x1c92('0x0'));var util=require(_0x1c92('0x1'));var moment=require(_0x1c92('0x2'));var BPromise=require(_0x1c92('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c92('0x4'));var db=require(_0x1c92('0x5'))['db'];var utils=require(_0x1c92('0x6'));var logger=require(_0x1c92('0x7'))(_0x1c92('0x8'));var config=require(_0x1c92('0x9'));var jayson=require(_0x1c92('0xa'));var client=jayson['client'][_0x1c92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7eb59a,_0x59729c,_0x54e525){return new BPromise(function(_0x449336,_0x625a01){return client['request'](_0x7eb59a,_0x54e525)['then'](function(_0x5aa361){logger[_0x1c92('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x59729c,'request\x20sent');logger[_0x1c92('0xd')](_0x1c92('0xe'),_0x59729c,'request\x20sent',JSON[_0x1c92('0xf')](_0x5aa361));if(_0x5aa361['error']){if(_0x5aa361[_0x1c92('0x10')][_0x1c92('0x11')]===0x1f4){logger[_0x1c92('0x10')](_0x1c92('0x12'),_0x59729c,_0x5aa361[_0x1c92('0x10')]['message']);return _0x625a01(_0x5aa361[_0x1c92('0x10')][_0x1c92('0x13')]);}logger[_0x1c92('0x10')](_0x1c92('0x12'),_0x59729c,_0x5aa361[_0x1c92('0x10')]['message']);return _0x449336(_0x5aa361[_0x1c92('0x10')][_0x1c92('0x13')]);}else{logger[_0x1c92('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x59729c,_0x1c92('0x14'));_0x449336(_0x5aa361[_0x1c92('0x15')][_0x1c92('0x13')]);}})[_0x1c92('0x16')](function(_0x2760ee){logger[_0x1c92('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x59729c,_0x2760ee);_0x625a01(_0x2760ee);});});}
\ No newline at end of file
+var _0xe8f3=['request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x30ac7e,_0x2a8369){var _0x449c1f=function(_0x3552b4){while(--_0x3552b4){_0x30ac7e['push'](_0x30ac7e['shift']());}};_0x449c1f(++_0x2a8369);}(_0xe8f3,0xe4));var _0x3e8f=function(_0xb397b7,_0x318353){_0xb397b7=_0xb397b7-0x0;var _0x515da9=_0xe8f3[_0xb397b7];return _0x515da9;};'use strict';var _=require(_0x3e8f('0x0'));var util=require(_0x3e8f('0x1'));var moment=require('moment');var BPromise=require(_0x3e8f('0x2'));var rs=require(_0x3e8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e8f('0x4'))['db'];var utils=require(_0x3e8f('0x5'));var logger=require(_0x3e8f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3e8f('0x7'));var client=jayson[_0x3e8f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x415fcd,_0x26ecd0,_0x5b5374){return new BPromise(function(_0x55be10,_0xd2c54b){return client[_0x3e8f('0x9')](_0x415fcd,_0x5b5374)['then'](function(_0xcd0b01){logger[_0x3e8f('0xa')](_0x3e8f('0xb'),_0x26ecd0,_0x3e8f('0xc'));logger[_0x3e8f('0xd')](_0x3e8f('0xe'),_0x26ecd0,_0x3e8f('0xc'),JSON[_0x3e8f('0xf')](_0xcd0b01));if(_0xcd0b01[_0x3e8f('0x10')]){if(_0xcd0b01[_0x3e8f('0x10')][_0x3e8f('0x11')]===0x1f4){logger[_0x3e8f('0x10')](_0x3e8f('0xb'),_0x26ecd0,_0xcd0b01['error'][_0x3e8f('0x12')]);return _0xd2c54b(_0xcd0b01['error'][_0x3e8f('0x12')]);}logger[_0x3e8f('0x10')](_0x3e8f('0xb'),_0x26ecd0,_0xcd0b01['error']['message']);return _0x55be10(_0xcd0b01[_0x3e8f('0x10')][_0x3e8f('0x12')]);}else{logger[_0x3e8f('0xa')](_0x3e8f('0xb'),_0x26ecd0,_0x3e8f('0xc'));_0x55be10(_0xcd0b01['result'][_0x3e8f('0x12')]);}})[_0x3e8f('0x13')](function(_0x85615c){logger[_0x3e8f('0x10')](_0x3e8f('0xb'),_0x26ecd0,_0x85615c);_0xd2c54b(_0x85615c);});});}
\ No newline at end of file
index a6cc879..1b8dcac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x5b940b,_0x451fb5){var _0x4fc692=function(_0x1dffad){while(--_0x1dffad){_0x5b940b['push'](_0x5b940b['shift']());}};_0x4fc692(++_0x451fb5);}(_0x17ba,0xab));var _0xa17b=function(_0x23559d,_0x55e1c7){_0x23559d=_0x23559d-0x0;var _0x453b0f=_0x17ba[_0x23559d];return _0x453b0f;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var auth=require(_0xa17b('0x5'));var interaction=require(_0xa17b('0x6'));var config=require(_0xa17b('0x7'));var controller=require(_0xa17b('0x8'));router[_0xa17b('0x9')]('/',auth[_0xa17b('0xa')](),controller[_0xa17b('0xb')]);router[_0xa17b('0x9')](_0xa17b('0xc'),auth[_0xa17b('0xa')](),controller[_0xa17b('0xd')]);router[_0xa17b('0x9')](_0xa17b('0xe'),auth[_0xa17b('0xa')](),controller[_0xa17b('0xf')]);router[_0xa17b('0x10')]('/',auth['isAuthenticated'](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xe'),auth[_0xa17b('0xa')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')](_0xa17b('0xe'),auth['isAuthenticated'](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router;
\ No newline at end of file
+var _0x9a19=['get','isAuthenticated','index','/describe','/:id','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x9a02d1,_0x2e730e){var _0x349fda=function(_0x46008b){while(--_0x46008b){_0x9a02d1['push'](_0x9a02d1['shift']());}};_0x349fda(++_0x2e730e);}(_0x9a19,0x114));var _0x99a1=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x9a19[_0x337748];return _0x3bb03f;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var auth=require(_0x99a1('0x5'));var interaction=require(_0x99a1('0x6'));var config=require(_0x99a1('0x7'));var controller=require(_0x99a1('0x8'));router[_0x99a1('0x9')]('/',auth[_0x99a1('0xa')](),controller[_0x99a1('0xb')]);router[_0x99a1('0x9')](_0x99a1('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x99a1('0xd'),auth[_0x99a1('0xa')](),controller['show']);router['post']('/',auth[_0x99a1('0xa')](),controller[_0x99a1('0xe')]);router[_0x99a1('0xf')](_0x99a1('0xd'),auth[_0x99a1('0xa')](),controller['update']);router[_0x99a1('0x10')](_0x99a1('0xd'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x11')]);module[_0x99a1('0x12')]=router;
\ No newline at end of file
index 1ecd87f..90ae913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x744e=['path','express','Router','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','delete','exports','util'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x744e,0xd1));var _0xe744=function(_0x664467,_0x380ff3){_0x664467=_0x664467-0x0;var _0x42b8d5=_0x744e[_0x664467];return _0x42b8d5;};'use strict';var multer=require('multer');var util=require(_0xe744('0x0'));var path=require(_0xe744('0x1'));var timeout=require('connect-timeout');var express=require(_0xe744('0x2'));var router=express[_0xe744('0x3')]();var auth=require(_0xe744('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe744('0x5'));var controller=require(_0xe744('0x6'));router[_0xe744('0x7')]('/',auth['isAuthenticated'](),controller[_0xe744('0x8')]);router[_0xe744('0x7')]('/:id',auth[_0xe744('0x9')](),controller[_0xe744('0xa')]);router[_0xe744('0x7')](_0xe744('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe744('0x7')](_0xe744('0xc'),auth[_0xe744('0x9')](),controller[_0xe744('0xd')]);router['post']('/',auth[_0xe744('0x9')](),controller[_0xe744('0xe')]);router[_0xe744('0xf')](_0xe744('0xb'),auth[_0xe744('0x9')](),controller[_0xe744('0x10')]);router[_0xe744('0x11')](_0xe744('0x12'),auth[_0xe744('0x9')](),controller['update']);router[_0xe744('0x13')]('/:id',auth[_0xe744('0x9')](),controller['destroy']);module[_0xe744('0x14')]=router;
\ No newline at end of file
+var _0x8239=['isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x8239,0x137));var _0x9823=function(_0x3a6e7e,_0x417e){_0x3a6e7e=_0x3a6e7e-0x0;var _0x4df5cc=_0x8239[_0x3a6e7e];return _0x4df5cc;};'use strict';var multer=require(_0x9823('0x0'));var util=require('util');var path=require(_0x9823('0x1'));var timeout=require(_0x9823('0x2'));var express=require(_0x9823('0x3'));var router=express['Router']();var auth=require(_0x9823('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9823('0x5'));var controller=require('./intDeskAccount.controller');router[_0x9823('0x6')]('/',auth['isAuthenticated'](),controller[_0x9823('0x7')]);router[_0x9823('0x6')](_0x9823('0x8'),auth[_0x9823('0x9')](),controller[_0x9823('0xa')]);router[_0x9823('0x6')](_0x9823('0xb'),auth[_0x9823('0x9')](),controller['getConfigurations']);router[_0x9823('0x6')](_0x9823('0xc'),auth[_0x9823('0x9')](),controller[_0x9823('0xd')]);router[_0x9823('0xe')]('/',auth['isAuthenticated'](),controller[_0x9823('0xf')]);router[_0x9823('0xe')](_0x9823('0xb'),auth[_0x9823('0x9')](),controller[_0x9823('0x10')]);router[_0x9823('0x11')](_0x9823('0x8'),auth[_0x9823('0x9')](),controller['update']);router[_0x9823('0x12')](_0x9823('0x8'),auth[_0x9823('0x9')](),controller['destroy']);module[_0x9823('0x13')]=router;
\ No newline at end of file
index f595d11..eadf890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50c4=['STRING','ENUM','basic','integrationTab','exports'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x50c4,0x1bc));var _0x450c=function(_0x3fee7e,_0xcaeb28){_0x3fee7e=_0x3fee7e-0x0;var _0x200ed5=_0x50c4[_0x3fee7e];return _0x200ed5;};'use strict';var Sequelize=require('sequelize');module[_0x450c('0x0')]={'name':{'type':Sequelize[_0x450c('0x1')]},'description':{'type':Sequelize[_0x450c('0x1')]},'username':{'type':Sequelize[_0x450c('0x1')]},'remoteUri':{'type':Sequelize[_0x450c('0x1')]},'authType':{'type':Sequelize[_0x450c('0x2')]('basic'),'defaultValue':_0x450c('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x450c('0x1')]},'consumerSecret':{'type':Sequelize[_0x450c('0x1')]},'token':{'type':Sequelize[_0x450c('0x1')]},'tokenSecret':{'type':Sequelize[_0x450c('0x1')]},'serverUrl':{'type':Sequelize[_0x450c('0x1')]},'type':{'type':Sequelize[_0x450c('0x2')](_0x450c('0x4'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0xf31d=['ENUM','basic','newTab','integrationTab','exports','STRING'];(function(_0x117cc0,_0x2e2a26){var _0x330b53=function(_0x2e4d62){while(--_0x2e4d62){_0x117cc0['push'](_0x117cc0['shift']());}};_0x330b53(++_0x2e2a26);}(_0xf31d,0x142));var _0xdf31=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xf31d[_0x3a6efd];return _0x487b9a;};'use strict';var Sequelize=require('sequelize');module[_0xdf31('0x0')]={'name':{'type':Sequelize[_0xdf31('0x1')]},'description':{'type':Sequelize[_0xdf31('0x1')]},'username':{'type':Sequelize[_0xdf31('0x1')]},'remoteUri':{'type':Sequelize[_0xdf31('0x1')]},'authType':{'type':Sequelize[_0xdf31('0x2')](_0xdf31('0x3')),'defaultValue':_0xdf31('0x3')},'password':{'type':Sequelize[_0xdf31('0x1')]},'consumerKey':{'type':Sequelize[_0xdf31('0x1')]},'consumerSecret':{'type':Sequelize[_0xdf31('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xdf31('0x1')]},'serverUrl':{'type':Sequelize[_0xdf31('0x1')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xdf31('0x4')),'defaultValue':_0xdf31('0x5')}};
\ No newline at end of file
index a3cb7dc..35bd7ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a8b=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','set','reject','save','update','destroy','name','index','DeskAccount','rawAttributes','model','keys','query','dateStart','dateEnd','attributes','intersection','fields','length','limit','order','sort','where','filters','add','day','merge','filter','map','type','key','VIRTUAL','includeAll','findAll','rows','show','params','include','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','consumerKey','consumerSecret','GET','format','%s/custom_fields','application/json','headers','%s:%s','username','toString','base64','concat','_embedded','entries','active','test','statusCode','stringify','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then'];(function(_0x328534,_0x33b41e){var _0x2796c0=function(_0x1ba8ad){while(--_0x1ba8ad){_0x328534['push'](_0x328534['shift']());}};_0x2796c0(++_0x33b41e);}(_0x9a8b,0xd3));var _0xb9a8=function(_0x149df7,_0x424f3f){_0x149df7=_0x149df7-0x0;var _0xbad03f=_0x9a8b[_0x149df7];return _0xbad03f;};'use strict';var pdf=require(_0xb9a8('0x0'));var emlformat=require(_0xb9a8('0x1'));var rimraf=require(_0xb9a8('0x2'));var zipdir=require(_0xb9a8('0x3'));var jsonpatch=require(_0xb9a8('0x4'));var rp=require(_0xb9a8('0x5'));var moment=require('moment');var BPromise=require(_0xb9a8('0x6'));var Mustache=require('mustache');var util=require(_0xb9a8('0x7'));var path=require(_0xb9a8('0x8'));var sox=require(_0xb9a8('0x9'));var csv=require(_0xb9a8('0xa'));var ejs=require(_0xb9a8('0xb'));var fs=require('fs');var _=require(_0xb9a8('0xc'));var squel=require(_0xb9a8('0xd'));var crypto=require('crypto');var jsforce=require(_0xb9a8('0xe'));var deskjs=require(_0xb9a8('0xf'));var toCsv=require(_0xb9a8('0xa'));var querystring=require(_0xb9a8('0x10'));var Papa=require(_0xb9a8('0x11'));var Redis=require(_0xb9a8('0x12'));var qs=require(_0xb9a8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb9a8('0x14'));var config=require(_0xb9a8('0x15'));var db=require(_0xb9a8('0x16'))['db'];var integrations=require(_0xb9a8('0x17'));var jayson=require(_0xb9a8('0x18'));var client=jayson[_0xb9a8('0x19')][_0xb9a8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2c6697,_0x363202,_0x58819a,_0x1bfc07){return new BPromise(function(_0x54d301,_0x3efb5f){var _0x3b9e01=_0x1bfc07||client;return _0x3b9e01[_0xb9a8('0x1b')](_0x2c6697,_0x58819a)[_0xb9a8('0x1c')](function(_0x40c7c6){logger[_0xb9a8('0x1d')](_0xb9a8('0x1e'),_0x363202,_0xb9a8('0x1f'));logger[_0xb9a8('0x20')](_0xb9a8('0x21'),_0x363202,_0xb9a8('0x1f'),JSON['stringify'](_0x40c7c6));if(_0x40c7c6['error']){if(_0x40c7c6['error']['code']===0x1f4){logger[_0xb9a8('0x22')](_0xb9a8('0x1e'),_0x363202,_0x40c7c6['error'][_0xb9a8('0x23')]);return _0x3efb5f(_0x40c7c6[_0xb9a8('0x22')][_0xb9a8('0x23')]);}logger[_0xb9a8('0x22')](_0xb9a8('0x1e'),_0x363202,_0x40c7c6[_0xb9a8('0x22')][_0xb9a8('0x23')]);return _0x54d301(_0x40c7c6[_0xb9a8('0x22')][_0xb9a8('0x23')]);}else{logger[_0xb9a8('0x1d')]('DeskAccount,\x20%s,\x20%s',_0x363202,_0xb9a8('0x1f'));_0x54d301(_0x40c7c6[_0xb9a8('0x24')][_0xb9a8('0x23')]);}})[_0xb9a8('0x25')](function(_0x3e24a8){logger[_0xb9a8('0x22')](_0xb9a8('0x1e'),_0x363202,_0x3e24a8);_0x3efb5f(_0x3e24a8);});});}function respondWithStatusCode(_0xd8e89d,_0x52dc7c){_0x52dc7c=_0x52dc7c||0xcc;return function(_0x39cd7c){if(_0x39cd7c){return _0xd8e89d[_0xb9a8('0x26')](_0x52dc7c);}return _0xd8e89d[_0xb9a8('0x27')](_0x52dc7c)[_0xb9a8('0x28')]();};}function respondWithResult(_0x31b838,_0x3f9298){_0x3f9298=_0x3f9298||0xc8;return function(_0x3ec1bc){if(_0x3ec1bc){return _0x31b838[_0xb9a8('0x27')](_0x3f9298)[_0xb9a8('0x29')](_0x3ec1bc);}};}function respondWithFilteredResult(_0x52981e,_0x543c37){return function(_0x4d3b9e){if(_0x4d3b9e){var _0x4e3144=_0x4d3b9e[_0xb9a8('0x2a')],_0x1c5668=_0x543c37[_0xb9a8('0x2b')],_0x38bac9=_0x543c37[_0xb9a8('0x2b')]+_0x543c37['limit'],_0x23aa21;if(_0x38bac9>=_0x4e3144){_0x38bac9=_0x4e3144;_0x23aa21=0xc8;}else{_0x23aa21=0xce;}_0x52981e[_0xb9a8('0x27')](_0x23aa21);return _0x52981e[_0xb9a8('0x2c')]('Content-Range',_0x1c5668+'-'+_0x38bac9+'/'+_0x4e3144)['json'](_0x4d3b9e);}return null;};}function patchUpdates(_0x11b86f){return function(_0xe878e3){try{jsonpatch['apply'](_0xe878e3,_0x11b86f,!![]);}catch(_0x3777a7){return BPromise[_0xb9a8('0x2d')](_0x3777a7);}return _0xe878e3[_0xb9a8('0x2e')]();};}function saveUpdates(_0x2f4d8e,_0x349fc1){return function(_0x4f3874){if(_0x4f3874){return _0x4f3874[_0xb9a8('0x2f')](_0x2f4d8e)[_0xb9a8('0x1c')](function(_0x285d39){return _0x285d39;});}return null;};}function removeEntity(_0x48aa6b,_0x4b98a1){return function(_0x54c2a5){if(_0x54c2a5){return _0x54c2a5[_0xb9a8('0x30')]()['then'](function(){_0x48aa6b[_0xb9a8('0x27')](0xcc)[_0xb9a8('0x28')]();});}};}function handleEntityNotFound(_0x3d701d,_0x28ad0f){return function(_0x4d2806){if(!_0x4d2806){_0x3d701d[_0xb9a8('0x26')](0x194);}return _0x4d2806;};}function handleError(_0x1a2f72,_0x12d5d1){_0x12d5d1=_0x12d5d1||0x1f4;return function(_0x441fff){logger['error'](_0x441fff['stack']);if(_0x441fff[_0xb9a8('0x31')]){delete _0x441fff[_0xb9a8('0x31')];}_0x1a2f72[_0xb9a8('0x27')](_0x12d5d1)['send'](_0x441fff);};}exports[_0xb9a8('0x32')]=function(_0x26bc70,_0x3004f7){var _0x1ae83c={},_0x3669a3={},_0xe0a489={'count':0x0,'rows':[]};var _0x3d7508=db[_0xb9a8('0x33')][_0xb9a8('0x34')];_0x3669a3[_0xb9a8('0x35')]=_[_0xb9a8('0x36')](_0x3d7508);var _0x132693={'dateStart':_0x26bc70[_0xb9a8('0x37')][_0xb9a8('0x38')],'dateEnd':_0x26bc70['query'][_0xb9a8('0x39')]};delete _0x26bc70[_0xb9a8('0x37')]['dateStart'];delete _0x26bc70[_0xb9a8('0x37')]['dateEnd'];_0x3669a3[_0xb9a8('0x37')]=_[_0xb9a8('0x36')](_0x26bc70['query']);_0x3669a3['filters']=_['intersection'](_0x3669a3[_0xb9a8('0x35')],_0x3669a3[_0xb9a8('0x37')]);_0x1ae83c[_0xb9a8('0x3a')]=_[_0xb9a8('0x3b')](_0x3669a3[_0xb9a8('0x35')],qs[_0xb9a8('0x3c')](_0x26bc70[_0xb9a8('0x37')]['fields']));_0x1ae83c[_0xb9a8('0x3a')]=_0x1ae83c[_0xb9a8('0x3a')][_0xb9a8('0x3d')]?_0x1ae83c[_0xb9a8('0x3a')]:_0x3669a3[_0xb9a8('0x35')];if(!_0x26bc70[_0xb9a8('0x37')]['hasOwnProperty']('nolimit')){_0x1ae83c[_0xb9a8('0x3e')]=qs[_0xb9a8('0x3e')](_0x26bc70['query'][_0xb9a8('0x3e')]);_0x1ae83c[_0xb9a8('0x2b')]=qs[_0xb9a8('0x2b')](_0x26bc70['query'][_0xb9a8('0x2b')]);}_0x1ae83c[_0xb9a8('0x3f')]=qs[_0xb9a8('0x40')](_0x26bc70[_0xb9a8('0x37')]['sort']);_0x1ae83c[_0xb9a8('0x41')]=qs[_0xb9a8('0x42')](_['pick'](_0x26bc70['query'],_0x3669a3['filters']));if(_0x132693[_0xb9a8('0x38')]){if(_0x132693[_0xb9a8('0x39')]){_0x132693[_0xb9a8('0x39')]=moment(_0x132693[_0xb9a8('0x39')])['add'](0x1,'day');}else{_0x132693[_0xb9a8('0x39')]=moment(_0x132693['dateStart'])[_0xb9a8('0x43')](0x1,_0xb9a8('0x44'));}_[_0xb9a8('0x45')](_0x1ae83c[_0xb9a8('0x41')],{'createdAt':{'$gte':_0x132693['dateStart'],'$lte':_0x132693[_0xb9a8('0x39')]}});}if(_0x26bc70[_0xb9a8('0x37')][_0xb9a8('0x46')]){_0x1ae83c[_0xb9a8('0x41')]=_[_0xb9a8('0x45')](_0x1ae83c[_0xb9a8('0x41')],{'$or':_[_0xb9a8('0x47')](_0x3d7508,function(_0x4648f6){if(_0x4648f6[_0xb9a8('0x48')][_0xb9a8('0x49')]!==_0xb9a8('0x4a')){var _0x4c964b={};_0x4c964b[_0x4648f6['field']]={'$like':'%'+_0x26bc70[_0xb9a8('0x37')][_0xb9a8('0x46')]+'%'};return _0x4c964b;}})});}_0x1ae83c=_[_0xb9a8('0x45')]({},_0x1ae83c,_0x26bc70['options']);var _0x3e02ca={'where':_0x1ae83c['where']};return db[_0xb9a8('0x33')][_0xb9a8('0x2a')](_0x3e02ca)[_0xb9a8('0x1c')](function(_0x2799af){_0xe0a489[_0xb9a8('0x2a')]=_0x2799af;if(_0x26bc70['query'][_0xb9a8('0x4b')]){_0x1ae83c['include']=[{'all':!![]}];}return db[_0xb9a8('0x33')][_0xb9a8('0x4c')](_0x1ae83c);})[_0xb9a8('0x1c')](function(_0x29575a){_0xe0a489[_0xb9a8('0x4d')]=_0x29575a;return _0xe0a489;})[_0xb9a8('0x1c')](respondWithFilteredResult(_0x3004f7,_0x1ae83c))[_0xb9a8('0x25')](handleError(_0x3004f7,null));};exports[_0xb9a8('0x4e')]=function(_0x29e965,_0x5e023e){var _0x28ef79={'raw':![],'where':{'id':_0x29e965[_0xb9a8('0x4f')]['id']}},_0x760d05={};_0x760d05[_0xb9a8('0x35')]=_['keys'](db['DeskAccount']['rawAttributes']);_0x760d05[_0xb9a8('0x37')]=_[_0xb9a8('0x36')](_0x29e965[_0xb9a8('0x37')]);_0x760d05[_0xb9a8('0x42')]=_[_0xb9a8('0x3b')](_0x760d05[_0xb9a8('0x35')],_0x760d05[_0xb9a8('0x37')]);_0x28ef79[_0xb9a8('0x3a')]=_['intersection'](_0x760d05[_0xb9a8('0x35')],qs[_0xb9a8('0x3c')](_0x29e965['query'][_0xb9a8('0x3c')]));_0x28ef79[_0xb9a8('0x3a')]=_0x28ef79['attributes'][_0xb9a8('0x3d')]?_0x28ef79[_0xb9a8('0x3a')]:_0x760d05[_0xb9a8('0x35')];if(_0x29e965['query']['includeAll']){_0x28ef79[_0xb9a8('0x50')]=[{'all':!![]}];}_0x28ef79=_[_0xb9a8('0x45')]({},_0x28ef79,_0x29e965['options']);return db['DeskAccount'][_0xb9a8('0x51')](_0x28ef79)[_0xb9a8('0x1c')](handleEntityNotFound(_0x5e023e,null))[_0xb9a8('0x1c')](respondWithResult(_0x5e023e,null))['catch'](handleError(_0x5e023e,null));};exports[_0xb9a8('0x52')]=function(_0x4e9dfd,_0x136b69){return db[_0xb9a8('0x33')][_0xb9a8('0x52')](_0x4e9dfd['body'],{})['then'](respondWithResult(_0x136b69,0xc9))[_0xb9a8('0x25')](handleError(_0x136b69,null));};exports[_0xb9a8('0x2f')]=function(_0x23a500,_0xf20fd4){if(_0x23a500['body']['id']){delete _0x23a500[_0xb9a8('0x53')]['id'];}return db[_0xb9a8('0x33')]['find']({'where':{'id':_0x23a500['params']['id']}})[_0xb9a8('0x1c')](handleEntityNotFound(_0xf20fd4,null))[_0xb9a8('0x1c')](saveUpdates(_0x23a500['body'],null))[_0xb9a8('0x1c')](respondWithResult(_0xf20fd4,null))['catch'](handleError(_0xf20fd4,null));};exports[_0xb9a8('0x30')]=function(_0x36d00d,_0x43eef3){return db[_0xb9a8('0x33')][_0xb9a8('0x51')]({'where':{'id':_0x36d00d[_0xb9a8('0x4f')]['id']}})[_0xb9a8('0x1c')](handleEntityNotFound(_0x43eef3,null))['then'](removeEntity(_0x43eef3,null))[_0xb9a8('0x25')](handleError(_0x43eef3,null));};exports[_0xb9a8('0x54')]=function(_0x1ecf33,_0x4a29ac,_0xe088f4){var _0x6a159a={};var _0x428549={};var _0x2f7899;var _0x5a4874;return db[_0xb9a8('0x33')][_0xb9a8('0x55')]({'where':{'id':_0x1ecf33[_0xb9a8('0x4f')]['id']}})[_0xb9a8('0x1c')](handleEntityNotFound(_0x4a29ac,null))[_0xb9a8('0x1c')](function(_0x5da2d4){if(_0x5da2d4){_0x2f7899=_0x5da2d4;_0x428549['model']=_['keys'](db[_0xb9a8('0x56')][_0xb9a8('0x34')]);_0x428549[_0xb9a8('0x37')]=_['keys'](_0x1ecf33['query']);_0x428549[_0xb9a8('0x42')]=_[_0xb9a8('0x3b')](_0x428549['model'],_0x428549['query']);_0x6a159a[_0xb9a8('0x3a')]=_[_0xb9a8('0x3b')](_0x428549['model'],qs[_0xb9a8('0x3c')](_0x1ecf33['query'][_0xb9a8('0x3c')]));_0x6a159a[_0xb9a8('0x3a')]=_0x6a159a[_0xb9a8('0x3a')][_0xb9a8('0x3d')]?_0x6a159a[_0xb9a8('0x3a')]:_0x428549[_0xb9a8('0x35')];_0x6a159a[_0xb9a8('0x3f')]=qs[_0xb9a8('0x40')](_0x1ecf33[_0xb9a8('0x37')][_0xb9a8('0x40')]);_0x6a159a[_0xb9a8('0x41')]=qs['filters'](_[_0xb9a8('0x57')](_0x1ecf33[_0xb9a8('0x37')],_0x428549[_0xb9a8('0x42')]));if(_0x1ecf33[_0xb9a8('0x37')][_0xb9a8('0x46')]){_0x6a159a['where']=_['merge'](_0x6a159a[_0xb9a8('0x41')],{'$or':_[_0xb9a8('0x47')](_0x6a159a[_0xb9a8('0x3a')],function(_0x4df0a5){var _0x4a34a9={};_0x4a34a9[_0x4df0a5]={'$like':'%'+_0x1ecf33['query']['filter']+'%'};return _0x4a34a9;})});}_0x6a159a=_[_0xb9a8('0x45')]({},_0x6a159a,_0x1ecf33['options']);return _0x2f7899[_0xb9a8('0x54')](_0x6a159a);}})['then'](function(_0x5727ce){if(_0x5727ce){_0x5a4874=_0x5727ce['length'];if(!_0x1ecf33['query'][_0xb9a8('0x58')](_0xb9a8('0x59'))){_0x6a159a['limit']=qs[_0xb9a8('0x3e')](_0x1ecf33['query'][_0xb9a8('0x3e')]);_0x6a159a[_0xb9a8('0x2b')]=qs[_0xb9a8('0x2b')](_0x1ecf33['query'][_0xb9a8('0x2b')]);}return _0x2f7899[_0xb9a8('0x54')](_0x6a159a);}})['then'](function(_0x5d07d8){if(_0x5d07d8){return _0x5d07d8?{'count':_0x5a4874,'rows':_0x5d07d8}:null;}})[_0xb9a8('0x1c')](respondWithResult(_0x4a29ac,null))['catch'](handleError(_0x4a29ac,null));};exports[_0xb9a8('0x5a')]=function(_0x3f9135,_0x3226c3,_0x5d7718){if(_0x3f9135['body']['id']){delete _0x3f9135[_0xb9a8('0x53')]['id'];}return db[_0xb9a8('0x33')][_0xb9a8('0x55')]({'where':{'id':_0x3f9135['params']['id']}})[_0xb9a8('0x1c')](handleEntityNotFound(_0x3226c3,null))['then'](function(_0x53c07c){if(_0x53c07c){_0x3f9135[_0xb9a8('0x53')]['AccountId']=_0x53c07c['id'];_0x3f9135[_0xb9a8('0x53')]['Subjects']=integrations[_0xb9a8('0x5b')](_0x3f9135['body'][_0xb9a8('0x5c')],_0x3f9135[_0xb9a8('0x53')][_0xb9a8('0x48')]);_0x3f9135[_0xb9a8('0x53')][_0xb9a8('0x5d')]=integrations[_0xb9a8('0x5e')](_0x3f9135[_0xb9a8('0x53')][_0xb9a8('0x5c')],_0x3f9135[_0xb9a8('0x53')]['type']);return db['DeskConfiguration'][_0xb9a8('0x52')](_0x3f9135[_0xb9a8('0x53')],{'include':[{'model':db[_0xb9a8('0x5f')],'as':_0xb9a8('0x60')},{'model':db[_0xb9a8('0x5f')],'as':_0xb9a8('0x5d')}]});}return null;})[_0xb9a8('0x1c')](respondWithResult(_0x3226c3,null))[_0xb9a8('0x25')](handleError(_0x3226c3,null));};exports[_0xb9a8('0x61')]=function(_0x1960a6,_0x26c728,_0x282e9a){var _0x3943c=[{'name':_0xb9a8('0x62'),'label':_0xb9a8('0x62'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];return db['DeskAccount'][_0xb9a8('0x55')]({'where':{'id':_0x1960a6[_0xb9a8('0x4f')]['id']},'attributes':['id',_0xb9a8('0x63'),_0xb9a8('0x64'),'username','password',_0xb9a8('0x65'),_0xb9a8('0x66'),'token','tokenSecret']})[_0xb9a8('0x1c')](handleEntityNotFound(_0x26c728,null))[_0xb9a8('0x1c')](function(_0x360c83){if(_0x360c83){var _0x4b16fd={'method':_0xb9a8('0x67'),'uri':util[_0xb9a8('0x68')](_0xb9a8('0x69'),_0x360c83['remoteUri']),'headers':{'Content-Type':'application/json','Accept':_0xb9a8('0x6a')},'json':!![]};if(_0x360c83[_0xb9a8('0x64')]==='basic'){_0x4b16fd[_0xb9a8('0x6b')]['Authorization']=util[_0xb9a8('0x68')]('Basic\x20%s',new Buffer(util['format'](_0xb9a8('0x6c'),_0x360c83[_0xb9a8('0x6d')],_0x360c83['password']))[_0xb9a8('0x6e')](_0xb9a8('0x6f')));}return rp(_0x4b16fd)[_0xb9a8('0x1c')](function(_0x251e49){return _0x3943c[_0xb9a8('0x70')](_[_0xb9a8('0x47')](_0x251e49[_0xb9a8('0x71')][_0xb9a8('0x72')],function(_0x1c00ac){return{'id':_0x1c00ac[_0xb9a8('0x31')],'name':_0x1c00ac[_0xb9a8('0x31')],'type':_0x1c00ac[_0xb9a8('0x48')],'active':_0x1c00ac[_0xb9a8('0x73')],'label':_0x1c00ac['label'],'custom':!![]};}));});}})[_0xb9a8('0x1c')](function(_0x5d19e0){return{'count':_0x5d19e0[_0xb9a8('0x3d')],'rows':_0x5d19e0};})['then'](respondWithResult(_0x26c728,null))[_0xb9a8('0x25')](function(_0x2a2b3a){var _0x5a13dd=_0x1960a6['query'][_0xb9a8('0x74')]?0x1f4:_0x2a2b3a[_0xb9a8('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb9a8('0x61'),_0x5a13dd,JSON[_0xb9a8('0x76')](_0x2a2b3a));delete _0x2a2b3a[_0xb9a8('0x31')];if(_0x5a13dd===0x191){_0x5a13dd=0x190;}_0x26c728[_0xb9a8('0x27')](_0x5a13dd)[_0xb9a8('0x77')](_0x1960a6[_0xb9a8('0x37')][_0xb9a8('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x2a2b3a[_0xb9a8('0x75')]}:_0x2a2b3a);});};
\ No newline at end of file
+var _0x5b24=['sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','add','where','filter','map','type','VIRTUAL','field','merge','options','DeskAccount','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','GET','%s/custom_fields','application/json','Authorization','format','Basic\x20%s','%s:%s','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x53ab4a,_0xbdb9f5){var _0x5ea59a=function(_0xa06efa){while(--_0xa06efa){_0x53ab4a['push'](_0x53ab4a['shift']());}};_0x5ea59a(++_0xbdb9f5);}(_0x5b24,0x169));var _0x45b2=function(_0x109946,_0x3494b7){_0x109946=_0x109946-0x0;var _0x4ed20b=_0x5b24[_0x109946];return _0x4ed20b;};'use strict';var pdf=require(_0x45b2('0x0'));var emlformat=require(_0x45b2('0x1'));var rimraf=require(_0x45b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x45b2('0x3'));var rp=require('request-promise');var moment=require(_0x45b2('0x4'));var BPromise=require(_0x45b2('0x5'));var Mustache=require(_0x45b2('0x6'));var util=require(_0x45b2('0x7'));var path=require('path');var sox=require(_0x45b2('0x8'));var csv=require(_0x45b2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x45b2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x45b2('0xb'));var deskjs=require(_0x45b2('0xc'));var toCsv=require(_0x45b2('0x9'));var querystring=require(_0x45b2('0xd'));var Papa=require(_0x45b2('0xe'));var Redis=require(_0x45b2('0xf'));var qs=require(_0x45b2('0x10'));var logger=require(_0x45b2('0x11'))(_0x45b2('0x12'));var utils=require(_0x45b2('0x13'));var config=require(_0x45b2('0x14'));var db=require(_0x45b2('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x45b2('0x16'));var client=jayson[_0x45b2('0x17')][_0x45b2('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xa1fad2,_0x2cf0f2,_0x1fd53a,_0x4289da){return new BPromise(function(_0x345d46,_0x2c2214){var _0x4dc1aa=_0x4289da||client;return _0x4dc1aa[_0x45b2('0x19')](_0xa1fad2,_0x1fd53a)[_0x45b2('0x1a')](function(_0x5360e3){logger[_0x45b2('0x1b')](_0x45b2('0x1c'),_0x2cf0f2,_0x45b2('0x1d'));logger[_0x45b2('0x1e')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2cf0f2,_0x45b2('0x1d'),JSON[_0x45b2('0x1f')](_0x5360e3));if(_0x5360e3[_0x45b2('0x20')]){if(_0x5360e3[_0x45b2('0x20')][_0x45b2('0x21')]===0x1f4){logger[_0x45b2('0x20')]('DeskAccount,\x20%s,\x20%s',_0x2cf0f2,_0x5360e3['error']['message']);return _0x2c2214(_0x5360e3[_0x45b2('0x20')][_0x45b2('0x22')]);}logger[_0x45b2('0x20')](_0x45b2('0x1c'),_0x2cf0f2,_0x5360e3[_0x45b2('0x20')][_0x45b2('0x22')]);return _0x345d46(_0x5360e3['error'][_0x45b2('0x22')]);}else{logger[_0x45b2('0x1b')](_0x45b2('0x1c'),_0x2cf0f2,'request\x20sent');_0x345d46(_0x5360e3['result'][_0x45b2('0x22')]);}})[_0x45b2('0x23')](function(_0x368638){logger[_0x45b2('0x20')]('DeskAccount,\x20%s,\x20%s',_0x2cf0f2,_0x368638);_0x2c2214(_0x368638);});});}function respondWithStatusCode(_0x3ae6cc,_0x4f9d35){_0x4f9d35=_0x4f9d35||0xcc;return function(_0x2041ff){if(_0x2041ff){return _0x3ae6cc[_0x45b2('0x24')](_0x4f9d35);}return _0x3ae6cc[_0x45b2('0x25')](_0x4f9d35)[_0x45b2('0x26')]();};}function respondWithResult(_0x52f019,_0x552823){_0x552823=_0x552823||0xc8;return function(_0x1ff3d4){if(_0x1ff3d4){return _0x52f019[_0x45b2('0x25')](_0x552823)[_0x45b2('0x27')](_0x1ff3d4);}};}function respondWithFilteredResult(_0x599c13,_0x4d4d06){return function(_0x4962d6){if(_0x4962d6){var _0x124318=_0x4962d6[_0x45b2('0x28')],_0x34943a=_0x4d4d06[_0x45b2('0x29')],_0x56a77b=_0x4d4d06[_0x45b2('0x29')]+_0x4d4d06[_0x45b2('0x2a')],_0x3329b7;if(_0x56a77b>=_0x124318){_0x56a77b=_0x124318;_0x3329b7=0xc8;}else{_0x3329b7=0xce;}_0x599c13[_0x45b2('0x25')](_0x3329b7);return _0x599c13['set']('Content-Range',_0x34943a+'-'+_0x56a77b+'/'+_0x124318)[_0x45b2('0x27')](_0x4962d6);}return null;};}function patchUpdates(_0x4ce002){return function(_0x2977ef){try{jsonpatch[_0x45b2('0x2b')](_0x2977ef,_0x4ce002,!![]);}catch(_0x5847f7){return BPromise[_0x45b2('0x2c')](_0x5847f7);}return _0x2977ef[_0x45b2('0x2d')]();};}function saveUpdates(_0x4924e2,_0xc98bfb){return function(_0x29435b){if(_0x29435b){return _0x29435b[_0x45b2('0x2e')](_0x4924e2)[_0x45b2('0x1a')](function(_0xef7e56){return _0xef7e56;});}return null;};}function removeEntity(_0x23949b,_0x3dc291){return function(_0x1e24e9){if(_0x1e24e9){return _0x1e24e9[_0x45b2('0x2f')]()[_0x45b2('0x1a')](function(){_0x23949b[_0x45b2('0x25')](0xcc)[_0x45b2('0x26')]();});}};}function handleEntityNotFound(_0x192ebf,_0x354fdb){return function(_0x1a9c04){if(!_0x1a9c04){_0x192ebf[_0x45b2('0x24')](0x194);}return _0x1a9c04;};}function handleError(_0x12861a,_0x5c1ca8){_0x5c1ca8=_0x5c1ca8||0x1f4;return function(_0x2a9371){logger[_0x45b2('0x20')](_0x2a9371[_0x45b2('0x30')]);if(_0x2a9371['name']){delete _0x2a9371[_0x45b2('0x31')];}_0x12861a['status'](_0x5c1ca8)['send'](_0x2a9371);};}exports[_0x45b2('0x32')]=function(_0x514258,_0x52f5f5){var _0x26d7b4={},_0xf02d33={},_0x55d7dd={'count':0x0,'rows':[]};var _0x264d9f=db['DeskAccount'][_0x45b2('0x33')];_0xf02d33[_0x45b2('0x34')]=_[_0x45b2('0x35')](_0x264d9f);var _0x438919={'dateStart':_0x514258[_0x45b2('0x36')][_0x45b2('0x37')],'dateEnd':_0x514258[_0x45b2('0x36')][_0x45b2('0x38')]};delete _0x514258[_0x45b2('0x36')][_0x45b2('0x37')];delete _0x514258[_0x45b2('0x36')]['dateEnd'];_0xf02d33[_0x45b2('0x36')]=_['keys'](_0x514258[_0x45b2('0x36')]);_0xf02d33[_0x45b2('0x39')]=_[_0x45b2('0x3a')](_0xf02d33[_0x45b2('0x34')],_0xf02d33[_0x45b2('0x36')]);_0x26d7b4['attributes']=_[_0x45b2('0x3a')](_0xf02d33[_0x45b2('0x34')],qs[_0x45b2('0x3b')](_0x514258[_0x45b2('0x36')][_0x45b2('0x3b')]));_0x26d7b4[_0x45b2('0x3c')]=_0x26d7b4[_0x45b2('0x3c')][_0x45b2('0x3d')]?_0x26d7b4[_0x45b2('0x3c')]:_0xf02d33[_0x45b2('0x34')];if(!_0x514258[_0x45b2('0x36')]['hasOwnProperty'](_0x45b2('0x3e'))){_0x26d7b4['limit']=qs[_0x45b2('0x2a')](_0x514258['query'][_0x45b2('0x2a')]);_0x26d7b4['offset']=qs[_0x45b2('0x29')](_0x514258['query']['offset']);}_0x26d7b4[_0x45b2('0x3f')]=qs[_0x45b2('0x40')](_0x514258[_0x45b2('0x36')][_0x45b2('0x40')]);_0x26d7b4['where']=qs[_0x45b2('0x39')](_[_0x45b2('0x41')](_0x514258[_0x45b2('0x36')],_0xf02d33['filters']));if(_0x438919[_0x45b2('0x37')]){if(_0x438919[_0x45b2('0x38')]){_0x438919[_0x45b2('0x38')]=moment(_0x438919[_0x45b2('0x38')])[_0x45b2('0x42')](0x1,'day');}else{_0x438919['dateEnd']=moment(_0x438919['dateStart'])[_0x45b2('0x42')](0x1,'day');}_['merge'](_0x26d7b4[_0x45b2('0x43')],{'createdAt':{'$gte':_0x438919['dateStart'],'$lte':_0x438919['dateEnd']}});}if(_0x514258[_0x45b2('0x36')][_0x45b2('0x44')]){_0x26d7b4[_0x45b2('0x43')]=_['merge'](_0x26d7b4['where'],{'$or':_[_0x45b2('0x45')](_0x264d9f,function(_0x1cfbc7){if(_0x1cfbc7[_0x45b2('0x46')]['key']!==_0x45b2('0x47')){var _0x5d65f4={};_0x5d65f4[_0x1cfbc7[_0x45b2('0x48')]]={'$like':'%'+_0x514258[_0x45b2('0x36')][_0x45b2('0x44')]+'%'};return _0x5d65f4;}})});}_0x26d7b4=_[_0x45b2('0x49')]({},_0x26d7b4,_0x514258[_0x45b2('0x4a')]);var _0x1cd631={'where':_0x26d7b4[_0x45b2('0x43')]};return db[_0x45b2('0x4b')][_0x45b2('0x28')](_0x1cd631)[_0x45b2('0x1a')](function(_0x2d9e22){_0x55d7dd[_0x45b2('0x28')]=_0x2d9e22;if(_0x514258['query'][_0x45b2('0x4c')]){_0x26d7b4[_0x45b2('0x4d')]=[{'all':!![]}];}return db[_0x45b2('0x4b')][_0x45b2('0x4e')](_0x26d7b4);})[_0x45b2('0x1a')](function(_0x336861){_0x55d7dd[_0x45b2('0x4f')]=_0x336861;return _0x55d7dd;})[_0x45b2('0x1a')](respondWithFilteredResult(_0x52f5f5,_0x26d7b4))[_0x45b2('0x23')](handleError(_0x52f5f5,null));};exports[_0x45b2('0x50')]=function(_0xe03491,_0x1e737d){var _0x139359={'raw':![],'where':{'id':_0xe03491[_0x45b2('0x51')]['id']}},_0x539ffb={};_0x539ffb[_0x45b2('0x34')]=_[_0x45b2('0x35')](db[_0x45b2('0x4b')][_0x45b2('0x33')]);_0x539ffb['query']=_[_0x45b2('0x35')](_0xe03491[_0x45b2('0x36')]);_0x539ffb['filters']=_[_0x45b2('0x3a')](_0x539ffb['model'],_0x539ffb[_0x45b2('0x36')]);_0x139359[_0x45b2('0x3c')]=_[_0x45b2('0x3a')](_0x539ffb[_0x45b2('0x34')],qs[_0x45b2('0x3b')](_0xe03491[_0x45b2('0x36')][_0x45b2('0x3b')]));_0x139359[_0x45b2('0x3c')]=_0x139359['attributes'][_0x45b2('0x3d')]?_0x139359[_0x45b2('0x3c')]:_0x539ffb['model'];if(_0xe03491[_0x45b2('0x36')]['includeAll']){_0x139359['include']=[{'all':!![]}];}_0x139359=_[_0x45b2('0x49')]({},_0x139359,_0xe03491[_0x45b2('0x4a')]);return db[_0x45b2('0x4b')][_0x45b2('0x52')](_0x139359)[_0x45b2('0x1a')](handleEntityNotFound(_0x1e737d,null))[_0x45b2('0x1a')](respondWithResult(_0x1e737d,null))[_0x45b2('0x23')](handleError(_0x1e737d,null));};exports['create']=function(_0x54984c,_0x35e01b){return db[_0x45b2('0x4b')][_0x45b2('0x53')](_0x54984c[_0x45b2('0x54')],{})[_0x45b2('0x1a')](respondWithResult(_0x35e01b,0xc9))[_0x45b2('0x23')](handleError(_0x35e01b,null));};exports['update']=function(_0x5ebf37,_0x506502){if(_0x5ebf37[_0x45b2('0x54')]['id']){delete _0x5ebf37[_0x45b2('0x54')]['id'];}return db['DeskAccount'][_0x45b2('0x52')]({'where':{'id':_0x5ebf37[_0x45b2('0x51')]['id']}})[_0x45b2('0x1a')](handleEntityNotFound(_0x506502,null))[_0x45b2('0x1a')](saveUpdates(_0x5ebf37[_0x45b2('0x54')],null))[_0x45b2('0x1a')](respondWithResult(_0x506502,null))[_0x45b2('0x23')](handleError(_0x506502,null));};exports[_0x45b2('0x2f')]=function(_0x17feff,_0xb27aa2){return db[_0x45b2('0x4b')][_0x45b2('0x52')]({'where':{'id':_0x17feff[_0x45b2('0x51')]['id']}})['then'](handleEntityNotFound(_0xb27aa2,null))['then'](removeEntity(_0xb27aa2,null))[_0x45b2('0x23')](handleError(_0xb27aa2,null));};exports[_0x45b2('0x55')]=function(_0x5a17df,_0x2a636f,_0x58d6fc){var _0x369413={};var _0x1a4c73={};var _0x32d7ed;var _0x5776b4;return db['DeskAccount'][_0x45b2('0x56')]({'where':{'id':_0x5a17df[_0x45b2('0x51')]['id']}})['then'](handleEntityNotFound(_0x2a636f,null))[_0x45b2('0x1a')](function(_0x264735){if(_0x264735){_0x32d7ed=_0x264735;_0x1a4c73[_0x45b2('0x34')]=_[_0x45b2('0x35')](db[_0x45b2('0x57')][_0x45b2('0x33')]);_0x1a4c73[_0x45b2('0x36')]=_[_0x45b2('0x35')](_0x5a17df['query']);_0x1a4c73[_0x45b2('0x39')]=_[_0x45b2('0x3a')](_0x1a4c73['model'],_0x1a4c73[_0x45b2('0x36')]);_0x369413[_0x45b2('0x3c')]=_[_0x45b2('0x3a')](_0x1a4c73[_0x45b2('0x34')],qs[_0x45b2('0x3b')](_0x5a17df[_0x45b2('0x36')]['fields']));_0x369413['attributes']=_0x369413[_0x45b2('0x3c')][_0x45b2('0x3d')]?_0x369413['attributes']:_0x1a4c73[_0x45b2('0x34')];_0x369413[_0x45b2('0x3f')]=qs[_0x45b2('0x40')](_0x5a17df[_0x45b2('0x36')][_0x45b2('0x40')]);_0x369413[_0x45b2('0x43')]=qs[_0x45b2('0x39')](_['pick'](_0x5a17df['query'],_0x1a4c73[_0x45b2('0x39')]));if(_0x5a17df[_0x45b2('0x36')][_0x45b2('0x44')]){_0x369413['where']=_[_0x45b2('0x49')](_0x369413[_0x45b2('0x43')],{'$or':_[_0x45b2('0x45')](_0x369413[_0x45b2('0x3c')],function(_0x9b7faa){var _0x5d8ff1={};_0x5d8ff1[_0x9b7faa]={'$like':'%'+_0x5a17df['query']['filter']+'%'};return _0x5d8ff1;})});}_0x369413=_[_0x45b2('0x49')]({},_0x369413,_0x5a17df['options']);return _0x32d7ed[_0x45b2('0x55')](_0x369413);}})[_0x45b2('0x1a')](function(_0x30b6da){if(_0x30b6da){_0x5776b4=_0x30b6da[_0x45b2('0x3d')];if(!_0x5a17df[_0x45b2('0x36')][_0x45b2('0x58')](_0x45b2('0x3e'))){_0x369413['limit']=qs[_0x45b2('0x2a')](_0x5a17df[_0x45b2('0x36')]['limit']);_0x369413[_0x45b2('0x29')]=qs[_0x45b2('0x29')](_0x5a17df['query'][_0x45b2('0x29')]);}return _0x32d7ed[_0x45b2('0x55')](_0x369413);}})[_0x45b2('0x1a')](function(_0x23dd3f){if(_0x23dd3f){return _0x23dd3f?{'count':_0x5776b4,'rows':_0x23dd3f}:null;}})[_0x45b2('0x1a')](respondWithResult(_0x2a636f,null))[_0x45b2('0x23')](handleError(_0x2a636f,null));};exports[_0x45b2('0x59')]=function(_0x19c108,_0x52b496,_0x673786){if(_0x19c108[_0x45b2('0x54')]['id']){delete _0x19c108[_0x45b2('0x54')]['id'];}return db[_0x45b2('0x4b')][_0x45b2('0x56')]({'where':{'id':_0x19c108[_0x45b2('0x51')]['id']}})['then'](handleEntityNotFound(_0x52b496,null))[_0x45b2('0x1a')](function(_0x12d4bc){if(_0x12d4bc){_0x19c108[_0x45b2('0x54')][_0x45b2('0x5a')]=_0x12d4bc['id'];_0x19c108[_0x45b2('0x54')]['Subjects']=integrations[_0x45b2('0x5b')](_0x19c108[_0x45b2('0x54')][_0x45b2('0x5c')],_0x19c108[_0x45b2('0x54')][_0x45b2('0x46')]);_0x19c108[_0x45b2('0x54')][_0x45b2('0x5d')]=integrations[_0x45b2('0x5e')](_0x19c108['body']['channel'],_0x19c108[_0x45b2('0x54')][_0x45b2('0x46')]);return db[_0x45b2('0x57')]['create'](_0x19c108[_0x45b2('0x54')],{'include':[{'model':db['DeskField'],'as':_0x45b2('0x5f')},{'model':db[_0x45b2('0x60')],'as':_0x45b2('0x5d')}]});}return null;})[_0x45b2('0x1a')](respondWithResult(_0x52b496,null))[_0x45b2('0x23')](handleError(_0x52b496,null));};exports[_0x45b2('0x61')]=function(_0xf5c3c6,_0x56da2b,_0x21336e){var _0x41fa5f=[{'name':_0x45b2('0x62'),'label':_0x45b2('0x62'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];return db['DeskAccount'][_0x45b2('0x56')]({'where':{'id':_0xf5c3c6[_0x45b2('0x51')]['id']},'attributes':['id',_0x45b2('0x63'),_0x45b2('0x64'),_0x45b2('0x65'),_0x45b2('0x66'),_0x45b2('0x67'),_0x45b2('0x68'),_0x45b2('0x69'),_0x45b2('0x6a')]})[_0x45b2('0x1a')](handleEntityNotFound(_0x56da2b,null))[_0x45b2('0x1a')](function(_0x1a50c3){if(_0x1a50c3){var _0x67d002={'method':_0x45b2('0x6b'),'uri':util['format'](_0x45b2('0x6c'),_0x1a50c3[_0x45b2('0x63')]),'headers':{'Content-Type':'application/json','Accept':_0x45b2('0x6d')},'json':!![]};if(_0x1a50c3[_0x45b2('0x64')]==='basic'){_0x67d002['headers'][_0x45b2('0x6e')]=util[_0x45b2('0x6f')](_0x45b2('0x70'),new Buffer(util['format'](_0x45b2('0x71'),_0x1a50c3[_0x45b2('0x65')],_0x1a50c3['password']))['toString']('base64'));}return rp(_0x67d002)['then'](function(_0x4b3e3a){return _0x41fa5f[_0x45b2('0x72')](_[_0x45b2('0x45')](_0x4b3e3a[_0x45b2('0x73')][_0x45b2('0x74')],function(_0xc9f19b){return{'id':_0xc9f19b[_0x45b2('0x31')],'name':_0xc9f19b[_0x45b2('0x31')],'type':_0xc9f19b[_0x45b2('0x46')],'active':_0xc9f19b[_0x45b2('0x75')],'label':_0xc9f19b[_0x45b2('0x76')],'custom':!![]};}));});}})[_0x45b2('0x1a')](function(_0x40a513){return{'count':_0x40a513[_0x45b2('0x3d')],'rows':_0x40a513};})[_0x45b2('0x1a')](respondWithResult(_0x56da2b,null))[_0x45b2('0x23')](function(_0x1aba2e){var _0x4f6eb5=_0xf5c3c6[_0x45b2('0x36')][_0x45b2('0x77')]?0x1f4:_0x1aba2e[_0x45b2('0x78')]||0x1f4;logger[_0x45b2('0x20')](_0x45b2('0x79'),_0x45b2('0x61'),_0x4f6eb5,JSON['stringify'](_0x1aba2e));delete _0x1aba2e[_0x45b2('0x31')];if(_0x4f6eb5===0x191){_0x4f6eb5=0x190;}_0x56da2b[_0x45b2('0x25')](_0x4f6eb5)[_0x45b2('0x7a')](_0xf5c3c6[_0x45b2('0x36')][_0x45b2('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x1aba2e[_0x45b2('0x78')]}:_0x1aba2e);});};
\ No newline at end of file
index 1e63e25..e7df958 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger','api','request-promise','./intDeskAccount.attributes'];(function(_0x3bd5c1,_0x2af194){var _0xd0f143=function(_0x30f078){while(--_0x30f078){_0x3bd5c1['push'](_0x3bd5c1['shift']());}};_0xd0f143(++_0x2af194);}(_0x8603,0x190));var _0x3860=function(_0x40a740,_0x2810b0){_0x40a740=_0x40a740-0x0;var _0x58406d=_0x8603[_0x40a740];return _0x58406d;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3860('0x3'));var attributes=require(_0x3860('0x4'));var integrations=require(_0x3860('0x5'));module['exports']=function(_0x2fc97a,_0x56f8c5){return _0x2fc97a[_0x3860('0x6')](_0x3860('0x7'),attributes,{'tableName':_0x3860('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b0e=['bluebird','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x8b0e,0x166));var _0xe8b0=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x8b0e[_0x2f2360];return _0x1cc8d3;};'use strict';var _=require(_0xe8b0('0x0'));var util=require(_0xe8b0('0x1'));var logger=require(_0xe8b0('0x2'))(_0xe8b0('0x3'));var moment=require(_0xe8b0('0x4'));var BPromise=require(_0xe8b0('0x5'));var rp=require('request-promise');var attributes=require(_0xe8b0('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xe8b0('0x7')]=function(_0x240513,_0x2a0ba1){return _0x240513[_0xe8b0('0x8')](_0xe8b0('0x9'),attributes,{'tableName':_0xe8b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b59a1ff..cd47c14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b06=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','debug','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3e57ef,_0x388fab){var _0x5ade66=function(_0xcbbd3){while(--_0xcbbd3){_0x3e57ef['push'](_0x3e57ef['shift']());}};_0x5ade66(++_0x388fab);}(_0x6b06,0x1e4));var _0x66b0=function(_0x2a89ee,_0x2f5d1c){_0x2a89ee=_0x2a89ee-0x0;var _0xb24e70=_0x6b06[_0x2a89ee];return _0xb24e70;};'use strict';var _=require(_0x66b0('0x0'));var util=require(_0x66b0('0x1'));var moment=require(_0x66b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x66b0('0x3'));var fs=require('fs');var Redis=require(_0x66b0('0x4'));var db=require(_0x66b0('0x5'))['db'];var utils=require(_0x66b0('0x6'));var logger=require(_0x66b0('0x7'))(_0x66b0('0x8'));var config=require(_0x66b0('0x9'));var jayson=require(_0x66b0('0xa'));var client=jayson['client'][_0x66b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fafa4,_0x52036c,_0xaab24d){return new BPromise(function(_0x1a3440,_0x47f0c4){return client[_0x66b0('0xc')](_0x2fafa4,_0xaab24d)[_0x66b0('0xd')](function(_0x1cf27a){logger[_0x66b0('0xe')](_0x66b0('0xf'),_0x52036c,_0x66b0('0x10'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x52036c,_0x66b0('0x10'),JSON[_0x66b0('0x11')](_0x1cf27a));if(_0x1cf27a['error']){if(_0x1cf27a['error'][_0x66b0('0x12')]===0x1f4){logger[_0x66b0('0x13')](_0x66b0('0xf'),_0x52036c,_0x1cf27a['error'][_0x66b0('0x14')]);return _0x47f0c4(_0x1cf27a[_0x66b0('0x13')][_0x66b0('0x14')]);}logger['error'](_0x66b0('0xf'),_0x52036c,_0x1cf27a[_0x66b0('0x13')][_0x66b0('0x14')]);return _0x1a3440(_0x1cf27a['error']['message']);}else{logger[_0x66b0('0xe')](_0x66b0('0xf'),_0x52036c,_0x66b0('0x10'));_0x1a3440(_0x1cf27a['result'][_0x66b0('0x14')]);}})[_0x66b0('0x15')](function(_0x4f0d75){logger[_0x66b0('0x13')](_0x66b0('0xf'),_0x52036c,_0x4f0d75);_0x47f0c4(_0x4f0d75);});});}exports[_0x66b0('0x16')]=function(_0xdd9f67){var _0x3a1852=this;return new Promise(function(_0x164ca5,_0x8d4d8){return db[_0x66b0('0x17')][_0x66b0('0x18')]({'raw':_0xdd9f67[_0x66b0('0x19')]?_0xdd9f67[_0x66b0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xdd9f67[_0x66b0('0x19')]?_0xdd9f67[_0x66b0('0x19')][_0x66b0('0x1a')]||null:null,'attributes':_0xdd9f67[_0x66b0('0x19')]?_0xdd9f67['options'][_0x66b0('0x1b')]||null:null,'limit':_0xdd9f67[_0x66b0('0x19')]?_0xdd9f67[_0x66b0('0x19')][_0x66b0('0x1c')]||null:null,'include':_0xdd9f67[_0x66b0('0x19')]?_0xdd9f67[_0x66b0('0x19')][_0x66b0('0x1d')]?_[_0x66b0('0x1e')](_0xdd9f67[_0x66b0('0x19')][_0x66b0('0x1d')],function(_0x3be3d3){return{'model':db[_0x3be3d3['model']],'as':_0x3be3d3['as'],'attributes':_0x3be3d3[_0x66b0('0x1b')],'include':_0x3be3d3[_0x66b0('0x1d')]?_[_0x66b0('0x1e')](_0x3be3d3['include'],function(_0x59ae0d){return{'model':db[_0x59ae0d[_0x66b0('0x1f')]],'as':_0x59ae0d['as'],'attributes':_0x59ae0d[_0x66b0('0x1b')],'include':_0x59ae0d[_0x66b0('0x1d')]?_['map'](_0x59ae0d[_0x66b0('0x1d')],function(_0x190f85){return{'model':db[_0x190f85[_0x66b0('0x1f')]],'as':_0x190f85['as'],'attributes':_0x190f85['attributes']};}):[]};}):[]};}):[]:[]})[_0x66b0('0xd')](function(_0x5e646e){logger[_0x66b0('0xe')]('GetDeskAccount',_0xdd9f67);logger[_0x66b0('0x20')](_0x66b0('0x16'),_0xdd9f67,JSON[_0x66b0('0x11')](_0x5e646e));_0x164ca5(_0x5e646e);})[_0x66b0('0x15')](function(_0x5cb95e){logger['error'](_0x66b0('0x16'),_0x5cb95e[_0x66b0('0x14')],_0xdd9f67);_0x8d4d8(_0x3a1852[_0x66b0('0x13')](0x1f4,_0x5cb95e[_0x66b0('0x14')]));});});};exports[_0x66b0('0x21')]=function(_0x5ddc15){var _0x3636d5=this;return new Promise(function(_0xfa4041,_0xf37c08){return db['DeskAccount'][_0x66b0('0x22')]({'raw':_0x5ddc15[_0x66b0('0x19')]?_0x5ddc15[_0x66b0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5ddc15[_0x66b0('0x19')]?_0x5ddc15[_0x66b0('0x19')]['where']||null:null,'attributes':_0x5ddc15[_0x66b0('0x19')]?_0x5ddc15[_0x66b0('0x19')]['attributes']||null:null,'include':_0x5ddc15[_0x66b0('0x19')]?_0x5ddc15[_0x66b0('0x19')][_0x66b0('0x1d')]?_[_0x66b0('0x1e')](_0x5ddc15['options']['include'],function(_0x4d354a){return{'model':db[_0x4d354a['model']],'as':_0x4d354a['as'],'attributes':_0x4d354a[_0x66b0('0x1b')],'include':_0x4d354a[_0x66b0('0x1d')]?_['map'](_0x4d354a[_0x66b0('0x1d')],function(_0x581483){return{'model':db[_0x581483[_0x66b0('0x1f')]],'as':_0x581483['as'],'attributes':_0x581483['attributes'],'include':_0x581483['include']?_[_0x66b0('0x1e')](_0x581483[_0x66b0('0x1d')],function(_0x2d31fe){return{'model':db[_0x2d31fe[_0x66b0('0x1f')]],'as':_0x2d31fe['as'],'attributes':_0x2d31fe[_0x66b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x66b0('0xd')](function(_0x27f3d4){logger[_0x66b0('0xe')](_0x66b0('0x21'),_0x5ddc15);logger[_0x66b0('0x20')]('ShowDeskAccount',_0x5ddc15,JSON[_0x66b0('0x11')](_0x27f3d4));_0xfa4041(_0x27f3d4);})['catch'](function(_0x6eba0b){logger[_0x66b0('0x13')](_0x66b0('0x21'),_0x6eba0b[_0x66b0('0x14')],_0x5ddc15);_0xf37c08(_0x3636d5[_0x66b0('0x13')](0x1f4,_0x6eba0b[_0x66b0('0x14')]));});});};
\ No newline at end of file
+var _0x6c45=['DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetDeskAccount','stringify','DeskAccount','find','where','ShowDeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x2e4cd6,_0xd3fb09){var _0xc99a9b=function(_0x44a569){while(--_0x44a569){_0x2e4cd6['push'](_0x2e4cd6['shift']());}};_0xc99a9b(++_0xd3fb09);}(_0x6c45,0xb1));var _0x56c4=function(_0x53f3ce,_0x1ab310){_0x53f3ce=_0x53f3ce-0x0;var _0x201e03=_0x6c45[_0x53f3ce];return _0x201e03;};'use strict';var _=require(_0x56c4('0x0'));var util=require(_0x56c4('0x1'));var moment=require('moment');var BPromise=require(_0x56c4('0x2'));var rs=require(_0x56c4('0x3'));var fs=require('fs');var Redis=require(_0x56c4('0x4'));var db=require(_0x56c4('0x5'))['db'];var utils=require(_0x56c4('0x6'));var logger=require(_0x56c4('0x7'))(_0x56c4('0x8'));var config=require(_0x56c4('0x9'));var jayson=require(_0x56c4('0xa'));var client=jayson[_0x56c4('0xb')][_0x56c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x330e6,_0x1d0b9b,_0x373748){return new BPromise(function(_0x7e0748,_0x38dbd7){return client[_0x56c4('0xd')](_0x330e6,_0x373748)[_0x56c4('0xe')](function(_0x2052f5){logger[_0x56c4('0xf')]('DeskAccount,\x20%s,\x20%s',_0x1d0b9b,_0x56c4('0x10'));logger[_0x56c4('0x11')](_0x56c4('0x12'),_0x1d0b9b,_0x56c4('0x10'),JSON['stringify'](_0x2052f5));if(_0x2052f5[_0x56c4('0x13')]){if(_0x2052f5[_0x56c4('0x13')][_0x56c4('0x14')]===0x1f4){logger[_0x56c4('0x13')]('DeskAccount,\x20%s,\x20%s',_0x1d0b9b,_0x2052f5[_0x56c4('0x13')]['message']);return _0x38dbd7(_0x2052f5['error'][_0x56c4('0x15')]);}logger[_0x56c4('0x13')](_0x56c4('0x16'),_0x1d0b9b,_0x2052f5[_0x56c4('0x13')][_0x56c4('0x15')]);return _0x7e0748(_0x2052f5['error'][_0x56c4('0x15')]);}else{logger[_0x56c4('0xf')]('DeskAccount,\x20%s,\x20%s',_0x1d0b9b,_0x56c4('0x10'));_0x7e0748(_0x2052f5[_0x56c4('0x17')][_0x56c4('0x15')]);}})[_0x56c4('0x18')](function(_0x5c54bd){logger[_0x56c4('0x13')](_0x56c4('0x16'),_0x1d0b9b,_0x5c54bd);_0x38dbd7(_0x5c54bd);});});}exports['GetDeskAccount']=function(_0xf99c93){var _0x73ebc7=this;return new Promise(function(_0x110f71,_0x2a6016){return db['DeskAccount'][_0x56c4('0x19')]({'raw':_0xf99c93[_0x56c4('0x1a')]?_0xf99c93[_0x56c4('0x1a')][_0x56c4('0x1b')]===undefined?!![]:![]:!![],'where':_0xf99c93[_0x56c4('0x1a')]?_0xf99c93[_0x56c4('0x1a')]['where']||null:null,'attributes':_0xf99c93['options']?_0xf99c93[_0x56c4('0x1a')][_0x56c4('0x1c')]||null:null,'limit':_0xf99c93['options']?_0xf99c93[_0x56c4('0x1a')][_0x56c4('0x1d')]||null:null,'include':_0xf99c93[_0x56c4('0x1a')]?_0xf99c93[_0x56c4('0x1a')][_0x56c4('0x1e')]?_[_0x56c4('0x1f')](_0xf99c93[_0x56c4('0x1a')]['include'],function(_0x1313a4){return{'model':db[_0x1313a4[_0x56c4('0x20')]],'as':_0x1313a4['as'],'attributes':_0x1313a4[_0x56c4('0x1c')],'include':_0x1313a4['include']?_[_0x56c4('0x1f')](_0x1313a4['include'],function(_0x213cc6){return{'model':db[_0x213cc6[_0x56c4('0x20')]],'as':_0x213cc6['as'],'attributes':_0x213cc6['attributes'],'include':_0x213cc6[_0x56c4('0x1e')]?_[_0x56c4('0x1f')](_0x213cc6['include'],function(_0x4c4a8c){return{'model':db[_0x4c4a8c['model']],'as':_0x4c4a8c['as'],'attributes':_0x4c4a8c[_0x56c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x56c4('0xe')](function(_0x3fe97d){logger['info'](_0x56c4('0x21'),_0xf99c93);logger['debug']('GetDeskAccount',_0xf99c93,JSON[_0x56c4('0x22')](_0x3fe97d));_0x110f71(_0x3fe97d);})[_0x56c4('0x18')](function(_0x45f4ee){logger[_0x56c4('0x13')](_0x56c4('0x21'),_0x45f4ee[_0x56c4('0x15')],_0xf99c93);_0x2a6016(_0x73ebc7[_0x56c4('0x13')](0x1f4,_0x45f4ee[_0x56c4('0x15')]));});});};exports['ShowDeskAccount']=function(_0x36f430){var _0x388dee=this;return new Promise(function(_0x3af58b,_0x4f73dc){return db[_0x56c4('0x23')][_0x56c4('0x24')]({'raw':_0x36f430[_0x56c4('0x1a')]?_0x36f430['options'][_0x56c4('0x1b')]===undefined?!![]:![]:!![],'where':_0x36f430[_0x56c4('0x1a')]?_0x36f430['options'][_0x56c4('0x25')]||null:null,'attributes':_0x36f430['options']?_0x36f430[_0x56c4('0x1a')][_0x56c4('0x1c')]||null:null,'include':_0x36f430[_0x56c4('0x1a')]?_0x36f430[_0x56c4('0x1a')][_0x56c4('0x1e')]?_['map'](_0x36f430['options'][_0x56c4('0x1e')],function(_0x110e97){return{'model':db[_0x110e97[_0x56c4('0x20')]],'as':_0x110e97['as'],'attributes':_0x110e97[_0x56c4('0x1c')],'include':_0x110e97[_0x56c4('0x1e')]?_['map'](_0x110e97[_0x56c4('0x1e')],function(_0x3bea12){return{'model':db[_0x3bea12[_0x56c4('0x20')]],'as':_0x3bea12['as'],'attributes':_0x3bea12[_0x56c4('0x1c')],'include':_0x3bea12[_0x56c4('0x1e')]?_[_0x56c4('0x1f')](_0x3bea12[_0x56c4('0x1e')],function(_0x517f57){return{'model':db[_0x517f57['model']],'as':_0x517f57['as'],'attributes':_0x517f57[_0x56c4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x56c4('0xe')](function(_0x29d3c4){logger[_0x56c4('0xf')](_0x56c4('0x26'),_0x36f430);logger['debug']('ShowDeskAccount',_0x36f430,JSON[_0x56c4('0x22')](_0x29d3c4));_0x3af58b(_0x29d3c4);})['catch'](function(_0x18be52){logger[_0x56c4('0x13')](_0x56c4('0x26'),_0x18be52[_0x56c4('0x15')],_0x36f430);_0x4f73dc(_0x388dee['error'](0x1f4,_0x18be52[_0x56c4('0x15')]));});});};
\ No newline at end of file
index 533c8f8..f361858 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca5c=['getTags','post','create','setTags','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','/:id/subjects','getDescriptions','/:id/tags'];(function(_0x1f0427,_0x57eaa4){var _0x458afc=function(_0xed8e98){while(--_0xed8e98){_0x1f0427['push'](_0x1f0427['shift']());}};_0x458afc(++_0x57eaa4);}(_0xca5c,0x116));var _0xcca5=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0xca5c[_0x45c48f];return _0xaf5037;};'use strict';var multer=require(_0xcca5('0x0'));var util=require(_0xcca5('0x1'));var path=require(_0xcca5('0x2'));var timeout=require(_0xcca5('0x3'));var express=require('express');var router=express[_0xcca5('0x4')]();var auth=require(_0xcca5('0x5'));var interaction=require(_0xcca5('0x6'));var config=require(_0xcca5('0x7'));var controller=require(_0xcca5('0x8'));router['get']('/',auth[_0xcca5('0x9')](),controller['index']);router[_0xcca5('0xa')](_0xcca5('0xb'),auth[_0xcca5('0x9')](),controller['show']);router['get'](_0xcca5('0xc'),auth[_0xcca5('0x9')](),controller['getFields']);router[_0xcca5('0xa')](_0xcca5('0xd'),auth[_0xcca5('0x9')](),controller['getSubjects']);router[_0xcca5('0xa')]('/:id/descriptions',auth[_0xcca5('0x9')](),controller[_0xcca5('0xe')]);router[_0xcca5('0xa')](_0xcca5('0xf'),auth[_0xcca5('0x9')](),controller[_0xcca5('0x10')]);router[_0xcca5('0x11')]('/',auth[_0xcca5('0x9')](),controller[_0xcca5('0x12')]);router['post'](_0xcca5('0xf'),auth['isAuthenticated'](),controller[_0xcca5('0x13')]);router['put']('/:id',auth[_0xcca5('0x9')](),controller[_0xcca5('0x14')]);router['delete'](_0xcca5('0xb'),auth[_0xcca5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xca94=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','destroy'];(function(_0x2140ae,_0x276645){var _0x33ccc7=function(_0xedb37c){while(--_0xedb37c){_0x2140ae['push'](_0x2140ae['shift']());}};_0x33ccc7(++_0x276645);}(_0xca94,0x146));var _0x4ca9=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0xca94[_0xf44d98];return _0x5ebb04;};'use strict';var multer=require(_0x4ca9('0x0'));var util=require(_0x4ca9('0x1'));var path=require(_0x4ca9('0x2'));var timeout=require(_0x4ca9('0x3'));var express=require('express');var router=express[_0x4ca9('0x4')]();var auth=require(_0x4ca9('0x5'));var interaction=require(_0x4ca9('0x6'));var config=require(_0x4ca9('0x7'));var controller=require(_0x4ca9('0x8'));router[_0x4ca9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ca9('0x9')](_0x4ca9('0xa'),auth['isAuthenticated'](),controller[_0x4ca9('0xb')]);router[_0x4ca9('0x9')](_0x4ca9('0xc'),auth[_0x4ca9('0xd')](),controller[_0x4ca9('0xe')]);router[_0x4ca9('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x4ca9('0xf')]);router[_0x4ca9('0x9')](_0x4ca9('0x10'),auth['isAuthenticated'](),controller[_0x4ca9('0x11')]);router[_0x4ca9('0x9')](_0x4ca9('0x12'),auth['isAuthenticated'](),controller[_0x4ca9('0x13')]);router[_0x4ca9('0x14')]('/',auth['isAuthenticated'](),controller[_0x4ca9('0x15')]);router[_0x4ca9('0x14')](_0x4ca9('0x12'),auth[_0x4ca9('0xd')](),controller['setTags']);router[_0x4ca9('0x16')](_0x4ca9('0xa'),auth[_0x4ca9('0xd')](),controller['update']);router['delete'](_0x4ca9('0xa'),auth[_0x4ca9('0xd')](),controller[_0x4ca9('0x17')]);module[_0x4ca9('0x18')]=router;
\ No newline at end of file
index d124b48..d82016f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb79=['sequelize','STRING'];(function(_0x27f2b9,_0x144e11){var _0x440385=function(_0x72436d){while(--_0x72436d){_0x27f2b9['push'](_0x27f2b9['shift']());}};_0x440385(++_0x144e11);}(_0xdb79,0x154));var _0x9db7=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdb79[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x9db7('0x0'));module['exports']={'name':{'type':Sequelize[_0x9db7('0x1')]},'description':{'type':Sequelize[_0x9db7('0x1')]}};
\ No newline at end of file
+var _0xf910=['sequelize','exports','STRING'];(function(_0x50916d,_0x3aa085){var _0xb48161=function(_0x5882ca){while(--_0x5882ca){_0x50916d['push'](_0x50916d['shift']());}};_0xb48161(++_0x3aa085);}(_0xf910,0x186));var _0x0f91=function(_0x385cd2,_0x26193e){_0x385cd2=_0x385cd2-0x0;var _0x570059=_0xf910[_0x385cd2];return _0x570059;};'use strict';var Sequelize=require(_0x0f91('0x0'));module[_0x0f91('0x1')]={'name':{'type':Sequelize[_0x0f91('0x2')]},'description':{'type':Sequelize[_0x0f91('0x2')]}};
\ No newline at end of file
index b60eb90..dbfb459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe25f=['body','update','destroy','getFields','findOne','filter','getSubjects','DeskField','pick','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','json','count','offset','status','set','Content-Range','apply','reject','save','then','stack','name','send','index','rawAttributes','model','keys','query','dateStart','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','dateEnd','add','merge','map','type','key','VIRTUAL','field','DeskConfiguration','includeAll','include','findAll','rows','show','params','intersection','options','find','create'];(function(_0xcc4d3a,_0x104f66){var _0x20bae1=function(_0x2403f8){while(--_0x2403f8){_0xcc4d3a['push'](_0xcc4d3a['shift']());}};_0x20bae1(++_0x104f66);}(_0xe25f,0x13c));var _0xfe25=function(_0x3f8896,_0x1491ff){_0x3f8896=_0x3f8896-0x0;var _0x286005=_0xe25f[_0x3f8896];return _0x286005;};'use strict';var pdf=require(_0xfe25('0x0'));var emlformat=require(_0xfe25('0x1'));var rimraf=require(_0xfe25('0x2'));var zipdir=require(_0xfe25('0x3'));var jsonpatch=require(_0xfe25('0x4'));var rp=require('request-promise');var moment=require(_0xfe25('0x5'));var BPromise=require(_0xfe25('0x6'));var Mustache=require(_0xfe25('0x7'));var util=require(_0xfe25('0x8'));var path=require(_0xfe25('0x9'));var sox=require(_0xfe25('0xa'));var csv=require(_0xfe25('0xb'));var ejs=require(_0xfe25('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfe25('0xd'));var crypto=require(_0xfe25('0xe'));var jsforce=require(_0xfe25('0xf'));var deskjs=require(_0xfe25('0x10'));var toCsv=require(_0xfe25('0xb'));var querystring=require(_0xfe25('0x11'));var Papa=require(_0xfe25('0x12'));var Redis=require(_0xfe25('0x13'));var qs=require(_0xfe25('0x14'));var logger=require(_0xfe25('0x15'))(_0xfe25('0x16'));var utils=require(_0xfe25('0x17'));var config=require(_0xfe25('0x18'));var db=require(_0xfe25('0x19'))['db'];var jayson=require(_0xfe25('0x1a'));var client=jayson['client'][_0xfe25('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3df27d,_0x2d0cee,_0x10e48d,_0x262acc){return new BPromise(function(_0x24a8fa,_0x59f7e4){var _0x5756cd=_0x262acc||client;return _0x5756cd[_0xfe25('0x1c')](_0x3df27d,_0x10e48d)['then'](function(_0x3a4c0c){logger['info'](_0xfe25('0x1d'),_0x2d0cee,_0xfe25('0x1e'));logger['debug'](_0xfe25('0x1f'),_0x2d0cee,_0xfe25('0x1e'),JSON[_0xfe25('0x20')](_0x3a4c0c));if(_0x3a4c0c[_0xfe25('0x21')]){if(_0x3a4c0c[_0xfe25('0x21')][_0xfe25('0x22')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2d0cee,_0x3a4c0c[_0xfe25('0x21')][_0xfe25('0x23')]);return _0x59f7e4(_0x3a4c0c[_0xfe25('0x21')][_0xfe25('0x23')]);}logger[_0xfe25('0x21')](_0xfe25('0x1d'),_0x2d0cee,_0x3a4c0c[_0xfe25('0x21')]['message']);return _0x24a8fa(_0x3a4c0c[_0xfe25('0x21')]['message']);}else{logger[_0xfe25('0x24')](_0xfe25('0x1d'),_0x2d0cee,_0xfe25('0x1e'));_0x24a8fa(_0x3a4c0c[_0xfe25('0x25')][_0xfe25('0x23')]);}})[_0xfe25('0x26')](function(_0x1b8230){logger[_0xfe25('0x21')](_0xfe25('0x1d'),_0x2d0cee,_0x1b8230);_0x59f7e4(_0x1b8230);});});}function respondWithStatusCode(_0x1cfbd5,_0x58517e){_0x58517e=_0x58517e||0xcc;return function(_0x3a83cb){if(_0x3a83cb){return _0x1cfbd5[_0xfe25('0x27')](_0x58517e);}return _0x1cfbd5['status'](_0x58517e)['end']();};}function respondWithResult(_0x3a7ddf,_0x14b765){_0x14b765=_0x14b765||0xc8;return function(_0x2c29b0){if(_0x2c29b0){return _0x3a7ddf['status'](_0x14b765)[_0xfe25('0x28')](_0x2c29b0);}};}function respondWithFilteredResult(_0x733e03,_0x572d28){return function(_0x3aa84c){if(_0x3aa84c){var _0x26afa2=_0x3aa84c[_0xfe25('0x29')],_0x3b5dcb=_0x572d28[_0xfe25('0x2a')],_0x1b3d35=_0x572d28[_0xfe25('0x2a')]+_0x572d28['limit'],_0x2e2cca;if(_0x1b3d35>=_0x26afa2){_0x1b3d35=_0x26afa2;_0x2e2cca=0xc8;}else{_0x2e2cca=0xce;}_0x733e03[_0xfe25('0x2b')](_0x2e2cca);return _0x733e03[_0xfe25('0x2c')](_0xfe25('0x2d'),_0x3b5dcb+'-'+_0x1b3d35+'/'+_0x26afa2)[_0xfe25('0x28')](_0x3aa84c);}return null;};}function patchUpdates(_0x30aca1){return function(_0x5032bd){try{jsonpatch[_0xfe25('0x2e')](_0x5032bd,_0x30aca1,!![]);}catch(_0x3c6929){return BPromise[_0xfe25('0x2f')](_0x3c6929);}return _0x5032bd[_0xfe25('0x30')]();};}function saveUpdates(_0x24b4d6,_0x1e1e8b){return function(_0x15c967){if(_0x15c967){return _0x15c967['update'](_0x24b4d6)[_0xfe25('0x31')](function(_0x33bd56){return _0x33bd56;});}return null;};}function removeEntity(_0x32bcc8,_0x3fbca7){return function(_0x22809f){if(_0x22809f){return _0x22809f['destroy']()[_0xfe25('0x31')](function(){_0x32bcc8[_0xfe25('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55142b,_0x36d3b1){return function(_0x4d1848){if(!_0x4d1848){_0x55142b[_0xfe25('0x27')](0x194);}return _0x4d1848;};}function handleError(_0x2e3ec6,_0x1bf248){_0x1bf248=_0x1bf248||0x1f4;return function(_0x4fa5f1){logger[_0xfe25('0x21')](_0x4fa5f1[_0xfe25('0x32')]);if(_0x4fa5f1[_0xfe25('0x33')]){delete _0x4fa5f1['name'];}_0x2e3ec6[_0xfe25('0x2b')](_0x1bf248)[_0xfe25('0x34')](_0x4fa5f1);};}exports[_0xfe25('0x35')]=function(_0xbf9c46,_0x4451bd){var _0x43e0d0={},_0x3c2891={},_0x3f05a8={'count':0x0,'rows':[]};var _0xe759ec=db['DeskConfiguration'][_0xfe25('0x36')];_0x3c2891[_0xfe25('0x37')]=_[_0xfe25('0x38')](_0xe759ec);var _0xae4f81={'dateStart':_0xbf9c46[_0xfe25('0x39')][_0xfe25('0x3a')],'dateEnd':_0xbf9c46['query']['dateEnd']};delete _0xbf9c46['query']['dateStart'];delete _0xbf9c46[_0xfe25('0x39')]['dateEnd'];_0x3c2891[_0xfe25('0x39')]=_[_0xfe25('0x38')](_0xbf9c46[_0xfe25('0x39')]);_0x3c2891[_0xfe25('0x3b')]=_['intersection'](_0x3c2891[_0xfe25('0x37')],_0x3c2891[_0xfe25('0x39')]);_0x43e0d0[_0xfe25('0x3c')]=_['intersection'](_0x3c2891[_0xfe25('0x37')],qs[_0xfe25('0x3d')](_0xbf9c46[_0xfe25('0x39')]['fields']));_0x43e0d0[_0xfe25('0x3c')]=_0x43e0d0[_0xfe25('0x3c')][_0xfe25('0x3e')]?_0x43e0d0[_0xfe25('0x3c')]:_0x3c2891['model'];if(!_0xbf9c46[_0xfe25('0x39')][_0xfe25('0x3f')](_0xfe25('0x40'))){_0x43e0d0[_0xfe25('0x41')]=qs['limit'](_0xbf9c46[_0xfe25('0x39')][_0xfe25('0x41')]);_0x43e0d0[_0xfe25('0x2a')]=qs['offset'](_0xbf9c46[_0xfe25('0x39')]['offset']);}_0x43e0d0[_0xfe25('0x42')]=qs[_0xfe25('0x43')](_0xbf9c46[_0xfe25('0x39')][_0xfe25('0x43')]);_0x43e0d0[_0xfe25('0x44')]=qs[_0xfe25('0x3b')](_['pick'](_0xbf9c46['query'],_0x3c2891[_0xfe25('0x3b')]));if(_0xae4f81[_0xfe25('0x3a')]){if(_0xae4f81[_0xfe25('0x45')]){_0xae4f81['dateEnd']=moment(_0xae4f81[_0xfe25('0x45')])[_0xfe25('0x46')](0x1,'day');}else{_0xae4f81[_0xfe25('0x45')]=moment(_0xae4f81[_0xfe25('0x3a')])[_0xfe25('0x46')](0x1,'day');}_['merge'](_0x43e0d0[_0xfe25('0x44')],{'createdAt':{'$gte':_0xae4f81[_0xfe25('0x3a')],'$lte':_0xae4f81[_0xfe25('0x45')]}});}if(_0xbf9c46[_0xfe25('0x39')]['filter']){_0x43e0d0[_0xfe25('0x44')]=_[_0xfe25('0x47')](_0x43e0d0['where'],{'$or':_[_0xfe25('0x48')](_0xe759ec,function(_0x5e7552){if(_0x5e7552[_0xfe25('0x49')][_0xfe25('0x4a')]!==_0xfe25('0x4b')){var _0x275579={};_0x275579[_0x5e7552[_0xfe25('0x4c')]]={'$like':'%'+_0xbf9c46[_0xfe25('0x39')]['filter']+'%'};return _0x275579;}})});}_0x43e0d0=_[_0xfe25('0x47')]({},_0x43e0d0,_0xbf9c46['options']);var _0xc9fffc={'where':_0x43e0d0[_0xfe25('0x44')]};return db[_0xfe25('0x4d')][_0xfe25('0x29')](_0xc9fffc)['then'](function(_0x1e4ca4){_0x3f05a8[_0xfe25('0x29')]=_0x1e4ca4;if(_0xbf9c46[_0xfe25('0x39')][_0xfe25('0x4e')]){_0x43e0d0[_0xfe25('0x4f')]=[{'all':!![]}];}return db[_0xfe25('0x4d')][_0xfe25('0x50')](_0x43e0d0);})[_0xfe25('0x31')](function(_0x2e47f7){_0x3f05a8[_0xfe25('0x51')]=_0x2e47f7;return _0x3f05a8;})['then'](respondWithFilteredResult(_0x4451bd,_0x43e0d0))['catch'](handleError(_0x4451bd,null));};exports[_0xfe25('0x52')]=function(_0x2bdef9,_0x12bbf1){var _0x197469={'raw':![],'where':{'id':_0x2bdef9[_0xfe25('0x53')]['id']}},_0x5bc61e={};_0x5bc61e['model']=_[_0xfe25('0x38')](db[_0xfe25('0x4d')][_0xfe25('0x36')]);_0x5bc61e[_0xfe25('0x39')]=_[_0xfe25('0x38')](_0x2bdef9['query']);_0x5bc61e['filters']=_[_0xfe25('0x54')](_0x5bc61e[_0xfe25('0x37')],_0x5bc61e[_0xfe25('0x39')]);_0x197469[_0xfe25('0x3c')]=_[_0xfe25('0x54')](_0x5bc61e[_0xfe25('0x37')],qs[_0xfe25('0x3d')](_0x2bdef9[_0xfe25('0x39')][_0xfe25('0x3d')]));_0x197469[_0xfe25('0x3c')]=_0x197469['attributes'][_0xfe25('0x3e')]?_0x197469[_0xfe25('0x3c')]:_0x5bc61e[_0xfe25('0x37')];if(_0x2bdef9[_0xfe25('0x39')][_0xfe25('0x4e')]){_0x197469[_0xfe25('0x4f')]=[{'all':!![]}];}_0x197469=_[_0xfe25('0x47')]({},_0x197469,_0x2bdef9[_0xfe25('0x55')]);return db[_0xfe25('0x4d')][_0xfe25('0x56')](_0x197469)['then'](handleEntityNotFound(_0x12bbf1,null))['then'](respondWithResult(_0x12bbf1,null))[_0xfe25('0x26')](handleError(_0x12bbf1,null));};exports[_0xfe25('0x57')]=function(_0x8f50bf,_0x40a599){return db['DeskConfiguration'][_0xfe25('0x57')](_0x8f50bf[_0xfe25('0x58')],{})[_0xfe25('0x31')](respondWithResult(_0x40a599,0xc9))[_0xfe25('0x26')](handleError(_0x40a599,null));};exports[_0xfe25('0x59')]=function(_0x31500c,_0x1fee69){if(_0x31500c[_0xfe25('0x58')]['id']){delete _0x31500c[_0xfe25('0x58')]['id'];}return db[_0xfe25('0x4d')][_0xfe25('0x56')]({'where':{'id':_0x31500c[_0xfe25('0x53')]['id']}})['then'](handleEntityNotFound(_0x1fee69,null))[_0xfe25('0x31')](saveUpdates(_0x31500c[_0xfe25('0x58')],null))[_0xfe25('0x31')](respondWithResult(_0x1fee69,null))[_0xfe25('0x26')](handleError(_0x1fee69,null));};exports[_0xfe25('0x5a')]=function(_0x5d1ffc,_0x3585f8){return db[_0xfe25('0x4d')]['find']({'where':{'id':_0x5d1ffc[_0xfe25('0x53')]['id']}})[_0xfe25('0x31')](handleEntityNotFound(_0x3585f8,null))['then'](removeEntity(_0x3585f8,null))[_0xfe25('0x26')](handleError(_0x3585f8,null));};exports[_0xfe25('0x5b')]=function(_0x398177,_0x2c3d77,_0xe7cc6e){var _0x70ba86={};var _0x4592fc={};var _0x321180;var _0x3349c0;return db[_0xfe25('0x4d')][_0xfe25('0x5c')]({'where':{'id':_0x398177['params']['id']}})[_0xfe25('0x31')](handleEntityNotFound(_0x2c3d77,null))[_0xfe25('0x31')](function(_0x2d6c9d){if(_0x2d6c9d){_0x321180=_0x2d6c9d;_0x4592fc[_0xfe25('0x37')]=_[_0xfe25('0x38')](db['DeskField'][_0xfe25('0x36')]);_0x4592fc[_0xfe25('0x39')]=_[_0xfe25('0x38')](_0x398177[_0xfe25('0x39')]);_0x4592fc[_0xfe25('0x3b')]=_[_0xfe25('0x54')](_0x4592fc['model'],_0x4592fc[_0xfe25('0x39')]);_0x70ba86[_0xfe25('0x3c')]=_['intersection'](_0x4592fc['model'],qs[_0xfe25('0x3d')](_0x398177['query']['fields']));_0x70ba86[_0xfe25('0x3c')]=_0x70ba86[_0xfe25('0x3c')][_0xfe25('0x3e')]?_0x70ba86[_0xfe25('0x3c')]:_0x4592fc[_0xfe25('0x37')];_0x70ba86[_0xfe25('0x42')]=qs[_0xfe25('0x43')](_0x398177[_0xfe25('0x39')][_0xfe25('0x43')]);_0x70ba86[_0xfe25('0x44')]=qs['filters'](_['pick'](_0x398177[_0xfe25('0x39')],_0x4592fc[_0xfe25('0x3b')]));if(_0x398177[_0xfe25('0x39')][_0xfe25('0x5d')]){_0x70ba86[_0xfe25('0x44')]=_[_0xfe25('0x47')](_0x70ba86[_0xfe25('0x44')],{'$or':_[_0xfe25('0x48')](_0x70ba86['attributes'],function(_0x109612){var _0x3e55fd={};_0x3e55fd[_0x109612]={'$like':'%'+_0x398177[_0xfe25('0x39')][_0xfe25('0x5d')]+'%'};return _0x3e55fd;})});}_0x70ba86=_[_0xfe25('0x47')]({},_0x70ba86,_0x398177['options']);return _0x321180['getFields'](_0x70ba86);}})['then'](function(_0x4e527b){if(_0x4e527b){_0x3349c0=_0x4e527b[_0xfe25('0x3e')];if(!_0x398177['query'][_0xfe25('0x3f')](_0xfe25('0x40'))){_0x70ba86[_0xfe25('0x41')]=qs[_0xfe25('0x41')](_0x398177[_0xfe25('0x39')]['limit']);_0x70ba86[_0xfe25('0x2a')]=qs['offset'](_0x398177[_0xfe25('0x39')][_0xfe25('0x2a')]);}return _0x321180[_0xfe25('0x5b')](_0x70ba86);}})[_0xfe25('0x31')](function(_0x5e6e34){if(_0x5e6e34){return _0x5e6e34?{'count':_0x3349c0,'rows':_0x5e6e34}:null;}})[_0xfe25('0x31')](respondWithResult(_0x2c3d77,null))[_0xfe25('0x26')](handleError(_0x2c3d77,null));};exports[_0xfe25('0x5e')]=function(_0x4a0fc1,_0x1a52ce,_0x4579bc){var _0x56eaf0={};var _0x5e8efb={};var _0x364876;var _0x4cbb60;return db[_0xfe25('0x4d')][_0xfe25('0x5c')]({'where':{'id':_0x4a0fc1[_0xfe25('0x53')]['id']}})[_0xfe25('0x31')](handleEntityNotFound(_0x1a52ce,null))['then'](function(_0x55031a){if(_0x55031a){_0x364876=_0x55031a;_0x5e8efb[_0xfe25('0x37')]=_['keys'](db[_0xfe25('0x5f')][_0xfe25('0x36')]);_0x5e8efb[_0xfe25('0x39')]=_[_0xfe25('0x38')](_0x4a0fc1[_0xfe25('0x39')]);_0x5e8efb[_0xfe25('0x3b')]=_[_0xfe25('0x54')](_0x5e8efb[_0xfe25('0x37')],_0x5e8efb[_0xfe25('0x39')]);_0x56eaf0['attributes']=_['intersection'](_0x5e8efb[_0xfe25('0x37')],qs['fields'](_0x4a0fc1['query'][_0xfe25('0x3d')]));_0x56eaf0[_0xfe25('0x3c')]=_0x56eaf0['attributes']['length']?_0x56eaf0[_0xfe25('0x3c')]:_0x5e8efb[_0xfe25('0x37')];_0x56eaf0[_0xfe25('0x42')]=qs[_0xfe25('0x43')](_0x4a0fc1[_0xfe25('0x39')]['sort']);_0x56eaf0['where']=qs['filters'](_[_0xfe25('0x60')](_0x4a0fc1[_0xfe25('0x39')],_0x5e8efb[_0xfe25('0x3b')]));if(_0x4a0fc1[_0xfe25('0x39')][_0xfe25('0x5d')]){_0x56eaf0[_0xfe25('0x44')]=_['merge'](_0x56eaf0[_0xfe25('0x44')],{'$or':_['map'](_0x56eaf0[_0xfe25('0x3c')],function(_0x2f5dd7){var _0x2713e7={};_0x2713e7[_0x2f5dd7]={'$like':'%'+_0x4a0fc1[_0xfe25('0x39')][_0xfe25('0x5d')]+'%'};return _0x2713e7;})});}_0x56eaf0=_[_0xfe25('0x47')]({},_0x56eaf0,_0x4a0fc1[_0xfe25('0x55')]);return _0x364876[_0xfe25('0x5e')](_0x56eaf0);}})[_0xfe25('0x31')](function(_0x116c8f){if(_0x116c8f){_0x4cbb60=_0x116c8f[_0xfe25('0x3e')];if(!_0x4a0fc1['query']['hasOwnProperty']('nolimit')){_0x56eaf0['limit']=qs[_0xfe25('0x41')](_0x4a0fc1['query'][_0xfe25('0x41')]);_0x56eaf0[_0xfe25('0x2a')]=qs[_0xfe25('0x2a')](_0x4a0fc1[_0xfe25('0x39')][_0xfe25('0x2a')]);}return _0x364876[_0xfe25('0x5e')](_0x56eaf0);}})[_0xfe25('0x31')](function(_0x222a6c){if(_0x222a6c){return _0x222a6c?{'count':_0x4cbb60,'rows':_0x222a6c}:null;}})['then'](respondWithResult(_0x1a52ce,null))[_0xfe25('0x26')](handleError(_0x1a52ce,null));};exports[_0xfe25('0x61')]=function(_0x17b6a2,_0x1dc875,_0x2df829){var _0xa9f408={};var _0x5bb523={};var _0x5550c9;var _0x212841;return db[_0xfe25('0x4d')]['findOne']({'where':{'id':_0x17b6a2[_0xfe25('0x53')]['id']}})[_0xfe25('0x31')](handleEntityNotFound(_0x1dc875,null))[_0xfe25('0x31')](function(_0x1de010){if(_0x1de010){_0x5550c9=_0x1de010;_0x5bb523[_0xfe25('0x37')]=_[_0xfe25('0x38')](db[_0xfe25('0x5f')][_0xfe25('0x36')]);_0x5bb523[_0xfe25('0x39')]=_['keys'](_0x17b6a2['query']);_0x5bb523[_0xfe25('0x3b')]=_[_0xfe25('0x54')](_0x5bb523[_0xfe25('0x37')],_0x5bb523[_0xfe25('0x39')]);_0xa9f408['attributes']=_[_0xfe25('0x54')](_0x5bb523[_0xfe25('0x37')],qs[_0xfe25('0x3d')](_0x17b6a2['query'][_0xfe25('0x3d')]));_0xa9f408['attributes']=_0xa9f408[_0xfe25('0x3c')]['length']?_0xa9f408[_0xfe25('0x3c')]:_0x5bb523[_0xfe25('0x37')];_0xa9f408[_0xfe25('0x42')]=qs[_0xfe25('0x43')](_0x17b6a2['query'][_0xfe25('0x43')]);_0xa9f408['where']=qs[_0xfe25('0x3b')](_['pick'](_0x17b6a2[_0xfe25('0x39')],_0x5bb523[_0xfe25('0x3b')]));if(_0x17b6a2['query']['filter']){_0xa9f408[_0xfe25('0x44')]=_[_0xfe25('0x47')](_0xa9f408[_0xfe25('0x44')],{'$or':_[_0xfe25('0x48')](_0xa9f408['attributes'],function(_0x377220){var _0x5c1b10={};_0x5c1b10[_0x377220]={'$like':'%'+_0x17b6a2[_0xfe25('0x39')][_0xfe25('0x5d')]+'%'};return _0x5c1b10;})});}_0xa9f408=_[_0xfe25('0x47')]({},_0xa9f408,_0x17b6a2[_0xfe25('0x55')]);return _0x5550c9[_0xfe25('0x61')](_0xa9f408);}})[_0xfe25('0x31')](function(_0x1af1e9){if(_0x1af1e9){_0x212841=_0x1af1e9['length'];if(!_0x17b6a2[_0xfe25('0x39')][_0xfe25('0x3f')](_0xfe25('0x40'))){_0xa9f408[_0xfe25('0x41')]=qs['limit'](_0x17b6a2[_0xfe25('0x39')][_0xfe25('0x41')]);_0xa9f408[_0xfe25('0x2a')]=qs[_0xfe25('0x2a')](_0x17b6a2[_0xfe25('0x39')][_0xfe25('0x2a')]);}return _0x5550c9[_0xfe25('0x61')](_0xa9f408);}})[_0xfe25('0x31')](function(_0x1f9a9f){if(_0x1f9a9f){return _0x1f9a9f?{'count':_0x212841,'rows':_0x1f9a9f}:null;}})[_0xfe25('0x31')](respondWithResult(_0x1dc875,null))[_0xfe25('0x26')](handleError(_0x1dc875,null));};exports[_0xfe25('0x62')]=function(_0x31d69b,_0x267f54,_0x570868){var _0x852bd0={};var _0x305c2d={};var _0x1988a9;var _0x1d09df;return db[_0xfe25('0x4d')][_0xfe25('0x5c')]({'where':{'id':_0x31d69b[_0xfe25('0x53')]['id']}})[_0xfe25('0x31')](handleEntityNotFound(_0x267f54,null))['then'](function(_0x528c15){if(_0x528c15){_0x1988a9=_0x528c15;_0x305c2d['model']=_[_0xfe25('0x38')](db['Tag'][_0xfe25('0x36')]);_0x305c2d[_0xfe25('0x39')]=_['keys'](_0x31d69b['query']);_0x305c2d[_0xfe25('0x3b')]=_[_0xfe25('0x54')](_0x305c2d[_0xfe25('0x37')],_0x305c2d[_0xfe25('0x39')]);_0x852bd0[_0xfe25('0x3c')]=_[_0xfe25('0x54')](_0x305c2d['model'],qs[_0xfe25('0x3d')](_0x31d69b['query']['fields']));_0x852bd0['attributes']=_0x852bd0[_0xfe25('0x3c')]['length']?_0x852bd0[_0xfe25('0x3c')]:_0x305c2d[_0xfe25('0x37')];_0x852bd0['order']=qs[_0xfe25('0x43')](_0x31d69b[_0xfe25('0x39')][_0xfe25('0x43')]);_0x852bd0[_0xfe25('0x44')]=qs[_0xfe25('0x3b')](_[_0xfe25('0x60')](_0x31d69b[_0xfe25('0x39')],_0x305c2d[_0xfe25('0x3b')]));if(_0x31d69b[_0xfe25('0x39')][_0xfe25('0x5d')]){_0x852bd0[_0xfe25('0x44')]=_[_0xfe25('0x47')](_0x852bd0['where'],{'$or':_[_0xfe25('0x48')](_0x852bd0[_0xfe25('0x3c')],function(_0x1901ed){var _0x22354e={};_0x22354e[_0x1901ed]={'$like':'%'+_0x31d69b['query'][_0xfe25('0x5d')]+'%'};return _0x22354e;})});}_0x852bd0=_[_0xfe25('0x47')]({},_0x852bd0,_0x31d69b[_0xfe25('0x55')]);return _0x1988a9[_0xfe25('0x62')](_0x852bd0);}})[_0xfe25('0x31')](function(_0x38877f){if(_0x38877f){_0x1d09df=_0x38877f['length'];if(!_0x31d69b[_0xfe25('0x39')][_0xfe25('0x3f')]('nolimit')){_0x852bd0[_0xfe25('0x41')]=qs[_0xfe25('0x41')](_0x31d69b[_0xfe25('0x39')]['limit']);_0x852bd0[_0xfe25('0x2a')]=qs[_0xfe25('0x2a')](_0x31d69b[_0xfe25('0x39')][_0xfe25('0x2a')]);}return _0x1988a9['getTags'](_0x852bd0);}})['then'](function(_0x59b36a){if(_0x59b36a){return _0x59b36a?{'count':_0x1d09df,'rows':_0x59b36a}:null;}})[_0xfe25('0x31')](respondWithResult(_0x267f54,null))[_0xfe25('0x26')](handleError(_0x267f54,null));};exports[_0xfe25('0x63')]=function(_0x1d1594,_0x360425,_0x165c2e){if(_0x1d1594[_0xfe25('0x58')]['id']){delete _0x1d1594[_0xfe25('0x58')]['id'];}return db[_0xfe25('0x4d')]['findOne']({'where':{'id':_0x1d1594[_0xfe25('0x53')]['id']}})[_0xfe25('0x31')](handleEntityNotFound(_0x360425,null))['then'](function(_0x3bbda2){if(_0x3bbda2){return _0x3bbda2[_0xfe25('0x63')](_0x1d1594[_0xfe25('0x58')][_0xfe25('0x64')]||[]);}return null;})[_0xfe25('0x31')](respondWithResult(_0x360425,null))[_0xfe25('0x26')](handleError(_0x360425,null));};
\ No newline at end of file
+var _0x2333=['apply','reject','save','destroy','then','stack','name','send','DeskConfiguration','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','add','day','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','create','body','update','params','getFields','findOne','DeskField','getSubjects','sort','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x2333,0x15f));var _0x3233=function(_0x120ce0,_0x3cda23){_0x120ce0=_0x120ce0-0x0;var _0x5ceb23=_0x2333[_0x120ce0];return _0x5ceb23;};'use strict';var pdf=require(_0x3233('0x0'));var emlformat=require(_0x3233('0x1'));var rimraf=require(_0x3233('0x2'));var zipdir=require(_0x3233('0x3'));var jsonpatch=require(_0x3233('0x4'));var rp=require(_0x3233('0x5'));var moment=require(_0x3233('0x6'));var BPromise=require(_0x3233('0x7'));var Mustache=require(_0x3233('0x8'));var util=require('util');var path=require(_0x3233('0x9'));var sox=require(_0x3233('0xa'));var csv=require(_0x3233('0xb'));var ejs=require(_0x3233('0xc'));var fs=require('fs');var _=require(_0x3233('0xd'));var squel=require(_0x3233('0xe'));var crypto=require(_0x3233('0xf'));var jsforce=require(_0x3233('0x10'));var deskjs=require(_0x3233('0x11'));var toCsv=require(_0x3233('0xb'));var querystring=require('querystring');var Papa=require(_0x3233('0x12'));var Redis=require('ioredis');var qs=require(_0x3233('0x13'));var logger=require(_0x3233('0x14'))(_0x3233('0x15'));var utils=require(_0x3233('0x16'));var config=require(_0x3233('0x17'));var db=require(_0x3233('0x18'))['db'];var jayson=require(_0x3233('0x19'));var client=jayson[_0x3233('0x1a')][_0x3233('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x358453,_0x482dfd,_0x349628,_0x17147c){return new BPromise(function(_0x5891bc,_0x18bbd2){var _0x48d877=_0x17147c||client;return _0x48d877[_0x3233('0x1c')](_0x358453,_0x349628)['then'](function(_0xaf800d){logger[_0x3233('0x1d')]('DeskConfiguration,\x20%s,\x20%s',_0x482dfd,_0x3233('0x1e'));logger[_0x3233('0x1f')](_0x3233('0x20'),_0x482dfd,_0x3233('0x1e'),JSON[_0x3233('0x21')](_0xaf800d));if(_0xaf800d['error']){if(_0xaf800d[_0x3233('0x22')][_0x3233('0x23')]===0x1f4){logger[_0x3233('0x22')](_0x3233('0x24'),_0x482dfd,_0xaf800d[_0x3233('0x22')][_0x3233('0x25')]);return _0x18bbd2(_0xaf800d[_0x3233('0x22')][_0x3233('0x25')]);}logger[_0x3233('0x22')]('DeskConfiguration,\x20%s,\x20%s',_0x482dfd,_0xaf800d[_0x3233('0x22')][_0x3233('0x25')]);return _0x5891bc(_0xaf800d[_0x3233('0x22')][_0x3233('0x25')]);}else{logger['info'](_0x3233('0x24'),_0x482dfd,_0x3233('0x1e'));_0x5891bc(_0xaf800d[_0x3233('0x26')][_0x3233('0x25')]);}})[_0x3233('0x27')](function(_0xa9f8ef){logger['error'](_0x3233('0x24'),_0x482dfd,_0xa9f8ef);_0x18bbd2(_0xa9f8ef);});});}function respondWithStatusCode(_0x39e489,_0x210c5a){_0x210c5a=_0x210c5a||0xcc;return function(_0x39d458){if(_0x39d458){return _0x39e489[_0x3233('0x28')](_0x210c5a);}return _0x39e489['status'](_0x210c5a)[_0x3233('0x29')]();};}function respondWithResult(_0xcce654,_0x3ad216){_0x3ad216=_0x3ad216||0xc8;return function(_0x2ec628){if(_0x2ec628){return _0xcce654[_0x3233('0x2a')](_0x3ad216)[_0x3233('0x2b')](_0x2ec628);}};}function respondWithFilteredResult(_0x301785,_0x3a8173){return function(_0x46b17e){if(_0x46b17e){var _0x282694=_0x46b17e[_0x3233('0x2c')],_0x475413=_0x3a8173[_0x3233('0x2d')],_0x433dde=_0x3a8173[_0x3233('0x2d')]+_0x3a8173[_0x3233('0x2e')],_0x4dd841;if(_0x433dde>=_0x282694){_0x433dde=_0x282694;_0x4dd841=0xc8;}else{_0x4dd841=0xce;}_0x301785['status'](_0x4dd841);return _0x301785[_0x3233('0x2f')](_0x3233('0x30'),_0x475413+'-'+_0x433dde+'/'+_0x282694)[_0x3233('0x2b')](_0x46b17e);}return null;};}function patchUpdates(_0x21f629){return function(_0x527ab7){try{jsonpatch[_0x3233('0x31')](_0x527ab7,_0x21f629,!![]);}catch(_0xc973f1){return BPromise[_0x3233('0x32')](_0xc973f1);}return _0x527ab7[_0x3233('0x33')]();};}function saveUpdates(_0x571581,_0x5c9a6c){return function(_0x57ec79){if(_0x57ec79){return _0x57ec79['update'](_0x571581)['then'](function(_0x2f6b16){return _0x2f6b16;});}return null;};}function removeEntity(_0x183eb8,_0x1eaa41){return function(_0x1d3326){if(_0x1d3326){return _0x1d3326[_0x3233('0x34')]()[_0x3233('0x35')](function(){_0x183eb8[_0x3233('0x2a')](0xcc)[_0x3233('0x29')]();});}};}function handleEntityNotFound(_0x5a269e,_0x1edc10){return function(_0x55ac60){if(!_0x55ac60){_0x5a269e[_0x3233('0x28')](0x194);}return _0x55ac60;};}function handleError(_0x40fa5e,_0x1aa83f){_0x1aa83f=_0x1aa83f||0x1f4;return function(_0x799255){logger[_0x3233('0x22')](_0x799255[_0x3233('0x36')]);if(_0x799255[_0x3233('0x37')]){delete _0x799255[_0x3233('0x37')];}_0x40fa5e[_0x3233('0x2a')](_0x1aa83f)[_0x3233('0x38')](_0x799255);};}exports['index']=function(_0xbbf7e6,_0x54576a){var _0x4e63f3={},_0x2a6b02={},_0x6a59fe={'count':0x0,'rows':[]};var _0x34d163=db[_0x3233('0x39')][_0x3233('0x3a')];_0x2a6b02[_0x3233('0x3b')]=_[_0x3233('0x3c')](_0x34d163);var _0x218829={'dateStart':_0xbbf7e6[_0x3233('0x3d')][_0x3233('0x3e')],'dateEnd':_0xbbf7e6[_0x3233('0x3d')][_0x3233('0x3f')]};delete _0xbbf7e6[_0x3233('0x3d')]['dateStart'];delete _0xbbf7e6['query'][_0x3233('0x3f')];_0x2a6b02[_0x3233('0x3d')]=_[_0x3233('0x3c')](_0xbbf7e6[_0x3233('0x3d')]);_0x2a6b02[_0x3233('0x40')]=_['intersection'](_0x2a6b02[_0x3233('0x3b')],_0x2a6b02[_0x3233('0x3d')]);_0x4e63f3[_0x3233('0x41')]=_[_0x3233('0x42')](_0x2a6b02[_0x3233('0x3b')],qs['fields'](_0xbbf7e6[_0x3233('0x3d')][_0x3233('0x43')]));_0x4e63f3[_0x3233('0x41')]=_0x4e63f3[_0x3233('0x41')][_0x3233('0x44')]?_0x4e63f3[_0x3233('0x41')]:_0x2a6b02[_0x3233('0x3b')];if(!_0xbbf7e6[_0x3233('0x3d')][_0x3233('0x45')](_0x3233('0x46'))){_0x4e63f3['limit']=qs['limit'](_0xbbf7e6[_0x3233('0x3d')][_0x3233('0x2e')]);_0x4e63f3[_0x3233('0x2d')]=qs[_0x3233('0x2d')](_0xbbf7e6['query']['offset']);}_0x4e63f3[_0x3233('0x47')]=qs['sort'](_0xbbf7e6[_0x3233('0x3d')]['sort']);_0x4e63f3[_0x3233('0x48')]=qs[_0x3233('0x40')](_[_0x3233('0x49')](_0xbbf7e6['query'],_0x2a6b02[_0x3233('0x40')]));if(_0x218829[_0x3233('0x3e')]){if(_0x218829[_0x3233('0x3f')]){_0x218829[_0x3233('0x3f')]=moment(_0x218829[_0x3233('0x3f')])[_0x3233('0x4a')](0x1,'day');}else{_0x218829['dateEnd']=moment(_0x218829[_0x3233('0x3e')])[_0x3233('0x4a')](0x1,_0x3233('0x4b'));}_[_0x3233('0x4c')](_0x4e63f3[_0x3233('0x48')],{'createdAt':{'$gte':_0x218829[_0x3233('0x3e')],'$lte':_0x218829[_0x3233('0x3f')]}});}if(_0xbbf7e6[_0x3233('0x3d')]['filter']){_0x4e63f3[_0x3233('0x48')]=_['merge'](_0x4e63f3[_0x3233('0x48')],{'$or':_[_0x3233('0x4d')](_0x34d163,function(_0x9e4e13){if(_0x9e4e13[_0x3233('0x4e')][_0x3233('0x4f')]!==_0x3233('0x50')){var _0x5a46dc={};_0x5a46dc[_0x9e4e13[_0x3233('0x51')]]={'$like':'%'+_0xbbf7e6[_0x3233('0x3d')][_0x3233('0x52')]+'%'};return _0x5a46dc;}})});}_0x4e63f3=_[_0x3233('0x4c')]({},_0x4e63f3,_0xbbf7e6[_0x3233('0x53')]);var _0x52b408={'where':_0x4e63f3['where']};return db[_0x3233('0x39')][_0x3233('0x2c')](_0x52b408)[_0x3233('0x35')](function(_0x4c1803){_0x6a59fe[_0x3233('0x2c')]=_0x4c1803;if(_0xbbf7e6[_0x3233('0x3d')]['includeAll']){_0x4e63f3['include']=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x4e63f3);})[_0x3233('0x35')](function(_0x55f927){_0x6a59fe['rows']=_0x55f927;return _0x6a59fe;})[_0x3233('0x35')](respondWithFilteredResult(_0x54576a,_0x4e63f3))[_0x3233('0x27')](handleError(_0x54576a,null));};exports['show']=function(_0x508757,_0x30bd99){var _0x4f11f0={'raw':![],'where':{'id':_0x508757['params']['id']}},_0x101fcd={};_0x101fcd[_0x3233('0x3b')]=_['keys'](db[_0x3233('0x39')][_0x3233('0x3a')]);_0x101fcd['query']=_[_0x3233('0x3c')](_0x508757[_0x3233('0x3d')]);_0x101fcd[_0x3233('0x40')]=_[_0x3233('0x42')](_0x101fcd['model'],_0x101fcd[_0x3233('0x3d')]);_0x4f11f0[_0x3233('0x41')]=_[_0x3233('0x42')](_0x101fcd[_0x3233('0x3b')],qs[_0x3233('0x43')](_0x508757[_0x3233('0x3d')]['fields']));_0x4f11f0[_0x3233('0x41')]=_0x4f11f0[_0x3233('0x41')][_0x3233('0x44')]?_0x4f11f0['attributes']:_0x101fcd[_0x3233('0x3b')];if(_0x508757[_0x3233('0x3d')][_0x3233('0x54')]){_0x4f11f0[_0x3233('0x55')]=[{'all':!![]}];}_0x4f11f0=_['merge']({},_0x4f11f0,_0x508757[_0x3233('0x53')]);return db['DeskConfiguration']['find'](_0x4f11f0)[_0x3233('0x35')](handleEntityNotFound(_0x30bd99,null))[_0x3233('0x35')](respondWithResult(_0x30bd99,null))[_0x3233('0x27')](handleError(_0x30bd99,null));};exports['create']=function(_0x23141c,_0x50686a){return db[_0x3233('0x39')][_0x3233('0x56')](_0x23141c[_0x3233('0x57')],{})[_0x3233('0x35')](respondWithResult(_0x50686a,0xc9))[_0x3233('0x27')](handleError(_0x50686a,null));};exports[_0x3233('0x58')]=function(_0x269a81,_0x44552e){if(_0x269a81[_0x3233('0x57')]['id']){delete _0x269a81[_0x3233('0x57')]['id'];}return db[_0x3233('0x39')]['find']({'where':{'id':_0x269a81[_0x3233('0x59')]['id']}})[_0x3233('0x35')](handleEntityNotFound(_0x44552e,null))[_0x3233('0x35')](saveUpdates(_0x269a81['body'],null))[_0x3233('0x35')](respondWithResult(_0x44552e,null))[_0x3233('0x27')](handleError(_0x44552e,null));};exports[_0x3233('0x34')]=function(_0x383031,_0x313128){return db['DeskConfiguration']['find']({'where':{'id':_0x383031[_0x3233('0x59')]['id']}})[_0x3233('0x35')](handleEntityNotFound(_0x313128,null))[_0x3233('0x35')](removeEntity(_0x313128,null))['catch'](handleError(_0x313128,null));};exports[_0x3233('0x5a')]=function(_0x3a99b1,_0x2f629d,_0x26e7d9){var _0x4ded93={};var _0xf3c0e1={};var _0x2393b7;var _0xd0157d;return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x3a99b1['params']['id']}})[_0x3233('0x35')](handleEntityNotFound(_0x2f629d,null))[_0x3233('0x35')](function(_0x5eb588){if(_0x5eb588){_0x2393b7=_0x5eb588;_0xf3c0e1[_0x3233('0x3b')]=_['keys'](db[_0x3233('0x5c')][_0x3233('0x3a')]);_0xf3c0e1[_0x3233('0x3d')]=_[_0x3233('0x3c')](_0x3a99b1[_0x3233('0x3d')]);_0xf3c0e1['filters']=_['intersection'](_0xf3c0e1[_0x3233('0x3b')],_0xf3c0e1[_0x3233('0x3d')]);_0x4ded93[_0x3233('0x41')]=_[_0x3233('0x42')](_0xf3c0e1[_0x3233('0x3b')],qs[_0x3233('0x43')](_0x3a99b1[_0x3233('0x3d')][_0x3233('0x43')]));_0x4ded93[_0x3233('0x41')]=_0x4ded93[_0x3233('0x41')][_0x3233('0x44')]?_0x4ded93[_0x3233('0x41')]:_0xf3c0e1[_0x3233('0x3b')];_0x4ded93['order']=qs['sort'](_0x3a99b1['query']['sort']);_0x4ded93[_0x3233('0x48')]=qs[_0x3233('0x40')](_[_0x3233('0x49')](_0x3a99b1[_0x3233('0x3d')],_0xf3c0e1[_0x3233('0x40')]));if(_0x3a99b1[_0x3233('0x3d')][_0x3233('0x52')]){_0x4ded93[_0x3233('0x48')]=_[_0x3233('0x4c')](_0x4ded93[_0x3233('0x48')],{'$or':_['map'](_0x4ded93['attributes'],function(_0x4fd302){var _0x592a01={};_0x592a01[_0x4fd302]={'$like':'%'+_0x3a99b1[_0x3233('0x3d')][_0x3233('0x52')]+'%'};return _0x592a01;})});}_0x4ded93=_['merge']({},_0x4ded93,_0x3a99b1[_0x3233('0x53')]);return _0x2393b7[_0x3233('0x5a')](_0x4ded93);}})['then'](function(_0x457aa4){if(_0x457aa4){_0xd0157d=_0x457aa4[_0x3233('0x44')];if(!_0x3a99b1[_0x3233('0x3d')][_0x3233('0x45')](_0x3233('0x46'))){_0x4ded93[_0x3233('0x2e')]=qs[_0x3233('0x2e')](_0x3a99b1[_0x3233('0x3d')][_0x3233('0x2e')]);_0x4ded93[_0x3233('0x2d')]=qs['offset'](_0x3a99b1['query'][_0x3233('0x2d')]);}return _0x2393b7[_0x3233('0x5a')](_0x4ded93);}})['then'](function(_0x41493e){if(_0x41493e){return _0x41493e?{'count':_0xd0157d,'rows':_0x41493e}:null;}})[_0x3233('0x35')](respondWithResult(_0x2f629d,null))[_0x3233('0x27')](handleError(_0x2f629d,null));};exports[_0x3233('0x5d')]=function(_0x23b55b,_0x564b01,_0x18c277){var _0x198b97={};var _0x3a650f={};var _0x222b36;var _0x2bae65;return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x23b55b[_0x3233('0x59')]['id']}})[_0x3233('0x35')](handleEntityNotFound(_0x564b01,null))['then'](function(_0x2dd0e6){if(_0x2dd0e6){_0x222b36=_0x2dd0e6;_0x3a650f[_0x3233('0x3b')]=_[_0x3233('0x3c')](db[_0x3233('0x5c')][_0x3233('0x3a')]);_0x3a650f['query']=_['keys'](_0x23b55b['query']);_0x3a650f['filters']=_['intersection'](_0x3a650f[_0x3233('0x3b')],_0x3a650f['query']);_0x198b97[_0x3233('0x41')]=_[_0x3233('0x42')](_0x3a650f[_0x3233('0x3b')],qs[_0x3233('0x43')](_0x23b55b['query']['fields']));_0x198b97[_0x3233('0x41')]=_0x198b97[_0x3233('0x41')][_0x3233('0x44')]?_0x198b97[_0x3233('0x41')]:_0x3a650f[_0x3233('0x3b')];_0x198b97[_0x3233('0x47')]=qs[_0x3233('0x5e')](_0x23b55b[_0x3233('0x3d')][_0x3233('0x5e')]);_0x198b97[_0x3233('0x48')]=qs['filters'](_['pick'](_0x23b55b['query'],_0x3a650f[_0x3233('0x40')]));if(_0x23b55b[_0x3233('0x3d')][_0x3233('0x52')]){_0x198b97['where']=_[_0x3233('0x4c')](_0x198b97[_0x3233('0x48')],{'$or':_['map'](_0x198b97[_0x3233('0x41')],function(_0x3e1a9e){var _0x39ae8c={};_0x39ae8c[_0x3e1a9e]={'$like':'%'+_0x23b55b['query'][_0x3233('0x52')]+'%'};return _0x39ae8c;})});}_0x198b97=_[_0x3233('0x4c')]({},_0x198b97,_0x23b55b[_0x3233('0x53')]);return _0x222b36[_0x3233('0x5d')](_0x198b97);}})['then'](function(_0x35a220){if(_0x35a220){_0x2bae65=_0x35a220[_0x3233('0x44')];if(!_0x23b55b[_0x3233('0x3d')][_0x3233('0x45')](_0x3233('0x46'))){_0x198b97['limit']=qs[_0x3233('0x2e')](_0x23b55b['query'][_0x3233('0x2e')]);_0x198b97[_0x3233('0x2d')]=qs[_0x3233('0x2d')](_0x23b55b[_0x3233('0x3d')]['offset']);}return _0x222b36['getSubjects'](_0x198b97);}})['then'](function(_0x4cf22f){if(_0x4cf22f){return _0x4cf22f?{'count':_0x2bae65,'rows':_0x4cf22f}:null;}})[_0x3233('0x35')](respondWithResult(_0x564b01,null))[_0x3233('0x27')](handleError(_0x564b01,null));};exports['getDescriptions']=function(_0x566db3,_0xc1bccf,_0x4c807f){var _0x20b5c1={};var _0xdde25e={};var _0x4f252c;var _0x13cc18;return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x566db3[_0x3233('0x59')]['id']}})[_0x3233('0x35')](handleEntityNotFound(_0xc1bccf,null))[_0x3233('0x35')](function(_0x1a33da){if(_0x1a33da){_0x4f252c=_0x1a33da;_0xdde25e[_0x3233('0x3b')]=_['keys'](db['DeskField']['rawAttributes']);_0xdde25e['query']=_[_0x3233('0x3c')](_0x566db3[_0x3233('0x3d')]);_0xdde25e[_0x3233('0x40')]=_[_0x3233('0x42')](_0xdde25e['model'],_0xdde25e[_0x3233('0x3d')]);_0x20b5c1['attributes']=_['intersection'](_0xdde25e[_0x3233('0x3b')],qs[_0x3233('0x43')](_0x566db3[_0x3233('0x3d')]['fields']));_0x20b5c1[_0x3233('0x41')]=_0x20b5c1[_0x3233('0x41')]['length']?_0x20b5c1['attributes']:_0xdde25e[_0x3233('0x3b')];_0x20b5c1['order']=qs['sort'](_0x566db3[_0x3233('0x3d')]['sort']);_0x20b5c1[_0x3233('0x48')]=qs[_0x3233('0x40')](_['pick'](_0x566db3[_0x3233('0x3d')],_0xdde25e[_0x3233('0x40')]));if(_0x566db3[_0x3233('0x3d')][_0x3233('0x52')]){_0x20b5c1['where']=_[_0x3233('0x4c')](_0x20b5c1[_0x3233('0x48')],{'$or':_['map'](_0x20b5c1[_0x3233('0x41')],function(_0x331028){var _0x38dd42={};_0x38dd42[_0x331028]={'$like':'%'+_0x566db3[_0x3233('0x3d')][_0x3233('0x52')]+'%'};return _0x38dd42;})});}_0x20b5c1=_[_0x3233('0x4c')]({},_0x20b5c1,_0x566db3['options']);return _0x4f252c[_0x3233('0x5f')](_0x20b5c1);}})['then'](function(_0x4c41cd){if(_0x4c41cd){_0x13cc18=_0x4c41cd[_0x3233('0x44')];if(!_0x566db3[_0x3233('0x3d')][_0x3233('0x45')]('nolimit')){_0x20b5c1['limit']=qs[_0x3233('0x2e')](_0x566db3[_0x3233('0x3d')][_0x3233('0x2e')]);_0x20b5c1['offset']=qs[_0x3233('0x2d')](_0x566db3[_0x3233('0x3d')][_0x3233('0x2d')]);}return _0x4f252c[_0x3233('0x5f')](_0x20b5c1);}})['then'](function(_0x21ea52){if(_0x21ea52){return _0x21ea52?{'count':_0x13cc18,'rows':_0x21ea52}:null;}})[_0x3233('0x35')](respondWithResult(_0xc1bccf,null))['catch'](handleError(_0xc1bccf,null));};exports[_0x3233('0x60')]=function(_0x322256,_0x17eea4,_0x2b77ae){var _0x4c34e2={};var _0x4ac69c={};var _0x4a86bd;var _0x4e4904;return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x322256[_0x3233('0x59')]['id']}})['then'](handleEntityNotFound(_0x17eea4,null))[_0x3233('0x35')](function(_0x1f3d73){if(_0x1f3d73){_0x4a86bd=_0x1f3d73;_0x4ac69c[_0x3233('0x3b')]=_[_0x3233('0x3c')](db[_0x3233('0x61')]['rawAttributes']);_0x4ac69c[_0x3233('0x3d')]=_['keys'](_0x322256['query']);_0x4ac69c[_0x3233('0x40')]=_[_0x3233('0x42')](_0x4ac69c[_0x3233('0x3b')],_0x4ac69c['query']);_0x4c34e2[_0x3233('0x41')]=_[_0x3233('0x42')](_0x4ac69c[_0x3233('0x3b')],qs['fields'](_0x322256[_0x3233('0x3d')][_0x3233('0x43')]));_0x4c34e2['attributes']=_0x4c34e2[_0x3233('0x41')][_0x3233('0x44')]?_0x4c34e2[_0x3233('0x41')]:_0x4ac69c[_0x3233('0x3b')];_0x4c34e2[_0x3233('0x47')]=qs[_0x3233('0x5e')](_0x322256['query'][_0x3233('0x5e')]);_0x4c34e2[_0x3233('0x48')]=qs[_0x3233('0x40')](_[_0x3233('0x49')](_0x322256[_0x3233('0x3d')],_0x4ac69c[_0x3233('0x40')]));if(_0x322256[_0x3233('0x3d')][_0x3233('0x52')]){_0x4c34e2[_0x3233('0x48')]=_[_0x3233('0x4c')](_0x4c34e2[_0x3233('0x48')],{'$or':_[_0x3233('0x4d')](_0x4c34e2['attributes'],function(_0x1d0103){var _0x5c67d8={};_0x5c67d8[_0x1d0103]={'$like':'%'+_0x322256[_0x3233('0x3d')][_0x3233('0x52')]+'%'};return _0x5c67d8;})});}_0x4c34e2=_[_0x3233('0x4c')]({},_0x4c34e2,_0x322256['options']);return _0x4a86bd[_0x3233('0x60')](_0x4c34e2);}})[_0x3233('0x35')](function(_0x1dda62){if(_0x1dda62){_0x4e4904=_0x1dda62['length'];if(!_0x322256[_0x3233('0x3d')][_0x3233('0x45')](_0x3233('0x46'))){_0x4c34e2[_0x3233('0x2e')]=qs['limit'](_0x322256[_0x3233('0x3d')]['limit']);_0x4c34e2[_0x3233('0x2d')]=qs[_0x3233('0x2d')](_0x322256[_0x3233('0x3d')]['offset']);}return _0x4a86bd[_0x3233('0x60')](_0x4c34e2);}})[_0x3233('0x35')](function(_0x53b978){if(_0x53b978){return _0x53b978?{'count':_0x4e4904,'rows':_0x53b978}:null;}})['then'](respondWithResult(_0x17eea4,null))['catch'](handleError(_0x17eea4,null));};exports['setTags']=function(_0x8749d4,_0x110cd0,_0x3107ef){if(_0x8749d4[_0x3233('0x57')]['id']){delete _0x8749d4[_0x3233('0x57')]['id'];}return db[_0x3233('0x39')][_0x3233('0x5b')]({'where':{'id':_0x8749d4[_0x3233('0x59')]['id']}})['then'](handleEntityNotFound(_0x110cd0,null))[_0x3233('0x35')](function(_0x5b83e9){if(_0x5b83e9){return _0x5b83e9[_0x3233('0x62')](_0x8749d4[_0x3233('0x57')][_0x3233('0x63')]||[]);}return null;})['then'](respondWithResult(_0x110cd0,null))['catch'](handleError(_0x110cd0,null));};
\ No newline at end of file
index c29e335..3babb9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['moment','request-promise','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x955f,0x1eb));var _0xf955=function(_0x313f77,_0x26245a){_0x313f77=_0x313f77-0x0;var _0x276462=_0x955f[_0x313f77];return _0x276462;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x1db0dd,_0x5a20bc){return _0x1db0dd[_0xf955('0x6')](_0xf955('0x7'),attributes,{'tableName':_0xf955('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe605=['define','DeskConfiguration','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise','./intDeskConfiguration.attributes','exports'];(function(_0x2361ab,_0x35bbe6){var _0x36b6ff=function(_0x16d69b){while(--_0x16d69b){_0x2361ab['push'](_0x2361ab['shift']());}};_0x36b6ff(++_0x35bbe6);}(_0xe605,0x92));var _0x5e60=function(_0xa679ef,_0x5f9a56){_0xa679ef=_0xa679ef-0x0;var _0x57c9f6=_0xe605[_0xa679ef];return _0x57c9f6;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var logger=require('../../config/logger')(_0x5e60('0x2'));var moment=require(_0x5e60('0x3'));var BPromise=require(_0x5e60('0x4'));var rp=require(_0x5e60('0x5'));var attributes=require(_0x5e60('0x6'));module[_0x5e60('0x7')]=function(_0x3a6c7c,_0x30d8fb){return _0x3a6c7c[_0x5e60('0x8')](_0x5e60('0x9'),attributes,{'tableName':_0x5e60('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e3d8ab..0cbe3a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x319f9e,_0x52c643){var _0x8b4ada=function(_0x123e3e){while(--_0x123e3e){_0x319f9e['push'](_0x319f9e['shift']());}};_0x8b4ada(++_0x52c643);}(_0x7da7,0x10d));var _0x77da=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x7da7[_0xabfec4];return _0x7bafa2;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var moment=require(_0x77da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77da('0x3'));var db=require(_0x77da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var jayson=require(_0x77da('0x7'));var client=jayson[_0x77da('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){return client[_0x77da('0x9')](_0x30afe0,_0x1191de)[_0x77da('0xa')](function(_0x58f3fe){logger[_0x77da('0xb')](_0x77da('0xc'),_0x47cf1d,_0x77da('0xd'));logger['debug'](_0x77da('0xe'),_0x47cf1d,_0x77da('0xd'),JSON[_0x77da('0xf')](_0x58f3fe));if(_0x58f3fe[_0x77da('0x10')]){if(_0x58f3fe['error'][_0x77da('0x11')]===0x1f4){logger[_0x77da('0x10')](_0x77da('0xc'),_0x47cf1d,_0x58f3fe['error']['message']);return _0x37c5ab(_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);}logger['error'](_0x77da('0xc'),_0x47cf1d,_0x58f3fe[_0x77da('0x10')][_0x77da('0x12')]);return _0x13992e(_0x58f3fe[_0x77da('0x10')]['message']);}else{logger[_0x77da('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x47cf1d,_0x77da('0xd'));_0x13992e(_0x58f3fe[_0x77da('0x13')][_0x77da('0x12')]);}})[_0x77da('0x14')](function(_0x4ecd98){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x47cf1d,_0x4ecd98);_0x37c5ab(_0x4ecd98);});});}
\ No newline at end of file
+var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2e2122,_0x1c487e){_0x2e2122=_0x2e2122-0x0;var _0x21a474=_0x3f8a[_0x2e2122];return _0x21a474;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('DeskConfiguration,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});}
\ No newline at end of file
index 7233a7d..e739f69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8a8=['get','isAuthenticated','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x47c459,_0x26b83d){var _0x4780ce=function(_0x1a63b2){while(--_0x1a63b2){_0x47c459['push'](_0x47c459['shift']());}};_0x4780ce(++_0x26b83d);}(_0xe8a8,0xd9));var _0x8e8a=function(_0x1111f5,_0xac54bd){_0x1111f5=_0x1111f5-0x0;var _0x2b2294=_0xe8a8[_0x1111f5];return _0x2b2294;};'use strict';var multer=require('multer');var util=require(_0x8e8a('0x0'));var path=require('path');var timeout=require(_0x8e8a('0x1'));var express=require(_0x8e8a('0x2'));var router=express[_0x8e8a('0x3')]();var auth=require(_0x8e8a('0x4'));var interaction=require(_0x8e8a('0x5'));var config=require(_0x8e8a('0x6'));var controller=require(_0x8e8a('0x7'));router[_0x8e8a('0x8')]('/',auth[_0x8e8a('0x9')](),controller['index']);router[_0x8e8a('0x8')](_0x8e8a('0xa'),auth[_0x8e8a('0x9')](),controller['show']);router['post']('/',auth[_0x8e8a('0x9')](),controller['create']);router['put'](_0x8e8a('0xa'),auth[_0x8e8a('0x9')](),controller[_0x8e8a('0xb')]);router[_0x8e8a('0xc')](_0x8e8a('0xa'),auth[_0x8e8a('0x9')](),controller[_0x8e8a('0xd')]);module[_0x8e8a('0xe')]=router;
\ No newline at end of file
+var _0x6556=['create','put','update','delete','destroy','exports','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x430a50,_0x3ecaac){var _0x320827=function(_0x31ffa8){while(--_0x31ffa8){_0x430a50['push'](_0x430a50['shift']());}};_0x320827(++_0x3ecaac);}(_0x6556,0xc6));var _0x6655=function(_0x144385,_0x2fd2dd){_0x144385=_0x144385-0x0;var _0x342388=_0x6556[_0x144385];return _0x342388;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6655('0x0'));var timeout=require('connect-timeout');var express=require(_0x6655('0x1'));var router=express[_0x6655('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x6655('0x3'));var config=require(_0x6655('0x4'));var controller=require('./intDeskField.controller');router[_0x6655('0x5')]('/',auth[_0x6655('0x6')](),controller[_0x6655('0x7')]);router[_0x6655('0x5')](_0x6655('0x8'),auth[_0x6655('0x6')](),controller['show']);router[_0x6655('0x9')]('/',auth[_0x6655('0x6')](),controller[_0x6655('0xa')]);router[_0x6655('0xb')]('/:id',auth[_0x6655('0x6')](),controller[_0x6655('0xc')]);router[_0x6655('0xd')](_0x6655('0x8'),auth['isAuthenticated'](),controller[_0x6655('0xe')]);module[_0x6655('0xf')]=router;
\ No newline at end of file
index 5daea87..3a580c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3071('0x5')]},'key':{'type':Sequelize[_0x3071('0x5')]},'keyType':{'type':Sequelize[_0x3071('0x0')](_0x3071('0x1'),_0x3071('0x2'),_0x3071('0x3'))},'keyContent':{'type':Sequelize[_0x3071('0x5')]},'idField':{'type':Sequelize[_0x3071('0x5')]},'nameField':{'type':Sequelize[_0x3071('0x5')]},'customField':{'type':Sequelize[_0x3071('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3071('0x5')]}};
\ No newline at end of file
+var _0xb4e6=['customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xb4e6[_0x1df7b8];return _0x29d911;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'type':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2'),_0x6b4e('0x3'),_0x6b4e('0x4'),_0x6b4e('0x5')),'defaultValue':_0x6b4e('0x2')},'content':{'type':Sequelize[_0x6b4e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6b4e('0x1')](_0x6b4e('0x2'),_0x6b4e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x6b4e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6b4e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4ec2a6c..8c251e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','reject','save','update','then','end','error','name','send','index','DeskField','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','map','type','key','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv'];(function(_0x52860d,_0x2a54c1){var _0x173197=function(_0x2bdbd2){while(--_0x2bdbd2){_0x52860d['push'](_0x52860d['shift']());}};_0x173197(++_0x2a54c1);}(_0x46ed,0x168));var _0xd46e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x46ed[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0xd46e('0x0'));var emlformat=require(_0xd46e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd46e('0x2'));var jsonpatch=require(_0xd46e('0x3'));var rp=require(_0xd46e('0x4'));var moment=require('moment');var BPromise=require(_0xd46e('0x5'));var Mustache=require(_0xd46e('0x6'));var util=require('util');var path=require(_0xd46e('0x7'));var sox=require(_0xd46e('0x8'));var csv=require(_0xd46e('0x9'));var ejs=require(_0xd46e('0xa'));var fs=require('fs');var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x9'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var qs=require(_0xd46e('0x12'));var logger=require('../../config/logger')(_0xd46e('0x13'));var utils=require(_0xd46e('0x14'));var config=require(_0xd46e('0x15'));var db=require(_0xd46e('0x16'))['db'];function respondWithStatusCode(_0x1ad723,_0x2d95a9){_0x2d95a9=_0x2d95a9||0xcc;return function(_0x4920b6){if(_0x4920b6){return _0x1ad723[_0xd46e('0x17')](_0x2d95a9);}return _0x1ad723['status'](_0x2d95a9)['end']();};}function respondWithResult(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xc8;return function(_0x53b309){if(_0x53b309){return _0xf3048c['status'](_0x27dbfb)[_0xd46e('0x18')](_0x53b309);}};}function respondWithFilteredResult(_0x4688ae,_0x1e9aae){return function(_0x3fdf88){if(_0x3fdf88){var _0x50c7c3=_0x3fdf88[_0xd46e('0x19')],_0x3b6d25=_0x1e9aae[_0xd46e('0x1a')],_0x44a620=_0x1e9aae['offset']+_0x1e9aae[_0xd46e('0x1b')],_0x417402;if(_0x44a620>=_0x50c7c3){_0x44a620=_0x50c7c3;_0x417402=0xc8;}else{_0x417402=0xce;}_0x4688ae[_0xd46e('0x1c')](_0x417402);return _0x4688ae[_0xd46e('0x1d')]('Content-Range',_0x3b6d25+'-'+_0x44a620+'/'+_0x50c7c3)['json'](_0x3fdf88);}return null;};}function patchUpdates(_0x2e8f6d){return function(_0x1bd574){try{jsonpatch['apply'](_0x1bd574,_0x2e8f6d,!![]);}catch(_0x4fd1f2){return BPromise[_0xd46e('0x1e')](_0x4fd1f2);}return _0x1bd574[_0xd46e('0x1f')]();};}function saveUpdates(_0x362885,_0x2273c5){return function(_0x409010){if(_0x409010){return _0x409010[_0xd46e('0x20')](_0x362885)[_0xd46e('0x21')](function(_0x327b7e){return _0x327b7e;});}return null;};}function removeEntity(_0xb4940,_0x3c7e91){return function(_0x468aba){if(_0x468aba){return _0x468aba['destroy']()[_0xd46e('0x21')](function(){_0xb4940[_0xd46e('0x1c')](0xcc)[_0xd46e('0x22')]();});}};}function handleEntityNotFound(_0x45ce0b,_0x128246){return function(_0xc1af7f){if(!_0xc1af7f){_0x45ce0b[_0xd46e('0x17')](0x194);}return _0xc1af7f;};}function handleError(_0x8a1be,_0x62dea5){_0x62dea5=_0x62dea5||0x1f4;return function(_0x4cf899){logger[_0xd46e('0x23')](_0x4cf899['stack']);if(_0x4cf899['name']){delete _0x4cf899[_0xd46e('0x24')];}_0x8a1be[_0xd46e('0x1c')](_0x62dea5)[_0xd46e('0x25')](_0x4cf899);};}exports[_0xd46e('0x26')]=function(_0x247b9f,_0x180851){var _0x1740d1={},_0x4dab6a={},_0x45d789={'count':0x0,'rows':[]};var _0x3c301a=db[_0xd46e('0x27')][_0xd46e('0x28')];_0x4dab6a[_0xd46e('0x29')]=_[_0xd46e('0x2a')](_0x3c301a);var _0x58aeef={'dateStart':_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x2c')],'dateEnd':_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x2d')]};delete _0x247b9f[_0xd46e('0x2b')][_0xd46e('0x2c')];delete _0x247b9f[_0xd46e('0x2b')][_0xd46e('0x2d')];_0x4dab6a[_0xd46e('0x2b')]=_[_0xd46e('0x2a')](_0x247b9f[_0xd46e('0x2b')]);_0x4dab6a[_0xd46e('0x2e')]=_[_0xd46e('0x2f')](_0x4dab6a['model'],_0x4dab6a[_0xd46e('0x2b')]);_0x1740d1[_0xd46e('0x30')]=_[_0xd46e('0x2f')](_0x4dab6a[_0xd46e('0x29')],qs['fields'](_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x31')]));_0x1740d1['attributes']=_0x1740d1[_0xd46e('0x30')][_0xd46e('0x32')]?_0x1740d1['attributes']:_0x4dab6a[_0xd46e('0x29')];if(!_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x33')]('nolimit')){_0x1740d1['limit']=qs[_0xd46e('0x1b')](_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x1b')]);_0x1740d1[_0xd46e('0x1a')]=qs[_0xd46e('0x1a')](_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x1a')]);}_0x1740d1[_0xd46e('0x34')]=qs['sort'](_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x35')]);_0x1740d1[_0xd46e('0x36')]=qs[_0xd46e('0x2e')](_[_0xd46e('0x37')](_0x247b9f[_0xd46e('0x2b')],_0x4dab6a[_0xd46e('0x2e')]));if(_0x58aeef['dateStart']){if(_0x58aeef[_0xd46e('0x2d')]){_0x58aeef[_0xd46e('0x2d')]=moment(_0x58aeef['dateEnd'])[_0xd46e('0x38')](0x1,_0xd46e('0x39'));}else{_0x58aeef[_0xd46e('0x2d')]=moment(_0x58aeef[_0xd46e('0x2c')])['add'](0x1,_0xd46e('0x39'));}_[_0xd46e('0x3a')](_0x1740d1[_0xd46e('0x36')],{'createdAt':{'$gte':_0x58aeef[_0xd46e('0x2c')],'$lte':_0x58aeef[_0xd46e('0x2d')]}});}if(_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x3b')]){_0x1740d1[_0xd46e('0x36')]=_['merge'](_0x1740d1[_0xd46e('0x36')],{'$or':_[_0xd46e('0x3c')](_0x3c301a,function(_0xc83ea1){if(_0xc83ea1[_0xd46e('0x3d')][_0xd46e('0x3e')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0xc83ea1['field']]={'$like':'%'+_0x247b9f['query']['filter']+'%'};return _0x964c66;}})});}_0x1740d1=_['merge']({},_0x1740d1,_0x247b9f[_0xd46e('0x3f')]);var _0x54949f={'where':_0x1740d1[_0xd46e('0x36')]};return db[_0xd46e('0x27')]['count'](_0x54949f)[_0xd46e('0x21')](function(_0x4114e6){_0x45d789[_0xd46e('0x19')]=_0x4114e6;if(_0x247b9f[_0xd46e('0x2b')][_0xd46e('0x40')]){_0x1740d1[_0xd46e('0x41')]=[{'all':!![]}];}return db[_0xd46e('0x27')][_0xd46e('0x42')](_0x1740d1);})[_0xd46e('0x21')](function(_0xec367d){_0x45d789[_0xd46e('0x43')]=_0xec367d;return _0x45d789;})['then'](respondWithFilteredResult(_0x180851,_0x1740d1))['catch'](handleError(_0x180851,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x44')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x29')]=_[_0xd46e('0x2a')](db[_0xd46e('0x27')][_0xd46e('0x28')]);_0x272f5f[_0xd46e('0x2b')]=_['keys'](_0x2b4a5a[_0xd46e('0x2b')]);_0x272f5f['filters']=_[_0xd46e('0x2f')](_0x272f5f[_0xd46e('0x29')],_0x272f5f[_0xd46e('0x2b')]);_0x168d35[_0xd46e('0x30')]=_[_0xd46e('0x2f')](_0x272f5f['model'],qs[_0xd46e('0x31')](_0x2b4a5a[_0xd46e('0x2b')][_0xd46e('0x31')]));_0x168d35[_0xd46e('0x30')]=_0x168d35[_0xd46e('0x30')]['length']?_0x168d35[_0xd46e('0x30')]:_0x272f5f[_0xd46e('0x29')];if(_0x2b4a5a[_0xd46e('0x2b')][_0xd46e('0x40')]){_0x168d35[_0xd46e('0x41')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x3f')]);return db[_0xd46e('0x27')][_0xd46e('0x45')](_0x168d35)[_0xd46e('0x21')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x21')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x46')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x47')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x27')][_0xd46e('0x47')](_0x440dcc[_0xd46e('0x48')],{})[_0xd46e('0x21')](respondWithResult(_0x5188f6,0xc9))[_0xd46e('0x46')](handleError(_0x5188f6,null));};exports['update']=function(_0x4ae314,_0x3a94cf){if(_0x4ae314[_0xd46e('0x48')]['id']){delete _0x4ae314[_0xd46e('0x48')]['id'];}return db['DeskField']['find']({'where':{'id':_0x4ae314[_0xd46e('0x44')]['id']}})[_0xd46e('0x21')](handleEntityNotFound(_0x3a94cf,null))['then'](saveUpdates(_0x4ae314[_0xd46e('0x48')],null))[_0xd46e('0x21')](respondWithResult(_0x3a94cf,null))[_0xd46e('0x46')](handleError(_0x3a94cf,null));};exports[_0xd46e('0x49')]=function(_0x1bd8a5,_0x34d4ca){return db[_0xd46e('0x27')][_0xd46e('0x45')]({'where':{'id':_0x1bd8a5['params']['id']}})[_0xd46e('0x21')](handleEntityNotFound(_0x34d4ca,null))[_0xd46e('0x21')](removeEntity(_0x34d4ca,null))[_0xd46e('0x46')](handleError(_0x34d4ca,null));};
\ No newline at end of file
+var _0x0295=['name','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','add','day','merge','filter','map','VIRTUAL','field','DeskField','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0295,0x1f0));var _0x5029=function(_0x3d3d7b,_0x5c0937){_0x3d3d7b=_0x3d3d7b-0x0;var _0x33e7c8=_0x0295[_0x3d3d7b];return _0x33e7c8;};'use strict';var pdf=require(_0x5029('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5029('0x2'));var BPromise=require(_0x5029('0x3'));var Mustache=require(_0x5029('0x4'));var util=require(_0x5029('0x5'));var path=require(_0x5029('0x6'));var sox=require(_0x5029('0x7'));var csv=require(_0x5029('0x8'));var ejs=require(_0x5029('0x9'));var fs=require('fs');var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x5029('0xe'))(_0x5029('0xf'));var utils=require(_0x5029('0x10'));var config=require('../../config/environment');var db=require(_0x5029('0x11'))['db'];function respondWithStatusCode(_0xbf61f,_0x3fe6d1){_0x3fe6d1=_0x3fe6d1||0xcc;return function(_0x4f295e){if(_0x4f295e){return _0xbf61f[_0x5029('0x12')](_0x3fe6d1);}return _0xbf61f[_0x5029('0x13')](_0x3fe6d1)['end']();};}function respondWithResult(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xc8;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x13')](_0x49f836)[_0x5029('0x14')](_0x4aebb6);}};}function respondWithFilteredResult(_0x12c237,_0x434630){return function(_0x2c0b33){if(_0x2c0b33){var _0x11c24b=_0x2c0b33[_0x5029('0x15')],_0xe278b7=_0x434630[_0x5029('0x16')],_0x317c20=_0x434630[_0x5029('0x16')]+_0x434630[_0x5029('0x17')],_0x10bf55;if(_0x317c20>=_0x11c24b){_0x317c20=_0x11c24b;_0x10bf55=0xc8;}else{_0x10bf55=0xce;}_0x12c237[_0x5029('0x13')](_0x10bf55);return _0x12c237[_0x5029('0x18')]('Content-Range',_0xe278b7+'-'+_0x317c20+'/'+_0x11c24b)[_0x5029('0x14')](_0x2c0b33);}return null;};}function patchUpdates(_0x31a155){return function(_0x35de81){try{jsonpatch[_0x5029('0x19')](_0x35de81,_0x31a155,!![]);}catch(_0x8cea01){return BPromise[_0x5029('0x1a')](_0x8cea01);}return _0x35de81[_0x5029('0x1b')]();};}function saveUpdates(_0x4adbb3,_0x226a5c){return function(_0x5696b1){if(_0x5696b1){return _0x5696b1[_0x5029('0x1c')](_0x4adbb3)[_0x5029('0x1d')](function(_0x2710aa){return _0x2710aa;});}return null;};}function removeEntity(_0x3cf0fb,_0x4b5854){return function(_0x47ecca){if(_0x47ecca){return _0x47ecca[_0x5029('0x1e')]()['then'](function(){_0x3cf0fb[_0x5029('0x13')](0xcc)[_0x5029('0x1f')]();});}};}function handleEntityNotFound(_0x1eb228,_0x2bbbcb){return function(_0x16bd22){if(!_0x16bd22){_0x1eb228[_0x5029('0x12')](0x194);}return _0x16bd22;};}function handleError(_0x125c26,_0x356dac){_0x356dac=_0x356dac||0x1f4;return function(_0x3e857d){logger['error'](_0x3e857d['stack']);if(_0x3e857d['name']){delete _0x3e857d[_0x5029('0x20')];}_0x125c26[_0x5029('0x13')](_0x356dac)['send'](_0x3e857d);};}exports['index']=function(_0x181da0,_0x1e7e61){var _0x36d810={},_0x5527fc={},_0x2c501f={'count':0x0,'rows':[]};var _0xb14bc=db['DeskField'][_0x5029('0x21')];_0x5527fc[_0x5029('0x22')]=_[_0x5029('0x23')](_0xb14bc);var _0x4a24b9={'dateStart':_0x181da0[_0x5029('0x24')][_0x5029('0x25')],'dateEnd':_0x181da0[_0x5029('0x24')]['dateEnd']};delete _0x181da0[_0x5029('0x24')][_0x5029('0x25')];delete _0x181da0['query'][_0x5029('0x26')];_0x5527fc[_0x5029('0x24')]=_[_0x5029('0x23')](_0x181da0[_0x5029('0x24')]);_0x5527fc[_0x5029('0x27')]=_[_0x5029('0x28')](_0x5527fc[_0x5029('0x22')],_0x5527fc[_0x5029('0x24')]);_0x36d810[_0x5029('0x29')]=_[_0x5029('0x28')](_0x5527fc[_0x5029('0x22')],qs[_0x5029('0x2a')](_0x181da0['query'][_0x5029('0x2a')]));_0x36d810['attributes']=_0x36d810[_0x5029('0x29')]['length']?_0x36d810['attributes']:_0x5527fc[_0x5029('0x22')];if(!_0x181da0[_0x5029('0x24')][_0x5029('0x2b')]('nolimit')){_0x36d810[_0x5029('0x17')]=qs[_0x5029('0x17')](_0x181da0[_0x5029('0x24')][_0x5029('0x17')]);_0x36d810[_0x5029('0x16')]=qs[_0x5029('0x16')](_0x181da0[_0x5029('0x24')][_0x5029('0x16')]);}_0x36d810[_0x5029('0x2c')]=qs['sort'](_0x181da0[_0x5029('0x24')][_0x5029('0x2d')]);_0x36d810[_0x5029('0x2e')]=qs[_0x5029('0x27')](_['pick'](_0x181da0[_0x5029('0x24')],_0x5527fc[_0x5029('0x27')]));if(_0x4a24b9[_0x5029('0x25')]){if(_0x4a24b9['dateEnd']){_0x4a24b9['dateEnd']=moment(_0x4a24b9[_0x5029('0x26')])[_0x5029('0x2f')](0x1,'day');}else{_0x4a24b9['dateEnd']=moment(_0x4a24b9[_0x5029('0x25')])[_0x5029('0x2f')](0x1,_0x5029('0x30'));}_[_0x5029('0x31')](_0x36d810[_0x5029('0x2e')],{'createdAt':{'$gte':_0x4a24b9[_0x5029('0x25')],'$lte':_0x4a24b9[_0x5029('0x26')]}});}if(_0x181da0[_0x5029('0x24')][_0x5029('0x32')]){_0x36d810[_0x5029('0x2e')]=_[_0x5029('0x31')](_0x36d810[_0x5029('0x2e')],{'$or':_[_0x5029('0x33')](_0xb14bc,function(_0x2fe5c){if(_0x2fe5c['type']['key']!==_0x5029('0x34')){var _0x1b64da={};_0x1b64da[_0x2fe5c[_0x5029('0x35')]]={'$like':'%'+_0x181da0['query'][_0x5029('0x32')]+'%'};return _0x1b64da;}})});}_0x36d810=_[_0x5029('0x31')]({},_0x36d810,_0x181da0['options']);var _0x247789={'where':_0x36d810['where']};return db[_0x5029('0x36')]['count'](_0x247789)[_0x5029('0x1d')](function(_0x359838){_0x2c501f[_0x5029('0x15')]=_0x359838;if(_0x181da0[_0x5029('0x24')][_0x5029('0x37')]){_0x36d810[_0x5029('0x38')]=[{'all':!![]}];}return db[_0x5029('0x36')][_0x5029('0x39')](_0x36d810);})[_0x5029('0x1d')](function(_0x5a3e4d){_0x2c501f[_0x5029('0x3a')]=_0x5a3e4d;return _0x2c501f;})[_0x5029('0x1d')](respondWithFilteredResult(_0x1e7e61,_0x36d810))[_0x5029('0x3b')](handleError(_0x1e7e61,null));};exports[_0x5029('0x3c')]=function(_0x3525bc,_0x11ac2e){var _0x5658a7={'raw':!![],'where':{'id':_0x3525bc[_0x5029('0x3d')]['id']}},_0x259db8={};_0x259db8[_0x5029('0x22')]=_[_0x5029('0x23')](db[_0x5029('0x36')]['rawAttributes']);_0x259db8[_0x5029('0x24')]=_[_0x5029('0x23')](_0x3525bc[_0x5029('0x24')]);_0x259db8[_0x5029('0x27')]=_[_0x5029('0x28')](_0x259db8[_0x5029('0x22')],_0x259db8[_0x5029('0x24')]);_0x5658a7[_0x5029('0x29')]=_[_0x5029('0x28')](_0x259db8['model'],qs[_0x5029('0x2a')](_0x3525bc[_0x5029('0x24')][_0x5029('0x2a')]));_0x5658a7[_0x5029('0x29')]=_0x5658a7['attributes']['length']?_0x5658a7[_0x5029('0x29')]:_0x259db8[_0x5029('0x22')];if(_0x3525bc[_0x5029('0x24')][_0x5029('0x37')]){_0x5658a7[_0x5029('0x38')]=[{'all':!![]}];}_0x5658a7=_[_0x5029('0x31')]({},_0x5658a7,_0x3525bc[_0x5029('0x3e')]);return db[_0x5029('0x36')][_0x5029('0x3f')](_0x5658a7)[_0x5029('0x1d')](handleEntityNotFound(_0x11ac2e,null))[_0x5029('0x1d')](respondWithResult(_0x11ac2e,null))[_0x5029('0x3b')](handleError(_0x11ac2e,null));};exports[_0x5029('0x40')]=function(_0x18f1f5,_0x3168bd){return db[_0x5029('0x36')][_0x5029('0x40')](_0x18f1f5[_0x5029('0x41')],{})[_0x5029('0x1d')](respondWithResult(_0x3168bd,0xc9))[_0x5029('0x3b')](handleError(_0x3168bd,null));};exports[_0x5029('0x1c')]=function(_0x489457,_0x1069c4){if(_0x489457['body']['id']){delete _0x489457[_0x5029('0x41')]['id'];}return db[_0x5029('0x36')]['find']({'where':{'id':_0x489457['params']['id']}})[_0x5029('0x1d')](handleEntityNotFound(_0x1069c4,null))['then'](saveUpdates(_0x489457['body'],null))[_0x5029('0x1d')](respondWithResult(_0x1069c4,null))[_0x5029('0x3b')](handleError(_0x1069c4,null));};exports[_0x5029('0x1e')]=function(_0x561291,_0x544fb3){return db[_0x5029('0x36')][_0x5029('0x3f')]({'where':{'id':_0x561291['params']['id']}})[_0x5029('0x1d')](handleEntityNotFound(_0x544fb3,null))['then'](removeEntity(_0x544fb3,null))[_0x5029('0x3b')](handleError(_0x544fb3,null));};
\ No newline at end of file
index f57058b..27b6b57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['request-promise','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','lodash','util','api','moment','bluebird'];(function(_0x524207,_0x343c59){var _0x4575ac=function(_0x4a27c6){while(--_0x4a27c6){_0x524207['push'](_0x524207['shift']());}};_0x4575ac(++_0x343c59);}(_0x17ba,0xab));var _0xa17b=function(_0x584143,_0x5e8b01){_0x584143=_0x584143-0x0;var _0x312958=_0x17ba[_0x584143];return _0x312958;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var attributes=require(_0xa17b('0x6'));module[_0xa17b('0x7')]=function(_0x11d7b7,_0x2f64d0){return _0x11d7b7[_0xa17b('0x8')](_0xa17b('0x9'),attributes,{'tableName':_0xa17b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87ea=['api','bluebird','request-promise','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','util','../../config/logger'];(function(_0x278d73,_0xb20d63){var _0x31ca5c=function(_0x3355d5){while(--_0x3355d5){_0x278d73['push'](_0x278d73['shift']());}};_0x31ca5c(++_0xb20d63);}(_0x87ea,0x18a));var _0xa87e=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x87ea[_0xbb9dbf];return _0x30223c;};'use strict';var _=require('lodash');var util=require(_0xa87e('0x0'));var logger=require(_0xa87e('0x1'))(_0xa87e('0x2'));var moment=require('moment');var BPromise=require(_0xa87e('0x3'));var rp=require(_0xa87e('0x4'));var attributes=require(_0xa87e('0x5'));module[_0xa87e('0x6')]=function(_0x29af08,_0x51b0cd){return _0x29af08[_0xa87e('0x7')](_0xa87e('0x8'),attributes,{'tableName':_0xa87e('0x9'),'paranoid':![],'indexes':[{'name':_0xa87e('0xa'),'fields':['idField',_0xa87e('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e894ad0..fb27090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x37eace,_0x5b8519){var _0x4e36c3=function(_0x3a26c2){while(--_0x3a26c2){_0x37eace['push'](_0x37eace['shift']());}};_0x4e36c3(++_0x5b8519);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x507e1c,_0x4ea8e7){_0x507e1c=_0x507e1c-0x0;var _0x76227d=_0xd6d6[_0x507e1c];return _0x76227d;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){return client[_0x6d6d('0xc')](_0x1bf731,_0x18f824)['then'](function(_0x51dd38){logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,_0x6d6d('0xf'));logger[_0x6d6d('0x10')](_0x6d6d('0x11'),_0x44f83d,'request\x20sent',JSON[_0x6d6d('0x12')](_0x51dd38));if(_0x51dd38[_0x6d6d('0x13')]){if(_0x51dd38['error']['code']===0x1f4){logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);return _0x408f88(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}logger[_0x6d6d('0x13')](_0x6d6d('0xe'),_0x44f83d,_0x51dd38['error'][_0x6d6d('0x14')]);return _0xd49f57(_0x51dd38[_0x6d6d('0x13')][_0x6d6d('0x14')]);}else{logger[_0x6d6d('0xd')](_0x6d6d('0xe'),_0x44f83d,'request\x20sent');_0xd49f57(_0x51dd38[_0x6d6d('0x15')]['message']);}})[_0x6d6d('0x16')](function(_0x2cbc86){logger[_0x6d6d('0x13')]('DeskField,\x20%s,\x20%s',_0x44f83d,_0x2cbc86);_0x408f88(_0x2cbc86);});});}
\ No newline at end of file
+var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result'];(function(_0x154fb7,_0x281bde){var _0x5bc551=function(_0x50f477){while(--_0x50f477){_0x154fb7['push'](_0x154fb7['shift']());}};_0x5bc551(++_0x281bde);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xf3cd[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('DeskField,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('DeskField,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});}
\ No newline at end of file
index fba5b47..2d22abe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac1=['post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','get','/:id/configurations','/:id/fields','getFields'];(function(_0xa94957,_0x44de11){var _0x1b6c46=function(_0x47d1c1){while(--_0x47d1c1){_0xa94957['push'](_0xa94957['shift']());}};_0x1b6c46(++_0x44de11);}(_0x9ac1,0xe3));var _0x19ac=function(_0x48527b,_0x5f0986){_0x48527b=_0x48527b-0x0;var _0x4ed64d=_0x9ac1[_0x48527b];return _0x4ed64d;};'use strict';var multer=require(_0x19ac('0x0'));var util=require(_0x19ac('0x1'));var path=require(_0x19ac('0x2'));var timeout=require(_0x19ac('0x3'));var express=require(_0x19ac('0x4'));var router=express[_0x19ac('0x5')]();var auth=require(_0x19ac('0x6'));var interaction=require(_0x19ac('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x19ac('0x8')](),controller[_0x19ac('0x9')]);router['get'](_0x19ac('0xa'),auth[_0x19ac('0x8')](),controller['show']);router[_0x19ac('0xb')](_0x19ac('0xc'),auth[_0x19ac('0x8')](),controller['getConfigurations']);router[_0x19ac('0xb')](_0x19ac('0xd'),auth[_0x19ac('0x8')](),controller[_0x19ac('0xe')]);router[_0x19ac('0xf')]('/',auth[_0x19ac('0x8')](),controller[_0x19ac('0x10')]);router[_0x19ac('0xf')](_0x19ac('0xc'),auth[_0x19ac('0x8')](),controller[_0x19ac('0x11')]);router[_0x19ac('0x12')]('/:id',auth[_0x19ac('0x8')](),controller[_0x19ac('0x13')]);router['delete'](_0x19ac('0xa'),auth[_0x19ac('0x8')](),controller[_0x19ac('0x14')]);module[_0x19ac('0x15')]=router;
\ No newline at end of file
+var _0x4b1e=['index','get','/:id','show','/:id/configurations','/:id/fields','post','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x4b1e,0x9e));var _0xe4b1=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x4b1e[_0x1f5a63];return _0x30bb7a;};'use strict';var multer=require(_0xe4b1('0x0'));var util=require(_0xe4b1('0x1'));var path=require(_0xe4b1('0x2'));var timeout=require(_0xe4b1('0x3'));var express=require(_0xe4b1('0x4'));var router=express[_0xe4b1('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4b1('0x6'));var config=require(_0xe4b1('0x7'));var controller=require(_0xe4b1('0x8'));router['get']('/',auth[_0xe4b1('0x9')](),controller[_0xe4b1('0xa')]);router[_0xe4b1('0xb')](_0xe4b1('0xc'),auth[_0xe4b1('0x9')](),controller[_0xe4b1('0xd')]);router[_0xe4b1('0xb')](_0xe4b1('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe4b1('0xb')](_0xe4b1('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xe4b1('0x10')]('/',auth[_0xe4b1('0x9')](),controller['create']);router[_0xe4b1('0x10')](_0xe4b1('0xe'),auth['isAuthenticated'](),controller[_0xe4b1('0x11')]);router[_0xe4b1('0x12')](_0xe4b1('0xc'),auth[_0xe4b1('0x9')](),controller['update']);router['delete'](_0xe4b1('0xc'),auth['isAuthenticated'](),controller[_0xe4b1('0x13')]);module[_0xe4b1('0x14')]=router;
\ No newline at end of file
index 0ef180c..8911213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed39=['exports','STRING','sequelize'];(function(_0x3da675,_0x4b7c68){var _0x42e9ea=function(_0x2b57d1){while(--_0x2b57d1){_0x3da675['push'](_0x3da675['shift']());}};_0x42e9ea(++_0x4b7c68);}(_0xed39,0xa7));var _0x9ed3=function(_0x4cf58d,_0x3862e0){_0x4cf58d=_0x4cf58d-0x0;var _0x45ebfc=_0xed39[_0x4cf58d];return _0x45ebfc;};'use strict';var Sequelize=require(_0x9ed3('0x0'));module[_0x9ed3('0x1')]={'name':{'type':Sequelize[_0x9ed3('0x2')]},'description':{'type':Sequelize[_0x9ed3('0x2')]},'username':{'type':Sequelize[_0x9ed3('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x9ed3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x9ed3('0x2')]}};
\ No newline at end of file
+var _0xb773=['STRING','username','sequelize','exports'];(function(_0xc60d1b,_0xc273b9){var _0x41eab4=function(_0x297160){while(--_0x297160){_0xc60d1b['push'](_0xc60d1b['shift']());}};_0x41eab4(++_0xc273b9);}(_0xb773,0x14e));var _0x3b77=function(_0x187499,_0x5e416a){_0x187499=_0x187499-0x0;var _0x2965fe=_0xb773[_0x187499];return _0x2965fe;};'use strict';var Sequelize=require(_0x3b77('0x0'));module[_0x3b77('0x1')]={'name':{'type':Sequelize[_0x3b77('0x2')]},'description':{'type':Sequelize[_0x3b77('0x2')]},'username':{'type':Sequelize[_0x3b77('0x2')],'unique':_0x3b77('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x3b77('0x2')]}};
\ No newline at end of file
index e05ae13..285a658 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d57=['lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','count','limit','set','Content-Range','json','apply','reject','update','sendStatus','name','send','keys','query','dateStart','dateEnd','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','day','add','filter','map','type','key','VIRTUAL','field','merge','includeAll','include','FreshdeskAccount','findAll','rows','rawAttributes','options','create','body','find','params','destroy','FreshdeskConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','findOne','remoteUri','apiKey','GET','format','%s%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','agent','source','group','company','includes','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x2f6690,_0x49aa34){var _0x534194=function(_0xddc45e){while(--_0xddc45e){_0x2f6690['push'](_0x2f6690['shift']());}};_0x534194(++_0x49aa34);}(_0x9d57,0x1cb));var _0x79d5=function(_0xb8d37f,_0xf510ab){_0xb8d37f=_0xb8d37f-0x0;var _0x5b6e68=_0x9d57[_0xb8d37f];return _0x5b6e68;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x79d5('0x0'));var zipdir=require(_0x79d5('0x1'));var jsonpatch=require(_0x79d5('0x2'));var rp=require(_0x79d5('0x3'));var moment=require(_0x79d5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x79d5('0x5'));var path=require(_0x79d5('0x6'));var sox=require(_0x79d5('0x7'));var csv=require(_0x79d5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x79d5('0x9'));var squel=require(_0x79d5('0xa'));var crypto=require('crypto');var jsforce=require(_0x79d5('0xb'));var deskjs=require(_0x79d5('0xc'));var toCsv=require(_0x79d5('0x8'));var querystring=require(_0x79d5('0xd'));var Papa=require('papaparse');var Redis=require(_0x79d5('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x79d5('0xf'))(_0x79d5('0x10'));var utils=require(_0x79d5('0x11'));var config=require('../../config/environment');var db=require(_0x79d5('0x12'))['db'];var integrations=require(_0x79d5('0x13'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b19b6,_0x5c10a0,_0x34b167,_0xa84dde){return new BPromise(function(_0x1bbfc5,_0x236a12){var _0x39d163=_0xa84dde||client;return _0x39d163['request'](_0x5b19b6,_0x34b167)[_0x79d5('0x14')](function(_0x16db99){logger[_0x79d5('0x15')](_0x79d5('0x16'),_0x5c10a0,_0x79d5('0x17'));logger[_0x79d5('0x18')](_0x79d5('0x19'),_0x5c10a0,_0x79d5('0x17'),JSON[_0x79d5('0x1a')](_0x16db99));if(_0x16db99[_0x79d5('0x1b')]){if(_0x16db99[_0x79d5('0x1b')][_0x79d5('0x1c')]===0x1f4){logger[_0x79d5('0x1b')](_0x79d5('0x16'),_0x5c10a0,_0x16db99[_0x79d5('0x1b')][_0x79d5('0x1d')]);return _0x236a12(_0x16db99['error']['message']);}logger['error'](_0x79d5('0x16'),_0x5c10a0,_0x16db99['error'][_0x79d5('0x1d')]);return _0x1bbfc5(_0x16db99['error'][_0x79d5('0x1d')]);}else{logger['info'](_0x79d5('0x16'),_0x5c10a0,_0x79d5('0x17'));_0x1bbfc5(_0x16db99[_0x79d5('0x1e')][_0x79d5('0x1d')]);}})[_0x79d5('0x1f')](function(_0x200744){logger[_0x79d5('0x1b')](_0x79d5('0x16'),_0x5c10a0,_0x200744);_0x236a12(_0x200744);});});}function respondWithStatusCode(_0x23752b,_0x2f9e8d){_0x2f9e8d=_0x2f9e8d||0xcc;return function(_0x561cf7){if(_0x561cf7){return _0x23752b['sendStatus'](_0x2f9e8d);}return _0x23752b[_0x79d5('0x20')](_0x2f9e8d)['end']();};}function respondWithResult(_0x230492,_0xcdb7b0){_0xcdb7b0=_0xcdb7b0||0xc8;return function(_0x260851){if(_0x260851){return _0x230492[_0x79d5('0x20')](_0xcdb7b0)['json'](_0x260851);}};}function respondWithFilteredResult(_0x273284,_0x5d0ef5){return function(_0x146551){if(_0x146551){var _0x4430a2=_0x146551[_0x79d5('0x21')],_0x6cfe9b=_0x5d0ef5['offset'],_0x56d078=_0x5d0ef5['offset']+_0x5d0ef5[_0x79d5('0x22')],_0x65b7c0;if(_0x56d078>=_0x4430a2){_0x56d078=_0x4430a2;_0x65b7c0=0xc8;}else{_0x65b7c0=0xce;}_0x273284[_0x79d5('0x20')](_0x65b7c0);return _0x273284[_0x79d5('0x23')](_0x79d5('0x24'),_0x6cfe9b+'-'+_0x56d078+'/'+_0x4430a2)[_0x79d5('0x25')](_0x146551);}return null;};}function patchUpdates(_0x2949fa){return function(_0x2e37df){try{jsonpatch[_0x79d5('0x26')](_0x2e37df,_0x2949fa,!![]);}catch(_0x2f3ca1){return BPromise[_0x79d5('0x27')](_0x2f3ca1);}return _0x2e37df['save']();};}function saveUpdates(_0x253fce,_0x578014){return function(_0x4cfc41){if(_0x4cfc41){return _0x4cfc41[_0x79d5('0x28')](_0x253fce)[_0x79d5('0x14')](function(_0x2a65e2){return _0x2a65e2;});}return null;};}function removeEntity(_0x3f6833,_0x1ba66e){return function(_0x8f1482){if(_0x8f1482){return _0x8f1482['destroy']()[_0x79d5('0x14')](function(){_0x3f6833[_0x79d5('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22805f,_0x983028){return function(_0x13472d){if(!_0x13472d){_0x22805f[_0x79d5('0x29')](0x194);}return _0x13472d;};}function handleError(_0x2df020,_0x263929){_0x263929=_0x263929||0x1f4;return function(_0x2749ea){logger['error'](_0x2749ea['stack']);if(_0x2749ea[_0x79d5('0x2a')]){delete _0x2749ea[_0x79d5('0x2a')];}_0x2df020[_0x79d5('0x20')](_0x263929)[_0x79d5('0x2b')](_0x2749ea);};}exports['index']=function(_0x2ad948,_0x48b384){var _0x4154e5={},_0x58d9b={},_0x4e97f9={'count':0x0,'rows':[]};var _0x124f2a=db['FreshdeskAccount']['rawAttributes'];_0x58d9b['model']=_[_0x79d5('0x2c')](_0x124f2a);var _0x7a7332={'dateStart':_0x2ad948[_0x79d5('0x2d')][_0x79d5('0x2e')],'dateEnd':_0x2ad948['query'][_0x79d5('0x2f')]};delete _0x2ad948[_0x79d5('0x2d')][_0x79d5('0x2e')];delete _0x2ad948[_0x79d5('0x2d')]['dateEnd'];_0x58d9b[_0x79d5('0x2d')]=_[_0x79d5('0x2c')](_0x2ad948[_0x79d5('0x2d')]);_0x58d9b[_0x79d5('0x30')]=_[_0x79d5('0x31')](_0x58d9b[_0x79d5('0x32')],_0x58d9b['query']);_0x4154e5['attributes']=_['intersection'](_0x58d9b[_0x79d5('0x32')],qs[_0x79d5('0x33')](_0x2ad948[_0x79d5('0x2d')][_0x79d5('0x33')]));_0x4154e5['attributes']=_0x4154e5['attributes'][_0x79d5('0x34')]?_0x4154e5[_0x79d5('0x35')]:_0x58d9b[_0x79d5('0x32')];if(!_0x2ad948[_0x79d5('0x2d')][_0x79d5('0x36')](_0x79d5('0x37'))){_0x4154e5[_0x79d5('0x22')]=qs[_0x79d5('0x22')](_0x2ad948['query'][_0x79d5('0x22')]);_0x4154e5[_0x79d5('0x38')]=qs[_0x79d5('0x38')](_0x2ad948[_0x79d5('0x2d')]['offset']);}_0x4154e5[_0x79d5('0x39')]=qs['sort'](_0x2ad948['query'][_0x79d5('0x3a')]);_0x4154e5[_0x79d5('0x3b')]=qs[_0x79d5('0x30')](_[_0x79d5('0x3c')](_0x2ad948[_0x79d5('0x2d')],_0x58d9b[_0x79d5('0x30')]));if(_0x7a7332[_0x79d5('0x2e')]){if(_0x7a7332[_0x79d5('0x2f')]){_0x7a7332[_0x79d5('0x2f')]=moment(_0x7a7332['dateEnd'])['add'](0x1,_0x79d5('0x3d'));}else{_0x7a7332[_0x79d5('0x2f')]=moment(_0x7a7332[_0x79d5('0x2e')])[_0x79d5('0x3e')](0x1,_0x79d5('0x3d'));}_['merge'](_0x4154e5[_0x79d5('0x3b')],{'createdAt':{'$gte':_0x7a7332[_0x79d5('0x2e')],'$lte':_0x7a7332['dateEnd']}});}if(_0x2ad948[_0x79d5('0x2d')][_0x79d5('0x3f')]){_0x4154e5[_0x79d5('0x3b')]=_['merge'](_0x4154e5[_0x79d5('0x3b')],{'$or':_[_0x79d5('0x40')](_0x124f2a,function(_0xfdb320){if(_0xfdb320[_0x79d5('0x41')][_0x79d5('0x42')]!==_0x79d5('0x43')){var _0x54b96a={};_0x54b96a[_0xfdb320[_0x79d5('0x44')]]={'$like':'%'+_0x2ad948['query'][_0x79d5('0x3f')]+'%'};return _0x54b96a;}})});}_0x4154e5=_[_0x79d5('0x45')]({},_0x4154e5,_0x2ad948['options']);var _0x4326c5={'where':_0x4154e5[_0x79d5('0x3b')]};return db['FreshdeskAccount'][_0x79d5('0x21')](_0x4326c5)[_0x79d5('0x14')](function(_0x7a5c46){_0x4e97f9[_0x79d5('0x21')]=_0x7a5c46;if(_0x2ad948[_0x79d5('0x2d')][_0x79d5('0x46')]){_0x4154e5[_0x79d5('0x47')]=[{'all':!![]}];}return db[_0x79d5('0x48')][_0x79d5('0x49')](_0x4154e5);})['then'](function(_0x52cde7){_0x4e97f9[_0x79d5('0x4a')]=_0x52cde7;return _0x4e97f9;})[_0x79d5('0x14')](respondWithFilteredResult(_0x48b384,_0x4154e5))['catch'](handleError(_0x48b384,null));};exports['show']=function(_0x319d28,_0xf01fce){var _0xd4511a={'raw':![],'where':{'id':_0x319d28['params']['id']}},_0x409090={};_0x409090[_0x79d5('0x32')]=_[_0x79d5('0x2c')](db[_0x79d5('0x48')][_0x79d5('0x4b')]);_0x409090[_0x79d5('0x2d')]=_[_0x79d5('0x2c')](_0x319d28[_0x79d5('0x2d')]);_0x409090['filters']=_[_0x79d5('0x31')](_0x409090['model'],_0x409090[_0x79d5('0x2d')]);_0xd4511a[_0x79d5('0x35')]=_[_0x79d5('0x31')](_0x409090[_0x79d5('0x32')],qs[_0x79d5('0x33')](_0x319d28[_0x79d5('0x2d')][_0x79d5('0x33')]));_0xd4511a[_0x79d5('0x35')]=_0xd4511a[_0x79d5('0x35')][_0x79d5('0x34')]?_0xd4511a[_0x79d5('0x35')]:_0x409090[_0x79d5('0x32')];if(_0x319d28[_0x79d5('0x2d')][_0x79d5('0x46')]){_0xd4511a[_0x79d5('0x47')]=[{'all':!![]}];}_0xd4511a=_[_0x79d5('0x45')]({},_0xd4511a,_0x319d28[_0x79d5('0x4c')]);return db['FreshdeskAccount']['find'](_0xd4511a)[_0x79d5('0x14')](handleEntityNotFound(_0xf01fce,null))[_0x79d5('0x14')](respondWithResult(_0xf01fce,null))[_0x79d5('0x1f')](handleError(_0xf01fce,null));};exports['create']=function(_0x53ee93,_0x3c305e){return db[_0x79d5('0x48')][_0x79d5('0x4d')](_0x53ee93[_0x79d5('0x4e')],{})[_0x79d5('0x14')](respondWithResult(_0x3c305e,0xc9))[_0x79d5('0x1f')](handleError(_0x3c305e,null));};exports['update']=function(_0x5f0f71,_0x997245){if(_0x5f0f71['body']['id']){delete _0x5f0f71[_0x79d5('0x4e')]['id'];}return db[_0x79d5('0x48')][_0x79d5('0x4f')]({'where':{'id':_0x5f0f71[_0x79d5('0x50')]['id']}})[_0x79d5('0x14')](handleEntityNotFound(_0x997245,null))[_0x79d5('0x14')](saveUpdates(_0x5f0f71[_0x79d5('0x4e')],null))[_0x79d5('0x14')](respondWithResult(_0x997245,null))[_0x79d5('0x1f')](handleError(_0x997245,null));};exports[_0x79d5('0x51')]=function(_0xd9bf6d,_0x418ad4){return db[_0x79d5('0x48')][_0x79d5('0x4f')]({'where':{'id':_0xd9bf6d[_0x79d5('0x50')]['id']}})[_0x79d5('0x14')](handleEntityNotFound(_0x418ad4,null))[_0x79d5('0x14')](removeEntity(_0x418ad4,null))['catch'](handleError(_0x418ad4,null));};exports['getConfigurations']=function(_0x2783bd,_0x21d867,_0xf9b557){var _0x29b15e={};var _0x3732d5={};var _0x5bb9cc;var _0x2d0c7b;return db[_0x79d5('0x48')]['findOne']({'where':{'id':_0x2783bd[_0x79d5('0x50')]['id']}})[_0x79d5('0x14')](handleEntityNotFound(_0x21d867,null))[_0x79d5('0x14')](function(_0x29e241){if(_0x29e241){_0x5bb9cc=_0x29e241;_0x3732d5[_0x79d5('0x32')]=_[_0x79d5('0x2c')](db[_0x79d5('0x52')][_0x79d5('0x4b')]);_0x3732d5['query']=_[_0x79d5('0x2c')](_0x2783bd[_0x79d5('0x2d')]);_0x3732d5[_0x79d5('0x30')]=_[_0x79d5('0x31')](_0x3732d5[_0x79d5('0x32')],_0x3732d5['query']);_0x29b15e['attributes']=_['intersection'](_0x3732d5[_0x79d5('0x32')],qs[_0x79d5('0x33')](_0x2783bd[_0x79d5('0x2d')]['fields']));_0x29b15e[_0x79d5('0x35')]=_0x29b15e['attributes']['length']?_0x29b15e[_0x79d5('0x35')]:_0x3732d5[_0x79d5('0x32')];_0x29b15e[_0x79d5('0x39')]=qs[_0x79d5('0x3a')](_0x2783bd[_0x79d5('0x2d')][_0x79d5('0x3a')]);_0x29b15e[_0x79d5('0x3b')]=qs['filters'](_[_0x79d5('0x3c')](_0x2783bd[_0x79d5('0x2d')],_0x3732d5[_0x79d5('0x30')]));if(_0x2783bd[_0x79d5('0x2d')]['filter']){_0x29b15e[_0x79d5('0x3b')]=_[_0x79d5('0x45')](_0x29b15e[_0x79d5('0x3b')],{'$or':_[_0x79d5('0x40')](_0x29b15e[_0x79d5('0x35')],function(_0x276ca7){var _0x8e1f31={};_0x8e1f31[_0x276ca7]={'$like':'%'+_0x2783bd[_0x79d5('0x2d')]['filter']+'%'};return _0x8e1f31;})});}_0x29b15e=_[_0x79d5('0x45')]({},_0x29b15e,_0x2783bd[_0x79d5('0x4c')]);return _0x5bb9cc[_0x79d5('0x53')](_0x29b15e);}})[_0x79d5('0x14')](function(_0x482e29){if(_0x482e29){_0x2d0c7b=_0x482e29[_0x79d5('0x34')];if(!_0x2783bd[_0x79d5('0x2d')]['hasOwnProperty']('nolimit')){_0x29b15e['limit']=qs['limit'](_0x2783bd['query'][_0x79d5('0x22')]);_0x29b15e[_0x79d5('0x38')]=qs[_0x79d5('0x38')](_0x2783bd['query'][_0x79d5('0x38')]);}return _0x5bb9cc['getConfigurations'](_0x29b15e);}})[_0x79d5('0x14')](function(_0x127ab5){if(_0x127ab5){return _0x127ab5?{'count':_0x2d0c7b,'rows':_0x127ab5}:null;}})[_0x79d5('0x14')](respondWithResult(_0x21d867,null))[_0x79d5('0x1f')](handleError(_0x21d867,null));};exports['addConfiguration']=function(_0x2131ca,_0x5256ca,_0x4ae3e3){if(_0x2131ca[_0x79d5('0x4e')]['id']){delete _0x2131ca[_0x79d5('0x4e')]['id'];}return db[_0x79d5('0x48')]['findOne']({'where':{'id':_0x2131ca[_0x79d5('0x50')]['id']}})[_0x79d5('0x14')](handleEntityNotFound(_0x5256ca,null))[_0x79d5('0x14')](function(_0x3ac67b){if(_0x3ac67b){_0x2131ca['body'][_0x79d5('0x54')]=_0x3ac67b['id'];_0x2131ca[_0x79d5('0x4e')][_0x79d5('0x55')]=integrations[_0x79d5('0x56')](_0x2131ca[_0x79d5('0x4e')][_0x79d5('0x57')],_0x2131ca[_0x79d5('0x4e')][_0x79d5('0x41')]);_0x2131ca['body'][_0x79d5('0x58')]=integrations[_0x79d5('0x59')](_0x2131ca[_0x79d5('0x4e')][_0x79d5('0x57')],_0x2131ca[_0x79d5('0x4e')][_0x79d5('0x41')]);return db['FreshdeskConfiguration'][_0x79d5('0x4d')](_0x2131ca[_0x79d5('0x4e')],{'include':[{'model':db[_0x79d5('0x5a')],'as':_0x79d5('0x55')},{'model':db[_0x79d5('0x5a')],'as':'Descriptions'}]});}return null;})[_0x79d5('0x14')](respondWithResult(_0x5256ca,null))[_0x79d5('0x1f')](handleError(_0x5256ca,null));};exports[_0x79d5('0x5b')]=function(_0xa287e2,_0x4fe8fb,_0x1e31dd){return db[_0x79d5('0x48')][_0x79d5('0x5c')]({'where':{'id':_0xa287e2[_0x79d5('0x50')]['id']},'attributes':['id',_0x79d5('0x5d'),_0x79d5('0x5e')]})[_0x79d5('0x14')](handleEntityNotFound(_0x4fe8fb,null))['then'](function(_0x587a78){if(_0x587a78){return rp({'method':_0x79d5('0x5f'),'uri':util[_0x79d5('0x60')](_0x79d5('0x61'),_0x587a78[_0x79d5('0x5d')],_0x79d5('0x62')),'headers':{'Authorization':util[_0x79d5('0x60')](_0x79d5('0x63'),new Buffer(util[_0x79d5('0x60')](_0x79d5('0x64'),_0x587a78[_0x79d5('0x5e')]))[_0x79d5('0x65')]('base64'))},'json':!![]});}})[_0x79d5('0x14')](function(_0x41ce3d){if(_0x41ce3d){var _0x2e64c5=[_0x79d5('0x66'),'subject',_0x79d5('0x67'),'description',_0x79d5('0x20'),'priority','group',_0x79d5('0x68'),'ticket_type',_0x79d5('0x69'),_0x79d5('0x6a')];_['remove'](_0x41ce3d,function(_0x2f89b4){return _0x2e64c5[_0x79d5('0x6b')](_0x2f89b4[_0x79d5('0x2a')])||!_0x2f89b4[_0x79d5('0x6c')]&&_0x2f89b4[_0x79d5('0x41')]!==_0x79d5('0x6d');});return{'count':_0x41ce3d[_0x79d5('0x34')],'rows':_[_0x79d5('0x40')](_0x41ce3d,function(_0x50e3ef){return{'id':_0x50e3ef[_0x79d5('0x2a')],'name':_0x50e3ef[_0x79d5('0x6e')],'custom':!_0x50e3ef[_0x79d5('0x6c')],'options':_0x50e3ef[_0x79d5('0x6f')]?_[_0x79d5('0x40')](_0x50e3ef[_0x79d5('0x6f')],function(_0x36953e){return{'name':_[_0x79d5('0x70')](_0x36953e),'value':_0x36953e};}):[]};})};}})[_0x79d5('0x14')](respondWithResult(_0x4fe8fb,null))['catch'](function(_0x43cc8f){var _0x358225=_0xa287e2[_0x79d5('0x2d')]['test']?0x1f4:_0x43cc8f[_0x79d5('0x71')]||0x1f4;logger[_0x79d5('0x1b')](_0x79d5('0x72'),_0x79d5('0x5b'),_0x358225,JSON[_0x79d5('0x1a')](_0x43cc8f));delete _0x43cc8f[_0x79d5('0x2a')];if(_0x358225===0x191){_0x358225=0x190;}_0x4fe8fb['status'](_0x358225)[_0x79d5('0x2b')](_0xa287e2['query'][_0x79d5('0x73')]?{'message':_0x79d5('0x74'),'statusCode':_0x43cc8f[_0x79d5('0x71')]}:_0x43cc8f);});};
\ No newline at end of file
+var _0x5afd=['getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','GET','format','%s%s','Basic\x20%s','%s:X','apiKey','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','add','day','merge','where','filter','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','Subjects'];(function(_0x55d860,_0x539abe){var _0x445e48=function(_0xe40711){while(--_0xe40711){_0x55d860['push'](_0x55d860['shift']());}};_0x445e48(++_0x539abe);}(_0x5afd,0xa6));var _0xd5af=function(_0x3a1e51,_0x3e39dc){_0x3a1e51=_0x3a1e51-0x0;var _0x2bb781=_0x5afd[_0x3a1e51];return _0x2bb781;};'use strict';var pdf=require(_0xd5af('0x0'));var emlformat=require(_0xd5af('0x1'));var rimraf=require(_0xd5af('0x2'));var zipdir=require(_0xd5af('0x3'));var jsonpatch=require(_0xd5af('0x4'));var rp=require(_0xd5af('0x5'));var moment=require(_0xd5af('0x6'));var BPromise=require(_0xd5af('0x7'));var Mustache=require(_0xd5af('0x8'));var util=require(_0xd5af('0x9'));var path=require(_0xd5af('0xa'));var sox=require(_0xd5af('0xb'));var csv=require('to-csv');var ejs=require(_0xd5af('0xc'));var fs=require('fs');var _=require(_0xd5af('0xd'));var squel=require(_0xd5af('0xe'));var crypto=require(_0xd5af('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd5af('0x10'));var toCsv=require(_0xd5af('0x11'));var querystring=require(_0xd5af('0x12'));var Papa=require(_0xd5af('0x13'));var Redis=require(_0xd5af('0x14'));var qs=require(_0xd5af('0x15'));var logger=require('../../config/logger')(_0xd5af('0x16'));var utils=require('../../config/utils');var config=require(_0xd5af('0x17'));var db=require(_0xd5af('0x18'))['db'];var integrations=require(_0xd5af('0x19'));var jayson=require(_0xd5af('0x1a'));var client=jayson[_0xd5af('0x1b')][_0xd5af('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x442b0d,_0x557963,_0x1b26bf,_0x5c15a4){return new BPromise(function(_0x1ea3cf,_0x26d606){var _0x339519=_0x5c15a4||client;return _0x339519[_0xd5af('0x1d')](_0x442b0d,_0x1b26bf)[_0xd5af('0x1e')](function(_0x3c191e){logger[_0xd5af('0x1f')](_0xd5af('0x20'),_0x557963,_0xd5af('0x21'));logger[_0xd5af('0x22')](_0xd5af('0x23'),_0x557963,_0xd5af('0x21'),JSON['stringify'](_0x3c191e));if(_0x3c191e[_0xd5af('0x24')]){if(_0x3c191e[_0xd5af('0x24')][_0xd5af('0x25')]===0x1f4){logger['error'](_0xd5af('0x20'),_0x557963,_0x3c191e[_0xd5af('0x24')][_0xd5af('0x26')]);return _0x26d606(_0x3c191e[_0xd5af('0x24')][_0xd5af('0x26')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x557963,_0x3c191e[_0xd5af('0x24')][_0xd5af('0x26')]);return _0x1ea3cf(_0x3c191e['error'][_0xd5af('0x26')]);}else{logger[_0xd5af('0x1f')](_0xd5af('0x20'),_0x557963,'request\x20sent');_0x1ea3cf(_0x3c191e[_0xd5af('0x27')][_0xd5af('0x26')]);}})[_0xd5af('0x28')](function(_0x5e83e2){logger[_0xd5af('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x557963,_0x5e83e2);_0x26d606(_0x5e83e2);});});}function respondWithStatusCode(_0x3d013a,_0x414d1f){_0x414d1f=_0x414d1f||0xcc;return function(_0x135522){if(_0x135522){return _0x3d013a[_0xd5af('0x29')](_0x414d1f);}return _0x3d013a[_0xd5af('0x2a')](_0x414d1f)['end']();};}function respondWithResult(_0x4e0eef,_0x20390a){_0x20390a=_0x20390a||0xc8;return function(_0x3d1912){if(_0x3d1912){return _0x4e0eef[_0xd5af('0x2a')](_0x20390a)[_0xd5af('0x2b')](_0x3d1912);}};}function respondWithFilteredResult(_0x2f0a92,_0x2d40b5){return function(_0x22160a){if(_0x22160a){var _0x87a338=_0x22160a[_0xd5af('0x2c')],_0x5c6e5f=_0x2d40b5[_0xd5af('0x2d')],_0x5ea60c=_0x2d40b5[_0xd5af('0x2d')]+_0x2d40b5[_0xd5af('0x2e')],_0x5eea3f;if(_0x5ea60c>=_0x87a338){_0x5ea60c=_0x87a338;_0x5eea3f=0xc8;}else{_0x5eea3f=0xce;}_0x2f0a92[_0xd5af('0x2a')](_0x5eea3f);return _0x2f0a92[_0xd5af('0x2f')](_0xd5af('0x30'),_0x5c6e5f+'-'+_0x5ea60c+'/'+_0x87a338)[_0xd5af('0x2b')](_0x22160a);}return null;};}function patchUpdates(_0x439827){return function(_0x2f8153){try{jsonpatch[_0xd5af('0x31')](_0x2f8153,_0x439827,!![]);}catch(_0x20d9bc){return BPromise[_0xd5af('0x32')](_0x20d9bc);}return _0x2f8153[_0xd5af('0x33')]();};}function saveUpdates(_0x502de1,_0x4231e2){return function(_0x4672dc){if(_0x4672dc){return _0x4672dc[_0xd5af('0x34')](_0x502de1)['then'](function(_0x4eadee){return _0x4eadee;});}return null;};}function removeEntity(_0x56fc74,_0x531bec){return function(_0x33eb27){if(_0x33eb27){return _0x33eb27[_0xd5af('0x35')]()[_0xd5af('0x1e')](function(){_0x56fc74[_0xd5af('0x2a')](0xcc)[_0xd5af('0x36')]();});}};}function handleEntityNotFound(_0x597fe2,_0x3df0c1){return function(_0x44388a){if(!_0x44388a){_0x597fe2[_0xd5af('0x29')](0x194);}return _0x44388a;};}function handleError(_0x5cb6a4,_0x16b1da){_0x16b1da=_0x16b1da||0x1f4;return function(_0x5ea1e0){logger[_0xd5af('0x24')](_0x5ea1e0[_0xd5af('0x37')]);if(_0x5ea1e0[_0xd5af('0x38')]){delete _0x5ea1e0[_0xd5af('0x38')];}_0x5cb6a4[_0xd5af('0x2a')](_0x16b1da)[_0xd5af('0x39')](_0x5ea1e0);};}exports[_0xd5af('0x3a')]=function(_0xa9a309,_0x213894){var _0x37edbd={},_0x5dc17f={},_0xf34afb={'count':0x0,'rows':[]};var _0x4f88c1=db[_0xd5af('0x3b')][_0xd5af('0x3c')];_0x5dc17f[_0xd5af('0x3d')]=_[_0xd5af('0x3e')](_0x4f88c1);var _0x21c1f1={'dateStart':_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x40')],'dateEnd':_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x41')]};delete _0xa9a309[_0xd5af('0x3f')][_0xd5af('0x40')];delete _0xa9a309[_0xd5af('0x3f')][_0xd5af('0x41')];_0x5dc17f[_0xd5af('0x3f')]=_[_0xd5af('0x3e')](_0xa9a309[_0xd5af('0x3f')]);_0x5dc17f[_0xd5af('0x42')]=_[_0xd5af('0x43')](_0x5dc17f['model'],_0x5dc17f[_0xd5af('0x3f')]);_0x37edbd[_0xd5af('0x44')]=_[_0xd5af('0x43')](_0x5dc17f[_0xd5af('0x3d')],qs['fields'](_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x45')]));_0x37edbd['attributes']=_0x37edbd['attributes'][_0xd5af('0x46')]?_0x37edbd[_0xd5af('0x44')]:_0x5dc17f['model'];if(!_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x47')]('nolimit')){_0x37edbd['limit']=qs['limit'](_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x2e')]);_0x37edbd[_0xd5af('0x2d')]=qs[_0xd5af('0x2d')](_0xa9a309[_0xd5af('0x3f')]['offset']);}_0x37edbd[_0xd5af('0x48')]=qs['sort'](_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x49')]);_0x37edbd['where']=qs['filters'](_[_0xd5af('0x4a')](_0xa9a309['query'],_0x5dc17f[_0xd5af('0x42')]));if(_0x21c1f1[_0xd5af('0x40')]){if(_0x21c1f1[_0xd5af('0x41')]){_0x21c1f1[_0xd5af('0x41')]=moment(_0x21c1f1[_0xd5af('0x41')])[_0xd5af('0x4b')](0x1,'day');}else{_0x21c1f1[_0xd5af('0x41')]=moment(_0x21c1f1[_0xd5af('0x40')])[_0xd5af('0x4b')](0x1,_0xd5af('0x4c'));}_[_0xd5af('0x4d')](_0x37edbd[_0xd5af('0x4e')],{'createdAt':{'$gte':_0x21c1f1[_0xd5af('0x40')],'$lte':_0x21c1f1['dateEnd']}});}if(_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x4f')]){_0x37edbd[_0xd5af('0x4e')]=_[_0xd5af('0x4d')](_0x37edbd['where'],{'$or':_[_0xd5af('0x50')](_0x4f88c1,function(_0x18cfb0){if(_0x18cfb0[_0xd5af('0x51')]['key']!==_0xd5af('0x52')){var _0x16054d={};_0x16054d[_0x18cfb0[_0xd5af('0x53')]]={'$like':'%'+_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x4f')]+'%'};return _0x16054d;}})});}_0x37edbd=_[_0xd5af('0x4d')]({},_0x37edbd,_0xa9a309[_0xd5af('0x54')]);var _0x7ae846={'where':_0x37edbd['where']};return db['FreshdeskAccount'][_0xd5af('0x2c')](_0x7ae846)[_0xd5af('0x1e')](function(_0x593641){_0xf34afb[_0xd5af('0x2c')]=_0x593641;if(_0xa9a309[_0xd5af('0x3f')][_0xd5af('0x55')]){_0x37edbd[_0xd5af('0x56')]=[{'all':!![]}];}return db[_0xd5af('0x3b')][_0xd5af('0x57')](_0x37edbd);})['then'](function(_0x5b692e){_0xf34afb[_0xd5af('0x58')]=_0x5b692e;return _0xf34afb;})[_0xd5af('0x1e')](respondWithFilteredResult(_0x213894,_0x37edbd))[_0xd5af('0x28')](handleError(_0x213894,null));};exports[_0xd5af('0x59')]=function(_0x424251,_0x4c507d){var _0x92dc85={'raw':![],'where':{'id':_0x424251[_0xd5af('0x5a')]['id']}},_0x343bf7={};_0x343bf7[_0xd5af('0x3d')]=_[_0xd5af('0x3e')](db[_0xd5af('0x3b')][_0xd5af('0x3c')]);_0x343bf7[_0xd5af('0x3f')]=_[_0xd5af('0x3e')](_0x424251[_0xd5af('0x3f')]);_0x343bf7['filters']=_[_0xd5af('0x43')](_0x343bf7[_0xd5af('0x3d')],_0x343bf7[_0xd5af('0x3f')]);_0x92dc85[_0xd5af('0x44')]=_['intersection'](_0x343bf7[_0xd5af('0x3d')],qs['fields'](_0x424251['query'][_0xd5af('0x45')]));_0x92dc85[_0xd5af('0x44')]=_0x92dc85[_0xd5af('0x44')][_0xd5af('0x46')]?_0x92dc85[_0xd5af('0x44')]:_0x343bf7[_0xd5af('0x3d')];if(_0x424251[_0xd5af('0x3f')][_0xd5af('0x55')]){_0x92dc85['include']=[{'all':!![]}];}_0x92dc85=_['merge']({},_0x92dc85,_0x424251[_0xd5af('0x54')]);return db[_0xd5af('0x3b')][_0xd5af('0x5b')](_0x92dc85)[_0xd5af('0x1e')](handleEntityNotFound(_0x4c507d,null))[_0xd5af('0x1e')](respondWithResult(_0x4c507d,null))['catch'](handleError(_0x4c507d,null));};exports[_0xd5af('0x5c')]=function(_0x2457da,_0x5eda28){return db['FreshdeskAccount'][_0xd5af('0x5c')](_0x2457da['body'],{})[_0xd5af('0x1e')](respondWithResult(_0x5eda28,0xc9))['catch'](handleError(_0x5eda28,null));};exports[_0xd5af('0x34')]=function(_0x5a74f8,_0x24e98f){if(_0x5a74f8[_0xd5af('0x5d')]['id']){delete _0x5a74f8[_0xd5af('0x5d')]['id'];}return db[_0xd5af('0x3b')][_0xd5af('0x5b')]({'where':{'id':_0x5a74f8[_0xd5af('0x5a')]['id']}})[_0xd5af('0x1e')](handleEntityNotFound(_0x24e98f,null))[_0xd5af('0x1e')](saveUpdates(_0x5a74f8[_0xd5af('0x5d')],null))[_0xd5af('0x1e')](respondWithResult(_0x24e98f,null))[_0xd5af('0x28')](handleError(_0x24e98f,null));};exports['destroy']=function(_0x532f02,_0x6efd6a){return db['FreshdeskAccount'][_0xd5af('0x5b')]({'where':{'id':_0x532f02[_0xd5af('0x5a')]['id']}})[_0xd5af('0x1e')](handleEntityNotFound(_0x6efd6a,null))[_0xd5af('0x1e')](removeEntity(_0x6efd6a,null))[_0xd5af('0x28')](handleError(_0x6efd6a,null));};exports[_0xd5af('0x5e')]=function(_0x200b30,_0x4c1746,_0x5264ca){var _0x5358f5={};var _0x59c53a={};var _0x4bbf49;var _0x23dbf4;return db[_0xd5af('0x3b')][_0xd5af('0x5f')]({'where':{'id':_0x200b30[_0xd5af('0x5a')]['id']}})[_0xd5af('0x1e')](handleEntityNotFound(_0x4c1746,null))[_0xd5af('0x1e')](function(_0x365c4c){if(_0x365c4c){_0x4bbf49=_0x365c4c;_0x59c53a[_0xd5af('0x3d')]=_['keys'](db[_0xd5af('0x60')][_0xd5af('0x3c')]);_0x59c53a[_0xd5af('0x3f')]=_[_0xd5af('0x3e')](_0x200b30['query']);_0x59c53a['filters']=_['intersection'](_0x59c53a[_0xd5af('0x3d')],_0x59c53a[_0xd5af('0x3f')]);_0x5358f5[_0xd5af('0x44')]=_['intersection'](_0x59c53a[_0xd5af('0x3d')],qs[_0xd5af('0x45')](_0x200b30[_0xd5af('0x3f')]['fields']));_0x5358f5['attributes']=_0x5358f5[_0xd5af('0x44')][_0xd5af('0x46')]?_0x5358f5[_0xd5af('0x44')]:_0x59c53a[_0xd5af('0x3d')];_0x5358f5[_0xd5af('0x48')]=qs['sort'](_0x200b30['query']['sort']);_0x5358f5[_0xd5af('0x4e')]=qs[_0xd5af('0x42')](_[_0xd5af('0x4a')](_0x200b30[_0xd5af('0x3f')],_0x59c53a[_0xd5af('0x42')]));if(_0x200b30[_0xd5af('0x3f')][_0xd5af('0x4f')]){_0x5358f5[_0xd5af('0x4e')]=_['merge'](_0x5358f5['where'],{'$or':_[_0xd5af('0x50')](_0x5358f5['attributes'],function(_0x571b59){var _0x28e2d4={};_0x28e2d4[_0x571b59]={'$like':'%'+_0x200b30[_0xd5af('0x3f')][_0xd5af('0x4f')]+'%'};return _0x28e2d4;})});}_0x5358f5=_['merge']({},_0x5358f5,_0x200b30[_0xd5af('0x54')]);return _0x4bbf49[_0xd5af('0x5e')](_0x5358f5);}})['then'](function(_0x254574){if(_0x254574){_0x23dbf4=_0x254574[_0xd5af('0x46')];if(!_0x200b30['query'][_0xd5af('0x47')](_0xd5af('0x61'))){_0x5358f5[_0xd5af('0x2e')]=qs[_0xd5af('0x2e')](_0x200b30['query'][_0xd5af('0x2e')]);_0x5358f5[_0xd5af('0x2d')]=qs[_0xd5af('0x2d')](_0x200b30[_0xd5af('0x3f')][_0xd5af('0x2d')]);}return _0x4bbf49[_0xd5af('0x5e')](_0x5358f5);}})[_0xd5af('0x1e')](function(_0x3ff3a9){if(_0x3ff3a9){return _0x3ff3a9?{'count':_0x23dbf4,'rows':_0x3ff3a9}:null;}})['then'](respondWithResult(_0x4c1746,null))['catch'](handleError(_0x4c1746,null));};exports[_0xd5af('0x62')]=function(_0xfc0567,_0x2e9203,_0x398604){if(_0xfc0567[_0xd5af('0x5d')]['id']){delete _0xfc0567[_0xd5af('0x5d')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0xfc0567[_0xd5af('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2e9203,null))[_0xd5af('0x1e')](function(_0x12658c){if(_0x12658c){_0xfc0567['body']['AccountId']=_0x12658c['id'];_0xfc0567[_0xd5af('0x5d')][_0xd5af('0x63')]=integrations[_0xd5af('0x64')](_0xfc0567[_0xd5af('0x5d')][_0xd5af('0x65')],_0xfc0567[_0xd5af('0x5d')][_0xd5af('0x51')]);_0xfc0567['body']['Descriptions']=integrations[_0xd5af('0x66')](_0xfc0567[_0xd5af('0x5d')][_0xd5af('0x65')],_0xfc0567['body'][_0xd5af('0x51')]);return db['FreshdeskConfiguration'][_0xd5af('0x5c')](_0xfc0567['body'],{'include':[{'model':db[_0xd5af('0x67')],'as':'Subjects'},{'model':db[_0xd5af('0x67')],'as':_0xd5af('0x68')}]});}return null;})[_0xd5af('0x1e')](respondWithResult(_0x2e9203,null))[_0xd5af('0x28')](handleError(_0x2e9203,null));};exports[_0xd5af('0x69')]=function(_0x51bba8,_0x51144a,_0x4b615c){return db[_0xd5af('0x3b')][_0xd5af('0x5f')]({'where':{'id':_0x51bba8[_0xd5af('0x5a')]['id']},'attributes':['id',_0xd5af('0x6a'),'apiKey']})[_0xd5af('0x1e')](handleEntityNotFound(_0x51144a,null))['then'](function(_0x28cb90){if(_0x28cb90){return rp({'method':_0xd5af('0x6b'),'uri':util[_0xd5af('0x6c')](_0xd5af('0x6d'),_0x28cb90['remoteUri'],'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0xd5af('0x6e'),new Buffer(util[_0xd5af('0x6c')](_0xd5af('0x6f'),_0x28cb90[_0xd5af('0x70')]))['toString']('base64'))},'json':!![]});}})[_0xd5af('0x1e')](function(_0x31ee17){if(_0x31ee17){var _0x310939=[_0xd5af('0x71'),_0xd5af('0x72'),_0xd5af('0x73'),_0xd5af('0x74'),'status',_0xd5af('0x75'),_0xd5af('0x76'),_0xd5af('0x77'),_0xd5af('0x78'),_0xd5af('0x76'),_0xd5af('0x79')];_[_0xd5af('0x7a')](_0x31ee17,function(_0x3f202b){return _0x310939[_0xd5af('0x7b')](_0x3f202b['name'])||!_0x3f202b[_0xd5af('0x7c')]&&_0x3f202b[_0xd5af('0x51')]!==_0xd5af('0x7d');});return{'count':_0x31ee17[_0xd5af('0x46')],'rows':_[_0xd5af('0x50')](_0x31ee17,function(_0x3f35ca){return{'id':_0x3f35ca['name'],'name':_0x3f35ca['label'],'custom':!_0x3f35ca[_0xd5af('0x7c')],'options':_0x3f35ca['choices']?_[_0xd5af('0x50')](_0x3f35ca[_0xd5af('0x7e')],function(_0x362c21){return{'name':_[_0xd5af('0x7f')](_0x362c21),'value':_0x362c21};}):[]};})};}})[_0xd5af('0x1e')](respondWithResult(_0x51144a,null))[_0xd5af('0x28')](function(_0x993beb){var _0x581c98=_0x51bba8[_0xd5af('0x3f')][_0xd5af('0x80')]?0x1f4:_0x993beb[_0xd5af('0x81')]||0x1f4;logger[_0xd5af('0x24')](_0xd5af('0x82'),'getFields',_0x581c98,JSON[_0xd5af('0x83')](_0x993beb));delete _0x993beb[_0xd5af('0x38')];if(_0x581c98===0x191){_0x581c98=0x190;}_0x51144a[_0xd5af('0x2a')](_0x581c98)[_0xd5af('0x39')](_0x51bba8[_0xd5af('0x3f')]['test']?{'message':_0xd5af('0x84'),'statusCode':_0x993beb[_0xd5af('0x81')]}:_0x993beb);});};
\ No newline at end of file
index f18be9b..4188c6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc423=['../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','./intFreshdeskAccount.attributes'];(function(_0x3b88d1,_0x22075b){var _0x393ed5=function(_0x4ab3eb){while(--_0x4ab3eb){_0x3b88d1['push'](_0x3b88d1['shift']());}};_0x393ed5(++_0x22075b);}(_0xc423,0x159));var _0x3c42=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc423[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x3c42('0x0'));var util=require(_0x3c42('0x1'));var logger=require(_0x3c42('0x2'))(_0x3c42('0x3'));var moment=require(_0x3c42('0x4'));var BPromise=require('bluebird');var rp=require(_0x3c42('0x5'));var attributes=require(_0x3c42('0x6'));var integrations=require(_0x3c42('0x7'));module['exports']=function(_0x2078b8,_0x15c741){return _0x2078b8[_0x3c42('0x8')](_0x3c42('0x9'),attributes,{'tableName':_0x3c42('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d51=['util','moment','request-promise','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash'];(function(_0x499354,_0x564a00){var _0x2dd14e=function(_0x46e7f9){while(--_0x46e7f9){_0x499354['push'](_0x499354['shift']());}};_0x2dd14e(++_0x564a00);}(_0x7d51,0x1e9));var _0x17d5=function(_0x9b8d7,_0x1a7fc8){_0x9b8d7=_0x9b8d7-0x0;var _0x11a35d=_0x7d51[_0x9b8d7];return _0x11a35d;};'use strict';var _=require(_0x17d5('0x0'));var util=require(_0x17d5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x17d5('0x2'));var BPromise=require('bluebird');var rp=require(_0x17d5('0x3'));var attributes=require(_0x17d5('0x4'));var integrations=require(_0x17d5('0x5'));module[_0x17d5('0x6')]=function(_0x5a7716,_0x570a58){return _0x5a7716[_0x17d5('0x7')](_0x17d5('0x8'),attributes,{'tableName':_0x17d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 859631f..11b521c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42c5=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','catch','ShowFreshdeskAccount','find','raw','util'];(function(_0x19b358,_0x563684){var _0x24cf91=function(_0x291c1d){while(--_0x291c1d){_0x19b358['push'](_0x19b358['shift']());}};_0x24cf91(++_0x563684);}(_0x42c5,0x117));var _0x542c=function(_0x4a7f39,_0x2153bc){_0x4a7f39=_0x4a7f39-0x0;var _0x3a708e=_0x42c5[_0x4a7f39];return _0x3a708e;};'use strict';var _=require('lodash');var util=require(_0x542c('0x0'));var moment=require(_0x542c('0x1'));var BPromise=require(_0x542c('0x2'));var rs=require(_0x542c('0x3'));var fs=require('fs');var Redis=require(_0x542c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x542c('0x5'));var config=require(_0x542c('0x6'));var jayson=require(_0x542c('0x7'));var client=jayson[_0x542c('0x8')][_0x542c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5dddf8,_0x2a648c,_0x4d2427){return new BPromise(function(_0x30cf4f,_0x4636aa){return client[_0x542c('0xa')](_0x5dddf8,_0x4d2427)[_0x542c('0xb')](function(_0x5ab0b1){logger[_0x542c('0xc')](_0x542c('0xd'),_0x2a648c,_0x542c('0xe'));logger[_0x542c('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2a648c,_0x542c('0xe'),JSON[_0x542c('0x10')](_0x5ab0b1));if(_0x5ab0b1[_0x542c('0x11')]){if(_0x5ab0b1['error'][_0x542c('0x12')]===0x1f4){logger[_0x542c('0x11')](_0x542c('0xd'),_0x2a648c,_0x5ab0b1[_0x542c('0x11')][_0x542c('0x13')]);return _0x4636aa(_0x5ab0b1[_0x542c('0x11')]['message']);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x2a648c,_0x5ab0b1[_0x542c('0x11')]['message']);return _0x30cf4f(_0x5ab0b1[_0x542c('0x11')][_0x542c('0x13')]);}else{logger['info'](_0x542c('0xd'),_0x2a648c,_0x542c('0xe'));_0x30cf4f(_0x5ab0b1[_0x542c('0x14')]['message']);}})['catch'](function(_0x53e437){logger[_0x542c('0x11')](_0x542c('0xd'),_0x2a648c,_0x53e437);_0x4636aa(_0x53e437);});});}exports[_0x542c('0x15')]=function(_0x232b2c){var _0x3dc6a0=this;return new Promise(function(_0x55567a,_0x23cffb){return db[_0x542c('0x16')][_0x542c('0x17')]({'raw':_0x232b2c[_0x542c('0x18')]?_0x232b2c['options']['raw']===undefined?!![]:![]:!![],'where':_0x232b2c[_0x542c('0x18')]?_0x232b2c[_0x542c('0x18')][_0x542c('0x19')]||null:null,'attributes':_0x232b2c[_0x542c('0x18')]?_0x232b2c['options'][_0x542c('0x1a')]||null:null,'limit':_0x232b2c[_0x542c('0x18')]?_0x232b2c[_0x542c('0x18')][_0x542c('0x1b')]||null:null,'include':_0x232b2c['options']?_0x232b2c[_0x542c('0x18')][_0x542c('0x1c')]?_['map'](_0x232b2c[_0x542c('0x18')][_0x542c('0x1c')],function(_0x274fdb){return{'model':db[_0x274fdb['model']],'as':_0x274fdb['as'],'attributes':_0x274fdb[_0x542c('0x1a')],'include':_0x274fdb[_0x542c('0x1c')]?_[_0x542c('0x1d')](_0x274fdb[_0x542c('0x1c')],function(_0x230ff0){return{'model':db[_0x230ff0[_0x542c('0x1e')]],'as':_0x230ff0['as'],'attributes':_0x230ff0[_0x542c('0x1a')],'include':_0x230ff0['include']?_[_0x542c('0x1d')](_0x230ff0[_0x542c('0x1c')],function(_0x47a368){return{'model':db[_0x47a368[_0x542c('0x1e')]],'as':_0x47a368['as'],'attributes':_0x47a368[_0x542c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27f55b){logger[_0x542c('0xc')](_0x542c('0x15'),_0x232b2c);logger[_0x542c('0xf')](_0x542c('0x15'),_0x232b2c,JSON[_0x542c('0x10')](_0x27f55b));_0x55567a(_0x27f55b);})[_0x542c('0x1f')](function(_0x6263e1){logger['error'](_0x542c('0x15'),_0x6263e1[_0x542c('0x13')],_0x232b2c);_0x23cffb(_0x3dc6a0[_0x542c('0x11')](0x1f4,_0x6263e1[_0x542c('0x13')]));});});};exports[_0x542c('0x20')]=function(_0x393841){var _0xb88025=this;return new Promise(function(_0x36fd0f,_0x22002b){return db[_0x542c('0x16')][_0x542c('0x21')]({'raw':_0x393841[_0x542c('0x18')]?_0x393841[_0x542c('0x18')][_0x542c('0x22')]===undefined?!![]:![]:!![],'where':_0x393841['options']?_0x393841['options'][_0x542c('0x19')]||null:null,'attributes':_0x393841[_0x542c('0x18')]?_0x393841[_0x542c('0x18')][_0x542c('0x1a')]||null:null,'include':_0x393841[_0x542c('0x18')]?_0x393841[_0x542c('0x18')][_0x542c('0x1c')]?_[_0x542c('0x1d')](_0x393841[_0x542c('0x18')][_0x542c('0x1c')],function(_0xe3f1cd){return{'model':db[_0xe3f1cd[_0x542c('0x1e')]],'as':_0xe3f1cd['as'],'attributes':_0xe3f1cd['attributes'],'include':_0xe3f1cd[_0x542c('0x1c')]?_[_0x542c('0x1d')](_0xe3f1cd[_0x542c('0x1c')],function(_0x5ee5c5){return{'model':db[_0x5ee5c5[_0x542c('0x1e')]],'as':_0x5ee5c5['as'],'attributes':_0x5ee5c5[_0x542c('0x1a')],'include':_0x5ee5c5[_0x542c('0x1c')]?_[_0x542c('0x1d')](_0x5ee5c5[_0x542c('0x1c')],function(_0xbce31a){return{'model':db[_0xbce31a[_0x542c('0x1e')]],'as':_0xbce31a['as'],'attributes':_0xbce31a[_0x542c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b45ca){logger[_0x542c('0xc')](_0x542c('0x20'),_0x393841);logger['debug'](_0x542c('0x20'),_0x393841,JSON['stringify'](_0x1b45ca));_0x36fd0f(_0x1b45ca);})[_0x542c('0x1f')](function(_0x4a1a08){logger[_0x542c('0x11')]('ShowFreshdeskAccount',_0x4a1a08[_0x542c('0x13')],_0x393841);_0x22002b(_0xb88025[_0x542c('0x11')](0x1f4,_0x4a1a08['message']));});});};
\ No newline at end of file
+var _0xe8cd=['request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5e8766,_0x2dc43e){var _0x484b49=function(_0x18bc30){while(--_0x18bc30){_0x5e8766['push'](_0x5e8766['shift']());}};_0x484b49(++_0x2dc43e);}(_0xe8cd,0x1df));var _0xde8c=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0xe8cd[_0x32729c];return _0x482cfd;};'use strict';var _=require(_0xde8c('0x0'));var util=require(_0xde8c('0x1'));var moment=require(_0xde8c('0x2'));var BPromise=require(_0xde8c('0x3'));var rs=require(_0xde8c('0x4'));var fs=require('fs');var Redis=require(_0xde8c('0x5'));var db=require(_0xde8c('0x6'))['db'];var utils=require(_0xde8c('0x7'));var logger=require('../../config/logger')(_0xde8c('0x8'));var config=require(_0xde8c('0x9'));var jayson=require(_0xde8c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1cfdae,_0x556464,_0x5417b5){return new BPromise(function(_0x4b1184,_0x266b63){return client[_0xde8c('0xb')](_0x1cfdae,_0x5417b5)[_0xde8c('0xc')](function(_0x2ed091){logger[_0xde8c('0xd')](_0xde8c('0xe'),_0x556464,_0xde8c('0xf'));logger[_0xde8c('0x10')](_0xde8c('0x11'),_0x556464,_0xde8c('0xf'),JSON[_0xde8c('0x12')](_0x2ed091));if(_0x2ed091[_0xde8c('0x13')]){if(_0x2ed091['error'][_0xde8c('0x14')]===0x1f4){logger[_0xde8c('0x13')](_0xde8c('0xe'),_0x556464,_0x2ed091['error']['message']);return _0x266b63(_0x2ed091[_0xde8c('0x13')]['message']);}logger[_0xde8c('0x13')](_0xde8c('0xe'),_0x556464,_0x2ed091[_0xde8c('0x13')][_0xde8c('0x15')]);return _0x4b1184(_0x2ed091[_0xde8c('0x13')][_0xde8c('0x15')]);}else{logger[_0xde8c('0xd')](_0xde8c('0xe'),_0x556464,'request\x20sent');_0x4b1184(_0x2ed091[_0xde8c('0x16')][_0xde8c('0x15')]);}})[_0xde8c('0x17')](function(_0x1cdb4b){logger[_0xde8c('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x556464,_0x1cdb4b);_0x266b63(_0x1cdb4b);});});}exports['GetFreshdeskAccount']=function(_0x73c3e5){var _0x17f0ae=this;return new Promise(function(_0xfeaaa7,_0x2af034){return db[_0xde8c('0x18')]['findAll']({'raw':_0x73c3e5['options']?_0x73c3e5[_0xde8c('0x19')][_0xde8c('0x1a')]===undefined?!![]:![]:!![],'where':_0x73c3e5['options']?_0x73c3e5[_0xde8c('0x19')][_0xde8c('0x1b')]||null:null,'attributes':_0x73c3e5[_0xde8c('0x19')]?_0x73c3e5[_0xde8c('0x19')][_0xde8c('0x1c')]||null:null,'limit':_0x73c3e5[_0xde8c('0x19')]?_0x73c3e5[_0xde8c('0x19')][_0xde8c('0x1d')]||null:null,'include':_0x73c3e5['options']?_0x73c3e5[_0xde8c('0x19')][_0xde8c('0x1e')]?_[_0xde8c('0x1f')](_0x73c3e5[_0xde8c('0x19')][_0xde8c('0x1e')],function(_0xd6c7ef){return{'model':db[_0xd6c7ef['model']],'as':_0xd6c7ef['as'],'attributes':_0xd6c7ef['attributes'],'include':_0xd6c7ef['include']?_[_0xde8c('0x1f')](_0xd6c7ef[_0xde8c('0x1e')],function(_0x4ff92d){return{'model':db[_0x4ff92d['model']],'as':_0x4ff92d['as'],'attributes':_0x4ff92d[_0xde8c('0x1c')],'include':_0x4ff92d[_0xde8c('0x1e')]?_[_0xde8c('0x1f')](_0x4ff92d['include'],function(_0x1da1c1){return{'model':db[_0x1da1c1[_0xde8c('0x20')]],'as':_0x1da1c1['as'],'attributes':_0x1da1c1[_0xde8c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f276a){logger[_0xde8c('0xd')](_0xde8c('0x21'),_0x73c3e5);logger[_0xde8c('0x10')](_0xde8c('0x21'),_0x73c3e5,JSON[_0xde8c('0x12')](_0x1f276a));_0xfeaaa7(_0x1f276a);})['catch'](function(_0x55cb2a){logger[_0xde8c('0x13')](_0xde8c('0x21'),_0x55cb2a[_0xde8c('0x15')],_0x73c3e5);_0x2af034(_0x17f0ae[_0xde8c('0x13')](0x1f4,_0x55cb2a[_0xde8c('0x15')]));});});};exports[_0xde8c('0x22')]=function(_0x2a6ec9){var _0x29ae4a=this;return new Promise(function(_0x118cdc,_0x5d7e29){return db[_0xde8c('0x18')]['find']({'raw':_0x2a6ec9['options']?_0x2a6ec9[_0xde8c('0x19')][_0xde8c('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a6ec9[_0xde8c('0x19')]?_0x2a6ec9[_0xde8c('0x19')][_0xde8c('0x1b')]||null:null,'attributes':_0x2a6ec9[_0xde8c('0x19')]?_0x2a6ec9[_0xde8c('0x19')][_0xde8c('0x1c')]||null:null,'include':_0x2a6ec9[_0xde8c('0x19')]?_0x2a6ec9[_0xde8c('0x19')][_0xde8c('0x1e')]?_[_0xde8c('0x1f')](_0x2a6ec9['options'][_0xde8c('0x1e')],function(_0x204999){return{'model':db[_0x204999[_0xde8c('0x20')]],'as':_0x204999['as'],'attributes':_0x204999['attributes'],'include':_0x204999[_0xde8c('0x1e')]?_[_0xde8c('0x1f')](_0x204999[_0xde8c('0x1e')],function(_0x32fefb){return{'model':db[_0x32fefb[_0xde8c('0x20')]],'as':_0x32fefb['as'],'attributes':_0x32fefb[_0xde8c('0x1c')],'include':_0x32fefb[_0xde8c('0x1e')]?_[_0xde8c('0x1f')](_0x32fefb[_0xde8c('0x1e')],function(_0x469770){return{'model':db[_0x469770[_0xde8c('0x20')]],'as':_0x469770['as'],'attributes':_0x469770[_0xde8c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xde8c('0xc')](function(_0x352027){logger['info'](_0xde8c('0x22'),_0x2a6ec9);logger[_0xde8c('0x10')](_0xde8c('0x22'),_0x2a6ec9,JSON['stringify'](_0x352027));_0x118cdc(_0x352027);})[_0xde8c('0x17')](function(_0x26f760){logger[_0xde8c('0x13')](_0xde8c('0x22'),_0x26f760[_0xde8c('0x15')],_0x2a6ec9);_0x5d7e29(_0x29ae4a[_0xde8c('0x13')](0x1f4,_0x26f760[_0xde8c('0x15')]));});});};
\ No newline at end of file
index a63c86a..5f87f9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b5=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show','get','getFields'];(function(_0x29a598,_0x5cb984){var _0x2bbc2d=function(_0x2ae906){while(--_0x2ae906){_0x29a598['push'](_0x29a598['shift']());}};_0x2bbc2d(++_0x5cb984);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x314f10,_0x4e4704){_0x314f10=_0x314f10-0x0;var _0x5f130b=_0xc3b5[_0x314f10];return _0x5f130b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3b('0x0'));var timeout=require(_0x5c3b('0x1'));var express=require(_0x5c3b('0x2'));var router=express[_0x5c3b('0x3')]();var auth=require(_0x5c3b('0x4'));var interaction=require(_0x5c3b('0x5'));var config=require(_0x5c3b('0x6'));var controller=require(_0x5c3b('0x7'));router['get']('/',auth[_0x5c3b('0x8')](),controller[_0x5c3b('0x9')]);router['get'](_0x5c3b('0xa'),auth[_0x5c3b('0x8')](),controller[_0x5c3b('0xb')]);router[_0x5c3b('0xc')]('/:id/fields',auth[_0x5c3b('0x8')](),controller[_0x5c3b('0xd')]);router[_0x5c3b('0xc')](_0x5c3b('0xe'),auth['isAuthenticated'](),controller[_0x5c3b('0xf')]);router[_0x5c3b('0xc')](_0x5c3b('0x10'),auth[_0x5c3b('0x8')](),controller[_0x5c3b('0x11')]);router['get'](_0x5c3b('0x12'),auth[_0x5c3b('0x8')](),controller['getTags']);router[_0x5c3b('0x13')]('/',auth[_0x5c3b('0x8')](),controller['create']);router[_0x5c3b('0x13')](_0x5c3b('0x12'),auth[_0x5c3b('0x8')](),controller[_0x5c3b('0x14')]);router[_0x5c3b('0x15')](_0x5c3b('0xa'),auth[_0x5c3b('0x8')](),controller['update']);router[_0x5c3b('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5c3b('0x17')]);module[_0x5c3b('0x18')]=router;
\ No newline at end of file
+var _0x0c02=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','/:id/tags','getTags','setTags','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4b0099,_0xb94501){var _0x276c6c=function(_0x2f4656){while(--_0x2f4656){_0x4b0099['push'](_0x4b0099['shift']());}};_0x276c6c(++_0xb94501);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var auth=require(_0x20c0('0x4'));var interaction=require(_0x20c0('0x5'));var config=require(_0x20c0('0x6'));var controller=require(_0x20c0('0x7'));router[_0x20c0('0x8')]('/',auth[_0x20c0('0x9')](),controller[_0x20c0('0xa')]);router[_0x20c0('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x20c0('0xb'),auth[_0x20c0('0x9')](),controller[_0x20c0('0xc')]);router[_0x20c0('0x8')](_0x20c0('0xd'),auth[_0x20c0('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x20c0('0x8')](_0x20c0('0xe'),auth[_0x20c0('0x9')](),controller[_0x20c0('0xf')]);router['post']('/',auth[_0x20c0('0x9')](),controller['create']);router['post'](_0x20c0('0xe'),auth[_0x20c0('0x9')](),controller[_0x20c0('0x10')]);router[_0x20c0('0x11')](_0x20c0('0x12'),auth[_0x20c0('0x9')](),controller[_0x20c0('0x13')]);router[_0x20c0('0x14')](_0x20c0('0x12'),auth['isAuthenticated'](),controller[_0x20c0('0x15')]);module[_0x20c0('0x16')]=router;
\ No newline at end of file
index aad16cf..1a1cf47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38fb=['exports','STRING'];(function(_0x2ac42c,_0x400eff){var _0x29b7f3=function(_0x2f9606){while(--_0x2f9606){_0x2ac42c['push'](_0x2ac42c['shift']());}};_0x29b7f3(++_0x400eff);}(_0x38fb,0x16c));var _0xb38f=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0x38fb[_0x1559a5];return _0x17a783;};'use strict';var Sequelize=require('sequelize');module[_0xb38f('0x0')]={'name':{'type':Sequelize[_0xb38f('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x99df=['exports','STRING','sequelize'];(function(_0x2a5864,_0x2b9396){var _0x490ab6=function(_0x3bcd16){while(--_0x3bcd16){_0x2a5864['push'](_0x2a5864['shift']());}};_0x490ab6(++_0x2b9396);}(_0x99df,0x16a));var _0xf99d=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x99df[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0xf99d('0x0'));module[_0xf99d('0x1')]={'name':{'type':Sequelize[_0xf99d('0x2')]},'description':{'type':Sequelize[_0xf99d('0x2')]}};
\ No newline at end of file
index 1e346c6..8d67fc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['includeAll','include','rows','params','create','body','find','findOne','FreshdeskField','order','pick','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','FreshdeskConfiguration','rawAttributes','model','keys','dateStart','query','dateEnd','intersection','attributes','fields','length','hasOwnProperty','sort','filters','add','day','merge','where','map','type','key','VIRTUAL','field','filter','options','count'];(function(_0xa6a23e,_0x8b657a){var _0x210e65=function(_0x58b4b8){while(--_0x58b4b8){_0xa6a23e['push'](_0xa6a23e['shift']());}};_0x210e65(++_0x8b657a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4efa8c,_0x391c2a){_0x4efa8c=_0x4efa8c-0x0;var _0x1b786b=_0x5f2f[_0x4efa8c];return _0x1b786b;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var qs=require(_0xf5f2('0x12'));var logger=require('../../config/logger')(_0xf5f2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf5f2('0x14'))['db'];var jayson=require(_0xf5f2('0x15'));var client=jayson['client'][_0xf5f2('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x14b51f,_0x331482,_0x3f2997,_0x59bb6c){return new BPromise(function(_0x3e5956,_0x5c01b8){var _0x5850f4=_0x59bb6c||client;return _0x5850f4[_0xf5f2('0x17')](_0x14b51f,_0x3f2997)[_0xf5f2('0x18')](function(_0x1c1a5c){logger[_0xf5f2('0x19')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x331482,_0xf5f2('0x1a'));logger[_0xf5f2('0x1b')](_0xf5f2('0x1c'),_0x331482,_0xf5f2('0x1a'),JSON[_0xf5f2('0x1d')](_0x1c1a5c));if(_0x1c1a5c[_0xf5f2('0x1e')]){if(_0x1c1a5c[_0xf5f2('0x1e')][_0xf5f2('0x1f')]===0x1f4){logger[_0xf5f2('0x1e')](_0xf5f2('0x20'),_0x331482,_0x1c1a5c[_0xf5f2('0x1e')][_0xf5f2('0x21')]);return _0x5c01b8(_0x1c1a5c[_0xf5f2('0x1e')][_0xf5f2('0x21')]);}logger[_0xf5f2('0x1e')](_0xf5f2('0x20'),_0x331482,_0x1c1a5c[_0xf5f2('0x1e')]['message']);return _0x3e5956(_0x1c1a5c[_0xf5f2('0x1e')][_0xf5f2('0x21')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x331482,_0xf5f2('0x1a'));_0x3e5956(_0x1c1a5c[_0xf5f2('0x22')]['message']);}})[_0xf5f2('0x23')](function(_0x170042){logger[_0xf5f2('0x1e')](_0xf5f2('0x20'),_0x331482,_0x170042);_0x5c01b8(_0x170042);});});}function respondWithStatusCode(_0x36f1cb,_0x4c691a){_0x4c691a=_0x4c691a||0xcc;return function(_0x21cd91){if(_0x21cd91){return _0x36f1cb[_0xf5f2('0x24')](_0x4c691a);}return _0x36f1cb[_0xf5f2('0x25')](_0x4c691a)[_0xf5f2('0x26')]();};}function respondWithResult(_0x287ad5,_0x5bdf4a){_0x5bdf4a=_0x5bdf4a||0xc8;return function(_0x529f07){if(_0x529f07){return _0x287ad5[_0xf5f2('0x25')](_0x5bdf4a)[_0xf5f2('0x27')](_0x529f07);}};}function respondWithFilteredResult(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(_0xf6c58d){var _0x788a8d=_0xf6c58d['count'],_0x13a3be=_0x1a5bb3[_0xf5f2('0x28')],_0x281ec8=_0x1a5bb3[_0xf5f2('0x28')]+_0x1a5bb3[_0xf5f2('0x29')],_0x294414;if(_0x281ec8>=_0x788a8d){_0x281ec8=_0x788a8d;_0x294414=0xc8;}else{_0x294414=0xce;}_0x13da6f[_0xf5f2('0x25')](_0x294414);return _0x13da6f[_0xf5f2('0x2a')](_0xf5f2('0x2b'),_0x13a3be+'-'+_0x281ec8+'/'+_0x788a8d)['json'](_0xf6c58d);}return null;};}function patchUpdates(_0x53cb96){return function(_0x22c826){try{jsonpatch[_0xf5f2('0x2c')](_0x22c826,_0x53cb96,!![]);}catch(_0x11c771){return BPromise['reject'](_0x11c771);}return _0x22c826['save']();};}function saveUpdates(_0x29571b,_0x50b8a2){return function(_0x17394a){if(_0x17394a){return _0x17394a[_0xf5f2('0x2d')](_0x29571b)[_0xf5f2('0x18')](function(_0x54c0c8){return _0x54c0c8;});}return null;};}function removeEntity(_0x52e959,_0x2f4778){return function(_0x4e19cb){if(_0x4e19cb){return _0x4e19cb[_0xf5f2('0x2e')]()['then'](function(){_0x52e959[_0xf5f2('0x25')](0xcc)[_0xf5f2('0x26')]();});}};}function handleEntityNotFound(_0x7b6817,_0x428770){return function(_0x256bd9){if(!_0x256bd9){_0x7b6817[_0xf5f2('0x24')](0x194);}return _0x256bd9;};}function handleError(_0x2ac089,_0x2c0e05){_0x2c0e05=_0x2c0e05||0x1f4;return function(_0x5ca917){logger[_0xf5f2('0x1e')](_0x5ca917[_0xf5f2('0x2f')]);if(_0x5ca917[_0xf5f2('0x30')]){delete _0x5ca917[_0xf5f2('0x30')];}_0x2ac089[_0xf5f2('0x25')](_0x2c0e05)[_0xf5f2('0x31')](_0x5ca917);};}exports[_0xf5f2('0x32')]=function(_0x48d64d,_0x144646){var _0xf503e8={},_0x55989d={},_0x3fc168={'count':0x0,'rows':[]};var _0x4b8c42=db[_0xf5f2('0x33')][_0xf5f2('0x34')];_0x55989d[_0xf5f2('0x35')]=_[_0xf5f2('0x36')](_0x4b8c42);var _0x59a6dd={'dateStart':_0x48d64d['query'][_0xf5f2('0x37')],'dateEnd':_0x48d64d[_0xf5f2('0x38')][_0xf5f2('0x39')]};delete _0x48d64d['query'][_0xf5f2('0x37')];delete _0x48d64d['query'][_0xf5f2('0x39')];_0x55989d['query']=_[_0xf5f2('0x36')](_0x48d64d[_0xf5f2('0x38')]);_0x55989d['filters']=_[_0xf5f2('0x3a')](_0x55989d[_0xf5f2('0x35')],_0x55989d[_0xf5f2('0x38')]);_0xf503e8[_0xf5f2('0x3b')]=_['intersection'](_0x55989d['model'],qs[_0xf5f2('0x3c')](_0x48d64d[_0xf5f2('0x38')][_0xf5f2('0x3c')]));_0xf503e8[_0xf5f2('0x3b')]=_0xf503e8[_0xf5f2('0x3b')][_0xf5f2('0x3d')]?_0xf503e8[_0xf5f2('0x3b')]:_0x55989d['model'];if(!_0x48d64d[_0xf5f2('0x38')][_0xf5f2('0x3e')]('nolimit')){_0xf503e8[_0xf5f2('0x29')]=qs[_0xf5f2('0x29')](_0x48d64d[_0xf5f2('0x38')][_0xf5f2('0x29')]);_0xf503e8[_0xf5f2('0x28')]=qs[_0xf5f2('0x28')](_0x48d64d[_0xf5f2('0x38')][_0xf5f2('0x28')]);}_0xf503e8['order']=qs[_0xf5f2('0x3f')](_0x48d64d[_0xf5f2('0x38')][_0xf5f2('0x3f')]);_0xf503e8['where']=qs['filters'](_['pick'](_0x48d64d[_0xf5f2('0x38')],_0x55989d[_0xf5f2('0x40')]));if(_0x59a6dd['dateStart']){if(_0x59a6dd[_0xf5f2('0x39')]){_0x59a6dd[_0xf5f2('0x39')]=moment(_0x59a6dd[_0xf5f2('0x39')])[_0xf5f2('0x41')](0x1,_0xf5f2('0x42'));}else{_0x59a6dd[_0xf5f2('0x39')]=moment(_0x59a6dd[_0xf5f2('0x37')])[_0xf5f2('0x41')](0x1,_0xf5f2('0x42'));}_[_0xf5f2('0x43')](_0xf503e8[_0xf5f2('0x44')],{'createdAt':{'$gte':_0x59a6dd[_0xf5f2('0x37')],'$lte':_0x59a6dd[_0xf5f2('0x39')]}});}if(_0x48d64d[_0xf5f2('0x38')]['filter']){_0xf503e8[_0xf5f2('0x44')]=_['merge'](_0xf503e8[_0xf5f2('0x44')],{'$or':_[_0xf5f2('0x45')](_0x4b8c42,function(_0x218def){if(_0x218def[_0xf5f2('0x46')][_0xf5f2('0x47')]!==_0xf5f2('0x48')){var _0x55a633={};_0x55a633[_0x218def[_0xf5f2('0x49')]]={'$like':'%'+_0x48d64d[_0xf5f2('0x38')][_0xf5f2('0x4a')]+'%'};return _0x55a633;}})});}_0xf503e8=_[_0xf5f2('0x43')]({},_0xf503e8,_0x48d64d[_0xf5f2('0x4b')]);var _0x10753a={'where':_0xf503e8[_0xf5f2('0x44')]};return db[_0xf5f2('0x33')]['count'](_0x10753a)[_0xf5f2('0x18')](function(_0x33ec29){_0x3fc168[_0xf5f2('0x4c')]=_0x33ec29;if(_0x48d64d['query'][_0xf5f2('0x4d')]){_0xf503e8[_0xf5f2('0x4e')]=[{'all':!![]}];}return db[_0xf5f2('0x33')]['findAll'](_0xf503e8);})['then'](function(_0x7bb942){_0x3fc168[_0xf5f2('0x4f')]=_0x7bb942;return _0x3fc168;})['then'](respondWithFilteredResult(_0x144646,_0xf503e8))[_0xf5f2('0x23')](handleError(_0x144646,null));};exports['show']=function(_0x740321,_0x497eb8){var _0x2cbd9d={'raw':![],'where':{'id':_0x740321[_0xf5f2('0x50')]['id']}},_0x5d9120={};_0x5d9120[_0xf5f2('0x35')]=_[_0xf5f2('0x36')](db[_0xf5f2('0x33')]['rawAttributes']);_0x5d9120[_0xf5f2('0x38')]=_[_0xf5f2('0x36')](_0x740321['query']);_0x5d9120['filters']=_[_0xf5f2('0x3a')](_0x5d9120[_0xf5f2('0x35')],_0x5d9120['query']);_0x2cbd9d[_0xf5f2('0x3b')]=_[_0xf5f2('0x3a')](_0x5d9120[_0xf5f2('0x35')],qs[_0xf5f2('0x3c')](_0x740321['query']['fields']));_0x2cbd9d[_0xf5f2('0x3b')]=_0x2cbd9d[_0xf5f2('0x3b')]['length']?_0x2cbd9d[_0xf5f2('0x3b')]:_0x5d9120[_0xf5f2('0x35')];if(_0x740321[_0xf5f2('0x38')][_0xf5f2('0x4d')]){_0x2cbd9d[_0xf5f2('0x4e')]=[{'all':!![]}];}_0x2cbd9d=_[_0xf5f2('0x43')]({},_0x2cbd9d,_0x740321[_0xf5f2('0x4b')]);return db['FreshdeskConfiguration']['find'](_0x2cbd9d)[_0xf5f2('0x18')](handleEntityNotFound(_0x497eb8,null))[_0xf5f2('0x18')](respondWithResult(_0x497eb8,null))[_0xf5f2('0x23')](handleError(_0x497eb8,null));};exports[_0xf5f2('0x51')]=function(_0x21b0d3,_0x5a861d){return db[_0xf5f2('0x33')][_0xf5f2('0x51')](_0x21b0d3[_0xf5f2('0x52')],{})['then'](respondWithResult(_0x5a861d,0xc9))[_0xf5f2('0x23')](handleError(_0x5a861d,null));};exports['update']=function(_0x78f1d2,_0x1a8d33){if(_0x78f1d2[_0xf5f2('0x52')]['id']){delete _0x78f1d2[_0xf5f2('0x52')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x78f1d2[_0xf5f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x1a8d33,null))[_0xf5f2('0x18')](saveUpdates(_0x78f1d2[_0xf5f2('0x52')],null))['then'](respondWithResult(_0x1a8d33,null))[_0xf5f2('0x23')](handleError(_0x1a8d33,null));};exports[_0xf5f2('0x2e')]=function(_0x2a8f6d,_0x51ef09){return db[_0xf5f2('0x33')][_0xf5f2('0x53')]({'where':{'id':_0x2a8f6d[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x51ef09,null))['then'](removeEntity(_0x51ef09,null))[_0xf5f2('0x23')](handleError(_0x51ef09,null));};exports['getFields']=function(_0x2cbe1e,_0x2a773d,_0x2e6f5d){var _0x380c08={};var _0x9f210e={};var _0x5583c2;var _0xda8dda;return db[_0xf5f2('0x33')][_0xf5f2('0x54')]({'where':{'id':_0x2cbe1e[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x2a773d,null))['then'](function(_0x31e16b){if(_0x31e16b){_0x5583c2=_0x31e16b;_0x9f210e['model']=_['keys'](db[_0xf5f2('0x55')]['rawAttributes']);_0x9f210e[_0xf5f2('0x38')]=_[_0xf5f2('0x36')](_0x2cbe1e[_0xf5f2('0x38')]);_0x9f210e[_0xf5f2('0x40')]=_['intersection'](_0x9f210e[_0xf5f2('0x35')],_0x9f210e[_0xf5f2('0x38')]);_0x380c08[_0xf5f2('0x3b')]=_[_0xf5f2('0x3a')](_0x9f210e[_0xf5f2('0x35')],qs[_0xf5f2('0x3c')](_0x2cbe1e[_0xf5f2('0x38')]['fields']));_0x380c08[_0xf5f2('0x3b')]=_0x380c08[_0xf5f2('0x3b')][_0xf5f2('0x3d')]?_0x380c08[_0xf5f2('0x3b')]:_0x9f210e['model'];_0x380c08[_0xf5f2('0x56')]=qs['sort'](_0x2cbe1e[_0xf5f2('0x38')][_0xf5f2('0x3f')]);_0x380c08['where']=qs[_0xf5f2('0x40')](_[_0xf5f2('0x57')](_0x2cbe1e[_0xf5f2('0x38')],_0x9f210e[_0xf5f2('0x40')]));if(_0x2cbe1e[_0xf5f2('0x38')]['filter']){_0x380c08[_0xf5f2('0x44')]=_[_0xf5f2('0x43')](_0x380c08[_0xf5f2('0x44')],{'$or':_[_0xf5f2('0x45')](_0x380c08[_0xf5f2('0x3b')],function(_0xfe70c1){var _0x53284f={};_0x53284f[_0xfe70c1]={'$like':'%'+_0x2cbe1e[_0xf5f2('0x38')][_0xf5f2('0x4a')]+'%'};return _0x53284f;})});}_0x380c08=_['merge']({},_0x380c08,_0x2cbe1e[_0xf5f2('0x4b')]);return _0x5583c2[_0xf5f2('0x58')](_0x380c08);}})[_0xf5f2('0x18')](function(_0x51a3c7){if(_0x51a3c7){_0xda8dda=_0x51a3c7['length'];if(!_0x2cbe1e['query'][_0xf5f2('0x3e')](_0xf5f2('0x59'))){_0x380c08[_0xf5f2('0x29')]=qs[_0xf5f2('0x29')](_0x2cbe1e[_0xf5f2('0x38')]['limit']);_0x380c08[_0xf5f2('0x28')]=qs[_0xf5f2('0x28')](_0x2cbe1e[_0xf5f2('0x38')][_0xf5f2('0x28')]);}return _0x5583c2[_0xf5f2('0x58')](_0x380c08);}})[_0xf5f2('0x18')](function(_0x11c302){if(_0x11c302){return _0x11c302?{'count':_0xda8dda,'rows':_0x11c302}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x2a773d,null))[_0xf5f2('0x23')](handleError(_0x2a773d,null));};exports[_0xf5f2('0x5a')]=function(_0x4457ab,_0x5679bc,_0x5e4e07){var _0x5a143f={};var _0x40f362={};var _0xafba8e;var _0x3d3181;return db[_0xf5f2('0x33')][_0xf5f2('0x54')]({'where':{'id':_0x4457ab['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5679bc,null))[_0xf5f2('0x18')](function(_0x301006){if(_0x301006){_0xafba8e=_0x301006;_0x40f362[_0xf5f2('0x35')]=_[_0xf5f2('0x36')](db['FreshdeskField'][_0xf5f2('0x34')]);_0x40f362[_0xf5f2('0x38')]=_['keys'](_0x4457ab[_0xf5f2('0x38')]);_0x40f362[_0xf5f2('0x40')]=_[_0xf5f2('0x3a')](_0x40f362[_0xf5f2('0x35')],_0x40f362['query']);_0x5a143f[_0xf5f2('0x3b')]=_[_0xf5f2('0x3a')](_0x40f362[_0xf5f2('0x35')],qs[_0xf5f2('0x3c')](_0x4457ab[_0xf5f2('0x38')]['fields']));_0x5a143f['attributes']=_0x5a143f[_0xf5f2('0x3b')][_0xf5f2('0x3d')]?_0x5a143f[_0xf5f2('0x3b')]:_0x40f362[_0xf5f2('0x35')];_0x5a143f['order']=qs['sort'](_0x4457ab[_0xf5f2('0x38')]['sort']);_0x5a143f['where']=qs['filters'](_['pick'](_0x4457ab[_0xf5f2('0x38')],_0x40f362[_0xf5f2('0x40')]));if(_0x4457ab[_0xf5f2('0x38')][_0xf5f2('0x4a')]){_0x5a143f[_0xf5f2('0x44')]=_[_0xf5f2('0x43')](_0x5a143f[_0xf5f2('0x44')],{'$or':_[_0xf5f2('0x45')](_0x5a143f[_0xf5f2('0x3b')],function(_0x26b251){var _0x9afb3c={};_0x9afb3c[_0x26b251]={'$like':'%'+_0x4457ab[_0xf5f2('0x38')][_0xf5f2('0x4a')]+'%'};return _0x9afb3c;})});}_0x5a143f=_[_0xf5f2('0x43')]({},_0x5a143f,_0x4457ab[_0xf5f2('0x4b')]);return _0xafba8e[_0xf5f2('0x5a')](_0x5a143f);}})[_0xf5f2('0x18')](function(_0x2778ed){if(_0x2778ed){_0x3d3181=_0x2778ed['length'];if(!_0x4457ab[_0xf5f2('0x38')][_0xf5f2('0x3e')](_0xf5f2('0x59'))){_0x5a143f[_0xf5f2('0x29')]=qs[_0xf5f2('0x29')](_0x4457ab[_0xf5f2('0x38')][_0xf5f2('0x29')]);_0x5a143f[_0xf5f2('0x28')]=qs['offset'](_0x4457ab[_0xf5f2('0x38')]['offset']);}return _0xafba8e['getSubjects'](_0x5a143f);}})['then'](function(_0x53449e){if(_0x53449e){return _0x53449e?{'count':_0x3d3181,'rows':_0x53449e}:null;}})['then'](respondWithResult(_0x5679bc,null))['catch'](handleError(_0x5679bc,null));};exports[_0xf5f2('0x5b')]=function(_0x18ce86,_0x26a57c,_0x375bc9){var _0x145d4d={};var _0x3cf857={};var _0x5dc63f;var _0x4a0005;return db[_0xf5f2('0x33')]['findOne']({'where':{'id':_0x18ce86[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x26a57c,null))['then'](function(_0x4f3ad4){if(_0x4f3ad4){_0x5dc63f=_0x4f3ad4;_0x3cf857[_0xf5f2('0x35')]=_[_0xf5f2('0x36')](db['FreshdeskField'][_0xf5f2('0x34')]);_0x3cf857[_0xf5f2('0x38')]=_['keys'](_0x18ce86[_0xf5f2('0x38')]);_0x3cf857[_0xf5f2('0x40')]=_[_0xf5f2('0x3a')](_0x3cf857['model'],_0x3cf857[_0xf5f2('0x38')]);_0x145d4d[_0xf5f2('0x3b')]=_[_0xf5f2('0x3a')](_0x3cf857[_0xf5f2('0x35')],qs[_0xf5f2('0x3c')](_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x3c')]));_0x145d4d[_0xf5f2('0x3b')]=_0x145d4d[_0xf5f2('0x3b')][_0xf5f2('0x3d')]?_0x145d4d[_0xf5f2('0x3b')]:_0x3cf857[_0xf5f2('0x35')];_0x145d4d[_0xf5f2('0x56')]=qs[_0xf5f2('0x3f')](_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x3f')]);_0x145d4d[_0xf5f2('0x44')]=qs[_0xf5f2('0x40')](_[_0xf5f2('0x57')](_0x18ce86[_0xf5f2('0x38')],_0x3cf857[_0xf5f2('0x40')]));if(_0x18ce86['query'][_0xf5f2('0x4a')]){_0x145d4d[_0xf5f2('0x44')]=_['merge'](_0x145d4d[_0xf5f2('0x44')],{'$or':_[_0xf5f2('0x45')](_0x145d4d['attributes'],function(_0xb56304){var _0x2f54eb={};_0x2f54eb[_0xb56304]={'$like':'%'+_0x18ce86[_0xf5f2('0x38')]['filter']+'%'};return _0x2f54eb;})});}_0x145d4d=_['merge']({},_0x145d4d,_0x18ce86[_0xf5f2('0x4b')]);return _0x5dc63f[_0xf5f2('0x5b')](_0x145d4d);}})[_0xf5f2('0x18')](function(_0x5ba275){if(_0x5ba275){_0x4a0005=_0x5ba275['length'];if(!_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x3e')](_0xf5f2('0x59'))){_0x145d4d['limit']=qs['limit'](_0x18ce86['query']['limit']);_0x145d4d['offset']=qs[_0xf5f2('0x28')](_0x18ce86['query'][_0xf5f2('0x28')]);}return _0x5dc63f[_0xf5f2('0x5b')](_0x145d4d);}})[_0xf5f2('0x18')](function(_0x43a167){if(_0x43a167){return _0x43a167?{'count':_0x4a0005,'rows':_0x43a167}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x26a57c,null))[_0xf5f2('0x23')](handleError(_0x26a57c,null));};exports[_0xf5f2('0x5c')]=function(_0x40e921,_0x3dc051,_0x27ca4a){var _0x1bb4ac={};var _0x36c3c8={};var _0x10c982;var _0x5e69a2;return db[_0xf5f2('0x33')][_0xf5f2('0x54')]({'where':{'id':_0x40e921['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x3dc051,null))[_0xf5f2('0x18')](function(_0x537a7d){if(_0x537a7d){_0x10c982=_0x537a7d;_0x36c3c8[_0xf5f2('0x35')]=_[_0xf5f2('0x36')](db[_0xf5f2('0x5d')]['rawAttributes']);_0x36c3c8[_0xf5f2('0x38')]=_[_0xf5f2('0x36')](_0x40e921['query']);_0x36c3c8[_0xf5f2('0x40')]=_[_0xf5f2('0x3a')](_0x36c3c8[_0xf5f2('0x35')],_0x36c3c8['query']);_0x1bb4ac[_0xf5f2('0x3b')]=_['intersection'](_0x36c3c8[_0xf5f2('0x35')],qs['fields'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x3c')]));_0x1bb4ac[_0xf5f2('0x3b')]=_0x1bb4ac[_0xf5f2('0x3b')]['length']?_0x1bb4ac[_0xf5f2('0x3b')]:_0x36c3c8['model'];_0x1bb4ac['order']=qs['sort'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x3f')]);_0x1bb4ac['where']=qs[_0xf5f2('0x40')](_[_0xf5f2('0x57')](_0x40e921[_0xf5f2('0x38')],_0x36c3c8[_0xf5f2('0x40')]));if(_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x4a')]){_0x1bb4ac['where']=_[_0xf5f2('0x43')](_0x1bb4ac[_0xf5f2('0x44')],{'$or':_['map'](_0x1bb4ac[_0xf5f2('0x3b')],function(_0x19cbff){var _0x58042c={};_0x58042c[_0x19cbff]={'$like':'%'+_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x4a')]+'%'};return _0x58042c;})});}_0x1bb4ac=_[_0xf5f2('0x43')]({},_0x1bb4ac,_0x40e921[_0xf5f2('0x4b')]);return _0x10c982[_0xf5f2('0x5c')](_0x1bb4ac);}})[_0xf5f2('0x18')](function(_0x4df05c){if(_0x4df05c){_0x5e69a2=_0x4df05c[_0xf5f2('0x3d')];if(!_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x3e')](_0xf5f2('0x59'))){_0x1bb4ac[_0xf5f2('0x29')]=qs[_0xf5f2('0x29')](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x29')]);_0x1bb4ac[_0xf5f2('0x28')]=qs['offset'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x28')]);}return _0x10c982[_0xf5f2('0x5c')](_0x1bb4ac);}})[_0xf5f2('0x18')](function(_0x35fe1a){if(_0x35fe1a){return _0x35fe1a?{'count':_0x5e69a2,'rows':_0x35fe1a}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x3dc051,null))[_0xf5f2('0x23')](handleError(_0x3dc051,null));};exports[_0xf5f2('0x5e')]=function(_0x33cfe7,_0x40d0eb,_0x4c138c){if(_0x33cfe7['body']['id']){delete _0x33cfe7[_0xf5f2('0x52')]['id'];}return db[_0xf5f2('0x33')][_0xf5f2('0x54')]({'where':{'id':_0x33cfe7[_0xf5f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x40d0eb,null))[_0xf5f2('0x18')](function(_0xffb639){if(_0xffb639){return _0xffb639[_0xf5f2('0x5e')](_0x33cfe7[_0xf5f2('0x52')][_0xf5f2('0x5f')]||[]);}return null;})['then'](respondWithResult(_0x40d0eb,null))[_0xf5f2('0x23')](handleError(_0x40d0eb,null));};
\ No newline at end of file
+var _0xc4aa=['http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','model','keys','query','dateEnd','dateStart','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','filter','merge','map','type','key','VIRTUAL','FreshdeskConfiguration','rows','show','params','rawAttributes','intersection','fields','includeAll','options','create','body','find','findOne','getFields','getSubjects','getDescriptions','FreshdeskField','getTags','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var qs=require(_0xac4a('0x10'));var logger=require(_0xac4a('0x11'))(_0xac4a('0x12'));var utils=require('../../config/utils');var config=require(_0xac4a('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0xac4a('0x14'));var client=jayson['client'][_0xac4a('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x2a0776,_0x24291d,_0x5e16aa,_0x21a79){return new BPromise(function(_0x68424a,_0x247b78){var _0x6e00d4=_0x21a79||client;return _0x6e00d4[_0xac4a('0x16')](_0x2a0776,_0x5e16aa)[_0xac4a('0x17')](function(_0x34bc01){logger[_0xac4a('0x18')](_0xac4a('0x19'),_0x24291d,_0xac4a('0x1a'));logger[_0xac4a('0x1b')](_0xac4a('0x1c'),_0x24291d,'request\x20sent',JSON[_0xac4a('0x1d')](_0x34bc01));if(_0x34bc01[_0xac4a('0x1e')]){if(_0x34bc01[_0xac4a('0x1e')][_0xac4a('0x1f')]===0x1f4){logger[_0xac4a('0x1e')](_0xac4a('0x19'),_0x24291d,_0x34bc01[_0xac4a('0x1e')][_0xac4a('0x20')]);return _0x247b78(_0x34bc01['error']['message']);}logger[_0xac4a('0x1e')](_0xac4a('0x19'),_0x24291d,_0x34bc01[_0xac4a('0x1e')]['message']);return _0x68424a(_0x34bc01[_0xac4a('0x1e')][_0xac4a('0x20')]);}else{logger[_0xac4a('0x18')](_0xac4a('0x19'),_0x24291d,_0xac4a('0x1a'));_0x68424a(_0x34bc01[_0xac4a('0x21')][_0xac4a('0x20')]);}})[_0xac4a('0x22')](function(_0x534092){logger[_0xac4a('0x1e')](_0xac4a('0x19'),_0x24291d,_0x534092);_0x247b78(_0x534092);});});}function respondWithStatusCode(_0x599787,_0x3d7ce0){_0x3d7ce0=_0x3d7ce0||0xcc;return function(_0x4169c0){if(_0x4169c0){return _0x599787[_0xac4a('0x23')](_0x3d7ce0);}return _0x599787[_0xac4a('0x24')](_0x3d7ce0)['end']();};}function respondWithResult(_0x1b7998,_0x2503d8){_0x2503d8=_0x2503d8||0xc8;return function(_0x15435c){if(_0x15435c){return _0x1b7998[_0xac4a('0x24')](_0x2503d8)[_0xac4a('0x25')](_0x15435c);}};}function respondWithFilteredResult(_0x2b0dc2,_0x222507){return function(_0x36054a){if(_0x36054a){var _0x3e2c69=_0x36054a[_0xac4a('0x26')],_0x3bc318=_0x222507[_0xac4a('0x27')],_0x1d0539=_0x222507[_0xac4a('0x27')]+_0x222507[_0xac4a('0x28')],_0x215a31;if(_0x1d0539>=_0x3e2c69){_0x1d0539=_0x3e2c69;_0x215a31=0xc8;}else{_0x215a31=0xce;}_0x2b0dc2['status'](_0x215a31);return _0x2b0dc2[_0xac4a('0x29')](_0xac4a('0x2a'),_0x3bc318+'-'+_0x1d0539+'/'+_0x3e2c69)[_0xac4a('0x25')](_0x36054a);}return null;};}function patchUpdates(_0x2772fe){return function(_0x116700){try{jsonpatch['apply'](_0x116700,_0x2772fe,!![]);}catch(_0x47f49c){return BPromise[_0xac4a('0x2b')](_0x47f49c);}return _0x116700[_0xac4a('0x2c')]();};}function saveUpdates(_0x1f12d5,_0x546b65){return function(_0x4bda1f){if(_0x4bda1f){return _0x4bda1f[_0xac4a('0x2d')](_0x1f12d5)[_0xac4a('0x17')](function(_0x228629){return _0x228629;});}return null;};}function removeEntity(_0x432066,_0x17118e){return function(_0x53d3a5){if(_0x53d3a5){return _0x53d3a5[_0xac4a('0x2e')]()['then'](function(){_0x432066[_0xac4a('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e6de,_0xfbe355){return function(_0x31501b){if(!_0x31501b){_0x17e6de[_0xac4a('0x23')](0x194);}return _0x31501b;};}function handleError(_0x34577f,_0x61e552){_0x61e552=_0x61e552||0x1f4;return function(_0xbd4591){logger[_0xac4a('0x1e')](_0xbd4591[_0xac4a('0x2f')]);if(_0xbd4591[_0xac4a('0x30')]){delete _0xbd4591[_0xac4a('0x30')];}_0x34577f[_0xac4a('0x24')](_0x61e552)[_0xac4a('0x31')](_0xbd4591);};}exports[_0xac4a('0x32')]=function(_0x5634e2,_0x30442d){var _0x1c41fb={},_0x5a4e2b={},_0x2a5419={'count':0x0,'rows':[]};var _0x1af1c1=db['FreshdeskConfiguration']['rawAttributes'];_0x5a4e2b[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1af1c1);var _0x1b42b6={'dateStart':_0x5634e2[_0xac4a('0x35')]['dateStart'],'dateEnd':_0x5634e2[_0xac4a('0x35')][_0xac4a('0x36')]};delete _0x5634e2['query'][_0xac4a('0x37')];delete _0x5634e2[_0xac4a('0x35')][_0xac4a('0x36')];_0x5a4e2b['query']=_[_0xac4a('0x34')](_0x5634e2[_0xac4a('0x35')]);_0x5a4e2b[_0xac4a('0x38')]=_['intersection'](_0x5a4e2b[_0xac4a('0x33')],_0x5a4e2b[_0xac4a('0x35')]);_0x1c41fb['attributes']=_['intersection'](_0x5a4e2b[_0xac4a('0x33')],qs['fields'](_0x5634e2['query']['fields']));_0x1c41fb['attributes']=_0x1c41fb[_0xac4a('0x39')][_0xac4a('0x3a')]?_0x1c41fb[_0xac4a('0x39')]:_0x5a4e2b[_0xac4a('0x33')];if(!_0x5634e2[_0xac4a('0x35')][_0xac4a('0x3b')](_0xac4a('0x3c'))){_0x1c41fb[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x5634e2[_0xac4a('0x35')][_0xac4a('0x28')]);_0x1c41fb[_0xac4a('0x27')]=qs['offset'](_0x5634e2['query']['offset']);}_0x1c41fb[_0xac4a('0x3d')]=qs[_0xac4a('0x3e')](_0x5634e2[_0xac4a('0x35')][_0xac4a('0x3e')]);_0x1c41fb[_0xac4a('0x3f')]=qs[_0xac4a('0x38')](_[_0xac4a('0x40')](_0x5634e2[_0xac4a('0x35')],_0x5a4e2b[_0xac4a('0x38')]));if(_0x1b42b6[_0xac4a('0x37')]){if(_0x1b42b6['dateEnd']){_0x1b42b6[_0xac4a('0x36')]=moment(_0x1b42b6[_0xac4a('0x36')])[_0xac4a('0x41')](0x1,_0xac4a('0x42'));}else{_0x1b42b6[_0xac4a('0x36')]=moment(_0x1b42b6['dateStart'])[_0xac4a('0x41')](0x1,_0xac4a('0x42'));}_['merge'](_0x1c41fb[_0xac4a('0x3f')],{'createdAt':{'$gte':_0x1b42b6['dateStart'],'$lte':_0x1b42b6[_0xac4a('0x36')]}});}if(_0x5634e2[_0xac4a('0x35')][_0xac4a('0x43')]){_0x1c41fb[_0xac4a('0x3f')]=_[_0xac4a('0x44')](_0x1c41fb[_0xac4a('0x3f')],{'$or':_[_0xac4a('0x45')](_0x1af1c1,function(_0x30a169){if(_0x30a169[_0xac4a('0x46')][_0xac4a('0x47')]!==_0xac4a('0x48')){var _0x3b68b3={};_0x3b68b3[_0x30a169['field']]={'$like':'%'+_0x5634e2[_0xac4a('0x35')][_0xac4a('0x43')]+'%'};return _0x3b68b3;}})});}_0x1c41fb=_[_0xac4a('0x44')]({},_0x1c41fb,_0x5634e2['options']);var _0x1764bf={'where':_0x1c41fb[_0xac4a('0x3f')]};return db['FreshdeskConfiguration'][_0xac4a('0x26')](_0x1764bf)['then'](function(_0x244950){_0x2a5419[_0xac4a('0x26')]=_0x244950;if(_0x5634e2[_0xac4a('0x35')]['includeAll']){_0x1c41fb['include']=[{'all':!![]}];}return db[_0xac4a('0x49')]['findAll'](_0x1c41fb);})[_0xac4a('0x17')](function(_0x566258){_0x2a5419[_0xac4a('0x4a')]=_0x566258;return _0x2a5419;})['then'](respondWithFilteredResult(_0x30442d,_0x1c41fb))[_0xac4a('0x22')](handleError(_0x30442d,null));};exports[_0xac4a('0x4b')]=function(_0x424f9b,_0x1c8c39){var _0x54782f={'raw':![],'where':{'id':_0x424f9b[_0xac4a('0x4c')]['id']}},_0x31c794={};_0x31c794[_0xac4a('0x33')]=_[_0xac4a('0x34')](db[_0xac4a('0x49')][_0xac4a('0x4d')]);_0x31c794[_0xac4a('0x35')]=_['keys'](_0x424f9b[_0xac4a('0x35')]);_0x31c794[_0xac4a('0x38')]=_['intersection'](_0x31c794[_0xac4a('0x33')],_0x31c794[_0xac4a('0x35')]);_0x54782f[_0xac4a('0x39')]=_[_0xac4a('0x4e')](_0x31c794['model'],qs[_0xac4a('0x4f')](_0x424f9b[_0xac4a('0x35')][_0xac4a('0x4f')]));_0x54782f[_0xac4a('0x39')]=_0x54782f[_0xac4a('0x39')]['length']?_0x54782f[_0xac4a('0x39')]:_0x31c794['model'];if(_0x424f9b[_0xac4a('0x35')][_0xac4a('0x50')]){_0x54782f['include']=[{'all':!![]}];}_0x54782f=_['merge']({},_0x54782f,_0x424f9b[_0xac4a('0x51')]);return db[_0xac4a('0x49')]['find'](_0x54782f)[_0xac4a('0x17')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x17')](respondWithResult(_0x1c8c39,null))[_0xac4a('0x22')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x52')]=function(_0x48900f,_0x3057d6){return db[_0xac4a('0x49')][_0xac4a('0x52')](_0x48900f[_0xac4a('0x53')],{})[_0xac4a('0x17')](respondWithResult(_0x3057d6,0xc9))[_0xac4a('0x22')](handleError(_0x3057d6,null));};exports[_0xac4a('0x2d')]=function(_0x487a44,_0x39123d){if(_0x487a44[_0xac4a('0x53')]['id']){delete _0x487a44[_0xac4a('0x53')]['id'];}return db[_0xac4a('0x49')][_0xac4a('0x54')]({'where':{'id':_0x487a44[_0xac4a('0x4c')]['id']}})[_0xac4a('0x17')](handleEntityNotFound(_0x39123d,null))[_0xac4a('0x17')](saveUpdates(_0x487a44[_0xac4a('0x53')],null))[_0xac4a('0x17')](respondWithResult(_0x39123d,null))[_0xac4a('0x22')](handleError(_0x39123d,null));};exports[_0xac4a('0x2e')]=function(_0x400ac4,_0x2fe7df){return db[_0xac4a('0x49')][_0xac4a('0x54')]({'where':{'id':_0x400ac4['params']['id']}})[_0xac4a('0x17')](handleEntityNotFound(_0x2fe7df,null))['then'](removeEntity(_0x2fe7df,null))[_0xac4a('0x22')](handleError(_0x2fe7df,null));};exports['getFields']=function(_0x2a30e8,_0x50595a,_0x3e92bf){var _0x5cac9b={};var _0x4d1b39={};var _0x52c957;var _0x568ffb;return db[_0xac4a('0x49')][_0xac4a('0x55')]({'where':{'id':_0x2a30e8[_0xac4a('0x4c')]['id']}})[_0xac4a('0x17')](handleEntityNotFound(_0x50595a,null))['then'](function(_0x1e1ffa){if(_0x1e1ffa){_0x52c957=_0x1e1ffa;_0x4d1b39['model']=_[_0xac4a('0x34')](db['FreshdeskField'][_0xac4a('0x4d')]);_0x4d1b39[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x2a30e8[_0xac4a('0x35')]);_0x4d1b39[_0xac4a('0x38')]=_[_0xac4a('0x4e')](_0x4d1b39[_0xac4a('0x33')],_0x4d1b39[_0xac4a('0x35')]);_0x5cac9b[_0xac4a('0x39')]=_[_0xac4a('0x4e')](_0x4d1b39[_0xac4a('0x33')],qs[_0xac4a('0x4f')](_0x2a30e8[_0xac4a('0x35')][_0xac4a('0x4f')]));_0x5cac9b[_0xac4a('0x39')]=_0x5cac9b[_0xac4a('0x39')][_0xac4a('0x3a')]?_0x5cac9b['attributes']:_0x4d1b39[_0xac4a('0x33')];_0x5cac9b[_0xac4a('0x3d')]=qs['sort'](_0x2a30e8[_0xac4a('0x35')][_0xac4a('0x3e')]);_0x5cac9b[_0xac4a('0x3f')]=qs[_0xac4a('0x38')](_[_0xac4a('0x40')](_0x2a30e8['query'],_0x4d1b39['filters']));if(_0x2a30e8[_0xac4a('0x35')][_0xac4a('0x43')]){_0x5cac9b[_0xac4a('0x3f')]=_[_0xac4a('0x44')](_0x5cac9b[_0xac4a('0x3f')],{'$or':_[_0xac4a('0x45')](_0x5cac9b[_0xac4a('0x39')],function(_0x2988d7){var _0x44c60b={};_0x44c60b[_0x2988d7]={'$like':'%'+_0x2a30e8[_0xac4a('0x35')][_0xac4a('0x43')]+'%'};return _0x44c60b;})});}_0x5cac9b=_['merge']({},_0x5cac9b,_0x2a30e8['options']);return _0x52c957[_0xac4a('0x56')](_0x5cac9b);}})[_0xac4a('0x17')](function(_0x2954fc){if(_0x2954fc){_0x568ffb=_0x2954fc[_0xac4a('0x3a')];if(!_0x2a30e8[_0xac4a('0x35')][_0xac4a('0x3b')](_0xac4a('0x3c'))){_0x5cac9b[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x2a30e8[_0xac4a('0x35')][_0xac4a('0x28')]);_0x5cac9b[_0xac4a('0x27')]=qs['offset'](_0x2a30e8[_0xac4a('0x35')][_0xac4a('0x27')]);}return _0x52c957[_0xac4a('0x56')](_0x5cac9b);}})[_0xac4a('0x17')](function(_0x513976){if(_0x513976){return _0x513976?{'count':_0x568ffb,'rows':_0x513976}:null;}})[_0xac4a('0x17')](respondWithResult(_0x50595a,null))['catch'](handleError(_0x50595a,null));};exports[_0xac4a('0x57')]=function(_0x3af39a,_0x499abc,_0x5bd95b){var _0x17eac2={};var _0x3b8974={};var _0x13097f;var _0x5dc373;return db[_0xac4a('0x49')]['findOne']({'where':{'id':_0x3af39a[_0xac4a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x499abc,null))['then'](function(_0x118c03){if(_0x118c03){_0x13097f=_0x118c03;_0x3b8974['model']=_[_0xac4a('0x34')](db['FreshdeskField'][_0xac4a('0x4d')]);_0x3b8974[_0xac4a('0x35')]=_['keys'](_0x3af39a[_0xac4a('0x35')]);_0x3b8974['filters']=_[_0xac4a('0x4e')](_0x3b8974[_0xac4a('0x33')],_0x3b8974['query']);_0x17eac2[_0xac4a('0x39')]=_['intersection'](_0x3b8974['model'],qs[_0xac4a('0x4f')](_0x3af39a['query'][_0xac4a('0x4f')]));_0x17eac2['attributes']=_0x17eac2['attributes'][_0xac4a('0x3a')]?_0x17eac2[_0xac4a('0x39')]:_0x3b8974[_0xac4a('0x33')];_0x17eac2['order']=qs['sort'](_0x3af39a[_0xac4a('0x35')][_0xac4a('0x3e')]);_0x17eac2['where']=qs['filters'](_[_0xac4a('0x40')](_0x3af39a[_0xac4a('0x35')],_0x3b8974[_0xac4a('0x38')]));if(_0x3af39a[_0xac4a('0x35')][_0xac4a('0x43')]){_0x17eac2[_0xac4a('0x3f')]=_[_0xac4a('0x44')](_0x17eac2[_0xac4a('0x3f')],{'$or':_[_0xac4a('0x45')](_0x17eac2['attributes'],function(_0x1201e8){var _0x440dc4={};_0x440dc4[_0x1201e8]={'$like':'%'+_0x3af39a[_0xac4a('0x35')]['filter']+'%'};return _0x440dc4;})});}_0x17eac2=_[_0xac4a('0x44')]({},_0x17eac2,_0x3af39a[_0xac4a('0x51')]);return _0x13097f[_0xac4a('0x57')](_0x17eac2);}})[_0xac4a('0x17')](function(_0x3d2b5c){if(_0x3d2b5c){_0x5dc373=_0x3d2b5c['length'];if(!_0x3af39a[_0xac4a('0x35')][_0xac4a('0x3b')](_0xac4a('0x3c'))){_0x17eac2[_0xac4a('0x28')]=qs[_0xac4a('0x28')](_0x3af39a[_0xac4a('0x35')][_0xac4a('0x28')]);_0x17eac2['offset']=qs[_0xac4a('0x27')](_0x3af39a[_0xac4a('0x35')][_0xac4a('0x27')]);}return _0x13097f[_0xac4a('0x57')](_0x17eac2);}})[_0xac4a('0x17')](function(_0x171c47){if(_0x171c47){return _0x171c47?{'count':_0x5dc373,'rows':_0x171c47}:null;}})['then'](respondWithResult(_0x499abc,null))[_0xac4a('0x22')](handleError(_0x499abc,null));};exports[_0xac4a('0x58')]=function(_0x1b9a33,_0x284bbf,_0x5bb389){var _0x21a384={};var _0x56a934={};var _0x4447b5;var _0x22b718;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x1b9a33[_0xac4a('0x4c')]['id']}})[_0xac4a('0x17')](handleEntityNotFound(_0x284bbf,null))[_0xac4a('0x17')](function(_0x4bb03d){if(_0x4bb03d){_0x4447b5=_0x4bb03d;_0x56a934[_0xac4a('0x33')]=_['keys'](db[_0xac4a('0x59')][_0xac4a('0x4d')]);_0x56a934[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b9a33[_0xac4a('0x35')]);_0x56a934['filters']=_['intersection'](_0x56a934[_0xac4a('0x33')],_0x56a934[_0xac4a('0x35')]);_0x21a384[_0xac4a('0x39')]=_[_0xac4a('0x4e')](_0x56a934[_0xac4a('0x33')],qs[_0xac4a('0x4f')](_0x1b9a33[_0xac4a('0x35')][_0xac4a('0x4f')]));_0x21a384['attributes']=_0x21a384['attributes'][_0xac4a('0x3a')]?_0x21a384[_0xac4a('0x39')]:_0x56a934[_0xac4a('0x33')];_0x21a384[_0xac4a('0x3d')]=qs[_0xac4a('0x3e')](_0x1b9a33[_0xac4a('0x35')][_0xac4a('0x3e')]);_0x21a384[_0xac4a('0x3f')]=qs['filters'](_['pick'](_0x1b9a33[_0xac4a('0x35')],_0x56a934[_0xac4a('0x38')]));if(_0x1b9a33[_0xac4a('0x35')][_0xac4a('0x43')]){_0x21a384[_0xac4a('0x3f')]=_[_0xac4a('0x44')](_0x21a384[_0xac4a('0x3f')],{'$or':_['map'](_0x21a384[_0xac4a('0x39')],function(_0x1bacf2){var _0x3439f3={};_0x3439f3[_0x1bacf2]={'$like':'%'+_0x1b9a33['query'][_0xac4a('0x43')]+'%'};return _0x3439f3;})});}_0x21a384=_[_0xac4a('0x44')]({},_0x21a384,_0x1b9a33[_0xac4a('0x51')]);return _0x4447b5[_0xac4a('0x58')](_0x21a384);}})[_0xac4a('0x17')](function(_0x27d023){if(_0x27d023){_0x22b718=_0x27d023[_0xac4a('0x3a')];if(!_0x1b9a33[_0xac4a('0x35')][_0xac4a('0x3b')]('nolimit')){_0x21a384[_0xac4a('0x28')]=qs['limit'](_0x1b9a33[_0xac4a('0x35')][_0xac4a('0x28')]);_0x21a384[_0xac4a('0x27')]=qs[_0xac4a('0x27')](_0x1b9a33[_0xac4a('0x35')][_0xac4a('0x27')]);}return _0x4447b5[_0xac4a('0x58')](_0x21a384);}})['then'](function(_0x2b883a){if(_0x2b883a){return _0x2b883a?{'count':_0x22b718,'rows':_0x2b883a}:null;}})[_0xac4a('0x17')](respondWithResult(_0x284bbf,null))[_0xac4a('0x22')](handleError(_0x284bbf,null));};exports[_0xac4a('0x5a')]=function(_0x15f706,_0x54a172,_0x1b37d9){var _0x360d4f={};var _0x4f2b19={};var _0x55af32;var _0x386d6d;return db[_0xac4a('0x49')]['findOne']({'where':{'id':_0x15f706[_0xac4a('0x4c')]['id']}})[_0xac4a('0x17')](handleEntityNotFound(_0x54a172,null))[_0xac4a('0x17')](function(_0x37657e){if(_0x37657e){_0x55af32=_0x37657e;_0x4f2b19[_0xac4a('0x33')]=_[_0xac4a('0x34')](db['Tag'][_0xac4a('0x4d')]);_0x4f2b19[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x15f706['query']);_0x4f2b19[_0xac4a('0x38')]=_[_0xac4a('0x4e')](_0x4f2b19[_0xac4a('0x33')],_0x4f2b19[_0xac4a('0x35')]);_0x360d4f[_0xac4a('0x39')]=_[_0xac4a('0x4e')](_0x4f2b19['model'],qs[_0xac4a('0x4f')](_0x15f706[_0xac4a('0x35')]['fields']));_0x360d4f[_0xac4a('0x39')]=_0x360d4f['attributes'][_0xac4a('0x3a')]?_0x360d4f[_0xac4a('0x39')]:_0x4f2b19['model'];_0x360d4f[_0xac4a('0x3d')]=qs['sort'](_0x15f706[_0xac4a('0x35')]['sort']);_0x360d4f[_0xac4a('0x3f')]=qs[_0xac4a('0x38')](_[_0xac4a('0x40')](_0x15f706[_0xac4a('0x35')],_0x4f2b19[_0xac4a('0x38')]));if(_0x15f706[_0xac4a('0x35')][_0xac4a('0x43')]){_0x360d4f[_0xac4a('0x3f')]=_[_0xac4a('0x44')](_0x360d4f[_0xac4a('0x3f')],{'$or':_[_0xac4a('0x45')](_0x360d4f[_0xac4a('0x39')],function(_0x47a834){var _0x4217df={};_0x4217df[_0x47a834]={'$like':'%'+_0x15f706['query'][_0xac4a('0x43')]+'%'};return _0x4217df;})});}_0x360d4f=_[_0xac4a('0x44')]({},_0x360d4f,_0x15f706['options']);return _0x55af32[_0xac4a('0x5a')](_0x360d4f);}})[_0xac4a('0x17')](function(_0x1b10ad){if(_0x1b10ad){_0x386d6d=_0x1b10ad[_0xac4a('0x3a')];if(!_0x15f706[_0xac4a('0x35')]['hasOwnProperty'](_0xac4a('0x3c'))){_0x360d4f['limit']=qs[_0xac4a('0x28')](_0x15f706[_0xac4a('0x35')][_0xac4a('0x28')]);_0x360d4f[_0xac4a('0x27')]=qs['offset'](_0x15f706[_0xac4a('0x35')]['offset']);}return _0x55af32[_0xac4a('0x5a')](_0x360d4f);}})[_0xac4a('0x17')](function(_0x279950){if(_0x279950){return _0x279950?{'count':_0x386d6d,'rows':_0x279950}:null;}})['then'](respondWithResult(_0x54a172,null))[_0xac4a('0x22')](handleError(_0x54a172,null));};exports[_0xac4a('0x5b')]=function(_0x127ede,_0x52f3f2,_0x2da95f){if(_0x127ede[_0xac4a('0x53')]['id']){delete _0x127ede[_0xac4a('0x53')]['id'];}return db[_0xac4a('0x49')][_0xac4a('0x55')]({'where':{'id':_0x127ede[_0xac4a('0x4c')]['id']}})[_0xac4a('0x17')](handleEntityNotFound(_0x52f3f2,null))[_0xac4a('0x17')](function(_0x58d57e){if(_0x58d57e){return _0x58d57e[_0xac4a('0x5b')](_0x127ede['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x52f3f2,null))['catch'](handleError(_0x52f3f2,null));};
\ No newline at end of file
index 260443c..b58283b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe292=['api','request-promise','./intFreshdeskConfiguration.attributes','int_freshdesk_configurations','../../config/logger'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xe292,0x19e));var _0x2e29=function(_0x2894ad,_0xc8b94a){_0x2894ad=_0x2894ad-0x0;var _0x2c925a=_0xe292[_0x2894ad];return _0x2c925a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e29('0x0'))(_0x2e29('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e29('0x2'));var attributes=require(_0x2e29('0x3'));module['exports']=function(_0x59d723,_0x80a47){return _0x59d723['define']('FreshdeskConfiguration',attributes,{'tableName':_0x2e29('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x81ef=['bluebird','request-promise','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x81ef,0xc3));var _0xf81e=function(_0x375cd4,_0x9f7fb0){_0x375cd4=_0x375cd4-0x0;var _0x868205=_0x81ef[_0x375cd4];return _0x868205;};'use strict';var _=require(_0xf81e('0x0'));var util=require(_0xf81e('0x1'));var logger=require(_0xf81e('0x2'))(_0xf81e('0x3'));var moment=require(_0xf81e('0x4'));var BPromise=require(_0xf81e('0x5'));var rp=require(_0xf81e('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x580f67,_0x472d99){return _0x580f67[_0xf81e('0x7')](_0xf81e('0x8'),attributes,{'tableName':_0xf81e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 83082c8..62b7398 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2a2=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0xf2a2,0x121));var _0x2f2a=function(_0x3c9e47,_0x5c1342){_0x3c9e47=_0x3c9e47-0x0;var _0x38f4df=_0xf2a2[_0x3c9e47];return _0x38f4df;};'use strict';var _=require('lodash');var util=require(_0x2f2a('0x0'));var moment=require(_0x2f2a('0x1'));var BPromise=require(_0x2f2a('0x2'));var rs=require(_0x2f2a('0x3'));var fs=require('fs');var Redis=require(_0x2f2a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2f2a('0x5'))(_0x2f2a('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f2a('0x7'));var client=jayson[_0x2f2a('0x8')][_0x2f2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cd1a7,_0x124d4a,_0x3a9c38){return new BPromise(function(_0x5a31d7,_0x3e8fce){return client[_0x2f2a('0xa')](_0x5cd1a7,_0x3a9c38)[_0x2f2a('0xb')](function(_0x5aebaf){logger[_0x2f2a('0xc')](_0x2f2a('0xd'),_0x124d4a,'request\x20sent');logger[_0x2f2a('0xe')](_0x2f2a('0xf'),_0x124d4a,_0x2f2a('0x10'),JSON['stringify'](_0x5aebaf));if(_0x5aebaf[_0x2f2a('0x11')]){if(_0x5aebaf[_0x2f2a('0x11')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x124d4a,_0x5aebaf[_0x2f2a('0x11')][_0x2f2a('0x12')]);return _0x3e8fce(_0x5aebaf[_0x2f2a('0x11')][_0x2f2a('0x12')]);}logger[_0x2f2a('0x11')](_0x2f2a('0xd'),_0x124d4a,_0x5aebaf['error'][_0x2f2a('0x12')]);return _0x5a31d7(_0x5aebaf[_0x2f2a('0x11')][_0x2f2a('0x12')]);}else{logger[_0x2f2a('0xc')](_0x2f2a('0xd'),_0x124d4a,_0x2f2a('0x10'));_0x5a31d7(_0x5aebaf[_0x2f2a('0x13')]['message']);}})[_0x2f2a('0x14')](function(_0x10ca2d){logger[_0x2f2a('0x11')](_0x2f2a('0xd'),_0x124d4a,_0x10ca2d);_0x3e8fce(_0x10ca2d);});});}
\ No newline at end of file
+var _0x8f42=['request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x43393d,_0x308a6e){var _0x48e073=function(_0x258127){while(--_0x258127){_0x43393d['push'](_0x43393d['shift']());}};_0x48e073(++_0x308a6e);}(_0x8f42,0x73));var _0x28f4=function(_0x428805,_0x387c19){_0x428805=_0x428805-0x0;var _0x3048c1=_0x8f42[_0x428805];return _0x3048c1;};'use strict';var _=require(_0x28f4('0x0'));var util=require('util');var moment=require(_0x28f4('0x1'));var BPromise=require(_0x28f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28f4('0x3'))['db'];var utils=require(_0x28f4('0x4'));var logger=require(_0x28f4('0x5'))(_0x28f4('0x6'));var config=require(_0x28f4('0x7'));var jayson=require(_0x28f4('0x8'));var client=jayson[_0x28f4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c2069,_0x58b0da,_0x42ea17){return new BPromise(function(_0x533586,_0x1ac561){return client['request'](_0x5c2069,_0x42ea17)['then'](function(_0x2326b9){logger['info'](_0x28f4('0xa'),_0x58b0da,_0x28f4('0xb'));logger[_0x28f4('0xc')](_0x28f4('0xd'),_0x58b0da,_0x28f4('0xb'),JSON[_0x28f4('0xe')](_0x2326b9));if(_0x2326b9[_0x28f4('0xf')]){if(_0x2326b9['error'][_0x28f4('0x10')]===0x1f4){logger[_0x28f4('0xf')](_0x28f4('0xa'),_0x58b0da,_0x2326b9['error'][_0x28f4('0x11')]);return _0x1ac561(_0x2326b9[_0x28f4('0xf')]['message']);}logger[_0x28f4('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x58b0da,_0x2326b9[_0x28f4('0xf')]['message']);return _0x533586(_0x2326b9[_0x28f4('0xf')][_0x28f4('0x11')]);}else{logger[_0x28f4('0x12')](_0x28f4('0xa'),_0x58b0da,'request\x20sent');_0x533586(_0x2326b9[_0x28f4('0x13')]['message']);}})[_0x28f4('0x14')](function(_0x2d66ef){logger[_0x28f4('0xf')](_0x28f4('0xa'),_0x58b0da,_0x2d66ef);_0x1ac561(_0x2d66ef);});});}
\ No newline at end of file
index e19f328..6e75977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x112f=['delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','put','update'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x112f,0x11e));var _0xf112=function(_0x2068ed,_0xfd9570){_0x2068ed=_0x2068ed-0x0;var _0x35cf82=_0x112f[_0x2068ed];return _0x35cf82;};'use strict';var multer=require(_0xf112('0x0'));var util=require('util');var path=require(_0xf112('0x1'));var timeout=require('connect-timeout');var express=require(_0xf112('0x2'));var router=express[_0xf112('0x3')]();var auth=require(_0xf112('0x4'));var interaction=require(_0xf112('0x5'));var config=require('../../config/environment');var controller=require(_0xf112('0x6'));router['get']('/',auth[_0xf112('0x7')](),controller[_0xf112('0x8')]);router[_0xf112('0x9')](_0xf112('0xa'),auth[_0xf112('0x7')](),controller[_0xf112('0xb')]);router['post']('/',auth[_0xf112('0x7')](),controller['create']);router[_0xf112('0xc')](_0xf112('0xa'),auth[_0xf112('0x7')](),controller[_0xf112('0xd')]);router[_0xf112('0xe')](_0xf112('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x1a4b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer'];(function(_0x44acb9,_0x539825){var _0x1105c7=function(_0x5e6c4f){while(--_0x5e6c4f){_0x44acb9['push'](_0x44acb9['shift']());}};_0x1105c7(++_0x539825);}(_0x1a4b,0xe3));var _0xb1a4=function(_0x387a90,_0x4debb0){_0x387a90=_0x387a90-0x0;var _0x138784=_0x1a4b[_0x387a90];return _0x138784;};'use strict';var multer=require(_0xb1a4('0x0'));var util=require(_0xb1a4('0x1'));var path=require('path');var timeout=require(_0xb1a4('0x2'));var express=require(_0xb1a4('0x3'));var router=express[_0xb1a4('0x4')]();var auth=require(_0xb1a4('0x5'));var interaction=require(_0xb1a4('0x6'));var config=require(_0xb1a4('0x7'));var controller=require(_0xb1a4('0x8'));router[_0xb1a4('0x9')]('/',auth[_0xb1a4('0xa')](),controller[_0xb1a4('0xb')]);router['get'](_0xb1a4('0xc'),auth[_0xb1a4('0xa')](),controller[_0xb1a4('0xd')]);router[_0xb1a4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb1a4('0xf')](_0xb1a4('0xc'),auth[_0xb1a4('0xa')](),controller[_0xb1a4('0x10')]);router[_0xb1a4('0x11')](_0xb1a4('0xc'),auth[_0xb1a4('0xa')](),controller[_0xb1a4('0x12')]);module['exports']=router;
\ No newline at end of file
index 1310364..2b7bc0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c81=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3c81,0x102));var _0x13c8=function(_0x2c8694,_0x5b6d4b){_0x2c8694=_0x2c8694-0x0;var _0xe2c98b=_0x3c81[_0x2c8694];return _0xe2c98b;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13c8('0x2'),_0x13c8('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x13c8('0x4')]},'keyType':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x2'),_0x13c8('0x3'),_0x13c8('0x6'))},'keyContent':{'type':Sequelize[_0x13c8('0x4')]},'idField':{'type':Sequelize[_0x13c8('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6324=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0x139698,_0x241038){var _0x4ae0f2=function(_0x466e0b){while(--_0x466e0b){_0x139698['push'](_0x139698['shift']());}};_0x4ae0f2(++_0x241038);}(_0x6324,0x142));var _0x4632=function(_0x170cbb,_0x9093e){_0x170cbb=_0x170cbb-0x0;var _0x39fae4=_0x6324[_0x170cbb];return _0x39fae4;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'type':{'type':Sequelize[_0x4632('0x2')](_0x4632('0x3'),'variable',_0x4632('0x4'),'keyValue'),'defaultValue':_0x4632('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4632('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4632('0x3'),_0x4632('0x6'),_0x4632('0x4'))},'keyContent':{'type':Sequelize[_0x4632('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4632('0x5')]},'customField':{'type':Sequelize[_0x4632('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4632('0x5')]}};
\ No newline at end of file
index 80ca8ad..fc4eaf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d4=['show','rawAttributes','length','options','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','FreshdeskField','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch'];(function(_0x364288,_0x5e7b32){var _0x1e609d=function(_0x169a28){while(--_0x169a28){_0x364288['push'](_0x364288['shift']());}};_0x1e609d(++_0x5e7b32);}(_0xc6d4,0xa0));var _0x4c6d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xc6d4[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x4c6d('0x0'));var emlformat=require(_0x4c6d('0x1'));var rimraf=require(_0x4c6d('0x2'));var zipdir=require(_0x4c6d('0x3'));var jsonpatch=require(_0x4c6d('0x4'));var rp=require('request-promise');var moment=require(_0x4c6d('0x5'));var BPromise=require(_0x4c6d('0x6'));var Mustache=require(_0x4c6d('0x7'));var util=require(_0x4c6d('0x8'));var path=require(_0x4c6d('0x9'));var sox=require(_0x4c6d('0xa'));var csv=require('to-csv');var ejs=require(_0x4c6d('0xb'));var fs=require('fs');var _=require(_0x4c6d('0xc'));var squel=require(_0x4c6d('0xd'));var crypto=require(_0x4c6d('0xe'));var jsforce=require(_0x4c6d('0xf'));var deskjs=require(_0x4c6d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4c6d('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x4c6d('0x12'))(_0x4c6d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4c6d('0x14'))['db'];function respondWithStatusCode(_0x20895a,_0x22d134){_0x22d134=_0x22d134||0xcc;return function(_0x4687a2){if(_0x4687a2){return _0x20895a[_0x4c6d('0x15')](_0x22d134);}return _0x20895a[_0x4c6d('0x16')](_0x22d134)[_0x4c6d('0x17')]();};}function respondWithResult(_0x48473a,_0x4d8acf){_0x4d8acf=_0x4d8acf||0xc8;return function(_0x6491ef){if(_0x6491ef){return _0x48473a['status'](_0x4d8acf)['json'](_0x6491ef);}};}function respondWithFilteredResult(_0x1fecb9,_0x44c4f4){return function(_0x3665fb){if(_0x3665fb){var _0x1619cd=_0x3665fb[_0x4c6d('0x18')],_0x377add=_0x44c4f4[_0x4c6d('0x19')],_0xf41248=_0x44c4f4['offset']+_0x44c4f4[_0x4c6d('0x1a')],_0x4b0063;if(_0xf41248>=_0x1619cd){_0xf41248=_0x1619cd;_0x4b0063=0xc8;}else{_0x4b0063=0xce;}_0x1fecb9['status'](_0x4b0063);return _0x1fecb9[_0x4c6d('0x1b')](_0x4c6d('0x1c'),_0x377add+'-'+_0xf41248+'/'+_0x1619cd)[_0x4c6d('0x1d')](_0x3665fb);}return null;};}function patchUpdates(_0x558b1d){return function(_0x42a9a2){try{jsonpatch[_0x4c6d('0x1e')](_0x42a9a2,_0x558b1d,!![]);}catch(_0x568015){return BPromise[_0x4c6d('0x1f')](_0x568015);}return _0x42a9a2['save']();};}function saveUpdates(_0x1e32f8,_0x5d5287){return function(_0x3d8508){if(_0x3d8508){return _0x3d8508[_0x4c6d('0x20')](_0x1e32f8)[_0x4c6d('0x21')](function(_0x48e33b){return _0x48e33b;});}return null;};}function removeEntity(_0x4dd41d,_0x2c32d3){return function(_0x2a9b4d){if(_0x2a9b4d){return _0x2a9b4d[_0x4c6d('0x22')]()['then'](function(){_0x4dd41d[_0x4c6d('0x16')](0xcc)[_0x4c6d('0x17')]();});}};}function handleEntityNotFound(_0x2691bd,_0x55e71d){return function(_0x826e50){if(!_0x826e50){_0x2691bd[_0x4c6d('0x15')](0x194);}return _0x826e50;};}function handleError(_0x4e69a5,_0x29ad7b){_0x29ad7b=_0x29ad7b||0x1f4;return function(_0x54b00d){logger[_0x4c6d('0x23')](_0x54b00d[_0x4c6d('0x24')]);if(_0x54b00d[_0x4c6d('0x25')]){delete _0x54b00d[_0x4c6d('0x25')];}_0x4e69a5[_0x4c6d('0x16')](_0x29ad7b)[_0x4c6d('0x26')](_0x54b00d);};}exports['index']=function(_0x5696ce,_0xfb374d){var _0x5e1ba7={},_0x476850={},_0x1fae32={'count':0x0,'rows':[]};var _0xdbb549=db[_0x4c6d('0x27')]['rawAttributes'];_0x476850[_0x4c6d('0x28')]=_[_0x4c6d('0x29')](_0xdbb549);var _0x4df067={'dateStart':_0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x2b')],'dateEnd':_0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x2c')]};delete _0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x2b')];delete _0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x2c')];_0x476850[_0x4c6d('0x2a')]=_['keys'](_0x5696ce[_0x4c6d('0x2a')]);_0x476850['filters']=_[_0x4c6d('0x2d')](_0x476850[_0x4c6d('0x28')],_0x476850['query']);_0x5e1ba7['attributes']=_[_0x4c6d('0x2d')](_0x476850[_0x4c6d('0x28')],qs[_0x4c6d('0x2e')](_0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x2e')]));_0x5e1ba7[_0x4c6d('0x2f')]=_0x5e1ba7[_0x4c6d('0x2f')]['length']?_0x5e1ba7[_0x4c6d('0x2f')]:_0x476850[_0x4c6d('0x28')];if(!_0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x30')](_0x4c6d('0x31'))){_0x5e1ba7[_0x4c6d('0x1a')]=qs[_0x4c6d('0x1a')](_0x5696ce['query'][_0x4c6d('0x1a')]);_0x5e1ba7['offset']=qs['offset'](_0x5696ce['query'][_0x4c6d('0x19')]);}_0x5e1ba7[_0x4c6d('0x32')]=qs[_0x4c6d('0x33')](_0x5696ce[_0x4c6d('0x2a')]['sort']);_0x5e1ba7[_0x4c6d('0x34')]=qs[_0x4c6d('0x35')](_[_0x4c6d('0x36')](_0x5696ce[_0x4c6d('0x2a')],_0x476850['filters']));if(_0x4df067[_0x4c6d('0x2b')]){if(_0x4df067['dateEnd']){_0x4df067[_0x4c6d('0x2c')]=moment(_0x4df067[_0x4c6d('0x2c')])[_0x4c6d('0x37')](0x1,'day');}else{_0x4df067[_0x4c6d('0x2c')]=moment(_0x4df067[_0x4c6d('0x2b')])[_0x4c6d('0x37')](0x1,_0x4c6d('0x38'));}_['merge'](_0x5e1ba7[_0x4c6d('0x34')],{'createdAt':{'$gte':_0x4df067[_0x4c6d('0x2b')],'$lte':_0x4df067[_0x4c6d('0x2c')]}});}if(_0x5696ce['query'][_0x4c6d('0x39')]){_0x5e1ba7[_0x4c6d('0x34')]=_[_0x4c6d('0x3a')](_0x5e1ba7[_0x4c6d('0x34')],{'$or':_[_0x4c6d('0x3b')](_0xdbb549,function(_0x5ef08c){if(_0x5ef08c[_0x4c6d('0x3c')][_0x4c6d('0x3d')]!==_0x4c6d('0x3e')){var _0xb9b2e9={};_0xb9b2e9[_0x5ef08c[_0x4c6d('0x3f')]]={'$like':'%'+_0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x39')]+'%'};return _0xb9b2e9;}})});}_0x5e1ba7=_[_0x4c6d('0x3a')]({},_0x5e1ba7,_0x5696ce['options']);var _0x237493={'where':_0x5e1ba7[_0x4c6d('0x34')]};return db[_0x4c6d('0x27')]['count'](_0x237493)[_0x4c6d('0x21')](function(_0x541e30){_0x1fae32[_0x4c6d('0x18')]=_0x541e30;if(_0x5696ce[_0x4c6d('0x2a')][_0x4c6d('0x40')]){_0x5e1ba7[_0x4c6d('0x41')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x5e1ba7);})[_0x4c6d('0x21')](function(_0x20076d){_0x1fae32[_0x4c6d('0x42')]=_0x20076d;return _0x1fae32;})[_0x4c6d('0x21')](respondWithFilteredResult(_0xfb374d,_0x5e1ba7))[_0x4c6d('0x43')](handleError(_0xfb374d,null));};exports[_0x4c6d('0x44')]=function(_0x17a8e0,_0x18b572){var _0xdb7e1e={'raw':!![],'where':{'id':_0x17a8e0['params']['id']}},_0x2a8843={};_0x2a8843[_0x4c6d('0x28')]=_[_0x4c6d('0x29')](db[_0x4c6d('0x27')][_0x4c6d('0x45')]);_0x2a8843['query']=_['keys'](_0x17a8e0[_0x4c6d('0x2a')]);_0x2a8843[_0x4c6d('0x35')]=_[_0x4c6d('0x2d')](_0x2a8843['model'],_0x2a8843['query']);_0xdb7e1e['attributes']=_[_0x4c6d('0x2d')](_0x2a8843[_0x4c6d('0x28')],qs[_0x4c6d('0x2e')](_0x17a8e0[_0x4c6d('0x2a')][_0x4c6d('0x2e')]));_0xdb7e1e['attributes']=_0xdb7e1e[_0x4c6d('0x2f')][_0x4c6d('0x46')]?_0xdb7e1e[_0x4c6d('0x2f')]:_0x2a8843[_0x4c6d('0x28')];if(_0x17a8e0[_0x4c6d('0x2a')][_0x4c6d('0x40')]){_0xdb7e1e[_0x4c6d('0x41')]=[{'all':!![]}];}_0xdb7e1e=_[_0x4c6d('0x3a')]({},_0xdb7e1e,_0x17a8e0[_0x4c6d('0x47')]);return db[_0x4c6d('0x27')]['find'](_0xdb7e1e)[_0x4c6d('0x21')](handleEntityNotFound(_0x18b572,null))[_0x4c6d('0x21')](respondWithResult(_0x18b572,null))['catch'](handleError(_0x18b572,null));};exports['create']=function(_0x2c462d,_0x24e402){return db[_0x4c6d('0x27')][_0x4c6d('0x48')](_0x2c462d[_0x4c6d('0x49')],{})['then'](respondWithResult(_0x24e402,0xc9))[_0x4c6d('0x43')](handleError(_0x24e402,null));};exports['update']=function(_0x288e54,_0x2ca367){if(_0x288e54['body']['id']){delete _0x288e54[_0x4c6d('0x49')]['id'];}return db['FreshdeskField'][_0x4c6d('0x4a')]({'where':{'id':_0x288e54[_0x4c6d('0x4b')]['id']}})[_0x4c6d('0x21')](handleEntityNotFound(_0x2ca367,null))[_0x4c6d('0x21')](saveUpdates(_0x288e54[_0x4c6d('0x49')],null))['then'](respondWithResult(_0x2ca367,null))[_0x4c6d('0x43')](handleError(_0x2ca367,null));};exports['destroy']=function(_0x558241,_0x36b4ad){return db[_0x4c6d('0x27')]['find']({'where':{'id':_0x558241[_0x4c6d('0x4b')]['id']}})[_0x4c6d('0x21')](handleEntityNotFound(_0x36b4ad,null))[_0x4c6d('0x21')](removeEntity(_0x36b4ad,null))[_0x4c6d('0x43')](handleError(_0x36b4ad,null));};
\ No newline at end of file
+var _0xa16a=['catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','FreshdeskField','rawAttributes','model','query','dateEnd','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','dateStart','add','day','merge','filter','where','map','key','VIRTUAL','field','options','includeAll','include','rows'];(function(_0x35201e,_0x34341b){var _0x4bc5b7=function(_0x504ba7){while(--_0x504ba7){_0x35201e['push'](_0x35201e['shift']());}};_0x4bc5b7(++_0x34341b);}(_0xa16a,0x1aa));var _0xaa16=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0xa16a[_0x2ff739];return _0x12dc13;};'use strict';var pdf=require(_0xaa16('0x0'));var emlformat=require(_0xaa16('0x1'));var rimraf=require(_0xaa16('0x2'));var zipdir=require(_0xaa16('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa16('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaa16('0x5'));var util=require(_0xaa16('0x6'));var path=require('path');var sox=require(_0xaa16('0x7'));var csv=require(_0xaa16('0x8'));var ejs=require(_0xaa16('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaa16('0xa'));var crypto=require(_0xaa16('0xb'));var jsforce=require(_0xaa16('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xaa16('0x8'));var querystring=require(_0xaa16('0xd'));var Papa=require(_0xaa16('0xe'));var Redis=require(_0xaa16('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xaa16('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xaa16('0x11'));var db=require(_0xaa16('0x12'))['db'];function respondWithStatusCode(_0xac387,_0x9bffb5){_0x9bffb5=_0x9bffb5||0xcc;return function(_0x478422){if(_0x478422){return _0xac387[_0xaa16('0x13')](_0x9bffb5);}return _0xac387[_0xaa16('0x14')](_0x9bffb5)['end']();};}function respondWithResult(_0x174d04,_0x4a9712){_0x4a9712=_0x4a9712||0xc8;return function(_0x229136){if(_0x229136){return _0x174d04[_0xaa16('0x14')](_0x4a9712)['json'](_0x229136);}};}function respondWithFilteredResult(_0x42817d,_0x3293b5){return function(_0xac9142){if(_0xac9142){var _0x2a2493=_0xac9142[_0xaa16('0x15')],_0x2454a5=_0x3293b5[_0xaa16('0x16')],_0x184ab8=_0x3293b5[_0xaa16('0x16')]+_0x3293b5['limit'],_0x3df400;if(_0x184ab8>=_0x2a2493){_0x184ab8=_0x2a2493;_0x3df400=0xc8;}else{_0x3df400=0xce;}_0x42817d[_0xaa16('0x14')](_0x3df400);return _0x42817d[_0xaa16('0x17')](_0xaa16('0x18'),_0x2454a5+'-'+_0x184ab8+'/'+_0x2a2493)['json'](_0xac9142);}return null;};}function patchUpdates(_0x54b012){return function(_0x319435){try{jsonpatch['apply'](_0x319435,_0x54b012,!![]);}catch(_0xffb119){return BPromise[_0xaa16('0x19')](_0xffb119);}return _0x319435[_0xaa16('0x1a')]();};}function saveUpdates(_0x6c0828,_0x3e037a){return function(_0x5e10b2){if(_0x5e10b2){return _0x5e10b2[_0xaa16('0x1b')](_0x6c0828)[_0xaa16('0x1c')](function(_0x57e650){return _0x57e650;});}return null;};}function removeEntity(_0x29d367,_0x3cd575){return function(_0x148751){if(_0x148751){return _0x148751[_0xaa16('0x1d')]()[_0xaa16('0x1c')](function(){_0x29d367[_0xaa16('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x61f06,_0x428e81){return function(_0x2c97c9){if(!_0x2c97c9){_0x61f06['sendStatus'](0x194);}return _0x2c97c9;};}function handleError(_0x39b51b,_0x5bc300){_0x5bc300=_0x5bc300||0x1f4;return function(_0x40f55f){logger['error'](_0x40f55f[_0xaa16('0x1e')]);if(_0x40f55f[_0xaa16('0x1f')]){delete _0x40f55f[_0xaa16('0x1f')];}_0x39b51b['status'](_0x5bc300)[_0xaa16('0x20')](_0x40f55f);};}exports[_0xaa16('0x21')]=function(_0x5e0608,_0x28e7ac){var _0x1b2d40={},_0x2c54ec={},_0x5ca911={'count':0x0,'rows':[]};var _0x20cbf5=db[_0xaa16('0x22')][_0xaa16('0x23')];_0x2c54ec[_0xaa16('0x24')]=_['keys'](_0x20cbf5);var _0x4dd24b={'dateStart':_0x5e0608[_0xaa16('0x25')]['dateStart'],'dateEnd':_0x5e0608[_0xaa16('0x25')][_0xaa16('0x26')]};delete _0x5e0608[_0xaa16('0x25')]['dateStart'];delete _0x5e0608[_0xaa16('0x25')][_0xaa16('0x26')];_0x2c54ec['query']=_[_0xaa16('0x27')](_0x5e0608[_0xaa16('0x25')]);_0x2c54ec[_0xaa16('0x28')]=_['intersection'](_0x2c54ec[_0xaa16('0x24')],_0x2c54ec[_0xaa16('0x25')]);_0x1b2d40['attributes']=_[_0xaa16('0x29')](_0x2c54ec['model'],qs[_0xaa16('0x2a')](_0x5e0608[_0xaa16('0x25')][_0xaa16('0x2a')]));_0x1b2d40[_0xaa16('0x2b')]=_0x1b2d40['attributes'][_0xaa16('0x2c')]?_0x1b2d40[_0xaa16('0x2b')]:_0x2c54ec['model'];if(!_0x5e0608[_0xaa16('0x25')][_0xaa16('0x2d')](_0xaa16('0x2e'))){_0x1b2d40['limit']=qs[_0xaa16('0x2f')](_0x5e0608[_0xaa16('0x25')][_0xaa16('0x2f')]);_0x1b2d40['offset']=qs[_0xaa16('0x16')](_0x5e0608[_0xaa16('0x25')][_0xaa16('0x16')]);}_0x1b2d40[_0xaa16('0x30')]=qs[_0xaa16('0x31')](_0x5e0608['query'][_0xaa16('0x31')]);_0x1b2d40['where']=qs[_0xaa16('0x28')](_['pick'](_0x5e0608[_0xaa16('0x25')],_0x2c54ec[_0xaa16('0x28')]));if(_0x4dd24b[_0xaa16('0x32')]){if(_0x4dd24b[_0xaa16('0x26')]){_0x4dd24b[_0xaa16('0x26')]=moment(_0x4dd24b[_0xaa16('0x26')])[_0xaa16('0x33')](0x1,_0xaa16('0x34'));}else{_0x4dd24b[_0xaa16('0x26')]=moment(_0x4dd24b[_0xaa16('0x32')])[_0xaa16('0x33')](0x1,'day');}_[_0xaa16('0x35')](_0x1b2d40['where'],{'createdAt':{'$gte':_0x4dd24b[_0xaa16('0x32')],'$lte':_0x4dd24b['dateEnd']}});}if(_0x5e0608['query'][_0xaa16('0x36')]){_0x1b2d40[_0xaa16('0x37')]=_[_0xaa16('0x35')](_0x1b2d40['where'],{'$or':_[_0xaa16('0x38')](_0x20cbf5,function(_0x4e47e7){if(_0x4e47e7['type'][_0xaa16('0x39')]!==_0xaa16('0x3a')){var _0x4c0b0d={};_0x4c0b0d[_0x4e47e7[_0xaa16('0x3b')]]={'$like':'%'+_0x5e0608[_0xaa16('0x25')]['filter']+'%'};return _0x4c0b0d;}})});}_0x1b2d40=_[_0xaa16('0x35')]({},_0x1b2d40,_0x5e0608[_0xaa16('0x3c')]);var _0x56d0d2={'where':_0x1b2d40[_0xaa16('0x37')]};return db[_0xaa16('0x22')]['count'](_0x56d0d2)[_0xaa16('0x1c')](function(_0x24b699){_0x5ca911['count']=_0x24b699;if(_0x5e0608[_0xaa16('0x25')][_0xaa16('0x3d')]){_0x1b2d40[_0xaa16('0x3e')]=[{'all':!![]}];}return db[_0xaa16('0x22')]['findAll'](_0x1b2d40);})[_0xaa16('0x1c')](function(_0x501932){_0x5ca911[_0xaa16('0x3f')]=_0x501932;return _0x5ca911;})[_0xaa16('0x1c')](respondWithFilteredResult(_0x28e7ac,_0x1b2d40))[_0xaa16('0x40')](handleError(_0x28e7ac,null));};exports[_0xaa16('0x41')]=function(_0x4a9a0c,_0x5961ce){var _0x1c1939={'raw':!![],'where':{'id':_0x4a9a0c[_0xaa16('0x42')]['id']}},_0x111bb5={};_0x111bb5[_0xaa16('0x24')]=_[_0xaa16('0x27')](db[_0xaa16('0x22')][_0xaa16('0x23')]);_0x111bb5['query']=_[_0xaa16('0x27')](_0x4a9a0c[_0xaa16('0x25')]);_0x111bb5[_0xaa16('0x28')]=_[_0xaa16('0x29')](_0x111bb5['model'],_0x111bb5['query']);_0x1c1939[_0xaa16('0x2b')]=_[_0xaa16('0x29')](_0x111bb5['model'],qs['fields'](_0x4a9a0c[_0xaa16('0x25')][_0xaa16('0x2a')]));_0x1c1939['attributes']=_0x1c1939['attributes'][_0xaa16('0x2c')]?_0x1c1939[_0xaa16('0x2b')]:_0x111bb5[_0xaa16('0x24')];if(_0x4a9a0c['query'][_0xaa16('0x3d')]){_0x1c1939['include']=[{'all':!![]}];}_0x1c1939=_['merge']({},_0x1c1939,_0x4a9a0c[_0xaa16('0x3c')]);return db['FreshdeskField'][_0xaa16('0x43')](_0x1c1939)[_0xaa16('0x1c')](handleEntityNotFound(_0x5961ce,null))['then'](respondWithResult(_0x5961ce,null))['catch'](handleError(_0x5961ce,null));};exports[_0xaa16('0x44')]=function(_0x344961,_0x49ab8b){return db[_0xaa16('0x22')][_0xaa16('0x44')](_0x344961[_0xaa16('0x45')],{})[_0xaa16('0x1c')](respondWithResult(_0x49ab8b,0xc9))[_0xaa16('0x40')](handleError(_0x49ab8b,null));};exports[_0xaa16('0x1b')]=function(_0x2bbd25,_0x445947){if(_0x2bbd25[_0xaa16('0x45')]['id']){delete _0x2bbd25[_0xaa16('0x45')]['id'];}return db[_0xaa16('0x22')][_0xaa16('0x43')]({'where':{'id':_0x2bbd25[_0xaa16('0x42')]['id']}})[_0xaa16('0x1c')](handleEntityNotFound(_0x445947,null))[_0xaa16('0x1c')](saveUpdates(_0x2bbd25[_0xaa16('0x45')],null))[_0xaa16('0x1c')](respondWithResult(_0x445947,null))['catch'](handleError(_0x445947,null));};exports['destroy']=function(_0x1196d5,_0x1a86df){return db[_0xaa16('0x22')][_0xaa16('0x43')]({'where':{'id':_0x1196d5[_0xaa16('0x42')]['id']}})[_0xaa16('0x1c')](handleEntityNotFound(_0x1a86df,null))[_0xaa16('0x1c')](removeEntity(_0x1a86df,null))['catch'](handleError(_0x1a86df,null));};
\ No newline at end of file
index fffb1bc..f5d44f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7de=['int_freshdesk_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x4f91aa,_0x474dd7){var _0x458374=function(_0x41c863){while(--_0x41c863){_0x4f91aa['push'](_0x4f91aa['shift']());}};_0x458374(++_0x474dd7);}(_0xb7de,0xc7));var _0xeb7d=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xb7de[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var logger=require(_0xeb7d('0x2'))('api');var moment=require(_0xeb7d('0x3'));var BPromise=require(_0xeb7d('0x4'));var rp=require(_0xeb7d('0x5'));var attributes=require(_0xeb7d('0x6'));module[_0xeb7d('0x7')]=function(_0x57a908,_0x16d106){return _0x57a908[_0xeb7d('0x8')](_0xeb7d('0x9'),attributes,{'tableName':_0xeb7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e22=['exports','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','request-promise','./intFreshdeskField.attributes'];(function(_0x27aaa4,_0x4b8c94){var _0x49e25f=function(_0x430ef1){while(--_0x430ef1){_0x27aaa4['push'](_0x27aaa4['shift']());}};_0x49e25f(++_0x4b8c94);}(_0x8e22,0x11c));var _0x28e2=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x8e22[_0x5e2751];return _0x139a39;};'use strict';var _=require(_0x28e2('0x0'));var util=require(_0x28e2('0x1'));var logger=require(_0x28e2('0x2'))(_0x28e2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x28e2('0x4'));var attributes=require(_0x28e2('0x5'));module[_0x28e2('0x6')]=function(_0x303dfc,_0x3cddfd){return _0x303dfc['define']('FreshdeskField',attributes,{'tableName':_0x28e2('0x7'),'paranoid':![],'indexes':[{'name':_0x28e2('0x8'),'fields':['idField',_0x28e2('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fc50069..78aaf29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c02=['FreshdeskField,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xf67b94,_0x220f25){var _0x4d0bdf=function(_0x521490){while(--_0x521490){_0xf67b94['push'](_0xf67b94['shift']());}};_0x4d0bdf(++_0x220f25);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var moment=require(_0x20c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x20c0('0x2'));var fs=require('fs');var Redis=require(_0x20c0('0x3'));var db=require(_0x20c0('0x4'))['db'];var utils=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var jayson=require(_0x20c0('0x9'));var client=jayson[_0x20c0('0xa')][_0x20c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6408,_0x4e1dac,_0x5da127){return new BPromise(function(_0x4db532,_0x1e35e2){return client[_0x20c0('0xc')](_0x5d6408,_0x5da127)[_0x20c0('0xd')](function(_0x41a4af){logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4e1dac,'request\x20sent',JSON['stringify'](_0x41a4af));if(_0x41a4af[_0x20c0('0x10')]){if(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x11')]===0x1f4){logger[_0x20c0('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x4e1dac,_0x41a4af[_0x20c0('0x10')]['message']);return _0x1e35e2(_0x41a4af['error'][_0x20c0('0x12')]);}logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);return _0x4db532(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);}else{logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');_0x4db532(_0x41a4af[_0x20c0('0x13')][_0x20c0('0x12')]);}})[_0x20c0('0x14')](function(_0x46b9e5){logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x46b9e5);_0x1e35e2(_0x46b9e5);});});}
\ No newline at end of file
+var _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x796a03,_0x3fd9a9){var _0x44a665=function(_0x4598fe){while(--_0x4598fe){_0x796a03['push'](_0x796a03['shift']());}};_0x44a665(++_0x3fd9a9);}(_0x54f3,0x120));var _0x354f=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x54f3[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});}
\ No newline at end of file
index 2251012..e7dfb03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a0b=['./intSalesforceAccount.controller','index','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9a0b,0x1f3));var _0xb9a0=function(_0x23545f,_0x32837c){_0x23545f=_0x23545f-0x0;var _0x1b7da5=_0x9a0b[_0x23545f];return _0x1b7da5;};'use strict';var multer=require('multer');var util=require(_0xb9a0('0x0'));var path=require(_0xb9a0('0x1'));var timeout=require(_0xb9a0('0x2'));var express=require(_0xb9a0('0x3'));var router=express[_0xb9a0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9a0('0x5'));var config=require(_0xb9a0('0x6'));var controller=require(_0xb9a0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb9a0('0x8')]);router[_0xb9a0('0x9')](_0xb9a0('0xa'),auth[_0xb9a0('0xb')](),controller[_0xb9a0('0xc')]);router[_0xb9a0('0x9')]('/:id/configurations',auth[_0xb9a0('0xb')](),controller[_0xb9a0('0xd')]);router['get'](_0xb9a0('0xe'),auth[_0xb9a0('0xb')](),controller[_0xb9a0('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb9a0('0x10')]);router['post'](_0xb9a0('0x11'),auth['isAuthenticated'](),controller[_0xb9a0('0x12')]);router[_0xb9a0('0x13')]('/:id',auth[_0xb9a0('0xb')](),controller[_0xb9a0('0x14')]);router['delete'](_0xb9a0('0xa'),auth[_0xb9a0('0xb')](),controller[_0xb9a0('0x15')]);module[_0xb9a0('0x16')]=router;
\ No newline at end of file
+var _0x91b4=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','destroy','multer'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x91b4,0x1b4));var _0x491b=function(_0xd0910d,_0x4ab688){_0xd0910d=_0xd0910d-0x0;var _0x209614=_0x91b4[_0xd0910d];return _0x209614;};'use strict';var multer=require(_0x491b('0x0'));var util=require(_0x491b('0x1'));var path=require(_0x491b('0x2'));var timeout=require(_0x491b('0x3'));var express=require(_0x491b('0x4'));var router=express[_0x491b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x491b('0x6'));var config=require(_0x491b('0x7'));var controller=require(_0x491b('0x8'));router[_0x491b('0x9')]('/',auth[_0x491b('0xa')](),controller[_0x491b('0xb')]);router[_0x491b('0x9')](_0x491b('0xc'),auth[_0x491b('0xa')](),controller[_0x491b('0xd')]);router['get'](_0x491b('0xe'),auth['isAuthenticated'](),controller[_0x491b('0xf')]);router['get']('/:id/fields',auth[_0x491b('0xa')](),controller[_0x491b('0x10')]);router[_0x491b('0x11')]('/',auth[_0x491b('0xa')](),controller[_0x491b('0x12')]);router[_0x491b('0x11')](_0x491b('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x491b('0x13')]('/:id',auth[_0x491b('0xa')](),controller[_0x491b('0x14')]);router[_0x491b('0x15')](_0x491b('0xc'),auth[_0x491b('0xa')](),controller[_0x491b('0x16')]);module['exports']=router;
\ No newline at end of file
index 35d3000..308ad82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52d9=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x52d9,0x1a3));var _0x952d=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0x52d9[_0x2dea58];return _0x2b23c2;};'use strict';var Sequelize=require('sequelize');module[_0x952d('0x0')]={'name':{'type':Sequelize[_0x952d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x952d('0x1')],'unique':_0x952d('0x2')},'remoteUri':{'type':Sequelize[_0x952d('0x1')]},'password':{'type':Sequelize[_0x952d('0x1')]},'clientId':{'type':Sequelize[_0x952d('0x1')]},'clientSecret':{'type':Sequelize[_0x952d('0x1')]},'securityToken':{'type':Sequelize[_0x952d('0x1')]},'serverUrl':{'type':Sequelize[_0x952d('0x1')]},'type':{'type':Sequelize[_0x952d('0x3')](_0x952d('0x4'),_0x952d('0x5')),'defaultValue':_0x952d('0x4')}};
\ No newline at end of file
+var _0x6366=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x567ea1,_0x3cb026){var _0x20964d=function(_0x2a7102){while(--_0x2a7102){_0x567ea1['push'](_0x567ea1['shift']());}};_0x20964d(++_0x3cb026);}(_0x6366,0x129));var _0x6636=function(_0x26123e,_0x558081){_0x26123e=_0x26123e-0x0;var _0x259266=_0x6366[_0x26123e];return _0x259266;};'use strict';var Sequelize=require(_0x6636('0x0'));module[_0x6636('0x1')]={'name':{'type':Sequelize[_0x6636('0x2')]},'description':{'type':Sequelize[_0x6636('0x2')]},'username':{'type':Sequelize[_0x6636('0x2')],'unique':_0x6636('0x3')},'remoteUri':{'type':Sequelize[_0x6636('0x2')]},'password':{'type':Sequelize[_0x6636('0x2')]},'clientId':{'type':Sequelize[_0x6636('0x2')]},'clientSecret':{'type':Sequelize[_0x6636('0x2')]},'securityToken':{'type':Sequelize[_0x6636('0x2')]},'serverUrl':{'type':Sequelize[_0x6636('0x2')]},'type':{'type':Sequelize[_0x6636('0x4')](_0x6636('0x5'),_0x6636('0x6')),'defaultValue':_0x6636('0x5')}};
\ No newline at end of file
index d995a3b..175fea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6944=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','apply','reject','save','destroy','stack','name','send','SalesforceAccount','rawAttributes','model','keys','query','dateStart','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','dateEnd','add','day','filter','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','show','params','length','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','map','options','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','type','Subjects','SalesforceField','getFields','remoteUri','clientSecret','username','securityToken','concat','sobject','Task','describe','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Type','remove','includes','label','custom','picklistValues','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','squel','crypto','to-csv'];(function(_0x1f04df,_0x17de78){var _0x39f4e7=function(_0x1ddbb8){while(--_0x1ddbb8){_0x1f04df['push'](_0x1f04df['shift']());}};_0x39f4e7(++_0x17de78);}(_0x6944,0x1d1));var _0x4694=function(_0x38f6ee,_0xf06a6c){_0x38f6ee=_0x38f6ee-0x0;var _0x49aeef=_0x6944[_0x38f6ee];return _0x49aeef;};'use strict';var pdf=require(_0x4694('0x0'));var emlformat=require(_0x4694('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4694('0x2'));var rp=require('request-promise');var moment=require(_0x4694('0x3'));var BPromise=require(_0x4694('0x4'));var Mustache=require(_0x4694('0x5'));var util=require('util');var path=require(_0x4694('0x6'));var sox=require(_0x4694('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4694('0x8'));var crypto=require(_0x4694('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4694('0xa'));var querystring=require(_0x4694('0xb'));var Papa=require(_0x4694('0xc'));var Redis=require(_0x4694('0xd'));var qs=require(_0x4694('0xe'));var logger=require(_0x4694('0xf'))('api');var utils=require(_0x4694('0x10'));var config=require(_0x4694('0x11'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4694('0x12'));var jayson=require(_0x4694('0x13'));var client=jayson[_0x4694('0x14')][_0x4694('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x1d765c,_0x477bb1,_0x20fbc6,_0x505acd){return new BPromise(function(_0x37c357,_0x243244){var _0x2206c0=_0x505acd||client;return _0x2206c0[_0x4694('0x16')](_0x1d765c,_0x20fbc6)[_0x4694('0x17')](function(_0x269748){logger[_0x4694('0x18')](_0x4694('0x19'),_0x477bb1,_0x4694('0x1a'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x477bb1,_0x4694('0x1a'),JSON[_0x4694('0x1b')](_0x269748));if(_0x269748[_0x4694('0x1c')]){if(_0x269748['error']['code']===0x1f4){logger['error'](_0x4694('0x19'),_0x477bb1,_0x269748[_0x4694('0x1c')][_0x4694('0x1d')]);return _0x243244(_0x269748['error']['message']);}logger[_0x4694('0x1c')](_0x4694('0x19'),_0x477bb1,_0x269748['error'][_0x4694('0x1d')]);return _0x37c357(_0x269748[_0x4694('0x1c')]['message']);}else{logger['info'](_0x4694('0x19'),_0x477bb1,'request\x20sent');_0x37c357(_0x269748[_0x4694('0x1e')][_0x4694('0x1d')]);}})[_0x4694('0x1f')](function(_0x5f59fb){logger[_0x4694('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0x477bb1,_0x5f59fb);_0x243244(_0x5f59fb);});});}function respondWithStatusCode(_0x2ada10,_0x591551){_0x591551=_0x591551||0xcc;return function(_0x2eaeaa){if(_0x2eaeaa){return _0x2ada10[_0x4694('0x20')](_0x591551);}return _0x2ada10[_0x4694('0x21')](_0x591551)[_0x4694('0x22')]();};}function respondWithResult(_0x56d10e,_0x34c010){_0x34c010=_0x34c010||0xc8;return function(_0x21a42a){if(_0x21a42a){return _0x56d10e['status'](_0x34c010)['json'](_0x21a42a);}};}function respondWithFilteredResult(_0xeecd13,_0x8afaf7){return function(_0x39371b){if(_0x39371b){var _0x1c24f9=_0x39371b[_0x4694('0x23')],_0x3ff9d0=_0x8afaf7[_0x4694('0x24')],_0x5a455d=_0x8afaf7[_0x4694('0x24')]+_0x8afaf7[_0x4694('0x25')],_0x132b0d;if(_0x5a455d>=_0x1c24f9){_0x5a455d=_0x1c24f9;_0x132b0d=0xc8;}else{_0x132b0d=0xce;}_0xeecd13[_0x4694('0x21')](_0x132b0d);return _0xeecd13[_0x4694('0x26')]('Content-Range',_0x3ff9d0+'-'+_0x5a455d+'/'+_0x1c24f9)['json'](_0x39371b);}return null;};}function patchUpdates(_0x44b4eb){return function(_0xc610f8){try{jsonpatch[_0x4694('0x27')](_0xc610f8,_0x44b4eb,!![]);}catch(_0x1ee15c){return BPromise[_0x4694('0x28')](_0x1ee15c);}return _0xc610f8[_0x4694('0x29')]();};}function saveUpdates(_0x5a07ca,_0xf59feb){return function(_0x130ab8){if(_0x130ab8){return _0x130ab8['update'](_0x5a07ca)[_0x4694('0x17')](function(_0x366796){return _0x366796;});}return null;};}function removeEntity(_0x18ae87,_0x39152d){return function(_0x319e45){if(_0x319e45){return _0x319e45[_0x4694('0x2a')]()[_0x4694('0x17')](function(){_0x18ae87['status'](0xcc)[_0x4694('0x22')]();});}};}function handleEntityNotFound(_0x536d5a,_0x2601d9){return function(_0x481dd0){if(!_0x481dd0){_0x536d5a[_0x4694('0x20')](0x194);}return _0x481dd0;};}function handleError(_0x373c29,_0x24d8d0){_0x24d8d0=_0x24d8d0||0x1f4;return function(_0x51790a){logger[_0x4694('0x1c')](_0x51790a[_0x4694('0x2b')]);if(_0x51790a[_0x4694('0x2c')]){delete _0x51790a['name'];}_0x373c29[_0x4694('0x21')](_0x24d8d0)[_0x4694('0x2d')](_0x51790a);};}exports['index']=function(_0x55b8aa,_0x1af406){var _0x4e9e96={},_0x1cc274={},_0x2343d0={'count':0x0,'rows':[]};var _0x5eaeee=db[_0x4694('0x2e')][_0x4694('0x2f')];_0x1cc274[_0x4694('0x30')]=_[_0x4694('0x31')](_0x5eaeee);var _0x38b9e6={'dateStart':_0x55b8aa[_0x4694('0x32')]['dateStart'],'dateEnd':_0x55b8aa['query']['dateEnd']};delete _0x55b8aa['query'][_0x4694('0x33')];delete _0x55b8aa['query']['dateEnd'];_0x1cc274[_0x4694('0x32')]=_[_0x4694('0x31')](_0x55b8aa[_0x4694('0x32')]);_0x1cc274[_0x4694('0x34')]=_['intersection'](_0x1cc274[_0x4694('0x30')],_0x1cc274[_0x4694('0x32')]);_0x4e9e96[_0x4694('0x35')]=_[_0x4694('0x36')](_0x1cc274['model'],qs['fields'](_0x55b8aa[_0x4694('0x32')][_0x4694('0x37')]));_0x4e9e96[_0x4694('0x35')]=_0x4e9e96[_0x4694('0x35')]['length']?_0x4e9e96[_0x4694('0x35')]:_0x1cc274[_0x4694('0x30')];if(!_0x55b8aa[_0x4694('0x32')][_0x4694('0x38')](_0x4694('0x39'))){_0x4e9e96[_0x4694('0x25')]=qs['limit'](_0x55b8aa['query'][_0x4694('0x25')]);_0x4e9e96['offset']=qs[_0x4694('0x24')](_0x55b8aa[_0x4694('0x32')]['offset']);}_0x4e9e96[_0x4694('0x3a')]=qs[_0x4694('0x3b')](_0x55b8aa[_0x4694('0x32')][_0x4694('0x3b')]);_0x4e9e96[_0x4694('0x3c')]=qs[_0x4694('0x34')](_[_0x4694('0x3d')](_0x55b8aa[_0x4694('0x32')],_0x1cc274[_0x4694('0x34')]));if(_0x38b9e6[_0x4694('0x33')]){if(_0x38b9e6[_0x4694('0x3e')]){_0x38b9e6[_0x4694('0x3e')]=moment(_0x38b9e6[_0x4694('0x3e')])[_0x4694('0x3f')](0x1,'day');}else{_0x38b9e6[_0x4694('0x3e')]=moment(_0x38b9e6[_0x4694('0x33')])[_0x4694('0x3f')](0x1,_0x4694('0x40'));}_['merge'](_0x4e9e96[_0x4694('0x3c')],{'createdAt':{'$gte':_0x38b9e6[_0x4694('0x33')],'$lte':_0x38b9e6['dateEnd']}});}if(_0x55b8aa['query'][_0x4694('0x41')]){_0x4e9e96[_0x4694('0x3c')]=_['merge'](_0x4e9e96[_0x4694('0x3c')],{'$or':_['map'](_0x5eaeee,function(_0x32be02){if(_0x32be02['type'][_0x4694('0x42')]!==_0x4694('0x43')){var _0x5066f4={};_0x5066f4[_0x32be02[_0x4694('0x44')]]={'$like':'%'+_0x55b8aa[_0x4694('0x32')]['filter']+'%'};return _0x5066f4;}})});}_0x4e9e96=_[_0x4694('0x45')]({},_0x4e9e96,_0x55b8aa['options']);var _0x43d6bf={'where':_0x4e9e96[_0x4694('0x3c')]};return db[_0x4694('0x2e')]['count'](_0x43d6bf)[_0x4694('0x17')](function(_0x224991){_0x2343d0[_0x4694('0x23')]=_0x224991;if(_0x55b8aa['query'][_0x4694('0x46')]){_0x4e9e96[_0x4694('0x47')]=[{'all':!![]}];}return db[_0x4694('0x2e')][_0x4694('0x48')](_0x4e9e96);})[_0x4694('0x17')](function(_0x55650d){_0x2343d0[_0x4694('0x49')]=_0x55650d;return _0x2343d0;})[_0x4694('0x17')](respondWithFilteredResult(_0x1af406,_0x4e9e96))[_0x4694('0x1f')](handleError(_0x1af406,null));};exports[_0x4694('0x4a')]=function(_0x18729b,_0x15bf00){var _0x577034={'raw':![],'where':{'id':_0x18729b[_0x4694('0x4b')]['id']}},_0x4a0ab2={};_0x4a0ab2['model']=_['keys'](db[_0x4694('0x2e')]['rawAttributes']);_0x4a0ab2[_0x4694('0x32')]=_[_0x4694('0x31')](_0x18729b[_0x4694('0x32')]);_0x4a0ab2[_0x4694('0x34')]=_[_0x4694('0x36')](_0x4a0ab2['model'],_0x4a0ab2[_0x4694('0x32')]);_0x577034[_0x4694('0x35')]=_[_0x4694('0x36')](_0x4a0ab2[_0x4694('0x30')],qs[_0x4694('0x37')](_0x18729b[_0x4694('0x32')]['fields']));_0x577034[_0x4694('0x35')]=_0x577034[_0x4694('0x35')][_0x4694('0x4c')]?_0x577034['attributes']:_0x4a0ab2[_0x4694('0x30')];if(_0x18729b[_0x4694('0x32')][_0x4694('0x46')]){_0x577034['include']=[{'all':!![]}];}_0x577034=_[_0x4694('0x45')]({},_0x577034,_0x18729b['options']);return db['SalesforceAccount'][_0x4694('0x4d')](_0x577034)[_0x4694('0x17')](handleEntityNotFound(_0x15bf00,null))[_0x4694('0x17')](respondWithResult(_0x15bf00,null))['catch'](handleError(_0x15bf00,null));};exports['create']=function(_0x311467,_0x3b0164){return db[_0x4694('0x2e')][_0x4694('0x4e')](_0x311467[_0x4694('0x4f')],{})[_0x4694('0x17')](respondWithResult(_0x3b0164,0xc9))[_0x4694('0x1f')](handleError(_0x3b0164,null));};exports[_0x4694('0x50')]=function(_0x4f65cb,_0xf232a9){if(_0x4f65cb[_0x4694('0x4f')]['id']){delete _0x4f65cb[_0x4694('0x4f')]['id'];}return db[_0x4694('0x2e')]['find']({'where':{'id':_0x4f65cb[_0x4694('0x4b')]['id']}})[_0x4694('0x17')](handleEntityNotFound(_0xf232a9,null))[_0x4694('0x17')](saveUpdates(_0x4f65cb[_0x4694('0x4f')],null))[_0x4694('0x17')](respondWithResult(_0xf232a9,null))['catch'](handleError(_0xf232a9,null));};exports['destroy']=function(_0x5bd30e,_0x19e52a){return db[_0x4694('0x2e')][_0x4694('0x4d')]({'where':{'id':_0x5bd30e[_0x4694('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19e52a,null))[_0x4694('0x17')](removeEntity(_0x19e52a,null))[_0x4694('0x1f')](handleError(_0x19e52a,null));};exports[_0x4694('0x51')]=function(_0x43f796,_0x390ae6,_0x17f1b6){var _0x4e26be={};var _0x303c4c={};var _0x114e9a;var _0x205acb;return db[_0x4694('0x2e')][_0x4694('0x52')]({'where':{'id':_0x43f796[_0x4694('0x4b')]['id']}})[_0x4694('0x17')](handleEntityNotFound(_0x390ae6,null))[_0x4694('0x17')](function(_0xb8a28f){if(_0xb8a28f){_0x114e9a=_0xb8a28f;_0x303c4c[_0x4694('0x30')]=_[_0x4694('0x31')](db[_0x4694('0x53')]['rawAttributes']);_0x303c4c[_0x4694('0x32')]=_[_0x4694('0x31')](_0x43f796[_0x4694('0x32')]);_0x303c4c['filters']=_[_0x4694('0x36')](_0x303c4c[_0x4694('0x30')],_0x303c4c[_0x4694('0x32')]);_0x4e26be[_0x4694('0x35')]=_['intersection'](_0x303c4c[_0x4694('0x30')],qs[_0x4694('0x37')](_0x43f796['query']['fields']));_0x4e26be['attributes']=_0x4e26be['attributes'][_0x4694('0x4c')]?_0x4e26be[_0x4694('0x35')]:_0x303c4c[_0x4694('0x30')];_0x4e26be[_0x4694('0x3a')]=qs[_0x4694('0x3b')](_0x43f796[_0x4694('0x32')][_0x4694('0x3b')]);_0x4e26be[_0x4694('0x3c')]=qs[_0x4694('0x34')](_['pick'](_0x43f796['query'],_0x303c4c[_0x4694('0x34')]));if(_0x43f796['query'][_0x4694('0x41')]){_0x4e26be[_0x4694('0x3c')]=_[_0x4694('0x45')](_0x4e26be['where'],{'$or':_[_0x4694('0x54')](_0x4e26be[_0x4694('0x35')],function(_0x9532b0){var _0x502423={};_0x502423[_0x9532b0]={'$like':'%'+_0x43f796[_0x4694('0x32')][_0x4694('0x41')]+'%'};return _0x502423;})});}_0x4e26be=_[_0x4694('0x45')]({},_0x4e26be,_0x43f796[_0x4694('0x55')]);return _0x114e9a['getConfigurations'](_0x4e26be);}})['then'](function(_0x193625){if(_0x193625){_0x205acb=_0x193625[_0x4694('0x4c')];if(!_0x43f796['query'][_0x4694('0x38')]('nolimit')){_0x4e26be[_0x4694('0x25')]=qs[_0x4694('0x25')](_0x43f796['query'][_0x4694('0x25')]);_0x4e26be['offset']=qs['offset'](_0x43f796[_0x4694('0x32')]['offset']);}return _0x114e9a[_0x4694('0x51')](_0x4e26be);}})[_0x4694('0x17')](function(_0x7302c8){if(_0x7302c8){return _0x7302c8?{'count':_0x205acb,'rows':_0x7302c8}:null;}})[_0x4694('0x17')](respondWithResult(_0x390ae6,null))['catch'](handleError(_0x390ae6,null));};exports[_0x4694('0x56')]=function(_0x365231,_0x1da2af,_0x2d7bda){if(_0x365231[_0x4694('0x4f')]['id']){delete _0x365231[_0x4694('0x4f')]['id'];}return db[_0x4694('0x2e')][_0x4694('0x52')]({'where':{'id':_0x365231['params']['id']}})[_0x4694('0x17')](handleEntityNotFound(_0x1da2af,null))[_0x4694('0x17')](function(_0x108936){if(_0x108936){_0x365231[_0x4694('0x4f')][_0x4694('0x57')]=_0x108936['id'];_0x365231[_0x4694('0x4f')]['Subjects']=integrations[_0x4694('0x58')](_0x365231[_0x4694('0x4f')]['channel'],_0x365231[_0x4694('0x4f')]['type']);_0x365231[_0x4694('0x4f')][_0x4694('0x59')]=integrations[_0x4694('0x5a')](_0x365231[_0x4694('0x4f')][_0x4694('0x5b')],_0x365231['body'][_0x4694('0x5c')]);return db['SalesforceConfiguration'][_0x4694('0x4e')](_0x365231['body'],{'include':[{'model':db['SalesforceField'],'as':_0x4694('0x5d')},{'model':db[_0x4694('0x5e')],'as':_0x4694('0x59')}]});}return null;})[_0x4694('0x17')](respondWithResult(_0x1da2af,null))[_0x4694('0x1f')](handleError(_0x1da2af,null));};exports[_0x4694('0x5f')]=function(_0x152cd5,_0x595fbd,_0x5515fb){var _0x382a18;return db['SalesforceAccount']['findOne']({'where':{'id':_0x152cd5['params']['id']},'attributes':['id',_0x4694('0x60'),'clientId',_0x4694('0x61'),_0x4694('0x62'),'password',_0x4694('0x63')]})[_0x4694('0x17')](handleEntityNotFound(_0x595fbd,null))['then'](function(_0x90127c){if(_0x90127c){_0x382a18=new jsforce['Connection']({'oauth2':{'loginUrl':_0x90127c[_0x4694('0x60')],'clientId':_0x90127c['clientId'],'clientSecret':_0x90127c[_0x4694('0x61')]}});return _0x382a18['login'](_0x90127c[_0x4694('0x62')],_0x90127c['password'][_0x4694('0x64')](_0x90127c[_0x4694('0x63')]));}})[_0x4694('0x17')](function(_0x532f12){if(_0x532f12){return _0x382a18[_0x4694('0x65')](_0x4694('0x66'))[_0x4694('0x67')]();}})[_0x4694('0x17')](function(_0x47540d){var _0x14b8fc=[_0x4694('0x68'),_0x4694('0x69'),_0x4694('0x6a'),'CallType',_0x4694('0x6b'),'Priority','Status',_0x4694('0x6c')];if(_0x47540d){_[_0x4694('0x6d')](_0x47540d[_0x4694('0x37')],function(_0x3475c5){return _0x3475c5['custom']===![]&&!_0x14b8fc[_0x4694('0x6e')](_0x3475c5[_0x4694('0x2c')]);});return{'count':_0x47540d[_0x4694('0x37')][_0x4694('0x4c')],'rows':_[_0x4694('0x54')](_0x47540d[_0x4694('0x37')],function(_0x59f595){return{'id':_0x59f595[_0x4694('0x2c')],'name':_0x59f595[_0x4694('0x6f')],'custom':_0x59f595[_0x4694('0x70')],'options':_0x59f595[_0x4694('0x71')]?_[_0x4694('0x54')](_0x59f595['picklistValues'],function(_0x4f9e24){return{'name':_0x4f9e24[_0x4694('0x6f')],'value':_0x4f9e24[_0x4694('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x595fbd,null))[_0x4694('0x1f')](function(_0x5f4872){var _0xa93787=_0x152cd5[_0x4694('0x32')][_0x4694('0x73')]?0x1f4:_0x5f4872[_0x4694('0x74')]||0x1f4;logger[_0x4694('0x1c')](_0x4694('0x75'),_0x4694('0x5f'),_0xa93787,JSON[_0x4694('0x1b')](_0x5f4872));delete _0x5f4872[_0x4694('0x2c')];if(_0xa93787===0x191){_0xa93787=0x190;}_0x595fbd[_0x4694('0x21')](_0xa93787)[_0x4694('0x2d')](_0x152cd5[_0x4694('0x32')]['test']?{'message':_0x4694('0x76'),'statusCode':_0x5f4872[_0x4694('0x74')]}:_0x5f4872);});};
\ No newline at end of file
+var _0x823a=['save','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','model','keys','query','dateStart','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','dateEnd','add','day','filter','merge','map','type','field','include','findAll','rows','show','params','options','find','create','update','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','SalesforceConfiguration','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','Connection','login','concat','sobject','describe','CallDisposition','CallObject','CallType','IsArchived','Priority','Status','Type','remove','label','custom','picklistValues','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','Content-Range','json','apply'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x823a,0xc1));var _0xa823=function(_0x4f14bd,_0x28b9db){_0x4f14bd=_0x4f14bd-0x0;var _0x515b8b=_0x823a[_0x4f14bd];return _0x515b8b;};'use strict';var pdf=require(_0xa823('0x0'));var emlformat=require(_0xa823('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa823('0x2'));var jsonpatch=require(_0xa823('0x3'));var rp=require(_0xa823('0x4'));var moment=require('moment');var BPromise=require(_0xa823('0x5'));var Mustache=require(_0xa823('0x6'));var util=require('util');var path=require(_0xa823('0x7'));var sox=require(_0xa823('0x8'));var csv=require(_0xa823('0x9'));var ejs=require(_0xa823('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa823('0xb'));var jsforce=require(_0xa823('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa823('0x9'));var querystring=require(_0xa823('0xd'));var Papa=require(_0xa823('0xe'));var Redis=require(_0xa823('0xf'));var qs=require(_0xa823('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa823('0x11'));var db=require(_0xa823('0x12'))['db'];var integrations=require(_0xa823('0x13'));var jayson=require(_0xa823('0x14'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a74e3,_0x532aa5,_0x49331e,_0x1cba80){return new BPromise(function(_0x14afd5,_0x236a10){var _0x23c71a=_0x1cba80||client;return _0x23c71a[_0xa823('0x15')](_0x3a74e3,_0x49331e)[_0xa823('0x16')](function(_0xdef63b){logger[_0xa823('0x17')](_0xa823('0x18'),_0x532aa5,_0xa823('0x19'));logger[_0xa823('0x1a')](_0xa823('0x1b'),_0x532aa5,_0xa823('0x19'),JSON[_0xa823('0x1c')](_0xdef63b));if(_0xdef63b[_0xa823('0x1d')]){if(_0xdef63b[_0xa823('0x1d')][_0xa823('0x1e')]===0x1f4){logger[_0xa823('0x1d')]('SalesforceAccount,\x20%s,\x20%s',_0x532aa5,_0xdef63b[_0xa823('0x1d')][_0xa823('0x1f')]);return _0x236a10(_0xdef63b[_0xa823('0x1d')][_0xa823('0x1f')]);}logger[_0xa823('0x1d')](_0xa823('0x18'),_0x532aa5,_0xdef63b[_0xa823('0x1d')]['message']);return _0x14afd5(_0xdef63b[_0xa823('0x1d')][_0xa823('0x1f')]);}else{logger[_0xa823('0x17')](_0xa823('0x18'),_0x532aa5,_0xa823('0x19'));_0x14afd5(_0xdef63b[_0xa823('0x20')][_0xa823('0x1f')]);}})[_0xa823('0x21')](function(_0x8725e6){logger[_0xa823('0x1d')](_0xa823('0x18'),_0x532aa5,_0x8725e6);_0x236a10(_0x8725e6);});});}function respondWithStatusCode(_0x46aa12,_0x15caa8){_0x15caa8=_0x15caa8||0xcc;return function(_0x3df575){if(_0x3df575){return _0x46aa12[_0xa823('0x22')](_0x15caa8);}return _0x46aa12[_0xa823('0x23')](_0x15caa8)['end']();};}function respondWithResult(_0x4a6cfa,_0x1523e2){_0x1523e2=_0x1523e2||0xc8;return function(_0xbaf730){if(_0xbaf730){return _0x4a6cfa[_0xa823('0x23')](_0x1523e2)['json'](_0xbaf730);}};}function respondWithFilteredResult(_0xdcafde,_0x438315){return function(_0x37733e){if(_0x37733e){var _0x2995ff=_0x37733e[_0xa823('0x24')],_0x233be7=_0x438315['offset'],_0x5a6afd=_0x438315[_0xa823('0x25')]+_0x438315['limit'],_0x46f1b2;if(_0x5a6afd>=_0x2995ff){_0x5a6afd=_0x2995ff;_0x46f1b2=0xc8;}else{_0x46f1b2=0xce;}_0xdcafde[_0xa823('0x23')](_0x46f1b2);return _0xdcafde['set'](_0xa823('0x26'),_0x233be7+'-'+_0x5a6afd+'/'+_0x2995ff)[_0xa823('0x27')](_0x37733e);}return null;};}function patchUpdates(_0x328077){return function(_0x695462){try{jsonpatch[_0xa823('0x28')](_0x695462,_0x328077,!![]);}catch(_0x804043){return BPromise['reject'](_0x804043);}return _0x695462[_0xa823('0x29')]();};}function saveUpdates(_0x29de7c,_0x3ae2b1){return function(_0x347298){if(_0x347298){return _0x347298['update'](_0x29de7c)[_0xa823('0x16')](function(_0x2b4445){return _0x2b4445;});}return null;};}function removeEntity(_0x37c9d6,_0x2ab55c){return function(_0x5184d0){if(_0x5184d0){return _0x5184d0[_0xa823('0x2a')]()[_0xa823('0x16')](function(){_0x37c9d6[_0xa823('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25df62,_0x13025e){return function(_0x2b5ef2){if(!_0x2b5ef2){_0x25df62['sendStatus'](0x194);}return _0x2b5ef2;};}function handleError(_0x102985,_0x3356a7){_0x3356a7=_0x3356a7||0x1f4;return function(_0x5f5c67){logger[_0xa823('0x1d')](_0x5f5c67[_0xa823('0x2b')]);if(_0x5f5c67[_0xa823('0x2c')]){delete _0x5f5c67[_0xa823('0x2c')];}_0x102985[_0xa823('0x23')](_0x3356a7)[_0xa823('0x2d')](_0x5f5c67);};}exports[_0xa823('0x2e')]=function(_0x159660,_0x529210){var _0x2e8781={},_0x541920={},_0x184b5f={'count':0x0,'rows':[]};var _0x29570c=db[_0xa823('0x2f')][_0xa823('0x30')];_0x541920[_0xa823('0x31')]=_[_0xa823('0x32')](_0x29570c);var _0x2a0058={'dateStart':_0x159660[_0xa823('0x33')]['dateStart'],'dateEnd':_0x159660['query']['dateEnd']};delete _0x159660['query'][_0xa823('0x34')];delete _0x159660[_0xa823('0x33')]['dateEnd'];_0x541920[_0xa823('0x33')]=_[_0xa823('0x32')](_0x159660[_0xa823('0x33')]);_0x541920[_0xa823('0x35')]=_[_0xa823('0x36')](_0x541920['model'],_0x541920[_0xa823('0x33')]);_0x2e8781[_0xa823('0x37')]=_['intersection'](_0x541920[_0xa823('0x31')],qs[_0xa823('0x38')](_0x159660[_0xa823('0x33')]['fields']));_0x2e8781[_0xa823('0x37')]=_0x2e8781['attributes'][_0xa823('0x39')]?_0x2e8781[_0xa823('0x37')]:_0x541920[_0xa823('0x31')];if(!_0x159660['query']['hasOwnProperty'](_0xa823('0x3a'))){_0x2e8781['limit']=qs['limit'](_0x159660[_0xa823('0x33')][_0xa823('0x3b')]);_0x2e8781[_0xa823('0x25')]=qs[_0xa823('0x25')](_0x159660[_0xa823('0x33')][_0xa823('0x25')]);}_0x2e8781[_0xa823('0x3c')]=qs[_0xa823('0x3d')](_0x159660[_0xa823('0x33')][_0xa823('0x3d')]);_0x2e8781[_0xa823('0x3e')]=qs[_0xa823('0x35')](_[_0xa823('0x3f')](_0x159660[_0xa823('0x33')],_0x541920[_0xa823('0x35')]));if(_0x2a0058[_0xa823('0x34')]){if(_0x2a0058[_0xa823('0x40')]){_0x2a0058['dateEnd']=moment(_0x2a0058['dateEnd'])[_0xa823('0x41')](0x1,_0xa823('0x42'));}else{_0x2a0058[_0xa823('0x40')]=moment(_0x2a0058[_0xa823('0x34')])[_0xa823('0x41')](0x1,_0xa823('0x42'));}_['merge'](_0x2e8781['where'],{'createdAt':{'$gte':_0x2a0058[_0xa823('0x34')],'$lte':_0x2a0058['dateEnd']}});}if(_0x159660[_0xa823('0x33')][_0xa823('0x43')]){_0x2e8781['where']=_[_0xa823('0x44')](_0x2e8781[_0xa823('0x3e')],{'$or':_[_0xa823('0x45')](_0x29570c,function(_0x467a4e){if(_0x467a4e[_0xa823('0x46')]['key']!=='VIRTUAL'){var _0x38d4a5={};_0x38d4a5[_0x467a4e[_0xa823('0x47')]]={'$like':'%'+_0x159660[_0xa823('0x33')][_0xa823('0x43')]+'%'};return _0x38d4a5;}})});}_0x2e8781=_[_0xa823('0x44')]({},_0x2e8781,_0x159660['options']);var _0x3ccf75={'where':_0x2e8781[_0xa823('0x3e')]};return db[_0xa823('0x2f')][_0xa823('0x24')](_0x3ccf75)[_0xa823('0x16')](function(_0x47eb28){_0x184b5f[_0xa823('0x24')]=_0x47eb28;if(_0x159660[_0xa823('0x33')]['includeAll']){_0x2e8781[_0xa823('0x48')]=[{'all':!![]}];}return db[_0xa823('0x2f')][_0xa823('0x49')](_0x2e8781);})[_0xa823('0x16')](function(_0x4745bc){_0x184b5f[_0xa823('0x4a')]=_0x4745bc;return _0x184b5f;})[_0xa823('0x16')](respondWithFilteredResult(_0x529210,_0x2e8781))[_0xa823('0x21')](handleError(_0x529210,null));};exports[_0xa823('0x4b')]=function(_0x5a116e,_0xfac66){var _0x270bf4={'raw':![],'where':{'id':_0x5a116e[_0xa823('0x4c')]['id']}},_0x2284b1={};_0x2284b1[_0xa823('0x31')]=_[_0xa823('0x32')](db[_0xa823('0x2f')][_0xa823('0x30')]);_0x2284b1[_0xa823('0x33')]=_['keys'](_0x5a116e[_0xa823('0x33')]);_0x2284b1[_0xa823('0x35')]=_['intersection'](_0x2284b1[_0xa823('0x31')],_0x2284b1[_0xa823('0x33')]);_0x270bf4[_0xa823('0x37')]=_[_0xa823('0x36')](_0x2284b1[_0xa823('0x31')],qs[_0xa823('0x38')](_0x5a116e[_0xa823('0x33')]['fields']));_0x270bf4[_0xa823('0x37')]=_0x270bf4[_0xa823('0x37')][_0xa823('0x39')]?_0x270bf4['attributes']:_0x2284b1[_0xa823('0x31')];if(_0x5a116e[_0xa823('0x33')]['includeAll']){_0x270bf4[_0xa823('0x48')]=[{'all':!![]}];}_0x270bf4=_[_0xa823('0x44')]({},_0x270bf4,_0x5a116e[_0xa823('0x4d')]);return db[_0xa823('0x2f')][_0xa823('0x4e')](_0x270bf4)[_0xa823('0x16')](handleEntityNotFound(_0xfac66,null))['then'](respondWithResult(_0xfac66,null))[_0xa823('0x21')](handleError(_0xfac66,null));};exports[_0xa823('0x4f')]=function(_0x3395dc,_0x3ab15f){return db[_0xa823('0x2f')]['create'](_0x3395dc['body'],{})[_0xa823('0x16')](respondWithResult(_0x3ab15f,0xc9))['catch'](handleError(_0x3ab15f,null));};exports[_0xa823('0x50')]=function(_0x15447b,_0xd4f2d7){if(_0x15447b[_0xa823('0x51')]['id']){delete _0x15447b[_0xa823('0x51')]['id'];}return db['SalesforceAccount'][_0xa823('0x4e')]({'where':{'id':_0x15447b[_0xa823('0x4c')]['id']}})[_0xa823('0x16')](handleEntityNotFound(_0xd4f2d7,null))[_0xa823('0x16')](saveUpdates(_0x15447b[_0xa823('0x51')],null))[_0xa823('0x16')](respondWithResult(_0xd4f2d7,null))['catch'](handleError(_0xd4f2d7,null));};exports['destroy']=function(_0x526a64,_0x98ad74){return db[_0xa823('0x2f')]['find']({'where':{'id':_0x526a64[_0xa823('0x4c')]['id']}})[_0xa823('0x16')](handleEntityNotFound(_0x98ad74,null))[_0xa823('0x16')](removeEntity(_0x98ad74,null))['catch'](handleError(_0x98ad74,null));};exports[_0xa823('0x52')]=function(_0x45c255,_0x171cef,_0x548890){var _0x56d7ac={};var _0x239de0={};var _0x377dee;var _0x4b055a;return db[_0xa823('0x2f')]['findOne']({'where':{'id':_0x45c255[_0xa823('0x4c')]['id']}})['then'](handleEntityNotFound(_0x171cef,null))['then'](function(_0xf03e5d){if(_0xf03e5d){_0x377dee=_0xf03e5d;_0x239de0[_0xa823('0x31')]=_[_0xa823('0x32')](db['SalesforceConfiguration']['rawAttributes']);_0x239de0[_0xa823('0x33')]=_[_0xa823('0x32')](_0x45c255['query']);_0x239de0['filters']=_[_0xa823('0x36')](_0x239de0[_0xa823('0x31')],_0x239de0['query']);_0x56d7ac[_0xa823('0x37')]=_[_0xa823('0x36')](_0x239de0[_0xa823('0x31')],qs[_0xa823('0x38')](_0x45c255[_0xa823('0x33')][_0xa823('0x38')]));_0x56d7ac['attributes']=_0x56d7ac[_0xa823('0x37')][_0xa823('0x39')]?_0x56d7ac[_0xa823('0x37')]:_0x239de0[_0xa823('0x31')];_0x56d7ac[_0xa823('0x3c')]=qs[_0xa823('0x3d')](_0x45c255['query'][_0xa823('0x3d')]);_0x56d7ac[_0xa823('0x3e')]=qs[_0xa823('0x35')](_[_0xa823('0x3f')](_0x45c255[_0xa823('0x33')],_0x239de0['filters']));if(_0x45c255[_0xa823('0x33')][_0xa823('0x43')]){_0x56d7ac['where']=_['merge'](_0x56d7ac[_0xa823('0x3e')],{'$or':_[_0xa823('0x45')](_0x56d7ac[_0xa823('0x37')],function(_0x251c76){var _0x45cae2={};_0x45cae2[_0x251c76]={'$like':'%'+_0x45c255[_0xa823('0x33')][_0xa823('0x43')]+'%'};return _0x45cae2;})});}_0x56d7ac=_['merge']({},_0x56d7ac,_0x45c255[_0xa823('0x4d')]);return _0x377dee['getConfigurations'](_0x56d7ac);}})[_0xa823('0x16')](function(_0x13295f){if(_0x13295f){_0x4b055a=_0x13295f[_0xa823('0x39')];if(!_0x45c255['query']['hasOwnProperty']('nolimit')){_0x56d7ac[_0xa823('0x3b')]=qs[_0xa823('0x3b')](_0x45c255[_0xa823('0x33')]['limit']);_0x56d7ac[_0xa823('0x25')]=qs[_0xa823('0x25')](_0x45c255['query'][_0xa823('0x25')]);}return _0x377dee[_0xa823('0x52')](_0x56d7ac);}})[_0xa823('0x16')](function(_0x4d734c){if(_0x4d734c){return _0x4d734c?{'count':_0x4b055a,'rows':_0x4d734c}:null;}})[_0xa823('0x16')](respondWithResult(_0x171cef,null))[_0xa823('0x21')](handleError(_0x171cef,null));};exports[_0xa823('0x53')]=function(_0xefb193,_0x53685e,_0x17e17d){if(_0xefb193[_0xa823('0x51')]['id']){delete _0xefb193['body']['id'];}return db[_0xa823('0x2f')][_0xa823('0x54')]({'where':{'id':_0xefb193[_0xa823('0x4c')]['id']}})[_0xa823('0x16')](handleEntityNotFound(_0x53685e,null))['then'](function(_0x4aa731){if(_0x4aa731){_0xefb193[_0xa823('0x51')][_0xa823('0x55')]=_0x4aa731['id'];_0xefb193['body'][_0xa823('0x56')]=integrations['getSubjects'](_0xefb193[_0xa823('0x51')]['channel'],_0xefb193[_0xa823('0x51')][_0xa823('0x46')]);_0xefb193[_0xa823('0x51')][_0xa823('0x57')]=integrations[_0xa823('0x58')](_0xefb193[_0xa823('0x51')][_0xa823('0x59')],_0xefb193[_0xa823('0x51')][_0xa823('0x46')]);return db[_0xa823('0x5a')][_0xa823('0x4f')](_0xefb193['body'],{'include':[{'model':db[_0xa823('0x5b')],'as':_0xa823('0x56')},{'model':db['SalesforceField'],'as':_0xa823('0x57')}]});}return null;})[_0xa823('0x16')](respondWithResult(_0x53685e,null))[_0xa823('0x21')](handleError(_0x53685e,null));};exports[_0xa823('0x5c')]=function(_0x40dc16,_0x156185,_0x54cc03){var _0x1965dd;return db[_0xa823('0x2f')][_0xa823('0x54')]({'where':{'id':_0x40dc16[_0xa823('0x4c')]['id']},'attributes':['id',_0xa823('0x5d'),_0xa823('0x5e'),_0xa823('0x5f'),_0xa823('0x60'),_0xa823('0x61'),'securityToken']})['then'](handleEntityNotFound(_0x156185,null))[_0xa823('0x16')](function(_0x45d7af){if(_0x45d7af){_0x1965dd=new jsforce[(_0xa823('0x62'))]({'oauth2':{'loginUrl':_0x45d7af[_0xa823('0x5d')],'clientId':_0x45d7af['clientId'],'clientSecret':_0x45d7af[_0xa823('0x5f')]}});return _0x1965dd[_0xa823('0x63')](_0x45d7af[_0xa823('0x60')],_0x45d7af[_0xa823('0x61')][_0xa823('0x64')](_0x45d7af['securityToken']));}})[_0xa823('0x16')](function(_0x2ce4d7){if(_0x2ce4d7){return _0x1965dd[_0xa823('0x65')]('Task')[_0xa823('0x66')]();}})['then'](function(_0xfe5ee2){var _0x1548ac=[_0xa823('0x67'),'CallDurationInSeconds',_0xa823('0x68'),_0xa823('0x69'),_0xa823('0x6a'),_0xa823('0x6b'),_0xa823('0x6c'),_0xa823('0x6d')];if(_0xfe5ee2){_[_0xa823('0x6e')](_0xfe5ee2[_0xa823('0x38')],function(_0x4900e8){return _0x4900e8['custom']===![]&&!_0x1548ac['includes'](_0x4900e8['name']);});return{'count':_0xfe5ee2[_0xa823('0x38')][_0xa823('0x39')],'rows':_[_0xa823('0x45')](_0xfe5ee2[_0xa823('0x38')],function(_0x2b40f5){return{'id':_0x2b40f5[_0xa823('0x2c')],'name':_0x2b40f5[_0xa823('0x6f')],'custom':_0x2b40f5[_0xa823('0x70')],'options':_0x2b40f5[_0xa823('0x71')]?_[_0xa823('0x45')](_0x2b40f5[_0xa823('0x71')],function(_0x157e3a){return{'name':_0x157e3a[_0xa823('0x6f')],'value':_0x157e3a['value']};}):[]};})};}})['then'](respondWithResult(_0x156185,null))['catch'](function(_0x1c19fe){var _0x4334fe=_0x40dc16['query'][_0xa823('0x72')]?0x1f4:_0x1c19fe[_0xa823('0x73')]||0x1f4;logger['error'](_0xa823('0x74'),_0xa823('0x5c'),_0x4334fe,JSON[_0xa823('0x1c')](_0x1c19fe));delete _0x1c19fe[_0xa823('0x2c')];if(_0x4334fe===0x191){_0x4334fe=0x190;}_0x156185['status'](_0x4334fe)[_0xa823('0x2d')](_0x40dc16[_0xa823('0x33')][_0xa823('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x1c19fe[_0xa823('0x73')]}:_0x1c19fe);});};
\ No newline at end of file
index 5a29eb6..2934584 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d20=['moment','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api'];(function(_0x3caa66,_0x48f53b){var _0x3b63e2=function(_0x3a4712){while(--_0x3a4712){_0x3caa66['push'](_0x3caa66['shift']());}};_0x3b63e2(++_0x48f53b);}(_0x8d20,0x1c5));var _0x08d2=function(_0x2a9ffa,_0x2b4ce4){_0x2a9ffa=_0x2a9ffa-0x0;var _0x1acd17=_0x8d20[_0x2a9ffa];return _0x1acd17;};'use strict';var _=require('lodash');var util=require(_0x08d2('0x0'));var logger=require(_0x08d2('0x1'))(_0x08d2('0x2'));var moment=require(_0x08d2('0x3'));var BPromise=require(_0x08d2('0x4'));var rp=require(_0x08d2('0x5'));var attributes=require(_0x08d2('0x6'));var integrations=require(_0x08d2('0x7'));module[_0x08d2('0x8')]=function(_0x480a7c,_0x2e07a0){return _0x480a7c[_0x08d2('0x9')](_0x08d2('0xa'),attributes,{'tableName':_0x08d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1539=['api','bluebird','request-promise','./intSalesforceAccount.attributes','exports','define','int_salesforce_accounts','util','../../config/logger'];(function(_0x5c2588,_0x5349a3){var _0x1aa9b8=function(_0x475af8){while(--_0x475af8){_0x5c2588['push'](_0x5c2588['shift']());}};_0x1aa9b8(++_0x5349a3);}(_0x1539,0x139));var _0x9153=function(_0x41d7ff,_0x112168){_0x41d7ff=_0x41d7ff-0x0;var _0x31b600=_0x1539[_0x41d7ff];return _0x31b600;};'use strict';var _=require('lodash');var util=require(_0x9153('0x0'));var logger=require(_0x9153('0x1'))(_0x9153('0x2'));var moment=require('moment');var BPromise=require(_0x9153('0x3'));var rp=require(_0x9153('0x4'));var attributes=require(_0x9153('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x9153('0x6')]=function(_0x441961,_0x4b3589){return _0x441961[_0x9153('0x7')]('SalesforceAccount',attributes,{'tableName':_0x9153('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 34b1639..719169c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ef7=['code','message','request\x20sent','result','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','GetSalesforceAccount','ShowSalesforceAccount','find','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x1dee14,_0x276383){var _0x1cb726=function(_0x21dc60){while(--_0x21dc60){_0x1dee14['push'](_0x1dee14['shift']());}};_0x1cb726(++_0x276383);}(_0x0ef7,0xc2));var _0x70ef=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0x0ef7[_0x5027b1];return _0x4a46cf;};'use strict';var _=require('lodash');var util=require(_0x70ef('0x0'));var moment=require(_0x70ef('0x1'));var BPromise=require(_0x70ef('0x2'));var rs=require(_0x70ef('0x3'));var fs=require('fs');var Redis=require(_0x70ef('0x4'));var db=require(_0x70ef('0x5'))['db'];var utils=require(_0x70ef('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x70ef('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x70ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a8666,_0x2c3b96,_0x1773c4){return new BPromise(function(_0xcbbc9a,_0x37db29){return client[_0x70ef('0x9')](_0x1a8666,_0x1773c4)[_0x70ef('0xa')](function(_0x40fe44){logger[_0x70ef('0xb')](_0x70ef('0xc'),_0x2c3b96,'request\x20sent');logger[_0x70ef('0xd')](_0x70ef('0xe'),_0x2c3b96,'request\x20sent',JSON['stringify'](_0x40fe44));if(_0x40fe44['error']){if(_0x40fe44[_0x70ef('0xf')][_0x70ef('0x10')]===0x1f4){logger[_0x70ef('0xf')](_0x70ef('0xc'),_0x2c3b96,_0x40fe44[_0x70ef('0xf')][_0x70ef('0x11')]);return _0x37db29(_0x40fe44[_0x70ef('0xf')][_0x70ef('0x11')]);}logger[_0x70ef('0xf')](_0x70ef('0xc'),_0x2c3b96,_0x40fe44[_0x70ef('0xf')][_0x70ef('0x11')]);return _0xcbbc9a(_0x40fe44['error'][_0x70ef('0x11')]);}else{logger[_0x70ef('0xb')](_0x70ef('0xc'),_0x2c3b96,_0x70ef('0x12'));_0xcbbc9a(_0x40fe44[_0x70ef('0x13')][_0x70ef('0x11')]);}})[_0x70ef('0x14')](function(_0x361901){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x2c3b96,_0x361901);_0x37db29(_0x361901);});});}exports['GetSalesforceAccount']=function(_0x4b7ed9){var _0x446394=this;return new Promise(function(_0xdff6d0,_0xfb4d6a){return db[_0x70ef('0x15')][_0x70ef('0x16')]({'raw':_0x4b7ed9[_0x70ef('0x17')]?_0x4b7ed9[_0x70ef('0x17')][_0x70ef('0x18')]===undefined?!![]:![]:!![],'where':_0x4b7ed9[_0x70ef('0x17')]?_0x4b7ed9[_0x70ef('0x17')][_0x70ef('0x19')]||null:null,'attributes':_0x4b7ed9['options']?_0x4b7ed9['options'][_0x70ef('0x1a')]||null:null,'limit':_0x4b7ed9[_0x70ef('0x17')]?_0x4b7ed9[_0x70ef('0x17')][_0x70ef('0x1b')]||null:null,'include':_0x4b7ed9[_0x70ef('0x17')]?_0x4b7ed9['options']['include']?_[_0x70ef('0x1c')](_0x4b7ed9[_0x70ef('0x17')][_0x70ef('0x1d')],function(_0xb8762){return{'model':db[_0xb8762[_0x70ef('0x1e')]],'as':_0xb8762['as'],'attributes':_0xb8762[_0x70ef('0x1a')],'include':_0xb8762[_0x70ef('0x1d')]?_[_0x70ef('0x1c')](_0xb8762[_0x70ef('0x1d')],function(_0x4ff3c9){return{'model':db[_0x4ff3c9[_0x70ef('0x1e')]],'as':_0x4ff3c9['as'],'attributes':_0x4ff3c9[_0x70ef('0x1a')],'include':_0x4ff3c9[_0x70ef('0x1d')]?_[_0x70ef('0x1c')](_0x4ff3c9[_0x70ef('0x1d')],function(_0x24e140){return{'model':db[_0x24e140[_0x70ef('0x1e')]],'as':_0x24e140['as'],'attributes':_0x24e140[_0x70ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x70ef('0xa')](function(_0x4924c4){logger['info'](_0x70ef('0x1f'),_0x4b7ed9);logger[_0x70ef('0xd')](_0x70ef('0x1f'),_0x4b7ed9,JSON['stringify'](_0x4924c4));_0xdff6d0(_0x4924c4);})[_0x70ef('0x14')](function(_0x6a245d){logger[_0x70ef('0xf')](_0x70ef('0x1f'),_0x6a245d[_0x70ef('0x11')],_0x4b7ed9);_0xfb4d6a(_0x446394[_0x70ef('0xf')](0x1f4,_0x6a245d[_0x70ef('0x11')]));});});};exports[_0x70ef('0x20')]=function(_0x365341){var _0x56f759=this;return new Promise(function(_0x215c4d,_0x1c5a5e){return db[_0x70ef('0x15')][_0x70ef('0x21')]({'raw':_0x365341['options']?_0x365341[_0x70ef('0x17')][_0x70ef('0x18')]===undefined?!![]:![]:!![],'where':_0x365341[_0x70ef('0x17')]?_0x365341[_0x70ef('0x17')][_0x70ef('0x19')]||null:null,'attributes':_0x365341['options']?_0x365341[_0x70ef('0x17')][_0x70ef('0x1a')]||null:null,'include':_0x365341[_0x70ef('0x17')]?_0x365341[_0x70ef('0x17')]['include']?_[_0x70ef('0x1c')](_0x365341[_0x70ef('0x17')][_0x70ef('0x1d')],function(_0x154972){return{'model':db[_0x154972[_0x70ef('0x1e')]],'as':_0x154972['as'],'attributes':_0x154972[_0x70ef('0x1a')],'include':_0x154972[_0x70ef('0x1d')]?_['map'](_0x154972['include'],function(_0x164359){return{'model':db[_0x164359['model']],'as':_0x164359['as'],'attributes':_0x164359[_0x70ef('0x1a')],'include':_0x164359[_0x70ef('0x1d')]?_[_0x70ef('0x1c')](_0x164359[_0x70ef('0x1d')],function(_0x1318ad){return{'model':db[_0x1318ad[_0x70ef('0x1e')]],'as':_0x1318ad['as'],'attributes':_0x1318ad[_0x70ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x70ef('0xa')](function(_0x5defdd){logger[_0x70ef('0xb')](_0x70ef('0x20'),_0x365341);logger[_0x70ef('0xd')](_0x70ef('0x20'),_0x365341,JSON[_0x70ef('0x22')](_0x5defdd));_0x215c4d(_0x5defdd);})['catch'](function(_0x1d117e){logger['error'](_0x70ef('0x20'),_0x1d117e['message'],_0x365341);_0x1c5a5e(_0x56f759['error'](0x1f4,_0x1d117e['message']));});});};
\ No newline at end of file
+var _0xa987=['findAll','options','raw','attributes','limit','include','map','model','ShowSalesforceAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','GetSalesforceAccount','SalesforceAccount'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xa987,0x12a));var _0x7a98=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xa987[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x7a98('0x0'));var util=require(_0x7a98('0x1'));var moment=require(_0x7a98('0x2'));var BPromise=require(_0x7a98('0x3'));var rs=require(_0x7a98('0x4'));var fs=require('fs');var Redis=require(_0x7a98('0x5'));var db=require(_0x7a98('0x6'))['db'];var utils=require(_0x7a98('0x7'));var logger=require(_0x7a98('0x8'))('rpc');var config=require(_0x7a98('0x9'));var jayson=require(_0x7a98('0xa'));var client=jayson[_0x7a98('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x430a5b,_0xde35b1,_0xb7b75c){return new BPromise(function(_0x15b79f,_0x183a90){return client[_0x7a98('0xc')](_0x430a5b,_0xb7b75c)[_0x7a98('0xd')](function(_0x1ebfec){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0xde35b1,'request\x20sent');logger[_0x7a98('0xe')](_0x7a98('0xf'),_0xde35b1,_0x7a98('0x10'),JSON[_0x7a98('0x11')](_0x1ebfec));if(_0x1ebfec[_0x7a98('0x12')]){if(_0x1ebfec[_0x7a98('0x12')]['code']===0x1f4){logger['error'](_0x7a98('0x13'),_0xde35b1,_0x1ebfec[_0x7a98('0x12')][_0x7a98('0x14')]);return _0x183a90(_0x1ebfec['error'][_0x7a98('0x14')]);}logger[_0x7a98('0x12')](_0x7a98('0x13'),_0xde35b1,_0x1ebfec[_0x7a98('0x12')][_0x7a98('0x14')]);return _0x15b79f(_0x1ebfec[_0x7a98('0x12')][_0x7a98('0x14')]);}else{logger[_0x7a98('0x15')](_0x7a98('0x13'),_0xde35b1,_0x7a98('0x10'));_0x15b79f(_0x1ebfec[_0x7a98('0x16')][_0x7a98('0x14')]);}})[_0x7a98('0x17')](function(_0x3dfa67){logger[_0x7a98('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0xde35b1,_0x3dfa67);_0x183a90(_0x3dfa67);});});}exports[_0x7a98('0x18')]=function(_0x507da4){var _0x5285c=this;return new Promise(function(_0x4c0c1c,_0x59de27){return db[_0x7a98('0x19')][_0x7a98('0x1a')]({'raw':_0x507da4[_0x7a98('0x1b')]?_0x507da4[_0x7a98('0x1b')][_0x7a98('0x1c')]===undefined?!![]:![]:!![],'where':_0x507da4[_0x7a98('0x1b')]?_0x507da4[_0x7a98('0x1b')]['where']||null:null,'attributes':_0x507da4[_0x7a98('0x1b')]?_0x507da4[_0x7a98('0x1b')][_0x7a98('0x1d')]||null:null,'limit':_0x507da4['options']?_0x507da4[_0x7a98('0x1b')][_0x7a98('0x1e')]||null:null,'include':_0x507da4['options']?_0x507da4[_0x7a98('0x1b')][_0x7a98('0x1f')]?_['map'](_0x507da4[_0x7a98('0x1b')][_0x7a98('0x1f')],function(_0x3976cb){return{'model':db[_0x3976cb['model']],'as':_0x3976cb['as'],'attributes':_0x3976cb['attributes'],'include':_0x3976cb['include']?_[_0x7a98('0x20')](_0x3976cb[_0x7a98('0x1f')],function(_0x467011){return{'model':db[_0x467011[_0x7a98('0x21')]],'as':_0x467011['as'],'attributes':_0x467011[_0x7a98('0x1d')],'include':_0x467011[_0x7a98('0x1f')]?_[_0x7a98('0x20')](_0x467011[_0x7a98('0x1f')],function(_0x47aa1e){return{'model':db[_0x47aa1e[_0x7a98('0x21')]],'as':_0x47aa1e['as'],'attributes':_0x47aa1e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a98('0xd')](function(_0x3c234f){logger[_0x7a98('0x15')](_0x7a98('0x18'),_0x507da4);logger['debug'](_0x7a98('0x18'),_0x507da4,JSON[_0x7a98('0x11')](_0x3c234f));_0x4c0c1c(_0x3c234f);})[_0x7a98('0x17')](function(_0x8a77ba){logger[_0x7a98('0x12')](_0x7a98('0x18'),_0x8a77ba[_0x7a98('0x14')],_0x507da4);_0x59de27(_0x5285c['error'](0x1f4,_0x8a77ba[_0x7a98('0x14')]));});});};exports[_0x7a98('0x22')]=function(_0x586565){var _0x3524dc=this;return new Promise(function(_0x6618fc,_0x57cc7f){return db[_0x7a98('0x19')]['find']({'raw':_0x586565['options']?_0x586565[_0x7a98('0x1b')][_0x7a98('0x1c')]===undefined?!![]:![]:!![],'where':_0x586565[_0x7a98('0x1b')]?_0x586565[_0x7a98('0x1b')][_0x7a98('0x23')]||null:null,'attributes':_0x586565[_0x7a98('0x1b')]?_0x586565[_0x7a98('0x1b')][_0x7a98('0x1d')]||null:null,'include':_0x586565[_0x7a98('0x1b')]?_0x586565[_0x7a98('0x1b')][_0x7a98('0x1f')]?_['map'](_0x586565[_0x7a98('0x1b')][_0x7a98('0x1f')],function(_0x2e8e56){return{'model':db[_0x2e8e56['model']],'as':_0x2e8e56['as'],'attributes':_0x2e8e56[_0x7a98('0x1d')],'include':_0x2e8e56[_0x7a98('0x1f')]?_['map'](_0x2e8e56[_0x7a98('0x1f')],function(_0x36156c){return{'model':db[_0x36156c[_0x7a98('0x21')]],'as':_0x36156c['as'],'attributes':_0x36156c[_0x7a98('0x1d')],'include':_0x36156c['include']?_[_0x7a98('0x20')](_0x36156c[_0x7a98('0x1f')],function(_0xa358e2){return{'model':db[_0xa358e2[_0x7a98('0x21')]],'as':_0xa358e2['as'],'attributes':_0xa358e2[_0x7a98('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc1d499){logger[_0x7a98('0x15')](_0x7a98('0x22'),_0x586565);logger[_0x7a98('0xe')]('ShowSalesforceAccount',_0x586565,JSON[_0x7a98('0x11')](_0xc1d499));_0x6618fc(_0xc1d499);})['catch'](function(_0x400a35){logger[_0x7a98('0x12')](_0x7a98('0x22'),_0x400a35[_0x7a98('0x14')],_0x586565);_0x57cc7f(_0x3524dc['error'](0x1f4,_0x400a35[_0x7a98('0x14')]));});});};
\ No newline at end of file
index e69c9fd..bc6f028 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f19=['index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x8b2bbd,_0x2b1ced){var _0x299614=function(_0x512aa8){while(--_0x512aa8){_0x8b2bbd['push'](_0x8b2bbd['shift']());}};_0x299614(++_0x2b1ced);}(_0x0f19,0x19a));var _0x90f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f19[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x90f1('0x0'));var util=require(_0x90f1('0x1'));var path=require('path');var timeout=require(_0x90f1('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x90f1('0x3'));var interaction=require(_0x90f1('0x4'));var config=require(_0x90f1('0x5'));var controller=require('./intSalesforceConfiguration.controller');router[_0x90f1('0x6')]('/',auth[_0x90f1('0x7')](),controller[_0x90f1('0x8')]);router['get'](_0x90f1('0x9'),auth[_0x90f1('0x7')](),controller[_0x90f1('0xa')]);router[_0x90f1('0x6')](_0x90f1('0xb'),auth['isAuthenticated'](),controller[_0x90f1('0xc')]);router[_0x90f1('0x6')](_0x90f1('0xd'),auth[_0x90f1('0x7')](),controller[_0x90f1('0xe')]);router[_0x90f1('0x6')](_0x90f1('0xf'),auth[_0x90f1('0x7')](),controller[_0x90f1('0x10')]);router[_0x90f1('0x11')]('/',auth[_0x90f1('0x7')](),controller[_0x90f1('0x12')]);router['put'](_0x90f1('0x9'),auth[_0x90f1('0x7')](),controller['update']);router[_0x90f1('0x13')](_0x90f1('0x9'),auth[_0x90f1('0x7')](),controller[_0x90f1('0x14')]);module[_0x90f1('0x15')]=router;
\ No newline at end of file
+var _0x5fbc=['put','/:id','delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x455b30,_0x286129){var _0x400f0c=function(_0x2145af){while(--_0x2145af){_0x455b30['push'](_0x455b30['shift']());}};_0x400f0c(++_0x286129);}(_0x5fbc,0x159));var _0xc5fb=function(_0x367ef7,_0x574367){_0x367ef7=_0x367ef7-0x0;var _0x2f1023=_0x5fbc[_0x367ef7];return _0x2f1023;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc5fb('0x0'));var timeout=require('connect-timeout');var express=require(_0xc5fb('0x1'));var router=express[_0xc5fb('0x2')]();var auth=require(_0xc5fb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc5fb('0x4'));var controller=require(_0xc5fb('0x5'));router[_0xc5fb('0x6')]('/',auth[_0xc5fb('0x7')](),controller[_0xc5fb('0x8')]);router[_0xc5fb('0x6')]('/:id',auth[_0xc5fb('0x7')](),controller[_0xc5fb('0x9')]);router[_0xc5fb('0x6')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xc5fb('0x6')](_0xc5fb('0xa'),auth[_0xc5fb('0x7')](),controller[_0xc5fb('0xb')]);router[_0xc5fb('0x6')](_0xc5fb('0xc'),auth[_0xc5fb('0x7')](),controller[_0xc5fb('0xd')]);router[_0xc5fb('0xe')]('/',auth[_0xc5fb('0x7')](),controller['create']);router[_0xc5fb('0xf')](_0xc5fb('0x10'),auth[_0xc5fb('0x7')](),controller['update']);router[_0xc5fb('0x11')]('/:id',auth[_0xc5fb('0x7')](),controller[_0xc5fb('0x12')]);module[_0xc5fb('0x13')]=router;
\ No newline at end of file
index 3cbe6d5..38b2969 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03e2=['lead','sequelize','STRING','ENUM','contact_lead','contact'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x03e2,0xcd));var _0x203e=function(_0x8c66e5,_0x1aaf65){_0x8c66e5=_0x8c66e5-0x0;var _0x47ee73=_0x03e2[_0x8c66e5];return _0x47ee73;};'use strict';var Sequelize=require(_0x203e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x203e('0x1')]},'moduleSearch':{'type':Sequelize[_0x203e('0x2')](_0x203e('0x3'),_0x203e('0x4'),_0x203e('0x5')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x203e('0x2')]('nothing',_0x203e('0x4'),_0x203e('0x5')),'defaultValue':'lead'}};
\ No newline at end of file
+var _0x5dad=['contact','lead','ENUM','exports','STRING','contact_lead'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5dad,0x1ad));var _0xd5da=function(_0x453ae8,_0x482922){_0x453ae8=_0x453ae8-0x0;var _0x1ef789=_0x5dad[_0x453ae8];return _0x1ef789;};'use strict';var Sequelize=require('sequelize');module[_0xd5da('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd5da('0x1')]},'moduleSearch':{'type':Sequelize['ENUM'](_0xd5da('0x2'),_0xd5da('0x3'),_0xd5da('0x4')),'defaultValue':_0xd5da('0x2')},'moduleCreate':{'type':Sequelize[_0xd5da('0x5')]('nothing',_0xd5da('0x3'),_0xd5da('0x4')),'defaultValue':_0xd5da('0x4')}};
\ No newline at end of file
index 0a8ad6e..8508dbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0317=['SalesforceConfiguration','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','merge','filter','map','type','key','field','count','includeAll','include','rows','show','options','find','create','body','params','getFields','findOne','SalesforceField','length','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','destroy','stack','name','send','index'];(function(_0xa35c6d,_0x416cd7){var _0x9475e5=function(_0x500ae2){while(--_0x500ae2){_0xa35c6d['push'](_0xa35c6d['shift']());}};_0x9475e5(++_0x416cd7);}(_0x0317,0x137));var _0x7031=function(_0x1a696f,_0x1e9b62){_0x1a696f=_0x1a696f-0x0;var _0x39057a=_0x0317[_0x1a696f];return _0x39057a;};'use strict';var pdf=require(_0x7031('0x0'));var emlformat=require(_0x7031('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7031('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7031('0x3'));var moment=require(_0x7031('0x4'));var BPromise=require(_0x7031('0x5'));var Mustache=require(_0x7031('0x6'));var util=require(_0x7031('0x7'));var path=require(_0x7031('0x8'));var sox=require('sox');var csv=require(_0x7031('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7031('0xa'));var squel=require(_0x7031('0xb'));var crypto=require(_0x7031('0xc'));var jsforce=require(_0x7031('0xd'));var deskjs=require(_0x7031('0xe'));var toCsv=require(_0x7031('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7031('0xf'));var qs=require(_0x7031('0x10'));var logger=require(_0x7031('0x11'))(_0x7031('0x12'));var utils=require(_0x7031('0x13'));var config=require(_0x7031('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7031('0x15'));var client=jayson[_0x7031('0x16')][_0x7031('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x34c03b,_0x106385,_0x15b016,_0x4e9ed1){return new BPromise(function(_0x4ade17,_0x558660){var _0x2b643f=_0x4e9ed1||client;return _0x2b643f[_0x7031('0x18')](_0x34c03b,_0x15b016)[_0x7031('0x19')](function(_0x33eb07){logger[_0x7031('0x1a')](_0x7031('0x1b'),_0x106385,_0x7031('0x1c'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x106385,_0x7031('0x1c'),JSON[_0x7031('0x1d')](_0x33eb07));if(_0x33eb07[_0x7031('0x1e')]){if(_0x33eb07[_0x7031('0x1e')][_0x7031('0x1f')]===0x1f4){logger['error'](_0x7031('0x1b'),_0x106385,_0x33eb07[_0x7031('0x1e')][_0x7031('0x20')]);return _0x558660(_0x33eb07[_0x7031('0x1e')]['message']);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x106385,_0x33eb07[_0x7031('0x1e')][_0x7031('0x20')]);return _0x4ade17(_0x33eb07[_0x7031('0x1e')][_0x7031('0x20')]);}else{logger['info'](_0x7031('0x1b'),_0x106385,_0x7031('0x1c'));_0x4ade17(_0x33eb07['result'][_0x7031('0x20')]);}})[_0x7031('0x21')](function(_0x306f1c){logger[_0x7031('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x106385,_0x306f1c);_0x558660(_0x306f1c);});});}function respondWithStatusCode(_0x33d088,_0x343e2c){_0x343e2c=_0x343e2c||0xcc;return function(_0x70f484){if(_0x70f484){return _0x33d088[_0x7031('0x22')](_0x343e2c);}return _0x33d088[_0x7031('0x23')](_0x343e2c)[_0x7031('0x24')]();};}function respondWithResult(_0x510332,_0x2f759c){_0x2f759c=_0x2f759c||0xc8;return function(_0x539bc7){if(_0x539bc7){return _0x510332[_0x7031('0x23')](_0x2f759c)['json'](_0x539bc7);}};}function respondWithFilteredResult(_0x40a66c,_0x5b2986){return function(_0xde757c){if(_0xde757c){var _0x269a20=_0xde757c['count'],_0x72ab48=_0x5b2986[_0x7031('0x25')],_0x554a60=_0x5b2986[_0x7031('0x25')]+_0x5b2986[_0x7031('0x26')],_0x3c0aa7;if(_0x554a60>=_0x269a20){_0x554a60=_0x269a20;_0x3c0aa7=0xc8;}else{_0x3c0aa7=0xce;}_0x40a66c[_0x7031('0x23')](_0x3c0aa7);return _0x40a66c['set'](_0x7031('0x27'),_0x72ab48+'-'+_0x554a60+'/'+_0x269a20)[_0x7031('0x28')](_0xde757c);}return null;};}function patchUpdates(_0x17d4be){return function(_0x31036d){try{jsonpatch[_0x7031('0x29')](_0x31036d,_0x17d4be,!![]);}catch(_0x52bb56){return BPromise[_0x7031('0x2a')](_0x52bb56);}return _0x31036d[_0x7031('0x2b')]();};}function saveUpdates(_0x471aa3,_0x482be4){return function(_0x218cc7){if(_0x218cc7){return _0x218cc7['update'](_0x471aa3)[_0x7031('0x19')](function(_0x203e21){return _0x203e21;});}return null;};}function removeEntity(_0x5cd0ea,_0x2dd91f){return function(_0x132784){if(_0x132784){return _0x132784[_0x7031('0x2c')]()[_0x7031('0x19')](function(){_0x5cd0ea[_0x7031('0x23')](0xcc)[_0x7031('0x24')]();});}};}function handleEntityNotFound(_0xa198d9,_0x2ca31e){return function(_0x1e5959){if(!_0x1e5959){_0xa198d9[_0x7031('0x22')](0x194);}return _0x1e5959;};}function handleError(_0x1907b9,_0x3406f4){_0x3406f4=_0x3406f4||0x1f4;return function(_0x50beb9){logger[_0x7031('0x1e')](_0x50beb9[_0x7031('0x2d')]);if(_0x50beb9[_0x7031('0x2e')]){delete _0x50beb9[_0x7031('0x2e')];}_0x1907b9[_0x7031('0x23')](_0x3406f4)[_0x7031('0x2f')](_0x50beb9);};}exports[_0x7031('0x30')]=function(_0x35fddc,_0x49dc20){var _0x1c6bf6={},_0x58f279={},_0x231929={'count':0x0,'rows':[]};var _0x29b1e4=db[_0x7031('0x31')][_0x7031('0x32')];_0x58f279[_0x7031('0x33')]=_[_0x7031('0x34')](_0x29b1e4);var _0x22cfc0={'dateStart':_0x35fddc[_0x7031('0x35')][_0x7031('0x36')],'dateEnd':_0x35fddc[_0x7031('0x35')][_0x7031('0x37')]};delete _0x35fddc[_0x7031('0x35')]['dateStart'];delete _0x35fddc[_0x7031('0x35')]['dateEnd'];_0x58f279[_0x7031('0x35')]=_[_0x7031('0x34')](_0x35fddc['query']);_0x58f279['filters']=_[_0x7031('0x38')](_0x58f279[_0x7031('0x33')],_0x58f279[_0x7031('0x35')]);_0x1c6bf6[_0x7031('0x39')]=_[_0x7031('0x38')](_0x58f279[_0x7031('0x33')],qs[_0x7031('0x3a')](_0x35fddc[_0x7031('0x35')][_0x7031('0x3a')]));_0x1c6bf6[_0x7031('0x39')]=_0x1c6bf6[_0x7031('0x39')]['length']?_0x1c6bf6['attributes']:_0x58f279[_0x7031('0x33')];if(!_0x35fddc['query'][_0x7031('0x3b')](_0x7031('0x3c'))){_0x1c6bf6[_0x7031('0x26')]=qs['limit'](_0x35fddc['query']['limit']);_0x1c6bf6['offset']=qs[_0x7031('0x25')](_0x35fddc['query']['offset']);}_0x1c6bf6[_0x7031('0x3d')]=qs[_0x7031('0x3e')](_0x35fddc['query'][_0x7031('0x3e')]);_0x1c6bf6[_0x7031('0x3f')]=qs[_0x7031('0x40')](_[_0x7031('0x41')](_0x35fddc[_0x7031('0x35')],_0x58f279[_0x7031('0x40')]));if(_0x22cfc0['dateStart']){if(_0x22cfc0[_0x7031('0x37')]){_0x22cfc0[_0x7031('0x37')]=moment(_0x22cfc0[_0x7031('0x37')])[_0x7031('0x42')](0x1,'day');}else{_0x22cfc0['dateEnd']=moment(_0x22cfc0[_0x7031('0x36')])[_0x7031('0x42')](0x1,_0x7031('0x43'));}_[_0x7031('0x44')](_0x1c6bf6[_0x7031('0x3f')],{'createdAt':{'$gte':_0x22cfc0[_0x7031('0x36')],'$lte':_0x22cfc0['dateEnd']}});}if(_0x35fddc['query'][_0x7031('0x45')]){_0x1c6bf6[_0x7031('0x3f')]=_[_0x7031('0x44')](_0x1c6bf6['where'],{'$or':_[_0x7031('0x46')](_0x29b1e4,function(_0x42b1ad){if(_0x42b1ad[_0x7031('0x47')][_0x7031('0x48')]!=='VIRTUAL'){var _0x2bbb40={};_0x2bbb40[_0x42b1ad[_0x7031('0x49')]]={'$like':'%'+_0x35fddc[_0x7031('0x35')][_0x7031('0x45')]+'%'};return _0x2bbb40;}})});}_0x1c6bf6=_[_0x7031('0x44')]({},_0x1c6bf6,_0x35fddc['options']);var _0x865c33={'where':_0x1c6bf6[_0x7031('0x3f')]};return db[_0x7031('0x31')][_0x7031('0x4a')](_0x865c33)[_0x7031('0x19')](function(_0x3fb4de){_0x231929[_0x7031('0x4a')]=_0x3fb4de;if(_0x35fddc['query'][_0x7031('0x4b')]){_0x1c6bf6[_0x7031('0x4c')]=[{'all':!![]}];}return db[_0x7031('0x31')]['findAll'](_0x1c6bf6);})[_0x7031('0x19')](function(_0x21cccb){_0x231929[_0x7031('0x4d')]=_0x21cccb;return _0x231929;})[_0x7031('0x19')](respondWithFilteredResult(_0x49dc20,_0x1c6bf6))[_0x7031('0x21')](handleError(_0x49dc20,null));};exports[_0x7031('0x4e')]=function(_0x2f7e47,_0x59d8b6){var _0x16c830={'raw':![],'where':{'id':_0x2f7e47['params']['id']}},_0x3194ad={};_0x3194ad[_0x7031('0x33')]=_[_0x7031('0x34')](db[_0x7031('0x31')][_0x7031('0x32')]);_0x3194ad['query']=_[_0x7031('0x34')](_0x2f7e47[_0x7031('0x35')]);_0x3194ad[_0x7031('0x40')]=_['intersection'](_0x3194ad[_0x7031('0x33')],_0x3194ad[_0x7031('0x35')]);_0x16c830[_0x7031('0x39')]=_[_0x7031('0x38')](_0x3194ad[_0x7031('0x33')],qs[_0x7031('0x3a')](_0x2f7e47['query'][_0x7031('0x3a')]));_0x16c830[_0x7031('0x39')]=_0x16c830['attributes']['length']?_0x16c830[_0x7031('0x39')]:_0x3194ad[_0x7031('0x33')];if(_0x2f7e47[_0x7031('0x35')][_0x7031('0x4b')]){_0x16c830['include']=[{'all':!![]}];}_0x16c830=_[_0x7031('0x44')]({},_0x16c830,_0x2f7e47[_0x7031('0x4f')]);return db[_0x7031('0x31')][_0x7031('0x50')](_0x16c830)[_0x7031('0x19')](handleEntityNotFound(_0x59d8b6,null))[_0x7031('0x19')](respondWithResult(_0x59d8b6,null))[_0x7031('0x21')](handleError(_0x59d8b6,null));};exports['create']=function(_0x2ed496,_0x11488b){return db[_0x7031('0x31')][_0x7031('0x51')](_0x2ed496[_0x7031('0x52')],{})['then'](respondWithResult(_0x11488b,0xc9))[_0x7031('0x21')](handleError(_0x11488b,null));};exports['update']=function(_0x47db76,_0x10704c){if(_0x47db76['body']['id']){delete _0x47db76[_0x7031('0x52')]['id'];}return db[_0x7031('0x31')][_0x7031('0x50')]({'where':{'id':_0x47db76[_0x7031('0x53')]['id']}})[_0x7031('0x19')](handleEntityNotFound(_0x10704c,null))['then'](saveUpdates(_0x47db76[_0x7031('0x52')],null))['then'](respondWithResult(_0x10704c,null))[_0x7031('0x21')](handleError(_0x10704c,null));};exports['destroy']=function(_0x30c236,_0x21e330){return db[_0x7031('0x31')][_0x7031('0x50')]({'where':{'id':_0x30c236['params']['id']}})[_0x7031('0x19')](handleEntityNotFound(_0x21e330,null))[_0x7031('0x19')](removeEntity(_0x21e330,null))[_0x7031('0x21')](handleError(_0x21e330,null));};exports[_0x7031('0x54')]=function(_0x2dd835,_0x3d6e2c,_0x511d04){var _0xc737e1={};var _0xea6bf7={};var _0x502133;var _0x1da9e1;return db['SalesforceConfiguration'][_0x7031('0x55')]({'where':{'id':_0x2dd835[_0x7031('0x53')]['id']}})[_0x7031('0x19')](handleEntityNotFound(_0x3d6e2c,null))[_0x7031('0x19')](function(_0x2d0e66){if(_0x2d0e66){_0x502133=_0x2d0e66;_0xea6bf7['model']=_[_0x7031('0x34')](db[_0x7031('0x56')][_0x7031('0x32')]);_0xea6bf7['query']=_['keys'](_0x2dd835[_0x7031('0x35')]);_0xea6bf7[_0x7031('0x40')]=_['intersection'](_0xea6bf7[_0x7031('0x33')],_0xea6bf7[_0x7031('0x35')]);_0xc737e1[_0x7031('0x39')]=_['intersection'](_0xea6bf7[_0x7031('0x33')],qs['fields'](_0x2dd835['query'][_0x7031('0x3a')]));_0xc737e1[_0x7031('0x39')]=_0xc737e1[_0x7031('0x39')][_0x7031('0x57')]?_0xc737e1['attributes']:_0xea6bf7[_0x7031('0x33')];_0xc737e1[_0x7031('0x3d')]=qs[_0x7031('0x3e')](_0x2dd835[_0x7031('0x35')][_0x7031('0x3e')]);_0xc737e1[_0x7031('0x3f')]=qs['filters'](_[_0x7031('0x41')](_0x2dd835[_0x7031('0x35')],_0xea6bf7[_0x7031('0x40')]));if(_0x2dd835['query'][_0x7031('0x45')]){_0xc737e1['where']=_[_0x7031('0x44')](_0xc737e1[_0x7031('0x3f')],{'$or':_['map'](_0xc737e1['attributes'],function(_0x4d3390){var _0x349b56={};_0x349b56[_0x4d3390]={'$like':'%'+_0x2dd835[_0x7031('0x35')][_0x7031('0x45')]+'%'};return _0x349b56;})});}_0xc737e1=_[_0x7031('0x44')]({},_0xc737e1,_0x2dd835[_0x7031('0x4f')]);return _0x502133['getFields'](_0xc737e1);}})[_0x7031('0x19')](function(_0x505764){if(_0x505764){_0x1da9e1=_0x505764[_0x7031('0x57')];if(!_0x2dd835[_0x7031('0x35')][_0x7031('0x3b')](_0x7031('0x3c'))){_0xc737e1[_0x7031('0x26')]=qs[_0x7031('0x26')](_0x2dd835[_0x7031('0x35')][_0x7031('0x26')]);_0xc737e1['offset']=qs[_0x7031('0x25')](_0x2dd835[_0x7031('0x35')]['offset']);}return _0x502133['getFields'](_0xc737e1);}})[_0x7031('0x19')](function(_0x556e9c){if(_0x556e9c){return _0x556e9c?{'count':_0x1da9e1,'rows':_0x556e9c}:null;}})['then'](respondWithResult(_0x3d6e2c,null))[_0x7031('0x21')](handleError(_0x3d6e2c,null));};exports[_0x7031('0x58')]=function(_0xae3003,_0x2fead3,_0x4cb32b){var _0x2e169d={};var _0x426967={};var _0x4137e9;var _0x562f68;return db['SalesforceConfiguration'][_0x7031('0x55')]({'where':{'id':_0xae3003[_0x7031('0x53')]['id']}})[_0x7031('0x19')](handleEntityNotFound(_0x2fead3,null))[_0x7031('0x19')](function(_0x3293e3){if(_0x3293e3){_0x4137e9=_0x3293e3;_0x426967['model']=_[_0x7031('0x34')](db['SalesforceField'][_0x7031('0x32')]);_0x426967[_0x7031('0x35')]=_[_0x7031('0x34')](_0xae3003['query']);_0x426967[_0x7031('0x40')]=_['intersection'](_0x426967[_0x7031('0x33')],_0x426967[_0x7031('0x35')]);_0x2e169d[_0x7031('0x39')]=_['intersection'](_0x426967[_0x7031('0x33')],qs[_0x7031('0x3a')](_0xae3003['query'][_0x7031('0x3a')]));_0x2e169d[_0x7031('0x39')]=_0x2e169d['attributes']['length']?_0x2e169d['attributes']:_0x426967['model'];_0x2e169d[_0x7031('0x3d')]=qs[_0x7031('0x3e')](_0xae3003[_0x7031('0x35')][_0x7031('0x3e')]);_0x2e169d[_0x7031('0x3f')]=qs[_0x7031('0x40')](_[_0x7031('0x41')](_0xae3003['query'],_0x426967['filters']));if(_0xae3003[_0x7031('0x35')][_0x7031('0x45')]){_0x2e169d['where']=_[_0x7031('0x44')](_0x2e169d[_0x7031('0x3f')],{'$or':_['map'](_0x2e169d[_0x7031('0x39')],function(_0x555d17){var _0xc80e7e={};_0xc80e7e[_0x555d17]={'$like':'%'+_0xae3003[_0x7031('0x35')]['filter']+'%'};return _0xc80e7e;})});}_0x2e169d=_[_0x7031('0x44')]({},_0x2e169d,_0xae3003[_0x7031('0x4f')]);return _0x4137e9[_0x7031('0x58')](_0x2e169d);}})['then'](function(_0x48a91e){if(_0x48a91e){_0x562f68=_0x48a91e[_0x7031('0x57')];if(!_0xae3003[_0x7031('0x35')][_0x7031('0x3b')]('nolimit')){_0x2e169d[_0x7031('0x26')]=qs[_0x7031('0x26')](_0xae3003[_0x7031('0x35')][_0x7031('0x26')]);_0x2e169d[_0x7031('0x25')]=qs[_0x7031('0x25')](_0xae3003[_0x7031('0x35')][_0x7031('0x25')]);}return _0x4137e9['getSubjects'](_0x2e169d);}})[_0x7031('0x19')](function(_0x1075ef){if(_0x1075ef){return _0x1075ef?{'count':_0x562f68,'rows':_0x1075ef}:null;}})[_0x7031('0x19')](respondWithResult(_0x2fead3,null))[_0x7031('0x21')](handleError(_0x2fead3,null));};exports[_0x7031('0x59')]=function(_0x609287,_0x86d24c,_0x1c2004){var _0x3caf65={};var _0x204278={};var _0x2fa4b6;var _0xcb144;return db[_0x7031('0x31')]['findOne']({'where':{'id':_0x609287[_0x7031('0x53')]['id']}})['then'](handleEntityNotFound(_0x86d24c,null))[_0x7031('0x19')](function(_0x2f728f){if(_0x2f728f){_0x2fa4b6=_0x2f728f;_0x204278[_0x7031('0x33')]=_[_0x7031('0x34')](db['SalesforceField'][_0x7031('0x32')]);_0x204278[_0x7031('0x35')]=_[_0x7031('0x34')](_0x609287['query']);_0x204278[_0x7031('0x40')]=_[_0x7031('0x38')](_0x204278['model'],_0x204278[_0x7031('0x35')]);_0x3caf65[_0x7031('0x39')]=_[_0x7031('0x38')](_0x204278[_0x7031('0x33')],qs[_0x7031('0x3a')](_0x609287[_0x7031('0x35')][_0x7031('0x3a')]));_0x3caf65[_0x7031('0x39')]=_0x3caf65[_0x7031('0x39')]['length']?_0x3caf65[_0x7031('0x39')]:_0x204278['model'];_0x3caf65[_0x7031('0x3d')]=qs['sort'](_0x609287[_0x7031('0x35')][_0x7031('0x3e')]);_0x3caf65['where']=qs['filters'](_[_0x7031('0x41')](_0x609287['query'],_0x204278[_0x7031('0x40')]));if(_0x609287[_0x7031('0x35')][_0x7031('0x45')]){_0x3caf65[_0x7031('0x3f')]=_[_0x7031('0x44')](_0x3caf65[_0x7031('0x3f')],{'$or':_[_0x7031('0x46')](_0x3caf65['attributes'],function(_0x49c022){var _0x260266={};_0x260266[_0x49c022]={'$like':'%'+_0x609287[_0x7031('0x35')][_0x7031('0x45')]+'%'};return _0x260266;})});}_0x3caf65=_['merge']({},_0x3caf65,_0x609287[_0x7031('0x4f')]);return _0x2fa4b6[_0x7031('0x59')](_0x3caf65);}})[_0x7031('0x19')](function(_0x49701c){if(_0x49701c){_0xcb144=_0x49701c[_0x7031('0x57')];if(!_0x609287['query']['hasOwnProperty'](_0x7031('0x3c'))){_0x3caf65[_0x7031('0x26')]=qs[_0x7031('0x26')](_0x609287[_0x7031('0x35')][_0x7031('0x26')]);_0x3caf65['offset']=qs[_0x7031('0x25')](_0x609287['query'][_0x7031('0x25')]);}return _0x2fa4b6['getDescriptions'](_0x3caf65);}})['then'](function(_0x4685a3){if(_0x4685a3){return _0x4685a3?{'count':_0xcb144,'rows':_0x4685a3}:null;}})[_0x7031('0x19')](respondWithResult(_0x86d24c,null))[_0x7031('0x21')](handleError(_0x86d24c,null));};
\ No newline at end of file
+var _0x9057=['length','nolimit','order','sort','pick','add','merge','where','filter','map','type','key','field','options','count','includeAll','include','rows','show','params','keys','fields','find','create','body','findOne','SalesforceField','getFields','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','http','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','SalesforceConfiguration','rawAttributes','model','query','dateStart','dateEnd','filters','intersection','attributes'];(function(_0xdec73e,_0x1749a1){var _0x23f232=function(_0x2e50d6){while(--_0x2e50d6){_0xdec73e['push'](_0xdec73e['shift']());}};_0x23f232(++_0x1749a1);}(_0x9057,0x17f));var _0x7905=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x9057[_0x56fe98];return _0x212f4f;};'use strict';var pdf=require(_0x7905('0x0'));var emlformat=require(_0x7905('0x1'));var rimraf=require(_0x7905('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7905('0x3'));var rp=require('request-promise');var moment=require(_0x7905('0x4'));var BPromise=require(_0x7905('0x5'));var Mustache=require(_0x7905('0x6'));var util=require('util');var path=require(_0x7905('0x7'));var sox=require('sox');var csv=require(_0x7905('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7905('0x9'));var squel=require('squel');var crypto=require(_0x7905('0xa'));var jsforce=require(_0x7905('0xb'));var deskjs=require(_0x7905('0xc'));var toCsv=require(_0x7905('0x8'));var querystring=require(_0x7905('0xd'));var Papa=require(_0x7905('0xe'));var Redis=require(_0x7905('0xf'));var qs=require(_0x7905('0x10'));var logger=require(_0x7905('0x11'))(_0x7905('0x12'));var utils=require(_0x7905('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x7905('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x49d53f,_0x4a0e2a,_0x1343b2,_0x2adf1b){return new BPromise(function(_0x594235,_0x2c55ac){var _0x74b6f0=_0x2adf1b||client;return _0x74b6f0['request'](_0x49d53f,_0x1343b2)['then'](function(_0x5f558b){logger[_0x7905('0x15')](_0x7905('0x16'),_0x4a0e2a,_0x7905('0x17'));logger[_0x7905('0x18')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4a0e2a,_0x7905('0x17'),JSON[_0x7905('0x19')](_0x5f558b));if(_0x5f558b['error']){if(_0x5f558b[_0x7905('0x1a')][_0x7905('0x1b')]===0x1f4){logger[_0x7905('0x1a')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4a0e2a,_0x5f558b[_0x7905('0x1a')]['message']);return _0x2c55ac(_0x5f558b[_0x7905('0x1a')][_0x7905('0x1c')]);}logger['error'](_0x7905('0x16'),_0x4a0e2a,_0x5f558b[_0x7905('0x1a')]['message']);return _0x594235(_0x5f558b[_0x7905('0x1a')]['message']);}else{logger['info'](_0x7905('0x16'),_0x4a0e2a,_0x7905('0x17'));_0x594235(_0x5f558b[_0x7905('0x1d')][_0x7905('0x1c')]);}})[_0x7905('0x1e')](function(_0x47e0dd){logger['error'](_0x7905('0x16'),_0x4a0e2a,_0x47e0dd);_0x2c55ac(_0x47e0dd);});});}function respondWithStatusCode(_0x54ec50,_0x4aa26c){_0x4aa26c=_0x4aa26c||0xcc;return function(_0xf32387){if(_0xf32387){return _0x54ec50[_0x7905('0x1f')](_0x4aa26c);}return _0x54ec50[_0x7905('0x20')](_0x4aa26c)[_0x7905('0x21')]();};}function respondWithResult(_0x6686a2,_0x140b9f){_0x140b9f=_0x140b9f||0xc8;return function(_0x4d803c){if(_0x4d803c){return _0x6686a2[_0x7905('0x20')](_0x140b9f)['json'](_0x4d803c);}};}function respondWithFilteredResult(_0x279d1e,_0x756952){return function(_0x4df2d7){if(_0x4df2d7){var _0x205b69=_0x4df2d7['count'],_0x2f2ef7=_0x756952[_0x7905('0x22')],_0x4d7117=_0x756952['offset']+_0x756952[_0x7905('0x23')],_0x424d6b;if(_0x4d7117>=_0x205b69){_0x4d7117=_0x205b69;_0x424d6b=0xc8;}else{_0x424d6b=0xce;}_0x279d1e[_0x7905('0x20')](_0x424d6b);return _0x279d1e[_0x7905('0x24')](_0x7905('0x25'),_0x2f2ef7+'-'+_0x4d7117+'/'+_0x205b69)[_0x7905('0x26')](_0x4df2d7);}return null;};}function patchUpdates(_0xa6cfce){return function(_0x2ea771){try{jsonpatch['apply'](_0x2ea771,_0xa6cfce,!![]);}catch(_0x4b3bad){return BPromise[_0x7905('0x27')](_0x4b3bad);}return _0x2ea771[_0x7905('0x28')]();};}function saveUpdates(_0x3e71d8,_0x5d53c8){return function(_0x2c8f2a){if(_0x2c8f2a){return _0x2c8f2a[_0x7905('0x29')](_0x3e71d8)[_0x7905('0x2a')](function(_0x459d33){return _0x459d33;});}return null;};}function removeEntity(_0x407f5a,_0x3a2ac7){return function(_0x149e89){if(_0x149e89){return _0x149e89[_0x7905('0x2b')]()[_0x7905('0x2a')](function(){_0x407f5a['status'](0xcc)[_0x7905('0x21')]();});}};}function handleEntityNotFound(_0x50376c,_0x59a966){return function(_0x5d2078){if(!_0x5d2078){_0x50376c[_0x7905('0x1f')](0x194);}return _0x5d2078;};}function handleError(_0x36fec1,_0x2cec8e){_0x2cec8e=_0x2cec8e||0x1f4;return function(_0x57aa4b){logger[_0x7905('0x1a')](_0x57aa4b[_0x7905('0x2c')]);if(_0x57aa4b['name']){delete _0x57aa4b[_0x7905('0x2d')];}_0x36fec1[_0x7905('0x20')](_0x2cec8e)[_0x7905('0x2e')](_0x57aa4b);};}exports[_0x7905('0x2f')]=function(_0x33ae88,_0x470812){var _0x49d0b6={},_0x4ecb36={},_0xf8e543={'count':0x0,'rows':[]};var _0x813795=db[_0x7905('0x30')][_0x7905('0x31')];_0x4ecb36[_0x7905('0x32')]=_['keys'](_0x813795);var _0x3dcc97={'dateStart':_0x33ae88[_0x7905('0x33')][_0x7905('0x34')],'dateEnd':_0x33ae88[_0x7905('0x33')][_0x7905('0x35')]};delete _0x33ae88[_0x7905('0x33')]['dateStart'];delete _0x33ae88['query'][_0x7905('0x35')];_0x4ecb36[_0x7905('0x33')]=_['keys'](_0x33ae88['query']);_0x4ecb36[_0x7905('0x36')]=_[_0x7905('0x37')](_0x4ecb36[_0x7905('0x32')],_0x4ecb36[_0x7905('0x33')]);_0x49d0b6[_0x7905('0x38')]=_[_0x7905('0x37')](_0x4ecb36[_0x7905('0x32')],qs['fields'](_0x33ae88['query']['fields']));_0x49d0b6['attributes']=_0x49d0b6[_0x7905('0x38')][_0x7905('0x39')]?_0x49d0b6[_0x7905('0x38')]:_0x4ecb36[_0x7905('0x32')];if(!_0x33ae88[_0x7905('0x33')]['hasOwnProperty'](_0x7905('0x3a'))){_0x49d0b6[_0x7905('0x23')]=qs[_0x7905('0x23')](_0x33ae88[_0x7905('0x33')]['limit']);_0x49d0b6[_0x7905('0x22')]=qs['offset'](_0x33ae88[_0x7905('0x33')][_0x7905('0x22')]);}_0x49d0b6[_0x7905('0x3b')]=qs[_0x7905('0x3c')](_0x33ae88[_0x7905('0x33')][_0x7905('0x3c')]);_0x49d0b6['where']=qs['filters'](_[_0x7905('0x3d')](_0x33ae88['query'],_0x4ecb36[_0x7905('0x36')]));if(_0x3dcc97[_0x7905('0x34')]){if(_0x3dcc97[_0x7905('0x35')]){_0x3dcc97[_0x7905('0x35')]=moment(_0x3dcc97[_0x7905('0x35')])[_0x7905('0x3e')](0x1,'day');}else{_0x3dcc97['dateEnd']=moment(_0x3dcc97['dateStart'])['add'](0x1,'day');}_[_0x7905('0x3f')](_0x49d0b6[_0x7905('0x40')],{'createdAt':{'$gte':_0x3dcc97[_0x7905('0x34')],'$lte':_0x3dcc97[_0x7905('0x35')]}});}if(_0x33ae88['query'][_0x7905('0x41')]){_0x49d0b6[_0x7905('0x40')]=_['merge'](_0x49d0b6['where'],{'$or':_[_0x7905('0x42')](_0x813795,function(_0x457bed){if(_0x457bed[_0x7905('0x43')][_0x7905('0x44')]!=='VIRTUAL'){var _0x21290a={};_0x21290a[_0x457bed[_0x7905('0x45')]]={'$like':'%'+_0x33ae88[_0x7905('0x33')][_0x7905('0x41')]+'%'};return _0x21290a;}})});}_0x49d0b6=_[_0x7905('0x3f')]({},_0x49d0b6,_0x33ae88[_0x7905('0x46')]);var _0xb909d8={'where':_0x49d0b6[_0x7905('0x40')]};return db[_0x7905('0x30')][_0x7905('0x47')](_0xb909d8)[_0x7905('0x2a')](function(_0x4dad89){_0xf8e543[_0x7905('0x47')]=_0x4dad89;if(_0x33ae88[_0x7905('0x33')][_0x7905('0x48')]){_0x49d0b6[_0x7905('0x49')]=[{'all':!![]}];}return db[_0x7905('0x30')]['findAll'](_0x49d0b6);})[_0x7905('0x2a')](function(_0x136a63){_0xf8e543[_0x7905('0x4a')]=_0x136a63;return _0xf8e543;})[_0x7905('0x2a')](respondWithFilteredResult(_0x470812,_0x49d0b6))[_0x7905('0x1e')](handleError(_0x470812,null));};exports[_0x7905('0x4b')]=function(_0xd3b4b3,_0x1ba865){var _0x580fce={'raw':![],'where':{'id':_0xd3b4b3[_0x7905('0x4c')]['id']}},_0x5369ee={};_0x5369ee[_0x7905('0x32')]=_['keys'](db[_0x7905('0x30')][_0x7905('0x31')]);_0x5369ee[_0x7905('0x33')]=_[_0x7905('0x4d')](_0xd3b4b3[_0x7905('0x33')]);_0x5369ee[_0x7905('0x36')]=_[_0x7905('0x37')](_0x5369ee['model'],_0x5369ee[_0x7905('0x33')]);_0x580fce[_0x7905('0x38')]=_[_0x7905('0x37')](_0x5369ee[_0x7905('0x32')],qs[_0x7905('0x4e')](_0xd3b4b3['query'][_0x7905('0x4e')]));_0x580fce[_0x7905('0x38')]=_0x580fce[_0x7905('0x38')][_0x7905('0x39')]?_0x580fce['attributes']:_0x5369ee[_0x7905('0x32')];if(_0xd3b4b3['query'][_0x7905('0x48')]){_0x580fce[_0x7905('0x49')]=[{'all':!![]}];}_0x580fce=_[_0x7905('0x3f')]({},_0x580fce,_0xd3b4b3[_0x7905('0x46')]);return db[_0x7905('0x30')][_0x7905('0x4f')](_0x580fce)[_0x7905('0x2a')](handleEntityNotFound(_0x1ba865,null))[_0x7905('0x2a')](respondWithResult(_0x1ba865,null))['catch'](handleError(_0x1ba865,null));};exports['create']=function(_0x545078,_0x3cc798){return db[_0x7905('0x30')][_0x7905('0x50')](_0x545078['body'],{})[_0x7905('0x2a')](respondWithResult(_0x3cc798,0xc9))[_0x7905('0x1e')](handleError(_0x3cc798,null));};exports[_0x7905('0x29')]=function(_0x1b71b2,_0x2ffdeb){if(_0x1b71b2['body']['id']){delete _0x1b71b2['body']['id'];}return db[_0x7905('0x30')][_0x7905('0x4f')]({'where':{'id':_0x1b71b2[_0x7905('0x4c')]['id']}})[_0x7905('0x2a')](handleEntityNotFound(_0x2ffdeb,null))['then'](saveUpdates(_0x1b71b2[_0x7905('0x51')],null))[_0x7905('0x2a')](respondWithResult(_0x2ffdeb,null))[_0x7905('0x1e')](handleError(_0x2ffdeb,null));};exports[_0x7905('0x2b')]=function(_0x27d54a,_0x454c8a){return db[_0x7905('0x30')][_0x7905('0x4f')]({'where':{'id':_0x27d54a['params']['id']}})[_0x7905('0x2a')](handleEntityNotFound(_0x454c8a,null))[_0x7905('0x2a')](removeEntity(_0x454c8a,null))[_0x7905('0x1e')](handleError(_0x454c8a,null));};exports['getFields']=function(_0xbf77c,_0x5ce969,_0x42cbe0){var _0x262eb1={};var _0x568c28={};var _0x5216b0;var _0x43262a;return db['SalesforceConfiguration'][_0x7905('0x52')]({'where':{'id':_0xbf77c[_0x7905('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5ce969,null))[_0x7905('0x2a')](function(_0x35ddcc){if(_0x35ddcc){_0x5216b0=_0x35ddcc;_0x568c28[_0x7905('0x32')]=_[_0x7905('0x4d')](db[_0x7905('0x53')][_0x7905('0x31')]);_0x568c28[_0x7905('0x33')]=_['keys'](_0xbf77c[_0x7905('0x33')]);_0x568c28[_0x7905('0x36')]=_[_0x7905('0x37')](_0x568c28[_0x7905('0x32')],_0x568c28[_0x7905('0x33')]);_0x262eb1[_0x7905('0x38')]=_['intersection'](_0x568c28[_0x7905('0x32')],qs[_0x7905('0x4e')](_0xbf77c[_0x7905('0x33')][_0x7905('0x4e')]));_0x262eb1[_0x7905('0x38')]=_0x262eb1[_0x7905('0x38')][_0x7905('0x39')]?_0x262eb1[_0x7905('0x38')]:_0x568c28[_0x7905('0x32')];_0x262eb1[_0x7905('0x3b')]=qs[_0x7905('0x3c')](_0xbf77c[_0x7905('0x33')]['sort']);_0x262eb1[_0x7905('0x40')]=qs['filters'](_[_0x7905('0x3d')](_0xbf77c[_0x7905('0x33')],_0x568c28[_0x7905('0x36')]));if(_0xbf77c[_0x7905('0x33')][_0x7905('0x41')]){_0x262eb1[_0x7905('0x40')]=_[_0x7905('0x3f')](_0x262eb1[_0x7905('0x40')],{'$or':_['map'](_0x262eb1[_0x7905('0x38')],function(_0x3d3f9){var _0x128d56={};_0x128d56[_0x3d3f9]={'$like':'%'+_0xbf77c[_0x7905('0x33')][_0x7905('0x41')]+'%'};return _0x128d56;})});}_0x262eb1=_[_0x7905('0x3f')]({},_0x262eb1,_0xbf77c['options']);return _0x5216b0[_0x7905('0x54')](_0x262eb1);}})[_0x7905('0x2a')](function(_0x237729){if(_0x237729){_0x43262a=_0x237729[_0x7905('0x39')];if(!_0xbf77c[_0x7905('0x33')][_0x7905('0x55')]('nolimit')){_0x262eb1[_0x7905('0x23')]=qs[_0x7905('0x23')](_0xbf77c['query'][_0x7905('0x23')]);_0x262eb1[_0x7905('0x22')]=qs['offset'](_0xbf77c['query'][_0x7905('0x22')]);}return _0x5216b0[_0x7905('0x54')](_0x262eb1);}})[_0x7905('0x2a')](function(_0x1a6826){if(_0x1a6826){return _0x1a6826?{'count':_0x43262a,'rows':_0x1a6826}:null;}})[_0x7905('0x2a')](respondWithResult(_0x5ce969,null))[_0x7905('0x1e')](handleError(_0x5ce969,null));};exports[_0x7905('0x56')]=function(_0x59e46e,_0x83e4b5,_0x304719){var _0x26ade1={};var _0x42bd6a={};var _0x525c28;var _0x37bb91;return db[_0x7905('0x30')][_0x7905('0x52')]({'where':{'id':_0x59e46e[_0x7905('0x4c')]['id']}})['then'](handleEntityNotFound(_0x83e4b5,null))['then'](function(_0x2aa8cc){if(_0x2aa8cc){_0x525c28=_0x2aa8cc;_0x42bd6a[_0x7905('0x32')]=_[_0x7905('0x4d')](db[_0x7905('0x53')][_0x7905('0x31')]);_0x42bd6a[_0x7905('0x33')]=_['keys'](_0x59e46e[_0x7905('0x33')]);_0x42bd6a[_0x7905('0x36')]=_[_0x7905('0x37')](_0x42bd6a['model'],_0x42bd6a[_0x7905('0x33')]);_0x26ade1[_0x7905('0x38')]=_[_0x7905('0x37')](_0x42bd6a[_0x7905('0x32')],qs[_0x7905('0x4e')](_0x59e46e[_0x7905('0x33')][_0x7905('0x4e')]));_0x26ade1['attributes']=_0x26ade1['attributes'][_0x7905('0x39')]?_0x26ade1['attributes']:_0x42bd6a[_0x7905('0x32')];_0x26ade1[_0x7905('0x3b')]=qs[_0x7905('0x3c')](_0x59e46e[_0x7905('0x33')][_0x7905('0x3c')]);_0x26ade1[_0x7905('0x40')]=qs[_0x7905('0x36')](_['pick'](_0x59e46e['query'],_0x42bd6a[_0x7905('0x36')]));if(_0x59e46e[_0x7905('0x33')]['filter']){_0x26ade1[_0x7905('0x40')]=_[_0x7905('0x3f')](_0x26ade1['where'],{'$or':_[_0x7905('0x42')](_0x26ade1[_0x7905('0x38')],function(_0x3a0d24){var _0xbb67c7={};_0xbb67c7[_0x3a0d24]={'$like':'%'+_0x59e46e['query'][_0x7905('0x41')]+'%'};return _0xbb67c7;})});}_0x26ade1=_[_0x7905('0x3f')]({},_0x26ade1,_0x59e46e['options']);return _0x525c28[_0x7905('0x56')](_0x26ade1);}})[_0x7905('0x2a')](function(_0x3f8670){if(_0x3f8670){_0x37bb91=_0x3f8670['length'];if(!_0x59e46e[_0x7905('0x33')]['hasOwnProperty'](_0x7905('0x3a'))){_0x26ade1[_0x7905('0x23')]=qs['limit'](_0x59e46e['query'][_0x7905('0x23')]);_0x26ade1[_0x7905('0x22')]=qs['offset'](_0x59e46e['query']['offset']);}return _0x525c28[_0x7905('0x56')](_0x26ade1);}})[_0x7905('0x2a')](function(_0x4e7fdd){if(_0x4e7fdd){return _0x4e7fdd?{'count':_0x37bb91,'rows':_0x4e7fdd}:null;}})[_0x7905('0x2a')](respondWithResult(_0x83e4b5,null))[_0x7905('0x1e')](handleError(_0x83e4b5,null));};exports[_0x7905('0x57')]=function(_0x4e61b9,_0x51893d,_0x5a1265){var _0x18242e={};var _0xf35fb={};var _0x4bd375;var _0x4a1141;return db[_0x7905('0x30')]['findOne']({'where':{'id':_0x4e61b9[_0x7905('0x4c')]['id']}})[_0x7905('0x2a')](handleEntityNotFound(_0x51893d,null))['then'](function(_0x1ab6ea){if(_0x1ab6ea){_0x4bd375=_0x1ab6ea;_0xf35fb[_0x7905('0x32')]=_[_0x7905('0x4d')](db[_0x7905('0x53')][_0x7905('0x31')]);_0xf35fb[_0x7905('0x33')]=_[_0x7905('0x4d')](_0x4e61b9[_0x7905('0x33')]);_0xf35fb[_0x7905('0x36')]=_['intersection'](_0xf35fb[_0x7905('0x32')],_0xf35fb[_0x7905('0x33')]);_0x18242e[_0x7905('0x38')]=_[_0x7905('0x37')](_0xf35fb[_0x7905('0x32')],qs[_0x7905('0x4e')](_0x4e61b9[_0x7905('0x33')][_0x7905('0x4e')]));_0x18242e[_0x7905('0x38')]=_0x18242e[_0x7905('0x38')][_0x7905('0x39')]?_0x18242e[_0x7905('0x38')]:_0xf35fb[_0x7905('0x32')];_0x18242e['order']=qs[_0x7905('0x3c')](_0x4e61b9[_0x7905('0x33')][_0x7905('0x3c')]);_0x18242e[_0x7905('0x40')]=qs[_0x7905('0x36')](_[_0x7905('0x3d')](_0x4e61b9[_0x7905('0x33')],_0xf35fb[_0x7905('0x36')]));if(_0x4e61b9[_0x7905('0x33')]['filter']){_0x18242e[_0x7905('0x40')]=_[_0x7905('0x3f')](_0x18242e['where'],{'$or':_[_0x7905('0x42')](_0x18242e[_0x7905('0x38')],function(_0xf72ff6){var _0x1dfb3d={};_0x1dfb3d[_0xf72ff6]={'$like':'%'+_0x4e61b9['query'][_0x7905('0x41')]+'%'};return _0x1dfb3d;})});}_0x18242e=_['merge']({},_0x18242e,_0x4e61b9[_0x7905('0x46')]);return _0x4bd375['getDescriptions'](_0x18242e);}})[_0x7905('0x2a')](function(_0x117477){if(_0x117477){_0x4a1141=_0x117477[_0x7905('0x39')];if(!_0x4e61b9['query'][_0x7905('0x55')]('nolimit')){_0x18242e['limit']=qs['limit'](_0x4e61b9['query']['limit']);_0x18242e[_0x7905('0x22')]=qs[_0x7905('0x22')](_0x4e61b9[_0x7905('0x33')][_0x7905('0x22')]);}return _0x4bd375['getDescriptions'](_0x18242e);}})[_0x7905('0x2a')](function(_0x2bc683){if(_0x2bc683){return _0x2bc683?{'count':_0x4a1141,'rows':_0x2bc683}:null;}})[_0x7905('0x2a')](respondWithResult(_0x51893d,null))[_0x7905('0x1e')](handleError(_0x51893d,null));};
\ No newline at end of file
index a936075..7d69f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd758=['lodash','util','../../config/logger','api','moment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd758,0x172));var _0x8d75=function(_0x5a5886,_0x4b8959){_0x5a5886=_0x5a5886-0x0;var _0x3eebd1=_0xd758[_0x5a5886];return _0x3eebd1;};'use strict';var _=require(_0x8d75('0x0'));var util=require(_0x8d75('0x1'));var logger=require(_0x8d75('0x2'))(_0x8d75('0x3'));var moment=require(_0x8d75('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x8d75('0x5'));module[_0x8d75('0x6')]=function(_0x2b06a7,_0x50247f){return _0x2b06a7[_0x8d75('0x7')](_0x8d75('0x8'),attributes,{'tableName':_0x8d75('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a21=['SalesforceConfiguration','lodash','util','../../config/logger','api','request-promise','./intSalesforceConfiguration.attributes'];(function(_0x5ea300,_0x5eb407){var _0x37e0bf=function(_0x54735e){while(--_0x54735e){_0x5ea300['push'](_0x5ea300['shift']());}};_0x37e0bf(++_0x5eb407);}(_0x7a21,0x1c8));var _0x17a2=function(_0x5f49e8,_0x4f12c7){_0x5f49e8=_0x5f49e8-0x0;var _0x2ae72d=_0x7a21[_0x5f49e8];return _0x2ae72d;};'use strict';var _=require(_0x17a2('0x0'));var util=require(_0x17a2('0x1'));var logger=require(_0x17a2('0x2'))(_0x17a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x17a2('0x4'));var attributes=require(_0x17a2('0x5'));module['exports']=function(_0x27b2cc,_0x383060){return _0x27b2cc['define'](_0x17a2('0x6'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 064dfc3..9dabff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','SalesforceConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x472584,_0x1b8b1a){_0x472584=_0x472584-0x0;var _0x135551=_0x7a54[_0x472584];return _0x135551;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
index 8d330f1..bebaa3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b92=['/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0x7b92,0xd8));var _0x27b9=function(_0x50f0a9,_0x2b0c57){_0x50f0a9=_0x50f0a9-0x0;var _0x5a33d9=_0x7b92[_0x50f0a9];return _0x5a33d9;};'use strict';var multer=require(_0x27b9('0x0'));var util=require(_0x27b9('0x1'));var path=require(_0x27b9('0x2'));var timeout=require(_0x27b9('0x3'));var express=require(_0x27b9('0x4'));var router=express[_0x27b9('0x5')]();var auth=require(_0x27b9('0x6'));var interaction=require(_0x27b9('0x7'));var config=require(_0x27b9('0x8'));var controller=require(_0x27b9('0x9'));router[_0x27b9('0xa')]('/',auth[_0x27b9('0xb')](),controller['index']);router[_0x27b9('0xa')](_0x27b9('0xc'),auth['isAuthenticated'](),controller[_0x27b9('0xd')]);router[_0x27b9('0xe')]('/',auth[_0x27b9('0xb')](),controller[_0x27b9('0xf')]);router[_0x27b9('0x10')](_0x27b9('0xc'),auth[_0x27b9('0xb')](),controller[_0x27b9('0x11')]);router['delete']('/:id',auth[_0x27b9('0xb')](),controller['destroy']);module[_0x27b9('0x12')]=router;
\ No newline at end of file
+var _0x8b07=['isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','index','get','/:id'];(function(_0x4e5e92,_0x4e657e){var _0x486c68=function(_0x35966f){while(--_0x35966f){_0x4e5e92['push'](_0x4e5e92['shift']());}};_0x486c68(++_0x4e657e);}(_0x8b07,0xd3));var _0x78b0=function(_0x1dae2a,_0x3d64f8){_0x1dae2a=_0x1dae2a-0x0;var _0x577e01=_0x8b07[_0x1dae2a];return _0x577e01;};'use strict';var multer=require('multer');var util=require(_0x78b0('0x0'));var path=require(_0x78b0('0x1'));var timeout=require(_0x78b0('0x2'));var express=require('express');var router=express[_0x78b0('0x3')]();var auth=require(_0x78b0('0x4'));var interaction=require(_0x78b0('0x5'));var config=require('../../config/environment');var controller=require(_0x78b0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x78b0('0x7')]);router[_0x78b0('0x8')](_0x78b0('0x9'),auth[_0x78b0('0xa')](),controller[_0x78b0('0xb')]);router['post']('/',auth[_0x78b0('0xa')](),controller['create']);router[_0x78b0('0xc')](_0x78b0('0x9'),auth[_0x78b0('0xa')](),controller[_0x78b0('0xd')]);router[_0x78b0('0xe')](_0x78b0('0x9'),auth[_0x78b0('0xa')](),controller[_0x78b0('0xf')]);module[_0x78b0('0x10')]=router;
\ No newline at end of file
index 0a8a7d4..7425976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29ce=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x145e2f,_0x2f3d1f){var _0x1aa0c3=function(_0x6de838){while(--_0x6de838){_0x145e2f['push'](_0x145e2f['shift']());}};_0x1aa0c3(++_0x2f3d1f);}(_0x29ce,0x189));var _0xe29c=function(_0x29d797,_0x5efe81){_0x29d797=_0x29d797-0x0;var _0x1b5e83=_0x29ce[_0x29d797];return _0x1b5e83;};'use strict';var Sequelize=require(_0xe29c('0x0'));module[_0xe29c('0x1')]={'type':{'type':Sequelize[_0xe29c('0x2')](_0xe29c('0x3'),_0xe29c('0x4'),'customVariable',_0xe29c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe29c('0x6')]},'keyType':{'type':Sequelize[_0xe29c('0x2')](_0xe29c('0x3'),'variable',_0xe29c('0x7'))},'keyContent':{'type':Sequelize[_0xe29c('0x6')]},'idField':{'type':Sequelize[_0xe29c('0x6')]},'variableName':{'type':Sequelize[_0xe29c('0x6')]}};
\ No newline at end of file
+var _0x6af5=['keyValue','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4f034d,_0x2abdd7){var _0x21f2f4=function(_0x2a6d9c){while(--_0x2a6d9c){_0x4f034d['push'](_0x4f034d['shift']());}};_0x21f2f4(++_0x2abdd7);}(_0x6af5,0x14a));var _0x56af=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x6af5[_0x1cb18a];return _0x22442e;};'use strict';var Sequelize=require(_0x56af('0x0'));module[_0x56af('0x1')]={'type':{'type':Sequelize[_0x56af('0x2')](_0x56af('0x3'),_0x56af('0x4'),_0x56af('0x5'),_0x56af('0x6')),'defaultValue':_0x56af('0x3')},'content':{'type':Sequelize[_0x56af('0x7')]},'key':{'type':Sequelize[_0x56af('0x7')]},'keyType':{'type':Sequelize[_0x56af('0x2')](_0x56af('0x3'),_0x56af('0x4'),_0x56af('0x5'))},'keyContent':{'type':Sequelize[_0x56af('0x7')]},'idField':{'type':Sequelize[_0x56af('0x7')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3194257..d94aac6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['end','error','stack','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','offset','sort','pick','add','day','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','SalesforceField','findAll','rows','catch','show','params','include','find','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','then','destroy'];(function(_0x1efac1,_0x5b2717){var _0x1ef022=function(_0x2ffd81){while(--_0x2ffd81){_0x1efac1['push'](_0x1efac1['shift']());}};_0x1ef022(++_0x5b2717);}(_0x54ef,0x112));var _0xf54e=function(_0x5b956d,_0x55fb24){_0x5b956d=_0x5b956d-0x0;var _0x8c559b=_0x54ef[_0x5b956d];return _0x8c559b;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var qs=require(_0xf54e('0x11'));var logger=require(_0xf54e('0x12'))(_0xf54e('0x13'));var utils=require('../../config/utils');var config=require(_0xf54e('0x14'));var db=require(_0xf54e('0x15'))['db'];function respondWithStatusCode(_0x143d66,_0x326eef){_0x326eef=_0x326eef||0xcc;return function(_0x553759){if(_0x553759){return _0x143d66[_0xf54e('0x16')](_0x326eef);}return _0x143d66['status'](_0x326eef)['end']();};}function respondWithResult(_0x15a9d4,_0x2033e9){_0x2033e9=_0x2033e9||0xc8;return function(_0x28f776){if(_0x28f776){return _0x15a9d4[_0xf54e('0x17')](_0x2033e9)['json'](_0x28f776);}};}function respondWithFilteredResult(_0x331732,_0x1bbeaa){return function(_0x1855fe){if(_0x1855fe){var _0x15f639=_0x1855fe[_0xf54e('0x18')],_0x56828e=_0x1bbeaa['offset'],_0x2366ee=_0x1bbeaa['offset']+_0x1bbeaa[_0xf54e('0x19')],_0x389abc;if(_0x2366ee>=_0x15f639){_0x2366ee=_0x15f639;_0x389abc=0xc8;}else{_0x389abc=0xce;}_0x331732[_0xf54e('0x17')](_0x389abc);return _0x331732[_0xf54e('0x1a')](_0xf54e('0x1b'),_0x56828e+'-'+_0x2366ee+'/'+_0x15f639)[_0xf54e('0x1c')](_0x1855fe);}return null;};}function patchUpdates(_0x3e7d96){return function(_0x2e27b6){try{jsonpatch[_0xf54e('0x1d')](_0x2e27b6,_0x3e7d96,!![]);}catch(_0x1dcc04){return BPromise[_0xf54e('0x1e')](_0x1dcc04);}return _0x2e27b6[_0xf54e('0x1f')]();};}function saveUpdates(_0x50fc66,_0x48a7e1){return function(_0x23e14){if(_0x23e14){return _0x23e14['update'](_0x50fc66)[_0xf54e('0x20')](function(_0x1bfe99){return _0x1bfe99;});}return null;};}function removeEntity(_0x106362,_0x9903fc){return function(_0xf64f12){if(_0xf64f12){return _0xf64f12[_0xf54e('0x21')]()[_0xf54e('0x20')](function(){_0x106362[_0xf54e('0x17')](0xcc)[_0xf54e('0x22')]();});}};}function handleEntityNotFound(_0x5f9eea,_0x1c58bd){return function(_0x5b83df){if(!_0x5b83df){_0x5f9eea[_0xf54e('0x16')](0x194);}return _0x5b83df;};}function handleError(_0x54f914,_0x264a8f){_0x264a8f=_0x264a8f||0x1f4;return function(_0x272df6){logger[_0xf54e('0x23')](_0x272df6[_0xf54e('0x24')]);if(_0x272df6[_0xf54e('0x25')]){delete _0x272df6[_0xf54e('0x25')];}_0x54f914[_0xf54e('0x17')](_0x264a8f)[_0xf54e('0x26')](_0x272df6);};}exports[_0xf54e('0x27')]=function(_0x33457f,_0xf6cdd7){var _0x39c0ae={},_0x2ea001={},_0x5390b8={'count':0x0,'rows':[]};var _0xb3706e=db['SalesforceField'][_0xf54e('0x28')];_0x2ea001['model']=_[_0xf54e('0x29')](_0xb3706e);var _0x269f47={'dateStart':_0x33457f[_0xf54e('0x2a')][_0xf54e('0x2b')],'dateEnd':_0x33457f[_0xf54e('0x2a')][_0xf54e('0x2c')]};delete _0x33457f[_0xf54e('0x2a')]['dateStart'];delete _0x33457f['query'][_0xf54e('0x2c')];_0x2ea001[_0xf54e('0x2a')]=_[_0xf54e('0x29')](_0x33457f[_0xf54e('0x2a')]);_0x2ea001[_0xf54e('0x2d')]=_[_0xf54e('0x2e')](_0x2ea001[_0xf54e('0x2f')],_0x2ea001[_0xf54e('0x2a')]);_0x39c0ae[_0xf54e('0x30')]=_[_0xf54e('0x2e')](_0x2ea001['model'],qs['fields'](_0x33457f[_0xf54e('0x2a')][_0xf54e('0x31')]));_0x39c0ae['attributes']=_0x39c0ae[_0xf54e('0x30')][_0xf54e('0x32')]?_0x39c0ae[_0xf54e('0x30')]:_0x2ea001[_0xf54e('0x2f')];if(!_0x33457f['query']['hasOwnProperty']('nolimit')){_0x39c0ae[_0xf54e('0x19')]=qs[_0xf54e('0x19')](_0x33457f[_0xf54e('0x2a')][_0xf54e('0x19')]);_0x39c0ae[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x33457f['query']['offset']);}_0x39c0ae['order']=qs[_0xf54e('0x34')](_0x33457f[_0xf54e('0x2a')]['sort']);_0x39c0ae['where']=qs[_0xf54e('0x2d')](_[_0xf54e('0x35')](_0x33457f[_0xf54e('0x2a')],_0x2ea001['filters']));if(_0x269f47[_0xf54e('0x2b')]){if(_0x269f47[_0xf54e('0x2c')]){_0x269f47['dateEnd']=moment(_0x269f47[_0xf54e('0x2c')])[_0xf54e('0x36')](0x1,_0xf54e('0x37'));}else{_0x269f47[_0xf54e('0x2c')]=moment(_0x269f47[_0xf54e('0x2b')])[_0xf54e('0x36')](0x1,'day');}_['merge'](_0x39c0ae[_0xf54e('0x38')],{'createdAt':{'$gte':_0x269f47[_0xf54e('0x2b')],'$lte':_0x269f47[_0xf54e('0x2c')]}});}if(_0x33457f['query'][_0xf54e('0x39')]){_0x39c0ae[_0xf54e('0x38')]=_[_0xf54e('0x3a')](_0x39c0ae[_0xf54e('0x38')],{'$or':_[_0xf54e('0x3b')](_0xb3706e,function(_0x23f297){if(_0x23f297[_0xf54e('0x3c')][_0xf54e('0x3d')]!==_0xf54e('0x3e')){var _0x2087b3={};_0x2087b3[_0x23f297[_0xf54e('0x3f')]]={'$like':'%'+_0x33457f[_0xf54e('0x2a')][_0xf54e('0x39')]+'%'};return _0x2087b3;}})});}_0x39c0ae=_[_0xf54e('0x3a')]({},_0x39c0ae,_0x33457f[_0xf54e('0x40')]);var _0x5085c1={'where':_0x39c0ae['where']};return db['SalesforceField'][_0xf54e('0x18')](_0x5085c1)[_0xf54e('0x20')](function(_0x5398b2){_0x5390b8[_0xf54e('0x18')]=_0x5398b2;if(_0x33457f[_0xf54e('0x2a')][_0xf54e('0x41')]){_0x39c0ae['include']=[{'all':!![]}];}return db[_0xf54e('0x42')][_0xf54e('0x43')](_0x39c0ae);})[_0xf54e('0x20')](function(_0x794be7){_0x5390b8[_0xf54e('0x44')]=_0x794be7;return _0x5390b8;})[_0xf54e('0x20')](respondWithFilteredResult(_0xf6cdd7,_0x39c0ae))[_0xf54e('0x45')](handleError(_0xf6cdd7,null));};exports[_0xf54e('0x46')]=function(_0x5b4ea1,_0x47bedd){var _0x11c736={'raw':!![],'where':{'id':_0x5b4ea1[_0xf54e('0x47')]['id']}},_0x3447fd={};_0x3447fd[_0xf54e('0x2f')]=_[_0xf54e('0x29')](db[_0xf54e('0x42')]['rawAttributes']);_0x3447fd[_0xf54e('0x2a')]=_['keys'](_0x5b4ea1[_0xf54e('0x2a')]);_0x3447fd['filters']=_[_0xf54e('0x2e')](_0x3447fd[_0xf54e('0x2f')],_0x3447fd[_0xf54e('0x2a')]);_0x11c736['attributes']=_[_0xf54e('0x2e')](_0x3447fd[_0xf54e('0x2f')],qs[_0xf54e('0x31')](_0x5b4ea1[_0xf54e('0x2a')][_0xf54e('0x31')]));_0x11c736['attributes']=_0x11c736[_0xf54e('0x30')][_0xf54e('0x32')]?_0x11c736[_0xf54e('0x30')]:_0x3447fd[_0xf54e('0x2f')];if(_0x5b4ea1['query'][_0xf54e('0x41')]){_0x11c736[_0xf54e('0x48')]=[{'all':!![]}];}_0x11c736=_['merge']({},_0x11c736,_0x5b4ea1[_0xf54e('0x40')]);return db[_0xf54e('0x42')][_0xf54e('0x49')](_0x11c736)[_0xf54e('0x20')](handleEntityNotFound(_0x47bedd,null))['then'](respondWithResult(_0x47bedd,null))[_0xf54e('0x45')](handleError(_0x47bedd,null));};exports[_0xf54e('0x4a')]=function(_0x2527f6,_0xb4654f){return db[_0xf54e('0x42')][_0xf54e('0x4a')](_0x2527f6[_0xf54e('0x4b')],{})[_0xf54e('0x20')](respondWithResult(_0xb4654f,0xc9))[_0xf54e('0x45')](handleError(_0xb4654f,null));};exports[_0xf54e('0x4c')]=function(_0xaf9bf0,_0x1f4cf8){if(_0xaf9bf0[_0xf54e('0x4b')]['id']){delete _0xaf9bf0[_0xf54e('0x4b')]['id'];}return db[_0xf54e('0x42')][_0xf54e('0x49')]({'where':{'id':_0xaf9bf0[_0xf54e('0x47')]['id']}})[_0xf54e('0x20')](handleEntityNotFound(_0x1f4cf8,null))[_0xf54e('0x20')](saveUpdates(_0xaf9bf0[_0xf54e('0x4b')],null))['then'](respondWithResult(_0x1f4cf8,null))['catch'](handleError(_0x1f4cf8,null));};exports[_0xf54e('0x21')]=function(_0x1106bb,_0x45861b){return db[_0xf54e('0x42')][_0xf54e('0x49')]({'where':{'id':_0x1106bb[_0xf54e('0x47')]['id']}})[_0xf54e('0x20')](handleEntityNotFound(_0x45861b,null))[_0xf54e('0x20')](removeEntity(_0x45861b,null))[_0xf54e('0x45')](handleError(_0x45861b,null));};
\ No newline at end of file
+var _0x0faf=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','Content-Range','json','reject','save','update','then','end','sendStatus','error','stack','name','send','SalesforceField','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','filter','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','length','find','create','body','destroy','html-pdf','rimraf'];(function(_0x52176b,_0x5ee873){var _0x4036af=function(_0x2f4d0e){while(--_0x2f4d0e){_0x52176b['push'](_0x52176b['shift']());}};_0x4036af(++_0x5ee873);}(_0x0faf,0x132));var _0xf0fa=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x0faf[_0x2ce6d5];return _0x32d272;};'use strict';var pdf=require(_0xf0fa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf0fa('0x1'));var zipdir=require(_0xf0fa('0x2'));var jsonpatch=require(_0xf0fa('0x3'));var rp=require(_0xf0fa('0x4'));var moment=require(_0xf0fa('0x5'));var BPromise=require(_0xf0fa('0x6'));var Mustache=require(_0xf0fa('0x7'));var util=require(_0xf0fa('0x8'));var path=require(_0xf0fa('0x9'));var sox=require('sox');var csv=require(_0xf0fa('0xa'));var ejs=require(_0xf0fa('0xb'));var fs=require('fs');var _=require(_0xf0fa('0xc'));var squel=require(_0xf0fa('0xd'));var crypto=require(_0xf0fa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf0fa('0xf'));var toCsv=require(_0xf0fa('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf0fa('0x10'));var qs=require(_0xf0fa('0x11'));var logger=require(_0xf0fa('0x12'))(_0xf0fa('0x13'));var utils=require(_0xf0fa('0x14'));var config=require(_0xf0fa('0x15'));var db=require(_0xf0fa('0x16'))['db'];function respondWithStatusCode(_0x20fd09,_0x5cf601){_0x5cf601=_0x5cf601||0xcc;return function(_0x2b88c1){if(_0x2b88c1){return _0x20fd09['sendStatus'](_0x5cf601);}return _0x20fd09[_0xf0fa('0x17')](_0x5cf601)['end']();};}function respondWithResult(_0x39ae2b,_0x17326f){_0x17326f=_0x17326f||0xc8;return function(_0x39a086){if(_0x39a086){return _0x39ae2b['status'](_0x17326f)['json'](_0x39a086);}};}function respondWithFilteredResult(_0x42591b,_0x540a04){return function(_0x1f7159){if(_0x1f7159){var _0x81fc49=_0x1f7159[_0xf0fa('0x18')],_0x10ce43=_0x540a04[_0xf0fa('0x19')],_0x3203ce=_0x540a04[_0xf0fa('0x19')]+_0x540a04['limit'],_0x467d5f;if(_0x3203ce>=_0x81fc49){_0x3203ce=_0x81fc49;_0x467d5f=0xc8;}else{_0x467d5f=0xce;}_0x42591b[_0xf0fa('0x17')](_0x467d5f);return _0x42591b[_0xf0fa('0x1a')](_0xf0fa('0x1b'),_0x10ce43+'-'+_0x3203ce+'/'+_0x81fc49)[_0xf0fa('0x1c')](_0x1f7159);}return null;};}function patchUpdates(_0x2bdf82){return function(_0x386e5f){try{jsonpatch['apply'](_0x386e5f,_0x2bdf82,!![]);}catch(_0x56ef81){return BPromise[_0xf0fa('0x1d')](_0x56ef81);}return _0x386e5f[_0xf0fa('0x1e')]();};}function saveUpdates(_0x151d09,_0x2385e2){return function(_0x1a3620){if(_0x1a3620){return _0x1a3620[_0xf0fa('0x1f')](_0x151d09)[_0xf0fa('0x20')](function(_0x3de639){return _0x3de639;});}return null;};}function removeEntity(_0x3b87a2,_0x15942b){return function(_0x1878c4){if(_0x1878c4){return _0x1878c4['destroy']()[_0xf0fa('0x20')](function(){_0x3b87a2[_0xf0fa('0x17')](0xcc)[_0xf0fa('0x21')]();});}};}function handleEntityNotFound(_0x3300d2,_0x3273b9){return function(_0x2b22c5){if(!_0x2b22c5){_0x3300d2[_0xf0fa('0x22')](0x194);}return _0x2b22c5;};}function handleError(_0x1f0eaf,_0x3feb0c){_0x3feb0c=_0x3feb0c||0x1f4;return function(_0x4a897f){logger[_0xf0fa('0x23')](_0x4a897f[_0xf0fa('0x24')]);if(_0x4a897f['name']){delete _0x4a897f[_0xf0fa('0x25')];}_0x1f0eaf[_0xf0fa('0x17')](_0x3feb0c)[_0xf0fa('0x26')](_0x4a897f);};}exports['index']=function(_0xded80d,_0x284499){var _0x3d10fb={},_0xf631f6={},_0x4e6eef={'count':0x0,'rows':[]};var _0x4be235=db[_0xf0fa('0x27')][_0xf0fa('0x28')];_0xf631f6[_0xf0fa('0x29')]=_[_0xf0fa('0x2a')](_0x4be235);var _0x57b8e9={'dateStart':_0xded80d[_0xf0fa('0x2b')][_0xf0fa('0x2c')],'dateEnd':_0xded80d[_0xf0fa('0x2b')]['dateEnd']};delete _0xded80d[_0xf0fa('0x2b')]['dateStart'];delete _0xded80d[_0xf0fa('0x2b')][_0xf0fa('0x2d')];_0xf631f6[_0xf0fa('0x2b')]=_['keys'](_0xded80d[_0xf0fa('0x2b')]);_0xf631f6[_0xf0fa('0x2e')]=_[_0xf0fa('0x2f')](_0xf631f6[_0xf0fa('0x29')],_0xf631f6[_0xf0fa('0x2b')]);_0x3d10fb[_0xf0fa('0x30')]=_['intersection'](_0xf631f6['model'],qs[_0xf0fa('0x31')](_0xded80d[_0xf0fa('0x2b')]['fields']));_0x3d10fb[_0xf0fa('0x30')]=_0x3d10fb['attributes']['length']?_0x3d10fb['attributes']:_0xf631f6[_0xf0fa('0x29')];if(!_0xded80d['query'][_0xf0fa('0x32')](_0xf0fa('0x33'))){_0x3d10fb[_0xf0fa('0x34')]=qs[_0xf0fa('0x34')](_0xded80d[_0xf0fa('0x2b')][_0xf0fa('0x34')]);_0x3d10fb[_0xf0fa('0x19')]=qs[_0xf0fa('0x19')](_0xded80d['query'][_0xf0fa('0x19')]);}_0x3d10fb[_0xf0fa('0x35')]=qs[_0xf0fa('0x36')](_0xded80d['query'][_0xf0fa('0x36')]);_0x3d10fb[_0xf0fa('0x37')]=qs[_0xf0fa('0x2e')](_[_0xf0fa('0x38')](_0xded80d['query'],_0xf631f6['filters']));if(_0x57b8e9[_0xf0fa('0x2c')]){if(_0x57b8e9[_0xf0fa('0x2d')]){_0x57b8e9[_0xf0fa('0x2d')]=moment(_0x57b8e9[_0xf0fa('0x2d')])[_0xf0fa('0x39')](0x1,'day');}else{_0x57b8e9['dateEnd']=moment(_0x57b8e9['dateStart'])['add'](0x1,_0xf0fa('0x3a'));}_[_0xf0fa('0x3b')](_0x3d10fb['where'],{'createdAt':{'$gte':_0x57b8e9['dateStart'],'$lte':_0x57b8e9[_0xf0fa('0x2d')]}});}if(_0xded80d[_0xf0fa('0x2b')][_0xf0fa('0x3c')]){_0x3d10fb[_0xf0fa('0x37')]=_[_0xf0fa('0x3b')](_0x3d10fb[_0xf0fa('0x37')],{'$or':_[_0xf0fa('0x3d')](_0x4be235,function(_0x4f5664){if(_0x4f5664['type'][_0xf0fa('0x3e')]!==_0xf0fa('0x3f')){var _0x37cdbf={};_0x37cdbf[_0x4f5664[_0xf0fa('0x40')]]={'$like':'%'+_0xded80d[_0xf0fa('0x2b')][_0xf0fa('0x3c')]+'%'};return _0x37cdbf;}})});}_0x3d10fb=_['merge']({},_0x3d10fb,_0xded80d[_0xf0fa('0x41')]);var _0x5b0bed={'where':_0x3d10fb[_0xf0fa('0x37')]};return db[_0xf0fa('0x27')][_0xf0fa('0x18')](_0x5b0bed)[_0xf0fa('0x20')](function(_0x14bee8){_0x4e6eef[_0xf0fa('0x18')]=_0x14bee8;if(_0xded80d[_0xf0fa('0x2b')][_0xf0fa('0x42')]){_0x3d10fb[_0xf0fa('0x43')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x3d10fb);})['then'](function(_0x304bae){_0x4e6eef[_0xf0fa('0x44')]=_0x304bae;return _0x4e6eef;})['then'](respondWithFilteredResult(_0x284499,_0x3d10fb))[_0xf0fa('0x45')](handleError(_0x284499,null));};exports[_0xf0fa('0x46')]=function(_0x2c3599,_0x32ade6){var _0x49e029={'raw':!![],'where':{'id':_0x2c3599[_0xf0fa('0x47')]['id']}},_0x3aa04c={};_0x3aa04c[_0xf0fa('0x29')]=_[_0xf0fa('0x2a')](db[_0xf0fa('0x27')][_0xf0fa('0x28')]);_0x3aa04c[_0xf0fa('0x2b')]=_[_0xf0fa('0x2a')](_0x2c3599[_0xf0fa('0x2b')]);_0x3aa04c['filters']=_[_0xf0fa('0x2f')](_0x3aa04c[_0xf0fa('0x29')],_0x3aa04c[_0xf0fa('0x2b')]);_0x49e029[_0xf0fa('0x30')]=_[_0xf0fa('0x2f')](_0x3aa04c[_0xf0fa('0x29')],qs['fields'](_0x2c3599[_0xf0fa('0x2b')][_0xf0fa('0x31')]));_0x49e029['attributes']=_0x49e029[_0xf0fa('0x30')][_0xf0fa('0x48')]?_0x49e029[_0xf0fa('0x30')]:_0x3aa04c[_0xf0fa('0x29')];if(_0x2c3599[_0xf0fa('0x2b')][_0xf0fa('0x42')]){_0x49e029[_0xf0fa('0x43')]=[{'all':!![]}];}_0x49e029=_[_0xf0fa('0x3b')]({},_0x49e029,_0x2c3599[_0xf0fa('0x41')]);return db['SalesforceField'][_0xf0fa('0x49')](_0x49e029)['then'](handleEntityNotFound(_0x32ade6,null))[_0xf0fa('0x20')](respondWithResult(_0x32ade6,null))[_0xf0fa('0x45')](handleError(_0x32ade6,null));};exports[_0xf0fa('0x4a')]=function(_0x569ba9,_0x324765){return db[_0xf0fa('0x27')][_0xf0fa('0x4a')](_0x569ba9[_0xf0fa('0x4b')],{})[_0xf0fa('0x20')](respondWithResult(_0x324765,0xc9))['catch'](handleError(_0x324765,null));};exports[_0xf0fa('0x1f')]=function(_0x4cda3e,_0x19c22f){if(_0x4cda3e[_0xf0fa('0x4b')]['id']){delete _0x4cda3e[_0xf0fa('0x4b')]['id'];}return db[_0xf0fa('0x27')][_0xf0fa('0x49')]({'where':{'id':_0x4cda3e['params']['id']}})[_0xf0fa('0x20')](handleEntityNotFound(_0x19c22f,null))[_0xf0fa('0x20')](saveUpdates(_0x4cda3e[_0xf0fa('0x4b')],null))[_0xf0fa('0x20')](respondWithResult(_0x19c22f,null))[_0xf0fa('0x45')](handleError(_0x19c22f,null));};exports[_0xf0fa('0x4c')]=function(_0x52e781,_0x44a3bf){return db['SalesforceField']['find']({'where':{'id':_0x52e781['params']['id']}})[_0xf0fa('0x20')](handleEntityNotFound(_0x44a3bf,null))[_0xf0fa('0x20')](removeEntity(_0x44a3bf,null))[_0xf0fa('0x45')](handleError(_0x44a3bf,null));};
\ No newline at end of file
index a954c2d..e318192 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e7e=['../../config/logger','api','bluebird','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','util'];(function(_0x12ed9b,_0x173526){var _0x345865=function(_0x320f8b){while(--_0x320f8b){_0x12ed9b['push'](_0x12ed9b['shift']());}};_0x345865(++_0x173526);}(_0x2e7e,0xce));var _0xe2e7=function(_0xd1179e,_0x5c65de){_0xd1179e=_0xd1179e-0x0;var _0x1c7c8e=_0x2e7e[_0xd1179e];return _0x1c7c8e;};'use strict';var _=require('lodash');var util=require(_0xe2e7('0x0'));var logger=require(_0xe2e7('0x1'))(_0xe2e7('0x2'));var moment=require('moment');var BPromise=require(_0xe2e7('0x3'));var rp=require('request-promise');var attributes=require(_0xe2e7('0x4'));module[_0xe2e7('0x5')]=function(_0x47f6da,_0x20cf4e){return _0x47f6da[_0xe2e7('0x6')](_0xe2e7('0x7'),attributes,{'tableName':_0xe2e7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4d2=['../../config/logger','api','moment','bluebird','request-promise','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc4d2,0x144));var _0x2c4d=function(_0xf00dab,_0x55e4c3){_0xf00dab=_0xf00dab-0x0;var _0x893765=_0xc4d2[_0xf00dab];return _0x893765;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c4d('0x0'))(_0x2c4d('0x1'));var moment=require(_0x2c4d('0x2'));var BPromise=require(_0x2c4d('0x3'));var rp=require(_0x2c4d('0x4'));var attributes=require(_0x2c4d('0x5'));module[_0x2c4d('0x6')]=function(_0x44b12a,_0x325dd3){return _0x44b12a[_0x2c4d('0x7')](_0x2c4d('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x2c4d('0x9'),'fields':[_0x2c4d('0xa'),_0x2c4d('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3706598..d3555b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0852=['message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x51b11d,_0x2e3d79){var _0x3cad6f=function(_0x315bbd){while(--_0x315bbd){_0x51b11d['push'](_0x51b11d['shift']());}};_0x3cad6f(++_0x2e3d79);}(_0x0852,0xdf));var _0x2085=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0852[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x2085('0x0'));var moment=require(_0x2085('0x1'));var BPromise=require(_0x2085('0x2'));var rs=require(_0x2085('0x3'));var fs=require('fs');var Redis=require(_0x2085('0x4'));var db=require(_0x2085('0x5'))['db'];var utils=require(_0x2085('0x6'));var logger=require('../../config/logger')(_0x2085('0x7'));var config=require('../../config/environment');var jayson=require(_0x2085('0x8'));var client=jayson[_0x2085('0x9')][_0x2085('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26979b,_0xec8bf4,_0x44e312){return new BPromise(function(_0x5ce6d4,_0xaf093d){return client[_0x2085('0xb')](_0x26979b,_0x44e312)[_0x2085('0xc')](function(_0x5fab36){logger['info'](_0x2085('0xd'),_0xec8bf4,_0x2085('0xe'));logger['debug'](_0x2085('0xf'),_0xec8bf4,'request\x20sent',JSON[_0x2085('0x10')](_0x5fab36));if(_0x5fab36['error']){if(_0x5fab36['error'][_0x2085('0x11')]===0x1f4){logger[_0x2085('0x12')]('SalesforceField,\x20%s,\x20%s',_0xec8bf4,_0x5fab36[_0x2085('0x12')][_0x2085('0x13')]);return _0xaf093d(_0x5fab36[_0x2085('0x12')]['message']);}logger[_0x2085('0x12')](_0x2085('0xd'),_0xec8bf4,_0x5fab36[_0x2085('0x12')][_0x2085('0x13')]);return _0x5ce6d4(_0x5fab36[_0x2085('0x12')][_0x2085('0x13')]);}else{logger[_0x2085('0x14')](_0x2085('0xd'),_0xec8bf4,_0x2085('0xe'));_0x5ce6d4(_0x5fab36['result'][_0x2085('0x13')]);}})[_0x2085('0x15')](function(_0xe3dec6){logger[_0x2085('0x12')](_0x2085('0xd'),_0xec8bf4,_0xe3dec6);_0xaf093d(_0xe3dec6);});});}
\ No newline at end of file
+var _0x852a=['../../config/utils','client','http','request','info','SalesforceField,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4e8efd,_0x46bc20){var _0x31e442=function(_0x4c6c00){while(--_0x4c6c00){_0x4e8efd['push'](_0x4e8efd['shift']());}};_0x31e442(++_0x46bc20);}(_0x852a,0x10c));var _0xa852=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x852a[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xa852('0x0'));var util=require('util');var moment=require(_0xa852('0x1'));var BPromise=require(_0xa852('0x2'));var rs=require(_0xa852('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa852('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa852('0x5')][_0xa852('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x23c76f,_0x3aa5b4,_0xaafa85){return new BPromise(function(_0x5831cd,_0x13e8f8){return client[_0xa852('0x7')](_0x23c76f,_0xaafa85)['then'](function(_0x188bd0){logger[_0xa852('0x8')](_0xa852('0x9'),_0x3aa5b4,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3aa5b4,'request\x20sent',JSON['stringify'](_0x188bd0));if(_0x188bd0[_0xa852('0xa')]){if(_0x188bd0['error'][_0xa852('0xb')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x3aa5b4,_0x188bd0[_0xa852('0xa')][_0xa852('0xc')]);return _0x13e8f8(_0x188bd0['error']['message']);}logger[_0xa852('0xa')](_0xa852('0x9'),_0x3aa5b4,_0x188bd0[_0xa852('0xa')]['message']);return _0x5831cd(_0x188bd0['error'][_0xa852('0xc')]);}else{logger['info'](_0xa852('0x9'),_0x3aa5b4,_0xa852('0xd'));_0x5831cd(_0x188bd0[_0xa852('0xe')][_0xa852('0xc')]);}})[_0xa852('0xf')](function(_0x542f4a){logger[_0xa852('0xa')](_0xa852('0x9'),_0x3aa5b4,_0x542f4a);_0x13e8f8(_0x542f4a);});});}
\ No newline at end of file
index 6350f6e..ed722f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd91c=['isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intSugarcrmAccount.controller'];(function(_0x47c59f,_0x45b81a){var _0x254828=function(_0x116da2){while(--_0x116da2){_0x47c59f['push'](_0x47c59f['shift']());}};_0x254828(++_0x45b81a);}(_0xd91c,0x19b));var _0xcd91=function(_0x35ad06,_0x573288){_0x35ad06=_0x35ad06-0x0;var _0xcff32a=_0xd91c[_0x35ad06];return _0xcff32a;};'use strict';var multer=require('multer');var util=require(_0xcd91('0x0'));var path=require(_0xcd91('0x1'));var timeout=require(_0xcd91('0x2'));var express=require('express');var router=express[_0xcd91('0x3')]();var auth=require(_0xcd91('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcd91('0x5'));var controller=require(_0xcd91('0x6'));router['get']('/',auth[_0xcd91('0x7')](),controller[_0xcd91('0x8')]);router[_0xcd91('0x9')](_0xcd91('0xa'),auth[_0xcd91('0x7')](),controller[_0xcd91('0xb')]);router[_0xcd91('0x9')](_0xcd91('0xc'),auth[_0xcd91('0x7')](),controller[_0xcd91('0xd')]);router['get'](_0xcd91('0xe'),auth[_0xcd91('0x7')](),controller['getFields']);router[_0xcd91('0xf')]('/',auth[_0xcd91('0x7')](),controller[_0xcd91('0x10')]);router[_0xcd91('0xf')](_0xcd91('0xc'),auth[_0xcd91('0x7')](),controller[_0xcd91('0x11')]);router[_0xcd91('0x12')](_0xcd91('0xa'),auth[_0xcd91('0x7')](),controller[_0xcd91('0x13')]);router['delete'](_0xcd91('0xa'),auth[_0xcd91('0x7')](),controller[_0xcd91('0x14')]);module[_0xcd91('0x15')]=router;
\ No newline at end of file
+var _0x9f51=['connect-timeout','express','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9f51,0x1e0));var _0x19f5=function(_0x37ec27,_0x51cfeb){_0x37ec27=_0x37ec27-0x0;var _0x26f0c2=_0x9f51[_0x37ec27];return _0x26f0c2;};'use strict';var multer=require(_0x19f5('0x0'));var util=require(_0x19f5('0x1'));var path=require(_0x19f5('0x2'));var timeout=require(_0x19f5('0x3'));var express=require(_0x19f5('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x19f5('0x5'));var controller=require(_0x19f5('0x6'));router[_0x19f5('0x7')]('/',auth[_0x19f5('0x8')](),controller[_0x19f5('0x9')]);router['get'](_0x19f5('0xa'),auth[_0x19f5('0x8')](),controller['show']);router[_0x19f5('0x7')](_0x19f5('0xb'),auth['isAuthenticated'](),controller[_0x19f5('0xc')]);router['get'](_0x19f5('0xd'),auth[_0x19f5('0x8')](),controller['getFields']);router[_0x19f5('0xe')]('/',auth['isAuthenticated'](),controller[_0x19f5('0xf')]);router[_0x19f5('0xe')]('/:id/configurations',auth[_0x19f5('0x8')](),controller[_0x19f5('0x10')]);router[_0x19f5('0x11')](_0x19f5('0xa'),auth[_0x19f5('0x8')](),controller[_0x19f5('0x12')]);router[_0x19f5('0x13')]('/:id',auth[_0x19f5('0x8')](),controller[_0x19f5('0x14')]);module['exports']=router;
\ No newline at end of file
index c58e89b..22c44d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23dd=['remoteUri','STRING','username'];(function(_0x58f9ef,_0xe3bb46){var _0x12fcef=function(_0x35fce1){while(--_0x35fce1){_0x58f9ef['push'](_0x58f9ef['shift']());}};_0x12fcef(++_0xe3bb46);}(_0x23dd,0xac));var _0xd23d=function(_0x3647ab,_0x189698){_0x3647ab=_0x3647ab-0x0;var _0x158662=_0x23dd[_0x3647ab];return _0x158662;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd23d('0x0')]},'description':{'type':Sequelize[_0xd23d('0x0')]},'username':{'type':Sequelize[_0xd23d('0x0')],'unique':_0xd23d('0x1')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd23d('0x2')},'serverUrl':{'type':Sequelize[_0xd23d('0x0')]}};
\ No newline at end of file
+var _0xc991=['exports','STRING','username','remoteUri'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xc991,0x1c4));var _0x1c99=function(_0x32fa22,_0x20510b){_0x32fa22=_0x32fa22-0x0;var _0x42c7ac=_0xc991[_0x32fa22];return _0x42c7ac;};'use strict';var Sequelize=require('sequelize');module[_0x1c99('0x0')]={'name':{'type':Sequelize[_0x1c99('0x1')]},'description':{'type':Sequelize[_0x1c99('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1c99('0x2')},'password':{'type':Sequelize[_0x1c99('0x1')]},'remoteUri':{'type':Sequelize[_0x1c99('0x1')],'unique':_0x1c99('0x3')},'serverUrl':{'type':Sequelize[_0x1c99('0x1')]}};
\ No newline at end of file
index 67ecc83..6ee7fa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62e6=['getFields','test','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','set','save','update','name','send','index','SugarcrmAccount','rawAttributes','model','keys','query','dateEnd','dateStart','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','filter','key','field','options','include','findAll','show','params','fields','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','getSubjects','type','Descriptions','getDescriptions','channel','SugarcrmField','Subjects','password','remoteUri','POST','format','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','/service/v4_1/rest.php','get_module_fields','values','module_fields','map','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0xbdf7c1,_0x49e75e){var _0x4ba1f2=function(_0x5b1437){while(--_0x5b1437){_0xbdf7c1['push'](_0xbdf7c1['shift']());}};_0x4ba1f2(++_0x49e75e);}(_0x62e6,0x156));var _0x662e=function(_0x180c9b,_0x13d173){_0x180c9b=_0x180c9b-0x0;var _0x3ff116=_0x62e6[_0x180c9b];return _0x3ff116;};'use strict';var pdf=require(_0x662e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x662e('0x1'));var zipdir=require(_0x662e('0x2'));var jsonpatch=require(_0x662e('0x3'));var rp=require(_0x662e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x662e('0x5'));var util=require('util');var path=require(_0x662e('0x6'));var sox=require(_0x662e('0x7'));var csv=require('to-csv');var ejs=require(_0x662e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x662e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x662e('0xa'));var toCsv=require(_0x662e('0xb'));var querystring=require(_0x662e('0xc'));var Papa=require('papaparse');var Redis=require(_0x662e('0xd'));var qs=require(_0x662e('0xe'));var logger=require(_0x662e('0xf'))(_0x662e('0x10'));var utils=require('../../config/utils');var config=require(_0x662e('0x11'));var db=require(_0x662e('0x12'))['db'];var integrations=require(_0x662e('0x13'));var jayson=require(_0x662e('0x14'));var client=jayson[_0x662e('0x15')][_0x662e('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x528803,_0x4b55b7,_0x37ea03,_0x4fe5d0){return new BPromise(function(_0x2e63cd,_0x5862d6){var _0x42fdb0=_0x4fe5d0||client;return _0x42fdb0[_0x662e('0x17')](_0x528803,_0x37ea03)[_0x662e('0x18')](function(_0x1d8b4a){logger['info'](_0x662e('0x19'),_0x4b55b7,_0x662e('0x1a'));logger[_0x662e('0x1b')](_0x662e('0x1c'),_0x4b55b7,_0x662e('0x1a'),JSON[_0x662e('0x1d')](_0x1d8b4a));if(_0x1d8b4a[_0x662e('0x1e')]){if(_0x1d8b4a[_0x662e('0x1e')][_0x662e('0x1f')]===0x1f4){logger[_0x662e('0x1e')](_0x662e('0x19'),_0x4b55b7,_0x1d8b4a[_0x662e('0x1e')]['message']);return _0x5862d6(_0x1d8b4a[_0x662e('0x1e')][_0x662e('0x20')]);}logger['error'](_0x662e('0x19'),_0x4b55b7,_0x1d8b4a[_0x662e('0x1e')][_0x662e('0x20')]);return _0x2e63cd(_0x1d8b4a[_0x662e('0x1e')]['message']);}else{logger['info'](_0x662e('0x19'),_0x4b55b7,_0x662e('0x1a'));_0x2e63cd(_0x1d8b4a[_0x662e('0x21')][_0x662e('0x20')]);}})[_0x662e('0x22')](function(_0x24c34b){logger['error'](_0x662e('0x19'),_0x4b55b7,_0x24c34b);_0x5862d6(_0x24c34b);});});}function respondWithStatusCode(_0x19cf9f,_0x4c1995){_0x4c1995=_0x4c1995||0xcc;return function(_0x4b14ae){if(_0x4b14ae){return _0x19cf9f[_0x662e('0x23')](_0x4c1995);}return _0x19cf9f['status'](_0x4c1995)[_0x662e('0x24')]();};}function respondWithResult(_0x3a064e,_0x30b84a){_0x30b84a=_0x30b84a||0xc8;return function(_0x39225a){if(_0x39225a){return _0x3a064e[_0x662e('0x25')](_0x30b84a)[_0x662e('0x26')](_0x39225a);}};}function respondWithFilteredResult(_0x267abf,_0x3f4886){return function(_0xeca591){if(_0xeca591){var _0x973bce=_0xeca591[_0x662e('0x27')],_0x402fad=_0x3f4886[_0x662e('0x28')],_0x3380e4=_0x3f4886[_0x662e('0x28')]+_0x3f4886['limit'],_0x180291;if(_0x3380e4>=_0x973bce){_0x3380e4=_0x973bce;_0x180291=0xc8;}else{_0x180291=0xce;}_0x267abf[_0x662e('0x25')](_0x180291);return _0x267abf[_0x662e('0x29')]('Content-Range',_0x402fad+'-'+_0x3380e4+'/'+_0x973bce)['json'](_0xeca591);}return null;};}function patchUpdates(_0x4d8e66){return function(_0x329eb1){try{jsonpatch['apply'](_0x329eb1,_0x4d8e66,!![]);}catch(_0x1971e7){return BPromise['reject'](_0x1971e7);}return _0x329eb1[_0x662e('0x2a')]();};}function saveUpdates(_0x24e174,_0x2b87d9){return function(_0x1b7430){if(_0x1b7430){return _0x1b7430[_0x662e('0x2b')](_0x24e174)[_0x662e('0x18')](function(_0x24549a){return _0x24549a;});}return null;};}function removeEntity(_0xb0bb1d,_0x17eb6b){return function(_0x301208){if(_0x301208){return _0x301208['destroy']()[_0x662e('0x18')](function(){_0xb0bb1d[_0x662e('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2853b0,_0x43a042){return function(_0x36aa76){if(!_0x36aa76){_0x2853b0[_0x662e('0x23')](0x194);}return _0x36aa76;};}function handleError(_0x150c9c,_0x16f3a5){_0x16f3a5=_0x16f3a5||0x1f4;return function(_0x165780){logger[_0x662e('0x1e')](_0x165780['stack']);if(_0x165780[_0x662e('0x2c')]){delete _0x165780[_0x662e('0x2c')];}_0x150c9c['status'](_0x16f3a5)[_0x662e('0x2d')](_0x165780);};}exports[_0x662e('0x2e')]=function(_0x4ed324,_0x1c0c11){var _0x1696f0={},_0x2e7e1e={},_0x42a663={'count':0x0,'rows':[]};var _0x357bec=db[_0x662e('0x2f')][_0x662e('0x30')];_0x2e7e1e[_0x662e('0x31')]=_[_0x662e('0x32')](_0x357bec);var _0x33d52d={'dateStart':_0x4ed324[_0x662e('0x33')]['dateStart'],'dateEnd':_0x4ed324[_0x662e('0x33')][_0x662e('0x34')]};delete _0x4ed324[_0x662e('0x33')][_0x662e('0x35')];delete _0x4ed324[_0x662e('0x33')]['dateEnd'];_0x2e7e1e['query']=_['keys'](_0x4ed324[_0x662e('0x33')]);_0x2e7e1e[_0x662e('0x36')]=_['intersection'](_0x2e7e1e['model'],_0x2e7e1e[_0x662e('0x33')]);_0x1696f0[_0x662e('0x37')]=_[_0x662e('0x38')](_0x2e7e1e[_0x662e('0x31')],qs['fields'](_0x4ed324[_0x662e('0x33')]['fields']));_0x1696f0[_0x662e('0x37')]=_0x1696f0[_0x662e('0x37')][_0x662e('0x39')]?_0x1696f0[_0x662e('0x37')]:_0x2e7e1e[_0x662e('0x31')];if(!_0x4ed324[_0x662e('0x33')][_0x662e('0x3a')](_0x662e('0x3b'))){_0x1696f0[_0x662e('0x3c')]=qs[_0x662e('0x3c')](_0x4ed324[_0x662e('0x33')][_0x662e('0x3c')]);_0x1696f0[_0x662e('0x28')]=qs[_0x662e('0x28')](_0x4ed324[_0x662e('0x33')][_0x662e('0x28')]);}_0x1696f0[_0x662e('0x3d')]=qs['sort'](_0x4ed324[_0x662e('0x33')][_0x662e('0x3e')]);_0x1696f0[_0x662e('0x3f')]=qs[_0x662e('0x36')](_[_0x662e('0x40')](_0x4ed324['query'],_0x2e7e1e[_0x662e('0x36')]));if(_0x33d52d['dateStart']){if(_0x33d52d[_0x662e('0x34')]){_0x33d52d[_0x662e('0x34')]=moment(_0x33d52d[_0x662e('0x34')])[_0x662e('0x41')](0x1,_0x662e('0x42'));}else{_0x33d52d[_0x662e('0x34')]=moment(_0x33d52d['dateStart'])[_0x662e('0x41')](0x1,_0x662e('0x42'));}_[_0x662e('0x43')](_0x1696f0[_0x662e('0x3f')],{'createdAt':{'$gte':_0x33d52d[_0x662e('0x35')],'$lte':_0x33d52d[_0x662e('0x34')]}});}if(_0x4ed324['query'][_0x662e('0x44')]){_0x1696f0[_0x662e('0x3f')]=_['merge'](_0x1696f0[_0x662e('0x3f')],{'$or':_['map'](_0x357bec,function(_0x2a00cf){if(_0x2a00cf['type'][_0x662e('0x45')]!=='VIRTUAL'){var _0x12824f={};_0x12824f[_0x2a00cf[_0x662e('0x46')]]={'$like':'%'+_0x4ed324['query'][_0x662e('0x44')]+'%'};return _0x12824f;}})});}_0x1696f0=_[_0x662e('0x43')]({},_0x1696f0,_0x4ed324[_0x662e('0x47')]);var _0x55c584={'where':_0x1696f0[_0x662e('0x3f')]};return db['SugarcrmAccount'][_0x662e('0x27')](_0x55c584)[_0x662e('0x18')](function(_0x26c996){_0x42a663[_0x662e('0x27')]=_0x26c996;if(_0x4ed324[_0x662e('0x33')]['includeAll']){_0x1696f0[_0x662e('0x48')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x662e('0x49')](_0x1696f0);})[_0x662e('0x18')](function(_0x19996d){_0x42a663['rows']=_0x19996d;return _0x42a663;})[_0x662e('0x18')](respondWithFilteredResult(_0x1c0c11,_0x1696f0))[_0x662e('0x22')](handleError(_0x1c0c11,null));};exports[_0x662e('0x4a')]=function(_0x246534,_0x9974f9){var _0x2a11d1={'raw':![],'where':{'id':_0x246534[_0x662e('0x4b')]['id']}},_0x1071dd={};_0x1071dd[_0x662e('0x31')]=_[_0x662e('0x32')](db[_0x662e('0x2f')][_0x662e('0x30')]);_0x1071dd[_0x662e('0x33')]=_['keys'](_0x246534[_0x662e('0x33')]);_0x1071dd[_0x662e('0x36')]=_[_0x662e('0x38')](_0x1071dd['model'],_0x1071dd['query']);_0x2a11d1[_0x662e('0x37')]=_[_0x662e('0x38')](_0x1071dd[_0x662e('0x31')],qs[_0x662e('0x4c')](_0x246534['query']['fields']));_0x2a11d1[_0x662e('0x37')]=_0x2a11d1[_0x662e('0x37')][_0x662e('0x39')]?_0x2a11d1[_0x662e('0x37')]:_0x1071dd[_0x662e('0x31')];if(_0x246534[_0x662e('0x33')]['includeAll']){_0x2a11d1['include']=[{'all':!![]}];}_0x2a11d1=_[_0x662e('0x43')]({},_0x2a11d1,_0x246534['options']);return db[_0x662e('0x2f')][_0x662e('0x4d')](_0x2a11d1)['then'](handleEntityNotFound(_0x9974f9,null))[_0x662e('0x18')](respondWithResult(_0x9974f9,null))[_0x662e('0x22')](handleError(_0x9974f9,null));};exports[_0x662e('0x4e')]=function(_0x2ecb9c,_0x20aeb0){return db[_0x662e('0x2f')]['create'](_0x2ecb9c['body'],{})[_0x662e('0x18')](respondWithResult(_0x20aeb0,0xc9))[_0x662e('0x22')](handleError(_0x20aeb0,null));};exports['update']=function(_0x4ea99d,_0xf50a11){if(_0x4ea99d[_0x662e('0x4f')]['id']){delete _0x4ea99d[_0x662e('0x4f')]['id'];}return db[_0x662e('0x2f')][_0x662e('0x4d')]({'where':{'id':_0x4ea99d[_0x662e('0x4b')]['id']}})[_0x662e('0x18')](handleEntityNotFound(_0xf50a11,null))[_0x662e('0x18')](saveUpdates(_0x4ea99d[_0x662e('0x4f')],null))[_0x662e('0x18')](respondWithResult(_0xf50a11,null))[_0x662e('0x22')](handleError(_0xf50a11,null));};exports['destroy']=function(_0x1889c9,_0x4de409){return db[_0x662e('0x2f')]['find']({'where':{'id':_0x1889c9[_0x662e('0x4b')]['id']}})[_0x662e('0x18')](handleEntityNotFound(_0x4de409,null))[_0x662e('0x18')](removeEntity(_0x4de409,null))[_0x662e('0x22')](handleError(_0x4de409,null));};exports['getConfigurations']=function(_0x586c80,_0x3b3564,_0x442316){var _0x50be37={};var _0xa74787={};var _0x38406e;var _0x2339ea;return db[_0x662e('0x2f')][_0x662e('0x50')]({'where':{'id':_0x586c80['params']['id']}})[_0x662e('0x18')](handleEntityNotFound(_0x3b3564,null))[_0x662e('0x18')](function(_0x25e27){if(_0x25e27){_0x38406e=_0x25e27;_0xa74787[_0x662e('0x31')]=_['keys'](db[_0x662e('0x51')]['rawAttributes']);_0xa74787[_0x662e('0x33')]=_['keys'](_0x586c80[_0x662e('0x33')]);_0xa74787[_0x662e('0x36')]=_[_0x662e('0x38')](_0xa74787[_0x662e('0x31')],_0xa74787[_0x662e('0x33')]);_0x50be37[_0x662e('0x37')]=_[_0x662e('0x38')](_0xa74787[_0x662e('0x31')],qs[_0x662e('0x4c')](_0x586c80[_0x662e('0x33')][_0x662e('0x4c')]));_0x50be37[_0x662e('0x37')]=_0x50be37['attributes'][_0x662e('0x39')]?_0x50be37[_0x662e('0x37')]:_0xa74787['model'];_0x50be37['order']=qs[_0x662e('0x3e')](_0x586c80[_0x662e('0x33')][_0x662e('0x3e')]);_0x50be37[_0x662e('0x3f')]=qs[_0x662e('0x36')](_[_0x662e('0x40')](_0x586c80[_0x662e('0x33')],_0xa74787[_0x662e('0x36')]));if(_0x586c80['query'][_0x662e('0x44')]){_0x50be37[_0x662e('0x3f')]=_[_0x662e('0x43')](_0x50be37[_0x662e('0x3f')],{'$or':_['map'](_0x50be37[_0x662e('0x37')],function(_0x4be890){var _0x591411={};_0x591411[_0x4be890]={'$like':'%'+_0x586c80[_0x662e('0x33')][_0x662e('0x44')]+'%'};return _0x591411;})});}_0x50be37=_[_0x662e('0x43')]({},_0x50be37,_0x586c80[_0x662e('0x47')]);return _0x38406e['getConfigurations'](_0x50be37);}})[_0x662e('0x18')](function(_0x3281de){if(_0x3281de){_0x2339ea=_0x3281de['length'];if(!_0x586c80['query'][_0x662e('0x3a')]('nolimit')){_0x50be37['limit']=qs['limit'](_0x586c80[_0x662e('0x33')]['limit']);_0x50be37[_0x662e('0x28')]=qs[_0x662e('0x28')](_0x586c80[_0x662e('0x33')]['offset']);}return _0x38406e[_0x662e('0x52')](_0x50be37);}})[_0x662e('0x18')](function(_0x506070){if(_0x506070){return _0x506070?{'count':_0x2339ea,'rows':_0x506070}:null;}})['then'](respondWithResult(_0x3b3564,null))['catch'](handleError(_0x3b3564,null));};exports[_0x662e('0x53')]=function(_0x107846,_0xdc6c65,_0x418d42){if(_0x107846[_0x662e('0x4f')]['id']){delete _0x107846[_0x662e('0x4f')]['id'];}return db['SugarcrmAccount'][_0x662e('0x50')]({'where':{'id':_0x107846[_0x662e('0x4b')]['id']}})[_0x662e('0x18')](handleEntityNotFound(_0xdc6c65,null))[_0x662e('0x18')](function(_0x423966){if(_0x423966){_0x107846[_0x662e('0x4f')]['AccountId']=_0x423966['id'];_0x107846[_0x662e('0x4f')]['Subjects']=integrations[_0x662e('0x54')](_0x107846[_0x662e('0x4f')]['channel'],_0x107846[_0x662e('0x4f')][_0x662e('0x55')]);_0x107846['body'][_0x662e('0x56')]=integrations[_0x662e('0x57')](_0x107846[_0x662e('0x4f')][_0x662e('0x58')],_0x107846[_0x662e('0x4f')][_0x662e('0x55')]);return db[_0x662e('0x51')][_0x662e('0x4e')](_0x107846[_0x662e('0x4f')],{'include':[{'model':db[_0x662e('0x59')],'as':_0x662e('0x5a')},{'model':db[_0x662e('0x59')],'as':_0x662e('0x56')}]});}return null;})['then'](respondWithResult(_0xdc6c65,null))[_0x662e('0x22')](handleError(_0xdc6c65,null));};exports['getFields']=function(_0x5a3572,_0x1e3f41,_0x419611){var _0x274b46;return db[_0x662e('0x2f')][_0x662e('0x50')]({'where':{'id':_0x5a3572[_0x662e('0x4b')]['id']},'attributes':['id','username',_0x662e('0x5b'),_0x662e('0x5c')]})[_0x662e('0x18')](handleEntityNotFound(_0x1e3f41,null))['then'](function(_0x1384b4){if(_0x1384b4){_0x274b46=_0x1384b4[_0x662e('0x5c')];return rp({'method':_0x662e('0x5d'),'uri':util[_0x662e('0x5e')](_0x662e('0x5f'),_0x274b46,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x662e('0x60'),'input_type':_0x662e('0x61'),'response_type':_0x662e('0x61'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1384b4['username'],'password':_0x1384b4['password'],'encryption':_0x662e('0x62')},'application':_0x662e('0x63')})}});}})['then'](function(_0x47c2d9){if(_0x47c2d9){return rp({'method':_0x662e('0x5d'),'uri':util['format'](_0x662e('0x5f'),_0x274b46,_0x662e('0x64')),'json':!![],'form':{'method':_0x662e('0x65'),'input_type':_0x662e('0x61'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x47c2d9['id'],'module_name':'Calls'})}});}})[_0x662e('0x18')](function(_0xd77333){if(_0xd77333){var _0x3cc861=_[_0x662e('0x66')](_0xd77333[_0x662e('0x67')]);return{'count':_0x3cc861['length'],'rows':_[_0x662e('0x68')](_0x3cc861,function(_0x247ba9){return{'id':_0x247ba9[_0x662e('0x2c')],'name':_0x247ba9[_0x662e('0x69')],'custom':_[_0x662e('0x6a')](_0x247ba9[_0x662e('0x2c')],'_c')?!![]:![],'options':_0x247ba9['options']?_[_0x662e('0x68')](_[_0x662e('0x66')](_0x247ba9[_0x662e('0x47')]),function(_0x1cc554){return{'name':_0x1cc554[_0x662e('0x6b')],'value':_0x1cc554['name']};}):[]};})};}})[_0x662e('0x18')](respondWithResult(_0x1e3f41,null))['catch'](function(_0x504450){var _0x1f9edf=_0x5a3572['query']['test']?0x1f4:_0x504450[_0x662e('0x6c')]||0x1f4;logger[_0x662e('0x1e')](_0x662e('0x6d'),_0x662e('0x6e'),_0x1f9edf,JSON[_0x662e('0x1d')](_0x504450));delete _0x504450['name'];if(_0x1f9edf===0x191){_0x1f9edf=0x190;}_0x1e3f41[_0x662e('0x25')](_0x1f9edf)[_0x662e('0x2d')](_0x5a3572[_0x662e('0x33')][_0x662e('0x6f')]?{'message':_0x662e('0x70'),'statusCode':_0x504450[_0x662e('0x6c')]}:_0x504450);});};
\ No newline at end of file
+var _0x2f46=['SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','pick','add','day','merge','type','key','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','show','find','create','body','update','params','getConfigurations','findOne','SugarcrmConfiguration','order','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','username','password','remoteUri','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Calls','values','module_fields','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2f46,0x1cf));var _0x62f4=function(_0x5af603,_0x418e65){_0x5af603=_0x5af603-0x0;var _0x2b4716=_0x2f46[_0x5af603];return _0x2b4716;};'use strict';var pdf=require(_0x62f4('0x0'));var emlformat=require(_0x62f4('0x1'));var rimraf=require(_0x62f4('0x2'));var zipdir=require(_0x62f4('0x3'));var jsonpatch=require(_0x62f4('0x4'));var rp=require(_0x62f4('0x5'));var moment=require(_0x62f4('0x6'));var BPromise=require(_0x62f4('0x7'));var Mustache=require('mustache');var util=require(_0x62f4('0x8'));var path=require(_0x62f4('0x9'));var sox=require(_0x62f4('0xa'));var csv=require('to-csv');var ejs=require(_0x62f4('0xb'));var fs=require('fs');var _=require(_0x62f4('0xc'));var squel=require('squel');var crypto=require(_0x62f4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x62f4('0xe'));var toCsv=require(_0x62f4('0xf'));var querystring=require(_0x62f4('0x10'));var Papa=require(_0x62f4('0x11'));var Redis=require(_0x62f4('0x12'));var qs=require(_0x62f4('0x13'));var logger=require(_0x62f4('0x14'))(_0x62f4('0x15'));var utils=require(_0x62f4('0x16'));var config=require(_0x62f4('0x17'));var db=require(_0x62f4('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x62f4('0x19'));var client=jayson[_0x62f4('0x1a')][_0x62f4('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2f6ba3,_0x1f067e,_0x5c84cf,_0x786de0){return new BPromise(function(_0x135505,_0x1ce087){var _0x156c48=_0x786de0||client;return _0x156c48[_0x62f4('0x1c')](_0x2f6ba3,_0x5c84cf)[_0x62f4('0x1d')](function(_0x3c0bee){logger[_0x62f4('0x1e')](_0x62f4('0x1f'),_0x1f067e,_0x62f4('0x20'));logger['debug'](_0x62f4('0x21'),_0x1f067e,_0x62f4('0x20'),JSON['stringify'](_0x3c0bee));if(_0x3c0bee['error']){if(_0x3c0bee[_0x62f4('0x22')][_0x62f4('0x23')]===0x1f4){logger[_0x62f4('0x22')]('SugarcrmAccount,\x20%s,\x20%s',_0x1f067e,_0x3c0bee['error'][_0x62f4('0x24')]);return _0x1ce087(_0x3c0bee[_0x62f4('0x22')][_0x62f4('0x24')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1f067e,_0x3c0bee['error'][_0x62f4('0x24')]);return _0x135505(_0x3c0bee[_0x62f4('0x22')]['message']);}else{logger[_0x62f4('0x1e')](_0x62f4('0x1f'),_0x1f067e,'request\x20sent');_0x135505(_0x3c0bee[_0x62f4('0x25')][_0x62f4('0x24')]);}})[_0x62f4('0x26')](function(_0x10482f){logger['error'](_0x62f4('0x1f'),_0x1f067e,_0x10482f);_0x1ce087(_0x10482f);});});}function respondWithStatusCode(_0x5c0683,_0x3de12b){_0x3de12b=_0x3de12b||0xcc;return function(_0x16b5df){if(_0x16b5df){return _0x5c0683['sendStatus'](_0x3de12b);}return _0x5c0683[_0x62f4('0x27')](_0x3de12b)[_0x62f4('0x28')]();};}function respondWithResult(_0x1be37c,_0x25df01){_0x25df01=_0x25df01||0xc8;return function(_0x37b48b){if(_0x37b48b){return _0x1be37c[_0x62f4('0x27')](_0x25df01)[_0x62f4('0x29')](_0x37b48b);}};}function respondWithFilteredResult(_0x5c8742,_0x34ed56){return function(_0x300a26){if(_0x300a26){var _0x4da9ed=_0x300a26[_0x62f4('0x2a')],_0x52083e=_0x34ed56['offset'],_0x219c89=_0x34ed56['offset']+_0x34ed56[_0x62f4('0x2b')],_0x2afd46;if(_0x219c89>=_0x4da9ed){_0x219c89=_0x4da9ed;_0x2afd46=0xc8;}else{_0x2afd46=0xce;}_0x5c8742['status'](_0x2afd46);return _0x5c8742['set'](_0x62f4('0x2c'),_0x52083e+'-'+_0x219c89+'/'+_0x4da9ed)[_0x62f4('0x29')](_0x300a26);}return null;};}function patchUpdates(_0x5ccdb6){return function(_0xeca87b){try{jsonpatch[_0x62f4('0x2d')](_0xeca87b,_0x5ccdb6,!![]);}catch(_0x2e0936){return BPromise[_0x62f4('0x2e')](_0x2e0936);}return _0xeca87b[_0x62f4('0x2f')]();};}function saveUpdates(_0x2d20d2,_0x285289){return function(_0x2544b4){if(_0x2544b4){return _0x2544b4['update'](_0x2d20d2)[_0x62f4('0x1d')](function(_0x40552c){return _0x40552c;});}return null;};}function removeEntity(_0x296959,_0x47fb8f){return function(_0x158ecd){if(_0x158ecd){return _0x158ecd[_0x62f4('0x30')]()[_0x62f4('0x1d')](function(){_0x296959[_0x62f4('0x27')](0xcc)[_0x62f4('0x28')]();});}};}function handleEntityNotFound(_0x444dbf,_0x183a7c){return function(_0x162126){if(!_0x162126){_0x444dbf['sendStatus'](0x194);}return _0x162126;};}function handleError(_0x648ff2,_0x1c47ba){_0x1c47ba=_0x1c47ba||0x1f4;return function(_0xa7a7af){logger[_0x62f4('0x22')](_0xa7a7af[_0x62f4('0x31')]);if(_0xa7a7af[_0x62f4('0x32')]){delete _0xa7a7af[_0x62f4('0x32')];}_0x648ff2[_0x62f4('0x27')](_0x1c47ba)[_0x62f4('0x33')](_0xa7a7af);};}exports[_0x62f4('0x34')]=function(_0x501721,_0x1d4d89){var _0x3061f2={},_0x7b2e8c={},_0x5b4a06={'count':0x0,'rows':[]};var _0x2aa097=db[_0x62f4('0x35')][_0x62f4('0x36')];_0x7b2e8c[_0x62f4('0x37')]=_['keys'](_0x2aa097);var _0x308665={'dateStart':_0x501721[_0x62f4('0x38')]['dateStart'],'dateEnd':_0x501721[_0x62f4('0x38')]['dateEnd']};delete _0x501721['query'][_0x62f4('0x39')];delete _0x501721[_0x62f4('0x38')][_0x62f4('0x3a')];_0x7b2e8c[_0x62f4('0x38')]=_[_0x62f4('0x3b')](_0x501721[_0x62f4('0x38')]);_0x7b2e8c[_0x62f4('0x3c')]=_[_0x62f4('0x3d')](_0x7b2e8c[_0x62f4('0x37')],_0x7b2e8c[_0x62f4('0x38')]);_0x3061f2[_0x62f4('0x3e')]=_['intersection'](_0x7b2e8c[_0x62f4('0x37')],qs[_0x62f4('0x3f')](_0x501721[_0x62f4('0x38')]['fields']));_0x3061f2[_0x62f4('0x3e')]=_0x3061f2['attributes'][_0x62f4('0x40')]?_0x3061f2[_0x62f4('0x3e')]:_0x7b2e8c['model'];if(!_0x501721[_0x62f4('0x38')][_0x62f4('0x41')](_0x62f4('0x42'))){_0x3061f2[_0x62f4('0x2b')]=qs[_0x62f4('0x2b')](_0x501721[_0x62f4('0x38')][_0x62f4('0x2b')]);_0x3061f2[_0x62f4('0x43')]=qs[_0x62f4('0x43')](_0x501721['query'][_0x62f4('0x43')]);}_0x3061f2['order']=qs[_0x62f4('0x44')](_0x501721[_0x62f4('0x38')][_0x62f4('0x44')]);_0x3061f2['where']=qs['filters'](_[_0x62f4('0x45')](_0x501721[_0x62f4('0x38')],_0x7b2e8c[_0x62f4('0x3c')]));if(_0x308665[_0x62f4('0x39')]){if(_0x308665[_0x62f4('0x3a')]){_0x308665['dateEnd']=moment(_0x308665[_0x62f4('0x3a')])[_0x62f4('0x46')](0x1,_0x62f4('0x47'));}else{_0x308665[_0x62f4('0x3a')]=moment(_0x308665[_0x62f4('0x39')])[_0x62f4('0x46')](0x1,'day');}_[_0x62f4('0x48')](_0x3061f2['where'],{'createdAt':{'$gte':_0x308665[_0x62f4('0x39')],'$lte':_0x308665[_0x62f4('0x3a')]}});}if(_0x501721[_0x62f4('0x38')]['filter']){_0x3061f2['where']=_[_0x62f4('0x48')](_0x3061f2['where'],{'$or':_['map'](_0x2aa097,function(_0x256eb2){if(_0x256eb2[_0x62f4('0x49')][_0x62f4('0x4a')]!==_0x62f4('0x4b')){var _0x3cded0={};_0x3cded0[_0x256eb2['field']]={'$like':'%'+_0x501721[_0x62f4('0x38')][_0x62f4('0x4c')]+'%'};return _0x3cded0;}})});}_0x3061f2=_[_0x62f4('0x48')]({},_0x3061f2,_0x501721[_0x62f4('0x4d')]);var _0x5b9de5={'where':_0x3061f2[_0x62f4('0x4e')]};return db[_0x62f4('0x35')]['count'](_0x5b9de5)['then'](function(_0x30e7e9){_0x5b4a06[_0x62f4('0x2a')]=_0x30e7e9;if(_0x501721[_0x62f4('0x38')][_0x62f4('0x4f')]){_0x3061f2[_0x62f4('0x50')]=[{'all':!![]}];}return db[_0x62f4('0x35')][_0x62f4('0x51')](_0x3061f2);})['then'](function(_0x29b9b2){_0x5b4a06[_0x62f4('0x52')]=_0x29b9b2;return _0x5b4a06;})[_0x62f4('0x1d')](respondWithFilteredResult(_0x1d4d89,_0x3061f2))[_0x62f4('0x26')](handleError(_0x1d4d89,null));};exports[_0x62f4('0x53')]=function(_0x24d967,_0x42cb4e){var _0x475fb6={'raw':![],'where':{'id':_0x24d967['params']['id']}},_0x5902bc={};_0x5902bc['model']=_[_0x62f4('0x3b')](db[_0x62f4('0x35')][_0x62f4('0x36')]);_0x5902bc['query']=_[_0x62f4('0x3b')](_0x24d967[_0x62f4('0x38')]);_0x5902bc[_0x62f4('0x3c')]=_[_0x62f4('0x3d')](_0x5902bc[_0x62f4('0x37')],_0x5902bc[_0x62f4('0x38')]);_0x475fb6[_0x62f4('0x3e')]=_[_0x62f4('0x3d')](_0x5902bc[_0x62f4('0x37')],qs['fields'](_0x24d967[_0x62f4('0x38')]['fields']));_0x475fb6[_0x62f4('0x3e')]=_0x475fb6[_0x62f4('0x3e')]['length']?_0x475fb6[_0x62f4('0x3e')]:_0x5902bc[_0x62f4('0x37')];if(_0x24d967[_0x62f4('0x38')]['includeAll']){_0x475fb6['include']=[{'all':!![]}];}_0x475fb6=_[_0x62f4('0x48')]({},_0x475fb6,_0x24d967['options']);return db['SugarcrmAccount'][_0x62f4('0x54')](_0x475fb6)[_0x62f4('0x1d')](handleEntityNotFound(_0x42cb4e,null))[_0x62f4('0x1d')](respondWithResult(_0x42cb4e,null))[_0x62f4('0x26')](handleError(_0x42cb4e,null));};exports[_0x62f4('0x55')]=function(_0x2fe0e1,_0x139506){return db[_0x62f4('0x35')][_0x62f4('0x55')](_0x2fe0e1[_0x62f4('0x56')],{})[_0x62f4('0x1d')](respondWithResult(_0x139506,0xc9))[_0x62f4('0x26')](handleError(_0x139506,null));};exports[_0x62f4('0x57')]=function(_0x445291,_0x440241){if(_0x445291[_0x62f4('0x56')]['id']){delete _0x445291[_0x62f4('0x56')]['id'];}return db[_0x62f4('0x35')][_0x62f4('0x54')]({'where':{'id':_0x445291[_0x62f4('0x58')]['id']}})[_0x62f4('0x1d')](handleEntityNotFound(_0x440241,null))['then'](saveUpdates(_0x445291[_0x62f4('0x56')],null))['then'](respondWithResult(_0x440241,null))['catch'](handleError(_0x440241,null));};exports[_0x62f4('0x30')]=function(_0x4c2d9a,_0x189b7a){return db['SugarcrmAccount'][_0x62f4('0x54')]({'where':{'id':_0x4c2d9a['params']['id']}})[_0x62f4('0x1d')](handleEntityNotFound(_0x189b7a,null))['then'](removeEntity(_0x189b7a,null))[_0x62f4('0x26')](handleError(_0x189b7a,null));};exports[_0x62f4('0x59')]=function(_0x5f1183,_0x2ad42a,_0x250c96){var _0x5b58b4={};var _0x2b2b20={};var _0x3bf85e;var _0x4e42c3;return db[_0x62f4('0x35')][_0x62f4('0x5a')]({'where':{'id':_0x5f1183[_0x62f4('0x58')]['id']}})['then'](handleEntityNotFound(_0x2ad42a,null))['then'](function(_0x12a89e){if(_0x12a89e){_0x3bf85e=_0x12a89e;_0x2b2b20[_0x62f4('0x37')]=_[_0x62f4('0x3b')](db[_0x62f4('0x5b')][_0x62f4('0x36')]);_0x2b2b20[_0x62f4('0x38')]=_[_0x62f4('0x3b')](_0x5f1183[_0x62f4('0x38')]);_0x2b2b20[_0x62f4('0x3c')]=_[_0x62f4('0x3d')](_0x2b2b20[_0x62f4('0x37')],_0x2b2b20[_0x62f4('0x38')]);_0x5b58b4[_0x62f4('0x3e')]=_['intersection'](_0x2b2b20[_0x62f4('0x37')],qs[_0x62f4('0x3f')](_0x5f1183[_0x62f4('0x38')]['fields']));_0x5b58b4['attributes']=_0x5b58b4[_0x62f4('0x3e')][_0x62f4('0x40')]?_0x5b58b4['attributes']:_0x2b2b20['model'];_0x5b58b4[_0x62f4('0x5c')]=qs[_0x62f4('0x44')](_0x5f1183['query']['sort']);_0x5b58b4[_0x62f4('0x4e')]=qs['filters'](_[_0x62f4('0x45')](_0x5f1183[_0x62f4('0x38')],_0x2b2b20[_0x62f4('0x3c')]));if(_0x5f1183[_0x62f4('0x38')]['filter']){_0x5b58b4[_0x62f4('0x4e')]=_[_0x62f4('0x48')](_0x5b58b4['where'],{'$or':_[_0x62f4('0x5d')](_0x5b58b4[_0x62f4('0x3e')],function(_0x4b30f1){var _0x4b6e51={};_0x4b6e51[_0x4b30f1]={'$like':'%'+_0x5f1183[_0x62f4('0x38')][_0x62f4('0x4c')]+'%'};return _0x4b6e51;})});}_0x5b58b4=_['merge']({},_0x5b58b4,_0x5f1183[_0x62f4('0x4d')]);return _0x3bf85e[_0x62f4('0x59')](_0x5b58b4);}})[_0x62f4('0x1d')](function(_0x5cf674){if(_0x5cf674){_0x4e42c3=_0x5cf674[_0x62f4('0x40')];if(!_0x5f1183[_0x62f4('0x38')]['hasOwnProperty'](_0x62f4('0x42'))){_0x5b58b4[_0x62f4('0x2b')]=qs['limit'](_0x5f1183[_0x62f4('0x38')][_0x62f4('0x2b')]);_0x5b58b4[_0x62f4('0x43')]=qs[_0x62f4('0x43')](_0x5f1183[_0x62f4('0x38')]['offset']);}return _0x3bf85e[_0x62f4('0x59')](_0x5b58b4);}})[_0x62f4('0x1d')](function(_0x54d413){if(_0x54d413){return _0x54d413?{'count':_0x4e42c3,'rows':_0x54d413}:null;}})['then'](respondWithResult(_0x2ad42a,null))[_0x62f4('0x26')](handleError(_0x2ad42a,null));};exports[_0x62f4('0x5e')]=function(_0x27e67e,_0x12e88c,_0x5baeac){if(_0x27e67e[_0x62f4('0x56')]['id']){delete _0x27e67e[_0x62f4('0x56')]['id'];}return db[_0x62f4('0x35')][_0x62f4('0x5a')]({'where':{'id':_0x27e67e[_0x62f4('0x58')]['id']}})[_0x62f4('0x1d')](handleEntityNotFound(_0x12e88c,null))[_0x62f4('0x1d')](function(_0x506bf1){if(_0x506bf1){_0x27e67e[_0x62f4('0x56')][_0x62f4('0x5f')]=_0x506bf1['id'];_0x27e67e['body'][_0x62f4('0x60')]=integrations[_0x62f4('0x61')](_0x27e67e[_0x62f4('0x56')][_0x62f4('0x62')],_0x27e67e[_0x62f4('0x56')][_0x62f4('0x49')]);_0x27e67e['body'][_0x62f4('0x63')]=integrations[_0x62f4('0x64')](_0x27e67e['body']['channel'],_0x27e67e[_0x62f4('0x56')]['type']);return db[_0x62f4('0x5b')][_0x62f4('0x55')](_0x27e67e[_0x62f4('0x56')],{'include':[{'model':db['SugarcrmField'],'as':_0x62f4('0x60')},{'model':db[_0x62f4('0x65')],'as':_0x62f4('0x63')}]});}return null;})[_0x62f4('0x1d')](respondWithResult(_0x12e88c,null))[_0x62f4('0x26')](handleError(_0x12e88c,null));};exports[_0x62f4('0x66')]=function(_0x4d99a7,_0x361354,_0x38aebf){var _0x538097;return db[_0x62f4('0x35')]['findOne']({'where':{'id':_0x4d99a7[_0x62f4('0x58')]['id']},'attributes':['id',_0x62f4('0x67'),_0x62f4('0x68'),'remoteUri']})[_0x62f4('0x1d')](handleEntityNotFound(_0x361354,null))[_0x62f4('0x1d')](function(_0x19e2ec){if(_0x19e2ec){_0x538097=_0x19e2ec[_0x62f4('0x69')];return rp({'method':_0x62f4('0x6a'),'uri':util[_0x62f4('0x6b')](_0x62f4('0x6c'),_0x538097,_0x62f4('0x6d')),'json':!![],'form':{'method':_0x62f4('0x6e'),'input_type':_0x62f4('0x6f'),'response_type':'JSON','rest_data':JSON[_0x62f4('0x70')]({'user_auth':{'user_name':_0x19e2ec[_0x62f4('0x67')],'password':_0x19e2ec[_0x62f4('0x68')],'encryption':'PLAIN'},'application':_0x62f4('0x71')})}});}})['then'](function(_0x31d368){if(_0x31d368){return rp({'method':_0x62f4('0x6a'),'uri':util[_0x62f4('0x6b')](_0x62f4('0x6c'),_0x538097,_0x62f4('0x6d')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x62f4('0x6f'),'response_type':_0x62f4('0x6f'),'rest_data':JSON[_0x62f4('0x70')]({'session':_0x31d368['id'],'module_name':_0x62f4('0x72')})}});}})[_0x62f4('0x1d')](function(_0x267f4b){if(_0x267f4b){var _0x85dd92=_[_0x62f4('0x73')](_0x267f4b[_0x62f4('0x74')]);return{'count':_0x85dd92[_0x62f4('0x40')],'rows':_[_0x62f4('0x5d')](_0x85dd92,function(_0x441457){return{'id':_0x441457['name'],'name':_0x441457[_0x62f4('0x75')],'custom':_[_0x62f4('0x76')](_0x441457[_0x62f4('0x32')],'_c')?!![]:![],'options':_0x441457[_0x62f4('0x4d')]?_[_0x62f4('0x5d')](_[_0x62f4('0x73')](_0x441457['options']),function(_0x19bf5e){return{'name':_0x19bf5e[_0x62f4('0x77')],'value':_0x19bf5e['name']};}):[]};})};}})[_0x62f4('0x1d')](respondWithResult(_0x361354,null))[_0x62f4('0x26')](function(_0x148b69){var _0x144aac=_0x4d99a7[_0x62f4('0x38')][_0x62f4('0x78')]?0x1f4:_0x148b69[_0x62f4('0x79')]||0x1f4;logger[_0x62f4('0x22')](_0x62f4('0x7a'),'getFields',_0x144aac,JSON[_0x62f4('0x70')](_0x148b69));delete _0x148b69[_0x62f4('0x32')];if(_0x144aac===0x191){_0x144aac=0x190;}_0x361354[_0x62f4('0x27')](_0x144aac)[_0x62f4('0x33')](_0x4d99a7[_0x62f4('0x38')][_0x62f4('0x78')]?{'message':_0x62f4('0x7b'),'statusCode':_0x148b69[_0x62f4('0x79')]}:_0x148b69);});};
\ No newline at end of file
index ab6ebfb..d67d565 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7efc=['SugarcrmAccount','int_sugarcrm_accounts','api','moment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0xc4a974,_0x57cc1a){var _0x33370f=function(_0x4470da){while(--_0x4470da){_0xc4a974['push'](_0xc4a974['shift']());}};_0x33370f(++_0x57cc1a);}(_0x7efc,0x182));var _0xc7ef=function(_0x4d2c26,_0x2701f9){_0x4d2c26=_0x4d2c26-0x0;var _0x5bf9b4=_0x7efc[_0x4d2c26];return _0x5bf9b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc7ef('0x0'));var moment=require(_0xc7ef('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xc7ef('0x2'));var integrations=require(_0xc7ef('0x3'));module[_0xc7ef('0x4')]=function(_0x445185,_0x2b5a05){return _0x445185[_0xc7ef('0x5')](_0xc7ef('0x6'),attributes,{'tableName':_0xc7ef('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3617=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','bluebird','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x59dfd0,_0x196cdf){var _0x295d4f=function(_0x57c5b2){while(--_0x57c5b2){_0x59dfd0['push'](_0x59dfd0['shift']());}};_0x295d4f(++_0x196cdf);}(_0x3617,0xec));var _0x7361=function(_0x30e6ce,_0x54b285){_0x30e6ce=_0x30e6ce-0x0;var _0x1514f5=_0x3617[_0x30e6ce];return _0x1514f5;};'use strict';var _=require(_0x7361('0x0'));var util=require(_0x7361('0x1'));var logger=require(_0x7361('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7361('0x3'));var rp=require('request-promise');var attributes=require(_0x7361('0x4'));var integrations=require(_0x7361('0x5'));module[_0x7361('0x6')]=function(_0x3be878,_0x77ea0a){return _0x3be878['define'](_0x7361('0x7'),attributes,{'tableName':_0x7361('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 138dbe8..02a23b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c27=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','util','moment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4c27,0x86));var _0x74c2=function(_0x41ad84,_0x2df4e4){_0x41ad84=_0x41ad84-0x0;var _0x29d7e5=_0x4c27[_0x41ad84];return _0x29d7e5;};'use strict';var _=require('lodash');var util=require(_0x74c2('0x0'));var moment=require(_0x74c2('0x1'));var BPromise=require(_0x74c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74c2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x74c2('0x4'))(_0x74c2('0x5'));var config=require(_0x74c2('0x6'));var jayson=require(_0x74c2('0x7'));var client=jayson[_0x74c2('0x8')][_0x74c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x465cf3,_0x15bdbe,_0x5ec67c){return new BPromise(function(_0x22cabe,_0x702cc2){return client[_0x74c2('0xa')](_0x465cf3,_0x5ec67c)[_0x74c2('0xb')](function(_0x55e311){logger['info'](_0x74c2('0xc'),_0x15bdbe,_0x74c2('0xd'));logger[_0x74c2('0xe')](_0x74c2('0xf'),_0x15bdbe,_0x74c2('0xd'),JSON[_0x74c2('0x10')](_0x55e311));if(_0x55e311[_0x74c2('0x11')]){if(_0x55e311[_0x74c2('0x11')]['code']===0x1f4){logger[_0x74c2('0x11')](_0x74c2('0xc'),_0x15bdbe,_0x55e311[_0x74c2('0x11')][_0x74c2('0x12')]);return _0x702cc2(_0x55e311[_0x74c2('0x11')][_0x74c2('0x12')]);}logger[_0x74c2('0x11')](_0x74c2('0xc'),_0x15bdbe,_0x55e311[_0x74c2('0x11')][_0x74c2('0x12')]);return _0x22cabe(_0x55e311[_0x74c2('0x11')][_0x74c2('0x12')]);}else{logger[_0x74c2('0x13')](_0x74c2('0xc'),_0x15bdbe,_0x74c2('0xd'));_0x22cabe(_0x55e311['result']['message']);}})[_0x74c2('0x14')](function(_0x2fa3ba){logger['error'](_0x74c2('0xc'),_0x15bdbe,_0x2fa3ba);_0x702cc2(_0x2fa3ba);});});}exports['GetSugarcrmAccount']=function(_0x874a40){var _0x5c370a=this;return new Promise(function(_0x57e8f7,_0x3375ce){return db[_0x74c2('0x15')][_0x74c2('0x16')]({'raw':_0x874a40[_0x74c2('0x17')]?_0x874a40[_0x74c2('0x17')][_0x74c2('0x18')]===undefined?!![]:![]:!![],'where':_0x874a40[_0x74c2('0x17')]?_0x874a40[_0x74c2('0x17')][_0x74c2('0x19')]||null:null,'attributes':_0x874a40[_0x74c2('0x17')]?_0x874a40[_0x74c2('0x17')][_0x74c2('0x1a')]||null:null,'limit':_0x874a40[_0x74c2('0x17')]?_0x874a40[_0x74c2('0x17')][_0x74c2('0x1b')]||null:null,'include':_0x874a40['options']?_0x874a40['options'][_0x74c2('0x1c')]?_[_0x74c2('0x1d')](_0x874a40[_0x74c2('0x17')][_0x74c2('0x1c')],function(_0xa1b777){return{'model':db[_0xa1b777['model']],'as':_0xa1b777['as'],'attributes':_0xa1b777['attributes'],'include':_0xa1b777[_0x74c2('0x1c')]?_[_0x74c2('0x1d')](_0xa1b777[_0x74c2('0x1c')],function(_0x446c2c){return{'model':db[_0x446c2c['model']],'as':_0x446c2c['as'],'attributes':_0x446c2c[_0x74c2('0x1a')],'include':_0x446c2c[_0x74c2('0x1c')]?_[_0x74c2('0x1d')](_0x446c2c[_0x74c2('0x1c')],function(_0x1be533){return{'model':db[_0x1be533[_0x74c2('0x1e')]],'as':_0x1be533['as'],'attributes':_0x1be533[_0x74c2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x74c2('0xb')](function(_0x512a91){logger[_0x74c2('0x13')](_0x74c2('0x1f'),_0x874a40);logger[_0x74c2('0xe')](_0x74c2('0x1f'),_0x874a40,JSON[_0x74c2('0x10')](_0x512a91));_0x57e8f7(_0x512a91);})[_0x74c2('0x14')](function(_0x436e4c){logger['error'](_0x74c2('0x1f'),_0x436e4c[_0x74c2('0x12')],_0x874a40);_0x3375ce(_0x5c370a[_0x74c2('0x11')](0x1f4,_0x436e4c[_0x74c2('0x12')]));});});};exports[_0x74c2('0x20')]=function(_0x4576d8){var _0x2c2442=this;return new Promise(function(_0x3ffeba,_0x4dc080){return db[_0x74c2('0x15')][_0x74c2('0x21')]({'raw':_0x4576d8[_0x74c2('0x17')]?_0x4576d8['options'][_0x74c2('0x18')]===undefined?!![]:![]:!![],'where':_0x4576d8[_0x74c2('0x17')]?_0x4576d8[_0x74c2('0x17')]['where']||null:null,'attributes':_0x4576d8[_0x74c2('0x17')]?_0x4576d8[_0x74c2('0x17')][_0x74c2('0x1a')]||null:null,'include':_0x4576d8[_0x74c2('0x17')]?_0x4576d8[_0x74c2('0x17')][_0x74c2('0x1c')]?_[_0x74c2('0x1d')](_0x4576d8[_0x74c2('0x17')][_0x74c2('0x1c')],function(_0x362878){return{'model':db[_0x362878[_0x74c2('0x1e')]],'as':_0x362878['as'],'attributes':_0x362878[_0x74c2('0x1a')],'include':_0x362878[_0x74c2('0x1c')]?_[_0x74c2('0x1d')](_0x362878[_0x74c2('0x1c')],function(_0x3d0fa4){return{'model':db[_0x3d0fa4[_0x74c2('0x1e')]],'as':_0x3d0fa4['as'],'attributes':_0x3d0fa4[_0x74c2('0x1a')],'include':_0x3d0fa4['include']?_[_0x74c2('0x1d')](_0x3d0fa4['include'],function(_0x54b3d9){return{'model':db[_0x54b3d9[_0x74c2('0x1e')]],'as':_0x54b3d9['as'],'attributes':_0x54b3d9[_0x74c2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x74c2('0xb')](function(_0x5cd550){logger[_0x74c2('0x13')](_0x74c2('0x20'),_0x4576d8);logger[_0x74c2('0xe')]('ShowSugarcrmAccount',_0x4576d8,JSON['stringify'](_0x5cd550));_0x3ffeba(_0x5cd550);})[_0x74c2('0x14')](function(_0x3ac1ae){logger[_0x74c2('0x11')]('ShowSugarcrmAccount',_0x3ac1ae['message'],_0x4576d8);_0x4dc080(_0x2c2442[_0x74c2('0x11')](0x1f4,_0x3ac1ae[_0x74c2('0x12')]));});});};
\ No newline at end of file
+var _0x7cf3=['where','limit','include','map','model','attributes','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw'];(function(_0xa88305,_0x222df7){var _0x2a64d2=function(_0x582437){while(--_0x582437){_0xa88305['push'](_0xa88305['shift']());}};_0x2a64d2(++_0x222df7);}(_0x7cf3,0x122));var _0x37cf=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x7cf3[_0x20845e];return _0x28cf2b;};'use strict';var _=require(_0x37cf('0x0'));var util=require(_0x37cf('0x1'));var moment=require(_0x37cf('0x2'));var BPromise=require(_0x37cf('0x3'));var rs=require(_0x37cf('0x4'));var fs=require('fs');var Redis=require(_0x37cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x37cf('0x6'));var config=require(_0x37cf('0x7'));var jayson=require(_0x37cf('0x8'));var client=jayson[_0x37cf('0x9')][_0x37cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b4da3,_0x1992a7,_0x57c948){return new BPromise(function(_0x514634,_0x3d75f6){return client['request'](_0x4b4da3,_0x57c948)[_0x37cf('0xb')](function(_0xc3cac7){logger[_0x37cf('0xc')](_0x37cf('0xd'),_0x1992a7,_0x37cf('0xe'));logger[_0x37cf('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1992a7,'request\x20sent',JSON['stringify'](_0xc3cac7));if(_0xc3cac7[_0x37cf('0x10')]){if(_0xc3cac7[_0x37cf('0x10')][_0x37cf('0x11')]===0x1f4){logger[_0x37cf('0x10')](_0x37cf('0xd'),_0x1992a7,_0xc3cac7['error'][_0x37cf('0x12')]);return _0x3d75f6(_0xc3cac7[_0x37cf('0x10')][_0x37cf('0x12')]);}logger[_0x37cf('0x10')](_0x37cf('0xd'),_0x1992a7,_0xc3cac7['error'][_0x37cf('0x12')]);return _0x514634(_0xc3cac7[_0x37cf('0x10')]['message']);}else{logger[_0x37cf('0xc')](_0x37cf('0xd'),_0x1992a7,_0x37cf('0xe'));_0x514634(_0xc3cac7[_0x37cf('0x13')][_0x37cf('0x12')]);}})[_0x37cf('0x14')](function(_0x339e1c){logger[_0x37cf('0x10')](_0x37cf('0xd'),_0x1992a7,_0x339e1c);_0x3d75f6(_0x339e1c);});});}exports[_0x37cf('0x15')]=function(_0x1e266a){var _0x4ab2e9=this;return new Promise(function(_0xc9f3ff,_0x330268){return db['SugarcrmAccount'][_0x37cf('0x16')]({'raw':_0x1e266a[_0x37cf('0x17')]?_0x1e266a[_0x37cf('0x17')][_0x37cf('0x18')]===undefined?!![]:![]:!![],'where':_0x1e266a['options']?_0x1e266a['options'][_0x37cf('0x19')]||null:null,'attributes':_0x1e266a[_0x37cf('0x17')]?_0x1e266a[_0x37cf('0x17')]['attributes']||null:null,'limit':_0x1e266a[_0x37cf('0x17')]?_0x1e266a[_0x37cf('0x17')][_0x37cf('0x1a')]||null:null,'include':_0x1e266a[_0x37cf('0x17')]?_0x1e266a[_0x37cf('0x17')][_0x37cf('0x1b')]?_[_0x37cf('0x1c')](_0x1e266a[_0x37cf('0x17')][_0x37cf('0x1b')],function(_0x58bc73){return{'model':db[_0x58bc73[_0x37cf('0x1d')]],'as':_0x58bc73['as'],'attributes':_0x58bc73[_0x37cf('0x1e')],'include':_0x58bc73[_0x37cf('0x1b')]?_[_0x37cf('0x1c')](_0x58bc73[_0x37cf('0x1b')],function(_0x961505){return{'model':db[_0x961505[_0x37cf('0x1d')]],'as':_0x961505['as'],'attributes':_0x961505[_0x37cf('0x1e')],'include':_0x961505['include']?_[_0x37cf('0x1c')](_0x961505[_0x37cf('0x1b')],function(_0x46bde8){return{'model':db[_0x46bde8[_0x37cf('0x1d')]],'as':_0x46bde8['as'],'attributes':_0x46bde8[_0x37cf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x37cf('0xb')](function(_0x22e2e3){logger[_0x37cf('0xc')](_0x37cf('0x15'),_0x1e266a);logger[_0x37cf('0xf')](_0x37cf('0x15'),_0x1e266a,JSON[_0x37cf('0x1f')](_0x22e2e3));_0xc9f3ff(_0x22e2e3);})[_0x37cf('0x14')](function(_0x5039fe){logger['error'](_0x37cf('0x15'),_0x5039fe[_0x37cf('0x12')],_0x1e266a);_0x330268(_0x4ab2e9[_0x37cf('0x10')](0x1f4,_0x5039fe[_0x37cf('0x12')]));});});};exports[_0x37cf('0x20')]=function(_0x441dc4){var _0x27c1b3=this;return new Promise(function(_0xb1a951,_0x1fe68a){return db[_0x37cf('0x21')][_0x37cf('0x22')]({'raw':_0x441dc4['options']?_0x441dc4[_0x37cf('0x17')][_0x37cf('0x18')]===undefined?!![]:![]:!![],'where':_0x441dc4['options']?_0x441dc4['options']['where']||null:null,'attributes':_0x441dc4['options']?_0x441dc4[_0x37cf('0x17')][_0x37cf('0x1e')]||null:null,'include':_0x441dc4[_0x37cf('0x17')]?_0x441dc4['options'][_0x37cf('0x1b')]?_['map'](_0x441dc4['options'][_0x37cf('0x1b')],function(_0x546fc0){return{'model':db[_0x546fc0[_0x37cf('0x1d')]],'as':_0x546fc0['as'],'attributes':_0x546fc0['attributes'],'include':_0x546fc0[_0x37cf('0x1b')]?_[_0x37cf('0x1c')](_0x546fc0[_0x37cf('0x1b')],function(_0x31a2e7){return{'model':db[_0x31a2e7['model']],'as':_0x31a2e7['as'],'attributes':_0x31a2e7[_0x37cf('0x1e')],'include':_0x31a2e7[_0x37cf('0x1b')]?_[_0x37cf('0x1c')](_0x31a2e7['include'],function(_0x807b01){return{'model':db[_0x807b01[_0x37cf('0x1d')]],'as':_0x807b01['as'],'attributes':_0x807b01[_0x37cf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x37cf('0xb')](function(_0x23aa8c){logger[_0x37cf('0xc')](_0x37cf('0x20'),_0x441dc4);logger[_0x37cf('0xf')](_0x37cf('0x20'),_0x441dc4,JSON[_0x37cf('0x1f')](_0x23aa8c));_0xb1a951(_0x23aa8c);})[_0x37cf('0x14')](function(_0x553138){logger[_0x37cf('0x10')](_0x37cf('0x20'),_0x553138['message'],_0x441dc4);_0x1fe68a(_0x27c1b3[_0x37cf('0x10')](0x1f4,_0x553138['message']));});});};
\ No newline at end of file
index 3dec19c..47a8989 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac25=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update'];(function(_0x55587d,_0x2e13b7){var _0x440f69=function(_0x23abbd){while(--_0x23abbd){_0x55587d['push'](_0x55587d['shift']());}};_0x440f69(++_0x2e13b7);}(_0xac25,0x1e5));var _0x5ac2=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xac25[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x5ac2('0x0'));var util=require(_0x5ac2('0x1'));var path=require(_0x5ac2('0x2'));var timeout=require(_0x5ac2('0x3'));var express=require(_0x5ac2('0x4'));var router=express[_0x5ac2('0x5')]();var auth=require(_0x5ac2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5ac2('0x7'));var controller=require(_0x5ac2('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5ac2('0x9')]('/:id',auth[_0x5ac2('0xa')](),controller['show']);router['get']('/:id/fields',auth[_0x5ac2('0xa')](),controller[_0x5ac2('0xb')]);router['get'](_0x5ac2('0xc'),auth[_0x5ac2('0xa')](),controller[_0x5ac2('0xd')]);router[_0x5ac2('0x9')](_0x5ac2('0xe'),auth['isAuthenticated'](),controller[_0x5ac2('0xf')]);router[_0x5ac2('0x10')]('/',auth['isAuthenticated'](),controller[_0x5ac2('0x11')]);router[_0x5ac2('0x12')](_0x5ac2('0x13'),auth[_0x5ac2('0xa')](),controller[_0x5ac2('0x14')]);router['delete'](_0x5ac2('0x13'),auth[_0x5ac2('0xa')](),controller[_0x5ac2('0x15')]);module[_0x5ac2('0x16')]=router;
\ No newline at end of file
+var _0x8f2a=['util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','/:id/descriptions','post','put','/:id','update','destroy','exports'];(function(_0x5674f5,_0x89d6af){var _0x5a7f05=function(_0x4afe4c){while(--_0x4afe4c){_0x5674f5['push'](_0x5674f5['shift']());}};_0x5a7f05(++_0x89d6af);}(_0x8f2a,0x98));var _0xa8f2=function(_0xac56ce,_0xb73e4){_0xac56ce=_0xac56ce-0x0;var _0x5105e1=_0x8f2a[_0xac56ce];return _0x5105e1;};'use strict';var multer=require('multer');var util=require(_0xa8f2('0x0'));var path=require(_0xa8f2('0x1'));var timeout=require(_0xa8f2('0x2'));var express=require(_0xa8f2('0x3'));var router=express[_0xa8f2('0x4')]();var auth=require(_0xa8f2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0xa8f2('0x6')]('/',auth[_0xa8f2('0x7')](),controller[_0xa8f2('0x8')]);router[_0xa8f2('0x6')]('/:id',auth[_0xa8f2('0x7')](),controller[_0xa8f2('0x9')]);router['get'](_0xa8f2('0xa'),auth[_0xa8f2('0x7')](),controller['getFields']);router[_0xa8f2('0x6')](_0xa8f2('0xb'),auth[_0xa8f2('0x7')](),controller['getSubjects']);router['get'](_0xa8f2('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa8f2('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa8f2('0xe')](_0xa8f2('0xf'),auth['isAuthenticated'](),controller[_0xa8f2('0x10')]);router['delete'](_0xa8f2('0xf'),auth[_0xa8f2('0x7')](),controller[_0xa8f2('0x11')]);module[_0xa8f2('0x12')]=router;
\ No newline at end of file
index 1b0eb07..c42b507 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbfd=['STRING','sequelize','exports'];(function(_0x38aeea,_0x57522a){var _0x5e8d2c=function(_0xff08ce){while(--_0xff08ce){_0x38aeea['push'](_0x38aeea['shift']());}};_0x5e8d2c(++_0x57522a);}(_0xbbfd,0x1ae));var _0xdbbf=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xbbfd[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require(_0xdbbf('0x0'));module[_0xdbbf('0x1')]={'name':{'type':Sequelize[_0xdbbf('0x2')]},'description':{'type':Sequelize[_0xdbbf('0x2')]}};
\ No newline at end of file
+var _0x8723=['exports','STRING','sequelize'];(function(_0x58fd8e,_0x3ed644){var _0x194192=function(_0x59a940){while(--_0x59a940){_0x58fd8e['push'](_0x58fd8e['shift']());}};_0x194192(++_0x3ed644);}(_0x8723,0x1dc));var _0x3872=function(_0x2e4e73,_0x121276){_0x2e4e73=_0x2e4e73-0x0;var _0x1f3fcc=_0x8723[_0x2e4e73];return _0x1f3fcc;};'use strict';var Sequelize=require(_0x3872('0x0'));module[_0x3872('0x1')]={'name':{'type':Sequelize[_0x3872('0x2')]},'description':{'type':Sequelize[_0x3872('0x2')]}};
\ No newline at end of file
index 49ddab5..881619f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab6=['filters','pick','add','day','merge','filter','field','options','SugarcrmConfiguration','include','findAll','params','rawAttributes','find','create','body','destroy','getFields','SugarcrmField','sort','map','getSubjects','findOne','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','model','dateStart','query','dateEnd','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xdab6,0x6f));var _0x6dab=function(_0x5b7070,_0x2ef3e9){_0x5b7070=_0x5b7070-0x0;var _0x582712=_0xdab6[_0x5b7070];return _0x582712;};'use strict';var pdf=require(_0x6dab('0x0'));var emlformat=require(_0x6dab('0x1'));var rimraf=require(_0x6dab('0x2'));var zipdir=require(_0x6dab('0x3'));var jsonpatch=require(_0x6dab('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6dab('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6dab('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6dab('0x7'));var squel=require('squel');var crypto=require(_0x6dab('0x8'));var jsforce=require(_0x6dab('0x9'));var deskjs=require(_0x6dab('0xa'));var toCsv=require(_0x6dab('0xb'));var querystring=require('querystring');var Papa=require(_0x6dab('0xc'));var Redis=require(_0x6dab('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x6dab('0xe'))(_0x6dab('0xf'));var utils=require(_0x6dab('0x10'));var config=require(_0x6dab('0x11'));var db=require(_0x6dab('0x12'))['db'];var jayson=require(_0x6dab('0x13'));var client=jayson[_0x6dab('0x14')][_0x6dab('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x21da78,_0x47a14f,_0x43f47d,_0x2e5ac0){return new BPromise(function(_0x5e2477,_0x145101){var _0x378a25=_0x2e5ac0||client;return _0x378a25[_0x6dab('0x16')](_0x21da78,_0x43f47d)[_0x6dab('0x17')](function(_0x2fee87){logger['info'](_0x6dab('0x18'),_0x47a14f,_0x6dab('0x19'));logger[_0x6dab('0x1a')](_0x6dab('0x1b'),_0x47a14f,'request\x20sent',JSON[_0x6dab('0x1c')](_0x2fee87));if(_0x2fee87[_0x6dab('0x1d')]){if(_0x2fee87[_0x6dab('0x1d')]['code']===0x1f4){logger[_0x6dab('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x47a14f,_0x2fee87[_0x6dab('0x1d')][_0x6dab('0x1e')]);return _0x145101(_0x2fee87[_0x6dab('0x1d')][_0x6dab('0x1e')]);}logger['error'](_0x6dab('0x18'),_0x47a14f,_0x2fee87[_0x6dab('0x1d')]['message']);return _0x5e2477(_0x2fee87[_0x6dab('0x1d')][_0x6dab('0x1e')]);}else{logger[_0x6dab('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x47a14f,'request\x20sent');_0x5e2477(_0x2fee87[_0x6dab('0x20')]['message']);}})[_0x6dab('0x21')](function(_0x14e001){logger[_0x6dab('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x47a14f,_0x14e001);_0x145101(_0x14e001);});});}function respondWithStatusCode(_0x3cfa6d,_0x38b0bc){_0x38b0bc=_0x38b0bc||0xcc;return function(_0x33935b){if(_0x33935b){return _0x3cfa6d[_0x6dab('0x22')](_0x38b0bc);}return _0x3cfa6d[_0x6dab('0x23')](_0x38b0bc)[_0x6dab('0x24')]();};}function respondWithResult(_0x35855a,_0x51541e){_0x51541e=_0x51541e||0xc8;return function(_0x5ceba7){if(_0x5ceba7){return _0x35855a[_0x6dab('0x23')](_0x51541e)[_0x6dab('0x25')](_0x5ceba7);}};}function respondWithFilteredResult(_0x40c1d5,_0x321e4d){return function(_0x115672){if(_0x115672){var _0x356be7=_0x115672[_0x6dab('0x26')],_0xc1ba6d=_0x321e4d[_0x6dab('0x27')],_0x13890e=_0x321e4d[_0x6dab('0x27')]+_0x321e4d[_0x6dab('0x28')],_0x696f4b;if(_0x13890e>=_0x356be7){_0x13890e=_0x356be7;_0x696f4b=0xc8;}else{_0x696f4b=0xce;}_0x40c1d5[_0x6dab('0x23')](_0x696f4b);return _0x40c1d5[_0x6dab('0x29')](_0x6dab('0x2a'),_0xc1ba6d+'-'+_0x13890e+'/'+_0x356be7)[_0x6dab('0x25')](_0x115672);}return null;};}function patchUpdates(_0x5aa4e1){return function(_0x2b6016){try{jsonpatch[_0x6dab('0x2b')](_0x2b6016,_0x5aa4e1,!![]);}catch(_0x3b4921){return BPromise[_0x6dab('0x2c')](_0x3b4921);}return _0x2b6016[_0x6dab('0x2d')]();};}function saveUpdates(_0x1bff11,_0x490ef3){return function(_0x5834bb){if(_0x5834bb){return _0x5834bb[_0x6dab('0x2e')](_0x1bff11)[_0x6dab('0x17')](function(_0x4ba9fa){return _0x4ba9fa;});}return null;};}function removeEntity(_0x48c903,_0x119945){return function(_0x3cc925){if(_0x3cc925){return _0x3cc925['destroy']()[_0x6dab('0x17')](function(){_0x48c903[_0x6dab('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5096ac,_0x44b5cb){return function(_0x846f03){if(!_0x846f03){_0x5096ac[_0x6dab('0x22')](0x194);}return _0x846f03;};}function handleError(_0x56f9a4,_0x5cd9ec){_0x5cd9ec=_0x5cd9ec||0x1f4;return function(_0x14c4a5){logger['error'](_0x14c4a5[_0x6dab('0x2f')]);if(_0x14c4a5[_0x6dab('0x30')]){delete _0x14c4a5['name'];}_0x56f9a4[_0x6dab('0x23')](_0x5cd9ec)[_0x6dab('0x31')](_0x14c4a5);};}exports['index']=function(_0x36a96f,_0x28c9c9){var _0x5ed8f5={},_0x57d0db={},_0x5b7939={'count':0x0,'rows':[]};var _0x37defe=db['SugarcrmConfiguration']['rawAttributes'];_0x57d0db[_0x6dab('0x32')]=_['keys'](_0x37defe);var _0x2ae5a7={'dateStart':_0x36a96f['query'][_0x6dab('0x33')],'dateEnd':_0x36a96f[_0x6dab('0x34')]['dateEnd']};delete _0x36a96f[_0x6dab('0x34')]['dateStart'];delete _0x36a96f[_0x6dab('0x34')][_0x6dab('0x35')];_0x57d0db['query']=_[_0x6dab('0x36')](_0x36a96f[_0x6dab('0x34')]);_0x57d0db['filters']=_['intersection'](_0x57d0db[_0x6dab('0x32')],_0x57d0db['query']);_0x5ed8f5['attributes']=_[_0x6dab('0x37')](_0x57d0db[_0x6dab('0x32')],qs[_0x6dab('0x38')](_0x36a96f['query'][_0x6dab('0x38')]));_0x5ed8f5[_0x6dab('0x39')]=_0x5ed8f5[_0x6dab('0x39')][_0x6dab('0x3a')]?_0x5ed8f5[_0x6dab('0x39')]:_0x57d0db[_0x6dab('0x32')];if(!_0x36a96f['query'][_0x6dab('0x3b')](_0x6dab('0x3c'))){_0x5ed8f5[_0x6dab('0x28')]=qs[_0x6dab('0x28')](_0x36a96f[_0x6dab('0x34')][_0x6dab('0x28')]);_0x5ed8f5[_0x6dab('0x27')]=qs[_0x6dab('0x27')](_0x36a96f[_0x6dab('0x34')][_0x6dab('0x27')]);}_0x5ed8f5[_0x6dab('0x3d')]=qs['sort'](_0x36a96f[_0x6dab('0x34')]['sort']);_0x5ed8f5[_0x6dab('0x3e')]=qs[_0x6dab('0x3f')](_[_0x6dab('0x40')](_0x36a96f[_0x6dab('0x34')],_0x57d0db['filters']));if(_0x2ae5a7[_0x6dab('0x33')]){if(_0x2ae5a7['dateEnd']){_0x2ae5a7[_0x6dab('0x35')]=moment(_0x2ae5a7[_0x6dab('0x35')])[_0x6dab('0x41')](0x1,_0x6dab('0x42'));}else{_0x2ae5a7[_0x6dab('0x35')]=moment(_0x2ae5a7[_0x6dab('0x33')])['add'](0x1,_0x6dab('0x42'));}_[_0x6dab('0x43')](_0x5ed8f5[_0x6dab('0x3e')],{'createdAt':{'$gte':_0x2ae5a7[_0x6dab('0x33')],'$lte':_0x2ae5a7[_0x6dab('0x35')]}});}if(_0x36a96f[_0x6dab('0x34')][_0x6dab('0x44')]){_0x5ed8f5[_0x6dab('0x3e')]=_[_0x6dab('0x43')](_0x5ed8f5[_0x6dab('0x3e')],{'$or':_['map'](_0x37defe,function(_0x29a978){if(_0x29a978['type']['key']!=='VIRTUAL'){var _0x210513={};_0x210513[_0x29a978[_0x6dab('0x45')]]={'$like':'%'+_0x36a96f[_0x6dab('0x34')][_0x6dab('0x44')]+'%'};return _0x210513;}})});}_0x5ed8f5=_['merge']({},_0x5ed8f5,_0x36a96f[_0x6dab('0x46')]);var _0xf17721={'where':_0x5ed8f5[_0x6dab('0x3e')]};return db[_0x6dab('0x47')][_0x6dab('0x26')](_0xf17721)[_0x6dab('0x17')](function(_0xa15e23){_0x5b7939['count']=_0xa15e23;if(_0x36a96f[_0x6dab('0x34')]['includeAll']){_0x5ed8f5[_0x6dab('0x48')]=[{'all':!![]}];}return db[_0x6dab('0x47')][_0x6dab('0x49')](_0x5ed8f5);})[_0x6dab('0x17')](function(_0x4bdd02){_0x5b7939['rows']=_0x4bdd02;return _0x5b7939;})[_0x6dab('0x17')](respondWithFilteredResult(_0x28c9c9,_0x5ed8f5))[_0x6dab('0x21')](handleError(_0x28c9c9,null));};exports['show']=function(_0x1bbf4b,_0x43d1d4){var _0x211f28={'raw':![],'where':{'id':_0x1bbf4b[_0x6dab('0x4a')]['id']}},_0x1c2bec={};_0x1c2bec[_0x6dab('0x32')]=_[_0x6dab('0x36')](db[_0x6dab('0x47')][_0x6dab('0x4b')]);_0x1c2bec[_0x6dab('0x34')]=_[_0x6dab('0x36')](_0x1bbf4b[_0x6dab('0x34')]);_0x1c2bec[_0x6dab('0x3f')]=_[_0x6dab('0x37')](_0x1c2bec[_0x6dab('0x32')],_0x1c2bec[_0x6dab('0x34')]);_0x211f28[_0x6dab('0x39')]=_[_0x6dab('0x37')](_0x1c2bec[_0x6dab('0x32')],qs[_0x6dab('0x38')](_0x1bbf4b[_0x6dab('0x34')][_0x6dab('0x38')]));_0x211f28[_0x6dab('0x39')]=_0x211f28[_0x6dab('0x39')][_0x6dab('0x3a')]?_0x211f28[_0x6dab('0x39')]:_0x1c2bec[_0x6dab('0x32')];if(_0x1bbf4b[_0x6dab('0x34')]['includeAll']){_0x211f28[_0x6dab('0x48')]=[{'all':!![]}];}_0x211f28=_['merge']({},_0x211f28,_0x1bbf4b[_0x6dab('0x46')]);return db[_0x6dab('0x47')][_0x6dab('0x4c')](_0x211f28)[_0x6dab('0x17')](handleEntityNotFound(_0x43d1d4,null))[_0x6dab('0x17')](respondWithResult(_0x43d1d4,null))[_0x6dab('0x21')](handleError(_0x43d1d4,null));};exports['create']=function(_0x3f9687,_0x35bffe){return db[_0x6dab('0x47')][_0x6dab('0x4d')](_0x3f9687[_0x6dab('0x4e')],{})[_0x6dab('0x17')](respondWithResult(_0x35bffe,0xc9))[_0x6dab('0x21')](handleError(_0x35bffe,null));};exports[_0x6dab('0x2e')]=function(_0x4da267,_0x5e26a6){if(_0x4da267[_0x6dab('0x4e')]['id']){delete _0x4da267[_0x6dab('0x4e')]['id'];}return db['SugarcrmConfiguration'][_0x6dab('0x4c')]({'where':{'id':_0x4da267[_0x6dab('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e26a6,null))[_0x6dab('0x17')](saveUpdates(_0x4da267[_0x6dab('0x4e')],null))[_0x6dab('0x17')](respondWithResult(_0x5e26a6,null))['catch'](handleError(_0x5e26a6,null));};exports[_0x6dab('0x4f')]=function(_0x38ff67,_0x3baaa2){return db[_0x6dab('0x47')][_0x6dab('0x4c')]({'where':{'id':_0x38ff67[_0x6dab('0x4a')]['id']}})[_0x6dab('0x17')](handleEntityNotFound(_0x3baaa2,null))[_0x6dab('0x17')](removeEntity(_0x3baaa2,null))[_0x6dab('0x21')](handleError(_0x3baaa2,null));};exports[_0x6dab('0x50')]=function(_0x29e5d9,_0x473126,_0x8f7ca3){var _0x5abf89={};var _0x45c82b={};var _0x122dd1;var _0x458a07;return db[_0x6dab('0x47')]['findOne']({'where':{'id':_0x29e5d9[_0x6dab('0x4a')]['id']}})[_0x6dab('0x17')](handleEntityNotFound(_0x473126,null))[_0x6dab('0x17')](function(_0x46becc){if(_0x46becc){_0x122dd1=_0x46becc;_0x45c82b['model']=_['keys'](db[_0x6dab('0x51')][_0x6dab('0x4b')]);_0x45c82b[_0x6dab('0x34')]=_[_0x6dab('0x36')](_0x29e5d9[_0x6dab('0x34')]);_0x45c82b[_0x6dab('0x3f')]=_[_0x6dab('0x37')](_0x45c82b[_0x6dab('0x32')],_0x45c82b['query']);_0x5abf89[_0x6dab('0x39')]=_[_0x6dab('0x37')](_0x45c82b[_0x6dab('0x32')],qs[_0x6dab('0x38')](_0x29e5d9[_0x6dab('0x34')]['fields']));_0x5abf89[_0x6dab('0x39')]=_0x5abf89[_0x6dab('0x39')][_0x6dab('0x3a')]?_0x5abf89[_0x6dab('0x39')]:_0x45c82b[_0x6dab('0x32')];_0x5abf89[_0x6dab('0x3d')]=qs[_0x6dab('0x52')](_0x29e5d9['query'][_0x6dab('0x52')]);_0x5abf89[_0x6dab('0x3e')]=qs[_0x6dab('0x3f')](_[_0x6dab('0x40')](_0x29e5d9[_0x6dab('0x34')],_0x45c82b[_0x6dab('0x3f')]));if(_0x29e5d9[_0x6dab('0x34')][_0x6dab('0x44')]){_0x5abf89[_0x6dab('0x3e')]=_['merge'](_0x5abf89['where'],{'$or':_[_0x6dab('0x53')](_0x5abf89[_0x6dab('0x39')],function(_0x12544d){var _0x258f9e={};_0x258f9e[_0x12544d]={'$like':'%'+_0x29e5d9[_0x6dab('0x34')][_0x6dab('0x44')]+'%'};return _0x258f9e;})});}_0x5abf89=_[_0x6dab('0x43')]({},_0x5abf89,_0x29e5d9[_0x6dab('0x46')]);return _0x122dd1[_0x6dab('0x50')](_0x5abf89);}})[_0x6dab('0x17')](function(_0x27a97c){if(_0x27a97c){_0x458a07=_0x27a97c[_0x6dab('0x3a')];if(!_0x29e5d9[_0x6dab('0x34')][_0x6dab('0x3b')](_0x6dab('0x3c'))){_0x5abf89[_0x6dab('0x28')]=qs[_0x6dab('0x28')](_0x29e5d9[_0x6dab('0x34')][_0x6dab('0x28')]);_0x5abf89[_0x6dab('0x27')]=qs[_0x6dab('0x27')](_0x29e5d9[_0x6dab('0x34')][_0x6dab('0x27')]);}return _0x122dd1[_0x6dab('0x50')](_0x5abf89);}})[_0x6dab('0x17')](function(_0x2b493b){if(_0x2b493b){return _0x2b493b?{'count':_0x458a07,'rows':_0x2b493b}:null;}})[_0x6dab('0x17')](respondWithResult(_0x473126,null))[_0x6dab('0x21')](handleError(_0x473126,null));};exports[_0x6dab('0x54')]=function(_0x19397d,_0x35cc37,_0x2e3f52){var _0x377e45={};var _0x7dd293={};var _0x5a63a5;var _0x528b53;return db[_0x6dab('0x47')][_0x6dab('0x55')]({'where':{'id':_0x19397d[_0x6dab('0x4a')]['id']}})[_0x6dab('0x17')](handleEntityNotFound(_0x35cc37,null))[_0x6dab('0x17')](function(_0xc692a1){if(_0xc692a1){_0x5a63a5=_0xc692a1;_0x7dd293[_0x6dab('0x32')]=_[_0x6dab('0x36')](db[_0x6dab('0x51')][_0x6dab('0x4b')]);_0x7dd293[_0x6dab('0x34')]=_['keys'](_0x19397d[_0x6dab('0x34')]);_0x7dd293[_0x6dab('0x3f')]=_[_0x6dab('0x37')](_0x7dd293['model'],_0x7dd293['query']);_0x377e45[_0x6dab('0x39')]=_[_0x6dab('0x37')](_0x7dd293[_0x6dab('0x32')],qs['fields'](_0x19397d['query'][_0x6dab('0x38')]));_0x377e45[_0x6dab('0x39')]=_0x377e45[_0x6dab('0x39')]['length']?_0x377e45['attributes']:_0x7dd293[_0x6dab('0x32')];_0x377e45[_0x6dab('0x3d')]=qs[_0x6dab('0x52')](_0x19397d[_0x6dab('0x34')][_0x6dab('0x52')]);_0x377e45['where']=qs['filters'](_[_0x6dab('0x40')](_0x19397d['query'],_0x7dd293[_0x6dab('0x3f')]));if(_0x19397d[_0x6dab('0x34')][_0x6dab('0x44')]){_0x377e45[_0x6dab('0x3e')]=_[_0x6dab('0x43')](_0x377e45[_0x6dab('0x3e')],{'$or':_['map'](_0x377e45[_0x6dab('0x39')],function(_0x3deabe){var _0x257137={};_0x257137[_0x3deabe]={'$like':'%'+_0x19397d['query'][_0x6dab('0x44')]+'%'};return _0x257137;})});}_0x377e45=_[_0x6dab('0x43')]({},_0x377e45,_0x19397d['options']);return _0x5a63a5[_0x6dab('0x54')](_0x377e45);}})['then'](function(_0x2731fb){if(_0x2731fb){_0x528b53=_0x2731fb[_0x6dab('0x3a')];if(!_0x19397d['query'][_0x6dab('0x3b')](_0x6dab('0x3c'))){_0x377e45[_0x6dab('0x28')]=qs['limit'](_0x19397d[_0x6dab('0x34')][_0x6dab('0x28')]);_0x377e45['offset']=qs[_0x6dab('0x27')](_0x19397d[_0x6dab('0x34')][_0x6dab('0x27')]);}return _0x5a63a5['getSubjects'](_0x377e45);}})[_0x6dab('0x17')](function(_0x27b517){if(_0x27b517){return _0x27b517?{'count':_0x528b53,'rows':_0x27b517}:null;}})['then'](respondWithResult(_0x35cc37,null))[_0x6dab('0x21')](handleError(_0x35cc37,null));};exports[_0x6dab('0x56')]=function(_0x32d4c0,_0x4ee1e3,_0x2a3d17){var _0xa94dd5={};var _0x551a92={};var _0x418757;var _0x16a361;return db[_0x6dab('0x47')][_0x6dab('0x55')]({'where':{'id':_0x32d4c0[_0x6dab('0x4a')]['id']}})[_0x6dab('0x17')](handleEntityNotFound(_0x4ee1e3,null))[_0x6dab('0x17')](function(_0x522801){if(_0x522801){_0x418757=_0x522801;_0x551a92[_0x6dab('0x32')]=_['keys'](db[_0x6dab('0x51')][_0x6dab('0x4b')]);_0x551a92['query']=_[_0x6dab('0x36')](_0x32d4c0['query']);_0x551a92[_0x6dab('0x3f')]=_['intersection'](_0x551a92[_0x6dab('0x32')],_0x551a92[_0x6dab('0x34')]);_0xa94dd5[_0x6dab('0x39')]=_['intersection'](_0x551a92[_0x6dab('0x32')],qs['fields'](_0x32d4c0[_0x6dab('0x34')][_0x6dab('0x38')]));_0xa94dd5[_0x6dab('0x39')]=_0xa94dd5[_0x6dab('0x39')]['length']?_0xa94dd5[_0x6dab('0x39')]:_0x551a92[_0x6dab('0x32')];_0xa94dd5[_0x6dab('0x3d')]=qs[_0x6dab('0x52')](_0x32d4c0[_0x6dab('0x34')][_0x6dab('0x52')]);_0xa94dd5['where']=qs['filters'](_['pick'](_0x32d4c0['query'],_0x551a92[_0x6dab('0x3f')]));if(_0x32d4c0[_0x6dab('0x34')][_0x6dab('0x44')]){_0xa94dd5['where']=_[_0x6dab('0x43')](_0xa94dd5[_0x6dab('0x3e')],{'$or':_[_0x6dab('0x53')](_0xa94dd5[_0x6dab('0x39')],function(_0x4d0ed0){var _0xf44cd0={};_0xf44cd0[_0x4d0ed0]={'$like':'%'+_0x32d4c0['query'][_0x6dab('0x44')]+'%'};return _0xf44cd0;})});}_0xa94dd5=_[_0x6dab('0x43')]({},_0xa94dd5,_0x32d4c0[_0x6dab('0x46')]);return _0x418757[_0x6dab('0x56')](_0xa94dd5);}})[_0x6dab('0x17')](function(_0x2ac3b4){if(_0x2ac3b4){_0x16a361=_0x2ac3b4[_0x6dab('0x3a')];if(!_0x32d4c0['query'][_0x6dab('0x3b')](_0x6dab('0x3c'))){_0xa94dd5[_0x6dab('0x28')]=qs[_0x6dab('0x28')](_0x32d4c0[_0x6dab('0x34')]['limit']);_0xa94dd5[_0x6dab('0x27')]=qs['offset'](_0x32d4c0[_0x6dab('0x34')][_0x6dab('0x27')]);}return _0x418757[_0x6dab('0x56')](_0xa94dd5);}})[_0x6dab('0x17')](function(_0x290b80){if(_0x290b80){return _0x290b80?{'count':_0x16a361,'rows':_0x290b80}:null;}})[_0x6dab('0x17')](respondWithResult(_0x4ee1e3,null))[_0x6dab('0x21')](handleError(_0x4ee1e3,null));};
\ No newline at end of file
+var _0x26fc=['pick','getSubjects','SugarcrmField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','json','count','offset','limit','Content-Range','update','destroy','end','name','send','rawAttributes','keys','dateStart','query','dateEnd','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','day','add','merge','filter','map','type','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','show','params','create','body','catch','find','getFields','findOne','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26fc,0x1ad));var _0xc26f=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x26fc[_0x433a86];return _0x23000c;};'use strict';var pdf=require(_0xc26f('0x0'));var emlformat=require(_0xc26f('0x1'));var rimraf=require(_0xc26f('0x2'));var zipdir=require(_0xc26f('0x3'));var jsonpatch=require(_0xc26f('0x4'));var rp=require('request-promise');var moment=require(_0xc26f('0x5'));var BPromise=require(_0xc26f('0x6'));var Mustache=require(_0xc26f('0x7'));var util=require(_0xc26f('0x8'));var path=require('path');var sox=require(_0xc26f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc26f('0xa'));var squel=require(_0xc26f('0xb'));var crypto=require(_0xc26f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc26f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc26f('0xe'));var Papa=require(_0xc26f('0xf'));var Redis=require(_0xc26f('0x10'));var qs=require(_0xc26f('0x11'));var logger=require(_0xc26f('0x12'))(_0xc26f('0x13'));var utils=require(_0xc26f('0x14'));var config=require(_0xc26f('0x15'));var db=require(_0xc26f('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xc26f('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4f86b8,_0x39ac70,_0x18b7d2,_0x104611){return new BPromise(function(_0xa891d2,_0x16c142){var _0x1ba1d9=_0x104611||client;return _0x1ba1d9[_0xc26f('0x18')](_0x4f86b8,_0x18b7d2)[_0xc26f('0x19')](function(_0x581bbd){logger[_0xc26f('0x1a')](_0xc26f('0x1b'),_0x39ac70,_0xc26f('0x1c'));logger[_0xc26f('0x1d')](_0xc26f('0x1e'),_0x39ac70,_0xc26f('0x1c'),JSON[_0xc26f('0x1f')](_0x581bbd));if(_0x581bbd[_0xc26f('0x20')]){if(_0x581bbd[_0xc26f('0x20')][_0xc26f('0x21')]===0x1f4){logger[_0xc26f('0x20')](_0xc26f('0x1b'),_0x39ac70,_0x581bbd[_0xc26f('0x20')]['message']);return _0x16c142(_0x581bbd['error']['message']);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x39ac70,_0x581bbd[_0xc26f('0x20')][_0xc26f('0x22')]);return _0xa891d2(_0x581bbd[_0xc26f('0x20')][_0xc26f('0x22')]);}else{logger['info'](_0xc26f('0x1b'),_0x39ac70,_0xc26f('0x1c'));_0xa891d2(_0x581bbd['result']['message']);}})['catch'](function(_0xdbe4f0){logger[_0xc26f('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x39ac70,_0xdbe4f0);_0x16c142(_0xdbe4f0);});});}function respondWithStatusCode(_0x27ed0f,_0x50d43d){_0x50d43d=_0x50d43d||0xcc;return function(_0x40d46d){if(_0x40d46d){return _0x27ed0f['sendStatus'](_0x50d43d);}return _0x27ed0f[_0xc26f('0x23')](_0x50d43d)['end']();};}function respondWithResult(_0x189c03,_0x1b89d1){_0x1b89d1=_0x1b89d1||0xc8;return function(_0x96c356){if(_0x96c356){return _0x189c03[_0xc26f('0x23')](_0x1b89d1)[_0xc26f('0x24')](_0x96c356);}};}function respondWithFilteredResult(_0x4679c8,_0x2dd8b1){return function(_0x2a92ae){if(_0x2a92ae){var _0x738a42=_0x2a92ae[_0xc26f('0x25')],_0x26f6c1=_0x2dd8b1[_0xc26f('0x26')],_0x5f5d0c=_0x2dd8b1[_0xc26f('0x26')]+_0x2dd8b1[_0xc26f('0x27')],_0x25e5d0;if(_0x5f5d0c>=_0x738a42){_0x5f5d0c=_0x738a42;_0x25e5d0=0xc8;}else{_0x25e5d0=0xce;}_0x4679c8[_0xc26f('0x23')](_0x25e5d0);return _0x4679c8['set'](_0xc26f('0x28'),_0x26f6c1+'-'+_0x5f5d0c+'/'+_0x738a42)[_0xc26f('0x24')](_0x2a92ae);}return null;};}function patchUpdates(_0x5a6286){return function(_0x862a1b){try{jsonpatch['apply'](_0x862a1b,_0x5a6286,!![]);}catch(_0x352b44){return BPromise['reject'](_0x352b44);}return _0x862a1b['save']();};}function saveUpdates(_0x23aa06,_0x89cae7){return function(_0x4a37e9){if(_0x4a37e9){return _0x4a37e9[_0xc26f('0x29')](_0x23aa06)['then'](function(_0x393c74){return _0x393c74;});}return null;};}function removeEntity(_0x19b8fe,_0x536c84){return function(_0x26a752){if(_0x26a752){return _0x26a752[_0xc26f('0x2a')]()[_0xc26f('0x19')](function(){_0x19b8fe[_0xc26f('0x23')](0xcc)[_0xc26f('0x2b')]();});}};}function handleEntityNotFound(_0xad57c,_0x1c5b8e){return function(_0x440d7a){if(!_0x440d7a){_0xad57c['sendStatus'](0x194);}return _0x440d7a;};}function handleError(_0x5bd9bf,_0x5188fd){_0x5188fd=_0x5188fd||0x1f4;return function(_0x44ff52){logger[_0xc26f('0x20')](_0x44ff52['stack']);if(_0x44ff52[_0xc26f('0x2c')]){delete _0x44ff52[_0xc26f('0x2c')];}_0x5bd9bf[_0xc26f('0x23')](_0x5188fd)[_0xc26f('0x2d')](_0x44ff52);};}exports['index']=function(_0x449301,_0x2869e8){var _0x5780e8={},_0x17e624={},_0x13e3e1={'count':0x0,'rows':[]};var _0x4538ac=db['SugarcrmConfiguration'][_0xc26f('0x2e')];_0x17e624['model']=_[_0xc26f('0x2f')](_0x4538ac);var _0x5a73bb={'dateStart':_0x449301['query'][_0xc26f('0x30')],'dateEnd':_0x449301[_0xc26f('0x31')][_0xc26f('0x32')]};delete _0x449301[_0xc26f('0x31')][_0xc26f('0x30')];delete _0x449301['query'][_0xc26f('0x32')];_0x17e624[_0xc26f('0x31')]=_[_0xc26f('0x2f')](_0x449301['query']);_0x17e624[_0xc26f('0x33')]=_[_0xc26f('0x34')](_0x17e624[_0xc26f('0x35')],_0x17e624[_0xc26f('0x31')]);_0x5780e8[_0xc26f('0x36')]=_[_0xc26f('0x34')](_0x17e624['model'],qs[_0xc26f('0x37')](_0x449301['query'][_0xc26f('0x37')]));_0x5780e8[_0xc26f('0x36')]=_0x5780e8[_0xc26f('0x36')]['length']?_0x5780e8[_0xc26f('0x36')]:_0x17e624['model'];if(!_0x449301[_0xc26f('0x31')][_0xc26f('0x38')](_0xc26f('0x39'))){_0x5780e8['limit']=qs[_0xc26f('0x27')](_0x449301[_0xc26f('0x31')][_0xc26f('0x27')]);_0x5780e8[_0xc26f('0x26')]=qs['offset'](_0x449301[_0xc26f('0x31')][_0xc26f('0x26')]);}_0x5780e8[_0xc26f('0x3a')]=qs[_0xc26f('0x3b')](_0x449301[_0xc26f('0x31')][_0xc26f('0x3b')]);_0x5780e8[_0xc26f('0x3c')]=qs[_0xc26f('0x33')](_['pick'](_0x449301[_0xc26f('0x31')],_0x17e624['filters']));if(_0x5a73bb[_0xc26f('0x30')]){if(_0x5a73bb[_0xc26f('0x32')]){_0x5a73bb[_0xc26f('0x32')]=moment(_0x5a73bb[_0xc26f('0x32')])['add'](0x1,_0xc26f('0x3d'));}else{_0x5a73bb[_0xc26f('0x32')]=moment(_0x5a73bb[_0xc26f('0x30')])[_0xc26f('0x3e')](0x1,_0xc26f('0x3d'));}_[_0xc26f('0x3f')](_0x5780e8[_0xc26f('0x3c')],{'createdAt':{'$gte':_0x5a73bb[_0xc26f('0x30')],'$lte':_0x5a73bb[_0xc26f('0x32')]}});}if(_0x449301[_0xc26f('0x31')][_0xc26f('0x40')]){_0x5780e8[_0xc26f('0x3c')]=_['merge'](_0x5780e8['where'],{'$or':_[_0xc26f('0x41')](_0x4538ac,function(_0x2e1683){if(_0x2e1683[_0xc26f('0x42')]['key']!==_0xc26f('0x43')){var _0x422d03={};_0x422d03[_0x2e1683['field']]={'$like':'%'+_0x449301[_0xc26f('0x31')][_0xc26f('0x40')]+'%'};return _0x422d03;}})});}_0x5780e8=_[_0xc26f('0x3f')]({},_0x5780e8,_0x449301[_0xc26f('0x44')]);var _0x728399={'where':_0x5780e8['where']};return db[_0xc26f('0x45')][_0xc26f('0x25')](_0x728399)[_0xc26f('0x19')](function(_0xa77ade){_0x13e3e1['count']=_0xa77ade;if(_0x449301['query'][_0xc26f('0x46')]){_0x5780e8[_0xc26f('0x47')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x5780e8);})['then'](function(_0x131ef4){_0x13e3e1['rows']=_0x131ef4;return _0x13e3e1;})[_0xc26f('0x19')](respondWithFilteredResult(_0x2869e8,_0x5780e8))['catch'](handleError(_0x2869e8,null));};exports[_0xc26f('0x48')]=function(_0x5e7067,_0x20e9d3){var _0x111ac0={'raw':![],'where':{'id':_0x5e7067[_0xc26f('0x49')]['id']}},_0x15b3f6={};_0x15b3f6[_0xc26f('0x35')]=_[_0xc26f('0x2f')](db[_0xc26f('0x45')][_0xc26f('0x2e')]);_0x15b3f6['query']=_['keys'](_0x5e7067[_0xc26f('0x31')]);_0x15b3f6[_0xc26f('0x33')]=_[_0xc26f('0x34')](_0x15b3f6[_0xc26f('0x35')],_0x15b3f6[_0xc26f('0x31')]);_0x111ac0[_0xc26f('0x36')]=_[_0xc26f('0x34')](_0x15b3f6[_0xc26f('0x35')],qs[_0xc26f('0x37')](_0x5e7067[_0xc26f('0x31')][_0xc26f('0x37')]));_0x111ac0[_0xc26f('0x36')]=_0x111ac0[_0xc26f('0x36')]['length']?_0x111ac0[_0xc26f('0x36')]:_0x15b3f6[_0xc26f('0x35')];if(_0x5e7067[_0xc26f('0x31')][_0xc26f('0x46')]){_0x111ac0[_0xc26f('0x47')]=[{'all':!![]}];}_0x111ac0=_['merge']({},_0x111ac0,_0x5e7067['options']);return db[_0xc26f('0x45')]['find'](_0x111ac0)[_0xc26f('0x19')](handleEntityNotFound(_0x20e9d3,null))[_0xc26f('0x19')](respondWithResult(_0x20e9d3,null))['catch'](handleError(_0x20e9d3,null));};exports[_0xc26f('0x4a')]=function(_0x156e8f,_0x364d33){return db[_0xc26f('0x45')][_0xc26f('0x4a')](_0x156e8f[_0xc26f('0x4b')],{})[_0xc26f('0x19')](respondWithResult(_0x364d33,0xc9))[_0xc26f('0x4c')](handleError(_0x364d33,null));};exports[_0xc26f('0x29')]=function(_0x4cb28b,_0x35ffe8){if(_0x4cb28b['body']['id']){delete _0x4cb28b[_0xc26f('0x4b')]['id'];}return db[_0xc26f('0x45')][_0xc26f('0x4d')]({'where':{'id':_0x4cb28b[_0xc26f('0x49')]['id']}})[_0xc26f('0x19')](handleEntityNotFound(_0x35ffe8,null))[_0xc26f('0x19')](saveUpdates(_0x4cb28b[_0xc26f('0x4b')],null))[_0xc26f('0x19')](respondWithResult(_0x35ffe8,null))[_0xc26f('0x4c')](handleError(_0x35ffe8,null));};exports[_0xc26f('0x2a')]=function(_0x54c6e2,_0x57ca2f){return db['SugarcrmConfiguration'][_0xc26f('0x4d')]({'where':{'id':_0x54c6e2[_0xc26f('0x49')]['id']}})[_0xc26f('0x19')](handleEntityNotFound(_0x57ca2f,null))[_0xc26f('0x19')](removeEntity(_0x57ca2f,null))[_0xc26f('0x4c')](handleError(_0x57ca2f,null));};exports[_0xc26f('0x4e')]=function(_0x2e50a3,_0x2f5bec,_0x2f2e74){var _0x56f858={};var _0x30a392={};var _0x562730;var _0x577ae6;return db[_0xc26f('0x45')][_0xc26f('0x4f')]({'where':{'id':_0x2e50a3[_0xc26f('0x49')]['id']}})[_0xc26f('0x19')](handleEntityNotFound(_0x2f5bec,null))[_0xc26f('0x19')](function(_0x5401f7){if(_0x5401f7){_0x562730=_0x5401f7;_0x30a392[_0xc26f('0x35')]=_[_0xc26f('0x2f')](db['SugarcrmField'][_0xc26f('0x2e')]);_0x30a392['query']=_[_0xc26f('0x2f')](_0x2e50a3['query']);_0x30a392[_0xc26f('0x33')]=_[_0xc26f('0x34')](_0x30a392[_0xc26f('0x35')],_0x30a392[_0xc26f('0x31')]);_0x56f858['attributes']=_[_0xc26f('0x34')](_0x30a392['model'],qs[_0xc26f('0x37')](_0x2e50a3[_0xc26f('0x31')][_0xc26f('0x37')]));_0x56f858[_0xc26f('0x36')]=_0x56f858[_0xc26f('0x36')][_0xc26f('0x50')]?_0x56f858[_0xc26f('0x36')]:_0x30a392[_0xc26f('0x35')];_0x56f858[_0xc26f('0x3a')]=qs['sort'](_0x2e50a3[_0xc26f('0x31')]['sort']);_0x56f858[_0xc26f('0x3c')]=qs[_0xc26f('0x33')](_[_0xc26f('0x51')](_0x2e50a3[_0xc26f('0x31')],_0x30a392[_0xc26f('0x33')]));if(_0x2e50a3[_0xc26f('0x31')]['filter']){_0x56f858[_0xc26f('0x3c')]=_[_0xc26f('0x3f')](_0x56f858['where'],{'$or':_[_0xc26f('0x41')](_0x56f858['attributes'],function(_0x2ea6d3){var _0x5ab2bd={};_0x5ab2bd[_0x2ea6d3]={'$like':'%'+_0x2e50a3['query']['filter']+'%'};return _0x5ab2bd;})});}_0x56f858=_[_0xc26f('0x3f')]({},_0x56f858,_0x2e50a3[_0xc26f('0x44')]);return _0x562730[_0xc26f('0x4e')](_0x56f858);}})[_0xc26f('0x19')](function(_0x20d4d7){if(_0x20d4d7){_0x577ae6=_0x20d4d7[_0xc26f('0x50')];if(!_0x2e50a3['query'][_0xc26f('0x38')](_0xc26f('0x39'))){_0x56f858[_0xc26f('0x27')]=qs['limit'](_0x2e50a3[_0xc26f('0x31')][_0xc26f('0x27')]);_0x56f858['offset']=qs[_0xc26f('0x26')](_0x2e50a3[_0xc26f('0x31')][_0xc26f('0x26')]);}return _0x562730[_0xc26f('0x4e')](_0x56f858);}})[_0xc26f('0x19')](function(_0x1684a0){if(_0x1684a0){return _0x1684a0?{'count':_0x577ae6,'rows':_0x1684a0}:null;}})[_0xc26f('0x19')](respondWithResult(_0x2f5bec,null))[_0xc26f('0x4c')](handleError(_0x2f5bec,null));};exports[_0xc26f('0x52')]=function(_0x5d3e0e,_0x583ea3,_0x12e6e6){var _0x139c48={};var _0x12533b={};var _0x34396b;var _0xb3f147;return db['SugarcrmConfiguration'][_0xc26f('0x4f')]({'where':{'id':_0x5d3e0e['params']['id']}})[_0xc26f('0x19')](handleEntityNotFound(_0x583ea3,null))[_0xc26f('0x19')](function(_0x4a4264){if(_0x4a4264){_0x34396b=_0x4a4264;_0x12533b['model']=_[_0xc26f('0x2f')](db[_0xc26f('0x53')][_0xc26f('0x2e')]);_0x12533b[_0xc26f('0x31')]=_[_0xc26f('0x2f')](_0x5d3e0e[_0xc26f('0x31')]);_0x12533b[_0xc26f('0x33')]=_['intersection'](_0x12533b[_0xc26f('0x35')],_0x12533b[_0xc26f('0x31')]);_0x139c48[_0xc26f('0x36')]=_[_0xc26f('0x34')](_0x12533b['model'],qs[_0xc26f('0x37')](_0x5d3e0e[_0xc26f('0x31')][_0xc26f('0x37')]));_0x139c48[_0xc26f('0x36')]=_0x139c48['attributes']['length']?_0x139c48[_0xc26f('0x36')]:_0x12533b[_0xc26f('0x35')];_0x139c48['order']=qs[_0xc26f('0x3b')](_0x5d3e0e['query']['sort']);_0x139c48[_0xc26f('0x3c')]=qs[_0xc26f('0x33')](_[_0xc26f('0x51')](_0x5d3e0e[_0xc26f('0x31')],_0x12533b['filters']));if(_0x5d3e0e['query']['filter']){_0x139c48[_0xc26f('0x3c')]=_[_0xc26f('0x3f')](_0x139c48[_0xc26f('0x3c')],{'$or':_[_0xc26f('0x41')](_0x139c48[_0xc26f('0x36')],function(_0x52649a){var _0x4667ae={};_0x4667ae[_0x52649a]={'$like':'%'+_0x5d3e0e[_0xc26f('0x31')][_0xc26f('0x40')]+'%'};return _0x4667ae;})});}_0x139c48=_[_0xc26f('0x3f')]({},_0x139c48,_0x5d3e0e[_0xc26f('0x44')]);return _0x34396b[_0xc26f('0x52')](_0x139c48);}})[_0xc26f('0x19')](function(_0xadd230){if(_0xadd230){_0xb3f147=_0xadd230['length'];if(!_0x5d3e0e[_0xc26f('0x31')][_0xc26f('0x38')]('nolimit')){_0x139c48[_0xc26f('0x27')]=qs[_0xc26f('0x27')](_0x5d3e0e[_0xc26f('0x31')]['limit']);_0x139c48[_0xc26f('0x26')]=qs[_0xc26f('0x26')](_0x5d3e0e[_0xc26f('0x31')][_0xc26f('0x26')]);}return _0x34396b['getSubjects'](_0x139c48);}})[_0xc26f('0x19')](function(_0xf7c6d9){if(_0xf7c6d9){return _0xf7c6d9?{'count':_0xb3f147,'rows':_0xf7c6d9}:null;}})[_0xc26f('0x19')](respondWithResult(_0x583ea3,null))[_0xc26f('0x4c')](handleError(_0x583ea3,null));};exports['getDescriptions']=function(_0x4860c7,_0x208fd5,_0x5423da){var _0x4932e0={};var _0x20d8d0={};var _0x2def0b;var _0x36dc75;return db[_0xc26f('0x45')][_0xc26f('0x4f')]({'where':{'id':_0x4860c7[_0xc26f('0x49')]['id']}})[_0xc26f('0x19')](handleEntityNotFound(_0x208fd5,null))[_0xc26f('0x19')](function(_0x299243){if(_0x299243){_0x2def0b=_0x299243;_0x20d8d0[_0xc26f('0x35')]=_[_0xc26f('0x2f')](db[_0xc26f('0x53')][_0xc26f('0x2e')]);_0x20d8d0[_0xc26f('0x31')]=_['keys'](_0x4860c7[_0xc26f('0x31')]);_0x20d8d0[_0xc26f('0x33')]=_['intersection'](_0x20d8d0[_0xc26f('0x35')],_0x20d8d0['query']);_0x4932e0[_0xc26f('0x36')]=_['intersection'](_0x20d8d0['model'],qs['fields'](_0x4860c7[_0xc26f('0x31')][_0xc26f('0x37')]));_0x4932e0['attributes']=_0x4932e0[_0xc26f('0x36')][_0xc26f('0x50')]?_0x4932e0['attributes']:_0x20d8d0[_0xc26f('0x35')];_0x4932e0['order']=qs[_0xc26f('0x3b')](_0x4860c7[_0xc26f('0x31')][_0xc26f('0x3b')]);_0x4932e0[_0xc26f('0x3c')]=qs['filters'](_[_0xc26f('0x51')](_0x4860c7[_0xc26f('0x31')],_0x20d8d0[_0xc26f('0x33')]));if(_0x4860c7[_0xc26f('0x31')]['filter']){_0x4932e0[_0xc26f('0x3c')]=_[_0xc26f('0x3f')](_0x4932e0['where'],{'$or':_[_0xc26f('0x41')](_0x4932e0[_0xc26f('0x36')],function(_0x2c6213){var _0x523f40={};_0x523f40[_0x2c6213]={'$like':'%'+_0x4860c7[_0xc26f('0x31')][_0xc26f('0x40')]+'%'};return _0x523f40;})});}_0x4932e0=_['merge']({},_0x4932e0,_0x4860c7[_0xc26f('0x44')]);return _0x2def0b[_0xc26f('0x54')](_0x4932e0);}})['then'](function(_0x3cd445){if(_0x3cd445){_0x36dc75=_0x3cd445[_0xc26f('0x50')];if(!_0x4860c7[_0xc26f('0x31')][_0xc26f('0x38')](_0xc26f('0x39'))){_0x4932e0[_0xc26f('0x27')]=qs[_0xc26f('0x27')](_0x4860c7[_0xc26f('0x31')]['limit']);_0x4932e0[_0xc26f('0x26')]=qs[_0xc26f('0x26')](_0x4860c7[_0xc26f('0x31')][_0xc26f('0x26')]);}return _0x2def0b[_0xc26f('0x54')](_0x4932e0);}})[_0xc26f('0x19')](function(_0xe9ac9e){if(_0xe9ac9e){return _0xe9ac9e?{'count':_0x36dc75,'rows':_0xe9ac9e}:null;}})[_0xc26f('0x19')](respondWithResult(_0x208fd5,null))[_0xc26f('0x4c')](handleError(_0x208fd5,null));};
\ No newline at end of file
index 3476a20..e5f8218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e48=['api','moment','bluebird','request-promise','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util'];(function(_0x5c598e,_0x1f444e){var _0x14704e=function(_0x4e39d7){while(--_0x4e39d7){_0x5c598e['push'](_0x5c598e['shift']());}};_0x14704e(++_0x1f444e);}(_0x2e48,0x76));var _0x82e4=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x2e48[_0x2ade6c];return _0x2cb372;};'use strict';var _=require(_0x82e4('0x0'));var util=require(_0x82e4('0x1'));var logger=require('../../config/logger')(_0x82e4('0x2'));var moment=require(_0x82e4('0x3'));var BPromise=require(_0x82e4('0x4'));var rp=require(_0x82e4('0x5'));var attributes=require(_0x82e4('0x6'));module[_0x82e4('0x7')]=function(_0x423455,_0x140611){return _0x423455['define'](_0x82e4('0x8'),attributes,{'tableName':_0x82e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8d7=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','bluebird','request-promise','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xc8d7,0x122));var _0x7c8d=function(_0x4a8825,_0x1a0dba){_0x4a8825=_0x4a8825-0x0;var _0x36a297=_0xc8d7[_0x4a8825];return _0x36a297;};'use strict';var _=require(_0x7c8d('0x0'));var util=require('util');var logger=require(_0x7c8d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7c8d('0x2'));var rp=require(_0x7c8d('0x3'));var attributes=require(_0x7c8d('0x4'));module[_0x7c8d('0x5')]=function(_0x166a93,_0x5e48ab){return _0x166a93[_0x7c8d('0x6')](_0x7c8d('0x7'),attributes,{'tableName':_0x7c8d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bfb6003..371e5ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6699=['SugarcrmConfiguration,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0x6699,0x168));var _0x9669=function(_0x5421eb,_0x426220){_0x5421eb=_0x5421eb-0x0;var _0x2a23e5=_0x6699[_0x5421eb];return _0x2a23e5;};'use strict';var _=require(_0x9669('0x0'));var util=require(_0x9669('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9669('0x2'));var fs=require('fs');var Redis=require(_0x9669('0x3'));var db=require(_0x9669('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9669('0x5'))(_0x9669('0x6'));var config=require(_0x9669('0x7'));var jayson=require(_0x9669('0x8'));var client=jayson[_0x9669('0x9')][_0x9669('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2886cb,_0xa1e729,_0x454461){return new BPromise(function(_0x199bc6,_0x20e224){return client['request'](_0x2886cb,_0x454461)[_0x9669('0xb')](function(_0x138fa5){logger[_0x9669('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xa1e729,'request\x20sent');logger[_0x9669('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xa1e729,_0x9669('0xe'),JSON[_0x9669('0xf')](_0x138fa5));if(_0x138fa5[_0x9669('0x10')]){if(_0x138fa5[_0x9669('0x10')][_0x9669('0x11')]===0x1f4){logger[_0x9669('0x10')](_0x9669('0x12'),_0xa1e729,_0x138fa5[_0x9669('0x10')][_0x9669('0x13')]);return _0x20e224(_0x138fa5[_0x9669('0x10')][_0x9669('0x13')]);}logger[_0x9669('0x10')](_0x9669('0x12'),_0xa1e729,_0x138fa5[_0x9669('0x10')][_0x9669('0x13')]);return _0x199bc6(_0x138fa5[_0x9669('0x10')][_0x9669('0x13')]);}else{logger[_0x9669('0xc')](_0x9669('0x12'),_0xa1e729,'request\x20sent');_0x199bc6(_0x138fa5['result'][_0x9669('0x13')]);}})[_0x9669('0x14')](function(_0x443389){logger[_0x9669('0x10')](_0x9669('0x12'),_0xa1e729,_0x443389);_0x20e224(_0x443389);});});}
\ No newline at end of file
+var _0xa8f6=['client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x32dca9,_0xb3f2ca){var _0x616072=function(_0x555158){while(--_0x555158){_0x32dca9['push'](_0x32dca9['shift']());}};_0x616072(++_0xb3f2ca);}(_0xa8f6,0xc9));var _0x6a8f=function(_0x589159,_0x43ee53){_0x589159=_0x589159-0x0;var _0x222f15=_0xa8f6[_0x589159];return _0x222f15;};'use strict';var _=require(_0x6a8f('0x0'));var util=require(_0x6a8f('0x1'));var moment=require(_0x6a8f('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a8f('0x4'))['db'];var utils=require(_0x6a8f('0x5'));var logger=require(_0x6a8f('0x6'))('rpc');var config=require(_0x6a8f('0x7'));var jayson=require(_0x6a8f('0x8'));var client=jayson[_0x6a8f('0x9')][_0x6a8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ed384,_0x4ebd3c,_0x3fd944){return new BPromise(function(_0x4a94f1,_0x25978d){return client['request'](_0x3ed384,_0x3fd944)['then'](function(_0x576e16){logger[_0x6a8f('0xb')](_0x6a8f('0xc'),_0x4ebd3c,_0x6a8f('0xd'));logger[_0x6a8f('0xe')](_0x6a8f('0xf'),_0x4ebd3c,_0x6a8f('0xd'),JSON[_0x6a8f('0x10')](_0x576e16));if(_0x576e16[_0x6a8f('0x11')]){if(_0x576e16[_0x6a8f('0x11')]['code']===0x1f4){logger[_0x6a8f('0x11')](_0x6a8f('0xc'),_0x4ebd3c,_0x576e16[_0x6a8f('0x11')][_0x6a8f('0x12')]);return _0x25978d(_0x576e16['error'][_0x6a8f('0x12')]);}logger[_0x6a8f('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4ebd3c,_0x576e16[_0x6a8f('0x11')][_0x6a8f('0x12')]);return _0x4a94f1(_0x576e16[_0x6a8f('0x11')][_0x6a8f('0x12')]);}else{logger[_0x6a8f('0xb')](_0x6a8f('0xc'),_0x4ebd3c,'request\x20sent');_0x4a94f1(_0x576e16[_0x6a8f('0x13')]['message']);}})[_0x6a8f('0x14')](function(_0x4e74c9){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4ebd3c,_0x4e74c9);_0x25978d(_0x4e74c9);});});}
\ No newline at end of file
index 8942b26..9497f7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf7=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update'];(function(_0x1873d3,_0x3fdc28){var _0x22554d=function(_0x2f8b03){while(--_0x2f8b03){_0x1873d3['push'](_0x1873d3['shift']());}};_0x22554d(++_0x3fdc28);}(_0xcaf7,0xa4));var _0x7caf=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xcaf7[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x7caf('0x0'));var util=require(_0x7caf('0x1'));var path=require(_0x7caf('0x2'));var timeout=require(_0x7caf('0x3'));var express=require(_0x7caf('0x4'));var router=express[_0x7caf('0x5')]();var auth=require(_0x7caf('0x6'));var interaction=require(_0x7caf('0x7'));var config=require(_0x7caf('0x8'));var controller=require('./intSugarcrmField.controller');router[_0x7caf('0x9')]('/',auth[_0x7caf('0xa')](),controller[_0x7caf('0xb')]);router[_0x7caf('0x9')](_0x7caf('0xc'),auth[_0x7caf('0xa')](),controller['show']);router[_0x7caf('0xd')]('/',auth['isAuthenticated'](),controller[_0x7caf('0xe')]);router['put'](_0x7caf('0xc'),auth[_0x7caf('0xa')](),controller[_0x7caf('0xf')]);router[_0x7caf('0x10')](_0x7caf('0xc'),auth[_0x7caf('0xa')](),controller[_0x7caf('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xfa89=['./intSugarcrmField.controller','index','get','/:id','show','post','create','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xfa89,0xc6));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9fa8('0x0'));var util=require(_0x9fa8('0x1'));var path=require(_0x9fa8('0x2'));var timeout=require(_0x9fa8('0x3'));var express=require(_0x9fa8('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9fa8('0x5'));var config=require('../../config/environment');var controller=require(_0x9fa8('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9fa8('0x7')]);router[_0x9fa8('0x8')](_0x9fa8('0x9'),auth['isAuthenticated'](),controller[_0x9fa8('0xa')]);router[_0x9fa8('0xb')]('/',auth['isAuthenticated'](),controller[_0x9fa8('0xc')]);router['put'](_0x9fa8('0x9'),auth[_0x9fa8('0xd')](),controller['update']);router[_0x9fa8('0xe')]('/:id',auth[_0x9fa8('0xd')](),controller[_0x9fa8('0xf')]);module[_0x9fa8('0x10')]=router;
\ No newline at end of file
index 1572db2..5121efd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['exports','ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x273f92,_0x5e6ea2){var _0x38b53c=function(_0x494d4e){while(--_0x494d4e){_0x273f92['push'](_0x273f92['shift']());}};_0x38b53c(++_0x5e6ea2);}(_0xac4a,0x13f));var _0xaac4=function(_0x20b9f1,_0x25711d){_0x20b9f1=_0x20b9f1-0x0;var _0x3b76e4=_0xac4a[_0x20b9f1];return _0x3b76e4;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'type':{'type':Sequelize[_0xaac4('0x2')](_0xaac4('0x3'),_0xaac4('0x4'),_0xaac4('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xaac4('0x6')]},'key':{'type':Sequelize[_0xaac4('0x6')]},'keyType':{'type':Sequelize[_0xaac4('0x2')]('string',_0xaac4('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xaac4('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaac4('0x6')]},'customField':{'type':Sequelize[_0xaac4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2dae=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x2cbc18,_0x4dee24){var _0x15877d=function(_0x3d86e2){while(--_0x3d86e2){_0x2cbc18['push'](_0x2cbc18['shift']());}};_0x15877d(++_0x4dee24);}(_0x2dae,0xc3));var _0xe2da=function(_0x493a51,_0x45128c){_0x493a51=_0x493a51-0x0;var _0xc85756=_0x2dae[_0x493a51];return _0xc85756;};'use strict';var Sequelize=require(_0xe2da('0x0'));module['exports']={'type':{'type':Sequelize[_0xe2da('0x1')](_0xe2da('0x2'),_0xe2da('0x3'),_0xe2da('0x4'),_0xe2da('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe2da('0x6')]},'key':{'type':Sequelize[_0xe2da('0x6')]},'keyType':{'type':Sequelize[_0xe2da('0x1')](_0xe2da('0x2'),'variable',_0xe2da('0x4'))},'keyContent':{'type':Sequelize[_0xe2da('0x6')]},'idField':{'type':Sequelize[_0xe2da('0x6')]},'nameField':{'type':Sequelize[_0xe2da('0x6')]},'customField':{'type':Sequelize[_0xe2da('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe2da('0x6')]}};
\ No newline at end of file
index be8b80b..955573b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14e4=['key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','SugarcrmField','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','add','day','merge','filter','where','map','type'];(function(_0xfc8cd8,_0x3073a7){var _0x55a1a1=function(_0x2291bb){while(--_0x2291bb){_0xfc8cd8['push'](_0xfc8cd8['shift']());}};_0x55a1a1(++_0x3073a7);}(_0x14e4,0x137));var _0x414e=function(_0x380457,_0x2ece0f){_0x380457=_0x380457-0x0;var _0x369601=_0x14e4[_0x380457];return _0x369601;};'use strict';var pdf=require(_0x414e('0x0'));var emlformat=require(_0x414e('0x1'));var rimraf=require(_0x414e('0x2'));var zipdir=require(_0x414e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x414e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x414e('0x5'));var util=require(_0x414e('0x6'));var path=require(_0x414e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x414e('0x8'));var fs=require('fs');var _=require(_0x414e('0x9'));var squel=require(_0x414e('0xa'));var crypto=require(_0x414e('0xb'));var jsforce=require(_0x414e('0xc'));var deskjs=require(_0x414e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x414e('0xe'));var Redis=require(_0x414e('0xf'));var qs=require(_0x414e('0x10'));var logger=require(_0x414e('0x11'))('api');var utils=require(_0x414e('0x12'));var config=require(_0x414e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c726c,_0x5b924c){_0x5b924c=_0x5b924c||0xcc;return function(_0x4aee16){if(_0x4aee16){return _0x2c726c['sendStatus'](_0x5b924c);}return _0x2c726c[_0x414e('0x14')](_0x5b924c)['end']();};}function respondWithResult(_0x1cdcaa,_0x1e533f){_0x1e533f=_0x1e533f||0xc8;return function(_0x38012a){if(_0x38012a){return _0x1cdcaa[_0x414e('0x14')](_0x1e533f)[_0x414e('0x15')](_0x38012a);}};}function respondWithFilteredResult(_0x1b3e51,_0x388951){return function(_0x39e39e){if(_0x39e39e){var _0x4bf357=_0x39e39e[_0x414e('0x16')],_0x2ab357=_0x388951[_0x414e('0x17')],_0x5058cd=_0x388951[_0x414e('0x17')]+_0x388951[_0x414e('0x18')],_0x338334;if(_0x5058cd>=_0x4bf357){_0x5058cd=_0x4bf357;_0x338334=0xc8;}else{_0x338334=0xce;}_0x1b3e51[_0x414e('0x14')](_0x338334);return _0x1b3e51[_0x414e('0x19')](_0x414e('0x1a'),_0x2ab357+'-'+_0x5058cd+'/'+_0x4bf357)[_0x414e('0x15')](_0x39e39e);}return null;};}function patchUpdates(_0x2f038d){return function(_0x552d2f){try{jsonpatch[_0x414e('0x1b')](_0x552d2f,_0x2f038d,!![]);}catch(_0x3e782a){return BPromise[_0x414e('0x1c')](_0x3e782a);}return _0x552d2f[_0x414e('0x1d')]();};}function saveUpdates(_0x973438,_0xc3495){return function(_0x223c9c){if(_0x223c9c){return _0x223c9c['update'](_0x973438)[_0x414e('0x1e')](function(_0xc65151){return _0xc65151;});}return null;};}function removeEntity(_0x3b4469,_0x476017){return function(_0x2e183d){if(_0x2e183d){return _0x2e183d[_0x414e('0x1f')]()[_0x414e('0x1e')](function(){_0x3b4469['status'](0xcc)[_0x414e('0x20')]();});}};}function handleEntityNotFound(_0x318f95,_0x28eb01){return function(_0x1841f1){if(!_0x1841f1){_0x318f95[_0x414e('0x21')](0x194);}return _0x1841f1;};}function handleError(_0x3cb7b1,_0x4d927d){_0x4d927d=_0x4d927d||0x1f4;return function(_0x48d17b){logger[_0x414e('0x22')](_0x48d17b[_0x414e('0x23')]);if(_0x48d17b[_0x414e('0x24')]){delete _0x48d17b['name'];}_0x3cb7b1[_0x414e('0x14')](_0x4d927d)['send'](_0x48d17b);};}exports['index']=function(_0x19d67a,_0x3e8498){var _0x270070={},_0x4a4c99={},_0x33c90a={'count':0x0,'rows':[]};var _0x224784=db[_0x414e('0x25')][_0x414e('0x26')];_0x4a4c99[_0x414e('0x27')]=_[_0x414e('0x28')](_0x224784);var _0x3ed5ca={'dateStart':_0x19d67a[_0x414e('0x29')][_0x414e('0x2a')],'dateEnd':_0x19d67a[_0x414e('0x29')][_0x414e('0x2b')]};delete _0x19d67a['query'][_0x414e('0x2a')];delete _0x19d67a[_0x414e('0x29')][_0x414e('0x2b')];_0x4a4c99[_0x414e('0x29')]=_[_0x414e('0x28')](_0x19d67a[_0x414e('0x29')]);_0x4a4c99[_0x414e('0x2c')]=_[_0x414e('0x2d')](_0x4a4c99[_0x414e('0x27')],_0x4a4c99[_0x414e('0x29')]);_0x270070[_0x414e('0x2e')]=_[_0x414e('0x2d')](_0x4a4c99[_0x414e('0x27')],qs['fields'](_0x19d67a[_0x414e('0x29')][_0x414e('0x2f')]));_0x270070[_0x414e('0x2e')]=_0x270070['attributes']['length']?_0x270070[_0x414e('0x2e')]:_0x4a4c99[_0x414e('0x27')];if(!_0x19d67a[_0x414e('0x29')][_0x414e('0x30')]('nolimit')){_0x270070[_0x414e('0x18')]=qs[_0x414e('0x18')](_0x19d67a['query']['limit']);_0x270070[_0x414e('0x17')]=qs[_0x414e('0x17')](_0x19d67a[_0x414e('0x29')]['offset']);}_0x270070[_0x414e('0x31')]=qs[_0x414e('0x32')](_0x19d67a[_0x414e('0x29')][_0x414e('0x32')]);_0x270070['where']=qs[_0x414e('0x2c')](_[_0x414e('0x33')](_0x19d67a['query'],_0x4a4c99[_0x414e('0x2c')]));if(_0x3ed5ca[_0x414e('0x2a')]){if(_0x3ed5ca['dateEnd']){_0x3ed5ca['dateEnd']=moment(_0x3ed5ca[_0x414e('0x2b')])[_0x414e('0x34')](0x1,_0x414e('0x35'));}else{_0x3ed5ca[_0x414e('0x2b')]=moment(_0x3ed5ca['dateStart'])[_0x414e('0x34')](0x1,_0x414e('0x35'));}_[_0x414e('0x36')](_0x270070['where'],{'createdAt':{'$gte':_0x3ed5ca[_0x414e('0x2a')],'$lte':_0x3ed5ca[_0x414e('0x2b')]}});}if(_0x19d67a['query'][_0x414e('0x37')]){_0x270070['where']=_[_0x414e('0x36')](_0x270070[_0x414e('0x38')],{'$or':_[_0x414e('0x39')](_0x224784,function(_0x5da6b8){if(_0x5da6b8[_0x414e('0x3a')][_0x414e('0x3b')]!==_0x414e('0x3c')){var _0x31aec3={};_0x31aec3[_0x5da6b8[_0x414e('0x3d')]]={'$like':'%'+_0x19d67a[_0x414e('0x29')][_0x414e('0x37')]+'%'};return _0x31aec3;}})});}_0x270070=_[_0x414e('0x36')]({},_0x270070,_0x19d67a[_0x414e('0x3e')]);var _0x506341={'where':_0x270070[_0x414e('0x38')]};return db[_0x414e('0x25')][_0x414e('0x16')](_0x506341)['then'](function(_0x1259ea){_0x33c90a['count']=_0x1259ea;if(_0x19d67a[_0x414e('0x29')][_0x414e('0x3f')]){_0x270070[_0x414e('0x40')]=[{'all':!![]}];}return db[_0x414e('0x25')][_0x414e('0x41')](_0x270070);})[_0x414e('0x1e')](function(_0x3b1c23){_0x33c90a[_0x414e('0x42')]=_0x3b1c23;return _0x33c90a;})[_0x414e('0x1e')](respondWithFilteredResult(_0x3e8498,_0x270070))[_0x414e('0x43')](handleError(_0x3e8498,null));};exports[_0x414e('0x44')]=function(_0x384c27,_0x51c884){var _0x539ada={'raw':!![],'where':{'id':_0x384c27[_0x414e('0x45')]['id']}},_0xd8e296={};_0xd8e296[_0x414e('0x27')]=_['keys'](db['SugarcrmField'][_0x414e('0x26')]);_0xd8e296[_0x414e('0x29')]=_[_0x414e('0x28')](_0x384c27[_0x414e('0x29')]);_0xd8e296[_0x414e('0x2c')]=_[_0x414e('0x2d')](_0xd8e296[_0x414e('0x27')],_0xd8e296[_0x414e('0x29')]);_0x539ada[_0x414e('0x2e')]=_['intersection'](_0xd8e296['model'],qs[_0x414e('0x2f')](_0x384c27[_0x414e('0x29')][_0x414e('0x2f')]));_0x539ada[_0x414e('0x2e')]=_0x539ada[_0x414e('0x2e')]['length']?_0x539ada[_0x414e('0x2e')]:_0xd8e296['model'];if(_0x384c27[_0x414e('0x29')][_0x414e('0x3f')]){_0x539ada[_0x414e('0x40')]=[{'all':!![]}];}_0x539ada=_[_0x414e('0x36')]({},_0x539ada,_0x384c27['options']);return db[_0x414e('0x25')]['find'](_0x539ada)[_0x414e('0x1e')](handleEntityNotFound(_0x51c884,null))['then'](respondWithResult(_0x51c884,null))[_0x414e('0x43')](handleError(_0x51c884,null));};exports['create']=function(_0x1223c8,_0x397bc7){return db[_0x414e('0x25')][_0x414e('0x46')](_0x1223c8[_0x414e('0x47')],{})[_0x414e('0x1e')](respondWithResult(_0x397bc7,0xc9))['catch'](handleError(_0x397bc7,null));};exports[_0x414e('0x48')]=function(_0x503084,_0x58e147){if(_0x503084[_0x414e('0x47')]['id']){delete _0x503084[_0x414e('0x47')]['id'];}return db[_0x414e('0x25')][_0x414e('0x49')]({'where':{'id':_0x503084[_0x414e('0x45')]['id']}})[_0x414e('0x1e')](handleEntityNotFound(_0x58e147,null))['then'](saveUpdates(_0x503084[_0x414e('0x47')],null))[_0x414e('0x1e')](respondWithResult(_0x58e147,null))[_0x414e('0x43')](handleError(_0x58e147,null));};exports[_0x414e('0x1f')]=function(_0x2cfc46,_0x4ad851){return db[_0x414e('0x25')][_0x414e('0x49')]({'where':{'id':_0x2cfc46[_0x414e('0x45')]['id']}})[_0x414e('0x1e')](handleEntityNotFound(_0x4ad851,null))['then'](removeEntity(_0x4ad851,null))[_0x414e('0x43')](handleError(_0x4ad851,null));};
\ No newline at end of file
+var _0x37d7=['send','index','SugarcrmField','model','keys','query','dateEnd','filters','intersection','attributes','fields','length','order','sort','where','pick','dateStart','add','merge','map','type','VIRTUAL','field','filter','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name'];(function(_0x2355d7,_0x3e37cf){var _0x34ec5e=function(_0x3ae5d8){while(--_0x3ae5d8){_0x2355d7['push'](_0x2355d7['shift']());}};_0x34ec5e(++_0x3e37cf);}(_0x37d7,0xb8));var _0x737d=function(_0x7033ad,_0x4f191a){_0x7033ad=_0x7033ad-0x0;var _0x4117fb=_0x37d7[_0x7033ad];return _0x4117fb;};'use strict';var pdf=require(_0x737d('0x0'));var emlformat=require(_0x737d('0x1'));var rimraf=require(_0x737d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x737d('0x3'));var rp=require('request-promise');var moment=require(_0x737d('0x4'));var BPromise=require(_0x737d('0x5'));var Mustache=require(_0x737d('0x6'));var util=require('util');var path=require(_0x737d('0x7'));var sox=require(_0x737d('0x8'));var csv=require('to-csv');var ejs=require(_0x737d('0x9'));var fs=require('fs');var _=require(_0x737d('0xa'));var squel=require(_0x737d('0xb'));var crypto=require(_0x737d('0xc'));var jsforce=require(_0x737d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x737d('0xe'));var Papa=require(_0x737d('0xf'));var Redis=require('ioredis');var qs=require(_0x737d('0x10'));var logger=require(_0x737d('0x11'))(_0x737d('0x12'));var utils=require('../../config/utils');var config=require(_0x737d('0x13'));var db=require(_0x737d('0x14'))['db'];function respondWithStatusCode(_0x124cc9,_0x427a63){_0x427a63=_0x427a63||0xcc;return function(_0xe34685){if(_0xe34685){return _0x124cc9['sendStatus'](_0x427a63);}return _0x124cc9[_0x737d('0x15')](_0x427a63)[_0x737d('0x16')]();};}function respondWithResult(_0x121ffa,_0x1cd26e){_0x1cd26e=_0x1cd26e||0xc8;return function(_0x275131){if(_0x275131){return _0x121ffa[_0x737d('0x15')](_0x1cd26e)[_0x737d('0x17')](_0x275131);}};}function respondWithFilteredResult(_0x26abc4,_0x2ee277){return function(_0x195461){if(_0x195461){var _0x9c582c=_0x195461[_0x737d('0x18')],_0x2853c7=_0x2ee277[_0x737d('0x19')],_0x431d1b=_0x2ee277[_0x737d('0x19')]+_0x2ee277[_0x737d('0x1a')],_0x99e17c;if(_0x431d1b>=_0x9c582c){_0x431d1b=_0x9c582c;_0x99e17c=0xc8;}else{_0x99e17c=0xce;}_0x26abc4[_0x737d('0x15')](_0x99e17c);return _0x26abc4[_0x737d('0x1b')](_0x737d('0x1c'),_0x2853c7+'-'+_0x431d1b+'/'+_0x9c582c)[_0x737d('0x17')](_0x195461);}return null;};}function patchUpdates(_0x576c60){return function(_0x18ee95){try{jsonpatch[_0x737d('0x1d')](_0x18ee95,_0x576c60,!![]);}catch(_0x121aa8){return BPromise[_0x737d('0x1e')](_0x121aa8);}return _0x18ee95[_0x737d('0x1f')]();};}function saveUpdates(_0x3fd9bc,_0x38c1c7){return function(_0xa626c){if(_0xa626c){return _0xa626c[_0x737d('0x20')](_0x3fd9bc)[_0x737d('0x21')](function(_0x539c1d){return _0x539c1d;});}return null;};}function removeEntity(_0x20f986,_0x1e9cfa){return function(_0xab8f68){if(_0xab8f68){return _0xab8f68['destroy']()[_0x737d('0x21')](function(){_0x20f986[_0x737d('0x15')](0xcc)[_0x737d('0x16')]();});}};}function handleEntityNotFound(_0x369364,_0x1b6d92){return function(_0x19583a){if(!_0x19583a){_0x369364[_0x737d('0x22')](0x194);}return _0x19583a;};}function handleError(_0x1c315b,_0x1060ae){_0x1060ae=_0x1060ae||0x1f4;return function(_0x1d6ced){logger[_0x737d('0x23')](_0x1d6ced[_0x737d('0x24')]);if(_0x1d6ced[_0x737d('0x25')]){delete _0x1d6ced[_0x737d('0x25')];}_0x1c315b['status'](_0x1060ae)[_0x737d('0x26')](_0x1d6ced);};}exports[_0x737d('0x27')]=function(_0x4484c9,_0x26578b){var _0x128f53={},_0x1f3aef={},_0x52a679={'count':0x0,'rows':[]};var _0xb602cb=db[_0x737d('0x28')]['rawAttributes'];_0x1f3aef[_0x737d('0x29')]=_[_0x737d('0x2a')](_0xb602cb);var _0x6069fe={'dateStart':_0x4484c9[_0x737d('0x2b')]['dateStart'],'dateEnd':_0x4484c9[_0x737d('0x2b')][_0x737d('0x2c')]};delete _0x4484c9[_0x737d('0x2b')]['dateStart'];delete _0x4484c9[_0x737d('0x2b')][_0x737d('0x2c')];_0x1f3aef[_0x737d('0x2b')]=_['keys'](_0x4484c9['query']);_0x1f3aef[_0x737d('0x2d')]=_[_0x737d('0x2e')](_0x1f3aef['model'],_0x1f3aef[_0x737d('0x2b')]);_0x128f53[_0x737d('0x2f')]=_[_0x737d('0x2e')](_0x1f3aef[_0x737d('0x29')],qs['fields'](_0x4484c9[_0x737d('0x2b')][_0x737d('0x30')]));_0x128f53[_0x737d('0x2f')]=_0x128f53[_0x737d('0x2f')][_0x737d('0x31')]?_0x128f53[_0x737d('0x2f')]:_0x1f3aef[_0x737d('0x29')];if(!_0x4484c9[_0x737d('0x2b')]['hasOwnProperty']('nolimit')){_0x128f53[_0x737d('0x1a')]=qs[_0x737d('0x1a')](_0x4484c9[_0x737d('0x2b')][_0x737d('0x1a')]);_0x128f53[_0x737d('0x19')]=qs[_0x737d('0x19')](_0x4484c9[_0x737d('0x2b')][_0x737d('0x19')]);}_0x128f53[_0x737d('0x32')]=qs[_0x737d('0x33')](_0x4484c9[_0x737d('0x2b')][_0x737d('0x33')]);_0x128f53[_0x737d('0x34')]=qs['filters'](_[_0x737d('0x35')](_0x4484c9[_0x737d('0x2b')],_0x1f3aef[_0x737d('0x2d')]));if(_0x6069fe[_0x737d('0x36')]){if(_0x6069fe[_0x737d('0x2c')]){_0x6069fe['dateEnd']=moment(_0x6069fe[_0x737d('0x2c')])['add'](0x1,'day');}else{_0x6069fe[_0x737d('0x2c')]=moment(_0x6069fe[_0x737d('0x36')])[_0x737d('0x37')](0x1,'day');}_[_0x737d('0x38')](_0x128f53[_0x737d('0x34')],{'createdAt':{'$gte':_0x6069fe[_0x737d('0x36')],'$lte':_0x6069fe['dateEnd']}});}if(_0x4484c9[_0x737d('0x2b')]['filter']){_0x128f53[_0x737d('0x34')]=_[_0x737d('0x38')](_0x128f53[_0x737d('0x34')],{'$or':_[_0x737d('0x39')](_0xb602cb,function(_0x3c6640){if(_0x3c6640[_0x737d('0x3a')]['key']!==_0x737d('0x3b')){var _0x177504={};_0x177504[_0x3c6640[_0x737d('0x3c')]]={'$like':'%'+_0x4484c9[_0x737d('0x2b')][_0x737d('0x3d')]+'%'};return _0x177504;}})});}_0x128f53=_[_0x737d('0x38')]({},_0x128f53,_0x4484c9[_0x737d('0x3e')]);var _0x3e16db={'where':_0x128f53[_0x737d('0x34')]};return db[_0x737d('0x28')][_0x737d('0x18')](_0x3e16db)['then'](function(_0x24e811){_0x52a679[_0x737d('0x18')]=_0x24e811;if(_0x4484c9[_0x737d('0x2b')][_0x737d('0x3f')]){_0x128f53[_0x737d('0x40')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x128f53);})['then'](function(_0x51a8ae){_0x52a679[_0x737d('0x41')]=_0x51a8ae;return _0x52a679;})[_0x737d('0x21')](respondWithFilteredResult(_0x26578b,_0x128f53))['catch'](handleError(_0x26578b,null));};exports[_0x737d('0x42')]=function(_0x8210fe,_0x1fc626){var _0x53accd={'raw':!![],'where':{'id':_0x8210fe[_0x737d('0x43')]['id']}},_0x4a5fd2={};_0x4a5fd2[_0x737d('0x29')]=_[_0x737d('0x2a')](db[_0x737d('0x28')][_0x737d('0x44')]);_0x4a5fd2[_0x737d('0x2b')]=_['keys'](_0x8210fe[_0x737d('0x2b')]);_0x4a5fd2[_0x737d('0x2d')]=_['intersection'](_0x4a5fd2[_0x737d('0x29')],_0x4a5fd2[_0x737d('0x2b')]);_0x53accd['attributes']=_[_0x737d('0x2e')](_0x4a5fd2[_0x737d('0x29')],qs[_0x737d('0x30')](_0x8210fe[_0x737d('0x2b')][_0x737d('0x30')]));_0x53accd[_0x737d('0x2f')]=_0x53accd[_0x737d('0x2f')][_0x737d('0x31')]?_0x53accd[_0x737d('0x2f')]:_0x4a5fd2['model'];if(_0x8210fe['query']['includeAll']){_0x53accd[_0x737d('0x40')]=[{'all':!![]}];}_0x53accd=_[_0x737d('0x38')]({},_0x53accd,_0x8210fe[_0x737d('0x3e')]);return db[_0x737d('0x28')][_0x737d('0x45')](_0x53accd)['then'](handleEntityNotFound(_0x1fc626,null))['then'](respondWithResult(_0x1fc626,null))[_0x737d('0x46')](handleError(_0x1fc626,null));};exports[_0x737d('0x47')]=function(_0x32d21d,_0x2d8237){return db[_0x737d('0x28')]['create'](_0x32d21d[_0x737d('0x48')],{})['then'](respondWithResult(_0x2d8237,0xc9))[_0x737d('0x46')](handleError(_0x2d8237,null));};exports[_0x737d('0x20')]=function(_0x2bb224,_0x3675ce){if(_0x2bb224['body']['id']){delete _0x2bb224[_0x737d('0x48')]['id'];}return db[_0x737d('0x28')][_0x737d('0x45')]({'where':{'id':_0x2bb224[_0x737d('0x43')]['id']}})[_0x737d('0x21')](handleEntityNotFound(_0x3675ce,null))[_0x737d('0x21')](saveUpdates(_0x2bb224[_0x737d('0x48')],null))['then'](respondWithResult(_0x3675ce,null))[_0x737d('0x46')](handleError(_0x3675ce,null));};exports[_0x737d('0x49')]=function(_0x319075,_0x30be89){return db['SugarcrmField'][_0x737d('0x45')]({'where':{'id':_0x319075['params']['id']}})[_0x737d('0x21')](handleEntityNotFound(_0x30be89,null))[_0x737d('0x21')](removeEntity(_0x30be89,null))['catch'](handleError(_0x30be89,null));};
\ No newline at end of file
index 8bd97dc..06b3660 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabe6=['SugarcrmField','int_sugarcrm_fields','util','../../config/logger','moment','bluebird','request-promise','./intSugarcrmField.attributes','exports'];(function(_0x310f1b,_0x48e137){var _0x2cc81c=function(_0x5bde88){while(--_0x5bde88){_0x310f1b['push'](_0x310f1b['shift']());}};_0x2cc81c(++_0x48e137);}(_0xabe6,0x173));var _0x6abe=function(_0x25e839,_0xd7f934){_0x25e839=_0x25e839-0x0;var _0x2cf882=_0xabe6[_0x25e839];return _0x2cf882;};'use strict';var _=require('lodash');var util=require(_0x6abe('0x0'));var logger=require(_0x6abe('0x1'))('api');var moment=require(_0x6abe('0x2'));var BPromise=require(_0x6abe('0x3'));var rp=require(_0x6abe('0x4'));var attributes=require(_0x6abe('0x5'));module[_0x6abe('0x6')]=function(_0x5db9d0,_0x2fd00d){return _0x5db9d0['define'](_0x6abe('0x7'),attributes,{'tableName':_0x6abe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c17=['exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0x1c17,0x1b3));var _0x71c1=function(_0x57a439,_0x5a9fa8){_0x57a439=_0x57a439-0x0;var _0x8b98cb=_0x1c17[_0x57a439];return _0x8b98cb;};'use strict';var _=require(_0x71c1('0x0'));var util=require(_0x71c1('0x1'));var logger=require(_0x71c1('0x2'))(_0x71c1('0x3'));var moment=require(_0x71c1('0x4'));var BPromise=require(_0x71c1('0x5'));var rp=require(_0x71c1('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x71c1('0x7')]=function(_0x36dc3d,_0x12326e){return _0x36dc3d[_0x71c1('0x8')](_0x71c1('0x9'),attributes,{'tableName':_0x71c1('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x71c1('0xb'),_0x71c1('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 2b3c8dd..9920903 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf21=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59a588,_0x4841f4){var _0x5bd3a0=function(_0x45df10){while(--_0x45df10){_0x59a588['push'](_0x59a588['shift']());}};_0x5bd3a0(++_0x4841f4);}(_0xbf21,0x19d));var _0x1bf2=function(_0x505384,_0x555b97){_0x505384=_0x505384-0x0;var _0x5b8e09=_0xbf21[_0x505384];return _0x5b8e09;};'use strict';var _=require(_0x1bf2('0x0'));var util=require(_0x1bf2('0x1'));var moment=require(_0x1bf2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bf2('0x3'));var db=require(_0x1bf2('0x4'))['db'];var utils=require(_0x1bf2('0x5'));var logger=require(_0x1bf2('0x6'))('rpc');var config=require(_0x1bf2('0x7'));var jayson=require(_0x1bf2('0x8'));var client=jayson[_0x1bf2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375ad5,_0x3ab36d,_0x425729){return new BPromise(function(_0x3835e8,_0x55d068){return client[_0x1bf2('0xa')](_0x375ad5,_0x425729)[_0x1bf2('0xb')](function(_0x4d69c5){logger[_0x1bf2('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3ab36d,_0x1bf2('0xd'));logger[_0x1bf2('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3ab36d,_0x1bf2('0xd'),JSON[_0x1bf2('0xf')](_0x4d69c5));if(_0x4d69c5['error']){if(_0x4d69c5[_0x1bf2('0x10')]['code']===0x1f4){logger[_0x1bf2('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x3ab36d,_0x4d69c5[_0x1bf2('0x10')][_0x1bf2('0x11')]);return _0x55d068(_0x4d69c5[_0x1bf2('0x10')][_0x1bf2('0x11')]);}logger['error'](_0x1bf2('0x12'),_0x3ab36d,_0x4d69c5['error'][_0x1bf2('0x11')]);return _0x3835e8(_0x4d69c5[_0x1bf2('0x10')]['message']);}else{logger[_0x1bf2('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3ab36d,_0x1bf2('0xd'));_0x3835e8(_0x4d69c5[_0x1bf2('0x13')][_0x1bf2('0x11')]);}})[_0x1bf2('0x14')](function(_0x5123c1){logger[_0x1bf2('0x10')](_0x1bf2('0x12'),_0x3ab36d,_0x5123c1);_0x55d068(_0x5123c1);});});}
\ No newline at end of file
+var _0x3d0d=['debug','request\x20sent','stringify','error','SugarcrmField,\x20%s,\x20%s','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x176e85,_0x37fec8){var _0x5ae8ac=function(_0x163a99){while(--_0x163a99){_0x176e85['push'](_0x176e85['shift']());}};_0x5ae8ac(++_0x37fec8);}(_0x3d0d,0x1ab));var _0xd3d0=function(_0x210408,_0x23fb48){_0x210408=_0x210408-0x0;var _0x37dc40=_0x3d0d[_0x210408];return _0x37dc40;};'use strict';var _=require('lodash');var util=require(_0xd3d0('0x0'));var moment=require(_0xd3d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3d0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3d0('0x3'))['db'];var utils=require(_0xd3d0('0x4'));var logger=require(_0xd3d0('0x5'))(_0xd3d0('0x6'));var config=require(_0xd3d0('0x7'));var jayson=require(_0xd3d0('0x8'));var client=jayson[_0xd3d0('0x9')][_0xd3d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b819,_0x48ef9a,_0x53477c){return new BPromise(function(_0x4146a5,_0x24d7da){return client[_0xd3d0('0xb')](_0x36b819,_0x53477c)[_0xd3d0('0xc')](function(_0x3c4523){logger[_0xd3d0('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x48ef9a,'request\x20sent');logger[_0xd3d0('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x48ef9a,_0xd3d0('0xf'),JSON[_0xd3d0('0x10')](_0x3c4523));if(_0x3c4523[_0xd3d0('0x11')]){if(_0x3c4523['error']['code']===0x1f4){logger['error'](_0xd3d0('0x12'),_0x48ef9a,_0x3c4523[_0xd3d0('0x11')][_0xd3d0('0x13')]);return _0x24d7da(_0x3c4523[_0xd3d0('0x11')][_0xd3d0('0x13')]);}logger[_0xd3d0('0x11')](_0xd3d0('0x12'),_0x48ef9a,_0x3c4523['error'][_0xd3d0('0x13')]);return _0x4146a5(_0x3c4523[_0xd3d0('0x11')][_0xd3d0('0x13')]);}else{logger['info'](_0xd3d0('0x12'),_0x48ef9a,_0xd3d0('0xf'));_0x4146a5(_0x3c4523[_0xd3d0('0x14')][_0xd3d0('0x13')]);}})['catch'](function(_0x57da54){logger[_0xd3d0('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x48ef9a,_0x57da54);_0x24d7da(_0x57da54);});});}
\ No newline at end of file
index c7f698a..03aaa78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x485f=['/:id','show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../config/environment','get','isAuthenticated','index'];(function(_0x118c28,_0x348904){var _0x4afea9=function(_0x1ff3a3){while(--_0x1ff3a3){_0x118c28['push'](_0x118c28['shift']());}};_0x4afea9(++_0x348904);}(_0x485f,0x188));var _0xf485=function(_0x33d286,_0x1d83b7){_0x33d286=_0x33d286-0x0;var _0xd4859a=_0x485f[_0x33d286];return _0xd4859a;};'use strict';var multer=require(_0xf485('0x0'));var util=require(_0xf485('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf485('0x2'));var router=express[_0xf485('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf485('0x4'));var controller=require('./intVtigerAccount.controller');router[_0xf485('0x5')]('/',auth[_0xf485('0x6')](),controller[_0xf485('0x7')]);router[_0xf485('0x5')](_0xf485('0x8'),auth['isAuthenticated'](),controller[_0xf485('0x9')]);router[_0xf485('0x5')](_0xf485('0xa'),auth['isAuthenticated'](),controller[_0xf485('0xb')]);router[_0xf485('0x5')]('/:id/fields',auth[_0xf485('0x6')](),controller[_0xf485('0xc')]);router[_0xf485('0xd')]('/',auth[_0xf485('0x6')](),controller[_0xf485('0xe')]);router['post'](_0xf485('0xa'),auth[_0xf485('0x6')](),controller['addConfiguration']);router[_0xf485('0xf')](_0xf485('0x8'),auth[_0xf485('0x6')](),controller[_0xf485('0x10')]);router[_0xf485('0x11')](_0xf485('0x8'),auth[_0xf485('0x6')](),controller[_0xf485('0x12')]);module[_0xf485('0x13')]=router;
\ No newline at end of file
+var _0x36f6=['getFields','create','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields'];(function(_0x25efef,_0x53ae70){var _0x4b60d0=function(_0x3151d4){while(--_0x3151d4){_0x25efef['push'](_0x25efef['shift']());}};_0x4b60d0(++_0x53ae70);}(_0x36f6,0xa1));var _0x636f=function(_0xf58718,_0x33541a){_0xf58718=_0xf58718-0x0;var _0x5aea10=_0x36f6[_0xf58718];return _0x5aea10;};'use strict';var multer=require(_0x636f('0x0'));var util=require(_0x636f('0x1'));var path=require(_0x636f('0x2'));var timeout=require(_0x636f('0x3'));var express=require('express');var router=express[_0x636f('0x4')]();var auth=require(_0x636f('0x5'));var interaction=require(_0x636f('0x6'));var config=require(_0x636f('0x7'));var controller=require(_0x636f('0x8'));router[_0x636f('0x9')]('/',auth[_0x636f('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x636f('0xb')]);router[_0x636f('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x636f('0xc')]);router['get'](_0x636f('0xd'),auth[_0x636f('0xa')](),controller[_0x636f('0xe')]);router['post']('/',auth[_0x636f('0xa')](),controller[_0x636f('0xf')]);router[_0x636f('0x10')](_0x636f('0x11'),auth[_0x636f('0xa')](),controller[_0x636f('0x12')]);router[_0x636f('0x13')](_0x636f('0x14'),auth[_0x636f('0xa')](),controller[_0x636f('0x15')]);router[_0x636f('0x16')](_0x636f('0x14'),auth['isAuthenticated'](),controller[_0x636f('0x17')]);module[_0x636f('0x18')]=router;
\ No newline at end of file
index e61e201..5868f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x079b=['exports','STRING','sequelize'];(function(_0x584d66,_0x325223){var _0x4588f2=function(_0x5dd9e1){while(--_0x5dd9e1){_0x584d66['push'](_0x584d66['shift']());}};_0x4588f2(++_0x325223);}(_0x079b,0xef));var _0xb079=function(_0x4c587a,_0x3bf54a){_0x4c587a=_0x4c587a-0x0;var _0x3e66fc=_0x079b[_0x4c587a];return _0x3e66fc;};'use strict';var Sequelize=require(_0xb079('0x0'));module[_0xb079('0x1')]={'name':{'type':Sequelize[_0xb079('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb079('0x2')]},'username':{'type':Sequelize[_0xb079('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xb079('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0xb079('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xd0ed=['HelpDesk','sequelize','exports','STRING'];(function(_0x4b3053,_0x1a2803){var _0x3b3bfa=function(_0x17c168){while(--_0x17c168){_0x4b3053['push'](_0x4b3053['shift']());}};_0x3b3bfa(++_0x1a2803);}(_0xd0ed,0x109));var _0xdd0e=function(_0x48a6f3,_0xecaada){_0x48a6f3=_0x48a6f3-0x0;var _0x4a236e=_0xd0ed[_0x48a6f3];return _0x4a236e;};'use strict';var Sequelize=require(_0xdd0e('0x0'));module[_0xdd0e('0x1')]={'name':{'type':Sequelize[_0xdd0e('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdd0e('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdd0e('0x3')},'remoteUri':{'type':Sequelize[_0xdd0e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xdd0e('0x2')]},'accessKey':{'type':Sequelize[_0xdd0e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 327e3b5..35c3ae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ddf=['includes','remove','editable','false','map','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','VtigerAccount','rawAttributes','keys','query','dateStart','dateEnd','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','day','merge','where','type','key','VIRTUAL','filter','options','includeAll','include','rows','show','find','create','body','params','getConfigurations','findOne','VtigerConfiguration','pick','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','description','moduleName','remoteUri','serverUrl','accessKey','username','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','reference'];(function(_0x1843b3,_0x10995a){var _0x3c7de0=function(_0xe28643){while(--_0xe28643){_0x1843b3['push'](_0x1843b3['shift']());}};_0x3c7de0(++_0x10995a);}(_0x7ddf,0x94));var _0xf7dd=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x7ddf[_0x1eda20];return _0x31b953;};'use strict';var pdf=require(_0xf7dd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf7dd('0x1'));var zipdir=require(_0xf7dd('0x2'));var jsonpatch=require(_0xf7dd('0x3'));var rp=require(_0xf7dd('0x4'));var moment=require(_0xf7dd('0x5'));var BPromise=require(_0xf7dd('0x6'));var Mustache=require('mustache');var util=require(_0xf7dd('0x7'));var path=require(_0xf7dd('0x8'));var sox=require(_0xf7dd('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf7dd('0xa'));var crypto=require('crypto');var jsforce=require(_0xf7dd('0xb'));var deskjs=require(_0xf7dd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf7dd('0xd'));var Papa=require(_0xf7dd('0xe'));var Redis=require(_0xf7dd('0xf'));var qs=require(_0xf7dd('0x10'));var logger=require('../../config/logger')(_0xf7dd('0x11'));var utils=require(_0xf7dd('0x12'));var config=require(_0xf7dd('0x13'));var db=require(_0xf7dd('0x14'))['db'];var integrations=require(_0xf7dd('0x15'));var jayson=require(_0xf7dd('0x16'));var client=jayson[_0xf7dd('0x17')][_0xf7dd('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x234d95,_0x1a12d1,_0x35e2f9,_0x54aa79){return new BPromise(function(_0x25bbc3,_0x283cb2){var _0x32e204=_0x54aa79||client;return _0x32e204[_0xf7dd('0x19')](_0x234d95,_0x35e2f9)[_0xf7dd('0x1a')](function(_0x1c6df2){logger['info'](_0xf7dd('0x1b'),_0x1a12d1,'request\x20sent');logger[_0xf7dd('0x1c')](_0xf7dd('0x1d'),_0x1a12d1,'request\x20sent',JSON[_0xf7dd('0x1e')](_0x1c6df2));if(_0x1c6df2[_0xf7dd('0x1f')]){if(_0x1c6df2[_0xf7dd('0x1f')]['code']===0x1f4){logger[_0xf7dd('0x1f')](_0xf7dd('0x1b'),_0x1a12d1,_0x1c6df2[_0xf7dd('0x1f')][_0xf7dd('0x20')]);return _0x283cb2(_0x1c6df2[_0xf7dd('0x1f')][_0xf7dd('0x20')]);}logger[_0xf7dd('0x1f')](_0xf7dd('0x1b'),_0x1a12d1,_0x1c6df2[_0xf7dd('0x1f')][_0xf7dd('0x20')]);return _0x25bbc3(_0x1c6df2[_0xf7dd('0x1f')][_0xf7dd('0x20')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x1a12d1,_0xf7dd('0x21'));_0x25bbc3(_0x1c6df2[_0xf7dd('0x22')][_0xf7dd('0x20')]);}})[_0xf7dd('0x23')](function(_0x1ff999){logger[_0xf7dd('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x1a12d1,_0x1ff999);_0x283cb2(_0x1ff999);});});}function respondWithStatusCode(_0x156d38,_0x43d4fd){_0x43d4fd=_0x43d4fd||0xcc;return function(_0x3fe822){if(_0x3fe822){return _0x156d38[_0xf7dd('0x24')](_0x43d4fd);}return _0x156d38[_0xf7dd('0x25')](_0x43d4fd)[_0xf7dd('0x26')]();};}function respondWithResult(_0xa4ea5,_0x5999de){_0x5999de=_0x5999de||0xc8;return function(_0x22f8f6){if(_0x22f8f6){return _0xa4ea5[_0xf7dd('0x25')](_0x5999de)[_0xf7dd('0x27')](_0x22f8f6);}};}function respondWithFilteredResult(_0x1da5fd,_0x36b6c2){return function(_0x5284ff){if(_0x5284ff){var _0x5c00aa=_0x5284ff[_0xf7dd('0x28')],_0x23f9f3=_0x36b6c2[_0xf7dd('0x29')],_0x187925=_0x36b6c2[_0xf7dd('0x29')]+_0x36b6c2[_0xf7dd('0x2a')],_0x40f346;if(_0x187925>=_0x5c00aa){_0x187925=_0x5c00aa;_0x40f346=0xc8;}else{_0x40f346=0xce;}_0x1da5fd[_0xf7dd('0x25')](_0x40f346);return _0x1da5fd[_0xf7dd('0x2b')](_0xf7dd('0x2c'),_0x23f9f3+'-'+_0x187925+'/'+_0x5c00aa)[_0xf7dd('0x27')](_0x5284ff);}return null;};}function patchUpdates(_0x16d822){return function(_0x162168){try{jsonpatch[_0xf7dd('0x2d')](_0x162168,_0x16d822,!![]);}catch(_0x2bcb43){return BPromise['reject'](_0x2bcb43);}return _0x162168[_0xf7dd('0x2e')]();};}function saveUpdates(_0xd4c9cd,_0xf05634){return function(_0x15bd8b){if(_0x15bd8b){return _0x15bd8b[_0xf7dd('0x2f')](_0xd4c9cd)['then'](function(_0x208701){return _0x208701;});}return null;};}function removeEntity(_0x40c914,_0x17d2cd){return function(_0x551e25){if(_0x551e25){return _0x551e25[_0xf7dd('0x30')]()[_0xf7dd('0x1a')](function(){_0x40c914['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2bc3,_0x112396){return function(_0x2f3f6b){if(!_0x2f3f6b){_0x5c2bc3[_0xf7dd('0x24')](0x194);}return _0x2f3f6b;};}function handleError(_0x55d16e,_0x2ba99f){_0x2ba99f=_0x2ba99f||0x1f4;return function(_0x19b59d){logger[_0xf7dd('0x1f')](_0x19b59d[_0xf7dd('0x31')]);if(_0x19b59d[_0xf7dd('0x32')]){delete _0x19b59d[_0xf7dd('0x32')];}_0x55d16e[_0xf7dd('0x25')](_0x2ba99f)[_0xf7dd('0x33')](_0x19b59d);};}exports[_0xf7dd('0x34')]=function(_0x3e9648,_0x37fc04){var _0x59036a={},_0x3677cc={},_0x3eadc5={'count':0x0,'rows':[]};var _0x379b21=db[_0xf7dd('0x35')][_0xf7dd('0x36')];_0x3677cc['model']=_[_0xf7dd('0x37')](_0x379b21);var _0x1fc782={'dateStart':_0x3e9648[_0xf7dd('0x38')][_0xf7dd('0x39')],'dateEnd':_0x3e9648['query']['dateEnd']};delete _0x3e9648[_0xf7dd('0x38')]['dateStart'];delete _0x3e9648[_0xf7dd('0x38')][_0xf7dd('0x3a')];_0x3677cc['query']=_[_0xf7dd('0x37')](_0x3e9648[_0xf7dd('0x38')]);_0x3677cc['filters']=_[_0xf7dd('0x3b')](_0x3677cc[_0xf7dd('0x3c')],_0x3677cc[_0xf7dd('0x38')]);_0x59036a[_0xf7dd('0x3d')]=_['intersection'](_0x3677cc[_0xf7dd('0x3c')],qs['fields'](_0x3e9648[_0xf7dd('0x38')][_0xf7dd('0x3e')]));_0x59036a['attributes']=_0x59036a[_0xf7dd('0x3d')][_0xf7dd('0x3f')]?_0x59036a[_0xf7dd('0x3d')]:_0x3677cc['model'];if(!_0x3e9648[_0xf7dd('0x38')][_0xf7dd('0x40')](_0xf7dd('0x41'))){_0x59036a[_0xf7dd('0x2a')]=qs[_0xf7dd('0x2a')](_0x3e9648[_0xf7dd('0x38')]['limit']);_0x59036a[_0xf7dd('0x29')]=qs[_0xf7dd('0x29')](_0x3e9648[_0xf7dd('0x38')][_0xf7dd('0x29')]);}_0x59036a[_0xf7dd('0x42')]=qs[_0xf7dd('0x43')](_0x3e9648[_0xf7dd('0x38')]['sort']);_0x59036a['where']=qs[_0xf7dd('0x44')](_['pick'](_0x3e9648[_0xf7dd('0x38')],_0x3677cc[_0xf7dd('0x44')]));if(_0x1fc782[_0xf7dd('0x39')]){if(_0x1fc782['dateEnd']){_0x1fc782[_0xf7dd('0x3a')]=moment(_0x1fc782[_0xf7dd('0x3a')])['add'](0x1,_0xf7dd('0x45'));}else{_0x1fc782['dateEnd']=moment(_0x1fc782[_0xf7dd('0x39')])['add'](0x1,_0xf7dd('0x45'));}_[_0xf7dd('0x46')](_0x59036a[_0xf7dd('0x47')],{'createdAt':{'$gte':_0x1fc782[_0xf7dd('0x39')],'$lte':_0x1fc782[_0xf7dd('0x3a')]}});}if(_0x3e9648['query']['filter']){_0x59036a[_0xf7dd('0x47')]=_[_0xf7dd('0x46')](_0x59036a[_0xf7dd('0x47')],{'$or':_['map'](_0x379b21,function(_0x54fb55){if(_0x54fb55[_0xf7dd('0x48')][_0xf7dd('0x49')]!==_0xf7dd('0x4a')){var _0x33fe3c={};_0x33fe3c[_0x54fb55['field']]={'$like':'%'+_0x3e9648[_0xf7dd('0x38')][_0xf7dd('0x4b')]+'%'};return _0x33fe3c;}})});}_0x59036a=_['merge']({},_0x59036a,_0x3e9648[_0xf7dd('0x4c')]);var _0x1db659={'where':_0x59036a['where']};return db[_0xf7dd('0x35')][_0xf7dd('0x28')](_0x1db659)[_0xf7dd('0x1a')](function(_0x50bc5f){_0x3eadc5[_0xf7dd('0x28')]=_0x50bc5f;if(_0x3e9648['query'][_0xf7dd('0x4d')]){_0x59036a[_0xf7dd('0x4e')]=[{'all':!![]}];}return db[_0xf7dd('0x35')]['findAll'](_0x59036a);})[_0xf7dd('0x1a')](function(_0x36e761){_0x3eadc5[_0xf7dd('0x4f')]=_0x36e761;return _0x3eadc5;})[_0xf7dd('0x1a')](respondWithFilteredResult(_0x37fc04,_0x59036a))[_0xf7dd('0x23')](handleError(_0x37fc04,null));};exports[_0xf7dd('0x50')]=function(_0x452db7,_0x2d89ab){var _0x34204a={'raw':![],'where':{'id':_0x452db7['params']['id']}},_0x256a1a={};_0x256a1a[_0xf7dd('0x3c')]=_[_0xf7dd('0x37')](db[_0xf7dd('0x35')][_0xf7dd('0x36')]);_0x256a1a[_0xf7dd('0x38')]=_[_0xf7dd('0x37')](_0x452db7[_0xf7dd('0x38')]);_0x256a1a['filters']=_[_0xf7dd('0x3b')](_0x256a1a[_0xf7dd('0x3c')],_0x256a1a[_0xf7dd('0x38')]);_0x34204a[_0xf7dd('0x3d')]=_[_0xf7dd('0x3b')](_0x256a1a[_0xf7dd('0x3c')],qs[_0xf7dd('0x3e')](_0x452db7[_0xf7dd('0x38')][_0xf7dd('0x3e')]));_0x34204a[_0xf7dd('0x3d')]=_0x34204a['attributes']['length']?_0x34204a['attributes']:_0x256a1a[_0xf7dd('0x3c')];if(_0x452db7[_0xf7dd('0x38')][_0xf7dd('0x4d')]){_0x34204a[_0xf7dd('0x4e')]=[{'all':!![]}];}_0x34204a=_[_0xf7dd('0x46')]({},_0x34204a,_0x452db7[_0xf7dd('0x4c')]);return db[_0xf7dd('0x35')][_0xf7dd('0x51')](_0x34204a)[_0xf7dd('0x1a')](handleEntityNotFound(_0x2d89ab,null))['then'](respondWithResult(_0x2d89ab,null))[_0xf7dd('0x23')](handleError(_0x2d89ab,null));};exports[_0xf7dd('0x52')]=function(_0x174754,_0x5d41c1){return db[_0xf7dd('0x35')][_0xf7dd('0x52')](_0x174754[_0xf7dd('0x53')],{})[_0xf7dd('0x1a')](respondWithResult(_0x5d41c1,0xc9))[_0xf7dd('0x23')](handleError(_0x5d41c1,null));};exports[_0xf7dd('0x2f')]=function(_0x5de230,_0x5577bb){if(_0x5de230['body']['id']){delete _0x5de230[_0xf7dd('0x53')]['id'];}return db[_0xf7dd('0x35')][_0xf7dd('0x51')]({'where':{'id':_0x5de230[_0xf7dd('0x54')]['id']}})[_0xf7dd('0x1a')](handleEntityNotFound(_0x5577bb,null))[_0xf7dd('0x1a')](saveUpdates(_0x5de230[_0xf7dd('0x53')],null))[_0xf7dd('0x1a')](respondWithResult(_0x5577bb,null))['catch'](handleError(_0x5577bb,null));};exports['destroy']=function(_0x12d40e,_0x535b01){return db['VtigerAccount'][_0xf7dd('0x51')]({'where':{'id':_0x12d40e[_0xf7dd('0x54')]['id']}})[_0xf7dd('0x1a')](handleEntityNotFound(_0x535b01,null))[_0xf7dd('0x1a')](removeEntity(_0x535b01,null))[_0xf7dd('0x23')](handleError(_0x535b01,null));};exports[_0xf7dd('0x55')]=function(_0x390805,_0x28e25e,_0x328ae4){var _0x3490de={};var _0x44374d={};var _0x2c61b4;var _0x53a443;return db[_0xf7dd('0x35')][_0xf7dd('0x56')]({'where':{'id':_0x390805[_0xf7dd('0x54')]['id']}})[_0xf7dd('0x1a')](handleEntityNotFound(_0x28e25e,null))['then'](function(_0x1d6e0a){if(_0x1d6e0a){_0x2c61b4=_0x1d6e0a;_0x44374d[_0xf7dd('0x3c')]=_[_0xf7dd('0x37')](db[_0xf7dd('0x57')]['rawAttributes']);_0x44374d[_0xf7dd('0x38')]=_[_0xf7dd('0x37')](_0x390805['query']);_0x44374d['filters']=_['intersection'](_0x44374d[_0xf7dd('0x3c')],_0x44374d[_0xf7dd('0x38')]);_0x3490de[_0xf7dd('0x3d')]=_['intersection'](_0x44374d[_0xf7dd('0x3c')],qs[_0xf7dd('0x3e')](_0x390805[_0xf7dd('0x38')][_0xf7dd('0x3e')]));_0x3490de[_0xf7dd('0x3d')]=_0x3490de['attributes'][_0xf7dd('0x3f')]?_0x3490de[_0xf7dd('0x3d')]:_0x44374d['model'];_0x3490de[_0xf7dd('0x42')]=qs[_0xf7dd('0x43')](_0x390805[_0xf7dd('0x38')][_0xf7dd('0x43')]);_0x3490de[_0xf7dd('0x47')]=qs[_0xf7dd('0x44')](_[_0xf7dd('0x58')](_0x390805['query'],_0x44374d['filters']));if(_0x390805[_0xf7dd('0x38')][_0xf7dd('0x4b')]){_0x3490de['where']=_['merge'](_0x3490de[_0xf7dd('0x47')],{'$or':_['map'](_0x3490de[_0xf7dd('0x3d')],function(_0x12864d){var _0x199827={};_0x199827[_0x12864d]={'$like':'%'+_0x390805['query'][_0xf7dd('0x4b')]+'%'};return _0x199827;})});}_0x3490de=_[_0xf7dd('0x46')]({},_0x3490de,_0x390805[_0xf7dd('0x4c')]);return _0x2c61b4['getConfigurations'](_0x3490de);}})['then'](function(_0x43e1d7){if(_0x43e1d7){_0x53a443=_0x43e1d7[_0xf7dd('0x3f')];if(!_0x390805[_0xf7dd('0x38')]['hasOwnProperty'](_0xf7dd('0x41'))){_0x3490de[_0xf7dd('0x2a')]=qs[_0xf7dd('0x2a')](_0x390805[_0xf7dd('0x38')]['limit']);_0x3490de[_0xf7dd('0x29')]=qs[_0xf7dd('0x29')](_0x390805[_0xf7dd('0x38')]['offset']);}return _0x2c61b4[_0xf7dd('0x55')](_0x3490de);}})[_0xf7dd('0x1a')](function(_0x421b13){if(_0x421b13){return _0x421b13?{'count':_0x53a443,'rows':_0x421b13}:null;}})['then'](respondWithResult(_0x28e25e,null))[_0xf7dd('0x23')](handleError(_0x28e25e,null));};exports['addConfiguration']=function(_0x2f0b63,_0x39fc2d,_0xfbaed1){if(_0x2f0b63[_0xf7dd('0x53')]['id']){delete _0x2f0b63[_0xf7dd('0x53')]['id'];}return db['VtigerAccount'][_0xf7dd('0x56')]({'where':{'id':_0x2f0b63[_0xf7dd('0x54')]['id']}})[_0xf7dd('0x1a')](handleEntityNotFound(_0x39fc2d,null))[_0xf7dd('0x1a')](function(_0x5d1ded){if(_0x5d1ded){_0x2f0b63[_0xf7dd('0x53')][_0xf7dd('0x59')]=_0x5d1ded['id'];_0x2f0b63[_0xf7dd('0x53')][_0xf7dd('0x5a')]=integrations['getSubjects'](_0x2f0b63[_0xf7dd('0x53')][_0xf7dd('0x5b')],_0x2f0b63['body'][_0xf7dd('0x48')]);_0x2f0b63[_0xf7dd('0x53')][_0xf7dd('0x5c')]=integrations[_0xf7dd('0x5d')](_0x2f0b63['body'][_0xf7dd('0x5b')],_0x2f0b63[_0xf7dd('0x53')][_0xf7dd('0x48')]);return db[_0xf7dd('0x57')][_0xf7dd('0x52')](_0x2f0b63[_0xf7dd('0x53')],{'include':[{'model':db['VtigerField'],'as':_0xf7dd('0x5a')},{'model':db[_0xf7dd('0x5e')],'as':_0xf7dd('0x5c')}]});}return null;})['then'](respondWithResult(_0x39fc2d,null))[_0xf7dd('0x23')](handleError(_0x39fc2d,null));};var md5=require(_0xf7dd('0x5f'));exports['getFields']=function(_0x2dbee4,_0x1d86c6,_0x3abbb0){var _0x153f34=null;var _0x3d9b51=null;var _0x16f64e=null;var _0x1b8a3f=null;return db[_0xf7dd('0x35')][_0xf7dd('0x56')]({'where':{'id':_0x2dbee4[_0xf7dd('0x54')]['id']},'attributes':['id','name','username',_0xf7dd('0x60'),_0xf7dd('0x61'),_0xf7dd('0x62'),_0xf7dd('0x63'),_0xf7dd('0x64')]})['then'](handleEntityNotFound(_0x1d86c6,null))[_0xf7dd('0x1a')](function(_0x1a6a84){if(_0x1a6a84){_0x153f34=_0x1a6a84[_0xf7dd('0x65')];_0x3d9b51=_0x1a6a84[_0xf7dd('0x64')];_0x16f64e=_0x1a6a84[_0xf7dd('0x61')];_0x1b8a3f=util[_0xf7dd('0x66')](_0xf7dd('0x67'),_0x1a6a84['remoteUri']);var _0x371346={'method':_0xf7dd('0x68'),'uri':_0x1b8a3f,'qs':{'operation':_0xf7dd('0x69'),'username':_0x1a6a84['username']},'json':!![]};return rp(_0x371346);}})[_0xf7dd('0x1a')](function(_0x31d44f){if(_0x31d44f[_0xf7dd('0x6a')]){var _0x302c34={'method':_0xf7dd('0x6b'),'uri':_0x1b8a3f,'form':{'operation':_0xf7dd('0x6c'),'username':_0x153f34,'accessKey':md5(_0x31d44f[_0xf7dd('0x22')][_0xf7dd('0x6d')]+_0x3d9b51)},'json':!![]};return rp(_0x302c34);}})[_0xf7dd('0x1a')](function(_0x267fae){if(_0x267fae[_0xf7dd('0x6a')]){var _0x1400cc={'method':_0xf7dd('0x68'),'uri':_0x1b8a3f,'qs':{'operation':_0xf7dd('0x6e'),'username':_0x153f34,'sessionName':_0x267fae[_0xf7dd('0x22')][_0xf7dd('0x6f')],'elementType':_0x16f64e},'json':!![]};return rp(_0x1400cc);}})[_0xf7dd('0x1a')](function(_0x492ec9){if(_0x492ec9[_0xf7dd('0x6a')]){var _0x97a033=[_0xf7dd('0x70'),_0xf7dd('0x71'),'owner'];_['remove'](_0x492ec9[_0xf7dd('0x22')]['fields'],function(_0xe1199c){return _0x97a033[_0xf7dd('0x72')](_0xe1199c[_0xf7dd('0x48')]['name']);});_[_0xf7dd('0x73')](_0x492ec9[_0xf7dd('0x22')][_0xf7dd('0x3e')],function(_0x5b5ff0){return _0x5b5ff0[_0xf7dd('0x74')]===_0xf7dd('0x75');});return{'count':_0x492ec9[_0xf7dd('0x22')][_0xf7dd('0x3e')][_0xf7dd('0x3f')],'rows':_[_0xf7dd('0x76')](_0x492ec9[_0xf7dd('0x22')]['fields'],function(_0x3c79d8){return{'id':_0x3c79d8['name'],'name':_0x3c79d8[_0xf7dd('0x77')],'custom':_[_0xf7dd('0x78')](_0x3c79d8[_0xf7dd('0x32')],'cf_')?!![]:![],'options':_0x3c79d8[_0xf7dd('0x48')][_0xf7dd('0x32')]===_0xf7dd('0x79')&&_0x3c79d8[_0xf7dd('0x48')][_0xf7dd('0x7a')][_0xf7dd('0x3f')]>0x0?_[_0xf7dd('0x76')](_0x3c79d8[_0xf7dd('0x48')]['picklistValues'],function(_0x1fbee3){return{'name':_0x1fbee3[_0xf7dd('0x77')],'value':_0x1fbee3[_0xf7dd('0x7b')]};}):[]};})};}})[_0xf7dd('0x1a')](respondWithResult(_0x1d86c6,null))[_0xf7dd('0x23')](function(_0x43583e){console[_0xf7dd('0x7c')](_0xf7dd('0x7d')+_0x43583e);var _0x41a098=_0x2dbee4[_0xf7dd('0x38')][_0xf7dd('0x7e')]?0x1f4:_0x43583e['statusCode']||0x1f4;logger[_0xf7dd('0x1f')](_0xf7dd('0x7f'),_0xf7dd('0x80'),_0x41a098,JSON[_0xf7dd('0x1e')](_0x43583e));delete _0x43583e[_0xf7dd('0x32')];if(_0x41a098===0x191){_0x41a098=0x190;}_0x1d86c6['status'](_0x41a098)['send'](_0x2dbee4[_0xf7dd('0x38')][_0xf7dd('0x7e')]?{'message':_0xf7dd('0x81'),'statusCode':_0x43583e[_0xf7dd('0x82')]}:_0x43583e);});};
\ No newline at end of file
+var _0xf66b=['rows','show','params','create','body','update','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','%s/webservice.php','GET','getchallenge','success','POST','token','describe','sessionName','autogenerated','remove','false','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','filter','map','type','VIRTUAL','options','VtigerAccount','includeAll','include'];(function(_0x304655,_0x5d3f57){var _0x398345=function(_0x12c5a9){while(--_0x12c5a9){_0x304655['push'](_0x304655['shift']());}};_0x398345(++_0x5d3f57);}(_0xf66b,0x1b3));var _0xbf66=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xf66b[_0x376b45];return _0x2341b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf66('0x0'));var rimraf=require(_0xbf66('0x1'));var zipdir=require(_0xbf66('0x2'));var jsonpatch=require(_0xbf66('0x3'));var rp=require(_0xbf66('0x4'));var moment=require(_0xbf66('0x5'));var BPromise=require(_0xbf66('0x6'));var Mustache=require(_0xbf66('0x7'));var util=require('util');var path=require(_0xbf66('0x8'));var sox=require(_0xbf66('0x9'));var csv=require(_0xbf66('0xa'));var ejs=require(_0xbf66('0xb'));var fs=require('fs');var _=require(_0xbf66('0xc'));var squel=require(_0xbf66('0xd'));var crypto=require(_0xbf66('0xe'));var jsforce=require(_0xbf66('0xf'));var deskjs=require(_0xbf66('0x10'));var toCsv=require(_0xbf66('0xa'));var querystring=require(_0xbf66('0x11'));var Papa=require(_0xbf66('0x12'));var Redis=require(_0xbf66('0x13'));var qs=require(_0xbf66('0x14'));var logger=require(_0xbf66('0x15'))('api');var utils=require(_0xbf66('0x16'));var config=require('../../config/environment');var db=require(_0xbf66('0x17'))['db'];var integrations=require(_0xbf66('0x18'));var jayson=require(_0xbf66('0x19'));var client=jayson[_0xbf66('0x1a')][_0xbf66('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x27aca3,_0x3599cb,_0x12edd4,_0x52f188){return new BPromise(function(_0x158d8d,_0x29feb7){var _0x5760ca=_0x52f188||client;return _0x5760ca[_0xbf66('0x1c')](_0x27aca3,_0x12edd4)[_0xbf66('0x1d')](function(_0x4f4ffc){logger[_0xbf66('0x1e')](_0xbf66('0x1f'),_0x3599cb,_0xbf66('0x20'));logger['debug'](_0xbf66('0x21'),_0x3599cb,_0xbf66('0x20'),JSON[_0xbf66('0x22')](_0x4f4ffc));if(_0x4f4ffc[_0xbf66('0x23')]){if(_0x4f4ffc[_0xbf66('0x23')][_0xbf66('0x24')]===0x1f4){logger[_0xbf66('0x23')](_0xbf66('0x1f'),_0x3599cb,_0x4f4ffc[_0xbf66('0x23')]['message']);return _0x29feb7(_0x4f4ffc[_0xbf66('0x23')]['message']);}logger[_0xbf66('0x23')](_0xbf66('0x1f'),_0x3599cb,_0x4f4ffc[_0xbf66('0x23')]['message']);return _0x158d8d(_0x4f4ffc[_0xbf66('0x23')][_0xbf66('0x25')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x3599cb,_0xbf66('0x20'));_0x158d8d(_0x4f4ffc[_0xbf66('0x26')]['message']);}})[_0xbf66('0x27')](function(_0x3cbec4){logger[_0xbf66('0x23')](_0xbf66('0x1f'),_0x3599cb,_0x3cbec4);_0x29feb7(_0x3cbec4);});});}function respondWithStatusCode(_0x3701db,_0x2d8dd2){_0x2d8dd2=_0x2d8dd2||0xcc;return function(_0x297568){if(_0x297568){return _0x3701db['sendStatus'](_0x2d8dd2);}return _0x3701db['status'](_0x2d8dd2)[_0xbf66('0x28')]();};}function respondWithResult(_0xe1fe0a,_0x16303f){_0x16303f=_0x16303f||0xc8;return function(_0x29488f){if(_0x29488f){return _0xe1fe0a[_0xbf66('0x29')](_0x16303f)[_0xbf66('0x2a')](_0x29488f);}};}function respondWithFilteredResult(_0x542711,_0x19f049){return function(_0x8c82f7){if(_0x8c82f7){var _0x3f4324=_0x8c82f7[_0xbf66('0x2b')],_0x3e9a1e=_0x19f049['offset'],_0x39b683=_0x19f049[_0xbf66('0x2c')]+_0x19f049['limit'],_0x53b684;if(_0x39b683>=_0x3f4324){_0x39b683=_0x3f4324;_0x53b684=0xc8;}else{_0x53b684=0xce;}_0x542711[_0xbf66('0x29')](_0x53b684);return _0x542711[_0xbf66('0x2d')](_0xbf66('0x2e'),_0x3e9a1e+'-'+_0x39b683+'/'+_0x3f4324)[_0xbf66('0x2a')](_0x8c82f7);}return null;};}function patchUpdates(_0x3a67a7){return function(_0x332bae){try{jsonpatch[_0xbf66('0x2f')](_0x332bae,_0x3a67a7,!![]);}catch(_0x7bff93){return BPromise[_0xbf66('0x30')](_0x7bff93);}return _0x332bae[_0xbf66('0x31')]();};}function saveUpdates(_0x131b96,_0x2e030f){return function(_0x2a6338){if(_0x2a6338){return _0x2a6338['update'](_0x131b96)['then'](function(_0x5e9ff1){return _0x5e9ff1;});}return null;};}function removeEntity(_0x5d1927,_0x48c12b){return function(_0x513b05){if(_0x513b05){return _0x513b05[_0xbf66('0x32')]()[_0xbf66('0x1d')](function(){_0x5d1927[_0xbf66('0x29')](0xcc)[_0xbf66('0x28')]();});}};}function handleEntityNotFound(_0x434d56,_0x153601){return function(_0x2de9e3){if(!_0x2de9e3){_0x434d56[_0xbf66('0x33')](0x194);}return _0x2de9e3;};}function handleError(_0x4490f1,_0x5f1a21){_0x5f1a21=_0x5f1a21||0x1f4;return function(_0x469885){logger[_0xbf66('0x23')](_0x469885[_0xbf66('0x34')]);if(_0x469885[_0xbf66('0x35')]){delete _0x469885[_0xbf66('0x35')];}_0x4490f1[_0xbf66('0x29')](_0x5f1a21)[_0xbf66('0x36')](_0x469885);};}exports[_0xbf66('0x37')]=function(_0x19a534,_0x414a7c){var _0x2259bc={},_0x1e93fd={},_0x58d630={'count':0x0,'rows':[]};var _0x4c8416=db['VtigerAccount'][_0xbf66('0x38')];_0x1e93fd['model']=_[_0xbf66('0x39')](_0x4c8416);var _0x18175d={'dateStart':_0x19a534[_0xbf66('0x3a')][_0xbf66('0x3b')],'dateEnd':_0x19a534['query'][_0xbf66('0x3c')]};delete _0x19a534[_0xbf66('0x3a')][_0xbf66('0x3b')];delete _0x19a534[_0xbf66('0x3a')][_0xbf66('0x3c')];_0x1e93fd[_0xbf66('0x3a')]=_[_0xbf66('0x39')](_0x19a534['query']);_0x1e93fd[_0xbf66('0x3d')]=_[_0xbf66('0x3e')](_0x1e93fd['model'],_0x1e93fd[_0xbf66('0x3a')]);_0x2259bc[_0xbf66('0x3f')]=_[_0xbf66('0x3e')](_0x1e93fd[_0xbf66('0x40')],qs[_0xbf66('0x41')](_0x19a534['query'][_0xbf66('0x41')]));_0x2259bc[_0xbf66('0x3f')]=_0x2259bc['attributes'][_0xbf66('0x42')]?_0x2259bc[_0xbf66('0x3f')]:_0x1e93fd[_0xbf66('0x40')];if(!_0x19a534[_0xbf66('0x3a')][_0xbf66('0x43')](_0xbf66('0x44'))){_0x2259bc[_0xbf66('0x45')]=qs['limit'](_0x19a534[_0xbf66('0x3a')][_0xbf66('0x45')]);_0x2259bc['offset']=qs['offset'](_0x19a534[_0xbf66('0x3a')][_0xbf66('0x2c')]);}_0x2259bc[_0xbf66('0x46')]=qs[_0xbf66('0x47')](_0x19a534['query']['sort']);_0x2259bc[_0xbf66('0x48')]=qs[_0xbf66('0x3d')](_[_0xbf66('0x49')](_0x19a534[_0xbf66('0x3a')],_0x1e93fd[_0xbf66('0x3d')]));if(_0x18175d[_0xbf66('0x3b')]){if(_0x18175d[_0xbf66('0x3c')]){_0x18175d[_0xbf66('0x3c')]=moment(_0x18175d['dateEnd'])[_0xbf66('0x4a')](0x1,_0xbf66('0x4b'));}else{_0x18175d['dateEnd']=moment(_0x18175d[_0xbf66('0x3b')])[_0xbf66('0x4a')](0x1,_0xbf66('0x4b'));}_[_0xbf66('0x4c')](_0x2259bc[_0xbf66('0x48')],{'createdAt':{'$gte':_0x18175d['dateStart'],'$lte':_0x18175d[_0xbf66('0x3c')]}});}if(_0x19a534[_0xbf66('0x3a')][_0xbf66('0x4d')]){_0x2259bc['where']=_[_0xbf66('0x4c')](_0x2259bc['where'],{'$or':_[_0xbf66('0x4e')](_0x4c8416,function(_0x510836){if(_0x510836[_0xbf66('0x4f')]['key']!==_0xbf66('0x50')){var _0x5a554e={};_0x5a554e[_0x510836['field']]={'$like':'%'+_0x19a534[_0xbf66('0x3a')]['filter']+'%'};return _0x5a554e;}})});}_0x2259bc=_[_0xbf66('0x4c')]({},_0x2259bc,_0x19a534[_0xbf66('0x51')]);var _0x38e5fc={'where':_0x2259bc[_0xbf66('0x48')]};return db[_0xbf66('0x52')][_0xbf66('0x2b')](_0x38e5fc)['then'](function(_0x57d723){_0x58d630[_0xbf66('0x2b')]=_0x57d723;if(_0x19a534[_0xbf66('0x3a')][_0xbf66('0x53')]){_0x2259bc[_0xbf66('0x54')]=[{'all':!![]}];}return db[_0xbf66('0x52')]['findAll'](_0x2259bc);})[_0xbf66('0x1d')](function(_0x55147e){_0x58d630[_0xbf66('0x55')]=_0x55147e;return _0x58d630;})['then'](respondWithFilteredResult(_0x414a7c,_0x2259bc))[_0xbf66('0x27')](handleError(_0x414a7c,null));};exports[_0xbf66('0x56')]=function(_0x48c19a,_0xf423cd){var _0x412f28={'raw':![],'where':{'id':_0x48c19a[_0xbf66('0x57')]['id']}},_0x3b5f61={};_0x3b5f61[_0xbf66('0x40')]=_[_0xbf66('0x39')](db[_0xbf66('0x52')][_0xbf66('0x38')]);_0x3b5f61[_0xbf66('0x3a')]=_[_0xbf66('0x39')](_0x48c19a[_0xbf66('0x3a')]);_0x3b5f61[_0xbf66('0x3d')]=_['intersection'](_0x3b5f61[_0xbf66('0x40')],_0x3b5f61[_0xbf66('0x3a')]);_0x412f28['attributes']=_['intersection'](_0x3b5f61['model'],qs[_0xbf66('0x41')](_0x48c19a['query']['fields']));_0x412f28[_0xbf66('0x3f')]=_0x412f28[_0xbf66('0x3f')][_0xbf66('0x42')]?_0x412f28[_0xbf66('0x3f')]:_0x3b5f61['model'];if(_0x48c19a[_0xbf66('0x3a')]['includeAll']){_0x412f28['include']=[{'all':!![]}];}_0x412f28=_[_0xbf66('0x4c')]({},_0x412f28,_0x48c19a[_0xbf66('0x51')]);return db[_0xbf66('0x52')]['find'](_0x412f28)[_0xbf66('0x1d')](handleEntityNotFound(_0xf423cd,null))[_0xbf66('0x1d')](respondWithResult(_0xf423cd,null))['catch'](handleError(_0xf423cd,null));};exports[_0xbf66('0x58')]=function(_0x19a947,_0x1ecefa){return db[_0xbf66('0x52')][_0xbf66('0x58')](_0x19a947[_0xbf66('0x59')],{})[_0xbf66('0x1d')](respondWithResult(_0x1ecefa,0xc9))[_0xbf66('0x27')](handleError(_0x1ecefa,null));};exports[_0xbf66('0x5a')]=function(_0x1d259e,_0x4685b9){if(_0x1d259e[_0xbf66('0x59')]['id']){delete _0x1d259e[_0xbf66('0x59')]['id'];}return db[_0xbf66('0x52')][_0xbf66('0x5b')]({'where':{'id':_0x1d259e['params']['id']}})['then'](handleEntityNotFound(_0x4685b9,null))['then'](saveUpdates(_0x1d259e[_0xbf66('0x59')],null))['then'](respondWithResult(_0x4685b9,null))[_0xbf66('0x27')](handleError(_0x4685b9,null));};exports[_0xbf66('0x32')]=function(_0x44f93d,_0x1454af){return db[_0xbf66('0x52')][_0xbf66('0x5b')]({'where':{'id':_0x44f93d[_0xbf66('0x57')]['id']}})[_0xbf66('0x1d')](handleEntityNotFound(_0x1454af,null))[_0xbf66('0x1d')](removeEntity(_0x1454af,null))['catch'](handleError(_0x1454af,null));};exports[_0xbf66('0x5c')]=function(_0x4c2a55,_0x3d6059,_0x2257bc){var _0x2c81a8={};var _0x49638e={};var _0x281a07;var _0x12e393;return db[_0xbf66('0x52')][_0xbf66('0x5d')]({'where':{'id':_0x4c2a55[_0xbf66('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d6059,null))['then'](function(_0x1f6e2c){if(_0x1f6e2c){_0x281a07=_0x1f6e2c;_0x49638e[_0xbf66('0x40')]=_['keys'](db[_0xbf66('0x5e')][_0xbf66('0x38')]);_0x49638e[_0xbf66('0x3a')]=_[_0xbf66('0x39')](_0x4c2a55[_0xbf66('0x3a')]);_0x49638e[_0xbf66('0x3d')]=_[_0xbf66('0x3e')](_0x49638e[_0xbf66('0x40')],_0x49638e[_0xbf66('0x3a')]);_0x2c81a8[_0xbf66('0x3f')]=_[_0xbf66('0x3e')](_0x49638e[_0xbf66('0x40')],qs[_0xbf66('0x41')](_0x4c2a55[_0xbf66('0x3a')]['fields']));_0x2c81a8['attributes']=_0x2c81a8['attributes']['length']?_0x2c81a8[_0xbf66('0x3f')]:_0x49638e[_0xbf66('0x40')];_0x2c81a8[_0xbf66('0x46')]=qs[_0xbf66('0x47')](_0x4c2a55[_0xbf66('0x3a')][_0xbf66('0x47')]);_0x2c81a8[_0xbf66('0x48')]=qs[_0xbf66('0x3d')](_[_0xbf66('0x49')](_0x4c2a55['query'],_0x49638e['filters']));if(_0x4c2a55[_0xbf66('0x3a')][_0xbf66('0x4d')]){_0x2c81a8[_0xbf66('0x48')]=_[_0xbf66('0x4c')](_0x2c81a8[_0xbf66('0x48')],{'$or':_[_0xbf66('0x4e')](_0x2c81a8[_0xbf66('0x3f')],function(_0x2a959d){var _0x949373={};_0x949373[_0x2a959d]={'$like':'%'+_0x4c2a55[_0xbf66('0x3a')][_0xbf66('0x4d')]+'%'};return _0x949373;})});}_0x2c81a8=_[_0xbf66('0x4c')]({},_0x2c81a8,_0x4c2a55[_0xbf66('0x51')]);return _0x281a07['getConfigurations'](_0x2c81a8);}})[_0xbf66('0x1d')](function(_0x264ed9){if(_0x264ed9){_0x12e393=_0x264ed9[_0xbf66('0x42')];if(!_0x4c2a55[_0xbf66('0x3a')]['hasOwnProperty'](_0xbf66('0x44'))){_0x2c81a8[_0xbf66('0x45')]=qs[_0xbf66('0x45')](_0x4c2a55['query']['limit']);_0x2c81a8[_0xbf66('0x2c')]=qs[_0xbf66('0x2c')](_0x4c2a55[_0xbf66('0x3a')]['offset']);}return _0x281a07[_0xbf66('0x5c')](_0x2c81a8);}})[_0xbf66('0x1d')](function(_0x8ba9f8){if(_0x8ba9f8){return _0x8ba9f8?{'count':_0x12e393,'rows':_0x8ba9f8}:null;}})['then'](respondWithResult(_0x3d6059,null))['catch'](handleError(_0x3d6059,null));};exports[_0xbf66('0x5f')]=function(_0x3c353f,_0x116010,_0x9771c0){if(_0x3c353f[_0xbf66('0x59')]['id']){delete _0x3c353f['body']['id'];}return db[_0xbf66('0x52')][_0xbf66('0x5d')]({'where':{'id':_0x3c353f[_0xbf66('0x57')]['id']}})[_0xbf66('0x1d')](handleEntityNotFound(_0x116010,null))[_0xbf66('0x1d')](function(_0x761f9e){if(_0x761f9e){_0x3c353f[_0xbf66('0x59')][_0xbf66('0x60')]=_0x761f9e['id'];_0x3c353f[_0xbf66('0x59')][_0xbf66('0x61')]=integrations[_0xbf66('0x62')](_0x3c353f['body'][_0xbf66('0x63')],_0x3c353f['body'][_0xbf66('0x4f')]);_0x3c353f[_0xbf66('0x59')][_0xbf66('0x64')]=integrations['getDescriptions'](_0x3c353f[_0xbf66('0x59')]['channel'],_0x3c353f['body'][_0xbf66('0x4f')]);return db[_0xbf66('0x5e')][_0xbf66('0x58')](_0x3c353f[_0xbf66('0x59')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0xbf66('0x65')],'as':'Descriptions'}]});}return null;})[_0xbf66('0x1d')](respondWithResult(_0x116010,null))[_0xbf66('0x27')](handleError(_0x116010,null));};var md5=require(_0xbf66('0x66'));exports['getFields']=function(_0x5348b9,_0x2b7184,_0x31af9b){var _0x3fdc53=null;var _0x36b799=null;var _0x38de39=null;var _0x440d18=null;return db['VtigerAccount'][_0xbf66('0x5d')]({'where':{'id':_0x5348b9['params']['id']},'attributes':['id',_0xbf66('0x35'),_0xbf66('0x67'),_0xbf66('0x68'),_0xbf66('0x69'),_0xbf66('0x6a'),_0xbf66('0x6b'),_0xbf66('0x6c')]})['then'](handleEntityNotFound(_0x2b7184,null))[_0xbf66('0x1d')](function(_0x5c89ec){if(_0x5c89ec){_0x3fdc53=_0x5c89ec[_0xbf66('0x67')];_0x36b799=_0x5c89ec['accessKey'];_0x38de39=_0x5c89ec[_0xbf66('0x69')];_0x440d18=util['format'](_0xbf66('0x6d'),_0x5c89ec[_0xbf66('0x6a')]);var _0x3d8927={'method':_0xbf66('0x6e'),'uri':_0x440d18,'qs':{'operation':_0xbf66('0x6f'),'username':_0x5c89ec[_0xbf66('0x67')]},'json':!![]};return rp(_0x3d8927);}})[_0xbf66('0x1d')](function(_0x35cb19){if(_0x35cb19[_0xbf66('0x70')]){var _0x327e09={'method':_0xbf66('0x71'),'uri':_0x440d18,'form':{'operation':'login','username':_0x3fdc53,'accessKey':md5(_0x35cb19['result'][_0xbf66('0x72')]+_0x36b799)},'json':!![]};return rp(_0x327e09);}})['then'](function(_0x3fb801){if(_0x3fb801['success']){var _0x2c62b8={'method':'GET','uri':_0x440d18,'qs':{'operation':_0xbf66('0x73'),'username':_0x3fdc53,'sessionName':_0x3fb801['result'][_0xbf66('0x74')],'elementType':_0x38de39},'json':!![]};return rp(_0x2c62b8);}})[_0xbf66('0x1d')](function(_0x47a672){if(_0x47a672[_0xbf66('0x70')]){var _0x37f5b1=[_0xbf66('0x75'),'reference','owner'];_[_0xbf66('0x76')](_0x47a672['result'][_0xbf66('0x41')],function(_0x3185de){return _0x37f5b1['includes'](_0x3185de[_0xbf66('0x4f')][_0xbf66('0x35')]);});_[_0xbf66('0x76')](_0x47a672['result']['fields'],function(_0x5368c8){return _0x5368c8['editable']===_0xbf66('0x77');});return{'count':_0x47a672[_0xbf66('0x26')][_0xbf66('0x41')]['length'],'rows':_['map'](_0x47a672['result'][_0xbf66('0x41')],function(_0x3b2369){return{'id':_0x3b2369[_0xbf66('0x35')],'name':_0x3b2369[_0xbf66('0x78')],'custom':_[_0xbf66('0x79')](_0x3b2369[_0xbf66('0x35')],_0xbf66('0x7a'))?!![]:![],'options':_0x3b2369['type'][_0xbf66('0x35')]===_0xbf66('0x7b')&&_0x3b2369[_0xbf66('0x4f')][_0xbf66('0x7c')][_0xbf66('0x42')]>0x0?_['map'](_0x3b2369[_0xbf66('0x4f')]['picklistValues'],function(_0x192987){return{'name':_0x192987[_0xbf66('0x78')],'value':_0x192987['value']};}):[]};})};}})[_0xbf66('0x1d')](respondWithResult(_0x2b7184,null))[_0xbf66('0x27')](function(_0x36cfcf){console[_0xbf66('0x7d')](_0xbf66('0x7e')+_0x36cfcf);var _0x1e9217=_0x5348b9[_0xbf66('0x3a')]['test']?0x1f4:_0x36cfcf['statusCode']||0x1f4;logger[_0xbf66('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xbf66('0x7f'),_0x1e9217,JSON['stringify'](_0x36cfcf));delete _0x36cfcf[_0xbf66('0x35')];if(_0x1e9217===0x191){_0x1e9217=0x190;}_0x2b7184[_0xbf66('0x29')](_0x1e9217)[_0xbf66('0x36')](_0x5348b9['query']['test']?{'message':_0xbf66('0x80'),'statusCode':_0x36cfcf[_0xbf66('0x81')]}:_0x36cfcf);});};
\ No newline at end of file
index 3827bd1..f539425 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ae9=['../../config/logger','bluebird','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3ae9,0x18a));var _0x93ae=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x3ae9[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x93ae('0x0'));var util=require(_0x93ae('0x1'));var logger=require(_0x93ae('0x2'))('api');var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var rp=require(_0x93ae('0x4'));var attributes=require(_0x93ae('0x5'));var integrations=require(_0x93ae('0x6'));module['exports']=function(_0x3164b5,_0x20f11c){return _0x3164b5[_0x93ae('0x7')](_0x93ae('0x8'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x63b0=['moment','bluebird','request-promise','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','api'];(function(_0x55e840,_0x4e54ce){var _0x8e570d=function(_0x3c2df8){while(--_0x3c2df8){_0x55e840['push'](_0x55e840['shift']());}};_0x8e570d(++_0x4e54ce);}(_0x63b0,0x147));var _0x063b=function(_0x3c7998,_0x4b71ea){_0x3c7998=_0x3c7998-0x0;var _0x9f725d=_0x63b0[_0x3c7998];return _0x9f725d;};'use strict';var _=require(_0x063b('0x0'));var util=require(_0x063b('0x1'));var logger=require('../../config/logger')(_0x063b('0x2'));var moment=require(_0x063b('0x3'));var BPromise=require(_0x063b('0x4'));var rp=require(_0x063b('0x5'));var attributes=require(_0x063b('0x6'));var integrations=require(_0x063b('0x7'));module[_0x063b('0x8')]=function(_0x111d93,_0x195f94){return _0x111d93[_0x063b('0x9')](_0x063b('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b3d33e0..ccee655 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a50=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowVtigerAccount','moment'];(function(_0x452dc4,_0x2f30d0){var _0x11a908=function(_0x12d509){while(--_0x12d509){_0x452dc4['push'](_0x452dc4['shift']());}};_0x11a908(++_0x2f30d0);}(_0x5a50,0x1cd));var _0x05a5=function(_0x41ea1b,_0x19ebd1){_0x41ea1b=_0x41ea1b-0x0;var _0x178f31=_0x5a50[_0x41ea1b];return _0x178f31;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05a5('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05a5('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x05a5('0x2'));var logger=require(_0x05a5('0x3'))(_0x05a5('0x4'));var config=require(_0x05a5('0x5'));var jayson=require(_0x05a5('0x6'));var client=jayson[_0x05a5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b53c,_0x3fdd68,_0x58c9bc){return new BPromise(function(_0x16fffa,_0x522bd9){return client[_0x05a5('0x8')](_0x2b53c,_0x58c9bc)[_0x05a5('0x9')](function(_0x48af97){logger[_0x05a5('0xa')](_0x05a5('0xb'),_0x3fdd68,_0x05a5('0xc'));logger[_0x05a5('0xd')](_0x05a5('0xe'),_0x3fdd68,_0x05a5('0xc'),JSON[_0x05a5('0xf')](_0x48af97));if(_0x48af97['error']){if(_0x48af97[_0x05a5('0x10')][_0x05a5('0x11')]===0x1f4){logger[_0x05a5('0x10')](_0x05a5('0xb'),_0x3fdd68,_0x48af97[_0x05a5('0x10')][_0x05a5('0x12')]);return _0x522bd9(_0x48af97[_0x05a5('0x10')][_0x05a5('0x12')]);}logger[_0x05a5('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x3fdd68,_0x48af97[_0x05a5('0x10')]['message']);return _0x16fffa(_0x48af97[_0x05a5('0x10')]['message']);}else{logger[_0x05a5('0xa')](_0x05a5('0xb'),_0x3fdd68,_0x05a5('0xc'));_0x16fffa(_0x48af97['result'][_0x05a5('0x12')]);}})[_0x05a5('0x13')](function(_0xaf0adb){logger[_0x05a5('0x10')](_0x05a5('0xb'),_0x3fdd68,_0xaf0adb);_0x522bd9(_0xaf0adb);});});}exports[_0x05a5('0x14')]=function(_0x5c74ef){var _0x3ccefa=this;return new Promise(function(_0x335d04,_0x404082){return db[_0x05a5('0x15')][_0x05a5('0x16')]({'raw':_0x5c74ef[_0x05a5('0x17')]?_0x5c74ef[_0x05a5('0x17')][_0x05a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5c74ef[_0x05a5('0x17')]?_0x5c74ef[_0x05a5('0x17')]['where']||null:null,'attributes':_0x5c74ef[_0x05a5('0x17')]?_0x5c74ef[_0x05a5('0x17')][_0x05a5('0x19')]||null:null,'limit':_0x5c74ef['options']?_0x5c74ef[_0x05a5('0x17')][_0x05a5('0x1a')]||null:null,'include':_0x5c74ef[_0x05a5('0x17')]?_0x5c74ef['options'][_0x05a5('0x1b')]?_[_0x05a5('0x1c')](_0x5c74ef['options']['include'],function(_0x62ac8c){return{'model':db[_0x62ac8c[_0x05a5('0x1d')]],'as':_0x62ac8c['as'],'attributes':_0x62ac8c[_0x05a5('0x19')],'include':_0x62ac8c['include']?_['map'](_0x62ac8c[_0x05a5('0x1b')],function(_0x311660){return{'model':db[_0x311660[_0x05a5('0x1d')]],'as':_0x311660['as'],'attributes':_0x311660['attributes'],'include':_0x311660[_0x05a5('0x1b')]?_[_0x05a5('0x1c')](_0x311660[_0x05a5('0x1b')],function(_0x3df54c){return{'model':db[_0x3df54c[_0x05a5('0x1d')]],'as':_0x3df54c['as'],'attributes':_0x3df54c[_0x05a5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x05a5('0x9')](function(_0x33f15f){logger[_0x05a5('0xa')](_0x05a5('0x14'),_0x5c74ef);logger[_0x05a5('0xd')]('GetVtigerAccount',_0x5c74ef,JSON[_0x05a5('0xf')](_0x33f15f));_0x335d04(_0x33f15f);})[_0x05a5('0x13')](function(_0x42d230){logger[_0x05a5('0x10')](_0x05a5('0x14'),_0x42d230[_0x05a5('0x12')],_0x5c74ef);_0x404082(_0x3ccefa['error'](0x1f4,_0x42d230['message']));});});};exports['ShowVtigerAccount']=function(_0x29d649){var _0x1972b7=this;return new Promise(function(_0x625e89,_0x31a395){return db[_0x05a5('0x15')][_0x05a5('0x1e')]({'raw':_0x29d649[_0x05a5('0x17')]?_0x29d649[_0x05a5('0x17')][_0x05a5('0x18')]===undefined?!![]:![]:!![],'where':_0x29d649['options']?_0x29d649[_0x05a5('0x17')][_0x05a5('0x1f')]||null:null,'attributes':_0x29d649[_0x05a5('0x17')]?_0x29d649['options'][_0x05a5('0x19')]||null:null,'include':_0x29d649['options']?_0x29d649['options'][_0x05a5('0x1b')]?_[_0x05a5('0x1c')](_0x29d649[_0x05a5('0x17')][_0x05a5('0x1b')],function(_0x447ee8){return{'model':db[_0x447ee8[_0x05a5('0x1d')]],'as':_0x447ee8['as'],'attributes':_0x447ee8[_0x05a5('0x19')],'include':_0x447ee8['include']?_[_0x05a5('0x1c')](_0x447ee8[_0x05a5('0x1b')],function(_0x5173ff){return{'model':db[_0x5173ff[_0x05a5('0x1d')]],'as':_0x5173ff['as'],'attributes':_0x5173ff['attributes'],'include':_0x5173ff['include']?_[_0x05a5('0x1c')](_0x5173ff[_0x05a5('0x1b')],function(_0x5452ae){return{'model':db[_0x5452ae['model']],'as':_0x5452ae['as'],'attributes':_0x5452ae[_0x05a5('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b3de5){logger['info']('ShowVtigerAccount',_0x29d649);logger[_0x05a5('0xd')](_0x05a5('0x20'),_0x29d649,JSON[_0x05a5('0xf')](_0x4b3de5));_0x625e89(_0x4b3de5);})['catch'](function(_0xf6badd){logger[_0x05a5('0x10')](_0x05a5('0x20'),_0xf6badd[_0x05a5('0x12')],_0x29d649);_0x31a395(_0x1972b7[_0x05a5('0x10')](0x1f4,_0xf6badd[_0x05a5('0x12')]));});});};
\ No newline at end of file
+var _0x73a4=['where','attributes','limit','include','map','model','ShowVtigerAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw'];(function(_0x33a74e,_0x18f983){var _0x20d012=function(_0x372d21){while(--_0x372d21){_0x33a74e['push'](_0x33a74e['shift']());}};_0x20d012(++_0x18f983);}(_0x73a4,0x8c));var _0x473a=function(_0x3a194c,_0x324ccc){_0x3a194c=_0x3a194c-0x0;var _0x43f2ba=_0x73a4[_0x3a194c];return _0x43f2ba;};'use strict';var _=require('lodash');var util=require(_0x473a('0x0'));var moment=require(_0x473a('0x1'));var BPromise=require(_0x473a('0x2'));var rs=require(_0x473a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x473a('0x4'))['db'];var utils=require(_0x473a('0x5'));var logger=require('../../config/logger')(_0x473a('0x6'));var config=require(_0x473a('0x7'));var jayson=require(_0x473a('0x8'));var client=jayson[_0x473a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57a645,_0x21526c,_0x13e35a){return new BPromise(function(_0x1755d8,_0x498e72){return client['request'](_0x57a645,_0x13e35a)[_0x473a('0xa')](function(_0x5bf162){logger[_0x473a('0xb')](_0x473a('0xc'),_0x21526c,_0x473a('0xd'));logger[_0x473a('0xe')](_0x473a('0xf'),_0x21526c,'request\x20sent',JSON[_0x473a('0x10')](_0x5bf162));if(_0x5bf162['error']){if(_0x5bf162[_0x473a('0x11')]['code']===0x1f4){logger[_0x473a('0x11')](_0x473a('0xc'),_0x21526c,_0x5bf162[_0x473a('0x11')][_0x473a('0x12')]);return _0x498e72(_0x5bf162['error'][_0x473a('0x12')]);}logger[_0x473a('0x11')](_0x473a('0xc'),_0x21526c,_0x5bf162[_0x473a('0x11')][_0x473a('0x12')]);return _0x1755d8(_0x5bf162[_0x473a('0x11')][_0x473a('0x12')]);}else{logger['info'](_0x473a('0xc'),_0x21526c,_0x473a('0xd'));_0x1755d8(_0x5bf162['result']['message']);}})[_0x473a('0x13')](function(_0x2a322c){logger[_0x473a('0x11')](_0x473a('0xc'),_0x21526c,_0x2a322c);_0x498e72(_0x2a322c);});});}exports[_0x473a('0x14')]=function(_0x2bc267){var _0x58e3ed=this;return new Promise(function(_0x503e5a,_0x54534d){return db[_0x473a('0x15')][_0x473a('0x16')]({'raw':_0x2bc267['options']?_0x2bc267[_0x473a('0x17')][_0x473a('0x18')]===undefined?!![]:![]:!![],'where':_0x2bc267['options']?_0x2bc267[_0x473a('0x17')][_0x473a('0x19')]||null:null,'attributes':_0x2bc267[_0x473a('0x17')]?_0x2bc267[_0x473a('0x17')][_0x473a('0x1a')]||null:null,'limit':_0x2bc267['options']?_0x2bc267[_0x473a('0x17')][_0x473a('0x1b')]||null:null,'include':_0x2bc267['options']?_0x2bc267['options'][_0x473a('0x1c')]?_[_0x473a('0x1d')](_0x2bc267['options'][_0x473a('0x1c')],function(_0x3b0972){return{'model':db[_0x3b0972['model']],'as':_0x3b0972['as'],'attributes':_0x3b0972[_0x473a('0x1a')],'include':_0x3b0972[_0x473a('0x1c')]?_[_0x473a('0x1d')](_0x3b0972['include'],function(_0x30d9fe){return{'model':db[_0x30d9fe[_0x473a('0x1e')]],'as':_0x30d9fe['as'],'attributes':_0x30d9fe['attributes'],'include':_0x30d9fe[_0x473a('0x1c')]?_['map'](_0x30d9fe[_0x473a('0x1c')],function(_0x2f19e6){return{'model':db[_0x2f19e6[_0x473a('0x1e')]],'as':_0x2f19e6['as'],'attributes':_0x2f19e6['attributes']};}):[]};}):[]};}):[]:[]})[_0x473a('0xa')](function(_0x4317f1){logger[_0x473a('0xb')](_0x473a('0x14'),_0x2bc267);logger[_0x473a('0xe')](_0x473a('0x14'),_0x2bc267,JSON[_0x473a('0x10')](_0x4317f1));_0x503e5a(_0x4317f1);})[_0x473a('0x13')](function(_0x3b3d81){logger[_0x473a('0x11')]('GetVtigerAccount',_0x3b3d81['message'],_0x2bc267);_0x54534d(_0x58e3ed[_0x473a('0x11')](0x1f4,_0x3b3d81[_0x473a('0x12')]));});});};exports[_0x473a('0x1f')]=function(_0x34eb7b){var _0x40a54a=this;return new Promise(function(_0x2a2f62,_0x3c5755){return db[_0x473a('0x15')][_0x473a('0x20')]({'raw':_0x34eb7b[_0x473a('0x17')]?_0x34eb7b[_0x473a('0x17')][_0x473a('0x18')]===undefined?!![]:![]:!![],'where':_0x34eb7b[_0x473a('0x17')]?_0x34eb7b['options']['where']||null:null,'attributes':_0x34eb7b[_0x473a('0x17')]?_0x34eb7b[_0x473a('0x17')][_0x473a('0x1a')]||null:null,'include':_0x34eb7b[_0x473a('0x17')]?_0x34eb7b[_0x473a('0x17')][_0x473a('0x1c')]?_['map'](_0x34eb7b[_0x473a('0x17')][_0x473a('0x1c')],function(_0x56ebc9){return{'model':db[_0x56ebc9[_0x473a('0x1e')]],'as':_0x56ebc9['as'],'attributes':_0x56ebc9[_0x473a('0x1a')],'include':_0x56ebc9[_0x473a('0x1c')]?_[_0x473a('0x1d')](_0x56ebc9[_0x473a('0x1c')],function(_0x3243d6){return{'model':db[_0x3243d6[_0x473a('0x1e')]],'as':_0x3243d6['as'],'attributes':_0x3243d6[_0x473a('0x1a')],'include':_0x3243d6[_0x473a('0x1c')]?_[_0x473a('0x1d')](_0x3243d6[_0x473a('0x1c')],function(_0x37050e){return{'model':db[_0x37050e[_0x473a('0x1e')]],'as':_0x37050e['as'],'attributes':_0x37050e[_0x473a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x473a('0xa')](function(_0x5d9439){logger[_0x473a('0xb')](_0x473a('0x1f'),_0x34eb7b);logger['debug'](_0x473a('0x1f'),_0x34eb7b,JSON[_0x473a('0x10')](_0x5d9439));_0x2a2f62(_0x5d9439);})[_0x473a('0x13')](function(_0x506615){logger[_0x473a('0x11')](_0x473a('0x1f'),_0x506615[_0x473a('0x12')],_0x34eb7b);_0x3c5755(_0x40a54a[_0x473a('0x11')](0x1f4,_0x506615[_0x473a('0x12')]));});});};
\ No newline at end of file
index 1cd5c49..314512c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['post','create','put','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0xb0f78d,_0x39b0a0){var _0x28c9a0=function(_0x90bee1){while(--_0x90bee1){_0xb0f78d['push'](_0xb0f78d['shift']());}};_0x28c9a0(++_0x39b0a0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x7')](_0x3071('0x10'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x13')]);router[_0x3071('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x15')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x16')]=router;
\ No newline at end of file
+var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x3ea531,_0x3bed88){var _0x2945c5=function(_0x25de09){while(--_0x25de09){_0x3ea531['push'](_0x3ea531['shift']());}};_0x2945c5(++_0x3bed88);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c8f05,_0x3b5b37){_0x2c8f05=_0x2c8f05-0x0;var _0x3a48fd=_0xb10b[_0x2c8f05];return _0x3a48fd;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
index 31fc15a..a94e3f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd0b=['STRING','sequelize'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xdd0b,0x1c3));var _0xbdd0=function(_0x52a33e,_0x35b536){_0x52a33e=_0x52a33e-0x0;var _0x38c24f=_0xdd0b[_0x52a33e];return _0x38c24f;};'use strict';var Sequelize=require(_0xbdd0('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdd0('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x865b=['sequelize','exports','STRING'];(function(_0x3df541,_0x33cf48){var _0x143bf2=function(_0x2b406a){while(--_0x2b406a){_0x3df541['push'](_0x3df541['shift']());}};_0x143bf2(++_0x33cf48);}(_0x865b,0x1b6));var _0xb865=function(_0x184dae,_0x5e7a29){_0x184dae=_0x184dae-0x0;var _0x3e53fe=_0x865b[_0x184dae];return _0x3e53fe;};'use strict';var Sequelize=require(_0xb865('0x0'));module[_0xb865('0x1')]={'name':{'type':Sequelize[_0xb865('0x2')]},'description':{'type':Sequelize[_0xb865('0x2')]}};
\ No newline at end of file
index 0233b9d..74f0ce6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbb6=['then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','add','day','filter','map','type','key','field','VtigerConfiguration','count','includeAll','findAll','rows','catch','params','rawAttributes','length','include','merge','create','body','find','findOne','VtigerField','order','options','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','jayson/promise','client','request'];(function(_0x390808,_0x4a820a){var _0x527273=function(_0x390860){while(--_0x390860){_0x390808['push'](_0x390808['shift']());}};_0x527273(++_0x4a820a);}(_0xcbb6,0x15d));var _0x6cbb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcbb6[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0x6cbb('0x0'));var emlformat=require(_0x6cbb('0x1'));var rimraf=require(_0x6cbb('0x2'));var zipdir=require(_0x6cbb('0x3'));var jsonpatch=require(_0x6cbb('0x4'));var rp=require(_0x6cbb('0x5'));var moment=require(_0x6cbb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6cbb('0x7'));var util=require(_0x6cbb('0x8'));var path=require(_0x6cbb('0x9'));var sox=require(_0x6cbb('0xa'));var csv=require(_0x6cbb('0xb'));var ejs=require(_0x6cbb('0xc'));var fs=require('fs');var _=require(_0x6cbb('0xd'));var squel=require(_0x6cbb('0xe'));var crypto=require(_0x6cbb('0xf'));var jsforce=require(_0x6cbb('0x10'));var deskjs=require(_0x6cbb('0x11'));var toCsv=require(_0x6cbb('0xb'));var querystring=require(_0x6cbb('0x12'));var Papa=require(_0x6cbb('0x13'));var Redis=require(_0x6cbb('0x14'));var qs=require(_0x6cbb('0x15'));var logger=require(_0x6cbb('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6cbb('0x17'))['db'];var jayson=require(_0x6cbb('0x18'));var client=jayson[_0x6cbb('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19c6ca,_0x55cbc7,_0x3dba6a,_0x3eedf5){return new BPromise(function(_0x160a2e,_0x1b6e9c){var _0x315c22=_0x3eedf5||client;return _0x315c22[_0x6cbb('0x1a')](_0x19c6ca,_0x3dba6a)[_0x6cbb('0x1b')](function(_0x18c4c4){logger[_0x6cbb('0x1c')](_0x6cbb('0x1d'),_0x55cbc7,'request\x20sent');logger[_0x6cbb('0x1e')](_0x6cbb('0x1f'),_0x55cbc7,'request\x20sent',JSON[_0x6cbb('0x20')](_0x18c4c4));if(_0x18c4c4['error']){if(_0x18c4c4[_0x6cbb('0x21')][_0x6cbb('0x22')]===0x1f4){logger[_0x6cbb('0x21')](_0x6cbb('0x1d'),_0x55cbc7,_0x18c4c4[_0x6cbb('0x21')][_0x6cbb('0x23')]);return _0x1b6e9c(_0x18c4c4[_0x6cbb('0x21')][_0x6cbb('0x23')]);}logger[_0x6cbb('0x21')](_0x6cbb('0x1d'),_0x55cbc7,_0x18c4c4[_0x6cbb('0x21')][_0x6cbb('0x23')]);return _0x160a2e(_0x18c4c4['error'][_0x6cbb('0x23')]);}else{logger['info'](_0x6cbb('0x1d'),_0x55cbc7,'request\x20sent');_0x160a2e(_0x18c4c4['result'][_0x6cbb('0x23')]);}})['catch'](function(_0x467465){logger[_0x6cbb('0x21')](_0x6cbb('0x1d'),_0x55cbc7,_0x467465);_0x1b6e9c(_0x467465);});});}function respondWithStatusCode(_0x106fa7,_0x430fbf){_0x430fbf=_0x430fbf||0xcc;return function(_0xea1e58){if(_0xea1e58){return _0x106fa7[_0x6cbb('0x24')](_0x430fbf);}return _0x106fa7[_0x6cbb('0x25')](_0x430fbf)['end']();};}function respondWithResult(_0xcd7300,_0xfd7281){_0xfd7281=_0xfd7281||0xc8;return function(_0x1f9c4a){if(_0x1f9c4a){return _0xcd7300[_0x6cbb('0x25')](_0xfd7281)[_0x6cbb('0x26')](_0x1f9c4a);}};}function respondWithFilteredResult(_0xf1f1fc,_0x2f1988){return function(_0x1a2a25){if(_0x1a2a25){var _0x2e1400=_0x1a2a25['count'],_0x3e6240=_0x2f1988[_0x6cbb('0x27')],_0x33b346=_0x2f1988[_0x6cbb('0x27')]+_0x2f1988[_0x6cbb('0x28')],_0x36a7ff;if(_0x33b346>=_0x2e1400){_0x33b346=_0x2e1400;_0x36a7ff=0xc8;}else{_0x36a7ff=0xce;}_0xf1f1fc[_0x6cbb('0x25')](_0x36a7ff);return _0xf1f1fc[_0x6cbb('0x29')](_0x6cbb('0x2a'),_0x3e6240+'-'+_0x33b346+'/'+_0x2e1400)['json'](_0x1a2a25);}return null;};}function patchUpdates(_0x10ef99){return function(_0x258d72){try{jsonpatch[_0x6cbb('0x2b')](_0x258d72,_0x10ef99,!![]);}catch(_0x111aff){return BPromise[_0x6cbb('0x2c')](_0x111aff);}return _0x258d72[_0x6cbb('0x2d')]();};}function saveUpdates(_0x5db1b4,_0x2e2ee6){return function(_0x2cb0da){if(_0x2cb0da){return _0x2cb0da[_0x6cbb('0x2e')](_0x5db1b4)[_0x6cbb('0x1b')](function(_0x3658f5){return _0x3658f5;});}return null;};}function removeEntity(_0x52cd08,_0x9d73f3){return function(_0x25373d){if(_0x25373d){return _0x25373d[_0x6cbb('0x2f')]()[_0x6cbb('0x1b')](function(){_0x52cd08[_0x6cbb('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c66e1,_0xbbedfd){return function(_0x21cc72){if(!_0x21cc72){_0x3c66e1[_0x6cbb('0x24')](0x194);}return _0x21cc72;};}function handleError(_0x27c9f0,_0x2d28a3){_0x2d28a3=_0x2d28a3||0x1f4;return function(_0x2926cc){logger[_0x6cbb('0x21')](_0x2926cc[_0x6cbb('0x30')]);if(_0x2926cc[_0x6cbb('0x31')]){delete _0x2926cc[_0x6cbb('0x31')];}_0x27c9f0[_0x6cbb('0x25')](_0x2d28a3)[_0x6cbb('0x32')](_0x2926cc);};}exports[_0x6cbb('0x33')]=function(_0x342041,_0x30a915){var _0x2adca3={},_0x4987c3={},_0x29202e={'count':0x0,'rows':[]};var _0x2d29a4=db['VtigerConfiguration']['rawAttributes'];_0x4987c3[_0x6cbb('0x34')]=_[_0x6cbb('0x35')](_0x2d29a4);var _0x3c02d0={'dateStart':_0x342041[_0x6cbb('0x36')][_0x6cbb('0x37')],'dateEnd':_0x342041['query']['dateEnd']};delete _0x342041[_0x6cbb('0x36')][_0x6cbb('0x37')];delete _0x342041['query'][_0x6cbb('0x38')];_0x4987c3[_0x6cbb('0x36')]=_[_0x6cbb('0x35')](_0x342041[_0x6cbb('0x36')]);_0x4987c3[_0x6cbb('0x39')]=_[_0x6cbb('0x3a')](_0x4987c3[_0x6cbb('0x34')],_0x4987c3[_0x6cbb('0x36')]);_0x2adca3[_0x6cbb('0x3b')]=_[_0x6cbb('0x3a')](_0x4987c3['model'],qs[_0x6cbb('0x3c')](_0x342041[_0x6cbb('0x36')][_0x6cbb('0x3c')]));_0x2adca3[_0x6cbb('0x3b')]=_0x2adca3[_0x6cbb('0x3b')]['length']?_0x2adca3[_0x6cbb('0x3b')]:_0x4987c3['model'];if(!_0x342041[_0x6cbb('0x36')][_0x6cbb('0x3d')](_0x6cbb('0x3e'))){_0x2adca3['limit']=qs[_0x6cbb('0x28')](_0x342041[_0x6cbb('0x36')][_0x6cbb('0x28')]);_0x2adca3['offset']=qs['offset'](_0x342041['query'][_0x6cbb('0x27')]);}_0x2adca3['order']=qs[_0x6cbb('0x3f')](_0x342041[_0x6cbb('0x36')][_0x6cbb('0x3f')]);_0x2adca3[_0x6cbb('0x40')]=qs[_0x6cbb('0x39')](_[_0x6cbb('0x41')](_0x342041['query'],_0x4987c3[_0x6cbb('0x39')]));if(_0x3c02d0[_0x6cbb('0x37')]){if(_0x3c02d0['dateEnd']){_0x3c02d0['dateEnd']=moment(_0x3c02d0[_0x6cbb('0x38')])[_0x6cbb('0x42')](0x1,_0x6cbb('0x43'));}else{_0x3c02d0[_0x6cbb('0x38')]=moment(_0x3c02d0['dateStart'])[_0x6cbb('0x42')](0x1,_0x6cbb('0x43'));}_['merge'](_0x2adca3['where'],{'createdAt':{'$gte':_0x3c02d0['dateStart'],'$lte':_0x3c02d0[_0x6cbb('0x38')]}});}if(_0x342041[_0x6cbb('0x36')][_0x6cbb('0x44')]){_0x2adca3[_0x6cbb('0x40')]=_['merge'](_0x2adca3[_0x6cbb('0x40')],{'$or':_[_0x6cbb('0x45')](_0x2d29a4,function(_0x2d92ce){if(_0x2d92ce[_0x6cbb('0x46')][_0x6cbb('0x47')]!=='VIRTUAL'){var _0x2f06b2={};_0x2f06b2[_0x2d92ce[_0x6cbb('0x48')]]={'$like':'%'+_0x342041['query'][_0x6cbb('0x44')]+'%'};return _0x2f06b2;}})});}_0x2adca3=_['merge']({},_0x2adca3,_0x342041['options']);var _0x4175ad={'where':_0x2adca3[_0x6cbb('0x40')]};return db[_0x6cbb('0x49')][_0x6cbb('0x4a')](_0x4175ad)[_0x6cbb('0x1b')](function(_0x4789ed){_0x29202e[_0x6cbb('0x4a')]=_0x4789ed;if(_0x342041[_0x6cbb('0x36')][_0x6cbb('0x4b')]){_0x2adca3['include']=[{'all':!![]}];}return db[_0x6cbb('0x49')][_0x6cbb('0x4c')](_0x2adca3);})[_0x6cbb('0x1b')](function(_0x2b0efd){_0x29202e[_0x6cbb('0x4d')]=_0x2b0efd;return _0x29202e;})[_0x6cbb('0x1b')](respondWithFilteredResult(_0x30a915,_0x2adca3))[_0x6cbb('0x4e')](handleError(_0x30a915,null));};exports['show']=function(_0x8ca527,_0xafd52e){var _0x1dce37={'raw':![],'where':{'id':_0x8ca527[_0x6cbb('0x4f')]['id']}},_0x385028={};_0x385028[_0x6cbb('0x34')]=_[_0x6cbb('0x35')](db[_0x6cbb('0x49')][_0x6cbb('0x50')]);_0x385028[_0x6cbb('0x36')]=_[_0x6cbb('0x35')](_0x8ca527[_0x6cbb('0x36')]);_0x385028[_0x6cbb('0x39')]=_[_0x6cbb('0x3a')](_0x385028['model'],_0x385028[_0x6cbb('0x36')]);_0x1dce37[_0x6cbb('0x3b')]=_[_0x6cbb('0x3a')](_0x385028[_0x6cbb('0x34')],qs[_0x6cbb('0x3c')](_0x8ca527['query'][_0x6cbb('0x3c')]));_0x1dce37[_0x6cbb('0x3b')]=_0x1dce37[_0x6cbb('0x3b')][_0x6cbb('0x51')]?_0x1dce37['attributes']:_0x385028[_0x6cbb('0x34')];if(_0x8ca527['query'][_0x6cbb('0x4b')]){_0x1dce37[_0x6cbb('0x52')]=[{'all':!![]}];}_0x1dce37=_[_0x6cbb('0x53')]({},_0x1dce37,_0x8ca527['options']);return db[_0x6cbb('0x49')]['find'](_0x1dce37)[_0x6cbb('0x1b')](handleEntityNotFound(_0xafd52e,null))[_0x6cbb('0x1b')](respondWithResult(_0xafd52e,null))[_0x6cbb('0x4e')](handleError(_0xafd52e,null));};exports[_0x6cbb('0x54')]=function(_0x2c5352,_0x404451){return db['VtigerConfiguration'][_0x6cbb('0x54')](_0x2c5352['body'],{})[_0x6cbb('0x1b')](respondWithResult(_0x404451,0xc9))[_0x6cbb('0x4e')](handleError(_0x404451,null));};exports[_0x6cbb('0x2e')]=function(_0x45d5a5,_0x152dd5){if(_0x45d5a5['body']['id']){delete _0x45d5a5[_0x6cbb('0x55')]['id'];}return db[_0x6cbb('0x49')][_0x6cbb('0x56')]({'where':{'id':_0x45d5a5[_0x6cbb('0x4f')]['id']}})[_0x6cbb('0x1b')](handleEntityNotFound(_0x152dd5,null))['then'](saveUpdates(_0x45d5a5[_0x6cbb('0x55')],null))[_0x6cbb('0x1b')](respondWithResult(_0x152dd5,null))[_0x6cbb('0x4e')](handleError(_0x152dd5,null));};exports['destroy']=function(_0x9c9a55,_0x281059){return db[_0x6cbb('0x49')][_0x6cbb('0x56')]({'where':{'id':_0x9c9a55[_0x6cbb('0x4f')]['id']}})[_0x6cbb('0x1b')](handleEntityNotFound(_0x281059,null))[_0x6cbb('0x1b')](removeEntity(_0x281059,null))[_0x6cbb('0x4e')](handleError(_0x281059,null));};exports['getFields']=function(_0x28df30,_0x4c1570,_0x812555){var _0x4d5fdb={};var _0x2801fb={};var _0x365c2a;var _0x5967df;return db['VtigerConfiguration'][_0x6cbb('0x57')]({'where':{'id':_0x28df30[_0x6cbb('0x4f')]['id']}})[_0x6cbb('0x1b')](handleEntityNotFound(_0x4c1570,null))['then'](function(_0x4ef1b2){if(_0x4ef1b2){_0x365c2a=_0x4ef1b2;_0x2801fb['model']=_[_0x6cbb('0x35')](db[_0x6cbb('0x58')][_0x6cbb('0x50')]);_0x2801fb['query']=_[_0x6cbb('0x35')](_0x28df30['query']);_0x2801fb[_0x6cbb('0x39')]=_[_0x6cbb('0x3a')](_0x2801fb[_0x6cbb('0x34')],_0x2801fb['query']);_0x4d5fdb[_0x6cbb('0x3b')]=_[_0x6cbb('0x3a')](_0x2801fb[_0x6cbb('0x34')],qs[_0x6cbb('0x3c')](_0x28df30['query'][_0x6cbb('0x3c')]));_0x4d5fdb[_0x6cbb('0x3b')]=_0x4d5fdb[_0x6cbb('0x3b')][_0x6cbb('0x51')]?_0x4d5fdb[_0x6cbb('0x3b')]:_0x2801fb[_0x6cbb('0x34')];_0x4d5fdb[_0x6cbb('0x59')]=qs[_0x6cbb('0x3f')](_0x28df30[_0x6cbb('0x36')][_0x6cbb('0x3f')]);_0x4d5fdb[_0x6cbb('0x40')]=qs['filters'](_[_0x6cbb('0x41')](_0x28df30['query'],_0x2801fb[_0x6cbb('0x39')]));if(_0x28df30[_0x6cbb('0x36')]['filter']){_0x4d5fdb[_0x6cbb('0x40')]=_[_0x6cbb('0x53')](_0x4d5fdb['where'],{'$or':_[_0x6cbb('0x45')](_0x4d5fdb[_0x6cbb('0x3b')],function(_0x4ac4fb){var _0x3952c6={};_0x3952c6[_0x4ac4fb]={'$like':'%'+_0x28df30['query'][_0x6cbb('0x44')]+'%'};return _0x3952c6;})});}_0x4d5fdb=_[_0x6cbb('0x53')]({},_0x4d5fdb,_0x28df30[_0x6cbb('0x5a')]);return _0x365c2a[_0x6cbb('0x5b')](_0x4d5fdb);}})['then'](function(_0x4cbcb3){if(_0x4cbcb3){_0x5967df=_0x4cbcb3['length'];if(!_0x28df30[_0x6cbb('0x36')][_0x6cbb('0x3d')](_0x6cbb('0x3e'))){_0x4d5fdb['limit']=qs[_0x6cbb('0x28')](_0x28df30[_0x6cbb('0x36')][_0x6cbb('0x28')]);_0x4d5fdb['offset']=qs[_0x6cbb('0x27')](_0x28df30[_0x6cbb('0x36')][_0x6cbb('0x27')]);}return _0x365c2a[_0x6cbb('0x5b')](_0x4d5fdb);}})[_0x6cbb('0x1b')](function(_0xb5a135){if(_0xb5a135){return _0xb5a135?{'count':_0x5967df,'rows':_0xb5a135}:null;}})[_0x6cbb('0x1b')](respondWithResult(_0x4c1570,null))[_0x6cbb('0x4e')](handleError(_0x4c1570,null));};exports['getSubjects']=function(_0x5f2648,_0x29a1f0,_0x44c222){var _0x391295={};var _0x2d9b8d={};var _0x5ec1c2;var _0x5eeaa0;return db[_0x6cbb('0x49')][_0x6cbb('0x57')]({'where':{'id':_0x5f2648['params']['id']}})['then'](handleEntityNotFound(_0x29a1f0,null))[_0x6cbb('0x1b')](function(_0x2563bf){if(_0x2563bf){_0x5ec1c2=_0x2563bf;_0x2d9b8d[_0x6cbb('0x34')]=_[_0x6cbb('0x35')](db[_0x6cbb('0x58')][_0x6cbb('0x50')]);_0x2d9b8d['query']=_[_0x6cbb('0x35')](_0x5f2648[_0x6cbb('0x36')]);_0x2d9b8d[_0x6cbb('0x39')]=_[_0x6cbb('0x3a')](_0x2d9b8d[_0x6cbb('0x34')],_0x2d9b8d[_0x6cbb('0x36')]);_0x391295['attributes']=_['intersection'](_0x2d9b8d['model'],qs[_0x6cbb('0x3c')](_0x5f2648[_0x6cbb('0x36')][_0x6cbb('0x3c')]));_0x391295[_0x6cbb('0x3b')]=_0x391295[_0x6cbb('0x3b')][_0x6cbb('0x51')]?_0x391295['attributes']:_0x2d9b8d[_0x6cbb('0x34')];_0x391295['order']=qs[_0x6cbb('0x3f')](_0x5f2648[_0x6cbb('0x36')]['sort']);_0x391295[_0x6cbb('0x40')]=qs[_0x6cbb('0x39')](_[_0x6cbb('0x41')](_0x5f2648['query'],_0x2d9b8d[_0x6cbb('0x39')]));if(_0x5f2648['query'][_0x6cbb('0x44')]){_0x391295['where']=_[_0x6cbb('0x53')](_0x391295['where'],{'$or':_['map'](_0x391295['attributes'],function(_0x2e3172){var _0x2efe1d={};_0x2efe1d[_0x2e3172]={'$like':'%'+_0x5f2648[_0x6cbb('0x36')][_0x6cbb('0x44')]+'%'};return _0x2efe1d;})});}_0x391295=_['merge']({},_0x391295,_0x5f2648[_0x6cbb('0x5a')]);return _0x5ec1c2[_0x6cbb('0x5c')](_0x391295);}})['then'](function(_0x3c7528){if(_0x3c7528){_0x5eeaa0=_0x3c7528[_0x6cbb('0x51')];if(!_0x5f2648['query'][_0x6cbb('0x3d')](_0x6cbb('0x3e'))){_0x391295[_0x6cbb('0x28')]=qs[_0x6cbb('0x28')](_0x5f2648[_0x6cbb('0x36')][_0x6cbb('0x28')]);_0x391295[_0x6cbb('0x27')]=qs[_0x6cbb('0x27')](_0x5f2648['query'][_0x6cbb('0x27')]);}return _0x5ec1c2[_0x6cbb('0x5c')](_0x391295);}})['then'](function(_0xe4d7a5){if(_0xe4d7a5){return _0xe4d7a5?{'count':_0x5eeaa0,'rows':_0xe4d7a5}:null;}})[_0x6cbb('0x1b')](respondWithResult(_0x29a1f0,null))[_0x6cbb('0x4e')](handleError(_0x29a1f0,null));};exports[_0x6cbb('0x5d')]=function(_0x40474e,_0x5255ac,_0x1f741b){var _0x2561a4={};var _0x5498ca={};var _0x564d67;var _0x2597c7;return db[_0x6cbb('0x49')][_0x6cbb('0x57')]({'where':{'id':_0x40474e[_0x6cbb('0x4f')]['id']}})[_0x6cbb('0x1b')](handleEntityNotFound(_0x5255ac,null))[_0x6cbb('0x1b')](function(_0x36849e){if(_0x36849e){_0x564d67=_0x36849e;_0x5498ca[_0x6cbb('0x34')]=_[_0x6cbb('0x35')](db[_0x6cbb('0x58')]['rawAttributes']);_0x5498ca[_0x6cbb('0x36')]=_[_0x6cbb('0x35')](_0x40474e[_0x6cbb('0x36')]);_0x5498ca['filters']=_[_0x6cbb('0x3a')](_0x5498ca[_0x6cbb('0x34')],_0x5498ca[_0x6cbb('0x36')]);_0x2561a4[_0x6cbb('0x3b')]=_['intersection'](_0x5498ca[_0x6cbb('0x34')],qs['fields'](_0x40474e[_0x6cbb('0x36')][_0x6cbb('0x3c')]));_0x2561a4[_0x6cbb('0x3b')]=_0x2561a4['attributes'][_0x6cbb('0x51')]?_0x2561a4[_0x6cbb('0x3b')]:_0x5498ca[_0x6cbb('0x34')];_0x2561a4['order']=qs[_0x6cbb('0x3f')](_0x40474e[_0x6cbb('0x36')][_0x6cbb('0x3f')]);_0x2561a4[_0x6cbb('0x40')]=qs[_0x6cbb('0x39')](_[_0x6cbb('0x41')](_0x40474e[_0x6cbb('0x36')],_0x5498ca['filters']));if(_0x40474e[_0x6cbb('0x36')][_0x6cbb('0x44')]){_0x2561a4['where']=_[_0x6cbb('0x53')](_0x2561a4[_0x6cbb('0x40')],{'$or':_[_0x6cbb('0x45')](_0x2561a4[_0x6cbb('0x3b')],function(_0x1b85a3){var _0x30a6b2={};_0x30a6b2[_0x1b85a3]={'$like':'%'+_0x40474e[_0x6cbb('0x36')][_0x6cbb('0x44')]+'%'};return _0x30a6b2;})});}_0x2561a4=_['merge']({},_0x2561a4,_0x40474e[_0x6cbb('0x5a')]);return _0x564d67[_0x6cbb('0x5d')](_0x2561a4);}})[_0x6cbb('0x1b')](function(_0x41e35e){if(_0x41e35e){_0x2597c7=_0x41e35e[_0x6cbb('0x51')];if(!_0x40474e[_0x6cbb('0x36')][_0x6cbb('0x3d')](_0x6cbb('0x3e'))){_0x2561a4[_0x6cbb('0x28')]=qs[_0x6cbb('0x28')](_0x40474e[_0x6cbb('0x36')][_0x6cbb('0x28')]);_0x2561a4['offset']=qs[_0x6cbb('0x27')](_0x40474e[_0x6cbb('0x36')]['offset']);}return _0x564d67[_0x6cbb('0x5d')](_0x2561a4);}})[_0x6cbb('0x1b')](function(_0x27f279){if(_0x27f279){return _0x27f279?{'count':_0x2597c7,'rows':_0x27f279}:null;}})['then'](respondWithResult(_0x5255ac,null))[_0x6cbb('0x4e')](handleError(_0x5255ac,null));};
\ No newline at end of file
+var _0xdb35=['field','options','includeAll','include','rows','show','params','create','body','find','getFields','VtigerField','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','apply','reject','save','update','destroy','name','send','VtigerConfiguration','rawAttributes','keys','query','dateStart','dateEnd','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','day','add','merge','filter','map','type','VIRTUAL'];(function(_0x3f4ba6,_0x133cd6){var _0x4fa5a3=function(_0x136d8b){while(--_0x136d8b){_0x3f4ba6['push'](_0x3f4ba6['shift']());}};_0x4fa5a3(++_0x133cd6);}(_0xdb35,0x6b));var _0x5db3=function(_0x44211d,_0x2f6292){_0x44211d=_0x44211d-0x0;var _0x4986c0=_0xdb35[_0x44211d];return _0x4986c0;};'use strict';var pdf=require(_0x5db3('0x0'));var emlformat=require(_0x5db3('0x1'));var rimraf=require(_0x5db3('0x2'));var zipdir=require(_0x5db3('0x3'));var jsonpatch=require(_0x5db3('0x4'));var rp=require(_0x5db3('0x5'));var moment=require('moment');var BPromise=require(_0x5db3('0x6'));var Mustache=require(_0x5db3('0x7'));var util=require(_0x5db3('0x8'));var path=require(_0x5db3('0x9'));var sox=require(_0x5db3('0xa'));var csv=require(_0x5db3('0xb'));var ejs=require(_0x5db3('0xc'));var fs=require('fs');var _=require(_0x5db3('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5db3('0xe'));var deskjs=require(_0x5db3('0xf'));var toCsv=require(_0x5db3('0xb'));var querystring=require(_0x5db3('0x10'));var Papa=require(_0x5db3('0x11'));var Redis=require(_0x5db3('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x5db3('0x13'))(_0x5db3('0x14'));var utils=require(_0x5db3('0x15'));var config=require(_0x5db3('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5db3('0x17'));var client=jayson[_0x5db3('0x18')][_0x5db3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x27ace1,_0x58cc73,_0x1a8f86,_0xc8ba7c){return new BPromise(function(_0x770248,_0x49d2d9){var _0x504a6a=_0xc8ba7c||client;return _0x504a6a[_0x5db3('0x1a')](_0x27ace1,_0x1a8f86)[_0x5db3('0x1b')](function(_0x55424a){logger[_0x5db3('0x1c')](_0x5db3('0x1d'),_0x58cc73,'request\x20sent');logger[_0x5db3('0x1e')](_0x5db3('0x1f'),_0x58cc73,_0x5db3('0x20'),JSON[_0x5db3('0x21')](_0x55424a));if(_0x55424a[_0x5db3('0x22')]){if(_0x55424a[_0x5db3('0x22')]['code']===0x1f4){logger[_0x5db3('0x22')](_0x5db3('0x1d'),_0x58cc73,_0x55424a[_0x5db3('0x22')][_0x5db3('0x23')]);return _0x49d2d9(_0x55424a[_0x5db3('0x22')]['message']);}logger[_0x5db3('0x22')](_0x5db3('0x1d'),_0x58cc73,_0x55424a[_0x5db3('0x22')][_0x5db3('0x23')]);return _0x770248(_0x55424a[_0x5db3('0x22')][_0x5db3('0x23')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x58cc73,_0x5db3('0x20'));_0x770248(_0x55424a[_0x5db3('0x24')][_0x5db3('0x23')]);}})[_0x5db3('0x25')](function(_0x10b44c){logger[_0x5db3('0x22')](_0x5db3('0x1d'),_0x58cc73,_0x10b44c);_0x49d2d9(_0x10b44c);});});}function respondWithStatusCode(_0x54347c,_0x4ce71e){_0x4ce71e=_0x4ce71e||0xcc;return function(_0x48e628){if(_0x48e628){return _0x54347c[_0x5db3('0x26')](_0x4ce71e);}return _0x54347c[_0x5db3('0x27')](_0x4ce71e)[_0x5db3('0x28')]();};}function respondWithResult(_0xed56a0,_0x3428c4){_0x3428c4=_0x3428c4||0xc8;return function(_0x252bea){if(_0x252bea){return _0xed56a0[_0x5db3('0x27')](_0x3428c4)[_0x5db3('0x29')](_0x252bea);}};}function respondWithFilteredResult(_0x46f92b,_0x191a83){return function(_0x519118){if(_0x519118){var _0x441272=_0x519118[_0x5db3('0x2a')],_0x5f0325=_0x191a83[_0x5db3('0x2b')],_0x225323=_0x191a83[_0x5db3('0x2b')]+_0x191a83['limit'],_0x2dc5d4;if(_0x225323>=_0x441272){_0x225323=_0x441272;_0x2dc5d4=0xc8;}else{_0x2dc5d4=0xce;}_0x46f92b['status'](_0x2dc5d4);return _0x46f92b['set']('Content-Range',_0x5f0325+'-'+_0x225323+'/'+_0x441272)[_0x5db3('0x29')](_0x519118);}return null;};}function patchUpdates(_0x240030){return function(_0x40d750){try{jsonpatch[_0x5db3('0x2c')](_0x40d750,_0x240030,!![]);}catch(_0x148866){return BPromise[_0x5db3('0x2d')](_0x148866);}return _0x40d750[_0x5db3('0x2e')]();};}function saveUpdates(_0x163250,_0x47eff7){return function(_0x330733){if(_0x330733){return _0x330733[_0x5db3('0x2f')](_0x163250)[_0x5db3('0x1b')](function(_0x18de82){return _0x18de82;});}return null;};}function removeEntity(_0x3d49ce,_0x4fdc68){return function(_0x5898ef){if(_0x5898ef){return _0x5898ef[_0x5db3('0x30')]()[_0x5db3('0x1b')](function(){_0x3d49ce[_0x5db3('0x27')](0xcc)[_0x5db3('0x28')]();});}};}function handleEntityNotFound(_0x59f4f7,_0x24ef04){return function(_0x4c8f04){if(!_0x4c8f04){_0x59f4f7[_0x5db3('0x26')](0x194);}return _0x4c8f04;};}function handleError(_0x5ef473,_0x4dbfa6){_0x4dbfa6=_0x4dbfa6||0x1f4;return function(_0x2a45e2){logger['error'](_0x2a45e2['stack']);if(_0x2a45e2[_0x5db3('0x31')]){delete _0x2a45e2[_0x5db3('0x31')];}_0x5ef473[_0x5db3('0x27')](_0x4dbfa6)[_0x5db3('0x32')](_0x2a45e2);};}exports['index']=function(_0x59e4f7,_0x3f98ff){var _0x3b91ec={},_0x105e1e={},_0x13bf0f={'count':0x0,'rows':[]};var _0x3bb8e3=db[_0x5db3('0x33')][_0x5db3('0x34')];_0x105e1e['model']=_[_0x5db3('0x35')](_0x3bb8e3);var _0x153b2e={'dateStart':_0x59e4f7[_0x5db3('0x36')][_0x5db3('0x37')],'dateEnd':_0x59e4f7[_0x5db3('0x36')][_0x5db3('0x38')]};delete _0x59e4f7[_0x5db3('0x36')][_0x5db3('0x37')];delete _0x59e4f7[_0x5db3('0x36')][_0x5db3('0x38')];_0x105e1e['query']=_[_0x5db3('0x35')](_0x59e4f7[_0x5db3('0x36')]);_0x105e1e[_0x5db3('0x39')]=_['intersection'](_0x105e1e[_0x5db3('0x3a')],_0x105e1e[_0x5db3('0x36')]);_0x3b91ec['attributes']=_[_0x5db3('0x3b')](_0x105e1e[_0x5db3('0x3a')],qs[_0x5db3('0x3c')](_0x59e4f7[_0x5db3('0x36')][_0x5db3('0x3c')]));_0x3b91ec[_0x5db3('0x3d')]=_0x3b91ec[_0x5db3('0x3d')][_0x5db3('0x3e')]?_0x3b91ec[_0x5db3('0x3d')]:_0x105e1e[_0x5db3('0x3a')];if(!_0x59e4f7['query'][_0x5db3('0x3f')](_0x5db3('0x40'))){_0x3b91ec[_0x5db3('0x41')]=qs[_0x5db3('0x41')](_0x59e4f7[_0x5db3('0x36')][_0x5db3('0x41')]);_0x3b91ec[_0x5db3('0x2b')]=qs[_0x5db3('0x2b')](_0x59e4f7[_0x5db3('0x36')][_0x5db3('0x2b')]);}_0x3b91ec[_0x5db3('0x42')]=qs[_0x5db3('0x43')](_0x59e4f7[_0x5db3('0x36')][_0x5db3('0x43')]);_0x3b91ec[_0x5db3('0x44')]=qs[_0x5db3('0x39')](_[_0x5db3('0x45')](_0x59e4f7[_0x5db3('0x36')],_0x105e1e['filters']));if(_0x153b2e[_0x5db3('0x37')]){if(_0x153b2e[_0x5db3('0x38')]){_0x153b2e['dateEnd']=moment(_0x153b2e[_0x5db3('0x38')])['add'](0x1,_0x5db3('0x46'));}else{_0x153b2e[_0x5db3('0x38')]=moment(_0x153b2e[_0x5db3('0x37')])[_0x5db3('0x47')](0x1,'day');}_[_0x5db3('0x48')](_0x3b91ec['where'],{'createdAt':{'$gte':_0x153b2e[_0x5db3('0x37')],'$lte':_0x153b2e[_0x5db3('0x38')]}});}if(_0x59e4f7[_0x5db3('0x36')][_0x5db3('0x49')]){_0x3b91ec['where']=_['merge'](_0x3b91ec[_0x5db3('0x44')],{'$or':_[_0x5db3('0x4a')](_0x3bb8e3,function(_0x3909c8){if(_0x3909c8[_0x5db3('0x4b')]['key']!==_0x5db3('0x4c')){var _0x41bf22={};_0x41bf22[_0x3909c8[_0x5db3('0x4d')]]={'$like':'%'+_0x59e4f7[_0x5db3('0x36')]['filter']+'%'};return _0x41bf22;}})});}_0x3b91ec=_[_0x5db3('0x48')]({},_0x3b91ec,_0x59e4f7[_0x5db3('0x4e')]);var _0x503a94={'where':_0x3b91ec[_0x5db3('0x44')]};return db['VtigerConfiguration'][_0x5db3('0x2a')](_0x503a94)[_0x5db3('0x1b')](function(_0x1b4965){_0x13bf0f[_0x5db3('0x2a')]=_0x1b4965;if(_0x59e4f7['query'][_0x5db3('0x4f')]){_0x3b91ec[_0x5db3('0x50')]=[{'all':!![]}];}return db[_0x5db3('0x33')]['findAll'](_0x3b91ec);})[_0x5db3('0x1b')](function(_0x24e43b){_0x13bf0f[_0x5db3('0x51')]=_0x24e43b;return _0x13bf0f;})[_0x5db3('0x1b')](respondWithFilteredResult(_0x3f98ff,_0x3b91ec))[_0x5db3('0x25')](handleError(_0x3f98ff,null));};exports[_0x5db3('0x52')]=function(_0x3095a1,_0x123ece){var _0xa1fd9e={'raw':![],'where':{'id':_0x3095a1[_0x5db3('0x53')]['id']}},_0x143929={};_0x143929[_0x5db3('0x3a')]=_[_0x5db3('0x35')](db[_0x5db3('0x33')][_0x5db3('0x34')]);_0x143929[_0x5db3('0x36')]=_['keys'](_0x3095a1['query']);_0x143929[_0x5db3('0x39')]=_['intersection'](_0x143929['model'],_0x143929[_0x5db3('0x36')]);_0xa1fd9e[_0x5db3('0x3d')]=_[_0x5db3('0x3b')](_0x143929['model'],qs[_0x5db3('0x3c')](_0x3095a1[_0x5db3('0x36')]['fields']));_0xa1fd9e['attributes']=_0xa1fd9e[_0x5db3('0x3d')][_0x5db3('0x3e')]?_0xa1fd9e[_0x5db3('0x3d')]:_0x143929['model'];if(_0x3095a1[_0x5db3('0x36')][_0x5db3('0x4f')]){_0xa1fd9e[_0x5db3('0x50')]=[{'all':!![]}];}_0xa1fd9e=_['merge']({},_0xa1fd9e,_0x3095a1[_0x5db3('0x4e')]);return db[_0x5db3('0x33')]['find'](_0xa1fd9e)[_0x5db3('0x1b')](handleEntityNotFound(_0x123ece,null))[_0x5db3('0x1b')](respondWithResult(_0x123ece,null))[_0x5db3('0x25')](handleError(_0x123ece,null));};exports['create']=function(_0x6e8cbd,_0x3c70eb){return db[_0x5db3('0x33')][_0x5db3('0x54')](_0x6e8cbd['body'],{})[_0x5db3('0x1b')](respondWithResult(_0x3c70eb,0xc9))[_0x5db3('0x25')](handleError(_0x3c70eb,null));};exports[_0x5db3('0x2f')]=function(_0x425ee9,_0x585f6a){if(_0x425ee9[_0x5db3('0x55')]['id']){delete _0x425ee9['body']['id'];}return db[_0x5db3('0x33')][_0x5db3('0x56')]({'where':{'id':_0x425ee9[_0x5db3('0x53')]['id']}})[_0x5db3('0x1b')](handleEntityNotFound(_0x585f6a,null))['then'](saveUpdates(_0x425ee9['body'],null))['then'](respondWithResult(_0x585f6a,null))[_0x5db3('0x25')](handleError(_0x585f6a,null));};exports[_0x5db3('0x30')]=function(_0x58cdd5,_0x17db26){return db['VtigerConfiguration'][_0x5db3('0x56')]({'where':{'id':_0x58cdd5[_0x5db3('0x53')]['id']}})['then'](handleEntityNotFound(_0x17db26,null))[_0x5db3('0x1b')](removeEntity(_0x17db26,null))['catch'](handleError(_0x17db26,null));};exports[_0x5db3('0x57')]=function(_0x7fccea,_0x3b2289,_0x436ffa){var _0x4d0f3b={};var _0x280067={};var _0x58ec9e;var _0x380e65;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x7fccea['params']['id']}})[_0x5db3('0x1b')](handleEntityNotFound(_0x3b2289,null))[_0x5db3('0x1b')](function(_0x490a71){if(_0x490a71){_0x58ec9e=_0x490a71;_0x280067[_0x5db3('0x3a')]=_[_0x5db3('0x35')](db[_0x5db3('0x58')][_0x5db3('0x34')]);_0x280067['query']=_[_0x5db3('0x35')](_0x7fccea[_0x5db3('0x36')]);_0x280067[_0x5db3('0x39')]=_[_0x5db3('0x3b')](_0x280067[_0x5db3('0x3a')],_0x280067[_0x5db3('0x36')]);_0x4d0f3b[_0x5db3('0x3d')]=_[_0x5db3('0x3b')](_0x280067['model'],qs[_0x5db3('0x3c')](_0x7fccea[_0x5db3('0x36')]['fields']));_0x4d0f3b[_0x5db3('0x3d')]=_0x4d0f3b[_0x5db3('0x3d')]['length']?_0x4d0f3b[_0x5db3('0x3d')]:_0x280067[_0x5db3('0x3a')];_0x4d0f3b[_0x5db3('0x42')]=qs[_0x5db3('0x43')](_0x7fccea[_0x5db3('0x36')][_0x5db3('0x43')]);_0x4d0f3b[_0x5db3('0x44')]=qs[_0x5db3('0x39')](_[_0x5db3('0x45')](_0x7fccea['query'],_0x280067['filters']));if(_0x7fccea[_0x5db3('0x36')][_0x5db3('0x49')]){_0x4d0f3b['where']=_[_0x5db3('0x48')](_0x4d0f3b[_0x5db3('0x44')],{'$or':_['map'](_0x4d0f3b['attributes'],function(_0x1a6d01){var _0xc624e2={};_0xc624e2[_0x1a6d01]={'$like':'%'+_0x7fccea[_0x5db3('0x36')][_0x5db3('0x49')]+'%'};return _0xc624e2;})});}_0x4d0f3b=_[_0x5db3('0x48')]({},_0x4d0f3b,_0x7fccea[_0x5db3('0x4e')]);return _0x58ec9e['getFields'](_0x4d0f3b);}})[_0x5db3('0x1b')](function(_0x5abbe9){if(_0x5abbe9){_0x380e65=_0x5abbe9[_0x5db3('0x3e')];if(!_0x7fccea[_0x5db3('0x36')][_0x5db3('0x3f')]('nolimit')){_0x4d0f3b[_0x5db3('0x41')]=qs['limit'](_0x7fccea[_0x5db3('0x36')][_0x5db3('0x41')]);_0x4d0f3b[_0x5db3('0x2b')]=qs[_0x5db3('0x2b')](_0x7fccea['query'][_0x5db3('0x2b')]);}return _0x58ec9e[_0x5db3('0x57')](_0x4d0f3b);}})[_0x5db3('0x1b')](function(_0x583d84){if(_0x583d84){return _0x583d84?{'count':_0x380e65,'rows':_0x583d84}:null;}})['then'](respondWithResult(_0x3b2289,null))[_0x5db3('0x25')](handleError(_0x3b2289,null));};exports['getSubjects']=function(_0xc7bc18,_0x23eeb4,_0x27b132){var _0xd59ddb={};var _0x23134f={};var _0x55ec43;var _0x3c5c4e;return db[_0x5db3('0x33')]['findOne']({'where':{'id':_0xc7bc18['params']['id']}})[_0x5db3('0x1b')](handleEntityNotFound(_0x23eeb4,null))['then'](function(_0x75d6da){if(_0x75d6da){_0x55ec43=_0x75d6da;_0x23134f['model']=_['keys'](db[_0x5db3('0x58')]['rawAttributes']);_0x23134f[_0x5db3('0x36')]=_[_0x5db3('0x35')](_0xc7bc18[_0x5db3('0x36')]);_0x23134f[_0x5db3('0x39')]=_['intersection'](_0x23134f[_0x5db3('0x3a')],_0x23134f['query']);_0xd59ddb[_0x5db3('0x3d')]=_[_0x5db3('0x3b')](_0x23134f[_0x5db3('0x3a')],qs[_0x5db3('0x3c')](_0xc7bc18['query']['fields']));_0xd59ddb[_0x5db3('0x3d')]=_0xd59ddb[_0x5db3('0x3d')][_0x5db3('0x3e')]?_0xd59ddb['attributes']:_0x23134f[_0x5db3('0x3a')];_0xd59ddb['order']=qs['sort'](_0xc7bc18[_0x5db3('0x36')]['sort']);_0xd59ddb[_0x5db3('0x44')]=qs[_0x5db3('0x39')](_[_0x5db3('0x45')](_0xc7bc18[_0x5db3('0x36')],_0x23134f[_0x5db3('0x39')]));if(_0xc7bc18[_0x5db3('0x36')][_0x5db3('0x49')]){_0xd59ddb[_0x5db3('0x44')]=_[_0x5db3('0x48')](_0xd59ddb[_0x5db3('0x44')],{'$or':_[_0x5db3('0x4a')](_0xd59ddb[_0x5db3('0x3d')],function(_0x24e377){var _0x431e11={};_0x431e11[_0x24e377]={'$like':'%'+_0xc7bc18[_0x5db3('0x36')][_0x5db3('0x49')]+'%'};return _0x431e11;})});}_0xd59ddb=_[_0x5db3('0x48')]({},_0xd59ddb,_0xc7bc18['options']);return _0x55ec43['getSubjects'](_0xd59ddb);}})[_0x5db3('0x1b')](function(_0x4f3b06){if(_0x4f3b06){_0x3c5c4e=_0x4f3b06[_0x5db3('0x3e')];if(!_0xc7bc18[_0x5db3('0x36')]['hasOwnProperty'](_0x5db3('0x40'))){_0xd59ddb[_0x5db3('0x41')]=qs[_0x5db3('0x41')](_0xc7bc18['query'][_0x5db3('0x41')]);_0xd59ddb[_0x5db3('0x2b')]=qs['offset'](_0xc7bc18[_0x5db3('0x36')][_0x5db3('0x2b')]);}return _0x55ec43[_0x5db3('0x59')](_0xd59ddb);}})[_0x5db3('0x1b')](function(_0x237726){if(_0x237726){return _0x237726?{'count':_0x3c5c4e,'rows':_0x237726}:null;}})['then'](respondWithResult(_0x23eeb4,null))[_0x5db3('0x25')](handleError(_0x23eeb4,null));};exports[_0x5db3('0x5a')]=function(_0x5a0595,_0x9cf036,_0x251f71){var _0x3d3f76={};var _0x1a2e9d={};var _0x389bad;var _0x5200cf;return db[_0x5db3('0x33')][_0x5db3('0x5b')]({'where':{'id':_0x5a0595[_0x5db3('0x53')]['id']}})[_0x5db3('0x1b')](handleEntityNotFound(_0x9cf036,null))[_0x5db3('0x1b')](function(_0xb68cd3){if(_0xb68cd3){_0x389bad=_0xb68cd3;_0x1a2e9d[_0x5db3('0x3a')]=_[_0x5db3('0x35')](db[_0x5db3('0x58')]['rawAttributes']);_0x1a2e9d['query']=_[_0x5db3('0x35')](_0x5a0595['query']);_0x1a2e9d[_0x5db3('0x39')]=_[_0x5db3('0x3b')](_0x1a2e9d['model'],_0x1a2e9d[_0x5db3('0x36')]);_0x3d3f76[_0x5db3('0x3d')]=_[_0x5db3('0x3b')](_0x1a2e9d[_0x5db3('0x3a')],qs['fields'](_0x5a0595[_0x5db3('0x36')][_0x5db3('0x3c')]));_0x3d3f76[_0x5db3('0x3d')]=_0x3d3f76[_0x5db3('0x3d')][_0x5db3('0x3e')]?_0x3d3f76['attributes']:_0x1a2e9d[_0x5db3('0x3a')];_0x3d3f76[_0x5db3('0x42')]=qs[_0x5db3('0x43')](_0x5a0595[_0x5db3('0x36')][_0x5db3('0x43')]);_0x3d3f76['where']=qs['filters'](_['pick'](_0x5a0595[_0x5db3('0x36')],_0x1a2e9d[_0x5db3('0x39')]));if(_0x5a0595[_0x5db3('0x36')][_0x5db3('0x49')]){_0x3d3f76[_0x5db3('0x44')]=_['merge'](_0x3d3f76['where'],{'$or':_[_0x5db3('0x4a')](_0x3d3f76[_0x5db3('0x3d')],function(_0x1bb759){var _0x4d3fac={};_0x4d3fac[_0x1bb759]={'$like':'%'+_0x5a0595[_0x5db3('0x36')][_0x5db3('0x49')]+'%'};return _0x4d3fac;})});}_0x3d3f76=_['merge']({},_0x3d3f76,_0x5a0595[_0x5db3('0x4e')]);return _0x389bad['getDescriptions'](_0x3d3f76);}})[_0x5db3('0x1b')](function(_0x515dba){if(_0x515dba){_0x5200cf=_0x515dba[_0x5db3('0x3e')];if(!_0x5a0595[_0x5db3('0x36')][_0x5db3('0x3f')](_0x5db3('0x40'))){_0x3d3f76[_0x5db3('0x41')]=qs['limit'](_0x5a0595[_0x5db3('0x36')]['limit']);_0x3d3f76[_0x5db3('0x2b')]=qs['offset'](_0x5a0595[_0x5db3('0x36')][_0x5db3('0x2b')]);}return _0x389bad[_0x5db3('0x5a')](_0x3d3f76);}})[_0x5db3('0x1b')](function(_0x258f58){if(_0x258f58){return _0x258f58?{'count':_0x5200cf,'rows':_0x258f58}:null;}})['then'](respondWithResult(_0x9cf036,null))[_0x5db3('0x25')](handleError(_0x9cf036,null));};
\ No newline at end of file
index f2f8bbc..442a33c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63e5=['util','../../config/logger','api','moment','request-promise','./intVtigerConfiguration.attributes','exports','define'];(function(_0x486684,_0x56b2c8){var _0x56278b=function(_0x4be895){while(--_0x4be895){_0x486684['push'](_0x486684['shift']());}};_0x56278b(++_0x56b2c8);}(_0x63e5,0x150));var _0x563e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x63e5[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require(_0x563e('0x0'));var logger=require(_0x563e('0x1'))(_0x563e('0x2'));var moment=require(_0x563e('0x3'));var BPromise=require('bluebird');var rp=require(_0x563e('0x4'));var attributes=require(_0x563e('0x5'));module[_0x563e('0x6')]=function(_0x356038,_0x3955e3){return _0x356038[_0x563e('0x7')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5145=['bluebird','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x51af72,_0x452087){var _0x46e192=function(_0x5972d2){while(--_0x5972d2){_0x51af72['push'](_0x51af72['shift']());}};_0x46e192(++_0x452087);}(_0x5145,0xd7));var _0x5514=function(_0xbca487,_0x50415d){_0xbca487=_0xbca487-0x0;var _0x4af2d1=_0x5145[_0xbca487];return _0x4af2d1;};'use strict';var _=require(_0x5514('0x0'));var util=require(_0x5514('0x1'));var logger=require(_0x5514('0x2'))(_0x5514('0x3'));var moment=require(_0x5514('0x4'));var BPromise=require(_0x5514('0x5'));var rp=require('request-promise');var attributes=require(_0x5514('0x6'));module[_0x5514('0x7')]=function(_0x3bca1f,_0x20e262){return _0x3bca1f[_0x5514('0x8')](_0x5514('0x9'),attributes,{'tableName':_0x5514('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cbd9884..d0952be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e1=['request','then','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4bbbfe,_0xcf1d6d){var _0x4ecb82=function(_0x1c97ae){while(--_0x1c97ae){_0x4bbbfe['push'](_0x4bbbfe['shift']());}};_0x4ecb82(++_0xcf1d6d);}(_0xa3e1,0x144));var _0x1a3e=function(_0xf73390,_0x14c109){_0xf73390=_0xf73390-0x0;var _0x4b212f=_0xa3e1[_0xf73390];return _0x4b212f;};'use strict';var _=require('lodash');var util=require(_0x1a3e('0x0'));var moment=require(_0x1a3e('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a3e('0x2'));var fs=require('fs');var Redis=require(_0x1a3e('0x3'));var db=require(_0x1a3e('0x4'))['db'];var utils=require(_0x1a3e('0x5'));var logger=require(_0x1a3e('0x6'))(_0x1a3e('0x7'));var config=require(_0x1a3e('0x8'));var jayson=require(_0x1a3e('0x9'));var client=jayson[_0x1a3e('0xa')][_0x1a3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5bcd,_0x5c3c98,_0x35ef10){return new BPromise(function(_0x4944d0,_0x5e974b){return client[_0x1a3e('0xc')](_0x4f5bcd,_0x35ef10)[_0x1a3e('0xd')](function(_0x44232c){logger['info'](_0x1a3e('0xe'),_0x5c3c98,'request\x20sent');logger[_0x1a3e('0xf')](_0x1a3e('0x10'),_0x5c3c98,_0x1a3e('0x11'),JSON[_0x1a3e('0x12')](_0x44232c));if(_0x44232c[_0x1a3e('0x13')]){if(_0x44232c[_0x1a3e('0x13')][_0x1a3e('0x14')]===0x1f4){logger['error'](_0x1a3e('0xe'),_0x5c3c98,_0x44232c[_0x1a3e('0x13')][_0x1a3e('0x15')]);return _0x5e974b(_0x44232c['error']['message']);}logger[_0x1a3e('0x13')](_0x1a3e('0xe'),_0x5c3c98,_0x44232c[_0x1a3e('0x13')][_0x1a3e('0x15')]);return _0x4944d0(_0x44232c[_0x1a3e('0x13')][_0x1a3e('0x15')]);}else{logger[_0x1a3e('0x16')](_0x1a3e('0xe'),_0x5c3c98,_0x1a3e('0x11'));_0x4944d0(_0x44232c[_0x1a3e('0x17')][_0x1a3e('0x15')]);}})['catch'](function(_0x56ef1f){logger['error'](_0x1a3e('0xe'),_0x5c3c98,_0x56ef1f);_0x5e974b(_0x56ef1f);});});}
\ No newline at end of file
+var _0x2569=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3e0bfc,_0xbf39f2){var _0x988f44=function(_0x510a8f){while(--_0x510a8f){_0x3e0bfc['push'](_0x3e0bfc['shift']());}};_0x988f44(++_0xbf39f2);}(_0x2569,0x1cf));var _0x9256=function(_0x43c394,_0x2d9e21){_0x43c394=_0x43c394-0x0;var _0x50f077=_0x2569[_0x43c394];return _0x50f077;};'use strict';var _=require(_0x9256('0x0'));var util=require(_0x9256('0x1'));var moment=require(_0x9256('0x2'));var BPromise=require(_0x9256('0x3'));var rs=require(_0x9256('0x4'));var fs=require('fs');var Redis=require(_0x9256('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9256('0x6'));var logger=require(_0x9256('0x7'))(_0x9256('0x8'));var config=require('../../config/environment');var jayson=require(_0x9256('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11c238,_0x31077c,_0x2dbacb){return new BPromise(function(_0x3bd298,_0x475a7c){return client['request'](_0x11c238,_0x2dbacb)[_0x9256('0xa')](function(_0x5cf062){logger[_0x9256('0xb')](_0x9256('0xc'),_0x31077c,_0x9256('0xd'));logger[_0x9256('0xe')](_0x9256('0xf'),_0x31077c,_0x9256('0xd'),JSON['stringify'](_0x5cf062));if(_0x5cf062[_0x9256('0x10')]){if(_0x5cf062[_0x9256('0x10')][_0x9256('0x11')]===0x1f4){logger[_0x9256('0x10')](_0x9256('0xc'),_0x31077c,_0x5cf062[_0x9256('0x10')][_0x9256('0x12')]);return _0x475a7c(_0x5cf062[_0x9256('0x10')][_0x9256('0x12')]);}logger[_0x9256('0x10')](_0x9256('0xc'),_0x31077c,_0x5cf062['error'][_0x9256('0x12')]);return _0x3bd298(_0x5cf062['error'][_0x9256('0x12')]);}else{logger[_0x9256('0xb')](_0x9256('0xc'),_0x31077c,_0x9256('0xd'));_0x3bd298(_0x5cf062[_0x9256('0x13')][_0x9256('0x12')]);}})[_0x9256('0x14')](function(_0x43acdc){logger[_0x9256('0x10')](_0x9256('0xc'),_0x31077c,_0x43acdc);_0x475a7c(_0x43acdc);});});}
\ No newline at end of file
index 5645599..60a0e26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8917=['put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x25a6cc,_0xcc8370){var _0x35baf4=function(_0x125711){while(--_0x125711){_0x25a6cc['push'](_0x25a6cc['shift']());}};_0x35baf4(++_0xcc8370);}(_0x8917,0x121));var _0x7891=function(_0x4269de,_0x363fdd){_0x4269de=_0x4269de-0x0;var _0x2a39fd=_0x8917[_0x4269de];return _0x2a39fd;};'use strict';var multer=require('multer');var util=require(_0x7891('0x0'));var path=require(_0x7891('0x1'));var timeout=require(_0x7891('0x2'));var express=require(_0x7891('0x3'));var router=express[_0x7891('0x4')]();var auth=require(_0x7891('0x5'));var interaction=require(_0x7891('0x6'));var config=require(_0x7891('0x7'));var controller=require('./intVtigerField.controller');router[_0x7891('0x8')]('/',auth[_0x7891('0x9')](),controller[_0x7891('0xa')]);router['get'](_0x7891('0xb'),auth['isAuthenticated'](),controller[_0x7891('0xc')]);router[_0x7891('0xd')]('/',auth['isAuthenticated'](),controller[_0x7891('0xe')]);router[_0x7891('0xf')](_0x7891('0xb'),auth[_0x7891('0x9')](),controller[_0x7891('0x10')]);router[_0x7891('0x11')](_0x7891('0xb'),auth[_0x7891('0x9')](),controller[_0x7891('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xb4b8=['../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5d3ca5,_0x158510){var _0x4d589d=function(_0x5f1321){while(--_0x5f1321){_0x5d3ca5['push'](_0x5d3ca5['shift']());}};_0x4d589d(++_0x158510);}(_0xb4b8,0x1d9));var _0x8b4b=function(_0xde34a5,_0x1eee80){_0xde34a5=_0xde34a5-0x0;var _0x29c656=_0xb4b8[_0xde34a5];return _0x29c656;};'use strict';var multer=require(_0x8b4b('0x0'));var util=require(_0x8b4b('0x1'));var path=require(_0x8b4b('0x2'));var timeout=require(_0x8b4b('0x3'));var express=require(_0x8b4b('0x4'));var router=express[_0x8b4b('0x5')]();var auth=require(_0x8b4b('0x6'));var interaction=require(_0x8b4b('0x7'));var config=require(_0x8b4b('0x8'));var controller=require(_0x8b4b('0x9'));router[_0x8b4b('0xa')]('/',auth[_0x8b4b('0xb')](),controller[_0x8b4b('0xc')]);router[_0x8b4b('0xa')](_0x8b4b('0xd'),auth[_0x8b4b('0xb')](),controller[_0x8b4b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8b4b('0xf')]);router[_0x8b4b('0x10')](_0x8b4b('0xd'),auth[_0x8b4b('0xb')](),controller[_0x8b4b('0x11')]);router['delete'](_0x8b4b('0xd'),auth['isAuthenticated'](),controller[_0x8b4b('0x12')]);module[_0x8b4b('0x13')]=router;
\ No newline at end of file
index 18398c4..ab426ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x26a56a,_0x270ee9){var _0x36d273=function(_0x3b836b){while(--_0x3b836b){_0x26a56a['push'](_0x26a56a['shift']());}};_0x36d273(++_0x270ee9);}(_0xb688,0xcf));var _0x8b68=function(_0x181061,_0x455557){_0x181061=_0x181061-0x0;var _0x57eda3=_0xb688[_0x181061];return _0x57eda3;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}};
\ No newline at end of file
+var _0x9c00=['sequelize','exports','variable','customVariable','string','STRING','ENUM','BOOLEAN'];(function(_0x34f541,_0x3132a3){var _0x250979=function(_0x5a5187){while(--_0x5a5187){_0x34f541['push'](_0x34f541['shift']());}};_0x250979(++_0x3132a3);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x9c00[_0x2ef8f1];return _0x17498d;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x09c0('0x2'),_0x09c0('0x3'),'keyValue'),'defaultValue':_0x09c0('0x4')},'content':{'type':Sequelize[_0x09c0('0x5')]},'key':{'type':Sequelize[_0x09c0('0x5')]},'keyType':{'type':Sequelize[_0x09c0('0x6')](_0x09c0('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x09c0('0x5')]},'idField':{'type':Sequelize[_0x09c0('0x5')]},'nameField':{'type':Sequelize[_0x09c0('0x5')]},'customField':{'type':Sequelize[_0x09c0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x09c0('0x5')]}};
\ No newline at end of file
index 5a6eb26..4d65309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e79=['name','send','index','VtigerField','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','filter','map','key','VIRTUAL','field','count','include','rows','show','options','find','catch','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack'];(function(_0x4e8706,_0x4bfa96){var _0x30a322=function(_0x58e0f0){while(--_0x58e0f0){_0x4e8706['push'](_0x4e8706['shift']());}};_0x30a322(++_0x4bfa96);}(_0x9e79,0xba));var _0x99e7=function(_0x2b4e1c,_0x25a2a1){_0x2b4e1c=_0x2b4e1c-0x0;var _0x2036b8=_0x9e79[_0x2b4e1c];return _0x2036b8;};'use strict';var pdf=require(_0x99e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x99e7('0x1'));var zipdir=require(_0x99e7('0x2'));var jsonpatch=require(_0x99e7('0x3'));var rp=require(_0x99e7('0x4'));var moment=require(_0x99e7('0x5'));var BPromise=require(_0x99e7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x99e7('0x7'));var sox=require(_0x99e7('0x8'));var csv=require(_0x99e7('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x99e7('0xa'));var squel=require(_0x99e7('0xb'));var crypto=require(_0x99e7('0xc'));var jsforce=require(_0x99e7('0xd'));var deskjs=require(_0x99e7('0xe'));var toCsv=require(_0x99e7('0x9'));var querystring=require(_0x99e7('0xf'));var Papa=require(_0x99e7('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x99e7('0x11'))(_0x99e7('0x12'));var utils=require(_0x99e7('0x13'));var config=require(_0x99e7('0x14'));var db=require(_0x99e7('0x15'))['db'];function respondWithStatusCode(_0x1ccb4d,_0x308243){_0x308243=_0x308243||0xcc;return function(_0x53d086){if(_0x53d086){return _0x1ccb4d['sendStatus'](_0x308243);}return _0x1ccb4d[_0x99e7('0x16')](_0x308243)[_0x99e7('0x17')]();};}function respondWithResult(_0x504e6f,_0x2c08cd){_0x2c08cd=_0x2c08cd||0xc8;return function(_0x19a138){if(_0x19a138){return _0x504e6f[_0x99e7('0x16')](_0x2c08cd)[_0x99e7('0x18')](_0x19a138);}};}function respondWithFilteredResult(_0x584ba5,_0x4951b7){return function(_0x5b4776){if(_0x5b4776){var _0x456844=_0x5b4776['count'],_0x6ca0d1=_0x4951b7[_0x99e7('0x19')],_0x35cfab=_0x4951b7['offset']+_0x4951b7[_0x99e7('0x1a')],_0x4d790c;if(_0x35cfab>=_0x456844){_0x35cfab=_0x456844;_0x4d790c=0xc8;}else{_0x4d790c=0xce;}_0x584ba5[_0x99e7('0x16')](_0x4d790c);return _0x584ba5[_0x99e7('0x1b')](_0x99e7('0x1c'),_0x6ca0d1+'-'+_0x35cfab+'/'+_0x456844)[_0x99e7('0x18')](_0x5b4776);}return null;};}function patchUpdates(_0x50d250){return function(_0x26c5b6){try{jsonpatch[_0x99e7('0x1d')](_0x26c5b6,_0x50d250,!![]);}catch(_0xc326fa){return BPromise[_0x99e7('0x1e')](_0xc326fa);}return _0x26c5b6[_0x99e7('0x1f')]();};}function saveUpdates(_0x57b28a,_0x3eda8c){return function(_0x51ca87){if(_0x51ca87){return _0x51ca87['update'](_0x57b28a)['then'](function(_0x20cf4b){return _0x20cf4b;});}return null;};}function removeEntity(_0x505429,_0x135954){return function(_0x4e0e91){if(_0x4e0e91){return _0x4e0e91[_0x99e7('0x20')]()[_0x99e7('0x21')](function(){_0x505429[_0x99e7('0x16')](0xcc)[_0x99e7('0x17')]();});}};}function handleEntityNotFound(_0x55c74f,_0x2b9150){return function(_0x5f08e7){if(!_0x5f08e7){_0x55c74f[_0x99e7('0x22')](0x194);}return _0x5f08e7;};}function handleError(_0x1664a7,_0x10a59b){_0x10a59b=_0x10a59b||0x1f4;return function(_0x83949b){logger['error'](_0x83949b[_0x99e7('0x23')]);if(_0x83949b[_0x99e7('0x24')]){delete _0x83949b[_0x99e7('0x24')];}_0x1664a7[_0x99e7('0x16')](_0x10a59b)[_0x99e7('0x25')](_0x83949b);};}exports[_0x99e7('0x26')]=function(_0x5af528,_0x340e90){var _0x327857={},_0x38a912={},_0xedf2e2={'count':0x0,'rows':[]};var _0x25f13b=db[_0x99e7('0x27')][_0x99e7('0x28')];_0x38a912[_0x99e7('0x29')]=_[_0x99e7('0x2a')](_0x25f13b);var _0x594ab2={'dateStart':_0x5af528[_0x99e7('0x2b')]['dateStart'],'dateEnd':_0x5af528['query'][_0x99e7('0x2c')]};delete _0x5af528[_0x99e7('0x2b')][_0x99e7('0x2d')];delete _0x5af528[_0x99e7('0x2b')][_0x99e7('0x2c')];_0x38a912[_0x99e7('0x2b')]=_[_0x99e7('0x2a')](_0x5af528[_0x99e7('0x2b')]);_0x38a912[_0x99e7('0x2e')]=_[_0x99e7('0x2f')](_0x38a912[_0x99e7('0x29')],_0x38a912['query']);_0x327857[_0x99e7('0x30')]=_[_0x99e7('0x2f')](_0x38a912['model'],qs[_0x99e7('0x31')](_0x5af528[_0x99e7('0x2b')][_0x99e7('0x31')]));_0x327857[_0x99e7('0x30')]=_0x327857['attributes'][_0x99e7('0x32')]?_0x327857[_0x99e7('0x30')]:_0x38a912[_0x99e7('0x29')];if(!_0x5af528['query'][_0x99e7('0x33')](_0x99e7('0x34'))){_0x327857[_0x99e7('0x1a')]=qs[_0x99e7('0x1a')](_0x5af528['query'][_0x99e7('0x1a')]);_0x327857[_0x99e7('0x19')]=qs[_0x99e7('0x19')](_0x5af528['query'][_0x99e7('0x19')]);}_0x327857['order']=qs['sort'](_0x5af528[_0x99e7('0x2b')][_0x99e7('0x35')]);_0x327857[_0x99e7('0x36')]=qs[_0x99e7('0x2e')](_[_0x99e7('0x37')](_0x5af528['query'],_0x38a912[_0x99e7('0x2e')]));if(_0x594ab2[_0x99e7('0x2d')]){if(_0x594ab2[_0x99e7('0x2c')]){_0x594ab2['dateEnd']=moment(_0x594ab2[_0x99e7('0x2c')])[_0x99e7('0x38')](0x1,_0x99e7('0x39'));}else{_0x594ab2[_0x99e7('0x2c')]=moment(_0x594ab2[_0x99e7('0x2d')])[_0x99e7('0x38')](0x1,_0x99e7('0x39'));}_[_0x99e7('0x3a')](_0x327857[_0x99e7('0x36')],{'createdAt':{'$gte':_0x594ab2[_0x99e7('0x2d')],'$lte':_0x594ab2[_0x99e7('0x2c')]}});}if(_0x5af528[_0x99e7('0x2b')][_0x99e7('0x3b')]){_0x327857['where']=_[_0x99e7('0x3a')](_0x327857[_0x99e7('0x36')],{'$or':_[_0x99e7('0x3c')](_0x25f13b,function(_0x37a0eb){if(_0x37a0eb['type'][_0x99e7('0x3d')]!==_0x99e7('0x3e')){var _0x3f984e={};_0x3f984e[_0x37a0eb[_0x99e7('0x3f')]]={'$like':'%'+_0x5af528[_0x99e7('0x2b')][_0x99e7('0x3b')]+'%'};return _0x3f984e;}})});}_0x327857=_[_0x99e7('0x3a')]({},_0x327857,_0x5af528['options']);var _0x5aa353={'where':_0x327857[_0x99e7('0x36')]};return db['VtigerField']['count'](_0x5aa353)[_0x99e7('0x21')](function(_0x2b540d){_0xedf2e2[_0x99e7('0x40')]=_0x2b540d;if(_0x5af528[_0x99e7('0x2b')]['includeAll']){_0x327857[_0x99e7('0x41')]=[{'all':!![]}];}return db[_0x99e7('0x27')]['findAll'](_0x327857);})[_0x99e7('0x21')](function(_0x27aa99){_0xedf2e2[_0x99e7('0x42')]=_0x27aa99;return _0xedf2e2;})[_0x99e7('0x21')](respondWithFilteredResult(_0x340e90,_0x327857))['catch'](handleError(_0x340e90,null));};exports[_0x99e7('0x43')]=function(_0x3345d5,_0x237071){var _0x135b7b={'raw':!![],'where':{'id':_0x3345d5['params']['id']}},_0x262e8b={};_0x262e8b['model']=_[_0x99e7('0x2a')](db['VtigerField'][_0x99e7('0x28')]);_0x262e8b['query']=_[_0x99e7('0x2a')](_0x3345d5[_0x99e7('0x2b')]);_0x262e8b[_0x99e7('0x2e')]=_[_0x99e7('0x2f')](_0x262e8b['model'],_0x262e8b[_0x99e7('0x2b')]);_0x135b7b[_0x99e7('0x30')]=_[_0x99e7('0x2f')](_0x262e8b[_0x99e7('0x29')],qs['fields'](_0x3345d5[_0x99e7('0x2b')]['fields']));_0x135b7b[_0x99e7('0x30')]=_0x135b7b[_0x99e7('0x30')][_0x99e7('0x32')]?_0x135b7b[_0x99e7('0x30')]:_0x262e8b[_0x99e7('0x29')];if(_0x3345d5['query']['includeAll']){_0x135b7b[_0x99e7('0x41')]=[{'all':!![]}];}_0x135b7b=_[_0x99e7('0x3a')]({},_0x135b7b,_0x3345d5[_0x99e7('0x44')]);return db[_0x99e7('0x27')][_0x99e7('0x45')](_0x135b7b)[_0x99e7('0x21')](handleEntityNotFound(_0x237071,null))['then'](respondWithResult(_0x237071,null))[_0x99e7('0x46')](handleError(_0x237071,null));};exports[_0x99e7('0x47')]=function(_0x5cd993,_0x565bb9){return db[_0x99e7('0x27')][_0x99e7('0x47')](_0x5cd993[_0x99e7('0x48')],{})[_0x99e7('0x21')](respondWithResult(_0x565bb9,0xc9))[_0x99e7('0x46')](handleError(_0x565bb9,null));};exports['update']=function(_0x54b681,_0x1ac639){if(_0x54b681['body']['id']){delete _0x54b681[_0x99e7('0x48')]['id'];}return db['VtigerField'][_0x99e7('0x45')]({'where':{'id':_0x54b681[_0x99e7('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ac639,null))[_0x99e7('0x21')](saveUpdates(_0x54b681[_0x99e7('0x48')],null))[_0x99e7('0x21')](respondWithResult(_0x1ac639,null))[_0x99e7('0x46')](handleError(_0x1ac639,null));};exports[_0x99e7('0x20')]=function(_0x3f235b,_0x497fa0){return db['VtigerField'][_0x99e7('0x45')]({'where':{'id':_0x3f235b['params']['id']}})[_0x99e7('0x21')](handleEntityNotFound(_0x497fa0,null))[_0x99e7('0x21')](removeEntity(_0x497fa0,null))[_0x99e7('0x46')](handleError(_0x497fa0,null));};
\ No newline at end of file
+var _0xe5b0=['apply','reject','update','then','destroy','end','error','stack','send','index','VtigerField','rawAttributes','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','add','day','merge','filter','map','type','key','VIRTUAL','field','options','count','include','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','json','offset','limit','set','Content-Range'];(function(_0x4903c4,_0x181043){var _0xd0e929=function(_0x429edb){while(--_0x429edb){_0x4903c4['push'](_0x4903c4['shift']());}};_0xd0e929(++_0x181043);}(_0xe5b0,0x1e4));var _0x0e5b=function(_0xac72a8,_0x1a539e){_0xac72a8=_0xac72a8-0x0;var _0x22553a=_0xe5b0[_0xac72a8];return _0x22553a;};'use strict';var pdf=require(_0x0e5b('0x0'));var emlformat=require(_0x0e5b('0x1'));var rimraf=require(_0x0e5b('0x2'));var zipdir=require(_0x0e5b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e5b('0x4'));var BPromise=require(_0x0e5b('0x5'));var Mustache=require(_0x0e5b('0x6'));var util=require(_0x0e5b('0x7'));var path=require('path');var sox=require(_0x0e5b('0x8'));var csv=require(_0x0e5b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e5b('0xa'));var squel=require(_0x0e5b('0xb'));var crypto=require(_0x0e5b('0xc'));var jsforce=require(_0x0e5b('0xd'));var deskjs=require(_0x0e5b('0xe'));var toCsv=require(_0x0e5b('0x9'));var querystring=require(_0x0e5b('0xf'));var Papa=require('papaparse');var Redis=require(_0x0e5b('0x10'));var qs=require(_0x0e5b('0x11'));var logger=require(_0x0e5b('0x12'))('api');var utils=require(_0x0e5b('0x13'));var config=require('../../config/environment');var db=require(_0x0e5b('0x14'))['db'];function respondWithStatusCode(_0x4c2602,_0x3e2a92){_0x3e2a92=_0x3e2a92||0xcc;return function(_0x3e2382){if(_0x3e2382){return _0x4c2602['sendStatus'](_0x3e2a92);}return _0x4c2602[_0x0e5b('0x15')](_0x3e2a92)['end']();};}function respondWithResult(_0x2c47bf,_0x539061){_0x539061=_0x539061||0xc8;return function(_0x30cdbb){if(_0x30cdbb){return _0x2c47bf['status'](_0x539061)[_0x0e5b('0x16')](_0x30cdbb);}};}function respondWithFilteredResult(_0x560c5f,_0x4bc36f){return function(_0x444592){if(_0x444592){var _0x50a02f=_0x444592['count'],_0x13b494=_0x4bc36f[_0x0e5b('0x17')],_0x5492ff=_0x4bc36f[_0x0e5b('0x17')]+_0x4bc36f[_0x0e5b('0x18')],_0x328385;if(_0x5492ff>=_0x50a02f){_0x5492ff=_0x50a02f;_0x328385=0xc8;}else{_0x328385=0xce;}_0x560c5f[_0x0e5b('0x15')](_0x328385);return _0x560c5f[_0x0e5b('0x19')](_0x0e5b('0x1a'),_0x13b494+'-'+_0x5492ff+'/'+_0x50a02f)[_0x0e5b('0x16')](_0x444592);}return null;};}function patchUpdates(_0x21c786){return function(_0x11cc16){try{jsonpatch[_0x0e5b('0x1b')](_0x11cc16,_0x21c786,!![]);}catch(_0x367e32){return BPromise[_0x0e5b('0x1c')](_0x367e32);}return _0x11cc16['save']();};}function saveUpdates(_0x526aec,_0x59c551){return function(_0x276117){if(_0x276117){return _0x276117[_0x0e5b('0x1d')](_0x526aec)[_0x0e5b('0x1e')](function(_0x1f8e3d){return _0x1f8e3d;});}return null;};}function removeEntity(_0xa33188,_0x4d226f){return function(_0x560b30){if(_0x560b30){return _0x560b30[_0x0e5b('0x1f')]()['then'](function(){_0xa33188['status'](0xcc)[_0x0e5b('0x20')]();});}};}function handleEntityNotFound(_0x7c2210,_0x11a819){return function(_0x10aa3a){if(!_0x10aa3a){_0x7c2210['sendStatus'](0x194);}return _0x10aa3a;};}function handleError(_0x3aa8b3,_0x429032){_0x429032=_0x429032||0x1f4;return function(_0x7f8bd0){logger[_0x0e5b('0x21')](_0x7f8bd0[_0x0e5b('0x22')]);if(_0x7f8bd0['name']){delete _0x7f8bd0['name'];}_0x3aa8b3['status'](_0x429032)[_0x0e5b('0x23')](_0x7f8bd0);};}exports[_0x0e5b('0x24')]=function(_0x2ee61a,_0x343b19){var _0x386384={},_0x1d4b7f={},_0x1c8172={'count':0x0,'rows':[]};var _0x2b97f1=db[_0x0e5b('0x25')][_0x0e5b('0x26')];_0x1d4b7f['model']=_['keys'](_0x2b97f1);var _0x155f3e={'dateStart':_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x28')],'dateEnd':_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x29')]};delete _0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x28')];delete _0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x29')];_0x1d4b7f['query']=_['keys'](_0x2ee61a['query']);_0x1d4b7f[_0x0e5b('0x2a')]=_[_0x0e5b('0x2b')](_0x1d4b7f['model'],_0x1d4b7f['query']);_0x386384['attributes']=_[_0x0e5b('0x2b')](_0x1d4b7f['model'],qs[_0x0e5b('0x2c')](_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x2c')]));_0x386384[_0x0e5b('0x2d')]=_0x386384[_0x0e5b('0x2d')][_0x0e5b('0x2e')]?_0x386384[_0x0e5b('0x2d')]:_0x1d4b7f[_0x0e5b('0x2f')];if(!_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x30')](_0x0e5b('0x31'))){_0x386384[_0x0e5b('0x18')]=qs[_0x0e5b('0x18')](_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x18')]);_0x386384[_0x0e5b('0x17')]=qs[_0x0e5b('0x17')](_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x17')]);}_0x386384[_0x0e5b('0x32')]=qs['sort'](_0x2ee61a['query'][_0x0e5b('0x33')]);_0x386384[_0x0e5b('0x34')]=qs[_0x0e5b('0x2a')](_['pick'](_0x2ee61a[_0x0e5b('0x27')],_0x1d4b7f[_0x0e5b('0x2a')]));if(_0x155f3e[_0x0e5b('0x28')]){if(_0x155f3e[_0x0e5b('0x29')]){_0x155f3e[_0x0e5b('0x29')]=moment(_0x155f3e[_0x0e5b('0x29')])[_0x0e5b('0x35')](0x1,_0x0e5b('0x36'));}else{_0x155f3e[_0x0e5b('0x29')]=moment(_0x155f3e[_0x0e5b('0x28')])[_0x0e5b('0x35')](0x1,_0x0e5b('0x36'));}_[_0x0e5b('0x37')](_0x386384['where'],{'createdAt':{'$gte':_0x155f3e[_0x0e5b('0x28')],'$lte':_0x155f3e[_0x0e5b('0x29')]}});}if(_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x38')]){_0x386384['where']=_['merge'](_0x386384[_0x0e5b('0x34')],{'$or':_[_0x0e5b('0x39')](_0x2b97f1,function(_0x33e983){if(_0x33e983[_0x0e5b('0x3a')][_0x0e5b('0x3b')]!==_0x0e5b('0x3c')){var _0x266abd={};_0x266abd[_0x33e983[_0x0e5b('0x3d')]]={'$like':'%'+_0x2ee61a[_0x0e5b('0x27')][_0x0e5b('0x38')]+'%'};return _0x266abd;}})});}_0x386384=_[_0x0e5b('0x37')]({},_0x386384,_0x2ee61a[_0x0e5b('0x3e')]);var _0xbf69e4={'where':_0x386384['where']};return db[_0x0e5b('0x25')][_0x0e5b('0x3f')](_0xbf69e4)['then'](function(_0x359e4e){_0x1c8172['count']=_0x359e4e;if(_0x2ee61a[_0x0e5b('0x27')]['includeAll']){_0x386384[_0x0e5b('0x40')]=[{'all':!![]}];}return db[_0x0e5b('0x25')]['findAll'](_0x386384);})[_0x0e5b('0x1e')](function(_0x4f41dc){_0x1c8172[_0x0e5b('0x41')]=_0x4f41dc;return _0x1c8172;})[_0x0e5b('0x1e')](respondWithFilteredResult(_0x343b19,_0x386384))[_0x0e5b('0x42')](handleError(_0x343b19,null));};exports[_0x0e5b('0x43')]=function(_0x173e92,_0x109f7c){var _0x32445f={'raw':!![],'where':{'id':_0x173e92[_0x0e5b('0x44')]['id']}},_0x1a2ce4={};_0x1a2ce4['model']=_[_0x0e5b('0x45')](db[_0x0e5b('0x25')][_0x0e5b('0x26')]);_0x1a2ce4[_0x0e5b('0x27')]=_['keys'](_0x173e92[_0x0e5b('0x27')]);_0x1a2ce4[_0x0e5b('0x2a')]=_[_0x0e5b('0x2b')](_0x1a2ce4[_0x0e5b('0x2f')],_0x1a2ce4[_0x0e5b('0x27')]);_0x32445f[_0x0e5b('0x2d')]=_[_0x0e5b('0x2b')](_0x1a2ce4[_0x0e5b('0x2f')],qs[_0x0e5b('0x2c')](_0x173e92[_0x0e5b('0x27')][_0x0e5b('0x2c')]));_0x32445f['attributes']=_0x32445f['attributes'][_0x0e5b('0x2e')]?_0x32445f[_0x0e5b('0x2d')]:_0x1a2ce4[_0x0e5b('0x2f')];if(_0x173e92['query']['includeAll']){_0x32445f[_0x0e5b('0x40')]=[{'all':!![]}];}_0x32445f=_[_0x0e5b('0x37')]({},_0x32445f,_0x173e92[_0x0e5b('0x3e')]);return db[_0x0e5b('0x25')][_0x0e5b('0x46')](_0x32445f)[_0x0e5b('0x1e')](handleEntityNotFound(_0x109f7c,null))[_0x0e5b('0x1e')](respondWithResult(_0x109f7c,null))[_0x0e5b('0x42')](handleError(_0x109f7c,null));};exports['create']=function(_0x53c6cd,_0x3d2378){return db[_0x0e5b('0x25')][_0x0e5b('0x47')](_0x53c6cd['body'],{})['then'](respondWithResult(_0x3d2378,0xc9))['catch'](handleError(_0x3d2378,null));};exports[_0x0e5b('0x1d')]=function(_0x3def20,_0x228e32){if(_0x3def20[_0x0e5b('0x48')]['id']){delete _0x3def20[_0x0e5b('0x48')]['id'];}return db[_0x0e5b('0x25')][_0x0e5b('0x46')]({'where':{'id':_0x3def20[_0x0e5b('0x44')]['id']}})[_0x0e5b('0x1e')](handleEntityNotFound(_0x228e32,null))[_0x0e5b('0x1e')](saveUpdates(_0x3def20[_0x0e5b('0x48')],null))[_0x0e5b('0x1e')](respondWithResult(_0x228e32,null))[_0x0e5b('0x42')](handleError(_0x228e32,null));};exports[_0x0e5b('0x1f')]=function(_0x572167,_0x6383d3){return db[_0x0e5b('0x25')]['find']({'where':{'id':_0x572167[_0x0e5b('0x44')]['id']}})[_0x0e5b('0x1e')](handleEntityNotFound(_0x6383d3,null))[_0x0e5b('0x1e')](removeEntity(_0x6383d3,null))['catch'](handleError(_0x6383d3,null));};
\ No newline at end of file
index b5a07b1..580780e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde14=['request-promise','./intVtigerField.attributes','exports','define','VtigerField','util','../../config/logger','api','moment'];(function(_0x2b854e,_0x523aef){var _0xf20386=function(_0x171287){while(--_0x171287){_0x2b854e['push'](_0x2b854e['shift']());}};_0xf20386(++_0x523aef);}(_0xde14,0xa7));var _0x4de1=function(_0x36a2af,_0x17f27d){_0x36a2af=_0x36a2af-0x0;var _0xe0bc84=_0xde14[_0x36a2af];return _0xe0bc84;};'use strict';var _=require('lodash');var util=require(_0x4de1('0x0'));var logger=require(_0x4de1('0x1'))(_0x4de1('0x2'));var moment=require(_0x4de1('0x3'));var BPromise=require('bluebird');var rp=require(_0x4de1('0x4'));var attributes=require(_0x4de1('0x5'));module[_0x4de1('0x6')]=function(_0x590d97,_0x2f1cdd){return _0x590d97[_0x4de1('0x7')](_0x4de1('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8251=['request-promise','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api','bluebird'];(function(_0x1be5f0,_0x22ea8f){var _0x2faf9f=function(_0x4b19ff){while(--_0x4b19ff){_0x1be5f0['push'](_0x1be5f0['shift']());}};_0x2faf9f(++_0x22ea8f);}(_0x8251,0xb0));var _0x1825=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8251[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x1825('0x0'));var logger=require(_0x1825('0x1'))(_0x1825('0x2'));var moment=require('moment');var BPromise=require(_0x1825('0x3'));var rp=require(_0x1825('0x4'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x222986,_0xd06f38){return _0x222986['define'](_0x1825('0x5'),attributes,{'tableName':_0x1825('0x6'),'paranoid':![],'indexes':[{'name':_0x1825('0x7'),'fields':[_0x1825('0x8'),_0x1825('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e0f3e34..6d8bf13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89ec=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x28af34,_0x44bdbe){var _0x52ebfb=function(_0x1d578c){while(--_0x1d578c){_0x28af34['push'](_0x28af34['shift']());}};_0x52ebfb(++_0x44bdbe);}(_0x89ec,0x8c));var _0xc89e=function(_0x12dcef,_0x19c54c){_0x12dcef=_0x12dcef-0x0;var _0x3010d4=_0x89ec[_0x12dcef];return _0x3010d4;};'use strict';var _=require(_0xc89e('0x0'));var util=require(_0xc89e('0x1'));var moment=require('moment');var BPromise=require(_0xc89e('0x2'));var rs=require(_0xc89e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc89e('0x4'))['db'];var utils=require(_0xc89e('0x5'));var logger=require(_0xc89e('0x6'))(_0xc89e('0x7'));var config=require('../../config/environment');var jayson=require(_0xc89e('0x8'));var client=jayson['client'][_0xc89e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x428a0f,_0x47e976,_0x3509dc){return new BPromise(function(_0x162050,_0x40cd34){return client[_0xc89e('0xa')](_0x428a0f,_0x3509dc)[_0xc89e('0xb')](function(_0x121a80){logger[_0xc89e('0xc')]('VtigerField,\x20%s,\x20%s',_0x47e976,_0xc89e('0xd'));logger[_0xc89e('0xe')](_0xc89e('0xf'),_0x47e976,_0xc89e('0xd'),JSON[_0xc89e('0x10')](_0x121a80));if(_0x121a80[_0xc89e('0x11')]){if(_0x121a80[_0xc89e('0x11')][_0xc89e('0x12')]===0x1f4){logger['error'](_0xc89e('0x13'),_0x47e976,_0x121a80['error'][_0xc89e('0x14')]);return _0x40cd34(_0x121a80[_0xc89e('0x11')]['message']);}logger[_0xc89e('0x11')](_0xc89e('0x13'),_0x47e976,_0x121a80[_0xc89e('0x11')][_0xc89e('0x14')]);return _0x162050(_0x121a80[_0xc89e('0x11')]['message']);}else{logger[_0xc89e('0xc')](_0xc89e('0x13'),_0x47e976,_0xc89e('0xd'));_0x162050(_0x121a80[_0xc89e('0x15')]['message']);}})['catch'](function(_0x3f513c){logger[_0xc89e('0x11')]('VtigerField,\x20%s,\x20%s',_0x47e976,_0x3f513c);_0x40cd34(_0x3f513c);});});}
\ No newline at end of file
+var _0x9e3f=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','VtigerField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3d2cc0,_0x14cc3c){var _0x2ab392=function(_0x36cb6e){while(--_0x36cb6e){_0x3d2cc0['push'](_0x3d2cc0['shift']());}};_0x2ab392(++_0x14cc3c);}(_0x9e3f,0x98));var _0xf9e3=function(_0x7b38a9,_0x2c38a6){_0x7b38a9=_0x7b38a9-0x0;var _0x113729=_0x9e3f[_0x7b38a9];return _0x113729;};'use strict';var _=require(_0xf9e3('0x0'));var util=require(_0xf9e3('0x1'));var moment=require(_0xf9e3('0x2'));var BPromise=require(_0xf9e3('0x3'));var rs=require(_0xf9e3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf9e3('0x5'))['db'];var utils=require(_0xf9e3('0x6'));var logger=require(_0xf9e3('0x7'))(_0xf9e3('0x8'));var config=require('../../config/environment');var jayson=require(_0xf9e3('0x9'));var client=jayson[_0xf9e3('0xa')][_0xf9e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1da1e8,_0x411b65,_0x34e8a1){return new BPromise(function(_0x3ab224,_0x6dd634){return client['request'](_0x1da1e8,_0x34e8a1)['then'](function(_0x4dbb01){logger[_0xf9e3('0xc')](_0xf9e3('0xd'),_0x411b65,_0xf9e3('0xe'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x411b65,_0xf9e3('0xe'),JSON[_0xf9e3('0xf')](_0x4dbb01));if(_0x4dbb01['error']){if(_0x4dbb01[_0xf9e3('0x10')][_0xf9e3('0x11')]===0x1f4){logger[_0xf9e3('0x10')](_0xf9e3('0xd'),_0x411b65,_0x4dbb01[_0xf9e3('0x10')]['message']);return _0x6dd634(_0x4dbb01[_0xf9e3('0x10')][_0xf9e3('0x12')]);}logger[_0xf9e3('0x10')](_0xf9e3('0xd'),_0x411b65,_0x4dbb01[_0xf9e3('0x10')][_0xf9e3('0x12')]);return _0x3ab224(_0x4dbb01['error']['message']);}else{logger[_0xf9e3('0xc')]('VtigerField,\x20%s,\x20%s',_0x411b65,'request\x20sent');_0x3ab224(_0x4dbb01[_0xf9e3('0x13')][_0xf9e3('0x12')]);}})[_0xf9e3('0x14')](function(_0x5d8972){logger['error'](_0xf9e3('0xd'),_0x411b65,_0x5d8972);_0x6dd634(_0x5d8972);});});}
\ No newline at end of file
index 1185a63..45e1446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd75a=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getConfigurations','getFields','create','post','/:id/configurations','addConfiguration','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0xd75a,0x160));var _0xad75=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd75a[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xad75('0x0'));var util=require('util');var path=require(_0xad75('0x1'));var timeout=require(_0xad75('0x2'));var express=require(_0xad75('0x3'));var router=express[_0xad75('0x4')]();var auth=require(_0xad75('0x5'));var interaction=require(_0xad75('0x6'));var config=require(_0xad75('0x7'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0xad75('0x8')](),controller[_0xad75('0x9')]);router[_0xad75('0xa')](_0xad75('0xb'),auth[_0xad75('0x8')](),controller['show']);router[_0xad75('0xa')]('/:id/configurations',auth[_0xad75('0x8')](),controller[_0xad75('0xc')]);router[_0xad75('0xa')]('/:id/fields',auth[_0xad75('0x8')](),controller[_0xad75('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xad75('0xe')]);router[_0xad75('0xf')](_0xad75('0x10'),auth[_0xad75('0x8')](),controller[_0xad75('0x11')]);router[_0xad75('0x12')](_0xad75('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xad75('0x13')](_0xad75('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xad75('0x14')]=router;
\ No newline at end of file
+var _0x35f8=['getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x3badb4,_0x22f2ea){var _0x26b8fd=function(_0x2bb70d){while(--_0x2bb70d){_0x3badb4['push'](_0x3badb4['shift']());}};_0x26b8fd(++_0x22f2ea);}(_0x35f8,0x93));var _0x835f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x35f8[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x835f('0x0'));var util=require(_0x835f('0x1'));var path=require(_0x835f('0x2'));var timeout=require(_0x835f('0x3'));var express=require(_0x835f('0x4'));var router=express['Router']();var auth=require(_0x835f('0x5'));var interaction=require(_0x835f('0x6'));var config=require('../../config/environment');var controller=require(_0x835f('0x7'));router[_0x835f('0x8')]('/',auth[_0x835f('0x9')](),controller[_0x835f('0xa')]);router[_0x835f('0x8')](_0x835f('0xb'),auth[_0x835f('0x9')](),controller[_0x835f('0xc')]);router[_0x835f('0x8')](_0x835f('0xd'),auth[_0x835f('0x9')](),controller[_0x835f('0xe')]);router[_0x835f('0x8')](_0x835f('0xf'),auth[_0x835f('0x9')](),controller[_0x835f('0x10')]);router[_0x835f('0x11')]('/',auth[_0x835f('0x9')](),controller['create']);router['post'](_0x835f('0xd'),auth[_0x835f('0x9')](),controller['addConfiguration']);router[_0x835f('0x12')](_0x835f('0xb'),auth[_0x835f('0x9')](),controller[_0x835f('0x13')]);router[_0x835f('0x14')](_0x835f('0xb'),auth['isAuthenticated'](),controller[_0x835f('0x15')]);module[_0x835f('0x16')]=router;
\ No newline at end of file
index 12ecfda..58898d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf881=['username','remoteUri','password','token','ENUM','integrationTab','sequelize','exports','STRING'];(function(_0x1359f6,_0xee1049){var _0x13d652=function(_0x347f4f){while(--_0x347f4f){_0x1359f6['push'](_0x1359f6['shift']());}};_0x13d652(++_0xee1049);}(_0xf881,0x9f));var _0x1f88=function(_0x4bdc05,_0x623370){_0x4bdc05=_0x4bdc05-0x0;var _0x43f1b3=_0xf881[_0x4bdc05];return _0x43f1b3;};'use strict';var Sequelize=require(_0x1f88('0x0'));module[_0x1f88('0x1')]={'name':{'type':Sequelize[_0x1f88('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1f88('0x2')],'unique':_0x1f88('0x3')},'password':{'type':Sequelize[_0x1f88('0x2')]},'token':{'type':Sequelize[_0x1f88('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1f88('0x4')},'authType':{'type':Sequelize['ENUM'](_0x1f88('0x5'),_0x1f88('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x1f88('0x2')]},'type':{'type':Sequelize[_0x1f88('0x7')](_0x1f88('0x8'),'newTab'),'defaultValue':_0x1f88('0x8')}};
\ No newline at end of file
+var _0x53f5=['integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','token'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x53f5,0x66));var _0x553f=function(_0xb05f17,_0x5ab843){_0xb05f17=_0xb05f17-0x0;var _0x2d7dbd=_0x53f5[_0xb05f17];return _0x2d7dbd;};'use strict';var Sequelize=require(_0x553f('0x0'));module[_0x553f('0x1')]={'name':{'type':Sequelize[_0x553f('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x553f('0x2')],'unique':_0x553f('0x3')},'password':{'type':Sequelize[_0x553f('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x553f('0x4')},'authType':{'type':Sequelize[_0x553f('0x5')](_0x553f('0x6'),_0x553f('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x553f('0x2')]},'type':{'type':Sequelize[_0x553f('0x5')](_0x553f('0x8'),_0x553f('0x9')),'defaultValue':_0x553f('0x8')}};
\ No newline at end of file
index 75eaa04..6c7348a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x598a=['base64','%s/token:%s','Sequelize','ValidationError','subject','assignee','remove','position','system_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','set','apply','reject','destroy','name','send','ZendeskAccount','model','keys','query','dateStart','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','dateEnd','add','day','merge','filter','map','type','key','VIRTUAL','field','count','includeAll','include','rows','rawAttributes','options','find','create','body','update','params','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ZendeskField','Descriptions','getFields','username','password','token','authType','remoteUri','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString'];(function(_0x5f572d,_0x28819d){var _0x59f7a2=function(_0xe1dc9d){while(--_0xe1dc9d){_0x5f572d['push'](_0x5f572d['shift']());}};_0x59f7a2(++_0x28819d);}(_0x598a,0xfb));var _0xa598=function(_0x53c96b,_0x157db4){_0x53c96b=_0x53c96b-0x0;var _0x18480f=_0x598a[_0x53c96b];return _0x18480f;};'use strict';var pdf=require(_0xa598('0x0'));var emlformat=require(_0xa598('0x1'));var rimraf=require(_0xa598('0x2'));var zipdir=require(_0xa598('0x3'));var jsonpatch=require(_0xa598('0x4'));var rp=require('request-promise');var moment=require(_0xa598('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa598('0x6'));var sox=require(_0xa598('0x7'));var csv=require(_0xa598('0x8'));var ejs=require(_0xa598('0x9'));var fs=require('fs');var _=require(_0xa598('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa598('0xb'));var deskjs=require(_0xa598('0xc'));var toCsv=require(_0xa598('0x8'));var querystring=require(_0xa598('0xd'));var Papa=require(_0xa598('0xe'));var Redis=require(_0xa598('0xf'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xa598('0x10'));var utils=require(_0xa598('0x11'));var config=require(_0xa598('0x12'));var db=require(_0xa598('0x13'))['db'];var integrations=require(_0xa598('0x14'));var jayson=require('jayson/promise');var client=jayson[_0xa598('0x15')][_0xa598('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x468710,_0x5041d4,_0xe8f905,_0x4919eb){return new BPromise(function(_0x3a88f9,_0x23b343){var _0xb3288a=_0x4919eb||client;return _0xb3288a[_0xa598('0x17')](_0x468710,_0xe8f905)[_0xa598('0x18')](function(_0x21f1d8){logger[_0xa598('0x19')](_0xa598('0x1a'),_0x5041d4,_0xa598('0x1b'));logger['debug'](_0xa598('0x1c'),_0x5041d4,_0xa598('0x1b'),JSON[_0xa598('0x1d')](_0x21f1d8));if(_0x21f1d8[_0xa598('0x1e')]){if(_0x21f1d8[_0xa598('0x1e')][_0xa598('0x1f')]===0x1f4){logger[_0xa598('0x1e')](_0xa598('0x1a'),_0x5041d4,_0x21f1d8[_0xa598('0x1e')][_0xa598('0x20')]);return _0x23b343(_0x21f1d8['error'][_0xa598('0x20')]);}logger[_0xa598('0x1e')](_0xa598('0x1a'),_0x5041d4,_0x21f1d8[_0xa598('0x1e')][_0xa598('0x20')]);return _0x3a88f9(_0x21f1d8[_0xa598('0x1e')]['message']);}else{logger['info'](_0xa598('0x1a'),_0x5041d4,'request\x20sent');_0x3a88f9(_0x21f1d8[_0xa598('0x21')][_0xa598('0x20')]);}})[_0xa598('0x22')](function(_0x2222b0){logger[_0xa598('0x1e')](_0xa598('0x1a'),_0x5041d4,_0x2222b0);_0x23b343(_0x2222b0);});});}function respondWithStatusCode(_0x483556,_0x44e211){_0x44e211=_0x44e211||0xcc;return function(_0x46d225){if(_0x46d225){return _0x483556[_0xa598('0x23')](_0x44e211);}return _0x483556[_0xa598('0x24')](_0x44e211)[_0xa598('0x25')]();};}function respondWithResult(_0x3c533a,_0x2c9a9b){_0x2c9a9b=_0x2c9a9b||0xc8;return function(_0xf366b1){if(_0xf366b1){return _0x3c533a['status'](_0x2c9a9b)[_0xa598('0x26')](_0xf366b1);}};}function respondWithFilteredResult(_0x414d2c,_0x499565){return function(_0x4ae8b1){if(_0x4ae8b1){var _0x35b669=_0x4ae8b1['count'],_0x559038=_0x499565[_0xa598('0x27')],_0x527c9f=_0x499565['offset']+_0x499565['limit'],_0x234a98;if(_0x527c9f>=_0x35b669){_0x527c9f=_0x35b669;_0x234a98=0xc8;}else{_0x234a98=0xce;}_0x414d2c[_0xa598('0x24')](_0x234a98);return _0x414d2c[_0xa598('0x28')]('Content-Range',_0x559038+'-'+_0x527c9f+'/'+_0x35b669)[_0xa598('0x26')](_0x4ae8b1);}return null;};}function patchUpdates(_0x2823f7){return function(_0x3cdc59){try{jsonpatch[_0xa598('0x29')](_0x3cdc59,_0x2823f7,!![]);}catch(_0x523392){return BPromise[_0xa598('0x2a')](_0x523392);}return _0x3cdc59['save']();};}function saveUpdates(_0x5d70aa,_0x587d11){return function(_0x25b8fe){if(_0x25b8fe){return _0x25b8fe['update'](_0x5d70aa)[_0xa598('0x18')](function(_0x3324df){return _0x3324df;});}return null;};}function removeEntity(_0x282294,_0x5a18ec){return function(_0x3ccace){if(_0x3ccace){return _0x3ccace[_0xa598('0x2b')]()[_0xa598('0x18')](function(){_0x282294[_0xa598('0x24')](0xcc)[_0xa598('0x25')]();});}};}function handleEntityNotFound(_0x4e5f9b,_0x430d21){return function(_0x39a83e){if(!_0x39a83e){_0x4e5f9b[_0xa598('0x23')](0x194);}return _0x39a83e;};}function handleError(_0x3fd327,_0x58e2a6){_0x58e2a6=_0x58e2a6||0x1f4;return function(_0x145fdf){logger[_0xa598('0x1e')](_0x145fdf['stack']);if(_0x145fdf['name']){delete _0x145fdf[_0xa598('0x2c')];}_0x3fd327[_0xa598('0x24')](_0x58e2a6)[_0xa598('0x2d')](_0x145fdf);};}exports['index']=function(_0x1fed30,_0x3928a1){var _0x556d2d={},_0x45e006={},_0x5b338e={'count':0x0,'rows':[]};var _0x16785f=db[_0xa598('0x2e')]['rawAttributes'];_0x45e006[_0xa598('0x2f')]=_[_0xa598('0x30')](_0x16785f);var _0x5eb96d={'dateStart':_0x1fed30[_0xa598('0x31')][_0xa598('0x32')],'dateEnd':_0x1fed30[_0xa598('0x31')]['dateEnd']};delete _0x1fed30[_0xa598('0x31')][_0xa598('0x32')];delete _0x1fed30[_0xa598('0x31')]['dateEnd'];_0x45e006[_0xa598('0x31')]=_['keys'](_0x1fed30[_0xa598('0x31')]);_0x45e006[_0xa598('0x33')]=_[_0xa598('0x34')](_0x45e006['model'],_0x45e006['query']);_0x556d2d['attributes']=_['intersection'](_0x45e006[_0xa598('0x2f')],qs[_0xa598('0x35')](_0x1fed30[_0xa598('0x31')][_0xa598('0x35')]));_0x556d2d[_0xa598('0x36')]=_0x556d2d[_0xa598('0x36')][_0xa598('0x37')]?_0x556d2d[_0xa598('0x36')]:_0x45e006[_0xa598('0x2f')];if(!_0x1fed30[_0xa598('0x31')]['hasOwnProperty'](_0xa598('0x38'))){_0x556d2d[_0xa598('0x39')]=qs[_0xa598('0x39')](_0x1fed30['query'][_0xa598('0x39')]);_0x556d2d[_0xa598('0x27')]=qs[_0xa598('0x27')](_0x1fed30[_0xa598('0x31')][_0xa598('0x27')]);}_0x556d2d[_0xa598('0x3a')]=qs['sort'](_0x1fed30['query'][_0xa598('0x3b')]);_0x556d2d[_0xa598('0x3c')]=qs['filters'](_[_0xa598('0x3d')](_0x1fed30['query'],_0x45e006['filters']));if(_0x5eb96d[_0xa598('0x32')]){if(_0x5eb96d['dateEnd']){_0x5eb96d[_0xa598('0x3e')]=moment(_0x5eb96d[_0xa598('0x3e')])[_0xa598('0x3f')](0x1,_0xa598('0x40'));}else{_0x5eb96d[_0xa598('0x3e')]=moment(_0x5eb96d[_0xa598('0x32')])[_0xa598('0x3f')](0x1,_0xa598('0x40'));}_[_0xa598('0x41')](_0x556d2d[_0xa598('0x3c')],{'createdAt':{'$gte':_0x5eb96d['dateStart'],'$lte':_0x5eb96d[_0xa598('0x3e')]}});}if(_0x1fed30[_0xa598('0x31')][_0xa598('0x42')]){_0x556d2d[_0xa598('0x3c')]=_[_0xa598('0x41')](_0x556d2d[_0xa598('0x3c')],{'$or':_[_0xa598('0x43')](_0x16785f,function(_0x53acb7){if(_0x53acb7[_0xa598('0x44')][_0xa598('0x45')]!==_0xa598('0x46')){var _0x1a8f63={};_0x1a8f63[_0x53acb7[_0xa598('0x47')]]={'$like':'%'+_0x1fed30[_0xa598('0x31')][_0xa598('0x42')]+'%'};return _0x1a8f63;}})});}_0x556d2d=_[_0xa598('0x41')]({},_0x556d2d,_0x1fed30['options']);var _0x2df028={'where':_0x556d2d['where']};return db[_0xa598('0x2e')][_0xa598('0x48')](_0x2df028)[_0xa598('0x18')](function(_0x19628b){_0x5b338e[_0xa598('0x48')]=_0x19628b;if(_0x1fed30[_0xa598('0x31')][_0xa598('0x49')]){_0x556d2d[_0xa598('0x4a')]=[{'all':!![]}];}return db[_0xa598('0x2e')]['findAll'](_0x556d2d);})['then'](function(_0x74239d){_0x5b338e[_0xa598('0x4b')]=_0x74239d;return _0x5b338e;})[_0xa598('0x18')](respondWithFilteredResult(_0x3928a1,_0x556d2d))[_0xa598('0x22')](handleError(_0x3928a1,null));};exports['show']=function(_0x550391,_0x5b3641){var _0xb40248={'raw':![],'where':{'id':_0x550391['params']['id']}},_0x2e102f={};_0x2e102f['model']=_['keys'](db[_0xa598('0x2e')][_0xa598('0x4c')]);_0x2e102f[_0xa598('0x31')]=_[_0xa598('0x30')](_0x550391['query']);_0x2e102f[_0xa598('0x33')]=_[_0xa598('0x34')](_0x2e102f[_0xa598('0x2f')],_0x2e102f[_0xa598('0x31')]);_0xb40248[_0xa598('0x36')]=_[_0xa598('0x34')](_0x2e102f[_0xa598('0x2f')],qs[_0xa598('0x35')](_0x550391[_0xa598('0x31')]['fields']));_0xb40248[_0xa598('0x36')]=_0xb40248['attributes']['length']?_0xb40248[_0xa598('0x36')]:_0x2e102f['model'];if(_0x550391['query'][_0xa598('0x49')]){_0xb40248[_0xa598('0x4a')]=[{'all':!![]}];}_0xb40248=_['merge']({},_0xb40248,_0x550391[_0xa598('0x4d')]);return db['ZendeskAccount'][_0xa598('0x4e')](_0xb40248)[_0xa598('0x18')](handleEntityNotFound(_0x5b3641,null))[_0xa598('0x18')](respondWithResult(_0x5b3641,null))[_0xa598('0x22')](handleError(_0x5b3641,null));};exports[_0xa598('0x4f')]=function(_0xa4d02b,_0x3d4e38){return db[_0xa598('0x2e')][_0xa598('0x4f')](_0xa4d02b[_0xa598('0x50')],{})[_0xa598('0x18')](respondWithResult(_0x3d4e38,0xc9))[_0xa598('0x22')](handleError(_0x3d4e38,null));};exports[_0xa598('0x51')]=function(_0x58a182,_0x12602){if(_0x58a182[_0xa598('0x50')]['id']){delete _0x58a182[_0xa598('0x50')]['id'];}return db['ZendeskAccount'][_0xa598('0x4e')]({'where':{'id':_0x58a182[_0xa598('0x52')]['id']}})[_0xa598('0x18')](handleEntityNotFound(_0x12602,null))['then'](saveUpdates(_0x58a182[_0xa598('0x50')],null))[_0xa598('0x18')](respondWithResult(_0x12602,null))['catch'](handleError(_0x12602,null));};exports['destroy']=function(_0x94e4f,_0x4d00c1){return db[_0xa598('0x2e')][_0xa598('0x4e')]({'where':{'id':_0x94e4f['params']['id']}})[_0xa598('0x18')](handleEntityNotFound(_0x4d00c1,null))[_0xa598('0x18')](removeEntity(_0x4d00c1,null))[_0xa598('0x22')](handleError(_0x4d00c1,null));};exports[_0xa598('0x53')]=function(_0x4c647f,_0x3eeb0d,_0x98cd12){var _0x3675f9={};var _0x40b541={};var _0x4838c4;var _0x5dd568;return db[_0xa598('0x2e')][_0xa598('0x54')]({'where':{'id':_0x4c647f['params']['id']}})[_0xa598('0x18')](handleEntityNotFound(_0x3eeb0d,null))[_0xa598('0x18')](function(_0x15c04a){if(_0x15c04a){_0x4838c4=_0x15c04a;_0x40b541['model']=_[_0xa598('0x30')](db[_0xa598('0x55')][_0xa598('0x4c')]);_0x40b541['query']=_[_0xa598('0x30')](_0x4c647f[_0xa598('0x31')]);_0x40b541['filters']=_[_0xa598('0x34')](_0x40b541['model'],_0x40b541['query']);_0x3675f9[_0xa598('0x36')]=_[_0xa598('0x34')](_0x40b541[_0xa598('0x2f')],qs[_0xa598('0x35')](_0x4c647f['query'][_0xa598('0x35')]));_0x3675f9[_0xa598('0x36')]=_0x3675f9[_0xa598('0x36')][_0xa598('0x37')]?_0x3675f9[_0xa598('0x36')]:_0x40b541[_0xa598('0x2f')];_0x3675f9[_0xa598('0x3a')]=qs[_0xa598('0x3b')](_0x4c647f[_0xa598('0x31')][_0xa598('0x3b')]);_0x3675f9['where']=qs[_0xa598('0x33')](_[_0xa598('0x3d')](_0x4c647f[_0xa598('0x31')],_0x40b541[_0xa598('0x33')]));if(_0x4c647f['query'][_0xa598('0x42')]){_0x3675f9[_0xa598('0x3c')]=_['merge'](_0x3675f9[_0xa598('0x3c')],{'$or':_['map'](_0x3675f9[_0xa598('0x36')],function(_0x4ff75d){var _0x4c493f={};_0x4c493f[_0x4ff75d]={'$like':'%'+_0x4c647f['query'][_0xa598('0x42')]+'%'};return _0x4c493f;})});}_0x3675f9=_[_0xa598('0x41')]({},_0x3675f9,_0x4c647f['options']);return _0x4838c4['getConfigurations'](_0x3675f9);}})[_0xa598('0x18')](function(_0x2cc54c){if(_0x2cc54c){_0x5dd568=_0x2cc54c[_0xa598('0x37')];if(!_0x4c647f[_0xa598('0x31')]['hasOwnProperty'](_0xa598('0x38'))){_0x3675f9[_0xa598('0x39')]=qs[_0xa598('0x39')](_0x4c647f[_0xa598('0x31')][_0xa598('0x39')]);_0x3675f9[_0xa598('0x27')]=qs['offset'](_0x4c647f[_0xa598('0x31')][_0xa598('0x27')]);}return _0x4838c4[_0xa598('0x53')](_0x3675f9);}})[_0xa598('0x18')](function(_0x2d0007){if(_0x2d0007){return _0x2d0007?{'count':_0x5dd568,'rows':_0x2d0007}:null;}})[_0xa598('0x18')](respondWithResult(_0x3eeb0d,null))[_0xa598('0x22')](handleError(_0x3eeb0d,null));};exports[_0xa598('0x56')]=function(_0x1b55b7,_0x42aeed,_0x400502){if(_0x1b55b7[_0xa598('0x50')]['id']){delete _0x1b55b7[_0xa598('0x50')]['id'];}return db[_0xa598('0x2e')][_0xa598('0x54')]({'where':{'id':_0x1b55b7['params']['id']}})['then'](handleEntityNotFound(_0x42aeed,null))[_0xa598('0x18')](function(_0x57c4d5){if(_0x57c4d5){_0x1b55b7['body'][_0xa598('0x57')]=_0x57c4d5['id'];_0x1b55b7['body'][_0xa598('0x58')]=integrations[_0xa598('0x59')](_0x1b55b7['body']['channel'],_0x1b55b7[_0xa598('0x50')][_0xa598('0x44')]);_0x1b55b7[_0xa598('0x50')]['Descriptions']=integrations[_0xa598('0x5a')](_0x1b55b7[_0xa598('0x50')][_0xa598('0x5b')],_0x1b55b7[_0xa598('0x50')][_0xa598('0x44')]);return db[_0xa598('0x55')]['create'](_0x1b55b7[_0xa598('0x50')],{'include':[{'model':db['ZendeskField'],'as':_0xa598('0x58')},{'model':db[_0xa598('0x5c')],'as':_0xa598('0x5d')}]});}return null;})[_0xa598('0x18')](respondWithResult(_0x42aeed,null))['catch'](handleError(_0x42aeed,null));};exports[_0xa598('0x5e')]=function(_0x48ac5e,_0x38ddb1,_0x28cbe7){return db[_0xa598('0x2e')][_0xa598('0x54')]({'where':{'id':_0x48ac5e[_0xa598('0x52')]['id']},'attributes':['id',_0xa598('0x5f'),_0xa598('0x60'),_0xa598('0x61'),_0xa598('0x62'),_0xa598('0x63')]})['then'](handleEntityNotFound(_0x38ddb1,null))['then'](function(_0x4479a0){if(_0x4479a0){var _0x311cca={'method':'GET','uri':util[_0xa598('0x64')]('%s%s',_0x4479a0[_0xa598('0x63')],_0xa598('0x65')),'json':!![]};switch(_0x4479a0[_0xa598('0x62')]){case _0xa598('0x60'):_0x311cca[_0xa598('0x66')]={'Authorization':util[_0xa598('0x64')](_0xa598('0x67'),new Buffer(util[_0xa598('0x64')](_0xa598('0x68'),_0x4479a0[_0xa598('0x5f')],_0x4479a0[_0xa598('0x60')]))[_0xa598('0x69')](_0xa598('0x6a')))};break;case _0xa598('0x61'):_0x311cca[_0xa598('0x66')]={'Authorization':util[_0xa598('0x64')](_0xa598('0x67'),new Buffer(util[_0xa598('0x64')](_0xa598('0x6b'),_0x4479a0[_0xa598('0x5f')],_0x4479a0[_0xa598('0x61')]))[_0xa598('0x69')](_0xa598('0x6a')))};break;default:throw new db[(_0xa598('0x6c'))][(_0xa598('0x6d'))]('Unknown\x20authentication\x20type');}return rp(_0x311cca);}})[_0xa598('0x18')](function(_0xecf761){if(_0xecf761){var _0x1e7df1=[_0xa598('0x6e'),'description','group',_0xa598('0x6f')];_[_0xa598('0x70')](_0xecf761['ticket_fields'],function(_0x4826d2){return _0x1e7df1['includes'](_0x4826d2[_0xa598('0x44')]);});return{'count':_0xecf761[_0xa598('0x65')][_0xa598('0x37')],'rows':_['map'](_0xecf761[_0xa598('0x65')],function(_0x14aed0){return{'id':_0x14aed0['id'],'name':_0x14aed0[_0xa598('0x71')]>0x7?_0x14aed0['title']:_0x14aed0[_0xa598('0x44')],'custom':_0x14aed0[_0xa598('0x71')]>0x7?!![]:![],'options':_0x14aed0[_0xa598('0x72')]?_0x14aed0[_0xa598('0x72')]:[]};})};}})['then'](respondWithResult(_0x38ddb1,null))['catch'](function(_0x5441c6){var _0x1f3acd=_0x48ac5e[_0xa598('0x31')]['test']?0x1f4:_0x5441c6[_0xa598('0x73')]||0x1f4;logger['error'](_0xa598('0x74'),_0xa598('0x5e'),_0x1f3acd,JSON[_0xa598('0x1d')](_0x5441c6));delete _0x5441c6[_0xa598('0x2c')];if(_0x1f3acd===0x191){_0x1f3acd=0x190;}_0x38ddb1['status'](_0x1f3acd)[_0xa598('0x2d')](_0x48ac5e[_0xa598('0x31')][_0xa598('0x75')]?{'message':_0xa598('0x76'),'statusCode':_0x5441c6[_0xa598('0x73')]}:_0x5441c6);});};
\ No newline at end of file
+var _0x37c5=['findOne','ZendeskConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','remoteUri','GET','format','%s%s','ticket_fields','authType','headers','Basic\x20%s','username','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','position','title','system_field_options','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../mysqldb','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','destroy','stack','name','index','ZendeskAccount','model','query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','add','day','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','getConfigurations'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0x37c5,0xa7));var _0x537c=function(_0x1c00b6,_0x2e538d){_0x1c00b6=_0x1c00b6-0x0;var _0x5113ef=_0x37c5[_0x1c00b6];return _0x5113ef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x537c('0x0'));var rimraf=require(_0x537c('0x1'));var zipdir=require(_0x537c('0x2'));var jsonpatch=require(_0x537c('0x3'));var rp=require(_0x537c('0x4'));var moment=require(_0x537c('0x5'));var BPromise=require(_0x537c('0x6'));var Mustache=require(_0x537c('0x7'));var util=require(_0x537c('0x8'));var path=require(_0x537c('0x9'));var sox=require('sox');var csv=require(_0x537c('0xa'));var ejs=require(_0x537c('0xb'));var fs=require('fs');var _=require(_0x537c('0xc'));var squel=require('squel');var crypto=require(_0x537c('0xd'));var jsforce=require(_0x537c('0xe'));var deskjs=require(_0x537c('0xf'));var toCsv=require(_0x537c('0xa'));var querystring=require('querystring');var Papa=require(_0x537c('0x10'));var Redis=require(_0x537c('0x11'));var qs=require(_0x537c('0x12'));var logger=require('../../config/logger')(_0x537c('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x537c('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x537c('0x15'));var client=jayson[_0x537c('0x16')][_0x537c('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x473606,_0x1ecb98,_0x4554be,_0x3a666f){return new BPromise(function(_0x2d1f01,_0x15aaca){var _0x577981=_0x3a666f||client;return _0x577981[_0x537c('0x18')](_0x473606,_0x4554be)[_0x537c('0x19')](function(_0x463703){logger[_0x537c('0x1a')](_0x537c('0x1b'),_0x1ecb98,_0x537c('0x1c'));logger[_0x537c('0x1d')](_0x537c('0x1e'),_0x1ecb98,_0x537c('0x1c'),JSON['stringify'](_0x463703));if(_0x463703[_0x537c('0x1f')]){if(_0x463703['error']['code']===0x1f4){logger[_0x537c('0x1f')](_0x537c('0x1b'),_0x1ecb98,_0x463703[_0x537c('0x1f')]['message']);return _0x15aaca(_0x463703[_0x537c('0x1f')][_0x537c('0x20')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1ecb98,_0x463703[_0x537c('0x1f')]['message']);return _0x2d1f01(_0x463703['error'][_0x537c('0x20')]);}else{logger[_0x537c('0x1a')]('ZendeskAccount,\x20%s,\x20%s',_0x1ecb98,_0x537c('0x1c'));_0x2d1f01(_0x463703[_0x537c('0x21')]['message']);}})['catch'](function(_0x1a91d1){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1ecb98,_0x1a91d1);_0x15aaca(_0x1a91d1);});});}function respondWithStatusCode(_0x21562e,_0x121331){_0x121331=_0x121331||0xcc;return function(_0x13fd5e){if(_0x13fd5e){return _0x21562e[_0x537c('0x22')](_0x121331);}return _0x21562e[_0x537c('0x23')](_0x121331)[_0x537c('0x24')]();};}function respondWithResult(_0x5802d1,_0x2ea036){_0x2ea036=_0x2ea036||0xc8;return function(_0x2412fd){if(_0x2412fd){return _0x5802d1[_0x537c('0x23')](_0x2ea036)[_0x537c('0x25')](_0x2412fd);}};}function respondWithFilteredResult(_0x428e5d,_0x4b6af1){return function(_0x552375){if(_0x552375){var _0x59442f=_0x552375[_0x537c('0x26')],_0x403ff6=_0x4b6af1[_0x537c('0x27')],_0x1fa0ca=_0x4b6af1[_0x537c('0x27')]+_0x4b6af1['limit'],_0x54569f;if(_0x1fa0ca>=_0x59442f){_0x1fa0ca=_0x59442f;_0x54569f=0xc8;}else{_0x54569f=0xce;}_0x428e5d['status'](_0x54569f);return _0x428e5d[_0x537c('0x28')](_0x537c('0x29'),_0x403ff6+'-'+_0x1fa0ca+'/'+_0x59442f)[_0x537c('0x25')](_0x552375);}return null;};}function patchUpdates(_0x4e5f18){return function(_0x49d60b){try{jsonpatch['apply'](_0x49d60b,_0x4e5f18,!![]);}catch(_0x22f82e){return BPromise[_0x537c('0x2a')](_0x22f82e);}return _0x49d60b['save']();};}function saveUpdates(_0x4ee822,_0x50788a){return function(_0x49138c){if(_0x49138c){return _0x49138c[_0x537c('0x2b')](_0x4ee822)[_0x537c('0x19')](function(_0x3aa9d6){return _0x3aa9d6;});}return null;};}function removeEntity(_0x5379e5,_0x931d86){return function(_0x2bc1b8){if(_0x2bc1b8){return _0x2bc1b8[_0x537c('0x2c')]()['then'](function(){_0x5379e5[_0x537c('0x23')](0xcc)[_0x537c('0x24')]();});}};}function handleEntityNotFound(_0x2aa360,_0x485ea6){return function(_0x547c99){if(!_0x547c99){_0x2aa360[_0x537c('0x22')](0x194);}return _0x547c99;};}function handleError(_0x3fa447,_0x30a7bf){_0x30a7bf=_0x30a7bf||0x1f4;return function(_0x27b251){logger[_0x537c('0x1f')](_0x27b251[_0x537c('0x2d')]);if(_0x27b251[_0x537c('0x2e')]){delete _0x27b251[_0x537c('0x2e')];}_0x3fa447['status'](_0x30a7bf)['send'](_0x27b251);};}exports[_0x537c('0x2f')]=function(_0x46263d,_0x4c8233){var _0x36d769={},_0xf7a818={},_0x116b5e={'count':0x0,'rows':[]};var _0x438334=db[_0x537c('0x30')]['rawAttributes'];_0xf7a818[_0x537c('0x31')]=_['keys'](_0x438334);var _0x596396={'dateStart':_0x46263d['query']['dateStart'],'dateEnd':_0x46263d[_0x537c('0x32')][_0x537c('0x33')]};delete _0x46263d[_0x537c('0x32')][_0x537c('0x34')];delete _0x46263d[_0x537c('0x32')][_0x537c('0x33')];_0xf7a818[_0x537c('0x32')]=_[_0x537c('0x35')](_0x46263d[_0x537c('0x32')]);_0xf7a818[_0x537c('0x36')]=_[_0x537c('0x37')](_0xf7a818[_0x537c('0x31')],_0xf7a818[_0x537c('0x32')]);_0x36d769[_0x537c('0x38')]=_['intersection'](_0xf7a818[_0x537c('0x31')],qs['fields'](_0x46263d[_0x537c('0x32')][_0x537c('0x39')]));_0x36d769['attributes']=_0x36d769[_0x537c('0x38')][_0x537c('0x3a')]?_0x36d769[_0x537c('0x38')]:_0xf7a818[_0x537c('0x31')];if(!_0x46263d['query'][_0x537c('0x3b')](_0x537c('0x3c'))){_0x36d769[_0x537c('0x3d')]=qs['limit'](_0x46263d[_0x537c('0x32')][_0x537c('0x3d')]);_0x36d769[_0x537c('0x27')]=qs[_0x537c('0x27')](_0x46263d[_0x537c('0x32')][_0x537c('0x27')]);}_0x36d769['order']=qs[_0x537c('0x3e')](_0x46263d[_0x537c('0x32')][_0x537c('0x3e')]);_0x36d769[_0x537c('0x3f')]=qs[_0x537c('0x36')](_[_0x537c('0x40')](_0x46263d[_0x537c('0x32')],_0xf7a818['filters']));if(_0x596396[_0x537c('0x34')]){if(_0x596396['dateEnd']){_0x596396[_0x537c('0x33')]=moment(_0x596396[_0x537c('0x33')])[_0x537c('0x41')](0x1,_0x537c('0x42'));}else{_0x596396[_0x537c('0x33')]=moment(_0x596396['dateStart'])['add'](0x1,_0x537c('0x42'));}_[_0x537c('0x43')](_0x36d769[_0x537c('0x3f')],{'createdAt':{'$gte':_0x596396[_0x537c('0x34')],'$lte':_0x596396[_0x537c('0x33')]}});}if(_0x46263d[_0x537c('0x32')]['filter']){_0x36d769[_0x537c('0x3f')]=_[_0x537c('0x43')](_0x36d769[_0x537c('0x3f')],{'$or':_[_0x537c('0x44')](_0x438334,function(_0x538813){if(_0x538813[_0x537c('0x45')][_0x537c('0x46')]!==_0x537c('0x47')){var _0x422c6c={};_0x422c6c[_0x538813[_0x537c('0x48')]]={'$like':'%'+_0x46263d[_0x537c('0x32')][_0x537c('0x49')]+'%'};return _0x422c6c;}})});}_0x36d769=_[_0x537c('0x43')]({},_0x36d769,_0x46263d[_0x537c('0x4a')]);var _0x5b13d3={'where':_0x36d769[_0x537c('0x3f')]};return db[_0x537c('0x30')]['count'](_0x5b13d3)[_0x537c('0x19')](function(_0xcd7018){_0x116b5e[_0x537c('0x26')]=_0xcd7018;if(_0x46263d['query'][_0x537c('0x4b')]){_0x36d769[_0x537c('0x4c')]=[{'all':!![]}];}return db[_0x537c('0x30')][_0x537c('0x4d')](_0x36d769);})['then'](function(_0x452b64){_0x116b5e[_0x537c('0x4e')]=_0x452b64;return _0x116b5e;})[_0x537c('0x19')](respondWithFilteredResult(_0x4c8233,_0x36d769))['catch'](handleError(_0x4c8233,null));};exports[_0x537c('0x4f')]=function(_0x4f70d4,_0x1ee6a8){var _0x30d00e={'raw':![],'where':{'id':_0x4f70d4[_0x537c('0x50')]['id']}},_0x3fdc31={};_0x3fdc31[_0x537c('0x31')]=_[_0x537c('0x35')](db[_0x537c('0x30')][_0x537c('0x51')]);_0x3fdc31[_0x537c('0x32')]=_[_0x537c('0x35')](_0x4f70d4['query']);_0x3fdc31['filters']=_[_0x537c('0x37')](_0x3fdc31[_0x537c('0x31')],_0x3fdc31[_0x537c('0x32')]);_0x30d00e[_0x537c('0x38')]=_[_0x537c('0x37')](_0x3fdc31[_0x537c('0x31')],qs[_0x537c('0x39')](_0x4f70d4['query']['fields']));_0x30d00e[_0x537c('0x38')]=_0x30d00e[_0x537c('0x38')][_0x537c('0x3a')]?_0x30d00e['attributes']:_0x3fdc31['model'];if(_0x4f70d4[_0x537c('0x32')]['includeAll']){_0x30d00e[_0x537c('0x4c')]=[{'all':!![]}];}_0x30d00e=_[_0x537c('0x43')]({},_0x30d00e,_0x4f70d4[_0x537c('0x4a')]);return db[_0x537c('0x30')][_0x537c('0x52')](_0x30d00e)[_0x537c('0x19')](handleEntityNotFound(_0x1ee6a8,null))[_0x537c('0x19')](respondWithResult(_0x1ee6a8,null))[_0x537c('0x53')](handleError(_0x1ee6a8,null));};exports[_0x537c('0x54')]=function(_0x1e6b82,_0x1b9f14){return db[_0x537c('0x30')]['create'](_0x1e6b82[_0x537c('0x55')],{})['then'](respondWithResult(_0x1b9f14,0xc9))['catch'](handleError(_0x1b9f14,null));};exports['update']=function(_0x631585,_0x3ac68a){if(_0x631585[_0x537c('0x55')]['id']){delete _0x631585['body']['id'];}return db[_0x537c('0x30')][_0x537c('0x52')]({'where':{'id':_0x631585[_0x537c('0x50')]['id']}})[_0x537c('0x19')](handleEntityNotFound(_0x3ac68a,null))[_0x537c('0x19')](saveUpdates(_0x631585['body'],null))[_0x537c('0x19')](respondWithResult(_0x3ac68a,null))[_0x537c('0x53')](handleError(_0x3ac68a,null));};exports[_0x537c('0x2c')]=function(_0x511be0,_0x52735e){return db['ZendeskAccount'][_0x537c('0x52')]({'where':{'id':_0x511be0[_0x537c('0x50')]['id']}})['then'](handleEntityNotFound(_0x52735e,null))[_0x537c('0x19')](removeEntity(_0x52735e,null))[_0x537c('0x53')](handleError(_0x52735e,null));};exports[_0x537c('0x56')]=function(_0x1ce3aa,_0x345f8b,_0x2d1c0f){var _0x4701cd={};var _0x40557a={};var _0x3a3cfe;var _0x5a436f;return db[_0x537c('0x30')][_0x537c('0x57')]({'where':{'id':_0x1ce3aa[_0x537c('0x50')]['id']}})['then'](handleEntityNotFound(_0x345f8b,null))[_0x537c('0x19')](function(_0xe2d30e){if(_0xe2d30e){_0x3a3cfe=_0xe2d30e;_0x40557a[_0x537c('0x31')]=_[_0x537c('0x35')](db[_0x537c('0x58')]['rawAttributes']);_0x40557a['query']=_[_0x537c('0x35')](_0x1ce3aa[_0x537c('0x32')]);_0x40557a['filters']=_[_0x537c('0x37')](_0x40557a[_0x537c('0x31')],_0x40557a[_0x537c('0x32')]);_0x4701cd[_0x537c('0x38')]=_['intersection'](_0x40557a[_0x537c('0x31')],qs[_0x537c('0x39')](_0x1ce3aa[_0x537c('0x32')][_0x537c('0x39')]));_0x4701cd[_0x537c('0x38')]=_0x4701cd[_0x537c('0x38')][_0x537c('0x3a')]?_0x4701cd[_0x537c('0x38')]:_0x40557a[_0x537c('0x31')];_0x4701cd[_0x537c('0x59')]=qs[_0x537c('0x3e')](_0x1ce3aa[_0x537c('0x32')][_0x537c('0x3e')]);_0x4701cd[_0x537c('0x3f')]=qs[_0x537c('0x36')](_[_0x537c('0x40')](_0x1ce3aa[_0x537c('0x32')],_0x40557a['filters']));if(_0x1ce3aa[_0x537c('0x32')][_0x537c('0x49')]){_0x4701cd[_0x537c('0x3f')]=_[_0x537c('0x43')](_0x4701cd['where'],{'$or':_[_0x537c('0x44')](_0x4701cd[_0x537c('0x38')],function(_0x6a42dc){var _0x32d9b9={};_0x32d9b9[_0x6a42dc]={'$like':'%'+_0x1ce3aa['query'][_0x537c('0x49')]+'%'};return _0x32d9b9;})});}_0x4701cd=_[_0x537c('0x43')]({},_0x4701cd,_0x1ce3aa['options']);return _0x3a3cfe[_0x537c('0x56')](_0x4701cd);}})[_0x537c('0x19')](function(_0x65197){if(_0x65197){_0x5a436f=_0x65197['length'];if(!_0x1ce3aa[_0x537c('0x32')][_0x537c('0x3b')](_0x537c('0x3c'))){_0x4701cd[_0x537c('0x3d')]=qs[_0x537c('0x3d')](_0x1ce3aa[_0x537c('0x32')][_0x537c('0x3d')]);_0x4701cd[_0x537c('0x27')]=qs[_0x537c('0x27')](_0x1ce3aa[_0x537c('0x32')][_0x537c('0x27')]);}return _0x3a3cfe['getConfigurations'](_0x4701cd);}})[_0x537c('0x19')](function(_0x13775a){if(_0x13775a){return _0x13775a?{'count':_0x5a436f,'rows':_0x13775a}:null;}})['then'](respondWithResult(_0x345f8b,null))[_0x537c('0x53')](handleError(_0x345f8b,null));};exports['addConfiguration']=function(_0x1be90a,_0x11908d,_0x7604f1){if(_0x1be90a[_0x537c('0x55')]['id']){delete _0x1be90a[_0x537c('0x55')]['id'];}return db[_0x537c('0x30')][_0x537c('0x57')]({'where':{'id':_0x1be90a[_0x537c('0x50')]['id']}})[_0x537c('0x19')](handleEntityNotFound(_0x11908d,null))[_0x537c('0x19')](function(_0x5252ea){if(_0x5252ea){_0x1be90a['body'][_0x537c('0x5a')]=_0x5252ea['id'];_0x1be90a[_0x537c('0x55')][_0x537c('0x5b')]=integrations[_0x537c('0x5c')](_0x1be90a[_0x537c('0x55')][_0x537c('0x5d')],_0x1be90a['body'][_0x537c('0x45')]);_0x1be90a[_0x537c('0x55')][_0x537c('0x5e')]=integrations[_0x537c('0x5f')](_0x1be90a[_0x537c('0x55')][_0x537c('0x5d')],_0x1be90a['body'][_0x537c('0x45')]);return db[_0x537c('0x58')]['create'](_0x1be90a[_0x537c('0x55')],{'include':[{'model':db[_0x537c('0x60')],'as':_0x537c('0x5b')},{'model':db[_0x537c('0x60')],'as':_0x537c('0x5e')}]});}return null;})['then'](respondWithResult(_0x11908d,null))[_0x537c('0x53')](handleError(_0x11908d,null));};exports[_0x537c('0x61')]=function(_0xe99faa,_0x4d43ee,_0x4b3516){return db[_0x537c('0x30')]['findOne']({'where':{'id':_0xe99faa['params']['id']},'attributes':['id','username',_0x537c('0x62'),_0x537c('0x63'),'authType',_0x537c('0x64')]})[_0x537c('0x19')](handleEntityNotFound(_0x4d43ee,null))[_0x537c('0x19')](function(_0x28c8e1){if(_0x28c8e1){var _0x8e56f3={'method':_0x537c('0x65'),'uri':util[_0x537c('0x66')](_0x537c('0x67'),_0x28c8e1[_0x537c('0x64')],_0x537c('0x68')),'json':!![]};switch(_0x28c8e1[_0x537c('0x69')]){case'password':_0x8e56f3[_0x537c('0x6a')]={'Authorization':util['format'](_0x537c('0x6b'),new Buffer(util[_0x537c('0x66')]('%s:%s',_0x28c8e1[_0x537c('0x6c')],_0x28c8e1[_0x537c('0x62')]))[_0x537c('0x6d')](_0x537c('0x6e')))};break;case _0x537c('0x63'):_0x8e56f3[_0x537c('0x6a')]={'Authorization':util[_0x537c('0x66')]('Basic\x20%s',new Buffer(util[_0x537c('0x66')](_0x537c('0x6f'),_0x28c8e1[_0x537c('0x6c')],_0x28c8e1[_0x537c('0x63')]))['toString'](_0x537c('0x6e')))};break;default:throw new db[(_0x537c('0x70'))][(_0x537c('0x71'))](_0x537c('0x72'));}return rp(_0x8e56f3);}})['then'](function(_0x59b44f){if(_0x59b44f){var _0x42e0c5=[_0x537c('0x73'),'description',_0x537c('0x74'),'assignee'];_[_0x537c('0x75')](_0x59b44f[_0x537c('0x68')],function(_0x4137a0){return _0x42e0c5[_0x537c('0x76')](_0x4137a0[_0x537c('0x45')]);});return{'count':_0x59b44f[_0x537c('0x68')][_0x537c('0x3a')],'rows':_[_0x537c('0x44')](_0x59b44f[_0x537c('0x68')],function(_0x29adc6){return{'id':_0x29adc6['id'],'name':_0x29adc6[_0x537c('0x77')]>0x7?_0x29adc6[_0x537c('0x78')]:_0x29adc6['type'],'custom':_0x29adc6[_0x537c('0x77')]>0x7?!![]:![],'options':_0x29adc6[_0x537c('0x79')]?_0x29adc6[_0x537c('0x79')]:[]};})};}})[_0x537c('0x19')](respondWithResult(_0x4d43ee,null))[_0x537c('0x53')](function(_0x11478b){var _0x155f96=_0xe99faa[_0x537c('0x32')][_0x537c('0x7a')]?0x1f4:_0x11478b[_0x537c('0x7b')]||0x1f4;logger[_0x537c('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x537c('0x61'),_0x155f96,JSON[_0x537c('0x7c')](_0x11478b));delete _0x11478b[_0x537c('0x2e')];if(_0x155f96===0x191){_0x155f96=0x190;}_0x4d43ee['status'](_0x155f96)[_0x537c('0x7d')](_0xe99faa['query'][_0x537c('0x7a')]?{'message':_0x537c('0x7e'),'statusCode':_0x11478b[_0x537c('0x7b')]}:_0x11478b);});};
\ No newline at end of file
index ea0fe95..6aaad21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4921=['exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x462816,_0x55ec9f){var _0x45b088=function(_0x270c6f){while(--_0x270c6f){_0x462816['push'](_0x462816['shift']());}};_0x45b088(++_0x55ec9f);}(_0x4921,0x8f));var _0x1492=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0x4921[_0x2920dd];return _0x5d4e52;};'use strict';var _=require(_0x1492('0x0'));var util=require(_0x1492('0x1'));var logger=require(_0x1492('0x2'))(_0x1492('0x3'));var moment=require(_0x1492('0x4'));var BPromise=require(_0x1492('0x5'));var rp=require(_0x1492('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x1492('0x7')]=function(_0x5a4adc,_0x4712a6){return _0x5a4adc['define'](_0x1492('0x8'),attributes,{'tableName':_0x1492('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9858=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','moment','bluebird','request-promise','./intZendeskAccount.attributes'];(function(_0x7aaf0,_0x5030b9){var _0x4e50f6=function(_0x2bf342){while(--_0x2bf342){_0x7aaf0['push'](_0x7aaf0['shift']());}};_0x4e50f6(++_0x5030b9);}(_0x9858,0x165));var _0x8985=function(_0x1ef1f2,_0x222ce0){_0x1ef1f2=_0x1ef1f2-0x0;var _0x5d6e7b=_0x9858[_0x1ef1f2];return _0x5d6e7b;};'use strict';var _=require('lodash');var util=require(_0x8985('0x0'));var logger=require(_0x8985('0x1'))('api');var moment=require(_0x8985('0x2'));var BPromise=require(_0x8985('0x3'));var rp=require(_0x8985('0x4'));var attributes=require(_0x8985('0x5'));var integrations=require(_0x8985('0x6'));module[_0x8985('0x7')]=function(_0x21837f,_0x393b18){return _0x21837f[_0x8985('0x8')](_0x8985('0x9'),attributes,{'tableName':_0x8985('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9d8b418..f02a9b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aeb=['attributes','limit','include','model','map','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8aeb,0x1ce));var _0xb8ae=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0x8aeb[_0x2731f0];return _0x36a180;};'use strict';var _=require(_0xb8ae('0x0'));var util=require(_0xb8ae('0x1'));var moment=require(_0xb8ae('0x2'));var BPromise=require(_0xb8ae('0x3'));var rs=require(_0xb8ae('0x4'));var fs=require('fs');var Redis=require(_0xb8ae('0x5'));var db=require(_0xb8ae('0x6'))['db'];var utils=require(_0xb8ae('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xb8ae('0x8'));var jayson=require(_0xb8ae('0x9'));var client=jayson['client'][_0xb8ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f380b,_0x1e3124,_0x883a53){return new BPromise(function(_0x49c3e8,_0x463594){return client['request'](_0x5f380b,_0x883a53)[_0xb8ae('0xb')](function(_0x57fe79){logger[_0xb8ae('0xc')](_0xb8ae('0xd'),_0x1e3124,_0xb8ae('0xe'));logger[_0xb8ae('0xf')](_0xb8ae('0x10'),_0x1e3124,_0xb8ae('0xe'),JSON[_0xb8ae('0x11')](_0x57fe79));if(_0x57fe79[_0xb8ae('0x12')]){if(_0x57fe79[_0xb8ae('0x12')][_0xb8ae('0x13')]===0x1f4){logger[_0xb8ae('0x12')](_0xb8ae('0xd'),_0x1e3124,_0x57fe79[_0xb8ae('0x12')][_0xb8ae('0x14')]);return _0x463594(_0x57fe79[_0xb8ae('0x12')][_0xb8ae('0x14')]);}logger['error'](_0xb8ae('0xd'),_0x1e3124,_0x57fe79['error'][_0xb8ae('0x14')]);return _0x49c3e8(_0x57fe79[_0xb8ae('0x12')]['message']);}else{logger[_0xb8ae('0xc')](_0xb8ae('0xd'),_0x1e3124,_0xb8ae('0xe'));_0x49c3e8(_0x57fe79[_0xb8ae('0x15')][_0xb8ae('0x14')]);}})[_0xb8ae('0x16')](function(_0x27a53c){logger[_0xb8ae('0x12')](_0xb8ae('0xd'),_0x1e3124,_0x27a53c);_0x463594(_0x27a53c);});});}exports[_0xb8ae('0x17')]=function(_0x1a6544){var _0xb2f222=this;return new Promise(function(_0x47b19c,_0x181d92){return db[_0xb8ae('0x18')][_0xb8ae('0x19')]({'raw':_0x1a6544[_0xb8ae('0x1a')]?_0x1a6544[_0xb8ae('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1a6544['options']?_0x1a6544[_0xb8ae('0x1a')][_0xb8ae('0x1b')]||null:null,'attributes':_0x1a6544[_0xb8ae('0x1a')]?_0x1a6544[_0xb8ae('0x1a')][_0xb8ae('0x1c')]||null:null,'limit':_0x1a6544[_0xb8ae('0x1a')]?_0x1a6544[_0xb8ae('0x1a')][_0xb8ae('0x1d')]||null:null,'include':_0x1a6544[_0xb8ae('0x1a')]?_0x1a6544[_0xb8ae('0x1a')][_0xb8ae('0x1e')]?_['map'](_0x1a6544[_0xb8ae('0x1a')][_0xb8ae('0x1e')],function(_0x1638e4){return{'model':db[_0x1638e4[_0xb8ae('0x1f')]],'as':_0x1638e4['as'],'attributes':_0x1638e4['attributes'],'include':_0x1638e4[_0xb8ae('0x1e')]?_[_0xb8ae('0x20')](_0x1638e4[_0xb8ae('0x1e')],function(_0x5a6667){return{'model':db[_0x5a6667[_0xb8ae('0x1f')]],'as':_0x5a6667['as'],'attributes':_0x5a6667[_0xb8ae('0x1c')],'include':_0x5a6667[_0xb8ae('0x1e')]?_[_0xb8ae('0x20')](_0x5a6667[_0xb8ae('0x1e')],function(_0xb81a8){return{'model':db[_0xb81a8[_0xb8ae('0x1f')]],'as':_0xb81a8['as'],'attributes':_0xb81a8[_0xb8ae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb8ae('0xb')](function(_0x5dde6c){logger['info'](_0xb8ae('0x17'),_0x1a6544);logger[_0xb8ae('0xf')](_0xb8ae('0x17'),_0x1a6544,JSON['stringify'](_0x5dde6c));_0x47b19c(_0x5dde6c);})[_0xb8ae('0x16')](function(_0x2866e5){logger[_0xb8ae('0x12')]('GetZendeskAccount',_0x2866e5['message'],_0x1a6544);_0x181d92(_0xb2f222[_0xb8ae('0x12')](0x1f4,_0x2866e5[_0xb8ae('0x14')]));});});};exports[_0xb8ae('0x21')]=function(_0x242f02){var _0x1a23e0=this;return new Promise(function(_0x46d595,_0x2a6650){return db[_0xb8ae('0x18')][_0xb8ae('0x22')]({'raw':_0x242f02[_0xb8ae('0x1a')]?_0x242f02[_0xb8ae('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x242f02[_0xb8ae('0x1a')]?_0x242f02[_0xb8ae('0x1a')][_0xb8ae('0x1b')]||null:null,'attributes':_0x242f02[_0xb8ae('0x1a')]?_0x242f02[_0xb8ae('0x1a')]['attributes']||null:null,'include':_0x242f02[_0xb8ae('0x1a')]?_0x242f02[_0xb8ae('0x1a')][_0xb8ae('0x1e')]?_[_0xb8ae('0x20')](_0x242f02[_0xb8ae('0x1a')]['include'],function(_0x104dea){return{'model':db[_0x104dea[_0xb8ae('0x1f')]],'as':_0x104dea['as'],'attributes':_0x104dea[_0xb8ae('0x1c')],'include':_0x104dea[_0xb8ae('0x1e')]?_[_0xb8ae('0x20')](_0x104dea[_0xb8ae('0x1e')],function(_0x576ba3){return{'model':db[_0x576ba3[_0xb8ae('0x1f')]],'as':_0x576ba3['as'],'attributes':_0x576ba3[_0xb8ae('0x1c')],'include':_0x576ba3[_0xb8ae('0x1e')]?_[_0xb8ae('0x20')](_0x576ba3[_0xb8ae('0x1e')],function(_0x5d0142){return{'model':db[_0x5d0142[_0xb8ae('0x1f')]],'as':_0x5d0142['as'],'attributes':_0x5d0142[_0xb8ae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb8ae('0xb')](function(_0x25c5be){logger[_0xb8ae('0xc')](_0xb8ae('0x21'),_0x242f02);logger['debug'](_0xb8ae('0x21'),_0x242f02,JSON[_0xb8ae('0x11')](_0x25c5be));_0x46d595(_0x25c5be);})[_0xb8ae('0x16')](function(_0x114fe2){logger[_0xb8ae('0x12')]('ShowZendeskAccount',_0x114fe2['message'],_0x242f02);_0x2a6650(_0x1a23e0[_0xb8ae('0x12')](0x1f4,_0x114fe2[_0xb8ae('0x14')]));});});};
\ No newline at end of file
+var _0x18c3=['message','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskAccount,\x20%s,\x20%s'];(function(_0xb06e17,_0x5a2160){var _0x3d62ea=function(_0x1706eb){while(--_0x1706eb){_0xb06e17['push'](_0xb06e17['shift']());}};_0x3d62ea(++_0x5a2160);}(_0x18c3,0x136));var _0x318c=function(_0x363b19,_0x521b3b){_0x363b19=_0x363b19-0x0;var _0xc6b95=_0x18c3[_0x363b19];return _0xc6b95;};'use strict';var _=require(_0x318c('0x0'));var util=require(_0x318c('0x1'));var moment=require(_0x318c('0x2'));var BPromise=require(_0x318c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x318c('0x4'));var db=require(_0x318c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x318c('0x6'));var config=require(_0x318c('0x7'));var jayson=require(_0x318c('0x8'));var client=jayson[_0x318c('0x9')][_0x318c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b9f8a,_0x66910b,_0x13d241){return new BPromise(function(_0x1b961b,_0x5d3954){return client[_0x318c('0xb')](_0x5b9f8a,_0x13d241)[_0x318c('0xc')](function(_0x4acb2a){logger[_0x318c('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x66910b,_0x318c('0xe'));logger[_0x318c('0xf')](_0x318c('0x10'),_0x66910b,_0x318c('0xe'),JSON[_0x318c('0x11')](_0x4acb2a));if(_0x4acb2a[_0x318c('0x12')]){if(_0x4acb2a[_0x318c('0x12')]['code']===0x1f4){logger['error'](_0x318c('0x13'),_0x66910b,_0x4acb2a['error'][_0x318c('0x14')]);return _0x5d3954(_0x4acb2a[_0x318c('0x12')]['message']);}logger[_0x318c('0x12')](_0x318c('0x13'),_0x66910b,_0x4acb2a['error']['message']);return _0x1b961b(_0x4acb2a[_0x318c('0x12')][_0x318c('0x14')]);}else{logger[_0x318c('0xd')](_0x318c('0x13'),_0x66910b,'request\x20sent');_0x1b961b(_0x4acb2a['result']['message']);}})['catch'](function(_0x58f0be){logger[_0x318c('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x66910b,_0x58f0be);_0x5d3954(_0x58f0be);});});}exports[_0x318c('0x15')]=function(_0xc8aaef){var _0x2fc427=this;return new Promise(function(_0x3712c1,_0x3d7163){return db[_0x318c('0x16')]['findAll']({'raw':_0xc8aaef[_0x318c('0x17')]?_0xc8aaef[_0x318c('0x17')][_0x318c('0x18')]===undefined?!![]:![]:!![],'where':_0xc8aaef[_0x318c('0x17')]?_0xc8aaef[_0x318c('0x17')][_0x318c('0x19')]||null:null,'attributes':_0xc8aaef[_0x318c('0x17')]?_0xc8aaef[_0x318c('0x17')][_0x318c('0x1a')]||null:null,'limit':_0xc8aaef[_0x318c('0x17')]?_0xc8aaef[_0x318c('0x17')][_0x318c('0x1b')]||null:null,'include':_0xc8aaef[_0x318c('0x17')]?_0xc8aaef[_0x318c('0x17')][_0x318c('0x1c')]?_[_0x318c('0x1d')](_0xc8aaef[_0x318c('0x17')][_0x318c('0x1c')],function(_0x5635dd){return{'model':db[_0x5635dd[_0x318c('0x1e')]],'as':_0x5635dd['as'],'attributes':_0x5635dd[_0x318c('0x1a')],'include':_0x5635dd[_0x318c('0x1c')]?_[_0x318c('0x1d')](_0x5635dd[_0x318c('0x1c')],function(_0x48410e){return{'model':db[_0x48410e['model']],'as':_0x48410e['as'],'attributes':_0x48410e[_0x318c('0x1a')],'include':_0x48410e[_0x318c('0x1c')]?_[_0x318c('0x1d')](_0x48410e[_0x318c('0x1c')],function(_0x1c5d5f){return{'model':db[_0x1c5d5f[_0x318c('0x1e')]],'as':_0x1c5d5f['as'],'attributes':_0x1c5d5f[_0x318c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x318c('0xc')](function(_0x4e26b5){logger[_0x318c('0xd')](_0x318c('0x15'),_0xc8aaef);logger[_0x318c('0xf')](_0x318c('0x15'),_0xc8aaef,JSON['stringify'](_0x4e26b5));_0x3712c1(_0x4e26b5);})['catch'](function(_0x235cf6){logger[_0x318c('0x12')](_0x318c('0x15'),_0x235cf6[_0x318c('0x14')],_0xc8aaef);_0x3d7163(_0x2fc427[_0x318c('0x12')](0x1f4,_0x235cf6['message']));});});};exports[_0x318c('0x1f')]=function(_0xe14dfd){var _0x5179e4=this;return new Promise(function(_0x415806,_0x542ac8){return db[_0x318c('0x16')]['find']({'raw':_0xe14dfd[_0x318c('0x17')]?_0xe14dfd[_0x318c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xe14dfd[_0x318c('0x17')]?_0xe14dfd[_0x318c('0x17')][_0x318c('0x19')]||null:null,'attributes':_0xe14dfd[_0x318c('0x17')]?_0xe14dfd[_0x318c('0x17')][_0x318c('0x1a')]||null:null,'include':_0xe14dfd[_0x318c('0x17')]?_0xe14dfd[_0x318c('0x17')][_0x318c('0x1c')]?_[_0x318c('0x1d')](_0xe14dfd[_0x318c('0x17')][_0x318c('0x1c')],function(_0x31e720){return{'model':db[_0x31e720[_0x318c('0x1e')]],'as':_0x31e720['as'],'attributes':_0x31e720[_0x318c('0x1a')],'include':_0x31e720[_0x318c('0x1c')]?_['map'](_0x31e720[_0x318c('0x1c')],function(_0x54b177){return{'model':db[_0x54b177[_0x318c('0x1e')]],'as':_0x54b177['as'],'attributes':_0x54b177[_0x318c('0x1a')],'include':_0x54b177[_0x318c('0x1c')]?_[_0x318c('0x1d')](_0x54b177['include'],function(_0x4ca4c0){return{'model':db[_0x4ca4c0['model']],'as':_0x4ca4c0['as'],'attributes':_0x4ca4c0[_0x318c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x318c('0xc')](function(_0xf9c1e0){logger[_0x318c('0xd')](_0x318c('0x1f'),_0xe14dfd);logger[_0x318c('0xf')](_0x318c('0x1f'),_0xe14dfd,JSON[_0x318c('0x11')](_0xf9c1e0));_0x415806(_0xf9c1e0);})[_0x318c('0x20')](function(_0x523bc4){logger[_0x318c('0x12')](_0x318c('0x1f'),_0x523bc4[_0x318c('0x14')],_0xe14dfd);_0x542ac8(_0x5179e4['error'](0x1f4,_0x523bc4['message']));});});};
\ No newline at end of file
index 5031314..ff4d34c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x770e=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x770e,0x194));var _0xe770=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x770e[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xe770('0x0'));var util=require('util');var path=require(_0xe770('0x1'));var timeout=require(_0xe770('0x2'));var express=require(_0xe770('0x3'));var router=express['Router']();var auth=require(_0xe770('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe770('0x5'));var controller=require('./intZendeskConfiguration.controller');router[_0xe770('0x6')]('/',auth[_0xe770('0x7')](),controller['index']);router['get'](_0xe770('0x8'),auth[_0xe770('0x7')](),controller[_0xe770('0x9')]);router['get'](_0xe770('0xa'),auth[_0xe770('0x7')](),controller[_0xe770('0xb')]);router[_0xe770('0x6')](_0xe770('0xc'),auth[_0xe770('0x7')](),controller['getSubjects']);router[_0xe770('0x6')](_0xe770('0xd'),auth['isAuthenticated'](),controller[_0xe770('0xe')]);router[_0xe770('0x6')](_0xe770('0xf'),auth['isAuthenticated'](),controller[_0xe770('0x10')]);router[_0xe770('0x11')]('/',auth[_0xe770('0x7')](),controller[_0xe770('0x12')]);router[_0xe770('0x11')](_0xe770('0xf'),auth[_0xe770('0x7')](),controller[_0xe770('0x13')]);router['put'](_0xe770('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xe770('0x14')](_0xe770('0x8'),auth[_0xe770('0x7')](),controller[_0xe770('0x15')]);module[_0xe770('0x16')]=router;
\ No newline at end of file
+var _0x1268=['express','Router','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','index','get','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put','update','delete','exports','multer','path'];(function(_0x1201c8,_0x29f858){var _0x5e20a1=function(_0x5a24cb){while(--_0x5a24cb){_0x1201c8['push'](_0x1201c8['shift']());}};_0x5e20a1(++_0x29f858);}(_0x1268,0x1b6));var _0x8126=function(_0x2b4d8a,_0xd9ec76){_0x2b4d8a=_0x2b4d8a-0x0;var _0x25af68=_0x1268[_0x2b4d8a];return _0x25af68;};'use strict';var multer=require(_0x8126('0x0'));var util=require('util');var path=require(_0x8126('0x1'));var timeout=require('connect-timeout');var express=require(_0x8126('0x2'));var router=express[_0x8126('0x3')]();var auth=require(_0x8126('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8126('0x5'));var controller=require(_0x8126('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8126('0x7')]);router[_0x8126('0x8')]('/:id',auth[_0x8126('0x9')](),controller['show']);router[_0x8126('0x8')](_0x8126('0xa'),auth['isAuthenticated'](),controller[_0x8126('0xb')]);router['get']('/:id/subjects',auth[_0x8126('0x9')](),controller[_0x8126('0xc')]);router['get'](_0x8126('0xd'),auth[_0x8126('0x9')](),controller[_0x8126('0xe')]);router[_0x8126('0x8')](_0x8126('0xf'),auth[_0x8126('0x9')](),controller['getTags']);router['post']('/',auth[_0x8126('0x9')](),controller[_0x8126('0x10')]);router[_0x8126('0x11')](_0x8126('0xf'),auth[_0x8126('0x9')](),controller['setTags']);router[_0x8126('0x12')]('/:id',auth[_0x8126('0x9')](),controller[_0x8126('0x13')]);router[_0x8126('0x14')]('/:id',auth[_0x8126('0x9')](),controller['destroy']);module[_0x8126('0x15')]=router;
\ No newline at end of file
index 7f885d1..b58e109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1690=['exports','STRING','sequelize'];(function(_0x9bcc0b,_0x120f6c){var _0x195399=function(_0x5be8b9){while(--_0x5be8b9){_0x9bcc0b['push'](_0x9bcc0b['shift']());}};_0x195399(++_0x120f6c);}(_0x1690,0x188));var _0x0169=function(_0xee83db,_0x50965c){_0xee83db=_0xee83db-0x0;var _0x247ce5=_0x1690[_0xee83db];return _0x247ce5;};'use strict';var Sequelize=require(_0x0169('0x0'));module[_0x0169('0x1')]={'name':{'type':Sequelize[_0x0169('0x2')]},'description':{'type':Sequelize[_0x0169('0x2')]}};
\ No newline at end of file
+var _0x90ff=['exports','STRING','sequelize'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x90ff,0x188));var _0xf90f=function(_0x1a76f6,_0x2d2de0){_0x1a76f6=_0x1a76f6-0x0;var _0x4b03e8=_0x90ff[_0x1a76f6];return _0x4b03e8;};'use strict';var Sequelize=require(_0xf90f('0x0'));module[_0xf90f('0x1')]={'name':{'type':Sequelize[_0xf90f('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 04173cd..267ead9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57b5=['setTags','ids','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','count','offset','status','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','add','day','where','filter','map','type','key','VIRTUAL','field','merge','options','ZendeskConfiguration','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','ZendeskField','order','limit','getSubjects','getDescriptions','getTags','Tag'];(function(_0x7f71c3,_0x7e57f2){var _0x2cfb77=function(_0x10f0df){while(--_0x10f0df){_0x7f71c3['push'](_0x7f71c3['shift']());}};_0x2cfb77(++_0x7e57f2);}(_0x57b5,0x65));var _0x557b=function(_0x161f03,_0x5d141b){_0x161f03=_0x161f03-0x0;var _0x2f396f=_0x57b5[_0x161f03];return _0x2f396f;};'use strict';var pdf=require(_0x557b('0x0'));var emlformat=require(_0x557b('0x1'));var rimraf=require(_0x557b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x557b('0x3'));var moment=require(_0x557b('0x4'));var BPromise=require(_0x557b('0x5'));var Mustache=require(_0x557b('0x6'));var util=require('util');var path=require(_0x557b('0x7'));var sox=require(_0x557b('0x8'));var csv=require(_0x557b('0x9'));var ejs=require(_0x557b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x557b('0xb'));var crypto=require(_0x557b('0xc'));var jsforce=require(_0x557b('0xd'));var deskjs=require(_0x557b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x557b('0xf'));var Papa=require(_0x557b('0x10'));var Redis=require(_0x557b('0x11'));var qs=require(_0x557b('0x12'));var logger=require('../../config/logger')(_0x557b('0x13'));var utils=require(_0x557b('0x14'));var config=require(_0x557b('0x15'));var db=require(_0x557b('0x16'))['db'];var jayson=require(_0x557b('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18f65a,_0x2eb58c,_0x279d07,_0x24377d){return new BPromise(function(_0xfa4faf,_0x35668c){var _0x20517a=_0x24377d||client;return _0x20517a[_0x557b('0x18')](_0x18f65a,_0x279d07)[_0x557b('0x19')](function(_0x2e1b12){logger['info'](_0x557b('0x1a'),_0x2eb58c,'request\x20sent');logger[_0x557b('0x1b')](_0x557b('0x1c'),_0x2eb58c,_0x557b('0x1d'),JSON[_0x557b('0x1e')](_0x2e1b12));if(_0x2e1b12[_0x557b('0x1f')]){if(_0x2e1b12[_0x557b('0x1f')][_0x557b('0x20')]===0x1f4){logger[_0x557b('0x1f')](_0x557b('0x1a'),_0x2eb58c,_0x2e1b12[_0x557b('0x1f')]['message']);return _0x35668c(_0x2e1b12[_0x557b('0x1f')]['message']);}logger[_0x557b('0x1f')](_0x557b('0x1a'),_0x2eb58c,_0x2e1b12[_0x557b('0x1f')][_0x557b('0x21')]);return _0xfa4faf(_0x2e1b12[_0x557b('0x1f')][_0x557b('0x21')]);}else{logger['info'](_0x557b('0x1a'),_0x2eb58c,_0x557b('0x1d'));_0xfa4faf(_0x2e1b12[_0x557b('0x22')][_0x557b('0x21')]);}})[_0x557b('0x23')](function(_0x357b8c){logger[_0x557b('0x1f')](_0x557b('0x1a'),_0x2eb58c,_0x357b8c);_0x35668c(_0x357b8c);});});}function respondWithStatusCode(_0x1d548f,_0x53a242){_0x53a242=_0x53a242||0xcc;return function(_0x4b55fe){if(_0x4b55fe){return _0x1d548f[_0x557b('0x24')](_0x53a242);}return _0x1d548f['status'](_0x53a242)['end']();};}function respondWithResult(_0x4591dd,_0x109fc1){_0x109fc1=_0x109fc1||0xc8;return function(_0x34144e){if(_0x34144e){return _0x4591dd['status'](_0x109fc1)['json'](_0x34144e);}};}function respondWithFilteredResult(_0x96d5b2,_0x21c38d){return function(_0x508434){if(_0x508434){var _0x1f730d=_0x508434[_0x557b('0x25')],_0x222b87=_0x21c38d['offset'],_0x4dadd5=_0x21c38d[_0x557b('0x26')]+_0x21c38d['limit'],_0xda8f46;if(_0x4dadd5>=_0x1f730d){_0x4dadd5=_0x1f730d;_0xda8f46=0xc8;}else{_0xda8f46=0xce;}_0x96d5b2[_0x557b('0x27')](_0xda8f46);return _0x96d5b2[_0x557b('0x28')](_0x557b('0x29'),_0x222b87+'-'+_0x4dadd5+'/'+_0x1f730d)[_0x557b('0x2a')](_0x508434);}return null;};}function patchUpdates(_0x2e1c2c){return function(_0x90660){try{jsonpatch[_0x557b('0x2b')](_0x90660,_0x2e1c2c,!![]);}catch(_0x340d80){return BPromise[_0x557b('0x2c')](_0x340d80);}return _0x90660[_0x557b('0x2d')]();};}function saveUpdates(_0x33327e,_0x4e3caa){return function(_0x32a3ad){if(_0x32a3ad){return _0x32a3ad[_0x557b('0x2e')](_0x33327e)[_0x557b('0x19')](function(_0x591497){return _0x591497;});}return null;};}function removeEntity(_0x4e5c65,_0x22ff06){return function(_0x5a3cfa){if(_0x5a3cfa){return _0x5a3cfa[_0x557b('0x2f')]()['then'](function(){_0x4e5c65[_0x557b('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14fc98,_0x43ed29){return function(_0x2e890e){if(!_0x2e890e){_0x14fc98[_0x557b('0x24')](0x194);}return _0x2e890e;};}function handleError(_0x4c48e1,_0x294b79){_0x294b79=_0x294b79||0x1f4;return function(_0x357f6f){logger['error'](_0x357f6f[_0x557b('0x30')]);if(_0x357f6f[_0x557b('0x31')]){delete _0x357f6f[_0x557b('0x31')];}_0x4c48e1['status'](_0x294b79)[_0x557b('0x32')](_0x357f6f);};}exports[_0x557b('0x33')]=function(_0xc7beaa,_0x43fa7d){var _0x2ac3dd={},_0x4c22d6={},_0x251fbe={'count':0x0,'rows':[]};var _0x13b117=db['ZendeskConfiguration'][_0x557b('0x34')];_0x4c22d6[_0x557b('0x35')]=_[_0x557b('0x36')](_0x13b117);var _0x2a94f4={'dateStart':_0xc7beaa[_0x557b('0x37')][_0x557b('0x38')],'dateEnd':_0xc7beaa[_0x557b('0x37')][_0x557b('0x39')]};delete _0xc7beaa[_0x557b('0x37')][_0x557b('0x38')];delete _0xc7beaa[_0x557b('0x37')][_0x557b('0x39')];_0x4c22d6['query']=_[_0x557b('0x36')](_0xc7beaa[_0x557b('0x37')]);_0x4c22d6[_0x557b('0x3a')]=_[_0x557b('0x3b')](_0x4c22d6[_0x557b('0x35')],_0x4c22d6[_0x557b('0x37')]);_0x2ac3dd[_0x557b('0x3c')]=_[_0x557b('0x3b')](_0x4c22d6[_0x557b('0x35')],qs[_0x557b('0x3d')](_0xc7beaa['query'][_0x557b('0x3d')]));_0x2ac3dd[_0x557b('0x3c')]=_0x2ac3dd[_0x557b('0x3c')][_0x557b('0x3e')]?_0x2ac3dd[_0x557b('0x3c')]:_0x4c22d6[_0x557b('0x35')];if(!_0xc7beaa[_0x557b('0x37')][_0x557b('0x3f')](_0x557b('0x40'))){_0x2ac3dd['limit']=qs['limit'](_0xc7beaa[_0x557b('0x37')]['limit']);_0x2ac3dd[_0x557b('0x26')]=qs[_0x557b('0x26')](_0xc7beaa[_0x557b('0x37')]['offset']);}_0x2ac3dd['order']=qs[_0x557b('0x41')](_0xc7beaa[_0x557b('0x37')][_0x557b('0x41')]);_0x2ac3dd['where']=qs['filters'](_[_0x557b('0x42')](_0xc7beaa[_0x557b('0x37')],_0x4c22d6[_0x557b('0x3a')]));if(_0x2a94f4[_0x557b('0x38')]){if(_0x2a94f4[_0x557b('0x39')]){_0x2a94f4[_0x557b('0x39')]=moment(_0x2a94f4['dateEnd'])[_0x557b('0x43')](0x1,_0x557b('0x44'));}else{_0x2a94f4[_0x557b('0x39')]=moment(_0x2a94f4[_0x557b('0x38')])[_0x557b('0x43')](0x1,_0x557b('0x44'));}_['merge'](_0x2ac3dd[_0x557b('0x45')],{'createdAt':{'$gte':_0x2a94f4[_0x557b('0x38')],'$lte':_0x2a94f4[_0x557b('0x39')]}});}if(_0xc7beaa[_0x557b('0x37')][_0x557b('0x46')]){_0x2ac3dd[_0x557b('0x45')]=_['merge'](_0x2ac3dd[_0x557b('0x45')],{'$or':_[_0x557b('0x47')](_0x13b117,function(_0x474f54){if(_0x474f54[_0x557b('0x48')][_0x557b('0x49')]!==_0x557b('0x4a')){var _0x44213b={};_0x44213b[_0x474f54[_0x557b('0x4b')]]={'$like':'%'+_0xc7beaa[_0x557b('0x37')][_0x557b('0x46')]+'%'};return _0x44213b;}})});}_0x2ac3dd=_[_0x557b('0x4c')]({},_0x2ac3dd,_0xc7beaa[_0x557b('0x4d')]);var _0x18b8ed={'where':_0x2ac3dd[_0x557b('0x45')]};return db[_0x557b('0x4e')]['count'](_0x18b8ed)[_0x557b('0x19')](function(_0x184518){_0x251fbe[_0x557b('0x25')]=_0x184518;if(_0xc7beaa['query'][_0x557b('0x4f')]){_0x2ac3dd[_0x557b('0x50')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x557b('0x51')](_0x2ac3dd);})[_0x557b('0x19')](function(_0x2a01f3){_0x251fbe[_0x557b('0x52')]=_0x2a01f3;return _0x251fbe;})['then'](respondWithFilteredResult(_0x43fa7d,_0x2ac3dd))[_0x557b('0x23')](handleError(_0x43fa7d,null));};exports[_0x557b('0x53')]=function(_0x3d3b36,_0x4722ce){var _0x3d291f={'raw':![],'where':{'id':_0x3d3b36[_0x557b('0x54')]['id']}},_0x31aa79={};_0x31aa79[_0x557b('0x35')]=_[_0x557b('0x36')](db[_0x557b('0x4e')][_0x557b('0x34')]);_0x31aa79[_0x557b('0x37')]=_[_0x557b('0x36')](_0x3d3b36['query']);_0x31aa79[_0x557b('0x3a')]=_['intersection'](_0x31aa79[_0x557b('0x35')],_0x31aa79[_0x557b('0x37')]);_0x3d291f[_0x557b('0x3c')]=_['intersection'](_0x31aa79[_0x557b('0x35')],qs[_0x557b('0x3d')](_0x3d3b36['query'][_0x557b('0x3d')]));_0x3d291f[_0x557b('0x3c')]=_0x3d291f[_0x557b('0x3c')][_0x557b('0x3e')]?_0x3d291f[_0x557b('0x3c')]:_0x31aa79[_0x557b('0x35')];if(_0x3d3b36['query'][_0x557b('0x4f')]){_0x3d291f[_0x557b('0x50')]=[{'all':!![]}];}_0x3d291f=_['merge']({},_0x3d291f,_0x3d3b36[_0x557b('0x4d')]);return db[_0x557b('0x4e')][_0x557b('0x55')](_0x3d291f)[_0x557b('0x19')](handleEntityNotFound(_0x4722ce,null))['then'](respondWithResult(_0x4722ce,null))[_0x557b('0x23')](handleError(_0x4722ce,null));};exports[_0x557b('0x56')]=function(_0x411ae9,_0xdf4fb9){return db['ZendeskConfiguration'][_0x557b('0x56')](_0x411ae9[_0x557b('0x57')],{})['then'](respondWithResult(_0xdf4fb9,0xc9))[_0x557b('0x23')](handleError(_0xdf4fb9,null));};exports[_0x557b('0x2e')]=function(_0x379c9a,_0xb1dfd1){if(_0x379c9a[_0x557b('0x57')]['id']){delete _0x379c9a[_0x557b('0x57')]['id'];}return db[_0x557b('0x4e')][_0x557b('0x55')]({'where':{'id':_0x379c9a['params']['id']}})['then'](handleEntityNotFound(_0xb1dfd1,null))[_0x557b('0x19')](saveUpdates(_0x379c9a['body'],null))[_0x557b('0x19')](respondWithResult(_0xb1dfd1,null))[_0x557b('0x23')](handleError(_0xb1dfd1,null));};exports['destroy']=function(_0x351f09,_0x45a57f){return db[_0x557b('0x4e')][_0x557b('0x55')]({'where':{'id':_0x351f09[_0x557b('0x54')]['id']}})[_0x557b('0x19')](handleEntityNotFound(_0x45a57f,null))[_0x557b('0x19')](removeEntity(_0x45a57f,null))[_0x557b('0x23')](handleError(_0x45a57f,null));};exports[_0x557b('0x58')]=function(_0x218d44,_0x9d4f10,_0xb38892){var _0x2eb4c1={};var _0x44163d={};var _0x1bdf86;var _0x27b900;return db['ZendeskConfiguration'][_0x557b('0x59')]({'where':{'id':_0x218d44['params']['id']}})[_0x557b('0x19')](handleEntityNotFound(_0x9d4f10,null))[_0x557b('0x19')](function(_0x105349){if(_0x105349){_0x1bdf86=_0x105349;_0x44163d[_0x557b('0x35')]=_[_0x557b('0x36')](db[_0x557b('0x5a')][_0x557b('0x34')]);_0x44163d[_0x557b('0x37')]=_[_0x557b('0x36')](_0x218d44[_0x557b('0x37')]);_0x44163d[_0x557b('0x3a')]=_[_0x557b('0x3b')](_0x44163d['model'],_0x44163d[_0x557b('0x37')]);_0x2eb4c1[_0x557b('0x3c')]=_['intersection'](_0x44163d[_0x557b('0x35')],qs[_0x557b('0x3d')](_0x218d44[_0x557b('0x37')][_0x557b('0x3d')]));_0x2eb4c1['attributes']=_0x2eb4c1[_0x557b('0x3c')]['length']?_0x2eb4c1[_0x557b('0x3c')]:_0x44163d['model'];_0x2eb4c1[_0x557b('0x5b')]=qs['sort'](_0x218d44[_0x557b('0x37')][_0x557b('0x41')]);_0x2eb4c1[_0x557b('0x45')]=qs['filters'](_[_0x557b('0x42')](_0x218d44[_0x557b('0x37')],_0x44163d[_0x557b('0x3a')]));if(_0x218d44[_0x557b('0x37')][_0x557b('0x46')]){_0x2eb4c1[_0x557b('0x45')]=_[_0x557b('0x4c')](_0x2eb4c1['where'],{'$or':_[_0x557b('0x47')](_0x2eb4c1[_0x557b('0x3c')],function(_0x28651b){var _0x16b025={};_0x16b025[_0x28651b]={'$like':'%'+_0x218d44[_0x557b('0x37')][_0x557b('0x46')]+'%'};return _0x16b025;})});}_0x2eb4c1=_[_0x557b('0x4c')]({},_0x2eb4c1,_0x218d44[_0x557b('0x4d')]);return _0x1bdf86['getFields'](_0x2eb4c1);}})[_0x557b('0x19')](function(_0x2a35a0){if(_0x2a35a0){_0x27b900=_0x2a35a0[_0x557b('0x3e')];if(!_0x218d44[_0x557b('0x37')][_0x557b('0x3f')](_0x557b('0x40'))){_0x2eb4c1['limit']=qs[_0x557b('0x5c')](_0x218d44[_0x557b('0x37')][_0x557b('0x5c')]);_0x2eb4c1[_0x557b('0x26')]=qs[_0x557b('0x26')](_0x218d44[_0x557b('0x37')][_0x557b('0x26')]);}return _0x1bdf86[_0x557b('0x58')](_0x2eb4c1);}})[_0x557b('0x19')](function(_0x5a8172){if(_0x5a8172){return _0x5a8172?{'count':_0x27b900,'rows':_0x5a8172}:null;}})[_0x557b('0x19')](respondWithResult(_0x9d4f10,null))[_0x557b('0x23')](handleError(_0x9d4f10,null));};exports[_0x557b('0x5d')]=function(_0x2bd50f,_0x76e103,_0x49acd1){var _0x5f2f44={};var _0x1b571c={};var _0x2a99b3;var _0x2faf75;return db[_0x557b('0x4e')][_0x557b('0x59')]({'where':{'id':_0x2bd50f['params']['id']}})[_0x557b('0x19')](handleEntityNotFound(_0x76e103,null))[_0x557b('0x19')](function(_0x1a309b){if(_0x1a309b){_0x2a99b3=_0x1a309b;_0x1b571c[_0x557b('0x35')]=_['keys'](db[_0x557b('0x5a')]['rawAttributes']);_0x1b571c[_0x557b('0x37')]=_['keys'](_0x2bd50f[_0x557b('0x37')]);_0x1b571c[_0x557b('0x3a')]=_['intersection'](_0x1b571c[_0x557b('0x35')],_0x1b571c['query']);_0x5f2f44[_0x557b('0x3c')]=_[_0x557b('0x3b')](_0x1b571c['model'],qs[_0x557b('0x3d')](_0x2bd50f[_0x557b('0x37')]['fields']));_0x5f2f44[_0x557b('0x3c')]=_0x5f2f44[_0x557b('0x3c')]['length']?_0x5f2f44[_0x557b('0x3c')]:_0x1b571c[_0x557b('0x35')];_0x5f2f44[_0x557b('0x5b')]=qs[_0x557b('0x41')](_0x2bd50f[_0x557b('0x37')]['sort']);_0x5f2f44['where']=qs['filters'](_[_0x557b('0x42')](_0x2bd50f[_0x557b('0x37')],_0x1b571c[_0x557b('0x3a')]));if(_0x2bd50f[_0x557b('0x37')][_0x557b('0x46')]){_0x5f2f44['where']=_[_0x557b('0x4c')](_0x5f2f44[_0x557b('0x45')],{'$or':_[_0x557b('0x47')](_0x5f2f44[_0x557b('0x3c')],function(_0x67c44d){var _0x28bb55={};_0x28bb55[_0x67c44d]={'$like':'%'+_0x2bd50f[_0x557b('0x37')]['filter']+'%'};return _0x28bb55;})});}_0x5f2f44=_[_0x557b('0x4c')]({},_0x5f2f44,_0x2bd50f[_0x557b('0x4d')]);return _0x2a99b3[_0x557b('0x5d')](_0x5f2f44);}})[_0x557b('0x19')](function(_0x4784d2){if(_0x4784d2){_0x2faf75=_0x4784d2['length'];if(!_0x2bd50f['query']['hasOwnProperty'](_0x557b('0x40'))){_0x5f2f44[_0x557b('0x5c')]=qs[_0x557b('0x5c')](_0x2bd50f[_0x557b('0x37')][_0x557b('0x5c')]);_0x5f2f44[_0x557b('0x26')]=qs[_0x557b('0x26')](_0x2bd50f['query']['offset']);}return _0x2a99b3[_0x557b('0x5d')](_0x5f2f44);}})[_0x557b('0x19')](function(_0x182eec){if(_0x182eec){return _0x182eec?{'count':_0x2faf75,'rows':_0x182eec}:null;}})[_0x557b('0x19')](respondWithResult(_0x76e103,null))['catch'](handleError(_0x76e103,null));};exports[_0x557b('0x5e')]=function(_0x519cc9,_0x3d270e,_0x40a67b){var _0x11b17a={};var _0x7f4493={};var _0x1b733b;var _0x27830f;return db[_0x557b('0x4e')]['findOne']({'where':{'id':_0x519cc9[_0x557b('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d270e,null))[_0x557b('0x19')](function(_0x35582d){if(_0x35582d){_0x1b733b=_0x35582d;_0x7f4493['model']=_[_0x557b('0x36')](db[_0x557b('0x5a')][_0x557b('0x34')]);_0x7f4493[_0x557b('0x37')]=_[_0x557b('0x36')](_0x519cc9[_0x557b('0x37')]);_0x7f4493[_0x557b('0x3a')]=_[_0x557b('0x3b')](_0x7f4493['model'],_0x7f4493[_0x557b('0x37')]);_0x11b17a[_0x557b('0x3c')]=_[_0x557b('0x3b')](_0x7f4493[_0x557b('0x35')],qs[_0x557b('0x3d')](_0x519cc9[_0x557b('0x37')]['fields']));_0x11b17a[_0x557b('0x3c')]=_0x11b17a[_0x557b('0x3c')]['length']?_0x11b17a[_0x557b('0x3c')]:_0x7f4493[_0x557b('0x35')];_0x11b17a[_0x557b('0x5b')]=qs[_0x557b('0x41')](_0x519cc9['query'][_0x557b('0x41')]);_0x11b17a[_0x557b('0x45')]=qs[_0x557b('0x3a')](_[_0x557b('0x42')](_0x519cc9[_0x557b('0x37')],_0x7f4493[_0x557b('0x3a')]));if(_0x519cc9[_0x557b('0x37')][_0x557b('0x46')]){_0x11b17a[_0x557b('0x45')]=_[_0x557b('0x4c')](_0x11b17a['where'],{'$or':_[_0x557b('0x47')](_0x11b17a[_0x557b('0x3c')],function(_0x32866d){var _0x3a667e={};_0x3a667e[_0x32866d]={'$like':'%'+_0x519cc9[_0x557b('0x37')][_0x557b('0x46')]+'%'};return _0x3a667e;})});}_0x11b17a=_[_0x557b('0x4c')]({},_0x11b17a,_0x519cc9[_0x557b('0x4d')]);return _0x1b733b[_0x557b('0x5e')](_0x11b17a);}})[_0x557b('0x19')](function(_0x3bc407){if(_0x3bc407){_0x27830f=_0x3bc407[_0x557b('0x3e')];if(!_0x519cc9[_0x557b('0x37')][_0x557b('0x3f')]('nolimit')){_0x11b17a[_0x557b('0x5c')]=qs[_0x557b('0x5c')](_0x519cc9[_0x557b('0x37')]['limit']);_0x11b17a['offset']=qs[_0x557b('0x26')](_0x519cc9[_0x557b('0x37')][_0x557b('0x26')]);}return _0x1b733b[_0x557b('0x5e')](_0x11b17a);}})[_0x557b('0x19')](function(_0x46ca09){if(_0x46ca09){return _0x46ca09?{'count':_0x27830f,'rows':_0x46ca09}:null;}})[_0x557b('0x19')](respondWithResult(_0x3d270e,null))['catch'](handleError(_0x3d270e,null));};exports[_0x557b('0x5f')]=function(_0x3bab32,_0x8b15d4,_0x4c8b31){var _0x2f17ad={};var _0x336eee={};var _0x369f2f;var _0x4cfd4f;return db[_0x557b('0x4e')][_0x557b('0x59')]({'where':{'id':_0x3bab32[_0x557b('0x54')]['id']}})[_0x557b('0x19')](handleEntityNotFound(_0x8b15d4,null))[_0x557b('0x19')](function(_0xba0e68){if(_0xba0e68){_0x369f2f=_0xba0e68;_0x336eee['model']=_['keys'](db[_0x557b('0x60')][_0x557b('0x34')]);_0x336eee[_0x557b('0x37')]=_[_0x557b('0x36')](_0x3bab32['query']);_0x336eee[_0x557b('0x3a')]=_['intersection'](_0x336eee[_0x557b('0x35')],_0x336eee[_0x557b('0x37')]);_0x2f17ad['attributes']=_[_0x557b('0x3b')](_0x336eee[_0x557b('0x35')],qs[_0x557b('0x3d')](_0x3bab32[_0x557b('0x37')][_0x557b('0x3d')]));_0x2f17ad[_0x557b('0x3c')]=_0x2f17ad[_0x557b('0x3c')]['length']?_0x2f17ad[_0x557b('0x3c')]:_0x336eee[_0x557b('0x35')];_0x2f17ad['order']=qs[_0x557b('0x41')](_0x3bab32[_0x557b('0x37')][_0x557b('0x41')]);_0x2f17ad[_0x557b('0x45')]=qs[_0x557b('0x3a')](_[_0x557b('0x42')](_0x3bab32[_0x557b('0x37')],_0x336eee[_0x557b('0x3a')]));if(_0x3bab32[_0x557b('0x37')]['filter']){_0x2f17ad[_0x557b('0x45')]=_[_0x557b('0x4c')](_0x2f17ad[_0x557b('0x45')],{'$or':_['map'](_0x2f17ad['attributes'],function(_0x51f064){var _0x208d42={};_0x208d42[_0x51f064]={'$like':'%'+_0x3bab32['query'][_0x557b('0x46')]+'%'};return _0x208d42;})});}_0x2f17ad=_[_0x557b('0x4c')]({},_0x2f17ad,_0x3bab32[_0x557b('0x4d')]);return _0x369f2f[_0x557b('0x5f')](_0x2f17ad);}})[_0x557b('0x19')](function(_0x351609){if(_0x351609){_0x4cfd4f=_0x351609[_0x557b('0x3e')];if(!_0x3bab32[_0x557b('0x37')]['hasOwnProperty'](_0x557b('0x40'))){_0x2f17ad['limit']=qs[_0x557b('0x5c')](_0x3bab32['query'][_0x557b('0x5c')]);_0x2f17ad[_0x557b('0x26')]=qs['offset'](_0x3bab32[_0x557b('0x37')][_0x557b('0x26')]);}return _0x369f2f[_0x557b('0x5f')](_0x2f17ad);}})[_0x557b('0x19')](function(_0x560d62){if(_0x560d62){return _0x560d62?{'count':_0x4cfd4f,'rows':_0x560d62}:null;}})['then'](respondWithResult(_0x8b15d4,null))['catch'](handleError(_0x8b15d4,null));};exports[_0x557b('0x61')]=function(_0x2ba1e9,_0xb81241,_0x4764d5){if(_0x2ba1e9[_0x557b('0x57')]['id']){delete _0x2ba1e9[_0x557b('0x57')]['id'];}return db['ZendeskConfiguration'][_0x557b('0x59')]({'where':{'id':_0x2ba1e9[_0x557b('0x54')]['id']}})[_0x557b('0x19')](handleEntityNotFound(_0xb81241,null))['then'](function(_0x2100ee){if(_0x2100ee){return _0x2100ee[_0x557b('0x61')](_0x2ba1e9[_0x557b('0x57')][_0x557b('0x62')]||[]);}return null;})[_0x557b('0x19')](respondWithResult(_0xb81241,null))[_0x557b('0x23')](handleError(_0xb81241,null));};
\ No newline at end of file
+var _0xdc63=['http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','name','send','index','ZendeskConfiguration','model','keys','dateStart','query','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','day','add','merge','where','key','VIRTUAL','field','filter','options','findAll','includeAll','find','create','body','params','getFields','findOne','pick','map','getSubjects','ZendeskField','rawAttributes','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','querystring','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','client'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0xdc63,0x1a0));var _0x3dc6=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xdc63[_0x2064e5];return _0x21a233;};'use strict';var pdf=require(_0x3dc6('0x0'));var emlformat=require(_0x3dc6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3dc6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3dc6('0x3'));var moment=require(_0x3dc6('0x4'));var BPromise=require(_0x3dc6('0x5'));var Mustache=require(_0x3dc6('0x6'));var util=require('util');var path=require(_0x3dc6('0x7'));var sox=require(_0x3dc6('0x8'));var csv=require(_0x3dc6('0x9'));var ejs=require(_0x3dc6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3dc6('0xb'));var jsforce=require(_0x3dc6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3dc6('0x9'));var querystring=require(_0x3dc6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0x3dc6('0xe'));var logger=require(_0x3dc6('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x3dc6('0x10'));var db=require(_0x3dc6('0x11'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3dc6('0x12')][_0x3dc6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x3efa3c,_0xa366a3,_0x56c1b8,_0x5398cc){return new BPromise(function(_0x45e15c,_0x1b4f85){var _0x6ca8fb=_0x5398cc||client;return _0x6ca8fb['request'](_0x3efa3c,_0x56c1b8)[_0x3dc6('0x14')](function(_0x3dc22c){logger['info'](_0x3dc6('0x15'),_0xa366a3,_0x3dc6('0x16'));logger['debug'](_0x3dc6('0x17'),_0xa366a3,_0x3dc6('0x16'),JSON['stringify'](_0x3dc22c));if(_0x3dc22c[_0x3dc6('0x18')]){if(_0x3dc22c['error']['code']===0x1f4){logger[_0x3dc6('0x18')](_0x3dc6('0x15'),_0xa366a3,_0x3dc22c[_0x3dc6('0x18')][_0x3dc6('0x19')]);return _0x1b4f85(_0x3dc22c[_0x3dc6('0x18')][_0x3dc6('0x19')]);}logger[_0x3dc6('0x18')](_0x3dc6('0x15'),_0xa366a3,_0x3dc22c[_0x3dc6('0x18')][_0x3dc6('0x19')]);return _0x45e15c(_0x3dc22c['error'][_0x3dc6('0x19')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xa366a3,_0x3dc6('0x16'));_0x45e15c(_0x3dc22c[_0x3dc6('0x1a')]['message']);}})[_0x3dc6('0x1b')](function(_0x3e8a57){logger[_0x3dc6('0x18')](_0x3dc6('0x15'),_0xa366a3,_0x3e8a57);_0x1b4f85(_0x3e8a57);});});}function respondWithStatusCode(_0x41bf76,_0x496e61){_0x496e61=_0x496e61||0xcc;return function(_0x15e669){if(_0x15e669){return _0x41bf76[_0x3dc6('0x1c')](_0x496e61);}return _0x41bf76['status'](_0x496e61)[_0x3dc6('0x1d')]();};}function respondWithResult(_0x525c0b,_0x3463e2){_0x3463e2=_0x3463e2||0xc8;return function(_0x291e18){if(_0x291e18){return _0x525c0b['status'](_0x3463e2)[_0x3dc6('0x1e')](_0x291e18);}};}function respondWithFilteredResult(_0x2d494a,_0x3ae385){return function(_0x469a4f){if(_0x469a4f){var _0x44b721=_0x469a4f[_0x3dc6('0x1f')],_0xbca402=_0x3ae385[_0x3dc6('0x20')],_0x2b28e5=_0x3ae385['offset']+_0x3ae385[_0x3dc6('0x21')],_0x434665;if(_0x2b28e5>=_0x44b721){_0x2b28e5=_0x44b721;_0x434665=0xc8;}else{_0x434665=0xce;}_0x2d494a[_0x3dc6('0x22')](_0x434665);return _0x2d494a[_0x3dc6('0x23')](_0x3dc6('0x24'),_0xbca402+'-'+_0x2b28e5+'/'+_0x44b721)[_0x3dc6('0x1e')](_0x469a4f);}return null;};}function patchUpdates(_0x47992a){return function(_0x55aff4){try{jsonpatch[_0x3dc6('0x25')](_0x55aff4,_0x47992a,!![]);}catch(_0xf68e29){return BPromise[_0x3dc6('0x26')](_0xf68e29);}return _0x55aff4[_0x3dc6('0x27')]();};}function saveUpdates(_0x20e9db,_0x1948e6){return function(_0x559937){if(_0x559937){return _0x559937[_0x3dc6('0x28')](_0x20e9db)[_0x3dc6('0x14')](function(_0x44bb8f){return _0x44bb8f;});}return null;};}function removeEntity(_0x28b307,_0x5281db){return function(_0x5d4a41){if(_0x5d4a41){return _0x5d4a41[_0x3dc6('0x29')]()[_0x3dc6('0x14')](function(){_0x28b307[_0x3dc6('0x22')](0xcc)[_0x3dc6('0x1d')]();});}};}function handleEntityNotFound(_0x1b5fc6,_0x5ec5ef){return function(_0x5d92a2){if(!_0x5d92a2){_0x1b5fc6[_0x3dc6('0x1c')](0x194);}return _0x5d92a2;};}function handleError(_0x5cff6a,_0x3236fc){_0x3236fc=_0x3236fc||0x1f4;return function(_0x19b0cc){logger[_0x3dc6('0x18')](_0x19b0cc['stack']);if(_0x19b0cc[_0x3dc6('0x2a')]){delete _0x19b0cc[_0x3dc6('0x2a')];}_0x5cff6a[_0x3dc6('0x22')](_0x3236fc)[_0x3dc6('0x2b')](_0x19b0cc);};}exports[_0x3dc6('0x2c')]=function(_0x177470,_0x104f0a){var _0x332f60={},_0x21c2b6={},_0x3c87c7={'count':0x0,'rows':[]};var _0x1de27d=db[_0x3dc6('0x2d')]['rawAttributes'];_0x21c2b6[_0x3dc6('0x2e')]=_[_0x3dc6('0x2f')](_0x1de27d);var _0x25ef16={'dateStart':_0x177470['query'][_0x3dc6('0x30')],'dateEnd':_0x177470[_0x3dc6('0x31')][_0x3dc6('0x32')]};delete _0x177470[_0x3dc6('0x31')][_0x3dc6('0x30')];delete _0x177470[_0x3dc6('0x31')]['dateEnd'];_0x21c2b6[_0x3dc6('0x31')]=_['keys'](_0x177470[_0x3dc6('0x31')]);_0x21c2b6[_0x3dc6('0x33')]=_[_0x3dc6('0x34')](_0x21c2b6[_0x3dc6('0x2e')],_0x21c2b6['query']);_0x332f60['attributes']=_[_0x3dc6('0x34')](_0x21c2b6[_0x3dc6('0x2e')],qs[_0x3dc6('0x35')](_0x177470[_0x3dc6('0x31')][_0x3dc6('0x35')]));_0x332f60[_0x3dc6('0x36')]=_0x332f60[_0x3dc6('0x36')][_0x3dc6('0x37')]?_0x332f60['attributes']:_0x21c2b6[_0x3dc6('0x2e')];if(!_0x177470[_0x3dc6('0x31')][_0x3dc6('0x38')](_0x3dc6('0x39'))){_0x332f60[_0x3dc6('0x21')]=qs[_0x3dc6('0x21')](_0x177470[_0x3dc6('0x31')][_0x3dc6('0x21')]);_0x332f60[_0x3dc6('0x20')]=qs[_0x3dc6('0x20')](_0x177470['query'][_0x3dc6('0x20')]);}_0x332f60[_0x3dc6('0x3a')]=qs[_0x3dc6('0x3b')](_0x177470[_0x3dc6('0x31')][_0x3dc6('0x3b')]);_0x332f60['where']=qs[_0x3dc6('0x33')](_['pick'](_0x177470[_0x3dc6('0x31')],_0x21c2b6['filters']));if(_0x25ef16['dateStart']){if(_0x25ef16['dateEnd']){_0x25ef16[_0x3dc6('0x32')]=moment(_0x25ef16[_0x3dc6('0x32')])['add'](0x1,_0x3dc6('0x3c'));}else{_0x25ef16[_0x3dc6('0x32')]=moment(_0x25ef16[_0x3dc6('0x30')])[_0x3dc6('0x3d')](0x1,_0x3dc6('0x3c'));}_[_0x3dc6('0x3e')](_0x332f60['where'],{'createdAt':{'$gte':_0x25ef16[_0x3dc6('0x30')],'$lte':_0x25ef16['dateEnd']}});}if(_0x177470[_0x3dc6('0x31')]['filter']){_0x332f60['where']=_[_0x3dc6('0x3e')](_0x332f60[_0x3dc6('0x3f')],{'$or':_['map'](_0x1de27d,function(_0x1787ae){if(_0x1787ae['type'][_0x3dc6('0x40')]!==_0x3dc6('0x41')){var _0x3752b4={};_0x3752b4[_0x1787ae[_0x3dc6('0x42')]]={'$like':'%'+_0x177470['query'][_0x3dc6('0x43')]+'%'};return _0x3752b4;}})});}_0x332f60=_[_0x3dc6('0x3e')]({},_0x332f60,_0x177470[_0x3dc6('0x44')]);var _0x1f39a5={'where':_0x332f60[_0x3dc6('0x3f')]};return db['ZendeskConfiguration'][_0x3dc6('0x1f')](_0x1f39a5)[_0x3dc6('0x14')](function(_0x470da4){_0x3c87c7['count']=_0x470da4;if(_0x177470[_0x3dc6('0x31')]['includeAll']){_0x332f60['include']=[{'all':!![]}];}return db[_0x3dc6('0x2d')][_0x3dc6('0x45')](_0x332f60);})[_0x3dc6('0x14')](function(_0x1d0da9){_0x3c87c7['rows']=_0x1d0da9;return _0x3c87c7;})['then'](respondWithFilteredResult(_0x104f0a,_0x332f60))[_0x3dc6('0x1b')](handleError(_0x104f0a,null));};exports['show']=function(_0x6c59e8,_0x46f1fe){var _0x4ce1d9={'raw':![],'where':{'id':_0x6c59e8['params']['id']}},_0x565905={};_0x565905[_0x3dc6('0x2e')]=_[_0x3dc6('0x2f')](db[_0x3dc6('0x2d')]['rawAttributes']);_0x565905[_0x3dc6('0x31')]=_[_0x3dc6('0x2f')](_0x6c59e8['query']);_0x565905[_0x3dc6('0x33')]=_[_0x3dc6('0x34')](_0x565905[_0x3dc6('0x2e')],_0x565905['query']);_0x4ce1d9[_0x3dc6('0x36')]=_['intersection'](_0x565905[_0x3dc6('0x2e')],qs[_0x3dc6('0x35')](_0x6c59e8['query']['fields']));_0x4ce1d9[_0x3dc6('0x36')]=_0x4ce1d9[_0x3dc6('0x36')][_0x3dc6('0x37')]?_0x4ce1d9['attributes']:_0x565905['model'];if(_0x6c59e8[_0x3dc6('0x31')][_0x3dc6('0x46')]){_0x4ce1d9['include']=[{'all':!![]}];}_0x4ce1d9=_[_0x3dc6('0x3e')]({},_0x4ce1d9,_0x6c59e8['options']);return db[_0x3dc6('0x2d')][_0x3dc6('0x47')](_0x4ce1d9)[_0x3dc6('0x14')](handleEntityNotFound(_0x46f1fe,null))[_0x3dc6('0x14')](respondWithResult(_0x46f1fe,null))[_0x3dc6('0x1b')](handleError(_0x46f1fe,null));};exports[_0x3dc6('0x48')]=function(_0x494bd0,_0x45e9dd){return db[_0x3dc6('0x2d')][_0x3dc6('0x48')](_0x494bd0[_0x3dc6('0x49')],{})[_0x3dc6('0x14')](respondWithResult(_0x45e9dd,0xc9))[_0x3dc6('0x1b')](handleError(_0x45e9dd,null));};exports[_0x3dc6('0x28')]=function(_0xc8886,_0x2718af){if(_0xc8886[_0x3dc6('0x49')]['id']){delete _0xc8886[_0x3dc6('0x49')]['id'];}return db[_0x3dc6('0x2d')]['find']({'where':{'id':_0xc8886[_0x3dc6('0x4a')]['id']}})[_0x3dc6('0x14')](handleEntityNotFound(_0x2718af,null))[_0x3dc6('0x14')](saveUpdates(_0xc8886[_0x3dc6('0x49')],null))['then'](respondWithResult(_0x2718af,null))[_0x3dc6('0x1b')](handleError(_0x2718af,null));};exports['destroy']=function(_0x314324,_0x3294cc){return db[_0x3dc6('0x2d')][_0x3dc6('0x47')]({'where':{'id':_0x314324[_0x3dc6('0x4a')]['id']}})[_0x3dc6('0x14')](handleEntityNotFound(_0x3294cc,null))['then'](removeEntity(_0x3294cc,null))[_0x3dc6('0x1b')](handleError(_0x3294cc,null));};exports[_0x3dc6('0x4b')]=function(_0x4cf3c4,_0x3d427f,_0xfd7cb3){var _0x4d5382={};var _0x14cc6d={};var _0x4adc44;var _0x11795b;return db[_0x3dc6('0x2d')][_0x3dc6('0x4c')]({'where':{'id':_0x4cf3c4[_0x3dc6('0x4a')]['id']}})[_0x3dc6('0x14')](handleEntityNotFound(_0x3d427f,null))[_0x3dc6('0x14')](function(_0x20e9ed){if(_0x20e9ed){_0x4adc44=_0x20e9ed;_0x14cc6d[_0x3dc6('0x2e')]=_[_0x3dc6('0x2f')](db['ZendeskField']['rawAttributes']);_0x14cc6d[_0x3dc6('0x31')]=_[_0x3dc6('0x2f')](_0x4cf3c4[_0x3dc6('0x31')]);_0x14cc6d[_0x3dc6('0x33')]=_[_0x3dc6('0x34')](_0x14cc6d['model'],_0x14cc6d[_0x3dc6('0x31')]);_0x4d5382[_0x3dc6('0x36')]=_[_0x3dc6('0x34')](_0x14cc6d[_0x3dc6('0x2e')],qs['fields'](_0x4cf3c4['query'][_0x3dc6('0x35')]));_0x4d5382[_0x3dc6('0x36')]=_0x4d5382[_0x3dc6('0x36')][_0x3dc6('0x37')]?_0x4d5382[_0x3dc6('0x36')]:_0x14cc6d[_0x3dc6('0x2e')];_0x4d5382['order']=qs['sort'](_0x4cf3c4[_0x3dc6('0x31')][_0x3dc6('0x3b')]);_0x4d5382[_0x3dc6('0x3f')]=qs[_0x3dc6('0x33')](_[_0x3dc6('0x4d')](_0x4cf3c4['query'],_0x14cc6d[_0x3dc6('0x33')]));if(_0x4cf3c4[_0x3dc6('0x31')][_0x3dc6('0x43')]){_0x4d5382['where']=_[_0x3dc6('0x3e')](_0x4d5382[_0x3dc6('0x3f')],{'$or':_[_0x3dc6('0x4e')](_0x4d5382[_0x3dc6('0x36')],function(_0x4d3b74){var _0x5e2f56={};_0x5e2f56[_0x4d3b74]={'$like':'%'+_0x4cf3c4[_0x3dc6('0x31')][_0x3dc6('0x43')]+'%'};return _0x5e2f56;})});}_0x4d5382=_[_0x3dc6('0x3e')]({},_0x4d5382,_0x4cf3c4[_0x3dc6('0x44')]);return _0x4adc44[_0x3dc6('0x4b')](_0x4d5382);}})['then'](function(_0x5ce384){if(_0x5ce384){_0x11795b=_0x5ce384[_0x3dc6('0x37')];if(!_0x4cf3c4[_0x3dc6('0x31')][_0x3dc6('0x38')](_0x3dc6('0x39'))){_0x4d5382[_0x3dc6('0x21')]=qs['limit'](_0x4cf3c4[_0x3dc6('0x31')][_0x3dc6('0x21')]);_0x4d5382[_0x3dc6('0x20')]=qs[_0x3dc6('0x20')](_0x4cf3c4['query'][_0x3dc6('0x20')]);}return _0x4adc44['getFields'](_0x4d5382);}})[_0x3dc6('0x14')](function(_0x23aab1){if(_0x23aab1){return _0x23aab1?{'count':_0x11795b,'rows':_0x23aab1}:null;}})[_0x3dc6('0x14')](respondWithResult(_0x3d427f,null))['catch'](handleError(_0x3d427f,null));};exports[_0x3dc6('0x4f')]=function(_0x5d7444,_0x7ddc23,_0x5c8920){var _0x445bf0={};var _0x5e2656={};var _0x28177e;var _0x3222c7;return db[_0x3dc6('0x2d')][_0x3dc6('0x4c')]({'where':{'id':_0x5d7444['params']['id']}})[_0x3dc6('0x14')](handleEntityNotFound(_0x7ddc23,null))[_0x3dc6('0x14')](function(_0x2cc9fc){if(_0x2cc9fc){_0x28177e=_0x2cc9fc;_0x5e2656[_0x3dc6('0x2e')]=_[_0x3dc6('0x2f')](db[_0x3dc6('0x50')][_0x3dc6('0x51')]);_0x5e2656[_0x3dc6('0x31')]=_['keys'](_0x5d7444[_0x3dc6('0x31')]);_0x5e2656[_0x3dc6('0x33')]=_[_0x3dc6('0x34')](_0x5e2656[_0x3dc6('0x2e')],_0x5e2656[_0x3dc6('0x31')]);_0x445bf0['attributes']=_[_0x3dc6('0x34')](_0x5e2656[_0x3dc6('0x2e')],qs[_0x3dc6('0x35')](_0x5d7444[_0x3dc6('0x31')][_0x3dc6('0x35')]));_0x445bf0[_0x3dc6('0x36')]=_0x445bf0[_0x3dc6('0x36')][_0x3dc6('0x37')]?_0x445bf0['attributes']:_0x5e2656[_0x3dc6('0x2e')];_0x445bf0[_0x3dc6('0x3a')]=qs[_0x3dc6('0x3b')](_0x5d7444[_0x3dc6('0x31')]['sort']);_0x445bf0[_0x3dc6('0x3f')]=qs[_0x3dc6('0x33')](_[_0x3dc6('0x4d')](_0x5d7444[_0x3dc6('0x31')],_0x5e2656[_0x3dc6('0x33')]));if(_0x5d7444[_0x3dc6('0x31')]['filter']){_0x445bf0[_0x3dc6('0x3f')]=_[_0x3dc6('0x3e')](_0x445bf0[_0x3dc6('0x3f')],{'$or':_[_0x3dc6('0x4e')](_0x445bf0[_0x3dc6('0x36')],function(_0x802269){var _0x1de6fb={};_0x1de6fb[_0x802269]={'$like':'%'+_0x5d7444[_0x3dc6('0x31')][_0x3dc6('0x43')]+'%'};return _0x1de6fb;})});}_0x445bf0=_[_0x3dc6('0x3e')]({},_0x445bf0,_0x5d7444['options']);return _0x28177e['getSubjects'](_0x445bf0);}})[_0x3dc6('0x14')](function(_0x1147d2){if(_0x1147d2){_0x3222c7=_0x1147d2['length'];if(!_0x5d7444['query'][_0x3dc6('0x38')](_0x3dc6('0x39'))){_0x445bf0['limit']=qs['limit'](_0x5d7444[_0x3dc6('0x31')][_0x3dc6('0x21')]);_0x445bf0[_0x3dc6('0x20')]=qs[_0x3dc6('0x20')](_0x5d7444[_0x3dc6('0x31')]['offset']);}return _0x28177e[_0x3dc6('0x4f')](_0x445bf0);}})[_0x3dc6('0x14')](function(_0x4f1576){if(_0x4f1576){return _0x4f1576?{'count':_0x3222c7,'rows':_0x4f1576}:null;}})['then'](respondWithResult(_0x7ddc23,null))[_0x3dc6('0x1b')](handleError(_0x7ddc23,null));};exports[_0x3dc6('0x52')]=function(_0x152baa,_0x393186,_0x586483){var _0x2c5fd1={};var _0x556a6b={};var _0x2a55ba;var _0x18a47d;return db[_0x3dc6('0x2d')][_0x3dc6('0x4c')]({'where':{'id':_0x152baa[_0x3dc6('0x4a')]['id']}})[_0x3dc6('0x14')](handleEntityNotFound(_0x393186,null))[_0x3dc6('0x14')](function(_0x19e890){if(_0x19e890){_0x2a55ba=_0x19e890;_0x556a6b[_0x3dc6('0x2e')]=_[_0x3dc6('0x2f')](db['ZendeskField']['rawAttributes']);_0x556a6b[_0x3dc6('0x31')]=_[_0x3dc6('0x2f')](_0x152baa[_0x3dc6('0x31')]);_0x556a6b['filters']=_['intersection'](_0x556a6b[_0x3dc6('0x2e')],_0x556a6b[_0x3dc6('0x31')]);_0x2c5fd1[_0x3dc6('0x36')]=_[_0x3dc6('0x34')](_0x556a6b[_0x3dc6('0x2e')],qs[_0x3dc6('0x35')](_0x152baa['query'][_0x3dc6('0x35')]));_0x2c5fd1[_0x3dc6('0x36')]=_0x2c5fd1[_0x3dc6('0x36')][_0x3dc6('0x37')]?_0x2c5fd1[_0x3dc6('0x36')]:_0x556a6b[_0x3dc6('0x2e')];_0x2c5fd1['order']=qs[_0x3dc6('0x3b')](_0x152baa[_0x3dc6('0x31')][_0x3dc6('0x3b')]);_0x2c5fd1['where']=qs[_0x3dc6('0x33')](_[_0x3dc6('0x4d')](_0x152baa[_0x3dc6('0x31')],_0x556a6b[_0x3dc6('0x33')]));if(_0x152baa[_0x3dc6('0x31')][_0x3dc6('0x43')]){_0x2c5fd1[_0x3dc6('0x3f')]=_[_0x3dc6('0x3e')](_0x2c5fd1[_0x3dc6('0x3f')],{'$or':_['map'](_0x2c5fd1[_0x3dc6('0x36')],function(_0xc7627){var _0x3a8a14={};_0x3a8a14[_0xc7627]={'$like':'%'+_0x152baa[_0x3dc6('0x31')][_0x3dc6('0x43')]+'%'};return _0x3a8a14;})});}_0x2c5fd1=_[_0x3dc6('0x3e')]({},_0x2c5fd1,_0x152baa[_0x3dc6('0x44')]);return _0x2a55ba['getDescriptions'](_0x2c5fd1);}})['then'](function(_0x171368){if(_0x171368){_0x18a47d=_0x171368[_0x3dc6('0x37')];if(!_0x152baa['query'][_0x3dc6('0x38')](_0x3dc6('0x39'))){_0x2c5fd1[_0x3dc6('0x21')]=qs[_0x3dc6('0x21')](_0x152baa[_0x3dc6('0x31')][_0x3dc6('0x21')]);_0x2c5fd1[_0x3dc6('0x20')]=qs[_0x3dc6('0x20')](_0x152baa[_0x3dc6('0x31')][_0x3dc6('0x20')]);}return _0x2a55ba['getDescriptions'](_0x2c5fd1);}})[_0x3dc6('0x14')](function(_0x1766e0){if(_0x1766e0){return _0x1766e0?{'count':_0x18a47d,'rows':_0x1766e0}:null;}})[_0x3dc6('0x14')](respondWithResult(_0x393186,null))[_0x3dc6('0x1b')](handleError(_0x393186,null));};exports['getTags']=function(_0x3de4eb,_0x294f5b,_0xbdf79c){var _0x22f829={};var _0x1bf29d={};var _0x575541;var _0x393131;return db[_0x3dc6('0x2d')][_0x3dc6('0x4c')]({'where':{'id':_0x3de4eb[_0x3dc6('0x4a')]['id']}})[_0x3dc6('0x14')](handleEntityNotFound(_0x294f5b,null))[_0x3dc6('0x14')](function(_0x472b8c){if(_0x472b8c){_0x575541=_0x472b8c;_0x1bf29d[_0x3dc6('0x2e')]=_[_0x3dc6('0x2f')](db[_0x3dc6('0x53')]['rawAttributes']);_0x1bf29d['query']=_[_0x3dc6('0x2f')](_0x3de4eb[_0x3dc6('0x31')]);_0x1bf29d['filters']=_[_0x3dc6('0x34')](_0x1bf29d[_0x3dc6('0x2e')],_0x1bf29d[_0x3dc6('0x31')]);_0x22f829[_0x3dc6('0x36')]=_[_0x3dc6('0x34')](_0x1bf29d[_0x3dc6('0x2e')],qs[_0x3dc6('0x35')](_0x3de4eb[_0x3dc6('0x31')]['fields']));_0x22f829[_0x3dc6('0x36')]=_0x22f829[_0x3dc6('0x36')][_0x3dc6('0x37')]?_0x22f829['attributes']:_0x1bf29d[_0x3dc6('0x2e')];_0x22f829[_0x3dc6('0x3a')]=qs['sort'](_0x3de4eb['query']['sort']);_0x22f829[_0x3dc6('0x3f')]=qs[_0x3dc6('0x33')](_[_0x3dc6('0x4d')](_0x3de4eb[_0x3dc6('0x31')],_0x1bf29d[_0x3dc6('0x33')]));if(_0x3de4eb['query'][_0x3dc6('0x43')]){_0x22f829[_0x3dc6('0x3f')]=_[_0x3dc6('0x3e')](_0x22f829['where'],{'$or':_['map'](_0x22f829[_0x3dc6('0x36')],function(_0x313e3a){var _0x459212={};_0x459212[_0x313e3a]={'$like':'%'+_0x3de4eb[_0x3dc6('0x31')][_0x3dc6('0x43')]+'%'};return _0x459212;})});}_0x22f829=_[_0x3dc6('0x3e')]({},_0x22f829,_0x3de4eb[_0x3dc6('0x44')]);return _0x575541[_0x3dc6('0x54')](_0x22f829);}})['then'](function(_0x412f8e){if(_0x412f8e){_0x393131=_0x412f8e[_0x3dc6('0x37')];if(!_0x3de4eb[_0x3dc6('0x31')][_0x3dc6('0x38')]('nolimit')){_0x22f829[_0x3dc6('0x21')]=qs['limit'](_0x3de4eb[_0x3dc6('0x31')][_0x3dc6('0x21')]);_0x22f829['offset']=qs['offset'](_0x3de4eb['query'][_0x3dc6('0x20')]);}return _0x575541['getTags'](_0x22f829);}})[_0x3dc6('0x14')](function(_0x2621ef){if(_0x2621ef){return _0x2621ef?{'count':_0x393131,'rows':_0x2621ef}:null;}})[_0x3dc6('0x14')](respondWithResult(_0x294f5b,null))['catch'](handleError(_0x294f5b,null));};exports[_0x3dc6('0x55')]=function(_0x496db4,_0x334c14,_0x274433){if(_0x496db4[_0x3dc6('0x49')]['id']){delete _0x496db4[_0x3dc6('0x49')]['id'];}return db['ZendeskConfiguration'][_0x3dc6('0x4c')]({'where':{'id':_0x496db4[_0x3dc6('0x4a')]['id']}})[_0x3dc6('0x14')](handleEntityNotFound(_0x334c14,null))[_0x3dc6('0x14')](function(_0x4e79eb){if(_0x4e79eb){return _0x4e79eb[_0x3dc6('0x55')](_0x496db4[_0x3dc6('0x49')][_0x3dc6('0x56')]||[]);}return null;})[_0x3dc6('0x14')](respondWithResult(_0x334c14,null))[_0x3dc6('0x1b')](handleError(_0x334c14,null));};
\ No newline at end of file
index f4eb4dd..ac76dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdae0=['moment','request-promise','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger'];(function(_0x10e119,_0x1c2921){var _0xe820f2=function(_0x1a0a42){while(--_0x1a0a42){_0x10e119['push'](_0x10e119['shift']());}};_0xe820f2(++_0x1c2921);}(_0xdae0,0x9d));var _0x0dae=function(_0x146d64,_0x20642a){_0x146d64=_0x146d64-0x0;var _0xd513c0=_0xdae0[_0x146d64];return _0xd513c0;};'use strict';var _=require(_0x0dae('0x0'));var util=require(_0x0dae('0x1'));var logger=require(_0x0dae('0x2'))('api');var moment=require(_0x0dae('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dae('0x4'));var attributes=require(_0x0dae('0x5'));module[_0x0dae('0x6')]=function(_0x41cb91,_0x3c0b8e){return _0x41cb91[_0x0dae('0x7')](_0x0dae('0x8'),attributes,{'tableName':_0x0dae('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa29d=['bluebird','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment'];(function(_0x2f8e8b,_0x221691){var _0x485311=function(_0x48dd31){while(--_0x48dd31){_0x2f8e8b['push'](_0x2f8e8b['shift']());}};_0x485311(++_0x221691);}(_0xa29d,0xd8));var _0xda29=function(_0x1f57cf,_0x542d6b){_0x1f57cf=_0x1f57cf-0x0;var _0x502127=_0xa29d[_0x1f57cf];return _0x502127;};'use strict';var _=require(_0xda29('0x0'));var util=require('util');var logger=require(_0xda29('0x1'))(_0xda29('0x2'));var moment=require(_0xda29('0x3'));var BPromise=require(_0xda29('0x4'));var rp=require('request-promise');var attributes=require(_0xda29('0x5'));module[_0xda29('0x6')]=function(_0x465fb6,_0x4b0852){return _0x465fb6[_0xda29('0x7')](_0xda29('0x8'),attributes,{'tableName':_0xda29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a2f5c5..3e9628a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c8=['stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x58682e,_0x48176d){var _0x533e59=function(_0x4a5513){while(--_0x4a5513){_0x58682e['push'](_0x58682e['shift']());}};_0x533e59(++_0x48176d);}(_0xc1c8,0xcd));var _0x8c1c=function(_0x425c47,_0x5282b1){_0x425c47=_0x425c47-0x0;var _0x16fb90=_0xc1c8[_0x425c47];return _0x16fb90;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8c1c('0x0'));var BPromise=require(_0x8c1c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c1c('0x2'))['db'];var utils=require(_0x8c1c('0x3'));var logger=require(_0x8c1c('0x4'))('rpc');var config=require(_0x8c1c('0x5'));var jayson=require(_0x8c1c('0x6'));var client=jayson[_0x8c1c('0x7')][_0x8c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11a029,_0x5da252,_0x35f4e6){return new BPromise(function(_0x488250,_0x3ae10c){return client[_0x8c1c('0x9')](_0x11a029,_0x35f4e6)[_0x8c1c('0xa')](function(_0x3c943e){logger[_0x8c1c('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5da252,_0x8c1c('0xc'));logger[_0x8c1c('0xd')](_0x8c1c('0xe'),_0x5da252,_0x8c1c('0xc'),JSON[_0x8c1c('0xf')](_0x3c943e));if(_0x3c943e[_0x8c1c('0x10')]){if(_0x3c943e[_0x8c1c('0x10')][_0x8c1c('0x11')]===0x1f4){logger[_0x8c1c('0x10')](_0x8c1c('0x12'),_0x5da252,_0x3c943e[_0x8c1c('0x10')][_0x8c1c('0x13')]);return _0x3ae10c(_0x3c943e[_0x8c1c('0x10')][_0x8c1c('0x13')]);}logger['error'](_0x8c1c('0x12'),_0x5da252,_0x3c943e['error'][_0x8c1c('0x13')]);return _0x488250(_0x3c943e[_0x8c1c('0x10')]['message']);}else{logger[_0x8c1c('0xb')](_0x8c1c('0x12'),_0x5da252,_0x8c1c('0xc'));_0x488250(_0x3c943e[_0x8c1c('0x14')][_0x8c1c('0x13')]);}})[_0x8c1c('0x15')](function(_0x47cb14){logger[_0x8c1c('0x10')](_0x8c1c('0x12'),_0x5da252,_0x47cb14);_0x3ae10c(_0x47cb14);});});}
\ No newline at end of file
+var _0x1832=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x1118fa,_0x2fbf7b){var _0x1d9836=function(_0x5c9c51){while(--_0x5c9c51){_0x1118fa['push'](_0x1118fa['shift']());}};_0x1d9836(++_0x2fbf7b);}(_0x1832,0x120));var _0x2183=function(_0x56b151,_0x91b0f9){_0x56b151=_0x56b151-0x0;var _0x2edfb0=_0x1832[_0x56b151];return _0x2edfb0;};'use strict';var _=require(_0x2183('0x0'));var util=require(_0x2183('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2183('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2183('0x3'))['db'];var utils=require(_0x2183('0x4'));var logger=require('../../config/logger')(_0x2183('0x5'));var config=require('../../config/environment');var jayson=require(_0x2183('0x6'));var client=jayson['client'][_0x2183('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ef5b0,_0x3ff669,_0xe17255){return new BPromise(function(_0x286315,_0x562b9d){return client[_0x2183('0x8')](_0x5ef5b0,_0xe17255)[_0x2183('0x9')](function(_0x4ddd81){logger[_0x2183('0xa')](_0x2183('0xb'),_0x3ff669,'request\x20sent');logger['debug'](_0x2183('0xc'),_0x3ff669,'request\x20sent',JSON[_0x2183('0xd')](_0x4ddd81));if(_0x4ddd81[_0x2183('0xe')]){if(_0x4ddd81['error'][_0x2183('0xf')]===0x1f4){logger[_0x2183('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3ff669,_0x4ddd81[_0x2183('0xe')][_0x2183('0x10')]);return _0x562b9d(_0x4ddd81[_0x2183('0xe')][_0x2183('0x10')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3ff669,_0x4ddd81[_0x2183('0xe')]['message']);return _0x286315(_0x4ddd81['error']['message']);}else{logger[_0x2183('0xa')](_0x2183('0xb'),_0x3ff669,_0x2183('0x11'));_0x286315(_0x4ddd81[_0x2183('0x12')][_0x2183('0x10')]);}})[_0x2183('0x13')](function(_0xa07908){logger[_0x2183('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3ff669,_0xa07908);_0x562b9d(_0xa07908);});});}
\ No newline at end of file
index 8fae80a..120a921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x174314,_0x36270d){var _0x54f363=function(_0x30d8e8){while(--_0x30d8e8){_0x174314['push'](_0x174314['shift']());}};_0x54f363(++_0x36270d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x1c8566,_0x19a77e){var _0xc64013=function(_0x386480){while(--_0x386480){_0x1c8566['push'](_0x1c8566['shift']());}};_0xc64013(++_0x19a77e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 43974c0..f0086e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x64706b,_0x494f8e){var _0x17c16f=function(_0x19891d){while(--_0x19891d){_0x64706b['push'](_0x64706b['shift']());}};_0x17c16f(++_0x494f8e);}(_0x750a,0x140));var _0xa750=function(_0x2a60c0,_0x5f49db){_0x2a60c0=_0x2a60c0-0x0;var _0x1fdb20=_0x750a[_0x2a60c0];return _0x1fdb20;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa750('0x1'),_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x4')},'content':{'type':Sequelize[_0xa750('0x5')]},'key':{'type':Sequelize[_0xa750('0x5')]},'keyType':{'type':Sequelize[_0xa750('0x6')](_0xa750('0x4'),_0xa750('0x1'),_0xa750('0x2'))},'keyContent':{'type':Sequelize[_0xa750('0x5')]},'idField':{'type':Sequelize[_0xa750('0x5')]},'nameField':{'type':Sequelize[_0xa750('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0bb5=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x0bb5,0x148));var _0x50bb=function(_0x269c08,_0x369a0b){_0x269c08=_0x269c08-0x0;var _0x485381=_0x0bb5[_0x269c08];return _0x485381;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x50bb('0x2'),_0x50bb('0x3'),_0x50bb('0x4')),'defaultValue':_0x50bb('0x5')},'content':{'type':Sequelize[_0x50bb('0x6')]},'key':{'type':Sequelize[_0x50bb('0x6')]},'keyType':{'type':Sequelize[_0x50bb('0x7')](_0x50bb('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x50bb('0x6')]},'idField':{'type':Sequelize[_0x50bb('0x6')]},'nameField':{'type':Sequelize[_0x50bb('0x6')]},'customField':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5c844b3..4110cef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3239=['merge','filter','map','VIRTUAL','options','includeAll','include','findAll','catch','show','length','create','body','params','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','count','offset','status','set','apply','update','destroy','then','end','error','stack','name','send','index','ZendeskField','rawAttributes','keys','query','dateEnd','dateStart','intersection','model','attributes','fields','nolimit','limit','order','sort','where','filters','pick','add','day'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x3239,0x168));var _0x9323=function(_0x2cc8d9,_0x431513){_0x2cc8d9=_0x2cc8d9-0x0;var _0x568579=_0x3239[_0x2cc8d9];return _0x568579;};'use strict';var pdf=require(_0x9323('0x0'));var emlformat=require(_0x9323('0x1'));var rimraf=require(_0x9323('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9323('0x3'));var moment=require('moment');var BPromise=require(_0x9323('0x4'));var Mustache=require(_0x9323('0x5'));var util=require('util');var path=require(_0x9323('0x6'));var sox=require(_0x9323('0x7'));var csv=require(_0x9323('0x8'));var ejs=require(_0x9323('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9323('0xa'));var crypto=require(_0x9323('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9323('0xc'));var Papa=require(_0x9323('0xd'));var Redis=require('ioredis');var qs=require(_0x9323('0xe'));var logger=require(_0x9323('0xf'))('api');var utils=require(_0x9323('0x10'));var config=require(_0x9323('0x11'));var db=require(_0x9323('0x12'))['db'];function respondWithStatusCode(_0x137bd4,_0x317be8){_0x317be8=_0x317be8||0xcc;return function(_0x1efb1b){if(_0x1efb1b){return _0x137bd4[_0x9323('0x13')](_0x317be8);}return _0x137bd4['status'](_0x317be8)['end']();};}function respondWithResult(_0x2fe961,_0x16a73f){_0x16a73f=_0x16a73f||0xc8;return function(_0x31da86){if(_0x31da86){return _0x2fe961['status'](_0x16a73f)[_0x9323('0x14')](_0x31da86);}};}function respondWithFilteredResult(_0x45397b,_0x29f6d8){return function(_0x492a20){if(_0x492a20){var _0x2b5cbf=_0x492a20[_0x9323('0x15')],_0x1620e4=_0x29f6d8['offset'],_0x29bb15=_0x29f6d8[_0x9323('0x16')]+_0x29f6d8['limit'],_0x18d04c;if(_0x29bb15>=_0x2b5cbf){_0x29bb15=_0x2b5cbf;_0x18d04c=0xc8;}else{_0x18d04c=0xce;}_0x45397b[_0x9323('0x17')](_0x18d04c);return _0x45397b[_0x9323('0x18')]('Content-Range',_0x1620e4+'-'+_0x29bb15+'/'+_0x2b5cbf)[_0x9323('0x14')](_0x492a20);}return null;};}function patchUpdates(_0x21ada8){return function(_0x33f824){try{jsonpatch[_0x9323('0x19')](_0x33f824,_0x21ada8,!![]);}catch(_0x53b8b0){return BPromise['reject'](_0x53b8b0);}return _0x33f824['save']();};}function saveUpdates(_0xc8f92e,_0x3c2d3f){return function(_0x122339){if(_0x122339){return _0x122339[_0x9323('0x1a')](_0xc8f92e)['then'](function(_0x2379d4){return _0x2379d4;});}return null;};}function removeEntity(_0x1aac42,_0x5d1679){return function(_0x2a67a3){if(_0x2a67a3){return _0x2a67a3[_0x9323('0x1b')]()[_0x9323('0x1c')](function(){_0x1aac42[_0x9323('0x17')](0xcc)[_0x9323('0x1d')]();});}};}function handleEntityNotFound(_0x4ff0d3,_0x4683c3){return function(_0x2b7083){if(!_0x2b7083){_0x4ff0d3[_0x9323('0x13')](0x194);}return _0x2b7083;};}function handleError(_0x2ad327,_0x18e150){_0x18e150=_0x18e150||0x1f4;return function(_0x3e74be){logger[_0x9323('0x1e')](_0x3e74be[_0x9323('0x1f')]);if(_0x3e74be['name']){delete _0x3e74be[_0x9323('0x20')];}_0x2ad327[_0x9323('0x17')](_0x18e150)[_0x9323('0x21')](_0x3e74be);};}exports[_0x9323('0x22')]=function(_0x145b3b,_0x4710b1){var _0xf7e7b7={},_0xe0467d={},_0x16e1ef={'count':0x0,'rows':[]};var _0x5447cc=db[_0x9323('0x23')][_0x9323('0x24')];_0xe0467d['model']=_[_0x9323('0x25')](_0x5447cc);var _0x2a4a10={'dateStart':_0x145b3b['query']['dateStart'],'dateEnd':_0x145b3b[_0x9323('0x26')][_0x9323('0x27')]};delete _0x145b3b['query'][_0x9323('0x28')];delete _0x145b3b[_0x9323('0x26')][_0x9323('0x27')];_0xe0467d['query']=_[_0x9323('0x25')](_0x145b3b[_0x9323('0x26')]);_0xe0467d['filters']=_[_0x9323('0x29')](_0xe0467d[_0x9323('0x2a')],_0xe0467d[_0x9323('0x26')]);_0xf7e7b7[_0x9323('0x2b')]=_[_0x9323('0x29')](_0xe0467d[_0x9323('0x2a')],qs[_0x9323('0x2c')](_0x145b3b[_0x9323('0x26')][_0x9323('0x2c')]));_0xf7e7b7[_0x9323('0x2b')]=_0xf7e7b7[_0x9323('0x2b')]['length']?_0xf7e7b7[_0x9323('0x2b')]:_0xe0467d[_0x9323('0x2a')];if(!_0x145b3b['query']['hasOwnProperty'](_0x9323('0x2d'))){_0xf7e7b7[_0x9323('0x2e')]=qs[_0x9323('0x2e')](_0x145b3b[_0x9323('0x26')][_0x9323('0x2e')]);_0xf7e7b7['offset']=qs[_0x9323('0x16')](_0x145b3b[_0x9323('0x26')][_0x9323('0x16')]);}_0xf7e7b7[_0x9323('0x2f')]=qs[_0x9323('0x30')](_0x145b3b[_0x9323('0x26')][_0x9323('0x30')]);_0xf7e7b7[_0x9323('0x31')]=qs[_0x9323('0x32')](_[_0x9323('0x33')](_0x145b3b[_0x9323('0x26')],_0xe0467d[_0x9323('0x32')]));if(_0x2a4a10[_0x9323('0x28')]){if(_0x2a4a10[_0x9323('0x27')]){_0x2a4a10[_0x9323('0x27')]=moment(_0x2a4a10[_0x9323('0x27')])[_0x9323('0x34')](0x1,_0x9323('0x35'));}else{_0x2a4a10[_0x9323('0x27')]=moment(_0x2a4a10['dateStart'])[_0x9323('0x34')](0x1,'day');}_[_0x9323('0x36')](_0xf7e7b7[_0x9323('0x31')],{'createdAt':{'$gte':_0x2a4a10[_0x9323('0x28')],'$lte':_0x2a4a10['dateEnd']}});}if(_0x145b3b['query'][_0x9323('0x37')]){_0xf7e7b7[_0x9323('0x31')]=_[_0x9323('0x36')](_0xf7e7b7['where'],{'$or':_[_0x9323('0x38')](_0x5447cc,function(_0x272f93){if(_0x272f93['type']['key']!==_0x9323('0x39')){var _0x1e624e={};_0x1e624e[_0x272f93['field']]={'$like':'%'+_0x145b3b[_0x9323('0x26')][_0x9323('0x37')]+'%'};return _0x1e624e;}})});}_0xf7e7b7=_[_0x9323('0x36')]({},_0xf7e7b7,_0x145b3b[_0x9323('0x3a')]);var _0x35d685={'where':_0xf7e7b7[_0x9323('0x31')]};return db['ZendeskField'][_0x9323('0x15')](_0x35d685)['then'](function(_0x24e1a8){_0x16e1ef[_0x9323('0x15')]=_0x24e1a8;if(_0x145b3b['query'][_0x9323('0x3b')]){_0xf7e7b7[_0x9323('0x3c')]=[{'all':!![]}];}return db[_0x9323('0x23')][_0x9323('0x3d')](_0xf7e7b7);})['then'](function(_0x4f7c97){_0x16e1ef['rows']=_0x4f7c97;return _0x16e1ef;})['then'](respondWithFilteredResult(_0x4710b1,_0xf7e7b7))[_0x9323('0x3e')](handleError(_0x4710b1,null));};exports[_0x9323('0x3f')]=function(_0x2a656e,_0x1d5fae){var _0x352ade={'raw':!![],'where':{'id':_0x2a656e['params']['id']}},_0x2c9a23={};_0x2c9a23['model']=_[_0x9323('0x25')](db[_0x9323('0x23')][_0x9323('0x24')]);_0x2c9a23[_0x9323('0x26')]=_[_0x9323('0x25')](_0x2a656e[_0x9323('0x26')]);_0x2c9a23[_0x9323('0x32')]=_[_0x9323('0x29')](_0x2c9a23['model'],_0x2c9a23[_0x9323('0x26')]);_0x352ade[_0x9323('0x2b')]=_[_0x9323('0x29')](_0x2c9a23[_0x9323('0x2a')],qs['fields'](_0x2a656e[_0x9323('0x26')][_0x9323('0x2c')]));_0x352ade[_0x9323('0x2b')]=_0x352ade[_0x9323('0x2b')][_0x9323('0x40')]?_0x352ade['attributes']:_0x2c9a23['model'];if(_0x2a656e[_0x9323('0x26')][_0x9323('0x3b')]){_0x352ade[_0x9323('0x3c')]=[{'all':!![]}];}_0x352ade=_['merge']({},_0x352ade,_0x2a656e['options']);return db['ZendeskField']['find'](_0x352ade)[_0x9323('0x1c')](handleEntityNotFound(_0x1d5fae,null))[_0x9323('0x1c')](respondWithResult(_0x1d5fae,null))[_0x9323('0x3e')](handleError(_0x1d5fae,null));};exports['create']=function(_0xa233a8,_0x1f2cfa){return db[_0x9323('0x23')][_0x9323('0x41')](_0xa233a8[_0x9323('0x42')],{})['then'](respondWithResult(_0x1f2cfa,0xc9))[_0x9323('0x3e')](handleError(_0x1f2cfa,null));};exports['update']=function(_0x5859b7,_0x53ebd2){if(_0x5859b7[_0x9323('0x42')]['id']){delete _0x5859b7[_0x9323('0x42')]['id'];}return db[_0x9323('0x23')]['find']({'where':{'id':_0x5859b7[_0x9323('0x43')]['id']}})[_0x9323('0x1c')](handleEntityNotFound(_0x53ebd2,null))[_0x9323('0x1c')](saveUpdates(_0x5859b7[_0x9323('0x42')],null))[_0x9323('0x1c')](respondWithResult(_0x53ebd2,null))['catch'](handleError(_0x53ebd2,null));};exports[_0x9323('0x1b')]=function(_0x2d9d39,_0x279c00){return db[_0x9323('0x23')][_0x9323('0x44')]({'where':{'id':_0x2d9d39[_0x9323('0x43')]['id']}})[_0x9323('0x1c')](handleEntityNotFound(_0x279c00,null))[_0x9323('0x1c')](removeEntity(_0x279c00,null))['catch'](handleError(_0x279c00,null));};
\ No newline at end of file
+var _0xe0a0=['rows','catch','show','create','body','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','ZendeskField','rawAttributes','query','dateStart','dateEnd','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','filter','merge','map','field','options','include','findAll'];(function(_0x47369a,_0x4e3b65){var _0x5629de=function(_0x33f450){while(--_0x33f450){_0x47369a['push'](_0x47369a['shift']());}};_0x5629de(++_0x4e3b65);}(_0xe0a0,0x17e));var _0x0e0a=function(_0x2d4ea4,_0x25cb3a){_0x2d4ea4=_0x2d4ea4-0x0;var _0xce2c50=_0xe0a0[_0x2d4ea4];return _0xce2c50;};'use strict';var pdf=require(_0x0e0a('0x0'));var emlformat=require(_0x0e0a('0x1'));var rimraf=require(_0x0e0a('0x2'));var zipdir=require(_0x0e0a('0x3'));var jsonpatch=require(_0x0e0a('0x4'));var rp=require(_0x0e0a('0x5'));var moment=require(_0x0e0a('0x6'));var BPromise=require(_0x0e0a('0x7'));var Mustache=require(_0x0e0a('0x8'));var util=require(_0x0e0a('0x9'));var path=require(_0x0e0a('0xa'));var sox=require(_0x0e0a('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e0a('0xc'));var squel=require(_0x0e0a('0xd'));var crypto=require(_0x0e0a('0xe'));var jsforce=require(_0x0e0a('0xf'));var deskjs=require(_0x0e0a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0e0a('0x11'));var Papa=require('papaparse');var Redis=require(_0x0e0a('0x12'));var qs=require(_0x0e0a('0x13'));var logger=require('../../config/logger')(_0x0e0a('0x14'));var utils=require(_0x0e0a('0x15'));var config=require(_0x0e0a('0x16'));var db=require(_0x0e0a('0x17'))['db'];function respondWithStatusCode(_0x15431c,_0x131759){_0x131759=_0x131759||0xcc;return function(_0x356961){if(_0x356961){return _0x15431c['sendStatus'](_0x131759);}return _0x15431c[_0x0e0a('0x18')](_0x131759)[_0x0e0a('0x19')]();};}function respondWithResult(_0x56e080,_0x21a619){_0x21a619=_0x21a619||0xc8;return function(_0x5cccc7){if(_0x5cccc7){return _0x56e080[_0x0e0a('0x18')](_0x21a619)[_0x0e0a('0x1a')](_0x5cccc7);}};}function respondWithFilteredResult(_0x358872,_0x19c8f4){return function(_0x249bc9){if(_0x249bc9){var _0x186326=_0x249bc9[_0x0e0a('0x1b')],_0x596468=_0x19c8f4['offset'],_0x3dcce1=_0x19c8f4[_0x0e0a('0x1c')]+_0x19c8f4['limit'],_0xb4e799;if(_0x3dcce1>=_0x186326){_0x3dcce1=_0x186326;_0xb4e799=0xc8;}else{_0xb4e799=0xce;}_0x358872['status'](_0xb4e799);return _0x358872[_0x0e0a('0x1d')](_0x0e0a('0x1e'),_0x596468+'-'+_0x3dcce1+'/'+_0x186326)[_0x0e0a('0x1a')](_0x249bc9);}return null;};}function patchUpdates(_0x378343){return function(_0x150463){try{jsonpatch[_0x0e0a('0x1f')](_0x150463,_0x378343,!![]);}catch(_0xc92549){return BPromise['reject'](_0xc92549);}return _0x150463[_0x0e0a('0x20')]();};}function saveUpdates(_0x35aa0f,_0x34952a){return function(_0x50973b){if(_0x50973b){return _0x50973b[_0x0e0a('0x21')](_0x35aa0f)[_0x0e0a('0x22')](function(_0x49b0d0){return _0x49b0d0;});}return null;};}function removeEntity(_0x50a8c8,_0x3da395){return function(_0x43a84b){if(_0x43a84b){return _0x43a84b[_0x0e0a('0x23')]()[_0x0e0a('0x22')](function(){_0x50a8c8['status'](0xcc)[_0x0e0a('0x19')]();});}};}function handleEntityNotFound(_0x20bc81,_0x3bd8aa){return function(_0x38e58e){if(!_0x38e58e){_0x20bc81['sendStatus'](0x194);}return _0x38e58e;};}function handleError(_0x114755,_0xc29f9){_0xc29f9=_0xc29f9||0x1f4;return function(_0x215811){logger[_0x0e0a('0x24')](_0x215811['stack']);if(_0x215811[_0x0e0a('0x25')]){delete _0x215811[_0x0e0a('0x25')];}_0x114755['status'](_0xc29f9)[_0x0e0a('0x26')](_0x215811);};}exports[_0x0e0a('0x27')]=function(_0x4224df,_0x592a1e){var _0x5535e5={},_0x20cbcf={},_0x3c0f3f={'count':0x0,'rows':[]};var _0x7c726=db[_0x0e0a('0x28')][_0x0e0a('0x29')];_0x20cbcf['model']=_['keys'](_0x7c726);var _0x200965={'dateStart':_0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x2b')],'dateEnd':_0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x2c')]};delete _0x4224df[_0x0e0a('0x2a')]['dateStart'];delete _0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x2c')];_0x20cbcf[_0x0e0a('0x2a')]=_[_0x0e0a('0x2d')](_0x4224df['query']);_0x20cbcf[_0x0e0a('0x2e')]=_[_0x0e0a('0x2f')](_0x20cbcf[_0x0e0a('0x30')],_0x20cbcf[_0x0e0a('0x2a')]);_0x5535e5['attributes']=_[_0x0e0a('0x2f')](_0x20cbcf[_0x0e0a('0x30')],qs[_0x0e0a('0x31')](_0x4224df['query'][_0x0e0a('0x31')]));_0x5535e5['attributes']=_0x5535e5['attributes'][_0x0e0a('0x32')]?_0x5535e5[_0x0e0a('0x33')]:_0x20cbcf['model'];if(!_0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x34')](_0x0e0a('0x35'))){_0x5535e5[_0x0e0a('0x36')]=qs[_0x0e0a('0x36')](_0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x36')]);_0x5535e5[_0x0e0a('0x1c')]=qs[_0x0e0a('0x1c')](_0x4224df[_0x0e0a('0x2a')]['offset']);}_0x5535e5[_0x0e0a('0x37')]=qs['sort'](_0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x38')]);_0x5535e5[_0x0e0a('0x39')]=qs['filters'](_[_0x0e0a('0x3a')](_0x4224df[_0x0e0a('0x2a')],_0x20cbcf[_0x0e0a('0x2e')]));if(_0x200965[_0x0e0a('0x2b')]){if(_0x200965[_0x0e0a('0x2c')]){_0x200965[_0x0e0a('0x2c')]=moment(_0x200965[_0x0e0a('0x2c')])[_0x0e0a('0x3b')](0x1,_0x0e0a('0x3c'));}else{_0x200965[_0x0e0a('0x2c')]=moment(_0x200965['dateStart'])[_0x0e0a('0x3b')](0x1,_0x0e0a('0x3c'));}_['merge'](_0x5535e5['where'],{'createdAt':{'$gte':_0x200965[_0x0e0a('0x2b')],'$lte':_0x200965[_0x0e0a('0x2c')]}});}if(_0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x3d')]){_0x5535e5[_0x0e0a('0x39')]=_[_0x0e0a('0x3e')](_0x5535e5[_0x0e0a('0x39')],{'$or':_[_0x0e0a('0x3f')](_0x7c726,function(_0x105498){if(_0x105498['type']['key']!=='VIRTUAL'){var _0x4db204={};_0x4db204[_0x105498[_0x0e0a('0x40')]]={'$like':'%'+_0x4224df[_0x0e0a('0x2a')][_0x0e0a('0x3d')]+'%'};return _0x4db204;}})});}_0x5535e5=_[_0x0e0a('0x3e')]({},_0x5535e5,_0x4224df[_0x0e0a('0x41')]);var _0x172602={'where':_0x5535e5[_0x0e0a('0x39')]};return db[_0x0e0a('0x28')][_0x0e0a('0x1b')](_0x172602)[_0x0e0a('0x22')](function(_0x3075e6){_0x3c0f3f[_0x0e0a('0x1b')]=_0x3075e6;if(_0x4224df['query']['includeAll']){_0x5535e5[_0x0e0a('0x42')]=[{'all':!![]}];}return db['ZendeskField'][_0x0e0a('0x43')](_0x5535e5);})['then'](function(_0x1879c9){_0x3c0f3f[_0x0e0a('0x44')]=_0x1879c9;return _0x3c0f3f;})[_0x0e0a('0x22')](respondWithFilteredResult(_0x592a1e,_0x5535e5))[_0x0e0a('0x45')](handleError(_0x592a1e,null));};exports[_0x0e0a('0x46')]=function(_0x4a32c7,_0x28e73a){var _0x49e9fa={'raw':!![],'where':{'id':_0x4a32c7['params']['id']}},_0x4af139={};_0x4af139[_0x0e0a('0x30')]=_['keys'](db['ZendeskField'][_0x0e0a('0x29')]);_0x4af139['query']=_[_0x0e0a('0x2d')](_0x4a32c7['query']);_0x4af139[_0x0e0a('0x2e')]=_[_0x0e0a('0x2f')](_0x4af139[_0x0e0a('0x30')],_0x4af139['query']);_0x49e9fa[_0x0e0a('0x33')]=_[_0x0e0a('0x2f')](_0x4af139[_0x0e0a('0x30')],qs[_0x0e0a('0x31')](_0x4a32c7['query']['fields']));_0x49e9fa[_0x0e0a('0x33')]=_0x49e9fa['attributes'][_0x0e0a('0x32')]?_0x49e9fa[_0x0e0a('0x33')]:_0x4af139[_0x0e0a('0x30')];if(_0x4a32c7[_0x0e0a('0x2a')]['includeAll']){_0x49e9fa[_0x0e0a('0x42')]=[{'all':!![]}];}_0x49e9fa=_[_0x0e0a('0x3e')]({},_0x49e9fa,_0x4a32c7[_0x0e0a('0x41')]);return db[_0x0e0a('0x28')]['find'](_0x49e9fa)[_0x0e0a('0x22')](handleEntityNotFound(_0x28e73a,null))[_0x0e0a('0x22')](respondWithResult(_0x28e73a,null))[_0x0e0a('0x45')](handleError(_0x28e73a,null));};exports[_0x0e0a('0x47')]=function(_0x2ccc7e,_0x36938d){return db['ZendeskField'][_0x0e0a('0x47')](_0x2ccc7e[_0x0e0a('0x48')],{})[_0x0e0a('0x22')](respondWithResult(_0x36938d,0xc9))[_0x0e0a('0x45')](handleError(_0x36938d,null));};exports[_0x0e0a('0x21')]=function(_0x2094f7,_0x2ae121){if(_0x2094f7[_0x0e0a('0x48')]['id']){delete _0x2094f7[_0x0e0a('0x48')]['id'];}return db[_0x0e0a('0x28')][_0x0e0a('0x49')]({'where':{'id':_0x2094f7[_0x0e0a('0x4a')]['id']}})[_0x0e0a('0x22')](handleEntityNotFound(_0x2ae121,null))['then'](saveUpdates(_0x2094f7[_0x0e0a('0x48')],null))[_0x0e0a('0x22')](respondWithResult(_0x2ae121,null))[_0x0e0a('0x45')](handleError(_0x2ae121,null));};exports['destroy']=function(_0x685dba,_0x2a88ab){return db[_0x0e0a('0x28')][_0x0e0a('0x49')]({'where':{'id':_0x685dba[_0x0e0a('0x4a')]['id']}})[_0x0e0a('0x22')](handleEntityNotFound(_0x2a88ab,null))[_0x0e0a('0x22')](removeEntity(_0x2a88ab,null))[_0x0e0a('0x45')](handleError(_0x2a88ab,null));};
\ No newline at end of file
index ad9885f..a12db88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0774=['bluebird','request-promise','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','../../config/logger','moment'];(function(_0x222d49,_0x422ac3){var _0x264eb=function(_0xae622b){while(--_0xae622b){_0x222d49['push'](_0x222d49['shift']());}};_0x264eb(++_0x422ac3);}(_0x0774,0x103));var _0x4077=function(_0x2e2b8e,_0x365ada){_0x2e2b8e=_0x2e2b8e-0x0;var _0x5d2b16=_0x0774[_0x2e2b8e];return _0x5d2b16;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4077('0x0'))('api');var moment=require(_0x4077('0x1'));var BPromise=require(_0x4077('0x2'));var rp=require(_0x4077('0x3'));var attributes=require(_0x4077('0x4'));module[_0x4077('0x5')]=function(_0x31c4d5,_0x446fc8){return _0x31c4d5[_0x4077('0x6')](_0x4077('0x7'),attributes,{'tableName':_0x4077('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3423=['idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x39be76,_0x5bf653){var _0x1c163d=function(_0x352d7b){while(--_0x352d7b){_0x39be76['push'](_0x39be76['shift']());}};_0x1c163d(++_0x5bf653);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var attributes=require(_0x3342('0x5'));module[_0x3342('0x6')]=function(_0x3c5d8d,_0x3075f8){return _0x3c5d8d[_0x3342('0x7')](_0x3342('0x8'),attributes,{'tableName':_0x3342('0x9'),'paranoid':![],'indexes':[{'name':_0x3342('0xa'),'fields':[_0x3342('0xb'),_0x3342('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 592fe7d..679c465 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb1=['../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x121886,_0x8cd8e5){var _0x20ca01=function(_0x15e144){while(--_0x15e144){_0x121886['push'](_0x121886['shift']());}};_0x20ca01(++_0x8cd8e5);}(_0x5eb1,0x7c));var _0x15eb=function(_0x397004,_0x7949f){_0x397004=_0x397004-0x0;var _0xa7a10=_0x5eb1[_0x397004];return _0xa7a10;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var moment=require(_0x15eb('0x1'));var BPromise=require(_0x15eb('0x2'));var rs=require(_0x15eb('0x3'));var fs=require('fs');var Redis=require(_0x15eb('0x4'));var db=require(_0x15eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15eb('0x6'))(_0x15eb('0x7'));var config=require(_0x15eb('0x8'));var jayson=require(_0x15eb('0x9'));var client=jayson['client'][_0x15eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x212692,_0x594f54,_0xe4d8ce){return new BPromise(function(_0x160879,_0x730b12){return client[_0x15eb('0xb')](_0x212692,_0xe4d8ce)[_0x15eb('0xc')](function(_0x2ad2c1){logger[_0x15eb('0xd')](_0x15eb('0xe'),_0x594f54,_0x15eb('0xf'));logger[_0x15eb('0x10')](_0x15eb('0x11'),_0x594f54,_0x15eb('0xf'),JSON[_0x15eb('0x12')](_0x2ad2c1));if(_0x2ad2c1['error']){if(_0x2ad2c1[_0x15eb('0x13')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x594f54,_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);return _0x730b12(_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);}logger['error'](_0x15eb('0xe'),_0x594f54,_0x2ad2c1[_0x15eb('0x13')][_0x15eb('0x14')]);return _0x160879(_0x2ad2c1[_0x15eb('0x13')]['message']);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x594f54,'request\x20sent');_0x160879(_0x2ad2c1[_0x15eb('0x15')]['message']);}})['catch'](function(_0x3a78e9){logger['error'](_0x15eb('0xe'),_0x594f54,_0x3a78e9);_0x730b12(_0x3a78e9);});});}
\ No newline at end of file
+var _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa902,0x8d));var _0x2a90=function(_0x35f188,_0x4f70a7){_0x35f188=_0x35f188-0x0;var _0x284e96=_0xa902[_0x35f188];return _0x284e96;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('ZendeskField,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('ZendeskField,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}
\ No newline at end of file
index f4b8853..35f0f5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','getConfigurations','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x14a0,0x8e));var _0x014a=function(_0x320bcf,_0x2051fb){_0x320bcf=_0x320bcf-0x0;var _0x4c0dde=_0x14a0[_0x320bcf];return _0x4c0dde;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var auth=require(_0x014a('0x5'));var interaction=require(_0x014a('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x014a('0x7')]('/',auth[_0x014a('0x8')](),controller[_0x014a('0x9')]);router['get']('/:id',auth[_0x014a('0x8')](),controller[_0x014a('0xa')]);router[_0x014a('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x014a('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x014a('0xc')]('/',auth['isAuthenticated'](),controller[_0x014a('0xd')]);router[_0x014a('0xc')]('/:id/configurations',auth[_0x014a('0x8')](),controller[_0x014a('0xe')]);router[_0x014a('0xf')](_0x014a('0x10'),auth[_0x014a('0x8')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')](_0x014a('0x10'),auth[_0x014a('0x8')](),controller[_0x014a('0x13')]);module[_0x014a('0x14')]=router;
\ No newline at end of file
+var _0xe5b5=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xe5b5[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var auth=require(_0x5e5b('0x6'));var interaction=require(_0x5e5b('0x7'));var config=require(_0x5e5b('0x8'));var controller=require(_0x5e5b('0x9'));router[_0x5e5b('0xa')]('/',auth[_0x5e5b('0xb')](),controller[_0x5e5b('0xc')]);router[_0x5e5b('0xa')](_0x5e5b('0xd'),auth[_0x5e5b('0xb')](),controller[_0x5e5b('0xe')]);router[_0x5e5b('0xa')](_0x5e5b('0xf'),auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x10')]);router[_0x5e5b('0xa')](_0x5e5b('0x11'),auth['isAuthenticated'](),controller[_0x5e5b('0x12')]);router['post']('/',auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x13')]);router[_0x5e5b('0x14')](_0x5e5b('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x5e5b('0xd'),auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x15')]);router[_0x5e5b('0x16')](_0x5e5b('0xd'),auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x17')]);module['exports']=router;
\ No newline at end of file
index a77646c..c9f2dd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5ab=['sequelize','STRING'];(function(_0x35ce74,_0x333bdc){var _0x488bff=function(_0x222442){while(--_0x222442){_0x35ce74['push'](_0x35ce74['shift']());}};_0x488bff(++_0x333bdc);}(_0xf5ab,0xae));var _0xbf5a=function(_0x26f06b,_0x56432e){_0x26f06b=_0x26f06b-0x0;var _0x5ab5b7=_0xf5ab[_0x26f06b];return _0x5ab5b7;};'use strict';var Sequelize=require(_0xbf5a('0x0'));module['exports']={'name':{'type':Sequelize[_0xbf5a('0x1')]},'description':{'type':Sequelize[_0xbf5a('0x1')]},'authToken':{'type':Sequelize[_0xbf5a('0x1')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xbf5a('0x1')]}};
\ No newline at end of file
+var _0x1862=['STRING','sequelize','exports'];(function(_0x4b0bb1,_0x51e0a9){var _0x496740=function(_0x3cc4a3){while(--_0x3cc4a3){_0x4b0bb1['push'](_0x4b0bb1['shift']());}};_0x496740(++_0x51e0a9);}(_0x1862,0x12d));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2186('0x0'));module[_0x2186('0x1')]={'name':{'type':Sequelize[_0x2186('0x2')]},'description':{'type':Sequelize[_0x2186('0x2')]},'authToken':{'type':Sequelize[_0x2186('0x2')]},'host':{'type':Sequelize[_0x2186('0x2')]},'serverUrl':{'type':Sequelize[_0x2186('0x2')]}};
\ No newline at end of file
index 4171c0d..8d4af9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['sort','where','pick','dateStart','add','day','filter','merge','key','field','options','ZohoAccount','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','map','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','type','ZohoField','host','authToken','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','Calls','section','length','includes','label','customfield','true','Pick\x20List','val','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','rawAttributes','keys','query','dateEnd','filters','intersection','model','fields','attributes','hasOwnProperty','order'];(function(_0x542739,_0x527cfc){var _0x40b9dd=function(_0x16525e){while(--_0x16525e){_0x542739['push'](_0x542739['shift']());}};_0x40b9dd(++_0x527cfc);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4f22b5,_0x338847){_0x4f22b5=_0x4f22b5-0x0;var _0x2f94b7=_0x9ffd[_0x4f22b5];return _0x2f94b7;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd9ff('0x11'));var utils=require(_0xd9ff('0x12'));var config=require(_0xd9ff('0x13'));var db=require(_0xd9ff('0x14'))['db'];var integrations=require(_0xd9ff('0x15'));var jayson=require(_0xd9ff('0x16'));var client=jayson[_0xd9ff('0x17')][_0xd9ff('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x47d842,_0x47b0d7,_0xaaf7af,_0x16a0d9){return new BPromise(function(_0x415c58,_0x350a5d){var _0x12c39a=_0x16a0d9||client;return _0x12c39a['request'](_0x47d842,_0xaaf7af)[_0xd9ff('0x19')](function(_0x3c9ace){logger['info'](_0xd9ff('0x1a'),_0x47b0d7,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x47b0d7,'request\x20sent',JSON[_0xd9ff('0x1b')](_0x3c9ace));if(_0x3c9ace['error']){if(_0x3c9ace[_0xd9ff('0x1c')][_0xd9ff('0x1d')]===0x1f4){logger[_0xd9ff('0x1c')](_0xd9ff('0x1a'),_0x47b0d7,_0x3c9ace[_0xd9ff('0x1c')][_0xd9ff('0x1e')]);return _0x350a5d(_0x3c9ace[_0xd9ff('0x1c')][_0xd9ff('0x1e')]);}logger[_0xd9ff('0x1c')](_0xd9ff('0x1a'),_0x47b0d7,_0x3c9ace[_0xd9ff('0x1c')][_0xd9ff('0x1e')]);return _0x415c58(_0x3c9ace[_0xd9ff('0x1c')]['message']);}else{logger['info'](_0xd9ff('0x1a'),_0x47b0d7,_0xd9ff('0x1f'));_0x415c58(_0x3c9ace['result']['message']);}})['catch'](function(_0x4b1477){logger[_0xd9ff('0x1c')]('ZohoAccount,\x20%s,\x20%s',_0x47b0d7,_0x4b1477);_0x350a5d(_0x4b1477);});});}function respondWithStatusCode(_0x4c486a,_0x3fd141){_0x3fd141=_0x3fd141||0xcc;return function(_0x291f52){if(_0x291f52){return _0x4c486a[_0xd9ff('0x20')](_0x3fd141);}return _0x4c486a[_0xd9ff('0x21')](_0x3fd141)[_0xd9ff('0x22')]();};}function respondWithResult(_0x4b058a,_0x4fada1){_0x4fada1=_0x4fada1||0xc8;return function(_0x1136e9){if(_0x1136e9){return _0x4b058a['status'](_0x4fada1)[_0xd9ff('0x23')](_0x1136e9);}};}function respondWithFilteredResult(_0x4d86fe,_0x285002){return function(_0x5d45b3){if(_0x5d45b3){var _0x10cbdd=_0x5d45b3['count'],_0x159e56=_0x285002[_0xd9ff('0x24')],_0x2138b4=_0x285002[_0xd9ff('0x24')]+_0x285002[_0xd9ff('0x25')],_0x2970e8;if(_0x2138b4>=_0x10cbdd){_0x2138b4=_0x10cbdd;_0x2970e8=0xc8;}else{_0x2970e8=0xce;}_0x4d86fe[_0xd9ff('0x21')](_0x2970e8);return _0x4d86fe['set'](_0xd9ff('0x26'),_0x159e56+'-'+_0x2138b4+'/'+_0x10cbdd)[_0xd9ff('0x23')](_0x5d45b3);}return null;};}function patchUpdates(_0x44b5a7){return function(_0x45fb63){try{jsonpatch[_0xd9ff('0x27')](_0x45fb63,_0x44b5a7,!![]);}catch(_0xe516e2){return BPromise[_0xd9ff('0x28')](_0xe516e2);}return _0x45fb63[_0xd9ff('0x29')]();};}function saveUpdates(_0x3dc443,_0x5706cf){return function(_0xcea5db){if(_0xcea5db){return _0xcea5db['update'](_0x3dc443)[_0xd9ff('0x19')](function(_0x29c532){return _0x29c532;});}return null;};}function removeEntity(_0xbdd352,_0x552d08){return function(_0x2ba4d3){if(_0x2ba4d3){return _0x2ba4d3[_0xd9ff('0x2a')]()[_0xd9ff('0x19')](function(){_0xbdd352[_0xd9ff('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41adb1,_0x5743de){return function(_0x18c28b){if(!_0x18c28b){_0x41adb1[_0xd9ff('0x20')](0x194);}return _0x18c28b;};}function handleError(_0x323cb5,_0x206424){_0x206424=_0x206424||0x1f4;return function(_0x20685b){logger[_0xd9ff('0x1c')](_0x20685b[_0xd9ff('0x2b')]);if(_0x20685b[_0xd9ff('0x2c')]){delete _0x20685b[_0xd9ff('0x2c')];}_0x323cb5[_0xd9ff('0x21')](_0x206424)[_0xd9ff('0x2d')](_0x20685b);};}exports[_0xd9ff('0x2e')]=function(_0x4670e4,_0x66f4d){var _0x498025={},_0x13322f={},_0x1ef7c3={'count':0x0,'rows':[]};var _0x2bde85=db['ZohoAccount'][_0xd9ff('0x2f')];_0x13322f['model']=_[_0xd9ff('0x30')](_0x2bde85);var _0x4ae56b={'dateStart':_0x4670e4[_0xd9ff('0x31')]['dateStart'],'dateEnd':_0x4670e4[_0xd9ff('0x31')][_0xd9ff('0x32')]};delete _0x4670e4[_0xd9ff('0x31')]['dateStart'];delete _0x4670e4['query']['dateEnd'];_0x13322f[_0xd9ff('0x31')]=_[_0xd9ff('0x30')](_0x4670e4[_0xd9ff('0x31')]);_0x13322f[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x13322f[_0xd9ff('0x35')],_0x13322f['query']);_0x498025['attributes']=_['intersection'](_0x13322f[_0xd9ff('0x35')],qs[_0xd9ff('0x36')](_0x4670e4[_0xd9ff('0x31')][_0xd9ff('0x36')]));_0x498025['attributes']=_0x498025[_0xd9ff('0x37')]['length']?_0x498025[_0xd9ff('0x37')]:_0x13322f[_0xd9ff('0x35')];if(!_0x4670e4[_0xd9ff('0x31')][_0xd9ff('0x38')]('nolimit')){_0x498025[_0xd9ff('0x25')]=qs[_0xd9ff('0x25')](_0x4670e4['query'][_0xd9ff('0x25')]);_0x498025[_0xd9ff('0x24')]=qs[_0xd9ff('0x24')](_0x4670e4[_0xd9ff('0x31')][_0xd9ff('0x24')]);}_0x498025[_0xd9ff('0x39')]=qs['sort'](_0x4670e4[_0xd9ff('0x31')][_0xd9ff('0x3a')]);_0x498025[_0xd9ff('0x3b')]=qs[_0xd9ff('0x33')](_[_0xd9ff('0x3c')](_0x4670e4['query'],_0x13322f[_0xd9ff('0x33')]));if(_0x4ae56b[_0xd9ff('0x3d')]){if(_0x4ae56b[_0xd9ff('0x32')]){_0x4ae56b['dateEnd']=moment(_0x4ae56b['dateEnd'])[_0xd9ff('0x3e')](0x1,_0xd9ff('0x3f'));}else{_0x4ae56b[_0xd9ff('0x32')]=moment(_0x4ae56b[_0xd9ff('0x3d')])[_0xd9ff('0x3e')](0x1,_0xd9ff('0x3f'));}_['merge'](_0x498025[_0xd9ff('0x3b')],{'createdAt':{'$gte':_0x4ae56b[_0xd9ff('0x3d')],'$lte':_0x4ae56b['dateEnd']}});}if(_0x4670e4[_0xd9ff('0x31')][_0xd9ff('0x40')]){_0x498025[_0xd9ff('0x3b')]=_[_0xd9ff('0x41')](_0x498025[_0xd9ff('0x3b')],{'$or':_['map'](_0x2bde85,function(_0x5cf34e){if(_0x5cf34e['type'][_0xd9ff('0x42')]!=='VIRTUAL'){var _0x4528c1={};_0x4528c1[_0x5cf34e[_0xd9ff('0x43')]]={'$like':'%'+_0x4670e4[_0xd9ff('0x31')]['filter']+'%'};return _0x4528c1;}})});}_0x498025=_[_0xd9ff('0x41')]({},_0x498025,_0x4670e4[_0xd9ff('0x44')]);var _0x536a3b={'where':_0x498025[_0xd9ff('0x3b')]};return db[_0xd9ff('0x45')][_0xd9ff('0x46')](_0x536a3b)[_0xd9ff('0x19')](function(_0x559101){_0x1ef7c3[_0xd9ff('0x46')]=_0x559101;if(_0x4670e4['query'][_0xd9ff('0x47')]){_0x498025['include']=[{'all':!![]}];}return db[_0xd9ff('0x45')][_0xd9ff('0x48')](_0x498025);})[_0xd9ff('0x19')](function(_0x1760c3){_0x1ef7c3[_0xd9ff('0x49')]=_0x1760c3;return _0x1ef7c3;})['then'](respondWithFilteredResult(_0x66f4d,_0x498025))[_0xd9ff('0x4a')](handleError(_0x66f4d,null));};exports[_0xd9ff('0x4b')]=function(_0x2fbe53,_0xa3f86d){var _0x5c3e11={'raw':![],'where':{'id':_0x2fbe53['params']['id']}},_0x537282={};_0x537282[_0xd9ff('0x35')]=_[_0xd9ff('0x30')](db[_0xd9ff('0x45')]['rawAttributes']);_0x537282[_0xd9ff('0x31')]=_[_0xd9ff('0x30')](_0x2fbe53[_0xd9ff('0x31')]);_0x537282[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x537282[_0xd9ff('0x35')],_0x537282[_0xd9ff('0x31')]);_0x5c3e11[_0xd9ff('0x37')]=_[_0xd9ff('0x34')](_0x537282[_0xd9ff('0x35')],qs[_0xd9ff('0x36')](_0x2fbe53[_0xd9ff('0x31')][_0xd9ff('0x36')]));_0x5c3e11['attributes']=_0x5c3e11[_0xd9ff('0x37')]['length']?_0x5c3e11[_0xd9ff('0x37')]:_0x537282['model'];if(_0x2fbe53[_0xd9ff('0x31')]['includeAll']){_0x5c3e11[_0xd9ff('0x4c')]=[{'all':!![]}];}_0x5c3e11=_['merge']({},_0x5c3e11,_0x2fbe53[_0xd9ff('0x44')]);return db['ZohoAccount'][_0xd9ff('0x4d')](_0x5c3e11)['then'](handleEntityNotFound(_0xa3f86d,null))[_0xd9ff('0x19')](respondWithResult(_0xa3f86d,null))['catch'](handleError(_0xa3f86d,null));};exports[_0xd9ff('0x4e')]=function(_0x103c99,_0x122c9d){return db[_0xd9ff('0x45')]['create'](_0x103c99[_0xd9ff('0x4f')],{})[_0xd9ff('0x19')](respondWithResult(_0x122c9d,0xc9))[_0xd9ff('0x4a')](handleError(_0x122c9d,null));};exports['update']=function(_0x2d6c3,_0x32e1b9){if(_0x2d6c3[_0xd9ff('0x4f')]['id']){delete _0x2d6c3[_0xd9ff('0x4f')]['id'];}return db[_0xd9ff('0x45')]['find']({'where':{'id':_0x2d6c3[_0xd9ff('0x50')]['id']}})[_0xd9ff('0x19')](handleEntityNotFound(_0x32e1b9,null))[_0xd9ff('0x19')](saveUpdates(_0x2d6c3[_0xd9ff('0x4f')],null))[_0xd9ff('0x19')](respondWithResult(_0x32e1b9,null))[_0xd9ff('0x4a')](handleError(_0x32e1b9,null));};exports[_0xd9ff('0x2a')]=function(_0x5bac6f,_0x3be850){return db[_0xd9ff('0x45')]['find']({'where':{'id':_0x5bac6f[_0xd9ff('0x50')]['id']}})[_0xd9ff('0x19')](handleEntityNotFound(_0x3be850,null))['then'](removeEntity(_0x3be850,null))[_0xd9ff('0x4a')](handleError(_0x3be850,null));};exports[_0xd9ff('0x51')]=function(_0x25d8d1,_0x54ea27,_0x4ea9c6){var _0x39473e={};var _0x4f0c33={};var _0x34dc83;var _0x1e4d0c;return db[_0xd9ff('0x45')][_0xd9ff('0x52')]({'where':{'id':_0x25d8d1['params']['id']}})['then'](handleEntityNotFound(_0x54ea27,null))['then'](function(_0x188b58){if(_0x188b58){_0x34dc83=_0x188b58;_0x4f0c33[_0xd9ff('0x35')]=_[_0xd9ff('0x30')](db[_0xd9ff('0x53')][_0xd9ff('0x2f')]);_0x4f0c33['query']=_[_0xd9ff('0x30')](_0x25d8d1['query']);_0x4f0c33[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x4f0c33[_0xd9ff('0x35')],_0x4f0c33[_0xd9ff('0x31')]);_0x39473e[_0xd9ff('0x37')]=_[_0xd9ff('0x34')](_0x4f0c33[_0xd9ff('0x35')],qs[_0xd9ff('0x36')](_0x25d8d1['query'][_0xd9ff('0x36')]));_0x39473e[_0xd9ff('0x37')]=_0x39473e['attributes']['length']?_0x39473e[_0xd9ff('0x37')]:_0x4f0c33['model'];_0x39473e[_0xd9ff('0x39')]=qs[_0xd9ff('0x3a')](_0x25d8d1['query'][_0xd9ff('0x3a')]);_0x39473e[_0xd9ff('0x3b')]=qs[_0xd9ff('0x33')](_[_0xd9ff('0x3c')](_0x25d8d1[_0xd9ff('0x31')],_0x4f0c33['filters']));if(_0x25d8d1[_0xd9ff('0x31')]['filter']){_0x39473e['where']=_[_0xd9ff('0x41')](_0x39473e[_0xd9ff('0x3b')],{'$or':_[_0xd9ff('0x54')](_0x39473e[_0xd9ff('0x37')],function(_0x56d822){var _0x13f6ab={};_0x13f6ab[_0x56d822]={'$like':'%'+_0x25d8d1[_0xd9ff('0x31')][_0xd9ff('0x40')]+'%'};return _0x13f6ab;})});}_0x39473e=_[_0xd9ff('0x41')]({},_0x39473e,_0x25d8d1[_0xd9ff('0x44')]);return _0x34dc83[_0xd9ff('0x51')](_0x39473e);}})[_0xd9ff('0x19')](function(_0x1d80f1){if(_0x1d80f1){_0x1e4d0c=_0x1d80f1['length'];if(!_0x25d8d1['query']['hasOwnProperty'](_0xd9ff('0x55'))){_0x39473e[_0xd9ff('0x25')]=qs['limit'](_0x25d8d1[_0xd9ff('0x31')][_0xd9ff('0x25')]);_0x39473e[_0xd9ff('0x24')]=qs[_0xd9ff('0x24')](_0x25d8d1[_0xd9ff('0x31')][_0xd9ff('0x24')]);}return _0x34dc83[_0xd9ff('0x51')](_0x39473e);}})[_0xd9ff('0x19')](function(_0x5e5460){if(_0x5e5460){return _0x5e5460?{'count':_0x1e4d0c,'rows':_0x5e5460}:null;}})[_0xd9ff('0x19')](respondWithResult(_0x54ea27,null))[_0xd9ff('0x4a')](handleError(_0x54ea27,null));};exports[_0xd9ff('0x56')]=function(_0x533050,_0x14e936,_0x58c9c2){if(_0x533050[_0xd9ff('0x4f')]['id']){delete _0x533050[_0xd9ff('0x4f')]['id'];}return db[_0xd9ff('0x45')]['findOne']({'where':{'id':_0x533050[_0xd9ff('0x50')]['id']}})[_0xd9ff('0x19')](handleEntityNotFound(_0x14e936,null))[_0xd9ff('0x19')](function(_0x1cd620){if(_0x1cd620){_0x533050['body'][_0xd9ff('0x57')]=_0x1cd620['id'];_0x533050[_0xd9ff('0x4f')][_0xd9ff('0x58')]=integrations['getSubjects'](_0x533050[_0xd9ff('0x4f')][_0xd9ff('0x59')],_0x533050[_0xd9ff('0x4f')]['type']);_0x533050[_0xd9ff('0x4f')][_0xd9ff('0x5a')]=integrations[_0xd9ff('0x5b')](_0x533050[_0xd9ff('0x4f')][_0xd9ff('0x59')],_0x533050['body'][_0xd9ff('0x5c')]);return db[_0xd9ff('0x53')]['create'](_0x533050[_0xd9ff('0x4f')],{'include':[{'model':db[_0xd9ff('0x5d')],'as':_0xd9ff('0x58')},{'model':db['ZohoField'],'as':_0xd9ff('0x5a')}]});}return null;})['then'](respondWithResult(_0x14e936,null))[_0xd9ff('0x4a')](handleError(_0x14e936,null));};exports['getFields']=function(_0x3b2848,_0x227124,_0x3e6c28){return db[_0xd9ff('0x45')][_0xd9ff('0x52')]({'where':{'id':_0x3b2848[_0xd9ff('0x50')]['id']},'attributes':['id',_0xd9ff('0x5e'),_0xd9ff('0x5f')]})[_0xd9ff('0x19')](handleEntityNotFound(_0x227124,null))[_0xd9ff('0x19')](function(_0x4955cc){if(_0x4955cc){return rp({'method':_0xd9ff('0x60'),'uri':util[_0xd9ff('0x61')](_0xd9ff('0x62'),_0x4955cc[_0xd9ff('0x5e')]),'qs':{'authtoken':_0x4955cc[_0xd9ff('0x5f')],'scope':_0xd9ff('0x63')},'json':!![]});}})['then'](function(_0x4b2b32){if(_0x4b2b32){if(_0x4b2b32[_0xd9ff('0x64')]&&_0x4b2b32[_0xd9ff('0x64')][_0xd9ff('0x1c')]){throw new Error(_0x4b2b32[_0xd9ff('0x64')][_0xd9ff('0x1c')][_0xd9ff('0x1e')]);}var _0x5b234c=[];if(_0x4b2b32[_0xd9ff('0x65')]&&_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]){if(_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL']){var _0x32aa19=['Call\x20Purpose'];for(var _0x124214=0x0,_0x3aef79=_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL'][_0xd9ff('0x67')];_0x124214<_0x3aef79;_0x124214++){if(_[_0xd9ff('0x68')](_0x32aa19,_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL'][_0x124214]['dv'])){_0x5b234c['push']({'id':_0x4b2b32[_0xd9ff('0x65')]['section']['FL'][_0x124214]['dv'],'name':_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL'][_0x124214][_0xd9ff('0x69')],'custom':_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL'][_0x124214][_0xd9ff('0x6a')]===_0xd9ff('0x6b')?!![]:![],'options':_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL'][_0x124214][_0xd9ff('0x5c')]===_0xd9ff('0x6c')&&_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL'][_0x124214]['val']?_[_0xd9ff('0x54')](_0x4b2b32[_0xd9ff('0x65')][_0xd9ff('0x66')]['FL'][_0x124214][_0xd9ff('0x6d')],function(_0x4c9b1b){return{'name':_0x4c9b1b,'value':_0x4c9b1b};}):[]});}}}}return{'count':_0x5b234c[_0xd9ff('0x67')],'rows':_0x5b234c};}})[_0xd9ff('0x19')](respondWithResult(_0x227124,null))['catch'](function(_0xd2ff57){var _0x1afdd4=_0x3b2848[_0xd9ff('0x31')][_0xd9ff('0x6e')]?0x1f4:_0xd2ff57[_0xd9ff('0x6f')]||0x1f4;logger[_0xd9ff('0x1c')](_0xd9ff('0x70'),'getFields',_0x1afdd4,JSON[_0xd9ff('0x1b')](_0xd2ff57));delete _0xd2ff57['name'];if(_0x1afdd4===0x191){_0x1afdd4=0x190;}_0x227124[_0xd9ff('0x21')](_0x1afdd4)[_0xd9ff('0x2d')](_0x3b2848[_0xd9ff('0x31')][_0xd9ff('0x6e')]?{'message':_0xd9ff('0x71'),'statusCode':_0xd2ff57[_0xd9ff('0x6f')]}:_0xd2ff57);});};
\ No newline at end of file
+var _0xda2d=['params','keys','includeAll','find','create','body','findOne','ZohoConfiguration','sort','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','type','ZohoField','getFields','authToken','format','https://crm.%s/crm/private/json/Calls/getFields','host','crmapi','response','Calls','section','Call\x20Purpose','push','label','customfield','true','Pick\x20List','val','statusCode','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','stack','name','send','index','ZohoAccount','rawAttributes','query','dateStart','dateEnd','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','add','day','merge','filter','map','field','options','include','rows','then'];(function(_0x131fb2,_0x2fe231){var _0x120a8a=function(_0x257e64){while(--_0x257e64){_0x131fb2['push'](_0x131fb2['shift']());}};_0x120a8a(++_0x2fe231);}(_0xda2d,0x102));var _0xdda2=function(_0x28f4c1,_0x35a46b){_0x28f4c1=_0x28f4c1-0x0;var _0x40cb28=_0xda2d[_0x28f4c1];return _0x40cb28;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda2('0x0'));var rimraf=require(_0xdda2('0x1'));var zipdir=require(_0xdda2('0x2'));var jsonpatch=require(_0xdda2('0x3'));var rp=require(_0xdda2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdda2('0x5'));var path=require(_0xdda2('0x6'));var sox=require(_0xdda2('0x7'));var csv=require(_0xdda2('0x8'));var ejs=require(_0xdda2('0x9'));var fs=require('fs');var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var qs=require(_0xdda2('0x11'));var logger=require(_0xdda2('0x12'))(_0xdda2('0x13'));var utils=require(_0xdda2('0x14'));var config=require(_0xdda2('0x15'));var db=require(_0xdda2('0x16'))['db'];var integrations=require(_0xdda2('0x17'));var jayson=require(_0xdda2('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56d25d,_0xa6446b,_0x320f73,_0x3518b9){return new BPromise(function(_0x1503a7,_0x2e4132){var _0x475222=_0x3518b9||client;return _0x475222[_0xdda2('0x19')](_0x56d25d,_0x320f73)['then'](function(_0x79c6d4){logger['info'](_0xdda2('0x1a'),_0xa6446b,_0xdda2('0x1b'));logger[_0xdda2('0x1c')](_0xdda2('0x1d'),_0xa6446b,_0xdda2('0x1b'),JSON['stringify'](_0x79c6d4));if(_0x79c6d4['error']){if(_0x79c6d4[_0xdda2('0x1e')]['code']===0x1f4){logger[_0xdda2('0x1e')](_0xdda2('0x1a'),_0xa6446b,_0x79c6d4[_0xdda2('0x1e')][_0xdda2('0x1f')]);return _0x2e4132(_0x79c6d4[_0xdda2('0x1e')][_0xdda2('0x1f')]);}logger[_0xdda2('0x1e')](_0xdda2('0x1a'),_0xa6446b,_0x79c6d4[_0xdda2('0x1e')][_0xdda2('0x1f')]);return _0x1503a7(_0x79c6d4[_0xdda2('0x1e')][_0xdda2('0x1f')]);}else{logger['info'](_0xdda2('0x1a'),_0xa6446b,'request\x20sent');_0x1503a7(_0x79c6d4[_0xdda2('0x20')][_0xdda2('0x1f')]);}})[_0xdda2('0x21')](function(_0x4c5226){logger[_0xdda2('0x1e')]('ZohoAccount,\x20%s,\x20%s',_0xa6446b,_0x4c5226);_0x2e4132(_0x4c5226);});});}function respondWithStatusCode(_0x425489,_0x107ee4){_0x107ee4=_0x107ee4||0xcc;return function(_0x4ac3eb){if(_0x4ac3eb){return _0x425489[_0xdda2('0x22')](_0x107ee4);}return _0x425489[_0xdda2('0x23')](_0x107ee4)[_0xdda2('0x24')]();};}function respondWithResult(_0x13b0f3,_0x45ee9d){_0x45ee9d=_0x45ee9d||0xc8;return function(_0x5739ad){if(_0x5739ad){return _0x13b0f3[_0xdda2('0x23')](_0x45ee9d)[_0xdda2('0x25')](_0x5739ad);}};}function respondWithFilteredResult(_0x2391a5,_0x31d48b){return function(_0x5436d1){if(_0x5436d1){var _0x4e97dc=_0x5436d1['count'],_0x28da54=_0x31d48b[_0xdda2('0x26')],_0x4567e7=_0x31d48b[_0xdda2('0x26')]+_0x31d48b[_0xdda2('0x27')],_0x2e8591;if(_0x4567e7>=_0x4e97dc){_0x4567e7=_0x4e97dc;_0x2e8591=0xc8;}else{_0x2e8591=0xce;}_0x2391a5[_0xdda2('0x23')](_0x2e8591);return _0x2391a5[_0xdda2('0x28')](_0xdda2('0x29'),_0x28da54+'-'+_0x4567e7+'/'+_0x4e97dc)['json'](_0x5436d1);}return null;};}function patchUpdates(_0x24c37d){return function(_0x255bbc){try{jsonpatch['apply'](_0x255bbc,_0x24c37d,!![]);}catch(_0x45e800){return BPromise[_0xdda2('0x2a')](_0x45e800);}return _0x255bbc[_0xdda2('0x2b')]();};}function saveUpdates(_0x15e511,_0x5540e5){return function(_0x129eba){if(_0x129eba){return _0x129eba[_0xdda2('0x2c')](_0x15e511)['then'](function(_0x1ca9f3){return _0x1ca9f3;});}return null;};}function removeEntity(_0x5edf7e,_0x2b8cd6){return function(_0x55809a){if(_0x55809a){return _0x55809a['destroy']()['then'](function(){_0x5edf7e[_0xdda2('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b13f4,_0x508664){return function(_0x5cba58){if(!_0x5cba58){_0x1b13f4['sendStatus'](0x194);}return _0x5cba58;};}function handleError(_0x4637c1,_0x567717){_0x567717=_0x567717||0x1f4;return function(_0xca6046){logger[_0xdda2('0x1e')](_0xca6046[_0xdda2('0x2d')]);if(_0xca6046[_0xdda2('0x2e')]){delete _0xca6046[_0xdda2('0x2e')];}_0x4637c1[_0xdda2('0x23')](_0x567717)[_0xdda2('0x2f')](_0xca6046);};}exports[_0xdda2('0x30')]=function(_0x4a32ea,_0x461621){var _0x4212da={},_0x2f8674={},_0x3d510c={'count':0x0,'rows':[]};var _0x392373=db[_0xdda2('0x31')][_0xdda2('0x32')];_0x2f8674['model']=_['keys'](_0x392373);var _0xa03f5={'dateStart':_0x4a32ea[_0xdda2('0x33')][_0xdda2('0x34')],'dateEnd':_0x4a32ea['query']['dateEnd']};delete _0x4a32ea[_0xdda2('0x33')][_0xdda2('0x34')];delete _0x4a32ea[_0xdda2('0x33')][_0xdda2('0x35')];_0x2f8674[_0xdda2('0x33')]=_['keys'](_0x4a32ea[_0xdda2('0x33')]);_0x2f8674[_0xdda2('0x36')]=_['intersection'](_0x2f8674['model'],_0x2f8674[_0xdda2('0x33')]);_0x4212da[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x2f8674[_0xdda2('0x39')],qs[_0xdda2('0x3a')](_0x4a32ea['query'][_0xdda2('0x3a')]));_0x4212da[_0xdda2('0x37')]=_0x4212da[_0xdda2('0x37')][_0xdda2('0x3b')]?_0x4212da['attributes']:_0x2f8674['model'];if(!_0x4a32ea[_0xdda2('0x33')][_0xdda2('0x3c')](_0xdda2('0x3d'))){_0x4212da['limit']=qs[_0xdda2('0x27')](_0x4a32ea['query'][_0xdda2('0x27')]);_0x4212da['offset']=qs[_0xdda2('0x26')](_0x4a32ea[_0xdda2('0x33')][_0xdda2('0x26')]);}_0x4212da[_0xdda2('0x3e')]=qs['sort'](_0x4a32ea[_0xdda2('0x33')]['sort']);_0x4212da[_0xdda2('0x3f')]=qs['filters'](_[_0xdda2('0x40')](_0x4a32ea[_0xdda2('0x33')],_0x2f8674[_0xdda2('0x36')]));if(_0xa03f5[_0xdda2('0x34')]){if(_0xa03f5[_0xdda2('0x35')]){_0xa03f5['dateEnd']=moment(_0xa03f5[_0xdda2('0x35')])[_0xdda2('0x41')](0x1,'day');}else{_0xa03f5[_0xdda2('0x35')]=moment(_0xa03f5['dateStart'])[_0xdda2('0x41')](0x1,_0xdda2('0x42'));}_[_0xdda2('0x43')](_0x4212da[_0xdda2('0x3f')],{'createdAt':{'$gte':_0xa03f5[_0xdda2('0x34')],'$lte':_0xa03f5[_0xdda2('0x35')]}});}if(_0x4a32ea[_0xdda2('0x33')][_0xdda2('0x44')]){_0x4212da[_0xdda2('0x3f')]=_[_0xdda2('0x43')](_0x4212da[_0xdda2('0x3f')],{'$or':_[_0xdda2('0x45')](_0x392373,function(_0x7a2dbc){if(_0x7a2dbc['type']['key']!=='VIRTUAL'){var _0x36573e={};_0x36573e[_0x7a2dbc[_0xdda2('0x46')]]={'$like':'%'+_0x4a32ea['query'][_0xdda2('0x44')]+'%'};return _0x36573e;}})});}_0x4212da=_[_0xdda2('0x43')]({},_0x4212da,_0x4a32ea[_0xdda2('0x47')]);var _0x5e56a8={'where':_0x4212da[_0xdda2('0x3f')]};return db[_0xdda2('0x31')]['count'](_0x5e56a8)['then'](function(_0x37422b){_0x3d510c['count']=_0x37422b;if(_0x4a32ea[_0xdda2('0x33')]['includeAll']){_0x4212da[_0xdda2('0x48')]=[{'all':!![]}];}return db[_0xdda2('0x31')]['findAll'](_0x4212da);})['then'](function(_0x3506ff){_0x3d510c[_0xdda2('0x49')]=_0x3506ff;return _0x3d510c;})[_0xdda2('0x4a')](respondWithFilteredResult(_0x461621,_0x4212da))[_0xdda2('0x21')](handleError(_0x461621,null));};exports['show']=function(_0x1edbc6,_0x3bba94){var _0x3d2cb0={'raw':![],'where':{'id':_0x1edbc6[_0xdda2('0x4b')]['id']}},_0x1dcada={};_0x1dcada['model']=_[_0xdda2('0x4c')](db[_0xdda2('0x31')]['rawAttributes']);_0x1dcada[_0xdda2('0x33')]=_[_0xdda2('0x4c')](_0x1edbc6[_0xdda2('0x33')]);_0x1dcada[_0xdda2('0x36')]=_[_0xdda2('0x38')](_0x1dcada[_0xdda2('0x39')],_0x1dcada['query']);_0x3d2cb0[_0xdda2('0x37')]=_['intersection'](_0x1dcada[_0xdda2('0x39')],qs['fields'](_0x1edbc6[_0xdda2('0x33')]['fields']));_0x3d2cb0[_0xdda2('0x37')]=_0x3d2cb0[_0xdda2('0x37')][_0xdda2('0x3b')]?_0x3d2cb0[_0xdda2('0x37')]:_0x1dcada[_0xdda2('0x39')];if(_0x1edbc6[_0xdda2('0x33')][_0xdda2('0x4d')]){_0x3d2cb0[_0xdda2('0x48')]=[{'all':!![]}];}_0x3d2cb0=_['merge']({},_0x3d2cb0,_0x1edbc6[_0xdda2('0x47')]);return db[_0xdda2('0x31')][_0xdda2('0x4e')](_0x3d2cb0)['then'](handleEntityNotFound(_0x3bba94,null))[_0xdda2('0x4a')](respondWithResult(_0x3bba94,null))[_0xdda2('0x21')](handleError(_0x3bba94,null));};exports['create']=function(_0x3868e7,_0x5d9437){return db[_0xdda2('0x31')][_0xdda2('0x4f')](_0x3868e7[_0xdda2('0x50')],{})[_0xdda2('0x4a')](respondWithResult(_0x5d9437,0xc9))[_0xdda2('0x21')](handleError(_0x5d9437,null));};exports['update']=function(_0x4bc1e9,_0x5c2cb2){if(_0x4bc1e9[_0xdda2('0x50')]['id']){delete _0x4bc1e9[_0xdda2('0x50')]['id'];}return db['ZohoAccount'][_0xdda2('0x4e')]({'where':{'id':_0x4bc1e9[_0xdda2('0x4b')]['id']}})[_0xdda2('0x4a')](handleEntityNotFound(_0x5c2cb2,null))['then'](saveUpdates(_0x4bc1e9[_0xdda2('0x50')],null))[_0xdda2('0x4a')](respondWithResult(_0x5c2cb2,null))[_0xdda2('0x21')](handleError(_0x5c2cb2,null));};exports['destroy']=function(_0x2b2c1d,_0x4495e5){return db[_0xdda2('0x31')][_0xdda2('0x4e')]({'where':{'id':_0x2b2c1d['params']['id']}})[_0xdda2('0x4a')](handleEntityNotFound(_0x4495e5,null))['then'](removeEntity(_0x4495e5,null))['catch'](handleError(_0x4495e5,null));};exports['getConfigurations']=function(_0x285cec,_0x35b38a,_0x2432c0){var _0x433cb0={};var _0x3f511d={};var _0x16cc37;var _0x29a739;return db[_0xdda2('0x31')][_0xdda2('0x51')]({'where':{'id':_0x285cec[_0xdda2('0x4b')]['id']}})[_0xdda2('0x4a')](handleEntityNotFound(_0x35b38a,null))['then'](function(_0x215e2a){if(_0x215e2a){_0x16cc37=_0x215e2a;_0x3f511d[_0xdda2('0x39')]=_[_0xdda2('0x4c')](db[_0xdda2('0x52')][_0xdda2('0x32')]);_0x3f511d[_0xdda2('0x33')]=_[_0xdda2('0x4c')](_0x285cec['query']);_0x3f511d[_0xdda2('0x36')]=_[_0xdda2('0x38')](_0x3f511d[_0xdda2('0x39')],_0x3f511d[_0xdda2('0x33')]);_0x433cb0[_0xdda2('0x37')]=_['intersection'](_0x3f511d[_0xdda2('0x39')],qs[_0xdda2('0x3a')](_0x285cec[_0xdda2('0x33')][_0xdda2('0x3a')]));_0x433cb0[_0xdda2('0x37')]=_0x433cb0['attributes'][_0xdda2('0x3b')]?_0x433cb0[_0xdda2('0x37')]:_0x3f511d[_0xdda2('0x39')];_0x433cb0[_0xdda2('0x3e')]=qs[_0xdda2('0x53')](_0x285cec['query'][_0xdda2('0x53')]);_0x433cb0[_0xdda2('0x3f')]=qs[_0xdda2('0x36')](_['pick'](_0x285cec[_0xdda2('0x33')],_0x3f511d['filters']));if(_0x285cec[_0xdda2('0x33')][_0xdda2('0x44')]){_0x433cb0[_0xdda2('0x3f')]=_['merge'](_0x433cb0[_0xdda2('0x3f')],{'$or':_[_0xdda2('0x45')](_0x433cb0['attributes'],function(_0x13c0d9){var _0x5adab5={};_0x5adab5[_0x13c0d9]={'$like':'%'+_0x285cec[_0xdda2('0x33')][_0xdda2('0x44')]+'%'};return _0x5adab5;})});}_0x433cb0=_[_0xdda2('0x43')]({},_0x433cb0,_0x285cec[_0xdda2('0x47')]);return _0x16cc37[_0xdda2('0x54')](_0x433cb0);}})['then'](function(_0x586ca1){if(_0x586ca1){_0x29a739=_0x586ca1[_0xdda2('0x3b')];if(!_0x285cec[_0xdda2('0x33')]['hasOwnProperty']('nolimit')){_0x433cb0[_0xdda2('0x27')]=qs['limit'](_0x285cec[_0xdda2('0x33')][_0xdda2('0x27')]);_0x433cb0['offset']=qs[_0xdda2('0x26')](_0x285cec[_0xdda2('0x33')][_0xdda2('0x26')]);}return _0x16cc37[_0xdda2('0x54')](_0x433cb0);}})[_0xdda2('0x4a')](function(_0x37f5cd){if(_0x37f5cd){return _0x37f5cd?{'count':_0x29a739,'rows':_0x37f5cd}:null;}})['then'](respondWithResult(_0x35b38a,null))[_0xdda2('0x21')](handleError(_0x35b38a,null));};exports[_0xdda2('0x55')]=function(_0x2dbaad,_0x533880,_0x27780e){if(_0x2dbaad[_0xdda2('0x50')]['id']){delete _0x2dbaad['body']['id'];}return db['ZohoAccount'][_0xdda2('0x51')]({'where':{'id':_0x2dbaad[_0xdda2('0x4b')]['id']}})[_0xdda2('0x4a')](handleEntityNotFound(_0x533880,null))['then'](function(_0x585a72){if(_0x585a72){_0x2dbaad[_0xdda2('0x50')]['AccountId']=_0x585a72['id'];_0x2dbaad[_0xdda2('0x50')][_0xdda2('0x56')]=integrations[_0xdda2('0x57')](_0x2dbaad[_0xdda2('0x50')][_0xdda2('0x58')],_0x2dbaad[_0xdda2('0x50')]['type']);_0x2dbaad['body'][_0xdda2('0x59')]=integrations['getDescriptions'](_0x2dbaad[_0xdda2('0x50')][_0xdda2('0x58')],_0x2dbaad[_0xdda2('0x50')][_0xdda2('0x5a')]);return db[_0xdda2('0x52')][_0xdda2('0x4f')](_0x2dbaad[_0xdda2('0x50')],{'include':[{'model':db[_0xdda2('0x5b')],'as':_0xdda2('0x56')},{'model':db['ZohoField'],'as':_0xdda2('0x59')}]});}return null;})[_0xdda2('0x4a')](respondWithResult(_0x533880,null))[_0xdda2('0x21')](handleError(_0x533880,null));};exports[_0xdda2('0x5c')]=function(_0x4990fe,_0x3b535d,_0x328e7d){return db[_0xdda2('0x31')][_0xdda2('0x51')]({'where':{'id':_0x4990fe['params']['id']},'attributes':['id','host',_0xdda2('0x5d')]})[_0xdda2('0x4a')](handleEntityNotFound(_0x3b535d,null))[_0xdda2('0x4a')](function(_0xe1c6e6){if(_0xe1c6e6){return rp({'method':'GET','uri':util[_0xdda2('0x5e')](_0xdda2('0x5f'),_0xe1c6e6[_0xdda2('0x60')]),'qs':{'authtoken':_0xe1c6e6[_0xdda2('0x5d')],'scope':_0xdda2('0x61')},'json':!![]});}})[_0xdda2('0x4a')](function(_0x27288a){if(_0x27288a){if(_0x27288a[_0xdda2('0x62')]&&_0x27288a[_0xdda2('0x62')][_0xdda2('0x1e')]){throw new Error(_0x27288a[_0xdda2('0x62')][_0xdda2('0x1e')][_0xdda2('0x1f')]);}var _0x3ac576=[];if(_0x27288a[_0xdda2('0x63')]&&_0x27288a['Calls'][_0xdda2('0x64')]){if(_0x27288a[_0xdda2('0x63')]['section']['FL']){var _0x50f7f6=[_0xdda2('0x65')];for(var _0x40fd4c=0x0,_0x1ba7dd=_0x27288a[_0xdda2('0x63')][_0xdda2('0x64')]['FL'][_0xdda2('0x3b')];_0x40fd4c<_0x1ba7dd;_0x40fd4c++){if(_['includes'](_0x50f7f6,_0x27288a[_0xdda2('0x63')][_0xdda2('0x64')]['FL'][_0x40fd4c]['dv'])){_0x3ac576[_0xdda2('0x66')]({'id':_0x27288a[_0xdda2('0x63')]['section']['FL'][_0x40fd4c]['dv'],'name':_0x27288a[_0xdda2('0x63')]['section']['FL'][_0x40fd4c][_0xdda2('0x67')],'custom':_0x27288a[_0xdda2('0x63')]['section']['FL'][_0x40fd4c][_0xdda2('0x68')]===_0xdda2('0x69')?!![]:![],'options':_0x27288a[_0xdda2('0x63')][_0xdda2('0x64')]['FL'][_0x40fd4c][_0xdda2('0x5a')]===_0xdda2('0x6a')&&_0x27288a[_0xdda2('0x63')][_0xdda2('0x64')]['FL'][_0x40fd4c][_0xdda2('0x6b')]?_[_0xdda2('0x45')](_0x27288a[_0xdda2('0x63')]['section']['FL'][_0x40fd4c][_0xdda2('0x6b')],function(_0x39d0a5){return{'name':_0x39d0a5,'value':_0x39d0a5};}):[]});}}}}return{'count':_0x3ac576[_0xdda2('0x3b')],'rows':_0x3ac576};}})[_0xdda2('0x4a')](respondWithResult(_0x3b535d,null))[_0xdda2('0x21')](function(_0x4b25c2){var _0xcb7ca3=_0x4990fe[_0xdda2('0x33')]['test']?0x1f4:_0x4b25c2[_0xdda2('0x6c')]||0x1f4;logger[_0xdda2('0x1e')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xcb7ca3,JSON[_0xdda2('0x6d')](_0x4b25c2));delete _0x4b25c2[_0xdda2('0x2e')];if(_0xcb7ca3===0x191){_0xcb7ca3=0x190;}_0x3b535d[_0xdda2('0x23')](_0xcb7ca3)[_0xdda2('0x2f')](_0x4990fe[_0xdda2('0x33')][_0xdda2('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4b25c2[_0xdda2('0x6c')]}:_0x4b25c2);});};
\ No newline at end of file
index dbd84a8..4920c30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87eb=['bluebird','request-promise','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','lodash','util','../../config/logger','api'];(function(_0x892fed,_0xb9234d){var _0x301ff4=function(_0x2ac34f){while(--_0x2ac34f){_0x892fed['push'](_0x892fed['shift']());}};_0x301ff4(++_0xb9234d);}(_0x87eb,0x178));var _0xb87e=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x87eb[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0xb87e('0x0'));var util=require(_0xb87e('0x1'));var logger=require(_0xb87e('0x2'))(_0xb87e('0x3'));var moment=require('moment');var BPromise=require(_0xb87e('0x4'));var rp=require(_0xb87e('0x5'));var attributes=require(_0xb87e('0x6'));var integrations=require(_0xb87e('0x7'));module[_0xb87e('0x8')]=function(_0x3abe46,_0x40ec12){return _0x3abe46['define']('ZohoAccount',attributes,{'tableName':_0xb87e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a25=['../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','util','../../config/logger','api','bluebird','request-promise','./intZohoAccount.attributes'];(function(_0x4cb07e,_0x5ea08a){var _0x27b2b7=function(_0x31b1e8){while(--_0x31b1e8){_0x4cb07e['push'](_0x4cb07e['shift']());}};_0x27b2b7(++_0x5ea08a);}(_0x6a25,0xd6));var _0x56a2=function(_0x1f7c0d,_0x319a23){_0x1f7c0d=_0x1f7c0d-0x0;var _0x396982=_0x6a25[_0x1f7c0d];return _0x396982;};'use strict';var _=require('lodash');var util=require(_0x56a2('0x0'));var logger=require(_0x56a2('0x1'))(_0x56a2('0x2'));var moment=require('moment');var BPromise=require(_0x56a2('0x3'));var rp=require(_0x56a2('0x4'));var attributes=require(_0x56a2('0x5'));var integrations=require(_0x56a2('0x6'));module[_0x56a2('0x7')]=function(_0x5ce8f5,_0x28e9a3){return _0x5ce8f5[_0x56a2('0x8')](_0x56a2('0x9'),attributes,{'tableName':_0x56a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f147b3..8063d02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5673=['raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','then','request\x20sent','debug','error','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','GetZohoAccount','ZohoAccount','options','attributes','map','include','model','stringify','ShowZohoAccount'];(function(_0xcb8ab,_0x252f1e){var _0x3c5d2b=function(_0x488e22){while(--_0x488e22){_0xcb8ab['push'](_0xcb8ab['shift']());}};_0x3c5d2b(++_0x252f1e);}(_0x5673,0x145));var _0x3567=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0x5673[_0x33ebf5];return _0x66957b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3567('0x0'));var BPromise=require(_0x3567('0x1'));var rs=require(_0x3567('0x2'));var fs=require('fs');var Redis=require(_0x3567('0x3'));var db=require(_0x3567('0x4'))['db'];var utils=require(_0x3567('0x5'));var logger=require(_0x3567('0x6'))(_0x3567('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dcb47,_0x8c6e84,_0x183902){return new BPromise(function(_0x205495,_0x14923f){return client['request'](_0x2dcb47,_0x183902)[_0x3567('0x8')](function(_0x518f75){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x8c6e84,_0x3567('0x9'));logger[_0x3567('0xa')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x8c6e84,'request\x20sent',JSON['stringify'](_0x518f75));if(_0x518f75['error']){if(_0x518f75[_0x3567('0xb')]['code']===0x1f4){logger['error'](_0x3567('0xc'),_0x8c6e84,_0x518f75['error']['message']);return _0x14923f(_0x518f75[_0x3567('0xb')][_0x3567('0xd')]);}logger[_0x3567('0xb')](_0x3567('0xc'),_0x8c6e84,_0x518f75['error']['message']);return _0x205495(_0x518f75['error'][_0x3567('0xd')]);}else{logger[_0x3567('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x8c6e84,'request\x20sent');_0x205495(_0x518f75[_0x3567('0xf')]['message']);}})[_0x3567('0x10')](function(_0x276b03){logger[_0x3567('0xb')](_0x3567('0xc'),_0x8c6e84,_0x276b03);_0x14923f(_0x276b03);});});}exports[_0x3567('0x11')]=function(_0x4517f5){var _0x3f28bf=this;return new Promise(function(_0x8fa98e,_0x8d6606){return db[_0x3567('0x12')]['findAll']({'raw':_0x4517f5[_0x3567('0x13')]?_0x4517f5[_0x3567('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x4517f5['options']?_0x4517f5[_0x3567('0x13')]['where']||null:null,'attributes':_0x4517f5['options']?_0x4517f5[_0x3567('0x13')][_0x3567('0x14')]||null:null,'limit':_0x4517f5[_0x3567('0x13')]?_0x4517f5[_0x3567('0x13')]['limit']||null:null,'include':_0x4517f5[_0x3567('0x13')]?_0x4517f5[_0x3567('0x13')]['include']?_[_0x3567('0x15')](_0x4517f5[_0x3567('0x13')][_0x3567('0x16')],function(_0x31ec69){return{'model':db[_0x31ec69[_0x3567('0x17')]],'as':_0x31ec69['as'],'attributes':_0x31ec69['attributes'],'include':_0x31ec69[_0x3567('0x16')]?_[_0x3567('0x15')](_0x31ec69[_0x3567('0x16')],function(_0x35c9bc){return{'model':db[_0x35c9bc[_0x3567('0x17')]],'as':_0x35c9bc['as'],'attributes':_0x35c9bc[_0x3567('0x14')],'include':_0x35c9bc['include']?_[_0x3567('0x15')](_0x35c9bc[_0x3567('0x16')],function(_0x11a651){return{'model':db[_0x11a651[_0x3567('0x17')]],'as':_0x11a651['as'],'attributes':_0x11a651[_0x3567('0x14')]};}):[]};}):[]};}):[]:[]})[_0x3567('0x8')](function(_0x5b7a14){logger[_0x3567('0xe')](_0x3567('0x11'),_0x4517f5);logger[_0x3567('0xa')](_0x3567('0x11'),_0x4517f5,JSON[_0x3567('0x18')](_0x5b7a14));_0x8fa98e(_0x5b7a14);})[_0x3567('0x10')](function(_0x40bfc8){logger[_0x3567('0xb')]('GetZohoAccount',_0x40bfc8[_0x3567('0xd')],_0x4517f5);_0x8d6606(_0x3f28bf['error'](0x1f4,_0x40bfc8[_0x3567('0xd')]));});});};exports[_0x3567('0x19')]=function(_0x5abf19){var _0x617829=this;return new Promise(function(_0x20a981,_0xa7fc9e){return db[_0x3567('0x12')]['find']({'raw':_0x5abf19[_0x3567('0x13')]?_0x5abf19[_0x3567('0x13')][_0x3567('0x1a')]===undefined?!![]:![]:!![],'where':_0x5abf19[_0x3567('0x13')]?_0x5abf19[_0x3567('0x13')]['where']||null:null,'attributes':_0x5abf19[_0x3567('0x13')]?_0x5abf19[_0x3567('0x13')][_0x3567('0x14')]||null:null,'include':_0x5abf19[_0x3567('0x13')]?_0x5abf19[_0x3567('0x13')]['include']?_[_0x3567('0x15')](_0x5abf19[_0x3567('0x13')]['include'],function(_0x28e3d2){return{'model':db[_0x28e3d2[_0x3567('0x17')]],'as':_0x28e3d2['as'],'attributes':_0x28e3d2[_0x3567('0x14')],'include':_0x28e3d2[_0x3567('0x16')]?_[_0x3567('0x15')](_0x28e3d2[_0x3567('0x16')],function(_0x1b2f29){return{'model':db[_0x1b2f29[_0x3567('0x17')]],'as':_0x1b2f29['as'],'attributes':_0x1b2f29[_0x3567('0x14')],'include':_0x1b2f29[_0x3567('0x16')]?_[_0x3567('0x15')](_0x1b2f29[_0x3567('0x16')],function(_0x255c5d){return{'model':db[_0x255c5d[_0x3567('0x17')]],'as':_0x255c5d['as'],'attributes':_0x255c5d[_0x3567('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a599e){logger[_0x3567('0xe')](_0x3567('0x19'),_0x5abf19);logger[_0x3567('0xa')](_0x3567('0x19'),_0x5abf19,JSON[_0x3567('0x18')](_0x1a599e));_0x20a981(_0x1a599e);})[_0x3567('0x10')](function(_0x4bc964){logger['error']('ShowZohoAccount',_0x4bc964['message'],_0x5abf19);_0xa7fc9e(_0x617829['error'](0x1f4,_0x4bc964[_0x3567('0xd')]));});});};
\ No newline at end of file
+var _0xf23c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','findAll','options','raw','where','limit','map','model','attributes','include','GetZohoAccount','ShowZohoAccount','ZohoAccount','find','lodash'];(function(_0x22f19a,_0x1e0337){var _0x40d24b=function(_0x3b1b09){while(--_0x3b1b09){_0x22f19a['push'](_0x22f19a['shift']());}};_0x40d24b(++_0x1e0337);}(_0xf23c,0x77));var _0xcf23=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0xf23c[_0x4d40dd];return _0x1c51f2;};'use strict';var _=require(_0xcf23('0x0'));var util=require(_0xcf23('0x1'));var moment=require(_0xcf23('0x2'));var BPromise=require(_0xcf23('0x3'));var rs=require(_0xcf23('0x4'));var fs=require('fs');var Redis=require(_0xcf23('0x5'));var db=require(_0xcf23('0x6'))['db'];var utils=require(_0xcf23('0x7'));var logger=require(_0xcf23('0x8'))(_0xcf23('0x9'));var config=require(_0xcf23('0xa'));var jayson=require(_0xcf23('0xb'));var client=jayson[_0xcf23('0xc')][_0xcf23('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e8005,_0x4f4744,_0x1a9569){return new BPromise(function(_0x30ecf2,_0x1d2be7){return client[_0xcf23('0xe')](_0x4e8005,_0x1a9569)[_0xcf23('0xf')](function(_0x332b76){logger[_0xcf23('0x10')](_0xcf23('0x11'),_0x4f4744,'request\x20sent');logger[_0xcf23('0x12')](_0xcf23('0x13'),_0x4f4744,_0xcf23('0x14'),JSON[_0xcf23('0x15')](_0x332b76));if(_0x332b76['error']){if(_0x332b76['error'][_0xcf23('0x16')]===0x1f4){logger[_0xcf23('0x17')]('ZohoAccount,\x20%s,\x20%s',_0x4f4744,_0x332b76[_0xcf23('0x17')][_0xcf23('0x18')]);return _0x1d2be7(_0x332b76[_0xcf23('0x17')][_0xcf23('0x18')]);}logger[_0xcf23('0x17')](_0xcf23('0x11'),_0x4f4744,_0x332b76['error'][_0xcf23('0x18')]);return _0x30ecf2(_0x332b76[_0xcf23('0x17')][_0xcf23('0x18')]);}else{logger[_0xcf23('0x10')](_0xcf23('0x11'),_0x4f4744,_0xcf23('0x14'));_0x30ecf2(_0x332b76[_0xcf23('0x19')][_0xcf23('0x18')]);}})[_0xcf23('0x1a')](function(_0x1e7d4b){logger[_0xcf23('0x17')](_0xcf23('0x11'),_0x4f4744,_0x1e7d4b);_0x1d2be7(_0x1e7d4b);});});}exports['GetZohoAccount']=function(_0x53cd5b){var _0x24c84d=this;return new Promise(function(_0x17f5d2,_0xcf4c75){return db['ZohoAccount'][_0xcf23('0x1b')]({'raw':_0x53cd5b[_0xcf23('0x1c')]?_0x53cd5b[_0xcf23('0x1c')][_0xcf23('0x1d')]===undefined?!![]:![]:!![],'where':_0x53cd5b['options']?_0x53cd5b['options'][_0xcf23('0x1e')]||null:null,'attributes':_0x53cd5b[_0xcf23('0x1c')]?_0x53cd5b[_0xcf23('0x1c')]['attributes']||null:null,'limit':_0x53cd5b[_0xcf23('0x1c')]?_0x53cd5b['options'][_0xcf23('0x1f')]||null:null,'include':_0x53cd5b[_0xcf23('0x1c')]?_0x53cd5b['options']['include']?_[_0xcf23('0x20')](_0x53cd5b[_0xcf23('0x1c')]['include'],function(_0x3ebe7e){return{'model':db[_0x3ebe7e[_0xcf23('0x21')]],'as':_0x3ebe7e['as'],'attributes':_0x3ebe7e[_0xcf23('0x22')],'include':_0x3ebe7e[_0xcf23('0x23')]?_[_0xcf23('0x20')](_0x3ebe7e[_0xcf23('0x23')],function(_0x2bac12){return{'model':db[_0x2bac12['model']],'as':_0x2bac12['as'],'attributes':_0x2bac12[_0xcf23('0x22')],'include':_0x2bac12[_0xcf23('0x23')]?_[_0xcf23('0x20')](_0x2bac12[_0xcf23('0x23')],function(_0x376f09){return{'model':db[_0x376f09['model']],'as':_0x376f09['as'],'attributes':_0x376f09[_0xcf23('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcf23('0xf')](function(_0x540e74){logger[_0xcf23('0x10')](_0xcf23('0x24'),_0x53cd5b);logger['debug'](_0xcf23('0x24'),_0x53cd5b,JSON[_0xcf23('0x15')](_0x540e74));_0x17f5d2(_0x540e74);})['catch'](function(_0x2c42d8){logger[_0xcf23('0x17')](_0xcf23('0x24'),_0x2c42d8[_0xcf23('0x18')],_0x53cd5b);_0xcf4c75(_0x24c84d[_0xcf23('0x17')](0x1f4,_0x2c42d8['message']));});});};exports[_0xcf23('0x25')]=function(_0x2b9882){var _0x4e00ac=this;return new Promise(function(_0xf4f3f5,_0x2be82d){return db[_0xcf23('0x26')][_0xcf23('0x27')]({'raw':_0x2b9882[_0xcf23('0x1c')]?_0x2b9882[_0xcf23('0x1c')][_0xcf23('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b9882[_0xcf23('0x1c')]?_0x2b9882[_0xcf23('0x1c')][_0xcf23('0x1e')]||null:null,'attributes':_0x2b9882[_0xcf23('0x1c')]?_0x2b9882[_0xcf23('0x1c')][_0xcf23('0x22')]||null:null,'include':_0x2b9882['options']?_0x2b9882[_0xcf23('0x1c')][_0xcf23('0x23')]?_[_0xcf23('0x20')](_0x2b9882[_0xcf23('0x1c')][_0xcf23('0x23')],function(_0x400751){return{'model':db[_0x400751['model']],'as':_0x400751['as'],'attributes':_0x400751[_0xcf23('0x22')],'include':_0x400751[_0xcf23('0x23')]?_[_0xcf23('0x20')](_0x400751[_0xcf23('0x23')],function(_0x1e361a){return{'model':db[_0x1e361a[_0xcf23('0x21')]],'as':_0x1e361a['as'],'attributes':_0x1e361a[_0xcf23('0x22')],'include':_0x1e361a['include']?_[_0xcf23('0x20')](_0x1e361a[_0xcf23('0x23')],function(_0x438bab){return{'model':db[_0x438bab[_0xcf23('0x21')]],'as':_0x438bab['as'],'attributes':_0x438bab[_0xcf23('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcf23('0xf')](function(_0x177162){logger[_0xcf23('0x10')](_0xcf23('0x25'),_0x2b9882);logger['debug']('ShowZohoAccount',_0x2b9882,JSON[_0xcf23('0x15')](_0x177162));_0xf4f3f5(_0x177162);})['catch'](function(_0x5cb5bd){logger['error']('ShowZohoAccount',_0x5cb5bd['message'],_0x2b9882);_0x2be82d(_0x4e00ac[_0xcf23('0x17')](0x1f4,_0x5cb5bd['message']));});});};
\ No newline at end of file
index 208057f..d3690d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb31a=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put'];(function(_0x365e3f,_0x5113da){var _0x5acf4a=function(_0x3ed90a){while(--_0x3ed90a){_0x365e3f['push'](_0x365e3f['shift']());}};_0x5acf4a(++_0x5113da);}(_0xb31a,0xd4));var _0xab31=function(_0x4124b3,_0x8dc708){_0x4124b3=_0x4124b3-0x0;var _0x41b54f=_0xb31a[_0x4124b3];return _0x41b54f;};'use strict';var multer=require(_0xab31('0x0'));var util=require(_0xab31('0x1'));var path=require(_0xab31('0x2'));var timeout=require(_0xab31('0x3'));var express=require(_0xab31('0x4'));var router=express[_0xab31('0x5')]();var auth=require(_0xab31('0x6'));var interaction=require(_0xab31('0x7'));var config=require(_0xab31('0x8'));var controller=require(_0xab31('0x9'));router[_0xab31('0xa')]('/',auth[_0xab31('0xb')](),controller[_0xab31('0xc')]);router[_0xab31('0xa')](_0xab31('0xd'),auth['isAuthenticated'](),controller[_0xab31('0xe')]);router[_0xab31('0xa')](_0xab31('0xf'),auth[_0xab31('0xb')](),controller[_0xab31('0x10')]);router[_0xab31('0xa')](_0xab31('0x11'),auth[_0xab31('0xb')](),controller[_0xab31('0x12')]);router['get']('/:id/descriptions',auth[_0xab31('0xb')](),controller[_0xab31('0x13')]);router['post']('/',auth[_0xab31('0xb')](),controller[_0xab31('0x14')]);router[_0xab31('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xab31('0x16')]);router[_0xab31('0x17')](_0xab31('0xd'),auth[_0xab31('0xb')](),controller[_0xab31('0x18')]);module[_0xab31('0x19')]=router;
\ No newline at end of file
+var _0xf8ca=['post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions'];(function(_0x1d2eff,_0x45286f){var _0x25e995=function(_0x22feec){while(--_0x22feec){_0x1d2eff['push'](_0x1d2eff['shift']());}};_0x25e995(++_0x45286f);}(_0xf8ca,0x1be));var _0xaf8c=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xf8ca[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0xaf8c('0x0'));var util=require(_0xaf8c('0x1'));var path=require('path');var timeout=require(_0xaf8c('0x2'));var express=require(_0xaf8c('0x3'));var router=express[_0xaf8c('0x4')]();var auth=require(_0xaf8c('0x5'));var interaction=require(_0xaf8c('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0xaf8c('0x7')]('/',auth[_0xaf8c('0x8')](),controller[_0xaf8c('0x9')]);router[_0xaf8c('0x7')](_0xaf8c('0xa'),auth[_0xaf8c('0x8')](),controller[_0xaf8c('0xb')]);router['get'](_0xaf8c('0xc'),auth['isAuthenticated'](),controller[_0xaf8c('0xd')]);router[_0xaf8c('0x7')]('/:id/subjects',auth[_0xaf8c('0x8')](),controller[_0xaf8c('0xe')]);router[_0xaf8c('0x7')]('/:id/descriptions',auth[_0xaf8c('0x8')](),controller[_0xaf8c('0xf')]);router[_0xaf8c('0x10')]('/',auth[_0xaf8c('0x8')](),controller[_0xaf8c('0x11')]);router['put'](_0xaf8c('0xa'),auth[_0xaf8c('0x8')](),controller[_0xaf8c('0x12')]);router[_0xaf8c('0x13')](_0xaf8c('0xa'),auth[_0xaf8c('0x8')](),controller[_0xaf8c('0x14')]);module[_0xaf8c('0x15')]=router;
\ No newline at end of file
index b005c5b..39d12d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e88=['sequelize','STRING'];(function(_0x5cc068,_0x30849f){var _0x307ac3=function(_0x4469b9){while(--_0x4469b9){_0x5cc068['push'](_0x5cc068['shift']());}};_0x307ac3(++_0x30849f);}(_0x6e88,0xb4));var _0x86e8=function(_0x42dea5,_0xaffe71){_0x42dea5=_0x42dea5-0x0;var _0x4c646a=_0x6e88[_0x42dea5];return _0x4c646a;};'use strict';var Sequelize=require(_0x86e8('0x0'));module['exports']={'name':{'type':Sequelize[_0x86e8('0x1')]},'description':{'type':Sequelize[_0x86e8('0x1')]}};
\ No newline at end of file
+var _0x6a83=['sequelize','exports','STRING'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0x6a83,0x90));var _0x36a8=function(_0x3e05d9,_0x2a6108){_0x3e05d9=_0x3e05d9-0x0;var _0x863f34=_0x6a83[_0x3e05d9];return _0x863f34;};'use strict';var Sequelize=require(_0x36a8('0x0'));module[_0x36a8('0x1')]={'name':{'type':Sequelize[_0x36a8('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9a6c9ee..e98b9cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aa9=['../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','name','send','index','ZohoConfiguration','rawAttributes','keys','query','dateEnd','dateStart','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','merge','filter','map','type','VIRTUAL','field','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','findOne','ZohoField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api'];(function(_0x4c1846,_0x1f46ab){var _0x4e7270=function(_0x17e183){while(--_0x17e183){_0x4c1846['push'](_0x4c1846['shift']());}};_0x4e7270(++_0x1f46ab);}(_0x3aa9,0x1b1));var _0x93aa=function(_0x2099c4,_0x43e128){_0x2099c4=_0x2099c4-0x0;var _0x1b84ca=_0x3aa9[_0x2099c4];return _0x1b84ca;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x93aa('0x0'));var zipdir=require(_0x93aa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x93aa('0x2'));var moment=require(_0x93aa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x93aa('0x4'));var util=require('util');var path=require(_0x93aa('0x5'));var sox=require(_0x93aa('0x6'));var csv=require(_0x93aa('0x7'));var ejs=require(_0x93aa('0x8'));var fs=require('fs');var _=require(_0x93aa('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x93aa('0xa'));var deskjs=require(_0x93aa('0xb'));var toCsv=require('to-csv');var querystring=require(_0x93aa('0xc'));var Papa=require(_0x93aa('0xd'));var Redis=require(_0x93aa('0xe'));var qs=require(_0x93aa('0xf'));var logger=require('../../config/logger')(_0x93aa('0x10'));var utils=require(_0x93aa('0x11'));var config=require(_0x93aa('0x12'));var db=require(_0x93aa('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x93aa('0x14')][_0x93aa('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x4b3b3c,_0x4c439f,_0x3981bc,_0x183f78){return new BPromise(function(_0x41a0e2,_0x31365c){var _0xdb92ce=_0x183f78||client;return _0xdb92ce[_0x93aa('0x16')](_0x4b3b3c,_0x3981bc)[_0x93aa('0x17')](function(_0x667862){logger['info'](_0x93aa('0x18'),_0x4c439f,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4c439f,'request\x20sent',JSON['stringify'](_0x667862));if(_0x667862[_0x93aa('0x19')]){if(_0x667862[_0x93aa('0x19')][_0x93aa('0x1a')]===0x1f4){logger[_0x93aa('0x19')](_0x93aa('0x18'),_0x4c439f,_0x667862[_0x93aa('0x19')][_0x93aa('0x1b')]);return _0x31365c(_0x667862['error'][_0x93aa('0x1b')]);}logger[_0x93aa('0x19')](_0x93aa('0x18'),_0x4c439f,_0x667862['error'][_0x93aa('0x1b')]);return _0x41a0e2(_0x667862['error']['message']);}else{logger[_0x93aa('0x1c')](_0x93aa('0x18'),_0x4c439f,_0x93aa('0x1d'));_0x41a0e2(_0x667862[_0x93aa('0x1e')][_0x93aa('0x1b')]);}})['catch'](function(_0x21ff77){logger[_0x93aa('0x19')](_0x93aa('0x18'),_0x4c439f,_0x21ff77);_0x31365c(_0x21ff77);});});}function respondWithStatusCode(_0x226eac,_0x51aa5a){_0x51aa5a=_0x51aa5a||0xcc;return function(_0x2d22cf){if(_0x2d22cf){return _0x226eac[_0x93aa('0x1f')](_0x51aa5a);}return _0x226eac[_0x93aa('0x20')](_0x51aa5a)[_0x93aa('0x21')]();};}function respondWithResult(_0x4272a6,_0x23b948){_0x23b948=_0x23b948||0xc8;return function(_0x45abde){if(_0x45abde){return _0x4272a6['status'](_0x23b948)[_0x93aa('0x22')](_0x45abde);}};}function respondWithFilteredResult(_0x2ea6a8,_0x46cfa3){return function(_0x5021c8){if(_0x5021c8){var _0x328d2a=_0x5021c8[_0x93aa('0x23')],_0x4a5927=_0x46cfa3[_0x93aa('0x24')],_0x261266=_0x46cfa3['offset']+_0x46cfa3[_0x93aa('0x25')],_0x6d9b8f;if(_0x261266>=_0x328d2a){_0x261266=_0x328d2a;_0x6d9b8f=0xc8;}else{_0x6d9b8f=0xce;}_0x2ea6a8[_0x93aa('0x20')](_0x6d9b8f);return _0x2ea6a8[_0x93aa('0x26')](_0x93aa('0x27'),_0x4a5927+'-'+_0x261266+'/'+_0x328d2a)[_0x93aa('0x22')](_0x5021c8);}return null;};}function patchUpdates(_0x1443ae){return function(_0x553578){try{jsonpatch[_0x93aa('0x28')](_0x553578,_0x1443ae,!![]);}catch(_0x55c9df){return BPromise[_0x93aa('0x29')](_0x55c9df);}return _0x553578[_0x93aa('0x2a')]();};}function saveUpdates(_0x482a39,_0x466075){return function(_0x77d626){if(_0x77d626){return _0x77d626[_0x93aa('0x2b')](_0x482a39)['then'](function(_0x440175){return _0x440175;});}return null;};}function removeEntity(_0x28a92a,_0x22c870){return function(_0x37592f){if(_0x37592f){return _0x37592f['destroy']()['then'](function(){_0x28a92a[_0x93aa('0x20')](0xcc)[_0x93aa('0x21')]();});}};}function handleEntityNotFound(_0x3b13ff,_0x4d04ea){return function(_0x34c5c2){if(!_0x34c5c2){_0x3b13ff[_0x93aa('0x1f')](0x194);}return _0x34c5c2;};}function handleError(_0xf5ac3e,_0x21bb3d){_0x21bb3d=_0x21bb3d||0x1f4;return function(_0x5ae28b){logger['error'](_0x5ae28b['stack']);if(_0x5ae28b[_0x93aa('0x2c')]){delete _0x5ae28b[_0x93aa('0x2c')];}_0xf5ac3e[_0x93aa('0x20')](_0x21bb3d)[_0x93aa('0x2d')](_0x5ae28b);};}exports[_0x93aa('0x2e')]=function(_0xde8ba5,_0x40f88e){var _0x5547cc={},_0x2648de={},_0x3946d4={'count':0x0,'rows':[]};var _0x4877c2=db[_0x93aa('0x2f')][_0x93aa('0x30')];_0x2648de['model']=_[_0x93aa('0x31')](_0x4877c2);var _0x43d557={'dateStart':_0xde8ba5[_0x93aa('0x32')]['dateStart'],'dateEnd':_0xde8ba5['query'][_0x93aa('0x33')]};delete _0xde8ba5[_0x93aa('0x32')][_0x93aa('0x34')];delete _0xde8ba5[_0x93aa('0x32')][_0x93aa('0x33')];_0x2648de['query']=_[_0x93aa('0x31')](_0xde8ba5[_0x93aa('0x32')]);_0x2648de['filters']=_[_0x93aa('0x35')](_0x2648de[_0x93aa('0x36')],_0x2648de[_0x93aa('0x32')]);_0x5547cc['attributes']=_[_0x93aa('0x35')](_0x2648de[_0x93aa('0x36')],qs[_0x93aa('0x37')](_0xde8ba5[_0x93aa('0x32')]['fields']));_0x5547cc[_0x93aa('0x38')]=_0x5547cc['attributes'][_0x93aa('0x39')]?_0x5547cc[_0x93aa('0x38')]:_0x2648de[_0x93aa('0x36')];if(!_0xde8ba5[_0x93aa('0x32')][_0x93aa('0x3a')](_0x93aa('0x3b'))){_0x5547cc[_0x93aa('0x25')]=qs[_0x93aa('0x25')](_0xde8ba5[_0x93aa('0x32')]['limit']);_0x5547cc[_0x93aa('0x24')]=qs[_0x93aa('0x24')](_0xde8ba5['query']['offset']);}_0x5547cc[_0x93aa('0x3c')]=qs[_0x93aa('0x3d')](_0xde8ba5[_0x93aa('0x32')][_0x93aa('0x3d')]);_0x5547cc[_0x93aa('0x3e')]=qs[_0x93aa('0x3f')](_[_0x93aa('0x40')](_0xde8ba5[_0x93aa('0x32')],_0x2648de[_0x93aa('0x3f')]));if(_0x43d557[_0x93aa('0x34')]){if(_0x43d557[_0x93aa('0x33')]){_0x43d557[_0x93aa('0x33')]=moment(_0x43d557[_0x93aa('0x33')])[_0x93aa('0x41')](0x1,_0x93aa('0x42'));}else{_0x43d557[_0x93aa('0x33')]=moment(_0x43d557['dateStart'])[_0x93aa('0x41')](0x1,'day');}_[_0x93aa('0x43')](_0x5547cc['where'],{'createdAt':{'$gte':_0x43d557[_0x93aa('0x34')],'$lte':_0x43d557[_0x93aa('0x33')]}});}if(_0xde8ba5[_0x93aa('0x32')][_0x93aa('0x44')]){_0x5547cc[_0x93aa('0x3e')]=_[_0x93aa('0x43')](_0x5547cc[_0x93aa('0x3e')],{'$or':_[_0x93aa('0x45')](_0x4877c2,function(_0x41136f){if(_0x41136f[_0x93aa('0x46')]['key']!==_0x93aa('0x47')){var _0x18552f={};_0x18552f[_0x41136f[_0x93aa('0x48')]]={'$like':'%'+_0xde8ba5[_0x93aa('0x32')][_0x93aa('0x44')]+'%'};return _0x18552f;}})});}_0x5547cc=_[_0x93aa('0x43')]({},_0x5547cc,_0xde8ba5[_0x93aa('0x49')]);var _0x486243={'where':_0x5547cc['where']};return db['ZohoConfiguration'][_0x93aa('0x23')](_0x486243)[_0x93aa('0x17')](function(_0x40adb5){_0x3946d4[_0x93aa('0x23')]=_0x40adb5;if(_0xde8ba5[_0x93aa('0x32')]['includeAll']){_0x5547cc[_0x93aa('0x4a')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x93aa('0x4b')](_0x5547cc);})['then'](function(_0x2525d7){_0x3946d4[_0x93aa('0x4c')]=_0x2525d7;return _0x3946d4;})[_0x93aa('0x17')](respondWithFilteredResult(_0x40f88e,_0x5547cc))['catch'](handleError(_0x40f88e,null));};exports[_0x93aa('0x4d')]=function(_0x1d113c,_0x4ee42f){var _0x51472={'raw':![],'where':{'id':_0x1d113c[_0x93aa('0x4e')]['id']}},_0x3ada89={};_0x3ada89[_0x93aa('0x36')]=_[_0x93aa('0x31')](db['ZohoConfiguration'][_0x93aa('0x30')]);_0x3ada89['query']=_[_0x93aa('0x31')](_0x1d113c[_0x93aa('0x32')]);_0x3ada89[_0x93aa('0x3f')]=_['intersection'](_0x3ada89[_0x93aa('0x36')],_0x3ada89['query']);_0x51472[_0x93aa('0x38')]=_[_0x93aa('0x35')](_0x3ada89[_0x93aa('0x36')],qs[_0x93aa('0x37')](_0x1d113c[_0x93aa('0x32')][_0x93aa('0x37')]));_0x51472[_0x93aa('0x38')]=_0x51472[_0x93aa('0x38')][_0x93aa('0x39')]?_0x51472[_0x93aa('0x38')]:_0x3ada89[_0x93aa('0x36')];if(_0x1d113c['query'][_0x93aa('0x4f')]){_0x51472[_0x93aa('0x4a')]=[{'all':!![]}];}_0x51472=_['merge']({},_0x51472,_0x1d113c[_0x93aa('0x49')]);return db[_0x93aa('0x2f')][_0x93aa('0x50')](_0x51472)['then'](handleEntityNotFound(_0x4ee42f,null))[_0x93aa('0x17')](respondWithResult(_0x4ee42f,null))[_0x93aa('0x51')](handleError(_0x4ee42f,null));};exports[_0x93aa('0x52')]=function(_0xb8537,_0x46ca48){return db[_0x93aa('0x2f')][_0x93aa('0x52')](_0xb8537[_0x93aa('0x53')],{})[_0x93aa('0x17')](respondWithResult(_0x46ca48,0xc9))[_0x93aa('0x51')](handleError(_0x46ca48,null));};exports[_0x93aa('0x2b')]=function(_0x3e39ca,_0x4daee4){if(_0x3e39ca['body']['id']){delete _0x3e39ca[_0x93aa('0x53')]['id'];}return db[_0x93aa('0x2f')][_0x93aa('0x50')]({'where':{'id':_0x3e39ca['params']['id']}})[_0x93aa('0x17')](handleEntityNotFound(_0x4daee4,null))[_0x93aa('0x17')](saveUpdates(_0x3e39ca[_0x93aa('0x53')],null))[_0x93aa('0x17')](respondWithResult(_0x4daee4,null))[_0x93aa('0x51')](handleError(_0x4daee4,null));};exports[_0x93aa('0x54')]=function(_0x880851,_0xc0da65){return db[_0x93aa('0x2f')][_0x93aa('0x50')]({'where':{'id':_0x880851[_0x93aa('0x4e')]['id']}})[_0x93aa('0x17')](handleEntityNotFound(_0xc0da65,null))[_0x93aa('0x17')](removeEntity(_0xc0da65,null))[_0x93aa('0x51')](handleError(_0xc0da65,null));};exports['getFields']=function(_0x1d4775,_0x395cd4,_0x5f0046){var _0x2868a8={};var _0x24eb92={};var _0x38d75c;var _0x1ca7be;return db['ZohoConfiguration'][_0x93aa('0x55')]({'where':{'id':_0x1d4775[_0x93aa('0x4e')]['id']}})[_0x93aa('0x17')](handleEntityNotFound(_0x395cd4,null))[_0x93aa('0x17')](function(_0x202945){if(_0x202945){_0x38d75c=_0x202945;_0x24eb92[_0x93aa('0x36')]=_[_0x93aa('0x31')](db[_0x93aa('0x56')][_0x93aa('0x30')]);_0x24eb92[_0x93aa('0x32')]=_['keys'](_0x1d4775[_0x93aa('0x32')]);_0x24eb92[_0x93aa('0x3f')]=_[_0x93aa('0x35')](_0x24eb92[_0x93aa('0x36')],_0x24eb92['query']);_0x2868a8[_0x93aa('0x38')]=_[_0x93aa('0x35')](_0x24eb92[_0x93aa('0x36')],qs[_0x93aa('0x37')](_0x1d4775[_0x93aa('0x32')][_0x93aa('0x37')]));_0x2868a8[_0x93aa('0x38')]=_0x2868a8[_0x93aa('0x38')][_0x93aa('0x39')]?_0x2868a8[_0x93aa('0x38')]:_0x24eb92[_0x93aa('0x36')];_0x2868a8[_0x93aa('0x3c')]=qs[_0x93aa('0x3d')](_0x1d4775['query'][_0x93aa('0x3d')]);_0x2868a8[_0x93aa('0x3e')]=qs['filters'](_[_0x93aa('0x40')](_0x1d4775[_0x93aa('0x32')],_0x24eb92['filters']));if(_0x1d4775[_0x93aa('0x32')]['filter']){_0x2868a8['where']=_[_0x93aa('0x43')](_0x2868a8[_0x93aa('0x3e')],{'$or':_['map'](_0x2868a8[_0x93aa('0x38')],function(_0x171598){var _0x2e3449={};_0x2e3449[_0x171598]={'$like':'%'+_0x1d4775['query'][_0x93aa('0x44')]+'%'};return _0x2e3449;})});}_0x2868a8=_[_0x93aa('0x43')]({},_0x2868a8,_0x1d4775[_0x93aa('0x49')]);return _0x38d75c['getFields'](_0x2868a8);}})[_0x93aa('0x17')](function(_0x11c1e0){if(_0x11c1e0){_0x1ca7be=_0x11c1e0['length'];if(!_0x1d4775['query']['hasOwnProperty']('nolimit')){_0x2868a8[_0x93aa('0x25')]=qs[_0x93aa('0x25')](_0x1d4775['query'][_0x93aa('0x25')]);_0x2868a8[_0x93aa('0x24')]=qs[_0x93aa('0x24')](_0x1d4775[_0x93aa('0x32')][_0x93aa('0x24')]);}return _0x38d75c[_0x93aa('0x57')](_0x2868a8);}})[_0x93aa('0x17')](function(_0x3f317e){if(_0x3f317e){return _0x3f317e?{'count':_0x1ca7be,'rows':_0x3f317e}:null;}})[_0x93aa('0x17')](respondWithResult(_0x395cd4,null))[_0x93aa('0x51')](handleError(_0x395cd4,null));};exports['getSubjects']=function(_0x3c5093,_0x5a61a0,_0x2f2121){var _0x41a0fd={};var _0x36cf93={};var _0x1d8aaa;var _0x56d6e8;return db[_0x93aa('0x2f')][_0x93aa('0x55')]({'where':{'id':_0x3c5093[_0x93aa('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a61a0,null))[_0x93aa('0x17')](function(_0x123d0d){if(_0x123d0d){_0x1d8aaa=_0x123d0d;_0x36cf93[_0x93aa('0x36')]=_[_0x93aa('0x31')](db[_0x93aa('0x56')][_0x93aa('0x30')]);_0x36cf93[_0x93aa('0x32')]=_[_0x93aa('0x31')](_0x3c5093[_0x93aa('0x32')]);_0x36cf93[_0x93aa('0x3f')]=_[_0x93aa('0x35')](_0x36cf93['model'],_0x36cf93[_0x93aa('0x32')]);_0x41a0fd[_0x93aa('0x38')]=_[_0x93aa('0x35')](_0x36cf93[_0x93aa('0x36')],qs['fields'](_0x3c5093[_0x93aa('0x32')][_0x93aa('0x37')]));_0x41a0fd[_0x93aa('0x38')]=_0x41a0fd['attributes'][_0x93aa('0x39')]?_0x41a0fd['attributes']:_0x36cf93[_0x93aa('0x36')];_0x41a0fd['order']=qs[_0x93aa('0x3d')](_0x3c5093[_0x93aa('0x32')]['sort']);_0x41a0fd[_0x93aa('0x3e')]=qs[_0x93aa('0x3f')](_[_0x93aa('0x40')](_0x3c5093['query'],_0x36cf93[_0x93aa('0x3f')]));if(_0x3c5093[_0x93aa('0x32')]['filter']){_0x41a0fd[_0x93aa('0x3e')]=_[_0x93aa('0x43')](_0x41a0fd[_0x93aa('0x3e')],{'$or':_[_0x93aa('0x45')](_0x41a0fd[_0x93aa('0x38')],function(_0x13320d){var _0x3eafcd={};_0x3eafcd[_0x13320d]={'$like':'%'+_0x3c5093[_0x93aa('0x32')][_0x93aa('0x44')]+'%'};return _0x3eafcd;})});}_0x41a0fd=_[_0x93aa('0x43')]({},_0x41a0fd,_0x3c5093['options']);return _0x1d8aaa['getSubjects'](_0x41a0fd);}})[_0x93aa('0x17')](function(_0x2c32d4){if(_0x2c32d4){_0x56d6e8=_0x2c32d4['length'];if(!_0x3c5093[_0x93aa('0x32')][_0x93aa('0x3a')](_0x93aa('0x3b'))){_0x41a0fd['limit']=qs[_0x93aa('0x25')](_0x3c5093['query'][_0x93aa('0x25')]);_0x41a0fd['offset']=qs[_0x93aa('0x24')](_0x3c5093[_0x93aa('0x32')][_0x93aa('0x24')]);}return _0x1d8aaa[_0x93aa('0x58')](_0x41a0fd);}})[_0x93aa('0x17')](function(_0x3f8961){if(_0x3f8961){return _0x3f8961?{'count':_0x56d6e8,'rows':_0x3f8961}:null;}})['then'](respondWithResult(_0x5a61a0,null))['catch'](handleError(_0x5a61a0,null));};exports['getDescriptions']=function(_0x8dd835,_0x57e724,_0x451026){var _0x38000b={};var _0x5fc5b1={};var _0x1e2de1;var _0x276f84;return db[_0x93aa('0x2f')][_0x93aa('0x55')]({'where':{'id':_0x8dd835[_0x93aa('0x4e')]['id']}})[_0x93aa('0x17')](handleEntityNotFound(_0x57e724,null))[_0x93aa('0x17')](function(_0x3870b2){if(_0x3870b2){_0x1e2de1=_0x3870b2;_0x5fc5b1[_0x93aa('0x36')]=_[_0x93aa('0x31')](db[_0x93aa('0x56')][_0x93aa('0x30')]);_0x5fc5b1['query']=_[_0x93aa('0x31')](_0x8dd835[_0x93aa('0x32')]);_0x5fc5b1[_0x93aa('0x3f')]=_[_0x93aa('0x35')](_0x5fc5b1[_0x93aa('0x36')],_0x5fc5b1[_0x93aa('0x32')]);_0x38000b[_0x93aa('0x38')]=_['intersection'](_0x5fc5b1[_0x93aa('0x36')],qs[_0x93aa('0x37')](_0x8dd835[_0x93aa('0x32')][_0x93aa('0x37')]));_0x38000b['attributes']=_0x38000b[_0x93aa('0x38')][_0x93aa('0x39')]?_0x38000b[_0x93aa('0x38')]:_0x5fc5b1[_0x93aa('0x36')];_0x38000b['order']=qs[_0x93aa('0x3d')](_0x8dd835[_0x93aa('0x32')]['sort']);_0x38000b['where']=qs[_0x93aa('0x3f')](_[_0x93aa('0x40')](_0x8dd835[_0x93aa('0x32')],_0x5fc5b1[_0x93aa('0x3f')]));if(_0x8dd835[_0x93aa('0x32')][_0x93aa('0x44')]){_0x38000b[_0x93aa('0x3e')]=_[_0x93aa('0x43')](_0x38000b[_0x93aa('0x3e')],{'$or':_[_0x93aa('0x45')](_0x38000b[_0x93aa('0x38')],function(_0x44a2ef){var _0x41a0c4={};_0x41a0c4[_0x44a2ef]={'$like':'%'+_0x8dd835['query']['filter']+'%'};return _0x41a0c4;})});}_0x38000b=_['merge']({},_0x38000b,_0x8dd835[_0x93aa('0x49')]);return _0x1e2de1['getDescriptions'](_0x38000b);}})[_0x93aa('0x17')](function(_0x4fe6f9){if(_0x4fe6f9){_0x276f84=_0x4fe6f9[_0x93aa('0x39')];if(!_0x8dd835[_0x93aa('0x32')]['hasOwnProperty']('nolimit')){_0x38000b[_0x93aa('0x25')]=qs[_0x93aa('0x25')](_0x8dd835[_0x93aa('0x32')]['limit']);_0x38000b['offset']=qs['offset'](_0x8dd835['query'][_0x93aa('0x24')]);}return _0x1e2de1[_0x93aa('0x59')](_0x38000b);}})[_0x93aa('0x17')](function(_0x3d6930){if(_0x3d6930){return _0x3d6930?{'count':_0x276f84,'rows':_0x3d6930}:null;}})[_0x93aa('0x17')](respondWithResult(_0x57e724,null))[_0x93aa('0x51')](handleError(_0x57e724,null));};
\ No newline at end of file
+var _0xe16e=['index','ZohoConfiguration','rawAttributes','model','query','dateStart','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','dateEnd','add','day','merge','filter','key','VIRTUAL','options','includeAll','include','params','find','create','update','body','getFields','ZohoField','findOne','map','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','destroy','stack','name','send'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0xe16e,0x1d4));var _0xee16=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0xe16e[_0x45c48f];return _0xaf5037;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xee16('0x0'));var rimraf=require(_0xee16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee16('0x2'));var rp=require(_0xee16('0x3'));var moment=require(_0xee16('0x4'));var BPromise=require(_0xee16('0x5'));var Mustache=require(_0xee16('0x6'));var util=require(_0xee16('0x7'));var path=require(_0xee16('0x8'));var sox=require(_0xee16('0x9'));var csv=require(_0xee16('0xa'));var ejs=require(_0xee16('0xb'));var fs=require('fs');var _=require(_0xee16('0xc'));var squel=require('squel');var crypto=require(_0xee16('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xee16('0xe'));var toCsv=require(_0xee16('0xa'));var querystring=require(_0xee16('0xf'));var Papa=require(_0xee16('0x10'));var Redis=require(_0xee16('0x11'));var qs=require(_0xee16('0x12'));var logger=require(_0xee16('0x13'))(_0xee16('0x14'));var utils=require(_0xee16('0x15'));var config=require(_0xee16('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xee16('0x17'));var client=jayson[_0xee16('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x504570,_0xd6c6f2,_0x26040a,_0x4ee12e){return new BPromise(function(_0x32884f,_0x223b21){var _0x3eaa74=_0x4ee12e||client;return _0x3eaa74['request'](_0x504570,_0x26040a)[_0xee16('0x19')](function(_0x8fae90){logger[_0xee16('0x1a')](_0xee16('0x1b'),_0xd6c6f2,'request\x20sent');logger[_0xee16('0x1c')](_0xee16('0x1d'),_0xd6c6f2,'request\x20sent',JSON[_0xee16('0x1e')](_0x8fae90));if(_0x8fae90[_0xee16('0x1f')]){if(_0x8fae90[_0xee16('0x1f')][_0xee16('0x20')]===0x1f4){logger[_0xee16('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0xd6c6f2,_0x8fae90[_0xee16('0x1f')][_0xee16('0x21')]);return _0x223b21(_0x8fae90['error'][_0xee16('0x21')]);}logger['error'](_0xee16('0x1b'),_0xd6c6f2,_0x8fae90['error'][_0xee16('0x21')]);return _0x32884f(_0x8fae90[_0xee16('0x1f')]['message']);}else{logger[_0xee16('0x1a')]('ZohoConfiguration,\x20%s,\x20%s',_0xd6c6f2,'request\x20sent');_0x32884f(_0x8fae90['result']['message']);}})[_0xee16('0x22')](function(_0x42fdf8){logger['error'](_0xee16('0x1b'),_0xd6c6f2,_0x42fdf8);_0x223b21(_0x42fdf8);});});}function respondWithStatusCode(_0x21d6c6,_0x2eb57f){_0x2eb57f=_0x2eb57f||0xcc;return function(_0x38fae6){if(_0x38fae6){return _0x21d6c6[_0xee16('0x23')](_0x2eb57f);}return _0x21d6c6['status'](_0x2eb57f)[_0xee16('0x24')]();};}function respondWithResult(_0x4caf83,_0x4bc918){_0x4bc918=_0x4bc918||0xc8;return function(_0x327426){if(_0x327426){return _0x4caf83[_0xee16('0x25')](_0x4bc918)[_0xee16('0x26')](_0x327426);}};}function respondWithFilteredResult(_0x3d5bab,_0x3c1b77){return function(_0x51a48d){if(_0x51a48d){var _0x3bbcd5=_0x51a48d[_0xee16('0x27')],_0x3f4011=_0x3c1b77[_0xee16('0x28')],_0x27713a=_0x3c1b77['offset']+_0x3c1b77[_0xee16('0x29')],_0x45e9a3;if(_0x27713a>=_0x3bbcd5){_0x27713a=_0x3bbcd5;_0x45e9a3=0xc8;}else{_0x45e9a3=0xce;}_0x3d5bab['status'](_0x45e9a3);return _0x3d5bab['set'](_0xee16('0x2a'),_0x3f4011+'-'+_0x27713a+'/'+_0x3bbcd5)[_0xee16('0x26')](_0x51a48d);}return null;};}function patchUpdates(_0x44d4b1){return function(_0x499400){try{jsonpatch['apply'](_0x499400,_0x44d4b1,!![]);}catch(_0x573190){return BPromise[_0xee16('0x2b')](_0x573190);}return _0x499400['save']();};}function saveUpdates(_0x5ee930,_0x40e2f2){return function(_0x2adb88){if(_0x2adb88){return _0x2adb88['update'](_0x5ee930)[_0xee16('0x19')](function(_0x23c44f){return _0x23c44f;});}return null;};}function removeEntity(_0x15c8b1,_0x301e6a){return function(_0x2c3218){if(_0x2c3218){return _0x2c3218[_0xee16('0x2c')]()[_0xee16('0x19')](function(){_0x15c8b1[_0xee16('0x25')](0xcc)[_0xee16('0x24')]();});}};}function handleEntityNotFound(_0x564eae,_0x12a69e){return function(_0x479711){if(!_0x479711){_0x564eae[_0xee16('0x23')](0x194);}return _0x479711;};}function handleError(_0x508cb8,_0xb50efd){_0xb50efd=_0xb50efd||0x1f4;return function(_0x57b574){logger[_0xee16('0x1f')](_0x57b574[_0xee16('0x2d')]);if(_0x57b574[_0xee16('0x2e')]){delete _0x57b574['name'];}_0x508cb8[_0xee16('0x25')](_0xb50efd)[_0xee16('0x2f')](_0x57b574);};}exports[_0xee16('0x30')]=function(_0x45d78a,_0x325b82){var _0x24642e={},_0x243cd5={},_0x4283f3={'count':0x0,'rows':[]};var _0x1ef3c2=db[_0xee16('0x31')][_0xee16('0x32')];_0x243cd5[_0xee16('0x33')]=_['keys'](_0x1ef3c2);var _0x1470e1={'dateStart':_0x45d78a['query']['dateStart'],'dateEnd':_0x45d78a[_0xee16('0x34')]['dateEnd']};delete _0x45d78a[_0xee16('0x34')][_0xee16('0x35')];delete _0x45d78a[_0xee16('0x34')]['dateEnd'];_0x243cd5['query']=_[_0xee16('0x36')](_0x45d78a[_0xee16('0x34')]);_0x243cd5[_0xee16('0x37')]=_[_0xee16('0x38')](_0x243cd5[_0xee16('0x33')],_0x243cd5['query']);_0x24642e['attributes']=_['intersection'](_0x243cd5[_0xee16('0x33')],qs[_0xee16('0x39')](_0x45d78a['query'][_0xee16('0x39')]));_0x24642e[_0xee16('0x3a')]=_0x24642e[_0xee16('0x3a')][_0xee16('0x3b')]?_0x24642e['attributes']:_0x243cd5[_0xee16('0x33')];if(!_0x45d78a[_0xee16('0x34')][_0xee16('0x3c')](_0xee16('0x3d'))){_0x24642e[_0xee16('0x29')]=qs[_0xee16('0x29')](_0x45d78a[_0xee16('0x34')][_0xee16('0x29')]);_0x24642e[_0xee16('0x28')]=qs['offset'](_0x45d78a[_0xee16('0x34')][_0xee16('0x28')]);}_0x24642e[_0xee16('0x3e')]=qs[_0xee16('0x3f')](_0x45d78a[_0xee16('0x34')][_0xee16('0x3f')]);_0x24642e[_0xee16('0x40')]=qs[_0xee16('0x37')](_[_0xee16('0x41')](_0x45d78a[_0xee16('0x34')],_0x243cd5['filters']));if(_0x1470e1['dateStart']){if(_0x1470e1[_0xee16('0x42')]){_0x1470e1['dateEnd']=moment(_0x1470e1['dateEnd'])[_0xee16('0x43')](0x1,_0xee16('0x44'));}else{_0x1470e1[_0xee16('0x42')]=moment(_0x1470e1[_0xee16('0x35')])[_0xee16('0x43')](0x1,_0xee16('0x44'));}_[_0xee16('0x45')](_0x24642e[_0xee16('0x40')],{'createdAt':{'$gte':_0x1470e1[_0xee16('0x35')],'$lte':_0x1470e1[_0xee16('0x42')]}});}if(_0x45d78a[_0xee16('0x34')][_0xee16('0x46')]){_0x24642e[_0xee16('0x40')]=_['merge'](_0x24642e[_0xee16('0x40')],{'$or':_['map'](_0x1ef3c2,function(_0x5ab3e2){if(_0x5ab3e2['type'][_0xee16('0x47')]!==_0xee16('0x48')){var _0x547e15={};_0x547e15[_0x5ab3e2['field']]={'$like':'%'+_0x45d78a[_0xee16('0x34')][_0xee16('0x46')]+'%'};return _0x547e15;}})});}_0x24642e=_[_0xee16('0x45')]({},_0x24642e,_0x45d78a[_0xee16('0x49')]);var _0x5e57e5={'where':_0x24642e[_0xee16('0x40')]};return db['ZohoConfiguration'][_0xee16('0x27')](_0x5e57e5)[_0xee16('0x19')](function(_0x5c80c7){_0x4283f3[_0xee16('0x27')]=_0x5c80c7;if(_0x45d78a['query'][_0xee16('0x4a')]){_0x24642e[_0xee16('0x4b')]=[{'all':!![]}];}return db[_0xee16('0x31')]['findAll'](_0x24642e);})[_0xee16('0x19')](function(_0x10d670){_0x4283f3['rows']=_0x10d670;return _0x4283f3;})[_0xee16('0x19')](respondWithFilteredResult(_0x325b82,_0x24642e))[_0xee16('0x22')](handleError(_0x325b82,null));};exports['show']=function(_0x28379f,_0x5e4fcc){var _0x2a171f={'raw':![],'where':{'id':_0x28379f[_0xee16('0x4c')]['id']}},_0x354be0={};_0x354be0[_0xee16('0x33')]=_[_0xee16('0x36')](db['ZohoConfiguration'][_0xee16('0x32')]);_0x354be0[_0xee16('0x34')]=_['keys'](_0x28379f[_0xee16('0x34')]);_0x354be0[_0xee16('0x37')]=_[_0xee16('0x38')](_0x354be0['model'],_0x354be0[_0xee16('0x34')]);_0x2a171f['attributes']=_[_0xee16('0x38')](_0x354be0[_0xee16('0x33')],qs[_0xee16('0x39')](_0x28379f[_0xee16('0x34')][_0xee16('0x39')]));_0x2a171f['attributes']=_0x2a171f[_0xee16('0x3a')][_0xee16('0x3b')]?_0x2a171f['attributes']:_0x354be0[_0xee16('0x33')];if(_0x28379f[_0xee16('0x34')][_0xee16('0x4a')]){_0x2a171f[_0xee16('0x4b')]=[{'all':!![]}];}_0x2a171f=_[_0xee16('0x45')]({},_0x2a171f,_0x28379f[_0xee16('0x49')]);return db[_0xee16('0x31')][_0xee16('0x4d')](_0x2a171f)[_0xee16('0x19')](handleEntityNotFound(_0x5e4fcc,null))[_0xee16('0x19')](respondWithResult(_0x5e4fcc,null))[_0xee16('0x22')](handleError(_0x5e4fcc,null));};exports[_0xee16('0x4e')]=function(_0x534ecb,_0x446f4f){return db['ZohoConfiguration'][_0xee16('0x4e')](_0x534ecb['body'],{})[_0xee16('0x19')](respondWithResult(_0x446f4f,0xc9))[_0xee16('0x22')](handleError(_0x446f4f,null));};exports[_0xee16('0x4f')]=function(_0x488f5c,_0x108967){if(_0x488f5c[_0xee16('0x50')]['id']){delete _0x488f5c[_0xee16('0x50')]['id'];}return db[_0xee16('0x31')][_0xee16('0x4d')]({'where':{'id':_0x488f5c[_0xee16('0x4c')]['id']}})[_0xee16('0x19')](handleEntityNotFound(_0x108967,null))[_0xee16('0x19')](saveUpdates(_0x488f5c[_0xee16('0x50')],null))[_0xee16('0x19')](respondWithResult(_0x108967,null))[_0xee16('0x22')](handleError(_0x108967,null));};exports[_0xee16('0x2c')]=function(_0x200a5f,_0x34915e){return db[_0xee16('0x31')]['find']({'where':{'id':_0x200a5f[_0xee16('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34915e,null))[_0xee16('0x19')](removeEntity(_0x34915e,null))[_0xee16('0x22')](handleError(_0x34915e,null));};exports[_0xee16('0x51')]=function(_0x372100,_0x37f0b9,_0x4982d2){var _0x43b7c0={};var _0x4fadd6={};var _0x27f128;var _0x413a9e;return db[_0xee16('0x31')]['findOne']({'where':{'id':_0x372100['params']['id']}})[_0xee16('0x19')](handleEntityNotFound(_0x37f0b9,null))[_0xee16('0x19')](function(_0x5f2b6f){if(_0x5f2b6f){_0x27f128=_0x5f2b6f;_0x4fadd6[_0xee16('0x33')]=_[_0xee16('0x36')](db[_0xee16('0x52')][_0xee16('0x32')]);_0x4fadd6[_0xee16('0x34')]=_[_0xee16('0x36')](_0x372100[_0xee16('0x34')]);_0x4fadd6[_0xee16('0x37')]=_[_0xee16('0x38')](_0x4fadd6['model'],_0x4fadd6[_0xee16('0x34')]);_0x43b7c0['attributes']=_['intersection'](_0x4fadd6[_0xee16('0x33')],qs[_0xee16('0x39')](_0x372100[_0xee16('0x34')]['fields']));_0x43b7c0[_0xee16('0x3a')]=_0x43b7c0[_0xee16('0x3a')][_0xee16('0x3b')]?_0x43b7c0['attributes']:_0x4fadd6[_0xee16('0x33')];_0x43b7c0[_0xee16('0x3e')]=qs['sort'](_0x372100[_0xee16('0x34')][_0xee16('0x3f')]);_0x43b7c0[_0xee16('0x40')]=qs[_0xee16('0x37')](_['pick'](_0x372100[_0xee16('0x34')],_0x4fadd6['filters']));if(_0x372100[_0xee16('0x34')][_0xee16('0x46')]){_0x43b7c0['where']=_[_0xee16('0x45')](_0x43b7c0[_0xee16('0x40')],{'$or':_['map'](_0x43b7c0[_0xee16('0x3a')],function(_0x281bdb){var _0x25232f={};_0x25232f[_0x281bdb]={'$like':'%'+_0x372100['query'][_0xee16('0x46')]+'%'};return _0x25232f;})});}_0x43b7c0=_['merge']({},_0x43b7c0,_0x372100[_0xee16('0x49')]);return _0x27f128['getFields'](_0x43b7c0);}})[_0xee16('0x19')](function(_0x4c0c07){if(_0x4c0c07){_0x413a9e=_0x4c0c07[_0xee16('0x3b')];if(!_0x372100[_0xee16('0x34')]['hasOwnProperty'](_0xee16('0x3d'))){_0x43b7c0[_0xee16('0x29')]=qs[_0xee16('0x29')](_0x372100['query'][_0xee16('0x29')]);_0x43b7c0[_0xee16('0x28')]=qs[_0xee16('0x28')](_0x372100[_0xee16('0x34')][_0xee16('0x28')]);}return _0x27f128[_0xee16('0x51')](_0x43b7c0);}})[_0xee16('0x19')](function(_0x13314e){if(_0x13314e){return _0x13314e?{'count':_0x413a9e,'rows':_0x13314e}:null;}})[_0xee16('0x19')](respondWithResult(_0x37f0b9,null))[_0xee16('0x22')](handleError(_0x37f0b9,null));};exports['getSubjects']=function(_0x1dc6b9,_0x37152a,_0x4b8fda){var _0x1536fe={};var _0x26a0a1={};var _0x41a0b7;var _0x5b3d6d;return db['ZohoConfiguration'][_0xee16('0x53')]({'where':{'id':_0x1dc6b9['params']['id']}})[_0xee16('0x19')](handleEntityNotFound(_0x37152a,null))['then'](function(_0x535d12){if(_0x535d12){_0x41a0b7=_0x535d12;_0x26a0a1[_0xee16('0x33')]=_[_0xee16('0x36')](db['ZohoField']['rawAttributes']);_0x26a0a1['query']=_[_0xee16('0x36')](_0x1dc6b9['query']);_0x26a0a1['filters']=_[_0xee16('0x38')](_0x26a0a1[_0xee16('0x33')],_0x26a0a1[_0xee16('0x34')]);_0x1536fe[_0xee16('0x3a')]=_[_0xee16('0x38')](_0x26a0a1[_0xee16('0x33')],qs[_0xee16('0x39')](_0x1dc6b9[_0xee16('0x34')][_0xee16('0x39')]));_0x1536fe['attributes']=_0x1536fe[_0xee16('0x3a')][_0xee16('0x3b')]?_0x1536fe['attributes']:_0x26a0a1[_0xee16('0x33')];_0x1536fe[_0xee16('0x3e')]=qs[_0xee16('0x3f')](_0x1dc6b9[_0xee16('0x34')]['sort']);_0x1536fe[_0xee16('0x40')]=qs[_0xee16('0x37')](_['pick'](_0x1dc6b9[_0xee16('0x34')],_0x26a0a1[_0xee16('0x37')]));if(_0x1dc6b9[_0xee16('0x34')][_0xee16('0x46')]){_0x1536fe[_0xee16('0x40')]=_[_0xee16('0x45')](_0x1536fe['where'],{'$or':_[_0xee16('0x54')](_0x1536fe[_0xee16('0x3a')],function(_0x1166c4){var _0x26ac46={};_0x26ac46[_0x1166c4]={'$like':'%'+_0x1dc6b9['query'][_0xee16('0x46')]+'%'};return _0x26ac46;})});}_0x1536fe=_['merge']({},_0x1536fe,_0x1dc6b9[_0xee16('0x49')]);return _0x41a0b7['getSubjects'](_0x1536fe);}})[_0xee16('0x19')](function(_0x4b7225){if(_0x4b7225){_0x5b3d6d=_0x4b7225[_0xee16('0x3b')];if(!_0x1dc6b9['query']['hasOwnProperty']('nolimit')){_0x1536fe[_0xee16('0x29')]=qs[_0xee16('0x29')](_0x1dc6b9[_0xee16('0x34')][_0xee16('0x29')]);_0x1536fe[_0xee16('0x28')]=qs['offset'](_0x1dc6b9[_0xee16('0x34')][_0xee16('0x28')]);}return _0x41a0b7['getSubjects'](_0x1536fe);}})[_0xee16('0x19')](function(_0x8075a9){if(_0x8075a9){return _0x8075a9?{'count':_0x5b3d6d,'rows':_0x8075a9}:null;}})['then'](respondWithResult(_0x37152a,null))[_0xee16('0x22')](handleError(_0x37152a,null));};exports[_0xee16('0x55')]=function(_0xfa5a8,_0x5aaeb8,_0x3422e3){var _0x3976e3={};var _0x3435e1={};var _0x4a3502;var _0x4b4c82;return db[_0xee16('0x31')][_0xee16('0x53')]({'where':{'id':_0xfa5a8['params']['id']}})[_0xee16('0x19')](handleEntityNotFound(_0x5aaeb8,null))[_0xee16('0x19')](function(_0x3c42c7){if(_0x3c42c7){_0x4a3502=_0x3c42c7;_0x3435e1[_0xee16('0x33')]=_['keys'](db[_0xee16('0x52')][_0xee16('0x32')]);_0x3435e1[_0xee16('0x34')]=_[_0xee16('0x36')](_0xfa5a8[_0xee16('0x34')]);_0x3435e1['filters']=_['intersection'](_0x3435e1[_0xee16('0x33')],_0x3435e1['query']);_0x3976e3['attributes']=_[_0xee16('0x38')](_0x3435e1[_0xee16('0x33')],qs['fields'](_0xfa5a8[_0xee16('0x34')][_0xee16('0x39')]));_0x3976e3[_0xee16('0x3a')]=_0x3976e3['attributes'][_0xee16('0x3b')]?_0x3976e3['attributes']:_0x3435e1[_0xee16('0x33')];_0x3976e3[_0xee16('0x3e')]=qs[_0xee16('0x3f')](_0xfa5a8['query'][_0xee16('0x3f')]);_0x3976e3['where']=qs[_0xee16('0x37')](_[_0xee16('0x41')](_0xfa5a8[_0xee16('0x34')],_0x3435e1[_0xee16('0x37')]));if(_0xfa5a8[_0xee16('0x34')][_0xee16('0x46')]){_0x3976e3[_0xee16('0x40')]=_[_0xee16('0x45')](_0x3976e3['where'],{'$or':_[_0xee16('0x54')](_0x3976e3[_0xee16('0x3a')],function(_0x1d3f6b){var _0x2bf8a4={};_0x2bf8a4[_0x1d3f6b]={'$like':'%'+_0xfa5a8['query'][_0xee16('0x46')]+'%'};return _0x2bf8a4;})});}_0x3976e3=_[_0xee16('0x45')]({},_0x3976e3,_0xfa5a8[_0xee16('0x49')]);return _0x4a3502[_0xee16('0x55')](_0x3976e3);}})[_0xee16('0x19')](function(_0x129d26){if(_0x129d26){_0x4b4c82=_0x129d26[_0xee16('0x3b')];if(!_0xfa5a8[_0xee16('0x34')][_0xee16('0x3c')](_0xee16('0x3d'))){_0x3976e3['limit']=qs[_0xee16('0x29')](_0xfa5a8[_0xee16('0x34')]['limit']);_0x3976e3[_0xee16('0x28')]=qs[_0xee16('0x28')](_0xfa5a8[_0xee16('0x34')]['offset']);}return _0x4a3502['getDescriptions'](_0x3976e3);}})[_0xee16('0x19')](function(_0x2f1be6){if(_0x2f1be6){return _0x2f1be6?{'count':_0x4b4c82,'rows':_0x2f1be6}:null;}})['then'](respondWithResult(_0x5aaeb8,null))['catch'](handleError(_0x5aaeb8,null));};
\ No newline at end of file
index 756a6b5..6dc2c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4226=['define','util','bluebird','request-promise','exports'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x4226,0x1dc));var _0x6422=function(_0x5afe82,_0x515648){_0x5afe82=_0x5afe82-0x0;var _0x23b46b=_0x4226[_0x5afe82];return _0x23b46b;};'use strict';var _=require('lodash');var util=require(_0x6422('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6422('0x1'));var rp=require(_0x6422('0x2'));var attributes=require('./intZohoConfiguration.attributes');module[_0x6422('0x3')]=function(_0x3b39f2,_0x244313){return _0x3b39f2[_0x6422('0x4')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8838=['int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise','exports','ZohoConfiguration'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x8838,0xeb));var _0x8883=function(_0x4586bb,_0x139c58){_0x4586bb=_0x4586bb-0x0;var _0x342389=_0x8838[_0x4586bb];return _0x342389;};'use strict';var _=require(_0x8883('0x0'));var util=require(_0x8883('0x1'));var logger=require(_0x8883('0x2'))(_0x8883('0x3'));var moment=require(_0x8883('0x4'));var BPromise=require('bluebird');var rp=require(_0x8883('0x5'));var attributes=require('./intZohoConfiguration.attributes');module[_0x8883('0x6')]=function(_0x11bac0,_0x2c689d){return _0x11bac0['define'](_0x8883('0x7'),attributes,{'tableName':_0x8883('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4cc67f..7b3cfba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95ad=['rpc','../../config/environment','client','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26f5e0,_0x5bfd89){var _0x202204=function(_0x38ea36){while(--_0x38ea36){_0x26f5e0['push'](_0x26f5e0['shift']());}};_0x202204(++_0x5bfd89);}(_0x95ad,0x1d9));var _0xd95a=function(_0x9cad5b,_0x49d9e0){_0x9cad5b=_0x9cad5b-0x0;var _0x4044a8=_0x95ad[_0x9cad5b];return _0x4044a8;};'use strict';var _=require('lodash');var util=require(_0xd95a('0x0'));var moment=require(_0xd95a('0x1'));var BPromise=require('bluebird');var rs=require(_0xd95a('0x2'));var fs=require('fs');var Redis=require(_0xd95a('0x3'));var db=require(_0xd95a('0x4'))['db'];var utils=require(_0xd95a('0x5'));var logger=require(_0xd95a('0x6'))(_0xd95a('0x7'));var config=require(_0xd95a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd95a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x142a58,_0x37ae11,_0x19adac){return new BPromise(function(_0x34bbea,_0x477fde){return client['request'](_0x142a58,_0x19adac)[_0xd95a('0xa')](function(_0x54f44a){logger[_0xd95a('0xb')](_0xd95a('0xc'),_0x37ae11,_0xd95a('0xd'));logger[_0xd95a('0xe')](_0xd95a('0xf'),_0x37ae11,'request\x20sent',JSON['stringify'](_0x54f44a));if(_0x54f44a['error']){if(_0x54f44a[_0xd95a('0x10')]['code']===0x1f4){logger[_0xd95a('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x37ae11,_0x54f44a[_0xd95a('0x10')][_0xd95a('0x11')]);return _0x477fde(_0x54f44a['error'][_0xd95a('0x11')]);}logger[_0xd95a('0x10')](_0xd95a('0xc'),_0x37ae11,_0x54f44a[_0xd95a('0x10')][_0xd95a('0x11')]);return _0x34bbea(_0x54f44a['error'][_0xd95a('0x11')]);}else{logger['info'](_0xd95a('0xc'),_0x37ae11,_0xd95a('0xd'));_0x34bbea(_0x54f44a[_0xd95a('0x12')][_0xd95a('0x11')]);}})[_0xd95a('0x13')](function(_0x1894c2){logger[_0xd95a('0x10')](_0xd95a('0xc'),_0x37ae11,_0x1894c2);_0x477fde(_0x1894c2);});});}
\ No newline at end of file
+var _0x694e=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x694e,0x11d));var _0xe694=function(_0x5b2025,_0x3e6fa7){_0x5b2025=_0x5b2025-0x0;var _0x305d12=_0x694e[_0x5b2025];return _0x305d12;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe694('0x0'));var BPromise=require(_0xe694('0x1'));var rs=require(_0xe694('0x2'));var fs=require('fs');var Redis=require(_0xe694('0x3'));var db=require(_0xe694('0x4'))['db'];var utils=require(_0xe694('0x5'));var logger=require(_0xe694('0x6'))('rpc');var config=require(_0xe694('0x7'));var jayson=require(_0xe694('0x8'));var client=jayson[_0xe694('0x9')][_0xe694('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3886f9,_0x1b929a,_0x18a582){return new BPromise(function(_0xd40d7c,_0x363476){return client['request'](_0x3886f9,_0x18a582)[_0xe694('0xb')](function(_0x1fa10f){logger[_0xe694('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x1b929a,'request\x20sent');logger[_0xe694('0xd')](_0xe694('0xe'),_0x1b929a,_0xe694('0xf'),JSON[_0xe694('0x10')](_0x1fa10f));if(_0x1fa10f[_0xe694('0x11')]){if(_0x1fa10f[_0xe694('0x11')][_0xe694('0x12')]===0x1f4){logger[_0xe694('0x11')](_0xe694('0x13'),_0x1b929a,_0x1fa10f['error'][_0xe694('0x14')]);return _0x363476(_0x1fa10f['error']['message']);}logger[_0xe694('0x11')](_0xe694('0x13'),_0x1b929a,_0x1fa10f[_0xe694('0x11')][_0xe694('0x14')]);return _0xd40d7c(_0x1fa10f[_0xe694('0x11')][_0xe694('0x14')]);}else{logger[_0xe694('0xc')](_0xe694('0x13'),_0x1b929a,_0xe694('0xf'));_0xd40d7c(_0x1fa10f[_0xe694('0x15')][_0xe694('0x14')]);}})[_0xe694('0x16')](function(_0x87ac54){logger[_0xe694('0x11')](_0xe694('0x13'),_0x1b929a,_0x87ac54);_0x363476(_0x87ac54);});});}
\ No newline at end of file
index 7daff88..63d3138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4db2=['/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x23d957,_0x5d2176){var _0x568ff2=function(_0x6ad689){while(--_0x6ad689){_0x23d957['push'](_0x23d957['shift']());}};_0x568ff2(++_0x5d2176);}(_0x4db2,0x170));var _0x24db=function(_0x45ffc0,_0x4f090b){_0x45ffc0=_0x45ffc0-0x0;var _0x1f0074=_0x4db2[_0x45ffc0];return _0x1f0074;};'use strict';var multer=require(_0x24db('0x0'));var util=require(_0x24db('0x1'));var path=require(_0x24db('0x2'));var timeout=require(_0x24db('0x3'));var express=require(_0x24db('0x4'));var router=express[_0x24db('0x5')]();var auth=require(_0x24db('0x6'));var interaction=require(_0x24db('0x7'));var config=require(_0x24db('0x8'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0x24db('0x9')](),controller[_0x24db('0xa')]);router[_0x24db('0xb')](_0x24db('0xc'),auth[_0x24db('0x9')](),controller[_0x24db('0xd')]);router[_0x24db('0xe')]('/',auth['isAuthenticated'](),controller[_0x24db('0xf')]);router[_0x24db('0x10')](_0x24db('0xc'),auth[_0x24db('0x9')](),controller[_0x24db('0x11')]);router['delete'](_0x24db('0xc'),auth[_0x24db('0x9')](),controller['destroy']);module[_0x24db('0x12')]=router;
\ No newline at end of file
+var _0xdefb=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','put','/:id','update','destroy','exports','multer'];(function(_0x1484e5,_0x2a588b){var _0x1243f7=function(_0x4fd767){while(--_0x4fd767){_0x1484e5['push'](_0x1484e5['shift']());}};_0x1243f7(++_0x2a588b);}(_0xdefb,0xc5));var _0xbdef=function(_0x3ed091,_0x3491d4){_0x3ed091=_0x3ed091-0x0;var _0x49f07c=_0xdefb[_0x3ed091];return _0x49f07c;};'use strict';var multer=require(_0xbdef('0x0'));var util=require(_0xbdef('0x1'));var path=require(_0xbdef('0x2'));var timeout=require(_0xbdef('0x3'));var express=require(_0xbdef('0x4'));var router=express[_0xbdef('0x5')]();var auth=require(_0xbdef('0x6'));var interaction=require(_0xbdef('0x7'));var config=require(_0xbdef('0x8'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0xbdef('0x9')](),controller[_0xbdef('0xa')]);router[_0xbdef('0xb')]('/:id',auth[_0xbdef('0x9')](),controller[_0xbdef('0xc')]);router['post']('/',auth[_0xbdef('0x9')](),controller['create']);router[_0xbdef('0xd')](_0xbdef('0xe'),auth[_0xbdef('0x9')](),controller[_0xbdef('0xf')]);router['delete'](_0xbdef('0xe'),auth[_0xbdef('0x9')](),controller[_0xbdef('0x10')]);module[_0xbdef('0x11')]=router;
\ No newline at end of file
index 2547025..fe09c1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4483=['customVariable','keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x210580,_0x1329d5){var _0x477835=function(_0x202c95){while(--_0x202c95){_0x210580['push'](_0x210580['shift']());}};_0x477835(++_0x1329d5);}(_0x4483,0x1a3));var _0x3448=function(_0xdb4579,_0x306808){_0xdb4579=_0xdb4579-0x0;var _0x5baee7=_0x4483[_0xdb4579];return _0x5baee7;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'type':{'type':Sequelize[_0x3448('0x2')]('string',_0x3448('0x3'),_0x3448('0x4'),_0x3448('0x5')),'defaultValue':_0x3448('0x6')},'content':{'type':Sequelize[_0x3448('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3448('0x2')](_0x3448('0x6'),_0x3448('0x3'),_0x3448('0x4'))},'keyContent':{'type':Sequelize[_0x3448('0x7')]},'idField':{'type':Sequelize[_0x3448('0x7')]},'nameField':{'type':Sequelize[_0x3448('0x7')]},'customField':{'type':Sequelize[_0x3448('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9354=['variable','customVariable','keyValue','string','STRING','BOOLEAN','exports','ENUM'];(function(_0x135770,_0x2bd922){var _0x509512=function(_0x56345c){while(--_0x56345c){_0x135770['push'](_0x135770['shift']());}};_0x509512(++_0x2bd922);}(_0x9354,0x96));var _0x4935=function(_0x24392f,_0x15a3e5){_0x24392f=_0x24392f-0x0;var _0x591e33=_0x9354[_0x24392f];return _0x591e33;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'type':{'type':Sequelize[_0x4935('0x1')]('string',_0x4935('0x2'),_0x4935('0x3'),_0x4935('0x4')),'defaultValue':_0x4935('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4935('0x6')]},'keyType':{'type':Sequelize[_0x4935('0x1')](_0x4935('0x5'),_0x4935('0x2'),_0x4935('0x3'))},'keyContent':{'type':Sequelize[_0x4935('0x6')]},'idField':{'type':Sequelize[_0x4935('0x6')]},'nameField':{'type':Sequelize[_0x4935('0x6')]},'customField':{'type':Sequelize[_0x4935('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b30e2ed..854f86a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfa7=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','ZohoField','rawAttributes','model','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','key','VIRTUAL','field','options','findAll','rows','catch','show','keys','include','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0x4d84cb,_0x4c81e3){var _0x40c301=function(_0x5e7fab){while(--_0x5e7fab){_0x4d84cb['push'](_0x4d84cb['shift']());}};_0x40c301(++_0x4c81e3);}(_0xbfa7,0x83));var _0x7bfa=function(_0x2ad40a,_0x5c3d62){_0x2ad40a=_0x2ad40a-0x0;var _0x405e4a=_0xbfa7[_0x2ad40a];return _0x405e4a;};'use strict';var pdf=require(_0x7bfa('0x0'));var emlformat=require(_0x7bfa('0x1'));var rimraf=require(_0x7bfa('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bfa('0x3'));var rp=require(_0x7bfa('0x4'));var moment=require(_0x7bfa('0x5'));var BPromise=require(_0x7bfa('0x6'));var Mustache=require(_0x7bfa('0x7'));var util=require(_0x7bfa('0x8'));var path=require('path');var sox=require(_0x7bfa('0x9'));var csv=require('to-csv');var ejs=require(_0x7bfa('0xa'));var fs=require('fs');var _=require(_0x7bfa('0xb'));var squel=require(_0x7bfa('0xc'));var crypto=require(_0x7bfa('0xd'));var jsforce=require(_0x7bfa('0xe'));var deskjs=require(_0x7bfa('0xf'));var toCsv=require(_0x7bfa('0x10'));var querystring=require(_0x7bfa('0x11'));var Papa=require(_0x7bfa('0x12'));var Redis=require('ioredis');var qs=require(_0x7bfa('0x13'));var logger=require(_0x7bfa('0x14'))('api');var utils=require(_0x7bfa('0x15'));var config=require(_0x7bfa('0x16'));var db=require(_0x7bfa('0x17'))['db'];function respondWithStatusCode(_0xb9c40b,_0x5a68a3){_0x5a68a3=_0x5a68a3||0xcc;return function(_0x212962){if(_0x212962){return _0xb9c40b[_0x7bfa('0x18')](_0x5a68a3);}return _0xb9c40b[_0x7bfa('0x19')](_0x5a68a3)['end']();};}function respondWithResult(_0x4a9d55,_0x555af7){_0x555af7=_0x555af7||0xc8;return function(_0x1d7293){if(_0x1d7293){return _0x4a9d55[_0x7bfa('0x19')](_0x555af7)[_0x7bfa('0x1a')](_0x1d7293);}};}function respondWithFilteredResult(_0x5c5b23,_0x1fc2c9){return function(_0x231b3a){if(_0x231b3a){var _0x5d1c3d=_0x231b3a[_0x7bfa('0x1b')],_0x2f9ec4=_0x1fc2c9[_0x7bfa('0x1c')],_0x52bf3c=_0x1fc2c9[_0x7bfa('0x1c')]+_0x1fc2c9[_0x7bfa('0x1d')],_0x2a43af;if(_0x52bf3c>=_0x5d1c3d){_0x52bf3c=_0x5d1c3d;_0x2a43af=0xc8;}else{_0x2a43af=0xce;}_0x5c5b23[_0x7bfa('0x19')](_0x2a43af);return _0x5c5b23[_0x7bfa('0x1e')](_0x7bfa('0x1f'),_0x2f9ec4+'-'+_0x52bf3c+'/'+_0x5d1c3d)[_0x7bfa('0x1a')](_0x231b3a);}return null;};}function patchUpdates(_0x4b91a2){return function(_0xa7abd3){try{jsonpatch[_0x7bfa('0x20')](_0xa7abd3,_0x4b91a2,!![]);}catch(_0x5a3eee){return BPromise[_0x7bfa('0x21')](_0x5a3eee);}return _0xa7abd3[_0x7bfa('0x22')]();};}function saveUpdates(_0x26324b,_0x1f913e){return function(_0x1d8a80){if(_0x1d8a80){return _0x1d8a80[_0x7bfa('0x23')](_0x26324b)[_0x7bfa('0x24')](function(_0x57e894){return _0x57e894;});}return null;};}function removeEntity(_0x2a1853,_0x46d267){return function(_0x31e696){if(_0x31e696){return _0x31e696[_0x7bfa('0x25')]()['then'](function(){_0x2a1853[_0x7bfa('0x19')](0xcc)[_0x7bfa('0x26')]();});}};}function handleEntityNotFound(_0x2c4aef,_0x41b766){return function(_0x1cdfe0){if(!_0x1cdfe0){_0x2c4aef[_0x7bfa('0x18')](0x194);}return _0x1cdfe0;};}function handleError(_0x44fcc1,_0x46ce5a){_0x46ce5a=_0x46ce5a||0x1f4;return function(_0x46a01f){logger['error'](_0x46a01f[_0x7bfa('0x27')]);if(_0x46a01f['name']){delete _0x46a01f[_0x7bfa('0x28')];}_0x44fcc1[_0x7bfa('0x19')](_0x46ce5a)[_0x7bfa('0x29')](_0x46a01f);};}exports[_0x7bfa('0x2a')]=function(_0x27770b,_0x22e21c){var _0x1bbfee={},_0x294e78={},_0x82fc2={'count':0x0,'rows':[]};var _0x48ddc0=db[_0x7bfa('0x2b')][_0x7bfa('0x2c')];_0x294e78[_0x7bfa('0x2d')]=_['keys'](_0x48ddc0);var _0x48ad76={'dateStart':_0x27770b['query'][_0x7bfa('0x2e')],'dateEnd':_0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x30')]};delete _0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x2e')];delete _0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x30')];_0x294e78[_0x7bfa('0x2f')]=_['keys'](_0x27770b[_0x7bfa('0x2f')]);_0x294e78[_0x7bfa('0x31')]=_[_0x7bfa('0x32')](_0x294e78[_0x7bfa('0x2d')],_0x294e78[_0x7bfa('0x2f')]);_0x1bbfee[_0x7bfa('0x33')]=_[_0x7bfa('0x32')](_0x294e78[_0x7bfa('0x2d')],qs[_0x7bfa('0x34')](_0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x34')]));_0x1bbfee[_0x7bfa('0x33')]=_0x1bbfee['attributes'][_0x7bfa('0x35')]?_0x1bbfee[_0x7bfa('0x33')]:_0x294e78[_0x7bfa('0x2d')];if(!_0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x36')](_0x7bfa('0x37'))){_0x1bbfee['limit']=qs[_0x7bfa('0x1d')](_0x27770b['query'][_0x7bfa('0x1d')]);_0x1bbfee[_0x7bfa('0x1c')]=qs[_0x7bfa('0x1c')](_0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x1c')]);}_0x1bbfee[_0x7bfa('0x38')]=qs[_0x7bfa('0x39')](_0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x39')]);_0x1bbfee[_0x7bfa('0x3a')]=qs[_0x7bfa('0x31')](_[_0x7bfa('0x3b')](_0x27770b['query'],_0x294e78[_0x7bfa('0x31')]));if(_0x48ad76['dateStart']){if(_0x48ad76[_0x7bfa('0x30')]){_0x48ad76[_0x7bfa('0x30')]=moment(_0x48ad76['dateEnd'])[_0x7bfa('0x3c')](0x1,_0x7bfa('0x3d'));}else{_0x48ad76[_0x7bfa('0x30')]=moment(_0x48ad76['dateStart'])['add'](0x1,_0x7bfa('0x3d'));}_[_0x7bfa('0x3e')](_0x1bbfee[_0x7bfa('0x3a')],{'createdAt':{'$gte':_0x48ad76[_0x7bfa('0x2e')],'$lte':_0x48ad76[_0x7bfa('0x30')]}});}if(_0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x3f')]){_0x1bbfee['where']=_[_0x7bfa('0x3e')](_0x1bbfee[_0x7bfa('0x3a')],{'$or':_[_0x7bfa('0x40')](_0x48ddc0,function(_0x438405){if(_0x438405['type'][_0x7bfa('0x41')]!==_0x7bfa('0x42')){var _0x31f4ad={};_0x31f4ad[_0x438405[_0x7bfa('0x43')]]={'$like':'%'+_0x27770b[_0x7bfa('0x2f')][_0x7bfa('0x3f')]+'%'};return _0x31f4ad;}})});}_0x1bbfee=_['merge']({},_0x1bbfee,_0x27770b[_0x7bfa('0x44')]);var _0x5d4b1b={'where':_0x1bbfee[_0x7bfa('0x3a')]};return db[_0x7bfa('0x2b')][_0x7bfa('0x1b')](_0x5d4b1b)['then'](function(_0x53d115){_0x82fc2[_0x7bfa('0x1b')]=_0x53d115;if(_0x27770b['query']['includeAll']){_0x1bbfee['include']=[{'all':!![]}];}return db[_0x7bfa('0x2b')][_0x7bfa('0x45')](_0x1bbfee);})[_0x7bfa('0x24')](function(_0x1af76e){_0x82fc2[_0x7bfa('0x46')]=_0x1af76e;return _0x82fc2;})[_0x7bfa('0x24')](respondWithFilteredResult(_0x22e21c,_0x1bbfee))[_0x7bfa('0x47')](handleError(_0x22e21c,null));};exports[_0x7bfa('0x48')]=function(_0x41cfb5,_0x52560c){var _0x32f4ac={'raw':!![],'where':{'id':_0x41cfb5['params']['id']}},_0x1f72ec={};_0x1f72ec['model']=_[_0x7bfa('0x49')](db['ZohoField'][_0x7bfa('0x2c')]);_0x1f72ec['query']=_[_0x7bfa('0x49')](_0x41cfb5[_0x7bfa('0x2f')]);_0x1f72ec[_0x7bfa('0x31')]=_[_0x7bfa('0x32')](_0x1f72ec[_0x7bfa('0x2d')],_0x1f72ec[_0x7bfa('0x2f')]);_0x32f4ac['attributes']=_[_0x7bfa('0x32')](_0x1f72ec[_0x7bfa('0x2d')],qs[_0x7bfa('0x34')](_0x41cfb5[_0x7bfa('0x2f')][_0x7bfa('0x34')]));_0x32f4ac[_0x7bfa('0x33')]=_0x32f4ac[_0x7bfa('0x33')][_0x7bfa('0x35')]?_0x32f4ac['attributes']:_0x1f72ec[_0x7bfa('0x2d')];if(_0x41cfb5[_0x7bfa('0x2f')]['includeAll']){_0x32f4ac[_0x7bfa('0x4a')]=[{'all':!![]}];}_0x32f4ac=_[_0x7bfa('0x3e')]({},_0x32f4ac,_0x41cfb5[_0x7bfa('0x44')]);return db[_0x7bfa('0x2b')][_0x7bfa('0x4b')](_0x32f4ac)[_0x7bfa('0x24')](handleEntityNotFound(_0x52560c,null))[_0x7bfa('0x24')](respondWithResult(_0x52560c,null))['catch'](handleError(_0x52560c,null));};exports['create']=function(_0x112693,_0x48dcad){return db[_0x7bfa('0x2b')][_0x7bfa('0x4c')](_0x112693[_0x7bfa('0x4d')],{})[_0x7bfa('0x24')](respondWithResult(_0x48dcad,0xc9))[_0x7bfa('0x47')](handleError(_0x48dcad,null));};exports[_0x7bfa('0x23')]=function(_0x1b0d1f,_0x33deca){if(_0x1b0d1f[_0x7bfa('0x4d')]['id']){delete _0x1b0d1f[_0x7bfa('0x4d')]['id'];}return db[_0x7bfa('0x2b')][_0x7bfa('0x4b')]({'where':{'id':_0x1b0d1f[_0x7bfa('0x4e')]['id']}})[_0x7bfa('0x24')](handleEntityNotFound(_0x33deca,null))['then'](saveUpdates(_0x1b0d1f['body'],null))[_0x7bfa('0x24')](respondWithResult(_0x33deca,null))[_0x7bfa('0x47')](handleError(_0x33deca,null));};exports[_0x7bfa('0x25')]=function(_0x2fe7d2,_0x25bcb6){return db[_0x7bfa('0x2b')][_0x7bfa('0x4b')]({'where':{'id':_0x2fe7d2['params']['id']}})[_0x7bfa('0x24')](handleEntityNotFound(_0x25bcb6,null))['then'](removeEntity(_0x25bcb6,null))['catch'](handleError(_0x25bcb6,null));};
\ No newline at end of file
+var _0x2211=['dateStart','dateEnd','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','day','add','merge','filter','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','status','end','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','ZohoField','rawAttributes','model','query'];(function(_0x20e84d,_0x2f0b85){var _0x3c64c9=function(_0x385a6b){while(--_0x385a6b){_0x20e84d['push'](_0x20e84d['shift']());}};_0x3c64c9(++_0x2f0b85);}(_0x2211,0x6e));var _0x1221=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0x2211[_0x307bf6];return _0x2878fc;};'use strict';var pdf=require(_0x1221('0x0'));var emlformat=require(_0x1221('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1221('0x2'));var jsonpatch=require(_0x1221('0x3'));var rp=require(_0x1221('0x4'));var moment=require('moment');var BPromise=require(_0x1221('0x5'));var Mustache=require(_0x1221('0x6'));var util=require(_0x1221('0x7'));var path=require(_0x1221('0x8'));var sox=require(_0x1221('0x9'));var csv=require(_0x1221('0xa'));var ejs=require(_0x1221('0xb'));var fs=require('fs');var _=require(_0x1221('0xc'));var squel=require(_0x1221('0xd'));var crypto=require(_0x1221('0xe'));var jsforce=require(_0x1221('0xf'));var deskjs=require(_0x1221('0x10'));var toCsv=require(_0x1221('0xa'));var querystring=require(_0x1221('0x11'));var Papa=require('papaparse');var Redis=require(_0x1221('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x1221('0x13'))(_0x1221('0x14'));var utils=require(_0x1221('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x464cf8,_0x45df8d){_0x45df8d=_0x45df8d||0xcc;return function(_0xbc1a48){if(_0xbc1a48){return _0x464cf8['sendStatus'](_0x45df8d);}return _0x464cf8[_0x1221('0x16')](_0x45df8d)[_0x1221('0x17')]();};}function respondWithResult(_0x58f249,_0x14c3bb){_0x14c3bb=_0x14c3bb||0xc8;return function(_0x1ef8e1){if(_0x1ef8e1){return _0x58f249['status'](_0x14c3bb)['json'](_0x1ef8e1);}};}function respondWithFilteredResult(_0x33550b,_0x3203b5){return function(_0x59c3e4){if(_0x59c3e4){var _0x9c5582=_0x59c3e4[_0x1221('0x18')],_0xd1e864=_0x3203b5[_0x1221('0x19')],_0x24cc32=_0x3203b5[_0x1221('0x19')]+_0x3203b5[_0x1221('0x1a')],_0x43aaa4;if(_0x24cc32>=_0x9c5582){_0x24cc32=_0x9c5582;_0x43aaa4=0xc8;}else{_0x43aaa4=0xce;}_0x33550b['status'](_0x43aaa4);return _0x33550b[_0x1221('0x1b')]('Content-Range',_0xd1e864+'-'+_0x24cc32+'/'+_0x9c5582)['json'](_0x59c3e4);}return null;};}function patchUpdates(_0x8ed848){return function(_0x5fa12c){try{jsonpatch[_0x1221('0x1c')](_0x5fa12c,_0x8ed848,!![]);}catch(_0x4875a5){return BPromise[_0x1221('0x1d')](_0x4875a5);}return _0x5fa12c[_0x1221('0x1e')]();};}function saveUpdates(_0x301880,_0x37a086){return function(_0x30ed3f){if(_0x30ed3f){return _0x30ed3f[_0x1221('0x1f')](_0x301880)[_0x1221('0x20')](function(_0xbe88fc){return _0xbe88fc;});}return null;};}function removeEntity(_0x33597b,_0x11faca){return function(_0x5ac7e4){if(_0x5ac7e4){return _0x5ac7e4['destroy']()[_0x1221('0x20')](function(){_0x33597b[_0x1221('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55da5c,_0x10207e){return function(_0x5d42d3){if(!_0x5d42d3){_0x55da5c['sendStatus'](0x194);}return _0x5d42d3;};}function handleError(_0x3468cc,_0x3caa78){_0x3caa78=_0x3caa78||0x1f4;return function(_0x58ccfe){logger[_0x1221('0x21')](_0x58ccfe[_0x1221('0x22')]);if(_0x58ccfe['name']){delete _0x58ccfe[_0x1221('0x23')];}_0x3468cc[_0x1221('0x16')](_0x3caa78)[_0x1221('0x24')](_0x58ccfe);};}exports[_0x1221('0x25')]=function(_0x5ddffc,_0x33bf97){var _0x8cb463={},_0x23ae33={},_0x149b06={'count':0x0,'rows':[]};var _0x5f17d9=db[_0x1221('0x26')][_0x1221('0x27')];_0x23ae33[_0x1221('0x28')]=_['keys'](_0x5f17d9);var _0x35d6c8={'dateStart':_0x5ddffc[_0x1221('0x29')][_0x1221('0x2a')],'dateEnd':_0x5ddffc[_0x1221('0x29')]['dateEnd']};delete _0x5ddffc[_0x1221('0x29')][_0x1221('0x2a')];delete _0x5ddffc[_0x1221('0x29')][_0x1221('0x2b')];_0x23ae33[_0x1221('0x29')]=_['keys'](_0x5ddffc[_0x1221('0x29')]);_0x23ae33['filters']=_['intersection'](_0x23ae33[_0x1221('0x28')],_0x23ae33[_0x1221('0x29')]);_0x8cb463['attributes']=_['intersection'](_0x23ae33[_0x1221('0x28')],qs[_0x1221('0x2c')](_0x5ddffc[_0x1221('0x29')]['fields']));_0x8cb463[_0x1221('0x2d')]=_0x8cb463[_0x1221('0x2d')][_0x1221('0x2e')]?_0x8cb463[_0x1221('0x2d')]:_0x23ae33[_0x1221('0x28')];if(!_0x5ddffc['query'][_0x1221('0x2f')](_0x1221('0x30'))){_0x8cb463['limit']=qs[_0x1221('0x1a')](_0x5ddffc[_0x1221('0x29')][_0x1221('0x1a')]);_0x8cb463['offset']=qs[_0x1221('0x19')](_0x5ddffc[_0x1221('0x29')][_0x1221('0x19')]);}_0x8cb463[_0x1221('0x31')]=qs[_0x1221('0x32')](_0x5ddffc[_0x1221('0x29')]['sort']);_0x8cb463[_0x1221('0x33')]=qs[_0x1221('0x34')](_[_0x1221('0x35')](_0x5ddffc[_0x1221('0x29')],_0x23ae33[_0x1221('0x34')]));if(_0x35d6c8[_0x1221('0x2a')]){if(_0x35d6c8['dateEnd']){_0x35d6c8[_0x1221('0x2b')]=moment(_0x35d6c8[_0x1221('0x2b')])['add'](0x1,_0x1221('0x36'));}else{_0x35d6c8[_0x1221('0x2b')]=moment(_0x35d6c8[_0x1221('0x2a')])[_0x1221('0x37')](0x1,_0x1221('0x36'));}_[_0x1221('0x38')](_0x8cb463[_0x1221('0x33')],{'createdAt':{'$gte':_0x35d6c8[_0x1221('0x2a')],'$lte':_0x35d6c8[_0x1221('0x2b')]}});}if(_0x5ddffc[_0x1221('0x29')][_0x1221('0x39')]){_0x8cb463['where']=_['merge'](_0x8cb463['where'],{'$or':_[_0x1221('0x3a')](_0x5f17d9,function(_0x39f94c){if(_0x39f94c[_0x1221('0x3b')][_0x1221('0x3c')]!=='VIRTUAL'){var _0x1b0d52={};_0x1b0d52[_0x39f94c[_0x1221('0x3d')]]={'$like':'%'+_0x5ddffc[_0x1221('0x29')][_0x1221('0x39')]+'%'};return _0x1b0d52;}})});}_0x8cb463=_[_0x1221('0x38')]({},_0x8cb463,_0x5ddffc[_0x1221('0x3e')]);var _0x49c46c={'where':_0x8cb463[_0x1221('0x33')]};return db['ZohoField'][_0x1221('0x18')](_0x49c46c)[_0x1221('0x20')](function(_0x50579e){_0x149b06['count']=_0x50579e;if(_0x5ddffc[_0x1221('0x29')][_0x1221('0x3f')]){_0x8cb463[_0x1221('0x40')]=[{'all':!![]}];}return db[_0x1221('0x26')][_0x1221('0x41')](_0x8cb463);})['then'](function(_0x5dc483){_0x149b06[_0x1221('0x42')]=_0x5dc483;return _0x149b06;})[_0x1221('0x20')](respondWithFilteredResult(_0x33bf97,_0x8cb463))[_0x1221('0x43')](handleError(_0x33bf97,null));};exports[_0x1221('0x44')]=function(_0x53b66d,_0x3d95c9){var _0x537a43={'raw':!![],'where':{'id':_0x53b66d[_0x1221('0x45')]['id']}},_0x46ae91={};_0x46ae91['model']=_[_0x1221('0x46')](db[_0x1221('0x26')][_0x1221('0x27')]);_0x46ae91[_0x1221('0x29')]=_[_0x1221('0x46')](_0x53b66d[_0x1221('0x29')]);_0x46ae91[_0x1221('0x34')]=_[_0x1221('0x47')](_0x46ae91[_0x1221('0x28')],_0x46ae91[_0x1221('0x29')]);_0x537a43['attributes']=_[_0x1221('0x47')](_0x46ae91[_0x1221('0x28')],qs[_0x1221('0x2c')](_0x53b66d[_0x1221('0x29')][_0x1221('0x2c')]));_0x537a43[_0x1221('0x2d')]=_0x537a43['attributes'][_0x1221('0x2e')]?_0x537a43['attributes']:_0x46ae91[_0x1221('0x28')];if(_0x53b66d[_0x1221('0x29')]['includeAll']){_0x537a43['include']=[{'all':!![]}];}_0x537a43=_[_0x1221('0x38')]({},_0x537a43,_0x53b66d['options']);return db[_0x1221('0x26')][_0x1221('0x48')](_0x537a43)[_0x1221('0x20')](handleEntityNotFound(_0x3d95c9,null))[_0x1221('0x20')](respondWithResult(_0x3d95c9,null))[_0x1221('0x43')](handleError(_0x3d95c9,null));};exports[_0x1221('0x49')]=function(_0x50d3ce,_0x204828){return db['ZohoField'][_0x1221('0x49')](_0x50d3ce[_0x1221('0x4a')],{})['then'](respondWithResult(_0x204828,0xc9))[_0x1221('0x43')](handleError(_0x204828,null));};exports[_0x1221('0x1f')]=function(_0x4c473d,_0x5677ec){if(_0x4c473d['body']['id']){delete _0x4c473d['body']['id'];}return db['ZohoField'][_0x1221('0x48')]({'where':{'id':_0x4c473d[_0x1221('0x45')]['id']}})[_0x1221('0x20')](handleEntityNotFound(_0x5677ec,null))[_0x1221('0x20')](saveUpdates(_0x4c473d[_0x1221('0x4a')],null))[_0x1221('0x20')](respondWithResult(_0x5677ec,null))[_0x1221('0x43')](handleError(_0x5677ec,null));};exports[_0x1221('0x4b')]=function(_0x21c756,_0x3c50e1){return db['ZohoField']['find']({'where':{'id':_0x21c756[_0x1221('0x45')]['id']}})[_0x1221('0x20')](handleEntityNotFound(_0x3c50e1,null))[_0x1221('0x20')](removeEntity(_0x3c50e1,null))[_0x1221('0x43')](handleError(_0x3c50e1,null));};
\ No newline at end of file
index 1525258..5016537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa223=['define','ZohoField','int_zoho_fields','util','api','moment','bluebird'];(function(_0x44ba49,_0x225349){var _0x57fbbe=function(_0x180fdf){while(--_0x180fdf){_0x44ba49['push'](_0x44ba49['shift']());}};_0x57fbbe(++_0x225349);}(_0xa223,0xea));var _0x3a22=function(_0x52408f,_0x194727){_0x52408f=_0x52408f-0x0;var _0x593e80=_0xa223[_0x52408f];return _0x593e80;};'use strict';var _=require('lodash');var util=require(_0x3a22('0x0'));var logger=require('../../config/logger')(_0x3a22('0x1'));var moment=require(_0x3a22('0x2'));var BPromise=require(_0x3a22('0x3'));var rp=require('request-promise');var attributes=require('./intZohoField.attributes');module['exports']=function(_0x4ec28f,_0x2edf8a){return _0x4ec28f[_0x3a22('0x4')](_0x3a22('0x5'),attributes,{'tableName':_0x3a22('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3da=['util','../../config/logger','api','moment','bluebird','request-promise','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var attributes=require(_0xae3d('0x7'));module[_0xae3d('0x8')]=function(_0x22bacf,_0x1b9397){return _0x22bacf[_0xae3d('0x9')](_0xae3d('0xa'),attributes,{'tableName':_0xae3d('0xb'),'paranoid':![],'indexes':[{'name':_0xae3d('0xc'),'fields':[_0xae3d('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 577d887..5a4f7d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fea=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e7368,_0x5bced5){var _0x2f4efc=function(_0x4ff510){while(--_0x4ff510){_0x2e7368['push'](_0x2e7368['shift']());}};_0x2f4efc(++_0x5bced5);}(_0x5fea,0x1b0));var _0xa5fe=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x5fea[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xa5fe('0x0'));var util=require(_0xa5fe('0x1'));var moment=require('moment');var BPromise=require(_0xa5fe('0x2'));var rs=require(_0xa5fe('0x3'));var fs=require('fs');var Redis=require(_0xa5fe('0x4'));var db=require(_0xa5fe('0x5'))['db'];var utils=require(_0xa5fe('0x6'));var logger=require(_0xa5fe('0x7'))(_0xa5fe('0x8'));var config=require(_0xa5fe('0x9'));var jayson=require(_0xa5fe('0xa'));var client=jayson[_0xa5fe('0xb')][_0xa5fe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4102cb,_0x1479fa,_0x5176f7){return new BPromise(function(_0x16790a,_0x47c892){return client[_0xa5fe('0xd')](_0x4102cb,_0x5176f7)[_0xa5fe('0xe')](function(_0x462190){logger['info'](_0xa5fe('0xf'),_0x1479fa,_0xa5fe('0x10'));logger[_0xa5fe('0x11')](_0xa5fe('0x12'),_0x1479fa,_0xa5fe('0x10'),JSON[_0xa5fe('0x13')](_0x462190));if(_0x462190[_0xa5fe('0x14')]){if(_0x462190[_0xa5fe('0x14')][_0xa5fe('0x15')]===0x1f4){logger[_0xa5fe('0x14')](_0xa5fe('0xf'),_0x1479fa,_0x462190['error']['message']);return _0x47c892(_0x462190[_0xa5fe('0x14')]['message']);}logger[_0xa5fe('0x14')](_0xa5fe('0xf'),_0x1479fa,_0x462190[_0xa5fe('0x14')][_0xa5fe('0x16')]);return _0x16790a(_0x462190[_0xa5fe('0x14')][_0xa5fe('0x16')]);}else{logger[_0xa5fe('0x17')](_0xa5fe('0xf'),_0x1479fa,_0xa5fe('0x10'));_0x16790a(_0x462190[_0xa5fe('0x18')]['message']);}})['catch'](function(_0x45e2f7){logger['error']('ZohoField,\x20%s,\x20%s',_0x1479fa,_0x45e2f7);_0x47c892(_0x45e2f7);});});}
\ No newline at end of file
+var _0x6c74=['lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x5e30ac,_0x13b3ae){var _0x2a18e8=function(_0x141067){while(--_0x141067){_0x5e30ac['push'](_0x5e30ac['shift']());}};_0x2a18e8(++_0x13b3ae);}(_0x6c74,0x1a4));var _0x46c7=function(_0xd56b4a,_0x3b529e){_0xd56b4a=_0xd56b4a-0x0;var _0x1006b8=_0x6c74[_0xd56b4a];return _0x1006b8;};'use strict';var _=require(_0x46c7('0x0'));var util=require(_0x46c7('0x1'));var moment=require(_0x46c7('0x2'));var BPromise=require(_0x46c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x46c7('0x5'))(_0x46c7('0x6'));var config=require(_0x46c7('0x7'));var jayson=require(_0x46c7('0x8'));var client=jayson[_0x46c7('0x9')][_0x46c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ed767,_0x1f6d5f,_0x129328){return new BPromise(function(_0x1f8bbb,_0x52beff){return client[_0x46c7('0xb')](_0x2ed767,_0x129328)[_0x46c7('0xc')](function(_0x5beb77){logger[_0x46c7('0xd')](_0x46c7('0xe'),_0x1f6d5f,_0x46c7('0xf'));logger[_0x46c7('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1f6d5f,_0x46c7('0xf'),JSON['stringify'](_0x5beb77));if(_0x5beb77[_0x46c7('0x11')]){if(_0x5beb77[_0x46c7('0x11')]['code']===0x1f4){logger[_0x46c7('0x11')](_0x46c7('0xe'),_0x1f6d5f,_0x5beb77[_0x46c7('0x11')][_0x46c7('0x12')]);return _0x52beff(_0x5beb77[_0x46c7('0x11')][_0x46c7('0x12')]);}logger[_0x46c7('0x11')](_0x46c7('0xe'),_0x1f6d5f,_0x5beb77[_0x46c7('0x11')][_0x46c7('0x12')]);return _0x1f8bbb(_0x5beb77[_0x46c7('0x11')][_0x46c7('0x12')]);}else{logger[_0x46c7('0xd')](_0x46c7('0xe'),_0x1f6d5f,_0x46c7('0xf'));_0x1f8bbb(_0x5beb77[_0x46c7('0x13')][_0x46c7('0x12')]);}})[_0x46c7('0x14')](function(_0x18dd1a){logger[_0x46c7('0x11')](_0x46c7('0xe'),_0x1f6d5f,_0x18dd1a);_0x52beff(_0x18dd1a);});});}
\ No newline at end of file
index 136dcf0..f2229ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc17=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x2bb6d9,_0x150b3d){_0x2bb6d9=_0x2bb6d9-0x0;var _0x3a91cd=_0xfc17[_0x2bb6d9];return _0x3a91cd;};'use strict';var multer=require(_0x7fc1('0x0'));var util=require(_0x7fc1('0x1'));var path=require(_0x7fc1('0x2'));var timeout=require(_0x7fc1('0x3'));var express=require('express');var router=express[_0x7fc1('0x4')]();var auth=require(_0x7fc1('0x5'));var interaction=require(_0x7fc1('0x6'));var config=require(_0x7fc1('0x7'));module[_0x7fc1('0x8')]=router;
\ No newline at end of file
+var _0x0650=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0650,0xed));var _0x0065=function(_0x2ecf85,_0x2eb99e){_0x2ecf85=_0x2ecf85-0x0;var _0x4b2286=_0x0650[_0x2ecf85];return _0x4b2286;};'use strict';var multer=require(_0x0065('0x0'));var util=require('util');var path=require(_0x0065('0x1'));var timeout=require(_0x0065('0x2'));var express=require('express');var router=express[_0x0065('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0065('0x4'));var config=require(_0x0065('0x5'));module[_0x0065('0x6')]=router;
\ No newline at end of file
index 8d22fe4..2071a2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb34=['sequelize','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x3f9aa0,_0x478ec3){var _0x4a82c0=function(_0x279091){while(--_0x279091){_0x3f9aa0['push'](_0x3f9aa0['shift']());}};_0x4a82c0(++_0x478ec3);}(_0xeb34,0x138));var _0x4eb3=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0xeb34[_0x2a7b50];return _0x4224c9;};'use strict';var Sequelize=require(_0x4eb3('0x0'));module['exports']={'name':{'type':Sequelize[_0x4eb3('0x1')],'allowNull':![],'unique':_0x4eb3('0x2')},'version':{'type':Sequelize[_0x4eb3('0x1')],'allowNull':![],'unique':_0x4eb3('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x4eb3('0x3')},'filename':{'type':Sequelize[_0x4eb3('0x1')]},'path':{'type':Sequelize[_0x4eb3('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x4eb3('0x4')]},'active':{'type':Sequelize[_0x4eb3('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x4eb3('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x4eb3('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x4eb3('0x1')]},'title':{'type':Sequelize[_0x4eb3('0x1')]},'remoteUri':{'type':Sequelize[_0x4eb3('0x1')]},'link':{'type':Sequelize[_0x4eb3('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x50bd=['sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x50bd,0x1e3));var _0xd50b=function(_0x31b337,_0x2b4693){_0x31b337=_0x31b337-0x0;var _0x164b0d=_0x50bd[_0x31b337];return _0x164b0d;};'use strict';var Sequelize=require(_0xd50b('0x0'));module[_0xd50b('0x1')]={'name':{'type':Sequelize[_0xd50b('0x2')],'allowNull':![],'unique':_0xd50b('0x3')},'version':{'type':Sequelize[_0xd50b('0x2')],'allowNull':![],'unique':_0xd50b('0x3')},'main':{'type':Sequelize[_0xd50b('0x2')],'defaultValue':_0xd50b('0x4')},'filename':{'type':Sequelize[_0xd50b('0x2')]},'path':{'type':Sequelize[_0xd50b('0x2')]},'type':{'type':Sequelize[_0xd50b('0x2')]},'size':{'type':Sequelize[_0xd50b('0x5')]},'active':{'type':Sequelize[_0xd50b('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xd50b('0x2')]},'logo':{'type':Sequelize[_0xd50b('0x2')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0xd50b('0x2')]},'title':{'type':Sequelize[_0xd50b('0x2')]},'remoteUri':{'type':Sequelize[_0xd50b('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
index b841c2e..0c1a99f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9d5=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','Integration','rawAttributes','keys','query','dateStart','dateEnd','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','filters','pick','day','add','filter','merge','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xf9d5,0x122));var _0x5f9d=function(_0x1e0919,_0x350959){_0x1e0919=_0x1e0919-0x0;var _0x44dac5=_0xf9d5[_0x1e0919];return _0x44dac5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5f9d('0x0'));var rimraf=require(_0x5f9d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f9d('0x2'));var rp=require(_0x5f9d('0x3'));var moment=require(_0x5f9d('0x4'));var BPromise=require(_0x5f9d('0x5'));var Mustache=require(_0x5f9d('0x6'));var util=require(_0x5f9d('0x7'));var path=require(_0x5f9d('0x8'));var sox=require('sox');var csv=require(_0x5f9d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5f9d('0xa'));var squel=require(_0x5f9d('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f9d('0xc'));var deskjs=require(_0x5f9d('0xd'));var toCsv=require(_0x5f9d('0x9'));var querystring=require(_0x5f9d('0xe'));var Papa=require(_0x5f9d('0xf'));var Redis=require(_0x5f9d('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x5f9d('0x11'))(_0x5f9d('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5f9d('0x13'))['db'];function respondWithStatusCode(_0x261a17,_0x35993b){_0x35993b=_0x35993b||0xcc;return function(_0x4c3b1a){if(_0x4c3b1a){return _0x261a17[_0x5f9d('0x14')](_0x35993b);}return _0x261a17[_0x5f9d('0x15')](_0x35993b)[_0x5f9d('0x16')]();};}function respondWithResult(_0x23a39f,_0x550655){_0x550655=_0x550655||0xc8;return function(_0x5d42fd){if(_0x5d42fd){return _0x23a39f[_0x5f9d('0x15')](_0x550655)[_0x5f9d('0x17')](_0x5d42fd);}};}function respondWithFilteredResult(_0x5aacdc,_0x8e2381){return function(_0x3ae401){if(_0x3ae401){var _0x57cb1a=_0x3ae401[_0x5f9d('0x18')],_0x4fd1cb=_0x8e2381[_0x5f9d('0x19')],_0x2f0154=_0x8e2381[_0x5f9d('0x19')]+_0x8e2381['limit'],_0x334cea;if(_0x2f0154>=_0x57cb1a){_0x2f0154=_0x57cb1a;_0x334cea=0xc8;}else{_0x334cea=0xce;}_0x5aacdc['status'](_0x334cea);return _0x5aacdc['set'](_0x5f9d('0x1a'),_0x4fd1cb+'-'+_0x2f0154+'/'+_0x57cb1a)['json'](_0x3ae401);}return null;};}function patchUpdates(_0x432f1a){return function(_0x48448e){try{jsonpatch[_0x5f9d('0x1b')](_0x48448e,_0x432f1a,!![]);}catch(_0x453285){return BPromise[_0x5f9d('0x1c')](_0x453285);}return _0x48448e['save']();};}function saveUpdates(_0x42e2f9,_0x16de94){return function(_0x3a2999){if(_0x3a2999){return _0x3a2999[_0x5f9d('0x1d')](_0x42e2f9)[_0x5f9d('0x1e')](function(_0xa62826){return _0xa62826;});}return null;};}function removeEntity(_0x32adab,_0x2563d5){return function(_0x3cd7a4){if(_0x3cd7a4){return _0x3cd7a4['destroy']()['then'](function(){_0x32adab['status'](0xcc)[_0x5f9d('0x16')]();});}};}function handleEntityNotFound(_0x4bd98f,_0xcb239b){return function(_0x5a3472){if(!_0x5a3472){_0x4bd98f[_0x5f9d('0x14')](0x194);}return _0x5a3472;};}function handleError(_0x564886,_0x4875c5){_0x4875c5=_0x4875c5||0x1f4;return function(_0x5086da){logger[_0x5f9d('0x1f')](_0x5086da[_0x5f9d('0x20')]);if(_0x5086da[_0x5f9d('0x21')]){delete _0x5086da[_0x5f9d('0x21')];}_0x564886['status'](_0x4875c5)[_0x5f9d('0x22')](_0x5086da);};}exports[_0x5f9d('0x23')]=function(_0x190402,_0x74f212){var _0x2d097f={},_0x14aaca={},_0x2d66cc={'count':0x0,'rows':[]};var _0x21cc63=db[_0x5f9d('0x24')][_0x5f9d('0x25')];_0x14aaca['model']=_[_0x5f9d('0x26')](_0x21cc63);var _0x1b9054={'dateStart':_0x190402[_0x5f9d('0x27')][_0x5f9d('0x28')],'dateEnd':_0x190402[_0x5f9d('0x27')][_0x5f9d('0x29')]};delete _0x190402[_0x5f9d('0x27')][_0x5f9d('0x28')];delete _0x190402[_0x5f9d('0x27')]['dateEnd'];_0x14aaca['query']=_['keys'](_0x190402[_0x5f9d('0x27')]);_0x14aaca['filters']=_[_0x5f9d('0x2a')](_0x14aaca['model'],_0x14aaca[_0x5f9d('0x27')]);_0x2d097f['attributes']=_[_0x5f9d('0x2a')](_0x14aaca[_0x5f9d('0x2b')],qs[_0x5f9d('0x2c')](_0x190402[_0x5f9d('0x27')][_0x5f9d('0x2c')]));_0x2d097f['attributes']=_0x2d097f[_0x5f9d('0x2d')]['length']?_0x2d097f[_0x5f9d('0x2d')]:_0x14aaca['model'];if(!_0x190402[_0x5f9d('0x27')][_0x5f9d('0x2e')]('nolimit')){_0x2d097f[_0x5f9d('0x2f')]=qs[_0x5f9d('0x2f')](_0x190402[_0x5f9d('0x27')]['limit']);_0x2d097f[_0x5f9d('0x19')]=qs[_0x5f9d('0x19')](_0x190402[_0x5f9d('0x27')][_0x5f9d('0x19')]);}_0x2d097f[_0x5f9d('0x30')]=qs['sort'](_0x190402[_0x5f9d('0x27')][_0x5f9d('0x31')]);_0x2d097f[_0x5f9d('0x32')]=qs[_0x5f9d('0x33')](_[_0x5f9d('0x34')](_0x190402[_0x5f9d('0x27')],_0x14aaca['filters']));if(_0x1b9054[_0x5f9d('0x28')]){if(_0x1b9054[_0x5f9d('0x29')]){_0x1b9054[_0x5f9d('0x29')]=moment(_0x1b9054['dateEnd'])['add'](0x1,_0x5f9d('0x35'));}else{_0x1b9054[_0x5f9d('0x29')]=moment(_0x1b9054[_0x5f9d('0x28')])[_0x5f9d('0x36')](0x1,_0x5f9d('0x35'));}_['merge'](_0x2d097f['where'],{'createdAt':{'$gte':_0x1b9054[_0x5f9d('0x28')],'$lte':_0x1b9054[_0x5f9d('0x29')]}});}if(_0x190402['query'][_0x5f9d('0x37')]){_0x2d097f['where']=_[_0x5f9d('0x38')](_0x2d097f[_0x5f9d('0x32')],{'$or':_['map'](_0x21cc63,function(_0x6fb378){if(_0x6fb378[_0x5f9d('0x39')][_0x5f9d('0x3a')]!=='VIRTUAL'){var _0x2e5361={};_0x2e5361[_0x6fb378[_0x5f9d('0x3b')]]={'$like':'%'+_0x190402[_0x5f9d('0x27')][_0x5f9d('0x37')]+'%'};return _0x2e5361;}})});}_0x2d097f=_[_0x5f9d('0x38')]({},_0x2d097f,_0x190402[_0x5f9d('0x3c')]);var _0x114a69={'where':_0x2d097f[_0x5f9d('0x32')]};return db[_0x5f9d('0x24')][_0x5f9d('0x18')](_0x114a69)[_0x5f9d('0x1e')](function(_0x227ef6){_0x2d66cc[_0x5f9d('0x18')]=_0x227ef6;if(_0x190402[_0x5f9d('0x27')][_0x5f9d('0x3d')]){_0x2d097f[_0x5f9d('0x3e')]=[{'all':!![]}];}return db[_0x5f9d('0x24')][_0x5f9d('0x3f')](_0x2d097f);})[_0x5f9d('0x1e')](function(_0x21b5d1){_0x2d66cc[_0x5f9d('0x40')]=_0x21b5d1;return _0x2d66cc;})[_0x5f9d('0x1e')](respondWithFilteredResult(_0x74f212,_0x2d097f))[_0x5f9d('0x41')](handleError(_0x74f212,null));};exports[_0x5f9d('0x42')]=function(_0x13d343,_0x9afb54){var _0x3accf9={'raw':![],'where':{'id':_0x13d343[_0x5f9d('0x43')]['id']}},_0x1fd561={};_0x1fd561[_0x5f9d('0x2b')]=_['keys'](db[_0x5f9d('0x24')]['rawAttributes']);_0x1fd561[_0x5f9d('0x27')]=_[_0x5f9d('0x26')](_0x13d343[_0x5f9d('0x27')]);_0x1fd561[_0x5f9d('0x33')]=_[_0x5f9d('0x2a')](_0x1fd561[_0x5f9d('0x2b')],_0x1fd561[_0x5f9d('0x27')]);_0x3accf9['attributes']=_[_0x5f9d('0x2a')](_0x1fd561[_0x5f9d('0x2b')],qs[_0x5f9d('0x2c')](_0x13d343['query'][_0x5f9d('0x2c')]));_0x3accf9['attributes']=_0x3accf9[_0x5f9d('0x2d')][_0x5f9d('0x44')]?_0x3accf9[_0x5f9d('0x2d')]:_0x1fd561['model'];if(_0x13d343['query'][_0x5f9d('0x3d')]){_0x3accf9[_0x5f9d('0x3e')]=[{'all':!![]}];}_0x3accf9=_['merge']({},_0x3accf9,_0x13d343[_0x5f9d('0x3c')]);return db['Integration'][_0x5f9d('0x45')](_0x3accf9)[_0x5f9d('0x1e')](handleEntityNotFound(_0x9afb54,null))[_0x5f9d('0x1e')](respondWithResult(_0x9afb54,null))[_0x5f9d('0x41')](handleError(_0x9afb54,null));};exports[_0x5f9d('0x46')]=function(_0x16a9fa,_0x3aa63c){return db[_0x5f9d('0x24')][_0x5f9d('0x46')](_0x16a9fa[_0x5f9d('0x47')],{})['then'](respondWithResult(_0x3aa63c,0xc9))[_0x5f9d('0x41')](handleError(_0x3aa63c,null));};exports[_0x5f9d('0x1d')]=function(_0x4e6d65,_0x29bf01){if(_0x4e6d65[_0x5f9d('0x47')]['id']){delete _0x4e6d65[_0x5f9d('0x47')]['id'];}return db[_0x5f9d('0x24')][_0x5f9d('0x45')]({'where':{'id':_0x4e6d65[_0x5f9d('0x43')]['id']}})[_0x5f9d('0x1e')](handleEntityNotFound(_0x29bf01,null))[_0x5f9d('0x1e')](saveUpdates(_0x4e6d65['body'],null))['then'](respondWithResult(_0x29bf01,null))[_0x5f9d('0x41')](handleError(_0x29bf01,null));};exports[_0x5f9d('0x48')]=function(_0x2c2de6,_0x101616){return db[_0x5f9d('0x24')][_0x5f9d('0x45')]({'where':{'id':_0x2c2de6[_0x5f9d('0x43')]['id']}})[_0x5f9d('0x1e')](handleEntityNotFound(_0x101616,null))[_0x5f9d('0x1e')](removeEntity(_0x101616,null))['catch'](handleError(_0x101616,null));};
\ No newline at end of file
+var _0x6657=['catch','show','params','options','create','body','update','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','then','error','stack','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','add','day','merge','filter','map','type','key','VIRTUAL','Integration','includeAll','include','findAll','rows'];(function(_0x738e7a,_0x6e9441){var _0x4f5489=function(_0xc5c30b){while(--_0xc5c30b){_0x738e7a['push'](_0x738e7a['shift']());}};_0x4f5489(++_0x6e9441);}(_0x6657,0x17f));var _0x7665=function(_0x50e545,_0x342948){_0x50e545=_0x50e545-0x0;var _0x181af8=_0x6657[_0x50e545];return _0x181af8;};'use strict';var pdf=require(_0x7665('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7665('0x1'));var zipdir=require(_0x7665('0x2'));var jsonpatch=require(_0x7665('0x3'));var rp=require(_0x7665('0x4'));var moment=require('moment');var BPromise=require(_0x7665('0x5'));var Mustache=require(_0x7665('0x6'));var util=require(_0x7665('0x7'));var path=require(_0x7665('0x8'));var sox=require(_0x7665('0x9'));var csv=require(_0x7665('0xa'));var ejs=require(_0x7665('0xb'));var fs=require('fs');var _=require(_0x7665('0xc'));var squel=require('squel');var crypto=require(_0x7665('0xd'));var jsforce=require(_0x7665('0xe'));var deskjs=require(_0x7665('0xf'));var toCsv=require(_0x7665('0xa'));var querystring=require(_0x7665('0x10'));var Papa=require(_0x7665('0x11'));var Redis=require(_0x7665('0x12'));var qs=require(_0x7665('0x13'));var logger=require('../../config/logger')(_0x7665('0x14'));var utils=require(_0x7665('0x15'));var config=require(_0x7665('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f1cd,_0x4cb337){_0x4cb337=_0x4cb337||0xcc;return function(_0x34e78b){if(_0x34e78b){return _0x43f1cd[_0x7665('0x17')](_0x4cb337);}return _0x43f1cd['status'](_0x4cb337)[_0x7665('0x18')]();};}function respondWithResult(_0x2e8dda,_0x4dd9aa){_0x4dd9aa=_0x4dd9aa||0xc8;return function(_0x3e2717){if(_0x3e2717){return _0x2e8dda[_0x7665('0x19')](_0x4dd9aa)['json'](_0x3e2717);}};}function respondWithFilteredResult(_0x42c571,_0x311e63){return function(_0x35c173){if(_0x35c173){var _0x3bc95e=_0x35c173[_0x7665('0x1a')],_0x2719c0=_0x311e63[_0x7665('0x1b')],_0x331d8c=_0x311e63[_0x7665('0x1b')]+_0x311e63[_0x7665('0x1c')],_0x308e5c;if(_0x331d8c>=_0x3bc95e){_0x331d8c=_0x3bc95e;_0x308e5c=0xc8;}else{_0x308e5c=0xce;}_0x42c571[_0x7665('0x19')](_0x308e5c);return _0x42c571[_0x7665('0x1d')](_0x7665('0x1e'),_0x2719c0+'-'+_0x331d8c+'/'+_0x3bc95e)[_0x7665('0x1f')](_0x35c173);}return null;};}function patchUpdates(_0xa3f5d4){return function(_0x522944){try{jsonpatch[_0x7665('0x20')](_0x522944,_0xa3f5d4,!![]);}catch(_0x8586d9){return BPromise['reject'](_0x8586d9);}return _0x522944[_0x7665('0x21')]();};}function saveUpdates(_0x2033a5,_0x6dd715){return function(_0x3dd56c){if(_0x3dd56c){return _0x3dd56c['update'](_0x2033a5)[_0x7665('0x22')](function(_0x1c0549){return _0x1c0549;});}return null;};}function removeEntity(_0x155c45,_0x468c93){return function(_0x1b3e02){if(_0x1b3e02){return _0x1b3e02['destroy']()[_0x7665('0x22')](function(){_0x155c45['status'](0xcc)[_0x7665('0x18')]();});}};}function handleEntityNotFound(_0x158062,_0x4cf4b5){return function(_0x5652dd){if(!_0x5652dd){_0x158062[_0x7665('0x17')](0x194);}return _0x5652dd;};}function handleError(_0x2b60dc,_0x4a9a25){_0x4a9a25=_0x4a9a25||0x1f4;return function(_0x2c54cc){logger[_0x7665('0x23')](_0x2c54cc[_0x7665('0x24')]);if(_0x2c54cc['name']){delete _0x2c54cc['name'];}_0x2b60dc['status'](_0x4a9a25)['send'](_0x2c54cc);};}exports[_0x7665('0x25')]=function(_0x3b22f4,_0x1129c1){var _0x5809e9={},_0xe0c30b={},_0x383d06={'count':0x0,'rows':[]};var _0x50bfa5=db['Integration'][_0x7665('0x26')];_0xe0c30b[_0x7665('0x27')]=_[_0x7665('0x28')](_0x50bfa5);var _0x23e167={'dateStart':_0x3b22f4[_0x7665('0x29')][_0x7665('0x2a')],'dateEnd':_0x3b22f4['query'][_0x7665('0x2b')]};delete _0x3b22f4['query']['dateStart'];delete _0x3b22f4[_0x7665('0x29')][_0x7665('0x2b')];_0xe0c30b[_0x7665('0x29')]=_[_0x7665('0x28')](_0x3b22f4[_0x7665('0x29')]);_0xe0c30b[_0x7665('0x2c')]=_[_0x7665('0x2d')](_0xe0c30b[_0x7665('0x27')],_0xe0c30b[_0x7665('0x29')]);_0x5809e9[_0x7665('0x2e')]=_[_0x7665('0x2d')](_0xe0c30b[_0x7665('0x27')],qs[_0x7665('0x2f')](_0x3b22f4[_0x7665('0x29')][_0x7665('0x2f')]));_0x5809e9[_0x7665('0x2e')]=_0x5809e9[_0x7665('0x2e')][_0x7665('0x30')]?_0x5809e9[_0x7665('0x2e')]:_0xe0c30b['model'];if(!_0x3b22f4[_0x7665('0x29')][_0x7665('0x31')](_0x7665('0x32'))){_0x5809e9[_0x7665('0x1c')]=qs[_0x7665('0x1c')](_0x3b22f4[_0x7665('0x29')]['limit']);_0x5809e9[_0x7665('0x1b')]=qs[_0x7665('0x1b')](_0x3b22f4[_0x7665('0x29')][_0x7665('0x1b')]);}_0x5809e9[_0x7665('0x33')]=qs['sort'](_0x3b22f4[_0x7665('0x29')]['sort']);_0x5809e9[_0x7665('0x34')]=qs['filters'](_[_0x7665('0x35')](_0x3b22f4[_0x7665('0x29')],_0xe0c30b[_0x7665('0x2c')]));if(_0x23e167[_0x7665('0x2a')]){if(_0x23e167[_0x7665('0x2b')]){_0x23e167[_0x7665('0x2b')]=moment(_0x23e167['dateEnd'])[_0x7665('0x36')](0x1,_0x7665('0x37'));}else{_0x23e167[_0x7665('0x2b')]=moment(_0x23e167[_0x7665('0x2a')])['add'](0x1,_0x7665('0x37'));}_[_0x7665('0x38')](_0x5809e9[_0x7665('0x34')],{'createdAt':{'$gte':_0x23e167[_0x7665('0x2a')],'$lte':_0x23e167[_0x7665('0x2b')]}});}if(_0x3b22f4['query'][_0x7665('0x39')]){_0x5809e9[_0x7665('0x34')]=_[_0x7665('0x38')](_0x5809e9[_0x7665('0x34')],{'$or':_[_0x7665('0x3a')](_0x50bfa5,function(_0x30d450){if(_0x30d450[_0x7665('0x3b')][_0x7665('0x3c')]!==_0x7665('0x3d')){var _0x46ddcd={};_0x46ddcd[_0x30d450['field']]={'$like':'%'+_0x3b22f4['query'][_0x7665('0x39')]+'%'};return _0x46ddcd;}})});}_0x5809e9=_[_0x7665('0x38')]({},_0x5809e9,_0x3b22f4['options']);var _0x50c49c={'where':_0x5809e9[_0x7665('0x34')]};return db[_0x7665('0x3e')]['count'](_0x50c49c)[_0x7665('0x22')](function(_0x2753c7){_0x383d06[_0x7665('0x1a')]=_0x2753c7;if(_0x3b22f4[_0x7665('0x29')][_0x7665('0x3f')]){_0x5809e9[_0x7665('0x40')]=[{'all':!![]}];}return db[_0x7665('0x3e')][_0x7665('0x41')](_0x5809e9);})[_0x7665('0x22')](function(_0x30fe6b){_0x383d06[_0x7665('0x42')]=_0x30fe6b;return _0x383d06;})[_0x7665('0x22')](respondWithFilteredResult(_0x1129c1,_0x5809e9))[_0x7665('0x43')](handleError(_0x1129c1,null));};exports[_0x7665('0x44')]=function(_0x4ebda0,_0x261ce7){var _0x4c3a34={'raw':![],'where':{'id':_0x4ebda0[_0x7665('0x45')]['id']}},_0x32fc2b={};_0x32fc2b[_0x7665('0x27')]=_[_0x7665('0x28')](db[_0x7665('0x3e')]['rawAttributes']);_0x32fc2b[_0x7665('0x29')]=_[_0x7665('0x28')](_0x4ebda0['query']);_0x32fc2b[_0x7665('0x2c')]=_['intersection'](_0x32fc2b[_0x7665('0x27')],_0x32fc2b[_0x7665('0x29')]);_0x4c3a34[_0x7665('0x2e')]=_['intersection'](_0x32fc2b['model'],qs[_0x7665('0x2f')](_0x4ebda0[_0x7665('0x29')]['fields']));_0x4c3a34[_0x7665('0x2e')]=_0x4c3a34[_0x7665('0x2e')][_0x7665('0x30')]?_0x4c3a34[_0x7665('0x2e')]:_0x32fc2b[_0x7665('0x27')];if(_0x4ebda0[_0x7665('0x29')][_0x7665('0x3f')]){_0x4c3a34[_0x7665('0x40')]=[{'all':!![]}];}_0x4c3a34=_[_0x7665('0x38')]({},_0x4c3a34,_0x4ebda0[_0x7665('0x46')]);return db[_0x7665('0x3e')]['find'](_0x4c3a34)[_0x7665('0x22')](handleEntityNotFound(_0x261ce7,null))['then'](respondWithResult(_0x261ce7,null))[_0x7665('0x43')](handleError(_0x261ce7,null));};exports[_0x7665('0x47')]=function(_0x7dc436,_0x192f8d){return db['Integration'][_0x7665('0x47')](_0x7dc436[_0x7665('0x48')],{})[_0x7665('0x22')](respondWithResult(_0x192f8d,0xc9))[_0x7665('0x43')](handleError(_0x192f8d,null));};exports[_0x7665('0x49')]=function(_0x532740,_0x322b43){if(_0x532740['body']['id']){delete _0x532740[_0x7665('0x48')]['id'];}return db[_0x7665('0x3e')]['find']({'where':{'id':_0x532740['params']['id']}})[_0x7665('0x22')](handleEntityNotFound(_0x322b43,null))[_0x7665('0x22')](saveUpdates(_0x532740[_0x7665('0x48')],null))[_0x7665('0x22')](respondWithResult(_0x322b43,null))['catch'](handleError(_0x322b43,null));};exports['destroy']=function(_0x141938,_0x567c79){return db[_0x7665('0x3e')][_0x7665('0x4a')]({'where':{'id':_0x141938[_0x7665('0x45')]['id']}})['then'](handleEntityNotFound(_0x567c79,null))[_0x7665('0x22')](removeEntity(_0x567c79,null))[_0x7665('0x43')](handleError(_0x567c79,null));};
\ No newline at end of file
index 8c2eb26..5a65412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['integrations','lodash','util','../../config/logger','api','bluebird','./integration.attributes','exports','define'];(function(_0x3cc8b0,_0x5dc0c8){var _0x427886=function(_0x18fe1b){while(--_0x18fe1b){_0x3cc8b0['push'](_0x3cc8b0['shift']());}};_0x427886(++_0x5dc0c8);}(_0x2542,0x169));var _0x2254=function(_0x3ea2c7,_0x180049){_0x3ea2c7=_0x3ea2c7-0x0;var _0xf72b5d=_0x2542[_0x3ea2c7];return _0xf72b5d;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var attributes=require(_0x2254('0x5'));module[_0x2254('0x6')]=function(_0x27f5c9,_0x456612){return _0x27f5c9[_0x2254('0x7')]('Integration',attributes,{'tableName':_0x2254('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f0e=['../../config/logger','api','moment','./integration.attributes','exports','define','lodash','util'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9f0e,0x116));var _0xe9f0=function(_0x9ec1da,_0x507d59){_0x9ec1da=_0x9ec1da-0x0;var _0x575043=_0x9f0e[_0x9ec1da];return _0x575043;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var logger=require(_0xe9f0('0x2'))(_0xe9f0('0x3'));var moment=require(_0xe9f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xe9f0('0x5'));module[_0xe9f0('0x6')]=function(_0x3c589d,_0x202d69){return _0x3c589d[_0xe9f0('0x7')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4dd454..2100ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9e9=['rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26658e,_0x1bb1a9){var _0x572802=function(_0x168565){while(--_0x168565){_0x26658e['push'](_0x26658e['shift']());}};_0x572802(++_0x1bb1a9);}(_0xd9e9,0x1b1));var _0x9d9e=function(_0x51d633,_0x1af977){_0x51d633=_0x51d633-0x0;var _0x3e75b2=_0xd9e9[_0x51d633];return _0x3e75b2;};'use strict';var _=require('lodash');var util=require(_0x9d9e('0x0'));var moment=require('moment');var BPromise=require(_0x9d9e('0x1'));var rs=require(_0x9d9e('0x2'));var fs=require('fs');var Redis=require(_0x9d9e('0x3'));var db=require(_0x9d9e('0x4'))['db'];var utils=require(_0x9d9e('0x5'));var logger=require(_0x9d9e('0x6'))(_0x9d9e('0x7'));var config=require('../../config/environment');var jayson=require(_0x9d9e('0x8'));var client=jayson[_0x9d9e('0x9')][_0x9d9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215a49,_0x24a1bd,_0x3207aa){return new BPromise(function(_0x23bd7a,_0x293742){return client[_0x9d9e('0xb')](_0x215a49,_0x3207aa)[_0x9d9e('0xc')](function(_0x3ae6cc){logger[_0x9d9e('0xd')](_0x9d9e('0xe'),_0x24a1bd,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x24a1bd,'request\x20sent',JSON[_0x9d9e('0xf')](_0x3ae6cc));if(_0x3ae6cc[_0x9d9e('0x10')]){if(_0x3ae6cc[_0x9d9e('0x10')][_0x9d9e('0x11')]===0x1f4){logger[_0x9d9e('0x10')](_0x9d9e('0xe'),_0x24a1bd,_0x3ae6cc[_0x9d9e('0x10')][_0x9d9e('0x12')]);return _0x293742(_0x3ae6cc[_0x9d9e('0x10')][_0x9d9e('0x12')]);}logger[_0x9d9e('0x10')](_0x9d9e('0xe'),_0x24a1bd,_0x3ae6cc[_0x9d9e('0x10')][_0x9d9e('0x12')]);return _0x23bd7a(_0x3ae6cc['error'][_0x9d9e('0x12')]);}else{logger['info'](_0x9d9e('0xe'),_0x24a1bd,_0x9d9e('0x13'));_0x23bd7a(_0x3ae6cc[_0x9d9e('0x14')][_0x9d9e('0x12')]);}})[_0x9d9e('0x15')](function(_0x857586){logger['error']('Integration,\x20%s,\x20%s',_0x24a1bd,_0x857586);_0x293742(_0x857586);});});}
\ No newline at end of file
+var _0x526f=['rpc','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3461df,_0x39d6d5){var _0x52b015=function(_0x588a74){while(--_0x588a74){_0x3461df['push'](_0x3461df['shift']());}};_0x52b015(++_0x39d6d5);}(_0x526f,0xc0));var _0xf526=function(_0x5a89a5,_0x101818){_0x5a89a5=_0x5a89a5-0x0;var _0x292c83=_0x526f[_0x5a89a5];return _0x292c83;};'use strict';var _=require(_0xf526('0x0'));var util=require(_0xf526('0x1'));var moment=require('moment');var BPromise=require(_0xf526('0x2'));var rs=require(_0xf526('0x3'));var fs=require('fs');var Redis=require(_0xf526('0x4'));var db=require(_0xf526('0x5'))['db'];var utils=require(_0xf526('0x6'));var logger=require(_0xf526('0x7'))(_0xf526('0x8'));var config=require('../../config/environment');var jayson=require(_0xf526('0x9'));var client=jayson[_0xf526('0xa')][_0xf526('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2348a4,_0x26bd6d,_0xc66b85){return new BPromise(function(_0x5a89a5,_0x36d6d9){return client[_0xf526('0xc')](_0x2348a4,_0xc66b85)[_0xf526('0xd')](function(_0x51b11c){logger[_0xf526('0xe')](_0xf526('0xf'),_0x26bd6d,_0xf526('0x10'));logger[_0xf526('0x11')](_0xf526('0x12'),_0x26bd6d,_0xf526('0x10'),JSON[_0xf526('0x13')](_0x51b11c));if(_0x51b11c[_0xf526('0x14')]){if(_0x51b11c[_0xf526('0x14')][_0xf526('0x15')]===0x1f4){logger[_0xf526('0x14')](_0xf526('0xf'),_0x26bd6d,_0x51b11c[_0xf526('0x14')][_0xf526('0x16')]);return _0x36d6d9(_0x51b11c[_0xf526('0x14')][_0xf526('0x16')]);}logger[_0xf526('0x14')](_0xf526('0xf'),_0x26bd6d,_0x51b11c['error'][_0xf526('0x16')]);return _0x5a89a5(_0x51b11c[_0xf526('0x14')][_0xf526('0x16')]);}else{logger[_0xf526('0xe')]('Integration,\x20%s,\x20%s',_0x26bd6d,'request\x20sent');_0x5a89a5(_0x51b11c[_0xf526('0x17')][_0xf526('0x16')]);}})[_0xf526('0x18')](function(_0x925c63){logger[_0xf526('0x14')](_0xf526('0xf'),_0x26bd6d,_0x925c63);_0x36d6d9(_0x925c63);});});}
\ No newline at end of file
index 7a028ec..1b13902 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82b0=['describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index'];(function(_0x369289,_0xb779d8){var _0x1c8ba4=function(_0x28cc27){while(--_0x28cc27){_0x369289['push'](_0x369289['shift']());}};_0x1c8ba4(++_0xb779d8);}(_0x82b0,0x81));var _0x082b=function(_0x160cd5,_0x19c58e){_0x160cd5=_0x160cd5-0x0;var _0x366763=_0x82b0[_0x160cd5];return _0x366763;};'use strict';var multer=require(_0x082b('0x0'));var util=require(_0x082b('0x1'));var path=require(_0x082b('0x2'));var timeout=require('connect-timeout');var express=require(_0x082b('0x3'));var router=express[_0x082b('0x4')]();var auth=require(_0x082b('0x5'));var interaction=require(_0x082b('0x6'));var config=require('../../config/environment');var controller=require(_0x082b('0x7'));router[_0x082b('0x8')]('/',auth[_0x082b('0x9')](),controller[_0x082b('0xa')]);router[_0x082b('0x8')]('/describe',auth[_0x082b('0x9')](),controller[_0x082b('0xb')]);router[_0x082b('0x8')](_0x082b('0xc'),auth[_0x082b('0x9')](),controller[_0x082b('0xd')]);router[_0x082b('0xe')]('/',auth[_0x082b('0x9')](),controller[_0x082b('0xf')]);router[_0x082b('0x10')](_0x082b('0xc'),auth[_0x082b('0x9')](),controller[_0x082b('0x11')]);router[_0x082b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x082b('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x8f1b=['Router','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','show','post','isAuthenticated','create','/:id','update','delete','destroy','exports','util'];(function(_0x5b2bcb,_0x4ebb1e){var _0x151bd8=function(_0xef2218){while(--_0xef2218){_0x5b2bcb['push'](_0x5b2bcb['shift']());}};_0x151bd8(++_0x4ebb1e);}(_0x8f1b,0xaf));var _0xb8f1=function(_0x23351d,_0xe8c2ae){_0x23351d=_0x23351d-0x0;var _0x396b70=_0x8f1b[_0x23351d];return _0x396b70;};'use strict';var multer=require('multer');var util=require(_0xb8f1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb8f1('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xb8f1('0x2'));var config=require(_0xb8f1('0x3'));var controller=require(_0xb8f1('0x4'));router[_0xb8f1('0x5')]('/',auth['isAuthenticated'](),controller[_0xb8f1('0x6')]);router[_0xb8f1('0x5')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb8f1('0x5')]('/:id',auth['isAuthenticated'](),controller[_0xb8f1('0x7')]);router[_0xb8f1('0x8')]('/',auth[_0xb8f1('0x9')](),controller[_0xb8f1('0xa')]);router['put'](_0xb8f1('0xb'),auth['isAuthenticated'](),controller[_0xb8f1('0xc')]);router[_0xb8f1('0xd')](_0xb8f1('0xb'),auth[_0xb8f1('0x9')](),controller[_0xb8f1('0xe')]);module[_0xb8f1('0xf')]=router;
\ No newline at end of file
index 02f860b..93c70e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e44=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENDING'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0x0e44,0x1f0));var _0x40e4=function(_0x1bbe99,_0x401abc){_0x1bbe99=_0x1bbe99-0x0;var _0x3939df=_0x0e44[_0x1bbe99];return _0x3939df;};'use strict';var Sequelize=require(_0x40e4('0x0'));module[_0x40e4('0x1')]={'integration':{'type':Sequelize[_0x40e4('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x40e4('0x2')]},'integrationId':{'type':Sequelize[_0x40e4('0x3')]},'contacts':{'type':Sequelize[_0x40e4('0x2')]},'uniqueid':{'type':Sequelize[_0x40e4('0x2')]},'calleridnum':{'type':Sequelize[_0x40e4('0x2')]},'calleridname':{'type':Sequelize[_0x40e4('0x2')]},'queue':{'type':Sequelize[_0x40e4('0x2')]},'interface':{'type':Sequelize[_0x40e4('0x2')]},'membername':{'type':Sequelize[_0x40e4('0x2')]},'agentcalledAt':{'type':Sequelize[_0x40e4('0x4')]},'agentconnectAt':{'type':Sequelize[_0x40e4('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x40e4('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x40e4('0x4')]},'talktime':{'type':Sequelize[_0x40e4('0x3')]},'agentacw':{'type':Sequelize[_0x40e4('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x40e4('0x3')]},'reason':{'type':Sequelize[_0x40e4('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x40e4('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x40e4('0x4')]},'agentdump':{'type':Sequelize[_0x40e4('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x40e4('0x2')]},'channelstate':{'type':Sequelize[_0x40e4('0x3')]},'channelstatedesc':{'type':Sequelize[_0x40e4('0x2')]},'connectedlinenum':{'type':Sequelize[_0x40e4('0x2')]},'connectedlinename':{'type':Sequelize[_0x40e4('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x40e4('0x2')]},'exten':{'type':Sequelize[_0x40e4('0x2')]},'priority':{'type':Sequelize[_0x40e4('0x2')]},'destchannel':{'type':Sequelize[_0x40e4('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x40e4('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x40e4('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x40e4('0x2')]},'destlanguage':{'type':Sequelize[_0x40e4('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x40e4('0x2')]},'destexten':{'type':Sequelize[_0x40e4('0x2')]},'destpriority':{'type':Sequelize[_0x40e4('0x2')]},'destuniqueid':{'type':Sequelize[_0x40e4('0x2')]},'messageId':{'type':Sequelize[_0x40e4('0x2')]},'inReplyTo':{'type':Sequelize[_0x40e4('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x40e4('0x2')]},'cc':{'type':Sequelize[_0x40e4('0x2')]},'attachment':{'type':Sequelize[_0x40e4('0x6')]},'html':{'type':Sequelize[_0x40e4('0x6')]},'text':{'type':Sequelize[_0x40e4('0x6')]},'status':{'type':Sequelize['ENUM']('SENT',_0x40e4('0x7'),'RECEIVED',_0x40e4('0x8'))},'url':{'type':Sequelize[_0x40e4('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x40e4('0x2')]},'projectId':{'type':Sequelize[_0x40e4('0x3')]}};
\ No newline at end of file
+var _0x0d34=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','FAILED','sequelize','exports'];(function(_0x173408,_0x4d895b){var _0x1d6da0=function(_0x3c0ec6){while(--_0x3c0ec6){_0x173408['push'](_0x173408['shift']());}};_0x1d6da0(++_0x4d895b);}(_0x0d34,0x1d4));var _0x40d3=function(_0x546dd1,_0x2e69e9){_0x546dd1=_0x546dd1-0x0;var _0x51dac5=_0x0d34[_0x546dd1];return _0x51dac5;};'use strict';var Sequelize=require(_0x40d3('0x0'));module[_0x40d3('0x1')]={'integration':{'type':Sequelize[_0x40d3('0x2')]},'eventChannel':{'type':Sequelize[_0x40d3('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x40d3('0x3')]},'contacts':{'type':Sequelize[_0x40d3('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x40d3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x40d3('0x2')]},'interface':{'type':Sequelize[_0x40d3('0x2')]},'membername':{'type':Sequelize[_0x40d3('0x2')]},'agentcalledAt':{'type':Sequelize[_0x40d3('0x4')]},'agentconnectAt':{'type':Sequelize[_0x40d3('0x4')]},'holdtime':{'type':Sequelize[_0x40d3('0x3')]},'agentcomplete':{'type':Sequelize[_0x40d3('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x40d3('0x4')]},'talktime':{'type':Sequelize[_0x40d3('0x3')]},'agentacw':{'type':Sequelize[_0x40d3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x40d3('0x3')]},'reason':{'type':Sequelize[_0x40d3('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x40d3('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x40d3('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x40d3('0x4')]},'lastevent':{'type':Sequelize[_0x40d3('0x2')]},'channel':{'type':Sequelize[_0x40d3('0x2')]},'channelstate':{'type':Sequelize[_0x40d3('0x3')]},'channelstatedesc':{'type':Sequelize[_0x40d3('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x40d3('0x2')]},'accountcode':{'type':Sequelize[_0x40d3('0x2')]},'context':{'type':Sequelize[_0x40d3('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x40d3('0x2')]},'destchannel':{'type':Sequelize[_0x40d3('0x2')]},'destchannelstate':{'type':Sequelize[_0x40d3('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x40d3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x40d3('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x40d3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x40d3('0x2')]},'destlanguage':{'type':Sequelize[_0x40d3('0x2')]},'destaccountcode':{'type':Sequelize[_0x40d3('0x2')]},'destcontext':{'type':Sequelize[_0x40d3('0x2')]},'destexten':{'type':Sequelize[_0x40d3('0x2')]},'destpriority':{'type':Sequelize[_0x40d3('0x2')]},'destuniqueid':{'type':Sequelize[_0x40d3('0x2')]},'messageId':{'type':Sequelize[_0x40d3('0x2')]},'inReplyTo':{'type':Sequelize[_0x40d3('0x2')]},'subject':{'type':Sequelize[_0x40d3('0x2')]},'from':{'type':Sequelize[_0x40d3('0x2')]},'to':{'type':Sequelize[_0x40d3('0x2')]},'cc':{'type':Sequelize[_0x40d3('0x2')]},'attachment':{'type':Sequelize[_0x40d3('0x6')]},'html':{'type':Sequelize[_0x40d3('0x6')]},'text':{'type':Sequelize[_0x40d3('0x6')]},'status':{'type':Sequelize['ENUM'](_0x40d3('0x7'),_0x40d3('0x8'),'RECEIVED',_0x40d3('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x40d3('0x2')]},'appdata':{'type':Sequelize[_0x40d3('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index a4cb5d7..47af78e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3856=['field','filter','options','IntegrationReport','include','rows','catch','params','length','includeAll','find','create','body','destroy','describe','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','index','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','add','day','merge','type','key','VIRTUAL'];(function(_0x251ce6,_0x286185){var _0x258a81=function(_0x30ce00){while(--_0x30ce00){_0x251ce6['push'](_0x251ce6['shift']());}};_0x258a81(++_0x286185);}(_0x3856,0x16d));var _0x6385=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x3856[_0x231e16];return _0x570a7c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6385('0x0'));var rimraf=require(_0x6385('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6385('0x2'));var moment=require('moment');var BPromise=require(_0x6385('0x3'));var Mustache=require(_0x6385('0x4'));var util=require('util');var path=require(_0x6385('0x5'));var sox=require(_0x6385('0x6'));var csv=require(_0x6385('0x7'));var ejs=require(_0x6385('0x8'));var fs=require('fs');var _=require(_0x6385('0x9'));var squel=require(_0x6385('0xa'));var crypto=require(_0x6385('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6385('0x7'));var querystring=require('querystring');var Papa=require(_0x6385('0xc'));var Redis=require(_0x6385('0xd'));var qs=require(_0x6385('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x6385('0xf'));var config=require('../../config/environment');var db=require(_0x6385('0x10'))['db'];function respondWithStatusCode(_0x1b8c24,_0x207589){_0x207589=_0x207589||0xcc;return function(_0x402c38){if(_0x402c38){return _0x1b8c24[_0x6385('0x11')](_0x207589);}return _0x1b8c24[_0x6385('0x12')](_0x207589)[_0x6385('0x13')]();};}function respondWithResult(_0x34ece8,_0x4c87d9){_0x4c87d9=_0x4c87d9||0xc8;return function(_0x3aed87){if(_0x3aed87){return _0x34ece8['status'](_0x4c87d9)[_0x6385('0x14')](_0x3aed87);}};}function respondWithFilteredResult(_0x2aaf3a,_0x485a33){return function(_0x10051e){if(_0x10051e){var _0x163b93=_0x10051e[_0x6385('0x15')],_0x384d9d=_0x485a33[_0x6385('0x16')],_0x1c87b8=_0x485a33[_0x6385('0x16')]+_0x485a33[_0x6385('0x17')],_0x4a3ce7;if(_0x1c87b8>=_0x163b93){_0x1c87b8=_0x163b93;_0x4a3ce7=0xc8;}else{_0x4a3ce7=0xce;}_0x2aaf3a[_0x6385('0x12')](_0x4a3ce7);return _0x2aaf3a[_0x6385('0x18')](_0x6385('0x19'),_0x384d9d+'-'+_0x1c87b8+'/'+_0x163b93)[_0x6385('0x14')](_0x10051e);}return null;};}function patchUpdates(_0xb176a3){return function(_0x4837b3){try{jsonpatch['apply'](_0x4837b3,_0xb176a3,!![]);}catch(_0x276414){return BPromise[_0x6385('0x1a')](_0x276414);}return _0x4837b3[_0x6385('0x1b')]();};}function saveUpdates(_0x4c91d8,_0x34295c){return function(_0xf44972){if(_0xf44972){return _0xf44972['update'](_0x4c91d8)[_0x6385('0x1c')](function(_0x5039e5){return _0x5039e5;});}return null;};}function removeEntity(_0x2ad574,_0x560adb){return function(_0x63c984){if(_0x63c984){return _0x63c984['destroy']()[_0x6385('0x1c')](function(){_0x2ad574['status'](0xcc)[_0x6385('0x13')]();});}};}function handleEntityNotFound(_0x13c69e,_0x1b0ad0){return function(_0x36b94f){if(!_0x36b94f){_0x13c69e[_0x6385('0x11')](0x194);}return _0x36b94f;};}function handleError(_0x167e6f,_0x3f920d){_0x3f920d=_0x3f920d||0x1f4;return function(_0x4a1d8f){logger[_0x6385('0x1d')](_0x4a1d8f[_0x6385('0x1e')]);if(_0x4a1d8f['name']){delete _0x4a1d8f[_0x6385('0x1f')];}_0x167e6f[_0x6385('0x12')](_0x3f920d)[_0x6385('0x20')](_0x4a1d8f);};}exports[_0x6385('0x21')]=function(_0x49a74c,_0x1de0db){var _0x1781eb={},_0x5e276f={},_0x3ca98d={'count':0x0,'rows':[]};var _0x12af1f=db['IntegrationReport'][_0x6385('0x22')];_0x5e276f[_0x6385('0x23')]=_[_0x6385('0x24')](_0x12af1f);var _0x365847={'dateStart':_0x49a74c['query'][_0x6385('0x25')],'dateEnd':_0x49a74c[_0x6385('0x26')][_0x6385('0x27')]};delete _0x49a74c[_0x6385('0x26')][_0x6385('0x25')];delete _0x49a74c['query'][_0x6385('0x27')];_0x5e276f[_0x6385('0x26')]=_[_0x6385('0x24')](_0x49a74c[_0x6385('0x26')]);_0x5e276f[_0x6385('0x28')]=_[_0x6385('0x29')](_0x5e276f['model'],_0x5e276f['query']);_0x1781eb['attributes']=_[_0x6385('0x29')](_0x5e276f[_0x6385('0x23')],qs[_0x6385('0x2a')](_0x49a74c['query'][_0x6385('0x2a')]));_0x1781eb['attributes']=_0x1781eb[_0x6385('0x2b')]['length']?_0x1781eb[_0x6385('0x2b')]:_0x5e276f['model'];if(!_0x49a74c[_0x6385('0x26')][_0x6385('0x2c')](_0x6385('0x2d'))){_0x1781eb[_0x6385('0x17')]=qs[_0x6385('0x17')](_0x49a74c['query'][_0x6385('0x17')]);_0x1781eb[_0x6385('0x16')]=qs[_0x6385('0x16')](_0x49a74c[_0x6385('0x26')][_0x6385('0x16')]);}_0x1781eb[_0x6385('0x2e')]=qs[_0x6385('0x2f')](_0x49a74c[_0x6385('0x26')][_0x6385('0x2f')]);_0x1781eb[_0x6385('0x30')]=qs['filters'](_['pick'](_0x49a74c[_0x6385('0x26')],_0x5e276f[_0x6385('0x28')]));if(_0x365847['dateStart']){if(_0x365847[_0x6385('0x27')]){_0x365847['dateEnd']=moment(_0x365847[_0x6385('0x27')])[_0x6385('0x31')](0x1,_0x6385('0x32'));}else{_0x365847[_0x6385('0x27')]=moment(_0x365847[_0x6385('0x25')])['add'](0x1,_0x6385('0x32'));}_[_0x6385('0x33')](_0x1781eb[_0x6385('0x30')],{'createdAt':{'$gte':_0x365847['dateStart'],'$lte':_0x365847[_0x6385('0x27')]}});}if(_0x49a74c[_0x6385('0x26')]['filter']){_0x1781eb[_0x6385('0x30')]=_['merge'](_0x1781eb[_0x6385('0x30')],{'$or':_['map'](_0x12af1f,function(_0x933d58){if(_0x933d58[_0x6385('0x34')][_0x6385('0x35')]!==_0x6385('0x36')){var _0x4106b7={};_0x4106b7[_0x933d58[_0x6385('0x37')]]={'$like':'%'+_0x49a74c['query'][_0x6385('0x38')]+'%'};return _0x4106b7;}})});}_0x1781eb=_[_0x6385('0x33')]({},_0x1781eb,_0x49a74c[_0x6385('0x39')]);var _0x3e95bb={'where':_0x1781eb[_0x6385('0x30')]};return db[_0x6385('0x3a')][_0x6385('0x15')](_0x3e95bb)[_0x6385('0x1c')](function(_0x4c1b96){_0x3ca98d[_0x6385('0x15')]=_0x4c1b96;if(_0x49a74c['query']['includeAll']){_0x1781eb[_0x6385('0x3b')]=[{'all':!![]}];}return db[_0x6385('0x3a')]['findAll'](_0x1781eb);})[_0x6385('0x1c')](function(_0x136541){_0x3ca98d[_0x6385('0x3c')]=_0x136541;return _0x3ca98d;})[_0x6385('0x1c')](respondWithFilteredResult(_0x1de0db,_0x1781eb))[_0x6385('0x3d')](handleError(_0x1de0db,null));};exports['show']=function(_0x51a405,_0x359f6c){var _0x371fd4={'raw':![],'where':{'id':_0x51a405[_0x6385('0x3e')]['id']}},_0xe3493a={};_0xe3493a[_0x6385('0x23')]=_[_0x6385('0x24')](db[_0x6385('0x3a')][_0x6385('0x22')]);_0xe3493a[_0x6385('0x26')]=_[_0x6385('0x24')](_0x51a405['query']);_0xe3493a[_0x6385('0x28')]=_[_0x6385('0x29')](_0xe3493a['model'],_0xe3493a[_0x6385('0x26')]);_0x371fd4[_0x6385('0x2b')]=_[_0x6385('0x29')](_0xe3493a[_0x6385('0x23')],qs[_0x6385('0x2a')](_0x51a405[_0x6385('0x26')][_0x6385('0x2a')]));_0x371fd4[_0x6385('0x2b')]=_0x371fd4[_0x6385('0x2b')][_0x6385('0x3f')]?_0x371fd4[_0x6385('0x2b')]:_0xe3493a[_0x6385('0x23')];if(_0x51a405[_0x6385('0x26')][_0x6385('0x40')]){_0x371fd4['include']=[{'all':!![]}];}_0x371fd4=_[_0x6385('0x33')]({},_0x371fd4,_0x51a405[_0x6385('0x39')]);return db[_0x6385('0x3a')][_0x6385('0x41')](_0x371fd4)[_0x6385('0x1c')](handleEntityNotFound(_0x359f6c,null))[_0x6385('0x1c')](respondWithResult(_0x359f6c,null))[_0x6385('0x3d')](handleError(_0x359f6c,null));};exports[_0x6385('0x42')]=function(_0x5bc515,_0x5bb2e4){return db['IntegrationReport'][_0x6385('0x42')](_0x5bc515['body'],{})['then'](respondWithResult(_0x5bb2e4,0xc9))['catch'](handleError(_0x5bb2e4,null));};exports['update']=function(_0x47e200,_0x54872a){if(_0x47e200[_0x6385('0x43')]['id']){delete _0x47e200[_0x6385('0x43')]['id'];}return db[_0x6385('0x3a')][_0x6385('0x41')]({'where':{'id':_0x47e200[_0x6385('0x3e')]['id']}})[_0x6385('0x1c')](handleEntityNotFound(_0x54872a,null))[_0x6385('0x1c')](saveUpdates(_0x47e200[_0x6385('0x43')],null))[_0x6385('0x1c')](respondWithResult(_0x54872a,null))['catch'](handleError(_0x54872a,null));};exports[_0x6385('0x44')]=function(_0x13f2ae,_0x13d437){return db[_0x6385('0x3a')][_0x6385('0x41')]({'where':{'id':_0x13f2ae[_0x6385('0x3e')]['id']}})[_0x6385('0x1c')](handleEntityNotFound(_0x13d437,null))[_0x6385('0x1c')](removeEntity(_0x13d437,null))[_0x6385('0x3d')](handleError(_0x13d437,null));};exports[_0x6385('0x45')]=function(_0x2c9980,_0x1ceeba){return db[_0x6385('0x3a')][_0x6385('0x45')]()[_0x6385('0x1c')](respondWithResult(_0x1ceeba,null))['catch'](handleError(_0x1ceeba,null));};
\ No newline at end of file
+var _0x45c8=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','where','add','day','filter','merge','type','key','VIRTUAL','field','IntegrationReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','squel','crypto','desk.js','ioredis'];(function(_0x4b5039,_0x23b033){var _0x597f29=function(_0x34465e){while(--_0x34465e){_0x4b5039['push'](_0x4b5039['shift']());}};_0x597f29(++_0x23b033);}(_0x45c8,0x8b));var _0x845c=function(_0x188959,_0x65142d){_0x188959=_0x188959-0x0;var _0x314f26=_0x45c8[_0x188959];return _0x314f26;};'use strict';var pdf=require(_0x845c('0x0'));var emlformat=require(_0x845c('0x1'));var rimraf=require(_0x845c('0x2'));var zipdir=require(_0x845c('0x3'));var jsonpatch=require(_0x845c('0x4'));var rp=require(_0x845c('0x5'));var moment=require(_0x845c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x845c('0x7'));var util=require('util');var path=require(_0x845c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x845c('0x9'));var fs=require('fs');var _=require(_0x845c('0xa'));var squel=require(_0x845c('0xb'));var crypto=require(_0x845c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x845c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x845c('0xe'));var qs=require(_0x845c('0xf'));var logger=require(_0x845c('0x10'))(_0x845c('0x11'));var utils=require(_0x845c('0x12'));var config=require(_0x845c('0x13'));var db=require(_0x845c('0x14'))['db'];function respondWithStatusCode(_0x576e49,_0x299094){_0x299094=_0x299094||0xcc;return function(_0x550c04){if(_0x550c04){return _0x576e49[_0x845c('0x15')](_0x299094);}return _0x576e49[_0x845c('0x16')](_0x299094)['end']();};}function respondWithResult(_0xe6c4f8,_0x5f2f9d){_0x5f2f9d=_0x5f2f9d||0xc8;return function(_0x278ed6){if(_0x278ed6){return _0xe6c4f8[_0x845c('0x16')](_0x5f2f9d)['json'](_0x278ed6);}};}function respondWithFilteredResult(_0x671c7f,_0x44867b){return function(_0x2677b1){if(_0x2677b1){var _0x500af4=_0x2677b1[_0x845c('0x17')],_0x49122b=_0x44867b['offset'],_0x3566fa=_0x44867b['offset']+_0x44867b[_0x845c('0x18')],_0x2c6321;if(_0x3566fa>=_0x500af4){_0x3566fa=_0x500af4;_0x2c6321=0xc8;}else{_0x2c6321=0xce;}_0x671c7f[_0x845c('0x16')](_0x2c6321);return _0x671c7f[_0x845c('0x19')](_0x845c('0x1a'),_0x49122b+'-'+_0x3566fa+'/'+_0x500af4)[_0x845c('0x1b')](_0x2677b1);}return null;};}function patchUpdates(_0x5b7643){return function(_0x492302){try{jsonpatch[_0x845c('0x1c')](_0x492302,_0x5b7643,!![]);}catch(_0x35d06b){return BPromise[_0x845c('0x1d')](_0x35d06b);}return _0x492302[_0x845c('0x1e')]();};}function saveUpdates(_0x4f4e63,_0x4b2f9a){return function(_0x33b9e3){if(_0x33b9e3){return _0x33b9e3[_0x845c('0x1f')](_0x4f4e63)[_0x845c('0x20')](function(_0x3591a4){return _0x3591a4;});}return null;};}function removeEntity(_0x5066f4,_0xeab85f){return function(_0x18ca7f){if(_0x18ca7f){return _0x18ca7f[_0x845c('0x21')]()[_0x845c('0x20')](function(){_0x5066f4[_0x845c('0x16')](0xcc)[_0x845c('0x22')]();});}};}function handleEntityNotFound(_0x4823fa,_0xd5e972){return function(_0x2e71f9){if(!_0x2e71f9){_0x4823fa['sendStatus'](0x194);}return _0x2e71f9;};}function handleError(_0x2b84dd,_0x144451){_0x144451=_0x144451||0x1f4;return function(_0x382d18){logger[_0x845c('0x23')](_0x382d18[_0x845c('0x24')]);if(_0x382d18[_0x845c('0x25')]){delete _0x382d18[_0x845c('0x25')];}_0x2b84dd['status'](_0x144451)[_0x845c('0x26')](_0x382d18);};}exports[_0x845c('0x27')]=function(_0x333296,_0x21cfa2){var _0x5955aa={},_0x399053={},_0x39d14e={'count':0x0,'rows':[]};var _0x4600ff=db['IntegrationReport']['rawAttributes'];_0x399053[_0x845c('0x28')]=_[_0x845c('0x29')](_0x4600ff);var _0x50dee0={'dateStart':_0x333296[_0x845c('0x2a')][_0x845c('0x2b')],'dateEnd':_0x333296[_0x845c('0x2a')][_0x845c('0x2c')]};delete _0x333296[_0x845c('0x2a')][_0x845c('0x2b')];delete _0x333296[_0x845c('0x2a')]['dateEnd'];_0x399053[_0x845c('0x2a')]=_[_0x845c('0x29')](_0x333296[_0x845c('0x2a')]);_0x399053[_0x845c('0x2d')]=_[_0x845c('0x2e')](_0x399053['model'],_0x399053[_0x845c('0x2a')]);_0x5955aa[_0x845c('0x2f')]=_[_0x845c('0x2e')](_0x399053[_0x845c('0x28')],qs[_0x845c('0x30')](_0x333296[_0x845c('0x2a')]['fields']));_0x5955aa[_0x845c('0x2f')]=_0x5955aa[_0x845c('0x2f')][_0x845c('0x31')]?_0x5955aa[_0x845c('0x2f')]:_0x399053[_0x845c('0x28')];if(!_0x333296[_0x845c('0x2a')][_0x845c('0x32')](_0x845c('0x33'))){_0x5955aa[_0x845c('0x18')]=qs['limit'](_0x333296[_0x845c('0x2a')][_0x845c('0x18')]);_0x5955aa[_0x845c('0x34')]=qs[_0x845c('0x34')](_0x333296[_0x845c('0x2a')][_0x845c('0x34')]);}_0x5955aa[_0x845c('0x35')]=qs['sort'](_0x333296[_0x845c('0x2a')]['sort']);_0x5955aa[_0x845c('0x36')]=qs['filters'](_['pick'](_0x333296[_0x845c('0x2a')],_0x399053[_0x845c('0x2d')]));if(_0x50dee0[_0x845c('0x2b')]){if(_0x50dee0['dateEnd']){_0x50dee0[_0x845c('0x2c')]=moment(_0x50dee0[_0x845c('0x2c')])[_0x845c('0x37')](0x1,_0x845c('0x38'));}else{_0x50dee0['dateEnd']=moment(_0x50dee0[_0x845c('0x2b')])[_0x845c('0x37')](0x1,_0x845c('0x38'));}_['merge'](_0x5955aa[_0x845c('0x36')],{'createdAt':{'$gte':_0x50dee0[_0x845c('0x2b')],'$lte':_0x50dee0['dateEnd']}});}if(_0x333296[_0x845c('0x2a')][_0x845c('0x39')]){_0x5955aa[_0x845c('0x36')]=_[_0x845c('0x3a')](_0x5955aa[_0x845c('0x36')],{'$or':_['map'](_0x4600ff,function(_0x132316){if(_0x132316[_0x845c('0x3b')][_0x845c('0x3c')]!==_0x845c('0x3d')){var _0x5eca37={};_0x5eca37[_0x132316[_0x845c('0x3e')]]={'$like':'%'+_0x333296['query'][_0x845c('0x39')]+'%'};return _0x5eca37;}})});}_0x5955aa=_[_0x845c('0x3a')]({},_0x5955aa,_0x333296['options']);var _0x5e3261={'where':_0x5955aa[_0x845c('0x36')]};return db[_0x845c('0x3f')][_0x845c('0x17')](_0x5e3261)[_0x845c('0x20')](function(_0x225f1c){_0x39d14e[_0x845c('0x17')]=_0x225f1c;if(_0x333296[_0x845c('0x2a')]['includeAll']){_0x5955aa[_0x845c('0x40')]=[{'all':!![]}];}return db[_0x845c('0x3f')][_0x845c('0x41')](_0x5955aa);})[_0x845c('0x20')](function(_0x229c16){_0x39d14e[_0x845c('0x42')]=_0x229c16;return _0x39d14e;})['then'](respondWithFilteredResult(_0x21cfa2,_0x5955aa))[_0x845c('0x43')](handleError(_0x21cfa2,null));};exports[_0x845c('0x44')]=function(_0x19cbb7,_0x404820){var _0x17168a={'raw':![],'where':{'id':_0x19cbb7[_0x845c('0x45')]['id']}},_0x3fdbe8={};_0x3fdbe8[_0x845c('0x28')]=_[_0x845c('0x29')](db[_0x845c('0x3f')][_0x845c('0x46')]);_0x3fdbe8['query']=_[_0x845c('0x29')](_0x19cbb7['query']);_0x3fdbe8[_0x845c('0x2d')]=_[_0x845c('0x2e')](_0x3fdbe8[_0x845c('0x28')],_0x3fdbe8[_0x845c('0x2a')]);_0x17168a['attributes']=_[_0x845c('0x2e')](_0x3fdbe8[_0x845c('0x28')],qs['fields'](_0x19cbb7[_0x845c('0x2a')][_0x845c('0x30')]));_0x17168a['attributes']=_0x17168a[_0x845c('0x2f')][_0x845c('0x31')]?_0x17168a[_0x845c('0x2f')]:_0x3fdbe8[_0x845c('0x28')];if(_0x19cbb7[_0x845c('0x2a')][_0x845c('0x47')]){_0x17168a[_0x845c('0x40')]=[{'all':!![]}];}_0x17168a=_[_0x845c('0x3a')]({},_0x17168a,_0x19cbb7[_0x845c('0x48')]);return db[_0x845c('0x3f')][_0x845c('0x49')](_0x17168a)['then'](handleEntityNotFound(_0x404820,null))[_0x845c('0x20')](respondWithResult(_0x404820,null))['catch'](handleError(_0x404820,null));};exports[_0x845c('0x4a')]=function(_0x52dd6a,_0x1ae48b){return db[_0x845c('0x3f')][_0x845c('0x4a')](_0x52dd6a['body'],{})[_0x845c('0x20')](respondWithResult(_0x1ae48b,0xc9))[_0x845c('0x43')](handleError(_0x1ae48b,null));};exports['update']=function(_0x586135,_0x5efccb){if(_0x586135['body']['id']){delete _0x586135[_0x845c('0x4b')]['id'];}return db[_0x845c('0x3f')][_0x845c('0x49')]({'where':{'id':_0x586135[_0x845c('0x45')]['id']}})[_0x845c('0x20')](handleEntityNotFound(_0x5efccb,null))['then'](saveUpdates(_0x586135['body'],null))['then'](respondWithResult(_0x5efccb,null))[_0x845c('0x43')](handleError(_0x5efccb,null));};exports[_0x845c('0x21')]=function(_0x533219,_0x2371c3){return db[_0x845c('0x3f')]['find']({'where':{'id':_0x533219[_0x845c('0x45')]['id']}})[_0x845c('0x20')](handleEntityNotFound(_0x2371c3,null))[_0x845c('0x20')](removeEntity(_0x2371c3,null))[_0x845c('0x43')](handleError(_0x2371c3,null));};exports[_0x845c('0x4c')]=function(_0x112b69,_0x36687e){return db[_0x845c('0x3f')]['describe']()[_0x845c('0x20')](respondWithResult(_0x36687e,null))[_0x845c('0x43')](handleError(_0x36687e,null));};
\ No newline at end of file
index d7e579b..8ccd41d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c7b=['define','IntegrationReport','report_integration','lodash','moment','request-promise','./integrationReport.attributes','exports'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x1ae152,_0x21f035){_0x1ae152=_0x1ae152-0x0;var _0x265ede=_0x6c7b[_0x1ae152];return _0x265ede;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6c7('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6c7('0x2'));var attributes=require(_0xb6c7('0x3'));module[_0xb6c7('0x4')]=function(_0x5857e0,_0x294dc9){return _0x5857e0[_0xb6c7('0x5')](_0xb6c7('0x6'),attributes,{'tableName':_0xb6c7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x24ca=['exports','define','IntegrationReport','report_integration','lodash','../../config/logger','api','moment','request-promise','./integrationReport.attributes'];(function(_0x37d698,_0x1ae42d){var _0x5e9f62=function(_0x32a1a0){while(--_0x32a1a0){_0x37d698['push'](_0x37d698['shift']());}};_0x5e9f62(++_0x1ae42d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x24ca[_0x531d15];return _0x271a18;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var attributes=require(_0xa24c('0x5'));module[_0xa24c('0x6')]=function(_0x28aa2f,_0xe76a30){return _0x28aa2f[_0xa24c('0x7')](_0xa24c('0x8'),attributes,{'tableName':_0xa24c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 48e6394..a0f68be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1329=['then','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x1329,0x199));var _0x9132=function(_0xac79e4,_0x5772ab){_0xac79e4=_0xac79e4-0x0;var _0xf98867=_0x1329[_0xac79e4];return _0xf98867;};'use strict';var _=require(_0x9132('0x0'));var util=require(_0x9132('0x1'));var moment=require(_0x9132('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9132('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9132('0x4'));var logger=require(_0x9132('0x5'))(_0x9132('0x6'));var config=require(_0x9132('0x7'));var jayson=require(_0x9132('0x8'));var client=jayson['client'][_0x9132('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46e1ac,_0x3e6659,_0x5b24b4){return new BPromise(function(_0x4873d2,_0x3ceac0){return client[_0x9132('0xa')](_0x46e1ac,_0x5b24b4)[_0x9132('0xb')](function(_0x208f21){logger['info'](_0x9132('0xc'),_0x3e6659,'request\x20sent');logger['debug'](_0x9132('0xd'),_0x3e6659,_0x9132('0xe'),JSON[_0x9132('0xf')](_0x208f21));if(_0x208f21[_0x9132('0x10')]){if(_0x208f21[_0x9132('0x10')][_0x9132('0x11')]===0x1f4){logger[_0x9132('0x10')](_0x9132('0xc'),_0x3e6659,_0x208f21['error']['message']);return _0x3ceac0(_0x208f21[_0x9132('0x10')][_0x9132('0x12')]);}logger[_0x9132('0x10')](_0x9132('0xc'),_0x3e6659,_0x208f21[_0x9132('0x10')]['message']);return _0x4873d2(_0x208f21[_0x9132('0x10')]['message']);}else{logger[_0x9132('0x13')](_0x9132('0xc'),_0x3e6659,'request\x20sent');_0x4873d2(_0x208f21['result']['message']);}})[_0x9132('0x14')](function(_0x4aa33d){logger[_0x9132('0x10')](_0x9132('0xc'),_0x3e6659,_0x4aa33d);_0x3ceac0(_0x4aa33d);});});}
\ No newline at end of file
+var _0x99f3=['IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x99f3,0xe8));var _0x399f=function(_0x135a1c,_0x28b5f6){_0x135a1c=_0x135a1c-0x0;var _0x295c98=_0x99f3[_0x135a1c];return _0x295c98;};'use strict';var _=require(_0x399f('0x0'));var util=require(_0x399f('0x1'));var moment=require(_0x399f('0x2'));var BPromise=require(_0x399f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x399f('0x4'));var db=require(_0x399f('0x5'))['db'];var utils=require(_0x399f('0x6'));var logger=require(_0x399f('0x7'))(_0x399f('0x8'));var config=require(_0x399f('0x9'));var jayson=require(_0x399f('0xa'));var client=jayson[_0x399f('0xb')][_0x399f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a3d81,_0x286cac,_0x348bda){return new BPromise(function(_0x35e13a,_0x4a0b63){return client[_0x399f('0xd')](_0x3a3d81,_0x348bda)[_0x399f('0xe')](function(_0x5d5de8){logger[_0x399f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x286cac,_0x399f('0x10'));logger[_0x399f('0x11')](_0x399f('0x12'),_0x286cac,_0x399f('0x10'),JSON['stringify'](_0x5d5de8));if(_0x5d5de8[_0x399f('0x13')]){if(_0x5d5de8['error'][_0x399f('0x14')]===0x1f4){logger[_0x399f('0x13')](_0x399f('0x15'),_0x286cac,_0x5d5de8['error'][_0x399f('0x16')]);return _0x4a0b63(_0x5d5de8[_0x399f('0x13')][_0x399f('0x16')]);}logger[_0x399f('0x13')](_0x399f('0x15'),_0x286cac,_0x5d5de8['error'][_0x399f('0x16')]);return _0x35e13a(_0x5d5de8[_0x399f('0x13')]['message']);}else{logger[_0x399f('0xf')](_0x399f('0x15'),_0x286cac,_0x399f('0x10'));_0x35e13a(_0x5d5de8[_0x399f('0x17')]['message']);}})[_0x399f('0x18')](function(_0x58a674){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x286cac,_0x58a674);_0x4a0b63(_0x58a674);});});}
\ No newline at end of file
index 25038d5..7d7390f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9a=['put','/:id','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','show','getIntervals','post','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x1277ef,_0xf002b3){var _0x5caab6=function(_0xcb84d2){while(--_0xcb84d2){_0x1277ef['push'](_0x1277ef['shift']());}};_0x5caab6(++_0xf002b3);}(_0x1c9a,0x98));var _0xa1c9=function(_0x5a85e4,_0x50f776){_0x5a85e4=_0x5a85e4-0x0;var _0x2bd827=_0x1c9a[_0x5a85e4];return _0x2bd827;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require('util');var path=require(_0xa1c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1c9('0x2'));var router=express[_0xa1c9('0x3')]();var auth=require(_0xa1c9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x5'));var controller=require(_0xa1c9('0x6'));router[_0xa1c9('0x7')]('/',auth[_0xa1c9('0x8')](),controller['index']);router[_0xa1c9('0x7')]('/:id',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x9')]);router[_0xa1c9('0x7')]('/:id/sub_intervals',auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xa')]);router[_0xa1c9('0xb')]('/',auth[_0xa1c9('0x8')](),controller['create']);router[_0xa1c9('0xb')](_0xa1c9('0xc'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xd')]);router[_0xa1c9('0xb')](_0xa1c9('0xe'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xf')]);router[_0xa1c9('0x10')](_0xa1c9('0x11'),auth['isAuthenticated'](),controller[_0xa1c9('0x12')]);router[_0xa1c9('0x13')](_0xa1c9('0x11'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xeb85=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/sub_intervals','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','util'];(function(_0x1df17c,_0x9f6eb9){var _0x4fa46f=function(_0x53596c){while(--_0x53596c){_0x1df17c['push'](_0x1df17c['shift']());}};_0x4fa46f(++_0x9f6eb9);}(_0xeb85,0x167));var _0x5eb8=function(_0x5edc76,_0x65ba69){_0x5edc76=_0x5edc76-0x0;var _0x166b4a=_0xeb85[_0x5edc76];return _0x166b4a;};'use strict';var multer=require('multer');var util=require(_0x5eb8('0x0'));var path=require(_0x5eb8('0x1'));var timeout=require(_0x5eb8('0x2'));var express=require(_0x5eb8('0x3'));var router=express[_0x5eb8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5eb8('0x5'));var config=require(_0x5eb8('0x6'));var controller=require('./interval.controller');router[_0x5eb8('0x7')]('/',auth[_0x5eb8('0x8')](),controller['index']);router[_0x5eb8('0x7')](_0x5eb8('0x9'),auth[_0x5eb8('0x8')](),controller['show']);router[_0x5eb8('0x7')](_0x5eb8('0xa'),auth[_0x5eb8('0x8')](),controller[_0x5eb8('0xb')]);router[_0x5eb8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/sub_intervals',auth[_0x5eb8('0x8')](),controller[_0x5eb8('0xd')]);router[_0x5eb8('0xc')](_0x5eb8('0xe'),auth['isAuthenticated'](),controller[_0x5eb8('0xf')]);router[_0x5eb8('0x10')](_0x5eb8('0x9'),auth[_0x5eb8('0x8')](),controller['update']);router[_0x5eb8('0x11')]('/:id',auth[_0x5eb8('0x8')](),controller[_0x5eb8('0x12')]);module[_0x5eb8('0x13')]=router;
\ No newline at end of file
index 4fb9210..1a40985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eea=['exports','STRING'];(function(_0x58366c,_0x184b3a){var _0x24c709=function(_0x5e6fb6){while(--_0x5e6fb6){_0x58366c['push'](_0x58366c['shift']());}};_0x24c709(++_0x184b3a);}(_0x0eea,0xdc));var _0xa0ee=function(_0x3819ed,_0x199c96){_0x3819ed=_0x3819ed-0x0;var _0x58eb98=_0x0eea[_0x3819ed];return _0x58eb98;};'use strict';var Sequelize=require('sequelize');module[_0xa0ee('0x0')]={'name':{'type':Sequelize[_0xa0ee('0x1')]},'description':{'type':Sequelize[_0xa0ee('0x1')]},'interval':{'type':Sequelize[_0xa0ee('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x4cd7=['exports','STRING'];(function(_0xeb49e8,_0x23c3a3){var _0x393116=function(_0x5b1b22){while(--_0x5b1b22){_0xeb49e8['push'](_0xeb49e8['shift']());}};_0x393116(++_0x23c3a3);}(_0x4cd7,0x1de));var _0x74cd=function(_0xc0de7b,_0x4aa490){_0xc0de7b=_0xc0de7b-0x0;var _0x469d74=_0x4cd7[_0xc0de7b];return _0x469d74;};'use strict';var Sequelize=require('sequelize');module[_0x74cd('0x0')]={'name':{'type':Sequelize[_0x74cd('0x1')]},'description':{'type':Sequelize[_0x74cd('0x1')]},'interval':{'type':Sequelize[_0x74cd('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 05e2f4c..fcb3a45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab2=['day','merge','filter','map','type','key','VIRTUAL','field','rows','catch','show','params','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','nolimit','sequelize','bulkCreate','findAll','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/extensions/rewrite','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','Intervals','UserProfileResource','destroy','sendStatus','stack','name','index','Interval','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','add'];(function(_0x5bd571,_0x484d47){var _0x93b12a=function(_0x2846ea){while(--_0x2846ea){_0x5bd571['push'](_0x5bd571['shift']());}};_0x93b12a(++_0x484d47);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2dab('0x0'));var emlformat=require(_0x2dab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2dab('0x2'));var jsonpatch=require(_0x2dab('0x3'));var rp=require(_0x2dab('0x4'));var moment=require(_0x2dab('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2dab('0x6'));var util=require(_0x2dab('0x7'));var path=require(_0x2dab('0x8'));var sox=require(_0x2dab('0x9'));var csv=require(_0x2dab('0xa'));var ejs=require(_0x2dab('0xb'));var fs=require('fs');var _=require(_0x2dab('0xc'));var squel=require(_0x2dab('0xd'));var crypto=require(_0x2dab('0xe'));var jsforce=require(_0x2dab('0xf'));var deskjs=require(_0x2dab('0x10'));var toCsv=require(_0x2dab('0xa'));var querystring=require(_0x2dab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0x2dab('0x12'));var logger=require(_0x2dab('0x13'))(_0x2dab('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2dab('0x15'))['db'];var extensions=require(_0x2dab('0x16'));function respondWithStatusCode(_0x2c4560,_0x1e6b24){_0x1e6b24=_0x1e6b24||0xcc;return function(_0x268d4b){if(_0x268d4b){return _0x2c4560['sendStatus'](_0x1e6b24);}return _0x2c4560[_0x2dab('0x17')](_0x1e6b24)[_0x2dab('0x18')]();};}function respondWithResult(_0x4b47e1,_0x11a7f5){_0x11a7f5=_0x11a7f5||0xc8;return function(_0x1bd1d2){if(_0x1bd1d2){return _0x4b47e1[_0x2dab('0x17')](_0x11a7f5)['json'](_0x1bd1d2);}};}function respondWithFilteredResult(_0x4040d8,_0x149867){return function(_0x50b496){if(_0x50b496){var _0x3c00b1=_0x50b496[_0x2dab('0x19')],_0x15a9e7=_0x149867['offset'],_0x3e8613=_0x149867[_0x2dab('0x1a')]+_0x149867[_0x2dab('0x1b')],_0x2f64c8;if(_0x3e8613>=_0x3c00b1){_0x3e8613=_0x3c00b1;_0x2f64c8=0xc8;}else{_0x2f64c8=0xce;}_0x4040d8[_0x2dab('0x17')](_0x2f64c8);return _0x4040d8[_0x2dab('0x1c')](_0x2dab('0x1d'),_0x15a9e7+'-'+_0x3e8613+'/'+_0x3c00b1)[_0x2dab('0x1e')](_0x50b496);}return null;};}function patchUpdates(_0x4ff9be){return function(_0x9436f0){try{jsonpatch[_0x2dab('0x1f')](_0x9436f0,_0x4ff9be,!![]);}catch(_0x2ad762){return BPromise['reject'](_0x2ad762);}return _0x9436f0[_0x2dab('0x20')]();};}function saveUpdates(_0x46de22,_0x3acee3){return function(_0x5b45b9){if(_0x5b45b9){return _0x5b45b9[_0x2dab('0x21')](_0x46de22)[_0x2dab('0x22')](function(_0x114697){return _0x114697;});}return null;};}function removeEntity(_0x37a4c0,_0x2225dd){return function(_0x1987c2){if(_0x1987c2){return _0x1987c2['destroy']()[_0x2dab('0x22')](function(){var _0x321469=_0x1987c2['get']({'plain':!![]});var _0x2d1032=_0x2dab('0x23');return db[_0x2dab('0x24')][_0x2dab('0x25')]({'where':{'type':_0x2d1032,'resourceId':_0x321469['id']}})[_0x2dab('0x22')](function(){return _0x1987c2;});})[_0x2dab('0x22')](function(){_0x37a4c0[_0x2dab('0x17')](0xcc)[_0x2dab('0x18')]();});}};}function handleEntityNotFound(_0xb01e46,_0x1b1c5b){return function(_0x50153d){if(!_0x50153d){_0xb01e46[_0x2dab('0x26')](0x194);}return _0x50153d;};}function handleError(_0x485443,_0xbe611){_0xbe611=_0xbe611||0x1f4;return function(_0x11454f){logger['error'](_0x11454f[_0x2dab('0x27')]);if(_0x11454f[_0x2dab('0x28')]){delete _0x11454f[_0x2dab('0x28')];}_0x485443[_0x2dab('0x17')](_0xbe611)['send'](_0x11454f);};}exports[_0x2dab('0x29')]=function(_0x26d6d2,_0xa93e){var _0x2b15c0={},_0x31cde1={},_0x577a09={'count':0x0,'rows':[]};var _0x39a899=db[_0x2dab('0x2a')][_0x2dab('0x2b')];_0x31cde1[_0x2dab('0x2c')]=_[_0x2dab('0x2d')](_0x39a899);var _0x11582d={'dateStart':_0x26d6d2[_0x2dab('0x2e')][_0x2dab('0x2f')],'dateEnd':_0x26d6d2[_0x2dab('0x2e')]['dateEnd']};delete _0x26d6d2['query']['dateStart'];delete _0x26d6d2[_0x2dab('0x2e')][_0x2dab('0x30')];_0x31cde1[_0x2dab('0x2e')]=_[_0x2dab('0x2d')](_0x26d6d2[_0x2dab('0x2e')]);_0x31cde1['filters']=_[_0x2dab('0x31')](_0x31cde1['model'],_0x31cde1['query']);_0x2b15c0['attributes']=_[_0x2dab('0x31')](_0x31cde1[_0x2dab('0x2c')],qs['fields'](_0x26d6d2['query'][_0x2dab('0x32')]));_0x2b15c0[_0x2dab('0x33')]=_0x2b15c0[_0x2dab('0x33')][_0x2dab('0x34')]?_0x2b15c0[_0x2dab('0x33')]:_0x31cde1[_0x2dab('0x2c')];if(!_0x26d6d2['query'][_0x2dab('0x35')]('nolimit')){_0x2b15c0[_0x2dab('0x1b')]=qs[_0x2dab('0x1b')](_0x26d6d2[_0x2dab('0x2e')][_0x2dab('0x1b')]);_0x2b15c0[_0x2dab('0x1a')]=qs[_0x2dab('0x1a')](_0x26d6d2['query']['offset']);}_0x2b15c0[_0x2dab('0x36')]=qs[_0x2dab('0x37')](_0x26d6d2[_0x2dab('0x2e')][_0x2dab('0x37')]);_0x2b15c0[_0x2dab('0x38')]=qs['filters'](_[_0x2dab('0x39')](_0x26d6d2[_0x2dab('0x2e')],_0x31cde1[_0x2dab('0x3a')]));if(_0x11582d[_0x2dab('0x2f')]){if(_0x11582d[_0x2dab('0x30')]){_0x11582d[_0x2dab('0x30')]=moment(_0x11582d[_0x2dab('0x30')])[_0x2dab('0x3b')](0x1,_0x2dab('0x3c'));}else{_0x11582d[_0x2dab('0x30')]=moment(_0x11582d[_0x2dab('0x2f')])[_0x2dab('0x3b')](0x1,'day');}_[_0x2dab('0x3d')](_0x2b15c0['where'],{'createdAt':{'$gte':_0x11582d[_0x2dab('0x2f')],'$lte':_0x11582d['dateEnd']}});}if(_0x26d6d2['query'][_0x2dab('0x3e')]){_0x2b15c0[_0x2dab('0x38')]=_[_0x2dab('0x3d')](_0x2b15c0['where'],{'$or':_[_0x2dab('0x3f')](_0x39a899,function(_0x19c521){if(_0x19c521[_0x2dab('0x40')][_0x2dab('0x41')]!==_0x2dab('0x42')){var _0x2be2f4={};_0x2be2f4[_0x19c521[_0x2dab('0x43')]]={'$like':'%'+_0x26d6d2[_0x2dab('0x2e')][_0x2dab('0x3e')]+'%'};return _0x2be2f4;}})});}_0x2b15c0=_[_0x2dab('0x3d')]({},_0x2b15c0,_0x26d6d2['options']);var _0x1b6c87={'where':_0x2b15c0['where']};return db['Interval'][_0x2dab('0x19')](_0x1b6c87)[_0x2dab('0x22')](function(_0xd53d79){_0x577a09['count']=_0xd53d79;if(_0x26d6d2['query']['includeAll']){_0x2b15c0['include']=[{'all':!![]}];}return db[_0x2dab('0x2a')]['findAll'](_0x2b15c0);})[_0x2dab('0x22')](function(_0x371545){_0x577a09[_0x2dab('0x44')]=_0x371545;return _0x577a09;})[_0x2dab('0x22')](respondWithFilteredResult(_0xa93e,_0x2b15c0))[_0x2dab('0x45')](handleError(_0xa93e,null));};exports[_0x2dab('0x46')]=function(_0x531bbc,_0x2e22fa){var _0x139438={'raw':!![],'where':{'id':_0x531bbc[_0x2dab('0x47')]['id']}},_0x590439={};_0x590439[_0x2dab('0x2c')]=_['keys'](db['Interval'][_0x2dab('0x2b')]);_0x590439[_0x2dab('0x2e')]=_[_0x2dab('0x2d')](_0x531bbc[_0x2dab('0x2e')]);_0x590439['filters']=_[_0x2dab('0x31')](_0x590439[_0x2dab('0x2c')],_0x590439['query']);_0x139438[_0x2dab('0x33')]=_[_0x2dab('0x31')](_0x590439[_0x2dab('0x2c')],qs[_0x2dab('0x32')](_0x531bbc[_0x2dab('0x2e')][_0x2dab('0x32')]));_0x139438[_0x2dab('0x33')]=_0x139438[_0x2dab('0x33')][_0x2dab('0x34')]?_0x139438['attributes']:_0x590439['model'];if(_0x531bbc['query']['includeAll']){_0x139438['include']=[{'all':!![]}];}_0x139438=_[_0x2dab('0x3d')]({},_0x139438,_0x531bbc[_0x2dab('0x48')]);return db[_0x2dab('0x2a')]['find'](_0x139438)[_0x2dab('0x22')](handleEntityNotFound(_0x2e22fa,null))[_0x2dab('0x22')](respondWithResult(_0x2e22fa,null))[_0x2dab('0x45')](handleError(_0x2e22fa,null));};exports['create']=function(_0x1740fc,_0x5bee18){return db[_0x2dab('0x2a')][_0x2dab('0x49')](_0x1740fc[_0x2dab('0x4a')],{})[_0x2dab('0x22')](function(_0x251cd6){var _0x5cec3f=_0x1740fc[_0x2dab('0x4b')][_0x2dab('0x4c')]({'plain':!![]});if(!_0x5cec3f)throw new Error(_0x2dab('0x4d'));if(_0x5cec3f['role']==='user'){var _0x580a33=_0x251cd6[_0x2dab('0x4c')]({'plain':!![]});var _0x2509a7='Intervals';return db[_0x2dab('0x4e')][_0x2dab('0x4f')]({'where':{'name':_0x2509a7,'userProfileId':_0x5cec3f[_0x2dab('0x50')]},'raw':!![]})['then'](function(_0x271c24){if(_0x271c24&&_0x271c24[_0x2dab('0x51')]===0x0){return db[_0x2dab('0x24')][_0x2dab('0x49')]({'name':_0x580a33[_0x2dab('0x28')],'resourceId':_0x580a33['id'],'type':_0x271c24[_0x2dab('0x28')],'sectionId':_0x271c24['id']},{})['then'](function(){return _0x251cd6;});}else{return _0x251cd6;}})[_0x2dab('0x45')](function(_0x486fb7){logger[_0x2dab('0x52')](_0x2dab('0x53'),_0x486fb7);throw _0x486fb7;});}return _0x251cd6;})['then'](respondWithResult(_0x5bee18,0xc9))[_0x2dab('0x45')](handleError(_0x5bee18,null));};exports[_0x2dab('0x21')]=function(_0x3e049f,_0x3713bf){if(_0x3e049f[_0x2dab('0x4a')]['id']){delete _0x3e049f[_0x2dab('0x4a')]['id'];}return db['Interval']['find']({'where':{'id':_0x3e049f[_0x2dab('0x47')]['id']}})[_0x2dab('0x22')](handleEntityNotFound(_0x3713bf,null))[_0x2dab('0x22')](saveUpdates(_0x3e049f[_0x2dab('0x4a')],null))[_0x2dab('0x22')](respondWithResult(_0x3713bf,null))['catch'](handleError(_0x3713bf,null));};exports['destroy']=function(_0x1e3e0c,_0x4ef191){return db[_0x2dab('0x2a')]['find']({'where':{'id':_0x1e3e0c[_0x2dab('0x47')]['id']}})[_0x2dab('0x22')](handleEntityNotFound(_0x4ef191,null))[_0x2dab('0x22')](removeEntity(_0x4ef191,null))[_0x2dab('0x45')](handleError(_0x4ef191,null));};exports['addInterval']=function(_0x289087,_0x3ebec5,_0x4fcb75){if(_0x289087[_0x2dab('0x4a')]['id']){delete _0x289087[_0x2dab('0x4a')]['id'];}return db['Interval'][_0x2dab('0x4f')]({'where':{'id':_0x289087['params']['id']}})[_0x2dab('0x22')](handleEntityNotFound(_0x3ebec5,null))[_0x2dab('0x22')](function(_0x22b618){if(_0x22b618){_0x289087[_0x2dab('0x4a')][_0x2dab('0x54')]=_0x22b618['id'];return db[_0x2dab('0x2a')][_0x2dab('0x49')](_0x289087[_0x2dab('0x4a')]);}})[_0x2dab('0x22')](respondWithResult(_0x3ebec5,null))[_0x2dab('0x45')](handleError(_0x3ebec5,null));};exports[_0x2dab('0x55')]=function(_0x4bad64,_0x47ad1a,_0x4eed66){var _0x3d09d8={};var _0x28605f={};var _0x38b0e3;var _0x2ac43b;return db[_0x2dab('0x2a')][_0x2dab('0x56')]({'where':{'id':_0x4bad64[_0x2dab('0x47')]['id']}})[_0x2dab('0x22')](handleEntityNotFound(_0x47ad1a,null))[_0x2dab('0x22')](function(_0x4bd2c8){if(_0x4bd2c8){_0x38b0e3=_0x4bd2c8;_0x28605f['model']=_['keys'](db['Interval']['rawAttributes']);_0x28605f[_0x2dab('0x2e')]=_[_0x2dab('0x2d')](_0x4bad64[_0x2dab('0x2e')]);_0x28605f[_0x2dab('0x3a')]=_['intersection'](_0x28605f[_0x2dab('0x2c')],_0x28605f['query']);_0x3d09d8[_0x2dab('0x33')]=_[_0x2dab('0x31')](_0x28605f[_0x2dab('0x2c')],qs[_0x2dab('0x32')](_0x4bad64[_0x2dab('0x2e')][_0x2dab('0x32')]));_0x3d09d8[_0x2dab('0x33')]=_0x3d09d8[_0x2dab('0x33')][_0x2dab('0x34')]?_0x3d09d8['attributes']:_0x28605f[_0x2dab('0x2c')];_0x3d09d8['order']=qs[_0x2dab('0x37')](_0x4bad64['query']['sort']);_0x3d09d8[_0x2dab('0x38')]=qs[_0x2dab('0x3a')](_[_0x2dab('0x39')](_0x4bad64[_0x2dab('0x2e')],_0x28605f[_0x2dab('0x3a')]));if(_0x4bad64[_0x2dab('0x2e')][_0x2dab('0x3e')]){_0x3d09d8[_0x2dab('0x38')]=_[_0x2dab('0x3d')](_0x3d09d8[_0x2dab('0x38')],{'$or':_[_0x2dab('0x3f')](_0x3d09d8[_0x2dab('0x33')],function(_0x40ea59){var _0xbf3a60={};_0xbf3a60[_0x40ea59]={'$like':'%'+_0x4bad64[_0x2dab('0x2e')]['filter']+'%'};return _0xbf3a60;})});}_0x3d09d8=_[_0x2dab('0x3d')]({},_0x3d09d8,_0x4bad64[_0x2dab('0x48')]);return _0x38b0e3[_0x2dab('0x55')](_0x3d09d8);}})[_0x2dab('0x22')](function(_0x1fe75a){if(_0x1fe75a){_0x2ac43b=_0x1fe75a[_0x2dab('0x34')];if(!_0x4bad64['query'][_0x2dab('0x35')](_0x2dab('0x57'))){_0x3d09d8['limit']=qs[_0x2dab('0x1b')](_0x4bad64['query'][_0x2dab('0x1b')]);_0x3d09d8[_0x2dab('0x1a')]=qs['offset'](_0x4bad64['query']['offset']);}return _0x38b0e3['getIntervals'](_0x3d09d8);}})[_0x2dab('0x22')](function(_0x1a92c0){if(_0x1a92c0){return _0x1a92c0?{'count':_0x2ac43b,'rows':_0x1a92c0}:null;}})[_0x2dab('0x22')](respondWithResult(_0x47ad1a,null))['catch'](handleError(_0x47ad1a,null));};exports['addIntervals']=function(_0x2ad42a,_0x4abb09,_0xf8aae){return db[_0x2dab('0x2a')][_0x2dab('0x56')]({'where':{'id':_0x2ad42a[_0x2dab('0x47')]['id']}})[_0x2dab('0x22')](handleEntityNotFound(_0x4abb09,null))['then'](function(_0x4606d9){if(_0x4606d9){return db[_0x2dab('0x58')]['transaction'](function(_0x36b882){return db['Interval'][_0x2dab('0x25')]({'where':{'IntervalId':_0x2ad42a[_0x2dab('0x47')]['id']},'transaction':_0x36b882})['then'](function(_0x4aa6d1){var _0x56e9d6=_[_0x2dab('0x3f')](_0x2ad42a[_0x2dab('0x4a')],function(_0x215536){delete _0x215536['id'];_0x215536[_0x2dab('0x54')]=_0x2ad42a[_0x2dab('0x47')]['id'];return _0x215536;});return db[_0x2dab('0x2a')][_0x2dab('0x59')](_0x56e9d6,{'transaction':_0x36b882});});})[_0x2dab('0x22')](function(){return db[_0x2dab('0x2a')][_0x2dab('0x5a')]({'where':{'IntervalId':_0x2ad42a['params']['id']}});});}})['then'](respondWithResult(_0x4abb09,null))[_0x2dab('0x45')](handleError(_0x4abb09,null));};
\ No newline at end of file
+var _0x4016=['reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','model','keys','dateStart','query','dateEnd','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','add','day','merge','filter','where','type','key','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','params','IntervalId','getIntervals','findOne','map','sequelize','transaction','eml-format','rimraf','moment','mustache','util','to-csv','ejs','squel','jsforce','querystring','papaparse','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply'];(function(_0x809030,_0xb9f685){var _0x137797=function(_0x55a1d6){while(--_0x55a1d6){_0x809030['push'](_0x809030['shift']());}};_0x137797(++_0xb9f685);}(_0x4016,0x131));var _0x6401=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4016[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6401('0x0'));var rimraf=require(_0x6401('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6401('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6401('0x3'));var util=require(_0x6401('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x6401('0x5'));var ejs=require(_0x6401('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6401('0x7'));var crypto=require('crypto');var jsforce=require(_0x6401('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x6401('0x5'));var querystring=require(_0x6401('0x9'));var Papa=require(_0x6401('0xa'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x6401('0xb'))(_0x6401('0xc'));var utils=require(_0x6401('0xd'));var config=require('../../config/environment');var db=require(_0x6401('0xe'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5d0027,_0x3ca7b0){_0x3ca7b0=_0x3ca7b0||0xcc;return function(_0x1faf44){if(_0x1faf44){return _0x5d0027[_0x6401('0xf')](_0x3ca7b0);}return _0x5d0027[_0x6401('0x10')](_0x3ca7b0)[_0x6401('0x11')]();};}function respondWithResult(_0x3a6071,_0x2d0fa2){_0x2d0fa2=_0x2d0fa2||0xc8;return function(_0x2a8b27){if(_0x2a8b27){return _0x3a6071[_0x6401('0x10')](_0x2d0fa2)[_0x6401('0x12')](_0x2a8b27);}};}function respondWithFilteredResult(_0x45fcea,_0x393711){return function(_0x2d4b29){if(_0x2d4b29){var _0x29fedc=_0x2d4b29[_0x6401('0x13')],_0x4c740a=_0x393711[_0x6401('0x14')],_0x1b510e=_0x393711[_0x6401('0x14')]+_0x393711[_0x6401('0x15')],_0x1fd3b8;if(_0x1b510e>=_0x29fedc){_0x1b510e=_0x29fedc;_0x1fd3b8=0xc8;}else{_0x1fd3b8=0xce;}_0x45fcea[_0x6401('0x10')](_0x1fd3b8);return _0x45fcea['set']('Content-Range',_0x4c740a+'-'+_0x1b510e+'/'+_0x29fedc)[_0x6401('0x12')](_0x2d4b29);}return null;};}function patchUpdates(_0x50eda7){return function(_0xc415e7){try{jsonpatch[_0x6401('0x16')](_0xc415e7,_0x50eda7,!![]);}catch(_0x7046f2){return BPromise[_0x6401('0x17')](_0x7046f2);}return _0xc415e7[_0x6401('0x18')]();};}function saveUpdates(_0xb8cd20,_0x79739d){return function(_0x51c167){if(_0x51c167){return _0x51c167[_0x6401('0x19')](_0xb8cd20)[_0x6401('0x1a')](function(_0x3fc8af){return _0x3fc8af;});}return null;};}function removeEntity(_0x1757ab,_0x4803ca){return function(_0x27ec8a){if(_0x27ec8a){return _0x27ec8a[_0x6401('0x1b')]()['then'](function(){var _0x20b445=_0x27ec8a[_0x6401('0x1c')]({'plain':!![]});var _0x569b7d=_0x6401('0x1d');return db[_0x6401('0x1e')][_0x6401('0x1b')]({'where':{'type':_0x569b7d,'resourceId':_0x20b445['id']}})[_0x6401('0x1a')](function(){return _0x27ec8a;});})[_0x6401('0x1a')](function(){_0x1757ab[_0x6401('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fb94,_0x55818a){return function(_0xee5737){if(!_0xee5737){_0x55fb94[_0x6401('0xf')](0x194);}return _0xee5737;};}function handleError(_0x409d11,_0x4e6d9f){_0x4e6d9f=_0x4e6d9f||0x1f4;return function(_0x3b1d99){logger[_0x6401('0x1f')](_0x3b1d99[_0x6401('0x20')]);if(_0x3b1d99[_0x6401('0x21')]){delete _0x3b1d99['name'];}_0x409d11['status'](_0x4e6d9f)[_0x6401('0x22')](_0x3b1d99);};}exports[_0x6401('0x23')]=function(_0x17a83d,_0x466a35){var _0x549b8c={},_0x7f6e88={},_0x43e089={'count':0x0,'rows':[]};var _0x13a1ea=db[_0x6401('0x24')][_0x6401('0x25')];_0x7f6e88[_0x6401('0x26')]=_[_0x6401('0x27')](_0x13a1ea);var _0x1d5624={'dateStart':_0x17a83d['query'][_0x6401('0x28')],'dateEnd':_0x17a83d[_0x6401('0x29')][_0x6401('0x2a')]};delete _0x17a83d[_0x6401('0x29')]['dateStart'];delete _0x17a83d[_0x6401('0x29')][_0x6401('0x2a')];_0x7f6e88[_0x6401('0x29')]=_['keys'](_0x17a83d['query']);_0x7f6e88[_0x6401('0x2b')]=_['intersection'](_0x7f6e88[_0x6401('0x26')],_0x7f6e88[_0x6401('0x29')]);_0x549b8c[_0x6401('0x2c')]=_[_0x6401('0x2d')](_0x7f6e88[_0x6401('0x26')],qs[_0x6401('0x2e')](_0x17a83d[_0x6401('0x29')][_0x6401('0x2e')]));_0x549b8c[_0x6401('0x2c')]=_0x549b8c['attributes'][_0x6401('0x2f')]?_0x549b8c[_0x6401('0x2c')]:_0x7f6e88[_0x6401('0x26')];if(!_0x17a83d[_0x6401('0x29')][_0x6401('0x30')]('nolimit')){_0x549b8c[_0x6401('0x15')]=qs[_0x6401('0x15')](_0x17a83d['query'][_0x6401('0x15')]);_0x549b8c['offset']=qs[_0x6401('0x14')](_0x17a83d[_0x6401('0x29')]['offset']);}_0x549b8c[_0x6401('0x31')]=qs[_0x6401('0x32')](_0x17a83d[_0x6401('0x29')][_0x6401('0x32')]);_0x549b8c['where']=qs[_0x6401('0x2b')](_[_0x6401('0x33')](_0x17a83d[_0x6401('0x29')],_0x7f6e88['filters']));if(_0x1d5624[_0x6401('0x28')]){if(_0x1d5624[_0x6401('0x2a')]){_0x1d5624['dateEnd']=moment(_0x1d5624[_0x6401('0x2a')])[_0x6401('0x34')](0x1,_0x6401('0x35'));}else{_0x1d5624[_0x6401('0x2a')]=moment(_0x1d5624[_0x6401('0x28')])[_0x6401('0x34')](0x1,_0x6401('0x35'));}_[_0x6401('0x36')](_0x549b8c['where'],{'createdAt':{'$gte':_0x1d5624[_0x6401('0x28')],'$lte':_0x1d5624[_0x6401('0x2a')]}});}if(_0x17a83d['query'][_0x6401('0x37')]){_0x549b8c[_0x6401('0x38')]=_[_0x6401('0x36')](_0x549b8c[_0x6401('0x38')],{'$or':_['map'](_0x13a1ea,function(_0x25d8aa){if(_0x25d8aa[_0x6401('0x39')][_0x6401('0x3a')]!==_0x6401('0x3b')){var _0x3d8ec5={};_0x3d8ec5[_0x25d8aa['field']]={'$like':'%'+_0x17a83d[_0x6401('0x29')][_0x6401('0x37')]+'%'};return _0x3d8ec5;}})});}_0x549b8c=_[_0x6401('0x36')]({},_0x549b8c,_0x17a83d[_0x6401('0x3c')]);var _0x531f26={'where':_0x549b8c[_0x6401('0x38')]};return db[_0x6401('0x24')][_0x6401('0x13')](_0x531f26)[_0x6401('0x1a')](function(_0x1ea17d){_0x43e089[_0x6401('0x13')]=_0x1ea17d;if(_0x17a83d[_0x6401('0x29')][_0x6401('0x3d')]){_0x549b8c[_0x6401('0x3e')]=[{'all':!![]}];}return db[_0x6401('0x24')][_0x6401('0x3f')](_0x549b8c);})['then'](function(_0x50364c){_0x43e089[_0x6401('0x40')]=_0x50364c;return _0x43e089;})[_0x6401('0x1a')](respondWithFilteredResult(_0x466a35,_0x549b8c))['catch'](handleError(_0x466a35,null));};exports[_0x6401('0x41')]=function(_0x246577,_0x22eaa4){var _0x270506={'raw':!![],'where':{'id':_0x246577['params']['id']}},_0x3ea2f1={};_0x3ea2f1[_0x6401('0x26')]=_['keys'](db[_0x6401('0x24')]['rawAttributes']);_0x3ea2f1[_0x6401('0x29')]=_[_0x6401('0x27')](_0x246577['query']);_0x3ea2f1[_0x6401('0x2b')]=_['intersection'](_0x3ea2f1['model'],_0x3ea2f1[_0x6401('0x29')]);_0x270506['attributes']=_[_0x6401('0x2d')](_0x3ea2f1[_0x6401('0x26')],qs[_0x6401('0x2e')](_0x246577[_0x6401('0x29')][_0x6401('0x2e')]));_0x270506[_0x6401('0x2c')]=_0x270506[_0x6401('0x2c')]['length']?_0x270506[_0x6401('0x2c')]:_0x3ea2f1[_0x6401('0x26')];if(_0x246577[_0x6401('0x29')][_0x6401('0x3d')]){_0x270506[_0x6401('0x3e')]=[{'all':!![]}];}_0x270506=_[_0x6401('0x36')]({},_0x270506,_0x246577[_0x6401('0x3c')]);return db[_0x6401('0x24')][_0x6401('0x42')](_0x270506)[_0x6401('0x1a')](handleEntityNotFound(_0x22eaa4,null))[_0x6401('0x1a')](respondWithResult(_0x22eaa4,null))[_0x6401('0x43')](handleError(_0x22eaa4,null));};exports[_0x6401('0x44')]=function(_0x4b055a,_0x3cb88f){return db[_0x6401('0x24')]['create'](_0x4b055a['body'],{})['then'](function(_0x508e79){var _0x2200d2=_0x4b055a['user'][_0x6401('0x1c')]({'plain':!![]});if(!_0x2200d2)throw new Error(_0x6401('0x45'));if(_0x2200d2[_0x6401('0x46')]===_0x6401('0x47')){var _0x128020=_0x508e79[_0x6401('0x1c')]({'plain':!![]});var _0x414856='Intervals';return db[_0x6401('0x48')][_0x6401('0x42')]({'where':{'name':_0x414856,'userProfileId':_0x2200d2[_0x6401('0x49')]},'raw':!![]})[_0x6401('0x1a')](function(_0x4fd45d){if(_0x4fd45d&&_0x4fd45d['autoAssociation']===0x0){return db[_0x6401('0x1e')][_0x6401('0x44')]({'name':_0x128020[_0x6401('0x21')],'resourceId':_0x128020['id'],'type':_0x4fd45d[_0x6401('0x21')],'sectionId':_0x4fd45d['id']},{})['then'](function(){return _0x508e79;});}else{return _0x508e79;}})[_0x6401('0x43')](function(_0x5058c1){logger[_0x6401('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5058c1);throw _0x5058c1;});}return _0x508e79;})[_0x6401('0x1a')](respondWithResult(_0x3cb88f,0xc9))['catch'](handleError(_0x3cb88f,null));};exports[_0x6401('0x19')]=function(_0x56085d,_0x70a774){if(_0x56085d['body']['id']){delete _0x56085d[_0x6401('0x4a')]['id'];}return db[_0x6401('0x24')][_0x6401('0x42')]({'where':{'id':_0x56085d[_0x6401('0x4b')]['id']}})[_0x6401('0x1a')](handleEntityNotFound(_0x70a774,null))[_0x6401('0x1a')](saveUpdates(_0x56085d[_0x6401('0x4a')],null))[_0x6401('0x1a')](respondWithResult(_0x70a774,null))[_0x6401('0x43')](handleError(_0x70a774,null));};exports['destroy']=function(_0x4b871d,_0x4e52d5){return db[_0x6401('0x24')][_0x6401('0x42')]({'where':{'id':_0x4b871d['params']['id']}})['then'](handleEntityNotFound(_0x4e52d5,null))[_0x6401('0x1a')](removeEntity(_0x4e52d5,null))[_0x6401('0x43')](handleError(_0x4e52d5,null));};exports['addInterval']=function(_0x291792,_0x1c075c,_0x33a0c5){if(_0x291792[_0x6401('0x4a')]['id']){delete _0x291792[_0x6401('0x4a')]['id'];}return db['Interval'][_0x6401('0x42')]({'where':{'id':_0x291792[_0x6401('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c075c,null))[_0x6401('0x1a')](function(_0x5396c6){if(_0x5396c6){_0x291792['body'][_0x6401('0x4c')]=_0x5396c6['id'];return db[_0x6401('0x24')][_0x6401('0x44')](_0x291792[_0x6401('0x4a')]);}})[_0x6401('0x1a')](respondWithResult(_0x1c075c,null))[_0x6401('0x43')](handleError(_0x1c075c,null));};exports[_0x6401('0x4d')]=function(_0x4d8a8b,_0x1a9132,_0x108e59){var _0x242542={};var _0x51c0aa={};var _0x1cd752;var _0x8fc75b;return db[_0x6401('0x24')][_0x6401('0x4e')]({'where':{'id':_0x4d8a8b[_0x6401('0x4b')]['id']}})[_0x6401('0x1a')](handleEntityNotFound(_0x1a9132,null))['then'](function(_0x54a2d1){if(_0x54a2d1){_0x1cd752=_0x54a2d1;_0x51c0aa[_0x6401('0x26')]=_[_0x6401('0x27')](db[_0x6401('0x24')][_0x6401('0x25')]);_0x51c0aa['query']=_[_0x6401('0x27')](_0x4d8a8b['query']);_0x51c0aa['filters']=_['intersection'](_0x51c0aa[_0x6401('0x26')],_0x51c0aa['query']);_0x242542[_0x6401('0x2c')]=_[_0x6401('0x2d')](_0x51c0aa[_0x6401('0x26')],qs[_0x6401('0x2e')](_0x4d8a8b['query'][_0x6401('0x2e')]));_0x242542['attributes']=_0x242542[_0x6401('0x2c')][_0x6401('0x2f')]?_0x242542[_0x6401('0x2c')]:_0x51c0aa[_0x6401('0x26')];_0x242542['order']=qs[_0x6401('0x32')](_0x4d8a8b[_0x6401('0x29')][_0x6401('0x32')]);_0x242542['where']=qs['filters'](_[_0x6401('0x33')](_0x4d8a8b['query'],_0x51c0aa[_0x6401('0x2b')]));if(_0x4d8a8b[_0x6401('0x29')][_0x6401('0x37')]){_0x242542[_0x6401('0x38')]=_[_0x6401('0x36')](_0x242542['where'],{'$or':_[_0x6401('0x4f')](_0x242542['attributes'],function(_0x3dc5c3){var _0x3dd2d4={};_0x3dd2d4[_0x3dc5c3]={'$like':'%'+_0x4d8a8b[_0x6401('0x29')]['filter']+'%'};return _0x3dd2d4;})});}_0x242542=_[_0x6401('0x36')]({},_0x242542,_0x4d8a8b[_0x6401('0x3c')]);return _0x1cd752[_0x6401('0x4d')](_0x242542);}})[_0x6401('0x1a')](function(_0x353d3b){if(_0x353d3b){_0x8fc75b=_0x353d3b[_0x6401('0x2f')];if(!_0x4d8a8b[_0x6401('0x29')][_0x6401('0x30')]('nolimit')){_0x242542['limit']=qs['limit'](_0x4d8a8b[_0x6401('0x29')][_0x6401('0x15')]);_0x242542[_0x6401('0x14')]=qs[_0x6401('0x14')](_0x4d8a8b[_0x6401('0x29')][_0x6401('0x14')]);}return _0x1cd752[_0x6401('0x4d')](_0x242542);}})[_0x6401('0x1a')](function(_0x544d4a){if(_0x544d4a){return _0x544d4a?{'count':_0x8fc75b,'rows':_0x544d4a}:null;}})[_0x6401('0x1a')](respondWithResult(_0x1a9132,null))['catch'](handleError(_0x1a9132,null));};exports['addIntervals']=function(_0x577a90,_0x43169b,_0xbfb41d){return db[_0x6401('0x24')]['findOne']({'where':{'id':_0x577a90[_0x6401('0x4b')]['id']}})[_0x6401('0x1a')](handleEntityNotFound(_0x43169b,null))[_0x6401('0x1a')](function(_0x275ccf){if(_0x275ccf){return db[_0x6401('0x50')][_0x6401('0x51')](function(_0x1740b0){return db[_0x6401('0x24')][_0x6401('0x1b')]({'where':{'IntervalId':_0x577a90[_0x6401('0x4b')]['id']},'transaction':_0x1740b0})[_0x6401('0x1a')](function(_0x369f3b){var _0x56f0b7=_[_0x6401('0x4f')](_0x577a90[_0x6401('0x4a')],function(_0x334f11){delete _0x334f11['id'];_0x334f11[_0x6401('0x4c')]=_0x577a90['params']['id'];return _0x334f11;});return db[_0x6401('0x24')]['bulkCreate'](_0x56f0b7,{'transaction':_0x1740b0});});})[_0x6401('0x1a')](function(){return db[_0x6401('0x24')]['findAll']({'where':{'IntervalId':_0x577a90[_0x6401('0x4b')]['id']}});});}})[_0x6401('0x1a')](respondWithResult(_0x43169b,null))[_0x6401('0x43')](handleError(_0x43169b,null));};
\ No newline at end of file
index e74c769..557eb7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe73f=['util','api','moment','bluebird','request-promise','./interval.attributes','tools_intervals','rewrite','lodash'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xe73f,0x8f));var _0xfe73=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe73f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfe73('0x0'));var util=require(_0xfe73('0x1'));var logger=require('../../config/logger')(_0xfe73('0x2'));var moment=require(_0xfe73('0x3'));var BPromise=require(_0xfe73('0x4'));var rp=require(_0xfe73('0x5'));var attributes=require(_0xfe73('0x6'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x17fe43,_0x35c827){return _0x17fe43['define']('Interval',attributes,{'tableName':_0xfe73('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2acd09,_0x55cd2b){extensions[_0xfe73('0x8')](_0x17fe43,_0x2acd09);},'afterBulkCreate':function(_0x31c4f9,_0x4bcff8,_0x459226){_0x459226();extensions['rewrite'](_0x17fe43,_0x31c4f9[0x0]);},'afterUpdate':function(_0x3e0e88,_0x54a071){extensions[_0xfe73('0x8')](_0x17fe43,_0x3e0e88);},'afterDestroy':function(_0x16e67e,_0x1a4a5c){extensions['rewrite'](_0x17fe43,_0x16e67e);}}});};
\ No newline at end of file
+var _0xa9a5=['./interval.attributes','../../components/extensions/rewrite','Interval','tools_intervals','rewrite','util','../../config/logger','api','moment','request-promise'];(function(_0x2df322,_0xab9588){var _0x1d5205=function(_0x1209ee){while(--_0x1209ee){_0x2df322['push'](_0x2df322['shift']());}};_0x1d5205(++_0xab9588);}(_0xa9a5,0xc3));var _0x5a9a=function(_0x496fcb,_0x379e07){_0x496fcb=_0x496fcb-0x0;var _0x5349bf=_0xa9a5[_0x496fcb];return _0x5349bf;};'use strict';var _=require('lodash');var util=require(_0x5a9a('0x0'));var logger=require(_0x5a9a('0x1'))(_0x5a9a('0x2'));var moment=require(_0x5a9a('0x3'));var BPromise=require('bluebird');var rp=require(_0x5a9a('0x4'));var attributes=require(_0x5a9a('0x5'));var extensions=require(_0x5a9a('0x6'));module['exports']=function(_0x3c1c5e,_0x3c407e){return _0x3c1c5e['define'](_0x5a9a('0x7'),attributes,{'tableName':_0x5a9a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xff7ef4,_0x3ad92a){extensions[_0x5a9a('0x9')](_0x3c1c5e,_0xff7ef4);},'afterBulkCreate':function(_0x5457b1,_0x12129c,_0x5b84ff){_0x5b84ff();extensions[_0x5a9a('0x9')](_0x3c1c5e,_0x5457b1[0x0]);},'afterUpdate':function(_0x39fe1e,_0x49c5f5){extensions['rewrite'](_0x3c1c5e,_0x39fe1e);},'afterDestroy':function(_0x22e9de,_0x51d936){extensions[_0x5a9a('0x9')](_0x3c1c5e,_0x22e9de);}}});};
\ No newline at end of file
index 5e837b0..3b418c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5292=['info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetInterval','Interval','findAll','options','where','attributes','include','map','model','then','catch','raw','ShowInterval','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request'];(function(_0x280436,_0xf4e795){var _0xc71df1=function(_0x3ca417){while(--_0x3ca417){_0x280436['push'](_0x280436['shift']());}};_0xc71df1(++_0xf4e795);}(_0x5292,0xf7));var _0x2529=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0x5292[_0x8a2dae];return _0x308f20;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var moment=require('moment');var BPromise=require(_0x2529('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2529('0x3'));var db=require(_0x2529('0x4'))['db'];var utils=require(_0x2529('0x5'));var logger=require(_0x2529('0x6'))('rpc');var config=require(_0x2529('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x407277,_0x43cbef,_0x5bb8a1){return new BPromise(function(_0x5c3355,_0x395ba9){return client[_0x2529('0x8')](_0x407277,_0x5bb8a1)['then'](function(_0xa234ac){logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));logger[_0x2529('0xc')](_0x2529('0xd'),_0x43cbef,_0x2529('0xb'),JSON[_0x2529('0xe')](_0xa234ac));if(_0xa234ac['error']){if(_0xa234ac[_0x2529('0xf')][_0x2529('0x10')]===0x1f4){logger['error'](_0x2529('0xa'),_0x43cbef,_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);return _0x395ba9(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}logger[_0x2529('0xf')](_0x2529('0xa'),_0x43cbef,_0xa234ac['error'][_0x2529('0x11')]);return _0x5c3355(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}else{logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));_0x5c3355(_0xa234ac[_0x2529('0x12')][_0x2529('0x11')]);}})['catch'](function(_0x163bf4){logger['error'](_0x2529('0xa'),_0x43cbef,_0x163bf4);_0x395ba9(_0x163bf4);});});}exports[_0x2529('0x13')]=function(_0x89be58){var _0x49aa27=this;return new Promise(function(_0x5b4d0d,_0xed24cf){return db[_0x2529('0x14')][_0x2529('0x15')]({'raw':_0x89be58[_0x2529('0x16')]?_0x89be58[_0x2529('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x89be58[_0x2529('0x16')]?_0x89be58[_0x2529('0x16')][_0x2529('0x17')]||null:null,'attributes':_0x89be58[_0x2529('0x16')]?_0x89be58['options'][_0x2529('0x18')]||null:null,'limit':_0x89be58[_0x2529('0x16')]?_0x89be58[_0x2529('0x16')]['limit']||null:null,'include':_0x89be58[_0x2529('0x16')]?_0x89be58[_0x2529('0x16')][_0x2529('0x19')]?_[_0x2529('0x1a')](_0x89be58['options'][_0x2529('0x19')],function(_0x2d0c6d){return{'model':db[_0x2d0c6d[_0x2529('0x1b')]],'as':_0x2d0c6d['as'],'attributes':_0x2d0c6d[_0x2529('0x18')],'include':_0x2d0c6d[_0x2529('0x19')]?_[_0x2529('0x1a')](_0x2d0c6d['include'],function(_0x5539ef){return{'model':db[_0x5539ef[_0x2529('0x1b')]],'as':_0x5539ef['as'],'attributes':_0x5539ef[_0x2529('0x18')],'include':_0x5539ef[_0x2529('0x19')]?_[_0x2529('0x1a')](_0x5539ef[_0x2529('0x19')],function(_0x2a8371){return{'model':db[_0x2a8371[_0x2529('0x1b')]],'as':_0x2a8371['as'],'attributes':_0x2a8371[_0x2529('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2529('0x1c')](function(_0x113df6){logger['info'](_0x2529('0x13'),_0x89be58);logger[_0x2529('0xc')]('GetInterval',_0x89be58,JSON[_0x2529('0xe')](_0x113df6));_0x5b4d0d(_0x113df6);})[_0x2529('0x1d')](function(_0x5bea2d){logger[_0x2529('0xf')](_0x2529('0x13'),_0x5bea2d['message'],_0x89be58);_0xed24cf(_0x49aa27[_0x2529('0xf')](0x1f4,_0x5bea2d[_0x2529('0x11')]));});});};exports['ShowInterval']=function(_0x96bd62){var _0x24e437=this;return new Promise(function(_0x3c2dba,_0x203acb){return db[_0x2529('0x14')]['find']({'raw':_0x96bd62[_0x2529('0x16')]?_0x96bd62[_0x2529('0x16')][_0x2529('0x1e')]===undefined?!![]:![]:!![],'where':_0x96bd62[_0x2529('0x16')]?_0x96bd62[_0x2529('0x16')][_0x2529('0x17')]||null:null,'attributes':_0x96bd62[_0x2529('0x16')]?_0x96bd62['options']['attributes']||null:null,'include':_0x96bd62[_0x2529('0x16')]?_0x96bd62['options'][_0x2529('0x19')]?_['map'](_0x96bd62['options']['include'],function(_0x30cdfb){return{'model':db[_0x30cdfb[_0x2529('0x1b')]],'as':_0x30cdfb['as'],'attributes':_0x30cdfb[_0x2529('0x18')],'include':_0x30cdfb['include']?_[_0x2529('0x1a')](_0x30cdfb['include'],function(_0x585ab5){return{'model':db[_0x585ab5['model']],'as':_0x585ab5['as'],'attributes':_0x585ab5[_0x2529('0x18')],'include':_0x585ab5[_0x2529('0x19')]?_[_0x2529('0x1a')](_0x585ab5[_0x2529('0x19')],function(_0x42551b){return{'model':db[_0x42551b[_0x2529('0x1b')]],'as':_0x42551b['as'],'attributes':_0x42551b[_0x2529('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2529('0x1c')](function(_0xd6e419){logger[_0x2529('0x9')](_0x2529('0x1f'),_0x96bd62);logger[_0x2529('0xc')](_0x2529('0x1f'),_0x96bd62,JSON['stringify'](_0xd6e419));_0x3c2dba(_0xd6e419);})['catch'](function(_0xadb4a2){logger[_0x2529('0xf')]('ShowInterval',_0xadb4a2[_0x2529('0x11')],_0x96bd62);_0x203acb(_0x24e437[_0x2529('0xf')](0x1f4,_0xadb4a2[_0x2529('0x11')]));});});};
\ No newline at end of file
+var _0x5075=['findAll','options','where','attributes','limit','include','map','model','debug','stringify','ShowInterval','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetInterval','Interval'];(function(_0x46ce47,_0x274821){var _0x331a89=function(_0x586a86){while(--_0x586a86){_0x46ce47['push'](_0x46ce47['shift']());}};_0x331a89(++_0x274821);}(_0x5075,0x73));var _0x5507=function(_0x6ea8a2,_0x561d6c){_0x6ea8a2=_0x6ea8a2-0x0;var _0x4fe938=_0x5075[_0x6ea8a2];return _0x4fe938;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var moment=require(_0x5507('0x2'));var BPromise=require(_0x5507('0x3'));var rs=require(_0x5507('0x4'));var fs=require('fs');var Redis=require(_0x5507('0x5'));var db=require(_0x5507('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5507('0x7'))(_0x5507('0x8'));var config=require(_0x5507('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5507('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x773559,_0x4c2d6d,_0x42c232){return new BPromise(function(_0x7cc84c,_0xbf4b50){return client['request'](_0x773559,_0x42c232)['then'](function(_0xe8c49){logger[_0x5507('0xb')](_0x5507('0xc'),_0x4c2d6d,_0x5507('0xd'));logger['debug'](_0x5507('0xe'),_0x4c2d6d,_0x5507('0xd'),JSON['stringify'](_0xe8c49));if(_0xe8c49[_0x5507('0xf')]){if(_0xe8c49[_0x5507('0xf')]['code']===0x1f4){logger[_0x5507('0xf')](_0x5507('0xc'),_0x4c2d6d,_0xe8c49[_0x5507('0xf')][_0x5507('0x10')]);return _0xbf4b50(_0xe8c49[_0x5507('0xf')][_0x5507('0x10')]);}logger['error'](_0x5507('0xc'),_0x4c2d6d,_0xe8c49[_0x5507('0xf')][_0x5507('0x10')]);return _0x7cc84c(_0xe8c49[_0x5507('0xf')]['message']);}else{logger[_0x5507('0xb')](_0x5507('0xc'),_0x4c2d6d,_0x5507('0xd'));_0x7cc84c(_0xe8c49[_0x5507('0x11')][_0x5507('0x10')]);}})[_0x5507('0x12')](function(_0x241932){logger[_0x5507('0xf')](_0x5507('0xc'),_0x4c2d6d,_0x241932);_0xbf4b50(_0x241932);});});}exports[_0x5507('0x13')]=function(_0x233b6a){var _0x2260f7=this;return new Promise(function(_0x3822dd,_0x5ad6d7){return db[_0x5507('0x14')][_0x5507('0x15')]({'raw':_0x233b6a[_0x5507('0x16')]?_0x233b6a[_0x5507('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x233b6a[_0x5507('0x16')]?_0x233b6a[_0x5507('0x16')][_0x5507('0x17')]||null:null,'attributes':_0x233b6a[_0x5507('0x16')]?_0x233b6a[_0x5507('0x16')][_0x5507('0x18')]||null:null,'limit':_0x233b6a['options']?_0x233b6a[_0x5507('0x16')][_0x5507('0x19')]||null:null,'include':_0x233b6a[_0x5507('0x16')]?_0x233b6a[_0x5507('0x16')][_0x5507('0x1a')]?_[_0x5507('0x1b')](_0x233b6a[_0x5507('0x16')][_0x5507('0x1a')],function(_0x398911){return{'model':db[_0x398911[_0x5507('0x1c')]],'as':_0x398911['as'],'attributes':_0x398911[_0x5507('0x18')],'include':_0x398911[_0x5507('0x1a')]?_[_0x5507('0x1b')](_0x398911[_0x5507('0x1a')],function(_0x1a2203){return{'model':db[_0x1a2203['model']],'as':_0x1a2203['as'],'attributes':_0x1a2203[_0x5507('0x18')],'include':_0x1a2203['include']?_[_0x5507('0x1b')](_0x1a2203['include'],function(_0xa66a01){return{'model':db[_0xa66a01[_0x5507('0x1c')]],'as':_0xa66a01['as'],'attributes':_0xa66a01['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xbe8d32){logger[_0x5507('0xb')]('GetInterval',_0x233b6a);logger[_0x5507('0x1d')](_0x5507('0x13'),_0x233b6a,JSON[_0x5507('0x1e')](_0xbe8d32));_0x3822dd(_0xbe8d32);})[_0x5507('0x12')](function(_0x1e5ce6){logger[_0x5507('0xf')]('GetInterval',_0x1e5ce6[_0x5507('0x10')],_0x233b6a);_0x5ad6d7(_0x2260f7[_0x5507('0xf')](0x1f4,_0x1e5ce6[_0x5507('0x10')]));});});};exports[_0x5507('0x1f')]=function(_0x29dd58){var _0x495bbe=this;return new Promise(function(_0x51e692,_0x3b09be){return db[_0x5507('0x14')][_0x5507('0x20')]({'raw':_0x29dd58[_0x5507('0x16')]?_0x29dd58['options'][_0x5507('0x21')]===undefined?!![]:![]:!![],'where':_0x29dd58[_0x5507('0x16')]?_0x29dd58[_0x5507('0x16')][_0x5507('0x17')]||null:null,'attributes':_0x29dd58[_0x5507('0x16')]?_0x29dd58[_0x5507('0x16')][_0x5507('0x18')]||null:null,'include':_0x29dd58[_0x5507('0x16')]?_0x29dd58['options'][_0x5507('0x1a')]?_[_0x5507('0x1b')](_0x29dd58[_0x5507('0x16')]['include'],function(_0x49485b){return{'model':db[_0x49485b[_0x5507('0x1c')]],'as':_0x49485b['as'],'attributes':_0x49485b[_0x5507('0x18')],'include':_0x49485b[_0x5507('0x1a')]?_[_0x5507('0x1b')](_0x49485b[_0x5507('0x1a')],function(_0x574fc6){return{'model':db[_0x574fc6['model']],'as':_0x574fc6['as'],'attributes':_0x574fc6[_0x5507('0x18')],'include':_0x574fc6[_0x5507('0x1a')]?_[_0x5507('0x1b')](_0x574fc6[_0x5507('0x1a')],function(_0x5dcd57){return{'model':db[_0x5dcd57['model']],'as':_0x5dcd57['as'],'attributes':_0x5dcd57[_0x5507('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x304daf){logger[_0x5507('0xb')](_0x5507('0x1f'),_0x29dd58);logger[_0x5507('0x1d')](_0x5507('0x1f'),_0x29dd58,JSON[_0x5507('0x1e')](_0x304daf));_0x51e692(_0x304daf);})[_0x5507('0x12')](function(_0x2b962d){logger[_0x5507('0xf')](_0x5507('0x1f'),_0x2b962d['message'],_0x29dd58);_0x3b09be(_0x495bbe['error'](0x1f4,_0x2b962d['message']));});});};
\ No newline at end of file
index 7a9e1a1..8308423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x110924,_0x1374bb){_0x110924=_0x110924-0x0;var _0x12905b=_0xb10b[_0x110924];return _0x12905b;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router;
\ No newline at end of file
+var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x4eb357,_0x36bd77){var _0x28729f=function(_0x885d26){while(--_0x885d26){_0x4eb357['push'](_0x4eb357['shift']());}};_0x28729f(++_0x36bd77);}(_0xadb5,0xad));var _0x5adb=function(_0x3b0ef3,_0x480bbf){_0x3b0ef3=_0x3b0ef3-0x0;var _0xb7145d=_0xadb5[_0x3b0ef3];return _0xb7145d;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
index 8cfbb9c..2ca8f6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','utf8','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0'];(function(_0x1b80b8,_0x1221e1){var _0x5c1a4f=function(_0x13c972){while(--_0x13c972){_0x1b80b8['push'](_0x1b80b8['shift']());}};_0x5c1a4f(++_0x1221e1);}(_0xe706,0xa3));var _0x6e70=function(_0x2af3e1,_0xb5207f){_0x2af3e1=_0x2af3e1-0x0;var _0xfa27d=_0xe706[_0x2af3e1];return _0xfa27d;};'use strict';var BPromise=require(_0x6e70('0x0'));var https=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var USERNAME=_0x6e70('0x3');var PASSWORD=_0x6e70('0x4');function openIssue(_0x2ca810,_0x7dfbc3){var _0x142c27={'fields':{'project':{'key':_0x2ca810[_0x6e70('0x5')]||_0x6e70('0x6')},'summary':(_0x2ca810[_0x6e70('0x7')]||_0x6e70('0x8'))+_0x6e70('0x9')+_0x2ca810['ip'],'description':_0x2ca810[_0x6e70('0xa')]||JSON[_0x6e70('0xb')](_0x2ca810),'issuetype':{'name':_0x2ca810[_0x6e70('0xc')]||_0x6e70('0xd')}}};_0x142c27[_0x6e70('0xe')][_0x6e70('0xf')]=_0x2ca810[_0x6e70('0x10')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x11')]=_0x2ca810[_0x6e70('0x12')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x13')]=_0x2ca810[_0x6e70('0x14')];_0x142c27[_0x6e70('0xe')]['customfield_11503']=_0x2ca810['name'];_0x142c27[_0x6e70('0xe')][_0x6e70('0x15')]=_0x2ca810[_0x6e70('0x16')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x17')]=_0x2ca810['ip'];var _0x310eb7={'host':_0x6e70('0x18'),'port':0x1bb,'path':_0x6e70('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6e70('0x1a')]('base64')}};var _0x53aed0=JSON[_0x6e70('0xb')](_0x142c27);var _0x22c50c=https['request'](_0x310eb7,function(_0x24f3ac){_0x24f3ac['setEncoding'](_0x6e70('0x1b'));var _0x161f23='';_0x24f3ac['on']('data',function(_0x49029f){_0x161f23+=_0x49029f;});_0x24f3ac['on'](_0x6e70('0x1c'),function(){if(_0x7dfbc3){return _0x7dfbc3['status'](_0x24f3ac[_0x6e70('0x1d')])[_0x6e70('0x1e')](JSON['parse'](_0x161f23));}});});_0x22c50c['on']('error',function(_0xc238ba){if(_0x7dfbc3){return _0x7dfbc3[_0x6e70('0x1f')](0x1f4)[_0x6e70('0x1e')]({'errors':[{'message':_0x6e70('0x20'),'type':_0x6e70('0x21')}]});}});_0x22c50c[_0x6e70('0x22')](_0x53aed0);_0x22c50c[_0x6e70('0x1c')]();}exports[_0x6e70('0x23')]=openIssue;exports[_0x6e70('0x24')]=function(_0xb29a2a,_0x4a0cfe){_0xb29a2a[_0x6e70('0x25')]['ip']=_0xb29a2a[_0x6e70('0x26')][_0x6e70('0x27')]||_0xb29a2a['connection'][_0x6e70('0x28')]||_0xb29a2a[_0x6e70('0x29')][_0x6e70('0x28')]||_0xb29a2a['connection'][_0x6e70('0x29')]['remoteAddress'];return openIssue(_0xb29a2a['body'],_0x4a0cfe);};
\ No newline at end of file
+var _0x0713=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','/rest/api/2/issue','POST','Basic\x20','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','error'];(function(_0x4db006,_0x3d27c1){var _0x493afc=function(_0x28185e){while(--_0x28185e){_0x4db006['push'](_0x4db006['shift']());}};_0x493afc(++_0x3d27c1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var USERNAME=_0x3071('0x2');var PASSWORD=_0x3071('0x3');function openIssue(_0x864539,_0x52b5fb){var _0x2c547f={'fields':{'project':{'key':_0x864539[_0x3071('0x4')]||_0x3071('0x5')},'summary':(_0x864539[_0x3071('0x6')]||_0x3071('0x7'))+_0x3071('0x8')+_0x864539['ip'],'description':_0x864539[_0x3071('0x9')]||JSON[_0x3071('0xa')](_0x864539),'issuetype':{'name':_0x864539[_0x3071('0xb')]||_0x3071('0xc')}}};_0x2c547f[_0x3071('0xd')][_0x3071('0xe')]=_0x864539[_0x3071('0xf')];_0x2c547f['fields'][_0x3071('0x10')]=_0x864539[_0x3071('0x11')];_0x2c547f[_0x3071('0xd')][_0x3071('0x12')]=_0x864539[_0x3071('0x13')];_0x2c547f['fields'][_0x3071('0x14')]=_0x864539[_0x3071('0x15')];_0x2c547f[_0x3071('0xd')][_0x3071('0x16')]=_0x864539[_0x3071('0x17')];_0x2c547f['fields']['customfield_10102']=_0x864539['ip'];var _0x1826ca={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3071('0x18'),'method':_0x3071('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x3071('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3071('0x1b'))}};var _0x45c93b=JSON[_0x3071('0xa')](_0x2c547f);var _0x1f14e1=https[_0x3071('0x1c')](_0x1826ca,function(_0x2a6a4b){_0x2a6a4b[_0x3071('0x1d')](_0x3071('0x1e'));var _0x21aad3='';_0x2a6a4b['on'](_0x3071('0x1f'),function(_0x5f3c22){_0x21aad3+=_0x5f3c22;});_0x2a6a4b['on'](_0x3071('0x20'),function(){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](_0x2a6a4b[_0x3071('0x22')])[_0x3071('0x23')](JSON[_0x3071('0x24')](_0x21aad3));}});});_0x1f14e1['on'](_0x3071('0x25'),function(_0x105bbb){if(_0x52b5fb){return _0x52b5fb[_0x3071('0x21')](0x1f4)['json']({'errors':[{'message':_0x3071('0x26'),'type':_0x3071('0x27')}]});}});_0x1f14e1[_0x3071('0x28')](_0x45c93b);_0x1f14e1['end']();}exports[_0x3071('0x29')]=openIssue;exports['send']=function(_0x833074,_0x43128c){_0x833074[_0x3071('0x2a')]['ip']=_0x833074[_0x3071('0x2b')][_0x3071('0x2c')]||_0x833074[_0x3071('0x2d')][_0x3071('0x2e')]||_0x833074[_0x3071('0x2f')]['remoteAddress']||_0x833074['connection'][_0x3071('0x2f')][_0x3071('0x2e')];return openIssue(_0x833074[_0x3071('0x2a')],_0x43128c);};
\ No newline at end of file
index 595d274..c65751a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ae8=['exports','util','path','express','Router','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','create','put','delete','destroy'];(function(_0x48861e,_0x123e0c){var _0xcdc443=function(_0x5d7495){while(--_0x5d7495){_0x48861e['push'](_0x48861e['shift']());}};_0xcdc443(++_0x123e0c);}(_0x3ae8,0x100));var _0x83ae=function(_0x1d8bb6,_0xd4c47a){_0x1d8bb6=_0x1d8bb6-0x0;var _0x4ea498=_0x3ae8[_0x1d8bb6];return _0x4ea498;};'use strict';var multer=require('multer');var util=require(_0x83ae('0x0'));var path=require(_0x83ae('0x1'));var timeout=require('connect-timeout');var express=require(_0x83ae('0x2'));var router=express[_0x83ae('0x3')]();var auth=require(_0x83ae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x83ae('0x5'));var controller=require('./jscriptyAnswerReport.controller');router[_0x83ae('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x83ae('0x6')](_0x83ae('0x7'),auth[_0x83ae('0x8')](),controller[_0x83ae('0x9')]);router[_0x83ae('0x6')](_0x83ae('0xa'),auth[_0x83ae('0x8')](),controller[_0x83ae('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x83ae('0xc')]);router[_0x83ae('0xd')](_0x83ae('0xa'),auth[_0x83ae('0x8')](),controller['update']);router[_0x83ae('0xe')](_0x83ae('0xa'),auth[_0x83ae('0x8')](),controller[_0x83ae('0xf')]);module[_0x83ae('0x10')]=router;
\ No newline at end of file
+var _0xe0bf=['../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x805b91,_0x4ee077){var _0x3ca414=function(_0x227f53){while(--_0x227f53){_0x805b91['push'](_0x805b91['shift']());}};_0x3ca414(++_0x4ee077);}(_0xe0bf,0x105));var _0xfe0b=function(_0x131e76,_0x1c1aa2){_0x131e76=_0x131e76-0x0;var _0x2fcde3=_0xe0bf[_0x131e76];return _0x2fcde3;};'use strict';var multer=require(_0xfe0b('0x0'));var util=require(_0xfe0b('0x1'));var path=require('path');var timeout=require(_0xfe0b('0x2'));var express=require(_0xfe0b('0x3'));var router=express['Router']();var auth=require(_0xfe0b('0x4'));var interaction=require(_0xfe0b('0x5'));var config=require(_0xfe0b('0x6'));var controller=require(_0xfe0b('0x7'));router[_0xfe0b('0x8')]('/',auth['isAuthenticated'](),controller[_0xfe0b('0x9')]);router[_0xfe0b('0x8')](_0xfe0b('0xa'),auth[_0xfe0b('0xb')](),controller[_0xfe0b('0xc')]);router['get']('/:id',auth[_0xfe0b('0xb')](),controller[_0xfe0b('0xd')]);router[_0xfe0b('0xe')]('/',auth[_0xfe0b('0xb')](),controller[_0xfe0b('0xf')]);router[_0xfe0b('0x10')](_0xfe0b('0x11'),auth[_0xfe0b('0xb')](),controller['update']);router[_0xfe0b('0x12')](_0xfe0b('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 986475d..ecc3b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e54=['STRING','sequelize','TEXT','long'];(function(_0x131b9f,_0x4d58ce){var _0x118bb4=function(_0x278a3d){while(--_0x278a3d){_0x131b9f['push'](_0x131b9f['shift']());}};_0x118bb4(++_0x4d58ce);}(_0x2e54,0x1dd));var _0x42e5=function(_0x317937,_0x29f3fc){_0x317937=_0x317937-0x0;var _0x5bd62f=_0x2e54[_0x317937];return _0x5bd62f;};'use strict';var Sequelize=require(_0x42e5('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x42e5('0x1')](_0x42e5('0x2'))},'membername':{'type':Sequelize[_0x42e5('0x3')]},'projectname':{'type':Sequelize[_0x42e5('0x3')]},'queue':{'type':Sequelize[_0x42e5('0x3')]},'uniqueid':{'type':Sequelize[_0x42e5('0x3')]},'calleridname':{'type':Sequelize[_0x42e5('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x42e5('0x3')]}};
\ No newline at end of file
+var _0x4bd1=['exports','TEXT','long','STRING'];(function(_0x58412f,_0x6cbf30){var _0x4614f6=function(_0x42ffeb){while(--_0x42ffeb){_0x58412f['push'](_0x58412f['shift']());}};_0x4614f6(++_0x6cbf30);}(_0x4bd1,0x90));var _0x14bd=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0x4bd1[_0x7b484];return _0x2ae1cf;};'use strict';var Sequelize=require('sequelize');module[_0x14bd('0x0')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x14bd('0x1')](_0x14bd('0x2'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x14bd('0x3')]},'queue':{'type':Sequelize[_0x14bd('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x14bd('0x3')]},'calleridnum':{'type':Sequelize[_0x14bd('0x3')]},'questionId':{'type':Sequelize[_0x14bd('0x3')]}};
\ No newline at end of file
index 3ed2829..362297a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f51=['destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','name','send','JscriptyAnswerReport','rawAttributes','keys','query','dateEnd','dateStart','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','add','day','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','rows','catch','show','params','length','include','find','create','body'];(function(_0x59ae80,_0x56b205){var _0x473bf9=function(_0x2f484e){while(--_0x2f484e){_0x59ae80['push'](_0x59ae80['shift']());}};_0x473bf9(++_0x56b205);}(_0x7f51,0xe3));var _0x17f5=function(_0x1d4e98,_0x446c3a){_0x1d4e98=_0x1d4e98-0x0;var _0x48cd7e=_0x7f51[_0x1d4e98];return _0x48cd7e;};'use strict';var pdf=require(_0x17f5('0x0'));var emlformat=require(_0x17f5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x17f5('0x2'));var jsonpatch=require(_0x17f5('0x3'));var rp=require(_0x17f5('0x4'));var moment=require('moment');var BPromise=require(_0x17f5('0x5'));var Mustache=require(_0x17f5('0x6'));var util=require(_0x17f5('0x7'));var path=require(_0x17f5('0x8'));var sox=require('sox');var csv=require(_0x17f5('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x17f5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x17f5('0xb'));var deskjs=require(_0x17f5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x17f5('0xd'));var Papa=require(_0x17f5('0xe'));var Redis=require(_0x17f5('0xf'));var qs=require(_0x17f5('0x10'));var logger=require(_0x17f5('0x11'))(_0x17f5('0x12'));var utils=require(_0x17f5('0x13'));var config=require(_0x17f5('0x14'));var db=require(_0x17f5('0x15'))['db'];function respondWithStatusCode(_0x3af5e9,_0xd1fcbd){_0xd1fcbd=_0xd1fcbd||0xcc;return function(_0x514c09){if(_0x514c09){return _0x3af5e9[_0x17f5('0x16')](_0xd1fcbd);}return _0x3af5e9[_0x17f5('0x17')](_0xd1fcbd)[_0x17f5('0x18')]();};}function respondWithResult(_0x1c9ef1,_0xc27a97){_0xc27a97=_0xc27a97||0xc8;return function(_0x40be8f){if(_0x40be8f){return _0x1c9ef1[_0x17f5('0x17')](_0xc27a97)[_0x17f5('0x19')](_0x40be8f);}};}function respondWithFilteredResult(_0x1bffe5,_0x1667b9){return function(_0x235136){if(_0x235136){var _0x36eef0=_0x235136['count'],_0x5ee640=_0x1667b9['offset'],_0x27942e=_0x1667b9[_0x17f5('0x1a')]+_0x1667b9[_0x17f5('0x1b')],_0x35a6de;if(_0x27942e>=_0x36eef0){_0x27942e=_0x36eef0;_0x35a6de=0xc8;}else{_0x35a6de=0xce;}_0x1bffe5[_0x17f5('0x17')](_0x35a6de);return _0x1bffe5['set'](_0x17f5('0x1c'),_0x5ee640+'-'+_0x27942e+'/'+_0x36eef0)['json'](_0x235136);}return null;};}function patchUpdates(_0x5c8efb){return function(_0x2bfc45){try{jsonpatch[_0x17f5('0x1d')](_0x2bfc45,_0x5c8efb,!![]);}catch(_0x5abd22){return BPromise[_0x17f5('0x1e')](_0x5abd22);}return _0x2bfc45[_0x17f5('0x1f')]();};}function saveUpdates(_0x182a8a,_0x203c84){return function(_0x698674){if(_0x698674){return _0x698674[_0x17f5('0x20')](_0x182a8a)[_0x17f5('0x21')](function(_0x4c7956){return _0x4c7956;});}return null;};}function removeEntity(_0xdda7ce,_0x43cb94){return function(_0x2827c0){if(_0x2827c0){return _0x2827c0['destroy']()[_0x17f5('0x21')](function(){_0xdda7ce[_0x17f5('0x17')](0xcc)[_0x17f5('0x18')]();});}};}function handleEntityNotFound(_0x14471f,_0x46a708){return function(_0xfac0e9){if(!_0xfac0e9){_0x14471f[_0x17f5('0x16')](0x194);}return _0xfac0e9;};}function handleError(_0x17d489,_0x1dfdfa){_0x1dfdfa=_0x1dfdfa||0x1f4;return function(_0x1913d6){logger['error'](_0x1913d6['stack']);if(_0x1913d6[_0x17f5('0x22')]){delete _0x1913d6[_0x17f5('0x22')];}_0x17d489['status'](_0x1dfdfa)[_0x17f5('0x23')](_0x1913d6);};}exports['index']=function(_0x5c3658,_0x42414a){var _0x412bef={},_0x2952a0={},_0x545140={'count':0x0,'rows':[]};var _0x48757a=db[_0x17f5('0x24')][_0x17f5('0x25')];_0x2952a0['model']=_[_0x17f5('0x26')](_0x48757a);var _0x16830a={'dateStart':_0x5c3658[_0x17f5('0x27')]['dateStart'],'dateEnd':_0x5c3658[_0x17f5('0x27')][_0x17f5('0x28')]};delete _0x5c3658[_0x17f5('0x27')][_0x17f5('0x29')];delete _0x5c3658[_0x17f5('0x27')][_0x17f5('0x28')];_0x2952a0['query']=_[_0x17f5('0x26')](_0x5c3658[_0x17f5('0x27')]);_0x2952a0[_0x17f5('0x2a')]=_[_0x17f5('0x2b')](_0x2952a0[_0x17f5('0x2c')],_0x2952a0['query']);_0x412bef[_0x17f5('0x2d')]=_[_0x17f5('0x2b')](_0x2952a0[_0x17f5('0x2c')],qs['fields'](_0x5c3658[_0x17f5('0x27')][_0x17f5('0x2e')]));_0x412bef['attributes']=_0x412bef[_0x17f5('0x2d')]['length']?_0x412bef['attributes']:_0x2952a0[_0x17f5('0x2c')];if(!_0x5c3658[_0x17f5('0x27')][_0x17f5('0x2f')]('nolimit')){_0x412bef[_0x17f5('0x1b')]=qs[_0x17f5('0x1b')](_0x5c3658[_0x17f5('0x27')][_0x17f5('0x1b')]);_0x412bef[_0x17f5('0x1a')]=qs[_0x17f5('0x1a')](_0x5c3658[_0x17f5('0x27')][_0x17f5('0x1a')]);}_0x412bef[_0x17f5('0x30')]=qs[_0x17f5('0x31')](_0x5c3658[_0x17f5('0x27')][_0x17f5('0x31')]);_0x412bef[_0x17f5('0x32')]=qs[_0x17f5('0x2a')](_[_0x17f5('0x33')](_0x5c3658[_0x17f5('0x27')],_0x2952a0[_0x17f5('0x2a')]));if(_0x16830a['dateStart']){if(_0x16830a['dateEnd']){_0x16830a['dateEnd']=moment(_0x16830a['dateEnd'])[_0x17f5('0x34')](0x1,_0x17f5('0x35'));}else{_0x16830a[_0x17f5('0x28')]=moment(_0x16830a[_0x17f5('0x29')])[_0x17f5('0x34')](0x1,_0x17f5('0x35'));}_['merge'](_0x412bef['where'],{'createdAt':{'$gte':_0x16830a['dateStart'],'$lte':_0x16830a[_0x17f5('0x28')]}});}if(_0x5c3658[_0x17f5('0x27')][_0x17f5('0x36')]){_0x412bef[_0x17f5('0x32')]=_[_0x17f5('0x37')](_0x412bef['where'],{'$or':_[_0x17f5('0x38')](_0x48757a,function(_0x1317f1){if(_0x1317f1[_0x17f5('0x39')][_0x17f5('0x3a')]!==_0x17f5('0x3b')){var _0x385287={};_0x385287[_0x1317f1[_0x17f5('0x3c')]]={'$like':'%'+_0x5c3658[_0x17f5('0x27')]['filter']+'%'};return _0x385287;}})});}_0x412bef=_[_0x17f5('0x37')]({},_0x412bef,_0x5c3658[_0x17f5('0x3d')]);var _0x579fba={'where':_0x412bef['where']};return db['JscriptyAnswerReport'][_0x17f5('0x3e')](_0x579fba)['then'](function(_0x54062d){_0x545140[_0x17f5('0x3e')]=_0x54062d;if(_0x5c3658[_0x17f5('0x27')][_0x17f5('0x3f')]){_0x412bef['include']=[{'all':!![]}];}return db[_0x17f5('0x24')]['findAll'](_0x412bef);})[_0x17f5('0x21')](function(_0x8b792b){_0x545140[_0x17f5('0x40')]=_0x8b792b;return _0x545140;})[_0x17f5('0x21')](respondWithFilteredResult(_0x42414a,_0x412bef))[_0x17f5('0x41')](handleError(_0x42414a,null));};exports[_0x17f5('0x42')]=function(_0x242ac5,_0x5e62f2){var _0x56d017={'raw':!![],'where':{'id':_0x242ac5[_0x17f5('0x43')]['id']}},_0x2f641d={};_0x2f641d[_0x17f5('0x2c')]=_[_0x17f5('0x26')](db['JscriptyAnswerReport'][_0x17f5('0x25')]);_0x2f641d[_0x17f5('0x27')]=_['keys'](_0x242ac5[_0x17f5('0x27')]);_0x2f641d[_0x17f5('0x2a')]=_[_0x17f5('0x2b')](_0x2f641d['model'],_0x2f641d[_0x17f5('0x27')]);_0x56d017[_0x17f5('0x2d')]=_[_0x17f5('0x2b')](_0x2f641d[_0x17f5('0x2c')],qs[_0x17f5('0x2e')](_0x242ac5['query'][_0x17f5('0x2e')]));_0x56d017[_0x17f5('0x2d')]=_0x56d017['attributes'][_0x17f5('0x44')]?_0x56d017[_0x17f5('0x2d')]:_0x2f641d[_0x17f5('0x2c')];if(_0x242ac5[_0x17f5('0x27')][_0x17f5('0x3f')]){_0x56d017[_0x17f5('0x45')]=[{'all':!![]}];}_0x56d017=_['merge']({},_0x56d017,_0x242ac5['options']);return db[_0x17f5('0x24')][_0x17f5('0x46')](_0x56d017)[_0x17f5('0x21')](handleEntityNotFound(_0x5e62f2,null))[_0x17f5('0x21')](respondWithResult(_0x5e62f2,null))[_0x17f5('0x41')](handleError(_0x5e62f2,null));};exports[_0x17f5('0x47')]=function(_0x55d126,_0x126901){return db[_0x17f5('0x24')][_0x17f5('0x47')](_0x55d126[_0x17f5('0x48')],{})[_0x17f5('0x21')](respondWithResult(_0x126901,0xc9))['catch'](handleError(_0x126901,null));};exports[_0x17f5('0x20')]=function(_0x584d20,_0x3be616){if(_0x584d20[_0x17f5('0x48')]['id']){delete _0x584d20[_0x17f5('0x48')]['id'];}return db[_0x17f5('0x24')][_0x17f5('0x46')]({'where':{'id':_0x584d20['params']['id']}})[_0x17f5('0x21')](handleEntityNotFound(_0x3be616,null))[_0x17f5('0x21')](saveUpdates(_0x584d20[_0x17f5('0x48')],null))[_0x17f5('0x21')](respondWithResult(_0x3be616,null))[_0x17f5('0x41')](handleError(_0x3be616,null));};exports[_0x17f5('0x49')]=function(_0x42c3d5,_0x9fec5c){return db[_0x17f5('0x24')][_0x17f5('0x46')]({'where':{'id':_0x42c3d5['params']['id']}})[_0x17f5('0x21')](handleEntityNotFound(_0x9fec5c,null))['then'](removeEntity(_0x9fec5c,null))[_0x17f5('0x41')](handleError(_0x9fec5c,null));};exports[_0x17f5('0x4a')]=function(_0x530ada,_0x5ca6cc){return db[_0x17f5('0x24')][_0x17f5('0x4a')]()[_0x17f5('0x21')](respondWithResult(_0x5ca6cc,null))[_0x17f5('0x41')](handleError(_0x5ca6cc,null));};
\ No newline at end of file
+var _0x64b8=['query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','add','day','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','limit','set','Content-Range','apply','save','then','sendStatus','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','model'];(function(_0x5baa6d,_0x32779d){var _0xef22e2=function(_0x8edadd){while(--_0x8edadd){_0x5baa6d['push'](_0x5baa6d['shift']());}};_0xef22e2(++_0x32779d);}(_0x64b8,0x163));var _0x864b=function(_0xe83bdf,_0xbb1582){_0xe83bdf=_0xe83bdf-0x0;var _0x129711=_0x64b8[_0xe83bdf];return _0x129711;};'use strict';var pdf=require(_0x864b('0x0'));var emlformat=require(_0x864b('0x1'));var rimraf=require(_0x864b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x864b('0x3'));var rp=require('request-promise');var moment=require(_0x864b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x864b('0x5'));var util=require(_0x864b('0x6'));var path=require('path');var sox=require(_0x864b('0x7'));var csv=require('to-csv');var ejs=require(_0x864b('0x8'));var fs=require('fs');var _=require(_0x864b('0x9'));var squel=require(_0x864b('0xa'));var crypto=require(_0x864b('0xb'));var jsforce=require(_0x864b('0xc'));var deskjs=require(_0x864b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x864b('0xe'));var Papa=require(_0x864b('0xf'));var Redis=require(_0x864b('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x864b('0x11'))('api');var utils=require(_0x864b('0x12'));var config=require(_0x864b('0x13'));var db=require(_0x864b('0x14'))['db'];function respondWithStatusCode(_0x52b2dd,_0x1d4be4){_0x1d4be4=_0x1d4be4||0xcc;return function(_0x363690){if(_0x363690){return _0x52b2dd['sendStatus'](_0x1d4be4);}return _0x52b2dd[_0x864b('0x15')](_0x1d4be4)[_0x864b('0x16')]();};}function respondWithResult(_0x39a49c,_0x2c2945){_0x2c2945=_0x2c2945||0xc8;return function(_0x104689){if(_0x104689){return _0x39a49c['status'](_0x2c2945)[_0x864b('0x17')](_0x104689);}};}function respondWithFilteredResult(_0xeafbb3,_0x51fced){return function(_0x587d83){if(_0x587d83){var _0x2e9cc6=_0x587d83[_0x864b('0x18')],_0x1d8af7=_0x51fced['offset'],_0x2d297a=_0x51fced['offset']+_0x51fced[_0x864b('0x19')],_0x1f9f85;if(_0x2d297a>=_0x2e9cc6){_0x2d297a=_0x2e9cc6;_0x1f9f85=0xc8;}else{_0x1f9f85=0xce;}_0xeafbb3[_0x864b('0x15')](_0x1f9f85);return _0xeafbb3[_0x864b('0x1a')](_0x864b('0x1b'),_0x1d8af7+'-'+_0x2d297a+'/'+_0x2e9cc6)[_0x864b('0x17')](_0x587d83);}return null;};}function patchUpdates(_0x10d5e7){return function(_0xf0723a){try{jsonpatch[_0x864b('0x1c')](_0xf0723a,_0x10d5e7,!![]);}catch(_0x4e427e){return BPromise['reject'](_0x4e427e);}return _0xf0723a[_0x864b('0x1d')]();};}function saveUpdates(_0x474721,_0x29d214){return function(_0x4e915a){if(_0x4e915a){return _0x4e915a['update'](_0x474721)[_0x864b('0x1e')](function(_0x561cf6){return _0x561cf6;});}return null;};}function removeEntity(_0x5b2522,_0x2b1a68){return function(_0x4b60b1){if(_0x4b60b1){return _0x4b60b1['destroy']()[_0x864b('0x1e')](function(){_0x5b2522[_0x864b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51db87,_0x5bffe1){return function(_0x400be5){if(!_0x400be5){_0x51db87[_0x864b('0x1f')](0x194);}return _0x400be5;};}function handleError(_0x5d2f3f,_0x3dc724){_0x3dc724=_0x3dc724||0x1f4;return function(_0x5dc646){logger[_0x864b('0x20')](_0x5dc646[_0x864b('0x21')]);if(_0x5dc646[_0x864b('0x22')]){delete _0x5dc646[_0x864b('0x22')];}_0x5d2f3f[_0x864b('0x15')](_0x3dc724)[_0x864b('0x23')](_0x5dc646);};}exports[_0x864b('0x24')]=function(_0x1e7d9f,_0x6fb5a3){var _0x514511={},_0x2e5e9e={},_0x3a929c={'count':0x0,'rows':[]};var _0x210296=db[_0x864b('0x25')][_0x864b('0x26')];_0x2e5e9e[_0x864b('0x27')]=_['keys'](_0x210296);var _0x236e19={'dateStart':_0x1e7d9f[_0x864b('0x28')]['dateStart'],'dateEnd':_0x1e7d9f['query'][_0x864b('0x29')]};delete _0x1e7d9f[_0x864b('0x28')][_0x864b('0x2a')];delete _0x1e7d9f[_0x864b('0x28')]['dateEnd'];_0x2e5e9e['query']=_[_0x864b('0x2b')](_0x1e7d9f[_0x864b('0x28')]);_0x2e5e9e[_0x864b('0x2c')]=_[_0x864b('0x2d')](_0x2e5e9e[_0x864b('0x27')],_0x2e5e9e['query']);_0x514511[_0x864b('0x2e')]=_['intersection'](_0x2e5e9e[_0x864b('0x27')],qs[_0x864b('0x2f')](_0x1e7d9f[_0x864b('0x28')][_0x864b('0x2f')]));_0x514511[_0x864b('0x2e')]=_0x514511[_0x864b('0x2e')][_0x864b('0x30')]?_0x514511[_0x864b('0x2e')]:_0x2e5e9e['model'];if(!_0x1e7d9f[_0x864b('0x28')][_0x864b('0x31')](_0x864b('0x32'))){_0x514511[_0x864b('0x19')]=qs[_0x864b('0x19')](_0x1e7d9f['query']['limit']);_0x514511[_0x864b('0x33')]=qs[_0x864b('0x33')](_0x1e7d9f[_0x864b('0x28')][_0x864b('0x33')]);}_0x514511[_0x864b('0x34')]=qs[_0x864b('0x35')](_0x1e7d9f[_0x864b('0x28')]['sort']);_0x514511[_0x864b('0x36')]=qs[_0x864b('0x2c')](_[_0x864b('0x37')](_0x1e7d9f['query'],_0x2e5e9e[_0x864b('0x2c')]));if(_0x236e19[_0x864b('0x2a')]){if(_0x236e19[_0x864b('0x29')]){_0x236e19['dateEnd']=moment(_0x236e19[_0x864b('0x29')])[_0x864b('0x38')](0x1,_0x864b('0x39'));}else{_0x236e19[_0x864b('0x29')]=moment(_0x236e19[_0x864b('0x2a')])[_0x864b('0x38')](0x1,'day');}_['merge'](_0x514511[_0x864b('0x36')],{'createdAt':{'$gte':_0x236e19['dateStart'],'$lte':_0x236e19[_0x864b('0x29')]}});}if(_0x1e7d9f[_0x864b('0x28')][_0x864b('0x3a')]){_0x514511[_0x864b('0x36')]=_[_0x864b('0x3b')](_0x514511['where'],{'$or':_[_0x864b('0x3c')](_0x210296,function(_0x503208){if(_0x503208[_0x864b('0x3d')][_0x864b('0x3e')]!==_0x864b('0x3f')){var _0x2de6d6={};_0x2de6d6[_0x503208[_0x864b('0x40')]]={'$like':'%'+_0x1e7d9f[_0x864b('0x28')][_0x864b('0x3a')]+'%'};return _0x2de6d6;}})});}_0x514511=_[_0x864b('0x3b')]({},_0x514511,_0x1e7d9f[_0x864b('0x41')]);var _0x23a021={'where':_0x514511[_0x864b('0x36')]};return db[_0x864b('0x25')]['count'](_0x23a021)['then'](function(_0xd5596c){_0x3a929c[_0x864b('0x18')]=_0xd5596c;if(_0x1e7d9f[_0x864b('0x28')][_0x864b('0x42')]){_0x514511[_0x864b('0x43')]=[{'all':!![]}];}return db[_0x864b('0x25')][_0x864b('0x44')](_0x514511);})[_0x864b('0x1e')](function(_0x1d6beb){_0x3a929c[_0x864b('0x45')]=_0x1d6beb;return _0x3a929c;})[_0x864b('0x1e')](respondWithFilteredResult(_0x6fb5a3,_0x514511))['catch'](handleError(_0x6fb5a3,null));};exports[_0x864b('0x46')]=function(_0x30460b,_0x41d48f){var _0x45c358={'raw':!![],'where':{'id':_0x30460b[_0x864b('0x47')]['id']}},_0x2415d6={};_0x2415d6[_0x864b('0x27')]=_[_0x864b('0x2b')](db['JscriptyAnswerReport'][_0x864b('0x26')]);_0x2415d6[_0x864b('0x28')]=_[_0x864b('0x2b')](_0x30460b[_0x864b('0x28')]);_0x2415d6[_0x864b('0x2c')]=_['intersection'](_0x2415d6[_0x864b('0x27')],_0x2415d6[_0x864b('0x28')]);_0x45c358['attributes']=_[_0x864b('0x2d')](_0x2415d6[_0x864b('0x27')],qs['fields'](_0x30460b['query']['fields']));_0x45c358[_0x864b('0x2e')]=_0x45c358[_0x864b('0x2e')][_0x864b('0x30')]?_0x45c358[_0x864b('0x2e')]:_0x2415d6[_0x864b('0x27')];if(_0x30460b[_0x864b('0x28')]['includeAll']){_0x45c358['include']=[{'all':!![]}];}_0x45c358=_[_0x864b('0x3b')]({},_0x45c358,_0x30460b['options']);return db[_0x864b('0x25')][_0x864b('0x48')](_0x45c358)[_0x864b('0x1e')](handleEntityNotFound(_0x41d48f,null))[_0x864b('0x1e')](respondWithResult(_0x41d48f,null))['catch'](handleError(_0x41d48f,null));};exports[_0x864b('0x49')]=function(_0x3dd7af,_0x363e8d){return db[_0x864b('0x25')][_0x864b('0x49')](_0x3dd7af[_0x864b('0x4a')],{})[_0x864b('0x1e')](respondWithResult(_0x363e8d,0xc9))['catch'](handleError(_0x363e8d,null));};exports[_0x864b('0x4b')]=function(_0x35661d,_0x4e12c0){if(_0x35661d['body']['id']){delete _0x35661d[_0x864b('0x4a')]['id'];}return db[_0x864b('0x25')]['find']({'where':{'id':_0x35661d[_0x864b('0x47')]['id']}})[_0x864b('0x1e')](handleEntityNotFound(_0x4e12c0,null))['then'](saveUpdates(_0x35661d[_0x864b('0x4a')],null))['then'](respondWithResult(_0x4e12c0,null))[_0x864b('0x4c')](handleError(_0x4e12c0,null));};exports[_0x864b('0x4d')]=function(_0x48515c,_0x5a1246){return db[_0x864b('0x25')][_0x864b('0x48')]({'where':{'id':_0x48515c[_0x864b('0x47')]['id']}})[_0x864b('0x1e')](handleEntityNotFound(_0x5a1246,null))[_0x864b('0x1e')](removeEntity(_0x5a1246,null))[_0x864b('0x4c')](handleError(_0x5a1246,null));};exports[_0x864b('0x4e')]=function(_0x5dcf05,_0x5052a6){return db[_0x864b('0x25')][_0x864b('0x4e')]()[_0x864b('0x1e')](respondWithResult(_0x5052a6,null))[_0x864b('0x4c')](handleError(_0x5052a6,null));};
\ No newline at end of file
index 70cee07..fb58fee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90fc=['lodash','util','api','bluebird','request-promise','exports','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x90fc,0xb0));var _0xc90f=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x90fc[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xc90f('0x0'));var util=require(_0xc90f('0x1'));var logger=require('../../config/logger')(_0xc90f('0x2'));var moment=require('moment');var BPromise=require(_0xc90f('0x3'));var rp=require(_0xc90f('0x4'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xc90f('0x5')]=function(_0x400cbb,_0x559744){return _0x400cbb['define'](_0xc90f('0x6'),attributes,{'tableName':_0xc90f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ee2=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','request-promise','./jscriptyAnswerReport.attributes'];(function(_0x26d0b4,_0x3091c9){var _0x3ac956=function(_0x837ace){while(--_0x837ace){_0x26d0b4['push'](_0x26d0b4['shift']());}};_0x3ac956(++_0x3091c9);}(_0x4ee2,0xea));var _0x24ee=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4ee2[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x24ee('0x0'));var logger=require(_0x24ee('0x1'))(_0x24ee('0x2'));var moment=require(_0x24ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x24ee('0x4'));var attributes=require(_0x24ee('0x5'));module[_0x24ee('0x6')]=function(_0x5c5f0f,_0x544c9b){return _0x5c5f0f[_0x24ee('0x7')](_0x24ee('0x8'),attributes,{'tableName':_0x24ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 84ace56..d23ed9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf674=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','randomstring'];(function(_0x344a50,_0x3acecb){var _0x2140c6=function(_0x456b7e){while(--_0x456b7e){_0x344a50['push'](_0x344a50['shift']());}};_0x2140c6(++_0x3acecb);}(_0xf674,0x18c));var _0x4f67=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xf674[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x4f67('0x0'));var moment=require(_0x4f67('0x1'));var BPromise=require('bluebird');var rs=require(_0x4f67('0x2'));var fs=require('fs');var Redis=require(_0x4f67('0x3'));var db=require(_0x4f67('0x4'))['db'];var utils=require(_0x4f67('0x5'));var logger=require('../../config/logger')(_0x4f67('0x6'));var config=require(_0x4f67('0x7'));var jayson=require(_0x4f67('0x8'));var client=jayson[_0x4f67('0x9')][_0x4f67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5576e3,_0x2a6538,_0xc1ebb9){return new BPromise(function(_0x21e54d,_0x5ca3cf){return client[_0x4f67('0xb')](_0x5576e3,_0xc1ebb9)['then'](function(_0x457a77){logger[_0x4f67('0xc')](_0x4f67('0xd'),_0x2a6538,'request\x20sent');logger[_0x4f67('0xe')](_0x4f67('0xf'),_0x2a6538,_0x4f67('0x10'),JSON[_0x4f67('0x11')](_0x457a77));if(_0x457a77[_0x4f67('0x12')]){if(_0x457a77[_0x4f67('0x12')]['code']===0x1f4){logger[_0x4f67('0x12')](_0x4f67('0xd'),_0x2a6538,_0x457a77[_0x4f67('0x12')][_0x4f67('0x13')]);return _0x5ca3cf(_0x457a77['error'][_0x4f67('0x13')]);}logger[_0x4f67('0x12')](_0x4f67('0xd'),_0x2a6538,_0x457a77[_0x4f67('0x12')][_0x4f67('0x13')]);return _0x21e54d(_0x457a77[_0x4f67('0x12')][_0x4f67('0x13')]);}else{logger[_0x4f67('0xc')](_0x4f67('0xd'),_0x2a6538,_0x4f67('0x10'));_0x21e54d(_0x457a77['result'][_0x4f67('0x13')]);}})[_0x4f67('0x14')](function(_0x5e7c39){logger['error'](_0x4f67('0xd'),_0x2a6538,_0x5e7c39);_0x5ca3cf(_0x5e7c39);});});}
\ No newline at end of file
+var _0x4138=['info','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x7d3dde,_0x421b90){var _0x16a30d=function(_0x46d40d){while(--_0x46d40d){_0x7d3dde['push'](_0x7d3dde['shift']());}};_0x16a30d(++_0x421b90);}(_0x4138,0xce));var _0x8413=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4138[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8413('0x0'));var BPromise=require('bluebird');var rs=require(_0x8413('0x1'));var fs=require('fs');var Redis=require(_0x8413('0x2'));var db=require(_0x8413('0x3'))['db'];var utils=require(_0x8413('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8413('0x5'));var client=jayson[_0x8413('0x6')][_0x8413('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58867c,_0xf00b5f,_0x46f82f){return new BPromise(function(_0x3e5c61,_0x913b68){return client['request'](_0x58867c,_0x46f82f)[_0x8413('0x8')](function(_0x3326d1){logger['info'](_0x8413('0x9'),_0xf00b5f,_0x8413('0xa'));logger[_0x8413('0xb')](_0x8413('0xc'),_0xf00b5f,_0x8413('0xa'),JSON['stringify'](_0x3326d1));if(_0x3326d1[_0x8413('0xd')]){if(_0x3326d1[_0x8413('0xd')]['code']===0x1f4){logger[_0x8413('0xd')](_0x8413('0x9'),_0xf00b5f,_0x3326d1[_0x8413('0xd')][_0x8413('0xe')]);return _0x913b68(_0x3326d1[_0x8413('0xd')][_0x8413('0xe')]);}logger[_0x8413('0xd')](_0x8413('0x9'),_0xf00b5f,_0x3326d1[_0x8413('0xd')][_0x8413('0xe')]);return _0x3e5c61(_0x3326d1['error'][_0x8413('0xe')]);}else{logger[_0x8413('0xf')](_0x8413('0x9'),_0xf00b5f,_0x8413('0xa'));_0x3e5c61(_0x3326d1[_0x8413('0x10')][_0x8413('0xe')]);}})['catch'](function(_0x28ecf7){logger[_0x8413('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xf00b5f,_0x28ecf7);_0x913b68(_0x28ecf7);});});}
\ No newline at end of file
index 0cf840e..fe5b991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e5e=['/:id','isAuthenticated','show','get','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','index'];(function(_0x12118d,_0x200420){var _0x1c23ae=function(_0x8011e){while(--_0x8011e){_0x12118d['push'](_0x12118d['shift']());}};_0x1c23ae(++_0x200420);}(_0x6e5e,0x1de));var _0xe6e5=function(_0xad0887,_0x2bd60d){_0xad0887=_0xad0887-0x0;var _0x5c44e4=_0x6e5e[_0xad0887];return _0x5c44e4;};'use strict';var multer=require(_0xe6e5('0x0'));var util=require(_0xe6e5('0x1'));var path=require('path');var timeout=require(_0xe6e5('0x2'));var express=require('express');var router=express[_0xe6e5('0x3')]();var auth=require(_0xe6e5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe6e5('0x5'));var controller=require(_0xe6e5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe6e5('0x7')]);router['get'](_0xe6e5('0x8'),auth[_0xe6e5('0x9')](),controller[_0xe6e5('0xa')]);router[_0xe6e5('0xb')](_0xe6e5('0xc'),auth[_0xe6e5('0x9')](),controller[_0xe6e5('0xd')]);router['get'](_0xe6e5('0xe'),auth['isAuthenticated'](),controller[_0xe6e5('0xf')]);router['get'](_0xe6e5('0x10'),auth['isAuthenticated'](),timeout(_0xe6e5('0x11')),controller[_0xe6e5('0x12')]);router[_0xe6e5('0x13')]('/',auth['isAuthenticated'](),controller[_0xe6e5('0x14')]);router[_0xe6e5('0x13')](_0xe6e5('0x15'),auth[_0xe6e5('0x9')](),controller[_0xe6e5('0x16')]);router[_0xe6e5('0x17')]('/:id',auth[_0xe6e5('0x9')](),controller[_0xe6e5('0x18')]);router[_0xe6e5('0x19')](_0xe6e5('0x8'),auth[_0xe6e5('0x9')](),controller['destroy']);module[_0xe6e5('0x1a')]=router;
\ No newline at end of file
+var _0x4bb0=['/:id/sessions','getSessions','getAnswers','/:id/summary','getSummary','post','create','/:id/clone','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show'];(function(_0x1c423a,_0x4423ce){var _0x374fd3=function(_0x7f61b5){while(--_0x7f61b5){_0x1c423a['push'](_0x1c423a['shift']());}};_0x374fd3(++_0x4423ce);}(_0x4bb0,0x73));var _0x04bb=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x4bb0[_0x1ae4a9];return _0x54d0b0;};'use strict';var multer=require(_0x04bb('0x0'));var util=require(_0x04bb('0x1'));var path=require(_0x04bb('0x2'));var timeout=require(_0x04bb('0x3'));var express=require(_0x04bb('0x4'));var router=express[_0x04bb('0x5')]();var auth=require(_0x04bb('0x6'));var interaction=require(_0x04bb('0x7'));var config=require(_0x04bb('0x8'));var controller=require(_0x04bb('0x9'));router[_0x04bb('0xa')]('/',auth['isAuthenticated'](),controller[_0x04bb('0xb')]);router[_0x04bb('0xa')](_0x04bb('0xc'),auth[_0x04bb('0xd')](),controller[_0x04bb('0xe')]);router[_0x04bb('0xa')](_0x04bb('0xf'),auth[_0x04bb('0xd')](),controller[_0x04bb('0x10')]);router['get']('/:id/answers',auth['isAuthenticated'](),controller[_0x04bb('0x11')]);router[_0x04bb('0xa')](_0x04bb('0x12'),auth[_0x04bb('0xd')](),timeout('30s'),controller[_0x04bb('0x13')]);router[_0x04bb('0x14')]('/',auth['isAuthenticated'](),controller[_0x04bb('0x15')]);router[_0x04bb('0x14')](_0x04bb('0x16'),auth[_0x04bb('0xd')](),controller['clone']);router[_0x04bb('0x17')](_0x04bb('0xc'),auth[_0x04bb('0xd')](),controller['update']);router['delete'](_0x04bb('0xc'),auth[_0x04bb('0xd')](),controller[_0x04bb('0x18')]);module[_0x04bb('0x19')]=router;
\ No newline at end of file
index 907b3ea..682afb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66d3=['description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x20c064,_0x383ee1){var _0x4af7fc=function(_0x338a5d){while(--_0x338a5d){_0x20c064['push'](_0x20c064['shift']());}};_0x4af7fc(++_0x383ee1);}(_0x66d3,0x16a));var _0x366d=function(_0x55f4e5,_0x1d34a8){_0x55f4e5=_0x55f4e5-0x0;var _0x5b67b3=_0x66d3[_0x55f4e5];return _0x5b67b3;};'use strict';var Sequelize=require(_0x366d('0x0'));var _=require(_0x366d('0x1'));var util=require(_0x366d('0x2'));module[_0x366d('0x3')]={'name':{'type':Sequelize[_0x366d('0x4')],'unique':_0x366d('0x5')},'description':{'type':Sequelize[_0x366d('0x4')]},'formData':{'type':Sequelize[_0x366d('0x6')](_0x366d('0x7')),'set':function(_0x25b194){if(_[_0x366d('0x8')](_0x25b194)){this[_0x366d('0x9')](_0x366d('0xa'),JSON[_0x366d('0xb')](_0x25b194));}else if(_[_0x366d('0xc')](_0x25b194)){this[_0x366d('0x9')]('formData',_0x25b194);}else{this['setDataValue']('formData',util[_0x366d('0xd')](_0x366d('0xe'),this['getDataValue'](_0x366d('0x5'))||'',this[_0x366d('0xf')](_0x366d('0x10'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x366d('0x11')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0189=['TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','description','BOOLEAN','sequelize','lodash','util','exports'];(function(_0x3b3d1e,_0x5cefe8){var _0x579c1b=function(_0x7e22dd){while(--_0x7e22dd){_0x3b3d1e['push'](_0x3b3d1e['shift']());}};_0x579c1b(++_0x5cefe8);}(_0x0189,0x14c));var _0x9018=function(_0x52b031,_0x219660){_0x52b031=_0x52b031-0x0;var _0x653520=_0x0189[_0x52b031];return _0x653520;};'use strict';var Sequelize=require(_0x9018('0x0'));var _=require(_0x9018('0x1'));var util=require(_0x9018('0x2'));module[_0x9018('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x9018('0x4')](_0x9018('0x5')),'set':function(_0x15bee6){if(_[_0x9018('0x6')](_0x15bee6)){this[_0x9018('0x7')]('formData',JSON[_0x9018('0x8')](_0x15bee6));}else if(_[_0x9018('0x9')](_0x15bee6)){this[_0x9018('0x7')](_0x9018('0xa'),_0x15bee6);}else{this[_0x9018('0x7')]('formData',util[_0x9018('0xb')](_0x9018('0xc'),this['getDataValue'](_0x9018('0xd'))||'',this['getDataValue'](_0x9018('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9018('0xf')],'defaultValue':!![]}};
\ No newline at end of file
index ed7f4c4..b86126b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefc3=['create','user','role','UserProfileSection','userProfileId','autoAssociation','createdAt','omit','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','pick','ProjectId','JscriptyAnswerReport','indexOf','toString','getSummary','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','day','add','merge','where','filter','map','key','VIRTUAL','field','options','JscriptyProject','includeAll','include','findAll','rows','show','params','length','find','catch'];(function(_0x3c8343,_0x15ce71){var _0xed5e88=function(_0x91e56d){while(--_0x91e56d){_0x3c8343['push'](_0x3c8343['shift']());}};_0xed5e88(++_0x15ce71);}(_0xefc3,0x10a));var _0x3efc=function(_0x275c10,_0x5eaade){_0x275c10=_0x275c10-0x0;var _0x5ab401=_0xefc3[_0x275c10];return _0x5ab401;};'use strict';var pdf=require(_0x3efc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3efc('0x1'));var zipdir=require(_0x3efc('0x2'));var jsonpatch=require(_0x3efc('0x3'));var rp=require(_0x3efc('0x4'));var moment=require(_0x3efc('0x5'));var BPromise=require(_0x3efc('0x6'));var Mustache=require(_0x3efc('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3efc('0x8'));var csv=require(_0x3efc('0x9'));var ejs=require(_0x3efc('0xa'));var fs=require('fs');var _=require(_0x3efc('0xb'));var squel=require(_0x3efc('0xc'));var crypto=require('crypto');var jsforce=require(_0x3efc('0xd'));var deskjs=require(_0x3efc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3efc('0xf'));var Papa=require(_0x3efc('0x10'));var Redis=require(_0x3efc('0x11'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x3efc('0x12'));var config=require(_0x3efc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3af132,_0x5bcd0d){_0x5bcd0d=_0x5bcd0d||0xcc;return function(_0x16ca04){if(_0x16ca04){return _0x3af132[_0x3efc('0x14')](_0x5bcd0d);}return _0x3af132['status'](_0x5bcd0d)[_0x3efc('0x15')]();};}function respondWithResult(_0x39fecc,_0x39285d){_0x39285d=_0x39285d||0xc8;return function(_0x5b134d){if(_0x5b134d){return _0x39fecc['status'](_0x39285d)[_0x3efc('0x16')](_0x5b134d);}};}function respondWithFilteredResult(_0x2c9491,_0x86fe28){return function(_0x457d79){if(_0x457d79){var _0x263572=_0x457d79[_0x3efc('0x17')],_0x38e333=_0x86fe28['offset'],_0xc3a4eb=_0x86fe28[_0x3efc('0x18')]+_0x86fe28[_0x3efc('0x19')],_0x377f8d;if(_0xc3a4eb>=_0x263572){_0xc3a4eb=_0x263572;_0x377f8d=0xc8;}else{_0x377f8d=0xce;}_0x2c9491[_0x3efc('0x1a')](_0x377f8d);return _0x2c9491[_0x3efc('0x1b')](_0x3efc('0x1c'),_0x38e333+'-'+_0xc3a4eb+'/'+_0x263572)['json'](_0x457d79);}return null;};}function patchUpdates(_0x4601d1){return function(_0x5af3d7){try{jsonpatch[_0x3efc('0x1d')](_0x5af3d7,_0x4601d1,!![]);}catch(_0x62767f){return BPromise[_0x3efc('0x1e')](_0x62767f);}return _0x5af3d7[_0x3efc('0x1f')]();};}function saveUpdates(_0x222a45,_0x5ef4dc){return function(_0x580e44){if(_0x580e44){return _0x580e44[_0x3efc('0x20')](_0x222a45)['then'](function(_0x44ee5f){return _0x44ee5f;});}return null;};}function removeEntity(_0x1bc7be,_0x4087d8){return function(_0x438cce){if(_0x438cce){return _0x438cce['destroy']()[_0x3efc('0x21')](function(){var _0x2d1300=_0x438cce[_0x3efc('0x22')]({'plain':!![]});var _0x1a5cd7='Projects';return db[_0x3efc('0x23')][_0x3efc('0x24')]({'where':{'type':_0x1a5cd7,'resourceId':_0x2d1300['id']}})[_0x3efc('0x21')](function(){return _0x438cce;});})['then'](function(){_0x1bc7be[_0x3efc('0x1a')](0xcc)[_0x3efc('0x15')]();});}};}function handleEntityNotFound(_0x4db554,_0x2b6d9e){return function(_0x583f47){if(!_0x583f47){_0x4db554[_0x3efc('0x14')](0x194);}return _0x583f47;};}function handleError(_0x20e9f0,_0x3457cb){_0x3457cb=_0x3457cb||0x1f4;return function(_0x311bc3){logger[_0x3efc('0x25')](_0x311bc3[_0x3efc('0x26')]);if(_0x311bc3[_0x3efc('0x27')]){delete _0x311bc3[_0x3efc('0x27')];}_0x20e9f0['status'](_0x3457cb)[_0x3efc('0x28')](_0x311bc3);};}exports[_0x3efc('0x29')]=function(_0x23ce3a,_0x1439a1){var _0x5cc833={},_0x69f289={},_0x24b6b8={'count':0x0,'rows':[]};var _0x20680b=db['JscriptyProject'][_0x3efc('0x2a')];_0x69f289['model']=_[_0x3efc('0x2b')](_0x20680b);var _0x426c6b={'dateStart':_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x2d')],'dateEnd':_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x2e')]};delete _0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x2d')];delete _0x23ce3a['query']['dateEnd'];_0x69f289[_0x3efc('0x2c')]=_['keys'](_0x23ce3a[_0x3efc('0x2c')]);_0x69f289[_0x3efc('0x2f')]=_[_0x3efc('0x30')](_0x69f289[_0x3efc('0x31')],_0x69f289[_0x3efc('0x2c')]);_0x5cc833[_0x3efc('0x32')]=_[_0x3efc('0x30')](_0x69f289['model'],qs[_0x3efc('0x33')](_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x33')]));_0x5cc833[_0x3efc('0x32')]=_0x5cc833[_0x3efc('0x32')]['length']?_0x5cc833['attributes']:_0x69f289[_0x3efc('0x31')];if(!_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x34')](_0x3efc('0x35'))){_0x5cc833[_0x3efc('0x19')]=qs[_0x3efc('0x19')](_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x19')]);_0x5cc833[_0x3efc('0x18')]=qs[_0x3efc('0x18')](_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x18')]);}_0x5cc833[_0x3efc('0x36')]=qs[_0x3efc('0x37')](_0x23ce3a['query'][_0x3efc('0x37')]);_0x5cc833['where']=qs[_0x3efc('0x2f')](_['pick'](_0x23ce3a[_0x3efc('0x2c')],_0x69f289[_0x3efc('0x2f')]));if(_0x426c6b['dateStart']){if(_0x426c6b['dateEnd']){_0x426c6b[_0x3efc('0x2e')]=moment(_0x426c6b[_0x3efc('0x2e')])['add'](0x1,_0x3efc('0x38'));}else{_0x426c6b['dateEnd']=moment(_0x426c6b[_0x3efc('0x2d')])[_0x3efc('0x39')](0x1,'day');}_[_0x3efc('0x3a')](_0x5cc833[_0x3efc('0x3b')],{'createdAt':{'$gte':_0x426c6b[_0x3efc('0x2d')],'$lte':_0x426c6b[_0x3efc('0x2e')]}});}if(_0x23ce3a['query'][_0x3efc('0x3c')]){_0x5cc833[_0x3efc('0x3b')]=_[_0x3efc('0x3a')](_0x5cc833['where'],{'$or':_[_0x3efc('0x3d')](_0x20680b,function(_0x37e7d6){if(_0x37e7d6['type'][_0x3efc('0x3e')]!==_0x3efc('0x3f')){var _0x45bfcb={};_0x45bfcb[_0x37e7d6[_0x3efc('0x40')]]={'$like':'%'+_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x3c')]+'%'};return _0x45bfcb;}})});}_0x5cc833=_['merge']({},_0x5cc833,_0x23ce3a[_0x3efc('0x41')]);var _0x4828ae={'where':_0x5cc833[_0x3efc('0x3b')]};return db[_0x3efc('0x42')][_0x3efc('0x17')](_0x4828ae)[_0x3efc('0x21')](function(_0x1f305e){_0x24b6b8[_0x3efc('0x17')]=_0x1f305e;if(_0x23ce3a[_0x3efc('0x2c')][_0x3efc('0x43')]){_0x5cc833[_0x3efc('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x3efc('0x45')](_0x5cc833);})[_0x3efc('0x21')](function(_0x50807e){_0x24b6b8[_0x3efc('0x46')]=_0x50807e;return _0x24b6b8;})[_0x3efc('0x21')](respondWithFilteredResult(_0x1439a1,_0x5cc833))['catch'](handleError(_0x1439a1,null));};exports[_0x3efc('0x47')]=function(_0xb06b96,_0x636d6d){var _0x2f6f05={'raw':![],'where':{'id':_0xb06b96[_0x3efc('0x48')]['id']}},_0x16a48b={};_0x16a48b['model']=_[_0x3efc('0x2b')](db[_0x3efc('0x42')][_0x3efc('0x2a')]);_0x16a48b['query']=_[_0x3efc('0x2b')](_0xb06b96[_0x3efc('0x2c')]);_0x16a48b[_0x3efc('0x2f')]=_[_0x3efc('0x30')](_0x16a48b[_0x3efc('0x31')],_0x16a48b['query']);_0x2f6f05[_0x3efc('0x32')]=_[_0x3efc('0x30')](_0x16a48b[_0x3efc('0x31')],qs['fields'](_0xb06b96['query'][_0x3efc('0x33')]));_0x2f6f05['attributes']=_0x2f6f05[_0x3efc('0x32')][_0x3efc('0x49')]?_0x2f6f05[_0x3efc('0x32')]:_0x16a48b[_0x3efc('0x31')];if(_0xb06b96['query'][_0x3efc('0x43')]){_0x2f6f05[_0x3efc('0x44')]=[{'all':!![]}];}_0x2f6f05=_['merge']({},_0x2f6f05,_0xb06b96[_0x3efc('0x41')]);return db[_0x3efc('0x42')][_0x3efc('0x4a')](_0x2f6f05)[_0x3efc('0x21')](handleEntityNotFound(_0x636d6d,null))[_0x3efc('0x21')](respondWithResult(_0x636d6d,null))[_0x3efc('0x4b')](handleError(_0x636d6d,null));};exports[_0x3efc('0x4c')]=function(_0x3377ed,_0x350d2e){return db[_0x3efc('0x42')][_0x3efc('0x4c')](_0x3377ed['body'],{})[_0x3efc('0x21')](function(_0x4b2a23){var _0x32cd55=_0x3377ed[_0x3efc('0x4d')][_0x3efc('0x22')]({'plain':!![]});if(!_0x32cd55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32cd55[_0x3efc('0x4e')]===_0x3efc('0x4d')){var _0x330f51=_0x4b2a23[_0x3efc('0x22')]({'plain':!![]});var _0x3a518a='Projects';return db[_0x3efc('0x4f')][_0x3efc('0x4a')]({'where':{'name':_0x3a518a,'userProfileId':_0x32cd55[_0x3efc('0x50')]},'raw':!![]})[_0x3efc('0x21')](function(_0x358eb9){if(_0x358eb9&&_0x358eb9[_0x3efc('0x51')]===0x0){return db[_0x3efc('0x23')][_0x3efc('0x4c')]({'name':_0x330f51[_0x3efc('0x27')],'resourceId':_0x330f51['id'],'type':_0x358eb9[_0x3efc('0x27')],'sectionId':_0x358eb9['id']},{})[_0x3efc('0x21')](function(){return _0x4b2a23;});}else{return _0x4b2a23;}})[_0x3efc('0x4b')](function(_0x12185e){logger[_0x3efc('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12185e);throw _0x12185e;});}return _0x4b2a23;})['then'](respondWithResult(_0x350d2e,0xc9))['catch'](handleError(_0x350d2e,null));};exports['clone']=function(_0x5f1c66,_0x172b14){var _0x136579={'raw':![],'where':{'id':_0x5f1c66['params']['id']}},_0x275a00={};_0x275a00['model']=_[_0x3efc('0x2b')](db['JscriptyProject'][_0x3efc('0x2a')]);_0x136579[_0x3efc('0x32')]=_[_0x3efc('0x30')](_0x275a00[_0x3efc('0x31')],qs[_0x3efc('0x33')](_0x5f1c66['query']['fields']));_0x136579[_0x3efc('0x32')]=_0x136579[_0x3efc('0x32')][_0x3efc('0x49')]?_0x136579[_0x3efc('0x32')]:_0x275a00[_0x3efc('0x31')];if(_0x5f1c66[_0x3efc('0x2c')]['includeAll']){_0x136579[_0x3efc('0x44')]=[{'all':!![]}];}_0x136579=_[_0x3efc('0x3a')]({},_0x136579,_0x5f1c66['options']);return db[_0x3efc('0x42')][_0x3efc('0x4a')](_0x136579)[_0x3efc('0x21')](handleEntityNotFound(_0x172b14,null))['then'](function(_0x3d6686){if(_0x3d6686){var _0x344f9e=_0x3d6686[_0x3efc('0x22')]({'plain':!![]});_0x344f9e=qs['omit'](_0x344f9e,['id',_0x3efc('0x52'),'updatedAt']);_0x5f1c66['body']=_[_0x3efc('0x53')](_0x5f1c66['body'],['id',_0x3efc('0x52'),_0x3efc('0x54')]);return db[_0x3efc('0x42')][_0x3efc('0x4c')](_[_0x3efc('0x3a')](_0x344f9e,_0x5f1c66[_0x3efc('0x55')]),{'include':_0x5f1c66[_0x3efc('0x2c')][_0x3efc('0x43')]?[{'all':!![]}]:undefined})[_0x3efc('0x21')](function(_0x51e398){var _0x467ce7=_0x5f1c66[_0x3efc('0x4d')]['get']({'plain':!![]});if(!_0x467ce7)throw new Error(_0x3efc('0x56'));if(_0x467ce7[_0x3efc('0x4e')]==='user'){var _0x46ed4d=_0x51e398[_0x3efc('0x22')]({'plain':!![]});var _0x1c3860='Projects';return db['UserProfileSection'][_0x3efc('0x4a')]({'where':{'name':_0x1c3860,'userProfileId':_0x467ce7[_0x3efc('0x50')]},'raw':!![]})[_0x3efc('0x21')](function(_0x5e0244){if(_0x5e0244&&_0x5e0244[_0x3efc('0x51')]===0x0){return db[_0x3efc('0x23')][_0x3efc('0x4c')]({'name':_0x46ed4d[_0x3efc('0x27')],'resourceId':_0x46ed4d['id'],'type':_0x5e0244[_0x3efc('0x27')],'sectionId':_0x5e0244['id']},{})['then'](function(){return _0x51e398;});}else{return _0x51e398;}})[_0x3efc('0x4b')](function(_0x4d1101){logger['error'](_0x3efc('0x57'),_0x4d1101);throw _0x4d1101;});}return _0x51e398;});}})['then'](respondWithResult(_0x172b14,0xc9))[_0x3efc('0x4b')](handleError(_0x172b14,null));};exports[_0x3efc('0x20')]=function(_0x2d0cb8,_0x15613f){if(_0x2d0cb8[_0x3efc('0x55')]['id']){delete _0x2d0cb8['body']['id'];}return db[_0x3efc('0x42')][_0x3efc('0x4a')]({'where':{'id':_0x2d0cb8['params']['id']}})[_0x3efc('0x21')](handleEntityNotFound(_0x15613f,null))[_0x3efc('0x21')](saveUpdates(_0x2d0cb8[_0x3efc('0x55')],null))[_0x3efc('0x21')](respondWithResult(_0x15613f,null))[_0x3efc('0x4b')](handleError(_0x15613f,null));};exports[_0x3efc('0x24')]=function(_0x37c44d,_0x371d05){return db[_0x3efc('0x42')][_0x3efc('0x4a')]({'where':{'id':_0x37c44d[_0x3efc('0x48')]['id']}})[_0x3efc('0x21')](handleEntityNotFound(_0x371d05,null))['then'](removeEntity(_0x371d05,null))['catch'](handleError(_0x371d05,null));};exports[_0x3efc('0x58')]=function(_0x140125,_0x3ed2ab,_0x273e08){var _0x36ee74={'raw':!![],'where':{}};var _0x512de4={};var _0x1fd9f5={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x3efc('0x59')]({'where':{'id':_0x140125[_0x3efc('0x48')]['id']}})[_0x3efc('0x21')](handleEntityNotFound(_0x3ed2ab,null))[_0x3efc('0x21')](function(_0x15d708){if(_0x15d708){_0x512de4[_0x3efc('0x31')]=_['keys'](db[_0x3efc('0x5a')][_0x3efc('0x2a')]);_0x512de4[_0x3efc('0x2c')]=_[_0x3efc('0x2b')](_0x140125[_0x3efc('0x2c')]);_0x512de4['filters']=_['intersection'](_0x512de4[_0x3efc('0x31')],_0x512de4[_0x3efc('0x2c')]);_0x36ee74[_0x3efc('0x32')]=_[_0x3efc('0x30')](_0x512de4[_0x3efc('0x31')],qs[_0x3efc('0x33')](_0x140125[_0x3efc('0x2c')][_0x3efc('0x33')]));_0x36ee74[_0x3efc('0x32')]=_0x36ee74[_0x3efc('0x32')][_0x3efc('0x49')]?_0x36ee74['attributes']:_0x512de4[_0x3efc('0x31')];if(!_0x140125[_0x3efc('0x2c')][_0x3efc('0x34')](_0x3efc('0x35'))){_0x36ee74[_0x3efc('0x19')]=qs[_0x3efc('0x19')](_0x140125[_0x3efc('0x2c')][_0x3efc('0x19')]);_0x36ee74['offset']=qs[_0x3efc('0x18')](_0x140125['query'][_0x3efc('0x18')]);}_0x36ee74[_0x3efc('0x36')]=qs[_0x3efc('0x37')](_0x140125[_0x3efc('0x2c')][_0x3efc('0x37')]);_0x36ee74['where']=qs[_0x3efc('0x2f')](_[_0x3efc('0x5b')](_0x140125['query'],_0x512de4[_0x3efc('0x2f')]));_0x36ee74[_0x3efc('0x3b')][_0x3efc('0x5c')]=_0x15d708['id'];if(_0x140125[_0x3efc('0x2c')][_0x3efc('0x3c')]){_0x36ee74['where']=_['merge'](_0x36ee74[_0x3efc('0x3b')],{'$or':_[_0x3efc('0x3d')](_0x36ee74[_0x3efc('0x32')],function(_0x192dad){var _0x301364={};_0x301364[_0x192dad]={'$like':'%'+_0x140125[_0x3efc('0x2c')]['filter']+'%'};return _0x301364;})});}_0x36ee74=_[_0x3efc('0x3a')]({},_0x36ee74,_0x140125[_0x3efc('0x41')]);return db[_0x3efc('0x5a')][_0x3efc('0x17')]({'where':_0x36ee74[_0x3efc('0x3b')]})[_0x3efc('0x21')](function(_0x57f9fb){_0x1fd9f5['count']=_0x57f9fb;if(_0x140125[_0x3efc('0x2c')]['includeAll']){_0x36ee74[_0x3efc('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x36ee74);})[_0x3efc('0x21')](function(_0x1377a7){_0x1fd9f5[_0x3efc('0x46')]=_0x1377a7;return _0x1fd9f5;});}})[_0x3efc('0x21')](respondWithFilteredResult(_0x3ed2ab,_0x36ee74))[_0x3efc('0x4b')](handleError(_0x3ed2ab,null));};exports['getAnswers']=function(_0x34b218,_0x544773,_0x2551d6){var _0x3cf044={'raw':!![],'where':{}};var _0x22c19c={};var _0x47414c={'count':0x0,'rows':[]};var _0x3f9f05={'dateStart':_0x34b218[_0x3efc('0x2c')][_0x3efc('0x2d')],'dateEnd':_0x34b218[_0x3efc('0x2c')]['dateEnd']};delete _0x34b218['query'][_0x3efc('0x2d')];delete _0x34b218['query']['dateEnd'];return db[_0x3efc('0x42')][_0x3efc('0x59')]({'where':{'id':_0x34b218['params']['id']}})[_0x3efc('0x21')](handleEntityNotFound(_0x544773,null))[_0x3efc('0x21')](function(_0x35fc3d){if(_0x35fc3d){_0x22c19c[_0x3efc('0x31')]=_[_0x3efc('0x2b')](db[_0x3efc('0x5d')][_0x3efc('0x2a')]);_0x22c19c[_0x3efc('0x2c')]=_[_0x3efc('0x2b')](_0x34b218[_0x3efc('0x2c')]);_0x22c19c[_0x3efc('0x2f')]=_[_0x3efc('0x30')](_0x22c19c[_0x3efc('0x31')],_0x22c19c['query']);_0x3cf044['attributes']=_[_0x3efc('0x30')](_0x22c19c[_0x3efc('0x31')],qs['fields'](_0x34b218[_0x3efc('0x2c')][_0x3efc('0x33')]));_0x3cf044['attributes']=_0x3cf044[_0x3efc('0x32')][_0x3efc('0x49')]?_0x3cf044[_0x3efc('0x32')]:_0x22c19c['model'];if(!_0x34b218[_0x3efc('0x2c')]['hasOwnProperty'](_0x3efc('0x35'))){_0x3cf044[_0x3efc('0x19')]=qs[_0x3efc('0x19')](_0x34b218['query'][_0x3efc('0x19')]);_0x3cf044['offset']=qs['offset'](_0x34b218[_0x3efc('0x2c')][_0x3efc('0x18')]);}_0x3cf044['order']=qs[_0x3efc('0x37')](_0x34b218['query']['sort']);_0x3cf044[_0x3efc('0x3b')]=qs[_0x3efc('0x2f')](_[_0x3efc('0x5b')](_0x34b218[_0x3efc('0x2c')],_0x22c19c['filters']));_0x3cf044[_0x3efc('0x3b')][_0x3efc('0x5c')]=_0x35fc3d['id'];if(_0x3f9f05['dateStart']){if(_0x3f9f05[_0x3efc('0x2e')]){_0x3f9f05['dateEnd']=moment(_0x3f9f05['dateEnd'])[_0x3efc('0x39')](0x1,_0x3efc('0x38'));}else{_0x3f9f05[_0x3efc('0x2e')]=moment(_0x3f9f05['dateStart'])[_0x3efc('0x39')](0x1,_0x3efc('0x38'));}_['merge'](_0x3cf044[_0x3efc('0x3b')],{'createdAt':{'$gte':_0x3f9f05[_0x3efc('0x2d')],'$lte':_0x3f9f05[_0x3efc('0x2e')]}});}if(_0x34b218[_0x3efc('0x2c')][_0x3efc('0x3c')]){_0x3cf044[_0x3efc('0x3b')]=_[_0x3efc('0x3a')](_0x3cf044[_0x3efc('0x3b')],{'$or':_[_0x3efc('0x3d')](_0x3cf044[_0x3efc('0x32')],function(_0x1a07a8){var _0x3f8ad0={};_0x3f8ad0[_0x1a07a8]={'$like':'%'+_0x34b218[_0x3efc('0x2c')][_0x3efc('0x3c')]+'%'};return _0x3f8ad0;})});}_0x3cf044=_[_0x3efc('0x3a')]({},_0x3cf044,_0x34b218['options']);return db[_0x3efc('0x5d')][_0x3efc('0x17')]({'where':_0x3cf044[_0x3efc('0x3b')]})[_0x3efc('0x21')](function(_0x282c62){_0x47414c['count']=_0x282c62;if(_0x34b218[_0x3efc('0x2c')][_0x3efc('0x43')]){_0x3cf044[_0x3efc('0x44')]=[{'all':!![]}];}return db[_0x3efc('0x5d')][_0x3efc('0x45')](_0x3cf044);})[_0x3efc('0x21')](function(_0x2efb8c){_0x47414c[_0x3efc('0x46')]=_0x2efb8c;return _0x47414c;});}})[_0x3efc('0x21')](respondWithFilteredResult(_0x544773,_0x3cf044))[_0x3efc('0x4b')](handleError(_0x544773,null));};function char(_0x5aff2a){return'number'===typeof _0x5aff2a?String['fromCharCode'][_0x3efc('0x1d')](null,arguments):_0x5aff2a;}function needsEncapsulation(_0x1a3972){return!!_0x1a3972&&(_0x1a3972['toString']()[_0x3efc('0x5e')](char(0xd))>=0x0||_0x1a3972[_0x3efc('0x5f')]()[_0x3efc('0x5e')](char(0xa))>=0x0||_0x1a3972[_0x3efc('0x5f')]()[_0x3efc('0x5e')](char(0x2c))>=0x0||_0x1a3972['toString']()[_0x3efc('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x18f112){var _0x22fd17=char(0x22),_0x3beed3='\x5c'+char(0x22),_0x15b998=_0x18f112[_0x3efc('0x5f')]()['replace'](new RegExp(_0x22fd17,'g'),_0x3beed3);return _0x22fd17+_0x15b998+_0x22fd17;}exports[_0x3efc('0x60')]=function(_0x543677,_0x22a18f,_0x2d433f){var _0x39d214,_0x24dd47;var _0x488a29={'dateStart':_0x543677['query'][_0x3efc('0x2d')],'dateEnd':_0x543677[_0x3efc('0x2c')]['dateEnd']};delete _0x543677[_0x3efc('0x2c')]['dateStart'];delete _0x543677[_0x3efc('0x2c')][_0x3efc('0x2e')];if(_0x488a29[_0x3efc('0x2d')]){if(_0x488a29[_0x3efc('0x2e')]){_0x488a29[_0x3efc('0x2e')]=moment(_0x488a29['dateEnd'])[_0x3efc('0x39')](0x1,_0x3efc('0x38'));}else{_0x488a29[_0x3efc('0x2e')]=moment(_0x488a29['dateStart'])[_0x3efc('0x39')](0x1,_0x3efc('0x38'));}}return db[_0x3efc('0x5a')][_0x3efc('0x45')]({'where':{'ProjectId':_0x543677[_0x3efc('0x48')]['id'],'starttime':{'$gte':_0x488a29[_0x3efc('0x2d')],'$lte':_0x488a29[_0x3efc('0x2e')]}}})['then'](handleEntityNotFound(_0x22a18f,null))[_0x3efc('0x21')](function(_0x52ddf5){if(_0x52ddf5){_0x39d214=_0x52ddf5;return db['JscriptyQuestionReport'][_0x3efc('0x45')]({'where':{'SessionId':{'$in':_[_0x3efc('0x3d')](_0x39d214,'id')},'ProjectId':_0x543677[_0x3efc('0x48')]['id']},'order':_0x3efc('0x61')});}})[_0x3efc('0x21')](handleEntityNotFound(_0x22a18f,null))[_0x3efc('0x21')](function(_0x513785){if(_0x513785){_0x24dd47=_0x513785;var _0x49f6cf={};for(var _0x1ada55=0x0,_0x3ef01a=_0x24dd47[_0x3efc('0x49')];_0x1ada55<_0x3ef01a;_0x1ada55++){if(!_0x49f6cf[_0x3efc('0x34')](_0x24dd47[_0x1ada55][_0x3efc('0x62')])){_0x49f6cf[_0x24dd47[_0x1ada55][_0x3efc('0x62')]]=needsEncapsulation(_0x24dd47[_0x1ada55][_0x3efc('0x63')])?encapsulate(_0x24dd47[_0x1ada55][_0x3efc('0x63')]):_0x24dd47[_0x1ada55]['question'];}}var _0x15f4ba=[],_0x11ecb6={};for(var _0x30eed8=0x0,_0x33f57f=_0x39d214[_0x3efc('0x49')];_0x30eed8<_0x33f57f;_0x30eed8++){_0x11ecb6={'ProjectId':_0x543677[_0x3efc('0x48')]['id'],'SessionId':_0x39d214[_0x30eed8]['id'],'StartTime':moment(_0x39d214[_0x30eed8][_0x3efc('0x64')])[_0x3efc('0x65')](_0x3efc('0x66'))};for(var _0x51ed65=0x0,_0x8637d0=_0x24dd47[_0x3efc('0x49')];_0x51ed65<_0x8637d0;_0x51ed65++){if(_0x24dd47[_0x51ed65][_0x3efc('0x67')]==_0x39d214[_0x30eed8]['id']&&_0x49f6cf[_0x3efc('0x34')](_0x24dd47[_0x51ed65][_0x3efc('0x62')])){_0x11ecb6[_0x49f6cf[_0x24dd47[_0x51ed65][_0x3efc('0x62')]]]=_0x24dd47[_0x51ed65]['answer'];}}for(var _0x31b363 in _0x49f6cf){if(!_0x11ecb6[_0x3efc('0x34')](_0x49f6cf[_0x31b363])){_0x11ecb6[_0x49f6cf[_0x31b363]]=null;}}_0x15f4ba['push'](_0x11ecb6);}return _0x15f4ba;}})['then'](function(_0x2317f3){if(!_['isEmpty'](_0x2317f3)){var _0x332e3f=toCsv(_0x2317f3);var _0x2adedb=Date[_0x3efc('0x68')]();fs[_0x3efc('0x69')](util[_0x3efc('0x65')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x543677[_0x3efc('0x48')]['id'],_0x2adedb),_0x332e3f);_0x22a18f[_0x3efc('0x6a')](_0x3efc('0x6b'),_0x3efc('0x6c')+util[_0x3efc('0x65')](_0x3efc('0x6d'),_0x543677[_0x3efc('0x48')]['id'],_0x2adedb));_0x22a18f['setHeader'](_0x3efc('0x6e'),_0x3efc('0x6f'));return _0x22a18f[_0x3efc('0x70')](util[_0x3efc('0x65')](_0x3efc('0x71'),_0x543677[_0x3efc('0x48')]['id'],_0x2adedb));}else{return _0x22a18f[_0x3efc('0x14')](0xcc);}})[_0x3efc('0x4b')](handleError(_0x22a18f,null));};
\ No newline at end of file
+var _0xf79f=['YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','download','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','Projects','UserProfileResource','error','name','send','JscriptyProject','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','where','filter','merge','map','type','key','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','createdAt','updatedAt','omit','user','userProfileId','update','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','findAll','fromCharCode','apply','toString','indexOf','replace','getSummary','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format'];(function(_0x52ced7,_0x33f680){var _0xde7fb=function(_0x594a6d){while(--_0x594a6d){_0x52ced7['push'](_0x52ced7['shift']());}};_0xde7fb(++_0x33f680);}(_0xf79f,0x1e2));var _0xff79=function(_0x589274,_0xa3f1bd){_0x589274=_0x589274-0x0;var _0x21814b=_0xf79f[_0x589274];return _0x21814b;};'use strict';var pdf=require(_0xff79('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xff79('0x1'));var zipdir=require(_0xff79('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff79('0x3'));var moment=require(_0xff79('0x4'));var BPromise=require(_0xff79('0x5'));var Mustache=require(_0xff79('0x6'));var util=require(_0xff79('0x7'));var path=require(_0xff79('0x8'));var sox=require('sox');var csv=require(_0xff79('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xff79('0xa'));var squel=require('squel');var crypto=require(_0xff79('0xb'));var jsforce=require(_0xff79('0xc'));var deskjs=require(_0xff79('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff79('0xe'));var Redis=require(_0xff79('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xff79('0x10'))('api');var utils=require(_0xff79('0x11'));var config=require(_0xff79('0x12'));var db=require(_0xff79('0x13'))['db'];function respondWithStatusCode(_0x388a4c,_0x130974){_0x130974=_0x130974||0xcc;return function(_0x3fa576){if(_0x3fa576){return _0x388a4c[_0xff79('0x14')](_0x130974);}return _0x388a4c[_0xff79('0x15')](_0x130974)[_0xff79('0x16')]();};}function respondWithResult(_0x5cb863,_0x1dd605){_0x1dd605=_0x1dd605||0xc8;return function(_0x556620){if(_0x556620){return _0x5cb863['status'](_0x1dd605)[_0xff79('0x17')](_0x556620);}};}function respondWithFilteredResult(_0x22d62b,_0x3af2ac){return function(_0x2dbb3a){if(_0x2dbb3a){var _0x143367=_0x2dbb3a[_0xff79('0x18')],_0x5a3168=_0x3af2ac[_0xff79('0x19')],_0x1d0ce3=_0x3af2ac[_0xff79('0x19')]+_0x3af2ac[_0xff79('0x1a')],_0xd75761;if(_0x1d0ce3>=_0x143367){_0x1d0ce3=_0x143367;_0xd75761=0xc8;}else{_0xd75761=0xce;}_0x22d62b['status'](_0xd75761);return _0x22d62b[_0xff79('0x1b')](_0xff79('0x1c'),_0x5a3168+'-'+_0x1d0ce3+'/'+_0x143367)['json'](_0x2dbb3a);}return null;};}function patchUpdates(_0x21dd24){return function(_0x5c6bf8){try{jsonpatch['apply'](_0x5c6bf8,_0x21dd24,!![]);}catch(_0x23ec5f){return BPromise[_0xff79('0x1d')](_0x23ec5f);}return _0x5c6bf8[_0xff79('0x1e')]();};}function saveUpdates(_0x5e16fa,_0x1e4c51){return function(_0x3559c8){if(_0x3559c8){return _0x3559c8['update'](_0x5e16fa)['then'](function(_0x704b49){return _0x704b49;});}return null;};}function removeEntity(_0x247266,_0xb6ecfe){return function(_0x2ae125){if(_0x2ae125){return _0x2ae125[_0xff79('0x1f')]()[_0xff79('0x20')](function(){var _0xd16c2e=_0x2ae125['get']({'plain':!![]});var _0xf7382e=_0xff79('0x21');return db[_0xff79('0x22')][_0xff79('0x1f')]({'where':{'type':_0xf7382e,'resourceId':_0xd16c2e['id']}})['then'](function(){return _0x2ae125;});})[_0xff79('0x20')](function(){_0x247266[_0xff79('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172c7a,_0x2af934){return function(_0x267398){if(!_0x267398){_0x172c7a[_0xff79('0x14')](0x194);}return _0x267398;};}function handleError(_0x57b8aa,_0x52bedb){_0x52bedb=_0x52bedb||0x1f4;return function(_0x4254a2){logger[_0xff79('0x23')](_0x4254a2['stack']);if(_0x4254a2[_0xff79('0x24')]){delete _0x4254a2[_0xff79('0x24')];}_0x57b8aa['status'](_0x52bedb)[_0xff79('0x25')](_0x4254a2);};}exports['index']=function(_0x9d9a45,_0x14ad34){var _0x48d6e1={},_0x359c50={},_0x395a7a={'count':0x0,'rows':[]};var _0x59d90c=db[_0xff79('0x26')]['rawAttributes'];_0x359c50[_0xff79('0x27')]=_[_0xff79('0x28')](_0x59d90c);var _0x238907={'dateStart':_0x9d9a45['query'][_0xff79('0x29')],'dateEnd':_0x9d9a45[_0xff79('0x2a')][_0xff79('0x2b')]};delete _0x9d9a45[_0xff79('0x2a')][_0xff79('0x29')];delete _0x9d9a45[_0xff79('0x2a')][_0xff79('0x2b')];_0x359c50[_0xff79('0x2a')]=_[_0xff79('0x28')](_0x9d9a45[_0xff79('0x2a')]);_0x359c50[_0xff79('0x2c')]=_[_0xff79('0x2d')](_0x359c50['model'],_0x359c50[_0xff79('0x2a')]);_0x48d6e1[_0xff79('0x2e')]=_[_0xff79('0x2d')](_0x359c50['model'],qs['fields'](_0x9d9a45[_0xff79('0x2a')][_0xff79('0x2f')]));_0x48d6e1[_0xff79('0x2e')]=_0x48d6e1[_0xff79('0x2e')][_0xff79('0x30')]?_0x48d6e1[_0xff79('0x2e')]:_0x359c50[_0xff79('0x27')];if(!_0x9d9a45[_0xff79('0x2a')][_0xff79('0x31')](_0xff79('0x32'))){_0x48d6e1['limit']=qs[_0xff79('0x1a')](_0x9d9a45[_0xff79('0x2a')][_0xff79('0x1a')]);_0x48d6e1['offset']=qs[_0xff79('0x19')](_0x9d9a45[_0xff79('0x2a')][_0xff79('0x19')]);}_0x48d6e1[_0xff79('0x33')]=qs[_0xff79('0x34')](_0x9d9a45[_0xff79('0x2a')]['sort']);_0x48d6e1['where']=qs[_0xff79('0x2c')](_[_0xff79('0x35')](_0x9d9a45['query'],_0x359c50[_0xff79('0x2c')]));if(_0x238907['dateStart']){if(_0x238907[_0xff79('0x2b')]){_0x238907['dateEnd']=moment(_0x238907[_0xff79('0x2b')])[_0xff79('0x36')](0x1,_0xff79('0x37'));}else{_0x238907['dateEnd']=moment(_0x238907[_0xff79('0x29')])[_0xff79('0x36')](0x1,_0xff79('0x37'));}_['merge'](_0x48d6e1[_0xff79('0x38')],{'createdAt':{'$gte':_0x238907[_0xff79('0x29')],'$lte':_0x238907[_0xff79('0x2b')]}});}if(_0x9d9a45[_0xff79('0x2a')][_0xff79('0x39')]){_0x48d6e1[_0xff79('0x38')]=_[_0xff79('0x3a')](_0x48d6e1[_0xff79('0x38')],{'$or':_[_0xff79('0x3b')](_0x59d90c,function(_0x2108a3){if(_0x2108a3[_0xff79('0x3c')][_0xff79('0x3d')]!==_0xff79('0x3e')){var _0x544d9a={};_0x544d9a[_0x2108a3['field']]={'$like':'%'+_0x9d9a45[_0xff79('0x2a')][_0xff79('0x39')]+'%'};return _0x544d9a;}})});}_0x48d6e1=_[_0xff79('0x3a')]({},_0x48d6e1,_0x9d9a45[_0xff79('0x3f')]);var _0x17c2c8={'where':_0x48d6e1[_0xff79('0x38')]};return db[_0xff79('0x26')][_0xff79('0x18')](_0x17c2c8)[_0xff79('0x20')](function(_0x2db937){_0x395a7a[_0xff79('0x18')]=_0x2db937;if(_0x9d9a45[_0xff79('0x2a')]['includeAll']){_0x48d6e1['include']=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x48d6e1);})[_0xff79('0x20')](function(_0xa807dc){_0x395a7a[_0xff79('0x40')]=_0xa807dc;return _0x395a7a;})['then'](respondWithFilteredResult(_0x14ad34,_0x48d6e1))[_0xff79('0x41')](handleError(_0x14ad34,null));};exports[_0xff79('0x42')]=function(_0x240e05,_0x2c8374){var _0xfab0d9={'raw':![],'where':{'id':_0x240e05[_0xff79('0x43')]['id']}},_0x4a2bc1={};_0x4a2bc1['model']=_[_0xff79('0x28')](db[_0xff79('0x26')]['rawAttributes']);_0x4a2bc1[_0xff79('0x2a')]=_[_0xff79('0x28')](_0x240e05[_0xff79('0x2a')]);_0x4a2bc1['filters']=_['intersection'](_0x4a2bc1[_0xff79('0x27')],_0x4a2bc1['query']);_0xfab0d9[_0xff79('0x2e')]=_[_0xff79('0x2d')](_0x4a2bc1[_0xff79('0x27')],qs[_0xff79('0x2f')](_0x240e05[_0xff79('0x2a')]['fields']));_0xfab0d9[_0xff79('0x2e')]=_0xfab0d9[_0xff79('0x2e')][_0xff79('0x30')]?_0xfab0d9[_0xff79('0x2e')]:_0x4a2bc1[_0xff79('0x27')];if(_0x240e05['query'][_0xff79('0x44')]){_0xfab0d9[_0xff79('0x45')]=[{'all':!![]}];}_0xfab0d9=_[_0xff79('0x3a')]({},_0xfab0d9,_0x240e05[_0xff79('0x3f')]);return db[_0xff79('0x26')][_0xff79('0x46')](_0xfab0d9)[_0xff79('0x20')](handleEntityNotFound(_0x2c8374,null))['then'](respondWithResult(_0x2c8374,null))[_0xff79('0x41')](handleError(_0x2c8374,null));};exports[_0xff79('0x47')]=function(_0xfee73e,_0x1ec44d){return db['JscriptyProject'][_0xff79('0x47')](_0xfee73e[_0xff79('0x48')],{})[_0xff79('0x20')](function(_0x5c9508){var _0x454307=_0xfee73e['user']['get']({'plain':!![]});if(!_0x454307)throw new Error(_0xff79('0x49'));if(_0x454307[_0xff79('0x4a')]==='user'){var _0x29d921=_0x5c9508[_0xff79('0x4b')]({'plain':!![]});var _0x55ed63=_0xff79('0x21');return db['UserProfileSection'][_0xff79('0x46')]({'where':{'name':_0x55ed63,'userProfileId':_0x454307['userProfileId']},'raw':!![]})[_0xff79('0x20')](function(_0x175945){if(_0x175945&&_0x175945[_0xff79('0x4c')]===0x0){return db['UserProfileResource'][_0xff79('0x47')]({'name':_0x29d921[_0xff79('0x24')],'resourceId':_0x29d921['id'],'type':_0x175945[_0xff79('0x24')],'sectionId':_0x175945['id']},{})[_0xff79('0x20')](function(){return _0x5c9508;});}else{return _0x5c9508;}})[_0xff79('0x41')](function(_0x4fff7c){logger[_0xff79('0x23')](_0xff79('0x4d'),_0x4fff7c);throw _0x4fff7c;});}return _0x5c9508;})[_0xff79('0x20')](respondWithResult(_0x1ec44d,0xc9))[_0xff79('0x41')](handleError(_0x1ec44d,null));};exports[_0xff79('0x4e')]=function(_0x467e9b,_0x48540e){var _0x5f08f5={'raw':![],'where':{'id':_0x467e9b[_0xff79('0x43')]['id']}},_0x29f03c={};_0x29f03c['model']=_['keys'](db[_0xff79('0x26')][_0xff79('0x4f')]);_0x5f08f5[_0xff79('0x2e')]=_[_0xff79('0x2d')](_0x29f03c['model'],qs[_0xff79('0x2f')](_0x467e9b[_0xff79('0x2a')][_0xff79('0x2f')]));_0x5f08f5['attributes']=_0x5f08f5[_0xff79('0x2e')][_0xff79('0x30')]?_0x5f08f5[_0xff79('0x2e')]:_0x29f03c[_0xff79('0x27')];if(_0x467e9b['query'][_0xff79('0x44')]){_0x5f08f5[_0xff79('0x45')]=[{'all':!![]}];}_0x5f08f5=_[_0xff79('0x3a')]({},_0x5f08f5,_0x467e9b[_0xff79('0x3f')]);return db[_0xff79('0x26')][_0xff79('0x46')](_0x5f08f5)['then'](handleEntityNotFound(_0x48540e,null))['then'](function(_0x3a31cb){if(_0x3a31cb){var _0x2f7dc5=_0x3a31cb[_0xff79('0x4b')]({'plain':!![]});_0x2f7dc5=qs['omit'](_0x2f7dc5,['id',_0xff79('0x50'),_0xff79('0x51')]);_0x467e9b['body']=_[_0xff79('0x52')](_0x467e9b[_0xff79('0x48')],['id',_0xff79('0x50'),_0xff79('0x51')]);return db['JscriptyProject']['create'](_[_0xff79('0x3a')](_0x2f7dc5,_0x467e9b[_0xff79('0x48')]),{'include':_0x467e9b[_0xff79('0x2a')][_0xff79('0x44')]?[{'all':!![]}]:undefined})[_0xff79('0x20')](function(_0x28e27b){var _0x3767fd=_0x467e9b[_0xff79('0x53')]['get']({'plain':!![]});if(!_0x3767fd)throw new Error(_0xff79('0x49'));if(_0x3767fd['role']===_0xff79('0x53')){var _0x3f5c87=_0x28e27b[_0xff79('0x4b')]({'plain':!![]});var _0x47368f=_0xff79('0x21');return db['UserProfileSection'][_0xff79('0x46')]({'where':{'name':_0x47368f,'userProfileId':_0x3767fd[_0xff79('0x54')]},'raw':!![]})[_0xff79('0x20')](function(_0xb57af3){if(_0xb57af3&&_0xb57af3['autoAssociation']===0x0){return db[_0xff79('0x22')][_0xff79('0x47')]({'name':_0x3f5c87[_0xff79('0x24')],'resourceId':_0x3f5c87['id'],'type':_0xb57af3[_0xff79('0x24')],'sectionId':_0xb57af3['id']},{})[_0xff79('0x20')](function(){return _0x28e27b;});}else{return _0x28e27b;}})['catch'](function(_0x559f80){logger[_0xff79('0x23')](_0xff79('0x4d'),_0x559f80);throw _0x559f80;});}return _0x28e27b;});}})[_0xff79('0x20')](respondWithResult(_0x48540e,0xc9))[_0xff79('0x41')](handleError(_0x48540e,null));};exports[_0xff79('0x55')]=function(_0x18e586,_0x47a37d){if(_0x18e586[_0xff79('0x48')]['id']){delete _0x18e586['body']['id'];}return db[_0xff79('0x26')][_0xff79('0x46')]({'where':{'id':_0x18e586[_0xff79('0x43')]['id']}})['then'](handleEntityNotFound(_0x47a37d,null))[_0xff79('0x20')](saveUpdates(_0x18e586[_0xff79('0x48')],null))[_0xff79('0x20')](respondWithResult(_0x47a37d,null))['catch'](handleError(_0x47a37d,null));};exports[_0xff79('0x1f')]=function(_0x39bf6f,_0x16198d){return db[_0xff79('0x26')][_0xff79('0x46')]({'where':{'id':_0x39bf6f[_0xff79('0x43')]['id']}})[_0xff79('0x20')](handleEntityNotFound(_0x16198d,null))['then'](removeEntity(_0x16198d,null))[_0xff79('0x41')](handleError(_0x16198d,null));};exports['getSessions']=function(_0xaf811a,_0x17a790,_0x13671b){var _0x239f2f={'raw':!![],'where':{}};var _0x109258={};var _0x249309={'count':0x0,'rows':[]};return db[_0xff79('0x26')][_0xff79('0x56')]({'where':{'id':_0xaf811a[_0xff79('0x43')]['id']}})[_0xff79('0x20')](handleEntityNotFound(_0x17a790,null))['then'](function(_0x4b2275){if(_0x4b2275){_0x109258[_0xff79('0x27')]=_[_0xff79('0x28')](db[_0xff79('0x57')][_0xff79('0x4f')]);_0x109258['query']=_[_0xff79('0x28')](_0xaf811a[_0xff79('0x2a')]);_0x109258[_0xff79('0x2c')]=_[_0xff79('0x2d')](_0x109258[_0xff79('0x27')],_0x109258[_0xff79('0x2a')]);_0x239f2f[_0xff79('0x2e')]=_[_0xff79('0x2d')](_0x109258[_0xff79('0x27')],qs[_0xff79('0x2f')](_0xaf811a[_0xff79('0x2a')][_0xff79('0x2f')]));_0x239f2f['attributes']=_0x239f2f[_0xff79('0x2e')][_0xff79('0x30')]?_0x239f2f['attributes']:_0x109258['model'];if(!_0xaf811a[_0xff79('0x2a')][_0xff79('0x31')]('nolimit')){_0x239f2f[_0xff79('0x1a')]=qs['limit'](_0xaf811a[_0xff79('0x2a')][_0xff79('0x1a')]);_0x239f2f[_0xff79('0x19')]=qs[_0xff79('0x19')](_0xaf811a['query']['offset']);}_0x239f2f[_0xff79('0x33')]=qs[_0xff79('0x34')](_0xaf811a['query'][_0xff79('0x34')]);_0x239f2f[_0xff79('0x38')]=qs['filters'](_[_0xff79('0x35')](_0xaf811a[_0xff79('0x2a')],_0x109258[_0xff79('0x2c')]));_0x239f2f[_0xff79('0x38')][_0xff79('0x58')]=_0x4b2275['id'];if(_0xaf811a[_0xff79('0x2a')]['filter']){_0x239f2f[_0xff79('0x38')]=_[_0xff79('0x3a')](_0x239f2f['where'],{'$or':_[_0xff79('0x3b')](_0x239f2f[_0xff79('0x2e')],function(_0x1aa255){var _0x45ec9c={};_0x45ec9c[_0x1aa255]={'$like':'%'+_0xaf811a['query']['filter']+'%'};return _0x45ec9c;})});}_0x239f2f=_['merge']({},_0x239f2f,_0xaf811a[_0xff79('0x3f')]);return db['JscriptySessionReport'][_0xff79('0x18')]({'where':_0x239f2f['where']})[_0xff79('0x20')](function(_0x2511de){_0x249309['count']=_0x2511de;if(_0xaf811a[_0xff79('0x2a')][_0xff79('0x44')]){_0x239f2f[_0xff79('0x45')]=[{'all':!![]}];}return db[_0xff79('0x57')]['findAll'](_0x239f2f);})[_0xff79('0x20')](function(_0xa7dffa){_0x249309[_0xff79('0x40')]=_0xa7dffa;return _0x249309;});}})['then'](respondWithFilteredResult(_0x17a790,_0x239f2f))['catch'](handleError(_0x17a790,null));};exports['getAnswers']=function(_0x59c3ab,_0xebf17e,_0x1f952c){var _0x57015d={'raw':!![],'where':{}};var _0x215980={};var _0x97ec69={'count':0x0,'rows':[]};var _0x43ea45={'dateStart':_0x59c3ab[_0xff79('0x2a')]['dateStart'],'dateEnd':_0x59c3ab[_0xff79('0x2a')][_0xff79('0x2b')]};delete _0x59c3ab['query']['dateStart'];delete _0x59c3ab[_0xff79('0x2a')][_0xff79('0x2b')];return db['JscriptyProject']['findOne']({'where':{'id':_0x59c3ab[_0xff79('0x43')]['id']}})[_0xff79('0x20')](handleEntityNotFound(_0xebf17e,null))[_0xff79('0x20')](function(_0x5a9fc0){if(_0x5a9fc0){_0x215980[_0xff79('0x27')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x215980[_0xff79('0x2a')]=_[_0xff79('0x28')](_0x59c3ab['query']);_0x215980[_0xff79('0x2c')]=_[_0xff79('0x2d')](_0x215980[_0xff79('0x27')],_0x215980[_0xff79('0x2a')]);_0x57015d[_0xff79('0x2e')]=_[_0xff79('0x2d')](_0x215980[_0xff79('0x27')],qs[_0xff79('0x2f')](_0x59c3ab[_0xff79('0x2a')][_0xff79('0x2f')]));_0x57015d['attributes']=_0x57015d[_0xff79('0x2e')][_0xff79('0x30')]?_0x57015d[_0xff79('0x2e')]:_0x215980[_0xff79('0x27')];if(!_0x59c3ab['query']['hasOwnProperty'](_0xff79('0x32'))){_0x57015d[_0xff79('0x1a')]=qs[_0xff79('0x1a')](_0x59c3ab[_0xff79('0x2a')][_0xff79('0x1a')]);_0x57015d[_0xff79('0x19')]=qs['offset'](_0x59c3ab[_0xff79('0x2a')]['offset']);}_0x57015d[_0xff79('0x33')]=qs['sort'](_0x59c3ab['query']['sort']);_0x57015d[_0xff79('0x38')]=qs[_0xff79('0x2c')](_['pick'](_0x59c3ab['query'],_0x215980['filters']));_0x57015d[_0xff79('0x38')][_0xff79('0x58')]=_0x5a9fc0['id'];if(_0x43ea45[_0xff79('0x29')]){if(_0x43ea45[_0xff79('0x2b')]){_0x43ea45[_0xff79('0x2b')]=moment(_0x43ea45[_0xff79('0x2b')])[_0xff79('0x36')](0x1,_0xff79('0x37'));}else{_0x43ea45[_0xff79('0x2b')]=moment(_0x43ea45[_0xff79('0x29')])[_0xff79('0x36')](0x1,'day');}_[_0xff79('0x3a')](_0x57015d[_0xff79('0x38')],{'createdAt':{'$gte':_0x43ea45[_0xff79('0x29')],'$lte':_0x43ea45[_0xff79('0x2b')]}});}if(_0x59c3ab['query'][_0xff79('0x39')]){_0x57015d['where']=_[_0xff79('0x3a')](_0x57015d['where'],{'$or':_['map'](_0x57015d[_0xff79('0x2e')],function(_0x4505e4){var _0x359965={};_0x359965[_0x4505e4]={'$like':'%'+_0x59c3ab['query'][_0xff79('0x39')]+'%'};return _0x359965;})});}_0x57015d=_['merge']({},_0x57015d,_0x59c3ab[_0xff79('0x3f')]);return db[_0xff79('0x59')][_0xff79('0x18')]({'where':_0x57015d[_0xff79('0x38')]})[_0xff79('0x20')](function(_0x29d0ed){_0x97ec69['count']=_0x29d0ed;if(_0x59c3ab['query'][_0xff79('0x44')]){_0x57015d[_0xff79('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xff79('0x5a')](_0x57015d);})[_0xff79('0x20')](function(_0xe92add){_0x97ec69[_0xff79('0x40')]=_0xe92add;return _0x97ec69;});}})[_0xff79('0x20')](respondWithFilteredResult(_0xebf17e,_0x57015d))['catch'](handleError(_0xebf17e,null));};function char(_0x4001c8){return'number'===typeof _0x4001c8?String[_0xff79('0x5b')][_0xff79('0x5c')](null,arguments):_0x4001c8;}function needsEncapsulation(_0x47f8e0){return!!_0x47f8e0&&(_0x47f8e0[_0xff79('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x47f8e0[_0xff79('0x5d')]()['indexOf'](char(0xa))>=0x0||_0x47f8e0[_0xff79('0x5d')]()['indexOf'](char(0x2c))>=0x0||_0x47f8e0[_0xff79('0x5d')]()[_0xff79('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x537dd7){var _0x39ef64=char(0x22),_0x163541='\x5c'+char(0x22),_0x56f029=_0x537dd7[_0xff79('0x5d')]()[_0xff79('0x5f')](new RegExp(_0x39ef64,'g'),_0x163541);return _0x39ef64+_0x56f029+_0x39ef64;}exports[_0xff79('0x60')]=function(_0x3b289e,_0x3add7e,_0x2fa651){var _0x38626d,_0x3d2765;var _0x4c6a7c={'dateStart':_0x3b289e[_0xff79('0x2a')][_0xff79('0x29')],'dateEnd':_0x3b289e['query'][_0xff79('0x2b')]};delete _0x3b289e[_0xff79('0x2a')][_0xff79('0x29')];delete _0x3b289e[_0xff79('0x2a')][_0xff79('0x2b')];if(_0x4c6a7c['dateStart']){if(_0x4c6a7c['dateEnd']){_0x4c6a7c['dateEnd']=moment(_0x4c6a7c[_0xff79('0x2b')])[_0xff79('0x36')](0x1,_0xff79('0x37'));}else{_0x4c6a7c['dateEnd']=moment(_0x4c6a7c[_0xff79('0x29')])[_0xff79('0x36')](0x1,_0xff79('0x37'));}}return db['JscriptySessionReport']['findAll']({'where':{'ProjectId':_0x3b289e[_0xff79('0x43')]['id'],'starttime':{'$gte':_0x4c6a7c[_0xff79('0x29')],'$lte':_0x4c6a7c['dateEnd']}}})[_0xff79('0x20')](handleEntityNotFound(_0x3add7e,null))[_0xff79('0x20')](function(_0x37574f){if(_0x37574f){_0x38626d=_0x37574f;return db[_0xff79('0x61')]['findAll']({'where':{'SessionId':{'$in':_[_0xff79('0x3b')](_0x38626d,'id')},'ProjectId':_0x3b289e[_0xff79('0x43')]['id']},'order':_0xff79('0x62')});}})[_0xff79('0x20')](handleEntityNotFound(_0x3add7e,null))['then'](function(_0x5dfb5c){if(_0x5dfb5c){_0x3d2765=_0x5dfb5c;var _0x285206={};for(var _0x55eb27=0x0,_0x1ffc1f=_0x3d2765[_0xff79('0x30')];_0x55eb27<_0x1ffc1f;_0x55eb27++){if(!_0x285206[_0xff79('0x31')](_0x3d2765[_0x55eb27][_0xff79('0x63')])){_0x285206[_0x3d2765[_0x55eb27][_0xff79('0x63')]]=needsEncapsulation(_0x3d2765[_0x55eb27][_0xff79('0x64')])?encapsulate(_0x3d2765[_0x55eb27][_0xff79('0x64')]):_0x3d2765[_0x55eb27]['question'];}}var _0x4d6580=[],_0x1208d4={};for(var _0x346d69=0x0,_0x481ae3=_0x38626d[_0xff79('0x30')];_0x346d69<_0x481ae3;_0x346d69++){_0x1208d4={'ProjectId':_0x3b289e[_0xff79('0x43')]['id'],'SessionId':_0x38626d[_0x346d69]['id'],'StartTime':moment(_0x38626d[_0x346d69][_0xff79('0x65')])[_0xff79('0x66')](_0xff79('0x67'))};for(var _0x44be42=0x0,_0x1228c3=_0x3d2765[_0xff79('0x30')];_0x44be42<_0x1228c3;_0x44be42++){if(_0x3d2765[_0x44be42][_0xff79('0x68')]==_0x38626d[_0x346d69]['id']&&_0x285206[_0xff79('0x31')](_0x3d2765[_0x44be42]['questionId'])){_0x1208d4[_0x285206[_0x3d2765[_0x44be42]['questionId']]]=_0x3d2765[_0x44be42][_0xff79('0x69')];}}for(var _0x458bc7 in _0x285206){if(!_0x1208d4[_0xff79('0x31')](_0x285206[_0x458bc7])){_0x1208d4[_0x285206[_0x458bc7]]=null;}}_0x4d6580[_0xff79('0x6a')](_0x1208d4);}return _0x4d6580;}})[_0xff79('0x20')](function(_0x2c1b4e){if(!_[_0xff79('0x6b')](_0x2c1b4e)){var _0x176f0f=toCsv(_0x2c1b4e);var _0x99d6bc=Date[_0xff79('0x6c')]();fs[_0xff79('0x6d')](util['format'](_0xff79('0x6e'),_0x3b289e[_0xff79('0x43')]['id'],_0x99d6bc),_0x176f0f);_0x3add7e['setHeader'](_0xff79('0x6f'),_0xff79('0x70')+util[_0xff79('0x66')](_0xff79('0x71'),_0x3b289e[_0xff79('0x43')]['id'],_0x99d6bc));_0x3add7e[_0xff79('0x72')](_0xff79('0x73'),'text/csv');return _0x3add7e[_0xff79('0x74')](util['format'](_0xff79('0x6e'),_0x3b289e[_0xff79('0x43')]['id'],_0x99d6bc));}else{return _0x3add7e[_0xff79('0x14')](0xcc);}})[_0xff79('0x41')](handleError(_0x3add7e,null));};
\ No newline at end of file
index 362b7f3..a40f4c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb3=['util','../../config/logger','api','moment','bluebird','request-promise','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x5eb3,0xd0));var _0x35eb=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0x5eb3[_0x2becba];return _0x90b5dd;};'use strict';var _=require(_0x35eb('0x0'));var util=require(_0x35eb('0x1'));var logger=require(_0x35eb('0x2'))(_0x35eb('0x3'));var moment=require(_0x35eb('0x4'));var BPromise=require(_0x35eb('0x5'));var rp=require(_0x35eb('0x6'));var attributes=require(_0x35eb('0x7'));module['exports']=function(_0x252036,_0x204392){return _0x252036[_0x35eb('0x8')](_0x35eb('0x9'),attributes,{'tableName':_0x35eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaef4=['request-promise','./jscriptyProject.attributes','JscriptyProject','lodash','util','../../config/logger','moment','bluebird'];(function(_0x47b63f,_0x520881){var _0x284e4c=function(_0x4a53fa){while(--_0x4a53fa){_0x47b63f['push'](_0x47b63f['shift']());}};_0x284e4c(++_0x520881);}(_0xaef4,0xfb));var _0x4aef=function(_0x3dea3b,_0x2288c4){_0x3dea3b=_0x3dea3b-0x0;var _0x529373=_0xaef4[_0x3dea3b];return _0x529373;};'use strict';var _=require(_0x4aef('0x0'));var util=require(_0x4aef('0x1'));var logger=require(_0x4aef('0x2'))('api');var moment=require(_0x4aef('0x3'));var BPromise=require(_0x4aef('0x4'));var rp=require(_0x4aef('0x5'));var attributes=require(_0x4aef('0x6'));module['exports']=function(_0x3f0fda,_0x43d329){return _0x3f0fda['define'](_0x4aef('0x7'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f47ca71..c6451b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e16=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','util','moment','bluebird','randomstring'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x4e16,0x1df));var _0x64e1=function(_0x25207d,_0x5cce53){_0x25207d=_0x25207d-0x0;var _0x547923=_0x4e16[_0x25207d];return _0x547923;};'use strict';var _=require('lodash');var util=require(_0x64e1('0x0'));var moment=require(_0x64e1('0x1'));var BPromise=require(_0x64e1('0x2'));var rs=require(_0x64e1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64e1('0x4'))['db'];var utils=require(_0x64e1('0x5'));var logger=require('../../config/logger')(_0x64e1('0x6'));var config=require(_0x64e1('0x7'));var jayson=require(_0x64e1('0x8'));var client=jayson[_0x64e1('0x9')][_0x64e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3892bc,_0x20ae89,_0x1123ac){return new BPromise(function(_0x599363,_0x131216){return client[_0x64e1('0xb')](_0x3892bc,_0x1123ac)['then'](function(_0x521a10){logger[_0x64e1('0xc')](_0x64e1('0xd'),_0x20ae89,_0x64e1('0xe'));logger[_0x64e1('0xf')](_0x64e1('0x10'),_0x20ae89,_0x64e1('0xe'),JSON['stringify'](_0x521a10));if(_0x521a10['error']){if(_0x521a10['error'][_0x64e1('0x11')]===0x1f4){logger[_0x64e1('0x12')](_0x64e1('0xd'),_0x20ae89,_0x521a10[_0x64e1('0x12')][_0x64e1('0x13')]);return _0x131216(_0x521a10[_0x64e1('0x12')]['message']);}logger[_0x64e1('0x12')](_0x64e1('0xd'),_0x20ae89,_0x521a10['error'][_0x64e1('0x13')]);return _0x599363(_0x521a10['error']['message']);}else{logger[_0x64e1('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x20ae89,'request\x20sent');_0x599363(_0x521a10[_0x64e1('0x14')][_0x64e1('0x13')]);}})['catch'](function(_0x41b503){logger[_0x64e1('0x12')](_0x64e1('0xd'),_0x20ae89,_0x41b503);_0x131216(_0x41b503);});});}
\ No newline at end of file
+var _0x14f5=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x5325a6,_0x5d6a33){var _0x1fe355=function(_0x5f04ed){while(--_0x5f04ed){_0x5325a6['push'](_0x5325a6['shift']());}};_0x1fe355(++_0x5d6a33);}(_0x14f5,0xbe));var _0x514f=function(_0x469aed,_0x58ae60){_0x469aed=_0x469aed-0x0;var _0x20b32f=_0x14f5[_0x469aed];return _0x20b32f;};'use strict';var _=require(_0x514f('0x0'));var util=require(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require('bluebird');var rs=require(_0x514f('0x3'));var fs=require('fs');var Redis=require(_0x514f('0x4'));var db=require(_0x514f('0x5'))['db'];var utils=require(_0x514f('0x6'));var logger=require('../../config/logger')(_0x514f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x514f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28086e,_0x37ee7f,_0x50bc5b){return new BPromise(function(_0xab4968,_0xcb9cf7){return client[_0x514f('0x9')](_0x28086e,_0x50bc5b)[_0x514f('0xa')](function(_0x2131d6){logger['info'](_0x514f('0xb'),_0x37ee7f,_0x514f('0xc'));logger['debug']('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x37ee7f,_0x514f('0xc'),JSON[_0x514f('0xd')](_0x2131d6));if(_0x2131d6[_0x514f('0xe')]){if(_0x2131d6[_0x514f('0xe')][_0x514f('0xf')]===0x1f4){logger[_0x514f('0xe')](_0x514f('0xb'),_0x37ee7f,_0x2131d6['error']['message']);return _0xcb9cf7(_0x2131d6[_0x514f('0xe')][_0x514f('0x10')]);}logger['error'](_0x514f('0xb'),_0x37ee7f,_0x2131d6[_0x514f('0xe')][_0x514f('0x10')]);return _0xab4968(_0x2131d6[_0x514f('0xe')][_0x514f('0x10')]);}else{logger[_0x514f('0x11')](_0x514f('0xb'),_0x37ee7f,_0x514f('0xc'));_0xab4968(_0x2131d6[_0x514f('0x12')][_0x514f('0x10')]);}})['catch'](function(_0x100c34){logger[_0x514f('0xe')](_0x514f('0xb'),_0x37ee7f,_0x100c34);_0xcb9cf7(_0x100c34);});});}
\ No newline at end of file
index deaf137..3a30e5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x969d=['update','delete','/:id','destroy','exports','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','put'];(function(_0x3f55f0,_0x322fdf){var _0x405e92=function(_0x85df9d){while(--_0x85df9d){_0x3f55f0['push'](_0x3f55f0['shift']());}};_0x405e92(++_0x322fdf);}(_0x969d,0xc5));var _0xd969=function(_0x23d2d2,_0xae4a93){_0x23d2d2=_0x23d2d2-0x0;var _0x52749f=_0x969d[_0x23d2d2];return _0x52749f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd969('0x0'));var express=require(_0xd969('0x1'));var router=express[_0xd969('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xd969('0x3'));var config=require(_0xd969('0x4'));var controller=require(_0xd969('0x5'));router[_0xd969('0x6')]('/',auth[_0xd969('0x7')](),controller[_0xd969('0x8')]);router[_0xd969('0x6')]('/describe',auth[_0xd969('0x7')](),controller[_0xd969('0x9')]);router[_0xd969('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd969('0x7')](),controller['create']);router[_0xd969('0xa')]('/:id',auth[_0xd969('0x7')](),controller[_0xd969('0xb')]);router[_0xd969('0xc')](_0xd969('0xd'),auth['isAuthenticated'](),controller[_0xd969('0xe')]);module[_0xd969('0xf')]=router;
\ No newline at end of file
+var _0x11de=['show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x30817b,_0x511702){var _0x5bbf69=function(_0xacb9fb){while(--_0xacb9fb){_0x30817b['push'](_0x30817b['shift']());}};_0x5bbf69(++_0x511702);}(_0x11de,0x17e));var _0xe11d=function(_0x35dc56,_0x331d0a){_0x35dc56=_0x35dc56-0x0;var _0x100856=_0x11de[_0x35dc56];return _0x100856;};'use strict';var multer=require(_0xe11d('0x0'));var util=require(_0xe11d('0x1'));var path=require('path');var timeout=require(_0xe11d('0x2'));var express=require(_0xe11d('0x3'));var router=express[_0xe11d('0x4')]();var auth=require(_0xe11d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe11d('0x6'));var controller=require(_0xe11d('0x7'));router[_0xe11d('0x8')]('/',auth[_0xe11d('0x9')](),controller[_0xe11d('0xa')]);router['get'](_0xe11d('0xb'),auth[_0xe11d('0x9')](),controller[_0xe11d('0xc')]);router[_0xe11d('0x8')](_0xe11d('0xd'),auth[_0xe11d('0x9')](),controller[_0xe11d('0xe')]);router[_0xe11d('0xf')]('/',auth[_0xe11d('0x9')](),controller[_0xe11d('0x10')]);router[_0xe11d('0x11')](_0xe11d('0xd'),auth[_0xe11d('0x9')](),controller[_0xe11d('0x12')]);router[_0xe11d('0x13')]('/:id',auth[_0xe11d('0x9')](),controller[_0xe11d('0x14')]);module[_0xe11d('0x15')]=router;
\ No newline at end of file
index 300d388..a3882b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50c1=['sequelize','STRING','long'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x50c1,0x1b6));var _0x150c=function(_0x472021,_0x118384){_0x472021=_0x472021-0x0;var _0x558e08=_0x50c1[_0x472021];return _0x558e08;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'question':{'type':Sequelize[_0x150c('0x1')]},'answer':{'type':Sequelize['TEXT'](_0x150c('0x2'))},'membername':{'type':Sequelize[_0x150c('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x150c('0x1')]},'uniqueid':{'type':Sequelize[_0x150c('0x1')]},'calleridname':{'type':Sequelize[_0x150c('0x1')]},'calleridnum':{'type':Sequelize[_0x150c('0x1')]},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbefe=['exports','TEXT','long','STRING'];(function(_0x3e297,_0x43e333){var _0x377884=function(_0x286b98){while(--_0x286b98){_0x3e297['push'](_0x3e297['shift']());}};_0x377884(++_0x43e333);}(_0xbefe,0x168));var _0xebef=function(_0x5714e0,_0xbf4ccd){_0x5714e0=_0x5714e0-0x0;var _0x348053=_0xbefe[_0x5714e0];return _0x348053;};'use strict';var Sequelize=require('sequelize');module[_0xebef('0x0')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xebef('0x1')](_0xebef('0x2'))},'membername':{'type':Sequelize[_0xebef('0x3')]},'projectname':{'type':Sequelize[_0xebef('0x3')]},'queue':{'type':Sequelize[_0xebef('0x3')]},'uniqueid':{'type':Sequelize[_0xebef('0x3')]},'calleridname':{'type':Sequelize[_0xebef('0x3')]},'calleridnum':{'type':Sequelize[_0xebef('0x3')]},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 68525f4..98456a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bae=['fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','day','add','merge','map','type','key','field','filter','options','includeAll','include','rows','catch','params','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','set','apply','reject','save','update','then','destroy','name','JscriptyQuestionReport','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model'];(function(_0x33a35d,_0x365515){var _0x1113a4=function(_0x2028c){while(--_0x2028c){_0x33a35d['push'](_0x33a35d['shift']());}};_0x1113a4(++_0x365515);}(_0x7bae,0x13b));var _0xe7ba=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7bae[_0x1035c1];return _0x308d67;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7ba('0x0'));var zipdir=require(_0xe7ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7ba('0x2'));var moment=require('moment');var BPromise=require(_0xe7ba('0x3'));var Mustache=require(_0xe7ba('0x4'));var util=require(_0xe7ba('0x5'));var path=require(_0xe7ba('0x6'));var sox=require(_0xe7ba('0x7'));var csv=require(_0xe7ba('0x8'));var ejs=require(_0xe7ba('0x9'));var fs=require('fs');var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x8'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var qs=require(_0xe7ba('0x11'));var logger=require(_0xe7ba('0x12'))(_0xe7ba('0x13'));var utils=require(_0xe7ba('0x14'));var config=require(_0xe7ba('0x15'));var db=require(_0xe7ba('0x16'))['db'];function respondWithStatusCode(_0x448bcc,_0x194447){_0x194447=_0x194447||0xcc;return function(_0x4b6597){if(_0x4b6597){return _0x448bcc[_0xe7ba('0x17')](_0x194447);}return _0x448bcc['status'](_0x194447)[_0xe7ba('0x18')]();};}function respondWithResult(_0x45229c,_0x390596){_0x390596=_0x390596||0xc8;return function(_0x17e4e6){if(_0x17e4e6){return _0x45229c[_0xe7ba('0x19')](_0x390596)[_0xe7ba('0x1a')](_0x17e4e6);}};}function respondWithFilteredResult(_0x561dbb,_0x561c48){return function(_0x2a5183){if(_0x2a5183){var _0x7ba72a=_0x2a5183['count'],_0x359f6f=_0x561c48['offset'],_0x5d1d03=_0x561c48['offset']+_0x561c48[_0xe7ba('0x1b')],_0x4390e3;if(_0x5d1d03>=_0x7ba72a){_0x5d1d03=_0x7ba72a;_0x4390e3=0xc8;}else{_0x4390e3=0xce;}_0x561dbb['status'](_0x4390e3);return _0x561dbb[_0xe7ba('0x1c')]('Content-Range',_0x359f6f+'-'+_0x5d1d03+'/'+_0x7ba72a)['json'](_0x2a5183);}return null;};}function patchUpdates(_0x5a82b5){return function(_0x3f326a){try{jsonpatch[_0xe7ba('0x1d')](_0x3f326a,_0x5a82b5,!![]);}catch(_0x39ca38){return BPromise[_0xe7ba('0x1e')](_0x39ca38);}return _0x3f326a[_0xe7ba('0x1f')]();};}function saveUpdates(_0x58550c,_0x149c62){return function(_0x20c653){if(_0x20c653){return _0x20c653[_0xe7ba('0x20')](_0x58550c)[_0xe7ba('0x21')](function(_0x4aaf35){return _0x4aaf35;});}return null;};}function removeEntity(_0x1076c5,_0x2936b7){return function(_0x5a158f){if(_0x5a158f){return _0x5a158f[_0xe7ba('0x22')]()[_0xe7ba('0x21')](function(){_0x1076c5[_0xe7ba('0x19')](0xcc)[_0xe7ba('0x18')]();});}};}function handleEntityNotFound(_0x394b69,_0x2acfc2){return function(_0x293b14){if(!_0x293b14){_0x394b69[_0xe7ba('0x17')](0x194);}return _0x293b14;};}function handleError(_0x41cbd9,_0xa72f1c){_0xa72f1c=_0xa72f1c||0x1f4;return function(_0x58cf43){logger['error'](_0x58cf43['stack']);if(_0x58cf43['name']){delete _0x58cf43[_0xe7ba('0x23')];}_0x41cbd9['status'](_0xa72f1c)['send'](_0x58cf43);};}exports['index']=function(_0x255def,_0x32cc00){var _0xe32862={},_0x2ea78a={},_0x3435c6={'count':0x0,'rows':[]};var _0xc88099=db[_0xe7ba('0x24')][_0xe7ba('0x25')];_0x2ea78a['model']=_[_0xe7ba('0x26')](_0xc88099);var _0x48c869={'dateStart':_0x255def[_0xe7ba('0x27')][_0xe7ba('0x28')],'dateEnd':_0x255def[_0xe7ba('0x27')]['dateEnd']};delete _0x255def['query'][_0xe7ba('0x28')];delete _0x255def[_0xe7ba('0x27')][_0xe7ba('0x29')];_0x2ea78a[_0xe7ba('0x27')]=_[_0xe7ba('0x26')](_0x255def['query']);_0x2ea78a[_0xe7ba('0x2a')]=_[_0xe7ba('0x2b')](_0x2ea78a['model'],_0x2ea78a[_0xe7ba('0x27')]);_0xe32862['attributes']=_['intersection'](_0x2ea78a[_0xe7ba('0x2c')],qs[_0xe7ba('0x2d')](_0x255def[_0xe7ba('0x27')]['fields']));_0xe32862[_0xe7ba('0x2e')]=_0xe32862['attributes'][_0xe7ba('0x2f')]?_0xe32862[_0xe7ba('0x2e')]:_0x2ea78a[_0xe7ba('0x2c')];if(!_0x255def[_0xe7ba('0x27')][_0xe7ba('0x30')]('nolimit')){_0xe32862[_0xe7ba('0x1b')]=qs[_0xe7ba('0x1b')](_0x255def['query'][_0xe7ba('0x1b')]);_0xe32862[_0xe7ba('0x31')]=qs[_0xe7ba('0x31')](_0x255def['query'][_0xe7ba('0x31')]);}_0xe32862[_0xe7ba('0x32')]=qs['sort'](_0x255def[_0xe7ba('0x27')][_0xe7ba('0x33')]);_0xe32862[_0xe7ba('0x34')]=qs['filters'](_[_0xe7ba('0x35')](_0x255def[_0xe7ba('0x27')],_0x2ea78a['filters']));if(_0x48c869[_0xe7ba('0x28')]){if(_0x48c869[_0xe7ba('0x29')]){_0x48c869[_0xe7ba('0x29')]=moment(_0x48c869['dateEnd'])['add'](0x1,_0xe7ba('0x36'));}else{_0x48c869[_0xe7ba('0x29')]=moment(_0x48c869[_0xe7ba('0x28')])[_0xe7ba('0x37')](0x1,_0xe7ba('0x36'));}_['merge'](_0xe32862[_0xe7ba('0x34')],{'createdAt':{'$gte':_0x48c869[_0xe7ba('0x28')],'$lte':_0x48c869[_0xe7ba('0x29')]}});}if(_0x255def[_0xe7ba('0x27')]['filter']){_0xe32862[_0xe7ba('0x34')]=_[_0xe7ba('0x38')](_0xe32862[_0xe7ba('0x34')],{'$or':_[_0xe7ba('0x39')](_0xc88099,function(_0x35a5f3){if(_0x35a5f3[_0xe7ba('0x3a')][_0xe7ba('0x3b')]!=='VIRTUAL'){var _0x3429fa={};_0x3429fa[_0x35a5f3[_0xe7ba('0x3c')]]={'$like':'%'+_0x255def[_0xe7ba('0x27')][_0xe7ba('0x3d')]+'%'};return _0x3429fa;}})});}_0xe32862=_[_0xe7ba('0x38')]({},_0xe32862,_0x255def[_0xe7ba('0x3e')]);var _0x220c3b={'where':_0xe32862[_0xe7ba('0x34')]};return db[_0xe7ba('0x24')]['count'](_0x220c3b)[_0xe7ba('0x21')](function(_0x417734){_0x3435c6['count']=_0x417734;if(_0x255def['query'][_0xe7ba('0x3f')]){_0xe32862[_0xe7ba('0x40')]=[{'all':!![]}];}return db[_0xe7ba('0x24')]['findAll'](_0xe32862);})[_0xe7ba('0x21')](function(_0x82246e){_0x3435c6[_0xe7ba('0x41')]=_0x82246e;return _0x3435c6;})[_0xe7ba('0x21')](respondWithFilteredResult(_0x32cc00,_0xe32862))[_0xe7ba('0x42')](handleError(_0x32cc00,null));};exports['show']=function(_0x165558,_0x54ef49){var _0x30a1c8={'raw':!![],'where':{'id':_0x165558[_0xe7ba('0x43')]['id']}},_0x2d9d85={};_0x2d9d85[_0xe7ba('0x2c')]=_[_0xe7ba('0x26')](db[_0xe7ba('0x24')][_0xe7ba('0x25')]);_0x2d9d85[_0xe7ba('0x27')]=_['keys'](_0x165558[_0xe7ba('0x27')]);_0x2d9d85[_0xe7ba('0x2a')]=_[_0xe7ba('0x2b')](_0x2d9d85[_0xe7ba('0x2c')],_0x2d9d85[_0xe7ba('0x27')]);_0x30a1c8[_0xe7ba('0x2e')]=_[_0xe7ba('0x2b')](_0x2d9d85[_0xe7ba('0x2c')],qs[_0xe7ba('0x2d')](_0x165558[_0xe7ba('0x27')]['fields']));_0x30a1c8[_0xe7ba('0x2e')]=_0x30a1c8['attributes'][_0xe7ba('0x2f')]?_0x30a1c8[_0xe7ba('0x2e')]:_0x2d9d85[_0xe7ba('0x2c')];if(_0x165558[_0xe7ba('0x27')][_0xe7ba('0x3f')]){_0x30a1c8[_0xe7ba('0x40')]=[{'all':!![]}];}_0x30a1c8=_['merge']({},_0x30a1c8,_0x165558[_0xe7ba('0x3e')]);return db[_0xe7ba('0x24')][_0xe7ba('0x44')](_0x30a1c8)[_0xe7ba('0x21')](handleEntityNotFound(_0x54ef49,null))[_0xe7ba('0x21')](respondWithResult(_0x54ef49,null))[_0xe7ba('0x42')](handleError(_0x54ef49,null));};exports[_0xe7ba('0x45')]=function(_0x266ace,_0x272cb9){return db[_0xe7ba('0x24')][_0xe7ba('0x45')](_0x266ace['body'],{})[_0xe7ba('0x21')](respondWithResult(_0x272cb9,0xc9))[_0xe7ba('0x42')](handleError(_0x272cb9,null));};exports[_0xe7ba('0x20')]=function(_0x24c7d9,_0x3ae802){if(_0x24c7d9[_0xe7ba('0x46')]['id']){delete _0x24c7d9['body']['id'];}return db[_0xe7ba('0x24')][_0xe7ba('0x44')]({'where':{'id':_0x24c7d9['params']['id']}})[_0xe7ba('0x21')](handleEntityNotFound(_0x3ae802,null))[_0xe7ba('0x21')](saveUpdates(_0x24c7d9[_0xe7ba('0x46')],null))[_0xe7ba('0x21')](respondWithResult(_0x3ae802,null))['catch'](handleError(_0x3ae802,null));};exports['destroy']=function(_0xa80cf,_0x2cfdc3){return db[_0xe7ba('0x24')]['find']({'where':{'id':_0xa80cf[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x21')](handleEntityNotFound(_0x2cfdc3,null))[_0xe7ba('0x21')](removeEntity(_0x2cfdc3,null))[_0xe7ba('0x42')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x47')]=function(_0x6b6f1,_0xf3a41f){return db['JscriptyQuestionReport'][_0xe7ba('0x47')]()[_0xe7ba('0x21')](respondWithResult(_0xf3a41f,null))[_0xe7ba('0x42')](handleError(_0xf3a41f,null));};
\ No newline at end of file
+var _0x207c=['then','destroy','end','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','merge','map','type','filter','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update'];(function(_0xa167e7,_0x369ad1){var _0x1ae004=function(_0x2d9e81){while(--_0x2d9e81){_0xa167e7['push'](_0xa167e7['shift']());}};_0x1ae004(++_0x369ad1);}(_0x207c,0x1e8));var _0xc207=function(_0x5353a7,_0x35c20f){_0x5353a7=_0x5353a7-0x0;var _0x2c86ac=_0x207c[_0x5353a7];return _0x2c86ac;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc207('0x0'));var rimraf=require(_0xc207('0x1'));var zipdir=require(_0xc207('0x2'));var jsonpatch=require(_0xc207('0x3'));var rp=require(_0xc207('0x4'));var moment=require(_0xc207('0x5'));var BPromise=require(_0xc207('0x6'));var Mustache=require('mustache');var util=require(_0xc207('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc207('0x8'));var fs=require('fs');var _=require(_0xc207('0x9'));var squel=require(_0xc207('0xa'));var crypto=require('crypto');var jsforce=require(_0xc207('0xb'));var deskjs=require(_0xc207('0xc'));var toCsv=require(_0xc207('0xd'));var querystring=require('querystring');var Papa=require(_0xc207('0xe'));var Redis=require(_0xc207('0xf'));var qs=require(_0xc207('0x10'));var logger=require(_0xc207('0x11'))(_0xc207('0x12'));var utils=require(_0xc207('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b556f,_0x19b297){_0x19b297=_0x19b297||0xcc;return function(_0x491062){if(_0x491062){return _0x5b556f[_0xc207('0x14')](_0x19b297);}return _0x5b556f[_0xc207('0x15')](_0x19b297)['end']();};}function respondWithResult(_0x3e1108,_0xb86b06){_0xb86b06=_0xb86b06||0xc8;return function(_0x3062f5){if(_0x3062f5){return _0x3e1108[_0xc207('0x15')](_0xb86b06)[_0xc207('0x16')](_0x3062f5);}};}function respondWithFilteredResult(_0x51e967,_0xc62672){return function(_0x3c77b7){if(_0x3c77b7){var _0x274bbd=_0x3c77b7['count'],_0x4031ad=_0xc62672[_0xc207('0x17')],_0x4ef6c4=_0xc62672[_0xc207('0x17')]+_0xc62672[_0xc207('0x18')],_0x564cef;if(_0x4ef6c4>=_0x274bbd){_0x4ef6c4=_0x274bbd;_0x564cef=0xc8;}else{_0x564cef=0xce;}_0x51e967[_0xc207('0x15')](_0x564cef);return _0x51e967['set'](_0xc207('0x19'),_0x4031ad+'-'+_0x4ef6c4+'/'+_0x274bbd)[_0xc207('0x16')](_0x3c77b7);}return null;};}function patchUpdates(_0x217d5e){return function(_0x5f288e){try{jsonpatch[_0xc207('0x1a')](_0x5f288e,_0x217d5e,!![]);}catch(_0x488cc0){return BPromise[_0xc207('0x1b')](_0x488cc0);}return _0x5f288e[_0xc207('0x1c')]();};}function saveUpdates(_0x131dc8,_0x461f6a){return function(_0xce0770){if(_0xce0770){return _0xce0770[_0xc207('0x1d')](_0x131dc8)[_0xc207('0x1e')](function(_0x464dea){return _0x464dea;});}return null;};}function removeEntity(_0x212005,_0x2bd2eb){return function(_0x3112ff){if(_0x3112ff){return _0x3112ff[_0xc207('0x1f')]()[_0xc207('0x1e')](function(){_0x212005['status'](0xcc)[_0xc207('0x20')]();});}};}function handleEntityNotFound(_0x5cda23,_0x2e89c5){return function(_0x3ac142){if(!_0x3ac142){_0x5cda23[_0xc207('0x14')](0x194);}return _0x3ac142;};}function handleError(_0x83253f,_0x3539f4){_0x3539f4=_0x3539f4||0x1f4;return function(_0xd209ac){logger[_0xc207('0x21')](_0xd209ac[_0xc207('0x22')]);if(_0xd209ac[_0xc207('0x23')]){delete _0xd209ac[_0xc207('0x23')];}_0x83253f[_0xc207('0x15')](_0x3539f4)[_0xc207('0x24')](_0xd209ac);};}exports[_0xc207('0x25')]=function(_0x138970,_0x1445d3){var _0x56a066={},_0x1e1440={},_0x5e0bd1={'count':0x0,'rows':[]};var _0x4cb3af=db[_0xc207('0x26')][_0xc207('0x27')];_0x1e1440[_0xc207('0x28')]=_[_0xc207('0x29')](_0x4cb3af);var _0x6a653d={'dateStart':_0x138970['query'][_0xc207('0x2a')],'dateEnd':_0x138970[_0xc207('0x2b')][_0xc207('0x2c')]};delete _0x138970[_0xc207('0x2b')][_0xc207('0x2a')];delete _0x138970[_0xc207('0x2b')][_0xc207('0x2c')];_0x1e1440[_0xc207('0x2b')]=_[_0xc207('0x29')](_0x138970[_0xc207('0x2b')]);_0x1e1440[_0xc207('0x2d')]=_[_0xc207('0x2e')](_0x1e1440[_0xc207('0x28')],_0x1e1440['query']);_0x56a066[_0xc207('0x2f')]=_[_0xc207('0x2e')](_0x1e1440[_0xc207('0x28')],qs[_0xc207('0x30')](_0x138970[_0xc207('0x2b')][_0xc207('0x30')]));_0x56a066['attributes']=_0x56a066[_0xc207('0x2f')][_0xc207('0x31')]?_0x56a066[_0xc207('0x2f')]:_0x1e1440[_0xc207('0x28')];if(!_0x138970['query'][_0xc207('0x32')](_0xc207('0x33'))){_0x56a066[_0xc207('0x18')]=qs[_0xc207('0x18')](_0x138970[_0xc207('0x2b')][_0xc207('0x18')]);_0x56a066[_0xc207('0x17')]=qs[_0xc207('0x17')](_0x138970[_0xc207('0x2b')]['offset']);}_0x56a066['order']=qs[_0xc207('0x34')](_0x138970[_0xc207('0x2b')][_0xc207('0x34')]);_0x56a066[_0xc207('0x35')]=qs['filters'](_[_0xc207('0x36')](_0x138970[_0xc207('0x2b')],_0x1e1440[_0xc207('0x2d')]));if(_0x6a653d[_0xc207('0x2a')]){if(_0x6a653d[_0xc207('0x2c')]){_0x6a653d['dateEnd']=moment(_0x6a653d[_0xc207('0x2c')])[_0xc207('0x37')](0x1,'day');}else{_0x6a653d[_0xc207('0x2c')]=moment(_0x6a653d['dateStart'])[_0xc207('0x37')](0x1,_0xc207('0x38'));}_['merge'](_0x56a066[_0xc207('0x35')],{'createdAt':{'$gte':_0x6a653d[_0xc207('0x2a')],'$lte':_0x6a653d[_0xc207('0x2c')]}});}if(_0x138970['query']['filter']){_0x56a066[_0xc207('0x35')]=_[_0xc207('0x39')](_0x56a066[_0xc207('0x35')],{'$or':_[_0xc207('0x3a')](_0x4cb3af,function(_0x4c3e29){if(_0x4c3e29[_0xc207('0x3b')]['key']!=='VIRTUAL'){var _0x4c10ed={};_0x4c10ed[_0x4c3e29['field']]={'$like':'%'+_0x138970[_0xc207('0x2b')][_0xc207('0x3c')]+'%'};return _0x4c10ed;}})});}_0x56a066=_[_0xc207('0x39')]({},_0x56a066,_0x138970['options']);var _0x1dd71e={'where':_0x56a066[_0xc207('0x35')]};return db[_0xc207('0x26')][_0xc207('0x3d')](_0x1dd71e)['then'](function(_0x47d43a){_0x5e0bd1[_0xc207('0x3d')]=_0x47d43a;if(_0x138970[_0xc207('0x2b')][_0xc207('0x3e')]){_0x56a066[_0xc207('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xc207('0x40')](_0x56a066);})[_0xc207('0x1e')](function(_0x3a935a){_0x5e0bd1[_0xc207('0x41')]=_0x3a935a;return _0x5e0bd1;})[_0xc207('0x1e')](respondWithFilteredResult(_0x1445d3,_0x56a066))[_0xc207('0x42')](handleError(_0x1445d3,null));};exports[_0xc207('0x43')]=function(_0x49930c,_0x154df9){var _0x5bab9f={'raw':!![],'where':{'id':_0x49930c[_0xc207('0x44')]['id']}},_0x3eafd7={};_0x3eafd7['model']=_[_0xc207('0x29')](db[_0xc207('0x26')][_0xc207('0x27')]);_0x3eafd7[_0xc207('0x2b')]=_[_0xc207('0x29')](_0x49930c['query']);_0x3eafd7[_0xc207('0x2d')]=_[_0xc207('0x2e')](_0x3eafd7[_0xc207('0x28')],_0x3eafd7['query']);_0x5bab9f[_0xc207('0x2f')]=_[_0xc207('0x2e')](_0x3eafd7[_0xc207('0x28')],qs[_0xc207('0x30')](_0x49930c['query']['fields']));_0x5bab9f[_0xc207('0x2f')]=_0x5bab9f[_0xc207('0x2f')][_0xc207('0x31')]?_0x5bab9f[_0xc207('0x2f')]:_0x3eafd7[_0xc207('0x28')];if(_0x49930c[_0xc207('0x2b')][_0xc207('0x3e')]){_0x5bab9f[_0xc207('0x3f')]=[{'all':!![]}];}_0x5bab9f=_[_0xc207('0x39')]({},_0x5bab9f,_0x49930c[_0xc207('0x45')]);return db[_0xc207('0x26')][_0xc207('0x46')](_0x5bab9f)['then'](handleEntityNotFound(_0x154df9,null))['then'](respondWithResult(_0x154df9,null))[_0xc207('0x42')](handleError(_0x154df9,null));};exports[_0xc207('0x47')]=function(_0x2468d0,_0x480f12){return db[_0xc207('0x26')][_0xc207('0x47')](_0x2468d0[_0xc207('0x48')],{})[_0xc207('0x1e')](respondWithResult(_0x480f12,0xc9))['catch'](handleError(_0x480f12,null));};exports[_0xc207('0x1d')]=function(_0x50bdf1,_0x202935){if(_0x50bdf1['body']['id']){delete _0x50bdf1['body']['id'];}return db[_0xc207('0x26')][_0xc207('0x46')]({'where':{'id':_0x50bdf1['params']['id']}})['then'](handleEntityNotFound(_0x202935,null))['then'](saveUpdates(_0x50bdf1[_0xc207('0x48')],null))[_0xc207('0x1e')](respondWithResult(_0x202935,null))[_0xc207('0x42')](handleError(_0x202935,null));};exports[_0xc207('0x1f')]=function(_0x173acf,_0x35e967){return db[_0xc207('0x26')][_0xc207('0x46')]({'where':{'id':_0x173acf['params']['id']}})[_0xc207('0x1e')](handleEntityNotFound(_0x35e967,null))[_0xc207('0x1e')](removeEntity(_0x35e967,null))['catch'](handleError(_0x35e967,null));};exports['describe']=function(_0x362001,_0x47c630){return db['JscriptyQuestionReport'][_0xc207('0x49')]()[_0xc207('0x1e')](respondWithResult(_0x47c630,null))[_0xc207('0x42')](handleError(_0x47c630,null));};
\ No newline at end of file
index 3cdb9f1..10a1a33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70a8=['define','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api','bluebird','./jscriptyQuestionReport.attributes'];(function(_0x38ce1e,_0x9a65ce){var _0x4bcf40=function(_0x3e8912){while(--_0x3e8912){_0x38ce1e['push'](_0x38ce1e['shift']());}};_0x4bcf40(++_0x9a65ce);}(_0x70a8,0x1f4));var _0x870a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x70a8[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x870a('0x0'))(_0x870a('0x1'));var moment=require('moment');var BPromise=require(_0x870a('0x2'));var rp=require('request-promise');var attributes=require(_0x870a('0x3'));module['exports']=function(_0x3a3213,_0x3e2935){return _0x3a3213[_0x870a('0x4')](_0x870a('0x5'),attributes,{'tableName':_0x870a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb846=['api','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x31e401,_0x4e9602){var _0x2c7dce=function(_0x56ea23){while(--_0x56ea23){_0x31e401['push'](_0x31e401['shift']());}};_0x2c7dce(++_0x4e9602);}(_0xb846,0x145));var _0x6b84=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb846[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x6b84('0x0'));var util=require(_0x6b84('0x1'));var logger=require(_0x6b84('0x2'))(_0x6b84('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x6b84('0x4'));module[_0x6b84('0x5')]=function(_0x14f110,_0x2c3c7b){return _0x14f110[_0x6b84('0x6')]('JscriptyQuestionReport',attributes,{'tableName':_0x6b84('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1476984..1bfcea9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1506=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x1506,0x154));var _0x6150=function(_0x12b5f1,_0x2ad05e){_0x12b5f1=_0x12b5f1-0x0;var _0x5f2511=_0x1506[_0x12b5f1];return _0x5f2511;};'use strict';var _=require(_0x6150('0x0'));var util=require(_0x6150('0x1'));var moment=require('moment');var BPromise=require(_0x6150('0x2'));var rs=require(_0x6150('0x3'));var fs=require('fs');var Redis=require(_0x6150('0x4'));var db=require(_0x6150('0x5'))['db'];var utils=require(_0x6150('0x6'));var logger=require(_0x6150('0x7'))(_0x6150('0x8'));var config=require(_0x6150('0x9'));var jayson=require(_0x6150('0xa'));var client=jayson[_0x6150('0xb')][_0x6150('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ecc10,_0x34c170,_0x2839e9){return new BPromise(function(_0x4fb9df,_0x18833d){return client['request'](_0x1ecc10,_0x2839e9)[_0x6150('0xd')](function(_0x3be2f6){logger[_0x6150('0xe')](_0x6150('0xf'),_0x34c170,_0x6150('0x10'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x34c170,'request\x20sent',JSON[_0x6150('0x11')](_0x3be2f6));if(_0x3be2f6[_0x6150('0x12')]){if(_0x3be2f6[_0x6150('0x12')][_0x6150('0x13')]===0x1f4){logger[_0x6150('0x12')](_0x6150('0xf'),_0x34c170,_0x3be2f6[_0x6150('0x12')]['message']);return _0x18833d(_0x3be2f6['error'][_0x6150('0x14')]);}logger[_0x6150('0x12')](_0x6150('0xf'),_0x34c170,_0x3be2f6[_0x6150('0x12')][_0x6150('0x14')]);return _0x4fb9df(_0x3be2f6[_0x6150('0x12')][_0x6150('0x14')]);}else{logger[_0x6150('0xe')](_0x6150('0xf'),_0x34c170,'request\x20sent');_0x4fb9df(_0x3be2f6[_0x6150('0x15')][_0x6150('0x14')]);}})[_0x6150('0x16')](function(_0x597bc1){logger[_0x6150('0x12')](_0x6150('0xf'),_0x34c170,_0x597bc1);_0x18833d(_0x597bc1);});});}
\ No newline at end of file
+var _0x7c73=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0x7c73,0x115));var _0x37c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c73[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x37c7('0x0'));var util=require(_0x37c7('0x1'));var moment=require('moment');var BPromise=require(_0x37c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37c7('0x3'));var db=require(_0x37c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x37c7('0x5'))('rpc');var config=require(_0x37c7('0x6'));var jayson=require(_0x37c7('0x7'));var client=jayson[_0x37c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55c27d,_0x16962a,_0x52a02d){return new BPromise(function(_0x1f00d8,_0x3e0c28){return client[_0x37c7('0x9')](_0x55c27d,_0x52a02d)[_0x37c7('0xa')](function(_0x957a78){logger[_0x37c7('0xb')](_0x37c7('0xc'),_0x16962a,_0x37c7('0xd'));logger['debug'](_0x37c7('0xe'),_0x16962a,_0x37c7('0xd'),JSON[_0x37c7('0xf')](_0x957a78));if(_0x957a78[_0x37c7('0x10')]){if(_0x957a78[_0x37c7('0x10')][_0x37c7('0x11')]===0x1f4){logger['error'](_0x37c7('0xc'),_0x16962a,_0x957a78[_0x37c7('0x10')][_0x37c7('0x12')]);return _0x3e0c28(_0x957a78[_0x37c7('0x10')][_0x37c7('0x12')]);}logger[_0x37c7('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16962a,_0x957a78[_0x37c7('0x10')][_0x37c7('0x12')]);return _0x1f00d8(_0x957a78['error'][_0x37c7('0x12')]);}else{logger[_0x37c7('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x16962a,'request\x20sent');_0x1f00d8(_0x957a78[_0x37c7('0x13')][_0x37c7('0x12')]);}})[_0x37c7('0x14')](function(_0x12a8e0){logger[_0x37c7('0x10')](_0x37c7('0xc'),_0x16962a,_0x12a8e0);_0x3e0c28(_0x12a8e0);});});}
\ No newline at end of file
index dc418b9..722f4c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef6e=['get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller'];(function(_0x20e882,_0x16185c){var _0x3e0dbe=function(_0x3d0129){while(--_0x3d0129){_0x20e882['push'](_0x20e882['shift']());}};_0x3e0dbe(++_0x16185c);}(_0xef6e,0xce));var _0xeef6=function(_0x49cbda,_0x4f2482){_0x49cbda=_0x49cbda-0x0;var _0x1ce6a1=_0xef6e[_0x49cbda];return _0x1ce6a1;};'use strict';var multer=require(_0xeef6('0x0'));var util=require(_0xeef6('0x1'));var path=require(_0xeef6('0x2'));var timeout=require(_0xeef6('0x3'));var express=require(_0xeef6('0x4'));var router=express[_0xeef6('0x5')]();var auth=require(_0xeef6('0x6'));var interaction=require(_0xeef6('0x7'));var config=require(_0xeef6('0x8'));var controller=require(_0xeef6('0x9'));router[_0xeef6('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeef6('0xa')](_0xeef6('0xb'),auth[_0xeef6('0xc')](),controller[_0xeef6('0xd')]);router[_0xeef6('0xa')](_0xeef6('0xe'),auth['isAuthenticated'](),controller[_0xeef6('0xf')]);router[_0xeef6('0xa')](_0xeef6('0x10'),auth[_0xeef6('0xc')](),controller[_0xeef6('0x11')]);router[_0xeef6('0x12')]('/',auth[_0xeef6('0xc')](),controller['create']);router[_0xeef6('0x13')](_0xeef6('0xe'),auth['isAuthenticated'](),controller[_0xeef6('0x14')]);router[_0xeef6('0x15')](_0xeef6('0xe'),auth[_0xeef6('0xc')](),controller[_0xeef6('0x16')]);module[_0xeef6('0x17')]=router;
\ No newline at end of file
+var _0x3526=['./jscriptySessionReport.controller','isAuthenticated','index','get','show','/:id/questions','getQuestions','post','/:id','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb397d0,_0x123ec9){var _0x1bcb05=function(_0x12370a){while(--_0x12370a){_0xb397d0['push'](_0xb397d0['shift']());}};_0x1bcb05(++_0x123ec9);}(_0x3526,0x12c));var _0x6352=function(_0x192a29,_0x59f8cb){_0x192a29=_0x192a29-0x0;var _0x55963f=_0x3526[_0x192a29];return _0x55963f;};'use strict';var multer=require(_0x6352('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6352('0x1'));var express=require('express');var router=express[_0x6352('0x2')]();var auth=require(_0x6352('0x3'));var interaction=require(_0x6352('0x4'));var config=require(_0x6352('0x5'));var controller=require(_0x6352('0x6'));router['get']('/',auth[_0x6352('0x7')](),controller[_0x6352('0x8')]);router[_0x6352('0x9')]('/describe',auth[_0x6352('0x7')](),controller['describe']);router[_0x6352('0x9')]('/:id',auth[_0x6352('0x7')](),controller[_0x6352('0xa')]);router[_0x6352('0x9')](_0x6352('0xb'),auth[_0x6352('0x7')](),controller[_0x6352('0xc')]);router[_0x6352('0xd')]('/',auth[_0x6352('0x7')](),controller['create']);router['put'](_0x6352('0xe'),auth[_0x6352('0x7')](),controller[_0x6352('0xf')]);router[_0x6352('0x10')](_0x6352('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x6352('0x11')]=router;
\ No newline at end of file
index 3e5cf5b..df99f27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb264=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','starttime','setDataValue','endtime'];(function(_0x5c5cc5,_0x4d2d09){var _0x27ecdc=function(_0x54da31){while(--_0x54da31){_0x5c5cc5['push'](_0x5c5cc5['shift']());}};_0x27ecdc(++_0x4d2d09);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x4b26('0x0'));var Sequelize=require(_0x4b26('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x4b26('0x2')],'set':function(_0x5148a6){this['setDataValue'](_0x4b26('0x3'),_0x5148a6);this[_0x4b26('0x4')](_0x4b26('0x5'),moment()[_0x4b26('0x6')](_0x4b26('0x7')));}},'endtime':{'type':Sequelize[_0x4b26('0x2')]},'membername':{'type':Sequelize[_0x4b26('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4b26('0x8')]},'uniqueid':{'type':Sequelize[_0x4b26('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4b26('0x8')]},'completed':{'type':Sequelize[_0x4b26('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x88a6=['STRING','BOOLEAN','sequelize','exports','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x88a6,0x121));var _0x688a=function(_0x577f3d,_0x43ab79){_0x577f3d=_0x577f3d-0x0;var _0x3b11f6=_0x88a6[_0x577f3d];return _0x3b11f6;};'use strict';var moment=require('moment');var Sequelize=require(_0x688a('0x0'));module[_0x688a('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0xaf3d22){this[_0x688a('0x2')](_0x688a('0x3'),_0xaf3d22);this[_0x688a('0x2')]('endtime',moment()['format'](_0x688a('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x688a('0x5')]},'projectname':{'type':Sequelize[_0x688a('0x5')]},'queue':{'type':Sequelize[_0x688a('0x5')]},'uniqueid':{'type':Sequelize[_0x688a('0x5')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x688a('0x5')]},'completed':{'type':Sequelize[_0x688a('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 89a2e66..32f0036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['field','includeAll','include','catch','show','params','options','find','create','body','describe','getQuestions','JscriptyQuestionReport','hasOwnProperty','SessionId','findAll','rows','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','JscriptySessionReport','rawAttributes','keys','query','intersection','fields','attributes','length','model','nolimit','limit','order','sort','where','filters','dateStart','dateEnd','day','add','merge','filter','map','type','VIRTUAL'];(function(_0x1e69f0,_0x68ccf6){var _0x3ba4aa=function(_0x13fdff){while(--_0x13fdff){_0x1e69f0['push'](_0x1e69f0['shift']());}};_0x3ba4aa(++_0x68ccf6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var qs=require(_0x0d8b('0xf'));var logger=require(_0x0d8b('0x10'))(_0x0d8b('0x11'));var utils=require(_0x0d8b('0x12'));var config=require('../../config/environment');var db=require(_0x0d8b('0x13'))['db'];function respondWithStatusCode(_0x4e0269,_0x4225c4){_0x4225c4=_0x4225c4||0xcc;return function(_0xc574a3){if(_0xc574a3){return _0x4e0269[_0x0d8b('0x14')](_0x4225c4);}return _0x4e0269[_0x0d8b('0x15')](_0x4225c4)[_0x0d8b('0x16')]();};}function respondWithResult(_0x32bb1a,_0x15dd0f){_0x15dd0f=_0x15dd0f||0xc8;return function(_0x31a8cc){if(_0x31a8cc){return _0x32bb1a[_0x0d8b('0x15')](_0x15dd0f)[_0x0d8b('0x17')](_0x31a8cc);}};}function respondWithFilteredResult(_0x5ad086,_0xe65334){return function(_0x1567ce){if(_0x1567ce){var _0x2d4e1c=_0x1567ce[_0x0d8b('0x18')],_0x4f6f21=_0xe65334[_0x0d8b('0x19')],_0x23eb7b=_0xe65334[_0x0d8b('0x19')]+_0xe65334['limit'],_0xa86349;if(_0x23eb7b>=_0x2d4e1c){_0x23eb7b=_0x2d4e1c;_0xa86349=0xc8;}else{_0xa86349=0xce;}_0x5ad086[_0x0d8b('0x15')](_0xa86349);return _0x5ad086[_0x0d8b('0x1a')](_0x0d8b('0x1b'),_0x4f6f21+'-'+_0x23eb7b+'/'+_0x2d4e1c)[_0x0d8b('0x17')](_0x1567ce);}return null;};}function patchUpdates(_0x333674){return function(_0x18dd2d){try{jsonpatch[_0x0d8b('0x1c')](_0x18dd2d,_0x333674,!![]);}catch(_0xa3612a){return BPromise['reject'](_0xa3612a);}return _0x18dd2d[_0x0d8b('0x1d')]();};}function saveUpdates(_0x23d58f,_0x196c0a){return function(_0x143372){if(_0x143372){return _0x143372[_0x0d8b('0x1e')](_0x23d58f)[_0x0d8b('0x1f')](function(_0x393beb){return _0x393beb;});}return null;};}function removeEntity(_0x352c17,_0x50ec1e){return function(_0x4f0a1a){if(_0x4f0a1a){return _0x4f0a1a[_0x0d8b('0x20')]()['then'](function(){_0x352c17['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x238728,_0x2b924f){return function(_0x214778){if(!_0x214778){_0x238728[_0x0d8b('0x14')](0x194);}return _0x214778;};}function handleError(_0x221071,_0x2c64e2){_0x2c64e2=_0x2c64e2||0x1f4;return function(_0x30980c){logger[_0x0d8b('0x21')](_0x30980c[_0x0d8b('0x22')]);if(_0x30980c['name']){delete _0x30980c[_0x0d8b('0x23')];}_0x221071[_0x0d8b('0x15')](_0x2c64e2)['send'](_0x30980c);};}exports[_0x0d8b('0x24')]=function(_0x4a0ae4,_0x3dd149){var _0x234bdd={},_0xa2af02={},_0x4fe6f9={'count':0x0,'rows':[]};var _0x59a905=db[_0x0d8b('0x25')][_0x0d8b('0x26')];_0xa2af02['model']=_[_0x0d8b('0x27')](_0x59a905);var _0x59aa83={'dateStart':_0x4a0ae4[_0x0d8b('0x28')]['dateStart'],'dateEnd':_0x4a0ae4[_0x0d8b('0x28')]['dateEnd']};delete _0x4a0ae4[_0x0d8b('0x28')]['dateStart'];delete _0x4a0ae4[_0x0d8b('0x28')]['dateEnd'];_0xa2af02[_0x0d8b('0x28')]=_[_0x0d8b('0x27')](_0x4a0ae4[_0x0d8b('0x28')]);_0xa2af02['filters']=_['intersection'](_0xa2af02['model'],_0xa2af02[_0x0d8b('0x28')]);_0x234bdd['attributes']=_[_0x0d8b('0x29')](_0xa2af02['model'],qs['fields'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x2a')]));_0x234bdd[_0x0d8b('0x2b')]=_0x234bdd[_0x0d8b('0x2b')][_0x0d8b('0x2c')]?_0x234bdd[_0x0d8b('0x2b')]:_0xa2af02[_0x0d8b('0x2d')];if(!_0x4a0ae4[_0x0d8b('0x28')]['hasOwnProperty'](_0x0d8b('0x2e'))){_0x234bdd[_0x0d8b('0x2f')]=qs['limit'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x2f')]);_0x234bdd[_0x0d8b('0x19')]=qs['offset'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x19')]);}_0x234bdd[_0x0d8b('0x30')]=qs[_0x0d8b('0x31')](_0x4a0ae4[_0x0d8b('0x28')]['sort']);_0x234bdd[_0x0d8b('0x32')]=qs[_0x0d8b('0x33')](_['pick'](_0x4a0ae4[_0x0d8b('0x28')],_0xa2af02[_0x0d8b('0x33')]));if(_0x59aa83[_0x0d8b('0x34')]){if(_0x59aa83[_0x0d8b('0x35')]){_0x59aa83[_0x0d8b('0x35')]=moment(_0x59aa83['dateEnd'])['add'](0x1,_0x0d8b('0x36'));}else{_0x59aa83['dateEnd']=moment(_0x59aa83['dateStart'])[_0x0d8b('0x37')](0x1,_0x0d8b('0x36'));}_[_0x0d8b('0x38')](_0x234bdd[_0x0d8b('0x32')],{'createdAt':{'$gte':_0x59aa83[_0x0d8b('0x34')],'$lte':_0x59aa83[_0x0d8b('0x35')]}});}if(_0x4a0ae4['query'][_0x0d8b('0x39')]){_0x234bdd[_0x0d8b('0x32')]=_[_0x0d8b('0x38')](_0x234bdd[_0x0d8b('0x32')],{'$or':_[_0x0d8b('0x3a')](_0x59a905,function(_0x1a39ad){if(_0x1a39ad[_0x0d8b('0x3b')]['key']!==_0x0d8b('0x3c')){var _0x34acb5={};_0x34acb5[_0x1a39ad[_0x0d8b('0x3d')]]={'$like':'%'+_0x4a0ae4[_0x0d8b('0x28')]['filter']+'%'};return _0x34acb5;}})});}_0x234bdd=_[_0x0d8b('0x38')]({},_0x234bdd,_0x4a0ae4['options']);var _0x37b26c={'where':_0x234bdd[_0x0d8b('0x32')]};return db[_0x0d8b('0x25')][_0x0d8b('0x18')](_0x37b26c)[_0x0d8b('0x1f')](function(_0x3e632e){_0x4fe6f9[_0x0d8b('0x18')]=_0x3e632e;if(_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x234bdd[_0x0d8b('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x234bdd);})['then'](function(_0x4d0811){_0x4fe6f9['rows']=_0x4d0811;return _0x4fe6f9;})[_0x0d8b('0x1f')](respondWithFilteredResult(_0x3dd149,_0x234bdd))[_0x0d8b('0x40')](handleError(_0x3dd149,null));};exports[_0x0d8b('0x41')]=function(_0x5100cf,_0x4a76a3){var _0x1b216d={'raw':!![],'where':{'id':_0x5100cf[_0x0d8b('0x42')]['id']}},_0x192de1={};_0x192de1['model']=_[_0x0d8b('0x27')](db[_0x0d8b('0x25')]['rawAttributes']);_0x192de1['query']=_[_0x0d8b('0x27')](_0x5100cf['query']);_0x192de1[_0x0d8b('0x33')]=_['intersection'](_0x192de1['model'],_0x192de1[_0x0d8b('0x28')]);_0x1b216d[_0x0d8b('0x2b')]=_['intersection'](_0x192de1['model'],qs['fields'](_0x5100cf['query'][_0x0d8b('0x2a')]));_0x1b216d[_0x0d8b('0x2b')]=_0x1b216d[_0x0d8b('0x2b')]['length']?_0x1b216d[_0x0d8b('0x2b')]:_0x192de1[_0x0d8b('0x2d')];if(_0x5100cf[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x1b216d[_0x0d8b('0x3f')]=[{'all':!![]}];}_0x1b216d=_[_0x0d8b('0x38')]({},_0x1b216d,_0x5100cf[_0x0d8b('0x43')]);return db[_0x0d8b('0x25')][_0x0d8b('0x44')](_0x1b216d)[_0x0d8b('0x1f')](handleEntityNotFound(_0x4a76a3,null))[_0x0d8b('0x1f')](respondWithResult(_0x4a76a3,null))[_0x0d8b('0x40')](handleError(_0x4a76a3,null));};exports[_0x0d8b('0x45')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x25')][_0x0d8b('0x45')](_0x3e569b[_0x0d8b('0x46')],{})[_0x0d8b('0x1f')](respondWithResult(_0x570af8,0xc9))['catch'](handleError(_0x570af8,null));};exports[_0x0d8b('0x1e')]=function(_0x4d8850,_0x5d29ab){if(_0x4d8850[_0x0d8b('0x46')]['id']){delete _0x4d8850[_0x0d8b('0x46')]['id'];}return db[_0x0d8b('0x25')][_0x0d8b('0x44')]({'where':{'id':_0x4d8850['params']['id']}})[_0x0d8b('0x1f')](handleEntityNotFound(_0x5d29ab,null))[_0x0d8b('0x1f')](saveUpdates(_0x4d8850[_0x0d8b('0x46')],null))[_0x0d8b('0x1f')](respondWithResult(_0x5d29ab,null))[_0x0d8b('0x40')](handleError(_0x5d29ab,null));};exports['destroy']=function(_0x5c0824,_0x4e4d5f){return db['JscriptySessionReport'][_0x0d8b('0x44')]({'where':{'id':_0x5c0824[_0x0d8b('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e4d5f,null))['then'](removeEntity(_0x4e4d5f,null))[_0x0d8b('0x40')](handleError(_0x4e4d5f,null));};exports[_0x0d8b('0x47')]=function(_0x5c5bd7,_0x5ef6c3){return db[_0x0d8b('0x25')][_0x0d8b('0x47')]()[_0x0d8b('0x1f')](respondWithResult(_0x5ef6c3,null))[_0x0d8b('0x40')](handleError(_0x5ef6c3,null));};exports[_0x0d8b('0x48')]=function(_0x506a79,_0x2de903,_0x2afe34){var _0x5481fc={'raw':!![],'where':{}};var _0x580580={};var _0xf6a773={'count':0x0,'rows':[]};return db[_0x0d8b('0x25')]['findOne']({'where':{'id':_0x506a79['params']['id']}})[_0x0d8b('0x1f')](handleEntityNotFound(_0x2de903,null))[_0x0d8b('0x1f')](function(_0x377027){if(_0x377027){_0x580580[_0x0d8b('0x2d')]=_['keys'](db[_0x0d8b('0x49')]['rawAttributes']);_0x580580['query']=_[_0x0d8b('0x27')](_0x506a79[_0x0d8b('0x28')]);_0x580580['filters']=_['intersection'](_0x580580[_0x0d8b('0x2d')],_0x580580[_0x0d8b('0x28')]);_0x5481fc[_0x0d8b('0x2b')]=_[_0x0d8b('0x29')](_0x580580[_0x0d8b('0x2d')],qs[_0x0d8b('0x2a')](_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x2a')]));_0x5481fc['attributes']=_0x5481fc[_0x0d8b('0x2b')][_0x0d8b('0x2c')]?_0x5481fc[_0x0d8b('0x2b')]:_0x580580[_0x0d8b('0x2d')];if(!_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x4a')](_0x0d8b('0x2e'))){_0x5481fc[_0x0d8b('0x2f')]=qs[_0x0d8b('0x2f')](_0x506a79['query'][_0x0d8b('0x2f')]);_0x5481fc[_0x0d8b('0x19')]=qs[_0x0d8b('0x19')](_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x19')]);}_0x5481fc['order']=qs[_0x0d8b('0x31')](_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x31')]);_0x5481fc[_0x0d8b('0x32')]=qs[_0x0d8b('0x33')](_['pick'](_0x506a79['query'],_0x580580[_0x0d8b('0x33')]));_0x5481fc[_0x0d8b('0x32')][_0x0d8b('0x4b')]=_0x377027['id'];if(_0x506a79[_0x0d8b('0x28')]['filter']){_0x5481fc[_0x0d8b('0x32')]=_[_0x0d8b('0x38')](_0x5481fc[_0x0d8b('0x32')],{'$or':_['map'](_0x5481fc[_0x0d8b('0x2b')],function(_0x532a85){var _0x2fce07={};_0x2fce07[_0x532a85]={'$like':'%'+_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x39')]+'%'};return _0x2fce07;})});}_0x5481fc=_[_0x0d8b('0x38')]({},_0x5481fc,_0x506a79[_0x0d8b('0x43')]);return db[_0x0d8b('0x49')]['count']({'where':_0x5481fc[_0x0d8b('0x32')]})['then'](function(_0x71e8d8){_0xf6a773[_0x0d8b('0x18')]=_0x71e8d8;if(_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x5481fc['include']=[{'all':!![]}];}return db[_0x0d8b('0x49')][_0x0d8b('0x4c')](_0x5481fc);})[_0x0d8b('0x1f')](function(_0x2332fc){_0xf6a773[_0x0d8b('0x4d')]=_0x2332fc;return _0xf6a773;});}})[_0x0d8b('0x1f')](respondWithFilteredResult(_0x2de903,_0x5481fc))[_0x0d8b('0x40')](handleError(_0x2de903,null));};
\ No newline at end of file
+var _0xd8b0=['field','includeAll','include','catch','show','params','options','find','create','body','describe','getQuestions','JscriptyQuestionReport','hasOwnProperty','SessionId','findAll','rows','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','JscriptySessionReport','rawAttributes','keys','query','intersection','fields','attributes','length','model','nolimit','limit','order','sort','where','filters','dateStart','dateEnd','day','add','merge','filter','map','type','VIRTUAL'];(function(_0x1419b9,_0x455362){var _0x9ce63=function(_0x54c2bf){while(--_0x54c2bf){_0x1419b9['push'](_0x1419b9['shift']());}};_0x9ce63(++_0x455362);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var qs=require(_0x0d8b('0xf'));var logger=require(_0x0d8b('0x10'))(_0x0d8b('0x11'));var utils=require(_0x0d8b('0x12'));var config=require('../../config/environment');var db=require(_0x0d8b('0x13'))['db'];function respondWithStatusCode(_0x4e0269,_0x4225c4){_0x4225c4=_0x4225c4||0xcc;return function(_0xc574a3){if(_0xc574a3){return _0x4e0269[_0x0d8b('0x14')](_0x4225c4);}return _0x4e0269[_0x0d8b('0x15')](_0x4225c4)[_0x0d8b('0x16')]();};}function respondWithResult(_0x32bb1a,_0x15dd0f){_0x15dd0f=_0x15dd0f||0xc8;return function(_0x31a8cc){if(_0x31a8cc){return _0x32bb1a[_0x0d8b('0x15')](_0x15dd0f)[_0x0d8b('0x17')](_0x31a8cc);}};}function respondWithFilteredResult(_0x5ad086,_0xe65334){return function(_0x1567ce){if(_0x1567ce){var _0x2d4e1c=_0x1567ce[_0x0d8b('0x18')],_0x4f6f21=_0xe65334[_0x0d8b('0x19')],_0x23eb7b=_0xe65334[_0x0d8b('0x19')]+_0xe65334['limit'],_0xa86349;if(_0x23eb7b>=_0x2d4e1c){_0x23eb7b=_0x2d4e1c;_0xa86349=0xc8;}else{_0xa86349=0xce;}_0x5ad086[_0x0d8b('0x15')](_0xa86349);return _0x5ad086[_0x0d8b('0x1a')](_0x0d8b('0x1b'),_0x4f6f21+'-'+_0x23eb7b+'/'+_0x2d4e1c)[_0x0d8b('0x17')](_0x1567ce);}return null;};}function patchUpdates(_0x333674){return function(_0x18dd2d){try{jsonpatch[_0x0d8b('0x1c')](_0x18dd2d,_0x333674,!![]);}catch(_0xa3612a){return BPromise['reject'](_0xa3612a);}return _0x18dd2d[_0x0d8b('0x1d')]();};}function saveUpdates(_0x23d58f,_0x196c0a){return function(_0x143372){if(_0x143372){return _0x143372[_0x0d8b('0x1e')](_0x23d58f)[_0x0d8b('0x1f')](function(_0x393beb){return _0x393beb;});}return null;};}function removeEntity(_0x352c17,_0x50ec1e){return function(_0x4f0a1a){if(_0x4f0a1a){return _0x4f0a1a[_0x0d8b('0x20')]()['then'](function(){_0x352c17['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x238728,_0x2b924f){return function(_0x214778){if(!_0x214778){_0x238728[_0x0d8b('0x14')](0x194);}return _0x214778;};}function handleError(_0x221071,_0x2c64e2){_0x2c64e2=_0x2c64e2||0x1f4;return function(_0x30980c){logger[_0x0d8b('0x21')](_0x30980c[_0x0d8b('0x22')]);if(_0x30980c['name']){delete _0x30980c[_0x0d8b('0x23')];}_0x221071[_0x0d8b('0x15')](_0x2c64e2)['send'](_0x30980c);};}exports[_0x0d8b('0x24')]=function(_0x4a0ae4,_0x3dd149){var _0x234bdd={},_0xa2af02={},_0x4fe6f9={'count':0x0,'rows':[]};var _0x59a905=db[_0x0d8b('0x25')][_0x0d8b('0x26')];_0xa2af02['model']=_[_0x0d8b('0x27')](_0x59a905);var _0x59aa83={'dateStart':_0x4a0ae4[_0x0d8b('0x28')]['dateStart'],'dateEnd':_0x4a0ae4[_0x0d8b('0x28')]['dateEnd']};delete _0x4a0ae4[_0x0d8b('0x28')]['dateStart'];delete _0x4a0ae4[_0x0d8b('0x28')]['dateEnd'];_0xa2af02[_0x0d8b('0x28')]=_[_0x0d8b('0x27')](_0x4a0ae4[_0x0d8b('0x28')]);_0xa2af02['filters']=_['intersection'](_0xa2af02['model'],_0xa2af02[_0x0d8b('0x28')]);_0x234bdd['attributes']=_[_0x0d8b('0x29')](_0xa2af02['model'],qs['fields'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x2a')]));_0x234bdd[_0x0d8b('0x2b')]=_0x234bdd[_0x0d8b('0x2b')][_0x0d8b('0x2c')]?_0x234bdd[_0x0d8b('0x2b')]:_0xa2af02[_0x0d8b('0x2d')];if(!_0x4a0ae4[_0x0d8b('0x28')]['hasOwnProperty'](_0x0d8b('0x2e'))){_0x234bdd[_0x0d8b('0x2f')]=qs['limit'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x2f')]);_0x234bdd[_0x0d8b('0x19')]=qs['offset'](_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x19')]);}_0x234bdd[_0x0d8b('0x30')]=qs[_0x0d8b('0x31')](_0x4a0ae4[_0x0d8b('0x28')]['sort']);_0x234bdd[_0x0d8b('0x32')]=qs[_0x0d8b('0x33')](_['pick'](_0x4a0ae4[_0x0d8b('0x28')],_0xa2af02[_0x0d8b('0x33')]));if(_0x59aa83[_0x0d8b('0x34')]){if(_0x59aa83[_0x0d8b('0x35')]){_0x59aa83[_0x0d8b('0x35')]=moment(_0x59aa83['dateEnd'])['add'](0x1,_0x0d8b('0x36'));}else{_0x59aa83['dateEnd']=moment(_0x59aa83['dateStart'])[_0x0d8b('0x37')](0x1,_0x0d8b('0x36'));}_[_0x0d8b('0x38')](_0x234bdd[_0x0d8b('0x32')],{'createdAt':{'$gte':_0x59aa83[_0x0d8b('0x34')],'$lte':_0x59aa83[_0x0d8b('0x35')]}});}if(_0x4a0ae4['query'][_0x0d8b('0x39')]){_0x234bdd[_0x0d8b('0x32')]=_[_0x0d8b('0x38')](_0x234bdd[_0x0d8b('0x32')],{'$or':_[_0x0d8b('0x3a')](_0x59a905,function(_0x1a39ad){if(_0x1a39ad[_0x0d8b('0x3b')]['key']!==_0x0d8b('0x3c')){var _0x34acb5={};_0x34acb5[_0x1a39ad[_0x0d8b('0x3d')]]={'$like':'%'+_0x4a0ae4[_0x0d8b('0x28')]['filter']+'%'};return _0x34acb5;}})});}_0x234bdd=_[_0x0d8b('0x38')]({},_0x234bdd,_0x4a0ae4['options']);var _0x37b26c={'where':_0x234bdd[_0x0d8b('0x32')]};return db[_0x0d8b('0x25')][_0x0d8b('0x18')](_0x37b26c)[_0x0d8b('0x1f')](function(_0x3e632e){_0x4fe6f9[_0x0d8b('0x18')]=_0x3e632e;if(_0x4a0ae4[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x234bdd[_0x0d8b('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x234bdd);})['then'](function(_0x4d0811){_0x4fe6f9['rows']=_0x4d0811;return _0x4fe6f9;})[_0x0d8b('0x1f')](respondWithFilteredResult(_0x3dd149,_0x234bdd))[_0x0d8b('0x40')](handleError(_0x3dd149,null));};exports[_0x0d8b('0x41')]=function(_0x5100cf,_0x4a76a3){var _0x1b216d={'raw':!![],'where':{'id':_0x5100cf[_0x0d8b('0x42')]['id']}},_0x192de1={};_0x192de1['model']=_[_0x0d8b('0x27')](db[_0x0d8b('0x25')]['rawAttributes']);_0x192de1['query']=_[_0x0d8b('0x27')](_0x5100cf['query']);_0x192de1[_0x0d8b('0x33')]=_['intersection'](_0x192de1['model'],_0x192de1[_0x0d8b('0x28')]);_0x1b216d[_0x0d8b('0x2b')]=_['intersection'](_0x192de1['model'],qs['fields'](_0x5100cf['query'][_0x0d8b('0x2a')]));_0x1b216d[_0x0d8b('0x2b')]=_0x1b216d[_0x0d8b('0x2b')]['length']?_0x1b216d[_0x0d8b('0x2b')]:_0x192de1[_0x0d8b('0x2d')];if(_0x5100cf[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x1b216d[_0x0d8b('0x3f')]=[{'all':!![]}];}_0x1b216d=_[_0x0d8b('0x38')]({},_0x1b216d,_0x5100cf[_0x0d8b('0x43')]);return db[_0x0d8b('0x25')][_0x0d8b('0x44')](_0x1b216d)[_0x0d8b('0x1f')](handleEntityNotFound(_0x4a76a3,null))[_0x0d8b('0x1f')](respondWithResult(_0x4a76a3,null))[_0x0d8b('0x40')](handleError(_0x4a76a3,null));};exports[_0x0d8b('0x45')]=function(_0x3e569b,_0x570af8){return db[_0x0d8b('0x25')][_0x0d8b('0x45')](_0x3e569b[_0x0d8b('0x46')],{})[_0x0d8b('0x1f')](respondWithResult(_0x570af8,0xc9))['catch'](handleError(_0x570af8,null));};exports[_0x0d8b('0x1e')]=function(_0x4d8850,_0x5d29ab){if(_0x4d8850[_0x0d8b('0x46')]['id']){delete _0x4d8850[_0x0d8b('0x46')]['id'];}return db[_0x0d8b('0x25')][_0x0d8b('0x44')]({'where':{'id':_0x4d8850['params']['id']}})[_0x0d8b('0x1f')](handleEntityNotFound(_0x5d29ab,null))[_0x0d8b('0x1f')](saveUpdates(_0x4d8850[_0x0d8b('0x46')],null))[_0x0d8b('0x1f')](respondWithResult(_0x5d29ab,null))[_0x0d8b('0x40')](handleError(_0x5d29ab,null));};exports['destroy']=function(_0x5c0824,_0x4e4d5f){return db['JscriptySessionReport'][_0x0d8b('0x44')]({'where':{'id':_0x5c0824[_0x0d8b('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e4d5f,null))['then'](removeEntity(_0x4e4d5f,null))[_0x0d8b('0x40')](handleError(_0x4e4d5f,null));};exports[_0x0d8b('0x47')]=function(_0x5c5bd7,_0x5ef6c3){return db[_0x0d8b('0x25')][_0x0d8b('0x47')]()[_0x0d8b('0x1f')](respondWithResult(_0x5ef6c3,null))[_0x0d8b('0x40')](handleError(_0x5ef6c3,null));};exports[_0x0d8b('0x48')]=function(_0x506a79,_0x2de903,_0x2afe34){var _0x5481fc={'raw':!![],'where':{}};var _0x580580={};var _0xf6a773={'count':0x0,'rows':[]};return db[_0x0d8b('0x25')]['findOne']({'where':{'id':_0x506a79['params']['id']}})[_0x0d8b('0x1f')](handleEntityNotFound(_0x2de903,null))[_0x0d8b('0x1f')](function(_0x377027){if(_0x377027){_0x580580[_0x0d8b('0x2d')]=_['keys'](db[_0x0d8b('0x49')]['rawAttributes']);_0x580580['query']=_[_0x0d8b('0x27')](_0x506a79[_0x0d8b('0x28')]);_0x580580['filters']=_['intersection'](_0x580580[_0x0d8b('0x2d')],_0x580580[_0x0d8b('0x28')]);_0x5481fc[_0x0d8b('0x2b')]=_[_0x0d8b('0x29')](_0x580580[_0x0d8b('0x2d')],qs[_0x0d8b('0x2a')](_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x2a')]));_0x5481fc['attributes']=_0x5481fc[_0x0d8b('0x2b')][_0x0d8b('0x2c')]?_0x5481fc[_0x0d8b('0x2b')]:_0x580580[_0x0d8b('0x2d')];if(!_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x4a')](_0x0d8b('0x2e'))){_0x5481fc[_0x0d8b('0x2f')]=qs[_0x0d8b('0x2f')](_0x506a79['query'][_0x0d8b('0x2f')]);_0x5481fc[_0x0d8b('0x19')]=qs[_0x0d8b('0x19')](_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x19')]);}_0x5481fc['order']=qs[_0x0d8b('0x31')](_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x31')]);_0x5481fc[_0x0d8b('0x32')]=qs[_0x0d8b('0x33')](_['pick'](_0x506a79['query'],_0x580580[_0x0d8b('0x33')]));_0x5481fc[_0x0d8b('0x32')][_0x0d8b('0x4b')]=_0x377027['id'];if(_0x506a79[_0x0d8b('0x28')]['filter']){_0x5481fc[_0x0d8b('0x32')]=_[_0x0d8b('0x38')](_0x5481fc[_0x0d8b('0x32')],{'$or':_['map'](_0x5481fc[_0x0d8b('0x2b')],function(_0x532a85){var _0x2fce07={};_0x2fce07[_0x532a85]={'$like':'%'+_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x39')]+'%'};return _0x2fce07;})});}_0x5481fc=_[_0x0d8b('0x38')]({},_0x5481fc,_0x506a79[_0x0d8b('0x43')]);return db[_0x0d8b('0x49')]['count']({'where':_0x5481fc[_0x0d8b('0x32')]})['then'](function(_0x71e8d8){_0xf6a773[_0x0d8b('0x18')]=_0x71e8d8;if(_0x506a79[_0x0d8b('0x28')][_0x0d8b('0x3e')]){_0x5481fc['include']=[{'all':!![]}];}return db[_0x0d8b('0x49')][_0x0d8b('0x4c')](_0x5481fc);})[_0x0d8b('0x1f')](function(_0x2332fc){_0xf6a773[_0x0d8b('0x4d')]=_0x2332fc;return _0xf6a773;});}})[_0x0d8b('0x1f')](respondWithFilteredResult(_0x2de903,_0x5481fc))[_0x0d8b('0x40')](handleError(_0x2de903,null));};
\ No newline at end of file
index f23bee6..ff08a97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5fc=['api','moment','bluebird','request-promise','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util'];(function(_0xe70d16,_0x4acf0a){var _0x1b01e7=function(_0x3cd066){while(--_0x3cd066){_0xe70d16['push'](_0xe70d16['shift']());}};_0x1b01e7(++_0x4acf0a);}(_0xb5fc,0x11e));var _0xcb5f=function(_0x54f1ce,_0x481a01){_0x54f1ce=_0x54f1ce-0x0;var _0x4f1712=_0xb5fc[_0x54f1ce];return _0x4f1712;};'use strict';var _=require(_0xcb5f('0x0'));var util=require(_0xcb5f('0x1'));var logger=require('../../config/logger')(_0xcb5f('0x2'));var moment=require(_0xcb5f('0x3'));var BPromise=require(_0xcb5f('0x4'));var rp=require(_0xcb5f('0x5'));var attributes=require(_0xcb5f('0x6'));module['exports']=function(_0x4fbc91,_0x11b2d2){return _0x4fbc91[_0xcb5f('0x7')]('JscriptySessionReport',attributes,{'tableName':_0xcb5f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x435b=['exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','bluebird','request-promise','./jscriptySessionReport.attributes'];(function(_0x29e398,_0x890225){var _0xd799e2=function(_0x4fcf2f){while(--_0x4fcf2f){_0x29e398['push'](_0x29e398['shift']());}};_0xd799e2(++_0x890225);}(_0x435b,0xf6));var _0xb435=function(_0x411118,_0x346809){_0x411118=_0x411118-0x0;var _0x168b7d=_0x435b[_0x411118];return _0x168b7d;};'use strict';var _=require(_0xb435('0x0'));var util=require(_0xb435('0x1'));var logger=require(_0xb435('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb435('0x3'));var rp=require(_0xb435('0x4'));var attributes=require(_0xb435('0x5'));module[_0xb435('0x6')]=function(_0x2d6efc,_0x386e11){return _0x2d6efc['define'](_0xb435('0x7'),attributes,{'tableName':_0xb435('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3a7ba2e..ec77910 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd98a=['client','http','then','info','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x598bf4,_0x1d3f14){var _0x2000d3=function(_0x513036){while(--_0x513036){_0x598bf4['push'](_0x598bf4['shift']());}};_0x2000d3(++_0x1d3f14);}(_0xd98a,0xfc));var _0xad98=function(_0x3edb48,_0x5546ad){_0x3edb48=_0x3edb48-0x0;var _0x1e1be9=_0xd98a[_0x3edb48];return _0x1e1be9;};'use strict';var _=require(_0xad98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xad98('0x1'));var rs=require(_0xad98('0x2'));var fs=require('fs');var Redis=require(_0xad98('0x3'));var db=require(_0xad98('0x4'))['db'];var utils=require(_0xad98('0x5'));var logger=require(_0xad98('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad98('0x7'));var client=jayson[_0xad98('0x8')][_0xad98('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cd316,_0x2bf76c,_0x480c93){return new BPromise(function(_0x20712b,_0x34eb2d){return client['request'](_0x2cd316,_0x480c93)[_0xad98('0xa')](function(_0x5016b4){logger[_0xad98('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x2bf76c,'request\x20sent');logger['debug'](_0xad98('0xc'),_0x2bf76c,_0xad98('0xd'),JSON[_0xad98('0xe')](_0x5016b4));if(_0x5016b4[_0xad98('0xf')]){if(_0x5016b4['error']['code']===0x1f4){logger[_0xad98('0xf')](_0xad98('0x10'),_0x2bf76c,_0x5016b4[_0xad98('0xf')][_0xad98('0x11')]);return _0x34eb2d(_0x5016b4[_0xad98('0xf')][_0xad98('0x11')]);}logger[_0xad98('0xf')](_0xad98('0x10'),_0x2bf76c,_0x5016b4[_0xad98('0xf')]['message']);return _0x20712b(_0x5016b4[_0xad98('0xf')][_0xad98('0x11')]);}else{logger[_0xad98('0xb')](_0xad98('0x10'),_0x2bf76c,_0xad98('0xd'));_0x20712b(_0x5016b4[_0xad98('0x12')][_0xad98('0x11')]);}})[_0xad98('0x13')](function(_0x1c98e7){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x2bf76c,_0x1c98e7);_0x34eb2d(_0x1c98e7);});});}
\ No newline at end of file
+var _0xcfcb=['result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','info'];(function(_0x5d4ed7,_0x3dd607){var _0xac91be=function(_0x1144f0){while(--_0x1144f0){_0x5d4ed7['push'](_0x5d4ed7['shift']());}};_0xac91be(++_0x3dd607);}(_0xcfcb,0x7a));var _0xbcfc=function(_0x4e85f2,_0x1cf40b){_0x4e85f2=_0x4e85f2-0x0;var _0x3ac183=_0xcfcb[_0x4e85f2];return _0x3ac183;};'use strict';var _=require(_0xbcfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbcfc('0x1'));var fs=require('fs');var Redis=require(_0xbcfc('0x2'));var db=require(_0xbcfc('0x3'))['db'];var utils=require(_0xbcfc('0x4'));var logger=require(_0xbcfc('0x5'))(_0xbcfc('0x6'));var config=require(_0xbcfc('0x7'));var jayson=require(_0xbcfc('0x8'));var client=jayson[_0xbcfc('0x9')][_0xbcfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4056a8,_0x42052a,_0x2a57ad){return new BPromise(function(_0x349e53,_0x29b308){return client[_0xbcfc('0xb')](_0x4056a8,_0x2a57ad)[_0xbcfc('0xc')](function(_0x47c569){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x42052a,'request\x20sent');logger[_0xbcfc('0xd')](_0xbcfc('0xe'),_0x42052a,_0xbcfc('0xf'),JSON[_0xbcfc('0x10')](_0x47c569));if(_0x47c569[_0xbcfc('0x11')]){if(_0x47c569[_0xbcfc('0x11')][_0xbcfc('0x12')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x42052a,_0x47c569[_0xbcfc('0x11')][_0xbcfc('0x13')]);return _0x29b308(_0x47c569['error'][_0xbcfc('0x13')]);}logger['error'](_0xbcfc('0x14'),_0x42052a,_0x47c569[_0xbcfc('0x11')]['message']);return _0x349e53(_0x47c569[_0xbcfc('0x11')][_0xbcfc('0x13')]);}else{logger[_0xbcfc('0x15')](_0xbcfc('0x14'),_0x42052a,_0xbcfc('0xf'));_0x349e53(_0x47c569[_0xbcfc('0x16')]['message']);}})[_0xbcfc('0x17')](function(_0x125773){logger['error'](_0xbcfc('0x14'),_0x42052a,_0x125773);_0x29b308(_0x125773);});});}
\ No newline at end of file
index a0a1c40..5806e8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ee=['update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id','isAuthenticated'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x54ee,0x17c));var _0xe54e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x54ee[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xe54e('0x0'));var util=require('util');var path=require(_0xe54e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe54e('0x2'));var router=express[_0xe54e('0x3')]();var auth=require(_0xe54e('0x4'));var interaction=require(_0xe54e('0x5'));var config=require(_0xe54e('0x6'));var controller=require(_0xe54e('0x7'));router[_0xe54e('0x8')]('/',controller['index']);router[_0xe54e('0x9')](_0xe54e('0xa'),auth[_0xe54e('0xb')](),controller[_0xe54e('0xc')]);module[_0xe54e('0xd')]=router;
\ No newline at end of file
+var _0xe168=['express','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','update','multer','util','path','connect-timeout'];(function(_0x145d15,_0xc75b56){var _0x5c5bf3=function(_0x13ce4e){while(--_0x13ce4e){_0x145d15['push'](_0x145d15['shift']());}};_0x5c5bf3(++_0xc75b56);}(_0xe168,0x194));var _0x8e16=function(_0x50f4a8,_0x247c79){_0x50f4a8=_0x50f4a8-0x0;var _0x1444fb=_0xe168[_0x50f4a8];return _0x1444fb;};'use strict';var multer=require(_0x8e16('0x0'));var util=require(_0x8e16('0x1'));var path=require(_0x8e16('0x2'));var timeout=require(_0x8e16('0x3'));var express=require(_0x8e16('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8e16('0x5'));var config=require(_0x8e16('0x6'));var controller=require(_0x8e16('0x7'));router[_0x8e16('0x8')]('/',controller[_0x8e16('0x9')]);router['put'](_0x8e16('0xa'),auth['isAuthenticated'](),controller[_0x8e16('0xb')]);module['exports']=router;
\ No newline at end of file
index c56d85e..a5eefc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0c5=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x23bb77,_0x4d374a){var _0x3d6761=function(_0x581a66){while(--_0x581a66){_0x23bb77['push'](_0x23bb77['shift']());}};_0x3d6761(++_0x4d374a);}(_0xf0c5,0xdd));var _0x5f0c=function(_0x52d72b,_0x1604c4){_0x52d72b=_0x52d72b-0x0;var _0x547c18=_0xf0c5[_0x52d72b];return _0x547c18;};'use strict';var Sequelize=require(_0x5f0c('0x0'));module[_0x5f0c('0x1')]={'license':{'type':Sequelize[_0x5f0c('0x2')]},'data1':{'type':Sequelize[_0x5f0c('0x3')]},'data2':{'type':Sequelize[_0x5f0c('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x5f0c('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6e47=['INTEGER','sequelize','TEXT','STRING'];(function(_0x50c00a,_0x2afdb8){var _0x37e299=function(_0x21f5ac){while(--_0x21f5ac){_0x50c00a['push'](_0x50c00a['shift']());}};_0x37e299(++_0x2afdb8);}(_0x6e47,0x1f1));var _0x76e4=function(_0x43c4e6,_0xe1b8a1){_0x43c4e6=_0x43c4e6-0x0;var _0x105529=_0x6e47[_0x43c4e6];return _0x105529;};'use strict';var Sequelize=require(_0x76e4('0x0'));module['exports']={'license':{'type':Sequelize[_0x76e4('0x1')]},'data1':{'type':Sequelize[_0x76e4('0x2')]},'data2':{'type':Sequelize[_0x76e4('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x76e4('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index ed4b1c6..75e68c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['body','params','checkLicense','key','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','options'];(function(_0x14bed5,_0x49a3d8){var _0x4fdc80=function(_0x4edc2a){while(--_0x4edc2a){_0x14bed5['push'](_0x14bed5['shift']());}};_0x4fdc80(++_0x49a3d8);}(_0xadb5,0xad));var _0x5adb=function(_0x3c5b39,_0x31fa08){_0x3c5b39=_0x3c5b39-0x0;var _0x20b214=_0xadb5[_0x3c5b39];return _0x20b214;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var qs=require(_0x5adb('0x12'));var logger=require(_0x5adb('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5adb('0x14'));var db=require(_0x5adb('0x15'))['db'];function respondWithStatusCode(_0x82e67e,_0x53b772){_0x53b772=_0x53b772||0xcc;return function(_0x29f0d5){if(_0x29f0d5){return _0x82e67e['sendStatus'](_0x53b772);}return _0x82e67e[_0x5adb('0x16')](_0x53b772)['end']();};}function respondWithResult(_0x8cfcc6,_0x39a0b3){_0x39a0b3=_0x39a0b3||0xc8;return function(_0x44abe3){if(_0x44abe3){return _0x8cfcc6['status'](_0x39a0b3)[_0x5adb('0x17')](_0x44abe3);}};}function respondWithFilteredResult(_0x34af2c,_0xf82f72){return function(_0x5263ec){if(_0x5263ec){var _0x2312de=_0x5263ec[_0x5adb('0x18')],_0x518823=_0xf82f72[_0x5adb('0x19')],_0x367d82=_0xf82f72[_0x5adb('0x19')]+_0xf82f72[_0x5adb('0x1a')],_0x42a482;if(_0x367d82>=_0x2312de){_0x367d82=_0x2312de;_0x42a482=0xc8;}else{_0x42a482=0xce;}_0x34af2c[_0x5adb('0x16')](_0x42a482);return _0x34af2c[_0x5adb('0x1b')](_0x5adb('0x1c'),_0x518823+'-'+_0x367d82+'/'+_0x2312de)['json'](_0x5263ec);}return null;};}function patchUpdates(_0x3fff62){return function(_0x5de028){try{jsonpatch[_0x5adb('0x1d')](_0x5de028,_0x3fff62,!![]);}catch(_0x558f76){return BPromise[_0x5adb('0x1e')](_0x558f76);}return _0x5de028['save']();};}function saveUpdates(_0x5e218c,_0x1fbaa5){return function(_0x1bed20){if(_0x1bed20){return _0x1bed20[_0x5adb('0x1f')](_0x5e218c)[_0x5adb('0x20')](function(_0x99bc6c){return _0x99bc6c;});}return null;};}function removeEntity(_0x5af69d,_0x3255b3){return function(_0x5c296e){if(_0x5c296e){return _0x5c296e['destroy']()[_0x5adb('0x20')](function(){_0x5af69d[_0x5adb('0x16')](0xcc)[_0x5adb('0x21')]();});}};}function handleEntityNotFound(_0x1a8014,_0x1e9ccf){return function(_0x413911){if(!_0x413911){_0x1a8014[_0x5adb('0x22')](0x194);}return _0x413911;};}function handleError(_0x4ca150,_0x4b1957){_0x4b1957=_0x4b1957||0x1f4;return function(_0x373cc3){logger[_0x5adb('0x23')](_0x373cc3[_0x5adb('0x24')]);if(_0x373cc3[_0x5adb('0x25')]){delete _0x373cc3['name'];}_0x4ca150[_0x5adb('0x16')](_0x4b1957)[_0x5adb('0x26')](_0x373cc3);};}var utilLicense=require('../../config/license/util');exports[_0x5adb('0x27')]=function(_0x1ded9f,_0x1a0acd){var _0x55b40a={'raw':!![],'where':{'id':0x1}},_0x13ad1d={};_0x13ad1d[_0x5adb('0x28')]=_[_0x5adb('0x29')](db[_0x5adb('0x2a')][_0x5adb('0x2b')]);_0x13ad1d[_0x5adb('0x2c')]=_['keys'](_0x1ded9f['query']);_0x13ad1d['filters']=_[_0x5adb('0x2d')](_0x13ad1d[_0x5adb('0x28')],_0x13ad1d[_0x5adb('0x2c')]);_0x55b40a[_0x5adb('0x2e')]=_[_0x5adb('0x2d')](_0x13ad1d['model'],qs[_0x5adb('0x2f')](_0x1ded9f[_0x5adb('0x2c')][_0x5adb('0x2f')]));_0x55b40a[_0x5adb('0x2e')]=_0x55b40a[_0x5adb('0x2e')][_0x5adb('0x30')]?_0x55b40a[_0x5adb('0x2e')]:_0x13ad1d[_0x5adb('0x28')];_0x55b40a=_[_0x5adb('0x31')]({},_0x55b40a,_0x1ded9f[_0x5adb('0x32')]);return utilLicense['getLicense'](_0x55b40a)[_0x5adb('0x20')](respondWithResult(_0x1a0acd,null))['catch'](handleError(_0x1a0acd,null));};exports[_0x5adb('0x1f')]=function(_0x20cde6,_0x5d1441){if(_0x20cde6[_0x5adb('0x33')]['id']){delete _0x20cde6[_0x5adb('0x33')]['id'];}return db[_0x5adb('0x2a')]['find']({'where':{'id':_0x20cde6[_0x5adb('0x34')]['id']}})[_0x5adb('0x20')](handleEntityNotFound(_0x5d1441,null))['then'](function(_0x5bb227){var _0x1ed9ea=_0x5bb227['get']({'plain':!![]});return utilLicense[_0x5adb('0x35')](_0x1ed9ea,_0x20cde6[_0x5adb('0x33')][_0x5adb('0x36')]);})[_0x5adb('0x20')](function(_0x9bdece){if(!_0x9bdece['demo']){return saveUpdates(_0x20cde6[_0x5adb('0x33')],null);}return _0x9bdece;})[_0x5adb('0x20')](respondWithResult(_0x5d1441,null))[_0x5adb('0x37')](handleError(_0x5d1441,null));};
\ No newline at end of file
+var _0x5464=['../../config/license/util','index','model','keys','License','rawAttributes','query','filters','fields','length','attributes','options','getLicense','catch','body','find','params','checkLicense','demo','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','offset','limit','status','set','Content-Range','apply','reject','save','update','then','end','error','stack','name'];(function(_0x21f1bd,_0x5049b7){var _0x4ab8bf=function(_0x180d72){while(--_0x180d72){_0x21f1bd['push'](_0x21f1bd['shift']());}};_0x4ab8bf(++_0x5049b7);}(_0x5464,0x15d));var _0x4546=function(_0x3f594c,_0x318f5c){_0x3f594c=_0x3f594c-0x0;var _0xb21637=_0x5464[_0x3f594c];return _0xb21637;};'use strict';var pdf=require(_0x4546('0x0'));var emlformat=require(_0x4546('0x1'));var rimraf=require(_0x4546('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4546('0x3'));var rp=require('request-promise');var moment=require(_0x4546('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4546('0x5'));var util=require(_0x4546('0x6'));var path=require(_0x4546('0x7'));var sox=require(_0x4546('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0xd'));var querystring=require(_0x4546('0xe'));var Papa=require(_0x4546('0xf'));var Redis=require(_0x4546('0x10'));var qs=require(_0x4546('0x11'));var logger=require('../../config/logger')(_0x4546('0x12'));var utils=require(_0x4546('0x13'));var config=require(_0x4546('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f82c9,_0x131b65){_0x131b65=_0x131b65||0xcc;return function(_0x23818b){if(_0x23818b){return _0x1f82c9[_0x4546('0x15')](_0x131b65);}return _0x1f82c9['status'](_0x131b65)['end']();};}function respondWithResult(_0x3e6622,_0x57cf5f){_0x57cf5f=_0x57cf5f||0xc8;return function(_0x59eb29){if(_0x59eb29){return _0x3e6622['status'](_0x57cf5f)['json'](_0x59eb29);}};}function respondWithFilteredResult(_0x598516,_0x4f5571){return function(_0x102180){if(_0x102180){var _0x51e279=_0x102180['count'],_0x363a17=_0x4f5571[_0x4546('0x16')],_0x54581c=_0x4f5571[_0x4546('0x16')]+_0x4f5571[_0x4546('0x17')],_0x26fc0e;if(_0x54581c>=_0x51e279){_0x54581c=_0x51e279;_0x26fc0e=0xc8;}else{_0x26fc0e=0xce;}_0x598516[_0x4546('0x18')](_0x26fc0e);return _0x598516[_0x4546('0x19')](_0x4546('0x1a'),_0x363a17+'-'+_0x54581c+'/'+_0x51e279)['json'](_0x102180);}return null;};}function patchUpdates(_0x4ffd6b){return function(_0x5780a7){try{jsonpatch[_0x4546('0x1b')](_0x5780a7,_0x4ffd6b,!![]);}catch(_0x39f552){return BPromise[_0x4546('0x1c')](_0x39f552);}return _0x5780a7[_0x4546('0x1d')]();};}function saveUpdates(_0x1d412c,_0x337a44){return function(_0x3ec009){if(_0x3ec009){return _0x3ec009[_0x4546('0x1e')](_0x1d412c)[_0x4546('0x1f')](function(_0xceb1d6){return _0xceb1d6;});}return null;};}function removeEntity(_0x57d740,_0x2d689f){return function(_0x392b69){if(_0x392b69){return _0x392b69['destroy']()[_0x4546('0x1f')](function(){_0x57d740[_0x4546('0x18')](0xcc)[_0x4546('0x20')]();});}};}function handleEntityNotFound(_0x2f065d,_0xc2997d){return function(_0x15b013){if(!_0x15b013){_0x2f065d['sendStatus'](0x194);}return _0x15b013;};}function handleError(_0x3dab5c,_0x2cca8b){_0x2cca8b=_0x2cca8b||0x1f4;return function(_0x4f9fcf){logger[_0x4546('0x21')](_0x4f9fcf[_0x4546('0x22')]);if(_0x4f9fcf[_0x4546('0x23')]){delete _0x4f9fcf[_0x4546('0x23')];}_0x3dab5c[_0x4546('0x18')](_0x2cca8b)['send'](_0x4f9fcf);};}var utilLicense=require(_0x4546('0x24'));exports[_0x4546('0x25')]=function(_0x831fa5,_0x48fc36){var _0x4c1dad={'raw':!![],'where':{'id':0x1}},_0x43740e={};_0x43740e[_0x4546('0x26')]=_[_0x4546('0x27')](db[_0x4546('0x28')][_0x4546('0x29')]);_0x43740e[_0x4546('0x2a')]=_[_0x4546('0x27')](_0x831fa5['query']);_0x43740e[_0x4546('0x2b')]=_['intersection'](_0x43740e[_0x4546('0x26')],_0x43740e[_0x4546('0x2a')]);_0x4c1dad['attributes']=_['intersection'](_0x43740e[_0x4546('0x26')],qs['fields'](_0x831fa5[_0x4546('0x2a')][_0x4546('0x2c')]));_0x4c1dad['attributes']=_0x4c1dad['attributes'][_0x4546('0x2d')]?_0x4c1dad[_0x4546('0x2e')]:_0x43740e[_0x4546('0x26')];_0x4c1dad=_['merge']({},_0x4c1dad,_0x831fa5[_0x4546('0x2f')]);return utilLicense[_0x4546('0x30')](_0x4c1dad)['then'](respondWithResult(_0x48fc36,null))[_0x4546('0x31')](handleError(_0x48fc36,null));};exports['update']=function(_0x2a3541,_0x44f604){if(_0x2a3541[_0x4546('0x32')]['id']){delete _0x2a3541[_0x4546('0x32')]['id'];}return db['License'][_0x4546('0x33')]({'where':{'id':_0x2a3541[_0x4546('0x34')]['id']}})[_0x4546('0x1f')](handleEntityNotFound(_0x44f604,null))[_0x4546('0x1f')](function(_0x1487fd){var _0x27f7b0=_0x1487fd['get']({'plain':!![]});return utilLicense[_0x4546('0x35')](_0x27f7b0,_0x2a3541[_0x4546('0x32')]['key']);})['then'](function(_0x3eb8e8){if(!_0x3eb8e8[_0x4546('0x36')]){return saveUpdates(_0x2a3541['body'],null);}return _0x3eb8e8;})[_0x4546('0x1f')](respondWithResult(_0x44f604,null))[_0x4546('0x31')](handleError(_0x44f604,null));};
\ No newline at end of file
index 4b3b0c8..bedf558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc01b=['bluebird','request-promise','exports','define','License','license','lodash','util','../../config/logger','api','moment'];(function(_0x3fc726,_0x3bb2d3){var _0x4ca942=function(_0x23c5a6){while(--_0x23c5a6){_0x3fc726['push'](_0x3fc726['shift']());}};_0x4ca942(++_0x3bb2d3);}(_0xc01b,0x74));var _0xbc01=function(_0x56bee1,_0x1d459b){_0x56bee1=_0x56bee1-0x0;var _0x5a2d14=_0xc01b[_0x56bee1];return _0x5a2d14;};'use strict';var _=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var logger=require(_0xbc01('0x2'))(_0xbc01('0x3'));var moment=require(_0xbc01('0x4'));var BPromise=require(_0xbc01('0x5'));var rp=require(_0xbc01('0x6'));var attributes=require('./license.attributes');module[_0xbc01('0x7')]=function(_0x133078,_0x222fa3){return _0x133078[_0xbc01('0x8')](_0xbc01('0x9'),attributes,{'tableName':_0xbc01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x682e=['lodash','util','../../config/logger','api','moment','bluebird','./license.attributes','exports','define','License','license'];(function(_0x447725,_0x49753b){var _0x399167=function(_0x1e47d9){while(--_0x1e47d9){_0x447725['push'](_0x447725['shift']());}};_0x399167(++_0x49753b);}(_0x682e,0x1ce));var _0xe682=function(_0x35836b,_0xda40f1){_0x35836b=_0x35836b-0x0;var _0x7650d0=_0x682e[_0x35836b];return _0x7650d0;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var logger=require(_0xe682('0x2'))(_0xe682('0x3'));var moment=require(_0xe682('0x4'));var BPromise=require(_0xe682('0x5'));var rp=require('request-promise');var attributes=require(_0xe682('0x6'));module[_0xe682('0x7')]=function(_0x3705a2,_0x44f74e){return _0x3705a2[_0xe682('0x8')](_0xe682('0x9'),attributes,{'tableName':_0xe682('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea26d6e..6190354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7202=['debug','License,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','License,\x20%s,\x20%s'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x7202,0x110));var _0x2720=function(_0x2341a7,_0x2378bf){_0x2341a7=_0x2341a7-0x0;var _0x277d41=_0x7202[_0x2341a7];return _0x277d41;};'use strict';var _=require(_0x2720('0x0'));var util=require('util');var moment=require(_0x2720('0x1'));var BPromise=require(_0x2720('0x2'));var rs=require(_0x2720('0x3'));var fs=require('fs');var Redis=require(_0x2720('0x4'));var db=require(_0x2720('0x5'))['db'];var utils=require(_0x2720('0x6'));var logger=require(_0x2720('0x7'))('rpc');var config=require(_0x2720('0x8'));var jayson=require(_0x2720('0x9'));var client=jayson[_0x2720('0xa')][_0x2720('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xce7575,_0x3f8029,_0xea2783){return new BPromise(function(_0xf98362,_0x26442f){return client['request'](_0xce7575,_0xea2783)['then'](function(_0x52ee24){logger[_0x2720('0xc')](_0x2720('0xd'),_0x3f8029,'request\x20sent');logger[_0x2720('0xe')](_0x2720('0xf'),_0x3f8029,'request\x20sent',JSON['stringify'](_0x52ee24));if(_0x52ee24[_0x2720('0x10')]){if(_0x52ee24['error'][_0x2720('0x11')]===0x1f4){logger[_0x2720('0x10')](_0x2720('0xd'),_0x3f8029,_0x52ee24[_0x2720('0x10')][_0x2720('0x12')]);return _0x26442f(_0x52ee24['error']['message']);}logger['error'](_0x2720('0xd'),_0x3f8029,_0x52ee24[_0x2720('0x10')][_0x2720('0x12')]);return _0xf98362(_0x52ee24[_0x2720('0x10')][_0x2720('0x12')]);}else{logger[_0x2720('0xc')](_0x2720('0xd'),_0x3f8029,_0x2720('0x13'));_0xf98362(_0x52ee24[_0x2720('0x14')][_0x2720('0x12')]);}})[_0x2720('0x15')](function(_0x1279a1){logger[_0x2720('0x10')](_0x2720('0xd'),_0x3f8029,_0x1279a1);_0x26442f(_0x1279a1);});});}
\ No newline at end of file
+var _0x4a7e=['License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','debug'];(function(_0x5720ed,_0x284602){var _0x4cad4c=function(_0x450548){while(--_0x450548){_0x5720ed['push'](_0x5720ed['shift']());}};_0x4cad4c(++_0x284602);}(_0x4a7e,0x194));var _0xe4a7=function(_0x157fb8,_0x519c48){_0x157fb8=_0x157fb8-0x0;var _0x3938eb=_0x4a7e[_0x157fb8];return _0x3938eb;};'use strict';var _=require(_0xe4a7('0x0'));var util=require(_0xe4a7('0x1'));var moment=require(_0xe4a7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4a7('0x3'));var db=require(_0xe4a7('0x4'))['db'];var utils=require(_0xe4a7('0x5'));var logger=require('../../config/logger')(_0xe4a7('0x6'));var config=require('../../config/environment');var jayson=require(_0xe4a7('0x7'));var client=jayson[_0xe4a7('0x8')][_0xe4a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21e1ea,_0x4d5858,_0x5c04b6){return new BPromise(function(_0x54f93d,_0x2cb4bf){return client['request'](_0x21e1ea,_0x5c04b6)[_0xe4a7('0xa')](function(_0x1cf723){logger[_0xe4a7('0xb')](_0xe4a7('0xc'),_0x4d5858,'request\x20sent');logger[_0xe4a7('0xd')](_0xe4a7('0xe'),_0x4d5858,_0xe4a7('0xf'),JSON[_0xe4a7('0x10')](_0x1cf723));if(_0x1cf723[_0xe4a7('0x11')]){if(_0x1cf723[_0xe4a7('0x11')][_0xe4a7('0x12')]===0x1f4){logger['error'](_0xe4a7('0xc'),_0x4d5858,_0x1cf723[_0xe4a7('0x11')][_0xe4a7('0x13')]);return _0x2cb4bf(_0x1cf723[_0xe4a7('0x11')][_0xe4a7('0x13')]);}logger[_0xe4a7('0x11')](_0xe4a7('0xc'),_0x4d5858,_0x1cf723[_0xe4a7('0x11')][_0xe4a7('0x13')]);return _0x54f93d(_0x1cf723[_0xe4a7('0x11')][_0xe4a7('0x13')]);}else{logger['info'](_0xe4a7('0xc'),_0x4d5858,_0xe4a7('0xf'));_0x54f93d(_0x1cf723[_0xe4a7('0x14')][_0xe4a7('0x13')]);}})[_0xe4a7('0x15')](function(_0xcdf5ea){logger['error'](_0xe4a7('0xc'),_0x4d5858,_0xcdf5ea);_0x2cb4bf(_0xcdf5ea);});});}
\ No newline at end of file
index e89abbf..df8f5e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','verifySmtp','/:id/users','getAgents','post','/:id/in_servers','addImap','addSmtp','/:id/interactions','addInteraction','/:id/send','send','addAgents'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailAccount.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x8')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x8')]('/:id/in_servers',auth[_0x7995('0x9')](),controller[_0x7995('0x12')]);router[_0x7995('0x8')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7995('0x15')]);router[_0x7995('0x8')](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x8')](_0x7995('0x18'),auth[_0x7995('0x9')](),controller['getMessages']);router[_0x7995('0x8')]('/:id/verify',auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);router[_0x7995('0x8')](_0x7995('0x1a'),auth[_0x7995('0x9')](),controller[_0x7995('0x1b')]);router['post']('/:id/dispositions',auth[_0x7995('0x9')](),controller['addDisposition']);router['post'](_0x7995('0x10'),auth[_0x7995('0x9')](),controller['addAnswer']);router[_0x7995('0x1c')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7995('0x1c')](_0x7995('0x1d'),auth[_0x7995('0x9')](),controller[_0x7995('0x1e')]);router[_0x7995('0x1c')](_0x7995('0x13'),auth['isAuthenticated'](),controller[_0x7995('0x1f')]);router[_0x7995('0x1c')](_0x7995('0x20'),auth[_0x7995('0x9')](),controller[_0x7995('0x21')]);router[_0x7995('0x1c')](_0x7995('0x16'),auth[_0x7995('0x9')](),controller['addApplications']);router[_0x7995('0x1c')](_0x7995('0x22'),auth[_0x7995('0x9')](),controller[_0x7995('0x23')]);router[_0x7995('0x1c')](_0x7995('0x1a'),auth['isAuthenticated'](),controller[_0x7995('0x24')]);router['put'](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x25')]);router[_0x7995('0x26')](_0x7995('0xe'),auth['isAuthenticated'](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x10'),auth[_0x7995('0x9')](),controller[_0x7995('0x28')]);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x7995('0x29')]);router[_0x7995('0x26')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x2a')]);router[_0x7995('0x26')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x2b')]);router['delete'](_0x7995('0x1a'),auth[_0x7995('0x9')](),controller[_0x7995('0x2c')]);module[_0x7995('0x2d')]=router;
\ No newline at end of file
+var _0x9957=['update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','verifySmtp','/:id/users','getAgents','post','/:id/in_servers','addImap','addSmtp','/:id/interactions','addInteraction','/:id/send','send','addAgents'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailAccount.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x8')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x8')]('/:id/in_servers',auth[_0x7995('0x9')](),controller[_0x7995('0x12')]);router[_0x7995('0x8')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7995('0x15')]);router[_0x7995('0x8')](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x8')](_0x7995('0x18'),auth[_0x7995('0x9')](),controller['getMessages']);router[_0x7995('0x8')]('/:id/verify',auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);router[_0x7995('0x8')](_0x7995('0x1a'),auth[_0x7995('0x9')](),controller[_0x7995('0x1b')]);router['post']('/:id/dispositions',auth[_0x7995('0x9')](),controller['addDisposition']);router['post'](_0x7995('0x10'),auth[_0x7995('0x9')](),controller['addAnswer']);router[_0x7995('0x1c')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7995('0x1c')](_0x7995('0x1d'),auth[_0x7995('0x9')](),controller[_0x7995('0x1e')]);router[_0x7995('0x1c')](_0x7995('0x13'),auth['isAuthenticated'](),controller[_0x7995('0x1f')]);router[_0x7995('0x1c')](_0x7995('0x20'),auth[_0x7995('0x9')](),controller[_0x7995('0x21')]);router[_0x7995('0x1c')](_0x7995('0x16'),auth[_0x7995('0x9')](),controller['addApplications']);router[_0x7995('0x1c')](_0x7995('0x22'),auth[_0x7995('0x9')](),controller[_0x7995('0x23')]);router[_0x7995('0x1c')](_0x7995('0x1a'),auth['isAuthenticated'](),controller[_0x7995('0x24')]);router['put'](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x25')]);router[_0x7995('0x26')](_0x7995('0xe'),auth['isAuthenticated'](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x10'),auth[_0x7995('0x9')](),controller[_0x7995('0x28')]);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x7995('0x29')]);router[_0x7995('0x26')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x2a')]);router[_0x7995('0x26')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x2b')]);router['delete'](_0x7995('0x1a'),auth[_0x7995('0x9')](),controller[_0x7995('0x2c')]);module[_0x7995('0x2d')]=router;
\ No newline at end of file
index d4926e0..d3fe8af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78f0=['BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','sequelize','exports','STRING'];(function(_0x5da1dd,_0xbb48ef){var _0x4f4fdc=function(_0xb23b78){while(--_0xb23b78){_0x5da1dd['push'](_0x5da1dd['shift']());}};_0x4f4fdc(++_0xbb48ef);}(_0x78f0,0x15d));var _0x078f=function(_0x2ceac2,_0x35ade2){_0x2ceac2=_0x2ceac2-0x0;var _0x4c3be7=_0x78f0[_0x2ceac2];return _0x4c3be7;};'use strict';var Sequelize=require(_0x078f('0x0'));module[_0x078f('0x1')]={'description':{'type':Sequelize[_0x078f('0x2')]},'name':{'type':Sequelize[_0x078f('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x078f('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x078f('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x078f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x078f('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x078f('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x078f('0x2')],'allowNull':![],'defaultValue':_0x078f('0x4')},'fontSize':{'type':Sequelize[_0x078f('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x078f('0x6')],'defaultValue':function(){return _0x078f('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x078f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x078f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x078f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x078f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x078f('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x078f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
+var _0x58e5=['exports','STRING','BOOLEAN','INTEGER','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','sequelize'];(function(_0x4344a2,_0x4798ee){var _0x3dc2cb=function(_0x1a127d){while(--_0x1a127d){_0x4344a2['push'](_0x4344a2['shift']());}};_0x3dc2cb(++_0x4798ee);}(_0x58e5,0xd1));var _0x558e=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x58e5[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0x558e('0x0'));module[_0x558e('0x1')]={'description':{'type':Sequelize[_0x558e('0x2')]},'name':{'type':Sequelize[_0x558e('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x558e('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x558e('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x558e('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x558e('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x558e('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x558e('0x5')],'defaultValue':function(){return _0x558e('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x558e('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x558e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
index 4ac62f0..c12da5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca2f=['debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','MailAccount','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','where','day','merge','map','type','key','VIRTUAL','filter','count','includeAll','include','rows','show','params','length','options','find','body','describe','addDisposition','MailAccountId','Disposition','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','pick','active','description','isNil','user','cuser','password','pass','authentication','host','port','service','cservice','cpassword','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','User','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','getApplications','getMessages','MailMessage','$gte','split','format','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','http','request','then','info'];(function(_0x128d68,_0x555a32){var _0x24ad4d=function(_0x101a3a){while(--_0x101a3a){_0x128d68['push'](_0x128d68['shift']());}};_0x24ad4d(++_0x555a32);}(_0xca2f,0x15d));var _0xfca2=function(_0x459e67,_0x5ecf3a){_0x459e67=_0x459e67-0x0;var _0x2308a9=_0xca2f[_0x459e67];return _0x2308a9;};'use strict';var pdf=require(_0xfca2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfca2('0x1'));var jsonpatch=require(_0xfca2('0x2'));var rp=require(_0xfca2('0x3'));var moment=require('moment');var BPromise=require(_0xfca2('0x4'));var Mustache=require('mustache');var util=require(_0xfca2('0x5'));var path=require(_0xfca2('0x6'));var sox=require(_0xfca2('0x7'));var csv=require(_0xfca2('0x8'));var ejs=require(_0xfca2('0x9'));var fs=require('fs');var _=require(_0xfca2('0xa'));var squel=require(_0xfca2('0xb'));var crypto=require(_0xfca2('0xc'));var jsforce=require(_0xfca2('0xd'));var deskjs=require(_0xfca2('0xe'));var toCsv=require(_0xfca2('0x8'));var querystring=require(_0xfca2('0xf'));var Papa=require(_0xfca2('0x10'));var Redis=require(_0xfca2('0x11'));var qs=require(_0xfca2('0x12'));var logger=require(_0xfca2('0x13'))(_0xfca2('0x14'));var utils=require(_0xfca2('0x15'));var config=require(_0xfca2('0x16'));var db=require(_0xfca2('0x17'))['db'];config[_0xfca2('0x18')]=_[_0xfca2('0x19')](config[_0xfca2('0x18')],{'host':_0xfca2('0x1a'),'port':0x18eb});var socket=require(_0xfca2('0x1b'))(new Redis(config[_0xfca2('0x18')]));require(_0xfca2('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xfca2('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x150f2b,_0x49644f,_0x1e6524,_0x159cc7){return new BPromise(function(_0x49b32c,_0x3388b1){var _0x3768df=_0x159cc7||client;return _0x3768df[_0xfca2('0x1e')](_0x150f2b,_0x1e6524)[_0xfca2('0x1f')](function(_0x284b81){logger[_0xfca2('0x20')]('MailAccount,\x20%s,\x20%s',_0x49644f,'request\x20sent');logger[_0xfca2('0x21')](_0xfca2('0x22'),_0x49644f,_0xfca2('0x23'),JSON[_0xfca2('0x24')](_0x284b81));if(_0x284b81[_0xfca2('0x25')]){if(_0x284b81[_0xfca2('0x25')][_0xfca2('0x26')]===0x1f4){logger[_0xfca2('0x25')](_0xfca2('0x27'),_0x49644f,_0x284b81['error'][_0xfca2('0x28')]);return _0x3388b1(_0x284b81[_0xfca2('0x25')][_0xfca2('0x28')]);}logger['error'](_0xfca2('0x27'),_0x49644f,_0x284b81[_0xfca2('0x25')][_0xfca2('0x28')]);return _0x49b32c(_0x284b81[_0xfca2('0x25')][_0xfca2('0x28')]);}else{logger[_0xfca2('0x20')](_0xfca2('0x27'),_0x49644f,_0xfca2('0x23'));_0x49b32c(_0x284b81['result'][_0xfca2('0x28')]);}})[_0xfca2('0x29')](function(_0xddc6d4){logger[_0xfca2('0x25')](_0xfca2('0x27'),_0x49644f,_0xddc6d4);_0x3388b1(_0xddc6d4);});});}function respondWithStatusCode(_0x1eabdd,_0x5e79b2){_0x5e79b2=_0x5e79b2||0xcc;return function(_0x280a71){if(_0x280a71){return _0x1eabdd[_0xfca2('0x2a')](_0x5e79b2);}return _0x1eabdd[_0xfca2('0x2b')](_0x5e79b2)[_0xfca2('0x2c')]();};}function respondWithResult(_0x392137,_0x59958d){_0x59958d=_0x59958d||0xc8;return function(_0x1b3156){if(_0x1b3156){return _0x392137[_0xfca2('0x2b')](_0x59958d)[_0xfca2('0x2d')](_0x1b3156);}};}function respondWithFilteredResult(_0x4fc3ab,_0x3eb62d){return function(_0x21360b){if(_0x21360b){var _0x32169a=_0x21360b['count'],_0x59421e=_0x3eb62d[_0xfca2('0x2e')],_0x29a8da=_0x3eb62d[_0xfca2('0x2e')]+_0x3eb62d['limit'],_0x490b6b;if(_0x29a8da>=_0x32169a){_0x29a8da=_0x32169a;_0x490b6b=0xc8;}else{_0x490b6b=0xce;}_0x4fc3ab[_0xfca2('0x2b')](_0x490b6b);return _0x4fc3ab[_0xfca2('0x2f')](_0xfca2('0x30'),_0x59421e+'-'+_0x29a8da+'/'+_0x32169a)[_0xfca2('0x2d')](_0x21360b);}return null;};}function patchUpdates(_0x4f5042){return function(_0x4bd02b){try{jsonpatch[_0xfca2('0x31')](_0x4bd02b,_0x4f5042,!![]);}catch(_0x3748c4){return BPromise[_0xfca2('0x32')](_0x3748c4);}return _0x4bd02b[_0xfca2('0x33')]();};}function saveUpdates(_0x44da9f,_0x53d76a){return function(_0x57ae11){if(_0x57ae11){return _0x57ae11[_0xfca2('0x34')](_0x44da9f)[_0xfca2('0x1f')](function(_0x4e8a46){return _0x4e8a46;});}return null;};}function removeEntity(_0x14ce80,_0x2fbce3){return function(_0x2caa42){if(_0x2caa42){return _0x2caa42[_0xfca2('0x35')]()[_0xfca2('0x1f')](function(){var _0x6e2a8b=_0x2caa42[_0xfca2('0x36')]({'plain':!![]});var _0x6a64b3='MailAccounts';return db[_0xfca2('0x37')][_0xfca2('0x35')]({'where':{'type':_0x6a64b3,'resourceId':_0x6e2a8b['id']}})[_0xfca2('0x1f')](function(){return _0x2caa42;});})[_0xfca2('0x1f')](function(){_0x14ce80[_0xfca2('0x2b')](0xcc)[_0xfca2('0x2c')]();});}};}function handleEntityNotFound(_0x2cf856,_0x34e206){return function(_0x157709){if(!_0x157709){_0x2cf856[_0xfca2('0x2a')](0x194);}return _0x157709;};}function handleError(_0x192bb3,_0x4ad2a9){_0x4ad2a9=_0x4ad2a9||0x1f4;return function(_0x68beb2){logger[_0xfca2('0x25')](_0x68beb2[_0xfca2('0x38')]);if(_0x68beb2[_0xfca2('0x39')]){delete _0x68beb2['name'];}_0x192bb3[_0xfca2('0x2b')](_0x4ad2a9)[_0xfca2('0x3a')](_0x68beb2);};}exports[_0xfca2('0x3b')]=function(_0x5db331,_0x502b5e){var _0x3226ee={'include':[{'model':db[_0xfca2('0x3c')],'as':_0xfca2('0x3d')},{'model':db[_0xfca2('0x3e')],'as':_0xfca2('0x3f')}]},_0x355534={},_0xcbf69a={'count':0x0,'rows':[]};var _0x5112c1=db[_0xfca2('0x40')][_0xfca2('0x41')];_0x355534[_0xfca2('0x42')]=_[_0xfca2('0x43')](_0x5112c1);var _0x24a351={'dateStart':_0x5db331[_0xfca2('0x44')][_0xfca2('0x45')],'dateEnd':_0x5db331['query'][_0xfca2('0x46')]};delete _0x5db331[_0xfca2('0x44')][_0xfca2('0x45')];delete _0x5db331[_0xfca2('0x44')][_0xfca2('0x46')];_0x355534[_0xfca2('0x44')]=_['keys'](_0x5db331[_0xfca2('0x44')]);_0x355534[_0xfca2('0x47')]=_['intersection'](_0x355534[_0xfca2('0x42')],_0x355534[_0xfca2('0x44')]);_0x3226ee[_0xfca2('0x48')]=_[_0xfca2('0x49')](_0x355534['model'],qs[_0xfca2('0x4a')](_0x5db331[_0xfca2('0x44')][_0xfca2('0x4a')]));_0x3226ee[_0xfca2('0x48')]=_0x3226ee[_0xfca2('0x48')]['length']?_0x3226ee['attributes']:_0x355534[_0xfca2('0x42')];if(!_0x5db331['query'][_0xfca2('0x4b')]('nolimit')){_0x3226ee[_0xfca2('0x4c')]=qs[_0xfca2('0x4c')](_0x5db331[_0xfca2('0x44')]['limit']);_0x3226ee[_0xfca2('0x2e')]=qs[_0xfca2('0x2e')](_0x5db331[_0xfca2('0x44')][_0xfca2('0x2e')]);}_0x3226ee[_0xfca2('0x4d')]=qs['sort'](_0x5db331[_0xfca2('0x44')][_0xfca2('0x4e')]);_0x3226ee[_0xfca2('0x4f')]=qs[_0xfca2('0x47')](_['pick'](_0x5db331[_0xfca2('0x44')],_0x355534[_0xfca2('0x47')]));if(_0x24a351[_0xfca2('0x45')]){if(_0x24a351[_0xfca2('0x46')]){_0x24a351[_0xfca2('0x46')]=moment(_0x24a351[_0xfca2('0x46')])['add'](0x1,_0xfca2('0x50'));}else{_0x24a351[_0xfca2('0x46')]=moment(_0x24a351[_0xfca2('0x45')])['add'](0x1,_0xfca2('0x50'));}_[_0xfca2('0x51')](_0x3226ee['where'],{'createdAt':{'$gte':_0x24a351[_0xfca2('0x45')],'$lte':_0x24a351[_0xfca2('0x46')]}});}if(_0x5db331['query']['filter']){_0x3226ee[_0xfca2('0x4f')]=_['merge'](_0x3226ee[_0xfca2('0x4f')],{'$or':_[_0xfca2('0x52')](_0x5112c1,function(_0x4c44af){if(_0x4c44af[_0xfca2('0x53')][_0xfca2('0x54')]!==_0xfca2('0x55')){var _0x37e855={};_0x37e855[_0x4c44af['field']]={'$like':'%'+_0x5db331[_0xfca2('0x44')][_0xfca2('0x56')]+'%'};return _0x37e855;}})});}_0x3226ee=_['merge']({},_0x3226ee,_0x5db331['options']);var _0x1b82c4={'where':_0x3226ee['where']};return db['MailAccount'][_0xfca2('0x57')](_0x1b82c4)[_0xfca2('0x1f')](function(_0xe0511b){_0xcbf69a['count']=_0xe0511b;if(_0x5db331['query'][_0xfca2('0x58')]){_0x3226ee[_0xfca2('0x59')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x3226ee);})['then'](function(_0x272b19){_0xcbf69a[_0xfca2('0x5a')]=_0x272b19;return _0xcbf69a;})[_0xfca2('0x1f')](respondWithFilteredResult(_0x502b5e,_0x3226ee))[_0xfca2('0x29')](handleError(_0x502b5e,null));};exports[_0xfca2('0x5b')]=function(_0x2ae174,_0x301f15){var _0xee55e9={'raw':![],'where':{'id':_0x2ae174[_0xfca2('0x5c')]['id']},'include':[{'model':db[_0xfca2('0x3c')],'as':'Imap'},{'model':db[_0xfca2('0x3e')],'as':_0xfca2('0x3f')}]},_0x545151={};_0x545151['model']=_[_0xfca2('0x43')](db[_0xfca2('0x40')][_0xfca2('0x41')]);_0x545151[_0xfca2('0x44')]=_[_0xfca2('0x43')](_0x2ae174[_0xfca2('0x44')]);_0x545151['filters']=_[_0xfca2('0x49')](_0x545151[_0xfca2('0x42')],_0x545151['query']);_0xee55e9[_0xfca2('0x48')]=_[_0xfca2('0x49')](_0x545151[_0xfca2('0x42')],qs[_0xfca2('0x4a')](_0x2ae174[_0xfca2('0x44')]['fields']));_0xee55e9[_0xfca2('0x48')]=_0xee55e9[_0xfca2('0x48')][_0xfca2('0x5d')]?_0xee55e9[_0xfca2('0x48')]:_0x545151[_0xfca2('0x42')];if(_0x2ae174[_0xfca2('0x44')][_0xfca2('0x58')]){_0xee55e9[_0xfca2('0x59')]=[{'all':!![]}];}_0xee55e9=_[_0xfca2('0x51')]({},_0xee55e9,_0x2ae174[_0xfca2('0x5e')]);return db['MailAccount'][_0xfca2('0x5f')](_0xee55e9)['then'](handleEntityNotFound(_0x301f15,null))[_0xfca2('0x1f')](respondWithResult(_0x301f15,null))['catch'](handleError(_0x301f15,null));};exports[_0xfca2('0x34')]=function(_0x468792,_0x5cc5a1){if(_0x468792['body']['id']){delete _0x468792['body']['id'];}return db['MailAccount'][_0xfca2('0x5f')]({'where':{'id':_0x468792[_0xfca2('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xfca2('0x3d')},{'model':db[_0xfca2('0x3e')],'as':'Smtp'}]})[_0xfca2('0x1f')](handleEntityNotFound(_0x5cc5a1,null))[_0xfca2('0x1f')](saveUpdates(_0x468792[_0xfca2('0x60')],null))[_0xfca2('0x1f')](function(_0x559dfe){if(_0x559dfe&&_0x468792['body']['Imap']){return db[_0xfca2('0x3c')][_0xfca2('0x34')](_0x468792[_0xfca2('0x60')][_0xfca2('0x3d')],{'where':{'MailAccountId':_0x559dfe['id']}})[_0xfca2('0x1f')](function(){return _0x559dfe;});}return _0x559dfe;})[_0xfca2('0x1f')](function(_0x12b79f){if(_0x12b79f&&_0x468792['body'][_0xfca2('0x3f')]){return db[_0xfca2('0x3e')][_0xfca2('0x34')](_0x468792[_0xfca2('0x60')][_0xfca2('0x3f')],{'where':{'MailAccountId':_0x12b79f['id']}})[_0xfca2('0x1f')](function(){return _0x12b79f;});}return _0x12b79f;})['then'](respondWithResult(_0x5cc5a1,null))[_0xfca2('0x29')](handleError(_0x5cc5a1,null));};exports['describe']=function(_0x4088c2,_0x37cc62){return db['MailAccount'][_0xfca2('0x61')]()[_0xfca2('0x1f')](respondWithResult(_0x37cc62,null))[_0xfca2('0x29')](handleError(_0x37cc62,null));};exports[_0xfca2('0x62')]=function(_0x233810,_0xaffcf8,_0x30a6ec){if(_0x233810['body']['id']){delete _0x233810[_0xfca2('0x60')]['id'];}return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0x233810[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0xaffcf8,null))[_0xfca2('0x1f')](function(_0x5beaef){if(_0x5beaef){_0x233810[_0xfca2('0x60')][_0xfca2('0x63')]=_0x5beaef['id'];return db[_0xfca2('0x64')]['create'](_0x233810['body']);}})[_0xfca2('0x1f')](respondWithResult(_0xaffcf8,null))[_0xfca2('0x29')](handleError(_0xaffcf8,null));};exports['getDispositions']=function(_0x4b991f,_0xf7b2a0,_0xd0109e){var _0x259cf0={'raw':![],'where':{}};var _0x23ad15={};var _0x123c81={'count':0x0,'rows':[]};return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0x4b991f[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0xf7b2a0,null))[_0xfca2('0x1f')](function(_0x3879d7){if(_0x3879d7){_0x23ad15['model']=_['keys'](db[_0xfca2('0x64')][_0xfca2('0x41')]);_0x23ad15[_0xfca2('0x44')]=_['keys'](_0x4b991f[_0xfca2('0x44')]);_0x23ad15[_0xfca2('0x47')]=_['intersection'](_0x23ad15[_0xfca2('0x42')],_0x23ad15['query']);_0x259cf0[_0xfca2('0x48')]=_[_0xfca2('0x49')](_0x23ad15[_0xfca2('0x42')],qs[_0xfca2('0x4a')](_0x4b991f[_0xfca2('0x44')][_0xfca2('0x4a')]));_0x259cf0[_0xfca2('0x48')]=_0x259cf0[_0xfca2('0x48')]['length']?_0x259cf0[_0xfca2('0x48')]:_0x23ad15['model'];if(!_0x4b991f[_0xfca2('0x44')][_0xfca2('0x4b')](_0xfca2('0x66'))){_0x259cf0[_0xfca2('0x4c')]=qs['limit'](_0x4b991f['query'][_0xfca2('0x4c')]);_0x259cf0['offset']=qs['offset'](_0x4b991f['query'][_0xfca2('0x2e')]);}_0x259cf0[_0xfca2('0x4d')]=qs[_0xfca2('0x4e')](_0x4b991f[_0xfca2('0x44')]['sort']);_0x259cf0[_0xfca2('0x4f')]=qs[_0xfca2('0x47')](_['pick'](_0x4b991f['query'],_0x23ad15['filters']));_0x259cf0[_0xfca2('0x4f')][_0xfca2('0x63')]=_0x3879d7['id'];if(_0x4b991f[_0xfca2('0x44')][_0xfca2('0x56')]){_0x259cf0[_0xfca2('0x4f')]=_[_0xfca2('0x51')](_0x259cf0[_0xfca2('0x4f')],{'$or':_[_0xfca2('0x52')](_0x259cf0['attributes'],function(_0x189710){var _0x2d6e4f={};_0x2d6e4f[_0x189710]={'$like':'%'+_0x4b991f[_0xfca2('0x44')][_0xfca2('0x56')]+'%'};return _0x2d6e4f;})});}_0x259cf0=_[_0xfca2('0x51')]({},_0x259cf0,_0x4b991f['options']);return db['Disposition']['count']({'where':_0x259cf0[_0xfca2('0x4f')]})[_0xfca2('0x1f')](function(_0x14c5d3){_0x123c81['count']=_0x14c5d3;if(_0x4b991f['query'][_0xfca2('0x58')]){_0x259cf0[_0xfca2('0x59')]=[{'all':!![]}];}return db[_0xfca2('0x64')][_0xfca2('0x67')](_0x259cf0);})[_0xfca2('0x1f')](function(_0x505ea6){_0x123c81[_0xfca2('0x5a')]=_0x505ea6;return _0x123c81;});}})[_0xfca2('0x1f')](respondWithFilteredResult(_0xf7b2a0,_0x259cf0))[_0xfca2('0x29')](handleError(_0xf7b2a0,null));};exports['removeDispositions']=function(_0x561624,_0x3e561c,_0x394800){var _0x331c64;return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0x561624[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x3e561c,null))[_0xfca2('0x1f')](function(_0x36749c){if(_0x36749c){return _0x36749c[_0xfca2('0x68')](_0x561624[_0xfca2('0x44')][_0xfca2('0x69')]);}})[_0xfca2('0x1f')](respondWithStatusCode(_0x3e561c,null))[_0xfca2('0x29')](handleError(_0x3e561c,null));};exports[_0xfca2('0x6a')]=function(_0x4a98a9,_0x5c35af,_0x272987){if(_0x4a98a9[_0xfca2('0x60')]['id']){delete _0x4a98a9['body']['id'];}return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0x4a98a9[_0xfca2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5c35af,null))[_0xfca2('0x1f')](function(_0x554a50){if(_0x554a50){_0x4a98a9[_0xfca2('0x60')]['MailAccountId']=_0x554a50['id'];return db[_0xfca2('0x6b')][_0xfca2('0x6c')](_0x4a98a9[_0xfca2('0x60')]);}})['then'](respondWithResult(_0x5c35af,null))[_0xfca2('0x29')](handleError(_0x5c35af,null));};exports[_0xfca2('0x6d')]=function(_0x8084aa,_0x5ceaba,_0x13ead5){var _0x94c77e={'raw':![],'where':{}};var _0x49bb19={};var _0x2cac71={'count':0x0,'rows':[]};return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0x8084aa[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x5ceaba,null))[_0xfca2('0x1f')](function(_0x588b06){if(_0x588b06){_0x49bb19[_0xfca2('0x42')]=_[_0xfca2('0x43')](db['CannedAnswer'][_0xfca2('0x41')]);_0x49bb19['query']=_[_0xfca2('0x43')](_0x8084aa[_0xfca2('0x44')]);_0x49bb19[_0xfca2('0x47')]=_[_0xfca2('0x49')](_0x49bb19[_0xfca2('0x42')],_0x49bb19[_0xfca2('0x44')]);_0x94c77e[_0xfca2('0x48')]=_[_0xfca2('0x49')](_0x49bb19['model'],qs[_0xfca2('0x4a')](_0x8084aa['query'][_0xfca2('0x4a')]));_0x94c77e[_0xfca2('0x48')]=_0x94c77e[_0xfca2('0x48')]['length']?_0x94c77e[_0xfca2('0x48')]:_0x49bb19['model'];if(!_0x8084aa['query'][_0xfca2('0x4b')]('nolimit')){_0x94c77e['limit']=qs[_0xfca2('0x4c')](_0x8084aa[_0xfca2('0x44')][_0xfca2('0x4c')]);_0x94c77e[_0xfca2('0x2e')]=qs[_0xfca2('0x2e')](_0x8084aa[_0xfca2('0x44')]['offset']);}_0x94c77e[_0xfca2('0x4d')]=qs[_0xfca2('0x4e')](_0x8084aa['query'][_0xfca2('0x4e')]);_0x94c77e[_0xfca2('0x4f')]=qs[_0xfca2('0x47')](_[_0xfca2('0x6e')](_0x8084aa[_0xfca2('0x44')],_0x49bb19['filters']));_0x94c77e[_0xfca2('0x4f')][_0xfca2('0x63')]=_0x588b06['id'];if(_0x8084aa[_0xfca2('0x44')][_0xfca2('0x56')]){_0x94c77e['where']=_[_0xfca2('0x51')](_0x94c77e[_0xfca2('0x4f')],{'$or':_[_0xfca2('0x52')](_0x94c77e[_0xfca2('0x48')],function(_0x309d89){var _0x4a4500={};_0x4a4500[_0x309d89]={'$like':'%'+_0x8084aa[_0xfca2('0x44')][_0xfca2('0x56')]+'%'};return _0x4a4500;})});}_0x94c77e=_[_0xfca2('0x51')]({},_0x94c77e,_0x8084aa[_0xfca2('0x5e')]);return db[_0xfca2('0x6b')][_0xfca2('0x57')]({'where':_0x94c77e[_0xfca2('0x4f')]})[_0xfca2('0x1f')](function(_0x272061){_0x2cac71['count']=_0x272061;if(_0x8084aa['query'][_0xfca2('0x58')]){_0x94c77e[_0xfca2('0x59')]=[{'all':!![]}];}return db[_0xfca2('0x6b')][_0xfca2('0x67')](_0x94c77e);})[_0xfca2('0x1f')](function(_0x40fcfa){_0x2cac71[_0xfca2('0x5a')]=_0x40fcfa;return _0x2cac71;});}})[_0xfca2('0x1f')](respondWithFilteredResult(_0x5ceaba,_0x94c77e))['catch'](handleError(_0x5ceaba,null));};exports['removeAnswers']=function(_0x205a89,_0x1f5362,_0x330ed7){var _0x291a72;return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0x205a89[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x1f5362,null))[_0xfca2('0x1f')](function(_0x1a6d0){if(_0x1a6d0){return _0x1a6d0['removeAnswers'](_0x205a89[_0xfca2('0x44')][_0xfca2('0x69')]);}})[_0xfca2('0x1f')](respondWithStatusCode(_0x1f5362,null))[_0xfca2('0x29')](handleError(_0x1f5362,null));};exports[_0xfca2('0x6c')]=function(_0x455f6f,_0x2573df){var _0x3aba5c={'name':_0x455f6f[_0xfca2('0x60')][_0xfca2('0x39')],'key':_0x455f6f['body'][_0xfca2('0x54')],'email':_0x455f6f['body']['email'],'ListId':_0x455f6f[_0xfca2('0x60')]['ListId'],'active':!_['isNil'](_0x455f6f[_0xfca2('0x60')][_0xfca2('0x6f')])?_0x455f6f[_0xfca2('0x60')]['active']:!![],'description':_0x455f6f[_0xfca2('0x60')][_0xfca2('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0xfca2('0x71')](_0x455f6f['body']['cservice'])){if(_0x455f6f[_0xfca2('0x60')]['cauthentication']){_0x3aba5c[_0xfca2('0x3d')][_0xfca2('0x72')]=_0x3aba5c[_0xfca2('0x3f')][_0xfca2('0x72')]=_0x455f6f[_0xfca2('0x60')][_0xfca2('0x73')];_0x3aba5c[_0xfca2('0x3d')][_0xfca2('0x74')]=_0x3aba5c[_0xfca2('0x3f')][_0xfca2('0x75')]=_0x455f6f['body']['cpassword'];}else{_0x3aba5c['Imap'][_0xfca2('0x76')]=_0x3aba5c[_0xfca2('0x3f')]['authentication']=![];}_0x3aba5c[_0xfca2('0x3d')][_0xfca2('0x77')]=_0x455f6f[_0xfca2('0x60')][_0xfca2('0x3d')][_0xfca2('0x77')];_0x3aba5c['Imap'][_0xfca2('0x78')]=_0x455f6f['body']['Imap']['port'];_0x3aba5c[_0xfca2('0x3f')]['host']=_0x455f6f[_0xfca2('0x60')][_0xfca2('0x3f')][_0xfca2('0x77')];_0x3aba5c[_0xfca2('0x3f')][_0xfca2('0x78')]=_0x455f6f[_0xfca2('0x60')][_0xfca2('0x3f')][_0xfca2('0x78')];}else{_0x3aba5c['Imap'][_0xfca2('0x79')]=_0x3aba5c[_0xfca2('0x3f')][_0xfca2('0x79')]=_0x455f6f[_0xfca2('0x60')][_0xfca2('0x7a')];_0x3aba5c[_0xfca2('0x3d')][_0xfca2('0x72')]=_0x3aba5c[_0xfca2('0x3f')][_0xfca2('0x72')]=_0x455f6f[_0xfca2('0x60')]['cuser'];_0x3aba5c[_0xfca2('0x3d')][_0xfca2('0x74')]=_0x3aba5c[_0xfca2('0x3f')]['pass']=_0x455f6f['body'][_0xfca2('0x7b')];}return db[_0xfca2('0x40')][_0xfca2('0x6c')](_0x3aba5c,{'include':[{'model':db[_0xfca2('0x3e')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0xfca2('0x3d')}]})['then'](function(_0x2e585d){var _0xb04153=_0x455f6f[_0xfca2('0x72')][_0xfca2('0x36')]({'plain':!![]});if(!_0xb04153)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb04153[_0xfca2('0x7c')]===_0xfca2('0x72')){var _0x1d07c4=_0x2e585d[_0xfca2('0x36')]({'plain':!![]});return db[_0xfca2('0x7d')][_0xfca2('0x5f')]({'where':{'name':_0xfca2('0x7e'),'userProfileId':_0xb04153[_0xfca2('0x7f')]},'raw':!![]})[_0xfca2('0x1f')](function(_0x49b345){if(_0x49b345&&_0x49b345[_0xfca2('0x80')]===0x0){return db[_0xfca2('0x37')][_0xfca2('0x6c')]({'name':_0x1d07c4[_0xfca2('0x39')],'resourceId':_0x1d07c4['id'],'type':_0x49b345[_0xfca2('0x39')],'sectionId':_0x49b345['id']},{})[_0xfca2('0x1f')](function(){return _0x2e585d;});}else{return _0x2e585d;}})['catch'](function(_0x5637b8){logger[_0xfca2('0x25')](_0xfca2('0x81'),_0x5637b8);throw _0x5637b8;});}return _0x2e585d;})[_0xfca2('0x1f')](respondWithResult(_0x2573df,0xc9))[_0xfca2('0x29')](handleError(_0x2573df,null));};exports['getImap']=function(_0x526271,_0x1b0843,_0x2066e5){return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0x526271[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x1b0843,null))['then'](function(_0x5e1b99){if(_0x5e1b99){return _0x5e1b99['getImap']();}return null;})[_0xfca2('0x1f')](respondWithResult(_0x1b0843,null))[_0xfca2('0x29')](handleError(_0x1b0843,null));};exports['addImap']=function(_0x31a1ce,_0x2e09ae,_0x2198d6){if(_0x31a1ce[_0xfca2('0x60')]['id']){delete _0x31a1ce[_0xfca2('0x60')]['id'];}return db[_0xfca2('0x40')]['find']({'where':{'id':_0x31a1ce['params']['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x2e09ae,null))[_0xfca2('0x1f')](function(_0x345be4){if(_0x345be4){_0x31a1ce['body'][_0xfca2('0x63')]=_0x345be4['id'];return db['MailServerIn'][_0xfca2('0x6c')](_0x31a1ce[_0xfca2('0x60')]);}})[_0xfca2('0x1f')](respondWithResult(_0x2e09ae,null))[_0xfca2('0x29')](handleError(_0x2e09ae,null));};exports[_0xfca2('0x82')]=function(_0x4fc4a8,_0x39f509,_0x191a8e){return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0x4fc4a8[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x39f509,null))['then'](function(_0x543899){if(_0x543899){return _0x543899[_0xfca2('0x83')](null);}return null;})[_0xfca2('0x1f')](respondWithStatusCode(_0x39f509,null))[_0xfca2('0x29')](handleError(_0x39f509,null));};exports[_0xfca2('0x84')]=function(_0x300ed0,_0x400570,_0x164338){return db[_0xfca2('0x40')]['findOne']({'where':{'id':_0x300ed0[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x400570,null))[_0xfca2('0x1f')](function(_0x65bb62){if(_0x65bb62){return _0x65bb62['getSmtp']();}return null;})['then'](respondWithResult(_0x400570,null))[_0xfca2('0x29')](handleError(_0x400570,null));};exports['addSmtp']=function(_0x285ff1,_0x44f04f,_0x1a34eb){if(_0x285ff1[_0xfca2('0x60')]['id']){delete _0x285ff1[_0xfca2('0x60')]['id'];}return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0x285ff1[_0xfca2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x44f04f,null))[_0xfca2('0x1f')](function(_0x42752c){if(_0x42752c){_0x285ff1[_0xfca2('0x60')][_0xfca2('0x63')]=_0x42752c['id'];return db[_0xfca2('0x3e')]['create'](_0x285ff1['body']);}})[_0xfca2('0x1f')](respondWithResult(_0x44f04f,null))['catch'](handleError(_0x44f04f,null));};exports[_0xfca2('0x85')]=function(_0xee6d7e,_0x4ce658,_0x5958b4){return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0xee6d7e['params']['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x4ce658,null))[_0xfca2('0x1f')](function(_0x3d0093){if(_0x3d0093){return _0x3d0093[_0xfca2('0x86')](null);}return null;})[_0xfca2('0x1f')](respondWithStatusCode(_0x4ce658,null))[_0xfca2('0x29')](handleError(_0x4ce658,null));};exports[_0xfca2('0x87')]=function(_0x3b143d,_0xe33637,_0x4f89fa){return db['MailInteraction'][_0xfca2('0x5f')]({'where':{'id':_0x3b143d[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0xe33637,null))[_0xfca2('0x1f')](function(_0x19bf1c){if(_0x19bf1c){return _0x19bf1c[_0xfca2('0x87')](_0x3b143d[_0xfca2('0x60')][_0xfca2('0x69')],_[_0xfca2('0x88')](_0x3b143d[_0xfca2('0x60')],[_0xfca2('0x69'),'id'])||{});}})[_0xfca2('0x1f')](respondWithResult(_0xe33637,null))['catch'](handleError(_0xe33637,null));};exports[_0xfca2('0x89')]=function(_0x1e45b4,_0x562a24,_0x94fd0a){var _0x1b603e={'raw':![],'where':{}};var _0x5c0968={};var _0xb9279a={'count':0x0,'rows':[]};return db[_0xfca2('0x40')]['findOne']({'where':{'id':_0x1e45b4[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x562a24,null))['then'](function(_0x52f76f){if(_0x52f76f){_0x5c0968[_0xfca2('0x42')]=_[_0xfca2('0x43')](db[_0xfca2('0x8a')][_0xfca2('0x41')]);_0x5c0968[_0xfca2('0x44')]=_[_0xfca2('0x43')](_0x1e45b4[_0xfca2('0x44')]);_0x5c0968[_0xfca2('0x47')]=_[_0xfca2('0x49')](_0x5c0968[_0xfca2('0x42')],_0x5c0968[_0xfca2('0x44')]);_0x1b603e['attributes']=_[_0xfca2('0x49')](_0x5c0968['model'],qs[_0xfca2('0x4a')](_0x1e45b4['query'][_0xfca2('0x4a')]));_0x1b603e[_0xfca2('0x48')]=_0x1b603e[_0xfca2('0x48')][_0xfca2('0x5d')]?_0x1b603e['attributes']:_0x5c0968['model'];if(!_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x4b')](_0xfca2('0x66'))){_0x1b603e['limit']=qs[_0xfca2('0x4c')](_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x4c')]);_0x1b603e['offset']=qs['offset'](_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x2e')]);}_0x1b603e[_0xfca2('0x4d')]=qs['sort'](_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x4e')]);_0x1b603e['where']=qs[_0xfca2('0x47')](_['pick'](_0x1e45b4[_0xfca2('0x44')],_0x5c0968[_0xfca2('0x47')]));_0x1b603e[_0xfca2('0x4f')]['MailAccountId']=_0x52f76f['id'];if(_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x56')]){_0x1b603e[_0xfca2('0x4f')]=_[_0xfca2('0x51')](_0x1b603e[_0xfca2('0x4f')],{'$or':_[_0xfca2('0x52')](_0x1b603e['attributes'],function(_0x37e0ae){var _0x590269={};_0x590269[_0x37e0ae]={'$like':'%'+_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x56')]+'%'};return _0x590269;})});}_0x1b603e=_['merge']({},_0x1b603e,_0x1e45b4[_0xfca2('0x5e')]);return db[_0xfca2('0x8a')][_0xfca2('0x57')]({'where':_0x1b603e['where']})[_0xfca2('0x1f')](function(_0x39e80e){_0xb9279a[_0xfca2('0x57')]=_0x39e80e;if(_0x1e45b4['query'][_0xfca2('0x58')]){_0x1b603e['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xfca2('0x8b')],'as':'Owner','attributes':[_0xfca2('0x39'),_0xfca2('0x8c'),'internal'],'required':![]},{'model':db[_0xfca2('0x8d')],'as':_0xfca2('0x8e'),'attributes':['id',_0xfca2('0x39'),_0xfca2('0x8f')],'where':_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x90')]?{'id':_0x1e45b4[_0xfca2('0x44')]['tag']}:undefined,'required':_0x1e45b4[_0xfca2('0x44')][_0xfca2('0x90')]?!![]:![]}];}return db['MailInteraction'][_0xfca2('0x67')](_0x1b603e);})[_0xfca2('0x1f')](function(_0x5b5538){_0xb9279a['rows']=_0x5b5538;return _0xb9279a;});}})[_0xfca2('0x1f')](respondWithFilteredResult(_0x562a24,_0x1b603e))[_0xfca2('0x29')](handleError(_0x562a24,null));};exports[_0xfca2('0x91')]=function(_0x368923,_0x3c72b7,_0x2929bd){return db['MailAccount'][_0xfca2('0x65')]({'where':{'id':_0x368923[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x3c72b7,null))['then'](function(_0x1e2456){if(_0x1e2456){return db[_0xfca2('0x92')][_0xfca2('0x93')](function(_0x5848c2){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x368923[_0xfca2('0x5c')]['id']},'transaction':_0x5848c2})[_0xfca2('0x1f')](function(_0x57fda){var _0x556acf=_[_0xfca2('0x52')](_0x368923[_0xfca2('0x60')],function(_0x4b3dfe){_0x4b3dfe[_0xfca2('0x63')]=_0x368923[_0xfca2('0x5c')]['id'];return _0x4b3dfe;});return db[_0xfca2('0x94')]['bulkCreate'](_0x556acf,{'transaction':_0x5848c2});});})[_0xfca2('0x1f')](function(){return db[_0xfca2('0x94')][_0xfca2('0x95')]({'where':{'MailAccountId':_0x368923[_0xfca2('0x5c')]['id']},'order':'priority'});});}})[_0xfca2('0x1f')](respondWithResult(_0x3c72b7,null))[_0xfca2('0x29')](handleError(_0x3c72b7,null));};exports[_0xfca2('0x96')]=function(_0x1996a5,_0x336e4e,_0x450bac){var _0x12c04c={};var _0xf598d6={};var _0x54438a;var _0x15de20;return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0x1996a5[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x336e4e,null))[_0xfca2('0x1f')](function(_0x132665){if(_0x132665){_0x54438a=_0x132665;_0xf598d6[_0xfca2('0x42')]=_['keys'](db[_0xfca2('0x94')][_0xfca2('0x41')]);_0xf598d6[_0xfca2('0x44')]=_[_0xfca2('0x43')](_0x1996a5[_0xfca2('0x44')]);_0xf598d6[_0xfca2('0x47')]=_['intersection'](_0xf598d6[_0xfca2('0x42')],_0xf598d6[_0xfca2('0x44')]);_0x12c04c['attributes']=_['intersection'](_0xf598d6[_0xfca2('0x42')],qs[_0xfca2('0x4a')](_0x1996a5[_0xfca2('0x44')][_0xfca2('0x4a')]));_0x12c04c[_0xfca2('0x48')]=_0x12c04c[_0xfca2('0x48')][_0xfca2('0x5d')]?_0x12c04c[_0xfca2('0x48')]:_0xf598d6['model'];_0x12c04c[_0xfca2('0x4d')]=qs['sort'](_0x1996a5[_0xfca2('0x44')]['sort']);_0x12c04c['where']=qs[_0xfca2('0x47')](_[_0xfca2('0x6e')](_0x1996a5[_0xfca2('0x44')],_0xf598d6[_0xfca2('0x47')]));if(_0x1996a5[_0xfca2('0x44')]['filter']){_0x12c04c[_0xfca2('0x4f')]=_[_0xfca2('0x51')](_0x12c04c[_0xfca2('0x4f')],{'$or':_[_0xfca2('0x52')](_0x12c04c[_0xfca2('0x48')],function(_0x16b12c){var _0x4ecd5c={};_0x4ecd5c[_0x16b12c]={'$like':'%'+_0x1996a5[_0xfca2('0x44')][_0xfca2('0x56')]+'%'};return _0x4ecd5c;})});}_0x12c04c=_[_0xfca2('0x51')]({},_0x12c04c,_0x1996a5[_0xfca2('0x5e')]);return _0x54438a[_0xfca2('0x96')](_0x12c04c);}})[_0xfca2('0x1f')](function(_0x3bd890){if(_0x3bd890){_0x15de20=_0x3bd890['length'];if(!_0x1996a5[_0xfca2('0x44')]['hasOwnProperty'](_0xfca2('0x66'))){_0x12c04c['limit']=qs[_0xfca2('0x4c')](_0x1996a5[_0xfca2('0x44')][_0xfca2('0x4c')]);_0x12c04c['offset']=qs[_0xfca2('0x2e')](_0x1996a5[_0xfca2('0x44')][_0xfca2('0x2e')]);}return _0x54438a['getApplications'](_0x12c04c);}})['then'](function(_0x3a80e9){if(_0x3a80e9){return _0x3a80e9?{'count':_0x15de20,'rows':_0x3a80e9}:null;}})[_0xfca2('0x1f')](respondWithResult(_0x336e4e,null))[_0xfca2('0x29')](handleError(_0x336e4e,null));};exports[_0xfca2('0x97')]=function(_0x37880f,_0x4bfa74,_0x364066){var _0x1db3dd={'raw':!![],'where':{}};var _0x112596={};var _0x2aedc7={'count':0x0,'rows':[]};return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0x37880f[_0xfca2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4bfa74,null))['then'](function(_0x81be5d){if(_0x81be5d){_0x112596['model']=_[_0xfca2('0x43')](db[_0xfca2('0x98')][_0xfca2('0x41')]);_0x112596[_0xfca2('0x44')]=_[_0xfca2('0x43')](_0x37880f['query']);_0x112596[_0xfca2('0x47')]=_[_0xfca2('0x49')](_0x112596['model'],_0x112596[_0xfca2('0x44')]);_0x1db3dd[_0xfca2('0x48')]=_[_0xfca2('0x49')](_0x112596['model'],qs[_0xfca2('0x4a')](_0x37880f[_0xfca2('0x44')][_0xfca2('0x4a')]));_0x1db3dd['attributes']=_0x1db3dd[_0xfca2('0x48')][_0xfca2('0x5d')]?_0x1db3dd[_0xfca2('0x48')]:_0x112596[_0xfca2('0x42')];if(!_0x37880f[_0xfca2('0x44')][_0xfca2('0x4b')]('nolimit')){_0x1db3dd[_0xfca2('0x4c')]=qs[_0xfca2('0x4c')](_0x37880f[_0xfca2('0x44')][_0xfca2('0x4c')]);_0x1db3dd['offset']=qs[_0xfca2('0x2e')](_0x37880f[_0xfca2('0x44')][_0xfca2('0x2e')]);}_0x1db3dd['order']=qs[_0xfca2('0x4e')](_0x37880f[_0xfca2('0x44')][_0xfca2('0x4e')]);_0x1db3dd[_0xfca2('0x4f')]=qs[_0xfca2('0x47')](_[_0xfca2('0x6e')](_0x37880f[_0xfca2('0x44')],_0x112596[_0xfca2('0x47')]));_0x1db3dd[_0xfca2('0x4f')][_0xfca2('0x63')]=_0x81be5d['id'];if(_0x37880f[_0xfca2('0x44')][_0xfca2('0x56')]){_0x1db3dd[_0xfca2('0x4f')]=_['merge'](_0x1db3dd['where'],{'$or':_[_0xfca2('0x52')](_0x1db3dd[_0xfca2('0x48')],function(_0x5ac945){var _0x16bd22={};_0x16bd22[_0x5ac945]={'$like':'%'+_0x37880f[_0xfca2('0x44')][_0xfca2('0x56')]+'%'};return _0x16bd22;})});}if(_0x37880f[_0xfca2('0x44')]['$gte']){var _0x98fca2=_0x37880f[_0xfca2('0x44')][_0xfca2('0x99')][_0xfca2('0x9a')](',');var _0xdc6704={};_0xdc6704[_0x98fca2[0x0]]={'$gte':moment(_0x98fca2[0x1])[_0xfca2('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1db3dd[_0xfca2('0x4f')]=_[_0xfca2('0x51')](_0x1db3dd[_0xfca2('0x4f')],_0xdc6704);}_0x1db3dd=_[_0xfca2('0x51')]({},_0x1db3dd,_0x37880f[_0xfca2('0x5e')]);return db[_0xfca2('0x98')][_0xfca2('0x57')]({'where':_0x1db3dd[_0xfca2('0x4f')]})[_0xfca2('0x1f')](function(_0x42b522){_0x2aedc7[_0xfca2('0x57')]=_0x42b522;if(_0x37880f[_0xfca2('0x44')]['includeAll']){_0x1db3dd['include']=[{'all':!![]}];}return db[_0xfca2('0x98')]['findAll'](_0x1db3dd);})[_0xfca2('0x1f')](function(_0x1e53f5){_0x2aedc7[_0xfca2('0x5a')]=_0x1e53f5;return _0x2aedc7;});}})[_0xfca2('0x1f')](respondWithFilteredResult(_0x4bfa74,_0x1db3dd))[_0xfca2('0x29')](handleError(_0x4bfa74,null));};exports[_0xfca2('0x3a')]=function(_0x2978eb,_0x149e59,_0x4c38eb){var _0x235801,_0x359bbc={},_0x50a93c;if(_0x2978eb[_0xfca2('0x60')]['to']){_0x50a93c=_0x2978eb['body']['to'][_0xfca2('0x9a')](',')[0x0];}return db['MailAccount'][_0xfca2('0x5f')]({'where':{'id':_0x2978eb[_0xfca2('0x5c')]['id']},'include':[{'model':db[_0xfca2('0x9c')],'as':_0xfca2('0x9d'),'include':[{'model':db['CmContact'],'as':_0xfca2('0x9e'),'where':{'email':_0x50a93c},'limit':0x1,'order':[[_0xfca2('0x9f'),_0xfca2('0xa0')]]}]},{'model':db['MailServerOut'],'as':_0xfca2('0x3f'),'raw':!![]}]})[_0xfca2('0x1f')](handleEntityNotFound(_0x149e59,null))['then'](function(_0x52917c){if(_0x52917c){_0x235801=_0x52917c;if(_0x52917c[_0xfca2('0x3f')]){if(_['isNil'](_0x2978eb[_0xfca2('0x60')]['from'])){_0x2978eb['body'][_0xfca2('0xa1')]=util[_0xfca2('0x9b')](_0xfca2('0xa2'),_0x52917c[_0xfca2('0x39')],_0x52917c[_0xfca2('0xa3')]||_0x52917c['Smtp'][_0xfca2('0x72')]);}if(_0x2978eb[_0xfca2('0x60')][_0xfca2('0xa4')]&&_0x2978eb[_0xfca2('0x60')]['attachments'][_0xfca2('0x5d')]){for(var _0x60fa23=0x0;_0x60fa23<_0x2978eb[_0xfca2('0x60')][_0xfca2('0xa4')][_0xfca2('0x5d')];_0x60fa23+=0x1){_0x2978eb['body'][_0xfca2('0xa4')][_0x60fa23]={'filename':_0x2978eb[_0xfca2('0x60')][_0xfca2('0xa4')][_0x60fa23][_0xfca2('0x39')],'path':path['join'](config[_0xfca2('0xa5')],_0xfca2('0xa6'),_0x2978eb[_0xfca2('0x60')][_0xfca2('0xa4')][_0x60fa23][_0xfca2('0xa7')])};}}var _0x8a0878={'tls':{'rejectUnauthorized':![]}};if(_[_0xfca2('0x71')](_0x52917c[_0xfca2('0x3f')][_0xfca2('0x79')])){if(_0x52917c[_0xfca2('0x3f')][_0xfca2('0x76')]){_0x8a0878[_0xfca2('0xa8')]={'user':_0x52917c['Smtp'][_0xfca2('0x72')],'pass':_0x52917c[_0xfca2('0x3f')]['pass']};}_0x8a0878[_0xfca2('0x77')]=_0x52917c[_0xfca2('0x3f')][_0xfca2('0x77')];_0x8a0878[_0xfca2('0x78')]=_0x52917c[_0xfca2('0x3f')]['port'];_0x8a0878[_0xfca2('0xa9')]=_0x52917c[_0xfca2('0x3f')]['secure'];}else{_0x8a0878['service']=_0x52917c['Smtp'][_0xfca2('0x79')];_0x8a0878[_0xfca2('0xa8')]={'user':_0x52917c[_0xfca2('0x3f')]['user'],'pass':_0x52917c[_0xfca2('0x3f')][_0xfca2('0x75')]};}return respondWithRpcPromise(_0xfca2('0xaa'),_0xfca2('0xab'),{'account':_0x8a0878,'message':_0x2978eb[_0xfca2('0x60')]});}else{throw new Error(_0xfca2('0xac'));}}})[_0xfca2('0x1f')](function(_0x167b55){if(_0x167b55){_0x359bbc=_0x167b55;if(_0x235801[_0xfca2('0x9d')]){if(_0x235801['List'][_0xfca2('0x9e')][_0xfca2('0x5d')]){return _0x235801['List'][_0xfca2('0x9e')][0x0];}else{return db[_0xfca2('0xad')]['create'](_[_0xfca2('0x19')](_0x2978eb[_0xfca2('0x60')],{'firstName':_0x2978eb[_0xfca2('0x60')]['to'],'email':_0x2978eb[_0xfca2('0x60')]['to'],'phone':_0x2978eb['body']['to'],'ListId':_0x235801['ListId']}));}}else{throw new Error(_0xfca2('0xac'));}}})['then'](function(_0x5278c3){if(_0x5278c3){var _0x668ec4={'UserId':_0x2978eb[_0xfca2('0x72')]['id'],'ContactId':_0x5278c3['id'],'MailAccountId':_0x235801['id'],'inReplyTo':_0x359bbc[_0xfca2('0xae')],'to':_0x2978eb[_0xfca2('0x60')]['from'],'cc':_0x2978eb[_0xfca2('0x60')]['cc'],'subject':_0x2978eb[_0xfca2('0x60')][_0xfca2('0xaf')],'attach':_0x2978eb[_0xfca2('0x60')][_0xfca2('0xb0')],'firstMsgDirection':_0xfca2('0xb1'),'lastMsgAt':moment()[_0xfca2('0x9b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xfca2('0xb1'),'lastMsgBody':_0x2978eb[_0xfca2('0x60')][_0xfca2('0x60')],'Messages':[_[_0xfca2('0x51')](_0x2978eb[_0xfca2('0x60')],{'messageId':_0x359bbc['messageId'],'sentAt':moment()[_0xfca2('0x9b')](_0xfca2('0xb2')),'read':!![],'MailAccountId':_0x235801['id'],'UserId':_0x2978eb['user']['id'],'ContactId':_0x5278c3['id']})]};if(_0x2978eb[_0xfca2('0x60')]['Interaction']){_0x668ec4=_[_0xfca2('0x51')](_0x668ec4,_0x2978eb['body'][_0xfca2('0xb3')]);}return db['MailInteraction'][_0xfca2('0x6c')](_0x668ec4,{'include':[{'model':db[_0xfca2('0x98')],'as':'Messages'}]});}})['then'](respondWithResult(_0x149e59,null))[_0xfca2('0x29')](handleError(_0x149e59,null));};exports[_0xfca2('0xb4')]=function(_0xe1ae57,_0x355520,_0x401155){return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0xe1ae57[_0xfca2('0x5c')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xfca2('0x3f'),'raw':!![]}]})[_0xfca2('0x1f')](handleEntityNotFound(_0x355520,null))['then'](function(_0x3c566f){if(_0x3c566f&&_0x3c566f[_0xfca2('0x3f')]){var _0x5c4253={'id':_0x3c566f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3c566f[_0xfca2('0x3f')][_0xfca2('0x79')]){_0x5c4253[_0xfca2('0x79')]=_0x3c566f[_0xfca2('0x3f')][_0xfca2('0x79')];}else{_0x5c4253[_0xfca2('0x77')]=_0x3c566f[_0xfca2('0x3f')][_0xfca2('0x77')];_0x5c4253[_0xfca2('0x78')]=_0x3c566f[_0xfca2('0x3f')][_0xfca2('0x78')];_0x5c4253[_0xfca2('0xa9')]=_0x3c566f[_0xfca2('0x3f')]['secure'];}if(_0x3c566f[_0xfca2('0x3f')][_0xfca2('0x76')]){_0x5c4253[_0xfca2('0xa8')]={'user':_0x3c566f[_0xfca2('0x3f')][_0xfca2('0x72')],'pass':_0x3c566f[_0xfca2('0x3f')][_0xfca2('0x75')]};}return respondWithRpcPromise(_0xfca2('0xb5'),'verifySmtp',{'account':_0x5c4253});}})['then'](respondWithResult(_0x355520,null))[_0xfca2('0x29')](handleError(_0x355520,null));};exports['destroy']=function(_0x349dbb,_0x1e7d1c){return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0x349dbb['params']['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x1e7d1c,null))['then'](function(_0x190e96){if(_0x190e96&&_0x190e96[_0xfca2('0x79')]){throw new db[(_0xfca2('0xb6'))][(_0xfca2('0xb7'))](_0xfca2('0xb8'));}return _0x190e96;})[_0xfca2('0x1f')](removeEntity(_0x1e7d1c,null))[_0xfca2('0x29')](handleError(_0x1e7d1c,null));};exports[_0xfca2('0xb9')]=function(_0x2f0f82,_0x3bb157,_0x503c9c){return db['MailAccount'][_0xfca2('0x5f')]({'where':{'id':_0x2f0f82[_0xfca2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3bb157,null))[_0xfca2('0x1f')](function(_0x5704ed){if(_0x5704ed){return _0x5704ed[_0xfca2('0xb9')](_0x2f0f82[_0xfca2('0x60')][_0xfca2('0x69')],_[_0xfca2('0x88')](_0x2f0f82[_0xfca2('0x60')],[_0xfca2('0x69'),'id'])||{})[_0xfca2('0xba')](function(_0x4bd14c){for(var _0x27cf52=0x0;_0x27cf52<_0x2f0f82[_0xfca2('0x60')]['ids'][_0xfca2('0x5d')];_0x27cf52+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x2f0f82['body'][_0xfca2('0x69')][_0x27cf52],'MailAccountId':_0x2f0f82['params']['id']});}return _0x4bd14c;});}})[_0xfca2('0x1f')](respondWithResult(_0x3bb157,null))['catch'](handleError(_0x3bb157,null));};exports[_0xfca2('0xbb')]=function(_0xe57ac1,_0x3f5f29,_0x4c8488){var _0x140808;return db[_0xfca2('0x40')][_0xfca2('0x5f')]({'where':{'id':_0xe57ac1[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x3f5f29,null))[_0xfca2('0x1f')](function(_0x54a518){if(_0x54a518){return _0x54a518[_0xfca2('0xbb')](_0xe57ac1['query'][_0xfca2('0x69')])[_0xfca2('0x1f')](function(_0xffb63e){if(_[_0xfca2('0xbc')](_0xe57ac1[_0xfca2('0x44')][_0xfca2('0x69')])){for(var _0x2098ac=0x0;_0x2098ac<_0xe57ac1['query'][_0xfca2('0x69')][_0xfca2('0x5d')];_0x2098ac+=0x1){socket['emit']('userMailAccount:remove',{'UserId':_0xe57ac1[_0xfca2('0x44')]['ids'][_0x2098ac],'MailAccountId':_0xe57ac1['params']['id']});}}else{socket[_0xfca2('0xbd')](_0xfca2('0xbe'),{'UserId':_0xe57ac1[_0xfca2('0x44')][_0xfca2('0x69')],'MailAccountId':_0xe57ac1[_0xfca2('0x5c')]['id']});}});}})[_0xfca2('0x1f')](respondWithStatusCode(_0x3f5f29,null))[_0xfca2('0x29')](handleError(_0x3f5f29,null));};exports['getAgents']=function(_0x1e03e2,_0x243758,_0x510695){var _0x40e3a1={};var _0x4a176f={};var _0x3049db;var _0x211c52;return db[_0xfca2('0x40')][_0xfca2('0x65')]({'where':{'id':_0x1e03e2[_0xfca2('0x5c')]['id']}})[_0xfca2('0x1f')](handleEntityNotFound(_0x243758,null))[_0xfca2('0x1f')](function(_0x4a41bc){if(_0x4a41bc){_0x3049db=_0x4a41bc;_0x4a176f[_0xfca2('0x42')]=_[_0xfca2('0x43')](db[_0xfca2('0x8b')][_0xfca2('0x41')]);_0x4a176f[_0xfca2('0x44')]=_[_0xfca2('0x43')](_0x1e03e2[_0xfca2('0x44')]);_0x4a176f[_0xfca2('0x47')]=_[_0xfca2('0x49')](_0x4a176f[_0xfca2('0x42')],_0x4a176f[_0xfca2('0x44')]);_0x40e3a1[_0xfca2('0x48')]=_[_0xfca2('0x49')](_0x4a176f['model'],qs[_0xfca2('0x4a')](_0x1e03e2[_0xfca2('0x44')][_0xfca2('0x4a')]));_0x40e3a1[_0xfca2('0x48')]=_0x40e3a1[_0xfca2('0x48')][_0xfca2('0x5d')]?_0x40e3a1[_0xfca2('0x48')]:_0x4a176f[_0xfca2('0x42')];_0x40e3a1[_0xfca2('0x4d')]=qs['sort'](_0x1e03e2[_0xfca2('0x44')]['sort']);_0x40e3a1[_0xfca2('0x4f')]=qs[_0xfca2('0x47')](_[_0xfca2('0x6e')](_0x1e03e2['query'],_0x4a176f[_0xfca2('0x47')]));if(_0x1e03e2[_0xfca2('0x44')][_0xfca2('0x56')]){_0x40e3a1[_0xfca2('0x4f')]=_['merge'](_0x40e3a1[_0xfca2('0x4f')],{'$or':_[_0xfca2('0x52')](_0x40e3a1[_0xfca2('0x48')],function(_0x3d149f){var _0x5d80ed={};_0x5d80ed[_0x3d149f]={'$like':'%'+_0x1e03e2[_0xfca2('0x44')][_0xfca2('0x56')]+'%'};return _0x5d80ed;})});}_0x40e3a1=_[_0xfca2('0x51')]({},_0x40e3a1,_0x1e03e2[_0xfca2('0x5e')]);return _0x3049db['getAgents'](_0x40e3a1);}})[_0xfca2('0x1f')](function(_0x4c3e4e){if(_0x4c3e4e){_0x211c52=_0x4c3e4e[_0xfca2('0x5d')];if(!_0x1e03e2[_0xfca2('0x44')][_0xfca2('0x4b')]('nolimit')){_0x40e3a1[_0xfca2('0x4c')]=qs[_0xfca2('0x4c')](_0x1e03e2[_0xfca2('0x44')][_0xfca2('0x4c')]);_0x40e3a1[_0xfca2('0x2e')]=qs[_0xfca2('0x2e')](_0x1e03e2[_0xfca2('0x44')][_0xfca2('0x2e')]);}return _0x3049db['getAgents'](_0x40e3a1);}})['then'](function(_0x25c875){if(_0x25c875){return _0x25c875?{'count':_0x211c52,'rows':_0x25c875}:null;}})[_0xfca2('0x1f')](respondWithResult(_0x243758,null))[_0xfca2('0x29')](handleError(_0x243758,null));};
\ No newline at end of file
+var _0xae8a=['merge','filter','map','type','key','VIRTUAL','field','MailAccount','findAll','rows','show','params','Imap','includeAll','include','options','find','body','describe','MailAccountId','Disposition','create','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','active','description','isNil','cauthentication','user','password','pass','cpassword','authentication','host','port','service','cuser','role','userProfileId','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','MailApplication','findAndCountAll','priority','getApplications','$gte','split','MailMessage','CmList','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','List','Contacts','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','save','update','get','MailAccounts','UserProfileResource','destroy','end','stack','name','send','index','MailServerIn','MailServerOut','Smtp','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0xae8a,0x1d5));var _0xaae8=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xae8a[_0x334841];return _0x5beb4b;};'use strict';var pdf=require(_0xaae8('0x0'));var emlformat=require(_0xaae8('0x1'));var rimraf=require(_0xaae8('0x2'));var zipdir=require(_0xaae8('0x3'));var jsonpatch=require(_0xaae8('0x4'));var rp=require(_0xaae8('0x5'));var moment=require(_0xaae8('0x6'));var BPromise=require(_0xaae8('0x7'));var Mustache=require('mustache');var util=require(_0xaae8('0x8'));var path=require(_0xaae8('0x9'));var sox=require(_0xaae8('0xa'));var csv=require(_0xaae8('0xb'));var ejs=require(_0xaae8('0xc'));var fs=require('fs');var _=require(_0xaae8('0xd'));var squel=require('squel');var crypto=require(_0xaae8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaae8('0xf'));var toCsv=require(_0xaae8('0xb'));var querystring=require('querystring');var Papa=require(_0xaae8('0x10'));var Redis=require(_0xaae8('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0xaae8('0x12'))('api');var utils=require(_0xaae8('0x13'));var config=require(_0xaae8('0x14'));var db=require(_0xaae8('0x15'))['db'];config[_0xaae8('0x16')]=_[_0xaae8('0x17')](config[_0xaae8('0x16')],{'host':_0xaae8('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaae8('0x19'))[_0xaae8('0x1a')](socket);var jayson=require(_0xaae8('0x1b'));var client=jayson[_0xaae8('0x1c')]['http']({'port':0x232b});function respondWithRpcPromise(_0x42f5b7,_0x45618,_0x4a17ac,_0x125efe){return new BPromise(function(_0x50cff1,_0x164945){var _0x4e786c=_0x125efe||client;return _0x4e786c[_0xaae8('0x1d')](_0x42f5b7,_0x4a17ac)[_0xaae8('0x1e')](function(_0x1c220f){logger[_0xaae8('0x1f')](_0xaae8('0x20'),_0x45618,_0xaae8('0x21'));logger[_0xaae8('0x22')](_0xaae8('0x23'),_0x45618,'request\x20sent',JSON[_0xaae8('0x24')](_0x1c220f));if(_0x1c220f['error']){if(_0x1c220f[_0xaae8('0x25')][_0xaae8('0x26')]===0x1f4){logger[_0xaae8('0x25')](_0xaae8('0x20'),_0x45618,_0x1c220f['error'][_0xaae8('0x27')]);return _0x164945(_0x1c220f[_0xaae8('0x25')][_0xaae8('0x27')]);}logger[_0xaae8('0x25')](_0xaae8('0x20'),_0x45618,_0x1c220f[_0xaae8('0x25')][_0xaae8('0x27')]);return _0x50cff1(_0x1c220f[_0xaae8('0x25')][_0xaae8('0x27')]);}else{logger[_0xaae8('0x1f')](_0xaae8('0x20'),_0x45618,'request\x20sent');_0x50cff1(_0x1c220f['result'][_0xaae8('0x27')]);}})[_0xaae8('0x28')](function(_0x19d47f){logger[_0xaae8('0x25')](_0xaae8('0x20'),_0x45618,_0x19d47f);_0x164945(_0x19d47f);});});}function respondWithStatusCode(_0x52857a,_0x23d26a){_0x23d26a=_0x23d26a||0xcc;return function(_0x43a297){if(_0x43a297){return _0x52857a[_0xaae8('0x29')](_0x23d26a);}return _0x52857a[_0xaae8('0x2a')](_0x23d26a)['end']();};}function respondWithResult(_0x553f07,_0x172561){_0x172561=_0x172561||0xc8;return function(_0x288c5d){if(_0x288c5d){return _0x553f07['status'](_0x172561)['json'](_0x288c5d);}};}function respondWithFilteredResult(_0x3664e1,_0x191b12){return function(_0x3d8ad7){if(_0x3d8ad7){var _0x443e39=_0x3d8ad7[_0xaae8('0x2b')],_0x23efc0=_0x191b12[_0xaae8('0x2c')],_0x1b106d=_0x191b12[_0xaae8('0x2c')]+_0x191b12[_0xaae8('0x2d')],_0x1bd78b;if(_0x1b106d>=_0x443e39){_0x1b106d=_0x443e39;_0x1bd78b=0xc8;}else{_0x1bd78b=0xce;}_0x3664e1['status'](_0x1bd78b);return _0x3664e1[_0xaae8('0x2e')](_0xaae8('0x2f'),_0x23efc0+'-'+_0x1b106d+'/'+_0x443e39)['json'](_0x3d8ad7);}return null;};}function patchUpdates(_0x5eb970){return function(_0x425fd0){try{jsonpatch[_0xaae8('0x30')](_0x425fd0,_0x5eb970,!![]);}catch(_0x271647){return BPromise[_0xaae8('0x31')](_0x271647);}return _0x425fd0[_0xaae8('0x32')]();};}function saveUpdates(_0x4f9d21,_0xd84b54){return function(_0x422a30){if(_0x422a30){return _0x422a30[_0xaae8('0x33')](_0x4f9d21)['then'](function(_0x111bbb){return _0x111bbb;});}return null;};}function removeEntity(_0xdf9783,_0x5a5e80){return function(_0x278423){if(_0x278423){return _0x278423['destroy']()[_0xaae8('0x1e')](function(){var _0x18a9bb=_0x278423[_0xaae8('0x34')]({'plain':!![]});var _0x4206da=_0xaae8('0x35');return db[_0xaae8('0x36')][_0xaae8('0x37')]({'where':{'type':_0x4206da,'resourceId':_0x18a9bb['id']}})[_0xaae8('0x1e')](function(){return _0x278423;});})[_0xaae8('0x1e')](function(){_0xdf9783['status'](0xcc)[_0xaae8('0x38')]();});}};}function handleEntityNotFound(_0x26e847,_0x4cbd69){return function(_0xec210){if(!_0xec210){_0x26e847[_0xaae8('0x29')](0x194);}return _0xec210;};}function handleError(_0x519ad8,_0x253f3b){_0x253f3b=_0x253f3b||0x1f4;return function(_0x42238e){logger[_0xaae8('0x25')](_0x42238e[_0xaae8('0x39')]);if(_0x42238e['name']){delete _0x42238e[_0xaae8('0x3a')];}_0x519ad8[_0xaae8('0x2a')](_0x253f3b)[_0xaae8('0x3b')](_0x42238e);};}exports[_0xaae8('0x3c')]=function(_0x5b842d,_0x35de65){var _0x372b7c={'include':[{'model':db[_0xaae8('0x3d')],'as':'Imap'},{'model':db[_0xaae8('0x3e')],'as':_0xaae8('0x3f')}]},_0x3fec2c={},_0x3baad3={'count':0x0,'rows':[]};var _0x3e04de=db['MailAccount'][_0xaae8('0x40')];_0x3fec2c[_0xaae8('0x41')]=_[_0xaae8('0x42')](_0x3e04de);var _0x25bbad={'dateStart':_0x5b842d['query'][_0xaae8('0x43')],'dateEnd':_0x5b842d['query']['dateEnd']};delete _0x5b842d[_0xaae8('0x44')][_0xaae8('0x43')];delete _0x5b842d[_0xaae8('0x44')][_0xaae8('0x45')];_0x3fec2c['query']=_[_0xaae8('0x42')](_0x5b842d[_0xaae8('0x44')]);_0x3fec2c[_0xaae8('0x46')]=_[_0xaae8('0x47')](_0x3fec2c[_0xaae8('0x41')],_0x3fec2c[_0xaae8('0x44')]);_0x372b7c[_0xaae8('0x48')]=_['intersection'](_0x3fec2c[_0xaae8('0x41')],qs[_0xaae8('0x49')](_0x5b842d['query'][_0xaae8('0x49')]));_0x372b7c[_0xaae8('0x48')]=_0x372b7c['attributes'][_0xaae8('0x4a')]?_0x372b7c[_0xaae8('0x48')]:_0x3fec2c['model'];if(!_0x5b842d['query'][_0xaae8('0x4b')](_0xaae8('0x4c'))){_0x372b7c['limit']=qs[_0xaae8('0x2d')](_0x5b842d[_0xaae8('0x44')][_0xaae8('0x2d')]);_0x372b7c[_0xaae8('0x2c')]=qs['offset'](_0x5b842d['query'][_0xaae8('0x2c')]);}_0x372b7c[_0xaae8('0x4d')]=qs[_0xaae8('0x4e')](_0x5b842d[_0xaae8('0x44')][_0xaae8('0x4e')]);_0x372b7c[_0xaae8('0x4f')]=qs[_0xaae8('0x46')](_[_0xaae8('0x50')](_0x5b842d['query'],_0x3fec2c[_0xaae8('0x46')]));if(_0x25bbad[_0xaae8('0x43')]){if(_0x25bbad[_0xaae8('0x45')]){_0x25bbad['dateEnd']=moment(_0x25bbad[_0xaae8('0x45')])[_0xaae8('0x51')](0x1,_0xaae8('0x52'));}else{_0x25bbad[_0xaae8('0x45')]=moment(_0x25bbad[_0xaae8('0x43')])[_0xaae8('0x51')](0x1,_0xaae8('0x52'));}_[_0xaae8('0x53')](_0x372b7c['where'],{'createdAt':{'$gte':_0x25bbad[_0xaae8('0x43')],'$lte':_0x25bbad['dateEnd']}});}if(_0x5b842d[_0xaae8('0x44')][_0xaae8('0x54')]){_0x372b7c['where']=_[_0xaae8('0x53')](_0x372b7c[_0xaae8('0x4f')],{'$or':_[_0xaae8('0x55')](_0x3e04de,function(_0x616155){if(_0x616155[_0xaae8('0x56')][_0xaae8('0x57')]!==_0xaae8('0x58')){var _0x5ddb12={};_0x5ddb12[_0x616155[_0xaae8('0x59')]]={'$like':'%'+_0x5b842d[_0xaae8('0x44')][_0xaae8('0x54')]+'%'};return _0x5ddb12;}})});}_0x372b7c=_['merge']({},_0x372b7c,_0x5b842d['options']);var _0x162909={'where':_0x372b7c['where']};return db[_0xaae8('0x5a')]['count'](_0x162909)[_0xaae8('0x1e')](function(_0x4b8ec2){_0x3baad3['count']=_0x4b8ec2;if(_0x5b842d[_0xaae8('0x44')]['includeAll']){_0x372b7c['include']=[{'all':!![]}];}return db[_0xaae8('0x5a')][_0xaae8('0x5b')](_0x372b7c);})[_0xaae8('0x1e')](function(_0x510451){_0x3baad3[_0xaae8('0x5c')]=_0x510451;return _0x3baad3;})[_0xaae8('0x1e')](respondWithFilteredResult(_0x35de65,_0x372b7c))[_0xaae8('0x28')](handleError(_0x35de65,null));};exports[_0xaae8('0x5d')]=function(_0x40b4fa,_0x5f9a91){var _0x58114e={'raw':![],'where':{'id':_0x40b4fa[_0xaae8('0x5e')]['id']},'include':[{'model':db[_0xaae8('0x3d')],'as':_0xaae8('0x5f')},{'model':db[_0xaae8('0x3e')],'as':'Smtp'}]},_0x25ea91={};_0x25ea91[_0xaae8('0x41')]=_['keys'](db[_0xaae8('0x5a')][_0xaae8('0x40')]);_0x25ea91[_0xaae8('0x44')]=_['keys'](_0x40b4fa[_0xaae8('0x44')]);_0x25ea91[_0xaae8('0x46')]=_[_0xaae8('0x47')](_0x25ea91['model'],_0x25ea91[_0xaae8('0x44')]);_0x58114e[_0xaae8('0x48')]=_[_0xaae8('0x47')](_0x25ea91['model'],qs['fields'](_0x40b4fa[_0xaae8('0x44')][_0xaae8('0x49')]));_0x58114e['attributes']=_0x58114e[_0xaae8('0x48')][_0xaae8('0x4a')]?_0x58114e[_0xaae8('0x48')]:_0x25ea91[_0xaae8('0x41')];if(_0x40b4fa['query'][_0xaae8('0x60')]){_0x58114e[_0xaae8('0x61')]=[{'all':!![]}];}_0x58114e=_['merge']({},_0x58114e,_0x40b4fa[_0xaae8('0x62')]);return db[_0xaae8('0x5a')][_0xaae8('0x63')](_0x58114e)[_0xaae8('0x1e')](handleEntityNotFound(_0x5f9a91,null))[_0xaae8('0x1e')](respondWithResult(_0x5f9a91,null))['catch'](handleError(_0x5f9a91,null));};exports[_0xaae8('0x33')]=function(_0xe6be02,_0x35363f){if(_0xe6be02['body']['id']){delete _0xe6be02[_0xaae8('0x64')]['id'];}return db[_0xaae8('0x5a')][_0xaae8('0x63')]({'where':{'id':_0xe6be02[_0xaae8('0x5e')]['id']},'include':[{'model':db[_0xaae8('0x3d')],'as':_0xaae8('0x5f')},{'model':db[_0xaae8('0x3e')],'as':_0xaae8('0x3f')}]})['then'](handleEntityNotFound(_0x35363f,null))[_0xaae8('0x1e')](saveUpdates(_0xe6be02[_0xaae8('0x64')],null))['then'](function(_0x14af16){if(_0x14af16&&_0xe6be02[_0xaae8('0x64')][_0xaae8('0x5f')]){return db[_0xaae8('0x3d')][_0xaae8('0x33')](_0xe6be02[_0xaae8('0x64')][_0xaae8('0x5f')],{'where':{'MailAccountId':_0x14af16['id']}})[_0xaae8('0x1e')](function(){return _0x14af16;});}return _0x14af16;})[_0xaae8('0x1e')](function(_0x264570){if(_0x264570&&_0xe6be02[_0xaae8('0x64')][_0xaae8('0x3f')]){return db['MailServerOut'][_0xaae8('0x33')](_0xe6be02[_0xaae8('0x64')][_0xaae8('0x3f')],{'where':{'MailAccountId':_0x264570['id']}})[_0xaae8('0x1e')](function(){return _0x264570;});}return _0x264570;})[_0xaae8('0x1e')](respondWithResult(_0x35363f,null))[_0xaae8('0x28')](handleError(_0x35363f,null));};exports[_0xaae8('0x65')]=function(_0x6dfcbf,_0x548b38){return db[_0xaae8('0x5a')][_0xaae8('0x65')]()[_0xaae8('0x1e')](respondWithResult(_0x548b38,null))[_0xaae8('0x28')](handleError(_0x548b38,null));};exports['addDisposition']=function(_0x3628cc,_0x195754,_0x500ab8){if(_0x3628cc[_0xaae8('0x64')]['id']){delete _0x3628cc['body']['id'];}return db[_0xaae8('0x5a')]['find']({'where':{'id':_0x3628cc[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x195754,null))[_0xaae8('0x1e')](function(_0x512f32){if(_0x512f32){_0x3628cc[_0xaae8('0x64')][_0xaae8('0x66')]=_0x512f32['id'];return db[_0xaae8('0x67')][_0xaae8('0x68')](_0x3628cc[_0xaae8('0x64')]);}})['then'](respondWithResult(_0x195754,null))['catch'](handleError(_0x195754,null));};exports[_0xaae8('0x69')]=function(_0x37e687,_0x13319d,_0x284770){var _0x129d01={'raw':![],'where':{}};var _0x326464={};var _0x3fb797={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x37e687[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x13319d,null))[_0xaae8('0x1e')](function(_0x34bf0c){if(_0x34bf0c){_0x326464[_0xaae8('0x41')]=_[_0xaae8('0x42')](db[_0xaae8('0x67')][_0xaae8('0x40')]);_0x326464[_0xaae8('0x44')]=_[_0xaae8('0x42')](_0x37e687['query']);_0x326464[_0xaae8('0x46')]=_[_0xaae8('0x47')](_0x326464[_0xaae8('0x41')],_0x326464[_0xaae8('0x44')]);_0x129d01['attributes']=_[_0xaae8('0x47')](_0x326464[_0xaae8('0x41')],qs[_0xaae8('0x49')](_0x37e687[_0xaae8('0x44')]['fields']));_0x129d01[_0xaae8('0x48')]=_0x129d01[_0xaae8('0x48')][_0xaae8('0x4a')]?_0x129d01[_0xaae8('0x48')]:_0x326464[_0xaae8('0x41')];if(!_0x37e687['query'][_0xaae8('0x4b')](_0xaae8('0x4c'))){_0x129d01[_0xaae8('0x2d')]=qs[_0xaae8('0x2d')](_0x37e687[_0xaae8('0x44')][_0xaae8('0x2d')]);_0x129d01[_0xaae8('0x2c')]=qs[_0xaae8('0x2c')](_0x37e687[_0xaae8('0x44')][_0xaae8('0x2c')]);}_0x129d01[_0xaae8('0x4d')]=qs[_0xaae8('0x4e')](_0x37e687[_0xaae8('0x44')][_0xaae8('0x4e')]);_0x129d01[_0xaae8('0x4f')]=qs[_0xaae8('0x46')](_['pick'](_0x37e687[_0xaae8('0x44')],_0x326464[_0xaae8('0x46')]));_0x129d01[_0xaae8('0x4f')][_0xaae8('0x66')]=_0x34bf0c['id'];if(_0x37e687[_0xaae8('0x44')][_0xaae8('0x54')]){_0x129d01[_0xaae8('0x4f')]=_[_0xaae8('0x53')](_0x129d01[_0xaae8('0x4f')],{'$or':_[_0xaae8('0x55')](_0x129d01['attributes'],function(_0x356458){var _0xda78c6={};_0xda78c6[_0x356458]={'$like':'%'+_0x37e687[_0xaae8('0x44')][_0xaae8('0x54')]+'%'};return _0xda78c6;})});}_0x129d01=_[_0xaae8('0x53')]({},_0x129d01,_0x37e687[_0xaae8('0x62')]);return db[_0xaae8('0x67')][_0xaae8('0x2b')]({'where':_0x129d01[_0xaae8('0x4f')]})[_0xaae8('0x1e')](function(_0x1ebfcb){_0x3fb797['count']=_0x1ebfcb;if(_0x37e687['query'][_0xaae8('0x60')]){_0x129d01[_0xaae8('0x61')]=[{'all':!![]}];}return db['Disposition'][_0xaae8('0x5b')](_0x129d01);})[_0xaae8('0x1e')](function(_0x2ec9b6){_0x3fb797['rows']=_0x2ec9b6;return _0x3fb797;});}})[_0xaae8('0x1e')](respondWithFilteredResult(_0x13319d,_0x129d01))[_0xaae8('0x28')](handleError(_0x13319d,null));};exports[_0xaae8('0x6a')]=function(_0x560219,_0x23453a,_0x1b55f9){var _0x469be9;return db[_0xaae8('0x5a')]['find']({'where':{'id':_0x560219[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x23453a,null))['then'](function(_0x4ada01){if(_0x4ada01){return _0x4ada01[_0xaae8('0x6a')](_0x560219['query'][_0xaae8('0x6b')]);}})[_0xaae8('0x1e')](respondWithStatusCode(_0x23453a,null))[_0xaae8('0x28')](handleError(_0x23453a,null));};exports[_0xaae8('0x6c')]=function(_0x39275a,_0x1501be,_0x2f453e){if(_0x39275a['body']['id']){delete _0x39275a[_0xaae8('0x64')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x39275a['params']['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x1501be,null))[_0xaae8('0x1e')](function(_0x5e2e43){if(_0x5e2e43){_0x39275a[_0xaae8('0x64')]['MailAccountId']=_0x5e2e43['id'];return db[_0xaae8('0x6d')]['create'](_0x39275a['body']);}})['then'](respondWithResult(_0x1501be,null))[_0xaae8('0x28')](handleError(_0x1501be,null));};exports[_0xaae8('0x6e')]=function(_0x567de6,_0x55315c,_0x1c8dda){var _0x1e3396={'raw':![],'where':{}};var _0x39f8db={};var _0x31692c={'count':0x0,'rows':[]};return db[_0xaae8('0x5a')][_0xaae8('0x6f')]({'where':{'id':_0x567de6['params']['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x55315c,null))[_0xaae8('0x1e')](function(_0x3586f5){if(_0x3586f5){_0x39f8db['model']=_[_0xaae8('0x42')](db[_0xaae8('0x6d')]['rawAttributes']);_0x39f8db['query']=_[_0xaae8('0x42')](_0x567de6[_0xaae8('0x44')]);_0x39f8db['filters']=_[_0xaae8('0x47')](_0x39f8db[_0xaae8('0x41')],_0x39f8db['query']);_0x1e3396['attributes']=_['intersection'](_0x39f8db[_0xaae8('0x41')],qs[_0xaae8('0x49')](_0x567de6[_0xaae8('0x44')]['fields']));_0x1e3396[_0xaae8('0x48')]=_0x1e3396[_0xaae8('0x48')][_0xaae8('0x4a')]?_0x1e3396[_0xaae8('0x48')]:_0x39f8db['model'];if(!_0x567de6[_0xaae8('0x44')][_0xaae8('0x4b')]('nolimit')){_0x1e3396[_0xaae8('0x2d')]=qs[_0xaae8('0x2d')](_0x567de6[_0xaae8('0x44')][_0xaae8('0x2d')]);_0x1e3396[_0xaae8('0x2c')]=qs[_0xaae8('0x2c')](_0x567de6[_0xaae8('0x44')][_0xaae8('0x2c')]);}_0x1e3396[_0xaae8('0x4d')]=qs[_0xaae8('0x4e')](_0x567de6[_0xaae8('0x44')][_0xaae8('0x4e')]);_0x1e3396['where']=qs[_0xaae8('0x46')](_[_0xaae8('0x50')](_0x567de6[_0xaae8('0x44')],_0x39f8db['filters']));_0x1e3396[_0xaae8('0x4f')][_0xaae8('0x66')]=_0x3586f5['id'];if(_0x567de6[_0xaae8('0x44')][_0xaae8('0x54')]){_0x1e3396[_0xaae8('0x4f')]=_['merge'](_0x1e3396[_0xaae8('0x4f')],{'$or':_[_0xaae8('0x55')](_0x1e3396['attributes'],function(_0x1ce392){var _0xd16f6a={};_0xd16f6a[_0x1ce392]={'$like':'%'+_0x567de6[_0xaae8('0x44')][_0xaae8('0x54')]+'%'};return _0xd16f6a;})});}_0x1e3396=_[_0xaae8('0x53')]({},_0x1e3396,_0x567de6[_0xaae8('0x62')]);return db[_0xaae8('0x6d')][_0xaae8('0x2b')]({'where':_0x1e3396[_0xaae8('0x4f')]})[_0xaae8('0x1e')](function(_0x22a832){_0x31692c[_0xaae8('0x2b')]=_0x22a832;if(_0x567de6[_0xaae8('0x44')][_0xaae8('0x60')]){_0x1e3396['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xaae8('0x5b')](_0x1e3396);})[_0xaae8('0x1e')](function(_0x5cf9ac){_0x31692c['rows']=_0x5cf9ac;return _0x31692c;});}})['then'](respondWithFilteredResult(_0x55315c,_0x1e3396))['catch'](handleError(_0x55315c,null));};exports['removeAnswers']=function(_0x2ef1fc,_0xbe1937,_0xbb32e5){var _0x296e96;return db[_0xaae8('0x5a')][_0xaae8('0x63')]({'where':{'id':_0x2ef1fc[_0xaae8('0x5e')]['id']}})['then'](handleEntityNotFound(_0xbe1937,null))[_0xaae8('0x1e')](function(_0x2c748f){if(_0x2c748f){return _0x2c748f['removeAnswers'](_0x2ef1fc['query'][_0xaae8('0x6b')]);}})[_0xaae8('0x1e')](respondWithStatusCode(_0xbe1937,null))[_0xaae8('0x28')](handleError(_0xbe1937,null));};exports['create']=function(_0x3518e4,_0x3234ad){var _0x37783c={'name':_0x3518e4[_0xaae8('0x64')]['name'],'key':_0x3518e4[_0xaae8('0x64')]['key'],'email':_0x3518e4[_0xaae8('0x64')]['email'],'ListId':_0x3518e4[_0xaae8('0x64')]['ListId'],'active':!_['isNil'](_0x3518e4[_0xaae8('0x64')]['active'])?_0x3518e4[_0xaae8('0x64')][_0xaae8('0x70')]:!![],'description':_0x3518e4[_0xaae8('0x64')][_0xaae8('0x71')]||null,'Imap':{},'Smtp':{}};if(_[_0xaae8('0x72')](_0x3518e4[_0xaae8('0x64')]['cservice'])){if(_0x3518e4[_0xaae8('0x64')][_0xaae8('0x73')]){_0x37783c[_0xaae8('0x5f')][_0xaae8('0x74')]=_0x37783c[_0xaae8('0x3f')][_0xaae8('0x74')]=_0x3518e4[_0xaae8('0x64')]['cuser'];_0x37783c[_0xaae8('0x5f')][_0xaae8('0x75')]=_0x37783c[_0xaae8('0x3f')][_0xaae8('0x76')]=_0x3518e4[_0xaae8('0x64')][_0xaae8('0x77')];}else{_0x37783c[_0xaae8('0x5f')][_0xaae8('0x78')]=_0x37783c[_0xaae8('0x3f')]['authentication']=![];}_0x37783c[_0xaae8('0x5f')][_0xaae8('0x79')]=_0x3518e4['body'][_0xaae8('0x5f')]['host'];_0x37783c[_0xaae8('0x5f')][_0xaae8('0x7a')]=_0x3518e4[_0xaae8('0x64')][_0xaae8('0x5f')]['port'];_0x37783c[_0xaae8('0x3f')][_0xaae8('0x79')]=_0x3518e4['body'][_0xaae8('0x3f')]['host'];_0x37783c[_0xaae8('0x3f')]['port']=_0x3518e4['body'][_0xaae8('0x3f')][_0xaae8('0x7a')];}else{_0x37783c[_0xaae8('0x5f')]['service']=_0x37783c[_0xaae8('0x3f')][_0xaae8('0x7b')]=_0x3518e4['body']['cservice'];_0x37783c[_0xaae8('0x5f')][_0xaae8('0x74')]=_0x37783c[_0xaae8('0x3f')]['user']=_0x3518e4[_0xaae8('0x64')][_0xaae8('0x7c')];_0x37783c[_0xaae8('0x5f')][_0xaae8('0x75')]=_0x37783c[_0xaae8('0x3f')]['pass']=_0x3518e4['body'][_0xaae8('0x77')];}return db[_0xaae8('0x5a')]['create'](_0x37783c,{'include':[{'model':db[_0xaae8('0x3e')],'as':'Smtp'},{'model':db[_0xaae8('0x3d')],'as':_0xaae8('0x5f')}]})[_0xaae8('0x1e')](function(_0x43a858){var _0x519d24=_0x3518e4['user']['get']({'plain':!![]});if(!_0x519d24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x519d24[_0xaae8('0x7d')]==='user'){var _0x4e1ce6=_0x43a858['get']({'plain':!![]});return db['UserProfileSection'][_0xaae8('0x63')]({'where':{'name':_0xaae8('0x35'),'userProfileId':_0x519d24[_0xaae8('0x7e')]},'raw':!![]})[_0xaae8('0x1e')](function(_0x59f2d8){if(_0x59f2d8&&_0x59f2d8[_0xaae8('0x7f')]===0x0){return db[_0xaae8('0x36')]['create']({'name':_0x4e1ce6[_0xaae8('0x3a')],'resourceId':_0x4e1ce6['id'],'type':_0x59f2d8[_0xaae8('0x3a')],'sectionId':_0x59f2d8['id']},{})[_0xaae8('0x1e')](function(){return _0x43a858;});}else{return _0x43a858;}})['catch'](function(_0x2d19d1){logger[_0xaae8('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d19d1);throw _0x2d19d1;});}return _0x43a858;})['then'](respondWithResult(_0x3234ad,0xc9))['catch'](handleError(_0x3234ad,null));};exports[_0xaae8('0x80')]=function(_0x3b6021,_0x369ba9,_0x3bea36){return db[_0xaae8('0x5a')][_0xaae8('0x6f')]({'where':{'id':_0x3b6021[_0xaae8('0x5e')]['id']}})['then'](handleEntityNotFound(_0x369ba9,null))[_0xaae8('0x1e')](function(_0x26ddbd){if(_0x26ddbd){return _0x26ddbd[_0xaae8('0x80')]();}return null;})[_0xaae8('0x1e')](respondWithResult(_0x369ba9,null))[_0xaae8('0x28')](handleError(_0x369ba9,null));};exports[_0xaae8('0x81')]=function(_0xc8378c,_0x12694e,_0x1c8cc6){if(_0xc8378c['body']['id']){delete _0xc8378c[_0xaae8('0x64')]['id'];}return db['MailAccount'][_0xaae8('0x63')]({'where':{'id':_0xc8378c['params']['id']}})['then'](handleEntityNotFound(_0x12694e,null))[_0xaae8('0x1e')](function(_0x31554d){if(_0x31554d){_0xc8378c[_0xaae8('0x64')][_0xaae8('0x66')]=_0x31554d['id'];return db[_0xaae8('0x3d')][_0xaae8('0x68')](_0xc8378c['body']);}})[_0xaae8('0x1e')](respondWithResult(_0x12694e,null))[_0xaae8('0x28')](handleError(_0x12694e,null));};exports[_0xaae8('0x82')]=function(_0x562284,_0x42c02e,_0x518ef0){return db['MailAccount'][_0xaae8('0x6f')]({'where':{'id':_0x562284[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x42c02e,null))[_0xaae8('0x1e')](function(_0x17c21c){if(_0x17c21c){return _0x17c21c['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x42c02e,null))[_0xaae8('0x28')](handleError(_0x42c02e,null));};exports[_0xaae8('0x83')]=function(_0x5b0849,_0x5a1f82,_0x58d896){return db[_0xaae8('0x5a')][_0xaae8('0x6f')]({'where':{'id':_0x5b0849[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x5a1f82,null))[_0xaae8('0x1e')](function(_0x44299d){if(_0x44299d){return _0x44299d[_0xaae8('0x83')]();}return null;})[_0xaae8('0x1e')](respondWithResult(_0x5a1f82,null))[_0xaae8('0x28')](handleError(_0x5a1f82,null));};exports[_0xaae8('0x84')]=function(_0x2d4dc6,_0x327164,_0x198ae5){if(_0x2d4dc6[_0xaae8('0x64')]['id']){delete _0x2d4dc6[_0xaae8('0x64')]['id'];}return db[_0xaae8('0x5a')][_0xaae8('0x63')]({'where':{'id':_0x2d4dc6['params']['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x327164,null))['then'](function(_0x272570){if(_0x272570){_0x2d4dc6[_0xaae8('0x64')][_0xaae8('0x66')]=_0x272570['id'];return db[_0xaae8('0x3e')][_0xaae8('0x68')](_0x2d4dc6[_0xaae8('0x64')]);}})[_0xaae8('0x1e')](respondWithResult(_0x327164,null))[_0xaae8('0x28')](handleError(_0x327164,null));};exports[_0xaae8('0x85')]=function(_0x20db01,_0x1916b0,_0x148dcd){return db[_0xaae8('0x5a')][_0xaae8('0x6f')]({'where':{'id':_0x20db01['params']['id']}})['then'](handleEntityNotFound(_0x1916b0,null))[_0xaae8('0x1e')](function(_0x1f6834){if(_0x1f6834){return _0x1f6834['setSmtp'](null);}return null;})[_0xaae8('0x1e')](respondWithStatusCode(_0x1916b0,null))[_0xaae8('0x28')](handleError(_0x1916b0,null));};exports[_0xaae8('0x86')]=function(_0x40eca3,_0x22d960,_0x279f80){return db[_0xaae8('0x87')][_0xaae8('0x63')]({'where':{'id':_0x40eca3[_0xaae8('0x5e')]['id']}})['then'](handleEntityNotFound(_0x22d960,null))['then'](function(_0x5eb426){if(_0x5eb426){return _0x5eb426[_0xaae8('0x86')](_0x40eca3[_0xaae8('0x64')][_0xaae8('0x6b')],_[_0xaae8('0x88')](_0x40eca3[_0xaae8('0x64')],['ids','id'])||{});}})[_0xaae8('0x1e')](respondWithResult(_0x22d960,null))[_0xaae8('0x28')](handleError(_0x22d960,null));};exports['getInteractions']=function(_0x529a71,_0x5227e1,_0x41f9d5){var _0x5c775e={'raw':![],'where':{}};var _0x2e6d5e={};var _0x370838={'count':0x0,'rows':[]};return db['MailAccount'][_0xaae8('0x6f')]({'where':{'id':_0x529a71['params']['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x5227e1,null))[_0xaae8('0x1e')](function(_0x2f5ae4){if(_0x2f5ae4){_0x2e6d5e[_0xaae8('0x41')]=_[_0xaae8('0x42')](db[_0xaae8('0x87')][_0xaae8('0x40')]);_0x2e6d5e['query']=_[_0xaae8('0x42')](_0x529a71[_0xaae8('0x44')]);_0x2e6d5e[_0xaae8('0x46')]=_['intersection'](_0x2e6d5e['model'],_0x2e6d5e['query']);_0x5c775e[_0xaae8('0x48')]=_[_0xaae8('0x47')](_0x2e6d5e['model'],qs[_0xaae8('0x49')](_0x529a71['query'][_0xaae8('0x49')]));_0x5c775e[_0xaae8('0x48')]=_0x5c775e['attributes']['length']?_0x5c775e[_0xaae8('0x48')]:_0x2e6d5e['model'];if(!_0x529a71[_0xaae8('0x44')][_0xaae8('0x4b')](_0xaae8('0x4c'))){_0x5c775e['limit']=qs[_0xaae8('0x2d')](_0x529a71[_0xaae8('0x44')][_0xaae8('0x2d')]);_0x5c775e[_0xaae8('0x2c')]=qs[_0xaae8('0x2c')](_0x529a71['query'][_0xaae8('0x2c')]);}_0x5c775e[_0xaae8('0x4d')]=qs[_0xaae8('0x4e')](_0x529a71[_0xaae8('0x44')][_0xaae8('0x4e')]);_0x5c775e[_0xaae8('0x4f')]=qs[_0xaae8('0x46')](_[_0xaae8('0x50')](_0x529a71['query'],_0x2e6d5e['filters']));_0x5c775e[_0xaae8('0x4f')]['MailAccountId']=_0x2f5ae4['id'];if(_0x529a71[_0xaae8('0x44')][_0xaae8('0x54')]){_0x5c775e[_0xaae8('0x4f')]=_[_0xaae8('0x53')](_0x5c775e[_0xaae8('0x4f')],{'$or':_[_0xaae8('0x55')](_0x5c775e['attributes'],function(_0x5c6774){var _0x1cf8a3={};_0x1cf8a3[_0x5c6774]={'$like':'%'+_0x529a71[_0xaae8('0x44')][_0xaae8('0x54')]+'%'};return _0x1cf8a3;})});}_0x5c775e=_[_0xaae8('0x53')]({},_0x5c775e,_0x529a71[_0xaae8('0x62')]);return db[_0xaae8('0x87')][_0xaae8('0x2b')]({'where':_0x5c775e[_0xaae8('0x4f')]})[_0xaae8('0x1e')](function(_0x4181c7){_0x370838[_0xaae8('0x2b')]=_0x4181c7;if(_0x529a71[_0xaae8('0x44')][_0xaae8('0x60')]){_0x5c775e[_0xaae8('0x61')]=[{'model':db[_0xaae8('0x89')],'as':'Contact','required':![]},{'model':db[_0xaae8('0x8a')],'as':_0xaae8('0x8b'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0xaae8('0x8c')],'as':_0xaae8('0x8d'),'attributes':['id',_0xaae8('0x3a'),_0xaae8('0x8e')],'where':_0x529a71['query']['tag']?{'id':_0x529a71[_0xaae8('0x44')][_0xaae8('0x8f')]}:undefined,'required':_0x529a71[_0xaae8('0x44')][_0xaae8('0x8f')]?!![]:![]}];}return db[_0xaae8('0x87')]['findAll'](_0x5c775e);})['then'](function(_0x1fdd10){_0x370838[_0xaae8('0x5c')]=_0x1fdd10;return _0x370838;});}})[_0xaae8('0x1e')](respondWithFilteredResult(_0x5227e1,_0x5c775e))[_0xaae8('0x28')](handleError(_0x5227e1,null));};exports[_0xaae8('0x90')]=function(_0x21783f,_0x5596cd,_0x75f083){return db[_0xaae8('0x5a')][_0xaae8('0x6f')]({'where':{'id':_0x21783f[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x5596cd,null))[_0xaae8('0x1e')](function(_0x9aaef9){if(_0x9aaef9){return db[_0xaae8('0x91')]['transaction'](function(_0x777cb8){return db[_0xaae8('0x92')][_0xaae8('0x37')]({'where':{'MailAccountId':_0x21783f[_0xaae8('0x5e')]['id']},'transaction':_0x777cb8})['then'](function(_0x566b80){var _0x391281=_['map'](_0x21783f[_0xaae8('0x64')],function(_0x205f5f){_0x205f5f[_0xaae8('0x66')]=_0x21783f[_0xaae8('0x5e')]['id'];return _0x205f5f;});return db[_0xaae8('0x92')]['bulkCreate'](_0x391281,{'transaction':_0x777cb8});});})[_0xaae8('0x1e')](function(){return db[_0xaae8('0x92')][_0xaae8('0x93')]({'where':{'MailAccountId':_0x21783f[_0xaae8('0x5e')]['id']},'order':_0xaae8('0x94')});});}})[_0xaae8('0x1e')](respondWithResult(_0x5596cd,null))['catch'](handleError(_0x5596cd,null));};exports[_0xaae8('0x95')]=function(_0x222be7,_0x527ead,_0x43af08){var _0x45f63f={};var _0x100b23={};var _0x1310d4;var _0x5319b8;return db[_0xaae8('0x5a')][_0xaae8('0x6f')]({'where':{'id':_0x222be7[_0xaae8('0x5e')]['id']}})['then'](handleEntityNotFound(_0x527ead,null))[_0xaae8('0x1e')](function(_0x448661){if(_0x448661){_0x1310d4=_0x448661;_0x100b23[_0xaae8('0x41')]=_[_0xaae8('0x42')](db[_0xaae8('0x92')]['rawAttributes']);_0x100b23['query']=_[_0xaae8('0x42')](_0x222be7['query']);_0x100b23['filters']=_['intersection'](_0x100b23[_0xaae8('0x41')],_0x100b23[_0xaae8('0x44')]);_0x45f63f[_0xaae8('0x48')]=_[_0xaae8('0x47')](_0x100b23['model'],qs[_0xaae8('0x49')](_0x222be7[_0xaae8('0x44')]['fields']));_0x45f63f[_0xaae8('0x48')]=_0x45f63f[_0xaae8('0x48')][_0xaae8('0x4a')]?_0x45f63f['attributes']:_0x100b23[_0xaae8('0x41')];_0x45f63f[_0xaae8('0x4d')]=qs[_0xaae8('0x4e')](_0x222be7['query'][_0xaae8('0x4e')]);_0x45f63f[_0xaae8('0x4f')]=qs[_0xaae8('0x46')](_[_0xaae8('0x50')](_0x222be7['query'],_0x100b23['filters']));if(_0x222be7['query']['filter']){_0x45f63f['where']=_[_0xaae8('0x53')](_0x45f63f['where'],{'$or':_[_0xaae8('0x55')](_0x45f63f[_0xaae8('0x48')],function(_0x4d076d){var _0x17238e={};_0x17238e[_0x4d076d]={'$like':'%'+_0x222be7[_0xaae8('0x44')][_0xaae8('0x54')]+'%'};return _0x17238e;})});}_0x45f63f=_[_0xaae8('0x53')]({},_0x45f63f,_0x222be7[_0xaae8('0x62')]);return _0x1310d4[_0xaae8('0x95')](_0x45f63f);}})['then'](function(_0x2fef07){if(_0x2fef07){_0x5319b8=_0x2fef07[_0xaae8('0x4a')];if(!_0x222be7[_0xaae8('0x44')][_0xaae8('0x4b')](_0xaae8('0x4c'))){_0x45f63f[_0xaae8('0x2d')]=qs[_0xaae8('0x2d')](_0x222be7[_0xaae8('0x44')][_0xaae8('0x2d')]);_0x45f63f['offset']=qs['offset'](_0x222be7[_0xaae8('0x44')][_0xaae8('0x2c')]);}return _0x1310d4[_0xaae8('0x95')](_0x45f63f);}})[_0xaae8('0x1e')](function(_0x252a90){if(_0x252a90){return _0x252a90?{'count':_0x5319b8,'rows':_0x252a90}:null;}})[_0xaae8('0x1e')](respondWithResult(_0x527ead,null))[_0xaae8('0x28')](handleError(_0x527ead,null));};exports['getMessages']=function(_0x5b78c0,_0x82c0b4,_0x255bc2){var _0x146afd={'raw':!![],'where':{}};var _0x4f6a56={};var _0x1c84ab={'count':0x0,'rows':[]};return db[_0xaae8('0x5a')][_0xaae8('0x6f')]({'where':{'id':_0x5b78c0['params']['id']}})['then'](handleEntityNotFound(_0x82c0b4,null))[_0xaae8('0x1e')](function(_0x4bfc38){if(_0x4bfc38){_0x4f6a56[_0xaae8('0x41')]=_['keys'](db['MailMessage'][_0xaae8('0x40')]);_0x4f6a56['query']=_[_0xaae8('0x42')](_0x5b78c0['query']);_0x4f6a56[_0xaae8('0x46')]=_['intersection'](_0x4f6a56['model'],_0x4f6a56['query']);_0x146afd[_0xaae8('0x48')]=_[_0xaae8('0x47')](_0x4f6a56['model'],qs[_0xaae8('0x49')](_0x5b78c0[_0xaae8('0x44')][_0xaae8('0x49')]));_0x146afd[_0xaae8('0x48')]=_0x146afd[_0xaae8('0x48')]['length']?_0x146afd['attributes']:_0x4f6a56['model'];if(!_0x5b78c0['query']['hasOwnProperty'](_0xaae8('0x4c'))){_0x146afd[_0xaae8('0x2d')]=qs[_0xaae8('0x2d')](_0x5b78c0[_0xaae8('0x44')][_0xaae8('0x2d')]);_0x146afd[_0xaae8('0x2c')]=qs[_0xaae8('0x2c')](_0x5b78c0[_0xaae8('0x44')]['offset']);}_0x146afd[_0xaae8('0x4d')]=qs[_0xaae8('0x4e')](_0x5b78c0[_0xaae8('0x44')][_0xaae8('0x4e')]);_0x146afd['where']=qs[_0xaae8('0x46')](_['pick'](_0x5b78c0[_0xaae8('0x44')],_0x4f6a56[_0xaae8('0x46')]));_0x146afd[_0xaae8('0x4f')][_0xaae8('0x66')]=_0x4bfc38['id'];if(_0x5b78c0[_0xaae8('0x44')][_0xaae8('0x54')]){_0x146afd[_0xaae8('0x4f')]=_[_0xaae8('0x53')](_0x146afd[_0xaae8('0x4f')],{'$or':_[_0xaae8('0x55')](_0x146afd[_0xaae8('0x48')],function(_0x29234e){var _0x32eb81={};_0x32eb81[_0x29234e]={'$like':'%'+_0x5b78c0[_0xaae8('0x44')][_0xaae8('0x54')]+'%'};return _0x32eb81;})});}if(_0x5b78c0[_0xaae8('0x44')][_0xaae8('0x96')]){var _0x229501=_0x5b78c0['query'][_0xaae8('0x96')][_0xaae8('0x97')](',');var _0x53c6b9={};_0x53c6b9[_0x229501[0x0]]={'$gte':moment(_0x229501[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x146afd[_0xaae8('0x4f')]=_[_0xaae8('0x53')](_0x146afd['where'],_0x53c6b9);}_0x146afd=_[_0xaae8('0x53')]({},_0x146afd,_0x5b78c0[_0xaae8('0x62')]);return db[_0xaae8('0x98')][_0xaae8('0x2b')]({'where':_0x146afd[_0xaae8('0x4f')]})[_0xaae8('0x1e')](function(_0x28e1ef){_0x1c84ab[_0xaae8('0x2b')]=_0x28e1ef;if(_0x5b78c0['query']['includeAll']){_0x146afd[_0xaae8('0x61')]=[{'all':!![]}];}return db[_0xaae8('0x98')][_0xaae8('0x5b')](_0x146afd);})[_0xaae8('0x1e')](function(_0x3ab3a4){_0x1c84ab[_0xaae8('0x5c')]=_0x3ab3a4;return _0x1c84ab;});}})[_0xaae8('0x1e')](respondWithFilteredResult(_0x82c0b4,_0x146afd))[_0xaae8('0x28')](handleError(_0x82c0b4,null));};exports['send']=function(_0x1ef527,_0x290f02,_0x3ebc60){var _0x150e1b,_0x34ee3b={},_0x392617;if(_0x1ef527[_0xaae8('0x64')]['to']){_0x392617=_0x1ef527['body']['to'][_0xaae8('0x97')](',')[0x0];}return db[_0xaae8('0x5a')]['find']({'where':{'id':_0x1ef527[_0xaae8('0x5e')]['id']},'include':[{'model':db[_0xaae8('0x99')],'as':'List','include':[{'model':db[_0xaae8('0x89')],'as':'Contacts','where':{'email':_0x392617},'limit':0x1,'order':[[_0xaae8('0x9a'),_0xaae8('0x9b')]]}]},{'model':db[_0xaae8('0x3e')],'as':'Smtp','raw':!![]}]})[_0xaae8('0x1e')](handleEntityNotFound(_0x290f02,null))[_0xaae8('0x1e')](function(_0x3586f7){if(_0x3586f7){_0x150e1b=_0x3586f7;if(_0x3586f7[_0xaae8('0x3f')]){if(_[_0xaae8('0x72')](_0x1ef527[_0xaae8('0x64')][_0xaae8('0x9c')])){_0x1ef527[_0xaae8('0x64')][_0xaae8('0x9c')]=util['format'](_0xaae8('0x9d'),_0x3586f7[_0xaae8('0x3a')],_0x3586f7[_0xaae8('0x9e')]||_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x74')]);}if(_0x1ef527[_0xaae8('0x64')][_0xaae8('0x9f')]&&_0x1ef527[_0xaae8('0x64')][_0xaae8('0x9f')][_0xaae8('0x4a')]){for(var _0x2f3e1b=0x0;_0x2f3e1b<_0x1ef527['body'][_0xaae8('0x9f')][_0xaae8('0x4a')];_0x2f3e1b+=0x1){_0x1ef527['body'][_0xaae8('0x9f')][_0x2f3e1b]={'filename':_0x1ef527[_0xaae8('0x64')][_0xaae8('0x9f')][_0x2f3e1b][_0xaae8('0x3a')],'path':path[_0xaae8('0xa0')](config['root'],_0xaae8('0xa1'),_0x1ef527[_0xaae8('0x64')][_0xaae8('0x9f')][_0x2f3e1b][_0xaae8('0xa2')])};}}var _0x5ebc51={'tls':{'rejectUnauthorized':![]}};if(_[_0xaae8('0x72')](_0x3586f7[_0xaae8('0x3f')]['service'])){if(_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x78')]){_0x5ebc51[_0xaae8('0xa3')]={'user':_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x74')],'pass':_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x76')]};}_0x5ebc51[_0xaae8('0x79')]=_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x79')];_0x5ebc51[_0xaae8('0x7a')]=_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x7a')];_0x5ebc51[_0xaae8('0xa4')]=_0x3586f7['Smtp'][_0xaae8('0xa4')];}else{_0x5ebc51[_0xaae8('0x7b')]=_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x7b')];_0x5ebc51['auth']={'user':_0x3586f7[_0xaae8('0x3f')]['user'],'pass':_0x3586f7[_0xaae8('0x3f')][_0xaae8('0x76')]};}return respondWithRpcPromise('SendMail',_0xaae8('0xa5'),{'account':_0x5ebc51,'message':_0x1ef527[_0xaae8('0x64')]});}else{throw new Error(_0xaae8('0xa6'));}}})['then'](function(_0x5474d9){if(_0x5474d9){_0x34ee3b=_0x5474d9;if(_0x150e1b['List']){if(_0x150e1b[_0xaae8('0xa7')][_0xaae8('0xa8')][_0xaae8('0x4a')]){return _0x150e1b[_0xaae8('0xa7')]['Contacts'][0x0];}else{return db[_0xaae8('0x89')][_0xaae8('0x68')](_[_0xaae8('0x17')](_0x1ef527[_0xaae8('0x64')],{'firstName':_0x1ef527[_0xaae8('0x64')]['to'],'email':_0x1ef527[_0xaae8('0x64')]['to'],'phone':_0x1ef527[_0xaae8('0x64')]['to'],'ListId':_0x150e1b['ListId']}));}}else{throw new Error(_0xaae8('0xa6'));}}})[_0xaae8('0x1e')](function(_0x49c88b){if(_0x49c88b){var _0x4a64e4={'UserId':_0x1ef527['user']['id'],'ContactId':_0x49c88b['id'],'MailAccountId':_0x150e1b['id'],'inReplyTo':_0x34ee3b[_0xaae8('0xa9')],'to':_0x1ef527[_0xaae8('0x64')][_0xaae8('0x9c')],'cc':_0x1ef527[_0xaae8('0x64')]['cc'],'subject':_0x1ef527[_0xaae8('0x64')][_0xaae8('0xaa')],'attach':_0x1ef527[_0xaae8('0x64')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0xaae8('0xab')](_0xaae8('0xac')),'lastMsgDirection':_0xaae8('0xad'),'lastMsgBody':_0x1ef527['body'][_0xaae8('0x64')],'Messages':[_['merge'](_0x1ef527[_0xaae8('0x64')],{'messageId':_0x34ee3b[_0xaae8('0xa9')],'sentAt':moment()[_0xaae8('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x150e1b['id'],'UserId':_0x1ef527[_0xaae8('0x74')]['id'],'ContactId':_0x49c88b['id']})]};if(_0x1ef527['body'][_0xaae8('0xae')]){_0x4a64e4=_[_0xaae8('0x53')](_0x4a64e4,_0x1ef527['body'][_0xaae8('0xae')]);}return db[_0xaae8('0x87')][_0xaae8('0x68')](_0x4a64e4,{'include':[{'model':db[_0xaae8('0x98')],'as':'Messages'}]});}})[_0xaae8('0x1e')](respondWithResult(_0x290f02,null))[_0xaae8('0x28')](handleError(_0x290f02,null));};exports['verifySmtp']=function(_0x1ea887,_0xcab8be,_0x80fab3){return db[_0xaae8('0x5a')][_0xaae8('0x63')]({'where':{'id':_0x1ea887[_0xaae8('0x5e')]['id']},'include':[{'model':db[_0xaae8('0x3e')],'as':'Smtp','raw':!![]}]})[_0xaae8('0x1e')](handleEntityNotFound(_0xcab8be,null))[_0xaae8('0x1e')](function(_0x2e7e2c){if(_0x2e7e2c&&_0x2e7e2c['Smtp']){var _0x23f6fc={'id':_0x2e7e2c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2e7e2c[_0xaae8('0x3f')][_0xaae8('0x7b')]){_0x23f6fc[_0xaae8('0x7b')]=_0x2e7e2c[_0xaae8('0x3f')]['service'];}else{_0x23f6fc[_0xaae8('0x79')]=_0x2e7e2c[_0xaae8('0x3f')]['host'];_0x23f6fc[_0xaae8('0x7a')]=_0x2e7e2c[_0xaae8('0x3f')][_0xaae8('0x7a')];_0x23f6fc[_0xaae8('0xa4')]=_0x2e7e2c['Smtp'][_0xaae8('0xa4')];}if(_0x2e7e2c['Smtp'][_0xaae8('0x78')]){_0x23f6fc[_0xaae8('0xa3')]={'user':_0x2e7e2c[_0xaae8('0x3f')]['user'],'pass':_0x2e7e2c[_0xaae8('0x3f')][_0xaae8('0x76')]};}return respondWithRpcPromise('VerifySmtp',_0xaae8('0xaf'),{'account':_0x23f6fc});}})['then'](respondWithResult(_0xcab8be,null))[_0xaae8('0x28')](handleError(_0xcab8be,null));};exports[_0xaae8('0x37')]=function(_0x496f96,_0x150f72){return db[_0xaae8('0x5a')][_0xaae8('0x63')]({'where':{'id':_0x496f96[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x150f72,null))[_0xaae8('0x1e')](function(_0x2f5d0d){if(_0x2f5d0d&&_0x2f5d0d[_0xaae8('0x7b')]){throw new db[(_0xaae8('0xb0'))]['ValidationError'](_0xaae8('0xb1'));}return _0x2f5d0d;})[_0xaae8('0x1e')](removeEntity(_0x150f72,null))[_0xaae8('0x28')](handleError(_0x150f72,null));};exports['addAgents']=function(_0x2e19b7,_0x4e123f,_0x156d34){return db[_0xaae8('0x5a')]['find']({'where':{'id':_0x2e19b7['params']['id']}})['then'](handleEntityNotFound(_0x4e123f,null))['then'](function(_0x403aec){if(_0x403aec){return _0x403aec[_0xaae8('0xb2')](_0x2e19b7['body'][_0xaae8('0x6b')],_[_0xaae8('0x88')](_0x2e19b7['body'],[_0xaae8('0x6b'),'id'])||{})[_0xaae8('0xb3')](function(_0x435173){for(var _0x5d1f2c=0x0;_0x5d1f2c<_0x2e19b7[_0xaae8('0x64')][_0xaae8('0x6b')][_0xaae8('0x4a')];_0x5d1f2c+=0x1){socket[_0xaae8('0xb4')]('userMailAccount:save',{'UserId':_0x2e19b7[_0xaae8('0x64')][_0xaae8('0x6b')][_0x5d1f2c],'MailAccountId':_0x2e19b7[_0xaae8('0x5e')]['id']});}return _0x435173;});}})[_0xaae8('0x1e')](respondWithResult(_0x4e123f,null))[_0xaae8('0x28')](handleError(_0x4e123f,null));};exports['removeAgents']=function(_0x273877,_0x2c6136,_0x554095){var _0x403f9f;return db[_0xaae8('0x5a')][_0xaae8('0x63')]({'where':{'id':_0x273877[_0xaae8('0x5e')]['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x2c6136,null))[_0xaae8('0x1e')](function(_0x1ab143){if(_0x1ab143){return _0x1ab143[_0xaae8('0xb5')](_0x273877[_0xaae8('0x44')]['ids'])[_0xaae8('0x1e')](function(_0x41ede3){if(_[_0xaae8('0xb6')](_0x273877[_0xaae8('0x44')][_0xaae8('0x6b')])){for(var _0x4b68f0=0x0;_0x4b68f0<_0x273877[_0xaae8('0x44')]['ids']['length'];_0x4b68f0+=0x1){socket[_0xaae8('0xb4')]('userMailAccount:remove',{'UserId':_0x273877[_0xaae8('0x44')][_0xaae8('0x6b')][_0x4b68f0],'MailAccountId':_0x273877['params']['id']});}}else{socket[_0xaae8('0xb4')]('userMailAccount:remove',{'UserId':_0x273877[_0xaae8('0x44')][_0xaae8('0x6b')],'MailAccountId':_0x273877[_0xaae8('0x5e')]['id']});}});}})[_0xaae8('0x1e')](respondWithStatusCode(_0x2c6136,null))[_0xaae8('0x28')](handleError(_0x2c6136,null));};exports['getAgents']=function(_0x390492,_0x3942d0,_0x1a86ba){var _0x52f2ec={};var _0x4cd08={};var _0x3cb728;var _0x126a96;return db['MailAccount'][_0xaae8('0x6f')]({'where':{'id':_0x390492['params']['id']}})[_0xaae8('0x1e')](handleEntityNotFound(_0x3942d0,null))['then'](function(_0x378a7d){if(_0x378a7d){_0x3cb728=_0x378a7d;_0x4cd08[_0xaae8('0x41')]=_['keys'](db[_0xaae8('0x8a')]['rawAttributes']);_0x4cd08[_0xaae8('0x44')]=_[_0xaae8('0x42')](_0x390492['query']);_0x4cd08[_0xaae8('0x46')]=_[_0xaae8('0x47')](_0x4cd08[_0xaae8('0x41')],_0x4cd08[_0xaae8('0x44')]);_0x52f2ec[_0xaae8('0x48')]=_[_0xaae8('0x47')](_0x4cd08['model'],qs[_0xaae8('0x49')](_0x390492[_0xaae8('0x44')][_0xaae8('0x49')]));_0x52f2ec[_0xaae8('0x48')]=_0x52f2ec[_0xaae8('0x48')][_0xaae8('0x4a')]?_0x52f2ec[_0xaae8('0x48')]:_0x4cd08[_0xaae8('0x41')];_0x52f2ec[_0xaae8('0x4d')]=qs[_0xaae8('0x4e')](_0x390492[_0xaae8('0x44')]['sort']);_0x52f2ec[_0xaae8('0x4f')]=qs['filters'](_[_0xaae8('0x50')](_0x390492[_0xaae8('0x44')],_0x4cd08[_0xaae8('0x46')]));if(_0x390492['query'][_0xaae8('0x54')]){_0x52f2ec[_0xaae8('0x4f')]=_[_0xaae8('0x53')](_0x52f2ec[_0xaae8('0x4f')],{'$or':_[_0xaae8('0x55')](_0x52f2ec[_0xaae8('0x48')],function(_0x13b3fa){var _0x2305d5={};_0x2305d5[_0x13b3fa]={'$like':'%'+_0x390492[_0xaae8('0x44')][_0xaae8('0x54')]+'%'};return _0x2305d5;})});}_0x52f2ec=_[_0xaae8('0x53')]({},_0x52f2ec,_0x390492[_0xaae8('0x62')]);return _0x3cb728[_0xaae8('0xb7')](_0x52f2ec);}})['then'](function(_0x173333){if(_0x173333){_0x126a96=_0x173333[_0xaae8('0x4a')];if(!_0x390492['query']['hasOwnProperty'](_0xaae8('0x4c'))){_0x52f2ec['limit']=qs[_0xaae8('0x2d')](_0x390492['query'][_0xaae8('0x2d')]);_0x52f2ec[_0xaae8('0x2c')]=qs[_0xaae8('0x2c')](_0x390492['query'][_0xaae8('0x2c')]);}return _0x3cb728[_0xaae8('0xb7')](_0x52f2ec);}})[_0xaae8('0x1e')](function(_0x3af208){if(_0x3af208){return _0x3af208?{'count':_0x126a96,'rows':_0x3af208}:null;}})['then'](respondWithResult(_0x3942d0,null))[_0xaae8('0x28')](handleError(_0x3942d0,null));};
\ No newline at end of file
index 753f64e..3a2820c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc4=['MailAccount','setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x2dfa1f,_0x234b78){var _0x4f0528=function(_0x1406c6){while(--_0x1406c6){_0x2dfa1f['push'](_0x2dfa1f['shift']());}};_0x4f0528(++_0x234b78);}(_0x5fc4,0xa9));var _0x45fc=function(_0x228af0,_0x4e0026){_0x228af0=_0x228af0-0x0;var _0x1a450e=_0x5fc4[_0x228af0];return _0x1a450e;};'use strict';var EventEmitter=require(_0x45fc('0x0'));var MailAccount=require(_0x45fc('0x1'))['db'][_0x45fc('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x45fc('0x3')](0x0);var events={'afterCreate':_0x45fc('0x4'),'afterUpdate':_0x45fc('0x5'),'afterDestroy':_0x45fc('0x6')};function emitEvent(_0x1ab130){return function(_0x28f34f,_0x35d05a,_0x3f95d0){MailAccountEvents[_0x45fc('0x7')](_0x1ab130+':'+_0x28f34f['id'],_0x28f34f);MailAccountEvents[_0x45fc('0x7')](_0x1ab130,_0x28f34f);_0x3f95d0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x45fc('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0x519c=['MailAccount','setMaxListeners','save','update','remove','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4bb4d5,_0x2c360c){var _0x56128f=function(_0x2d1765){while(--_0x2d1765){_0x4bb4d5['push'](_0x4bb4d5['shift']());}};_0x56128f(++_0x2c360c);}(_0x519c,0x10c));var _0xc519=function(_0x537b58,_0x163223){_0x537b58=_0x537b58-0x0;var _0x244462=_0x519c[_0x537b58];return _0x244462;};'use strict';var EventEmitter=require(_0xc519('0x0'));var MailAccount=require(_0xc519('0x1'))['db'][_0xc519('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc519('0x3')](0x0);var events={'afterCreate':_0xc519('0x4'),'afterUpdate':_0xc519('0x5'),'afterDestroy':_0xc519('0x6')};function emitEvent(_0x2be778){return function(_0x39d744,_0x11a3a3,_0x3ef845){MailAccountEvents['emit'](_0x2be778+':'+_0x39d744['id'],_0x39d744);MailAccountEvents['emit'](_0x2be778,_0x39d744);_0x3ef845(null);};}for(var e in events){if(events[_0xc519('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xc519('0x8')]=MailAccountEvents;
\ No newline at end of file
index e1ef5a5..ac09daa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x285e=['request-promise','./mailAccount.attributes','exports','MailAccount','mail_accounts','util','api','bluebird'];(function(_0x1174d3,_0x17fe65){var _0xb58ebd=function(_0x32835f){while(--_0x32835f){_0x1174d3['push'](_0x1174d3['shift']());}};_0xb58ebd(++_0x17fe65);}(_0x285e,0x11d));var _0xe285=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x285e[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require('lodash');var util=require(_0xe285('0x0'));var logger=require('../../config/logger')(_0xe285('0x1'));var moment=require('moment');var BPromise=require(_0xe285('0x2'));var rp=require(_0xe285('0x3'));var attributes=require(_0xe285('0x4'));module[_0xe285('0x5')]=function(_0x29b2ab,_0x5d46f8){return _0x29b2ab['define'](_0xe285('0x6'),attributes,{'tableName':_0xe285('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ab6=['mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1ab6,0x10f));var _0x61ab=function(_0x607b09,_0x8fed7b){_0x607b09=_0x607b09-0x0;var _0x581b1c=_0x1ab6[_0x607b09];return _0x581b1c;};'use strict';var _=require(_0x61ab('0x0'));var util=require(_0x61ab('0x1'));var logger=require(_0x61ab('0x2'))(_0x61ab('0x3'));var moment=require(_0x61ab('0x4'));var BPromise=require(_0x61ab('0x5'));var rp=require(_0x61ab('0x6'));var attributes=require('./mailAccount.attributes');module[_0x61ab('0x7')]=function(_0xd176b4,_0x1d9a4c){return _0xd176b4[_0x61ab('0x8')]('MailAccount',attributes,{'tableName':_0x61ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index af9492e..3303115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a19=['messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','update','subject','interaction','created','create','contact','attachments','originTo','originCc','bcc','Attachment','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','then','info','ShowMailAccount','raw','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','Applications','MailServerOut','Smtp','get','omit','List','applications','orderBy','priority','autoclose','*,*,*,*','length','List\x20not\x20found'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x8a19,0xe8));var _0x98a1=function(_0x3b0025,_0x29991e){_0x3b0025=_0x3b0025-0x0;var _0x239bc8=_0x8a19[_0x3b0025];return _0x239bc8;};'use strict';var _=require('lodash');var util=require(_0x98a1('0x0'));var moment=require(_0x98a1('0x1'));var BPromise=require(_0x98a1('0x2'));var rs=require(_0x98a1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98a1('0x4'))['db'];var utils=require(_0x98a1('0x5'));var logger=require('../../config/logger')(_0x98a1('0x6'));var config=require(_0x98a1('0x7'));var jayson=require(_0x98a1('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x98a1('0x9')]=_[_0x98a1('0xa')](config[_0x98a1('0x9')],{'host':_0x98a1('0xb'),'port':0x18eb});var socket=require(_0x98a1('0xc'))(new Redis(config[_0x98a1('0x9')]));require(_0x98a1('0xd'))[_0x98a1('0xe')](socket);function respondWithRpcPromise(_0x4a2209,_0x4982f8,_0x4d802b){return new BPromise(function(_0x32bf1f,_0x3c95d5){return client[_0x98a1('0xf')](_0x4a2209,_0x4d802b)['then'](function(_0x206fd6){logger['info'](_0x98a1('0x10'),_0x4982f8,_0x98a1('0x11'));logger[_0x98a1('0x12')](_0x98a1('0x13'),_0x4982f8,_0x98a1('0x11'),JSON[_0x98a1('0x14')](_0x206fd6));if(_0x206fd6[_0x98a1('0x15')]){if(_0x206fd6[_0x98a1('0x15')][_0x98a1('0x16')]===0x1f4){logger[_0x98a1('0x15')](_0x98a1('0x10'),_0x4982f8,_0x206fd6[_0x98a1('0x15')][_0x98a1('0x17')]);return _0x3c95d5(_0x206fd6[_0x98a1('0x15')]['message']);}logger['error'](_0x98a1('0x10'),_0x4982f8,_0x206fd6['error'][_0x98a1('0x17')]);return _0x32bf1f(_0x206fd6[_0x98a1('0x15')]['message']);}else{logger['info'](_0x98a1('0x10'),_0x4982f8,_0x98a1('0x11'));_0x32bf1f(_0x206fd6['result'][_0x98a1('0x17')]);}})[_0x98a1('0x18')](function(_0x2ec10e){logger['error']('MailAccount,\x20%s,\x20%s',_0x4982f8,_0x2ec10e);_0x3c95d5(_0x2ec10e);});});}exports[_0x98a1('0x19')]=function(_0x97bf8){var _0x541b6e=this;return new Promise(function(_0x4cbb0a,_0x5b250a){return db[_0x98a1('0x1a')][_0x98a1('0x1b')]({'raw':_0x97bf8['options']?_0x97bf8['options']['raw']===undefined?!![]:![]:!![],'where':_0x97bf8[_0x98a1('0x1c')]?_0x97bf8[_0x98a1('0x1c')]['where']||null:null,'attributes':_0x97bf8[_0x98a1('0x1c')]?_0x97bf8[_0x98a1('0x1c')][_0x98a1('0x1d')]||null:null,'limit':_0x97bf8[_0x98a1('0x1c')]?_0x97bf8[_0x98a1('0x1c')][_0x98a1('0x1e')]||null:null,'include':_0x97bf8['options']?_0x97bf8[_0x98a1('0x1c')][_0x98a1('0x1f')]?_[_0x98a1('0x20')](_0x97bf8[_0x98a1('0x1c')]['include'],function(_0x1ff907){return{'model':db[_0x1ff907[_0x98a1('0x21')]],'as':_0x1ff907['as'],'attributes':_0x1ff907['attributes'],'include':_0x1ff907['include']?_[_0x98a1('0x20')](_0x1ff907[_0x98a1('0x1f')],function(_0x23f9e9){return{'model':db[_0x23f9e9[_0x98a1('0x21')]],'as':_0x23f9e9['as'],'attributes':_0x23f9e9[_0x98a1('0x1d')],'include':_0x23f9e9['include']?_[_0x98a1('0x20')](_0x23f9e9[_0x98a1('0x1f')],function(_0x5db428){return{'model':db[_0x5db428[_0x98a1('0x21')]],'as':_0x5db428['as'],'attributes':_0x5db428[_0x98a1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x98a1('0x22')](function(_0x451508){logger[_0x98a1('0x23')](_0x98a1('0x19'),_0x97bf8);logger[_0x98a1('0x12')](_0x98a1('0x19'),_0x97bf8,JSON[_0x98a1('0x14')](_0x451508));_0x4cbb0a(_0x451508);})['catch'](function(_0x5486b6){logger['error'](_0x98a1('0x19'),_0x5486b6['message'],_0x97bf8);_0x5b250a(_0x541b6e['error'](0x1f4,_0x5486b6[_0x98a1('0x17')]));});});};exports[_0x98a1('0x24')]=function(_0x2b0e76){var _0x1bce18=this;return new Promise(function(_0x37d8e0,_0x30b622){return db[_0x98a1('0x1a')]['find']({'raw':_0x2b0e76[_0x98a1('0x1c')]?_0x2b0e76[_0x98a1('0x1c')][_0x98a1('0x25')]===undefined?!![]:![]:!![],'where':_0x2b0e76[_0x98a1('0x1c')]?_0x2b0e76[_0x98a1('0x1c')]['where']||null:null,'attributes':_0x2b0e76[_0x98a1('0x1c')]?_0x2b0e76[_0x98a1('0x1c')][_0x98a1('0x1d')]||null:null,'include':_0x2b0e76[_0x98a1('0x1c')]?_0x2b0e76['options'][_0x98a1('0x1f')]?_['map'](_0x2b0e76[_0x98a1('0x1c')]['include'],function(_0x26083d){return{'model':db[_0x26083d['model']],'as':_0x26083d['as'],'attributes':_0x26083d['attributes'],'include':_0x26083d['include']?_[_0x98a1('0x20')](_0x26083d[_0x98a1('0x1f')],function(_0x446e76){return{'model':db[_0x446e76[_0x98a1('0x21')]],'as':_0x446e76['as'],'attributes':_0x446e76[_0x98a1('0x1d')],'include':_0x446e76['include']?_['map'](_0x446e76[_0x98a1('0x1f')],function(_0x4c6411){return{'model':db[_0x4c6411['model']],'as':_0x4c6411['as'],'attributes':_0x4c6411[_0x98a1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x98a1('0x22')](function(_0x3183bc){logger['info'](_0x98a1('0x24'),_0x2b0e76);logger['debug']('ShowMailAccount',_0x2b0e76,JSON['stringify'](_0x3183bc));_0x37d8e0(_0x3183bc);})[_0x98a1('0x18')](function(_0x3bd6da){logger['error'](_0x98a1('0x24'),_0x3bd6da[_0x98a1('0x17')],_0x2b0e76);_0x30b622(_0x1bce18['error'](0x1f4,_0x3bd6da[_0x98a1('0x17')]));});});};exports[_0x98a1('0x26')]=function(_0xa5e6aa){var _0x2575f7=this;return new Promise(function(_0x18069e,_0x35cc6e){var _0x2425cb={'body':_0xa5e6aa[_0x98a1('0x27')],'channel':_0x98a1('0x28')};var _0x594b85=_[_0x98a1('0x29')](_[_0x98a1('0x2a')](db[_0x98a1('0x2b')]['rawAttributes']),[_0x98a1('0x2c'),_0x98a1('0x2d'),_0x98a1('0x2e'),'ListId']);var _0x359a7d=![];if(_0xa5e6aa[_0x98a1('0x27')]['id']){delete _0xa5e6aa[_0x98a1('0x27')]['id'];}if(_['isNil'](_0xa5e6aa['body'][_0x98a1('0x2f')])){return _0x35cc6e(_0x2575f7['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x98a1('0x30')](_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x27')])||_0xa5e6aa['body']['body']===''){return _0x35cc6e(_0x2575f7[_0x98a1('0x15')](0x1f4,_0x98a1('0x31')));}if(_[_0x98a1('0x30')](_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x32')])){return _0x35cc6e(_0x2575f7[_0x98a1('0x15')](0x1f4,_0x98a1('0x33')+_0x594b85));}if(!_['includes'](_0x594b85,_0xa5e6aa[_0x98a1('0x27')]['mapKey'])){return _0x35cc6e(_0x2575f7['error'](0x1f4,_0x98a1('0x34')+_0x594b85));}var _0x29e952={};_0x29e952[_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x32')]]=_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x2f')];return db[_0x98a1('0x1a')][_0x98a1('0x35')]({'where':{'id':_0xa5e6aa[_0x98a1('0x36')]['id']},'include':[{'model':db[_0x98a1('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0x98a1('0x38'),'where':_0x29e952,'limit':0x1,'order':[['updatedAt',_0x98a1('0x39')]]}]},{'model':db['MailApplication'],'as':_0x98a1('0x3a')},{'model':db[_0x98a1('0x3b')],'as':_0x98a1('0x3c')}]})[_0x98a1('0x22')](function(_0x43c335){if(_0x43c335&&_0x43c335['List']){var _0x3f0ec9=_0x43c335[_0x98a1('0x3d')]({'plain':!![]});_0x2425cb[_0x98a1('0x36')]=_[_0x98a1('0x3e')](_0x3f0ec9,[_0x98a1('0x3a'),_0x98a1('0x3f')]);_0x2425cb[_0x98a1('0x40')]=_0x3f0ec9[_0x98a1('0x3a')];_0x2425cb['list']=_0x3f0ec9[_0x98a1('0x3f')];_0x2425cb['applications']=_[_0x98a1('0x41')](_0x2425cb[_0x98a1('0x40')],[_0x98a1('0x42')],['asc']);if(_0x2425cb[_0x98a1('0x36')]&&_0x2425cb[_0x98a1('0x36')][_0x98a1('0x43')]){_0x2425cb['applications']['push']({'id':0x0,'priority':_0x2425cb[_0x98a1('0x40')]['length']+0x1,'app':'close','appdata':'autoclose','interval':_0x98a1('0x44')});}if(_0x2425cb[_0x98a1('0x36')][_0x98a1('0x3a')]){delete _0x2425cb['account'][_0x98a1('0x3a')];}if(_0x2425cb[_0x98a1('0x36')][_0x98a1('0x3f')]){delete _0x2425cb['account']['List'];}if(_0x3f0ec9[_0x98a1('0x3f')][_0x98a1('0x38')][_0x98a1('0x45')]){return _0x3f0ec9[_0x98a1('0x3f')][_0x98a1('0x38')][0x0];}var _0x5c254d=_[_0x98a1('0xa')](_0xa5e6aa['body'],{'firstName':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x2f')],'ListId':_0x3f0ec9['ListId']});_0x5c254d[_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x32')]]=_0xa5e6aa['body'][_0x98a1('0x2f')];return db['CmContact']['create'](_0x5c254d);}else{throw new Error(_0x98a1('0x46'));}})['then'](function(_0x559a79){_0x2425cb['contact']=_0x559a79;if(_0x559a79){if(!_0xa5e6aa['body'][_0x98a1('0x17')][_0x98a1('0x47')]){_0xa5e6aa[_0x98a1('0x27')]['message'][_0x98a1('0x47')]=rs[_0x98a1('0x48')]()+'\x20'+_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')][_0x98a1('0x2f')];}var _0x287151={'ContactId':_0x559a79['id'],'MailAccountId':_0xa5e6aa[_0x98a1('0x36')]['id'],'inReplyTo':_0xa5e6aa[_0x98a1('0x27')]['message'][_0x98a1('0x47')],'to':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')]['from'],'cc':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')]['cc'],'subject':_0xa5e6aa[_0x98a1('0x27')]['message']['subject'],'attach':_0xa5e6aa['body'][_0x98a1('0x17')][_0x98a1('0x49')],'lastMsgAt':moment()[_0x98a1('0x4a')](_0x98a1('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0xa5e6aa[_0x98a1('0x27')]['body']};return db[_0x98a1('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0xa5e6aa[_0x98a1('0x36')]['id']},'include':[{'model':db[_0x98a1('0x4d')],'as':_0x98a1('0x4e'),'attributes':[_0x98a1('0x47')],'where':{'messageId':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')]['inReplyTo']}}]})[_0x98a1('0x22')](function(_0x5c7466){if(_0x5c7466){return[_0x5c7466,![]];}return db[_0x98a1('0x4c')]['create'](_0x287151)['then'](function(_0x4924d8){return[_0x4924d8,!![]];});});}else{throw new Error(_0x98a1('0x4f'));}})[_0x98a1('0x50')](function(_0xd6d274,_0x57c746){if(_0xd6d274){_0x359a7d=_0x57c746;if(!_0x57c746){return _0xd6d274[_0x98a1('0x51')]({'inReplyTo':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')][_0x98a1('0x47')],'to':_0xa5e6aa['body'][_0x98a1('0x17')][_0x98a1('0x2f')],'cc':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')]['cc'],'subject':_0xa5e6aa[_0x98a1('0x27')]['message'][_0x98a1('0x52')],'attach':_0xd6d274[_0x98a1('0x49')]?_0xd6d274[_0x98a1('0x49')]:_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')][_0x98a1('0x49')],'substatus':null,'substatusAt':moment()['format'](_0x98a1('0x4b')),'lastMsgAt':moment()[_0x98a1('0x4a')](_0x98a1('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x27')]});}else{return _0xd6d274;}}})[_0x98a1('0x22')](function(_0x448779){_0x2425cb[_0x98a1('0x53')]=_0x448779['get']({'plain':!![]});_0x2425cb[_0x98a1('0x53')][_0x98a1('0x54')]=_0x359a7d;return db[_0x98a1('0x4d')][_0x98a1('0x55')]({'body':_0xa5e6aa[_0x98a1('0x27')]['body'],'MailAccountId':_0xa5e6aa['account']['id'],'MailInteractionId':_0x448779['id'],'direction':'in','ContactId':_0x2425cb[_0x98a1('0x56')]['id'],'messageId':_0xa5e6aa[_0x98a1('0x27')]['message'][_0x98a1('0x47')],'from':_0xa5e6aa['body'][_0x98a1('0x17')][_0x98a1('0x2f')],'to':_0xa5e6aa['body'][_0x98a1('0x17')]['to'],'cc':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')]['cc'],'subject':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')][_0x98a1('0x52')],'attach':_0xa5e6aa[_0x98a1('0x27')]['message'][_0x98a1('0x49')],'Attachments':_0xa5e6aa['body'][_0x98a1('0x17')][_0x98a1('0x57')],'originTo':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')][_0x98a1('0x58')],'originCc':_0xa5e6aa[_0x98a1('0x27')][_0x98a1('0x17')][_0x98a1('0x59')],'bcc':_0xa5e6aa['body'][_0x98a1('0x17')][_0x98a1('0x5a')]},{'include':[{'model':db[_0x98a1('0x5b')],'as':_0x98a1('0x5c')}]});})[_0x98a1('0x22')](function(_0x114479){_0x2425cb['message']=_0x114479;if(_0x2425cb[_0x98a1('0x53')]['UserId']){return db[_0x98a1('0x5d')][_0x98a1('0x35')]({'attributes':['id',_0x98a1('0x5e')],'where':{'id':_0x2425cb[_0x98a1('0x53')][_0x98a1('0x5f')]}})['then'](function(_0x132f8a){if(_0x132f8a){_0x2425cb[_0x98a1('0x40')][_0x98a1('0x60')]({'id':0x0,'priority':0x0,'app':_0x98a1('0x61'),'appdata':_0x132f8a['name']+','+(_0x2425cb[_0x98a1('0x36')][_0x98a1('0x62')]||0xa),'interval':_0x98a1('0x44')});}return respondWithRpcPromise(_0x98a1('0x63'),_0x98a1('0x64'),_0x2425cb);});}return respondWithRpcPromise('Start',_0x98a1('0x64'),_0x2425cb);})[_0x98a1('0x22')](function(_0x3363a0){_0x18069e(_0x3363a0);})[_0x98a1('0x18')](function(_0x1df57d){_0x35cc6e(_0x2575f7[_0x98a1('0x15')](0x1f4,_0x1df57d[_0x98a1('0x17')]));});});};
\ No newline at end of file
+var _0xa1ab=['omit','list','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','ListId','create','contact','messageId','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','attachments','originTo','bcc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailAccount','MailAccount','options','raw','where','attributes','limit','include','model','map','debug','catch','ShowMailAccount','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','account'];(function(_0x524650,_0x46a646){var _0x441698=function(_0x12d9ed){while(--_0x12d9ed){_0x524650['push'](_0x524650['shift']());}};_0x441698(++_0x46a646);}(_0xa1ab,0x92));var _0xba1a=function(_0x2b23ef,_0x41ff06){_0x2b23ef=_0x2b23ef-0x0;var _0x507012=_0xa1ab[_0x2b23ef];return _0x507012;};'use strict';var _=require(_0xba1a('0x0'));var util=require(_0xba1a('0x1'));var moment=require(_0xba1a('0x2'));var BPromise=require(_0xba1a('0x3'));var rs=require(_0xba1a('0x4'));var fs=require('fs');var Redis=require(_0xba1a('0x5'));var db=require(_0xba1a('0x6'))['db'];var utils=require(_0xba1a('0x7'));var logger=require(_0xba1a('0x8'))(_0xba1a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xba1a('0xa')][_0xba1a('0xb')]({'port':0x232c});config['redis']=_['defaults'](config[_0xba1a('0xc')],{'host':_0xba1a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba1a('0xc')]));require(_0xba1a('0xe'))[_0xba1a('0xf')](socket);function respondWithRpcPromise(_0x383344,_0x138af1,_0x45c48a){return new BPromise(function(_0x361b1f,_0x2a5599){return client[_0xba1a('0x10')](_0x383344,_0x45c48a)[_0xba1a('0x11')](function(_0x3ed0fd){logger[_0xba1a('0x12')](_0xba1a('0x13'),_0x138af1,_0xba1a('0x14'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x138af1,'request\x20sent',JSON[_0xba1a('0x15')](_0x3ed0fd));if(_0x3ed0fd[_0xba1a('0x16')]){if(_0x3ed0fd[_0xba1a('0x16')][_0xba1a('0x17')]===0x1f4){logger[_0xba1a('0x16')](_0xba1a('0x13'),_0x138af1,_0x3ed0fd['error'][_0xba1a('0x18')]);return _0x2a5599(_0x3ed0fd[_0xba1a('0x16')][_0xba1a('0x18')]);}logger[_0xba1a('0x16')]('MailAccount,\x20%s,\x20%s',_0x138af1,_0x3ed0fd[_0xba1a('0x16')][_0xba1a('0x18')]);return _0x361b1f(_0x3ed0fd[_0xba1a('0x16')]['message']);}else{logger[_0xba1a('0x12')](_0xba1a('0x13'),_0x138af1,'request\x20sent');_0x361b1f(_0x3ed0fd[_0xba1a('0x19')][_0xba1a('0x18')]);}})['catch'](function(_0x370149){logger['error'](_0xba1a('0x13'),_0x138af1,_0x370149);_0x2a5599(_0x370149);});});}exports[_0xba1a('0x1a')]=function(_0x137ec8){var _0x58c59b=this;return new Promise(function(_0x2c9b48,_0x1cd873){return db[_0xba1a('0x1b')]['findAll']({'raw':_0x137ec8['options']?_0x137ec8[_0xba1a('0x1c')][_0xba1a('0x1d')]===undefined?!![]:![]:!![],'where':_0x137ec8[_0xba1a('0x1c')]?_0x137ec8['options'][_0xba1a('0x1e')]||null:null,'attributes':_0x137ec8['options']?_0x137ec8[_0xba1a('0x1c')][_0xba1a('0x1f')]||null:null,'limit':_0x137ec8[_0xba1a('0x1c')]?_0x137ec8[_0xba1a('0x1c')][_0xba1a('0x20')]||null:null,'include':_0x137ec8[_0xba1a('0x1c')]?_0x137ec8[_0xba1a('0x1c')][_0xba1a('0x21')]?_['map'](_0x137ec8[_0xba1a('0x1c')][_0xba1a('0x21')],function(_0x4a8bee){return{'model':db[_0x4a8bee[_0xba1a('0x22')]],'as':_0x4a8bee['as'],'attributes':_0x4a8bee['attributes'],'include':_0x4a8bee[_0xba1a('0x21')]?_['map'](_0x4a8bee[_0xba1a('0x21')],function(_0x1c9112){return{'model':db[_0x1c9112['model']],'as':_0x1c9112['as'],'attributes':_0x1c9112['attributes'],'include':_0x1c9112['include']?_[_0xba1a('0x23')](_0x1c9112[_0xba1a('0x21')],function(_0x598901){return{'model':db[_0x598901[_0xba1a('0x22')]],'as':_0x598901['as'],'attributes':_0x598901[_0xba1a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xba1a('0x11')](function(_0x342e83){logger[_0xba1a('0x12')](_0xba1a('0x1a'),_0x137ec8);logger[_0xba1a('0x24')](_0xba1a('0x1a'),_0x137ec8,JSON[_0xba1a('0x15')](_0x342e83));_0x2c9b48(_0x342e83);})[_0xba1a('0x25')](function(_0x23f2d3){logger['error'](_0xba1a('0x1a'),_0x23f2d3[_0xba1a('0x18')],_0x137ec8);_0x1cd873(_0x58c59b[_0xba1a('0x16')](0x1f4,_0x23f2d3[_0xba1a('0x18')]));});});};exports[_0xba1a('0x26')]=function(_0x5edd6){var _0x4d1b80=this;return new Promise(function(_0x4d08b6,_0xfd92fd){return db[_0xba1a('0x1b')]['find']({'raw':_0x5edd6[_0xba1a('0x1c')]?_0x5edd6[_0xba1a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5edd6[_0xba1a('0x1c')]?_0x5edd6[_0xba1a('0x1c')]['where']||null:null,'attributes':_0x5edd6['options']?_0x5edd6[_0xba1a('0x1c')][_0xba1a('0x1f')]||null:null,'include':_0x5edd6[_0xba1a('0x1c')]?_0x5edd6[_0xba1a('0x1c')][_0xba1a('0x21')]?_[_0xba1a('0x23')](_0x5edd6['options'][_0xba1a('0x21')],function(_0x2dafaa){return{'model':db[_0x2dafaa['model']],'as':_0x2dafaa['as'],'attributes':_0x2dafaa[_0xba1a('0x1f')],'include':_0x2dafaa['include']?_[_0xba1a('0x23')](_0x2dafaa[_0xba1a('0x21')],function(_0x3a33de){return{'model':db[_0x3a33de[_0xba1a('0x22')]],'as':_0x3a33de['as'],'attributes':_0x3a33de[_0xba1a('0x1f')],'include':_0x3a33de[_0xba1a('0x21')]?_['map'](_0x3a33de['include'],function(_0x2818a3){return{'model':db[_0x2818a3['model']],'as':_0x2818a3['as'],'attributes':_0x2818a3[_0xba1a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xba1a('0x11')](function(_0x223ca0){logger[_0xba1a('0x12')](_0xba1a('0x26'),_0x5edd6);logger[_0xba1a('0x24')]('ShowMailAccount',_0x5edd6,JSON['stringify'](_0x223ca0));_0x4d08b6(_0x223ca0);})[_0xba1a('0x25')](function(_0x885e64){logger[_0xba1a('0x16')](_0xba1a('0x26'),_0x885e64[_0xba1a('0x18')],_0x5edd6);_0xfd92fd(_0x4d1b80[_0xba1a('0x16')](0x1f4,_0x885e64[_0xba1a('0x18')]));});});};exports['NotifyMailAccount']=function(_0x2e3a3d){var _0x411d79=this;return new Promise(function(_0x3a7f7e,_0x29bb01){var _0x4521de={'body':_0x2e3a3d['body'],'channel':_0xba1a('0x27')};var _0x11b3d7=_[_0xba1a('0x28')](_[_0xba1a('0x29')](db[_0xba1a('0x2a')]['rawAttributes']),[_0xba1a('0x2b'),_0xba1a('0x2c'),_0xba1a('0x2d'),'ListId']);var _0x4f07e9=![];if(_0x2e3a3d[_0xba1a('0x2e')]['id']){delete _0x2e3a3d[_0xba1a('0x2e')]['id'];}if(_[_0xba1a('0x2f')](_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x30')])){return _0x29bb01(_0x411d79[_0xba1a('0x16')](0x1f4,_0xba1a('0x31')));}if(_['isNil'](_0x2e3a3d['body'][_0xba1a('0x2e')])||_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x2e')]===''){return _0x29bb01(_0x411d79['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xba1a('0x2f')](_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x32')])){return _0x29bb01(_0x411d79['error'](0x1f4,_0xba1a('0x33')+_0x11b3d7));}if(!_[_0xba1a('0x34')](_0x11b3d7,_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x32')])){return _0x29bb01(_0x411d79[_0xba1a('0x16')](0x1f4,_0xba1a('0x35')+_0x11b3d7));}var _0x56b5c8={};_0x56b5c8[_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x32')]]=_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x30')];return db[_0xba1a('0x1b')][_0xba1a('0x36')]({'where':{'id':_0x2e3a3d['account']['id']},'include':[{'model':db[_0xba1a('0x37')],'as':_0xba1a('0x38'),'include':[{'model':db['CmContact'],'as':_0xba1a('0x39'),'where':_0x56b5c8,'limit':0x1,'order':[[_0xba1a('0x2c'),_0xba1a('0x3a')]]}]},{'model':db[_0xba1a('0x3b')],'as':_0xba1a('0x3c')},{'model':db[_0xba1a('0x3d')],'as':_0xba1a('0x3e')}]})['then'](function(_0x2afde2){if(_0x2afde2&&_0x2afde2['List']){var _0x23cc50=_0x2afde2['get']({'plain':!![]});_0x4521de[_0xba1a('0x3f')]=_[_0xba1a('0x40')](_0x23cc50,[_0xba1a('0x3c'),_0xba1a('0x38')]);_0x4521de['applications']=_0x23cc50[_0xba1a('0x3c')];_0x4521de[_0xba1a('0x41')]=_0x23cc50['List'];_0x4521de[_0xba1a('0x42')]=_[_0xba1a('0x43')](_0x4521de[_0xba1a('0x42')],[_0xba1a('0x44')],[_0xba1a('0x45')]);if(_0x4521de['account']&&_0x4521de['account'][_0xba1a('0x46')]){_0x4521de['applications'][_0xba1a('0x47')]({'id':0x0,'priority':_0x4521de[_0xba1a('0x42')][_0xba1a('0x48')]+0x1,'app':_0xba1a('0x49'),'appdata':'autoclose','interval':_0xba1a('0x4a')});}if(_0x4521de['account'][_0xba1a('0x3c')]){delete _0x4521de['account'][_0xba1a('0x3c')];}if(_0x4521de[_0xba1a('0x3f')]['List']){delete _0x4521de[_0xba1a('0x3f')][_0xba1a('0x38')];}if(_0x23cc50[_0xba1a('0x38')][_0xba1a('0x39')][_0xba1a('0x48')]){return _0x23cc50['List']['Contacts'][0x0];}var _0x43e3dc=_[_0xba1a('0x4b')](_0x2e3a3d[_0xba1a('0x2e')],{'firstName':_0x2e3a3d['body'][_0xba1a('0x30')],'ListId':_0x23cc50[_0xba1a('0x4c')]});_0x43e3dc[_0x2e3a3d['body'][_0xba1a('0x32')]]=_0x2e3a3d[_0xba1a('0x2e')]['from'];return db[_0xba1a('0x2a')][_0xba1a('0x4d')](_0x43e3dc);}else{throw new Error('List\x20not\x20found');}})[_0xba1a('0x11')](function(_0x5c9eb1){_0x4521de[_0xba1a('0x4e')]=_0x5c9eb1;if(_0x5c9eb1){if(!_0x2e3a3d[_0xba1a('0x2e')]['message'][_0xba1a('0x4f')]){_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x4f')]=rs['generate']()+'\x20'+_0x2e3a3d[_0xba1a('0x2e')]['message'][_0xba1a('0x30')];}var _0x1e5473={'ContactId':_0x5c9eb1['id'],'MailAccountId':_0x2e3a3d['account']['id'],'inReplyTo':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x4f')],'to':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')]['from'],'cc':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')]['cc'],'subject':_0x2e3a3d['body'][_0xba1a('0x18')]['subject'],'attach':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')]['attach'],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x2e')]};return db[_0xba1a('0x50')][_0xba1a('0x36')]({'where':{'closed':![],'MailAccountId':_0x2e3a3d['account']['id']},'include':[{'model':db[_0xba1a('0x51')],'as':_0xba1a('0x52'),'attributes':[_0xba1a('0x4f')],'where':{'messageId':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x53')]}}]})[_0xba1a('0x11')](function(_0x84d9d8){if(_0x84d9d8){return[_0x84d9d8,![]];}return db[_0xba1a('0x50')][_0xba1a('0x4d')](_0x1e5473)[_0xba1a('0x11')](function(_0x459523){return[_0x459523,!![]];});});}else{throw new Error(_0xba1a('0x54'));}})[_0xba1a('0x55')](function(_0x3dc833,_0x8ee6a1){if(_0x3dc833){_0x4f07e9=_0x8ee6a1;if(!_0x8ee6a1){return _0x3dc833['update']({'inReplyTo':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x4f')],'to':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x30')],'cc':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')]['cc'],'subject':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x56')],'attach':_0x3dc833[_0xba1a('0x57')]?_0x3dc833[_0xba1a('0x57')]:_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x57')],'substatus':null,'substatusAt':moment()[_0xba1a('0x58')](_0xba1a('0x59')),'lastMsgAt':moment()[_0xba1a('0x58')](_0xba1a('0x59')),'lastMsgDirection':'in','lastMsgBody':_0x2e3a3d[_0xba1a('0x2e')]['body']});}else{return _0x3dc833;}}})[_0xba1a('0x11')](function(_0x464939){_0x4521de[_0xba1a('0x5a')]=_0x464939[_0xba1a('0x5b')]({'plain':!![]});_0x4521de[_0xba1a('0x5a')]['created']=_0x4f07e9;return db['MailMessage']['create']({'body':_0x2e3a3d['body'][_0xba1a('0x2e')],'MailAccountId':_0x2e3a3d[_0xba1a('0x3f')]['id'],'MailInteractionId':_0x464939['id'],'direction':'in','ContactId':_0x4521de[_0xba1a('0x4e')]['id'],'messageId':_0x2e3a3d['body'][_0xba1a('0x18')][_0xba1a('0x4f')],'from':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')]['from'],'to':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')]['to'],'cc':_0x2e3a3d[_0xba1a('0x2e')]['message']['cc'],'subject':_0x2e3a3d['body'][_0xba1a('0x18')][_0xba1a('0x56')],'attach':_0x2e3a3d[_0xba1a('0x2e')]['message'][_0xba1a('0x57')],'Attachments':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x5c')],'originTo':_0x2e3a3d[_0xba1a('0x2e')]['message'][_0xba1a('0x5d')],'originCc':_0x2e3a3d[_0xba1a('0x2e')]['message']['originCc'],'bcc':_0x2e3a3d[_0xba1a('0x2e')][_0xba1a('0x18')][_0xba1a('0x5e')]},{'include':[{'model':db[_0xba1a('0x5f')],'as':_0xba1a('0x60')}]});})[_0xba1a('0x11')](function(_0x5dafd6){_0x4521de[_0xba1a('0x18')]=_0x5dafd6;if(_0x4521de['interaction'][_0xba1a('0x61')]){return db[_0xba1a('0x62')]['find']({'attributes':['id',_0xba1a('0x63')],'where':{'id':_0x4521de[_0xba1a('0x5a')][_0xba1a('0x61')]}})[_0xba1a('0x11')](function(_0x16a8f4){if(_0x16a8f4){_0x4521de[_0xba1a('0x42')][_0xba1a('0x64')]({'id':0x0,'priority':0x0,'app':_0xba1a('0x65'),'appdata':_0x16a8f4[_0xba1a('0x63')]+','+(_0x4521de[_0xba1a('0x3f')][_0xba1a('0x66')]||0xa),'interval':_0xba1a('0x4a')});}return respondWithRpcPromise(_0xba1a('0x67'),_0xba1a('0x68'),_0x4521de);});}return respondWithRpcPromise('Start',_0xba1a('0x68'),_0x4521de);})[_0xba1a('0x11')](function(_0x1321c6){_0x3a7f7e(_0x1321c6);})['catch'](function(_0xd76ee5){_0x29bb01(_0x411d79[_0xba1a('0x16')](0x1f4,_0xd76ee5[_0xba1a('0x18')]));});});};
\ No newline at end of file
index ec2e63a..4545cc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74c2=['remove','update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x4bb2b9,_0x459c78){var _0x40e2a2=function(_0x19a26c){while(--_0x19a26c){_0x4bb2b9['push'](_0x4bb2b9['shift']());}};_0x40e2a2(++_0x459c78);}(_0x74c2,0x1e4));var _0x274c=function(_0x17d6a2,_0xa09537){_0x17d6a2=_0x17d6a2-0x0;var _0x2103b0=_0x74c2[_0x17d6a2];return _0x2103b0;};'use strict';var MailAccountEvents=require(_0x274c('0x0'));var events=[_0x274c('0x1'),_0x274c('0x2'),_0x274c('0x3')];function createListener(_0x14da1f,_0x768676){return function(_0x5ab461){_0x768676[_0x274c('0x4')](_0x14da1f,_0x5ab461);};}function removeListener(_0x428d58,_0x4ab0b9){return function(){MailAccountEvents[_0x274c('0x5')](_0x428d58,_0x4ab0b9);};}exports[_0x274c('0x6')]=function(_0x317ff4){for(var _0xb087e9=0x0,_0x74bb29=events[_0x274c('0x7')];_0xb087e9<_0x74bb29;_0xb087e9++){var _0xb2ac07=events[_0xb087e9];var _0x581e4c=createListener(_0x274c('0x8')+_0xb2ac07,_0x317ff4);MailAccountEvents['on'](_0xb2ac07,_0x581e4c);}};
\ No newline at end of file
+var _0x14c1=['emit','register','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x39feb6,_0x330769){var _0x321173=function(_0x3e7a3b){while(--_0x3e7a3b){_0x39feb6['push'](_0x39feb6['shift']());}};_0x321173(++_0x330769);}(_0x14c1,0x88));var _0x114c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x14c1[_0x321bb2];return _0x9c12ed;};'use strict';var MailAccountEvents=require(_0x114c('0x0'));var events=[_0x114c('0x1'),_0x114c('0x2'),_0x114c('0x3')];function createListener(_0x21dd21,_0x3a5d7d){return function(_0xe0c5bb){_0x3a5d7d[_0x114c('0x4')](_0x21dd21,_0xe0c5bb);};}function removeListener(_0x5e5745,_0x12ecdd){return function(){MailAccountEvents['removeListener'](_0x5e5745,_0x12ecdd);};}exports[_0x114c('0x5')]=function(_0xa26c33){for(var _0x96dbfa=0x0,_0x5ba856=events['length'];_0x96dbfa<_0x5ba856;_0x96dbfa++){var _0xaccba4=events[_0x96dbfa];var _0x96086b=createListener(_0x114c('0x6')+_0xaccba4,_0xa26c33);MailAccountEvents['on'](_0xaccba4,_0x96086b);}};
\ No newline at end of file
index ac1553c..00add60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x984b=['./mailApplication.controller','isAuthenticated','show','/:id','delete','destroy','exports','connect-timeout','express','Router','../../config/environment'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0x984b,0xee));var _0xb984=function(_0x143638,_0x1da3ff){_0x143638=_0x143638-0x0;var _0x341af5=_0x984b[_0x143638];return _0x341af5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb984('0x0'));var express=require(_0xb984('0x1'));var router=express[_0xb984('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb984('0x3'));var controller=require(_0xb984('0x4'));router['get']('/:id',auth[_0xb984('0x5')](),controller[_0xb984('0x6')]);router['put'](_0xb984('0x7'),auth[_0xb984('0x5')](),controller['update']);router[_0xb984('0x8')]('/:id',auth[_0xb984('0x5')](),controller[_0xb984('0x9')]);module[_0xb984('0xa')]=router;
\ No newline at end of file
+var _0xe600=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update','destroy','exports'];(function(_0x413353,_0xc0098b){var _0x31e422=function(_0x4c1f8c){while(--_0x4c1f8c){_0x413353['push'](_0x413353['shift']());}};_0x31e422(++_0xc0098b);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x0e60('0x0'));var path=require('path');var timeout=require(_0x0e60('0x1'));var express=require(_0x0e60('0x2'));var router=express[_0x0e60('0x3')]();var auth=require(_0x0e60('0x4'));var interaction=require(_0x0e60('0x5'));var config=require(_0x0e60('0x6'));var controller=require(_0x0e60('0x7'));router[_0x0e60('0x8')](_0x0e60('0x9'),auth[_0x0e60('0xa')](),controller['show']);router[_0x0e60('0xb')](_0x0e60('0x9'),auth[_0x0e60('0xa')](),controller[_0x0e60('0xc')]);router['delete'](_0x0e60('0x9'),auth[_0x0e60('0xa')](),controller[_0x0e60('0xd')]);module[_0x0e60('0xe')]=router;
\ No newline at end of file
index 40d08ac..cf257c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['noop','sequelize','exports','INTEGER','STRING'];(function(_0x24c137,_0x123891){var _0x4d1c12=function(_0xe75c69){while(--_0xe75c69){_0x24c137['push'](_0x24c137['shift']());}};_0x4d1c12(++_0x123891);}(_0x4975,0xc9));var _0x5497=function(_0x25a610,_0x2e5ef6){_0x25a610=_0x25a610-0x0;var _0x235dbe=_0x4975[_0x25a610];return _0x235dbe;};'use strict';var Sequelize=require(_0x5497('0x0'));module[_0x5497('0x1')]={'priority':{'type':Sequelize[_0x5497('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0x4')},'appdata':{'type':Sequelize[_0x5497('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x5497('0x3')]},'interval':{'type':Sequelize[_0x5497('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xeba8=['sequelize','exports','INTEGER','STRING','noop'];(function(_0x2b0874,_0xd88626){var _0x313095=function(_0xa9e1c0){while(--_0xa9e1c0){_0x2b0874['push'](_0x2b0874['shift']());}};_0x313095(++_0xd88626);}(_0xeba8,0x87));var _0x8eba=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0xeba8[_0x42bb6d];return _0x1db89b;};'use strict';var Sequelize=require(_0x8eba('0x0'));module[_0x8eba('0x1')]={'priority':{'type':Sequelize[_0x8eba('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8eba('0x3')],'allowNull':![],'defaultValue':_0x8eba('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8eba('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 68426a4..1a31a29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe94a=['squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','apply','reject','save','then','destroy','name','show','rawAttributes','keys','filters','intersection','model','fields','query','attributes','include','merge','options','MailApplication','catch','update','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash'];(function(_0xa2fc86,_0x28fa6e){var _0x4578ec=function(_0x3535ff){while(--_0x3535ff){_0xa2fc86['push'](_0xa2fc86['shift']());}};_0x4578ec(++_0x28fa6e);}(_0xe94a,0x1c7));var _0xae94=function(_0x489c95,_0x53159c){_0x489c95=_0x489c95-0x0;var _0x10e7a7=_0xe94a[_0x489c95];return _0x10e7a7;};'use strict';var pdf=require(_0xae94('0x0'));var emlformat=require(_0xae94('0x1'));var rimraf=require(_0xae94('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae94('0x3'));var rp=require(_0xae94('0x4'));var moment=require(_0xae94('0x5'));var BPromise=require(_0xae94('0x6'));var Mustache=require(_0xae94('0x7'));var util=require(_0xae94('0x8'));var path=require('path');var sox=require(_0xae94('0x9'));var csv=require(_0xae94('0xa'));var ejs=require(_0xae94('0xb'));var fs=require('fs');var _=require(_0xae94('0xc'));var squel=require(_0xae94('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xae94('0xe'));var toCsv=require(_0xae94('0xa'));var querystring=require('querystring');var Papa=require(_0xae94('0xf'));var Redis=require(_0xae94('0x10'));var qs=require(_0xae94('0x11'));var logger=require(_0xae94('0x12'))(_0xae94('0x13'));var utils=require(_0xae94('0x14'));var config=require(_0xae94('0x15'));var db=require(_0xae94('0x16'))['db'];function respondWithStatusCode(_0x4cb724,_0x59a9ba){_0x59a9ba=_0x59a9ba||0xcc;return function(_0x8430b){if(_0x8430b){return _0x4cb724[_0xae94('0x17')](_0x59a9ba);}return _0x4cb724['status'](_0x59a9ba)[_0xae94('0x18')]();};}function respondWithResult(_0x488159,_0x506e6d){_0x506e6d=_0x506e6d||0xc8;return function(_0x295017){if(_0x295017){return _0x488159[_0xae94('0x19')](_0x506e6d)[_0xae94('0x1a')](_0x295017);}};}function respondWithFilteredResult(_0x223e35,_0x48bf46){return function(_0x444a92){if(_0x444a92){var _0x92a18=_0x444a92['count'],_0x17589d=_0x48bf46[_0xae94('0x1b')],_0x56a922=_0x48bf46['offset']+_0x48bf46[_0xae94('0x1c')],_0x274fb3;if(_0x56a922>=_0x92a18){_0x56a922=_0x92a18;_0x274fb3=0xc8;}else{_0x274fb3=0xce;}_0x223e35[_0xae94('0x19')](_0x274fb3);return _0x223e35['set']('Content-Range',_0x17589d+'-'+_0x56a922+'/'+_0x92a18)[_0xae94('0x1a')](_0x444a92);}return null;};}function patchUpdates(_0x382b4a){return function(_0x296009){try{jsonpatch[_0xae94('0x1d')](_0x296009,_0x382b4a,!![]);}catch(_0x5d4379){return BPromise[_0xae94('0x1e')](_0x5d4379);}return _0x296009[_0xae94('0x1f')]();};}function saveUpdates(_0x5a0cdd,_0x2e2745){return function(_0x1b3e4){if(_0x1b3e4){return _0x1b3e4['update'](_0x5a0cdd)[_0xae94('0x20')](function(_0xb9b721){return _0xb9b721;});}return null;};}function removeEntity(_0x432f26,_0xb42887){return function(_0x4267f5){if(_0x4267f5){return _0x4267f5[_0xae94('0x21')]()[_0xae94('0x20')](function(){_0x432f26[_0xae94('0x19')](0xcc)[_0xae94('0x18')]();});}};}function handleEntityNotFound(_0x5e42ec,_0xea0193){return function(_0x123dd6){if(!_0x123dd6){_0x5e42ec['sendStatus'](0x194);}return _0x123dd6;};}function handleError(_0x111bd8,_0xea4b73){_0xea4b73=_0xea4b73||0x1f4;return function(_0x3990aa){logger['error'](_0x3990aa['stack']);if(_0x3990aa[_0xae94('0x22')]){delete _0x3990aa[_0xae94('0x22')];}_0x111bd8[_0xae94('0x19')](_0xea4b73)['send'](_0x3990aa);};}exports[_0xae94('0x23')]=function(_0xc51ace,_0x3ea78a){var _0xf67ced={'raw':!![],'where':{'id':_0xc51ace['params']['id']}},_0x5e6932={};_0x5e6932['model']=_['keys'](db['MailApplication'][_0xae94('0x24')]);_0x5e6932['query']=_[_0xae94('0x25')](_0xc51ace['query']);_0x5e6932[_0xae94('0x26')]=_[_0xae94('0x27')](_0x5e6932[_0xae94('0x28')],_0x5e6932['query']);_0xf67ced['attributes']=_[_0xae94('0x27')](_0x5e6932[_0xae94('0x28')],qs[_0xae94('0x29')](_0xc51ace[_0xae94('0x2a')][_0xae94('0x29')]));_0xf67ced[_0xae94('0x2b')]=_0xf67ced[_0xae94('0x2b')]['length']?_0xf67ced[_0xae94('0x2b')]:_0x5e6932['model'];if(_0xc51ace['query']['includeAll']){_0xf67ced[_0xae94('0x2c')]=[{'all':!![]}];}_0xf67ced=_[_0xae94('0x2d')]({},_0xf67ced,_0xc51ace[_0xae94('0x2e')]);return db[_0xae94('0x2f')]['find'](_0xf67ced)['then'](handleEntityNotFound(_0x3ea78a,null))[_0xae94('0x20')](respondWithResult(_0x3ea78a,null))[_0xae94('0x30')](handleError(_0x3ea78a,null));};exports[_0xae94('0x31')]=function(_0x9f5067,_0x5381ef){if(_0x9f5067['body']['id']){delete _0x9f5067[_0xae94('0x32')]['id'];}return db[_0xae94('0x2f')]['find']({'where':{'id':_0x9f5067[_0xae94('0x33')]['id']}})[_0xae94('0x20')](handleEntityNotFound(_0x5381ef,null))[_0xae94('0x20')](saveUpdates(_0x9f5067[_0xae94('0x32')],null))[_0xae94('0x20')](respondWithResult(_0x5381ef,null))[_0xae94('0x30')](handleError(_0x5381ef,null));};exports[_0xae94('0x21')]=function(_0x587caa,_0x3d8e08){return db[_0xae94('0x2f')]['find']({'where':{'id':_0x587caa[_0xae94('0x33')]['id']}})[_0xae94('0x20')](handleEntityNotFound(_0x3d8e08,null))[_0xae94('0x20')](removeEntity(_0x3d8e08,null))[_0xae94('0x30')](handleError(_0x3d8e08,null));};
\ No newline at end of file
+var _0x40b5=['offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','params','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','model','fields','length','includeAll','include','merge','options','catch','update','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','end','json','count'];(function(_0xeb018d,_0x290131){var _0xd1ac55=function(_0x5b9c03){while(--_0x5b9c03){_0xeb018d['push'](_0xeb018d['shift']());}};_0xd1ac55(++_0x290131);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x540b('0x0'));var emlformat=require(_0x540b('0x1'));var rimraf=require(_0x540b('0x2'));var zipdir=require(_0x540b('0x3'));var jsonpatch=require(_0x540b('0x4'));var rp=require(_0x540b('0x5'));var moment=require(_0x540b('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x540b('0x7'));var util=require(_0x540b('0x8'));var path=require(_0x540b('0x9'));var sox=require(_0x540b('0xa'));var csv=require(_0x540b('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x540b('0xc'));var squel=require(_0x540b('0xd'));var crypto=require(_0x540b('0xe'));var jsforce=require(_0x540b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x540b('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0x540b('0x10'));var logger=require('../../config/logger')(_0x540b('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x540b('0x12'))['db'];function respondWithStatusCode(_0x79866b,_0x598bce){_0x598bce=_0x598bce||0xcc;return function(_0x3306a1){if(_0x3306a1){return _0x79866b[_0x540b('0x13')](_0x598bce);}return _0x79866b[_0x540b('0x14')](_0x598bce)[_0x540b('0x15')]();};}function respondWithResult(_0x5f4237,_0xdf0923){_0xdf0923=_0xdf0923||0xc8;return function(_0x42e9d6){if(_0x42e9d6){return _0x5f4237[_0x540b('0x14')](_0xdf0923)[_0x540b('0x16')](_0x42e9d6);}};}function respondWithFilteredResult(_0x498616,_0x18e0f7){return function(_0x4a5098){if(_0x4a5098){var _0x5a7d4c=_0x4a5098[_0x540b('0x17')],_0x2ab462=_0x18e0f7[_0x540b('0x18')],_0x1c9743=_0x18e0f7['offset']+_0x18e0f7[_0x540b('0x19')],_0xbff023;if(_0x1c9743>=_0x5a7d4c){_0x1c9743=_0x5a7d4c;_0xbff023=0xc8;}else{_0xbff023=0xce;}_0x498616[_0x540b('0x14')](_0xbff023);return _0x498616[_0x540b('0x1a')](_0x540b('0x1b'),_0x2ab462+'-'+_0x1c9743+'/'+_0x5a7d4c)[_0x540b('0x16')](_0x4a5098);}return null;};}function patchUpdates(_0xd61e60){return function(_0x2a3265){try{jsonpatch[_0x540b('0x1c')](_0x2a3265,_0xd61e60,!![]);}catch(_0x3d5b62){return BPromise['reject'](_0x3d5b62);}return _0x2a3265[_0x540b('0x1d')]();};}function saveUpdates(_0x471429,_0x5900ed){return function(_0x135cd7){if(_0x135cd7){return _0x135cd7['update'](_0x471429)[_0x540b('0x1e')](function(_0x5e49d7){return _0x5e49d7;});}return null;};}function removeEntity(_0x4a37f9,_0x17674c){return function(_0x47dd84){if(_0x47dd84){return _0x47dd84[_0x540b('0x1f')]()[_0x540b('0x1e')](function(){_0x4a37f9[_0x540b('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445462,_0x1d140f){return function(_0x1378c2){if(!_0x1378c2){_0x445462[_0x540b('0x13')](0x194);}return _0x1378c2;};}function handleError(_0x24f49b,_0x310930){_0x310930=_0x310930||0x1f4;return function(_0x3acfef){logger[_0x540b('0x20')](_0x3acfef[_0x540b('0x21')]);if(_0x3acfef[_0x540b('0x22')]){delete _0x3acfef['name'];}_0x24f49b[_0x540b('0x14')](_0x310930)[_0x540b('0x23')](_0x3acfef);};}exports['show']=function(_0x4f8c0c,_0x327a01){var _0x3d6b0c={'raw':!![],'where':{'id':_0x4f8c0c[_0x540b('0x24')]['id']}},_0x3f4fe0={};_0x3f4fe0['model']=_[_0x540b('0x25')](db[_0x540b('0x26')][_0x540b('0x27')]);_0x3f4fe0[_0x540b('0x28')]=_[_0x540b('0x25')](_0x4f8c0c[_0x540b('0x28')]);_0x3f4fe0[_0x540b('0x29')]=_['intersection'](_0x3f4fe0['model'],_0x3f4fe0['query']);_0x3d6b0c[_0x540b('0x2a')]=_[_0x540b('0x2b')](_0x3f4fe0[_0x540b('0x2c')],qs['fields'](_0x4f8c0c['query'][_0x540b('0x2d')]));_0x3d6b0c[_0x540b('0x2a')]=_0x3d6b0c['attributes'][_0x540b('0x2e')]?_0x3d6b0c[_0x540b('0x2a')]:_0x3f4fe0[_0x540b('0x2c')];if(_0x4f8c0c[_0x540b('0x28')][_0x540b('0x2f')]){_0x3d6b0c[_0x540b('0x30')]=[{'all':!![]}];}_0x3d6b0c=_[_0x540b('0x31')]({},_0x3d6b0c,_0x4f8c0c[_0x540b('0x32')]);return db[_0x540b('0x26')]['find'](_0x3d6b0c)[_0x540b('0x1e')](handleEntityNotFound(_0x327a01,null))['then'](respondWithResult(_0x327a01,null))[_0x540b('0x33')](handleError(_0x327a01,null));};exports[_0x540b('0x34')]=function(_0x1f1263,_0x14bada){if(_0x1f1263[_0x540b('0x35')]['id']){delete _0x1f1263[_0x540b('0x35')]['id'];}return db[_0x540b('0x26')][_0x540b('0x36')]({'where':{'id':_0x1f1263[_0x540b('0x24')]['id']}})[_0x540b('0x1e')](handleEntityNotFound(_0x14bada,null))['then'](saveUpdates(_0x1f1263[_0x540b('0x35')],null))['then'](respondWithResult(_0x14bada,null))[_0x540b('0x33')](handleError(_0x14bada,null));};exports['destroy']=function(_0x4aab39,_0x49955e){return db[_0x540b('0x26')]['find']({'where':{'id':_0x4aab39[_0x540b('0x24')]['id']}})[_0x540b('0x1e')](handleEntityNotFound(_0x49955e,null))['then'](removeEntity(_0x49955e,null))['catch'](handleError(_0x49955e,null));};
\ No newline at end of file
index 7037f3d..4578f2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1463=['./mailApplication.attributes','exports','MailApplication','mail_applications','util','api','moment','bluebird','request-promise'];(function(_0x1dc93c,_0x2411a3){var _0x54699e=function(_0x6e1a76){while(--_0x6e1a76){_0x1dc93c['push'](_0x1dc93c['shift']());}};_0x54699e(++_0x2411a3);}(_0x1463,0x163));var _0x3146=function(_0x1fe07f,_0x45de29){_0x1fe07f=_0x1fe07f-0x0;var _0x58070c=_0x1463[_0x1fe07f];return _0x58070c;};'use strict';var _=require('lodash');var util=require(_0x3146('0x0'));var logger=require('../../config/logger')(_0x3146('0x1'));var moment=require(_0x3146('0x2'));var BPromise=require(_0x3146('0x3'));var rp=require(_0x3146('0x4'));var attributes=require(_0x3146('0x5'));module[_0x3146('0x6')]=function(_0x23d980,_0x15518b){return _0x23d980['define'](_0x3146('0x7'),attributes,{'tableName':_0x3146('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x461f=['request-promise','./mailApplication.attributes','exports','define','mail_applications','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1887d8,_0x3cce4f){var _0x4c31f4=function(_0x5d3c85){while(--_0x5d3c85){_0x1887d8['push'](_0x1887d8['shift']());}};_0x4c31f4(++_0x3cce4f);}(_0x461f,0x144));var _0xf461=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x461f[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xf461('0x0'));var util=require(_0xf461('0x1'));var logger=require(_0xf461('0x2'))(_0xf461('0x3'));var moment=require(_0xf461('0x4'));var BPromise=require(_0xf461('0x5'));var rp=require(_0xf461('0x6'));var attributes=require(_0xf461('0x7'));module[_0xf461('0x8')]=function(_0x384433,_0x5ddf50){return _0x384433[_0xf461('0x9')]('MailApplication',attributes,{'tableName':_0xf461('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d3251c1..58a9d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3055b4,_0x40b87a){var _0x273b9c=function(_0x69af09){while(--_0x69af09){_0x3055b4['push'](_0x3055b4['shift']());}};_0x273b9c(++_0x40b87a);}(_0x7a54,0x106));var _0x47a5=function(_0x4e69a9,_0x450c7c){_0x4e69a9=_0x4e69a9-0x0;var _0x59e34a=_0x7a54[_0x4e69a9];return _0x59e34a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});};
\ No newline at end of file
+var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x8fba13,_0xd04f28){var _0x2ef1d5=function(_0x5ea73b){while(--_0x5ea73b){_0x8fba13['push'](_0x8fba13['shift']());}};_0x2ef1d5(++_0xd04f28);}(_0x7a54,0x106));var _0x47a5=function(_0x1514e5,_0x69d759){_0x1514e5=_0x1514e5-0x0;var _0x4f511e=_0x7a54[_0x1514e5];return _0x4f511e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});};
\ No newline at end of file
index b29d7e4..6a786cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fe8=['describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','/:id','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get'];(function(_0x1a45c2,_0x4d0a47){var _0x571691=function(_0x43be22){while(--_0x43be22){_0x1a45c2['push'](_0x1a45c2['shift']());}};_0x571691(++_0x4d0a47);}(_0x0fe8,0x89));var _0x80fe=function(_0x1a87c2,_0x47c3cb){_0x1a87c2=_0x1a87c2-0x0;var _0x51d0d9=_0x0fe8[_0x1a87c2];return _0x51d0d9;};'use strict';var multer=require(_0x80fe('0x0'));var util=require(_0x80fe('0x1'));var path=require(_0x80fe('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x80fe('0x3')]();var auth=require(_0x80fe('0x4'));var interaction=require(_0x80fe('0x5'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x80fe('0x6')](),controller['index']);router[_0x80fe('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x80fe('0x8')]);router[_0x80fe('0x7')]('/:id',auth[_0x80fe('0x6')](),controller[_0x80fe('0x9')]);router[_0x80fe('0x7')](_0x80fe('0xa'),auth[_0x80fe('0x6')](),controller[_0x80fe('0xb')]);router[_0x80fe('0x7')]('/:id/download',auth[_0x80fe('0x6')](),controller['download']);router[_0x80fe('0xc')]('/',auth[_0x80fe('0x6')](),controller[_0x80fe('0xd')]);router[_0x80fe('0xc')]('/:id/messages',auth['isAuthenticated'](),controller[_0x80fe('0xe')]);router[_0x80fe('0xc')](_0x80fe('0xf'),auth[_0x80fe('0x6')](),interaction['tracked'](_0x80fe('0x10'),_0x80fe('0x11')),controller[_0x80fe('0x12')]);router[_0x80fe('0x13')](_0x80fe('0x14'),auth['isAuthenticated'](),interaction[_0x80fe('0x15')](_0x80fe('0x10'),_0x80fe('0x16')),controller[_0x80fe('0x17')]);router[_0x80fe('0x18')](_0x80fe('0x14'),auth[_0x80fe('0x6')](),interaction['tracked'](_0x80fe('0x10'),_0x80fe('0x19')),controller[_0x80fe('0x1a')]);router[_0x80fe('0x18')](_0x80fe('0xf'),auth[_0x80fe('0x6')](),controller[_0x80fe('0x1b')]);module[_0x80fe('0x1c')]=router;
\ No newline at end of file
+var _0x9bca=['/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','mail','put','/:id','mailinteraction:update','delete','mailinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','show'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x9bca,0x8c));var _0xa9bc=function(_0x5a2f8a,_0x1921f5){_0x5a2f8a=_0x5a2f8a-0x0;var _0x398eea=_0x9bca[_0x5a2f8a];return _0x398eea;};'use strict';var multer=require(_0xa9bc('0x0'));var util=require(_0xa9bc('0x1'));var path=require(_0xa9bc('0x2'));var timeout=require(_0xa9bc('0x3'));var express=require(_0xa9bc('0x4'));var router=express[_0xa9bc('0x5')]();var auth=require(_0xa9bc('0x6'));var interaction=require(_0xa9bc('0x7'));var config=require(_0xa9bc('0x8'));var controller=require(_0xa9bc('0x9'));router[_0xa9bc('0xa')]('/',auth[_0xa9bc('0xb')](),controller[_0xa9bc('0xc')]);router['get'](_0xa9bc('0xd'),auth[_0xa9bc('0xb')](),controller['describe']);router[_0xa9bc('0xa')]('/:id',auth[_0xa9bc('0xb')](),controller[_0xa9bc('0xe')]);router[_0xa9bc('0xa')]('/:id/messages',auth[_0xa9bc('0xb')](),controller['getMessages']);router['get'](_0xa9bc('0xf'),auth[_0xa9bc('0xb')](),controller[_0xa9bc('0x10')]);router[_0xa9bc('0x11')]('/',auth[_0xa9bc('0xb')](),controller[_0xa9bc('0x12')]);router[_0xa9bc('0x11')](_0xa9bc('0x13'),auth['isAuthenticated'](),controller[_0xa9bc('0x14')]);router[_0xa9bc('0x11')](_0xa9bc('0x15'),auth['isAuthenticated'](),interaction[_0xa9bc('0x16')](_0xa9bc('0x17'),'mailinteraction:addtags'),controller['addTags']);router[_0xa9bc('0x18')](_0xa9bc('0x19'),auth[_0xa9bc('0xb')](),interaction[_0xa9bc('0x16')](_0xa9bc('0x17'),_0xa9bc('0x1a')),controller['update']);router[_0xa9bc('0x1b')](_0xa9bc('0x19'),auth[_0xa9bc('0xb')](),interaction[_0xa9bc('0x16')]('mail',_0xa9bc('0x1c')),controller[_0xa9bc('0x1d')]);router['delete'](_0xa9bc('0x15'),auth[_0xa9bc('0xb')](),controller['removeTags']);module[_0xa9bc('0x1e')]=router;
\ No newline at end of file
index 89d1f0a..162f719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd131=['slice','join','sequelize','html-to-text','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','ENUM','out','getDataValue','fromString','split'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd131,0xbd));var _0x1d13=function(_0x4ddb06,_0x394cc8){_0x4ddb06=_0x4ddb06-0x0;var _0x1b610a=_0xd131[_0x4ddb06];return _0x1b610a;};'use strict';var Sequelize=require(_0x1d13('0x0'));var htmlToText=require(_0x1d13('0x1'));var iconv=require(_0x1d13('0x2'));module[_0x1d13('0x3')]={'closed':{'type':Sequelize[_0x1d13('0x4')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1d13('0x5')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1d13('0x6')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x1d13('0x6')]},'cc':{'type':Sequelize[_0x1d13('0x7')](_0x1d13('0x8'))},'subject':{'type':Sequelize[_0x1d13('0x7')]('')+_0x1d13('0x9')},'attach':{'type':Sequelize[_0x1d13('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1d13('0x5')]},'substatus':{'type':Sequelize[_0x1d13('0x6')](0x3c)},'substatusAt':{'type':Sequelize[_0x1d13('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x1d13('0xa')]('in',_0x1d13('0xb')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1d13('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x1d13('0xa')]('in',_0x1d13('0xb')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x1d13('0x7')]('long')+_0x1d13('0x9'),'get':function(){try{return this[_0x1d13('0xc')]('lastMsgBody')?htmlToText[_0x1d13('0xd')](this[_0x1d13('0xc')]('lastMsgBody'),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0x1d13('0xe')]('\x0a')[_0x1d13('0xf')](0x0,0x6)[_0x1d13('0x10')]('\x0a'):null;}catch(_0x484795){return null;}}}};
\ No newline at end of file
+var _0xb16a=['out','getDataValue','lastMsgBody','fromString','split','join','sequelize','html-to-text','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','ENUM'];(function(_0x408c39,_0x19b396){var _0x4403b7=function(_0xa87b89){while(--_0xa87b89){_0x408c39['push'](_0x408c39['shift']());}};_0x4403b7(++_0x19b396);}(_0xb16a,0x1e2));var _0xab16=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb16a[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xab16('0x0'));var htmlToText=require(_0xab16('0x1'));var iconv=require(_0xab16('0x2'));module[_0xab16('0x3')]={'closed':{'type':Sequelize[_0xab16('0x4')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xab16('0x5')]},'disposition':{'type':Sequelize[_0xab16('0x6')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xab16('0x6')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xab16('0x7')](_0xab16('0x8'))},'subject':{'type':Sequelize[_0xab16('0x7')]('')+_0xab16('0x9')},'attach':{'type':Sequelize[_0xab16('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xab16('0x6')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xab16('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xab16('0xa')]('in',_0xab16('0xb')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0xab16('0x8'))+_0xab16('0x9'),'get':function(){try{return this[_0xab16('0xc')](_0xab16('0xd'))?htmlToText[_0xab16('0xe')](this['getDataValue'](_0xab16('0xd')),{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'ignoreImage':!![]})[_0xab16('0xf')]('\x0a')['slice'](0x0,0x6)[_0xab16('0x10')]('\x0a'):null;}catch(_0x19448d){return null;}}}};
\ No newline at end of file
index 06d44df..4fc1afd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03cd=['includeAll','User','Users','fullname','CmContact','Contact','Owner','internal','Account','email','color','Tag','ThroughTags','rows','show','params','options','find','catch','create','body','destroy','describe','addMessage','ids','getMessages','findOne','MailInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','files','attachments','server','tmp','interaction-%s.zip','from','subject','Attachment','Attachments','mkdirSync','each','basename','existsSync','build','writeFileSync','message%d.eml','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','json','count','offset','status','Content-Range','reject','save','update','then','error','stack','name','send','MailInteraction','rawAttributes','query','dateStart','dateEnd','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','add','day','merge','map','type','key','filter','tag','push','distinct','read','include','MailMessage','Messages','direction','createdAt'];(function(_0x3dc55d,_0xd07e93){var _0x3aa7f3=function(_0x506b46){while(--_0x506b46){_0x3dc55d['push'](_0x3dc55d['shift']());}};_0x3aa7f3(++_0xd07e93);}(_0x03cd,0x1e8));var _0xd03c=function(_0x12fbd7,_0x271c13){_0x12fbd7=_0x12fbd7-0x0;var _0x381f9e=_0x03cd[_0x12fbd7];return _0x381f9e;};'use strict';var pdf=require(_0xd03c('0x0'));var emlformat=require(_0xd03c('0x1'));var rimraf=require(_0xd03c('0x2'));var zipdir=require(_0xd03c('0x3'));var jsonpatch=require(_0xd03c('0x4'));var rp=require(_0xd03c('0x5'));var moment=require(_0xd03c('0x6'));var BPromise=require(_0xd03c('0x7'));var Mustache=require(_0xd03c('0x8'));var util=require('util');var path=require(_0xd03c('0x9'));var sox=require(_0xd03c('0xa'));var csv=require(_0xd03c('0xb'));var ejs=require(_0xd03c('0xc'));var fs=require('fs');var _=require(_0xd03c('0xd'));var squel=require(_0xd03c('0xe'));var crypto=require(_0xd03c('0xf'));var jsforce=require(_0xd03c('0x10'));var deskjs=require(_0xd03c('0x11'));var toCsv=require(_0xd03c('0xb'));var querystring=require(_0xd03c('0x12'));var Papa=require(_0xd03c('0x13'));var Redis=require('ioredis');var qs=require(_0xd03c('0x14'));var logger=require(_0xd03c('0x15'))(_0xd03c('0x16'));var utils=require('../../config/utils');var config=require(_0xd03c('0x17'));var db=require(_0xd03c('0x18'))['db'];config['redis']=_[_0xd03c('0x19')](config[_0xd03c('0x1a')],{'host':_0xd03c('0x1b'),'port':0x18eb});var socket=require(_0xd03c('0x1c'))(new Redis(config[_0xd03c('0x1a')]));require(_0xd03c('0x1d'))['register'](socket);function respondWithStatusCode(_0xa6b9e9,_0x2cf1be){_0x2cf1be=_0x2cf1be||0xcc;return function(_0x13050e){if(_0x13050e){return _0xa6b9e9[_0xd03c('0x1e')](_0x2cf1be);}return _0xa6b9e9['status'](_0x2cf1be)[_0xd03c('0x1f')]();};}function respondWithResult(_0x177ce8,_0x1f2191){_0x1f2191=_0x1f2191||0xc8;return function(_0x1c2934){if(_0x1c2934){return _0x177ce8['status'](_0x1f2191)[_0xd03c('0x20')](_0x1c2934);}};}function respondWithFilteredResult(_0xd08195,_0x56e8af){return function(_0x534c68){if(_0x534c68){var _0x12f65d=_0x534c68[_0xd03c('0x21')],_0x42edcf=_0x56e8af[_0xd03c('0x22')],_0x4d2f14=_0x56e8af[_0xd03c('0x22')]+_0x56e8af['limit'],_0x198be9;if(_0x4d2f14>=_0x12f65d){_0x4d2f14=_0x12f65d;_0x198be9=0xc8;}else{_0x198be9=0xce;}_0xd08195[_0xd03c('0x23')](_0x198be9);return _0xd08195['set'](_0xd03c('0x24'),_0x42edcf+'-'+_0x4d2f14+'/'+_0x12f65d)[_0xd03c('0x20')](_0x534c68);}return null;};}function patchUpdates(_0x5c5b29){return function(_0x985416){try{jsonpatch['apply'](_0x985416,_0x5c5b29,!![]);}catch(_0xc1c3bd){return BPromise[_0xd03c('0x25')](_0xc1c3bd);}return _0x985416[_0xd03c('0x26')]();};}function saveUpdates(_0xc6baed,_0x2faf40){return function(_0x442ab8){if(_0x442ab8){return _0x442ab8[_0xd03c('0x27')](_0xc6baed)[_0xd03c('0x28')](function(_0x260319){return _0x260319;});}return null;};}function removeEntity(_0x3abd75,_0x1cb9e8){return function(_0x57c815){if(_0x57c815){return _0x57c815['destroy']()[_0xd03c('0x28')](function(){_0x3abd75[_0xd03c('0x23')](0xcc)[_0xd03c('0x1f')]();});}};}function handleEntityNotFound(_0x133c26,_0x234adc){return function(_0xe0c6af){if(!_0xe0c6af){_0x133c26[_0xd03c('0x1e')](0x194);}return _0xe0c6af;};}function handleError(_0x23862,_0x53ddc7){_0x53ddc7=_0x53ddc7||0x1f4;return function(_0x394d33){logger[_0xd03c('0x29')](_0x394d33[_0xd03c('0x2a')]);if(_0x394d33[_0xd03c('0x2b')]){delete _0x394d33[_0xd03c('0x2b')];}_0x23862[_0xd03c('0x23')](_0x53ddc7)[_0xd03c('0x2c')](_0x394d33);};}exports['index']=function(_0x3b75b0,_0x5eca8e){var _0x153481={},_0x74e671={},_0x13db0c={'count':0x0,'rows':[]};var _0x20ea86=db[_0xd03c('0x2d')][_0xd03c('0x2e')];_0x74e671['model']=_['keys'](_0x20ea86);var _0x3db994={'dateStart':_0x3b75b0[_0xd03c('0x2f')]['dateStart'],'dateEnd':_0x3b75b0[_0xd03c('0x2f')]['dateEnd']};delete _0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x30')];delete _0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x31')];_0x74e671[_0xd03c('0x2f')]=_[_0xd03c('0x32')](_0x3b75b0['query']);_0x74e671['filters']=_[_0xd03c('0x33')](_0x74e671['model'],_0x74e671[_0xd03c('0x2f')]);_0x153481['attributes']=_[_0xd03c('0x33')](_0x74e671[_0xd03c('0x34')],qs[_0xd03c('0x35')](_0x3b75b0['query']['fields']));_0x153481[_0xd03c('0x36')]=_0x153481['attributes'][_0xd03c('0x37')]?_0x153481['attributes']:_0x74e671['model'];if(!_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x38')](_0xd03c('0x39'))){_0x153481['limit']=qs[_0xd03c('0x3a')](_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x3a')]);_0x153481['offset']=qs[_0xd03c('0x22')](_0x3b75b0['query']['offset']);}_0x153481[_0xd03c('0x3b')]=qs['sort'](_0x3b75b0['query'][_0xd03c('0x3c')]);_0x153481[_0xd03c('0x3d')]=qs[_0xd03c('0x3e')](_[_0xd03c('0x3f')](_0x3b75b0[_0xd03c('0x2f')],_0x74e671[_0xd03c('0x3e')]));if(_0x3db994[_0xd03c('0x30')]){if(_0x3db994[_0xd03c('0x31')]){_0x3db994[_0xd03c('0x31')]=moment(_0x3db994[_0xd03c('0x31')])[_0xd03c('0x40')](0x1,_0xd03c('0x41'));}else{_0x3db994[_0xd03c('0x31')]=moment(_0x3db994[_0xd03c('0x30')])[_0xd03c('0x40')](0x1,'day');}_[_0xd03c('0x42')](_0x153481[_0xd03c('0x3d')],{'createdAt':{'$gte':_0x3db994[_0xd03c('0x30')],'$lte':_0x3db994[_0xd03c('0x31')]}});}if(_0x3b75b0['query']['filter']){_0x153481[_0xd03c('0x3d')]=_['merge'](_0x153481['where'],{'$or':_[_0xd03c('0x43')](_0x20ea86,function(_0x55e8b3){if(_0x55e8b3[_0xd03c('0x44')][_0xd03c('0x45')]!=='VIRTUAL'){var _0x6c7f2={};_0x6c7f2[_0x55e8b3['field']]={'$like':'%'+_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x46')]+'%'};return _0x6c7f2;}})});}_0x153481=_[_0xd03c('0x42')]({},_0x153481,_0x3b75b0['options']);var _0x339133={'where':_0x153481['where']};_0x339133['include']=[];if(_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x47')]){_0x339133['include'][_0xd03c('0x48')]({'model':db['Tag'],'as':'Tags','attributes':['id'],'where':{'id':_0x3b75b0[_0xd03c('0x2f')]['tag']},'required':!![]});_0x339133[_0xd03c('0x49')]=!![];}if(_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x4a')]){_0x339133[_0xd03c('0x4b')]['push']({'model':db[_0xd03c('0x4c')],'as':_0xd03c('0x4d'),'attributes':['id',_0xd03c('0x4e'),_0xd03c('0x4f'),_0xd03c('0x4a')],'where':{'direction':'in','read':_0x3b75b0['query'][_0xd03c('0x4a')]||![]},'required':!![]});_0x339133[_0xd03c('0x49')]=!![];}return db[_0xd03c('0x2d')]['count'](_0x339133)[_0xd03c('0x28')](function(_0x329ab5){_0x13db0c[_0xd03c('0x21')]=_0x329ab5;if(_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x50')]){_0x153481[_0xd03c('0x4b')]=[{'model':db[_0xd03c('0x51')],'as':_0xd03c('0x52'),'required':![],'attributes':['id',_0xd03c('0x2b'),_0xd03c('0x53')]},{'model':db[_0xd03c('0x54')],'as':_0xd03c('0x55'),'required':![]},{'model':db[_0xd03c('0x51')],'as':_0xd03c('0x56'),'attributes':[_0xd03c('0x2b'),_0xd03c('0x53'),_0xd03c('0x57')],'required':![]},{'model':db['MailAccount'],'as':_0xd03c('0x58'),'attributes':[_0xd03c('0x2b'),'key',_0xd03c('0x59')],'required':![]},{'model':db[_0xd03c('0x4c')],'as':_0xd03c('0x4d'),'attributes':['id',_0xd03c('0x4e'),_0xd03c('0x4f'),_0xd03c('0x4a')],'where':{'direction':'in','read':_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x4a')]||![]},'required':_0x3b75b0[_0xd03c('0x2f')]['read']||![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd03c('0x2b'),_0xd03c('0x5a')],'required':_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x47')]?!![]:![]},{'model':db[_0xd03c('0x5b')],'as':_0xd03c('0x5c'),'attributes':['id',_0xd03c('0x2b'),_0xd03c('0x5a')],'through':_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x47')]?{'attributes':[],'where':{'TagId':_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x47')]||undefined}}:{},'required':_0x3b75b0[_0xd03c('0x2f')][_0xd03c('0x47')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x153481);})[_0xd03c('0x28')](function(_0x3aa049){_0x13db0c[_0xd03c('0x5d')]=_0x3aa049;return _0x13db0c;})['then'](respondWithFilteredResult(_0x5eca8e,_0x153481))['catch'](handleError(_0x5eca8e,null));};exports[_0xd03c('0x5e')]=function(_0x58bc67,_0x578263){var _0x3360b5={'raw':![],'where':{'id':_0x58bc67[_0xd03c('0x5f')]['id']}},_0x406b8b={};_0x406b8b[_0xd03c('0x34')]=_[_0xd03c('0x32')](db[_0xd03c('0x2d')][_0xd03c('0x2e')]);_0x406b8b['query']=_['keys'](_0x58bc67[_0xd03c('0x2f')]);_0x406b8b[_0xd03c('0x3e')]=_[_0xd03c('0x33')](_0x406b8b[_0xd03c('0x34')],_0x406b8b[_0xd03c('0x2f')]);_0x3360b5['attributes']=_[_0xd03c('0x33')](_0x406b8b[_0xd03c('0x34')],qs[_0xd03c('0x35')](_0x58bc67[_0xd03c('0x2f')][_0xd03c('0x35')]));_0x3360b5[_0xd03c('0x36')]=_0x3360b5['attributes'][_0xd03c('0x37')]?_0x3360b5[_0xd03c('0x36')]:_0x406b8b[_0xd03c('0x34')];if(_0x58bc67[_0xd03c('0x2f')][_0xd03c('0x50')]){_0x3360b5[_0xd03c('0x4b')]=[{'all':!![]}];}_0x3360b5=_['merge']({},_0x3360b5,_0x58bc67[_0xd03c('0x60')]);return db[_0xd03c('0x2d')][_0xd03c('0x61')](_0x3360b5)[_0xd03c('0x28')](handleEntityNotFound(_0x578263,null))[_0xd03c('0x28')](respondWithResult(_0x578263,null))[_0xd03c('0x62')](handleError(_0x578263,null));};exports['create']=function(_0x1697f9,_0x55addf){return db['MailInteraction'][_0xd03c('0x63')](_0x1697f9[_0xd03c('0x64')],{})[_0xd03c('0x28')](respondWithResult(_0x55addf,0xc9))[_0xd03c('0x62')](handleError(_0x55addf,null));};exports['update']=function(_0x41bf16,_0x65264c){if(_0x41bf16[_0xd03c('0x64')]['id']){delete _0x41bf16[_0xd03c('0x64')]['id'];}return db['MailInteraction'][_0xd03c('0x61')]({'where':{'id':_0x41bf16[_0xd03c('0x5f')]['id']}})[_0xd03c('0x28')](handleEntityNotFound(_0x65264c,null))[_0xd03c('0x28')](saveUpdates(_0x41bf16['body'],null))['then'](respondWithResult(_0x65264c,null))[_0xd03c('0x62')](handleError(_0x65264c,null));};exports[_0xd03c('0x65')]=function(_0x5221b9,_0x530206){return db[_0xd03c('0x2d')][_0xd03c('0x61')]({'where':{'id':_0x5221b9[_0xd03c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x530206,null))[_0xd03c('0x28')](removeEntity(_0x530206,null))[_0xd03c('0x62')](handleError(_0x530206,null));};exports[_0xd03c('0x66')]=function(_0x408bef,_0x476902){return db['MailInteraction'][_0xd03c('0x66')]()[_0xd03c('0x28')](respondWithResult(_0x476902,null))['catch'](handleError(_0x476902,null));};exports['addMessage']=function(_0x18f21a,_0x532427,_0xd587a6){return db[_0xd03c('0x4c')]['find']({'where':{'id':_0x18f21a[_0xd03c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x532427,null))[_0xd03c('0x28')](function(_0x259b76){if(_0x259b76){return _0x259b76[_0xd03c('0x67')](_0x18f21a[_0xd03c('0x64')][_0xd03c('0x68')],_['omit'](_0x18f21a[_0xd03c('0x64')],['ids','id'])||{});}})['then'](respondWithResult(_0x532427,null))[_0xd03c('0x62')](handleError(_0x532427,null));};exports[_0xd03c('0x69')]=function(_0x4d3d86,_0x3f24df,_0x23adeb){var _0x5b5f43={'raw':![],'where':{}};var _0x4e073a={};var _0x15fa76={'count':0x0,'rows':[]};return db[_0xd03c('0x2d')][_0xd03c('0x6a')]({'where':{'id':_0x4d3d86[_0xd03c('0x5f')]['id']}})[_0xd03c('0x28')](handleEntityNotFound(_0x3f24df,null))['then'](function(_0x13cc0d){if(_0x13cc0d){_0x4e073a[_0xd03c('0x34')]=_['keys'](db[_0xd03c('0x4c')][_0xd03c('0x2e')]);_0x4e073a[_0xd03c('0x2f')]=_[_0xd03c('0x32')](_0x4d3d86['query']);_0x4e073a[_0xd03c('0x3e')]=_[_0xd03c('0x33')](_0x4e073a[_0xd03c('0x34')],_0x4e073a[_0xd03c('0x2f')]);_0x5b5f43[_0xd03c('0x36')]=_['intersection'](_0x4e073a[_0xd03c('0x34')],qs[_0xd03c('0x35')](_0x4d3d86[_0xd03c('0x2f')]['fields']));_0x5b5f43[_0xd03c('0x36')]=_0x5b5f43['attributes'][_0xd03c('0x37')]?_0x5b5f43['attributes']:_0x4e073a[_0xd03c('0x34')];if(!_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x38')](_0xd03c('0x39'))){_0x5b5f43[_0xd03c('0x3a')]=qs['limit'](_0x4d3d86['query']['limit']);_0x5b5f43[_0xd03c('0x22')]=qs[_0xd03c('0x22')](_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x22')]);}_0x5b5f43[_0xd03c('0x3b')]=qs[_0xd03c('0x3c')](_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x3c')]);_0x5b5f43[_0xd03c('0x3d')]=qs[_0xd03c('0x3e')](_[_0xd03c('0x3f')](_0x4d3d86[_0xd03c('0x2f')],_0x4e073a['filters']));_0x5b5f43[_0xd03c('0x3d')][_0xd03c('0x6b')]=_0x13cc0d['id'];if(_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x46')]){_0x5b5f43[_0xd03c('0x3d')]=_[_0xd03c('0x42')](_0x5b5f43[_0xd03c('0x3d')],{'$or':_[_0xd03c('0x43')](_0x5b5f43[_0xd03c('0x36')],function(_0x1b7711){var _0x3dfc49={};_0x3dfc49[_0x1b7711]={'$like':'%'+_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x46')]+'%'};return _0x3dfc49;})});}if(_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x6c')]){var _0x578183=_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x6c')][_0xd03c('0x6d')](',');var _0x47d9a2={};_0x47d9a2[_0x578183[0x0]]={'$gte':moment(_0x578183[0x1])[_0xd03c('0x6e')](_0xd03c('0x6f'))};_0x5b5f43[_0xd03c('0x3d')]=_[_0xd03c('0x42')](_0x5b5f43[_0xd03c('0x3d')],_0x47d9a2);}_0x5b5f43=_['merge']({},_0x5b5f43,_0x4d3d86[_0xd03c('0x60')]);return db[_0xd03c('0x4c')][_0xd03c('0x21')]({'where':_0x5b5f43[_0xd03c('0x3d')]})['then'](function(_0x5015b8){_0x15fa76['count']=_0x5015b8;if(_0x4d3d86[_0xd03c('0x2f')][_0xd03c('0x50')]){_0x5b5f43[_0xd03c('0x4b')]=[{'all':!![]}];}return db['MailMessage'][_0xd03c('0x70')](_0x5b5f43);})[_0xd03c('0x28')](function(_0x1558f7){_0x15fa76[_0xd03c('0x5d')]=_0x1558f7;return _0x15fa76;});}})[_0xd03c('0x28')](respondWithFilteredResult(_0x3f24df,_0x5b5f43))[_0xd03c('0x62')](handleError(_0x3f24df,null));};exports[_0xd03c('0x71')]=function(_0x36927a,_0x50ee6b,_0x566fb7){return db['MailInteraction']['find']({'where':{'id':_0x36927a[_0xd03c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x50ee6b,null))['then'](function(_0xa5c88f){if(_0xa5c88f){return _0xa5c88f[_0xd03c('0x72')](_0x36927a[_0xd03c('0x64')][_0xd03c('0x68')],_[_0xd03c('0x73')](_0x36927a[_0xd03c('0x64')],[_0xd03c('0x68'),'id'])||{})['spread'](function(){return db[_0xd03c('0x5b')][_0xd03c('0x70')]({'attributes':['id',_0xd03c('0x2b'),_0xd03c('0x5a')],'where':{'id':_0x36927a[_0xd03c('0x64')][_0xd03c('0x68')]}});})[_0xd03c('0x28')](function(_0x396d51){socket[_0xd03c('0x74')](_0xd03c('0x75'),{'id':Number(_0x36927a[_0xd03c('0x5f')]['id']),'tags':_0x396d51||[]});return{'id':Number(_0x36927a['params']['id']),'tags':_0x396d51||[]};});}})[_0xd03c('0x28')](respondWithResult(_0x50ee6b,null))['catch'](handleError(_0x50ee6b,null));};exports[_0xd03c('0x76')]=function(_0x56719b,_0x10c47b,_0x453f1b){var _0x27d101;return db[_0xd03c('0x2d')][_0xd03c('0x61')]({'where':{'id':_0x56719b[_0xd03c('0x5f')]['id']}})[_0xd03c('0x28')](handleEntityNotFound(_0x10c47b,null))[_0xd03c('0x28')](function(_0x109190){if(_0x109190){return _0x109190[_0xd03c('0x76')](_0x56719b['query'][_0xd03c('0x68')]);}})[_0xd03c('0x28')](respondWithStatusCode(_0x10c47b,null))[_0xd03c('0x62')](handleError(_0x10c47b,null));};exports[_0xd03c('0x77')]=function(_0x1413d5,_0x58dc9f){var _0x45372f=moment()[_0xd03c('0x78')]()[_0xd03c('0x79')]();var _0x4cf599=path[_0xd03c('0x7a')](config[_0xd03c('0x7b')],'server',_0xd03c('0x7c'),_0xd03c('0x7d'));var _0x10d4a0=path[_0xd03c('0x7a')](config['root'],_0xd03c('0x7e'),'files',_0xd03c('0x7f'));var _0x39465c=path[_0xd03c('0x7a')](_0x10d4a0,_0x45372f);var _0x21d47a=util[_0xd03c('0x6e')](_0xd03c('0x80'),_0x45372f);var _0x5d93b0=path[_0xd03c('0x7a')](_0x10d4a0,_0x21d47a);var _0x1fc86b=![];return db['MailInteraction'][_0xd03c('0x61')]({'where':{'id':_0x1413d5[_0xd03c('0x5f')]['id']}})['then'](handleEntityNotFound(_0x58dc9f,null))[_0xd03c('0x28')](function(_0x1ca566){if(_0x1ca566){return _0x1ca566[_0xd03c('0x69')]({'attributes':['id',_0xd03c('0x64'),_0xd03c('0x81'),'to','cc',_0xd03c('0x82'),'createdAt'],'where':{'secret':![]},'include':_0x1413d5['query'][_0xd03c('0x7d')]?[{'model':db[_0xd03c('0x83')],'as':_0xd03c('0x84')}]:undefined,'order':qs['sort']('id')});}return[];})[_0xd03c('0x28')](function(_0x2be99f){_0x1fc86b=_0x2be99f['length'];if(_0x2be99f[_0xd03c('0x37')]){fs[_0xd03c('0x85')](_0x39465c);return BPromise[_0xd03c('0x86')](_0x2be99f,function(_0x44894c,_0x28c1ca){var _0x1fa4eb=_0x44894c;var _0x10385={'from':_0x1fa4eb[_0xd03c('0x81')],'to':_0x1fa4eb['to'],'subject':_0x1fa4eb[_0xd03c('0x82')],'html':_0x1fa4eb[_0xd03c('0x64')],'attachments':[]};return new BPromise(function(_0x551119,_0x4b3d9d){if(_0x44894c['Attachments']){for(var _0x34835b=0x0;_0x34835b<_0x44894c[_0xd03c('0x84')][_0xd03c('0x37')];_0x34835b++){var _0x3ec001=_0x44894c['Attachments'][_0x34835b];var _0x56d094=path['join'](_0x4cf599,_0x3ec001[_0xd03c('0x87')]);if(fs[_0xd03c('0x88')](_0x56d094)){_0x10385[_0xd03c('0x7d')][_0xd03c('0x48')]({'name':_0x3ec001[_0xd03c('0x2b')],'contentType':_0x3ec001[_0xd03c('0x44')],'data':fs['readFileSync'](_0x56d094)});}}}emlformat[_0xd03c('0x89')](_0x10385,function(_0x546ee7,_0x555de7){if(_0x546ee7)return _0x4b3d9d(_0x546ee7);fs[_0xd03c('0x8a')](path['join'](_0x39465c,util[_0xd03c('0x6e')](_0xd03c('0x8b'),_0x28c1ca)),_0x555de7);return _0x551119(_0x555de7);});});});}})['then'](function(){if(_0x1fc86b){return new BPromise(function(_0x22a0f0,_0x45a7fd){zipdir(_0x39465c,{'saveTo':_0x5d93b0},function(_0x346456,_0x3f929c){if(_0x346456)return _0x45a7fd(_0x346456);return _0x22a0f0(_0x3f929c);});});}})[_0xd03c('0x28')](function(){if(_0x1fc86b){return new BPromise(function(_0x4dda36,_0x1f3070){rimraf(_0x39465c,function(_0x127cc3){if(_0x127cc3)_0x1f3070(_0x127cc3);return _0x4dda36();});});}})[_0xd03c('0x28')](function(){if(_0x1fc86b){return _0x58dc9f[_0xd03c('0x77')](_0x5d93b0,_0x21d47a,function(_0xae8be0){if(_0xae8be0){console[_0xd03c('0x8c')](_0xd03c('0x8d'),_0xae8be0);}else{fs['unlinkSync'](_0x5d93b0);}});}else{return _0x58dc9f[_0xd03c('0x1e')](0xc8);}})[_0xd03c('0x62')](handleError(_0x58dc9f,null));};
\ No newline at end of file
+var _0xed1e=['hasOwnProperty','nolimit','order','sort','filters','pick','add','day','merge','where','filter','map','type','key','VIRTUAL','field','options','tag','include','Tag','distinct','read','push','Messages','direction','createdAt','MailInteraction','includeAll','User','CmContact','Contact','fullname','internal','MailAccount','Account','MailMessage','Tags','color','ThroughTags','findAll','rows','catch','show','params','find','create','body','describe','addMessage','omit','ids','getMessages','findOne','MailInteractionId','$gte','split','addTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','server','files','attachments','root','tmp','format','interaction-%s.zip','from','subject','each','Attachments','basename','existsSync','readFileSync','build','message%d.eml','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','index','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','length'];(function(_0x5103f6,_0x354557){var _0x45800f=function(_0x54844e){while(--_0x54844e){_0x5103f6['push'](_0x5103f6['shift']());}};_0x45800f(++_0x354557);}(_0xed1e,0x151));var _0xeed1=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0xed1e[_0xd511d];return _0x3f148e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xeed1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeed1('0x1'));var moment=require(_0xeed1('0x2'));var BPromise=require(_0xeed1('0x3'));var Mustache=require('mustache');var util=require(_0xeed1('0x4'));var path=require('path');var sox=require(_0xeed1('0x5'));var csv=require(_0xeed1('0x6'));var ejs=require(_0xeed1('0x7'));var fs=require('fs');var _=require(_0xeed1('0x8'));var squel=require(_0xeed1('0x9'));var crypto=require(_0xeed1('0xa'));var jsforce=require(_0xeed1('0xb'));var deskjs=require(_0xeed1('0xc'));var toCsv=require(_0xeed1('0x6'));var querystring=require(_0xeed1('0xd'));var Papa=require(_0xeed1('0xe'));var Redis=require(_0xeed1('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xeed1('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xeed1('0x11'));var db=require(_0xeed1('0x12'))['db'];config[_0xeed1('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeed1('0x14'))(new Redis(config[_0xeed1('0x13')]));require('./mailInteraction.socket')[_0xeed1('0x15')](socket);function respondWithStatusCode(_0x5e9435,_0x1d67a2){_0x1d67a2=_0x1d67a2||0xcc;return function(_0x5597fc){if(_0x5597fc){return _0x5e9435[_0xeed1('0x16')](_0x1d67a2);}return _0x5e9435['status'](_0x1d67a2)[_0xeed1('0x17')]();};}function respondWithResult(_0x179b70,_0x3d817d){_0x3d817d=_0x3d817d||0xc8;return function(_0x525439){if(_0x525439){return _0x179b70[_0xeed1('0x18')](_0x3d817d)[_0xeed1('0x19')](_0x525439);}};}function respondWithFilteredResult(_0x4dc99c,_0x28871b){return function(_0x1b8dd3){if(_0x1b8dd3){var _0x450210=_0x1b8dd3[_0xeed1('0x1a')],_0x2c58b3=_0x28871b[_0xeed1('0x1b')],_0x29bb91=_0x28871b['offset']+_0x28871b[_0xeed1('0x1c')],_0x3f3acc;if(_0x29bb91>=_0x450210){_0x29bb91=_0x450210;_0x3f3acc=0xc8;}else{_0x3f3acc=0xce;}_0x4dc99c[_0xeed1('0x18')](_0x3f3acc);return _0x4dc99c[_0xeed1('0x1d')](_0xeed1('0x1e'),_0x2c58b3+'-'+_0x29bb91+'/'+_0x450210)[_0xeed1('0x19')](_0x1b8dd3);}return null;};}function patchUpdates(_0x4d265a){return function(_0x59828b){try{jsonpatch['apply'](_0x59828b,_0x4d265a,!![]);}catch(_0x1096bb){return BPromise[_0xeed1('0x1f')](_0x1096bb);}return _0x59828b['save']();};}function saveUpdates(_0x6f287,_0x2a8818){return function(_0x34e88e){if(_0x34e88e){return _0x34e88e['update'](_0x6f287)[_0xeed1('0x20')](function(_0x1309d4){return _0x1309d4;});}return null;};}function removeEntity(_0x3f729b,_0x27f65d){return function(_0x1cc0bf){if(_0x1cc0bf){return _0x1cc0bf['destroy']()['then'](function(){_0x3f729b['status'](0xcc)[_0xeed1('0x17')]();});}};}function handleEntityNotFound(_0x21de76,_0x37098c){return function(_0x411d3e){if(!_0x411d3e){_0x21de76[_0xeed1('0x16')](0x194);}return _0x411d3e;};}function handleError(_0x7658ab,_0x453bea){_0x453bea=_0x453bea||0x1f4;return function(_0x1ae319){logger[_0xeed1('0x21')](_0x1ae319[_0xeed1('0x22')]);if(_0x1ae319[_0xeed1('0x23')]){delete _0x1ae319[_0xeed1('0x23')];}_0x7658ab['status'](_0x453bea)['send'](_0x1ae319);};}exports[_0xeed1('0x24')]=function(_0x42b2c5,_0x5bcd2e){var _0x2e48a3={},_0xe97072={},_0x1515b9={'count':0x0,'rows':[]};var _0x1df766=db['MailInteraction'][_0xeed1('0x25')];_0xe97072[_0xeed1('0x26')]=_[_0xeed1('0x27')](_0x1df766);var _0x4cdf4e={'dateStart':_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x29')],'dateEnd':_0x42b2c5['query'][_0xeed1('0x2a')]};delete _0x42b2c5[_0xeed1('0x28')][_0xeed1('0x29')];delete _0x42b2c5[_0xeed1('0x28')][_0xeed1('0x2a')];_0xe97072[_0xeed1('0x28')]=_[_0xeed1('0x27')](_0x42b2c5['query']);_0xe97072['filters']=_[_0xeed1('0x2b')](_0xe97072['model'],_0xe97072[_0xeed1('0x28')]);_0x2e48a3[_0xeed1('0x2c')]=_[_0xeed1('0x2b')](_0xe97072[_0xeed1('0x26')],qs[_0xeed1('0x2d')](_0x42b2c5['query'][_0xeed1('0x2d')]));_0x2e48a3[_0xeed1('0x2c')]=_0x2e48a3[_0xeed1('0x2c')][_0xeed1('0x2e')]?_0x2e48a3[_0xeed1('0x2c')]:_0xe97072[_0xeed1('0x26')];if(!_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x2f')](_0xeed1('0x30'))){_0x2e48a3['limit']=qs[_0xeed1('0x1c')](_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x1c')]);_0x2e48a3['offset']=qs[_0xeed1('0x1b')](_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x1b')]);}_0x2e48a3[_0xeed1('0x31')]=qs[_0xeed1('0x32')](_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x32')]);_0x2e48a3['where']=qs[_0xeed1('0x33')](_[_0xeed1('0x34')](_0x42b2c5['query'],_0xe97072[_0xeed1('0x33')]));if(_0x4cdf4e[_0xeed1('0x29')]){if(_0x4cdf4e['dateEnd']){_0x4cdf4e[_0xeed1('0x2a')]=moment(_0x4cdf4e[_0xeed1('0x2a')])[_0xeed1('0x35')](0x1,_0xeed1('0x36'));}else{_0x4cdf4e[_0xeed1('0x2a')]=moment(_0x4cdf4e[_0xeed1('0x29')])[_0xeed1('0x35')](0x1,_0xeed1('0x36'));}_[_0xeed1('0x37')](_0x2e48a3[_0xeed1('0x38')],{'createdAt':{'$gte':_0x4cdf4e[_0xeed1('0x29')],'$lte':_0x4cdf4e[_0xeed1('0x2a')]}});}if(_0x42b2c5['query'][_0xeed1('0x39')]){_0x2e48a3[_0xeed1('0x38')]=_[_0xeed1('0x37')](_0x2e48a3[_0xeed1('0x38')],{'$or':_[_0xeed1('0x3a')](_0x1df766,function(_0x53caa8){if(_0x53caa8[_0xeed1('0x3b')][_0xeed1('0x3c')]!==_0xeed1('0x3d')){var _0x2635c8={};_0x2635c8[_0x53caa8[_0xeed1('0x3e')]]={'$like':'%'+_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x39')]+'%'};return _0x2635c8;}})});}_0x2e48a3=_[_0xeed1('0x37')]({},_0x2e48a3,_0x42b2c5[_0xeed1('0x3f')]);var _0x36e05b={'where':_0x2e48a3['where']};_0x36e05b['include']=[];if(_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x40')]){_0x36e05b[_0xeed1('0x41')]['push']({'model':db[_0xeed1('0x42')],'as':'Tags','attributes':['id'],'where':{'id':_0x42b2c5[_0xeed1('0x28')]['tag']},'required':!![]});_0x36e05b[_0xeed1('0x43')]=!![];}if(_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x44')]){_0x36e05b[_0xeed1('0x41')][_0xeed1('0x45')]({'model':db['MailMessage'],'as':_0xeed1('0x46'),'attributes':['id',_0xeed1('0x47'),_0xeed1('0x48'),_0xeed1('0x44')],'where':{'direction':'in','read':_0x42b2c5['query'][_0xeed1('0x44')]||![]},'required':!![]});_0x36e05b['distinct']=!![];}return db[_0xeed1('0x49')]['count'](_0x36e05b)[_0xeed1('0x20')](function(_0x506dcb){_0x1515b9[_0xeed1('0x1a')]=_0x506dcb;if(_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x4a')]){_0x2e48a3[_0xeed1('0x41')]=[{'model':db[_0xeed1('0x4b')],'as':'Users','required':![],'attributes':['id',_0xeed1('0x23'),'fullname']},{'model':db[_0xeed1('0x4c')],'as':_0xeed1('0x4d'),'required':![]},{'model':db[_0xeed1('0x4b')],'as':'Owner','attributes':[_0xeed1('0x23'),_0xeed1('0x4e'),_0xeed1('0x4f')],'required':![]},{'model':db[_0xeed1('0x50')],'as':_0xeed1('0x51'),'attributes':[_0xeed1('0x23'),_0xeed1('0x3c'),'email'],'required':![]},{'model':db[_0xeed1('0x52')],'as':_0xeed1('0x46'),'attributes':['id','direction',_0xeed1('0x48'),_0xeed1('0x44')],'where':{'direction':'in','read':_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x44')]||![]},'required':_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x44')]||![]},{'model':db[_0xeed1('0x42')],'as':_0xeed1('0x53'),'attributes':['id',_0xeed1('0x23'),_0xeed1('0x54')],'required':_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x40')]?!![]:![]},{'model':db[_0xeed1('0x42')],'as':_0xeed1('0x55'),'attributes':['id',_0xeed1('0x23'),_0xeed1('0x54')],'through':_0x42b2c5[_0xeed1('0x28')]['tag']?{'attributes':[],'where':{'TagId':_0x42b2c5[_0xeed1('0x28')][_0xeed1('0x40')]||undefined}}:{},'required':_0x42b2c5[_0xeed1('0x28')]['tag']?!![]:![]}];}return db[_0xeed1('0x49')][_0xeed1('0x56')](_0x2e48a3);})['then'](function(_0x37c7bf){_0x1515b9[_0xeed1('0x57')]=_0x37c7bf;return _0x1515b9;})[_0xeed1('0x20')](respondWithFilteredResult(_0x5bcd2e,_0x2e48a3))[_0xeed1('0x58')](handleError(_0x5bcd2e,null));};exports[_0xeed1('0x59')]=function(_0x14df38,_0x4cb3b7){var _0x35ced0={'raw':![],'where':{'id':_0x14df38[_0xeed1('0x5a')]['id']}},_0xa51ad3={};_0xa51ad3[_0xeed1('0x26')]=_[_0xeed1('0x27')](db[_0xeed1('0x49')][_0xeed1('0x25')]);_0xa51ad3[_0xeed1('0x28')]=_[_0xeed1('0x27')](_0x14df38[_0xeed1('0x28')]);_0xa51ad3['filters']=_[_0xeed1('0x2b')](_0xa51ad3[_0xeed1('0x26')],_0xa51ad3[_0xeed1('0x28')]);_0x35ced0[_0xeed1('0x2c')]=_[_0xeed1('0x2b')](_0xa51ad3[_0xeed1('0x26')],qs['fields'](_0x14df38[_0xeed1('0x28')][_0xeed1('0x2d')]));_0x35ced0[_0xeed1('0x2c')]=_0x35ced0['attributes']['length']?_0x35ced0[_0xeed1('0x2c')]:_0xa51ad3[_0xeed1('0x26')];if(_0x14df38['query'][_0xeed1('0x4a')]){_0x35ced0[_0xeed1('0x41')]=[{'all':!![]}];}_0x35ced0=_[_0xeed1('0x37')]({},_0x35ced0,_0x14df38[_0xeed1('0x3f')]);return db[_0xeed1('0x49')][_0xeed1('0x5b')](_0x35ced0)[_0xeed1('0x20')](handleEntityNotFound(_0x4cb3b7,null))[_0xeed1('0x20')](respondWithResult(_0x4cb3b7,null))[_0xeed1('0x58')](handleError(_0x4cb3b7,null));};exports[_0xeed1('0x5c')]=function(_0xca68a8,_0x179d9c){return db[_0xeed1('0x49')][_0xeed1('0x5c')](_0xca68a8[_0xeed1('0x5d')],{})[_0xeed1('0x20')](respondWithResult(_0x179d9c,0xc9))[_0xeed1('0x58')](handleError(_0x179d9c,null));};exports['update']=function(_0x24b3a5,_0x55af36){if(_0x24b3a5[_0xeed1('0x5d')]['id']){delete _0x24b3a5[_0xeed1('0x5d')]['id'];}return db['MailInteraction'][_0xeed1('0x5b')]({'where':{'id':_0x24b3a5[_0xeed1('0x5a')]['id']}})[_0xeed1('0x20')](handleEntityNotFound(_0x55af36,null))['then'](saveUpdates(_0x24b3a5[_0xeed1('0x5d')],null))[_0xeed1('0x20')](respondWithResult(_0x55af36,null))[_0xeed1('0x58')](handleError(_0x55af36,null));};exports['destroy']=function(_0x1eb408,_0x48ff7c){return db[_0xeed1('0x49')]['find']({'where':{'id':_0x1eb408[_0xeed1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x48ff7c,null))[_0xeed1('0x20')](removeEntity(_0x48ff7c,null))['catch'](handleError(_0x48ff7c,null));};exports[_0xeed1('0x5e')]=function(_0x7ea012,_0x3dcfc2){return db[_0xeed1('0x49')]['describe']()['then'](respondWithResult(_0x3dcfc2,null))[_0xeed1('0x58')](handleError(_0x3dcfc2,null));};exports[_0xeed1('0x5f')]=function(_0x23695e,_0x4f915b,_0x19416f){return db[_0xeed1('0x52')][_0xeed1('0x5b')]({'where':{'id':_0x23695e['params']['id']}})[_0xeed1('0x20')](handleEntityNotFound(_0x4f915b,null))[_0xeed1('0x20')](function(_0xead4e){if(_0xead4e){return _0xead4e['addMessage'](_0x23695e[_0xeed1('0x5d')]['ids'],_[_0xeed1('0x60')](_0x23695e[_0xeed1('0x5d')],[_0xeed1('0x61'),'id'])||{});}})[_0xeed1('0x20')](respondWithResult(_0x4f915b,null))[_0xeed1('0x58')](handleError(_0x4f915b,null));};exports[_0xeed1('0x62')]=function(_0x3a9b69,_0x399cee,_0x53f1c6){var _0x2ac557={'raw':![],'where':{}};var _0x2b7636={};var _0x41ccab={'count':0x0,'rows':[]};return db[_0xeed1('0x49')][_0xeed1('0x63')]({'where':{'id':_0x3a9b69['params']['id']}})[_0xeed1('0x20')](handleEntityNotFound(_0x399cee,null))[_0xeed1('0x20')](function(_0x43bc9f){if(_0x43bc9f){_0x2b7636[_0xeed1('0x26')]=_[_0xeed1('0x27')](db[_0xeed1('0x52')]['rawAttributes']);_0x2b7636[_0xeed1('0x28')]=_[_0xeed1('0x27')](_0x3a9b69[_0xeed1('0x28')]);_0x2b7636[_0xeed1('0x33')]=_[_0xeed1('0x2b')](_0x2b7636[_0xeed1('0x26')],_0x2b7636[_0xeed1('0x28')]);_0x2ac557[_0xeed1('0x2c')]=_[_0xeed1('0x2b')](_0x2b7636['model'],qs[_0xeed1('0x2d')](_0x3a9b69[_0xeed1('0x28')]['fields']));_0x2ac557[_0xeed1('0x2c')]=_0x2ac557[_0xeed1('0x2c')][_0xeed1('0x2e')]?_0x2ac557[_0xeed1('0x2c')]:_0x2b7636[_0xeed1('0x26')];if(!_0x3a9b69['query']['hasOwnProperty'](_0xeed1('0x30'))){_0x2ac557[_0xeed1('0x1c')]=qs[_0xeed1('0x1c')](_0x3a9b69['query']['limit']);_0x2ac557[_0xeed1('0x1b')]=qs['offset'](_0x3a9b69[_0xeed1('0x28')][_0xeed1('0x1b')]);}_0x2ac557['order']=qs[_0xeed1('0x32')](_0x3a9b69[_0xeed1('0x28')]['sort']);_0x2ac557[_0xeed1('0x38')]=qs[_0xeed1('0x33')](_[_0xeed1('0x34')](_0x3a9b69[_0xeed1('0x28')],_0x2b7636[_0xeed1('0x33')]));_0x2ac557[_0xeed1('0x38')][_0xeed1('0x64')]=_0x43bc9f['id'];if(_0x3a9b69['query']['filter']){_0x2ac557[_0xeed1('0x38')]=_[_0xeed1('0x37')](_0x2ac557[_0xeed1('0x38')],{'$or':_[_0xeed1('0x3a')](_0x2ac557[_0xeed1('0x2c')],function(_0x4125b0){var _0x151645={};_0x151645[_0x4125b0]={'$like':'%'+_0x3a9b69[_0xeed1('0x28')]['filter']+'%'};return _0x151645;})});}if(_0x3a9b69[_0xeed1('0x28')][_0xeed1('0x65')]){var _0x5c67e5=_0x3a9b69[_0xeed1('0x28')][_0xeed1('0x65')][_0xeed1('0x66')](',');var _0x46dec7={};_0x46dec7[_0x5c67e5[0x0]]={'$gte':moment(_0x5c67e5[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2ac557['where']=_['merge'](_0x2ac557[_0xeed1('0x38')],_0x46dec7);}_0x2ac557=_['merge']({},_0x2ac557,_0x3a9b69[_0xeed1('0x3f')]);return db['MailMessage'][_0xeed1('0x1a')]({'where':_0x2ac557[_0xeed1('0x38')]})['then'](function(_0x512e2f){_0x41ccab['count']=_0x512e2f;if(_0x3a9b69[_0xeed1('0x28')][_0xeed1('0x4a')]){_0x2ac557['include']=[{'all':!![]}];}return db[_0xeed1('0x52')][_0xeed1('0x56')](_0x2ac557);})[_0xeed1('0x20')](function(_0x2887fa){_0x41ccab[_0xeed1('0x57')]=_0x2887fa;return _0x41ccab;});}})[_0xeed1('0x20')](respondWithFilteredResult(_0x399cee,_0x2ac557))[_0xeed1('0x58')](handleError(_0x399cee,null));};exports[_0xeed1('0x67')]=function(_0x17452c,_0x5039e6,_0x587cf2){return db[_0xeed1('0x49')][_0xeed1('0x5b')]({'where':{'id':_0x17452c[_0xeed1('0x5a')]['id']}})[_0xeed1('0x20')](handleEntityNotFound(_0x5039e6,null))[_0xeed1('0x20')](function(_0x329d89){if(_0x329d89){return _0x329d89['setTags'](_0x17452c[_0xeed1('0x5d')]['ids'],_[_0xeed1('0x60')](_0x17452c[_0xeed1('0x5d')],['ids','id'])||{})[_0xeed1('0x68')](function(){return db['Tag']['findAll']({'attributes':['id',_0xeed1('0x23'),'color'],'where':{'id':_0x17452c[_0xeed1('0x5d')][_0xeed1('0x61')]}});})[_0xeed1('0x20')](function(_0x179ee2){socket[_0xeed1('0x69')](_0xeed1('0x6a'),{'id':Number(_0x17452c[_0xeed1('0x5a')]['id']),'tags':_0x179ee2||[]});return{'id':Number(_0x17452c['params']['id']),'tags':_0x179ee2||[]};});}})['then'](respondWithResult(_0x5039e6,null))[_0xeed1('0x58')](handleError(_0x5039e6,null));};exports[_0xeed1('0x6b')]=function(_0x553fd9,_0x439b82,_0xdb0c13){var _0x20cda2;return db['MailInteraction'][_0xeed1('0x5b')]({'where':{'id':_0x553fd9['params']['id']}})[_0xeed1('0x20')](handleEntityNotFound(_0x439b82,null))[_0xeed1('0x20')](function(_0x21fe2d){if(_0x21fe2d){return _0x21fe2d[_0xeed1('0x6b')](_0x553fd9[_0xeed1('0x28')][_0xeed1('0x61')]);}})['then'](respondWithStatusCode(_0x439b82,null))[_0xeed1('0x58')](handleError(_0x439b82,null));};exports[_0xeed1('0x6c')]=function(_0x50d93b,_0x5edb03){var _0x514058=moment()[_0xeed1('0x6d')]()[_0xeed1('0x6e')]();var _0x1dcf1b=path[_0xeed1('0x6f')](config['root'],_0xeed1('0x70'),_0xeed1('0x71'),_0xeed1('0x72'));var _0x2231e6=path[_0xeed1('0x6f')](config[_0xeed1('0x73')],'server',_0xeed1('0x71'),_0xeed1('0x74'));var _0x3b2b40=path[_0xeed1('0x6f')](_0x2231e6,_0x514058);var _0x4d9b0e=util[_0xeed1('0x75')](_0xeed1('0x76'),_0x514058);var _0x3db1e1=path[_0xeed1('0x6f')](_0x2231e6,_0x4d9b0e);var _0x2e5522=![];return db[_0xeed1('0x49')][_0xeed1('0x5b')]({'where':{'id':_0x50d93b[_0xeed1('0x5a')]['id']}})[_0xeed1('0x20')](handleEntityNotFound(_0x5edb03,null))['then'](function(_0x1ca04b){if(_0x1ca04b){return _0x1ca04b[_0xeed1('0x62')]({'attributes':['id','body',_0xeed1('0x77'),'to','cc',_0xeed1('0x78'),_0xeed1('0x48')],'where':{'secret':![]},'include':_0x50d93b[_0xeed1('0x28')][_0xeed1('0x72')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined,'order':qs[_0xeed1('0x32')]('id')});}return[];})[_0xeed1('0x20')](function(_0x1beb06){_0x2e5522=_0x1beb06['length'];if(_0x1beb06['length']){fs['mkdirSync'](_0x3b2b40);return BPromise[_0xeed1('0x79')](_0x1beb06,function(_0x2293d7,_0x4aaf8e){var _0x463adc=_0x2293d7;var _0x5bd605={'from':_0x463adc['from'],'to':_0x463adc['to'],'subject':_0x463adc['subject'],'html':_0x463adc[_0xeed1('0x5d')],'attachments':[]};return new BPromise(function(_0x771c54,_0xdec9ff){if(_0x2293d7[_0xeed1('0x7a')]){for(var _0xf6c7d2=0x0;_0xf6c7d2<_0x2293d7['Attachments'][_0xeed1('0x2e')];_0xf6c7d2++){var _0x27a163=_0x2293d7['Attachments'][_0xf6c7d2];var _0x320a58=path[_0xeed1('0x6f')](_0x1dcf1b,_0x27a163[_0xeed1('0x7b')]);if(fs[_0xeed1('0x7c')](_0x320a58)){_0x5bd605[_0xeed1('0x72')][_0xeed1('0x45')]({'name':_0x27a163[_0xeed1('0x23')],'contentType':_0x27a163[_0xeed1('0x3b')],'data':fs[_0xeed1('0x7d')](_0x320a58)});}}}emlformat[_0xeed1('0x7e')](_0x5bd605,function(_0x37f85f,_0x3b049a){if(_0x37f85f)return _0xdec9ff(_0x37f85f);fs['writeFileSync'](path[_0xeed1('0x6f')](_0x3b2b40,util[_0xeed1('0x75')](_0xeed1('0x7f'),_0x4aaf8e)),_0x3b049a);return _0x771c54(_0x3b049a);});});});}})[_0xeed1('0x20')](function(){if(_0x2e5522){return new BPromise(function(_0x35cf58,_0x26d1b4){zipdir(_0x3b2b40,{'saveTo':_0x3db1e1},function(_0x405cd5,_0x5c9b35){if(_0x405cd5)return _0x26d1b4(_0x405cd5);return _0x35cf58(_0x5c9b35);});});}})[_0xeed1('0x20')](function(){if(_0x2e5522){return new BPromise(function(_0x2e878a,_0x415a4c){rimraf(_0x3b2b40,function(_0x2f5c7b){if(_0x2f5c7b)_0x415a4c(_0x2f5c7b);return _0x2e878a();});});}})['then'](function(){if(_0x2e5522){return _0x5edb03[_0xeed1('0x6c')](_0x3db1e1,_0x4d9b0e,function(_0x4cd485){if(_0x4cd485){console['log']('err',_0x4cd485);}else{fs['unlinkSync'](_0x3db1e1);}});}else{return _0x5edb03[_0xeed1('0x16')](0xc8);}})['catch'](handleError(_0x5edb03,null));};
\ No newline at end of file
index 900ee9d..4a3ef0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c76=['events','MailInteraction','emit','hasOwnProperty','hook','exports'];(function(_0x362c3e,_0x118ca3){var _0x35e5d3=function(_0x525a2c){while(--_0x525a2c){_0x362c3e['push'](_0x362c3e['shift']());}};_0x35e5d3(++_0x118ca3);}(_0x6c76,0xea));var _0x66c7=function(_0x21aabd,_0x1c5e9b){_0x21aabd=_0x21aabd-0x0;var _0xfc577a=_0x6c76[_0x21aabd];return _0xfc577a;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x66c7('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2abeae){return function(_0x21823b,_0x283ea9,_0x538112){MailInteractionEvents['emit'](_0x2abeae+':'+_0x21823b['id'],_0x21823b);MailInteractionEvents[_0x66c7('0x2')](_0x2abeae,_0x21823b);_0x538112(null);};}for(var e in events){if(events[_0x66c7('0x3')](e)){var event=events[e];MailInteraction[_0x66c7('0x4')](e,emitEvent(event));}}module[_0x66c7('0x5')]=MailInteractionEvents;
\ No newline at end of file
+var _0xfc9e=['events','../../mysqldb','MailInteraction','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x37b713,_0x248677){var _0xae950c=function(_0x272cb9){while(--_0x272cb9){_0x37b713['push'](_0x37b713['shift']());}};_0xae950c(++_0x248677);}(_0xfc9e,0x7e));var _0xefc9=function(_0x888385,_0x9cdc66){_0x888385=_0x888385-0x0;var _0x22d5c2=_0xfc9e[_0x888385];return _0x22d5c2;};'use strict';var EventEmitter=require(_0xefc9('0x0'));var MailInteraction=require(_0xefc9('0x1'))['db'][_0xefc9('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xefc9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xefc9('0x4'),'afterDestroy':_0xefc9('0x5')};function emitEvent(_0x902c1a){return function(_0x22c573,_0x1cffa0,_0x5244c2){MailInteractionEvents[_0xefc9('0x6')](_0x902c1a+':'+_0x22c573['id'],_0x22c573);MailInteractionEvents[_0xefc9('0x6')](_0x902c1a,_0x22c573);_0x5244c2(null);};}for(var e in events){if(events[_0xefc9('0x7')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xefc9('0x8')]=MailInteractionEvents;
\ No newline at end of file
index 2eac79a..f189e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40cb=['./mailInteraction.attributes','exports','define','mail_interactions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x171bdf,_0x393bb8){var _0x3a8702=function(_0x293ae2){while(--_0x293ae2){_0x171bdf['push'](_0x171bdf['shift']());}};_0x3a8702(++_0x393bb8);}(_0x40cb,0x108));var _0xb40c=function(_0x49c5b8,_0x422a0d){_0x49c5b8=_0x49c5b8-0x0;var _0x3e362d=_0x40cb[_0x49c5b8];return _0x3e362d;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var logger=require(_0xb40c('0x2'))(_0xb40c('0x3'));var moment=require('moment');var BPromise=require(_0xb40c('0x4'));var rp=require(_0xb40c('0x5'));var attributes=require(_0xb40c('0x6'));module[_0xb40c('0x7')]=function(_0x52aacd,_0x712159){return _0x52aacd[_0xb40c('0x8')]('MailInteraction',attributes,{'tableName':_0xb40c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc83b=['./mailInteraction.attributes','exports','define','MailInteraction','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x26aa38,_0x54d458){var _0x455ca5=function(_0x375d22){while(--_0x375d22){_0x26aa38['push'](_0x26aa38['shift']());}};_0x455ca5(++_0x54d458);}(_0xc83b,0xa4));var _0xbc83=function(_0x3754e5,_0x74480b){_0x3754e5=_0x3754e5-0x0;var _0xfa5cc2=_0xc83b[_0x3754e5];return _0xfa5cc2;};'use strict';var _=require(_0xbc83('0x0'));var util=require(_0xbc83('0x1'));var logger=require(_0xbc83('0x2'))(_0xbc83('0x3'));var moment=require('moment');var BPromise=require(_0xbc83('0x4'));var rp=require(_0xbc83('0x5'));var attributes=require(_0xbc83('0x6'));module[_0xbc83('0x7')]=function(_0xee232c,_0x50b38d){return _0xee232c[_0xbc83('0x8')](_0xbc83('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6dcc7fe..411f7ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb61=['register','then','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','info','request\x20sent','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','stringify','catch','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./mailInteraction.socket'];(function(_0x4d3bf9,_0x1c31fd){var _0xac8bc3=function(_0x462df8){while(--_0x462df8){_0x4d3bf9['push'](_0x4d3bf9['shift']());}};_0xac8bc3(++_0x1c31fd);}(_0xbb61,0x131));var _0x1bb6=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xbb61[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x1bb6('0x0'));var util=require('util');var moment=require(_0x1bb6('0x1'));var BPromise=require(_0x1bb6('0x2'));var rs=require(_0x1bb6('0x3'));var fs=require('fs');var Redis=require(_0x1bb6('0x4'));var db=require(_0x1bb6('0x5'))['db'];var utils=require(_0x1bb6('0x6'));var logger=require(_0x1bb6('0x7'))('rpc');var config=require(_0x1bb6('0x8'));var jayson=require(_0x1bb6('0x9'));var client=jayson[_0x1bb6('0xa')]['http']({'port':0x232a});config[_0x1bb6('0xb')]=_[_0x1bb6('0xc')](config[_0x1bb6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1bb6('0xd'))(new Redis(config[_0x1bb6('0xb')]));require(_0x1bb6('0xe'))[_0x1bb6('0xf')](socket);function respondWithRpcPromise(_0x1a18bf,_0x359a49,_0x5c8d00){return new BPromise(function(_0xe24210,_0x29ee41){return client['request'](_0x1a18bf,_0x5c8d00)[_0x1bb6('0x10')](function(_0x5988f4){logger['info']('MailInteraction,\x20%s,\x20%s',_0x359a49,'request\x20sent');logger[_0x1bb6('0x11')](_0x1bb6('0x12'),_0x359a49,'request\x20sent',JSON['stringify'](_0x5988f4));if(_0x5988f4[_0x1bb6('0x13')]){if(_0x5988f4[_0x1bb6('0x13')][_0x1bb6('0x14')]===0x1f4){logger[_0x1bb6('0x13')](_0x1bb6('0x15'),_0x359a49,_0x5988f4[_0x1bb6('0x13')][_0x1bb6('0x16')]);return _0x29ee41(_0x5988f4[_0x1bb6('0x13')]['message']);}logger[_0x1bb6('0x13')](_0x1bb6('0x15'),_0x359a49,_0x5988f4[_0x1bb6('0x13')][_0x1bb6('0x16')]);return _0xe24210(_0x5988f4[_0x1bb6('0x13')]['message']);}else{logger[_0x1bb6('0x17')](_0x1bb6('0x15'),_0x359a49,_0x1bb6('0x18'));_0xe24210(_0x5988f4['result'][_0x1bb6('0x16')]);}})['catch'](function(_0x203f2b){logger['error'](_0x1bb6('0x15'),_0x359a49,_0x203f2b);_0x29ee41(_0x203f2b);});});}exports[_0x1bb6('0x19')]=function(_0x44190f){var _0x457d46=this;return new Promise(function(_0x138300,_0xb05bd){return db[_0x1bb6('0x1a')][_0x1bb6('0x1b')](_0x44190f[_0x1bb6('0x1c')],{'raw':_0x44190f['options']?_0x44190f[_0x1bb6('0x1d')][_0x1bb6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44190f['options']?_0x44190f[_0x1bb6('0x1d')][_0x1bb6('0x1f')]||null:null,'attributes':_0x44190f[_0x1bb6('0x1d')]?_0x44190f[_0x1bb6('0x1d')]['attributes']||null:null,'limit':_0x44190f['options']?_0x44190f['options']['limit']||null:null})['then'](function(_0x2bdcd3){logger[_0x1bb6('0x17')](_0x1bb6('0x19'),_0x44190f);logger['debug'](_0x1bb6('0x19'),_0x44190f,JSON[_0x1bb6('0x20')](_0x2bdcd3));_0x138300(_0x2bdcd3);})[_0x1bb6('0x21')](function(_0x320512){logger[_0x1bb6('0x13')]('UpdateMailInteraction',_0x320512['message'],_0x44190f);_0xb05bd(_0x457d46['error'](0x1f4,_0x320512[_0x1bb6('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x569f85){return new Promise(function(_0x17cde9,_0x501cb3){return db['MailInteraction'][_0x1bb6('0x22')]({'where':_0x569f85[_0x1bb6('0x1d')]?_0x569f85[_0x1bb6('0x1d')][_0x1bb6('0x1f')]||null:null})['then'](function(_0x1bc261){if(_0x1bc261){return _0x1bc261[_0x1bb6('0x23')](_0x569f85['body'][_0x1bb6('0x24')],_[_0x1bb6('0x25')](_0x569f85[_0x1bb6('0x1c')],['ids','id'])||{});}})[_0x1bb6('0x26')](function(_0x25a6a6){logger[_0x1bb6('0x17')](_0x1bb6('0x27'),_0x569f85);logger['debug'](_0x1bb6('0x27'),_0x569f85,JSON[_0x1bb6('0x20')](_0x25a6a6));_0x17cde9(_0x25a6a6);})['catch'](function(_0x2ad17d){logger[_0x1bb6('0x13')](_0x1bb6('0x27'),_0x2ad17d['message'],_0x569f85);_0x501cb3(_this[_0x1bb6('0x13')](0x1f4,_0x2ad17d[_0x1bb6('0x16')]));});});};
\ No newline at end of file
+var _0x8458=['AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToMailInteraction','MailInteraction','find','ids','spread'];(function(_0x52dbd1,_0xe46f69){var _0x58c76a=function(_0x35bff0){while(--_0x35bff0){_0x52dbd1['push'](_0x52dbd1['shift']());}};_0x58c76a(++_0xe46f69);}(_0x8458,0x1a5));var _0x8845=function(_0x2981ee,_0x47fc69){_0x2981ee=_0x2981ee-0x0;var _0x57f2d9=_0x8458[_0x2981ee];return _0x57f2d9;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var moment=require(_0x8845('0x1'));var BPromise=require(_0x8845('0x2'));var rs=require(_0x8845('0x3'));var fs=require('fs');var Redis=require(_0x8845('0x4'));var db=require(_0x8845('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8845('0x6'))(_0x8845('0x7'));var config=require(_0x8845('0x8'));var jayson=require(_0x8845('0x9'));var client=jayson[_0x8845('0xa')]['http']({'port':0x232a});config[_0x8845('0xb')]=_['defaults'](config[_0x8845('0xb')],{'host':_0x8845('0xc'),'port':0x18eb});var socket=require(_0x8845('0xd'))(new Redis(config['redis']));require(_0x8845('0xe'))[_0x8845('0xf')](socket);function respondWithRpcPromise(_0x59cd0b,_0x33d23e,_0xd846f1){return new BPromise(function(_0x55703d,_0x3b9c78){return client[_0x8845('0x10')](_0x59cd0b,_0xd846f1)[_0x8845('0x11')](function(_0x1f1027){logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));logger[_0x8845('0x15')](_0x8845('0x16'),_0x33d23e,_0x8845('0x14'),JSON[_0x8845('0x17')](_0x1f1027));if(_0x1f1027[_0x8845('0x18')]){if(_0x1f1027[_0x8845('0x18')][_0x8845('0x19')]===0x1f4){logger['error'](_0x8845('0x13'),_0x33d23e,_0x1f1027[_0x8845('0x18')]['message']);return _0x3b9c78(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}logger[_0x8845('0x18')]('MailInteraction,\x20%s,\x20%s',_0x33d23e,_0x1f1027['error']['message']);return _0x55703d(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}else{logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));_0x55703d(_0x1f1027[_0x8845('0x1b')][_0x8845('0x1a')]);}})['catch'](function(_0x4e6a6f){logger['error'](_0x8845('0x13'),_0x33d23e,_0x4e6a6f);_0x3b9c78(_0x4e6a6f);});});}exports[_0x8845('0x1c')]=function(_0x122c92){var _0x380010=this;return new Promise(function(_0x49ec66,_0x2e94f5){return db['MailInteraction']['update'](_0x122c92[_0x8845('0x1d')],{'raw':_0x122c92[_0x8845('0x1e')]?_0x122c92['options'][_0x8845('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x122c92[_0x8845('0x1e')]?_0x122c92['options'][_0x8845('0x20')]||null:null,'attributes':_0x122c92[_0x8845('0x1e')]?_0x122c92[_0x8845('0x1e')][_0x8845('0x21')]||null:null,'limit':_0x122c92['options']?_0x122c92['options'][_0x8845('0x22')]||null:null})[_0x8845('0x11')](function(_0x3b4f41){logger[_0x8845('0x12')](_0x8845('0x1c'),_0x122c92);logger[_0x8845('0x15')](_0x8845('0x1c'),_0x122c92,JSON[_0x8845('0x17')](_0x3b4f41));_0x49ec66(_0x3b4f41);})[_0x8845('0x23')](function(_0x21be51){logger[_0x8845('0x18')](_0x8845('0x1c'),_0x21be51[_0x8845('0x1a')],_0x122c92);_0x2e94f5(_0x380010[_0x8845('0x18')](0x1f4,_0x21be51[_0x8845('0x1a')]));});});};exports[_0x8845('0x24')]=function(_0x792660){return new Promise(function(_0x5e30a4,_0x47dfff){return db[_0x8845('0x25')][_0x8845('0x26')]({'where':_0x792660[_0x8845('0x1e')]?_0x792660[_0x8845('0x1e')][_0x8845('0x20')]||null:null})[_0x8845('0x11')](function(_0x1844b6){if(_0x1844b6){return _0x1844b6['addTags'](_0x792660[_0x8845('0x1d')][_0x8845('0x27')],_['omit'](_0x792660[_0x8845('0x1d')],[_0x8845('0x27'),'id'])||{});}})[_0x8845('0x28')](function(_0x5e3464){logger[_0x8845('0x12')](_0x8845('0x29'),_0x792660);logger[_0x8845('0x15')](_0x8845('0x29'),_0x792660,JSON['stringify'](_0x5e3464));_0x5e30a4(_0x5e3464);})['catch'](function(_0x3c6354){logger[_0x8845('0x18')]('AddTags',_0x3c6354[_0x8845('0x1a')],_0x792660);_0x47dfff(_this[_0x8845('0x18')](0x1f4,_0x3c6354[_0x8845('0x1a')]));});});};
\ No newline at end of file
index bc34380..b904897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28b0=['register','length','mailInteraction:','./mailInteraction.events','save','update','emit'];(function(_0x173a3c,_0x59b034){var _0xe6344=function(_0x43b3d9){while(--_0x43b3d9){_0x173a3c['push'](_0x173a3c['shift']());}};_0xe6344(++_0x59b034);}(_0x28b0,0x1a0));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x028b('0x0'));var events=[_0x028b('0x1'),'remove',_0x028b('0x2')];function createListener(_0xa9269b,_0x2fe02f){return function(_0x385c73){_0x2fe02f[_0x028b('0x3')](_0xa9269b,_0x385c73);};}function removeListener(_0x39cb49,_0x33a3a0){return function(){MailInteractionEvents['removeListener'](_0x39cb49,_0x33a3a0);};}exports[_0x028b('0x4')]=function(_0x54dae4){for(var _0x5988be=0x0,_0x22e3c6=events[_0x028b('0x5')];_0x5988be<_0x22e3c6;_0x5988be++){var _0x3d8152=events[_0x5988be];var _0xe30b30=createListener(_0x028b('0x6')+_0x3d8152,_0x54dae4);MailInteractionEvents['on'](_0x3d8152,_0xe30b30);}};
\ No newline at end of file
+var _0xe3ab=['length','mailInteraction:','./mailInteraction.events','save','remove','update','removeListener'];(function(_0x4b1533,_0x15c6ab){var _0xd8bf07=function(_0x4e7de5){while(--_0x4e7de5){_0x4b1533['push'](_0x4b1533['shift']());}};_0xd8bf07(++_0x15c6ab);}(_0xe3ab,0x11a));var _0xbe3a=function(_0x4c57e5,_0x455b85){_0x4c57e5=_0x4c57e5-0x0;var _0x1091d3=_0xe3ab[_0x4c57e5];return _0x1091d3;};'use strict';var MailInteractionEvents=require(_0xbe3a('0x0'));var events=[_0xbe3a('0x1'),_0xbe3a('0x2'),_0xbe3a('0x3')];function createListener(_0x3f178b,_0x496347){return function(_0x4c3dd0){_0x496347['emit'](_0x3f178b,_0x4c3dd0);};}function removeListener(_0x21ba8e,_0x206db8){return function(){MailInteractionEvents[_0xbe3a('0x4')](_0x21ba8e,_0x206db8);};}exports['register']=function(_0x3179b9){for(var _0x315ac4=0x0,_0x35e629=events[_0xbe3a('0x5')];_0x315ac4<_0x35e629;_0x315ac4++){var _0x2f2b1f=events[_0x315ac4];var _0x3e0ba9=createListener(_0xbe3a('0x6')+_0x2f2b1f,_0x3179b9);MailInteractionEvents['on'](_0x2f2b1f,_0x3e0ba9);}};
\ No newline at end of file
index 44c0a82..ea3cda9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','mail','create','put','/:id/accept','accept','reject','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x17d856,_0x1b4820){var _0x2b2b17=function(_0x47852d){while(--_0x47852d){_0x17d856['push'](_0x17d856['shift']());}};_0x2b2b17(++_0x1b4820);}(_0x71ab,0x64));var _0xb71a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x71ab[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0x7')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0x7')](_0xb71a('0xe'),auth['isAuthenticated'](),controller[_0xb71a('0xf')]);router['post']('/',auth[_0xb71a('0x8')](),interaction[_0xb71a('0x10')](_0xb71a('0x11'),'mailmessage:create'),controller[_0xb71a('0x12')]);router['put'](_0xb71a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb71a('0x13')](_0xb71a('0x14'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x15')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xb71a('0x16')]);router[_0xb71a('0x17')](_0xb71a('0xc'),auth[_0xb71a('0x8')](),controller[_0xb71a('0x18')]);module[_0xb71a('0x19')]=router;
\ No newline at end of file
+var _0xa630=['describe','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','create','update','put','/:id/reject','reject','delete','destroy','multer','util','express','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x1f585a,_0xcf8e34){var _0x3e8e6e=function(_0x26be9d){while(--_0x26be9d){_0x1f585a['push'](_0x1f585a['shift']());}};_0x3e8e6e(++_0xcf8e34);}(_0xa630,0xbe));var _0x0a63=function(_0x2565d9,_0x5d61ab){_0x2565d9=_0x2565d9-0x0;var _0x824a3e=_0xa630[_0x2565d9];return _0x824a3e;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var auth=require(_0x0a63('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a63('0x4'));var controller=require(_0x0a63('0x5'));router[_0x0a63('0x6')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0x8')]);router['get'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xa')]);router[_0x0a63('0x6')](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller['show']);router[_0x0a63('0x6')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xd')]);router[_0x0a63('0xe')]('/',auth[_0x0a63('0x7')](),interaction[_0x0a63('0xf')](_0x0a63('0x10'),_0x0a63('0x11')),controller[_0x0a63('0x12')]);router['put'](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x13')]);router[_0x0a63('0x14')]('/:id/accept',auth[_0x0a63('0x7')](),controller['accept']);router[_0x0a63('0x14')](_0x0a63('0x15'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x16')]);router[_0x0a63('0x17')](_0x0a63('0xb'),auth[_0x0a63('0x7')](),controller[_0x0a63('0x18')]);module['exports']=router;
\ No newline at end of file
index d7deeab..1223c68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5b3=['ENUM','out','STRING','DATE','lodash','TEXT','long','BOOLEAN'];(function(_0x358cb7,_0x56cd12){var _0x2e2870=function(_0x245fbf){while(--_0x245fbf){_0x358cb7['push'](_0x358cb7['shift']());}};_0x2e2870(++_0x56cd12);}(_0xf5b3,0x7c));var _0x3f5b=function(_0x35d586,_0x43094a){_0x35d586=_0x35d586-0x0;var _0x4288ae=_0xf5b3[_0x35d586];return _0x4288ae;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3f5b('0x0'));module['exports']={'body':{'type':Sequelize[_0x3f5b('0x1')](_0x3f5b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3f5b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3f5b('0x4')]('in',_0x3f5b('0x5')),'defaultValue':_0x3f5b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3f5b('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x3f5b('0x1')](_0x3f5b('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x3f5b('0x2'))},'bcc':{'type':Sequelize[_0x3f5b('0x1')](_0x3f5b('0x2'))},'subject':{'type':Sequelize[_0x3f5b('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3f5b('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3f5b('0x7')]},'originTo':{'type':Sequelize[_0x3f5b('0x1')](_0x3f5b('0x2'))},'originCc':{'type':Sequelize['TEXT']('long')}};
\ No newline at end of file
+var _0x3e63=['long','BOOLEAN','out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT'];(function(_0x46d4a2,_0x3a21c3){var _0x5e032c=function(_0x14fa1a){while(--_0x14fa1a){_0x46d4a2['push'](_0x46d4a2['shift']());}};_0x5e032c(++_0x3a21c3);}(_0x3e63,0x100));var _0x33e6=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0x3e63[_0x3474ac];return _0x5345ec;};'use strict';var Sequelize=require(_0x33e6('0x0'));var _=require(_0x33e6('0x1'));module[_0x33e6('0x2')]={'body':{'type':Sequelize[_0x33e6('0x3')](_0x33e6('0x4')),'allowNull':![]},'read':{'type':Sequelize[_0x33e6('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x33e6('0x6')),'defaultValue':_0x33e6('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x33e6('0x7')]},'to':{'type':Sequelize[_0x33e6('0x3')](_0x33e6('0x4'))},'cc':{'type':Sequelize[_0x33e6('0x3')](_0x33e6('0x4'))},'bcc':{'type':Sequelize[_0x33e6('0x3')]('long')},'subject':{'type':Sequelize[_0x33e6('0x3')]},'sentAt':{'type':Sequelize[_0x33e6('0x8')]},'attach':{'type':Sequelize[_0x33e6('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x33e6('0x3')](_0x33e6('0x4'))},'originCc':{'type':Sequelize[_0x33e6('0x3')](_0x33e6('0x4'))}};
\ No newline at end of file
index c7621b3..1b30b1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12db=['end','name','MailMessage','rawAttributes','model','query','dateStart','dateEnd','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','day','add','merge','map','type','key','VIRTUAL','field','filter','includeAll','include','show','params','options','find','body','describe','create','direction','secret','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','mail','readAt','UserId','CmContact','Contact','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','channel','accept','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','SIP/%s','event','rejectmessage','download','unix','toString','server','tmp','files','message-%s.eml','from','subject','createdAt','Attachment','Attachments','basename','existsSync','readFileSync','build','writeFileSync','log','unlinkSync','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','count','offset','Content-Range','reject','save','update','destroy'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x12db,0x107));var _0xb12d=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x12db[_0x3c4f1f];return _0x19cb69;};'use strict';var pdf=require(_0xb12d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb12d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb12d('0x2'));var rp=require(_0xb12d('0x3'));var moment=require('moment');var BPromise=require(_0xb12d('0x4'));var Mustache=require(_0xb12d('0x5'));var util=require(_0xb12d('0x6'));var path=require(_0xb12d('0x7'));var sox=require(_0xb12d('0x8'));var csv=require(_0xb12d('0x9'));var ejs=require(_0xb12d('0xa'));var fs=require('fs');var _=require(_0xb12d('0xb'));var squel=require('squel');var crypto=require(_0xb12d('0xc'));var jsforce=require(_0xb12d('0xd'));var deskjs=require(_0xb12d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb12d('0xf'));var Papa=require('papaparse');var Redis=require(_0xb12d('0x10'));var qs=require(_0xb12d('0x11'));var logger=require(_0xb12d('0x12'))(_0xb12d('0x13'));var utils=require('../../config/utils');var config=require(_0xb12d('0x14'));var db=require(_0xb12d('0x15'))['db'];config[_0xb12d('0x16')]=_[_0xb12d('0x17')](config[_0xb12d('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb12d('0x18'))(new Redis(config[_0xb12d('0x16')]));require(_0xb12d('0x19'))[_0xb12d('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb12d('0x1b')]['http']({'port':0x232c});var client9003=jayson[_0xb12d('0x1b')][_0xb12d('0x1c')]({'port':0x232b});var client9002=jayson[_0xb12d('0x1b')][_0xb12d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1b7d50,_0xfdfd1,_0x445d04,_0x5a79b2){return new BPromise(function(_0x39024a,_0x5591a1){var _0x27f10e=_0x5a79b2||client;return _0x27f10e[_0xb12d('0x1d')](_0x1b7d50,_0x445d04)[_0xb12d('0x1e')](function(_0x15f3d5){logger[_0xb12d('0x1f')](_0xb12d('0x20'),_0xfdfd1,'request\x20sent');logger[_0xb12d('0x21')](_0xb12d('0x22'),_0xfdfd1,_0xb12d('0x23'),JSON[_0xb12d('0x24')](_0x15f3d5));if(_0x15f3d5[_0xb12d('0x25')]){if(_0x15f3d5[_0xb12d('0x25')][_0xb12d('0x26')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xfdfd1,_0x15f3d5['error'][_0xb12d('0x27')]);return _0x5591a1(_0x15f3d5[_0xb12d('0x25')][_0xb12d('0x27')]);}logger[_0xb12d('0x25')](_0xb12d('0x20'),_0xfdfd1,_0x15f3d5[_0xb12d('0x25')][_0xb12d('0x27')]);return _0x39024a(_0x15f3d5[_0xb12d('0x25')][_0xb12d('0x27')]);}else{logger[_0xb12d('0x1f')](_0xb12d('0x20'),_0xfdfd1,'request\x20sent');_0x39024a(_0x15f3d5['result'][_0xb12d('0x27')]);}})[_0xb12d('0x28')](function(_0x57a8e8){logger['error'](_0xb12d('0x20'),_0xfdfd1,_0x57a8e8);_0x5591a1(_0x57a8e8);});});}function respondWithStatusCode(_0x19575a,_0x1e444e){_0x1e444e=_0x1e444e||0xcc;return function(_0x432003){if(_0x432003){return _0x19575a[_0xb12d('0x29')](_0x1e444e);}return _0x19575a[_0xb12d('0x2a')](_0x1e444e)['end']();};}function respondWithResult(_0x4af0c4,_0xd9c37){_0xd9c37=_0xd9c37||0xc8;return function(_0x2f4651){if(_0x2f4651){return _0x4af0c4['status'](_0xd9c37)[_0xb12d('0x2b')](_0x2f4651);}};}function respondWithFilteredResult(_0x1f534d,_0x28f908){return function(_0x429ab4){if(_0x429ab4){var _0x2b4d24=_0x429ab4[_0xb12d('0x2c')],_0x336f69=_0x28f908[_0xb12d('0x2d')],_0x3404d6=_0x28f908['offset']+_0x28f908['limit'],_0x20498d;if(_0x3404d6>=_0x2b4d24){_0x3404d6=_0x2b4d24;_0x20498d=0xc8;}else{_0x20498d=0xce;}_0x1f534d['status'](_0x20498d);return _0x1f534d['set'](_0xb12d('0x2e'),_0x336f69+'-'+_0x3404d6+'/'+_0x2b4d24)[_0xb12d('0x2b')](_0x429ab4);}return null;};}function patchUpdates(_0x2c9fc3){return function(_0x1312bd){try{jsonpatch['apply'](_0x1312bd,_0x2c9fc3,!![]);}catch(_0x5dd518){return BPromise[_0xb12d('0x2f')](_0x5dd518);}return _0x1312bd[_0xb12d('0x30')]();};}function saveUpdates(_0x4c5a1e,_0x179285){return function(_0x1fd068){if(_0x1fd068){return _0x1fd068[_0xb12d('0x31')](_0x4c5a1e)[_0xb12d('0x1e')](function(_0x12ed66){return _0x12ed66;});}return null;};}function removeEntity(_0x415111,_0x24463a){return function(_0x4523f0){if(_0x4523f0){return _0x4523f0[_0xb12d('0x32')]()[_0xb12d('0x1e')](function(){_0x415111['status'](0xcc)[_0xb12d('0x33')]();});}};}function handleEntityNotFound(_0x3e602c,_0x484769){return function(_0x4f9e2b){if(!_0x4f9e2b){_0x3e602c[_0xb12d('0x29')](0x194);}return _0x4f9e2b;};}function handleError(_0x4ec0e8,_0x45fc49){_0x45fc49=_0x45fc49||0x1f4;return function(_0x1d2569){logger[_0xb12d('0x25')](_0x1d2569['stack']);if(_0x1d2569[_0xb12d('0x34')]){delete _0x1d2569[_0xb12d('0x34')];}_0x4ec0e8[_0xb12d('0x2a')](_0x45fc49)['send'](_0x1d2569);};}exports['index']=function(_0xb58f74,_0x558b25){var _0x1fd6ef={},_0x3fdfe1={},_0x133389={'count':0x0,'rows':[]};var _0x52ede9=db[_0xb12d('0x35')][_0xb12d('0x36')];_0x3fdfe1[_0xb12d('0x37')]=_['keys'](_0x52ede9);var _0x4dd630={'dateStart':_0xb58f74[_0xb12d('0x38')][_0xb12d('0x39')],'dateEnd':_0xb58f74[_0xb12d('0x38')]['dateEnd']};delete _0xb58f74[_0xb12d('0x38')]['dateStart'];delete _0xb58f74[_0xb12d('0x38')][_0xb12d('0x3a')];_0x3fdfe1['query']=_[_0xb12d('0x3b')](_0xb58f74[_0xb12d('0x38')]);_0x3fdfe1['filters']=_[_0xb12d('0x3c')](_0x3fdfe1[_0xb12d('0x37')],_0x3fdfe1['query']);_0x1fd6ef[_0xb12d('0x3d')]=_['intersection'](_0x3fdfe1[_0xb12d('0x37')],qs[_0xb12d('0x3e')](_0xb58f74[_0xb12d('0x38')][_0xb12d('0x3e')]));_0x1fd6ef['attributes']=_0x1fd6ef[_0xb12d('0x3d')][_0xb12d('0x3f')]?_0x1fd6ef[_0xb12d('0x3d')]:_0x3fdfe1[_0xb12d('0x37')];if(!_0xb58f74[_0xb12d('0x38')]['hasOwnProperty'](_0xb12d('0x40'))){_0x1fd6ef[_0xb12d('0x41')]=qs[_0xb12d('0x41')](_0xb58f74[_0xb12d('0x38')][_0xb12d('0x41')]);_0x1fd6ef[_0xb12d('0x2d')]=qs['offset'](_0xb58f74['query'][_0xb12d('0x2d')]);}_0x1fd6ef[_0xb12d('0x42')]=qs[_0xb12d('0x43')](_0xb58f74[_0xb12d('0x38')][_0xb12d('0x43')]);_0x1fd6ef[_0xb12d('0x44')]=qs['filters'](_[_0xb12d('0x45')](_0xb58f74[_0xb12d('0x38')],_0x3fdfe1[_0xb12d('0x46')]));if(_0x4dd630[_0xb12d('0x39')]){if(_0x4dd630[_0xb12d('0x3a')]){_0x4dd630['dateEnd']=moment(_0x4dd630[_0xb12d('0x3a')])['add'](0x1,_0xb12d('0x47'));}else{_0x4dd630['dateEnd']=moment(_0x4dd630[_0xb12d('0x39')])[_0xb12d('0x48')](0x1,_0xb12d('0x47'));}_[_0xb12d('0x49')](_0x1fd6ef[_0xb12d('0x44')],{'createdAt':{'$gte':_0x4dd630[_0xb12d('0x39')],'$lte':_0x4dd630['dateEnd']}});}if(_0xb58f74[_0xb12d('0x38')]['filter']){_0x1fd6ef['where']=_[_0xb12d('0x49')](_0x1fd6ef[_0xb12d('0x44')],{'$or':_[_0xb12d('0x4a')](_0x52ede9,function(_0x5c4654){if(_0x5c4654[_0xb12d('0x4b')][_0xb12d('0x4c')]!==_0xb12d('0x4d')){var _0x4faa4c={};_0x4faa4c[_0x5c4654[_0xb12d('0x4e')]]={'$like':'%'+_0xb58f74[_0xb12d('0x38')][_0xb12d('0x4f')]+'%'};return _0x4faa4c;}})});}_0x1fd6ef=_['merge']({},_0x1fd6ef,_0xb58f74['options']);var _0x3aa7ee={'where':_0x1fd6ef['where']};return db['MailMessage'][_0xb12d('0x2c')](_0x3aa7ee)[_0xb12d('0x1e')](function(_0x48684e){_0x133389['count']=_0x48684e;if(_0xb58f74[_0xb12d('0x38')][_0xb12d('0x50')]){_0x1fd6ef[_0xb12d('0x51')]=[{'all':!![]}];}return db[_0xb12d('0x35')]['findAll'](_0x1fd6ef);})[_0xb12d('0x1e')](function(_0x4fa36f){_0x133389['rows']=_0x4fa36f;return _0x133389;})[_0xb12d('0x1e')](respondWithFilteredResult(_0x558b25,_0x1fd6ef))[_0xb12d('0x28')](handleError(_0x558b25,null));};exports[_0xb12d('0x52')]=function(_0x5c8dcf,_0x574dfe){var _0x3cdf74={'raw':!![],'where':{'id':_0x5c8dcf[_0xb12d('0x53')]['id']}},_0x35b7ab={};_0x35b7ab[_0xb12d('0x37')]=_[_0xb12d('0x3b')](db[_0xb12d('0x35')][_0xb12d('0x36')]);_0x35b7ab['query']=_[_0xb12d('0x3b')](_0x5c8dcf[_0xb12d('0x38')]);_0x35b7ab[_0xb12d('0x46')]=_[_0xb12d('0x3c')](_0x35b7ab[_0xb12d('0x37')],_0x35b7ab[_0xb12d('0x38')]);_0x3cdf74[_0xb12d('0x3d')]=_['intersection'](_0x35b7ab[_0xb12d('0x37')],qs[_0xb12d('0x3e')](_0x5c8dcf[_0xb12d('0x38')][_0xb12d('0x3e')]));_0x3cdf74[_0xb12d('0x3d')]=_0x3cdf74[_0xb12d('0x3d')][_0xb12d('0x3f')]?_0x3cdf74['attributes']:_0x35b7ab['model'];if(_0x5c8dcf[_0xb12d('0x38')]['includeAll']){_0x3cdf74[_0xb12d('0x51')]=[{'all':!![]}];}_0x3cdf74=_[_0xb12d('0x49')]({},_0x3cdf74,_0x5c8dcf[_0xb12d('0x54')]);return db[_0xb12d('0x35')][_0xb12d('0x55')](_0x3cdf74)['then'](handleEntityNotFound(_0x574dfe,null))['then'](respondWithResult(_0x574dfe,null))['catch'](handleError(_0x574dfe,null));};exports[_0xb12d('0x31')]=function(_0x3966f4,_0x592cc4){if(_0x3966f4[_0xb12d('0x56')]['id']){delete _0x3966f4[_0xb12d('0x56')]['id'];}return db['MailMessage'][_0xb12d('0x55')]({'where':{'id':_0x3966f4[_0xb12d('0x53')]['id']}})[_0xb12d('0x1e')](handleEntityNotFound(_0x592cc4,null))[_0xb12d('0x1e')](saveUpdates(_0x3966f4[_0xb12d('0x56')],null))[_0xb12d('0x1e')](respondWithResult(_0x592cc4,null))[_0xb12d('0x28')](handleError(_0x592cc4,null));};exports[_0xb12d('0x32')]=function(_0x13e518,_0x4871f5){return db[_0xb12d('0x35')]['find']({'where':{'id':_0x13e518['params']['id']}})['then'](handleEntityNotFound(_0x4871f5,null))[_0xb12d('0x1e')](removeEntity(_0x4871f5,null))[_0xb12d('0x28')](handleError(_0x4871f5,null));};exports['describe']=function(_0x50305c,_0x3b917a){return db[_0xb12d('0x35')][_0xb12d('0x57')]()[_0xb12d('0x1e')](respondWithResult(_0x3b917a,null))[_0xb12d('0x28')](handleError(_0x3b917a,null));};exports[_0xb12d('0x58')]=function(_0x3374f3,_0x17d895){return db['MailMessage']['create'](_0x3374f3[_0xb12d('0x56')])['then'](function(_0x50b3b6){if(_0x50b3b6){if(_0x50b3b6[_0xb12d('0x59')]==='out'&&!_0x50b3b6[_0xb12d('0x5a')]){return db['MailAccount'][_0xb12d('0x5b')]({'where':{'id':_0x50b3b6[_0xb12d('0x5c')]},'include':[{'model':db[_0xb12d('0x5d')],'as':_0xb12d('0x5e'),'raw':!![]}]})[_0xb12d('0x1e')](function(_0x6e5704){if(_0x6e5704&&_0x6e5704[_0xb12d('0x5e')]){var _0x1e5eef={'tls':{'rejectUnauthorized':![]}};if(_[_0xb12d('0x5f')](_0x6e5704['Smtp'][_0xb12d('0x60')])){_0x1e5eef['host']=_0x6e5704['Smtp'][_0xb12d('0x61')];_0x1e5eef[_0xb12d('0x62')]=_0x6e5704[_0xb12d('0x5e')][_0xb12d('0x62')];_0x1e5eef[_0xb12d('0x63')]=_0x6e5704[_0xb12d('0x5e')][_0xb12d('0x63')];if(_0x6e5704['Smtp'][_0xb12d('0x64')]){_0x1e5eef[_0xb12d('0x65')]={'user':_0x6e5704[_0xb12d('0x5e')][_0xb12d('0x66')],'pass':_0x6e5704[_0xb12d('0x5e')][_0xb12d('0x67')]};}}else{_0x1e5eef[_0xb12d('0x60')]=_0x6e5704[_0xb12d('0x5e')][_0xb12d('0x60')];_0x1e5eef[_0xb12d('0x65')]={'user':_0x6e5704[_0xb12d('0x5e')][_0xb12d('0x66')],'pass':_0x6e5704['Smtp'][_0xb12d('0x67')]};_0x1e5eef['secure']=_0x6e5704['Smtp'][_0xb12d('0x63')];}if(_0x3374f3[_0xb12d('0x56')][_0xb12d('0x68')]&&_0x3374f3[_0xb12d('0x56')][_0xb12d('0x68')][_0xb12d('0x3f')]){for(var _0x5e07ca=0x0;_0x5e07ca<_0x3374f3[_0xb12d('0x56')][_0xb12d('0x68')][_0xb12d('0x3f')];_0x5e07ca+=0x1){_0x3374f3['body']['attachments'][_0x5e07ca]={'filename':_0x3374f3[_0xb12d('0x56')][_0xb12d('0x68')][_0x5e07ca][_0xb12d('0x34')],'path':path[_0xb12d('0x69')](config[_0xb12d('0x6a')],'server/files/attachments',_0x3374f3[_0xb12d('0x56')][_0xb12d('0x68')][_0x5e07ca]['basename'])};}}return{'account':_0x1e5eef,'message':_0x3374f3[_0xb12d('0x56')]};}})['then'](function(_0x12160a){if(_0x12160a){return respondWithRpcPromise(_0xb12d('0x6b'),_0xb12d('0x6c'),_0x12160a,client9003)['then'](function(_0x43d714){return _0x50b3b6[_0xb12d('0x31')]({'read':!![],'messageId':_0x43d714[_0xb12d('0x6d')],'sentAt':moment()[_0xb12d('0x6e')](_0xb12d('0x6f'))});})[_0xb12d('0x28')](function(_0x3b29d0){logger['error']('%s',JSON[_0xb12d('0x24')](_0x3b29d0));return _0x50b3b6;});}return _0x50b3b6;});}return _0x50b3b6;}})[_0xb12d('0x1e')](respondWithResult(_0x17d895,0xc9))['catch'](handleError(_0x17d895,null));};var interaction_log=require(_0xb12d('0x12'))(_0xb12d('0x70'));exports['accept']=function(_0x3e2532,_0x573340,_0x10c498){var _0x353e3a={'channel':_0xb12d('0x71')};if(_0x3e2532['body']['id']){delete _0x3e2532[_0xb12d('0x56')]['id'];}_0x3e2532[_0xb12d('0x56')]['read']=!![];_0x3e2532['body'][_0xb12d('0x72')]=moment()['format'](_0xb12d('0x6f'));_0x3e2532[_0xb12d('0x56')][_0xb12d('0x73')]=_0x3e2532['body']['UserId']||_0x3e2532[_0xb12d('0x66')]['id'];return db[_0xb12d('0x35')][_0xb12d('0x55')]({'where':{'id':_0x3e2532['params']['id'],'UserId':null},'include':[{'model':db[_0xb12d('0x74')],'as':_0xb12d('0x75')}]})[_0xb12d('0x1e')](handleEntityNotFound(_0x573340,null))[_0xb12d('0x1e')](saveUpdates(_0x3e2532[_0xb12d('0x56')],null))[_0xb12d('0x1e')](function(_0xe01966){if(_0xe01966){_0x353e3a[_0xb12d('0x27')]=_0xe01966[_0xb12d('0x76')]({'plain':!![]});return db[_0xb12d('0x77')][_0xb12d('0x55')]({'where':{'id':_0xe01966['MailInteractionId']}});}return null;})[_0xb12d('0x1e')](handleEntityNotFound(_0x573340,null))['then'](function(_0x47eea0){if(_0x47eea0){return _0x47eea0[_0xb12d('0x31')]({'UserId':_0x3e2532[_0xb12d('0x56')][_0xb12d('0x73')],'read1stAt':_[_0xb12d('0x5f')](_0x47eea0[_0xb12d('0x78')])?moment()[_0xb12d('0x6e')](_0xb12d('0x6f')):undefined});}return null;})[_0xb12d('0x1e')](function(_0x42fc10){if(_0x42fc10){_0x353e3a[_0xb12d('0x79')]=_0x42fc10[_0xb12d('0x76')]({'plain':!![]});interaction_log[_0xb12d('0x1f')](_0xb12d('0x7a'),_0x3e2532['user']['id'],_0x3e2532['user']['name'],_0x3e2532[_0xb12d('0x66')][_0xb12d('0x7b')],_0x353e3a[_0xb12d('0x79')]['id'],_0x3e2532[_0xb12d('0x56')]?JSON['stringify'](_0x3e2532['body']):'null');return respondWithRpcPromise(_0xb12d('0x7c'),_0xb12d('0x7d'),_0x353e3a);}return null;})['then'](function(_0x1e29f3){if(_0x1e29f3){if(_0x3e2532[_0xb12d('0x56')][_0xb12d('0x7e')]){_0x353e3a[_0xb12d('0x27')]['interface']=util['format']('SIP/%s',_0x3e2532[_0xb12d('0x66')]['name']);_0x353e3a['message']['channel']=_0x353e3a[_0xb12d('0x7f')];_0x353e3a['message']['event']=_0xb12d('0x80');return respondWithRpcPromise('EventManager',_0xb12d('0x81'),{'event':_0xb12d('0x82'),'message':_0x353e3a['message']},client9002)[_0xb12d('0x1e')](function(){return _0x353e3a;});}return _0x353e3a;}return null;})[_0xb12d('0x1e')](respondWithResult(_0x573340,null))[_0xb12d('0x28')](handleError(_0x573340,null));};var interaction_log=require(_0xb12d('0x12'))('mail-interactions');exports[_0xb12d('0x2f')]=function(_0x5b4af4,_0x13bd10,_0x28a171){var _0xde6389={'agent':{},'channel':_0xb12d('0x71')};if(_0x5b4af4[_0xb12d('0x56')]['id']){delete _0x5b4af4[_0xb12d('0x56')]['id'];}_0x5b4af4['body']['UserId']=_0x5b4af4['body']['UserId']||_0x5b4af4['user']['id'];_0xde6389[_0xb12d('0x83')]['id']=_0x5b4af4['body'][_0xb12d('0x73')];return db[_0xb12d('0x35')][_0xb12d('0x55')]({'where':{'id':_0x5b4af4['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13bd10,null))[_0xb12d('0x1e')](function(_0x406cf9){if(_0x406cf9){_0xde6389['message']=_0x406cf9[_0xb12d('0x76')]({'plain':!![]});return db[_0xb12d('0x77')][_0xb12d('0x55')]({'where':{'id':_0x406cf9['MailInteractionId']}});}return null;})[_0xb12d('0x1e')](handleEntityNotFound(_0x13bd10,null))['then'](function(_0x508fdb){if(_0x508fdb){_0xde6389[_0xb12d('0x79')]=_0x508fdb['get']({'plain':!![]});interaction_log[_0xb12d('0x1f')](_0xb12d('0x84'),_0x5b4af4[_0xb12d('0x66')]['id'],_0x5b4af4[_0xb12d('0x66')][_0xb12d('0x34')],_0x5b4af4[_0xb12d('0x66')][_0xb12d('0x7b')],_0xde6389[_0xb12d('0x79')]['id'],_0x5b4af4[_0xb12d('0x56')]?JSON[_0xb12d('0x24')](_0x5b4af4[_0xb12d('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0xb12d('0x85'),_0xde6389);}return null;})['then'](function(_0x3030b8){if(_0x3030b8){_0x3030b8[_0xb12d('0x27')][_0xb12d('0x86')]=util[_0xb12d('0x6e')](_0xb12d('0x87'),_0x5b4af4[_0xb12d('0x66')]['name']);_0x3030b8[_0xb12d('0x27')][_0xb12d('0x7f')]=_0xde6389[_0xb12d('0x7f')];_0x3030b8[_0xb12d('0x27')][_0xb12d('0x88')]=_0xb12d('0x2f');respondWithRpcPromise(_0xb12d('0x81'),'EventManager',{'event':_0xb12d('0x89'),'message':_0x3030b8[_0xb12d('0x27')]},client9002);return _0xde6389;}return null;})['then'](respondWithResult(_0x13bd10,null))[_0xb12d('0x28')](handleError(_0x13bd10,null));};exports[_0xb12d('0x8a')]=function(_0x47b74f,_0x55ed48){var _0x126847=moment()[_0xb12d('0x8b')]()[_0xb12d('0x8c')]();var _0x1b4474=path[_0xb12d('0x69')](config[_0xb12d('0x6a')],_0xb12d('0x8d'),'files',_0xb12d('0x8e'));var _0x35625d=path[_0xb12d('0x69')](config[_0xb12d('0x6a')],'server',_0xb12d('0x8f'),'attachments');var _0x4c51ff=util[_0xb12d('0x6e')](_0xb12d('0x90'),_0x126847);return db[_0xb12d('0x35')]['find']({'where':{'id':_0x47b74f[_0xb12d('0x53')]['id']},'attributes':['id',_0xb12d('0x56'),_0xb12d('0x91'),'to','cc',_0xb12d('0x92'),_0xb12d('0x93')],'include':_0x47b74f[_0xb12d('0x38')][_0xb12d('0x68')]?[{'model':db[_0xb12d('0x94')],'as':_0xb12d('0x95')}]:undefined})['then'](handleEntityNotFound(_0x55ed48,null))[_0xb12d('0x1e')](function(_0x5ab461){if(_0x5ab461){var _0x579379=_0x5ab461;var _0x350a32={'from':_0x579379['from'],'to':_0x579379['to'],'subject':_0x579379['subject'],'html':_0x579379['body'],'attachments':[]};return new BPromise(function(_0x1e7372,_0x58fef8){if(_0x5ab461[_0xb12d('0x95')]){for(var _0x2785a2=0x0;_0x2785a2<_0x5ab461[_0xb12d('0x95')]['length'];_0x2785a2++){var _0x15a0d4=_0x5ab461[_0xb12d('0x95')][_0x2785a2];var _0x5814d4=path[_0xb12d('0x69')](_0x35625d,_0x15a0d4[_0xb12d('0x96')]);if(fs[_0xb12d('0x97')](_0x5814d4)){_0x350a32[_0xb12d('0x68')]['push']({'name':_0x15a0d4[_0xb12d('0x34')],'contentType':_0x15a0d4[_0xb12d('0x4b')],'data':fs[_0xb12d('0x98')](_0x5814d4)});}}}emlformat[_0xb12d('0x99')](_0x350a32,function(_0x3e4867,_0x31570e){if(_0x3e4867)return _0x58fef8(_0x3e4867);fs[_0xb12d('0x9a')](path['join'](_0x1b4474,_0x4c51ff),_0x31570e);return _0x1e7372(_0x31570e);});});}})['then'](function(_0x4436b1){if(_0x4436b1){return _0x55ed48[_0xb12d('0x8a')](path['join'](_0x1b4474,_0x4c51ff),_0x4c51ff,function(_0x4b28f4){if(_0x4b28f4){console[_0xb12d('0x9b')]('err',_0x4b28f4);}else{fs[_0xb12d('0x9c')](path[_0xb12d('0x69')](_0x1b4474,_0x4c51ff));}});}})[_0xb12d('0x28')](handleError(_0x55ed48,null));};
\ No newline at end of file
+var _0xa22c=['fast-json-patch','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','destroy','name','send','index','rawAttributes','keys','dateStart','query','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','add','day','merge','filter','type','key','VIRTUAL','field','options','MailMessage','includeAll','include','findAll','rows','catch','show','params','update','body','find','describe','create','out','secret','MailAccount','MailAccountId','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','basename','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','read','UserId','CmContact','Contact','MailInteraction','MailInteractionId','isNil','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','mail','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','subject','createdAt','Attachments','from','existsSync','push','readFileSync','build','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa22c,0x130));var _0xca22=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa22c[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0xca22('0x0'));var emlformat=require(_0xca22('0x1'));var rimraf=require(_0xca22('0x2'));var zipdir=require(_0xca22('0x3'));var jsonpatch=require(_0xca22('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xca22('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xca22('0x6'));var sox=require(_0xca22('0x7'));var csv=require(_0xca22('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xca22('0x9'));var squel=require(_0xca22('0xa'));var crypto=require(_0xca22('0xb'));var jsforce=require(_0xca22('0xc'));var deskjs=require(_0xca22('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca22('0xe'));var Redis=require(_0xca22('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0xca22('0x10'))(_0xca22('0x11'));var utils=require(_0xca22('0x12'));var config=require(_0xca22('0x13'));var db=require('../../mysqldb')['db'];config[_0xca22('0x14')]=_[_0xca22('0x15')](config[_0xca22('0x14')],{'host':_0xca22('0x16'),'port':0x18eb});var socket=require(_0xca22('0x17'))(new Redis(config[_0xca22('0x14')]));require(_0xca22('0x18'))[_0xca22('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xca22('0x1a')][_0xca22('0x1b')]({'port':0x232c});var client9003=jayson[_0xca22('0x1a')][_0xca22('0x1b')]({'port':0x232b});var client9002=jayson[_0xca22('0x1a')][_0xca22('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x53269b,_0x156464,_0x521791,_0x53cd1f){return new BPromise(function(_0x96a150,_0x469a54){var _0x56a079=_0x53cd1f||client;return _0x56a079['request'](_0x53269b,_0x521791)[_0xca22('0x1c')](function(_0x4a2963){logger[_0xca22('0x1d')]('MailMessage,\x20%s,\x20%s',_0x156464,_0xca22('0x1e'));logger[_0xca22('0x1f')](_0xca22('0x20'),_0x156464,_0xca22('0x1e'),JSON[_0xca22('0x21')](_0x4a2963));if(_0x4a2963[_0xca22('0x22')]){if(_0x4a2963[_0xca22('0x22')][_0xca22('0x23')]===0x1f4){logger[_0xca22('0x22')](_0xca22('0x24'),_0x156464,_0x4a2963[_0xca22('0x22')][_0xca22('0x25')]);return _0x469a54(_0x4a2963[_0xca22('0x22')][_0xca22('0x25')]);}logger[_0xca22('0x22')](_0xca22('0x24'),_0x156464,_0x4a2963[_0xca22('0x22')]['message']);return _0x96a150(_0x4a2963[_0xca22('0x22')][_0xca22('0x25')]);}else{logger[_0xca22('0x1d')](_0xca22('0x24'),_0x156464,_0xca22('0x1e'));_0x96a150(_0x4a2963['result'][_0xca22('0x25')]);}})['catch'](function(_0x331f64){logger[_0xca22('0x22')](_0xca22('0x24'),_0x156464,_0x331f64);_0x469a54(_0x331f64);});});}function respondWithStatusCode(_0x3443cf,_0x299d9c){_0x299d9c=_0x299d9c||0xcc;return function(_0x25314f){if(_0x25314f){return _0x3443cf[_0xca22('0x26')](_0x299d9c);}return _0x3443cf[_0xca22('0x27')](_0x299d9c)[_0xca22('0x28')]();};}function respondWithResult(_0x10564a,_0x71c79f){_0x71c79f=_0x71c79f||0xc8;return function(_0x10255d){if(_0x10255d){return _0x10564a[_0xca22('0x27')](_0x71c79f)['json'](_0x10255d);}};}function respondWithFilteredResult(_0x55b30a,_0x4380ee){return function(_0x17f9e2){if(_0x17f9e2){var _0x4ce389=_0x17f9e2[_0xca22('0x29')],_0xd13e10=_0x4380ee[_0xca22('0x2a')],_0x2a27a8=_0x4380ee[_0xca22('0x2a')]+_0x4380ee[_0xca22('0x2b')],_0x67da19;if(_0x2a27a8>=_0x4ce389){_0x2a27a8=_0x4ce389;_0x67da19=0xc8;}else{_0x67da19=0xce;}_0x55b30a[_0xca22('0x27')](_0x67da19);return _0x55b30a[_0xca22('0x2c')](_0xca22('0x2d'),_0xd13e10+'-'+_0x2a27a8+'/'+_0x4ce389)[_0xca22('0x2e')](_0x17f9e2);}return null;};}function patchUpdates(_0x5e0625){return function(_0x1bccce){try{jsonpatch['apply'](_0x1bccce,_0x5e0625,!![]);}catch(_0x41f8ef){return BPromise[_0xca22('0x2f')](_0x41f8ef);}return _0x1bccce[_0xca22('0x30')]();};}function saveUpdates(_0xd05e83,_0x4fb011){return function(_0x5cc123){if(_0x5cc123){return _0x5cc123['update'](_0xd05e83)[_0xca22('0x1c')](function(_0x435389){return _0x435389;});}return null;};}function removeEntity(_0x189e2,_0x52e908){return function(_0x4db013){if(_0x4db013){return _0x4db013[_0xca22('0x31')]()[_0xca22('0x1c')](function(){_0x189e2['status'](0xcc)[_0xca22('0x28')]();});}};}function handleEntityNotFound(_0x457d46,_0x40de2e){return function(_0x38e836){if(!_0x38e836){_0x457d46[_0xca22('0x26')](0x194);}return _0x38e836;};}function handleError(_0x28750c,_0x1d73eb){_0x1d73eb=_0x1d73eb||0x1f4;return function(_0x3f91ea){logger[_0xca22('0x22')](_0x3f91ea['stack']);if(_0x3f91ea[_0xca22('0x32')]){delete _0x3f91ea['name'];}_0x28750c['status'](_0x1d73eb)[_0xca22('0x33')](_0x3f91ea);};}exports[_0xca22('0x34')]=function(_0x23d4e1,_0x20d9f6){var _0x2be5e0={},_0xd049b3={},_0x43b6d5={'count':0x0,'rows':[]};var _0x9926b7=db['MailMessage'][_0xca22('0x35')];_0xd049b3['model']=_[_0xca22('0x36')](_0x9926b7);var _0x189f08={'dateStart':_0x23d4e1['query'][_0xca22('0x37')],'dateEnd':_0x23d4e1[_0xca22('0x38')][_0xca22('0x39')]};delete _0x23d4e1[_0xca22('0x38')][_0xca22('0x37')];delete _0x23d4e1[_0xca22('0x38')][_0xca22('0x39')];_0xd049b3['query']=_[_0xca22('0x36')](_0x23d4e1['query']);_0xd049b3[_0xca22('0x3a')]=_[_0xca22('0x3b')](_0xd049b3[_0xca22('0x3c')],_0xd049b3['query']);_0x2be5e0[_0xca22('0x3d')]=_[_0xca22('0x3b')](_0xd049b3[_0xca22('0x3c')],qs[_0xca22('0x3e')](_0x23d4e1[_0xca22('0x38')][_0xca22('0x3e')]));_0x2be5e0['attributes']=_0x2be5e0['attributes'][_0xca22('0x3f')]?_0x2be5e0['attributes']:_0xd049b3[_0xca22('0x3c')];if(!_0x23d4e1[_0xca22('0x38')][_0xca22('0x40')]('nolimit')){_0x2be5e0[_0xca22('0x2b')]=qs[_0xca22('0x2b')](_0x23d4e1[_0xca22('0x38')]['limit']);_0x2be5e0[_0xca22('0x2a')]=qs[_0xca22('0x2a')](_0x23d4e1[_0xca22('0x38')][_0xca22('0x2a')]);}_0x2be5e0['order']=qs['sort'](_0x23d4e1['query'][_0xca22('0x41')]);_0x2be5e0[_0xca22('0x42')]=qs[_0xca22('0x3a')](_['pick'](_0x23d4e1['query'],_0xd049b3['filters']));if(_0x189f08[_0xca22('0x37')]){if(_0x189f08[_0xca22('0x39')]){_0x189f08[_0xca22('0x39')]=moment(_0x189f08[_0xca22('0x39')])[_0xca22('0x43')](0x1,_0xca22('0x44'));}else{_0x189f08[_0xca22('0x39')]=moment(_0x189f08[_0xca22('0x37')])[_0xca22('0x43')](0x1,_0xca22('0x44'));}_[_0xca22('0x45')](_0x2be5e0[_0xca22('0x42')],{'createdAt':{'$gte':_0x189f08[_0xca22('0x37')],'$lte':_0x189f08[_0xca22('0x39')]}});}if(_0x23d4e1[_0xca22('0x38')][_0xca22('0x46')]){_0x2be5e0['where']=_[_0xca22('0x45')](_0x2be5e0['where'],{'$or':_['map'](_0x9926b7,function(_0x37a721){if(_0x37a721[_0xca22('0x47')][_0xca22('0x48')]!==_0xca22('0x49')){var _0x2f1ac0={};_0x2f1ac0[_0x37a721[_0xca22('0x4a')]]={'$like':'%'+_0x23d4e1[_0xca22('0x38')][_0xca22('0x46')]+'%'};return _0x2f1ac0;}})});}_0x2be5e0=_[_0xca22('0x45')]({},_0x2be5e0,_0x23d4e1[_0xca22('0x4b')]);var _0x242e19={'where':_0x2be5e0['where']};return db[_0xca22('0x4c')][_0xca22('0x29')](_0x242e19)['then'](function(_0x420c75){_0x43b6d5['count']=_0x420c75;if(_0x23d4e1['query'][_0xca22('0x4d')]){_0x2be5e0[_0xca22('0x4e')]=[{'all':!![]}];}return db[_0xca22('0x4c')][_0xca22('0x4f')](_0x2be5e0);})[_0xca22('0x1c')](function(_0x1bf41e){_0x43b6d5[_0xca22('0x50')]=_0x1bf41e;return _0x43b6d5;})[_0xca22('0x1c')](respondWithFilteredResult(_0x20d9f6,_0x2be5e0))[_0xca22('0x51')](handleError(_0x20d9f6,null));};exports[_0xca22('0x52')]=function(_0x53fba5,_0x12fb82){var _0x11d4aa={'raw':!![],'where':{'id':_0x53fba5[_0xca22('0x53')]['id']}},_0xa8a2c3={};_0xa8a2c3[_0xca22('0x3c')]=_[_0xca22('0x36')](db[_0xca22('0x4c')][_0xca22('0x35')]);_0xa8a2c3['query']=_['keys'](_0x53fba5[_0xca22('0x38')]);_0xa8a2c3[_0xca22('0x3a')]=_[_0xca22('0x3b')](_0xa8a2c3['model'],_0xa8a2c3[_0xca22('0x38')]);_0x11d4aa['attributes']=_['intersection'](_0xa8a2c3[_0xca22('0x3c')],qs[_0xca22('0x3e')](_0x53fba5[_0xca22('0x38')][_0xca22('0x3e')]));_0x11d4aa[_0xca22('0x3d')]=_0x11d4aa[_0xca22('0x3d')][_0xca22('0x3f')]?_0x11d4aa[_0xca22('0x3d')]:_0xa8a2c3[_0xca22('0x3c')];if(_0x53fba5[_0xca22('0x38')][_0xca22('0x4d')]){_0x11d4aa[_0xca22('0x4e')]=[{'all':!![]}];}_0x11d4aa=_[_0xca22('0x45')]({},_0x11d4aa,_0x53fba5['options']);return db[_0xca22('0x4c')]['find'](_0x11d4aa)[_0xca22('0x1c')](handleEntityNotFound(_0x12fb82,null))[_0xca22('0x1c')](respondWithResult(_0x12fb82,null))[_0xca22('0x51')](handleError(_0x12fb82,null));};exports[_0xca22('0x54')]=function(_0x2e6ae5,_0x80f3be){if(_0x2e6ae5[_0xca22('0x55')]['id']){delete _0x2e6ae5[_0xca22('0x55')]['id'];}return db[_0xca22('0x4c')][_0xca22('0x56')]({'where':{'id':_0x2e6ae5['params']['id']}})[_0xca22('0x1c')](handleEntityNotFound(_0x80f3be,null))[_0xca22('0x1c')](saveUpdates(_0x2e6ae5['body'],null))[_0xca22('0x1c')](respondWithResult(_0x80f3be,null))[_0xca22('0x51')](handleError(_0x80f3be,null));};exports[_0xca22('0x31')]=function(_0x51e47b,_0x4aefa4){return db[_0xca22('0x4c')][_0xca22('0x56')]({'where':{'id':_0x51e47b[_0xca22('0x53')]['id']}})[_0xca22('0x1c')](handleEntityNotFound(_0x4aefa4,null))[_0xca22('0x1c')](removeEntity(_0x4aefa4,null))[_0xca22('0x51')](handleError(_0x4aefa4,null));};exports[_0xca22('0x57')]=function(_0x4f368e,_0x9c06f3){return db[_0xca22('0x4c')][_0xca22('0x57')]()[_0xca22('0x1c')](respondWithResult(_0x9c06f3,null))[_0xca22('0x51')](handleError(_0x9c06f3,null));};exports[_0xca22('0x58')]=function(_0x19d448,_0x3ca907){return db[_0xca22('0x4c')][_0xca22('0x58')](_0x19d448[_0xca22('0x55')])[_0xca22('0x1c')](function(_0x473bc2){if(_0x473bc2){if(_0x473bc2['direction']===_0xca22('0x59')&&!_0x473bc2[_0xca22('0x5a')]){return db[_0xca22('0x5b')]['findOne']({'where':{'id':_0x473bc2[_0xca22('0x5c')]},'include':[{'model':db[_0xca22('0x5d')],'as':_0xca22('0x5e'),'raw':!![]}]})[_0xca22('0x1c')](function(_0x169d6a){if(_0x169d6a&&_0x169d6a['Smtp']){var _0xbb49b4={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x169d6a[_0xca22('0x5e')][_0xca22('0x5f')])){_0xbb49b4[_0xca22('0x60')]=_0x169d6a[_0xca22('0x5e')]['host'];_0xbb49b4[_0xca22('0x61')]=_0x169d6a['Smtp'][_0xca22('0x61')];_0xbb49b4[_0xca22('0x62')]=_0x169d6a['Smtp']['secure'];if(_0x169d6a[_0xca22('0x5e')][_0xca22('0x63')]){_0xbb49b4[_0xca22('0x64')]={'user':_0x169d6a[_0xca22('0x5e')][_0xca22('0x65')],'pass':_0x169d6a[_0xca22('0x5e')][_0xca22('0x66')]};}}else{_0xbb49b4['service']=_0x169d6a[_0xca22('0x5e')][_0xca22('0x5f')];_0xbb49b4['auth']={'user':_0x169d6a[_0xca22('0x5e')][_0xca22('0x65')],'pass':_0x169d6a[_0xca22('0x5e')][_0xca22('0x66')]};_0xbb49b4[_0xca22('0x62')]=_0x169d6a[_0xca22('0x5e')][_0xca22('0x62')];}if(_0x19d448[_0xca22('0x55')][_0xca22('0x67')]&&_0x19d448[_0xca22('0x55')][_0xca22('0x67')][_0xca22('0x3f')]){for(var _0x44ade6=0x0;_0x44ade6<_0x19d448[_0xca22('0x55')]['attachments']['length'];_0x44ade6+=0x1){_0x19d448[_0xca22('0x55')]['attachments'][_0x44ade6]={'filename':_0x19d448['body'][_0xca22('0x67')][_0x44ade6][_0xca22('0x32')],'path':path[_0xca22('0x68')](config[_0xca22('0x69')],'server/files/attachments',_0x19d448[_0xca22('0x55')]['attachments'][_0x44ade6][_0xca22('0x6a')])};}}return{'account':_0xbb49b4,'message':_0x19d448[_0xca22('0x55')]};}})[_0xca22('0x1c')](function(_0x363e39){if(_0x363e39){return respondWithRpcPromise('SendMail','sendMail',_0x363e39,client9003)['then'](function(_0x2ca929){return _0x473bc2[_0xca22('0x54')]({'read':!![],'messageId':_0x2ca929[_0xca22('0x6b')],'sentAt':moment()[_0xca22('0x6c')](_0xca22('0x6d'))});})[_0xca22('0x51')](function(_0x3ff7a9){logger[_0xca22('0x22')]('%s',JSON[_0xca22('0x21')](_0x3ff7a9));return _0x473bc2;});}return _0x473bc2;});}return _0x473bc2;}})[_0xca22('0x1c')](respondWithResult(_0x3ca907,0xc9))['catch'](handleError(_0x3ca907,null));};var interaction_log=require(_0xca22('0x10'))(_0xca22('0x6e'));exports[_0xca22('0x6f')]=function(_0x1a65e8,_0x47633a,_0x5ba336){var _0x415631={'channel':'mail'};if(_0x1a65e8[_0xca22('0x55')]['id']){delete _0x1a65e8[_0xca22('0x55')]['id'];}_0x1a65e8[_0xca22('0x55')][_0xca22('0x70')]=!![];_0x1a65e8['body']['readAt']=moment()[_0xca22('0x6c')](_0xca22('0x6d'));_0x1a65e8[_0xca22('0x55')][_0xca22('0x71')]=_0x1a65e8[_0xca22('0x55')][_0xca22('0x71')]||_0x1a65e8['user']['id'];return db[_0xca22('0x4c')][_0xca22('0x56')]({'where':{'id':_0x1a65e8['params']['id'],'UserId':null},'include':[{'model':db[_0xca22('0x72')],'as':_0xca22('0x73')}]})[_0xca22('0x1c')](handleEntityNotFound(_0x47633a,null))[_0xca22('0x1c')](saveUpdates(_0x1a65e8['body'],null))['then'](function(_0x2bd6ee){if(_0x2bd6ee){_0x415631[_0xca22('0x25')]=_0x2bd6ee['get']({'plain':!![]});return db[_0xca22('0x74')][_0xca22('0x56')]({'where':{'id':_0x2bd6ee[_0xca22('0x75')]}});}return null;})['then'](handleEntityNotFound(_0x47633a,null))[_0xca22('0x1c')](function(_0x3d8ec8){if(_0x3d8ec8){return _0x3d8ec8[_0xca22('0x54')]({'UserId':_0x1a65e8[_0xca22('0x55')][_0xca22('0x71')],'read1stAt':_[_0xca22('0x76')](_0x3d8ec8['read1stAt'])?moment()[_0xca22('0x6c')](_0xca22('0x6d')):undefined});}return null;})[_0xca22('0x1c')](function(_0x13947a){if(_0x13947a){_0x415631[_0xca22('0x77')]=_0x13947a[_0xca22('0x78')]({'plain':!![]});interaction_log[_0xca22('0x1d')](_0xca22('0x79'),_0x1a65e8['user']['id'],_0x1a65e8[_0xca22('0x65')][_0xca22('0x32')],_0x1a65e8[_0xca22('0x65')][_0xca22('0x7a')],_0x415631[_0xca22('0x77')]['id'],_0x1a65e8[_0xca22('0x55')]?JSON['stringify'](_0x1a65e8['body']):_0xca22('0x7b'));return respondWithRpcPromise(_0xca22('0x7c'),_0xca22('0x7d'),_0x415631);}return null;})[_0xca22('0x1c')](function(_0x22196c){if(_0x22196c){if(_0x1a65e8['body'][_0xca22('0x7e')]){_0x415631[_0xca22('0x25')][_0xca22('0x7f')]=util[_0xca22('0x6c')](_0xca22('0x80'),_0x1a65e8[_0xca22('0x65')][_0xca22('0x32')]);_0x415631['message'][_0xca22('0x81')]=_0x415631[_0xca22('0x81')];_0x415631['message']['event']='accept';return respondWithRpcPromise(_0xca22('0x82'),_0xca22('0x82'),{'event':'acceptmessage','message':_0x415631[_0xca22('0x25')]},client9002)[_0xca22('0x1c')](function(){return _0x415631;});}return _0x415631;}return null;})[_0xca22('0x1c')](respondWithResult(_0x47633a,null))['catch'](handleError(_0x47633a,null));};var interaction_log=require(_0xca22('0x10'))('mail-interactions');exports[_0xca22('0x2f')]=function(_0x49b89b,_0x12a5e9,_0x35c39a){var _0x132ecf={'agent':{},'channel':_0xca22('0x83')};if(_0x49b89b[_0xca22('0x55')]['id']){delete _0x49b89b[_0xca22('0x55')]['id'];}_0x49b89b[_0xca22('0x55')]['UserId']=_0x49b89b['body']['UserId']||_0x49b89b[_0xca22('0x65')]['id'];_0x132ecf[_0xca22('0x84')]['id']=_0x49b89b[_0xca22('0x55')][_0xca22('0x71')];return db[_0xca22('0x4c')][_0xca22('0x56')]({'where':{'id':_0x49b89b['params']['id'],'UserId':null}})[_0xca22('0x1c')](handleEntityNotFound(_0x12a5e9,null))[_0xca22('0x1c')](function(_0x5b713d){if(_0x5b713d){_0x132ecf['message']=_0x5b713d[_0xca22('0x78')]({'plain':!![]});return db[_0xca22('0x74')][_0xca22('0x56')]({'where':{'id':_0x5b713d[_0xca22('0x75')]}});}return null;})[_0xca22('0x1c')](handleEntityNotFound(_0x12a5e9,null))[_0xca22('0x1c')](function(_0x1c80c3){if(_0x1c80c3){_0x132ecf[_0xca22('0x77')]=_0x1c80c3['get']({'plain':!![]});interaction_log[_0xca22('0x1d')](_0xca22('0x85'),_0x49b89b[_0xca22('0x65')]['id'],_0x49b89b['user'][_0xca22('0x32')],_0x49b89b[_0xca22('0x65')][_0xca22('0x7a')],_0x132ecf[_0xca22('0x77')]['id'],_0x49b89b['body']?JSON[_0xca22('0x21')](_0x49b89b[_0xca22('0x55')]):_0xca22('0x7b'));return respondWithRpcPromise(_0xca22('0x86'),'rejectMessage',_0x132ecf);}return null;})[_0xca22('0x1c')](function(_0x362632){if(_0x362632){_0x362632[_0xca22('0x25')][_0xca22('0x7f')]=util[_0xca22('0x6c')](_0xca22('0x80'),_0x49b89b[_0xca22('0x65')][_0xca22('0x32')]);_0x362632[_0xca22('0x25')][_0xca22('0x81')]=_0x132ecf[_0xca22('0x81')];_0x362632[_0xca22('0x25')]['event']=_0xca22('0x2f');respondWithRpcPromise(_0xca22('0x82'),'EventManager',{'event':_0xca22('0x87'),'message':_0x362632['message']},client9002);return _0x132ecf;}return null;})[_0xca22('0x1c')](respondWithResult(_0x12a5e9,null))[_0xca22('0x51')](handleError(_0x12a5e9,null));};exports['download']=function(_0x41cf4,_0x58e3d7){var _0x3892b8=moment()[_0xca22('0x88')]()[_0xca22('0x89')]();var _0x1b62ae=path[_0xca22('0x68')](config[_0xca22('0x69')],_0xca22('0x8a'),_0xca22('0x8b'),_0xca22('0x8c'));var _0x56bea6=path[_0xca22('0x68')](config[_0xca22('0x69')],_0xca22('0x8a'),_0xca22('0x8b'),_0xca22('0x67'));var _0x1764e5=util['format'](_0xca22('0x8d'),_0x3892b8);return db[_0xca22('0x4c')][_0xca22('0x56')]({'where':{'id':_0x41cf4[_0xca22('0x53')]['id']},'attributes':['id',_0xca22('0x55'),'from','to','cc',_0xca22('0x8e'),_0xca22('0x8f')],'include':_0x41cf4['query'][_0xca22('0x67')]?[{'model':db['Attachment'],'as':_0xca22('0x90')}]:undefined})[_0xca22('0x1c')](handleEntityNotFound(_0x58e3d7,null))['then'](function(_0x4b5e76){if(_0x4b5e76){var _0x13cdb4=_0x4b5e76;var _0x59719b={'from':_0x13cdb4[_0xca22('0x91')],'to':_0x13cdb4['to'],'subject':_0x13cdb4[_0xca22('0x8e')],'html':_0x13cdb4[_0xca22('0x55')],'attachments':[]};return new BPromise(function(_0x481236,_0x389500){if(_0x4b5e76[_0xca22('0x90')]){for(var _0x19f735=0x0;_0x19f735<_0x4b5e76['Attachments'][_0xca22('0x3f')];_0x19f735++){var _0x13a4f2=_0x4b5e76[_0xca22('0x90')][_0x19f735];var _0x3917b8=path['join'](_0x56bea6,_0x13a4f2[_0xca22('0x6a')]);if(fs[_0xca22('0x92')](_0x3917b8)){_0x59719b[_0xca22('0x67')][_0xca22('0x93')]({'name':_0x13a4f2[_0xca22('0x32')],'contentType':_0x13a4f2[_0xca22('0x47')],'data':fs[_0xca22('0x94')](_0x3917b8)});}}}emlformat[_0xca22('0x95')](_0x59719b,function(_0x1db438,_0x4d55af){if(_0x1db438)return _0x389500(_0x1db438);fs['writeFileSync'](path[_0xca22('0x68')](_0x1b62ae,_0x1764e5),_0x4d55af);return _0x481236(_0x4d55af);});});}})[_0xca22('0x1c')](function(_0x322861){if(_0x322861){return _0x58e3d7[_0xca22('0x96')](path[_0xca22('0x68')](_0x1b62ae,_0x1764e5),_0x1764e5,function(_0x496199){if(_0x496199){console[_0xca22('0x97')](_0xca22('0x98'),_0x496199);}else{fs[_0xca22('0x99')](path['join'](_0x1b62ae,_0x1764e5));}});}})[_0xca22('0x51')](handleError(_0x58e3d7,null));};
\ No newline at end of file
index 569254d..b335188 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc3=['hook','exports','events','MailMessage','save','update','emit','hasOwnProperty'];(function(_0x4789b3,_0x4f98e1){var _0x27b5c1=function(_0x1c1056){while(--_0x1c1056){_0x4789b3['push'](_0x4789b3['shift']());}};_0x27b5c1(++_0x4f98e1);}(_0x8bc3,0x82));var _0x38bc=function(_0x5e2a0f,_0x447ab4){_0x5e2a0f=_0x5e2a0f-0x0;var _0x3e8c10=_0x8bc3[_0x5e2a0f];return _0x3e8c10;};'use strict';var EventEmitter=require(_0x38bc('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x38bc('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x38bc('0x2'),'afterUpdate':_0x38bc('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38862e){return function(_0x24ad99,_0x20d785,_0x265fd7){MailMessageEvents['emit'](_0x38862e+':'+_0x24ad99['id'],_0x24ad99);MailMessageEvents[_0x38bc('0x4')](_0x38862e,_0x24ad99);_0x265fd7(null);};}for(var e in events){if(events[_0x38bc('0x5')](e)){var event=events[e];MailMessage[_0x38bc('0x6')](e,emitEvent(event));}}module[_0x38bc('0x7')]=MailMessageEvents;
\ No newline at end of file
+var _0x38e4=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xb7e7df,_0x5f0fae){var _0x45d689=function(_0x3244f1){while(--_0x3244f1){_0xb7e7df['push'](_0xb7e7df['shift']());}};_0x45d689(++_0x5f0fae);}(_0x38e4,0x9e));var _0x438e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x38e4[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0x438e('0x0'));var MailMessage=require(_0x438e('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x438e('0x2')](0x0);var events={'afterCreate':_0x438e('0x3'),'afterUpdate':'update','afterDestroy':_0x438e('0x4')};function emitEvent(_0x27e5d9){return function(_0x387d68,_0x5ec55c,_0x2ac738){MailMessageEvents[_0x438e('0x5')](_0x27e5d9+':'+_0x387d68['id'],_0x387d68);MailMessageEvents[_0x438e('0x5')](_0x27e5d9,_0x387d68);_0x2ac738(null);};}for(var e in events){if(events[_0x438e('0x6')](e)){var event=events[e];MailMessage[_0x438e('0x7')](e,emitEvent(event));}}module[_0x438e('0x8')]=MailMessageEvents;
\ No newline at end of file
index c94602e..e7ff71e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','utf8mb4'];(function(_0x982824,_0x1edf88){var _0x50a65a=function(_0x2aa471){while(--_0x2aa471){_0x982824['push'](_0x982824['shift']());}};_0x50a65a(++_0x1edf88);}(_0x6f0d,0xeb));var _0xd6f0=function(_0x384d7b,_0x2475bf){_0x384d7b=_0x384d7b-0x0;var _0x389b7e=_0x6f0d[_0x384d7b];return _0x389b7e;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require(_0xd6f0('0x4'));var rp=require(_0xd6f0('0x5'));var attributes=require(_0xd6f0('0x6'));module['exports']=function(_0x326310,_0x1ed64d){return _0x326310[_0xd6f0('0x7')](_0xd6f0('0x8'),attributes,{'tableName':_0xd6f0('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd6f0('0xa')]}],'timestamps':!![],'charset':_0xd6f0('0xb'),'collate':_0xd6f0('0xc')});};
\ No newline at end of file
+var _0x4a1e=['mail_messages','messageId','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','./mailMessage.attributes','define','MailMessage'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4a1e,0xd0));var _0xe4a1=function(_0x5bb4e8,_0x44b756){_0x5bb4e8=_0x5bb4e8-0x0;var _0x2a86f2=_0x4a1e[_0x5bb4e8];return _0x2a86f2;};'use strict';var _=require('lodash');var util=require(_0xe4a1('0x0'));var logger=require('../../config/logger')(_0xe4a1('0x1'));var moment=require(_0xe4a1('0x2'));var BPromise=require(_0xe4a1('0x3'));var rp=require(_0xe4a1('0x4'));var attributes=require(_0xe4a1('0x5'));module['exports']=function(_0x41d483,_0x53476d){return _0x41d483[_0xe4a1('0x6')](_0xe4a1('0x7'),attributes,{'tableName':_0xe4a1('0x8'),'paranoid':![],'indexes':[{'name':_0xe4a1('0x9'),'fields':[_0xe4a1('0x9')]}],'timestamps':!![],'charset':_0xe4a1('0xa'),'collate':_0xe4a1('0xb')});};
\ No newline at end of file
index bf21619..58b3831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63b6=['../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','debug','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x31c81b,_0x4a2b1c){var _0x52ab34=function(_0x2e6c48){while(--_0x2e6c48){_0x31c81b['push'](_0x31c81b['shift']());}};_0x52ab34(++_0x4a2b1c);}(_0x63b6,0x127));var _0x663b=function(_0x102b2b,_0x45d45e){_0x102b2b=_0x102b2b-0x0;var _0x55db93=_0x63b6[_0x102b2b];return _0x55db93;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var moment=require(_0x663b('0x2'));var BPromise=require('bluebird');var rs=require(_0x663b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x663b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x663b('0x5'))(_0x663b('0x6'));var config=require(_0x663b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x663b('0x8')]['http']({'port':0x232a});config[_0x663b('0x9')]=_['defaults'](config[_0x663b('0x9')],{'host':_0x663b('0xa'),'port':0x18eb});var socket=require(_0x663b('0xb'))(new Redis(config[_0x663b('0x9')]));require(_0x663b('0xc'))[_0x663b('0xd')](socket);function respondWithRpcPromise(_0x4a9838,_0x31106e,_0x1a00e3){return new BPromise(function(_0x1d0dba,_0x213994){return client[_0x663b('0xe')](_0x4a9838,_0x1a00e3)[_0x663b('0xf')](function(_0xb70cbe){logger[_0x663b('0x10')](_0x663b('0x11'),_0x31106e,_0x663b('0x12'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x31106e,_0x663b('0x12'),JSON[_0x663b('0x13')](_0xb70cbe));if(_0xb70cbe[_0x663b('0x14')]){if(_0xb70cbe[_0x663b('0x14')][_0x663b('0x15')]===0x1f4){logger[_0x663b('0x14')]('MailMessage,\x20%s,\x20%s',_0x31106e,_0xb70cbe[_0x663b('0x14')][_0x663b('0x16')]);return _0x213994(_0xb70cbe[_0x663b('0x14')][_0x663b('0x16')]);}logger[_0x663b('0x14')](_0x663b('0x11'),_0x31106e,_0xb70cbe[_0x663b('0x14')][_0x663b('0x16')]);return _0x1d0dba(_0xb70cbe[_0x663b('0x14')][_0x663b('0x16')]);}else{logger[_0x663b('0x10')](_0x663b('0x11'),_0x31106e,_0x663b('0x12'));_0x1d0dba(_0xb70cbe[_0x663b('0x17')]['message']);}})[_0x663b('0x18')](function(_0x455dd5){logger['error'](_0x663b('0x11'),_0x31106e,_0x455dd5);_0x213994(_0x455dd5);});});}exports[_0x663b('0x19')]=function(_0x50786f){var _0x593db6=this;return new Promise(function(_0x1f7dd9,_0x12a5b7){return db[_0x663b('0x1a')][_0x663b('0x1b')](_0x50786f['body'],{'raw':_0x50786f[_0x663b('0x1c')]?_0x50786f[_0x663b('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x521a89){logger['info'](_0x663b('0x19'),_0x50786f);logger[_0x663b('0x1d')](_0x663b('0x19'),_0x50786f,JSON[_0x663b('0x13')](_0x521a89));_0x1f7dd9(_0x521a89);})[_0x663b('0x18')](function(_0x43b58a){logger[_0x663b('0x14')](_0x663b('0x19'),_0x43b58a[_0x663b('0x16')],_0x50786f);_0x12a5b7(_0x593db6['error'](0x1f4,_0x43b58a[_0x663b('0x16')]));});});};
\ No newline at end of file
+var _0x86f4=['code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d37d1,_0x2a8a4d){var _0x37683b=function(_0x38a04b){while(--_0x38a04b){_0x5d37d1['push'](_0x5d37d1['shift']());}};_0x37683b(++_0x2a8a4d);}(_0x86f4,0x18a));var _0x486f=function(_0x319f62,_0x4f619c){_0x319f62=_0x319f62-0x0;var _0x374629=_0x86f4[_0x319f62];return _0x374629;};'use strict';var _=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var moment=require(_0x486f('0x2'));var BPromise=require(_0x486f('0x3'));var rs=require(_0x486f('0x4'));var fs=require('fs');var Redis=require(_0x486f('0x5'));var db=require(_0x486f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x486f('0x7'))(_0x486f('0x8'));var config=require('../../config/environment');var jayson=require(_0x486f('0x9'));var client=jayson[_0x486f('0xa')][_0x486f('0xb')]({'port':0x232a});config[_0x486f('0xc')]=_[_0x486f('0xd')](config[_0x486f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x486f('0xe'))(new Redis(config[_0x486f('0xc')]));require(_0x486f('0xf'))[_0x486f('0x10')](socket);function respondWithRpcPromise(_0x377d09,_0x362036,_0x19ccdd){return new BPromise(function(_0x1e4118,_0x37cf58){return client[_0x486f('0x11')](_0x377d09,_0x19ccdd)[_0x486f('0x12')](function(_0x12e2c1){logger[_0x486f('0x13')](_0x486f('0x14'),_0x362036,_0x486f('0x15'));logger[_0x486f('0x16')](_0x486f('0x17'),_0x362036,'request\x20sent',JSON[_0x486f('0x18')](_0x12e2c1));if(_0x12e2c1['error']){if(_0x12e2c1[_0x486f('0x19')][_0x486f('0x1a')]===0x1f4){logger[_0x486f('0x19')]('MailMessage,\x20%s,\x20%s',_0x362036,_0x12e2c1['error'][_0x486f('0x1b')]);return _0x37cf58(_0x12e2c1[_0x486f('0x19')]['message']);}logger[_0x486f('0x19')](_0x486f('0x14'),_0x362036,_0x12e2c1[_0x486f('0x19')]['message']);return _0x1e4118(_0x12e2c1['error'][_0x486f('0x1b')]);}else{logger[_0x486f('0x13')](_0x486f('0x14'),_0x362036,_0x486f('0x15'));_0x1e4118(_0x12e2c1['result']['message']);}})[_0x486f('0x1c')](function(_0x9518){logger[_0x486f('0x19')](_0x486f('0x14'),_0x362036,_0x9518);_0x37cf58(_0x9518);});});}exports[_0x486f('0x1d')]=function(_0x243dbf){var _0x1c3887=this;return new Promise(function(_0xdba591,_0xe0b1cc){return db[_0x486f('0x1e')][_0x486f('0x1f')](_0x243dbf[_0x486f('0x20')],{'raw':_0x243dbf[_0x486f('0x21')]?_0x243dbf[_0x486f('0x21')][_0x486f('0x22')]===undefined?!![]:![]:!![]})[_0x486f('0x12')](function(_0x4d784e){logger[_0x486f('0x13')](_0x486f('0x1d'),_0x243dbf);logger[_0x486f('0x16')](_0x486f('0x1d'),_0x243dbf,JSON[_0x486f('0x18')](_0x4d784e));_0xdba591(_0x4d784e);})[_0x486f('0x1c')](function(_0x37d89f){logger[_0x486f('0x19')](_0x486f('0x1d'),_0x37d89f[_0x486f('0x1b')],_0x243dbf);_0xe0b1cc(_0x1c3887[_0x486f('0x19')](0x1f4,_0x37d89f[_0x486f('0x1b')]));});});};
\ No newline at end of file
index 7b33d1a..77e9af4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fc3=['emit','removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x3ad614,_0x5286da){var _0x2c620d=function(_0x41fc6e){while(--_0x41fc6e){_0x3ad614['push'](_0x3ad614['shift']());}};_0x2c620d(++_0x5286da);}(_0x9fc3,0xcb));var _0x39fc=function(_0x476b2c,_0x36b29c){_0x476b2c=_0x476b2c-0x0;var _0x2dc822=_0x9fc3[_0x476b2c];return _0x2dc822;};'use strict';var MailMessageEvents=require(_0x39fc('0x0'));var events=[_0x39fc('0x1'),_0x39fc('0x2'),_0x39fc('0x3')];function createListener(_0x293689,_0x5c6007){return function(_0x504c52){_0x5c6007[_0x39fc('0x4')](_0x293689,_0x504c52);};}function removeListener(_0xe79d81,_0x59808d){return function(){MailMessageEvents[_0x39fc('0x5')](_0xe79d81,_0x59808d);};}exports[_0x39fc('0x6')]=function(_0x1ad379){for(var _0x4496d0=0x0,_0x39d163=events[_0x39fc('0x7')];_0x4496d0<_0x39d163;_0x4496d0++){var _0x4e70fa=events[_0x4496d0];var _0x108460=createListener(_0x39fc('0x8')+_0x4e70fa,_0x1ad379);MailMessageEvents['on'](_0x4e70fa,_0x108460);}};
\ No newline at end of file
+var _0x4973=['emit','removeListener','length','./mailMessage.events','save','remove','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4973,0x73));var _0x3497=function(_0x9f9816,_0x579b0e){_0x9f9816=_0x9f9816-0x0;var _0x40a913=_0x4973[_0x9f9816];return _0x40a913;};'use strict';var MailMessageEvents=require(_0x3497('0x0'));var events=[_0x3497('0x1'),_0x3497('0x2'),_0x3497('0x3')];function createListener(_0x40eaec,_0x16b2a5){return function(_0x3156e9){_0x16b2a5[_0x3497('0x4')](_0x40eaec,_0x3156e9);};}function removeListener(_0x4d9313,_0x251bc0){return function(){MailMessageEvents[_0x3497('0x5')](_0x4d9313,_0x251bc0);};}exports['register']=function(_0xfce5e3){for(var _0x27e994=0x0,_0x89eaa4=events[_0x3497('0x6')];_0x27e994<_0x89eaa4;_0x27e994++){var _0x337153=events[_0x27e994];var _0x46c248=createListener('mailMessage:'+_0x337153,_0xfce5e3);MailMessageEvents['on'](_0x337153,_0x46c248);}};
\ No newline at end of file
index ec76b25..f079347 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf518=['post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','path','express','Router','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x338cff,_0x26894f){var _0x4892d6=function(_0x3f0876){while(--_0x3f0876){_0x338cff['push'](_0x338cff['shift']());}};_0x4892d6(++_0x26894f);}(_0xf518,0x18f));var _0x8f51=function(_0x59b2a1,_0x1f631f){_0x59b2a1=_0x59b2a1-0x0;var _0x4908d1=_0xf518[_0x59b2a1];return _0x4908d1;};'use strict';var multer=require('multer');var util=require(_0x8f51('0x0'));var path=require(_0x8f51('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f51('0x2'));var router=express[_0x8f51('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8f51('0x4'));var config=require('../../config/environment');var controller=require(_0x8f51('0x5'));router[_0x8f51('0x6')]('/',auth[_0x8f51('0x7')](),controller[_0x8f51('0x8')]);router[_0x8f51('0x6')](_0x8f51('0x9'),auth[_0x8f51('0x7')](),controller['describe']);router[_0x8f51('0x6')](_0x8f51('0xa'),auth[_0x8f51('0x7')](),controller[_0x8f51('0xb')]);router[_0x8f51('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0x8f51('0xc')]);router['get'](_0x8f51('0xd'),auth['isAuthenticated'](),controller[_0x8f51('0xe')]);router[_0x8f51('0x6')](_0x8f51('0xf'),auth[_0x8f51('0x7')](),controller[_0x8f51('0x10')]);router[_0x8f51('0x11')]('/',auth[_0x8f51('0x7')](),controller[_0x8f51('0x12')]);router[_0x8f51('0x11')](_0x8f51('0xd'),auth['isAuthenticated'](),controller['addTeams']);router[_0x8f51('0x11')](_0x8f51('0xf'),auth['isAuthenticated'](),controller[_0x8f51('0x13')]);router[_0x8f51('0x14')](_0x8f51('0xa'),auth[_0x8f51('0x7')](),controller[_0x8f51('0x15')]);router[_0x8f51('0x16')](_0x8f51('0xa'),auth['isAuthenticated'](),controller[_0x8f51('0x17')]);router[_0x8f51('0x16')]('/:id/teams',auth[_0x8f51('0x7')](),controller[_0x8f51('0x18')]);router['delete'](_0x8f51('0xf'),auth[_0x8f51('0x7')](),controller[_0x8f51('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x86e5=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','getAgents','post','create','/:id/teams','addTeams','/:id/users','put','delete','removeAgents','exports','multer','util'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x86e5,0x15c));var _0x586e=function(_0x21ed71,_0x3fca8e){_0x21ed71=_0x21ed71-0x0;var _0x515130=_0x86e5[_0x21ed71];return _0x515130;};'use strict';var multer=require(_0x586e('0x0'));var util=require(_0x586e('0x1'));var path=require(_0x586e('0x2'));var timeout=require(_0x586e('0x3'));var express=require(_0x586e('0x4'));var router=express['Router']();var auth=require(_0x586e('0x5'));var interaction=require(_0x586e('0x6'));var config=require('../../config/environment');var controller=require(_0x586e('0x7'));router[_0x586e('0x8')]('/',auth[_0x586e('0x9')](),controller[_0x586e('0xa')]);router[_0x586e('0x8')]('/describe',auth[_0x586e('0x9')](),controller[_0x586e('0xb')]);router[_0x586e('0x8')](_0x586e('0xc'),auth[_0x586e('0x9')](),controller['show']);router[_0x586e('0x8')](_0x586e('0xd'),auth[_0x586e('0x9')](),controller[_0x586e('0xe')]);router['get']('/:id/teams',auth[_0x586e('0x9')](),controller['getTeams']);router[_0x586e('0x8')]('/:id/users',auth[_0x586e('0x9')](),controller[_0x586e('0xf')]);router[_0x586e('0x10')]('/',auth[_0x586e('0x9')](),controller[_0x586e('0x11')]);router['post'](_0x586e('0x12'),auth[_0x586e('0x9')](),controller[_0x586e('0x13')]);router['post'](_0x586e('0x14'),auth[_0x586e('0x9')](),controller['addAgents']);router[_0x586e('0x15')](_0x586e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x586e('0x16')](_0x586e('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x586e('0x16')](_0x586e('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x586e('0x14'),auth['isAuthenticated'](),controller[_0x586e('0x17')]);module[_0x586e('0x18')]=router;
\ No newline at end of file
index c36bfbe..94dc873 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae5=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x4bb541,_0xfe74c5){var _0x30958f=function(_0x41ed68){while(--_0x41ed68){_0x4bb541['push'](_0x4bb541['shift']());}};_0x30958f(++_0xfe74c5);}(_0x1ae5,0x1f4));var _0x51ae=function(_0x33af97,_0x28a560){_0x33af97=_0x33af97-0x0;var _0x4729b1=_0x1ae5[_0x33af97];return _0x4729b1;};'use strict';var Sequelize=require(_0x51ae('0x0'));module[_0x51ae('0x1')]={'name':{'type':Sequelize[_0x51ae('0x2')],'unique':_0x51ae('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x51ae('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x51ae('0x5'),_0x51ae('0x6'),_0x51ae('0x7'))}};
\ No newline at end of file
+var _0x0b84=['beepall','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0b84,0x112));var _0x40b8=function(_0x5ba74f,_0x200bf4){_0x5ba74f=_0x5ba74f-0x0;var _0x534d79=_0x0b84[_0x5ba74f];return _0x534d79;};'use strict';var Sequelize=require(_0x40b8('0x0'));module[_0x40b8('0x1')]={'name':{'type':Sequelize[_0x40b8('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x40b8('0x2')]},'timeout':{'type':Sequelize[_0x40b8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x40b8('0x4')](_0x40b8('0x5'),_0x40b8('0x6'),'roundrobin')}};
\ No newline at end of file
index e77253d..b65cea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fb4=['include','params','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','addAgents','removeTeams','union','removeAgents','omit','spread','userMailQueue:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','json','count','offset','limit','set','apply','save','then','destroy','MailQueues','UserProfileResource','error','stack','name','index','MailQueue','rawAttributes','model','query','dateEnd','dateStart','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','add','day','merge','map','type','VIRTUAL','field','filter','includeAll'];(function(_0x579f8,_0x4c0de5){var _0x2d2d64=function(_0x4cd9bb){while(--_0x4cd9bb){_0x579f8['push'](_0x579f8['shift']());}};_0x2d2d64(++_0x4c0de5);}(_0x4fb4,0x190));var _0x44fb=function(_0x14d6eb,_0x11359b){_0x14d6eb=_0x14d6eb-0x0;var _0x4f8df1=_0x4fb4[_0x14d6eb];return _0x4f8df1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x44fb('0x0'));var rimraf=require(_0x44fb('0x1'));var zipdir=require(_0x44fb('0x2'));var jsonpatch=require(_0x44fb('0x3'));var rp=require(_0x44fb('0x4'));var moment=require(_0x44fb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x44fb('0x6'));var util=require(_0x44fb('0x7'));var path=require(_0x44fb('0x8'));var sox=require(_0x44fb('0x9'));var csv=require(_0x44fb('0xa'));var ejs=require(_0x44fb('0xb'));var fs=require('fs');var _=require(_0x44fb('0xc'));var squel=require(_0x44fb('0xd'));var crypto=require('crypto');var jsforce=require(_0x44fb('0xe'));var deskjs=require(_0x44fb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x44fb('0x10'));var Papa=require(_0x44fb('0x11'));var Redis=require(_0x44fb('0x12'));var qs=require(_0x44fb('0x13'));var logger=require(_0x44fb('0x14'))(_0x44fb('0x15'));var utils=require(_0x44fb('0x16'));var config=require(_0x44fb('0x17'));var db=require(_0x44fb('0x18'))['db'];config[_0x44fb('0x19')]=_['defaults'](config[_0x44fb('0x19')],{'host':_0x44fb('0x1a'),'port':0x18eb});var socket=require(_0x44fb('0x1b'))(new Redis(config[_0x44fb('0x19')]));require(_0x44fb('0x1c'))['register'](socket);function respondWithStatusCode(_0x1fc8fa,_0xaedd7f){_0xaedd7f=_0xaedd7f||0xcc;return function(_0x39fb83){if(_0x39fb83){return _0x1fc8fa[_0x44fb('0x1d')](_0xaedd7f);}return _0x1fc8fa[_0x44fb('0x1e')](_0xaedd7f)['end']();};}function respondWithResult(_0xbc84db,_0x18268c){_0x18268c=_0x18268c||0xc8;return function(_0x472658){if(_0x472658){return _0xbc84db[_0x44fb('0x1e')](_0x18268c)[_0x44fb('0x1f')](_0x472658);}};}function respondWithFilteredResult(_0x43ce3,_0x19b828){return function(_0x585559){if(_0x585559){var _0x2c622f=_0x585559[_0x44fb('0x20')],_0x21886d=_0x19b828[_0x44fb('0x21')],_0x2e0efd=_0x19b828[_0x44fb('0x21')]+_0x19b828[_0x44fb('0x22')],_0x13cf75;if(_0x2e0efd>=_0x2c622f){_0x2e0efd=_0x2c622f;_0x13cf75=0xc8;}else{_0x13cf75=0xce;}_0x43ce3[_0x44fb('0x1e')](_0x13cf75);return _0x43ce3[_0x44fb('0x23')]('Content-Range',_0x21886d+'-'+_0x2e0efd+'/'+_0x2c622f)['json'](_0x585559);}return null;};}function patchUpdates(_0x4b50f5){return function(_0x4188f9){try{jsonpatch[_0x44fb('0x24')](_0x4188f9,_0x4b50f5,!![]);}catch(_0x2dd412){return BPromise['reject'](_0x2dd412);}return _0x4188f9[_0x44fb('0x25')]();};}function saveUpdates(_0x11449d,_0x3394e2){return function(_0x5adc98){if(_0x5adc98){return _0x5adc98['update'](_0x11449d)[_0x44fb('0x26')](function(_0x5cf7ec){return _0x5cf7ec;});}return null;};}function removeEntity(_0x441d79,_0x4fc66d){return function(_0x954b1d){if(_0x954b1d){return _0x954b1d[_0x44fb('0x27')]()[_0x44fb('0x26')](function(){var _0x4a27b6=_0x954b1d['get']({'plain':!![]});var _0x105b88=_0x44fb('0x28');return db[_0x44fb('0x29')][_0x44fb('0x27')]({'where':{'type':_0x105b88,'resourceId':_0x4a27b6['id']}})['then'](function(){return _0x954b1d;});})[_0x44fb('0x26')](function(){_0x441d79[_0x44fb('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b6ce5,_0x4aaab6){return function(_0x2611d6){if(!_0x2611d6){_0x5b6ce5[_0x44fb('0x1d')](0x194);}return _0x2611d6;};}function handleError(_0x1f5d4c,_0xb7e5e8){_0xb7e5e8=_0xb7e5e8||0x1f4;return function(_0x15e748){logger[_0x44fb('0x2a')](_0x15e748[_0x44fb('0x2b')]);if(_0x15e748[_0x44fb('0x2c')]){delete _0x15e748['name'];}_0x1f5d4c['status'](_0xb7e5e8)['send'](_0x15e748);};}exports[_0x44fb('0x2d')]=function(_0x4a957f,_0x14099b){var _0x253e16={},_0x5e3639={},_0x212b10={'count':0x0,'rows':[]};var _0x262aa1=db[_0x44fb('0x2e')][_0x44fb('0x2f')];_0x5e3639[_0x44fb('0x30')]=_['keys'](_0x262aa1);var _0x50ce63={'dateStart':_0x4a957f[_0x44fb('0x31')]['dateStart'],'dateEnd':_0x4a957f[_0x44fb('0x31')][_0x44fb('0x32')]};delete _0x4a957f[_0x44fb('0x31')][_0x44fb('0x33')];delete _0x4a957f[_0x44fb('0x31')][_0x44fb('0x32')];_0x5e3639[_0x44fb('0x31')]=_[_0x44fb('0x34')](_0x4a957f[_0x44fb('0x31')]);_0x5e3639[_0x44fb('0x35')]=_[_0x44fb('0x36')](_0x5e3639[_0x44fb('0x30')],_0x5e3639[_0x44fb('0x31')]);_0x253e16[_0x44fb('0x37')]=_[_0x44fb('0x36')](_0x5e3639['model'],qs['fields'](_0x4a957f['query'][_0x44fb('0x38')]));_0x253e16[_0x44fb('0x37')]=_0x253e16[_0x44fb('0x37')][_0x44fb('0x39')]?_0x253e16['attributes']:_0x5e3639[_0x44fb('0x30')];if(!_0x4a957f[_0x44fb('0x31')]['hasOwnProperty'](_0x44fb('0x3a'))){_0x253e16['limit']=qs[_0x44fb('0x22')](_0x4a957f['query'][_0x44fb('0x22')]);_0x253e16['offset']=qs[_0x44fb('0x21')](_0x4a957f['query']['offset']);}_0x253e16[_0x44fb('0x3b')]=qs[_0x44fb('0x3c')](_0x4a957f[_0x44fb('0x31')][_0x44fb('0x3c')]);_0x253e16[_0x44fb('0x3d')]=qs[_0x44fb('0x35')](_[_0x44fb('0x3e')](_0x4a957f[_0x44fb('0x31')],_0x5e3639[_0x44fb('0x35')]));if(_0x50ce63[_0x44fb('0x33')]){if(_0x50ce63['dateEnd']){_0x50ce63[_0x44fb('0x32')]=moment(_0x50ce63[_0x44fb('0x32')])[_0x44fb('0x3f')](0x1,_0x44fb('0x40'));}else{_0x50ce63[_0x44fb('0x32')]=moment(_0x50ce63['dateStart'])[_0x44fb('0x3f')](0x1,_0x44fb('0x40'));}_['merge'](_0x253e16['where'],{'createdAt':{'$gte':_0x50ce63[_0x44fb('0x33')],'$lte':_0x50ce63[_0x44fb('0x32')]}});}if(_0x4a957f[_0x44fb('0x31')]['filter']){_0x253e16[_0x44fb('0x3d')]=_[_0x44fb('0x41')](_0x253e16[_0x44fb('0x3d')],{'$or':_[_0x44fb('0x42')](_0x262aa1,function(_0x8f8aae){if(_0x8f8aae[_0x44fb('0x43')]['key']!==_0x44fb('0x44')){var _0x537535={};_0x537535[_0x8f8aae[_0x44fb('0x45')]]={'$like':'%'+_0x4a957f[_0x44fb('0x31')][_0x44fb('0x46')]+'%'};return _0x537535;}})});}_0x253e16=_[_0x44fb('0x41')]({},_0x253e16,_0x4a957f['options']);var _0x322269={'where':_0x253e16[_0x44fb('0x3d')]};return db[_0x44fb('0x2e')][_0x44fb('0x20')](_0x322269)[_0x44fb('0x26')](function(_0x5b38e0){_0x212b10[_0x44fb('0x20')]=_0x5b38e0;if(_0x4a957f[_0x44fb('0x31')][_0x44fb('0x47')]){_0x253e16[_0x44fb('0x48')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x253e16);})[_0x44fb('0x26')](function(_0x439725){_0x212b10['rows']=_0x439725;return _0x212b10;})[_0x44fb('0x26')](respondWithFilteredResult(_0x14099b,_0x253e16))['catch'](handleError(_0x14099b,null));};exports['show']=function(_0x5519d9,_0x5d5317){var _0x396bdc={'raw':!![],'where':{'id':_0x5519d9[_0x44fb('0x49')]['id']}},_0x1a7acd={};_0x1a7acd[_0x44fb('0x30')]=_['keys'](db[_0x44fb('0x2e')][_0x44fb('0x2f')]);_0x1a7acd[_0x44fb('0x31')]=_[_0x44fb('0x34')](_0x5519d9[_0x44fb('0x31')]);_0x1a7acd[_0x44fb('0x35')]=_[_0x44fb('0x36')](_0x1a7acd[_0x44fb('0x30')],_0x1a7acd['query']);_0x396bdc[_0x44fb('0x37')]=_['intersection'](_0x1a7acd['model'],qs[_0x44fb('0x38')](_0x5519d9[_0x44fb('0x31')][_0x44fb('0x38')]));_0x396bdc['attributes']=_0x396bdc[_0x44fb('0x37')][_0x44fb('0x39')]?_0x396bdc[_0x44fb('0x37')]:_0x1a7acd[_0x44fb('0x30')];if(_0x5519d9[_0x44fb('0x31')][_0x44fb('0x47')]){_0x396bdc[_0x44fb('0x48')]=[{'all':!![]}];}_0x396bdc=_['merge']({},_0x396bdc,_0x5519d9[_0x44fb('0x4a')]);return db['MailQueue'][_0x44fb('0x4b')](_0x396bdc)['then'](handleEntityNotFound(_0x5d5317,null))[_0x44fb('0x26')](respondWithResult(_0x5d5317,null))[_0x44fb('0x4c')](handleError(_0x5d5317,null));};exports[_0x44fb('0x4d')]=function(_0x82975,_0x5847e8){return db[_0x44fb('0x2e')][_0x44fb('0x4d')](_0x82975[_0x44fb('0x4e')],{})[_0x44fb('0x26')](function(_0x20094d){var _0x32b166=_0x82975[_0x44fb('0x4f')][_0x44fb('0x50')]({'plain':!![]});if(!_0x32b166)throw new Error(_0x44fb('0x51'));if(_0x32b166[_0x44fb('0x52')]===_0x44fb('0x4f')){var _0x2ebfc7=_0x20094d['get']({'plain':!![]});var _0x2dcdf6='MailQueues';return db[_0x44fb('0x53')][_0x44fb('0x4b')]({'where':{'name':_0x2dcdf6,'userProfileId':_0x32b166['userProfileId']},'raw':!![]})['then'](function(_0x4ff11b){if(_0x4ff11b&&_0x4ff11b[_0x44fb('0x54')]===0x0){return db[_0x44fb('0x29')][_0x44fb('0x4d')]({'name':_0x2ebfc7[_0x44fb('0x2c')],'resourceId':_0x2ebfc7['id'],'type':_0x4ff11b[_0x44fb('0x2c')],'sectionId':_0x4ff11b['id']},{})[_0x44fb('0x26')](function(){return _0x20094d;});}else{return _0x20094d;}})[_0x44fb('0x4c')](function(_0x3c0c8c){logger[_0x44fb('0x2a')](_0x44fb('0x55'),_0x3c0c8c);throw _0x3c0c8c;});}return _0x20094d;})[_0x44fb('0x26')](respondWithResult(_0x5847e8,0xc9))[_0x44fb('0x4c')](handleError(_0x5847e8,null));};exports[_0x44fb('0x56')]=function(_0x3e1ca3,_0x709b9b){if(_0x3e1ca3[_0x44fb('0x4e')]['id']){delete _0x3e1ca3[_0x44fb('0x4e')]['id'];}return db[_0x44fb('0x2e')][_0x44fb('0x4b')]({'where':{'id':_0x3e1ca3['params']['id']}})['then'](handleEntityNotFound(_0x709b9b,null))[_0x44fb('0x26')](saveUpdates(_0x3e1ca3['body'],null))['then'](respondWithResult(_0x709b9b,null))['catch'](handleError(_0x709b9b,null));};exports[_0x44fb('0x27')]=function(_0x399586,_0x174fcf){return db['MailQueue'][_0x44fb('0x4b')]({'where':{'id':_0x399586['params']['id']}})[_0x44fb('0x26')](handleEntityNotFound(_0x174fcf,null))['then'](removeEntity(_0x174fcf,null))[_0x44fb('0x4c')](handleError(_0x174fcf,null));};exports[_0x44fb('0x57')]=function(_0xdbfdab,_0x4ff7ac){return db[_0x44fb('0x2e')][_0x44fb('0x57')]()[_0x44fb('0x26')](respondWithResult(_0x4ff7ac,null))['catch'](handleError(_0x4ff7ac,null));};exports[_0x44fb('0x58')]=function(_0x2e633c,_0x293849,_0x4b7445){var _0x54b1fb={'raw':!![],'where':{}},_0x1ed4a0={},_0x35a96b;return db[_0x44fb('0x2e')][_0x44fb('0x59')]({'where':{'id':_0x2e633c['params']['id']}})['then'](handleEntityNotFound(_0x293849,null))[_0x44fb('0x26')](function(_0xc81529){if(_0xc81529){_0x35a96b=_0xc81529[_0x44fb('0x50')]({'plain':!![]});_0x1ed4a0[_0x44fb('0x30')]=_[_0x44fb('0x34')](db[_0x44fb('0x5a')]['rawAttributes']);_0x1ed4a0[_0x44fb('0x31')]=_[_0x44fb('0x34')](_0x2e633c[_0x44fb('0x31')]);_0x1ed4a0[_0x44fb('0x35')]=_['intersection'](_0x1ed4a0['model'],_0x1ed4a0[_0x44fb('0x31')]);_0x54b1fb[_0x44fb('0x37')]=_[_0x44fb('0x36')](_0x1ed4a0['model'],qs[_0x44fb('0x38')](_0x2e633c['query'][_0x44fb('0x38')]));_0x54b1fb[_0x44fb('0x37')]=_0x54b1fb[_0x44fb('0x37')][_0x44fb('0x39')]?_0x54b1fb[_0x44fb('0x37')]:_0x1ed4a0['model'];if(!_0x2e633c[_0x44fb('0x31')][_0x44fb('0x5b')](_0x44fb('0x3a'))){_0x54b1fb[_0x44fb('0x22')]=qs['limit'](_0x2e633c[_0x44fb('0x31')][_0x44fb('0x22')]);_0x54b1fb[_0x44fb('0x21')]=qs[_0x44fb('0x21')](_0x2e633c[_0x44fb('0x31')][_0x44fb('0x21')]);}_0x54b1fb[_0x44fb('0x3b')]=qs[_0x44fb('0x3c')](_0x2e633c[_0x44fb('0x31')][_0x44fb('0x3c')]);_0x54b1fb[_0x44fb('0x3d')]=qs[_0x44fb('0x35')](_[_0x44fb('0x3e')](_0x2e633c[_0x44fb('0x31')],_0x1ed4a0[_0x44fb('0x35')]));_0x54b1fb[_0x44fb('0x3d')][_0x44fb('0x5c')]=_0xc81529['id'];if(_0x2e633c[_0x44fb('0x31')][_0x44fb('0x46')]){_0x54b1fb['where']=_['merge'](_0x54b1fb[_0x44fb('0x3d')],{'$or':_[_0x44fb('0x42')](_0x54b1fb[_0x44fb('0x37')],function(_0x1feabd){var _0x7123bb={};_0x7123bb[_0x1feabd]={'$like':'%'+_0x2e633c[_0x44fb('0x31')]['filter']+'%'};return _0x7123bb;})});}_0x54b1fb=_['merge']({},_0x54b1fb,_0x2e633c[_0x44fb('0x4a')]);return db[_0x44fb('0x5a')][_0x44fb('0x5d')](_0x54b1fb);}})[_0x44fb('0x26')](function(_0x5db677){if(_0x5db677){return db[_0x44fb('0x5e')][_0x44fb('0x5f')]({'where':{'id':_[_0x44fb('0x42')](_0x5db677,_0x44fb('0x60')),'role':_0x44fb('0x61')},'attributes':['id',_0x44fb('0x2c'),_0x44fb('0x62'),_0x44fb('0x63'),_0x44fb('0x64')]});}})[_0x44fb('0x26')](function(_0x5231ac){if(_0x5231ac){return{'count':_0x5231ac[_0x44fb('0x20')],'rows':_[_0x44fb('0x42')](_0x5231ac['rows'],function(_0x4395ae){return{'membername':_0x4395ae[_0x44fb('0x2c')],'UserId':_0x4395ae['id'],'queue_name':_0x35a96b['name'],'MailQueueId':_0x35a96b['id'],'interface':util[_0x44fb('0x65')](_0x44fb('0x66'),_0x44fb('0x67'),_0x4395ae['name']),'penalty':0x0,'paused':_0x4395ae['mailPause'],'createdAt':_0x4395ae['createdAt'],'updatedAt':_0x4395ae[_0x44fb('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x44fb('0x26')](respondWithFilteredResult(_0x293849,_0x54b1fb))[_0x44fb('0x4c')](handleError(_0x293849,null));};exports[_0x44fb('0x68')]=function(_0x2a472f,_0x1f890e,_0x212b96){var _0x33c7a2={};var _0x55905f={};var _0x3781f8;var _0x100636;return db[_0x44fb('0x2e')][_0x44fb('0x59')]({'where':{'id':_0x2a472f[_0x44fb('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f890e,null))[_0x44fb('0x26')](function(_0x21785b){if(_0x21785b){_0x3781f8=_0x21785b;_0x55905f[_0x44fb('0x30')]=_['keys'](db[_0x44fb('0x69')][_0x44fb('0x2f')]);_0x55905f[_0x44fb('0x31')]=_[_0x44fb('0x34')](_0x2a472f[_0x44fb('0x31')]);_0x55905f[_0x44fb('0x35')]=_[_0x44fb('0x36')](_0x55905f[_0x44fb('0x30')],_0x55905f[_0x44fb('0x31')]);_0x33c7a2[_0x44fb('0x37')]=_[_0x44fb('0x36')](_0x55905f[_0x44fb('0x30')],qs[_0x44fb('0x38')](_0x2a472f[_0x44fb('0x31')]['fields']));_0x33c7a2[_0x44fb('0x37')]=_0x33c7a2[_0x44fb('0x37')][_0x44fb('0x39')]?_0x33c7a2[_0x44fb('0x37')]:_0x55905f[_0x44fb('0x30')];_0x33c7a2[_0x44fb('0x3b')]=qs[_0x44fb('0x3c')](_0x2a472f[_0x44fb('0x31')][_0x44fb('0x3c')]);_0x33c7a2['where']=qs[_0x44fb('0x35')](_['pick'](_0x2a472f[_0x44fb('0x31')],_0x55905f[_0x44fb('0x35')]));if(_0x2a472f['query']['filter']){_0x33c7a2[_0x44fb('0x3d')]=_[_0x44fb('0x41')](_0x33c7a2['where'],{'$or':_[_0x44fb('0x42')](_0x33c7a2['attributes'],function(_0x4b46b4){var _0x246b60={};_0x246b60[_0x4b46b4]={'$like':'%'+_0x2a472f[_0x44fb('0x31')][_0x44fb('0x46')]+'%'};return _0x246b60;})});}_0x33c7a2=_[_0x44fb('0x41')]({},_0x33c7a2,_0x2a472f[_0x44fb('0x4a')]);return _0x3781f8['getTeams'](_0x33c7a2);}})['then'](function(_0x546aed){if(_0x546aed){_0x100636=_0x546aed[_0x44fb('0x39')];if(!_0x2a472f[_0x44fb('0x31')][_0x44fb('0x5b')](_0x44fb('0x3a'))){_0x33c7a2[_0x44fb('0x22')]=qs[_0x44fb('0x22')](_0x2a472f[_0x44fb('0x31')][_0x44fb('0x22')]);_0x33c7a2[_0x44fb('0x21')]=qs[_0x44fb('0x21')](_0x2a472f[_0x44fb('0x31')][_0x44fb('0x21')]);}return _0x3781f8[_0x44fb('0x68')](_0x33c7a2);}})[_0x44fb('0x26')](function(_0x55f5c8){if(_0x55f5c8){return _0x55f5c8?{'count':_0x100636,'rows':_0x55f5c8}:null;}})[_0x44fb('0x26')](respondWithResult(_0x1f890e,null))['catch'](handleError(_0x1f890e,null));};exports[_0x44fb('0x6a')]=function(_0x83e778,_0x5e1c14,_0x1792e7){var _0x152963=[];var _0x2b5583;return db[_0x44fb('0x69')]['findAll']({'where':{'id':_0x83e778['body'][_0x44fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x44fb('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x44fb('0x26')](function(_0x162e4f){if(_0x162e4f){for(var _0xe94110=0x0;_0xe94110<_0x162e4f[_0x44fb('0x39')];_0xe94110+=0x1){for(var _0x3fac48=0x0;_0x3fac48<_0x162e4f[_0xe94110][_0x44fb('0x6c')][_0x44fb('0x39')];_0x3fac48+=0x1){_0x152963=_['union'](_0x152963,[_0x162e4f[_0xe94110]['Agents'][_0x3fac48]['id']]);}}return _0x152963;}})['then'](function(_0x3fed28){if(_0x3fed28){return db['MailQueue'][_0x44fb('0x4b')]({'where':{'id':_0x83e778[_0x44fb('0x49')]['id']}});}})[_0x44fb('0x26')](function(_0x15c6ee){if(_0x15c6ee){_0x2b5583=_0x15c6ee;return _0x2b5583[_0x44fb('0x6d')](_0x152963,{'penalty':_0x83e778['body']['penalty']});}})['then'](function(_0x129076){if(_0x129076){return _0x2b5583[_0x44fb('0x6a')](_0x83e778['body'][_0x44fb('0x6b')]);}})['then'](handleEntityNotFound(_0x5e1c14,null))['then'](respondWithStatusCode(_0x5e1c14,null))[_0x44fb('0x4c')](handleError(_0x5e1c14,null));};exports[_0x44fb('0x6e')]=function(_0x4c4843,_0xa4e785,_0x1b8ab7){var _0x214496=[];var _0xe3b820;return db['Team'][_0x44fb('0x5d')]({'where':{'id':_0x4c4843[_0x44fb('0x31')][_0x44fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x44fb('0x5e')],'as':_0x44fb('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x44fb('0x26')](function(_0x420365){if(_0x420365){for(var _0xb828e6=0x0;_0xb828e6<_0x420365[_0x44fb('0x39')];_0xb828e6+=0x1){for(var _0xef4cf0=0x0;_0xef4cf0<_0x420365[_0xb828e6][_0x44fb('0x6c')][_0x44fb('0x39')];_0xef4cf0+=0x1){_0x214496=_[_0x44fb('0x6f')](_0x214496,[_0x420365[_0xb828e6][_0x44fb('0x6c')][_0xef4cf0]['id']]);}}return _0x214496;}})[_0x44fb('0x26')](function(_0x2b3fef){if(_0x2b3fef){return db[_0x44fb('0x2e')]['find']({'where':{'id':_0x4c4843[_0x44fb('0x49')]['id']}});}})[_0x44fb('0x26')](function(_0x50f5bd){if(_0x50f5bd){_0xe3b820=_0x50f5bd;return _0xe3b820[_0x44fb('0x70')](_0x214496);}})[_0x44fb('0x26')](function(_0x95de68){if(_0xe3b820){return _0xe3b820['removeTeams'](_0x4c4843[_0x44fb('0x31')][_0x44fb('0x6b')]);}})[_0x44fb('0x26')](handleEntityNotFound(_0xa4e785,null))[_0x44fb('0x26')](respondWithStatusCode(_0xa4e785,null))[_0x44fb('0x4c')](handleError(_0xa4e785,null));};exports[_0x44fb('0x6d')]=function(_0x37aa8c,_0x45f8d3,_0x190e04){return db['MailQueue'][_0x44fb('0x4b')]({'where':{'id':_0x37aa8c[_0x44fb('0x49')]['id']}})['then'](handleEntityNotFound(_0x45f8d3,null))[_0x44fb('0x26')](function(_0x1a0c70){if(_0x1a0c70){return _0x1a0c70[_0x44fb('0x6d')](_0x37aa8c['body'][_0x44fb('0x6b')],_[_0x44fb('0x71')](_0x37aa8c[_0x44fb('0x4e')],[_0x44fb('0x6b'),'id'])||{})[_0x44fb('0x72')](function(_0x43db61){for(var _0x3b8b46=0x0;_0x3b8b46<_0x37aa8c[_0x44fb('0x4e')]['ids'][_0x44fb('0x39')];_0x3b8b46+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x37aa8c['body']['ids'][_0x3b8b46],'MailQueueId':_0x37aa8c['params']['id']});}return _0x43db61;});}})[_0x44fb('0x26')](respondWithResult(_0x45f8d3,null))[_0x44fb('0x4c')](handleError(_0x45f8d3,null));};exports[_0x44fb('0x70')]=function(_0x43e7e3,_0x2242b6,_0x42e94e){var _0x18176a;return db[_0x44fb('0x2e')][_0x44fb('0x4b')]({'where':{'id':_0x43e7e3[_0x44fb('0x49')]['id']}})[_0x44fb('0x26')](handleEntityNotFound(_0x2242b6,null))[_0x44fb('0x26')](function(_0x4e0583){if(_0x4e0583){return _0x4e0583[_0x44fb('0x70')](_0x43e7e3[_0x44fb('0x31')][_0x44fb('0x6b')])[_0x44fb('0x26')](function(_0x1bf195){if(_['isArray'](_0x43e7e3[_0x44fb('0x31')]['ids'])){for(var _0x15e4e1=0x0;_0x15e4e1<_0x43e7e3['query']['ids']['length'];_0x15e4e1+=0x1){socket['emit'](_0x44fb('0x73'),{'UserId':_0x43e7e3[_0x44fb('0x31')][_0x44fb('0x6b')][_0x15e4e1],'MailQueueId':_0x43e7e3[_0x44fb('0x49')]['id']});}}else{socket[_0x44fb('0x74')](_0x44fb('0x73'),{'UserId':_0x43e7e3[_0x44fb('0x31')]['ids'],'MailQueueId':_0x43e7e3[_0x44fb('0x49')]['id']});}});}})[_0x44fb('0x26')](respondWithStatusCode(_0x2242b6,null))['catch'](handleError(_0x2242b6,null));};exports['getAgents']=function(_0x23df45,_0x25c0e1,_0x4e5434){var _0x3f5c39={};var _0x56ead7={};var _0x2236e0;var _0x2b6d9c;return db[_0x44fb('0x2e')][_0x44fb('0x59')]({'where':{'id':_0x23df45[_0x44fb('0x49')]['id']}})['then'](handleEntityNotFound(_0x25c0e1,null))['then'](function(_0x2e77f7){if(_0x2e77f7){_0x2236e0=_0x2e77f7;_0x56ead7[_0x44fb('0x30')]=_[_0x44fb('0x34')](db[_0x44fb('0x5e')][_0x44fb('0x2f')]);_0x56ead7[_0x44fb('0x31')]=_['keys'](_0x23df45[_0x44fb('0x31')]);_0x56ead7[_0x44fb('0x35')]=_[_0x44fb('0x36')](_0x56ead7[_0x44fb('0x30')],_0x56ead7[_0x44fb('0x31')]);_0x3f5c39[_0x44fb('0x37')]=_[_0x44fb('0x36')](_0x56ead7[_0x44fb('0x30')],qs[_0x44fb('0x38')](_0x23df45[_0x44fb('0x31')][_0x44fb('0x38')]));_0x3f5c39['attributes']=_0x3f5c39['attributes']['length']?_0x3f5c39[_0x44fb('0x37')]:_0x56ead7[_0x44fb('0x30')];_0x3f5c39[_0x44fb('0x3b')]=qs[_0x44fb('0x3c')](_0x23df45[_0x44fb('0x31')][_0x44fb('0x3c')]);_0x3f5c39[_0x44fb('0x3d')]=qs[_0x44fb('0x35')](_[_0x44fb('0x3e')](_0x23df45[_0x44fb('0x31')],_0x56ead7['filters']));if(_0x23df45[_0x44fb('0x31')][_0x44fb('0x46')]){_0x3f5c39[_0x44fb('0x3d')]=_[_0x44fb('0x41')](_0x3f5c39[_0x44fb('0x3d')],{'$or':_[_0x44fb('0x42')](_0x3f5c39[_0x44fb('0x37')],function(_0x44c60c){var _0x1a35b5={};_0x1a35b5[_0x44c60c]={'$like':'%'+_0x23df45[_0x44fb('0x31')]['filter']+'%'};return _0x1a35b5;})});}_0x3f5c39=_[_0x44fb('0x41')]({},_0x3f5c39,_0x23df45[_0x44fb('0x4a')]);return _0x2236e0[_0x44fb('0x75')](_0x3f5c39);}})[_0x44fb('0x26')](function(_0x1aecad){if(_0x1aecad){_0x2b6d9c=_0x1aecad[_0x44fb('0x39')];if(!_0x23df45[_0x44fb('0x31')][_0x44fb('0x5b')](_0x44fb('0x3a'))){_0x3f5c39['limit']=qs['limit'](_0x23df45[_0x44fb('0x31')]['limit']);_0x3f5c39[_0x44fb('0x21')]=qs[_0x44fb('0x21')](_0x23df45[_0x44fb('0x31')][_0x44fb('0x21')]);}return _0x2236e0['getAgents'](_0x3f5c39);}})[_0x44fb('0x26')](function(_0x2fb148){if(_0x2fb148){return _0x2fb148?{'count':_0x2b6d9c,'rows':_0x2fb148}:null;}})[_0x44fb('0x26')](respondWithResult(_0x25c0e1,null))[_0x44fb('0x4c')](handleError(_0x25c0e1,null));};
\ No newline at end of file
+var _0xeda8=['userProfileId','autoAssociation','update','describe','MailQueueId','UserMailQueue','findAll','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','findOne','Team','addTeams','ids','Agents','addAgents','removeTeams','union','omit','spread','removeAgents','isArray','userMailQueue:remove','emit','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','index','MailQueue','rawAttributes','model','dateStart','query','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','merge','filter','map','type','key','VIRTUAL','field','options','count','include','catch','params','includeAll','find','create','body','user','role','MailQueues'];(function(_0x1fc463,_0x38f738){var _0x246345=function(_0x35e023){while(--_0x35e023){_0x1fc463['push'](_0x1fc463['shift']());}};_0x246345(++_0x38f738);}(_0xeda8,0x104));var _0x8eda=function(_0x522fca,_0x860242){_0x522fca=_0x522fca-0x0;var _0x3db11d=_0xeda8[_0x522fca];return _0x3db11d;};'use strict';var pdf=require(_0x8eda('0x0'));var emlformat=require(_0x8eda('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8eda('0x2'));var jsonpatch=require(_0x8eda('0x3'));var rp=require(_0x8eda('0x4'));var moment=require(_0x8eda('0x5'));var BPromise=require(_0x8eda('0x6'));var Mustache=require(_0x8eda('0x7'));var util=require(_0x8eda('0x8'));var path=require(_0x8eda('0x9'));var sox=require(_0x8eda('0xa'));var csv=require(_0x8eda('0xb'));var ejs=require(_0x8eda('0xc'));var fs=require('fs');var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x8eda('0x11'))(_0x8eda('0x12'));var utils=require(_0x8eda('0x13'));var config=require('../../config/environment');var db=require(_0x8eda('0x14'))['db'];config['redis']=_[_0x8eda('0x15')](config[_0x8eda('0x16')],{'host':_0x8eda('0x17'),'port':0x18eb});var socket=require(_0x8eda('0x18'))(new Redis(config[_0x8eda('0x16')]));require(_0x8eda('0x19'))[_0x8eda('0x1a')](socket);function respondWithStatusCode(_0x24ea76,_0x57957c){_0x57957c=_0x57957c||0xcc;return function(_0x500bd4){if(_0x500bd4){return _0x24ea76[_0x8eda('0x1b')](_0x57957c);}return _0x24ea76[_0x8eda('0x1c')](_0x57957c)['end']();};}function respondWithResult(_0x106a04,_0x34b1ee){_0x34b1ee=_0x34b1ee||0xc8;return function(_0x123905){if(_0x123905){return _0x106a04['status'](_0x34b1ee)[_0x8eda('0x1d')](_0x123905);}};}function respondWithFilteredResult(_0x5594ad,_0xf7d764){return function(_0x553382){if(_0x553382){var _0x24aed4=_0x553382['count'],_0x58023b=_0xf7d764['offset'],_0x38a6a0=_0xf7d764[_0x8eda('0x1e')]+_0xf7d764[_0x8eda('0x1f')],_0x2a4d2b;if(_0x38a6a0>=_0x24aed4){_0x38a6a0=_0x24aed4;_0x2a4d2b=0xc8;}else{_0x2a4d2b=0xce;}_0x5594ad[_0x8eda('0x1c')](_0x2a4d2b);return _0x5594ad[_0x8eda('0x20')](_0x8eda('0x21'),_0x58023b+'-'+_0x38a6a0+'/'+_0x24aed4)[_0x8eda('0x1d')](_0x553382);}return null;};}function patchUpdates(_0x4fb4ee){return function(_0x7081dd){try{jsonpatch[_0x8eda('0x22')](_0x7081dd,_0x4fb4ee,!![]);}catch(_0x232786){return BPromise[_0x8eda('0x23')](_0x232786);}return _0x7081dd['save']();};}function saveUpdates(_0x33143e,_0x4f8483){return function(_0x45517e){if(_0x45517e){return _0x45517e['update'](_0x33143e)[_0x8eda('0x24')](function(_0x2dab25){return _0x2dab25;});}return null;};}function removeEntity(_0x4f3e0a,_0x58e54b){return function(_0x56dba4){if(_0x56dba4){return _0x56dba4[_0x8eda('0x25')]()[_0x8eda('0x24')](function(){var _0x5be84f=_0x56dba4[_0x8eda('0x26')]({'plain':!![]});var _0x37a8ab='MailQueues';return db[_0x8eda('0x27')][_0x8eda('0x25')]({'where':{'type':_0x37a8ab,'resourceId':_0x5be84f['id']}})[_0x8eda('0x24')](function(){return _0x56dba4;});})[_0x8eda('0x24')](function(){_0x4f3e0a[_0x8eda('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41b5a9,_0x5a8bed){return function(_0x35310c){if(!_0x35310c){_0x41b5a9[_0x8eda('0x1b')](0x194);}return _0x35310c;};}function handleError(_0x8337b4,_0x567f69){_0x567f69=_0x567f69||0x1f4;return function(_0x23e892){logger[_0x8eda('0x28')](_0x23e892[_0x8eda('0x29')]);if(_0x23e892['name']){delete _0x23e892[_0x8eda('0x2a')];}_0x8337b4[_0x8eda('0x1c')](_0x567f69)['send'](_0x23e892);};}exports[_0x8eda('0x2b')]=function(_0x29e6f4,_0x373ff6){var _0x3cf3f7={},_0x53274e={},_0x58dd55={'count':0x0,'rows':[]};var _0x54513c=db[_0x8eda('0x2c')][_0x8eda('0x2d')];_0x53274e[_0x8eda('0x2e')]=_['keys'](_0x54513c);var _0x4a9ee2={'dateStart':_0x29e6f4['query'][_0x8eda('0x2f')],'dateEnd':_0x29e6f4[_0x8eda('0x30')][_0x8eda('0x31')]};delete _0x29e6f4['query']['dateStart'];delete _0x29e6f4['query'][_0x8eda('0x31')];_0x53274e[_0x8eda('0x30')]=_[_0x8eda('0x32')](_0x29e6f4[_0x8eda('0x30')]);_0x53274e[_0x8eda('0x33')]=_[_0x8eda('0x34')](_0x53274e[_0x8eda('0x2e')],_0x53274e[_0x8eda('0x30')]);_0x3cf3f7[_0x8eda('0x35')]=_[_0x8eda('0x34')](_0x53274e[_0x8eda('0x2e')],qs[_0x8eda('0x36')](_0x29e6f4[_0x8eda('0x30')][_0x8eda('0x36')]));_0x3cf3f7['attributes']=_0x3cf3f7[_0x8eda('0x35')][_0x8eda('0x37')]?_0x3cf3f7[_0x8eda('0x35')]:_0x53274e['model'];if(!_0x29e6f4['query'][_0x8eda('0x38')](_0x8eda('0x39'))){_0x3cf3f7[_0x8eda('0x1f')]=qs[_0x8eda('0x1f')](_0x29e6f4['query'][_0x8eda('0x1f')]);_0x3cf3f7[_0x8eda('0x1e')]=qs[_0x8eda('0x1e')](_0x29e6f4[_0x8eda('0x30')][_0x8eda('0x1e')]);}_0x3cf3f7[_0x8eda('0x3a')]=qs['sort'](_0x29e6f4[_0x8eda('0x30')][_0x8eda('0x3b')]);_0x3cf3f7[_0x8eda('0x3c')]=qs[_0x8eda('0x33')](_[_0x8eda('0x3d')](_0x29e6f4[_0x8eda('0x30')],_0x53274e['filters']));if(_0x4a9ee2[_0x8eda('0x2f')]){if(_0x4a9ee2[_0x8eda('0x31')]){_0x4a9ee2[_0x8eda('0x31')]=moment(_0x4a9ee2[_0x8eda('0x31')])[_0x8eda('0x3e')](0x1,'day');}else{_0x4a9ee2[_0x8eda('0x31')]=moment(_0x4a9ee2[_0x8eda('0x2f')])[_0x8eda('0x3e')](0x1,'day');}_[_0x8eda('0x3f')](_0x3cf3f7['where'],{'createdAt':{'$gte':_0x4a9ee2[_0x8eda('0x2f')],'$lte':_0x4a9ee2[_0x8eda('0x31')]}});}if(_0x29e6f4[_0x8eda('0x30')][_0x8eda('0x40')]){_0x3cf3f7[_0x8eda('0x3c')]=_['merge'](_0x3cf3f7['where'],{'$or':_[_0x8eda('0x41')](_0x54513c,function(_0xfcb278){if(_0xfcb278[_0x8eda('0x42')][_0x8eda('0x43')]!==_0x8eda('0x44')){var _0x13b3bc={};_0x13b3bc[_0xfcb278[_0x8eda('0x45')]]={'$like':'%'+_0x29e6f4[_0x8eda('0x30')][_0x8eda('0x40')]+'%'};return _0x13b3bc;}})});}_0x3cf3f7=_[_0x8eda('0x3f')]({},_0x3cf3f7,_0x29e6f4[_0x8eda('0x46')]);var _0x400548={'where':_0x3cf3f7[_0x8eda('0x3c')]};return db[_0x8eda('0x2c')][_0x8eda('0x47')](_0x400548)[_0x8eda('0x24')](function(_0x321c50){_0x58dd55[_0x8eda('0x47')]=_0x321c50;if(_0x29e6f4[_0x8eda('0x30')]['includeAll']){_0x3cf3f7[_0x8eda('0x48')]=[{'all':!![]}];}return db[_0x8eda('0x2c')]['findAll'](_0x3cf3f7);})[_0x8eda('0x24')](function(_0x3df55b){_0x58dd55['rows']=_0x3df55b;return _0x58dd55;})[_0x8eda('0x24')](respondWithFilteredResult(_0x373ff6,_0x3cf3f7))[_0x8eda('0x49')](handleError(_0x373ff6,null));};exports['show']=function(_0x307aae,_0x74d822){var _0x2a3546={'raw':!![],'where':{'id':_0x307aae[_0x8eda('0x4a')]['id']}},_0x48ad47={};_0x48ad47[_0x8eda('0x2e')]=_[_0x8eda('0x32')](db[_0x8eda('0x2c')][_0x8eda('0x2d')]);_0x48ad47[_0x8eda('0x30')]=_[_0x8eda('0x32')](_0x307aae['query']);_0x48ad47[_0x8eda('0x33')]=_['intersection'](_0x48ad47[_0x8eda('0x2e')],_0x48ad47['query']);_0x2a3546[_0x8eda('0x35')]=_['intersection'](_0x48ad47[_0x8eda('0x2e')],qs['fields'](_0x307aae[_0x8eda('0x30')][_0x8eda('0x36')]));_0x2a3546[_0x8eda('0x35')]=_0x2a3546[_0x8eda('0x35')][_0x8eda('0x37')]?_0x2a3546[_0x8eda('0x35')]:_0x48ad47[_0x8eda('0x2e')];if(_0x307aae[_0x8eda('0x30')][_0x8eda('0x4b')]){_0x2a3546[_0x8eda('0x48')]=[{'all':!![]}];}_0x2a3546=_[_0x8eda('0x3f')]({},_0x2a3546,_0x307aae[_0x8eda('0x46')]);return db['MailQueue'][_0x8eda('0x4c')](_0x2a3546)[_0x8eda('0x24')](handleEntityNotFound(_0x74d822,null))[_0x8eda('0x24')](respondWithResult(_0x74d822,null))[_0x8eda('0x49')](handleError(_0x74d822,null));};exports[_0x8eda('0x4d')]=function(_0x389399,_0x1158bc){return db[_0x8eda('0x2c')][_0x8eda('0x4d')](_0x389399[_0x8eda('0x4e')],{})[_0x8eda('0x24')](function(_0x370ec2){var _0x1c5e12=_0x389399[_0x8eda('0x4f')][_0x8eda('0x26')]({'plain':!![]});if(!_0x1c5e12)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c5e12[_0x8eda('0x50')]===_0x8eda('0x4f')){var _0xabfddb=_0x370ec2[_0x8eda('0x26')]({'plain':!![]});var _0x1a6bde=_0x8eda('0x51');return db['UserProfileSection'][_0x8eda('0x4c')]({'where':{'name':_0x1a6bde,'userProfileId':_0x1c5e12[_0x8eda('0x52')]},'raw':!![]})[_0x8eda('0x24')](function(_0x4d1c40){if(_0x4d1c40&&_0x4d1c40[_0x8eda('0x53')]===0x0){return db['UserProfileResource'][_0x8eda('0x4d')]({'name':_0xabfddb[_0x8eda('0x2a')],'resourceId':_0xabfddb['id'],'type':_0x4d1c40[_0x8eda('0x2a')],'sectionId':_0x4d1c40['id']},{})['then'](function(){return _0x370ec2;});}else{return _0x370ec2;}})[_0x8eda('0x49')](function(_0x557eed){logger[_0x8eda('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x557eed);throw _0x557eed;});}return _0x370ec2;})[_0x8eda('0x24')](respondWithResult(_0x1158bc,0xc9))[_0x8eda('0x49')](handleError(_0x1158bc,null));};exports[_0x8eda('0x54')]=function(_0x7bc277,_0xc7bc6a){if(_0x7bc277[_0x8eda('0x4e')]['id']){delete _0x7bc277[_0x8eda('0x4e')]['id'];}return db[_0x8eda('0x2c')][_0x8eda('0x4c')]({'where':{'id':_0x7bc277[_0x8eda('0x4a')]['id']}})['then'](handleEntityNotFound(_0xc7bc6a,null))[_0x8eda('0x24')](saveUpdates(_0x7bc277[_0x8eda('0x4e')],null))['then'](respondWithResult(_0xc7bc6a,null))[_0x8eda('0x49')](handleError(_0xc7bc6a,null));};exports['destroy']=function(_0x5f51fc,_0x4a3e61){return db['MailQueue']['find']({'where':{'id':_0x5f51fc[_0x8eda('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4a3e61,null))[_0x8eda('0x24')](removeEntity(_0x4a3e61,null))[_0x8eda('0x49')](handleError(_0x4a3e61,null));};exports[_0x8eda('0x55')]=function(_0x3298fa,_0x21bd2b){return db[_0x8eda('0x2c')][_0x8eda('0x55')]()['then'](respondWithResult(_0x21bd2b,null))[_0x8eda('0x49')](handleError(_0x21bd2b,null));};exports['getMembers']=function(_0xdd71ce,_0x4ba827,_0xfb98bf){var _0x4c3cd7={'raw':!![],'where':{}},_0x31b5ba={},_0x147942;return db[_0x8eda('0x2c')]['findOne']({'where':{'id':_0xdd71ce['params']['id']}})['then'](handleEntityNotFound(_0x4ba827,null))[_0x8eda('0x24')](function(_0xbed399){if(_0xbed399){_0x147942=_0xbed399['get']({'plain':!![]});_0x31b5ba[_0x8eda('0x2e')]=_['keys'](db['UserMailQueue'][_0x8eda('0x2d')]);_0x31b5ba[_0x8eda('0x30')]=_[_0x8eda('0x32')](_0xdd71ce[_0x8eda('0x30')]);_0x31b5ba['filters']=_['intersection'](_0x31b5ba[_0x8eda('0x2e')],_0x31b5ba[_0x8eda('0x30')]);_0x4c3cd7[_0x8eda('0x35')]=_[_0x8eda('0x34')](_0x31b5ba['model'],qs[_0x8eda('0x36')](_0xdd71ce['query'][_0x8eda('0x36')]));_0x4c3cd7['attributes']=_0x4c3cd7[_0x8eda('0x35')]['length']?_0x4c3cd7[_0x8eda('0x35')]:_0x31b5ba[_0x8eda('0x2e')];if(!_0xdd71ce[_0x8eda('0x30')][_0x8eda('0x38')](_0x8eda('0x39'))){_0x4c3cd7[_0x8eda('0x1f')]=qs[_0x8eda('0x1f')](_0xdd71ce[_0x8eda('0x30')][_0x8eda('0x1f')]);_0x4c3cd7['offset']=qs['offset'](_0xdd71ce[_0x8eda('0x30')]['offset']);}_0x4c3cd7[_0x8eda('0x3a')]=qs[_0x8eda('0x3b')](_0xdd71ce[_0x8eda('0x30')][_0x8eda('0x3b')]);_0x4c3cd7[_0x8eda('0x3c')]=qs['filters'](_['pick'](_0xdd71ce[_0x8eda('0x30')],_0x31b5ba[_0x8eda('0x33')]));_0x4c3cd7[_0x8eda('0x3c')][_0x8eda('0x56')]=_0xbed399['id'];if(_0xdd71ce[_0x8eda('0x30')][_0x8eda('0x40')]){_0x4c3cd7[_0x8eda('0x3c')]=_['merge'](_0x4c3cd7[_0x8eda('0x3c')],{'$or':_[_0x8eda('0x41')](_0x4c3cd7['attributes'],function(_0x462663){var _0x5467e9={};_0x5467e9[_0x462663]={'$like':'%'+_0xdd71ce['query']['filter']+'%'};return _0x5467e9;})});}_0x4c3cd7=_['merge']({},_0x4c3cd7,_0xdd71ce[_0x8eda('0x46')]);return db[_0x8eda('0x57')][_0x8eda('0x58')](_0x4c3cd7);}})[_0x8eda('0x24')](function(_0xa3e405){if(_0xa3e405){return db[_0x8eda('0x59')]['findAndCountAll']({'where':{'id':_[_0x8eda('0x41')](_0xa3e405,_0x8eda('0x5a')),'role':_0x8eda('0x5b')},'attributes':['id',_0x8eda('0x2a'),'mailPause',_0x8eda('0x5c'),_0x8eda('0x5d')]});}})[_0x8eda('0x24')](function(_0x2dac0e){if(_0x2dac0e){return{'count':_0x2dac0e[_0x8eda('0x47')],'rows':_[_0x8eda('0x41')](_0x2dac0e['rows'],function(_0x22a362){return{'membername':_0x22a362[_0x8eda('0x2a')],'UserId':_0x22a362['id'],'queue_name':_0x147942[_0x8eda('0x2a')],'MailQueueId':_0x147942['id'],'interface':util[_0x8eda('0x5e')](_0x8eda('0x5f'),_0x8eda('0x60'),_0x22a362[_0x8eda('0x2a')]),'penalty':0x0,'paused':_0x22a362[_0x8eda('0x61')],'createdAt':_0x22a362[_0x8eda('0x5d')],'updatedAt':_0x22a362[_0x8eda('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8eda('0x24')](respondWithFilteredResult(_0x4ba827,_0x4c3cd7))[_0x8eda('0x49')](handleError(_0x4ba827,null));};exports[_0x8eda('0x62')]=function(_0x3d823e,_0x53d7da,_0x4b90c0){var _0x2c721c={};var _0x1f1e6b={};var _0x1b43c0;var _0x32db8b;return db['MailQueue'][_0x8eda('0x63')]({'where':{'id':_0x3d823e[_0x8eda('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53d7da,null))[_0x8eda('0x24')](function(_0x5f0d26){if(_0x5f0d26){_0x1b43c0=_0x5f0d26;_0x1f1e6b[_0x8eda('0x2e')]=_[_0x8eda('0x32')](db[_0x8eda('0x64')]['rawAttributes']);_0x1f1e6b[_0x8eda('0x30')]=_[_0x8eda('0x32')](_0x3d823e[_0x8eda('0x30')]);_0x1f1e6b['filters']=_[_0x8eda('0x34')](_0x1f1e6b[_0x8eda('0x2e')],_0x1f1e6b[_0x8eda('0x30')]);_0x2c721c[_0x8eda('0x35')]=_['intersection'](_0x1f1e6b['model'],qs[_0x8eda('0x36')](_0x3d823e[_0x8eda('0x30')][_0x8eda('0x36')]));_0x2c721c[_0x8eda('0x35')]=_0x2c721c['attributes'][_0x8eda('0x37')]?_0x2c721c[_0x8eda('0x35')]:_0x1f1e6b[_0x8eda('0x2e')];_0x2c721c[_0x8eda('0x3a')]=qs[_0x8eda('0x3b')](_0x3d823e['query'][_0x8eda('0x3b')]);_0x2c721c[_0x8eda('0x3c')]=qs[_0x8eda('0x33')](_['pick'](_0x3d823e['query'],_0x1f1e6b['filters']));if(_0x3d823e[_0x8eda('0x30')][_0x8eda('0x40')]){_0x2c721c[_0x8eda('0x3c')]=_[_0x8eda('0x3f')](_0x2c721c[_0x8eda('0x3c')],{'$or':_[_0x8eda('0x41')](_0x2c721c[_0x8eda('0x35')],function(_0x3f700a){var _0x5a7b8b={};_0x5a7b8b[_0x3f700a]={'$like':'%'+_0x3d823e[_0x8eda('0x30')][_0x8eda('0x40')]+'%'};return _0x5a7b8b;})});}_0x2c721c=_[_0x8eda('0x3f')]({},_0x2c721c,_0x3d823e['options']);return _0x1b43c0[_0x8eda('0x62')](_0x2c721c);}})[_0x8eda('0x24')](function(_0x3095bd){if(_0x3095bd){_0x32db8b=_0x3095bd[_0x8eda('0x37')];if(!_0x3d823e[_0x8eda('0x30')][_0x8eda('0x38')](_0x8eda('0x39'))){_0x2c721c[_0x8eda('0x1f')]=qs[_0x8eda('0x1f')](_0x3d823e[_0x8eda('0x30')][_0x8eda('0x1f')]);_0x2c721c['offset']=qs[_0x8eda('0x1e')](_0x3d823e[_0x8eda('0x30')][_0x8eda('0x1e')]);}return _0x1b43c0[_0x8eda('0x62')](_0x2c721c);}})[_0x8eda('0x24')](function(_0x33ff22){if(_0x33ff22){return _0x33ff22?{'count':_0x32db8b,'rows':_0x33ff22}:null;}})[_0x8eda('0x24')](respondWithResult(_0x53d7da,null))[_0x8eda('0x49')](handleError(_0x53d7da,null));};exports[_0x8eda('0x65')]=function(_0x2c4ab4,_0x31cea2,_0x5c4deb){var _0x513b25=[];var _0x49c49f;return db[_0x8eda('0x64')][_0x8eda('0x58')]({'where':{'id':_0x2c4ab4['body'][_0x8eda('0x66')]},'attributes':['id'],'include':[{'model':db[_0x8eda('0x59')],'as':_0x8eda('0x67'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x22c295){if(_0x22c295){for(var _0x4cec3f=0x0;_0x4cec3f<_0x22c295[_0x8eda('0x37')];_0x4cec3f+=0x1){for(var _0x518d50=0x0;_0x518d50<_0x22c295[_0x4cec3f][_0x8eda('0x67')][_0x8eda('0x37')];_0x518d50+=0x1){_0x513b25=_['union'](_0x513b25,[_0x22c295[_0x4cec3f][_0x8eda('0x67')][_0x518d50]['id']]);}}return _0x513b25;}})[_0x8eda('0x24')](function(_0x355d61){if(_0x355d61){return db[_0x8eda('0x2c')][_0x8eda('0x4c')]({'where':{'id':_0x2c4ab4[_0x8eda('0x4a')]['id']}});}})[_0x8eda('0x24')](function(_0x359ebd){if(_0x359ebd){_0x49c49f=_0x359ebd;return _0x49c49f[_0x8eda('0x68')](_0x513b25,{'penalty':_0x2c4ab4[_0x8eda('0x4e')]['penalty']});}})['then'](function(_0x5ed6a0){if(_0x5ed6a0){return _0x49c49f['addTeams'](_0x2c4ab4[_0x8eda('0x4e')][_0x8eda('0x66')]);}})[_0x8eda('0x24')](handleEntityNotFound(_0x31cea2,null))['then'](respondWithStatusCode(_0x31cea2,null))[_0x8eda('0x49')](handleError(_0x31cea2,null));};exports[_0x8eda('0x69')]=function(_0x3d4cfe,_0x3ab457,_0x1f7cad){var _0x30200a=[];var _0x72184a;return db[_0x8eda('0x64')]['findAll']({'where':{'id':_0x3d4cfe['query'][_0x8eda('0x66')]},'attributes':['id'],'include':[{'model':db[_0x8eda('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8eda('0x24')](function(_0x27b68d){if(_0x27b68d){for(var _0x27ba04=0x0;_0x27ba04<_0x27b68d['length'];_0x27ba04+=0x1){for(var _0x36926f=0x0;_0x36926f<_0x27b68d[_0x27ba04][_0x8eda('0x67')][_0x8eda('0x37')];_0x36926f+=0x1){_0x30200a=_[_0x8eda('0x6a')](_0x30200a,[_0x27b68d[_0x27ba04][_0x8eda('0x67')][_0x36926f]['id']]);}}return _0x30200a;}})[_0x8eda('0x24')](function(_0x2480b2){if(_0x2480b2){return db['MailQueue'][_0x8eda('0x4c')]({'where':{'id':_0x3d4cfe[_0x8eda('0x4a')]['id']}});}})['then'](function(_0x5d8512){if(_0x5d8512){_0x72184a=_0x5d8512;return _0x72184a['removeAgents'](_0x30200a);}})[_0x8eda('0x24')](function(_0x818445){if(_0x72184a){return _0x72184a[_0x8eda('0x69')](_0x3d4cfe[_0x8eda('0x30')][_0x8eda('0x66')]);}})[_0x8eda('0x24')](handleEntityNotFound(_0x3ab457,null))[_0x8eda('0x24')](respondWithStatusCode(_0x3ab457,null))[_0x8eda('0x49')](handleError(_0x3ab457,null));};exports[_0x8eda('0x68')]=function(_0x1a3993,_0x2a195b,_0x3ebd70){return db[_0x8eda('0x2c')][_0x8eda('0x4c')]({'where':{'id':_0x1a3993['params']['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x2a195b,null))[_0x8eda('0x24')](function(_0x2dfde8){if(_0x2dfde8){return _0x2dfde8[_0x8eda('0x68')](_0x1a3993['body'][_0x8eda('0x66')],_[_0x8eda('0x6b')](_0x1a3993[_0x8eda('0x4e')],[_0x8eda('0x66'),'id'])||{})[_0x8eda('0x6c')](function(_0x59690b){for(var _0x447936=0x0;_0x447936<_0x1a3993[_0x8eda('0x4e')][_0x8eda('0x66')][_0x8eda('0x37')];_0x447936+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x1a3993[_0x8eda('0x4e')][_0x8eda('0x66')][_0x447936],'MailQueueId':_0x1a3993[_0x8eda('0x4a')]['id']});}return _0x59690b;});}})[_0x8eda('0x24')](respondWithResult(_0x2a195b,null))['catch'](handleError(_0x2a195b,null));};exports[_0x8eda('0x6d')]=function(_0x31c013,_0x5e507b,_0x1afc81){var _0x37be2a;return db[_0x8eda('0x2c')][_0x8eda('0x4c')]({'where':{'id':_0x31c013[_0x8eda('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5e507b,null))[_0x8eda('0x24')](function(_0x64426e){if(_0x64426e){return _0x64426e[_0x8eda('0x6d')](_0x31c013[_0x8eda('0x30')][_0x8eda('0x66')])[_0x8eda('0x24')](function(_0x7f3ddd){if(_[_0x8eda('0x6e')](_0x31c013[_0x8eda('0x30')][_0x8eda('0x66')])){for(var _0x4d1cbe=0x0;_0x4d1cbe<_0x31c013[_0x8eda('0x30')][_0x8eda('0x66')][_0x8eda('0x37')];_0x4d1cbe+=0x1){socket['emit'](_0x8eda('0x6f'),{'UserId':_0x31c013['query']['ids'][_0x4d1cbe],'MailQueueId':_0x31c013['params']['id']});}}else{socket[_0x8eda('0x70')](_0x8eda('0x6f'),{'UserId':_0x31c013['query'][_0x8eda('0x66')],'MailQueueId':_0x31c013[_0x8eda('0x4a')]['id']});}});}})['then'](respondWithStatusCode(_0x5e507b,null))[_0x8eda('0x49')](handleError(_0x5e507b,null));};exports[_0x8eda('0x71')]=function(_0x5c6183,_0x532b73,_0x1ceee9){var _0x56279b={};var _0x4e9522={};var _0x437911;var _0x19eeb2;return db['MailQueue'][_0x8eda('0x63')]({'where':{'id':_0x5c6183[_0x8eda('0x4a')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x532b73,null))['then'](function(_0x5e56e8){if(_0x5e56e8){_0x437911=_0x5e56e8;_0x4e9522[_0x8eda('0x2e')]=_['keys'](db['User']['rawAttributes']);_0x4e9522[_0x8eda('0x30')]=_['keys'](_0x5c6183[_0x8eda('0x30')]);_0x4e9522[_0x8eda('0x33')]=_[_0x8eda('0x34')](_0x4e9522[_0x8eda('0x2e')],_0x4e9522[_0x8eda('0x30')]);_0x56279b[_0x8eda('0x35')]=_[_0x8eda('0x34')](_0x4e9522[_0x8eda('0x2e')],qs[_0x8eda('0x36')](_0x5c6183[_0x8eda('0x30')]['fields']));_0x56279b['attributes']=_0x56279b[_0x8eda('0x35')]['length']?_0x56279b[_0x8eda('0x35')]:_0x4e9522[_0x8eda('0x2e')];_0x56279b[_0x8eda('0x3a')]=qs[_0x8eda('0x3b')](_0x5c6183[_0x8eda('0x30')][_0x8eda('0x3b')]);_0x56279b[_0x8eda('0x3c')]=qs['filters'](_[_0x8eda('0x3d')](_0x5c6183[_0x8eda('0x30')],_0x4e9522['filters']));if(_0x5c6183[_0x8eda('0x30')][_0x8eda('0x40')]){_0x56279b[_0x8eda('0x3c')]=_[_0x8eda('0x3f')](_0x56279b[_0x8eda('0x3c')],{'$or':_['map'](_0x56279b[_0x8eda('0x35')],function(_0x4997aa){var _0x38c2ab={};_0x38c2ab[_0x4997aa]={'$like':'%'+_0x5c6183[_0x8eda('0x30')]['filter']+'%'};return _0x38c2ab;})});}_0x56279b=_['merge']({},_0x56279b,_0x5c6183[_0x8eda('0x46')]);return _0x437911[_0x8eda('0x71')](_0x56279b);}})[_0x8eda('0x24')](function(_0x3a11e8){if(_0x3a11e8){_0x19eeb2=_0x3a11e8['length'];if(!_0x5c6183['query'][_0x8eda('0x38')](_0x8eda('0x39'))){_0x56279b[_0x8eda('0x1f')]=qs[_0x8eda('0x1f')](_0x5c6183[_0x8eda('0x30')][_0x8eda('0x1f')]);_0x56279b[_0x8eda('0x1e')]=qs['offset'](_0x5c6183['query'][_0x8eda('0x1e')]);}return _0x437911['getAgents'](_0x56279b);}})['then'](function(_0x3aea54){if(_0x3aea54){return _0x3aea54?{'count':_0x19eeb2,'rows':_0x3aea54}:null;}})[_0x8eda('0x24')](respondWithResult(_0x532b73,null))[_0x8eda('0x49')](handleError(_0x532b73,null));};
\ No newline at end of file
index eb33feb..09252cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcad=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x279d05,_0xca64b9){var _0x115161=function(_0x4ee4d2){while(--_0x4ee4d2){_0x279d05['push'](_0x279d05['shift']());}};_0x115161(++_0xca64b9);}(_0xbcad,0xde));var _0xdbca=function(_0x1838dd,_0x4963f6){_0x1838dd=_0x1838dd-0x0;var _0x2aa3ab=_0xbcad[_0x1838dd];return _0x2aa3ab;};'use strict';var EventEmitter=require(_0xdbca('0x0'));var MailQueue=require(_0xdbca('0x1'))['db'][_0xdbca('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xdbca('0x3')](0x0);var events={'afterCreate':_0xdbca('0x4'),'afterUpdate':_0xdbca('0x5'),'afterDestroy':_0xdbca('0x6')};function emitEvent(_0x657d88){return function(_0x36496e,_0x5d12ab,_0x5ed436){MailQueueEvents['emit'](_0x657d88+':'+_0x36496e['id'],_0x36496e);MailQueueEvents[_0xdbca('0x7')](_0x657d88,_0x36496e);_0x5ed436(null);};}for(var e in events){if(events[_0xdbca('0x8')](e)){var event=events[e];MailQueue[_0xdbca('0x9')](e,emitEvent(event));}}module[_0xdbca('0xa')]=MailQueueEvents;
\ No newline at end of file
+var _0x41a4=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue'];(function(_0x207e0b,_0x4eb9c8){var _0x94d971=function(_0x5b6315){while(--_0x5b6315){_0x207e0b['push'](_0x207e0b['shift']());}};_0x94d971(++_0x4eb9c8);}(_0x41a4,0xc5));var _0x441a=function(_0x807fdb,_0xf27203){_0x807fdb=_0x807fdb-0x0;var _0x53901b=_0x41a4[_0x807fdb];return _0x53901b;};'use strict';var EventEmitter=require(_0x441a('0x0'));var MailQueue=require(_0x441a('0x1'))['db'][_0x441a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x441a('0x3')](0x0);var events={'afterCreate':_0x441a('0x4'),'afterUpdate':_0x441a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x11c278){return function(_0x31aa8c,_0xa1c67c,_0x35498c){MailQueueEvents[_0x441a('0x6')](_0x11c278+':'+_0x31aa8c['id'],_0x31aa8c);MailQueueEvents[_0x441a('0x6')](_0x11c278,_0x31aa8c);_0x35498c(null);};}for(var e in events){if(events[_0x441a('0x7')](e)){var event=events[e];MailQueue[_0x441a('0x8')](e,emitEvent(event));}}module[_0x441a('0x9')]=MailQueueEvents;
\ No newline at end of file
index 24f8911..a402d9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f9a=['moment','bluebird','exports','define','MailQueue','lodash','api'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x8f9a,0xad));var _0xa8f9=function(_0x1d9ba7,_0x3709a2){_0x1d9ba7=_0x1d9ba7-0x0;var _0xfbb9c9=_0x8f9a[_0x1d9ba7];return _0xfbb9c9;};'use strict';var _=require(_0xa8f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8f9('0x1'));var moment=require(_0xa8f9('0x2'));var BPromise=require(_0xa8f9('0x3'));var rp=require('request-promise');var attributes=require('./mailQueue.attributes');module[_0xa8f9('0x4')]=function(_0x23f488,_0xc08958){return _0x23f488[_0xa8f9('0x5')](_0xa8f9('0x6'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc623=['MailQueue','mail_queues','../../config/logger','moment','bluebird','./mailQueue.attributes','define'];(function(_0x3c2b2b,_0x5250d9){var _0x1484f5=function(_0x6c9957){while(--_0x6c9957){_0x3c2b2b['push'](_0x3c2b2b['shift']());}};_0x1484f5(++_0x5250d9);}(_0xc623,0xdb));var _0x3c62=function(_0x18d8b3,_0x1e4aef){_0x18d8b3=_0x18d8b3-0x0;var _0x29f7bb=_0xc623[_0x18d8b3];return _0x29f7bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c62('0x0'))('api');var moment=require(_0x3c62('0x1'));var BPromise=require(_0x3c62('0x2'));var rp=require('request-promise');var attributes=require(_0x3c62('0x3'));module['exports']=function(_0x56d32a,_0x33c527){return _0x56d32a[_0x3c62('0x4')](_0x3c62('0x5'),attributes,{'tableName':_0x3c62('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1c794bd..53afb8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1840=['socket.io-emitter','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','findAll','options','raw','where','limit','include','attributes','map','model','debug','MailQueue','find','ShowMailQueue','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1840,0xde));var _0x0184=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x1840[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x0184('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0184('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0184('0x2'));var db=require(_0x0184('0x3'))['db'];var utils=require(_0x0184('0x4'));var logger=require(_0x0184('0x5'))('rpc');var config=require(_0x0184('0x6'));var jayson=require(_0x0184('0x7'));var client=jayson['client'][_0x0184('0x8')]({'port':0x232a});config[_0x0184('0x9')]=_[_0x0184('0xa')](config[_0x0184('0x9')],{'host':_0x0184('0xb'),'port':0x18eb});var socket=require(_0x0184('0xc'))(new Redis(config[_0x0184('0x9')]));require('./mailQueue.socket')[_0x0184('0xd')](socket);function respondWithRpcPromise(_0x296805,_0x12fdf7,_0x2fe04f){return new BPromise(function(_0x315f26,_0x975987){return client[_0x0184('0xe')](_0x296805,_0x2fe04f)[_0x0184('0xf')](function(_0xf76637){logger[_0x0184('0x10')](_0x0184('0x11'),_0x12fdf7,_0x0184('0x12'));logger['debug'](_0x0184('0x13'),_0x12fdf7,_0x0184('0x12'),JSON[_0x0184('0x14')](_0xf76637));if(_0xf76637[_0x0184('0x15')]){if(_0xf76637[_0x0184('0x15')][_0x0184('0x16')]===0x1f4){logger[_0x0184('0x15')](_0x0184('0x11'),_0x12fdf7,_0xf76637[_0x0184('0x15')]['message']);return _0x975987(_0xf76637[_0x0184('0x15')][_0x0184('0x17')]);}logger[_0x0184('0x15')](_0x0184('0x11'),_0x12fdf7,_0xf76637['error'][_0x0184('0x17')]);return _0x315f26(_0xf76637[_0x0184('0x15')][_0x0184('0x17')]);}else{logger[_0x0184('0x10')]('MailQueue,\x20%s,\x20%s',_0x12fdf7,'request\x20sent');_0x315f26(_0xf76637['result'][_0x0184('0x17')]);}})[_0x0184('0x18')](function(_0x3e81db){logger[_0x0184('0x15')](_0x0184('0x11'),_0x12fdf7,_0x3e81db);_0x975987(_0x3e81db);});});}exports[_0x0184('0x19')]=function(_0x58ce76){var _0x4a47c1=this;return new Promise(function(_0x7a13fc,_0x24d1ed){return db['MailQueue'][_0x0184('0x1a')]({'raw':_0x58ce76[_0x0184('0x1b')]?_0x58ce76[_0x0184('0x1b')][_0x0184('0x1c')]===undefined?!![]:![]:!![],'where':_0x58ce76[_0x0184('0x1b')]?_0x58ce76[_0x0184('0x1b')][_0x0184('0x1d')]||null:null,'attributes':_0x58ce76[_0x0184('0x1b')]?_0x58ce76[_0x0184('0x1b')]['attributes']||null:null,'limit':_0x58ce76[_0x0184('0x1b')]?_0x58ce76[_0x0184('0x1b')][_0x0184('0x1e')]||null:null,'include':_0x58ce76[_0x0184('0x1b')]?_0x58ce76[_0x0184('0x1b')][_0x0184('0x1f')]?_['map'](_0x58ce76[_0x0184('0x1b')][_0x0184('0x1f')],function(_0xe66774){return{'model':db[_0xe66774['model']],'as':_0xe66774['as'],'attributes':_0xe66774[_0x0184('0x20')],'include':_0xe66774['include']?_[_0x0184('0x21')](_0xe66774[_0x0184('0x1f')],function(_0x5761ec){return{'model':db[_0x5761ec[_0x0184('0x22')]],'as':_0x5761ec['as'],'attributes':_0x5761ec[_0x0184('0x20')],'include':_0x5761ec[_0x0184('0x1f')]?_[_0x0184('0x21')](_0x5761ec[_0x0184('0x1f')],function(_0x1e7a2d){return{'model':db[_0x1e7a2d[_0x0184('0x22')]],'as':_0x1e7a2d['as'],'attributes':_0x1e7a2d[_0x0184('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xab883a){logger[_0x0184('0x10')]('GetMailQueue',_0x58ce76);logger[_0x0184('0x23')](_0x0184('0x19'),_0x58ce76,JSON['stringify'](_0xab883a));_0x7a13fc(_0xab883a);})[_0x0184('0x18')](function(_0x1430ba){logger['error'](_0x0184('0x19'),_0x1430ba[_0x0184('0x17')],_0x58ce76);_0x24d1ed(_0x4a47c1[_0x0184('0x15')](0x1f4,_0x1430ba['message']));});});};exports['ShowMailQueue']=function(_0x9a5842){var _0x573ac6=this;return new Promise(function(_0x35295a,_0x12aa71){return db[_0x0184('0x24')][_0x0184('0x25')]({'raw':_0x9a5842[_0x0184('0x1b')]?_0x9a5842[_0x0184('0x1b')][_0x0184('0x1c')]===undefined?!![]:![]:!![],'where':_0x9a5842[_0x0184('0x1b')]?_0x9a5842['options'][_0x0184('0x1d')]||null:null,'attributes':_0x9a5842[_0x0184('0x1b')]?_0x9a5842['options']['attributes']||null:null,'include':_0x9a5842['options']?_0x9a5842[_0x0184('0x1b')][_0x0184('0x1f')]?_[_0x0184('0x21')](_0x9a5842['options']['include'],function(_0x519ed9){return{'model':db[_0x519ed9[_0x0184('0x22')]],'as':_0x519ed9['as'],'attributes':_0x519ed9[_0x0184('0x20')],'include':_0x519ed9['include']?_[_0x0184('0x21')](_0x519ed9[_0x0184('0x1f')],function(_0x22d12f){return{'model':db[_0x22d12f[_0x0184('0x22')]],'as':_0x22d12f['as'],'attributes':_0x22d12f[_0x0184('0x20')],'include':_0x22d12f[_0x0184('0x1f')]?_[_0x0184('0x21')](_0x22d12f['include'],function(_0x2a0051){return{'model':db[_0x2a0051[_0x0184('0x22')]],'as':_0x2a0051['as'],'attributes':_0x2a0051[_0x0184('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0184('0xf')](function(_0x161ec0){logger[_0x0184('0x10')](_0x0184('0x26'),_0x9a5842);logger['debug']('ShowMailQueue',_0x9a5842,JSON[_0x0184('0x14')](_0x161ec0));_0x35295a(_0x161ec0);})[_0x0184('0x18')](function(_0x3d75a9){logger[_0x0184('0x15')](_0x0184('0x26'),_0x3d75a9['message'],_0x9a5842);_0x12aa71(_0x573ac6[_0x0184('0x15')](0x1f4,_0x3d75a9['message']));});});};
\ No newline at end of file
+var _0x57b7=['include','model','map','then','ShowMailQueue','find','raw','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit'];(function(_0x48a725,_0x3ee2fc){var _0x253e7b=function(_0x4b3145){while(--_0x4b3145){_0x48a725['push'](_0x48a725['shift']());}};_0x253e7b(++_0x3ee2fc);}(_0x57b7,0x11f));var _0x757b=function(_0x52d1e1,_0x21224c){_0x52d1e1=_0x52d1e1-0x0;var _0x3049e7=_0x57b7[_0x52d1e1];return _0x3049e7;};'use strict';var _=require('lodash');var util=require(_0x757b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x757b('0x1'));var db=require(_0x757b('0x2'))['db'];var utils=require(_0x757b('0x3'));var logger=require(_0x757b('0x4'))(_0x757b('0x5'));var config=require(_0x757b('0x6'));var jayson=require(_0x757b('0x7'));var client=jayson[_0x757b('0x8')][_0x757b('0x9')]({'port':0x232a});config['redis']=_[_0x757b('0xa')](config['redis'],{'host':_0x757b('0xb'),'port':0x18eb});var socket=require(_0x757b('0xc'))(new Redis(config[_0x757b('0xd')]));require(_0x757b('0xe'))['register'](socket);function respondWithRpcPromise(_0x3d5332,_0x151334,_0x40e328){return new BPromise(function(_0x2c0d36,_0x1b1739){return client['request'](_0x3d5332,_0x40e328)['then'](function(_0x2c03d2){logger['info'](_0x757b('0xf'),_0x151334,'request\x20sent');logger[_0x757b('0x10')](_0x757b('0x11'),_0x151334,_0x757b('0x12'),JSON[_0x757b('0x13')](_0x2c03d2));if(_0x2c03d2[_0x757b('0x14')]){if(_0x2c03d2[_0x757b('0x14')][_0x757b('0x15')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x151334,_0x2c03d2[_0x757b('0x14')][_0x757b('0x16')]);return _0x1b1739(_0x2c03d2['error'][_0x757b('0x16')]);}logger[_0x757b('0x14')](_0x757b('0xf'),_0x151334,_0x2c03d2['error']['message']);return _0x2c0d36(_0x2c03d2[_0x757b('0x14')][_0x757b('0x16')]);}else{logger[_0x757b('0x17')](_0x757b('0xf'),_0x151334,_0x757b('0x12'));_0x2c0d36(_0x2c03d2[_0x757b('0x18')][_0x757b('0x16')]);}})[_0x757b('0x19')](function(_0x4d369f){logger[_0x757b('0x14')](_0x757b('0xf'),_0x151334,_0x4d369f);_0x1b1739(_0x4d369f);});});}exports[_0x757b('0x1a')]=function(_0x2dc1be){var _0x7b5d25=this;return new Promise(function(_0x1bc528,_0x30cfdc){return db[_0x757b('0x1b')][_0x757b('0x1c')]({'raw':_0x2dc1be[_0x757b('0x1d')]?_0x2dc1be[_0x757b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2dc1be[_0x757b('0x1d')]?_0x2dc1be[_0x757b('0x1d')][_0x757b('0x1e')]||null:null,'attributes':_0x2dc1be[_0x757b('0x1d')]?_0x2dc1be['options'][_0x757b('0x1f')]||null:null,'limit':_0x2dc1be[_0x757b('0x1d')]?_0x2dc1be[_0x757b('0x1d')][_0x757b('0x20')]||null:null,'include':_0x2dc1be[_0x757b('0x1d')]?_0x2dc1be['options'][_0x757b('0x21')]?_['map'](_0x2dc1be['options'][_0x757b('0x21')],function(_0x4d522f){return{'model':db[_0x4d522f[_0x757b('0x22')]],'as':_0x4d522f['as'],'attributes':_0x4d522f[_0x757b('0x1f')],'include':_0x4d522f[_0x757b('0x21')]?_['map'](_0x4d522f[_0x757b('0x21')],function(_0xd98836){return{'model':db[_0xd98836[_0x757b('0x22')]],'as':_0xd98836['as'],'attributes':_0xd98836['attributes'],'include':_0xd98836[_0x757b('0x21')]?_[_0x757b('0x23')](_0xd98836[_0x757b('0x21')],function(_0x30b83d){return{'model':db[_0x30b83d[_0x757b('0x22')]],'as':_0x30b83d['as'],'attributes':_0x30b83d[_0x757b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x757b('0x24')](function(_0x4bc4b8){logger[_0x757b('0x17')](_0x757b('0x1a'),_0x2dc1be);logger[_0x757b('0x10')](_0x757b('0x1a'),_0x2dc1be,JSON['stringify'](_0x4bc4b8));_0x1bc528(_0x4bc4b8);})[_0x757b('0x19')](function(_0x466f7f){logger[_0x757b('0x14')](_0x757b('0x1a'),_0x466f7f[_0x757b('0x16')],_0x2dc1be);_0x30cfdc(_0x7b5d25[_0x757b('0x14')](0x1f4,_0x466f7f[_0x757b('0x16')]));});});};exports[_0x757b('0x25')]=function(_0x3790d5){var _0x2e11bd=this;return new Promise(function(_0x51207a,_0x5d1732){return db[_0x757b('0x1b')][_0x757b('0x26')]({'raw':_0x3790d5[_0x757b('0x1d')]?_0x3790d5[_0x757b('0x1d')][_0x757b('0x27')]===undefined?!![]:![]:!![],'where':_0x3790d5[_0x757b('0x1d')]?_0x3790d5['options'][_0x757b('0x1e')]||null:null,'attributes':_0x3790d5[_0x757b('0x1d')]?_0x3790d5['options'][_0x757b('0x1f')]||null:null,'include':_0x3790d5[_0x757b('0x1d')]?_0x3790d5[_0x757b('0x1d')]['include']?_[_0x757b('0x23')](_0x3790d5['options'][_0x757b('0x21')],function(_0x2e4ce6){return{'model':db[_0x2e4ce6[_0x757b('0x22')]],'as':_0x2e4ce6['as'],'attributes':_0x2e4ce6['attributes'],'include':_0x2e4ce6[_0x757b('0x21')]?_[_0x757b('0x23')](_0x2e4ce6[_0x757b('0x21')],function(_0x195f1f){return{'model':db[_0x195f1f[_0x757b('0x22')]],'as':_0x195f1f['as'],'attributes':_0x195f1f[_0x757b('0x1f')],'include':_0x195f1f[_0x757b('0x21')]?_[_0x757b('0x23')](_0x195f1f[_0x757b('0x21')],function(_0x3228cf){return{'model':db[_0x3228cf[_0x757b('0x22')]],'as':_0x3228cf['as'],'attributes':_0x3228cf[_0x757b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x374c37){logger['info']('ShowMailQueue',_0x3790d5);logger[_0x757b('0x10')](_0x757b('0x25'),_0x3790d5,JSON[_0x757b('0x13')](_0x374c37));_0x51207a(_0x374c37);})[_0x757b('0x19')](function(_0x45943c){logger[_0x757b('0x14')]('ShowMailQueue',_0x45943c[_0x757b('0x16')],_0x3790d5);_0x5d1732(_0x2e11bd[_0x757b('0x14')](0x1f4,_0x45943c[_0x757b('0x16')]));});});};
\ No newline at end of file
index 402da3d..5bc0772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb36=['./mailQueue.events','save','remove','update','register','length','mailQueue:'];(function(_0x5d5c49,_0x528f94){var _0x41cb72=function(_0x4fe8e2){while(--_0x4fe8e2){_0x5d5c49['push'](_0x5d5c49['shift']());}};_0x41cb72(++_0x528f94);}(_0xbb36,0x1a4));var _0x6bb3=function(_0x145607,_0x2045d0){_0x145607=_0x145607-0x0;var _0xc18527=_0xbb36[_0x145607];return _0xc18527;};'use strict';var MailQueueEvents=require(_0x6bb3('0x0'));var events=[_0x6bb3('0x1'),_0x6bb3('0x2'),_0x6bb3('0x3')];function createListener(_0x33444f,_0x34ba11){return function(_0x1739aa){_0x34ba11['emit'](_0x33444f,_0x1739aa);};}function removeListener(_0x2380ab,_0x5b7c2b){return function(){MailQueueEvents['removeListener'](_0x2380ab,_0x5b7c2b);};}exports[_0x6bb3('0x4')]=function(_0x16cc76){for(var _0x143280=0x0,_0x5d7238=events[_0x6bb3('0x5')];_0x143280<_0x5d7238;_0x143280++){var _0x532a3e=events[_0x143280];var _0x409c74=createListener(_0x6bb3('0x6')+_0x532a3e,_0x16cc76);MailQueueEvents['on'](_0x532a3e,_0x409c74);}};
\ No newline at end of file
+var _0x50e1=['length','mailQueue:','remove','update','emit','removeListener','register'];(function(_0x3b69ec,_0x11cdfe){var _0x1745d9=function(_0x24d9b5){while(--_0x24d9b5){_0x3b69ec['push'](_0x3b69ec['shift']());}};_0x1745d9(++_0x11cdfe);}(_0x50e1,0x18a));var _0x150e=function(_0x159956,_0xa961c8){_0x159956=_0x159956-0x0;var _0x4e9473=_0x50e1[_0x159956];return _0x4e9473;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0x150e('0x0'),_0x150e('0x1')];function createListener(_0x41d3ef,_0xb03a3e){return function(_0x5543bb){_0xb03a3e[_0x150e('0x2')](_0x41d3ef,_0x5543bb);};}function removeListener(_0x3becf5,_0x206386){return function(){MailQueueEvents[_0x150e('0x3')](_0x3becf5,_0x206386);};}exports[_0x150e('0x4')]=function(_0x5d47b6){for(var _0x131382=0x0,_0x22d2db=events[_0x150e('0x5')];_0x131382<_0x22d2db;_0x131382++){var _0x77993f=events[_0x131382];var _0x5da72f=createListener(_0x150e('0x6')+_0x77993f,_0x5d47b6);MailQueueEvents['on'](_0x77993f,_0x5da72f);}};
\ No newline at end of file
index 4e8e9cc..eddfe71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x033a=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./mailQueueReport.controller','get','/describe','isAuthenticated','describe','/:id'];(function(_0x307af3,_0x4ed88c){var _0x51216d=function(_0x3cec36){while(--_0x3cec36){_0x307af3['push'](_0x307af3['shift']());}};_0x51216d(++_0x4ed88c);}(_0x033a,0x133));var _0xa033=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0x033a[_0x2dacca];return _0x4e8745;};'use strict';var multer=require(_0xa033('0x0'));var util=require(_0xa033('0x1'));var path=require(_0xa033('0x2'));var timeout=require(_0xa033('0x3'));var express=require(_0xa033('0x4'));var router=express[_0xa033('0x5')]();var auth=require(_0xa033('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa033('0x7'));router[_0xa033('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa033('0x9'),auth[_0xa033('0xa')](),controller[_0xa033('0xb')]);router['get'](_0xa033('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa033('0xd')]('/',auth['isAuthenticated'](),controller[_0xa033('0xe')]);router[_0xa033('0xf')]('/:id',auth[_0xa033('0xa')](),controller[_0xa033('0x10')]);router[_0xa033('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa033('0x12')]);module[_0xa033('0x13')]=router;
\ No newline at end of file
+var _0x3be9=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','put'];(function(_0x2d27b9,_0x169619){var _0x207cbf=function(_0x335a04){while(--_0x335a04){_0x2d27b9['push'](_0x2d27b9['shift']());}};_0x207cbf(++_0x169619);}(_0x3be9,0xb8));var _0x93be=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0x3be9[_0x57966a];return _0x191765;};'use strict';var multer=require(_0x93be('0x0'));var util=require('util');var path=require(_0x93be('0x1'));var timeout=require(_0x93be('0x2'));var express=require(_0x93be('0x3'));var router=express['Router']();var auth=require(_0x93be('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x93be('0x5'));var controller=require(_0x93be('0x6'));router[_0x93be('0x7')]('/',auth[_0x93be('0x8')](),controller[_0x93be('0x9')]);router[_0x93be('0x7')](_0x93be('0xa'),auth[_0x93be('0x8')](),controller['describe']);router[_0x93be('0x7')](_0x93be('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x93be('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x93be('0xd')](_0x93be('0xb'),auth[_0x93be('0x8')](),controller[_0x93be('0xe')]);router[_0x93be('0xf')](_0x93be('0xb'),auth[_0x93be('0x8')](),controller[_0x93be('0x10')]);module[_0x93be('0x11')]=router;
\ No newline at end of file
index 7d5b8e7..4a8500f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc152=['STRING','moment','sequelize','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc152,0xb1));var _0x2c15=function(_0x213dd5,_0x1b5e50){_0x213dd5=_0x213dd5-0x0;var _0x39955a=_0xc152[_0x213dd5];return _0x39955a;};'use strict';var moment=require(_0x2c15('0x0'));var Sequelize=require(_0x2c15('0x1'));module[_0x2c15('0x2')]={'uniqueid':{'type':Sequelize[_0x2c15('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2c15('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2c15('0x3')]}};
\ No newline at end of file
+var _0x7236=['moment','sequelize','exports','STRING','DATE'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0x7236,0x122));var _0x6723=function(_0x4d22d4,_0x522986){_0x4d22d4=_0x4d22d4-0x0;var _0x4f1a86=_0x7236[_0x4d22d4];return _0x4f1a86;};'use strict';var moment=require(_0x6723('0x0'));var Sequelize=require(_0x6723('0x1'));module[_0x6723('0x2')]={'uniqueid':{'type':Sequelize[_0x6723('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6723('0x4')]},'acceptAt':{'type':Sequelize[_0x6723('0x4')]},'exitAt':{'type':Sequelize[_0x6723('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9cedf45..55a8933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33ad=['reject','save','then','error','stack','name','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','day','merge','filter','map','type','key','VIRTUAL','field','options','MailQueueReport','includeAll','include','rows','catch','show','params','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x2f8ff6,_0x5a83bb){var _0x1cc75a=function(_0x17b872){while(--_0x17b872){_0x2f8ff6['push'](_0x2f8ff6['shift']());}};_0x1cc75a(++_0x5a83bb);}(_0x33ad,0x74));var _0xd33a=function(_0x71c12a,_0x420c10){_0x71c12a=_0x71c12a-0x0;var _0x422206=_0x33ad[_0x71c12a];return _0x422206;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd33a('0x0'));var rimraf=require(_0xd33a('0x1'));var zipdir=require(_0xd33a('0x2'));var jsonpatch=require(_0xd33a('0x3'));var rp=require(_0xd33a('0x4'));var moment=require(_0xd33a('0x5'));var BPromise=require(_0xd33a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd33a('0x7'));var ejs=require(_0xd33a('0x8'));var fs=require('fs');var _=require(_0xd33a('0x9'));var squel=require(_0xd33a('0xa'));var crypto=require(_0xd33a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd33a('0x7'));var querystring=require(_0xd33a('0xc'));var Papa=require(_0xd33a('0xd'));var Redis=require('ioredis');var qs=require(_0xd33a('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0xd33a('0xf'));var config=require(_0xd33a('0x10'));var db=require(_0xd33a('0x11'))['db'];function respondWithStatusCode(_0x1497e4,_0x224e1b){_0x224e1b=_0x224e1b||0xcc;return function(_0xf89b19){if(_0xf89b19){return _0x1497e4[_0xd33a('0x12')](_0x224e1b);}return _0x1497e4[_0xd33a('0x13')](_0x224e1b)[_0xd33a('0x14')]();};}function respondWithResult(_0x15e8fe,_0x14c679){_0x14c679=_0x14c679||0xc8;return function(_0x414ce0){if(_0x414ce0){return _0x15e8fe[_0xd33a('0x13')](_0x14c679)[_0xd33a('0x15')](_0x414ce0);}};}function respondWithFilteredResult(_0x49f102,_0x3bd9f6){return function(_0x4a0d62){if(_0x4a0d62){var _0x16db6b=_0x4a0d62[_0xd33a('0x16')],_0x74c31b=_0x3bd9f6[_0xd33a('0x17')],_0x4c41a3=_0x3bd9f6['offset']+_0x3bd9f6[_0xd33a('0x18')],_0x289dc5;if(_0x4c41a3>=_0x16db6b){_0x4c41a3=_0x16db6b;_0x289dc5=0xc8;}else{_0x289dc5=0xce;}_0x49f102[_0xd33a('0x13')](_0x289dc5);return _0x49f102[_0xd33a('0x19')](_0xd33a('0x1a'),_0x74c31b+'-'+_0x4c41a3+'/'+_0x16db6b)[_0xd33a('0x15')](_0x4a0d62);}return null;};}function patchUpdates(_0x56e93a){return function(_0x5d680a){try{jsonpatch[_0xd33a('0x1b')](_0x5d680a,_0x56e93a,!![]);}catch(_0x25c234){return BPromise[_0xd33a('0x1c')](_0x25c234);}return _0x5d680a[_0xd33a('0x1d')]();};}function saveUpdates(_0x4bb5a1,_0x50cb97){return function(_0x242d08){if(_0x242d08){return _0x242d08['update'](_0x4bb5a1)['then'](function(_0x1b4d42){return _0x1b4d42;});}return null;};}function removeEntity(_0x62d8c,_0x5d93d4){return function(_0x2c5fe3){if(_0x2c5fe3){return _0x2c5fe3['destroy']()[_0xd33a('0x1e')](function(){_0x62d8c[_0xd33a('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d012e,_0x220c22){return function(_0x10070c){if(!_0x10070c){_0x2d012e[_0xd33a('0x12')](0x194);}return _0x10070c;};}function handleError(_0x24a570,_0x431604){_0x431604=_0x431604||0x1f4;return function(_0x2c0af4){logger[_0xd33a('0x1f')](_0x2c0af4[_0xd33a('0x20')]);if(_0x2c0af4[_0xd33a('0x21')]){delete _0x2c0af4[_0xd33a('0x21')];}_0x24a570[_0xd33a('0x13')](_0x431604)['send'](_0x2c0af4);};}exports['index']=function(_0x79a742,_0x31a67b){var _0x57d09f={},_0x113419={},_0x155383={'count':0x0,'rows':[]};var _0x343889=db['MailQueueReport'][_0xd33a('0x22')];_0x113419['model']=_[_0xd33a('0x23')](_0x343889);var _0x5df0de={'dateStart':_0x79a742[_0xd33a('0x24')][_0xd33a('0x25')],'dateEnd':_0x79a742[_0xd33a('0x24')][_0xd33a('0x26')]};delete _0x79a742[_0xd33a('0x24')][_0xd33a('0x25')];delete _0x79a742[_0xd33a('0x24')][_0xd33a('0x26')];_0x113419[_0xd33a('0x24')]=_[_0xd33a('0x23')](_0x79a742['query']);_0x113419[_0xd33a('0x27')]=_[_0xd33a('0x28')](_0x113419[_0xd33a('0x29')],_0x113419[_0xd33a('0x24')]);_0x57d09f[_0xd33a('0x2a')]=_[_0xd33a('0x28')](_0x113419[_0xd33a('0x29')],qs[_0xd33a('0x2b')](_0x79a742[_0xd33a('0x24')][_0xd33a('0x2b')]));_0x57d09f[_0xd33a('0x2a')]=_0x57d09f[_0xd33a('0x2a')][_0xd33a('0x2c')]?_0x57d09f[_0xd33a('0x2a')]:_0x113419[_0xd33a('0x29')];if(!_0x79a742[_0xd33a('0x24')][_0xd33a('0x2d')](_0xd33a('0x2e'))){_0x57d09f['limit']=qs[_0xd33a('0x18')](_0x79a742[_0xd33a('0x24')][_0xd33a('0x18')]);_0x57d09f[_0xd33a('0x17')]=qs[_0xd33a('0x17')](_0x79a742['query'][_0xd33a('0x17')]);}_0x57d09f['order']=qs['sort'](_0x79a742[_0xd33a('0x24')][_0xd33a('0x2f')]);_0x57d09f[_0xd33a('0x30')]=qs[_0xd33a('0x27')](_[_0xd33a('0x31')](_0x79a742['query'],_0x113419['filters']));if(_0x5df0de[_0xd33a('0x25')]){if(_0x5df0de['dateEnd']){_0x5df0de[_0xd33a('0x26')]=moment(_0x5df0de[_0xd33a('0x26')])['add'](0x1,'day');}else{_0x5df0de[_0xd33a('0x26')]=moment(_0x5df0de[_0xd33a('0x25')])['add'](0x1,_0xd33a('0x32'));}_[_0xd33a('0x33')](_0x57d09f[_0xd33a('0x30')],{'createdAt':{'$gte':_0x5df0de[_0xd33a('0x25')],'$lte':_0x5df0de[_0xd33a('0x26')]}});}if(_0x79a742['query'][_0xd33a('0x34')]){_0x57d09f[_0xd33a('0x30')]=_[_0xd33a('0x33')](_0x57d09f[_0xd33a('0x30')],{'$or':_[_0xd33a('0x35')](_0x343889,function(_0x1eddd8){if(_0x1eddd8[_0xd33a('0x36')][_0xd33a('0x37')]!==_0xd33a('0x38')){var _0x52c4a5={};_0x52c4a5[_0x1eddd8[_0xd33a('0x39')]]={'$like':'%'+_0x79a742[_0xd33a('0x24')][_0xd33a('0x34')]+'%'};return _0x52c4a5;}})});}_0x57d09f=_[_0xd33a('0x33')]({},_0x57d09f,_0x79a742[_0xd33a('0x3a')]);var _0x264d0b={'where':_0x57d09f[_0xd33a('0x30')]};return db[_0xd33a('0x3b')][_0xd33a('0x16')](_0x264d0b)['then'](function(_0x5be473){_0x155383[_0xd33a('0x16')]=_0x5be473;if(_0x79a742[_0xd33a('0x24')][_0xd33a('0x3c')]){_0x57d09f[_0xd33a('0x3d')]=[{'all':!![]}];}return db[_0xd33a('0x3b')]['findAll'](_0x57d09f);})['then'](function(_0x9c3d45){_0x155383[_0xd33a('0x3e')]=_0x9c3d45;return _0x155383;})[_0xd33a('0x1e')](respondWithFilteredResult(_0x31a67b,_0x57d09f))[_0xd33a('0x3f')](handleError(_0x31a67b,null));};exports[_0xd33a('0x40')]=function(_0x1535a1,_0x1276aa){var _0x52f4ff={'raw':!![],'where':{'id':_0x1535a1[_0xd33a('0x41')]['id']}},_0x22a2dd={};_0x22a2dd[_0xd33a('0x29')]=_[_0xd33a('0x23')](db[_0xd33a('0x3b')][_0xd33a('0x22')]);_0x22a2dd[_0xd33a('0x24')]=_['keys'](_0x1535a1[_0xd33a('0x24')]);_0x22a2dd[_0xd33a('0x27')]=_[_0xd33a('0x28')](_0x22a2dd[_0xd33a('0x29')],_0x22a2dd[_0xd33a('0x24')]);_0x52f4ff[_0xd33a('0x2a')]=_['intersection'](_0x22a2dd['model'],qs[_0xd33a('0x2b')](_0x1535a1[_0xd33a('0x24')]['fields']));_0x52f4ff[_0xd33a('0x2a')]=_0x52f4ff[_0xd33a('0x2a')]['length']?_0x52f4ff['attributes']:_0x22a2dd['model'];if(_0x1535a1[_0xd33a('0x24')][_0xd33a('0x3c')]){_0x52f4ff[_0xd33a('0x3d')]=[{'all':!![]}];}_0x52f4ff=_[_0xd33a('0x33')]({},_0x52f4ff,_0x1535a1['options']);return db['MailQueueReport'][_0xd33a('0x42')](_0x52f4ff)['then'](handleEntityNotFound(_0x1276aa,null))[_0xd33a('0x1e')](respondWithResult(_0x1276aa,null))[_0xd33a('0x3f')](handleError(_0x1276aa,null));};exports[_0xd33a('0x43')]=function(_0x2db177,_0x11b328){return db[_0xd33a('0x3b')]['create'](_0x2db177[_0xd33a('0x44')],{})[_0xd33a('0x1e')](respondWithResult(_0x11b328,0xc9))[_0xd33a('0x3f')](handleError(_0x11b328,null));};exports[_0xd33a('0x45')]=function(_0x5aaf6d,_0x3600b1){if(_0x5aaf6d[_0xd33a('0x44')]['id']){delete _0x5aaf6d[_0xd33a('0x44')]['id'];}return db[_0xd33a('0x3b')][_0xd33a('0x42')]({'where':{'id':_0x5aaf6d['params']['id']}})[_0xd33a('0x1e')](handleEntityNotFound(_0x3600b1,null))[_0xd33a('0x1e')](saveUpdates(_0x5aaf6d[_0xd33a('0x44')],null))[_0xd33a('0x1e')](respondWithResult(_0x3600b1,null))[_0xd33a('0x3f')](handleError(_0x3600b1,null));};exports[_0xd33a('0x46')]=function(_0x54fc54,_0x156434){return db['MailQueueReport'][_0xd33a('0x42')]({'where':{'id':_0x54fc54[_0xd33a('0x41')]['id']}})[_0xd33a('0x1e')](handleEntityNotFound(_0x156434,null))[_0xd33a('0x1e')](removeEntity(_0x156434,null))[_0xd33a('0x3f')](handleError(_0x156434,null));};exports['describe']=function(_0x2a5aa2,_0x4023ec){return db[_0xd33a('0x3b')][_0xd33a('0x47')]()[_0xd33a('0x1e')](respondWithResult(_0x4023ec,null))[_0xd33a('0x3f')](handleError(_0x4023ec,null));};
\ No newline at end of file
+var _0xd2bb=['name','send','index','MailQueueReport','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','order','sort','pick','day','add','merge','where','map','key','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','catch','show','rawAttributes','length','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','json','reject','save','then','destroy','error'];(function(_0x4a7d36,_0x8066f0){var _0x145bcd=function(_0x2dcb3a){while(--_0x2dcb3a){_0x4a7d36['push'](_0x4a7d36['shift']());}};_0x145bcd(++_0x8066f0);}(_0xd2bb,0xb9));var _0xbd2b=function(_0x2e60cf,_0x309262){_0x2e60cf=_0x2e60cf-0x0;var _0xa18531=_0xd2bb[_0x2e60cf];return _0xa18531;};'use strict';var pdf=require(_0xbd2b('0x0'));var emlformat=require(_0xbd2b('0x1'));var rimraf=require(_0xbd2b('0x2'));var zipdir=require(_0xbd2b('0x3'));var jsonpatch=require(_0xbd2b('0x4'));var rp=require(_0xbd2b('0x5'));var moment=require('moment');var BPromise=require(_0xbd2b('0x6'));var Mustache=require(_0xbd2b('0x7'));var util=require(_0xbd2b('0x8'));var path=require('path');var sox=require(_0xbd2b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd2b('0xa'));var squel=require(_0xbd2b('0xb'));var crypto=require(_0xbd2b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbd2b('0xd'));var querystring=require(_0xbd2b('0xe'));var Papa=require(_0xbd2b('0xf'));var Redis=require(_0xbd2b('0x10'));var qs=require(_0xbd2b('0x11'));var logger=require(_0xbd2b('0x12'))(_0xbd2b('0x13'));var utils=require(_0xbd2b('0x14'));var config=require(_0xbd2b('0x15'));var db=require(_0xbd2b('0x16'))['db'];function respondWithStatusCode(_0x652d4d,_0x37d497){_0x37d497=_0x37d497||0xcc;return function(_0x5014fa){if(_0x5014fa){return _0x652d4d[_0xbd2b('0x17')](_0x37d497);}return _0x652d4d[_0xbd2b('0x18')](_0x37d497)[_0xbd2b('0x19')]();};}function respondWithResult(_0x3c3e3f,_0x562665){_0x562665=_0x562665||0xc8;return function(_0x2a04a2){if(_0x2a04a2){return _0x3c3e3f[_0xbd2b('0x18')](_0x562665)['json'](_0x2a04a2);}};}function respondWithFilteredResult(_0x2888bd,_0x5f9c56){return function(_0x3111b8){if(_0x3111b8){var _0x256be=_0x3111b8['count'],_0x153b60=_0x5f9c56[_0xbd2b('0x1a')],_0x2d054a=_0x5f9c56['offset']+_0x5f9c56[_0xbd2b('0x1b')],_0x2dd6b6;if(_0x2d054a>=_0x256be){_0x2d054a=_0x256be;_0x2dd6b6=0xc8;}else{_0x2dd6b6=0xce;}_0x2888bd[_0xbd2b('0x18')](_0x2dd6b6);return _0x2888bd['set']('Content-Range',_0x153b60+'-'+_0x2d054a+'/'+_0x256be)[_0xbd2b('0x1c')](_0x3111b8);}return null;};}function patchUpdates(_0x4aed10){return function(_0x513de4){try{jsonpatch['apply'](_0x513de4,_0x4aed10,!![]);}catch(_0x326f44){return BPromise[_0xbd2b('0x1d')](_0x326f44);}return _0x513de4[_0xbd2b('0x1e')]();};}function saveUpdates(_0x32f676,_0x4fb501){return function(_0x2cabe2){if(_0x2cabe2){return _0x2cabe2['update'](_0x32f676)[_0xbd2b('0x1f')](function(_0x1b71e2){return _0x1b71e2;});}return null;};}function removeEntity(_0x1a3d57,_0x1681a9){return function(_0x3b0b04){if(_0x3b0b04){return _0x3b0b04[_0xbd2b('0x20')]()[_0xbd2b('0x1f')](function(){_0x1a3d57[_0xbd2b('0x18')](0xcc)[_0xbd2b('0x19')]();});}};}function handleEntityNotFound(_0x42b9f9,_0x2486f8){return function(_0x2b69ae){if(!_0x2b69ae){_0x42b9f9[_0xbd2b('0x17')](0x194);}return _0x2b69ae;};}function handleError(_0x261937,_0x5acbbc){_0x5acbbc=_0x5acbbc||0x1f4;return function(_0x342f79){logger[_0xbd2b('0x21')](_0x342f79['stack']);if(_0x342f79[_0xbd2b('0x22')]){delete _0x342f79['name'];}_0x261937[_0xbd2b('0x18')](_0x5acbbc)[_0xbd2b('0x23')](_0x342f79);};}exports[_0xbd2b('0x24')]=function(_0x5c1c87,_0xfaacec){var _0x5ee171={},_0x40e300={},_0xa0c63a={'count':0x0,'rows':[]};var _0x22fc02=db[_0xbd2b('0x25')]['rawAttributes'];_0x40e300[_0xbd2b('0x26')]=_[_0xbd2b('0x27')](_0x22fc02);var _0x49871c={'dateStart':_0x5c1c87['query'][_0xbd2b('0x28')],'dateEnd':_0x5c1c87[_0xbd2b('0x29')]['dateEnd']};delete _0x5c1c87[_0xbd2b('0x29')]['dateStart'];delete _0x5c1c87[_0xbd2b('0x29')][_0xbd2b('0x2a')];_0x40e300['query']=_['keys'](_0x5c1c87[_0xbd2b('0x29')]);_0x40e300[_0xbd2b('0x2b')]=_[_0xbd2b('0x2c')](_0x40e300['model'],_0x40e300['query']);_0x5ee171[_0xbd2b('0x2d')]=_[_0xbd2b('0x2c')](_0x40e300[_0xbd2b('0x26')],qs[_0xbd2b('0x2e')](_0x5c1c87['query'][_0xbd2b('0x2e')]));_0x5ee171[_0xbd2b('0x2d')]=_0x5ee171[_0xbd2b('0x2d')]['length']?_0x5ee171['attributes']:_0x40e300[_0xbd2b('0x26')];if(!_0x5c1c87[_0xbd2b('0x29')]['hasOwnProperty']('nolimit')){_0x5ee171[_0xbd2b('0x1b')]=qs[_0xbd2b('0x1b')](_0x5c1c87[_0xbd2b('0x29')]['limit']);_0x5ee171[_0xbd2b('0x1a')]=qs[_0xbd2b('0x1a')](_0x5c1c87[_0xbd2b('0x29')]['offset']);}_0x5ee171[_0xbd2b('0x2f')]=qs[_0xbd2b('0x30')](_0x5c1c87['query'][_0xbd2b('0x30')]);_0x5ee171['where']=qs[_0xbd2b('0x2b')](_[_0xbd2b('0x31')](_0x5c1c87['query'],_0x40e300['filters']));if(_0x49871c['dateStart']){if(_0x49871c['dateEnd']){_0x49871c['dateEnd']=moment(_0x49871c[_0xbd2b('0x2a')])['add'](0x1,_0xbd2b('0x32'));}else{_0x49871c[_0xbd2b('0x2a')]=moment(_0x49871c[_0xbd2b('0x28')])[_0xbd2b('0x33')](0x1,_0xbd2b('0x32'));}_[_0xbd2b('0x34')](_0x5ee171[_0xbd2b('0x35')],{'createdAt':{'$gte':_0x49871c[_0xbd2b('0x28')],'$lte':_0x49871c['dateEnd']}});}if(_0x5c1c87[_0xbd2b('0x29')]['filter']){_0x5ee171['where']=_[_0xbd2b('0x34')](_0x5ee171[_0xbd2b('0x35')],{'$or':_[_0xbd2b('0x36')](_0x22fc02,function(_0x2c5420){if(_0x2c5420['type'][_0xbd2b('0x37')]!==_0xbd2b('0x38')){var _0x35f67b={};_0x35f67b[_0x2c5420[_0xbd2b('0x39')]]={'$like':'%'+_0x5c1c87[_0xbd2b('0x29')][_0xbd2b('0x3a')]+'%'};return _0x35f67b;}})});}_0x5ee171=_['merge']({},_0x5ee171,_0x5c1c87['options']);var _0x1f6e3f={'where':_0x5ee171[_0xbd2b('0x35')]};return db[_0xbd2b('0x25')][_0xbd2b('0x3b')](_0x1f6e3f)[_0xbd2b('0x1f')](function(_0x202f16){_0xa0c63a[_0xbd2b('0x3b')]=_0x202f16;if(_0x5c1c87[_0xbd2b('0x29')][_0xbd2b('0x3c')]){_0x5ee171[_0xbd2b('0x3d')]=[{'all':!![]}];}return db[_0xbd2b('0x25')][_0xbd2b('0x3e')](_0x5ee171);})[_0xbd2b('0x1f')](function(_0x3ade08){_0xa0c63a[_0xbd2b('0x3f')]=_0x3ade08;return _0xa0c63a;})['then'](respondWithFilteredResult(_0xfaacec,_0x5ee171))[_0xbd2b('0x40')](handleError(_0xfaacec,null));};exports[_0xbd2b('0x41')]=function(_0x443ab6,_0x52777f){var _0x215e72={'raw':!![],'where':{'id':_0x443ab6['params']['id']}},_0x4c26dc={};_0x4c26dc[_0xbd2b('0x26')]=_[_0xbd2b('0x27')](db[_0xbd2b('0x25')][_0xbd2b('0x42')]);_0x4c26dc[_0xbd2b('0x29')]=_[_0xbd2b('0x27')](_0x443ab6['query']);_0x4c26dc[_0xbd2b('0x2b')]=_[_0xbd2b('0x2c')](_0x4c26dc[_0xbd2b('0x26')],_0x4c26dc['query']);_0x215e72['attributes']=_[_0xbd2b('0x2c')](_0x4c26dc[_0xbd2b('0x26')],qs[_0xbd2b('0x2e')](_0x443ab6['query'][_0xbd2b('0x2e')]));_0x215e72[_0xbd2b('0x2d')]=_0x215e72[_0xbd2b('0x2d')][_0xbd2b('0x43')]?_0x215e72[_0xbd2b('0x2d')]:_0x4c26dc[_0xbd2b('0x26')];if(_0x443ab6['query'][_0xbd2b('0x3c')]){_0x215e72[_0xbd2b('0x3d')]=[{'all':!![]}];}_0x215e72=_[_0xbd2b('0x34')]({},_0x215e72,_0x443ab6['options']);return db[_0xbd2b('0x25')]['find'](_0x215e72)['then'](handleEntityNotFound(_0x52777f,null))[_0xbd2b('0x1f')](respondWithResult(_0x52777f,null))['catch'](handleError(_0x52777f,null));};exports['create']=function(_0x326e0d,_0x3bfd22){return db[_0xbd2b('0x25')][_0xbd2b('0x44')](_0x326e0d[_0xbd2b('0x45')],{})[_0xbd2b('0x1f')](respondWithResult(_0x3bfd22,0xc9))['catch'](handleError(_0x3bfd22,null));};exports['update']=function(_0x10f413,_0x115ddb){if(_0x10f413[_0xbd2b('0x45')]['id']){delete _0x10f413[_0xbd2b('0x45')]['id'];}return db[_0xbd2b('0x25')][_0xbd2b('0x46')]({'where':{'id':_0x10f413[_0xbd2b('0x47')]['id']}})[_0xbd2b('0x1f')](handleEntityNotFound(_0x115ddb,null))[_0xbd2b('0x1f')](saveUpdates(_0x10f413[_0xbd2b('0x45')],null))['then'](respondWithResult(_0x115ddb,null))['catch'](handleError(_0x115ddb,null));};exports[_0xbd2b('0x20')]=function(_0x53ad46,_0x443132){return db[_0xbd2b('0x25')]['find']({'where':{'id':_0x53ad46[_0xbd2b('0x47')]['id']}})['then'](handleEntityNotFound(_0x443132,null))[_0xbd2b('0x1f')](removeEntity(_0x443132,null))[_0xbd2b('0x40')](handleError(_0x443132,null));};exports['describe']=function(_0x18feda,_0x4cd3df){return db['MailQueueReport'][_0xbd2b('0x48')]()[_0xbd2b('0x1f')](respondWithResult(_0x4cd3df,null))[_0xbd2b('0x40')](handleError(_0x4cd3df,null));};
\ No newline at end of file
index 7127c39..a91a121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x514d=['MailQueueReport','uniqueid','util','../../config/logger','api','request-promise','./mailQueueReport.attributes','define'];(function(_0x46ef2d,_0x535cdf){var _0xc36575=function(_0x3c2741){while(--_0x3c2741){_0x46ef2d['push'](_0x46ef2d['shift']());}};_0xc36575(++_0x535cdf);}(_0x514d,0x172));var _0xd514=function(_0x45b098,_0x12fa2b){_0x45b098=_0x45b098-0x0;var _0x341ce7=_0x514d[_0x45b098];return _0x341ce7;};'use strict';var _=require('lodash');var util=require(_0xd514('0x0'));var logger=require(_0xd514('0x1'))(_0xd514('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd514('0x3'));var attributes=require(_0xd514('0x4'));module['exports']=function(_0x3c2163,_0x559995){return _0x3c2163[_0xd514('0x5')](_0xd514('0x6'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xd514('0x7'),'fields':[_0xd514('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6c2=['util','../../config/logger','api','moment','bluebird','request-promise','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0xe4dfd9,_0x34dda4){var _0x1c2a0f=function(_0xb49185){while(--_0xb49185){_0xe4dfd9['push'](_0xe4dfd9['shift']());}};_0x1c2a0f(++_0x34dda4);}(_0xe6c2,0x192));var _0x2e6c=function(_0x41217b,_0x1870fd){_0x41217b=_0x41217b-0x0;var _0x298da9=_0xe6c2[_0x41217b];return _0x298da9;};'use strict';var _=require(_0x2e6c('0x0'));var util=require(_0x2e6c('0x1'));var logger=require(_0x2e6c('0x2'))(_0x2e6c('0x3'));var moment=require(_0x2e6c('0x4'));var BPromise=require(_0x2e6c('0x5'));var rp=require(_0x2e6c('0x6'));var attributes=require(_0x2e6c('0x7'));module[_0x2e6c('0x8')]=function(_0x1fbfa6,_0x1e163d){return _0x1fbfa6[_0x2e6c('0x9')](_0x2e6c('0xa'),attributes,{'tableName':_0x2e6c('0xb'),'paranoid':![],'indexes':[{'name':_0x2e6c('0xc'),'fields':[_0x2e6c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 2af80eb..c8724a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1636=['MailQueueReport,\x20%s,\x20%s','result','catch','CreateMailQueueReport','create','body','options','raw','UpdateMailQueueReport','MailQueueReport','update','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x350a47,_0x1dd7ea){var _0x5cabeb=function(_0x1c0dbf){while(--_0x1c0dbf){_0x350a47['push'](_0x350a47['shift']());}};_0x5cabeb(++_0x1dd7ea);}(_0x1636,0x1b1));var _0x6163=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1636[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6163('0x0'));var util=require('util');var moment=require(_0x6163('0x1'));var BPromise=require('bluebird');var rs=require(_0x6163('0x2'));var fs=require('fs');var Redis=require(_0x6163('0x3'));var db=require(_0x6163('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6163('0x5'));var config=require(_0x6163('0x6'));var jayson=require(_0x6163('0x7'));var client=jayson['client'][_0x6163('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3705ec,_0x3c2b1a,_0x417353){return new BPromise(function(_0x332d4e,_0x29f3c3){return client['request'](_0x3705ec,_0x417353)[_0x6163('0x9')](function(_0x203021){logger[_0x6163('0xa')]('MailQueueReport,\x20%s,\x20%s',_0x3c2b1a,_0x6163('0xb'));logger[_0x6163('0xc')](_0x6163('0xd'),_0x3c2b1a,'request\x20sent',JSON[_0x6163('0xe')](_0x203021));if(_0x203021['error']){if(_0x203021[_0x6163('0xf')]['code']===0x1f4){logger[_0x6163('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3c2b1a,_0x203021[_0x6163('0xf')][_0x6163('0x10')]);return _0x29f3c3(_0x203021[_0x6163('0xf')][_0x6163('0x10')]);}logger[_0x6163('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3c2b1a,_0x203021[_0x6163('0xf')][_0x6163('0x10')]);return _0x332d4e(_0x203021['error'][_0x6163('0x10')]);}else{logger['info'](_0x6163('0x11'),_0x3c2b1a,_0x6163('0xb'));_0x332d4e(_0x203021[_0x6163('0x12')][_0x6163('0x10')]);}})[_0x6163('0x13')](function(_0x250e6e){logger['error'](_0x6163('0x11'),_0x3c2b1a,_0x250e6e);_0x29f3c3(_0x250e6e);});});}exports[_0x6163('0x14')]=function(_0x2500e0){var _0x47d9b5=this;return new Promise(function(_0x1dffc4,_0x393ef9){return db['MailQueueReport'][_0x6163('0x15')](_0x2500e0[_0x6163('0x16')],{'raw':_0x2500e0[_0x6163('0x17')]?_0x2500e0['options'][_0x6163('0x18')]===undefined?!![]:![]:!![]})[_0x6163('0x9')](function(_0x36b795){logger[_0x6163('0xa')](_0x6163('0x14'),_0x2500e0);logger[_0x6163('0xc')]('CreateMailQueueReport',_0x2500e0,JSON[_0x6163('0xe')](_0x36b795));_0x1dffc4(_0x36b795);})[_0x6163('0x13')](function(_0x2c6ae2){logger['error'](_0x6163('0x14'),_0x2c6ae2[_0x6163('0x10')],_0x2500e0);_0x393ef9(_0x47d9b5[_0x6163('0xf')](0x1f4,_0x2c6ae2[_0x6163('0x10')]));});});};exports[_0x6163('0x19')]=function(_0xe7883e){var _0x2c7a45=this;return new Promise(function(_0x51e53c,_0x5f5de3){return db[_0x6163('0x1a')][_0x6163('0x1b')](_0xe7883e[_0x6163('0x16')],{'raw':_0xe7883e[_0x6163('0x17')]?_0xe7883e[_0x6163('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe7883e['options']?_0xe7883e[_0x6163('0x17')]['where']||null:null,'attributes':_0xe7883e[_0x6163('0x17')]?_0xe7883e[_0x6163('0x17')][_0x6163('0x1c')]||null:null,'limit':_0xe7883e[_0x6163('0x17')]?_0xe7883e['options'][_0x6163('0x1d')]||null:null})[_0x6163('0x9')](function(_0x48168d){logger[_0x6163('0xa')](_0x6163('0x19'),_0xe7883e);logger['debug'](_0x6163('0x19'),_0xe7883e,JSON[_0x6163('0xe')](_0x48168d));_0x51e53c(_0x48168d);})['catch'](function(_0x30695b){logger[_0x6163('0xf')]('UpdateMailQueueReport',_0x30695b[_0x6163('0x10')],_0xe7883e);_0x5f5de3(_0x2c7a45['error'](0x1f4,_0x30695b[_0x6163('0x10')]));});});};
\ No newline at end of file
+var _0xa18c=['CreateMailQueueReport','body','options','then','stringify','UpdateMailQueueReport','MailQueueReport','update','raw','where','attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa18c,0x115));var _0xca18=function(_0x1e3649,_0x5c9921){_0x1e3649=_0x1e3649-0x0;var _0x18dcf0=_0xa18c[_0x1e3649];return _0x18dcf0;};'use strict';var _=require(_0xca18('0x0'));var util=require(_0xca18('0x1'));var moment=require(_0xca18('0x2'));var BPromise=require(_0xca18('0x3'));var rs=require(_0xca18('0x4'));var fs=require('fs');var Redis=require(_0xca18('0x5'));var db=require(_0xca18('0x6'))['db'];var utils=require(_0xca18('0x7'));var logger=require('../../config/logger')(_0xca18('0x8'));var config=require(_0xca18('0x9'));var jayson=require(_0xca18('0xa'));var client=jayson[_0xca18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44c051,_0x831a59,_0x30309e){return new BPromise(function(_0x413ab2,_0x28d0a8){return client['request'](_0x44c051,_0x30309e)['then'](function(_0x418ed9){logger[_0xca18('0xc')](_0xca18('0xd'),_0x831a59,'request\x20sent');logger['debug'](_0xca18('0xe'),_0x831a59,_0xca18('0xf'),JSON['stringify'](_0x418ed9));if(_0x418ed9[_0xca18('0x10')]){if(_0x418ed9[_0xca18('0x10')][_0xca18('0x11')]===0x1f4){logger[_0xca18('0x10')](_0xca18('0xd'),_0x831a59,_0x418ed9['error'][_0xca18('0x12')]);return _0x28d0a8(_0x418ed9[_0xca18('0x10')][_0xca18('0x12')]);}logger[_0xca18('0x10')](_0xca18('0xd'),_0x831a59,_0x418ed9[_0xca18('0x10')]['message']);return _0x413ab2(_0x418ed9[_0xca18('0x10')][_0xca18('0x12')]);}else{logger[_0xca18('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x831a59,_0xca18('0xf'));_0x413ab2(_0x418ed9['result'][_0xca18('0x12')]);}})[_0xca18('0x13')](function(_0xfd0792){logger[_0xca18('0x10')](_0xca18('0xd'),_0x831a59,_0xfd0792);_0x28d0a8(_0xfd0792);});});}exports[_0xca18('0x14')]=function(_0x4cd364){var _0x501e82=this;return new Promise(function(_0x637a03,_0x26c19b){return db['MailQueueReport']['create'](_0x4cd364[_0xca18('0x15')],{'raw':_0x4cd364[_0xca18('0x16')]?_0x4cd364['options']['raw']===undefined?!![]:![]:!![]})[_0xca18('0x17')](function(_0x1fc047){logger[_0xca18('0xc')]('CreateMailQueueReport',_0x4cd364);logger['debug'](_0xca18('0x14'),_0x4cd364,JSON[_0xca18('0x18')](_0x1fc047));_0x637a03(_0x1fc047);})[_0xca18('0x13')](function(_0x4838eb){logger[_0xca18('0x10')](_0xca18('0x14'),_0x4838eb['message'],_0x4cd364);_0x26c19b(_0x501e82[_0xca18('0x10')](0x1f4,_0x4838eb[_0xca18('0x12')]));});});};exports[_0xca18('0x19')]=function(_0x4e2160){var _0x19c65f=this;return new Promise(function(_0x38fd62,_0x2f169a){return db[_0xca18('0x1a')][_0xca18('0x1b')](_0x4e2160[_0xca18('0x15')],{'raw':_0x4e2160[_0xca18('0x16')]?_0x4e2160[_0xca18('0x16')][_0xca18('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e2160[_0xca18('0x16')]?_0x4e2160[_0xca18('0x16')][_0xca18('0x1d')]||null:null,'attributes':_0x4e2160[_0xca18('0x16')]?_0x4e2160[_0xca18('0x16')][_0xca18('0x1e')]||null:null,'limit':_0x4e2160['options']?_0x4e2160[_0xca18('0x16')][_0xca18('0x1f')]||null:null})[_0xca18('0x17')](function(_0x49aaa9){logger[_0xca18('0xc')](_0xca18('0x19'),_0x4e2160);logger[_0xca18('0x20')](_0xca18('0x19'),_0x4e2160,JSON['stringify'](_0x49aaa9));_0x38fd62(_0x49aaa9);})[_0xca18('0x13')](function(_0x4e38d9){logger[_0xca18('0x10')](_0xca18('0x19'),_0x4e38d9['message'],_0x4e2160);_0x2f169a(_0x19c65f[_0xca18('0x10')](0x1f4,_0x4e38d9[_0xca18('0x12')]));});});};
\ No newline at end of file
index c2d65d3..4957d40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b47=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x36403f,_0x3fb52a){var _0x1ca1cf=function(_0x4e2455){while(--_0x4e2455){_0x36403f['push'](_0x36403f['shift']());}};_0x1ca1cf(++_0x3fb52a);}(_0x2b47,0x177));var _0x72b4=function(_0x5d0db6,_0x40828f){_0x5d0db6=_0x5d0db6-0x0;var _0x267c66=_0x2b47[_0x5d0db6];return _0x267c66;};'use strict';var multer=require(_0x72b4('0x0'));var util=require('util');var path=require(_0x72b4('0x1'));var timeout=require(_0x72b4('0x2'));var express=require(_0x72b4('0x3'));var router=express['Router']();var auth=require(_0x72b4('0x4'));var interaction=require(_0x72b4('0x5'));var config=require(_0x72b4('0x6'));module[_0x72b4('0x7')]=router;
\ No newline at end of file
+var _0x06ae=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x06ae,0x16e));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xe06a('0x0'));var path=require(_0xe06a('0x1'));var timeout=require(_0xe06a('0x2'));var express=require(_0xe06a('0x3'));var router=express[_0xe06a('0x4')]();var auth=require(_0xe06a('0x5'));var interaction=require(_0xe06a('0x6'));var config=require(_0xe06a('0x7'));module[_0xe06a('0x8')]=router;
\ No newline at end of file
index 873f32b..0ce2694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e0d=['BOOLEAN','sequelize','exports','STRING','username','INTEGER'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x5dd789,_0x4a15c2){_0x5dd789=_0x5dd789-0x0;var _0x259a41=_0x9e0d[_0x5dd789];return _0x259a41;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'description':{'type':Sequelize[_0xd9e0('0x2')]},'host':{'type':Sequelize[_0xd9e0('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xd9e0('0x2')],'unique':_0xd9e0('0x3')},'password':{'type':Sequelize[_0xd9e0('0x2')]},'port':{'type':Sequelize[_0xd9e0('0x4')]},'tls':{'type':Sequelize[_0xd9e0('0x5')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd9e0('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd9e0('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd9e0('0x2')]}};
\ No newline at end of file
+var _0xa0bc=['exports','STRING','BOOLEAN','username','INTEGER','INBOX'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xca0b('0x0')]={'description':{'type':Sequelize[_0xca0b('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xca0b('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xca0b('0x1')],'unique':_0xca0b('0x3')},'password':{'type':Sequelize[_0xca0b('0x1')]},'port':{'type':Sequelize[_0xca0b('0x4')]},'tls':{'type':Sequelize[_0xca0b('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xca0b('0x1')],'defaultValue':_0xca0b('0x5')},'connTimeout':{'type':Sequelize[_0xca0b('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xca0b('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xca0b('0x1')]}};
\ No newline at end of file
index a2f5e44..5ddff00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b59=['./mailServerIn.attributes','define','MailServerIn','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5d0354,_0x4cfec4){var _0x367575=function(_0x58a202){while(--_0x58a202){_0x5d0354['push'](_0x5d0354['shift']());}};_0x367575(++_0x4cfec4);}(_0x3b59,0x9c));var _0x93b5=function(_0x398b34,_0xfedab3){_0x398b34=_0x398b34-0x0;var _0x518a80=_0x3b59[_0x398b34];return _0x518a80;};'use strict';var _=require(_0x93b5('0x0'));var util=require(_0x93b5('0x1'));var logger=require(_0x93b5('0x2'))(_0x93b5('0x3'));var moment=require(_0x93b5('0x4'));var BPromise=require(_0x93b5('0x5'));var rp=require('request-promise');var attributes=require(_0x93b5('0x6'));module['exports']=function(_0x3c6e23,_0x33930f){return _0x3c6e23[_0x93b5('0x7')](_0x93b5('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3657=['lodash','util','../../config/logger','moment','bluebird','request-promise','./mailServerIn.attributes','define','mail_servers_in'];(function(_0x64a811,_0x4887b7){var _0x3d8099=function(_0x3cb2b0){while(--_0x3cb2b0){_0x64a811['push'](_0x64a811['shift']());}};_0x3d8099(++_0x4887b7);}(_0x3657,0x183));var _0x7365=function(_0xd0448e,_0x2d3d92){_0xd0448e=_0xd0448e-0x0;var _0x3563cb=_0x3657[_0xd0448e];return _0x3563cb;};'use strict';var _=require(_0x7365('0x0'));var util=require(_0x7365('0x1'));var logger=require(_0x7365('0x2'))('api');var moment=require(_0x7365('0x3'));var BPromise=require(_0x7365('0x4'));var rp=require(_0x7365('0x5'));var attributes=require(_0x7365('0x6'));module['exports']=function(_0x3e33af,_0x402032){return _0x3e33af[_0x7365('0x7')]('MailServerIn',attributes,{'tableName':_0x7365('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8b494e2..1fd0c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2fe=['raw','where','attributes','limit','map','model','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options'];(function(_0x22ac47,_0x396e8d){var _0x3566cb=function(_0xe835b3){while(--_0xe835b3){_0x22ac47['push'](_0x22ac47['shift']());}};_0x3566cb(++_0x396e8d);}(_0xb2fe,0xfc));var _0xeb2f=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0xb2fe[_0x9b2bb0];return _0x2cdb3b;};'use strict';var _=require(_0xeb2f('0x0'));var util=require(_0xeb2f('0x1'));var moment=require(_0xeb2f('0x2'));var BPromise=require(_0xeb2f('0x3'));var rs=require(_0xeb2f('0x4'));var fs=require('fs');var Redis=require(_0xeb2f('0x5'));var db=require(_0xeb2f('0x6'))['db'];var utils=require(_0xeb2f('0x7'));var logger=require(_0xeb2f('0x8'))(_0xeb2f('0x9'));var config=require(_0xeb2f('0xa'));var jayson=require(_0xeb2f('0xb'));var client=jayson[_0xeb2f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x567ce3,_0x5ecb9a,_0x368ae4){return new BPromise(function(_0x5a73e4,_0x11e61a){return client[_0xeb2f('0xd')](_0x567ce3,_0x368ae4)[_0xeb2f('0xe')](function(_0x4fde4e){logger['info'](_0xeb2f('0xf'),_0x5ecb9a,'request\x20sent');logger[_0xeb2f('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x5ecb9a,_0xeb2f('0x11'),JSON[_0xeb2f('0x12')](_0x4fde4e));if(_0x4fde4e['error']){if(_0x4fde4e[_0xeb2f('0x13')]['code']===0x1f4){logger[_0xeb2f('0x13')](_0xeb2f('0xf'),_0x5ecb9a,_0x4fde4e['error']['message']);return _0x11e61a(_0x4fde4e[_0xeb2f('0x13')][_0xeb2f('0x14')]);}logger[_0xeb2f('0x13')](_0xeb2f('0xf'),_0x5ecb9a,_0x4fde4e[_0xeb2f('0x13')]['message']);return _0x5a73e4(_0x4fde4e[_0xeb2f('0x13')][_0xeb2f('0x14')]);}else{logger[_0xeb2f('0x15')](_0xeb2f('0xf'),_0x5ecb9a,'request\x20sent');_0x5a73e4(_0x4fde4e[_0xeb2f('0x16')][_0xeb2f('0x14')]);}})[_0xeb2f('0x17')](function(_0x47a2cf){logger[_0xeb2f('0x13')](_0xeb2f('0xf'),_0x5ecb9a,_0x47a2cf);_0x11e61a(_0x47a2cf);});});}exports[_0xeb2f('0x18')]=function(_0x235bc8){var _0x12bd6e=this;return new Promise(function(_0x4e3708,_0x260b06){return db[_0xeb2f('0x19')][_0xeb2f('0x1a')]({'raw':_0x235bc8['options']?_0x235bc8[_0xeb2f('0x1b')][_0xeb2f('0x1c')]===undefined?!![]:![]:!![],'where':_0x235bc8[_0xeb2f('0x1b')]?_0x235bc8[_0xeb2f('0x1b')][_0xeb2f('0x1d')]||null:null,'attributes':_0x235bc8[_0xeb2f('0x1b')]?_0x235bc8[_0xeb2f('0x1b')][_0xeb2f('0x1e')]||null:null,'limit':_0x235bc8['options']?_0x235bc8[_0xeb2f('0x1b')][_0xeb2f('0x1f')]||null:null,'include':_0x235bc8[_0xeb2f('0x1b')]?_0x235bc8[_0xeb2f('0x1b')]['include']?_[_0xeb2f('0x20')](_0x235bc8['options']['include'],function(_0x551eea){return{'model':db[_0x551eea[_0xeb2f('0x21')]],'as':_0x551eea['as'],'attributes':_0x551eea[_0xeb2f('0x1e')],'include':_0x551eea[_0xeb2f('0x22')]?_[_0xeb2f('0x20')](_0x551eea[_0xeb2f('0x22')],function(_0x336452){return{'model':db[_0x336452[_0xeb2f('0x21')]],'as':_0x336452['as'],'attributes':_0x336452[_0xeb2f('0x1e')],'include':_0x336452[_0xeb2f('0x22')]?_['map'](_0x336452[_0xeb2f('0x22')],function(_0x457010){return{'model':db[_0x457010['model']],'as':_0x457010['as'],'attributes':_0x457010[_0xeb2f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeb2f('0xe')](function(_0x2d344a){logger[_0xeb2f('0x15')](_0xeb2f('0x18'),_0x235bc8);logger[_0xeb2f('0x10')](_0xeb2f('0x18'),_0x235bc8,JSON[_0xeb2f('0x12')](_0x2d344a));_0x4e3708(_0x2d344a);})['catch'](function(_0x223fac){logger['error']('GetMailServerIn',_0x223fac[_0xeb2f('0x14')],_0x235bc8);_0x260b06(_0x12bd6e['error'](0x1f4,_0x223fac[_0xeb2f('0x14')]));});});};
\ No newline at end of file
+var _0x99e9=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','map','model','include','catch','lodash','bluebird','ioredis','../../config/environment','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4c1951,_0x20bcad){var _0x4ca67d=function(_0x5bd53f){while(--_0x5bd53f){_0x4c1951['push'](_0x4c1951['shift']());}};_0x4ca67d(++_0x20bcad);}(_0x99e9,0x17d));var _0x999e=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x99e9[_0x2f6233];return _0x1c9c36;};'use strict';var _=require(_0x999e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x999e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x999e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x999e('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x4')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7f6f37,_0xb032ce,_0x1deb30){return new BPromise(function(_0x6a3066,_0x33a126){return client[_0x999e('0x5')](_0x7f6f37,_0x1deb30)[_0x999e('0x6')](function(_0x5735eb){logger[_0x999e('0x7')](_0x999e('0x8'),_0xb032ce,_0x999e('0x9'));logger[_0x999e('0xa')](_0x999e('0xb'),_0xb032ce,_0x999e('0x9'),JSON[_0x999e('0xc')](_0x5735eb));if(_0x5735eb[_0x999e('0xd')]){if(_0x5735eb['error'][_0x999e('0xe')]===0x1f4){logger[_0x999e('0xd')]('MailServerIn,\x20%s,\x20%s',_0xb032ce,_0x5735eb[_0x999e('0xd')][_0x999e('0xf')]);return _0x33a126(_0x5735eb[_0x999e('0xd')][_0x999e('0xf')]);}logger['error'](_0x999e('0x8'),_0xb032ce,_0x5735eb[_0x999e('0xd')][_0x999e('0xf')]);return _0x6a3066(_0x5735eb['error'][_0x999e('0xf')]);}else{logger['info'](_0x999e('0x8'),_0xb032ce,_0x999e('0x9'));_0x6a3066(_0x5735eb[_0x999e('0x10')][_0x999e('0xf')]);}})['catch'](function(_0xee234a){logger[_0x999e('0xd')](_0x999e('0x8'),_0xb032ce,_0xee234a);_0x33a126(_0xee234a);});});}exports[_0x999e('0x11')]=function(_0x3d60f1){var _0xb7379a=this;return new Promise(function(_0xf57612,_0xdc0e3){return db[_0x999e('0x12')][_0x999e('0x13')]({'raw':_0x3d60f1[_0x999e('0x14')]?_0x3d60f1[_0x999e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3d60f1[_0x999e('0x14')]?_0x3d60f1[_0x999e('0x14')][_0x999e('0x15')]||null:null,'attributes':_0x3d60f1[_0x999e('0x14')]?_0x3d60f1[_0x999e('0x14')][_0x999e('0x16')]||null:null,'limit':_0x3d60f1[_0x999e('0x14')]?_0x3d60f1[_0x999e('0x14')][_0x999e('0x17')]||null:null,'include':_0x3d60f1[_0x999e('0x14')]?_0x3d60f1['options']['include']?_[_0x999e('0x18')](_0x3d60f1['options']['include'],function(_0x45d4f3){return{'model':db[_0x45d4f3[_0x999e('0x19')]],'as':_0x45d4f3['as'],'attributes':_0x45d4f3['attributes'],'include':_0x45d4f3[_0x999e('0x1a')]?_[_0x999e('0x18')](_0x45d4f3[_0x999e('0x1a')],function(_0x482cd9){return{'model':db[_0x482cd9[_0x999e('0x19')]],'as':_0x482cd9['as'],'attributes':_0x482cd9[_0x999e('0x16')],'include':_0x482cd9[_0x999e('0x1a')]?_[_0x999e('0x18')](_0x482cd9[_0x999e('0x1a')],function(_0x314474){return{'model':db[_0x314474['model']],'as':_0x314474['as'],'attributes':_0x314474[_0x999e('0x16')]};}):[]};}):[]};}):[]:[]})[_0x999e('0x6')](function(_0x3b7c66){logger[_0x999e('0x7')](_0x999e('0x11'),_0x3d60f1);logger[_0x999e('0xa')](_0x999e('0x11'),_0x3d60f1,JSON[_0x999e('0xc')](_0x3b7c66));_0xf57612(_0x3b7c66);})[_0x999e('0x1b')](function(_0x417f4b){logger[_0x999e('0xd')](_0x999e('0x11'),_0x417f4b[_0x999e('0xf')],_0x3d60f1);_0xdc0e3(_0xb7379a[_0x999e('0xd')](0x1f4,_0x417f4b['message']));});});};
\ No newline at end of file
index 56604cb..5245642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2656=['express','Router','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','/:id','show','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1acf77,_0x3ec597){var _0x4bddb1=function(_0x45e602){while(--_0x45e602){_0x1acf77['push'](_0x1acf77['shift']());}};_0x4bddb1(++_0x3ec597);}(_0x2656,0x8d));var _0x6265=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x2656[_0x367e5b];return _0x4b909e;};'use strict';var multer=require('multer');var util=require(_0x6265('0x0'));var path=require(_0x6265('0x1'));var timeout=require(_0x6265('0x2'));var express=require(_0x6265('0x3'));var router=express[_0x6265('0x4')]();var auth=require(_0x6265('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6265('0x6'));var controller=require(_0x6265('0x7'));router[_0x6265('0x8')]('/',auth[_0x6265('0x9')](),controller['index']);router[_0x6265('0x8')](_0x6265('0xa'),auth['isAuthenticated'](),controller[_0x6265('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6265('0xc')](_0x6265('0xa'),auth[_0x6265('0x9')](),controller['update']);router[_0x6265('0xd')]('/:id',auth[_0x6265('0x9')](),controller[_0x6265('0xe')]);module[_0x6265('0xf')]=router;
\ No newline at end of file
+var _0xae74=['get','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xec814,_0x590ac3){var _0x3e5c2c=function(_0x4b6ae5){while(--_0x4b6ae5){_0xec814['push'](_0xec814['shift']());}};_0x3e5c2c(++_0x590ac3);}(_0xae74,0x17f));var _0x4ae7=function(_0x3f2d46,_0x536959){_0x3f2d46=_0x3f2d46-0x0;var _0x1cf6d3=_0xae74[_0x3f2d46];return _0x1cf6d3;};'use strict';var multer=require(_0x4ae7('0x0'));var util=require('util');var path=require(_0x4ae7('0x1'));var timeout=require(_0x4ae7('0x2'));var express=require(_0x4ae7('0x3'));var router=express[_0x4ae7('0x4')]();var auth=require(_0x4ae7('0x5'));var interaction=require(_0x4ae7('0x6'));var config=require(_0x4ae7('0x7'));var controller=require('./mailServerOut.controller');router[_0x4ae7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4ae7('0x8')](_0x4ae7('0x9'),auth[_0x4ae7('0xa')](),controller['show']);router[_0x4ae7('0xb')]('/',auth[_0x4ae7('0xa')](),controller[_0x4ae7('0xc')]);router['put']('/:id',auth[_0x4ae7('0xa')](),controller[_0x4ae7('0xd')]);router[_0x4ae7('0xe')](_0x4ae7('0x9'),auth[_0x4ae7('0xa')](),controller[_0x4ae7('0xf')]);module[_0x4ae7('0x10')]=router;
\ No newline at end of file
index c6dc1f2..5d0d036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8d7=['sequelize','exports','STRING','BOOLEAN'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xc8d7,0xf8));var _0x7c8d=function(_0x4410ae,_0x2094d4){_0x4410ae=_0x4410ae-0x0;var _0x19cc05=_0xc8d7[_0x4410ae];return _0x19cc05;};'use strict';var Sequelize=require(_0x7c8d('0x0'));module[_0x7c8d('0x1')]={'description':{'type':Sequelize[_0x7c8d('0x2')]},'host':{'type':Sequelize[_0x7c8d('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x7c8d('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x7c8d('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x7c8d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6546=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x238e7c,_0x46ee86){var _0x128a39=function(_0x54b983){while(--_0x54b983){_0x238e7c['push'](_0x238e7c['shift']());}};_0x128a39(++_0x46ee86);}(_0x6546,0xf8));var _0x6654=function(_0x356487,_0x475f42){_0x356487=_0x356487-0x0;var _0x20d671=_0x6546[_0x356487];return _0x20d671;};'use strict';var Sequelize=require('sequelize');module[_0x6654('0x0')]={'description':{'type':Sequelize[_0x6654('0x1')]},'host':{'type':Sequelize[_0x6654('0x1')]},'user':{'type':Sequelize[_0x6654('0x1')]},'pass':{'type':Sequelize[_0x6654('0x1')]},'port':{'type':Sequelize[_0x6654('0x2')]},'secure':{'type':Sequelize[_0x6654('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x6654('0x1')]},'authentication':{'type':Sequelize[_0x6654('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 37cea28..2cee2e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e57=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','error','stack','name','send','index','MailServerOut','rawAttributes','model','keys','query','dateEnd','dateStart','intersection','attributes','length','nolimit','order','sort','where','filters','add','day','merge','filter','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','fields','find','create','body','update','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x826c87,_0x4f721e){var _0x3143f5=function(_0x3acf10){while(--_0x3acf10){_0x826c87['push'](_0x826c87['shift']());}};_0x3143f5(++_0x4f721e);}(_0x5e57,0x8d));var _0x75e5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5e57[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x75e5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x75e5('0x1'));var zipdir=require(_0x75e5('0x2'));var jsonpatch=require(_0x75e5('0x3'));var rp=require(_0x75e5('0x4'));var moment=require(_0x75e5('0x5'));var BPromise=require(_0x75e5('0x6'));var Mustache=require(_0x75e5('0x7'));var util=require('util');var path=require(_0x75e5('0x8'));var sox=require(_0x75e5('0x9'));var csv=require(_0x75e5('0xa'));var ejs=require(_0x75e5('0xb'));var fs=require('fs');var _=require(_0x75e5('0xc'));var squel=require(_0x75e5('0xd'));var crypto=require(_0x75e5('0xe'));var jsforce=require(_0x75e5('0xf'));var deskjs=require(_0x75e5('0x10'));var toCsv=require(_0x75e5('0xa'));var querystring=require(_0x75e5('0x11'));var Papa=require(_0x75e5('0x12'));var Redis=require(_0x75e5('0x13'));var qs=require(_0x75e5('0x14'));var logger=require(_0x75e5('0x15'))(_0x75e5('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c0064,_0x554e8b){_0x554e8b=_0x554e8b||0xcc;return function(_0x315329){if(_0x315329){return _0x4c0064[_0x75e5('0x17')](_0x554e8b);}return _0x4c0064[_0x75e5('0x18')](_0x554e8b)[_0x75e5('0x19')]();};}function respondWithResult(_0x335111,_0x178f29){_0x178f29=_0x178f29||0xc8;return function(_0x28d02a){if(_0x28d02a){return _0x335111[_0x75e5('0x18')](_0x178f29)[_0x75e5('0x1a')](_0x28d02a);}};}function respondWithFilteredResult(_0x3ebfb0,_0x443ab3){return function(_0x20bb1a){if(_0x20bb1a){var _0x51a6a9=_0x20bb1a['count'],_0x49a22e=_0x443ab3['offset'],_0x44f2a4=_0x443ab3[_0x75e5('0x1b')]+_0x443ab3[_0x75e5('0x1c')],_0x260dde;if(_0x44f2a4>=_0x51a6a9){_0x44f2a4=_0x51a6a9;_0x260dde=0xc8;}else{_0x260dde=0xce;}_0x3ebfb0[_0x75e5('0x18')](_0x260dde);return _0x3ebfb0[_0x75e5('0x1d')](_0x75e5('0x1e'),_0x49a22e+'-'+_0x44f2a4+'/'+_0x51a6a9)[_0x75e5('0x1a')](_0x20bb1a);}return null;};}function patchUpdates(_0x438f2c){return function(_0x948d23){try{jsonpatch[_0x75e5('0x1f')](_0x948d23,_0x438f2c,!![]);}catch(_0x5b4b79){return BPromise[_0x75e5('0x20')](_0x5b4b79);}return _0x948d23['save']();};}function saveUpdates(_0x5cb0ac,_0x399c92){return function(_0x52f77c){if(_0x52f77c){return _0x52f77c['update'](_0x5cb0ac)[_0x75e5('0x21')](function(_0x23dd1b){return _0x23dd1b;});}return null;};}function removeEntity(_0x4e17e2,_0x252df2){return function(_0x2a445f){if(_0x2a445f){return _0x2a445f['destroy']()[_0x75e5('0x21')](function(){_0x4e17e2[_0x75e5('0x18')](0xcc)[_0x75e5('0x19')]();});}};}function handleEntityNotFound(_0x14482b,_0x3e1b52){return function(_0x1be097){if(!_0x1be097){_0x14482b['sendStatus'](0x194);}return _0x1be097;};}function handleError(_0x13c047,_0x20a435){_0x20a435=_0x20a435||0x1f4;return function(_0x4be630){logger[_0x75e5('0x22')](_0x4be630[_0x75e5('0x23')]);if(_0x4be630[_0x75e5('0x24')]){delete _0x4be630[_0x75e5('0x24')];}_0x13c047['status'](_0x20a435)[_0x75e5('0x25')](_0x4be630);};}exports[_0x75e5('0x26')]=function(_0x5b311f,_0x4ea1d2){var _0x55d97d={},_0x1abb17={},_0x26128d={'count':0x0,'rows':[]};var _0x28ab90=db[_0x75e5('0x27')][_0x75e5('0x28')];_0x1abb17[_0x75e5('0x29')]=_[_0x75e5('0x2a')](_0x28ab90);var _0xdf5d59={'dateStart':_0x5b311f[_0x75e5('0x2b')]['dateStart'],'dateEnd':_0x5b311f[_0x75e5('0x2b')][_0x75e5('0x2c')]};delete _0x5b311f['query'][_0x75e5('0x2d')];delete _0x5b311f[_0x75e5('0x2b')][_0x75e5('0x2c')];_0x1abb17[_0x75e5('0x2b')]=_[_0x75e5('0x2a')](_0x5b311f[_0x75e5('0x2b')]);_0x1abb17['filters']=_[_0x75e5('0x2e')](_0x1abb17['model'],_0x1abb17[_0x75e5('0x2b')]);_0x55d97d[_0x75e5('0x2f')]=_[_0x75e5('0x2e')](_0x1abb17[_0x75e5('0x29')],qs['fields'](_0x5b311f[_0x75e5('0x2b')]['fields']));_0x55d97d[_0x75e5('0x2f')]=_0x55d97d[_0x75e5('0x2f')][_0x75e5('0x30')]?_0x55d97d[_0x75e5('0x2f')]:_0x1abb17[_0x75e5('0x29')];if(!_0x5b311f['query']['hasOwnProperty'](_0x75e5('0x31'))){_0x55d97d['limit']=qs[_0x75e5('0x1c')](_0x5b311f['query'][_0x75e5('0x1c')]);_0x55d97d[_0x75e5('0x1b')]=qs['offset'](_0x5b311f[_0x75e5('0x2b')]['offset']);}_0x55d97d[_0x75e5('0x32')]=qs[_0x75e5('0x33')](_0x5b311f[_0x75e5('0x2b')][_0x75e5('0x33')]);_0x55d97d[_0x75e5('0x34')]=qs[_0x75e5('0x35')](_['pick'](_0x5b311f[_0x75e5('0x2b')],_0x1abb17[_0x75e5('0x35')]));if(_0xdf5d59[_0x75e5('0x2d')]){if(_0xdf5d59[_0x75e5('0x2c')]){_0xdf5d59['dateEnd']=moment(_0xdf5d59[_0x75e5('0x2c')])[_0x75e5('0x36')](0x1,_0x75e5('0x37'));}else{_0xdf5d59[_0x75e5('0x2c')]=moment(_0xdf5d59[_0x75e5('0x2d')])['add'](0x1,'day');}_[_0x75e5('0x38')](_0x55d97d[_0x75e5('0x34')],{'createdAt':{'$gte':_0xdf5d59['dateStart'],'$lte':_0xdf5d59[_0x75e5('0x2c')]}});}if(_0x5b311f[_0x75e5('0x2b')][_0x75e5('0x39')]){_0x55d97d['where']=_['merge'](_0x55d97d[_0x75e5('0x34')],{'$or':_['map'](_0x28ab90,function(_0x1552ce){if(_0x1552ce[_0x75e5('0x3a')]['key']!==_0x75e5('0x3b')){var _0x499b96={};_0x499b96[_0x1552ce[_0x75e5('0x3c')]]={'$like':'%'+_0x5b311f[_0x75e5('0x2b')]['filter']+'%'};return _0x499b96;}})});}_0x55d97d=_['merge']({},_0x55d97d,_0x5b311f[_0x75e5('0x3d')]);var _0x4dd1aa={'where':_0x55d97d['where']};return db[_0x75e5('0x27')][_0x75e5('0x3e')](_0x4dd1aa)['then'](function(_0x2ce774){_0x26128d[_0x75e5('0x3e')]=_0x2ce774;if(_0x5b311f[_0x75e5('0x2b')][_0x75e5('0x3f')]){_0x55d97d[_0x75e5('0x40')]=[{'all':!![]}];}return db[_0x75e5('0x27')][_0x75e5('0x41')](_0x55d97d);})['then'](function(_0x2f0350){_0x26128d[_0x75e5('0x42')]=_0x2f0350;return _0x26128d;})['then'](respondWithFilteredResult(_0x4ea1d2,_0x55d97d))[_0x75e5('0x43')](handleError(_0x4ea1d2,null));};exports['show']=function(_0x16ef5f,_0x4f4dd4){var _0x5994d9={'raw':!![],'where':{'id':_0x16ef5f[_0x75e5('0x44')]['id']}},_0x26afaf={};_0x26afaf[_0x75e5('0x29')]=_[_0x75e5('0x2a')](db[_0x75e5('0x27')][_0x75e5('0x28')]);_0x26afaf[_0x75e5('0x2b')]=_[_0x75e5('0x2a')](_0x16ef5f[_0x75e5('0x2b')]);_0x26afaf[_0x75e5('0x35')]=_[_0x75e5('0x2e')](_0x26afaf['model'],_0x26afaf['query']);_0x5994d9[_0x75e5('0x2f')]=_[_0x75e5('0x2e')](_0x26afaf['model'],qs[_0x75e5('0x45')](_0x16ef5f[_0x75e5('0x2b')][_0x75e5('0x45')]));_0x5994d9[_0x75e5('0x2f')]=_0x5994d9['attributes']['length']?_0x5994d9[_0x75e5('0x2f')]:_0x26afaf[_0x75e5('0x29')];if(_0x16ef5f[_0x75e5('0x2b')][_0x75e5('0x3f')]){_0x5994d9[_0x75e5('0x40')]=[{'all':!![]}];}_0x5994d9=_[_0x75e5('0x38')]({},_0x5994d9,_0x16ef5f[_0x75e5('0x3d')]);return db[_0x75e5('0x27')][_0x75e5('0x46')](_0x5994d9)[_0x75e5('0x21')](handleEntityNotFound(_0x4f4dd4,null))[_0x75e5('0x21')](respondWithResult(_0x4f4dd4,null))['catch'](handleError(_0x4f4dd4,null));};exports[_0x75e5('0x47')]=function(_0x4b54c6,_0x4ef421){return db['MailServerOut'][_0x75e5('0x47')](_0x4b54c6[_0x75e5('0x48')],{})[_0x75e5('0x21')](respondWithResult(_0x4ef421,0xc9))[_0x75e5('0x43')](handleError(_0x4ef421,null));};exports[_0x75e5('0x49')]=function(_0x53bde0,_0x411105){if(_0x53bde0[_0x75e5('0x48')]['id']){delete _0x53bde0[_0x75e5('0x48')]['id'];}return db[_0x75e5('0x27')]['find']({'where':{'id':_0x53bde0[_0x75e5('0x44')]['id']}})[_0x75e5('0x21')](handleEntityNotFound(_0x411105,null))[_0x75e5('0x21')](saveUpdates(_0x53bde0[_0x75e5('0x48')],null))[_0x75e5('0x21')](respondWithResult(_0x411105,null))[_0x75e5('0x43')](handleError(_0x411105,null));};exports[_0x75e5('0x4a')]=function(_0x429767,_0x1b7eba){return db['MailServerOut'][_0x75e5('0x46')]({'where':{'id':_0x429767[_0x75e5('0x44')]['id']}})[_0x75e5('0x21')](handleEntityNotFound(_0x1b7eba,null))['then'](removeEntity(_0x1b7eba,null))[_0x75e5('0x43')](handleError(_0x1b7eba,null));};
\ No newline at end of file
+var _0xb9c2=['offset','limit','Content-Range','apply','save','destroy','then','end','stack','name','send','index','MailServerOut','rawAttributes','keys','query','dateEnd','dateStart','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','options','find','catch','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count'];(function(_0x39b51c,_0x40010d){var _0x146312=function(_0x4ea93b){while(--_0x4ea93b){_0x39b51c['push'](_0x39b51c['shift']());}};_0x146312(++_0x40010d);}(_0xb9c2,0xcb));var _0x2b9c=function(_0x168120,_0x4e19de){_0x168120=_0x168120-0x0;var _0x5c827e=_0xb9c2[_0x168120];return _0x5c827e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2b9c('0x0'));var rimraf=require(_0x2b9c('0x1'));var zipdir=require(_0x2b9c('0x2'));var jsonpatch=require(_0x2b9c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2b9c('0x4'));var Mustache=require(_0x2b9c('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2b9c('0x6'));var csv=require(_0x2b9c('0x7'));var ejs=require(_0x2b9c('0x8'));var fs=require('fs');var _=require(_0x2b9c('0x9'));var squel=require(_0x2b9c('0xa'));var crypto=require(_0x2b9c('0xb'));var jsforce=require(_0x2b9c('0xc'));var deskjs=require(_0x2b9c('0xd'));var toCsv=require(_0x2b9c('0x7'));var querystring=require(_0x2b9c('0xe'));var Papa=require('papaparse');var Redis=require(_0x2b9c('0xf'));var qs=require(_0x2b9c('0x10'));var logger=require(_0x2b9c('0x11'))(_0x2b9c('0x12'));var utils=require(_0x2b9c('0x13'));var config=require(_0x2b9c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cb72e,_0x1d6487){_0x1d6487=_0x1d6487||0xcc;return function(_0x1e17ac){if(_0x1e17ac){return _0x2cb72e[_0x2b9c('0x15')](_0x1d6487);}return _0x2cb72e[_0x2b9c('0x16')](_0x1d6487)['end']();};}function respondWithResult(_0x29e64b,_0x3f8f38){_0x3f8f38=_0x3f8f38||0xc8;return function(_0xe0d88a){if(_0xe0d88a){return _0x29e64b['status'](_0x3f8f38)[_0x2b9c('0x17')](_0xe0d88a);}};}function respondWithFilteredResult(_0x28e2a6,_0x17e1eb){return function(_0x514db8){if(_0x514db8){var _0x389f2c=_0x514db8[_0x2b9c('0x18')],_0xcb8fd6=_0x17e1eb['offset'],_0x16c575=_0x17e1eb[_0x2b9c('0x19')]+_0x17e1eb[_0x2b9c('0x1a')],_0x2faf76;if(_0x16c575>=_0x389f2c){_0x16c575=_0x389f2c;_0x2faf76=0xc8;}else{_0x2faf76=0xce;}_0x28e2a6[_0x2b9c('0x16')](_0x2faf76);return _0x28e2a6['set'](_0x2b9c('0x1b'),_0xcb8fd6+'-'+_0x16c575+'/'+_0x389f2c)[_0x2b9c('0x17')](_0x514db8);}return null;};}function patchUpdates(_0x3ef9b4){return function(_0x335a41){try{jsonpatch[_0x2b9c('0x1c')](_0x335a41,_0x3ef9b4,!![]);}catch(_0x5b5000){return BPromise['reject'](_0x5b5000);}return _0x335a41[_0x2b9c('0x1d')]();};}function saveUpdates(_0x3274bf,_0x257375){return function(_0x16ae1b){if(_0x16ae1b){return _0x16ae1b['update'](_0x3274bf)['then'](function(_0x338540){return _0x338540;});}return null;};}function removeEntity(_0x384c6a,_0xa10cca){return function(_0xb47e05){if(_0xb47e05){return _0xb47e05[_0x2b9c('0x1e')]()[_0x2b9c('0x1f')](function(){_0x384c6a[_0x2b9c('0x16')](0xcc)[_0x2b9c('0x20')]();});}};}function handleEntityNotFound(_0xa61518,_0x45fb0f){return function(_0x3dc872){if(!_0x3dc872){_0xa61518[_0x2b9c('0x15')](0x194);}return _0x3dc872;};}function handleError(_0x53a3cd,_0x154140){_0x154140=_0x154140||0x1f4;return function(_0x5d9aa3){logger['error'](_0x5d9aa3[_0x2b9c('0x21')]);if(_0x5d9aa3[_0x2b9c('0x22')]){delete _0x5d9aa3[_0x2b9c('0x22')];}_0x53a3cd[_0x2b9c('0x16')](_0x154140)[_0x2b9c('0x23')](_0x5d9aa3);};}exports[_0x2b9c('0x24')]=function(_0x175028,_0x486d79){var _0x3ec00a={},_0x47f7b2={},_0x330980={'count':0x0,'rows':[]};var _0x2471bf=db[_0x2b9c('0x25')][_0x2b9c('0x26')];_0x47f7b2['model']=_[_0x2b9c('0x27')](_0x2471bf);var _0x1ede85={'dateStart':_0x175028[_0x2b9c('0x28')]['dateStart'],'dateEnd':_0x175028[_0x2b9c('0x28')][_0x2b9c('0x29')]};delete _0x175028['query'][_0x2b9c('0x2a')];delete _0x175028[_0x2b9c('0x28')][_0x2b9c('0x29')];_0x47f7b2[_0x2b9c('0x28')]=_[_0x2b9c('0x27')](_0x175028[_0x2b9c('0x28')]);_0x47f7b2['filters']=_['intersection'](_0x47f7b2[_0x2b9c('0x2b')],_0x47f7b2[_0x2b9c('0x28')]);_0x3ec00a[_0x2b9c('0x2c')]=_[_0x2b9c('0x2d')](_0x47f7b2[_0x2b9c('0x2b')],qs[_0x2b9c('0x2e')](_0x175028[_0x2b9c('0x28')][_0x2b9c('0x2e')]));_0x3ec00a[_0x2b9c('0x2c')]=_0x3ec00a[_0x2b9c('0x2c')][_0x2b9c('0x2f')]?_0x3ec00a[_0x2b9c('0x2c')]:_0x47f7b2[_0x2b9c('0x2b')];if(!_0x175028['query'][_0x2b9c('0x30')](_0x2b9c('0x31'))){_0x3ec00a['limit']=qs[_0x2b9c('0x1a')](_0x175028['query'][_0x2b9c('0x1a')]);_0x3ec00a[_0x2b9c('0x19')]=qs[_0x2b9c('0x19')](_0x175028[_0x2b9c('0x28')]['offset']);}_0x3ec00a[_0x2b9c('0x32')]=qs[_0x2b9c('0x33')](_0x175028[_0x2b9c('0x28')][_0x2b9c('0x33')]);_0x3ec00a[_0x2b9c('0x34')]=qs[_0x2b9c('0x35')](_[_0x2b9c('0x36')](_0x175028[_0x2b9c('0x28')],_0x47f7b2['filters']));if(_0x1ede85[_0x2b9c('0x2a')]){if(_0x1ede85[_0x2b9c('0x29')]){_0x1ede85[_0x2b9c('0x29')]=moment(_0x1ede85[_0x2b9c('0x29')])[_0x2b9c('0x37')](0x1,_0x2b9c('0x38'));}else{_0x1ede85[_0x2b9c('0x29')]=moment(_0x1ede85[_0x2b9c('0x2a')])[_0x2b9c('0x37')](0x1,_0x2b9c('0x38'));}_['merge'](_0x3ec00a[_0x2b9c('0x34')],{'createdAt':{'$gte':_0x1ede85[_0x2b9c('0x2a')],'$lte':_0x1ede85[_0x2b9c('0x29')]}});}if(_0x175028[_0x2b9c('0x28')][_0x2b9c('0x39')]){_0x3ec00a[_0x2b9c('0x34')]=_[_0x2b9c('0x3a')](_0x3ec00a['where'],{'$or':_[_0x2b9c('0x3b')](_0x2471bf,function(_0x119506){if(_0x119506[_0x2b9c('0x3c')][_0x2b9c('0x3d')]!==_0x2b9c('0x3e')){var _0x30f396={};_0x30f396[_0x119506[_0x2b9c('0x3f')]]={'$like':'%'+_0x175028[_0x2b9c('0x28')][_0x2b9c('0x39')]+'%'};return _0x30f396;}})});}_0x3ec00a=_[_0x2b9c('0x3a')]({},_0x3ec00a,_0x175028['options']);var _0x33fd26={'where':_0x3ec00a[_0x2b9c('0x34')]};return db[_0x2b9c('0x25')]['count'](_0x33fd26)[_0x2b9c('0x1f')](function(_0x3289d9){_0x330980[_0x2b9c('0x18')]=_0x3289d9;if(_0x175028['query'][_0x2b9c('0x40')]){_0x3ec00a[_0x2b9c('0x41')]=[{'all':!![]}];}return db['MailServerOut'][_0x2b9c('0x42')](_0x3ec00a);})[_0x2b9c('0x1f')](function(_0x59a8e9){_0x330980[_0x2b9c('0x43')]=_0x59a8e9;return _0x330980;})[_0x2b9c('0x1f')](respondWithFilteredResult(_0x486d79,_0x3ec00a))['catch'](handleError(_0x486d79,null));};exports[_0x2b9c('0x44')]=function(_0x16251a,_0x5a3721){var _0x485952={'raw':!![],'where':{'id':_0x16251a['params']['id']}},_0x5be772={};_0x5be772[_0x2b9c('0x2b')]=_[_0x2b9c('0x27')](db[_0x2b9c('0x25')][_0x2b9c('0x26')]);_0x5be772[_0x2b9c('0x28')]=_[_0x2b9c('0x27')](_0x16251a[_0x2b9c('0x28')]);_0x5be772[_0x2b9c('0x35')]=_[_0x2b9c('0x2d')](_0x5be772['model'],_0x5be772[_0x2b9c('0x28')]);_0x485952[_0x2b9c('0x2c')]=_[_0x2b9c('0x2d')](_0x5be772[_0x2b9c('0x2b')],qs[_0x2b9c('0x2e')](_0x16251a[_0x2b9c('0x28')]['fields']));_0x485952['attributes']=_0x485952[_0x2b9c('0x2c')]['length']?_0x485952['attributes']:_0x5be772[_0x2b9c('0x2b')];if(_0x16251a[_0x2b9c('0x28')][_0x2b9c('0x40')]){_0x485952[_0x2b9c('0x41')]=[{'all':!![]}];}_0x485952=_['merge']({},_0x485952,_0x16251a[_0x2b9c('0x45')]);return db[_0x2b9c('0x25')][_0x2b9c('0x46')](_0x485952)[_0x2b9c('0x1f')](handleEntityNotFound(_0x5a3721,null))[_0x2b9c('0x1f')](respondWithResult(_0x5a3721,null))[_0x2b9c('0x47')](handleError(_0x5a3721,null));};exports[_0x2b9c('0x48')]=function(_0x1c754c,_0x1f2935){return db['MailServerOut'][_0x2b9c('0x48')](_0x1c754c['body'],{})[_0x2b9c('0x1f')](respondWithResult(_0x1f2935,0xc9))['catch'](handleError(_0x1f2935,null));};exports[_0x2b9c('0x49')]=function(_0x3cc9ea,_0x2f2253){if(_0x3cc9ea['body']['id']){delete _0x3cc9ea[_0x2b9c('0x4a')]['id'];}return db[_0x2b9c('0x25')][_0x2b9c('0x46')]({'where':{'id':_0x3cc9ea[_0x2b9c('0x4b')]['id']}})[_0x2b9c('0x1f')](handleEntityNotFound(_0x2f2253,null))[_0x2b9c('0x1f')](saveUpdates(_0x3cc9ea[_0x2b9c('0x4a')],null))[_0x2b9c('0x1f')](respondWithResult(_0x2f2253,null))[_0x2b9c('0x47')](handleError(_0x2f2253,null));};exports[_0x2b9c('0x1e')]=function(_0x40d3c8,_0x81cc1d){return db[_0x2b9c('0x25')][_0x2b9c('0x46')]({'where':{'id':_0x40d3c8[_0x2b9c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x81cc1d,null))[_0x2b9c('0x1f')](removeEntity(_0x81cc1d,null))[_0x2b9c('0x47')](handleError(_0x81cc1d,null));};
\ No newline at end of file
index 704dbb7..faec081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util'];(function(_0x364cf8,_0x146b9b){var _0x6a59ee=function(_0x3d81eb){while(--_0x3d81eb){_0x364cf8['push'](_0x364cf8['shift']());}};_0x6a59ee(++_0x146b9b);}(_0x814b,0x1a2));var _0xb814=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x814b[_0x2af29a];return _0x5ef02f;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var attributes=require(_0xb814('0x6'));module[_0xb814('0x7')]=function(_0x258866,_0x4237bc){return _0x258866[_0xb814('0x8')](_0xb814('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5334=['moment','request-promise','exports','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x31e714,_0x598f59){var _0x5ad3de=function(_0x512c2c){while(--_0x512c2c){_0x31e714['push'](_0x31e714['shift']());}};_0x5ad3de(++_0x598f59);}(_0x5334,0x84));var _0x4533=function(_0x4940a0,_0x3f9be1){_0x4940a0=_0x4940a0-0x0;var _0x556f14=_0x5334[_0x4940a0];return _0x556f14;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var moment=require(_0x4533('0x4'));var BPromise=require('bluebird');var rp=require(_0x4533('0x5'));var attributes=require('./mailServerOut.attributes');module[_0x4533('0x6')]=function(_0x11ce61,_0x5cbca4){return _0x11ce61['define']('MailServerOut',attributes,{'tableName':_0x4533('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae04d09..ae26a9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29be=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x29be,0x70));var _0xe29b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x29be[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xe29b('0x0'));var util=require(_0xe29b('0x1'));var moment=require(_0xe29b('0x2'));var BPromise=require(_0xe29b('0x3'));var rs=require(_0xe29b('0x4'));var fs=require('fs');var Redis=require(_0xe29b('0x5'));var db=require(_0xe29b('0x6'))['db'];var utils=require(_0xe29b('0x7'));var logger=require(_0xe29b('0x8'))('rpc');var config=require(_0xe29b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe29b('0xa')][_0xe29b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27b88f,_0x15edc7,_0x28390b){return new BPromise(function(_0x13c431,_0x1bc4f7){return client[_0xe29b('0xc')](_0x27b88f,_0x28390b)[_0xe29b('0xd')](function(_0xd69b6b){logger[_0xe29b('0xe')](_0xe29b('0xf'),_0x15edc7,_0xe29b('0x10'));logger[_0xe29b('0x11')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x15edc7,_0xe29b('0x10'),JSON[_0xe29b('0x12')](_0xd69b6b));if(_0xd69b6b[_0xe29b('0x13')]){if(_0xd69b6b[_0xe29b('0x13')]['code']===0x1f4){logger[_0xe29b('0x13')](_0xe29b('0xf'),_0x15edc7,_0xd69b6b[_0xe29b('0x13')]['message']);return _0x1bc4f7(_0xd69b6b[_0xe29b('0x13')][_0xe29b('0x14')]);}logger[_0xe29b('0x13')](_0xe29b('0xf'),_0x15edc7,_0xd69b6b[_0xe29b('0x13')][_0xe29b('0x14')]);return _0x13c431(_0xd69b6b[_0xe29b('0x13')][_0xe29b('0x14')]);}else{logger[_0xe29b('0xe')](_0xe29b('0xf'),_0x15edc7,_0xe29b('0x10'));_0x13c431(_0xd69b6b['result']['message']);}})[_0xe29b('0x15')](function(_0x2dcfba){logger[_0xe29b('0x13')](_0xe29b('0xf'),_0x15edc7,_0x2dcfba);_0x1bc4f7(_0x2dcfba);});});}
\ No newline at end of file
+var _0x11db=['stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s'];(function(_0x45af77,_0xf8a53){var _0x5d4564=function(_0x46fc94){while(--_0x46fc94){_0x45af77['push'](_0x45af77['shift']());}};_0x5d4564(++_0xf8a53);}(_0x11db,0x146));var _0xb11d=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x11db[_0x29d915];return _0x160f86;};'use strict';var _=require(_0xb11d('0x0'));var util=require(_0xb11d('0x1'));var moment=require(_0xb11d('0x2'));var BPromise=require(_0xb11d('0x3'));var rs=require(_0xb11d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb11d('0x5'))['db'];var utils=require(_0xb11d('0x6'));var logger=require(_0xb11d('0x7'))(_0xb11d('0x8'));var config=require(_0xb11d('0x9'));var jayson=require(_0xb11d('0xa'));var client=jayson[_0xb11d('0xb')][_0xb11d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf6b4f0,_0x3e712f,_0x4dd7c7){return new BPromise(function(_0x3cafac,_0x32db13){return client[_0xb11d('0xd')](_0xf6b4f0,_0x4dd7c7)['then'](function(_0x216fbb){logger[_0xb11d('0xe')](_0xb11d('0xf'),_0x3e712f,_0xb11d('0x10'));logger[_0xb11d('0x11')](_0xb11d('0x12'),_0x3e712f,'request\x20sent',JSON[_0xb11d('0x13')](_0x216fbb));if(_0x216fbb['error']){if(_0x216fbb[_0xb11d('0x14')]['code']===0x1f4){logger[_0xb11d('0x14')](_0xb11d('0xf'),_0x3e712f,_0x216fbb[_0xb11d('0x14')][_0xb11d('0x15')]);return _0x32db13(_0x216fbb['error'][_0xb11d('0x15')]);}logger[_0xb11d('0x14')](_0xb11d('0xf'),_0x3e712f,_0x216fbb[_0xb11d('0x14')][_0xb11d('0x15')]);return _0x3cafac(_0x216fbb[_0xb11d('0x14')][_0xb11d('0x15')]);}else{logger[_0xb11d('0xe')]('MailServerOut,\x20%s,\x20%s',_0x3e712f,_0xb11d('0x10'));_0x3cafac(_0x216fbb['result'][_0xb11d('0x15')]);}})[_0xb11d('0x16')](function(_0x549cbe){logger[_0xb11d('0x14')](_0xb11d('0xf'),_0x3e712f,_0x549cbe);_0x32db13(_0x549cbe);});});}
\ No newline at end of file
index 05ae4a4..8b2ee07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4858=['show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x4858,0x17d));var _0x8485=function(_0x2dc35f,_0x2fb239){_0x2dc35f=_0x2dc35f-0x0;var _0x4f0eac=_0x4858[_0x2dc35f];return _0x4f0eac;};'use strict';var multer=require('multer');var util=require(_0x8485('0x0'));var path=require(_0x8485('0x1'));var timeout=require(_0x8485('0x2'));var express=require(_0x8485('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x8485('0x4')]('/',auth[_0x8485('0x5')](),controller[_0x8485('0x6')]);router['get'](_0x8485('0x7'),auth[_0x8485('0x5')](),controller[_0x8485('0x8')]);router[_0x8485('0x4')](_0x8485('0x9'),auth['isAuthenticated'](),controller[_0x8485('0xa')]);router[_0x8485('0xb')]('/',auth[_0x8485('0x5')](),controller['create']);router[_0x8485('0xc')]('/:id',auth[_0x8485('0x5')](),controller[_0x8485('0xd')]);router[_0x8485('0xe')](_0x8485('0x9'),auth[_0x8485('0x5')](),controller[_0x8485('0xf')]);module[_0x8485('0x10')]=router;
\ No newline at end of file
+var _0xdd7f=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','destroy','multer','path','connect-timeout','express','Router'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdd7f,0xfa));var _0xfdd7=function(_0x86fcee,_0xe61866){_0x86fcee=_0x86fcee-0x0;var _0x551d25=_0xdd7f[_0x86fcee];return _0x551d25;};'use strict';var multer=require(_0xfdd7('0x0'));var util=require('util');var path=require(_0xfdd7('0x1'));var timeout=require(_0xfdd7('0x2'));var express=require(_0xfdd7('0x3'));var router=express[_0xfdd7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfdd7('0x5'));var config=require(_0xfdd7('0x6'));var controller=require(_0xfdd7('0x7'));router[_0xfdd7('0x8')]('/',auth[_0xfdd7('0x9')](),controller[_0xfdd7('0xa')]);router[_0xfdd7('0x8')](_0xfdd7('0xb'),auth[_0xfdd7('0x9')](),controller['describe']);router['get'](_0xfdd7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfdd7('0xd')]('/',auth['isAuthenticated'](),controller[_0xfdd7('0xe')]);router[_0xfdd7('0xf')](_0xfdd7('0xc'),auth[_0xfdd7('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfdd7('0x10')]);module['exports']=router;
\ No newline at end of file
index 100a34d..3e0894e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceb0=['STRING'];(function(_0x3da59f,_0x334632){var _0xe0d91d=function(_0x4dbc5a){while(--_0x4dbc5a){_0x3da59f['push'](_0x3da59f['shift']());}};_0xe0d91d(++_0x334632);}(_0xceb0,0x173));var _0x0ceb=function(_0x377df2,_0x529be4){_0x377df2=_0x377df2-0x0;var _0x2db88c=_0xceb0[_0x377df2];return _0x2db88c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0ceb('0x0')]}};
\ No newline at end of file
+var _0xfff0=['name','exports','STRING'];(function(_0x283e1e,_0x596015){var _0x5af164=function(_0xdef7b3){while(--_0xdef7b3){_0x283e1e['push'](_0x283e1e['shift']());}};_0x5af164(++_0x596015);}(_0xfff0,0x139));var _0x0fff=function(_0x409e1b,_0x3cc769){_0x409e1b=_0x409e1b-0x0;var _0x5cb72b=_0xfff0[_0x409e1b];return _0x5cb72b;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'name':{'type':Sequelize[_0x0fff('0x1')],'unique':_0x0fff('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1b266b5..95903db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['dateEnd','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','day','add','where','filter','map','type','key','VIRTUAL','field','merge','options','MailSubstatus','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','then','destroy','name','send','index','rawAttributes','model','keys','query','dateStart'];(function(_0x29999e,_0x5d8368){var _0x57f419=function(_0x35030a){while(--_0x35030a){_0x29999e['push'](_0x29999e['shift']());}};_0x57f419(++_0x5d8368);}(_0xdb28,0x106));var _0x8db2=function(_0x2d3bf5,_0x2cd91f){_0x2d3bf5=_0x2d3bf5-0x0;var _0x3632b3=_0xdb28[_0x2d3bf5];return _0x3632b3;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var qs=require(_0x8db2('0x11'));var logger=require(_0x8db2('0x12'))(_0x8db2('0x13'));var utils=require('../../config/utils');var config=require(_0x8db2('0x14'));var db=require(_0x8db2('0x15'))['db'];function respondWithStatusCode(_0x576475,_0x41beda){_0x41beda=_0x41beda||0xcc;return function(_0x3b2faa){if(_0x3b2faa){return _0x576475[_0x8db2('0x16')](_0x41beda);}return _0x576475[_0x8db2('0x17')](_0x41beda)[_0x8db2('0x18')]();};}function respondWithResult(_0x559fb1,_0x49fadc){_0x49fadc=_0x49fadc||0xc8;return function(_0x15070d){if(_0x15070d){return _0x559fb1[_0x8db2('0x17')](_0x49fadc)[_0x8db2('0x19')](_0x15070d);}};}function respondWithFilteredResult(_0x1d6a15,_0x227355){return function(_0xfa285b){if(_0xfa285b){var _0x2f177a=_0xfa285b['count'],_0x3c96a7=_0x227355[_0x8db2('0x1a')],_0x131252=_0x227355[_0x8db2('0x1a')]+_0x227355['limit'],_0x16c8c2;if(_0x131252>=_0x2f177a){_0x131252=_0x2f177a;_0x16c8c2=0xc8;}else{_0x16c8c2=0xce;}_0x1d6a15[_0x8db2('0x17')](_0x16c8c2);return _0x1d6a15[_0x8db2('0x1b')](_0x8db2('0x1c'),_0x3c96a7+'-'+_0x131252+'/'+_0x2f177a)[_0x8db2('0x19')](_0xfa285b);}return null;};}function patchUpdates(_0x2efd06){return function(_0x46ce14){try{jsonpatch['apply'](_0x46ce14,_0x2efd06,!![]);}catch(_0x5df464){return BPromise[_0x8db2('0x1d')](_0x5df464);}return _0x46ce14[_0x8db2('0x1e')]();};}function saveUpdates(_0x1310d3,_0x1b64e4){return function(_0x58562e){if(_0x58562e){return _0x58562e[_0x8db2('0x1f')](_0x1310d3)[_0x8db2('0x20')](function(_0x260940){return _0x260940;});}return null;};}function removeEntity(_0x297ba3,_0x3dbe8e){return function(_0x597260){if(_0x597260){return _0x597260[_0x8db2('0x21')]()[_0x8db2('0x20')](function(){_0x297ba3[_0x8db2('0x17')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x2260d8,_0x21704c){return function(_0x796ec1){if(!_0x796ec1){_0x2260d8['sendStatus'](0x194);}return _0x796ec1;};}function handleError(_0x256202,_0x4f6516){_0x4f6516=_0x4f6516||0x1f4;return function(_0x5725f0){logger['error'](_0x5725f0['stack']);if(_0x5725f0[_0x8db2('0x22')]){delete _0x5725f0[_0x8db2('0x22')];}_0x256202[_0x8db2('0x17')](_0x4f6516)[_0x8db2('0x23')](_0x5725f0);};}exports[_0x8db2('0x24')]=function(_0x8d4f54,_0x58cd9d){var _0x3544ba={},_0x372311={},_0x430dd5={'count':0x0,'rows':[]};var _0x8b7cec=db['MailSubstatus'][_0x8db2('0x25')];_0x372311[_0x8db2('0x26')]=_[_0x8db2('0x27')](_0x8b7cec);var _0x1687ed={'dateStart':_0x8d4f54[_0x8db2('0x28')][_0x8db2('0x29')],'dateEnd':_0x8d4f54[_0x8db2('0x28')][_0x8db2('0x2a')]};delete _0x8d4f54[_0x8db2('0x28')]['dateStart'];delete _0x8d4f54[_0x8db2('0x28')]['dateEnd'];_0x372311['query']=_[_0x8db2('0x27')](_0x8d4f54[_0x8db2('0x28')]);_0x372311[_0x8db2('0x2b')]=_['intersection'](_0x372311[_0x8db2('0x26')],_0x372311['query']);_0x3544ba[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](_0x372311[_0x8db2('0x26')],qs['fields'](_0x8d4f54['query'][_0x8db2('0x2e')]));_0x3544ba[_0x8db2('0x2c')]=_0x3544ba['attributes']['length']?_0x3544ba[_0x8db2('0x2c')]:_0x372311[_0x8db2('0x26')];if(!_0x8d4f54[_0x8db2('0x28')][_0x8db2('0x2f')](_0x8db2('0x30'))){_0x3544ba[_0x8db2('0x31')]=qs[_0x8db2('0x31')](_0x8d4f54[_0x8db2('0x28')][_0x8db2('0x31')]);_0x3544ba[_0x8db2('0x1a')]=qs['offset'](_0x8d4f54[_0x8db2('0x28')][_0x8db2('0x1a')]);}_0x3544ba['order']=qs[_0x8db2('0x32')](_0x8d4f54[_0x8db2('0x28')]['sort']);_0x3544ba['where']=qs[_0x8db2('0x2b')](_['pick'](_0x8d4f54[_0x8db2('0x28')],_0x372311[_0x8db2('0x2b')]));if(_0x1687ed[_0x8db2('0x29')]){if(_0x1687ed[_0x8db2('0x2a')]){_0x1687ed['dateEnd']=moment(_0x1687ed[_0x8db2('0x2a')])['add'](0x1,_0x8db2('0x33'));}else{_0x1687ed[_0x8db2('0x2a')]=moment(_0x1687ed[_0x8db2('0x29')])[_0x8db2('0x34')](0x1,'day');}_['merge'](_0x3544ba[_0x8db2('0x35')],{'createdAt':{'$gte':_0x1687ed[_0x8db2('0x29')],'$lte':_0x1687ed['dateEnd']}});}if(_0x8d4f54[_0x8db2('0x28')][_0x8db2('0x36')]){_0x3544ba[_0x8db2('0x35')]=_['merge'](_0x3544ba[_0x8db2('0x35')],{'$or':_[_0x8db2('0x37')](_0x8b7cec,function(_0x953349){if(_0x953349[_0x8db2('0x38')][_0x8db2('0x39')]!==_0x8db2('0x3a')){var _0x380046={};_0x380046[_0x953349[_0x8db2('0x3b')]]={'$like':'%'+_0x8d4f54[_0x8db2('0x28')][_0x8db2('0x36')]+'%'};return _0x380046;}})});}_0x3544ba=_[_0x8db2('0x3c')]({},_0x3544ba,_0x8d4f54[_0x8db2('0x3d')]);var _0x1d9025={'where':_0x3544ba['where']};return db[_0x8db2('0x3e')][_0x8db2('0x3f')](_0x1d9025)['then'](function(_0x49a7ae){_0x430dd5[_0x8db2('0x3f')]=_0x49a7ae;if(_0x8d4f54['query'][_0x8db2('0x40')]){_0x3544ba[_0x8db2('0x41')]=[{'all':!![]}];}return db[_0x8db2('0x3e')][_0x8db2('0x42')](_0x3544ba);})[_0x8db2('0x20')](function(_0x30d606){_0x430dd5[_0x8db2('0x43')]=_0x30d606;return _0x430dd5;})['then'](respondWithFilteredResult(_0x58cd9d,_0x3544ba))[_0x8db2('0x44')](handleError(_0x58cd9d,null));};exports[_0x8db2('0x45')]=function(_0x40c69e,_0x4a0b56){var _0x482b26={'raw':!![],'where':{'id':_0x40c69e[_0x8db2('0x46')]['id']}},_0x424c27={};_0x424c27[_0x8db2('0x26')]=_[_0x8db2('0x27')](db['MailSubstatus'][_0x8db2('0x25')]);_0x424c27['query']=_[_0x8db2('0x27')](_0x40c69e[_0x8db2('0x28')]);_0x424c27[_0x8db2('0x2b')]=_['intersection'](_0x424c27['model'],_0x424c27[_0x8db2('0x28')]);_0x482b26['attributes']=_[_0x8db2('0x2d')](_0x424c27[_0x8db2('0x26')],qs[_0x8db2('0x2e')](_0x40c69e[_0x8db2('0x28')][_0x8db2('0x2e')]));_0x482b26[_0x8db2('0x2c')]=_0x482b26[_0x8db2('0x2c')][_0x8db2('0x47')]?_0x482b26[_0x8db2('0x2c')]:_0x424c27[_0x8db2('0x26')];if(_0x40c69e[_0x8db2('0x28')][_0x8db2('0x40')]){_0x482b26['include']=[{'all':!![]}];}_0x482b26=_[_0x8db2('0x3c')]({},_0x482b26,_0x40c69e[_0x8db2('0x3d')]);return db[_0x8db2('0x3e')][_0x8db2('0x48')](_0x482b26)['then'](handleEntityNotFound(_0x4a0b56,null))['then'](respondWithResult(_0x4a0b56,null))[_0x8db2('0x44')](handleError(_0x4a0b56,null));};exports[_0x8db2('0x49')]=function(_0x164020,_0x4c66e5){return db['MailSubstatus']['create'](_0x164020[_0x8db2('0x4a')],{})[_0x8db2('0x20')](respondWithResult(_0x4c66e5,0xc9))[_0x8db2('0x44')](handleError(_0x4c66e5,null));};exports[_0x8db2('0x1f')]=function(_0xaab731,_0x4195ef){if(_0xaab731[_0x8db2('0x4a')]['id']){delete _0xaab731['body']['id'];}return db['MailSubstatus'][_0x8db2('0x48')]({'where':{'id':_0xaab731[_0x8db2('0x46')]['id']}})[_0x8db2('0x20')](handleEntityNotFound(_0x4195ef,null))[_0x8db2('0x20')](saveUpdates(_0xaab731[_0x8db2('0x4a')],null))[_0x8db2('0x20')](respondWithResult(_0x4195ef,null))[_0x8db2('0x44')](handleError(_0x4195ef,null));};exports[_0x8db2('0x21')]=function(_0x4187d6,_0x426ae0){return db[_0x8db2('0x3e')][_0x8db2('0x48')]({'where':{'id':_0x4187d6[_0x8db2('0x46')]['id']}})[_0x8db2('0x20')](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x20')](removeEntity(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));};exports[_0x8db2('0x4b')]=function(_0xb4b0a,_0x579317){return db[_0x8db2('0x3e')][_0x8db2('0x4b')]()[_0x8db2('0x20')](respondWithResult(_0x579317,null))['catch'](handleError(_0x579317,null));};
\ No newline at end of file
+var _0x5f2f=['Content-Range','apply','reject','save','destroy','then','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','dateStart','query','dateEnd','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','day','add','merge','map','type','key','field','filter','options','includeAll','catch','show','params','intersection','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3bf9fa,_0x48d3f7){_0x3bf9fa=_0x3bf9fa-0x0;var _0xdb118c=_0x5f2f[_0x3bf9fa];return _0xdb118c;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var qs=require(_0xf5f2('0x12'));var logger=require('../../config/logger')(_0xf5f2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf5f2('0x14'))['db'];function respondWithStatusCode(_0x151aba,_0x4b78cd){_0x4b78cd=_0x4b78cd||0xcc;return function(_0x336f6b){if(_0x336f6b){return _0x151aba[_0xf5f2('0x15')](_0x4b78cd);}return _0x151aba[_0xf5f2('0x16')](_0x4b78cd)[_0xf5f2('0x17')]();};}function respondWithResult(_0x59bb6c,_0x3e5956){_0x3e5956=_0x3e5956||0xc8;return function(_0x5c01b8){if(_0x5c01b8){return _0x59bb6c[_0xf5f2('0x16')](_0x3e5956)[_0xf5f2('0x18')](_0x5c01b8);}};}function respondWithFilteredResult(_0x269909,_0x1c1a5c){return function(_0x422b55){if(_0x422b55){var _0x4d97fc=_0x422b55[_0xf5f2('0x19')],_0xafe430=_0x1c1a5c[_0xf5f2('0x1a')],_0x286197=_0x1c1a5c[_0xf5f2('0x1a')]+_0x1c1a5c[_0xf5f2('0x1b')],_0x17d656;if(_0x286197>=_0x4d97fc){_0x286197=_0x4d97fc;_0x17d656=0xc8;}else{_0x17d656=0xce;}_0x269909[_0xf5f2('0x16')](_0x17d656);return _0x269909[_0xf5f2('0x1c')](_0xf5f2('0x1d'),_0xafe430+'-'+_0x286197+'/'+_0x4d97fc)[_0xf5f2('0x18')](_0x422b55);}return null;};}function patchUpdates(_0x28e097){return function(_0x4ff59b){try{jsonpatch[_0xf5f2('0x1e')](_0x4ff59b,_0x28e097,!![]);}catch(_0x3cf5ea){return BPromise[_0xf5f2('0x1f')](_0x3cf5ea);}return _0x4ff59b[_0xf5f2('0x20')]();};}function saveUpdates(_0x56acc5,_0x34706d){return function(_0x47101e){if(_0x47101e){return _0x47101e['update'](_0x56acc5)['then'](function(_0x2d2805){return _0x2d2805;});}return null;};}function removeEntity(_0x388e6c,_0x4ae323){return function(_0x45b74f){if(_0x45b74f){return _0x45b74f[_0xf5f2('0x21')]()[_0xf5f2('0x22')](function(){_0x388e6c[_0xf5f2('0x16')](0xcc)[_0xf5f2('0x17')]();});}};}function handleEntityNotFound(_0x4c691a,_0x21cd91){return function(_0x4669a6){if(!_0x4669a6){_0x4c691a[_0xf5f2('0x15')](0x194);}return _0x4669a6;};}function handleError(_0x2833fe,_0x287ad5){_0x287ad5=_0x287ad5||0x1f4;return function(_0x5bdf4a){logger['error'](_0x5bdf4a[_0xf5f2('0x23')]);if(_0x5bdf4a[_0xf5f2('0x24')]){delete _0x5bdf4a[_0xf5f2('0x24')];}_0x2833fe[_0xf5f2('0x16')](_0x287ad5)[_0xf5f2('0x25')](_0x5bdf4a);};}exports[_0xf5f2('0x26')]=function(_0x13a3be,_0x281ec8){var _0x294414={},_0x4ab014={},_0xaa2602={'count':0x0,'rows':[]};var _0x102449=db[_0xf5f2('0x27')][_0xf5f2('0x28')];_0x4ab014[_0xf5f2('0x29')]=_[_0xf5f2('0x2a')](_0x102449);var _0x5b6672={'dateStart':_0x13a3be['query'][_0xf5f2('0x2b')],'dateEnd':_0x13a3be[_0xf5f2('0x2c')][_0xf5f2('0x2d')]};delete _0x13a3be['query']['dateStart'];delete _0x13a3be[_0xf5f2('0x2c')][_0xf5f2('0x2d')];_0x4ab014[_0xf5f2('0x2c')]=_[_0xf5f2('0x2a')](_0x13a3be[_0xf5f2('0x2c')]);_0x4ab014['filters']=_['intersection'](_0x4ab014[_0xf5f2('0x29')],_0x4ab014['query']);_0x294414[_0xf5f2('0x2e')]=_['intersection'](_0x4ab014[_0xf5f2('0x29')],qs[_0xf5f2('0x2f')](_0x13a3be[_0xf5f2('0x2c')][_0xf5f2('0x2f')]));_0x294414[_0xf5f2('0x2e')]=_0x294414[_0xf5f2('0x2e')][_0xf5f2('0x30')]?_0x294414[_0xf5f2('0x2e')]:_0x4ab014['model'];if(!_0x13a3be[_0xf5f2('0x2c')][_0xf5f2('0x31')](_0xf5f2('0x32'))){_0x294414[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x13a3be[_0xf5f2('0x2c')][_0xf5f2('0x1b')]);_0x294414['offset']=qs[_0xf5f2('0x1a')](_0x13a3be[_0xf5f2('0x2c')]['offset']);}_0x294414[_0xf5f2('0x33')]=qs['sort'](_0x13a3be[_0xf5f2('0x2c')][_0xf5f2('0x34')]);_0x294414[_0xf5f2('0x35')]=qs[_0xf5f2('0x36')](_['pick'](_0x13a3be['query'],_0x4ab014[_0xf5f2('0x36')]));if(_0x5b6672[_0xf5f2('0x2b')]){if(_0x5b6672[_0xf5f2('0x2d')]){_0x5b6672['dateEnd']=moment(_0x5b6672[_0xf5f2('0x2d')])['add'](0x1,_0xf5f2('0x37'));}else{_0x5b6672['dateEnd']=moment(_0x5b6672[_0xf5f2('0x2b')])[_0xf5f2('0x38')](0x1,'day');}_[_0xf5f2('0x39')](_0x294414[_0xf5f2('0x35')],{'createdAt':{'$gte':_0x5b6672[_0xf5f2('0x2b')],'$lte':_0x5b6672[_0xf5f2('0x2d')]}});}if(_0x13a3be['query']['filter']){_0x294414[_0xf5f2('0x35')]=_[_0xf5f2('0x39')](_0x294414[_0xf5f2('0x35')],{'$or':_[_0xf5f2('0x3a')](_0x102449,function(_0x2c7f65){if(_0x2c7f65[_0xf5f2('0x3b')][_0xf5f2('0x3c')]!=='VIRTUAL'){var _0x110fe5={};_0x110fe5[_0x2c7f65[_0xf5f2('0x3d')]]={'$like':'%'+_0x13a3be['query'][_0xf5f2('0x3e')]+'%'};return _0x110fe5;}})});}_0x294414=_[_0xf5f2('0x39')]({},_0x294414,_0x13a3be[_0xf5f2('0x3f')]);var _0x85b6d0={'where':_0x294414[_0xf5f2('0x35')]};return db[_0xf5f2('0x27')][_0xf5f2('0x19')](_0x85b6d0)[_0xf5f2('0x22')](function(_0x574f24){_0xaa2602[_0xf5f2('0x19')]=_0x574f24;if(_0x13a3be[_0xf5f2('0x2c')][_0xf5f2('0x40')]){_0x294414['include']=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x294414);})[_0xf5f2('0x22')](function(_0x2ad13c){_0xaa2602['rows']=_0x2ad13c;return _0xaa2602;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x281ec8,_0x294414))[_0xf5f2('0x41')](handleError(_0x281ec8,null));};exports[_0xf5f2('0x42')]=function(_0x31f86c,_0x354c34){var _0x2b3b1c={'raw':!![],'where':{'id':_0x31f86c[_0xf5f2('0x43')]['id']}},_0x1a6ec1={};_0x1a6ec1[_0xf5f2('0x29')]=_[_0xf5f2('0x2a')](db[_0xf5f2('0x27')][_0xf5f2('0x28')]);_0x1a6ec1[_0xf5f2('0x2c')]=_[_0xf5f2('0x2a')](_0x31f86c['query']);_0x1a6ec1[_0xf5f2('0x36')]=_['intersection'](_0x1a6ec1[_0xf5f2('0x29')],_0x1a6ec1[_0xf5f2('0x2c')]);_0x2b3b1c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x1a6ec1[_0xf5f2('0x29')],qs[_0xf5f2('0x2f')](_0x31f86c['query'][_0xf5f2('0x2f')]));_0x2b3b1c[_0xf5f2('0x2e')]=_0x2b3b1c[_0xf5f2('0x2e')][_0xf5f2('0x30')]?_0x2b3b1c[_0xf5f2('0x2e')]:_0x1a6ec1[_0xf5f2('0x29')];if(_0x31f86c[_0xf5f2('0x2c')][_0xf5f2('0x40')]){_0x2b3b1c['include']=[{'all':!![]}];}_0x2b3b1c=_[_0xf5f2('0x39')]({},_0x2b3b1c,_0x31f86c[_0xf5f2('0x3f')]);return db[_0xf5f2('0x27')]['find'](_0x2b3b1c)[_0xf5f2('0x22')](handleEntityNotFound(_0x354c34,null))[_0xf5f2('0x22')](respondWithResult(_0x354c34,null))[_0xf5f2('0x41')](handleError(_0x354c34,null));};exports['create']=function(_0x57a7cb,_0x7bb942){return db[_0xf5f2('0x27')]['create'](_0x57a7cb[_0xf5f2('0x45')],{})['then'](respondWithResult(_0x7bb942,0xc9))[_0xf5f2('0x41')](handleError(_0x7bb942,null));};exports['update']=function(_0x2cbd9d,_0x5d9120){if(_0x2cbd9d[_0xf5f2('0x45')]['id']){delete _0x2cbd9d[_0xf5f2('0x45')]['id'];}return db[_0xf5f2('0x27')][_0xf5f2('0x46')]({'where':{'id':_0x2cbd9d['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x5d9120,null))[_0xf5f2('0x22')](saveUpdates(_0x2cbd9d['body'],null))['then'](respondWithResult(_0x5d9120,null))[_0xf5f2('0x41')](handleError(_0x5d9120,null));};exports[_0xf5f2('0x21')]=function(_0x57782c,_0x22b645){return db[_0xf5f2('0x27')][_0xf5f2('0x46')]({'where':{'id':_0x57782c[_0xf5f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x22b645,null))['then'](removeEntity(_0x22b645,null))[_0xf5f2('0x41')](handleError(_0x22b645,null));};exports[_0xf5f2('0x47')]=function(_0x4b62fc,_0x40eef){return db[_0xf5f2('0x27')][_0xf5f2('0x47')]()[_0xf5f2('0x22')](respondWithResult(_0x40eef,null))[_0xf5f2('0x41')](handleError(_0x40eef,null));};
\ No newline at end of file
index 3e67fc2..0c89751 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a4c=['bluebird','./mailSubstatus.attributes','define','mail_substatuses','lodash','../../config/logger','api','moment'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x8a4c,0x194));var _0xc8a4=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0x8a4c[_0x4ca288];return _0x2362c1;};'use strict';var _=require(_0xc8a4('0x0'));var util=require('util');var logger=require(_0xc8a4('0x1'))(_0xc8a4('0x2'));var moment=require(_0xc8a4('0x3'));var BPromise=require(_0xc8a4('0x4'));var rp=require('request-promise');var attributes=require(_0xc8a4('0x5'));module['exports']=function(_0x466a70,_0x4bc1c8){return _0x466a70[_0xc8a4('0x6')]('MailSubstatus',attributes,{'tableName':_0xc8a4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x47eb=['define','MailSubstatus','lodash','../../config/logger','api','moment','bluebird','request-promise','./mailSubstatus.attributes','exports'];(function(_0x1ef930,_0x129c24){var _0x3b5a1d=function(_0x458a4f){while(--_0x458a4f){_0x1ef930['push'](_0x1ef930['shift']());}};_0x3b5a1d(++_0x129c24);}(_0x47eb,0x17e));var _0xb47e=function(_0x2c96f6,_0x877207){_0x2c96f6=_0x2c96f6-0x0;var _0x6d4808=_0x47eb[_0x2c96f6];return _0x6d4808;};'use strict';var _=require(_0xb47e('0x0'));var util=require('util');var logger=require(_0xb47e('0x1'))(_0xb47e('0x2'));var moment=require(_0xb47e('0x3'));var BPromise=require(_0xb47e('0x4'));var rp=require(_0xb47e('0x5'));var attributes=require(_0xb47e('0x6'));module[_0xb47e('0x7')]=function(_0x1bf284,_0x1163f4){return _0x1bf284[_0xb47e('0x8')](_0xb47e('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 37b080e..956983d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0ad=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x573faa,_0x5563b3){var _0x2760e9=function(_0x1a001e){while(--_0x1a001e){_0x573faa['push'](_0x573faa['shift']());}};_0x2760e9(++_0x5563b3);}(_0xe0ad,0x1f1));var _0xde0a=function(_0x4b82b7,_0x4e4616){_0x4b82b7=_0x4b82b7-0x0;var _0x2dde86=_0xe0ad[_0x4b82b7];return _0x2dde86;};'use strict';var _=require(_0xde0a('0x0'));var util=require(_0xde0a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xde0a('0x2'));var fs=require('fs');var Redis=require(_0xde0a('0x3'));var db=require(_0xde0a('0x4'))['db'];var utils=require(_0xde0a('0x5'));var logger=require(_0xde0a('0x6'))('rpc');var config=require(_0xde0a('0x7'));var jayson=require(_0xde0a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xde2ecc,_0x3af294,_0x3c3ddf){return new BPromise(function(_0x241d21,_0x5f2c3b){return client['request'](_0xde2ecc,_0x3c3ddf)[_0xde0a('0x9')](function(_0x3de4c6){logger[_0xde0a('0xa')](_0xde0a('0xb'),_0x3af294,_0xde0a('0xc'));logger[_0xde0a('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x3af294,_0xde0a('0xc'),JSON[_0xde0a('0xe')](_0x3de4c6));if(_0x3de4c6[_0xde0a('0xf')]){if(_0x3de4c6[_0xde0a('0xf')][_0xde0a('0x10')]===0x1f4){logger[_0xde0a('0xf')](_0xde0a('0xb'),_0x3af294,_0x3de4c6[_0xde0a('0xf')][_0xde0a('0x11')]);return _0x5f2c3b(_0x3de4c6[_0xde0a('0xf')][_0xde0a('0x11')]);}logger[_0xde0a('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x3af294,_0x3de4c6[_0xde0a('0xf')][_0xde0a('0x11')]);return _0x241d21(_0x3de4c6['error'][_0xde0a('0x11')]);}else{logger[_0xde0a('0xa')](_0xde0a('0xb'),_0x3af294,_0xde0a('0xc'));_0x241d21(_0x3de4c6[_0xde0a('0x12')]['message']);}})[_0xde0a('0x13')](function(_0x7eb930){logger[_0xde0a('0xf')](_0xde0a('0xb'),_0x3af294,_0x7eb930);_0x5f2c3b(_0x7eb930);});});}
\ No newline at end of file
+var _0x5b01=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird'];(function(_0x1268ae,_0x26e9ea){var _0xb3de65=function(_0x7c3b8c){while(--_0x7c3b8c){_0x1268ae['push'](_0x1268ae['shift']());}};_0xb3de65(++_0x26e9ea);}(_0x5b01,0x8d));var _0x15b0=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x5b01[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require(_0x15b0('0x0'));var util=require('util');var moment=require(_0x15b0('0x1'));var BPromise=require(_0x15b0('0x2'));var rs=require(_0x15b0('0x3'));var fs=require('fs');var Redis=require(_0x15b0('0x4'));var db=require(_0x15b0('0x5'))['db'];var utils=require(_0x15b0('0x6'));var logger=require(_0x15b0('0x7'))(_0x15b0('0x8'));var config=require(_0x15b0('0x9'));var jayson=require(_0x15b0('0xa'));var client=jayson[_0x15b0('0xb')][_0x15b0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51d870,_0x2dcd74,_0x1cbc90){return new BPromise(function(_0x287531,_0x50bf1e){return client[_0x15b0('0xd')](_0x51d870,_0x1cbc90)[_0x15b0('0xe')](function(_0x52eb3a){logger[_0x15b0('0xf')](_0x15b0('0x10'),_0x2dcd74,_0x15b0('0x11'));logger[_0x15b0('0x12')](_0x15b0('0x13'),_0x2dcd74,_0x15b0('0x11'),JSON[_0x15b0('0x14')](_0x52eb3a));if(_0x52eb3a[_0x15b0('0x15')]){if(_0x52eb3a[_0x15b0('0x15')]['code']===0x1f4){logger[_0x15b0('0x15')](_0x15b0('0x10'),_0x2dcd74,_0x52eb3a[_0x15b0('0x15')][_0x15b0('0x16')]);return _0x50bf1e(_0x52eb3a[_0x15b0('0x15')][_0x15b0('0x16')]);}logger[_0x15b0('0x15')](_0x15b0('0x10'),_0x2dcd74,_0x52eb3a[_0x15b0('0x15')][_0x15b0('0x16')]);return _0x287531(_0x52eb3a[_0x15b0('0x15')][_0x15b0('0x16')]);}else{logger['info'](_0x15b0('0x10'),_0x2dcd74,_0x15b0('0x11'));_0x287531(_0x52eb3a[_0x15b0('0x17')][_0x15b0('0x16')]);}})['catch'](function(_0x4c849f){logger[_0x15b0('0x15')](_0x15b0('0x10'),_0x2dcd74,_0x4c849f);_0x50bf1e(_0x4c849f);});});}
\ No newline at end of file
index 3218090..ae28795 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b65=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','put','update','delete','destroy','multer'];(function(_0x132d8f,_0x4ccb46){var _0x41821d=function(_0x374129){while(--_0x374129){_0x132d8f['push'](_0x132d8f['shift']());}};_0x41821d(++_0x4ccb46);}(_0x1b65,0x1b4));var _0x51b6=function(_0x414bee,_0x1b19a4){_0x414bee=_0x414bee-0x0;var _0x3ab4df=_0x1b65[_0x414bee];return _0x3ab4df;};'use strict';var multer=require(_0x51b6('0x0'));var util=require(_0x51b6('0x1'));var path=require(_0x51b6('0x2'));var timeout=require(_0x51b6('0x3'));var express=require('express');var router=express[_0x51b6('0x4')]();var auth=require(_0x51b6('0x5'));var interaction=require(_0x51b6('0x6'));var config=require(_0x51b6('0x7'));var controller=require(_0x51b6('0x8'));router[_0x51b6('0x9')]('/',auth[_0x51b6('0xa')](),controller['index']);router[_0x51b6('0x9')](_0x51b6('0xb'),auth[_0x51b6('0xa')](),controller[_0x51b6('0xc')]);router['get'](_0x51b6('0xd'),auth[_0x51b6('0xa')](),controller['show']);router[_0x51b6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x51b6('0xf')](_0x51b6('0xd'),auth[_0x51b6('0xa')](),controller[_0x51b6('0x10')]);router[_0x51b6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x51b6('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x126e=['../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x126e,0x108));var _0xe126=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x126e[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require('multer');var util=require(_0xe126('0x0'));var path=require(_0xe126('0x1'));var timeout=require(_0xe126('0x2'));var express=require(_0xe126('0x3'));var router=express[_0xe126('0x4')]();var auth=require(_0xe126('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe126('0x6'));var controller=require(_0xe126('0x7'));router[_0xe126('0x8')]('/',auth[_0xe126('0x9')](),controller[_0xe126('0xa')]);router[_0xe126('0x8')](_0xe126('0xb'),auth['isAuthenticated'](),controller[_0xe126('0xc')]);router[_0xe126('0x8')](_0xe126('0xd'),auth[_0xe126('0x9')](),controller[_0xe126('0xe')]);router['post']('/',auth[_0xe126('0x9')](),controller[_0xe126('0xf')]);router['put'](_0xe126('0xd'),auth[_0xe126('0x9')](),controller['update']);router[_0xe126('0x10')]('/:id',auth[_0xe126('0x9')](),controller['destroy']);module[_0xe126('0x11')]=router;
\ No newline at end of file
index 29d7619..c38ce1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3630=['sequelize','STRING','ENUM','account','agent','queue','DATE','NOW','moment'];(function(_0x1f2a24,_0x551eae){var _0x1a9f5f=function(_0x3af021){while(--_0x3af021){_0x1f2a24['push'](_0x1f2a24['shift']());}};_0x1a9f5f(++_0x551eae);}(_0x3630,0x1d3));var _0x0363=function(_0x4d2b68,_0x55c0d8){_0x4d2b68=_0x4d2b68-0x0;var _0x2009d4=_0x3630[_0x4d2b68];return _0x2009d4;};'use strict';var moment=require(_0x0363('0x0'));var Sequelize=require(_0x0363('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0363('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0363('0x3')](_0x0363('0x4'),_0x0363('0x5'),_0x0363('0x6')),'allowNull':![],'defaultValue':_0x0363('0x6')},'transferredAt':{'type':Sequelize[_0x0363('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x0363('0x8')]}};
\ No newline at end of file
+var _0x93d9=['sequelize','exports','ENUM','account','agent','queue','DATE','NOW','moment'];(function(_0x5c127e,_0x31443d){var _0x907616=function(_0x2a8c5c){while(--_0x2a8c5c){_0x5c127e['push'](_0x5c127e['shift']());}};_0x907616(++_0x31443d);}(_0x93d9,0x116));var _0x993d=function(_0x4682ec,_0x47cb05){_0x4682ec=_0x4682ec-0x0;var _0x4bc03b=_0x93d9[_0x4682ec];return _0x4bc03b;};'use strict';var moment=require(_0x993d('0x0'));var Sequelize=require(_0x993d('0x1'));module[_0x993d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x993d('0x3')](_0x993d('0x4'),_0x993d('0x5'),'queue'),'allowNull':![],'defaultValue':_0x993d('0x6')},'transferredAt':{'type':Sequelize[_0x993d('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x993d('0x8')]}};
\ No newline at end of file
index af2dccc..c7c12c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb130=['../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','then','destroy','error','name','send','MailTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','add','day','merge','where','key','VIRTUAL','field','filter','count','include','findAll','show','params','includeAll','options','find','catch','create','body','update','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xb130,0x117));var _0x0b13=function(_0xc9cd47,_0x35a546){_0xc9cd47=_0xc9cd47-0x0;var _0x26827e=_0xb130[_0xc9cd47];return _0x26827e;};'use strict';var pdf=require(_0x0b13('0x0'));var emlformat=require(_0x0b13('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0b13('0x2'));var rp=require(_0x0b13('0x3'));var moment=require('moment');var BPromise=require(_0x0b13('0x4'));var Mustache=require(_0x0b13('0x5'));var util=require(_0x0b13('0x6'));var path=require(_0x0b13('0x7'));var sox=require(_0x0b13('0x8'));var csv=require(_0x0b13('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0b13('0xa'));var squel=require(_0x0b13('0xb'));var crypto=require('crypto');var jsforce=require(_0x0b13('0xc'));var deskjs=require(_0x0b13('0xd'));var toCsv=require(_0x0b13('0x9'));var querystring=require(_0x0b13('0xe'));var Papa=require(_0x0b13('0xf'));var Redis=require(_0x0b13('0x10'));var qs=require(_0x0b13('0x11'));var logger=require(_0x0b13('0x12'))(_0x0b13('0x13'));var utils=require(_0x0b13('0x14'));var config=require(_0x0b13('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253899,_0x316cfc){_0x316cfc=_0x316cfc||0xcc;return function(_0x4e2167){if(_0x4e2167){return _0x253899[_0x0b13('0x16')](_0x316cfc);}return _0x253899[_0x0b13('0x17')](_0x316cfc)[_0x0b13('0x18')]();};}function respondWithResult(_0x565e46,_0x146465){_0x146465=_0x146465||0xc8;return function(_0x404800){if(_0x404800){return _0x565e46[_0x0b13('0x17')](_0x146465)[_0x0b13('0x19')](_0x404800);}};}function respondWithFilteredResult(_0x4c9a4d,_0x53d3c8){return function(_0x3566f6){if(_0x3566f6){var _0x4727a9=_0x3566f6['count'],_0x3d12bb=_0x53d3c8[_0x0b13('0x1a')],_0x275bbf=_0x53d3c8[_0x0b13('0x1a')]+_0x53d3c8['limit'],_0x58b1e9;if(_0x275bbf>=_0x4727a9){_0x275bbf=_0x4727a9;_0x58b1e9=0xc8;}else{_0x58b1e9=0xce;}_0x4c9a4d[_0x0b13('0x17')](_0x58b1e9);return _0x4c9a4d[_0x0b13('0x1b')](_0x0b13('0x1c'),_0x3d12bb+'-'+_0x275bbf+'/'+_0x4727a9)[_0x0b13('0x19')](_0x3566f6);}return null;};}function patchUpdates(_0x37401f){return function(_0x3bd19a){try{jsonpatch[_0x0b13('0x1d')](_0x3bd19a,_0x37401f,!![]);}catch(_0x334e65){return BPromise[_0x0b13('0x1e')](_0x334e65);}return _0x3bd19a['save']();};}function saveUpdates(_0x4d89cc,_0x14b675){return function(_0x362b07){if(_0x362b07){return _0x362b07['update'](_0x4d89cc)[_0x0b13('0x1f')](function(_0x5da07e){return _0x5da07e;});}return null;};}function removeEntity(_0x3b1b05,_0x4013c0){return function(_0x1790ce){if(_0x1790ce){return _0x1790ce[_0x0b13('0x20')]()['then'](function(){_0x3b1b05[_0x0b13('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ad7b,_0xc29f5f){return function(_0x3a6ee9){if(!_0x3a6ee9){_0x37ad7b['sendStatus'](0x194);}return _0x3a6ee9;};}function handleError(_0x3169c7,_0x49fde6){_0x49fde6=_0x49fde6||0x1f4;return function(_0x50830c){logger[_0x0b13('0x21')](_0x50830c['stack']);if(_0x50830c[_0x0b13('0x22')]){delete _0x50830c[_0x0b13('0x22')];}_0x3169c7[_0x0b13('0x17')](_0x49fde6)[_0x0b13('0x23')](_0x50830c);};}exports['index']=function(_0x233388,_0x1ed2c7){var _0xe61d63={},_0x4d438a={},_0x3c44bb={'count':0x0,'rows':[]};var _0xa35168=db[_0x0b13('0x24')][_0x0b13('0x25')];_0x4d438a[_0x0b13('0x26')]=_[_0x0b13('0x27')](_0xa35168);var _0x132cc8={'dateStart':_0x233388[_0x0b13('0x28')][_0x0b13('0x29')],'dateEnd':_0x233388[_0x0b13('0x28')][_0x0b13('0x2a')]};delete _0x233388[_0x0b13('0x28')][_0x0b13('0x29')];delete _0x233388['query'][_0x0b13('0x2a')];_0x4d438a['query']=_[_0x0b13('0x27')](_0x233388[_0x0b13('0x28')]);_0x4d438a[_0x0b13('0x2b')]=_[_0x0b13('0x2c')](_0x4d438a['model'],_0x4d438a['query']);_0xe61d63[_0x0b13('0x2d')]=_[_0x0b13('0x2c')](_0x4d438a['model'],qs[_0x0b13('0x2e')](_0x233388[_0x0b13('0x28')][_0x0b13('0x2e')]));_0xe61d63['attributes']=_0xe61d63[_0x0b13('0x2d')][_0x0b13('0x2f')]?_0xe61d63['attributes']:_0x4d438a[_0x0b13('0x26')];if(!_0x233388['query'][_0x0b13('0x30')]('nolimit')){_0xe61d63['limit']=qs[_0x0b13('0x31')](_0x233388[_0x0b13('0x28')][_0x0b13('0x31')]);_0xe61d63[_0x0b13('0x1a')]=qs[_0x0b13('0x1a')](_0x233388[_0x0b13('0x28')][_0x0b13('0x1a')]);}_0xe61d63[_0x0b13('0x32')]=qs[_0x0b13('0x33')](_0x233388['query'][_0x0b13('0x33')]);_0xe61d63['where']=qs[_0x0b13('0x2b')](_[_0x0b13('0x34')](_0x233388[_0x0b13('0x28')],_0x4d438a[_0x0b13('0x2b')]));if(_0x132cc8[_0x0b13('0x29')]){if(_0x132cc8['dateEnd']){_0x132cc8[_0x0b13('0x2a')]=moment(_0x132cc8[_0x0b13('0x2a')])['add'](0x1,'day');}else{_0x132cc8['dateEnd']=moment(_0x132cc8['dateStart'])[_0x0b13('0x35')](0x1,_0x0b13('0x36'));}_[_0x0b13('0x37')](_0xe61d63[_0x0b13('0x38')],{'createdAt':{'$gte':_0x132cc8[_0x0b13('0x29')],'$lte':_0x132cc8[_0x0b13('0x2a')]}});}if(_0x233388[_0x0b13('0x28')]['filter']){_0xe61d63['where']=_['merge'](_0xe61d63[_0x0b13('0x38')],{'$or':_['map'](_0xa35168,function(_0x5ee8af){if(_0x5ee8af['type'][_0x0b13('0x39')]!==_0x0b13('0x3a')){var _0x56ff13={};_0x56ff13[_0x5ee8af[_0x0b13('0x3b')]]={'$like':'%'+_0x233388[_0x0b13('0x28')][_0x0b13('0x3c')]+'%'};return _0x56ff13;}})});}_0xe61d63=_[_0x0b13('0x37')]({},_0xe61d63,_0x233388['options']);var _0x1a46bb={'where':_0xe61d63[_0x0b13('0x38')]};return db[_0x0b13('0x24')][_0x0b13('0x3d')](_0x1a46bb)['then'](function(_0x145db1){_0x3c44bb[_0x0b13('0x3d')]=_0x145db1;if(_0x233388['query']['includeAll']){_0xe61d63[_0x0b13('0x3e')]=[{'all':!![]}];}return db[_0x0b13('0x24')][_0x0b13('0x3f')](_0xe61d63);})['then'](function(_0x3b0a5d){_0x3c44bb['rows']=_0x3b0a5d;return _0x3c44bb;})[_0x0b13('0x1f')](respondWithFilteredResult(_0x1ed2c7,_0xe61d63))['catch'](handleError(_0x1ed2c7,null));};exports[_0x0b13('0x40')]=function(_0x131d71,_0x147558){var _0x572f05={'raw':!![],'where':{'id':_0x131d71[_0x0b13('0x41')]['id']}},_0x23b2f2={};_0x23b2f2[_0x0b13('0x26')]=_[_0x0b13('0x27')](db['MailTransferReport'][_0x0b13('0x25')]);_0x23b2f2['query']=_[_0x0b13('0x27')](_0x131d71[_0x0b13('0x28')]);_0x23b2f2[_0x0b13('0x2b')]=_[_0x0b13('0x2c')](_0x23b2f2[_0x0b13('0x26')],_0x23b2f2[_0x0b13('0x28')]);_0x572f05[_0x0b13('0x2d')]=_[_0x0b13('0x2c')](_0x23b2f2[_0x0b13('0x26')],qs['fields'](_0x131d71[_0x0b13('0x28')][_0x0b13('0x2e')]));_0x572f05[_0x0b13('0x2d')]=_0x572f05[_0x0b13('0x2d')][_0x0b13('0x2f')]?_0x572f05[_0x0b13('0x2d')]:_0x23b2f2[_0x0b13('0x26')];if(_0x131d71[_0x0b13('0x28')][_0x0b13('0x42')]){_0x572f05[_0x0b13('0x3e')]=[{'all':!![]}];}_0x572f05=_[_0x0b13('0x37')]({},_0x572f05,_0x131d71[_0x0b13('0x43')]);return db[_0x0b13('0x24')][_0x0b13('0x44')](_0x572f05)['then'](handleEntityNotFound(_0x147558,null))['then'](respondWithResult(_0x147558,null))[_0x0b13('0x45')](handleError(_0x147558,null));};exports[_0x0b13('0x46')]=function(_0x38ef72,_0x2c250a){return db['MailTransferReport'][_0x0b13('0x46')](_0x38ef72[_0x0b13('0x47')],{})[_0x0b13('0x1f')](respondWithResult(_0x2c250a,0xc9))[_0x0b13('0x45')](handleError(_0x2c250a,null));};exports[_0x0b13('0x48')]=function(_0x22127e,_0x4fc0c9){if(_0x22127e['body']['id']){delete _0x22127e[_0x0b13('0x47')]['id'];}return db['MailTransferReport'][_0x0b13('0x44')]({'where':{'id':_0x22127e[_0x0b13('0x41')]['id']}})['then'](handleEntityNotFound(_0x4fc0c9,null))[_0x0b13('0x1f')](saveUpdates(_0x22127e['body'],null))[_0x0b13('0x1f')](respondWithResult(_0x4fc0c9,null))['catch'](handleError(_0x4fc0c9,null));};exports[_0x0b13('0x20')]=function(_0x45fdb6,_0x1cd316){return db[_0x0b13('0x24')]['find']({'where':{'id':_0x45fdb6[_0x0b13('0x41')]['id']}})['then'](handleEntityNotFound(_0x1cd316,null))[_0x0b13('0x1f')](removeEntity(_0x1cd316,null))[_0x0b13('0x45')](handleError(_0x1cd316,null));};exports[_0x0b13('0x49')]=function(_0x5bd8f2,_0x482a04){return db[_0x0b13('0x24')][_0x0b13('0x49')]()[_0x0b13('0x1f')](respondWithResult(_0x482a04,null))[_0x0b13('0x45')](handleError(_0x482a04,null));};
\ No newline at end of file
+var _0x5bd2=['html-pdf','eml-format','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','destroy','then','error','name','send','MailTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','filter','type','VIRTUAL','field','options','includeAll','include','findAll','params','intersection','find','catch','create','body','update','describe'];(function(_0x1cc781,_0x2aa881){var _0x19209d=function(_0x1be929){while(--_0x1be929){_0x1cc781['push'](_0x1cc781['shift']());}};_0x19209d(++_0x2aa881);}(_0x5bd2,0x15e));var _0x25bd=function(_0x32f88e,_0x59ed45){_0x32f88e=_0x32f88e-0x0;var _0x1442c4=_0x5bd2[_0x32f88e];return _0x1442c4;};'use strict';var pdf=require(_0x25bd('0x0'));var emlformat=require(_0x25bd('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x25bd('0x2'));var rp=require(_0x25bd('0x3'));var moment=require(_0x25bd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25bd('0x5'));var path=require(_0x25bd('0x6'));var sox=require('sox');var csv=require(_0x25bd('0x7'));var ejs=require(_0x25bd('0x8'));var fs=require('fs');var _=require(_0x25bd('0x9'));var squel=require('squel');var crypto=require(_0x25bd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x25bd('0xb'));var toCsv=require(_0x25bd('0x7'));var querystring=require(_0x25bd('0xc'));var Papa=require('papaparse');var Redis=require(_0x25bd('0xd'));var qs=require('../../components/parsers/qs');var logger=require(_0x25bd('0xe'))(_0x25bd('0xf'));var utils=require(_0x25bd('0x10'));var config=require(_0x25bd('0x11'));var db=require(_0x25bd('0x12'))['db'];function respondWithStatusCode(_0x1f8f69,_0x28b4b0){_0x28b4b0=_0x28b4b0||0xcc;return function(_0x29332d){if(_0x29332d){return _0x1f8f69[_0x25bd('0x13')](_0x28b4b0);}return _0x1f8f69[_0x25bd('0x14')](_0x28b4b0)[_0x25bd('0x15')]();};}function respondWithResult(_0x4e00cd,_0x333822){_0x333822=_0x333822||0xc8;return function(_0x4e5294){if(_0x4e5294){return _0x4e00cd[_0x25bd('0x14')](_0x333822)['json'](_0x4e5294);}};}function respondWithFilteredResult(_0x3b50d5,_0x1c51a1){return function(_0x24a7ba){if(_0x24a7ba){var _0x424ebb=_0x24a7ba[_0x25bd('0x16')],_0xb140a6=_0x1c51a1[_0x25bd('0x17')],_0x13b228=_0x1c51a1[_0x25bd('0x17')]+_0x1c51a1['limit'],_0x4b6cc3;if(_0x13b228>=_0x424ebb){_0x13b228=_0x424ebb;_0x4b6cc3=0xc8;}else{_0x4b6cc3=0xce;}_0x3b50d5[_0x25bd('0x14')](_0x4b6cc3);return _0x3b50d5['set'](_0x25bd('0x18'),_0xb140a6+'-'+_0x13b228+'/'+_0x424ebb)[_0x25bd('0x19')](_0x24a7ba);}return null;};}function patchUpdates(_0x10acd1){return function(_0x90c24e){try{jsonpatch[_0x25bd('0x1a')](_0x90c24e,_0x10acd1,!![]);}catch(_0x451afc){return BPromise[_0x25bd('0x1b')](_0x451afc);}return _0x90c24e[_0x25bd('0x1c')]();};}function saveUpdates(_0x31dee8,_0x35769f){return function(_0x2344a5){if(_0x2344a5){return _0x2344a5['update'](_0x31dee8)['then'](function(_0x431c38){return _0x431c38;});}return null;};}function removeEntity(_0x4c77f6,_0x563ea2){return function(_0x3905cd){if(_0x3905cd){return _0x3905cd[_0x25bd('0x1d')]()[_0x25bd('0x1e')](function(){_0x4c77f6[_0x25bd('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4985c9,_0x5bf4bb){return function(_0x4e468a){if(!_0x4e468a){_0x4985c9[_0x25bd('0x13')](0x194);}return _0x4e468a;};}function handleError(_0x3045ee,_0xf02464){_0xf02464=_0xf02464||0x1f4;return function(_0x172c99){logger[_0x25bd('0x1f')](_0x172c99['stack']);if(_0x172c99['name']){delete _0x172c99[_0x25bd('0x20')];}_0x3045ee[_0x25bd('0x14')](_0xf02464)[_0x25bd('0x21')](_0x172c99);};}exports['index']=function(_0x210f2f,_0x47dbe2){var _0x264e69={},_0x31d736={},_0x2688ac={'count':0x0,'rows':[]};var _0x1905dd=db[_0x25bd('0x22')][_0x25bd('0x23')];_0x31d736[_0x25bd('0x24')]=_[_0x25bd('0x25')](_0x1905dd);var _0x4ac224={'dateStart':_0x210f2f[_0x25bd('0x26')][_0x25bd('0x27')],'dateEnd':_0x210f2f[_0x25bd('0x26')][_0x25bd('0x28')]};delete _0x210f2f['query'][_0x25bd('0x27')];delete _0x210f2f[_0x25bd('0x26')][_0x25bd('0x28')];_0x31d736[_0x25bd('0x26')]=_[_0x25bd('0x25')](_0x210f2f[_0x25bd('0x26')]);_0x31d736[_0x25bd('0x29')]=_['intersection'](_0x31d736[_0x25bd('0x24')],_0x31d736[_0x25bd('0x26')]);_0x264e69['attributes']=_['intersection'](_0x31d736[_0x25bd('0x24')],qs[_0x25bd('0x2a')](_0x210f2f[_0x25bd('0x26')][_0x25bd('0x2a')]));_0x264e69[_0x25bd('0x2b')]=_0x264e69[_0x25bd('0x2b')]['length']?_0x264e69[_0x25bd('0x2b')]:_0x31d736[_0x25bd('0x24')];if(!_0x210f2f[_0x25bd('0x26')][_0x25bd('0x2c')](_0x25bd('0x2d'))){_0x264e69[_0x25bd('0x2e')]=qs[_0x25bd('0x2e')](_0x210f2f[_0x25bd('0x26')][_0x25bd('0x2e')]);_0x264e69[_0x25bd('0x17')]=qs[_0x25bd('0x17')](_0x210f2f['query']['offset']);}_0x264e69[_0x25bd('0x2f')]=qs[_0x25bd('0x30')](_0x210f2f[_0x25bd('0x26')][_0x25bd('0x30')]);_0x264e69[_0x25bd('0x31')]=qs[_0x25bd('0x29')](_[_0x25bd('0x32')](_0x210f2f[_0x25bd('0x26')],_0x31d736[_0x25bd('0x29')]));if(_0x4ac224[_0x25bd('0x27')]){if(_0x4ac224['dateEnd']){_0x4ac224[_0x25bd('0x28')]=moment(_0x4ac224[_0x25bd('0x28')])[_0x25bd('0x33')](0x1,_0x25bd('0x34'));}else{_0x4ac224['dateEnd']=moment(_0x4ac224[_0x25bd('0x27')])['add'](0x1,_0x25bd('0x34'));}_[_0x25bd('0x35')](_0x264e69[_0x25bd('0x31')],{'createdAt':{'$gte':_0x4ac224['dateStart'],'$lte':_0x4ac224[_0x25bd('0x28')]}});}if(_0x210f2f[_0x25bd('0x26')][_0x25bd('0x36')]){_0x264e69[_0x25bd('0x31')]=_[_0x25bd('0x35')](_0x264e69[_0x25bd('0x31')],{'$or':_['map'](_0x1905dd,function(_0x5a3581){if(_0x5a3581[_0x25bd('0x37')]['key']!==_0x25bd('0x38')){var _0x2b6531={};_0x2b6531[_0x5a3581[_0x25bd('0x39')]]={'$like':'%'+_0x210f2f['query'][_0x25bd('0x36')]+'%'};return _0x2b6531;}})});}_0x264e69=_[_0x25bd('0x35')]({},_0x264e69,_0x210f2f[_0x25bd('0x3a')]);var _0x2ebbff={'where':_0x264e69['where']};return db[_0x25bd('0x22')][_0x25bd('0x16')](_0x2ebbff)['then'](function(_0x22781e){_0x2688ac['count']=_0x22781e;if(_0x210f2f[_0x25bd('0x26')][_0x25bd('0x3b')]){_0x264e69[_0x25bd('0x3c')]=[{'all':!![]}];}return db[_0x25bd('0x22')][_0x25bd('0x3d')](_0x264e69);})[_0x25bd('0x1e')](function(_0x2e7e84){_0x2688ac['rows']=_0x2e7e84;return _0x2688ac;})[_0x25bd('0x1e')](respondWithFilteredResult(_0x47dbe2,_0x264e69))['catch'](handleError(_0x47dbe2,null));};exports['show']=function(_0x208cdd,_0x14ef1c){var _0x3a2da4={'raw':!![],'where':{'id':_0x208cdd[_0x25bd('0x3e')]['id']}},_0x378955={};_0x378955[_0x25bd('0x24')]=_[_0x25bd('0x25')](db[_0x25bd('0x22')][_0x25bd('0x23')]);_0x378955[_0x25bd('0x26')]=_[_0x25bd('0x25')](_0x208cdd[_0x25bd('0x26')]);_0x378955['filters']=_['intersection'](_0x378955['model'],_0x378955[_0x25bd('0x26')]);_0x3a2da4['attributes']=_[_0x25bd('0x3f')](_0x378955[_0x25bd('0x24')],qs[_0x25bd('0x2a')](_0x208cdd[_0x25bd('0x26')][_0x25bd('0x2a')]));_0x3a2da4['attributes']=_0x3a2da4[_0x25bd('0x2b')]['length']?_0x3a2da4[_0x25bd('0x2b')]:_0x378955[_0x25bd('0x24')];if(_0x208cdd[_0x25bd('0x26')]['includeAll']){_0x3a2da4[_0x25bd('0x3c')]=[{'all':!![]}];}_0x3a2da4=_[_0x25bd('0x35')]({},_0x3a2da4,_0x208cdd[_0x25bd('0x3a')]);return db[_0x25bd('0x22')][_0x25bd('0x40')](_0x3a2da4)[_0x25bd('0x1e')](handleEntityNotFound(_0x14ef1c,null))[_0x25bd('0x1e')](respondWithResult(_0x14ef1c,null))[_0x25bd('0x41')](handleError(_0x14ef1c,null));};exports['create']=function(_0x4cbada,_0x5ceab3){return db[_0x25bd('0x22')][_0x25bd('0x42')](_0x4cbada[_0x25bd('0x43')],{})[_0x25bd('0x1e')](respondWithResult(_0x5ceab3,0xc9))[_0x25bd('0x41')](handleError(_0x5ceab3,null));};exports[_0x25bd('0x44')]=function(_0x3ba0a2,_0x427daf){if(_0x3ba0a2[_0x25bd('0x43')]['id']){delete _0x3ba0a2[_0x25bd('0x43')]['id'];}return db[_0x25bd('0x22')][_0x25bd('0x40')]({'where':{'id':_0x3ba0a2['params']['id']}})['then'](handleEntityNotFound(_0x427daf,null))[_0x25bd('0x1e')](saveUpdates(_0x3ba0a2['body'],null))[_0x25bd('0x1e')](respondWithResult(_0x427daf,null))['catch'](handleError(_0x427daf,null));};exports[_0x25bd('0x1d')]=function(_0x473464,_0x2f4697){return db['MailTransferReport'][_0x25bd('0x40')]({'where':{'id':_0x473464[_0x25bd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2f4697,null))[_0x25bd('0x1e')](removeEntity(_0x2f4697,null))[_0x25bd('0x41')](handleError(_0x2f4697,null));};exports['describe']=function(_0x5f555a,_0x2a10f3){return db[_0x25bd('0x22')][_0x25bd('0x45')]()[_0x25bd('0x1e')](respondWithResult(_0x2a10f3,null))[_0x25bd('0x41')](handleError(_0x2a10f3,null));};
\ No newline at end of file
index b5014c8..5696941 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdb9=['./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5d5045,_0x107f38){var _0xe7d49e=function(_0x1c9290){while(--_0x1c9290){_0x5d5045['push'](_0x5d5045['shift']());}};_0xe7d49e(++_0x107f38);}(_0xcdb9,0x82));var _0x9cdb=function(_0x42e473,_0x35ff20){_0x42e473=_0x42e473-0x0;var _0x4f7b46=_0xcdb9[_0x42e473];return _0x4f7b46;};'use strict';var _=require('lodash');var util=require(_0x9cdb('0x0'));var logger=require(_0x9cdb('0x1'))(_0x9cdb('0x2'));var moment=require('moment');var BPromise=require(_0x9cdb('0x3'));var rp=require(_0x9cdb('0x4'));var attributes=require(_0x9cdb('0x5'));module[_0x9cdb('0x6')]=function(_0x366bab,_0x5ba925){return _0x366bab['define'](_0x9cdb('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x9cdb('0x8'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x63a5=['MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','./mailTransferReport.attributes','exports'];(function(_0x2f2fd1,_0x35b45b){var _0x4a1e3a=function(_0x4f0ea9){while(--_0x4f0ea9){_0x2f2fd1['push'](_0x2f2fd1['shift']());}};_0x4a1e3a(++_0x35b45b);}(_0x63a5,0x18e));var _0x563a=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x63a5[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var logger=require(_0x563a('0x2'))('api');var moment=require(_0x563a('0x3'));var BPromise=require('bluebird');var rp=require(_0x563a('0x4'));var attributes=require(_0x563a('0x5'));module[_0x563a('0x6')]=function(_0x37e617,_0x5c2a8d){return _0x37e617['define'](_0x563a('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x563a('0x8'),'fields':[_0x563a('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index 001d94d..fce8d95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf72=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','MailTransferReport,\x20%s,\x20%s','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf72,0x198));var _0x2cf7=function(_0x31083d,_0xb3a299){_0x31083d=_0x31083d-0x0;var _0x27a2ad=_0xcf72[_0x31083d];return _0x27a2ad;};'use strict';var _=require(_0x2cf7('0x0'));var util=require(_0x2cf7('0x1'));var moment=require(_0x2cf7('0x2'));var BPromise=require('bluebird');var rs=require(_0x2cf7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cf7('0x4'))['db'];var utils=require(_0x2cf7('0x5'));var logger=require(_0x2cf7('0x6'))(_0x2cf7('0x7'));var config=require(_0x2cf7('0x8'));var jayson=require(_0x2cf7('0x9'));var client=jayson[_0x2cf7('0xa')][_0x2cf7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9e6588,_0x17f347,_0x1c0503){return new BPromise(function(_0x55c249,_0x1f9e60){return client[_0x2cf7('0xc')](_0x9e6588,_0x1c0503)[_0x2cf7('0xd')](function(_0x18be74){logger[_0x2cf7('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x17f347,_0x2cf7('0xf'));logger[_0x2cf7('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x17f347,_0x2cf7('0xf'),JSON[_0x2cf7('0x11')](_0x18be74));if(_0x18be74[_0x2cf7('0x12')]){if(_0x18be74[_0x2cf7('0x12')][_0x2cf7('0x13')]===0x1f4){logger[_0x2cf7('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x17f347,_0x18be74[_0x2cf7('0x12')][_0x2cf7('0x14')]);return _0x1f9e60(_0x18be74['error'][_0x2cf7('0x14')]);}logger[_0x2cf7('0x12')](_0x2cf7('0x15'),_0x17f347,_0x18be74[_0x2cf7('0x12')][_0x2cf7('0x14')]);return _0x55c249(_0x18be74[_0x2cf7('0x12')][_0x2cf7('0x14')]);}else{logger[_0x2cf7('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x17f347,_0x2cf7('0xf'));_0x55c249(_0x18be74[_0x2cf7('0x16')]['message']);}})['catch'](function(_0xd374e4){logger[_0x2cf7('0x12')](_0x2cf7('0x15'),_0x17f347,_0xd374e4);_0x1f9e60(_0xd374e4);});});}
\ No newline at end of file
+var _0x3f40=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x3f08ea,_0x431bf1){var _0x47961e=function(_0x4aa1aa){while(--_0x4aa1aa){_0x3f08ea['push'](_0x3f08ea['shift']());}};_0x47961e(++_0x431bf1);}(_0x3f40,0x161));var _0x03f4=function(_0x32a6ae,_0x3afb72){_0x32a6ae=_0x32a6ae-0x0;var _0xfe0175=_0x3f40[_0x32a6ae];return _0xfe0175;};'use strict';var _=require('lodash');var util=require(_0x03f4('0x0'));var moment=require(_0x03f4('0x1'));var BPromise=require(_0x03f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03f4('0x3'));var db=require(_0x03f4('0x4'))['db'];var utils=require(_0x03f4('0x5'));var logger=require('../../config/logger')(_0x03f4('0x6'));var config=require('../../config/environment');var jayson=require(_0x03f4('0x7'));var client=jayson[_0x03f4('0x8')][_0x03f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc4df98,_0xd751ac,_0xadb367){return new BPromise(function(_0x5d7d9e,_0x52108d){return client['request'](_0xc4df98,_0xadb367)[_0x03f4('0xa')](function(_0x46e0eb){logger['info'](_0x03f4('0xb'),_0xd751ac,_0x03f4('0xc'));logger[_0x03f4('0xd')](_0x03f4('0xe'),_0xd751ac,_0x03f4('0xc'),JSON[_0x03f4('0xf')](_0x46e0eb));if(_0x46e0eb[_0x03f4('0x10')]){if(_0x46e0eb[_0x03f4('0x10')][_0x03f4('0x11')]===0x1f4){logger[_0x03f4('0x10')](_0x03f4('0xb'),_0xd751ac,_0x46e0eb[_0x03f4('0x10')][_0x03f4('0x12')]);return _0x52108d(_0x46e0eb['error'][_0x03f4('0x12')]);}logger[_0x03f4('0x10')](_0x03f4('0xb'),_0xd751ac,_0x46e0eb['error'][_0x03f4('0x12')]);return _0x5d7d9e(_0x46e0eb[_0x03f4('0x10')][_0x03f4('0x12')]);}else{logger[_0x03f4('0x13')]('MailTransferReport,\x20%s,\x20%s',_0xd751ac,_0x03f4('0xc'));_0x5d7d9e(_0x46e0eb[_0x03f4('0x14')]['message']);}})[_0x03f4('0x15')](function(_0x348042){logger[_0x03f4('0x10')](_0x03f4('0xb'),_0xd751ac,_0x348042);_0x52108d(_0x348042);});});}
\ No newline at end of file
index f475ec7..82fffa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42e0=['get','/describe','describe','show','post','create','put','/:id','update','destroy','util','express','Router','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated'];(function(_0x585eaa,_0x185d64){var _0x2234ad=function(_0x12d732){while(--_0x12d732){_0x585eaa['push'](_0x585eaa['shift']());}};_0x2234ad(++_0x185d64);}(_0x42e0,0x1c4));var _0x042e=function(_0x43c80e,_0x573e6d){_0x43c80e=_0x43c80e-0x0;var _0x128bb7=_0x42e0[_0x43c80e];return _0x128bb7;};'use strict';var multer=require('multer');var util=require(_0x042e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x042e('0x1'));var router=express[_0x042e('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x042e('0x3'));var config=require(_0x042e('0x4'));var controller=require(_0x042e('0x5'));router['get']('/',auth[_0x042e('0x6')](),controller['index']);router[_0x042e('0x7')](_0x042e('0x8'),auth[_0x042e('0x6')](),controller[_0x042e('0x9')]);router[_0x042e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x042e('0xa')]);router[_0x042e('0xb')]('/',auth[_0x042e('0x6')](),controller[_0x042e('0xc')]);router[_0x042e('0xd')](_0x042e('0xe'),auth[_0x042e('0x6')](),controller[_0x042e('0xf')]);router['delete'](_0x042e('0xe'),auth[_0x042e('0x6')](),controller[_0x042e('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x91cb=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','delete','destroy'];(function(_0x9b091b,_0x4a502a){var _0x5c8abe=function(_0x512b8f){while(--_0x512b8f){_0x9b091b['push'](_0x9b091b['shift']());}};_0x5c8abe(++_0x4a502a);}(_0x91cb,0x1b9));var _0xb91c=function(_0x32fc14,_0x20cd7b){_0x32fc14=_0x32fc14-0x0;var _0x434767=_0x91cb[_0x32fc14];return _0x434767;};'use strict';var multer=require(_0xb91c('0x0'));var util=require('util');var path=require(_0xb91c('0x1'));var timeout=require(_0xb91c('0x2'));var express=require(_0xb91c('0x3'));var router=express[_0xb91c('0x4')]();var auth=require(_0xb91c('0x5'));var interaction=require(_0xb91c('0x6'));var config=require(_0xb91c('0x7'));var controller=require(_0xb91c('0x8'));router[_0xb91c('0x9')]('/',auth[_0xb91c('0xa')](),controller[_0xb91c('0xb')]);router['get']('/describe',auth[_0xb91c('0xa')](),controller[_0xb91c('0xc')]);router[_0xb91c('0x9')](_0xb91c('0xd'),auth[_0xb91c('0xa')](),controller['show']);router[_0xb91c('0xe')]('/',auth[_0xb91c('0xa')](),controller[_0xb91c('0xf')]);router[_0xb91c('0x10')]('/:id',auth[_0xb91c('0xa')](),controller['update']);router[_0xb91c('0x11')](_0xb91c('0xd'),auth[_0xb91c('0xa')](),controller[_0xb91c('0x12')]);module[_0xb91c('0x13')]=router;
\ No newline at end of file
index ad84db6..ab61489 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80d7=['enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','INTEGER','DATE','getDataValue'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x80d7,0xb0));var _0x780d=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x80d7[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require(_0x780d('0x0'));var moment=require('moment');module[_0x780d('0x1')]={'channel':{'type':Sequelize[_0x780d('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x780d('0x2')]},'type':{'type':Sequelize[_0x780d('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x780d('0x3')]},'enterAt':{'type':Sequelize[_0x780d('0x4')]},'exitAt':{'type':Sequelize[_0x780d('0x4')],'set':function(_0x433590){var _0x528aba=moment(_0x433590);var _0x404d91=moment(this[_0x780d('0x5')](_0x780d('0x6')));var _0x78bd3e=_0x528aba[_0x780d('0x7')](_0x404d91,_0x780d('0x8'));this[_0x780d('0x9')](_0x780d('0xa'),_0x433590);this[_0x780d('0x9')]('duration',_0x78bd3e||null);}},'data1':{'type':Sequelize[_0x780d('0x2')],'comment':_0x780d('0xb')},'data2':{'type':Sequelize[_0x780d('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x780d('0x2')],'comment':_0x780d('0xc')},'data4':{'type':Sequelize[_0x780d('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x780d('0xd')},'role':{'type':Sequelize[_0x780d('0x2')]},'internal':{'type':Sequelize[_0x780d('0x3')]},'uniqueid':{'type':Sequelize[_0x780d('0x2')]}};
\ No newline at end of file
+var _0x6a2e=['exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue'];(function(_0x8ecd95,_0x3a3aea){var _0x20cd90=function(_0x34b7e0){while(--_0x34b7e0){_0x8ecd95['push'](_0x8ecd95['shift']());}};_0x20cd90(++_0x3a3aea);}(_0x6a2e,0x1a9));var _0xe6a2=function(_0xf62c57,_0x3c40a2){_0xf62c57=_0xf62c57-0x0;var _0x3d95c6=_0x6a2e[_0xf62c57];return _0x3d95c6;};'use strict';var Sequelize=require(_0xe6a2('0x0'));var moment=require(_0xe6a2('0x1'));module[_0xe6a2('0x2')]={'channel':{'type':Sequelize[_0xe6a2('0x3')]},'membername':{'type':Sequelize[_0xe6a2('0x3')]},'interface':{'type':Sequelize[_0xe6a2('0x3')]},'type':{'type':Sequelize[_0xe6a2('0x3')],'defaultValue':_0xe6a2('0x4'),'comment':_0xe6a2('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xe6a2('0x6')]},'exitAt':{'type':Sequelize[_0xe6a2('0x6')],'set':function(_0x3ee1ed){var _0x474a4d=moment(_0x3ee1ed);var _0x48cca1=moment(this[_0xe6a2('0x7')](_0xe6a2('0x8')));var _0x5b1b27=_0x474a4d[_0xe6a2('0x9')](_0x48cca1,_0xe6a2('0xa'));this[_0xe6a2('0xb')](_0xe6a2('0xc'),_0x3ee1ed);this[_0xe6a2('0xb')]('duration',_0x5b1b27||null);}},'data1':{'type':Sequelize[_0xe6a2('0x3')],'comment':_0xe6a2('0xd')},'data2':{'type':Sequelize[_0xe6a2('0x3')],'comment':_0xe6a2('0xe')},'data3':{'type':Sequelize[_0xe6a2('0x3')],'comment':_0xe6a2('0xf')},'data4':{'type':Sequelize[_0xe6a2('0x3')],'comment':_0xe6a2('0x10')},'data5':{'type':Sequelize[_0xe6a2('0x3')],'comment':_0xe6a2('0x11')},'role':{'type':Sequelize[_0xe6a2('0x3')]},'internal':{'type':Sequelize[_0xe6a2('0x12')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ee10e97..6718f92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6db=['limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','MemberReport','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xa6db,0x84));var _0xba6d=function(_0x57c340,_0x5ae0f7){_0x57c340=_0x57c340-0x0;var _0x48dbd2=_0xa6db[_0x57c340];return _0x48dbd2;};'use strict';var pdf=require(_0xba6d('0x0'));var emlformat=require(_0xba6d('0x1'));var rimraf=require(_0xba6d('0x2'));var zipdir=require(_0xba6d('0x3'));var jsonpatch=require(_0xba6d('0x4'));var rp=require(_0xba6d('0x5'));var moment=require(_0xba6d('0x6'));var BPromise=require(_0xba6d('0x7'));var Mustache=require(_0xba6d('0x8'));var util=require(_0xba6d('0x9'));var path=require(_0xba6d('0xa'));var sox=require(_0xba6d('0xb'));var csv=require(_0xba6d('0xc'));var ejs=require(_0xba6d('0xd'));var fs=require('fs');var _=require(_0xba6d('0xe'));var squel=require(_0xba6d('0xf'));var crypto=require(_0xba6d('0x10'));var jsforce=require(_0xba6d('0x11'));var deskjs=require(_0xba6d('0x12'));var toCsv=require(_0xba6d('0xc'));var querystring=require(_0xba6d('0x13'));var Papa=require(_0xba6d('0x14'));var Redis=require(_0xba6d('0x15'));var qs=require('../../components/parsers/qs');var logger=require(_0xba6d('0x16'))(_0xba6d('0x17'));var utils=require(_0xba6d('0x18'));var config=require(_0xba6d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x295892,_0x32901a){_0x32901a=_0x32901a||0xcc;return function(_0x10083a){if(_0x10083a){return _0x295892[_0xba6d('0x1a')](_0x32901a);}return _0x295892['status'](_0x32901a)[_0xba6d('0x1b')]();};}function respondWithResult(_0x4dde30,_0x951c41){_0x951c41=_0x951c41||0xc8;return function(_0x4379fe){if(_0x4379fe){return _0x4dde30[_0xba6d('0x1c')](_0x951c41)[_0xba6d('0x1d')](_0x4379fe);}};}function respondWithFilteredResult(_0x231de9,_0x31cc12){return function(_0x865350){if(_0x865350){var _0x5e10bf=_0x865350[_0xba6d('0x1e')],_0x342817=_0x31cc12[_0xba6d('0x1f')],_0x3445c5=_0x31cc12[_0xba6d('0x1f')]+_0x31cc12[_0xba6d('0x20')],_0x4c2c29;if(_0x3445c5>=_0x5e10bf){_0x3445c5=_0x5e10bf;_0x4c2c29=0xc8;}else{_0x4c2c29=0xce;}_0x231de9[_0xba6d('0x1c')](_0x4c2c29);return _0x231de9[_0xba6d('0x21')](_0xba6d('0x22'),_0x342817+'-'+_0x3445c5+'/'+_0x5e10bf)[_0xba6d('0x1d')](_0x865350);}return null;};}function patchUpdates(_0x21d54c){return function(_0xe92b66){try{jsonpatch[_0xba6d('0x23')](_0xe92b66,_0x21d54c,!![]);}catch(_0x10573a){return BPromise[_0xba6d('0x24')](_0x10573a);}return _0xe92b66[_0xba6d('0x25')]();};}function saveUpdates(_0x107e59,_0x28210f){return function(_0x152193){if(_0x152193){return _0x152193['update'](_0x107e59)[_0xba6d('0x26')](function(_0x33346f){return _0x33346f;});}return null;};}function removeEntity(_0x493a67,_0x43fac1){return function(_0x21b9ae){if(_0x21b9ae){return _0x21b9ae[_0xba6d('0x27')]()[_0xba6d('0x26')](function(){_0x493a67[_0xba6d('0x1c')](0xcc)[_0xba6d('0x1b')]();});}};}function handleEntityNotFound(_0x321ea0,_0x59beba){return function(_0x321225){if(!_0x321225){_0x321ea0[_0xba6d('0x1a')](0x194);}return _0x321225;};}function handleError(_0x417536,_0x17cb24){_0x17cb24=_0x17cb24||0x1f4;return function(_0x167988){logger[_0xba6d('0x28')](_0x167988[_0xba6d('0x29')]);if(_0x167988['name']){delete _0x167988['name'];}_0x417536[_0xba6d('0x1c')](_0x17cb24)[_0xba6d('0x2a')](_0x167988);};}exports[_0xba6d('0x2b')]=function(_0x2c1938,_0x4fec2e){var _0x56cb79={},_0x212fed={},_0x38f57e={'count':0x0,'rows':[]};var _0x5b644e=db[_0xba6d('0x2c')]['rawAttributes'];_0x212fed[_0xba6d('0x2d')]=_[_0xba6d('0x2e')](_0x5b644e);var _0xbea2a4={'dateStart':_0x2c1938['query'][_0xba6d('0x2f')],'dateEnd':_0x2c1938[_0xba6d('0x30')][_0xba6d('0x31')]};delete _0x2c1938[_0xba6d('0x30')]['dateStart'];delete _0x2c1938[_0xba6d('0x30')][_0xba6d('0x31')];_0x212fed[_0xba6d('0x30')]=_['keys'](_0x2c1938['query']);_0x212fed[_0xba6d('0x32')]=_[_0xba6d('0x33')](_0x212fed[_0xba6d('0x2d')],_0x212fed[_0xba6d('0x30')]);_0x56cb79[_0xba6d('0x34')]=_[_0xba6d('0x33')](_0x212fed[_0xba6d('0x2d')],qs[_0xba6d('0x35')](_0x2c1938[_0xba6d('0x30')][_0xba6d('0x35')]));_0x56cb79[_0xba6d('0x34')]=_0x56cb79[_0xba6d('0x34')][_0xba6d('0x36')]?_0x56cb79[_0xba6d('0x34')]:_0x212fed[_0xba6d('0x2d')];if(!_0x2c1938[_0xba6d('0x30')][_0xba6d('0x37')]('nolimit')){_0x56cb79[_0xba6d('0x20')]=qs[_0xba6d('0x20')](_0x2c1938[_0xba6d('0x30')][_0xba6d('0x20')]);_0x56cb79[_0xba6d('0x1f')]=qs['offset'](_0x2c1938['query'][_0xba6d('0x1f')]);}_0x56cb79[_0xba6d('0x38')]=qs['sort'](_0x2c1938[_0xba6d('0x30')]['sort']);_0x56cb79[_0xba6d('0x39')]=qs[_0xba6d('0x32')](_[_0xba6d('0x3a')](_0x2c1938['query'],_0x212fed[_0xba6d('0x32')]));if(_0xbea2a4[_0xba6d('0x2f')]){if(_0xbea2a4[_0xba6d('0x31')]){_0xbea2a4[_0xba6d('0x31')]=moment(_0xbea2a4[_0xba6d('0x31')])[_0xba6d('0x3b')](0x1,_0xba6d('0x3c'));}else{_0xbea2a4[_0xba6d('0x31')]=moment(_0xbea2a4['dateStart'])[_0xba6d('0x3b')](0x1,_0xba6d('0x3c'));}_[_0xba6d('0x3d')](_0x56cb79[_0xba6d('0x39')],{'createdAt':{'$gte':_0xbea2a4[_0xba6d('0x2f')],'$lte':_0xbea2a4[_0xba6d('0x31')]}});}if(_0x2c1938[_0xba6d('0x30')][_0xba6d('0x3e')]){_0x56cb79[_0xba6d('0x39')]=_[_0xba6d('0x3d')](_0x56cb79[_0xba6d('0x39')],{'$or':_[_0xba6d('0x3f')](_0x5b644e,function(_0x8f3128){if(_0x8f3128[_0xba6d('0x40')][_0xba6d('0x41')]!==_0xba6d('0x42')){var _0x4123c3={};_0x4123c3[_0x8f3128[_0xba6d('0x43')]]={'$like':'%'+_0x2c1938[_0xba6d('0x30')][_0xba6d('0x3e')]+'%'};return _0x4123c3;}})});}_0x56cb79=_['merge']({},_0x56cb79,_0x2c1938['options']);var _0x2650a9={'where':_0x56cb79[_0xba6d('0x39')]};return db[_0xba6d('0x2c')][_0xba6d('0x1e')](_0x2650a9)[_0xba6d('0x26')](function(_0xbfc9ac){_0x38f57e['count']=_0xbfc9ac;if(_0x2c1938[_0xba6d('0x30')][_0xba6d('0x44')]){_0x56cb79[_0xba6d('0x45')]=[{'all':!![]}];}return db[_0xba6d('0x2c')][_0xba6d('0x46')](_0x56cb79);})[_0xba6d('0x26')](function(_0x10b6b0){_0x38f57e[_0xba6d('0x47')]=_0x10b6b0;return _0x38f57e;})[_0xba6d('0x26')](respondWithFilteredResult(_0x4fec2e,_0x56cb79))[_0xba6d('0x48')](handleError(_0x4fec2e,null));};exports[_0xba6d('0x49')]=function(_0x3f07b2,_0x3e7e7c){var _0x21b768={'raw':!![],'where':{'id':_0x3f07b2[_0xba6d('0x4a')]['id']}},_0x9a3b11={};_0x9a3b11[_0xba6d('0x2d')]=_[_0xba6d('0x2e')](db[_0xba6d('0x2c')][_0xba6d('0x4b')]);_0x9a3b11['query']=_['keys'](_0x3f07b2[_0xba6d('0x30')]);_0x9a3b11[_0xba6d('0x32')]=_['intersection'](_0x9a3b11[_0xba6d('0x2d')],_0x9a3b11[_0xba6d('0x30')]);_0x21b768[_0xba6d('0x34')]=_['intersection'](_0x9a3b11['model'],qs[_0xba6d('0x35')](_0x3f07b2['query'][_0xba6d('0x35')]));_0x21b768[_0xba6d('0x34')]=_0x21b768[_0xba6d('0x34')][_0xba6d('0x36')]?_0x21b768[_0xba6d('0x34')]:_0x9a3b11[_0xba6d('0x2d')];if(_0x3f07b2[_0xba6d('0x30')][_0xba6d('0x44')]){_0x21b768[_0xba6d('0x45')]=[{'all':!![]}];}_0x21b768=_[_0xba6d('0x3d')]({},_0x21b768,_0x3f07b2[_0xba6d('0x4c')]);return db[_0xba6d('0x2c')][_0xba6d('0x4d')](_0x21b768)[_0xba6d('0x26')](handleEntityNotFound(_0x3e7e7c,null))[_0xba6d('0x26')](respondWithResult(_0x3e7e7c,null))[_0xba6d('0x48')](handleError(_0x3e7e7c,null));};exports['create']=function(_0x318296,_0x17d566){return db[_0xba6d('0x2c')][_0xba6d('0x4e')](_0x318296['body'],{})[_0xba6d('0x26')](respondWithResult(_0x17d566,0xc9))[_0xba6d('0x48')](handleError(_0x17d566,null));};exports[_0xba6d('0x4f')]=function(_0x1e3844,_0x18bf97){if(_0x1e3844[_0xba6d('0x50')]['id']){delete _0x1e3844[_0xba6d('0x50')]['id'];}return db[_0xba6d('0x2c')][_0xba6d('0x4d')]({'where':{'id':_0x1e3844[_0xba6d('0x4a')]['id']}})[_0xba6d('0x26')](handleEntityNotFound(_0x18bf97,null))[_0xba6d('0x26')](saveUpdates(_0x1e3844[_0xba6d('0x50')],null))[_0xba6d('0x26')](respondWithResult(_0x18bf97,null))['catch'](handleError(_0x18bf97,null));};exports[_0xba6d('0x27')]=function(_0x202a7b,_0x4400d6){return db[_0xba6d('0x2c')][_0xba6d('0x4d')]({'where':{'id':_0x202a7b[_0xba6d('0x4a')]['id']}})[_0xba6d('0x26')](handleEntityNotFound(_0x4400d6,null))[_0xba6d('0x26')](removeEntity(_0x4400d6,null))[_0xba6d('0x48')](handleError(_0x4400d6,null));};exports[_0xba6d('0x51')]=function(_0x2ed816,_0x11918f){return db['MemberReport']['describe']()['then'](respondWithResult(_0x11918f,null))[_0xba6d('0x48')](handleError(_0x11918f,null));};
\ No newline at end of file
+var _0x43eb=['rows','catch','show','params','options','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','MemberReport','rawAttributes','model','query','dateStart','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','dateEnd','day','add','merge','filter','where','type','key','VIRTUAL','field','includeAll','include'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x43eb,0xea));var _0xb43e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43eb[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb43e('0x0'));var emlformat=require(_0xb43e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb43e('0x2'));var jsonpatch=require(_0xb43e('0x3'));var rp=require(_0xb43e('0x4'));var moment=require(_0xb43e('0x5'));var BPromise=require(_0xb43e('0x6'));var Mustache=require('mustache');var util=require(_0xb43e('0x7'));var path=require(_0xb43e('0x8'));var sox=require(_0xb43e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb43e('0xa'));var squel=require('squel');var crypto=require(_0xb43e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb43e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb43e('0xd'));var Papa=require(_0xb43e('0xe'));var Redis=require(_0xb43e('0xf'));var qs=require(_0xb43e('0x10'));var logger=require(_0xb43e('0x11'))(_0xb43e('0x12'));var utils=require(_0xb43e('0x13'));var config=require('../../config/environment');var db=require(_0xb43e('0x14'))['db'];function respondWithStatusCode(_0x34ca20,_0x50d711){_0x50d711=_0x50d711||0xcc;return function(_0x925728){if(_0x925728){return _0x34ca20[_0xb43e('0x15')](_0x50d711);}return _0x34ca20['status'](_0x50d711)[_0xb43e('0x16')]();};}function respondWithResult(_0x3efe12,_0x5c13bf){_0x5c13bf=_0x5c13bf||0xc8;return function(_0xd95c45){if(_0xd95c45){return _0x3efe12['status'](_0x5c13bf)[_0xb43e('0x17')](_0xd95c45);}};}function respondWithFilteredResult(_0x267bc4,_0x18a9ae){return function(_0x2adec5){if(_0x2adec5){var _0x29fee2=_0x2adec5[_0xb43e('0x18')],_0x56bf88=_0x18a9ae[_0xb43e('0x19')],_0x5de19b=_0x18a9ae['offset']+_0x18a9ae[_0xb43e('0x1a')],_0x16536b;if(_0x5de19b>=_0x29fee2){_0x5de19b=_0x29fee2;_0x16536b=0xc8;}else{_0x16536b=0xce;}_0x267bc4[_0xb43e('0x1b')](_0x16536b);return _0x267bc4[_0xb43e('0x1c')](_0xb43e('0x1d'),_0x56bf88+'-'+_0x5de19b+'/'+_0x29fee2)[_0xb43e('0x17')](_0x2adec5);}return null;};}function patchUpdates(_0x403a9a){return function(_0x224e10){try{jsonpatch[_0xb43e('0x1e')](_0x224e10,_0x403a9a,!![]);}catch(_0x1257e8){return BPromise[_0xb43e('0x1f')](_0x1257e8);}return _0x224e10[_0xb43e('0x20')]();};}function saveUpdates(_0x35716d,_0x368294){return function(_0x5e5dcd){if(_0x5e5dcd){return _0x5e5dcd[_0xb43e('0x21')](_0x35716d)[_0xb43e('0x22')](function(_0x4d8b36){return _0x4d8b36;});}return null;};}function removeEntity(_0x44cf09,_0x217ad9){return function(_0x2011db){if(_0x2011db){return _0x2011db[_0xb43e('0x23')]()[_0xb43e('0x22')](function(){_0x44cf09[_0xb43e('0x1b')](0xcc)[_0xb43e('0x16')]();});}};}function handleEntityNotFound(_0x4be0e9,_0x10936c){return function(_0x7c2de2){if(!_0x7c2de2){_0x4be0e9[_0xb43e('0x15')](0x194);}return _0x7c2de2;};}function handleError(_0x2e575b,_0x2f7b36){_0x2f7b36=_0x2f7b36||0x1f4;return function(_0x601d68){logger[_0xb43e('0x24')](_0x601d68[_0xb43e('0x25')]);if(_0x601d68['name']){delete _0x601d68['name'];}_0x2e575b[_0xb43e('0x1b')](_0x2f7b36)['send'](_0x601d68);};}exports['index']=function(_0x4f83e9,_0x26e557){var _0x15e5ac={},_0x5e7284={},_0x2ff7b7={'count':0x0,'rows':[]};var _0x3fe4cd=db[_0xb43e('0x26')][_0xb43e('0x27')];_0x5e7284[_0xb43e('0x28')]=_['keys'](_0x3fe4cd);var _0x468eea={'dateStart':_0x4f83e9[_0xb43e('0x29')][_0xb43e('0x2a')],'dateEnd':_0x4f83e9[_0xb43e('0x29')]['dateEnd']};delete _0x4f83e9[_0xb43e('0x29')]['dateStart'];delete _0x4f83e9['query']['dateEnd'];_0x5e7284[_0xb43e('0x29')]=_[_0xb43e('0x2b')](_0x4f83e9[_0xb43e('0x29')]);_0x5e7284[_0xb43e('0x2c')]=_['intersection'](_0x5e7284[_0xb43e('0x28')],_0x5e7284[_0xb43e('0x29')]);_0x15e5ac[_0xb43e('0x2d')]=_[_0xb43e('0x2e')](_0x5e7284[_0xb43e('0x28')],qs['fields'](_0x4f83e9[_0xb43e('0x29')][_0xb43e('0x2f')]));_0x15e5ac[_0xb43e('0x2d')]=_0x15e5ac[_0xb43e('0x2d')][_0xb43e('0x30')]?_0x15e5ac[_0xb43e('0x2d')]:_0x5e7284['model'];if(!_0x4f83e9[_0xb43e('0x29')][_0xb43e('0x31')](_0xb43e('0x32'))){_0x15e5ac['limit']=qs['limit'](_0x4f83e9['query'][_0xb43e('0x1a')]);_0x15e5ac[_0xb43e('0x19')]=qs[_0xb43e('0x19')](_0x4f83e9['query'][_0xb43e('0x19')]);}_0x15e5ac[_0xb43e('0x33')]=qs[_0xb43e('0x34')](_0x4f83e9[_0xb43e('0x29')][_0xb43e('0x34')]);_0x15e5ac['where']=qs[_0xb43e('0x2c')](_[_0xb43e('0x35')](_0x4f83e9[_0xb43e('0x29')],_0x5e7284[_0xb43e('0x2c')]));if(_0x468eea[_0xb43e('0x2a')]){if(_0x468eea[_0xb43e('0x36')]){_0x468eea[_0xb43e('0x36')]=moment(_0x468eea[_0xb43e('0x36')])['add'](0x1,_0xb43e('0x37'));}else{_0x468eea[_0xb43e('0x36')]=moment(_0x468eea[_0xb43e('0x2a')])[_0xb43e('0x38')](0x1,_0xb43e('0x37'));}_[_0xb43e('0x39')](_0x15e5ac['where'],{'createdAt':{'$gte':_0x468eea[_0xb43e('0x2a')],'$lte':_0x468eea[_0xb43e('0x36')]}});}if(_0x4f83e9[_0xb43e('0x29')][_0xb43e('0x3a')]){_0x15e5ac[_0xb43e('0x3b')]=_[_0xb43e('0x39')](_0x15e5ac[_0xb43e('0x3b')],{'$or':_['map'](_0x3fe4cd,function(_0x43e840){if(_0x43e840[_0xb43e('0x3c')][_0xb43e('0x3d')]!==_0xb43e('0x3e')){var _0x558cae={};_0x558cae[_0x43e840[_0xb43e('0x3f')]]={'$like':'%'+_0x4f83e9['query']['filter']+'%'};return _0x558cae;}})});}_0x15e5ac=_['merge']({},_0x15e5ac,_0x4f83e9['options']);var _0x4cb6da={'where':_0x15e5ac['where']};return db[_0xb43e('0x26')][_0xb43e('0x18')](_0x4cb6da)['then'](function(_0xc9c33b){_0x2ff7b7[_0xb43e('0x18')]=_0xc9c33b;if(_0x4f83e9[_0xb43e('0x29')][_0xb43e('0x40')]){_0x15e5ac[_0xb43e('0x41')]=[{'all':!![]}];}return db[_0xb43e('0x26')]['findAll'](_0x15e5ac);})[_0xb43e('0x22')](function(_0x3bfe94){_0x2ff7b7[_0xb43e('0x42')]=_0x3bfe94;return _0x2ff7b7;})['then'](respondWithFilteredResult(_0x26e557,_0x15e5ac))[_0xb43e('0x43')](handleError(_0x26e557,null));};exports[_0xb43e('0x44')]=function(_0x3f594a,_0x46320f){var _0x375277={'raw':!![],'where':{'id':_0x3f594a[_0xb43e('0x45')]['id']}},_0x13c616={};_0x13c616[_0xb43e('0x28')]=_['keys'](db[_0xb43e('0x26')][_0xb43e('0x27')]);_0x13c616[_0xb43e('0x29')]=_[_0xb43e('0x2b')](_0x3f594a[_0xb43e('0x29')]);_0x13c616[_0xb43e('0x2c')]=_[_0xb43e('0x2e')](_0x13c616[_0xb43e('0x28')],_0x13c616[_0xb43e('0x29')]);_0x375277[_0xb43e('0x2d')]=_[_0xb43e('0x2e')](_0x13c616['model'],qs[_0xb43e('0x2f')](_0x3f594a[_0xb43e('0x29')][_0xb43e('0x2f')]));_0x375277[_0xb43e('0x2d')]=_0x375277[_0xb43e('0x2d')]['length']?_0x375277[_0xb43e('0x2d')]:_0x13c616[_0xb43e('0x28')];if(_0x3f594a['query']['includeAll']){_0x375277['include']=[{'all':!![]}];}_0x375277=_[_0xb43e('0x39')]({},_0x375277,_0x3f594a[_0xb43e('0x46')]);return db[_0xb43e('0x26')]['find'](_0x375277)[_0xb43e('0x22')](handleEntityNotFound(_0x46320f,null))[_0xb43e('0x22')](respondWithResult(_0x46320f,null))['catch'](handleError(_0x46320f,null));};exports[_0xb43e('0x47')]=function(_0x1c4f2d,_0x3cf8c3){return db[_0xb43e('0x26')][_0xb43e('0x47')](_0x1c4f2d[_0xb43e('0x48')],{})[_0xb43e('0x22')](respondWithResult(_0x3cf8c3,0xc9))[_0xb43e('0x43')](handleError(_0x3cf8c3,null));};exports['update']=function(_0x5bad4a,_0xc21117){if(_0x5bad4a[_0xb43e('0x48')]['id']){delete _0x5bad4a[_0xb43e('0x48')]['id'];}return db[_0xb43e('0x26')][_0xb43e('0x49')]({'where':{'id':_0x5bad4a[_0xb43e('0x45')]['id']}})['then'](handleEntityNotFound(_0xc21117,null))[_0xb43e('0x22')](saveUpdates(_0x5bad4a[_0xb43e('0x48')],null))['then'](respondWithResult(_0xc21117,null))[_0xb43e('0x43')](handleError(_0xc21117,null));};exports[_0xb43e('0x23')]=function(_0x66b636,_0x454f08){return db[_0xb43e('0x26')][_0xb43e('0x49')]({'where':{'id':_0x66b636['params']['id']}})[_0xb43e('0x22')](handleEntityNotFound(_0x454f08,null))[_0xb43e('0x22')](removeEntity(_0x454f08,null))[_0xb43e('0x43')](handleError(_0x454f08,null));};exports['describe']=function(_0x5147b6,_0x2fc1dc){return db['MemberReport'][_0xb43e('0x4a')]()[_0xb43e('0x22')](respondWithResult(_0x2fc1dc,null))['catch'](handleError(_0x2fc1dc,null));};
\ No newline at end of file
index 99c699d..47ab05b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5da=['request-promise','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x42bb6d,_0x412255){var _0x1db89b=function(_0x5da43a){while(--_0x5da43a){_0x42bb6d['push'](_0x42bb6d['shift']());}};_0x1db89b(++_0x412255);}(_0xa5da,0xbe));var _0xaa5d=function(_0x23c251,_0x8770d6){_0x23c251=_0x23c251-0x0;var _0x4f7070=_0xa5da[_0x23c251];return _0x4f7070;};'use strict';var _=require(_0xaa5d('0x0'));var util=require(_0xaa5d('0x1'));var logger=require(_0xaa5d('0x2'))(_0xaa5d('0x3'));var moment=require(_0xaa5d('0x4'));var BPromise=require(_0xaa5d('0x5'));var rp=require(_0xaa5d('0x6'));var attributes=require(_0xaa5d('0x7'));module[_0xaa5d('0x8')]=function(_0x2c19ef,_0x4a9ea1){return _0x2c19ef[_0xaa5d('0x9')](_0xaa5d('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xaa5d('0xb'),'fields':[_0xaa5d('0xc'),_0xaa5d('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c33=['api','moment','request-promise','exports','define','report_member','membername_interface','membername','interface','lodash','util'];(function(_0x132889,_0x2207a8){var _0xd93752=function(_0x572faa){while(--_0x572faa){_0x132889['push'](_0x132889['shift']());}};_0xd93752(++_0x2207a8);}(_0x7c33,0x127));var _0x37c3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x7c33[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x37c3('0x0'));var util=require(_0x37c3('0x1'));var logger=require('../../config/logger')(_0x37c3('0x2'));var moment=require(_0x37c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x37c3('0x4'));var attributes=require('./memberReport.attributes');module[_0x37c3('0x5')]=function(_0x3cd7d9,_0x3681fc){return _0x3cd7d9[_0x37c3('0x6')]('MemberReport',attributes,{'tableName':_0x37c3('0x7'),'paranoid':![],'indexes':[{'name':_0x37c3('0x8'),'fields':[_0x37c3('0x9'),_0x37c3('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index d88cafd..5dbef7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc40a=['http','request','then','info','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','code','error','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','limit','model','attributes','include','map','debug','body','CreateMemberReport','where','UpdateMemberReport','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x3e75f1,_0x231535){var _0x5258f6=function(_0x2cdfd6){while(--_0x2cdfd6){_0x3e75f1['push'](_0x3e75f1['shift']());}};_0x5258f6(++_0x231535);}(_0xc40a,0x18f));var _0xac40=function(_0x186bc4,_0x2c73c9){_0x186bc4=_0x186bc4-0x0;var _0x55ba8f=_0xc40a[_0x186bc4];return _0x55ba8f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac40('0x0'));var BPromise=require('bluebird');var rs=require(_0xac40('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xac40('0x2'));var logger=require(_0xac40('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xac40('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x400034,_0x546346,_0x449a6d){return new BPromise(function(_0x536f29,_0x1b05a2){return client[_0xac40('0x5')](_0x400034,_0x449a6d)[_0xac40('0x6')](function(_0x3511aa){logger[_0xac40('0x7')]('MemberReport,\x20%s,\x20%s',_0x546346,_0xac40('0x8'));logger['debug'](_0xac40('0x9'),_0x546346,_0xac40('0x8'),JSON[_0xac40('0xa')](_0x3511aa));if(_0x3511aa['error']){if(_0x3511aa['error'][_0xac40('0xb')]===0x1f4){logger[_0xac40('0xc')](_0xac40('0xd'),_0x546346,_0x3511aa['error'][_0xac40('0xe')]);return _0x1b05a2(_0x3511aa[_0xac40('0xc')][_0xac40('0xe')]);}logger[_0xac40('0xc')](_0xac40('0xd'),_0x546346,_0x3511aa[_0xac40('0xc')][_0xac40('0xe')]);return _0x536f29(_0x3511aa['error'][_0xac40('0xe')]);}else{logger['info'](_0xac40('0xd'),_0x546346,_0xac40('0x8'));_0x536f29(_0x3511aa['result'][_0xac40('0xe')]);}})[_0xac40('0xf')](function(_0x40b84d){logger[_0xac40('0xc')](_0xac40('0xd'),_0x546346,_0x40b84d);_0x1b05a2(_0x40b84d);});});}exports[_0xac40('0x10')]=function(_0x19fb94){var _0x364569=this;return new Promise(function(_0x3163c8,_0x3372ce){return db[_0xac40('0x11')][_0xac40('0x12')]({'raw':_0x19fb94[_0xac40('0x13')]?_0x19fb94['options'][_0xac40('0x14')]===undefined?!![]:![]:!![],'where':_0x19fb94[_0xac40('0x13')]?_0x19fb94[_0xac40('0x13')]['where']||null:null,'attributes':_0x19fb94[_0xac40('0x13')]?_0x19fb94[_0xac40('0x13')]['attributes']||null:null,'limit':_0x19fb94['options']?_0x19fb94[_0xac40('0x13')][_0xac40('0x15')]||null:null,'include':_0x19fb94[_0xac40('0x13')]?_0x19fb94[_0xac40('0x13')]['include']?_['map'](_0x19fb94[_0xac40('0x13')]['include'],function(_0x5b922f){return{'model':db[_0x5b922f[_0xac40('0x16')]],'as':_0x5b922f['as'],'attributes':_0x5b922f[_0xac40('0x17')],'include':_0x5b922f[_0xac40('0x18')]?_[_0xac40('0x19')](_0x5b922f['include'],function(_0xd1024c){return{'model':db[_0xd1024c[_0xac40('0x16')]],'as':_0xd1024c['as'],'attributes':_0xd1024c[_0xac40('0x17')],'include':_0xd1024c[_0xac40('0x18')]?_[_0xac40('0x19')](_0xd1024c[_0xac40('0x18')],function(_0x496af0){return{'model':db[_0x496af0[_0xac40('0x16')]],'as':_0x496af0['as'],'attributes':_0x496af0[_0xac40('0x17')]};}):[]};}):[]};}):[]:[]})[_0xac40('0x6')](function(_0x4025c7){logger[_0xac40('0x7')](_0xac40('0x10'),_0x19fb94);logger[_0xac40('0x1a')](_0xac40('0x10'),_0x19fb94,JSON[_0xac40('0xa')](_0x4025c7));_0x3163c8(_0x4025c7);})[_0xac40('0xf')](function(_0x1a035f){logger[_0xac40('0xc')](_0xac40('0x10'),_0x1a035f[_0xac40('0xe')],_0x19fb94);_0x3372ce(_0x364569[_0xac40('0xc')](0x1f4,_0x1a035f[_0xac40('0xe')]));});});};exports['CreateMemberReport']=function(_0x5f1f88){var _0x20bf1f=this;return new Promise(function(_0x177219,_0xc23867){return db['MemberReport']['create'](_0x5f1f88[_0xac40('0x1b')],{'raw':_0x5f1f88[_0xac40('0x13')]?_0x5f1f88['options'][_0xac40('0x14')]===undefined?!![]:![]:!![]})[_0xac40('0x6')](function(_0x154b07){logger[_0xac40('0x7')]('CreateMemberReport',_0x5f1f88);logger[_0xac40('0x1a')](_0xac40('0x1c'),_0x5f1f88,JSON['stringify'](_0x154b07));_0x177219(_0x154b07);})['catch'](function(_0x34e83b){logger[_0xac40('0xc')](_0xac40('0x1c'),_0x34e83b[_0xac40('0xe')],_0x5f1f88);_0xc23867(_0x20bf1f['error'](0x1f4,_0x34e83b['message']));});});};exports['UpdateMemberReport']=function(_0x55048d){var _0x113844=this;return new Promise(function(_0x48e97d,_0x27c220){return db[_0xac40('0x11')]['update'](_0x55048d[_0xac40('0x1b')],{'raw':_0x55048d[_0xac40('0x13')]?_0x55048d[_0xac40('0x13')][_0xac40('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55048d[_0xac40('0x13')]?_0x55048d[_0xac40('0x13')][_0xac40('0x1d')]||null:null,'attributes':_0x55048d[_0xac40('0x13')]?_0x55048d[_0xac40('0x13')][_0xac40('0x17')]||null:null,'limit':_0x55048d['options']?_0x55048d[_0xac40('0x13')][_0xac40('0x15')]||null:null})[_0xac40('0x6')](function(_0x5c6c70){logger['info']('UpdateMemberReport',_0x55048d);logger[_0xac40('0x1a')]('UpdateMemberReport',_0x55048d,JSON['stringify'](_0x5c6c70));_0x48e97d(_0x5c6c70);})[_0xac40('0xf')](function(_0x4854a2){logger['error'](_0xac40('0x1e'),_0x4854a2['message'],_0x55048d);_0x27c220(_0x113844[_0xac40('0xc')](0x1f4,_0x4854a2[_0xac40('0xe')]));});});};
\ No newline at end of file
+var _0x7e1f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','MemberReport','options','raw','attributes','limit','include','map','model','then','GetMemberReport','CreateMemberReport','create','body','update','UpdateMemberReport','catch','lodash','moment'];(function(_0x281cab,_0x471f2f){var _0x3cab1c=function(_0x15544e){while(--_0x15544e){_0x281cab['push'](_0x281cab['shift']());}};_0x3cab1c(++_0x471f2f);}(_0x7e1f,0x92));var _0xf7e1=function(_0x5e87a3,_0x348a63){_0x5e87a3=_0x5e87a3-0x0;var _0x100362=_0x7e1f[_0x5e87a3];return _0x100362;};'use strict';var _=require(_0xf7e1('0x0'));var util=require('util');var moment=require(_0xf7e1('0x1'));var BPromise=require(_0xf7e1('0x2'));var rs=require(_0xf7e1('0x3'));var fs=require('fs');var Redis=require(_0xf7e1('0x4'));var db=require(_0xf7e1('0x5'))['db'];var utils=require(_0xf7e1('0x6'));var logger=require(_0xf7e1('0x7'))('rpc');var config=require(_0xf7e1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf7e1('0x9')][_0xf7e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b3be2,_0x4c3615,_0x4671fa){return new BPromise(function(_0x596121,_0x4109aa){return client[_0xf7e1('0xb')](_0x3b3be2,_0x4671fa)['then'](function(_0x3da738){logger[_0xf7e1('0xc')]('MemberReport,\x20%s,\x20%s',_0x4c3615,_0xf7e1('0xd'));logger[_0xf7e1('0xe')](_0xf7e1('0xf'),_0x4c3615,_0xf7e1('0xd'),JSON[_0xf7e1('0x10')](_0x3da738));if(_0x3da738['error']){if(_0x3da738[_0xf7e1('0x11')][_0xf7e1('0x12')]===0x1f4){logger[_0xf7e1('0x11')](_0xf7e1('0x13'),_0x4c3615,_0x3da738['error']['message']);return _0x4109aa(_0x3da738['error'][_0xf7e1('0x14')]);}logger[_0xf7e1('0x11')](_0xf7e1('0x13'),_0x4c3615,_0x3da738['error'][_0xf7e1('0x14')]);return _0x596121(_0x3da738[_0xf7e1('0x11')]['message']);}else{logger[_0xf7e1('0xc')](_0xf7e1('0x13'),_0x4c3615,_0xf7e1('0xd'));_0x596121(_0x3da738['result'][_0xf7e1('0x14')]);}})['catch'](function(_0x324c8c){logger[_0xf7e1('0x11')](_0xf7e1('0x13'),_0x4c3615,_0x324c8c);_0x4109aa(_0x324c8c);});});}exports['GetMemberReport']=function(_0x2c042b){var _0x5d9f1e=this;return new Promise(function(_0x1c0b7c,_0x338470){return db[_0xf7e1('0x15')]['findAll']({'raw':_0x2c042b[_0xf7e1('0x16')]?_0x2c042b['options'][_0xf7e1('0x17')]===undefined?!![]:![]:!![],'where':_0x2c042b['options']?_0x2c042b[_0xf7e1('0x16')]['where']||null:null,'attributes':_0x2c042b[_0xf7e1('0x16')]?_0x2c042b[_0xf7e1('0x16')][_0xf7e1('0x18')]||null:null,'limit':_0x2c042b[_0xf7e1('0x16')]?_0x2c042b['options'][_0xf7e1('0x19')]||null:null,'include':_0x2c042b['options']?_0x2c042b[_0xf7e1('0x16')][_0xf7e1('0x1a')]?_[_0xf7e1('0x1b')](_0x2c042b[_0xf7e1('0x16')][_0xf7e1('0x1a')],function(_0x576e84){return{'model':db[_0x576e84[_0xf7e1('0x1c')]],'as':_0x576e84['as'],'attributes':_0x576e84[_0xf7e1('0x18')],'include':_0x576e84['include']?_[_0xf7e1('0x1b')](_0x576e84[_0xf7e1('0x1a')],function(_0x469622){return{'model':db[_0x469622[_0xf7e1('0x1c')]],'as':_0x469622['as'],'attributes':_0x469622[_0xf7e1('0x18')],'include':_0x469622[_0xf7e1('0x1a')]?_[_0xf7e1('0x1b')](_0x469622[_0xf7e1('0x1a')],function(_0xbde16e){return{'model':db[_0xbde16e[_0xf7e1('0x1c')]],'as':_0xbde16e['as'],'attributes':_0xbde16e[_0xf7e1('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf7e1('0x1d')](function(_0x486a8a){logger[_0xf7e1('0xc')]('GetMemberReport',_0x2c042b);logger[_0xf7e1('0xe')]('GetMemberReport',_0x2c042b,JSON['stringify'](_0x486a8a));_0x1c0b7c(_0x486a8a);})['catch'](function(_0x3bf56f){logger[_0xf7e1('0x11')](_0xf7e1('0x1e'),_0x3bf56f[_0xf7e1('0x14')],_0x2c042b);_0x338470(_0x5d9f1e[_0xf7e1('0x11')](0x1f4,_0x3bf56f['message']));});});};exports[_0xf7e1('0x1f')]=function(_0x5dc417){var _0x7d1725=this;return new Promise(function(_0x2cc1a2,_0x4492fc){return db[_0xf7e1('0x15')][_0xf7e1('0x20')](_0x5dc417[_0xf7e1('0x21')],{'raw':_0x5dc417[_0xf7e1('0x16')]?_0x5dc417[_0xf7e1('0x16')][_0xf7e1('0x17')]===undefined?!![]:![]:!![]})[_0xf7e1('0x1d')](function(_0x4a6478){logger[_0xf7e1('0xc')]('CreateMemberReport',_0x5dc417);logger[_0xf7e1('0xe')](_0xf7e1('0x1f'),_0x5dc417,JSON[_0xf7e1('0x10')](_0x4a6478));_0x2cc1a2(_0x4a6478);})['catch'](function(_0x55081a){logger[_0xf7e1('0x11')](_0xf7e1('0x1f'),_0x55081a[_0xf7e1('0x14')],_0x5dc417);_0x4492fc(_0x7d1725[_0xf7e1('0x11')](0x1f4,_0x55081a[_0xf7e1('0x14')]));});});};exports['UpdateMemberReport']=function(_0x492f06){var _0x18a173=this;return new Promise(function(_0x58d9e7,_0x4379a6){return db[_0xf7e1('0x15')][_0xf7e1('0x22')](_0x492f06[_0xf7e1('0x21')],{'raw':_0x492f06[_0xf7e1('0x16')]?_0x492f06[_0xf7e1('0x16')][_0xf7e1('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x492f06['options']?_0x492f06['options']['where']||null:null,'attributes':_0x492f06[_0xf7e1('0x16')]?_0x492f06['options'][_0xf7e1('0x18')]||null:null,'limit':_0x492f06[_0xf7e1('0x16')]?_0x492f06[_0xf7e1('0x16')][_0xf7e1('0x19')]||null:null})[_0xf7e1('0x1d')](function(_0x3d1c5d){logger[_0xf7e1('0xc')](_0xf7e1('0x23'),_0x492f06);logger[_0xf7e1('0xe')](_0xf7e1('0x23'),_0x492f06,JSON[_0xf7e1('0x10')](_0x3d1c5d));_0x58d9e7(_0x3d1c5d);})[_0xf7e1('0x24')](function(_0x5d8907){logger[_0xf7e1('0x11')](_0xf7e1('0x23'),_0x5d8907[_0xf7e1('0x14')],_0x492f06);_0x4379a6(_0x18a173[_0xf7e1('0x11')](0x1f4,_0x5d8907[_0xf7e1('0x14')]));});});};
\ No newline at end of file
index 889479e..53a6511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7c1=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','connect-timeout'];(function(_0x4258a1,_0x304c73){var _0x5057e4=function(_0x5eb4dd){while(--_0x5eb4dd){_0x4258a1['push'](_0x4258a1['shift']());}};_0x5057e4(++_0x304c73);}(_0xf7c1,0x18a));var _0x1f7c=function(_0x39ef5b,_0x211511){_0x39ef5b=_0x39ef5b-0x0;var _0x7e21c2=_0xf7c1[_0x39ef5b];return _0x7e21c2;};'use strict';var multer=require(_0x1f7c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1f7c('0x1'));var express=require(_0x1f7c('0x2'));var router=express[_0x1f7c('0x3')]();var auth=require(_0x1f7c('0x4'));var interaction=require(_0x1f7c('0x5'));var config=require(_0x1f7c('0x6'));var controller=require(_0x1f7c('0x7'));router[_0x1f7c('0x8')]('/',controller[_0x1f7c('0x9')]);module[_0x1f7c('0xa')]=router;
\ No newline at end of file
+var _0x9fd7=['../../config/environment','./migration.controller','get','index','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0x21791c,_0x42ae12){var _0x58e892=function(_0x177df4){while(--_0x177df4){_0x21791c['push'](_0x21791c['shift']());}};_0x58e892(++_0x42ae12);}(_0x9fd7,0x1ef));var _0x79fd=function(_0x105c60,_0x2b77a6){_0x105c60=_0x105c60-0x0;var _0x4cd240=_0x9fd7[_0x105c60];return _0x4cd240;};'use strict';var multer=require(_0x79fd('0x0'));var util=require(_0x79fd('0x1'));var path=require(_0x79fd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x79fd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x79fd('0x4'));var config=require(_0x79fd('0x5'));var controller=require(_0x79fd('0x6'));router[_0x79fd('0x7')]('/',controller[_0x79fd('0x8')]);module[_0x79fd('0x9')]=router;
\ No newline at end of file
index aa247bb..0718da7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a2=['sequelize','exports','STRING'];(function(_0x3bd0a3,_0x334334){var _0x574e9a=function(_0x483779){while(--_0x483779){_0x3bd0a3['push'](_0x3bd0a3['shift']());}};_0x574e9a(++_0x334334);}(_0x16a2,0x105));var _0x216a=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x16a2[_0xbe40ad];return _0x50fac9;};'use strict';var Sequelize=require(_0x216a('0x0'));module[_0x216a('0x1')]={'version':{'type':Sequelize[_0x216a('0x2')],'primaryKey':!![],'autoIncrement':![]}};
\ No newline at end of file
+var _0x4c4a=['exports','STRING','sequelize'];(function(_0x3277f7,_0x5b7f70){var _0x55e573=function(_0x3fe0c1){while(--_0x3fe0c1){_0x3277f7['push'](_0x3277f7['shift']());}};_0x55e573(++_0x5b7f70);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x12f11b,_0x395826){_0x12f11b=_0x12f11b-0x0;var _0xedf3a2=_0x4c4a[_0x12f11b];return _0xedf3a2;};'use strict';var Sequelize=require(_0xa4c4('0x0'));module[_0xa4c4('0x1')]={'version':{'type':Sequelize[_0xa4c4('0x2')],'primaryKey':!![],'autoIncrement':![]}};
\ No newline at end of file
index d36e4c0..4ee7024 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6906=['merge','filter','map','type','key','field','options','includeAll','include','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','destroy','error','name','index','Migration','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day'];(function(_0x464e1f,_0x2aa86f){var _0x1c1ce2=function(_0x543c79){while(--_0x543c79){_0x464e1f['push'](_0x464e1f['shift']());}};_0x1c1ce2(++_0x2aa86f);}(_0x6906,0x1da));var _0x6690=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6906[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x6690('0x0'));var emlformat=require(_0x6690('0x1'));var rimraf=require(_0x6690('0x2'));var zipdir=require(_0x6690('0x3'));var jsonpatch=require(_0x6690('0x4'));var rp=require(_0x6690('0x5'));var moment=require('moment');var BPromise=require(_0x6690('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6690('0x7'));var csv=require(_0x6690('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6690('0x9'));var squel=require(_0x6690('0xa'));var crypto=require(_0x6690('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6690('0xc'));var toCsv=require(_0x6690('0x8'));var querystring=require(_0x6690('0xd'));var Papa=require(_0x6690('0xe'));var Redis=require('ioredis');var qs=require(_0x6690('0xf'));var logger=require('../../config/logger')(_0x6690('0x10'));var utils=require(_0x6690('0x11'));var config=require(_0x6690('0x12'));var db=require(_0x6690('0x13'))['db'];function respondWithStatusCode(_0x85c646,_0x1e2976){_0x1e2976=_0x1e2976||0xcc;return function(_0x4abb9d){if(_0x4abb9d){return _0x85c646[_0x6690('0x14')](_0x1e2976);}return _0x85c646[_0x6690('0x15')](_0x1e2976)['end']();};}function respondWithResult(_0x558e75,_0x1c1654){_0x1c1654=_0x1c1654||0xc8;return function(_0x41e7e1){if(_0x41e7e1){return _0x558e75[_0x6690('0x15')](_0x1c1654)[_0x6690('0x16')](_0x41e7e1);}};}function respondWithFilteredResult(_0x5bc183,_0x4e7b97){return function(_0x30b924){if(_0x30b924){var _0x4716a4=_0x30b924[_0x6690('0x17')],_0xe50dcf=_0x4e7b97[_0x6690('0x18')],_0x560621=_0x4e7b97['offset']+_0x4e7b97[_0x6690('0x19')],_0x1d38ba;if(_0x560621>=_0x4716a4){_0x560621=_0x4716a4;_0x1d38ba=0xc8;}else{_0x1d38ba=0xce;}_0x5bc183[_0x6690('0x15')](_0x1d38ba);return _0x5bc183[_0x6690('0x1a')]('Content-Range',_0xe50dcf+'-'+_0x560621+'/'+_0x4716a4)[_0x6690('0x16')](_0x30b924);}return null;};}function patchUpdates(_0x5f127e){return function(_0x24eb3b){try{jsonpatch[_0x6690('0x1b')](_0x24eb3b,_0x5f127e,!![]);}catch(_0x334fdc){return BPromise['reject'](_0x334fdc);}return _0x24eb3b[_0x6690('0x1c')]();};}function saveUpdates(_0x3f9ab2,_0x100aa9){return function(_0x54fdaa){if(_0x54fdaa){return _0x54fdaa[_0x6690('0x1d')](_0x3f9ab2)[_0x6690('0x1e')](function(_0x48b4ee){return _0x48b4ee;});}return null;};}function removeEntity(_0x574186,_0x3ebeea){return function(_0x4e2a75){if(_0x4e2a75){return _0x4e2a75[_0x6690('0x1f')]()[_0x6690('0x1e')](function(){_0x574186[_0x6690('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e368f,_0x35e162){return function(_0x29970c){if(!_0x29970c){_0x1e368f['sendStatus'](0x194);}return _0x29970c;};}function handleError(_0x321468,_0x109f4d){_0x109f4d=_0x109f4d||0x1f4;return function(_0x567d56){logger[_0x6690('0x20')](_0x567d56['stack']);if(_0x567d56[_0x6690('0x21')]){delete _0x567d56[_0x6690('0x21')];}_0x321468[_0x6690('0x15')](_0x109f4d)['send'](_0x567d56);};}exports[_0x6690('0x22')]=function(_0x301236,_0x48b92f){var _0x282b27={},_0x33d60e={},_0x48f977={'count':0x0,'rows':[]};var _0x5274a3=db[_0x6690('0x23')][_0x6690('0x24')];_0x33d60e[_0x6690('0x25')]=_[_0x6690('0x26')](_0x5274a3);var _0x212e45={'dateStart':_0x301236[_0x6690('0x27')][_0x6690('0x28')],'dateEnd':_0x301236['query'][_0x6690('0x29')]};delete _0x301236[_0x6690('0x27')][_0x6690('0x28')];delete _0x301236[_0x6690('0x27')][_0x6690('0x29')];_0x33d60e[_0x6690('0x27')]=_[_0x6690('0x26')](_0x301236['query']);_0x33d60e[_0x6690('0x2a')]=_[_0x6690('0x2b')](_0x33d60e['model'],_0x33d60e[_0x6690('0x27')]);_0x282b27[_0x6690('0x2c')]=_['intersection'](_0x33d60e[_0x6690('0x25')],qs['fields'](_0x301236['query']['fields']));_0x282b27[_0x6690('0x2c')]=_0x282b27[_0x6690('0x2c')][_0x6690('0x2d')]?_0x282b27[_0x6690('0x2c')]:_0x33d60e['model'];if(!_0x301236[_0x6690('0x27')][_0x6690('0x2e')](_0x6690('0x2f'))){_0x282b27[_0x6690('0x19')]=qs['limit'](_0x301236['query'][_0x6690('0x19')]);_0x282b27[_0x6690('0x18')]=qs[_0x6690('0x18')](_0x301236[_0x6690('0x27')]['offset']);}_0x282b27[_0x6690('0x30')]=qs[_0x6690('0x31')](_0x301236[_0x6690('0x27')][_0x6690('0x31')]);_0x282b27[_0x6690('0x32')]=qs['filters'](_[_0x6690('0x33')](_0x301236[_0x6690('0x27')],_0x33d60e['filters']));if(_0x212e45[_0x6690('0x28')]){if(_0x212e45[_0x6690('0x29')]){_0x212e45[_0x6690('0x29')]=moment(_0x212e45['dateEnd'])[_0x6690('0x34')](0x1,_0x6690('0x35'));}else{_0x212e45[_0x6690('0x29')]=moment(_0x212e45['dateStart'])['add'](0x1,'day');}_[_0x6690('0x36')](_0x282b27[_0x6690('0x32')],{'createdAt':{'$gte':_0x212e45['dateStart'],'$lte':_0x212e45[_0x6690('0x29')]}});}if(_0x301236[_0x6690('0x27')][_0x6690('0x37')]){_0x282b27[_0x6690('0x32')]=_[_0x6690('0x36')](_0x282b27[_0x6690('0x32')],{'$or':_[_0x6690('0x38')](_0x5274a3,function(_0x5de6a0){if(_0x5de6a0[_0x6690('0x39')][_0x6690('0x3a')]!=='VIRTUAL'){var _0x171c5a={};_0x171c5a[_0x5de6a0[_0x6690('0x3b')]]={'$like':'%'+_0x301236['query'][_0x6690('0x37')]+'%'};return _0x171c5a;}})});}_0x282b27=_[_0x6690('0x36')]({},_0x282b27,_0x301236[_0x6690('0x3c')]);var _0x5e09c9={'where':_0x282b27[_0x6690('0x32')]};return db[_0x6690('0x23')][_0x6690('0x17')](_0x5e09c9)[_0x6690('0x1e')](function(_0x792664){_0x48f977['count']=_0x792664;if(_0x301236[_0x6690('0x27')][_0x6690('0x3d')]){_0x282b27[_0x6690('0x3e')]=[{'all':!![]}];}return db[_0x6690('0x23')][_0x6690('0x3f')](_0x282b27);})[_0x6690('0x1e')](function(_0x102f3e){_0x48f977[_0x6690('0x40')]=_0x102f3e;return _0x48f977;})[_0x6690('0x1e')](respondWithFilteredResult(_0x48b92f,_0x282b27))[_0x6690('0x41')](handleError(_0x48b92f,null));};
\ No newline at end of file
+var _0xaa83=['eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','status','end','count','offset','limit','Content-Range','json','apply','reject','then','sendStatus','error','stack','name','index','Migration','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','add','day','merge','filter','map','type','VIRTUAL','options','includeAll','findAll','rows','catch','html-pdf'];(function(_0x705e26,_0x171793){var _0x19472c=function(_0x53272d){while(--_0x53272d){_0x705e26['push'](_0x705e26['shift']());}};_0x19472c(++_0x171793);}(_0xaa83,0x1e7));var _0x3aa8=function(_0x2fa453,_0x502837){_0x2fa453=_0x2fa453-0x0;var _0x250026=_0xaa83[_0x2fa453];return _0x250026;};'use strict';var pdf=require(_0x3aa8('0x0'));var emlformat=require(_0x3aa8('0x1'));var rimraf=require(_0x3aa8('0x2'));var zipdir=require(_0x3aa8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3aa8('0x4'));var Mustache=require(_0x3aa8('0x5'));var util=require(_0x3aa8('0x6'));var path=require(_0x3aa8('0x7'));var sox=require(_0x3aa8('0x8'));var csv=require(_0x3aa8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3aa8('0xa'));var squel=require(_0x3aa8('0xb'));var crypto=require('crypto');var jsforce=require(_0x3aa8('0xc'));var deskjs=require(_0x3aa8('0xd'));var toCsv=require(_0x3aa8('0x9'));var querystring=require('querystring');var Papa=require(_0x3aa8('0xe'));var Redis=require(_0x3aa8('0xf'));var qs=require(_0x3aa8('0x10'));var logger=require('../../config/logger')(_0x3aa8('0x11'));var utils=require(_0x3aa8('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8a96a9,_0x2d14ff){_0x2d14ff=_0x2d14ff||0xcc;return function(_0x45b1c1){if(_0x45b1c1){return _0x8a96a9['sendStatus'](_0x2d14ff);}return _0x8a96a9[_0x3aa8('0x13')](_0x2d14ff)[_0x3aa8('0x14')]();};}function respondWithResult(_0x57601b,_0x1fa9ec){_0x1fa9ec=_0x1fa9ec||0xc8;return function(_0x256b07){if(_0x256b07){return _0x57601b['status'](_0x1fa9ec)['json'](_0x256b07);}};}function respondWithFilteredResult(_0x408369,_0x1fc3ed){return function(_0x1e23e5){if(_0x1e23e5){var _0x134ce7=_0x1e23e5[_0x3aa8('0x15')],_0x12360b=_0x1fc3ed['offset'],_0x3f3aff=_0x1fc3ed[_0x3aa8('0x16')]+_0x1fc3ed[_0x3aa8('0x17')],_0x197405;if(_0x3f3aff>=_0x134ce7){_0x3f3aff=_0x134ce7;_0x197405=0xc8;}else{_0x197405=0xce;}_0x408369[_0x3aa8('0x13')](_0x197405);return _0x408369['set'](_0x3aa8('0x18'),_0x12360b+'-'+_0x3f3aff+'/'+_0x134ce7)[_0x3aa8('0x19')](_0x1e23e5);}return null;};}function patchUpdates(_0x474bba){return function(_0x4ecfe4){try{jsonpatch[_0x3aa8('0x1a')](_0x4ecfe4,_0x474bba,!![]);}catch(_0x3db14d){return BPromise[_0x3aa8('0x1b')](_0x3db14d);}return _0x4ecfe4['save']();};}function saveUpdates(_0x575c6c,_0x58cab9){return function(_0x26b280){if(_0x26b280){return _0x26b280['update'](_0x575c6c)[_0x3aa8('0x1c')](function(_0x33ab2a){return _0x33ab2a;});}return null;};}function removeEntity(_0x1fc070,_0x34d931){return function(_0x3af7de){if(_0x3af7de){return _0x3af7de['destroy']()[_0x3aa8('0x1c')](function(){_0x1fc070[_0x3aa8('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x96cecd,_0x523cff){return function(_0x4cd376){if(!_0x4cd376){_0x96cecd[_0x3aa8('0x1d')](0x194);}return _0x4cd376;};}function handleError(_0x2fbd65,_0x486d72){_0x486d72=_0x486d72||0x1f4;return function(_0x2004f9){logger[_0x3aa8('0x1e')](_0x2004f9[_0x3aa8('0x1f')]);if(_0x2004f9[_0x3aa8('0x20')]){delete _0x2004f9['name'];}_0x2fbd65[_0x3aa8('0x13')](_0x486d72)['send'](_0x2004f9);};}exports[_0x3aa8('0x21')]=function(_0x208f4d,_0x502084){var _0x3a7b32={},_0x2eb401={},_0x3d7642={'count':0x0,'rows':[]};var _0x49a214=db[_0x3aa8('0x22')][_0x3aa8('0x23')];_0x2eb401['model']=_[_0x3aa8('0x24')](_0x49a214);var _0x33c341={'dateStart':_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x26')],'dateEnd':_0x208f4d['query']['dateEnd']};delete _0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x26')];delete _0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x27')];_0x2eb401[_0x3aa8('0x25')]=_[_0x3aa8('0x24')](_0x208f4d[_0x3aa8('0x25')]);_0x2eb401[_0x3aa8('0x28')]=_[_0x3aa8('0x29')](_0x2eb401[_0x3aa8('0x2a')],_0x2eb401[_0x3aa8('0x25')]);_0x3a7b32['attributes']=_[_0x3aa8('0x29')](_0x2eb401[_0x3aa8('0x2a')],qs['fields'](_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x2b')]));_0x3a7b32['attributes']=_0x3a7b32[_0x3aa8('0x2c')]['length']?_0x3a7b32[_0x3aa8('0x2c')]:_0x2eb401[_0x3aa8('0x2a')];if(!_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x2d')](_0x3aa8('0x2e'))){_0x3a7b32[_0x3aa8('0x17')]=qs[_0x3aa8('0x17')](_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x17')]);_0x3a7b32[_0x3aa8('0x16')]=qs['offset'](_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x16')]);}_0x3a7b32['order']=qs[_0x3aa8('0x2f')](_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x2f')]);_0x3a7b32[_0x3aa8('0x30')]=qs[_0x3aa8('0x28')](_['pick'](_0x208f4d[_0x3aa8('0x25')],_0x2eb401[_0x3aa8('0x28')]));if(_0x33c341[_0x3aa8('0x26')]){if(_0x33c341[_0x3aa8('0x27')]){_0x33c341[_0x3aa8('0x27')]=moment(_0x33c341[_0x3aa8('0x27')])[_0x3aa8('0x31')](0x1,_0x3aa8('0x32'));}else{_0x33c341[_0x3aa8('0x27')]=moment(_0x33c341['dateStart'])[_0x3aa8('0x31')](0x1,_0x3aa8('0x32'));}_[_0x3aa8('0x33')](_0x3a7b32['where'],{'createdAt':{'$gte':_0x33c341[_0x3aa8('0x26')],'$lte':_0x33c341[_0x3aa8('0x27')]}});}if(_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x34')]){_0x3a7b32[_0x3aa8('0x30')]=_['merge'](_0x3a7b32[_0x3aa8('0x30')],{'$or':_[_0x3aa8('0x35')](_0x49a214,function(_0x182fc7){if(_0x182fc7[_0x3aa8('0x36')]['key']!==_0x3aa8('0x37')){var _0x14a723={};_0x14a723[_0x182fc7['field']]={'$like':'%'+_0x208f4d[_0x3aa8('0x25')]['filter']+'%'};return _0x14a723;}})});}_0x3a7b32=_['merge']({},_0x3a7b32,_0x208f4d[_0x3aa8('0x38')]);var _0x2cdfb5={'where':_0x3a7b32[_0x3aa8('0x30')]};return db[_0x3aa8('0x22')][_0x3aa8('0x15')](_0x2cdfb5)[_0x3aa8('0x1c')](function(_0x4ccd24){_0x3d7642[_0x3aa8('0x15')]=_0x4ccd24;if(_0x208f4d[_0x3aa8('0x25')][_0x3aa8('0x39')]){_0x3a7b32['include']=[{'all':!![]}];}return db[_0x3aa8('0x22')][_0x3aa8('0x3a')](_0x3a7b32);})[_0x3aa8('0x1c')](function(_0x46c817){_0x3d7642[_0x3aa8('0x3b')]=_0x46c817;return _0x3d7642;})['then'](respondWithFilteredResult(_0x502084,_0x3a7b32))[_0x3aa8('0x3c')](handleError(_0x502084,null));};
\ No newline at end of file
index 037c4c8..da8e508 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2faf=['bluebird','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','moment'];(function(_0x364bb4,_0x5f23e3){var _0x3c47bc=function(_0x44f0fa){while(--_0x44f0fa){_0x364bb4['push'](_0x364bb4['shift']());}};_0x3c47bc(++_0x5f23e3);}(_0x2faf,0xb0));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf2fa('0x0'));var util=require(_0xf2fa('0x1'));var logger=require(_0xf2fa('0x2'))('api');var moment=require(_0xf2fa('0x3'));var BPromise=require(_0xf2fa('0x4'));var rp=require('request-promise');var attributes=require(_0xf2fa('0x5'));module[_0xf2fa('0x6')]=function(_0x2884e3,_0x4cfc9d){return _0x2884e3[_0xf2fa('0x7')](_0xf2fa('0x8'),attributes,{'tableName':_0xf2fa('0x9'),'paranoid':![],'indexes':[],'timestamps':![]});};
\ No newline at end of file
+var _0xa6ce=['api','bluebird','request-promise','define','Migration','migrations','lodash','../../config/logger'];(function(_0x43291d,_0x166561){var _0x6c48ff=function(_0x5a31a4){while(--_0x5a31a4){_0x43291d['push'](_0x43291d['shift']());}};_0x6c48ff(++_0x166561);}(_0xa6ce,0x15e));var _0xea6c=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0xa6ce[_0x10dfdf];return _0x4d857d;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var logger=require(_0xea6c('0x1'))(_0xea6c('0x2'));var moment=require('moment');var BPromise=require(_0xea6c('0x3'));var rp=require(_0xea6c('0x4'));var attributes=require('./migration.attributes');module['exports']=function(_0x2ac723,_0x1eea8f){return _0x2ac723[_0xea6c('0x5')](_0xea6c('0x6'),attributes,{'tableName':_0xea6c('0x7'),'paranoid':![],'indexes':[],'timestamps':![]});};
\ No newline at end of file
index ebfb558..8786fdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b19=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x197896,_0x2abee1){var _0x2c67d5=function(_0x5e3ce0){while(--_0x5e3ce0){_0x197896['push'](_0x197896['shift']());}};_0x2c67d5(++_0x2abee1);}(_0x4b19,0x195));var _0x94b1=function(_0x35e79e,_0x55020d){_0x35e79e=_0x35e79e-0x0;var _0x25de3b=_0x4b19[_0x35e79e];return _0x25de3b;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var moment=require(_0x94b1('0x1'));var BPromise=require(_0x94b1('0x2'));var rs=require(_0x94b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x94b1('0x4'))['db'];var utils=require(_0x94b1('0x5'));var logger=require(_0x94b1('0x6'))('rpc');var config=require(_0x94b1('0x7'));var jayson=require(_0x94b1('0x8'));var client=jayson['client'][_0x94b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x110a52,_0x4ea1f9,_0x40c69c){return new BPromise(function(_0x201a02,_0xad0a85){return client['request'](_0x110a52,_0x40c69c)[_0x94b1('0xa')](function(_0x4f948b){logger['info'](_0x94b1('0xb'),_0x4ea1f9,_0x94b1('0xc'));logger[_0x94b1('0xd')](_0x94b1('0xe'),_0x4ea1f9,_0x94b1('0xc'),JSON[_0x94b1('0xf')](_0x4f948b));if(_0x4f948b['error']){if(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x11')]===0x1f4){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x4f948b['error']['message']);return _0xad0a85(_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);}logger['error']('Migration,\x20%s,\x20%s',_0x4ea1f9,_0x4f948b[_0x94b1('0x10')][_0x94b1('0x12')]);return _0x201a02(_0x4f948b['error'][_0x94b1('0x12')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x4ea1f9,_0x94b1('0xc'));_0x201a02(_0x4f948b[_0x94b1('0x13')][_0x94b1('0x12')]);}})[_0x94b1('0x14')](function(_0x494138){logger[_0x94b1('0x10')](_0x94b1('0xb'),_0x4ea1f9,_0x494138);_0xad0a85(_0x494138);});});}
\ No newline at end of file
+var _0xf2ca=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0xad3ac2,_0xb570a2){var _0x4a53f3=function(_0x120253){while(--_0x120253){_0xad3ac2['push'](_0xad3ac2['shift']());}};_0x4a53f3(++_0xb570a2);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xf2ca[_0x220f3f];return _0x1f170e;};'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});function respondWithRpcPromise(_0x1f9531,_0x58351f,_0x37fedd){return new BPromise(function(_0x3c0421,_0x4a7397){return client[_0xaf2c('0xc')](_0x1f9531,_0x37fedd)['then'](function(_0x439ca3){logger['info'](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x58351f,'request\x20sent',JSON['stringify'](_0x439ca3));if(_0x439ca3[_0xaf2c('0x11')]){if(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x12')]===0x1f4){logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3['error']['message']);return _0x4a7397(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}logger[_0xaf2c('0x11')](_0xaf2c('0xd'),_0x58351f,_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);return _0x3c0421(_0x439ca3[_0xaf2c('0x11')][_0xaf2c('0x13')]);}else{logger[_0xaf2c('0x14')](_0xaf2c('0xd'),_0x58351f,_0xaf2c('0xe'));_0x3c0421(_0x439ca3[_0xaf2c('0x15')][_0xaf2c('0x13')]);}})[_0xaf2c('0x16')](function(_0x705d09){logger['error'](_0xaf2c('0xd'),_0x58351f,_0x705d09);_0x4a7397(_0x705d09);});});}
\ No newline at end of file
index 8567119..8ed5daf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x614b=['index','/:id','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x614b,0xb3));var _0xb614=function(_0x3bdaf7,_0x4b61c2){_0x3bdaf7=_0x3bdaf7-0x0;var _0x483c43=_0x614b[_0x3bdaf7];return _0x483c43;};'use strict';var multer=require(_0xb614('0x0'));var util=require(_0xb614('0x1'));var path=require('path');var timeout=require(_0xb614('0x2'));var express=require(_0xb614('0x3'));var router=express[_0xb614('0x4')]();var auth=require(_0xb614('0x5'));var interaction=require(_0xb614('0x6'));var config=require(_0xb614('0x7'));var controller=require(_0xb614('0x8'));router[_0xb614('0x9')]('/',auth[_0xb614('0xa')](),controller[_0xb614('0xb')]);router[_0xb614('0x9')](_0xb614('0xc'),auth[_0xb614('0xa')](),controller['show']);router[_0xb614('0xd')]('/',auth[_0xb614('0xa')](),controller[_0xb614('0xe')]);router[_0xb614('0xf')](_0xb614('0xc'),auth['isAuthenticated'](),controller[_0xb614('0x10')]);router[_0xb614('0x11')](_0xb614('0xc'),auth[_0xb614('0xa')](),controller[_0xb614('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2b95=['../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x35c1cf,_0x197400){var _0x56bc59=function(_0x7b52ad){while(--_0x7b52ad){_0x35c1cf['push'](_0x35c1cf['shift']());}};_0x56bc59(++_0x197400);}(_0x2b95,0x1f1));var _0x52b9=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0x2b95[_0x4fda88];return _0xe37511;};'use strict';var multer=require(_0x52b9('0x0'));var util=require(_0x52b9('0x1'));var path=require(_0x52b9('0x2'));var timeout=require(_0x52b9('0x3'));var express=require(_0x52b9('0x4'));var router=express[_0x52b9('0x5')]();var auth=require(_0x52b9('0x6'));var interaction=require(_0x52b9('0x7'));var config=require(_0x52b9('0x8'));var controller=require(_0x52b9('0x9'));router['get']('/',auth[_0x52b9('0xa')](),controller[_0x52b9('0xb')]);router['get'](_0x52b9('0xc'),auth[_0x52b9('0xa')](),controller[_0x52b9('0xd')]);router[_0x52b9('0xe')]('/',auth[_0x52b9('0xa')](),controller[_0x52b9('0xf')]);router[_0x52b9('0x10')]('/:id',auth[_0x52b9('0xa')](),controller[_0x52b9('0x11')]);router[_0x52b9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x52b9('0x13')]);module[_0x52b9('0x14')]=router;
\ No newline at end of file
index 9447dcc..dc2311f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26cc=['ENUM','localnet','externip','STRING','exports'];(function(_0xff8595,_0x39341d){var _0x31e49e=function(_0x23ee7b){while(--_0x23ee7b){_0xff8595['push'](_0xff8595['shift']());}};_0x31e49e(++_0x39341d);}(_0x26cc,0x149));var _0xc26c=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0x26cc[_0xdefbc3];return _0x367798;};'use strict';var Sequelize=require('sequelize');module[_0xc26c('0x0')]={'type':{'type':Sequelize[_0xc26c('0x1')](_0xc26c('0x2'),_0xc26c('0x3'))},'value':{'type':Sequelize[_0xc26c('0x4')]}};
\ No newline at end of file
+var _0x6479=['externip','STRING','sequelize','ENUM'];(function(_0x529035,_0x31de5c){var _0x256095=function(_0x545c56){while(--_0x545c56){_0x529035['push'](_0x529035['shift']());}};_0x256095(++_0x31de5c);}(_0x6479,0x17a));var _0x9647=function(_0x1a37df,_0x3ed536){_0x1a37df=_0x1a37df-0x0;var _0x5a7d5f=_0x6479[_0x1a37df];return _0x5a7d5f;};'use strict';var Sequelize=require(_0x9647('0x0'));module['exports']={'type':{'type':Sequelize[_0x9647('0x1')]('localnet',_0x9647('0x2'))},'value':{'type':Sequelize[_0x9647('0x3')]}};
\ No newline at end of file
index 05664d5..b0b3fe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf1c=['fast-json-patch','request-promise','moment','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','then','info','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Network','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','add','day','merge','filter','map','key','VIRTUAL','field','options','includeAll','findAll','catch','show','include','find','create','sequelize','body','type','server/files/templates/network.ejs','render','Reload','chan_sip.so','params','readFileSync','join','root','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','html-pdf','eml-format','zip-dir'];(function(_0x351b05,_0x3fe0ea){var _0x19e3c4=function(_0x109b0b){while(--_0x109b0b){_0x351b05['push'](_0x351b05['shift']());}};_0x19e3c4(++_0x3fe0ea);}(_0xcf1c,0x18d));var _0xccf1=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0xcf1c[_0x4521e3];return _0x46a272;};'use strict';var pdf=require(_0xccf1('0x0'));var emlformat=require(_0xccf1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xccf1('0x2'));var jsonpatch=require(_0xccf1('0x3'));var rp=require(_0xccf1('0x4'));var moment=require(_0xccf1('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xccf1('0x6'));var sox=require('sox');var csv=require(_0xccf1('0x7'));var ejs=require(_0xccf1('0x8'));var fs=require('fs');var _=require(_0xccf1('0x9'));var squel=require(_0xccf1('0xa'));var crypto=require(_0xccf1('0xb'));var jsforce=require(_0xccf1('0xc'));var deskjs=require(_0xccf1('0xd'));var toCsv=require(_0xccf1('0x7'));var querystring=require(_0xccf1('0xe'));var Papa=require(_0xccf1('0xf'));var Redis=require(_0xccf1('0x10'));var qs=require(_0xccf1('0x11'));var logger=require(_0xccf1('0x12'))(_0xccf1('0x13'));var utils=require(_0xccf1('0x14'));var config=require(_0xccf1('0x15'));var db=require(_0xccf1('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xccf1('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xdf5ed4,_0x1bbfb0,_0x3789c2,_0x3da424){return new BPromise(function(_0x568b81,_0x592a7e){var _0x41b3e4=_0x3da424||client;return _0x41b3e4[_0xccf1('0x18')](_0xdf5ed4,_0x3789c2)[_0xccf1('0x19')](function(_0x44b68a){logger[_0xccf1('0x1a')]('Network,\x20%s,\x20%s',_0x1bbfb0,_0xccf1('0x1b'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x1bbfb0,_0xccf1('0x1b'),JSON[_0xccf1('0x1c')](_0x44b68a));if(_0x44b68a[_0xccf1('0x1d')]){if(_0x44b68a[_0xccf1('0x1d')][_0xccf1('0x1e')]===0x1f4){logger[_0xccf1('0x1d')](_0xccf1('0x1f'),_0x1bbfb0,_0x44b68a['error'][_0xccf1('0x20')]);return _0x592a7e(_0x44b68a['error'][_0xccf1('0x20')]);}logger['error'](_0xccf1('0x1f'),_0x1bbfb0,_0x44b68a[_0xccf1('0x1d')]['message']);return _0x568b81(_0x44b68a[_0xccf1('0x1d')][_0xccf1('0x20')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x1bbfb0,'request\x20sent');_0x568b81(_0x44b68a[_0xccf1('0x21')][_0xccf1('0x20')]);}})['catch'](function(_0x4d4666){logger[_0xccf1('0x1d')](_0xccf1('0x1f'),_0x1bbfb0,_0x4d4666);_0x592a7e(_0x4d4666);});});}function respondWithStatusCode(_0x43d622,_0xe8c94){_0xe8c94=_0xe8c94||0xcc;return function(_0x1ad23c){if(_0x1ad23c){return _0x43d622[_0xccf1('0x22')](_0xe8c94);}return _0x43d622[_0xccf1('0x23')](_0xe8c94)[_0xccf1('0x24')]();};}function respondWithResult(_0x75b9f6,_0x4a4de5){_0x4a4de5=_0x4a4de5||0xc8;return function(_0x2702a2){if(_0x2702a2){return _0x75b9f6[_0xccf1('0x23')](_0x4a4de5)[_0xccf1('0x25')](_0x2702a2);}};}function respondWithFilteredResult(_0x2c9e07,_0x17f5a9){return function(_0x13827d){if(_0x13827d){var _0x3d1011=_0x13827d[_0xccf1('0x26')],_0x29f095=_0x17f5a9[_0xccf1('0x27')],_0x34799e=_0x17f5a9[_0xccf1('0x27')]+_0x17f5a9['limit'],_0xec56ce;if(_0x34799e>=_0x3d1011){_0x34799e=_0x3d1011;_0xec56ce=0xc8;}else{_0xec56ce=0xce;}_0x2c9e07[_0xccf1('0x23')](_0xec56ce);return _0x2c9e07[_0xccf1('0x28')](_0xccf1('0x29'),_0x29f095+'-'+_0x34799e+'/'+_0x3d1011)[_0xccf1('0x25')](_0x13827d);}return null;};}function patchUpdates(_0x5a83b8){return function(_0x2b069f){try{jsonpatch[_0xccf1('0x2a')](_0x2b069f,_0x5a83b8,!![]);}catch(_0x39f66a){return BPromise[_0xccf1('0x2b')](_0x39f66a);}return _0x2b069f[_0xccf1('0x2c')]();};}function saveUpdates(_0x1fc293,_0xc5cb28){return function(_0x3bafc5){if(_0x3bafc5){return _0x3bafc5[_0xccf1('0x2d')](_0x1fc293)['then'](function(_0x1082b5){return _0x1082b5;});}return null;};}function removeEntity(_0x71e3d8,_0x47034f){return function(_0x46b513){if(_0x46b513){return _0x46b513[_0xccf1('0x2e')]()['then'](function(){_0x71e3d8[_0xccf1('0x23')](0xcc)[_0xccf1('0x24')]();});}};}function handleEntityNotFound(_0x27bd37,_0x236dc8){return function(_0x3c0526){if(!_0x3c0526){_0x27bd37['sendStatus'](0x194);}return _0x3c0526;};}function handleError(_0x5dd1df,_0x22c20d){_0x22c20d=_0x22c20d||0x1f4;return function(_0x3dc8a9){logger[_0xccf1('0x1d')](_0x3dc8a9[_0xccf1('0x2f')]);if(_0x3dc8a9['name']){delete _0x3dc8a9[_0xccf1('0x30')];}_0x5dd1df[_0xccf1('0x23')](_0x22c20d)[_0xccf1('0x31')](_0x3dc8a9);};}exports[_0xccf1('0x32')]=function(_0x1ba5e9,_0x23513f){var _0x31436a={},_0x5c1848={},_0x23e912={'count':0x0,'rows':[]};var _0xf664ab=db[_0xccf1('0x33')][_0xccf1('0x34')];_0x5c1848[_0xccf1('0x35')]=_[_0xccf1('0x36')](_0xf664ab);var _0x269737={'dateStart':_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x38')],'dateEnd':_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x39')]};delete _0x1ba5e9[_0xccf1('0x37')]['dateStart'];delete _0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x39')];_0x5c1848['query']=_[_0xccf1('0x36')](_0x1ba5e9[_0xccf1('0x37')]);_0x5c1848[_0xccf1('0x3a')]=_[_0xccf1('0x3b')](_0x5c1848[_0xccf1('0x35')],_0x5c1848[_0xccf1('0x37')]);_0x31436a[_0xccf1('0x3c')]=_[_0xccf1('0x3b')](_0x5c1848[_0xccf1('0x35')],qs[_0xccf1('0x3d')](_0x1ba5e9['query'][_0xccf1('0x3d')]));_0x31436a['attributes']=_0x31436a['attributes'][_0xccf1('0x3e')]?_0x31436a[_0xccf1('0x3c')]:_0x5c1848['model'];if(!_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x3f')]('nolimit')){_0x31436a['limit']=qs[_0xccf1('0x40')](_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x40')]);_0x31436a[_0xccf1('0x27')]=qs[_0xccf1('0x27')](_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x27')]);}_0x31436a[_0xccf1('0x41')]=qs['sort'](_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x42')]);_0x31436a[_0xccf1('0x43')]=qs[_0xccf1('0x3a')](_['pick'](_0x1ba5e9[_0xccf1('0x37')],_0x5c1848[_0xccf1('0x3a')]));if(_0x269737[_0xccf1('0x38')]){if(_0x269737['dateEnd']){_0x269737['dateEnd']=moment(_0x269737[_0xccf1('0x39')])[_0xccf1('0x44')](0x1,'day');}else{_0x269737[_0xccf1('0x39')]=moment(_0x269737['dateStart'])[_0xccf1('0x44')](0x1,_0xccf1('0x45'));}_[_0xccf1('0x46')](_0x31436a[_0xccf1('0x43')],{'createdAt':{'$gte':_0x269737[_0xccf1('0x38')],'$lte':_0x269737[_0xccf1('0x39')]}});}if(_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x47')]){_0x31436a[_0xccf1('0x43')]=_[_0xccf1('0x46')](_0x31436a[_0xccf1('0x43')],{'$or':_[_0xccf1('0x48')](_0xf664ab,function(_0x3f38a3){if(_0x3f38a3['type'][_0xccf1('0x49')]!==_0xccf1('0x4a')){var _0x360a9e={};_0x360a9e[_0x3f38a3[_0xccf1('0x4b')]]={'$like':'%'+_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x47')]+'%'};return _0x360a9e;}})});}_0x31436a=_[_0xccf1('0x46')]({},_0x31436a,_0x1ba5e9[_0xccf1('0x4c')]);var _0xef0944={'where':_0x31436a[_0xccf1('0x43')]};return db['Network'][_0xccf1('0x26')](_0xef0944)[_0xccf1('0x19')](function(_0x2d14f1){_0x23e912[_0xccf1('0x26')]=_0x2d14f1;if(_0x1ba5e9[_0xccf1('0x37')][_0xccf1('0x4d')]){_0x31436a['include']=[{'all':!![]}];}return db['Network'][_0xccf1('0x4e')](_0x31436a);})[_0xccf1('0x19')](function(_0x4955a2){_0x23e912['rows']=_0x4955a2;return _0x23e912;})[_0xccf1('0x19')](respondWithFilteredResult(_0x23513f,_0x31436a))[_0xccf1('0x4f')](handleError(_0x23513f,null));};exports[_0xccf1('0x50')]=function(_0x1fb7dc,_0x11ef95){var _0x1a7d83={'raw':!![],'where':{'id':_0x1fb7dc['params']['id']}},_0x4dc6cd={};_0x4dc6cd[_0xccf1('0x35')]=_[_0xccf1('0x36')](db['Network'][_0xccf1('0x34')]);_0x4dc6cd[_0xccf1('0x37')]=_[_0xccf1('0x36')](_0x1fb7dc['query']);_0x4dc6cd[_0xccf1('0x3a')]=_['intersection'](_0x4dc6cd['model'],_0x4dc6cd[_0xccf1('0x37')]);_0x1a7d83[_0xccf1('0x3c')]=_[_0xccf1('0x3b')](_0x4dc6cd[_0xccf1('0x35')],qs[_0xccf1('0x3d')](_0x1fb7dc[_0xccf1('0x37')]['fields']));_0x1a7d83[_0xccf1('0x3c')]=_0x1a7d83[_0xccf1('0x3c')][_0xccf1('0x3e')]?_0x1a7d83['attributes']:_0x4dc6cd[_0xccf1('0x35')];if(_0x1fb7dc[_0xccf1('0x37')][_0xccf1('0x4d')]){_0x1a7d83[_0xccf1('0x51')]=[{'all':!![]}];}_0x1a7d83=_['merge']({},_0x1a7d83,_0x1fb7dc[_0xccf1('0x4c')]);return db[_0xccf1('0x33')][_0xccf1('0x52')](_0x1a7d83)[_0xccf1('0x19')](handleEntityNotFound(_0x11ef95,null))['then'](respondWithResult(_0x11ef95,null))['catch'](handleError(_0x11ef95,null));};exports[_0xccf1('0x53')]=function(_0x2306d0,_0x2b9bbf,_0x474238){var _0x4255d8;return db[_0xccf1('0x54')]['transaction'](function(_0x360c2c){return db[_0xccf1('0x33')][_0xccf1('0x53')](_0x2306d0['body'],{'raw':!![]})[_0xccf1('0x19')](function(_0x5da043){_0x4255d8=_0x5da043;return db[_0xccf1('0x33')][_0xccf1('0x4e')]({'where':{'type':_0x2306d0[_0xccf1('0x55')][_0xccf1('0x56')]},'raw':!![]});})[_0xccf1('0x19')](function(_0x4f2035){var _0x5a56ad=fs['readFileSync'](path['join'](config['root'],_0xccf1('0x57')),'utf8');var _0xcebd0a=ejs[_0xccf1('0x58')](_0x5a56ad,{'networks':_0x4f2035||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x2306d0['body'][_0xccf1('0x56')]['toLowerCase']()),_0xcebd0a);})[_0xccf1('0x19')](function(){return respondWithRpcPromise(_0xccf1('0x59'),_0xccf1('0x53'),{'module':_0xccf1('0x5a')});})[_0xccf1('0x19')](function(){return _0x4255d8;});})['then'](respondWithResult(_0x2b9bbf,0xc9))[_0xccf1('0x4f')](handleError(_0x2b9bbf,null));};exports['update']=function(_0x2e38f5,_0x3e38b9,_0x46cb0e){var _0x18631d;return db[_0xccf1('0x54')]['transaction'](function(_0x44da74){return db[_0xccf1('0x33')][_0xccf1('0x52')]({'where':{'id':_0x2e38f5[_0xccf1('0x5b')]['id']}})[_0xccf1('0x19')](handleEntityNotFound(_0x3e38b9,null))['then'](saveUpdates(_0x2e38f5[_0xccf1('0x55')],null))[_0xccf1('0x19')](function(_0x400e52){if(_0x400e52){_0x18631d=_0x400e52;return db['Network'][_0xccf1('0x4e')]({'where':{'type':_0x18631d[_0xccf1('0x56')]},'raw':!![]});}return null;})['then'](function(_0x4a5f22){if(_0x4a5f22){var _0x443fe0=fs[_0xccf1('0x5c')](path[_0xccf1('0x5d')](config[_0xccf1('0x5e')],_0xccf1('0x57')),_0xccf1('0x5f'));var _0x3f6f06=ejs[_0xccf1('0x58')](_0x443fe0,{'networks':_0x4a5f22||[]});fs[_0xccf1('0x60')](util[_0xccf1('0x61')](_0xccf1('0x62'),_0x18631d[_0xccf1('0x56')][_0xccf1('0x63')]()),_0x3f6f06);return respondWithRpcPromise('Reload',_0xccf1('0x2d'),{'module':_0xccf1('0x5a')});}return null;})[_0xccf1('0x19')](function(_0x47cd9a){if(_0x47cd9a){return _0x18631d;}return null;});})[_0xccf1('0x19')](respondWithResult(_0x3e38b9,null))[_0xccf1('0x4f')](handleError(_0x3e38b9,null));};exports[_0xccf1('0x2e')]=function(_0x2ae648,_0x286476,_0x5203d0){var _0x4f9760;return db[_0xccf1('0x33')]['find']({'where':{'id':_0x2ae648['params']['id']}})[_0xccf1('0x19')](function(_0x2ad500){_0x4f9760=_0x2ad500;return _0x2ad500;})[_0xccf1('0x19')](handleEntityNotFound(_0x286476,null))[_0xccf1('0x19')](removeEntity(_0x286476,null))['then'](function(){if(_0x4f9760){return db[_0xccf1('0x33')]['findAll']({'where':{'type':_0x4f9760[_0xccf1('0x56')]},'raw':!![]});}})['then'](function(_0x300437){if(_0x300437){var _0x4e3b06=fs['readFileSync'](path['join'](config[_0xccf1('0x5e')],'server/files/templates/network.ejs'),'utf8');var _0x237874=ejs[_0xccf1('0x58')](_0x4e3b06,{'networks':_0x300437||[]});fs[_0xccf1('0x60')](util[_0xccf1('0x61')](_0xccf1('0x62'),_0x4f9760['type'][_0xccf1('0x63')]()),_0x237874);return respondWithRpcPromise(_0xccf1('0x59'),_0xccf1('0x2e'),{'module':_0xccf1('0x5a')});}})[_0xccf1('0x4f')](handleError(_0x286476,null));};
\ No newline at end of file
+var _0xb717=['reject','save','update','destroy','stack','name','send','index','Network','rawAttributes','model','keys','query','dateEnd','dateStart','filters','intersection','attributes','fields','length','nolimit','order','sort','where','add','day','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','find','create','transaction','body','readFileSync','join','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','sequelize','server/files/templates/network.ejs','root','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit'];(function(_0x35c561,_0x1ade37){var _0x3c3f89=function(_0x26c733){while(--_0x26c733){_0x35c561['push'](_0x35c561['shift']());}};_0x3c3f89(++_0x1ade37);}(_0xb717,0x1b4));var _0x7b71=function(_0x34717d,_0x455ffa){_0x34717d=_0x34717d-0x0;var _0x533169=_0xb717[_0x34717d];return _0x533169;};'use strict';var pdf=require(_0x7b71('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b71('0x2'));var rp=require(_0x7b71('0x3'));var moment=require(_0x7b71('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7b71('0x5'));var util=require(_0x7b71('0x6'));var path=require(_0x7b71('0x7'));var sox=require(_0x7b71('0x8'));var csv=require(_0x7b71('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7b71('0xa'));var squel=require(_0x7b71('0xb'));var crypto=require(_0x7b71('0xc'));var jsforce=require(_0x7b71('0xd'));var deskjs=require(_0x7b71('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b71('0xf'));var Papa=require(_0x7b71('0x10'));var Redis=require('ioredis');var qs=require(_0x7b71('0x11'));var logger=require(_0x7b71('0x12'))(_0x7b71('0x13'));var utils=require('../../config/utils');var config=require(_0x7b71('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7b71('0x15'));var client=jayson['client'][_0x7b71('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x6f4e0,_0x291ba5,_0x101181,_0x45c890){return new BPromise(function(_0x5681fb,_0x453d50){var _0x481d32=_0x45c890||client;return _0x481d32[_0x7b71('0x17')](_0x6f4e0,_0x101181)[_0x7b71('0x18')](function(_0x4f1f41){logger[_0x7b71('0x19')](_0x7b71('0x1a'),_0x291ba5,_0x7b71('0x1b'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x291ba5,_0x7b71('0x1b'),JSON[_0x7b71('0x1c')](_0x4f1f41));if(_0x4f1f41[_0x7b71('0x1d')]){if(_0x4f1f41[_0x7b71('0x1d')]['code']===0x1f4){logger[_0x7b71('0x1d')]('Network,\x20%s,\x20%s',_0x291ba5,_0x4f1f41['error'][_0x7b71('0x1e')]);return _0x453d50(_0x4f1f41[_0x7b71('0x1d')][_0x7b71('0x1e')]);}logger[_0x7b71('0x1d')](_0x7b71('0x1a'),_0x291ba5,_0x4f1f41['error'][_0x7b71('0x1e')]);return _0x5681fb(_0x4f1f41[_0x7b71('0x1d')][_0x7b71('0x1e')]);}else{logger[_0x7b71('0x19')](_0x7b71('0x1a'),_0x291ba5,_0x7b71('0x1b'));_0x5681fb(_0x4f1f41['result'][_0x7b71('0x1e')]);}})[_0x7b71('0x1f')](function(_0x204c69){logger[_0x7b71('0x1d')]('Network,\x20%s,\x20%s',_0x291ba5,_0x204c69);_0x453d50(_0x204c69);});});}function respondWithStatusCode(_0x55ed9c,_0x2d7fa1){_0x2d7fa1=_0x2d7fa1||0xcc;return function(_0xbd752b){if(_0xbd752b){return _0x55ed9c[_0x7b71('0x20')](_0x2d7fa1);}return _0x55ed9c[_0x7b71('0x21')](_0x2d7fa1)[_0x7b71('0x22')]();};}function respondWithResult(_0x478dd8,_0x2b824d){_0x2b824d=_0x2b824d||0xc8;return function(_0x58591c){if(_0x58591c){return _0x478dd8[_0x7b71('0x21')](_0x2b824d)[_0x7b71('0x23')](_0x58591c);}};}function respondWithFilteredResult(_0x19a6f5,_0x292430){return function(_0x49ce76){if(_0x49ce76){var _0x5e297f=_0x49ce76[_0x7b71('0x24')],_0x103774=_0x292430[_0x7b71('0x25')],_0x28841d=_0x292430[_0x7b71('0x25')]+_0x292430[_0x7b71('0x26')],_0x598102;if(_0x28841d>=_0x5e297f){_0x28841d=_0x5e297f;_0x598102=0xc8;}else{_0x598102=0xce;}_0x19a6f5[_0x7b71('0x21')](_0x598102);return _0x19a6f5['set']('Content-Range',_0x103774+'-'+_0x28841d+'/'+_0x5e297f)[_0x7b71('0x23')](_0x49ce76);}return null;};}function patchUpdates(_0x57c86c){return function(_0x360d4c){try{jsonpatch['apply'](_0x360d4c,_0x57c86c,!![]);}catch(_0x18cc43){return BPromise[_0x7b71('0x27')](_0x18cc43);}return _0x360d4c[_0x7b71('0x28')]();};}function saveUpdates(_0x5539b3,_0x1e4e89){return function(_0xc29e2b){if(_0xc29e2b){return _0xc29e2b[_0x7b71('0x29')](_0x5539b3)['then'](function(_0x5e11e1){return _0x5e11e1;});}return null;};}function removeEntity(_0xd100d4,_0x14ff72){return function(_0x45c62d){if(_0x45c62d){return _0x45c62d[_0x7b71('0x2a')]()[_0x7b71('0x18')](function(){_0xd100d4[_0x7b71('0x21')](0xcc)[_0x7b71('0x22')]();});}};}function handleEntityNotFound(_0x548fe4,_0x4284e7){return function(_0x154d25){if(!_0x154d25){_0x548fe4[_0x7b71('0x20')](0x194);}return _0x154d25;};}function handleError(_0x57e8ce,_0x1d0d75){_0x1d0d75=_0x1d0d75||0x1f4;return function(_0x2e0291){logger[_0x7b71('0x1d')](_0x2e0291[_0x7b71('0x2b')]);if(_0x2e0291[_0x7b71('0x2c')]){delete _0x2e0291[_0x7b71('0x2c')];}_0x57e8ce['status'](_0x1d0d75)[_0x7b71('0x2d')](_0x2e0291);};}exports[_0x7b71('0x2e')]=function(_0x15b2e3,_0x3d4b6b){var _0x9c57fc={},_0x56593c={},_0x32bcbd={'count':0x0,'rows':[]};var _0x31e0d1=db[_0x7b71('0x2f')][_0x7b71('0x30')];_0x56593c[_0x7b71('0x31')]=_[_0x7b71('0x32')](_0x31e0d1);var _0x39ebab={'dateStart':_0x15b2e3[_0x7b71('0x33')]['dateStart'],'dateEnd':_0x15b2e3[_0x7b71('0x33')][_0x7b71('0x34')]};delete _0x15b2e3[_0x7b71('0x33')][_0x7b71('0x35')];delete _0x15b2e3[_0x7b71('0x33')][_0x7b71('0x34')];_0x56593c[_0x7b71('0x33')]=_['keys'](_0x15b2e3[_0x7b71('0x33')]);_0x56593c[_0x7b71('0x36')]=_[_0x7b71('0x37')](_0x56593c[_0x7b71('0x31')],_0x56593c['query']);_0x9c57fc[_0x7b71('0x38')]=_[_0x7b71('0x37')](_0x56593c[_0x7b71('0x31')],qs[_0x7b71('0x39')](_0x15b2e3[_0x7b71('0x33')][_0x7b71('0x39')]));_0x9c57fc[_0x7b71('0x38')]=_0x9c57fc[_0x7b71('0x38')][_0x7b71('0x3a')]?_0x9c57fc[_0x7b71('0x38')]:_0x56593c[_0x7b71('0x31')];if(!_0x15b2e3[_0x7b71('0x33')]['hasOwnProperty'](_0x7b71('0x3b'))){_0x9c57fc[_0x7b71('0x26')]=qs['limit'](_0x15b2e3[_0x7b71('0x33')][_0x7b71('0x26')]);_0x9c57fc[_0x7b71('0x25')]=qs[_0x7b71('0x25')](_0x15b2e3[_0x7b71('0x33')]['offset']);}_0x9c57fc[_0x7b71('0x3c')]=qs[_0x7b71('0x3d')](_0x15b2e3[_0x7b71('0x33')][_0x7b71('0x3d')]);_0x9c57fc[_0x7b71('0x3e')]=qs['filters'](_['pick'](_0x15b2e3[_0x7b71('0x33')],_0x56593c['filters']));if(_0x39ebab[_0x7b71('0x35')]){if(_0x39ebab[_0x7b71('0x34')]){_0x39ebab[_0x7b71('0x34')]=moment(_0x39ebab[_0x7b71('0x34')])[_0x7b71('0x3f')](0x1,_0x7b71('0x40'));}else{_0x39ebab[_0x7b71('0x34')]=moment(_0x39ebab['dateStart'])[_0x7b71('0x3f')](0x1,_0x7b71('0x40'));}_['merge'](_0x9c57fc[_0x7b71('0x3e')],{'createdAt':{'$gte':_0x39ebab[_0x7b71('0x35')],'$lte':_0x39ebab[_0x7b71('0x34')]}});}if(_0x15b2e3[_0x7b71('0x33')][_0x7b71('0x41')]){_0x9c57fc[_0x7b71('0x3e')]=_[_0x7b71('0x42')](_0x9c57fc[_0x7b71('0x3e')],{'$or':_[_0x7b71('0x43')](_0x31e0d1,function(_0x4412ca){if(_0x4412ca[_0x7b71('0x44')][_0x7b71('0x45')]!==_0x7b71('0x46')){var _0x4a9167={};_0x4a9167[_0x4412ca[_0x7b71('0x47')]]={'$like':'%'+_0x15b2e3[_0x7b71('0x33')]['filter']+'%'};return _0x4a9167;}})});}_0x9c57fc=_['merge']({},_0x9c57fc,_0x15b2e3['options']);var _0x1c9b76={'where':_0x9c57fc[_0x7b71('0x3e')]};return db[_0x7b71('0x2f')]['count'](_0x1c9b76)[_0x7b71('0x18')](function(_0x3f6ae9){_0x32bcbd['count']=_0x3f6ae9;if(_0x15b2e3[_0x7b71('0x33')][_0x7b71('0x48')]){_0x9c57fc[_0x7b71('0x49')]=[{'all':!![]}];}return db['Network'][_0x7b71('0x4a')](_0x9c57fc);})[_0x7b71('0x18')](function(_0x945c68){_0x32bcbd[_0x7b71('0x4b')]=_0x945c68;return _0x32bcbd;})[_0x7b71('0x18')](respondWithFilteredResult(_0x3d4b6b,_0x9c57fc))[_0x7b71('0x1f')](handleError(_0x3d4b6b,null));};exports[_0x7b71('0x4c')]=function(_0x30e8d8,_0xdb438){var _0x32bf02={'raw':!![],'where':{'id':_0x30e8d8[_0x7b71('0x4d')]['id']}},_0x35b792={};_0x35b792['model']=_[_0x7b71('0x32')](db['Network'][_0x7b71('0x30')]);_0x35b792[_0x7b71('0x33')]=_[_0x7b71('0x32')](_0x30e8d8[_0x7b71('0x33')]);_0x35b792[_0x7b71('0x36')]=_[_0x7b71('0x37')](_0x35b792['model'],_0x35b792[_0x7b71('0x33')]);_0x32bf02['attributes']=_['intersection'](_0x35b792[_0x7b71('0x31')],qs['fields'](_0x30e8d8[_0x7b71('0x33')][_0x7b71('0x39')]));_0x32bf02[_0x7b71('0x38')]=_0x32bf02[_0x7b71('0x38')][_0x7b71('0x3a')]?_0x32bf02[_0x7b71('0x38')]:_0x35b792[_0x7b71('0x31')];if(_0x30e8d8[_0x7b71('0x33')][_0x7b71('0x48')]){_0x32bf02[_0x7b71('0x49')]=[{'all':!![]}];}_0x32bf02=_[_0x7b71('0x42')]({},_0x32bf02,_0x30e8d8['options']);return db['Network'][_0x7b71('0x4e')](_0x32bf02)['then'](handleEntityNotFound(_0xdb438,null))[_0x7b71('0x18')](respondWithResult(_0xdb438,null))[_0x7b71('0x1f')](handleError(_0xdb438,null));};exports[_0x7b71('0x4f')]=function(_0x581adb,_0x5554c9,_0x5eacbb){var _0x3c7e78;return db['sequelize'][_0x7b71('0x50')](function(_0x1af6a2){return db['Network'][_0x7b71('0x4f')](_0x581adb['body'],{'raw':!![]})[_0x7b71('0x18')](function(_0x5cab91){_0x3c7e78=_0x5cab91;return db[_0x7b71('0x2f')]['findAll']({'where':{'type':_0x581adb[_0x7b71('0x51')]['type']},'raw':!![]});})[_0x7b71('0x18')](function(_0x53e33a){var _0x41ebfa=fs[_0x7b71('0x52')](path[_0x7b71('0x53')](config['root'],'server/files/templates/network.ejs'),_0x7b71('0x54'));var _0x29bfa5=ejs[_0x7b71('0x55')](_0x41ebfa,{'networks':_0x53e33a||[]});fs[_0x7b71('0x56')](util[_0x7b71('0x57')](_0x7b71('0x58'),_0x581adb['body'][_0x7b71('0x44')][_0x7b71('0x59')]()),_0x29bfa5);})['then'](function(){return respondWithRpcPromise(_0x7b71('0x5a'),'create',{'module':_0x7b71('0x5b')});})[_0x7b71('0x18')](function(){return _0x3c7e78;});})[_0x7b71('0x18')](respondWithResult(_0x5554c9,0xc9))[_0x7b71('0x1f')](handleError(_0x5554c9,null));};exports['update']=function(_0x38dbd7,_0x361d38,_0xe95b22){var _0x3588da;return db[_0x7b71('0x5c')][_0x7b71('0x50')](function(_0x44b61a){return db[_0x7b71('0x2f')][_0x7b71('0x4e')]({'where':{'id':_0x38dbd7['params']['id']}})[_0x7b71('0x18')](handleEntityNotFound(_0x361d38,null))[_0x7b71('0x18')](saveUpdates(_0x38dbd7[_0x7b71('0x51')],null))[_0x7b71('0x18')](function(_0x36fd40){if(_0x36fd40){_0x3588da=_0x36fd40;return db[_0x7b71('0x2f')][_0x7b71('0x4a')]({'where':{'type':_0x3588da[_0x7b71('0x44')]},'raw':!![]});}return null;})[_0x7b71('0x18')](function(_0x89bbb1){if(_0x89bbb1){var _0x50fe46=fs[_0x7b71('0x52')](path['join'](config['root'],_0x7b71('0x5d')),_0x7b71('0x54'));var _0x345f61=ejs[_0x7b71('0x55')](_0x50fe46,{'networks':_0x89bbb1||[]});fs[_0x7b71('0x56')](util[_0x7b71('0x57')](_0x7b71('0x58'),_0x3588da[_0x7b71('0x44')][_0x7b71('0x59')]()),_0x345f61);return respondWithRpcPromise('Reload',_0x7b71('0x29'),{'module':_0x7b71('0x5b')});}return null;})[_0x7b71('0x18')](function(_0x487320){if(_0x487320){return _0x3588da;}return null;});})[_0x7b71('0x18')](respondWithResult(_0x361d38,null))[_0x7b71('0x1f')](handleError(_0x361d38,null));};exports[_0x7b71('0x2a')]=function(_0xc372f7,_0x5c9286,_0x4f5028){var _0x143dd9;return db[_0x7b71('0x2f')][_0x7b71('0x4e')]({'where':{'id':_0xc372f7[_0x7b71('0x4d')]['id']}})[_0x7b71('0x18')](function(_0x3a400c){_0x143dd9=_0x3a400c;return _0x3a400c;})[_0x7b71('0x18')](handleEntityNotFound(_0x5c9286,null))[_0x7b71('0x18')](removeEntity(_0x5c9286,null))[_0x7b71('0x18')](function(){if(_0x143dd9){return db['Network'][_0x7b71('0x4a')]({'where':{'type':_0x143dd9[_0x7b71('0x44')]},'raw':!![]});}})[_0x7b71('0x18')](function(_0x244ba3){if(_0x244ba3){var _0x90f3b1=fs[_0x7b71('0x52')](path[_0x7b71('0x53')](config[_0x7b71('0x5e')],'server/files/templates/network.ejs'),_0x7b71('0x54'));var _0x1e983c=ejs['render'](_0x90f3b1,{'networks':_0x244ba3||[]});fs[_0x7b71('0x56')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x143dd9['type'][_0x7b71('0x59')]()),_0x1e983c);return respondWithRpcPromise(_0x7b71('0x5a'),'destroy',{'module':'chan_sip.so'});}})[_0x7b71('0x1f')](handleError(_0x5c9286,null));};
\ No newline at end of file
index 2907b1e..bfb4afb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf700=['util','../../config/logger','api','bluebird','exports','Network','network'];(function(_0x5cde70,_0x5275c5){var _0x559b7c=function(_0x5e54b2){while(--_0x5e54b2){_0x5cde70['push'](_0x5cde70['shift']());}};_0x559b7c(++_0x5275c5);}(_0xf700,0x7e));var _0x0f70=function(_0x5df023,_0x43ebe3){_0x5df023=_0x5df023-0x0;var _0x5bd677=_0xf700[_0x5df023];return _0x5bd677;};'use strict';var _=require('lodash');var util=require(_0x0f70('0x0'));var logger=require(_0x0f70('0x1'))(_0x0f70('0x2'));var moment=require('moment');var BPromise=require(_0x0f70('0x3'));var rp=require('request-promise');var attributes=require('./network.attributes');module[_0x0f70('0x4')]=function(_0x33b821,_0x2fc6e4){return _0x33b821['define'](_0x0f70('0x5'),attributes,{'tableName':_0x0f70('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed25=['define','network','lodash','../../config/logger','api','moment','bluebird','request-promise','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed25,0x1a9));var _0x5ed2=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0xed25[_0x335a62];return _0x249a9a;};'use strict';var _=require(_0x5ed2('0x0'));var util=require('util');var logger=require(_0x5ed2('0x1'))(_0x5ed2('0x2'));var moment=require(_0x5ed2('0x3'));var BPromise=require(_0x5ed2('0x4'));var rp=require(_0x5ed2('0x5'));var attributes=require('./network.attributes');module[_0x5ed2('0x6')]=function(_0x2d66b3,_0x253bd7){return _0x2d66b3[_0x5ed2('0x7')]('Network',attributes,{'tableName':_0x5ed2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2574f2b..a5d1102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7217,0x19e));var _0x7721=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7217[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Network,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x4975,0x86));var _0x5497=function(_0x1124ec,_0x559c35){_0x1124ec=_0x1124ec-0x0;var _0xaefa28=_0x4975[_0x1124ec];return _0xaefa28;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Network,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
index e21d8b8..1bb326e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd845=['/describe','describe','/:id','/:id/canned_answers','/:id/applications','/:id/interactions','post','create','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','/:id/send','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index'];(function(_0x185ad6,_0x1a135f){var _0x5e2b14=function(_0x5c6293){while(--_0x5c6293){_0x185ad6['push'](_0x185ad6['shift']());}};_0x5e2b14(++_0x1a135f);}(_0xd845,0x1c4));var _0x5d84=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xd845[_0x1b5aea];return _0x15cfc6;};'use strict';var multer=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var path=require(_0x5d84('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d84('0x3'));var router=express['Router']();var auth=require(_0x5d84('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5d84('0x5'));var controller=require(_0x5d84('0x6'));router[_0x5d84('0x7')]('/',auth[_0x5d84('0x8')](),controller[_0x5d84('0x9')]);router[_0x5d84('0x7')](_0x5d84('0xa'),auth[_0x5d84('0x8')](),controller[_0x5d84('0xb')]);router[_0x5d84('0x7')](_0x5d84('0xc'),auth[_0x5d84('0x8')](),controller['show']);router['get']('/:id/dispositions',auth[_0x5d84('0x8')](),controller['getDispositions']);router[_0x5d84('0x7')](_0x5d84('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x5d84('0xe'),auth[_0x5d84('0x8')](),controller['getApplications']);router[_0x5d84('0x7')](_0x5d84('0xf'),auth[_0x5d84('0x8')](),controller['getInteractions']);router['get']('/:id/users',auth[_0x5d84('0x8')](),controller['getAgents']);router[_0x5d84('0x10')]('/',auth[_0x5d84('0x8')](),controller[_0x5d84('0x11')]);router[_0x5d84('0x10')](_0x5d84('0x12'),auth[_0x5d84('0x8')](),controller['addDisposition']);router['post'](_0x5d84('0xd'),auth['isAuthenticated'](),controller[_0x5d84('0x13')]);router[_0x5d84('0x10')](_0x5d84('0x14'),controller[_0x5d84('0x15')]);router[_0x5d84('0x10')](_0x5d84('0xe'),auth['isAuthenticated'](),controller[_0x5d84('0x16')]);router[_0x5d84('0x10')](_0x5d84('0x17'),auth[_0x5d84('0x8')](),controller[_0x5d84('0x18')]);router[_0x5d84('0x10')](_0x5d84('0x19'),auth[_0x5d84('0x8')](),controller['send']);router['put'](_0x5d84('0xc'),auth[_0x5d84('0x8')](),controller[_0x5d84('0x1a')]);router['delete'](_0x5d84('0xc'),auth[_0x5d84('0x8')](),controller[_0x5d84('0x1b')]);router['delete'](_0x5d84('0x12'),auth[_0x5d84('0x8')](),controller[_0x5d84('0x1c')]);router[_0x5d84('0x1d')](_0x5d84('0xd'),auth[_0x5d84('0x8')](),controller[_0x5d84('0x1e')]);router[_0x5d84('0x1d')](_0x5d84('0x17'),auth[_0x5d84('0x8')](),controller[_0x5d84('0x1f')]);module[_0x5d84('0x20')]=router;
\ No newline at end of file
+var _0xe833=['isAuthenticated','index','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','/:id/dispositions','addAnswer','addApplications','addAgents','/:id/send','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xe833,0x16e));var _0x3e83=function(_0x392c22,_0x2bb8ab){_0x392c22=_0x392c22-0x0;var _0x5a756b=_0xe833[_0x392c22];return _0x5a756b;};'use strict';var multer=require(_0x3e83('0x0'));var util=require(_0x3e83('0x1'));var path=require('path');var timeout=require(_0x3e83('0x2'));var express=require(_0x3e83('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3e83('0x4'));var config=require(_0x3e83('0x5'));var controller=require(_0x3e83('0x6'));router[_0x3e83('0x7')]('/',auth[_0x3e83('0x8')](),controller[_0x3e83('0x9')]);router[_0x3e83('0x7')]('/describe',auth[_0x3e83('0x8')](),controller[_0x3e83('0xa')]);router[_0x3e83('0x7')]('/:id',auth[_0x3e83('0x8')](),controller[_0x3e83('0xb')]);router[_0x3e83('0x7')]('/:id/dispositions',auth[_0x3e83('0x8')](),controller[_0x3e83('0xc')]);router['get'](_0x3e83('0xd'),auth[_0x3e83('0x8')](),controller[_0x3e83('0xe')]);router['get'](_0x3e83('0xf'),auth[_0x3e83('0x8')](),controller[_0x3e83('0x10')]);router[_0x3e83('0x7')](_0x3e83('0x11'),auth[_0x3e83('0x8')](),controller[_0x3e83('0x12')]);router['get'](_0x3e83('0x13'),auth[_0x3e83('0x8')](),controller[_0x3e83('0x14')]);router[_0x3e83('0x15')]('/',auth[_0x3e83('0x8')](),controller['create']);router['post'](_0x3e83('0x16'),auth[_0x3e83('0x8')](),controller['addDisposition']);router[_0x3e83('0x15')](_0x3e83('0xd'),auth[_0x3e83('0x8')](),controller[_0x3e83('0x17')]);router['post']('/:id/notify',controller['notify']);router['post'](_0x3e83('0xf'),auth['isAuthenticated'](),controller[_0x3e83('0x18')]);router[_0x3e83('0x15')]('/:id/users',auth[_0x3e83('0x8')](),controller[_0x3e83('0x19')]);router[_0x3e83('0x15')](_0x3e83('0x1a'),auth[_0x3e83('0x8')](),controller['send']);router['put'](_0x3e83('0x1b'),auth[_0x3e83('0x8')](),controller[_0x3e83('0x1c')]);router[_0x3e83('0x1d')](_0x3e83('0x1b'),auth[_0x3e83('0x8')](),controller[_0x3e83('0x1e')]);router['delete'](_0x3e83('0x16'),auth['isAuthenticated'](),controller[_0x3e83('0x1f')]);router[_0x3e83('0x1d')](_0x3e83('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x3e83('0x1d')](_0x3e83('0x13'),auth['isAuthenticated'](),controller[_0x3e83('0x20')]);module[_0x3e83('0x21')]=router;
\ No newline at end of file
index f1531f1..7d1956f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['TEXT','BOOLEAN','INTEGER','sequelize','randomstring','STRING','name','generate'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa41a,0x6b));var _0xaa41=function(_0x1a6213,_0x4c6230){_0x1a6213=_0x1a6213-0x0;var _0x18f0b4=_0xa41a[_0x1a6213];return _0x18f0b4;};'use strict';var Sequelize=require(_0xaa41('0x0'));var rs=require(_0xaa41('0x1'));module['exports']={'name':{'type':Sequelize[_0xaa41('0x2')],'unique':_0xaa41('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xaa41('0x2')]},'token':{'type':Sequelize[_0xaa41('0x2')],'defaultValue':function(){return rs[_0xaa41('0x4')]();}},'replyUri':{'type':Sequelize[_0xaa41('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xaa41('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xaa41('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xaa41('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xaa41('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xaa41('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaa41('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaa41('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
+var _0x008c=['BOOLEAN','INTEGER','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x1793e7,_0x4cba8a){var _0x3b5854=function(_0x38a637){while(--_0x38a637){_0x1793e7['push'](_0x1793e7['shift']());}};_0x3b5854(++_0x4cba8a);}(_0x008c,0x188));var _0xc008=function(_0x5d547f,_0x50a029){_0x5d547f=_0x5d547f-0x0;var _0x66efe3=_0x008c[_0x5d547f];return _0x66efe3;};'use strict';var Sequelize=require(_0xc008('0x0'));var rs=require(_0xc008('0x1'));module[_0xc008('0x2')]={'name':{'type':Sequelize[_0xc008('0x3')],'unique':_0xc008('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc008('0x3')],'defaultValue':function(){return rs[_0xc008('0x5')]();}},'replyUri':{'type':Sequelize[_0xc008('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc008('0x6')],'defaultValue':function(){return _0xc008('0x7');}},'notificationSound':{'type':Sequelize[_0xc008('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc008('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc008('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xc008('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc008('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c}};
\ No newline at end of file
index 2e9572c..874cc91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37c5=['VIRTUAL','field','options','includeAll','findAll','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','OpenchannelAccountId','map','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','ValidationError','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','defaults','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','User','CmList','out','OpenchannelMessage','dataValues','Messages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','OpenchannelAccount,\x20%s,\x20%s','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','end','stack','name','send','OpenchannelAccount','rawAttributes','model','keys','query','dateEnd','dateStart','intersection','attributes','fields','length','order','sort','filters','pick','add','day','where','filter','merge','type'];(function(_0x38fbda,_0x28c441){var _0x4402f3=function(_0x433b88){while(--_0x433b88){_0x38fbda['push'](_0x38fbda['shift']());}};_0x4402f3(++_0x28c441);}(_0x37c5,0x1ec));var _0x537c=function(_0x35ac99,_0x314ff4){_0x35ac99=_0x35ac99-0x0;var _0x22b115=_0x37c5[_0x35ac99];return _0x22b115;};'use strict';var pdf=require(_0x537c('0x0'));var emlformat=require(_0x537c('0x1'));var rimraf=require(_0x537c('0x2'));var zipdir=require(_0x537c('0x3'));var jsonpatch=require(_0x537c('0x4'));var rp=require(_0x537c('0x5'));var moment=require(_0x537c('0x6'));var BPromise=require(_0x537c('0x7'));var Mustache=require('mustache');var util=require(_0x537c('0x8'));var path=require(_0x537c('0x9'));var sox=require('sox');var csv=require(_0x537c('0xa'));var ejs=require(_0x537c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x537c('0xc'));var crypto=require(_0x537c('0xd'));var jsforce=require(_0x537c('0xe'));var deskjs=require(_0x537c('0xf'));var toCsv=require(_0x537c('0xa'));var querystring=require(_0x537c('0x10'));var Papa=require(_0x537c('0x11'));var Redis=require(_0x537c('0x12'));var qs=require(_0x537c('0x13'));var logger=require(_0x537c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x537c('0x15'))['db'];config[_0x537c('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x537c('0x17'))(new Redis(config['redis']));require(_0x537c('0x18'))['register'](socket);var jayson=require(_0x537c('0x19'));var client=jayson[_0x537c('0x1a')][_0x537c('0x1b')]({'port':0x232c});var client9002=jayson[_0x537c('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c6c49,_0x323cae,_0xddcee2,_0x8e7feb){return new BPromise(function(_0x2b3652,_0x3bd902){var _0xb95284=_0x8e7feb||client;return _0xb95284[_0x537c('0x1c')](_0x1c6c49,_0xddcee2)[_0x537c('0x1d')](function(_0x810dc5){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x323cae,_0x537c('0x1e'));logger[_0x537c('0x1f')](_0x537c('0x20'),_0x323cae,_0x537c('0x1e'),JSON[_0x537c('0x21')](_0x810dc5));if(_0x810dc5[_0x537c('0x22')]){if(_0x810dc5[_0x537c('0x22')][_0x537c('0x23')]===0x1f4){logger[_0x537c('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x323cae,_0x810dc5[_0x537c('0x22')][_0x537c('0x24')]);return _0x3bd902(_0x810dc5[_0x537c('0x22')][_0x537c('0x24')]);}logger[_0x537c('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x323cae,_0x810dc5[_0x537c('0x22')][_0x537c('0x24')]);return _0x2b3652(_0x810dc5[_0x537c('0x22')]['message']);}else{logger[_0x537c('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x323cae,_0x537c('0x1e'));_0x2b3652(_0x810dc5['result'][_0x537c('0x24')]);}})['catch'](function(_0x1ba8d5){logger['error'](_0x537c('0x26'),_0x323cae,_0x1ba8d5);_0x3bd902(_0x1ba8d5);});});}function respondWithStatusCode(_0xe17925,_0x8a45f5){_0x8a45f5=_0x8a45f5||0xcc;return function(_0x28ce3e){if(_0x28ce3e){return _0xe17925[_0x537c('0x27')](_0x8a45f5);}return _0xe17925[_0x537c('0x28')](_0x8a45f5)['end']();};}function respondWithResult(_0x29af18,_0x2e0b41){_0x2e0b41=_0x2e0b41||0xc8;return function(_0x4bb3ed){if(_0x4bb3ed){return _0x29af18[_0x537c('0x28')](_0x2e0b41)[_0x537c('0x29')](_0x4bb3ed);}};}function respondWithFilteredResult(_0x171bd6,_0x163dda){return function(_0x19a1de){if(_0x19a1de){var _0x2f06fe=_0x19a1de[_0x537c('0x2a')],_0x14af52=_0x163dda[_0x537c('0x2b')],_0x275eff=_0x163dda[_0x537c('0x2b')]+_0x163dda[_0x537c('0x2c')],_0x46ab2d;if(_0x275eff>=_0x2f06fe){_0x275eff=_0x2f06fe;_0x46ab2d=0xc8;}else{_0x46ab2d=0xce;}_0x171bd6[_0x537c('0x28')](_0x46ab2d);return _0x171bd6[_0x537c('0x2d')](_0x537c('0x2e'),_0x14af52+'-'+_0x275eff+'/'+_0x2f06fe)[_0x537c('0x29')](_0x19a1de);}return null;};}function patchUpdates(_0x4907fe){return function(_0x249aaa){try{jsonpatch['apply'](_0x249aaa,_0x4907fe,!![]);}catch(_0x2348a6){return BPromise['reject'](_0x2348a6);}return _0x249aaa[_0x537c('0x2f')]();};}function saveUpdates(_0x46c25d,_0x749538){return function(_0x12baf9){if(_0x12baf9){return _0x12baf9[_0x537c('0x30')](_0x46c25d)[_0x537c('0x1d')](function(_0xad297){return _0xad297;});}return null;};}function removeEntity(_0x195924,_0x5d69ce){return function(_0x368cb7){if(_0x368cb7){return _0x368cb7[_0x537c('0x31')]()[_0x537c('0x1d')](function(){var _0x500bba=_0x368cb7[_0x537c('0x32')]({'plain':!![]});var _0x1b9ce8=_0x537c('0x33');return db[_0x537c('0x34')]['destroy']({'where':{'type':_0x1b9ce8,'resourceId':_0x500bba['id']}})[_0x537c('0x1d')](function(){return _0x368cb7;});})['then'](function(){_0x195924[_0x537c('0x28')](0xcc)[_0x537c('0x35')]();});}};}function handleEntityNotFound(_0xa73fbd,_0x243085){return function(_0x20beb5){if(!_0x20beb5){_0xa73fbd[_0x537c('0x27')](0x194);}return _0x20beb5;};}function handleError(_0x33aed3,_0x567312){_0x567312=_0x567312||0x1f4;return function(_0x4d2795){logger['error'](_0x4d2795[_0x537c('0x36')]);if(_0x4d2795[_0x537c('0x37')]){delete _0x4d2795[_0x537c('0x37')];}_0x33aed3[_0x537c('0x28')](_0x567312)[_0x537c('0x38')](_0x4d2795);};}exports['index']=function(_0x24eabe,_0x35abf7){var _0x4283aa={},_0xf25ff={},_0x53db5c={'count':0x0,'rows':[]};var _0x2f61b6=db[_0x537c('0x39')][_0x537c('0x3a')];_0xf25ff[_0x537c('0x3b')]=_[_0x537c('0x3c')](_0x2f61b6);var _0xe95c8c={'dateStart':_0x24eabe[_0x537c('0x3d')]['dateStart'],'dateEnd':_0x24eabe[_0x537c('0x3d')][_0x537c('0x3e')]};delete _0x24eabe['query'][_0x537c('0x3f')];delete _0x24eabe['query'][_0x537c('0x3e')];_0xf25ff[_0x537c('0x3d')]=_[_0x537c('0x3c')](_0x24eabe[_0x537c('0x3d')]);_0xf25ff['filters']=_[_0x537c('0x40')](_0xf25ff[_0x537c('0x3b')],_0xf25ff['query']);_0x4283aa[_0x537c('0x41')]=_[_0x537c('0x40')](_0xf25ff['model'],qs['fields'](_0x24eabe[_0x537c('0x3d')][_0x537c('0x42')]));_0x4283aa[_0x537c('0x41')]=_0x4283aa[_0x537c('0x41')][_0x537c('0x43')]?_0x4283aa['attributes']:_0xf25ff['model'];if(!_0x24eabe[_0x537c('0x3d')]['hasOwnProperty']('nolimit')){_0x4283aa['limit']=qs['limit'](_0x24eabe[_0x537c('0x3d')][_0x537c('0x2c')]);_0x4283aa[_0x537c('0x2b')]=qs['offset'](_0x24eabe['query'][_0x537c('0x2b')]);}_0x4283aa[_0x537c('0x44')]=qs[_0x537c('0x45')](_0x24eabe[_0x537c('0x3d')][_0x537c('0x45')]);_0x4283aa['where']=qs[_0x537c('0x46')](_[_0x537c('0x47')](_0x24eabe['query'],_0xf25ff['filters']));if(_0xe95c8c[_0x537c('0x3f')]){if(_0xe95c8c[_0x537c('0x3e')]){_0xe95c8c[_0x537c('0x3e')]=moment(_0xe95c8c[_0x537c('0x3e')])[_0x537c('0x48')](0x1,'day');}else{_0xe95c8c[_0x537c('0x3e')]=moment(_0xe95c8c['dateStart'])[_0x537c('0x48')](0x1,_0x537c('0x49'));}_['merge'](_0x4283aa[_0x537c('0x4a')],{'createdAt':{'$gte':_0xe95c8c['dateStart'],'$lte':_0xe95c8c[_0x537c('0x3e')]}});}if(_0x24eabe[_0x537c('0x3d')][_0x537c('0x4b')]){_0x4283aa[_0x537c('0x4a')]=_[_0x537c('0x4c')](_0x4283aa[_0x537c('0x4a')],{'$or':_['map'](_0x2f61b6,function(_0xdf86ed){if(_0xdf86ed[_0x537c('0x4d')]['key']!==_0x537c('0x4e')){var _0x54cb21={};_0x54cb21[_0xdf86ed[_0x537c('0x4f')]]={'$like':'%'+_0x24eabe['query'][_0x537c('0x4b')]+'%'};return _0x54cb21;}})});}_0x4283aa=_[_0x537c('0x4c')]({},_0x4283aa,_0x24eabe[_0x537c('0x50')]);var _0x404556={'where':_0x4283aa[_0x537c('0x4a')]};return db[_0x537c('0x39')][_0x537c('0x2a')](_0x404556)['then'](function(_0x952e17){_0x53db5c['count']=_0x952e17;if(_0x24eabe[_0x537c('0x3d')][_0x537c('0x51')]){_0x4283aa['include']=[{'all':!![]}];}return db[_0x537c('0x39')][_0x537c('0x52')](_0x4283aa);})[_0x537c('0x1d')](function(_0x26477c){_0x53db5c[_0x537c('0x53')]=_0x26477c;return _0x53db5c;})[_0x537c('0x1d')](respondWithFilteredResult(_0x35abf7,_0x4283aa))[_0x537c('0x54')](handleError(_0x35abf7,null));};exports[_0x537c('0x55')]=function(_0x523d30,_0xc6b834){var _0x598a4b={'raw':![],'where':{'id':_0x523d30['params']['id']}},_0x1d02ba={};_0x1d02ba[_0x537c('0x3b')]=_[_0x537c('0x3c')](db[_0x537c('0x39')][_0x537c('0x3a')]);_0x1d02ba[_0x537c('0x3d')]=_['keys'](_0x523d30['query']);_0x1d02ba['filters']=_[_0x537c('0x40')](_0x1d02ba[_0x537c('0x3b')],_0x1d02ba[_0x537c('0x3d')]);_0x598a4b['attributes']=_[_0x537c('0x40')](_0x1d02ba[_0x537c('0x3b')],qs['fields'](_0x523d30[_0x537c('0x3d')][_0x537c('0x42')]));_0x598a4b[_0x537c('0x41')]=_0x598a4b[_0x537c('0x41')]['length']?_0x598a4b[_0x537c('0x41')]:_0x1d02ba[_0x537c('0x3b')];if(_0x523d30[_0x537c('0x3d')]['includeAll']){_0x598a4b['include']=[{'all':!![]}];}_0x598a4b=_[_0x537c('0x4c')]({},_0x598a4b,_0x523d30[_0x537c('0x50')]);return db[_0x537c('0x39')]['find'](_0x598a4b)[_0x537c('0x1d')](handleEntityNotFound(_0xc6b834,null))[_0x537c('0x1d')](respondWithResult(_0xc6b834,null))['catch'](handleError(_0xc6b834,null));};exports[_0x537c('0x56')]=function(_0x419e79,_0x1c952f){return db[_0x537c('0x39')][_0x537c('0x56')](_0x419e79[_0x537c('0x57')],{})[_0x537c('0x1d')](function(_0x570157){var _0x428ae8=_0x419e79[_0x537c('0x58')][_0x537c('0x32')]({'plain':!![]});if(!_0x428ae8)throw new Error(_0x537c('0x59'));if(_0x428ae8[_0x537c('0x5a')]==='user'){var _0x59e9e3=_0x570157[_0x537c('0x32')]({'plain':!![]});var _0x4b2ff0=_0x537c('0x33');return db[_0x537c('0x5b')][_0x537c('0x5c')]({'where':{'name':_0x4b2ff0,'userProfileId':_0x428ae8[_0x537c('0x5d')]},'raw':!![]})['then'](function(_0x27c934){if(_0x27c934&&_0x27c934[_0x537c('0x5e')]===0x0){return db['UserProfileResource']['create']({'name':_0x59e9e3['name'],'resourceId':_0x59e9e3['id'],'type':_0x27c934[_0x537c('0x37')],'sectionId':_0x27c934['id']},{})[_0x537c('0x1d')](function(){return _0x570157;});}else{return _0x570157;}})[_0x537c('0x54')](function(_0x2c85e3){logger['error'](_0x537c('0x5f'),_0x2c85e3);throw _0x2c85e3;});}return _0x570157;})[_0x537c('0x1d')](respondWithResult(_0x1c952f,0xc9))['catch'](handleError(_0x1c952f,null));};exports[_0x537c('0x30')]=function(_0x4a4eb8,_0x26eca8){if(_0x4a4eb8['body']['id']){delete _0x4a4eb8[_0x537c('0x57')]['id'];}return db[_0x537c('0x39')][_0x537c('0x5c')]({'where':{'id':_0x4a4eb8[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x26eca8,null))['then'](saveUpdates(_0x4a4eb8['body'],null))['then'](respondWithResult(_0x26eca8,null))[_0x537c('0x54')](handleError(_0x26eca8,null));};exports[_0x537c('0x31')]=function(_0x57195c,_0x28f631){return db[_0x537c('0x39')][_0x537c('0x5c')]({'where':{'id':_0x57195c[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x28f631,null))[_0x537c('0x1d')](removeEntity(_0x28f631,null))['catch'](handleError(_0x28f631,null));};exports[_0x537c('0x61')]=function(_0x1f789a,_0xb24bbb){return db[_0x537c('0x39')][_0x537c('0x61')]()[_0x537c('0x1d')](respondWithResult(_0xb24bbb,null))[_0x537c('0x54')](handleError(_0xb24bbb,null));};exports[_0x537c('0x62')]=function(_0x14c6e4,_0x424671,_0x41212e){if(_0x14c6e4[_0x537c('0x57')]['id']){delete _0x14c6e4[_0x537c('0x57')]['id'];}return db[_0x537c('0x39')][_0x537c('0x5c')]({'where':{'id':_0x14c6e4[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x424671,null))[_0x537c('0x1d')](function(_0x1a65d0){if(_0x1a65d0){_0x14c6e4[_0x537c('0x57')][_0x537c('0x63')]=_0x1a65d0['id'];return db[_0x537c('0x64')][_0x537c('0x56')](_0x14c6e4[_0x537c('0x57')]);}})['then'](respondWithResult(_0x424671,null))[_0x537c('0x54')](handleError(_0x424671,null));};exports[_0x537c('0x65')]=function(_0xb62bdb,_0x290847,_0x1f57f6){var _0x3df577={'raw':![],'where':{}};var _0x584423={};var _0x22637b={'count':0x0,'rows':[]};return db[_0x537c('0x39')][_0x537c('0x66')]({'where':{'id':_0xb62bdb[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x290847,null))[_0x537c('0x1d')](function(_0x4fa5e2){if(_0x4fa5e2){_0x584423[_0x537c('0x3b')]=_[_0x537c('0x3c')](db[_0x537c('0x64')][_0x537c('0x3a')]);_0x584423['query']=_[_0x537c('0x3c')](_0xb62bdb['query']);_0x584423[_0x537c('0x46')]=_[_0x537c('0x40')](_0x584423[_0x537c('0x3b')],_0x584423[_0x537c('0x3d')]);_0x3df577[_0x537c('0x41')]=_[_0x537c('0x40')](_0x584423[_0x537c('0x3b')],qs['fields'](_0xb62bdb[_0x537c('0x3d')][_0x537c('0x42')]));_0x3df577[_0x537c('0x41')]=_0x3df577['attributes']['length']?_0x3df577[_0x537c('0x41')]:_0x584423[_0x537c('0x3b')];if(!_0xb62bdb[_0x537c('0x3d')][_0x537c('0x67')](_0x537c('0x68'))){_0x3df577[_0x537c('0x2c')]=qs['limit'](_0xb62bdb['query']['limit']);_0x3df577[_0x537c('0x2b')]=qs[_0x537c('0x2b')](_0xb62bdb[_0x537c('0x3d')][_0x537c('0x2b')]);}_0x3df577[_0x537c('0x44')]=qs[_0x537c('0x45')](_0xb62bdb[_0x537c('0x3d')]['sort']);_0x3df577[_0x537c('0x4a')]=qs[_0x537c('0x46')](_['pick'](_0xb62bdb[_0x537c('0x3d')],_0x584423[_0x537c('0x46')]));_0x3df577[_0x537c('0x4a')][_0x537c('0x69')]=_0x4fa5e2['id'];if(_0xb62bdb[_0x537c('0x3d')][_0x537c('0x4b')]){_0x3df577[_0x537c('0x4a')]=_[_0x537c('0x4c')](_0x3df577['where'],{'$or':_[_0x537c('0x6a')](_0x3df577[_0x537c('0x41')],function(_0x3d9334){var _0x2cf509={};_0x2cf509[_0x3d9334]={'$like':'%'+_0xb62bdb[_0x537c('0x3d')][_0x537c('0x4b')]+'%'};return _0x2cf509;})});}_0x3df577=_[_0x537c('0x4c')]({},_0x3df577,_0xb62bdb[_0x537c('0x50')]);return db[_0x537c('0x64')][_0x537c('0x2a')]({'where':_0x3df577[_0x537c('0x4a')]})['then'](function(_0x60f27d){_0x22637b[_0x537c('0x2a')]=_0x60f27d;if(_0xb62bdb[_0x537c('0x3d')][_0x537c('0x51')]){_0x3df577[_0x537c('0x6b')]=[{'all':!![]}];}return db[_0x537c('0x64')][_0x537c('0x52')](_0x3df577);})[_0x537c('0x1d')](function(_0x11628b){_0x22637b['rows']=_0x11628b;return _0x22637b;});}})[_0x537c('0x1d')](respondWithFilteredResult(_0x290847,_0x3df577))[_0x537c('0x54')](handleError(_0x290847,null));};exports[_0x537c('0x6c')]=function(_0x4289ad,_0x1c1178,_0x5d903a){var _0xb7425f;return db[_0x537c('0x39')]['find']({'where':{'id':_0x4289ad[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x1c1178,null))['then'](function(_0x4e24b3){if(_0x4e24b3){return _0x4e24b3[_0x537c('0x6c')](_0x4289ad[_0x537c('0x3d')][_0x537c('0x6d')]);}})['then'](respondWithStatusCode(_0x1c1178,null))[_0x537c('0x54')](handleError(_0x1c1178,null));};exports[_0x537c('0x6e')]=function(_0x8ca7a7,_0x35ad15,_0xe5d3c7){if(_0x8ca7a7['body']['id']){delete _0x8ca7a7[_0x537c('0x57')]['id'];}return db[_0x537c('0x39')]['find']({'where':{'id':_0x8ca7a7[_0x537c('0x60')]['id']}})['then'](handleEntityNotFound(_0x35ad15,null))[_0x537c('0x1d')](function(_0x20afff){if(_0x20afff){_0x8ca7a7['body'][_0x537c('0x69')]=_0x20afff['id'];return db[_0x537c('0x6f')][_0x537c('0x56')](_0x8ca7a7[_0x537c('0x57')]);}})['then'](respondWithResult(_0x35ad15,null))[_0x537c('0x54')](handleError(_0x35ad15,null));};exports[_0x537c('0x70')]=function(_0xc2649d,_0x27e914,_0x33f0cc){var _0xedc500={'raw':![],'where':{}};var _0x4e6b69={};var _0x415157={'count':0x0,'rows':[]};return db[_0x537c('0x39')][_0x537c('0x66')]({'where':{'id':_0xc2649d[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x27e914,null))[_0x537c('0x1d')](function(_0x26a3e5){if(_0x26a3e5){_0x4e6b69['model']=_['keys'](db['CannedAnswer'][_0x537c('0x3a')]);_0x4e6b69[_0x537c('0x3d')]=_[_0x537c('0x3c')](_0xc2649d[_0x537c('0x3d')]);_0x4e6b69[_0x537c('0x46')]=_[_0x537c('0x40')](_0x4e6b69['model'],_0x4e6b69[_0x537c('0x3d')]);_0xedc500[_0x537c('0x41')]=_[_0x537c('0x40')](_0x4e6b69[_0x537c('0x3b')],qs[_0x537c('0x42')](_0xc2649d[_0x537c('0x3d')][_0x537c('0x42')]));_0xedc500[_0x537c('0x41')]=_0xedc500['attributes'][_0x537c('0x43')]?_0xedc500[_0x537c('0x41')]:_0x4e6b69[_0x537c('0x3b')];if(!_0xc2649d[_0x537c('0x3d')][_0x537c('0x67')](_0x537c('0x68'))){_0xedc500['limit']=qs[_0x537c('0x2c')](_0xc2649d['query'][_0x537c('0x2c')]);_0xedc500['offset']=qs['offset'](_0xc2649d[_0x537c('0x3d')]['offset']);}_0xedc500[_0x537c('0x44')]=qs[_0x537c('0x45')](_0xc2649d[_0x537c('0x3d')][_0x537c('0x45')]);_0xedc500[_0x537c('0x4a')]=qs['filters'](_[_0x537c('0x47')](_0xc2649d[_0x537c('0x3d')],_0x4e6b69[_0x537c('0x46')]));_0xedc500['where']['OpenchannelAccountId']=_0x26a3e5['id'];if(_0xc2649d[_0x537c('0x3d')][_0x537c('0x4b')]){_0xedc500['where']=_[_0x537c('0x4c')](_0xedc500[_0x537c('0x4a')],{'$or':_[_0x537c('0x6a')](_0xedc500[_0x537c('0x41')],function(_0x529f18){var _0x25c80f={};_0x25c80f[_0x529f18]={'$like':'%'+_0xc2649d[_0x537c('0x3d')][_0x537c('0x4b')]+'%'};return _0x25c80f;})});}_0xedc500=_['merge']({},_0xedc500,_0xc2649d['options']);return db[_0x537c('0x6f')]['count']({'where':_0xedc500['where']})[_0x537c('0x1d')](function(_0x5e09c2){_0x415157[_0x537c('0x2a')]=_0x5e09c2;if(_0xc2649d[_0x537c('0x3d')][_0x537c('0x51')]){_0xedc500[_0x537c('0x6b')]=[{'all':!![]}];}return db[_0x537c('0x6f')]['findAll'](_0xedc500);})[_0x537c('0x1d')](function(_0x3c73a3){_0x415157[_0x537c('0x53')]=_0x3c73a3;return _0x415157;});}})[_0x537c('0x1d')](respondWithFilteredResult(_0x27e914,_0xedc500))[_0x537c('0x54')](handleError(_0x27e914,null));};exports[_0x537c('0x71')]=function(_0x557bd5,_0x3f197b,_0x4521af){var _0x549449;return db[_0x537c('0x39')]['find']({'where':{'id':_0x557bd5[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x3f197b,null))[_0x537c('0x1d')](function(_0x4aad63){if(_0x4aad63){return _0x4aad63[_0x537c('0x71')](_0x557bd5['query'][_0x537c('0x6d')]);}})[_0x537c('0x1d')](respondWithStatusCode(_0x3f197b,null))[_0x537c('0x54')](handleError(_0x3f197b,null));};exports[_0x537c('0x72')]=function(_0xb85673,_0x1a4022,_0x397ba8){var _0x5c67b2={'body':_0xb85673['body'],'channel':'openchannel'};var _0x323c31=[];var _0x1d46ef=[];var _0x59725b={};var _0x2d898e=![];return db[_0x537c('0x73')]['describe']()[_0x537c('0x1d')](function(_0xb801ef){if(!_0xb801ef){throw new db['Sequelize'][(_0x537c('0x74'))]('no\x20available\x20attributes');}_0x323c31=_['difference'](_['keys'](_0xb801ef),[_0x537c('0x75'),'updatedAt']);_0x1d46ef=_[_0x537c('0x76')](_['keys'](_0xb801ef),[_0x537c('0x75'),_0x537c('0x77'),_0x537c('0x78'),_0x537c('0x79')]);if(_0xb85673['body']['id']){delete _0xb85673['body']['id'];}if(_[_0x537c('0x7a')](_0xb85673[_0x537c('0x57')][_0x537c('0x7b')])){throw new db['Sequelize'][(_0x537c('0x74'))](_0x537c('0x7c'));}if(_['isNil'](_0xb85673[_0x537c('0x57')][_0x537c('0x57')])||_0xb85673[_0x537c('0x57')][_0x537c('0x57')]===''){throw new db[(_0x537c('0x7d'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x537c('0x7a')](_0xb85673[_0x537c('0x57')]['mapKey'])){throw new db['Sequelize'][(_0x537c('0x74'))](_0x537c('0x7e')+_0x1d46ef);}if(!_[_0x537c('0x7f')](_0x1d46ef,_0xb85673[_0x537c('0x57')][_0x537c('0x80')])){throw new db['Sequelize'][(_0x537c('0x74'))](_0x537c('0x81')+_0x1d46ef);}_0x59725b[_0xb85673[_0x537c('0x57')][_0x537c('0x80')]]=_0xb85673['body']['from'];})['then'](function(){return db[_0x537c('0x39')][_0x537c('0x5c')]({'where':{'id':_0xb85673[_0x537c('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x537c('0x82'),'include':[{'model':db[_0x537c('0x73')],'as':_0x537c('0x83'),'where':_0x59725b,'limit':0x1,'order':[['updatedAt',_0x537c('0x84')]]}]},{'model':db[_0x537c('0x85')],'as':'Applications'}]});})[_0x537c('0x1d')](handleEntityNotFound(_0x1a4022,null))[_0x537c('0x1d')](function(_0x37143b){if(_0x37143b&&_0x37143b[_0x537c('0x82')]){_0x5c67b2[_0x537c('0x86')]=_0x37143b;_0x5c67b2[_0x537c('0x87')]=_0x37143b[_0x537c('0x88')];_0x5c67b2[_0x537c('0x89')]=_0x37143b[_0x537c('0x82')];_0x5c67b2[_0x537c('0x87')]=_[_0x537c('0x8a')](_0x5c67b2['applications'],[_0x537c('0x8b')],['asc']);if(_0x5c67b2[_0x537c('0x86')][_0x537c('0x88')]){delete _0x5c67b2['account']['Applications'];}if(_0x5c67b2[_0x537c('0x86')][_0x537c('0x82')]&&_0x5c67b2[_0x537c('0x86')]['List'][_0x537c('0x83')][_0x537c('0x43')]){return _0x5c67b2[_0x537c('0x86')][_0x537c('0x82')][_0x537c('0x83')][0x0];}var _0x4def2c=_[_0x537c('0x8c')](_0xb85673[_0x537c('0x57')],{'firstName':_0xb85673['body'][_0x537c('0x7b')],'ListId':_0x37143b[_0x537c('0x79')]});_0x4def2c[_0xb85673['body'][_0x537c('0x80')]]=_0xb85673[_0x537c('0x57')][_0x537c('0x7b')];return db[_0x537c('0x73')][_0x537c('0x56')](_0x4def2c,{'fields':_0x323c31,'raw':!![]});}})[_0x537c('0x1d')](handleEntityNotFound(_0x1a4022,null))[_0x537c('0x1d')](function(_0x1b4bcc){_0x5c67b2['contact']=_0x1b4bcc;if(_0x1b4bcc){var _0x2f36cd={'ContactId':_0x1b4bcc['id'],'OpenchannelAccountId':_0xb85673[_0x537c('0x60')]['id'],'from':(_0x1b4bcc[_0x537c('0x8d')]||'')+'\x20'+(_0x1b4bcc[_0x537c('0x8e')]||'')};var _0x3c7121={'OpenchannelAccountId':_0xb85673[_0x537c('0x60')]['id'],'closed':![]};if(_0xb85673[_0x537c('0x57')][_0x537c('0x8f')]){_0x3c7121[_0x537c('0x8f')]=_0xb85673['body'][_0x537c('0x8f')];return db['OpenchannelInteraction'][_0x537c('0x5c')]({'where':_0x3c7121})[_0x537c('0x1d')](function(_0x12f7e0){if(_0x12f7e0){return[_0x12f7e0,![]];}_0x2f36cd[_0x537c('0x8f')]=_0xb85673[_0x537c('0x57')][_0x537c('0x8f')];_0x2f36cd[_0x537c('0x90')]=_0xb85673[_0x537c('0x57')][_0x537c('0x90')];return db[_0x537c('0x91')][_0x537c('0x56')](_0x2f36cd)[_0x537c('0x1d')](function(_0xcb8733){return[_0xcb8733,!![]];});});}else{_0x3c7121['threadId']=null;}_0x3c7121[_0x537c('0x92')]=_0x1b4bcc['id'];return db[_0x537c('0x91')][_0x537c('0x5c')]({'where':_0x3c7121})[_0x537c('0x1d')](function(_0xb61990){if(_0xb61990){return[_0xb61990,![]];}return db[_0x537c('0x91')]['create'](_0x2f36cd)[_0x537c('0x1d')](function(_0x33962d){return[_0x33962d,!![]];});});}})[_0x537c('0x93')](function(_0x5e7200,_0x4d6a07){if(_0x5e7200){_0x2d898e=_0x4d6a07;if(!_0x4d6a07){var _0x4af236={'from':(_0x5c67b2[_0x537c('0x94')][_0x537c('0x8d')]||'')+'\x20'+(_0x5c67b2[_0x537c('0x94')]['lastName']||'')};if(_0xb85673['body'][_0x537c('0x8f')]&&_0xb85673[_0x537c('0x57')][_0x537c('0x95')]&&_0xb85673[_0x537c('0x57')][_0x537c('0x8f')]!=_0xb85673[_0x537c('0x57')]['messageId']){_0x4af236['threadId']=_0xb85673[_0x537c('0x57')]['messageId'];}return _0x5e7200['update'](_0x4af236);}else{return _0x5e7200;}}})[_0x537c('0x1d')](function(_0x320d9e){_0x5c67b2['interaction']=_0x320d9e[_0x537c('0x32')]({'plain':!![]});_0x5c67b2[_0x537c('0x96')][_0x537c('0x97')]=_0x2d898e;if(_0x5c67b2[_0x537c('0x96')][_0x537c('0x97')]){if(_0x5c67b2[_0x537c('0x86')][_0x537c('0x98')]){_0x5c67b2[_0x537c('0x87')][_0x537c('0x99')]({'id':0x0,'priority':_0x5c67b2[_0x537c('0x87')]['length']+0x1,'app':'close','appdata':_0x537c('0x9a'),'interval':_0x537c('0x9b')});}}return db['OpenchannelMessage'][_0x537c('0x56')]({'body':_0xb85673['body'][_0x537c('0x57')],'OpenchannelAccountId':_0xb85673[_0x537c('0x60')]['id'],'OpenchannelInteractionId':_0x320d9e['id'],'direction':'in','ContactId':_0x5c67b2[_0x537c('0x94')]['id'],'AttachmentId':_0xb85673[_0x537c('0x57')][_0x537c('0x9c')]});})['then'](function(_0x36bd05){_0x5c67b2[_0x537c('0x24')]=_0x36bd05;if(_0x5c67b2[_0x537c('0x96')][_0x537c('0x9d')]){return db['User'][_0x537c('0x5c')]({'attributes':['id',_0x537c('0x37')],'where':{'id':_0x5c67b2['interaction'][_0x537c('0x9d')]}})['then'](function(_0x112c38){if(_0x112c38){_0x5c67b2[_0x537c('0x87')][_0x537c('0x9e')]({'id':0x0,'priority':0x0,'app':_0x537c('0x9f'),'appdata':_0x112c38[_0x537c('0x37')]+','+(_0x5c67b2[_0x537c('0x86')][_0x537c('0xa0')]||0xa),'interval':_0x537c('0x9b')});_0x5c67b2['forcedOwnership']=![];}return respondWithRpcPromise(_0x537c('0xa1'),_0x537c('0xa2'),_0x5c67b2);});}return respondWithRpcPromise(_0x537c('0xa1'),_0x537c('0xa2'),_0x5c67b2);})[_0x537c('0x1d')](function(_0x3a3b69){respondWithRpcPromise(_0x537c('0xa3'),_0x537c('0xa3'),{'event':_0x537c('0x72'),'message':_0x3a3b69},client9002);return _0x3a3b69;})['then'](respondWithResult(_0x1a4022,null))[_0x537c('0x54')](handleError(_0x1a4022,null));};exports[_0x537c('0xa4')]=function(_0x4697d7,_0x3451ec,_0x24138a){return db[_0x537c('0x39')][_0x537c('0x66')]({'where':{'id':_0x4697d7[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x3451ec,null))[_0x537c('0x1d')](function(_0x4272de){if(_0x4272de){return db['sequelize'][_0x537c('0xa5')](function(_0x5186f1){return db[_0x537c('0x85')][_0x537c('0x31')]({'where':{'OpenchannelAccountId':_0x4697d7['params']['id']},'transaction':_0x5186f1})[_0x537c('0x1d')](function(_0x4be34f){var _0x4f584d=_['map'](_0x4697d7[_0x537c('0x57')],function(_0x2250ed){_0x2250ed[_0x537c('0x69')]=_0x4697d7['params']['id'];return _0x2250ed;});return db[_0x537c('0x85')][_0x537c('0xa6')](_0x4f584d,{'transaction':_0x5186f1});});})[_0x537c('0x1d')](function(){return db[_0x537c('0x85')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4697d7['params']['id']},'order':_0x537c('0x8b')});});}})['then'](respondWithResult(_0x3451ec,null))['catch'](handleError(_0x3451ec,null));};exports[_0x537c('0xa7')]=function(_0x5248bb,_0x22ddcd,_0x3e570f){var _0x15378e={};var _0x3f25cd={};var _0x493536;var _0xf0fac3;return db[_0x537c('0x39')]['findOne']({'where':{'id':_0x5248bb[_0x537c('0x60')]['id']}})['then'](handleEntityNotFound(_0x22ddcd,null))[_0x537c('0x1d')](function(_0x250e84){if(_0x250e84){_0x493536=_0x250e84;_0x3f25cd[_0x537c('0x3b')]=_[_0x537c('0x3c')](db[_0x537c('0x85')][_0x537c('0x3a')]);_0x3f25cd[_0x537c('0x3d')]=_['keys'](_0x5248bb[_0x537c('0x3d')]);_0x3f25cd[_0x537c('0x46')]=_[_0x537c('0x40')](_0x3f25cd[_0x537c('0x3b')],_0x3f25cd['query']);_0x15378e[_0x537c('0x41')]=_[_0x537c('0x40')](_0x3f25cd['model'],qs[_0x537c('0x42')](_0x5248bb[_0x537c('0x3d')][_0x537c('0x42')]));_0x15378e[_0x537c('0x41')]=_0x15378e['attributes'][_0x537c('0x43')]?_0x15378e[_0x537c('0x41')]:_0x3f25cd[_0x537c('0x3b')];_0x15378e['order']=qs[_0x537c('0x45')](_0x5248bb[_0x537c('0x3d')][_0x537c('0x45')]);_0x15378e['where']=qs['filters'](_['pick'](_0x5248bb['query'],_0x3f25cd[_0x537c('0x46')]));if(_0x5248bb[_0x537c('0x3d')][_0x537c('0x4b')]){_0x15378e[_0x537c('0x4a')]=_['merge'](_0x15378e['where'],{'$or':_[_0x537c('0x6a')](_0x15378e[_0x537c('0x41')],function(_0x20bc2d){var _0x4837ab={};_0x4837ab[_0x20bc2d]={'$like':'%'+_0x5248bb['query'][_0x537c('0x4b')]+'%'};return _0x4837ab;})});}_0x15378e=_[_0x537c('0x4c')]({},_0x15378e,_0x5248bb[_0x537c('0x50')]);return _0x493536[_0x537c('0xa7')](_0x15378e);}})['then'](function(_0x83aae3){if(_0x83aae3){_0xf0fac3=_0x83aae3[_0x537c('0x43')];if(!_0x5248bb['query'][_0x537c('0x67')](_0x537c('0x68'))){_0x15378e[_0x537c('0x2c')]=qs['limit'](_0x5248bb[_0x537c('0x3d')][_0x537c('0x2c')]);_0x15378e[_0x537c('0x2b')]=qs[_0x537c('0x2b')](_0x5248bb[_0x537c('0x3d')]['offset']);}return _0x493536[_0x537c('0xa7')](_0x15378e);}})[_0x537c('0x1d')](function(_0x50ff99){if(_0x50ff99){return _0x50ff99?{'count':_0xf0fac3,'rows':_0x50ff99}:null;}})[_0x537c('0x1d')](respondWithResult(_0x22ddcd,null))[_0x537c('0x54')](handleError(_0x22ddcd,null));};exports[_0x537c('0xa8')]=function(_0x3eaa40,_0x1a0955,_0x1a27fd){var _0x2fe50b={'raw':![],'where':{}};var _0x55142e={};var _0x490f2f={'count':0x0,'rows':[]};return db[_0x537c('0x39')][_0x537c('0x66')]({'where':{'id':_0x3eaa40[_0x537c('0x60')]['id']}})['then'](handleEntityNotFound(_0x1a0955,null))['then'](function(_0x55b9a1){if(_0x55b9a1){_0x55142e[_0x537c('0x3b')]=_[_0x537c('0x3c')](db[_0x537c('0x91')][_0x537c('0x3a')]);_0x55142e[_0x537c('0x3d')]=_[_0x537c('0x3c')](_0x3eaa40[_0x537c('0x3d')]);_0x55142e['filters']=_['intersection'](_0x55142e[_0x537c('0x3b')],_0x55142e['query']);_0x2fe50b[_0x537c('0x41')]=_['intersection'](_0x55142e[_0x537c('0x3b')],qs[_0x537c('0x42')](_0x3eaa40[_0x537c('0x3d')]['fields']));_0x2fe50b['attributes']=_0x2fe50b['attributes'][_0x537c('0x43')]?_0x2fe50b[_0x537c('0x41')]:_0x55142e[_0x537c('0x3b')];if(!_0x3eaa40['query'][_0x537c('0x67')]('nolimit')){_0x2fe50b[_0x537c('0x2c')]=qs[_0x537c('0x2c')](_0x3eaa40['query'][_0x537c('0x2c')]);_0x2fe50b[_0x537c('0x2b')]=qs[_0x537c('0x2b')](_0x3eaa40[_0x537c('0x3d')][_0x537c('0x2b')]);}_0x2fe50b[_0x537c('0x44')]=qs['sort'](_0x3eaa40[_0x537c('0x3d')]['sort']);_0x2fe50b[_0x537c('0x4a')]=qs[_0x537c('0x46')](_['pick'](_0x3eaa40[_0x537c('0x3d')],_0x55142e[_0x537c('0x46')]));_0x2fe50b[_0x537c('0x4a')][_0x537c('0x69')]=_0x55b9a1['id'];if(_0x3eaa40[_0x537c('0x3d')][_0x537c('0x4b')]){_0x2fe50b['where']=_['merge'](_0x2fe50b['where'],{'$or':_[_0x537c('0x6a')](_0x2fe50b[_0x537c('0x41')],function(_0x401ca8){var _0x5283ca={};_0x5283ca[_0x401ca8]={'$like':'%'+_0x3eaa40[_0x537c('0x3d')]['filter']+'%'};return _0x5283ca;})});}_0x2fe50b=_[_0x537c('0x4c')]({},_0x2fe50b,_0x3eaa40[_0x537c('0x50')]);return db['OpenchannelInteraction']['count']({'where':_0x2fe50b['where']})['then'](function(_0x228e52){_0x490f2f[_0x537c('0x2a')]=_0x228e52;if(_0x3eaa40[_0x537c('0x3d')][_0x537c('0x51')]){_0x2fe50b['include']=[{'model':db[_0x537c('0x73')],'as':_0x537c('0xa9'),'required':![]},{'model':db['User'],'as':_0x537c('0xaa'),'attributes':['name',_0x537c('0xab'),'internal'],'required':![]},{'model':db[_0x537c('0xac')],'as':_0x537c('0xad'),'attributes':['id',_0x537c('0x37'),_0x537c('0xae')],'where':_0x3eaa40[_0x537c('0x3d')][_0x537c('0xaf')]?{'id':_0x3eaa40[_0x537c('0x3d')][_0x537c('0xaf')]}:undefined,'required':_0x3eaa40[_0x537c('0x3d')][_0x537c('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x537c('0x52')](_0x2fe50b);})['then'](function(_0x147280){_0x490f2f[_0x537c('0x53')]=_0x147280;return _0x490f2f;});}})[_0x537c('0x1d')](respondWithFilteredResult(_0x1a0955,_0x2fe50b))[_0x537c('0x54')](handleError(_0x1a0955,null));};exports[_0x537c('0xb0')]=function(_0x21f322,_0x1c35d9,_0x276c02){return db[_0x537c('0x39')][_0x537c('0x5c')]({'where':{'id':_0x21f322[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x1c35d9,null))[_0x537c('0x1d')](function(_0x310527){if(_0x310527){return _0x310527[_0x537c('0xb0')](_0x21f322[_0x537c('0x57')]['ids'],_[_0x537c('0xb1')](_0x21f322[_0x537c('0x57')],[_0x537c('0x6d'),'id'])||{})[_0x537c('0x93')](function(_0x4e9adf){for(var _0x4bfc12=0x0;_0x4bfc12<_0x21f322[_0x537c('0x57')][_0x537c('0x6d')][_0x537c('0x43')];_0x4bfc12+=0x1){socket[_0x537c('0xb2')](_0x537c('0xb3'),{'UserId':_0x21f322[_0x537c('0x57')][_0x537c('0x6d')][_0x4bfc12],'OpenchannelAccountId':_0x21f322['params']['id']});}return _0x4e9adf;});}})[_0x537c('0x1d')](respondWithResult(_0x1c35d9,null))[_0x537c('0x54')](handleError(_0x1c35d9,null));};exports[_0x537c('0xb4')]=function(_0x527c40,_0x21faf1,_0x318298){var _0x100504;return db[_0x537c('0x39')][_0x537c('0x5c')]({'where':{'id':_0x527c40[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x21faf1,null))[_0x537c('0x1d')](function(_0x2bf8a2){if(_0x2bf8a2){return _0x2bf8a2[_0x537c('0xb4')](_0x527c40[_0x537c('0x3d')][_0x537c('0x6d')])['then'](function(_0x5814a3){if(_[_0x537c('0xb5')](_0x527c40[_0x537c('0x3d')][_0x537c('0x6d')])){for(var _0x17ba08=0x0;_0x17ba08<_0x527c40['query'][_0x537c('0x6d')]['length'];_0x17ba08+=0x1){socket['emit'](_0x537c('0xb6'),{'UserId':_0x527c40[_0x537c('0x3d')][_0x537c('0x6d')][_0x17ba08],'OpenchannelAccountId':_0x527c40[_0x537c('0x60')]['id']});}}else{socket['emit'](_0x537c('0xb6'),{'UserId':_0x527c40[_0x537c('0x3d')][_0x537c('0x6d')],'OpenchannelAccountId':_0x527c40['params']['id']});}});}})[_0x537c('0x1d')](respondWithStatusCode(_0x21faf1,null))['catch'](handleError(_0x21faf1,null));};exports[_0x537c('0xb7')]=function(_0x38b91e,_0x2453c2,_0x29eb93){var _0x598ad4={};var _0x3b0ffd={};var _0x211306;var _0x3bad01;return db[_0x537c('0x39')][_0x537c('0x66')]({'where':{'id':_0x38b91e[_0x537c('0x60')]['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0x2453c2,null))['then'](function(_0x25ceea){if(_0x25ceea){_0x211306=_0x25ceea;_0x3b0ffd['model']=_['keys'](db[_0x537c('0xb8')]['rawAttributes']);_0x3b0ffd['query']=_[_0x537c('0x3c')](_0x38b91e['query']);_0x3b0ffd[_0x537c('0x46')]=_['intersection'](_0x3b0ffd['model'],_0x3b0ffd[_0x537c('0x3d')]);_0x598ad4[_0x537c('0x41')]=_['intersection'](_0x3b0ffd[_0x537c('0x3b')],qs[_0x537c('0x42')](_0x38b91e[_0x537c('0x3d')][_0x537c('0x42')]));_0x598ad4['attributes']=_0x598ad4[_0x537c('0x41')]['length']?_0x598ad4[_0x537c('0x41')]:_0x3b0ffd['model'];_0x598ad4['order']=qs[_0x537c('0x45')](_0x38b91e[_0x537c('0x3d')]['sort']);_0x598ad4['where']=qs[_0x537c('0x46')](_[_0x537c('0x47')](_0x38b91e[_0x537c('0x3d')],_0x3b0ffd[_0x537c('0x46')]));if(_0x38b91e[_0x537c('0x3d')][_0x537c('0x4b')]){_0x598ad4[_0x537c('0x4a')]=_[_0x537c('0x4c')](_0x598ad4['where'],{'$or':_[_0x537c('0x6a')](_0x598ad4['attributes'],function(_0x4f9bb0){var _0x5bdf3b={};_0x5bdf3b[_0x4f9bb0]={'$like':'%'+_0x38b91e[_0x537c('0x3d')]['filter']+'%'};return _0x5bdf3b;})});}_0x598ad4=_['merge']({},_0x598ad4,_0x38b91e['options']);return _0x211306[_0x537c('0xb7')](_0x598ad4);}})['then'](function(_0x483ff4){if(_0x483ff4){_0x3bad01=_0x483ff4['length'];if(!_0x38b91e[_0x537c('0x3d')][_0x537c('0x67')](_0x537c('0x68'))){_0x598ad4[_0x537c('0x2c')]=qs[_0x537c('0x2c')](_0x38b91e[_0x537c('0x3d')][_0x537c('0x2c')]);_0x598ad4[_0x537c('0x2b')]=qs[_0x537c('0x2b')](_0x38b91e[_0x537c('0x3d')][_0x537c('0x2b')]);}return _0x211306[_0x537c('0xb7')](_0x598ad4);}})[_0x537c('0x1d')](function(_0x96e913){if(_0x96e913){return _0x96e913?{'count':_0x3bad01,'rows':_0x96e913}:null;}})['then'](respondWithResult(_0x2453c2,null))[_0x537c('0x54')](handleError(_0x2453c2,null));};exports[_0x537c('0x38')]=function(_0x5a1cb9,_0xeb359f,_0x38b776){var _0x18f84a,_0x4ca3de,_0x40f28d;if(_[_0x537c('0x7a')](_0x5a1cb9['body']['body'])||_0x5a1cb9[_0x537c('0x57')][_0x537c('0x57')]===''){throw new db['Sequelize'][(_0x537c('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x537c('0x7a')](_0x5a1cb9[_0x537c('0x57')]['to'])){}_0x18f84a=_0x5a1cb9[_0x537c('0x57')]['to'];return db[_0x537c('0x39')][_0x537c('0x66')]({'where':{'id':_0x5a1cb9['params']['id']}})[_0x537c('0x1d')](handleEntityNotFound(_0xeb359f,null))[_0x537c('0x1d')](function(_0x17ae77){if(_0x17ae77){return db[_0x537c('0x39')][_0x537c('0x5c')]({'where':{'id':_0x17ae77['id']},'include':[{'model':db[_0x537c('0xb9')],'as':_0x537c('0x82'),'include':[{'model':db[_0x537c('0x73')],'as':_0x537c('0x83'),'where':{[_0x17ae77[_0x537c('0x80')]]:_0x18f84a},'limit':0x1,'order':[[_0x537c('0x77'),_0x537c('0x84')]]}]}]})[_0x537c('0x1d')](handleEntityNotFound(_0xeb359f,null))[_0x537c('0x1d')](function(_0x3eecd6){if(_0x3eecd6&&_0x3eecd6[_0x537c('0x82')]){_0x4ca3de=_0x3eecd6[_0x537c('0x32')]({'plain':!![]});if(_0x4ca3de[_0x537c('0x82')]&&_0x4ca3de[_0x537c('0x82')][_0x537c('0x83')][_0x537c('0x43')]){return _0x4ca3de['List'][_0x537c('0x83')][0x0];}return db[_0x537c('0x73')]['create'](_['defaults'](_0x5a1cb9['body'],{'firstName':_0x18f84a,[_0x3eecd6[_0x537c('0x80')]]:_0x18f84a,'phone':_0x18f84a,'ListId':_0x4ca3de[_0x537c('0x79')]}));}})[_0x537c('0x1d')](handleEntityNotFound(_0xeb359f,null))['then'](function(_0x27f408){if(_0x27f408){_0x40f28d=_0x27f408;return db['OpenchannelInteraction'][_0x537c('0x5c')]({'where':{'ContactId':_0x40f28d['id'],'closed':![],'OpenchannelAccountId':_0x4ca3de['id']}})[_0x537c('0x1d')](function(_0x12d701){if(_0x12d701){return[_0x12d701,![]];}return db[_0x537c('0x91')][_0x537c('0x56')]({'UserId':_0x5a1cb9[_0x537c('0x58')]['id'],'ContactId':_0x40f28d['id'],'OpenchannelAccountId':_0x4ca3de['id'],'lastMsgDirection':_0x537c('0xba'),'Messages':[_[_0x537c('0x4c')](_0x5a1cb9['body'],{'read':![],'body':_0x5a1cb9['body'][_0x537c('0x57')],'OpenchannelAccountId':_0x4ca3de['id'],'UserId':_0x5a1cb9['user']['id'],'ContactId':_0x40f28d['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x537c('0x1d')](function(_0x3a18a1){return[_0x3a18a1,!![]];});});}})[_0x537c('0x93')](function(_0x5539b9,_0xc89f9a){if(_0xc89f9a){return _0x5539b9;}return db[_0x537c('0xbb')][_0x537c('0x56')](_[_0x537c('0x4c')](_0x5a1cb9[_0x537c('0x57')],{'read':![],'body':_0x5a1cb9[_0x537c('0x57')][_0x537c('0x57')],'OpenchannelAccountId':_0x4ca3de['id'],'OpenchannelInteractionId':_0x5539b9['id'],'UserId':_0x5a1cb9['user']['id'],'ContactId':_0x40f28d['id']}))[_0x537c('0x1d')](function(_0x123544){_0x5539b9[_0x537c('0xbc')]['Messages']=[];_0x5539b9[_0x537c('0xbc')][_0x537c('0xbd')][_0x537c('0x99')](_0x123544[_0x537c('0xbc')]);return _0x5539b9;});});}})[_0x537c('0x1d')](respondWithResult(_0xeb359f,null))['catch'](handleError(_0xeb359f,null));};
\ No newline at end of file
+var _0x38e1=['save','update','get','UserProfileResource','destroy','end','index','OpenchannelAccount','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','add','day','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','user','role','OpenchannelAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','OpenchannelApplication','Applications','applications','list','priority','asc','account','Contacts','firstName','lastName','OpenchannelInteraction','threadId','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','OpenchannelMessage','contact','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','notify','sequelize','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','send','DESC','out','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/utils','../../mysqldb','redis','defaults','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject'];(function(_0x5a9867,_0x4ed3ca){var _0x1aec4c=function(_0x4683f8){while(--_0x4683f8){_0x5a9867['push'](_0x5a9867['shift']());}};_0x1aec4c(++_0x4ed3ca);}(_0x38e1,0x148));var _0x138e=function(_0x1ebb8b,_0x12ca28){_0x1ebb8b=_0x1ebb8b-0x0;var _0x1ea803=_0x38e1[_0x1ebb8b];return _0x1ea803;};'use strict';var pdf=require(_0x138e('0x0'));var emlformat=require(_0x138e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x138e('0x2'));var jsonpatch=require(_0x138e('0x3'));var rp=require(_0x138e('0x4'));var moment=require(_0x138e('0x5'));var BPromise=require(_0x138e('0x6'));var Mustache=require(_0x138e('0x7'));var util=require('util');var path=require(_0x138e('0x8'));var sox=require(_0x138e('0x9'));var csv=require(_0x138e('0xa'));var ejs=require(_0x138e('0xb'));var fs=require('fs');var _=require(_0x138e('0xc'));var squel=require(_0x138e('0xd'));var crypto=require(_0x138e('0xe'));var jsforce=require(_0x138e('0xf'));var deskjs=require(_0x138e('0x10'));var toCsv=require(_0x138e('0xa'));var querystring=require(_0x138e('0x11'));var Papa=require(_0x138e('0x12'));var Redis=require(_0x138e('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x138e('0x14'));var config=require('../../config/environment');var db=require(_0x138e('0x15'))['db'];config[_0x138e('0x16')]=_[_0x138e('0x17')](config[_0x138e('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x138e('0x18')](socket);var jayson=require(_0x138e('0x19'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x138e('0x1a')][_0x138e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1354fb,_0x2320e9,_0x134d72,_0x4bb921){return new BPromise(function(_0x3a6d78,_0x2c6a5e){var _0x1f1391=_0x4bb921||client;return _0x1f1391['request'](_0x1354fb,_0x134d72)[_0x138e('0x1c')](function(_0x1b0459){logger[_0x138e('0x1d')](_0x138e('0x1e'),_0x2320e9,_0x138e('0x1f'));logger[_0x138e('0x20')](_0x138e('0x21'),_0x2320e9,_0x138e('0x1f'),JSON['stringify'](_0x1b0459));if(_0x1b0459[_0x138e('0x22')]){if(_0x1b0459[_0x138e('0x22')][_0x138e('0x23')]===0x1f4){logger[_0x138e('0x22')](_0x138e('0x1e'),_0x2320e9,_0x1b0459[_0x138e('0x22')][_0x138e('0x24')]);return _0x2c6a5e(_0x1b0459[_0x138e('0x22')][_0x138e('0x24')]);}logger[_0x138e('0x22')](_0x138e('0x1e'),_0x2320e9,_0x1b0459[_0x138e('0x22')][_0x138e('0x24')]);return _0x3a6d78(_0x1b0459['error'][_0x138e('0x24')]);}else{logger[_0x138e('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x2320e9,_0x138e('0x1f'));_0x3a6d78(_0x1b0459[_0x138e('0x25')]['message']);}})[_0x138e('0x26')](function(_0x1fab28){logger[_0x138e('0x22')](_0x138e('0x1e'),_0x2320e9,_0x1fab28);_0x2c6a5e(_0x1fab28);});});}function respondWithStatusCode(_0x15c4e8,_0x289fae){_0x289fae=_0x289fae||0xcc;return function(_0x57c4f4){if(_0x57c4f4){return _0x15c4e8[_0x138e('0x27')](_0x289fae);}return _0x15c4e8[_0x138e('0x28')](_0x289fae)['end']();};}function respondWithResult(_0x396b49,_0x2a6865){_0x2a6865=_0x2a6865||0xc8;return function(_0x580990){if(_0x580990){return _0x396b49['status'](_0x2a6865)[_0x138e('0x29')](_0x580990);}};}function respondWithFilteredResult(_0x102627,_0x1bf6f7){return function(_0x4dc7b8){if(_0x4dc7b8){var _0x35362a=_0x4dc7b8[_0x138e('0x2a')],_0xf4568=_0x1bf6f7['offset'],_0x3233ce=_0x1bf6f7[_0x138e('0x2b')]+_0x1bf6f7[_0x138e('0x2c')],_0x469612;if(_0x3233ce>=_0x35362a){_0x3233ce=_0x35362a;_0x469612=0xc8;}else{_0x469612=0xce;}_0x102627[_0x138e('0x28')](_0x469612);return _0x102627[_0x138e('0x2d')]('Content-Range',_0xf4568+'-'+_0x3233ce+'/'+_0x35362a)[_0x138e('0x29')](_0x4dc7b8);}return null;};}function patchUpdates(_0x2f208f){return function(_0x4412c9){try{jsonpatch[_0x138e('0x2e')](_0x4412c9,_0x2f208f,!![]);}catch(_0x581eb3){return BPromise[_0x138e('0x2f')](_0x581eb3);}return _0x4412c9[_0x138e('0x30')]();};}function saveUpdates(_0x6ed40b,_0x3bb075){return function(_0x1aa3bc){if(_0x1aa3bc){return _0x1aa3bc[_0x138e('0x31')](_0x6ed40b)[_0x138e('0x1c')](function(_0xaec838){return _0xaec838;});}return null;};}function removeEntity(_0x2e4088,_0x522d7c){return function(_0x475f1c){if(_0x475f1c){return _0x475f1c['destroy']()['then'](function(){var _0x35d4df=_0x475f1c[_0x138e('0x32')]({'plain':!![]});var _0x63e3fa='OpenchannelAccounts';return db[_0x138e('0x33')][_0x138e('0x34')]({'where':{'type':_0x63e3fa,'resourceId':_0x35d4df['id']}})[_0x138e('0x1c')](function(){return _0x475f1c;});})[_0x138e('0x1c')](function(){_0x2e4088[_0x138e('0x28')](0xcc)[_0x138e('0x35')]();});}};}function handleEntityNotFound(_0x5a289a,_0x91f1be){return function(_0x369223){if(!_0x369223){_0x5a289a[_0x138e('0x27')](0x194);}return _0x369223;};}function handleError(_0x1febaf,_0x37da3d){_0x37da3d=_0x37da3d||0x1f4;return function(_0x3400e8){logger[_0x138e('0x22')](_0x3400e8['stack']);if(_0x3400e8['name']){delete _0x3400e8['name'];}_0x1febaf['status'](_0x37da3d)['send'](_0x3400e8);};}exports[_0x138e('0x36')]=function(_0x3d2e1a,_0x266242){var _0x294a0f={},_0x4e3a31={},_0x5dd055={'count':0x0,'rows':[]};var _0x39d3ac=db[_0x138e('0x37')][_0x138e('0x38')];_0x4e3a31[_0x138e('0x39')]=_['keys'](_0x39d3ac);var _0x1fe335={'dateStart':_0x3d2e1a[_0x138e('0x3a')][_0x138e('0x3b')],'dateEnd':_0x3d2e1a[_0x138e('0x3a')][_0x138e('0x3c')]};delete _0x3d2e1a[_0x138e('0x3a')]['dateStart'];delete _0x3d2e1a['query'][_0x138e('0x3c')];_0x4e3a31[_0x138e('0x3a')]=_[_0x138e('0x3d')](_0x3d2e1a[_0x138e('0x3a')]);_0x4e3a31[_0x138e('0x3e')]=_[_0x138e('0x3f')](_0x4e3a31[_0x138e('0x39')],_0x4e3a31[_0x138e('0x3a')]);_0x294a0f['attributes']=_['intersection'](_0x4e3a31[_0x138e('0x39')],qs[_0x138e('0x40')](_0x3d2e1a[_0x138e('0x3a')]['fields']));_0x294a0f[_0x138e('0x41')]=_0x294a0f[_0x138e('0x41')][_0x138e('0x42')]?_0x294a0f[_0x138e('0x41')]:_0x4e3a31['model'];if(!_0x3d2e1a[_0x138e('0x3a')][_0x138e('0x43')](_0x138e('0x44'))){_0x294a0f[_0x138e('0x2c')]=qs[_0x138e('0x2c')](_0x3d2e1a['query'][_0x138e('0x2c')]);_0x294a0f[_0x138e('0x2b')]=qs[_0x138e('0x2b')](_0x3d2e1a[_0x138e('0x3a')]['offset']);}_0x294a0f[_0x138e('0x45')]=qs[_0x138e('0x46')](_0x3d2e1a[_0x138e('0x3a')]['sort']);_0x294a0f['where']=qs['filters'](_[_0x138e('0x47')](_0x3d2e1a[_0x138e('0x3a')],_0x4e3a31[_0x138e('0x3e')]));if(_0x1fe335[_0x138e('0x3b')]){if(_0x1fe335[_0x138e('0x3c')]){_0x1fe335['dateEnd']=moment(_0x1fe335[_0x138e('0x3c')])[_0x138e('0x48')](0x1,'day');}else{_0x1fe335[_0x138e('0x3c')]=moment(_0x1fe335[_0x138e('0x3b')])[_0x138e('0x48')](0x1,_0x138e('0x49'));}_['merge'](_0x294a0f[_0x138e('0x4a')],{'createdAt':{'$gte':_0x1fe335[_0x138e('0x3b')],'$lte':_0x1fe335['dateEnd']}});}if(_0x3d2e1a['query'][_0x138e('0x4b')]){_0x294a0f[_0x138e('0x4a')]=_[_0x138e('0x4c')](_0x294a0f['where'],{'$or':_[_0x138e('0x4d')](_0x39d3ac,function(_0x53e147){if(_0x53e147[_0x138e('0x4e')][_0x138e('0x4f')]!==_0x138e('0x50')){var _0x24fc42={};_0x24fc42[_0x53e147[_0x138e('0x51')]]={'$like':'%'+_0x3d2e1a[_0x138e('0x3a')][_0x138e('0x4b')]+'%'};return _0x24fc42;}})});}_0x294a0f=_['merge']({},_0x294a0f,_0x3d2e1a[_0x138e('0x52')]);var _0x23fe8e={'where':_0x294a0f[_0x138e('0x4a')]};return db[_0x138e('0x37')][_0x138e('0x2a')](_0x23fe8e)['then'](function(_0x3b0cef){_0x5dd055['count']=_0x3b0cef;if(_0x3d2e1a['query'][_0x138e('0x53')]){_0x294a0f[_0x138e('0x54')]=[{'all':!![]}];}return db[_0x138e('0x37')][_0x138e('0x55')](_0x294a0f);})[_0x138e('0x1c')](function(_0x54aef0){_0x5dd055[_0x138e('0x56')]=_0x54aef0;return _0x5dd055;})[_0x138e('0x1c')](respondWithFilteredResult(_0x266242,_0x294a0f))[_0x138e('0x26')](handleError(_0x266242,null));};exports[_0x138e('0x57')]=function(_0x4ebbd0,_0x3382c4){var _0x12d6d5={'raw':![],'where':{'id':_0x4ebbd0[_0x138e('0x58')]['id']}},_0x1e1c2b={};_0x1e1c2b[_0x138e('0x39')]=_[_0x138e('0x3d')](db['OpenchannelAccount'][_0x138e('0x38')]);_0x1e1c2b[_0x138e('0x3a')]=_[_0x138e('0x3d')](_0x4ebbd0['query']);_0x1e1c2b[_0x138e('0x3e')]=_[_0x138e('0x3f')](_0x1e1c2b[_0x138e('0x39')],_0x1e1c2b[_0x138e('0x3a')]);_0x12d6d5[_0x138e('0x41')]=_[_0x138e('0x3f')](_0x1e1c2b[_0x138e('0x39')],qs[_0x138e('0x40')](_0x4ebbd0['query'][_0x138e('0x40')]));_0x12d6d5[_0x138e('0x41')]=_0x12d6d5[_0x138e('0x41')]['length']?_0x12d6d5[_0x138e('0x41')]:_0x1e1c2b[_0x138e('0x39')];if(_0x4ebbd0[_0x138e('0x3a')][_0x138e('0x53')]){_0x12d6d5[_0x138e('0x54')]=[{'all':!![]}];}_0x12d6d5=_[_0x138e('0x4c')]({},_0x12d6d5,_0x4ebbd0[_0x138e('0x52')]);return db[_0x138e('0x37')][_0x138e('0x59')](_0x12d6d5)[_0x138e('0x1c')](handleEntityNotFound(_0x3382c4,null))[_0x138e('0x1c')](respondWithResult(_0x3382c4,null))['catch'](handleError(_0x3382c4,null));};exports[_0x138e('0x5a')]=function(_0x1dd4db,_0x5abe14){return db['OpenchannelAccount']['create'](_0x1dd4db[_0x138e('0x5b')],{})[_0x138e('0x1c')](function(_0x2c57b1){var _0x2e0190=_0x1dd4db[_0x138e('0x5c')]['get']({'plain':!![]});if(!_0x2e0190)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e0190[_0x138e('0x5d')]===_0x138e('0x5c')){var _0x532e0d=_0x2c57b1[_0x138e('0x32')]({'plain':!![]});var _0x4c28f7=_0x138e('0x5e');return db[_0x138e('0x5f')][_0x138e('0x59')]({'where':{'name':_0x4c28f7,'userProfileId':_0x2e0190['userProfileId']},'raw':!![]})[_0x138e('0x1c')](function(_0x2260eb){if(_0x2260eb&&_0x2260eb[_0x138e('0x60')]===0x0){return db[_0x138e('0x33')]['create']({'name':_0x532e0d['name'],'resourceId':_0x532e0d['id'],'type':_0x2260eb['name'],'sectionId':_0x2260eb['id']},{})[_0x138e('0x1c')](function(){return _0x2c57b1;});}else{return _0x2c57b1;}})[_0x138e('0x26')](function(_0x1d1d5f){logger[_0x138e('0x22')](_0x138e('0x61'),_0x1d1d5f);throw _0x1d1d5f;});}return _0x2c57b1;})[_0x138e('0x1c')](respondWithResult(_0x5abe14,0xc9))[_0x138e('0x26')](handleError(_0x5abe14,null));};exports['update']=function(_0x92df1a,_0x59d525){if(_0x92df1a[_0x138e('0x5b')]['id']){delete _0x92df1a[_0x138e('0x5b')]['id'];}return db[_0x138e('0x37')][_0x138e('0x59')]({'where':{'id':_0x92df1a[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x59d525,null))[_0x138e('0x1c')](saveUpdates(_0x92df1a['body'],null))[_0x138e('0x1c')](respondWithResult(_0x59d525,null))[_0x138e('0x26')](handleError(_0x59d525,null));};exports[_0x138e('0x34')]=function(_0x19054b,_0x263c8f){return db['OpenchannelAccount'][_0x138e('0x59')]({'where':{'id':_0x19054b['params']['id']}})['then'](handleEntityNotFound(_0x263c8f,null))[_0x138e('0x1c')](removeEntity(_0x263c8f,null))[_0x138e('0x26')](handleError(_0x263c8f,null));};exports[_0x138e('0x62')]=function(_0x499534,_0x1306c8){return db[_0x138e('0x37')][_0x138e('0x62')]()[_0x138e('0x1c')](respondWithResult(_0x1306c8,null))[_0x138e('0x26')](handleError(_0x1306c8,null));};exports[_0x138e('0x63')]=function(_0x285ee5,_0xf4adee,_0x4f0a66){if(_0x285ee5[_0x138e('0x5b')]['id']){delete _0x285ee5[_0x138e('0x5b')]['id'];}return db[_0x138e('0x37')][_0x138e('0x59')]({'where':{'id':_0x285ee5[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0xf4adee,null))[_0x138e('0x1c')](function(_0xd03afc){if(_0xd03afc){_0x285ee5[_0x138e('0x5b')][_0x138e('0x64')]=_0xd03afc['id'];return db[_0x138e('0x65')][_0x138e('0x5a')](_0x285ee5[_0x138e('0x5b')]);}})[_0x138e('0x1c')](respondWithResult(_0xf4adee,null))[_0x138e('0x26')](handleError(_0xf4adee,null));};exports[_0x138e('0x66')]=function(_0x152f3e,_0x3a24ab,_0x563f62){var _0x50c3f5={'raw':![],'where':{}};var _0x4ed967={};var _0x5828ae={'count':0x0,'rows':[]};return db[_0x138e('0x37')][_0x138e('0x67')]({'where':{'id':_0x152f3e[_0x138e('0x58')]['id']}})['then'](handleEntityNotFound(_0x3a24ab,null))[_0x138e('0x1c')](function(_0x460ade){if(_0x460ade){_0x4ed967[_0x138e('0x39')]=_[_0x138e('0x3d')](db[_0x138e('0x65')][_0x138e('0x38')]);_0x4ed967['query']=_[_0x138e('0x3d')](_0x152f3e[_0x138e('0x3a')]);_0x4ed967[_0x138e('0x3e')]=_['intersection'](_0x4ed967['model'],_0x4ed967[_0x138e('0x3a')]);_0x50c3f5['attributes']=_[_0x138e('0x3f')](_0x4ed967['model'],qs[_0x138e('0x40')](_0x152f3e[_0x138e('0x3a')][_0x138e('0x40')]));_0x50c3f5[_0x138e('0x41')]=_0x50c3f5['attributes'][_0x138e('0x42')]?_0x50c3f5[_0x138e('0x41')]:_0x4ed967[_0x138e('0x39')];if(!_0x152f3e['query'][_0x138e('0x43')]('nolimit')){_0x50c3f5[_0x138e('0x2c')]=qs[_0x138e('0x2c')](_0x152f3e[_0x138e('0x3a')][_0x138e('0x2c')]);_0x50c3f5[_0x138e('0x2b')]=qs['offset'](_0x152f3e[_0x138e('0x3a')]['offset']);}_0x50c3f5[_0x138e('0x45')]=qs['sort'](_0x152f3e[_0x138e('0x3a')][_0x138e('0x46')]);_0x50c3f5['where']=qs[_0x138e('0x3e')](_[_0x138e('0x47')](_0x152f3e['query'],_0x4ed967[_0x138e('0x3e')]));_0x50c3f5['where'][_0x138e('0x68')]=_0x460ade['id'];if(_0x152f3e[_0x138e('0x3a')][_0x138e('0x4b')]){_0x50c3f5[_0x138e('0x4a')]=_[_0x138e('0x4c')](_0x50c3f5[_0x138e('0x4a')],{'$or':_[_0x138e('0x4d')](_0x50c3f5[_0x138e('0x41')],function(_0x4b9211){var _0x5a6b3f={};_0x5a6b3f[_0x4b9211]={'$like':'%'+_0x152f3e['query'][_0x138e('0x4b')]+'%'};return _0x5a6b3f;})});}_0x50c3f5=_['merge']({},_0x50c3f5,_0x152f3e[_0x138e('0x52')]);return db['Disposition']['count']({'where':_0x50c3f5[_0x138e('0x4a')]})[_0x138e('0x1c')](function(_0x3c36e6){_0x5828ae[_0x138e('0x2a')]=_0x3c36e6;if(_0x152f3e[_0x138e('0x3a')][_0x138e('0x53')]){_0x50c3f5[_0x138e('0x54')]=[{'all':!![]}];}return db[_0x138e('0x65')]['findAll'](_0x50c3f5);})[_0x138e('0x1c')](function(_0x3c461e){_0x5828ae['rows']=_0x3c461e;return _0x5828ae;});}})[_0x138e('0x1c')](respondWithFilteredResult(_0x3a24ab,_0x50c3f5))[_0x138e('0x26')](handleError(_0x3a24ab,null));};exports['removeDispositions']=function(_0x1be5e0,_0x37bf39,_0x3a8a12){var _0x2dd818;return db[_0x138e('0x37')][_0x138e('0x59')]({'where':{'id':_0x1be5e0[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x37bf39,null))[_0x138e('0x1c')](function(_0x1efab8){if(_0x1efab8){return _0x1efab8[_0x138e('0x69')](_0x1be5e0[_0x138e('0x3a')][_0x138e('0x6a')]);}})[_0x138e('0x1c')](respondWithStatusCode(_0x37bf39,null))[_0x138e('0x26')](handleError(_0x37bf39,null));};exports[_0x138e('0x6b')]=function(_0x270511,_0x45b1a4,_0x3ddccb){if(_0x270511['body']['id']){delete _0x270511[_0x138e('0x5b')]['id'];}return db[_0x138e('0x37')][_0x138e('0x59')]({'where':{'id':_0x270511[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x45b1a4,null))[_0x138e('0x1c')](function(_0x135ad8){if(_0x135ad8){_0x270511[_0x138e('0x5b')][_0x138e('0x68')]=_0x135ad8['id'];return db[_0x138e('0x6c')]['create'](_0x270511[_0x138e('0x5b')]);}})[_0x138e('0x1c')](respondWithResult(_0x45b1a4,null))[_0x138e('0x26')](handleError(_0x45b1a4,null));};exports['getAnswers']=function(_0x47cc5f,_0x3f0625,_0x8e87d0){var _0x2248d9={'raw':![],'where':{}};var _0xda5591={};var _0x8c23db={'count':0x0,'rows':[]};return db[_0x138e('0x37')]['findOne']({'where':{'id':_0x47cc5f[_0x138e('0x58')]['id']}})['then'](handleEntityNotFound(_0x3f0625,null))[_0x138e('0x1c')](function(_0x1b7c82){if(_0x1b7c82){_0xda5591['model']=_[_0x138e('0x3d')](db[_0x138e('0x6c')][_0x138e('0x38')]);_0xda5591['query']=_[_0x138e('0x3d')](_0x47cc5f['query']);_0xda5591[_0x138e('0x3e')]=_[_0x138e('0x3f')](_0xda5591['model'],_0xda5591[_0x138e('0x3a')]);_0x2248d9[_0x138e('0x41')]=_[_0x138e('0x3f')](_0xda5591[_0x138e('0x39')],qs[_0x138e('0x40')](_0x47cc5f['query'][_0x138e('0x40')]));_0x2248d9[_0x138e('0x41')]=_0x2248d9[_0x138e('0x41')]['length']?_0x2248d9[_0x138e('0x41')]:_0xda5591[_0x138e('0x39')];if(!_0x47cc5f['query'][_0x138e('0x43')](_0x138e('0x44'))){_0x2248d9[_0x138e('0x2c')]=qs[_0x138e('0x2c')](_0x47cc5f[_0x138e('0x3a')][_0x138e('0x2c')]);_0x2248d9['offset']=qs[_0x138e('0x2b')](_0x47cc5f['query']['offset']);}_0x2248d9[_0x138e('0x45')]=qs[_0x138e('0x46')](_0x47cc5f['query']['sort']);_0x2248d9[_0x138e('0x4a')]=qs['filters'](_['pick'](_0x47cc5f['query'],_0xda5591[_0x138e('0x3e')]));_0x2248d9[_0x138e('0x4a')]['OpenchannelAccountId']=_0x1b7c82['id'];if(_0x47cc5f[_0x138e('0x3a')][_0x138e('0x4b')]){_0x2248d9[_0x138e('0x4a')]=_['merge'](_0x2248d9[_0x138e('0x4a')],{'$or':_[_0x138e('0x4d')](_0x2248d9[_0x138e('0x41')],function(_0x8cf3d0){var _0x177ce3={};_0x177ce3[_0x8cf3d0]={'$like':'%'+_0x47cc5f[_0x138e('0x3a')][_0x138e('0x4b')]+'%'};return _0x177ce3;})});}_0x2248d9=_[_0x138e('0x4c')]({},_0x2248d9,_0x47cc5f['options']);return db[_0x138e('0x6c')][_0x138e('0x2a')]({'where':_0x2248d9[_0x138e('0x4a')]})[_0x138e('0x1c')](function(_0x3a7c6b){_0x8c23db['count']=_0x3a7c6b;if(_0x47cc5f[_0x138e('0x3a')][_0x138e('0x53')]){_0x2248d9[_0x138e('0x54')]=[{'all':!![]}];}return db[_0x138e('0x6c')][_0x138e('0x55')](_0x2248d9);})[_0x138e('0x1c')](function(_0x324213){_0x8c23db[_0x138e('0x56')]=_0x324213;return _0x8c23db;});}})[_0x138e('0x1c')](respondWithFilteredResult(_0x3f0625,_0x2248d9))[_0x138e('0x26')](handleError(_0x3f0625,null));};exports[_0x138e('0x6d')]=function(_0x173914,_0x274002,_0x52af2f){var _0x460357;return db[_0x138e('0x37')][_0x138e('0x59')]({'where':{'id':_0x173914[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x274002,null))[_0x138e('0x1c')](function(_0x1bec4a){if(_0x1bec4a){return _0x1bec4a[_0x138e('0x6d')](_0x173914[_0x138e('0x3a')][_0x138e('0x6a')]);}})[_0x138e('0x1c')](respondWithStatusCode(_0x274002,null))[_0x138e('0x26')](handleError(_0x274002,null));};exports['notify']=function(_0x952255,_0x91232d,_0x4cdfb9){var _0x203f34={'body':_0x952255['body'],'channel':_0x138e('0x6e')};var _0x1e7437=[];var _0x56ad83=[];var _0x45256a={};var _0x284c90=![];return db[_0x138e('0x6f')][_0x138e('0x62')]()[_0x138e('0x1c')](function(_0x4825e7){if(!_0x4825e7){throw new db[(_0x138e('0x70'))][(_0x138e('0x71'))](_0x138e('0x72'));}_0x1e7437=_['difference'](_[_0x138e('0x3d')](_0x4825e7),['createdAt','updatedAt']);_0x56ad83=_[_0x138e('0x73')](_[_0x138e('0x3d')](_0x4825e7),[_0x138e('0x74'),_0x138e('0x75'),'CompanyId',_0x138e('0x76')]);if(_0x952255[_0x138e('0x5b')]['id']){delete _0x952255[_0x138e('0x5b')]['id'];}if(_[_0x138e('0x77')](_0x952255[_0x138e('0x5b')][_0x138e('0x78')])){throw new db[(_0x138e('0x70'))][(_0x138e('0x71'))](_0x138e('0x79'));}if(_[_0x138e('0x77')](_0x952255[_0x138e('0x5b')][_0x138e('0x5b')])||_0x952255[_0x138e('0x5b')][_0x138e('0x5b')]===''){throw new db['Sequelize'][(_0x138e('0x71'))](_0x138e('0x7a'));}if(_[_0x138e('0x77')](_0x952255['body'][_0x138e('0x7b')])){throw new db['Sequelize'][(_0x138e('0x71'))](_0x138e('0x7c')+_0x56ad83);}if(!_[_0x138e('0x7d')](_0x56ad83,_0x952255[_0x138e('0x5b')]['mapKey'])){throw new db[(_0x138e('0x70'))]['ValidationError'](_0x138e('0x7e')+_0x56ad83);}_0x45256a[_0x952255['body']['mapKey']]=_0x952255[_0x138e('0x5b')][_0x138e('0x78')];})['then'](function(){return db[_0x138e('0x37')]['find']({'where':{'id':_0x952255['params']['id']},'include':[{'model':db[_0x138e('0x7f')],'as':_0x138e('0x80'),'include':[{'model':db[_0x138e('0x6f')],'as':'Contacts','where':_0x45256a,'limit':0x1,'order':[[_0x138e('0x75'),'DESC']]}]},{'model':db[_0x138e('0x81')],'as':_0x138e('0x82')}]});})[_0x138e('0x1c')](handleEntityNotFound(_0x91232d,null))[_0x138e('0x1c')](function(_0x501817){if(_0x501817&&_0x501817[_0x138e('0x80')]){_0x203f34['account']=_0x501817;_0x203f34[_0x138e('0x83')]=_0x501817['Applications'];_0x203f34[_0x138e('0x84')]=_0x501817['List'];_0x203f34[_0x138e('0x83')]=_['orderBy'](_0x203f34[_0x138e('0x83')],[_0x138e('0x85')],[_0x138e('0x86')]);if(_0x203f34[_0x138e('0x87')][_0x138e('0x82')]){delete _0x203f34['account'][_0x138e('0x82')];}if(_0x203f34[_0x138e('0x87')]['List']&&_0x203f34[_0x138e('0x87')][_0x138e('0x80')][_0x138e('0x88')]['length']){return _0x203f34[_0x138e('0x87')][_0x138e('0x80')][_0x138e('0x88')][0x0];}var _0x193844=_[_0x138e('0x17')](_0x952255[_0x138e('0x5b')],{'firstName':_0x952255[_0x138e('0x5b')][_0x138e('0x78')],'ListId':_0x501817['ListId']});_0x193844[_0x952255[_0x138e('0x5b')][_0x138e('0x7b')]]=_0x952255[_0x138e('0x5b')][_0x138e('0x78')];return db['CmContact'][_0x138e('0x5a')](_0x193844,{'fields':_0x1e7437,'raw':!![]});}})[_0x138e('0x1c')](handleEntityNotFound(_0x91232d,null))['then'](function(_0xae40ad){_0x203f34['contact']=_0xae40ad;if(_0xae40ad){var _0x139f9b={'ContactId':_0xae40ad['id'],'OpenchannelAccountId':_0x952255['params']['id'],'from':(_0xae40ad[_0x138e('0x89')]||'')+'\x20'+(_0xae40ad[_0x138e('0x8a')]||'')};var _0x1788be={'OpenchannelAccountId':_0x952255[_0x138e('0x58')]['id'],'closed':![]};if(_0x952255[_0x138e('0x5b')]['threadId']){_0x1788be['threadId']=_0x952255['body']['threadId'];return db[_0x138e('0x8b')]['find']({'where':_0x1788be})['then'](function(_0x3eb321){if(_0x3eb321){return[_0x3eb321,![]];}_0x139f9b[_0x138e('0x8c')]=_0x952255['body'][_0x138e('0x8c')];_0x139f9b[_0x138e('0x8d')]=_0x952255[_0x138e('0x5b')]['externalUrl'];return db[_0x138e('0x8b')][_0x138e('0x5a')](_0x139f9b)[_0x138e('0x1c')](function(_0x27aac5){return[_0x27aac5,!![]];});});}else{_0x1788be[_0x138e('0x8c')]=null;}_0x1788be[_0x138e('0x8e')]=_0xae40ad['id'];return db[_0x138e('0x8b')][_0x138e('0x59')]({'where':_0x1788be})['then'](function(_0x289285){if(_0x289285){return[_0x289285,![]];}return db[_0x138e('0x8b')][_0x138e('0x5a')](_0x139f9b)[_0x138e('0x1c')](function(_0x2e961b){return[_0x2e961b,!![]];});});}})[_0x138e('0x8f')](function(_0x516e63,_0x1f0f7a){if(_0x516e63){_0x284c90=_0x1f0f7a;if(!_0x1f0f7a){var _0x3915db={'from':(_0x203f34['contact'][_0x138e('0x89')]||'')+'\x20'+(_0x203f34['contact'][_0x138e('0x8a')]||'')};if(_0x952255['body'][_0x138e('0x8c')]&&_0x952255[_0x138e('0x5b')]['messageId']&&_0x952255[_0x138e('0x5b')][_0x138e('0x8c')]!=_0x952255[_0x138e('0x5b')][_0x138e('0x90')]){_0x3915db['threadId']=_0x952255[_0x138e('0x5b')][_0x138e('0x90')];}return _0x516e63[_0x138e('0x31')](_0x3915db);}else{return _0x516e63;}}})[_0x138e('0x1c')](function(_0x51fd4b){_0x203f34['interaction']=_0x51fd4b[_0x138e('0x32')]({'plain':!![]});_0x203f34[_0x138e('0x91')]['created']=_0x284c90;if(_0x203f34['interaction'][_0x138e('0x92')]){if(_0x203f34[_0x138e('0x87')][_0x138e('0x93')]){_0x203f34[_0x138e('0x83')]['push']({'id':0x0,'priority':_0x203f34[_0x138e('0x83')][_0x138e('0x42')]+0x1,'app':_0x138e('0x94'),'appdata':_0x138e('0x95'),'interval':'*,*,*,*'});}}return db[_0x138e('0x96')][_0x138e('0x5a')]({'body':_0x952255[_0x138e('0x5b')][_0x138e('0x5b')],'OpenchannelAccountId':_0x952255[_0x138e('0x58')]['id'],'OpenchannelInteractionId':_0x51fd4b['id'],'direction':'in','ContactId':_0x203f34[_0x138e('0x97')]['id'],'AttachmentId':_0x952255['body'][_0x138e('0x98')]});})[_0x138e('0x1c')](function(_0x2baef6){_0x203f34[_0x138e('0x24')]=_0x2baef6;if(_0x203f34[_0x138e('0x91')]['UserId']){return db[_0x138e('0x99')][_0x138e('0x59')]({'attributes':['id',_0x138e('0x9a')],'where':{'id':_0x203f34[_0x138e('0x91')][_0x138e('0x9b')]}})[_0x138e('0x1c')](function(_0x3de83d){if(_0x3de83d){_0x203f34[_0x138e('0x83')][_0x138e('0x9c')]({'id':0x0,'priority':0x0,'app':_0x138e('0x9d'),'appdata':_0x3de83d[_0x138e('0x9a')]+','+(_0x203f34[_0x138e('0x87')][_0x138e('0x9e')]||0xa),'interval':_0x138e('0x9f')});_0x203f34[_0x138e('0xa0')]=![];}return respondWithRpcPromise('Start',_0x138e('0xa1'),_0x203f34);});}return respondWithRpcPromise(_0x138e('0xa2'),_0x138e('0xa1'),_0x203f34);})[_0x138e('0x1c')](function(_0x232909){respondWithRpcPromise(_0x138e('0xa3'),_0x138e('0xa3'),{'event':_0x138e('0xa4'),'message':_0x232909},client9002);return _0x232909;})[_0x138e('0x1c')](respondWithResult(_0x91232d,null))[_0x138e('0x26')](handleError(_0x91232d,null));};exports['addApplications']=function(_0xb71bb3,_0x3dab72,_0x219e0b){return db[_0x138e('0x37')][_0x138e('0x67')]({'where':{'id':_0xb71bb3['params']['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x3dab72,null))[_0x138e('0x1c')](function(_0xb20025){if(_0xb20025){return db[_0x138e('0xa5')]['transaction'](function(_0x526dfb){return db['OpenchannelApplication'][_0x138e('0x34')]({'where':{'OpenchannelAccountId':_0xb71bb3[_0x138e('0x58')]['id']},'transaction':_0x526dfb})[_0x138e('0x1c')](function(_0x2fa18a){var _0x531789=_[_0x138e('0x4d')](_0xb71bb3[_0x138e('0x5b')],function(_0x19e588){_0x19e588[_0x138e('0x68')]=_0xb71bb3[_0x138e('0x58')]['id'];return _0x19e588;});return db[_0x138e('0x81')][_0x138e('0xa6')](_0x531789,{'transaction':_0x526dfb});});})['then'](function(){return db[_0x138e('0x81')][_0x138e('0xa7')]({'where':{'OpenchannelAccountId':_0xb71bb3[_0x138e('0x58')]['id']},'order':_0x138e('0x85')});});}})[_0x138e('0x1c')](respondWithResult(_0x3dab72,null))[_0x138e('0x26')](handleError(_0x3dab72,null));};exports['getApplications']=function(_0x28ddc3,_0x18cff5,_0x2b4269){var _0x1f49a3={};var _0x4f5992={};var _0x5ceaee;var _0x53be27;return db['OpenchannelAccount'][_0x138e('0x67')]({'where':{'id':_0x28ddc3[_0x138e('0x58')]['id']}})['then'](handleEntityNotFound(_0x18cff5,null))[_0x138e('0x1c')](function(_0x5b5681){if(_0x5b5681){_0x5ceaee=_0x5b5681;_0x4f5992[_0x138e('0x39')]=_[_0x138e('0x3d')](db['OpenchannelApplication'][_0x138e('0x38')]);_0x4f5992[_0x138e('0x3a')]=_[_0x138e('0x3d')](_0x28ddc3[_0x138e('0x3a')]);_0x4f5992[_0x138e('0x3e')]=_[_0x138e('0x3f')](_0x4f5992['model'],_0x4f5992[_0x138e('0x3a')]);_0x1f49a3[_0x138e('0x41')]=_[_0x138e('0x3f')](_0x4f5992[_0x138e('0x39')],qs[_0x138e('0x40')](_0x28ddc3['query'][_0x138e('0x40')]));_0x1f49a3[_0x138e('0x41')]=_0x1f49a3['attributes'][_0x138e('0x42')]?_0x1f49a3[_0x138e('0x41')]:_0x4f5992['model'];_0x1f49a3['order']=qs[_0x138e('0x46')](_0x28ddc3[_0x138e('0x3a')][_0x138e('0x46')]);_0x1f49a3[_0x138e('0x4a')]=qs[_0x138e('0x3e')](_[_0x138e('0x47')](_0x28ddc3[_0x138e('0x3a')],_0x4f5992[_0x138e('0x3e')]));if(_0x28ddc3[_0x138e('0x3a')]['filter']){_0x1f49a3[_0x138e('0x4a')]=_[_0x138e('0x4c')](_0x1f49a3[_0x138e('0x4a')],{'$or':_[_0x138e('0x4d')](_0x1f49a3[_0x138e('0x41')],function(_0x589481){var _0x541d1c={};_0x541d1c[_0x589481]={'$like':'%'+_0x28ddc3[_0x138e('0x3a')]['filter']+'%'};return _0x541d1c;})});}_0x1f49a3=_[_0x138e('0x4c')]({},_0x1f49a3,_0x28ddc3['options']);return _0x5ceaee[_0x138e('0xa8')](_0x1f49a3);}})[_0x138e('0x1c')](function(_0x13318e){if(_0x13318e){_0x53be27=_0x13318e['length'];if(!_0x28ddc3['query'][_0x138e('0x43')]('nolimit')){_0x1f49a3[_0x138e('0x2c')]=qs['limit'](_0x28ddc3[_0x138e('0x3a')]['limit']);_0x1f49a3['offset']=qs['offset'](_0x28ddc3['query'][_0x138e('0x2b')]);}return _0x5ceaee[_0x138e('0xa8')](_0x1f49a3);}})[_0x138e('0x1c')](function(_0x5f1bf7){if(_0x5f1bf7){return _0x5f1bf7?{'count':_0x53be27,'rows':_0x5f1bf7}:null;}})[_0x138e('0x1c')](respondWithResult(_0x18cff5,null))[_0x138e('0x26')](handleError(_0x18cff5,null));};exports['getInteractions']=function(_0x1147c0,_0x2525c1,_0x24a1f2){var _0x42d7bc={'raw':![],'where':{}};var _0x31b117={};var _0x3ae7d2={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x138e('0x67')]({'where':{'id':_0x1147c0[_0x138e('0x58')]['id']}})['then'](handleEntityNotFound(_0x2525c1,null))[_0x138e('0x1c')](function(_0x4b052a){if(_0x4b052a){_0x31b117[_0x138e('0x39')]=_[_0x138e('0x3d')](db[_0x138e('0x8b')]['rawAttributes']);_0x31b117[_0x138e('0x3a')]=_['keys'](_0x1147c0[_0x138e('0x3a')]);_0x31b117[_0x138e('0x3e')]=_[_0x138e('0x3f')](_0x31b117[_0x138e('0x39')],_0x31b117[_0x138e('0x3a')]);_0x42d7bc[_0x138e('0x41')]=_[_0x138e('0x3f')](_0x31b117[_0x138e('0x39')],qs[_0x138e('0x40')](_0x1147c0[_0x138e('0x3a')][_0x138e('0x40')]));_0x42d7bc[_0x138e('0x41')]=_0x42d7bc['attributes']['length']?_0x42d7bc[_0x138e('0x41')]:_0x31b117['model'];if(!_0x1147c0[_0x138e('0x3a')]['hasOwnProperty'](_0x138e('0x44'))){_0x42d7bc['limit']=qs[_0x138e('0x2c')](_0x1147c0[_0x138e('0x3a')][_0x138e('0x2c')]);_0x42d7bc[_0x138e('0x2b')]=qs[_0x138e('0x2b')](_0x1147c0[_0x138e('0x3a')]['offset']);}_0x42d7bc[_0x138e('0x45')]=qs[_0x138e('0x46')](_0x1147c0[_0x138e('0x3a')][_0x138e('0x46')]);_0x42d7bc[_0x138e('0x4a')]=qs['filters'](_[_0x138e('0x47')](_0x1147c0[_0x138e('0x3a')],_0x31b117[_0x138e('0x3e')]));_0x42d7bc['where'][_0x138e('0x68')]=_0x4b052a['id'];if(_0x1147c0[_0x138e('0x3a')][_0x138e('0x4b')]){_0x42d7bc[_0x138e('0x4a')]=_[_0x138e('0x4c')](_0x42d7bc[_0x138e('0x4a')],{'$or':_[_0x138e('0x4d')](_0x42d7bc['attributes'],function(_0x3d1b14){var _0x4acbea={};_0x4acbea[_0x3d1b14]={'$like':'%'+_0x1147c0[_0x138e('0x3a')]['filter']+'%'};return _0x4acbea;})});}_0x42d7bc=_['merge']({},_0x42d7bc,_0x1147c0['options']);return db[_0x138e('0x8b')]['count']({'where':_0x42d7bc[_0x138e('0x4a')]})[_0x138e('0x1c')](function(_0x43d390){_0x3ae7d2['count']=_0x43d390;if(_0x1147c0[_0x138e('0x3a')]['includeAll']){_0x42d7bc[_0x138e('0x54')]=[{'model':db['CmContact'],'as':_0x138e('0xa9'),'required':![]},{'model':db[_0x138e('0x99')],'as':_0x138e('0xaa'),'attributes':[_0x138e('0x9a'),_0x138e('0xab'),_0x138e('0xac')],'required':![]},{'model':db['Tag'],'as':_0x138e('0xad'),'attributes':['id',_0x138e('0x9a'),_0x138e('0xae')],'where':_0x1147c0[_0x138e('0x3a')][_0x138e('0xaf')]?{'id':_0x1147c0[_0x138e('0x3a')][_0x138e('0xaf')]}:undefined,'required':_0x1147c0[_0x138e('0x3a')][_0x138e('0xaf')]?!![]:![]}];}return db[_0x138e('0x8b')][_0x138e('0x55')](_0x42d7bc);})[_0x138e('0x1c')](function(_0x515916){_0x3ae7d2[_0x138e('0x56')]=_0x515916;return _0x3ae7d2;});}})['then'](respondWithFilteredResult(_0x2525c1,_0x42d7bc))[_0x138e('0x26')](handleError(_0x2525c1,null));};exports['addAgents']=function(_0x4a3036,_0x51e878,_0x45dd24){return db[_0x138e('0x37')]['find']({'where':{'id':_0x4a3036[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x51e878,null))[_0x138e('0x1c')](function(_0x4766bb){if(_0x4766bb){return _0x4766bb[_0x138e('0xb0')](_0x4a3036['body']['ids'],_['omit'](_0x4a3036['body'],[_0x138e('0x6a'),'id'])||{})[_0x138e('0x8f')](function(_0x41d7aa){for(var _0x28e799=0x0;_0x28e799<_0x4a3036[_0x138e('0x5b')][_0x138e('0x6a')][_0x138e('0x42')];_0x28e799+=0x1){socket['emit'](_0x138e('0xb1'),{'UserId':_0x4a3036[_0x138e('0x5b')][_0x138e('0x6a')][_0x28e799],'OpenchannelAccountId':_0x4a3036[_0x138e('0x58')]['id']});}return _0x41d7aa;});}})[_0x138e('0x1c')](respondWithResult(_0x51e878,null))[_0x138e('0x26')](handleError(_0x51e878,null));};exports['removeAgents']=function(_0x18989d,_0x466f67,_0xc7703b){var _0x3a4b62;return db[_0x138e('0x37')]['find']({'where':{'id':_0x18989d[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x466f67,null))[_0x138e('0x1c')](function(_0x45dbf1){if(_0x45dbf1){return _0x45dbf1[_0x138e('0xb2')](_0x18989d[_0x138e('0x3a')]['ids'])[_0x138e('0x1c')](function(_0x15f5b3){if(_[_0x138e('0xb3')](_0x18989d[_0x138e('0x3a')][_0x138e('0x6a')])){for(var _0x485729=0x0;_0x485729<_0x18989d[_0x138e('0x3a')][_0x138e('0x6a')]['length'];_0x485729+=0x1){socket['emit'](_0x138e('0xb4'),{'UserId':_0x18989d[_0x138e('0x3a')][_0x138e('0x6a')][_0x485729],'OpenchannelAccountId':_0x18989d[_0x138e('0x58')]['id']});}}else{socket[_0x138e('0xb5')](_0x138e('0xb4'),{'UserId':_0x18989d[_0x138e('0x3a')]['ids'],'OpenchannelAccountId':_0x18989d['params']['id']});}});}})[_0x138e('0x1c')](respondWithStatusCode(_0x466f67,null))[_0x138e('0x26')](handleError(_0x466f67,null));};exports[_0x138e('0xb6')]=function(_0x5728a3,_0x3cfad9,_0x1d96d0){var _0x1e8bc6={};var _0x9a7f72={};var _0x197361;var _0x4e58bf;return db[_0x138e('0x37')][_0x138e('0x67')]({'where':{'id':_0x5728a3['params']['id']}})['then'](handleEntityNotFound(_0x3cfad9,null))[_0x138e('0x1c')](function(_0x4eb164){if(_0x4eb164){_0x197361=_0x4eb164;_0x9a7f72[_0x138e('0x39')]=_[_0x138e('0x3d')](db[_0x138e('0x99')][_0x138e('0x38')]);_0x9a7f72[_0x138e('0x3a')]=_[_0x138e('0x3d')](_0x5728a3[_0x138e('0x3a')]);_0x9a7f72[_0x138e('0x3e')]=_[_0x138e('0x3f')](_0x9a7f72[_0x138e('0x39')],_0x9a7f72[_0x138e('0x3a')]);_0x1e8bc6[_0x138e('0x41')]=_[_0x138e('0x3f')](_0x9a7f72[_0x138e('0x39')],qs[_0x138e('0x40')](_0x5728a3['query']['fields']));_0x1e8bc6[_0x138e('0x41')]=_0x1e8bc6[_0x138e('0x41')][_0x138e('0x42')]?_0x1e8bc6[_0x138e('0x41')]:_0x9a7f72['model'];_0x1e8bc6[_0x138e('0x45')]=qs[_0x138e('0x46')](_0x5728a3['query'][_0x138e('0x46')]);_0x1e8bc6['where']=qs[_0x138e('0x3e')](_['pick'](_0x5728a3[_0x138e('0x3a')],_0x9a7f72['filters']));if(_0x5728a3[_0x138e('0x3a')]['filter']){_0x1e8bc6[_0x138e('0x4a')]=_[_0x138e('0x4c')](_0x1e8bc6['where'],{'$or':_['map'](_0x1e8bc6['attributes'],function(_0x2d2a30){var _0x32af4a={};_0x32af4a[_0x2d2a30]={'$like':'%'+_0x5728a3['query'][_0x138e('0x4b')]+'%'};return _0x32af4a;})});}_0x1e8bc6=_['merge']({},_0x1e8bc6,_0x5728a3[_0x138e('0x52')]);return _0x197361[_0x138e('0xb6')](_0x1e8bc6);}})[_0x138e('0x1c')](function(_0x12ba9b){if(_0x12ba9b){_0x4e58bf=_0x12ba9b[_0x138e('0x42')];if(!_0x5728a3['query'][_0x138e('0x43')](_0x138e('0x44'))){_0x1e8bc6[_0x138e('0x2c')]=qs['limit'](_0x5728a3['query'][_0x138e('0x2c')]);_0x1e8bc6[_0x138e('0x2b')]=qs[_0x138e('0x2b')](_0x5728a3[_0x138e('0x3a')][_0x138e('0x2b')]);}return _0x197361[_0x138e('0xb6')](_0x1e8bc6);}})[_0x138e('0x1c')](function(_0x3437d7){if(_0x3437d7){return _0x3437d7?{'count':_0x4e58bf,'rows':_0x3437d7}:null;}})['then'](respondWithResult(_0x3cfad9,null))['catch'](handleError(_0x3cfad9,null));};exports[_0x138e('0xb7')]=function(_0xbdd07f,_0x299ebb,_0xa1f770){var _0x2de0dd,_0xba806f,_0x44324c;if(_[_0x138e('0x77')](_0xbdd07f[_0x138e('0x5b')][_0x138e('0x5b')])||_0xbdd07f[_0x138e('0x5b')][_0x138e('0x5b')]===''){throw new db[(_0x138e('0x70'))][(_0x138e('0x71'))](_0x138e('0x7a'));}if(_['isNil'](_0xbdd07f[_0x138e('0x5b')]['to'])){}_0x2de0dd=_0xbdd07f[_0x138e('0x5b')]['to'];return db[_0x138e('0x37')]['findOne']({'where':{'id':_0xbdd07f[_0x138e('0x58')]['id']}})[_0x138e('0x1c')](handleEntityNotFound(_0x299ebb,null))[_0x138e('0x1c')](function(_0x566d7f){if(_0x566d7f){return db[_0x138e('0x37')][_0x138e('0x59')]({'where':{'id':_0x566d7f['id']},'include':[{'model':db[_0x138e('0x7f')],'as':_0x138e('0x80'),'include':[{'model':db[_0x138e('0x6f')],'as':_0x138e('0x88'),'where':{[_0x566d7f['mapKey']]:_0x2de0dd},'limit':0x1,'order':[[_0x138e('0x75'),_0x138e('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x299ebb,null))[_0x138e('0x1c')](function(_0x15414d){if(_0x15414d&&_0x15414d[_0x138e('0x80')]){_0xba806f=_0x15414d['get']({'plain':!![]});if(_0xba806f[_0x138e('0x80')]&&_0xba806f[_0x138e('0x80')]['Contacts'][_0x138e('0x42')]){return _0xba806f[_0x138e('0x80')]['Contacts'][0x0];}return db[_0x138e('0x6f')][_0x138e('0x5a')](_[_0x138e('0x17')](_0xbdd07f[_0x138e('0x5b')],{'firstName':_0x2de0dd,[_0x15414d['mapKey']]:_0x2de0dd,'phone':_0x2de0dd,'ListId':_0xba806f[_0x138e('0x76')]}));}})[_0x138e('0x1c')](handleEntityNotFound(_0x299ebb,null))['then'](function(_0x507f4b){if(_0x507f4b){_0x44324c=_0x507f4b;return db['OpenchannelInteraction'][_0x138e('0x59')]({'where':{'ContactId':_0x44324c['id'],'closed':![],'OpenchannelAccountId':_0xba806f['id']}})[_0x138e('0x1c')](function(_0x39be0c){if(_0x39be0c){return[_0x39be0c,![]];}return db[_0x138e('0x8b')][_0x138e('0x5a')]({'UserId':_0xbdd07f[_0x138e('0x5c')]['id'],'ContactId':_0x44324c['id'],'OpenchannelAccountId':_0xba806f['id'],'lastMsgDirection':_0x138e('0xb9'),'Messages':[_[_0x138e('0x4c')](_0xbdd07f[_0x138e('0x5b')],{'read':![],'body':_0xbdd07f[_0x138e('0x5b')][_0x138e('0x5b')],'OpenchannelAccountId':_0xba806f['id'],'UserId':_0xbdd07f[_0x138e('0x5c')]['id'],'ContactId':_0x44324c['id']})]},{'include':[{'model':db[_0x138e('0x96')],'as':_0x138e('0xba')}]})[_0x138e('0x1c')](function(_0x329cca){return[_0x329cca,!![]];});});}})[_0x138e('0x8f')](function(_0xf04e54,_0x3a2286){if(_0x3a2286){return _0xf04e54;}return db[_0x138e('0x96')][_0x138e('0x5a')](_['merge'](_0xbdd07f[_0x138e('0x5b')],{'read':![],'body':_0xbdd07f[_0x138e('0x5b')][_0x138e('0x5b')],'OpenchannelAccountId':_0xba806f['id'],'OpenchannelInteractionId':_0xf04e54['id'],'UserId':_0xbdd07f[_0x138e('0x5c')]['id'],'ContactId':_0x44324c['id']}))[_0x138e('0x1c')](function(_0x537f88){_0xf04e54[_0x138e('0xbb')][_0x138e('0xba')]=[];_0xf04e54[_0x138e('0xbb')][_0x138e('0xba')]['push'](_0x537f88[_0x138e('0xbb')]);return _0xf04e54;});});}})[_0x138e('0x1c')](respondWithResult(_0x299ebb,null))['catch'](handleError(_0x299ebb,null));};
\ No newline at end of file
index b13a111..eef6501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a81=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount'];(function(_0x529f4a,_0xfde501){var _0x56ac2d=function(_0x11bd6f){while(--_0x11bd6f){_0x529f4a['push'](_0x529f4a['shift']());}};_0x56ac2d(++_0xfde501);}(_0x8a81,0x1da));var _0x18a8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8a81[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x18a8('0x0'));var OpenchannelAccount=require(_0x18a8('0x1'))['db'][_0x18a8('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x18a8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x18a8('0x4'),'afterDestroy':_0x18a8('0x5')};function emitEvent(_0x137a14){return function(_0x22c518,_0x24a716,_0x1a1221){OpenchannelAccountEvents['emit'](_0x137a14+':'+_0x22c518['id'],_0x22c518);OpenchannelAccountEvents[_0x18a8('0x6')](_0x137a14,_0x22c518);_0x1a1221(null);};}for(var e in events){if(events[_0x18a8('0x7')](e)){var event=events[e];OpenchannelAccount[_0x18a8('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x4148=['setMaxListeners','save','hasOwnProperty','hook','OpenchannelAccount'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x4148,0xb8));var _0x8414=function(_0x44d4e9,_0x52d710){_0x44d4e9=_0x44d4e9-0x0;var _0x4c9bd2=_0x4148[_0x44d4e9];return _0x4c9bd2;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x8414('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8414('0x1')](0x0);var events={'afterCreate':_0x8414('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x27de1c){return function(_0x1327fc,_0x171343,_0x3529f9){OpenchannelAccountEvents['emit'](_0x27de1c+':'+_0x1327fc['id'],_0x1327fc);OpenchannelAccountEvents['emit'](_0x27de1c,_0x1327fc);_0x3529f9(null);};}for(var e in events){if(events[_0x8414('0x3')](e)){var event=events[e];OpenchannelAccount[_0x8414('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index 08cd569..2efca67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['openchannel_accounts','lodash','../../config/logger','api','moment','request-promise','./openchannelAccount.attributes','exports','define'];(function(_0x4866f3,_0x556a62){var _0x7847c=function(_0x5bc5db){while(--_0x5bc5db){_0x4866f3['push'](_0x4866f3['shift']());}};_0x7847c(++_0x556a62);}(_0xb10b,0x12a));var _0xbb10=function(_0x405dc0,_0x5f2898){_0x405dc0=_0x405dc0-0x0;var _0x1ed46d=_0xb10b[_0x405dc0];return _0x1ed46d;};'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 attributes=require(_0xbb10('0x5'));module[_0xbb10('0x6')]=function(_0x22320e,_0x49baf4){return _0x22320e[_0xbb10('0x7')]('OpenchannelAccount',attributes,{'tableName':_0xbb10('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0xebd356,_0x3e5f35){var _0x287253=function(_0x28db26){while(--_0x28db26){_0xebd356['push'](_0xebd356['shift']());}};_0x287253(++_0x3e5f35);}(_0xe706,0xa3));var _0x6e70=function(_0x3645cc,_0x25ba47){_0x3645cc=_0x3645cc-0x0;var _0x351979=_0xe706[_0x3645cc];return _0x351979;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var attributes=require(_0x6e70('0x6'));module[_0x6e70('0x7')]=function(_0x2164a4,_0x376a8d){return _0x2164a4[_0x6e70('0x8')](_0x6e70('0x9'),attributes,{'tableName':_0x6e70('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55360e9..9c31780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x57a81a,_0x4cbe1c){var _0x2b76dd=function(_0x5f080a){while(--_0x5f080a){_0x57a81a['push'](_0x57a81a['shift']());}};_0x2b76dd(++_0x4cbe1c);}(_0x814b,0x1a2));var _0xb814=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x814b[_0x3358ba];return _0x296e73;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});}
\ No newline at end of file
+var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x16b595,_0x14d1e0){var _0x5716a8=function(_0x1fa3b2){while(--_0x1fa3b2){_0x16b595['push'](_0x16b595['shift']());}};_0x5716a8(++_0x14d1e0);}(_0xe14b,0x93));var _0xbe14=function(_0x236d0d,_0x285c99){_0x236d0d=_0x236d0d-0x0;var _0x443710=_0xe14b[_0x236d0d];return _0x443710;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});}
\ No newline at end of file
index d477ec2..3926e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf3c=['register','length','remove','update'];(function(_0x545bed,_0x221e96){var _0x16c79c=function(_0x465346){while(--_0x465346){_0x545bed['push'](_0x545bed['shift']());}};_0x16c79c(++_0x221e96);}(_0xdf3c,0x6e));var _0xcdf3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdf3c[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0xcdf3('0x0'),_0xcdf3('0x1')];function createListener(_0xa7104,_0x11404c){return function(_0x22f477){_0x11404c['emit'](_0xa7104,_0x22f477);};}function removeListener(_0x36e084,_0x1506c0){return function(){OpenchannelAccountEvents['removeListener'](_0x36e084,_0x1506c0);};}exports[_0xcdf3('0x2')]=function(_0x57ef59){for(var _0x32aea7=0x0,_0x458681=events[_0xcdf3('0x3')];_0x32aea7<_0x458681;_0x32aea7++){var _0x464362=events[_0x32aea7];var _0x512a4f=createListener('openchannelAccount:'+_0x464362,_0x57ef59);OpenchannelAccountEvents['on'](_0x464362,_0x512a4f);}};
\ No newline at end of file
+var _0x5572=['openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x5572,0x145));var _0x2557=function(_0x2e25b0,_0x3657aa){_0x2e25b0=_0x2e25b0-0x0;var _0x142a77=_0x5572[_0x2e25b0];return _0x142a77;};'use strict';var OpenchannelAccountEvents=require(_0x2557('0x0'));var events=[_0x2557('0x1'),'remove',_0x2557('0x2')];function createListener(_0x427165,_0x13f974){return function(_0x4c812c){_0x13f974[_0x2557('0x3')](_0x427165,_0x4c812c);};}function removeListener(_0x44aeee,_0x414c41){return function(){OpenchannelAccountEvents[_0x2557('0x4')](_0x44aeee,_0x414c41);};}exports['register']=function(_0x440a05){for(var _0x440a49=0x0,_0x54f6c6=events['length'];_0x440a49<_0x54f6c6;_0x440a49++){var _0x9b461d=events[_0x440a49];var _0x53bca8=createListener(_0x2557('0x5')+_0x9b461d,_0x440a05);OpenchannelAccountEvents['on'](_0x9b461d,_0x53bca8);}};
\ No newline at end of file
index 6e976bc..70781a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d2f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3d2f,0x16e));var _0xf3d2=function(_0x2efda4,_0x86b53b){_0x2efda4=_0x2efda4-0x0;var _0x1b5c11=_0x3d2f[_0x2efda4];return _0x1b5c11;};'use strict';var multer=require(_0xf3d2('0x0'));var util=require(_0xf3d2('0x1'));var path=require(_0xf3d2('0x2'));var timeout=require(_0xf3d2('0x3'));var express=require('express');var router=express[_0xf3d2('0x4')]();var auth=require(_0xf3d2('0x5'));var interaction=require(_0xf3d2('0x6'));var config=require(_0xf3d2('0x7'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0xf3d2('0x8')](),controller[_0xf3d2('0x9')]);router['get'](_0xf3d2('0xa'),auth[_0xf3d2('0x8')](),controller[_0xf3d2('0xb')]);router[_0xf3d2('0xc')]('/',auth[_0xf3d2('0x8')](),controller[_0xf3d2('0xd')]);router['put'](_0xf3d2('0xa'),auth[_0xf3d2('0x8')](),controller['update']);router[_0xf3d2('0xe')](_0xf3d2('0xa'),auth[_0xf3d2('0x8')](),controller[_0xf3d2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xb47a=['get','isAuthenticated','post','create','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller'];(function(_0x1f9c8a,_0x1c582a){var _0x2c8918=function(_0x495fdf){while(--_0x495fdf){_0x1f9c8a['push'](_0x1f9c8a['shift']());}};_0x2c8918(++_0x1c582a);}(_0xb47a,0xe6));var _0xab47=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb47a[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0xab47('0x0'));var util=require('util');var path=require(_0xab47('0x1'));var timeout=require('connect-timeout');var express=require(_0xab47('0x2'));var router=express[_0xab47('0x3')]();var auth=require(_0xab47('0x4'));var interaction=require(_0xab47('0x5'));var config=require(_0xab47('0x6'));var controller=require(_0xab47('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xab47('0x8')]('/:id',auth[_0xab47('0x9')](),controller['show']);router[_0xab47('0xa')]('/',auth['isAuthenticated'](),controller[_0xab47('0xb')]);router['put'](_0xab47('0xc'),auth[_0xab47('0x9')](),controller[_0xab47('0xd')]);router[_0xab47('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xab47('0xf')]);module[_0xab47('0x10')]=router;
\ No newline at end of file
index ace5a6a..5f4aca1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2089=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2089,0x17c));var _0x9208=function(_0x2a4c8b,_0x397e8f){_0x2a4c8b=_0x2a4c8b-0x0;var _0x5009e2=_0x2089[_0x2a4c8b];return _0x5009e2;};'use strict';var Sequelize=require('sequelize');module[_0x9208('0x0')]={'priority':{'type':Sequelize[_0x9208('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9208('0x2')],'allowNull':![],'defaultValue':_0x9208('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0x9208('0x2')]},'interval':{'type':Sequelize[_0x9208('0x2')],'defaultValue':_0x9208('0x4')}};
\ No newline at end of file
+var _0xdafc=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x14547b,_0x1b8dc8){var _0xf53c68=function(_0x1d41ee){while(--_0x1d41ee){_0x14547b['push'](_0x14547b['shift']());}};_0xf53c68(++_0x1b8dc8);}(_0xdafc,0x10b));var _0xcdaf=function(_0x336e40,_0x331acf){_0x336e40=_0x336e40-0x0;var _0x1bc5c5=_0xdafc[_0x336e40];return _0x1bc5c5;};'use strict';var Sequelize=require(_0xcdaf('0x0'));module[_0xcdaf('0x1')]={'priority':{'type':Sequelize[_0xcdaf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcdaf('0x3')],'allowNull':![],'defaultValue':_0xcdaf('0x4')},'appdata':{'type':Sequelize[_0xcdaf('0x3')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xcdaf('0x3')]},'interval':{'type':Sequelize[_0xcdaf('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 0764f40..58e3831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e4b=['nolimit','order','sort','where','filters','add','day','merge','filter','map','type','key','field','count','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','body','html-pdf','eml-format','zip-dir','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','limit','status','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','OpenchannelApplication','model','dateStart','dateEnd','query','keys','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x26a906,_0x3d135c){var _0x495575=function(_0x2365af){while(--_0x2365af){_0x26a906['push'](_0x26a906['shift']());}};_0x495575(++_0x3d135c);}(_0x6e4b,0x139));var _0xb6e4=function(_0x5f149a,_0x5a9a87){_0x5f149a=_0x5f149a-0x0;var _0x2d0bd8=_0x6e4b[_0x5f149a];return _0x2d0bd8;};'use strict';var pdf=require(_0xb6e4('0x0'));var emlformat=require(_0xb6e4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb6e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb6e4('0x3'));var util=require(_0xb6e4('0x4'));var path=require(_0xb6e4('0x5'));var sox=require('sox');var csv=require(_0xb6e4('0x6'));var ejs=require(_0xb6e4('0x7'));var fs=require('fs');var _=require(_0xb6e4('0x8'));var squel=require(_0xb6e4('0x9'));var crypto=require(_0xb6e4('0xa'));var jsforce=require(_0xb6e4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb6e4('0x6'));var querystring=require(_0xb6e4('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0xb6e4('0xd'));var logger=require(_0xb6e4('0xe'))(_0xb6e4('0xf'));var utils=require(_0xb6e4('0x10'));var config=require(_0xb6e4('0x11'));var db=require(_0xb6e4('0x12'))['db'];function respondWithStatusCode(_0x4b49bf,_0x17665b){_0x17665b=_0x17665b||0xcc;return function(_0x40f9af){if(_0x40f9af){return _0x4b49bf[_0xb6e4('0x13')](_0x17665b);}return _0x4b49bf['status'](_0x17665b)[_0xb6e4('0x14')]();};}function respondWithResult(_0x22b39f,_0x4690d4){_0x4690d4=_0x4690d4||0xc8;return function(_0x19a351){if(_0x19a351){return _0x22b39f['status'](_0x4690d4)['json'](_0x19a351);}};}function respondWithFilteredResult(_0x56c32b,_0xab3ef5){return function(_0x2e0dc3){if(_0x2e0dc3){var _0x163f70=_0x2e0dc3['count'],_0x81dad1=_0xab3ef5['offset'],_0x44230d=_0xab3ef5[_0xb6e4('0x15')]+_0xab3ef5[_0xb6e4('0x16')],_0x11ae26;if(_0x44230d>=_0x163f70){_0x44230d=_0x163f70;_0x11ae26=0xc8;}else{_0x11ae26=0xce;}_0x56c32b[_0xb6e4('0x17')](_0x11ae26);return _0x56c32b[_0xb6e4('0x18')](_0xb6e4('0x19'),_0x81dad1+'-'+_0x44230d+'/'+_0x163f70)[_0xb6e4('0x1a')](_0x2e0dc3);}return null;};}function patchUpdates(_0x4473ca){return function(_0x3b0eb5){try{jsonpatch[_0xb6e4('0x1b')](_0x3b0eb5,_0x4473ca,!![]);}catch(_0x40ec9f){return BPromise['reject'](_0x40ec9f);}return _0x3b0eb5[_0xb6e4('0x1c')]();};}function saveUpdates(_0x18476b,_0x58acb6){return function(_0x4e47f9){if(_0x4e47f9){return _0x4e47f9['update'](_0x18476b)[_0xb6e4('0x1d')](function(_0x489f8c){return _0x489f8c;});}return null;};}function removeEntity(_0x4c4307,_0x1c9ec3){return function(_0x136344){if(_0x136344){return _0x136344[_0xb6e4('0x1e')]()['then'](function(){_0x4c4307['status'](0xcc)[_0xb6e4('0x14')]();});}};}function handleEntityNotFound(_0xf3d5a2,_0x4ffa1e){return function(_0x17e29a){if(!_0x17e29a){_0xf3d5a2[_0xb6e4('0x13')](0x194);}return _0x17e29a;};}function handleError(_0x46bcc9,_0x4c408e){_0x4c408e=_0x4c408e||0x1f4;return function(_0x3d88ea){logger[_0xb6e4('0x1f')](_0x3d88ea[_0xb6e4('0x20')]);if(_0x3d88ea[_0xb6e4('0x21')]){delete _0x3d88ea[_0xb6e4('0x21')];}_0x46bcc9[_0xb6e4('0x17')](_0x4c408e)[_0xb6e4('0x22')](_0x3d88ea);};}exports[_0xb6e4('0x23')]=function(_0x1913c9,_0x5a7cac){var _0x2d66c0={},_0x351ac2={},_0x50802c={'count':0x0,'rows':[]};var _0x3b3612=db[_0xb6e4('0x24')]['rawAttributes'];_0x351ac2[_0xb6e4('0x25')]=_['keys'](_0x3b3612);var _0x1b2c3a={'dateStart':_0x1913c9['query'][_0xb6e4('0x26')],'dateEnd':_0x1913c9['query'][_0xb6e4('0x27')]};delete _0x1913c9['query'][_0xb6e4('0x26')];delete _0x1913c9['query'][_0xb6e4('0x27')];_0x351ac2[_0xb6e4('0x28')]=_[_0xb6e4('0x29')](_0x1913c9['query']);_0x351ac2['filters']=_['intersection'](_0x351ac2[_0xb6e4('0x25')],_0x351ac2[_0xb6e4('0x28')]);_0x2d66c0[_0xb6e4('0x2a')]=_[_0xb6e4('0x2b')](_0x351ac2['model'],qs[_0xb6e4('0x2c')](_0x1913c9[_0xb6e4('0x28')][_0xb6e4('0x2c')]));_0x2d66c0[_0xb6e4('0x2a')]=_0x2d66c0['attributes'][_0xb6e4('0x2d')]?_0x2d66c0['attributes']:_0x351ac2['model'];if(!_0x1913c9['query'][_0xb6e4('0x2e')](_0xb6e4('0x2f'))){_0x2d66c0['limit']=qs[_0xb6e4('0x16')](_0x1913c9[_0xb6e4('0x28')][_0xb6e4('0x16')]);_0x2d66c0[_0xb6e4('0x15')]=qs[_0xb6e4('0x15')](_0x1913c9[_0xb6e4('0x28')]['offset']);}_0x2d66c0[_0xb6e4('0x30')]=qs[_0xb6e4('0x31')](_0x1913c9['query'][_0xb6e4('0x31')]);_0x2d66c0[_0xb6e4('0x32')]=qs[_0xb6e4('0x33')](_['pick'](_0x1913c9['query'],_0x351ac2[_0xb6e4('0x33')]));if(_0x1b2c3a['dateStart']){if(_0x1b2c3a['dateEnd']){_0x1b2c3a[_0xb6e4('0x27')]=moment(_0x1b2c3a['dateEnd'])[_0xb6e4('0x34')](0x1,_0xb6e4('0x35'));}else{_0x1b2c3a[_0xb6e4('0x27')]=moment(_0x1b2c3a[_0xb6e4('0x26')])['add'](0x1,'day');}_[_0xb6e4('0x36')](_0x2d66c0['where'],{'createdAt':{'$gte':_0x1b2c3a[_0xb6e4('0x26')],'$lte':_0x1b2c3a['dateEnd']}});}if(_0x1913c9[_0xb6e4('0x28')][_0xb6e4('0x37')]){_0x2d66c0[_0xb6e4('0x32')]=_['merge'](_0x2d66c0[_0xb6e4('0x32')],{'$or':_[_0xb6e4('0x38')](_0x3b3612,function(_0x57d5ed){if(_0x57d5ed[_0xb6e4('0x39')][_0xb6e4('0x3a')]!=='VIRTUAL'){var _0x2f96ff={};_0x2f96ff[_0x57d5ed[_0xb6e4('0x3b')]]={'$like':'%'+_0x1913c9[_0xb6e4('0x28')]['filter']+'%'};return _0x2f96ff;}})});}_0x2d66c0=_[_0xb6e4('0x36')]({},_0x2d66c0,_0x1913c9['options']);var _0x2380e8={'where':_0x2d66c0[_0xb6e4('0x32')]};return db[_0xb6e4('0x24')]['count'](_0x2380e8)['then'](function(_0xae338f){_0x50802c[_0xb6e4('0x3c')]=_0xae338f;if(_0x1913c9[_0xb6e4('0x28')][_0xb6e4('0x3d')]){_0x2d66c0['include']=[{'all':!![]}];}return db[_0xb6e4('0x24')][_0xb6e4('0x3e')](_0x2d66c0);})[_0xb6e4('0x1d')](function(_0x109d94){_0x50802c['rows']=_0x109d94;return _0x50802c;})[_0xb6e4('0x1d')](respondWithFilteredResult(_0x5a7cac,_0x2d66c0))[_0xb6e4('0x3f')](handleError(_0x5a7cac,null));};exports[_0xb6e4('0x40')]=function(_0x31d147,_0x340473){var _0x163739={'raw':!![],'where':{'id':_0x31d147[_0xb6e4('0x41')]['id']}},_0x1ec542={};_0x1ec542['model']=_[_0xb6e4('0x29')](db['OpenchannelApplication'][_0xb6e4('0x42')]);_0x1ec542['query']=_['keys'](_0x31d147[_0xb6e4('0x28')]);_0x1ec542['filters']=_['intersection'](_0x1ec542['model'],_0x1ec542[_0xb6e4('0x28')]);_0x163739[_0xb6e4('0x2a')]=_[_0xb6e4('0x2b')](_0x1ec542[_0xb6e4('0x25')],qs[_0xb6e4('0x2c')](_0x31d147[_0xb6e4('0x28')][_0xb6e4('0x2c')]));_0x163739[_0xb6e4('0x2a')]=_0x163739[_0xb6e4('0x2a')][_0xb6e4('0x2d')]?_0x163739[_0xb6e4('0x2a')]:_0x1ec542['model'];if(_0x31d147[_0xb6e4('0x28')][_0xb6e4('0x3d')]){_0x163739[_0xb6e4('0x43')]=[{'all':!![]}];}_0x163739=_['merge']({},_0x163739,_0x31d147[_0xb6e4('0x44')]);return db['OpenchannelApplication'][_0xb6e4('0x45')](_0x163739)[_0xb6e4('0x1d')](handleEntityNotFound(_0x340473,null))[_0xb6e4('0x1d')](respondWithResult(_0x340473,null))['catch'](handleError(_0x340473,null));};exports[_0xb6e4('0x46')]=function(_0x213d41,_0xf764d5){return db[_0xb6e4('0x24')]['create'](_0x213d41[_0xb6e4('0x47')],{})[_0xb6e4('0x1d')](respondWithResult(_0xf764d5,0xc9))[_0xb6e4('0x3f')](handleError(_0xf764d5,null));};exports['update']=function(_0x198055,_0x496539){if(_0x198055[_0xb6e4('0x47')]['id']){delete _0x198055[_0xb6e4('0x47')]['id'];}return db[_0xb6e4('0x24')][_0xb6e4('0x45')]({'where':{'id':_0x198055['params']['id']}})[_0xb6e4('0x1d')](handleEntityNotFound(_0x496539,null))['then'](saveUpdates(_0x198055['body'],null))[_0xb6e4('0x1d')](respondWithResult(_0x496539,null))[_0xb6e4('0x3f')](handleError(_0x496539,null));};exports[_0xb6e4('0x1e')]=function(_0x1d7c4f,_0x2a879b){return db[_0xb6e4('0x24')]['find']({'where':{'id':_0x1d7c4f[_0xb6e4('0x41')]['id']}})[_0xb6e4('0x1d')](handleEntityNotFound(_0x2a879b,null))[_0xb6e4('0x1d')](removeEntity(_0x2a879b,null))['catch'](handleError(_0x2a879b,null));};
\ No newline at end of file
+var _0x151a=['filter','map','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','OpenchannelApplication','rawAttributes','keys','dateStart','query','dateEnd','filters','model','attributes','intersection','fields','sort','where','add','merge'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x151a,0x127));var _0xa151=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x151a[_0x29e3b6];return _0x55d4b0;};'use strict';var pdf=require(_0xa151('0x0'));var emlformat=require(_0xa151('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa151('0x2'));var jsonpatch=require(_0xa151('0x3'));var rp=require(_0xa151('0x4'));var moment=require(_0xa151('0x5'));var BPromise=require(_0xa151('0x6'));var Mustache=require('mustache');var util=require(_0xa151('0x7'));var path=require(_0xa151('0x8'));var sox=require(_0xa151('0x9'));var csv=require(_0xa151('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa151('0xb'));var squel=require(_0xa151('0xc'));var crypto=require(_0xa151('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa151('0xe'));var Papa=require(_0xa151('0xf'));var Redis=require(_0xa151('0x10'));var qs=require(_0xa151('0x11'));var logger=require('../../config/logger')(_0xa151('0x12'));var utils=require(_0xa151('0x13'));var config=require(_0xa151('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2420e7,_0x51df1e){_0x51df1e=_0x51df1e||0xcc;return function(_0x268352){if(_0x268352){return _0x2420e7[_0xa151('0x15')](_0x51df1e);}return _0x2420e7['status'](_0x51df1e)[_0xa151('0x16')]();};}function respondWithResult(_0x4d3002,_0x5b06a8){_0x5b06a8=_0x5b06a8||0xc8;return function(_0xe259fa){if(_0xe259fa){return _0x4d3002[_0xa151('0x17')](_0x5b06a8)[_0xa151('0x18')](_0xe259fa);}};}function respondWithFilteredResult(_0xe90918,_0x5c9aa9){return function(_0x5ca025){if(_0x5ca025){var _0x31110c=_0x5ca025[_0xa151('0x19')],_0x5effbe=_0x5c9aa9['offset'],_0x2b1e5f=_0x5c9aa9[_0xa151('0x1a')]+_0x5c9aa9[_0xa151('0x1b')],_0x46758b;if(_0x2b1e5f>=_0x31110c){_0x2b1e5f=_0x31110c;_0x46758b=0xc8;}else{_0x46758b=0xce;}_0xe90918['status'](_0x46758b);return _0xe90918[_0xa151('0x1c')](_0xa151('0x1d'),_0x5effbe+'-'+_0x2b1e5f+'/'+_0x31110c)[_0xa151('0x18')](_0x5ca025);}return null;};}function patchUpdates(_0x7a8ff9){return function(_0x2256f7){try{jsonpatch[_0xa151('0x1e')](_0x2256f7,_0x7a8ff9,!![]);}catch(_0x4e3d20){return BPromise[_0xa151('0x1f')](_0x4e3d20);}return _0x2256f7['save']();};}function saveUpdates(_0x37fba8,_0x354849){return function(_0x3210ba){if(_0x3210ba){return _0x3210ba[_0xa151('0x20')](_0x37fba8)[_0xa151('0x21')](function(_0x53d77a){return _0x53d77a;});}return null;};}function removeEntity(_0x52fc78,_0x5653fb){return function(_0x20d8f4){if(_0x20d8f4){return _0x20d8f4[_0xa151('0x22')]()[_0xa151('0x21')](function(){_0x52fc78[_0xa151('0x17')](0xcc)[_0xa151('0x16')]();});}};}function handleEntityNotFound(_0x276ad5,_0x131533){return function(_0x1f4de8){if(!_0x1f4de8){_0x276ad5['sendStatus'](0x194);}return _0x1f4de8;};}function handleError(_0x3886bd,_0x40e031){_0x40e031=_0x40e031||0x1f4;return function(_0x4f03f0){logger[_0xa151('0x23')](_0x4f03f0[_0xa151('0x24')]);if(_0x4f03f0[_0xa151('0x25')]){delete _0x4f03f0[_0xa151('0x25')];}_0x3886bd[_0xa151('0x17')](_0x40e031)[_0xa151('0x26')](_0x4f03f0);};}exports[_0xa151('0x27')]=function(_0x112663,_0x2d149e){var _0x2a731d={},_0x335732={},_0x47d24a={'count':0x0,'rows':[]};var _0xdbf887=db[_0xa151('0x28')][_0xa151('0x29')];_0x335732['model']=_[_0xa151('0x2a')](_0xdbf887);var _0x31aa4e={'dateStart':_0x112663['query'][_0xa151('0x2b')],'dateEnd':_0x112663[_0xa151('0x2c')][_0xa151('0x2d')]};delete _0x112663[_0xa151('0x2c')][_0xa151('0x2b')];delete _0x112663[_0xa151('0x2c')][_0xa151('0x2d')];_0x335732[_0xa151('0x2c')]=_[_0xa151('0x2a')](_0x112663[_0xa151('0x2c')]);_0x335732[_0xa151('0x2e')]=_['intersection'](_0x335732[_0xa151('0x2f')],_0x335732[_0xa151('0x2c')]);_0x2a731d[_0xa151('0x30')]=_[_0xa151('0x31')](_0x335732['model'],qs[_0xa151('0x32')](_0x112663[_0xa151('0x2c')][_0xa151('0x32')]));_0x2a731d[_0xa151('0x30')]=_0x2a731d[_0xa151('0x30')]['length']?_0x2a731d[_0xa151('0x30')]:_0x335732[_0xa151('0x2f')];if(!_0x112663['query']['hasOwnProperty']('nolimit')){_0x2a731d['limit']=qs[_0xa151('0x1b')](_0x112663[_0xa151('0x2c')][_0xa151('0x1b')]);_0x2a731d[_0xa151('0x1a')]=qs[_0xa151('0x1a')](_0x112663[_0xa151('0x2c')][_0xa151('0x1a')]);}_0x2a731d['order']=qs[_0xa151('0x33')](_0x112663[_0xa151('0x2c')][_0xa151('0x33')]);_0x2a731d[_0xa151('0x34')]=qs[_0xa151('0x2e')](_['pick'](_0x112663[_0xa151('0x2c')],_0x335732[_0xa151('0x2e')]));if(_0x31aa4e[_0xa151('0x2b')]){if(_0x31aa4e[_0xa151('0x2d')]){_0x31aa4e['dateEnd']=moment(_0x31aa4e[_0xa151('0x2d')])[_0xa151('0x35')](0x1,'day');}else{_0x31aa4e[_0xa151('0x2d')]=moment(_0x31aa4e['dateStart'])[_0xa151('0x35')](0x1,'day');}_[_0xa151('0x36')](_0x2a731d[_0xa151('0x34')],{'createdAt':{'$gte':_0x31aa4e[_0xa151('0x2b')],'$lte':_0x31aa4e['dateEnd']}});}if(_0x112663[_0xa151('0x2c')][_0xa151('0x37')]){_0x2a731d[_0xa151('0x34')]=_[_0xa151('0x36')](_0x2a731d['where'],{'$or':_[_0xa151('0x38')](_0xdbf887,function(_0x32e27a){if(_0x32e27a['type'][_0xa151('0x39')]!==_0xa151('0x3a')){var _0x4aa215={};_0x4aa215[_0x32e27a['field']]={'$like':'%'+_0x112663['query'][_0xa151('0x37')]+'%'};return _0x4aa215;}})});}_0x2a731d=_[_0xa151('0x36')]({},_0x2a731d,_0x112663[_0xa151('0x3b')]);var _0x454d0a={'where':_0x2a731d['where']};return db[_0xa151('0x28')][_0xa151('0x19')](_0x454d0a)['then'](function(_0x5d76be){_0x47d24a[_0xa151('0x19')]=_0x5d76be;if(_0x112663[_0xa151('0x2c')][_0xa151('0x3c')]){_0x2a731d[_0xa151('0x3d')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xa151('0x3e')](_0x2a731d);})[_0xa151('0x21')](function(_0x1a8576){_0x47d24a[_0xa151('0x3f')]=_0x1a8576;return _0x47d24a;})['then'](respondWithFilteredResult(_0x2d149e,_0x2a731d))[_0xa151('0x40')](handleError(_0x2d149e,null));};exports['show']=function(_0x1f580d,_0x126e5a){var _0x557ce2={'raw':!![],'where':{'id':_0x1f580d[_0xa151('0x41')]['id']}},_0x5f5731={};_0x5f5731[_0xa151('0x2f')]=_['keys'](db[_0xa151('0x28')][_0xa151('0x29')]);_0x5f5731[_0xa151('0x2c')]=_['keys'](_0x1f580d['query']);_0x5f5731[_0xa151('0x2e')]=_[_0xa151('0x31')](_0x5f5731[_0xa151('0x2f')],_0x5f5731['query']);_0x557ce2['attributes']=_[_0xa151('0x31')](_0x5f5731[_0xa151('0x2f')],qs[_0xa151('0x32')](_0x1f580d[_0xa151('0x2c')][_0xa151('0x32')]));_0x557ce2[_0xa151('0x30')]=_0x557ce2['attributes'][_0xa151('0x42')]?_0x557ce2[_0xa151('0x30')]:_0x5f5731[_0xa151('0x2f')];if(_0x1f580d['query'][_0xa151('0x3c')]){_0x557ce2['include']=[{'all':!![]}];}_0x557ce2=_[_0xa151('0x36')]({},_0x557ce2,_0x1f580d[_0xa151('0x3b')]);return db['OpenchannelApplication'][_0xa151('0x43')](_0x557ce2)[_0xa151('0x21')](handleEntityNotFound(_0x126e5a,null))[_0xa151('0x21')](respondWithResult(_0x126e5a,null))[_0xa151('0x40')](handleError(_0x126e5a,null));};exports[_0xa151('0x44')]=function(_0x6a2ac5,_0xbecf94){return db[_0xa151('0x28')][_0xa151('0x44')](_0x6a2ac5[_0xa151('0x45')],{})['then'](respondWithResult(_0xbecf94,0xc9))['catch'](handleError(_0xbecf94,null));};exports['update']=function(_0x4bc46b,_0xc6a650){if(_0x4bc46b[_0xa151('0x45')]['id']){delete _0x4bc46b[_0xa151('0x45')]['id'];}return db[_0xa151('0x28')][_0xa151('0x43')]({'where':{'id':_0x4bc46b[_0xa151('0x41')]['id']}})[_0xa151('0x21')](handleEntityNotFound(_0xc6a650,null))[_0xa151('0x21')](saveUpdates(_0x4bc46b[_0xa151('0x45')],null))[_0xa151('0x21')](respondWithResult(_0xc6a650,null))[_0xa151('0x40')](handleError(_0xc6a650,null));};exports['destroy']=function(_0x34487c,_0x5c0ef4){return db[_0xa151('0x28')]['find']({'where':{'id':_0x34487c[_0xa151('0x41')]['id']}})[_0xa151('0x21')](handleEntityNotFound(_0x5c0ef4,null))[_0xa151('0x21')](removeEntity(_0x5c0ef4,null))['catch'](handleError(_0x5c0ef4,null));};
\ No newline at end of file
index 799c1b6..2394710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1495=['openchannel_applications','lodash','util','../../config/logger','api','bluebird','request-promise','exports','define','OpenchannelApplication'];(function(_0x503195,_0xe0dc3e){var _0x88762b=function(_0x31045e){while(--_0x31045e){_0x503195['push'](_0x503195['shift']());}};_0x88762b(++_0xe0dc3e);}(_0x1495,0x6f));var _0x5149=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1495[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5149('0x0'));var util=require(_0x5149('0x1'));var logger=require(_0x5149('0x2'))(_0x5149('0x3'));var moment=require('moment');var BPromise=require(_0x5149('0x4'));var rp=require(_0x5149('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x5149('0x6')]=function(_0x14369b,_0x3828e9){return _0x14369b[_0x5149('0x7')](_0x5149('0x8'),attributes,{'tableName':_0x5149('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7986=['define','OpenchannelApplication','openchannel_applications','util','../../config/logger','api','bluebird','./openchannelApplication.attributes','exports'];(function(_0x40171b,_0x3f9fb2){var _0x847390=function(_0x57cbe9){while(--_0x57cbe9){_0x40171b['push'](_0x40171b['shift']());}};_0x847390(++_0x3f9fb2);}(_0x7986,0x12c));var _0x6798=function(_0x48cfc3,_0x252175){_0x48cfc3=_0x48cfc3-0x0;var _0x1ebea3=_0x7986[_0x48cfc3];return _0x1ebea3;};'use strict';var _=require('lodash');var util=require(_0x6798('0x0'));var logger=require(_0x6798('0x1'))(_0x6798('0x2'));var moment=require('moment');var BPromise=require(_0x6798('0x3'));var rp=require('request-promise');var attributes=require(_0x6798('0x4'));module[_0x6798('0x5')]=function(_0x13cd76,_0x4e089e){return _0x13cd76[_0x6798('0x6')](_0x6798('0x7'),attributes,{'tableName':_0x6798('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a19bf78..c6eb404 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a58=['http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateOpenchannelApplication','update','options','raw','where','limit','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e042d,_0x192c48){var _0x1f7171=function(_0x178b22){while(--_0x178b22){_0x2e042d['push'](_0x2e042d['shift']());}};_0x1f7171(++_0x192c48);}(_0x6a58,0x120));var _0x86a5=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x6a58[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x86a5('0x0'));var util=require(_0x86a5('0x1'));var moment=require('moment');var BPromise=require(_0x86a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86a5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86a5('0x4'));var logger=require(_0x86a5('0x5'))(_0x86a5('0x6'));var config=require(_0x86a5('0x7'));var jayson=require(_0x86a5('0x8'));var client=jayson['client'][_0x86a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd0a4f4,_0x5749e8,_0x425c8f){return new BPromise(function(_0xe98bdc,_0x43a1a2){return client[_0x86a5('0xa')](_0xd0a4f4,_0x425c8f)[_0x86a5('0xb')](function(_0x3084f3){logger[_0x86a5('0xc')](_0x86a5('0xd'),_0x5749e8,_0x86a5('0xe'));logger[_0x86a5('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5749e8,'request\x20sent',JSON[_0x86a5('0x10')](_0x3084f3));if(_0x3084f3['error']){if(_0x3084f3[_0x86a5('0x11')][_0x86a5('0x12')]===0x1f4){logger['error'](_0x86a5('0xd'),_0x5749e8,_0x3084f3[_0x86a5('0x11')]['message']);return _0x43a1a2(_0x3084f3[_0x86a5('0x11')][_0x86a5('0x13')]);}logger['error'](_0x86a5('0xd'),_0x5749e8,_0x3084f3[_0x86a5('0x11')][_0x86a5('0x13')]);return _0xe98bdc(_0x3084f3[_0x86a5('0x11')][_0x86a5('0x13')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x5749e8,_0x86a5('0xe'));_0xe98bdc(_0x3084f3['result'][_0x86a5('0x13')]);}})[_0x86a5('0x14')](function(_0x69a6ec){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x5749e8,_0x69a6ec);_0x43a1a2(_0x69a6ec);});});}exports[_0x86a5('0x15')]=function(_0x173005){var _0x146327=this;return new Promise(function(_0x130048,_0x3628a2){return db['OpenchannelApplication'][_0x86a5('0x16')](_0x173005['body'],{'raw':_0x173005[_0x86a5('0x17')]?_0x173005[_0x86a5('0x17')][_0x86a5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x173005[_0x86a5('0x17')]?_0x173005[_0x86a5('0x17')][_0x86a5('0x19')]||null:null,'attributes':_0x173005[_0x86a5('0x17')]?_0x173005[_0x86a5('0x17')]['attributes']||null:null,'limit':_0x173005['options']?_0x173005[_0x86a5('0x17')][_0x86a5('0x1a')]||null:null})['then'](function(_0x5cc8f0){logger['info'](_0x86a5('0x15'),_0x173005);logger[_0x86a5('0xf')](_0x86a5('0x15'),_0x173005,JSON['stringify'](_0x5cc8f0));_0x130048(_0x5cc8f0);})['catch'](function(_0x2a9dee){logger[_0x86a5('0x11')](_0x86a5('0x15'),_0x2a9dee['message'],_0x173005);_0x3628a2(_0x146327[_0x86a5('0x11')](0x1f4,_0x2a9dee['message']));});});};
\ No newline at end of file
+var _0x975c=['request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelApplication','update','body','options','raw','where','attributes','UpdateOpenchannelApplication','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x975c,0x122));var _0xc975=function(_0x2faeae,_0x2f7aa4){_0x2faeae=_0x2faeae-0x0;var _0xf0b909=_0x975c[_0x2faeae];return _0xf0b909;};'use strict';var _=require('lodash');var util=require(_0xc975('0x0'));var moment=require(_0xc975('0x1'));var BPromise=require('bluebird');var rs=require(_0xc975('0x2'));var fs=require('fs');var Redis=require(_0xc975('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc975('0x4'));var logger=require(_0xc975('0x5'))(_0xc975('0x6'));var config=require('../../config/environment');var jayson=require(_0xc975('0x7'));var client=jayson[_0xc975('0x8')][_0xc975('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x270229,_0xe21e92,_0x3c6789){return new BPromise(function(_0x543cff,_0x32e8c0){return client[_0xc975('0xa')](_0x270229,_0x3c6789)[_0xc975('0xb')](function(_0x3e31ad){logger[_0xc975('0xc')](_0xc975('0xd'),_0xe21e92,_0xc975('0xe'));logger[_0xc975('0xf')](_0xc975('0x10'),_0xe21e92,_0xc975('0xe'),JSON[_0xc975('0x11')](_0x3e31ad));if(_0x3e31ad['error']){if(_0x3e31ad[_0xc975('0x12')][_0xc975('0x13')]===0x1f4){logger['error'](_0xc975('0xd'),_0xe21e92,_0x3e31ad[_0xc975('0x12')][_0xc975('0x14')]);return _0x32e8c0(_0x3e31ad['error'][_0xc975('0x14')]);}logger[_0xc975('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0xe21e92,_0x3e31ad[_0xc975('0x12')][_0xc975('0x14')]);return _0x543cff(_0x3e31ad[_0xc975('0x12')][_0xc975('0x14')]);}else{logger[_0xc975('0xc')](_0xc975('0xd'),_0xe21e92,_0xc975('0xe'));_0x543cff(_0x3e31ad['result'][_0xc975('0x14')]);}})['catch'](function(_0x3d3e02){logger[_0xc975('0x12')](_0xc975('0xd'),_0xe21e92,_0x3d3e02);_0x32e8c0(_0x3d3e02);});});}exports['UpdateOpenchannelApplication']=function(_0x5b6e91){var _0xacdf8a=this;return new Promise(function(_0x4c22e1,_0x25018f){return db[_0xc975('0x15')][_0xc975('0x16')](_0x5b6e91[_0xc975('0x17')],{'raw':_0x5b6e91[_0xc975('0x18')]?_0x5b6e91[_0xc975('0x18')][_0xc975('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b6e91[_0xc975('0x18')]?_0x5b6e91[_0xc975('0x18')][_0xc975('0x1a')]||null:null,'attributes':_0x5b6e91[_0xc975('0x18')]?_0x5b6e91['options'][_0xc975('0x1b')]||null:null,'limit':_0x5b6e91[_0xc975('0x18')]?_0x5b6e91[_0xc975('0x18')]['limit']||null:null})['then'](function(_0x2f0ae0){logger['info'](_0xc975('0x1c'),_0x5b6e91);logger[_0xc975('0xf')](_0xc975('0x1c'),_0x5b6e91,JSON['stringify'](_0x2f0ae0));_0x4c22e1(_0x2f0ae0);})[_0xc975('0x1d')](function(_0x2b35ff){logger['error'](_0xc975('0x1c'),_0x2b35ff[_0xc975('0x14')],_0x5b6e91);_0x25018f(_0xacdf8a[_0xc975('0x12')](0x1f4,_0x2b35ff[_0xc975('0x14')]));});});};
\ No newline at end of file
index ccfe921..ace3950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9de4=['/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage'];(function(_0x34aaa1,_0x30e563){var _0x85c43f=function(_0x10e8da){while(--_0x10e8da){_0x34aaa1['push'](_0x34aaa1['shift']());}};_0x85c43f(++_0x30e563);}(_0x9de4,0xfb));var _0x49de=function(_0x5610df,_0x2831f5){_0x5610df=_0x5610df-0x0;var _0x404e73=_0x9de4[_0x5610df];return _0x404e73;};'use strict';var multer=require(_0x49de('0x0'));var util=require(_0x49de('0x1'));var path=require(_0x49de('0x2'));var timeout=require(_0x49de('0x3'));var express=require(_0x49de('0x4'));var router=express['Router']();var auth=require(_0x49de('0x5'));var interaction=require(_0x49de('0x6'));var config=require(_0x49de('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x49de('0x8')](),controller[_0x49de('0x9')]);router[_0x49de('0xa')](_0x49de('0xb'),auth[_0x49de('0x8')](),controller[_0x49de('0xc')]);router[_0x49de('0xa')](_0x49de('0xd'),auth[_0x49de('0x8')](),controller[_0x49de('0xe')]);router[_0x49de('0xa')]('/:id/messages',auth[_0x49de('0x8')](),controller[_0x49de('0xf')]);router['get'](_0x49de('0x10'),auth[_0x49de('0x8')](),controller[_0x49de('0x11')]);router[_0x49de('0x12')]('/',auth[_0x49de('0x8')](),controller['create']);router[_0x49de('0x12')](_0x49de('0x13'),auth[_0x49de('0x8')](),controller[_0x49de('0x14')]);router[_0x49de('0x12')](_0x49de('0x15'),auth['isAuthenticated'](),interaction[_0x49de('0x16')](_0x49de('0x17'),_0x49de('0x18')),controller[_0x49de('0x19')]);router[_0x49de('0x1a')](_0x49de('0xd'),auth[_0x49de('0x8')](),interaction[_0x49de('0x16')]('openchannel',_0x49de('0x1b')),controller[_0x49de('0x1c')]);router[_0x49de('0x1d')](_0x49de('0xd'),auth[_0x49de('0x8')](),interaction[_0x49de('0x16')](_0x49de('0x17'),_0x49de('0x1e')),controller[_0x49de('0x1f')]);router[_0x49de('0x1d')](_0x49de('0x15'),auth[_0x49de('0x8')](),controller[_0x49de('0x20')]);module[_0x49de('0x21')]=router;
\ No newline at end of file
+var _0x56d2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannel','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router'];(function(_0x53a360,_0x28c7ba){var _0x333c2d=function(_0x2ba85b){while(--_0x2ba85b){_0x53a360['push'](_0x53a360['shift']());}};_0x333c2d(++_0x28c7ba);}(_0x56d2,0x181));var _0x256d=function(_0x4d97ef,_0xd3bab4){_0x4d97ef=_0x4d97ef-0x0;var _0x2e029e=_0x56d2[_0x4d97ef];return _0x2e029e;};'use strict';var multer=require(_0x256d('0x0'));var util=require(_0x256d('0x1'));var path=require(_0x256d('0x2'));var timeout=require('connect-timeout');var express=require(_0x256d('0x3'));var router=express[_0x256d('0x4')]();var auth=require(_0x256d('0x5'));var interaction=require(_0x256d('0x6'));var config=require(_0x256d('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x256d('0x8')]('/',auth[_0x256d('0x9')](),controller['index']);router[_0x256d('0x8')](_0x256d('0xa'),auth['isAuthenticated'](),controller[_0x256d('0xb')]);router[_0x256d('0x8')]('/:id',auth[_0x256d('0x9')](),controller['show']);router['get'](_0x256d('0xc'),auth[_0x256d('0x9')](),controller[_0x256d('0xd')]);router[_0x256d('0x8')](_0x256d('0xe'),auth[_0x256d('0x9')](),controller[_0x256d('0xf')]);router[_0x256d('0x10')]('/',auth[_0x256d('0x9')](),controller['create']);router['post']('/:id/messages',auth[_0x256d('0x9')](),controller[_0x256d('0x11')]);router[_0x256d('0x10')](_0x256d('0x12'),auth[_0x256d('0x9')](),interaction[_0x256d('0x13')]('openchannel',_0x256d('0x14')),controller['addTags']);router[_0x256d('0x15')]('/:id',auth[_0x256d('0x9')](),interaction['tracked']('openchannel',_0x256d('0x16')),controller[_0x256d('0x17')]);router[_0x256d('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x256d('0x13')](_0x256d('0x19'),_0x256d('0x1a')),controller[_0x256d('0x1b')]);router[_0x256d('0x18')](_0x256d('0x12'),auth[_0x256d('0x9')](),controller[_0x256d('0x1c')]);module[_0x256d('0x1d')]=router;
\ No newline at end of file
index 046555c..cde8d6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c6d=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0xfc4a88,_0x546f2a){var _0x3d54b3=function(_0x9c859d){while(--_0x9c859d){_0xfc4a88['push'](_0xfc4a88['shift']());}};_0x3d54b3(++_0x546f2a);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5cdfa4,_0x400cfa){_0x5cdfa4=_0x5cdfa4-0x0;var _0x598cec=_0x4c6d[_0x5cdfa4];return _0x598cec;};'use strict';var Sequelize=require(_0xd4c6('0x0'));module[_0xd4c6('0x1')]={'closed':{'type':Sequelize[_0xd4c6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd4c6('0x3')]},'disposition':{'type':Sequelize[_0xd4c6('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xd4c6('0x3')]},'threadId':{'type':Sequelize[_0xd4c6('0x4')]},'externalUrl':{'type':Sequelize[_0xd4c6('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd4c6('0x5')]('in',_0xd4c6('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5455=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x4d5f48,_0x386fc2){var _0x56b066=function(_0x93a6f6){while(--_0x93a6f6){_0x4d5f48['push'](_0x4d5f48['shift']());}};_0x56b066(++_0x386fc2);}(_0x5455,0x197));var _0x5545=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5455[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module[_0x5545('0x0')]={'closed':{'type':Sequelize[_0x5545('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5545('0x2')]},'disposition':{'type':Sequelize[_0x5545('0x3')]},'note':{'type':Sequelize[_0x5545('0x3')]},'read1stAt':{'type':Sequelize[_0x5545('0x2')]},'threadId':{'type':Sequelize[_0x5545('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5545('0x4')]('in',_0x5545('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 43d22b8..902a4a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b88=['findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','OpenchannelInteractionId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','emit','removeTags','download','unix','toString','join','root','files','tmp','server','firstName','Attachment','Letter','1cm','mkdirSync','<h1>Openchannel\x20Interaction:\x20#%d</h1>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','<hr>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','basename','existsSync','createWriteStream','toFile','interaction-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','reject','update','then','destroy','error','name','model','keys','query','dateEnd','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','dateStart','add','day','filter','merge','map','type','key','VIRTUAL','options','tag','include','push','Tags','distinct','OpenchannelMessage','direction','createdAt','read','OpenchannelInteraction','count','includeAll','Users','fullname','CmContact','Contact','User','Owner','internal','OpenchannelAccount','Account','Messages','Tag','ThroughTags','color'];(function(_0x365dd,_0x827328){var _0x391fc2=function(_0xa7943f){while(--_0xa7943f){_0x365dd['push'](_0x365dd['shift']());}};_0x391fc2(++_0x827328);}(_0x2b88,0xc1));var _0x82b8=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x2b88[_0x5b7788];return _0x573871;};'use strict';var pdf=require(_0x82b8('0x0'));var emlformat=require(_0x82b8('0x1'));var rimraf=require(_0x82b8('0x2'));var zipdir=require(_0x82b8('0x3'));var jsonpatch=require(_0x82b8('0x4'));var rp=require(_0x82b8('0x5'));var moment=require(_0x82b8('0x6'));var BPromise=require(_0x82b8('0x7'));var Mustache=require('mustache');var util=require(_0x82b8('0x8'));var path=require(_0x82b8('0x9'));var sox=require(_0x82b8('0xa'));var csv=require(_0x82b8('0xb'));var ejs=require(_0x82b8('0xc'));var fs=require('fs');var _=require(_0x82b8('0xd'));var squel=require(_0x82b8('0xe'));var crypto=require(_0x82b8('0xf'));var jsforce=require(_0x82b8('0x10'));var deskjs=require(_0x82b8('0x11'));var toCsv=require(_0x82b8('0xb'));var querystring=require(_0x82b8('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0x82b8('0x13'));var logger=require(_0x82b8('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x82b8('0x15'))['db'];config[_0x82b8('0x16')]=_[_0x82b8('0x17')](config[_0x82b8('0x16')],{'host':_0x82b8('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82b8('0x16')]));require(_0x82b8('0x19'))[_0x82b8('0x1a')](socket);function respondWithStatusCode(_0x427c7d,_0x15a80b){_0x15a80b=_0x15a80b||0xcc;return function(_0x1153cb){if(_0x1153cb){return _0x427c7d[_0x82b8('0x1b')](_0x15a80b);}return _0x427c7d[_0x82b8('0x1c')](_0x15a80b)[_0x82b8('0x1d')]();};}function respondWithResult(_0x2c6131,_0x50b7cc){_0x50b7cc=_0x50b7cc||0xc8;return function(_0x507cab){if(_0x507cab){return _0x2c6131[_0x82b8('0x1c')](_0x50b7cc)[_0x82b8('0x1e')](_0x507cab);}};}function respondWithFilteredResult(_0x2c8613,_0x2060c6){return function(_0x76df92){if(_0x76df92){var _0x59e372=_0x76df92['count'],_0x505b41=_0x2060c6[_0x82b8('0x1f')],_0x359a9e=_0x2060c6[_0x82b8('0x1f')]+_0x2060c6[_0x82b8('0x20')],_0x3f9021;if(_0x359a9e>=_0x59e372){_0x359a9e=_0x59e372;_0x3f9021=0xc8;}else{_0x3f9021=0xce;}_0x2c8613[_0x82b8('0x1c')](_0x3f9021);return _0x2c8613[_0x82b8('0x21')]('Content-Range',_0x505b41+'-'+_0x359a9e+'/'+_0x59e372)[_0x82b8('0x1e')](_0x76df92);}return null;};}function patchUpdates(_0x1a1813){return function(_0x242f1a){try{jsonpatch['apply'](_0x242f1a,_0x1a1813,!![]);}catch(_0x43d39b){return BPromise[_0x82b8('0x22')](_0x43d39b);}return _0x242f1a['save']();};}function saveUpdates(_0x32b398,_0x2ff0be){return function(_0x4269ad){if(_0x4269ad){return _0x4269ad[_0x82b8('0x23')](_0x32b398)[_0x82b8('0x24')](function(_0x12aa1d){return _0x12aa1d;});}return null;};}function removeEntity(_0x3fbca9,_0x24de9f){return function(_0x5e83f5){if(_0x5e83f5){return _0x5e83f5[_0x82b8('0x25')]()[_0x82b8('0x24')](function(){_0x3fbca9[_0x82b8('0x1c')](0xcc)[_0x82b8('0x1d')]();});}};}function handleEntityNotFound(_0x23110c,_0x225946){return function(_0x4b208d){if(!_0x4b208d){_0x23110c[_0x82b8('0x1b')](0x194);}return _0x4b208d;};}function handleError(_0x33c817,_0x389eeb){_0x389eeb=_0x389eeb||0x1f4;return function(_0x192661){logger[_0x82b8('0x26')](_0x192661['stack']);if(_0x192661[_0x82b8('0x27')]){delete _0x192661['name'];}_0x33c817['status'](_0x389eeb)['send'](_0x192661);};}exports['index']=function(_0x164909,_0x4faa3c){var _0x582d9c={},_0x331929={},_0x4d4a4d={'count':0x0,'rows':[]};var _0xe041e9=db['OpenchannelInteraction']['rawAttributes'];_0x331929[_0x82b8('0x28')]=_[_0x82b8('0x29')](_0xe041e9);var _0x490ad6={'dateStart':_0x164909[_0x82b8('0x2a')]['dateStart'],'dateEnd':_0x164909[_0x82b8('0x2a')][_0x82b8('0x2b')]};delete _0x164909[_0x82b8('0x2a')]['dateStart'];delete _0x164909['query'][_0x82b8('0x2b')];_0x331929[_0x82b8('0x2a')]=_[_0x82b8('0x29')](_0x164909[_0x82b8('0x2a')]);_0x331929[_0x82b8('0x2c')]=_[_0x82b8('0x2d')](_0x331929[_0x82b8('0x28')],_0x331929['query']);_0x582d9c[_0x82b8('0x2e')]=_[_0x82b8('0x2d')](_0x331929[_0x82b8('0x28')],qs[_0x82b8('0x2f')](_0x164909[_0x82b8('0x2a')][_0x82b8('0x2f')]));_0x582d9c[_0x82b8('0x2e')]=_0x582d9c[_0x82b8('0x2e')][_0x82b8('0x30')]?_0x582d9c[_0x82b8('0x2e')]:_0x331929[_0x82b8('0x28')];if(!_0x164909['query']['hasOwnProperty'](_0x82b8('0x31'))){_0x582d9c[_0x82b8('0x20')]=qs[_0x82b8('0x20')](_0x164909[_0x82b8('0x2a')]['limit']);_0x582d9c[_0x82b8('0x1f')]=qs[_0x82b8('0x1f')](_0x164909['query']['offset']);}_0x582d9c[_0x82b8('0x32')]=qs[_0x82b8('0x33')](_0x164909[_0x82b8('0x2a')][_0x82b8('0x33')]);_0x582d9c[_0x82b8('0x34')]=qs[_0x82b8('0x2c')](_[_0x82b8('0x35')](_0x164909[_0x82b8('0x2a')],_0x331929['filters']));if(_0x490ad6[_0x82b8('0x36')]){if(_0x490ad6[_0x82b8('0x2b')]){_0x490ad6[_0x82b8('0x2b')]=moment(_0x490ad6[_0x82b8('0x2b')])[_0x82b8('0x37')](0x1,_0x82b8('0x38'));}else{_0x490ad6[_0x82b8('0x2b')]=moment(_0x490ad6[_0x82b8('0x36')])[_0x82b8('0x37')](0x1,_0x82b8('0x38'));}_['merge'](_0x582d9c[_0x82b8('0x34')],{'createdAt':{'$gte':_0x490ad6[_0x82b8('0x36')],'$lte':_0x490ad6[_0x82b8('0x2b')]}});}if(_0x164909[_0x82b8('0x2a')][_0x82b8('0x39')]){_0x582d9c['where']=_[_0x82b8('0x3a')](_0x582d9c[_0x82b8('0x34')],{'$or':_[_0x82b8('0x3b')](_0xe041e9,function(_0x261859){if(_0x261859[_0x82b8('0x3c')][_0x82b8('0x3d')]!==_0x82b8('0x3e')){var _0x5408cf={};_0x5408cf[_0x261859['field']]={'$like':'%'+_0x164909[_0x82b8('0x2a')][_0x82b8('0x39')]+'%'};return _0x5408cf;}})});}_0x582d9c=_[_0x82b8('0x3a')]({},_0x582d9c,_0x164909[_0x82b8('0x3f')]);var _0x5c570d={'where':_0x582d9c[_0x82b8('0x34')]};_0x5c570d['include']=[];if(_0x164909[_0x82b8('0x2a')][_0x82b8('0x40')]){_0x5c570d[_0x82b8('0x41')][_0x82b8('0x42')]({'model':db['Tag'],'as':_0x82b8('0x43'),'attributes':['id'],'where':{'id':_0x164909['query']['tag']},'required':!![]});_0x5c570d[_0x82b8('0x44')]=!![];}if(_0x164909[_0x82b8('0x2a')]['read']){_0x5c570d[_0x82b8('0x41')][_0x82b8('0x42')]({'model':db[_0x82b8('0x45')],'as':'Messages','attributes':['id',_0x82b8('0x46'),_0x82b8('0x47'),_0x82b8('0x48')],'where':{'direction':'in','read':_0x164909[_0x82b8('0x2a')][_0x82b8('0x48')]||![]},'required':!![]});_0x5c570d[_0x82b8('0x44')]=!![];}return db[_0x82b8('0x49')][_0x82b8('0x4a')](_0x5c570d)['then'](function(_0x17c48b){_0x4d4a4d[_0x82b8('0x4a')]=_0x17c48b;if(_0x164909[_0x82b8('0x2a')][_0x82b8('0x4b')]){_0x582d9c[_0x82b8('0x41')]=[{'model':db['User'],'as':_0x82b8('0x4c'),'required':![],'attributes':['id',_0x82b8('0x27'),_0x82b8('0x4d')]},{'model':db[_0x82b8('0x4e')],'as':_0x82b8('0x4f'),'required':![]},{'model':db[_0x82b8('0x50')],'as':_0x82b8('0x51'),'attributes':[_0x82b8('0x27'),_0x82b8('0x4d'),_0x82b8('0x52')],'required':![]},{'model':db[_0x82b8('0x53')],'as':_0x82b8('0x54'),'attributes':[_0x82b8('0x27'),_0x82b8('0x3d')],'required':![]},{'model':db['OpenchannelMessage'],'as':_0x82b8('0x55'),'attributes':['id',_0x82b8('0x46'),_0x82b8('0x47'),_0x82b8('0x48')],'where':{'direction':'in','read':_0x164909['query'][_0x82b8('0x48')]||![]},'required':_0x164909[_0x82b8('0x2a')][_0x82b8('0x48')]||![]},{'model':db['Tag'],'as':_0x82b8('0x43'),'attributes':['id',_0x82b8('0x27'),'color'],'required':_0x164909[_0x82b8('0x2a')][_0x82b8('0x40')]?!![]:![]},{'model':db[_0x82b8('0x56')],'as':_0x82b8('0x57'),'attributes':['id',_0x82b8('0x27'),_0x82b8('0x58')],'through':_0x164909[_0x82b8('0x2a')][_0x82b8('0x40')]?{'attributes':[],'where':{'TagId':_0x164909[_0x82b8('0x2a')]['tag']||undefined}}:{},'required':_0x164909['query'][_0x82b8('0x40')]?!![]:![]}];}return db[_0x82b8('0x49')][_0x82b8('0x59')](_0x582d9c);})[_0x82b8('0x24')](function(_0x47c5f5){_0x4d4a4d[_0x82b8('0x5a')]=_0x47c5f5;return _0x4d4a4d;})[_0x82b8('0x24')](respondWithFilteredResult(_0x4faa3c,_0x582d9c))[_0x82b8('0x5b')](handleError(_0x4faa3c,null));};exports[_0x82b8('0x5c')]=function(_0x45b382,_0x4c9667){var _0x4e3c3f={'raw':![],'where':{'id':_0x45b382['params']['id']}},_0x324723={};_0x324723[_0x82b8('0x28')]=_[_0x82b8('0x29')](db[_0x82b8('0x49')][_0x82b8('0x5d')]);_0x324723['query']=_[_0x82b8('0x29')](_0x45b382[_0x82b8('0x2a')]);_0x324723['filters']=_[_0x82b8('0x2d')](_0x324723[_0x82b8('0x28')],_0x324723['query']);_0x4e3c3f[_0x82b8('0x2e')]=_[_0x82b8('0x2d')](_0x324723[_0x82b8('0x28')],qs[_0x82b8('0x2f')](_0x45b382[_0x82b8('0x2a')]['fields']));_0x4e3c3f[_0x82b8('0x2e')]=_0x4e3c3f[_0x82b8('0x2e')][_0x82b8('0x30')]?_0x4e3c3f[_0x82b8('0x2e')]:_0x324723[_0x82b8('0x28')];if(_0x45b382[_0x82b8('0x2a')]['includeAll']){_0x4e3c3f[_0x82b8('0x41')]=[{'all':!![]}];}_0x4e3c3f=_['merge']({},_0x4e3c3f,_0x45b382[_0x82b8('0x3f')]);return db[_0x82b8('0x49')][_0x82b8('0x5e')](_0x4e3c3f)[_0x82b8('0x24')](handleEntityNotFound(_0x4c9667,null))[_0x82b8('0x24')](respondWithResult(_0x4c9667,null))[_0x82b8('0x5b')](handleError(_0x4c9667,null));};exports[_0x82b8('0x5f')]=function(_0x12c54f,_0x37d4e9){return db['OpenchannelInteraction'][_0x82b8('0x5f')](_0x12c54f[_0x82b8('0x60')],{})[_0x82b8('0x24')](respondWithResult(_0x37d4e9,0xc9))[_0x82b8('0x5b')](handleError(_0x37d4e9,null));};exports['update']=function(_0x2910ed,_0x1cde8a){if(_0x2910ed[_0x82b8('0x60')]['id']){delete _0x2910ed[_0x82b8('0x60')]['id'];}return db[_0x82b8('0x49')][_0x82b8('0x5e')]({'where':{'id':_0x2910ed['params']['id']}})[_0x82b8('0x24')](handleEntityNotFound(_0x1cde8a,null))[_0x82b8('0x24')](saveUpdates(_0x2910ed[_0x82b8('0x60')],null))[_0x82b8('0x24')](respondWithResult(_0x1cde8a,null))[_0x82b8('0x5b')](handleError(_0x1cde8a,null));};exports[_0x82b8('0x25')]=function(_0x2335f4,_0x35adfb){return db[_0x82b8('0x49')][_0x82b8('0x5e')]({'where':{'id':_0x2335f4[_0x82b8('0x61')]['id']}})[_0x82b8('0x24')](handleEntityNotFound(_0x35adfb,null))[_0x82b8('0x24')](removeEntity(_0x35adfb,null))[_0x82b8('0x5b')](handleError(_0x35adfb,null));};exports[_0x82b8('0x62')]=function(_0x55a86b,_0x1d0bad){return db[_0x82b8('0x49')][_0x82b8('0x62')]()[_0x82b8('0x24')](respondWithResult(_0x1d0bad,null))[_0x82b8('0x5b')](handleError(_0x1d0bad,null));};exports['addMessage']=function(_0x38ee05,_0x327ece,_0x392a45){return db[_0x82b8('0x45')][_0x82b8('0x5e')]({'where':{'id':_0x38ee05[_0x82b8('0x61')]['id']}})[_0x82b8('0x24')](handleEntityNotFound(_0x327ece,null))[_0x82b8('0x24')](function(_0x7a26f4){if(_0x7a26f4){return _0x7a26f4[_0x82b8('0x63')](_0x38ee05[_0x82b8('0x60')][_0x82b8('0x64')],_[_0x82b8('0x65')](_0x38ee05[_0x82b8('0x60')],[_0x82b8('0x64'),'id'])||{});}})[_0x82b8('0x24')](respondWithResult(_0x327ece,null))[_0x82b8('0x5b')](handleError(_0x327ece,null));};exports[_0x82b8('0x66')]=function(_0x35bf6e,_0x3a6d13,_0x6478e0){var _0x310d2b={'raw':![],'where':{}};var _0x3b2b6f={};var _0x492aac={'count':0x0,'rows':[]};return db[_0x82b8('0x49')][_0x82b8('0x67')]({'where':{'id':_0x35bf6e[_0x82b8('0x61')]['id']}})[_0x82b8('0x24')](handleEntityNotFound(_0x3a6d13,null))[_0x82b8('0x24')](function(_0x1b958f){if(_0x1b958f){_0x3b2b6f[_0x82b8('0x28')]=_[_0x82b8('0x29')](db[_0x82b8('0x45')][_0x82b8('0x5d')]);_0x3b2b6f[_0x82b8('0x2a')]=_['keys'](_0x35bf6e[_0x82b8('0x2a')]);_0x3b2b6f[_0x82b8('0x2c')]=_[_0x82b8('0x2d')](_0x3b2b6f['model'],_0x3b2b6f[_0x82b8('0x2a')]);_0x310d2b[_0x82b8('0x2e')]=_[_0x82b8('0x2d')](_0x3b2b6f['model'],qs['fields'](_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x2f')]));_0x310d2b[_0x82b8('0x2e')]=_0x310d2b[_0x82b8('0x2e')][_0x82b8('0x30')]?_0x310d2b['attributes']:_0x3b2b6f['model'];if(!_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x68')]('nolimit')){_0x310d2b['limit']=qs[_0x82b8('0x20')](_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x20')]);_0x310d2b[_0x82b8('0x1f')]=qs[_0x82b8('0x1f')](_0x35bf6e['query'][_0x82b8('0x1f')]);}_0x310d2b[_0x82b8('0x32')]=qs[_0x82b8('0x33')](_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x33')]);_0x310d2b[_0x82b8('0x34')]=qs[_0x82b8('0x2c')](_['pick'](_0x35bf6e[_0x82b8('0x2a')],_0x3b2b6f[_0x82b8('0x2c')]));_0x310d2b[_0x82b8('0x34')][_0x82b8('0x69')]=_0x1b958f['id'];if(_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x39')]){_0x310d2b[_0x82b8('0x34')]=_['merge'](_0x310d2b[_0x82b8('0x34')],{'$or':_[_0x82b8('0x3b')](_0x310d2b[_0x82b8('0x2e')],function(_0x5b796a){var _0x9d92c5={};_0x9d92c5[_0x5b796a]={'$like':'%'+_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x39')]+'%'};return _0x9d92c5;})});}if(_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x6a')]){var _0x3d6a40=_0x35bf6e['query'][_0x82b8('0x6a')][_0x82b8('0x6b')](',');var _0xa130db={};_0xa130db[_0x3d6a40[0x0]]={'$gte':moment(_0x3d6a40[0x1])[_0x82b8('0x6c')](_0x82b8('0x6d'))};_0x310d2b[_0x82b8('0x34')]=_[_0x82b8('0x3a')](_0x310d2b[_0x82b8('0x34')],_0xa130db);}_0x310d2b=_[_0x82b8('0x3a')]({},_0x310d2b,_0x35bf6e['options']);return db[_0x82b8('0x45')][_0x82b8('0x4a')]({'where':_0x310d2b['where']})[_0x82b8('0x24')](function(_0x892e0f){_0x492aac[_0x82b8('0x4a')]=_0x892e0f;if(_0x35bf6e[_0x82b8('0x2a')][_0x82b8('0x4b')]){_0x310d2b[_0x82b8('0x41')]=[{'all':!![]}];}return db[_0x82b8('0x45')]['findAll'](_0x310d2b);})[_0x82b8('0x24')](function(_0x409f1d){_0x492aac[_0x82b8('0x5a')]=_0x409f1d;return _0x492aac;});}})[_0x82b8('0x24')](respondWithFilteredResult(_0x3a6d13,_0x310d2b))[_0x82b8('0x5b')](handleError(_0x3a6d13,null));};exports[_0x82b8('0x6e')]=function(_0x41aad8,_0x5d8d14,_0x2733ff){return db[_0x82b8('0x49')]['find']({'where':{'id':_0x41aad8[_0x82b8('0x61')]['id']}})[_0x82b8('0x24')](handleEntityNotFound(_0x5d8d14,null))['then'](function(_0x5e5f84){if(_0x5e5f84){return _0x5e5f84['setTags'](_0x41aad8[_0x82b8('0x60')][_0x82b8('0x64')],_[_0x82b8('0x65')](_0x41aad8['body'],['ids','id'])||{})[_0x82b8('0x6f')](function(){return db[_0x82b8('0x56')][_0x82b8('0x59')]({'attributes':['id',_0x82b8('0x27'),_0x82b8('0x58')],'where':{'id':_0x41aad8[_0x82b8('0x60')]['ids']}});})['then'](function(_0x297963){socket[_0x82b8('0x70')]('openchannelInteractionTags:save',{'id':Number(_0x41aad8[_0x82b8('0x61')]['id']),'tags':_0x297963||[]});return{'id':Number(_0x41aad8[_0x82b8('0x61')]['id']),'tags':_0x297963||[]};});}})[_0x82b8('0x24')](respondWithResult(_0x5d8d14,null))[_0x82b8('0x5b')](handleError(_0x5d8d14,null));};exports[_0x82b8('0x71')]=function(_0x1dcb72,_0x114fcb,_0x37940b){var _0x6baad9;return db[_0x82b8('0x49')][_0x82b8('0x5e')]({'where':{'id':_0x1dcb72[_0x82b8('0x61')]['id']}})[_0x82b8('0x24')](handleEntityNotFound(_0x114fcb,null))[_0x82b8('0x24')](function(_0x28fbad){if(_0x28fbad){return _0x28fbad[_0x82b8('0x71')](_0x1dcb72[_0x82b8('0x2a')]['ids']);}})[_0x82b8('0x24')](respondWithStatusCode(_0x114fcb,null))['catch'](handleError(_0x114fcb,null));};exports[_0x82b8('0x72')]=function(_0x1a6f5b,_0x112574){var _0x4c4669=moment()[_0x82b8('0x73')]()[_0x82b8('0x74')]();var _0x5c03d6=path[_0x82b8('0x75')](config[_0x82b8('0x76')],'server',_0x82b8('0x77'),_0x82b8('0x78'));var _0x25685f=path['join'](config[_0x82b8('0x76')],_0x82b8('0x79'),'files','attachments');var _0x22c85a=path[_0x82b8('0x75')](_0x5c03d6,_0x4c4669);var _0x252e59=util[_0x82b8('0x6c')]('interaction-%s.zip',_0x4c4669);var _0x2a0a71=path[_0x82b8('0x75')](_0x5c03d6,_0x252e59);var _0x7a08d2=![];return db[_0x82b8('0x49')][_0x82b8('0x5e')]({'where':{'id':_0x1a6f5b['params']['id']},'include':[{'model':db[_0x82b8('0x45')],'as':'Messages','attributes':['id',_0x82b8('0x60')],'include':[{'model':db['User'],'as':_0x82b8('0x50'),'attributes':['id',_0x82b8('0x4d')],'raw':!![]},{'model':db['CmContact'],'as':_0x82b8('0x4f'),'attributes':['id',_0x82b8('0x7a')],'raw':!![]},{'model':db[_0x82b8('0x7b')],'as':_0x82b8('0x7b'),'raw':!![]}]}]})[_0x82b8('0x24')](handleEntityNotFound(_0x112574,null))[_0x82b8('0x24')](function(_0xa8ae26){if(_0xa8ae26){_0x7a08d2=!![];var _0x36a0e1='';var _0x936781={'format':_0x82b8('0x7c'),'border':_0x82b8('0x7d')};fs[_0x82b8('0x7e')](_0x22c85a);_0x36a0e1+=util[_0x82b8('0x6c')](_0x82b8('0x7f'),_0xa8ae26['id']);_0x36a0e1+=util[_0x82b8('0x6c')]('<h2>Date:\x20%s</h2>',moment()[_0x82b8('0x6c')](_0x82b8('0x80'))[_0x82b8('0x74')]());_0x36a0e1+=_0x82b8('0x81');for(var _0x2f0ce2=0x0;_0x2f0ce2<_0xa8ae26[_0x82b8('0x55')]['length'];_0x2f0ce2++){var _0x482fbb=_0xa8ae26[_0x82b8('0x55')][_0x2f0ce2];_0x36a0e1+=_0x82b8('0x82');_0x36a0e1+=util[_0x82b8('0x6c')](_0x82b8('0x83'),_0x482fbb[_0x82b8('0x50')]?_0x482fbb[_0x82b8('0x50')][_0x82b8('0x4d')]:_0x482fbb[_0x82b8('0x4f')]['firstName'],_0x482fbb[_0x82b8('0x60')]);_0x36a0e1+=_0x82b8('0x84');if(_0x482fbb[_0x82b8('0x7b')]){var _0x4d5aac=_0x482fbb[_0x82b8('0x7b')];var _0x567f03=path[_0x82b8('0x75')](_0x25685f,_0x4d5aac[_0x82b8('0x85')]);if(fs[_0x82b8('0x86')](_0x567f03)){fs['createReadStream'](_0x567f03)['pipe'](fs[_0x82b8('0x87')](path[_0x82b8('0x75')](_0x22c85a,_0x4d5aac['basename'])));}}}return new BPromise(function(_0x2be9d3,_0x31c1ab){pdf[_0x82b8('0x5f')](_0x36a0e1,_0x936781)[_0x82b8('0x88')](path[_0x82b8('0x75')](_0x22c85a,_0x82b8('0x89')+_0x4c4669+_0x82b8('0x8a')),function(_0x57bb0f,_0x217d12){if(_0x57bb0f)return _0x31c1ab(_0x57bb0f);_0x2be9d3(_0x217d12);});});}})['then'](function(){if(_0x7a08d2){return new BPromise(function(_0x185c4c,_0x302b88){zipdir(_0x22c85a,{'saveTo':_0x2a0a71},function(_0x4405e0,_0xd2065f){if(_0x4405e0)return _0x302b88(_0x4405e0);return _0x185c4c(_0xd2065f);});});}})[_0x82b8('0x24')](function(){if(_0x7a08d2){return new BPromise(function(_0x34fd04,_0x14d787){rimraf(_0x22c85a,function(_0x46e737){if(_0x46e737)_0x14d787(_0x46e737);return _0x34fd04();});});}})[_0x82b8('0x24')](function(){if(_0x7a08d2){return _0x112574['download'](_0x2a0a71,_0x252e59,function(_0x1b651f){if(_0x1b651f){console[_0x82b8('0x8b')]('err',_0x1b651f);}else{fs[_0x82b8('0x8c')](_0x2a0a71);}});}else{return _0x112574['sendStatus'](0xc8);}})['catch'](handleError(_0x112574,null));};
\ No newline at end of file
+var _0x7837=['end','offset','limit','json','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','filter','where','merge','map','key','VIRTUAL','options','include','tag','push','Tag','Tags','read','OpenchannelMessage','Messages','direction','createdAt','distinct','OpenchannelInteraction','count','includeAll','Users','fullname','CmContact','Contact','User','internal','OpenchannelAccount','Account','color','ThroughTags','catch','params','find','create','body','describe','addMessage','ids','omit','findOne','split','format','findAll','addTags','setTags','spread','emit','removeTags','unix','join','root','server','files','tmp','attachments','firstName','Attachment','Letter','1cm','mkdirSync','<h1>Openchannel\x20Interaction:\x20#%d</h1>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','basename','existsSync','createReadStream','pipe','toFile','interaction-','.pdf','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status'];(function(_0x24f4b4,_0x391e24){var _0x185ea6=function(_0x15b994){while(--_0x15b994){_0x24f4b4['push'](_0x24f4b4['shift']());}};_0x185ea6(++_0x391e24);}(_0x7837,0x69));var _0x7783=function(_0x5979a7,_0x2b3150){_0x5979a7=_0x5979a7-0x0;var _0x21b3cf=_0x7837[_0x5979a7];return _0x21b3cf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7783('0x0'));var rimraf=require(_0x7783('0x1'));var zipdir=require(_0x7783('0x2'));var jsonpatch=require(_0x7783('0x3'));var rp=require(_0x7783('0x4'));var moment=require('moment');var BPromise=require(_0x7783('0x5'));var Mustache=require(_0x7783('0x6'));var util=require(_0x7783('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7783('0x8'));var ejs=require(_0x7783('0x9'));var fs=require('fs');var _=require(_0x7783('0xa'));var squel=require('squel');var crypto=require(_0x7783('0xb'));var jsforce=require(_0x7783('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7783('0x8'));var querystring=require('querystring');var Papa=require(_0x7783('0xd'));var Redis=require(_0x7783('0xe'));var qs=require(_0x7783('0xf'));var logger=require(_0x7783('0x10'))('api');var utils=require(_0x7783('0x11'));var config=require('../../config/environment');var db=require(_0x7783('0x12'))['db'];config[_0x7783('0x13')]=_[_0x7783('0x14')](config[_0x7783('0x13')],{'host':_0x7783('0x15'),'port':0x18eb});var socket=require(_0x7783('0x16'))(new Redis(config[_0x7783('0x13')]));require(_0x7783('0x17'))[_0x7783('0x18')](socket);function respondWithStatusCode(_0x591644,_0x132812){_0x132812=_0x132812||0xcc;return function(_0x4a5728){if(_0x4a5728){return _0x591644[_0x7783('0x19')](_0x132812);}return _0x591644[_0x7783('0x1a')](_0x132812)[_0x7783('0x1b')]();};}function respondWithResult(_0x4a3680,_0x1df211){_0x1df211=_0x1df211||0xc8;return function(_0x2e8272){if(_0x2e8272){return _0x4a3680['status'](_0x1df211)['json'](_0x2e8272);}};}function respondWithFilteredResult(_0x2a6565,_0x3427a2){return function(_0x1957f8){if(_0x1957f8){var _0x1ce3e2=_0x1957f8['count'],_0x383153=_0x3427a2[_0x7783('0x1c')],_0x3184ec=_0x3427a2[_0x7783('0x1c')]+_0x3427a2[_0x7783('0x1d')],_0x302c76;if(_0x3184ec>=_0x1ce3e2){_0x3184ec=_0x1ce3e2;_0x302c76=0xc8;}else{_0x302c76=0xce;}_0x2a6565[_0x7783('0x1a')](_0x302c76);return _0x2a6565['set']('Content-Range',_0x383153+'-'+_0x3184ec+'/'+_0x1ce3e2)[_0x7783('0x1e')](_0x1957f8);}return null;};}function patchUpdates(_0x54ad30){return function(_0x21701a){try{jsonpatch[_0x7783('0x1f')](_0x21701a,_0x54ad30,!![]);}catch(_0xeae559){return BPromise[_0x7783('0x20')](_0xeae559);}return _0x21701a[_0x7783('0x21')]();};}function saveUpdates(_0x2da6f2,_0x552963){return function(_0x58d722){if(_0x58d722){return _0x58d722[_0x7783('0x22')](_0x2da6f2)[_0x7783('0x23')](function(_0x1ff732){return _0x1ff732;});}return null;};}function removeEntity(_0x50b915,_0x54f9d0){return function(_0x30a02){if(_0x30a02){return _0x30a02[_0x7783('0x24')]()[_0x7783('0x23')](function(){_0x50b915[_0x7783('0x1a')](0xcc)[_0x7783('0x1b')]();});}};}function handleEntityNotFound(_0x2bfb2e,_0x11569b){return function(_0x3999c6){if(!_0x3999c6){_0x2bfb2e[_0x7783('0x19')](0x194);}return _0x3999c6;};}function handleError(_0x181dd3,_0x53ea2b){_0x53ea2b=_0x53ea2b||0x1f4;return function(_0x919dfb){logger[_0x7783('0x25')](_0x919dfb[_0x7783('0x26')]);if(_0x919dfb[_0x7783('0x27')]){delete _0x919dfb[_0x7783('0x27')];}_0x181dd3[_0x7783('0x1a')](_0x53ea2b)[_0x7783('0x28')](_0x919dfb);};}exports['index']=function(_0x3a9073,_0x4d432c){var _0x11a2f1={},_0x48f206={},_0x54f9c7={'count':0x0,'rows':[]};var _0x37053c=db['OpenchannelInteraction'][_0x7783('0x29')];_0x48f206['model']=_[_0x7783('0x2a')](_0x37053c);var _0x311cd7={'dateStart':_0x3a9073[_0x7783('0x2b')][_0x7783('0x2c')],'dateEnd':_0x3a9073[_0x7783('0x2b')][_0x7783('0x2d')]};delete _0x3a9073[_0x7783('0x2b')]['dateStart'];delete _0x3a9073['query'][_0x7783('0x2d')];_0x48f206['query']=_[_0x7783('0x2a')](_0x3a9073[_0x7783('0x2b')]);_0x48f206[_0x7783('0x2e')]=_[_0x7783('0x2f')](_0x48f206[_0x7783('0x30')],_0x48f206[_0x7783('0x2b')]);_0x11a2f1[_0x7783('0x31')]=_[_0x7783('0x2f')](_0x48f206['model'],qs[_0x7783('0x32')](_0x3a9073[_0x7783('0x2b')][_0x7783('0x32')]));_0x11a2f1[_0x7783('0x31')]=_0x11a2f1[_0x7783('0x31')][_0x7783('0x33')]?_0x11a2f1['attributes']:_0x48f206[_0x7783('0x30')];if(!_0x3a9073['query'][_0x7783('0x34')](_0x7783('0x35'))){_0x11a2f1[_0x7783('0x1d')]=qs['limit'](_0x3a9073[_0x7783('0x2b')][_0x7783('0x1d')]);_0x11a2f1[_0x7783('0x1c')]=qs[_0x7783('0x1c')](_0x3a9073[_0x7783('0x2b')][_0x7783('0x1c')]);}_0x11a2f1[_0x7783('0x36')]=qs['sort'](_0x3a9073[_0x7783('0x2b')][_0x7783('0x37')]);_0x11a2f1['where']=qs['filters'](_[_0x7783('0x38')](_0x3a9073['query'],_0x48f206['filters']));if(_0x311cd7['dateStart']){if(_0x311cd7[_0x7783('0x2d')]){_0x311cd7['dateEnd']=moment(_0x311cd7[_0x7783('0x2d')])[_0x7783('0x39')](0x1,_0x7783('0x3a'));}else{_0x311cd7[_0x7783('0x2d')]=moment(_0x311cd7[_0x7783('0x2c')])[_0x7783('0x39')](0x1,_0x7783('0x3a'));}_['merge'](_0x11a2f1['where'],{'createdAt':{'$gte':_0x311cd7[_0x7783('0x2c')],'$lte':_0x311cd7[_0x7783('0x2d')]}});}if(_0x3a9073['query'][_0x7783('0x3b')]){_0x11a2f1[_0x7783('0x3c')]=_[_0x7783('0x3d')](_0x11a2f1[_0x7783('0x3c')],{'$or':_[_0x7783('0x3e')](_0x37053c,function(_0x4cc1cc){if(_0x4cc1cc['type'][_0x7783('0x3f')]!==_0x7783('0x40')){var _0x5d0ed3={};_0x5d0ed3[_0x4cc1cc['field']]={'$like':'%'+_0x3a9073[_0x7783('0x2b')][_0x7783('0x3b')]+'%'};return _0x5d0ed3;}})});}_0x11a2f1=_['merge']({},_0x11a2f1,_0x3a9073[_0x7783('0x41')]);var _0x217a8e={'where':_0x11a2f1['where']};_0x217a8e[_0x7783('0x42')]=[];if(_0x3a9073[_0x7783('0x2b')][_0x7783('0x43')]){_0x217a8e[_0x7783('0x42')][_0x7783('0x44')]({'model':db[_0x7783('0x45')],'as':_0x7783('0x46'),'attributes':['id'],'where':{'id':_0x3a9073[_0x7783('0x2b')][_0x7783('0x43')]},'required':!![]});_0x217a8e['distinct']=!![];}if(_0x3a9073[_0x7783('0x2b')][_0x7783('0x47')]){_0x217a8e[_0x7783('0x42')]['push']({'model':db[_0x7783('0x48')],'as':_0x7783('0x49'),'attributes':['id',_0x7783('0x4a'),_0x7783('0x4b'),'read'],'where':{'direction':'in','read':_0x3a9073[_0x7783('0x2b')][_0x7783('0x47')]||![]},'required':!![]});_0x217a8e[_0x7783('0x4c')]=!![];}return db[_0x7783('0x4d')]['count'](_0x217a8e)[_0x7783('0x23')](function(_0x993c87){_0x54f9c7[_0x7783('0x4e')]=_0x993c87;if(_0x3a9073['query'][_0x7783('0x4f')]){_0x11a2f1[_0x7783('0x42')]=[{'model':db['User'],'as':_0x7783('0x50'),'required':![],'attributes':['id',_0x7783('0x27'),_0x7783('0x51')]},{'model':db[_0x7783('0x52')],'as':_0x7783('0x53'),'required':![]},{'model':db[_0x7783('0x54')],'as':'Owner','attributes':['name',_0x7783('0x51'),_0x7783('0x55')],'required':![]},{'model':db[_0x7783('0x56')],'as':_0x7783('0x57'),'attributes':[_0x7783('0x27'),_0x7783('0x3f')],'required':![]},{'model':db[_0x7783('0x48')],'as':_0x7783('0x49'),'attributes':['id',_0x7783('0x4a'),_0x7783('0x4b'),'read'],'where':{'direction':'in','read':_0x3a9073['query'][_0x7783('0x47')]||![]},'required':_0x3a9073[_0x7783('0x2b')][_0x7783('0x47')]||![]},{'model':db[_0x7783('0x45')],'as':_0x7783('0x46'),'attributes':['id','name',_0x7783('0x58')],'required':_0x3a9073[_0x7783('0x2b')][_0x7783('0x43')]?!![]:![]},{'model':db[_0x7783('0x45')],'as':_0x7783('0x59'),'attributes':['id',_0x7783('0x27'),_0x7783('0x58')],'through':_0x3a9073[_0x7783('0x2b')]['tag']?{'attributes':[],'where':{'TagId':_0x3a9073[_0x7783('0x2b')][_0x7783('0x43')]||undefined}}:{},'required':_0x3a9073[_0x7783('0x2b')][_0x7783('0x43')]?!![]:![]}];}return db[_0x7783('0x4d')]['findAll'](_0x11a2f1);})[_0x7783('0x23')](function(_0x1a9af0){_0x54f9c7['rows']=_0x1a9af0;return _0x54f9c7;})[_0x7783('0x23')](respondWithFilteredResult(_0x4d432c,_0x11a2f1))[_0x7783('0x5a')](handleError(_0x4d432c,null));};exports['show']=function(_0x2ec0e0,_0x179d94){var _0x285bf3={'raw':![],'where':{'id':_0x2ec0e0[_0x7783('0x5b')]['id']}},_0x15db84={};_0x15db84['model']=_[_0x7783('0x2a')](db[_0x7783('0x4d')][_0x7783('0x29')]);_0x15db84[_0x7783('0x2b')]=_[_0x7783('0x2a')](_0x2ec0e0[_0x7783('0x2b')]);_0x15db84[_0x7783('0x2e')]=_['intersection'](_0x15db84[_0x7783('0x30')],_0x15db84[_0x7783('0x2b')]);_0x285bf3['attributes']=_[_0x7783('0x2f')](_0x15db84[_0x7783('0x30')],qs[_0x7783('0x32')](_0x2ec0e0[_0x7783('0x2b')][_0x7783('0x32')]));_0x285bf3[_0x7783('0x31')]=_0x285bf3[_0x7783('0x31')][_0x7783('0x33')]?_0x285bf3[_0x7783('0x31')]:_0x15db84[_0x7783('0x30')];if(_0x2ec0e0['query']['includeAll']){_0x285bf3[_0x7783('0x42')]=[{'all':!![]}];}_0x285bf3=_[_0x7783('0x3d')]({},_0x285bf3,_0x2ec0e0['options']);return db[_0x7783('0x4d')][_0x7783('0x5c')](_0x285bf3)[_0x7783('0x23')](handleEntityNotFound(_0x179d94,null))[_0x7783('0x23')](respondWithResult(_0x179d94,null))[_0x7783('0x5a')](handleError(_0x179d94,null));};exports[_0x7783('0x5d')]=function(_0x522d71,_0x51aff2){return db[_0x7783('0x4d')][_0x7783('0x5d')](_0x522d71['body'],{})[_0x7783('0x23')](respondWithResult(_0x51aff2,0xc9))[_0x7783('0x5a')](handleError(_0x51aff2,null));};exports[_0x7783('0x22')]=function(_0x1bce37,_0x165195){if(_0x1bce37[_0x7783('0x5e')]['id']){delete _0x1bce37[_0x7783('0x5e')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x1bce37[_0x7783('0x5b')]['id']}})['then'](handleEntityNotFound(_0x165195,null))[_0x7783('0x23')](saveUpdates(_0x1bce37[_0x7783('0x5e')],null))[_0x7783('0x23')](respondWithResult(_0x165195,null))[_0x7783('0x5a')](handleError(_0x165195,null));};exports[_0x7783('0x24')]=function(_0x23b8b8,_0x17fbf4){return db[_0x7783('0x4d')][_0x7783('0x5c')]({'where':{'id':_0x23b8b8[_0x7783('0x5b')]['id']}})[_0x7783('0x23')](handleEntityNotFound(_0x17fbf4,null))[_0x7783('0x23')](removeEntity(_0x17fbf4,null))[_0x7783('0x5a')](handleError(_0x17fbf4,null));};exports[_0x7783('0x5f')]=function(_0x4df9ac,_0x47838){return db[_0x7783('0x4d')][_0x7783('0x5f')]()[_0x7783('0x23')](respondWithResult(_0x47838,null))[_0x7783('0x5a')](handleError(_0x47838,null));};exports[_0x7783('0x60')]=function(_0x4f4ebb,_0x14f6d5,_0x11c8f5){return db[_0x7783('0x48')]['find']({'where':{'id':_0x4f4ebb[_0x7783('0x5b')]['id']}})[_0x7783('0x23')](handleEntityNotFound(_0x14f6d5,null))['then'](function(_0x4a5a3d){if(_0x4a5a3d){return _0x4a5a3d[_0x7783('0x60')](_0x4f4ebb[_0x7783('0x5e')][_0x7783('0x61')],_[_0x7783('0x62')](_0x4f4ebb['body'],[_0x7783('0x61'),'id'])||{});}})[_0x7783('0x23')](respondWithResult(_0x14f6d5,null))[_0x7783('0x5a')](handleError(_0x14f6d5,null));};exports['getMessages']=function(_0x2904f9,_0x49e8d9,_0x41bf79){var _0x14f89e={'raw':![],'where':{}};var _0x400646={};var _0x1d5a28={'count':0x0,'rows':[]};return db[_0x7783('0x4d')][_0x7783('0x63')]({'where':{'id':_0x2904f9[_0x7783('0x5b')]['id']}})[_0x7783('0x23')](handleEntityNotFound(_0x49e8d9,null))[_0x7783('0x23')](function(_0x277fb8){if(_0x277fb8){_0x400646['model']=_[_0x7783('0x2a')](db['OpenchannelMessage'][_0x7783('0x29')]);_0x400646[_0x7783('0x2b')]=_['keys'](_0x2904f9[_0x7783('0x2b')]);_0x400646['filters']=_[_0x7783('0x2f')](_0x400646[_0x7783('0x30')],_0x400646[_0x7783('0x2b')]);_0x14f89e[_0x7783('0x31')]=_[_0x7783('0x2f')](_0x400646[_0x7783('0x30')],qs[_0x7783('0x32')](_0x2904f9[_0x7783('0x2b')][_0x7783('0x32')]));_0x14f89e[_0x7783('0x31')]=_0x14f89e['attributes'][_0x7783('0x33')]?_0x14f89e[_0x7783('0x31')]:_0x400646[_0x7783('0x30')];if(!_0x2904f9[_0x7783('0x2b')][_0x7783('0x34')](_0x7783('0x35'))){_0x14f89e[_0x7783('0x1d')]=qs[_0x7783('0x1d')](_0x2904f9[_0x7783('0x2b')]['limit']);_0x14f89e[_0x7783('0x1c')]=qs[_0x7783('0x1c')](_0x2904f9[_0x7783('0x2b')]['offset']);}_0x14f89e['order']=qs['sort'](_0x2904f9[_0x7783('0x2b')][_0x7783('0x37')]);_0x14f89e['where']=qs['filters'](_[_0x7783('0x38')](_0x2904f9['query'],_0x400646[_0x7783('0x2e')]));_0x14f89e['where']['OpenchannelInteractionId']=_0x277fb8['id'];if(_0x2904f9[_0x7783('0x2b')]['filter']){_0x14f89e['where']=_[_0x7783('0x3d')](_0x14f89e[_0x7783('0x3c')],{'$or':_['map'](_0x14f89e[_0x7783('0x31')],function(_0x24bb17){var _0x5d58b0={};_0x5d58b0[_0x24bb17]={'$like':'%'+_0x2904f9['query'][_0x7783('0x3b')]+'%'};return _0x5d58b0;})});}if(_0x2904f9[_0x7783('0x2b')]['$gte']){var _0x3979a3=_0x2904f9[_0x7783('0x2b')]['$gte'][_0x7783('0x64')](',');var _0x3ec81c={};_0x3ec81c[_0x3979a3[0x0]]={'$gte':moment(_0x3979a3[0x1])[_0x7783('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};_0x14f89e[_0x7783('0x3c')]=_[_0x7783('0x3d')](_0x14f89e[_0x7783('0x3c')],_0x3ec81c);}_0x14f89e=_['merge']({},_0x14f89e,_0x2904f9[_0x7783('0x41')]);return db[_0x7783('0x48')][_0x7783('0x4e')]({'where':_0x14f89e['where']})[_0x7783('0x23')](function(_0x761492){_0x1d5a28['count']=_0x761492;if(_0x2904f9[_0x7783('0x2b')][_0x7783('0x4f')]){_0x14f89e['include']=[{'all':!![]}];}return db[_0x7783('0x48')][_0x7783('0x66')](_0x14f89e);})[_0x7783('0x23')](function(_0x4630cf){_0x1d5a28['rows']=_0x4630cf;return _0x1d5a28;});}})['then'](respondWithFilteredResult(_0x49e8d9,_0x14f89e))[_0x7783('0x5a')](handleError(_0x49e8d9,null));};exports[_0x7783('0x67')]=function(_0xc077dc,_0x5777f3,_0x42e18f){return db[_0x7783('0x4d')]['find']({'where':{'id':_0xc077dc[_0x7783('0x5b')]['id']}})[_0x7783('0x23')](handleEntityNotFound(_0x5777f3,null))[_0x7783('0x23')](function(_0x5676e6){if(_0x5676e6){return _0x5676e6[_0x7783('0x68')](_0xc077dc[_0x7783('0x5e')]['ids'],_[_0x7783('0x62')](_0xc077dc[_0x7783('0x5e')],[_0x7783('0x61'),'id'])||{})[_0x7783('0x69')](function(){return db[_0x7783('0x45')][_0x7783('0x66')]({'attributes':['id','name',_0x7783('0x58')],'where':{'id':_0xc077dc['body'][_0x7783('0x61')]}});})[_0x7783('0x23')](function(_0x162fc4){socket[_0x7783('0x6a')]('openchannelInteractionTags:save',{'id':Number(_0xc077dc[_0x7783('0x5b')]['id']),'tags':_0x162fc4||[]});return{'id':Number(_0xc077dc[_0x7783('0x5b')]['id']),'tags':_0x162fc4||[]};});}})[_0x7783('0x23')](respondWithResult(_0x5777f3,null))[_0x7783('0x5a')](handleError(_0x5777f3,null));};exports[_0x7783('0x6b')]=function(_0x5d4e34,_0x110b6e,_0x59d088){var _0x1119b4;return db[_0x7783('0x4d')]['find']({'where':{'id':_0x5d4e34['params']['id']}})[_0x7783('0x23')](handleEntityNotFound(_0x110b6e,null))['then'](function(_0x49c635){if(_0x49c635){return _0x49c635['removeTags'](_0x5d4e34[_0x7783('0x2b')][_0x7783('0x61')]);}})['then'](respondWithStatusCode(_0x110b6e,null))[_0x7783('0x5a')](handleError(_0x110b6e,null));};exports['download']=function(_0x276366,_0x5c8a70){var _0x53a6e8=moment()[_0x7783('0x6c')]()['toString']();var _0x2a67dc=path[_0x7783('0x6d')](config[_0x7783('0x6e')],_0x7783('0x6f'),_0x7783('0x70'),_0x7783('0x71'));var _0x206386=path[_0x7783('0x6d')](config['root'],_0x7783('0x6f'),_0x7783('0x70'),_0x7783('0x72'));var _0x6ee78f=path['join'](_0x2a67dc,_0x53a6e8);var _0x22147a=util[_0x7783('0x65')]('interaction-%s.zip',_0x53a6e8);var _0x43b89d=path[_0x7783('0x6d')](_0x2a67dc,_0x22147a);var _0x3726a2=![];return db[_0x7783('0x4d')][_0x7783('0x5c')]({'where':{'id':_0x276366[_0x7783('0x5b')]['id']},'include':[{'model':db[_0x7783('0x48')],'as':_0x7783('0x49'),'attributes':['id','body'],'include':[{'model':db[_0x7783('0x54')],'as':_0x7783('0x54'),'attributes':['id',_0x7783('0x51')],'raw':!![]},{'model':db[_0x7783('0x52')],'as':'Contact','attributes':['id',_0x7783('0x73')],'raw':!![]},{'model':db[_0x7783('0x74')],'as':_0x7783('0x74'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5c8a70,null))[_0x7783('0x23')](function(_0x47b847){if(_0x47b847){_0x3726a2=!![];var _0x19875a='';var _0x42dcac={'format':_0x7783('0x75'),'border':_0x7783('0x76')};fs[_0x7783('0x77')](_0x6ee78f);_0x19875a+=util[_0x7783('0x65')](_0x7783('0x78'),_0x47b847['id']);_0x19875a+=util[_0x7783('0x65')]('<h2>Date:\x20%s</h2>',moment()[_0x7783('0x65')]('MMMM\x20Do\x20YYYY,\x20HH:mm:ss')['toString']());_0x19875a+='<hr>';for(var _0x25e0a1=0x0;_0x25e0a1<_0x47b847['Messages'][_0x7783('0x33')];_0x25e0a1++){var _0x115227=_0x47b847[_0x7783('0x49')][_0x25e0a1];_0x19875a+=_0x7783('0x79');_0x19875a+=util[_0x7783('0x65')](_0x7783('0x7a'),_0x115227[_0x7783('0x54')]?_0x115227[_0x7783('0x54')][_0x7783('0x51')]:_0x115227[_0x7783('0x53')][_0x7783('0x73')],_0x115227[_0x7783('0x5e')]);_0x19875a+=_0x7783('0x7b');if(_0x115227[_0x7783('0x74')]){var _0x487e7a=_0x115227[_0x7783('0x74')];var _0x62c8a7=path[_0x7783('0x6d')](_0x206386,_0x487e7a[_0x7783('0x7c')]);if(fs[_0x7783('0x7d')](_0x62c8a7)){fs[_0x7783('0x7e')](_0x62c8a7)[_0x7783('0x7f')](fs['createWriteStream'](path['join'](_0x6ee78f,_0x487e7a[_0x7783('0x7c')])));}}}return new BPromise(function(_0x46a34e,_0x28841f){pdf[_0x7783('0x5d')](_0x19875a,_0x42dcac)[_0x7783('0x80')](path[_0x7783('0x6d')](_0x6ee78f,_0x7783('0x81')+_0x53a6e8+_0x7783('0x82')),function(_0x529da2,_0x5b41ce){if(_0x529da2)return _0x28841f(_0x529da2);_0x46a34e(_0x5b41ce);});});}})[_0x7783('0x23')](function(){if(_0x3726a2){return new BPromise(function(_0x589c62,_0x2bfb0f){zipdir(_0x6ee78f,{'saveTo':_0x43b89d},function(_0x2da8d3,_0x36eb7f){if(_0x2da8d3)return _0x2bfb0f(_0x2da8d3);return _0x589c62(_0x36eb7f);});});}})[_0x7783('0x23')](function(){if(_0x3726a2){return new BPromise(function(_0x574bbc,_0x3663d1){rimraf(_0x6ee78f,function(_0x5f2700){if(_0x5f2700)_0x3663d1(_0x5f2700);return _0x574bbc();});});}})[_0x7783('0x23')](function(){if(_0x3726a2){return _0x5c8a70['download'](_0x43b89d,_0x22147a,function(_0x7655b3){if(_0x7655b3){console[_0x7783('0x83')]('err',_0x7655b3);}else{fs['unlinkSync'](_0x43b89d);}});}else{return _0x5c8a70[_0x7783('0x19')](0xc8);}})[_0x7783('0x5a')](handleError(_0x5c8a70,null));};
\ No newline at end of file
index 50cb0be..61d052f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7947=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners'];(function(_0xcbd776,_0x302fe8){var _0x13d4b4=function(_0x5b8046){while(--_0x5b8046){_0xcbd776['push'](_0xcbd776['shift']());}};_0x13d4b4(++_0x302fe8);}(_0x7947,0x146));var _0x7794=function(_0x559ecc,_0x591615){_0x559ecc=_0x559ecc-0x0;var _0x16dd7b=_0x7947[_0x559ecc];return _0x16dd7b;};'use strict';var EventEmitter=require(_0x7794('0x0'));var OpenchannelInteraction=require(_0x7794('0x1'))['db'][_0x7794('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x7794('0x3')](0x0);var events={'afterCreate':_0x7794('0x4'),'afterUpdate':_0x7794('0x5'),'afterDestroy':_0x7794('0x6')};function emitEvent(_0x1a8f8d){return function(_0x4338ee,_0x5af573,_0x89cd57){OpenchannelInteractionEvents['emit'](_0x1a8f8d+':'+_0x4338ee['id'],_0x4338ee);OpenchannelInteractionEvents[_0x7794('0x7')](_0x1a8f8d,_0x4338ee);_0x89cd57(null);};}for(var e in events){if(events[_0x7794('0x8')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x7794('0x9')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x7efd=['update','remove','emit','hasOwnProperty','exports','events','OpenchannelInteraction','setMaxListeners'];(function(_0x3439b4,_0x3c235c){var _0x38d9f8=function(_0x4a3a54){while(--_0x4a3a54){_0x3439b4['push'](_0x3439b4['shift']());}};_0x38d9f8(++_0x3c235c);}(_0x7efd,0x19d));var _0xd7ef=function(_0x3bbe75,_0x18c3a5){_0x3bbe75=_0x3bbe75-0x0;var _0x5226f0=_0x7efd[_0x3bbe75];return _0x5226f0;};'use strict';var EventEmitter=require(_0xd7ef('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xd7ef('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd7ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd7ef('0x3'),'afterDestroy':_0xd7ef('0x4')};function emitEvent(_0x5cb970){return function(_0x251062,_0x2b937b,_0x5d535a){OpenchannelInteractionEvents[_0xd7ef('0x5')](_0x5cb970+':'+_0x251062['id'],_0x251062);OpenchannelInteractionEvents['emit'](_0x5cb970,_0x251062);_0x5d535a(null);};}for(var e in events){if(events[_0xd7ef('0x6')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xd7ef('0x7')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 59e3358..b2cf770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4b1=['util','../../config/logger','moment','bluebird','request-promise','exports','define','lodash'];(function(_0x59ae80,_0x56b205){var _0x473bf9=function(_0x2f484e){while(--_0x2f484e){_0x59ae80['push'](_0x59ae80['shift']());}};_0x473bf9(++_0x56b205);}(_0xa4b1,0xc7));var _0x1a4b=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xa4b1[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require(_0x1a4b('0x0'));var util=require(_0x1a4b('0x1'));var logger=require(_0x1a4b('0x2'))('api');var moment=require(_0x1a4b('0x3'));var BPromise=require(_0x1a4b('0x4'));var rp=require(_0x1a4b('0x5'));var attributes=require('./openchannelInteraction.attributes');module[_0x1a4b('0x6')]=function(_0x2d8a09,_0x3787c8){return _0x2d8a09[_0x1a4b('0x7')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6fdf=['moment','request-promise','exports','define','OpenchannelInteraction','openchannel_interactions','api'];(function(_0x3850ec,_0x1d8daf){var _0x2f2a54=function(_0x36e78b){while(--_0x36e78b){_0x3850ec['push'](_0x3850ec['shift']());}};_0x2f2a54(++_0x1d8daf);}(_0x6fdf,0xca));var _0xf6fd=function(_0x1e018e,_0x1a75cc){_0x1e018e=_0x1e018e-0x0;var _0x13f093=_0x6fdf[_0x1e018e];return _0x13f093;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf6fd('0x0'));var moment=require(_0xf6fd('0x1'));var BPromise=require('bluebird');var rp=require(_0xf6fd('0x2'));var attributes=require('./openchannelInteraction.attributes');module[_0xf6fd('0x3')]=function(_0x41326d,_0x3cc081){return _0x41326d[_0xf6fd('0x4')](_0xf6fd('0x5'),attributes,{'tableName':_0xf6fd('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce74e11..5486334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3435=['info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','then','catch','AddTagsToOpenchannelInteraction','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request'];(function(_0x295a3d,_0x56d487){var _0x23a732=function(_0x15cfc2){while(--_0x15cfc2){_0x295a3d['push'](_0x295a3d['shift']());}};_0x23a732(++_0x56d487);}(_0x3435,0xfa));var _0x5343=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x3435[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var moment=require(_0x5343('0x2'));var BPromise=require(_0x5343('0x3'));var rs=require(_0x5343('0x4'));var fs=require('fs');var Redis=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5343('0x6'));var logger=require(_0x5343('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5343('0x8'));var client=jayson[_0x5343('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5343('0xa')](config[_0x5343('0xb')],{'host':_0x5343('0xc'),'port':0x18eb});var socket=require(_0x5343('0xd'))(new Redis(config[_0x5343('0xb')]));require('./openchannelInteraction.socket')[_0x5343('0xe')](socket);function respondWithRpcPromise(_0x50d857,_0x1b310a,_0x328e54){return new BPromise(function(_0x27ed68,_0x2e6df1){return client[_0x5343('0xf')](_0x50d857,_0x328e54)['then'](function(_0x42a94a){logger[_0x5343('0x10')](_0x5343('0x11'),_0x1b310a,'request\x20sent');logger[_0x5343('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'),JSON[_0x5343('0x14')](_0x42a94a));if(_0x42a94a['error']){if(_0x42a94a[_0x5343('0x15')]['code']===0x1f4){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x2e6df1(_0x42a94a['error'][_0x5343('0x16')]);}logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x27ed68(_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);}else{logger[_0x5343('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'));_0x27ed68(_0x42a94a[_0x5343('0x17')][_0x5343('0x16')]);}})['catch'](function(_0x1eb3bd){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x1eb3bd);_0x2e6df1(_0x1eb3bd);});});}exports[_0x5343('0x18')]=function(_0x35e68c){var _0xd93241=this;return new Promise(function(_0x132505,_0x40ba38){return db[_0x5343('0x19')]['update'](_0x35e68c[_0x5343('0x1a')],{'raw':_0x35e68c[_0x5343('0x1b')]?_0x35e68c[_0x5343('0x1b')][_0x5343('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e68c[_0x5343('0x1b')]?_0x35e68c['options'][_0x5343('0x1d')]||null:null,'attributes':_0x35e68c[_0x5343('0x1b')]?_0x35e68c[_0x5343('0x1b')][_0x5343('0x1e')]||null:null,'limit':_0x35e68c[_0x5343('0x1b')]?_0x35e68c['options'][_0x5343('0x1f')]||null:null})[_0x5343('0x20')](function(_0x584034){logger[_0x5343('0x10')](_0x5343('0x18'),_0x35e68c);logger[_0x5343('0x12')]('UpdateOpenchannelInteraction',_0x35e68c,JSON['stringify'](_0x584034));_0x132505(_0x584034);})[_0x5343('0x21')](function(_0x5871de){logger[_0x5343('0x15')]('UpdateOpenchannelInteraction',_0x5871de[_0x5343('0x16')],_0x35e68c);_0x40ba38(_0xd93241['error'](0x1f4,_0x5871de['message']));});});};exports[_0x5343('0x22')]=function(_0x4cb858){return new Promise(function(_0x551bf4,_0x5d597e){return db[_0x5343('0x19')]['find']({'where':_0x4cb858[_0x5343('0x1b')]?_0x4cb858['options']['where']||null:null})[_0x5343('0x20')](function(_0x5b44d7){if(_0x5b44d7){return _0x5b44d7['addTags'](_0x4cb858[_0x5343('0x1a')][_0x5343('0x23')],_[_0x5343('0x24')](_0x4cb858[_0x5343('0x1a')],['ids','id'])||{});}})['spread'](function(_0x1f8ee9){logger[_0x5343('0x10')](_0x5343('0x25'),_0x4cb858);logger[_0x5343('0x12')](_0x5343('0x25'),_0x4cb858,JSON[_0x5343('0x14')](_0x1f8ee9));_0x551bf4(_0x1f8ee9);})[_0x5343('0x21')](function(_0x3e4f8f){logger[_0x5343('0x15')](_0x5343('0x25'),_0x3e4f8f[_0x5343('0x16')],_0x4cb858);_0x5d597e(_this[_0x5343('0x15')](0x1f4,_0x3e4f8f['message']));});});};
\ No newline at end of file
+var _0x3435=['info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','then','catch','AddTagsToOpenchannelInteraction','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x3435,0xfa));var _0x5343=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x3435[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var moment=require(_0x5343('0x2'));var BPromise=require(_0x5343('0x3'));var rs=require(_0x5343('0x4'));var fs=require('fs');var Redis=require(_0x5343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5343('0x6'));var logger=require(_0x5343('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5343('0x8'));var client=jayson[_0x5343('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5343('0xa')](config[_0x5343('0xb')],{'host':_0x5343('0xc'),'port':0x18eb});var socket=require(_0x5343('0xd'))(new Redis(config[_0x5343('0xb')]));require('./openchannelInteraction.socket')[_0x5343('0xe')](socket);function respondWithRpcPromise(_0x50d857,_0x1b310a,_0x328e54){return new BPromise(function(_0x27ed68,_0x2e6df1){return client[_0x5343('0xf')](_0x50d857,_0x328e54)['then'](function(_0x42a94a){logger[_0x5343('0x10')](_0x5343('0x11'),_0x1b310a,'request\x20sent');logger[_0x5343('0x12')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'),JSON[_0x5343('0x14')](_0x42a94a));if(_0x42a94a['error']){if(_0x42a94a[_0x5343('0x15')]['code']===0x1f4){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x2e6df1(_0x42a94a['error'][_0x5343('0x16')]);}logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);return _0x27ed68(_0x42a94a[_0x5343('0x15')][_0x5343('0x16')]);}else{logger[_0x5343('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1b310a,_0x5343('0x13'));_0x27ed68(_0x42a94a[_0x5343('0x17')][_0x5343('0x16')]);}})['catch'](function(_0x1eb3bd){logger[_0x5343('0x15')](_0x5343('0x11'),_0x1b310a,_0x1eb3bd);_0x2e6df1(_0x1eb3bd);});});}exports[_0x5343('0x18')]=function(_0x35e68c){var _0xd93241=this;return new Promise(function(_0x132505,_0x40ba38){return db[_0x5343('0x19')]['update'](_0x35e68c[_0x5343('0x1a')],{'raw':_0x35e68c[_0x5343('0x1b')]?_0x35e68c[_0x5343('0x1b')][_0x5343('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e68c[_0x5343('0x1b')]?_0x35e68c['options'][_0x5343('0x1d')]||null:null,'attributes':_0x35e68c[_0x5343('0x1b')]?_0x35e68c[_0x5343('0x1b')][_0x5343('0x1e')]||null:null,'limit':_0x35e68c[_0x5343('0x1b')]?_0x35e68c['options'][_0x5343('0x1f')]||null:null})[_0x5343('0x20')](function(_0x584034){logger[_0x5343('0x10')](_0x5343('0x18'),_0x35e68c);logger[_0x5343('0x12')]('UpdateOpenchannelInteraction',_0x35e68c,JSON['stringify'](_0x584034));_0x132505(_0x584034);})[_0x5343('0x21')](function(_0x5871de){logger[_0x5343('0x15')]('UpdateOpenchannelInteraction',_0x5871de[_0x5343('0x16')],_0x35e68c);_0x40ba38(_0xd93241['error'](0x1f4,_0x5871de['message']));});});};exports[_0x5343('0x22')]=function(_0x4cb858){return new Promise(function(_0x551bf4,_0x5d597e){return db[_0x5343('0x19')]['find']({'where':_0x4cb858[_0x5343('0x1b')]?_0x4cb858['options']['where']||null:null})[_0x5343('0x20')](function(_0x5b44d7){if(_0x5b44d7){return _0x5b44d7['addTags'](_0x4cb858[_0x5343('0x1a')][_0x5343('0x23')],_[_0x5343('0x24')](_0x4cb858[_0x5343('0x1a')],['ids','id'])||{});}})['spread'](function(_0x1f8ee9){logger[_0x5343('0x10')](_0x5343('0x25'),_0x4cb858);logger[_0x5343('0x12')](_0x5343('0x25'),_0x4cb858,JSON[_0x5343('0x14')](_0x1f8ee9));_0x551bf4(_0x1f8ee9);})[_0x5343('0x21')](function(_0x3e4f8f){logger[_0x5343('0x15')](_0x5343('0x25'),_0x3e4f8f[_0x5343('0x16')],_0x4cb858);_0x5d597e(_this[_0x5343('0x15')](0x1f4,_0x3e4f8f['message']));});});};
\ No newline at end of file
index 18f6a71..724430e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af8=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','remove'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x9af8,0x14e));var _0x89af=function(_0x1292ef,_0x2e2781){_0x1292ef=_0x1292ef-0x0;var _0x264248=_0x9af8[_0x1292ef];return _0x264248;};'use strict';var OpenchannelInteractionEvents=require(_0x89af('0x0'));var events=['save',_0x89af('0x1'),_0x89af('0x2')];function createListener(_0x3c41d5,_0x17f6f9){return function(_0x237791){_0x17f6f9[_0x89af('0x3')](_0x3c41d5,_0x237791);};}function removeListener(_0x27a0b1,_0xbdee3b){return function(){OpenchannelInteractionEvents[_0x89af('0x4')](_0x27a0b1,_0xbdee3b);};}exports[_0x89af('0x5')]=function(_0x78eb52){for(var _0x22269c=0x0,_0x43c44e=events[_0x89af('0x6')];_0x22269c<_0x43c44e;_0x22269c++){var _0x3052f9=events[_0x22269c];var _0x557936=createListener(_0x89af('0x7')+_0x3052f9,_0x78eb52);OpenchannelInteractionEvents['on'](_0x3052f9,_0x557936);}};
\ No newline at end of file
+var _0x587f=['save','removeListener','register','length','openchannelInteraction:'];(function(_0x3239f5,_0x50e77c){var _0x3559c8=function(_0x4f9f83){while(--_0x4f9f83){_0x3239f5['push'](_0x3239f5['shift']());}};_0x3559c8(++_0x50e77c);}(_0x587f,0x14f));var _0xf587=function(_0x43fda2,_0x1c5662){_0x43fda2=_0x43fda2-0x0;var _0xa492a2=_0x587f[_0x43fda2];return _0xa492a2;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xf587('0x0'),'remove','update'];function createListener(_0x3d8624,_0x25be05){return function(_0x52a303){_0x25be05['emit'](_0x3d8624,_0x52a303);};}function removeListener(_0x1480a4,_0x26f3e5){return function(){OpenchannelInteractionEvents[_0xf587('0x1')](_0x1480a4,_0x26f3e5);};}exports[_0xf587('0x2')]=function(_0x1c3873){for(var _0x39ad0a=0x0,_0x64898e=events[_0xf587('0x3')];_0x39ad0a<_0x64898e;_0x39ad0a++){var _0x310287=events[_0x39ad0a];var _0x686829=createListener(_0xf587('0x4')+_0x310287,_0x1c3873);OpenchannelInteractionEvents['on'](_0x310287,_0x686829);}};
\ No newline at end of file
index 32b58a2..8859ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e67=['reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','/:id/accept','accept','put','/:id/reject'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x5e67,0x70));var _0x75e6=function(_0x502056,_0x2e7f78){_0x502056=_0x502056-0x0;var _0x53ddde=_0x5e67[_0x502056];return _0x53ddde;};'use strict';var multer=require(_0x75e6('0x0'));var util=require(_0x75e6('0x1'));var path=require(_0x75e6('0x2'));var timeout=require(_0x75e6('0x3'));var express=require(_0x75e6('0x4'));var router=express[_0x75e6('0x5')]();var auth=require(_0x75e6('0x6'));var interaction=require(_0x75e6('0x7'));var config=require(_0x75e6('0x8'));var controller=require(_0x75e6('0x9'));router[_0x75e6('0xa')]('/',auth[_0x75e6('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x75e6('0xc')]);router['get'](_0x75e6('0xd'),auth[_0x75e6('0xb')](),controller[_0x75e6('0xe')]);router[_0x75e6('0xf')]('/',auth['isAuthenticated'](),interaction[_0x75e6('0x10')](_0x75e6('0x11'),_0x75e6('0x12')),controller['create']);router['put'](_0x75e6('0xd'),auth[_0x75e6('0xb')](),controller['update']);router['put'](_0x75e6('0x13'),auth[_0x75e6('0xb')](),controller[_0x75e6('0x14')]);router[_0x75e6('0x15')](_0x75e6('0x16'),auth[_0x75e6('0xb')](),controller[_0x75e6('0x17')]);router[_0x75e6('0x18')]('/:id',auth[_0x75e6('0xb')](),controller[_0x75e6('0x19')]);module[_0x75e6('0x1a')]=router;
\ No newline at end of file
+var _0xffa2=['index','/describe','/:id','post','tracked','openchannel','create','put','update','/:id/reject','reject','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0xffa2,0x150));var _0x2ffa=function(_0x3480d0,_0x23a2bd){_0x3480d0=_0x3480d0-0x0;var _0x443c51=_0xffa2[_0x3480d0];return _0x443c51;};'use strict';var multer=require(_0x2ffa('0x0'));var util=require(_0x2ffa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2ffa('0x2'));var router=express[_0x2ffa('0x3')]();var auth=require(_0x2ffa('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2ffa('0x5'));var controller=require(_0x2ffa('0x6'));router[_0x2ffa('0x7')]('/',auth[_0x2ffa('0x8')](),controller[_0x2ffa('0x9')]);router['get'](_0x2ffa('0xa'),auth[_0x2ffa('0x8')](),controller['describe']);router['get'](_0x2ffa('0xb'),auth[_0x2ffa('0x8')](),controller['show']);router[_0x2ffa('0xc')]('/',auth[_0x2ffa('0x8')](),interaction[_0x2ffa('0xd')](_0x2ffa('0xe'),'openchannelmessage:create'),controller[_0x2ffa('0xf')]);router[_0x2ffa('0x10')](_0x2ffa('0xb'),auth[_0x2ffa('0x8')](),controller[_0x2ffa('0x11')]);router[_0x2ffa('0x10')]('/:id/accept',auth[_0x2ffa('0x8')](),controller['accept']);router['put'](_0x2ffa('0x12'),auth[_0x2ffa('0x8')](),controller[_0x2ffa('0x13')]);router[_0x2ffa('0x14')](_0x2ffa('0xb'),auth[_0x2ffa('0x8')](),controller[_0x2ffa('0x15')]);module[_0x2ffa('0x16')]=router;
\ No newline at end of file
index 0b96cc5..9caa37a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb2b=['TEXT','medium','BOOLEAN','ENUM','out','sequelize','exports'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xeb2b,0x10f));var _0xbeb2=function(_0x200f29,_0x3af579){_0x200f29=_0x200f29-0x0;var _0x200077=_0xeb2b[_0x200f29];return _0x200077;};'use strict';var Sequelize=require(_0xbeb2('0x0'));module[_0xbeb2('0x1')]={'body':{'type':Sequelize[_0xbeb2('0x2')](_0xbeb2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbeb2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xbeb2('0x5')]('in',_0xbeb2('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x4623=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE'];(function(_0x5bab8e,_0x5a9ed6){var _0x3e14ea=function(_0x3d5948){while(--_0x3d5948){_0x5bab8e['push'](_0x5bab8e['shift']());}};_0x3e14ea(++_0x5a9ed6);}(_0x4623,0x12d));var _0x3462=function(_0x34d069,_0xcc9217){_0x34d069=_0x34d069-0x0;var _0x290f39=_0x4623[_0x34d069];return _0x290f39;};'use strict';var Sequelize=require(_0x3462('0x0'));module[_0x3462('0x1')]={'body':{'type':Sequelize[_0x3462('0x2')](_0x3462('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3462('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3462('0x5')),'defaultValue':_0x3462('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3462('0x6')]}};
\ No newline at end of file
index 8ad4b13..9fc330f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33ee=['register','jayson/promise','http','client','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','index','OpenchannelMessage','rawAttributes','model','keys','query','dateStart','dateEnd','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','add','day','merge','type','key','VIRTUAL','field','options','count','includeAll','include','rows','show','params','length','find','body','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','manual','interface','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket'];(function(_0x21125f,_0x8079f8){var _0x2f421d=function(_0x231299){while(--_0x231299){_0x21125f['push'](_0x21125f['shift']());}};_0x2f421d(++_0x8079f8);}(_0x33ee,0xde));var _0xe33e=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x33ee[_0x255d5b];return _0x3e141a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe33e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe33e('0x1'));var jsonpatch=require(_0xe33e('0x2'));var rp=require(_0xe33e('0x3'));var moment=require(_0xe33e('0x4'));var BPromise=require(_0xe33e('0x5'));var Mustache=require(_0xe33e('0x6'));var util=require('util');var path=require(_0xe33e('0x7'));var sox=require(_0xe33e('0x8'));var csv=require(_0xe33e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe33e('0xa'));var squel=require(_0xe33e('0xb'));var crypto=require(_0xe33e('0xc'));var jsforce=require(_0xe33e('0xd'));var deskjs=require(_0xe33e('0xe'));var toCsv=require(_0xe33e('0x9'));var querystring=require(_0xe33e('0xf'));var Papa=require('papaparse');var Redis=require(_0xe33e('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xe33e('0x11'));var utils=require('../../config/utils');var config=require(_0xe33e('0x12'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe33e('0x13')](config[_0xe33e('0x14')],{'host':_0xe33e('0x15'),'port':0x18eb});var socket=require(_0xe33e('0x16'))(new Redis(config[_0xe33e('0x14')]));require(_0xe33e('0x17'))[_0xe33e('0x18')](socket);var jayson=require(_0xe33e('0x19'));var client=jayson['client'][_0xe33e('0x1a')]({'port':0x232c});var client9002=jayson[_0xe33e('0x1b')][_0xe33e('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x47537d,_0x14026a,_0xfc4032,_0x2eca6c){return new BPromise(function(_0x4bee51,_0x5bb82e){var _0x1a14f7=_0x2eca6c||client;return _0x1a14f7[_0xe33e('0x1c')](_0x47537d,_0xfc4032)['then'](function(_0x5c27b5){logger[_0xe33e('0x1d')](_0xe33e('0x1e'),_0x14026a,_0xe33e('0x1f'));logger['debug'](_0xe33e('0x20'),_0x14026a,_0xe33e('0x1f'),JSON[_0xe33e('0x21')](_0x5c27b5));if(_0x5c27b5['error']){if(_0x5c27b5['error'][_0xe33e('0x22')]===0x1f4){logger[_0xe33e('0x23')](_0xe33e('0x1e'),_0x14026a,_0x5c27b5[_0xe33e('0x23')][_0xe33e('0x24')]);return _0x5bb82e(_0x5c27b5['error'][_0xe33e('0x24')]);}logger[_0xe33e('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x14026a,_0x5c27b5[_0xe33e('0x23')][_0xe33e('0x24')]);return _0x4bee51(_0x5c27b5['error']['message']);}else{logger[_0xe33e('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x14026a,_0xe33e('0x1f'));_0x4bee51(_0x5c27b5[_0xe33e('0x25')][_0xe33e('0x24')]);}})[_0xe33e('0x26')](function(_0x4d213d){logger[_0xe33e('0x23')](_0xe33e('0x1e'),_0x14026a,_0x4d213d);_0x5bb82e(_0x4d213d);});});}function respondWithStatusCode(_0x29682b,_0x2b9447){_0x2b9447=_0x2b9447||0xcc;return function(_0x54554c){if(_0x54554c){return _0x29682b[_0xe33e('0x27')](_0x2b9447);}return _0x29682b[_0xe33e('0x28')](_0x2b9447)[_0xe33e('0x29')]();};}function respondWithResult(_0x510bcc,_0x24df53){_0x24df53=_0x24df53||0xc8;return function(_0x32ff0a){if(_0x32ff0a){return _0x510bcc['status'](_0x24df53)['json'](_0x32ff0a);}};}function respondWithFilteredResult(_0x497d70,_0x9edc87){return function(_0x470a31){if(_0x470a31){var _0x574e62=_0x470a31['count'],_0x450c1d=_0x9edc87[_0xe33e('0x2a')],_0x19f03c=_0x9edc87['offset']+_0x9edc87[_0xe33e('0x2b')],_0x3599bd;if(_0x19f03c>=_0x574e62){_0x19f03c=_0x574e62;_0x3599bd=0xc8;}else{_0x3599bd=0xce;}_0x497d70[_0xe33e('0x28')](_0x3599bd);return _0x497d70[_0xe33e('0x2c')](_0xe33e('0x2d'),_0x450c1d+'-'+_0x19f03c+'/'+_0x574e62)[_0xe33e('0x2e')](_0x470a31);}return null;};}function patchUpdates(_0x205312){return function(_0x3739a7){try{jsonpatch[_0xe33e('0x2f')](_0x3739a7,_0x205312,!![]);}catch(_0x3936ab){return BPromise[_0xe33e('0x30')](_0x3936ab);}return _0x3739a7[_0xe33e('0x31')]();};}function saveUpdates(_0x10c7e5,_0x4f4fef){return function(_0x218872){if(_0x218872){return _0x218872[_0xe33e('0x32')](_0x10c7e5)['then'](function(_0x250bee){return _0x250bee;});}return null;};}function removeEntity(_0x1535ff,_0xe357b){return function(_0x2022ae){if(_0x2022ae){return _0x2022ae[_0xe33e('0x33')]()[_0xe33e('0x34')](function(){_0x1535ff['status'](0xcc)[_0xe33e('0x29')]();});}};}function handleEntityNotFound(_0x31d863,_0x860f1e){return function(_0x1245ff){if(!_0x1245ff){_0x31d863[_0xe33e('0x27')](0x194);}return _0x1245ff;};}function handleError(_0x3b2ae2,_0x478777){_0x478777=_0x478777||0x1f4;return function(_0x202c4e){logger['error'](_0x202c4e['stack']);if(_0x202c4e['name']){delete _0x202c4e[_0xe33e('0x35')];}_0x3b2ae2[_0xe33e('0x28')](_0x478777)['send'](_0x202c4e);};}exports[_0xe33e('0x36')]=function(_0x52aa41,_0x1cfb71){var _0x58947c={},_0x3a5b46={},_0x2f3786={'count':0x0,'rows':[]};var _0x1a99fd=db[_0xe33e('0x37')][_0xe33e('0x38')];_0x3a5b46[_0xe33e('0x39')]=_[_0xe33e('0x3a')](_0x1a99fd);var _0x5c60ee={'dateStart':_0x52aa41[_0xe33e('0x3b')][_0xe33e('0x3c')],'dateEnd':_0x52aa41['query'][_0xe33e('0x3d')]};delete _0x52aa41['query'][_0xe33e('0x3c')];delete _0x52aa41[_0xe33e('0x3b')][_0xe33e('0x3d')];_0x3a5b46[_0xe33e('0x3b')]=_['keys'](_0x52aa41['query']);_0x3a5b46['filters']=_['intersection'](_0x3a5b46[_0xe33e('0x39')],_0x3a5b46[_0xe33e('0x3b')]);_0x58947c[_0xe33e('0x3e')]=_[_0xe33e('0x3f')](_0x3a5b46['model'],qs[_0xe33e('0x40')](_0x52aa41[_0xe33e('0x3b')]['fields']));_0x58947c[_0xe33e('0x3e')]=_0x58947c[_0xe33e('0x3e')]['length']?_0x58947c[_0xe33e('0x3e')]:_0x3a5b46[_0xe33e('0x39')];if(!_0x52aa41[_0xe33e('0x3b')][_0xe33e('0x41')](_0xe33e('0x42'))){_0x58947c[_0xe33e('0x2b')]=qs[_0xe33e('0x2b')](_0x52aa41[_0xe33e('0x3b')][_0xe33e('0x2b')]);_0x58947c[_0xe33e('0x2a')]=qs[_0xe33e('0x2a')](_0x52aa41[_0xe33e('0x3b')][_0xe33e('0x2a')]);}_0x58947c[_0xe33e('0x43')]=qs['sort'](_0x52aa41[_0xe33e('0x3b')][_0xe33e('0x44')]);_0x58947c[_0xe33e('0x45')]=qs[_0xe33e('0x46')](_[_0xe33e('0x47')](_0x52aa41[_0xe33e('0x3b')],_0x3a5b46[_0xe33e('0x46')]));if(_0x5c60ee[_0xe33e('0x3c')]){if(_0x5c60ee[_0xe33e('0x3d')]){_0x5c60ee[_0xe33e('0x3d')]=moment(_0x5c60ee[_0xe33e('0x3d')])[_0xe33e('0x48')](0x1,_0xe33e('0x49'));}else{_0x5c60ee[_0xe33e('0x3d')]=moment(_0x5c60ee[_0xe33e('0x3c')])[_0xe33e('0x48')](0x1,'day');}_['merge'](_0x58947c[_0xe33e('0x45')],{'createdAt':{'$gte':_0x5c60ee[_0xe33e('0x3c')],'$lte':_0x5c60ee[_0xe33e('0x3d')]}});}if(_0x52aa41[_0xe33e('0x3b')]['filter']){_0x58947c[_0xe33e('0x45')]=_[_0xe33e('0x4a')](_0x58947c[_0xe33e('0x45')],{'$or':_['map'](_0x1a99fd,function(_0x30ab9d){if(_0x30ab9d[_0xe33e('0x4b')][_0xe33e('0x4c')]!==_0xe33e('0x4d')){var _0x5480dd={};_0x5480dd[_0x30ab9d[_0xe33e('0x4e')]]={'$like':'%'+_0x52aa41[_0xe33e('0x3b')]['filter']+'%'};return _0x5480dd;}})});}_0x58947c=_['merge']({},_0x58947c,_0x52aa41[_0xe33e('0x4f')]);var _0x2e8ebc={'where':_0x58947c[_0xe33e('0x45')]};return db[_0xe33e('0x37')][_0xe33e('0x50')](_0x2e8ebc)[_0xe33e('0x34')](function(_0x12112a){_0x2f3786[_0xe33e('0x50')]=_0x12112a;if(_0x52aa41[_0xe33e('0x3b')][_0xe33e('0x51')]){_0x58947c[_0xe33e('0x52')]=[{'all':!![]}];}return db[_0xe33e('0x37')]['findAll'](_0x58947c);})[_0xe33e('0x34')](function(_0x51b518){_0x2f3786[_0xe33e('0x53')]=_0x51b518;return _0x2f3786;})[_0xe33e('0x34')](respondWithFilteredResult(_0x1cfb71,_0x58947c))[_0xe33e('0x26')](handleError(_0x1cfb71,null));};exports[_0xe33e('0x54')]=function(_0x20632e,_0x586912){var _0x59407b={'raw':!![],'where':{'id':_0x20632e[_0xe33e('0x55')]['id']}},_0x4a4214={};_0x4a4214[_0xe33e('0x39')]=_[_0xe33e('0x3a')](db[_0xe33e('0x37')][_0xe33e('0x38')]);_0x4a4214['query']=_[_0xe33e('0x3a')](_0x20632e['query']);_0x4a4214[_0xe33e('0x46')]=_[_0xe33e('0x3f')](_0x4a4214[_0xe33e('0x39')],_0x4a4214[_0xe33e('0x3b')]);_0x59407b[_0xe33e('0x3e')]=_[_0xe33e('0x3f')](_0x4a4214[_0xe33e('0x39')],qs[_0xe33e('0x40')](_0x20632e[_0xe33e('0x3b')][_0xe33e('0x40')]));_0x59407b['attributes']=_0x59407b[_0xe33e('0x3e')][_0xe33e('0x56')]?_0x59407b[_0xe33e('0x3e')]:_0x4a4214['model'];if(_0x20632e[_0xe33e('0x3b')][_0xe33e('0x51')]){_0x59407b[_0xe33e('0x52')]=[{'all':!![]}];}_0x59407b=_['merge']({},_0x59407b,_0x20632e['options']);return db[_0xe33e('0x37')][_0xe33e('0x57')](_0x59407b)[_0xe33e('0x34')](handleEntityNotFound(_0x586912,null))[_0xe33e('0x34')](respondWithResult(_0x586912,null))[_0xe33e('0x26')](handleError(_0x586912,null));};exports['create']=function(_0x3bbacf,_0x39cbaa){return db[_0xe33e('0x37')]['create'](_0x3bbacf[_0xe33e('0x58')],{})['then'](respondWithResult(_0x39cbaa,0xc9))['catch'](handleError(_0x39cbaa,null));};exports['update']=function(_0x5c7998,_0x4dfc62){if(_0x5c7998[_0xe33e('0x58')]['id']){delete _0x5c7998[_0xe33e('0x58')]['id'];}return db[_0xe33e('0x37')][_0xe33e('0x57')]({'where':{'id':_0x5c7998[_0xe33e('0x55')]['id']}})['then'](handleEntityNotFound(_0x4dfc62,null))[_0xe33e('0x34')](saveUpdates(_0x5c7998[_0xe33e('0x58')],null))['then'](respondWithResult(_0x4dfc62,null))[_0xe33e('0x26')](handleError(_0x4dfc62,null));};exports[_0xe33e('0x33')]=function(_0x117eaf,_0x533515){return db[_0xe33e('0x37')][_0xe33e('0x57')]({'where':{'id':_0x117eaf[_0xe33e('0x55')]['id']}})[_0xe33e('0x34')](handleEntityNotFound(_0x533515,null))[_0xe33e('0x34')](removeEntity(_0x533515,null))[_0xe33e('0x26')](handleError(_0x533515,null));};exports['describe']=function(_0x4f47f3,_0x31d222){return db['OpenchannelMessage']['describe']()[_0xe33e('0x34')](respondWithResult(_0x31d222,null))[_0xe33e('0x26')](handleError(_0x31d222,null));};var interaction_log=require(_0xe33e('0x59'))(_0xe33e('0x5a'));exports[_0xe33e('0x5b')]=function(_0x46ecac,_0x206c4c,_0x47b2b3){var _0x111faa={'channel':_0xe33e('0x5c')};if(_0x46ecac['body']['id']){delete _0x46ecac['body']['id'];}_0x46ecac[_0xe33e('0x58')][_0xe33e('0x5d')]=!![];_0x46ecac[_0xe33e('0x58')][_0xe33e('0x5e')]=moment()[_0xe33e('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x46ecac[_0xe33e('0x58')][_0xe33e('0x60')]=_0x46ecac[_0xe33e('0x58')]['UserId']||_0x46ecac[_0xe33e('0x61')]['id'];return db['OpenchannelMessage'][_0xe33e('0x57')]({'where':{'id':_0x46ecac[_0xe33e('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xe33e('0x62')],'as':_0xe33e('0x63')}]})[_0xe33e('0x34')](handleEntityNotFound(_0x206c4c,null))[_0xe33e('0x34')](saveUpdates(_0x46ecac['body'],null))[_0xe33e('0x34')](function(_0x5e9b2f){if(_0x5e9b2f){_0x111faa[_0xe33e('0x24')]=_0x5e9b2f['get']({'plain':!![]});return db[_0xe33e('0x64')][_0xe33e('0x57')]({'where':{'id':_0x5e9b2f[_0xe33e('0x65')]}});}return null;})[_0xe33e('0x34')](handleEntityNotFound(_0x206c4c,null))[_0xe33e('0x34')](function(_0x2b9823){if(_0x2b9823){return _0x2b9823[_0xe33e('0x32')]({'UserId':_0x46ecac[_0xe33e('0x58')][_0xe33e('0x60')],'read1stAt':_[_0xe33e('0x66')](_0x2b9823[_0xe33e('0x67')])?moment()['format'](_0xe33e('0x68')):undefined});}return null;})[_0xe33e('0x34')](function(_0x4507e7){if(_0x4507e7){_0x111faa[_0xe33e('0x69')]=_0x4507e7[_0xe33e('0x6a')]({'plain':!![]});interaction_log[_0xe33e('0x1d')](_0xe33e('0x6b'),_0x46ecac['user']['id'],_0x46ecac[_0xe33e('0x61')][_0xe33e('0x35')],_0x46ecac['user']['role'],_0x111faa['interaction']['id'],_0x46ecac[_0xe33e('0x58')]?JSON[_0xe33e('0x21')](_0x46ecac[_0xe33e('0x58')]):'null');return respondWithRpcPromise(_0xe33e('0x6c'),'acceptMessage',_0x111faa);}return null;})[_0xe33e('0x34')](function(_0x42e552){if(_0x42e552){if(_0x46ecac[_0xe33e('0x58')][_0xe33e('0x6d')]){_0x111faa[_0xe33e('0x24')][_0xe33e('0x6e')]=util[_0xe33e('0x5f')]('SIP/%s',_0x46ecac[_0xe33e('0x61')]['name']);_0x111faa[_0xe33e('0x24')][_0xe33e('0x6f')]=_0x111faa[_0xe33e('0x6f')];_0x111faa[_0xe33e('0x24')][_0xe33e('0x70')]='accept';return respondWithRpcPromise('EventManager',_0xe33e('0x71'),{'event':_0xe33e('0x72'),'message':_0x111faa['message']},client9002)[_0xe33e('0x34')](function(){return _0x111faa;});}return _0x111faa;}return null;})[_0xe33e('0x34')](respondWithResult(_0x206c4c,null))[_0xe33e('0x26')](handleError(_0x206c4c,null));};var interaction_log=require(_0xe33e('0x59'))('openchannel-interactions');exports['reject']=function(_0x4ed3f5,_0xd78c09,_0x19b78a){var _0xc3a1dc={'agent':{},'channel':_0xe33e('0x5c')};if(_0x4ed3f5[_0xe33e('0x58')]['id']){delete _0x4ed3f5['body']['id'];}_0x4ed3f5[_0xe33e('0x58')][_0xe33e('0x60')]=_0x4ed3f5[_0xe33e('0x58')][_0xe33e('0x60')]||_0x4ed3f5['user']['id'];_0xc3a1dc[_0xe33e('0x73')]['id']=_0x4ed3f5[_0xe33e('0x58')][_0xe33e('0x60')];return db[_0xe33e('0x37')][_0xe33e('0x57')]({'where':{'id':_0x4ed3f5['params']['id'],'UserId':null}})[_0xe33e('0x34')](handleEntityNotFound(_0xd78c09,null))[_0xe33e('0x34')](function(_0x32b880){if(_0x32b880){_0xc3a1dc[_0xe33e('0x24')]=_0x32b880['get']({'plain':!![]});return db[_0xe33e('0x64')][_0xe33e('0x57')]({'where':{'id':_0x32b880[_0xe33e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0xd78c09,null))[_0xe33e('0x34')](function(_0x5ca06e){if(_0x5ca06e){_0xc3a1dc[_0xe33e('0x69')]=_0x5ca06e[_0xe33e('0x6a')]({'plain':!![]});interaction_log['info'](_0xe33e('0x74'),_0x4ed3f5['user']['id'],_0x4ed3f5['user']['name'],_0x4ed3f5[_0xe33e('0x61')][_0xe33e('0x75')],_0xc3a1dc[_0xe33e('0x69')]['id'],_0x4ed3f5['body']?JSON['stringify'](_0x4ed3f5['body']):_0xe33e('0x76'));return respondWithRpcPromise(_0xe33e('0x77'),_0xe33e('0x78'),_0xc3a1dc);}return null;})[_0xe33e('0x34')](function(_0x3d7cf2){if(_0x3d7cf2){_0x3d7cf2[_0xe33e('0x24')][_0xe33e('0x6e')]=util['format'](_0xe33e('0x79'),_0x4ed3f5[_0xe33e('0x61')][_0xe33e('0x35')]);_0x3d7cf2[_0xe33e('0x24')]['channel']=_0xc3a1dc[_0xe33e('0x6f')];_0x3d7cf2['message']['event']=_0xe33e('0x30');respondWithRpcPromise(_0xe33e('0x71'),_0xe33e('0x71'),{'event':_0xe33e('0x7a'),'message':_0x3d7cf2[_0xe33e('0x24')]},client9002);return _0xc3a1dc;}return null;})['then'](respondWithResult(_0xd78c09,null))[_0xe33e('0x26')](handleError(_0xd78c09,null));};
\ No newline at end of file
+var _0x6912=['interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel','agent','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','redis','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','destroy','stack','name','send','index','query','dateStart','dateEnd','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','add','day','merge','where','filter','map','type','key','VIRTUAL','field','options','count','includeAll','OpenchannelMessage','findAll','rows','show','rawAttributes','length','include','create','body','find','params','describe','../../config/logger','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteractionId','isNil','read1stAt'];(function(_0x2589a6,_0x1706b7){var _0x590344=function(_0x44669c){while(--_0x44669c){_0x2589a6['push'](_0x2589a6['shift']());}};_0x590344(++_0x1706b7);}(_0x6912,0x18d));var _0x2691=function(_0x2abda3,_0x2afd02){_0x2abda3=_0x2abda3-0x0;var _0x31485f=_0x6912[_0x2abda3];return _0x31485f;};'use strict';var pdf=require(_0x2691('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2691('0x1'));var zipdir=require(_0x2691('0x2'));var jsonpatch=require(_0x2691('0x3'));var rp=require(_0x2691('0x4'));var moment=require(_0x2691('0x5'));var BPromise=require(_0x2691('0x6'));var Mustache=require(_0x2691('0x7'));var util=require(_0x2691('0x8'));var path=require(_0x2691('0x9'));var sox=require('sox');var csv=require(_0x2691('0xa'));var ejs=require(_0x2691('0xb'));var fs=require('fs');var _=require(_0x2691('0xc'));var squel=require(_0x2691('0xd'));var crypto=require('crypto');var jsforce=require(_0x2691('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2691('0xa'));var querystring=require(_0x2691('0xf'));var Papa=require(_0x2691('0x10'));var Redis=require(_0x2691('0x11'));var qs=require(_0x2691('0x12'));var logger=require('../../config/logger')(_0x2691('0x13'));var utils=require('../../config/utils');var config=require(_0x2691('0x14'));var db=require('../../mysqldb')['db'];config[_0x2691('0x15')]=_['defaults'](config[_0x2691('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x2691('0x16')](socket);var jayson=require(_0x2691('0x17'));var client=jayson[_0x2691('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0x2691('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x216b55,_0x173d93,_0x7f2ef3,_0x2da6d4){return new BPromise(function(_0x3b1654,_0x1645f8){var _0x580e07=_0x2da6d4||client;return _0x580e07['request'](_0x216b55,_0x7f2ef3)[_0x2691('0x1a')](function(_0x5db629){logger[_0x2691('0x1b')](_0x2691('0x1c'),_0x173d93,'request\x20sent');logger[_0x2691('0x1d')](_0x2691('0x1e'),_0x173d93,_0x2691('0x1f'),JSON['stringify'](_0x5db629));if(_0x5db629[_0x2691('0x20')]){if(_0x5db629[_0x2691('0x20')][_0x2691('0x21')]===0x1f4){logger[_0x2691('0x20')](_0x2691('0x1c'),_0x173d93,_0x5db629[_0x2691('0x20')][_0x2691('0x22')]);return _0x1645f8(_0x5db629['error']['message']);}logger[_0x2691('0x20')](_0x2691('0x1c'),_0x173d93,_0x5db629[_0x2691('0x20')][_0x2691('0x22')]);return _0x3b1654(_0x5db629[_0x2691('0x20')]['message']);}else{logger[_0x2691('0x1b')](_0x2691('0x1c'),_0x173d93,_0x2691('0x1f'));_0x3b1654(_0x5db629[_0x2691('0x23')][_0x2691('0x22')]);}})[_0x2691('0x24')](function(_0x1e0ed8){logger['error'](_0x2691('0x1c'),_0x173d93,_0x1e0ed8);_0x1645f8(_0x1e0ed8);});});}function respondWithStatusCode(_0x30c4b6,_0x403b17){_0x403b17=_0x403b17||0xcc;return function(_0xd1e5f){if(_0xd1e5f){return _0x30c4b6[_0x2691('0x25')](_0x403b17);}return _0x30c4b6[_0x2691('0x26')](_0x403b17)[_0x2691('0x27')]();};}function respondWithResult(_0x167cd1,_0x443452){_0x443452=_0x443452||0xc8;return function(_0x3e6d9e){if(_0x3e6d9e){return _0x167cd1['status'](_0x443452)['json'](_0x3e6d9e);}};}function respondWithFilteredResult(_0x428489,_0x3e2f11){return function(_0x569f32){if(_0x569f32){var _0x1f8ea3=_0x569f32['count'],_0x4b92e3=_0x3e2f11[_0x2691('0x28')],_0x3d6b79=_0x3e2f11[_0x2691('0x28')]+_0x3e2f11[_0x2691('0x29')],_0x9c55ea;if(_0x3d6b79>=_0x1f8ea3){_0x3d6b79=_0x1f8ea3;_0x9c55ea=0xc8;}else{_0x9c55ea=0xce;}_0x428489['status'](_0x9c55ea);return _0x428489[_0x2691('0x2a')](_0x2691('0x2b'),_0x4b92e3+'-'+_0x3d6b79+'/'+_0x1f8ea3)[_0x2691('0x2c')](_0x569f32);}return null;};}function patchUpdates(_0x1e15a3){return function(_0x1afe50){try{jsonpatch['apply'](_0x1afe50,_0x1e15a3,!![]);}catch(_0x4051d6){return BPromise[_0x2691('0x2d')](_0x4051d6);}return _0x1afe50[_0x2691('0x2e')]();};}function saveUpdates(_0x18de90,_0x3ebd4b){return function(_0x2bb1be){if(_0x2bb1be){return _0x2bb1be[_0x2691('0x2f')](_0x18de90)[_0x2691('0x1a')](function(_0x19f0ae){return _0x19f0ae;});}return null;};}function removeEntity(_0x330825,_0x260f4d){return function(_0x3e26ac){if(_0x3e26ac){return _0x3e26ac[_0x2691('0x30')]()[_0x2691('0x1a')](function(){_0x330825[_0x2691('0x26')](0xcc)[_0x2691('0x27')]();});}};}function handleEntityNotFound(_0x3f558b,_0x4bc46d){return function(_0x55c78b){if(!_0x55c78b){_0x3f558b['sendStatus'](0x194);}return _0x55c78b;};}function handleError(_0x229f59,_0x3f2366){_0x3f2366=_0x3f2366||0x1f4;return function(_0x35ee84){logger[_0x2691('0x20')](_0x35ee84[_0x2691('0x31')]);if(_0x35ee84['name']){delete _0x35ee84[_0x2691('0x32')];}_0x229f59[_0x2691('0x26')](_0x3f2366)[_0x2691('0x33')](_0x35ee84);};}exports[_0x2691('0x34')]=function(_0x56cf0d,_0x59e8c2){var _0x467879={},_0x140cef={},_0x42cd60={'count':0x0,'rows':[]};var _0x4364c1=db['OpenchannelMessage']['rawAttributes'];_0x140cef['model']=_['keys'](_0x4364c1);var _0x5cbe95={'dateStart':_0x56cf0d[_0x2691('0x35')][_0x2691('0x36')],'dateEnd':_0x56cf0d[_0x2691('0x35')][_0x2691('0x37')]};delete _0x56cf0d[_0x2691('0x35')][_0x2691('0x36')];delete _0x56cf0d[_0x2691('0x35')]['dateEnd'];_0x140cef[_0x2691('0x35')]=_[_0x2691('0x38')](_0x56cf0d[_0x2691('0x35')]);_0x140cef[_0x2691('0x39')]=_['intersection'](_0x140cef[_0x2691('0x3a')],_0x140cef['query']);_0x467879[_0x2691('0x3b')]=_[_0x2691('0x3c')](_0x140cef[_0x2691('0x3a')],qs[_0x2691('0x3d')](_0x56cf0d[_0x2691('0x35')][_0x2691('0x3d')]));_0x467879[_0x2691('0x3b')]=_0x467879[_0x2691('0x3b')]['length']?_0x467879['attributes']:_0x140cef[_0x2691('0x3a')];if(!_0x56cf0d[_0x2691('0x35')][_0x2691('0x3e')](_0x2691('0x3f'))){_0x467879[_0x2691('0x29')]=qs['limit'](_0x56cf0d['query']['limit']);_0x467879[_0x2691('0x28')]=qs['offset'](_0x56cf0d[_0x2691('0x35')]['offset']);}_0x467879[_0x2691('0x40')]=qs['sort'](_0x56cf0d[_0x2691('0x35')][_0x2691('0x41')]);_0x467879['where']=qs[_0x2691('0x39')](_[_0x2691('0x42')](_0x56cf0d[_0x2691('0x35')],_0x140cef['filters']));if(_0x5cbe95[_0x2691('0x36')]){if(_0x5cbe95[_0x2691('0x37')]){_0x5cbe95[_0x2691('0x37')]=moment(_0x5cbe95[_0x2691('0x37')])[_0x2691('0x43')](0x1,_0x2691('0x44'));}else{_0x5cbe95[_0x2691('0x37')]=moment(_0x5cbe95[_0x2691('0x36')])[_0x2691('0x43')](0x1,_0x2691('0x44'));}_[_0x2691('0x45')](_0x467879[_0x2691('0x46')],{'createdAt':{'$gte':_0x5cbe95[_0x2691('0x36')],'$lte':_0x5cbe95[_0x2691('0x37')]}});}if(_0x56cf0d[_0x2691('0x35')][_0x2691('0x47')]){_0x467879[_0x2691('0x46')]=_[_0x2691('0x45')](_0x467879[_0x2691('0x46')],{'$or':_[_0x2691('0x48')](_0x4364c1,function(_0x38f006){if(_0x38f006[_0x2691('0x49')][_0x2691('0x4a')]!==_0x2691('0x4b')){var _0x1ac644={};_0x1ac644[_0x38f006[_0x2691('0x4c')]]={'$like':'%'+_0x56cf0d[_0x2691('0x35')][_0x2691('0x47')]+'%'};return _0x1ac644;}})});}_0x467879=_['merge']({},_0x467879,_0x56cf0d[_0x2691('0x4d')]);var _0x5a6bf0={'where':_0x467879[_0x2691('0x46')]};return db['OpenchannelMessage'][_0x2691('0x4e')](_0x5a6bf0)['then'](function(_0x352f93){_0x42cd60[_0x2691('0x4e')]=_0x352f93;if(_0x56cf0d[_0x2691('0x35')][_0x2691('0x4f')]){_0x467879['include']=[{'all':!![]}];}return db[_0x2691('0x50')][_0x2691('0x51')](_0x467879);})[_0x2691('0x1a')](function(_0x5cae34){_0x42cd60[_0x2691('0x52')]=_0x5cae34;return _0x42cd60;})[_0x2691('0x1a')](respondWithFilteredResult(_0x59e8c2,_0x467879))[_0x2691('0x24')](handleError(_0x59e8c2,null));};exports[_0x2691('0x53')]=function(_0x565d39,_0x5b90f1){var _0x39b15d={'raw':!![],'where':{'id':_0x565d39['params']['id']}},_0x783994={};_0x783994[_0x2691('0x3a')]=_[_0x2691('0x38')](db[_0x2691('0x50')][_0x2691('0x54')]);_0x783994[_0x2691('0x35')]=_[_0x2691('0x38')](_0x565d39[_0x2691('0x35')]);_0x783994[_0x2691('0x39')]=_[_0x2691('0x3c')](_0x783994[_0x2691('0x3a')],_0x783994[_0x2691('0x35')]);_0x39b15d[_0x2691('0x3b')]=_[_0x2691('0x3c')](_0x783994[_0x2691('0x3a')],qs['fields'](_0x565d39[_0x2691('0x35')]['fields']));_0x39b15d['attributes']=_0x39b15d['attributes'][_0x2691('0x55')]?_0x39b15d['attributes']:_0x783994[_0x2691('0x3a')];if(_0x565d39[_0x2691('0x35')][_0x2691('0x4f')]){_0x39b15d[_0x2691('0x56')]=[{'all':!![]}];}_0x39b15d=_[_0x2691('0x45')]({},_0x39b15d,_0x565d39[_0x2691('0x4d')]);return db[_0x2691('0x50')]['find'](_0x39b15d)[_0x2691('0x1a')](handleEntityNotFound(_0x5b90f1,null))[_0x2691('0x1a')](respondWithResult(_0x5b90f1,null))[_0x2691('0x24')](handleError(_0x5b90f1,null));};exports[_0x2691('0x57')]=function(_0x556930,_0x5726ed){return db[_0x2691('0x50')][_0x2691('0x57')](_0x556930[_0x2691('0x58')],{})[_0x2691('0x1a')](respondWithResult(_0x5726ed,0xc9))[_0x2691('0x24')](handleError(_0x5726ed,null));};exports[_0x2691('0x2f')]=function(_0x5af449,_0x5df469){if(_0x5af449[_0x2691('0x58')]['id']){delete _0x5af449['body']['id'];}return db[_0x2691('0x50')]['find']({'where':{'id':_0x5af449['params']['id']}})[_0x2691('0x1a')](handleEntityNotFound(_0x5df469,null))[_0x2691('0x1a')](saveUpdates(_0x5af449[_0x2691('0x58')],null))[_0x2691('0x1a')](respondWithResult(_0x5df469,null))[_0x2691('0x24')](handleError(_0x5df469,null));};exports['destroy']=function(_0x21c81a,_0x1017a9){return db['OpenchannelMessage'][_0x2691('0x59')]({'where':{'id':_0x21c81a[_0x2691('0x5a')]['id']}})[_0x2691('0x1a')](handleEntityNotFound(_0x1017a9,null))[_0x2691('0x1a')](removeEntity(_0x1017a9,null))[_0x2691('0x24')](handleError(_0x1017a9,null));};exports['describe']=function(_0x1e15c9,_0x374a63){return db['OpenchannelMessage'][_0x2691('0x5b')]()[_0x2691('0x1a')](respondWithResult(_0x374a63,null))[_0x2691('0x24')](handleError(_0x374a63,null));};var interaction_log=require(_0x2691('0x5c'))(_0x2691('0x5d'));exports[_0x2691('0x5e')]=function(_0x2257a6,_0x421dfe,_0x2ad32c){var _0x332c94={'channel':'openchannel'};if(_0x2257a6[_0x2691('0x58')]['id']){delete _0x2257a6['body']['id'];}_0x2257a6[_0x2691('0x58')][_0x2691('0x5f')]=!![];_0x2257a6[_0x2691('0x58')][_0x2691('0x60')]=moment()[_0x2691('0x61')](_0x2691('0x62'));_0x2257a6['body']['UserId']=_0x2257a6[_0x2691('0x58')][_0x2691('0x63')]||_0x2257a6[_0x2691('0x64')]['id'];return db[_0x2691('0x50')][_0x2691('0x59')]({'where':{'id':_0x2257a6[_0x2691('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0x2691('0x65')],'as':_0x2691('0x66')}]})['then'](handleEntityNotFound(_0x421dfe,null))[_0x2691('0x1a')](saveUpdates(_0x2257a6['body'],null))[_0x2691('0x1a')](function(_0x479f80){if(_0x479f80){_0x332c94['message']=_0x479f80[_0x2691('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2691('0x59')]({'where':{'id':_0x479f80[_0x2691('0x68')]}});}return null;})[_0x2691('0x1a')](handleEntityNotFound(_0x421dfe,null))[_0x2691('0x1a')](function(_0x2d105a){if(_0x2d105a){return _0x2d105a[_0x2691('0x2f')]({'UserId':_0x2257a6[_0x2691('0x58')][_0x2691('0x63')],'read1stAt':_[_0x2691('0x69')](_0x2d105a[_0x2691('0x6a')])?moment()[_0x2691('0x61')](_0x2691('0x62')):undefined});}return null;})[_0x2691('0x1a')](function(_0x4ff6b2){if(_0x4ff6b2){_0x332c94[_0x2691('0x6b')]=_0x4ff6b2[_0x2691('0x67')]({'plain':!![]});interaction_log[_0x2691('0x1b')](_0x2691('0x6c'),_0x2257a6[_0x2691('0x64')]['id'],_0x2257a6['user'][_0x2691('0x32')],_0x2257a6[_0x2691('0x64')][_0x2691('0x6d')],_0x332c94[_0x2691('0x6b')]['id'],_0x2257a6[_0x2691('0x58')]?JSON['stringify'](_0x2257a6[_0x2691('0x58')]):'null');return respondWithRpcPromise(_0x2691('0x6e'),_0x2691('0x6f'),_0x332c94);}return null;})[_0x2691('0x1a')](function(_0x29f8cf){if(_0x29f8cf){if(_0x2257a6[_0x2691('0x58')][_0x2691('0x70')]){_0x332c94[_0x2691('0x22')][_0x2691('0x71')]=util['format'](_0x2691('0x72'),_0x2257a6['user'][_0x2691('0x32')]);_0x332c94[_0x2691('0x22')][_0x2691('0x73')]=_0x332c94[_0x2691('0x73')];_0x332c94[_0x2691('0x22')][_0x2691('0x74')]=_0x2691('0x5e');return respondWithRpcPromise(_0x2691('0x75'),_0x2691('0x75'),{'event':_0x2691('0x76'),'message':_0x332c94[_0x2691('0x22')]},client9002)[_0x2691('0x1a')](function(){return _0x332c94;});}return _0x332c94;}return null;})[_0x2691('0x1a')](respondWithResult(_0x421dfe,null))[_0x2691('0x24')](handleError(_0x421dfe,null));};var interaction_log=require(_0x2691('0x5c'))(_0x2691('0x5d'));exports[_0x2691('0x2d')]=function(_0x1d6bc6,_0x344b01,_0x27ee4a){var _0x59acac={'agent':{},'channel':_0x2691('0x77')};if(_0x1d6bc6[_0x2691('0x58')]['id']){delete _0x1d6bc6[_0x2691('0x58')]['id'];}_0x1d6bc6['body']['UserId']=_0x1d6bc6['body']['UserId']||_0x1d6bc6[_0x2691('0x64')]['id'];_0x59acac[_0x2691('0x78')]['id']=_0x1d6bc6[_0x2691('0x58')][_0x2691('0x63')];return db[_0x2691('0x50')][_0x2691('0x59')]({'where':{'id':_0x1d6bc6[_0x2691('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x344b01,null))[_0x2691('0x1a')](function(_0x25281e){if(_0x25281e){_0x59acac['message']=_0x25281e[_0x2691('0x67')]({'plain':!![]});return db[_0x2691('0x79')]['find']({'where':{'id':_0x25281e[_0x2691('0x68')]}});}return null;})[_0x2691('0x1a')](handleEntityNotFound(_0x344b01,null))[_0x2691('0x1a')](function(_0x1990c2){if(_0x1990c2){_0x59acac[_0x2691('0x6b')]=_0x1990c2['get']({'plain':!![]});interaction_log[_0x2691('0x1b')](_0x2691('0x7a'),_0x1d6bc6[_0x2691('0x64')]['id'],_0x1d6bc6['user'][_0x2691('0x32')],_0x1d6bc6[_0x2691('0x64')][_0x2691('0x6d')],_0x59acac[_0x2691('0x6b')]['id'],_0x1d6bc6[_0x2691('0x58')]?JSON[_0x2691('0x7b')](_0x1d6bc6[_0x2691('0x58')]):_0x2691('0x7c'));return respondWithRpcPromise(_0x2691('0x7d'),'rejectMessage',_0x59acac);}return null;})['then'](function(_0x3d78e0){if(_0x3d78e0){_0x3d78e0['message'][_0x2691('0x71')]=util[_0x2691('0x61')]('SIP/%s',_0x1d6bc6[_0x2691('0x64')]['name']);_0x3d78e0[_0x2691('0x22')][_0x2691('0x73')]=_0x59acac[_0x2691('0x73')];_0x3d78e0['message'][_0x2691('0x74')]='reject';respondWithRpcPromise(_0x2691('0x75'),_0x2691('0x75'),{'event':'rejectmessage','message':_0x3d78e0[_0x2691('0x22')]},client9002);return _0x59acac;}return null;})['then'](respondWithResult(_0x344b01,null))[_0x2691('0x24')](handleError(_0x344b01,null));};
\ No newline at end of file
index ed0a062..7596e9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3db=['../../mysqldb','setMaxListeners','remove','emit','hook','exports','events'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0xa3db,0x14f));var _0xba3d=function(_0x4964b5,_0x48bdf0){_0x4964b5=_0x4964b5-0x0;var _0x3663d3=_0xa3db[_0x4964b5];return _0x3663d3;};'use strict';var EventEmitter=require(_0xba3d('0x0'));var OpenchannelMessage=require(_0xba3d('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xba3d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xba3d('0x3')};function emitEvent(_0x24baae){return function(_0x17b71e,_0x479f14,_0x258798){OpenchannelMessageEvents[_0xba3d('0x4')](_0x24baae+':'+_0x17b71e['id'],_0x17b71e);OpenchannelMessageEvents['emit'](_0x24baae,_0x17b71e);_0x258798(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xba3d('0x5')](e,emitEvent(event));}}module[_0xba3d('0x6')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x89f3=['update','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x221464,_0x29dd78){var _0x106df0=function(_0x2e3051){while(--_0x2e3051){_0x221464['push'](_0x221464['shift']());}};_0x106df0(++_0x29dd78);}(_0x89f3,0x1ac));var _0x389f=function(_0x4dd4ea,_0x43f978){_0x4dd4ea=_0x4dd4ea-0x0;var _0xb87275=_0x89f3[_0x4dd4ea];return _0xb87275;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x389f('0x0'))['db'][_0x389f('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x389f('0x2')](0x0);var events={'afterCreate':_0x389f('0x3'),'afterUpdate':_0x389f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x36942c){return function(_0x42f17d,_0x39bd93,_0x425657){OpenchannelMessageEvents[_0x389f('0x5')](_0x36942c+':'+_0x42f17d['id'],_0x42f17d);OpenchannelMessageEvents['emit'](_0x36942c,_0x42f17d);_0x425657(null);};}for(var e in events){if(events[_0x389f('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x389f('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
index 7031178..8f12fbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf9b=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','out','secret','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','POST','method','GET','body','OpenchannelMessage,\x20%s,\x20%s','threadId','error','inspect','finally'];(function(_0x2996bf,_0x2a2102){var _0x37cdb4=function(_0x210937){while(--_0x210937){_0x2996bf['push'](_0x2996bf['shift']());}};_0x37cdb4(++_0x2a2102);}(_0xdf9b,0x122));var _0xbdf9=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xdf9b[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xbdf9('0x0'));var util=require(_0xbdf9('0x1'));var logger=require(_0xbdf9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbdf9('0x3'));var rp=require(_0xbdf9('0x4'));var attributes=require(_0xbdf9('0x5'));module[_0xbdf9('0x6')]=function(_0x266b7e,_0x40c862){return _0x266b7e[_0xbdf9('0x7')](_0xbdf9('0x8'),attributes,{'tableName':_0xbdf9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x245484,_0x55a9f6,_0x14a1d4){var _0x1aa5ba=_0x266b7e['models'];var _0x318925=_0x245484[_0xbdf9('0xa')]({'plain':!![]});if(_0x318925[_0xbdf9('0xb')][_0xbdf9('0xc')]()==='in'||_0x318925[_0xbdf9('0xb')][_0xbdf9('0xc')]()==='out'&&!_0x318925['secret']&&!_[_0xbdf9('0xd')](_0x318925[_0xbdf9('0xe')])){_0x1aa5ba[_0xbdf9('0xf')]['findOne']({'where':{'id':_0x318925[_0xbdf9('0x10')]}})[_0xbdf9('0x11')](function(_0x2d83d7){if(_0x2d83d7){_0x2d83d7[_0xbdf9('0x12')]({'lastMsgAt':_0x318925[_0xbdf9('0x13')],'lastMsgDirection':_0x318925[_0xbdf9('0xb')][_0xbdf9('0xc')](),'lastMsgBody':_0x318925['body']});}})[_0xbdf9('0x14')](function(_0x480532){console['error'](_0x480532);});}if(_0x318925[_0xbdf9('0xb')]===_0xbdf9('0x15')&&!_0x318925[_0xbdf9('0x16')]){var _0x4c089d;_0x1aa5ba[_0xbdf9('0x17')][_0xbdf9('0x18')]()[_0xbdf9('0x11')](function(_0x1b2875){return _0x1aa5ba[_0xbdf9('0x19')]['find']({'where':{'id':_0x318925[_0xbdf9('0x1a')]},'include':[{'model':_0x1aa5ba[_0xbdf9('0xf')],'as':_0xbdf9('0x1b'),'where':{'id':_0x318925[_0xbdf9('0x10')]},'limit':0x1,'include':[{'model':_0x1aa5ba[_0xbdf9('0x17')],'as':'Contact','attributes':_[_0xbdf9('0x1c')](_0x1b2875)}]}]});})['then'](function(_0x5cfc55){_0x4c089d=_0x5cfc55[_0xbdf9('0xa')]({'plain':!![]});if(_0x4c089d&&_0x4c089d[_0xbdf9('0x1d')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xbdf9('0x1e'),util[_0xbdf9('0x1f')](_0xbdf9('0x20'),_0x318925['id'],_0x4c089d[_0xbdf9('0x1d')]));if(_0x4c089d['Interactions']&&_0x4c089d[_0xbdf9('0x1b')][_0xbdf9('0x21')]){_0x318925[_0xbdf9('0x22')]=_[_0xbdf9('0x23')](_0x4c089d[_0xbdf9('0x1b')][0x0],'Contact');_0x318925['Contact']=_0x4c089d['Interactions'][0x0][_0xbdf9('0x24')];}var _0x55a9f6={'method':_0xbdf9('0x25'),'uri':encodeURI(_0x4c089d[_0xbdf9('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x55a9f6[_0xbdf9('0x26')]){case _0xbdf9('0x27'):_0x55a9f6['qs']=_0x318925;break;case _0xbdf9('0x25'):_0x55a9f6[_0xbdf9('0x28')]=_0x318925;break;}return rp(_0x55a9f6)[_0xbdf9('0x11')](function(_0x338276){logger['info'](_0xbdf9('0x29'),_0xbdf9('0x1e'),util[_0xbdf9('0x1f')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x318925['id'],_0x4c089d['replyUri']));if(_0x338276[_0xbdf9('0x28')][_0xbdf9('0x2a')]&&_0x338276['body']['threadId']!=_0x318925[_0xbdf9('0x22')][_0xbdf9('0x2a')]){return _0x1aa5ba[_0xbdf9('0xf')][_0xbdf9('0x12')]({'threadId':_0x338276['body'][_0xbdf9('0x2a')]},{'logging':!![],'where':{'id':_0x318925[_0xbdf9('0x22')]['id']}});}else{return;}})['then'](function(){return _0x245484[_0xbdf9('0x12')]({'read':!![]});})[_0xbdf9('0x14')](function(_0x3b9ce9){logger[_0xbdf9('0x2b')](_0xbdf9('0x29'),_0xbdf9('0x1e'),util[_0xbdf9('0x2c')](_0x3b9ce9,{'showHidden':![],'depth':null}));_0x14a1d4();});}else{_0x14a1d4();}})[_0xbdf9('0x2d')](function(){_0x14a1d4();});}else{_0x14a1d4();}}},'charset':_0xbdf9('0x2e'),'collate':_0xbdf9('0x2f')});};
\ No newline at end of file
+var _0xefe0=['body','error','CmContact','OpenchannelAccountId','Interactions','keys','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','Contact','POST','method','GET','info','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','models','get','direction','toLowerCase','out','isNil','findOne','OpenchannelInteractionId','then','createdAt'];(function(_0x3c3b57,_0x5c6241){var _0x630592=function(_0x527535){while(--_0x527535){_0x3c3b57['push'](_0x3c3b57['shift']());}};_0x630592(++_0x5c6241);}(_0xefe0,0xa3));var _0x0efe=function(_0x5c52a3,_0x13c8d5){_0x5c52a3=_0x5c52a3-0x0;var _0x5537b9=_0xefe0[_0x5c52a3];return _0x5537b9;};'use strict';var _=require(_0x0efe('0x0'));var util=require(_0x0efe('0x1'));var logger=require(_0x0efe('0x2'))(_0x0efe('0x3'));var moment=require(_0x0efe('0x4'));var BPromise=require(_0x0efe('0x5'));var rp=require(_0x0efe('0x6'));var attributes=require(_0x0efe('0x7'));module['exports']=function(_0x36869f,_0x221eaf){return _0x36869f[_0x0efe('0x8')](_0x0efe('0x9'),attributes,{'tableName':_0x0efe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b21d6,_0x53beea,_0x394718){var _0x566cd3=_0x36869f[_0x0efe('0xb')];var _0x49bfe7=_0x1b21d6[_0x0efe('0xc')]({'plain':!![]});if(_0x49bfe7[_0x0efe('0xd')]['toLowerCase']()==='in'||_0x49bfe7[_0x0efe('0xd')][_0x0efe('0xe')]()===_0x0efe('0xf')&&!_0x49bfe7['secret']&&!_[_0x0efe('0x10')](_0x49bfe7['UserId'])){_0x566cd3['OpenchannelInteraction'][_0x0efe('0x11')]({'where':{'id':_0x49bfe7[_0x0efe('0x12')]}})[_0x0efe('0x13')](function(_0x4f8bfc){if(_0x4f8bfc){_0x4f8bfc['update']({'lastMsgAt':_0x49bfe7[_0x0efe('0x14')],'lastMsgDirection':_0x49bfe7['direction'][_0x0efe('0xe')](),'lastMsgBody':_0x49bfe7[_0x0efe('0x15')]});}})['catch'](function(_0x320e41){console[_0x0efe('0x16')](_0x320e41);});}if(_0x49bfe7[_0x0efe('0xd')]===_0x0efe('0xf')&&!_0x49bfe7['secret']){var _0x28663c;_0x566cd3[_0x0efe('0x17')]['describe']()[_0x0efe('0x13')](function(_0x5a8323){return _0x566cd3['OpenchannelAccount']['find']({'where':{'id':_0x49bfe7[_0x0efe('0x18')]},'include':[{'model':_0x566cd3['OpenchannelInteraction'],'as':_0x0efe('0x19'),'where':{'id':_0x49bfe7[_0x0efe('0x12')]},'limit':0x1,'include':[{'model':_0x566cd3[_0x0efe('0x17')],'as':'Contact','attributes':_[_0x0efe('0x1a')](_0x5a8323)}]}]});})['then'](function(_0x4bad4f){_0x28663c=_0x4bad4f[_0x0efe('0xc')]({'plain':!![]});if(_0x28663c&&_0x28663c['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x0efe('0x1b'),util[_0x0efe('0x1c')](_0x0efe('0x1d'),_0x49bfe7['id'],_0x28663c[_0x0efe('0x1e')]));if(_0x28663c[_0x0efe('0x19')]&&_0x28663c['Interactions'][_0x0efe('0x1f')]){_0x49bfe7[_0x0efe('0x20')]=_['omit'](_0x28663c[_0x0efe('0x19')][0x0],_0x0efe('0x21'));_0x49bfe7[_0x0efe('0x21')]=_0x28663c[_0x0efe('0x19')][0x0][_0x0efe('0x21')];}var _0x53beea={'method':_0x0efe('0x22'),'uri':encodeURI(_0x28663c[_0x0efe('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x53beea[_0x0efe('0x23')]){case _0x0efe('0x24'):_0x53beea['qs']=_0x49bfe7;break;case _0x0efe('0x22'):_0x53beea[_0x0efe('0x15')]=_0x49bfe7;break;}return rp(_0x53beea)[_0x0efe('0x13')](function(_0x2e1a2d){logger[_0x0efe('0x25')](_0x0efe('0x26'),_0x0efe('0x1b'),util[_0x0efe('0x1c')](_0x0efe('0x27'),_0x49bfe7['id'],_0x28663c[_0x0efe('0x1e')]));if(_0x2e1a2d[_0x0efe('0x15')][_0x0efe('0x28')]&&_0x2e1a2d[_0x0efe('0x15')]['threadId']!=_0x49bfe7[_0x0efe('0x20')][_0x0efe('0x28')]){return _0x566cd3['OpenchannelInteraction'][_0x0efe('0x29')]({'threadId':_0x2e1a2d['body'][_0x0efe('0x28')]},{'logging':!![],'where':{'id':_0x49bfe7[_0x0efe('0x20')]['id']}});}else{return;}})[_0x0efe('0x13')](function(){return _0x1b21d6[_0x0efe('0x29')]({'read':!![]});})['catch'](function(_0x516385){logger[_0x0efe('0x16')](_0x0efe('0x26'),_0x0efe('0x1b'),util[_0x0efe('0x2a')](_0x516385,{'showHidden':![],'depth':null}));_0x394718();});}else{_0x394718();}})[_0x0efe('0x2b')](function(){_0x394718();});}else{_0x394718();}}},'charset':_0x0efe('0x2c'),'collate':_0x0efe('0x2d')});};
\ No newline at end of file
index 99779eb..b64afca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbda9=['CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0xb3ce04,_0x50e9e4){var _0x403a56=function(_0x13a9d9){while(--_0x13a9d9){_0xb3ce04['push'](_0xb3ce04['shift']());}};_0x403a56(++_0x50e9e4);}(_0xbda9,0x146));var _0x9bda=function(_0x3a76cc,_0x43c78d){_0x3a76cc=_0x3a76cc-0x0;var _0x1204f8=_0xbda9[_0x3a76cc];return _0x1204f8;};'use strict';var _=require(_0x9bda('0x0'));var util=require(_0x9bda('0x1'));var moment=require(_0x9bda('0x2'));var BPromise=require(_0x9bda('0x3'));var rs=require(_0x9bda('0x4'));var fs=require('fs');var Redis=require(_0x9bda('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9bda('0x6'));var logger=require(_0x9bda('0x7'))('rpc');var config=require(_0x9bda('0x8'));var jayson=require(_0x9bda('0x9'));var client=jayson[_0x9bda('0xa')][_0x9bda('0xb')]({'port':0x232a});config[_0x9bda('0xc')]=_[_0x9bda('0xd')](config[_0x9bda('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9bda('0xe'))(new Redis(config[_0x9bda('0xc')]));require('./openchannelMessage.socket')[_0x9bda('0xf')](socket);function respondWithRpcPromise(_0x313f74,_0x17b03f,_0xe1e7b5){return new BPromise(function(_0x390ccf,_0xfc6de){return client[_0x9bda('0x10')](_0x313f74,_0xe1e7b5)[_0x9bda('0x11')](function(_0x584a55){logger[_0x9bda('0x12')](_0x9bda('0x13'),_0x17b03f,_0x9bda('0x14'));logger[_0x9bda('0x15')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x17b03f,_0x9bda('0x14'),JSON[_0x9bda('0x16')](_0x584a55));if(_0x584a55[_0x9bda('0x17')]){if(_0x584a55['error']['code']===0x1f4){logger['error'](_0x9bda('0x13'),_0x17b03f,_0x584a55[_0x9bda('0x17')]['message']);return _0xfc6de(_0x584a55['error']['message']);}logger['error'](_0x9bda('0x13'),_0x17b03f,_0x584a55['error'][_0x9bda('0x18')]);return _0x390ccf(_0x584a55['error']['message']);}else{logger[_0x9bda('0x12')](_0x9bda('0x13'),_0x17b03f,_0x9bda('0x14'));_0x390ccf(_0x584a55['result']['message']);}})[_0x9bda('0x19')](function(_0x41db38){logger[_0x9bda('0x17')](_0x9bda('0x13'),_0x17b03f,_0x41db38);_0xfc6de(_0x41db38);});});}exports[_0x9bda('0x1a')]=function(_0xd83788){var _0xc7a0cf=this;return new Promise(function(_0x14f574,_0x141d9c){return db[_0x9bda('0x1b')][_0x9bda('0x1c')](_0xd83788[_0x9bda('0x1d')],{'raw':_0xd83788[_0x9bda('0x1e')]?_0xd83788[_0x9bda('0x1e')][_0x9bda('0x1f')]===undefined?!![]:![]:!![]})[_0x9bda('0x11')](function(_0x539a53){logger['info']('CreateOpenchannelMessage',_0xd83788);logger[_0x9bda('0x15')](_0x9bda('0x1a'),_0xd83788,JSON[_0x9bda('0x16')](_0x539a53));_0x14f574(_0x539a53);})[_0x9bda('0x19')](function(_0x587bc5){logger['error'](_0x9bda('0x1a'),_0x587bc5[_0x9bda('0x18')],_0xd83788);_0x141d9c(_0xc7a0cf[_0x9bda('0x17')](0x1f4,_0x587bc5[_0x9bda('0x18')]));});});};
\ No newline at end of file
+var _0x136b=['redis','socket.io-emitter','request','then','info','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x1e7be1,_0x161891){var _0x5c9c54=function(_0x5e377b){while(--_0x5e377b){_0x1e7be1['push'](_0x1e7be1['shift']());}};_0x5c9c54(++_0x161891);}(_0x136b,0xfc));var _0xb136=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x136b[_0x92c450];return _0x2a9599;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb136('0x0'));var rs=require(_0xb136('0x1'));var fs=require('fs');var Redis=require(_0xb136('0x2'));var db=require(_0xb136('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb136('0x4'))('rpc');var config=require(_0xb136('0x5'));var jayson=require(_0xb136('0x6'));var client=jayson['client'][_0xb136('0x7')]({'port':0x232a});config[_0xb136('0x8')]=_['defaults'](config[_0xb136('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb136('0x9'))(new Redis(config[_0xb136('0x8')]));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3fea02,_0x4db06a,_0x5cca6b){return new BPromise(function(_0x5497bf,_0x5e60a1){return client[_0xb136('0xa')](_0x3fea02,_0x5cca6b)[_0xb136('0xb')](function(_0xa6abe1){logger[_0xb136('0xc')](_0xb136('0xd'),_0x4db06a,'request\x20sent');logger['debug'](_0xb136('0xe'),_0x4db06a,_0xb136('0xf'),JSON[_0xb136('0x10')](_0xa6abe1));if(_0xa6abe1['error']){if(_0xa6abe1[_0xb136('0x11')][_0xb136('0x12')]===0x1f4){logger[_0xb136('0x11')](_0xb136('0xd'),_0x4db06a,_0xa6abe1[_0xb136('0x11')][_0xb136('0x13')]);return _0x5e60a1(_0xa6abe1[_0xb136('0x11')][_0xb136('0x13')]);}logger[_0xb136('0x11')](_0xb136('0xd'),_0x4db06a,_0xa6abe1[_0xb136('0x11')]['message']);return _0x5497bf(_0xa6abe1['error']['message']);}else{logger[_0xb136('0xc')](_0xb136('0xd'),_0x4db06a,_0xb136('0xf'));_0x5497bf(_0xa6abe1['result'][_0xb136('0x13')]);}})[_0xb136('0x14')](function(_0xf9c95){logger[_0xb136('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x4db06a,_0xf9c95);_0x5e60a1(_0xf9c95);});});}exports[_0xb136('0x15')]=function(_0x55e123){var _0x57dfd4=this;return new Promise(function(_0x53f5fe,_0x25b615){return db[_0xb136('0x16')]['create'](_0x55e123[_0xb136('0x17')],{'raw':_0x55e123[_0xb136('0x18')]?_0x55e123[_0xb136('0x18')][_0xb136('0x19')]===undefined?!![]:![]:!![]})[_0xb136('0xb')](function(_0x386160){logger[_0xb136('0xc')]('CreateOpenchannelMessage',_0x55e123);logger['debug'](_0xb136('0x15'),_0x55e123,JSON['stringify'](_0x386160));_0x53f5fe(_0x386160);})[_0xb136('0x14')](function(_0x37b423){logger[_0xb136('0x11')](_0xb136('0x15'),_0x37b423['message'],_0x55e123);_0x25b615(_0x57dfd4['error'](0x1f4,_0x37b423[_0xb136('0x13')]));});});};
\ No newline at end of file
index 71ca0d6..2ff6943 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee24=['length','openchannelMessage:','save','remove','emit','removeListener','register'];(function(_0x4a4cf5,_0x55007f){var _0x582d45=function(_0x17e797){while(--_0x17e797){_0x4a4cf5['push'](_0x4a4cf5['shift']());}};_0x582d45(++_0x55007f);}(_0xee24,0x1a6));var _0x4ee2=function(_0x14cc59,_0x361208){_0x14cc59=_0x14cc59-0x0;var _0x31c77c=_0xee24[_0x14cc59];return _0x31c77c;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x4ee2('0x0'),_0x4ee2('0x1'),'update'];function createListener(_0x234b61,_0x4e09d3){return function(_0x3ff71c){_0x4e09d3[_0x4ee2('0x2')](_0x234b61,_0x3ff71c);};}function removeListener(_0x5546e1,_0x1aee89){return function(){OpenchannelMessageEvents[_0x4ee2('0x3')](_0x5546e1,_0x1aee89);};}exports[_0x4ee2('0x4')]=function(_0x1993de){for(var _0x5c778f=0x0,_0x2e6e11=events[_0x4ee2('0x5')];_0x5c778f<_0x2e6e11;_0x5c778f++){var _0xe966eb=events[_0x5c778f];var _0x9a963c=createListener(_0x4ee2('0x6')+_0xe966eb,_0x1993de);OpenchannelMessageEvents['on'](_0xe966eb,_0x9a963c);}};
\ No newline at end of file
+var _0x0207=['emit','removeListener','length','openchannelMessage:','save'];(function(_0x4319f9,_0x59952f){var _0x313af6=function(_0x260a55){while(--_0x260a55){_0x4319f9['push'](_0x4319f9['shift']());}};_0x313af6(++_0x59952f);}(_0x0207,0x162));var _0x7020=function(_0xe4e303,_0x8f9657){_0xe4e303=_0xe4e303-0x0;var _0x39021e=_0x0207[_0xe4e303];return _0x39021e;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x7020('0x0'),'remove','update'];function createListener(_0x1a481c,_0x28ab1d){return function(_0x2213ca){_0x28ab1d[_0x7020('0x1')](_0x1a481c,_0x2213ca);};}function removeListener(_0x2e62fd,_0x25174b){return function(){OpenchannelMessageEvents[_0x7020('0x2')](_0x2e62fd,_0x25174b);};}exports['register']=function(_0x5074d7){for(var _0x38c320=0x0,_0x39263c=events[_0x7020('0x3')];_0x38c320<_0x39263c;_0x38c320++){var _0x17deac=events[_0x38c320];var _0x42bc79=createListener(_0x7020('0x4')+_0x17deac,_0x5074d7);OpenchannelMessageEvents['on'](_0x17deac,_0x42bc79);}};
\ No newline at end of file
index 64bf639..2b775c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x714d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addAgents','put','/:id','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x5ce44b,_0x1b2779){var _0x57a6cc=function(_0x9d5883){while(--_0x9d5883){_0x5ce44b['push'](_0x5ce44b['shift']());}};_0x57a6cc(++_0x1b2779);}(_0x714d,0x11e));var _0xd714=function(_0x27256c,_0x3fa3ef){_0x27256c=_0x27256c-0x0;var _0x1caaf8=_0x714d[_0x27256c];return _0x1caaf8;};'use strict';var multer=require(_0xd714('0x0'));var util=require(_0xd714('0x1'));var path=require(_0xd714('0x2'));var timeout=require(_0xd714('0x3'));var express=require(_0xd714('0x4'));var router=express[_0xd714('0x5')]();var auth=require(_0xd714('0x6'));var interaction=require(_0xd714('0x7'));var config=require(_0xd714('0x8'));var controller=require(_0xd714('0x9'));router[_0xd714('0xa')]('/',auth[_0xd714('0xb')](),controller[_0xd714('0xc')]);router[_0xd714('0xa')](_0xd714('0xd'),auth['isAuthenticated'](),controller[_0xd714('0xe')]);router[_0xd714('0xa')]('/:id',auth[_0xd714('0xb')](),controller[_0xd714('0xf')]);router[_0xd714('0xa')](_0xd714('0x10'),auth['isAuthenticated'](),controller[_0xd714('0x11')]);router['get'](_0xd714('0x12'),auth[_0xd714('0xb')](),controller['getTeams']);router['get'](_0xd714('0x13'),auth['isAuthenticated'](),controller[_0xd714('0x14')]);router[_0xd714('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xd714('0x12'),auth[_0xd714('0xb')](),controller['addTeams']);router[_0xd714('0x15')](_0xd714('0x13'),auth[_0xd714('0xb')](),controller[_0xd714('0x16')]);router[_0xd714('0x17')]('/:id',auth[_0xd714('0xb')](),controller['update']);router['delete'](_0xd714('0x18'),auth[_0xd714('0xb')](),controller[_0xd714('0x19')]);router[_0xd714('0x1a')](_0xd714('0x12'),auth[_0xd714('0xb')](),controller['removeTeams']);router[_0xd714('0x1a')](_0xd714('0x13'),auth[_0xd714('0xb')](),controller[_0xd714('0x1b')]);module[_0xd714('0x1c')]=router;
\ No newline at end of file
+var _0xdb04=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x33fdd9,_0x332011){var _0x271966=function(_0x2fa8f0){while(--_0x2fa8f0){_0x33fdd9['push'](_0x33fdd9['shift']());}};_0x271966(++_0x332011);}(_0xdb04,0x15f));var _0x4db0=function(_0x265bcb,_0x2a09c0){_0x265bcb=_0x265bcb-0x0;var _0x5f1bc8=_0xdb04[_0x265bcb];return _0x5f1bc8;};'use strict';var multer=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var path=require(_0x4db0('0x2'));var timeout=require(_0x4db0('0x3'));var express=require(_0x4db0('0x4'));var router=express[_0x4db0('0x5')]();var auth=require(_0x4db0('0x6'));var interaction=require(_0x4db0('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x4db0('0x8')]('/',auth[_0x4db0('0x9')](),controller[_0x4db0('0xa')]);router[_0x4db0('0x8')](_0x4db0('0xb'),auth[_0x4db0('0x9')](),controller[_0x4db0('0xc')]);router[_0x4db0('0x8')](_0x4db0('0xd'),auth[_0x4db0('0x9')](),controller[_0x4db0('0xe')]);router[_0x4db0('0x8')](_0x4db0('0xf'),auth['isAuthenticated'](),controller[_0x4db0('0x10')]);router['get'](_0x4db0('0x11'),auth[_0x4db0('0x9')](),controller[_0x4db0('0x12')]);router['get']('/:id/users',auth[_0x4db0('0x9')](),controller[_0x4db0('0x13')]);router[_0x4db0('0x14')]('/',auth[_0x4db0('0x9')](),controller[_0x4db0('0x15')]);router[_0x4db0('0x14')]('/:id/teams',auth[_0x4db0('0x9')](),controller['addTeams']);router[_0x4db0('0x14')](_0x4db0('0x16'),auth['isAuthenticated'](),controller[_0x4db0('0x17')]);router[_0x4db0('0x18')](_0x4db0('0xd'),auth['isAuthenticated'](),controller[_0x4db0('0x19')]);router['delete'](_0x4db0('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x4db0('0x1a')](_0x4db0('0x11'),auth[_0x4db0('0x9')](),controller['removeTeams']);router[_0x4db0('0x1a')](_0x4db0('0x16'),auth[_0x4db0('0x9')](),controller['removeAgents']);module[_0x4db0('0x1b')]=router;
\ No newline at end of file
index 3d7ea9a..887a36e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc42=['STRING','INTEGER','ENUM','roundrobin','exports','name'];(function(_0x2c9f51,_0x2eec01){var _0x12abf9=function(_0x2d463f){while(--_0x2d463f){_0x2c9f51['push'](_0x2c9f51['shift']());}};_0x12abf9(++_0x2eec01);}(_0xdc42,0x76));var _0x2dc4=function(_0x3e6811,_0x2a28c0){_0x3e6811=_0x3e6811-0x0;var _0x21b6b0=_0xdc42[_0x3e6811];return _0x21b6b0;};'use strict';var Sequelize=require('sequelize');module[_0x2dc4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2dc4('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2dc4('0x2')]},'timeout':{'type':Sequelize[_0x2dc4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2dc4('0x4')]('rrmemory','beepall',_0x2dc4('0x5'))}};
\ No newline at end of file
+var _0x7591=['beepall','roundrobin','sequelize','exports','INTEGER','ENUM','rrmemory'];(function(_0x5f1e9c,_0x5cc4e6){var _0x4f08f7=function(_0x4c6c63){while(--_0x4c6c63){_0x5f1e9c['push'](_0x5f1e9c['shift']());}};_0x4f08f7(++_0x5cc4e6);}(_0x7591,0x152));var _0x1759=function(_0x1b6e09,_0xdfbfaa){_0x1b6e09=_0x1b6e09-0x0;var _0x575b1c=_0x7591[_0x1b6e09];return _0x575b1c;};'use strict';var Sequelize=require(_0x1759('0x0'));module[_0x1759('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1759('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1759('0x3')](_0x1759('0x4'),_0x1759('0x5'),_0x1759('0x6'))}};
\ No newline at end of file
index dabb117..af5bd7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa905=['getTeams','Team','Agents','union','addAgents','penalty','addTeams','ids','removeTeams','removeAgents','omit','spread','emit','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','query','dateEnd','dateStart','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','map','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','options','User','findAndCountAll','openchannelPause','updatedAt','createdAt','format','%s/%s'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xa905,0x1db));var _0x5a90=function(_0x4949ff,_0x3fd488){_0x4949ff=_0x4949ff-0x0;var _0x5aaa30=_0xa905[_0x4949ff];return _0x5aaa30;};'use strict';var pdf=require(_0x5a90('0x0'));var emlformat=require(_0x5a90('0x1'));var rimraf=require(_0x5a90('0x2'));var zipdir=require(_0x5a90('0x3'));var jsonpatch=require(_0x5a90('0x4'));var rp=require(_0x5a90('0x5'));var moment=require('moment');var BPromise=require(_0x5a90('0x6'));var Mustache=require(_0x5a90('0x7'));var util=require(_0x5a90('0x8'));var path=require(_0x5a90('0x9'));var sox=require(_0x5a90('0xa'));var csv=require(_0x5a90('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5a90('0xc'));var crypto=require(_0x5a90('0xd'));var jsforce=require(_0x5a90('0xe'));var deskjs=require(_0x5a90('0xf'));var toCsv=require(_0x5a90('0xb'));var querystring=require(_0x5a90('0x10'));var Papa=require('papaparse');var Redis=require(_0x5a90('0x11'));var qs=require(_0x5a90('0x12'));var logger=require('../../config/logger')(_0x5a90('0x13'));var utils=require('../../config/utils');var config=require(_0x5a90('0x14'));var db=require(_0x5a90('0x15'))['db'];config[_0x5a90('0x16')]=_[_0x5a90('0x17')](config['redis'],{'host':_0x5a90('0x18'),'port':0x18eb});var socket=require(_0x5a90('0x19'))(new Redis(config[_0x5a90('0x16')]));require(_0x5a90('0x1a'))['register'](socket);function respondWithStatusCode(_0x536c26,_0x32a3fe){_0x32a3fe=_0x32a3fe||0xcc;return function(_0x419ceb){if(_0x419ceb){return _0x536c26[_0x5a90('0x1b')](_0x32a3fe);}return _0x536c26[_0x5a90('0x1c')](_0x32a3fe)[_0x5a90('0x1d')]();};}function respondWithResult(_0x4a921e,_0x417060){_0x417060=_0x417060||0xc8;return function(_0x1f7bbc){if(_0x1f7bbc){return _0x4a921e[_0x5a90('0x1c')](_0x417060)['json'](_0x1f7bbc);}};}function respondWithFilteredResult(_0x13e092,_0x4d0429){return function(_0x3b2a0e){if(_0x3b2a0e){var _0x16d52d=_0x3b2a0e[_0x5a90('0x1e')],_0x509b33=_0x4d0429[_0x5a90('0x1f')],_0x1b6179=_0x4d0429[_0x5a90('0x1f')]+_0x4d0429[_0x5a90('0x20')],_0x3f77fc;if(_0x1b6179>=_0x16d52d){_0x1b6179=_0x16d52d;_0x3f77fc=0xc8;}else{_0x3f77fc=0xce;}_0x13e092['status'](_0x3f77fc);return _0x13e092[_0x5a90('0x21')](_0x5a90('0x22'),_0x509b33+'-'+_0x1b6179+'/'+_0x16d52d)[_0x5a90('0x23')](_0x3b2a0e);}return null;};}function patchUpdates(_0x16a1b9){return function(_0x27231b){try{jsonpatch[_0x5a90('0x24')](_0x27231b,_0x16a1b9,!![]);}catch(_0x248699){return BPromise[_0x5a90('0x25')](_0x248699);}return _0x27231b['save']();};}function saveUpdates(_0x99ae9e,_0x30fecc){return function(_0x2436c3){if(_0x2436c3){return _0x2436c3[_0x5a90('0x26')](_0x99ae9e)[_0x5a90('0x27')](function(_0x39d1ba){return _0x39d1ba;});}return null;};}function removeEntity(_0x4aa47d,_0x43463a){return function(_0x43518a){if(_0x43518a){return _0x43518a[_0x5a90('0x28')]()[_0x5a90('0x27')](function(){var _0xae8c93=_0x43518a[_0x5a90('0x29')]({'plain':!![]});var _0x1288f5=_0x5a90('0x2a');return db[_0x5a90('0x2b')][_0x5a90('0x28')]({'where':{'type':_0x1288f5,'resourceId':_0xae8c93['id']}})[_0x5a90('0x27')](function(){return _0x43518a;});})[_0x5a90('0x27')](function(){_0x4aa47d[_0x5a90('0x1c')](0xcc)[_0x5a90('0x1d')]();});}};}function handleEntityNotFound(_0x5cb227,_0x3aaf95){return function(_0x15ada9){if(!_0x15ada9){_0x5cb227[_0x5a90('0x1b')](0x194);}return _0x15ada9;};}function handleError(_0x170293,_0x203644){_0x203644=_0x203644||0x1f4;return function(_0x13182e){logger[_0x5a90('0x2c')](_0x13182e[_0x5a90('0x2d')]);if(_0x13182e['name']){delete _0x13182e[_0x5a90('0x2e')];}_0x170293[_0x5a90('0x1c')](_0x203644)[_0x5a90('0x2f')](_0x13182e);};}exports[_0x5a90('0x30')]=function(_0x32ff23,_0x15efaf){var _0x53c8bf={},_0x42319e={},_0x5109e3={'count':0x0,'rows':[]};var _0x349b1a=db[_0x5a90('0x31')][_0x5a90('0x32')];_0x42319e['model']=_['keys'](_0x349b1a);var _0x16cd6c={'dateStart':_0x32ff23[_0x5a90('0x33')]['dateStart'],'dateEnd':_0x32ff23[_0x5a90('0x33')][_0x5a90('0x34')]};delete _0x32ff23[_0x5a90('0x33')][_0x5a90('0x35')];delete _0x32ff23[_0x5a90('0x33')]['dateEnd'];_0x42319e[_0x5a90('0x33')]=_['keys'](_0x32ff23[_0x5a90('0x33')]);_0x42319e[_0x5a90('0x36')]=_[_0x5a90('0x37')](_0x42319e['model'],_0x42319e[_0x5a90('0x33')]);_0x53c8bf[_0x5a90('0x38')]=_[_0x5a90('0x37')](_0x42319e[_0x5a90('0x39')],qs[_0x5a90('0x3a')](_0x32ff23[_0x5a90('0x33')][_0x5a90('0x3a')]));_0x53c8bf[_0x5a90('0x38')]=_0x53c8bf[_0x5a90('0x38')][_0x5a90('0x3b')]?_0x53c8bf[_0x5a90('0x38')]:_0x42319e[_0x5a90('0x39')];if(!_0x32ff23[_0x5a90('0x33')][_0x5a90('0x3c')](_0x5a90('0x3d'))){_0x53c8bf[_0x5a90('0x20')]=qs['limit'](_0x32ff23[_0x5a90('0x33')][_0x5a90('0x20')]);_0x53c8bf[_0x5a90('0x1f')]=qs[_0x5a90('0x1f')](_0x32ff23['query'][_0x5a90('0x1f')]);}_0x53c8bf[_0x5a90('0x3e')]=qs['sort'](_0x32ff23['query'][_0x5a90('0x3f')]);_0x53c8bf[_0x5a90('0x40')]=qs['filters'](_[_0x5a90('0x41')](_0x32ff23['query'],_0x42319e[_0x5a90('0x36')]));if(_0x16cd6c[_0x5a90('0x35')]){if(_0x16cd6c['dateEnd']){_0x16cd6c[_0x5a90('0x34')]=moment(_0x16cd6c[_0x5a90('0x34')])[_0x5a90('0x42')](0x1,'day');}else{_0x16cd6c[_0x5a90('0x34')]=moment(_0x16cd6c[_0x5a90('0x35')])['add'](0x1,_0x5a90('0x43'));}_[_0x5a90('0x44')](_0x53c8bf[_0x5a90('0x40')],{'createdAt':{'$gte':_0x16cd6c[_0x5a90('0x35')],'$lte':_0x16cd6c['dateEnd']}});}if(_0x32ff23[_0x5a90('0x33')]['filter']){_0x53c8bf[_0x5a90('0x40')]=_[_0x5a90('0x44')](_0x53c8bf[_0x5a90('0x40')],{'$or':_[_0x5a90('0x45')](_0x349b1a,function(_0x513f73){if(_0x513f73[_0x5a90('0x46')]['key']!==_0x5a90('0x47')){var _0x3dabdd={};_0x3dabdd[_0x513f73['field']]={'$like':'%'+_0x32ff23['query'][_0x5a90('0x48')]+'%'};return _0x3dabdd;}})});}_0x53c8bf=_[_0x5a90('0x44')]({},_0x53c8bf,_0x32ff23['options']);var _0x17be3f={'where':_0x53c8bf['where']};return db[_0x5a90('0x31')][_0x5a90('0x1e')](_0x17be3f)['then'](function(_0x5cc76c){_0x5109e3[_0x5a90('0x1e')]=_0x5cc76c;if(_0x32ff23[_0x5a90('0x33')][_0x5a90('0x49')]){_0x53c8bf[_0x5a90('0x4a')]=[{'all':!![]}];}return db[_0x5a90('0x31')][_0x5a90('0x4b')](_0x53c8bf);})[_0x5a90('0x27')](function(_0x706f0f){_0x5109e3[_0x5a90('0x4c')]=_0x706f0f;return _0x5109e3;})[_0x5a90('0x27')](respondWithFilteredResult(_0x15efaf,_0x53c8bf))[_0x5a90('0x4d')](handleError(_0x15efaf,null));};exports[_0x5a90('0x4e')]=function(_0x38e6fd,_0x5ca440){var _0x2266d8={'raw':!![],'where':{'id':_0x38e6fd[_0x5a90('0x4f')]['id']}},_0x4fe158={};_0x4fe158[_0x5a90('0x39')]=_['keys'](db['OpenchannelQueue']['rawAttributes']);_0x4fe158[_0x5a90('0x33')]=_[_0x5a90('0x50')](_0x38e6fd[_0x5a90('0x33')]);_0x4fe158['filters']=_['intersection'](_0x4fe158[_0x5a90('0x39')],_0x4fe158[_0x5a90('0x33')]);_0x2266d8[_0x5a90('0x38')]=_[_0x5a90('0x37')](_0x4fe158[_0x5a90('0x39')],qs[_0x5a90('0x3a')](_0x38e6fd[_0x5a90('0x33')][_0x5a90('0x3a')]));_0x2266d8[_0x5a90('0x38')]=_0x2266d8[_0x5a90('0x38')][_0x5a90('0x3b')]?_0x2266d8[_0x5a90('0x38')]:_0x4fe158[_0x5a90('0x39')];if(_0x38e6fd['query'][_0x5a90('0x49')]){_0x2266d8[_0x5a90('0x4a')]=[{'all':!![]}];}_0x2266d8=_[_0x5a90('0x44')]({},_0x2266d8,_0x38e6fd['options']);return db[_0x5a90('0x31')][_0x5a90('0x51')](_0x2266d8)[_0x5a90('0x27')](handleEntityNotFound(_0x5ca440,null))['then'](respondWithResult(_0x5ca440,null))[_0x5a90('0x4d')](handleError(_0x5ca440,null));};exports[_0x5a90('0x52')]=function(_0x5dea2a,_0x57d5ad){return db['OpenchannelQueue'][_0x5a90('0x52')](_0x5dea2a[_0x5a90('0x53')],{})['then'](function(_0x51fbbf){var _0x417aa9=_0x5dea2a[_0x5a90('0x54')]['get']({'plain':!![]});if(!_0x417aa9)throw new Error(_0x5a90('0x55'));if(_0x417aa9['role']===_0x5a90('0x54')){var _0x291035=_0x51fbbf[_0x5a90('0x29')]({'plain':!![]});var _0x277b9d='OpenchannelQueues';return db['UserProfileSection'][_0x5a90('0x51')]({'where':{'name':_0x277b9d,'userProfileId':_0x417aa9[_0x5a90('0x56')]},'raw':!![]})[_0x5a90('0x27')](function(_0x486749){if(_0x486749&&_0x486749[_0x5a90('0x57')]===0x0){return db[_0x5a90('0x2b')][_0x5a90('0x52')]({'name':_0x291035[_0x5a90('0x2e')],'resourceId':_0x291035['id'],'type':_0x486749[_0x5a90('0x2e')],'sectionId':_0x486749['id']},{})[_0x5a90('0x27')](function(){return _0x51fbbf;});}else{return _0x51fbbf;}})[_0x5a90('0x4d')](function(_0x10495e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10495e);throw _0x10495e;});}return _0x51fbbf;})['then'](respondWithResult(_0x57d5ad,0xc9))['catch'](handleError(_0x57d5ad,null));};exports[_0x5a90('0x26')]=function(_0x256bb8,_0x9d2929){if(_0x256bb8[_0x5a90('0x53')]['id']){delete _0x256bb8[_0x5a90('0x53')]['id'];}return db[_0x5a90('0x31')][_0x5a90('0x51')]({'where':{'id':_0x256bb8['params']['id']}})[_0x5a90('0x27')](handleEntityNotFound(_0x9d2929,null))[_0x5a90('0x27')](saveUpdates(_0x256bb8[_0x5a90('0x53')],null))[_0x5a90('0x27')](respondWithResult(_0x9d2929,null))['catch'](handleError(_0x9d2929,null));};exports[_0x5a90('0x28')]=function(_0x4633d0,_0x5fcdc5){return db['OpenchannelQueue']['find']({'where':{'id':_0x4633d0[_0x5a90('0x4f')]['id']}})[_0x5a90('0x27')](handleEntityNotFound(_0x5fcdc5,null))[_0x5a90('0x27')](removeEntity(_0x5fcdc5,null))[_0x5a90('0x4d')](handleError(_0x5fcdc5,null));};exports[_0x5a90('0x58')]=function(_0x50bb8e,_0x2ea5ab){return db[_0x5a90('0x31')][_0x5a90('0x58')]()[_0x5a90('0x27')](respondWithResult(_0x2ea5ab,null))[_0x5a90('0x4d')](handleError(_0x2ea5ab,null));};exports['getMembers']=function(_0x20d901,_0x54837e,_0x20334c){var _0x3a22f3={'raw':!![],'where':{}},_0x21cd6e={},_0x2a8e44;return db[_0x5a90('0x31')][_0x5a90('0x59')]({'where':{'id':_0x20d901[_0x5a90('0x4f')]['id']}})[_0x5a90('0x27')](handleEntityNotFound(_0x54837e,null))[_0x5a90('0x27')](function(_0x4b3936){if(_0x4b3936){_0x2a8e44=_0x4b3936[_0x5a90('0x29')]({'plain':!![]});_0x21cd6e['model']=_[_0x5a90('0x50')](db[_0x5a90('0x5a')][_0x5a90('0x32')]);_0x21cd6e[_0x5a90('0x33')]=_[_0x5a90('0x50')](_0x20d901[_0x5a90('0x33')]);_0x21cd6e[_0x5a90('0x36')]=_[_0x5a90('0x37')](_0x21cd6e[_0x5a90('0x39')],_0x21cd6e[_0x5a90('0x33')]);_0x3a22f3['attributes']=_[_0x5a90('0x37')](_0x21cd6e[_0x5a90('0x39')],qs[_0x5a90('0x3a')](_0x20d901['query'][_0x5a90('0x3a')]));_0x3a22f3[_0x5a90('0x38')]=_0x3a22f3[_0x5a90('0x38')][_0x5a90('0x3b')]?_0x3a22f3[_0x5a90('0x38')]:_0x21cd6e[_0x5a90('0x39')];if(!_0x20d901[_0x5a90('0x33')][_0x5a90('0x3c')](_0x5a90('0x3d'))){_0x3a22f3[_0x5a90('0x20')]=qs[_0x5a90('0x20')](_0x20d901[_0x5a90('0x33')][_0x5a90('0x20')]);_0x3a22f3[_0x5a90('0x1f')]=qs[_0x5a90('0x1f')](_0x20d901['query'][_0x5a90('0x1f')]);}_0x3a22f3[_0x5a90('0x3e')]=qs[_0x5a90('0x3f')](_0x20d901[_0x5a90('0x33')][_0x5a90('0x3f')]);_0x3a22f3[_0x5a90('0x40')]=qs[_0x5a90('0x36')](_[_0x5a90('0x41')](_0x20d901[_0x5a90('0x33')],_0x21cd6e['filters']));_0x3a22f3['where'][_0x5a90('0x5b')]=_0x4b3936['id'];if(_0x20d901[_0x5a90('0x33')][_0x5a90('0x48')]){_0x3a22f3[_0x5a90('0x40')]=_[_0x5a90('0x44')](_0x3a22f3[_0x5a90('0x40')],{'$or':_[_0x5a90('0x45')](_0x3a22f3[_0x5a90('0x38')],function(_0x22abf4){var _0x4c2ce8={};_0x4c2ce8[_0x22abf4]={'$like':'%'+_0x20d901[_0x5a90('0x33')][_0x5a90('0x48')]+'%'};return _0x4c2ce8;})});}_0x3a22f3=_[_0x5a90('0x44')]({},_0x3a22f3,_0x20d901[_0x5a90('0x5c')]);return db[_0x5a90('0x5a')][_0x5a90('0x4b')](_0x3a22f3);}})[_0x5a90('0x27')](function(_0x2d214c){if(_0x2d214c){return db[_0x5a90('0x5d')][_0x5a90('0x5e')]({'where':{'id':_['map'](_0x2d214c,'UserId'),'role':'agent'},'attributes':['id','name',_0x5a90('0x5f'),_0x5a90('0x60'),_0x5a90('0x61')]});}})[_0x5a90('0x27')](function(_0x118fc3){if(_0x118fc3){return{'count':_0x118fc3['count'],'rows':_['map'](_0x118fc3[_0x5a90('0x4c')],function(_0x7fb06a){return{'membername':_0x7fb06a[_0x5a90('0x2e')],'UserId':_0x7fb06a['id'],'queue_name':_0x2a8e44['name'],'OpenchannelQueueId':_0x2a8e44['id'],'interface':util[_0x5a90('0x62')](_0x5a90('0x63'),'SIP',_0x7fb06a[_0x5a90('0x2e')]),'penalty':0x0,'paused':_0x7fb06a[_0x5a90('0x5f')],'createdAt':_0x7fb06a[_0x5a90('0x61')],'updatedAt':_0x7fb06a[_0x5a90('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5a90('0x27')](respondWithFilteredResult(_0x54837e,_0x3a22f3))[_0x5a90('0x4d')](handleError(_0x54837e,null));};exports[_0x5a90('0x64')]=function(_0x267a20,_0x31f119,_0x3560be){var _0x23caa8={};var _0x353909={};var _0x249cac;var _0x36f8fa;return db['OpenchannelQueue'][_0x5a90('0x59')]({'where':{'id':_0x267a20['params']['id']}})[_0x5a90('0x27')](handleEntityNotFound(_0x31f119,null))[_0x5a90('0x27')](function(_0x8508e1){if(_0x8508e1){_0x249cac=_0x8508e1;_0x353909[_0x5a90('0x39')]=_[_0x5a90('0x50')](db[_0x5a90('0x65')][_0x5a90('0x32')]);_0x353909['query']=_[_0x5a90('0x50')](_0x267a20[_0x5a90('0x33')]);_0x353909[_0x5a90('0x36')]=_[_0x5a90('0x37')](_0x353909[_0x5a90('0x39')],_0x353909['query']);_0x23caa8[_0x5a90('0x38')]=_[_0x5a90('0x37')](_0x353909[_0x5a90('0x39')],qs[_0x5a90('0x3a')](_0x267a20[_0x5a90('0x33')][_0x5a90('0x3a')]));_0x23caa8[_0x5a90('0x38')]=_0x23caa8['attributes'][_0x5a90('0x3b')]?_0x23caa8['attributes']:_0x353909[_0x5a90('0x39')];_0x23caa8[_0x5a90('0x3e')]=qs[_0x5a90('0x3f')](_0x267a20[_0x5a90('0x33')][_0x5a90('0x3f')]);_0x23caa8[_0x5a90('0x40')]=qs['filters'](_[_0x5a90('0x41')](_0x267a20[_0x5a90('0x33')],_0x353909[_0x5a90('0x36')]));if(_0x267a20['query'][_0x5a90('0x48')]){_0x23caa8[_0x5a90('0x40')]=_[_0x5a90('0x44')](_0x23caa8[_0x5a90('0x40')],{'$or':_[_0x5a90('0x45')](_0x23caa8['attributes'],function(_0x3f36fd){var _0xcab1ed={};_0xcab1ed[_0x3f36fd]={'$like':'%'+_0x267a20[_0x5a90('0x33')]['filter']+'%'};return _0xcab1ed;})});}_0x23caa8=_[_0x5a90('0x44')]({},_0x23caa8,_0x267a20[_0x5a90('0x5c')]);return _0x249cac['getTeams'](_0x23caa8);}})[_0x5a90('0x27')](function(_0x575444){if(_0x575444){_0x36f8fa=_0x575444[_0x5a90('0x3b')];if(!_0x267a20[_0x5a90('0x33')][_0x5a90('0x3c')](_0x5a90('0x3d'))){_0x23caa8[_0x5a90('0x20')]=qs['limit'](_0x267a20[_0x5a90('0x33')]['limit']);_0x23caa8['offset']=qs[_0x5a90('0x1f')](_0x267a20[_0x5a90('0x33')][_0x5a90('0x1f')]);}return _0x249cac[_0x5a90('0x64')](_0x23caa8);}})[_0x5a90('0x27')](function(_0x1996ad){if(_0x1996ad){return _0x1996ad?{'count':_0x36f8fa,'rows':_0x1996ad}:null;}})['then'](respondWithResult(_0x31f119,null))[_0x5a90('0x4d')](handleError(_0x31f119,null));};exports['addTeams']=function(_0x3363d,_0x258d05,_0x1172d1){var _0x52fcbe=[];var _0x2ee17b;return db[_0x5a90('0x65')][_0x5a90('0x4b')]({'where':{'id':_0x3363d['body']['ids']},'attributes':['id'],'include':[{'model':db[_0x5a90('0x5d')],'as':_0x5a90('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5a90('0x27')](function(_0x4d7016){if(_0x4d7016){for(var _0x1ad3a8=0x0;_0x1ad3a8<_0x4d7016[_0x5a90('0x3b')];_0x1ad3a8+=0x1){for(var _0x35ac23=0x0;_0x35ac23<_0x4d7016[_0x1ad3a8][_0x5a90('0x66')][_0x5a90('0x3b')];_0x35ac23+=0x1){_0x52fcbe=_[_0x5a90('0x67')](_0x52fcbe,[_0x4d7016[_0x1ad3a8][_0x5a90('0x66')][_0x35ac23]['id']]);}}return _0x52fcbe;}})['then'](function(_0x29eb8f){if(_0x29eb8f){return db['OpenchannelQueue']['find']({'where':{'id':_0x3363d['params']['id']}});}})[_0x5a90('0x27')](function(_0x284979){if(_0x284979){_0x2ee17b=_0x284979;return _0x2ee17b[_0x5a90('0x68')](_0x52fcbe,{'penalty':_0x3363d['body'][_0x5a90('0x69')]});}})[_0x5a90('0x27')](function(_0x20e8f3){if(_0x20e8f3){return _0x2ee17b[_0x5a90('0x6a')](_0x3363d[_0x5a90('0x53')][_0x5a90('0x6b')]);}})['then'](handleEntityNotFound(_0x258d05,null))[_0x5a90('0x27')](respondWithStatusCode(_0x258d05,null))['catch'](handleError(_0x258d05,null));};exports[_0x5a90('0x6c')]=function(_0x4e7808,_0x5ebf77,_0x30ae88){var _0x4fbf30=[];var _0x2b5747;return db['Team'][_0x5a90('0x4b')]({'where':{'id':_0x4e7808[_0x5a90('0x33')][_0x5a90('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x5a90('0x5d')],'as':_0x5a90('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5a90('0x27')](function(_0x52c9f6){if(_0x52c9f6){for(var _0x50bb5e=0x0;_0x50bb5e<_0x52c9f6[_0x5a90('0x3b')];_0x50bb5e+=0x1){for(var _0x135cc9=0x0;_0x135cc9<_0x52c9f6[_0x50bb5e][_0x5a90('0x66')][_0x5a90('0x3b')];_0x135cc9+=0x1){_0x4fbf30=_['union'](_0x4fbf30,[_0x52c9f6[_0x50bb5e]['Agents'][_0x135cc9]['id']]);}}return _0x4fbf30;}})[_0x5a90('0x27')](function(_0x28bc08){if(_0x28bc08){return db[_0x5a90('0x31')][_0x5a90('0x51')]({'where':{'id':_0x4e7808[_0x5a90('0x4f')]['id']}});}})[_0x5a90('0x27')](function(_0x1cd110){if(_0x1cd110){_0x2b5747=_0x1cd110;return _0x2b5747[_0x5a90('0x6d')](_0x4fbf30);}})[_0x5a90('0x27')](function(_0xdfb4df){if(_0x2b5747){return _0x2b5747['removeTeams'](_0x4e7808[_0x5a90('0x33')]['ids']);}})[_0x5a90('0x27')](handleEntityNotFound(_0x5ebf77,null))[_0x5a90('0x27')](respondWithStatusCode(_0x5ebf77,null))[_0x5a90('0x4d')](handleError(_0x5ebf77,null));};exports[_0x5a90('0x68')]=function(_0xc0b908,_0x5ad55d,_0x547f88){return db[_0x5a90('0x31')][_0x5a90('0x51')]({'where':{'id':_0xc0b908[_0x5a90('0x4f')]['id']}})[_0x5a90('0x27')](handleEntityNotFound(_0x5ad55d,null))['then'](function(_0x3032d8){if(_0x3032d8){return _0x3032d8[_0x5a90('0x68')](_0xc0b908['body'][_0x5a90('0x6b')],_[_0x5a90('0x6e')](_0xc0b908[_0x5a90('0x53')],[_0x5a90('0x6b'),'id'])||{})[_0x5a90('0x6f')](function(_0x4c932d){for(var _0x4d4590=0x0;_0x4d4590<_0xc0b908['body'][_0x5a90('0x6b')][_0x5a90('0x3b')];_0x4d4590+=0x1){socket[_0x5a90('0x70')]('userOpenchannelQueue:save',{'UserId':_0xc0b908[_0x5a90('0x53')][_0x5a90('0x6b')][_0x4d4590],'OpenchannelQueueId':_0xc0b908[_0x5a90('0x4f')]['id']});}return _0x4c932d;});}})[_0x5a90('0x27')](respondWithResult(_0x5ad55d,null))[_0x5a90('0x4d')](handleError(_0x5ad55d,null));};exports['removeAgents']=function(_0x4c1069,_0x41cb93,_0x20f973){var _0x3bbe40;return db[_0x5a90('0x31')][_0x5a90('0x51')]({'where':{'id':_0x4c1069['params']['id']}})[_0x5a90('0x27')](handleEntityNotFound(_0x41cb93,null))['then'](function(_0x3fb8e0){if(_0x3fb8e0){return _0x3fb8e0['removeAgents'](_0x4c1069['query'][_0x5a90('0x6b')])['then'](function(_0x3288e6){if(_['isArray'](_0x4c1069[_0x5a90('0x33')][_0x5a90('0x6b')])){for(var _0x86680b=0x0;_0x86680b<_0x4c1069[_0x5a90('0x33')][_0x5a90('0x6b')][_0x5a90('0x3b')];_0x86680b+=0x1){socket['emit'](_0x5a90('0x71'),{'UserId':_0x4c1069[_0x5a90('0x33')]['ids'][_0x86680b],'OpenchannelQueueId':_0x4c1069[_0x5a90('0x4f')]['id']});}}else{socket['emit'](_0x5a90('0x71'),{'UserId':_0x4c1069[_0x5a90('0x33')]['ids'],'OpenchannelQueueId':_0x4c1069[_0x5a90('0x4f')]['id']});}});}})['then'](respondWithStatusCode(_0x41cb93,null))[_0x5a90('0x4d')](handleError(_0x41cb93,null));};exports[_0x5a90('0x72')]=function(_0x40b6af,_0x272283,_0x3864ce){var _0x5e0dd8={};var _0x14d33a={};var _0x1f38bc;var _0x1a5509;return db[_0x5a90('0x31')][_0x5a90('0x59')]({'where':{'id':_0x40b6af[_0x5a90('0x4f')]['id']}})[_0x5a90('0x27')](handleEntityNotFound(_0x272283,null))[_0x5a90('0x27')](function(_0x3a5b5b){if(_0x3a5b5b){_0x1f38bc=_0x3a5b5b;_0x14d33a[_0x5a90('0x39')]=_['keys'](db[_0x5a90('0x5d')][_0x5a90('0x32')]);_0x14d33a[_0x5a90('0x33')]=_[_0x5a90('0x50')](_0x40b6af[_0x5a90('0x33')]);_0x14d33a['filters']=_[_0x5a90('0x37')](_0x14d33a[_0x5a90('0x39')],_0x14d33a['query']);_0x5e0dd8['attributes']=_[_0x5a90('0x37')](_0x14d33a[_0x5a90('0x39')],qs[_0x5a90('0x3a')](_0x40b6af[_0x5a90('0x33')][_0x5a90('0x3a')]));_0x5e0dd8[_0x5a90('0x38')]=_0x5e0dd8[_0x5a90('0x38')][_0x5a90('0x3b')]?_0x5e0dd8[_0x5a90('0x38')]:_0x14d33a[_0x5a90('0x39')];_0x5e0dd8[_0x5a90('0x3e')]=qs[_0x5a90('0x3f')](_0x40b6af['query'][_0x5a90('0x3f')]);_0x5e0dd8['where']=qs[_0x5a90('0x36')](_['pick'](_0x40b6af['query'],_0x14d33a['filters']));if(_0x40b6af[_0x5a90('0x33')]['filter']){_0x5e0dd8[_0x5a90('0x40')]=_[_0x5a90('0x44')](_0x5e0dd8['where'],{'$or':_[_0x5a90('0x45')](_0x5e0dd8[_0x5a90('0x38')],function(_0x19b3f3){var _0x363079={};_0x363079[_0x19b3f3]={'$like':'%'+_0x40b6af[_0x5a90('0x33')]['filter']+'%'};return _0x363079;})});}_0x5e0dd8=_[_0x5a90('0x44')]({},_0x5e0dd8,_0x40b6af[_0x5a90('0x5c')]);return _0x1f38bc['getAgents'](_0x5e0dd8);}})['then'](function(_0x2d67b9){if(_0x2d67b9){_0x1a5509=_0x2d67b9[_0x5a90('0x3b')];if(!_0x40b6af[_0x5a90('0x33')][_0x5a90('0x3c')](_0x5a90('0x3d'))){_0x5e0dd8[_0x5a90('0x20')]=qs['limit'](_0x40b6af[_0x5a90('0x33')][_0x5a90('0x20')]);_0x5e0dd8[_0x5a90('0x1f')]=qs[_0x5a90('0x1f')](_0x40b6af[_0x5a90('0x33')][_0x5a90('0x1f')]);}return _0x1f38bc[_0x5a90('0x72')](_0x5e0dd8);}})[_0x5a90('0x27')](function(_0x140ff9){if(_0x140ff9){return _0x140ff9?{'count':_0x1a5509,'rows':_0x140ff9}:null;}})['then'](respondWithResult(_0x272283,null))[_0x5a90('0x4d')](handleError(_0x272283,null));};
\ No newline at end of file
+var _0x3587=['limit','order','sort','where','day','add','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','getMembers','findOne','nolimit','OpenchannelQueueId','UserOpenchannelQueue','UserId','openchannelPause','format','%s/%s','SIP','getTeams','Team','pick','addTeams','User','union','Agents','addAgents','penalty','removeTeams','ids','omit','spread','emit','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json','count','offset','set','Content-Range','apply','save','then','UserProfileResource','end','sendStatus','error','stack','name','send','index','OpenchannelQueue','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x9dca4c,_0xc09e49){var _0x4c8506=function(_0x8305bf){while(--_0x8305bf){_0x9dca4c['push'](_0x9dca4c['shift']());}};_0x4c8506(++_0xc09e49);}(_0x3587,0x1ae));var _0x7358=function(_0x3628a7,_0x525338){_0x3628a7=_0x3628a7-0x0;var _0x28a2b3=_0x3587[_0x3628a7];return _0x28a2b3;};'use strict';var pdf=require(_0x7358('0x0'));var emlformat=require(_0x7358('0x1'));var rimraf=require(_0x7358('0x2'));var zipdir=require(_0x7358('0x3'));var jsonpatch=require(_0x7358('0x4'));var rp=require(_0x7358('0x5'));var moment=require('moment');var BPromise=require(_0x7358('0x6'));var Mustache=require(_0x7358('0x7'));var util=require(_0x7358('0x8'));var path=require(_0x7358('0x9'));var sox=require(_0x7358('0xa'));var csv=require(_0x7358('0xb'));var ejs=require(_0x7358('0xc'));var fs=require('fs');var _=require(_0x7358('0xd'));var squel=require(_0x7358('0xe'));var crypto=require(_0x7358('0xf'));var jsforce=require(_0x7358('0x10'));var deskjs=require(_0x7358('0x11'));var toCsv=require(_0x7358('0xb'));var querystring=require('querystring');var Papa=require(_0x7358('0x12'));var Redis=require(_0x7358('0x13'));var qs=require('../../components/parsers/qs');var logger=require(_0x7358('0x14'))(_0x7358('0x15'));var utils=require(_0x7358('0x16'));var config=require('../../config/environment');var db=require(_0x7358('0x17'))['db'];config['redis']=_[_0x7358('0x18')](config[_0x7358('0x19')],{'host':_0x7358('0x1a'),'port':0x18eb});var socket=require(_0x7358('0x1b'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x7358('0x1c')](socket);function respondWithStatusCode(_0x5c7047,_0x272bb8){_0x272bb8=_0x272bb8||0xcc;return function(_0x2478fa){if(_0x2478fa){return _0x5c7047['sendStatus'](_0x272bb8);}return _0x5c7047['status'](_0x272bb8)['end']();};}function respondWithResult(_0x5b57c8,_0x45b02f){_0x45b02f=_0x45b02f||0xc8;return function(_0xf70835){if(_0xf70835){return _0x5b57c8[_0x7358('0x1d')](_0x45b02f)[_0x7358('0x1e')](_0xf70835);}};}function respondWithFilteredResult(_0x3a87df,_0x382ca9){return function(_0x5d82d8){if(_0x5d82d8){var _0x3dff1d=_0x5d82d8[_0x7358('0x1f')],_0x251b81=_0x382ca9[_0x7358('0x20')],_0x12ef1e=_0x382ca9['offset']+_0x382ca9['limit'],_0x1e0617;if(_0x12ef1e>=_0x3dff1d){_0x12ef1e=_0x3dff1d;_0x1e0617=0xc8;}else{_0x1e0617=0xce;}_0x3a87df['status'](_0x1e0617);return _0x3a87df[_0x7358('0x21')](_0x7358('0x22'),_0x251b81+'-'+_0x12ef1e+'/'+_0x3dff1d)[_0x7358('0x1e')](_0x5d82d8);}return null;};}function patchUpdates(_0x174ed1){return function(_0x4bda02){try{jsonpatch[_0x7358('0x23')](_0x4bda02,_0x174ed1,!![]);}catch(_0x370346){return BPromise['reject'](_0x370346);}return _0x4bda02[_0x7358('0x24')]();};}function saveUpdates(_0x191cae,_0x1ae0e4){return function(_0x1a71af){if(_0x1a71af){return _0x1a71af['update'](_0x191cae)[_0x7358('0x25')](function(_0x543626){return _0x543626;});}return null;};}function removeEntity(_0x223a55,_0x20ba47){return function(_0x4b045f){if(_0x4b045f){return _0x4b045f['destroy']()[_0x7358('0x25')](function(){var _0x396564=_0x4b045f['get']({'plain':!![]});var _0x16df31='OpenchannelQueues';return db[_0x7358('0x26')]['destroy']({'where':{'type':_0x16df31,'resourceId':_0x396564['id']}})[_0x7358('0x25')](function(){return _0x4b045f;});})[_0x7358('0x25')](function(){_0x223a55[_0x7358('0x1d')](0xcc)[_0x7358('0x27')]();});}};}function handleEntityNotFound(_0x56995a,_0x2b7b21){return function(_0x26fc66){if(!_0x26fc66){_0x56995a[_0x7358('0x28')](0x194);}return _0x26fc66;};}function handleError(_0x3e7085,_0x3bfd46){_0x3bfd46=_0x3bfd46||0x1f4;return function(_0x1ddd16){logger[_0x7358('0x29')](_0x1ddd16[_0x7358('0x2a')]);if(_0x1ddd16[_0x7358('0x2b')]){delete _0x1ddd16[_0x7358('0x2b')];}_0x3e7085[_0x7358('0x1d')](_0x3bfd46)[_0x7358('0x2c')](_0x1ddd16);};}exports[_0x7358('0x2d')]=function(_0x4565b8,_0x64ce45){var _0x21fe47={},_0x13424d={},_0x5a0691={'count':0x0,'rows':[]};var _0x2295e0=db[_0x7358('0x2e')]['rawAttributes'];_0x13424d[_0x7358('0x2f')]=_[_0x7358('0x30')](_0x2295e0);var _0x1d6b60={'dateStart':_0x4565b8[_0x7358('0x31')][_0x7358('0x32')],'dateEnd':_0x4565b8['query'][_0x7358('0x33')]};delete _0x4565b8['query']['dateStart'];delete _0x4565b8[_0x7358('0x31')][_0x7358('0x33')];_0x13424d['query']=_[_0x7358('0x30')](_0x4565b8['query']);_0x13424d[_0x7358('0x34')]=_[_0x7358('0x35')](_0x13424d[_0x7358('0x2f')],_0x13424d['query']);_0x21fe47[_0x7358('0x36')]=_[_0x7358('0x35')](_0x13424d[_0x7358('0x2f')],qs[_0x7358('0x37')](_0x4565b8[_0x7358('0x31')][_0x7358('0x37')]));_0x21fe47[_0x7358('0x36')]=_0x21fe47[_0x7358('0x36')][_0x7358('0x38')]?_0x21fe47[_0x7358('0x36')]:_0x13424d[_0x7358('0x2f')];if(!_0x4565b8[_0x7358('0x31')][_0x7358('0x39')]('nolimit')){_0x21fe47[_0x7358('0x3a')]=qs['limit'](_0x4565b8[_0x7358('0x31')][_0x7358('0x3a')]);_0x21fe47[_0x7358('0x20')]=qs['offset'](_0x4565b8['query'][_0x7358('0x20')]);}_0x21fe47[_0x7358('0x3b')]=qs[_0x7358('0x3c')](_0x4565b8['query'][_0x7358('0x3c')]);_0x21fe47[_0x7358('0x3d')]=qs['filters'](_['pick'](_0x4565b8['query'],_0x13424d[_0x7358('0x34')]));if(_0x1d6b60[_0x7358('0x32')]){if(_0x1d6b60[_0x7358('0x33')]){_0x1d6b60[_0x7358('0x33')]=moment(_0x1d6b60[_0x7358('0x33')])['add'](0x1,_0x7358('0x3e'));}else{_0x1d6b60[_0x7358('0x33')]=moment(_0x1d6b60[_0x7358('0x32')])[_0x7358('0x3f')](0x1,_0x7358('0x3e'));}_[_0x7358('0x40')](_0x21fe47[_0x7358('0x3d')],{'createdAt':{'$gte':_0x1d6b60[_0x7358('0x32')],'$lte':_0x1d6b60[_0x7358('0x33')]}});}if(_0x4565b8[_0x7358('0x31')]['filter']){_0x21fe47[_0x7358('0x3d')]=_[_0x7358('0x40')](_0x21fe47['where'],{'$or':_[_0x7358('0x41')](_0x2295e0,function(_0x291a1f){if(_0x291a1f[_0x7358('0x42')][_0x7358('0x43')]!==_0x7358('0x44')){var _0x932d01={};_0x932d01[_0x291a1f[_0x7358('0x45')]]={'$like':'%'+_0x4565b8['query'][_0x7358('0x46')]+'%'};return _0x932d01;}})});}_0x21fe47=_[_0x7358('0x40')]({},_0x21fe47,_0x4565b8[_0x7358('0x47')]);var _0x1e7cfb={'where':_0x21fe47[_0x7358('0x3d')]};return db[_0x7358('0x2e')][_0x7358('0x1f')](_0x1e7cfb)['then'](function(_0x3f3d46){_0x5a0691[_0x7358('0x1f')]=_0x3f3d46;if(_0x4565b8[_0x7358('0x31')][_0x7358('0x48')]){_0x21fe47[_0x7358('0x49')]=[{'all':!![]}];}return db[_0x7358('0x2e')][_0x7358('0x4a')](_0x21fe47);})['then'](function(_0x3c07d9){_0x5a0691[_0x7358('0x4b')]=_0x3c07d9;return _0x5a0691;})['then'](respondWithFilteredResult(_0x64ce45,_0x21fe47))['catch'](handleError(_0x64ce45,null));};exports[_0x7358('0x4c')]=function(_0x280339,_0x4f62a6){var _0x55d3e3={'raw':!![],'where':{'id':_0x280339[_0x7358('0x4d')]['id']}},_0x49c3e0={};_0x49c3e0[_0x7358('0x2f')]=_[_0x7358('0x30')](db[_0x7358('0x2e')][_0x7358('0x4e')]);_0x49c3e0['query']=_['keys'](_0x280339[_0x7358('0x31')]);_0x49c3e0[_0x7358('0x34')]=_['intersection'](_0x49c3e0[_0x7358('0x2f')],_0x49c3e0[_0x7358('0x31')]);_0x55d3e3[_0x7358('0x36')]=_['intersection'](_0x49c3e0[_0x7358('0x2f')],qs['fields'](_0x280339[_0x7358('0x31')]['fields']));_0x55d3e3['attributes']=_0x55d3e3['attributes'][_0x7358('0x38')]?_0x55d3e3[_0x7358('0x36')]:_0x49c3e0[_0x7358('0x2f')];if(_0x280339['query']['includeAll']){_0x55d3e3[_0x7358('0x49')]=[{'all':!![]}];}_0x55d3e3=_[_0x7358('0x40')]({},_0x55d3e3,_0x280339['options']);return db['OpenchannelQueue'][_0x7358('0x4f')](_0x55d3e3)[_0x7358('0x25')](handleEntityNotFound(_0x4f62a6,null))['then'](respondWithResult(_0x4f62a6,null))['catch'](handleError(_0x4f62a6,null));};exports['create']=function(_0x50e5c0,_0x453c34){return db[_0x7358('0x2e')][_0x7358('0x50')](_0x50e5c0[_0x7358('0x51')],{})[_0x7358('0x25')](function(_0x52514c){var _0x479f38=_0x50e5c0[_0x7358('0x52')][_0x7358('0x53')]({'plain':!![]});if(!_0x479f38)throw new Error(_0x7358('0x54'));if(_0x479f38[_0x7358('0x55')]===_0x7358('0x52')){var _0x1bc6d8=_0x52514c['get']({'plain':!![]});var _0x41c9ea=_0x7358('0x56');return db['UserProfileSection'][_0x7358('0x4f')]({'where':{'name':_0x41c9ea,'userProfileId':_0x479f38['userProfileId']},'raw':!![]})['then'](function(_0x3ccfdb){if(_0x3ccfdb&&_0x3ccfdb[_0x7358('0x57')]===0x0){return db[_0x7358('0x26')]['create']({'name':_0x1bc6d8['name'],'resourceId':_0x1bc6d8['id'],'type':_0x3ccfdb[_0x7358('0x2b')],'sectionId':_0x3ccfdb['id']},{})['then'](function(){return _0x52514c;});}else{return _0x52514c;}})[_0x7358('0x58')](function(_0x44ebcd){logger[_0x7358('0x29')](_0x7358('0x59'),_0x44ebcd);throw _0x44ebcd;});}return _0x52514c;})['then'](respondWithResult(_0x453c34,0xc9))[_0x7358('0x58')](handleError(_0x453c34,null));};exports[_0x7358('0x5a')]=function(_0x5633c5,_0x1a37a8){if(_0x5633c5[_0x7358('0x51')]['id']){delete _0x5633c5[_0x7358('0x51')]['id'];}return db[_0x7358('0x2e')]['find']({'where':{'id':_0x5633c5[_0x7358('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a37a8,null))[_0x7358('0x25')](saveUpdates(_0x5633c5['body'],null))[_0x7358('0x25')](respondWithResult(_0x1a37a8,null))[_0x7358('0x58')](handleError(_0x1a37a8,null));};exports[_0x7358('0x5b')]=function(_0x393f73,_0x352ed4){return db[_0x7358('0x2e')][_0x7358('0x4f')]({'where':{'id':_0x393f73[_0x7358('0x4d')]['id']}})[_0x7358('0x25')](handleEntityNotFound(_0x352ed4,null))['then'](removeEntity(_0x352ed4,null))[_0x7358('0x58')](handleError(_0x352ed4,null));};exports['describe']=function(_0x2ad5cd,_0x5da5fa){return db[_0x7358('0x2e')][_0x7358('0x5c')]()[_0x7358('0x25')](respondWithResult(_0x5da5fa,null))[_0x7358('0x58')](handleError(_0x5da5fa,null));};exports[_0x7358('0x5d')]=function(_0x45bea9,_0xd86e3,_0x135870){var _0x15802f={'raw':!![],'where':{}},_0x2f889d={},_0x1f283b;return db['OpenchannelQueue'][_0x7358('0x5e')]({'where':{'id':_0x45bea9[_0x7358('0x4d')]['id']}})['then'](handleEntityNotFound(_0xd86e3,null))[_0x7358('0x25')](function(_0x291eab){if(_0x291eab){_0x1f283b=_0x291eab[_0x7358('0x53')]({'plain':!![]});_0x2f889d[_0x7358('0x2f')]=_[_0x7358('0x30')](db['UserOpenchannelQueue']['rawAttributes']);_0x2f889d[_0x7358('0x31')]=_[_0x7358('0x30')](_0x45bea9[_0x7358('0x31')]);_0x2f889d[_0x7358('0x34')]=_[_0x7358('0x35')](_0x2f889d['model'],_0x2f889d['query']);_0x15802f[_0x7358('0x36')]=_['intersection'](_0x2f889d[_0x7358('0x2f')],qs[_0x7358('0x37')](_0x45bea9[_0x7358('0x31')][_0x7358('0x37')]));_0x15802f[_0x7358('0x36')]=_0x15802f['attributes'][_0x7358('0x38')]?_0x15802f['attributes']:_0x2f889d['model'];if(!_0x45bea9['query']['hasOwnProperty'](_0x7358('0x5f'))){_0x15802f[_0x7358('0x3a')]=qs[_0x7358('0x3a')](_0x45bea9[_0x7358('0x31')][_0x7358('0x3a')]);_0x15802f[_0x7358('0x20')]=qs[_0x7358('0x20')](_0x45bea9[_0x7358('0x31')][_0x7358('0x20')]);}_0x15802f['order']=qs[_0x7358('0x3c')](_0x45bea9[_0x7358('0x31')]['sort']);_0x15802f[_0x7358('0x3d')]=qs[_0x7358('0x34')](_['pick'](_0x45bea9[_0x7358('0x31')],_0x2f889d[_0x7358('0x34')]));_0x15802f[_0x7358('0x3d')][_0x7358('0x60')]=_0x291eab['id'];if(_0x45bea9[_0x7358('0x31')]['filter']){_0x15802f['where']=_[_0x7358('0x40')](_0x15802f[_0x7358('0x3d')],{'$or':_[_0x7358('0x41')](_0x15802f[_0x7358('0x36')],function(_0x4ce992){var _0x1226a9={};_0x1226a9[_0x4ce992]={'$like':'%'+_0x45bea9[_0x7358('0x31')]['filter']+'%'};return _0x1226a9;})});}_0x15802f=_[_0x7358('0x40')]({},_0x15802f,_0x45bea9[_0x7358('0x47')]);return db[_0x7358('0x61')][_0x7358('0x4a')](_0x15802f);}})[_0x7358('0x25')](function(_0x2e8775){if(_0x2e8775){return db['User']['findAndCountAll']({'where':{'id':_[_0x7358('0x41')](_0x2e8775,_0x7358('0x62')),'role':'agent'},'attributes':['id',_0x7358('0x2b'),_0x7358('0x63'),'updatedAt','createdAt']});}})[_0x7358('0x25')](function(_0x4bf0ca){if(_0x4bf0ca){return{'count':_0x4bf0ca[_0x7358('0x1f')],'rows':_['map'](_0x4bf0ca[_0x7358('0x4b')],function(_0x473848){return{'membername':_0x473848[_0x7358('0x2b')],'UserId':_0x473848['id'],'queue_name':_0x1f283b[_0x7358('0x2b')],'OpenchannelQueueId':_0x1f283b['id'],'interface':util[_0x7358('0x64')](_0x7358('0x65'),_0x7358('0x66'),_0x473848['name']),'penalty':0x0,'paused':_0x473848[_0x7358('0x63')],'createdAt':_0x473848['createdAt'],'updatedAt':_0x473848['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7358('0x25')](respondWithFilteredResult(_0xd86e3,_0x15802f))[_0x7358('0x58')](handleError(_0xd86e3,null));};exports[_0x7358('0x67')]=function(_0x29e7ad,_0x35c6e3,_0x39dc89){var _0x5632a9={};var _0x2a543f={};var _0x464d18;var _0x21bfe9;return db['OpenchannelQueue'][_0x7358('0x5e')]({'where':{'id':_0x29e7ad[_0x7358('0x4d')]['id']}})[_0x7358('0x25')](handleEntityNotFound(_0x35c6e3,null))[_0x7358('0x25')](function(_0x435bb4){if(_0x435bb4){_0x464d18=_0x435bb4;_0x2a543f[_0x7358('0x2f')]=_[_0x7358('0x30')](db[_0x7358('0x68')][_0x7358('0x4e')]);_0x2a543f[_0x7358('0x31')]=_[_0x7358('0x30')](_0x29e7ad[_0x7358('0x31')]);_0x2a543f[_0x7358('0x34')]=_[_0x7358('0x35')](_0x2a543f['model'],_0x2a543f['query']);_0x5632a9['attributes']=_[_0x7358('0x35')](_0x2a543f[_0x7358('0x2f')],qs[_0x7358('0x37')](_0x29e7ad[_0x7358('0x31')][_0x7358('0x37')]));_0x5632a9[_0x7358('0x36')]=_0x5632a9[_0x7358('0x36')][_0x7358('0x38')]?_0x5632a9[_0x7358('0x36')]:_0x2a543f[_0x7358('0x2f')];_0x5632a9['order']=qs[_0x7358('0x3c')](_0x29e7ad[_0x7358('0x31')][_0x7358('0x3c')]);_0x5632a9[_0x7358('0x3d')]=qs[_0x7358('0x34')](_[_0x7358('0x69')](_0x29e7ad['query'],_0x2a543f[_0x7358('0x34')]));if(_0x29e7ad[_0x7358('0x31')][_0x7358('0x46')]){_0x5632a9['where']=_[_0x7358('0x40')](_0x5632a9['where'],{'$or':_[_0x7358('0x41')](_0x5632a9[_0x7358('0x36')],function(_0x2637d2){var _0x2e8259={};_0x2e8259[_0x2637d2]={'$like':'%'+_0x29e7ad[_0x7358('0x31')][_0x7358('0x46')]+'%'};return _0x2e8259;})});}_0x5632a9=_[_0x7358('0x40')]({},_0x5632a9,_0x29e7ad[_0x7358('0x47')]);return _0x464d18[_0x7358('0x67')](_0x5632a9);}})[_0x7358('0x25')](function(_0x373567){if(_0x373567){_0x21bfe9=_0x373567[_0x7358('0x38')];if(!_0x29e7ad[_0x7358('0x31')][_0x7358('0x39')]('nolimit')){_0x5632a9[_0x7358('0x3a')]=qs[_0x7358('0x3a')](_0x29e7ad[_0x7358('0x31')]['limit']);_0x5632a9['offset']=qs[_0x7358('0x20')](_0x29e7ad[_0x7358('0x31')][_0x7358('0x20')]);}return _0x464d18[_0x7358('0x67')](_0x5632a9);}})['then'](function(_0x2a8601){if(_0x2a8601){return _0x2a8601?{'count':_0x21bfe9,'rows':_0x2a8601}:null;}})[_0x7358('0x25')](respondWithResult(_0x35c6e3,null))['catch'](handleError(_0x35c6e3,null));};exports[_0x7358('0x6a')]=function(_0xd2b3da,_0x18b3aa,_0x7a2c06){var _0x3c9d0b=[];var _0x4b8a01;return db[_0x7358('0x68')][_0x7358('0x4a')]({'where':{'id':_0xd2b3da['body']['ids']},'attributes':['id'],'include':[{'model':db[_0x7358('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7358('0x25')](function(_0x26948b){if(_0x26948b){for(var _0x4f315f=0x0;_0x4f315f<_0x26948b['length'];_0x4f315f+=0x1){for(var _0x36265f=0x0;_0x36265f<_0x26948b[_0x4f315f]['Agents']['length'];_0x36265f+=0x1){_0x3c9d0b=_[_0x7358('0x6c')](_0x3c9d0b,[_0x26948b[_0x4f315f][_0x7358('0x6d')][_0x36265f]['id']]);}}return _0x3c9d0b;}})[_0x7358('0x25')](function(_0x6b2197){if(_0x6b2197){return db[_0x7358('0x2e')][_0x7358('0x4f')]({'where':{'id':_0xd2b3da['params']['id']}});}})['then'](function(_0x4c953e){if(_0x4c953e){_0x4b8a01=_0x4c953e;return _0x4b8a01[_0x7358('0x6e')](_0x3c9d0b,{'penalty':_0xd2b3da[_0x7358('0x51')][_0x7358('0x6f')]});}})[_0x7358('0x25')](function(_0x5f90af){if(_0x5f90af){return _0x4b8a01[_0x7358('0x6a')](_0xd2b3da[_0x7358('0x51')]['ids']);}})[_0x7358('0x25')](handleEntityNotFound(_0x18b3aa,null))[_0x7358('0x25')](respondWithStatusCode(_0x18b3aa,null))[_0x7358('0x58')](handleError(_0x18b3aa,null));};exports[_0x7358('0x70')]=function(_0x1d061b,_0x5ee6fd,_0x1981da){var _0x37e466=[];var _0x4170ac;return db[_0x7358('0x68')][_0x7358('0x4a')]({'where':{'id':_0x1d061b[_0x7358('0x31')][_0x7358('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7358('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x7358('0x25')](function(_0x2d9393){if(_0x2d9393){for(var _0x561d23=0x0;_0x561d23<_0x2d9393[_0x7358('0x38')];_0x561d23+=0x1){for(var _0x1b1c21=0x0;_0x1b1c21<_0x2d9393[_0x561d23][_0x7358('0x6d')][_0x7358('0x38')];_0x1b1c21+=0x1){_0x37e466=_['union'](_0x37e466,[_0x2d9393[_0x561d23][_0x7358('0x6d')][_0x1b1c21]['id']]);}}return _0x37e466;}})['then'](function(_0x55930c){if(_0x55930c){return db[_0x7358('0x2e')][_0x7358('0x4f')]({'where':{'id':_0x1d061b[_0x7358('0x4d')]['id']}});}})[_0x7358('0x25')](function(_0x472318){if(_0x472318){_0x4170ac=_0x472318;return _0x4170ac['removeAgents'](_0x37e466);}})[_0x7358('0x25')](function(_0x70a6fb){if(_0x4170ac){return _0x4170ac[_0x7358('0x70')](_0x1d061b['query'][_0x7358('0x71')]);}})['then'](handleEntityNotFound(_0x5ee6fd,null))['then'](respondWithStatusCode(_0x5ee6fd,null))[_0x7358('0x58')](handleError(_0x5ee6fd,null));};exports[_0x7358('0x6e')]=function(_0x495322,_0x3453da,_0x11fdee){return db[_0x7358('0x2e')][_0x7358('0x4f')]({'where':{'id':_0x495322['params']['id']}})[_0x7358('0x25')](handleEntityNotFound(_0x3453da,null))[_0x7358('0x25')](function(_0x4e8772){if(_0x4e8772){return _0x4e8772[_0x7358('0x6e')](_0x495322[_0x7358('0x51')][_0x7358('0x71')],_[_0x7358('0x72')](_0x495322['body'],[_0x7358('0x71'),'id'])||{})[_0x7358('0x73')](function(_0x3aac65){for(var _0x12cecf=0x0;_0x12cecf<_0x495322[_0x7358('0x51')]['ids'][_0x7358('0x38')];_0x12cecf+=0x1){socket[_0x7358('0x74')](_0x7358('0x75'),{'UserId':_0x495322[_0x7358('0x51')]['ids'][_0x12cecf],'OpenchannelQueueId':_0x495322[_0x7358('0x4d')]['id']});}return _0x3aac65;});}})['then'](respondWithResult(_0x3453da,null))['catch'](handleError(_0x3453da,null));};exports[_0x7358('0x76')]=function(_0x142eb0,_0x41f507,_0x1b8d7a){var _0x2bb106;return db[_0x7358('0x2e')][_0x7358('0x4f')]({'where':{'id':_0x142eb0[_0x7358('0x4d')]['id']}})[_0x7358('0x25')](handleEntityNotFound(_0x41f507,null))[_0x7358('0x25')](function(_0x37c8b7){if(_0x37c8b7){return _0x37c8b7[_0x7358('0x76')](_0x142eb0[_0x7358('0x31')][_0x7358('0x71')])[_0x7358('0x25')](function(_0x427c91){if(_[_0x7358('0x77')](_0x142eb0['query'][_0x7358('0x71')])){for(var _0x26e90c=0x0;_0x26e90c<_0x142eb0[_0x7358('0x31')][_0x7358('0x71')][_0x7358('0x38')];_0x26e90c+=0x1){socket['emit'](_0x7358('0x78'),{'UserId':_0x142eb0[_0x7358('0x31')][_0x7358('0x71')][_0x26e90c],'OpenchannelQueueId':_0x142eb0[_0x7358('0x4d')]['id']});}}else{socket[_0x7358('0x74')](_0x7358('0x78'),{'UserId':_0x142eb0[_0x7358('0x31')][_0x7358('0x71')],'OpenchannelQueueId':_0x142eb0['params']['id']});}});}})['then'](respondWithStatusCode(_0x41f507,null))[_0x7358('0x58')](handleError(_0x41f507,null));};exports[_0x7358('0x79')]=function(_0x4bd049,_0x113662,_0x11c891){var _0x5ce8f2={};var _0x4f40c3={};var _0x3fe2da;var _0x674dd0;return db[_0x7358('0x2e')]['findOne']({'where':{'id':_0x4bd049['params']['id']}})['then'](handleEntityNotFound(_0x113662,null))[_0x7358('0x25')](function(_0x3deab4){if(_0x3deab4){_0x3fe2da=_0x3deab4;_0x4f40c3[_0x7358('0x2f')]=_[_0x7358('0x30')](db[_0x7358('0x6b')]['rawAttributes']);_0x4f40c3['query']=_['keys'](_0x4bd049[_0x7358('0x31')]);_0x4f40c3[_0x7358('0x34')]=_[_0x7358('0x35')](_0x4f40c3['model'],_0x4f40c3[_0x7358('0x31')]);_0x5ce8f2[_0x7358('0x36')]=_[_0x7358('0x35')](_0x4f40c3[_0x7358('0x2f')],qs[_0x7358('0x37')](_0x4bd049[_0x7358('0x31')][_0x7358('0x37')]));_0x5ce8f2[_0x7358('0x36')]=_0x5ce8f2[_0x7358('0x36')]['length']?_0x5ce8f2[_0x7358('0x36')]:_0x4f40c3[_0x7358('0x2f')];_0x5ce8f2[_0x7358('0x3b')]=qs[_0x7358('0x3c')](_0x4bd049[_0x7358('0x31')][_0x7358('0x3c')]);_0x5ce8f2[_0x7358('0x3d')]=qs['filters'](_['pick'](_0x4bd049[_0x7358('0x31')],_0x4f40c3[_0x7358('0x34')]));if(_0x4bd049[_0x7358('0x31')][_0x7358('0x46')]){_0x5ce8f2[_0x7358('0x3d')]=_[_0x7358('0x40')](_0x5ce8f2[_0x7358('0x3d')],{'$or':_[_0x7358('0x41')](_0x5ce8f2[_0x7358('0x36')],function(_0x737d8){var _0xe3969={};_0xe3969[_0x737d8]={'$like':'%'+_0x4bd049['query'][_0x7358('0x46')]+'%'};return _0xe3969;})});}_0x5ce8f2=_['merge']({},_0x5ce8f2,_0x4bd049['options']);return _0x3fe2da[_0x7358('0x79')](_0x5ce8f2);}})[_0x7358('0x25')](function(_0x22e449){if(_0x22e449){_0x674dd0=_0x22e449[_0x7358('0x38')];if(!_0x4bd049[_0x7358('0x31')][_0x7358('0x39')](_0x7358('0x5f'))){_0x5ce8f2['limit']=qs[_0x7358('0x3a')](_0x4bd049[_0x7358('0x31')][_0x7358('0x3a')]);_0x5ce8f2[_0x7358('0x20')]=qs[_0x7358('0x20')](_0x4bd049['query'][_0x7358('0x20')]);}return _0x3fe2da[_0x7358('0x79')](_0x5ce8f2);}})[_0x7358('0x25')](function(_0x15beeb){if(_0x15beeb){return _0x15beeb?{'count':_0x674dd0,'rows':_0x15beeb}:null;}})['then'](respondWithResult(_0x113662,null))[_0x7358('0x58')](handleError(_0x113662,null));};
\ No newline at end of file
index 6261c1a..cb8ff92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa768=['exports','events','../../mysqldb','OpenchannelQueue','update','remove','emit'];(function(_0x47327a,_0xa744ab){var _0x258c4c=function(_0x4f043){while(--_0x4f043){_0x47327a['push'](_0x47327a['shift']());}};_0x258c4c(++_0xa744ab);}(_0xa768,0xbe));var _0x8a76=function(_0x205e7b,_0x30d30d){_0x205e7b=_0x205e7b-0x0;var _0x16e2f5=_0xa768[_0x205e7b];return _0x16e2f5;};'use strict';var EventEmitter=require(_0x8a76('0x0'));var OpenchannelQueue=require(_0x8a76('0x1'))['db'][_0x8a76('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a76('0x3'),'afterDestroy':_0x8a76('0x4')};function emitEvent(_0x40dc02){return function(_0x1aeef4,_0x21b52f,_0x4c8a71){OpenchannelQueueEvents[_0x8a76('0x5')](_0x40dc02+':'+_0x1aeef4['id'],_0x1aeef4);OpenchannelQueueEvents['emit'](_0x40dc02,_0x1aeef4);_0x4c8a71(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x8a76('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xdb88=['OpenchannelQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4481c5,_0x5e5cd2){var _0x2e332f=function(_0x48254c){while(--_0x48254c){_0x4481c5['push'](_0x4481c5['shift']());}};_0x2e332f(++_0x5e5cd2);}(_0xdb88,0x198));var _0x8db8=function(_0x454ea9,_0x4f9868){_0x454ea9=_0x454ea9-0x0;var _0x5dbe48=_0xdb88[_0x454ea9];return _0x5dbe48;};'use strict';var EventEmitter=require(_0x8db8('0x0'));var OpenchannelQueue=require(_0x8db8('0x1'))['db'][_0x8db8('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8db8('0x3')](0x0);var events={'afterCreate':_0x8db8('0x4'),'afterUpdate':_0x8db8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5415dd){return function(_0x50d4cd,_0x42cb73,_0x2c82bd){OpenchannelQueueEvents[_0x8db8('0x6')](_0x5415dd+':'+_0x50d4cd['id'],_0x50d4cd);OpenchannelQueueEvents[_0x8db8('0x6')](_0x5415dd,_0x50d4cd);_0x2c82bd(null);};}for(var e in events){if(events[_0x8db8('0x7')](e)){var event=events[e];OpenchannelQueue[_0x8db8('0x8')](e,emitEvent(event));}}module[_0x8db8('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
index 99c5e64..8fcd891 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13a=['request-promise','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','moment'];(function(_0x45b462,_0x419d1e){var _0x12516f=function(_0x415098){while(--_0x415098){_0x45b462['push'](_0x45b462['shift']());}};_0x12516f(++_0x419d1e);}(_0xe13a,0x178));var _0xae13=function(_0x18c962,_0x5952fd){_0x18c962=_0x18c962-0x0;var _0x1e630c=_0xe13a[_0x18c962];return _0x1e630c;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var logger=require(_0xae13('0x1'))(_0xae13('0x2'));var moment=require(_0xae13('0x3'));var BPromise=require('bluebird');var rp=require(_0xae13('0x4'));var attributes=require(_0xae13('0x5'));module[_0xae13('0x6')]=function(_0x10abd7,_0x28a89a){return _0x10abd7[_0xae13('0x7')](_0xae13('0x8'),attributes,{'tableName':_0xae13('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bde=['openchannel_queues','util','api','bluebird','request-promise','./openchannelQueue.attributes','exports','define'];(function(_0x1c55fe,_0x7fab59){var _0x5b5c99=function(_0x3a08e1){while(--_0x3a08e1){_0x1c55fe['push'](_0x1c55fe['shift']());}};_0x5b5c99(++_0x7fab59);}(_0x9bde,0xe1));var _0xe9bd=function(_0x358dc0,_0x4ce1af){_0x358dc0=_0x358dc0-0x0;var _0x31f700=_0x9bde[_0x358dc0];return _0x31f700;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var attributes=require(_0xe9bd('0x4'));module[_0xe9bd('0x5')]=function(_0x10822d,_0x1a4d14){return _0x10822d[_0xe9bd('0x6')]('OpenchannelQueue',attributes,{'tableName':_0xe9bd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75531fa..ea0d5a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b78=['stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','OpenchannelQueue','find','where','ShowOpenchannelQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x669095,_0x2b58ce){var _0x58a9ae=function(_0x28a9fe){while(--_0x28a9fe){_0x669095['push'](_0x669095['shift']());}};_0x58a9ae(++_0x2b58ce);}(_0x0b78,0x1ad));var _0x80b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0b78[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var moment=require('moment');var BPromise=require(_0x80b7('0x2'));var rs=require(_0x80b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80b7('0x8')]({'port':0x232a});config['redis']=_[_0x80b7('0x9')](config[_0x80b7('0xa')],{'host':_0x80b7('0xb'),'port':0x18eb});var socket=require(_0x80b7('0xc'))(new Redis(config['redis']));require(_0x80b7('0xd'))[_0x80b7('0xe')](socket);function respondWithRpcPromise(_0x374c52,_0x5176b2,_0x467f38){return new BPromise(function(_0x522a21,_0x2b1a00){return client[_0x80b7('0xf')](_0x374c52,_0x467f38)[_0x80b7('0x10')](function(_0x7b971b){logger[_0x80b7('0x11')](_0x80b7('0x12'),_0x5176b2,_0x80b7('0x13'));logger[_0x80b7('0x14')](_0x80b7('0x15'),_0x5176b2,_0x80b7('0x13'),JSON[_0x80b7('0x16')](_0x7b971b));if(_0x7b971b['error']){if(_0x7b971b[_0x80b7('0x17')][_0x80b7('0x18')]===0x1f4){logger['error'](_0x80b7('0x12'),_0x5176b2,_0x7b971b[_0x80b7('0x17')]['message']);return _0x2b1a00(_0x7b971b[_0x80b7('0x17')][_0x80b7('0x19')]);}logger[_0x80b7('0x17')](_0x80b7('0x12'),_0x5176b2,_0x7b971b[_0x80b7('0x17')][_0x80b7('0x19')]);return _0x522a21(_0x7b971b[_0x80b7('0x17')][_0x80b7('0x19')]);}else{logger[_0x80b7('0x11')](_0x80b7('0x12'),_0x5176b2,'request\x20sent');_0x522a21(_0x7b971b[_0x80b7('0x1a')][_0x80b7('0x19')]);}})[_0x80b7('0x1b')](function(_0x125c47){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x5176b2,_0x125c47);_0x2b1a00(_0x125c47);});});}exports[_0x80b7('0x1c')]=function(_0x1e27aa){var _0x1b584b=this;return new Promise(function(_0xd51ad9,_0x574e5c){return db['OpenchannelQueue'][_0x80b7('0x1d')]({'raw':_0x1e27aa[_0x80b7('0x1e')]?_0x1e27aa[_0x80b7('0x1e')][_0x80b7('0x1f')]===undefined?!![]:![]:!![],'where':_0x1e27aa['options']?_0x1e27aa[_0x80b7('0x1e')]['where']||null:null,'attributes':_0x1e27aa['options']?_0x1e27aa[_0x80b7('0x1e')][_0x80b7('0x20')]||null:null,'limit':_0x1e27aa[_0x80b7('0x1e')]?_0x1e27aa[_0x80b7('0x1e')][_0x80b7('0x21')]||null:null,'include':_0x1e27aa[_0x80b7('0x1e')]?_0x1e27aa[_0x80b7('0x1e')][_0x80b7('0x22')]?_[_0x80b7('0x23')](_0x1e27aa[_0x80b7('0x1e')][_0x80b7('0x22')],function(_0x311aa3){return{'model':db[_0x311aa3[_0x80b7('0x24')]],'as':_0x311aa3['as'],'attributes':_0x311aa3[_0x80b7('0x20')],'include':_0x311aa3[_0x80b7('0x22')]?_['map'](_0x311aa3[_0x80b7('0x22')],function(_0x1661be){return{'model':db[_0x1661be['model']],'as':_0x1661be['as'],'attributes':_0x1661be[_0x80b7('0x20')],'include':_0x1661be[_0x80b7('0x22')]?_[_0x80b7('0x23')](_0x1661be['include'],function(_0x1b7715){return{'model':db[_0x1b7715[_0x80b7('0x24')]],'as':_0x1b7715['as'],'attributes':_0x1b7715[_0x80b7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x80b7('0x10')](function(_0x1c4607){logger[_0x80b7('0x11')](_0x80b7('0x1c'),_0x1e27aa);logger[_0x80b7('0x14')](_0x80b7('0x1c'),_0x1e27aa,JSON[_0x80b7('0x16')](_0x1c4607));_0xd51ad9(_0x1c4607);})[_0x80b7('0x1b')](function(_0x44c3ec){logger[_0x80b7('0x17')]('GetOpenchannelQueue',_0x44c3ec['message'],_0x1e27aa);_0x574e5c(_0x1b584b[_0x80b7('0x17')](0x1f4,_0x44c3ec[_0x80b7('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x4e8557){var _0x106921=this;return new Promise(function(_0x1c95ea,_0x1cbe71){return db[_0x80b7('0x25')][_0x80b7('0x26')]({'raw':_0x4e8557[_0x80b7('0x1e')]?_0x4e8557['options'][_0x80b7('0x1f')]===undefined?!![]:![]:!![],'where':_0x4e8557[_0x80b7('0x1e')]?_0x4e8557[_0x80b7('0x1e')][_0x80b7('0x27')]||null:null,'attributes':_0x4e8557['options']?_0x4e8557[_0x80b7('0x1e')][_0x80b7('0x20')]||null:null,'include':_0x4e8557['options']?_0x4e8557[_0x80b7('0x1e')][_0x80b7('0x22')]?_[_0x80b7('0x23')](_0x4e8557[_0x80b7('0x1e')][_0x80b7('0x22')],function(_0xfbd58e){return{'model':db[_0xfbd58e[_0x80b7('0x24')]],'as':_0xfbd58e['as'],'attributes':_0xfbd58e[_0x80b7('0x20')],'include':_0xfbd58e['include']?_['map'](_0xfbd58e['include'],function(_0x34f479){return{'model':db[_0x34f479[_0x80b7('0x24')]],'as':_0x34f479['as'],'attributes':_0x34f479[_0x80b7('0x20')],'include':_0x34f479[_0x80b7('0x22')]?_[_0x80b7('0x23')](_0x34f479[_0x80b7('0x22')],function(_0x1c2341){return{'model':db[_0x1c2341[_0x80b7('0x24')]],'as':_0x1c2341['as'],'attributes':_0x1c2341['attributes']};}):[]};}):[]};}):[]:[]})[_0x80b7('0x10')](function(_0xb26b05){logger[_0x80b7('0x11')](_0x80b7('0x28'),_0x4e8557);logger[_0x80b7('0x14')](_0x80b7('0x28'),_0x4e8557,JSON['stringify'](_0xb26b05));_0x1c95ea(_0xb26b05);})[_0x80b7('0x1b')](function(_0x53f51c){logger[_0x80b7('0x17')](_0x80b7('0x28'),_0x53f51c['message'],_0x4e8557);_0x1cbe71(_0x106921['error'](0x1f4,_0x53f51c[_0x80b7('0x19')]));});});};
\ No newline at end of file
+var _0x13c0=['model','GetOpenchannelQueue','catch','ShowOpenchannelQueue','raw','where','map','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','OpenchannelQueue','options','attributes','limit','include'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x13c0,0x79));var _0x013c=function(_0x4ccf7f,_0x161ffd){_0x4ccf7f=_0x4ccf7f-0x0;var _0x1953f0=_0x13c0[_0x4ccf7f];return _0x1953f0;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});config[_0x013c('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x013c('0xc'))(new Redis(config[_0x013c('0xb')]));require('./openchannelQueue.socket')[_0x013c('0xd')](socket);function respondWithRpcPromise(_0xa99b50,_0x371681,_0x3fa7ff){return new BPromise(function(_0x1e10ba,_0x8b250a){return client[_0x013c('0xe')](_0xa99b50,_0x3fa7ff)[_0x013c('0xf')](function(_0x39c6f4){logger[_0x013c('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x371681,'request\x20sent');logger[_0x013c('0x11')](_0x013c('0x12'),_0x371681,_0x013c('0x13'),JSON[_0x013c('0x14')](_0x39c6f4));if(_0x39c6f4['error']){if(_0x39c6f4[_0x013c('0x15')][_0x013c('0x16')]===0x1f4){logger[_0x013c('0x15')](_0x013c('0x17'),_0x371681,_0x39c6f4[_0x013c('0x15')]['message']);return _0x8b250a(_0x39c6f4[_0x013c('0x15')][_0x013c('0x18')]);}logger[_0x013c('0x15')](_0x013c('0x17'),_0x371681,_0x39c6f4[_0x013c('0x15')][_0x013c('0x18')]);return _0x1e10ba(_0x39c6f4[_0x013c('0x15')][_0x013c('0x18')]);}else{logger[_0x013c('0x10')](_0x013c('0x17'),_0x371681,_0x013c('0x13'));_0x1e10ba(_0x39c6f4[_0x013c('0x19')][_0x013c('0x18')]);}})['catch'](function(_0x59bcbe){logger[_0x013c('0x15')](_0x013c('0x17'),_0x371681,_0x59bcbe);_0x8b250a(_0x59bcbe);});});}exports['GetOpenchannelQueue']=function(_0x260006){var _0x12e4db=this;return new Promise(function(_0x29c141,_0x38bac2){return db[_0x013c('0x1a')]['findAll']({'raw':_0x260006[_0x013c('0x1b')]?_0x260006[_0x013c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x260006[_0x013c('0x1b')]?_0x260006[_0x013c('0x1b')]['where']||null:null,'attributes':_0x260006['options']?_0x260006[_0x013c('0x1b')][_0x013c('0x1c')]||null:null,'limit':_0x260006[_0x013c('0x1b')]?_0x260006[_0x013c('0x1b')][_0x013c('0x1d')]||null:null,'include':_0x260006[_0x013c('0x1b')]?_0x260006[_0x013c('0x1b')][_0x013c('0x1e')]?_['map'](_0x260006[_0x013c('0x1b')][_0x013c('0x1e')],function(_0x1952d0){return{'model':db[_0x1952d0[_0x013c('0x1f')]],'as':_0x1952d0['as'],'attributes':_0x1952d0[_0x013c('0x1c')],'include':_0x1952d0[_0x013c('0x1e')]?_['map'](_0x1952d0[_0x013c('0x1e')],function(_0xd85349){return{'model':db[_0xd85349[_0x013c('0x1f')]],'as':_0xd85349['as'],'attributes':_0xd85349['attributes'],'include':_0xd85349[_0x013c('0x1e')]?_['map'](_0xd85349[_0x013c('0x1e')],function(_0x455b88){return{'model':db[_0x455b88['model']],'as':_0x455b88['as'],'attributes':_0x455b88[_0x013c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x013c('0xf')](function(_0x16cdad){logger[_0x013c('0x10')](_0x013c('0x20'),_0x260006);logger[_0x013c('0x11')](_0x013c('0x20'),_0x260006,JSON[_0x013c('0x14')](_0x16cdad));_0x29c141(_0x16cdad);})[_0x013c('0x21')](function(_0x441898){logger['error'](_0x013c('0x20'),_0x441898[_0x013c('0x18')],_0x260006);_0x38bac2(_0x12e4db[_0x013c('0x15')](0x1f4,_0x441898[_0x013c('0x18')]));});});};exports[_0x013c('0x22')]=function(_0x5b42ac){var _0x27f205=this;return new Promise(function(_0x13bc2d,_0xd19307){return db[_0x013c('0x1a')]['find']({'raw':_0x5b42ac['options']?_0x5b42ac['options'][_0x013c('0x23')]===undefined?!![]:![]:!![],'where':_0x5b42ac[_0x013c('0x1b')]?_0x5b42ac[_0x013c('0x1b')][_0x013c('0x24')]||null:null,'attributes':_0x5b42ac[_0x013c('0x1b')]?_0x5b42ac[_0x013c('0x1b')][_0x013c('0x1c')]||null:null,'include':_0x5b42ac[_0x013c('0x1b')]?_0x5b42ac[_0x013c('0x1b')][_0x013c('0x1e')]?_[_0x013c('0x25')](_0x5b42ac[_0x013c('0x1b')]['include'],function(_0x5b4247){return{'model':db[_0x5b4247[_0x013c('0x1f')]],'as':_0x5b4247['as'],'attributes':_0x5b4247[_0x013c('0x1c')],'include':_0x5b4247[_0x013c('0x1e')]?_[_0x013c('0x25')](_0x5b4247['include'],function(_0x48b8a6){return{'model':db[_0x48b8a6[_0x013c('0x1f')]],'as':_0x48b8a6['as'],'attributes':_0x48b8a6[_0x013c('0x1c')],'include':_0x48b8a6[_0x013c('0x1e')]?_['map'](_0x48b8a6[_0x013c('0x1e')],function(_0x2402b5){return{'model':db[_0x2402b5['model']],'as':_0x2402b5['as'],'attributes':_0x2402b5[_0x013c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcdfd4c){logger[_0x013c('0x10')](_0x013c('0x22'),_0x5b42ac);logger[_0x013c('0x11')]('ShowOpenchannelQueue',_0x5b42ac,JSON[_0x013c('0x14')](_0xcdfd4c));_0x13bc2d(_0xcdfd4c);})[_0x013c('0x21')](function(_0x391f1f){logger[_0x013c('0x15')](_0x013c('0x22'),_0x391f1f[_0x013c('0x18')],_0x5b42ac);_0xd19307(_0x27f205[_0x013c('0x15')](0x1f4,_0x391f1f[_0x013c('0x18')]));});});};
\ No newline at end of file
index 3ab38f0..d086baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var OpenchannelQueueEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelQueueEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 556ef91..c96486c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
+var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
index 1cd6fdc..3f96cf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea6a=['exports','STRING','DATE','moment','sequelize'];(function(_0x2a4bb1,_0x8d5834){var _0x5c71aa=function(_0x1977e){while(--_0x1977e){_0x2a4bb1['push'](_0x2a4bb1['shift']());}};_0x5c71aa(++_0x8d5834);}(_0xea6a,0x1b1));var _0xaea6=function(_0x57ab10,_0x5092a2){_0x57ab10=_0x57ab10-0x0;var _0x22bd72=_0xea6a[_0x57ab10];return _0x22bd72;};'use strict';var moment=require(_0xaea6('0x0'));var Sequelize=require(_0xaea6('0x1'));module[_0xaea6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xaea6('0x3')]},'joinAt':{'type':Sequelize[_0xaea6('0x4')]},'leaveAt':{'type':Sequelize[_0xaea6('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xaea6('0x4')]},'reason':{'type':Sequelize[_0xaea6('0x3')]}};
\ No newline at end of file
+var _0xc50a=['exports','STRING','DATE','moment'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0xc50a,0x163));var _0xac50=function(_0x15ad2e,_0x2c7d3c){_0x15ad2e=_0x15ad2e-0x0;var _0x51e0a2=_0xc50a[_0x15ad2e];return _0x51e0a2;};'use strict';var moment=require(_0xac50('0x0'));var Sequelize=require('sequelize');module[_0xac50('0x1')]={'uniqueid':{'type':Sequelize[_0xac50('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xac50('0x2')]},'joinAt':{'type':Sequelize[_0xac50('0x3')]},'leaveAt':{'type':Sequelize[_0xac50('0x3')]},'acceptAt':{'type':Sequelize[_0xac50('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xac50('0x2')]}};
\ No newline at end of file
index bde4ad2..387f5f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0762=['end','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','map','type','field','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x326d35,_0x4f65b3){var _0xd3f8f3=function(_0x1fbbaf){while(--_0x1fbbaf){_0x326d35['push'](_0x326d35['shift']());}};_0xd3f8f3(++_0x4f65b3);}(_0x0762,0x1e5));var _0x2076=function(_0x517f0f,_0x5a95b7){_0x517f0f=_0x517f0f-0x0;var _0x226e4e=_0x0762[_0x517f0f];return _0x226e4e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2076('0x0'));var rimraf=require(_0x2076('0x1'));var zipdir=require(_0x2076('0x2'));var jsonpatch=require(_0x2076('0x3'));var rp=require('request-promise');var moment=require(_0x2076('0x4'));var BPromise=require(_0x2076('0x5'));var Mustache=require('mustache');var util=require(_0x2076('0x6'));var path=require(_0x2076('0x7'));var sox=require(_0x2076('0x8'));var csv=require(_0x2076('0x9'));var ejs=require(_0x2076('0xa'));var fs=require('fs');var _=require(_0x2076('0xb'));var squel=require('squel');var crypto=require(_0x2076('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2076('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2076('0xe'));var Papa=require(_0x2076('0xf'));var Redis=require(_0x2076('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x2076('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x2076('0x12'));var db=require(_0x2076('0x13'))['db'];function respondWithStatusCode(_0x2ab449,_0x470193){_0x470193=_0x470193||0xcc;return function(_0x15cd2a){if(_0x15cd2a){return _0x2ab449[_0x2076('0x14')](_0x470193);}return _0x2ab449[_0x2076('0x15')](_0x470193)['end']();};}function respondWithResult(_0x45c841,_0x7d5b14){_0x7d5b14=_0x7d5b14||0xc8;return function(_0x5e9b8e){if(_0x5e9b8e){return _0x45c841[_0x2076('0x15')](_0x7d5b14)[_0x2076('0x16')](_0x5e9b8e);}};}function respondWithFilteredResult(_0x4b2118,_0x45496e){return function(_0x1a1d8b){if(_0x1a1d8b){var _0x72e403=_0x1a1d8b[_0x2076('0x17')],_0x4cdb29=_0x45496e[_0x2076('0x18')],_0x553d3a=_0x45496e[_0x2076('0x18')]+_0x45496e['limit'],_0x1880e8;if(_0x553d3a>=_0x72e403){_0x553d3a=_0x72e403;_0x1880e8=0xc8;}else{_0x1880e8=0xce;}_0x4b2118[_0x2076('0x15')](_0x1880e8);return _0x4b2118[_0x2076('0x19')](_0x2076('0x1a'),_0x4cdb29+'-'+_0x553d3a+'/'+_0x72e403)['json'](_0x1a1d8b);}return null;};}function patchUpdates(_0x32a680){return function(_0x803556){try{jsonpatch[_0x2076('0x1b')](_0x803556,_0x32a680,!![]);}catch(_0xc53cf3){return BPromise[_0x2076('0x1c')](_0xc53cf3);}return _0x803556[_0x2076('0x1d')]();};}function saveUpdates(_0xe9652f,_0x44dc58){return function(_0x3dc183){if(_0x3dc183){return _0x3dc183[_0x2076('0x1e')](_0xe9652f)[_0x2076('0x1f')](function(_0x14c423){return _0x14c423;});}return null;};}function removeEntity(_0x3c7cc1,_0x3bf492){return function(_0x1e515d){if(_0x1e515d){return _0x1e515d[_0x2076('0x20')]()['then'](function(){_0x3c7cc1[_0x2076('0x15')](0xcc)[_0x2076('0x21')]();});}};}function handleEntityNotFound(_0x3b890c,_0xd385e9){return function(_0xf81405){if(!_0xf81405){_0x3b890c[_0x2076('0x14')](0x194);}return _0xf81405;};}function handleError(_0x4999e5,_0x5a7fde){_0x5a7fde=_0x5a7fde||0x1f4;return function(_0x10ab4b){logger['error'](_0x10ab4b[_0x2076('0x22')]);if(_0x10ab4b[_0x2076('0x23')]){delete _0x10ab4b[_0x2076('0x23')];}_0x4999e5[_0x2076('0x15')](_0x5a7fde)[_0x2076('0x24')](_0x10ab4b);};}exports[_0x2076('0x25')]=function(_0x3a4dcf,_0x757afe){var _0x4dd0d2={},_0x545bcb={},_0x1f369c={'count':0x0,'rows':[]};var _0x117962=db[_0x2076('0x26')][_0x2076('0x27')];_0x545bcb[_0x2076('0x28')]=_['keys'](_0x117962);var _0x37e2d6={'dateStart':_0x3a4dcf[_0x2076('0x29')][_0x2076('0x2a')],'dateEnd':_0x3a4dcf['query']['dateEnd']};delete _0x3a4dcf[_0x2076('0x29')][_0x2076('0x2a')];delete _0x3a4dcf['query'][_0x2076('0x2b')];_0x545bcb[_0x2076('0x29')]=_[_0x2076('0x2c')](_0x3a4dcf[_0x2076('0x29')]);_0x545bcb[_0x2076('0x2d')]=_[_0x2076('0x2e')](_0x545bcb[_0x2076('0x28')],_0x545bcb[_0x2076('0x29')]);_0x4dd0d2[_0x2076('0x2f')]=_[_0x2076('0x2e')](_0x545bcb[_0x2076('0x28')],qs[_0x2076('0x30')](_0x3a4dcf[_0x2076('0x29')]['fields']));_0x4dd0d2['attributes']=_0x4dd0d2[_0x2076('0x2f')][_0x2076('0x31')]?_0x4dd0d2[_0x2076('0x2f')]:_0x545bcb[_0x2076('0x28')];if(!_0x3a4dcf[_0x2076('0x29')][_0x2076('0x32')](_0x2076('0x33'))){_0x4dd0d2[_0x2076('0x34')]=qs[_0x2076('0x34')](_0x3a4dcf[_0x2076('0x29')][_0x2076('0x34')]);_0x4dd0d2[_0x2076('0x18')]=qs[_0x2076('0x18')](_0x3a4dcf[_0x2076('0x29')][_0x2076('0x18')]);}_0x4dd0d2[_0x2076('0x35')]=qs[_0x2076('0x36')](_0x3a4dcf[_0x2076('0x29')]['sort']);_0x4dd0d2[_0x2076('0x37')]=qs[_0x2076('0x2d')](_[_0x2076('0x38')](_0x3a4dcf[_0x2076('0x29')],_0x545bcb[_0x2076('0x2d')]));if(_0x37e2d6['dateStart']){if(_0x37e2d6[_0x2076('0x2b')]){_0x37e2d6[_0x2076('0x2b')]=moment(_0x37e2d6[_0x2076('0x2b')])[_0x2076('0x39')](0x1,_0x2076('0x3a'));}else{_0x37e2d6[_0x2076('0x2b')]=moment(_0x37e2d6['dateStart'])[_0x2076('0x39')](0x1,_0x2076('0x3a'));}_[_0x2076('0x3b')](_0x4dd0d2[_0x2076('0x37')],{'createdAt':{'$gte':_0x37e2d6[_0x2076('0x2a')],'$lte':_0x37e2d6[_0x2076('0x2b')]}});}if(_0x3a4dcf[_0x2076('0x29')]['filter']){_0x4dd0d2['where']=_[_0x2076('0x3b')](_0x4dd0d2['where'],{'$or':_[_0x2076('0x3c')](_0x117962,function(_0x1c19e7){if(_0x1c19e7[_0x2076('0x3d')]['key']!=='VIRTUAL'){var _0x4b4128={};_0x4b4128[_0x1c19e7[_0x2076('0x3e')]]={'$like':'%'+_0x3a4dcf[_0x2076('0x29')]['filter']+'%'};return _0x4b4128;}})});}_0x4dd0d2=_[_0x2076('0x3b')]({},_0x4dd0d2,_0x3a4dcf['options']);var _0x4b3d12={'where':_0x4dd0d2[_0x2076('0x37')]};return db[_0x2076('0x26')][_0x2076('0x17')](_0x4b3d12)[_0x2076('0x1f')](function(_0x2745c6){_0x1f369c['count']=_0x2745c6;if(_0x3a4dcf[_0x2076('0x29')][_0x2076('0x3f')]){_0x4dd0d2[_0x2076('0x40')]=[{'all':!![]}];}return db[_0x2076('0x26')]['findAll'](_0x4dd0d2);})[_0x2076('0x1f')](function(_0x5e778c){_0x1f369c[_0x2076('0x41')]=_0x5e778c;return _0x1f369c;})['then'](respondWithFilteredResult(_0x757afe,_0x4dd0d2))[_0x2076('0x42')](handleError(_0x757afe,null));};exports[_0x2076('0x43')]=function(_0x2d6562,_0x2a60b1){var _0x409f0b={'raw':!![],'where':{'id':_0x2d6562[_0x2076('0x44')]['id']}},_0x17aa36={};_0x17aa36[_0x2076('0x28')]=_[_0x2076('0x2c')](db[_0x2076('0x26')][_0x2076('0x27')]);_0x17aa36[_0x2076('0x29')]=_[_0x2076('0x2c')](_0x2d6562['query']);_0x17aa36[_0x2076('0x2d')]=_[_0x2076('0x2e')](_0x17aa36[_0x2076('0x28')],_0x17aa36[_0x2076('0x29')]);_0x409f0b[_0x2076('0x2f')]=_[_0x2076('0x2e')](_0x17aa36[_0x2076('0x28')],qs[_0x2076('0x30')](_0x2d6562['query'][_0x2076('0x30')]));_0x409f0b[_0x2076('0x2f')]=_0x409f0b['attributes']['length']?_0x409f0b[_0x2076('0x2f')]:_0x17aa36[_0x2076('0x28')];if(_0x2d6562[_0x2076('0x29')][_0x2076('0x3f')]){_0x409f0b['include']=[{'all':!![]}];}_0x409f0b=_['merge']({},_0x409f0b,_0x2d6562[_0x2076('0x45')]);return db[_0x2076('0x26')][_0x2076('0x46')](_0x409f0b)[_0x2076('0x1f')](handleEntityNotFound(_0x2a60b1,null))['then'](respondWithResult(_0x2a60b1,null))[_0x2076('0x42')](handleError(_0x2a60b1,null));};exports[_0x2076('0x47')]=function(_0x4e6169,_0x349f28){return db[_0x2076('0x26')][_0x2076('0x47')](_0x4e6169[_0x2076('0x48')],{})[_0x2076('0x1f')](respondWithResult(_0x349f28,0xc9))['catch'](handleError(_0x349f28,null));};exports[_0x2076('0x1e')]=function(_0x3ed8d5,_0x5656d5){if(_0x3ed8d5[_0x2076('0x48')]['id']){delete _0x3ed8d5[_0x2076('0x48')]['id'];}return db[_0x2076('0x26')][_0x2076('0x46')]({'where':{'id':_0x3ed8d5[_0x2076('0x44')]['id']}})[_0x2076('0x1f')](handleEntityNotFound(_0x5656d5,null))[_0x2076('0x1f')](saveUpdates(_0x3ed8d5[_0x2076('0x48')],null))[_0x2076('0x1f')](respondWithResult(_0x5656d5,null))[_0x2076('0x42')](handleError(_0x5656d5,null));};exports[_0x2076('0x20')]=function(_0x2cf009,_0x5a0498){return db[_0x2076('0x26')]['find']({'where':{'id':_0x2cf009[_0x2076('0x44')]['id']}})[_0x2076('0x1f')](handleEntityNotFound(_0x5a0498,null))[_0x2076('0x1f')](removeEntity(_0x5a0498,null))[_0x2076('0x42')](handleError(_0x5a0498,null));};exports[_0x2076('0x49')]=function(_0x4c9139,_0x4ddf89){return db[_0x2076('0x26')][_0x2076('0x49')]()[_0x2076('0x1f')](respondWithResult(_0x4ddf89,null))['catch'](handleError(_0x4ddf89,null));};
\ No newline at end of file
+var _0x3306=['send','index','OpenchannelQueueReport','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','key','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','find','create','update','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','json','apply','reject','save','then','error','stack','name'];(function(_0x2c5ff6,_0x3d0ea1){var _0x392006=function(_0x40723a){while(--_0x40723a){_0x2c5ff6['push'](_0x2c5ff6['shift']());}};_0x392006(++_0x3d0ea1);}(_0x3306,0x107));var _0x6330=function(_0xe23e3,_0x2c3fff){_0xe23e3=_0xe23e3-0x0;var _0x55cda9=_0x3306[_0xe23e3];return _0x55cda9;};'use strict';var pdf=require(_0x6330('0x0'));var emlformat=require(_0x6330('0x1'));var rimraf=require(_0x6330('0x2'));var zipdir=require(_0x6330('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6330('0x4'));var moment=require(_0x6330('0x5'));var BPromise=require(_0x6330('0x6'));var Mustache=require(_0x6330('0x7'));var util=require(_0x6330('0x8'));var path=require('path');var sox=require(_0x6330('0x9'));var csv=require(_0x6330('0xa'));var ejs=require(_0x6330('0xb'));var fs=require('fs');var _=require(_0x6330('0xc'));var squel=require(_0x6330('0xd'));var crypto=require(_0x6330('0xe'));var jsforce=require(_0x6330('0xf'));var deskjs=require(_0x6330('0x10'));var toCsv=require(_0x6330('0xa'));var querystring=require(_0x6330('0x11'));var Papa=require('papaparse');var Redis=require(_0x6330('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0x6330('0x13'))(_0x6330('0x14'));var utils=require(_0x6330('0x15'));var config=require(_0x6330('0x16'));var db=require(_0x6330('0x17'))['db'];function respondWithStatusCode(_0x1ad5c9,_0x1a2b7d){_0x1a2b7d=_0x1a2b7d||0xcc;return function(_0x19d44e){if(_0x19d44e){return _0x1ad5c9['sendStatus'](_0x1a2b7d);}return _0x1ad5c9['status'](_0x1a2b7d)[_0x6330('0x18')]();};}function respondWithResult(_0x27ff9a,_0x47189e){_0x47189e=_0x47189e||0xc8;return function(_0x29094b){if(_0x29094b){return _0x27ff9a[_0x6330('0x19')](_0x47189e)['json'](_0x29094b);}};}function respondWithFilteredResult(_0x15fa68,_0x38367a){return function(_0x11306d){if(_0x11306d){var _0xd5cf27=_0x11306d[_0x6330('0x1a')],_0x5140e3=_0x38367a[_0x6330('0x1b')],_0x4c6860=_0x38367a['offset']+_0x38367a[_0x6330('0x1c')],_0x32b59f;if(_0x4c6860>=_0xd5cf27){_0x4c6860=_0xd5cf27;_0x32b59f=0xc8;}else{_0x32b59f=0xce;}_0x15fa68[_0x6330('0x19')](_0x32b59f);return _0x15fa68['set']('Content-Range',_0x5140e3+'-'+_0x4c6860+'/'+_0xd5cf27)[_0x6330('0x1d')](_0x11306d);}return null;};}function patchUpdates(_0x29fd07){return function(_0x3ba601){try{jsonpatch[_0x6330('0x1e')](_0x3ba601,_0x29fd07,!![]);}catch(_0x2c8e54){return BPromise[_0x6330('0x1f')](_0x2c8e54);}return _0x3ba601[_0x6330('0x20')]();};}function saveUpdates(_0x31154b,_0x1080e9){return function(_0x421785){if(_0x421785){return _0x421785['update'](_0x31154b)[_0x6330('0x21')](function(_0x206757){return _0x206757;});}return null;};}function removeEntity(_0x29836d,_0x3c8ce5){return function(_0x352767){if(_0x352767){return _0x352767['destroy']()[_0x6330('0x21')](function(){_0x29836d[_0x6330('0x19')](0xcc)[_0x6330('0x18')]();});}};}function handleEntityNotFound(_0x1a6169,_0x1b69b0){return function(_0x186b91){if(!_0x186b91){_0x1a6169['sendStatus'](0x194);}return _0x186b91;};}function handleError(_0x54cbeb,_0x59144c){_0x59144c=_0x59144c||0x1f4;return function(_0xd535b9){logger[_0x6330('0x22')](_0xd535b9[_0x6330('0x23')]);if(_0xd535b9[_0x6330('0x24')]){delete _0xd535b9['name'];}_0x54cbeb[_0x6330('0x19')](_0x59144c)[_0x6330('0x25')](_0xd535b9);};}exports[_0x6330('0x26')]=function(_0x19206e,_0x1d8280){var _0x4cf9d9={},_0x4ead1d={},_0x255861={'count':0x0,'rows':[]};var _0xfe629c=db[_0x6330('0x27')]['rawAttributes'];_0x4ead1d[_0x6330('0x28')]=_[_0x6330('0x29')](_0xfe629c);var _0x325037={'dateStart':_0x19206e[_0x6330('0x2a')]['dateStart'],'dateEnd':_0x19206e[_0x6330('0x2a')]['dateEnd']};delete _0x19206e[_0x6330('0x2a')][_0x6330('0x2b')];delete _0x19206e[_0x6330('0x2a')][_0x6330('0x2c')];_0x4ead1d['query']=_[_0x6330('0x29')](_0x19206e[_0x6330('0x2a')]);_0x4ead1d[_0x6330('0x2d')]=_[_0x6330('0x2e')](_0x4ead1d[_0x6330('0x28')],_0x4ead1d['query']);_0x4cf9d9[_0x6330('0x2f')]=_['intersection'](_0x4ead1d[_0x6330('0x28')],qs['fields'](_0x19206e[_0x6330('0x2a')]['fields']));_0x4cf9d9['attributes']=_0x4cf9d9[_0x6330('0x2f')][_0x6330('0x30')]?_0x4cf9d9[_0x6330('0x2f')]:_0x4ead1d[_0x6330('0x28')];if(!_0x19206e[_0x6330('0x2a')][_0x6330('0x31')](_0x6330('0x32'))){_0x4cf9d9[_0x6330('0x1c')]=qs[_0x6330('0x1c')](_0x19206e[_0x6330('0x2a')][_0x6330('0x1c')]);_0x4cf9d9[_0x6330('0x1b')]=qs['offset'](_0x19206e[_0x6330('0x2a')]['offset']);}_0x4cf9d9[_0x6330('0x33')]=qs[_0x6330('0x34')](_0x19206e[_0x6330('0x2a')][_0x6330('0x34')]);_0x4cf9d9[_0x6330('0x35')]=qs[_0x6330('0x2d')](_[_0x6330('0x36')](_0x19206e[_0x6330('0x2a')],_0x4ead1d[_0x6330('0x2d')]));if(_0x325037[_0x6330('0x2b')]){if(_0x325037['dateEnd']){_0x325037[_0x6330('0x2c')]=moment(_0x325037[_0x6330('0x2c')])['add'](0x1,'day');}else{_0x325037[_0x6330('0x2c')]=moment(_0x325037['dateStart'])[_0x6330('0x37')](0x1,_0x6330('0x38'));}_[_0x6330('0x39')](_0x4cf9d9[_0x6330('0x35')],{'createdAt':{'$gte':_0x325037[_0x6330('0x2b')],'$lte':_0x325037[_0x6330('0x2c')]}});}if(_0x19206e[_0x6330('0x2a')][_0x6330('0x3a')]){_0x4cf9d9['where']=_[_0x6330('0x39')](_0x4cf9d9[_0x6330('0x35')],{'$or':_[_0x6330('0x3b')](_0xfe629c,function(_0x524b3d){if(_0x524b3d['type'][_0x6330('0x3c')]!==_0x6330('0x3d')){var _0x3d5440={};_0x3d5440[_0x524b3d['field']]={'$like':'%'+_0x19206e['query']['filter']+'%'};return _0x3d5440;}})});}_0x4cf9d9=_['merge']({},_0x4cf9d9,_0x19206e['options']);var _0x1e7964={'where':_0x4cf9d9['where']};return db['OpenchannelQueueReport'][_0x6330('0x1a')](_0x1e7964)[_0x6330('0x21')](function(_0x46f26c){_0x255861[_0x6330('0x1a')]=_0x46f26c;if(_0x19206e[_0x6330('0x2a')][_0x6330('0x3e')]){_0x4cf9d9[_0x6330('0x3f')]=[{'all':!![]}];}return db[_0x6330('0x27')][_0x6330('0x40')](_0x4cf9d9);})[_0x6330('0x21')](function(_0x531c8a){_0x255861[_0x6330('0x41')]=_0x531c8a;return _0x255861;})[_0x6330('0x21')](respondWithFilteredResult(_0x1d8280,_0x4cf9d9))[_0x6330('0x42')](handleError(_0x1d8280,null));};exports[_0x6330('0x43')]=function(_0x3b1fd3,_0x5d9cc9){var _0x2dd36a={'raw':!![],'where':{'id':_0x3b1fd3['params']['id']}},_0x10811e={};_0x10811e[_0x6330('0x28')]=_[_0x6330('0x29')](db[_0x6330('0x27')]['rawAttributes']);_0x10811e[_0x6330('0x2a')]=_[_0x6330('0x29')](_0x3b1fd3[_0x6330('0x2a')]);_0x10811e[_0x6330('0x2d')]=_[_0x6330('0x2e')](_0x10811e['model'],_0x10811e[_0x6330('0x2a')]);_0x2dd36a[_0x6330('0x2f')]=_[_0x6330('0x2e')](_0x10811e[_0x6330('0x28')],qs[_0x6330('0x44')](_0x3b1fd3[_0x6330('0x2a')][_0x6330('0x44')]));_0x2dd36a['attributes']=_0x2dd36a[_0x6330('0x2f')][_0x6330('0x30')]?_0x2dd36a['attributes']:_0x10811e['model'];if(_0x3b1fd3['query'][_0x6330('0x3e')]){_0x2dd36a['include']=[{'all':!![]}];}_0x2dd36a=_[_0x6330('0x39')]({},_0x2dd36a,_0x3b1fd3['options']);return db['OpenchannelQueueReport'][_0x6330('0x45')](_0x2dd36a)[_0x6330('0x21')](handleEntityNotFound(_0x5d9cc9,null))[_0x6330('0x21')](respondWithResult(_0x5d9cc9,null))[_0x6330('0x42')](handleError(_0x5d9cc9,null));};exports['create']=function(_0x1f77e3,_0x66f6a2){return db['OpenchannelQueueReport'][_0x6330('0x46')](_0x1f77e3['body'],{})[_0x6330('0x21')](respondWithResult(_0x66f6a2,0xc9))[_0x6330('0x42')](handleError(_0x66f6a2,null));};exports[_0x6330('0x47')]=function(_0x203d86,_0x395f11){if(_0x203d86[_0x6330('0x48')]['id']){delete _0x203d86[_0x6330('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x6330('0x45')]({'where':{'id':_0x203d86[_0x6330('0x49')]['id']}})[_0x6330('0x21')](handleEntityNotFound(_0x395f11,null))['then'](saveUpdates(_0x203d86[_0x6330('0x48')],null))['then'](respondWithResult(_0x395f11,null))[_0x6330('0x42')](handleError(_0x395f11,null));};exports['destroy']=function(_0x2328f8,_0x24a36e){return db[_0x6330('0x27')][_0x6330('0x45')]({'where':{'id':_0x2328f8[_0x6330('0x49')]['id']}})['then'](handleEntityNotFound(_0x24a36e,null))[_0x6330('0x21')](removeEntity(_0x24a36e,null))[_0x6330('0x42')](handleError(_0x24a36e,null));};exports[_0x6330('0x4a')]=function(_0x2e29e6,_0x239e95){return db[_0x6330('0x27')]['describe']()[_0x6330('0x21')](respondWithResult(_0x239e95,null))[_0x6330('0x42')](handleError(_0x239e95,null));};
\ No newline at end of file
index 7da05d3..bd641c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67d1=['OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','./openchannelQueueReport.attributes','define'];(function(_0x5f0e2a,_0x4e56f7){var _0x25470e=function(_0x158cbe){while(--_0x158cbe){_0x5f0e2a['push'](_0x5f0e2a['shift']());}};_0x25470e(++_0x4e56f7);}(_0x67d1,0xdf));var _0x167d=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x67d1[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x167d('0x0'));var util=require(_0x167d('0x1'));var logger=require(_0x167d('0x2'))(_0x167d('0x3'));var moment=require('moment');var BPromise=require(_0x167d('0x4'));var rp=require(_0x167d('0x5'));var attributes=require(_0x167d('0x6'));module['exports']=function(_0x59228a,_0x557a8c){return _0x59228a[_0x167d('0x7')](_0x167d('0x8'),attributes,{'tableName':_0x167d('0x9'),'paranoid':![],'indexes':[{'name':_0x167d('0xa'),'fields':[_0x167d('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c50=['report_openchannel_queue','uniqueid','api','bluebird','exports','define'];(function(_0x1c7386,_0x298a93){var _0x2b6b71=function(_0x3dfaf0){while(--_0x3dfaf0){_0x1c7386['push'](_0x1c7386['shift']());}};_0x2b6b71(++_0x298a93);}(_0x9c50,0xec));var _0x09c5=function(_0x3cd3ca,_0x27920a){_0x3cd3ca=_0x3cd3ca-0x0;var _0x4e9890=_0x9c50[_0x3cd3ca];return _0x4e9890;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x09c5('0x0'));var moment=require('moment');var BPromise=require(_0x09c5('0x1'));var rp=require('request-promise');var attributes=require('./openchannelQueueReport.attributes');module[_0x09c5('0x2')]=function(_0x1e2992,_0x4ad2a1){return _0x1e2992[_0x09c5('0x3')]('OpenchannelQueueReport',attributes,{'tableName':_0x09c5('0x4'),'paranoid':![],'indexes':[{'name':_0x09c5('0x5'),'fields':[_0x09c5('0x5')]}],'timestamps':!![]});};
\ No newline at end of file
index 72946e7..bed7c87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc49=['UpdateOpenchannelQueueReport','update','attributes','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw'];(function(_0x49fc85,_0x247421){var _0x2a6a65=function(_0x4a5816){while(--_0x4a5816){_0x49fc85['push'](_0x49fc85['shift']());}};_0x2a6a65(++_0x247421);}(_0xcc49,0x18b));var _0x9cc4=function(_0x4dc392,_0x255362){_0x4dc392=_0x4dc392-0x0;var _0x4e45ad=_0xcc49[_0x4dc392];return _0x4e45ad;};'use strict';var _=require(_0x9cc4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9cc4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cc4('0x2'));var db=require(_0x9cc4('0x3'))['db'];var utils=require(_0x9cc4('0x4'));var logger=require(_0x9cc4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9cc4('0x6'));var client=jayson['client'][_0x9cc4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34e8b2,_0x3bc2d5,_0x1dc388){return new BPromise(function(_0x1e0c6e,_0x29b59a){return client[_0x9cc4('0x8')](_0x34e8b2,_0x1dc388)[_0x9cc4('0x9')](function(_0x378c41){logger[_0x9cc4('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3bc2d5,'request\x20sent');logger[_0x9cc4('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x3bc2d5,_0x9cc4('0xc'),JSON[_0x9cc4('0xd')](_0x378c41));if(_0x378c41[_0x9cc4('0xe')]){if(_0x378c41[_0x9cc4('0xe')][_0x9cc4('0xf')]===0x1f4){logger[_0x9cc4('0xe')](_0x9cc4('0x10'),_0x3bc2d5,_0x378c41[_0x9cc4('0xe')][_0x9cc4('0x11')]);return _0x29b59a(_0x378c41['error'][_0x9cc4('0x11')]);}logger['error'](_0x9cc4('0x10'),_0x3bc2d5,_0x378c41[_0x9cc4('0xe')][_0x9cc4('0x11')]);return _0x1e0c6e(_0x378c41[_0x9cc4('0xe')][_0x9cc4('0x11')]);}else{logger[_0x9cc4('0xa')](_0x9cc4('0x10'),_0x3bc2d5,_0x9cc4('0xc'));_0x1e0c6e(_0x378c41[_0x9cc4('0x12')][_0x9cc4('0x11')]);}})[_0x9cc4('0x13')](function(_0x1e67b5){logger[_0x9cc4('0xe')](_0x9cc4('0x10'),_0x3bc2d5,_0x1e67b5);_0x29b59a(_0x1e67b5);});});}exports[_0x9cc4('0x14')]=function(_0x276ae6){var _0x125bcd=this;return new Promise(function(_0x3eb660,_0x51b3cb){return db[_0x9cc4('0x15')]['create'](_0x276ae6[_0x9cc4('0x16')],{'raw':_0x276ae6['options']?_0x276ae6[_0x9cc4('0x17')][_0x9cc4('0x18')]===undefined?!![]:![]:!![]})[_0x9cc4('0x9')](function(_0x34d4ba){logger[_0x9cc4('0xa')](_0x9cc4('0x14'),_0x276ae6);logger[_0x9cc4('0xb')]('CreateOpenchannelQueueReport',_0x276ae6,JSON['stringify'](_0x34d4ba));_0x3eb660(_0x34d4ba);})[_0x9cc4('0x13')](function(_0x1f7129){logger[_0x9cc4('0xe')]('CreateOpenchannelQueueReport',_0x1f7129[_0x9cc4('0x11')],_0x276ae6);_0x51b3cb(_0x125bcd[_0x9cc4('0xe')](0x1f4,_0x1f7129[_0x9cc4('0x11')]));});});};exports[_0x9cc4('0x19')]=function(_0x500f09){var _0x298ee5=this;return new Promise(function(_0x4707d2,_0x5ce71d){return db[_0x9cc4('0x15')][_0x9cc4('0x1a')](_0x500f09[_0x9cc4('0x16')],{'raw':_0x500f09[_0x9cc4('0x17')]?_0x500f09[_0x9cc4('0x17')][_0x9cc4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x500f09[_0x9cc4('0x17')]?_0x500f09[_0x9cc4('0x17')]['where']||null:null,'attributes':_0x500f09[_0x9cc4('0x17')]?_0x500f09[_0x9cc4('0x17')][_0x9cc4('0x1b')]||null:null,'limit':_0x500f09[_0x9cc4('0x17')]?_0x500f09['options']['limit']||null:null})[_0x9cc4('0x9')](function(_0x57aca4){logger[_0x9cc4('0xa')]('UpdateOpenchannelQueueReport',_0x500f09);logger['debug'](_0x9cc4('0x19'),_0x500f09,JSON['stringify'](_0x57aca4));_0x4707d2(_0x57aca4);})[_0x9cc4('0x13')](function(_0x404d3e){logger[_0x9cc4('0xe')](_0x9cc4('0x19'),_0x404d3e[_0x9cc4('0x11')],_0x500f09);_0x5ce71d(_0x298ee5[_0x9cc4('0xe')](0x1f4,_0x404d3e[_0x9cc4('0x11')]));});});};
\ No newline at end of file
+var _0x687e=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','where','limit','lodash'];(function(_0x5eddcc,_0x3490b7){var _0x110516=function(_0x5925bb){while(--_0x5925bb){_0x5eddcc['push'](_0x5eddcc['shift']());}};_0x110516(++_0x3490b7);}(_0x687e,0x13f));var _0xe687=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x687e[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xe687('0x0'));var util=require(_0xe687('0x1'));var moment=require(_0xe687('0x2'));var BPromise=require(_0xe687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe687('0x4'));var logger=require(_0xe687('0x5'))(_0xe687('0x6'));var config=require(_0xe687('0x7'));var jayson=require(_0xe687('0x8'));var client=jayson[_0xe687('0x9')][_0xe687('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c288a,_0x56491d,_0x3baf22){return new BPromise(function(_0x1d9909,_0x55c75d){return client[_0xe687('0xb')](_0x2c288a,_0x3baf22)[_0xe687('0xc')](function(_0x2fcf5c){logger[_0xe687('0xd')](_0xe687('0xe'),_0x56491d,_0xe687('0xf'));logger[_0xe687('0x10')](_0xe687('0x11'),_0x56491d,'request\x20sent',JSON[_0xe687('0x12')](_0x2fcf5c));if(_0x2fcf5c[_0xe687('0x13')]){if(_0x2fcf5c[_0xe687('0x13')][_0xe687('0x14')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x56491d,_0x2fcf5c['error']['message']);return _0x55c75d(_0x2fcf5c[_0xe687('0x13')][_0xe687('0x15')]);}logger[_0xe687('0x13')](_0xe687('0xe'),_0x56491d,_0x2fcf5c[_0xe687('0x13')][_0xe687('0x15')]);return _0x1d9909(_0x2fcf5c[_0xe687('0x13')]['message']);}else{logger[_0xe687('0xd')](_0xe687('0xe'),_0x56491d,'request\x20sent');_0x1d9909(_0x2fcf5c[_0xe687('0x16')][_0xe687('0x15')]);}})[_0xe687('0x17')](function(_0x1c9e0d){logger[_0xe687('0x13')](_0xe687('0xe'),_0x56491d,_0x1c9e0d);_0x55c75d(_0x1c9e0d);});});}exports['CreateOpenchannelQueueReport']=function(_0x4258b9){var _0x46f4e5=this;return new Promise(function(_0xff400d,_0x152e4d){return db[_0xe687('0x18')]['create'](_0x4258b9[_0xe687('0x19')],{'raw':_0x4258b9[_0xe687('0x1a')]?_0x4258b9['options'][_0xe687('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x197d61){logger['info'](_0xe687('0x1c'),_0x4258b9);logger['debug'](_0xe687('0x1c'),_0x4258b9,JSON[_0xe687('0x12')](_0x197d61));_0xff400d(_0x197d61);})[_0xe687('0x17')](function(_0x37d05d){logger[_0xe687('0x13')](_0xe687('0x1c'),_0x37d05d[_0xe687('0x15')],_0x4258b9);_0x152e4d(_0x46f4e5[_0xe687('0x13')](0x1f4,_0x37d05d[_0xe687('0x15')]));});});};exports[_0xe687('0x1d')]=function(_0x461cfd){var _0x36d7c7=this;return new Promise(function(_0x5620a1,_0xa326b3){return db[_0xe687('0x18')]['update'](_0x461cfd[_0xe687('0x19')],{'raw':_0x461cfd[_0xe687('0x1a')]?_0x461cfd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x461cfd['options']?_0x461cfd['options'][_0xe687('0x1e')]||null:null,'attributes':_0x461cfd[_0xe687('0x1a')]?_0x461cfd['options']['attributes']||null:null,'limit':_0x461cfd[_0xe687('0x1a')]?_0x461cfd[_0xe687('0x1a')][_0xe687('0x1f')]||null:null})['then'](function(_0x3228a0){logger[_0xe687('0xd')](_0xe687('0x1d'),_0x461cfd);logger[_0xe687('0x10')]('UpdateOpenchannelQueueReport',_0x461cfd,JSON[_0xe687('0x12')](_0x3228a0));_0x5620a1(_0x3228a0);})[_0xe687('0x17')](function(_0x57db0b){logger[_0xe687('0x13')](_0xe687('0x1d'),_0x57db0b['message'],_0x461cfd);_0xa326b3(_0x36d7c7[_0xe687('0x13')](0x1f4,_0x57db0b[_0xe687('0x15')]));});});};
\ No newline at end of file
index 1d0996c..666cdae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1437=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','/:id','post','delete','destroy','exports','multer','path','express'];(function(_0x3e11c7,_0x25db06){var _0x376e8e=function(_0x223182){while(--_0x223182){_0x3e11c7['push'](_0x3e11c7['shift']());}};_0x376e8e(++_0x25db06);}(_0x1437,0xfc));var _0x7143=function(_0x160fe1,_0x113d9c){_0x160fe1=_0x160fe1-0x0;var _0x414c83=_0x1437[_0x160fe1];return _0x414c83;};'use strict';var multer=require(_0x7143('0x0'));var util=require('util');var path=require(_0x7143('0x1'));var timeout=require('connect-timeout');var express=require(_0x7143('0x2'));var router=express[_0x7143('0x3')]();var auth=require(_0x7143('0x4'));var interaction=require(_0x7143('0x5'));var config=require(_0x7143('0x6'));var controller=require(_0x7143('0x7'));router[_0x7143('0x8')]('/',auth['isAuthenticated'](),controller[_0x7143('0x9')]);router[_0x7143('0x8')](_0x7143('0xa'),auth[_0x7143('0xb')](),controller['describe']);router[_0x7143('0x8')](_0x7143('0xc'),auth[_0x7143('0xb')](),controller['show']);router[_0x7143('0xd')]('/',auth[_0x7143('0xb')](),controller['create']);router['put']('/:id',auth[_0x7143('0xb')](),controller['update']);router[_0x7143('0xe')](_0x7143('0xc'),auth[_0x7143('0xb')](),controller[_0x7143('0xf')]);module[_0x7143('0x10')]=router;
\ No newline at end of file
+var _0x743d=['connect-timeout','express','Router','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','/describe','describe','get','/:id','show','create','put','update','delete','destroy','exports','path'];(function(_0x1ef994,_0x1772f4){var _0x397380=function(_0x22cd99){while(--_0x22cd99){_0x1ef994['push'](_0x1ef994['shift']());}};_0x397380(++_0x1772f4);}(_0x743d,0xa1));var _0xd743=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x743d[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd743('0x0'));var timeout=require(_0xd743('0x1'));var express=require(_0xd743('0x2'));var router=express[_0xd743('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd743('0x4'));var config=require('../../config/environment');var controller=require(_0xd743('0x5'));router['get']('/',auth[_0xd743('0x6')](),controller['index']);router['get'](_0xd743('0x7'),auth[_0xd743('0x6')](),controller[_0xd743('0x8')]);router[_0xd743('0x9')](_0xd743('0xa'),auth[_0xd743('0x6')](),controller[_0xd743('0xb')]);router['post']('/',auth[_0xd743('0x6')](),controller[_0xd743('0xc')]);router[_0xd743('0xd')](_0xd743('0xa'),auth[_0xd743('0x6')](),controller[_0xd743('0xe')]);router[_0xd743('0xf')]('/:id',auth[_0xd743('0x6')](),controller[_0xd743('0x10')]);module[_0xd743('0x11')]=router;
\ No newline at end of file
index 65c4280..be49cc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa08c=['NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa08c,0xf1));var _0xca08=function(_0x331a97,_0x875b9){_0x331a97=_0x331a97-0x0;var _0x587e9c=_0xa08c[_0x331a97];return _0x587e9c;};'use strict';var moment=require(_0xca08('0x0'));var Sequelize=require(_0xca08('0x1'));module[_0xca08('0x2')]={'uniqueid':{'type':Sequelize[_0xca08('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xca08('0x4')](_0xca08('0x5'),_0xca08('0x6'),_0xca08('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xca08('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xca08('0x9')]}};
\ No newline at end of file
+var _0x300f=['STRING','ENUM','account','agent','queue','DATE','moment','exports'];(function(_0x1c4f7b,_0x52ff1b){var _0x1b153a=function(_0x2a48e7){while(--_0x2a48e7){_0x1c4f7b['push'](_0x1c4f7b['shift']());}};_0x1b153a(++_0x52ff1b);}(_0x300f,0x176));var _0xf300=function(_0x5a83cd,_0x30e558){_0x5a83cd=_0x5a83cd-0x0;var _0x4cb4b8=_0x300f[_0x5a83cd];return _0x4cb4b8;};'use strict';var moment=require(_0xf300('0x0'));var Sequelize=require('sequelize');module[_0xf300('0x1')]={'uniqueid':{'type':Sequelize[_0xf300('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf300('0x3')](_0xf300('0x4'),_0xf300('0x5'),'queue'),'allowNull':![],'defaultValue':_0xf300('0x6')},'transferredAt':{'type':Sequelize[_0xf300('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 6ca1197..df462ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9477=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','apply','reject','save','update','then','error','name','send','index','OpenchannelTransferReport','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','add','day','merge','filter','type','key','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','fields','options','create','body','find','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9477,0xda));var _0x7947=function(_0x51417d,_0x15425e){_0x51417d=_0x51417d-0x0;var _0x496920=_0x9477[_0x51417d];return _0x496920;};'use strict';var pdf=require(_0x7947('0x0'));var emlformat=require(_0x7947('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7947('0x2'));var jsonpatch=require(_0x7947('0x3'));var rp=require(_0x7947('0x4'));var moment=require(_0x7947('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7947('0x6'));var util=require(_0x7947('0x7'));var path=require(_0x7947('0x8'));var sox=require('sox');var csv=require(_0x7947('0x9'));var ejs=require(_0x7947('0xa'));var fs=require('fs');var _=require(_0x7947('0xb'));var squel=require(_0x7947('0xc'));var crypto=require(_0x7947('0xd'));var jsforce=require(_0x7947('0xe'));var deskjs=require(_0x7947('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7947('0x10'));var Papa=require(_0x7947('0x11'));var Redis=require(_0x7947('0x12'));var qs=require(_0x7947('0x13'));var logger=require(_0x7947('0x14'))(_0x7947('0x15'));var utils=require('../../config/utils');var config=require(_0x7947('0x16'));var db=require(_0x7947('0x17'))['db'];function respondWithStatusCode(_0x376177,_0x4b627d){_0x4b627d=_0x4b627d||0xcc;return function(_0x59687b){if(_0x59687b){return _0x376177[_0x7947('0x18')](_0x4b627d);}return _0x376177[_0x7947('0x19')](_0x4b627d)['end']();};}function respondWithResult(_0x53e4a5,_0x1c1554){_0x1c1554=_0x1c1554||0xc8;return function(_0x155588){if(_0x155588){return _0x53e4a5[_0x7947('0x19')](_0x1c1554)[_0x7947('0x1a')](_0x155588);}};}function respondWithFilteredResult(_0xaa3056,_0x2d66ad){return function(_0x282ab5){if(_0x282ab5){var _0x48816d=_0x282ab5['count'],_0x5a8518=_0x2d66ad[_0x7947('0x1b')],_0x12229b=_0x2d66ad[_0x7947('0x1b')]+_0x2d66ad['limit'],_0x351783;if(_0x12229b>=_0x48816d){_0x12229b=_0x48816d;_0x351783=0xc8;}else{_0x351783=0xce;}_0xaa3056[_0x7947('0x19')](_0x351783);return _0xaa3056['set'](_0x7947('0x1c'),_0x5a8518+'-'+_0x12229b+'/'+_0x48816d)['json'](_0x282ab5);}return null;};}function patchUpdates(_0x254486){return function(_0x4bfd60){try{jsonpatch[_0x7947('0x1d')](_0x4bfd60,_0x254486,!![]);}catch(_0x136b58){return BPromise[_0x7947('0x1e')](_0x136b58);}return _0x4bfd60[_0x7947('0x1f')]();};}function saveUpdates(_0x461611,_0x19df47){return function(_0x562b19){if(_0x562b19){return _0x562b19[_0x7947('0x20')](_0x461611)[_0x7947('0x21')](function(_0x4a97d7){return _0x4a97d7;});}return null;};}function removeEntity(_0x5a1a97,_0x5d15dd){return function(_0x633ef5){if(_0x633ef5){return _0x633ef5['destroy']()[_0x7947('0x21')](function(){_0x5a1a97[_0x7947('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b871b,_0x2407b6){return function(_0x1119d8){if(!_0x1119d8){_0x4b871b['sendStatus'](0x194);}return _0x1119d8;};}function handleError(_0x311008,_0x5bfe17){_0x5bfe17=_0x5bfe17||0x1f4;return function(_0x5972b2){logger[_0x7947('0x22')](_0x5972b2['stack']);if(_0x5972b2['name']){delete _0x5972b2[_0x7947('0x23')];}_0x311008[_0x7947('0x19')](_0x5bfe17)[_0x7947('0x24')](_0x5972b2);};}exports[_0x7947('0x25')]=function(_0x3bf598,_0x3f5681){var _0x2fce6b={},_0x55a5ac={},_0x275166={'count':0x0,'rows':[]};var _0x2103a5=db[_0x7947('0x26')][_0x7947('0x27')];_0x55a5ac[_0x7947('0x28')]=_['keys'](_0x2103a5);var _0x2c037b={'dateStart':_0x3bf598[_0x7947('0x29')][_0x7947('0x2a')],'dateEnd':_0x3bf598[_0x7947('0x29')]['dateEnd']};delete _0x3bf598['query'][_0x7947('0x2a')];delete _0x3bf598[_0x7947('0x29')][_0x7947('0x2b')];_0x55a5ac[_0x7947('0x29')]=_[_0x7947('0x2c')](_0x3bf598[_0x7947('0x29')]);_0x55a5ac[_0x7947('0x2d')]=_[_0x7947('0x2e')](_0x55a5ac[_0x7947('0x28')],_0x55a5ac['query']);_0x2fce6b[_0x7947('0x2f')]=_[_0x7947('0x2e')](_0x55a5ac['model'],qs['fields'](_0x3bf598['query']['fields']));_0x2fce6b[_0x7947('0x2f')]=_0x2fce6b[_0x7947('0x2f')][_0x7947('0x30')]?_0x2fce6b[_0x7947('0x2f')]:_0x55a5ac[_0x7947('0x28')];if(!_0x3bf598['query'][_0x7947('0x31')](_0x7947('0x32'))){_0x2fce6b['limit']=qs[_0x7947('0x33')](_0x3bf598[_0x7947('0x29')][_0x7947('0x33')]);_0x2fce6b['offset']=qs[_0x7947('0x1b')](_0x3bf598['query'][_0x7947('0x1b')]);}_0x2fce6b['order']=qs[_0x7947('0x34')](_0x3bf598[_0x7947('0x29')]['sort']);_0x2fce6b[_0x7947('0x35')]=qs[_0x7947('0x2d')](_[_0x7947('0x36')](_0x3bf598['query'],_0x55a5ac[_0x7947('0x2d')]));if(_0x2c037b[_0x7947('0x2a')]){if(_0x2c037b[_0x7947('0x2b')]){_0x2c037b[_0x7947('0x2b')]=moment(_0x2c037b['dateEnd'])[_0x7947('0x37')](0x1,'day');}else{_0x2c037b[_0x7947('0x2b')]=moment(_0x2c037b[_0x7947('0x2a')])[_0x7947('0x37')](0x1,_0x7947('0x38'));}_[_0x7947('0x39')](_0x2fce6b['where'],{'createdAt':{'$gte':_0x2c037b['dateStart'],'$lte':_0x2c037b[_0x7947('0x2b')]}});}if(_0x3bf598[_0x7947('0x29')][_0x7947('0x3a')]){_0x2fce6b[_0x7947('0x35')]=_[_0x7947('0x39')](_0x2fce6b[_0x7947('0x35')],{'$or':_['map'](_0x2103a5,function(_0x4f6ef7){if(_0x4f6ef7[_0x7947('0x3b')][_0x7947('0x3c')]!==_0x7947('0x3d')){var _0x4fc180={};_0x4fc180[_0x4f6ef7['field']]={'$like':'%'+_0x3bf598[_0x7947('0x29')][_0x7947('0x3a')]+'%'};return _0x4fc180;}})});}_0x2fce6b=_['merge']({},_0x2fce6b,_0x3bf598['options']);var _0x3b21ba={'where':_0x2fce6b[_0x7947('0x35')]};return db[_0x7947('0x26')][_0x7947('0x3e')](_0x3b21ba)[_0x7947('0x21')](function(_0x30e079){_0x275166['count']=_0x30e079;if(_0x3bf598[_0x7947('0x29')][_0x7947('0x3f')]){_0x2fce6b['include']=[{'all':!![]}];}return db[_0x7947('0x26')][_0x7947('0x40')](_0x2fce6b);})[_0x7947('0x21')](function(_0x36e1ea){_0x275166[_0x7947('0x41')]=_0x36e1ea;return _0x275166;})[_0x7947('0x21')](respondWithFilteredResult(_0x3f5681,_0x2fce6b))[_0x7947('0x42')](handleError(_0x3f5681,null));};exports[_0x7947('0x43')]=function(_0x2f7d1a,_0x433a99){var _0x5e6db7={'raw':!![],'where':{'id':_0x2f7d1a[_0x7947('0x44')]['id']}},_0x21aea1={};_0x21aea1['model']=_[_0x7947('0x2c')](db[_0x7947('0x26')][_0x7947('0x27')]);_0x21aea1[_0x7947('0x29')]=_['keys'](_0x2f7d1a[_0x7947('0x29')]);_0x21aea1['filters']=_['intersection'](_0x21aea1[_0x7947('0x28')],_0x21aea1[_0x7947('0x29')]);_0x5e6db7[_0x7947('0x2f')]=_['intersection'](_0x21aea1['model'],qs['fields'](_0x2f7d1a[_0x7947('0x29')][_0x7947('0x45')]));_0x5e6db7[_0x7947('0x2f')]=_0x5e6db7[_0x7947('0x2f')][_0x7947('0x30')]?_0x5e6db7[_0x7947('0x2f')]:_0x21aea1[_0x7947('0x28')];if(_0x2f7d1a[_0x7947('0x29')][_0x7947('0x3f')]){_0x5e6db7['include']=[{'all':!![]}];}_0x5e6db7=_[_0x7947('0x39')]({},_0x5e6db7,_0x2f7d1a[_0x7947('0x46')]);return db['OpenchannelTransferReport']['find'](_0x5e6db7)['then'](handleEntityNotFound(_0x433a99,null))['then'](respondWithResult(_0x433a99,null))[_0x7947('0x42')](handleError(_0x433a99,null));};exports[_0x7947('0x47')]=function(_0x2a2aeb,_0x505f40){return db['OpenchannelTransferReport']['create'](_0x2a2aeb[_0x7947('0x48')],{})[_0x7947('0x21')](respondWithResult(_0x505f40,0xc9))['catch'](handleError(_0x505f40,null));};exports[_0x7947('0x20')]=function(_0x488147,_0x53f1fe){if(_0x488147[_0x7947('0x48')]['id']){delete _0x488147[_0x7947('0x48')]['id'];}return db[_0x7947('0x26')][_0x7947('0x49')]({'where':{'id':_0x488147[_0x7947('0x44')]['id']}})[_0x7947('0x21')](handleEntityNotFound(_0x53f1fe,null))[_0x7947('0x21')](saveUpdates(_0x488147[_0x7947('0x48')],null))[_0x7947('0x21')](respondWithResult(_0x53f1fe,null))[_0x7947('0x42')](handleError(_0x53f1fe,null));};exports[_0x7947('0x4a')]=function(_0x5f422b,_0x44ab7e){return db['OpenchannelTransferReport'][_0x7947('0x49')]({'where':{'id':_0x5f422b[_0x7947('0x44')]['id']}})['then'](handleEntityNotFound(_0x44ab7e,null))[_0x7947('0x21')](removeEntity(_0x44ab7e,null))[_0x7947('0x42')](handleError(_0x44ab7e,null));};exports['describe']=function(_0x43f5c6,_0x1c734b){return db['OpenchannelTransferReport'][_0x7947('0x4b')]()[_0x7947('0x21')](respondWithResult(_0x1c734b,null))['catch'](handleError(_0x1c734b,null));};
\ No newline at end of file
+var _0xdd94=['VIRTUAL','field','options','then','includeAll','include','findAll','rows','catch','show','params','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','OpenchannelTransferReport','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','limit','order','sort','pick','day','merge','filter','where','map','type','key'];(function(_0x506368,_0x12e988){var _0x5e6230=function(_0x19ef42){while(--_0x19ef42){_0x506368['push'](_0x506368['shift']());}};_0x5e6230(++_0x12e988);}(_0xdd94,0xf5));var _0x4dd9=function(_0x5e6038,_0x2ab407){_0x5e6038=_0x5e6038-0x0;var _0x268682=_0xdd94[_0x5e6038];return _0x268682;};'use strict';var pdf=require(_0x4dd9('0x0'));var emlformat=require(_0x4dd9('0x1'));var rimraf=require(_0x4dd9('0x2'));var zipdir=require(_0x4dd9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4dd9('0x4'));var moment=require(_0x4dd9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4dd9('0x6'));var util=require(_0x4dd9('0x7'));var path=require(_0x4dd9('0x8'));var sox=require(_0x4dd9('0x9'));var csv=require(_0x4dd9('0xa'));var ejs=require(_0x4dd9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4dd9('0xc'));var crypto=require(_0x4dd9('0xd'));var jsforce=require(_0x4dd9('0xe'));var deskjs=require(_0x4dd9('0xf'));var toCsv=require(_0x4dd9('0xa'));var querystring=require(_0x4dd9('0x10'));var Papa=require('papaparse');var Redis=require(_0x4dd9('0x11'));var qs=require(_0x4dd9('0x12'));var logger=require(_0x4dd9('0x13'))(_0x4dd9('0x14'));var utils=require(_0x4dd9('0x15'));var config=require(_0x4dd9('0x16'));var db=require(_0x4dd9('0x17'))['db'];function respondWithStatusCode(_0x528cdc,_0x2e59e5){_0x2e59e5=_0x2e59e5||0xcc;return function(_0x366116){if(_0x366116){return _0x528cdc['sendStatus'](_0x2e59e5);}return _0x528cdc[_0x4dd9('0x18')](_0x2e59e5)['end']();};}function respondWithResult(_0x5183d0,_0x5e4bf9){_0x5e4bf9=_0x5e4bf9||0xc8;return function(_0x50735e){if(_0x50735e){return _0x5183d0[_0x4dd9('0x18')](_0x5e4bf9)[_0x4dd9('0x19')](_0x50735e);}};}function respondWithFilteredResult(_0x23bb52,_0x430bcb){return function(_0x55702d){if(_0x55702d){var _0x95c372=_0x55702d[_0x4dd9('0x1a')],_0x36c058=_0x430bcb[_0x4dd9('0x1b')],_0x3baf90=_0x430bcb[_0x4dd9('0x1b')]+_0x430bcb['limit'],_0x3c8012;if(_0x3baf90>=_0x95c372){_0x3baf90=_0x95c372;_0x3c8012=0xc8;}else{_0x3c8012=0xce;}_0x23bb52[_0x4dd9('0x18')](_0x3c8012);return _0x23bb52[_0x4dd9('0x1c')](_0x4dd9('0x1d'),_0x36c058+'-'+_0x3baf90+'/'+_0x95c372)[_0x4dd9('0x19')](_0x55702d);}return null;};}function patchUpdates(_0x15ffab){return function(_0x3989e7){try{jsonpatch[_0x4dd9('0x1e')](_0x3989e7,_0x15ffab,!![]);}catch(_0x36a197){return BPromise[_0x4dd9('0x1f')](_0x36a197);}return _0x3989e7[_0x4dd9('0x20')]();};}function saveUpdates(_0x286e7d,_0x5ba214){return function(_0x58602d){if(_0x58602d){return _0x58602d[_0x4dd9('0x21')](_0x286e7d)['then'](function(_0x1bb4f8){return _0x1bb4f8;});}return null;};}function removeEntity(_0x444828,_0x397b00){return function(_0x29b90a){if(_0x29b90a){return _0x29b90a[_0x4dd9('0x22')]()['then'](function(){_0x444828[_0x4dd9('0x18')](0xcc)[_0x4dd9('0x23')]();});}};}function handleEntityNotFound(_0x48040a,_0x269738){return function(_0x17f133){if(!_0x17f133){_0x48040a['sendStatus'](0x194);}return _0x17f133;};}function handleError(_0x4d5ae9,_0x4465c4){_0x4465c4=_0x4465c4||0x1f4;return function(_0x47ddbc){logger['error'](_0x47ddbc[_0x4dd9('0x24')]);if(_0x47ddbc['name']){delete _0x47ddbc[_0x4dd9('0x25')];}_0x4d5ae9['status'](_0x4465c4)[_0x4dd9('0x26')](_0x47ddbc);};}exports[_0x4dd9('0x27')]=function(_0x226a84,_0x46d913){var _0x5bd629={},_0x52bb87={},_0x274eec={'count':0x0,'rows':[]};var _0x52d06a=db[_0x4dd9('0x28')][_0x4dd9('0x29')];_0x52bb87['model']=_[_0x4dd9('0x2a')](_0x52d06a);var _0x3afcc9={'dateStart':_0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x2c')],'dateEnd':_0x226a84['query'][_0x4dd9('0x2d')]};delete _0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x2c')];delete _0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x2d')];_0x52bb87[_0x4dd9('0x2b')]=_['keys'](_0x226a84[_0x4dd9('0x2b')]);_0x52bb87[_0x4dd9('0x2e')]=_[_0x4dd9('0x2f')](_0x52bb87[_0x4dd9('0x30')],_0x52bb87[_0x4dd9('0x2b')]);_0x5bd629[_0x4dd9('0x31')]=_[_0x4dd9('0x2f')](_0x52bb87[_0x4dd9('0x30')],qs['fields'](_0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x32')]));_0x5bd629[_0x4dd9('0x31')]=_0x5bd629['attributes'][_0x4dd9('0x33')]?_0x5bd629[_0x4dd9('0x31')]:_0x52bb87[_0x4dd9('0x30')];if(!_0x226a84[_0x4dd9('0x2b')]['hasOwnProperty']('nolimit')){_0x5bd629[_0x4dd9('0x34')]=qs[_0x4dd9('0x34')](_0x226a84['query'][_0x4dd9('0x34')]);_0x5bd629[_0x4dd9('0x1b')]=qs[_0x4dd9('0x1b')](_0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x1b')]);}_0x5bd629[_0x4dd9('0x35')]=qs[_0x4dd9('0x36')](_0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x36')]);_0x5bd629['where']=qs['filters'](_[_0x4dd9('0x37')](_0x226a84['query'],_0x52bb87[_0x4dd9('0x2e')]));if(_0x3afcc9[_0x4dd9('0x2c')]){if(_0x3afcc9[_0x4dd9('0x2d')]){_0x3afcc9['dateEnd']=moment(_0x3afcc9[_0x4dd9('0x2d')])['add'](0x1,_0x4dd9('0x38'));}else{_0x3afcc9[_0x4dd9('0x2d')]=moment(_0x3afcc9[_0x4dd9('0x2c')])['add'](0x1,_0x4dd9('0x38'));}_[_0x4dd9('0x39')](_0x5bd629['where'],{'createdAt':{'$gte':_0x3afcc9['dateStart'],'$lte':_0x3afcc9[_0x4dd9('0x2d')]}});}if(_0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x3a')]){_0x5bd629[_0x4dd9('0x3b')]=_[_0x4dd9('0x39')](_0x5bd629['where'],{'$or':_[_0x4dd9('0x3c')](_0x52d06a,function(_0x22fcaa){if(_0x22fcaa[_0x4dd9('0x3d')][_0x4dd9('0x3e')]!==_0x4dd9('0x3f')){var _0x16190e={};_0x16190e[_0x22fcaa[_0x4dd9('0x40')]]={'$like':'%'+_0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x3a')]+'%'};return _0x16190e;}})});}_0x5bd629=_[_0x4dd9('0x39')]({},_0x5bd629,_0x226a84[_0x4dd9('0x41')]);var _0x226cf7={'where':_0x5bd629['where']};return db['OpenchannelTransferReport'][_0x4dd9('0x1a')](_0x226cf7)[_0x4dd9('0x42')](function(_0x48c1f7){_0x274eec[_0x4dd9('0x1a')]=_0x48c1f7;if(_0x226a84[_0x4dd9('0x2b')][_0x4dd9('0x43')]){_0x5bd629[_0x4dd9('0x44')]=[{'all':!![]}];}return db[_0x4dd9('0x28')][_0x4dd9('0x45')](_0x5bd629);})[_0x4dd9('0x42')](function(_0x1ef341){_0x274eec[_0x4dd9('0x46')]=_0x1ef341;return _0x274eec;})['then'](respondWithFilteredResult(_0x46d913,_0x5bd629))[_0x4dd9('0x47')](handleError(_0x46d913,null));};exports[_0x4dd9('0x48')]=function(_0x95e314,_0x40eb38){var _0x4687e0={'raw':!![],'where':{'id':_0x95e314[_0x4dd9('0x49')]['id']}},_0x50dab8={};_0x50dab8['model']=_[_0x4dd9('0x2a')](db['OpenchannelTransferReport']['rawAttributes']);_0x50dab8[_0x4dd9('0x2b')]=_[_0x4dd9('0x2a')](_0x95e314[_0x4dd9('0x2b')]);_0x50dab8[_0x4dd9('0x2e')]=_['intersection'](_0x50dab8['model'],_0x50dab8['query']);_0x4687e0[_0x4dd9('0x31')]=_['intersection'](_0x50dab8[_0x4dd9('0x30')],qs[_0x4dd9('0x32')](_0x95e314['query'][_0x4dd9('0x32')]));_0x4687e0[_0x4dd9('0x31')]=_0x4687e0[_0x4dd9('0x31')][_0x4dd9('0x33')]?_0x4687e0['attributes']:_0x50dab8[_0x4dd9('0x30')];if(_0x95e314[_0x4dd9('0x2b')][_0x4dd9('0x43')]){_0x4687e0[_0x4dd9('0x44')]=[{'all':!![]}];}_0x4687e0=_[_0x4dd9('0x39')]({},_0x4687e0,_0x95e314[_0x4dd9('0x41')]);return db[_0x4dd9('0x28')][_0x4dd9('0x4a')](_0x4687e0)['then'](handleEntityNotFound(_0x40eb38,null))['then'](respondWithResult(_0x40eb38,null))[_0x4dd9('0x47')](handleError(_0x40eb38,null));};exports['create']=function(_0x319c02,_0x3be015){return db[_0x4dd9('0x28')]['create'](_0x319c02[_0x4dd9('0x4b')],{})[_0x4dd9('0x42')](respondWithResult(_0x3be015,0xc9))[_0x4dd9('0x47')](handleError(_0x3be015,null));};exports[_0x4dd9('0x21')]=function(_0x443778,_0x4410df){if(_0x443778[_0x4dd9('0x4b')]['id']){delete _0x443778[_0x4dd9('0x4b')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x443778[_0x4dd9('0x49')]['id']}})['then'](handleEntityNotFound(_0x4410df,null))[_0x4dd9('0x42')](saveUpdates(_0x443778[_0x4dd9('0x4b')],null))[_0x4dd9('0x42')](respondWithResult(_0x4410df,null))[_0x4dd9('0x47')](handleError(_0x4410df,null));};exports[_0x4dd9('0x22')]=function(_0x1488e9,_0x1fd2be){return db['OpenchannelTransferReport'][_0x4dd9('0x4a')]({'where':{'id':_0x1488e9['params']['id']}})['then'](handleEntityNotFound(_0x1fd2be,null))[_0x4dd9('0x42')](removeEntity(_0x1fd2be,null))[_0x4dd9('0x47')](handleError(_0x1fd2be,null));};exports['describe']=function(_0x2c6159,_0x4e396c){return db[_0x4dd9('0x28')][_0x4dd9('0x4c')]()[_0x4dd9('0x42')](respondWithResult(_0x4e396c,null))[_0x4dd9('0x47')](handleError(_0x4e396c,null));};
\ No newline at end of file
index bb6eb08..c9da6b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['lodash','util','../../config/logger','api','moment','bluebird','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid'];(function(_0x26ce01,_0x2046b2){var _0x15b336=function(_0x5cd022){while(--_0x5cd022){_0x26ce01['push'](_0x26ce01['shift']());}};_0x15b336(++_0x2046b2);}(_0x814b,0x1a2));var _0xb814=function(_0x5427c8,_0x18f384){_0x5427c8=_0x5427c8-0x0;var _0x33a129=_0x814b[_0x5427c8];return _0x33a129;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var attributes=require(_0xb814('0x6'));module[_0xb814('0x7')]=function(_0x258866,_0x4237bc){return _0x258866[_0xb814('0x8')](_0xb814('0x9'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xb814('0xa'),'fields':[_0xb814('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f2f=['bluebird','request-promise','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x35452b,_0x501eb1){var _0x541db5=function(_0x1988c9){while(--_0x1988c9){_0x35452b['push'](_0x35452b['shift']());}};_0x541db5(++_0x501eb1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d6c99,_0x13968d){_0x1d6c99=_0x1d6c99-0x0;var _0x501cab=_0x5f2f[_0x1d6c99];return _0x501cab;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var attributes=require(_0xf5f2('0x7'));module['exports']=function(_0x4854b6,_0x1665c7){return _0x4854b6[_0xf5f2('0x8')](_0xf5f2('0x9'),attributes,{'tableName':_0xf5f2('0xa'),'paranoid':![],'indexes':[{'name':_0xf5f2('0xb'),'fields':[_0xf5f2('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 8815219..36e1335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5752=['OpenchannelTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0x5752,0x99));var _0x2575=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5752[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x2575('0x0'));var util=require(_0x2575('0x1'));var moment=require(_0x2575('0x2'));var BPromise=require(_0x2575('0x3'));var rs=require(_0x2575('0x4'));var fs=require('fs');var Redis=require(_0x2575('0x5'));var db=require(_0x2575('0x6'))['db'];var utils=require(_0x2575('0x7'));var logger=require(_0x2575('0x8'))('rpc');var config=require(_0x2575('0x9'));var jayson=require(_0x2575('0xa'));var client=jayson[_0x2575('0xb')][_0x2575('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21d6ff,_0x1882b2,_0x18faf6){return new BPromise(function(_0x3bd1d8,_0x1a4cdd){return client[_0x2575('0xd')](_0x21d6ff,_0x18faf6)[_0x2575('0xe')](function(_0x4616b8){logger[_0x2575('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1882b2,_0x2575('0x10'));logger[_0x2575('0x11')](_0x2575('0x12'),_0x1882b2,_0x2575('0x10'),JSON[_0x2575('0x13')](_0x4616b8));if(_0x4616b8[_0x2575('0x14')]){if(_0x4616b8[_0x2575('0x14')][_0x2575('0x15')]===0x1f4){logger[_0x2575('0x14')](_0x2575('0x16'),_0x1882b2,_0x4616b8['error']['message']);return _0x1a4cdd(_0x4616b8[_0x2575('0x14')][_0x2575('0x17')]);}logger['error'](_0x2575('0x16'),_0x1882b2,_0x4616b8[_0x2575('0x14')][_0x2575('0x17')]);return _0x3bd1d8(_0x4616b8[_0x2575('0x14')][_0x2575('0x17')]);}else{logger[_0x2575('0xf')](_0x2575('0x16'),_0x1882b2,_0x2575('0x10'));_0x3bd1d8(_0x4616b8['result'][_0x2575('0x17')]);}})[_0x2575('0x18')](function(_0xc30c78){logger[_0x2575('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1882b2,_0xc30c78);_0x1a4cdd(_0xc30c78);});});}
\ No newline at end of file
+var _0x9b88=['request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b88,0x1bd));var _0x89b8=function(_0x51cbc7,_0x70e604){_0x51cbc7=_0x51cbc7-0x0;var _0x1ec150=_0x9b88[_0x51cbc7];return _0x1ec150;};'use strict';var _=require(_0x89b8('0x0'));var util=require(_0x89b8('0x1'));var moment=require(_0x89b8('0x2'));var BPromise=require(_0x89b8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x89b8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x89b8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x424270,_0x322367,_0xfa314e){return new BPromise(function(_0x82293f,_0x4f773e){return client[_0x89b8('0x7')](_0x424270,_0xfa314e)[_0x89b8('0x8')](function(_0x3d4a2e){logger[_0x89b8('0x9')](_0x89b8('0xa'),_0x322367,_0x89b8('0xb'));logger[_0x89b8('0xc')](_0x89b8('0xd'),_0x322367,'request\x20sent',JSON[_0x89b8('0xe')](_0x3d4a2e));if(_0x3d4a2e[_0x89b8('0xf')]){if(_0x3d4a2e[_0x89b8('0xf')]['code']===0x1f4){logger[_0x89b8('0xf')](_0x89b8('0xa'),_0x322367,_0x3d4a2e[_0x89b8('0xf')][_0x89b8('0x10')]);return _0x4f773e(_0x3d4a2e[_0x89b8('0xf')][_0x89b8('0x10')]);}logger[_0x89b8('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x322367,_0x3d4a2e['error']['message']);return _0x82293f(_0x3d4a2e[_0x89b8('0xf')][_0x89b8('0x10')]);}else{logger[_0x89b8('0x9')](_0x89b8('0xa'),_0x322367,_0x89b8('0xb'));_0x82293f(_0x3d4a2e[_0x89b8('0x11')][_0x89b8('0x10')]);}})[_0x89b8('0x12')](function(_0x1a8784){logger['error'](_0x89b8('0xa'),_0x322367,_0x1a8784);_0x4f773e(_0x1a8784);});});}
\ No newline at end of file
index a6414d1..2d5f47e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d46=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','post','delete','destroy','exports','multer'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x4d46,0x197));var _0x64d4=function(_0x1bf445,_0x4555e3){_0x1bf445=_0x1bf445-0x0;var _0x528318=_0x4d46[_0x1bf445];return _0x528318;};'use strict';var multer=require(_0x64d4('0x0'));var util=require(_0x64d4('0x1'));var path=require(_0x64d4('0x2'));var timeout=require(_0x64d4('0x3'));var express=require(_0x64d4('0x4'));var router=express[_0x64d4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x64d4('0x6'));var config=require(_0x64d4('0x7'));var controller=require(_0x64d4('0x8'));router[_0x64d4('0x9')]('/',auth[_0x64d4('0xa')](),controller[_0x64d4('0xb')]);router['get'](_0x64d4('0xc'),auth[_0x64d4('0xa')](),controller['show']);router[_0x64d4('0xd')]('/',auth[_0x64d4('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x64d4('0xe')](_0x64d4('0xc'),auth[_0x64d4('0xa')](),controller[_0x64d4('0xf')]);module[_0x64d4('0x10')]=router;
\ No newline at end of file
+var _0x57f8=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x57f8,0x198));var _0x857f=function(_0x133f69,_0x2d4632){_0x133f69=_0x133f69-0x0;var _0x3b67bb=_0x57f8[_0x133f69];return _0x3b67bb;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var auth=require(_0x857f('0x5'));var interaction=require(_0x857f('0x6'));var config=require(_0x857f('0x7'));var controller=require(_0x857f('0x8'));router[_0x857f('0x9')]('/',auth[_0x857f('0xa')](),controller[_0x857f('0xb')]);router['get'](_0x857f('0xc'),auth[_0x857f('0xa')](),controller[_0x857f('0xd')]);router['post']('/',auth[_0x857f('0xa')](),controller[_0x857f('0xe')]);router[_0x857f('0xf')]('/:id',auth[_0x857f('0xa')](),controller[_0x857f('0x10')]);router[_0x857f('0x11')]('/:id',auth[_0x857f('0xa')](),controller[_0x857f('0x12')]);module[_0x857f('0x13')]=router;
\ No newline at end of file
index 8fec571..3a0d92d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd81=['sequelize','exports','STRING','name'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0xdd81,0x128));var _0x1dd8=function(_0xfd99a4,_0x56c39a){_0xfd99a4=_0xfd99a4-0x0;var _0x1b5c8b=_0xdd81[_0xfd99a4];return _0x1b5c8b;};'use strict';var Sequelize=require(_0x1dd8('0x0'));module[_0x1dd8('0x1')]={'name':{'type':Sequelize[_0x1dd8('0x2')],'unique':_0x1dd8('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6d4c=['STRING','sequelize','exports','name'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x6d4c,0x69));var _0xc6d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d4c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc6d4('0x0'));module[_0xc6d4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc6d4('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc6d4('0x3')]}};
\ No newline at end of file
index 7185572..b5ee934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80b4=['attributes','fields','length','hasOwnProperty','nolimit','offset','sort','add','merge','where','filter','type','VIRTUAL','field','options','includeAll','include','Pause','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','error','name','send','index','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection'];(function(_0x282b4d,_0x36fe01){var _0x2c6507=function(_0x60480e){while(--_0x60480e){_0x282b4d['push'](_0x282b4d['shift']());}};_0x2c6507(++_0x36fe01);}(_0x80b4,0x6e));var _0x480b=function(_0x2f289a,_0x5736e6){_0x2f289a=_0x2f289a-0x0;var _0x48029d=_0x80b4[_0x2f289a];return _0x48029d;};'use strict';var pdf=require(_0x480b('0x0'));var emlformat=require(_0x480b('0x1'));var rimraf=require(_0x480b('0x2'));var zipdir=require(_0x480b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x480b('0x4'));var moment=require('moment');var BPromise=require(_0x480b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x480b('0x6'));var sox=require('sox');var csv=require(_0x480b('0x7'));var ejs=require(_0x480b('0x8'));var fs=require('fs');var _=require(_0x480b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x480b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x480b('0x7'));var querystring=require(_0x480b('0xb'));var Papa=require(_0x480b('0xc'));var Redis=require(_0x480b('0xd'));var qs=require(_0x480b('0xe'));var logger=require('../../config/logger')(_0x480b('0xf'));var utils=require(_0x480b('0x10'));var config=require(_0x480b('0x11'));var db=require(_0x480b('0x12'))['db'];function respondWithStatusCode(_0x58fa9b,_0x1495e3){_0x1495e3=_0x1495e3||0xcc;return function(_0x5204ea){if(_0x5204ea){return _0x58fa9b[_0x480b('0x13')](_0x1495e3);}return _0x58fa9b[_0x480b('0x14')](_0x1495e3)[_0x480b('0x15')]();};}function respondWithResult(_0x456814,_0x2a611e){_0x2a611e=_0x2a611e||0xc8;return function(_0x4e7430){if(_0x4e7430){return _0x456814[_0x480b('0x14')](_0x2a611e)[_0x480b('0x16')](_0x4e7430);}};}function respondWithFilteredResult(_0xcda75f,_0x393360){return function(_0xa2a698){if(_0xa2a698){var _0x42f82b=_0xa2a698[_0x480b('0x17')],_0x5b9217=_0x393360['offset'],_0x4c4539=_0x393360['offset']+_0x393360[_0x480b('0x18')],_0x37950c;if(_0x4c4539>=_0x42f82b){_0x4c4539=_0x42f82b;_0x37950c=0xc8;}else{_0x37950c=0xce;}_0xcda75f[_0x480b('0x14')](_0x37950c);return _0xcda75f['set'](_0x480b('0x19'),_0x5b9217+'-'+_0x4c4539+'/'+_0x42f82b)[_0x480b('0x16')](_0xa2a698);}return null;};}function patchUpdates(_0x276597){return function(_0x53cb6c){try{jsonpatch[_0x480b('0x1a')](_0x53cb6c,_0x276597,!![]);}catch(_0x25983d){return BPromise[_0x480b('0x1b')](_0x25983d);}return _0x53cb6c[_0x480b('0x1c')]();};}function saveUpdates(_0x1a6cc5,_0x47b94e){return function(_0xfa8573){if(_0xfa8573){return _0xfa8573[_0x480b('0x1d')](_0x1a6cc5)[_0x480b('0x1e')](function(_0x3b14e1){return _0x3b14e1;});}return null;};}function removeEntity(_0x3e093f,_0x3cb5db){return function(_0x30886f){if(_0x30886f){return _0x30886f[_0x480b('0x1f')]()[_0x480b('0x1e')](function(){var _0x3eb46d=_0x30886f[_0x480b('0x20')]({'plain':!![]});var _0x955eb=_0x480b('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x955eb,'resourceId':_0x3eb46d['id']}})[_0x480b('0x1e')](function(){return _0x30886f;});})['then'](function(){_0x3e093f[_0x480b('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e2b6,_0x40a423){return function(_0x8fd0ba){if(!_0x8fd0ba){_0x47e2b6['sendStatus'](0x194);}return _0x8fd0ba;};}function handleError(_0x2c1c02,_0x32ad1a){_0x32ad1a=_0x32ad1a||0x1f4;return function(_0x117890){logger[_0x480b('0x22')](_0x117890['stack']);if(_0x117890[_0x480b('0x23')]){delete _0x117890[_0x480b('0x23')];}_0x2c1c02[_0x480b('0x14')](_0x32ad1a)[_0x480b('0x24')](_0x117890);};}exports[_0x480b('0x25')]=function(_0x1a44f1,_0x4269b4){var _0x57258e={},_0x59f63a={},_0x104d63={'count':0x0,'rows':[]};var _0x147f15=db['Pause'][_0x480b('0x26')];_0x59f63a[_0x480b('0x27')]=_['keys'](_0x147f15);var _0x5b62ba={'dateStart':_0x1a44f1[_0x480b('0x28')][_0x480b('0x29')],'dateEnd':_0x1a44f1['query'][_0x480b('0x2a')]};delete _0x1a44f1['query'][_0x480b('0x29')];delete _0x1a44f1[_0x480b('0x28')]['dateEnd'];_0x59f63a[_0x480b('0x28')]=_[_0x480b('0x2b')](_0x1a44f1['query']);_0x59f63a[_0x480b('0x2c')]=_[_0x480b('0x2d')](_0x59f63a[_0x480b('0x27')],_0x59f63a[_0x480b('0x28')]);_0x57258e[_0x480b('0x2e')]=_['intersection'](_0x59f63a['model'],qs[_0x480b('0x2f')](_0x1a44f1[_0x480b('0x28')]['fields']));_0x57258e[_0x480b('0x2e')]=_0x57258e['attributes'][_0x480b('0x30')]?_0x57258e['attributes']:_0x59f63a[_0x480b('0x27')];if(!_0x1a44f1[_0x480b('0x28')][_0x480b('0x31')](_0x480b('0x32'))){_0x57258e[_0x480b('0x18')]=qs['limit'](_0x1a44f1[_0x480b('0x28')][_0x480b('0x18')]);_0x57258e[_0x480b('0x33')]=qs['offset'](_0x1a44f1['query'][_0x480b('0x33')]);}_0x57258e['order']=qs[_0x480b('0x34')](_0x1a44f1[_0x480b('0x28')][_0x480b('0x34')]);_0x57258e['where']=qs[_0x480b('0x2c')](_['pick'](_0x1a44f1[_0x480b('0x28')],_0x59f63a[_0x480b('0x2c')]));if(_0x5b62ba['dateStart']){if(_0x5b62ba['dateEnd']){_0x5b62ba[_0x480b('0x2a')]=moment(_0x5b62ba[_0x480b('0x2a')])[_0x480b('0x35')](0x1,'day');}else{_0x5b62ba['dateEnd']=moment(_0x5b62ba['dateStart'])[_0x480b('0x35')](0x1,'day');}_[_0x480b('0x36')](_0x57258e[_0x480b('0x37')],{'createdAt':{'$gte':_0x5b62ba[_0x480b('0x29')],'$lte':_0x5b62ba[_0x480b('0x2a')]}});}if(_0x1a44f1[_0x480b('0x28')][_0x480b('0x38')]){_0x57258e['where']=_[_0x480b('0x36')](_0x57258e[_0x480b('0x37')],{'$or':_['map'](_0x147f15,function(_0x5c2218){if(_0x5c2218[_0x480b('0x39')]['key']!==_0x480b('0x3a')){var _0xce1ad9={};_0xce1ad9[_0x5c2218[_0x480b('0x3b')]]={'$like':'%'+_0x1a44f1[_0x480b('0x28')][_0x480b('0x38')]+'%'};return _0xce1ad9;}})});}_0x57258e=_[_0x480b('0x36')]({},_0x57258e,_0x1a44f1[_0x480b('0x3c')]);var _0x77245e={'where':_0x57258e[_0x480b('0x37')]};return db['Pause']['count'](_0x77245e)[_0x480b('0x1e')](function(_0x271418){_0x104d63[_0x480b('0x17')]=_0x271418;if(_0x1a44f1[_0x480b('0x28')][_0x480b('0x3d')]){_0x57258e[_0x480b('0x3e')]=[{'all':!![]}];}return db[_0x480b('0x3f')][_0x480b('0x40')](_0x57258e);})[_0x480b('0x1e')](function(_0x538e6a){_0x104d63[_0x480b('0x41')]=_0x538e6a;return _0x104d63;})[_0x480b('0x1e')](respondWithFilteredResult(_0x4269b4,_0x57258e))[_0x480b('0x42')](handleError(_0x4269b4,null));};exports['show']=function(_0x10067f,_0x406065){var _0x1105fd={'raw':!![],'where':{'id':_0x10067f['params']['id']}},_0x36e7f3={};_0x36e7f3['model']=_[_0x480b('0x2b')](db['Pause'][_0x480b('0x26')]);_0x36e7f3['query']=_[_0x480b('0x2b')](_0x10067f[_0x480b('0x28')]);_0x36e7f3[_0x480b('0x2c')]=_[_0x480b('0x2d')](_0x36e7f3[_0x480b('0x27')],_0x36e7f3['query']);_0x1105fd[_0x480b('0x2e')]=_[_0x480b('0x2d')](_0x36e7f3[_0x480b('0x27')],qs[_0x480b('0x2f')](_0x10067f[_0x480b('0x28')]['fields']));_0x1105fd[_0x480b('0x2e')]=_0x1105fd['attributes'][_0x480b('0x30')]?_0x1105fd[_0x480b('0x2e')]:_0x36e7f3[_0x480b('0x27')];if(_0x10067f[_0x480b('0x28')][_0x480b('0x3d')]){_0x1105fd['include']=[{'all':!![]}];}_0x1105fd=_['merge']({},_0x1105fd,_0x10067f[_0x480b('0x3c')]);return db[_0x480b('0x3f')][_0x480b('0x43')](_0x1105fd)[_0x480b('0x1e')](handleEntityNotFound(_0x406065,null))[_0x480b('0x1e')](respondWithResult(_0x406065,null))[_0x480b('0x42')](handleError(_0x406065,null));};exports[_0x480b('0x44')]=function(_0x15874b,_0x310ac2){return db[_0x480b('0x3f')][_0x480b('0x44')](_0x15874b[_0x480b('0x45')],{})['then'](function(_0x2ff517){var _0x4606d6=_0x15874b[_0x480b('0x46')][_0x480b('0x20')]({'plain':!![]});if(!_0x4606d6)throw new Error(_0x480b('0x47'));if(_0x4606d6['role']===_0x480b('0x46')){var _0x28f373=_0x2ff517[_0x480b('0x20')]({'plain':!![]});var _0x10c124=_0x480b('0x21');return db[_0x480b('0x48')][_0x480b('0x43')]({'where':{'name':_0x10c124,'userProfileId':_0x4606d6[_0x480b('0x49')]},'raw':!![]})[_0x480b('0x1e')](function(_0x335b53){if(_0x335b53&&_0x335b53[_0x480b('0x4a')]===0x0){return db[_0x480b('0x4b')][_0x480b('0x44')]({'name':_0x28f373[_0x480b('0x23')],'resourceId':_0x28f373['id'],'type':_0x335b53[_0x480b('0x23')],'sectionId':_0x335b53['id']},{})[_0x480b('0x1e')](function(){return _0x2ff517;});}else{return _0x2ff517;}})[_0x480b('0x42')](function(_0x2115c3){logger[_0x480b('0x22')](_0x480b('0x4c'),_0x2115c3);throw _0x2115c3;});}return _0x2ff517;})['then'](respondWithResult(_0x310ac2,0xc9))[_0x480b('0x42')](handleError(_0x310ac2,null));};exports[_0x480b('0x1d')]=function(_0x75e3fd,_0x176659){if(_0x75e3fd[_0x480b('0x45')]['id']){delete _0x75e3fd[_0x480b('0x45')]['id'];}return db[_0x480b('0x3f')][_0x480b('0x43')]({'where':{'id':_0x75e3fd[_0x480b('0x4d')]['id']}})[_0x480b('0x1e')](handleEntityNotFound(_0x176659,null))[_0x480b('0x1e')](saveUpdates(_0x75e3fd[_0x480b('0x45')],null))['then'](respondWithResult(_0x176659,null))[_0x480b('0x42')](handleError(_0x176659,null));};exports[_0x480b('0x1f')]=function(_0x21c45f,_0x2b0036){return db[_0x480b('0x3f')]['find']({'where':{'id':_0x21c45f[_0x480b('0x4d')]['id']}})[_0x480b('0x1e')](handleEntityNotFound(_0x2b0036,null))['then'](removeEntity(_0x2b0036,null))[_0x480b('0x42')](handleError(_0x2b0036,null));};
\ No newline at end of file
+var _0xd3a0=['then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','rawAttributes','keys','dateStart','query','dateEnd','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','add','day','merge','filter','where','map','type','key','options','Pause','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xd3a0,0x7c));var _0x0d3a=function(_0x180b34,_0x3cdd48){_0x180b34=_0x180b34-0x0;var _0x2aff01=_0xd3a0[_0x180b34];return _0x2aff01;};'use strict';var pdf=require(_0x0d3a('0x0'));var emlformat=require(_0x0d3a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0d3a('0x2'));var jsonpatch=require(_0x0d3a('0x3'));var rp=require(_0x0d3a('0x4'));var moment=require(_0x0d3a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0d3a('0x6'));var util=require(_0x0d3a('0x7'));var path=require(_0x0d3a('0x8'));var sox=require('sox');var csv=require(_0x0d3a('0x9'));var ejs=require(_0x0d3a('0xa'));var fs=require('fs');var _=require(_0x0d3a('0xb'));var squel=require(_0x0d3a('0xc'));var crypto=require(_0x0d3a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0d3a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0d3a('0xf'));var Papa=require('papaparse');var Redis=require(_0x0d3a('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x0d3a('0x11'));var config=require(_0x0d3a('0x12'));var db=require(_0x0d3a('0x13'))['db'];function respondWithStatusCode(_0x1d73d3,_0xc5a187){_0xc5a187=_0xc5a187||0xcc;return function(_0x1e922a){if(_0x1e922a){return _0x1d73d3[_0x0d3a('0x14')](_0xc5a187);}return _0x1d73d3[_0x0d3a('0x15')](_0xc5a187)[_0x0d3a('0x16')]();};}function respondWithResult(_0x15757b,_0x4c1457){_0x4c1457=_0x4c1457||0xc8;return function(_0x583372){if(_0x583372){return _0x15757b['status'](_0x4c1457)['json'](_0x583372);}};}function respondWithFilteredResult(_0x5b8d1d,_0x2b8a95){return function(_0x51dde3){if(_0x51dde3){var _0x160771=_0x51dde3[_0x0d3a('0x17')],_0x45b678=_0x2b8a95[_0x0d3a('0x18')],_0x382720=_0x2b8a95[_0x0d3a('0x18')]+_0x2b8a95[_0x0d3a('0x19')],_0x9036f3;if(_0x382720>=_0x160771){_0x382720=_0x160771;_0x9036f3=0xc8;}else{_0x9036f3=0xce;}_0x5b8d1d[_0x0d3a('0x15')](_0x9036f3);return _0x5b8d1d[_0x0d3a('0x1a')](_0x0d3a('0x1b'),_0x45b678+'-'+_0x382720+'/'+_0x160771)[_0x0d3a('0x1c')](_0x51dde3);}return null;};}function patchUpdates(_0x1bb0a5){return function(_0x2facfc){try{jsonpatch[_0x0d3a('0x1d')](_0x2facfc,_0x1bb0a5,!![]);}catch(_0x15b83a){return BPromise[_0x0d3a('0x1e')](_0x15b83a);}return _0x2facfc['save']();};}function saveUpdates(_0x3ec88c,_0x1475e9){return function(_0x70302c){if(_0x70302c){return _0x70302c[_0x0d3a('0x1f')](_0x3ec88c)[_0x0d3a('0x20')](function(_0x7efb61){return _0x7efb61;});}return null;};}function removeEntity(_0x52d59d,_0x3e088c){return function(_0x422543){if(_0x422543){return _0x422543['destroy']()[_0x0d3a('0x20')](function(){var _0x4f1319=_0x422543[_0x0d3a('0x21')]({'plain':!![]});var _0x2b3532=_0x0d3a('0x22');return db[_0x0d3a('0x23')][_0x0d3a('0x24')]({'where':{'type':_0x2b3532,'resourceId':_0x4f1319['id']}})[_0x0d3a('0x20')](function(){return _0x422543;});})[_0x0d3a('0x20')](function(){_0x52d59d[_0x0d3a('0x15')](0xcc)[_0x0d3a('0x16')]();});}};}function handleEntityNotFound(_0x46c55f,_0x2a0852){return function(_0x21d718){if(!_0x21d718){_0x46c55f[_0x0d3a('0x14')](0x194);}return _0x21d718;};}function handleError(_0x40eff0,_0x378930){_0x378930=_0x378930||0x1f4;return function(_0x52cdc0){logger[_0x0d3a('0x25')](_0x52cdc0[_0x0d3a('0x26')]);if(_0x52cdc0[_0x0d3a('0x27')]){delete _0x52cdc0[_0x0d3a('0x27')];}_0x40eff0[_0x0d3a('0x15')](_0x378930)[_0x0d3a('0x28')](_0x52cdc0);};}exports['index']=function(_0x44a5c4,_0xca75cf){var _0x2966fa={},_0x3f1d36={},_0x179bf2={'count':0x0,'rows':[]};var _0x30ae80=db['Pause'][_0x0d3a('0x29')];_0x3f1d36['model']=_[_0x0d3a('0x2a')](_0x30ae80);var _0x1e4cdf={'dateStart':_0x44a5c4['query'][_0x0d3a('0x2b')],'dateEnd':_0x44a5c4[_0x0d3a('0x2c')][_0x0d3a('0x2d')]};delete _0x44a5c4[_0x0d3a('0x2c')][_0x0d3a('0x2b')];delete _0x44a5c4[_0x0d3a('0x2c')][_0x0d3a('0x2d')];_0x3f1d36[_0x0d3a('0x2c')]=_[_0x0d3a('0x2a')](_0x44a5c4[_0x0d3a('0x2c')]);_0x3f1d36[_0x0d3a('0x2e')]=_['intersection'](_0x3f1d36[_0x0d3a('0x2f')],_0x3f1d36[_0x0d3a('0x2c')]);_0x2966fa['attributes']=_[_0x0d3a('0x30')](_0x3f1d36[_0x0d3a('0x2f')],qs[_0x0d3a('0x31')](_0x44a5c4[_0x0d3a('0x2c')]['fields']));_0x2966fa[_0x0d3a('0x32')]=_0x2966fa['attributes'][_0x0d3a('0x33')]?_0x2966fa[_0x0d3a('0x32')]:_0x3f1d36[_0x0d3a('0x2f')];if(!_0x44a5c4[_0x0d3a('0x2c')][_0x0d3a('0x34')]('nolimit')){_0x2966fa['limit']=qs[_0x0d3a('0x19')](_0x44a5c4[_0x0d3a('0x2c')][_0x0d3a('0x19')]);_0x2966fa[_0x0d3a('0x18')]=qs[_0x0d3a('0x18')](_0x44a5c4[_0x0d3a('0x2c')]['offset']);}_0x2966fa['order']=qs[_0x0d3a('0x35')](_0x44a5c4[_0x0d3a('0x2c')]['sort']);_0x2966fa['where']=qs[_0x0d3a('0x2e')](_[_0x0d3a('0x36')](_0x44a5c4[_0x0d3a('0x2c')],_0x3f1d36[_0x0d3a('0x2e')]));if(_0x1e4cdf[_0x0d3a('0x2b')]){if(_0x1e4cdf['dateEnd']){_0x1e4cdf[_0x0d3a('0x2d')]=moment(_0x1e4cdf[_0x0d3a('0x2d')])[_0x0d3a('0x37')](0x1,_0x0d3a('0x38'));}else{_0x1e4cdf[_0x0d3a('0x2d')]=moment(_0x1e4cdf[_0x0d3a('0x2b')])['add'](0x1,'day');}_[_0x0d3a('0x39')](_0x2966fa['where'],{'createdAt':{'$gte':_0x1e4cdf[_0x0d3a('0x2b')],'$lte':_0x1e4cdf[_0x0d3a('0x2d')]}});}if(_0x44a5c4['query'][_0x0d3a('0x3a')]){_0x2966fa[_0x0d3a('0x3b')]=_[_0x0d3a('0x39')](_0x2966fa[_0x0d3a('0x3b')],{'$or':_[_0x0d3a('0x3c')](_0x30ae80,function(_0x129175){if(_0x129175[_0x0d3a('0x3d')][_0x0d3a('0x3e')]!=='VIRTUAL'){var _0x5c9420={};_0x5c9420[_0x129175['field']]={'$like':'%'+_0x44a5c4[_0x0d3a('0x2c')][_0x0d3a('0x3a')]+'%'};return _0x5c9420;}})});}_0x2966fa=_[_0x0d3a('0x39')]({},_0x2966fa,_0x44a5c4[_0x0d3a('0x3f')]);var _0x8bfff={'where':_0x2966fa[_0x0d3a('0x3b')]};return db[_0x0d3a('0x40')][_0x0d3a('0x17')](_0x8bfff)[_0x0d3a('0x20')](function(_0x59e773){_0x179bf2['count']=_0x59e773;if(_0x44a5c4['query']['includeAll']){_0x2966fa['include']=[{'all':!![]}];}return db['Pause'][_0x0d3a('0x41')](_0x2966fa);})['then'](function(_0x494438){_0x179bf2[_0x0d3a('0x42')]=_0x494438;return _0x179bf2;})['then'](respondWithFilteredResult(_0xca75cf,_0x2966fa))[_0x0d3a('0x43')](handleError(_0xca75cf,null));};exports[_0x0d3a('0x44')]=function(_0x265d48,_0x454f7f){var _0x5ad5d0={'raw':!![],'where':{'id':_0x265d48[_0x0d3a('0x45')]['id']}},_0x4142e6={};_0x4142e6['model']=_[_0x0d3a('0x2a')](db[_0x0d3a('0x40')][_0x0d3a('0x29')]);_0x4142e6[_0x0d3a('0x2c')]=_[_0x0d3a('0x2a')](_0x265d48[_0x0d3a('0x2c')]);_0x4142e6[_0x0d3a('0x2e')]=_[_0x0d3a('0x30')](_0x4142e6[_0x0d3a('0x2f')],_0x4142e6[_0x0d3a('0x2c')]);_0x5ad5d0[_0x0d3a('0x32')]=_[_0x0d3a('0x30')](_0x4142e6[_0x0d3a('0x2f')],qs['fields'](_0x265d48[_0x0d3a('0x2c')][_0x0d3a('0x31')]));_0x5ad5d0[_0x0d3a('0x32')]=_0x5ad5d0['attributes'][_0x0d3a('0x33')]?_0x5ad5d0[_0x0d3a('0x32')]:_0x4142e6['model'];if(_0x265d48[_0x0d3a('0x2c')][_0x0d3a('0x46')]){_0x5ad5d0[_0x0d3a('0x47')]=[{'all':!![]}];}_0x5ad5d0=_[_0x0d3a('0x39')]({},_0x5ad5d0,_0x265d48[_0x0d3a('0x3f')]);return db[_0x0d3a('0x40')][_0x0d3a('0x48')](_0x5ad5d0)[_0x0d3a('0x20')](handleEntityNotFound(_0x454f7f,null))[_0x0d3a('0x20')](respondWithResult(_0x454f7f,null))[_0x0d3a('0x43')](handleError(_0x454f7f,null));};exports[_0x0d3a('0x49')]=function(_0x29ac63,_0x4462b6){return db[_0x0d3a('0x40')][_0x0d3a('0x49')](_0x29ac63[_0x0d3a('0x4a')],{})[_0x0d3a('0x20')](function(_0x756d1c){var _0x479e23=_0x29ac63[_0x0d3a('0x4b')]['get']({'plain':!![]});if(!_0x479e23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x479e23[_0x0d3a('0x4c')]===_0x0d3a('0x4b')){var _0x2b6b90=_0x756d1c[_0x0d3a('0x21')]({'plain':!![]});var _0x11518c=_0x0d3a('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x11518c,'userProfileId':_0x479e23['userProfileId']},'raw':!![]})[_0x0d3a('0x20')](function(_0x3f75d7){if(_0x3f75d7&&_0x3f75d7['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d3a('0x49')]({'name':_0x2b6b90['name'],'resourceId':_0x2b6b90['id'],'type':_0x3f75d7[_0x0d3a('0x27')],'sectionId':_0x3f75d7['id']},{})['then'](function(){return _0x756d1c;});}else{return _0x756d1c;}})[_0x0d3a('0x43')](function(_0x1fe4af){logger[_0x0d3a('0x25')](_0x0d3a('0x4d'),_0x1fe4af);throw _0x1fe4af;});}return _0x756d1c;})['then'](respondWithResult(_0x4462b6,0xc9))[_0x0d3a('0x43')](handleError(_0x4462b6,null));};exports[_0x0d3a('0x1f')]=function(_0x2056b1,_0x3f7fa8){if(_0x2056b1[_0x0d3a('0x4a')]['id']){delete _0x2056b1[_0x0d3a('0x4a')]['id'];}return db[_0x0d3a('0x40')][_0x0d3a('0x48')]({'where':{'id':_0x2056b1[_0x0d3a('0x45')]['id']}})[_0x0d3a('0x20')](handleEntityNotFound(_0x3f7fa8,null))[_0x0d3a('0x20')](saveUpdates(_0x2056b1[_0x0d3a('0x4a')],null))[_0x0d3a('0x20')](respondWithResult(_0x3f7fa8,null))[_0x0d3a('0x43')](handleError(_0x3f7fa8,null));};exports[_0x0d3a('0x24')]=function(_0x33a16b,_0x974bc1){return db['Pause'][_0x0d3a('0x48')]({'where':{'id':_0x33a16b['params']['id']}})['then'](handleEntityNotFound(_0x974bc1,null))[_0x0d3a('0x20')](removeEntity(_0x974bc1,null))[_0x0d3a('0x43')](handleError(_0x974bc1,null));};
\ No newline at end of file
index c1e3f63..4df7e1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f09=['request-promise','./pause.attributes','exports','Pause','util','bluebird'];(function(_0x138975,_0x319d77){var _0x2ff39a=function(_0x2a1a21){while(--_0x2a1a21){_0x138975['push'](_0x138975['shift']());}};_0x2ff39a(++_0x319d77);}(_0x3f09,0x82));var _0x93f0=function(_0x455e56,_0x52a5e9){_0x455e56=_0x455e56-0x0;var _0x2ca900=_0x3f09[_0x455e56];return _0x2ca900;};'use strict';var _=require('lodash');var util=require(_0x93f0('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x93f0('0x1'));var rp=require(_0x93f0('0x2'));var attributes=require(_0x93f0('0x3'));module[_0x93f0('0x4')]=function(_0x1f309a,_0x1c1232){return _0x1f309a['define'](_0x93f0('0x5'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a0d=['define','Pause','tools_pauses','lodash','util','../../config/logger','moment','bluebird','request-promise','./pause.attributes','exports'];(function(_0x39b9ee,_0x20293e){var _0x3cb2c4=function(_0x4e6051){while(--_0x4e6051){_0x39b9ee['push'](_0x39b9ee['shift']());}};_0x3cb2c4(++_0x20293e);}(_0x6a0d,0x12c));var _0xd6a0=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6a0d[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xd6a0('0x0'));var util=require(_0xd6a0('0x1'));var logger=require(_0xd6a0('0x2'))('api');var moment=require(_0xd6a0('0x3'));var BPromise=require(_0xd6a0('0x4'));var rp=require(_0xd6a0('0x5'));var attributes=require(_0xd6a0('0x6'));module[_0xd6a0('0x7')]=function(_0x56c53f,_0x1dc99b){return _0x56c53f[_0xd6a0('0x8')](_0xd6a0('0x9'),attributes,{'tableName':_0xd6a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c3f3556..1679f7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2367=['request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowPause','Pause','options','raw','where','include','map','attributes','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x154e1a,_0x14041a){var _0x5bb8a1=function(_0x2f0f1d){while(--_0x2f0f1d){_0x154e1a['push'](_0x154e1a['shift']());}};_0x5bb8a1(++_0x14041a);}(_0x2367,0x7f));var _0x7236=function(_0x4abd7d,_0x12415a){_0x4abd7d=_0x4abd7d-0x0;var _0x56004a=_0x2367[_0x4abd7d];return _0x56004a;};'use strict';var _=require(_0x7236('0x0'));var util=require(_0x7236('0x1'));var moment=require(_0x7236('0x2'));var BPromise=require('bluebird');var rs=require(_0x7236('0x3'));var fs=require('fs');var Redis=require(_0x7236('0x4'));var db=require(_0x7236('0x5'))['db'];var utils=require(_0x7236('0x6'));var logger=require(_0x7236('0x7'))(_0x7236('0x8'));var config=require(_0x7236('0x9'));var jayson=require(_0x7236('0xa'));var client=jayson[_0x7236('0xb')][_0x7236('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49dd30,_0xe5f0b3,_0x8322ed){return new BPromise(function(_0x2cfc6a,_0x171b46){return client[_0x7236('0xd')](_0x49dd30,_0x8322ed)[_0x7236('0xe')](function(_0x5a9de3){logger[_0x7236('0xf')](_0x7236('0x10'),_0xe5f0b3,_0x7236('0x11'));logger[_0x7236('0x12')](_0x7236('0x13'),_0xe5f0b3,'request\x20sent',JSON[_0x7236('0x14')](_0x5a9de3));if(_0x5a9de3['error']){if(_0x5a9de3[_0x7236('0x15')][_0x7236('0x16')]===0x1f4){logger[_0x7236('0x15')](_0x7236('0x10'),_0xe5f0b3,_0x5a9de3[_0x7236('0x15')]['message']);return _0x171b46(_0x5a9de3[_0x7236('0x15')][_0x7236('0x17')]);}logger[_0x7236('0x15')](_0x7236('0x10'),_0xe5f0b3,_0x5a9de3[_0x7236('0x15')]['message']);return _0x2cfc6a(_0x5a9de3[_0x7236('0x15')][_0x7236('0x17')]);}else{logger[_0x7236('0xf')](_0x7236('0x10'),_0xe5f0b3,_0x7236('0x11'));_0x2cfc6a(_0x5a9de3[_0x7236('0x18')][_0x7236('0x17')]);}})[_0x7236('0x19')](function(_0x1b8d11){logger[_0x7236('0x15')](_0x7236('0x10'),_0xe5f0b3,_0x1b8d11);_0x171b46(_0x1b8d11);});});}exports[_0x7236('0x1a')]=function(_0x57ff45){var _0xc728f3=this;return new Promise(function(_0x2b1c63,_0xbb2e67){return db[_0x7236('0x1b')]['find']({'raw':_0x57ff45[_0x7236('0x1c')]?_0x57ff45[_0x7236('0x1c')][_0x7236('0x1d')]===undefined?!![]:![]:!![],'where':_0x57ff45['options']?_0x57ff45[_0x7236('0x1c')][_0x7236('0x1e')]||null:null,'attributes':_0x57ff45[_0x7236('0x1c')]?_0x57ff45['options']['attributes']||null:null,'include':_0x57ff45[_0x7236('0x1c')]?_0x57ff45[_0x7236('0x1c')][_0x7236('0x1f')]?_[_0x7236('0x20')](_0x57ff45[_0x7236('0x1c')]['include'],function(_0x141452){return{'model':db[_0x141452['model']],'as':_0x141452['as'],'attributes':_0x141452[_0x7236('0x21')],'include':_0x141452['include']?_[_0x7236('0x20')](_0x141452[_0x7236('0x1f')],function(_0x451edf){return{'model':db[_0x451edf[_0x7236('0x22')]],'as':_0x451edf['as'],'attributes':_0x451edf[_0x7236('0x21')],'include':_0x451edf[_0x7236('0x1f')]?_[_0x7236('0x20')](_0x451edf['include'],function(_0xb593fd){return{'model':db[_0xb593fd['model']],'as':_0xb593fd['as'],'attributes':_0xb593fd[_0x7236('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x588066){logger['info'](_0x7236('0x1a'),_0x57ff45);logger[_0x7236('0x12')]('ShowPause',_0x57ff45,JSON['stringify'](_0x588066));_0x2b1c63(_0x588066);})[_0x7236('0x19')](function(_0x3b8ebe){logger[_0x7236('0x15')](_0x7236('0x1a'),_0x3b8ebe[_0x7236('0x17')],_0x57ff45);_0xbb2e67(_0xc728f3['error'](0x1f4,_0x3b8ebe['message']));});});};
\ No newline at end of file
+var _0xba91=['request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowPause','find','options','raw','where','include','map','model','attributes','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Pause,\x20%s,\x20%s'];(function(_0x4da71a,_0x56c8b4){var _0x34da41=function(_0x3eb893){while(--_0x3eb893){_0x4da71a['push'](_0x4da71a['shift']());}};_0x34da41(++_0x56c8b4);}(_0xba91,0xac));var _0x1ba9=function(_0x29b9e5,_0x4798a3){_0x29b9e5=_0x29b9e5-0x0;var _0x1a83cd=_0xba91[_0x29b9e5];return _0x1a83cd;};'use strict';var _=require(_0x1ba9('0x0'));var util=require('util');var moment=require(_0x1ba9('0x1'));var BPromise=require(_0x1ba9('0x2'));var rs=require(_0x1ba9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ba9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ba9('0x5'))('rpc');var config=require(_0x1ba9('0x6'));var jayson=require(_0x1ba9('0x7'));var client=jayson[_0x1ba9('0x8')][_0x1ba9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x123791,_0x509884,_0x7cf7fd){return new BPromise(function(_0x367b2,_0x5f2505){return client[_0x1ba9('0xa')](_0x123791,_0x7cf7fd)[_0x1ba9('0xb')](function(_0x322930){logger[_0x1ba9('0xc')](_0x1ba9('0xd'),_0x509884,_0x1ba9('0xe'));logger['debug'](_0x1ba9('0xf'),_0x509884,'request\x20sent',JSON[_0x1ba9('0x10')](_0x322930));if(_0x322930['error']){if(_0x322930[_0x1ba9('0x11')]['code']===0x1f4){logger[_0x1ba9('0x11')]('Pause,\x20%s,\x20%s',_0x509884,_0x322930[_0x1ba9('0x11')]['message']);return _0x5f2505(_0x322930[_0x1ba9('0x11')][_0x1ba9('0x12')]);}logger[_0x1ba9('0x11')](_0x1ba9('0xd'),_0x509884,_0x322930['error'][_0x1ba9('0x12')]);return _0x367b2(_0x322930['error'][_0x1ba9('0x12')]);}else{logger[_0x1ba9('0xc')]('Pause,\x20%s,\x20%s',_0x509884,_0x1ba9('0xe'));_0x367b2(_0x322930[_0x1ba9('0x13')][_0x1ba9('0x12')]);}})[_0x1ba9('0x14')](function(_0x3d0a40){logger[_0x1ba9('0x11')](_0x1ba9('0xd'),_0x509884,_0x3d0a40);_0x5f2505(_0x3d0a40);});});}exports[_0x1ba9('0x15')]=function(_0x5ca9ce){var _0x2fe7d5=this;return new Promise(function(_0x26ebb5,_0x3c52cd){return db['Pause'][_0x1ba9('0x16')]({'raw':_0x5ca9ce[_0x1ba9('0x17')]?_0x5ca9ce[_0x1ba9('0x17')][_0x1ba9('0x18')]===undefined?!![]:![]:!![],'where':_0x5ca9ce[_0x1ba9('0x17')]?_0x5ca9ce[_0x1ba9('0x17')][_0x1ba9('0x19')]||null:null,'attributes':_0x5ca9ce[_0x1ba9('0x17')]?_0x5ca9ce['options']['attributes']||null:null,'include':_0x5ca9ce[_0x1ba9('0x17')]?_0x5ca9ce[_0x1ba9('0x17')][_0x1ba9('0x1a')]?_[_0x1ba9('0x1b')](_0x5ca9ce[_0x1ba9('0x17')]['include'],function(_0x22f3f0){return{'model':db[_0x22f3f0[_0x1ba9('0x1c')]],'as':_0x22f3f0['as'],'attributes':_0x22f3f0['attributes'],'include':_0x22f3f0[_0x1ba9('0x1a')]?_[_0x1ba9('0x1b')](_0x22f3f0[_0x1ba9('0x1a')],function(_0x5e0876){return{'model':db[_0x5e0876[_0x1ba9('0x1c')]],'as':_0x5e0876['as'],'attributes':_0x5e0876['attributes'],'include':_0x5e0876['include']?_[_0x1ba9('0x1b')](_0x5e0876[_0x1ba9('0x1a')],function(_0x5bff57){return{'model':db[_0x5bff57['model']],'as':_0x5bff57['as'],'attributes':_0x5bff57[_0x1ba9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ddecf){logger['info'](_0x1ba9('0x15'),_0x5ca9ce);logger[_0x1ba9('0x1e')]('ShowPause',_0x5ca9ce,JSON[_0x1ba9('0x10')](_0x1ddecf));_0x26ebb5(_0x1ddecf);})[_0x1ba9('0x14')](function(_0x458939){logger[_0x1ba9('0x11')](_0x1ba9('0x15'),_0x458939[_0x1ba9('0x12')],_0x5ca9ce);_0x3c52cd(_0x2fe7d5['error'](0x1f4,_0x458939[_0x1ba9('0x12')]));});});};
\ No newline at end of file
index fcd90b1..e4de87a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29ea=['isAuthenticated','update','delete','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','upload','webhookPost','put'];(function(_0x43a44d,_0xd04708){var _0x557796=function(_0x2e6924){while(--_0x2e6924){_0x43a44d['push'](_0x43a44d['shift']());}};_0x557796(++_0xd04708);}(_0x29ea,0x183));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa29e('0x0'));var util=require(_0xa29e('0x1'));var path=require('path');var timeout=require(_0xa29e('0x2'));var express=require(_0xa29e('0x3'));var router=express[_0xa29e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa29e('0x5'));var config=require(_0xa29e('0x6'));var controller=require(_0xa29e('0x7'));router[_0xa29e('0x8')]('/',auth['isAuthenticated'](),controller[_0xa29e('0x9')]);router[_0xa29e('0x8')](_0xa29e('0xa'),controller[_0xa29e('0xb')]);router[_0xa29e('0x8')](_0xa29e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa29e('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xa29e('0xd')]);var upload=multer({'storage':multer[_0xa29e('0xe')]({'destination':function(_0x402afe,_0x5a1c41,_0x2bd409){_0x2bd409(null,path[_0xa29e('0xf')](config['root'],_0xa29e('0x10')));},'filename':function(_0x66a9b5,_0x2a7faf,_0x447bbb){_0x2a7faf[_0xa29e('0x11')]=_0x2a7faf['originalname'][_0xa29e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x447bbb(null,util[_0xa29e('0x13')](_0xa29e('0x14'),path[_0xa29e('0x15')](_0x2a7faf[_0xa29e('0x11')],path[_0xa29e('0x16')](_0x2a7faf['originalname'])),Date[_0xa29e('0x17')](),path[_0xa29e('0x16')](_0x2a7faf[_0xa29e('0x11')])));}})});router[_0xa29e('0x18')]('/',upload['single'](_0xa29e('0x19')),controller[_0xa29e('0x1a')]);router[_0xa29e('0x18')](_0xa29e('0xa'),controller[_0xa29e('0x1b')]);router[_0xa29e('0x1c')](_0xa29e('0xc'),auth[_0xa29e('0x1d')](),controller[_0xa29e('0x1e')]);router[_0xa29e('0x1f')](_0xa29e('0xc'),auth['isAuthenticated'](),controller[_0xa29e('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x467f=['./plugin.controller','isAuthenticated','index','/webhook','webhookGet','/:id','show','get','/:id/download','diskStorage','root','server/files/plugins','originalname','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c9b66,_0x581946){var _0x5d7d5e=function(_0x125c40){while(--_0x125c40){_0x4c9b66['push'](_0x4c9b66['shift']());}};_0x5d7d5e(++_0x581946);}(_0x467f,0x1a5));var _0xf467=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x467f[_0x36ed3c];return _0x52a2e0;};'use strict';var multer=require(_0xf467('0x0'));var util=require(_0xf467('0x1'));var path=require(_0xf467('0x2'));var timeout=require(_0xf467('0x3'));var express=require(_0xf467('0x4'));var router=express['Router']();var auth=require(_0xf467('0x5'));var interaction=require(_0xf467('0x6'));var config=require(_0xf467('0x7'));var controller=require(_0xf467('0x8'));router['get']('/',auth[_0xf467('0x9')](),controller[_0xf467('0xa')]);router['get'](_0xf467('0xb'),controller[_0xf467('0xc')]);router['get'](_0xf467('0xd'),auth[_0xf467('0x9')](),controller[_0xf467('0xe')]);router[_0xf467('0xf')](_0xf467('0x10'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xf467('0x11')]({'destination':function(_0x47f2f3,_0x3f0fc1,_0x3f425d){_0x3f425d(null,path['join'](config[_0xf467('0x12')],_0xf467('0x13')));},'filename':function(_0x4320bc,_0x4f90f2,_0x3ac682){_0x4f90f2[_0xf467('0x14')]=_0x4f90f2[_0xf467('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ac682(null,util['format'](_0xf467('0x15'),path[_0xf467('0x16')](_0x4f90f2[_0xf467('0x14')],path[_0xf467('0x17')](_0x4f90f2[_0xf467('0x14')])),Date[_0xf467('0x18')](),path[_0xf467('0x17')](_0x4f90f2[_0xf467('0x14')])));}})});router['post']('/',upload[_0xf467('0x19')](_0xf467('0x1a')),controller[_0xf467('0x1b')]);router[_0xf467('0x1c')](_0xf467('0xb'),controller[_0xf467('0x1d')]);router['put'](_0xf467('0xd'),auth[_0xf467('0x9')](),controller[_0xf467('0x1e')]);router[_0xf467('0x1f')](_0xf467('0xd'),auth[_0xf467('0x9')](),controller['delete']);module[_0xf467('0x20')]=router;
\ No newline at end of file
index b9de8b8..006992a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x107c=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x107c,0xf9));var _0xc107=function(_0x21ee11,_0x172225){_0x21ee11=_0x21ee11-0x0;var _0xb4c64e=_0x107c[_0x21ee11];return _0xb4c64e;};'use strict';var Sequelize=require(_0xc107('0x0'));module[_0xc107('0x1')]={'name':{'type':Sequelize[_0xc107('0x2')]},'type':{'type':Sequelize[_0xc107('0x3')](_0xc107('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xc107('0x5')]},'path':{'type':Sequelize[_0xc107('0x2')],'comment':_0xc107('0x6')},'active':{'type':Sequelize[_0xc107('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xc107('0x8'),_0xc107('0x9'),_0xc107('0xa'),_0xc107('0xb')),'defaultValue':_0xc107('0xa'),'comment':_0xc107('0xc')},'icon':{'type':Sequelize[_0xc107('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xc107('0x2')]},'scriptPath':{'type':Sequelize[_0xc107('0x2')]}};
\ No newline at end of file
+var _0x79f4=['exports','ENUM','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x2ae566,_0x4225e5){var _0x21590c=function(_0x2a095e){while(--_0x2a095e){_0x2ae566['push'](_0x2ae566['shift']());}};_0x21590c(++_0x4225e5);}(_0x79f4,0x113));var _0x479f=function(_0x3255ee,_0x1b5549){_0x3255ee=_0x3255ee-0x0;var _0x4c832a=_0x79f4[_0x3255ee];return _0x4c832a;};'use strict';var Sequelize=require('sequelize');module[_0x479f('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x479f('0x1')]('html',_0x479f('0x2'))},'description':{'type':Sequelize[_0x479f('0x3')]},'version':{'type':Sequelize[_0x479f('0x3')]},'path':{'type':Sequelize[_0x479f('0x4')],'comment':_0x479f('0x5')},'active':{'type':Sequelize[_0x479f('0x6')],'defaultValue':0x0,'comment':_0x479f('0x7')},'sidebar':{'type':Sequelize[_0x479f('0x1')](_0x479f('0x8'),'agentOnly',_0x479f('0x9'),'never'),'defaultValue':_0x479f('0x9'),'comment':_0x479f('0xa')},'icon':{'type':Sequelize[_0x479f('0x4')]},'adminUrl':{'type':Sequelize[_0x479f('0x4')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x479f('0x4')]}};
\ No newline at end of file
index 40a256d..7f8db67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c8e=['port','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','to-csv','lodash','squel','crypto','jsforce','ioredis','extract-zip','archiver','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Plugins','stack','name','send','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','day','merge','filter','map','type','field','options','Plugin','count','includeAll','include','findAll','catch','params','fields','find','download','path','join','server/files/plugins','format','%s.zip','zip','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','dirname','node_modules/**/*','attachments/**/*','finalize','Sequelize','Plugin\x20not\x20found','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Extracted\x20folder\x20removed','delete','webhookGet','hostname'];(function(_0x1cdfcd,_0x37be5f){var _0x274b60=function(_0x34f017){while(--_0x34f017){_0x1cdfcd['push'](_0x1cdfcd['shift']());}};_0x274b60(++_0x37be5f);}(_0x7c8e,0x161));var _0xe7c8=function(_0x9ff1c0,_0x207afc){_0x9ff1c0=_0x9ff1c0-0x0;var _0x3e6c23=_0x7c8e[_0x9ff1c0];return _0x3e6c23;};'use strict';var pdf=require(_0xe7c8('0x0'));var emlformat=require(_0xe7c8('0x1'));var rimraf=require(_0xe7c8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe7c8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe7c8('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe7c8('0x6'));var squel=require(_0xe7c8('0x7'));var crypto=require(_0xe7c8('0x8'));var jsforce=require(_0xe7c8('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe7c8('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe7c8('0xa'));var extract=require(_0xe7c8('0xb'));var rimraf=require(_0xe7c8('0x2'));var archiver=require(_0xe7c8('0xc'));var qs=require(_0xe7c8('0xd'));var logger=require(_0xe7c8('0xe'))(_0xe7c8('0xf'));var utils=require(_0xe7c8('0x10'));var config=require(_0xe7c8('0x11'));var db=require(_0xe7c8('0x12'))['db'];config[_0xe7c8('0x13')]=_[_0xe7c8('0x14')](config[_0xe7c8('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xe7c8('0x15'))(new Redis(config[_0xe7c8('0x13')]));require(_0xe7c8('0x16'))[_0xe7c8('0x17')](socket);function respondWithStatusCode(_0x3690d0,_0x7c648c){_0x7c648c=_0x7c648c||0xcc;return function(_0x337b48){if(_0x337b48){return _0x3690d0[_0xe7c8('0x18')](_0x7c648c);}return _0x3690d0[_0xe7c8('0x19')](_0x7c648c)[_0xe7c8('0x1a')]();};}function respondWithResult(_0x12f6aa,_0x28584e){_0x28584e=_0x28584e||0xc8;return function(_0x14ae91){if(_0x14ae91){return _0x12f6aa[_0xe7c8('0x19')](_0x28584e)['json'](_0x14ae91);}};}function respondWithFilteredResult(_0x39b1c4,_0x200790){return function(_0x543838){if(_0x543838){var _0x3cb7ad=_0x543838['count'],_0x49a139=_0x200790[_0xe7c8('0x1b')],_0x5d7cba=_0x200790[_0xe7c8('0x1b')]+_0x200790['limit'],_0xf36c3d;if(_0x5d7cba>=_0x3cb7ad){_0x5d7cba=_0x3cb7ad;_0xf36c3d=0xc8;}else{_0xf36c3d=0xce;}_0x39b1c4[_0xe7c8('0x19')](_0xf36c3d);return _0x39b1c4[_0xe7c8('0x1c')](_0xe7c8('0x1d'),_0x49a139+'-'+_0x5d7cba+'/'+_0x3cb7ad)[_0xe7c8('0x1e')](_0x543838);}return null;};}function patchUpdates(_0x1362ad){return function(_0x856100){try{jsonpatch[_0xe7c8('0x1f')](_0x856100,_0x1362ad,!![]);}catch(_0x1f161d){return BPromise[_0xe7c8('0x20')](_0x1f161d);}return _0x856100[_0xe7c8('0x21')]();};}function saveUpdates(_0x4405a6,_0x493542){return function(_0x27f982){if(_0x27f982){return _0x27f982[_0xe7c8('0x22')](_0x4405a6)[_0xe7c8('0x23')](function(_0x5d7d01){return _0x5d7d01;});}return null;};}function removeEntity(_0x4b621f,_0x5e718a){return function(_0x57e106){if(_0x57e106){return _0x57e106[_0xe7c8('0x24')]()['then'](function(){var _0x1e826f=_0x57e106[_0xe7c8('0x25')]({'plain':!![]});var _0x324eab=_0xe7c8('0x26');return db['UserProfileResource'][_0xe7c8('0x24')]({'where':{'type':_0x324eab,'resourceId':_0x1e826f['id']}})[_0xe7c8('0x23')](function(){return _0x57e106;});})[_0xe7c8('0x23')](function(){_0x4b621f[_0xe7c8('0x19')](0xcc)[_0xe7c8('0x1a')]();});}};}function handleEntityNotFound(_0x4d6f3c,_0x4835ad){return function(_0x5e9308){if(!_0x5e9308){_0x4d6f3c[_0xe7c8('0x18')](0x194);}return _0x5e9308;};}function handleError(_0x3efde8,_0x6061f){_0x6061f=_0x6061f||0x1f4;return function(_0x1b246b){logger['error'](_0x1b246b[_0xe7c8('0x27')]);if(_0x1b246b[_0xe7c8('0x28')]){delete _0x1b246b[_0xe7c8('0x28')];}_0x3efde8[_0xe7c8('0x19')](_0x6061f)[_0xe7c8('0x29')](_0x1b246b);};}exports['index']=function(_0x4fb4ad,_0x4cde6a){var _0x38a2a={},_0x169b89={},_0x4b7490={'count':0x0,'rows':[]};var _0x19665=db['Plugin'][_0xe7c8('0x2a')];_0x169b89[_0xe7c8('0x2b')]=_[_0xe7c8('0x2c')](_0x19665);var _0x1323c9={'dateStart':_0x4fb4ad['query']['dateStart'],'dateEnd':_0x4fb4ad[_0xe7c8('0x2d')]['dateEnd']};delete _0x4fb4ad[_0xe7c8('0x2d')][_0xe7c8('0x2e')];delete _0x4fb4ad[_0xe7c8('0x2d')][_0xe7c8('0x2f')];_0x169b89['query']=_[_0xe7c8('0x2c')](_0x4fb4ad[_0xe7c8('0x2d')]);_0x169b89['filters']=_[_0xe7c8('0x30')](_0x169b89[_0xe7c8('0x2b')],_0x169b89[_0xe7c8('0x2d')]);_0x38a2a[_0xe7c8('0x31')]=_[_0xe7c8('0x30')](_0x169b89[_0xe7c8('0x2b')],qs['fields'](_0x4fb4ad['query']['fields']));_0x38a2a[_0xe7c8('0x31')]=_0x38a2a[_0xe7c8('0x31')][_0xe7c8('0x32')]?_0x38a2a['attributes']:_0x169b89[_0xe7c8('0x2b')];if(!_0x4fb4ad[_0xe7c8('0x2d')][_0xe7c8('0x33')](_0xe7c8('0x34'))){_0x38a2a[_0xe7c8('0x35')]=qs['limit'](_0x4fb4ad[_0xe7c8('0x2d')][_0xe7c8('0x35')]);_0x38a2a['offset']=qs[_0xe7c8('0x1b')](_0x4fb4ad['query'][_0xe7c8('0x1b')]);}_0x38a2a[_0xe7c8('0x36')]=qs[_0xe7c8('0x37')](_0x4fb4ad[_0xe7c8('0x2d')]['sort']);_0x38a2a[_0xe7c8('0x38')]=qs['filters'](_[_0xe7c8('0x39')](_0x4fb4ad[_0xe7c8('0x2d')],_0x169b89[_0xe7c8('0x3a')]));if(_0x1323c9['dateStart']){if(_0x1323c9[_0xe7c8('0x2f')]){_0x1323c9[_0xe7c8('0x2f')]=moment(_0x1323c9[_0xe7c8('0x2f')])['add'](0x1,_0xe7c8('0x3b'));}else{_0x1323c9['dateEnd']=moment(_0x1323c9[_0xe7c8('0x2e')])['add'](0x1,_0xe7c8('0x3b'));}_[_0xe7c8('0x3c')](_0x38a2a['where'],{'createdAt':{'$gte':_0x1323c9[_0xe7c8('0x2e')],'$lte':_0x1323c9['dateEnd']}});}if(_0x4fb4ad[_0xe7c8('0x2d')][_0xe7c8('0x3d')]){_0x38a2a['where']=_[_0xe7c8('0x3c')](_0x38a2a['where'],{'$or':_[_0xe7c8('0x3e')](_0x19665,function(_0x4d4cb4){if(_0x4d4cb4[_0xe7c8('0x3f')]['key']!=='VIRTUAL'){var _0xf7a047={};_0xf7a047[_0x4d4cb4[_0xe7c8('0x40')]]={'$like':'%'+_0x4fb4ad['query']['filter']+'%'};return _0xf7a047;}})});}_0x38a2a=_[_0xe7c8('0x3c')]({},_0x38a2a,_0x4fb4ad[_0xe7c8('0x41')]);var _0x5da0e0={'where':_0x38a2a[_0xe7c8('0x38')]};return db[_0xe7c8('0x42')][_0xe7c8('0x43')](_0x5da0e0)['then'](function(_0x3d238d){_0x4b7490[_0xe7c8('0x43')]=_0x3d238d;if(_0x4fb4ad[_0xe7c8('0x2d')][_0xe7c8('0x44')]){_0x38a2a[_0xe7c8('0x45')]=[{'all':!![]}];}return db['Plugin'][_0xe7c8('0x46')](_0x38a2a);})[_0xe7c8('0x23')](function(_0x46ceb7){_0x4b7490['rows']=_0x46ceb7;return _0x4b7490;})['then'](respondWithFilteredResult(_0x4cde6a,_0x38a2a))[_0xe7c8('0x47')](handleError(_0x4cde6a,null));};exports['show']=function(_0x3a0e27,_0x3d9cb5){var _0x6e4e79={'raw':!![],'where':{'id':_0x3a0e27[_0xe7c8('0x48')]['id']}},_0x41ff94={};_0x41ff94['model']=_[_0xe7c8('0x2c')](db[_0xe7c8('0x42')]['rawAttributes']);_0x41ff94['query']=_[_0xe7c8('0x2c')](_0x3a0e27[_0xe7c8('0x2d')]);_0x41ff94[_0xe7c8('0x3a')]=_['intersection'](_0x41ff94[_0xe7c8('0x2b')],_0x41ff94[_0xe7c8('0x2d')]);_0x6e4e79[_0xe7c8('0x31')]=_['intersection'](_0x41ff94[_0xe7c8('0x2b')],qs[_0xe7c8('0x49')](_0x3a0e27['query'][_0xe7c8('0x49')]));_0x6e4e79[_0xe7c8('0x31')]=_0x6e4e79[_0xe7c8('0x31')][_0xe7c8('0x32')]?_0x6e4e79[_0xe7c8('0x31')]:_0x41ff94[_0xe7c8('0x2b')];if(_0x3a0e27[_0xe7c8('0x2d')]['includeAll']){_0x6e4e79[_0xe7c8('0x45')]=[{'all':!![]}];}_0x6e4e79=_[_0xe7c8('0x3c')]({},_0x6e4e79,_0x3a0e27['options']);return db[_0xe7c8('0x42')][_0xe7c8('0x4a')](_0x6e4e79)[_0xe7c8('0x23')](handleEntityNotFound(_0x3d9cb5,null))[_0xe7c8('0x23')](respondWithResult(_0x3d9cb5,null))[_0xe7c8('0x47')](handleError(_0x3d9cb5,null));};exports[_0xe7c8('0x4b')]=function(_0x3f685f,_0x397641,_0x19bc9a){return db[_0xe7c8('0x42')]['find']({'where':{'id':_0x3f685f['params']['id']},'attributes':[_0xe7c8('0x28'),_0xe7c8('0x4c')],'raw':!![]})[_0xe7c8('0x23')](handleEntityNotFound(_0x397641,null))['then'](function(_0x5c5f03){if(_0x5c5f03){var _0x52e4a6=path[_0xe7c8('0x4d')](config['root'],_0xe7c8('0x4e'),util[_0xe7c8('0x4f')](_0xe7c8('0x50'),path['basename'](_0x5c5f03['path'])));var _0x1c1b39=fs['createWriteStream'](_0x52e4a6);var _0x58fe8f=archiver(_0xe7c8('0x51'),{'zlib':{'level':0x9}});_0x58fe8f['on'](_0xe7c8('0x52'),function(_0x5db23d){if(_0x5db23d[_0xe7c8('0x53')]===_0xe7c8('0x54')){logger[_0xe7c8('0x55')](_0x5db23d);}else{throw new db['Sequelize'][(_0xe7c8('0x56'))](_0xe7c8('0x57'));}});_0x58fe8f['on'](_0xe7c8('0x55'),function(_0x1ff547){throw new db['Sequelize']['Error'](_0xe7c8('0x57'));});_0x58fe8f[_0xe7c8('0x58')](_0x1c1b39);_0x58fe8f['glob'](_0xe7c8('0x59'),{'cwd':path['join'](config[_0xe7c8('0x5a')],_0xe7c8('0x4e'),path[_0xe7c8('0x5b')](_0x5c5f03[_0xe7c8('0x4c')])),'ignore':[path[_0xe7c8('0x4d')](path['basename'](_0x5c5f03[_0xe7c8('0x4c')]),_0xe7c8('0x5c')),path[_0xe7c8('0x4d')](path['basename'](_0x5c5f03['path']),_0xe7c8('0x5d'))],'nodir':!![]})[_0xe7c8('0x5e')]();_0x1c1b39['on']('close',function(){if(!fs['existsSync'](_0x52e4a6)){throw new db[(_0xe7c8('0x5f'))][(_0xe7c8('0x56'))](_0xe7c8('0x60'));}return _0x397641[_0xe7c8('0x4b')](_0x52e4a6,util[_0xe7c8('0x4f')](_0xe7c8('0x50'),path[_0xe7c8('0x61')](_0x5c5f03[_0xe7c8('0x4c')])),function(_0xcf1aca){if(_0xcf1aca){throw new db[(_0xe7c8('0x5f'))][(_0xe7c8('0x56'))](_0xe7c8('0x62'));}fs[_0xe7c8('0x63')](_0x52e4a6);logger['info'](_0xe7c8('0x64'));logger[_0xe7c8('0x65')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x397641,null));};exports[_0xe7c8('0x66')]=function(_0x4972be,_0x1bf798,_0x43ca6e){var _0xb9898c=path[_0xe7c8('0x61')](_0x4972be[_0xe7c8('0x67')]['filename'],path[_0xe7c8('0x68')](_0x4972be[_0xe7c8('0x67')][_0xe7c8('0x69')]));var _0x196799=path[_0xe7c8('0x4d')](config['root'],_0xe7c8('0x4e'),_0x4972be[_0xe7c8('0x67')][_0xe7c8('0x69')]);var _0x5587c7=path[_0xe7c8('0x4d')](config[_0xe7c8('0x5a')],_0xe7c8('0x4e'),_0xb9898c);logger[_0xe7c8('0x65')](_0xe7c8('0x6a'),_0x196799);logger[_0xe7c8('0x65')]('Plugin\x20upload\x20destination:\x20%s',_0x5587c7);try{fs[_0xe7c8('0x6b')](_0x196799,parseInt(_0xe7c8('0x6c'),0x8));extract(_0x196799,{'dir':_0x5587c7},function(_0x399110){if(_0x399110){logger[_0xe7c8('0x55')](_0x399110);handleError(_0x399110,!![]);};var _0x3d5265=fs[_0xe7c8('0x6d')](_0x5587c7);if(_0x3d5265['length']>0x1){removeReferences(_0x196799,_0x5587c7);logger[_0xe7c8('0x55')](_0xe7c8('0x6e'));return _0x43ca6e(new Error(_0xe7c8('0x6e')));}var _0x93d7c7=fs[_0xe7c8('0x6f')](path['join'](_0x5587c7,_0x3d5265[0x0]));if(_0x93d7c7['isFile']()){removeReferences(_0x196799,_0x5587c7);logger['error'](_0xe7c8('0x6e'));return _0x43ca6e(new Error(_0xe7c8('0x6e')));}if(_0x93d7c7[_0xe7c8('0x70')]()){var _0x417072=fs[_0xe7c8('0x6d')](path[_0xe7c8('0x4d')](_0x5587c7,_0x3d5265[0x0]));if(_0x417072[_0xe7c8('0x32')]===0x0){removeReferences(_0x196799,_0x5587c7);logger[_0xe7c8('0x55')](_0xe7c8('0x6e'));return _0x43ca6e(new Error('Invalid\x20plugin\x20structure'));}var _0x41d6fd=_0x417072[_0xe7c8('0x71')](function(_0x7dd4a9){return _0x7dd4a9===_0xe7c8('0x72');});if(!_0x41d6fd){return _0x43ca6e(new Error('Plugin\x20manifest\x20missing'));}var _0x417856=fs[_0xe7c8('0x73')](path['join'](_0x5587c7,_0x3d5265[0x0],_0xe7c8('0x72')));var _0x3963dd=JSON[_0xe7c8('0x74')](_0x417856);if(_0xe7c8('0x75')==typeof _0x3963dd['name']){return _0x43ca6e(new Error(_0xe7c8('0x76')));}if('undefined'==typeof _0x3963dd['type']){return _0x43ca6e(new Error(_0xe7c8('0x77')));}if('undefined'==typeof _0x3963dd[_0xe7c8('0x78')]){return _0x43ca6e(new Error(_0xe7c8('0x79')));}if('undefined'==typeof _0x3963dd[_0xe7c8('0x7a')]){return _0x43ca6e(new Error(_0xe7c8('0x7b')));}if(_0x3963dd[_0xe7c8('0x3f')]===_0xe7c8('0x7c')){if('undefined'==typeof _0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')]){return _0x43ca6e(new Error(_0xe7c8('0x7e')));}if(_0xe7c8('0x75')==typeof _0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')][_0xe7c8('0x7f')]&&'undefined'==typeof _0x3963dd['parameters'][_0xe7c8('0x7d')][_0xe7c8('0x80')]){return _0x43ca6e(new Error(_0xe7c8('0x81')));}}else if(_0x3963dd['type']===_0xe7c8('0x82')){if('undefined'==typeof _0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x83')]){return _0x43ca6e(new Error(_0xe7c8('0x84')));}if('undefined'==typeof _0x3963dd['parameters'][_0xe7c8('0x85')]){return _0x43ca6e(new Error(_0xe7c8('0x86')));}}else{return _0x43ca6e(new Error(_0xe7c8('0x87')));}var _0xe49cfa=_0x3963dd['name'];var _0x1351c6=_0x3963dd[_0xe7c8('0x88')];var _0x195263=_0x3963dd[_0xe7c8('0x3f')];var _0x2dcc70=_0x3963dd[_0xe7c8('0x89')]?_0x3963dd[_0xe7c8('0x89')]:_0xe7c8('0x8a');var _0x1d1fd2=_0x3963dd[_0xe7c8('0x8b')]?_0x3963dd[_0xe7c8('0x8b')]:_0xe7c8('0x8c');var _0x48d4e8='';var _0x36e68a='';var _0x597bca='';var _0x2b34b2='';var _0x3645f2=_0x3963dd[_0xe7c8('0x78')];if(_0x195263===_0xe7c8('0x7c')){if('undefined'!=typeof _0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')][_0xe7c8('0x7f')]){var _0x2a4b89=_0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')][_0xe7c8('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xe7c8('0x8d')](_0x2a4b89)){_0x48d4e8=path[_0xe7c8('0x4d')](_0xe7c8('0x8e'),_0xb9898c,_0x3d5265[0x0],_0x2a4b89);}else{_0x48d4e8=_0x2a4b89;}}else{logger['info'](_0xe7c8('0x8f'));}if('undefined'!=typeof _0x3963dd[_0xe7c8('0x7a')]['views'][_0xe7c8('0x80')]){var _0x182ac2=_0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')][_0xe7c8('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xe7c8('0x8d')](_0x182ac2)){_0x36e68a=path[_0xe7c8('0x4d')]('plugins',_0xb9898c,_0x3d5265[0x0],_0x182ac2);}else{_0x36e68a=_0x182ac2;}}else{logger['info'](_0xe7c8('0x90'));}}else if(_0x195263===_0xe7c8('0x82')){_0x597bca=_0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x83')];_0x2b34b2=_0x3963dd['parameters'][_0xe7c8('0x85')];if(_0xe7c8('0x75')!=typeof _0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')]){if(_0xe7c8('0x75')!=typeof _0x3963dd['parameters'][_0xe7c8('0x7d')]['admin']){var _0x2a4b89=_0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')][_0xe7c8('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xe7c8('0x8d')](_0x2a4b89)){_0x48d4e8=path[_0xe7c8('0x4d')](_0xe7c8('0x8e'),_0xb9898c,_0x3d5265[0x0],_0x2a4b89);}else{_0x48d4e8=_0x2a4b89;}}if(_0xe7c8('0x75')!=typeof _0x3963dd[_0xe7c8('0x7a')][_0xe7c8('0x7d')]['agent']){var _0x182ac2=_0x3963dd['parameters'][_0xe7c8('0x7d')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xe7c8('0x8d')](_0x182ac2)){_0x36e68a=path[_0xe7c8('0x4d')](_0xe7c8('0x8e'),_0xb9898c,_0x3d5265[0x0],_0x182ac2);}else{_0x36e68a=_0x182ac2;}}}}var _0x185420={'name':_0xe49cfa,'description':_0x1351c6,'path':path[_0xe7c8('0x4d')](_0xb9898c,_0x3d5265[0x0]),'type':_0x195263,'sidebar':_0x2dcc70,'icon':_0x1d1fd2,'adminUrl':_0x48d4e8,'agentUrl':_0x36e68a,'scriptName':_0x597bca,'scriptPath':_0x2b34b2,'version':_0x3645f2};removeReferences(_0x196799,null);return db[_0xe7c8('0x42')][_0xe7c8('0x91')](_0x185420)[_0xe7c8('0x23')](function(_0x25d840){var _0x3df10f={'role':_0x4972be[_0xe7c8('0x92')][_0xe7c8('0x93')],'userProfileId':_0x4972be['body'][_0xe7c8('0x94')]};if(!_0x3df10f)throw new Error(_0xe7c8('0x95'));if(_0x3df10f[_0xe7c8('0x93')]==='user'){var _0x95334a=_0x25d840[_0xe7c8('0x25')]({'plain':!![]});return db[_0xe7c8('0x96')][_0xe7c8('0x4a')]({'where':{'name':_0xe7c8('0x26'),'userProfileId':_0x3df10f[_0xe7c8('0x94')]},'raw':!![]})[_0xe7c8('0x23')](function(_0x2a4840){if(_0x2a4840&&_0x2a4840[_0xe7c8('0x97')]===0x0){return db[_0xe7c8('0x98')][_0xe7c8('0x91')]({'name':_0x95334a[_0xe7c8('0x28')],'resourceId':_0x95334a['id'],'type':_0x2a4840[_0xe7c8('0x28')],'sectionId':_0x2a4840['id']},{})['then'](function(){return _0x25d840;});}else{return _0x25d840;}})['catch'](function(_0x5e806a){logger[_0xe7c8('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e806a);throw _0x5e806a;});}return _0x25d840;})[_0xe7c8('0x23')](respondWithResult(_0x1bf798,null))[_0xe7c8('0x47')](handleError(_0x1bf798,null));}});}catch(_0x43c5b5){_0x1bf798[_0xe7c8('0x19')](0x1f4)['send'](_0x43c5b5);}};function removeReferences(_0x1c4395,_0xade0aa){try{if(_0x1c4395){fs['unlinkSync'](_0x1c4395);logger[_0xe7c8('0x65')]('Zip\x20archive\x20removed');}if(_0xade0aa){rimraf(_0xade0aa,function(){});logger[_0xe7c8('0x65')](_0xe7c8('0x99'));}}catch(_0x3d1b95){logger[_0xe7c8('0x55')](_0x3d1b95);}}exports['update']=function(_0x2c1813,_0x117be9,_0x4030dd){return db[_0xe7c8('0x42')][_0xe7c8('0x4a')]({'where':{'id':_0x2c1813[_0xe7c8('0x48')]['id']}})[_0xe7c8('0x23')](handleEntityNotFound(_0x117be9,null))[_0xe7c8('0x23')](saveUpdates(_0x2c1813[_0xe7c8('0x92')],null))[_0xe7c8('0x23')](respondWithResult(_0x117be9,null))[_0xe7c8('0x47')](handleError(_0x117be9,null));};exports[_0xe7c8('0x9a')]=function(_0x55a411,_0x5740dc,_0x2738db){return db[_0xe7c8('0x42')][_0xe7c8('0x4a')]({'where':{'id':_0x55a411[_0xe7c8('0x48')]['id']}})[_0xe7c8('0x23')](function(_0x215727){if(_0x215727){return _0x215727[_0xe7c8('0x24')]();}})[_0xe7c8('0x23')](function(_0x2ca016){rimraf(path[_0xe7c8('0x4d')](config[_0xe7c8('0x5a')],'server/files/plugins',path[_0xe7c8('0x5b')](_0x2ca016[_0xe7c8('0x4c')])),function(){});return _0x2ca016;})[_0xe7c8('0x23')](handleEntityNotFound(_0x5740dc,null))[_0xe7c8('0x23')](respondWithStatusCode(_0x5740dc,null))['catch'](handleError(_0x5740dc,null));};exports[_0xe7c8('0x9b')]=function(_0x2418a2,_0x57f858,_0x33a16c){return BPromise['resolve']()[_0xe7c8('0x23')](function(){if(!_0x2418a2['query'][_0xe7c8('0x4c')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2418a2[_0xe7c8('0x2d')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3aeb1d=_0x2418a2['query'][_0xe7c8('0x9c')]?_0x2418a2[_0xe7c8('0x2d')][_0xe7c8('0x9c')]+':'+_0x2418a2[_0xe7c8('0x2d')][_0xe7c8('0x9d')]:'http://localhost:'+_0x2418a2[_0xe7c8('0x2d')][_0xe7c8('0x9d')];var _0x16d4ca=_0x2418a2[_0xe7c8('0x2d')][_0xe7c8('0x1e')]?_0x2418a2['query'][_0xe7c8('0x1e')]:!![];var _0x1b19e2=_0x2418a2['query'][_0xe7c8('0x9e')]?_0x2418a2[_0xe7c8('0x2d')][_0xe7c8('0x9e')]:null;var _0x50e0dc={'method':_0x2418a2[_0xe7c8('0x9f')],'uri':util[_0xe7c8('0x4f')](_0xe7c8('0xa0'),_0x3aeb1d,_0x2418a2['query']['path']),'json':_0x16d4ca,'resolveWithFullResponse':!![],'encoding':_0x1b19e2,'qs':_0x2418a2[_0xe7c8('0x2d')]};if(_0x2418a2[_0xe7c8('0xa1')]){_0x50e0dc[_0xe7c8('0xa1')]=_0x2418a2['headers'];if(_0x50e0dc[_0xe7c8('0xa1')][_0xe7c8('0xa2')]){delete _0x50e0dc['headers'][_0xe7c8('0xa2')];}}return rp(_0x50e0dc);})[_0xe7c8('0x23')](function(_0x413608){if(_0x413608){_0x57f858[_0xe7c8('0x1c')](_0x413608[_0xe7c8('0xa1')]);logger[_0xe7c8('0x65')](_0x413608[_0xe7c8('0x92')]);if(_[_0xe7c8('0xa3')](_0x2418a2[_0xe7c8('0x2d')][_0xe7c8('0x4c')],_0xe7c8('0x4b'))&&_0x413608[_0xe7c8('0xa4')]==0x1f4){return _0x57f858['sendStatus'](_0x413608[_0xe7c8('0xa4')]);}else{return _0x57f858['status'](_0x413608[_0xe7c8('0xa4')])[_0xe7c8('0x29')](_0x413608['body']);}}else{return _0x57f858[_0xe7c8('0x18')](0xc8);}})[_0xe7c8('0x47')](handleError(_0x57f858,null));};exports[_0xe7c8('0xa5')]=function(_0x18fa86,_0x3bbafe,_0x5d22ba){return BPromise[_0xe7c8('0xa6')]()['then'](function(){if(!_0x18fa86[_0xe7c8('0x2d')]['path']){throw new Error(_0xe7c8('0xa7'));}if(!_0x18fa86[_0xe7c8('0x2d')][_0xe7c8('0x9d')]){throw new Error(_0xe7c8('0xa8'));}var _0x3ef5ef=_0x18fa86[_0xe7c8('0x2d')][_0xe7c8('0x9c')]?_0x18fa86['query']['hostname']+':'+_0x18fa86[_0xe7c8('0x2d')][_0xe7c8('0x9d')]:_0xe7c8('0xa9')+_0x18fa86[_0xe7c8('0x2d')][_0xe7c8('0x9d')];var _0x66ef3b=_0x18fa86[_0xe7c8('0x2d')][_0xe7c8('0x1e')]?_0x18fa86['query'][_0xe7c8('0x1e')]:!![];var _0x465edc=_0x18fa86[_0xe7c8('0x2d')][_0xe7c8('0x9e')]?_0x18fa86[_0xe7c8('0x2d')][_0xe7c8('0x9e')]:null;var _0x5f0e67={'method':_0x18fa86['method'],'uri':util[_0xe7c8('0x4f')](_0xe7c8('0xa0'),_0x3ef5ef,_0x18fa86['query']['path']),'json':_0x66ef3b,'resolveWithFullResponse':!![],'encoding':_0x465edc,'body':_0x18fa86[_0xe7c8('0x92')]};if(_0x18fa86['headers']){_0x5f0e67[_0xe7c8('0xa1')]=_0x18fa86[_0xe7c8('0xa1')];if(_0x5f0e67[_0xe7c8('0xa1')][_0xe7c8('0xa2')]){delete _0x5f0e67[_0xe7c8('0xa1')][_0xe7c8('0xa2')];}}return rp(_0x5f0e67);})[_0xe7c8('0x23')](function(_0xfdd9b8){if(_0xfdd9b8){_0x3bbafe[_0xe7c8('0x1c')](_0xfdd9b8['headers']);logger['info'](_0xfdd9b8[_0xe7c8('0x92')]);return _0x3bbafe[_0xe7c8('0x19')](_0xfdd9b8[_0xe7c8('0xa4')])[_0xe7c8('0x29')](_0xfdd9b8[_0xe7c8('0x92')]);}else{return _0x3bbafe[_0xe7c8('0x18')](0xc8);}})[_0xe7c8('0x47')](handleError(_0x3bbafe,null));};
\ No newline at end of file
+var _0xe160=['existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','length','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','type','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','html','admin','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','set','endsWith','statusCode','webhookPost','resolve','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','extract-zip','archiver','../../config/logger','api','../../config/utils','localhost','socket.io-emitter','redis','./plugin.socket','register','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','stack','name','send','index','Plugin','model','query','dateStart','dateEnd','keys','filters','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','filter','map','key','VIRTUAL','field','count','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','options','find','download','path','join','root','server/files/plugins','format','%s.zip','createWriteStream','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','basename','attachments/**/*','close'];(function(_0x1d0352,_0xc82186){var _0x4e884f=function(_0x1a6d25){while(--_0x1a6d25){_0x1d0352['push'](_0x1d0352['shift']());}};_0x4e884f(++_0xc82186);}(_0xe160,0xeb));var _0x0e16=function(_0x2fecfd,_0x9f080c){_0x2fecfd=_0x2fecfd-0x0;var _0x330ca0=_0xe160[_0x2fecfd];return _0x330ca0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e16('0x0'));var rimraf=require(_0x0e16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e16('0x2'));var rp=require(_0x0e16('0x3'));var moment=require('moment');var BPromise=require(_0x0e16('0x4'));var Mustache=require(_0x0e16('0x5'));var util=require(_0x0e16('0x6'));var path=require('path');var sox=require(_0x0e16('0x7'));var csv=require(_0x0e16('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e16('0x9'));var squel=require('squel');var crypto=require(_0x0e16('0xa'));var jsforce=require(_0x0e16('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0e16('0x8'));var querystring=require(_0x0e16('0xc'));var Papa=require(_0x0e16('0xd'));var Redis=require('ioredis');var extract=require(_0x0e16('0xe'));var rimraf=require('rimraf');var archiver=require(_0x0e16('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x0e16('0x10'))(_0x0e16('0x11'));var utils=require(_0x0e16('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0e16('0x13'),'port':0x18eb});var socket=require(_0x0e16('0x14'))(new Redis(config[_0x0e16('0x15')]));require(_0x0e16('0x16'))[_0x0e16('0x17')](socket);function respondWithStatusCode(_0x11fc2e,_0x455146){_0x455146=_0x455146||0xcc;return function(_0x1932b1){if(_0x1932b1){return _0x11fc2e[_0x0e16('0x18')](_0x455146);}return _0x11fc2e[_0x0e16('0x19')](_0x455146)[_0x0e16('0x1a')]();};}function respondWithResult(_0x57c93b,_0x5a52a5){_0x5a52a5=_0x5a52a5||0xc8;return function(_0x8b14b7){if(_0x8b14b7){return _0x57c93b[_0x0e16('0x19')](_0x5a52a5)['json'](_0x8b14b7);}};}function respondWithFilteredResult(_0x67bade,_0x3d3ea4){return function(_0x2c7c85){if(_0x2c7c85){var _0x4f309b=_0x2c7c85['count'],_0xeceed8=_0x3d3ea4[_0x0e16('0x1b')],_0x5c992c=_0x3d3ea4[_0x0e16('0x1b')]+_0x3d3ea4['limit'],_0x3c87e4;if(_0x5c992c>=_0x4f309b){_0x5c992c=_0x4f309b;_0x3c87e4=0xc8;}else{_0x3c87e4=0xce;}_0x67bade[_0x0e16('0x19')](_0x3c87e4);return _0x67bade['set'](_0x0e16('0x1c'),_0xeceed8+'-'+_0x5c992c+'/'+_0x4f309b)[_0x0e16('0x1d')](_0x2c7c85);}return null;};}function patchUpdates(_0x45609e){return function(_0xc00ae4){try{jsonpatch[_0x0e16('0x1e')](_0xc00ae4,_0x45609e,!![]);}catch(_0x53585e){return BPromise[_0x0e16('0x1f')](_0x53585e);}return _0xc00ae4[_0x0e16('0x20')]();};}function saveUpdates(_0x8d1829,_0x10b588){return function(_0x5c684c){if(_0x5c684c){return _0x5c684c[_0x0e16('0x21')](_0x8d1829)['then'](function(_0x2d06ad){return _0x2d06ad;});}return null;};}function removeEntity(_0x4ebf38,_0x1031f2){return function(_0x356266){if(_0x356266){return _0x356266[_0x0e16('0x22')]()[_0x0e16('0x23')](function(){var _0x2bf96d=_0x356266[_0x0e16('0x24')]({'plain':!![]});var _0x49aed3=_0x0e16('0x25');return db[_0x0e16('0x26')][_0x0e16('0x22')]({'where':{'type':_0x49aed3,'resourceId':_0x2bf96d['id']}})['then'](function(){return _0x356266;});})['then'](function(){_0x4ebf38[_0x0e16('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37fcbd,_0x1a4b67){return function(_0x227544){if(!_0x227544){_0x37fcbd[_0x0e16('0x18')](0x194);}return _0x227544;};}function handleError(_0x565b16,_0x404c3e){_0x404c3e=_0x404c3e||0x1f4;return function(_0x2c99d3){logger['error'](_0x2c99d3[_0x0e16('0x27')]);if(_0x2c99d3[_0x0e16('0x28')]){delete _0x2c99d3['name'];}_0x565b16[_0x0e16('0x19')](_0x404c3e)[_0x0e16('0x29')](_0x2c99d3);};}exports[_0x0e16('0x2a')]=function(_0x380695,_0x2436b8){var _0xe42cd5={},_0x4003ff={},_0x20ae5a={'count':0x0,'rows':[]};var _0x515e44=db[_0x0e16('0x2b')]['rawAttributes'];_0x4003ff[_0x0e16('0x2c')]=_['keys'](_0x515e44);var _0x32e11b={'dateStart':_0x380695[_0x0e16('0x2d')][_0x0e16('0x2e')],'dateEnd':_0x380695[_0x0e16('0x2d')][_0x0e16('0x2f')]};delete _0x380695[_0x0e16('0x2d')][_0x0e16('0x2e')];delete _0x380695['query'][_0x0e16('0x2f')];_0x4003ff[_0x0e16('0x2d')]=_[_0x0e16('0x30')](_0x380695[_0x0e16('0x2d')]);_0x4003ff[_0x0e16('0x31')]=_['intersection'](_0x4003ff[_0x0e16('0x2c')],_0x4003ff[_0x0e16('0x2d')]);_0xe42cd5['attributes']=_['intersection'](_0x4003ff[_0x0e16('0x2c')],qs[_0x0e16('0x32')](_0x380695['query']['fields']));_0xe42cd5['attributes']=_0xe42cd5['attributes']['length']?_0xe42cd5[_0x0e16('0x33')]:_0x4003ff['model'];if(!_0x380695['query'][_0x0e16('0x34')](_0x0e16('0x35'))){_0xe42cd5[_0x0e16('0x36')]=qs[_0x0e16('0x36')](_0x380695['query'][_0x0e16('0x36')]);_0xe42cd5[_0x0e16('0x1b')]=qs['offset'](_0x380695[_0x0e16('0x2d')]['offset']);}_0xe42cd5[_0x0e16('0x37')]=qs[_0x0e16('0x38')](_0x380695['query']['sort']);_0xe42cd5[_0x0e16('0x39')]=qs[_0x0e16('0x31')](_[_0x0e16('0x3a')](_0x380695[_0x0e16('0x2d')],_0x4003ff[_0x0e16('0x31')]));if(_0x32e11b[_0x0e16('0x2e')]){if(_0x32e11b[_0x0e16('0x2f')]){_0x32e11b[_0x0e16('0x2f')]=moment(_0x32e11b[_0x0e16('0x2f')])[_0x0e16('0x3b')](0x1,'day');}else{_0x32e11b['dateEnd']=moment(_0x32e11b['dateStart'])[_0x0e16('0x3b')](0x1,_0x0e16('0x3c'));}_[_0x0e16('0x3d')](_0xe42cd5[_0x0e16('0x39')],{'createdAt':{'$gte':_0x32e11b[_0x0e16('0x2e')],'$lte':_0x32e11b['dateEnd']}});}if(_0x380695['query'][_0x0e16('0x3e')]){_0xe42cd5[_0x0e16('0x39')]=_['merge'](_0xe42cd5[_0x0e16('0x39')],{'$or':_[_0x0e16('0x3f')](_0x515e44,function(_0x23b9ca){if(_0x23b9ca['type'][_0x0e16('0x40')]!==_0x0e16('0x41')){var _0x293edb={};_0x293edb[_0x23b9ca[_0x0e16('0x42')]]={'$like':'%'+_0x380695[_0x0e16('0x2d')][_0x0e16('0x3e')]+'%'};return _0x293edb;}})});}_0xe42cd5=_[_0x0e16('0x3d')]({},_0xe42cd5,_0x380695['options']);var _0xeca9ab={'where':_0xe42cd5[_0x0e16('0x39')]};return db[_0x0e16('0x2b')][_0x0e16('0x43')](_0xeca9ab)[_0x0e16('0x23')](function(_0x481950){_0x20ae5a[_0x0e16('0x43')]=_0x481950;if(_0x380695[_0x0e16('0x2d')]['includeAll']){_0xe42cd5[_0x0e16('0x44')]=[{'all':!![]}];}return db['Plugin'][_0x0e16('0x45')](_0xe42cd5);})[_0x0e16('0x23')](function(_0x2495e0){_0x20ae5a[_0x0e16('0x46')]=_0x2495e0;return _0x20ae5a;})[_0x0e16('0x23')](respondWithFilteredResult(_0x2436b8,_0xe42cd5))[_0x0e16('0x47')](handleError(_0x2436b8,null));};exports[_0x0e16('0x48')]=function(_0x292d9d,_0x98985b){var _0xfb7595={'raw':!![],'where':{'id':_0x292d9d[_0x0e16('0x49')]['id']}},_0xf43028={};_0xf43028[_0x0e16('0x2c')]=_[_0x0e16('0x30')](db[_0x0e16('0x2b')][_0x0e16('0x4a')]);_0xf43028[_0x0e16('0x2d')]=_[_0x0e16('0x30')](_0x292d9d[_0x0e16('0x2d')]);_0xf43028[_0x0e16('0x31')]=_[_0x0e16('0x4b')](_0xf43028['model'],_0xf43028['query']);_0xfb7595[_0x0e16('0x33')]=_[_0x0e16('0x4b')](_0xf43028[_0x0e16('0x2c')],qs[_0x0e16('0x32')](_0x292d9d[_0x0e16('0x2d')][_0x0e16('0x32')]));_0xfb7595['attributes']=_0xfb7595[_0x0e16('0x33')]['length']?_0xfb7595[_0x0e16('0x33')]:_0xf43028['model'];if(_0x292d9d['query'][_0x0e16('0x4c')]){_0xfb7595[_0x0e16('0x44')]=[{'all':!![]}];}_0xfb7595=_[_0x0e16('0x3d')]({},_0xfb7595,_0x292d9d[_0x0e16('0x4d')]);return db[_0x0e16('0x2b')][_0x0e16('0x4e')](_0xfb7595)[_0x0e16('0x23')](handleEntityNotFound(_0x98985b,null))[_0x0e16('0x23')](respondWithResult(_0x98985b,null))[_0x0e16('0x47')](handleError(_0x98985b,null));};exports[_0x0e16('0x4f')]=function(_0x1184c3,_0x267ad9,_0x18bfd8){return db[_0x0e16('0x2b')][_0x0e16('0x4e')]({'where':{'id':_0x1184c3[_0x0e16('0x49')]['id']},'attributes':[_0x0e16('0x28'),_0x0e16('0x50')],'raw':!![]})[_0x0e16('0x23')](handleEntityNotFound(_0x267ad9,null))['then'](function(_0x4f5f40){if(_0x4f5f40){var _0x7d5fd9=path[_0x0e16('0x51')](config[_0x0e16('0x52')],_0x0e16('0x53'),util[_0x0e16('0x54')](_0x0e16('0x55'),path['basename'](_0x4f5f40['path'])));var _0xec8ec0=fs[_0x0e16('0x56')](_0x7d5fd9);var _0x59012d=archiver('zip',{'zlib':{'level':0x9}});_0x59012d['on']('warning',function(_0x2d7062){if(_0x2d7062['code']==='ENOENT'){logger[_0x0e16('0x57')](_0x2d7062);}else{throw new db[(_0x0e16('0x58'))][(_0x0e16('0x59'))](_0x0e16('0x5a'));}});_0x59012d['on'](_0x0e16('0x57'),function(_0x2280f6){throw new db[(_0x0e16('0x58'))][(_0x0e16('0x59'))](_0x0e16('0x5a'));});_0x59012d[_0x0e16('0x5b')](_0xec8ec0);_0x59012d[_0x0e16('0x5c')](_0x0e16('0x5d'),{'cwd':path[_0x0e16('0x51')](config['root'],_0x0e16('0x53'),path[_0x0e16('0x5e')](_0x4f5f40[_0x0e16('0x50')])),'ignore':[path[_0x0e16('0x51')](path['basename'](_0x4f5f40['path']),_0x0e16('0x5f')),path[_0x0e16('0x51')](path[_0x0e16('0x60')](_0x4f5f40[_0x0e16('0x50')]),_0x0e16('0x61'))],'nodir':!![]})['finalize']();_0xec8ec0['on'](_0x0e16('0x62'),function(){if(!fs[_0x0e16('0x63')](_0x7d5fd9)){throw new db[(_0x0e16('0x58'))][(_0x0e16('0x59'))](_0x0e16('0x64'));}return _0x267ad9[_0x0e16('0x4f')](_0x7d5fd9,util['format']('%s.zip',path[_0x0e16('0x60')](_0x4f5f40['path'])),function(_0x2a59b1){if(_0x2a59b1){throw new db[(_0x0e16('0x58'))][(_0x0e16('0x59'))](_0x0e16('0x65'));}fs[_0x0e16('0x66')](_0x7d5fd9);logger[_0x0e16('0x67')](_0x0e16('0x68'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0x0e16('0x47')](handleError(_0x267ad9,null));};exports[_0x0e16('0x69')]=function(_0x49dc77,_0x43de67,_0x16f3be){var _0x100975=path[_0x0e16('0x60')](_0x49dc77[_0x0e16('0x6a')][_0x0e16('0x6b')],path[_0x0e16('0x6c')](_0x49dc77['file'][_0x0e16('0x6b')]));var _0x3df591=path[_0x0e16('0x51')](config[_0x0e16('0x52')],_0x0e16('0x53'),_0x49dc77[_0x0e16('0x6a')][_0x0e16('0x6b')]);var _0x54bca7=path[_0x0e16('0x51')](config[_0x0e16('0x52')],_0x0e16('0x53'),_0x100975);logger[_0x0e16('0x67')](_0x0e16('0x6d'),_0x3df591);logger[_0x0e16('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x54bca7);try{fs['chmodSync'](_0x3df591,parseInt(_0x0e16('0x6e'),0x8));extract(_0x3df591,{'dir':_0x54bca7},function(_0x5ab7b0){if(_0x5ab7b0){logger['error'](_0x5ab7b0);handleError(_0x5ab7b0,!![]);};var _0x21925d=fs[_0x0e16('0x6f')](_0x54bca7);if(_0x21925d['length']>0x1){removeReferences(_0x3df591,_0x54bca7);logger[_0x0e16('0x57')](_0x0e16('0x70'));return _0x16f3be(new Error(_0x0e16('0x70')));}var _0x44fbc0=fs['lstatSync'](path['join'](_0x54bca7,_0x21925d[0x0]));if(_0x44fbc0[_0x0e16('0x71')]()){removeReferences(_0x3df591,_0x54bca7);logger[_0x0e16('0x57')](_0x0e16('0x70'));return _0x16f3be(new Error(_0x0e16('0x70')));}if(_0x44fbc0['isDirectory']()){var _0x3a018b=fs[_0x0e16('0x6f')](path[_0x0e16('0x51')](_0x54bca7,_0x21925d[0x0]));if(_0x3a018b[_0x0e16('0x72')]===0x0){removeReferences(_0x3df591,_0x54bca7);logger[_0x0e16('0x57')](_0x0e16('0x70'));return _0x16f3be(new Error('Invalid\x20plugin\x20structure'));}var _0x580c23=_0x3a018b[_0x0e16('0x73')](function(_0x35d038){return _0x35d038===_0x0e16('0x74');});if(!_0x580c23){return _0x16f3be(new Error(_0x0e16('0x75')));}var _0x46ff7c=fs[_0x0e16('0x76')](path[_0x0e16('0x51')](_0x54bca7,_0x21925d[0x0],_0x0e16('0x74')));var _0xd2e5b2=JSON[_0x0e16('0x77')](_0x46ff7c);if(_0x0e16('0x78')==typeof _0xd2e5b2[_0x0e16('0x28')]){return _0x16f3be(new Error(_0x0e16('0x79')));}if('undefined'==typeof _0xd2e5b2[_0x0e16('0x7a')]){return _0x16f3be(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x0e16('0x78')==typeof _0xd2e5b2[_0x0e16('0x7b')]){return _0x16f3be(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x0e16('0x78')==typeof _0xd2e5b2[_0x0e16('0x7c')]){return _0x16f3be(new Error(_0x0e16('0x7d')));}if(_0xd2e5b2[_0x0e16('0x7a')]==='html'){if(_0x0e16('0x78')==typeof _0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x7e')]){return _0x16f3be(new Error(_0x0e16('0x7f')));}if(_0x0e16('0x78')==typeof _0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x7e')]['admin']&&_0x0e16('0x78')==typeof _0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x7e')]['agent']){return _0x16f3be(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0xd2e5b2[_0x0e16('0x7a')]==='script'){if(_0x0e16('0x78')==typeof _0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x80')]){return _0x16f3be(new Error(_0x0e16('0x81')));}if('undefined'==typeof _0xd2e5b2[_0x0e16('0x7c')]['scriptPath']){return _0x16f3be(new Error(_0x0e16('0x82')));}}else{return _0x16f3be(new Error(_0x0e16('0x83')));}var _0x55b676=_0xd2e5b2[_0x0e16('0x28')];var _0x3efda3=_0xd2e5b2['description'];var _0x54db5c=_0xd2e5b2['type'];var _0x20ecf8=_0xd2e5b2['sidebar']?_0xd2e5b2[_0x0e16('0x84')]:_0x0e16('0x85');var _0xc54acb=_0xd2e5b2[_0x0e16('0x86')]?_0xd2e5b2[_0x0e16('0x86')]:_0x0e16('0x87');var _0x55e618='';var _0x18db86='';var _0x34da13='';var _0x2fcc97='';var _0x3a25af=_0xd2e5b2[_0x0e16('0x7b')];if(_0x54db5c===_0x0e16('0x88')){if('undefined'!=typeof _0xd2e5b2['parameters']['views'][_0x0e16('0x89')]){var _0x401ad5=_0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x7e')][_0x0e16('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x0e16('0x8a')](_0x401ad5)){_0x55e618=path['join'](_0x0e16('0x8b'),_0x100975,_0x21925d[0x0],_0x401ad5);}else{_0x55e618=_0x401ad5;}}else{logger[_0x0e16('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x0e16('0x78')!=typeof _0xd2e5b2['parameters'][_0x0e16('0x7e')]['agent']){var _0x469650=_0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x7e')][_0x0e16('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x0e16('0x8a')](_0x469650)){_0x18db86=path['join'](_0x0e16('0x8b'),_0x100975,_0x21925d[0x0],_0x469650);}else{_0x18db86=_0x469650;}}else{logger[_0x0e16('0x67')](_0x0e16('0x8d'));}}else if(_0x54db5c==='script'){_0x34da13=_0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x80')];_0x2fcc97=_0xd2e5b2[_0x0e16('0x7c')]['scriptPath'];if('undefined'!=typeof _0xd2e5b2['parameters']['views']){if(_0x0e16('0x78')!=typeof _0xd2e5b2[_0x0e16('0x7c')]['views']['admin']){var _0x401ad5=_0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x7e')][_0x0e16('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x0e16('0x8a')](_0x401ad5)){_0x55e618=path[_0x0e16('0x51')](_0x0e16('0x8b'),_0x100975,_0x21925d[0x0],_0x401ad5);}else{_0x55e618=_0x401ad5;}}if(_0x0e16('0x78')!=typeof _0xd2e5b2[_0x0e16('0x7c')][_0x0e16('0x7e')][_0x0e16('0x8c')]){var _0x469650=_0xd2e5b2['parameters'][_0x0e16('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x0e16('0x8a')](_0x469650)){_0x18db86=path['join'](_0x0e16('0x8b'),_0x100975,_0x21925d[0x0],_0x469650);}else{_0x18db86=_0x469650;}}}}var _0x2f08b4={'name':_0x55b676,'description':_0x3efda3,'path':path[_0x0e16('0x51')](_0x100975,_0x21925d[0x0]),'type':_0x54db5c,'sidebar':_0x20ecf8,'icon':_0xc54acb,'adminUrl':_0x55e618,'agentUrl':_0x18db86,'scriptName':_0x34da13,'scriptPath':_0x2fcc97,'version':_0x3a25af};removeReferences(_0x3df591,null);return db['Plugin'][_0x0e16('0x8e')](_0x2f08b4)[_0x0e16('0x23')](function(_0x3b928f){var _0x17126={'role':_0x49dc77[_0x0e16('0x8f')][_0x0e16('0x90')],'userProfileId':_0x49dc77['body'][_0x0e16('0x91')]};if(!_0x17126)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17126['role']===_0x0e16('0x92')){var _0x44f7db=_0x3b928f[_0x0e16('0x24')]({'plain':!![]});return db[_0x0e16('0x93')][_0x0e16('0x4e')]({'where':{'name':_0x0e16('0x25'),'userProfileId':_0x17126[_0x0e16('0x91')]},'raw':!![]})[_0x0e16('0x23')](function(_0x3477c1){if(_0x3477c1&&_0x3477c1[_0x0e16('0x94')]===0x0){return db[_0x0e16('0x26')][_0x0e16('0x8e')]({'name':_0x44f7db['name'],'resourceId':_0x44f7db['id'],'type':_0x3477c1[_0x0e16('0x28')],'sectionId':_0x3477c1['id']},{})[_0x0e16('0x23')](function(){return _0x3b928f;});}else{return _0x3b928f;}})['catch'](function(_0x3e6a98){logger['error'](_0x0e16('0x95'),_0x3e6a98);throw _0x3e6a98;});}return _0x3b928f;})[_0x0e16('0x23')](respondWithResult(_0x43de67,null))[_0x0e16('0x47')](handleError(_0x43de67,null));}});}catch(_0x6f6000){_0x43de67[_0x0e16('0x19')](0x1f4)[_0x0e16('0x29')](_0x6f6000);}};function removeReferences(_0x5f1bcc,_0x24b322){try{if(_0x5f1bcc){fs[_0x0e16('0x66')](_0x5f1bcc);logger[_0x0e16('0x67')](_0x0e16('0x96'));}if(_0x24b322){rimraf(_0x24b322,function(){});logger[_0x0e16('0x67')](_0x0e16('0x97'));}}catch(_0x356033){logger[_0x0e16('0x57')](_0x356033);}}exports[_0x0e16('0x21')]=function(_0x19c1c7,_0x4fdce4,_0xd44425){return db[_0x0e16('0x2b')][_0x0e16('0x4e')]({'where':{'id':_0x19c1c7[_0x0e16('0x49')]['id']}})[_0x0e16('0x23')](handleEntityNotFound(_0x4fdce4,null))[_0x0e16('0x23')](saveUpdates(_0x19c1c7[_0x0e16('0x8f')],null))[_0x0e16('0x23')](respondWithResult(_0x4fdce4,null))[_0x0e16('0x47')](handleError(_0x4fdce4,null));};exports['delete']=function(_0xe2577f,_0x345a2c,_0x37a8e7){return db[_0x0e16('0x2b')][_0x0e16('0x4e')]({'where':{'id':_0xe2577f[_0x0e16('0x49')]['id']}})[_0x0e16('0x23')](function(_0x11bc77){if(_0x11bc77){return _0x11bc77['destroy']();}})[_0x0e16('0x23')](function(_0x223018){rimraf(path[_0x0e16('0x51')](config['root'],_0x0e16('0x53'),path[_0x0e16('0x5e')](_0x223018[_0x0e16('0x50')])),function(){});return _0x223018;})[_0x0e16('0x23')](handleEntityNotFound(_0x345a2c,null))[_0x0e16('0x23')](respondWithStatusCode(_0x345a2c,null))['catch'](handleError(_0x345a2c,null));};exports[_0x0e16('0x98')]=function(_0xcc5ff8,_0x59a225,_0x2e25bb){return BPromise['resolve']()[_0x0e16('0x23')](function(){if(!_0xcc5ff8[_0x0e16('0x2d')][_0x0e16('0x50')]){throw new Error(_0x0e16('0x99'));}if(!_0xcc5ff8['query'][_0x0e16('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x48eed6=_0xcc5ff8[_0x0e16('0x2d')][_0x0e16('0x9b')]?_0xcc5ff8['query']['hostname']+':'+_0xcc5ff8['query'][_0x0e16('0x9a')]:_0x0e16('0x9c')+_0xcc5ff8[_0x0e16('0x2d')][_0x0e16('0x9a')];var _0x59cf92=_0xcc5ff8['query'][_0x0e16('0x1d')]?_0xcc5ff8['query'][_0x0e16('0x1d')]:!![];var _0x1dc3f7=_0xcc5ff8[_0x0e16('0x2d')][_0x0e16('0x9d')]?_0xcc5ff8[_0x0e16('0x2d')]['encoding']:null;var _0x595d6e={'method':_0xcc5ff8[_0x0e16('0x9e')],'uri':util[_0x0e16('0x54')](_0x0e16('0x9f'),_0x48eed6,_0xcc5ff8['query'][_0x0e16('0x50')]),'json':_0x59cf92,'resolveWithFullResponse':!![],'encoding':_0x1dc3f7,'qs':_0xcc5ff8[_0x0e16('0x2d')]};if(_0xcc5ff8[_0x0e16('0xa0')]){_0x595d6e[_0x0e16('0xa0')]=_0xcc5ff8['headers'];if(_0x595d6e['headers'][_0x0e16('0xa1')]){delete _0x595d6e[_0x0e16('0xa0')][_0x0e16('0xa1')];}}return rp(_0x595d6e);})[_0x0e16('0x23')](function(_0x4749b2){if(_0x4749b2){_0x59a225[_0x0e16('0xa2')](_0x4749b2['headers']);logger['info'](_0x4749b2['body']);if(_[_0x0e16('0xa3')](_0xcc5ff8['query'][_0x0e16('0x50')],_0x0e16('0x4f'))&&_0x4749b2[_0x0e16('0xa4')]==0x1f4){return _0x59a225[_0x0e16('0x18')](_0x4749b2['statusCode']);}else{return _0x59a225[_0x0e16('0x19')](_0x4749b2[_0x0e16('0xa4')])[_0x0e16('0x29')](_0x4749b2[_0x0e16('0x8f')]);}}else{return _0x59a225[_0x0e16('0x18')](0xc8);}})[_0x0e16('0x47')](handleError(_0x59a225,null));};exports[_0x0e16('0xa5')]=function(_0x53d285,_0x5797e6,_0x312b92){return BPromise[_0x0e16('0xa6')]()['then'](function(){if(!_0x53d285['query'][_0x0e16('0x50')]){throw new Error(_0x0e16('0x99'));}if(!_0x53d285[_0x0e16('0x2d')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4d541f=_0x53d285[_0x0e16('0x2d')][_0x0e16('0x9b')]?_0x53d285[_0x0e16('0x2d')]['hostname']+':'+_0x53d285[_0x0e16('0x2d')][_0x0e16('0x9a')]:_0x0e16('0x9c')+_0x53d285[_0x0e16('0x2d')][_0x0e16('0x9a')];var _0x2abd6a=_0x53d285['query'][_0x0e16('0x1d')]?_0x53d285[_0x0e16('0x2d')][_0x0e16('0x1d')]:!![];var _0x41b67f=_0x53d285[_0x0e16('0x2d')][_0x0e16('0x9d')]?_0x53d285[_0x0e16('0x2d')][_0x0e16('0x9d')]:null;var _0x263305={'method':_0x53d285[_0x0e16('0x9e')],'uri':util['format'](_0x0e16('0x9f'),_0x4d541f,_0x53d285[_0x0e16('0x2d')][_0x0e16('0x50')]),'json':_0x2abd6a,'resolveWithFullResponse':!![],'encoding':_0x41b67f,'body':_0x53d285[_0x0e16('0x8f')]};if(_0x53d285[_0x0e16('0xa0')]){_0x263305[_0x0e16('0xa0')]=_0x53d285[_0x0e16('0xa0')];if(_0x263305[_0x0e16('0xa0')][_0x0e16('0xa1')]){delete _0x263305[_0x0e16('0xa0')][_0x0e16('0xa1')];}}return rp(_0x263305);})[_0x0e16('0x23')](function(_0x209217){if(_0x209217){_0x5797e6[_0x0e16('0xa2')](_0x209217[_0x0e16('0xa0')]);logger['info'](_0x209217[_0x0e16('0x8f')]);return _0x5797e6[_0x0e16('0x19')](_0x209217[_0x0e16('0xa4')])[_0x0e16('0x29')](_0x209217['body']);}else{return _0x5797e6[_0x0e16('0x18')](0xc8);}})[_0x0e16('0x47')](handleError(_0x5797e6,null));};
\ No newline at end of file
index d0a65d6..5b24980 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1e5f97,_0x12708d){var _0x2350c2=function(_0x9279fb){while(--_0x9279fb){_0x1e5f97['push'](_0x1e5f97['shift']());}};_0x2350c2(++_0x12708d);}(_0x7a54,0x106));var _0x47a5=function(_0x50d90d,_0xd78bf8){_0x50d90d=_0x50d90d-0x0;var _0x55d6b6=_0x7a54[_0x50d90d];return _0x55d6b6;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var Plugin=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){PluginEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);PluginEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x47a5('0x7')]=PluginEvents;
\ No newline at end of file
+var _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x4818f3,_0x82b98c){var _0x20448e=function(_0x589ef0){while(--_0x589ef0){_0x4818f3['push'](_0x4818f3['shift']());}};_0x20448e(++_0x82b98c);}(_0xb10b,0x12a));var _0xbb10=function(_0x4be57c,_0x151881){_0x4be57c=_0x4be57c-0x0;var _0x5901da=_0xb10b[_0x4be57c];return _0x5901da;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index 1498a8d..015fc48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1843=['api','bluebird','request-promise','./plugin.attributes','exports','define','Plugin','lodash','util'];(function(_0x463b9a,_0x2a9eba){var _0x5f5186=function(_0xb1f6cc){while(--_0xb1f6cc){_0x463b9a['push'](_0x463b9a['shift']());}};_0x5f5186(++_0x2a9eba);}(_0x1843,0x6a));var _0x3184=function(_0x3bc541,_0x52d4ec){_0x3bc541=_0x3bc541-0x0;var _0x1a873d=_0x1843[_0x3bc541];return _0x1a873d;};'use strict';var _=require(_0x3184('0x0'));var util=require(_0x3184('0x1'));var logger=require('../../config/logger')(_0x3184('0x2'));var moment=require('moment');var BPromise=require(_0x3184('0x3'));var rp=require(_0x3184('0x4'));var attributes=require(_0x3184('0x5'));module[_0x3184('0x6')]=function(_0x5e43fb,_0x397b9d){return _0x5e43fb[_0x3184('0x7')](_0x3184('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00e1=['plugins','lodash','util','../../config/logger','api','moment','request-promise','./plugin.attributes','exports','define'];(function(_0x3909a2,_0x4ec367){var _0x522bde=function(_0x290f71){while(--_0x290f71){_0x3909a2['push'](_0x3909a2['shift']());}};_0x522bde(++_0x4ec367);}(_0x00e1,0x19b));var _0x100e=function(_0x5ad4c7,_0x19c419){_0x5ad4c7=_0x5ad4c7-0x0;var _0x57f3e7=_0x00e1[_0x5ad4c7];return _0x57f3e7;};'use strict';var _=require(_0x100e('0x0'));var util=require(_0x100e('0x1'));var logger=require(_0x100e('0x2'))(_0x100e('0x3'));var moment=require(_0x100e('0x4'));var BPromise=require('bluebird');var rp=require(_0x100e('0x5'));var attributes=require(_0x100e('0x6'));module[_0x100e('0x7')]=function(_0x5847ca,_0x4a4baf){return _0x5847ca[_0x100e('0x8')]('Plugin',attributes,{'tableName':_0x100e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4524ef..67110f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06eb=['http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreatePlugin','Plugin','create','body','options','raw','info','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x485507,_0x9ab47f){var _0x1f79e7=function(_0x2670c9){while(--_0x2670c9){_0x485507['push'](_0x485507['shift']());}};_0x1f79e7(++_0x9ab47f);}(_0x06eb,0x1c8));var _0xb06e=function(_0x46be29,_0x7adaa4){_0x46be29=_0x46be29-0x0;var _0x78c78e=_0x06eb[_0x46be29];return _0x78c78e;};'use strict';var _=require(_0xb06e('0x0'));var util=require(_0xb06e('0x1'));var moment=require(_0xb06e('0x2'));var BPromise=require(_0xb06e('0x3'));var rs=require(_0xb06e('0x4'));var fs=require('fs');var Redis=require(_0xb06e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb06e('0x6'));var logger=require(_0xb06e('0x7'))(_0xb06e('0x8'));var config=require(_0xb06e('0x9'));var jayson=require(_0xb06e('0xa'));var client=jayson[_0xb06e('0xb')][_0xb06e('0xc')]({'port':0x232a});config[_0xb06e('0xd')]=_[_0xb06e('0xe')](config['redis'],{'host':_0xb06e('0xf'),'port':0x18eb});var socket=require(_0xb06e('0x10'))(new Redis(config[_0xb06e('0xd')]));require(_0xb06e('0x11'))[_0xb06e('0x12')](socket);function respondWithRpcPromise(_0x1626dd,_0x5892a2,_0x555785){return new BPromise(function(_0x4554e5,_0x5428b5){return client[_0xb06e('0x13')](_0x1626dd,_0x555785)['then'](function(_0x224037){logger['info'](_0xb06e('0x14'),_0x5892a2,_0xb06e('0x15'));logger['debug'](_0xb06e('0x16'),_0x5892a2,_0xb06e('0x15'),JSON[_0xb06e('0x17')](_0x224037));if(_0x224037[_0xb06e('0x18')]){if(_0x224037['error'][_0xb06e('0x19')]===0x1f4){logger[_0xb06e('0x18')](_0xb06e('0x14'),_0x5892a2,_0x224037[_0xb06e('0x18')]['message']);return _0x5428b5(_0x224037[_0xb06e('0x18')][_0xb06e('0x1a')]);}logger[_0xb06e('0x18')](_0xb06e('0x14'),_0x5892a2,_0x224037[_0xb06e('0x18')][_0xb06e('0x1a')]);return _0x4554e5(_0x224037[_0xb06e('0x18')][_0xb06e('0x1a')]);}else{logger['info'](_0xb06e('0x14'),_0x5892a2,_0xb06e('0x15'));_0x4554e5(_0x224037['result'][_0xb06e('0x1a')]);}})['catch'](function(_0x56b915){logger[_0xb06e('0x18')](_0xb06e('0x14'),_0x5892a2,_0x56b915);_0x5428b5(_0x56b915);});});}exports[_0xb06e('0x1b')]=function(_0x2fe321){var _0x22fd36=this;return new Promise(function(_0x1bf850,_0x27723d){return db[_0xb06e('0x1c')][_0xb06e('0x1d')](_0x2fe321[_0xb06e('0x1e')],{'raw':_0x2fe321['options']?_0x2fe321[_0xb06e('0x1f')][_0xb06e('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x4aa8e7){logger[_0xb06e('0x21')](_0xb06e('0x1b'),_0x2fe321);logger[_0xb06e('0x22')](_0xb06e('0x1b'),_0x2fe321,JSON[_0xb06e('0x17')](_0x4aa8e7));_0x1bf850(_0x4aa8e7);})[_0xb06e('0x23')](function(_0xdb4161){logger[_0xb06e('0x18')](_0xb06e('0x1b'),_0xdb4161[_0xb06e('0x1a')],_0x2fe321);_0x27723d(_0x22fd36[_0xb06e('0x18')](0x1f4,_0xdb4161[_0xb06e('0x1a')]));});});};
\ No newline at end of file
+var _0x25d8=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','Plugin','body','options','raw','then','lodash','moment','bluebird','../../mysqldb'];(function(_0x468d65,_0xe5583f){var _0x53d71b=function(_0x2ba953){while(--_0x2ba953){_0x468d65['push'](_0x468d65['shift']());}};_0x53d71b(++_0xe5583f);}(_0x25d8,0x113));var _0x825d=function(_0x13df9a,_0x70b907){_0x13df9a=_0x13df9a-0x0;var _0x594349=_0x25d8[_0x13df9a];return _0x594349;};'use strict';var _=require(_0x825d('0x0'));var util=require('util');var moment=require(_0x825d('0x1'));var BPromise=require(_0x825d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x825d('0x3'))['db'];var utils=require(_0x825d('0x4'));var logger=require(_0x825d('0x5'))('rpc');var config=require(_0x825d('0x6'));var jayson=require(_0x825d('0x7'));var client=jayson['client'][_0x825d('0x8')]({'port':0x232a});config['redis']=_[_0x825d('0x9')](config[_0x825d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x825d('0xb'))(new Redis(config[_0x825d('0xa')]));require(_0x825d('0xc'))[_0x825d('0xd')](socket);function respondWithRpcPromise(_0x72df5f,_0x514afc,_0x38b571){return new BPromise(function(_0x437156,_0xc91eaa){return client[_0x825d('0xe')](_0x72df5f,_0x38b571)['then'](function(_0x3e917c){logger[_0x825d('0xf')](_0x825d('0x10'),_0x514afc,_0x825d('0x11'));logger[_0x825d('0x12')](_0x825d('0x13'),_0x514afc,_0x825d('0x11'),JSON[_0x825d('0x14')](_0x3e917c));if(_0x3e917c['error']){if(_0x3e917c[_0x825d('0x15')][_0x825d('0x16')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x514afc,_0x3e917c['error'][_0x825d('0x17')]);return _0xc91eaa(_0x3e917c['error'][_0x825d('0x17')]);}logger['error'](_0x825d('0x10'),_0x514afc,_0x3e917c['error'][_0x825d('0x17')]);return _0x437156(_0x3e917c[_0x825d('0x15')][_0x825d('0x17')]);}else{logger[_0x825d('0xf')](_0x825d('0x10'),_0x514afc,_0x825d('0x11'));_0x437156(_0x3e917c['result']['message']);}})[_0x825d('0x18')](function(_0xe94629){logger[_0x825d('0x15')](_0x825d('0x10'),_0x514afc,_0xe94629);_0xc91eaa(_0xe94629);});});}exports[_0x825d('0x19')]=function(_0x353b71){var _0x339b01=this;return new Promise(function(_0x46b607,_0x43936f){return db[_0x825d('0x1a')]['create'](_0x353b71[_0x825d('0x1b')],{'raw':_0x353b71[_0x825d('0x1c')]?_0x353b71[_0x825d('0x1c')][_0x825d('0x1d')]===undefined?!![]:![]:!![]})[_0x825d('0x1e')](function(_0x174ebd){logger['info'](_0x825d('0x19'),_0x353b71);logger[_0x825d('0x12')]('CreatePlugin',_0x353b71,JSON[_0x825d('0x14')](_0x174ebd));_0x46b607(_0x174ebd);})[_0x825d('0x18')](function(_0x368dd8){logger[_0x825d('0x15')]('CreatePlugin',_0x368dd8['message'],_0x353b71);_0x43936f(_0x339b01[_0x825d('0x15')](0x1f4,_0x368dd8[_0x825d('0x17')]));});});};
\ No newline at end of file
index 5c65c9d..48821ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3586=['save','remove','emit','removeListener','register','length','./plugin.events'];(function(_0x476035,_0x4f1764){var _0xc979ce=function(_0x307546){while(--_0x307546){_0x476035['push'](_0x476035['shift']());}};_0xc979ce(++_0x4f1764);}(_0x3586,0x92));var _0x6358=function(_0x649a3b,_0x2b1cf5){_0x649a3b=_0x649a3b-0x0;var _0x8ec5a5=_0x3586[_0x649a3b];return _0x8ec5a5;};'use strict';var PluginEvents=require(_0x6358('0x0'));var events=[_0x6358('0x1'),_0x6358('0x2'),'update'];function createListener(_0xb6f070,_0x5e56ea){return function(_0x5b3487){_0x5e56ea[_0x6358('0x3')](_0xb6f070,_0x5b3487);};}function removeListener(_0x58c0ab,_0x7116ea){return function(){PluginEvents[_0x6358('0x4')](_0x58c0ab,_0x7116ea);};}exports[_0x6358('0x5')]=function(_0x470d49){for(var _0x2c73ae=0x0,_0x17b014=events[_0x6358('0x6')];_0x2c73ae<_0x17b014;_0x2c73ae++){var _0x593e38=events[_0x2c73ae];var _0x5a76fe=createListener('plugin:'+_0x593e38,_0x470d49);PluginEvents['on'](_0x593e38,_0x5a76fe);}};
\ No newline at end of file
+var _0x2074=['save','remove','removeListener','register','length','plugin:','./plugin.events'];(function(_0x28b95f,_0x19a5fa){var _0x2a1bf4=function(_0x581a58){while(--_0x581a58){_0x28b95f['push'](_0x28b95f['shift']());}};_0x2a1bf4(++_0x19a5fa);}(_0x2074,0xc3));var _0x4207=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x2074[_0x4ae6ef];return _0x3cbb4e;};'use strict';var PluginEvents=require(_0x4207('0x0'));var events=[_0x4207('0x1'),_0x4207('0x2'),'update'];function createListener(_0x20dbae,_0x4e321f){return function(_0x22ecdc){_0x4e321f['emit'](_0x20dbae,_0x22ecdc);};}function removeListener(_0x15f8d0,_0x36d56a){return function(){PluginEvents[_0x4207('0x3')](_0x15f8d0,_0x36d56a);};}exports[_0x4207('0x4')]=function(_0x3649a0){for(var _0x1ee7db=0x0,_0x4b5b3f=events[_0x4207('0x5')];_0x1ee7db<_0x4b5b3f;_0x1ee7db++){var _0xefea89=events[_0x1ee7db];var _0x19ebcd=createListener(_0x4207('0x6')+_0xefea89,_0x3649a0);PluginEvents['on'](_0xefea89,_0x19ebcd);}};
\ No newline at end of file
index 40435ff..849dc87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x41c223,_0x26ff92){var _0x345695=function(_0x3b0b10){while(--_0x3b0b10){_0x41c223['push'](_0x41c223['shift']());}};_0x345695(++_0x26ff92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x51ce18,_0x9f8388){var _0x58596e=function(_0x245e9a){while(--_0x245e9a){_0x51ce18['push'](_0x51ce18['shift']());}};_0x58596e(++_0x9f8388);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
index cdc3106..c3d86ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27bd=['script','join','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','path','child_process','sendStatus','status','error','name','send','info','list','then','reject','express','motion2','length','show','params','catch','create','body'];(function(_0x2afd9c,_0x5c5211){var _0x2b033d=function(_0x3d7346){while(--_0x3d7346){_0x2afd9c['push'](_0x2afd9c['shift']());}};_0x2b033d(++_0x5c5211);}(_0x27bd,0x11e));var _0xd27b=function(_0x3fb205,_0x380c2a){_0x3fb205=_0x3fb205-0x0;var _0x249f08=_0x27bd[_0x3fb205];return _0x249f08;};'use strict';var _=require(_0xd27b('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('api');var path=require(_0xd27b('0x1'));var exec=require(_0xd27b('0x2'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0x19386d,_0xd187d4){return function(_0x54aa8a){if(!_0x54aa8a){_0x19386d[_0xd27b('0x3')](0x194);;}return _0x54aa8a;};}function respondWithResult(_0x1f5e4c,_0x5e12e1){_0x5e12e1=_0x5e12e1||0xc8;return function(_0x52f18f){if(_0x52f18f){return _0x1f5e4c[_0xd27b('0x4')](_0x5e12e1)['json'](_0x52f18f);}return null;};}function handleError(_0x43bd3a,_0x4e7fdc){_0x4e7fdc=_0x4e7fdc||0x1f4;return function(_0x4bd917){logger[_0xd27b('0x5')](_0x4bd917['stack']);if(_0x4bd917[_0xd27b('0x6')]){delete _0x4bd917[_0xd27b('0x6')];}_0x43bd3a[_0xd27b('0x4')](_0x4e7fdc)[_0xd27b('0x7')](_0x4bd917);};}function execChildProcess(){return new BPromise(function(_0x3ef96f,_0x383769){exec('npm\x20install',function(_0x183efd,_0x283f2f,_0x464cb6){logger[_0xd27b('0x8')](_0x283f2f);logger['info'](_0x464cb6);if(_0x183efd){logger[_0xd27b('0x5')](_0x183efd);return _0x383769(_0x183efd);}return _0x3ef96f(_0x283f2f);});});}exports['index']=function(_0xb0bad5,_0x26f494){return pm2[_0xd27b('0x9')]()[_0xd27b('0xa')](function(_0x4ee6d9){if(_0x4ee6d9){var _0x16acd9=_[_0xd27b('0xb')](_0x4ee6d9,function(_0x268a97){return _0x268a97[_0xd27b('0x6')]===_0xd27b('0xc')||_0x268a97[_0xd27b('0x6')]===_0xd27b('0xd');});return{'rows':_0x16acd9,'count':_0x16acd9[_0xd27b('0xe')]};}return null;})[_0xd27b('0xa')](respondWithResult(_0x26f494,null))['catch'](handleError(_0x26f494,null));};exports[_0xd27b('0xf')]=function(_0x3a6944,_0x43fc06){return pm2['describe'](_0x3a6944[_0xd27b('0x10')]['id'])[_0xd27b('0xa')](respondWithResult(_0x43fc06,null))[_0xd27b('0xa')](handleEntityNotFound(_0x43fc06,null))[_0xd27b('0x11')](handleError(_0x43fc06,null));};exports[_0xd27b('0x12')]=function(_0x23b741,_0x8dd41b){if(_0x23b741[_0xd27b('0x13')][_0xd27b('0x6')]&&_0x23b741['body'][_0xd27b('0x14')]){var _0x3eacc5=path[_0xd27b('0x15')](__dirname,'../../files/plugins',_0x23b741['body'][_0xd27b('0x14')]);var _0x33dbe1=process[_0xd27b('0x16')]();process[_0xd27b('0x17')](path[_0xd27b('0x18')](_0x3eacc5));return execChildProcess()[_0xd27b('0xa')](function(_0x245da5){process[_0xd27b('0x17')](_0x33dbe1);return pm2[_0xd27b('0x19')]({'name':_0x23b741[_0xd27b('0x13')]['name'],'script':_0x3eacc5});})['then'](function(_0x57f080){pm2[_0xd27b('0x1a')]();return _0x57f080[0x0];})[_0xd27b('0xa')](respondWithResult(_0x8dd41b,0xc9))[_0xd27b('0x11')](handleError(_0x8dd41b,null));}else{return _0x8dd41b['status'](0x1f4)[_0xd27b('0x7')]({'message':_0xd27b('0x1b')});}};exports[_0xd27b('0x1c')]=function(_0x54f9dc,_0x21dcb1){if(_0x54f9dc['body']['id']){delete _0x54f9dc[_0xd27b('0x13')]['id'];}var _0x4b169f={'online':_0xd27b('0x1d'),'stopped':'stop'};if(_0x4b169f['hasOwnProperty'](_0x54f9dc['body']['status'])){return pm2[_0x4b169f[_0x54f9dc[_0xd27b('0x13')]['status']]](_0x54f9dc['params']['id'])[_0xd27b('0xa')](respondWithResult(_0x21dcb1,0xc8))[_0xd27b('0x11')](handleError(_0x21dcb1,null));}else{return _0x21dcb1['status'](0x1f4)[_0xd27b('0x7')]({'message':_0xd27b('0x1e')});}};exports[_0xd27b('0x1f')]=function(_0x14dd49,_0x5db95e){if(_0x14dd49['body']['id']){delete _0x14dd49['body']['id'];}if(_0x14dd49['params']['id']){return pm2[_0xd27b('0x20')](_0x14dd49['params']['id'])[_0xd27b('0xa')](function(_0x48f3b4){pm2[_0xd27b('0x1a')]();return _0x48f3b4[0x0];})[_0xd27b('0xa')](respondWithResult(_0x5db95e,null))['catch'](handleError(_0x5db95e,null));}else{return _0x5db95e['status'](0x1f4)['send']({'message':_0xd27b('0x21')});}};
\ No newline at end of file
+var _0xf759=['catch','show','describe','params','body','script','join','../../files/plugins','chdir','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','status','send','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','json','error','stack','name','npm\x20install','info','index','list','then','reject','express','length'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xf759,0x154));var _0x9f75=function(_0x45a79a,_0x43636b){_0x45a79a=_0x45a79a-0x0;var _0x537143=_0xf759[_0x45a79a];return _0x537143;};'use strict';var _=require(_0x9f75('0x0'));var pm2=require(_0x9f75('0x1'));var logger=require(_0x9f75('0x2'))(_0x9f75('0x3'));var path=require(_0x9f75('0x4'));var exec=require(_0x9f75('0x5'))[_0x9f75('0x6')];var BPromise=require(_0x9f75('0x7'));function handleEntityNotFound(_0x3692df,_0x2a5404){return function(_0x2fb1b0){if(!_0x2fb1b0){_0x3692df['sendStatus'](0x194);;}return _0x2fb1b0;};}function respondWithResult(_0x2f40ae,_0x58d750){_0x58d750=_0x58d750||0xc8;return function(_0x2b91b0){if(_0x2b91b0){return _0x2f40ae['status'](_0x58d750)[_0x9f75('0x8')](_0x2b91b0);}return null;};}function handleError(_0x23f356,_0x23c317){_0x23c317=_0x23c317||0x1f4;return function(_0x4dad03){logger[_0x9f75('0x9')](_0x4dad03[_0x9f75('0xa')]);if(_0x4dad03[_0x9f75('0xb')]){delete _0x4dad03['name'];}_0x23f356['status'](_0x23c317)['send'](_0x4dad03);};}function execChildProcess(){return new BPromise(function(_0x137104,_0x4a483b){exec(_0x9f75('0xc'),function(_0x2d0572,_0x736ff0,_0x2c7043){logger[_0x9f75('0xd')](_0x736ff0);logger[_0x9f75('0xd')](_0x2c7043);if(_0x2d0572){logger['error'](_0x2d0572);return _0x4a483b(_0x2d0572);}return _0x137104(_0x736ff0);});});}exports[_0x9f75('0xe')]=function(_0x3928e4,_0x3e3967){return pm2[_0x9f75('0xf')]()[_0x9f75('0x10')](function(_0x4e9e5b){if(_0x4e9e5b){var _0x422b03=_[_0x9f75('0x11')](_0x4e9e5b,function(_0x37c2d8){return _0x37c2d8[_0x9f75('0xb')]===_0x9f75('0x12')||_0x37c2d8[_0x9f75('0xb')]==='motion2';});return{'rows':_0x422b03,'count':_0x422b03[_0x9f75('0x13')]};}return null;})[_0x9f75('0x10')](respondWithResult(_0x3e3967,null))[_0x9f75('0x14')](handleError(_0x3e3967,null));};exports[_0x9f75('0x15')]=function(_0x505bbf,_0x55be04){return pm2[_0x9f75('0x16')](_0x505bbf[_0x9f75('0x17')]['id'])[_0x9f75('0x10')](respondWithResult(_0x55be04,null))[_0x9f75('0x10')](handleEntityNotFound(_0x55be04,null))[_0x9f75('0x14')](handleError(_0x55be04,null));};exports['create']=function(_0x2b4018,_0x2a1db7){if(_0x2b4018['body'][_0x9f75('0xb')]&&_0x2b4018[_0x9f75('0x18')][_0x9f75('0x19')]){var _0x2b287d=path[_0x9f75('0x1a')](__dirname,_0x9f75('0x1b'),_0x2b4018[_0x9f75('0x18')][_0x9f75('0x19')]);var _0x1542fa=process['cwd']();process[_0x9f75('0x1c')](path['dirname'](_0x2b287d));return execChildProcess()['then'](function(_0x3d5aae){process[_0x9f75('0x1c')](_0x1542fa);return pm2[_0x9f75('0x1d')]({'name':_0x2b4018[_0x9f75('0x18')]['name'],'script':_0x2b287d});})[_0x9f75('0x10')](function(_0x13770d){pm2['dump']();return _0x13770d[0x0];})[_0x9f75('0x10')](respondWithResult(_0x2a1db7,0xc9))['catch'](handleError(_0x2a1db7,null));}else{return _0x2a1db7['status'](0x1f4)['send']({'message':_0x9f75('0x1e')});}};exports[_0x9f75('0x1f')]=function(_0x28a4c8,_0x32cd7e){if(_0x28a4c8['body']['id']){delete _0x28a4c8[_0x9f75('0x18')]['id'];}var _0x5ad92e={'online':_0x9f75('0x20'),'stopped':_0x9f75('0x21')};if(_0x5ad92e[_0x9f75('0x22')](_0x28a4c8[_0x9f75('0x18')][_0x9f75('0x23')])){return pm2[_0x5ad92e[_0x28a4c8['body']['status']]](_0x28a4c8[_0x9f75('0x17')]['id'])[_0x9f75('0x10')](respondWithResult(_0x32cd7e,0xc8))[_0x9f75('0x14')](handleError(_0x32cd7e,null));}else{return _0x32cd7e[_0x9f75('0x23')](0x1f4)[_0x9f75('0x24')]({'message':_0x9f75('0x25')});}};exports[_0x9f75('0x26')]=function(_0x451379,_0x1b84f4){if(_0x451379['body']['id']){delete _0x451379['body']['id'];}if(_0x451379[_0x9f75('0x17')]['id']){return pm2[_0x9f75('0x27')](_0x451379[_0x9f75('0x17')]['id'])[_0x9f75('0x10')](function(_0x3bd34f){pm2['dump']();return _0x3bd34f[0x0];})[_0x9f75('0x10')](respondWithResult(_0x1b84f4,null))[_0x9f75('0x14')](handleError(_0x1b84f4,null));}else{return _0x1b84f4[_0x9f75('0x23')](0x1f4)[_0x9f75('0x24')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index e2b0e92..37e04a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e69=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x56d006,_0x5b5aff){var _0x3a4dc5=function(_0x7ae17b){while(--_0x7ae17b){_0x56d006['push'](_0x56d006['shift']());}};_0x3a4dc5(++_0x5b5aff);}(_0x9e69,0x150));var _0x99e6=function(_0x597a04,_0x447866){_0x597a04=_0x597a04-0x0;var _0x3a85c6=_0x9e69[_0x597a04];return _0x3a85c6;};'use strict';var multer=require('multer');var util=require(_0x99e6('0x0'));var path=require(_0x99e6('0x1'));var timeout=require(_0x99e6('0x2'));var express=require(_0x99e6('0x3'));var router=express['Router']();var auth=require(_0x99e6('0x4'));var interaction=require(_0x99e6('0x5'));var config=require('../../config/environment');module[_0x99e6('0x6')]=router;
\ No newline at end of file
+var _0x7b84=['../../config/environment','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7b84,0x17c));var _0x47b8=function(_0x12952f,_0x3b957d){_0x12952f=_0x12952f-0x0;var _0x11b8a5=_0x7b84[_0x12952f];return _0x11b8a5;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var auth=require(_0x47b8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47b8('0x7'));module[_0x47b8('0x8')]=router;
\ No newline at end of file
index 2694853..8da7be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x027a=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x5c4a77,_0x53a55c){var _0x3b7b29=function(_0x7ded41){while(--_0x7ded41){_0x5c4a77['push'](_0x5c4a77['shift']());}};_0x3b7b29(++_0x53a55c);}(_0x027a,0x109));var _0xa027=function(_0x3e5ccd,_0x348dff){_0x3e5ccd=_0x3e5ccd-0x0;var _0x2eff71=_0x027a[_0x3e5ccd];return _0x2eff71;};'use strict';var Sequelize=require(_0xa027('0x0'));module[_0xa027('0x1')]={'state':{'type':Sequelize[_0xa027('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa027('0x3')]},'scheduledat':{'type':Sequelize[_0xa027('0x4')]},'uniqueid':{'type':Sequelize[_0xa027('0x3')]},'starttime':{'type':Sequelize[_0xa027('0x4')]},'responsetime':{'type':Sequelize[_0xa027('0x4')]},'ringtime':{'type':Sequelize[_0xa027('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa027('0x3')]},'campaigntype':{'type':Sequelize[_0xa027('0x3')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3fc2=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x3fc2,0x7e));var _0x23fc=function(_0x5ab407,_0x38003a){_0x5ab407=_0x5ab407-0x0;var _0x5578d3=_0x3fc2[_0x5ab407];return _0x5578d3;};'use strict';var Sequelize=require(_0x23fc('0x0'));module[_0x23fc('0x1')]={'state':{'type':Sequelize[_0x23fc('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x23fc('0x3')]},'starttime':{'type':Sequelize[_0x23fc('0x4')]},'responsetime':{'type':Sequelize[_0x23fc('0x4')]},'ringtime':{'type':Sequelize[_0x23fc('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x23fc('0x3')]},'campaigntype':{'type':Sequelize[_0x23fc('0x3')]},'membername':{'type':Sequelize[_0x23fc('0x3')]}};
\ No newline at end of file
index 3f67d49..496a332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4de9=['moment','request-promise','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','util','../../config/logger'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x4de9,0xde));var _0x94de=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x4de9[_0x301c34];return _0x1a8c5a;};'use strict';var _=require('lodash');var util=require(_0x94de('0x0'));var logger=require(_0x94de('0x1'))('api');var moment=require(_0x94de('0x2'));var BPromise=require('bluebird');var rp=require(_0x94de('0x3'));var attributes=require(_0x94de('0x4'));module['exports']=function(_0x116003,_0x5e1237){return _0x116003['define'](_0x94de('0x5'),attributes,{'tableName':_0x94de('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9334=['util','../../config/logger','api','moment','bluebird','request-promise','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x17395f,_0x486c9c){var _0x415f5a=function(_0x313749){while(--_0x313749){_0x17395f['push'](_0x17395f['shift']());}};_0x415f5a(++_0x486c9c);}(_0x9334,0x1df));var _0x4933=function(_0x10d3d4,_0x2183e7){_0x10d3d4=_0x10d3d4-0x0;var _0x5c2d8e=_0x9334[_0x10d3d4];return _0x5c2d8e;};'use strict';var _=require(_0x4933('0x0'));var util=require(_0x4933('0x1'));var logger=require(_0x4933('0x2'))(_0x4933('0x3'));var moment=require(_0x4933('0x4'));var BPromise=require(_0x4933('0x5'));var rp=require(_0x4933('0x6'));var attributes=require(_0x4933('0x7'));module[_0x4933('0x8')]=function(_0x2e44c2,_0x17f1cb){return _0x2e44c2[_0x4933('0x9')](_0x4933('0xa'),attributes,{'tableName':_0x4933('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20b0120..7a037a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3d=['moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ReportAgentPreview','create','options','raw','CreateReportAgentPreview','stringify','lodash','util'];(function(_0x3c4062,_0x3767fc){var _0x3f5bf3=function(_0x105e55){while(--_0x105e55){_0x3c4062['push'](_0x3c4062['shift']());}};_0x3f5bf3(++_0x3767fc);}(_0xeb3d,0x116));var _0xdeb3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeb3d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdeb3('0x0'));var util=require(_0xdeb3('0x1'));var moment=require(_0xdeb3('0x2'));var BPromise=require(_0xdeb3('0x3'));var rs=require(_0xdeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdeb3('0x5'));var logger=require(_0xdeb3('0x6'))('rpc');var config=require(_0xdeb3('0x7'));var jayson=require(_0xdeb3('0x8'));var client=jayson[_0xdeb3('0x9')][_0xdeb3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5258d0,_0x269670,_0x46c362){return new BPromise(function(_0xecd06a,_0x1d2c2){return client['request'](_0x5258d0,_0x46c362)[_0xdeb3('0xb')](function(_0x4b9572){logger[_0xdeb3('0xc')](_0xdeb3('0xd'),_0x269670,_0xdeb3('0xe'));logger[_0xdeb3('0xf')](_0xdeb3('0x10'),_0x269670,_0xdeb3('0xe'),JSON['stringify'](_0x4b9572));if(_0x4b9572[_0xdeb3('0x11')]){if(_0x4b9572[_0xdeb3('0x11')][_0xdeb3('0x12')]===0x1f4){logger[_0xdeb3('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x269670,_0x4b9572['error'][_0xdeb3('0x13')]);return _0x1d2c2(_0x4b9572[_0xdeb3('0x11')][_0xdeb3('0x13')]);}logger[_0xdeb3('0x11')](_0xdeb3('0xd'),_0x269670,_0x4b9572[_0xdeb3('0x11')][_0xdeb3('0x13')]);return _0xecd06a(_0x4b9572[_0xdeb3('0x11')]['message']);}else{logger['info'](_0xdeb3('0xd'),_0x269670,'request\x20sent');_0xecd06a(_0x4b9572[_0xdeb3('0x14')][_0xdeb3('0x13')]);}})[_0xdeb3('0x15')](function(_0x1329ce){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x269670,_0x1329ce);_0x1d2c2(_0x1329ce);});});}exports['CreateReportAgentPreview']=function(_0x532935){var _0x3eb132=this;return new Promise(function(_0x5270e5,_0x4e8bfe){return db[_0xdeb3('0x16')][_0xdeb3('0x17')](_0x532935['body'],{'raw':_0x532935[_0xdeb3('0x18')]?_0x532935[_0xdeb3('0x18')][_0xdeb3('0x19')]===undefined?!![]:![]:!![]})[_0xdeb3('0xb')](function(_0x3d6ebd){logger['info'](_0xdeb3('0x1a'),_0x532935);logger['debug'](_0xdeb3('0x1a'),_0x532935,JSON[_0xdeb3('0x1b')](_0x3d6ebd));_0x5270e5(_0x3d6ebd);})[_0xdeb3('0x15')](function(_0x52f391){logger[_0xdeb3('0x11')](_0xdeb3('0x1a'),_0x52f391[_0xdeb3('0x13')],_0x532935);_0x4e8bfe(_0x3eb132[_0xdeb3('0x11')](0x1f4,_0x52f391[_0xdeb3('0x13')]));});});};
\ No newline at end of file
+var _0xef4f=['message','result','ReportAgentPreview','create','body','options','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xef4f,0xaf));var _0xfef4=function(_0x33c1a4,_0x442cf9){_0x33c1a4=_0x33c1a4-0x0;var _0x33bf95=_0xef4f[_0x33c1a4];return _0x33bf95;};'use strict';var _=require(_0xfef4('0x0'));var util=require('util');var moment=require(_0xfef4('0x1'));var BPromise=require(_0xfef4('0x2'));var rs=require(_0xfef4('0x3'));var fs=require('fs');var Redis=require(_0xfef4('0x4'));var db=require(_0xfef4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfef4('0x6'));var config=require('../../config/environment');var jayson=require(_0xfef4('0x7'));var client=jayson['client'][_0xfef4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b5108,_0x16eaec,_0x4ec2a3){return new BPromise(function(_0x257118,_0xd41025){return client['request'](_0x5b5108,_0x4ec2a3)[_0xfef4('0x9')](function(_0x249454){logger[_0xfef4('0xa')](_0xfef4('0xb'),_0x16eaec,_0xfef4('0xc'));logger[_0xfef4('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x16eaec,'request\x20sent',JSON[_0xfef4('0xe')](_0x249454));if(_0x249454['error']){if(_0x249454[_0xfef4('0xf')][_0xfef4('0x10')]===0x1f4){logger[_0xfef4('0xf')](_0xfef4('0xb'),_0x16eaec,_0x249454['error'][_0xfef4('0x11')]);return _0xd41025(_0x249454[_0xfef4('0xf')][_0xfef4('0x11')]);}logger[_0xfef4('0xf')](_0xfef4('0xb'),_0x16eaec,_0x249454[_0xfef4('0xf')][_0xfef4('0x11')]);return _0x257118(_0x249454[_0xfef4('0xf')][_0xfef4('0x11')]);}else{logger[_0xfef4('0xa')](_0xfef4('0xb'),_0x16eaec,_0xfef4('0xc'));_0x257118(_0x249454[_0xfef4('0x12')][_0xfef4('0x11')]);}})['catch'](function(_0x3c74fb){logger[_0xfef4('0xf')](_0xfef4('0xb'),_0x16eaec,_0x3c74fb);_0xd41025(_0x3c74fb);});});}exports['CreateReportAgentPreview']=function(_0x539509){var _0x2e09de=this;return new Promise(function(_0x1a2edd,_0x9fbdcb){return db[_0xfef4('0x13')][_0xfef4('0x14')](_0x539509[_0xfef4('0x15')],{'raw':_0x539509['options']?_0x539509[_0xfef4('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xfef4('0x9')](function(_0x2ed0f2){logger['info'](_0xfef4('0x17'),_0x539509);logger[_0xfef4('0xd')](_0xfef4('0x17'),_0x539509,JSON[_0xfef4('0xe')](_0x2ed0f2));_0x1a2edd(_0x2ed0f2);})['catch'](function(_0x34abbb){logger[_0xfef4('0xf')]('CreateReportAgentPreview',_0x34abbb['message'],_0x539509);_0x9fbdcb(_0x2e09de[_0xfef4('0xf')](0x1f4,_0x34abbb['message']));});});};
\ No newline at end of file
index 72238b1..cde10b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa342=['/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','./rpc.controller','voiceChannels','get','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id'];(function(_0x35d0df,_0x1208e5){var _0x50bb6c=function(_0x2fecc6){while(--_0x2fecc6){_0x35d0df['push'](_0x35d0df['shift']());}};_0x50bb6c(++_0x1208e5);}(_0xa342,0x99));var _0x2a34=function(_0x33cfd9,_0x5965aa){_0x33cfd9=_0x33cfd9-0x0;var _0x157e83=_0xa342[_0x33cfd9];return _0x157e83;};'use strict';var multer=require('multer');var util=require(_0x2a34('0x0'));var path=require(_0x2a34('0x1'));var express=require(_0x2a34('0x2'));var router=express[_0x2a34('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x2a34('0x4'));router['get']('/voice/channels',auth['isAuthenticated'](),controller[_0x2a34('0x5')]);router[_0x2a34('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x2a34('0x7')](),controller[_0x2a34('0x8')]);router[_0x2a34('0x6')](_0x2a34('0x9'),auth[_0x2a34('0x7')](),controller['voiceChannelStopMixMonitor']);router[_0x2a34('0x6')](_0x2a34('0xa'),auth[_0x2a34('0x7')](),controller[_0x2a34('0xb')]);router['get'](_0x2a34('0xc'),auth[_0x2a34('0x7')](),controller[_0x2a34('0xd')]);router[_0x2a34('0x6')](_0x2a34('0xe'),auth[_0x2a34('0x7')](),controller[_0x2a34('0xf')]);router['get'](_0x2a34('0x10'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x11')]);router['get'](_0x2a34('0x12'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x13')]);router[_0x2a34('0x6')]('/sms/queues',auth[_0x2a34('0x7')](),controller[_0x2a34('0x14')]);router[_0x2a34('0x6')](_0x2a34('0x15'),auth[_0x2a34('0x7')](),controller['faxQueues']);router['get'](_0x2a34('0x16'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x17')]);router[_0x2a34('0x6')](_0x2a34('0x18'),auth[_0x2a34('0x7')](),controller['voiceQueuesChannels']);router[_0x2a34('0x6')](_0x2a34('0x19'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x1a')]);router[_0x2a34('0x6')](_0x2a34('0x1b'),auth['isAuthenticated'](),controller[_0x2a34('0x1c')]);router[_0x2a34('0x6')](_0x2a34('0x1d'),auth[_0x2a34('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x2a34('0x6')](_0x2a34('0x1e'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x1f')]);router[_0x2a34('0x6')](_0x2a34('0x20'),auth[_0x2a34('0x7')](),controller['outbound']);router[_0x2a34('0x6')](_0x2a34('0x21'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x22')]);router[_0x2a34('0x6')](_0x2a34('0x23'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x24')]);router[_0x2a34('0x25')](_0x2a34('0x26'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x27')]);router[_0x2a34('0x6')](_0x2a34('0x28'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x29')]);router[_0x2a34('0x6')]('/trunks',auth[_0x2a34('0x7')](),controller[_0x2a34('0x2a')]);router[_0x2a34('0x6')]('/campaigns',auth[_0x2a34('0x7')](),controller[_0x2a34('0x2b')]);router[_0x2a34('0x6')](_0x2a34('0x2c'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x2d')]);router[_0x2a34('0x6')](_0x2a34('0x2e'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x2f')]);router[_0x2a34('0x6')]('/mail/queues/waitinginteractions',auth[_0x2a34('0x7')](),controller[_0x2a34('0x30')]);router['get']('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router['get'](_0x2a34('0x31'),auth['isAuthenticated'](),controller[_0x2a34('0x32')]);router['get'](_0x2a34('0x33'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x34')]);router[_0x2a34('0x35')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x2a34('0x36')));router['get'](_0x2a34('0x37'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x38')]);router[_0x2a34('0x35')](_0x2a34('0x39'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x3a')]('chat'));router['get'](_0x2a34('0x3b'),auth[_0x2a34('0x7')](),controller['showChatQueues']);router[_0x2a34('0x35')](_0x2a34('0x3c'),auth[_0x2a34('0x7')](),controller['queueNotify'](_0x2a34('0x3d')));router[_0x2a34('0x6')]('/fax/queues/:id',auth[_0x2a34('0x7')](),controller[_0x2a34('0x3e')]);router['post'](_0x2a34('0x3f'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x3a')]('openchannel'));router['get']('/openchannel/queues/:id',auth[_0x2a34('0x7')](),controller['showOpenchannelQueues']);router[_0x2a34('0x35')](_0x2a34('0x40'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x3a')](_0x2a34('0x41')));router[_0x2a34('0x6')](_0x2a34('0x42'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x43')]);router[_0x2a34('0x35')](_0x2a34('0x44'),auth[_0x2a34('0x7')](),controller[_0x2a34('0x45')]);module[_0x2a34('0x46')]=router;
\ No newline at end of file
+var _0x77cb=['agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify'];(function(_0xa43491,_0x11ac20){var _0x29939a=function(_0x3aaacc){while(--_0x3aaacc){_0xa43491['push'](_0xa43491['shift']());}};_0x29939a(++_0x11ac20);}(_0x77cb,0x1b2));var _0xb77c=function(_0x439a62,_0x140fbd){_0x439a62=_0x439a62-0x0;var _0x1bcbf8=_0x77cb[_0x439a62];return _0x1bcbf8;};'use strict';var multer=require(_0xb77c('0x0'));var util=require(_0xb77c('0x1'));var path=require(_0xb77c('0x2'));var express=require(_0xb77c('0x3'));var router=express[_0xb77c('0x4')]();var auth=require(_0xb77c('0x5'));var controller=require('./rpc.controller');router[_0xb77c('0x6')](_0xb77c('0x7'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x9')]);router[_0xb77c('0x6')](_0xb77c('0xa'),auth[_0xb77c('0x8')](),controller[_0xb77c('0xb')]);router[_0xb77c('0x6')](_0xb77c('0xc'),auth[_0xb77c('0x8')](),controller[_0xb77c('0xd')]);router[_0xb77c('0x6')]('/voice/queues',auth['isAuthenticated'](),controller[_0xb77c('0xe')]);router[_0xb77c('0x6')](_0xb77c('0xf'),auth[_0xb77c('0x8')](),controller['chatQueues']);router['get'](_0xb77c('0x10'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x11')]);router[_0xb77c('0x6')](_0xb77c('0x12'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x13')]);router[_0xb77c('0x6')]('/openchannel/queues',auth[_0xb77c('0x8')](),controller[_0xb77c('0x14')]);router[_0xb77c('0x6')](_0xb77c('0x15'),auth[_0xb77c('0x8')](),controller['smsQueues']);router[_0xb77c('0x6')](_0xb77c('0x16'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x17')]);router[_0xb77c('0x6')](_0xb77c('0x18'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x19')]);router[_0xb77c('0x6')](_0xb77c('0x1a'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x1b')]);router[_0xb77c('0x6')]('/voice/queues/channels/:uniqueid',auth[_0xb77c('0x8')](),controller['voiceQueuesChannel']);router[_0xb77c('0x6')](_0xb77c('0x1c'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x1d')]);router[_0xb77c('0x6')](_0xb77c('0x1e'),auth['isAuthenticated'](),controller[_0xb77c('0x1f')]);router[_0xb77c('0x6')](_0xb77c('0x20'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x21')]);router['get']('/outbound',auth[_0xb77c('0x8')](),controller[_0xb77c('0x22')]);router[_0xb77c('0x6')](_0xb77c('0x23'),auth['isAuthenticated'](),controller['outboundChannels']);router['get'](_0xb77c('0x24'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x25')]);router['put'](_0xb77c('0x26'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x27')]);router[_0xb77c('0x6')](_0xb77c('0x28'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x29')]);router[_0xb77c('0x6')](_0xb77c('0x2a'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x2b')]);router['get']('/campaigns',auth[_0xb77c('0x8')](),controller['campaigns']);router['get'](_0xb77c('0x2c'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x2d')]);router[_0xb77c('0x6')]('/chat/queues/waitinginteractions',auth[_0xb77c('0x8')](),controller['chatQueuesWaitingInteractions']);router[_0xb77c('0x6')](_0xb77c('0x2e'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router['get'](_0xb77c('0x2f'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x30')]);router[_0xb77c('0x6')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xb77c('0x31')]);router['get']('/fax/queues/waitinginteractions',auth[_0xb77c('0x8')](),controller[_0xb77c('0x32')]);router[_0xb77c('0x33')](_0xb77c('0x34'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x35')]('mail'));router['get'](_0xb77c('0x36'),auth['isAuthenticated'](),controller[_0xb77c('0x37')]);router['post'](_0xb77c('0x38'),auth[_0xb77c('0x8')](),controller['queueNotify'](_0xb77c('0x39')));router['get'](_0xb77c('0x3a'),auth[_0xb77c('0x8')](),controller['showChatQueues']);router[_0xb77c('0x33')](_0xb77c('0x3b'),auth['isAuthenticated'](),controller[_0xb77c('0x35')](_0xb77c('0x3c')));router[_0xb77c('0x6')](_0xb77c('0x3d'),auth['isAuthenticated'](),controller[_0xb77c('0x3e')]);router[_0xb77c('0x33')](_0xb77c('0x3f'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x35')]('openchannel'));router[_0xb77c('0x6')](_0xb77c('0x40'),auth['isAuthenticated'](),controller[_0xb77c('0x41')]);router[_0xb77c('0x33')]('/sms/queues/:id/notify',auth[_0xb77c('0x8')](),controller[_0xb77c('0x35')](_0xb77c('0x42')));router['get'](_0xb77c('0x43'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x44')]);router[_0xb77c('0x33')](_0xb77c('0x45'),auth[_0xb77c('0x8')](),controller[_0xb77c('0x46')]);module[_0xb77c('0x47')]=router;
\ No newline at end of file
index 805c86b..ef6b1f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97a5=['Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','messageId','../../mysqldb','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','query','catch','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','updateAttributes','findOrCreate','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found'];(function(_0xdb0b9f,_0x202edd){var _0x1d129b=function(_0x1ab3c8){while(--_0x1ab3c8){_0xdb0b9f['push'](_0xdb0b9f['shift']());}};_0x1d129b(++_0x202edd);}(_0x97a5,0x16c));var _0x597a=function(_0x21a820,_0x34099f){_0x21a820=_0x21a820-0x0;var _0x49b501=_0x97a5[_0x21a820];return _0x49b501;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require('util');var db=require(_0x597a('0x0'))['db'];var logger=require('../../config/logger')(_0x597a('0x1'));var jayson=require(_0x597a('0x2'));var amiClient=jayson[_0x597a('0x3')]['http']({'port':0x232a});var mailClient=jayson['client'][_0x597a('0x4')]({'port':0x232b});var routingClient=jayson[_0x597a('0x3')][_0x597a('0x4')]({'port':0x232c});function respondWithRpcPromise(_0x4d7e7c,_0x25996e,_0x55cd05){return new BPromise(function(_0x589c98,_0x482edd){var _0x4dd99c=_0x55cd05?_0x55cd05:amiClient;return _0x4dd99c[_0x597a('0x5')](_0x4d7e7c,_0x25996e)[_0x597a('0x6')](function(_0x5a3050){if(_0x5a3050[_0x597a('0x7')]){if(_0x5a3050[_0x597a('0x7')][_0x597a('0x8')]===0x1f4){return _0x482edd(_0x5a3050[_0x597a('0x7')][_0x597a('0x9')]);}return _0x589c98(_0x5a3050[_0x597a('0x7')][_0x597a('0x9')]);}else{_0x589c98(_0x5a3050[_0x597a('0xa')]);}})['catch'](function(_0x3f702f){_0x482edd(_0x3f702f);});});}function respondWithResult(_0x410e53,_0x1ed6ea){_0x1ed6ea=_0x1ed6ea||0xc8;return function(_0x2a9705){if(_0x2a9705){return _0x410e53[_0x597a('0xb')](_0x1ed6ea)[_0x597a('0xc')](_0x2a9705);}return _0x410e53[_0x597a('0xd')](0x194);};}function handleError(_0x67e6c6,_0x359ce7){_0x359ce7=_0x359ce7||0x1f4;return function(_0x59ab56){logger[_0x597a('0x7')](_0x59ab56[_0x597a('0xe')]);if(_0x59ab56[_0x597a('0xf')]){delete _0x59ab56[_0x597a('0xf')];}_0x67e6c6[_0x597a('0xb')](_0x359ce7)[_0x597a('0x10')](_0x59ab56);};}function findById(_0x3a6a9b){return function(_0x6a7ba8){if(!_['isNil'](_0x3a6a9b)&&!_[_0x597a('0x11')](_0x6a7ba8)&&!_[_0x597a('0x11')](_0x6a7ba8[_0x597a('0x12')])){return _[_0x597a('0x13')](_0x6a7ba8[_0x597a('0x12')],function(_0x263efe){return _0x263efe['id']==_0x3a6a9b;});}return null;};}exports['voiceChannels']=function(_0x27378b,_0x551add){return respondWithRpcPromise(_0x597a('0x14'),_0x27378b[_0x597a('0x15')])[_0x597a('0x6')](respondWithResult(_0x551add,null))[_0x597a('0x16')](handleError(_0x551add,null));};exports[_0x597a('0x17')]=function(_0x8297b,_0x1e16f0){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x597a('0x18')](_0x8297b['query'],_0x8297b[_0x597a('0x19')]))[_0x597a('0x6')](respondWithResult(_0x1e16f0,null))[_0x597a('0x16')](handleError(_0x1e16f0,null));};exports['voiceChannelStopMixMonitor']=function(_0x595be2,_0x354a11){return respondWithRpcPromise(_0x597a('0x1a'),_[_0x597a('0x18')](_0x595be2[_0x597a('0x15')],_0x595be2[_0x597a('0x19')]))[_0x597a('0x6')](respondWithResult(_0x354a11,null))[_0x597a('0x16')](handleError(_0x354a11,null));};exports[_0x597a('0x1b')]=function(_0x2cdb94,_0x45dc55){return respondWithRpcPromise(_0x597a('0x1c'),_0x2cdb94[_0x597a('0x15')])[_0x597a('0x6')](respondWithResult(_0x45dc55,null))[_0x597a('0x16')](handleError(_0x45dc55,null));};exports[_0x597a('0x1d')]=function(_0x2069ef,_0x40df42){return respondWithRpcPromise(_0x597a('0x1c'),_0x2069ef[_0x597a('0x15')])[_0x597a('0x6')](findById(_0x2069ef['params']['id']))[_0x597a('0x6')](respondWithResult(_0x40df42,null))[_0x597a('0x16')](handleError(_0x40df42,null));};exports[_0x597a('0x1e')]=function(_0x2c04b,_0x4f0cef){return respondWithRpcPromise(_0x597a('0x1f'),_['merge'](_0x2c04b[_0x597a('0x15')],_0x2c04b[_0x597a('0x19')]))[_0x597a('0x6')](respondWithResult(_0x4f0cef,null))[_0x597a('0x16')](handleError(_0x4f0cef,null));};exports[_0x597a('0x20')]=function(_0x4b3cac,_0x9fbd9){return respondWithRpcPromise(_0x597a('0x21'),_0x4b3cac['query'])[_0x597a('0x6')](respondWithResult(_0x9fbd9,null))[_0x597a('0x16')](handleError(_0x9fbd9,null));};exports[_0x597a('0x22')]=function(_0x22c84e,_0xc42ca0){return respondWithRpcPromise(_0x597a('0x23'),_['merge'](_0x22c84e[_0x597a('0x15')],_0x22c84e[_0x597a('0x19')]))[_0x597a('0x6')](respondWithResult(_0xc42ca0,null))[_0x597a('0x16')](handleError(_0xc42ca0,null));};exports[_0x597a('0x24')]=function(_0x1a6c57,_0x1ed7d7){return respondWithRpcPromise(_0x597a('0x25'),_[_0x597a('0x18')](_0x1a6c57[_0x597a('0x15')],_0x1a6c57['params']))['then'](respondWithResult(_0x1ed7d7,null))[_0x597a('0x16')](handleError(_0x1ed7d7,null));};exports['voiceQueuesChannelRedirect']=function(_0x2257f5,_0x2989ab){return respondWithRpcPromise(_0x597a('0x26'),_['merge'](_0x2257f5['query'],_0x2257f5[_0x597a('0x19')]))[_0x597a('0x6')](respondWithResult(_0x2989ab,null))['catch'](handleError(_0x2989ab,null));};exports['outbound']=function(_0x28d9a9,_0x4996c9){return respondWithRpcPromise(_0x597a('0x27'),_0x28d9a9[_0x597a('0x15')])[_0x597a('0x6')](respondWithResult(_0x4996c9,null))['catch'](handleError(_0x4996c9,null));};exports[_0x597a('0x28')]=function(_0x70386,_0xba0ed7){return respondWithRpcPromise(_0x597a('0x29'),_0x70386['query'])[_0x597a('0x6')](respondWithResult(_0xba0ed7,null))['catch'](handleError(_0xba0ed7,null));};exports[_0x597a('0x2a')]=function(_0x57e490,_0x345399){var _0x4a941e;return respondWithRpcPromise('Agents',_0x57e490[_0x597a('0x15')])[_0x597a('0x6')](function(_0x6276c7){_0x4a941e=_0x6276c7;return respondWithRpcPromise(_0x597a('0x2b'),_0x57e490[_0x597a('0x15')],routingClient);})[_0x597a('0x6')](function(_0x37aec1){return _[_0x597a('0x18')]({},_0x37aec1,_0x4a941e);})['then'](respondWithResult(_0x345399,null))[_0x597a('0x16')](handleError(_0x345399,null));};exports[_0x597a('0x2c')]=function(_0x4cd33b,_0x43766f){if(_0x4cd33b[_0x597a('0x2d')]&&_0x4cd33b['body'][_0x597a('0x2e')]&&_0x4cd33b[_0x597a('0x2f')]&&_0x4cd33b[_0x597a('0x2f')][_0x597a('0xf')]){for(var _0x27d314 in _0x4cd33b[_0x597a('0x2d')][_0x597a('0x2e')]){if(_0x4cd33b[_0x597a('0x2d')][_0x597a('0x2e')][_0x597a('0x30')](_0x27d314)){db[_0x597a('0x31')][_0x597a('0x32')]({'where':{'channel':_0x27d314,'membername':_0x4cd33b[_0x597a('0x2f')][_0x597a('0xf')],'type':_0x597a('0x33'),'exitAt':null,'uniqueid':_0x4cd33b[_0x597a('0x2d')][_0x597a('0x2e')][_0x27d314]&&_0x4cd33b[_0x597a('0x2d')][_0x597a('0x2e')][_0x27d314][_0x597a('0x34')]?{'$notIn':_0x4cd33b['body'][_0x597a('0x2e')][_0x27d314]}:{'$ne':null}}})[_0x597a('0x6')](function(_0x36c1d5){var _0x3d41fe=moment()[_0x597a('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x59bb64=0x0,_0x37ff1d=_0x36c1d5[_0x597a('0x34')];_0x59bb64<_0x37ff1d;_0x59bb64+=0x1){_0x36c1d5[_0x59bb64][_0x597a('0x36')]({'exitAt':_0x3d41fe});}});for(var _0x422dde=0x0;_0x422dde<_0x4cd33b[_0x597a('0x2d')][_0x597a('0x2e')][_0x27d314][_0x597a('0x34')];_0x422dde+=0x1){db[_0x597a('0x31')][_0x597a('0x37')]({'where':{'channel':_0x27d314,'membername':_0x4cd33b['user'][_0x597a('0xf')],'type':'INTERACTION','uniqueid':_0x4cd33b['body'][_0x597a('0x2e')][_0x27d314][_0x422dde],'exitAt':null},'defaults':{'channel':_0x27d314,'membername':_0x4cd33b['user']['name'],'interface':_[_0x597a('0x11')](_0x4cd33b['user'][_0x597a('0x38')])?util[_0x597a('0x35')](_0x597a('0x39'),_0x4cd33b[_0x597a('0x2f')][_0x597a('0xf')]):_0x4cd33b['user'][_0x597a('0x38')],'type':_0x597a('0x33'),'enterAt':moment()[_0x597a('0x35')](_0x597a('0x3a')),'role':_0x597a('0x3b'),'internal':_0x4cd33b[_0x597a('0x2f')]['internal'],'uniqueid':_0x4cd33b[_0x597a('0x2d')]['interaction'][_0x27d314][_0x422dde]}});}}}}return respondWithRpcPromise(_0x597a('0x3c'),{'id':_0x4cd33b[_0x597a('0x19')]['id'],'capacity':_0x4cd33b['body'][_0x597a('0x3d')]},routingClient)[_0x597a('0x6')](respondWithResult(_0x43766f,null))['catch'](handleError(_0x43766f,null));};exports[_0x597a('0x3e')]=function(_0x106154,_0x4b83fe){return respondWithRpcPromise(_0x597a('0x3f'),_0x106154[_0x597a('0x15')])['then'](respondWithResult(_0x4b83fe,null))[_0x597a('0x16')](handleError(_0x4b83fe,null));};exports[_0x597a('0x40')]=function(_0x2c8ddc,_0x2b936e){return respondWithRpcPromise('Trunks',_0x2c8ddc['query'])[_0x597a('0x6')](respondWithResult(_0x2b936e,null))[_0x597a('0x16')](handleError(_0x2b936e,null));};exports['campaigns']=function(_0x16c6ef,_0x131ddd){return respondWithRpcPromise(_0x597a('0x41'),_0x16c6ef[_0x597a('0x15')])[_0x597a('0x6')](respondWithResult(_0x131ddd,null))['catch'](handleError(_0x131ddd,null));};exports[_0x597a('0x42')]=function(_0x2abf46,_0x1dc04d){return respondWithRpcPromise(_0x597a('0x43'),_0x2abf46['query'],routingClient)[_0x597a('0x6')](respondWithResult(_0x1dc04d,null))[_0x597a('0x16')](handleError(_0x1dc04d,null));};exports[_0x597a('0x44')]=function(_0x4e2993,_0x57b6b2){return respondWithRpcPromise(_0x597a('0x43'),_0x4e2993['query'],routingClient)[_0x597a('0x6')](findById(_0x4e2993[_0x597a('0x19')]['id']))[_0x597a('0x6')](respondWithResult(_0x57b6b2,null))[_0x597a('0x16')](handleError(_0x57b6b2,null));};exports[_0x597a('0x45')]=function(_0x389c3a,_0x27e466){return respondWithRpcPromise(_0x597a('0x46'),_0x389c3a[_0x597a('0x15')],routingClient)[_0x597a('0x6')](respondWithResult(_0x27e466,null))['catch'](handleError(_0x27e466,null));};exports[_0x597a('0x47')]=function(_0x4c10c5,_0x13e33a){return respondWithRpcPromise(_0x597a('0x46'),_0x4c10c5[_0x597a('0x15')],routingClient)[_0x597a('0x6')](findById(_0x4c10c5[_0x597a('0x19')]['id']))['then'](respondWithResult(_0x13e33a,null))[_0x597a('0x16')](handleError(_0x13e33a,null));};exports[_0x597a('0x48')]=function(_0x4f93bf,_0x6a98fc){return respondWithRpcPromise(_0x597a('0x49'),_0x4f93bf[_0x597a('0x15')],mailClient)['then'](respondWithResult(_0x6a98fc,null))[_0x597a('0x16')](handleError(_0x6a98fc,null));};exports[_0x597a('0x4a')]=function(_0x33cbb9,_0x2d116b){return respondWithRpcPromise(_0x597a('0x4b'),_0x33cbb9[_0x597a('0x15')],routingClient)[_0x597a('0x6')](respondWithResult(_0x2d116b,null))['catch'](handleError(_0x2d116b,null));};exports['showOpenchannelQueues']=function(_0x313652,_0x523440){return respondWithRpcPromise(_0x597a('0x4b'),_0x313652[_0x597a('0x15')],routingClient)[_0x597a('0x6')](findById(_0x313652[_0x597a('0x19')]['id']))['then'](respondWithResult(_0x523440,null))['catch'](handleError(_0x523440,null));};exports[_0x597a('0x4c')]=function(_0x8afee7,_0x381529){return respondWithRpcPromise(_0x597a('0x4d'),_0x8afee7['query'],routingClient)[_0x597a('0x6')](respondWithResult(_0x381529,null))[_0x597a('0x16')](handleError(_0x381529,null));};exports[_0x597a('0x4e')]=function(_0x3511ef,_0x202ceb){return respondWithRpcPromise(_0x597a('0x4d'),_0x3511ef[_0x597a('0x15')],routingClient)[_0x597a('0x6')](findById(_0x3511ef[_0x597a('0x19')]['id']))[_0x597a('0x6')](respondWithResult(_0x202ceb,null))[_0x597a('0x16')](handleError(_0x202ceb,null));};exports['faxQueues']=function(_0x477443,_0x50aee1){return respondWithRpcPromise(_0x597a('0x4f'),_0x477443[_0x597a('0x15')],routingClient)['then'](respondWithResult(_0x50aee1,null))[_0x597a('0x16')](handleError(_0x50aee1,null));};exports[_0x597a('0x50')]=function(_0x553eb6,_0x184d2b){return respondWithRpcPromise(_0x597a('0x4f'),_0x553eb6['query'],routingClient)[_0x597a('0x6')](findById(_0x553eb6[_0x597a('0x19')]['id']))[_0x597a('0x6')](respondWithResult(_0x184d2b,null))[_0x597a('0x16')](handleError(_0x184d2b,null));};exports[_0x597a('0x51')]=function(_0x4c1f75,_0x3f379f){return respondWithRpcPromise(_0x597a('0x52'),_0x4c1f75[_0x597a('0x15')])[_0x597a('0x6')](respondWithResult(_0x3f379f,null))[_0x597a('0x16')](handleError(_0x3f379f,null));};exports[_0x597a('0x53')]=function(_0x224ad4,_0x1dd955){return respondWithRpcPromise(_0x597a('0x54'),_0x224ad4[_0x597a('0x15')],routingClient)[_0x597a('0x6')](respondWithResult(_0x1dd955,null))[_0x597a('0x16')](handleError(_0x1dd955,null));};exports[_0x597a('0x55')]=function(_0x4bfada,_0x527f68){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x4bfada['query'],routingClient)[_0x597a('0x6')](respondWithResult(_0x527f68,null))['catch'](handleError(_0x527f68,null));};exports[_0x597a('0x56')]=function(_0x21ec30,_0x31ad0d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x21ec30[_0x597a('0x15')],routingClient)['then'](respondWithResult(_0x31ad0d,null))[_0x597a('0x16')](handleError(_0x31ad0d,null));};exports[_0x597a('0x57')]=function(_0x4053ee,_0x47b176){return respondWithRpcPromise(_0x597a('0x58'),_0x4053ee[_0x597a('0x15')],routingClient)[_0x597a('0x6')](respondWithResult(_0x47b176,null))['catch'](handleError(_0x47b176,null));};exports[_0x597a('0x59')]=function(_0x4b47b5,_0x5cf7a5){return respondWithRpcPromise(_0x597a('0x5a'),_0x4b47b5['query'],routingClient)[_0x597a('0x6')](respondWithResult(_0x5cf7a5,null))[_0x597a('0x16')](handleError(_0x5cf7a5,null));};exports['queueNotify']=function(_0x5991b8){return function(_0x497f59,_0x208b8f){var _0x3df241,_0x5d58ea;var _0x371920=_[_0x597a('0x5b')](_0x5991b8);var _0x186f33=_0x5991b8==='chat'?_0x597a('0x5c'):'Account';return db[_0x371920+_0x597a('0x5d')][_0x597a('0x5e')]({'raw':!![],'where':{'id':_0x497f59['params']['id']}})[_0x597a('0x6')](function(_0x55fda6){if(_[_0x597a('0x11')](_0x55fda6)){throw new Error(_0x371920+_0x597a('0x5f'));}_0x3df241=_0x55fda6;return db[_0x371920+_0x597a('0x60')][_0x597a('0x5e')]({'where':{'id':_0x497f59[_0x597a('0x2d')]['messageId']},'include':[{'model':db[_0x371920+_0x597a('0x61')],'as':_0x597a('0x61')},{'model':db[_0x371920+_0x186f33],'as':'Account'}]});})['then'](function(_0x402d1d){if(_[_0x597a('0x11')](_0x402d1d)){throw new Error(_0x371920+_0x597a('0x62'));}_0x5d58ea=_0x402d1d;return _0x402d1d[_0x597a('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x597a('0x6')](function(){var _0x5ae07e={'uniqueid':_0x5991b8+'.'+_0x5d58ea['id']+'.'+_0x5d58ea[_0x597a('0x61')]['id'],'FromUserId':_0x497f59['user']['id'],'type':_0x597a('0x64')};_0x5ae07e[_0x371920+_0x597a('0x65')]=_0x5d58ea['id'];_0x5ae07e[_0x371920+_0x597a('0x66')]=_0x5d58ea['Interaction']['id'];_0x5ae07e[_0x597a('0x67')+_0x371920+_0x186f33+'Id']=_0x5d58ea[_0x597a('0x68')]['id'];_0x5ae07e['To'+_0x371920+_0x597a('0x69')]=_0x3df241['id'];return db[_0x371920+_0x597a('0x6a')][_0x597a('0x6b')](_0x5ae07e);})[_0x597a('0x6')](function(){return respondWithRpcPromise(_0x597a('0x6c'),{'channel':_0x5991b8,'interaction':_0x5d58ea[_0x597a('0x61')],'message':_0x5d58ea,'account':_0x5d58ea['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x597a('0x64'),'appdata':_0x3df241[_0x597a('0xf')]+','+(_0x5d58ea[_0x597a('0x68')][_0x597a('0x6d')]||0x12c),'interval':_0x597a('0x6e')}]},routingClient);})[_0x597a('0x6')](respondWithResult(_0x208b8f,null))[_0x597a('0x16')](handleError(_0x208b8f,null));};};exports[_0x597a('0x6f')]=function(_0x4c1a96,_0x3a6184){var _0x101c31,_0x498eac;if(_[_0x597a('0x11')](_0x4c1a96[_0x597a('0x2d')]['channel'])){throw new Error(_0x597a('0x70'));}var _0x596686=_0x4c1a96[_0x597a('0x2d')]['channel'];var _0x363d1c=_[_0x597a('0x5b')](_0x596686);var _0x1ee161=_0x596686==='chat'?'Website':'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x4c1a96[_0x597a('0x19')]['id'],'role':'agent'}})[_0x597a('0x6')](function(_0xe15e1b){if(_[_0x597a('0x11')](_0xe15e1b)){throw new Error(_0x597a('0x71'));}_0x101c31=_0xe15e1b;return db[_0x363d1c+_0x597a('0x60')][_0x597a('0x5e')]({'where':{'id':_0x4c1a96[_0x597a('0x2d')][_0x597a('0x72')]},'include':[{'model':db[_0x363d1c+_0x597a('0x61')],'as':_0x597a('0x61')},{'model':db[_0x363d1c+_0x1ee161],'as':_0x597a('0x68')}]});})[_0x597a('0x6')](function(_0x4b69e6){if(_[_0x597a('0x11')](_0x4b69e6)){throw new Error(_0x363d1c+'\x20Message\x20not\x20found');}_0x498eac=_0x4b69e6;return _0x4b69e6[_0x597a('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x597a('0x6')](function(){var _0xf1acb5={'uniqueid':_0x596686+'.'+_0x498eac['id']+'.'+_0x498eac[_0x597a('0x61')]['id'],'FromUserId':_0x4c1a96[_0x597a('0x2f')]['id'],'type':'queue','ToUserId':_0x101c31['id']};_0xf1acb5[_0x363d1c+_0x597a('0x65')]=_0x498eac['id'];_0xf1acb5[_0x363d1c+_0x597a('0x66')]=_0x498eac[_0x597a('0x61')]['id'];_0xf1acb5['From'+_0x363d1c+_0x1ee161+'Id']=_0x498eac['Account']['id'];return db[_0x363d1c+_0x597a('0x6a')][_0x597a('0x6b')](_0xf1acb5);})[_0x597a('0x6')](function(){return respondWithRpcPromise(_0x597a('0x6c'),{'channel':_0x596686,'interaction':_0x498eac['Interaction'],'message':_0x498eac,'account':_0x498eac['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x597a('0x3b'),'appdata':_0x101c31[_0x597a('0xf')]+','+(_0x498eac[_0x597a('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x597a('0x6e')}]},routingClient);})[_0x597a('0x6')](respondWithResult(_0x3a6184,null))[_0x597a('0x16')](handleError(_0x3a6184,null));};
\ No newline at end of file
+var _0xb8f4=['MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','MessageId','From','TransferReport','create','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack','send','isNil','rows','query','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','merge','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','agent','internal','telephones','Telephones','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts'];(function(_0x25d3cb,_0x201a7d){var _0x53a675=function(_0x10c83b){while(--_0x10c83b){_0x25d3cb['push'](_0x25d3cb['shift']());}};_0x53a675(++_0x201a7d);}(_0xb8f4,0x17b));var _0x4b8f=function(_0x57e35c,_0x427579){_0x57e35c=_0x57e35c-0x0;var _0x1b8e3f=_0xb8f4[_0x57e35c];return _0x1b8e3f;};'use strict';var BPromise=require(_0x4b8f('0x0'));var moment=require(_0x4b8f('0x1'));var _=require(_0x4b8f('0x2'));var util=require(_0x4b8f('0x3'));var db=require(_0x4b8f('0x4'))['db'];var logger=require('../../config/logger')(_0x4b8f('0x5'));var jayson=require(_0x4b8f('0x6'));var amiClient=jayson[_0x4b8f('0x7')][_0x4b8f('0x8')]({'port':0x232a});var mailClient=jayson[_0x4b8f('0x7')][_0x4b8f('0x8')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x4b9575,_0x410b6f,_0xa05101){return new BPromise(function(_0x2e49e4,_0x1b668d){var _0x363802=_0xa05101?_0xa05101:amiClient;return _0x363802[_0x4b8f('0x9')](_0x4b9575,_0x410b6f)[_0x4b8f('0xa')](function(_0x45fb2a){if(_0x45fb2a[_0x4b8f('0xb')]){if(_0x45fb2a[_0x4b8f('0xb')][_0x4b8f('0xc')]===0x1f4){return _0x1b668d(_0x45fb2a[_0x4b8f('0xb')]['message']);}return _0x2e49e4(_0x45fb2a['error'][_0x4b8f('0xd')]);}else{_0x2e49e4(_0x45fb2a[_0x4b8f('0xe')]);}})['catch'](function(_0x537b3b){_0x1b668d(_0x537b3b);});});}function respondWithResult(_0x21f228,_0x24f010){_0x24f010=_0x24f010||0xc8;return function(_0xaf24fa){if(_0xaf24fa){return _0x21f228[_0x4b8f('0xf')](_0x24f010)[_0x4b8f('0x10')](_0xaf24fa);}return _0x21f228[_0x4b8f('0x11')](0x194);};}function handleError(_0x5343bf,_0x3ebb84){_0x3ebb84=_0x3ebb84||0x1f4;return function(_0x3b48ad){logger[_0x4b8f('0xb')](_0x3b48ad[_0x4b8f('0x12')]);if(_0x3b48ad['name']){delete _0x3b48ad['name'];}_0x5343bf[_0x4b8f('0xf')](_0x3ebb84)[_0x4b8f('0x13')](_0x3b48ad);};}function findById(_0x2d69cd){return function(_0x588d62){if(!_[_0x4b8f('0x14')](_0x2d69cd)&&!_[_0x4b8f('0x14')](_0x588d62)&&!_[_0x4b8f('0x14')](_0x588d62[_0x4b8f('0x15')])){return _['find'](_0x588d62[_0x4b8f('0x15')],function(_0x5a130e){return _0x5a130e['id']==_0x2d69cd;});}return null;};}exports['voiceChannels']=function(_0x4f41b7,_0x406f42){return respondWithRpcPromise('VoiceChannels',_0x4f41b7[_0x4b8f('0x16')])[_0x4b8f('0xa')](respondWithResult(_0x406f42,null))[_0x4b8f('0x17')](handleError(_0x406f42,null));};exports[_0x4b8f('0x18')]=function(_0x550d25,_0x4ba14d){return respondWithRpcPromise(_0x4b8f('0x19'),_['merge'](_0x550d25[_0x4b8f('0x16')],_0x550d25[_0x4b8f('0x1a')]))[_0x4b8f('0xa')](respondWithResult(_0x4ba14d,null))[_0x4b8f('0x17')](handleError(_0x4ba14d,null));};exports[_0x4b8f('0x1b')]=function(_0x1be814,_0x36756c){return respondWithRpcPromise(_0x4b8f('0x1c'),_['merge'](_0x1be814[_0x4b8f('0x16')],_0x1be814[_0x4b8f('0x1a')]))[_0x4b8f('0xa')](respondWithResult(_0x36756c,null))[_0x4b8f('0x17')](handleError(_0x36756c,null));};exports[_0x4b8f('0x1d')]=function(_0x364aec,_0x71e897){return respondWithRpcPromise(_0x4b8f('0x1e'),_0x364aec[_0x4b8f('0x16')])['then'](respondWithResult(_0x71e897,null))[_0x4b8f('0x17')](handleError(_0x71e897,null));};exports['showVoiceQueues']=function(_0x17e9b2,_0x14c806){return respondWithRpcPromise('VoiceQueues',_0x17e9b2[_0x4b8f('0x16')])['then'](findById(_0x17e9b2[_0x4b8f('0x1a')]['id']))[_0x4b8f('0xa')](respondWithResult(_0x14c806,null))[_0x4b8f('0x17')](handleError(_0x14c806,null));};exports[_0x4b8f('0x1f')]=function(_0x20cf18,_0x6a0c00){return respondWithRpcPromise(_0x4b8f('0x20'),_['merge'](_0x20cf18['query'],_0x20cf18[_0x4b8f('0x1a')]))[_0x4b8f('0xa')](respondWithResult(_0x6a0c00,null))[_0x4b8f('0x17')](handleError(_0x6a0c00,null));};exports[_0x4b8f('0x21')]=function(_0x1d3a2c,_0x1c4b5e){return respondWithRpcPromise(_0x4b8f('0x22'),_0x1d3a2c[_0x4b8f('0x16')])['then'](respondWithResult(_0x1c4b5e,null))[_0x4b8f('0x17')](handleError(_0x1c4b5e,null));};exports[_0x4b8f('0x23')]=function(_0x553d5a,_0x316a3b){return respondWithRpcPromise(_0x4b8f('0x24'),_[_0x4b8f('0x25')](_0x553d5a['query'],_0x553d5a['params']))[_0x4b8f('0xa')](respondWithResult(_0x316a3b,null))[_0x4b8f('0x17')](handleError(_0x316a3b,null));};exports[_0x4b8f('0x26')]=function(_0x33476b,_0x1ce961){return respondWithRpcPromise(_0x4b8f('0x27'),_[_0x4b8f('0x25')](_0x33476b[_0x4b8f('0x16')],_0x33476b[_0x4b8f('0x1a')]))[_0x4b8f('0xa')](respondWithResult(_0x1ce961,null))[_0x4b8f('0x17')](handleError(_0x1ce961,null));};exports[_0x4b8f('0x28')]=function(_0x35f0c9,_0x15545c){return respondWithRpcPromise(_0x4b8f('0x29'),_['merge'](_0x35f0c9[_0x4b8f('0x16')],_0x35f0c9['params']))[_0x4b8f('0xa')](respondWithResult(_0x15545c,null))[_0x4b8f('0x17')](handleError(_0x15545c,null));};exports['outbound']=function(_0x4d12b2,_0x1d8dc2){return respondWithRpcPromise('Outbound',_0x4d12b2[_0x4b8f('0x16')])[_0x4b8f('0xa')](respondWithResult(_0x1d8dc2,null))[_0x4b8f('0x17')](handleError(_0x1d8dc2,null));};exports['outboundChannels']=function(_0x158af6,_0x3dd437){return respondWithRpcPromise(_0x4b8f('0x2a'),_0x158af6[_0x4b8f('0x16')])[_0x4b8f('0xa')](respondWithResult(_0x3dd437,null))[_0x4b8f('0x17')](handleError(_0x3dd437,null));};exports[_0x4b8f('0x2b')]=function(_0x50ae71,_0x11a4ad){var _0x1c629d;return respondWithRpcPromise(_0x4b8f('0x2c'),_0x50ae71[_0x4b8f('0x16')])['then'](function(_0x4265fb){_0x1c629d=_0x4265fb;return respondWithRpcPromise(_0x4b8f('0x2c'),_0x50ae71[_0x4b8f('0x16')],routingClient);})['then'](function(_0x49c968){return _[_0x4b8f('0x25')]({},_0x49c968,_0x1c629d);})[_0x4b8f('0xa')](respondWithResult(_0x11a4ad,null))['catch'](handleError(_0x11a4ad,null));};exports[_0x4b8f('0x2d')]=function(_0x2f00c9,_0x3639bb){if(_0x2f00c9[_0x4b8f('0x2e')]&&_0x2f00c9['body'][_0x4b8f('0x2f')]&&_0x2f00c9[_0x4b8f('0x30')]&&_0x2f00c9[_0x4b8f('0x30')][_0x4b8f('0x31')]){for(var _0x3a511b in _0x2f00c9[_0x4b8f('0x2e')]['interaction']){if(_0x2f00c9['body'][_0x4b8f('0x2f')][_0x4b8f('0x32')](_0x3a511b)){db['MemberReport'][_0x4b8f('0x33')]({'where':{'channel':_0x3a511b,'membername':_0x2f00c9[_0x4b8f('0x30')][_0x4b8f('0x31')],'type':_0x4b8f('0x34'),'exitAt':null,'uniqueid':_0x2f00c9[_0x4b8f('0x2e')]['interaction'][_0x3a511b]&&_0x2f00c9[_0x4b8f('0x2e')][_0x4b8f('0x2f')][_0x3a511b][_0x4b8f('0x35')]?{'$notIn':_0x2f00c9[_0x4b8f('0x2e')][_0x4b8f('0x2f')][_0x3a511b]}:{'$ne':null}}})[_0x4b8f('0xa')](function(_0x4d70db){var _0x23ce71=moment()[_0x4b8f('0x36')](_0x4b8f('0x37'));for(var _0x2c3ba3=0x0,_0x2f453c=_0x4d70db[_0x4b8f('0x35')];_0x2c3ba3<_0x2f453c;_0x2c3ba3+=0x1){_0x4d70db[_0x2c3ba3][_0x4b8f('0x38')]({'exitAt':_0x23ce71});}});for(var _0x405f9b=0x0;_0x405f9b<_0x2f00c9[_0x4b8f('0x2e')][_0x4b8f('0x2f')][_0x3a511b][_0x4b8f('0x35')];_0x405f9b+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x3a511b,'membername':_0x2f00c9[_0x4b8f('0x30')][_0x4b8f('0x31')],'type':_0x4b8f('0x34'),'uniqueid':_0x2f00c9[_0x4b8f('0x2e')][_0x4b8f('0x2f')][_0x3a511b][_0x405f9b],'exitAt':null},'defaults':{'channel':_0x3a511b,'membername':_0x2f00c9['user'][_0x4b8f('0x31')],'interface':_['isNil'](_0x2f00c9[_0x4b8f('0x30')][_0x4b8f('0x39')])?util[_0x4b8f('0x36')]('SIP/%s',_0x2f00c9[_0x4b8f('0x30')][_0x4b8f('0x31')]):_0x2f00c9[_0x4b8f('0x30')][_0x4b8f('0x39')],'type':_0x4b8f('0x34'),'enterAt':moment()[_0x4b8f('0x36')](_0x4b8f('0x37')),'role':_0x4b8f('0x3a'),'internal':_0x2f00c9[_0x4b8f('0x30')][_0x4b8f('0x3b')],'uniqueid':_0x2f00c9[_0x4b8f('0x2e')][_0x4b8f('0x2f')][_0x3a511b][_0x405f9b]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2f00c9[_0x4b8f('0x1a')]['id'],'capacity':_0x2f00c9[_0x4b8f('0x2e')]['capacity']},routingClient)[_0x4b8f('0xa')](respondWithResult(_0x3639bb,null))['catch'](handleError(_0x3639bb,null));};exports[_0x4b8f('0x3c')]=function(_0x42561c,_0x2ef420){return respondWithRpcPromise(_0x4b8f('0x3d'),_0x42561c['query'])[_0x4b8f('0xa')](respondWithResult(_0x2ef420,null))[_0x4b8f('0x17')](handleError(_0x2ef420,null));};exports['trunks']=function(_0x3acb95,_0x34cdf3){return respondWithRpcPromise('Trunks',_0x3acb95['query'])['then'](respondWithResult(_0x34cdf3,null))[_0x4b8f('0x17')](handleError(_0x34cdf3,null));};exports['campaigns']=function(_0x221078,_0x461964){return respondWithRpcPromise(_0x4b8f('0x3e'),_0x221078[_0x4b8f('0x16')])[_0x4b8f('0xa')](respondWithResult(_0x461964,null))[_0x4b8f('0x17')](handleError(_0x461964,null));};exports[_0x4b8f('0x3f')]=function(_0x3d8209,_0x293602){return respondWithRpcPromise('ChatQueues',_0x3d8209[_0x4b8f('0x16')],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x293602,null))[_0x4b8f('0x17')](handleError(_0x293602,null));};exports['showChatQueues']=function(_0x316d54,_0xb73977){return respondWithRpcPromise(_0x4b8f('0x40'),_0x316d54[_0x4b8f('0x16')],routingClient)[_0x4b8f('0xa')](findById(_0x316d54[_0x4b8f('0x1a')]['id']))[_0x4b8f('0xa')](respondWithResult(_0xb73977,null))[_0x4b8f('0x17')](handleError(_0xb73977,null));};exports[_0x4b8f('0x41')]=function(_0x331c1d,_0x974e64){return respondWithRpcPromise(_0x4b8f('0x42'),_0x331c1d['query'],routingClient)['then'](respondWithResult(_0x974e64,null))[_0x4b8f('0x17')](handleError(_0x974e64,null));};exports[_0x4b8f('0x43')]=function(_0x351ccd,_0x418aab){return respondWithRpcPromise('MailQueues',_0x351ccd[_0x4b8f('0x16')],routingClient)['then'](findById(_0x351ccd[_0x4b8f('0x1a')]['id']))[_0x4b8f('0xa')](respondWithResult(_0x418aab,null))[_0x4b8f('0x17')](handleError(_0x418aab,null));};exports[_0x4b8f('0x44')]=function(_0x547395,_0x423af1){return respondWithRpcPromise(_0x4b8f('0x45'),_0x547395['query'],mailClient)[_0x4b8f('0xa')](respondWithResult(_0x423af1,null))['catch'](handleError(_0x423af1,null));};exports[_0x4b8f('0x46')]=function(_0x5807eb,_0x3a98b6){return respondWithRpcPromise(_0x4b8f('0x47'),_0x5807eb[_0x4b8f('0x16')],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x3a98b6,null))[_0x4b8f('0x17')](handleError(_0x3a98b6,null));};exports[_0x4b8f('0x48')]=function(_0x2c5898,_0x168592){return respondWithRpcPromise(_0x4b8f('0x47'),_0x2c5898['query'],routingClient)[_0x4b8f('0xa')](findById(_0x2c5898[_0x4b8f('0x1a')]['id']))[_0x4b8f('0xa')](respondWithResult(_0x168592,null))[_0x4b8f('0x17')](handleError(_0x168592,null));};exports[_0x4b8f('0x49')]=function(_0x91961a,_0x48f401){return respondWithRpcPromise(_0x4b8f('0x4a'),_0x91961a[_0x4b8f('0x16')],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x48f401,null))[_0x4b8f('0x17')](handleError(_0x48f401,null));};exports['showSmsQueues']=function(_0x2176b4,_0x39f057){return respondWithRpcPromise(_0x4b8f('0x4a'),_0x2176b4['query'],routingClient)[_0x4b8f('0xa')](findById(_0x2176b4[_0x4b8f('0x1a')]['id']))[_0x4b8f('0xa')](respondWithResult(_0x39f057,null))[_0x4b8f('0x17')](handleError(_0x39f057,null));};exports['faxQueues']=function(_0x2a064e,_0x330851){return respondWithRpcPromise(_0x4b8f('0x4b'),_0x2a064e[_0x4b8f('0x16')],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x330851,null))[_0x4b8f('0x17')](handleError(_0x330851,null));};exports['showFaxQueues']=function(_0x34767d,_0x4839a0){return respondWithRpcPromise('FaxQueues',_0x34767d['query'],routingClient)[_0x4b8f('0xa')](findById(_0x34767d[_0x4b8f('0x1a')]['id']))['then'](respondWithResult(_0x4839a0,null))['catch'](handleError(_0x4839a0,null));};exports[_0x4b8f('0x4c')]=function(_0x51f6b7,_0xc8713){return respondWithRpcPromise(_0x4b8f('0x4d'),_0x51f6b7[_0x4b8f('0x16')])[_0x4b8f('0xa')](respondWithResult(_0xc8713,null))['catch'](handleError(_0xc8713,null));};exports['chatQueuesWaitingInteractions']=function(_0x1e5dd7,_0x5f164e){return respondWithRpcPromise(_0x4b8f('0x4e'),_0x1e5dd7[_0x4b8f('0x16')],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x5f164e,null))[_0x4b8f('0x17')](handleError(_0x5f164e,null));};exports[_0x4b8f('0x4f')]=function(_0x1eef2f,_0x13e963){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1eef2f['query'],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x13e963,null))['catch'](handleError(_0x13e963,null));};exports[_0x4b8f('0x50')]=function(_0xb8756,_0x49c167){return respondWithRpcPromise(_0x4b8f('0x51'),_0xb8756['query'],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x49c167,null))[_0x4b8f('0x17')](handleError(_0x49c167,null));};exports[_0x4b8f('0x52')]=function(_0x588043,_0x487f86){return respondWithRpcPromise(_0x4b8f('0x53'),_0x588043['query'],routingClient)[_0x4b8f('0xa')](respondWithResult(_0x487f86,null))[_0x4b8f('0x17')](handleError(_0x487f86,null));};exports['faxQueuesWaitingInteractions']=function(_0x50fe8f,_0xd1ff6){return respondWithRpcPromise(_0x4b8f('0x54'),_0x50fe8f[_0x4b8f('0x16')],routingClient)[_0x4b8f('0xa')](respondWithResult(_0xd1ff6,null))[_0x4b8f('0x17')](handleError(_0xd1ff6,null));};exports[_0x4b8f('0x55')]=function(_0x56caf6){return function(_0x29b0d3,_0x46f5b9){var _0x25cde4,_0x2001b2;var _0x59133a=_[_0x4b8f('0x56')](_0x56caf6);var _0x256621=_0x56caf6===_0x4b8f('0x57')?'Website':'Account';return db[_0x59133a+_0x4b8f('0x58')][_0x4b8f('0x59')]({'raw':!![],'where':{'id':_0x29b0d3[_0x4b8f('0x1a')]['id']}})[_0x4b8f('0xa')](function(_0x861209){if(_[_0x4b8f('0x14')](_0x861209)){throw new Error(_0x59133a+'\x20Queue\x20not\x20found');}_0x25cde4=_0x861209;return db[_0x59133a+_0x4b8f('0x5a')][_0x4b8f('0x59')]({'where':{'id':_0x29b0d3[_0x4b8f('0x2e')][_0x4b8f('0x5b')]},'include':[{'model':db[_0x59133a+_0x4b8f('0x5c')],'as':'Interaction'},{'model':db[_0x59133a+_0x256621],'as':_0x4b8f('0x5d')}]});})[_0x4b8f('0xa')](function(_0x523053){if(_['isNil'](_0x523053)){throw new Error(_0x59133a+_0x4b8f('0x5e'));}_0x2001b2=_0x523053;return _0x523053[_0x4b8f('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4b8f('0xa')](function(){var _0x4b6130={'uniqueid':_0x56caf6+'.'+_0x2001b2['id']+'.'+_0x2001b2[_0x4b8f('0x5c')]['id'],'FromUserId':_0x29b0d3['user']['id'],'type':_0x4b8f('0x60')};_0x4b6130[_0x59133a+'MessageId']=_0x2001b2['id'];_0x4b6130[_0x59133a+_0x4b8f('0x61')]=_0x2001b2[_0x4b8f('0x5c')]['id'];_0x4b6130['From'+_0x59133a+_0x256621+'Id']=_0x2001b2[_0x4b8f('0x5d')]['id'];_0x4b6130['To'+_0x59133a+_0x4b8f('0x62')]=_0x25cde4['id'];return db[_0x59133a+'TransferReport']['create'](_0x4b6130);})[_0x4b8f('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x56caf6,'interaction':_0x2001b2[_0x4b8f('0x5c')],'message':_0x2001b2,'account':_0x2001b2[_0x4b8f('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4b8f('0x60'),'appdata':_0x25cde4[_0x4b8f('0x31')]+','+(_0x2001b2['Account'][_0x4b8f('0x63')]||0x12c),'interval':_0x4b8f('0x64')}]},routingClient);})[_0x4b8f('0xa')](respondWithResult(_0x46f5b9,null))['catch'](handleError(_0x46f5b9,null));};};exports[_0x4b8f('0x65')]=function(_0x3b9b0d,_0x4297d7){var _0x117f01,_0x479ad1;if(_[_0x4b8f('0x14')](_0x3b9b0d['body'][_0x4b8f('0x66')])){throw new Error(_0x4b8f('0x67'));}var _0x24a6f2=_0x3b9b0d[_0x4b8f('0x2e')][_0x4b8f('0x66')];var _0xe484e=_[_0x4b8f('0x56')](_0x24a6f2);var _0x249657=_0x24a6f2===_0x4b8f('0x57')?_0x4b8f('0x68'):_0x4b8f('0x5d');return db[_0x4b8f('0x69')][_0x4b8f('0x59')]({'raw':!![],'where':{'id':_0x3b9b0d[_0x4b8f('0x1a')]['id'],'role':_0x4b8f('0x3a')}})[_0x4b8f('0xa')](function(_0x36c4da){if(_[_0x4b8f('0x14')](_0x36c4da)){throw new Error('Agent\x20not\x20found');}_0x117f01=_0x36c4da;return db[_0xe484e+_0x4b8f('0x5a')][_0x4b8f('0x59')]({'where':{'id':_0x3b9b0d[_0x4b8f('0x2e')]['messageId']},'include':[{'model':db[_0xe484e+'Interaction'],'as':_0x4b8f('0x5c')},{'model':db[_0xe484e+_0x249657],'as':_0x4b8f('0x5d')}]});})[_0x4b8f('0xa')](function(_0xcd4d61){if(_[_0x4b8f('0x14')](_0xcd4d61)){throw new Error(_0xe484e+'\x20Message\x20not\x20found');}_0x479ad1=_0xcd4d61;return _0xcd4d61['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4b8f('0xa')](function(){var _0x445b93={'uniqueid':_0x24a6f2+'.'+_0x479ad1['id']+'.'+_0x479ad1[_0x4b8f('0x5c')]['id'],'FromUserId':_0x3b9b0d[_0x4b8f('0x30')]['id'],'type':_0x4b8f('0x60'),'ToUserId':_0x117f01['id']};_0x445b93[_0xe484e+_0x4b8f('0x6a')]=_0x479ad1['id'];_0x445b93[_0xe484e+_0x4b8f('0x61')]=_0x479ad1['Interaction']['id'];_0x445b93[_0x4b8f('0x6b')+_0xe484e+_0x249657+'Id']=_0x479ad1['Account']['id'];return db[_0xe484e+_0x4b8f('0x6c')][_0x4b8f('0x6d')](_0x445b93);})[_0x4b8f('0xa')](function(){return respondWithRpcPromise(_0x4b8f('0x6e'),{'channel':_0x24a6f2,'interaction':_0x479ad1[_0x4b8f('0x5c')],'message':_0x479ad1,'account':_0x479ad1[_0x4b8f('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4b8f('0x3a'),'appdata':_0x117f01[_0x4b8f('0x31')]+','+(_0x479ad1[_0x4b8f('0x5d')][_0x4b8f('0x6f')]||0x12c),'interval':_0x4b8f('0x64')}]},routingClient);})[_0x4b8f('0xa')](respondWithResult(_0x4297d7,null))[_0x4b8f('0x17')](handleError(_0x4297d7,null));};
\ No newline at end of file
index d74d933..07804cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x389b=['post','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','run'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x389b,0xaf));var _0xb389=function(_0x4eaa96,_0x53b203){_0x4eaa96=_0x4eaa96-0x0;var _0x390958=_0x389b[_0x4eaa96];return _0x390958;};'use strict';var multer=require('multer');var util=require(_0xb389('0x0'));var path=require(_0xb389('0x1'));var timeout=require(_0xb389('0x2'));var express=require('express');var router=express[_0xb389('0x3')]();var auth=require(_0xb389('0x4'));var interaction=require(_0xb389('0x5'));var config=require(_0xb389('0x6'));var controller=require(_0xb389('0x7'));router[_0xb389('0x8')]('/',auth[_0xb389('0x9')](),controller['index']);router[_0xb389('0x8')](_0xb389('0xa'),auth[_0xb389('0x9')](),controller[_0xb389('0xb')]);router[_0xb389('0x8')](_0xb389('0xc'),auth[_0xb389('0x9')](),controller[_0xb389('0xd')]);router[_0xb389('0xe')]('/',auth[_0xb389('0x9')](),controller[_0xb389('0xf')]);router[_0xb389('0x10')](_0xb389('0xa'),auth[_0xb389('0x9')](),controller[_0xb389('0x11')]);router[_0xb389('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb389('0x13')]);module[_0xb389('0x14')]=router;
\ No newline at end of file
+var _0x4081=['update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x4d6bb9,_0x50f618){var _0x33b563=function(_0x4e7ea1){while(--_0x4e7ea1){_0x4d6bb9['push'](_0x4d6bb9['shift']());}};_0x33b563(++_0x50f618);}(_0x4081,0x156));var _0x1408=function(_0x34c07a,_0x236e49){_0x34c07a=_0x34c07a-0x0;var _0x1e7e8b=_0x4081[_0x34c07a];return _0x1e7e8b;};'use strict';var multer=require(_0x1408('0x0'));var util=require(_0x1408('0x1'));var path=require(_0x1408('0x2'));var timeout=require(_0x1408('0x3'));var express=require(_0x1408('0x4'));var router=express[_0x1408('0x5')]();var auth=require(_0x1408('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1408('0x7'));var controller=require('./schedule.controller');router[_0x1408('0x8')]('/',auth[_0x1408('0x9')](),controller[_0x1408('0xa')]);router[_0x1408('0x8')](_0x1408('0xb'),auth[_0x1408('0x9')](),controller[_0x1408('0xc')]);router[_0x1408('0x8')]('/:id/run',auth[_0x1408('0x9')](),controller['run']);router[_0x1408('0xd')]('/',auth[_0x1408('0x9')](),controller['create']);router[_0x1408('0xe')](_0x1408('0xb'),auth[_0x1408('0x9')](),controller[_0x1408('0xf')]);router[_0x1408('0x10')](_0x1408('0xb'),auth[_0x1408('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6e11a92..548d521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4887=['BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','weeks','hours','minutes','days','csv','pdf','xlsx','custom'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4887,0xec));var _0x7488=function(_0x4cf7fc,_0x29b67d){_0x4cf7fc=_0x4cf7fc-0x0;var _0x6d390c=_0x4887[_0x4cf7fc];return _0x6d390c;};'use strict';var Sequelize=require(_0x7488('0x0'));module[_0x7488('0x1')]={'name':{'type':Sequelize[_0x7488('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7488('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7488('0x2')],'allowNull':![],'defaultValue':_0x7488('0x3')},'startAt':{'type':Sequelize[_0x7488('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x7488('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7488('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7488('0x6')](_0x7488('0x7'),'quarters','months',_0x7488('0x8'),'days',_0x7488('0x9'),_0x7488('0xa')),'allowNull':![],'defaultValue':_0x7488('0xb')},'output':{'type':Sequelize[_0x7488('0x6')](_0x7488('0xc'),_0x7488('0xd'),_0x7488('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x7488('0x6')](_0x7488('0xf'),'default'),'allowNull':![],'defaultValue':_0x7488('0xf')},'sendMail':{'type':Sequelize[_0x7488('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x7488('0x2')]},'cc':{'type':Sequelize[_0x7488('0x11')]},'bcc':{'type':Sequelize[_0x7488('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x7488('0x10')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x943f=['default','custom','BOOLEAN','TEXT','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0x943f,0x1f2));var _0xf943=function(_0x2974a4,_0x79c3dd){_0x2974a4=_0x2974a4-0x0;var _0xfb04b9=_0x943f[_0x2974a4];return _0xfb04b9;};'use strict';var Sequelize=require(_0xf943('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf943('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf943('0x1')],'allowNull':![],'defaultValue':_0xf943('0x2')},'startAt':{'type':Sequelize[_0xf943('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf943('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf943('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf943('0x5')]('years',_0xf943('0x6'),_0xf943('0x7'),_0xf943('0x8'),_0xf943('0x9'),_0xf943('0xa'),_0xf943('0xb')),'allowNull':![],'defaultValue':_0xf943('0x9')},'output':{'type':Sequelize[_0xf943('0x5')](_0xf943('0xc'),_0xf943('0xd'),_0xf943('0xe')),'allowNull':![],'defaultValue':_0xf943('0xc')},'type':{'type':Sequelize[_0xf943('0x5')]('custom',_0xf943('0xf')),'allowNull':![],'defaultValue':_0xf943('0x10')},'sendMail':{'type':Sequelize[_0xf943('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xf943('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 2f8a557..2811d40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f42=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','day','add','where','filter','map','type','key','merge','findAll','rows','catch','show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','error','stack','name','send','index','Schedule','rawAttributes','model','keys','query','dateStart','dateEnd'];(function(_0x30e5a1,_0x1ae4ed){var _0x1a4e57=function(_0x52eb3b){while(--_0x52eb3b){_0x30e5a1['push'](_0x30e5a1['shift']());}};_0x1a4e57(++_0x1ae4ed);}(_0x0f42,0xc9));var _0x20f4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0f42[_0x465028];return _0xb783d4;};'use strict';var pdf=require(_0x20f4('0x0'));var emlformat=require(_0x20f4('0x1'));var rimraf=require(_0x20f4('0x2'));var zipdir=require(_0x20f4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x20f4('0x4'));var moment=require('moment');var BPromise=require(_0x20f4('0x5'));var Mustache=require(_0x20f4('0x6'));var util=require(_0x20f4('0x7'));var path=require(_0x20f4('0x8'));var sox=require(_0x20f4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x20f4('0xa'));var squel=require('squel');var crypto=require(_0x20f4('0xb'));var jsforce=require(_0x20f4('0xc'));var deskjs=require(_0x20f4('0xd'));var toCsv=require(_0x20f4('0xe'));var querystring=require(_0x20f4('0xf'));var Papa=require(_0x20f4('0x10'));var Redis=require(_0x20f4('0x11'));var qs=require(_0x20f4('0x12'));var logger=require(_0x20f4('0x13'))(_0x20f4('0x14'));var utils=require('../../config/utils');var config=require(_0x20f4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf1d83e,_0x4c54b9){_0x4c54b9=_0x4c54b9||0xcc;return function(_0x1fa02a){if(_0x1fa02a){return _0xf1d83e[_0x20f4('0x16')](_0x4c54b9);}return _0xf1d83e[_0x20f4('0x17')](_0x4c54b9)[_0x20f4('0x18')]();};}function respondWithResult(_0x42d902,_0x24bfd4){_0x24bfd4=_0x24bfd4||0xc8;return function(_0x5555a3){if(_0x5555a3){return _0x42d902[_0x20f4('0x17')](_0x24bfd4)[_0x20f4('0x19')](_0x5555a3);}};}function respondWithFilteredResult(_0x5c0203,_0x452967){return function(_0x1898b2){if(_0x1898b2){var _0x287372=_0x1898b2[_0x20f4('0x1a')],_0x272942=_0x452967['offset'],_0x4ba133=_0x452967[_0x20f4('0x1b')]+_0x452967[_0x20f4('0x1c')],_0x1e2bde;if(_0x4ba133>=_0x287372){_0x4ba133=_0x287372;_0x1e2bde=0xc8;}else{_0x1e2bde=0xce;}_0x5c0203[_0x20f4('0x17')](_0x1e2bde);return _0x5c0203[_0x20f4('0x1d')](_0x20f4('0x1e'),_0x272942+'-'+_0x4ba133+'/'+_0x287372)['json'](_0x1898b2);}return null;};}function patchUpdates(_0x483575){return function(_0x3e7dcf){try{jsonpatch[_0x20f4('0x1f')](_0x3e7dcf,_0x483575,!![]);}catch(_0x5263c0){return BPromise[_0x20f4('0x20')](_0x5263c0);}return _0x3e7dcf[_0x20f4('0x21')]();};}function saveUpdates(_0x2c9859,_0xdf1a88){return function(_0x37dd1b){if(_0x37dd1b){return _0x37dd1b[_0x20f4('0x22')](_0x2c9859)[_0x20f4('0x23')](function(_0x4faf92){return _0x4faf92;});}return null;};}function removeEntity(_0x60d6ca,_0x526c53){return function(_0xd9efb2){if(_0xd9efb2){return _0xd9efb2[_0x20f4('0x24')]()['then'](function(){var _0x636e3b=_0xd9efb2[_0x20f4('0x25')]({'plain':!![]});var _0x342477=_0x20f4('0x26');return db['UserProfileResource'][_0x20f4('0x24')]({'where':{'type':_0x342477,'resourceId':_0x636e3b['id']}})['then'](function(){return _0xd9efb2;});})['then'](function(){_0x60d6ca[_0x20f4('0x17')](0xcc)[_0x20f4('0x18')]();});}};}function handleEntityNotFound(_0x8162f,_0x305200){return function(_0x46f1ae){if(!_0x46f1ae){_0x8162f[_0x20f4('0x16')](0x194);}return _0x46f1ae;};}function handleError(_0x1925b5,_0x283cdb){_0x283cdb=_0x283cdb||0x1f4;return function(_0x22863f){logger[_0x20f4('0x27')](_0x22863f[_0x20f4('0x28')]);if(_0x22863f[_0x20f4('0x29')]){delete _0x22863f['name'];}_0x1925b5['status'](_0x283cdb)[_0x20f4('0x2a')](_0x22863f);};}exports[_0x20f4('0x2b')]=function(_0x4d1f5f,_0x33cb85){var _0x98b122={},_0x461bcf={},_0x19c4c3={'count':0x0,'rows':[]};var _0x404996=db[_0x20f4('0x2c')][_0x20f4('0x2d')];_0x461bcf[_0x20f4('0x2e')]=_[_0x20f4('0x2f')](_0x404996);var _0x53f075={'dateStart':_0x4d1f5f[_0x20f4('0x30')][_0x20f4('0x31')],'dateEnd':_0x4d1f5f['query'][_0x20f4('0x32')]};delete _0x4d1f5f[_0x20f4('0x30')][_0x20f4('0x31')];delete _0x4d1f5f[_0x20f4('0x30')][_0x20f4('0x32')];_0x461bcf['query']=_[_0x20f4('0x2f')](_0x4d1f5f['query']);_0x461bcf[_0x20f4('0x33')]=_[_0x20f4('0x34')](_0x461bcf['model'],_0x461bcf[_0x20f4('0x30')]);_0x98b122[_0x20f4('0x35')]=_[_0x20f4('0x34')](_0x461bcf[_0x20f4('0x2e')],qs[_0x20f4('0x36')](_0x4d1f5f[_0x20f4('0x30')][_0x20f4('0x36')]));_0x98b122[_0x20f4('0x35')]=_0x98b122['attributes'][_0x20f4('0x37')]?_0x98b122[_0x20f4('0x35')]:_0x461bcf['model'];if(!_0x4d1f5f[_0x20f4('0x30')][_0x20f4('0x38')](_0x20f4('0x39'))){_0x98b122[_0x20f4('0x1c')]=qs[_0x20f4('0x1c')](_0x4d1f5f[_0x20f4('0x30')][_0x20f4('0x1c')]);_0x98b122[_0x20f4('0x1b')]=qs['offset'](_0x4d1f5f[_0x20f4('0x30')]['offset']);}_0x98b122[_0x20f4('0x3a')]=qs['sort'](_0x4d1f5f['query'][_0x20f4('0x3b')]);_0x98b122['where']=qs['filters'](_['pick'](_0x4d1f5f[_0x20f4('0x30')],_0x461bcf[_0x20f4('0x33')]));if(_0x53f075[_0x20f4('0x31')]){if(_0x53f075[_0x20f4('0x32')]){_0x53f075['dateEnd']=moment(_0x53f075[_0x20f4('0x32')])['add'](0x1,_0x20f4('0x3c'));}else{_0x53f075[_0x20f4('0x32')]=moment(_0x53f075[_0x20f4('0x31')])[_0x20f4('0x3d')](0x1,'day');}_['merge'](_0x98b122[_0x20f4('0x3e')],{'createdAt':{'$gte':_0x53f075['dateStart'],'$lte':_0x53f075['dateEnd']}});}if(_0x4d1f5f[_0x20f4('0x30')][_0x20f4('0x3f')]){_0x98b122[_0x20f4('0x3e')]=_['merge'](_0x98b122[_0x20f4('0x3e')],{'$or':_[_0x20f4('0x40')](_0x404996,function(_0x2b4f61){if(_0x2b4f61[_0x20f4('0x41')][_0x20f4('0x42')]!=='VIRTUAL'){var _0x54d2ee={};_0x54d2ee[_0x2b4f61['field']]={'$like':'%'+_0x4d1f5f[_0x20f4('0x30')]['filter']+'%'};return _0x54d2ee;}})});}_0x98b122=_[_0x20f4('0x43')]({},_0x98b122,_0x4d1f5f['options']);var _0x13e48d={'where':_0x98b122[_0x20f4('0x3e')]};return db[_0x20f4('0x2c')]['count'](_0x13e48d)[_0x20f4('0x23')](function(_0x502467){_0x19c4c3[_0x20f4('0x1a')]=_0x502467;if(_0x4d1f5f[_0x20f4('0x30')]['includeAll']){_0x98b122['include']=[{'all':!![]}];}return db['Schedule'][_0x20f4('0x44')](_0x98b122);})[_0x20f4('0x23')](function(_0xbbf5fd){_0x19c4c3[_0x20f4('0x45')]=_0xbbf5fd;return _0x19c4c3;})[_0x20f4('0x23')](respondWithFilteredResult(_0x33cb85,_0x98b122))[_0x20f4('0x46')](handleError(_0x33cb85,null));};exports[_0x20f4('0x47')]=function(_0x150ee5,_0x49b338){var _0x3a453f={'raw':![],'where':{'id':_0x150ee5['params']['id']}},_0x2067fe={};_0x2067fe['model']=_[_0x20f4('0x2f')](db['Schedule'][_0x20f4('0x2d')]);_0x2067fe['query']=_['keys'](_0x150ee5[_0x20f4('0x30')]);_0x2067fe['filters']=_['intersection'](_0x2067fe[_0x20f4('0x2e')],_0x2067fe[_0x20f4('0x30')]);_0x3a453f[_0x20f4('0x35')]=_['intersection'](_0x2067fe['model'],qs[_0x20f4('0x36')](_0x150ee5[_0x20f4('0x30')][_0x20f4('0x36')]));_0x3a453f['attributes']=_0x3a453f[_0x20f4('0x35')][_0x20f4('0x37')]?_0x3a453f[_0x20f4('0x35')]:_0x2067fe[_0x20f4('0x2e')];if(_0x150ee5[_0x20f4('0x30')]['includeAll']){_0x3a453f['include']=[{'all':!![]}];}_0x3a453f=_['merge']({},_0x3a453f,_0x150ee5[_0x20f4('0x48')]);return db['Schedule']['find'](_0x3a453f)[_0x20f4('0x23')](handleEntityNotFound(_0x49b338,null))[_0x20f4('0x23')](respondWithResult(_0x49b338,null))[_0x20f4('0x46')](handleError(_0x49b338,null));};exports[_0x20f4('0x49')]=function(_0x27ce57,_0x567026){return db[_0x20f4('0x2c')][_0x20f4('0x49')](_0x27ce57[_0x20f4('0x4a')],{})[_0x20f4('0x23')](function(_0x2c5ccd){var _0x52de8e=_0x27ce57[_0x20f4('0x4b')][_0x20f4('0x25')]({'plain':!![]});if(!_0x52de8e)throw new Error(_0x20f4('0x4c'));if(_0x52de8e['role']==='user'){var _0x43471f=_0x2c5ccd['get']({'plain':!![]});var _0x5459f3=_0x20f4('0x26');return db['UserProfileSection'][_0x20f4('0x4d')]({'where':{'name':_0x5459f3,'userProfileId':_0x52de8e[_0x20f4('0x4e')]},'raw':!![]})['then'](function(_0x49eb40){if(_0x49eb40&&_0x49eb40[_0x20f4('0x4f')]===0x0){return db['UserProfileResource'][_0x20f4('0x49')]({'name':_0x43471f['name'],'resourceId':_0x43471f['id'],'type':_0x49eb40[_0x20f4('0x29')],'sectionId':_0x49eb40['id']},{})[_0x20f4('0x23')](function(){return _0x2c5ccd;});}else{return _0x2c5ccd;}})[_0x20f4('0x46')](function(_0x1fc4fa){logger[_0x20f4('0x27')](_0x20f4('0x50'),_0x1fc4fa);throw _0x1fc4fa;});}return _0x2c5ccd;})[_0x20f4('0x23')](respondWithResult(_0x567026,0xc9))[_0x20f4('0x46')](handleError(_0x567026,null));};exports['update']=function(_0x1b2437,_0x3944fa){if(_0x1b2437['body']['id']){delete _0x1b2437[_0x20f4('0x4a')]['id'];}return db['Schedule']['find']({'where':{'id':_0x1b2437[_0x20f4('0x51')]['id']}})['then'](handleEntityNotFound(_0x3944fa,null))['then'](saveUpdates(_0x1b2437['body'],null))[_0x20f4('0x23')](respondWithResult(_0x3944fa,null))['catch'](handleError(_0x3944fa,null));};exports[_0x20f4('0x24')]=function(_0x57a7d8,_0x37cb81){return db[_0x20f4('0x2c')]['find']({'where':{'id':_0x57a7d8[_0x20f4('0x51')]['id']}})[_0x20f4('0x23')](handleEntityNotFound(_0x37cb81,null))['then'](removeEntity(_0x37cb81,null))['catch'](handleError(_0x37cb81,null));};exports[_0x20f4('0x52')]=function(_0x31992a,_0x144a87,_0x245ff4){var _0x303979=require(_0x20f4('0x53'));return db[_0x20f4('0x2c')][_0x20f4('0x4d')]({'where':{'id':_0x31992a[_0x20f4('0x51')]['id']},'raw':!![]})[_0x20f4('0x23')](handleEntityNotFound(_0x144a87,null))[_0x20f4('0x23')](function(){_0x303979[_0x20f4('0x52')](_0x31992a['params']['id']);})['then'](respondWithStatusCode(_0x144a87,null))[_0x20f4('0x46')](handleError(_0x144a87,null));};
\ No newline at end of file
+var _0x7c2a=['dateStart','filters','model','attributes','intersection','fields','hasOwnProperty','limit','sort','where','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','run','../../config/schedule','html-pdf','rimraf','zip-dir','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','update','destroy','then','get','Scheduler','UserProfileResource','stack','name','index','Schedule','rawAttributes','keys','query','dateEnd'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7c2a,0x169));var _0xa7c2=function(_0x16fc20,_0x20de09){_0x16fc20=_0x16fc20-0x0;var _0x41b330=_0x7c2a[_0x16fc20];return _0x41b330;};'use strict';var pdf=require(_0xa7c2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa7c2('0x1'));var zipdir=require(_0xa7c2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa7c2('0x3'));var util=require('util');var path=require(_0xa7c2('0x4'));var sox=require(_0xa7c2('0x5'));var csv=require(_0xa7c2('0x6'));var ejs=require(_0xa7c2('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa7c2('0x8'));var crypto=require(_0xa7c2('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa7c2('0x6'));var querystring=require(_0xa7c2('0xa'));var Papa=require(_0xa7c2('0xb'));var Redis=require('ioredis');var qs=require(_0xa7c2('0xc'));var logger=require(_0xa7c2('0xd'))('api');var utils=require(_0xa7c2('0xe'));var config=require(_0xa7c2('0xf'));var db=require(_0xa7c2('0x10'))['db'];function respondWithStatusCode(_0x51a268,_0x2dec80){_0x2dec80=_0x2dec80||0xcc;return function(_0x4d6cdc){if(_0x4d6cdc){return _0x51a268[_0xa7c2('0x11')](_0x2dec80);}return _0x51a268[_0xa7c2('0x12')](_0x2dec80)[_0xa7c2('0x13')]();};}function respondWithResult(_0x447fdd,_0x2be11b){_0x2be11b=_0x2be11b||0xc8;return function(_0x4e5553){if(_0x4e5553){return _0x447fdd[_0xa7c2('0x12')](_0x2be11b)[_0xa7c2('0x14')](_0x4e5553);}};}function respondWithFilteredResult(_0x114d90,_0x3b183f){return function(_0xbe48bd){if(_0xbe48bd){var _0x546bd1=_0xbe48bd['count'],_0x3c2d7b=_0x3b183f[_0xa7c2('0x15')],_0x5680f2=_0x3b183f[_0xa7c2('0x15')]+_0x3b183f['limit'],_0x39b50f;if(_0x5680f2>=_0x546bd1){_0x5680f2=_0x546bd1;_0x39b50f=0xc8;}else{_0x39b50f=0xce;}_0x114d90[_0xa7c2('0x12')](_0x39b50f);return _0x114d90[_0xa7c2('0x16')](_0xa7c2('0x17'),_0x3c2d7b+'-'+_0x5680f2+'/'+_0x546bd1)[_0xa7c2('0x14')](_0xbe48bd);}return null;};}function patchUpdates(_0x1037f6){return function(_0x56f845){try{jsonpatch['apply'](_0x56f845,_0x1037f6,!![]);}catch(_0x478425){return BPromise[_0xa7c2('0x18')](_0x478425);}return _0x56f845['save']();};}function saveUpdates(_0x37b3d4,_0x3d5d04){return function(_0x53569d){if(_0x53569d){return _0x53569d[_0xa7c2('0x19')](_0x37b3d4)['then'](function(_0x137839){return _0x137839;});}return null;};}function removeEntity(_0x93c833,_0x510c99){return function(_0x1a95ca){if(_0x1a95ca){return _0x1a95ca[_0xa7c2('0x1a')]()[_0xa7c2('0x1b')](function(){var _0x5dbdf8=_0x1a95ca[_0xa7c2('0x1c')]({'plain':!![]});var _0x4c800e=_0xa7c2('0x1d');return db[_0xa7c2('0x1e')][_0xa7c2('0x1a')]({'where':{'type':_0x4c800e,'resourceId':_0x5dbdf8['id']}})['then'](function(){return _0x1a95ca;});})[_0xa7c2('0x1b')](function(){_0x93c833['status'](0xcc)[_0xa7c2('0x13')]();});}};}function handleEntityNotFound(_0x29d32c,_0x588a6d){return function(_0x4d8203){if(!_0x4d8203){_0x29d32c[_0xa7c2('0x11')](0x194);}return _0x4d8203;};}function handleError(_0x3e847e,_0x129003){_0x129003=_0x129003||0x1f4;return function(_0x1f6843){logger['error'](_0x1f6843[_0xa7c2('0x1f')]);if(_0x1f6843['name']){delete _0x1f6843[_0xa7c2('0x20')];}_0x3e847e[_0xa7c2('0x12')](_0x129003)['send'](_0x1f6843);};}exports[_0xa7c2('0x21')]=function(_0x44ae82,_0x13135){var _0x496904={},_0x4a0c7b={},_0x5dd9ca={'count':0x0,'rows':[]};var _0x3f06c4=db[_0xa7c2('0x22')][_0xa7c2('0x23')];_0x4a0c7b['model']=_[_0xa7c2('0x24')](_0x3f06c4);var _0x19b1df={'dateStart':_0x44ae82[_0xa7c2('0x25')]['dateStart'],'dateEnd':_0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x26')]};delete _0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x27')];delete _0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x26')];_0x4a0c7b[_0xa7c2('0x25')]=_[_0xa7c2('0x24')](_0x44ae82[_0xa7c2('0x25')]);_0x4a0c7b[_0xa7c2('0x28')]=_['intersection'](_0x4a0c7b[_0xa7c2('0x29')],_0x4a0c7b[_0xa7c2('0x25')]);_0x496904[_0xa7c2('0x2a')]=_[_0xa7c2('0x2b')](_0x4a0c7b['model'],qs['fields'](_0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x2c')]));_0x496904['attributes']=_0x496904['attributes']['length']?_0x496904[_0xa7c2('0x2a')]:_0x4a0c7b[_0xa7c2('0x29')];if(!_0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x2d')]('nolimit')){_0x496904['limit']=qs[_0xa7c2('0x2e')](_0x44ae82['query'][_0xa7c2('0x2e')]);_0x496904[_0xa7c2('0x15')]=qs['offset'](_0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x15')]);}_0x496904['order']=qs[_0xa7c2('0x2f')](_0x44ae82[_0xa7c2('0x25')]['sort']);_0x496904[_0xa7c2('0x30')]=qs[_0xa7c2('0x28')](_[_0xa7c2('0x31')](_0x44ae82['query'],_0x4a0c7b['filters']));if(_0x19b1df[_0xa7c2('0x27')]){if(_0x19b1df[_0xa7c2('0x26')]){_0x19b1df[_0xa7c2('0x26')]=moment(_0x19b1df[_0xa7c2('0x26')])[_0xa7c2('0x32')](0x1,_0xa7c2('0x33'));}else{_0x19b1df[_0xa7c2('0x26')]=moment(_0x19b1df[_0xa7c2('0x27')])['add'](0x1,_0xa7c2('0x33'));}_[_0xa7c2('0x34')](_0x496904[_0xa7c2('0x30')],{'createdAt':{'$gte':_0x19b1df[_0xa7c2('0x27')],'$lte':_0x19b1df[_0xa7c2('0x26')]}});}if(_0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x35')]){_0x496904[_0xa7c2('0x30')]=_[_0xa7c2('0x34')](_0x496904[_0xa7c2('0x30')],{'$or':_[_0xa7c2('0x36')](_0x3f06c4,function(_0x501663){if(_0x501663[_0xa7c2('0x37')][_0xa7c2('0x38')]!==_0xa7c2('0x39')){var _0x5627b2={};_0x5627b2[_0x501663[_0xa7c2('0x3a')]]={'$like':'%'+_0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x35')]+'%'};return _0x5627b2;}})});}_0x496904=_[_0xa7c2('0x34')]({},_0x496904,_0x44ae82[_0xa7c2('0x3b')]);var _0x4ad551={'where':_0x496904['where']};return db[_0xa7c2('0x22')]['count'](_0x4ad551)[_0xa7c2('0x1b')](function(_0x39c13e){_0x5dd9ca[_0xa7c2('0x3c')]=_0x39c13e;if(_0x44ae82[_0xa7c2('0x25')][_0xa7c2('0x3d')]){_0x496904[_0xa7c2('0x3e')]=[{'all':!![]}];}return db[_0xa7c2('0x22')][_0xa7c2('0x3f')](_0x496904);})[_0xa7c2('0x1b')](function(_0x488293){_0x5dd9ca[_0xa7c2('0x40')]=_0x488293;return _0x5dd9ca;})['then'](respondWithFilteredResult(_0x13135,_0x496904))['catch'](handleError(_0x13135,null));};exports[_0xa7c2('0x41')]=function(_0x3bd190,_0x1d482d){var _0x2d037a={'raw':![],'where':{'id':_0x3bd190[_0xa7c2('0x42')]['id']}},_0x131617={};_0x131617[_0xa7c2('0x29')]=_[_0xa7c2('0x24')](db[_0xa7c2('0x22')][_0xa7c2('0x23')]);_0x131617[_0xa7c2('0x25')]=_[_0xa7c2('0x24')](_0x3bd190[_0xa7c2('0x25')]);_0x131617[_0xa7c2('0x28')]=_[_0xa7c2('0x2b')](_0x131617[_0xa7c2('0x29')],_0x131617[_0xa7c2('0x25')]);_0x2d037a[_0xa7c2('0x2a')]=_[_0xa7c2('0x2b')](_0x131617[_0xa7c2('0x29')],qs['fields'](_0x3bd190['query']['fields']));_0x2d037a[_0xa7c2('0x2a')]=_0x2d037a[_0xa7c2('0x2a')][_0xa7c2('0x43')]?_0x2d037a[_0xa7c2('0x2a')]:_0x131617[_0xa7c2('0x29')];if(_0x3bd190['query'][_0xa7c2('0x3d')]){_0x2d037a[_0xa7c2('0x3e')]=[{'all':!![]}];}_0x2d037a=_[_0xa7c2('0x34')]({},_0x2d037a,_0x3bd190['options']);return db['Schedule'][_0xa7c2('0x44')](_0x2d037a)[_0xa7c2('0x1b')](handleEntityNotFound(_0x1d482d,null))['then'](respondWithResult(_0x1d482d,null))[_0xa7c2('0x45')](handleError(_0x1d482d,null));};exports[_0xa7c2('0x46')]=function(_0x58cc04,_0xf5c8a1){return db['Schedule']['create'](_0x58cc04[_0xa7c2('0x47')],{})[_0xa7c2('0x1b')](function(_0x56811f){var _0x10fa9a=_0x58cc04[_0xa7c2('0x48')]['get']({'plain':!![]});if(!_0x10fa9a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10fa9a[_0xa7c2('0x49')]===_0xa7c2('0x48')){var _0x47d174=_0x56811f[_0xa7c2('0x1c')]({'plain':!![]});var _0x123c17=_0xa7c2('0x1d');return db[_0xa7c2('0x4a')][_0xa7c2('0x44')]({'where':{'name':_0x123c17,'userProfileId':_0x10fa9a[_0xa7c2('0x4b')]},'raw':!![]})[_0xa7c2('0x1b')](function(_0x18293d){if(_0x18293d&&_0x18293d[_0xa7c2('0x4c')]===0x0){return db[_0xa7c2('0x1e')][_0xa7c2('0x46')]({'name':_0x47d174['name'],'resourceId':_0x47d174['id'],'type':_0x18293d['name'],'sectionId':_0x18293d['id']},{})[_0xa7c2('0x1b')](function(){return _0x56811f;});}else{return _0x56811f;}})[_0xa7c2('0x45')](function(_0xc64e83){logger[_0xa7c2('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc64e83);throw _0xc64e83;});}return _0x56811f;})[_0xa7c2('0x1b')](respondWithResult(_0xf5c8a1,0xc9))[_0xa7c2('0x45')](handleError(_0xf5c8a1,null));};exports[_0xa7c2('0x19')]=function(_0x46e2fb,_0x4b24dc){if(_0x46e2fb[_0xa7c2('0x47')]['id']){delete _0x46e2fb[_0xa7c2('0x47')]['id'];}return db[_0xa7c2('0x22')][_0xa7c2('0x44')]({'where':{'id':_0x46e2fb[_0xa7c2('0x42')]['id']}})[_0xa7c2('0x1b')](handleEntityNotFound(_0x4b24dc,null))['then'](saveUpdates(_0x46e2fb[_0xa7c2('0x47')],null))[_0xa7c2('0x1b')](respondWithResult(_0x4b24dc,null))[_0xa7c2('0x45')](handleError(_0x4b24dc,null));};exports['destroy']=function(_0x2969ec,_0x224a65){return db[_0xa7c2('0x22')][_0xa7c2('0x44')]({'where':{'id':_0x2969ec[_0xa7c2('0x42')]['id']}})[_0xa7c2('0x1b')](handleEntityNotFound(_0x224a65,null))['then'](removeEntity(_0x224a65,null))[_0xa7c2('0x45')](handleError(_0x224a65,null));};exports[_0xa7c2('0x4e')]=function(_0x47b9f7,_0x3ce025,_0x10774b){var _0x344e30=require(_0xa7c2('0x4f'));return db[_0xa7c2('0x22')][_0xa7c2('0x44')]({'where':{'id':_0x47b9f7[_0xa7c2('0x42')]['id']},'raw':!![]})[_0xa7c2('0x1b')](handleEntityNotFound(_0x3ce025,null))['then'](function(){_0x344e30[_0xa7c2('0x4e')](_0x47b9f7[_0xa7c2('0x42')]['id']);})[_0xa7c2('0x1b')](respondWithStatusCode(_0x3ce025,null))[_0xa7c2('0x45')](handleError(_0x3ce025,null));};
\ No newline at end of file
index 1849480..5d82b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd54=['moment','bluebird','request-promise','exports','tools_schedules','lodash','util','api'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xbd54,0x11d));var _0x4bd5=function(_0x357633,_0x254610){_0x357633=_0x357633-0x0;var _0x261faf=_0xbd54[_0x357633];return _0x261faf;};'use strict';var _=require(_0x4bd5('0x0'));var util=require(_0x4bd5('0x1'));var logger=require('../../config/logger')(_0x4bd5('0x2'));var moment=require(_0x4bd5('0x3'));var BPromise=require(_0x4bd5('0x4'));var rp=require(_0x4bd5('0x5'));var attributes=require('./schedule.attributes');module[_0x4bd5('0x6')]=function(_0x45a7ea,_0x55e73e){return _0x45a7ea['define']('Schedule',attributes,{'tableName':_0x4bd5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e45=['bluebird','./schedule.attributes','exports','lodash','util','../../config/logger','api','moment'];(function(_0xa6ea40,_0x36cc77){var _0x4eb6df=function(_0x500de3){while(--_0x500de3){_0xa6ea40['push'](_0xa6ea40['shift']());}};_0x4eb6df(++_0x36cc77);}(_0x3e45,0x1cb));var _0x53e4=function(_0x4358f1,_0x5edc4a){_0x4358f1=_0x4358f1-0x0;var _0x3747c1=_0x3e45[_0x4358f1];return _0x3747c1;};'use strict';var _=require(_0x53e4('0x0'));var util=require(_0x53e4('0x1'));var logger=require(_0x53e4('0x2'))(_0x53e4('0x3'));var moment=require(_0x53e4('0x4'));var BPromise=require(_0x53e4('0x5'));var rp=require('request-promise');var attributes=require(_0x53e4('0x6'));module[_0x53e4('0x7')]=function(_0x3ca895,_0x28cdf3){return _0x3ca895['define']('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9a8fb65..0531ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1860=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa3d9a7,_0x1cf219){var _0x48080a=function(_0x43bead){while(--_0x43bead){_0xa3d9a7['push'](_0xa3d9a7['shift']());}};_0x48080a(++_0x1cf219);}(_0x1860,0x90));var _0x0186=function(_0x28c19b,_0x438c58){_0x28c19b=_0x28c19b-0x0;var _0x1d8230=_0x1860[_0x28c19b];return _0x1d8230;};'use strict';var _=require(_0x0186('0x0'));var util=require(_0x0186('0x1'));var moment=require(_0x0186('0x2'));var BPromise=require(_0x0186('0x3'));var rs=require(_0x0186('0x4'));var fs=require('fs');var Redis=require(_0x0186('0x5'));var db=require(_0x0186('0x6'))['db'];var utils=require(_0x0186('0x7'));var logger=require('../../config/logger')(_0x0186('0x8'));var config=require(_0x0186('0x9'));var jayson=require(_0x0186('0xa'));var client=jayson[_0x0186('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8bf86b,_0x44ba25,_0x1ce459){return new BPromise(function(_0x2a605c,_0x226af5){return client['request'](_0x8bf86b,_0x1ce459)[_0x0186('0xc')](function(_0xcafdfd){logger[_0x0186('0xd')](_0x0186('0xe'),_0x44ba25,_0x0186('0xf'));logger[_0x0186('0x10')](_0x0186('0x11'),_0x44ba25,_0x0186('0xf'),JSON[_0x0186('0x12')](_0xcafdfd));if(_0xcafdfd['error']){if(_0xcafdfd['error']['code']===0x1f4){logger[_0x0186('0x13')](_0x0186('0xe'),_0x44ba25,_0xcafdfd[_0x0186('0x13')][_0x0186('0x14')]);return _0x226af5(_0xcafdfd[_0x0186('0x13')][_0x0186('0x14')]);}logger['error'](_0x0186('0xe'),_0x44ba25,_0xcafdfd[_0x0186('0x13')]['message']);return _0x2a605c(_0xcafdfd[_0x0186('0x13')][_0x0186('0x14')]);}else{logger[_0x0186('0xd')](_0x0186('0xe'),_0x44ba25,'request\x20sent');_0x2a605c(_0xcafdfd[_0x0186('0x15')][_0x0186('0x14')]);}})[_0x0186('0x16')](function(_0x108904){logger[_0x0186('0x13')](_0x0186('0xe'),_0x44ba25,_0x108904);_0x226af5(_0x108904);});});}
\ No newline at end of file
+var _0x7e05=['http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client'];(function(_0x36bdfc,_0x3c67f1){var _0x22a5be=function(_0x81f4b2){while(--_0x81f4b2){_0x36bdfc['push'](_0x36bdfc['shift']());}};_0x22a5be(++_0x3c67f1);}(_0x7e05,0xfb));var _0x57e0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7e05[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x57e0('0x0'));var util=require(_0x57e0('0x1'));var moment=require(_0x57e0('0x2'));var BPromise=require(_0x57e0('0x3'));var rs=require(_0x57e0('0x4'));var fs=require('fs');var Redis=require(_0x57e0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x57e0('0x6'));var logger=require(_0x57e0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x57e0('0x8')][_0x57e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x364c85,_0x1659e4,_0x5c2804){return new BPromise(function(_0x1899d9,_0x4dea18){return client['request'](_0x364c85,_0x5c2804)[_0x57e0('0xa')](function(_0x2d2beb){logger[_0x57e0('0xb')](_0x57e0('0xc'),_0x1659e4,_0x57e0('0xd'));logger[_0x57e0('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1659e4,'request\x20sent',JSON['stringify'](_0x2d2beb));if(_0x2d2beb[_0x57e0('0xf')]){if(_0x2d2beb[_0x57e0('0xf')][_0x57e0('0x10')]===0x1f4){logger[_0x57e0('0xf')](_0x57e0('0xc'),_0x1659e4,_0x2d2beb[_0x57e0('0xf')][_0x57e0('0x11')]);return _0x4dea18(_0x2d2beb['error'][_0x57e0('0x11')]);}logger['error'](_0x57e0('0xc'),_0x1659e4,_0x2d2beb[_0x57e0('0xf')][_0x57e0('0x11')]);return _0x1899d9(_0x2d2beb['error'][_0x57e0('0x11')]);}else{logger[_0x57e0('0xb')]('Schedule,\x20%s,\x20%s',_0x1659e4,_0x57e0('0xd'));_0x1899d9(_0x2d2beb[_0x57e0('0x12')]['message']);}})[_0x57e0('0x13')](function(_0x3d11ff){logger[_0x57e0('0xf')](_0x57e0('0xc'),_0x1659e4,_0x3d11ff);_0x4dea18(_0x3d11ff);});});}
\ No newline at end of file
index 6f32743..a70f616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7fc=['file','addLogo','diskStorage','join','extname','single','preferred','/:id/preferred','addPreferred','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','root','server/files/images/logos/','format','logo','originalname','post'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xc7fc,0x101));var _0xcc7f=function(_0x189cf7,_0x233a77){_0x189cf7=_0x189cf7-0x0;var _0xddf988=_0xc7fc[_0x189cf7];return _0xddf988;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcc7f('0x0'));var timeout=require(_0xcc7f('0x1'));var express=require('express');var router=express[_0xcc7f('0x2')]();var auth=require(_0xcc7f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcc7f('0x4'));var controller=require(_0xcc7f('0x5'));router[_0xcc7f('0x6')]('/',auth[_0xcc7f('0x7')](),controller[_0xcc7f('0x8')]);router[_0xcc7f('0x6')](_0xcc7f('0x9'),controller[_0xcc7f('0xa')]);router['get'](_0xcc7f('0xb'),controller[_0xcc7f('0xc')]);router[_0xcc7f('0x6')](_0xcc7f('0xd'),controller['getLogoLogin']);router[_0xcc7f('0x6')](_0xcc7f('0xe'),controller[_0xcc7f('0xf')]);router['get']('/:id/preferred',controller['getPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52de33,_0xc014d,_0xdb7e9a){_0xdb7e9a(null,path['join'](config[_0xcc7f('0x10')],_0xcc7f('0x11')));},'filename':function(_0x32f8ba,_0x5e289f,_0x4b74e8){_0x4b74e8(null,util[_0xcc7f('0x12')]('%s%s',_0xcc7f('0x13'),path['extname'](_0x5e289f[_0xcc7f('0x14')])));}})});router[_0xcc7f('0x15')](_0xcc7f('0xb'),upload['single'](_0xcc7f('0x16')),controller[_0xcc7f('0x17')]);var upload=multer({'storage':multer[_0xcc7f('0x18')]({'destination':function(_0x4a2eaf,_0x18c144,_0x569cdb){_0x569cdb(null,path[_0xcc7f('0x19')](config['root'],_0xcc7f('0x11')));},'filename':function(_0x5521b1,_0x20817b,_0x36b054){_0x36b054(null,util[_0xcc7f('0x12')]('%s%s','logologin',path[_0xcc7f('0x1a')](_0x20817b[_0xcc7f('0x14')])));}})});router['post']('/:id/logo_login',upload[_0xcc7f('0x1b')](_0xcc7f('0x16')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xcc7f('0x18')]({'destination':function(_0x3fd4b9,_0x34ed71,_0x2fb221){_0x2fb221(null,path[_0xcc7f('0x19')](config[_0xcc7f('0x10')],_0xcc7f('0x11')));},'filename':function(_0x4868ae,_0x43ad91,_0x486cb3){_0x486cb3(null,util[_0xcc7f('0x12')]('%s%s',_0xcc7f('0x1c'),path[_0xcc7f('0x1a')](_0x43ad91[_0xcc7f('0x14')])));}})});router[_0xcc7f('0x15')](_0xcc7f('0x1d'),upload[_0xcc7f('0x1b')](_0xcc7f('0x16')),controller[_0xcc7f('0x1e')]);router['put'](_0xcc7f('0x9'),auth['isAuthenticated'](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0xea69=['show','getLogo','/:id/gdpr','gdpr','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','logologin','/:id/logo_login','addLogoLogin','/:id/preferred','single','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id'];(function(_0x18bee8,_0x15e890){var _0x4301a9=function(_0x36c7d3){while(--_0x36c7d3){_0x18bee8['push'](_0x18bee8['shift']());}};_0x4301a9(++_0x15e890);}(_0xea69,0xd6));var _0x9ea6=function(_0x41ff4,_0x24954b){_0x41ff4=_0x41ff4-0x0;var _0x5507b2=_0xea69[_0x41ff4];return _0x5507b2;};'use strict';var multer=require(_0x9ea6('0x0'));var util=require(_0x9ea6('0x1'));var path=require(_0x9ea6('0x2'));var timeout=require(_0x9ea6('0x3'));var express=require(_0x9ea6('0x4'));var router=express[_0x9ea6('0x5')]();var auth=require(_0x9ea6('0x6'));var interaction=require(_0x9ea6('0x7'));var config=require(_0x9ea6('0x8'));var controller=require(_0x9ea6('0x9'));router[_0x9ea6('0xa')]('/',auth[_0x9ea6('0xb')](),controller[_0x9ea6('0xc')]);router[_0x9ea6('0xa')](_0x9ea6('0xd'),controller[_0x9ea6('0xe')]);router['get']('/:id/logo',controller[_0x9ea6('0xf')]);router[_0x9ea6('0xa')]('/:id/logo_login',controller['getLogoLogin']);router[_0x9ea6('0xa')](_0x9ea6('0x10'),controller[_0x9ea6('0x11')]);router[_0x9ea6('0xa')]('/:id/preferred',controller['getPreferred']);var upload=multer({'storage':multer[_0x9ea6('0x12')]({'destination':function(_0x324a57,_0x59329e,_0x11e8bf){_0x11e8bf(null,path[_0x9ea6('0x13')](config[_0x9ea6('0x14')],_0x9ea6('0x15')));},'filename':function(_0x50e1b4,_0xd9ae2c,_0x42b782){_0x42b782(null,util[_0x9ea6('0x16')](_0x9ea6('0x17'),_0x9ea6('0x18'),path[_0x9ea6('0x19')](_0xd9ae2c[_0x9ea6('0x1a')])));}})});router[_0x9ea6('0x1b')]('/:id/logo',upload['single'](_0x9ea6('0x1c')),controller[_0x9ea6('0x1d')]);var upload=multer({'storage':multer[_0x9ea6('0x12')]({'destination':function(_0x1665de,_0x2a0090,_0x201fda){_0x201fda(null,path[_0x9ea6('0x13')](config[_0x9ea6('0x14')],_0x9ea6('0x15')));},'filename':function(_0x4dcf2a,_0x5c9d12,_0x9f40c8){_0x9f40c8(null,util[_0x9ea6('0x16')](_0x9ea6('0x17'),_0x9ea6('0x1e'),path[_0x9ea6('0x19')](_0x5c9d12[_0x9ea6('0x1a')])));}})});router[_0x9ea6('0x1b')](_0x9ea6('0x1f'),upload['single']('file'),controller[_0x9ea6('0x20')]);var upload=multer({'storage':multer[_0x9ea6('0x12')]({'destination':function(_0x424ee4,_0x241e04,_0x209be1){_0x209be1(null,path[_0x9ea6('0x13')](config[_0x9ea6('0x14')],'server/files/images/logos/'));},'filename':function(_0x53ce49,_0x283f1f,_0x314202){_0x314202(null,util[_0x9ea6('0x16')](_0x9ea6('0x17'),'preferred',path[_0x9ea6('0x19')](_0x283f1f[_0x9ea6('0x1a')])));}})});router[_0x9ea6('0x1b')](_0x9ea6('0x21'),upload[_0x9ea6('0x22')](_0x9ea6('0x1c')),controller['addPreferred']);router[_0x9ea6('0x23')](_0x9ea6('0xd'),auth['isAuthenticated'](),controller[_0x9ea6('0x24')]);module[_0x9ea6('0x25')]=router;
\ No newline at end of file
index 2b08823..82391e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa562=['exports','INTEGER','min_mailbox','STRING','BOOLEAN','alternate','sequelize'];(function(_0x4f6ea1,_0x301b70){var _0x3331c9=function(_0x57a0ef){while(--_0x57a0ef){_0x4f6ea1['push'](_0x4f6ea1['shift']());}};_0x3331c9(++_0x301b70);}(_0xa562,0x1e9));var _0x2a56=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0xa562[_0x2fd69d];return _0x5d5ef3;};'use strict';var Sequelize=require(_0x2a56('0x0'));module[_0x2a56('0x1')]={'min_internal':{'type':Sequelize[_0x2a56('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2a56('0x2')](0xb),'unique':_0x2a56('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2a56('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x2a56('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2a56('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2a56('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x2a56('0x4')]},'turnusername':{'type':Sequelize[_0x2a56('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x2a56('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2a56('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2a56('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2a56('0x4')],'defaultValue':_0x2a56('0x6')},'chatTimeout':{'type':Sequelize[_0x2a56('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x2a56('0x5')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe2ba=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','sequelize','exports','INTEGER','STRING'];(function(_0x2d3a4d,_0x47561e){var _0x3a94a3=function(_0x2f48da){while(--_0x2f48da){_0x2d3a4d['push'](_0x2d3a4d['shift']());}};_0x3a94a3(++_0x47561e);}(_0xe2ba,0xea));var _0xae2b=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xe2ba[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0xae2b('0x0'));module[_0xae2b('0x1')]={'min_internal':{'type':Sequelize[_0xae2b('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xae2b('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xae2b('0x3')],'defaultValue':_0xae2b('0x4')},'logo':{'type':Sequelize[_0xae2b('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xae2b('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xae2b('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xae2b('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xae2b('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xae2b('0x3')]},'turnusername':{'type':Sequelize[_0xae2b('0x3')]},'turnpassword':{'type':Sequelize[_0xae2b('0x3')]},'pageTitle':{'type':Sequelize[_0xae2b('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xae2b('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xae2b('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xae2b('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xae2b('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xae2b('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xae2b('0x3')],'defaultValue':_0xae2b('0x6')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xae2b('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xae2b('0x5')],'defaultValue':!![]}};
\ No newline at end of file
index 54b8b57..5e286b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa069=['addPreferred','default_preferred.png','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','model','keys','query','dateEnd','dateStart','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','field','filter','Setting','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','get','readFileSync','join','root','server/files/templates/stun.ejs','utf8','render','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','logo','filename','../../config/license/util','getLogo','getLicense','loginLogo','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','upperFirst','custom','ValidationError','Logo\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred','default_loginLogo.png','Sequelize','securePassword'];(function(_0x12b002,_0x43b9a7){var _0x4acf7d=function(_0x39101b){while(--_0x39101b){_0x12b002['push'](_0x12b002['shift']());}};_0x4acf7d(++_0x43b9a7);}(_0xa069,0xf2));var _0x9a06=function(_0x534c17,_0x56bc04){_0x534c17=_0x534c17-0x0;var _0xa091e8=_0xa069[_0x534c17];return _0xa091e8;};'use strict';var pdf=require(_0x9a06('0x0'));var emlformat=require(_0x9a06('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9a06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a06('0x3'));var moment=require('moment');var BPromise=require(_0x9a06('0x4'));var Mustache=require(_0x9a06('0x5'));var util=require(_0x9a06('0x6'));var path=require('path');var sox=require(_0x9a06('0x7'));var csv=require(_0x9a06('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9a06('0x9'));var crypto=require('crypto');var jsforce=require(_0x9a06('0xa'));var deskjs=require(_0x9a06('0xb'));var toCsv=require(_0x9a06('0x8'));var querystring=require(_0x9a06('0xc'));var Papa=require('papaparse');var Redis=require(_0x9a06('0xd'));var qs=require(_0x9a06('0xe'));var logger=require(_0x9a06('0xf'))('api');var utils=require(_0x9a06('0x10'));var config=require('../../config/environment');var db=require(_0x9a06('0x11'))['db'];var jayson=require(_0x9a06('0x12'));var client=jayson[_0x9a06('0x13')][_0x9a06('0x14')]({'port':0x232a});function respondWithRpcPromise(_0xcff665,_0x4c9f71,_0x17f7e2,_0xc1f428){return new BPromise(function(_0x313034,_0x313b9c){var _0x1c201f=_0xc1f428||client;return _0x1c201f[_0x9a06('0x15')](_0xcff665,_0x17f7e2)[_0x9a06('0x16')](function(_0x6c106b){logger[_0x9a06('0x17')]('Setting,\x20%s,\x20%s',_0x4c9f71,_0x9a06('0x18'));logger[_0x9a06('0x19')](_0x9a06('0x1a'),_0x4c9f71,_0x9a06('0x18'),JSON['stringify'](_0x6c106b));if(_0x6c106b['error']){if(_0x6c106b['error']['code']===0x1f4){logger[_0x9a06('0x1b')](_0x9a06('0x1c'),_0x4c9f71,_0x6c106b['error']['message']);return _0x313b9c(_0x6c106b[_0x9a06('0x1b')]['message']);}logger[_0x9a06('0x1b')](_0x9a06('0x1c'),_0x4c9f71,_0x6c106b[_0x9a06('0x1b')][_0x9a06('0x1d')]);return _0x313034(_0x6c106b[_0x9a06('0x1b')]['message']);}else{logger[_0x9a06('0x17')](_0x9a06('0x1c'),_0x4c9f71,_0x9a06('0x18'));_0x313034(_0x6c106b[_0x9a06('0x1e')][_0x9a06('0x1d')]);}})['catch'](function(_0x5b2d01){logger['error'](_0x9a06('0x1c'),_0x4c9f71,_0x5b2d01);_0x313b9c(_0x5b2d01);});});}function respondWithStatusCode(_0x37e2ee,_0x2a242c){_0x2a242c=_0x2a242c||0xcc;return function(_0x85f43a){if(_0x85f43a){return _0x37e2ee[_0x9a06('0x1f')](_0x2a242c);}return _0x37e2ee[_0x9a06('0x20')](_0x2a242c)[_0x9a06('0x21')]();};}function respondWithResult(_0x3b3172,_0x1b123e){_0x1b123e=_0x1b123e||0xc8;return function(_0x48f6d4){if(_0x48f6d4){return _0x3b3172[_0x9a06('0x20')](_0x1b123e)[_0x9a06('0x22')](_0x48f6d4);}};}function respondWithFilteredResult(_0x1d4fa5,_0x3654a2){return function(_0x5349d3){if(_0x5349d3){var _0x1d90d0=_0x5349d3[_0x9a06('0x23')],_0x3404df=_0x3654a2['offset'],_0x13da52=_0x3654a2[_0x9a06('0x24')]+_0x3654a2['limit'],_0x3fd1bb;if(_0x13da52>=_0x1d90d0){_0x13da52=_0x1d90d0;_0x3fd1bb=0xc8;}else{_0x3fd1bb=0xce;}_0x1d4fa5[_0x9a06('0x20')](_0x3fd1bb);return _0x1d4fa5[_0x9a06('0x25')](_0x9a06('0x26'),_0x3404df+'-'+_0x13da52+'/'+_0x1d90d0)[_0x9a06('0x22')](_0x5349d3);}return null;};}function patchUpdates(_0x5dc6b5){return function(_0x418ebd){try{jsonpatch[_0x9a06('0x27')](_0x418ebd,_0x5dc6b5,!![]);}catch(_0x20eec0){return BPromise[_0x9a06('0x28')](_0x20eec0);}return _0x418ebd[_0x9a06('0x29')]();};}function saveUpdates(_0x1c4a37,_0xd42f83){return function(_0x300b03){if(_0x300b03){return _0x300b03[_0x9a06('0x2a')](_0x1c4a37)['then'](function(_0x215f45){return _0x215f45;});}return null;};}function removeEntity(_0x1f3502,_0x558eeb){return function(_0x1e4df1){if(_0x1e4df1){return _0x1e4df1[_0x9a06('0x2b')]()['then'](function(){_0x1f3502[_0x9a06('0x20')](0xcc)[_0x9a06('0x21')]();});}};}function handleEntityNotFound(_0x13cb68,_0x56e239){return function(_0x54a339){if(!_0x54a339){_0x13cb68[_0x9a06('0x1f')](0x194);}return _0x54a339;};}function handleError(_0x574999,_0x5150ae){_0x5150ae=_0x5150ae||0x1f4;return function(_0x56804a){logger[_0x9a06('0x1b')](_0x56804a[_0x9a06('0x2c')]);if(_0x56804a['name']){delete _0x56804a[_0x9a06('0x2d')];}_0x574999[_0x9a06('0x20')](_0x5150ae)['send'](_0x56804a);};}exports[_0x9a06('0x2e')]=function(_0xd25025,_0x2133c0){var _0x4b60fd={},_0x135266={},_0x4d9ea9={'count':0x0,'rows':[]};var _0x3312e3=db['Setting']['rawAttributes'];_0x135266[_0x9a06('0x2f')]=_[_0x9a06('0x30')](_0x3312e3);var _0x3a7781={'dateStart':_0xd25025[_0x9a06('0x31')]['dateStart'],'dateEnd':_0xd25025[_0x9a06('0x31')][_0x9a06('0x32')]};delete _0xd25025[_0x9a06('0x31')][_0x9a06('0x33')];delete _0xd25025[_0x9a06('0x31')][_0x9a06('0x32')];_0x135266[_0x9a06('0x31')]=_[_0x9a06('0x30')](_0xd25025['query']);_0x135266[_0x9a06('0x34')]=_['intersection'](_0x135266[_0x9a06('0x2f')],_0x135266[_0x9a06('0x31')]);_0x4b60fd[_0x9a06('0x35')]=_[_0x9a06('0x36')](_0x135266[_0x9a06('0x2f')],qs[_0x9a06('0x37')](_0xd25025[_0x9a06('0x31')]['fields']));_0x4b60fd[_0x9a06('0x35')]=_0x4b60fd[_0x9a06('0x35')][_0x9a06('0x38')]?_0x4b60fd['attributes']:_0x135266[_0x9a06('0x2f')];if(!_0xd25025[_0x9a06('0x31')][_0x9a06('0x39')](_0x9a06('0x3a'))){_0x4b60fd[_0x9a06('0x3b')]=qs[_0x9a06('0x3b')](_0xd25025[_0x9a06('0x31')][_0x9a06('0x3b')]);_0x4b60fd['offset']=qs['offset'](_0xd25025[_0x9a06('0x31')][_0x9a06('0x24')]);}_0x4b60fd[_0x9a06('0x3c')]=qs[_0x9a06('0x3d')](_0xd25025[_0x9a06('0x31')][_0x9a06('0x3d')]);_0x4b60fd[_0x9a06('0x3e')]=qs[_0x9a06('0x34')](_[_0x9a06('0x3f')](_0xd25025[_0x9a06('0x31')],_0x135266[_0x9a06('0x34')]));if(_0x3a7781[_0x9a06('0x33')]){if(_0x3a7781['dateEnd']){_0x3a7781[_0x9a06('0x32')]=moment(_0x3a7781[_0x9a06('0x32')])['add'](0x1,'day');}else{_0x3a7781['dateEnd']=moment(_0x3a7781[_0x9a06('0x33')])['add'](0x1,'day');}_['merge'](_0x4b60fd[_0x9a06('0x3e')],{'createdAt':{'$gte':_0x3a7781['dateStart'],'$lte':_0x3a7781['dateEnd']}});}if(_0xd25025[_0x9a06('0x31')]['filter']){_0x4b60fd['where']=_[_0x9a06('0x40')](_0x4b60fd[_0x9a06('0x3e')],{'$or':_[_0x9a06('0x41')](_0x3312e3,function(_0x22047c){if(_0x22047c[_0x9a06('0x42')]['key']!=='VIRTUAL'){var _0x307395={};_0x307395[_0x22047c[_0x9a06('0x43')]]={'$like':'%'+_0xd25025['query'][_0x9a06('0x44')]+'%'};return _0x307395;}})});}_0x4b60fd=_['merge']({},_0x4b60fd,_0xd25025['options']);var _0x11b58b={'where':_0x4b60fd[_0x9a06('0x3e')]};return db[_0x9a06('0x45')][_0x9a06('0x23')](_0x11b58b)[_0x9a06('0x16')](function(_0x4d5109){_0x4d9ea9[_0x9a06('0x23')]=_0x4d5109;if(_0xd25025[_0x9a06('0x31')][_0x9a06('0x46')]){_0x4b60fd[_0x9a06('0x47')]=[{'all':!![]}];}return db[_0x9a06('0x45')][_0x9a06('0x48')](_0x4b60fd);})[_0x9a06('0x16')](function(_0xe84578){_0x4d9ea9[_0x9a06('0x49')]=_0xe84578;return _0x4d9ea9;})[_0x9a06('0x16')](respondWithFilteredResult(_0x2133c0,_0x4b60fd))[_0x9a06('0x4a')](handleError(_0x2133c0,null));};exports['show']=function(_0x588341,_0x3f6deb){var _0x36e283={'raw':![],'where':{'id':_0x588341[_0x9a06('0x4b')]['id']}},_0x189aae={};_0x189aae['model']=_[_0x9a06('0x30')](db[_0x9a06('0x45')][_0x9a06('0x4c')]);_0x189aae[_0x9a06('0x31')]=_[_0x9a06('0x30')](_0x588341[_0x9a06('0x31')]);_0x189aae[_0x9a06('0x34')]=_[_0x9a06('0x36')](_0x189aae[_0x9a06('0x2f')],_0x189aae['query']);_0x36e283[_0x9a06('0x35')]=_['intersection'](_0x189aae[_0x9a06('0x2f')],qs[_0x9a06('0x37')](_0x588341['query']['fields']));_0x36e283[_0x9a06('0x35')]=_0x36e283['attributes'][_0x9a06('0x38')]?_0x36e283[_0x9a06('0x35')]:_0x189aae[_0x9a06('0x2f')];if(_0x588341[_0x9a06('0x31')][_0x9a06('0x46')]){_0x36e283['include']=[{'all':!![]}];}_0x36e283=_['merge']({},_0x36e283,_0x588341['options']);return db[_0x9a06('0x45')][_0x9a06('0x4d')](_0x36e283)[_0x9a06('0x16')](handleEntityNotFound(_0x3f6deb,null))[_0x9a06('0x16')](respondWithResult(_0x3f6deb,null))[_0x9a06('0x4a')](handleError(_0x3f6deb,null));};exports[_0x9a06('0x2a')]=function(_0x3eeb6d,_0x542b1f,_0x339730){var _0x385229;return db[_0x9a06('0x45')]['find']({'where':{'id':_0x3eeb6d['params']['id']}})[_0x9a06('0x16')](handleEntityNotFound(_0x542b1f,null))['then'](saveUpdates(_0x3eeb6d[_0x9a06('0x4e')],null))[_0x9a06('0x16')](function(_0x51424e){if(_0x51424e){_0x385229=_0x51424e[_0x9a06('0x4f')]({'plain':!![]});var _0x1f1b5b=fs[_0x9a06('0x50')](path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x9a06('0x53')),_0x9a06('0x54'));var _0x96ee96=ejs[_0x9a06('0x55')](_0x1f1b5b,_0x385229);var _0x14fb9b=fs['readFileSync'](path[_0x9a06('0x51')](config['root'],_0x9a06('0x56')),'utf8');var _0x35dd3d=ejs[_0x9a06('0x55')](_0x14fb9b,_0x385229);fs[_0x9a06('0x57')]('/etc/asterisk/stun_xcally.conf',_0x96ee96);fs[_0x9a06('0x57')](_0x9a06('0x58'),_0x35dd3d);return respondWithRpcPromise(_0x9a06('0x59'),_0x9a06('0x2a'),{'module':_0x9a06('0x5a')});}})['then'](function(){return respondWithRpcPromise('Reload',_0x9a06('0x2a'),{'module':_0x9a06('0x5b')});})['then'](function(){return _0x385229||null;})[_0x9a06('0x16')](respondWithResult(_0x542b1f,null))[_0x9a06('0x4a')](handleError(_0x542b1f,null));};exports[_0x9a06('0x5c')]=function(_0x5b85ce,_0xd489d9,_0x5a132e){if(_0x5b85ce['file']&&_0x5b85ce[_0x9a06('0x5d')]['filename']){_0x5b85ce[_0x9a06('0x4e')][_0x9a06('0x5e')]=_0x5b85ce[_0x9a06('0x5d')][_0x9a06('0x5f')];}return db[_0x9a06('0x45')][_0x9a06('0x4d')]({'where':{'id':_0x5b85ce['params']['id']}})[_0x9a06('0x16')](handleEntityNotFound(_0xd489d9,null))['then'](saveUpdates(_0x5b85ce[_0x9a06('0x4e')],null))[_0x9a06('0x16')](respondWithResult(_0xd489d9,null))[_0x9a06('0x4a')](handleError(_0xd489d9,null));};exports['addLogoLogin']=function(_0x4edde4,_0x577227,_0x27f48d){if(_0x4edde4['file']&&_0x4edde4[_0x9a06('0x5d')][_0x9a06('0x5f')]){_0x4edde4['body']['loginLogo']=_0x4edde4[_0x9a06('0x5d')][_0x9a06('0x5f')];}return db[_0x9a06('0x45')][_0x9a06('0x4d')]({'where':{'id':_0x4edde4['params']['id']}})[_0x9a06('0x16')](handleEntityNotFound(_0x577227,null))['then'](saveUpdates(_0x4edde4[_0x9a06('0x4e')],null))[_0x9a06('0x16')](respondWithResult(_0x577227,null))[_0x9a06('0x4a')](handleError(_0x577227,null));};var utilLicense=require(_0x9a06('0x60'));exports[_0x9a06('0x61')]=function(_0x4c2f10,_0x5927f2,_0x1515f9){var _0x238b0d='server/files/images/logos';var _0x5b06e1={'custom':![]};return utilLicense[_0x9a06('0x62')]()[_0x9a06('0x16')](function(_0x3d6571){if(_0x3d6571){_0x5b06e1=_0x3d6571;}return db[_0x9a06('0x45')][_0x9a06('0x4d')]({'where':{'id':_0x4c2f10[_0x9a06('0x4b')]['id']},'attributes':['logo',_0x9a06('0x63'),'preferred',_0x9a06('0x64'),_0x9a06('0x65'),_0x9a06('0x66')],'raw':!![]});})[_0x9a06('0x16')](handleEntityNotFound(_0x5927f2,null))['then'](function(_0x472f79){if(_0x472f79){var _0x15b344=_0x472f79['logo']&&fs[_0x9a06('0x67')](path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x238b0d,_[_0x9a06('0x68')](_0x472f79[_0x9a06('0x5e')])))?path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x238b0d,_[_0x9a06('0x68')](_0x472f79[_0x9a06('0x5e')])):path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x238b0d,_[_0x9a06('0x68')](_0x9a06('0x69')));var _0x313f84=_0x9a06('0x6a')+_[_0x9a06('0x6b')](_0x9a06('0x5e'));if(_0x472f79[_0x313f84]||!_0x5b06e1[_0x9a06('0x6c')]){_0x15b344=path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x238b0d,_['toLower'](_0x9a06('0x69')));}if(!fs['existsSync'](_0x15b344)){throw new db['Sequelize'][(_0x9a06('0x6d'))](_0x9a06('0x6e'));}return _0x5927f2[_0x9a06('0x6f')](_0x15b344);}})['catch'](handleError(_0x5927f2,null));};var utilLicense=require(_0x9a06('0x60'));exports[_0x9a06('0x70')]=function(_0x281ee2,_0xf4cafd,_0x2451a0){var _0x356d1a=_0x9a06('0x71');var _0x26675d={'custom':![]};return utilLicense['getLicense']()[_0x9a06('0x16')](function(_0x36b4de){if(_0x36b4de){_0x26675d=_0x36b4de;}return db['Setting'][_0x9a06('0x4d')]({'where':{'id':_0x281ee2[_0x9a06('0x4b')]['id']},'attributes':[_0x9a06('0x5e'),_0x9a06('0x63'),_0x9a06('0x72'),_0x9a06('0x64'),_0x9a06('0x65'),_0x9a06('0x66')],'raw':!![]});})[_0x9a06('0x16')](handleEntityNotFound(_0xf4cafd,null))['then'](function(_0x3697c0){if(_0x3697c0){var _0xcc91d1=_0x3697c0['loginLogo']&&fs[_0x9a06('0x67')](path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x356d1a,_['toLower'](_0x3697c0[_0x9a06('0x63')])))?path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x356d1a,_['toLower'](_0x3697c0[_0x9a06('0x63')])):path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x356d1a,_[_0x9a06('0x68')]('default_loginLogo.png'));var _0x24d65b=_0x9a06('0x6a')+_['upperFirst'](_0x9a06('0x63'));if(_0x3697c0[_0x24d65b]||!_0x26675d['custom']){_0xcc91d1=path[_0x9a06('0x51')](config['root'],_0x356d1a,_[_0x9a06('0x68')](_0x9a06('0x73')));}if(!fs[_0x9a06('0x67')](_0xcc91d1)){throw new db[(_0x9a06('0x74'))][(_0x9a06('0x6d'))](_0x9a06('0x6e'));}return _0xf4cafd[_0x9a06('0x6f')](_0xcc91d1);}})[_0x9a06('0x4a')](handleError(_0xf4cafd,null));};exports['gdpr']=function(_0x1fb3ee,_0x502c6e){return db[_0x9a06('0x45')]['find']({'where':{'id':_0x1fb3ee['params']['id']},'attributes':[_0x9a06('0x75')]})[_0x9a06('0x16')](respondWithResult(_0x502c6e,null))['catch'](handleError(_0x502c6e,null));};exports[_0x9a06('0x76')]=function(_0x292fe6,_0x1f4197,_0x4052d8){if(_0x292fe6[_0x9a06('0x5d')]&&_0x292fe6[_0x9a06('0x5d')][_0x9a06('0x5f')]){_0x292fe6[_0x9a06('0x4e')][_0x9a06('0x72')]=_0x292fe6['file'][_0x9a06('0x5f')];}return db['Setting']['find']({'where':{'id':_0x292fe6[_0x9a06('0x4b')]['id']}})[_0x9a06('0x16')](handleEntityNotFound(_0x1f4197,null))['then'](saveUpdates(_0x292fe6[_0x9a06('0x4e')],null))['then'](respondWithResult(_0x1f4197,null))['catch'](handleError(_0x1f4197,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x288a34,_0x121d9d,_0x4b29f2){var _0x308cec=_0x9a06('0x71');var _0x4f4a81={'custom':![]};return utilLicense[_0x9a06('0x62')]()['then'](function(_0x3ccb36){if(_0x3ccb36){_0x4f4a81=_0x3ccb36;}return db['Setting'][_0x9a06('0x4d')]({'where':{'id':_0x288a34[_0x9a06('0x4b')]['id']},'attributes':[_0x9a06('0x5e'),'loginLogo',_0x9a06('0x72'),_0x9a06('0x64'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})[_0x9a06('0x16')](handleEntityNotFound(_0x121d9d,null))[_0x9a06('0x16')](function(_0xf8665d){if(_0xf8665d){var _0x162389=_0xf8665d['preferred']&&fs[_0x9a06('0x67')](path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x308cec,_['toLower'](_0xf8665d['preferred'])))?path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x308cec,_[_0x9a06('0x68')](_0xf8665d[_0x9a06('0x72')])):path[_0x9a06('0x51')](config[_0x9a06('0x52')],_0x308cec,_[_0x9a06('0x68')](_0x9a06('0x77')));var _0x578852=_0x9a06('0x6a')+_[_0x9a06('0x6b')]('preferred');if(_0xf8665d[_0x578852]||!_0x4f4a81[_0x9a06('0x6c')]||!_0x4f4a81[_0x9a06('0x72')]){_0x162389=path[_0x9a06('0x51')](config['root'],_0x308cec,_[_0x9a06('0x68')]('default_preferred.png'));}if(!fs['existsSync'](_0x162389)){throw new db[(_0x9a06('0x74'))][(_0x9a06('0x6d'))]('Logo\x20not\x20found');}return _0x121d9d[_0x9a06('0x6f')](_0x162389);}})[_0x9a06('0x4a')](handleError(_0x121d9d,null));};
\ No newline at end of file
+var _0x5c53=['json','count','offset','set','save','update','stack','name','index','Setting','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','add','day','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','params','body','get','join','root','render','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','filename','logo','find','addLogoLogin','../../config/license/util','getLogo','getLicense','loginLogo','preferred','defaultLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','upperFirst','Sequelize','ValidationError','download','getLogoLogin','server/files/images/logos','defaultLoginLogo','Logo\x20not\x20found','securePassword','addPreferred','getPreferred','default_preferred.png','custom','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','end'];(function(_0x4ca160,_0x14886c){var _0x303ae9=function(_0xa1d94c){while(--_0xa1d94c){_0x4ca160['push'](_0x4ca160['shift']());}};_0x303ae9(++_0x14886c);}(_0x5c53,0x1ab));var _0x35c5=function(_0x14c6dd,_0x35e700){_0x14c6dd=_0x14c6dd-0x0;var _0x561904=_0x5c53[_0x14c6dd];return _0x561904;};'use strict';var pdf=require(_0x35c5('0x0'));var emlformat=require(_0x35c5('0x1'));var rimraf=require(_0x35c5('0x2'));var zipdir=require(_0x35c5('0x3'));var jsonpatch=require(_0x35c5('0x4'));var rp=require(_0x35c5('0x5'));var moment=require(_0x35c5('0x6'));var BPromise=require(_0x35c5('0x7'));var Mustache=require(_0x35c5('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x35c5('0x9'));var fs=require('fs');var _=require(_0x35c5('0xa'));var squel=require(_0x35c5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x35c5('0xc'));var toCsv=require(_0x35c5('0xd'));var querystring=require('querystring');var Papa=require(_0x35c5('0xe'));var Redis=require('ioredis');var qs=require(_0x35c5('0xf'));var logger=require(_0x35c5('0x10'))(_0x35c5('0x11'));var utils=require(_0x35c5('0x12'));var config=require(_0x35c5('0x13'));var db=require(_0x35c5('0x14'))['db'];var jayson=require(_0x35c5('0x15'));var client=jayson[_0x35c5('0x16')][_0x35c5('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x1bb17f,_0x37e0ba,_0x2e0e78,_0x10fe58){return new BPromise(function(_0x3a796b,_0x189a95){var _0x10d21d=_0x10fe58||client;return _0x10d21d['request'](_0x1bb17f,_0x2e0e78)[_0x35c5('0x18')](function(_0x2cd82c){logger[_0x35c5('0x19')](_0x35c5('0x1a'),_0x37e0ba,_0x35c5('0x1b'));logger['debug'](_0x35c5('0x1c'),_0x37e0ba,_0x35c5('0x1b'),JSON[_0x35c5('0x1d')](_0x2cd82c));if(_0x2cd82c['error']){if(_0x2cd82c['error'][_0x35c5('0x1e')]===0x1f4){logger[_0x35c5('0x1f')](_0x35c5('0x1a'),_0x37e0ba,_0x2cd82c[_0x35c5('0x1f')][_0x35c5('0x20')]);return _0x189a95(_0x2cd82c[_0x35c5('0x1f')][_0x35c5('0x20')]);}logger['error'](_0x35c5('0x1a'),_0x37e0ba,_0x2cd82c['error'][_0x35c5('0x20')]);return _0x3a796b(_0x2cd82c[_0x35c5('0x1f')][_0x35c5('0x20')]);}else{logger['info'](_0x35c5('0x1a'),_0x37e0ba,_0x35c5('0x1b'));_0x3a796b(_0x2cd82c['result'][_0x35c5('0x20')]);}})[_0x35c5('0x21')](function(_0x1fa63a){logger['error'](_0x35c5('0x1a'),_0x37e0ba,_0x1fa63a);_0x189a95(_0x1fa63a);});});}function respondWithStatusCode(_0x49df27,_0x2fba3d){_0x2fba3d=_0x2fba3d||0xcc;return function(_0x56e2c2){if(_0x56e2c2){return _0x49df27[_0x35c5('0x22')](_0x2fba3d);}return _0x49df27[_0x35c5('0x23')](_0x2fba3d)[_0x35c5('0x24')]();};}function respondWithResult(_0x441161,_0x4cd1ba){_0x4cd1ba=_0x4cd1ba||0xc8;return function(_0x4ac070){if(_0x4ac070){return _0x441161[_0x35c5('0x23')](_0x4cd1ba)[_0x35c5('0x25')](_0x4ac070);}};}function respondWithFilteredResult(_0x43fdae,_0x22eab6){return function(_0x34fe09){if(_0x34fe09){var _0xe949ac=_0x34fe09[_0x35c5('0x26')],_0x451be6=_0x22eab6[_0x35c5('0x27')],_0x1f2d06=_0x22eab6[_0x35c5('0x27')]+_0x22eab6['limit'],_0x180169;if(_0x1f2d06>=_0xe949ac){_0x1f2d06=_0xe949ac;_0x180169=0xc8;}else{_0x180169=0xce;}_0x43fdae['status'](_0x180169);return _0x43fdae[_0x35c5('0x28')]('Content-Range',_0x451be6+'-'+_0x1f2d06+'/'+_0xe949ac)[_0x35c5('0x25')](_0x34fe09);}return null;};}function patchUpdates(_0x152292){return function(_0x56a6c7){try{jsonpatch['apply'](_0x56a6c7,_0x152292,!![]);}catch(_0x6c8624){return BPromise['reject'](_0x6c8624);}return _0x56a6c7[_0x35c5('0x29')]();};}function saveUpdates(_0x39c934,_0x43e941){return function(_0xb4cd73){if(_0xb4cd73){return _0xb4cd73[_0x35c5('0x2a')](_0x39c934)[_0x35c5('0x18')](function(_0x1f343f){return _0x1f343f;});}return null;};}function removeEntity(_0xaeffaa,_0x4f1660){return function(_0x25e6f6){if(_0x25e6f6){return _0x25e6f6['destroy']()['then'](function(){_0xaeffaa['status'](0xcc)[_0x35c5('0x24')]();});}};}function handleEntityNotFound(_0x50b3a2,_0x42f3f9){return function(_0x1de3eb){if(!_0x1de3eb){_0x50b3a2[_0x35c5('0x22')](0x194);}return _0x1de3eb;};}function handleError(_0x50297f,_0x5554ad){_0x5554ad=_0x5554ad||0x1f4;return function(_0x1135de){logger[_0x35c5('0x1f')](_0x1135de[_0x35c5('0x2b')]);if(_0x1135de['name']){delete _0x1135de[_0x35c5('0x2c')];}_0x50297f[_0x35c5('0x23')](_0x5554ad)['send'](_0x1135de);};}exports[_0x35c5('0x2d')]=function(_0x5f08f0,_0x4c9ccf){var _0x3d893d={},_0x1bc3ad={},_0x4f7774={'count':0x0,'rows':[]};var _0x38095d=db[_0x35c5('0x2e')]['rawAttributes'];_0x1bc3ad[_0x35c5('0x2f')]=_[_0x35c5('0x30')](_0x38095d);var _0x558049={'dateStart':_0x5f08f0[_0x35c5('0x31')][_0x35c5('0x32')],'dateEnd':_0x5f08f0[_0x35c5('0x31')]['dateEnd']};delete _0x5f08f0['query'][_0x35c5('0x32')];delete _0x5f08f0['query'][_0x35c5('0x33')];_0x1bc3ad[_0x35c5('0x31')]=_['keys'](_0x5f08f0[_0x35c5('0x31')]);_0x1bc3ad[_0x35c5('0x34')]=_[_0x35c5('0x35')](_0x1bc3ad['model'],_0x1bc3ad[_0x35c5('0x31')]);_0x3d893d[_0x35c5('0x36')]=_['intersection'](_0x1bc3ad[_0x35c5('0x2f')],qs[_0x35c5('0x37')](_0x5f08f0[_0x35c5('0x31')][_0x35c5('0x37')]));_0x3d893d['attributes']=_0x3d893d[_0x35c5('0x36')][_0x35c5('0x38')]?_0x3d893d['attributes']:_0x1bc3ad[_0x35c5('0x2f')];if(!_0x5f08f0[_0x35c5('0x31')][_0x35c5('0x39')]('nolimit')){_0x3d893d[_0x35c5('0x3a')]=qs['limit'](_0x5f08f0[_0x35c5('0x31')][_0x35c5('0x3a')]);_0x3d893d[_0x35c5('0x27')]=qs[_0x35c5('0x27')](_0x5f08f0[_0x35c5('0x31')][_0x35c5('0x27')]);}_0x3d893d['order']=qs['sort'](_0x5f08f0[_0x35c5('0x31')][_0x35c5('0x3b')]);_0x3d893d[_0x35c5('0x3c')]=qs[_0x35c5('0x34')](_[_0x35c5('0x3d')](_0x5f08f0['query'],_0x1bc3ad[_0x35c5('0x34')]));if(_0x558049[_0x35c5('0x32')]){if(_0x558049[_0x35c5('0x33')]){_0x558049[_0x35c5('0x33')]=moment(_0x558049[_0x35c5('0x33')])[_0x35c5('0x3e')](0x1,_0x35c5('0x3f'));}else{_0x558049[_0x35c5('0x33')]=moment(_0x558049['dateStart'])[_0x35c5('0x3e')](0x1,_0x35c5('0x3f'));}_[_0x35c5('0x40')](_0x3d893d['where'],{'createdAt':{'$gte':_0x558049[_0x35c5('0x32')],'$lte':_0x558049[_0x35c5('0x33')]}});}if(_0x5f08f0[_0x35c5('0x31')]['filter']){_0x3d893d[_0x35c5('0x3c')]=_[_0x35c5('0x40')](_0x3d893d[_0x35c5('0x3c')],{'$or':_[_0x35c5('0x41')](_0x38095d,function(_0x530d14){if(_0x530d14[_0x35c5('0x42')]['key']!==_0x35c5('0x43')){var _0x47b509={};_0x47b509[_0x530d14[_0x35c5('0x44')]]={'$like':'%'+_0x5f08f0[_0x35c5('0x31')]['filter']+'%'};return _0x47b509;}})});}_0x3d893d=_[_0x35c5('0x40')]({},_0x3d893d,_0x5f08f0[_0x35c5('0x45')]);var _0x44d9ec={'where':_0x3d893d[_0x35c5('0x3c')]};return db[_0x35c5('0x2e')][_0x35c5('0x26')](_0x44d9ec)[_0x35c5('0x18')](function(_0x2cbe60){_0x4f7774['count']=_0x2cbe60;if(_0x5f08f0[_0x35c5('0x31')][_0x35c5('0x46')]){_0x3d893d[_0x35c5('0x47')]=[{'all':!![]}];}return db['Setting'][_0x35c5('0x48')](_0x3d893d);})[_0x35c5('0x18')](function(_0x1f418d){_0x4f7774['rows']=_0x1f418d;return _0x4f7774;})['then'](respondWithFilteredResult(_0x4c9ccf,_0x3d893d))[_0x35c5('0x21')](handleError(_0x4c9ccf,null));};exports['show']=function(_0x20970c,_0x45445e){var _0x107626={'raw':![],'where':{'id':_0x20970c['params']['id']}},_0x32acdf={};_0x32acdf[_0x35c5('0x2f')]=_[_0x35c5('0x30')](db['Setting']['rawAttributes']);_0x32acdf[_0x35c5('0x31')]=_[_0x35c5('0x30')](_0x20970c[_0x35c5('0x31')]);_0x32acdf[_0x35c5('0x34')]=_[_0x35c5('0x35')](_0x32acdf[_0x35c5('0x2f')],_0x32acdf['query']);_0x107626[_0x35c5('0x36')]=_[_0x35c5('0x35')](_0x32acdf['model'],qs[_0x35c5('0x37')](_0x20970c[_0x35c5('0x31')][_0x35c5('0x37')]));_0x107626['attributes']=_0x107626[_0x35c5('0x36')][_0x35c5('0x38')]?_0x107626[_0x35c5('0x36')]:_0x32acdf[_0x35c5('0x2f')];if(_0x20970c[_0x35c5('0x31')][_0x35c5('0x46')]){_0x107626[_0x35c5('0x47')]=[{'all':!![]}];}_0x107626=_[_0x35c5('0x40')]({},_0x107626,_0x20970c[_0x35c5('0x45')]);return db[_0x35c5('0x2e')]['find'](_0x107626)[_0x35c5('0x18')](handleEntityNotFound(_0x45445e,null))[_0x35c5('0x18')](respondWithResult(_0x45445e,null))['catch'](handleError(_0x45445e,null));};exports[_0x35c5('0x2a')]=function(_0xc3ae90,_0x224139,_0x31a293){var _0x24a92c;return db[_0x35c5('0x2e')]['find']({'where':{'id':_0xc3ae90[_0x35c5('0x49')]['id']}})[_0x35c5('0x18')](handleEntityNotFound(_0x224139,null))[_0x35c5('0x18')](saveUpdates(_0xc3ae90[_0x35c5('0x4a')],null))[_0x35c5('0x18')](function(_0x12947e){if(_0x12947e){_0x24a92c=_0x12947e[_0x35c5('0x4b')]({'plain':!![]});var _0x4e40e8=fs['readFileSync'](path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],'server/files/templates/stun.ejs'),'utf8');var _0xb52021=ejs[_0x35c5('0x4e')](_0x4e40e8,_0x24a92c);var _0x280902=fs['readFileSync'](path[_0x35c5('0x4c')](config['root'],_0x35c5('0x4f')),'utf8');var _0x1d749b=ejs['render'](_0x280902,_0x24a92c);fs[_0x35c5('0x50')](_0x35c5('0x51'),_0xb52021);fs['writeFileSync'](_0x35c5('0x52'),_0x1d749b);return respondWithRpcPromise('Reload',_0x35c5('0x2a'),{'module':_0x35c5('0x53')});}})['then'](function(){return respondWithRpcPromise(_0x35c5('0x54'),_0x35c5('0x2a'),{'module':_0x35c5('0x55')});})['then'](function(){return _0x24a92c||null;})['then'](respondWithResult(_0x224139,null))[_0x35c5('0x21')](handleError(_0x224139,null));};exports[_0x35c5('0x56')]=function(_0x1c819b,_0x34b915,_0x89eee8){if(_0x1c819b[_0x35c5('0x57')]&&_0x1c819b[_0x35c5('0x57')][_0x35c5('0x58')]){_0x1c819b[_0x35c5('0x4a')][_0x35c5('0x59')]=_0x1c819b[_0x35c5('0x57')][_0x35c5('0x58')];}return db[_0x35c5('0x2e')][_0x35c5('0x5a')]({'where':{'id':_0x1c819b[_0x35c5('0x49')]['id']}})[_0x35c5('0x18')](handleEntityNotFound(_0x34b915,null))['then'](saveUpdates(_0x1c819b['body'],null))[_0x35c5('0x18')](respondWithResult(_0x34b915,null))['catch'](handleError(_0x34b915,null));};exports[_0x35c5('0x5b')]=function(_0x128e8f,_0x4fe7fc,_0x6208c6){if(_0x128e8f[_0x35c5('0x57')]&&_0x128e8f[_0x35c5('0x57')][_0x35c5('0x58')]){_0x128e8f['body']['loginLogo']=_0x128e8f[_0x35c5('0x57')][_0x35c5('0x58')];}return db[_0x35c5('0x2e')]['find']({'where':{'id':_0x128e8f[_0x35c5('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fe7fc,null))[_0x35c5('0x18')](saveUpdates(_0x128e8f[_0x35c5('0x4a')],null))[_0x35c5('0x18')](respondWithResult(_0x4fe7fc,null))['catch'](handleError(_0x4fe7fc,null));};var utilLicense=require(_0x35c5('0x5c'));exports[_0x35c5('0x5d')]=function(_0xe911f8,_0x435656,_0x2e216a){var _0x371c66='server/files/images/logos';var _0xb582d3={'custom':![]};return utilLicense[_0x35c5('0x5e')]()[_0x35c5('0x18')](function(_0x4b54de){if(_0x4b54de){_0xb582d3=_0x4b54de;}return db[_0x35c5('0x2e')][_0x35c5('0x5a')]({'where':{'id':_0xe911f8[_0x35c5('0x49')]['id']},'attributes':[_0x35c5('0x59'),_0x35c5('0x5f'),_0x35c5('0x60'),_0x35c5('0x61'),'defaultLoginLogo',_0x35c5('0x62')],'raw':!![]});})[_0x35c5('0x18')](handleEntityNotFound(_0x435656,null))[_0x35c5('0x18')](function(_0x4f1542){if(_0x4f1542){var _0x4bf056=_0x4f1542[_0x35c5('0x59')]&&fs[_0x35c5('0x63')](path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x371c66,_[_0x35c5('0x64')](_0x4f1542[_0x35c5('0x59')])))?path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x371c66,_[_0x35c5('0x64')](_0x4f1542['logo'])):path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x371c66,_['toLower'](_0x35c5('0x65')));var _0x324d55=_0x35c5('0x66')+_[_0x35c5('0x67')](_0x35c5('0x59'));if(_0x4f1542[_0x324d55]||!_0xb582d3['custom']){_0x4bf056=path[_0x35c5('0x4c')](config['root'],_0x371c66,_[_0x35c5('0x64')](_0x35c5('0x65')));}if(!fs['existsSync'](_0x4bf056)){throw new db[(_0x35c5('0x68'))][(_0x35c5('0x69'))]('Logo\x20not\x20found');}return _0x435656[_0x35c5('0x6a')](_0x4bf056);}})['catch'](handleError(_0x435656,null));};var utilLicense=require('../../config/license/util');exports[_0x35c5('0x6b')]=function(_0x492f97,_0x234546,_0x133a18){var _0x4eb84d=_0x35c5('0x6c');var _0x435c99={'custom':![]};return utilLicense[_0x35c5('0x5e')]()[_0x35c5('0x18')](function(_0x5150f6){if(_0x5150f6){_0x435c99=_0x5150f6;}return db[_0x35c5('0x2e')][_0x35c5('0x5a')]({'where':{'id':_0x492f97[_0x35c5('0x49')]['id']},'attributes':[_0x35c5('0x59'),_0x35c5('0x5f'),_0x35c5('0x60'),'defaultLogo',_0x35c5('0x6d'),'defaultPreferred'],'raw':!![]});})[_0x35c5('0x18')](handleEntityNotFound(_0x234546,null))[_0x35c5('0x18')](function(_0x47656c){if(_0x47656c){var _0x516ce6=_0x47656c[_0x35c5('0x5f')]&&fs['existsSync'](path[_0x35c5('0x4c')](config['root'],_0x4eb84d,_[_0x35c5('0x64')](_0x47656c[_0x35c5('0x5f')])))?path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x4eb84d,_['toLower'](_0x47656c['loginLogo'])):path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x4eb84d,_[_0x35c5('0x64')]('default_loginLogo.png'));var _0x46c056=_0x35c5('0x66')+_['upperFirst']('loginLogo');if(_0x47656c[_0x46c056]||!_0x435c99['custom']){_0x516ce6=path['join'](config[_0x35c5('0x4d')],_0x4eb84d,_[_0x35c5('0x64')]('default_loginLogo.png'));}if(!fs['existsSync'](_0x516ce6)){throw new db[(_0x35c5('0x68'))][(_0x35c5('0x69'))](_0x35c5('0x6e'));}return _0x234546[_0x35c5('0x6a')](_0x516ce6);}})['catch'](handleError(_0x234546,null));};exports['gdpr']=function(_0x5ddb77,_0x387bc6){return db[_0x35c5('0x2e')]['find']({'where':{'id':_0x5ddb77[_0x35c5('0x49')]['id']},'attributes':[_0x35c5('0x6f')]})[_0x35c5('0x18')](respondWithResult(_0x387bc6,null))['catch'](handleError(_0x387bc6,null));};exports[_0x35c5('0x70')]=function(_0x57c0b1,_0x2d309e,_0x5e8c81){if(_0x57c0b1[_0x35c5('0x57')]&&_0x57c0b1['file'][_0x35c5('0x58')]){_0x57c0b1['body']['preferred']=_0x57c0b1[_0x35c5('0x57')][_0x35c5('0x58')];}return db[_0x35c5('0x2e')][_0x35c5('0x5a')]({'where':{'id':_0x57c0b1[_0x35c5('0x49')]['id']}})[_0x35c5('0x18')](handleEntityNotFound(_0x2d309e,null))['then'](saveUpdates(_0x57c0b1[_0x35c5('0x4a')],null))[_0x35c5('0x18')](respondWithResult(_0x2d309e,null))[_0x35c5('0x21')](handleError(_0x2d309e,null));};var utilLicense=require(_0x35c5('0x5c'));exports[_0x35c5('0x71')]=function(_0x2632a7,_0x4f0d4d,_0x495f42){var _0x11fa2c=_0x35c5('0x6c');var _0x355826={'custom':![]};return utilLicense[_0x35c5('0x5e')]()[_0x35c5('0x18')](function(_0x120a12){if(_0x120a12){_0x355826=_0x120a12;}return db[_0x35c5('0x2e')][_0x35c5('0x5a')]({'where':{'id':_0x2632a7[_0x35c5('0x49')]['id']},'attributes':['logo',_0x35c5('0x5f'),_0x35c5('0x60'),_0x35c5('0x61'),_0x35c5('0x6d'),_0x35c5('0x62')],'raw':!![]});})[_0x35c5('0x18')](handleEntityNotFound(_0x4f0d4d,null))['then'](function(_0x5b23bd){if(_0x5b23bd){var _0x4d6715=_0x5b23bd['preferred']&&fs[_0x35c5('0x63')](path[_0x35c5('0x4c')](config['root'],_0x11fa2c,_[_0x35c5('0x64')](_0x5b23bd[_0x35c5('0x60')])))?path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x11fa2c,_[_0x35c5('0x64')](_0x5b23bd[_0x35c5('0x60')])):path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x11fa2c,_[_0x35c5('0x64')](_0x35c5('0x72')));var _0x43d93f=_0x35c5('0x66')+_[_0x35c5('0x67')](_0x35c5('0x60'));if(_0x5b23bd[_0x43d93f]||!_0x355826[_0x35c5('0x73')]||!_0x355826['preferred']){_0x4d6715=path[_0x35c5('0x4c')](config[_0x35c5('0x4d')],_0x11fa2c,_[_0x35c5('0x64')]('default_preferred.png'));}if(!fs[_0x35c5('0x63')](_0x4d6715)){throw new db[(_0x35c5('0x68'))][(_0x35c5('0x69'))](_0x35c5('0x6e'));}return _0x4f0d4d[_0x35c5('0x6a')](_0x4d6715);}})[_0x35c5('0x21')](handleError(_0x4f0d4d,null));};
\ No newline at end of file
index 5b61bb8..c2f5906 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4caf=['util','api','request-promise','./setting.attributes','exports','define','Setting','settings'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0x4caf,0xf0));var _0xf4ca=function(_0x4bbf07,_0x5be510){_0x4bbf07=_0x4bbf07-0x0;var _0x5b2e97=_0x4caf[_0x4bbf07];return _0x5b2e97;};'use strict';var _=require('lodash');var util=require(_0xf4ca('0x0'));var logger=require('../../config/logger')(_0xf4ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf4ca('0x2'));var attributes=require(_0xf4ca('0x3'));module[_0xf4ca('0x4')]=function(_0x1c0752,_0x1d7048){return _0x1c0752[_0xf4ca('0x5')](_0xf4ca('0x6'),attributes,{'tableName':_0xf4ca('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9078=['request-promise','exports','define','Setting','settings','lodash','util','api','moment'];(function(_0x4deb0f,_0x435083){var _0x45345e=function(_0x792fc9){while(--_0x792fc9){_0x4deb0f['push'](_0x4deb0f['shift']());}};_0x45345e(++_0x435083);}(_0x9078,0xc2));var _0x8907=function(_0x20fabd,_0x41b3e7){_0x20fabd=_0x20fabd-0x0;var _0x29d75f=_0x9078[_0x20fabd];return _0x29d75f;};'use strict';var _=require(_0x8907('0x0'));var util=require(_0x8907('0x1'));var logger=require('../../config/logger')(_0x8907('0x2'));var moment=require(_0x8907('0x3'));var BPromise=require('bluebird');var rp=require(_0x8907('0x4'));var attributes=require('./setting.attributes');module[_0x8907('0x5')]=function(_0xeba0c7,_0x1faaa3){return _0xeba0c7[_0x8907('0x6')](_0x8907('0x7'),attributes,{'tableName':_0x8907('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8268db..ae6e358 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa52d=['then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request'];(function(_0x3c3d2d,_0x3725a6){var _0x354bc2=function(_0x3b1207){while(--_0x3b1207){_0x3c3d2d['push'](_0x3c3d2d['shift']());}};_0x354bc2(++_0x3725a6);}(_0xa52d,0x97));var _0xda52=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0xa52d[_0xaaf2e2];return _0x28bc36;};'use strict';var _=require('lodash');var util=require(_0xda52('0x0'));var moment=require(_0xda52('0x1'));var BPromise=require(_0xda52('0x2'));var rs=require(_0xda52('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda52('0x4'))['db'];var utils=require(_0xda52('0x5'));var logger=require(_0xda52('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda52('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e7a78,_0x2880e4,_0x5ae34c){return new BPromise(function(_0x6a0b1f,_0x47e563){return client[_0xda52('0x8')](_0x1e7a78,_0x5ae34c)[_0xda52('0x9')](function(_0x322cb4){logger[_0xda52('0xa')](_0xda52('0xb'),_0x2880e4,'request\x20sent');logger[_0xda52('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x2880e4,_0xda52('0xd'),JSON[_0xda52('0xe')](_0x322cb4));if(_0x322cb4[_0xda52('0xf')]){if(_0x322cb4[_0xda52('0xf')][_0xda52('0x10')]===0x1f4){logger[_0xda52('0xf')](_0xda52('0xb'),_0x2880e4,_0x322cb4[_0xda52('0xf')][_0xda52('0x11')]);return _0x47e563(_0x322cb4[_0xda52('0xf')][_0xda52('0x11')]);}logger['error'](_0xda52('0xb'),_0x2880e4,_0x322cb4['error'][_0xda52('0x11')]);return _0x6a0b1f(_0x322cb4['error'][_0xda52('0x11')]);}else{logger['info'](_0xda52('0xb'),_0x2880e4,'request\x20sent');_0x6a0b1f(_0x322cb4[_0xda52('0x12')][_0xda52('0x11')]);}})[_0xda52('0x13')](function(_0x45c5d7){logger[_0xda52('0xf')]('Setting,\x20%s,\x20%s',_0x2880e4,_0x45c5d7);_0x47e563(_0x45c5d7);});});}
\ No newline at end of file
+var _0x8057=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8057,0x13f));var _0x7805=function(_0x1e69d5,_0x14dfe8){_0x1e69d5=_0x1e69d5-0x0;var _0x547518=_0x8057[_0x1e69d5];return _0x547518;};'use strict';var _=require(_0x7805('0x0'));var util=require(_0x7805('0x1'));var moment=require(_0x7805('0x2'));var BPromise=require(_0x7805('0x3'));var rs=require(_0x7805('0x4'));var fs=require('fs');var Redis=require(_0x7805('0x5'));var db=require(_0x7805('0x6'))['db'];var utils=require(_0x7805('0x7'));var logger=require(_0x7805('0x8'))(_0x7805('0x9'));var config=require(_0x7805('0xa'));var jayson=require(_0x7805('0xb'));var client=jayson['client'][_0x7805('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50d65b,_0x629594,_0x27099f){return new BPromise(function(_0x53518d,_0x5744aa){return client[_0x7805('0xd')](_0x50d65b,_0x27099f)[_0x7805('0xe')](function(_0x1d4053){logger[_0x7805('0xf')](_0x7805('0x10'),_0x629594,'request\x20sent');logger[_0x7805('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x629594,'request\x20sent',JSON[_0x7805('0x12')](_0x1d4053));if(_0x1d4053[_0x7805('0x13')]){if(_0x1d4053['error'][_0x7805('0x14')]===0x1f4){logger['error'](_0x7805('0x10'),_0x629594,_0x1d4053[_0x7805('0x13')][_0x7805('0x15')]);return _0x5744aa(_0x1d4053[_0x7805('0x13')]['message']);}logger['error'](_0x7805('0x10'),_0x629594,_0x1d4053[_0x7805('0x13')][_0x7805('0x15')]);return _0x53518d(_0x1d4053[_0x7805('0x13')][_0x7805('0x15')]);}else{logger[_0x7805('0xf')](_0x7805('0x10'),_0x629594,'request\x20sent');_0x53518d(_0x1d4053[_0x7805('0x16')][_0x7805('0x15')]);}})[_0x7805('0x17')](function(_0xce838f){logger[_0x7805('0x13')](_0x7805('0x10'),_0x629594,_0xce838f);_0x5744aa(_0xce838f);});});}
\ No newline at end of file
index dd1a966..c4c1fbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9546=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users'];(function(_0x314f65,_0x304354){var _0x5fd673=function(_0x4195fe){while(--_0x4195fe){_0x314f65['push'](_0x314f65['shift']());}};_0x5fd673(++_0x304354);}(_0x9546,0x1c4));var _0x6954=function(_0x5c31f4,_0x446a83){_0x5c31f4=_0x5c31f4-0x0;var _0x2583bf=_0x9546[_0x5c31f4];return _0x2583bf;};'use strict';var multer=require(_0x6954('0x0'));var util=require(_0x6954('0x1'));var path=require(_0x6954('0x2'));var timeout=require(_0x6954('0x3'));var express=require(_0x6954('0x4'));var router=express[_0x6954('0x5')]();var auth=require(_0x6954('0x6'));var interaction=require(_0x6954('0x7'));var config=require(_0x6954('0x8'));var controller=require(_0x6954('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6954('0xa'),auth[_0x6954('0xb')](),controller[_0x6954('0xc')]);router[_0x6954('0xd')](_0x6954('0xe'),auth['isAuthenticated'](),controller[_0x6954('0xf')]);router[_0x6954('0xd')](_0x6954('0x10'),auth[_0x6954('0xb')](),controller[_0x6954('0x11')]);router[_0x6954('0xd')](_0x6954('0x12'),auth[_0x6954('0xb')](),controller[_0x6954('0x13')]);router[_0x6954('0xd')]('/:id/applications',auth['isAuthenticated'](),controller[_0x6954('0x14')]);router['get'](_0x6954('0x15'),auth[_0x6954('0xb')](),controller[_0x6954('0x16')]);router[_0x6954('0xd')](_0x6954('0x17'),controller[_0x6954('0x18')]);router['get']('/:id/users',auth[_0x6954('0xb')](),controller[_0x6954('0x19')]);router[_0x6954('0x1a')]('/',auth['isAuthenticated'](),controller[_0x6954('0x1b')]);router['post'](_0x6954('0x10'),auth[_0x6954('0xb')](),controller[_0x6954('0x1c')]);router[_0x6954('0x1a')](_0x6954('0x12'),auth['isAuthenticated'](),controller[_0x6954('0x1d')]);router[_0x6954('0x1a')](_0x6954('0x1e'),controller[_0x6954('0x1f')]);router[_0x6954('0x1a')](_0x6954('0x20'),auth[_0x6954('0xb')](),controller[_0x6954('0x21')]);router['post'](_0x6954('0x22'),auth[_0x6954('0xb')](),controller[_0x6954('0x23')]);router[_0x6954('0x1a')](_0x6954('0x17'),controller['status']);router['post']('/:id/users',auth[_0x6954('0xb')](),controller['addAgents']);router[_0x6954('0x24')](_0x6954('0xe'),auth['isAuthenticated'](),controller[_0x6954('0x25')]);router[_0x6954('0x26')](_0x6954('0xe'),auth['isAuthenticated'](),controller[_0x6954('0x27')]);router['delete'](_0x6954('0x10'),auth[_0x6954('0xb')](),controller[_0x6954('0x28')]);router['delete'](_0x6954('0x12'),auth['isAuthenticated'](),controller[_0x6954('0x29')]);router[_0x6954('0x26')](_0x6954('0x2a'),auth[_0x6954('0xb')](),controller[_0x6954('0x2b')]);module[_0x6954('0x2c')]=router;
\ No newline at end of file
+var _0xc026=['/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','addAnswer','/:id/notify','notify','addApplications','send','/:id/status','status','/:id/users','put','delete','destroy','removeAnswers','removeAgents','exports','util','path','express','Router','../../components/auth/service','./smsAccount.controller','get','isAuthenticated','index'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xc026,0x1be));var _0x6c02=function(_0x7b7f5f,_0x2d472b){_0x7b7f5f=_0x7b7f5f-0x0;var _0x35e97f=_0xc026[_0x7b7f5f];return _0x35e97f;};'use strict';var multer=require('multer');var util=require(_0x6c02('0x0'));var path=require(_0x6c02('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c02('0x2'));var router=express[_0x6c02('0x3')]();var auth=require(_0x6c02('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6c02('0x5'));router[_0x6c02('0x6')]('/',auth[_0x6c02('0x7')](),controller[_0x6c02('0x8')]);router['get'](_0x6c02('0x9'),auth[_0x6c02('0x7')](),controller['describe']);router[_0x6c02('0x6')](_0x6c02('0xa'),auth[_0x6c02('0x7')](),controller['show']);router[_0x6c02('0x6')](_0x6c02('0xb'),auth[_0x6c02('0x7')](),controller[_0x6c02('0xc')]);router['get'](_0x6c02('0xd'),auth[_0x6c02('0x7')](),controller[_0x6c02('0xe')]);router[_0x6c02('0x6')](_0x6c02('0xf'),auth[_0x6c02('0x7')](),controller[_0x6c02('0x10')]);router[_0x6c02('0x6')](_0x6c02('0x11'),auth[_0x6c02('0x7')](),controller[_0x6c02('0x12')]);router[_0x6c02('0x6')]('/:id/status',controller['statusGet']);router[_0x6c02('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x6c02('0x13')]);router[_0x6c02('0x14')]('/',auth[_0x6c02('0x7')](),controller['create']);router[_0x6c02('0x14')](_0x6c02('0xb'),auth[_0x6c02('0x7')](),controller['addDisposition']);router[_0x6c02('0x14')]('/:id/canned_answers',auth[_0x6c02('0x7')](),controller[_0x6c02('0x15')]);router[_0x6c02('0x14')](_0x6c02('0x16'),controller[_0x6c02('0x17')]);router['post'](_0x6c02('0xf'),auth[_0x6c02('0x7')](),controller[_0x6c02('0x18')]);router[_0x6c02('0x14')]('/:id/send',auth[_0x6c02('0x7')](),controller[_0x6c02('0x19')]);router['post'](_0x6c02('0x1a'),controller[_0x6c02('0x1b')]);router['post'](_0x6c02('0x1c'),auth[_0x6c02('0x7')](),controller['addAgents']);router[_0x6c02('0x1d')]('/:id',auth[_0x6c02('0x7')](),controller['update']);router[_0x6c02('0x1e')](_0x6c02('0xa'),auth[_0x6c02('0x7')](),controller[_0x6c02('0x1f')]);router[_0x6c02('0x1e')](_0x6c02('0xb'),auth[_0x6c02('0x7')](),controller['removeDispositions']);router[_0x6c02('0x1e')](_0x6c02('0xd'),auth[_0x6c02('0x7')](),controller[_0x6c02('0x20')]);router[_0x6c02('0x1e')](_0x6c02('0x1c'),auth['isAuthenticated'](),controller[_0x6c02('0x21')]);module[_0x6c02('0x22')]=router;
\ No newline at end of file
index 48e182d..e66c713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb7=['name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','exports'];(function(_0x4540fe,_0x2d685f){var _0x54fc9f=function(_0x54bea8){while(--_0x54bea8){_0x4540fe['push'](_0x4540fe['shift']());}};_0x54fc9f(++_0x2d685f);}(_0x3cb7,0xcf));var _0x73cb=function(_0x15eb63,_0xd3f629){_0x15eb63=_0x15eb63-0x0;var _0x19fc81=_0x3cb7[_0x15eb63];return _0x19fc81;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x73cb('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x73cb('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x73cb('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x73cb('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x73cb('0x2')],'defaultValue':function(){return rs[_0x73cb('0x3')]();}},'phone':{'type':Sequelize[_0x73cb('0x2')]},'type':{'type':Sequelize[_0x73cb('0x4')](_0x73cb('0x5'),'skebby',_0x73cb('0x6'),_0x73cb('0x7'),_0x73cb('0x8'),_0x73cb('0x9'),_0x73cb('0xa'),'infobip',_0x73cb('0xb'))},'accountSid':{'type':Sequelize[_0x73cb('0x2')]},'authId':{'type':Sequelize[_0x73cb('0x2')]},'authToken':{'type':Sequelize[_0x73cb('0x2')]},'smsMethod':{'type':Sequelize[_0x73cb('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x73cb('0x2')]},'password':{'type':Sequelize[_0x73cb('0x2')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x73cb('0x2')]},'deliveryReport':{'type':Sequelize[_0x73cb('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x73cb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x73cb('0xd')],'defaultValue':function(){return _0x73cb('0xe');}},'notificationSound':{'type':Sequelize[_0x73cb('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x73cb('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x73cb('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x73cb('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x73cb('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x73cb('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x73cb('0x2')]}};
\ No newline at end of file
+var _0x58a0=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','sequelize','randomstring','STRING','generate','twilio','skebby','connectel','clicksend','plivo','csc','infobip','intelepeer','ENUM','BOOLEAN','TEXT'];(function(_0x24f98b,_0x55e210){var _0x352d62=function(_0x306d67){while(--_0x306d67){_0x24f98b['push'](_0x24f98b['shift']());}};_0x352d62(++_0x55e210);}(_0x58a0,0xce));var _0x058a=function(_0xa84046,_0x456128){_0xa84046=_0xa84046-0x0;var _0x156dae=_0x58a0[_0xa84046];return _0x156dae;};'use strict';var Sequelize=require(_0x058a('0x0'));var rs=require(_0x058a('0x1'));module['exports']={'name':{'type':Sequelize[_0x058a('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x058a('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x058a('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x058a('0x2')],'defaultValue':function(){return rs[_0x058a('0x3')]();}},'phone':{'type':Sequelize[_0x058a('0x2')]},'type':{'type':Sequelize['ENUM'](_0x058a('0x4'),_0x058a('0x5'),_0x058a('0x6'),_0x058a('0x7'),_0x058a('0x8'),'clickatell',_0x058a('0x9'),_0x058a('0xa'),_0x058a('0xb'))},'accountSid':{'type':Sequelize[_0x058a('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x058a('0x2')]},'smsMethod':{'type':Sequelize[_0x058a('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x058a('0x2')]},'password':{'type':Sequelize[_0x058a('0x2')]},'apiKey':{'type':Sequelize[_0x058a('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x058a('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x058a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x058a('0xe')],'defaultValue':function(){return _0x058a('0xf');}},'notificationSound':{'type':Sequelize[_0x058a('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x058a('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x058a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x058a('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x058a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x058a('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x058a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0d567d2..64a1ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x482d=['findAll','rows','show','params','SmsAccount','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','SmsApplication','Applications','account','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','From','messageId','skebby','sender','text','connectel','from','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','omit','Contacts','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','applications','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','spread','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','intelepeer','redif','DELIVERED','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','message-id','state','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','count','offset','set','Content-Range','json','apply','save','update','UserProfileResource','stack','name','send','index','rawAttributes','model','query','dateStart','dateEnd','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','add','day','merge','where','filter','map','type','key','VIRTUAL','options','includeAll','include'];(function(_0x299ec8,_0x358b44){var _0x25b11e=function(_0x140735){while(--_0x140735){_0x299ec8['push'](_0x299ec8['shift']());}};_0x25b11e(++_0x358b44);}(_0x482d,0x16c));var _0xd482=function(_0x2faa5d,_0x5cd0c7){_0x2faa5d=_0x2faa5d-0x0;var _0x20607d=_0x482d[_0x2faa5d];return _0x20607d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd482('0x0'));var zipdir=require(_0xd482('0x1'));var jsonpatch=require(_0xd482('0x2'));var rp=require(_0xd482('0x3'));var moment=require(_0xd482('0x4'));var BPromise=require(_0xd482('0x5'));var Mustache=require('mustache');var util=require(_0xd482('0x6'));var path=require(_0xd482('0x7'));var sox=require(_0xd482('0x8'));var csv=require('to-csv');var ejs=require(_0xd482('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd482('0xa'));var deskjs=require(_0xd482('0xb'));var toCsv=require(_0xd482('0xc'));var querystring=require('querystring');var Papa=require(_0xd482('0xd'));var Redis=require(_0xd482('0xe'));var qs=require(_0xd482('0xf'));var logger=require(_0xd482('0x10'))(_0xd482('0x11'));var utils=require(_0xd482('0x12'));var config=require(_0xd482('0x13'));var db=require(_0xd482('0x14'))['db'];config['redis']=_[_0xd482('0x15')](config[_0xd482('0x16')],{'host':_0xd482('0x17'),'port':0x18eb});var socket=require(_0xd482('0x18'))(new Redis(config['redis']));require(_0xd482('0x19'))[_0xd482('0x1a')](socket);var jayson=require(_0xd482('0x1b'));var client=jayson['client'][_0xd482('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x56d516,_0x5c5eaa,_0x2aa7f4,_0x5420dc){return new BPromise(function(_0x3b6849,_0x3e7067){var _0x494272=_0x5420dc||client;return _0x494272[_0xd482('0x1d')](_0x56d516,_0x2aa7f4)[_0xd482('0x1e')](function(_0x319c97){logger[_0xd482('0x1f')](_0xd482('0x20'),_0x5c5eaa,'request\x20sent');logger[_0xd482('0x21')](_0xd482('0x22'),_0x5c5eaa,_0xd482('0x23'),JSON['stringify'](_0x319c97));if(_0x319c97[_0xd482('0x24')]){if(_0x319c97[_0xd482('0x24')][_0xd482('0x25')]===0x1f4){logger[_0xd482('0x24')](_0xd482('0x20'),_0x5c5eaa,_0x319c97['error']['message']);return _0x3e7067(_0x319c97['error'][_0xd482('0x26')]);}logger[_0xd482('0x24')](_0xd482('0x20'),_0x5c5eaa,_0x319c97['error'][_0xd482('0x26')]);return _0x3b6849(_0x319c97[_0xd482('0x24')][_0xd482('0x26')]);}else{logger[_0xd482('0x1f')](_0xd482('0x20'),_0x5c5eaa,_0xd482('0x23'));_0x3b6849(_0x319c97[_0xd482('0x27')][_0xd482('0x26')]);}})['catch'](function(_0x3a6bba){logger[_0xd482('0x24')](_0xd482('0x20'),_0x5c5eaa,_0x3a6bba);_0x3e7067(_0x3a6bba);});});}function respondWithStatusCode(_0xc3fb6e,_0x3b4ac2){_0x3b4ac2=_0x3b4ac2||0xcc;return function(_0x1aa81c){if(_0x1aa81c){return _0xc3fb6e[_0xd482('0x28')](_0x3b4ac2);}return _0xc3fb6e[_0xd482('0x29')](_0x3b4ac2)['end']();};}function respondWithResult(_0x4d9351,_0x40ee1b){_0x40ee1b=_0x40ee1b||0xc8;return function(_0x5a78cb){if(_0x5a78cb){return _0x4d9351[_0xd482('0x29')](_0x40ee1b)['json'](_0x5a78cb);}};}function respondWithFilteredResult(_0x47ce2d,_0x5e4bed){return function(_0x11ca6d){if(_0x11ca6d){var _0x5be9b4=_0x11ca6d[_0xd482('0x2a')],_0x400cbc=_0x5e4bed[_0xd482('0x2b')],_0x120906=_0x5e4bed['offset']+_0x5e4bed['limit'],_0x3654fa;if(_0x120906>=_0x5be9b4){_0x120906=_0x5be9b4;_0x3654fa=0xc8;}else{_0x3654fa=0xce;}_0x47ce2d[_0xd482('0x29')](_0x3654fa);return _0x47ce2d[_0xd482('0x2c')](_0xd482('0x2d'),_0x400cbc+'-'+_0x120906+'/'+_0x5be9b4)[_0xd482('0x2e')](_0x11ca6d);}return null;};}function patchUpdates(_0x5905c8){return function(_0x43f952){try{jsonpatch[_0xd482('0x2f')](_0x43f952,_0x5905c8,!![]);}catch(_0x203869){return BPromise['reject'](_0x203869);}return _0x43f952[_0xd482('0x30')]();};}function saveUpdates(_0x377706,_0x367b53){return function(_0x486484){if(_0x486484){return _0x486484[_0xd482('0x31')](_0x377706)['then'](function(_0x39a7e2){return _0x39a7e2;});}return null;};}function removeEntity(_0xdb3ea,_0x315ac4){return function(_0x2000c1){if(_0x2000c1){return _0x2000c1['destroy']()[_0xd482('0x1e')](function(){var _0x150b08=_0x2000c1['get']({'plain':!![]});var _0x42e3fc='SmsAccounts';return db[_0xd482('0x32')]['destroy']({'where':{'type':_0x42e3fc,'resourceId':_0x150b08['id']}})['then'](function(){return _0x2000c1;});})['then'](function(){_0xdb3ea[_0xd482('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26447a,_0x11bab1){return function(_0x46d858){if(!_0x46d858){_0x26447a[_0xd482('0x28')](0x194);}return _0x46d858;};}function handleError(_0xdca47c,_0x5687eb){_0x5687eb=_0x5687eb||0x1f4;return function(_0x14ed14){logger[_0xd482('0x24')](_0x14ed14[_0xd482('0x33')]);if(_0x14ed14[_0xd482('0x34')]){delete _0x14ed14[_0xd482('0x34')];}_0xdca47c[_0xd482('0x29')](_0x5687eb)[_0xd482('0x35')](_0x14ed14);};}exports[_0xd482('0x36')]=function(_0x57edae,_0x544081){var _0x1cc4be={},_0x3e2978={},_0x3d4440={'count':0x0,'rows':[]};var _0x50ae05=db['SmsAccount'][_0xd482('0x37')];_0x3e2978[_0xd482('0x38')]=_['keys'](_0x50ae05);var _0x4a1f52={'dateStart':_0x57edae[_0xd482('0x39')][_0xd482('0x3a')],'dateEnd':_0x57edae[_0xd482('0x39')][_0xd482('0x3b')]};delete _0x57edae[_0xd482('0x39')][_0xd482('0x3a')];delete _0x57edae[_0xd482('0x39')]['dateEnd'];_0x3e2978[_0xd482('0x39')]=_[_0xd482('0x3c')](_0x57edae[_0xd482('0x39')]);_0x3e2978[_0xd482('0x3d')]=_['intersection'](_0x3e2978[_0xd482('0x38')],_0x3e2978[_0xd482('0x39')]);_0x1cc4be[_0xd482('0x3e')]=_[_0xd482('0x3f')](_0x3e2978[_0xd482('0x38')],qs[_0xd482('0x40')](_0x57edae['query'][_0xd482('0x40')]));_0x1cc4be['attributes']=_0x1cc4be['attributes'][_0xd482('0x41')]?_0x1cc4be['attributes']:_0x3e2978['model'];if(!_0x57edae[_0xd482('0x39')]['hasOwnProperty'](_0xd482('0x42'))){_0x1cc4be[_0xd482('0x43')]=qs[_0xd482('0x43')](_0x57edae[_0xd482('0x39')]['limit']);_0x1cc4be[_0xd482('0x2b')]=qs[_0xd482('0x2b')](_0x57edae[_0xd482('0x39')][_0xd482('0x2b')]);}_0x1cc4be['order']=qs[_0xd482('0x44')](_0x57edae[_0xd482('0x39')]['sort']);_0x1cc4be['where']=qs[_0xd482('0x3d')](_[_0xd482('0x45')](_0x57edae[_0xd482('0x39')],_0x3e2978[_0xd482('0x3d')]));if(_0x4a1f52['dateStart']){if(_0x4a1f52[_0xd482('0x3b')]){_0x4a1f52[_0xd482('0x3b')]=moment(_0x4a1f52['dateEnd'])[_0xd482('0x46')](0x1,_0xd482('0x47'));}else{_0x4a1f52[_0xd482('0x3b')]=moment(_0x4a1f52[_0xd482('0x3a')])[_0xd482('0x46')](0x1,_0xd482('0x47'));}_[_0xd482('0x48')](_0x1cc4be[_0xd482('0x49')],{'createdAt':{'$gte':_0x4a1f52[_0xd482('0x3a')],'$lte':_0x4a1f52[_0xd482('0x3b')]}});}if(_0x57edae['query'][_0xd482('0x4a')]){_0x1cc4be[_0xd482('0x49')]=_[_0xd482('0x48')](_0x1cc4be[_0xd482('0x49')],{'$or':_[_0xd482('0x4b')](_0x50ae05,function(_0x38451d){if(_0x38451d[_0xd482('0x4c')][_0xd482('0x4d')]!==_0xd482('0x4e')){var _0x2ca18b={};_0x2ca18b[_0x38451d['field']]={'$like':'%'+_0x57edae[_0xd482('0x39')][_0xd482('0x4a')]+'%'};return _0x2ca18b;}})});}_0x1cc4be=_['merge']({},_0x1cc4be,_0x57edae[_0xd482('0x4f')]);var _0x8cd742={'where':_0x1cc4be['where']};return db['SmsAccount']['count'](_0x8cd742)[_0xd482('0x1e')](function(_0x511e12){_0x3d4440[_0xd482('0x2a')]=_0x511e12;if(_0x57edae[_0xd482('0x39')][_0xd482('0x50')]){_0x1cc4be[_0xd482('0x51')]=[{'all':!![]}];}return db['SmsAccount'][_0xd482('0x52')](_0x1cc4be);})[_0xd482('0x1e')](function(_0xf4481e){_0x3d4440[_0xd482('0x53')]=_0xf4481e;return _0x3d4440;})[_0xd482('0x1e')](respondWithFilteredResult(_0x544081,_0x1cc4be))['catch'](handleError(_0x544081,null));};exports[_0xd482('0x54')]=function(_0x3dc426,_0x44237e){var _0x1934b2={'raw':![],'where':{'id':_0x3dc426[_0xd482('0x55')]['id']}},_0x1d72af={};_0x1d72af['model']=_[_0xd482('0x3c')](db[_0xd482('0x56')]['rawAttributes']);_0x1d72af[_0xd482('0x39')]=_['keys'](_0x3dc426[_0xd482('0x39')]);_0x1d72af[_0xd482('0x3d')]=_[_0xd482('0x3f')](_0x1d72af['model'],_0x1d72af[_0xd482('0x39')]);_0x1934b2[_0xd482('0x3e')]=_[_0xd482('0x3f')](_0x1d72af[_0xd482('0x38')],qs['fields'](_0x3dc426[_0xd482('0x39')][_0xd482('0x40')]));_0x1934b2[_0xd482('0x3e')]=_0x1934b2[_0xd482('0x3e')][_0xd482('0x41')]?_0x1934b2[_0xd482('0x3e')]:_0x1d72af[_0xd482('0x38')];if(_0x3dc426[_0xd482('0x39')]['includeAll']){_0x1934b2['include']=[{'all':!![]}];}_0x1934b2=_[_0xd482('0x48')]({},_0x1934b2,_0x3dc426['options']);return db[_0xd482('0x56')][_0xd482('0x57')](_0x1934b2)[_0xd482('0x1e')](handleEntityNotFound(_0x44237e,null))[_0xd482('0x1e')](respondWithResult(_0x44237e,null))[_0xd482('0x58')](handleError(_0x44237e,null));};exports[_0xd482('0x59')]=function(_0x1b8263,_0x2a968d){return db[_0xd482('0x56')][_0xd482('0x59')](_0x1b8263[_0xd482('0x5a')],{})[_0xd482('0x1e')](function(_0x7863a5){var _0x53f897=_0x1b8263[_0xd482('0x5b')][_0xd482('0x5c')]({'plain':!![]});if(!_0x53f897)throw new Error(_0xd482('0x5d'));if(_0x53f897['role']===_0xd482('0x5b')){var _0x4b410c=_0x7863a5[_0xd482('0x5c')]({'plain':!![]});var _0x1e4f89=_0xd482('0x5e');return db[_0xd482('0x5f')][_0xd482('0x57')]({'where':{'name':_0x1e4f89,'userProfileId':_0x53f897[_0xd482('0x60')]},'raw':!![]})['then'](function(_0x14072c){if(_0x14072c&&_0x14072c[_0xd482('0x61')]===0x0){return db['UserProfileResource'][_0xd482('0x59')]({'name':_0x4b410c['name'],'resourceId':_0x4b410c['id'],'type':_0x14072c[_0xd482('0x34')],'sectionId':_0x14072c['id']},{})[_0xd482('0x1e')](function(){return _0x7863a5;});}else{return _0x7863a5;}})['catch'](function(_0x157380){logger[_0xd482('0x24')](_0xd482('0x62'),_0x157380);throw _0x157380;});}return _0x7863a5;})['then'](respondWithResult(_0x2a968d,0xc9))['catch'](handleError(_0x2a968d,null));};exports[_0xd482('0x31')]=function(_0x35f923,_0x107867){if(_0x35f923[_0xd482('0x5a')]['id']){delete _0x35f923['body']['id'];}return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0x35f923['params']['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x107867,null))[_0xd482('0x1e')](saveUpdates(_0x35f923[_0xd482('0x5a')],null))[_0xd482('0x1e')](respondWithResult(_0x107867,null))['catch'](handleError(_0x107867,null));};exports[_0xd482('0x63')]=function(_0x5ec1c2,_0x323c19){return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0x5ec1c2['params']['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x323c19,null))['then'](removeEntity(_0x323c19,null))[_0xd482('0x58')](handleError(_0x323c19,null));};exports[_0xd482('0x64')]=function(_0x1b0216,_0x388edf){return db['SmsAccount'][_0xd482('0x64')]()[_0xd482('0x1e')](respondWithResult(_0x388edf,null))[_0xd482('0x58')](handleError(_0x388edf,null));};exports[_0xd482('0x65')]=function(_0x452188,_0x3e1ea5,_0x30366b){if(_0x452188[_0xd482('0x5a')]['id']){delete _0x452188[_0xd482('0x5a')]['id'];}return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0x452188[_0xd482('0x55')]['id']}})['then'](handleEntityNotFound(_0x3e1ea5,null))[_0xd482('0x1e')](function(_0x790a71){if(_0x790a71){_0x452188['body'][_0xd482('0x66')]=_0x790a71['id'];return db[_0xd482('0x67')][_0xd482('0x59')](_0x452188[_0xd482('0x5a')]);}})[_0xd482('0x1e')](respondWithResult(_0x3e1ea5,null))[_0xd482('0x58')](handleError(_0x3e1ea5,null));};exports[_0xd482('0x68')]=function(_0x467efe,_0xe93afc,_0x235ec1){var _0x50cdeb={'raw':![],'where':{}};var _0x40973f={};var _0x5d294d={'count':0x0,'rows':[]};return db[_0xd482('0x56')][_0xd482('0x69')]({'where':{'id':_0x467efe[_0xd482('0x55')]['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0xe93afc,null))[_0xd482('0x1e')](function(_0xc23db7){if(_0xc23db7){_0x40973f[_0xd482('0x38')]=_[_0xd482('0x3c')](db['Disposition'][_0xd482('0x37')]);_0x40973f['query']=_['keys'](_0x467efe[_0xd482('0x39')]);_0x40973f[_0xd482('0x3d')]=_[_0xd482('0x3f')](_0x40973f['model'],_0x40973f[_0xd482('0x39')]);_0x50cdeb[_0xd482('0x3e')]=_['intersection'](_0x40973f['model'],qs[_0xd482('0x40')](_0x467efe[_0xd482('0x39')][_0xd482('0x40')]));_0x50cdeb[_0xd482('0x3e')]=_0x50cdeb[_0xd482('0x3e')][_0xd482('0x41')]?_0x50cdeb[_0xd482('0x3e')]:_0x40973f[_0xd482('0x38')];if(!_0x467efe[_0xd482('0x39')][_0xd482('0x6a')](_0xd482('0x42'))){_0x50cdeb[_0xd482('0x43')]=qs['limit'](_0x467efe['query'][_0xd482('0x43')]);_0x50cdeb[_0xd482('0x2b')]=qs['offset'](_0x467efe[_0xd482('0x39')]['offset']);}_0x50cdeb[_0xd482('0x6b')]=qs[_0xd482('0x44')](_0x467efe['query'][_0xd482('0x44')]);_0x50cdeb['where']=qs[_0xd482('0x3d')](_[_0xd482('0x45')](_0x467efe[_0xd482('0x39')],_0x40973f['filters']));_0x50cdeb[_0xd482('0x49')][_0xd482('0x66')]=_0xc23db7['id'];if(_0x467efe[_0xd482('0x39')][_0xd482('0x4a')]){_0x50cdeb['where']=_[_0xd482('0x48')](_0x50cdeb[_0xd482('0x49')],{'$or':_[_0xd482('0x4b')](_0x50cdeb[_0xd482('0x3e')],function(_0x2c943b){var _0x5217b6={};_0x5217b6[_0x2c943b]={'$like':'%'+_0x467efe[_0xd482('0x39')][_0xd482('0x4a')]+'%'};return _0x5217b6;})});}_0x50cdeb=_[_0xd482('0x48')]({},_0x50cdeb,_0x467efe[_0xd482('0x4f')]);return db[_0xd482('0x67')]['count']({'where':_0x50cdeb[_0xd482('0x49')]})[_0xd482('0x1e')](function(_0x319c90){_0x5d294d[_0xd482('0x2a')]=_0x319c90;if(_0x467efe[_0xd482('0x39')][_0xd482('0x50')]){_0x50cdeb[_0xd482('0x51')]=[{'all':!![]}];}return db[_0xd482('0x67')][_0xd482('0x52')](_0x50cdeb);})['then'](function(_0x2c2e56){_0x5d294d[_0xd482('0x53')]=_0x2c2e56;return _0x5d294d;});}})[_0xd482('0x1e')](respondWithFilteredResult(_0xe93afc,_0x50cdeb))[_0xd482('0x58')](handleError(_0xe93afc,null));};exports['removeDispositions']=function(_0x4b6aad,_0x12b8de,_0x285df7){var _0x26adb4;return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0x4b6aad['params']['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x12b8de,null))[_0xd482('0x1e')](function(_0xedb21d){if(_0xedb21d){return _0xedb21d[_0xd482('0x6c')](_0x4b6aad[_0xd482('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x12b8de,null))[_0xd482('0x58')](handleError(_0x12b8de,null));};exports[_0xd482('0x6d')]=function(_0x24e061,_0x3f634d,_0x33ebce){if(_0x24e061[_0xd482('0x5a')]['id']){delete _0x24e061['body']['id'];}return db[_0xd482('0x56')]['find']({'where':{'id':_0x24e061[_0xd482('0x55')]['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x3f634d,null))[_0xd482('0x1e')](function(_0x3856ac){if(_0x3856ac){_0x24e061[_0xd482('0x5a')][_0xd482('0x66')]=_0x3856ac['id'];return db['CannedAnswer'][_0xd482('0x59')](_0x24e061[_0xd482('0x5a')]);}})['then'](respondWithResult(_0x3f634d,null))['catch'](handleError(_0x3f634d,null));};exports[_0xd482('0x6e')]=function(_0x441181,_0x183891,_0x331939){var _0x423e5f={'raw':![],'where':{}};var _0x99ab9e={};var _0x16f780={'count':0x0,'rows':[]};return db[_0xd482('0x56')][_0xd482('0x69')]({'where':{'id':_0x441181[_0xd482('0x55')]['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x183891,null))[_0xd482('0x1e')](function(_0x5c62c5){if(_0x5c62c5){_0x99ab9e[_0xd482('0x38')]=_[_0xd482('0x3c')](db[_0xd482('0x6f')][_0xd482('0x37')]);_0x99ab9e[_0xd482('0x39')]=_[_0xd482('0x3c')](_0x441181[_0xd482('0x39')]);_0x99ab9e[_0xd482('0x3d')]=_[_0xd482('0x3f')](_0x99ab9e[_0xd482('0x38')],_0x99ab9e[_0xd482('0x39')]);_0x423e5f[_0xd482('0x3e')]=_[_0xd482('0x3f')](_0x99ab9e['model'],qs[_0xd482('0x40')](_0x441181['query']['fields']));_0x423e5f[_0xd482('0x3e')]=_0x423e5f[_0xd482('0x3e')][_0xd482('0x41')]?_0x423e5f[_0xd482('0x3e')]:_0x99ab9e[_0xd482('0x38')];if(!_0x441181[_0xd482('0x39')]['hasOwnProperty'](_0xd482('0x42'))){_0x423e5f[_0xd482('0x43')]=qs[_0xd482('0x43')](_0x441181[_0xd482('0x39')]['limit']);_0x423e5f[_0xd482('0x2b')]=qs['offset'](_0x441181[_0xd482('0x39')][_0xd482('0x2b')]);}_0x423e5f[_0xd482('0x6b')]=qs[_0xd482('0x44')](_0x441181['query'][_0xd482('0x44')]);_0x423e5f['where']=qs[_0xd482('0x3d')](_[_0xd482('0x45')](_0x441181[_0xd482('0x39')],_0x99ab9e[_0xd482('0x3d')]));_0x423e5f['where'][_0xd482('0x66')]=_0x5c62c5['id'];if(_0x441181[_0xd482('0x39')]['filter']){_0x423e5f['where']=_[_0xd482('0x48')](_0x423e5f[_0xd482('0x49')],{'$or':_['map'](_0x423e5f[_0xd482('0x3e')],function(_0x3819a8){var _0x6e8b6={};_0x6e8b6[_0x3819a8]={'$like':'%'+_0x441181[_0xd482('0x39')]['filter']+'%'};return _0x6e8b6;})});}_0x423e5f=_[_0xd482('0x48')]({},_0x423e5f,_0x441181[_0xd482('0x4f')]);return db[_0xd482('0x6f')][_0xd482('0x2a')]({'where':_0x423e5f[_0xd482('0x49')]})['then'](function(_0x2ddb56){_0x16f780[_0xd482('0x2a')]=_0x2ddb56;if(_0x441181[_0xd482('0x39')][_0xd482('0x50')]){_0x423e5f['include']=[{'all':!![]}];}return db[_0xd482('0x6f')][_0xd482('0x52')](_0x423e5f);})['then'](function(_0x22ef95){_0x16f780[_0xd482('0x53')]=_0x22ef95;return _0x16f780;});}})[_0xd482('0x1e')](respondWithFilteredResult(_0x183891,_0x423e5f))[_0xd482('0x58')](handleError(_0x183891,null));};exports['removeAnswers']=function(_0x5ee1a9,_0x6419e8,_0x42a1cf){var _0x2d0523;return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0x5ee1a9['params']['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x6419e8,null))[_0xd482('0x1e')](function(_0x7b7e5b){if(_0x7b7e5b){return _0x7b7e5b[_0xd482('0x70')](_0x5ee1a9['query'][_0xd482('0x71')]);}})[_0xd482('0x1e')](respondWithStatusCode(_0x6419e8,null))[_0xd482('0x58')](handleError(_0x6419e8,null));};exports['notify']=function(_0x2a841d,_0x31dd91,_0xcb85df){var _0x3bf8c8={'channel':'sms'};var _0x579853=[];var _0x323ad9=[];var _0x5077cf={};return db[_0xd482('0x56')]['find']({'where':{'id':_0x2a841d[_0xd482('0x55')]['id']},'include':[{'model':db[_0xd482('0x72')],'as':_0xd482('0x73')}]})[_0xd482('0x1e')](handleEntityNotFound(_0x31dd91,null))[_0xd482('0x1e')](function(_0x1a10a3){_0x3bf8c8[_0xd482('0x74')]=_0x1a10a3;_0x3bf8c8['applications']=_['orderBy'](_0x1a10a3[_0xd482('0x73')],[_0xd482('0x75')],['asc']);if(_0x3bf8c8['account']['Applications']){delete _0x3bf8c8['account'][_0xd482('0x73')];}return db[_0xd482('0x76')][_0xd482('0x64')]();})['then'](function(_0x1b2e13){if(!_0x1b2e13){throw new db[(_0xd482('0x77'))][(_0xd482('0x78'))](_0xd482('0x79'));}_0x579853=_[_0xd482('0x7a')](_[_0xd482('0x3c')](_0x1b2e13),[_0xd482('0x7b'),_0xd482('0x7c')]);_0x323ad9=_['difference'](_[_0xd482('0x3c')](_0x1b2e13),[_0xd482('0x7b'),_0xd482('0x7c'),'CompanyId',_0xd482('0x7d')]);_0x3bf8c8[_0xd482('0x5a')]={'mapKey':_0xd482('0x7e')};if(_0x3bf8c8[_0xd482('0x74')][_0xd482('0x4c')]){switch(_0x3bf8c8['account']['type']){case'twilio':_0x3bf8c8[_0xd482('0x5a')]['from']=_0x2a841d[_0xd482('0x5a')][_0xd482('0x7f')];_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x5a')]=_0x2a841d[_0xd482('0x5a')]['Body'];_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x80')]=_0x2a841d[_0xd482('0x5a')]['MessageSid'];break;case _0xd482('0x81'):_0x3bf8c8[_0xd482('0x5a')]['from']='+'+_0x2a841d[_0xd482('0x5a')][_0xd482('0x82')];_0x3bf8c8['body'][_0xd482('0x5a')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x83')];break;case _0xd482('0x84'):_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x85')];_0x3bf8c8['body'][_0xd482('0x5a')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x26')];break;case _0xd482('0x86'):_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')]=_0x2a841d['body'][_0xd482('0x85')];_0x3bf8c8['body'][_0xd482('0x5a')]=_0x2a841d['body'][_0xd482('0x5a')];_0x3bf8c8[_0xd482('0x5a')]['messageId']=_0x2a841d['body'][_0xd482('0x87')];break;case _0xd482('0x88'):_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')]=_0x2a841d[_0xd482('0x5a')]['From'];_0x3bf8c8['body']['body']=_0x2a841d[_0xd482('0x5a')]['Text'];_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x80')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x89')];break;case _0xd482('0x8a'):_0x3bf8c8[_0xd482('0x5a')]['from']='+'+_0x2a841d['body'][_0xd482('0x8b')][0x0]['from'];_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x5a')]=_0x2a841d[_0xd482('0x5a')]['results'][0x0][_0xd482('0x83')];_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x80')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x8b')][0x0]['messageId'];break;case _0xd482('0x8c'):_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')]=_0x2a841d['body'][_0xd482('0x8d')];_0x3bf8c8['body'][_0xd482('0x5a')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x8e')][_0xd482('0x26')];break;case _0xd482('0x8f'):_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x90')];_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x5a')]=_0x2a841d[_0xd482('0x5a')]['text'];_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x80')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x91')];break;case'intelepeer':_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')]=_0x2a841d[_0xd482('0x5a')][_0xd482('0x85')];_0x3bf8c8[_0xd482('0x5a')]['body']=_0x2a841d[_0xd482('0x5a')][_0xd482('0x26')];_0x3bf8c8['body']['messageId']=_0x2a841d[_0xd482('0x5a')]['refid'];break;}}if(_0x3bf8c8[_0xd482('0x5a')]['id']){delete _0x3bf8c8['body']['id'];}if(_[_0xd482('0x92')](_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')])){throw new db['Sequelize'][(_0xd482('0x78'))](_0xd482('0x93'));}if(_[_0xd482('0x92')](_0x3bf8c8[_0xd482('0x5a')]['body'])||_0x3bf8c8['body']['body']===''){throw new db[(_0xd482('0x77'))][(_0xd482('0x78'))](_0xd482('0x94'));}if(_[_0xd482('0x92')](_0x3bf8c8['body'][_0xd482('0x95')])){throw new db['Sequelize'][(_0xd482('0x78'))](_0xd482('0x96')+_0x323ad9);}if(!_['includes'](_0x323ad9,_0x3bf8c8['body']['mapKey'])){throw new db[(_0xd482('0x77'))][(_0xd482('0x78'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x323ad9);}_0x5077cf[_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x95')]]=_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')];return db[_0xd482('0x97')][_0xd482('0x57')]({'where':{'id':_0x3bf8c8[_0xd482('0x74')][_0xd482('0x7d')]},'include':[{'model':db[_0xd482('0x76')],'as':'Contacts','where':_0x5077cf,'limit':0x1,'order':[[_0xd482('0x7c'),'DESC']]}]});})[_0xd482('0x1e')](handleEntityNotFound(_0x31dd91,null))[_0xd482('0x1e')](function(_0x1f7ef7){if(_0x1f7ef7){_0x3bf8c8[_0xd482('0x98')]=_[_0xd482('0x99')](_0x1f7ef7,[_0xd482('0x9a')]);if(_0x1f7ef7[_0xd482('0x9a')][_0xd482('0x41')]){return _0x1f7ef7[_0xd482('0x9a')][0x0];}var _0x394080=_[_0xd482('0x15')](_0x3bf8c8[_0xd482('0x5a')],{'firstName':_0x3bf8c8['body'][_0xd482('0x85')],'ListId':_0x1f7ef7['id']});_0x394080[_0x3bf8c8['body'][_0xd482('0x95')]]=_0x3bf8c8[_0xd482('0x5a')]['from'];return db['CmContact']['create'](_0x394080,{'fields':_0x579853,'raw':!![]});}})['then'](handleEntityNotFound(_0x31dd91,null))[_0xd482('0x1e')](function(_0x11bcd4){if(_0x11bcd4){_0x3bf8c8[_0xd482('0x9b')]=_0x11bcd4;var _0x2c6588={'ContactId':_0x11bcd4['id'],'phone':_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')],'SmsAccountId':_0x2a841d['params']['id']};var _0x2f9c36={'ContactId':_0x11bcd4['id'],'SmsAccountId':_0x2a841d['params']['id'],'closed':![]};return db[_0xd482('0x9c')][_0xd482('0x57')]({'where':_0x2f9c36})['then'](function(_0x24fd59){if(_0x24fd59){return[_0x24fd59,![]];}return db[_0xd482('0x9c')]['create'](_0x2c6588)['then'](function(_0x45bd7f){return[_0x45bd7f,!![]];});});}})['spread'](function(_0x1e9772,_0x459e00){_0x3bf8c8['interaction']=_0x1e9772[_0xd482('0x5c')]({'plain':!![]});_0x3bf8c8[_0xd482('0x9d')][_0xd482('0x9e')]=![];if(_0x459e00){if(_0x3bf8c8[_0xd482('0x74')][_0xd482('0x9f')]){_0x3bf8c8['applications'][_0xd482('0xa0')]({'id':0x0,'priority':_0x3bf8c8['applications'][_0xd482('0x41')]+0x1,'app':_0xd482('0xa1'),'appdata':_0xd482('0xa2'),'interval':_0xd482('0xa3')});}_0x3bf8c8['interaction'][_0xd482('0x9e')]=!![];}return db['SmsMessage'][_0xd482('0x59')]({'phone':_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x85')],'messageId':_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x80')],'body':_0x3bf8c8[_0xd482('0x5a')][_0xd482('0x5a')],'SmsAccountId':_0x2a841d[_0xd482('0x55')]['id'],'SmsInteractionId':_0x1e9772['id'],'direction':'in','ContactId':_0x1e9772['ContactId'],'AttachmentId':_0x3bf8c8[_0xd482('0x5a')][_0xd482('0xa4')]});})['then'](function(_0x4e392f){_0x3bf8c8[_0xd482('0x26')]=_0x4e392f;if(_0x3bf8c8['interaction'][_0xd482('0xa5')]){return db[_0xd482('0xa6')]['find']({'attributes':['id',_0xd482('0x34')],'where':{'id':_0x3bf8c8[_0xd482('0x9d')][_0xd482('0xa5')]}})[_0xd482('0x1e')](function(_0x5c5902){if(_0x5c5902){_0x3bf8c8[_0xd482('0xa7')][_0xd482('0xa8')]({'id':0x0,'priority':0x0,'app':_0xd482('0xa9'),'appdata':_0x5c5902[_0xd482('0x34')]+','+(_0x3bf8c8[_0xd482('0x74')][_0xd482('0xaa')]||0xa),'interval':_0xd482('0xa3')});}return respondWithRpcPromise(_0xd482('0xab'),'startRouting',_0x3bf8c8);});}return respondWithRpcPromise('Start',_0xd482('0xac'),_0x3bf8c8);})[_0xd482('0x1e')](function(_0x2ec9b3){if(_0x2ec9b3){var _0x4a25b4=0xc8;var _0x138770=_0xd482('0xad');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x138770,_0x4a25b4,_0xd482('0xae'));logger[_0xd482('0x21')](_0xd482('0xaf'),_0x138770,_0x4a25b4,_0xd482('0xae'),JSON['stringify'](_0x2ec9b3));if(_0x3bf8c8['account']['type']===_0xd482('0xb0')){return _0x31dd91[_0xd482('0x29')](_0x4a25b4)['set'](_0xd482('0xb1'),_0xd482('0xb2'))[_0xd482('0x35')](_0xd482('0xb3'));}else{return _0x31dd91['status'](_0x4a25b4)[_0xd482('0x2e')](_0x2ec9b3);}}})[_0xd482('0x58')](handleError(_0x31dd91,null));};exports[_0xd482('0xb4')]=function(_0x85ceb1,_0x287e2a,_0x5731){return db[_0xd482('0x56')][_0xd482('0x69')]({'where':{'id':_0x85ceb1['params']['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x287e2a,null))[_0xd482('0x1e')](function(_0x2761f3){if(_0x2761f3){return db[_0xd482('0xb5')][_0xd482('0xb6')](function(_0x45d9ae){return db[_0xd482('0x72')][_0xd482('0x63')]({'where':{'SmsAccountId':_0x85ceb1['params']['id']},'transaction':_0x45d9ae})[_0xd482('0x1e')](function(_0x22713e){var _0x32019a=_[_0xd482('0x4b')](_0x85ceb1[_0xd482('0x5a')],function(_0x2466cb){_0x2466cb[_0xd482('0x66')]=_0x85ceb1['params']['id'];return _0x2466cb;});return db[_0xd482('0x72')][_0xd482('0xb7')](_0x32019a,{'transaction':_0x45d9ae});});})['then'](function(){return db['SmsApplication'][_0xd482('0xb8')]({'where':{'SmsAccountId':_0x85ceb1['params']['id']},'order':'priority'});});}})[_0xd482('0x1e')](respondWithResult(_0x287e2a,null))['catch'](handleError(_0x287e2a,null));};exports[_0xd482('0xb9')]=function(_0x21a0ad,_0xf314e5,_0x5312b9){var _0x4c37fe={};var _0x398540={};var _0x302e35;var _0x14f172;return db[_0xd482('0x56')][_0xd482('0x69')]({'where':{'id':_0x21a0ad[_0xd482('0x55')]['id']}})['then'](handleEntityNotFound(_0xf314e5,null))[_0xd482('0x1e')](function(_0x1cc062){if(_0x1cc062){_0x302e35=_0x1cc062;_0x398540['model']=_[_0xd482('0x3c')](db['SmsApplication']['rawAttributes']);_0x398540[_0xd482('0x39')]=_[_0xd482('0x3c')](_0x21a0ad[_0xd482('0x39')]);_0x398540[_0xd482('0x3d')]=_[_0xd482('0x3f')](_0x398540[_0xd482('0x38')],_0x398540[_0xd482('0x39')]);_0x4c37fe[_0xd482('0x3e')]=_[_0xd482('0x3f')](_0x398540['model'],qs[_0xd482('0x40')](_0x21a0ad['query'][_0xd482('0x40')]));_0x4c37fe['attributes']=_0x4c37fe[_0xd482('0x3e')]['length']?_0x4c37fe[_0xd482('0x3e')]:_0x398540[_0xd482('0x38')];_0x4c37fe[_0xd482('0x6b')]=qs[_0xd482('0x44')](_0x21a0ad[_0xd482('0x39')]['sort']);_0x4c37fe['where']=qs['filters'](_[_0xd482('0x45')](_0x21a0ad[_0xd482('0x39')],_0x398540[_0xd482('0x3d')]));if(_0x21a0ad[_0xd482('0x39')][_0xd482('0x4a')]){_0x4c37fe[_0xd482('0x49')]=_[_0xd482('0x48')](_0x4c37fe[_0xd482('0x49')],{'$or':_[_0xd482('0x4b')](_0x4c37fe[_0xd482('0x3e')],function(_0x1423a6){var _0x9911c2={};_0x9911c2[_0x1423a6]={'$like':'%'+_0x21a0ad[_0xd482('0x39')]['filter']+'%'};return _0x9911c2;})});}_0x4c37fe=_[_0xd482('0x48')]({},_0x4c37fe,_0x21a0ad[_0xd482('0x4f')]);return _0x302e35[_0xd482('0xb9')](_0x4c37fe);}})[_0xd482('0x1e')](function(_0x66bd23){if(_0x66bd23){_0x14f172=_0x66bd23[_0xd482('0x41')];if(!_0x21a0ad[_0xd482('0x39')][_0xd482('0x6a')](_0xd482('0x42'))){_0x4c37fe[_0xd482('0x43')]=qs[_0xd482('0x43')](_0x21a0ad[_0xd482('0x39')]['limit']);_0x4c37fe['offset']=qs[_0xd482('0x2b')](_0x21a0ad[_0xd482('0x39')]['offset']);}return _0x302e35[_0xd482('0xb9')](_0x4c37fe);}})[_0xd482('0x1e')](function(_0x16b267){if(_0x16b267){return _0x16b267?{'count':_0x14f172,'rows':_0x16b267}:null;}})[_0xd482('0x1e')](respondWithResult(_0xf314e5,null))['catch'](handleError(_0xf314e5,null));};exports[_0xd482('0xba')]=function(_0x1cd04c,_0x58b760,_0x419874){var _0x9ea762={'raw':![],'where':{}};var _0x43b309={};var _0x32a96c={'count':0x0,'rows':[]};return db[_0xd482('0x56')][_0xd482('0x69')]({'where':{'id':_0x1cd04c[_0xd482('0x55')]['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x58b760,null))[_0xd482('0x1e')](function(_0x5f4d72){if(_0x5f4d72){_0x43b309[_0xd482('0x38')]=_[_0xd482('0x3c')](db[_0xd482('0x9c')][_0xd482('0x37')]);_0x43b309['query']=_[_0xd482('0x3c')](_0x1cd04c[_0xd482('0x39')]);_0x43b309['filters']=_[_0xd482('0x3f')](_0x43b309[_0xd482('0x38')],_0x43b309[_0xd482('0x39')]);_0x9ea762['attributes']=_[_0xd482('0x3f')](_0x43b309[_0xd482('0x38')],qs[_0xd482('0x40')](_0x1cd04c[_0xd482('0x39')][_0xd482('0x40')]));_0x9ea762[_0xd482('0x3e')]=_0x9ea762['attributes'][_0xd482('0x41')]?_0x9ea762[_0xd482('0x3e')]:_0x43b309['model'];if(!_0x1cd04c[_0xd482('0x39')][_0xd482('0x6a')]('nolimit')){_0x9ea762[_0xd482('0x43')]=qs['limit'](_0x1cd04c[_0xd482('0x39')][_0xd482('0x43')]);_0x9ea762[_0xd482('0x2b')]=qs[_0xd482('0x2b')](_0x1cd04c[_0xd482('0x39')][_0xd482('0x2b')]);}_0x9ea762[_0xd482('0x6b')]=qs['sort'](_0x1cd04c['query'][_0xd482('0x44')]);_0x9ea762[_0xd482('0x49')]=qs[_0xd482('0x3d')](_[_0xd482('0x45')](_0x1cd04c[_0xd482('0x39')],_0x43b309[_0xd482('0x3d')]));_0x9ea762[_0xd482('0x49')][_0xd482('0x66')]=_0x5f4d72['id'];if(_0x1cd04c[_0xd482('0x39')][_0xd482('0x4a')]){_0x9ea762[_0xd482('0x49')]=_[_0xd482('0x48')](_0x9ea762[_0xd482('0x49')],{'$or':_['map'](_0x9ea762[_0xd482('0x3e')],function(_0x139c72){var _0x1539cd={};_0x1539cd[_0x139c72]={'$like':'%'+_0x1cd04c[_0xd482('0x39')][_0xd482('0x4a')]+'%'};return _0x1539cd;})});}_0x9ea762=_['merge']({},_0x9ea762,_0x1cd04c[_0xd482('0x4f')]);return db[_0xd482('0x9c')]['count']({'where':_0x9ea762[_0xd482('0x49')]})[_0xd482('0x1e')](function(_0x3515af){_0x32a96c[_0xd482('0x2a')]=_0x3515af;if(_0x1cd04c[_0xd482('0x39')][_0xd482('0x50')]){_0x9ea762[_0xd482('0x51')]=[{'model':db['CmContact'],'as':_0xd482('0xbb'),'required':![]},{'model':db[_0xd482('0xa6')],'as':'Owner','attributes':[_0xd482('0x34'),_0xd482('0xbc'),_0xd482('0xbd')],'required':![]},{'model':db[_0xd482('0xbe')],'as':_0xd482('0xbf'),'attributes':['id',_0xd482('0x34'),'color'],'where':_0x1cd04c[_0xd482('0x39')][_0xd482('0xc0')]?{'id':_0x1cd04c[_0xd482('0x39')]['tag']}:undefined,'required':_0x1cd04c[_0xd482('0x39')][_0xd482('0xc0')]?!![]:![]}];}return db[_0xd482('0x9c')][_0xd482('0x52')](_0x9ea762);})[_0xd482('0x1e')](function(_0x4304ed){_0x32a96c[_0xd482('0x53')]=_0x4304ed;return _0x32a96c;});}})['then'](respondWithFilteredResult(_0x58b760,_0x9ea762))[_0xd482('0x58')](handleError(_0x58b760,null));};exports[_0xd482('0x35')]=function(_0x531076,_0x2a88b7,_0x379e54){var _0x11f7a0,_0x571678,_0x20b25e;if(_['isNil'](_0x531076[_0xd482('0x5a')][_0xd482('0x5a')])||_0x531076[_0xd482('0x5a')][_0xd482('0x5a')]===''){throw new db['Sequelize'][(_0xd482('0x78'))](_0xd482('0x94'));}if(_[_0xd482('0x92')](_0x531076[_0xd482('0x5a')]['to'])){throw new db['Sequelize'][(_0xd482('0x78'))](_0xd482('0xc1'));}_0x11f7a0=_0x531076['body']['to'];return db[_0xd482('0x56')]['find']({'where':{'id':_0x531076[_0xd482('0x55')]['id']},'include':[{'model':db[_0xd482('0x97')],'as':_0xd482('0xc2'),'include':[{'model':db[_0xd482('0x76')],'as':_0xd482('0x9a'),'where':{'mobile':_0x11f7a0},'limit':0x1,'order':[[_0xd482('0x7c'),'DESC']]}]}]})[_0xd482('0x1e')](handleEntityNotFound(_0x2a88b7,null))[_0xd482('0x1e')](function(_0x47490e){if(_0x47490e&&_0x47490e[_0xd482('0xc2')]){_0x571678=_0x47490e['get']({'plain':!![]});if(_0x571678[_0xd482('0xc2')]&&_0x571678[_0xd482('0xc2')][_0xd482('0x9a')][_0xd482('0x41')]){return _0x571678['List'][_0xd482('0x9a')][0x0];}return db['CmContact'][_0xd482('0x59')](_[_0xd482('0x15')](_0x531076[_0xd482('0x5a')],{'firstName':_0x11f7a0,'mobile':_0x11f7a0,'phone':_0x11f7a0,'ListId':_0x571678[_0xd482('0x7d')]}));}})['then'](handleEntityNotFound(_0x2a88b7,null))['then'](function(_0xc9e458){if(_0xc9e458){_0x20b25e=_0xc9e458;return db[_0xd482('0x9c')][_0xd482('0x57')]({'where':{'ContactId':_0x20b25e['id'],'closed':![],'SmsAccountId':_0x571678['id']}})['then'](function(_0x4e2e37){if(_0x4e2e37){return[_0x4e2e37,![]];}return db[_0xd482('0x9c')]['create']({'UserId':_0x531076['user']['id'],'ContactId':_0x20b25e['id'],'SmsAccountId':_0x571678['id'],'phone':_0x11f7a0,'firstMsgDirection':'out','Messages':[_[_0xd482('0x48')](_0x531076[_0xd482('0x5a')],{'read':![],'body':_0x531076[_0xd482('0x5a')]['body'],'phone':_0x11f7a0,'SmsAccountId':_0x571678['id'],'UserId':_0x531076[_0xd482('0x5b')]['id'],'ContactId':_0x20b25e['id']})]},{'include':[{'model':db[_0xd482('0xc3')],'as':_0xd482('0xc4')}]})[_0xd482('0x1e')](function(_0x2f001){return[_0x2f001,!![]];});});}})[_0xd482('0xc5')](function(_0x763972,_0x5cab45){if(_0x5cab45){return _0x763972;}return db[_0xd482('0xc3')][_0xd482('0x59')](_[_0xd482('0x48')](_0x531076[_0xd482('0x5a')],{'read':![],'body':_0x531076[_0xd482('0x5a')][_0xd482('0x5a')],'phone':_0x11f7a0,'SmsAccountId':_0x571678['id'],'SmsInteractionId':_0x763972['id'],'UserId':_0x531076[_0xd482('0x5b')]['id'],'ContactId':_0x20b25e['id']}))[_0xd482('0x1e')](function(_0x3b0a9c){_0x763972[_0xd482('0xc6')]['Messages']=[];_0x763972['dataValues'][_0xd482('0xc4')][_0xd482('0xa0')](_0x3b0a9c[_0xd482('0xc6')]);return _0x763972;});})[_0xd482('0x1e')](respondWithResult(_0x2a88b7,null))[_0xd482('0x58')](handleError(_0x2a88b7,null));};exports[_0xd482('0x29')]=function(_0x1b2908,_0x268916,_0x29b188){if(_0x1b2908[_0xd482('0x5a')]['id']){delete _0x1b2908[_0xd482('0x5a')]['id'];}console[_0xd482('0xc7')](_0xd482('0xc8'),_0x1b2908[_0xd482('0x5a')]);var _0xe56046,_0x45dd25,_0x9797bb;return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0x1b2908['params']['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x268916,null))[_0xd482('0x1e')](function(_0x139c08){if(_0x139c08){_0x9797bb=_0x139c08;logger[_0xd482('0x21')](_0xd482('0x22'),_0xd482('0x29'),_0xd482('0xc9'),_0x139c08[_0xd482('0x4c')],util['inspect'](_0x1b2908[_0xd482('0x5a')],{'showHidden':![],'depth':null}));switch(_0x139c08[_0xd482('0x4c')]){case'skebby':if(_0x1b2908[_0xd482('0x5a')][_0xd482('0xca')]&&_0x1b2908[_0xd482('0x5a')][_0xd482('0x29')]){_0x45dd25=_0x1b2908['body'][_0xd482('0x29')];return db['SmsMessage'][_0xd482('0x57')]({'where':{'messageId':_0x1b2908['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x1b2908[_0xd482('0x5a')][_0xd482('0xcb')]&&_0x1b2908['body'][_0xd482('0xcc')]){_0x45dd25=_0x1b2908[_0xd482('0x5a')][_0xd482('0xcc')];return db['SmsMessage'][_0xd482('0x57')]({'where':{'messageId':_0x1b2908['body']['requestid']}});}break;case _0xd482('0x86'):if(_0x1b2908[_0xd482('0x5a')]['message_id']&&_0x1b2908[_0xd482('0x5a')][_0xd482('0xcd')]){_0x45dd25=_0x1b2908[_0xd482('0x5a')][_0xd482('0xcd')];return db[_0xd482('0xc3')][_0xd482('0x57')]({'where':{'messageId':_0x1b2908[_0xd482('0x5a')][_0xd482('0x87')]}});}break;case _0xd482('0x8a'):var _0x2531b0=_0x1b2908[_0xd482('0x5a')]['results'][0x0];if(_0x2531b0[_0xd482('0x80')]&&_0x2531b0[_0xd482('0x29')][_0xd482('0xce')]==='DELIVERED'){_0x45dd25=_0x2531b0[_0xd482('0x29')][_0xd482('0xce')];return db['SmsMessage']['find']({'where':{'messageId':_0x2531b0[_0xd482('0x80')]}});}break;case _0xd482('0x8f'):if(_0x1b2908['body'][_0xd482('0x80')]&&_0x1b2908['body']['status']){_0x45dd25=_0x1b2908[_0xd482('0x5a')]['status'];return db[_0xd482('0xc3')][_0xd482('0x57')]({'where':{'messageId':_0x1b2908['body'][_0xd482('0x80')]}});}break;case _0xd482('0xcf'):if(_0x1b2908[_0xd482('0x5a')][_0xd482('0xd0')]&&_0x1b2908['body'][_0xd482('0x29')]){_0x45dd25=_0x1b2908[_0xd482('0x5a')][_0xd482('0x29')];return db[_0xd482('0xc3')]['find']({'where':{'messageId':_0x1b2908['body'][_0xd482('0xd0')]}});}break;}}})[_0xd482('0x1e')](handleEntityNotFound(_0x268916,null))[_0xd482('0x1e')](function(_0x4b006d){if(_0x4b006d){_0xe56046=_0x4b006d;switch(_0x9797bb[_0xd482('0x4c')]){case _0xd482('0x81'):if(_0x45dd25===_0xd482('0xd1')){return _0xe56046[_0xd482('0x31')]({'read':!![]});}else{logger[_0xd482('0x24')](_0xd482('0x22'),'status',_0xd482('0x81'),util[_0xd482('0xd2')](_0x1b2908[_0xd482('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xd482('0x84'):if(_0x45dd25==='1'){return _0xe56046[_0xd482('0x31')]({'read':!![]});}else{logger[_0xd482('0x24')](_0xd482('0x22'),_0xd482('0x29'),_0xd482('0x81'),util[_0xd482('0xd2')](_0x1b2908[_0xd482('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xd482('0x86'):if(!_0x1b2908['body'][_0xd482('0xd3')]&&_0x45dd25>=0xc8&&_0x45dd25<=0xce){return _0xe56046[_0xd482('0x31')]({'read':!![]});}else{logger[_0xd482('0x24')](_0xd482('0x22'),_0xd482('0x29'),_0xd482('0x86'),util['inspect'](_0x1b2908[_0xd482('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xd482('0x8a'):var _0x4b1176=_0x1b2908[_0xd482('0x5a')]['results'][0x0];if(_0x4b1176[_0xd482('0x29')]['groupName']===_0xd482('0xd1')){return _0xe56046['update']({'read':!![]});}else{logger[_0xd482('0x24')](_0xd482('0x22'),'status',_0xd482('0x8a'),util[_0xd482('0xd2')](_0x1b2908[_0xd482('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x45dd25==_0xd482('0xd4')||_0x45dd25==_0xd482('0xd5')){return _0xe56046[_0xd482('0x31')]({'read':!![]});}else{logger[_0xd482('0x24')](_0xd482('0x22'),_0xd482('0x29'),'clickatell',util[_0xd482('0xd2')](_0x1b2908[_0xd482('0x5a')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x45dd25==='DELIVRD'||_0x45dd25===_0xd482('0xd6')){return _0xe56046[_0xd482('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd482('0xcf'),util[_0xd482('0xd2')](_0x1b2908[_0xd482('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xe56046;}})[_0xd482('0x1e')](respondWithResult(_0x268916,null))['catch'](handleError(_0x268916,null));};exports['statusGet']=function(_0x77df9a,_0x124372,_0x38a88d){var _0x1920bb,_0x1224cc,_0x4df427;return db[_0xd482('0x56')]['find']({'where':{'id':_0x77df9a[_0xd482('0x55')]['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x124372,null))['then'](function(_0x2c601d){if(_0x2c601d){_0x4df427=_0x2c601d;logger[_0xd482('0x21')](_0xd482('0x22'),'status','received\x20delivery\x20report\x20from',_0x2c601d[_0xd482('0x4c')],util[_0xd482('0xd2')](_0x77df9a[_0xd482('0x39')],{'showHidden':![],'depth':null}));switch(_0x2c601d['type']){case _0xd482('0x8c'):if(_0x77df9a[_0xd482('0x39')][_0xd482('0xd7')]&&_0x77df9a[_0xd482('0x39')][_0xd482('0xd8')]){_0x1224cc=_0x77df9a[_0xd482('0x39')][_0xd482('0xd8')];return db[_0xd482('0xc3')][_0xd482('0x57')]({'where':{'messageId':_0x77df9a[_0xd482('0x39')][_0xd482('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x124372,null))['then'](function(_0x53680c){if(_0x53680c){_0x1920bb=_0x53680c;switch(_0x4df427['type']){case'csc':if(_0x1224cc==='2'||_0x1224cc==='6'){return _0x1920bb[_0xd482('0x31')]({'read':!![]});}else{logger[_0xd482('0x24')](_0xd482('0x22'),_0xd482('0x29'),_0xd482('0x8c'),util[_0xd482('0xd2')](_0x77df9a[_0xd482('0x39')],{'showHidden':![],'depth':null}));};break;}return _0x1920bb;}})['then'](respondWithResult(_0x124372,null))['catch'](handleError(_0x124372,null));};exports['addAgents']=function(_0xc494f9,_0x25213c,_0x2ffbf2){return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0xc494f9['params']['id']}})['then'](handleEntityNotFound(_0x25213c,null))['then'](function(_0x1b9807){if(_0x1b9807){return _0x1b9807['addAgents'](_0xc494f9[_0xd482('0x5a')]['ids'],_[_0xd482('0x99')](_0xc494f9[_0xd482('0x5a')],['ids','id'])||{})[_0xd482('0xc5')](function(_0x4d70c0){for(var _0x564b7b=0x0;_0x564b7b<_0xc494f9['body'][_0xd482('0x71')]['length'];_0x564b7b+=0x1){socket['emit'](_0xd482('0xd9'),{'UserId':_0xc494f9[_0xd482('0x5a')][_0xd482('0x71')][_0x564b7b],'SmsAccountId':_0xc494f9[_0xd482('0x55')]['id']});}return _0x4d70c0;});}})['then'](respondWithResult(_0x25213c,null))['catch'](handleError(_0x25213c,null));};exports[_0xd482('0xda')]=function(_0x17e017,_0xd947,_0x156bba){var _0x1a2f1d;return db[_0xd482('0x56')][_0xd482('0x57')]({'where':{'id':_0x17e017[_0xd482('0x55')]['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0xd947,null))[_0xd482('0x1e')](function(_0xc1fe41){if(_0xc1fe41){return _0xc1fe41[_0xd482('0xda')](_0x17e017[_0xd482('0x39')][_0xd482('0x71')])['then'](function(_0x311e65){if(_[_0xd482('0xdb')](_0x17e017[_0xd482('0x39')][_0xd482('0x71')])){for(var _0x231dd=0x0;_0x231dd<_0x17e017[_0xd482('0x39')]['ids'][_0xd482('0x41')];_0x231dd+=0x1){socket[_0xd482('0xdc')](_0xd482('0xdd'),{'UserId':_0x17e017['query']['ids'][_0x231dd],'SmsAccountId':_0x17e017[_0xd482('0x55')]['id']});}}else{socket[_0xd482('0xdc')](_0xd482('0xdd'),{'UserId':_0x17e017[_0xd482('0x39')]['ids'],'SmsAccountId':_0x17e017[_0xd482('0x55')]['id']});}});}})[_0xd482('0x1e')](respondWithStatusCode(_0xd947,null))['catch'](handleError(_0xd947,null));};exports[_0xd482('0xde')]=function(_0x2d931e,_0x38767c,_0x1dccb8){var _0x43ab22={};var _0x3e2eea={};var _0x361b3e;var _0x2ab4de;return db['SmsAccount'][_0xd482('0x69')]({'where':{'id':_0x2d931e['params']['id']}})[_0xd482('0x1e')](handleEntityNotFound(_0x38767c,null))[_0xd482('0x1e')](function(_0x24ca2c){if(_0x24ca2c){_0x361b3e=_0x24ca2c;_0x3e2eea[_0xd482('0x38')]=_[_0xd482('0x3c')](db[_0xd482('0xa6')][_0xd482('0x37')]);_0x3e2eea[_0xd482('0x39')]=_[_0xd482('0x3c')](_0x2d931e[_0xd482('0x39')]);_0x3e2eea[_0xd482('0x3d')]=_[_0xd482('0x3f')](_0x3e2eea[_0xd482('0x38')],_0x3e2eea[_0xd482('0x39')]);_0x43ab22['attributes']=_['intersection'](_0x3e2eea[_0xd482('0x38')],qs[_0xd482('0x40')](_0x2d931e[_0xd482('0x39')][_0xd482('0x40')]));_0x43ab22[_0xd482('0x3e')]=_0x43ab22[_0xd482('0x3e')][_0xd482('0x41')]?_0x43ab22[_0xd482('0x3e')]:_0x3e2eea[_0xd482('0x38')];_0x43ab22['order']=qs[_0xd482('0x44')](_0x2d931e['query']['sort']);_0x43ab22['where']=qs[_0xd482('0x3d')](_['pick'](_0x2d931e[_0xd482('0x39')],_0x3e2eea[_0xd482('0x3d')]));if(_0x2d931e[_0xd482('0x39')]['filter']){_0x43ab22['where']=_['merge'](_0x43ab22[_0xd482('0x49')],{'$or':_[_0xd482('0x4b')](_0x43ab22[_0xd482('0x3e')],function(_0x4dc176){var _0x1cbc08={};_0x1cbc08[_0x4dc176]={'$like':'%'+_0x2d931e['query'][_0xd482('0x4a')]+'%'};return _0x1cbc08;})});}_0x43ab22=_[_0xd482('0x48')]({},_0x43ab22,_0x2d931e[_0xd482('0x4f')]);return _0x361b3e[_0xd482('0xde')](_0x43ab22);}})[_0xd482('0x1e')](function(_0x3e7610){if(_0x3e7610){_0x2ab4de=_0x3e7610[_0xd482('0x41')];if(!_0x2d931e['query']['hasOwnProperty']('nolimit')){_0x43ab22[_0xd482('0x43')]=qs[_0xd482('0x43')](_0x2d931e[_0xd482('0x39')][_0xd482('0x43')]);_0x43ab22['offset']=qs[_0xd482('0x2b')](_0x2d931e[_0xd482('0x39')]['offset']);}return _0x361b3e[_0xd482('0xde')](_0x43ab22);}})['then'](function(_0x303fae){if(_0x303fae){return _0x303fae?{'count':_0x2ab4de,'rows':_0x303fae}:null;}})[_0xd482('0x1e')](respondWithResult(_0x38767c,null))['catch'](handleError(_0x38767c,null));};
\ No newline at end of file
+var _0xe292=['SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','get','SmsAccounts','destroy','stack','name','send','index','SmsAccount','model','dateStart','query','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','params','rawAttributes','find','create','body','user','userProfileId','autoAssociation','UserProfileResource','update','describe','addDisposition','SmsAccountId','Disposition','findOne','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','list','SmsInteraction','spread','interaction','autoclose','close','created','ContactId','AttachmentId','User','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','set','Content-Type','text/xml','addApplications','sequelize','transaction','bulkCreate','getApplications','Owner','fullname','internal','Tag','Tags','tag','CmList','List','out','SmsMessage','Messages','dataValues','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','intelepeer','redif','skebby','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','getAgents','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xe292,0x19e));var _0x2e29=function(_0x12a9cf,_0x2edbba){_0x12a9cf=_0x12a9cf-0x0;var _0x9e024b=_0xe292[_0x12a9cf];return _0x9e024b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2e29('0x0'));var zipdir=require(_0x2e29('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e29('0x2'));var BPromise=require(_0x2e29('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2e29('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e29('0x5'));var fs=require('fs');var _=require(_0x2e29('0x6'));var squel=require(_0x2e29('0x7'));var crypto=require(_0x2e29('0x8'));var jsforce=require(_0x2e29('0x9'));var deskjs=require(_0x2e29('0xa'));var toCsv=require(_0x2e29('0xb'));var querystring=require(_0x2e29('0xc'));var Papa=require(_0x2e29('0xd'));var Redis=require(_0x2e29('0xe'));var qs=require('../../components/parsers/qs');var logger=require(_0x2e29('0xf'))(_0x2e29('0x10'));var utils=require('../../config/utils');var config=require(_0x2e29('0x11'));var db=require(_0x2e29('0x12'))['db'];config[_0x2e29('0x13')]=_[_0x2e29('0x14')](config[_0x2e29('0x13')],{'host':_0x2e29('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e29('0x13')]));require(_0x2e29('0x16'))[_0x2e29('0x17')](socket);var jayson=require(_0x2e29('0x18'));var client=jayson[_0x2e29('0x19')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4b79ad,_0x32344b,_0x291319,_0x326b26){return new BPromise(function(_0x615f4d,_0x22a196){var _0x5dbc41=_0x326b26||client;return _0x5dbc41['request'](_0x4b79ad,_0x291319)[_0x2e29('0x1a')](function(_0x4e6f42){logger['info'](_0x2e29('0x1b'),_0x32344b,_0x2e29('0x1c'));logger[_0x2e29('0x1d')](_0x2e29('0x1e'),_0x32344b,_0x2e29('0x1c'),JSON[_0x2e29('0x1f')](_0x4e6f42));if(_0x4e6f42[_0x2e29('0x20')]){if(_0x4e6f42['error']['code']===0x1f4){logger[_0x2e29('0x20')]('SmsAccount,\x20%s,\x20%s',_0x32344b,_0x4e6f42[_0x2e29('0x20')][_0x2e29('0x21')]);return _0x22a196(_0x4e6f42[_0x2e29('0x20')]['message']);}logger['error'](_0x2e29('0x1b'),_0x32344b,_0x4e6f42[_0x2e29('0x20')][_0x2e29('0x21')]);return _0x615f4d(_0x4e6f42[_0x2e29('0x20')]['message']);}else{logger[_0x2e29('0x22')](_0x2e29('0x1b'),_0x32344b,_0x2e29('0x1c'));_0x615f4d(_0x4e6f42[_0x2e29('0x23')][_0x2e29('0x21')]);}})['catch'](function(_0xee5a46){logger[_0x2e29('0x20')](_0x2e29('0x1b'),_0x32344b,_0xee5a46);_0x22a196(_0xee5a46);});});}function respondWithStatusCode(_0x1c0b35,_0x32edc5){_0x32edc5=_0x32edc5||0xcc;return function(_0x367ddd){if(_0x367ddd){return _0x1c0b35[_0x2e29('0x24')](_0x32edc5);}return _0x1c0b35[_0x2e29('0x25')](_0x32edc5)[_0x2e29('0x26')]();};}function respondWithResult(_0x35a621,_0x121064){_0x121064=_0x121064||0xc8;return function(_0x57fa04){if(_0x57fa04){return _0x35a621[_0x2e29('0x25')](_0x121064)[_0x2e29('0x27')](_0x57fa04);}};}function respondWithFilteredResult(_0x367dae,_0x2b49b2){return function(_0x22ec51){if(_0x22ec51){var _0x476e17=_0x22ec51[_0x2e29('0x28')],_0x45a6dd=_0x2b49b2[_0x2e29('0x29')],_0x487e7a=_0x2b49b2[_0x2e29('0x29')]+_0x2b49b2[_0x2e29('0x2a')],_0x3b8b61;if(_0x487e7a>=_0x476e17){_0x487e7a=_0x476e17;_0x3b8b61=0xc8;}else{_0x3b8b61=0xce;}_0x367dae[_0x2e29('0x25')](_0x3b8b61);return _0x367dae['set'](_0x2e29('0x2b'),_0x45a6dd+'-'+_0x487e7a+'/'+_0x476e17)[_0x2e29('0x27')](_0x22ec51);}return null;};}function patchUpdates(_0x5441fa){return function(_0x387fd0){try{jsonpatch[_0x2e29('0x2c')](_0x387fd0,_0x5441fa,!![]);}catch(_0x4ab417){return BPromise[_0x2e29('0x2d')](_0x4ab417);}return _0x387fd0[_0x2e29('0x2e')]();};}function saveUpdates(_0x1816fc,_0xdc1cf9){return function(_0x31c282){if(_0x31c282){return _0x31c282['update'](_0x1816fc)[_0x2e29('0x1a')](function(_0x28085a){return _0x28085a;});}return null;};}function removeEntity(_0x210c69,_0x2d817a){return function(_0x2e6297){if(_0x2e6297){return _0x2e6297['destroy']()[_0x2e29('0x1a')](function(){var _0x19c20b=_0x2e6297[_0x2e29('0x2f')]({'plain':!![]});var _0x24a1fd=_0x2e29('0x30');return db['UserProfileResource'][_0x2e29('0x31')]({'where':{'type':_0x24a1fd,'resourceId':_0x19c20b['id']}})[_0x2e29('0x1a')](function(){return _0x2e6297;});})['then'](function(){_0x210c69[_0x2e29('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ccd5,_0x5ac372){return function(_0x2adc1c){if(!_0x2adc1c){_0x45ccd5['sendStatus'](0x194);}return _0x2adc1c;};}function handleError(_0x502b1b,_0x561a2a){_0x561a2a=_0x561a2a||0x1f4;return function(_0x475c49){logger[_0x2e29('0x20')](_0x475c49[_0x2e29('0x32')]);if(_0x475c49[_0x2e29('0x33')]){delete _0x475c49[_0x2e29('0x33')];}_0x502b1b[_0x2e29('0x25')](_0x561a2a)[_0x2e29('0x34')](_0x475c49);};}exports[_0x2e29('0x35')]=function(_0x34622f,_0x309dbf){var _0x23daa8={},_0x475ca5={},_0x463180={'count':0x0,'rows':[]};var _0xbebb0c=db[_0x2e29('0x36')]['rawAttributes'];_0x475ca5[_0x2e29('0x37')]=_['keys'](_0xbebb0c);var _0x3f2b14={'dateStart':_0x34622f['query'][_0x2e29('0x38')],'dateEnd':_0x34622f[_0x2e29('0x39')][_0x2e29('0x3a')]};delete _0x34622f['query'][_0x2e29('0x38')];delete _0x34622f[_0x2e29('0x39')][_0x2e29('0x3a')];_0x475ca5['query']=_[_0x2e29('0x3b')](_0x34622f[_0x2e29('0x39')]);_0x475ca5[_0x2e29('0x3c')]=_[_0x2e29('0x3d')](_0x475ca5[_0x2e29('0x37')],_0x475ca5[_0x2e29('0x39')]);_0x23daa8[_0x2e29('0x3e')]=_['intersection'](_0x475ca5[_0x2e29('0x37')],qs[_0x2e29('0x3f')](_0x34622f['query'][_0x2e29('0x3f')]));_0x23daa8[_0x2e29('0x3e')]=_0x23daa8['attributes'][_0x2e29('0x40')]?_0x23daa8['attributes']:_0x475ca5[_0x2e29('0x37')];if(!_0x34622f[_0x2e29('0x39')][_0x2e29('0x41')](_0x2e29('0x42'))){_0x23daa8[_0x2e29('0x2a')]=qs['limit'](_0x34622f[_0x2e29('0x39')][_0x2e29('0x2a')]);_0x23daa8[_0x2e29('0x29')]=qs['offset'](_0x34622f[_0x2e29('0x39')][_0x2e29('0x29')]);}_0x23daa8[_0x2e29('0x43')]=qs[_0x2e29('0x44')](_0x34622f[_0x2e29('0x39')][_0x2e29('0x44')]);_0x23daa8[_0x2e29('0x45')]=qs['filters'](_[_0x2e29('0x46')](_0x34622f[_0x2e29('0x39')],_0x475ca5['filters']));if(_0x3f2b14[_0x2e29('0x38')]){if(_0x3f2b14[_0x2e29('0x3a')]){_0x3f2b14['dateEnd']=moment(_0x3f2b14['dateEnd'])[_0x2e29('0x47')](0x1,_0x2e29('0x48'));}else{_0x3f2b14[_0x2e29('0x3a')]=moment(_0x3f2b14['dateStart'])[_0x2e29('0x47')](0x1,'day');}_['merge'](_0x23daa8[_0x2e29('0x45')],{'createdAt':{'$gte':_0x3f2b14[_0x2e29('0x38')],'$lte':_0x3f2b14[_0x2e29('0x3a')]}});}if(_0x34622f[_0x2e29('0x39')][_0x2e29('0x49')]){_0x23daa8['where']=_[_0x2e29('0x4a')](_0x23daa8[_0x2e29('0x45')],{'$or':_[_0x2e29('0x4b')](_0xbebb0c,function(_0x8db8b9){if(_0x8db8b9[_0x2e29('0x4c')][_0x2e29('0x4d')]!==_0x2e29('0x4e')){var _0x39c94b={};_0x39c94b[_0x8db8b9[_0x2e29('0x4f')]]={'$like':'%'+_0x34622f[_0x2e29('0x39')][_0x2e29('0x49')]+'%'};return _0x39c94b;}})});}_0x23daa8=_[_0x2e29('0x4a')]({},_0x23daa8,_0x34622f[_0x2e29('0x50')]);var _0x2775dd={'where':_0x23daa8['where']};return db[_0x2e29('0x36')][_0x2e29('0x28')](_0x2775dd)[_0x2e29('0x1a')](function(_0x274d5b){_0x463180[_0x2e29('0x28')]=_0x274d5b;if(_0x34622f[_0x2e29('0x39')]['includeAll']){_0x23daa8[_0x2e29('0x51')]=[{'all':!![]}];}return db[_0x2e29('0x36')][_0x2e29('0x52')](_0x23daa8);})[_0x2e29('0x1a')](function(_0x4e32eb){_0x463180['rows']=_0x4e32eb;return _0x463180;})[_0x2e29('0x1a')](respondWithFilteredResult(_0x309dbf,_0x23daa8))[_0x2e29('0x53')](handleError(_0x309dbf,null));};exports[_0x2e29('0x54')]=function(_0x1a0f20,_0x216acd){var _0xf28de5={'raw':![],'where':{'id':_0x1a0f20[_0x2e29('0x55')]['id']}},_0x16c253={};_0x16c253[_0x2e29('0x37')]=_[_0x2e29('0x3b')](db[_0x2e29('0x36')][_0x2e29('0x56')]);_0x16c253[_0x2e29('0x39')]=_[_0x2e29('0x3b')](_0x1a0f20['query']);_0x16c253[_0x2e29('0x3c')]=_[_0x2e29('0x3d')](_0x16c253[_0x2e29('0x37')],_0x16c253[_0x2e29('0x39')]);_0xf28de5[_0x2e29('0x3e')]=_[_0x2e29('0x3d')](_0x16c253[_0x2e29('0x37')],qs[_0x2e29('0x3f')](_0x1a0f20[_0x2e29('0x39')][_0x2e29('0x3f')]));_0xf28de5['attributes']=_0xf28de5[_0x2e29('0x3e')][_0x2e29('0x40')]?_0xf28de5['attributes']:_0x16c253['model'];if(_0x1a0f20[_0x2e29('0x39')]['includeAll']){_0xf28de5[_0x2e29('0x51')]=[{'all':!![]}];}_0xf28de5=_[_0x2e29('0x4a')]({},_0xf28de5,_0x1a0f20[_0x2e29('0x50')]);return db[_0x2e29('0x36')][_0x2e29('0x57')](_0xf28de5)['then'](handleEntityNotFound(_0x216acd,null))['then'](respondWithResult(_0x216acd,null))[_0x2e29('0x53')](handleError(_0x216acd,null));};exports[_0x2e29('0x58')]=function(_0x55bb1b,_0x10db43){return db['SmsAccount'][_0x2e29('0x58')](_0x55bb1b[_0x2e29('0x59')],{})[_0x2e29('0x1a')](function(_0x36f6ae){var _0x49c3d4=_0x55bb1b[_0x2e29('0x5a')][_0x2e29('0x2f')]({'plain':!![]});if(!_0x49c3d4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49c3d4['role']===_0x2e29('0x5a')){var _0x15af1c=_0x36f6ae[_0x2e29('0x2f')]({'plain':!![]});var _0x2a971e='SmsAccounts';return db['UserProfileSection'][_0x2e29('0x57')]({'where':{'name':_0x2a971e,'userProfileId':_0x49c3d4[_0x2e29('0x5b')]},'raw':!![]})[_0x2e29('0x1a')](function(_0x4ed8d5){if(_0x4ed8d5&&_0x4ed8d5[_0x2e29('0x5c')]===0x0){return db[_0x2e29('0x5d')]['create']({'name':_0x15af1c['name'],'resourceId':_0x15af1c['id'],'type':_0x4ed8d5[_0x2e29('0x33')],'sectionId':_0x4ed8d5['id']},{})[_0x2e29('0x1a')](function(){return _0x36f6ae;});}else{return _0x36f6ae;}})['catch'](function(_0x15fba6){logger[_0x2e29('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15fba6);throw _0x15fba6;});}return _0x36f6ae;})['then'](respondWithResult(_0x10db43,0xc9))[_0x2e29('0x53')](handleError(_0x10db43,null));};exports[_0x2e29('0x5e')]=function(_0x3fd849,_0x1b0f6a){if(_0x3fd849['body']['id']){delete _0x3fd849[_0x2e29('0x59')]['id'];}return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0x3fd849[_0x2e29('0x55')]['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x1b0f6a,null))[_0x2e29('0x1a')](saveUpdates(_0x3fd849['body'],null))[_0x2e29('0x1a')](respondWithResult(_0x1b0f6a,null))[_0x2e29('0x53')](handleError(_0x1b0f6a,null));};exports[_0x2e29('0x31')]=function(_0x2e91a5,_0x2c736a){return db[_0x2e29('0x36')]['find']({'where':{'id':_0x2e91a5[_0x2e29('0x55')]['id']}})['then'](handleEntityNotFound(_0x2c736a,null))[_0x2e29('0x1a')](removeEntity(_0x2c736a,null))[_0x2e29('0x53')](handleError(_0x2c736a,null));};exports[_0x2e29('0x5f')]=function(_0x2eba50,_0x5c3fd3){return db[_0x2e29('0x36')][_0x2e29('0x5f')]()[_0x2e29('0x1a')](respondWithResult(_0x5c3fd3,null))[_0x2e29('0x53')](handleError(_0x5c3fd3,null));};exports[_0x2e29('0x60')]=function(_0x4da7df,_0x4cdc7c,_0x241613){if(_0x4da7df['body']['id']){delete _0x4da7df[_0x2e29('0x59')]['id'];}return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0x4da7df['params']['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x4cdc7c,null))[_0x2e29('0x1a')](function(_0x3f0293){if(_0x3f0293){_0x4da7df[_0x2e29('0x59')][_0x2e29('0x61')]=_0x3f0293['id'];return db[_0x2e29('0x62')][_0x2e29('0x58')](_0x4da7df[_0x2e29('0x59')]);}})[_0x2e29('0x1a')](respondWithResult(_0x4cdc7c,null))[_0x2e29('0x53')](handleError(_0x4cdc7c,null));};exports['getDispositions']=function(_0x1779d3,_0x1ac2c0,_0x10fbd4){var _0x5ea0bf={'raw':![],'where':{}};var _0x29ad4e={};var _0x3d817e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2e29('0x63')]({'where':{'id':_0x1779d3['params']['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x1ac2c0,null))[_0x2e29('0x1a')](function(_0x5e1ee8){if(_0x5e1ee8){_0x29ad4e[_0x2e29('0x37')]=_[_0x2e29('0x3b')](db[_0x2e29('0x62')]['rawAttributes']);_0x29ad4e[_0x2e29('0x39')]=_[_0x2e29('0x3b')](_0x1779d3['query']);_0x29ad4e[_0x2e29('0x3c')]=_[_0x2e29('0x3d')](_0x29ad4e['model'],_0x29ad4e['query']);_0x5ea0bf[_0x2e29('0x3e')]=_[_0x2e29('0x3d')](_0x29ad4e[_0x2e29('0x37')],qs['fields'](_0x1779d3['query'][_0x2e29('0x3f')]));_0x5ea0bf[_0x2e29('0x3e')]=_0x5ea0bf['attributes']['length']?_0x5ea0bf[_0x2e29('0x3e')]:_0x29ad4e['model'];if(!_0x1779d3[_0x2e29('0x39')][_0x2e29('0x41')](_0x2e29('0x42'))){_0x5ea0bf[_0x2e29('0x2a')]=qs[_0x2e29('0x2a')](_0x1779d3['query'][_0x2e29('0x2a')]);_0x5ea0bf[_0x2e29('0x29')]=qs[_0x2e29('0x29')](_0x1779d3['query']['offset']);}_0x5ea0bf[_0x2e29('0x43')]=qs[_0x2e29('0x44')](_0x1779d3[_0x2e29('0x39')][_0x2e29('0x44')]);_0x5ea0bf[_0x2e29('0x45')]=qs[_0x2e29('0x3c')](_[_0x2e29('0x46')](_0x1779d3['query'],_0x29ad4e[_0x2e29('0x3c')]));_0x5ea0bf[_0x2e29('0x45')][_0x2e29('0x61')]=_0x5e1ee8['id'];if(_0x1779d3[_0x2e29('0x39')][_0x2e29('0x49')]){_0x5ea0bf[_0x2e29('0x45')]=_[_0x2e29('0x4a')](_0x5ea0bf[_0x2e29('0x45')],{'$or':_['map'](_0x5ea0bf[_0x2e29('0x3e')],function(_0x307be5){var _0x3fbcbb={};_0x3fbcbb[_0x307be5]={'$like':'%'+_0x1779d3[_0x2e29('0x39')][_0x2e29('0x49')]+'%'};return _0x3fbcbb;})});}_0x5ea0bf=_[_0x2e29('0x4a')]({},_0x5ea0bf,_0x1779d3[_0x2e29('0x50')]);return db[_0x2e29('0x62')]['count']({'where':_0x5ea0bf[_0x2e29('0x45')]})[_0x2e29('0x1a')](function(_0x2ad8ca){_0x3d817e[_0x2e29('0x28')]=_0x2ad8ca;if(_0x1779d3['query'][_0x2e29('0x64')]){_0x5ea0bf[_0x2e29('0x51')]=[{'all':!![]}];}return db[_0x2e29('0x62')][_0x2e29('0x52')](_0x5ea0bf);})[_0x2e29('0x1a')](function(_0x4c67f7){_0x3d817e[_0x2e29('0x65')]=_0x4c67f7;return _0x3d817e;});}})['then'](respondWithFilteredResult(_0x1ac2c0,_0x5ea0bf))[_0x2e29('0x53')](handleError(_0x1ac2c0,null));};exports[_0x2e29('0x66')]=function(_0x480504,_0x400724,_0x2e03d0){var _0x4f79fa;return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0x480504['params']['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x400724,null))['then'](function(_0x2fdf1e){if(_0x2fdf1e){return _0x2fdf1e[_0x2e29('0x66')](_0x480504[_0x2e29('0x39')][_0x2e29('0x67')]);}})[_0x2e29('0x1a')](respondWithStatusCode(_0x400724,null))[_0x2e29('0x53')](handleError(_0x400724,null));};exports[_0x2e29('0x68')]=function(_0x1df2df,_0x241abe,_0x2f2a1f){if(_0x1df2df[_0x2e29('0x59')]['id']){delete _0x1df2df[_0x2e29('0x59')]['id'];}return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0x1df2df[_0x2e29('0x55')]['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x241abe,null))[_0x2e29('0x1a')](function(_0x406156){if(_0x406156){_0x1df2df[_0x2e29('0x59')]['SmsAccountId']=_0x406156['id'];return db[_0x2e29('0x69')][_0x2e29('0x58')](_0x1df2df['body']);}})['then'](respondWithResult(_0x241abe,null))[_0x2e29('0x53')](handleError(_0x241abe,null));};exports[_0x2e29('0x6a')]=function(_0x49512c,_0x52f772,_0x1bdc24){var _0x3716bf={'raw':![],'where':{}};var _0x39a073={};var _0x498c44={'count':0x0,'rows':[]};return db[_0x2e29('0x36')][_0x2e29('0x63')]({'where':{'id':_0x49512c['params']['id']}})['then'](handleEntityNotFound(_0x52f772,null))[_0x2e29('0x1a')](function(_0x41ae75){if(_0x41ae75){_0x39a073[_0x2e29('0x37')]=_[_0x2e29('0x3b')](db['CannedAnswer']['rawAttributes']);_0x39a073[_0x2e29('0x39')]=_[_0x2e29('0x3b')](_0x49512c[_0x2e29('0x39')]);_0x39a073['filters']=_['intersection'](_0x39a073[_0x2e29('0x37')],_0x39a073['query']);_0x3716bf[_0x2e29('0x3e')]=_['intersection'](_0x39a073[_0x2e29('0x37')],qs[_0x2e29('0x3f')](_0x49512c[_0x2e29('0x39')]['fields']));_0x3716bf['attributes']=_0x3716bf['attributes'][_0x2e29('0x40')]?_0x3716bf[_0x2e29('0x3e')]:_0x39a073[_0x2e29('0x37')];if(!_0x49512c[_0x2e29('0x39')][_0x2e29('0x41')](_0x2e29('0x42'))){_0x3716bf['limit']=qs[_0x2e29('0x2a')](_0x49512c[_0x2e29('0x39')][_0x2e29('0x2a')]);_0x3716bf[_0x2e29('0x29')]=qs[_0x2e29('0x29')](_0x49512c[_0x2e29('0x39')][_0x2e29('0x29')]);}_0x3716bf['order']=qs[_0x2e29('0x44')](_0x49512c[_0x2e29('0x39')][_0x2e29('0x44')]);_0x3716bf[_0x2e29('0x45')]=qs[_0x2e29('0x3c')](_[_0x2e29('0x46')](_0x49512c['query'],_0x39a073[_0x2e29('0x3c')]));_0x3716bf['where'][_0x2e29('0x61')]=_0x41ae75['id'];if(_0x49512c['query'][_0x2e29('0x49')]){_0x3716bf['where']=_['merge'](_0x3716bf[_0x2e29('0x45')],{'$or':_[_0x2e29('0x4b')](_0x3716bf[_0x2e29('0x3e')],function(_0x1879e8){var _0x4af0ba={};_0x4af0ba[_0x1879e8]={'$like':'%'+_0x49512c['query'][_0x2e29('0x49')]+'%'};return _0x4af0ba;})});}_0x3716bf=_[_0x2e29('0x4a')]({},_0x3716bf,_0x49512c[_0x2e29('0x50')]);return db[_0x2e29('0x69')]['count']({'where':_0x3716bf[_0x2e29('0x45')]})[_0x2e29('0x1a')](function(_0x14503f){_0x498c44[_0x2e29('0x28')]=_0x14503f;if(_0x49512c[_0x2e29('0x39')]['includeAll']){_0x3716bf[_0x2e29('0x51')]=[{'all':!![]}];}return db[_0x2e29('0x69')]['findAll'](_0x3716bf);})[_0x2e29('0x1a')](function(_0x37f633){_0x498c44[_0x2e29('0x65')]=_0x37f633;return _0x498c44;});}})[_0x2e29('0x1a')](respondWithFilteredResult(_0x52f772,_0x3716bf))['catch'](handleError(_0x52f772,null));};exports[_0x2e29('0x6b')]=function(_0x21eacd,_0x43d5ae,_0x56c74b){var _0x58929d;return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0x21eacd['params']['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x43d5ae,null))[_0x2e29('0x1a')](function(_0x4212d9){if(_0x4212d9){return _0x4212d9[_0x2e29('0x6b')](_0x21eacd[_0x2e29('0x39')]['ids']);}})[_0x2e29('0x1a')](respondWithStatusCode(_0x43d5ae,null))['catch'](handleError(_0x43d5ae,null));};exports[_0x2e29('0x6c')]=function(_0xcec236,_0x593872,_0x5a5f3c){var _0x2c7d4c={'channel':_0x2e29('0x6d')};var _0x570d87=[];var _0x255c1f=[];var _0x5acc05={};return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0xcec236[_0x2e29('0x55')]['id']},'include':[{'model':db[_0x2e29('0x6e')],'as':'Applications'}]})[_0x2e29('0x1a')](handleEntityNotFound(_0x593872,null))['then'](function(_0x319384){_0x2c7d4c[_0x2e29('0x6f')]=_0x319384;_0x2c7d4c[_0x2e29('0x70')]=_[_0x2e29('0x71')](_0x319384[_0x2e29('0x72')],[_0x2e29('0x73')],[_0x2e29('0x74')]);if(_0x2c7d4c['account'][_0x2e29('0x72')]){delete _0x2c7d4c['account'][_0x2e29('0x72')];}return db['CmContact'][_0x2e29('0x5f')]();})['then'](function(_0x17a092){if(!_0x17a092){throw new db[(_0x2e29('0x75'))][(_0x2e29('0x76'))]('no\x20available\x20attributes');}_0x570d87=_['difference'](_[_0x2e29('0x3b')](_0x17a092),[_0x2e29('0x77'),_0x2e29('0x78')]);_0x255c1f=_[_0x2e29('0x79')](_[_0x2e29('0x3b')](_0x17a092),[_0x2e29('0x77'),'updatedAt',_0x2e29('0x7a'),_0x2e29('0x7b')]);_0x2c7d4c[_0x2e29('0x59')]={'mapKey':_0x2e29('0x7c')};if(_0x2c7d4c[_0x2e29('0x6f')][_0x2e29('0x4c')]){switch(_0x2c7d4c[_0x2e29('0x6f')][_0x2e29('0x4c')]){case _0x2e29('0x7d'):_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x7f')];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x59')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x80')];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x81')]=_0xcec236[_0x2e29('0x59')]['MessageSid'];break;case'skebby':_0x2c7d4c['body'][_0x2e29('0x7e')]='+'+_0xcec236[_0x2e29('0x59')][_0x2e29('0x82')];_0x2c7d4c['body'][_0x2e29('0x59')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x83')];break;case _0x2e29('0x84'):_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')]=_0xcec236['body']['from'];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x59')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x21')];break;case _0x2e29('0x85'):_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')]=_0xcec236['body']['from'];_0x2c7d4c[_0x2e29('0x59')]['body']=_0xcec236['body']['body'];_0x2c7d4c['body'][_0x2e29('0x81')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x86')];break;case _0x2e29('0x87'):_0x2c7d4c['body'][_0x2e29('0x7e')]=_0xcec236[_0x2e29('0x59')]['From'];_0x2c7d4c[_0x2e29('0x59')]['body']=_0xcec236[_0x2e29('0x59')][_0x2e29('0x88')];_0x2c7d4c['body'][_0x2e29('0x81')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x89')];break;case'infobip':_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')]='+'+_0xcec236[_0x2e29('0x59')][_0x2e29('0x8a')][0x0]['from'];_0x2c7d4c[_0x2e29('0x59')]['body']=_0xcec236[_0x2e29('0x59')]['results'][0x0][_0x2e29('0x83')];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x81')]=_0xcec236[_0x2e29('0x59')]['results'][0x0]['messageId'];break;case _0x2e29('0x8b'):_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x8c')];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x59')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x8d')][_0x2e29('0x21')];break;case _0x2e29('0x8e'):_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x8f')];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x59')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x83')];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x81')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x90')];break;case'intelepeer':_0x2c7d4c['body'][_0x2e29('0x7e')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x7e')];_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x59')]=_0xcec236['body'][_0x2e29('0x21')];_0x2c7d4c['body'][_0x2e29('0x81')]=_0xcec236[_0x2e29('0x59')][_0x2e29('0x91')];break;}}if(_0x2c7d4c['body']['id']){delete _0x2c7d4c[_0x2e29('0x59')]['id'];}if(_['isNil'](_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')])){throw new db[(_0x2e29('0x75'))]['ValidationError'](_0x2e29('0x92'));}if(_[_0x2e29('0x93')](_0x2c7d4c[_0x2e29('0x59')]['body'])||_0x2c7d4c['body'][_0x2e29('0x59')]===''){throw new db[(_0x2e29('0x75'))][(_0x2e29('0x76'))](_0x2e29('0x94'));}if(_[_0x2e29('0x93')](_0x2c7d4c[_0x2e29('0x59')]['mapKey'])){throw new db[(_0x2e29('0x75'))][(_0x2e29('0x76'))](_0x2e29('0x95')+_0x255c1f);}if(!_[_0x2e29('0x96')](_0x255c1f,_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x97')])){throw new db[(_0x2e29('0x75'))][(_0x2e29('0x76'))](_0x2e29('0x98')+_0x255c1f);}_0x5acc05[_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x97')]]=_0x2c7d4c[_0x2e29('0x59')]['from'];return db['CmList']['find']({'where':{'id':_0x2c7d4c[_0x2e29('0x6f')][_0x2e29('0x7b')]},'include':[{'model':db[_0x2e29('0x99')],'as':_0x2e29('0x9a'),'where':_0x5acc05,'limit':0x1,'order':[[_0x2e29('0x78'),_0x2e29('0x9b')]]}]});})[_0x2e29('0x1a')](handleEntityNotFound(_0x593872,null))[_0x2e29('0x1a')](function(_0x519935){if(_0x519935){_0x2c7d4c[_0x2e29('0x9c')]=_['omit'](_0x519935,[_0x2e29('0x9a')]);if(_0x519935[_0x2e29('0x9a')]['length']){return _0x519935[_0x2e29('0x9a')][0x0];}var _0x2af6a0=_[_0x2e29('0x14')](_0x2c7d4c[_0x2e29('0x59')],{'firstName':_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')],'ListId':_0x519935['id']});_0x2af6a0[_0x2c7d4c[_0x2e29('0x59')]['mapKey']]=_0x2c7d4c['body'][_0x2e29('0x7e')];return db[_0x2e29('0x99')]['create'](_0x2af6a0,{'fields':_0x570d87,'raw':!![]});}})[_0x2e29('0x1a')](handleEntityNotFound(_0x593872,null))[_0x2e29('0x1a')](function(_0x41042b){if(_0x41042b){_0x2c7d4c['contact']=_0x41042b;var _0x2e1a32={'ContactId':_0x41042b['id'],'phone':_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x7e')],'SmsAccountId':_0xcec236[_0x2e29('0x55')]['id']};var _0x5b2644={'ContactId':_0x41042b['id'],'SmsAccountId':_0xcec236[_0x2e29('0x55')]['id'],'closed':![]};return db[_0x2e29('0x9d')]['find']({'where':_0x5b2644})[_0x2e29('0x1a')](function(_0x2bbca8){if(_0x2bbca8){return[_0x2bbca8,![]];}return db[_0x2e29('0x9d')]['create'](_0x2e1a32)[_0x2e29('0x1a')](function(_0xc81fbb){return[_0xc81fbb,!![]];});});}})[_0x2e29('0x9e')](function(_0x18b854,_0xbdc9bc){_0x2c7d4c['interaction']=_0x18b854[_0x2e29('0x2f')]({'plain':!![]});_0x2c7d4c[_0x2e29('0x9f')]['created']=![];if(_0xbdc9bc){if(_0x2c7d4c['account'][_0x2e29('0xa0')]){_0x2c7d4c[_0x2e29('0x70')]['push']({'id':0x0,'priority':_0x2c7d4c['applications'][_0x2e29('0x40')]+0x1,'app':_0x2e29('0xa1'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x2c7d4c['interaction'][_0x2e29('0xa2')]=!![];}return db['SmsMessage'][_0x2e29('0x58')]({'phone':_0x2c7d4c['body'][_0x2e29('0x7e')],'messageId':_0x2c7d4c['body'][_0x2e29('0x81')],'body':_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0x59')],'SmsAccountId':_0xcec236[_0x2e29('0x55')]['id'],'SmsInteractionId':_0x18b854['id'],'direction':'in','ContactId':_0x18b854[_0x2e29('0xa3')],'AttachmentId':_0x2c7d4c[_0x2e29('0x59')][_0x2e29('0xa4')]});})[_0x2e29('0x1a')](function(_0x30113e){_0x2c7d4c[_0x2e29('0x21')]=_0x30113e;if(_0x2c7d4c[_0x2e29('0x9f')]['UserId']){return db[_0x2e29('0xa5')][_0x2e29('0x57')]({'attributes':['id','name'],'where':{'id':_0x2c7d4c[_0x2e29('0x9f')][_0x2e29('0xa6')]}})['then'](function(_0x31ffa4){if(_0x31ffa4){_0x2c7d4c['applications'][_0x2e29('0xa7')]({'id':0x0,'priority':0x0,'app':_0x2e29('0xa8'),'appdata':_0x31ffa4[_0x2e29('0x33')]+','+(_0x2c7d4c[_0x2e29('0x6f')]['waitForTheAssignedAgent']||0xa),'interval':_0x2e29('0xa9')});}return respondWithRpcPromise(_0x2e29('0xaa'),_0x2e29('0xab'),_0x2c7d4c);});}return respondWithRpcPromise(_0x2e29('0xaa'),_0x2e29('0xab'),_0x2c7d4c);})['then'](function(_0x35789f){if(_0x35789f){var _0x800169=0xc8;var _0x1ea876=_0x2e29('0xac');logger[_0x2e29('0x22')](_0x2e29('0x1e'),_0x1ea876,_0x800169,_0x2e29('0xad'));logger[_0x2e29('0x1d')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1ea876,_0x800169,_0x2e29('0xad'),JSON[_0x2e29('0x1f')](_0x35789f));if(_0x2c7d4c[_0x2e29('0x6f')][_0x2e29('0x4c')]===_0x2e29('0x7d')){return _0x593872[_0x2e29('0x25')](_0x800169)[_0x2e29('0xae')](_0x2e29('0xaf'),_0x2e29('0xb0'))[_0x2e29('0x34')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x593872[_0x2e29('0x25')](_0x800169)[_0x2e29('0x27')](_0x35789f);}}})[_0x2e29('0x53')](handleError(_0x593872,null));};exports[_0x2e29('0xb1')]=function(_0x55f1c9,_0x68a300,_0x42e395){return db['SmsAccount'][_0x2e29('0x63')]({'where':{'id':_0x55f1c9[_0x2e29('0x55')]['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x68a300,null))[_0x2e29('0x1a')](function(_0x71d822){if(_0x71d822){return db[_0x2e29('0xb2')][_0x2e29('0xb3')](function(_0x33148e){return db[_0x2e29('0x6e')][_0x2e29('0x31')]({'where':{'SmsAccountId':_0x55f1c9[_0x2e29('0x55')]['id']},'transaction':_0x33148e})[_0x2e29('0x1a')](function(_0x5071c2){var _0x128376=_[_0x2e29('0x4b')](_0x55f1c9[_0x2e29('0x59')],function(_0x24582b){_0x24582b[_0x2e29('0x61')]=_0x55f1c9[_0x2e29('0x55')]['id'];return _0x24582b;});return db[_0x2e29('0x6e')][_0x2e29('0xb4')](_0x128376,{'transaction':_0x33148e});});})[_0x2e29('0x1a')](function(){return db[_0x2e29('0x6e')]['findAndCountAll']({'where':{'SmsAccountId':_0x55f1c9[_0x2e29('0x55')]['id']},'order':_0x2e29('0x73')});});}})[_0x2e29('0x1a')](respondWithResult(_0x68a300,null))[_0x2e29('0x53')](handleError(_0x68a300,null));};exports['getApplications']=function(_0x4168e5,_0x3f29e9,_0x4d3c78){var _0x550f0b={};var _0x55b1aa={};var _0x35c50d;var _0x167253;return db[_0x2e29('0x36')]['findOne']({'where':{'id':_0x4168e5['params']['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x3f29e9,null))['then'](function(_0x4bb391){if(_0x4bb391){_0x35c50d=_0x4bb391;_0x55b1aa[_0x2e29('0x37')]=_[_0x2e29('0x3b')](db[_0x2e29('0x6e')][_0x2e29('0x56')]);_0x55b1aa[_0x2e29('0x39')]=_['keys'](_0x4168e5[_0x2e29('0x39')]);_0x55b1aa[_0x2e29('0x3c')]=_['intersection'](_0x55b1aa[_0x2e29('0x37')],_0x55b1aa['query']);_0x550f0b[_0x2e29('0x3e')]=_[_0x2e29('0x3d')](_0x55b1aa[_0x2e29('0x37')],qs[_0x2e29('0x3f')](_0x4168e5['query']['fields']));_0x550f0b[_0x2e29('0x3e')]=_0x550f0b[_0x2e29('0x3e')][_0x2e29('0x40')]?_0x550f0b[_0x2e29('0x3e')]:_0x55b1aa[_0x2e29('0x37')];_0x550f0b['order']=qs[_0x2e29('0x44')](_0x4168e5[_0x2e29('0x39')][_0x2e29('0x44')]);_0x550f0b['where']=qs[_0x2e29('0x3c')](_['pick'](_0x4168e5['query'],_0x55b1aa['filters']));if(_0x4168e5[_0x2e29('0x39')][_0x2e29('0x49')]){_0x550f0b[_0x2e29('0x45')]=_[_0x2e29('0x4a')](_0x550f0b[_0x2e29('0x45')],{'$or':_[_0x2e29('0x4b')](_0x550f0b[_0x2e29('0x3e')],function(_0xc60d46){var _0xefc1bd={};_0xefc1bd[_0xc60d46]={'$like':'%'+_0x4168e5[_0x2e29('0x39')]['filter']+'%'};return _0xefc1bd;})});}_0x550f0b=_[_0x2e29('0x4a')]({},_0x550f0b,_0x4168e5[_0x2e29('0x50')]);return _0x35c50d[_0x2e29('0xb5')](_0x550f0b);}})[_0x2e29('0x1a')](function(_0xafa0f0){if(_0xafa0f0){_0x167253=_0xafa0f0['length'];if(!_0x4168e5[_0x2e29('0x39')][_0x2e29('0x41')]('nolimit')){_0x550f0b[_0x2e29('0x2a')]=qs[_0x2e29('0x2a')](_0x4168e5[_0x2e29('0x39')]['limit']);_0x550f0b['offset']=qs[_0x2e29('0x29')](_0x4168e5[_0x2e29('0x39')][_0x2e29('0x29')]);}return _0x35c50d[_0x2e29('0xb5')](_0x550f0b);}})[_0x2e29('0x1a')](function(_0x30f895){if(_0x30f895){return _0x30f895?{'count':_0x167253,'rows':_0x30f895}:null;}})[_0x2e29('0x1a')](respondWithResult(_0x3f29e9,null))[_0x2e29('0x53')](handleError(_0x3f29e9,null));};exports['getInteractions']=function(_0x38a571,_0x8fa4b5,_0xc537bb){var _0x1fde50={'raw':![],'where':{}};var _0x3449f9={};var _0x16bc16={'count':0x0,'rows':[]};return db[_0x2e29('0x36')]['findOne']({'where':{'id':_0x38a571[_0x2e29('0x55')]['id']}})['then'](handleEntityNotFound(_0x8fa4b5,null))[_0x2e29('0x1a')](function(_0x469cb0){if(_0x469cb0){_0x3449f9[_0x2e29('0x37')]=_[_0x2e29('0x3b')](db['SmsInteraction'][_0x2e29('0x56')]);_0x3449f9[_0x2e29('0x39')]=_['keys'](_0x38a571[_0x2e29('0x39')]);_0x3449f9[_0x2e29('0x3c')]=_[_0x2e29('0x3d')](_0x3449f9[_0x2e29('0x37')],_0x3449f9[_0x2e29('0x39')]);_0x1fde50[_0x2e29('0x3e')]=_[_0x2e29('0x3d')](_0x3449f9[_0x2e29('0x37')],qs[_0x2e29('0x3f')](_0x38a571[_0x2e29('0x39')][_0x2e29('0x3f')]));_0x1fde50[_0x2e29('0x3e')]=_0x1fde50['attributes'][_0x2e29('0x40')]?_0x1fde50[_0x2e29('0x3e')]:_0x3449f9[_0x2e29('0x37')];if(!_0x38a571['query']['hasOwnProperty']('nolimit')){_0x1fde50[_0x2e29('0x2a')]=qs[_0x2e29('0x2a')](_0x38a571[_0x2e29('0x39')][_0x2e29('0x2a')]);_0x1fde50['offset']=qs[_0x2e29('0x29')](_0x38a571[_0x2e29('0x39')][_0x2e29('0x29')]);}_0x1fde50['order']=qs[_0x2e29('0x44')](_0x38a571[_0x2e29('0x39')][_0x2e29('0x44')]);_0x1fde50[_0x2e29('0x45')]=qs[_0x2e29('0x3c')](_[_0x2e29('0x46')](_0x38a571['query'],_0x3449f9[_0x2e29('0x3c')]));_0x1fde50[_0x2e29('0x45')][_0x2e29('0x61')]=_0x469cb0['id'];if(_0x38a571[_0x2e29('0x39')]['filter']){_0x1fde50[_0x2e29('0x45')]=_[_0x2e29('0x4a')](_0x1fde50[_0x2e29('0x45')],{'$or':_[_0x2e29('0x4b')](_0x1fde50[_0x2e29('0x3e')],function(_0x4dd87f){var _0x3b9da4={};_0x3b9da4[_0x4dd87f]={'$like':'%'+_0x38a571[_0x2e29('0x39')]['filter']+'%'};return _0x3b9da4;})});}_0x1fde50=_[_0x2e29('0x4a')]({},_0x1fde50,_0x38a571[_0x2e29('0x50')]);return db[_0x2e29('0x9d')][_0x2e29('0x28')]({'where':_0x1fde50[_0x2e29('0x45')]})[_0x2e29('0x1a')](function(_0x37e425){_0x16bc16[_0x2e29('0x28')]=_0x37e425;if(_0x38a571[_0x2e29('0x39')][_0x2e29('0x64')]){_0x1fde50['include']=[{'model':db[_0x2e29('0x99')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x2e29('0xb6'),'attributes':[_0x2e29('0x33'),_0x2e29('0xb7'),_0x2e29('0xb8')],'required':![]},{'model':db[_0x2e29('0xb9')],'as':_0x2e29('0xba'),'attributes':['id',_0x2e29('0x33'),'color'],'where':_0x38a571[_0x2e29('0x39')]['tag']?{'id':_0x38a571[_0x2e29('0x39')]['tag']}:undefined,'required':_0x38a571[_0x2e29('0x39')][_0x2e29('0xbb')]?!![]:![]}];}return db[_0x2e29('0x9d')]['findAll'](_0x1fde50);})[_0x2e29('0x1a')](function(_0x3fe5bf){_0x16bc16[_0x2e29('0x65')]=_0x3fe5bf;return _0x16bc16;});}})['then'](respondWithFilteredResult(_0x8fa4b5,_0x1fde50))['catch'](handleError(_0x8fa4b5,null));};exports[_0x2e29('0x34')]=function(_0x2b554f,_0x18ce59,_0x56cfea){var _0x5b82d9,_0x2539f7,_0x270f89;if(_[_0x2e29('0x93')](_0x2b554f['body'][_0x2e29('0x59')])||_0x2b554f[_0x2e29('0x59')][_0x2e29('0x59')]===''){throw new db[(_0x2e29('0x75'))][(_0x2e29('0x76'))](_0x2e29('0x94'));}if(_[_0x2e29('0x93')](_0x2b554f['body']['to'])){throw new db[(_0x2e29('0x75'))][(_0x2e29('0x76'))]('to\x20is\x20mandatory');}_0x5b82d9=_0x2b554f[_0x2e29('0x59')]['to'];return db[_0x2e29('0x36')]['find']({'where':{'id':_0x2b554f[_0x2e29('0x55')]['id']},'include':[{'model':db[_0x2e29('0xbc')],'as':_0x2e29('0xbd'),'include':[{'model':db[_0x2e29('0x99')],'as':_0x2e29('0x9a'),'where':{'mobile':_0x5b82d9},'limit':0x1,'order':[['updatedAt',_0x2e29('0x9b')]]}]}]})[_0x2e29('0x1a')](handleEntityNotFound(_0x18ce59,null))[_0x2e29('0x1a')](function(_0x261853){if(_0x261853&&_0x261853[_0x2e29('0xbd')]){_0x2539f7=_0x261853[_0x2e29('0x2f')]({'plain':!![]});if(_0x2539f7[_0x2e29('0xbd')]&&_0x2539f7['List'][_0x2e29('0x9a')][_0x2e29('0x40')]){return _0x2539f7[_0x2e29('0xbd')][_0x2e29('0x9a')][0x0];}return db[_0x2e29('0x99')][_0x2e29('0x58')](_[_0x2e29('0x14')](_0x2b554f[_0x2e29('0x59')],{'firstName':_0x5b82d9,'mobile':_0x5b82d9,'phone':_0x5b82d9,'ListId':_0x2539f7[_0x2e29('0x7b')]}));}})[_0x2e29('0x1a')](handleEntityNotFound(_0x18ce59,null))[_0x2e29('0x1a')](function(_0x24ca79){if(_0x24ca79){_0x270f89=_0x24ca79;return db[_0x2e29('0x9d')][_0x2e29('0x57')]({'where':{'ContactId':_0x270f89['id'],'closed':![],'SmsAccountId':_0x2539f7['id']}})[_0x2e29('0x1a')](function(_0xfdb225){if(_0xfdb225){return[_0xfdb225,![]];}return db[_0x2e29('0x9d')][_0x2e29('0x58')]({'UserId':_0x2b554f[_0x2e29('0x5a')]['id'],'ContactId':_0x270f89['id'],'SmsAccountId':_0x2539f7['id'],'phone':_0x5b82d9,'firstMsgDirection':_0x2e29('0xbe'),'Messages':[_[_0x2e29('0x4a')](_0x2b554f[_0x2e29('0x59')],{'read':![],'body':_0x2b554f[_0x2e29('0x59')][_0x2e29('0x59')],'phone':_0x5b82d9,'SmsAccountId':_0x2539f7['id'],'UserId':_0x2b554f[_0x2e29('0x5a')]['id'],'ContactId':_0x270f89['id']})]},{'include':[{'model':db[_0x2e29('0xbf')],'as':_0x2e29('0xc0')}]})[_0x2e29('0x1a')](function(_0x11d809){return[_0x11d809,!![]];});});}})['spread'](function(_0x9e50c8,_0x11c084){if(_0x11c084){return _0x9e50c8;}return db[_0x2e29('0xbf')][_0x2e29('0x58')](_[_0x2e29('0x4a')](_0x2b554f[_0x2e29('0x59')],{'read':![],'body':_0x2b554f[_0x2e29('0x59')][_0x2e29('0x59')],'phone':_0x5b82d9,'SmsAccountId':_0x2539f7['id'],'SmsInteractionId':_0x9e50c8['id'],'UserId':_0x2b554f[_0x2e29('0x5a')]['id'],'ContactId':_0x270f89['id']}))['then'](function(_0x219c2e){_0x9e50c8[_0x2e29('0xc1')][_0x2e29('0xc0')]=[];_0x9e50c8[_0x2e29('0xc1')]['Messages']['push'](_0x219c2e[_0x2e29('0xc1')]);return _0x9e50c8;});})[_0x2e29('0x1a')](respondWithResult(_0x18ce59,null))[_0x2e29('0x53')](handleError(_0x18ce59,null));};exports[_0x2e29('0x25')]=function(_0x598c7e,_0x5218bb,_0x5b4537){if(_0x598c7e[_0x2e29('0x59')]['id']){delete _0x598c7e[_0x2e29('0x59')]['id'];}console[_0x2e29('0xc2')]('endpoint\x20/status\x20POST\x20/',_0x598c7e['body']);var _0x42f03d,_0x5e07a6,_0x538979;return db[_0x2e29('0x36')]['find']({'where':{'id':_0x598c7e[_0x2e29('0x55')]['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x5218bb,null))[_0x2e29('0x1a')](function(_0x205827){if(_0x205827){_0x538979=_0x205827;logger[_0x2e29('0x1d')](_0x2e29('0x1e'),_0x2e29('0x25'),_0x2e29('0xc3'),_0x205827['type'],util[_0x2e29('0xc4')](_0x598c7e[_0x2e29('0x59')],{'showHidden':![],'depth':null}));switch(_0x205827[_0x2e29('0x4c')]){case'skebby':if(_0x598c7e[_0x2e29('0x59')][_0x2e29('0xc5')]&&_0x598c7e[_0x2e29('0x59')][_0x2e29('0x25')]){_0x5e07a6=_0x598c7e[_0x2e29('0x59')][_0x2e29('0x25')];return db[_0x2e29('0xbf')]['find']({'where':{'messageId':_0x598c7e[_0x2e29('0x59')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x598c7e['body'][_0x2e29('0xc6')]&&_0x598c7e[_0x2e29('0x59')][_0x2e29('0xc7')]){_0x5e07a6=_0x598c7e[_0x2e29('0x59')][_0x2e29('0xc7')];return db[_0x2e29('0xbf')]['find']({'where':{'messageId':_0x598c7e[_0x2e29('0x59')][_0x2e29('0xc6')]}});}break;case'clicksend':if(_0x598c7e[_0x2e29('0x59')][_0x2e29('0x86')]&&_0x598c7e[_0x2e29('0x59')][_0x2e29('0xc8')]){_0x5e07a6=_0x598c7e[_0x2e29('0x59')][_0x2e29('0xc8')];return db['SmsMessage']['find']({'where':{'messageId':_0x598c7e[_0x2e29('0x59')][_0x2e29('0x86')]}});}break;case _0x2e29('0xc9'):var _0x47094b=_0x598c7e[_0x2e29('0x59')]['results'][0x0];if(_0x47094b['messageId']&&_0x47094b['status'][_0x2e29('0xca')]===_0x2e29('0xcb')){_0x5e07a6=_0x47094b[_0x2e29('0x25')][_0x2e29('0xca')];return db[_0x2e29('0xbf')][_0x2e29('0x57')]({'where':{'messageId':_0x47094b['messageId']}});}break;case _0x2e29('0x8e'):if(_0x598c7e[_0x2e29('0x59')][_0x2e29('0x81')]&&_0x598c7e[_0x2e29('0x59')]['status']){_0x5e07a6=_0x598c7e[_0x2e29('0x59')]['status'];return db[_0x2e29('0xbf')][_0x2e29('0x57')]({'where':{'messageId':_0x598c7e['body'][_0x2e29('0x81')]}});}break;case _0x2e29('0xcc'):if(_0x598c7e[_0x2e29('0x59')][_0x2e29('0xcd')]&&_0x598c7e['body'][_0x2e29('0x25')]){_0x5e07a6=_0x598c7e[_0x2e29('0x59')][_0x2e29('0x25')];return db[_0x2e29('0xbf')]['find']({'where':{'messageId':_0x598c7e[_0x2e29('0x59')][_0x2e29('0xcd')]}});}break;}}})[_0x2e29('0x1a')](handleEntityNotFound(_0x5218bb,null))[_0x2e29('0x1a')](function(_0x23780c){if(_0x23780c){_0x42f03d=_0x23780c;switch(_0x538979[_0x2e29('0x4c')]){case _0x2e29('0xce'):if(_0x5e07a6===_0x2e29('0xcb')){return _0x42f03d[_0x2e29('0x5e')]({'read':!![]});}else{logger[_0x2e29('0x20')](_0x2e29('0x1e'),'status',_0x2e29('0xce'),util['inspect'](_0x598c7e[_0x2e29('0x59')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5e07a6==='1'){return _0x42f03d['update']({'read':!![]});}else{logger[_0x2e29('0x20')](_0x2e29('0x1e'),_0x2e29('0x25'),_0x2e29('0xce'),util[_0x2e29('0xc4')](_0x598c7e[_0x2e29('0x59')],{'showHidden':![],'depth':null}));}break;case _0x2e29('0x85'):if(!_0x598c7e['body'][_0x2e29('0xcf')]&&_0x5e07a6>=0xc8&&_0x5e07a6<=0xce){return _0x42f03d['update']({'read':!![]});}else{logger[_0x2e29('0x20')](_0x2e29('0x1e'),_0x2e29('0x25'),_0x2e29('0x85'),util[_0x2e29('0xc4')](_0x598c7e[_0x2e29('0x59')],{'showHidden':![],'depth':null}));}break;case _0x2e29('0xc9'):var _0x6299e4=_0x598c7e[_0x2e29('0x59')][_0x2e29('0x8a')][0x0];if(_0x6299e4[_0x2e29('0x25')][_0x2e29('0xca')]===_0x2e29('0xcb')){return _0x42f03d[_0x2e29('0x5e')]({'read':!![]});}else{logger[_0x2e29('0x20')](_0x2e29('0x1e'),_0x2e29('0x25'),_0x2e29('0xc9'),util[_0x2e29('0xc4')](_0x598c7e[_0x2e29('0x59')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x5e07a6==_0x2e29('0xd0')||_0x5e07a6==_0x2e29('0xd1')){return _0x42f03d[_0x2e29('0x5e')]({'read':!![]});}else{logger['error'](_0x2e29('0x1e'),_0x2e29('0x25'),_0x2e29('0x8e'),util[_0x2e29('0xc4')](_0x598c7e[_0x2e29('0x59')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x5e07a6===_0x2e29('0xd2')||_0x5e07a6===_0x2e29('0xd3')){return _0x42f03d[_0x2e29('0x5e')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2e29('0x25'),_0x2e29('0xcc'),util['inspect'](_0x598c7e[_0x2e29('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x42f03d;}})[_0x2e29('0x1a')](respondWithResult(_0x5218bb,null))[_0x2e29('0x53')](handleError(_0x5218bb,null));};exports[_0x2e29('0xd4')]=function(_0x35b805,_0x53cfd8,_0x5e4d26){var _0x873c91,_0x5083e7,_0x341302;return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0x35b805[_0x2e29('0x55')]['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x53cfd8,null))[_0x2e29('0x1a')](function(_0x2d755){if(_0x2d755){_0x341302=_0x2d755;logger[_0x2e29('0x1d')](_0x2e29('0x1e'),'status',_0x2e29('0xc3'),_0x2d755[_0x2e29('0x4c')],util[_0x2e29('0xc4')](_0x35b805[_0x2e29('0x39')],{'showHidden':![],'depth':null}));switch(_0x2d755[_0x2e29('0x4c')]){case'csc':if(_0x35b805[_0x2e29('0x39')][_0x2e29('0xd5')]&&_0x35b805['query']['state']){_0x5083e7=_0x35b805[_0x2e29('0x39')][_0x2e29('0xd6')];return db[_0x2e29('0xbf')][_0x2e29('0x57')]({'where':{'messageId':_0x35b805[_0x2e29('0x39')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x53cfd8,null))[_0x2e29('0x1a')](function(_0x957b6){if(_0x957b6){_0x873c91=_0x957b6;switch(_0x341302[_0x2e29('0x4c')]){case _0x2e29('0x8b'):if(_0x5083e7==='2'||_0x5083e7==='6'){return _0x873c91[_0x2e29('0x5e')]({'read':!![]});}else{logger['error'](_0x2e29('0x1e'),_0x2e29('0x25'),_0x2e29('0x8b'),util[_0x2e29('0xc4')](_0x35b805[_0x2e29('0x39')],{'showHidden':![],'depth':null}));};break;}return _0x873c91;}})[_0x2e29('0x1a')](respondWithResult(_0x53cfd8,null))[_0x2e29('0x53')](handleError(_0x53cfd8,null));};exports[_0x2e29('0xd7')]=function(_0x3c9af8,_0x101ed7,_0x1146bb){return db['SmsAccount'][_0x2e29('0x57')]({'where':{'id':_0x3c9af8[_0x2e29('0x55')]['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x101ed7,null))[_0x2e29('0x1a')](function(_0x2dd0f6){if(_0x2dd0f6){return _0x2dd0f6[_0x2e29('0xd7')](_0x3c9af8['body'][_0x2e29('0x67')],_[_0x2e29('0xd8')](_0x3c9af8[_0x2e29('0x59')],[_0x2e29('0x67'),'id'])||{})['spread'](function(_0x10302d){for(var _0x1f9f6d=0x0;_0x1f9f6d<_0x3c9af8[_0x2e29('0x59')]['ids']['length'];_0x1f9f6d+=0x1){socket[_0x2e29('0xd9')](_0x2e29('0xda'),{'UserId':_0x3c9af8[_0x2e29('0x59')][_0x2e29('0x67')][_0x1f9f6d],'SmsAccountId':_0x3c9af8['params']['id']});}return _0x10302d;});}})[_0x2e29('0x1a')](respondWithResult(_0x101ed7,null))['catch'](handleError(_0x101ed7,null));};exports[_0x2e29('0xdb')]=function(_0x219ba2,_0x3972d3,_0x43ca96){var _0x377f70;return db[_0x2e29('0x36')][_0x2e29('0x57')]({'where':{'id':_0x219ba2['params']['id']}})['then'](handleEntityNotFound(_0x3972d3,null))[_0x2e29('0x1a')](function(_0x515726){if(_0x515726){return _0x515726['removeAgents'](_0x219ba2['query'][_0x2e29('0x67')])['then'](function(_0x275887){if(_[_0x2e29('0xdc')](_0x219ba2[_0x2e29('0x39')][_0x2e29('0x67')])){for(var _0x2bb2ce=0x0;_0x2bb2ce<_0x219ba2[_0x2e29('0x39')]['ids']['length'];_0x2bb2ce+=0x1){socket[_0x2e29('0xd9')]('userSmsAccount:remove',{'UserId':_0x219ba2['query'][_0x2e29('0x67')][_0x2bb2ce],'SmsAccountId':_0x219ba2[_0x2e29('0x55')]['id']});}}else{socket[_0x2e29('0xd9')]('userSmsAccount:remove',{'UserId':_0x219ba2['query'][_0x2e29('0x67')],'SmsAccountId':_0x219ba2[_0x2e29('0x55')]['id']});}});}})['then'](respondWithStatusCode(_0x3972d3,null))['catch'](handleError(_0x3972d3,null));};exports[_0x2e29('0xdd')]=function(_0x46d72c,_0x10d58e,_0x21da14){var _0x5eb751={};var _0x3a0104={};var _0x145b75;var _0x3b13ea;return db[_0x2e29('0x36')][_0x2e29('0x63')]({'where':{'id':_0x46d72c[_0x2e29('0x55')]['id']}})[_0x2e29('0x1a')](handleEntityNotFound(_0x10d58e,null))[_0x2e29('0x1a')](function(_0x5d8ac8){if(_0x5d8ac8){_0x145b75=_0x5d8ac8;_0x3a0104[_0x2e29('0x37')]=_[_0x2e29('0x3b')](db[_0x2e29('0xa5')]['rawAttributes']);_0x3a0104[_0x2e29('0x39')]=_[_0x2e29('0x3b')](_0x46d72c[_0x2e29('0x39')]);_0x3a0104[_0x2e29('0x3c')]=_[_0x2e29('0x3d')](_0x3a0104[_0x2e29('0x37')],_0x3a0104[_0x2e29('0x39')]);_0x5eb751['attributes']=_['intersection'](_0x3a0104[_0x2e29('0x37')],qs['fields'](_0x46d72c[_0x2e29('0x39')]['fields']));_0x5eb751[_0x2e29('0x3e')]=_0x5eb751[_0x2e29('0x3e')][_0x2e29('0x40')]?_0x5eb751[_0x2e29('0x3e')]:_0x3a0104[_0x2e29('0x37')];_0x5eb751[_0x2e29('0x43')]=qs[_0x2e29('0x44')](_0x46d72c[_0x2e29('0x39')]['sort']);_0x5eb751[_0x2e29('0x45')]=qs[_0x2e29('0x3c')](_[_0x2e29('0x46')](_0x46d72c['query'],_0x3a0104['filters']));if(_0x46d72c[_0x2e29('0x39')][_0x2e29('0x49')]){_0x5eb751[_0x2e29('0x45')]=_[_0x2e29('0x4a')](_0x5eb751[_0x2e29('0x45')],{'$or':_[_0x2e29('0x4b')](_0x5eb751[_0x2e29('0x3e')],function(_0x51014d){var _0x16cf77={};_0x16cf77[_0x51014d]={'$like':'%'+_0x46d72c[_0x2e29('0x39')][_0x2e29('0x49')]+'%'};return _0x16cf77;})});}_0x5eb751=_['merge']({},_0x5eb751,_0x46d72c['options']);return _0x145b75['getAgents'](_0x5eb751);}})[_0x2e29('0x1a')](function(_0x43e752){if(_0x43e752){_0x3b13ea=_0x43e752['length'];if(!_0x46d72c[_0x2e29('0x39')][_0x2e29('0x41')](_0x2e29('0x42'))){_0x5eb751[_0x2e29('0x2a')]=qs[_0x2e29('0x2a')](_0x46d72c['query']['limit']);_0x5eb751[_0x2e29('0x29')]=qs[_0x2e29('0x29')](_0x46d72c[_0x2e29('0x39')][_0x2e29('0x29')]);}return _0x145b75[_0x2e29('0xdd')](_0x5eb751);}})[_0x2e29('0x1a')](function(_0x245306){if(_0x245306){return _0x245306?{'count':_0x3b13ea,'rows':_0x245306}:null;}})['then'](respondWithResult(_0x10d58e,null))[_0x2e29('0x53')](handleError(_0x10d58e,null));};
\ No newline at end of file
index d6db4ae..b8c31e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e84=['save','update','remove','emit','exports','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x3679a4,_0x1ecf8c){var _0x33b025=function(_0x55ce1d){while(--_0x55ce1d){_0x3679a4['push'](_0x3679a4['shift']());}};_0x33b025(++_0x1ecf8c);}(_0x4e84,0x11c));var _0x44e8=function(_0x32e8f0,_0x34abef){_0x32e8f0=_0x32e8f0-0x0;var _0x502551=_0x4e84[_0x32e8f0];return _0x502551;};'use strict';var EventEmitter=require(_0x44e8('0x0'));var SmsAccount=require(_0x44e8('0x1'))['db'][_0x44e8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x44e8('0x3')](0x0);var events={'afterCreate':_0x44e8('0x4'),'afterUpdate':_0x44e8('0x5'),'afterDestroy':_0x44e8('0x6')};function emitEvent(_0x1709bf){return function(_0x26f7d8,_0x56bdd0,_0x2fdad4){SmsAccountEvents['emit'](_0x1709bf+':'+_0x26f7d8['id'],_0x26f7d8);SmsAccountEvents[_0x44e8('0x7')](_0x1709bf,_0x26f7d8);_0x2fdad4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x44e8('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x986f=['emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount','save'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x986f,0x153));var _0xf986=function(_0x42942f,_0x17b6c4){_0x42942f=_0x42942f-0x0;var _0x470bfd=_0x986f[_0x42942f];return _0x470bfd;};'use strict';var EventEmitter=require(_0xf986('0x0'));var SmsAccount=require(_0xf986('0x1'))['db'][_0xf986('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf986('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x338d72){return function(_0x19c447,_0x114858,_0x1b7b67){SmsAccountEvents[_0xf986('0x4')](_0x338d72+':'+_0x19c447['id'],_0x19c447);SmsAccountEvents[_0xf986('0x4')](_0x338d72,_0x19c447);_0x1b7b67(null);};}for(var e in events){if(events[_0xf986('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xf986('0x6')]=SmsAccountEvents;
\ No newline at end of file
index b8a7dc1..fc5c2fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98c5=['exports','define','SmsAccount','lodash','util','../../config/logger','moment','request-promise'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x98c5,0xeb));var _0x598c=function(_0xb94c8e,_0x36c697){_0xb94c8e=_0xb94c8e-0x0;var _0x2097c8=_0x98c5[_0xb94c8e];return _0x2097c8;};'use strict';var _=require(_0x598c('0x0'));var util=require(_0x598c('0x1'));var logger=require(_0x598c('0x2'))('api');var moment=require(_0x598c('0x3'));var BPromise=require('bluebird');var rp=require(_0x598c('0x4'));var attributes=require('./smsAccount.attributes');module[_0x598c('0x5')]=function(_0x2bb78a,_0x51911a){return _0x2bb78a[_0x598c('0x6')](_0x598c('0x7'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8201=['SmsAccount','lodash','api','bluebird','./smsAccount.attributes','exports','define'];(function(_0x4ea5d3,_0x3b4a2a){var _0x1ee7de=function(_0x3d6c6e){while(--_0x3d6c6e){_0x4ea5d3['push'](_0x4ea5d3['shift']());}};_0x1ee7de(++_0x3b4a2a);}(_0x8201,0x71));var _0x1820=function(_0x1c245e,_0x1b9d9d){_0x1c245e=_0x1c245e-0x0;var _0x4a440a=_0x8201[_0x1c245e];return _0x4a440a;};'use strict';var _=require(_0x1820('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1820('0x1'));var moment=require('moment');var BPromise=require(_0x1820('0x2'));var rp=require('request-promise');var attributes=require(_0x1820('0x3'));module[_0x1820('0x4')]=function(_0x549e0d,_0x41ea33){return _0x549e0d[_0x1820('0x5')](_0x1820('0x6'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2705629..71f88f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b08=['info','request\x20sent','debug','error','message','SmsAccount,\x20%s,\x20%s','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then'];(function(_0x1930ff,_0x40c327){var _0x5d5eb0=function(_0x517263){while(--_0x517263){_0x1930ff['push'](_0x1930ff['shift']());}};_0x5d5eb0(++_0x40c327);}(_0x0b08,0x171));var _0x80b0=function(_0x55fa5c,_0x30bd41){_0x55fa5c=_0x55fa5c-0x0;var _0xea802f=_0x0b08[_0x55fa5c];return _0xea802f;};'use strict';var _=require(_0x80b0('0x0'));var util=require('util');var moment=require(_0x80b0('0x1'));var BPromise=require('bluebird');var rs=require(_0x80b0('0x2'));var fs=require('fs');var Redis=require(_0x80b0('0x3'));var db=require(_0x80b0('0x4'))['db'];var utils=require(_0x80b0('0x5'));var logger=require(_0x80b0('0x6'))('rpc');var config=require(_0x80b0('0x7'));var jayson=require(_0x80b0('0x8'));var client=jayson['client'][_0x80b0('0x9')]({'port':0x232a});config['redis']=_[_0x80b0('0xa')](config[_0x80b0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x80b0('0xc'))(new Redis(config[_0x80b0('0xb')]));require('./smsAccount.socket')[_0x80b0('0xd')](socket);function respondWithRpcPromise(_0x5495e4,_0x2bc94b,_0x38c286){return new BPromise(function(_0x3ef9ed,_0x4beb1b){return client[_0x80b0('0xe')](_0x5495e4,_0x38c286)[_0x80b0('0xf')](function(_0x372801){logger[_0x80b0('0x10')]('SmsAccount,\x20%s,\x20%s',_0x2bc94b,_0x80b0('0x11'));logger[_0x80b0('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2bc94b,_0x80b0('0x11'),JSON['stringify'](_0x372801));if(_0x372801[_0x80b0('0x13')]){if(_0x372801[_0x80b0('0x13')]['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2bc94b,_0x372801['error'][_0x80b0('0x14')]);return _0x4beb1b(_0x372801['error'][_0x80b0('0x14')]);}logger[_0x80b0('0x13')](_0x80b0('0x15'),_0x2bc94b,_0x372801['error'][_0x80b0('0x14')]);return _0x3ef9ed(_0x372801[_0x80b0('0x13')][_0x80b0('0x14')]);}else{logger['info'](_0x80b0('0x15'),_0x2bc94b,_0x80b0('0x11'));_0x3ef9ed(_0x372801[_0x80b0('0x16')][_0x80b0('0x14')]);}})[_0x80b0('0x17')](function(_0xb09558){logger['error'](_0x80b0('0x15'),_0x2bc94b,_0xb09558);_0x4beb1b(_0xb09558);});});}exports[_0x80b0('0x18')]=function(_0x14bf6e){var _0xe708f1=this;return new Promise(function(_0x2058c9,_0x353867){return db[_0x80b0('0x19')][_0x80b0('0x1a')]({'raw':_0x14bf6e[_0x80b0('0x1b')]?_0x14bf6e[_0x80b0('0x1b')][_0x80b0('0x1c')]===undefined?!![]:![]:!![],'where':_0x14bf6e['options']?_0x14bf6e[_0x80b0('0x1b')][_0x80b0('0x1d')]||null:null,'attributes':_0x14bf6e['options']?_0x14bf6e[_0x80b0('0x1b')][_0x80b0('0x1e')]||null:null,'include':_0x14bf6e[_0x80b0('0x1b')]?_0x14bf6e[_0x80b0('0x1b')][_0x80b0('0x1f')]?_[_0x80b0('0x20')](_0x14bf6e[_0x80b0('0x1b')][_0x80b0('0x1f')],function(_0xefc3c1){return{'model':db[_0xefc3c1[_0x80b0('0x21')]],'as':_0xefc3c1['as'],'attributes':_0xefc3c1[_0x80b0('0x1e')],'include':_0xefc3c1[_0x80b0('0x1f')]?_[_0x80b0('0x20')](_0xefc3c1[_0x80b0('0x1f')],function(_0x1a34c8){return{'model':db[_0x1a34c8['model']],'as':_0x1a34c8['as'],'attributes':_0x1a34c8['attributes'],'include':_0x1a34c8[_0x80b0('0x1f')]?_[_0x80b0('0x20')](_0x1a34c8[_0x80b0('0x1f')],function(_0x117823){return{'model':db[_0x117823['model']],'as':_0x117823['as'],'attributes':_0x117823[_0x80b0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x561a5){logger[_0x80b0('0x10')](_0x80b0('0x18'),_0x14bf6e);logger[_0x80b0('0x12')](_0x80b0('0x18'),_0x14bf6e,JSON[_0x80b0('0x22')](_0x561a5));_0x2058c9(_0x561a5);})['catch'](function(_0x4a23d8){logger[_0x80b0('0x13')]('ShowSmsAccount',_0x4a23d8[_0x80b0('0x14')],_0x14bf6e);_0x353867(_0xe708f1[_0x80b0('0x13')](0x1f4,_0x4a23d8[_0x80b0('0x14')]));});});};
\ No newline at end of file
+var _0xbf6b=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','include','map','model','attributes','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ddaba,_0x441e02){var _0x6511ff=function(_0x53c867){while(--_0x53c867){_0x5ddaba['push'](_0x5ddaba['shift']());}};_0x6511ff(++_0x441e02);}(_0xbf6b,0x6c));var _0xbbf6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xbf6b[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xbbf6('0x0'));var util=require('util');var moment=require(_0xbbf6('0x1'));var BPromise=require(_0xbbf6('0x2'));var rs=require(_0xbbf6('0x3'));var fs=require('fs');var Redis=require(_0xbbf6('0x4'));var db=require(_0xbbf6('0x5'))['db'];var utils=require(_0xbbf6('0x6'));var logger=require(_0xbbf6('0x7'))(_0xbbf6('0x8'));var config=require(_0xbbf6('0x9'));var jayson=require(_0xbbf6('0xa'));var client=jayson[_0xbbf6('0xb')][_0xbbf6('0xc')]({'port':0x232a});config[_0xbbf6('0xd')]=_[_0xbbf6('0xe')](config[_0xbbf6('0xd')],{'host':_0xbbf6('0xf'),'port':0x18eb});var socket=require(_0xbbf6('0x10'))(new Redis(config[_0xbbf6('0xd')]));require(_0xbbf6('0x11'))[_0xbbf6('0x12')](socket);function respondWithRpcPromise(_0x32f174,_0x154179,_0x3bf1bb){return new BPromise(function(_0x2aeae4,_0x4145b7){return client[_0xbbf6('0x13')](_0x32f174,_0x3bf1bb)['then'](function(_0x4abaae){logger[_0xbbf6('0x14')](_0xbbf6('0x15'),_0x154179,'request\x20sent');logger[_0xbbf6('0x16')](_0xbbf6('0x17'),_0x154179,_0xbbf6('0x18'),JSON[_0xbbf6('0x19')](_0x4abaae));if(_0x4abaae[_0xbbf6('0x1a')]){if(_0x4abaae[_0xbbf6('0x1a')][_0xbbf6('0x1b')]===0x1f4){logger[_0xbbf6('0x1a')](_0xbbf6('0x15'),_0x154179,_0x4abaae[_0xbbf6('0x1a')][_0xbbf6('0x1c')]);return _0x4145b7(_0x4abaae['error'][_0xbbf6('0x1c')]);}logger[_0xbbf6('0x1a')](_0xbbf6('0x15'),_0x154179,_0x4abaae[_0xbbf6('0x1a')]['message']);return _0x2aeae4(_0x4abaae['error'][_0xbbf6('0x1c')]);}else{logger[_0xbbf6('0x14')]('SmsAccount,\x20%s,\x20%s',_0x154179,_0xbbf6('0x18'));_0x2aeae4(_0x4abaae['result'][_0xbbf6('0x1c')]);}})[_0xbbf6('0x1d')](function(_0x44aa84){logger[_0xbbf6('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x154179,_0x44aa84);_0x4145b7(_0x44aa84);});});}exports[_0xbbf6('0x1e')]=function(_0x5ed214){var _0x1a2d7f=this;return new Promise(function(_0x112cf4,_0x21ed8d){return db[_0xbbf6('0x1f')][_0xbbf6('0x20')]({'raw':_0x5ed214[_0xbbf6('0x21')]?_0x5ed214[_0xbbf6('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x5ed214[_0xbbf6('0x21')]?_0x5ed214['options']['where']||null:null,'attributes':_0x5ed214[_0xbbf6('0x21')]?_0x5ed214[_0xbbf6('0x21')]['attributes']||null:null,'include':_0x5ed214[_0xbbf6('0x21')]?_0x5ed214['options'][_0xbbf6('0x22')]?_[_0xbbf6('0x23')](_0x5ed214[_0xbbf6('0x21')][_0xbbf6('0x22')],function(_0x345b31){return{'model':db[_0x345b31[_0xbbf6('0x24')]],'as':_0x345b31['as'],'attributes':_0x345b31[_0xbbf6('0x25')],'include':_0x345b31[_0xbbf6('0x22')]?_['map'](_0x345b31['include'],function(_0xeb444e){return{'model':db[_0xeb444e['model']],'as':_0xeb444e['as'],'attributes':_0xeb444e['attributes'],'include':_0xeb444e['include']?_[_0xbbf6('0x23')](_0xeb444e[_0xbbf6('0x22')],function(_0x52ab20){return{'model':db[_0x52ab20[_0xbbf6('0x24')]],'as':_0x52ab20['as'],'attributes':_0x52ab20[_0xbbf6('0x25')]};}):[]};}):[]};}):[]:[]})[_0xbbf6('0x26')](function(_0x16ca07){logger[_0xbbf6('0x14')](_0xbbf6('0x1e'),_0x5ed214);logger['debug'](_0xbbf6('0x1e'),_0x5ed214,JSON[_0xbbf6('0x19')](_0x16ca07));_0x112cf4(_0x16ca07);})['catch'](function(_0x2473d3){logger[_0xbbf6('0x1a')](_0xbbf6('0x1e'),_0x2473d3['message'],_0x5ed214);_0x21ed8d(_0x1a2d7f['error'](0x1f4,_0x2473d3['message']));});});};
\ No newline at end of file
index 0ca3e0c..891f3c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1193=['remove','update','emit','removeListener','register','length','save'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0x1193,0x1a3));var _0x3119=function(_0x45877e,_0x194aac){_0x45877e=_0x45877e-0x0;var _0x37d18=_0x1193[_0x45877e];return _0x37d18;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x3119('0x0'),_0x3119('0x1'),_0x3119('0x2')];function createListener(_0x2d5cdb,_0x204bd0){return function(_0x240930){_0x204bd0[_0x3119('0x3')](_0x2d5cdb,_0x240930);};}function removeListener(_0x4592d6,_0x39cd0d){return function(){SmsAccountEvents[_0x3119('0x4')](_0x4592d6,_0x39cd0d);};}exports[_0x3119('0x5')]=function(_0x4f4a2f){for(var _0x1ab07e=0x0,_0x10ce9b=events[_0x3119('0x6')];_0x1ab07e<_0x10ce9b;_0x1ab07e++){var _0x7b9f5b=events[_0x1ab07e];var _0x17d74a=createListener('smsAccount:'+_0x7b9f5b,_0x4f4a2f);SmsAccountEvents['on'](_0x7b9f5b,_0x17d74a);}};
\ No newline at end of file
+var _0xc662=['emit','removeListener','register','length','save','remove','update'];(function(_0x1d8305,_0x1e63c6){var _0x183f62=function(_0x4c7d45){while(--_0x4c7d45){_0x1d8305['push'](_0x1d8305['shift']());}};_0x183f62(++_0x1e63c6);}(_0xc662,0x11c));var _0x2c66=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xc662[_0xea8947];return _0x2455e9;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x2c66('0x0'),_0x2c66('0x1'),_0x2c66('0x2')];function createListener(_0x272e8f,_0x365a07){return function(_0x5822a5){_0x365a07[_0x2c66('0x3')](_0x272e8f,_0x5822a5);};}function removeListener(_0xbd337c,_0x5ee444){return function(){SmsAccountEvents[_0x2c66('0x4')](_0xbd337c,_0x5ee444);};}exports[_0x2c66('0x5')]=function(_0x2bcdf8){for(var _0x772045=0x0,_0x1da1b3=events[_0x2c66('0x6')];_0x772045<_0x1da1b3;_0x772045++){var _0x30076c=events[_0x772045];var _0x4f9409=createListener('smsAccount:'+_0x30076c,_0x2bcdf8);SmsAccountEvents['on'](_0x30076c,_0x4f9409);}};
\ No newline at end of file
index 0aae237..ff07427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdca3=['create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','post'];(function(_0xf74372,_0x51fe82){var _0x36bb65=function(_0x499b7a){while(--_0x499b7a){_0xf74372['push'](_0xf74372['shift']());}};_0x36bb65(++_0x51fe82);}(_0xdca3,0x64));var _0x3dca=function(_0x4cfb50,_0x5641c6){_0x4cfb50=_0x4cfb50-0x0;var _0x162ef2=_0xdca3[_0x4cfb50];return _0x162ef2;};'use strict';var multer=require(_0x3dca('0x0'));var util=require('util');var path=require(_0x3dca('0x1'));var timeout=require(_0x3dca('0x2'));var express=require(_0x3dca('0x3'));var router=express[_0x3dca('0x4')]();var auth=require(_0x3dca('0x5'));var interaction=require(_0x3dca('0x6'));var config=require(_0x3dca('0x7'));var controller=require(_0x3dca('0x8'));router[_0x3dca('0x9')]('/',auth[_0x3dca('0xa')](),controller[_0x3dca('0xb')]);router['get'](_0x3dca('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3dca('0xd')]('/',auth['isAuthenticated'](),controller[_0x3dca('0xe')]);router[_0x3dca('0xf')](_0x3dca('0xc'),auth[_0x3dca('0xa')](),controller['update']);router[_0x3dca('0x10')](_0x3dca('0xc'),auth[_0x3dca('0xa')](),controller[_0x3dca('0x11')]);module[_0x3dca('0x12')]=router;
\ No newline at end of file
+var _0x1c3d=['isAuthenticated','index','show','create','put','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./smsApplication.controller','get'];(function(_0x3f5dd6,_0x3ae02f){var _0x5f47b9=function(_0x4aaea1){while(--_0x4aaea1){_0x3f5dd6['push'](_0x3f5dd6['shift']());}};_0x5f47b9(++_0x3ae02f);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x35d90b,_0x157231){_0x35d90b=_0x35d90b-0x0;var _0x4bd6f4=_0x1c3d[_0x35d90b];return _0x4bd6f4;};'use strict';var multer=require('multer');var util=require(_0xd1c3('0x0'));var path=require(_0xd1c3('0x1'));var timeout=require(_0xd1c3('0x2'));var express=require(_0xd1c3('0x3'));var router=express[_0xd1c3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1c3('0x5'));var controller=require(_0xd1c3('0x6'));router[_0xd1c3('0x7')]('/',auth[_0xd1c3('0x8')](),controller[_0xd1c3('0x9')]);router[_0xd1c3('0x7')]('/:id',auth[_0xd1c3('0x8')](),controller[_0xd1c3('0xa')]);router['post']('/',auth[_0xd1c3('0x8')](),controller[_0xd1c3('0xb')]);router[_0xd1c3('0xc')](_0xd1c3('0xd'),auth[_0xd1c3('0x8')](),controller['update']);router['delete'](_0xd1c3('0xd'),auth[_0xd1c3('0x8')](),controller[_0xd1c3('0xe')]);module[_0xd1c3('0xf')]=router;
\ No newline at end of file
index 071fd07..715c036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9faf=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x53c853,_0x3a310e){var _0x2f7999=function(_0x2c3734){while(--_0x2c3734){_0x53c853['push'](_0x53c853['shift']());}};_0x2f7999(++_0x3a310e);}(_0x9faf,0xc0));var _0xf9fa=function(_0x544149,_0x1a2eca){_0x544149=_0x544149-0x0;var _0x1dd0d1=_0x9faf[_0x544149];return _0x1dd0d1;};'use strict';var Sequelize=require(_0xf9fa('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf9fa('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf9fa('0x2')],'allowNull':![],'defaultValue':_0xf9fa('0x3')},'appdata':{'type':Sequelize[_0xf9fa('0x2')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xf9fa('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf9fa('0x4')}};
\ No newline at end of file
+var _0xd08d=['*,*,*,*','sequelize','STRING','noop'];(function(_0x216389,_0x13a816){var _0x25821a=function(_0x27bb50){while(--_0x27bb50){_0x216389['push'](_0x216389['shift']());}};_0x25821a(++_0x13a816);}(_0xd08d,0x151));var _0xdd08=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xd08d[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require(_0xdd08('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdd08('0x1')],'allowNull':![],'defaultValue':_0xdd08('0x2')},'appdata':{'type':Sequelize[_0xdd08('0x1')](0x1000),'defaultValue':''},'description':{'type':Sequelize[_0xdd08('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdd08('0x3')}};
\ No newline at end of file
index 202cf6e..cc4dfae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['findAll','rows','catch','show','length','includeAll','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','status','stack','name','send','index','SmsApplication','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','limit','order','sort','where','add','day','filter','merge','map','VIRTUAL','field','options','include'];(function(_0x544cdf,_0xb216ba){var _0x4afd4c=function(_0x2e1ad8){while(--_0x2e1ad8){_0x544cdf['push'](_0x544cdf['shift']());}};_0x4afd4c(++_0xb216ba);}(_0x5fab,0x177));var _0xb5fa=function(_0x5e4a9c,_0x2c0d9b){_0x5e4a9c=_0x5e4a9c-0x0;var _0x7f3c28=_0x5fab[_0x5e4a9c];return _0x7f3c28;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xb5fa('0x11'))(_0xb5fa('0x12'));var utils=require(_0xb5fa('0x13'));var config=require(_0xb5fa('0x14'));var db=require(_0xb5fa('0x15'))['db'];function respondWithStatusCode(_0xadef41,_0x65c6b6){_0x65c6b6=_0x65c6b6||0xcc;return function(_0x46da66){if(_0x46da66){return _0xadef41[_0xb5fa('0x16')](_0x65c6b6);}return _0xadef41['status'](_0x65c6b6)[_0xb5fa('0x17')]();};}function respondWithResult(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xc8;return function(_0x116849){if(_0x116849){return _0x3dad4d['status'](_0x56e8b0)[_0xb5fa('0x18')](_0x116849);}};}function respondWithFilteredResult(_0x3fc372,_0x40c914){return function(_0xca8d82){if(_0xca8d82){var _0x8e9d1c=_0xca8d82[_0xb5fa('0x19')],_0x5371cf=_0x40c914[_0xb5fa('0x1a')],_0x567f31=_0x40c914[_0xb5fa('0x1a')]+_0x40c914['limit'],_0x38e964;if(_0x567f31>=_0x8e9d1c){_0x567f31=_0x8e9d1c;_0x38e964=0xc8;}else{_0x38e964=0xce;}_0x3fc372['status'](_0x38e964);return _0x3fc372[_0xb5fa('0x1b')](_0xb5fa('0x1c'),_0x5371cf+'-'+_0x567f31+'/'+_0x8e9d1c)[_0xb5fa('0x18')](_0xca8d82);}return null;};}function patchUpdates(_0x46eef0){return function(_0x324ba5){try{jsonpatch[_0xb5fa('0x1d')](_0x324ba5,_0x46eef0,!![]);}catch(_0x3b0f69){return BPromise[_0xb5fa('0x1e')](_0x3b0f69);}return _0x324ba5[_0xb5fa('0x1f')]();};}function saveUpdates(_0x368cb1,_0x3c8d53){return function(_0x1f5064){if(_0x1f5064){return _0x1f5064['update'](_0x368cb1)[_0xb5fa('0x20')](function(_0x519e20){return _0x519e20;});}return null;};}function removeEntity(_0x37ae06,_0x4a6c04){return function(_0xd0fe2b){if(_0xd0fe2b){return _0xd0fe2b[_0xb5fa('0x21')]()['then'](function(){_0x37ae06[_0xb5fa('0x22')](0xcc)[_0xb5fa('0x17')]();});}};}function handleEntityNotFound(_0x283a56,_0x47f71a){return function(_0x32a85c){if(!_0x32a85c){_0x283a56[_0xb5fa('0x16')](0x194);}return _0x32a85c;};}function handleError(_0x444237,_0x542348){_0x542348=_0x542348||0x1f4;return function(_0x224ec8){logger['error'](_0x224ec8[_0xb5fa('0x23')]);if(_0x224ec8[_0xb5fa('0x24')]){delete _0x224ec8[_0xb5fa('0x24')];}_0x444237[_0xb5fa('0x22')](_0x542348)[_0xb5fa('0x25')](_0x224ec8);};}exports[_0xb5fa('0x26')]=function(_0x6a455c,_0x20d649){var _0x568870={},_0x4ec294={},_0x5bdf11={'count':0x0,'rows':[]};var _0x5a1c39=db[_0xb5fa('0x27')][_0xb5fa('0x28')];_0x4ec294[_0xb5fa('0x29')]=_[_0xb5fa('0x2a')](_0x5a1c39);var _0x534884={'dateStart':_0x6a455c[_0xb5fa('0x2b')][_0xb5fa('0x2c')],'dateEnd':_0x6a455c[_0xb5fa('0x2b')][_0xb5fa('0x2d')]};delete _0x6a455c[_0xb5fa('0x2b')][_0xb5fa('0x2c')];delete _0x6a455c[_0xb5fa('0x2b')][_0xb5fa('0x2d')];_0x4ec294[_0xb5fa('0x2b')]=_[_0xb5fa('0x2a')](_0x6a455c[_0xb5fa('0x2b')]);_0x4ec294[_0xb5fa('0x2e')]=_[_0xb5fa('0x2f')](_0x4ec294[_0xb5fa('0x29')],_0x4ec294[_0xb5fa('0x2b')]);_0x568870[_0xb5fa('0x30')]=_[_0xb5fa('0x2f')](_0x4ec294[_0xb5fa('0x29')],qs[_0xb5fa('0x31')](_0x6a455c['query'][_0xb5fa('0x31')]));_0x568870['attributes']=_0x568870['attributes']['length']?_0x568870[_0xb5fa('0x30')]:_0x4ec294['model'];if(!_0x6a455c[_0xb5fa('0x2b')]['hasOwnProperty']('nolimit')){_0x568870[_0xb5fa('0x32')]=qs[_0xb5fa('0x32')](_0x6a455c['query']['limit']);_0x568870[_0xb5fa('0x1a')]=qs[_0xb5fa('0x1a')](_0x6a455c[_0xb5fa('0x2b')]['offset']);}_0x568870[_0xb5fa('0x33')]=qs[_0xb5fa('0x34')](_0x6a455c['query'][_0xb5fa('0x34')]);_0x568870[_0xb5fa('0x35')]=qs[_0xb5fa('0x2e')](_['pick'](_0x6a455c[_0xb5fa('0x2b')],_0x4ec294[_0xb5fa('0x2e')]));if(_0x534884[_0xb5fa('0x2c')]){if(_0x534884['dateEnd']){_0x534884[_0xb5fa('0x2d')]=moment(_0x534884[_0xb5fa('0x2d')])[_0xb5fa('0x36')](0x1,_0xb5fa('0x37'));}else{_0x534884['dateEnd']=moment(_0x534884['dateStart'])['add'](0x1,'day');}_['merge'](_0x568870['where'],{'createdAt':{'$gte':_0x534884[_0xb5fa('0x2c')],'$lte':_0x534884['dateEnd']}});}if(_0x6a455c[_0xb5fa('0x2b')][_0xb5fa('0x38')]){_0x568870[_0xb5fa('0x35')]=_[_0xb5fa('0x39')](_0x568870[_0xb5fa('0x35')],{'$or':_[_0xb5fa('0x3a')](_0x5a1c39,function(_0x4b4c4c){if(_0x4b4c4c['type']['key']!==_0xb5fa('0x3b')){var _0x4d23f1={};_0x4d23f1[_0x4b4c4c[_0xb5fa('0x3c')]]={'$like':'%'+_0x6a455c['query']['filter']+'%'};return _0x4d23f1;}})});}_0x568870=_[_0xb5fa('0x39')]({},_0x568870,_0x6a455c[_0xb5fa('0x3d')]);var _0x2e056e={'where':_0x568870[_0xb5fa('0x35')]};return db[_0xb5fa('0x27')][_0xb5fa('0x19')](_0x2e056e)[_0xb5fa('0x20')](function(_0x83df0b){_0x5bdf11[_0xb5fa('0x19')]=_0x83df0b;if(_0x6a455c[_0xb5fa('0x2b')]['includeAll']){_0x568870[_0xb5fa('0x3e')]=[{'all':!![]}];}return db['SmsApplication'][_0xb5fa('0x3f')](_0x568870);})[_0xb5fa('0x20')](function(_0x2c7c5f){_0x5bdf11[_0xb5fa('0x40')]=_0x2c7c5f;return _0x5bdf11;})[_0xb5fa('0x20')](respondWithFilteredResult(_0x20d649,_0x568870))[_0xb5fa('0x41')](handleError(_0x20d649,null));};exports[_0xb5fa('0x42')]=function(_0x10c381,_0x4da448){var _0x1c3c2c={'raw':!![],'where':{'id':_0x10c381['params']['id']}},_0xc03e44={};_0xc03e44[_0xb5fa('0x29')]=_['keys'](db[_0xb5fa('0x27')][_0xb5fa('0x28')]);_0xc03e44['query']=_['keys'](_0x10c381[_0xb5fa('0x2b')]);_0xc03e44[_0xb5fa('0x2e')]=_[_0xb5fa('0x2f')](_0xc03e44[_0xb5fa('0x29')],_0xc03e44[_0xb5fa('0x2b')]);_0x1c3c2c[_0xb5fa('0x30')]=_[_0xb5fa('0x2f')](_0xc03e44[_0xb5fa('0x29')],qs['fields'](_0x10c381[_0xb5fa('0x2b')][_0xb5fa('0x31')]));_0x1c3c2c['attributes']=_0x1c3c2c[_0xb5fa('0x30')][_0xb5fa('0x43')]?_0x1c3c2c[_0xb5fa('0x30')]:_0xc03e44[_0xb5fa('0x29')];if(_0x10c381[_0xb5fa('0x2b')][_0xb5fa('0x44')]){_0x1c3c2c[_0xb5fa('0x3e')]=[{'all':!![]}];}_0x1c3c2c=_[_0xb5fa('0x39')]({},_0x1c3c2c,_0x10c381[_0xb5fa('0x3d')]);return db[_0xb5fa('0x27')][_0xb5fa('0x45')](_0x1c3c2c)[_0xb5fa('0x20')](handleEntityNotFound(_0x4da448,null))[_0xb5fa('0x20')](respondWithResult(_0x4da448,null))[_0xb5fa('0x41')](handleError(_0x4da448,null));};exports[_0xb5fa('0x46')]=function(_0x3a39f2,_0x52f5d8){return db['SmsApplication'][_0xb5fa('0x46')](_0x3a39f2['body'],{})[_0xb5fa('0x20')](respondWithResult(_0x52f5d8,0xc9))[_0xb5fa('0x41')](handleError(_0x52f5d8,null));};exports['update']=function(_0x4ef1d0,_0x2931a7){if(_0x4ef1d0[_0xb5fa('0x47')]['id']){delete _0x4ef1d0[_0xb5fa('0x47')]['id'];}return db[_0xb5fa('0x27')][_0xb5fa('0x45')]({'where':{'id':_0x4ef1d0['params']['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x2931a7,null))['then'](saveUpdates(_0x4ef1d0[_0xb5fa('0x47')],null))[_0xb5fa('0x20')](respondWithResult(_0x2931a7,null))[_0xb5fa('0x41')](handleError(_0x2931a7,null));};exports['destroy']=function(_0x27409a,_0x130a0d){return db['SmsApplication']['find']({'where':{'id':_0x27409a[_0xb5fa('0x48')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x130a0d,null))[_0xb5fa('0x20')](removeEntity(_0x130a0d,null))[_0xb5fa('0x41')](handleError(_0x130a0d,null));};
\ No newline at end of file
+var _0x1261=['dateStart','dateEnd','add','day','where','filter','merge','map','type','key','VIRTUAL','field','options','SmsApplication','count','findAll','rows','catch','keys','length','include','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','rawAttributes','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick'];(function(_0x4098e8,_0xf2876b){var _0x4f56b3=function(_0x3a45cf){while(--_0x3a45cf){_0x4098e8['push'](_0x4098e8['shift']());}};_0x4f56b3(++_0xf2876b);}(_0x1261,0x144));var _0x1126=function(_0x56eb70,_0x2bd75c){_0x56eb70=_0x56eb70-0x0;var _0x47f1fe=_0x1261[_0x56eb70];return _0x47f1fe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var qs=require(_0x1126('0x12'));var logger=require(_0x1126('0x13'))('api');var utils=require(_0x1126('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15c071,_0x561b93){_0x561b93=_0x561b93||0xcc;return function(_0x15e89b){if(_0x15e89b){return _0x15c071[_0x1126('0x15')](_0x561b93);}return _0x15c071[_0x1126('0x16')](_0x561b93)[_0x1126('0x17')]();};}function respondWithResult(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xc8;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x16')](_0x3f10e9)[_0x1126('0x18')](_0xd8ca42);}};}function respondWithFilteredResult(_0x53a8f0,_0x5de9a7){return function(_0x1af673){if(_0x1af673){var _0x154e20=_0x1af673['count'],_0x279455=_0x5de9a7[_0x1126('0x19')],_0x4be0c6=_0x5de9a7[_0x1126('0x19')]+_0x5de9a7[_0x1126('0x1a')],_0x45149c;if(_0x4be0c6>=_0x154e20){_0x4be0c6=_0x154e20;_0x45149c=0xc8;}else{_0x45149c=0xce;}_0x53a8f0['status'](_0x45149c);return _0x53a8f0[_0x1126('0x1b')](_0x1126('0x1c'),_0x279455+'-'+_0x4be0c6+'/'+_0x154e20)['json'](_0x1af673);}return null;};}function patchUpdates(_0x4d2b38){return function(_0x22ae0b){try{jsonpatch[_0x1126('0x1d')](_0x22ae0b,_0x4d2b38,!![]);}catch(_0x58d11a){return BPromise['reject'](_0x58d11a);}return _0x22ae0b[_0x1126('0x1e')]();};}function saveUpdates(_0x58b109,_0x22ed37){return function(_0x1d6d19){if(_0x1d6d19){return _0x1d6d19[_0x1126('0x1f')](_0x58b109)['then'](function(_0x2a08ba){return _0x2a08ba;});}return null;};}function removeEntity(_0x49d209,_0x56efeb){return function(_0x30f6b3){if(_0x30f6b3){return _0x30f6b3[_0x1126('0x20')]()[_0x1126('0x21')](function(){_0x49d209[_0x1126('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ab60,_0x477e6a){return function(_0x48a08d){if(!_0x48a08d){_0x29ab60[_0x1126('0x15')](0x194);}return _0x48a08d;};}function handleError(_0x59cd8e,_0x529dd9){_0x529dd9=_0x529dd9||0x1f4;return function(_0x4b57ab){logger[_0x1126('0x22')](_0x4b57ab[_0x1126('0x23')]);if(_0x4b57ab[_0x1126('0x24')]){delete _0x4b57ab[_0x1126('0x24')];}_0x59cd8e[_0x1126('0x16')](_0x529dd9)[_0x1126('0x25')](_0x4b57ab);};}exports[_0x1126('0x26')]=function(_0x38119d,_0x589725){var _0x35eec3={},_0x375e59={},_0xa293f4={'count':0x0,'rows':[]};var _0x5ddf63=db['SmsApplication'][_0x1126('0x27')];_0x375e59[_0x1126('0x28')]=_['keys'](_0x5ddf63);var _0x2fb797={'dateStart':_0x38119d[_0x1126('0x29')]['dateStart'],'dateEnd':_0x38119d[_0x1126('0x29')]['dateEnd']};delete _0x38119d[_0x1126('0x29')]['dateStart'];delete _0x38119d[_0x1126('0x29')]['dateEnd'];_0x375e59[_0x1126('0x29')]=_['keys'](_0x38119d['query']);_0x375e59['filters']=_[_0x1126('0x2a')](_0x375e59[_0x1126('0x28')],_0x375e59[_0x1126('0x29')]);_0x35eec3['attributes']=_[_0x1126('0x2a')](_0x375e59[_0x1126('0x28')],qs['fields'](_0x38119d[_0x1126('0x29')][_0x1126('0x2b')]));_0x35eec3[_0x1126('0x2c')]=_0x35eec3[_0x1126('0x2c')]['length']?_0x35eec3['attributes']:_0x375e59[_0x1126('0x28')];if(!_0x38119d[_0x1126('0x29')][_0x1126('0x2d')](_0x1126('0x2e'))){_0x35eec3['limit']=qs[_0x1126('0x1a')](_0x38119d[_0x1126('0x29')][_0x1126('0x1a')]);_0x35eec3[_0x1126('0x19')]=qs[_0x1126('0x19')](_0x38119d['query'][_0x1126('0x19')]);}_0x35eec3[_0x1126('0x2f')]=qs[_0x1126('0x30')](_0x38119d[_0x1126('0x29')]['sort']);_0x35eec3['where']=qs[_0x1126('0x31')](_[_0x1126('0x32')](_0x38119d['query'],_0x375e59[_0x1126('0x31')]));if(_0x2fb797[_0x1126('0x33')]){if(_0x2fb797[_0x1126('0x34')]){_0x2fb797['dateEnd']=moment(_0x2fb797['dateEnd'])[_0x1126('0x35')](0x1,_0x1126('0x36'));}else{_0x2fb797[_0x1126('0x34')]=moment(_0x2fb797[_0x1126('0x33')])['add'](0x1,_0x1126('0x36'));}_['merge'](_0x35eec3[_0x1126('0x37')],{'createdAt':{'$gte':_0x2fb797[_0x1126('0x33')],'$lte':_0x2fb797[_0x1126('0x34')]}});}if(_0x38119d[_0x1126('0x29')][_0x1126('0x38')]){_0x35eec3['where']=_[_0x1126('0x39')](_0x35eec3[_0x1126('0x37')],{'$or':_[_0x1126('0x3a')](_0x5ddf63,function(_0x397e3b){if(_0x397e3b[_0x1126('0x3b')][_0x1126('0x3c')]!==_0x1126('0x3d')){var _0x4faaa3={};_0x4faaa3[_0x397e3b[_0x1126('0x3e')]]={'$like':'%'+_0x38119d[_0x1126('0x29')][_0x1126('0x38')]+'%'};return _0x4faaa3;}})});}_0x35eec3=_[_0x1126('0x39')]({},_0x35eec3,_0x38119d[_0x1126('0x3f')]);var _0x518de1={'where':_0x35eec3['where']};return db[_0x1126('0x40')][_0x1126('0x41')](_0x518de1)[_0x1126('0x21')](function(_0x21c38e){_0xa293f4[_0x1126('0x41')]=_0x21c38e;if(_0x38119d[_0x1126('0x29')]['includeAll']){_0x35eec3['include']=[{'all':!![]}];}return db['SmsApplication'][_0x1126('0x42')](_0x35eec3);})['then'](function(_0xf84005){_0xa293f4[_0x1126('0x43')]=_0xf84005;return _0xa293f4;})[_0x1126('0x21')](respondWithFilteredResult(_0x589725,_0x35eec3))[_0x1126('0x44')](handleError(_0x589725,null));};exports['show']=function(_0x4c94bb,_0x353042){var _0xa93167={'raw':!![],'where':{'id':_0x4c94bb['params']['id']}},_0x1d63b9={};_0x1d63b9[_0x1126('0x28')]=_['keys'](db[_0x1126('0x40')]['rawAttributes']);_0x1d63b9[_0x1126('0x29')]=_[_0x1126('0x45')](_0x4c94bb[_0x1126('0x29')]);_0x1d63b9['filters']=_[_0x1126('0x2a')](_0x1d63b9[_0x1126('0x28')],_0x1d63b9[_0x1126('0x29')]);_0xa93167['attributes']=_['intersection'](_0x1d63b9['model'],qs[_0x1126('0x2b')](_0x4c94bb['query'][_0x1126('0x2b')]));_0xa93167['attributes']=_0xa93167[_0x1126('0x2c')][_0x1126('0x46')]?_0xa93167[_0x1126('0x2c')]:_0x1d63b9[_0x1126('0x28')];if(_0x4c94bb[_0x1126('0x29')]['includeAll']){_0xa93167[_0x1126('0x47')]=[{'all':!![]}];}_0xa93167=_[_0x1126('0x39')]({},_0xa93167,_0x4c94bb['options']);return db[_0x1126('0x40')][_0x1126('0x48')](_0xa93167)['then'](handleEntityNotFound(_0x353042,null))[_0x1126('0x21')](respondWithResult(_0x353042,null))[_0x1126('0x44')](handleError(_0x353042,null));};exports['create']=function(_0x3e4eeb,_0xbdde58){return db[_0x1126('0x40')]['create'](_0x3e4eeb[_0x1126('0x49')],{})[_0x1126('0x21')](respondWithResult(_0xbdde58,0xc9))[_0x1126('0x44')](handleError(_0xbdde58,null));};exports[_0x1126('0x1f')]=function(_0x224456,_0x2081f2){if(_0x224456[_0x1126('0x49')]['id']){delete _0x224456[_0x1126('0x49')]['id'];}return db['SmsApplication'][_0x1126('0x48')]({'where':{'id':_0x224456['params']['id']}})[_0x1126('0x21')](handleEntityNotFound(_0x2081f2,null))[_0x1126('0x21')](saveUpdates(_0x224456['body'],null))['then'](respondWithResult(_0x2081f2,null))[_0x1126('0x44')](handleError(_0x2081f2,null));};exports[_0x1126('0x20')]=function(_0x387fe1,_0x52a9a4){return db[_0x1126('0x40')][_0x1126('0x48')]({'where':{'id':_0x387fe1[_0x1126('0x4a')]['id']}})[_0x1126('0x21')](handleEntityNotFound(_0x52a9a4,null))['then'](removeEntity(_0x52a9a4,null))[_0x1126('0x44')](handleError(_0x52a9a4,null));};
\ No newline at end of file
index 0678598..aabccce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d3e=['request-promise','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','../../config/logger','api','bluebird'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x4d3e,0x1c8));var _0xe4d3=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x4d3e[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xe4d3('0x0'));var util=require('util');var logger=require(_0xe4d3('0x1'))(_0xe4d3('0x2'));var moment=require('moment');var BPromise=require(_0xe4d3('0x3'));var rp=require(_0xe4d3('0x4'));var attributes=require(_0xe4d3('0x5'));module[_0xe4d3('0x6')]=function(_0x3dc360,_0x2fe36b){return _0x3dc360[_0xe4d3('0x7')](_0xe4d3('0x8'),attributes,{'tableName':_0xe4d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x716c=['../../config/logger','api','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util'];(function(_0x347301,_0x351a7f){var _0x94a373=function(_0x5eb887){while(--_0x5eb887){_0x347301['push'](_0x347301['shift']());}};_0x94a373(++_0x351a7f);}(_0x716c,0x1ae));var _0xc716=function(_0x5b5cf4,_0x34f40b){_0x5b5cf4=_0x5b5cf4-0x0;var _0x24942a=_0x716c[_0x5b5cf4];return _0x24942a;};'use strict';var _=require(_0xc716('0x0'));var util=require(_0xc716('0x1'));var logger=require(_0xc716('0x2'))(_0xc716('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xc716('0x4'));module[_0xc716('0x5')]=function(_0x1eb72f,_0x1efea8){return _0x1eb72f[_0xc716('0x6')](_0xc716('0x7'),attributes,{'tableName':_0xc716('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c555ced..bfa29c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d5=['../../config/environment','jayson/promise','http','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x281166,_0x1bd7a7){var _0x3c3dda=function(_0x26284c){while(--_0x26284c){_0x281166['push'](_0x281166['shift']());}};_0x3c3dda(++_0x1bd7a7);}(_0x89d5,0x18a));var _0x589d=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x89d5[_0x487b0c];return _0x1adbdc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x589d('0x0'));var BPromise=require(_0x589d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x589d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x589d('0x3'));var logger=require(_0x589d('0x4'))(_0x589d('0x5'));var config=require(_0x589d('0x6'));var jayson=require(_0x589d('0x7'));var client=jayson['client'][_0x589d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x101f2d,_0x4114e5,_0x12edda){return new BPromise(function(_0x24c80a,_0x1f4a22){return client['request'](_0x101f2d,_0x12edda)['then'](function(_0x534583){logger['info'](_0x589d('0x9'),_0x4114e5,_0x589d('0xa'));logger[_0x589d('0xb')](_0x589d('0xc'),_0x4114e5,_0x589d('0xa'),JSON[_0x589d('0xd')](_0x534583));if(_0x534583[_0x589d('0xe')]){if(_0x534583[_0x589d('0xe')][_0x589d('0xf')]===0x1f4){logger[_0x589d('0xe')]('SmsApplication,\x20%s,\x20%s',_0x4114e5,_0x534583[_0x589d('0xe')][_0x589d('0x10')]);return _0x1f4a22(_0x534583[_0x589d('0xe')][_0x589d('0x10')]);}logger[_0x589d('0xe')](_0x589d('0x9'),_0x4114e5,_0x534583[_0x589d('0xe')][_0x589d('0x10')]);return _0x24c80a(_0x534583['error'][_0x589d('0x10')]);}else{logger[_0x589d('0x11')](_0x589d('0x9'),_0x4114e5,_0x589d('0xa'));_0x24c80a(_0x534583[_0x589d('0x12')][_0x589d('0x10')]);}})[_0x589d('0x13')](function(_0xd8f982){logger[_0x589d('0xe')]('SmsApplication,\x20%s,\x20%s',_0x4114e5,_0xd8f982);_0x1f4a22(_0xd8f982);});});}
\ No newline at end of file
+var _0x4b38=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x4b38,0x11a));var _0x84b3=function(_0x1a3bcd,_0xce2319){_0x1a3bcd=_0x1a3bcd-0x0;var _0x1b8925=_0x4b38[_0x1a3bcd];return _0x1b8925;};'use strict';var _=require(_0x84b3('0x0'));var util=require('util');var moment=require(_0x84b3('0x1'));var BPromise=require(_0x84b3('0x2'));var rs=require(_0x84b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84b3('0x4'))['db'];var utils=require(_0x84b3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x84b3('0x6'));var jayson=require(_0x84b3('0x7'));var client=jayson[_0x84b3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46e7c9,_0x17f6e6,_0x26240b){return new BPromise(function(_0x34e401,_0x28d0ae){return client['request'](_0x46e7c9,_0x26240b)[_0x84b3('0x9')](function(_0x405cc3){logger[_0x84b3('0xa')](_0x84b3('0xb'),_0x17f6e6,_0x84b3('0xc'));logger[_0x84b3('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x17f6e6,_0x84b3('0xc'),JSON[_0x84b3('0xe')](_0x405cc3));if(_0x405cc3['error']){if(_0x405cc3[_0x84b3('0xf')][_0x84b3('0x10')]===0x1f4){logger[_0x84b3('0xf')](_0x84b3('0xb'),_0x17f6e6,_0x405cc3[_0x84b3('0xf')][_0x84b3('0x11')]);return _0x28d0ae(_0x405cc3[_0x84b3('0xf')][_0x84b3('0x11')]);}logger[_0x84b3('0xf')](_0x84b3('0xb'),_0x17f6e6,_0x405cc3[_0x84b3('0xf')][_0x84b3('0x11')]);return _0x34e401(_0x405cc3[_0x84b3('0xf')][_0x84b3('0x11')]);}else{logger[_0x84b3('0xa')](_0x84b3('0xb'),_0x17f6e6,_0x84b3('0xc'));_0x34e401(_0x405cc3[_0x84b3('0x12')][_0x84b3('0x11')]);}})[_0x84b3('0x13')](function(_0x36f380){logger[_0x84b3('0xf')](_0x84b3('0xb'),_0x17f6e6,_0x36f380);_0x28d0ae(_0x36f380);});});}
\ No newline at end of file
index b86c697..53e65c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x876d=['destroy','removeTags','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy'];(function(_0x2e5392,_0x309cd4){var _0x1b87dc=function(_0x1be487){while(--_0x1be487){_0x2e5392['push'](_0x2e5392['shift']());}};_0x1b87dc(++_0x309cd4);}(_0x876d,0x177));var _0xd876=function(_0x2f1f7e,_0x39a585){_0x2f1f7e=_0x2f1f7e-0x0;var _0x727936=_0x876d[_0x2f1f7e];return _0x727936;};'use strict';var multer=require(_0xd876('0x0'));var util=require('util');var path=require(_0xd876('0x1'));var timeout=require('connect-timeout');var express=require(_0xd876('0x2'));var router=express[_0xd876('0x3')]();var auth=require(_0xd876('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd876('0x5'));var controller=require('./smsInteraction.controller');router[_0xd876('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd876('0x7'),auth['isAuthenticated'](),controller[_0xd876('0x8')]);router[_0xd876('0x6')](_0xd876('0x9'),auth[_0xd876('0xa')](),controller[_0xd876('0xb')]);router[_0xd876('0x6')](_0xd876('0xc'),auth[_0xd876('0xa')](),controller[_0xd876('0xd')]);router['get'](_0xd876('0xe'),auth[_0xd876('0xa')](),controller[_0xd876('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd876('0x10')]);router[_0xd876('0x11')](_0xd876('0xc'),auth[_0xd876('0xa')](),controller[_0xd876('0x12')]);router[_0xd876('0x11')](_0xd876('0x13'),auth[_0xd876('0xa')](),interaction[_0xd876('0x14')](_0xd876('0x15'),_0xd876('0x16')),controller[_0xd876('0x17')]);router[_0xd876('0x18')](_0xd876('0x9'),auth[_0xd876('0xa')](),interaction['tracked'](_0xd876('0x15'),_0xd876('0x19')),controller['update']);router[_0xd876('0x1a')]('/:id',auth[_0xd876('0xa')](),interaction[_0xd876('0x14')](_0xd876('0x15'),_0xd876('0x1b')),controller[_0xd876('0x1c')]);router[_0xd876('0x1a')](_0xd876('0x13'),auth[_0xd876('0xa')](),controller[_0xd876('0x1d')]);module[_0xd876('0x1e')]=router;
\ No newline at end of file
+var _0x949f=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','smsinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','express'];(function(_0x3f4b46,_0x141f74){var _0x4322db=function(_0x350998){while(--_0x350998){_0x3f4b46['push'](_0x3f4b46['shift']());}};_0x4322db(++_0x141f74);}(_0x949f,0x1ec));var _0xf949=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x949f[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xf949('0x0'));var path=require(_0xf949('0x1'));var timeout=require(_0xf949('0x2'));var express=require(_0xf949('0x3'));var router=express[_0xf949('0x4')]();var auth=require(_0xf949('0x5'));var interaction=require(_0xf949('0x6'));var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router['get']('/',auth[_0xf949('0x7')](),controller[_0xf949('0x8')]);router[_0xf949('0x9')](_0xf949('0xa'),auth[_0xf949('0x7')](),controller[_0xf949('0xb')]);router['get'](_0xf949('0xc'),auth[_0xf949('0x7')](),controller[_0xf949('0xd')]);router[_0xf949('0x9')](_0xf949('0xe'),auth['isAuthenticated'](),controller[_0xf949('0xf')]);router[_0xf949('0x9')](_0xf949('0x10'),auth['isAuthenticated'](),controller[_0xf949('0x11')]);router['post']('/',auth[_0xf949('0x7')](),controller[_0xf949('0x12')]);router[_0xf949('0x13')](_0xf949('0xe'),auth[_0xf949('0x7')](),controller[_0xf949('0x14')]);router[_0xf949('0x13')](_0xf949('0x15'),auth[_0xf949('0x7')](),interaction[_0xf949('0x16')](_0xf949('0x17'),_0xf949('0x18')),controller['addTags']);router['put'](_0xf949('0xc'),auth[_0xf949('0x7')](),interaction[_0xf949('0x16')]('sms',_0xf949('0x19')),controller[_0xf949('0x1a')]);router[_0xf949('0x1b')](_0xf949('0xc'),auth[_0xf949('0x7')](),interaction['tracked'](_0xf949('0x17'),'smsinteraction:destroy'),controller[_0xf949('0x1c')]);router[_0xf949('0x1b')](_0xf949('0x15'),auth[_0xf949('0x7')](),controller[_0xf949('0x1d')]);module[_0xf949('0x1e')]=router;
\ No newline at end of file
index a7b7b0c..7df54cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe2e=['exports','BOOLEAN','STRING','DATE','ENUM','out','sequelize','moment'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbe2e,0xae));var _0xebe2=function(_0x587a8d,_0x58f1f0){_0x587a8d=_0x587a8d-0x0;var _0x4d2d18=_0xbe2e[_0x587a8d];return _0x4d2d18;};'use strict';var Sequelize=require(_0xebe2('0x0'));var moment=require(_0xebe2('0x1'));module[_0xebe2('0x2')]={'closed':{'type':Sequelize[_0xebe2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xebe2('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xebe2('0x4')]},'read1stAt':{'type':Sequelize[_0xebe2('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xebe2('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xebe2('0x6')]('in',_0xebe2('0x7')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xff49=['moment','exports','STRING','DATE','ENUM'];(function(_0x3abdf1,_0x2ae71d){var _0x556fd5=function(_0x23ff01){while(--_0x23ff01){_0x3abdf1['push'](_0x3abdf1['shift']());}};_0x556fd5(++_0x2ae71d);}(_0xff49,0x17c));var _0x9ff4=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0xff49[_0x396466];return _0x5e9ab4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9ff4('0x0'));module[_0x9ff4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9ff4('0x2')]},'note':{'type':Sequelize[_0x9ff4('0x2')]},'phone':{'type':Sequelize[_0x9ff4('0x2')]},'read1stAt':{'type':Sequelize[_0x9ff4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9ff4('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9ff4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9ff4('0x4')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 7cdde93..69d2788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6ce=['SmsInteractionId','$gte','split','findAll','addTags','setTags','spread','smsInteractionTags:save','removeTags','unix','toString','root','server','files','tmp','join','attachments','interaction-%s.zip','firstName','Letter','1cm','<h1>Sms\x20Interaction:\x20#%d</h1>','format','<h2>Date:\x20%s</h2>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','<hr>','<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>','</div>','toFile','interaction-','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','limit','set','Content-Range','save','then','destroy','error','stack','name','send','rawAttributes','keys','query','dateStart','dateEnd','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','add','merge','filter','map','type','key','VIRTUAL','field','tag','include','Tag','Tags','distinct','read','SmsMessage','Messages','direction','createdAt','SmsInteraction','count','includeAll','Users','fullname','CmContact','Contact','User','internal','SmsAccount','Account','color','ThroughTags','rows','show','length','options','find','catch','create','body','params','describe','addMessage','ids','omit','getMessages','hasOwnProperty'];(function(_0x54bd30,_0x3da919){var _0x158327=function(_0x5ec704){while(--_0x5ec704){_0x54bd30['push'](_0x54bd30['shift']());}};_0x158327(++_0x3da919);}(_0xd6ce,0x127));var _0xed6c=function(_0x269036,_0x205e99){_0x269036=_0x269036-0x0;var _0x534559=_0xd6ce[_0x269036];return _0x534559;};'use strict';var pdf=require(_0xed6c('0x0'));var emlformat=require(_0xed6c('0x1'));var rimraf=require(_0xed6c('0x2'));var zipdir=require(_0xed6c('0x3'));var jsonpatch=require(_0xed6c('0x4'));var rp=require(_0xed6c('0x5'));var moment=require(_0xed6c('0x6'));var BPromise=require(_0xed6c('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xed6c('0x8'));var sox=require(_0xed6c('0x9'));var csv=require(_0xed6c('0xa'));var ejs=require(_0xed6c('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xed6c('0xc'));var jsforce=require(_0xed6c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed6c('0xe'));var Papa=require(_0xed6c('0xf'));var Redis=require(_0xed6c('0x10'));var qs=require(_0xed6c('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xed6c('0x12'))['db'];config['redis']=_['defaults'](config[_0xed6c('0x13')],{'host':_0xed6c('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed6c('0x13')]));require('./smsInteraction.socket')[_0xed6c('0x15')](socket);function respondWithStatusCode(_0xbcf0f4,_0x47c392){_0x47c392=_0x47c392||0xcc;return function(_0x3f3126){if(_0x3f3126){return _0xbcf0f4[_0xed6c('0x16')](_0x47c392);}return _0xbcf0f4[_0xed6c('0x17')](_0x47c392)[_0xed6c('0x18')]();};}function respondWithResult(_0x4b0ad3,_0x57ec05){_0x57ec05=_0x57ec05||0xc8;return function(_0x2034d4){if(_0x2034d4){return _0x4b0ad3[_0xed6c('0x17')](_0x57ec05)[_0xed6c('0x19')](_0x2034d4);}};}function respondWithFilteredResult(_0x4fbdb5,_0x13c503){return function(_0x526c54){if(_0x526c54){var _0x135efe=_0x526c54['count'],_0x326350=_0x13c503[_0xed6c('0x1a')],_0x32dac0=_0x13c503[_0xed6c('0x1a')]+_0x13c503[_0xed6c('0x1b')],_0x1fe8c0;if(_0x32dac0>=_0x135efe){_0x32dac0=_0x135efe;_0x1fe8c0=0xc8;}else{_0x1fe8c0=0xce;}_0x4fbdb5['status'](_0x1fe8c0);return _0x4fbdb5[_0xed6c('0x1c')](_0xed6c('0x1d'),_0x326350+'-'+_0x32dac0+'/'+_0x135efe)[_0xed6c('0x19')](_0x526c54);}return null;};}function patchUpdates(_0x2aebdc){return function(_0x314aeb){try{jsonpatch['apply'](_0x314aeb,_0x2aebdc,!![]);}catch(_0x85aedf){return BPromise['reject'](_0x85aedf);}return _0x314aeb[_0xed6c('0x1e')]();};}function saveUpdates(_0x37a9ce,_0x30e605){return function(_0x34faac){if(_0x34faac){return _0x34faac['update'](_0x37a9ce)[_0xed6c('0x1f')](function(_0x4e1870){return _0x4e1870;});}return null;};}function removeEntity(_0x351d57,_0x5ea6f4){return function(_0x7882e0){if(_0x7882e0){return _0x7882e0[_0xed6c('0x20')]()[_0xed6c('0x1f')](function(){_0x351d57[_0xed6c('0x17')](0xcc)[_0xed6c('0x18')]();});}};}function handleEntityNotFound(_0x1c3aca,_0x638bc2){return function(_0x27fb6c){if(!_0x27fb6c){_0x1c3aca[_0xed6c('0x16')](0x194);}return _0x27fb6c;};}function handleError(_0x2bb6fc,_0xd7f45d){_0xd7f45d=_0xd7f45d||0x1f4;return function(_0x58538b){logger[_0xed6c('0x21')](_0x58538b[_0xed6c('0x22')]);if(_0x58538b[_0xed6c('0x23')]){delete _0x58538b[_0xed6c('0x23')];}_0x2bb6fc[_0xed6c('0x17')](_0xd7f45d)[_0xed6c('0x24')](_0x58538b);};}exports['index']=function(_0x23ee72,_0x2d03d7){var _0x3182ce={},_0x4e0a5a={},_0x4e4373={'count':0x0,'rows':[]};var _0x531cd0=db['SmsInteraction'][_0xed6c('0x25')];_0x4e0a5a['model']=_[_0xed6c('0x26')](_0x531cd0);var _0x4d4feb={'dateStart':_0x23ee72[_0xed6c('0x27')][_0xed6c('0x28')],'dateEnd':_0x23ee72['query'][_0xed6c('0x29')]};delete _0x23ee72[_0xed6c('0x27')][_0xed6c('0x28')];delete _0x23ee72[_0xed6c('0x27')][_0xed6c('0x29')];_0x4e0a5a[_0xed6c('0x27')]=_['keys'](_0x23ee72[_0xed6c('0x27')]);_0x4e0a5a[_0xed6c('0x2a')]=_['intersection'](_0x4e0a5a[_0xed6c('0x2b')],_0x4e0a5a['query']);_0x3182ce[_0xed6c('0x2c')]=_[_0xed6c('0x2d')](_0x4e0a5a[_0xed6c('0x2b')],qs[_0xed6c('0x2e')](_0x23ee72[_0xed6c('0x27')][_0xed6c('0x2e')]));_0x3182ce['attributes']=_0x3182ce['attributes']['length']?_0x3182ce[_0xed6c('0x2c')]:_0x4e0a5a[_0xed6c('0x2b')];if(!_0x23ee72[_0xed6c('0x27')]['hasOwnProperty'](_0xed6c('0x2f'))){_0x3182ce[_0xed6c('0x1b')]=qs[_0xed6c('0x1b')](_0x23ee72[_0xed6c('0x27')][_0xed6c('0x1b')]);_0x3182ce[_0xed6c('0x1a')]=qs[_0xed6c('0x1a')](_0x23ee72[_0xed6c('0x27')][_0xed6c('0x1a')]);}_0x3182ce[_0xed6c('0x30')]=qs[_0xed6c('0x31')](_0x23ee72[_0xed6c('0x27')]['sort']);_0x3182ce[_0xed6c('0x32')]=qs[_0xed6c('0x2a')](_[_0xed6c('0x33')](_0x23ee72[_0xed6c('0x27')],_0x4e0a5a['filters']));if(_0x4d4feb[_0xed6c('0x28')]){if(_0x4d4feb[_0xed6c('0x29')]){_0x4d4feb[_0xed6c('0x29')]=moment(_0x4d4feb['dateEnd'])[_0xed6c('0x34')](0x1,'day');}else{_0x4d4feb[_0xed6c('0x29')]=moment(_0x4d4feb[_0xed6c('0x28')])[_0xed6c('0x34')](0x1,'day');}_[_0xed6c('0x35')](_0x3182ce[_0xed6c('0x32')],{'createdAt':{'$gte':_0x4d4feb[_0xed6c('0x28')],'$lte':_0x4d4feb[_0xed6c('0x29')]}});}if(_0x23ee72[_0xed6c('0x27')][_0xed6c('0x36')]){_0x3182ce[_0xed6c('0x32')]=_[_0xed6c('0x35')](_0x3182ce[_0xed6c('0x32')],{'$or':_[_0xed6c('0x37')](_0x531cd0,function(_0x212acc){if(_0x212acc[_0xed6c('0x38')][_0xed6c('0x39')]!==_0xed6c('0x3a')){var _0x2bb8eb={};_0x2bb8eb[_0x212acc[_0xed6c('0x3b')]]={'$like':'%'+_0x23ee72['query'][_0xed6c('0x36')]+'%'};return _0x2bb8eb;}})});}_0x3182ce=_[_0xed6c('0x35')]({},_0x3182ce,_0x23ee72['options']);var _0x141ea3={'where':_0x3182ce[_0xed6c('0x32')]};_0x141ea3['include']=[];if(_0x23ee72['query'][_0xed6c('0x3c')]){_0x141ea3[_0xed6c('0x3d')]['push']({'model':db[_0xed6c('0x3e')],'as':_0xed6c('0x3f'),'attributes':['id'],'where':{'id':_0x23ee72['query']['tag']},'required':!![]});_0x141ea3[_0xed6c('0x40')]=!![];}if(_0x23ee72[_0xed6c('0x27')][_0xed6c('0x41')]){_0x141ea3[_0xed6c('0x3d')]['push']({'model':db[_0xed6c('0x42')],'as':_0xed6c('0x43'),'attributes':['id',_0xed6c('0x44'),_0xed6c('0x45'),_0xed6c('0x41')],'where':{'direction':'in','read':_0x23ee72[_0xed6c('0x27')][_0xed6c('0x41')]||![]},'required':!![]});_0x141ea3[_0xed6c('0x40')]=!![];}return db[_0xed6c('0x46')]['count'](_0x141ea3)[_0xed6c('0x1f')](function(_0x53f43d){_0x4e4373[_0xed6c('0x47')]=_0x53f43d;if(_0x23ee72[_0xed6c('0x27')][_0xed6c('0x48')]){_0x3182ce[_0xed6c('0x3d')]=[{'model':db['User'],'as':_0xed6c('0x49'),'required':![],'attributes':['id','name',_0xed6c('0x4a')]},{'model':db[_0xed6c('0x4b')],'as':_0xed6c('0x4c'),'required':![]},{'model':db[_0xed6c('0x4d')],'as':'Owner','attributes':[_0xed6c('0x23'),_0xed6c('0x4a'),_0xed6c('0x4e')],'required':![]},{'model':db[_0xed6c('0x4f')],'as':_0xed6c('0x50'),'attributes':[_0xed6c('0x23'),_0xed6c('0x39')],'required':![]},{'model':db[_0xed6c('0x42')],'as':_0xed6c('0x43'),'attributes':['id',_0xed6c('0x44'),_0xed6c('0x45'),_0xed6c('0x41')],'where':{'direction':'in','read':_0x23ee72[_0xed6c('0x27')][_0xed6c('0x41')]||![]},'required':_0x23ee72[_0xed6c('0x27')][_0xed6c('0x41')]||![]},{'model':db[_0xed6c('0x3e')],'as':'Tags','attributes':['id',_0xed6c('0x23'),_0xed6c('0x51')],'required':_0x23ee72[_0xed6c('0x27')][_0xed6c('0x3c')]?!![]:![]},{'model':db[_0xed6c('0x3e')],'as':_0xed6c('0x52'),'attributes':['id',_0xed6c('0x23'),_0xed6c('0x51')],'through':_0x23ee72['query'][_0xed6c('0x3c')]?{'attributes':[],'where':{'TagId':_0x23ee72[_0xed6c('0x27')][_0xed6c('0x3c')]||undefined}}:{},'required':_0x23ee72[_0xed6c('0x27')][_0xed6c('0x3c')]?!![]:![]}];}return db[_0xed6c('0x46')]['findAll'](_0x3182ce);})[_0xed6c('0x1f')](function(_0x347bea){_0x4e4373[_0xed6c('0x53')]=_0x347bea;return _0x4e4373;})[_0xed6c('0x1f')](respondWithFilteredResult(_0x2d03d7,_0x3182ce))['catch'](handleError(_0x2d03d7,null));};exports[_0xed6c('0x54')]=function(_0x39e366,_0x2d6f1b){var _0x40b9bf={'raw':![],'where':{'id':_0x39e366['params']['id']}},_0x32c422={};_0x32c422[_0xed6c('0x2b')]=_[_0xed6c('0x26')](db['SmsInteraction'][_0xed6c('0x25')]);_0x32c422[_0xed6c('0x27')]=_['keys'](_0x39e366[_0xed6c('0x27')]);_0x32c422[_0xed6c('0x2a')]=_[_0xed6c('0x2d')](_0x32c422[_0xed6c('0x2b')],_0x32c422['query']);_0x40b9bf[_0xed6c('0x2c')]=_['intersection'](_0x32c422[_0xed6c('0x2b')],qs[_0xed6c('0x2e')](_0x39e366[_0xed6c('0x27')][_0xed6c('0x2e')]));_0x40b9bf[_0xed6c('0x2c')]=_0x40b9bf[_0xed6c('0x2c')][_0xed6c('0x55')]?_0x40b9bf[_0xed6c('0x2c')]:_0x32c422['model'];if(_0x39e366[_0xed6c('0x27')][_0xed6c('0x48')]){_0x40b9bf[_0xed6c('0x3d')]=[{'all':!![]}];}_0x40b9bf=_[_0xed6c('0x35')]({},_0x40b9bf,_0x39e366[_0xed6c('0x56')]);return db[_0xed6c('0x46')][_0xed6c('0x57')](_0x40b9bf)[_0xed6c('0x1f')](handleEntityNotFound(_0x2d6f1b,null))[_0xed6c('0x1f')](respondWithResult(_0x2d6f1b,null))[_0xed6c('0x58')](handleError(_0x2d6f1b,null));};exports[_0xed6c('0x59')]=function(_0x58c7b3,_0x1ede26){return db[_0xed6c('0x46')][_0xed6c('0x59')](_0x58c7b3['body'],{})[_0xed6c('0x1f')](respondWithResult(_0x1ede26,0xc9))['catch'](handleError(_0x1ede26,null));};exports['update']=function(_0x2e093e,_0x1b719a){if(_0x2e093e['body']['id']){delete _0x2e093e[_0xed6c('0x5a')]['id'];}return db[_0xed6c('0x46')][_0xed6c('0x57')]({'where':{'id':_0x2e093e[_0xed6c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1b719a,null))[_0xed6c('0x1f')](saveUpdates(_0x2e093e['body'],null))[_0xed6c('0x1f')](respondWithResult(_0x1b719a,null))['catch'](handleError(_0x1b719a,null));};exports[_0xed6c('0x20')]=function(_0x13e73e,_0x2c6cdb){return db['SmsInteraction']['find']({'where':{'id':_0x13e73e[_0xed6c('0x5b')]['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x2c6cdb,null))['then'](removeEntity(_0x2c6cdb,null))[_0xed6c('0x58')](handleError(_0x2c6cdb,null));};exports[_0xed6c('0x5c')]=function(_0x13afc9,_0x38aa78){return db[_0xed6c('0x46')]['describe']()['then'](respondWithResult(_0x38aa78,null))[_0xed6c('0x58')](handleError(_0x38aa78,null));};exports[_0xed6c('0x5d')]=function(_0xb01d6e,_0x3dec47,_0x42d8d8){return db[_0xed6c('0x42')]['find']({'where':{'id':_0xb01d6e['params']['id']}})[_0xed6c('0x1f')](handleEntityNotFound(_0x3dec47,null))[_0xed6c('0x1f')](function(_0x55dc0b){if(_0x55dc0b){return _0x55dc0b[_0xed6c('0x5d')](_0xb01d6e[_0xed6c('0x5a')][_0xed6c('0x5e')],_[_0xed6c('0x5f')](_0xb01d6e['body'],[_0xed6c('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x3dec47,null))[_0xed6c('0x58')](handleError(_0x3dec47,null));};exports[_0xed6c('0x60')]=function(_0x3daf6e,_0x5dbc83,_0x130b7b){var _0x4a7c99={'raw':![],'where':{}};var _0x1f336c={};var _0x54741d={'count':0x0,'rows':[]};return db[_0xed6c('0x46')]['findOne']({'where':{'id':_0x3daf6e[_0xed6c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5dbc83,null))[_0xed6c('0x1f')](function(_0x39385c){if(_0x39385c){_0x1f336c[_0xed6c('0x2b')]=_['keys'](db[_0xed6c('0x42')]['rawAttributes']);_0x1f336c[_0xed6c('0x27')]=_[_0xed6c('0x26')](_0x3daf6e[_0xed6c('0x27')]);_0x1f336c[_0xed6c('0x2a')]=_[_0xed6c('0x2d')](_0x1f336c[_0xed6c('0x2b')],_0x1f336c['query']);_0x4a7c99['attributes']=_[_0xed6c('0x2d')](_0x1f336c['model'],qs[_0xed6c('0x2e')](_0x3daf6e[_0xed6c('0x27')][_0xed6c('0x2e')]));_0x4a7c99['attributes']=_0x4a7c99[_0xed6c('0x2c')]['length']?_0x4a7c99[_0xed6c('0x2c')]:_0x1f336c['model'];if(!_0x3daf6e[_0xed6c('0x27')][_0xed6c('0x61')](_0xed6c('0x2f'))){_0x4a7c99[_0xed6c('0x1b')]=qs['limit'](_0x3daf6e[_0xed6c('0x27')][_0xed6c('0x1b')]);_0x4a7c99[_0xed6c('0x1a')]=qs[_0xed6c('0x1a')](_0x3daf6e['query'][_0xed6c('0x1a')]);}_0x4a7c99[_0xed6c('0x30')]=qs['sort'](_0x3daf6e['query'][_0xed6c('0x31')]);_0x4a7c99[_0xed6c('0x32')]=qs['filters'](_['pick'](_0x3daf6e[_0xed6c('0x27')],_0x1f336c[_0xed6c('0x2a')]));_0x4a7c99[_0xed6c('0x32')][_0xed6c('0x62')]=_0x39385c['id'];if(_0x3daf6e[_0xed6c('0x27')][_0xed6c('0x36')]){_0x4a7c99[_0xed6c('0x32')]=_[_0xed6c('0x35')](_0x4a7c99[_0xed6c('0x32')],{'$or':_[_0xed6c('0x37')](_0x4a7c99[_0xed6c('0x2c')],function(_0x1b49d6){var _0x2972de={};_0x2972de[_0x1b49d6]={'$like':'%'+_0x3daf6e[_0xed6c('0x27')][_0xed6c('0x36')]+'%'};return _0x2972de;})});}if(_0x3daf6e[_0xed6c('0x27')]['$gte']){var _0x292275=_0x3daf6e[_0xed6c('0x27')][_0xed6c('0x63')][_0xed6c('0x64')](',');var _0x2e6545={};_0x2e6545[_0x292275[0x0]]={'$gte':moment(_0x292275[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4a7c99[_0xed6c('0x32')]=_['merge'](_0x4a7c99['where'],_0x2e6545);}_0x4a7c99=_[_0xed6c('0x35')]({},_0x4a7c99,_0x3daf6e[_0xed6c('0x56')]);return db[_0xed6c('0x42')]['count']({'where':_0x4a7c99['where']})[_0xed6c('0x1f')](function(_0x1523d2){_0x54741d[_0xed6c('0x47')]=_0x1523d2;if(_0x3daf6e[_0xed6c('0x27')][_0xed6c('0x48')]){_0x4a7c99[_0xed6c('0x3d')]=[{'all':!![]}];}return db['SmsMessage'][_0xed6c('0x65')](_0x4a7c99);})[_0xed6c('0x1f')](function(_0x5e7942){_0x54741d[_0xed6c('0x53')]=_0x5e7942;return _0x54741d;});}})[_0xed6c('0x1f')](respondWithFilteredResult(_0x5dbc83,_0x4a7c99))['catch'](handleError(_0x5dbc83,null));};exports[_0xed6c('0x66')]=function(_0x105a07,_0xf05f66,_0x4c28a8){return db[_0xed6c('0x46')][_0xed6c('0x57')]({'where':{'id':_0x105a07['params']['id']}})['then'](handleEntityNotFound(_0xf05f66,null))['then'](function(_0x1bcdf3){if(_0x1bcdf3){return _0x1bcdf3[_0xed6c('0x67')](_0x105a07['body'][_0xed6c('0x5e')],_[_0xed6c('0x5f')](_0x105a07['body'],[_0xed6c('0x5e'),'id'])||{})[_0xed6c('0x68')](function(){return db[_0xed6c('0x3e')][_0xed6c('0x65')]({'attributes':['id','name','color'],'where':{'id':_0x105a07[_0xed6c('0x5a')][_0xed6c('0x5e')]}});})[_0xed6c('0x1f')](function(_0x39d076){socket['emit'](_0xed6c('0x69'),{'id':Number(_0x105a07[_0xed6c('0x5b')]['id']),'tags':_0x39d076||[]});return{'id':Number(_0x105a07[_0xed6c('0x5b')]['id']),'tags':_0x39d076||[]};});}})['then'](respondWithResult(_0xf05f66,null))[_0xed6c('0x58')](handleError(_0xf05f66,null));};exports['removeTags']=function(_0x5017be,_0x42cd1e,_0x55cfb5){var _0x3f072e;return db['SmsInteraction']['find']({'where':{'id':_0x5017be[_0xed6c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x42cd1e,null))[_0xed6c('0x1f')](function(_0x37d592){if(_0x37d592){return _0x37d592[_0xed6c('0x6a')](_0x5017be[_0xed6c('0x27')][_0xed6c('0x5e')]);}})[_0xed6c('0x1f')](respondWithStatusCode(_0x42cd1e,null))[_0xed6c('0x58')](handleError(_0x42cd1e,null));};exports['download']=function(_0x52b56c,_0x327ba9){var _0x48a57b=moment()[_0xed6c('0x6b')]()[_0xed6c('0x6c')]();var _0x2b3b41=path['join'](config[_0xed6c('0x6d')],_0xed6c('0x6e'),_0xed6c('0x6f'),_0xed6c('0x70'));var _0x112139=path[_0xed6c('0x71')](config[_0xed6c('0x6d')],'server','files',_0xed6c('0x72'));var _0x4f6401=path['join'](_0x2b3b41,_0x48a57b);var _0x333353=util['format'](_0xed6c('0x73'),_0x48a57b);var _0x4ca3fb=path[_0xed6c('0x71')](_0x2b3b41,_0x333353);var _0x4a01ea=![];return db[_0xed6c('0x46')]['find']({'where':{'id':_0x52b56c[_0xed6c('0x5b')]['id']},'include':[{'model':db['SmsMessage'],'as':_0xed6c('0x43'),'attributes':['id',_0xed6c('0x5a')],'include':[{'model':db[_0xed6c('0x4d')],'as':'User','attributes':['id',_0xed6c('0x4a')],'raw':!![]},{'model':db[_0xed6c('0x4b')],'as':'Contact','attributes':['id',_0xed6c('0x74')],'raw':!![]}]}]})[_0xed6c('0x1f')](handleEntityNotFound(_0x327ba9,null))[_0xed6c('0x1f')](function(_0x24f4cb){if(_0x24f4cb){_0x4a01ea=!![];var _0x3f0872='';var _0x12d29c={'format':_0xed6c('0x75'),'border':_0xed6c('0x76')};fs['mkdirSync'](_0x4f6401);_0x3f0872+=util['format'](_0xed6c('0x77'),_0x24f4cb['id']);_0x3f0872+=util[_0xed6c('0x78')](_0xed6c('0x79'),moment()[_0xed6c('0x78')](_0xed6c('0x7a'))[_0xed6c('0x6c')]());_0x3f0872+=_0xed6c('0x7b');for(var _0x4dd99b=0x0;_0x4dd99b<_0x24f4cb['Messages'][_0xed6c('0x55')];_0x4dd99b++){var _0x1c26b3=_0x24f4cb['Messages'][_0x4dd99b];_0x3f0872+='<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>';_0x3f0872+=util[_0xed6c('0x78')](_0xed6c('0x7c'),_0x1c26b3[_0xed6c('0x4d')]?_0x1c26b3[_0xed6c('0x4d')][_0xed6c('0x4a')]:_0x1c26b3[_0xed6c('0x4c')][_0xed6c('0x74')],_0x1c26b3[_0xed6c('0x5a')]);_0x3f0872+=_0xed6c('0x7d');}return new BPromise(function(_0x18a479,_0x4125f4){pdf[_0xed6c('0x59')](_0x3f0872,_0x12d29c)[_0xed6c('0x7e')](path['join'](_0x4f6401,_0xed6c('0x7f')+_0x48a57b+_0xed6c('0x80')),function(_0x13dae4,_0x1d2375){if(_0x13dae4)return _0x4125f4(_0x13dae4);_0x18a479(_0x1d2375);});});}})[_0xed6c('0x1f')](function(){if(_0x4a01ea){return new BPromise(function(_0x3886b4,_0x3e5064){zipdir(_0x4f6401,{'saveTo':_0x4ca3fb},function(_0x40000b,_0x6de8a8){if(_0x40000b)return _0x3e5064(_0x40000b);return _0x3886b4(_0x6de8a8);});});}})[_0xed6c('0x1f')](function(){if(_0x4a01ea){return new BPromise(function(_0x18c36e,_0x347ccf){rimraf(_0x4f6401,function(_0x182746){if(_0x182746)_0x347ccf(_0x182746);return _0x18c36e();});});}})[_0xed6c('0x1f')](function(){if(_0x4a01ea){return _0x327ba9['download'](_0x4ca3fb,_0x333353,function(_0x1f0298){if(_0x1f0298){console[_0xed6c('0x81')](_0xed6c('0x82'),_0x1f0298);}else{fs['unlinkSync'](_0x4ca3fb);}});}else{return _0x327ba9['sendStatus'](0xc8);}})[_0xed6c('0x58')](handleError(_0x327ba9,null));};
\ No newline at end of file
+var _0xb90d=['save','update','destroy','then','sendStatus','error','stack','send','index','SmsInteraction','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','day','merge','where','filter','type','VIRTUAL','field','include','tag','push','Tag','read','SmsMessage','Messages','direction','createdAt','distinct','includeAll','User','Users','internal','Account','name','key','Tags','color','ThroughTags','rows','options','catch','create','body','find','params','describe','addMessage','ids','getMessages','findOne','SmsInteractionId','map','$gte','split','format','findAll','addTags','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','interaction-%s.zip','fullname','CmContact','Contact','firstName','Letter','mkdirSync','<h1>Sms\x20Interaction:\x20#%d</h1>','<h2>Date:\x20%s</h2>','MMMM\x20Do\x20YYYY,\x20HH:mm:ss','<hr>','<div\x20style=\x22border-style:\x20solid;\x20border-width:\x201px;\x20margin:\x203px;\x22>','</div>','interaction-','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','end','status','count','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb90d,0x17a));var _0xdb90=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xb90d[_0x17a32f];return _0x15a293;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdb90('0x0'));var rimraf=require(_0xdb90('0x1'));var zipdir=require(_0xdb90('0x2'));var jsonpatch=require(_0xdb90('0x3'));var rp=require(_0xdb90('0x4'));var moment=require(_0xdb90('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb90('0x6'));var util=require(_0xdb90('0x7'));var path=require(_0xdb90('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdb90('0x9'));var fs=require('fs');var _=require(_0xdb90('0xa'));var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdb90('0xd'));var toCsv=require(_0xdb90('0xe'));var querystring=require(_0xdb90('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb90('0x10'));var qs=require(_0xdb90('0x11'));var logger=require(_0xdb90('0x12'))(_0xdb90('0x13'));var utils=require(_0xdb90('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdb90('0x15')](config[_0xdb90('0x16')],{'host':_0xdb90('0x17'),'port':0x18eb});var socket=require(_0xdb90('0x18'))(new Redis(config[_0xdb90('0x16')]));require(_0xdb90('0x19'))['register'](socket);function respondWithStatusCode(_0x554beb,_0x4deacf){_0x4deacf=_0x4deacf||0xcc;return function(_0x511592){if(_0x511592){return _0x554beb['sendStatus'](_0x4deacf);}return _0x554beb['status'](_0x4deacf)[_0xdb90('0x1a')]();};}function respondWithResult(_0x118101,_0x5b93b1){_0x5b93b1=_0x5b93b1||0xc8;return function(_0x19b02e){if(_0x19b02e){return _0x118101[_0xdb90('0x1b')](_0x5b93b1)['json'](_0x19b02e);}};}function respondWithFilteredResult(_0x4a3298,_0x113588){return function(_0x2bde8b){if(_0x2bde8b){var _0x29ceb7=_0x2bde8b[_0xdb90('0x1c')],_0x5101e9=_0x113588[_0xdb90('0x1d')],_0x27cbfd=_0x113588[_0xdb90('0x1d')]+_0x113588[_0xdb90('0x1e')],_0x13f6df;if(_0x27cbfd>=_0x29ceb7){_0x27cbfd=_0x29ceb7;_0x13f6df=0xc8;}else{_0x13f6df=0xce;}_0x4a3298[_0xdb90('0x1b')](_0x13f6df);return _0x4a3298[_0xdb90('0x1f')](_0xdb90('0x20'),_0x5101e9+'-'+_0x27cbfd+'/'+_0x29ceb7)[_0xdb90('0x21')](_0x2bde8b);}return null;};}function patchUpdates(_0x5394f7){return function(_0x55e1b7){try{jsonpatch[_0xdb90('0x22')](_0x55e1b7,_0x5394f7,!![]);}catch(_0x1c2dbe){return BPromise[_0xdb90('0x23')](_0x1c2dbe);}return _0x55e1b7[_0xdb90('0x24')]();};}function saveUpdates(_0x1f70e3,_0x57d0fa){return function(_0x31f9df){if(_0x31f9df){return _0x31f9df[_0xdb90('0x25')](_0x1f70e3)['then'](function(_0x14a73e){return _0x14a73e;});}return null;};}function removeEntity(_0x5aecb7,_0x185b08){return function(_0x2fdb1b){if(_0x2fdb1b){return _0x2fdb1b[_0xdb90('0x26')]()[_0xdb90('0x27')](function(){_0x5aecb7[_0xdb90('0x1b')](0xcc)[_0xdb90('0x1a')]();});}};}function handleEntityNotFound(_0x1de849,_0x23aea1){return function(_0x1ef44a){if(!_0x1ef44a){_0x1de849[_0xdb90('0x28')](0x194);}return _0x1ef44a;};}function handleError(_0x64268c,_0x5d3b63){_0x5d3b63=_0x5d3b63||0x1f4;return function(_0x1a27c3){logger[_0xdb90('0x29')](_0x1a27c3[_0xdb90('0x2a')]);if(_0x1a27c3['name']){delete _0x1a27c3['name'];}_0x64268c[_0xdb90('0x1b')](_0x5d3b63)[_0xdb90('0x2b')](_0x1a27c3);};}exports[_0xdb90('0x2c')]=function(_0x18e806,_0x19fd32){var _0x321efc={},_0x46f743={},_0x67aebc={'count':0x0,'rows':[]};var _0x554d8f=db[_0xdb90('0x2d')][_0xdb90('0x2e')];_0x46f743[_0xdb90('0x2f')]=_[_0xdb90('0x30')](_0x554d8f);var _0x3e9791={'dateStart':_0x18e806[_0xdb90('0x31')][_0xdb90('0x32')],'dateEnd':_0x18e806[_0xdb90('0x31')][_0xdb90('0x33')]};delete _0x18e806[_0xdb90('0x31')][_0xdb90('0x32')];delete _0x18e806[_0xdb90('0x31')][_0xdb90('0x33')];_0x46f743[_0xdb90('0x31')]=_['keys'](_0x18e806[_0xdb90('0x31')]);_0x46f743[_0xdb90('0x34')]=_[_0xdb90('0x35')](_0x46f743[_0xdb90('0x2f')],_0x46f743[_0xdb90('0x31')]);_0x321efc[_0xdb90('0x36')]=_[_0xdb90('0x35')](_0x46f743[_0xdb90('0x2f')],qs[_0xdb90('0x37')](_0x18e806[_0xdb90('0x31')]['fields']));_0x321efc[_0xdb90('0x36')]=_0x321efc[_0xdb90('0x36')]['length']?_0x321efc[_0xdb90('0x36')]:_0x46f743[_0xdb90('0x2f')];if(!_0x18e806[_0xdb90('0x31')][_0xdb90('0x38')](_0xdb90('0x39'))){_0x321efc['limit']=qs[_0xdb90('0x1e')](_0x18e806[_0xdb90('0x31')][_0xdb90('0x1e')]);_0x321efc['offset']=qs[_0xdb90('0x1d')](_0x18e806[_0xdb90('0x31')]['offset']);}_0x321efc[_0xdb90('0x3a')]=qs[_0xdb90('0x3b')](_0x18e806[_0xdb90('0x31')][_0xdb90('0x3b')]);_0x321efc['where']=qs[_0xdb90('0x34')](_[_0xdb90('0x3c')](_0x18e806['query'],_0x46f743['filters']));if(_0x3e9791[_0xdb90('0x32')]){if(_0x3e9791[_0xdb90('0x33')]){_0x3e9791[_0xdb90('0x33')]=moment(_0x3e9791[_0xdb90('0x33')])['add'](0x1,_0xdb90('0x3d'));}else{_0x3e9791['dateEnd']=moment(_0x3e9791['dateStart'])['add'](0x1,_0xdb90('0x3d'));}_[_0xdb90('0x3e')](_0x321efc[_0xdb90('0x3f')],{'createdAt':{'$gte':_0x3e9791[_0xdb90('0x32')],'$lte':_0x3e9791[_0xdb90('0x33')]}});}if(_0x18e806['query'][_0xdb90('0x40')]){_0x321efc['where']=_[_0xdb90('0x3e')](_0x321efc[_0xdb90('0x3f')],{'$or':_['map'](_0x554d8f,function(_0x4d041e){if(_0x4d041e[_0xdb90('0x41')]['key']!==_0xdb90('0x42')){var _0x26ba02={};_0x26ba02[_0x4d041e[_0xdb90('0x43')]]={'$like':'%'+_0x18e806['query'][_0xdb90('0x40')]+'%'};return _0x26ba02;}})});}_0x321efc=_[_0xdb90('0x3e')]({},_0x321efc,_0x18e806['options']);var _0x10e4e3={'where':_0x321efc[_0xdb90('0x3f')]};_0x10e4e3[_0xdb90('0x44')]=[];if(_0x18e806[_0xdb90('0x31')][_0xdb90('0x45')]){_0x10e4e3[_0xdb90('0x44')][_0xdb90('0x46')]({'model':db[_0xdb90('0x47')],'as':'Tags','attributes':['id'],'where':{'id':_0x18e806[_0xdb90('0x31')]['tag']},'required':!![]});_0x10e4e3['distinct']=!![];}if(_0x18e806['query'][_0xdb90('0x48')]){_0x10e4e3['include']['push']({'model':db[_0xdb90('0x49')],'as':_0xdb90('0x4a'),'attributes':['id',_0xdb90('0x4b'),_0xdb90('0x4c'),'read'],'where':{'direction':'in','read':_0x18e806[_0xdb90('0x31')][_0xdb90('0x48')]||![]},'required':!![]});_0x10e4e3[_0xdb90('0x4d')]=!![];}return db[_0xdb90('0x2d')][_0xdb90('0x1c')](_0x10e4e3)[_0xdb90('0x27')](function(_0x45ef0d){_0x67aebc[_0xdb90('0x1c')]=_0x45ef0d;if(_0x18e806[_0xdb90('0x31')][_0xdb90('0x4e')]){_0x321efc[_0xdb90('0x44')]=[{'model':db[_0xdb90('0x4f')],'as':_0xdb90('0x50'),'required':![],'attributes':['id','name','fullname']},{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xdb90('0x4f')],'as':'Owner','attributes':['name','fullname',_0xdb90('0x51')],'required':![]},{'model':db['SmsAccount'],'as':_0xdb90('0x52'),'attributes':[_0xdb90('0x53'),_0xdb90('0x54')],'required':![]},{'model':db[_0xdb90('0x49')],'as':_0xdb90('0x4a'),'attributes':['id',_0xdb90('0x4b'),_0xdb90('0x4c'),_0xdb90('0x48')],'where':{'direction':'in','read':_0x18e806['query'][_0xdb90('0x48')]||![]},'required':_0x18e806[_0xdb90('0x31')]['read']||![]},{'model':db['Tag'],'as':_0xdb90('0x55'),'attributes':['id',_0xdb90('0x53'),_0xdb90('0x56')],'required':_0x18e806['query'][_0xdb90('0x45')]?!![]:![]},{'model':db[_0xdb90('0x47')],'as':_0xdb90('0x57'),'attributes':['id',_0xdb90('0x53'),_0xdb90('0x56')],'through':_0x18e806[_0xdb90('0x31')][_0xdb90('0x45')]?{'attributes':[],'where':{'TagId':_0x18e806[_0xdb90('0x31')][_0xdb90('0x45')]||undefined}}:{},'required':_0x18e806[_0xdb90('0x31')][_0xdb90('0x45')]?!![]:![]}];}return db[_0xdb90('0x2d')]['findAll'](_0x321efc);})['then'](function(_0x5c0f70){_0x67aebc[_0xdb90('0x58')]=_0x5c0f70;return _0x67aebc;})[_0xdb90('0x27')](respondWithFilteredResult(_0x19fd32,_0x321efc))['catch'](handleError(_0x19fd32,null));};exports['show']=function(_0x34be48,_0x598ce0){var _0x28606a={'raw':![],'where':{'id':_0x34be48['params']['id']}},_0x372962={};_0x372962[_0xdb90('0x2f')]=_[_0xdb90('0x30')](db['SmsInteraction']['rawAttributes']);_0x372962[_0xdb90('0x31')]=_[_0xdb90('0x30')](_0x34be48[_0xdb90('0x31')]);_0x372962[_0xdb90('0x34')]=_[_0xdb90('0x35')](_0x372962[_0xdb90('0x2f')],_0x372962['query']);_0x28606a['attributes']=_[_0xdb90('0x35')](_0x372962[_0xdb90('0x2f')],qs['fields'](_0x34be48[_0xdb90('0x31')][_0xdb90('0x37')]));_0x28606a[_0xdb90('0x36')]=_0x28606a[_0xdb90('0x36')]['length']?_0x28606a[_0xdb90('0x36')]:_0x372962['model'];if(_0x34be48[_0xdb90('0x31')][_0xdb90('0x4e')]){_0x28606a[_0xdb90('0x44')]=[{'all':!![]}];}_0x28606a=_[_0xdb90('0x3e')]({},_0x28606a,_0x34be48[_0xdb90('0x59')]);return db['SmsInteraction']['find'](_0x28606a)[_0xdb90('0x27')](handleEntityNotFound(_0x598ce0,null))[_0xdb90('0x27')](respondWithResult(_0x598ce0,null))[_0xdb90('0x5a')](handleError(_0x598ce0,null));};exports[_0xdb90('0x5b')]=function(_0x53350f,_0x306c62){return db[_0xdb90('0x2d')][_0xdb90('0x5b')](_0x53350f[_0xdb90('0x5c')],{})[_0xdb90('0x27')](respondWithResult(_0x306c62,0xc9))[_0xdb90('0x5a')](handleError(_0x306c62,null));};exports['update']=function(_0x42a883,_0x2180eb){if(_0x42a883[_0xdb90('0x5c')]['id']){delete _0x42a883[_0xdb90('0x5c')]['id'];}return db[_0xdb90('0x2d')][_0xdb90('0x5d')]({'where':{'id':_0x42a883[_0xdb90('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2180eb,null))[_0xdb90('0x27')](saveUpdates(_0x42a883[_0xdb90('0x5c')],null))[_0xdb90('0x27')](respondWithResult(_0x2180eb,null))[_0xdb90('0x5a')](handleError(_0x2180eb,null));};exports[_0xdb90('0x26')]=function(_0x1cb910,_0x4df113){return db[_0xdb90('0x2d')][_0xdb90('0x5d')]({'where':{'id':_0x1cb910['params']['id']}})[_0xdb90('0x27')](handleEntityNotFound(_0x4df113,null))[_0xdb90('0x27')](removeEntity(_0x4df113,null))[_0xdb90('0x5a')](handleError(_0x4df113,null));};exports[_0xdb90('0x5f')]=function(_0x2fc237,_0x5ec05f){return db[_0xdb90('0x2d')]['describe']()[_0xdb90('0x27')](respondWithResult(_0x5ec05f,null))[_0xdb90('0x5a')](handleError(_0x5ec05f,null));};exports[_0xdb90('0x60')]=function(_0x194141,_0x367c73,_0x3c1571){return db['SmsMessage'][_0xdb90('0x5d')]({'where':{'id':_0x194141[_0xdb90('0x5e')]['id']}})['then'](handleEntityNotFound(_0x367c73,null))['then'](function(_0x10e936){if(_0x10e936){return _0x10e936[_0xdb90('0x60')](_0x194141[_0xdb90('0x5c')][_0xdb90('0x61')],_['omit'](_0x194141[_0xdb90('0x5c')],[_0xdb90('0x61'),'id'])||{});}})['then'](respondWithResult(_0x367c73,null))[_0xdb90('0x5a')](handleError(_0x367c73,null));};exports[_0xdb90('0x62')]=function(_0xbf1af0,_0x18885e,_0x248d69){var _0x4e03cd={'raw':![],'where':{}};var _0x358c1b={};var _0x6d224c={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xdb90('0x63')]({'where':{'id':_0xbf1af0[_0xdb90('0x5e')]['id']}})[_0xdb90('0x27')](handleEntityNotFound(_0x18885e,null))['then'](function(_0x2d71ee){if(_0x2d71ee){_0x358c1b[_0xdb90('0x2f')]=_[_0xdb90('0x30')](db[_0xdb90('0x49')]['rawAttributes']);_0x358c1b[_0xdb90('0x31')]=_[_0xdb90('0x30')](_0xbf1af0['query']);_0x358c1b['filters']=_[_0xdb90('0x35')](_0x358c1b[_0xdb90('0x2f')],_0x358c1b['query']);_0x4e03cd['attributes']=_[_0xdb90('0x35')](_0x358c1b[_0xdb90('0x2f')],qs[_0xdb90('0x37')](_0xbf1af0[_0xdb90('0x31')][_0xdb90('0x37')]));_0x4e03cd[_0xdb90('0x36')]=_0x4e03cd[_0xdb90('0x36')]['length']?_0x4e03cd[_0xdb90('0x36')]:_0x358c1b[_0xdb90('0x2f')];if(!_0xbf1af0['query']['hasOwnProperty'](_0xdb90('0x39'))){_0x4e03cd['limit']=qs[_0xdb90('0x1e')](_0xbf1af0['query'][_0xdb90('0x1e')]);_0x4e03cd[_0xdb90('0x1d')]=qs[_0xdb90('0x1d')](_0xbf1af0['query'][_0xdb90('0x1d')]);}_0x4e03cd[_0xdb90('0x3a')]=qs[_0xdb90('0x3b')](_0xbf1af0[_0xdb90('0x31')]['sort']);_0x4e03cd['where']=qs[_0xdb90('0x34')](_['pick'](_0xbf1af0[_0xdb90('0x31')],_0x358c1b['filters']));_0x4e03cd[_0xdb90('0x3f')][_0xdb90('0x64')]=_0x2d71ee['id'];if(_0xbf1af0['query'][_0xdb90('0x40')]){_0x4e03cd[_0xdb90('0x3f')]=_['merge'](_0x4e03cd['where'],{'$or':_[_0xdb90('0x65')](_0x4e03cd[_0xdb90('0x36')],function(_0x327b3b){var _0x473e93={};_0x473e93[_0x327b3b]={'$like':'%'+_0xbf1af0['query'][_0xdb90('0x40')]+'%'};return _0x473e93;})});}if(_0xbf1af0[_0xdb90('0x31')]['$gte']){var _0x10d7e8=_0xbf1af0['query'][_0xdb90('0x66')][_0xdb90('0x67')](',');var _0x227a96={};_0x227a96[_0x10d7e8[0x0]]={'$gte':moment(_0x10d7e8[0x1])[_0xdb90('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4e03cd['where']=_[_0xdb90('0x3e')](_0x4e03cd[_0xdb90('0x3f')],_0x227a96);}_0x4e03cd=_['merge']({},_0x4e03cd,_0xbf1af0[_0xdb90('0x59')]);return db[_0xdb90('0x49')][_0xdb90('0x1c')]({'where':_0x4e03cd[_0xdb90('0x3f')]})[_0xdb90('0x27')](function(_0x19a176){_0x6d224c[_0xdb90('0x1c')]=_0x19a176;if(_0xbf1af0[_0xdb90('0x31')]['includeAll']){_0x4e03cd[_0xdb90('0x44')]=[{'all':!![]}];}return db[_0xdb90('0x49')][_0xdb90('0x69')](_0x4e03cd);})[_0xdb90('0x27')](function(_0x5a9b4e){_0x6d224c[_0xdb90('0x58')]=_0x5a9b4e;return _0x6d224c;});}})['then'](respondWithFilteredResult(_0x18885e,_0x4e03cd))[_0xdb90('0x5a')](handleError(_0x18885e,null));};exports[_0xdb90('0x6a')]=function(_0x4af59f,_0x13554f,_0xdc2051){return db[_0xdb90('0x2d')][_0xdb90('0x5d')]({'where':{'id':_0x4af59f[_0xdb90('0x5e')]['id']}})['then'](handleEntityNotFound(_0x13554f,null))[_0xdb90('0x27')](function(_0x28e90f){if(_0x28e90f){return _0x28e90f[_0xdb90('0x6b')](_0x4af59f[_0xdb90('0x5c')][_0xdb90('0x61')],_[_0xdb90('0x6c')](_0x4af59f[_0xdb90('0x5c')],[_0xdb90('0x61'),'id'])||{})[_0xdb90('0x6d')](function(){return db[_0xdb90('0x47')][_0xdb90('0x69')]({'attributes':['id',_0xdb90('0x53'),_0xdb90('0x56')],'where':{'id':_0x4af59f[_0xdb90('0x5c')]['ids']}});})['then'](function(_0x503c8b){socket[_0xdb90('0x6e')](_0xdb90('0x6f'),{'id':Number(_0x4af59f[_0xdb90('0x5e')]['id']),'tags':_0x503c8b||[]});return{'id':Number(_0x4af59f[_0xdb90('0x5e')]['id']),'tags':_0x503c8b||[]};});}})[_0xdb90('0x27')](respondWithResult(_0x13554f,null))[_0xdb90('0x5a')](handleError(_0x13554f,null));};exports[_0xdb90('0x70')]=function(_0x28f1ba,_0x2a3f9c,_0x250966){var _0x54d6e9;return db[_0xdb90('0x2d')]['find']({'where':{'id':_0x28f1ba[_0xdb90('0x5e')]['id']}})[_0xdb90('0x27')](handleEntityNotFound(_0x2a3f9c,null))[_0xdb90('0x27')](function(_0xe65b97){if(_0xe65b97){return _0xe65b97[_0xdb90('0x70')](_0x28f1ba[_0xdb90('0x31')]['ids']);}})[_0xdb90('0x27')](respondWithStatusCode(_0x2a3f9c,null))[_0xdb90('0x5a')](handleError(_0x2a3f9c,null));};exports[_0xdb90('0x71')]=function(_0x41dd22,_0x3cdb58){var _0x305e3f=moment()[_0xdb90('0x72')]()[_0xdb90('0x73')]();var _0x1b4d33=path[_0xdb90('0x74')](config[_0xdb90('0x75')],_0xdb90('0x76'),'files',_0xdb90('0x77'));var _0x228466=path[_0xdb90('0x74')](config[_0xdb90('0x75')],_0xdb90('0x76'),_0xdb90('0x78'),'attachments');var _0x1cb9ef=path[_0xdb90('0x74')](_0x1b4d33,_0x305e3f);var _0x29ec00=util[_0xdb90('0x68')](_0xdb90('0x79'),_0x305e3f);var _0x54f146=path['join'](_0x1b4d33,_0x29ec00);var _0x4e03c0=![];return db[_0xdb90('0x2d')][_0xdb90('0x5d')]({'where':{'id':_0x41dd22[_0xdb90('0x5e')]['id']},'include':[{'model':db[_0xdb90('0x49')],'as':_0xdb90('0x4a'),'attributes':['id',_0xdb90('0x5c')],'include':[{'model':db[_0xdb90('0x4f')],'as':_0xdb90('0x4f'),'attributes':['id',_0xdb90('0x7a')],'raw':!![]},{'model':db[_0xdb90('0x7b')],'as':_0xdb90('0x7c'),'attributes':['id',_0xdb90('0x7d')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3cdb58,null))[_0xdb90('0x27')](function(_0x498703){if(_0x498703){_0x4e03c0=!![];var _0x268867='';var _0x4ee794={'format':_0xdb90('0x7e'),'border':'1cm'};fs[_0xdb90('0x7f')](_0x1cb9ef);_0x268867+=util['format'](_0xdb90('0x80'),_0x498703['id']);_0x268867+=util['format'](_0xdb90('0x81'),moment()['format'](_0xdb90('0x82'))[_0xdb90('0x73')]());_0x268867+=_0xdb90('0x83');for(var _0x3c0342=0x0;_0x3c0342<_0x498703[_0xdb90('0x4a')]['length'];_0x3c0342++){var _0x3f474b=_0x498703['Messages'][_0x3c0342];_0x268867+=_0xdb90('0x84');_0x268867+=util[_0xdb90('0x68')]('<p\x20style=\x22margin:\x203px;\x22>%s:\x20%s</p>',_0x3f474b[_0xdb90('0x4f')]?_0x3f474b[_0xdb90('0x4f')]['fullname']:_0x3f474b[_0xdb90('0x7c')]['firstName'],_0x3f474b[_0xdb90('0x5c')]);_0x268867+=_0xdb90('0x85');}return new BPromise(function(_0x1703d6,_0x1c1e3b){pdf[_0xdb90('0x5b')](_0x268867,_0x4ee794)['toFile'](path['join'](_0x1cb9ef,_0xdb90('0x86')+_0x305e3f+'.pdf'),function(_0x3ca58f,_0x36bb6a){if(_0x3ca58f)return _0x1c1e3b(_0x3ca58f);_0x1703d6(_0x36bb6a);});});}})[_0xdb90('0x27')](function(){if(_0x4e03c0){return new BPromise(function(_0x4a5dfe,_0x76bd5a){zipdir(_0x1cb9ef,{'saveTo':_0x54f146},function(_0x4569da,_0x11084c){if(_0x4569da)return _0x76bd5a(_0x4569da);return _0x4a5dfe(_0x11084c);});});}})[_0xdb90('0x27')](function(){if(_0x4e03c0){return new BPromise(function(_0x2a154d,_0x27bc81){rimraf(_0x1cb9ef,function(_0x1cd992){if(_0x1cd992)_0x27bc81(_0x1cd992);return _0x2a154d();});});}})[_0xdb90('0x27')](function(){if(_0x4e03c0){return _0x3cdb58['download'](_0x54f146,_0x29ec00,function(_0x3ecb41){if(_0x3ecb41){console[_0xdb90('0x87')](_0xdb90('0x88'),_0x3ecb41);}else{fs[_0xdb90('0x89')](_0x54f146);}});}else{return _0x3cdb58[_0xdb90('0x28')](0xc8);}})['catch'](handleError(_0x3cdb58,null));};
\ No newline at end of file
index 4d10ac3..4997f44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e8c=['../../mysqldb','SmsInteraction','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e8c,0x70));var _0xc4e8=function(_0x49693f,_0x4d994f){_0x49693f=_0x49693f-0x0;var _0x1b0f6e=_0x4e8c[_0x49693f];return _0x1b0f6e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xc4e8('0x0'))['db'][_0xc4e8('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc4e8('0x2'),'afterUpdate':_0xc4e8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x570aa6){return function(_0x46631b,_0x3c8250,_0x3e6a5e){SmsInteractionEvents[_0xc4e8('0x4')](_0x570aa6+':'+_0x46631b['id'],_0x46631b);SmsInteractionEvents[_0xc4e8('0x4')](_0x570aa6,_0x46631b);_0x3e6a5e(null);};}for(var e in events){if(events[_0xc4e8('0x5')](e)){var event=events[e];SmsInteraction[_0xc4e8('0x6')](e,emitEvent(event));}}module[_0xc4e8('0x7')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x75fc=['SmsInteraction','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x75fc,0x8a));var _0xc75f=function(_0x24dd04,_0xc76a46){_0x24dd04=_0x24dd04-0x0;var _0x4d8d7c=_0x75fc[_0x24dd04];return _0x4d8d7c;};'use strict';var EventEmitter=require(_0xc75f('0x0'));var SmsInteraction=require(_0xc75f('0x1'))['db'][_0xc75f('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc75f('0x3'),'afterUpdate':_0xc75f('0x4'),'afterDestroy':_0xc75f('0x5')};function emitEvent(_0x58b2a0){return function(_0x5ee568,_0x1087f8,_0x2ec4e6){SmsInteractionEvents[_0xc75f('0x6')](_0x58b2a0+':'+_0x5ee568['id'],_0x5ee568);SmsInteractionEvents[_0xc75f('0x6')](_0x58b2a0,_0x5ee568);_0x2ec4e6(null);};}for(var e in events){if(events[_0xc75f('0x7')](e)){var event=events[e];SmsInteraction[_0xc75f('0x8')](e,emitEvent(event));}}module[_0xc75f('0x9')]=SmsInteractionEvents;
\ No newline at end of file
index 9404251..8342ca1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8106=['./smsInteraction.attributes','define','SmsInteraction','sms_interactions','lodash','../../config/logger','api','moment','request-promise'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x8106,0x190));var _0x6810=function(_0x4f8377,_0x449b48){_0x4f8377=_0x4f8377-0x0;var _0xc7212f=_0x8106[_0x4f8377];return _0xc7212f;};'use strict';var _=require(_0x6810('0x0'));var util=require('util');var logger=require(_0x6810('0x1'))(_0x6810('0x2'));var moment=require(_0x6810('0x3'));var BPromise=require('bluebird');var rp=require(_0x6810('0x4'));var attributes=require(_0x6810('0x5'));module['exports']=function(_0x2b0edc,_0x1c5e96){return _0x2b0edc[_0x6810('0x6')](_0x6810('0x7'),attributes,{'tableName':_0x6810('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeab3=['exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x9af6f0,_0x5b5c1d){var _0x50bd75=function(_0x394883){while(--_0x394883){_0x9af6f0['push'](_0x9af6f0['shift']());}};_0x50bd75(++_0x5b5c1d);}(_0xeab3,0x143));var _0x3eab=function(_0x33539a,_0xab9aa5){_0x33539a=_0x33539a-0x0;var _0x1a99a7=_0xeab3[_0x33539a];return _0x1a99a7;};'use strict';var _=require(_0x3eab('0x0'));var util=require(_0x3eab('0x1'));var logger=require(_0x3eab('0x2'))(_0x3eab('0x3'));var moment=require(_0x3eab('0x4'));var BPromise=require(_0x3eab('0x5'));var rp=require('request-promise');var attributes=require('./smsInteraction.attributes');module[_0x3eab('0x6')]=function(_0x44addd,_0x13ba56){return _0x44addd['define']('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index da4d315..252626c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4be6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment'];(function(_0x4ba054,_0x4fd478){var _0x4e5ec7=function(_0x4020b3){while(--_0x4020b3){_0x4ba054['push'](_0x4ba054['shift']());}};_0x4e5ec7(++_0x4fd478);}(_0x4be6,0x7e));var _0x64be=function(_0x4fac58,_0x213b99){_0x4fac58=_0x4fac58-0x0;var _0x10e5d1=_0x4be6[_0x4fac58];return _0x10e5d1;};'use strict';var _=require(_0x64be('0x0'));var util=require(_0x64be('0x1'));var moment=require(_0x64be('0x2'));var BPromise=require(_0x64be('0x3'));var rs=require(_0x64be('0x4'));var fs=require('fs');var Redis=require(_0x64be('0x5'));var db=require(_0x64be('0x6'))['db'];var utils=require(_0x64be('0x7'));var logger=require('../../config/logger')(_0x64be('0x8'));var config=require(_0x64be('0x9'));var jayson=require(_0x64be('0xa'));var client=jayson[_0x64be('0xb')][_0x64be('0xc')]({'port':0x232a});config[_0x64be('0xd')]=_[_0x64be('0xe')](config[_0x64be('0xd')],{'host':_0x64be('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64be('0xd')]));require(_0x64be('0x10'))['register'](socket);function respondWithRpcPromise(_0xa65e32,_0x5c30c3,_0x2bee5b){return new BPromise(function(_0x6afbfa,_0x1d82a9){return client[_0x64be('0x11')](_0xa65e32,_0x2bee5b)[_0x64be('0x12')](function(_0x585a0f){logger[_0x64be('0x13')](_0x64be('0x14'),_0x5c30c3,_0x64be('0x15'));logger[_0x64be('0x16')](_0x64be('0x17'),_0x5c30c3,_0x64be('0x15'),JSON[_0x64be('0x18')](_0x585a0f));if(_0x585a0f[_0x64be('0x19')]){if(_0x585a0f[_0x64be('0x19')]['code']===0x1f4){logger[_0x64be('0x19')](_0x64be('0x14'),_0x5c30c3,_0x585a0f['error'][_0x64be('0x1a')]);return _0x1d82a9(_0x585a0f['error']['message']);}logger[_0x64be('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x5c30c3,_0x585a0f[_0x64be('0x19')][_0x64be('0x1a')]);return _0x6afbfa(_0x585a0f[_0x64be('0x19')][_0x64be('0x1a')]);}else{logger[_0x64be('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x5c30c3,_0x64be('0x15'));_0x6afbfa(_0x585a0f['result'][_0x64be('0x1a')]);}})[_0x64be('0x1b')](function(_0x5e82e9){logger[_0x64be('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x5c30c3,_0x5e82e9);_0x1d82a9(_0x5e82e9);});});}exports[_0x64be('0x1c')]=function(_0x579a6e){var _0xb8614=this;return new Promise(function(_0x318587,_0x57b866){return db[_0x64be('0x1d')][_0x64be('0x1e')](_0x579a6e[_0x64be('0x1f')],{'raw':_0x579a6e[_0x64be('0x20')]?_0x579a6e[_0x64be('0x20')][_0x64be('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579a6e[_0x64be('0x20')]?_0x579a6e[_0x64be('0x20')][_0x64be('0x22')]||null:null,'attributes':_0x579a6e[_0x64be('0x20')]?_0x579a6e[_0x64be('0x20')][_0x64be('0x23')]||null:null,'limit':_0x579a6e[_0x64be('0x20')]?_0x579a6e['options'][_0x64be('0x24')]||null:null})[_0x64be('0x12')](function(_0x374329){logger[_0x64be('0x13')](_0x64be('0x1c'),_0x579a6e);logger[_0x64be('0x16')](_0x64be('0x1c'),_0x579a6e,JSON[_0x64be('0x18')](_0x374329));_0x318587(_0x374329);})[_0x64be('0x1b')](function(_0x490f1a){logger[_0x64be('0x19')](_0x64be('0x1c'),_0x490f1a['message'],_0x579a6e);_0x57b866(_0xb8614[_0x64be('0x19')](0x1f4,_0x490f1a[_0x64be('0x1a')]));});});};exports[_0x64be('0x25')]=function(_0x34d6e4){return new Promise(function(_0x44c720,_0x1cf28f){return db[_0x64be('0x1d')][_0x64be('0x26')]({'where':_0x34d6e4[_0x64be('0x20')]?_0x34d6e4[_0x64be('0x20')][_0x64be('0x22')]||null:null})['then'](function(_0x2eb823){if(_0x2eb823){return _0x2eb823[_0x64be('0x27')](_0x34d6e4[_0x64be('0x1f')]['ids'],_['omit'](_0x34d6e4[_0x64be('0x1f')],[_0x64be('0x28'),'id'])||{});}})[_0x64be('0x29')](function(_0x4cf137){logger['info']('AddTags',_0x34d6e4);logger[_0x64be('0x16')](_0x64be('0x2a'),_0x34d6e4,JSON[_0x64be('0x18')](_0x4cf137));_0x44c720(_0x4cf137);})[_0x64be('0x1b')](function(_0x3ce89f){logger[_0x64be('0x19')](_0x64be('0x2a'),_0x3ce89f[_0x64be('0x1a')],_0x34d6e4);_0x1cf28f(_this['error'](0x1f4,_0x3ce89f[_0x64be('0x1a')]));});});};
\ No newline at end of file
+var _0x141b=['catch','UpdateSmsInteraction','update','raw','options','where','attributes','limit','AddTagsToSmsInteraction','SmsInteraction','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x369669,_0x5f1661){var _0x45a9ea=function(_0x47f948){while(--_0x47f948){_0x369669['push'](_0x369669['shift']());}};_0x45a9ea(++_0x5f1661);}(_0x141b,0x10b));var _0xb141=function(_0x1d57d6,_0x48063e){_0x1d57d6=_0x1d57d6-0x0;var _0x1845f9=_0x141b[_0x1d57d6];return _0x1845f9;};'use strict';var _=require(_0xb141('0x0'));var util=require(_0xb141('0x1'));var moment=require(_0xb141('0x2'));var BPromise=require(_0xb141('0x3'));var rs=require(_0xb141('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb141('0x5'))['db'];var utils=require(_0xb141('0x6'));var logger=require(_0xb141('0x7'))('rpc');var config=require(_0xb141('0x8'));var jayson=require(_0xb141('0x9'));var client=jayson[_0xb141('0xa')][_0xb141('0xb')]({'port':0x232a});config[_0xb141('0xc')]=_[_0xb141('0xd')](config[_0xb141('0xc')],{'host':_0xb141('0xe'),'port':0x18eb});var socket=require(_0xb141('0xf'))(new Redis(config[_0xb141('0xc')]));require(_0xb141('0x10'))['register'](socket);function respondWithRpcPromise(_0x40ed65,_0x202046,_0x2e31e5){return new BPromise(function(_0x378f57,_0x5d06e4){return client[_0xb141('0x11')](_0x40ed65,_0x2e31e5)[_0xb141('0x12')](function(_0xc18b65){logger[_0xb141('0x13')](_0xb141('0x14'),_0x202046,_0xb141('0x15'));logger[_0xb141('0x16')](_0xb141('0x17'),_0x202046,_0xb141('0x15'),JSON[_0xb141('0x18')](_0xc18b65));if(_0xc18b65[_0xb141('0x19')]){if(_0xc18b65[_0xb141('0x19')]['code']===0x1f4){logger[_0xb141('0x19')](_0xb141('0x14'),_0x202046,_0xc18b65[_0xb141('0x19')]['message']);return _0x5d06e4(_0xc18b65[_0xb141('0x19')][_0xb141('0x1a')]);}logger[_0xb141('0x19')](_0xb141('0x14'),_0x202046,_0xc18b65[_0xb141('0x19')]['message']);return _0x378f57(_0xc18b65[_0xb141('0x19')][_0xb141('0x1a')]);}else{logger['info'](_0xb141('0x14'),_0x202046,_0xb141('0x15'));_0x378f57(_0xc18b65['result'][_0xb141('0x1a')]);}})[_0xb141('0x1b')](function(_0x4fcc47){logger['error'](_0xb141('0x14'),_0x202046,_0x4fcc47);_0x5d06e4(_0x4fcc47);});});}exports[_0xb141('0x1c')]=function(_0x4e8df3){var _0x2b1204=this;return new Promise(function(_0x3a656e,_0x50c1ca){return db['SmsInteraction'][_0xb141('0x1d')](_0x4e8df3['body'],{'raw':_0x4e8df3['options']?_0x4e8df3['options'][_0xb141('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e8df3[_0xb141('0x1f')]?_0x4e8df3['options'][_0xb141('0x20')]||null:null,'attributes':_0x4e8df3[_0xb141('0x1f')]?_0x4e8df3[_0xb141('0x1f')][_0xb141('0x21')]||null:null,'limit':_0x4e8df3[_0xb141('0x1f')]?_0x4e8df3[_0xb141('0x1f')][_0xb141('0x22')]||null:null})['then'](function(_0x463f7d){logger[_0xb141('0x13')](_0xb141('0x1c'),_0x4e8df3);logger[_0xb141('0x16')](_0xb141('0x1c'),_0x4e8df3,JSON[_0xb141('0x18')](_0x463f7d));_0x3a656e(_0x463f7d);})['catch'](function(_0xdf0149){logger[_0xb141('0x19')](_0xb141('0x1c'),_0xdf0149[_0xb141('0x1a')],_0x4e8df3);_0x50c1ca(_0x2b1204[_0xb141('0x19')](0x1f4,_0xdf0149[_0xb141('0x1a')]));});});};exports[_0xb141('0x23')]=function(_0x1e02fd){return new Promise(function(_0x8340a,_0x10b789){return db[_0xb141('0x24')]['find']({'where':_0x1e02fd[_0xb141('0x1f')]?_0x1e02fd[_0xb141('0x1f')][_0xb141('0x20')]||null:null})[_0xb141('0x12')](function(_0x5ee089){if(_0x5ee089){return _0x5ee089[_0xb141('0x25')](_0x1e02fd[_0xb141('0x26')][_0xb141('0x27')],_[_0xb141('0x28')](_0x1e02fd['body'],[_0xb141('0x27'),'id'])||{});}})['spread'](function(_0x1ae96b){logger[_0xb141('0x13')](_0xb141('0x29'),_0x1e02fd);logger[_0xb141('0x16')](_0xb141('0x29'),_0x1e02fd,JSON[_0xb141('0x18')](_0x1ae96b));_0x8340a(_0x1ae96b);})[_0xb141('0x1b')](function(_0x29f839){logger[_0xb141('0x19')](_0xb141('0x29'),_0x29f839[_0xb141('0x1a')],_0x1e02fd);_0x10b789(_this[_0xb141('0x19')](0x1f4,_0x29f839[_0xb141('0x1a')]));});});};
\ No newline at end of file
index e265933..19b0321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe697=['remove','emit','smsInteraction:','save'];(function(_0x3e8ff8,_0x53eba4){var _0x3c8315=function(_0x413b1b){while(--_0x413b1b){_0x3e8ff8['push'](_0x3e8ff8['shift']());}};_0x3c8315(++_0x53eba4);}(_0xe697,0x1cf));var _0x7e69=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0xe697[_0x255c48];return _0xaebda3;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x7e69('0x0'),_0x7e69('0x1'),'update'];function createListener(_0x4fe0b0,_0x22a580){return function(_0xe278f7){_0x22a580[_0x7e69('0x2')](_0x4fe0b0,_0xe278f7);};}function removeListener(_0x53373f,_0x4ec532){return function(){SmsInteractionEvents['removeListener'](_0x53373f,_0x4ec532);};}exports['register']=function(_0x56dca7){for(var _0x5c893a=0x0,_0x307335=events['length'];_0x5c893a<_0x307335;_0x5c893a++){var _0x6c1cf0=events[_0x5c893a];var _0x5e5a57=createListener(_0x7e69('0x3')+_0x6c1cf0,_0x56dca7);SmsInteractionEvents['on'](_0x6c1cf0,_0x5e5a57);}};
\ No newline at end of file
+var _0x6f0d=['remove','update','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x4fe7b9,_0x20ab2a){var _0x53439d=function(_0x2fc56b){while(--_0x2fc56b){_0x4fe7b9['push'](_0x4fe7b9['shift']());}};_0x53439d(++_0x20ab2a);}(_0x6f0d,0x1e5));var _0xd6f0=function(_0x34f78b,_0x26b7f5){_0x34f78b=_0x34f78b-0x0;var _0x1c6b2e=_0x6f0d[_0x34f78b];return _0x1c6b2e;};'use strict';var SmsInteractionEvents=require(_0xd6f0('0x0'));var events=['save',_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x214284,_0x20cf0c){return function(_0x13cfe2){_0x20cf0c['emit'](_0x214284,_0x13cfe2);};}function removeListener(_0x196ec0,_0x2072dc){return function(){SmsInteractionEvents[_0xd6f0('0x3')](_0x196ec0,_0x2072dc);};}exports['register']=function(_0x52c4d9){for(var _0x18a556=0x0,_0x1cf8b2=events[_0xd6f0('0x4')];_0x18a556<_0x1cf8b2;_0x18a556++){var _0x289bc6=events[_0x18a556];var _0x272022=createListener(_0xd6f0('0x5')+_0x289bc6,_0x52c4d9);SmsInteractionEvents['on'](_0x289bc6,_0x272022);}};
\ No newline at end of file
index b4fc915..f4e9d1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe346=['/:id/status','status','put','/:id/accept','accept','reject','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create'];(function(_0x44ed50,_0x27fe97){var _0x4788ea=function(_0x2d286d){while(--_0x2d286d){_0x44ed50['push'](_0x44ed50['shift']());}};_0x4788ea(++_0x27fe97);}(_0xe346,0x89));var _0x6e34=function(_0x4286c7,_0xe6a8d4){_0x4286c7=_0x4286c7-0x0;var _0x426147=_0xe346[_0x4286c7];return _0x426147;};'use strict';var multer=require(_0x6e34('0x0'));var util=require('util');var path=require(_0x6e34('0x1'));var timeout=require(_0x6e34('0x2'));var express=require(_0x6e34('0x3'));var router=express[_0x6e34('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e34('0x5'));var config=require(_0x6e34('0x6'));var controller=require(_0x6e34('0x7'));router[_0x6e34('0x8')]('/',auth['isAuthenticated'](),controller[_0x6e34('0x9')]);router[_0x6e34('0x8')](_0x6e34('0xa'),auth[_0x6e34('0xb')](),controller[_0x6e34('0xc')]);router[_0x6e34('0x8')](_0x6e34('0xd'),auth[_0x6e34('0xb')](),controller[_0x6e34('0xe')]);router[_0x6e34('0xf')]('/',auth[_0x6e34('0xb')](),interaction[_0x6e34('0x10')](_0x6e34('0x11'),_0x6e34('0x12')),controller['create']);router[_0x6e34('0xf')](_0x6e34('0x13'),controller[_0x6e34('0x14')]);router[_0x6e34('0x15')](_0x6e34('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6e34('0x15')](_0x6e34('0x16'),auth[_0x6e34('0xb')](),controller[_0x6e34('0x17')]);router[_0x6e34('0x15')]('/:id/reject',auth[_0x6e34('0xb')](),controller[_0x6e34('0x18')]);router['delete'](_0x6e34('0xd'),auth[_0x6e34('0xb')](),controller['destroy']);module[_0x6e34('0x19')]=router;
\ No newline at end of file
+var _0x3ba4=['smsmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','sms'];(function(_0x3c4740,_0x1f83c1){var _0x549846=function(_0x53cbed){while(--_0x53cbed){_0x3c4740['push'](_0x3c4740['shift']());}};_0x549846(++_0x1f83c1);}(_0x3ba4,0xc2));var _0x43ba=function(_0x4d451e,_0x33dd1f){_0x4d451e=_0x4d451e-0x0;var _0x29a2ac=_0x3ba4[_0x4d451e];return _0x29a2ac;};'use strict';var multer=require(_0x43ba('0x0'));var util=require('util');var path=require(_0x43ba('0x1'));var timeout=require(_0x43ba('0x2'));var express=require(_0x43ba('0x3'));var router=express[_0x43ba('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x43ba('0x5'));var config=require(_0x43ba('0x6'));var controller=require(_0x43ba('0x7'));router[_0x43ba('0x8')]('/',auth[_0x43ba('0x9')](),controller[_0x43ba('0xa')]);router[_0x43ba('0x8')](_0x43ba('0xb'),auth[_0x43ba('0x9')](),controller['describe']);router[_0x43ba('0x8')]('/:id',auth[_0x43ba('0x9')](),controller[_0x43ba('0xc')]);router[_0x43ba('0xd')]('/',auth['isAuthenticated'](),interaction[_0x43ba('0xe')](_0x43ba('0xf'),_0x43ba('0x10')),controller[_0x43ba('0x11')]);router[_0x43ba('0xd')](_0x43ba('0x12'),controller[_0x43ba('0x13')]);router[_0x43ba('0x14')](_0x43ba('0x15'),auth[_0x43ba('0x9')](),controller[_0x43ba('0x16')]);router[_0x43ba('0x14')](_0x43ba('0x17'),auth['isAuthenticated'](),controller[_0x43ba('0x18')]);router[_0x43ba('0x14')](_0x43ba('0x19'),auth['isAuthenticated'](),controller[_0x43ba('0x1a')]);router[_0x43ba('0x1b')](_0x43ba('0x15'),auth[_0x43ba('0x9')](),controller[_0x43ba('0x1c')]);module[_0x43ba('0x1d')]=router;
\ No newline at end of file
index f8d8669..b598559 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a80=['medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize','TEXT'];(function(_0x27fc6b,_0x45ea0a){var _0x40d832=function(_0x3fbbb4){while(--_0x3fbbb4){_0x27fc6b['push'](_0x27fc6b['shift']());}};_0x40d832(++_0x45ea0a);}(_0x4a80,0xbe));var _0x04a8=function(_0x5db018,_0x504f94){_0x5db018=_0x5db018-0x0;var _0xe48a05=_0x4a80[_0x5db018];return _0xe48a05;};'use strict';var Sequelize=require(_0x04a8('0x0'));module['exports']={'body':{'type':Sequelize[_0x04a8('0x1')](_0x04a8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x04a8('0x3')]('in',_0x04a8('0x4')),'defaultValue':_0x04a8('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x04a8('0x5')](0xbe)},'phone':{'type':Sequelize[_0x04a8('0x5')]},'readAt':{'type':Sequelize[_0x04a8('0x6')]},'secret':{'type':Sequelize[_0x04a8('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0xae35=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1510c5,_0xde9022){var _0x433a86=function(_0x114896){while(--_0x114896){_0x1510c5['push'](_0x1510c5['shift']());}};_0x433a86(++_0xde9022);}(_0xae35,0x172));var _0x5ae3=function(_0x5889a4,_0x4c68a8){_0x5889a4=_0x5889a4-0x0;var _0x4db8da=_0xae35[_0x5889a4];return _0x4db8da;};'use strict';var Sequelize=require(_0x5ae3('0x0'));module[_0x5ae3('0x1')]={'body':{'type':Sequelize[_0x5ae3('0x2')](_0x5ae3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5ae3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5ae3('0x5')]('in',_0x5ae3('0x6')),'defaultValue':_0x5ae3('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x5ae3('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x5ae3('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 125784d..1fc16ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb88a=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SIP/%s','EventManager','sms-interactions','sms','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','interface','channel','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','type','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','DELIVERED','infobip','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','index','SmsMessage','rawAttributes','model','keys','query','dateEnd','dateStart','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','day','add','merge','filter','map','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','include','find','create','body','destroy','describe','accept','read'];(function(_0x58bd1d,_0x50bb83){var _0x1ce885=function(_0x595a83){while(--_0x595a83){_0x58bd1d['push'](_0x58bd1d['shift']());}};_0x1ce885(++_0x50bb83);}(_0xb88a,0xbb));var _0xab88=function(_0x1a68a,_0x2f6c45){_0x1a68a=_0x1a68a-0x0;var _0x44128f=_0xb88a[_0x1a68a];return _0x44128f;};'use strict';var pdf=require(_0xab88('0x0'));var emlformat=require(_0xab88('0x1'));var rimraf=require(_0xab88('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xab88('0x3'));var moment=require(_0xab88('0x4'));var BPromise=require(_0xab88('0x5'));var Mustache=require(_0xab88('0x6'));var util=require('util');var path=require(_0xab88('0x7'));var sox=require(_0xab88('0x8'));var csv=require(_0xab88('0x9'));var ejs=require(_0xab88('0xa'));var fs=require('fs');var _=require(_0xab88('0xb'));var squel=require(_0xab88('0xc'));var crypto=require(_0xab88('0xd'));var jsforce=require(_0xab88('0xe'));var deskjs=require(_0xab88('0xf'));var toCsv=require(_0xab88('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab88('0x10'));var qs=require(_0xab88('0x11'));var logger=require(_0xab88('0x12'))('api');var utils=require(_0xab88('0x13'));var config=require(_0xab88('0x14'));var db=require(_0xab88('0x15'))['db'];config['redis']=_[_0xab88('0x16')](config[_0xab88('0x17')],{'host':_0xab88('0x18'),'port':0x18eb});var socket=require(_0xab88('0x19'))(new Redis(config[_0xab88('0x17')]));require(_0xab88('0x1a'))[_0xab88('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xab88('0x1c')][_0xab88('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cfc4a,_0x55142a,_0x8ff5b8,_0x2bce74){return new BPromise(function(_0x3cf22a,_0x48e8fd){var _0x323acc=_0x2bce74||client;return _0x323acc[_0xab88('0x1e')](_0x5cfc4a,_0x8ff5b8)[_0xab88('0x1f')](function(_0xb63f1c){logger['info'](_0xab88('0x20'),_0x55142a,_0xab88('0x21'));logger[_0xab88('0x22')](_0xab88('0x23'),_0x55142a,_0xab88('0x21'),JSON[_0xab88('0x24')](_0xb63f1c));if(_0xb63f1c[_0xab88('0x25')]){if(_0xb63f1c[_0xab88('0x25')][_0xab88('0x26')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x55142a,_0xb63f1c[_0xab88('0x25')]['message']);return _0x48e8fd(_0xb63f1c[_0xab88('0x25')][_0xab88('0x27')]);}logger[_0xab88('0x25')]('SmsMessage,\x20%s,\x20%s',_0x55142a,_0xb63f1c['error']['message']);return _0x3cf22a(_0xb63f1c['error'][_0xab88('0x27')]);}else{logger[_0xab88('0x28')](_0xab88('0x20'),_0x55142a,_0xab88('0x21'));_0x3cf22a(_0xb63f1c[_0xab88('0x29')]['message']);}})[_0xab88('0x2a')](function(_0x188719){logger[_0xab88('0x25')]('SmsMessage,\x20%s,\x20%s',_0x55142a,_0x188719);_0x48e8fd(_0x188719);});});}function respondWithStatusCode(_0x36b19d,_0x538eae){_0x538eae=_0x538eae||0xcc;return function(_0x30d4b8){if(_0x30d4b8){return _0x36b19d[_0xab88('0x2b')](_0x538eae);}return _0x36b19d[_0xab88('0x2c')](_0x538eae)[_0xab88('0x2d')]();};}function respondWithResult(_0x24bcee,_0x27fa7c){_0x27fa7c=_0x27fa7c||0xc8;return function(_0x1b623c){if(_0x1b623c){return _0x24bcee[_0xab88('0x2c')](_0x27fa7c)[_0xab88('0x2e')](_0x1b623c);}};}function respondWithFilteredResult(_0x11856d,_0x3883d8){return function(_0x49db68){if(_0x49db68){var _0x236009=_0x49db68[_0xab88('0x2f')],_0x290aeb=_0x3883d8['offset'],_0x52eaf1=_0x3883d8[_0xab88('0x30')]+_0x3883d8[_0xab88('0x31')],_0x30505f;if(_0x52eaf1>=_0x236009){_0x52eaf1=_0x236009;_0x30505f=0xc8;}else{_0x30505f=0xce;}_0x11856d[_0xab88('0x2c')](_0x30505f);return _0x11856d['set'](_0xab88('0x32'),_0x290aeb+'-'+_0x52eaf1+'/'+_0x236009)[_0xab88('0x2e')](_0x49db68);}return null;};}function patchUpdates(_0xccb5c7){return function(_0x3dbbe9){try{jsonpatch[_0xab88('0x33')](_0x3dbbe9,_0xccb5c7,!![]);}catch(_0x4d2061){return BPromise[_0xab88('0x34')](_0x4d2061);}return _0x3dbbe9[_0xab88('0x35')]();};}function saveUpdates(_0x3096c0,_0x594369){return function(_0x829c8e){if(_0x829c8e){return _0x829c8e[_0xab88('0x36')](_0x3096c0)[_0xab88('0x1f')](function(_0x2396b5){return _0x2396b5;});}return null;};}function removeEntity(_0x3fa4d1,_0x14179a){return function(_0x43bdd3){if(_0x43bdd3){return _0x43bdd3['destroy']()[_0xab88('0x1f')](function(){_0x3fa4d1[_0xab88('0x2c')](0xcc)[_0xab88('0x2d')]();});}};}function handleEntityNotFound(_0x578cf0,_0x815390){return function(_0x2b9d05){if(!_0x2b9d05){_0x578cf0[_0xab88('0x2b')](0x194);}return _0x2b9d05;};}function handleError(_0x100d4c,_0x11a9cf){_0x11a9cf=_0x11a9cf||0x1f4;return function(_0x1ada4a){logger[_0xab88('0x25')](_0x1ada4a[_0xab88('0x37')]);if(_0x1ada4a['name']){delete _0x1ada4a[_0xab88('0x38')];}_0x100d4c[_0xab88('0x2c')](_0x11a9cf)[_0xab88('0x39')](_0x1ada4a);};}exports[_0xab88('0x3a')]=function(_0x2cc42b,_0x2fd254){var _0x28ca2e={},_0x45a9cf={},_0x47abca={'count':0x0,'rows':[]};var _0x59a1d6=db[_0xab88('0x3b')][_0xab88('0x3c')];_0x45a9cf[_0xab88('0x3d')]=_[_0xab88('0x3e')](_0x59a1d6);var _0x11f8e7={'dateStart':_0x2cc42b[_0xab88('0x3f')]['dateStart'],'dateEnd':_0x2cc42b[_0xab88('0x3f')][_0xab88('0x40')]};delete _0x2cc42b['query'][_0xab88('0x41')];delete _0x2cc42b['query'][_0xab88('0x40')];_0x45a9cf[_0xab88('0x3f')]=_[_0xab88('0x3e')](_0x2cc42b[_0xab88('0x3f')]);_0x45a9cf[_0xab88('0x42')]=_['intersection'](_0x45a9cf[_0xab88('0x3d')],_0x45a9cf[_0xab88('0x3f')]);_0x28ca2e[_0xab88('0x43')]=_['intersection'](_0x45a9cf['model'],qs[_0xab88('0x44')](_0x2cc42b[_0xab88('0x3f')][_0xab88('0x44')]));_0x28ca2e[_0xab88('0x43')]=_0x28ca2e[_0xab88('0x43')][_0xab88('0x45')]?_0x28ca2e['attributes']:_0x45a9cf[_0xab88('0x3d')];if(!_0x2cc42b[_0xab88('0x3f')][_0xab88('0x46')](_0xab88('0x47'))){_0x28ca2e['limit']=qs['limit'](_0x2cc42b[_0xab88('0x3f')][_0xab88('0x31')]);_0x28ca2e[_0xab88('0x30')]=qs[_0xab88('0x30')](_0x2cc42b[_0xab88('0x3f')][_0xab88('0x30')]);}_0x28ca2e[_0xab88('0x48')]=qs[_0xab88('0x49')](_0x2cc42b[_0xab88('0x3f')][_0xab88('0x49')]);_0x28ca2e[_0xab88('0x4a')]=qs['filters'](_[_0xab88('0x4b')](_0x2cc42b['query'],_0x45a9cf[_0xab88('0x42')]));if(_0x11f8e7[_0xab88('0x41')]){if(_0x11f8e7[_0xab88('0x40')]){_0x11f8e7[_0xab88('0x40')]=moment(_0x11f8e7[_0xab88('0x40')])['add'](0x1,_0xab88('0x4c'));}else{_0x11f8e7[_0xab88('0x40')]=moment(_0x11f8e7[_0xab88('0x41')])[_0xab88('0x4d')](0x1,'day');}_[_0xab88('0x4e')](_0x28ca2e[_0xab88('0x4a')],{'createdAt':{'$gte':_0x11f8e7[_0xab88('0x41')],'$lte':_0x11f8e7['dateEnd']}});}if(_0x2cc42b[_0xab88('0x3f')][_0xab88('0x4f')]){_0x28ca2e['where']=_[_0xab88('0x4e')](_0x28ca2e[_0xab88('0x4a')],{'$or':_[_0xab88('0x50')](_0x59a1d6,function(_0x1911eb){if(_0x1911eb['type']['key']!==_0xab88('0x51')){var _0x39a158={};_0x39a158[_0x1911eb['field']]={'$like':'%'+_0x2cc42b['query'][_0xab88('0x4f')]+'%'};return _0x39a158;}})});}_0x28ca2e=_[_0xab88('0x4e')]({},_0x28ca2e,_0x2cc42b[_0xab88('0x52')]);var _0x41c00b={'where':_0x28ca2e['where']};return db[_0xab88('0x3b')][_0xab88('0x2f')](_0x41c00b)[_0xab88('0x1f')](function(_0x57bfe8){_0x47abca['count']=_0x57bfe8;if(_0x2cc42b[_0xab88('0x3f')][_0xab88('0x53')]){_0x28ca2e['include']=[{'all':!![]}];}return db[_0xab88('0x3b')][_0xab88('0x54')](_0x28ca2e);})[_0xab88('0x1f')](function(_0x502808){_0x47abca[_0xab88('0x55')]=_0x502808;return _0x47abca;})[_0xab88('0x1f')](respondWithFilteredResult(_0x2fd254,_0x28ca2e))[_0xab88('0x2a')](handleError(_0x2fd254,null));};exports[_0xab88('0x56')]=function(_0x345721,_0x16414e){var _0x115a1c={'raw':!![],'where':{'id':_0x345721[_0xab88('0x57')]['id']}},_0x371215={};_0x371215[_0xab88('0x3d')]=_[_0xab88('0x3e')](db[_0xab88('0x3b')][_0xab88('0x3c')]);_0x371215[_0xab88('0x3f')]=_[_0xab88('0x3e')](_0x345721[_0xab88('0x3f')]);_0x371215[_0xab88('0x42')]=_[_0xab88('0x58')](_0x371215[_0xab88('0x3d')],_0x371215[_0xab88('0x3f')]);_0x115a1c[_0xab88('0x43')]=_['intersection'](_0x371215[_0xab88('0x3d')],qs['fields'](_0x345721[_0xab88('0x3f')][_0xab88('0x44')]));_0x115a1c[_0xab88('0x43')]=_0x115a1c[_0xab88('0x43')]['length']?_0x115a1c['attributes']:_0x371215['model'];if(_0x345721['query'][_0xab88('0x53')]){_0x115a1c[_0xab88('0x59')]=[{'all':!![]}];}_0x115a1c=_['merge']({},_0x115a1c,_0x345721[_0xab88('0x52')]);return db[_0xab88('0x3b')][_0xab88('0x5a')](_0x115a1c)['then'](handleEntityNotFound(_0x16414e,null))[_0xab88('0x1f')](respondWithResult(_0x16414e,null))[_0xab88('0x2a')](handleError(_0x16414e,null));};exports[_0xab88('0x5b')]=function(_0x2983a5,_0x4b0efd){return db[_0xab88('0x3b')][_0xab88('0x5b')](_0x2983a5[_0xab88('0x5c')],{})[_0xab88('0x1f')](respondWithResult(_0x4b0efd,0xc9))[_0xab88('0x2a')](handleError(_0x4b0efd,null));};exports[_0xab88('0x36')]=function(_0x5b4735,_0x1f11c5){if(_0x5b4735[_0xab88('0x5c')]['id']){delete _0x5b4735[_0xab88('0x5c')]['id'];}return db[_0xab88('0x3b')][_0xab88('0x5a')]({'where':{'id':_0x5b4735[_0xab88('0x57')]['id']}})[_0xab88('0x1f')](handleEntityNotFound(_0x1f11c5,null))[_0xab88('0x1f')](saveUpdates(_0x5b4735[_0xab88('0x5c')],null))[_0xab88('0x1f')](respondWithResult(_0x1f11c5,null))[_0xab88('0x2a')](handleError(_0x1f11c5,null));};exports[_0xab88('0x5d')]=function(_0x27ba90,_0x2db671){return db[_0xab88('0x3b')][_0xab88('0x5a')]({'where':{'id':_0x27ba90[_0xab88('0x57')]['id']}})[_0xab88('0x1f')](handleEntityNotFound(_0x2db671,null))[_0xab88('0x1f')](removeEntity(_0x2db671,null))[_0xab88('0x2a')](handleError(_0x2db671,null));};exports[_0xab88('0x5e')]=function(_0x45c8fd,_0x3c3bf1){return db[_0xab88('0x3b')][_0xab88('0x5e')]()['then'](respondWithResult(_0x3c3bf1,null))[_0xab88('0x2a')](handleError(_0x3c3bf1,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xab88('0x5f')]=function(_0x375f81,_0x445bc7,_0x233387){var _0x3d63d7={'channel':'sms'};if(_0x375f81['body']['id']){delete _0x375f81[_0xab88('0x5c')]['id'];}_0x375f81[_0xab88('0x5c')][_0xab88('0x60')]=!![];_0x375f81[_0xab88('0x5c')]['readAt']=moment()['format'](_0xab88('0x61'));_0x375f81[_0xab88('0x5c')]['UserId']=_0x375f81[_0xab88('0x5c')][_0xab88('0x62')]||_0x375f81[_0xab88('0x63')]['id'];return db[_0xab88('0x3b')][_0xab88('0x5a')]({'where':{'id':_0x375f81[_0xab88('0x57')]['id'],'UserId':null},'include':[{'model':db[_0xab88('0x64')],'as':_0xab88('0x65')}]})['then'](handleEntityNotFound(_0x445bc7,null))[_0xab88('0x1f')](saveUpdates(_0x375f81[_0xab88('0x5c')],null))[_0xab88('0x1f')](function(_0x355b90){if(_0x355b90){_0x3d63d7[_0xab88('0x27')]=_0x355b90['get']({'plain':!![]});return db[_0xab88('0x66')][_0xab88('0x5a')]({'where':{'id':_0x355b90[_0xab88('0x67')]}});}return null;})[_0xab88('0x1f')](handleEntityNotFound(_0x445bc7,null))[_0xab88('0x1f')](function(_0x576585){if(_0x576585){return _0x576585[_0xab88('0x36')]({'UserId':_0x375f81['body']['UserId'],'read1stAt':_[_0xab88('0x68')](_0x576585[_0xab88('0x69')])?moment()[_0xab88('0x6a')](_0xab88('0x61')):undefined});}return null;})[_0xab88('0x1f')](function(_0x4353cf){if(_0x4353cf){_0x3d63d7['interaction']=_0x4353cf['get']({'plain':!![]});interaction_log[_0xab88('0x28')](_0xab88('0x6b'),_0x375f81[_0xab88('0x63')]['id'],_0x375f81['user']['name'],_0x375f81[_0xab88('0x63')]['role'],_0x3d63d7[_0xab88('0x6c')]['id'],_0x375f81[_0xab88('0x5c')]?JSON[_0xab88('0x24')](_0x375f81['body']):_0xab88('0x6d'));return respondWithRpcPromise(_0xab88('0x6e'),_0xab88('0x6f'),_0x3d63d7);}return null;})[_0xab88('0x1f')](function(_0x296763){if(_0x296763){if(_0x375f81[_0xab88('0x5c')]['manual']){_0x3d63d7['message']['interface']=util['format'](_0xab88('0x70'),_0x375f81[_0xab88('0x63')][_0xab88('0x38')]);_0x3d63d7[_0xab88('0x27')]['channel']=_0x3d63d7['channel'];_0x3d63d7[_0xab88('0x27')]['event']='accept';return respondWithRpcPromise('EventManager',_0xab88('0x71'),{'event':'acceptmessage','message':_0x3d63d7[_0xab88('0x27')]},client9002)[_0xab88('0x1f')](function(){return _0x3d63d7;});}return _0x3d63d7;}return null;})[_0xab88('0x1f')](respondWithResult(_0x445bc7,null))[_0xab88('0x2a')](handleError(_0x445bc7,null));};var interaction_log=require(_0xab88('0x12'))(_0xab88('0x72'));exports[_0xab88('0x34')]=function(_0x2e0820,_0x33d6ea,_0x5971ae){var _0x2ec3ba={'agent':{},'channel':_0xab88('0x73')};if(_0x2e0820[_0xab88('0x5c')]['id']){delete _0x2e0820[_0xab88('0x5c')]['id'];}_0x2e0820[_0xab88('0x5c')][_0xab88('0x62')]=_0x2e0820[_0xab88('0x5c')][_0xab88('0x62')]||_0x2e0820[_0xab88('0x63')]['id'];_0x2ec3ba['agent']['id']=_0x2e0820[_0xab88('0x5c')][_0xab88('0x62')];return db[_0xab88('0x3b')][_0xab88('0x5a')]({'where':{'id':_0x2e0820[_0xab88('0x57')]['id'],'UserId':null}})[_0xab88('0x1f')](handleEntityNotFound(_0x33d6ea,null))['then'](function(_0x2d1b69){if(_0x2d1b69){_0x2ec3ba[_0xab88('0x27')]=_0x2d1b69['get']({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x2d1b69[_0xab88('0x67')]}});}return null;})[_0xab88('0x1f')](handleEntityNotFound(_0x33d6ea,null))[_0xab88('0x1f')](function(_0x295aad){if(_0x295aad){_0x2ec3ba['interaction']=_0x295aad[_0xab88('0x74')]({'plain':!![]});interaction_log[_0xab88('0x28')](_0xab88('0x75'),_0x2e0820[_0xab88('0x63')]['id'],_0x2e0820[_0xab88('0x63')][_0xab88('0x38')],_0x2e0820[_0xab88('0x63')][_0xab88('0x76')],_0x2ec3ba['interaction']['id'],_0x2e0820[_0xab88('0x5c')]?JSON['stringify'](_0x2e0820[_0xab88('0x5c')]):_0xab88('0x6d'));return respondWithRpcPromise(_0xab88('0x77'),_0xab88('0x78'),_0x2ec3ba);}return null;})['then'](function(_0x41b817){if(_0x41b817){_0x41b817['message'][_0xab88('0x79')]=util[_0xab88('0x6a')]('SIP/%s',_0x2e0820['user'][_0xab88('0x38')]);_0x41b817[_0xab88('0x27')][_0xab88('0x7a')]=_0x2ec3ba[_0xab88('0x7a')];_0x41b817[_0xab88('0x27')]['event']='reject';respondWithRpcPromise(_0xab88('0x71'),_0xab88('0x71'),{'event':'rejectmessage','message':_0x41b817[_0xab88('0x27')]},client9002);return _0x2ec3ba;}return null;})['then'](respondWithResult(_0x33d6ea,null))[_0xab88('0x2a')](handleError(_0x33d6ea,null));};exports[_0xab88('0x2c')]=function(_0x3c5f30,_0x4e343b,_0x3dde48){if(_0x3c5f30[_0xab88('0x5c')]['id']){delete _0x3c5f30[_0xab88('0x5c')]['id'];}var _0x43401b;return db['SmsMessage'][_0xab88('0x5a')]({'where':{'id':_0x3c5f30[_0xab88('0x57')]['id']}})['then'](handleEntityNotFound(_0x4e343b,null))[_0xab88('0x1f')](function(_0x5245af){if(_0x5245af){_0x43401b=_0x5245af;return db[_0xab88('0x7b')][_0xab88('0x5a')]({'where':{'id':_0x5245af[_0xab88('0x7c')]}});}})[_0xab88('0x1f')](handleEntityNotFound(_0x4e343b,null))[_0xab88('0x1f')](function(_0x498838){if(_0x498838){logger[_0xab88('0x22')](_0xab88('0x23'),_0xab88('0x2c'),_0xab88('0x7d'),_0x498838[_0xab88('0x7e')],util['inspect'](_0x3c5f30['body'],{'showHidden':![],'depth':null}));switch(_0x498838[_0xab88('0x7e')]){case _0xab88('0x7f'):if(_0x3c5f30[_0xab88('0x5c')][_0xab88('0x80')]&&_0x3c5f30[_0xab88('0x5c')][_0xab88('0x80')]===_0x43401b[_0xab88('0x81')]){return _0x43401b['update']({'read':!![]});}else{logger[_0xab88('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xab88('0x2c'),_0xab88('0x7f'),util[_0xab88('0x82')](_0x3c5f30[_0xab88('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xab88('0x83'):if(_0x3c5f30['body']['MessageUUID']&&_0x3c5f30[_0xab88('0x5c')][_0xab88('0x84')]===_0x43401b[_0xab88('0x81')]&&_[_0xab88('0x85')]([_0xab88('0x86'),_0xab88('0x87')],_0x3c5f30[_0xab88('0x5c')][_0xab88('0x88')])>=0x0){return _0x43401b[_0xab88('0x36')]({'read':!![]});}else{logger[_0xab88('0x25')](_0xab88('0x89'),_0xab88('0x2c'),_0xab88('0x8a'),util['inspect'](_0x3c5f30[_0xab88('0x5c')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x471a10=_0x3c5f30[_0xab88('0x5c')][_0xab88('0x8b')][0x0];if(_0x471a10[_0xab88('0x2c')]['groupName']===_0xab88('0x8c')){return _0x43401b[_0xab88('0x36')]({'read':!![]});}else{logger[_0xab88('0x25')](_0xab88('0x89'),_0xab88('0x2c'),_0xab88('0x8d'),util[_0xab88('0x82')](_0x3c5f30[_0xab88('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x43401b;}})[_0xab88('0x1f')](respondWithResult(_0x4e343b,null))[_0xab88('0x2a')](handleError(_0x4e343b,null));};
\ No newline at end of file
+var _0xaccb=['lodash','crypto','jsforce','desk.js','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','name','send','index','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','nolimit','sort','pick','add','day','where','merge','map','type','key','VIRTUAL','filter','options','SmsMessage','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms','role','RejectMessage','rejectMessage','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs'];(function(_0x237340,_0x39b15d){var _0x5542c8=function(_0xb6a05f){while(--_0xb6a05f){_0x237340['push'](_0x237340['shift']());}};_0x5542c8(++_0x39b15d);}(_0xaccb,0x108));var _0xbacc=function(_0x2ea50a,_0x505086){_0x2ea50a=_0x2ea50a-0x0;var _0x45cd78=_0xaccb[_0x2ea50a];return _0x45cd78;};'use strict';var pdf=require(_0xbacc('0x0'));var emlformat=require(_0xbacc('0x1'));var rimraf=require(_0xbacc('0x2'));var zipdir=require(_0xbacc('0x3'));var jsonpatch=require(_0xbacc('0x4'));var rp=require(_0xbacc('0x5'));var moment=require('moment');var BPromise=require(_0xbacc('0x6'));var Mustache=require(_0xbacc('0x7'));var util=require(_0xbacc('0x8'));var path=require(_0xbacc('0x9'));var sox=require(_0xbacc('0xa'));var csv=require('to-csv');var ejs=require(_0xbacc('0xb'));var fs=require('fs');var _=require(_0xbacc('0xc'));var squel=require('squel');var crypto=require(_0xbacc('0xd'));var jsforce=require(_0xbacc('0xe'));var deskjs=require(_0xbacc('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbacc('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0xbacc('0x11'))(_0xbacc('0x12'));var utils=require('../../config/utils');var config=require(_0xbacc('0x13'));var db=require(_0xbacc('0x14'))['db'];config[_0xbacc('0x15')]=_['defaults'](config[_0xbacc('0x15')],{'host':_0xbacc('0x16'),'port':0x18eb});var socket=require(_0xbacc('0x17'))(new Redis(config[_0xbacc('0x15')]));require(_0xbacc('0x18'))[_0xbacc('0x19')](socket);var jayson=require(_0xbacc('0x1a'));var client=jayson[_0xbacc('0x1b')][_0xbacc('0x1c')]({'port':0x232c});var client9002=jayson[_0xbacc('0x1b')][_0xbacc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2a4387,_0x265db5,_0xf3d5c,_0x170631){return new BPromise(function(_0x52fcfe,_0x562366){var _0x3ca60d=_0x170631||client;return _0x3ca60d[_0xbacc('0x1d')](_0x2a4387,_0xf3d5c)[_0xbacc('0x1e')](function(_0x50a62b){logger[_0xbacc('0x1f')](_0xbacc('0x20'),_0x265db5,'request\x20sent');logger[_0xbacc('0x21')](_0xbacc('0x22'),_0x265db5,_0xbacc('0x23'),JSON[_0xbacc('0x24')](_0x50a62b));if(_0x50a62b[_0xbacc('0x25')]){if(_0x50a62b[_0xbacc('0x25')]['code']===0x1f4){logger[_0xbacc('0x25')](_0xbacc('0x20'),_0x265db5,_0x50a62b['error']['message']);return _0x562366(_0x50a62b[_0xbacc('0x25')][_0xbacc('0x26')]);}logger[_0xbacc('0x25')](_0xbacc('0x20'),_0x265db5,_0x50a62b[_0xbacc('0x25')][_0xbacc('0x26')]);return _0x52fcfe(_0x50a62b['error'][_0xbacc('0x26')]);}else{logger[_0xbacc('0x1f')](_0xbacc('0x20'),_0x265db5,_0xbacc('0x23'));_0x52fcfe(_0x50a62b[_0xbacc('0x27')]['message']);}})['catch'](function(_0x108103){logger['error'](_0xbacc('0x20'),_0x265db5,_0x108103);_0x562366(_0x108103);});});}function respondWithStatusCode(_0x35dbcb,_0x1338eb){_0x1338eb=_0x1338eb||0xcc;return function(_0x2ee0c3){if(_0x2ee0c3){return _0x35dbcb['sendStatus'](_0x1338eb);}return _0x35dbcb[_0xbacc('0x28')](_0x1338eb)[_0xbacc('0x29')]();};}function respondWithResult(_0x5501b2,_0x47e4ff){_0x47e4ff=_0x47e4ff||0xc8;return function(_0x52e151){if(_0x52e151){return _0x5501b2['status'](_0x47e4ff)[_0xbacc('0x2a')](_0x52e151);}};}function respondWithFilteredResult(_0x4ef958,_0x343657){return function(_0xfe2f95){if(_0xfe2f95){var _0x5e342b=_0xfe2f95[_0xbacc('0x2b')],_0x380337=_0x343657[_0xbacc('0x2c')],_0x2e6ac3=_0x343657['offset']+_0x343657[_0xbacc('0x2d')],_0x397a02;if(_0x2e6ac3>=_0x5e342b){_0x2e6ac3=_0x5e342b;_0x397a02=0xc8;}else{_0x397a02=0xce;}_0x4ef958[_0xbacc('0x28')](_0x397a02);return _0x4ef958[_0xbacc('0x2e')](_0xbacc('0x2f'),_0x380337+'-'+_0x2e6ac3+'/'+_0x5e342b)[_0xbacc('0x2a')](_0xfe2f95);}return null;};}function patchUpdates(_0x3788ee){return function(_0x1f7cd1){try{jsonpatch['apply'](_0x1f7cd1,_0x3788ee,!![]);}catch(_0x1c4121){return BPromise[_0xbacc('0x30')](_0x1c4121);}return _0x1f7cd1[_0xbacc('0x31')]();};}function saveUpdates(_0x242c1a,_0x40ea94){return function(_0x5c986b){if(_0x5c986b){return _0x5c986b[_0xbacc('0x32')](_0x242c1a)['then'](function(_0x3584a9){return _0x3584a9;});}return null;};}function removeEntity(_0x1bb0d6,_0x4736e1){return function(_0x59cab7){if(_0x59cab7){return _0x59cab7[_0xbacc('0x33')]()['then'](function(){_0x1bb0d6[_0xbacc('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c56e,_0x324421){return function(_0x2acedb){if(!_0x2acedb){_0x20c56e[_0xbacc('0x34')](0x194);}return _0x2acedb;};}function handleError(_0x5afd9c,_0x37f652){_0x37f652=_0x37f652||0x1f4;return function(_0x556871){logger[_0xbacc('0x25')](_0x556871['stack']);if(_0x556871[_0xbacc('0x35')]){delete _0x556871[_0xbacc('0x35')];}_0x5afd9c['status'](_0x37f652)[_0xbacc('0x36')](_0x556871);};}exports[_0xbacc('0x37')]=function(_0x5ccce2,_0x4dc9a5){var _0x3cbb05={},_0x6bd821={},_0x1a7a18={'count':0x0,'rows':[]};var _0x45e50b=db['SmsMessage'][_0xbacc('0x38')];_0x6bd821[_0xbacc('0x39')]=_[_0xbacc('0x3a')](_0x45e50b);var _0x295a4a={'dateStart':_0x5ccce2['query'][_0xbacc('0x3b')],'dateEnd':_0x5ccce2[_0xbacc('0x3c')][_0xbacc('0x3d')]};delete _0x5ccce2[_0xbacc('0x3c')][_0xbacc('0x3b')];delete _0x5ccce2['query'][_0xbacc('0x3d')];_0x6bd821[_0xbacc('0x3c')]=_[_0xbacc('0x3a')](_0x5ccce2[_0xbacc('0x3c')]);_0x6bd821[_0xbacc('0x3e')]=_[_0xbacc('0x3f')](_0x6bd821['model'],_0x6bd821[_0xbacc('0x3c')]);_0x3cbb05[_0xbacc('0x40')]=_[_0xbacc('0x3f')](_0x6bd821[_0xbacc('0x39')],qs[_0xbacc('0x41')](_0x5ccce2[_0xbacc('0x3c')][_0xbacc('0x41')]));_0x3cbb05[_0xbacc('0x40')]=_0x3cbb05[_0xbacc('0x40')][_0xbacc('0x42')]?_0x3cbb05[_0xbacc('0x40')]:_0x6bd821[_0xbacc('0x39')];if(!_0x5ccce2[_0xbacc('0x3c')]['hasOwnProperty'](_0xbacc('0x43'))){_0x3cbb05[_0xbacc('0x2d')]=qs[_0xbacc('0x2d')](_0x5ccce2['query']['limit']);_0x3cbb05['offset']=qs['offset'](_0x5ccce2[_0xbacc('0x3c')]['offset']);}_0x3cbb05['order']=qs[_0xbacc('0x44')](_0x5ccce2[_0xbacc('0x3c')][_0xbacc('0x44')]);_0x3cbb05['where']=qs[_0xbacc('0x3e')](_[_0xbacc('0x45')](_0x5ccce2[_0xbacc('0x3c')],_0x6bd821['filters']));if(_0x295a4a[_0xbacc('0x3b')]){if(_0x295a4a['dateEnd']){_0x295a4a[_0xbacc('0x3d')]=moment(_0x295a4a[_0xbacc('0x3d')])[_0xbacc('0x46')](0x1,_0xbacc('0x47'));}else{_0x295a4a[_0xbacc('0x3d')]=moment(_0x295a4a[_0xbacc('0x3b')])[_0xbacc('0x46')](0x1,'day');}_['merge'](_0x3cbb05['where'],{'createdAt':{'$gte':_0x295a4a['dateStart'],'$lte':_0x295a4a[_0xbacc('0x3d')]}});}if(_0x5ccce2['query']['filter']){_0x3cbb05[_0xbacc('0x48')]=_[_0xbacc('0x49')](_0x3cbb05[_0xbacc('0x48')],{'$or':_[_0xbacc('0x4a')](_0x45e50b,function(_0x4c7a33){if(_0x4c7a33[_0xbacc('0x4b')][_0xbacc('0x4c')]!==_0xbacc('0x4d')){var _0x13f0b2={};_0x13f0b2[_0x4c7a33['field']]={'$like':'%'+_0x5ccce2['query'][_0xbacc('0x4e')]+'%'};return _0x13f0b2;}})});}_0x3cbb05=_[_0xbacc('0x49')]({},_0x3cbb05,_0x5ccce2[_0xbacc('0x4f')]);var _0xa6cfa0={'where':_0x3cbb05['where']};return db[_0xbacc('0x50')][_0xbacc('0x2b')](_0xa6cfa0)[_0xbacc('0x1e')](function(_0x289a67){_0x1a7a18[_0xbacc('0x2b')]=_0x289a67;if(_0x5ccce2[_0xbacc('0x3c')][_0xbacc('0x51')]){_0x3cbb05[_0xbacc('0x52')]=[{'all':!![]}];}return db[_0xbacc('0x50')][_0xbacc('0x53')](_0x3cbb05);})['then'](function(_0x4fe94a){_0x1a7a18[_0xbacc('0x54')]=_0x4fe94a;return _0x1a7a18;})[_0xbacc('0x1e')](respondWithFilteredResult(_0x4dc9a5,_0x3cbb05))[_0xbacc('0x55')](handleError(_0x4dc9a5,null));};exports[_0xbacc('0x56')]=function(_0x5619a6,_0xf3b27a){var _0x25f95c={'raw':!![],'where':{'id':_0x5619a6[_0xbacc('0x57')]['id']}},_0x206387={};_0x206387[_0xbacc('0x39')]=_[_0xbacc('0x3a')](db[_0xbacc('0x50')][_0xbacc('0x38')]);_0x206387[_0xbacc('0x3c')]=_['keys'](_0x5619a6['query']);_0x206387[_0xbacc('0x3e')]=_['intersection'](_0x206387[_0xbacc('0x39')],_0x206387[_0xbacc('0x3c')]);_0x25f95c['attributes']=_['intersection'](_0x206387[_0xbacc('0x39')],qs['fields'](_0x5619a6['query'][_0xbacc('0x41')]));_0x25f95c[_0xbacc('0x40')]=_0x25f95c[_0xbacc('0x40')][_0xbacc('0x42')]?_0x25f95c[_0xbacc('0x40')]:_0x206387['model'];if(_0x5619a6[_0xbacc('0x3c')][_0xbacc('0x51')]){_0x25f95c[_0xbacc('0x52')]=[{'all':!![]}];}_0x25f95c=_['merge']({},_0x25f95c,_0x5619a6[_0xbacc('0x4f')]);return db[_0xbacc('0x50')][_0xbacc('0x58')](_0x25f95c)[_0xbacc('0x1e')](handleEntityNotFound(_0xf3b27a,null))['then'](respondWithResult(_0xf3b27a,null))[_0xbacc('0x55')](handleError(_0xf3b27a,null));};exports[_0xbacc('0x59')]=function(_0x421bb4,_0x47fb14){return db[_0xbacc('0x50')]['create'](_0x421bb4[_0xbacc('0x5a')],{})['then'](respondWithResult(_0x47fb14,0xc9))['catch'](handleError(_0x47fb14,null));};exports[_0xbacc('0x32')]=function(_0x2e26c7,_0x5a7c58){if(_0x2e26c7['body']['id']){delete _0x2e26c7[_0xbacc('0x5a')]['id'];}return db[_0xbacc('0x50')][_0xbacc('0x58')]({'where':{'id':_0x2e26c7[_0xbacc('0x57')]['id']}})[_0xbacc('0x1e')](handleEntityNotFound(_0x5a7c58,null))[_0xbacc('0x1e')](saveUpdates(_0x2e26c7[_0xbacc('0x5a')],null))['then'](respondWithResult(_0x5a7c58,null))[_0xbacc('0x55')](handleError(_0x5a7c58,null));};exports[_0xbacc('0x33')]=function(_0xaae05f,_0x216168){return db[_0xbacc('0x50')]['find']({'where':{'id':_0xaae05f[_0xbacc('0x57')]['id']}})[_0xbacc('0x1e')](handleEntityNotFound(_0x216168,null))[_0xbacc('0x1e')](removeEntity(_0x216168,null))['catch'](handleError(_0x216168,null));};exports['describe']=function(_0x49e271,_0x3f7f23){return db[_0xbacc('0x50')][_0xbacc('0x5b')]()[_0xbacc('0x1e')](respondWithResult(_0x3f7f23,null))[_0xbacc('0x55')](handleError(_0x3f7f23,null));};var interaction_log=require('../../config/logger')(_0xbacc('0x5c'));exports[_0xbacc('0x5d')]=function(_0x2fc454,_0x2b57f2,_0x40021a){var _0x4e8be2={'channel':'sms'};if(_0x2fc454['body']['id']){delete _0x2fc454[_0xbacc('0x5a')]['id'];}_0x2fc454[_0xbacc('0x5a')][_0xbacc('0x5e')]=!![];_0x2fc454[_0xbacc('0x5a')]['readAt']=moment()[_0xbacc('0x5f')](_0xbacc('0x60'));_0x2fc454[_0xbacc('0x5a')][_0xbacc('0x61')]=_0x2fc454['body'][_0xbacc('0x61')]||_0x2fc454[_0xbacc('0x62')]['id'];return db['SmsMessage'][_0xbacc('0x58')]({'where':{'id':_0x2fc454[_0xbacc('0x57')]['id'],'UserId':null},'include':[{'model':db[_0xbacc('0x63')],'as':_0xbacc('0x64')}]})[_0xbacc('0x1e')](handleEntityNotFound(_0x2b57f2,null))['then'](saveUpdates(_0x2fc454[_0xbacc('0x5a')],null))['then'](function(_0x52f372){if(_0x52f372){_0x4e8be2[_0xbacc('0x26')]=_0x52f372[_0xbacc('0x65')]({'plain':!![]});return db[_0xbacc('0x66')]['find']({'where':{'id':_0x52f372[_0xbacc('0x67')]}});}return null;})[_0xbacc('0x1e')](handleEntityNotFound(_0x2b57f2,null))[_0xbacc('0x1e')](function(_0x30b01a){if(_0x30b01a){return _0x30b01a[_0xbacc('0x32')]({'UserId':_0x2fc454['body']['UserId'],'read1stAt':_['isNil'](_0x30b01a[_0xbacc('0x68')])?moment()[_0xbacc('0x5f')](_0xbacc('0x60')):undefined});}return null;})[_0xbacc('0x1e')](function(_0x4a55a6){if(_0x4a55a6){_0x4e8be2[_0xbacc('0x69')]=_0x4a55a6[_0xbacc('0x65')]({'plain':!![]});interaction_log[_0xbacc('0x1f')](_0xbacc('0x6a'),_0x2fc454[_0xbacc('0x62')]['id'],_0x2fc454[_0xbacc('0x62')]['name'],_0x2fc454['user']['role'],_0x4e8be2[_0xbacc('0x69')]['id'],_0x2fc454[_0xbacc('0x5a')]?JSON['stringify'](_0x2fc454[_0xbacc('0x5a')]):_0xbacc('0x6b'));return respondWithRpcPromise(_0xbacc('0x6c'),'acceptMessage',_0x4e8be2);}return null;})[_0xbacc('0x1e')](function(_0x9ab1e1){if(_0x9ab1e1){if(_0x2fc454[_0xbacc('0x5a')][_0xbacc('0x6d')]){_0x4e8be2['message'][_0xbacc('0x6e')]=util[_0xbacc('0x5f')](_0xbacc('0x6f'),_0x2fc454['user'][_0xbacc('0x35')]);_0x4e8be2[_0xbacc('0x26')][_0xbacc('0x70')]=_0x4e8be2[_0xbacc('0x70')];_0x4e8be2['message'][_0xbacc('0x71')]=_0xbacc('0x5d');return respondWithRpcPromise(_0xbacc('0x72'),_0xbacc('0x72'),{'event':_0xbacc('0x73'),'message':_0x4e8be2['message']},client9002)[_0xbacc('0x1e')](function(){return _0x4e8be2;});}return _0x4e8be2;}return null;})[_0xbacc('0x1e')](respondWithResult(_0x2b57f2,null))[_0xbacc('0x55')](handleError(_0x2b57f2,null));};var interaction_log=require(_0xbacc('0x11'))(_0xbacc('0x5c'));exports['reject']=function(_0xf44e92,_0x1142ab,_0x1f871a){var _0x58db50={'agent':{},'channel':_0xbacc('0x74')};if(_0xf44e92[_0xbacc('0x5a')]['id']){delete _0xf44e92[_0xbacc('0x5a')]['id'];}_0xf44e92[_0xbacc('0x5a')][_0xbacc('0x61')]=_0xf44e92['body'][_0xbacc('0x61')]||_0xf44e92[_0xbacc('0x62')]['id'];_0x58db50['agent']['id']=_0xf44e92[_0xbacc('0x5a')]['UserId'];return db[_0xbacc('0x50')][_0xbacc('0x58')]({'where':{'id':_0xf44e92['params']['id'],'UserId':null}})[_0xbacc('0x1e')](handleEntityNotFound(_0x1142ab,null))[_0xbacc('0x1e')](function(_0x3cc8e5){if(_0x3cc8e5){_0x58db50['message']=_0x3cc8e5[_0xbacc('0x65')]({'plain':!![]});return db[_0xbacc('0x66')]['find']({'where':{'id':_0x3cc8e5[_0xbacc('0x67')]}});}return null;})[_0xbacc('0x1e')](handleEntityNotFound(_0x1142ab,null))[_0xbacc('0x1e')](function(_0x342566){if(_0x342566){_0x58db50[_0xbacc('0x69')]=_0x342566['get']({'plain':!![]});interaction_log[_0xbacc('0x1f')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf44e92['user']['id'],_0xf44e92[_0xbacc('0x62')]['name'],_0xf44e92[_0xbacc('0x62')][_0xbacc('0x75')],_0x58db50['interaction']['id'],_0xf44e92[_0xbacc('0x5a')]?JSON[_0xbacc('0x24')](_0xf44e92[_0xbacc('0x5a')]):'null');return respondWithRpcPromise(_0xbacc('0x76'),_0xbacc('0x77'),_0x58db50);}return null;})[_0xbacc('0x1e')](function(_0xc8249a){if(_0xc8249a){_0xc8249a[_0xbacc('0x26')]['interface']=util['format']('SIP/%s',_0xf44e92['user'][_0xbacc('0x35')]);_0xc8249a[_0xbacc('0x26')][_0xbacc('0x70')]=_0x58db50[_0xbacc('0x70')];_0xc8249a[_0xbacc('0x26')][_0xbacc('0x71')]=_0xbacc('0x30');respondWithRpcPromise(_0xbacc('0x72'),_0xbacc('0x72'),{'event':_0xbacc('0x78'),'message':_0xc8249a[_0xbacc('0x26')]},client9002);return _0x58db50;}return null;})[_0xbacc('0x1e')](respondWithResult(_0x1142ab,null))[_0xbacc('0x55')](handleError(_0x1142ab,null));};exports[_0xbacc('0x28')]=function(_0x1d6099,_0x1ca222,_0x3ac77f){if(_0x1d6099[_0xbacc('0x5a')]['id']){delete _0x1d6099[_0xbacc('0x5a')]['id'];}var _0x1a3653;return db[_0xbacc('0x50')][_0xbacc('0x58')]({'where':{'id':_0x1d6099[_0xbacc('0x57')]['id']}})[_0xbacc('0x1e')](handleEntityNotFound(_0x1ca222,null))[_0xbacc('0x1e')](function(_0xe53958){if(_0xe53958){_0x1a3653=_0xe53958;return db['SmsAccount'][_0xbacc('0x58')]({'where':{'id':_0xe53958[_0xbacc('0x79')]}});}})[_0xbacc('0x1e')](handleEntityNotFound(_0x1ca222,null))[_0xbacc('0x1e')](function(_0x4668bc){if(_0x4668bc){logger[_0xbacc('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbacc('0x28'),_0xbacc('0x7a'),_0x4668bc[_0xbacc('0x4b')],util[_0xbacc('0x7b')](_0x1d6099[_0xbacc('0x5a')],{'showHidden':![],'depth':null}));switch(_0x4668bc[_0xbacc('0x4b')]){case _0xbacc('0x7c'):if(_0x1d6099[_0xbacc('0x5a')]['MessageSid']&&_0x1d6099[_0xbacc('0x5a')][_0xbacc('0x7d')]===_0x1a3653[_0xbacc('0x7e')]){return _0x1a3653[_0xbacc('0x32')]({'read':!![]});}else{logger[_0xbacc('0x25')](_0xbacc('0x7f'),_0xbacc('0x28'),'twilio',util[_0xbacc('0x7b')](_0x1d6099[_0xbacc('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xbacc('0x80'):if(_0x1d6099[_0xbacc('0x5a')][_0xbacc('0x81')]&&_0x1d6099[_0xbacc('0x5a')][_0xbacc('0x81')]===_0x1a3653[_0xbacc('0x7e')]&&_[_0xbacc('0x82')]([_0xbacc('0x83'),_0xbacc('0x84')],_0x1d6099[_0xbacc('0x5a')][_0xbacc('0x85')])>=0x0){return _0x1a3653[_0xbacc('0x32')]({'read':!![]});}else{logger[_0xbacc('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbacc('0x28'),_0xbacc('0x86'),util['inspect'](_0x1d6099[_0xbacc('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x15aa74=_0x1d6099[_0xbacc('0x5a')][_0xbacc('0x87')][0x0];if(_0x15aa74[_0xbacc('0x28')][_0xbacc('0x88')]===_0xbacc('0x89')){return _0x1a3653[_0xbacc('0x32')]({'read':!![]});}else{logger[_0xbacc('0x25')](_0xbacc('0x7f'),'status','infobip',util[_0xbacc('0x7b')](_0x1d6099[_0xbacc('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x1a3653;}})[_0xbacc('0x1e')](respondWithResult(_0x1ca222,null))[_0xbacc('0x55')](handleError(_0x1ca222,null));};
\ No newline at end of file
index 8cad0d5..dca185e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8813=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8813,0x91));var _0x3881=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8813[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3881('0x0'));var SmsMessage=require(_0x3881('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3881('0x2')](0x0);var events={'afterCreate':_0x3881('0x3'),'afterUpdate':_0x3881('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ce9f7){return function(_0x4153f2,_0x3f7f19,_0x1a0e36){SmsMessageEvents[_0x3881('0x5')](_0x4ce9f7+':'+_0x4153f2['id'],_0x4153f2);SmsMessageEvents[_0x3881('0x5')](_0x4ce9f7,_0x4153f2);_0x1a0e36(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x3881('0x6')](e,emitEvent(event));}}module[_0x3881('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0x8746=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8746,0x1f0));var _0x6874=function(_0x3ba527,_0x446a5e){_0x3ba527=_0x3ba527-0x0;var _0x5ee6ad=_0x8746[_0x3ba527];return _0x5ee6ad;};'use strict';var EventEmitter=require(_0x6874('0x0'));var SmsMessage=require(_0x6874('0x1'))['db'][_0x6874('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6874('0x3')](0x0);var events={'afterCreate':_0x6874('0x4'),'afterUpdate':_0x6874('0x5'),'afterDestroy':_0x6874('0x6')};function emitEvent(_0x2ca0bc){return function(_0x5134d1,_0x5d006c,_0x551a1a){SmsMessageEvents[_0x6874('0x7')](_0x2ca0bc+':'+_0x5134d1['id'],_0x5134d1);SmsMessageEvents[_0x6874('0x7')](_0x2ca0bc,_0x5134d1);_0x551a1a(null);};}for(var e in events){if(events[_0x6874('0x8')](e)){var event=events[e];SmsMessage[_0x6874('0x9')](e,emitEvent(event));}}module[_0x6874('0xa')]=SmsMessageEvents;
\ No newline at end of file
index 0525d6a..3494469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd1d=['sms_messages','messageId','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','createdAt','body','catch','error','SmsAccount','find','type','twilio','accountSid','authToken','messages','phone','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','POST','user_key','session_key','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','head','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','createHash','md5','digest','hex','https://sms.csc.lv/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiKey','uuid','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','exports','define','SmsMessage'];(function(_0x21205e,_0x7eb8e7){var _0x136ebb=function(_0x54aac2){while(--_0x54aac2){_0x21205e['push'](_0x21205e['shift']());}};_0x136ebb(++_0x7eb8e7);}(_0xcd1d,0x140));var _0xdcd1=function(_0x52fa65,_0x4458b2){_0x52fa65=_0x52fa65-0x0;var _0x46dab4=_0xcd1d[_0x52fa65];return _0x46dab4;};'use strict';var _=require(_0xdcd1('0x0'));var util=require(_0xdcd1('0x1'));var logger=require(_0xdcd1('0x2'))(_0xdcd1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require('./smsMessage.attributes');module[_0xdcd1('0x4')]=function(_0x310f44,_0x1da756){return _0x310f44[_0xdcd1('0x5')](_0xdcd1('0x6'),attributes,{'tableName':_0xdcd1('0x7'),'paranoid':![],'indexes':[{'name':_0xdcd1('0x8'),'fields':[_0xdcd1('0x8')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x457a70,_0x3d22f8,_0x2e8b8f){var _0x8be7fc=_0x310f44['models'];var _0x96c0bc=_0x457a70[_0xdcd1('0x9')]({'plain':!![]});if(_0x96c0bc[_0xdcd1('0xa')][_0xdcd1('0xb')]()==='in'||_0x96c0bc[_0xdcd1('0xa')]['toLowerCase']()==='out'&&!_0x96c0bc[_0xdcd1('0xc')]&&!_[_0xdcd1('0xd')](_0x96c0bc[_0xdcd1('0xe')])){_0x8be7fc[_0xdcd1('0xf')]['findOne']({'where':{'id':_0x96c0bc[_0xdcd1('0x10')]}})[_0xdcd1('0x11')](function(_0xfc4596){if(_0xfc4596){_0xfc4596['update']({'lastMsgAt':_0x96c0bc[_0xdcd1('0x12')],'lastMsgDirection':_0x96c0bc[_0xdcd1('0xa')][_0xdcd1('0xb')](),'lastMsgBody':_0x96c0bc[_0xdcd1('0x13')]});}})[_0xdcd1('0x14')](function(_0x2b28ce){console[_0xdcd1('0x15')](_0x2b28ce);});}if(_0x96c0bc['direction']==='out'&&!_0x96c0bc[_0xdcd1('0xc')]){var _0x521149;_0x8be7fc[_0xdcd1('0x16')][_0xdcd1('0x17')]({'where':{'id':_0x96c0bc['SmsAccountId']},'raw':!![]})[_0xdcd1('0x11')](function(_0x2d1f67){_0x521149=_0x2d1f67;if(_0x521149&&_0x521149[_0xdcd1('0x18')]){switch(_0x521149['type']){case _0xdcd1('0x19'):var _0x1e9bac=require(_0xdcd1('0x19'));if(_0x521149[_0xdcd1('0x1a')]&&_0x521149[_0xdcd1('0x1b')]&&_0x521149['phone']){var _0x268e91=new _0x1e9bac(_0x521149[_0xdcd1('0x1a')],_0x521149['authToken']);_0x268e91[_0xdcd1('0x1c')]['create']({'body':_0x96c0bc[_0xdcd1('0x13')],'to':_0x96c0bc[_0xdcd1('0x1d')],'from':_0x521149['phone'],'statusCallback':_0x521149[_0xdcd1('0x1e')]+_0xdcd1('0x1f')+_0x96c0bc['id']+_0xdcd1('0x20')+_0x521149[_0xdcd1('0x21')]})[_0xdcd1('0x11')](function(_0x2969c5){if(_0x2969c5[_0xdcd1('0x22')]){return _0x457a70[_0xdcd1('0x23')]({'messageId':_0x2969c5[_0xdcd1('0x22')]});}})[_0xdcd1('0x14')](function(_0x4c910b){logger['error'](_0xdcd1('0x24'),_0xdcd1('0x25'),'twilio',util[_0xdcd1('0x26')](_0x4c910b,{'showHidden':![],'depth':null}));});}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x19'),_0xdcd1('0x27'));}break;case _0xdcd1('0x28'):var _0x129daf=_0xdcd1('0x29');if(_0x521149[_0xdcd1('0x2a')]&&_0x521149[_0xdcd1('0x2b')]){var _0xc40786={'recipient':[_0x96c0bc[_0xdcd1('0x1d')]],'message':_0x96c0bc[_0xdcd1('0x13')],'message_type':_0x521149[_0xdcd1('0x2c')]};var _0x2e5e92={'url':_0x129daf+_0xdcd1('0x2d')+_0x521149['username']+'&password='+_0x521149[_0xdcd1('0x2b')],'method':_0xdcd1('0x2e')};rp(_0x2e5e92)['then'](function(_0x1e377c){var _0x5d15c4=_0x1e377c['split'](';');var _0x40e900={'user_key':_0x5d15c4[0x0],'session_key':_0x5d15c4[0x1]};_0x2e5e92={'url':_0x129daf+'sms','method':_0xdcd1('0x2f'),'headers':{'user_key':_0x40e900[_0xdcd1('0x30')],'Session_key':_0x40e900[_0xdcd1('0x31')]},'json':!![],'body':_0xc40786};return rp(_0x2e5e92);})[_0xdcd1('0x11')](function(_0x280cd4){if(_0x280cd4['total_sent']>=0x1){var _0x47eb49={'messageId':_0x280cd4['internal_order_id']};if(_0x521149['smsMethod']!=='GP'||!_0x521149['deliveryReport']){_0x47eb49[_0xdcd1('0x32')]=!![];}return _0x457a70[_0xdcd1('0x23')](_0x47eb49);}else{return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x28'),util[_0xdcd1('0x26')](_0x280cd4,{'showHidden':![],'depth':null}));}})[_0xdcd1('0x14')](function(_0x1bff66){return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),'afterCreate',_0xdcd1('0x28'),util[_0xdcd1('0x26')](_0x1bff66,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdcd1('0x25'),_0xdcd1('0x28'),_0xdcd1('0x33'));}break;case _0xdcd1('0x34'):if(_0x521149['authToken']){var _0x169039={'recipient':_0x96c0bc[_0xdcd1('0x1d')],'message':_0x96c0bc[_0xdcd1('0x13')],'sender':_0x521149[_0xdcd1('0x35')]||_0x521149['phone'],'authorization':_0x521149[_0xdcd1('0x1b')]};var _0x3d22f8={'method':_0xdcd1('0x2f'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x169039,'json':!![]};rp(_0x3d22f8)[_0xdcd1('0x11')](function(_0x50247a){var _0x288f2d={'messageId':_0x50247a[_0xdcd1('0x36')]};if(!_0x521149[_0xdcd1('0x37')]){_0x288f2d[_0xdcd1('0x32')]=!![];}return _0x457a70[_0xdcd1('0x23')](_0x288f2d);})[_0xdcd1('0x14')](function(_0x18697b){logger['error'](_0xdcd1('0x24'),'afterCreate','connectel',util[_0xdcd1('0x26')](_0x18697b,{'showHidden':![],'depth':null}));});}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),'connectel',_0xdcd1('0x38'));}break;case _0xdcd1('0x39'):if(_0x521149[_0xdcd1('0x2a')]&&_0x521149[_0xdcd1('0x2b')]){var _0x169039={'messages':[{'source':_0xdcd1('0x3a'),'to':_0x96c0bc[_0xdcd1('0x1d')],'body':_0x96c0bc[_0xdcd1('0x13')],'from':_0x521149[_0xdcd1('0x35')]||_0x521149['phone']}]};var _0x654892=util[_0xdcd1('0x3b')](_0xdcd1('0x3c'),_0x521149[_0xdcd1('0x2a')],_0x521149[_0xdcd1('0x2b')]);var _0x3d22f8={'method':_0xdcd1('0x2f'),'uri':_0xdcd1('0x3d'),'body':_0x169039,'headers':{'Authorization':util[_0xdcd1('0x3b')]('Basic\x20%s',new Buffer(_0x654892)[_0xdcd1('0x3e')]('base64'))},'json':!![]};rp(_0x3d22f8)[_0xdcd1('0x11')](function(_0x3a9d04){if(_0x3a9d04[_0xdcd1('0x3f')]>=0xc8&&_0x3a9d04[_0xdcd1('0x3f')]<=0xce){if(_0x3a9d04[_0xdcd1('0x40')]&&_0x3a9d04[_0xdcd1('0x40')]['queued_count']>0x0){var _0x351dc2=_[_0xdcd1('0x41')](_0x3a9d04[_0xdcd1('0x40')][_0xdcd1('0x1c')]);var _0x1ef8b1={'messageId':_0x351dc2[_0xdcd1('0x42')]};if(!_0x521149[_0xdcd1('0x37')]){_0x1ef8b1[_0xdcd1('0x32')]=!![];}return _0x457a70[_0xdcd1('0x23')](_0x1ef8b1);}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),'afterCreate','clickSend',util['inspect'](_0x3a9d04,{'showHidden':![],'depth':null}));}}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x43'),util[_0xdcd1('0x26')](_0x3a9d04,{'showHidden':![],'depth':null}));}})[_0xdcd1('0x14')](function(_0x4f6218){logger[_0xdcd1('0x15')](_0xdcd1('0x24'),'afterCreate','clickSend',util[_0xdcd1('0x26')](_0x4f6218,{'showHidden':![],'depth':null}));});}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xdcd1('0x44'):if(_0x521149[_0xdcd1('0x45')]&&_0x521149[_0xdcd1('0x1b')]){var _0x169039={'dst':_0x96c0bc[_0xdcd1('0x1d')],'text':_0x96c0bc[_0xdcd1('0x13')],'src':_0x521149['senderString']||_0x521149[_0xdcd1('0x1d')],'url':_0x521149[_0xdcd1('0x1e')]+_0xdcd1('0x1f')+_0x96c0bc['id']+_0xdcd1('0x20')+_0x521149[_0xdcd1('0x21')]};var _0x654892=util[_0xdcd1('0x3b')]('%s:%s',_0x521149[_0xdcd1('0x45')],_0x521149[_0xdcd1('0x1b')]);var _0x3d22f8={'method':'POST','uri':util[_0xdcd1('0x3b')](_0xdcd1('0x46'),_0x521149[_0xdcd1('0x45')]),'body':_0x169039,'headers':{'Authorization':util[_0xdcd1('0x3b')](_0xdcd1('0x47'),new Buffer(_0x654892)[_0xdcd1('0x3e')](_0xdcd1('0x48')))},'json':!![]};rp(_0x3d22f8)[_0xdcd1('0x11')](function(_0x17a01a){var _0x2f8083={'messageId':_0x17a01a[_0xdcd1('0x49')][0x0]};return _0x457a70[_0xdcd1('0x23')](_0x2f8083);})[_0xdcd1('0x14')](function(_0x399bd4){logger[_0xdcd1('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdcd1('0x25'),'plivo',util[_0xdcd1('0x26')](_0x399bd4,{'showHidden':![],'depth':null}));});}else{logger[_0xdcd1('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xdcd1('0x25'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x521149['username']&&_0x521149['password']){if(_0x521149[_0xdcd1('0x4a')]){var _0x1513e2={'method':'POST','uri':_0x521149['baseUrl']+_0xdcd1('0x4b'),'body':{'username':_0x521149[_0xdcd1('0x2a')],'password':_0x521149['password']},'json':!![]};return rp(_0x1513e2)[_0xdcd1('0x11')](function(_0x555a15){var _0x332e14={'method':'POST','uri':_0x521149[_0xdcd1('0x4a')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x521149[_0xdcd1('0x1d')],'destinations':[{'to':_0x96c0bc['phone']}],'text':_0x96c0bc[_0xdcd1('0x13')],'notifyUrl':_0x521149[_0xdcd1('0x1e')]+'/api/sms/messages/'+_0x96c0bc['id']+_0xdcd1('0x20')+_0x521149[_0xdcd1('0x21')],'notifyContentType':_0xdcd1('0x4c'),'callbackData':_0x521149[_0xdcd1('0x1d')]+';'+_0x96c0bc[_0xdcd1('0x13')]}]},'headers':{'Authorization':_0xdcd1('0x4d')+_0x555a15['token']},'json':!![]};return rp(_0x332e14)[_0xdcd1('0x11')](function(_0x4ee435){if(_0x4ee435[_0xdcd1('0x1c')]){var _0x4b0806={'messageId':_0x4ee435[_0xdcd1('0x1c')][0x0]['messageId']};if(!_0x521149['deliveryReport']){_0x4b0806[_0xdcd1('0x32')]=!![];}return _0x457a70['update'](_0x4b0806);}else{return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x4e'),util['inspect'](_0x4ee435,{'showHidden':![],'depth':null}));}});})[_0xdcd1('0x14')](function(_0xb5d799){return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),'infobip',util['inspect'](_0xb5d799,{'showHidden':![],'depth':null}));});}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x4e'),_0xdcd1('0x4f'));}}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x4e'),_0xdcd1('0x33'));}case _0xdcd1('0x50'):var _0x339294=require(_0xdcd1('0x51'));if(_0x521149['apiKey']){var _0x2b9c67={};_0x2b9c67[_0xdcd1('0x52')]=_0x521149[_0xdcd1('0x2a')];_0x2b9c67['phone']=_0x96c0bc['phone'];_0x2b9c67['sender']=_0x521149[_0xdcd1('0x1d')];_0x2b9c67[_0xdcd1('0x53')]=_0x96c0bc[_0xdcd1('0x13')];_0x2b9c67[_0xdcd1('0x54')]=+new Date();var _0x1ffe9d='';var _0x45ba1a='';var _0x2fb7b9=Object[_0xdcd1('0x55')](_0x2b9c67);_0x2fb7b9[_0xdcd1('0x56')]();for(var _0x3fff95=0x0;_0x3fff95<_0x2fb7b9['length'];_0x3fff95++){if(_0x1ffe9d!=''){_0x1ffe9d+='&';}_0x1ffe9d+=_0x2fb7b9[_0x3fff95]+'='+encodeURIComponent(_0x2b9c67[_0x2fb7b9[_0x3fff95]]);_0x45ba1a+=_0x2b9c67[_0x2fb7b9[_0x3fff95]];}_0x45ba1a+=_0x521149['apiKey'];_0x45ba1a=_0x339294[_0xdcd1('0x57')](_0xdcd1('0x58'))[_0xdcd1('0x23')](_0x45ba1a)[_0xdcd1('0x59')](_0xdcd1('0x5a'));if(_0x1ffe9d!==''){_0x1ffe9d+='&';}_0x1ffe9d+='signature='+_0x45ba1a;var _0x2e5e92={'method':_0xdcd1('0x2e'),'uri':_0xdcd1('0x5b')+_0x1ffe9d,'json':!![]};return rp(_0x2e5e92)['then'](function(_0x53d168){var _0x1c593b=Object[_0xdcd1('0x55')](_0x53d168);if(_0x53d168[_0x1c593b[0x0]][_0xdcd1('0x15')]&&parseInt(_0x53d168[_0x1c593b[0x0]][_0xdcd1('0x15')])===0x0){var _0x2c0268={'messageId':_0x53d168[_0x1c593b[0x0]]['id_sms']};if(!_0x521149[_0xdcd1('0x37')]){_0x2c0268['read']=!![];}return _0x457a70['update'](_0x2c0268);}else{return logger['error'](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x50'),util[_0xdcd1('0x26')](_0x53d168['error'],{'showHidden':![],'depth':null}));}})[_0xdcd1('0x14')](function(_0x372a6a){return logger['error'](_0xdcd1('0x24'),'afterCreate',_0xdcd1('0x50'),util[_0xdcd1('0x26')](_0x372a6a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x50'),_0xdcd1('0x5c'));}case _0xdcd1('0x5d'):if(_0x521149['apiKey']){var _0x386d61={'method':_0xdcd1('0x2f'),'uri':_0xdcd1('0x5e'),'headers':{'Authorization':_0x521149[_0xdcd1('0x5f')]},'body':{'content':_0x96c0bc[_0xdcd1('0x13')],'to':[_0x96c0bc['phone']],'from':_0x521149[_0xdcd1('0x1d')],'binary':![],'clientMessageId':_0xdcd1('0x60'),'charset':'UTF-8'},'json':!![]};rp(_0x386d61)[_0xdcd1('0x11')](function(_0x1151e6){if(!_0x1151e6[_0xdcd1('0x15')]){var _0xb1f363={'messageId':_0x1151e6[_0xdcd1('0x1c')][0x0][_0xdcd1('0x61')]};if(!_0x521149['deliveryReport']){_0xb1f363[_0xdcd1('0x32')]=!![];}return _0x457a70[_0xdcd1('0x23')](_0xb1f363);}else{return logger[_0xdcd1('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xdcd1('0x5d'),util[_0xdcd1('0x26')](_0x1151e6[_0xdcd1('0x15')],{'showHidden':![],'depth':null}));}})[_0xdcd1('0x14')](function(_0x13347b){return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x5d'),util[_0xdcd1('0x26')](_0x13347b,{'showHidden':![],'depth':null}));});}else{logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),'clickatell',_0xdcd1('0x5c'));}break;case _0xdcd1('0x62'):if(_0x521149[_0xdcd1('0x5f')]){var _0x4d6af8={};var _0x2e5e92={'method':_0xdcd1('0x2f'),'uri':_0xdcd1('0x63'),'headers':{'Authorization':_0xdcd1('0x64')+_0x521149[_0xdcd1('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x521149[_0xdcd1('0x1d')],'to':_0x96c0bc[_0xdcd1('0x1d')],'text':_0x96c0bc[_0xdcd1('0x13')]},'json':!![]};return rp(_0x2e5e92)[_0xdcd1('0x11')](function(_0x24ca74){if(_0x24ca74[_0xdcd1('0x65')]==0xca){_0x4d6af8[_0xdcd1('0x66')]=_0x24ca74;var _0x12bad0={'method':_0xdcd1('0x2f'),'uri':_0xdcd1('0x67'),'headers':{'Authorization':_0xdcd1('0x64')+_0x521149[_0xdcd1('0x5f')],'Content-Type':_0xdcd1('0x4c')},'body':{'refid':_0x4d6af8[_0xdcd1('0x66')][_0xdcd1('0x68')]},'json':!![]};return rp(_0x12bad0)['then'](function(_0x49dac6){_0x4d6af8['status']=_0x49dac6;var _0x25addc={'messageId':_0x4d6af8[_0xdcd1('0x66')]['refid'],'read':!![]};return _0x457a70[_0xdcd1('0x23')](_0x25addc);});}else{return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),'intelepeer',util['inspect'](_0x24ca74,{'showHidden':![],'depth':null}));}})['catch'](function(_0x230bd0){return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x62'),util[_0xdcd1('0x26')](_0x230bd0,{'showHidden':![],'depth':null}));});}else{return logger[_0xdcd1('0x15')](_0xdcd1('0x24'),_0xdcd1('0x25'),_0xdcd1('0x62'),_0xdcd1('0x69'));}break;}}})[_0xdcd1('0x6a')](function(){_0x2e8b8f();});}else{_0x2e8b8f();}}},'charset':_0xdcd1('0x6b'),'collate':_0xdcd1('0x6c')});};
\ No newline at end of file
+var _0x1c80=['message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','sort','createHash','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','utf8mb4','lodash','util','api','moment','bluebird','SmsMessage','messageId','models','get','direction','toLowerCase','secret','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','body','catch','error','out','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','username','smsMethod','login?username=','&password=','password','GET','split','sms','POST','user_key','total_sent','internal_order_id','read','skebby','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','format','toString','base64','http_code','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c80,0x109));var _0x01c8=function(_0x17515c,_0x29abdf){_0x17515c=_0x17515c-0x0;var _0x1df823=_0x1c80[_0x17515c];return _0x1df823;};'use strict';var _=require(_0x01c8('0x0'));var util=require(_0x01c8('0x1'));var logger=require('../../config/logger')(_0x01c8('0x2'));var moment=require(_0x01c8('0x3'));var BPromise=require(_0x01c8('0x4'));var rp=require('request-promise');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x3bcbd6,_0x1e3e50){return _0x3bcbd6['define'](_0x01c8('0x5'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x01c8('0x6'),'fields':[_0x01c8('0x6')]}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c1f5e,_0x30e19c,_0x2714e3){var _0x45498d=_0x3bcbd6[_0x01c8('0x7')];var _0x2e7ab7=_0x5c1f5e[_0x01c8('0x8')]({'plain':!![]});if(_0x2e7ab7[_0x01c8('0x9')][_0x01c8('0xa')]()==='in'||_0x2e7ab7[_0x01c8('0x9')][_0x01c8('0xa')]()==='out'&&!_0x2e7ab7[_0x01c8('0xb')]&&!_['isNil'](_0x2e7ab7['UserId'])){_0x45498d[_0x01c8('0xc')][_0x01c8('0xd')]({'where':{'id':_0x2e7ab7[_0x01c8('0xe')]}})[_0x01c8('0xf')](function(_0x581c28){if(_0x581c28){_0x581c28[_0x01c8('0x10')]({'lastMsgAt':_0x2e7ab7[_0x01c8('0x11')],'lastMsgDirection':_0x2e7ab7[_0x01c8('0x9')][_0x01c8('0xa')](),'lastMsgBody':_0x2e7ab7[_0x01c8('0x12')]});}})[_0x01c8('0x13')](function(_0x1abb97){console[_0x01c8('0x14')](_0x1abb97);});}if(_0x2e7ab7['direction']===_0x01c8('0x15')&&!_0x2e7ab7['secret']){var _0x35bfd5;_0x45498d[_0x01c8('0x16')]['find']({'where':{'id':_0x2e7ab7[_0x01c8('0x17')]},'raw':!![]})['then'](function(_0x164972){_0x35bfd5=_0x164972;if(_0x35bfd5&&_0x35bfd5[_0x01c8('0x18')]){switch(_0x35bfd5[_0x01c8('0x18')]){case _0x01c8('0x19'):var _0x3cdab3=require('twilio');if(_0x35bfd5[_0x01c8('0x1a')]&&_0x35bfd5[_0x01c8('0x1b')]&&_0x35bfd5[_0x01c8('0x1c')]){var _0x48f8a7=new _0x3cdab3(_0x35bfd5[_0x01c8('0x1a')],_0x35bfd5[_0x01c8('0x1b')]);_0x48f8a7[_0x01c8('0x1d')][_0x01c8('0x1e')]({'body':_0x2e7ab7['body'],'to':_0x2e7ab7[_0x01c8('0x1c')],'from':_0x35bfd5[_0x01c8('0x1c')],'statusCallback':_0x35bfd5[_0x01c8('0x1f')]+_0x01c8('0x20')+_0x2e7ab7['id']+_0x01c8('0x21')+_0x35bfd5[_0x01c8('0x22')]})[_0x01c8('0xf')](function(_0x34ee02){if(_0x34ee02[_0x01c8('0x23')]){return _0x5c1f5e[_0x01c8('0x10')]({'messageId':_0x34ee02['sid']});}})['catch'](function(_0x45e94c){logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x19'),util[_0x01c8('0x26')](_0x45e94c,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x01c8('0x25'),_0x01c8('0x19'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x41687a='https://api.skebby.it/API/v1.0/REST/';if(_0x35bfd5[_0x01c8('0x27')]&&_0x35bfd5['password']){var _0x153100={'recipient':[_0x2e7ab7['phone']],'message':_0x2e7ab7[_0x01c8('0x12')],'message_type':_0x35bfd5[_0x01c8('0x28')]};var _0x20c1ea={'url':_0x41687a+_0x01c8('0x29')+_0x35bfd5[_0x01c8('0x27')]+_0x01c8('0x2a')+_0x35bfd5[_0x01c8('0x2b')],'method':_0x01c8('0x2c')};rp(_0x20c1ea)[_0x01c8('0xf')](function(_0xbb725){var _0x231b04=_0xbb725[_0x01c8('0x2d')](';');var _0x3c590a={'user_key':_0x231b04[0x0],'session_key':_0x231b04[0x1]};_0x20c1ea={'url':_0x41687a+_0x01c8('0x2e'),'method':_0x01c8('0x2f'),'headers':{'user_key':_0x3c590a[_0x01c8('0x30')],'Session_key':_0x3c590a['session_key']},'json':!![],'body':_0x153100};return rp(_0x20c1ea);})['then'](function(_0x8246f1){if(_0x8246f1[_0x01c8('0x31')]>=0x1){var _0x5046c6={'messageId':_0x8246f1[_0x01c8('0x32')]};if(_0x35bfd5[_0x01c8('0x28')]!=='GP'||!_0x35bfd5['deliveryReport']){_0x5046c6[_0x01c8('0x33')]=!![];}return _0x5c1f5e[_0x01c8('0x10')](_0x5046c6);}else{return logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x34'),util['inspect'](_0x8246f1,{'showHidden':![],'depth':null}));}})[_0x01c8('0x13')](function(_0x4556a5){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x01c8('0x25'),_0x01c8('0x34'),util[_0x01c8('0x26')](_0x4556a5,{'showHidden':![],'depth':null}));});}else{logger[_0x01c8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x01c8('0x25'),_0x01c8('0x34'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x01c8('0x35'):if(_0x35bfd5[_0x01c8('0x1b')]){var _0x25ac98={'recipient':_0x2e7ab7['phone'],'message':_0x2e7ab7[_0x01c8('0x12')],'sender':_0x35bfd5[_0x01c8('0x36')]||_0x35bfd5[_0x01c8('0x1c')],'authorization':_0x35bfd5[_0x01c8('0x1b')]};var _0x30e19c={'method':'POST','uri':_0x01c8('0x37'),'body':_0x25ac98,'json':!![]};rp(_0x30e19c)['then'](function(_0x30267a){var _0x4e2bea={'messageId':_0x30267a[_0x01c8('0x38')]};if(!_0x35bfd5[_0x01c8('0x39')]){_0x4e2bea['read']=!![];}return _0x5c1f5e[_0x01c8('0x10')](_0x4e2bea);})[_0x01c8('0x13')](function(_0x194e4e){logger['error'](_0x01c8('0x24'),'afterCreate',_0x01c8('0x35'),util[_0x01c8('0x26')](_0x194e4e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x01c8('0x25'),_0x01c8('0x35'),_0x01c8('0x3a'));}break;case _0x01c8('0x3b'):if(_0x35bfd5[_0x01c8('0x27')]&&_0x35bfd5[_0x01c8('0x2b')]){var _0x25ac98={'messages':[{'source':_0x01c8('0x3c'),'to':_0x2e7ab7[_0x01c8('0x1c')],'body':_0x2e7ab7[_0x01c8('0x12')],'from':_0x35bfd5[_0x01c8('0x36')]||_0x35bfd5[_0x01c8('0x1c')]}]};var _0x56d804=util['format'](_0x01c8('0x3d'),_0x35bfd5[_0x01c8('0x27')],_0x35bfd5[_0x01c8('0x2b')]);var _0x30e19c={'method':_0x01c8('0x2f'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x25ac98,'headers':{'Authorization':util[_0x01c8('0x3e')]('Basic\x20%s',new Buffer(_0x56d804)[_0x01c8('0x3f')](_0x01c8('0x40')))},'json':!![]};rp(_0x30e19c)['then'](function(_0x2c41ea){if(_0x2c41ea[_0x01c8('0x41')]>=0xc8&&_0x2c41ea['http_code']<=0xce){if(_0x2c41ea['data']&&_0x2c41ea[_0x01c8('0x42')][_0x01c8('0x43')]>0x0){var _0xf38483=_[_0x01c8('0x44')](_0x2c41ea['data'][_0x01c8('0x1d')]);var _0x11c2ae={'messageId':_0xf38483['message_id']};if(!_0x35bfd5[_0x01c8('0x39')]){_0x11c2ae[_0x01c8('0x33')]=!![];}return _0x5c1f5e['update'](_0x11c2ae);}else{logger[_0x01c8('0x14')](_0x01c8('0x24'),'afterCreate',_0x01c8('0x45'),util[_0x01c8('0x26')](_0x2c41ea,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x45'),util[_0x01c8('0x26')](_0x2c41ea,{'showHidden':![],'depth':null}));}})[_0x01c8('0x13')](function(_0x3e6091){logger[_0x01c8('0x14')](_0x01c8('0x24'),'afterCreate',_0x01c8('0x45'),util[_0x01c8('0x26')](_0x3e6091,{'showHidden':![],'depth':null}));});}else{logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x45'),_0x01c8('0x46'));}break;case'plivo':if(_0x35bfd5[_0x01c8('0x47')]&&_0x35bfd5['authToken']){var _0x25ac98={'dst':_0x2e7ab7[_0x01c8('0x1c')],'text':_0x2e7ab7[_0x01c8('0x12')],'src':_0x35bfd5[_0x01c8('0x36')]||_0x35bfd5[_0x01c8('0x1c')],'url':_0x35bfd5[_0x01c8('0x1f')]+_0x01c8('0x20')+_0x2e7ab7['id']+_0x01c8('0x21')+_0x35bfd5[_0x01c8('0x22')]};var _0x56d804=util[_0x01c8('0x3e')](_0x01c8('0x3d'),_0x35bfd5[_0x01c8('0x47')],_0x35bfd5['authToken']);var _0x30e19c={'method':_0x01c8('0x2f'),'uri':util[_0x01c8('0x3e')](_0x01c8('0x48'),_0x35bfd5['authId']),'body':_0x25ac98,'headers':{'Authorization':util[_0x01c8('0x3e')](_0x01c8('0x49'),new Buffer(_0x56d804)['toString'](_0x01c8('0x40')))},'json':!![]};rp(_0x30e19c)['then'](function(_0x595b1c){var _0x4c6d8c={'messageId':_0x595b1c[_0x01c8('0x4a')][0x0]};return _0x5c1f5e['update'](_0x4c6d8c);})[_0x01c8('0x13')](function(_0x33390b){logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x4b'),util[_0x01c8('0x26')](_0x33390b,{'showHidden':![],'depth':null}));});}else{logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x4b'),_0x01c8('0x4c'));}break;case'infobip':if(_0x35bfd5[_0x01c8('0x27')]&&_0x35bfd5[_0x01c8('0x2b')]){if(_0x35bfd5[_0x01c8('0x4d')]){var _0x4951c8={'method':_0x01c8('0x2f'),'uri':_0x35bfd5[_0x01c8('0x4d')]+_0x01c8('0x4e'),'body':{'username':_0x35bfd5[_0x01c8('0x27')],'password':_0x35bfd5[_0x01c8('0x2b')]},'json':!![]};return rp(_0x4951c8)[_0x01c8('0xf')](function(_0x4468bb){var _0x1b3411={'method':_0x01c8('0x2f'),'uri':_0x35bfd5[_0x01c8('0x4d')]+_0x01c8('0x4f'),'body':{'messages':[{'from':_0x35bfd5[_0x01c8('0x1c')],'destinations':[{'to':_0x2e7ab7['phone']}],'text':_0x2e7ab7[_0x01c8('0x12')],'notifyUrl':_0x35bfd5[_0x01c8('0x1f')]+_0x01c8('0x20')+_0x2e7ab7['id']+_0x01c8('0x21')+_0x35bfd5[_0x01c8('0x22')],'notifyContentType':_0x01c8('0x50'),'callbackData':_0x35bfd5['phone']+';'+_0x2e7ab7[_0x01c8('0x12')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x4468bb[_0x01c8('0x22')]},'json':!![]};return rp(_0x1b3411)[_0x01c8('0xf')](function(_0x296fac){if(_0x296fac[_0x01c8('0x1d')]){var _0x4dafa4={'messageId':_0x296fac['messages'][0x0]['messageId']};if(!_0x35bfd5[_0x01c8('0x39')]){_0x4dafa4[_0x01c8('0x33')]=!![];}return _0x5c1f5e['update'](_0x4dafa4);}else{return logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x51'),util['inspect'](_0x296fac,{'showHidden':![],'depth':null}));}});})[_0x01c8('0x13')](function(_0xe89b3){return logger[_0x01c8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x01c8('0x25'),_0x01c8('0x51'),util[_0x01c8('0x26')](_0xe89b3,{'showHidden':![],'depth':null}));});}else{logger[_0x01c8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x01c8('0x51'),_0x01c8('0x52'));}}else{logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),'infobip','Missing\x20parameters:\x20username,\x20password');}case _0x01c8('0x53'):var _0x1e5ccc=require(_0x01c8('0x54'));if(_0x35bfd5[_0x01c8('0x55')]){var _0x22d9e1={};_0x22d9e1[_0x01c8('0x56')]=_0x35bfd5[_0x01c8('0x27')];_0x22d9e1[_0x01c8('0x1c')]=_0x2e7ab7[_0x01c8('0x1c')];_0x22d9e1[_0x01c8('0x57')]=_0x35bfd5[_0x01c8('0x1c')];_0x22d9e1[_0x01c8('0x58')]=_0x2e7ab7['body'];_0x22d9e1[_0x01c8('0x59')]=+new Date();var _0x2fc2c7='';var _0x131343='';var _0x38221b=Object['keys'](_0x22d9e1);_0x38221b[_0x01c8('0x5a')]();for(var _0x4e92b4=0x0;_0x4e92b4<_0x38221b['length'];_0x4e92b4++){if(_0x2fc2c7!=''){_0x2fc2c7+='&';}_0x2fc2c7+=_0x38221b[_0x4e92b4]+'='+encodeURIComponent(_0x22d9e1[_0x38221b[_0x4e92b4]]);_0x131343+=_0x22d9e1[_0x38221b[_0x4e92b4]];}_0x131343+=_0x35bfd5[_0x01c8('0x55')];_0x131343=_0x1e5ccc[_0x01c8('0x5b')](_0x01c8('0x5c'))[_0x01c8('0x10')](_0x131343)[_0x01c8('0x5d')](_0x01c8('0x5e'));if(_0x2fc2c7!==''){_0x2fc2c7+='&';}_0x2fc2c7+=_0x01c8('0x5f')+_0x131343;var _0x20c1ea={'method':_0x01c8('0x2c'),'uri':_0x01c8('0x60')+_0x2fc2c7,'json':!![]};return rp(_0x20c1ea)[_0x01c8('0xf')](function(_0xfafeb2){var _0x4c3287=Object[_0x01c8('0x61')](_0xfafeb2);if(_0xfafeb2[_0x4c3287[0x0]]['error']&&parseInt(_0xfafeb2[_0x4c3287[0x0]]['error'])===0x0){var _0x4e7496={'messageId':_0xfafeb2[_0x4c3287[0x0]][_0x01c8('0x62')]};if(!_0x35bfd5[_0x01c8('0x39')]){_0x4e7496['read']=!![];}return _0x5c1f5e[_0x01c8('0x10')](_0x4e7496);}else{return logger[_0x01c8('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0x01c8('0x26')](_0xfafeb2[_0x01c8('0x14')],{'showHidden':![],'depth':null}));}})[_0x01c8('0x13')](function(_0x48f74e){return logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x53'),util[_0x01c8('0x26')](_0x48f74e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x01c8('0x24'),'afterCreate','csc',_0x01c8('0x63'));}case _0x01c8('0x64'):if(_0x35bfd5[_0x01c8('0x55')]){var _0xe22107={'method':_0x01c8('0x2f'),'uri':_0x01c8('0x65'),'headers':{'Authorization':_0x35bfd5[_0x01c8('0x55')]},'body':{'content':_0x2e7ab7['body'],'to':[_0x2e7ab7[_0x01c8('0x1c')]],'from':_0x35bfd5['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x01c8('0x66')},'json':!![]};rp(_0xe22107)[_0x01c8('0xf')](function(_0x47aff0){if(!_0x47aff0[_0x01c8('0x14')]){var _0x44bf96={'messageId':_0x47aff0[_0x01c8('0x1d')][0x0][_0x01c8('0x67')]};if(!_0x35bfd5['deliveryReport']){_0x44bf96['read']=!![];}return _0x5c1f5e['update'](_0x44bf96);}else{return logger['error'](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x64'),util[_0x01c8('0x26')](_0x47aff0['error'],{'showHidden':![],'depth':null}));}})[_0x01c8('0x13')](function(_0x4d4e2f){return logger[_0x01c8('0x14')](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x64'),util['inspect'](_0x4d4e2f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x01c8('0x24'),'afterCreate','clickatell',_0x01c8('0x63'));}break;case _0x01c8('0x68'):if(_0x35bfd5[_0x01c8('0x55')]){var _0x5a4c89={};var _0x20c1ea={'method':_0x01c8('0x2f'),'uri':_0x01c8('0x69'),'headers':{'Authorization':_0x01c8('0x6a')+_0x35bfd5[_0x01c8('0x55')],'Content-Type':_0x01c8('0x50')},'body':{'from':_0x35bfd5[_0x01c8('0x1c')],'to':_0x2e7ab7[_0x01c8('0x1c')],'text':_0x2e7ab7['body']},'json':!![]};return rp(_0x20c1ea)[_0x01c8('0xf')](function(_0x9846ee){if(_0x9846ee[_0x01c8('0x6b')]==0xca){_0x5a4c89[_0x01c8('0x6c')]=_0x9846ee;var _0x4df4ed={'method':_0x01c8('0x2f'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x01c8('0x6a')+_0x35bfd5[_0x01c8('0x55')],'Content-Type':_0x01c8('0x50')},'body':{'refid':_0x5a4c89[_0x01c8('0x6c')][_0x01c8('0x6d')]},'json':!![]};return rp(_0x4df4ed)[_0x01c8('0xf')](function(_0x356c1b){_0x5a4c89[_0x01c8('0x6e')]=_0x356c1b;var _0x456987={'messageId':_0x5a4c89[_0x01c8('0x6c')][_0x01c8('0x6d')],'read':!![]};return _0x5c1f5e[_0x01c8('0x10')](_0x456987);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x01c8('0x25'),_0x01c8('0x68'),util[_0x01c8('0x26')](_0x9846ee,{'showHidden':![],'depth':null}));}})[_0x01c8('0x13')](function(_0x2a9987){return logger['error'](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x68'),util['inspect'](_0x2a9987,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x01c8('0x24'),_0x01c8('0x25'),_0x01c8('0x68'),_0x01c8('0x6f'));}break;}}})['finally'](function(){_0x2714e3();});}else{_0x2714e3();}}},'charset':_0x01c8('0x70'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 3928c51..d49f95f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4eb=['SmsMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','localhost','redis','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsMessage'];(function(_0x4da2b0,_0x5a8149){var _0x30825e=function(_0x25772c){while(--_0x25772c){_0x4da2b0['push'](_0x4da2b0['shift']());}};_0x30825e(++_0x5a8149);}(_0xe4eb,0x159));var _0xbe4e=function(_0x3a7258,_0x4f9d4f){_0x3a7258=_0x3a7258-0x0;var _0x2f6012=_0xe4eb[_0x3a7258];return _0x2f6012;};'use strict';var _=require(_0xbe4e('0x0'));var util=require(_0xbe4e('0x1'));var moment=require(_0xbe4e('0x2'));var BPromise=require('bluebird');var rs=require(_0xbe4e('0x3'));var fs=require('fs');var Redis=require(_0xbe4e('0x4'));var db=require(_0xbe4e('0x5'))['db'];var utils=require(_0xbe4e('0x6'));var logger=require('../../config/logger')(_0xbe4e('0x7'));var config=require(_0xbe4e('0x8'));var jayson=require(_0xbe4e('0x9'));var client=jayson[_0xbe4e('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xbe4e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe4e('0xc')]));require('./smsMessage.socket')[_0xbe4e('0xd')](socket);function respondWithRpcPromise(_0x20a8a7,_0x2f955a,_0x28de9d){return new BPromise(function(_0x49d809,_0x59b662){return client[_0xbe4e('0xe')](_0x20a8a7,_0x28de9d)[_0xbe4e('0xf')](function(_0x76adff){logger[_0xbe4e('0x10')](_0xbe4e('0x11'),_0x2f955a,_0xbe4e('0x12'));logger[_0xbe4e('0x13')](_0xbe4e('0x14'),_0x2f955a,_0xbe4e('0x12'),JSON[_0xbe4e('0x15')](_0x76adff));if(_0x76adff[_0xbe4e('0x16')]){if(_0x76adff['error']['code']===0x1f4){logger[_0xbe4e('0x16')](_0xbe4e('0x11'),_0x2f955a,_0x76adff[_0xbe4e('0x16')][_0xbe4e('0x17')]);return _0x59b662(_0x76adff[_0xbe4e('0x16')][_0xbe4e('0x17')]);}logger[_0xbe4e('0x16')]('SmsMessage,\x20%s,\x20%s',_0x2f955a,_0x76adff[_0xbe4e('0x16')][_0xbe4e('0x17')]);return _0x49d809(_0x76adff[_0xbe4e('0x16')]['message']);}else{logger[_0xbe4e('0x10')](_0xbe4e('0x11'),_0x2f955a,'request\x20sent');_0x49d809(_0x76adff[_0xbe4e('0x18')][_0xbe4e('0x17')]);}})[_0xbe4e('0x19')](function(_0x5c5e8c){logger[_0xbe4e('0x16')](_0xbe4e('0x11'),_0x2f955a,_0x5c5e8c);_0x59b662(_0x5c5e8c);});});}exports[_0xbe4e('0x1a')]=function(_0x2482f9){var _0x3a7347=this;return new Promise(function(_0x17538c,_0x570ff7){return db[_0xbe4e('0x1b')]['create'](_0x2482f9[_0xbe4e('0x1c')],{'raw':_0x2482f9['options']?_0x2482f9[_0xbe4e('0x1d')][_0xbe4e('0x1e')]===undefined?!![]:![]:!![]})[_0xbe4e('0xf')](function(_0x28eede){logger[_0xbe4e('0x10')]('CreateSmsMessage',_0x2482f9);logger['debug'](_0xbe4e('0x1a'),_0x2482f9,JSON['stringify'](_0x28eede));_0x17538c(_0x28eede);})[_0xbe4e('0x19')](function(_0x434ee8){logger[_0xbe4e('0x16')]('CreateSmsMessage',_0x434ee8[_0xbe4e('0x17')],_0x2482f9);_0x570ff7(_0x3a7347[_0xbe4e('0x16')](0x1f4,_0x434ee8[_0xbe4e('0x17')]));});});};
\ No newline at end of file
+var _0xfdd8=['options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0x29af39,_0x343c56){var _0x3ab715=function(_0x24eaea){while(--_0x24eaea){_0x29af39['push'](_0x29af39['shift']());}};_0x3ab715(++_0x343c56);}(_0xfdd8,0x12b));var _0x8fdd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfdd8[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8fdd('0x0'));var util=require(_0x8fdd('0x1'));var moment=require('moment');var BPromise=require(_0x8fdd('0x2'));var rs=require(_0x8fdd('0x3'));var fs=require('fs');var Redis=require(_0x8fdd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fdd('0x5'));var logger=require(_0x8fdd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8fdd('0x7'));var client=jayson[_0x8fdd('0x8')][_0x8fdd('0x9')]({'port':0x232a});config[_0x8fdd('0xa')]=_[_0x8fdd('0xb')](config['redis'],{'host':_0x8fdd('0xc'),'port':0x18eb});var socket=require(_0x8fdd('0xd'))(new Redis(config['redis']));require(_0x8fdd('0xe'))[_0x8fdd('0xf')](socket);function respondWithRpcPromise(_0x1a4b33,_0x333c2d,_0x54eda4){return new BPromise(function(_0x54b95d,_0x2accec){return client[_0x8fdd('0x10')](_0x1a4b33,_0x54eda4)[_0x8fdd('0x11')](function(_0x60d7a8){logger[_0x8fdd('0x12')]('SmsMessage,\x20%s,\x20%s',_0x333c2d,_0x8fdd('0x13'));logger[_0x8fdd('0x14')](_0x8fdd('0x15'),_0x333c2d,_0x8fdd('0x13'),JSON[_0x8fdd('0x16')](_0x60d7a8));if(_0x60d7a8[_0x8fdd('0x17')]){if(_0x60d7a8[_0x8fdd('0x17')]['code']===0x1f4){logger[_0x8fdd('0x17')](_0x8fdd('0x18'),_0x333c2d,_0x60d7a8['error'][_0x8fdd('0x19')]);return _0x2accec(_0x60d7a8[_0x8fdd('0x17')][_0x8fdd('0x19')]);}logger[_0x8fdd('0x17')](_0x8fdd('0x18'),_0x333c2d,_0x60d7a8[_0x8fdd('0x17')][_0x8fdd('0x19')]);return _0x54b95d(_0x60d7a8[_0x8fdd('0x17')][_0x8fdd('0x19')]);}else{logger[_0x8fdd('0x12')]('SmsMessage,\x20%s,\x20%s',_0x333c2d,_0x8fdd('0x13'));_0x54b95d(_0x60d7a8[_0x8fdd('0x1a')]['message']);}})[_0x8fdd('0x1b')](function(_0x22b701){logger[_0x8fdd('0x17')](_0x8fdd('0x18'),_0x333c2d,_0x22b701);_0x2accec(_0x22b701);});});}exports[_0x8fdd('0x1c')]=function(_0x445963){var _0x456d97=this;return new Promise(function(_0x16126c,_0x520593){return db[_0x8fdd('0x1d')]['create'](_0x445963[_0x8fdd('0x1e')],{'raw':_0x445963[_0x8fdd('0x1f')]?_0x445963[_0x8fdd('0x1f')][_0x8fdd('0x20')]===undefined?!![]:![]:!![]})[_0x8fdd('0x11')](function(_0xe14690){logger['info']('CreateSmsMessage',_0x445963);logger['debug'](_0x8fdd('0x1c'),_0x445963,JSON[_0x8fdd('0x16')](_0xe14690));_0x16126c(_0xe14690);})[_0x8fdd('0x1b')](function(_0x4d648b){logger['error'](_0x8fdd('0x1c'),_0x4d648b[_0x8fdd('0x19')],_0x445963);_0x520593(_0x456d97['error'](0x1f4,_0x4d648b['message']));});});};
\ No newline at end of file
index ba08ce6..7f694f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe570=['register','length','smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x44a329,_0x45f280){var _0x45f2a3=function(_0x272e62){while(--_0x272e62){_0x44a329['push'](_0x44a329['shift']());}};_0x45f2a3(++_0x45f280);}(_0xe570,0x111));var _0x0e57=function(_0x458e1d,_0x4c666d){_0x458e1d=_0x458e1d-0x0;var _0x44e9c5=_0xe570[_0x458e1d];return _0x44e9c5;};'use strict';var SmsMessageEvents=require(_0x0e57('0x0'));var events=[_0x0e57('0x1'),_0x0e57('0x2'),_0x0e57('0x3')];function createListener(_0x58d6ed,_0x5277ac){return function(_0xedada3){_0x5277ac[_0x0e57('0x4')](_0x58d6ed,_0xedada3);};}function removeListener(_0x31d00c,_0xddc78a){return function(){SmsMessageEvents[_0x0e57('0x5')](_0x31d00c,_0xddc78a);};}exports[_0x0e57('0x6')]=function(_0x29f72f){for(var _0x56796a=0x0,_0x498081=events[_0x0e57('0x7')];_0x56796a<_0x498081;_0x56796a++){var _0x53a945=events[_0x56796a];var _0x51c721=createListener(_0x0e57('0x8')+_0x53a945,_0x29f72f);SmsMessageEvents['on'](_0x53a945,_0x51c721);}};
\ No newline at end of file
+var _0x23b2=['length','smsMessage:','./smsMessage.events','save','update','emit'];(function(_0x4e73cd,_0x3cab2b){var _0x364446=function(_0x3c67f1){while(--_0x3c67f1){_0x4e73cd['push'](_0x4e73cd['shift']());}};_0x364446(++_0x3cab2b);}(_0x23b2,0x7a));var _0x223b=function(_0x57f76c,_0x3e8ac8){_0x57f76c=_0x57f76c-0x0;var _0x12dc28=_0x23b2[_0x57f76c];return _0x12dc28;};'use strict';var SmsMessageEvents=require(_0x223b('0x0'));var events=[_0x223b('0x1'),'remove',_0x223b('0x2')];function createListener(_0x4cf1d9,_0x513ca0){return function(_0xe14adc){_0x513ca0[_0x223b('0x3')](_0x4cf1d9,_0xe14adc);};}function removeListener(_0x5db109,_0x4b0afd){return function(){SmsMessageEvents['removeListener'](_0x5db109,_0x4b0afd);};}exports['register']=function(_0x5a95ef){for(var _0xe34a73=0x0,_0xc14d7e=events[_0x223b('0x4')];_0xe34a73<_0xc14d7e;_0xe34a73++){var _0x59b063=events[_0xe34a73];var _0x413b2f=createListener(_0x223b('0x5')+_0x59b063,_0x5a95ef);SmsMessageEvents['on'](_0x59b063,_0x413b2f);}};
\ No newline at end of file
index b0d87a4..f6f5013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x225b=['update','delete','/:id/teams','removeTeams','removeAgents','exports','multer','connect-timeout','express','Router','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x225b,0x1c6));var _0xb225=function(_0x1d6012,_0x1777b5){_0x1d6012=_0x1d6012-0x0;var _0x51233d=_0x225b[_0x1d6012];return _0x51233d;};'use strict';var multer=require(_0xb225('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb225('0x1'));var express=require(_0xb225('0x2'));var router=express[_0xb225('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb225('0x4'));var controller=require(_0xb225('0x5'));router[_0xb225('0x6')]('/',auth[_0xb225('0x7')](),controller[_0xb225('0x8')]);router[_0xb225('0x6')](_0xb225('0x9'),auth['isAuthenticated'](),controller[_0xb225('0xa')]);router[_0xb225('0x6')](_0xb225('0xb'),auth[_0xb225('0x7')](),controller[_0xb225('0xc')]);router[_0xb225('0x6')](_0xb225('0xd'),auth[_0xb225('0x7')](),controller['getMembers']);router[_0xb225('0x6')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb225('0xe')]);router[_0xb225('0x6')](_0xb225('0xf'),auth['isAuthenticated'](),controller[_0xb225('0x10')]);router[_0xb225('0x11')]('/',auth[_0xb225('0x7')](),controller[_0xb225('0x12')]);router['post']('/:id/teams',auth[_0xb225('0x7')](),controller[_0xb225('0x13')]);router[_0xb225('0x11')]('/:id/users',auth[_0xb225('0x7')](),controller[_0xb225('0x14')]);router[_0xb225('0x15')]('/:id',auth[_0xb225('0x7')](),controller[_0xb225('0x16')]);router['delete'](_0xb225('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xb225('0x17')](_0xb225('0x18'),auth[_0xb225('0x7')](),controller[_0xb225('0x19')]);router[_0xb225('0x17')](_0xb225('0xf'),auth[_0xb225('0x7')](),controller[_0xb225('0x1a')]);module[_0xb225('0x1b')]=router;
\ No newline at end of file
+var _0xcc37=['../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xcc37,0x6c));var _0x7cc3=function(_0x5147b0,_0x25873c){_0x5147b0=_0x5147b0-0x0;var _0x127696=_0xcc37[_0x5147b0];return _0x127696;};'use strict';var multer=require('multer');var util=require(_0x7cc3('0x0'));var path=require(_0x7cc3('0x1'));var timeout=require(_0x7cc3('0x2'));var express=require(_0x7cc3('0x3'));var router=express['Router']();var auth=require(_0x7cc3('0x4'));var interaction=require(_0x7cc3('0x5'));var config=require('../../config/environment');var controller=require(_0x7cc3('0x6'));router[_0x7cc3('0x7')]('/',auth[_0x7cc3('0x8')](),controller[_0x7cc3('0x9')]);router[_0x7cc3('0x7')](_0x7cc3('0xa'),auth[_0x7cc3('0x8')](),controller['describe']);router[_0x7cc3('0x7')](_0x7cc3('0xb'),auth[_0x7cc3('0x8')](),controller[_0x7cc3('0xc')]);router['get'](_0x7cc3('0xd'),auth[_0x7cc3('0x8')](),controller['getMembers']);router[_0x7cc3('0x7')](_0x7cc3('0xe'),auth['isAuthenticated'](),controller[_0x7cc3('0xf')]);router[_0x7cc3('0x7')]('/:id/users',auth[_0x7cc3('0x8')](),controller['getAgents']);router[_0x7cc3('0x10')]('/',auth[_0x7cc3('0x8')](),controller[_0x7cc3('0x11')]);router[_0x7cc3('0x10')](_0x7cc3('0xe'),auth['isAuthenticated'](),controller[_0x7cc3('0x12')]);router[_0x7cc3('0x10')](_0x7cc3('0x13'),auth[_0x7cc3('0x8')](),controller[_0x7cc3('0x14')]);router[_0x7cc3('0x15')](_0x7cc3('0xb'),auth[_0x7cc3('0x8')](),controller[_0x7cc3('0x16')]);router[_0x7cc3('0x17')](_0x7cc3('0xb'),auth[_0x7cc3('0x8')](),controller[_0x7cc3('0x18')]);router[_0x7cc3('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7cc3('0x19')]);router[_0x7cc3('0x17')](_0x7cc3('0x13'),auth[_0x7cc3('0x8')](),controller[_0x7cc3('0x1a')]);module[_0x7cc3('0x1b')]=router;
\ No newline at end of file
index 308a8ea..25fef98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd881=['sequelize','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3d19cf,_0x57b154){var _0x512238=function(_0x33929d){while(--_0x33929d){_0x3d19cf['push'](_0x3d19cf['shift']());}};_0x512238(++_0x57b154);}(_0xd881,0x1c0));var _0x1d88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd881[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1d88('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1d88('0x1')]},'timeout':{'type':Sequelize[_0x1d88('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1d88('0x3')](_0x1d88('0x4'),_0x1d88('0x5'),_0x1d88('0x6'))}};
\ No newline at end of file
+var _0xf78c=['name','INTEGER','roundrobin','sequelize','exports','STRING'];(function(_0x34c122,_0x326e01){var _0xe2c41e=function(_0x1a8d47){while(--_0x1a8d47){_0x34c122['push'](_0x34c122['shift']());}};_0xe2c41e(++_0x326e01);}(_0xf78c,0xe1));var _0xcf78=function(_0x5f2734,_0x2d78aa){_0x5f2734=_0x5f2734-0x0;var _0xbfb340=_0xf78c[_0x5f2734];return _0xbfb340;};'use strict';var Sequelize=require(_0xcf78('0x0'));module[_0xcf78('0x1')]={'name':{'type':Sequelize[_0xcf78('0x2')],'unique':_0xcf78('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcf78('0x2')]},'timeout':{'type':Sequelize[_0xcf78('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xcf78('0x5'))}};
\ No newline at end of file
index caa8137..08537f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1584=['fields','length','nolimit','order','where','filters','pick','dateEnd','add','day','merge','filter','type','key','VIRTUAL','field','options','includeAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserSmsQueue','hasOwnProperty','sort','SmsQueueId','map','findAll','User','UserId','agent','updatedAt','%s/%s','SIP','smsPause','createdAt','getTeams','addTeams','Team','ids','Agents','union','addAgents','penalty','removeAgents','removeTeams','spread','emit','userSmsQueue:save','userSmsQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','status','error','stack','name','send','SmsQueue','rawAttributes','model','keys','query','dateStart','intersection','attributes'];(function(_0x48e8a9,_0x46ef74){var _0x3f3293=function(_0x3ab61f){while(--_0x3ab61f){_0x48e8a9['push'](_0x48e8a9['shift']());}};_0x3f3293(++_0x46ef74);}(_0x1584,0xb6));var _0x4158=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1584[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4158('0x0'));var zipdir=require(_0x4158('0x1'));var jsonpatch=require(_0x4158('0x2'));var rp=require(_0x4158('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4158('0x4'));var util=require(_0x4158('0x5'));var path=require(_0x4158('0x6'));var sox=require('sox');var csv=require(_0x4158('0x7'));var ejs=require(_0x4158('0x8'));var fs=require('fs');var _=require(_0x4158('0x9'));var squel=require(_0x4158('0xa'));var crypto=require(_0x4158('0xb'));var jsforce=require(_0x4158('0xc'));var deskjs=require(_0x4158('0xd'));var toCsv=require(_0x4158('0x7'));var querystring=require('querystring');var Papa=require(_0x4158('0xe'));var Redis=require(_0x4158('0xf'));var qs=require(_0x4158('0x10'));var logger=require(_0x4158('0x11'))(_0x4158('0x12'));var utils=require('../../config/utils');var config=require(_0x4158('0x13'));var db=require(_0x4158('0x14'))['db'];config['redis']=_['defaults'](config[_0x4158('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x4158('0x16'))(new Redis(config['redis']));require(_0x4158('0x17'))[_0x4158('0x18')](socket);function respondWithStatusCode(_0x52353c,_0x3b4399){_0x3b4399=_0x3b4399||0xcc;return function(_0x66e6eb){if(_0x66e6eb){return _0x52353c[_0x4158('0x19')](_0x3b4399);}return _0x52353c['status'](_0x3b4399)[_0x4158('0x1a')]();};}function respondWithResult(_0x2e5dc5,_0x87e3f6){_0x87e3f6=_0x87e3f6||0xc8;return function(_0x3c8746){if(_0x3c8746){return _0x2e5dc5['status'](_0x87e3f6)[_0x4158('0x1b')](_0x3c8746);}};}function respondWithFilteredResult(_0x1c51fc,_0x4334fe){return function(_0x4cb5ab){if(_0x4cb5ab){var _0x33291b=_0x4cb5ab[_0x4158('0x1c')],_0x2c9bf1=_0x4334fe[_0x4158('0x1d')],_0x214fd0=_0x4334fe[_0x4158('0x1d')]+_0x4334fe[_0x4158('0x1e')],_0x4bb0af;if(_0x214fd0>=_0x33291b){_0x214fd0=_0x33291b;_0x4bb0af=0xc8;}else{_0x4bb0af=0xce;}_0x1c51fc['status'](_0x4bb0af);return _0x1c51fc[_0x4158('0x1f')](_0x4158('0x20'),_0x2c9bf1+'-'+_0x214fd0+'/'+_0x33291b)[_0x4158('0x1b')](_0x4cb5ab);}return null;};}function patchUpdates(_0x114e44){return function(_0x28d7bd){try{jsonpatch[_0x4158('0x21')](_0x28d7bd,_0x114e44,!![]);}catch(_0x7d5d67){return BPromise[_0x4158('0x22')](_0x7d5d67);}return _0x28d7bd[_0x4158('0x23')]();};}function saveUpdates(_0x5b248f,_0x14bb7e){return function(_0x400d78){if(_0x400d78){return _0x400d78['update'](_0x5b248f)[_0x4158('0x24')](function(_0x427649){return _0x427649;});}return null;};}function removeEntity(_0x485a8a,_0x541e56){return function(_0x5818b7){if(_0x5818b7){return _0x5818b7[_0x4158('0x25')]()['then'](function(){var _0x2c08a6=_0x5818b7[_0x4158('0x26')]({'plain':!![]});var _0x280c84=_0x4158('0x27');return db[_0x4158('0x28')][_0x4158('0x25')]({'where':{'type':_0x280c84,'resourceId':_0x2c08a6['id']}})[_0x4158('0x24')](function(){return _0x5818b7;});})['then'](function(){_0x485a8a[_0x4158('0x29')](0xcc)[_0x4158('0x1a')]();});}};}function handleEntityNotFound(_0x94f8ef,_0x114e75){return function(_0x46ffe9){if(!_0x46ffe9){_0x94f8ef['sendStatus'](0x194);}return _0x46ffe9;};}function handleError(_0x674f91,_0x17d437){_0x17d437=_0x17d437||0x1f4;return function(_0x40a80a){logger[_0x4158('0x2a')](_0x40a80a[_0x4158('0x2b')]);if(_0x40a80a[_0x4158('0x2c')]){delete _0x40a80a[_0x4158('0x2c')];}_0x674f91[_0x4158('0x29')](_0x17d437)[_0x4158('0x2d')](_0x40a80a);};}exports['index']=function(_0x11690f,_0x570ce2){var _0x38fd43={},_0x4c6839={},_0x41e9fc={'count':0x0,'rows':[]};var _0x255446=db[_0x4158('0x2e')][_0x4158('0x2f')];_0x4c6839[_0x4158('0x30')]=_[_0x4158('0x31')](_0x255446);var _0x4b643c={'dateStart':_0x11690f[_0x4158('0x32')][_0x4158('0x33')],'dateEnd':_0x11690f['query']['dateEnd']};delete _0x11690f[_0x4158('0x32')]['dateStart'];delete _0x11690f[_0x4158('0x32')]['dateEnd'];_0x4c6839['query']=_[_0x4158('0x31')](_0x11690f[_0x4158('0x32')]);_0x4c6839['filters']=_[_0x4158('0x34')](_0x4c6839[_0x4158('0x30')],_0x4c6839[_0x4158('0x32')]);_0x38fd43[_0x4158('0x35')]=_[_0x4158('0x34')](_0x4c6839[_0x4158('0x30')],qs[_0x4158('0x36')](_0x11690f[_0x4158('0x32')][_0x4158('0x36')]));_0x38fd43[_0x4158('0x35')]=_0x38fd43['attributes'][_0x4158('0x37')]?_0x38fd43[_0x4158('0x35')]:_0x4c6839[_0x4158('0x30')];if(!_0x11690f['query']['hasOwnProperty'](_0x4158('0x38'))){_0x38fd43[_0x4158('0x1e')]=qs[_0x4158('0x1e')](_0x11690f['query'][_0x4158('0x1e')]);_0x38fd43['offset']=qs[_0x4158('0x1d')](_0x11690f[_0x4158('0x32')][_0x4158('0x1d')]);}_0x38fd43[_0x4158('0x39')]=qs['sort'](_0x11690f[_0x4158('0x32')]['sort']);_0x38fd43[_0x4158('0x3a')]=qs[_0x4158('0x3b')](_[_0x4158('0x3c')](_0x11690f[_0x4158('0x32')],_0x4c6839[_0x4158('0x3b')]));if(_0x4b643c[_0x4158('0x33')]){if(_0x4b643c[_0x4158('0x3d')]){_0x4b643c[_0x4158('0x3d')]=moment(_0x4b643c['dateEnd'])[_0x4158('0x3e')](0x1,_0x4158('0x3f'));}else{_0x4b643c[_0x4158('0x3d')]=moment(_0x4b643c[_0x4158('0x33')])[_0x4158('0x3e')](0x1,_0x4158('0x3f'));}_[_0x4158('0x40')](_0x38fd43[_0x4158('0x3a')],{'createdAt':{'$gte':_0x4b643c[_0x4158('0x33')],'$lte':_0x4b643c[_0x4158('0x3d')]}});}if(_0x11690f['query'][_0x4158('0x41')]){_0x38fd43['where']=_[_0x4158('0x40')](_0x38fd43[_0x4158('0x3a')],{'$or':_['map'](_0x255446,function(_0x453d53){if(_0x453d53[_0x4158('0x42')][_0x4158('0x43')]!==_0x4158('0x44')){var _0x3efdcd={};_0x3efdcd[_0x453d53[_0x4158('0x45')]]={'$like':'%'+_0x11690f[_0x4158('0x32')][_0x4158('0x41')]+'%'};return _0x3efdcd;}})});}_0x38fd43=_[_0x4158('0x40')]({},_0x38fd43,_0x11690f[_0x4158('0x46')]);var _0x5b48cd={'where':_0x38fd43[_0x4158('0x3a')]};return db[_0x4158('0x2e')][_0x4158('0x1c')](_0x5b48cd)[_0x4158('0x24')](function(_0x407955){_0x41e9fc[_0x4158('0x1c')]=_0x407955;if(_0x11690f[_0x4158('0x32')][_0x4158('0x47')]){_0x38fd43['include']=[{'all':!![]}];}return db[_0x4158('0x2e')]['findAll'](_0x38fd43);})[_0x4158('0x24')](function(_0xdf90b2){_0x41e9fc[_0x4158('0x48')]=_0xdf90b2;return _0x41e9fc;})['then'](respondWithFilteredResult(_0x570ce2,_0x38fd43))[_0x4158('0x49')](handleError(_0x570ce2,null));};exports[_0x4158('0x4a')]=function(_0x3b3698,_0x1b7387){var _0x6b058e={'raw':!![],'where':{'id':_0x3b3698[_0x4158('0x4b')]['id']}},_0x2fb157={};_0x2fb157[_0x4158('0x30')]=_[_0x4158('0x31')](db[_0x4158('0x2e')]['rawAttributes']);_0x2fb157[_0x4158('0x32')]=_[_0x4158('0x31')](_0x3b3698[_0x4158('0x32')]);_0x2fb157[_0x4158('0x3b')]=_[_0x4158('0x34')](_0x2fb157[_0x4158('0x30')],_0x2fb157['query']);_0x6b058e[_0x4158('0x35')]=_[_0x4158('0x34')](_0x2fb157[_0x4158('0x30')],qs[_0x4158('0x36')](_0x3b3698[_0x4158('0x32')]['fields']));_0x6b058e[_0x4158('0x35')]=_0x6b058e[_0x4158('0x35')][_0x4158('0x37')]?_0x6b058e[_0x4158('0x35')]:_0x2fb157[_0x4158('0x30')];if(_0x3b3698[_0x4158('0x32')][_0x4158('0x47')]){_0x6b058e[_0x4158('0x4c')]=[{'all':!![]}];}_0x6b058e=_[_0x4158('0x40')]({},_0x6b058e,_0x3b3698[_0x4158('0x46')]);return db[_0x4158('0x2e')][_0x4158('0x4d')](_0x6b058e)[_0x4158('0x24')](handleEntityNotFound(_0x1b7387,null))['then'](respondWithResult(_0x1b7387,null))[_0x4158('0x49')](handleError(_0x1b7387,null));};exports[_0x4158('0x4e')]=function(_0x5adbaa,_0x161e69){return db[_0x4158('0x2e')][_0x4158('0x4e')](_0x5adbaa[_0x4158('0x4f')],{})['then'](function(_0x407700){var _0x5a80f4=_0x5adbaa['user']['get']({'plain':!![]});if(!_0x5a80f4)throw new Error(_0x4158('0x50'));if(_0x5a80f4[_0x4158('0x51')]===_0x4158('0x52')){var _0x49ffae=_0x407700[_0x4158('0x26')]({'plain':!![]});var _0x2818e9='SmsQueues';return db[_0x4158('0x53')][_0x4158('0x4d')]({'where':{'name':_0x2818e9,'userProfileId':_0x5a80f4['userProfileId']},'raw':!![]})[_0x4158('0x24')](function(_0x52c41d){if(_0x52c41d&&_0x52c41d[_0x4158('0x54')]===0x0){return db['UserProfileResource'][_0x4158('0x4e')]({'name':_0x49ffae[_0x4158('0x2c')],'resourceId':_0x49ffae['id'],'type':_0x52c41d[_0x4158('0x2c')],'sectionId':_0x52c41d['id']},{})[_0x4158('0x24')](function(){return _0x407700;});}else{return _0x407700;}})[_0x4158('0x49')](function(_0x6bbae6){logger[_0x4158('0x2a')](_0x4158('0x55'),_0x6bbae6);throw _0x6bbae6;});}return _0x407700;})[_0x4158('0x24')](respondWithResult(_0x161e69,0xc9))[_0x4158('0x49')](handleError(_0x161e69,null));};exports[_0x4158('0x56')]=function(_0x27d234,_0x4be3b4){if(_0x27d234['body']['id']){delete _0x27d234['body']['id'];}return db['SmsQueue'][_0x4158('0x4d')]({'where':{'id':_0x27d234[_0x4158('0x4b')]['id']}})[_0x4158('0x24')](handleEntityNotFound(_0x4be3b4,null))['then'](saveUpdates(_0x27d234[_0x4158('0x4f')],null))[_0x4158('0x24')](respondWithResult(_0x4be3b4,null))[_0x4158('0x49')](handleError(_0x4be3b4,null));};exports[_0x4158('0x25')]=function(_0x10e8d3,_0x3ec652){return db[_0x4158('0x2e')][_0x4158('0x4d')]({'where':{'id':_0x10e8d3[_0x4158('0x4b')]['id']}})[_0x4158('0x24')](handleEntityNotFound(_0x3ec652,null))[_0x4158('0x24')](removeEntity(_0x3ec652,null))[_0x4158('0x49')](handleError(_0x3ec652,null));};exports[_0x4158('0x57')]=function(_0x2ce219,_0x1ea0a0){return db[_0x4158('0x2e')][_0x4158('0x57')]()[_0x4158('0x24')](respondWithResult(_0x1ea0a0,null))[_0x4158('0x49')](handleError(_0x1ea0a0,null));};exports['getMembers']=function(_0x38a5c5,_0x8776b3,_0x3621ba){var _0x3ee9f3={'raw':!![],'where':{}},_0x2db21e={},_0x4ba88a;return db[_0x4158('0x2e')][_0x4158('0x58')]({'where':{'id':_0x38a5c5['params']['id']}})[_0x4158('0x24')](handleEntityNotFound(_0x8776b3,null))[_0x4158('0x24')](function(_0x37ecb4){if(_0x37ecb4){_0x4ba88a=_0x37ecb4[_0x4158('0x26')]({'plain':!![]});_0x2db21e[_0x4158('0x30')]=_[_0x4158('0x31')](db[_0x4158('0x59')]['rawAttributes']);_0x2db21e[_0x4158('0x32')]=_[_0x4158('0x31')](_0x38a5c5[_0x4158('0x32')]);_0x2db21e['filters']=_['intersection'](_0x2db21e[_0x4158('0x30')],_0x2db21e[_0x4158('0x32')]);_0x3ee9f3['attributes']=_[_0x4158('0x34')](_0x2db21e[_0x4158('0x30')],qs[_0x4158('0x36')](_0x38a5c5[_0x4158('0x32')][_0x4158('0x36')]));_0x3ee9f3[_0x4158('0x35')]=_0x3ee9f3[_0x4158('0x35')][_0x4158('0x37')]?_0x3ee9f3[_0x4158('0x35')]:_0x2db21e[_0x4158('0x30')];if(!_0x38a5c5[_0x4158('0x32')][_0x4158('0x5a')](_0x4158('0x38'))){_0x3ee9f3['limit']=qs[_0x4158('0x1e')](_0x38a5c5[_0x4158('0x32')]['limit']);_0x3ee9f3[_0x4158('0x1d')]=qs[_0x4158('0x1d')](_0x38a5c5[_0x4158('0x32')][_0x4158('0x1d')]);}_0x3ee9f3[_0x4158('0x39')]=qs[_0x4158('0x5b')](_0x38a5c5['query'][_0x4158('0x5b')]);_0x3ee9f3['where']=qs[_0x4158('0x3b')](_[_0x4158('0x3c')](_0x38a5c5['query'],_0x2db21e['filters']));_0x3ee9f3[_0x4158('0x3a')][_0x4158('0x5c')]=_0x37ecb4['id'];if(_0x38a5c5[_0x4158('0x32')][_0x4158('0x41')]){_0x3ee9f3['where']=_['merge'](_0x3ee9f3['where'],{'$or':_[_0x4158('0x5d')](_0x3ee9f3[_0x4158('0x35')],function(_0x1fb9a9){var _0x2475ef={};_0x2475ef[_0x1fb9a9]={'$like':'%'+_0x38a5c5['query'][_0x4158('0x41')]+'%'};return _0x2475ef;})});}_0x3ee9f3=_[_0x4158('0x40')]({},_0x3ee9f3,_0x38a5c5[_0x4158('0x46')]);return db[_0x4158('0x59')][_0x4158('0x5e')](_0x3ee9f3);}})[_0x4158('0x24')](function(_0x3cb735){if(_0x3cb735){return db[_0x4158('0x5f')]['findAndCountAll']({'where':{'id':_[_0x4158('0x5d')](_0x3cb735,_0x4158('0x60')),'role':_0x4158('0x61')},'attributes':['id',_0x4158('0x2c'),'smsPause',_0x4158('0x62'),'createdAt']});}})['then'](function(_0x6dab98){if(_0x6dab98){return{'count':_0x6dab98[_0x4158('0x1c')],'rows':_['map'](_0x6dab98[_0x4158('0x48')],function(_0x32d03f){return{'membername':_0x32d03f[_0x4158('0x2c')],'UserId':_0x32d03f['id'],'queue_name':_0x4ba88a[_0x4158('0x2c')],'SmsQueueId':_0x4ba88a['id'],'interface':util['format'](_0x4158('0x63'),_0x4158('0x64'),_0x32d03f[_0x4158('0x2c')]),'penalty':0x0,'paused':_0x32d03f[_0x4158('0x65')],'createdAt':_0x32d03f[_0x4158('0x66')],'updatedAt':_0x32d03f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4158('0x24')](respondWithFilteredResult(_0x8776b3,_0x3ee9f3))[_0x4158('0x49')](handleError(_0x8776b3,null));};exports[_0x4158('0x67')]=function(_0x2b8385,_0x38ca12,_0x3bd721){var _0x864bc={};var _0x3c4eb9={};var _0x2f3b64;var _0x4a244d;return db[_0x4158('0x2e')][_0x4158('0x58')]({'where':{'id':_0x2b8385[_0x4158('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38ca12,null))[_0x4158('0x24')](function(_0x551de0){if(_0x551de0){_0x2f3b64=_0x551de0;_0x3c4eb9[_0x4158('0x30')]=_['keys'](db['Team'][_0x4158('0x2f')]);_0x3c4eb9[_0x4158('0x32')]=_['keys'](_0x2b8385[_0x4158('0x32')]);_0x3c4eb9[_0x4158('0x3b')]=_[_0x4158('0x34')](_0x3c4eb9['model'],_0x3c4eb9[_0x4158('0x32')]);_0x864bc[_0x4158('0x35')]=_[_0x4158('0x34')](_0x3c4eb9[_0x4158('0x30')],qs[_0x4158('0x36')](_0x2b8385['query'][_0x4158('0x36')]));_0x864bc[_0x4158('0x35')]=_0x864bc[_0x4158('0x35')][_0x4158('0x37')]?_0x864bc[_0x4158('0x35')]:_0x3c4eb9[_0x4158('0x30')];_0x864bc[_0x4158('0x39')]=qs[_0x4158('0x5b')](_0x2b8385[_0x4158('0x32')][_0x4158('0x5b')]);_0x864bc['where']=qs[_0x4158('0x3b')](_[_0x4158('0x3c')](_0x2b8385[_0x4158('0x32')],_0x3c4eb9[_0x4158('0x3b')]));if(_0x2b8385[_0x4158('0x32')][_0x4158('0x41')]){_0x864bc['where']=_[_0x4158('0x40')](_0x864bc[_0x4158('0x3a')],{'$or':_[_0x4158('0x5d')](_0x864bc[_0x4158('0x35')],function(_0x30fef0){var _0x258dc0={};_0x258dc0[_0x30fef0]={'$like':'%'+_0x2b8385[_0x4158('0x32')][_0x4158('0x41')]+'%'};return _0x258dc0;})});}_0x864bc=_[_0x4158('0x40')]({},_0x864bc,_0x2b8385[_0x4158('0x46')]);return _0x2f3b64[_0x4158('0x67')](_0x864bc);}})[_0x4158('0x24')](function(_0xc27113){if(_0xc27113){_0x4a244d=_0xc27113[_0x4158('0x37')];if(!_0x2b8385['query'][_0x4158('0x5a')]('nolimit')){_0x864bc[_0x4158('0x1e')]=qs['limit'](_0x2b8385[_0x4158('0x32')]['limit']);_0x864bc[_0x4158('0x1d')]=qs[_0x4158('0x1d')](_0x2b8385[_0x4158('0x32')][_0x4158('0x1d')]);}return _0x2f3b64[_0x4158('0x67')](_0x864bc);}})[_0x4158('0x24')](function(_0x4fe6b8){if(_0x4fe6b8){return _0x4fe6b8?{'count':_0x4a244d,'rows':_0x4fe6b8}:null;}})[_0x4158('0x24')](respondWithResult(_0x38ca12,null))['catch'](handleError(_0x38ca12,null));};exports[_0x4158('0x68')]=function(_0x7650da,_0x5bb3e8,_0x272ad9){var _0x499010=[];var _0x148741;return db[_0x4158('0x69')][_0x4158('0x5e')]({'where':{'id':_0x7650da['body'][_0x4158('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4158('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x4158('0x24')](function(_0x4ca330){if(_0x4ca330){for(var _0x493d0a=0x0;_0x493d0a<_0x4ca330[_0x4158('0x37')];_0x493d0a+=0x1){for(var _0xdb191c=0x0;_0xdb191c<_0x4ca330[_0x493d0a][_0x4158('0x6b')][_0x4158('0x37')];_0xdb191c+=0x1){_0x499010=_[_0x4158('0x6c')](_0x499010,[_0x4ca330[_0x493d0a][_0x4158('0x6b')][_0xdb191c]['id']]);}}return _0x499010;}})[_0x4158('0x24')](function(_0x2279c0){if(_0x2279c0){return db[_0x4158('0x2e')][_0x4158('0x4d')]({'where':{'id':_0x7650da[_0x4158('0x4b')]['id']}});}})['then'](function(_0x45dd73){if(_0x45dd73){_0x148741=_0x45dd73;return _0x148741[_0x4158('0x6d')](_0x499010,{'penalty':_0x7650da[_0x4158('0x4f')][_0x4158('0x6e')]});}})[_0x4158('0x24')](function(_0x23024f){if(_0x23024f){return _0x148741[_0x4158('0x68')](_0x7650da[_0x4158('0x4f')][_0x4158('0x6a')]);}})[_0x4158('0x24')](handleEntityNotFound(_0x5bb3e8,null))[_0x4158('0x24')](respondWithStatusCode(_0x5bb3e8,null))[_0x4158('0x49')](handleError(_0x5bb3e8,null));};exports['removeTeams']=function(_0x25f95c,_0xbd2262,_0x320253){var _0x15323d=[];var _0x120349;return db[_0x4158('0x69')][_0x4158('0x5e')]({'where':{'id':_0x25f95c[_0x4158('0x32')][_0x4158('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x4158('0x5f')],'as':_0x4158('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x4158('0x24')](function(_0x585874){if(_0x585874){for(var _0x39f2b9=0x0;_0x39f2b9<_0x585874['length'];_0x39f2b9+=0x1){for(var _0x51f142=0x0;_0x51f142<_0x585874[_0x39f2b9][_0x4158('0x6b')]['length'];_0x51f142+=0x1){_0x15323d=_[_0x4158('0x6c')](_0x15323d,[_0x585874[_0x39f2b9][_0x4158('0x6b')][_0x51f142]['id']]);}}return _0x15323d;}})[_0x4158('0x24')](function(_0x39228b){if(_0x39228b){return db['SmsQueue'][_0x4158('0x4d')]({'where':{'id':_0x25f95c['params']['id']}});}})[_0x4158('0x24')](function(_0xc33106){if(_0xc33106){_0x120349=_0xc33106;return _0x120349[_0x4158('0x6f')](_0x15323d);}})['then'](function(_0x2a06f9){if(_0x120349){return _0x120349[_0x4158('0x70')](_0x25f95c[_0x4158('0x32')][_0x4158('0x6a')]);}})[_0x4158('0x24')](handleEntityNotFound(_0xbd2262,null))[_0x4158('0x24')](respondWithStatusCode(_0xbd2262,null))[_0x4158('0x49')](handleError(_0xbd2262,null));};exports[_0x4158('0x6d')]=function(_0x43e783,_0x42887d,_0x3fb9ef){return db[_0x4158('0x2e')]['find']({'where':{'id':_0x43e783[_0x4158('0x4b')]['id']}})[_0x4158('0x24')](handleEntityNotFound(_0x42887d,null))[_0x4158('0x24')](function(_0x104735){if(_0x104735){return _0x104735['addAgents'](_0x43e783[_0x4158('0x4f')][_0x4158('0x6a')],_['omit'](_0x43e783[_0x4158('0x4f')],[_0x4158('0x6a'),'id'])||{})[_0x4158('0x71')](function(_0x26432e){for(var _0x4bcebc=0x0;_0x4bcebc<_0x43e783['body'][_0x4158('0x6a')]['length'];_0x4bcebc+=0x1){socket[_0x4158('0x72')](_0x4158('0x73'),{'UserId':_0x43e783[_0x4158('0x4f')][_0x4158('0x6a')][_0x4bcebc],'SmsQueueId':_0x43e783[_0x4158('0x4b')]['id']});}return _0x26432e;});}})[_0x4158('0x24')](respondWithResult(_0x42887d,null))['catch'](handleError(_0x42887d,null));};exports[_0x4158('0x6f')]=function(_0x38f624,_0x330dae,_0x117efa){var _0x4ddfd9;return db[_0x4158('0x2e')]['find']({'where':{'id':_0x38f624[_0x4158('0x4b')]['id']}})[_0x4158('0x24')](handleEntityNotFound(_0x330dae,null))['then'](function(_0x1d8f44){if(_0x1d8f44){return _0x1d8f44[_0x4158('0x6f')](_0x38f624[_0x4158('0x32')][_0x4158('0x6a')])[_0x4158('0x24')](function(_0x105166){if(_['isArray'](_0x38f624[_0x4158('0x32')][_0x4158('0x6a')])){for(var _0x101c93=0x0;_0x101c93<_0x38f624[_0x4158('0x32')][_0x4158('0x6a')][_0x4158('0x37')];_0x101c93+=0x1){socket[_0x4158('0x72')](_0x4158('0x74'),{'UserId':_0x38f624[_0x4158('0x32')][_0x4158('0x6a')][_0x101c93],'SmsQueueId':_0x38f624['params']['id']});}}else{socket[_0x4158('0x72')](_0x4158('0x74'),{'UserId':_0x38f624[_0x4158('0x32')]['ids'],'SmsQueueId':_0x38f624[_0x4158('0x4b')]['id']});}});}})[_0x4158('0x24')](respondWithStatusCode(_0x330dae,null))[_0x4158('0x49')](handleError(_0x330dae,null));};exports['getAgents']=function(_0x16c242,_0x43ad2b,_0x4a4a00){var _0x32b2f8={};var _0x4037db={};var _0x3c02a5;var _0x30da5a;return db['SmsQueue']['findOne']({'where':{'id':_0x16c242['params']['id']}})[_0x4158('0x24')](handleEntityNotFound(_0x43ad2b,null))[_0x4158('0x24')](function(_0x4ab1cf){if(_0x4ab1cf){_0x3c02a5=_0x4ab1cf;_0x4037db['model']=_[_0x4158('0x31')](db['User'][_0x4158('0x2f')]);_0x4037db[_0x4158('0x32')]=_[_0x4158('0x31')](_0x16c242[_0x4158('0x32')]);_0x4037db[_0x4158('0x3b')]=_[_0x4158('0x34')](_0x4037db['model'],_0x4037db['query']);_0x32b2f8[_0x4158('0x35')]=_['intersection'](_0x4037db['model'],qs[_0x4158('0x36')](_0x16c242['query']['fields']));_0x32b2f8[_0x4158('0x35')]=_0x32b2f8[_0x4158('0x35')][_0x4158('0x37')]?_0x32b2f8[_0x4158('0x35')]:_0x4037db[_0x4158('0x30')];_0x32b2f8['order']=qs[_0x4158('0x5b')](_0x16c242[_0x4158('0x32')]['sort']);_0x32b2f8[_0x4158('0x3a')]=qs[_0x4158('0x3b')](_[_0x4158('0x3c')](_0x16c242['query'],_0x4037db[_0x4158('0x3b')]));if(_0x16c242[_0x4158('0x32')][_0x4158('0x41')]){_0x32b2f8[_0x4158('0x3a')]=_[_0x4158('0x40')](_0x32b2f8[_0x4158('0x3a')],{'$or':_['map'](_0x32b2f8[_0x4158('0x35')],function(_0x51152e){var _0xed0d05={};_0xed0d05[_0x51152e]={'$like':'%'+_0x16c242[_0x4158('0x32')][_0x4158('0x41')]+'%'};return _0xed0d05;})});}_0x32b2f8=_[_0x4158('0x40')]({},_0x32b2f8,_0x16c242[_0x4158('0x46')]);return _0x3c02a5['getAgents'](_0x32b2f8);}})[_0x4158('0x24')](function(_0x5013da){if(_0x5013da){_0x30da5a=_0x5013da[_0x4158('0x37')];if(!_0x16c242['query'][_0x4158('0x5a')](_0x4158('0x38'))){_0x32b2f8['limit']=qs['limit'](_0x16c242[_0x4158('0x32')][_0x4158('0x1e')]);_0x32b2f8[_0x4158('0x1d')]=qs[_0x4158('0x1d')](_0x16c242[_0x4158('0x32')][_0x4158('0x1d')]);}return _0x3c02a5[_0x4158('0x75')](_0x32b2f8);}})[_0x4158('0x24')](function(_0x5e2aae){if(_0x5e2aae){return _0x5e2aae?{'count':_0x30da5a,'rows':_0x5e2aae}:null;}})[_0x4158('0x24')](respondWithResult(_0x43ad2b,null))['catch'](handleError(_0x43ad2b,null));};
\ No newline at end of file
+var _0xc188=['getTeams','addTeams','ids','User','Agents','union','penalty','removeTeams','removeAgents','addAgents','omit','spread','emit','userSmsQueue:save','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','intersection','model','attributes','fields','hasOwnProperty','offset','sort','filters','add','day','merge','where','filter','map','type','field','options','SmsQueue','includeAll','include','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserSmsQueue','nolimit','order','SmsQueueId','findAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','Team','pick'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xc188,0x16c));var _0x8c18=function(_0x4a917d,_0x18c5fb){_0x4a917d=_0x4a917d-0x0;var _0x465333=_0xc188[_0x4a917d];return _0x465333;};'use strict';var pdf=require(_0x8c18('0x0'));var emlformat=require(_0x8c18('0x1'));var rimraf=require(_0x8c18('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c18('0x3'));var rp=require('request-promise');var moment=require(_0x8c18('0x4'));var BPromise=require(_0x8c18('0x5'));var Mustache=require(_0x8c18('0x6'));var util=require(_0x8c18('0x7'));var path=require('path');var sox=require(_0x8c18('0x8'));var csv=require('to-csv');var ejs=require(_0x8c18('0x9'));var fs=require('fs');var _=require(_0x8c18('0xa'));var squel=require(_0x8c18('0xb'));var crypto=require(_0x8c18('0xc'));var jsforce=require(_0x8c18('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8c18('0xe'));var querystring=require('querystring');var Papa=require(_0x8c18('0xf'));var Redis=require(_0x8c18('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x8c18('0x11'))(_0x8c18('0x12'));var utils=require(_0x8c18('0x13'));var config=require('../../config/environment');var db=require(_0x8c18('0x14'))['db'];config[_0x8c18('0x15')]=_[_0x8c18('0x16')](config[_0x8c18('0x15')],{'host':_0x8c18('0x17'),'port':0x18eb});var socket=require(_0x8c18('0x18'))(new Redis(config[_0x8c18('0x15')]));require(_0x8c18('0x19'))[_0x8c18('0x1a')](socket);function respondWithStatusCode(_0xd22f0c,_0x2f4b14){_0x2f4b14=_0x2f4b14||0xcc;return function(_0x4be7a8){if(_0x4be7a8){return _0xd22f0c[_0x8c18('0x1b')](_0x2f4b14);}return _0xd22f0c[_0x8c18('0x1c')](_0x2f4b14)[_0x8c18('0x1d')]();};}function respondWithResult(_0x279132,_0x34c6b8){_0x34c6b8=_0x34c6b8||0xc8;return function(_0x5a924b){if(_0x5a924b){return _0x279132['status'](_0x34c6b8)[_0x8c18('0x1e')](_0x5a924b);}};}function respondWithFilteredResult(_0x76bcb3,_0x43193e){return function(_0x4f5fb5){if(_0x4f5fb5){var _0x3fdf88=_0x4f5fb5[_0x8c18('0x1f')],_0x1b549d=_0x43193e['offset'],_0x333967=_0x43193e['offset']+_0x43193e[_0x8c18('0x20')],_0x2b8206;if(_0x333967>=_0x3fdf88){_0x333967=_0x3fdf88;_0x2b8206=0xc8;}else{_0x2b8206=0xce;}_0x76bcb3[_0x8c18('0x1c')](_0x2b8206);return _0x76bcb3[_0x8c18('0x21')](_0x8c18('0x22'),_0x1b549d+'-'+_0x333967+'/'+_0x3fdf88)[_0x8c18('0x1e')](_0x4f5fb5);}return null;};}function patchUpdates(_0x21bd08){return function(_0x4f7781){try{jsonpatch[_0x8c18('0x23')](_0x4f7781,_0x21bd08,!![]);}catch(_0x5b3a20){return BPromise[_0x8c18('0x24')](_0x5b3a20);}return _0x4f7781[_0x8c18('0x25')]();};}function saveUpdates(_0xd46770,_0x538079){return function(_0x22ec18){if(_0x22ec18){return _0x22ec18[_0x8c18('0x26')](_0xd46770)[_0x8c18('0x27')](function(_0x5438dc){return _0x5438dc;});}return null;};}function removeEntity(_0x5af5c9,_0x766253){return function(_0x8a4050){if(_0x8a4050){return _0x8a4050[_0x8c18('0x28')]()['then'](function(){var _0xf65d83=_0x8a4050[_0x8c18('0x29')]({'plain':!![]});var _0x5c9329=_0x8c18('0x2a');return db[_0x8c18('0x2b')][_0x8c18('0x28')]({'where':{'type':_0x5c9329,'resourceId':_0xf65d83['id']}})['then'](function(){return _0x8a4050;});})['then'](function(){_0x5af5c9['status'](0xcc)[_0x8c18('0x1d')]();});}};}function handleEntityNotFound(_0x5904b5,_0x47a9b8){return function(_0x353d67){if(!_0x353d67){_0x5904b5[_0x8c18('0x1b')](0x194);}return _0x353d67;};}function handleError(_0x383c31,_0x432f8b){_0x432f8b=_0x432f8b||0x1f4;return function(_0x1b34c2){logger[_0x8c18('0x2c')](_0x1b34c2['stack']);if(_0x1b34c2[_0x8c18('0x2d')]){delete _0x1b34c2[_0x8c18('0x2d')];}_0x383c31[_0x8c18('0x1c')](_0x432f8b)[_0x8c18('0x2e')](_0x1b34c2);};}exports[_0x8c18('0x2f')]=function(_0x53dc85,_0x1fd139){var _0x56f125={},_0x472ab6={},_0x5563c6={'count':0x0,'rows':[]};var _0x29a276=db['SmsQueue'][_0x8c18('0x30')];_0x472ab6['model']=_[_0x8c18('0x31')](_0x29a276);var _0x3c8424={'dateStart':_0x53dc85[_0x8c18('0x32')][_0x8c18('0x33')],'dateEnd':_0x53dc85[_0x8c18('0x32')][_0x8c18('0x34')]};delete _0x53dc85[_0x8c18('0x32')]['dateStart'];delete _0x53dc85[_0x8c18('0x32')][_0x8c18('0x34')];_0x472ab6[_0x8c18('0x32')]=_[_0x8c18('0x31')](_0x53dc85['query']);_0x472ab6['filters']=_[_0x8c18('0x35')](_0x472ab6[_0x8c18('0x36')],_0x472ab6[_0x8c18('0x32')]);_0x56f125[_0x8c18('0x37')]=_[_0x8c18('0x35')](_0x472ab6[_0x8c18('0x36')],qs[_0x8c18('0x38')](_0x53dc85['query']['fields']));_0x56f125[_0x8c18('0x37')]=_0x56f125[_0x8c18('0x37')]['length']?_0x56f125[_0x8c18('0x37')]:_0x472ab6[_0x8c18('0x36')];if(!_0x53dc85[_0x8c18('0x32')][_0x8c18('0x39')]('nolimit')){_0x56f125[_0x8c18('0x20')]=qs[_0x8c18('0x20')](_0x53dc85['query'][_0x8c18('0x20')]);_0x56f125[_0x8c18('0x3a')]=qs[_0x8c18('0x3a')](_0x53dc85[_0x8c18('0x32')]['offset']);}_0x56f125['order']=qs[_0x8c18('0x3b')](_0x53dc85[_0x8c18('0x32')][_0x8c18('0x3b')]);_0x56f125['where']=qs[_0x8c18('0x3c')](_['pick'](_0x53dc85['query'],_0x472ab6[_0x8c18('0x3c')]));if(_0x3c8424[_0x8c18('0x33')]){if(_0x3c8424[_0x8c18('0x34')]){_0x3c8424[_0x8c18('0x34')]=moment(_0x3c8424[_0x8c18('0x34')])[_0x8c18('0x3d')](0x1,_0x8c18('0x3e'));}else{_0x3c8424['dateEnd']=moment(_0x3c8424['dateStart'])[_0x8c18('0x3d')](0x1,_0x8c18('0x3e'));}_[_0x8c18('0x3f')](_0x56f125[_0x8c18('0x40')],{'createdAt':{'$gte':_0x3c8424['dateStart'],'$lte':_0x3c8424[_0x8c18('0x34')]}});}if(_0x53dc85[_0x8c18('0x32')][_0x8c18('0x41')]){_0x56f125[_0x8c18('0x40')]=_[_0x8c18('0x3f')](_0x56f125[_0x8c18('0x40')],{'$or':_[_0x8c18('0x42')](_0x29a276,function(_0x20b3d7){if(_0x20b3d7[_0x8c18('0x43')]['key']!=='VIRTUAL'){var _0xd6a00f={};_0xd6a00f[_0x20b3d7[_0x8c18('0x44')]]={'$like':'%'+_0x53dc85[_0x8c18('0x32')][_0x8c18('0x41')]+'%'};return _0xd6a00f;}})});}_0x56f125=_['merge']({},_0x56f125,_0x53dc85[_0x8c18('0x45')]);var _0x4d381a={'where':_0x56f125[_0x8c18('0x40')]};return db[_0x8c18('0x46')][_0x8c18('0x1f')](_0x4d381a)['then'](function(_0x46e53){_0x5563c6[_0x8c18('0x1f')]=_0x46e53;if(_0x53dc85[_0x8c18('0x32')][_0x8c18('0x47')]){_0x56f125[_0x8c18('0x48')]=[{'all':!![]}];}return db[_0x8c18('0x46')]['findAll'](_0x56f125);})[_0x8c18('0x27')](function(_0x5601b4){_0x5563c6['rows']=_0x5601b4;return _0x5563c6;})[_0x8c18('0x27')](respondWithFilteredResult(_0x1fd139,_0x56f125))['catch'](handleError(_0x1fd139,null));};exports['show']=function(_0x1a1563,_0x4987e6){var _0x2c47a2={'raw':!![],'where':{'id':_0x1a1563[_0x8c18('0x49')]['id']}},_0x23a96b={};_0x23a96b['model']=_[_0x8c18('0x31')](db[_0x8c18('0x46')][_0x8c18('0x30')]);_0x23a96b[_0x8c18('0x32')]=_['keys'](_0x1a1563[_0x8c18('0x32')]);_0x23a96b['filters']=_[_0x8c18('0x35')](_0x23a96b[_0x8c18('0x36')],_0x23a96b[_0x8c18('0x32')]);_0x2c47a2['attributes']=_[_0x8c18('0x35')](_0x23a96b['model'],qs[_0x8c18('0x38')](_0x1a1563[_0x8c18('0x32')][_0x8c18('0x38')]));_0x2c47a2[_0x8c18('0x37')]=_0x2c47a2[_0x8c18('0x37')][_0x8c18('0x4a')]?_0x2c47a2[_0x8c18('0x37')]:_0x23a96b[_0x8c18('0x36')];if(_0x1a1563['query'][_0x8c18('0x47')]){_0x2c47a2[_0x8c18('0x48')]=[{'all':!![]}];}_0x2c47a2=_[_0x8c18('0x3f')]({},_0x2c47a2,_0x1a1563['options']);return db[_0x8c18('0x46')][_0x8c18('0x4b')](_0x2c47a2)[_0x8c18('0x27')](handleEntityNotFound(_0x4987e6,null))['then'](respondWithResult(_0x4987e6,null))[_0x8c18('0x4c')](handleError(_0x4987e6,null));};exports['create']=function(_0xd61f0a,_0x5d1d81){return db[_0x8c18('0x46')][_0x8c18('0x4d')](_0xd61f0a['body'],{})[_0x8c18('0x27')](function(_0x3ac5ce){var _0x7bb5d0=_0xd61f0a[_0x8c18('0x4e')]['get']({'plain':!![]});if(!_0x7bb5d0)throw new Error(_0x8c18('0x4f'));if(_0x7bb5d0[_0x8c18('0x50')]===_0x8c18('0x4e')){var _0x25d51b=_0x3ac5ce['get']({'plain':!![]});var _0x3adf32='SmsQueues';return db['UserProfileSection'][_0x8c18('0x4b')]({'where':{'name':_0x3adf32,'userProfileId':_0x7bb5d0[_0x8c18('0x51')]},'raw':!![]})[_0x8c18('0x27')](function(_0x12aeac){if(_0x12aeac&&_0x12aeac['autoAssociation']===0x0){return db[_0x8c18('0x2b')]['create']({'name':_0x25d51b[_0x8c18('0x2d')],'resourceId':_0x25d51b['id'],'type':_0x12aeac['name'],'sectionId':_0x12aeac['id']},{})['then'](function(){return _0x3ac5ce;});}else{return _0x3ac5ce;}})[_0x8c18('0x4c')](function(_0x364de4){logger[_0x8c18('0x2c')](_0x8c18('0x52'),_0x364de4);throw _0x364de4;});}return _0x3ac5ce;})[_0x8c18('0x27')](respondWithResult(_0x5d1d81,0xc9))[_0x8c18('0x4c')](handleError(_0x5d1d81,null));};exports[_0x8c18('0x26')]=function(_0x583f61,_0x36b267){if(_0x583f61[_0x8c18('0x53')]['id']){delete _0x583f61[_0x8c18('0x53')]['id'];}return db[_0x8c18('0x46')]['find']({'where':{'id':_0x583f61[_0x8c18('0x49')]['id']}})[_0x8c18('0x27')](handleEntityNotFound(_0x36b267,null))[_0x8c18('0x27')](saveUpdates(_0x583f61['body'],null))[_0x8c18('0x27')](respondWithResult(_0x36b267,null))[_0x8c18('0x4c')](handleError(_0x36b267,null));};exports['destroy']=function(_0x2587fb,_0x242bf9){return db[_0x8c18('0x46')][_0x8c18('0x4b')]({'where':{'id':_0x2587fb[_0x8c18('0x49')]['id']}})[_0x8c18('0x27')](handleEntityNotFound(_0x242bf9,null))[_0x8c18('0x27')](removeEntity(_0x242bf9,null))[_0x8c18('0x4c')](handleError(_0x242bf9,null));};exports[_0x8c18('0x54')]=function(_0x47084a,_0x508d9a){return db[_0x8c18('0x46')][_0x8c18('0x54')]()[_0x8c18('0x27')](respondWithResult(_0x508d9a,null))[_0x8c18('0x4c')](handleError(_0x508d9a,null));};exports['getMembers']=function(_0x1e5ecc,_0x497a91,_0x3ea229){var _0x62eff4={'raw':!![],'where':{}},_0xfade5b={},_0x45c6e1;return db['SmsQueue'][_0x8c18('0x55')]({'where':{'id':_0x1e5ecc[_0x8c18('0x49')]['id']}})[_0x8c18('0x27')](handleEntityNotFound(_0x497a91,null))[_0x8c18('0x27')](function(_0x5886ec){if(_0x5886ec){_0x45c6e1=_0x5886ec[_0x8c18('0x29')]({'plain':!![]});_0xfade5b[_0x8c18('0x36')]=_[_0x8c18('0x31')](db[_0x8c18('0x56')]['rawAttributes']);_0xfade5b['query']=_[_0x8c18('0x31')](_0x1e5ecc[_0x8c18('0x32')]);_0xfade5b[_0x8c18('0x3c')]=_[_0x8c18('0x35')](_0xfade5b['model'],_0xfade5b[_0x8c18('0x32')]);_0x62eff4[_0x8c18('0x37')]=_[_0x8c18('0x35')](_0xfade5b[_0x8c18('0x36')],qs[_0x8c18('0x38')](_0x1e5ecc[_0x8c18('0x32')][_0x8c18('0x38')]));_0x62eff4[_0x8c18('0x37')]=_0x62eff4[_0x8c18('0x37')][_0x8c18('0x4a')]?_0x62eff4['attributes']:_0xfade5b['model'];if(!_0x1e5ecc[_0x8c18('0x32')][_0x8c18('0x39')](_0x8c18('0x57'))){_0x62eff4[_0x8c18('0x20')]=qs[_0x8c18('0x20')](_0x1e5ecc[_0x8c18('0x32')][_0x8c18('0x20')]);_0x62eff4[_0x8c18('0x3a')]=qs['offset'](_0x1e5ecc['query'][_0x8c18('0x3a')]);}_0x62eff4[_0x8c18('0x58')]=qs[_0x8c18('0x3b')](_0x1e5ecc[_0x8c18('0x32')][_0x8c18('0x3b')]);_0x62eff4[_0x8c18('0x40')]=qs[_0x8c18('0x3c')](_['pick'](_0x1e5ecc[_0x8c18('0x32')],_0xfade5b['filters']));_0x62eff4[_0x8c18('0x40')][_0x8c18('0x59')]=_0x5886ec['id'];if(_0x1e5ecc[_0x8c18('0x32')]['filter']){_0x62eff4[_0x8c18('0x40')]=_['merge'](_0x62eff4['where'],{'$or':_[_0x8c18('0x42')](_0x62eff4['attributes'],function(_0x5dfe3d){var _0x31a01c={};_0x31a01c[_0x5dfe3d]={'$like':'%'+_0x1e5ecc[_0x8c18('0x32')]['filter']+'%'};return _0x31a01c;})});}_0x62eff4=_[_0x8c18('0x3f')]({},_0x62eff4,_0x1e5ecc[_0x8c18('0x45')]);return db[_0x8c18('0x56')][_0x8c18('0x5a')](_0x62eff4);}})['then'](function(_0x209db8){if(_0x209db8){return db['User']['findAndCountAll']({'where':{'id':_[_0x8c18('0x42')](_0x209db8,_0x8c18('0x5b')),'role':_0x8c18('0x5c')},'attributes':['id','name',_0x8c18('0x5d'),_0x8c18('0x5e'),_0x8c18('0x5f')]});}})['then'](function(_0x326dca){if(_0x326dca){return{'count':_0x326dca[_0x8c18('0x1f')],'rows':_[_0x8c18('0x42')](_0x326dca[_0x8c18('0x60')],function(_0x12ff33){return{'membername':_0x12ff33[_0x8c18('0x2d')],'UserId':_0x12ff33['id'],'queue_name':_0x45c6e1[_0x8c18('0x2d')],'SmsQueueId':_0x45c6e1['id'],'interface':util[_0x8c18('0x61')]('%s/%s','SIP',_0x12ff33[_0x8c18('0x2d')]),'penalty':0x0,'paused':_0x12ff33[_0x8c18('0x5d')],'createdAt':_0x12ff33['createdAt'],'updatedAt':_0x12ff33[_0x8c18('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8c18('0x27')](respondWithFilteredResult(_0x497a91,_0x62eff4))[_0x8c18('0x4c')](handleError(_0x497a91,null));};exports['getTeams']=function(_0x2d6194,_0x2dbe80,_0x50c806){var _0x269330={};var _0xb16291={};var _0x20db73;var _0x246434;return db[_0x8c18('0x46')][_0x8c18('0x55')]({'where':{'id':_0x2d6194[_0x8c18('0x49')]['id']}})[_0x8c18('0x27')](handleEntityNotFound(_0x2dbe80,null))['then'](function(_0x4e381e){if(_0x4e381e){_0x20db73=_0x4e381e;_0xb16291[_0x8c18('0x36')]=_['keys'](db[_0x8c18('0x62')][_0x8c18('0x30')]);_0xb16291[_0x8c18('0x32')]=_[_0x8c18('0x31')](_0x2d6194[_0x8c18('0x32')]);_0xb16291[_0x8c18('0x3c')]=_[_0x8c18('0x35')](_0xb16291[_0x8c18('0x36')],_0xb16291[_0x8c18('0x32')]);_0x269330['attributes']=_[_0x8c18('0x35')](_0xb16291[_0x8c18('0x36')],qs[_0x8c18('0x38')](_0x2d6194[_0x8c18('0x32')]['fields']));_0x269330[_0x8c18('0x37')]=_0x269330[_0x8c18('0x37')]['length']?_0x269330[_0x8c18('0x37')]:_0xb16291[_0x8c18('0x36')];_0x269330[_0x8c18('0x58')]=qs[_0x8c18('0x3b')](_0x2d6194[_0x8c18('0x32')][_0x8c18('0x3b')]);_0x269330[_0x8c18('0x40')]=qs['filters'](_[_0x8c18('0x63')](_0x2d6194[_0x8c18('0x32')],_0xb16291['filters']));if(_0x2d6194['query'][_0x8c18('0x41')]){_0x269330[_0x8c18('0x40')]=_[_0x8c18('0x3f')](_0x269330[_0x8c18('0x40')],{'$or':_[_0x8c18('0x42')](_0x269330[_0x8c18('0x37')],function(_0x401cb1){var _0x252c37={};_0x252c37[_0x401cb1]={'$like':'%'+_0x2d6194[_0x8c18('0x32')][_0x8c18('0x41')]+'%'};return _0x252c37;})});}_0x269330=_[_0x8c18('0x3f')]({},_0x269330,_0x2d6194['options']);return _0x20db73[_0x8c18('0x64')](_0x269330);}})[_0x8c18('0x27')](function(_0x2fbc33){if(_0x2fbc33){_0x246434=_0x2fbc33[_0x8c18('0x4a')];if(!_0x2d6194[_0x8c18('0x32')][_0x8c18('0x39')](_0x8c18('0x57'))){_0x269330['limit']=qs[_0x8c18('0x20')](_0x2d6194['query']['limit']);_0x269330[_0x8c18('0x3a')]=qs[_0x8c18('0x3a')](_0x2d6194[_0x8c18('0x32')]['offset']);}return _0x20db73[_0x8c18('0x64')](_0x269330);}})[_0x8c18('0x27')](function(_0x278e61){if(_0x278e61){return _0x278e61?{'count':_0x246434,'rows':_0x278e61}:null;}})[_0x8c18('0x27')](respondWithResult(_0x2dbe80,null))[_0x8c18('0x4c')](handleError(_0x2dbe80,null));};exports[_0x8c18('0x65')]=function(_0x57eb69,_0x1d3ded,_0x121ce0){var _0x5832d1=[];var _0x13b2c4;return db[_0x8c18('0x62')][_0x8c18('0x5a')]({'where':{'id':_0x57eb69[_0x8c18('0x53')][_0x8c18('0x66')]},'attributes':['id'],'include':[{'model':db[_0x8c18('0x67')],'as':_0x8c18('0x68'),'attributes':['id'],'raw':!![]}]})[_0x8c18('0x27')](function(_0x501bb5){if(_0x501bb5){for(var _0xac96c8=0x0;_0xac96c8<_0x501bb5[_0x8c18('0x4a')];_0xac96c8+=0x1){for(var _0x5b1c7b=0x0;_0x5b1c7b<_0x501bb5[_0xac96c8][_0x8c18('0x68')][_0x8c18('0x4a')];_0x5b1c7b+=0x1){_0x5832d1=_[_0x8c18('0x69')](_0x5832d1,[_0x501bb5[_0xac96c8][_0x8c18('0x68')][_0x5b1c7b]['id']]);}}return _0x5832d1;}})[_0x8c18('0x27')](function(_0x33d8f8){if(_0x33d8f8){return db[_0x8c18('0x46')][_0x8c18('0x4b')]({'where':{'id':_0x57eb69[_0x8c18('0x49')]['id']}});}})[_0x8c18('0x27')](function(_0x51a443){if(_0x51a443){_0x13b2c4=_0x51a443;return _0x13b2c4['addAgents'](_0x5832d1,{'penalty':_0x57eb69[_0x8c18('0x53')][_0x8c18('0x6a')]});}})[_0x8c18('0x27')](function(_0x59ccfd){if(_0x59ccfd){return _0x13b2c4[_0x8c18('0x65')](_0x57eb69[_0x8c18('0x53')][_0x8c18('0x66')]);}})[_0x8c18('0x27')](handleEntityNotFound(_0x1d3ded,null))[_0x8c18('0x27')](respondWithStatusCode(_0x1d3ded,null))[_0x8c18('0x4c')](handleError(_0x1d3ded,null));};exports[_0x8c18('0x6b')]=function(_0x5a96cd,_0x17d1c0,_0x2782e9){var _0x2bbbb4=[];var _0x5125a7;return db[_0x8c18('0x62')]['findAll']({'where':{'id':_0x5a96cd[_0x8c18('0x32')][_0x8c18('0x66')]},'attributes':['id'],'include':[{'model':db[_0x8c18('0x67')],'as':_0x8c18('0x68'),'attributes':['id'],'raw':!![]}]})[_0x8c18('0x27')](function(_0x1b264d){if(_0x1b264d){for(var _0x3a9804=0x0;_0x3a9804<_0x1b264d[_0x8c18('0x4a')];_0x3a9804+=0x1){for(var _0x364e04=0x0;_0x364e04<_0x1b264d[_0x3a9804][_0x8c18('0x68')][_0x8c18('0x4a')];_0x364e04+=0x1){_0x2bbbb4=_[_0x8c18('0x69')](_0x2bbbb4,[_0x1b264d[_0x3a9804]['Agents'][_0x364e04]['id']]);}}return _0x2bbbb4;}})[_0x8c18('0x27')](function(_0xf4fb30){if(_0xf4fb30){return db['SmsQueue'][_0x8c18('0x4b')]({'where':{'id':_0x5a96cd[_0x8c18('0x49')]['id']}});}})[_0x8c18('0x27')](function(_0x401b1f){if(_0x401b1f){_0x5125a7=_0x401b1f;return _0x5125a7[_0x8c18('0x6c')](_0x2bbbb4);}})[_0x8c18('0x27')](function(_0x4229f8){if(_0x5125a7){return _0x5125a7[_0x8c18('0x6b')](_0x5a96cd[_0x8c18('0x32')][_0x8c18('0x66')]);}})['then'](handleEntityNotFound(_0x17d1c0,null))['then'](respondWithStatusCode(_0x17d1c0,null))[_0x8c18('0x4c')](handleError(_0x17d1c0,null));};exports[_0x8c18('0x6d')]=function(_0x375e3b,_0x464da6,_0x3b3ad2){return db[_0x8c18('0x46')][_0x8c18('0x4b')]({'where':{'id':_0x375e3b[_0x8c18('0x49')]['id']}})[_0x8c18('0x27')](handleEntityNotFound(_0x464da6,null))[_0x8c18('0x27')](function(_0x11cb4c){if(_0x11cb4c){return _0x11cb4c['addAgents'](_0x375e3b[_0x8c18('0x53')][_0x8c18('0x66')],_[_0x8c18('0x6e')](_0x375e3b[_0x8c18('0x53')],['ids','id'])||{})[_0x8c18('0x6f')](function(_0x2471f9){for(var _0x8ae2d8=0x0;_0x8ae2d8<_0x375e3b[_0x8c18('0x53')][_0x8c18('0x66')][_0x8c18('0x4a')];_0x8ae2d8+=0x1){socket[_0x8c18('0x70')](_0x8c18('0x71'),{'UserId':_0x375e3b[_0x8c18('0x53')]['ids'][_0x8ae2d8],'SmsQueueId':_0x375e3b['params']['id']});}return _0x2471f9;});}})[_0x8c18('0x27')](respondWithResult(_0x464da6,null))[_0x8c18('0x4c')](handleError(_0x464da6,null));};exports[_0x8c18('0x6c')]=function(_0x1b5b52,_0x53a455,_0x5983da){var _0x1b40b8;return db['SmsQueue']['find']({'where':{'id':_0x1b5b52[_0x8c18('0x49')]['id']}})['then'](handleEntityNotFound(_0x53a455,null))[_0x8c18('0x27')](function(_0x230940){if(_0x230940){return _0x230940[_0x8c18('0x6c')](_0x1b5b52[_0x8c18('0x32')][_0x8c18('0x66')])[_0x8c18('0x27')](function(_0x3904c3){if(_['isArray'](_0x1b5b52[_0x8c18('0x32')][_0x8c18('0x66')])){for(var _0x4638c0=0x0;_0x4638c0<_0x1b5b52[_0x8c18('0x32')][_0x8c18('0x66')]['length'];_0x4638c0+=0x1){socket[_0x8c18('0x70')](_0x8c18('0x72'),{'UserId':_0x1b5b52[_0x8c18('0x32')]['ids'][_0x4638c0],'SmsQueueId':_0x1b5b52[_0x8c18('0x49')]['id']});}}else{socket[_0x8c18('0x70')](_0x8c18('0x72'),{'UserId':_0x1b5b52[_0x8c18('0x32')]['ids'],'SmsQueueId':_0x1b5b52['params']['id']});}});}})[_0x8c18('0x27')](respondWithStatusCode(_0x53a455,null))[_0x8c18('0x4c')](handleError(_0x53a455,null));};exports[_0x8c18('0x73')]=function(_0xd1af47,_0x5adcf7,_0xd79ca6){var _0x782f72={};var _0x40abda={};var _0x2c0b1b;var _0x49a74a;return db['SmsQueue'][_0x8c18('0x55')]({'where':{'id':_0xd1af47[_0x8c18('0x49')]['id']}})['then'](handleEntityNotFound(_0x5adcf7,null))[_0x8c18('0x27')](function(_0x453e85){if(_0x453e85){_0x2c0b1b=_0x453e85;_0x40abda[_0x8c18('0x36')]=_['keys'](db[_0x8c18('0x67')][_0x8c18('0x30')]);_0x40abda[_0x8c18('0x32')]=_['keys'](_0xd1af47[_0x8c18('0x32')]);_0x40abda['filters']=_['intersection'](_0x40abda[_0x8c18('0x36')],_0x40abda['query']);_0x782f72[_0x8c18('0x37')]=_['intersection'](_0x40abda[_0x8c18('0x36')],qs[_0x8c18('0x38')](_0xd1af47[_0x8c18('0x32')][_0x8c18('0x38')]));_0x782f72[_0x8c18('0x37')]=_0x782f72['attributes']['length']?_0x782f72[_0x8c18('0x37')]:_0x40abda[_0x8c18('0x36')];_0x782f72[_0x8c18('0x58')]=qs[_0x8c18('0x3b')](_0xd1af47[_0x8c18('0x32')][_0x8c18('0x3b')]);_0x782f72[_0x8c18('0x40')]=qs[_0x8c18('0x3c')](_[_0x8c18('0x63')](_0xd1af47[_0x8c18('0x32')],_0x40abda['filters']));if(_0xd1af47[_0x8c18('0x32')][_0x8c18('0x41')]){_0x782f72[_0x8c18('0x40')]=_[_0x8c18('0x3f')](_0x782f72[_0x8c18('0x40')],{'$or':_[_0x8c18('0x42')](_0x782f72[_0x8c18('0x37')],function(_0x49a42b){var _0x3b3ce0={};_0x3b3ce0[_0x49a42b]={'$like':'%'+_0xd1af47[_0x8c18('0x32')][_0x8c18('0x41')]+'%'};return _0x3b3ce0;})});}_0x782f72=_[_0x8c18('0x3f')]({},_0x782f72,_0xd1af47[_0x8c18('0x45')]);return _0x2c0b1b[_0x8c18('0x73')](_0x782f72);}})['then'](function(_0x5bf1cb){if(_0x5bf1cb){_0x49a74a=_0x5bf1cb[_0x8c18('0x4a')];if(!_0xd1af47[_0x8c18('0x32')][_0x8c18('0x39')](_0x8c18('0x57'))){_0x782f72['limit']=qs[_0x8c18('0x20')](_0xd1af47[_0x8c18('0x32')][_0x8c18('0x20')]);_0x782f72['offset']=qs[_0x8c18('0x3a')](_0xd1af47[_0x8c18('0x32')][_0x8c18('0x3a')]);}return _0x2c0b1b['getAgents'](_0x782f72);}})['then'](function(_0x66dabe){if(_0x66dabe){return _0x66dabe?{'count':_0x49a74a,'rows':_0x66dabe}:null;}})[_0x8c18('0x27')](respondWithResult(_0x5adcf7,null))[_0x8c18('0x4c')](handleError(_0x5adcf7,null));};
\ No newline at end of file
index a702bba..5fe80b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x661a=['exports','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x661a,0xac));var _0xa661=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x661a[_0x30033a];return _0x5e3518;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0xa661('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa661('0x1')](0x0);var events={'afterCreate':_0xa661('0x2'),'afterUpdate':_0xa661('0x3'),'afterDestroy':_0xa661('0x4')};function emitEvent(_0x4f9c0f){return function(_0xe19bc5,_0x22a60c,_0x566330){SmsQueueEvents[_0xa661('0x5')](_0x4f9c0f+':'+_0xe19bc5['id'],_0xe19bc5);SmsQueueEvents[_0xa661('0x5')](_0x4f9c0f,_0xe19bc5);_0x566330(null);};}for(var e in events){if(events[_0xa661('0x6')](e)){var event=events[e];SmsQueue[_0xa661('0x7')](e,emitEvent(event));}}module[_0xa661('0x8')]=SmsQueueEvents;
\ No newline at end of file
+var _0x8457=['SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x5e76e9,_0x3f287c){var _0x9396c8=function(_0x5b0345){while(--_0x5b0345){_0x5e76e9['push'](_0x5e76e9['shift']());}};_0x9396c8(++_0x3f287c);}(_0x8457,0xbe));var _0x7845=function(_0x20d0af,_0xa3ad5b){_0x20d0af=_0x20d0af-0x0;var _0x523906=_0x8457[_0x20d0af];return _0x523906;};'use strict';var EventEmitter=require(_0x7845('0x0'));var SmsQueue=require(_0x7845('0x1'))['db'][_0x7845('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7845('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7845('0x4'),'afterDestroy':_0x7845('0x5')};function emitEvent(_0x5caa81){return function(_0x53fb1d,_0x8605df,_0x66dbd4){SmsQueueEvents[_0x7845('0x6')](_0x5caa81+':'+_0x53fb1d['id'],_0x53fb1d);SmsQueueEvents['emit'](_0x5caa81,_0x53fb1d);_0x66dbd4(null);};}for(var e in events){if(events[_0x7845('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index 4281553..569d6c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe74=['lodash','bluebird','request-promise','exports'];(function(_0x291139,_0x7f30de){var _0x3c42c0=function(_0x5832e3){while(--_0x5832e3){_0x291139['push'](_0x291139['shift']());}};_0x3c42c0(++_0x7f30de);}(_0xbe74,0x1cc));var _0x4be7=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xbe74[_0x2dc96f];return _0xd012da;};'use strict';var _=require(_0x4be7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4be7('0x1'));var rp=require(_0x4be7('0x2'));var attributes=require('./smsQueue.attributes');module[_0x4be7('0x3')]=function(_0x38e862,_0x1e1377){return _0x38e862['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf241=['request-promise','./smsQueue.attributes','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4c13ed,_0x23dd9e){var _0x3b9061=function(_0xd33d04){while(--_0xd33d04){_0x4c13ed['push'](_0x4c13ed['shift']());}};_0x3b9061(++_0x23dd9e);}(_0xf241,0xec));var _0x1f24=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf241[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1f24('0x0'));var util=require(_0x1f24('0x1'));var logger=require(_0x1f24('0x2'))(_0x1f24('0x3'));var moment=require(_0x1f24('0x4'));var BPromise=require(_0x1f24('0x5'));var rp=require(_0x1f24('0x6'));var attributes=require(_0x1f24('0x7'));module['exports']=function(_0xaef16f,_0x14c2f7){return _0xaef16f[_0x1f24('0x8')](_0x1f24('0x9'),attributes,{'tableName':_0x1f24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3a0ed3b..fa0c536 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd75=['SmsQueue,\x20%s,\x20%s','message','request\x20sent','catch','GetSmsQueue','findAll','options','where','attributes','limit','include','map','model','then','stringify','SmsQueue','find','raw','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x468975,_0x4e149d){var _0x471419=function(_0x56d719){while(--_0x56d719){_0x468975['push'](_0x468975['shift']());}};_0x471419(++_0x4e149d);}(_0xfd75,0x12b));var _0x5fd7=function(_0x372047,_0x7f5c2b){_0x372047=_0x372047-0x0;var _0x44f282=_0xfd75[_0x372047];return _0x44f282;};'use strict';var _=require(_0x5fd7('0x0'));var util=require(_0x5fd7('0x1'));var moment=require(_0x5fd7('0x2'));var BPromise=require(_0x5fd7('0x3'));var rs=require(_0x5fd7('0x4'));var fs=require('fs');var Redis=require(_0x5fd7('0x5'));var db=require(_0x5fd7('0x6'))['db'];var utils=require(_0x5fd7('0x7'));var logger=require('../../config/logger')(_0x5fd7('0x8'));var config=require('../../config/environment');var jayson=require(_0x5fd7('0x9'));var client=jayson[_0x5fd7('0xa')][_0x5fd7('0xb')]({'port':0x232a});config['redis']=_[_0x5fd7('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fd7('0xd')]));require(_0x5fd7('0xe'))[_0x5fd7('0xf')](socket);function respondWithRpcPromise(_0x1b0317,_0x38343e,_0x15306c){return new BPromise(function(_0x2c2bbc,_0x3733cb){return client[_0x5fd7('0x10')](_0x1b0317,_0x15306c)['then'](function(_0x95b3b2){logger[_0x5fd7('0x11')]('SmsQueue,\x20%s,\x20%s',_0x38343e,'request\x20sent');logger['debug'](_0x5fd7('0x12'),_0x38343e,'request\x20sent',JSON['stringify'](_0x95b3b2));if(_0x95b3b2[_0x5fd7('0x13')]){if(_0x95b3b2['error'][_0x5fd7('0x14')]===0x1f4){logger['error'](_0x5fd7('0x15'),_0x38343e,_0x95b3b2['error']['message']);return _0x3733cb(_0x95b3b2[_0x5fd7('0x13')][_0x5fd7('0x16')]);}logger[_0x5fd7('0x13')](_0x5fd7('0x15'),_0x38343e,_0x95b3b2['error'][_0x5fd7('0x16')]);return _0x2c2bbc(_0x95b3b2[_0x5fd7('0x13')][_0x5fd7('0x16')]);}else{logger[_0x5fd7('0x11')]('SmsQueue,\x20%s,\x20%s',_0x38343e,_0x5fd7('0x17'));_0x2c2bbc(_0x95b3b2['result'][_0x5fd7('0x16')]);}})[_0x5fd7('0x18')](function(_0x4d3f8f){logger[_0x5fd7('0x13')](_0x5fd7('0x15'),_0x38343e,_0x4d3f8f);_0x3733cb(_0x4d3f8f);});});}exports[_0x5fd7('0x19')]=function(_0x356df4){var _0x5b1131=this;return new Promise(function(_0x26e8ce,_0x290c46){return db['SmsQueue'][_0x5fd7('0x1a')]({'raw':_0x356df4[_0x5fd7('0x1b')]?_0x356df4[_0x5fd7('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x356df4[_0x5fd7('0x1b')]?_0x356df4[_0x5fd7('0x1b')][_0x5fd7('0x1c')]||null:null,'attributes':_0x356df4[_0x5fd7('0x1b')]?_0x356df4[_0x5fd7('0x1b')][_0x5fd7('0x1d')]||null:null,'limit':_0x356df4[_0x5fd7('0x1b')]?_0x356df4['options'][_0x5fd7('0x1e')]||null:null,'include':_0x356df4[_0x5fd7('0x1b')]?_0x356df4[_0x5fd7('0x1b')][_0x5fd7('0x1f')]?_[_0x5fd7('0x20')](_0x356df4[_0x5fd7('0x1b')][_0x5fd7('0x1f')],function(_0x5ad131){return{'model':db[_0x5ad131[_0x5fd7('0x21')]],'as':_0x5ad131['as'],'attributes':_0x5ad131[_0x5fd7('0x1d')],'include':_0x5ad131[_0x5fd7('0x1f')]?_[_0x5fd7('0x20')](_0x5ad131[_0x5fd7('0x1f')],function(_0x3379a7){return{'model':db[_0x3379a7[_0x5fd7('0x21')]],'as':_0x3379a7['as'],'attributes':_0x3379a7[_0x5fd7('0x1d')],'include':_0x3379a7[_0x5fd7('0x1f')]?_[_0x5fd7('0x20')](_0x3379a7[_0x5fd7('0x1f')],function(_0x5aaff0){return{'model':db[_0x5aaff0['model']],'as':_0x5aaff0['as'],'attributes':_0x5aaff0['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fd7('0x22')](function(_0x125fbe){logger[_0x5fd7('0x11')](_0x5fd7('0x19'),_0x356df4);logger['debug']('GetSmsQueue',_0x356df4,JSON[_0x5fd7('0x23')](_0x125fbe));_0x26e8ce(_0x125fbe);})[_0x5fd7('0x18')](function(_0x34c487){logger[_0x5fd7('0x13')](_0x5fd7('0x19'),_0x34c487[_0x5fd7('0x16')],_0x356df4);_0x290c46(_0x5b1131['error'](0x1f4,_0x34c487[_0x5fd7('0x16')]));});});};exports['ShowSmsQueue']=function(_0x1d0e90){var _0x4282d4=this;return new Promise(function(_0x99f0b8,_0x34fe04){return db[_0x5fd7('0x24')][_0x5fd7('0x25')]({'raw':_0x1d0e90['options']?_0x1d0e90[_0x5fd7('0x1b')][_0x5fd7('0x26')]===undefined?!![]:![]:!![],'where':_0x1d0e90[_0x5fd7('0x1b')]?_0x1d0e90['options']['where']||null:null,'attributes':_0x1d0e90[_0x5fd7('0x1b')]?_0x1d0e90[_0x5fd7('0x1b')][_0x5fd7('0x1d')]||null:null,'include':_0x1d0e90['options']?_0x1d0e90[_0x5fd7('0x1b')][_0x5fd7('0x1f')]?_['map'](_0x1d0e90[_0x5fd7('0x1b')][_0x5fd7('0x1f')],function(_0x29bae2){return{'model':db[_0x29bae2[_0x5fd7('0x21')]],'as':_0x29bae2['as'],'attributes':_0x29bae2[_0x5fd7('0x1d')],'include':_0x29bae2[_0x5fd7('0x1f')]?_[_0x5fd7('0x20')](_0x29bae2['include'],function(_0x260a1c){return{'model':db[_0x260a1c[_0x5fd7('0x21')]],'as':_0x260a1c['as'],'attributes':_0x260a1c[_0x5fd7('0x1d')],'include':_0x260a1c[_0x5fd7('0x1f')]?_[_0x5fd7('0x20')](_0x260a1c[_0x5fd7('0x1f')],function(_0x5aa414){return{'model':db[_0x5aa414['model']],'as':_0x5aa414['as'],'attributes':_0x5aa414['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x24857a){logger['info'](_0x5fd7('0x27'),_0x1d0e90);logger['debug'](_0x5fd7('0x27'),_0x1d0e90,JSON[_0x5fd7('0x23')](_0x24857a));_0x99f0b8(_0x24857a);})['catch'](function(_0x231f70){logger[_0x5fd7('0x13')]('ShowSmsQueue',_0x231f70[_0x5fd7('0x16')],_0x1d0e90);_0x34fe04(_0x4282d4[_0x5fd7('0x13')](0x1f4,_0x231f70['message']));});});};
\ No newline at end of file
+var _0xd8d0=['message','info','catch','SmsQueue','options','raw','attributes','include','map','model','GetSmsQueue','ShowSmsQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1562fc,_0x179fd3){var _0x301a5c=function(_0x523367){while(--_0x523367){_0x1562fc['push'](_0x1562fc['shift']());}};_0x301a5c(++_0x179fd3);}(_0xd8d0,0x80));var _0x0d8d=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xd8d0[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0x0d8d('0x0'));var util=require(_0x0d8d('0x1'));var moment=require(_0x0d8d('0x2'));var BPromise=require(_0x0d8d('0x3'));var rs=require(_0x0d8d('0x4'));var fs=require('fs');var Redis=require(_0x0d8d('0x5'));var db=require(_0x0d8d('0x6'))['db'];var utils=require(_0x0d8d('0x7'));var logger=require(_0x0d8d('0x8'))(_0x0d8d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8d('0xa')]['http']({'port':0x232a});config[_0x0d8d('0xb')]=_[_0x0d8d('0xc')](config[_0x0d8d('0xb')],{'host':_0x0d8d('0xd'),'port':0x18eb});var socket=require(_0x0d8d('0xe'))(new Redis(config['redis']));require(_0x0d8d('0xf'))['register'](socket);function respondWithRpcPromise(_0x230a24,_0x49e2e4,_0x5d36d9){return new BPromise(function(_0x457f88,_0xf48238){return client[_0x0d8d('0x10')](_0x230a24,_0x5d36d9)[_0x0d8d('0x11')](function(_0x28eadd){logger['info'](_0x0d8d('0x12'),_0x49e2e4,'request\x20sent');logger[_0x0d8d('0x13')](_0x0d8d('0x14'),_0x49e2e4,_0x0d8d('0x15'),JSON[_0x0d8d('0x16')](_0x28eadd));if(_0x28eadd[_0x0d8d('0x17')]){if(_0x28eadd[_0x0d8d('0x17')]['code']===0x1f4){logger[_0x0d8d('0x17')](_0x0d8d('0x12'),_0x49e2e4,_0x28eadd[_0x0d8d('0x17')][_0x0d8d('0x18')]);return _0xf48238(_0x28eadd['error'][_0x0d8d('0x18')]);}logger[_0x0d8d('0x17')]('SmsQueue,\x20%s,\x20%s',_0x49e2e4,_0x28eadd['error'][_0x0d8d('0x18')]);return _0x457f88(_0x28eadd[_0x0d8d('0x17')]['message']);}else{logger[_0x0d8d('0x19')](_0x0d8d('0x12'),_0x49e2e4,_0x0d8d('0x15'));_0x457f88(_0x28eadd['result'][_0x0d8d('0x18')]);}})[_0x0d8d('0x1a')](function(_0x3aebc5){logger[_0x0d8d('0x17')](_0x0d8d('0x12'),_0x49e2e4,_0x3aebc5);_0xf48238(_0x3aebc5);});});}exports['GetSmsQueue']=function(_0x2d931a){var _0x1f9f39=this;return new Promise(function(_0x58089e,_0x4dd696){return db[_0x0d8d('0x1b')]['findAll']({'raw':_0x2d931a[_0x0d8d('0x1c')]?_0x2d931a[_0x0d8d('0x1c')][_0x0d8d('0x1d')]===undefined?!![]:![]:!![],'where':_0x2d931a[_0x0d8d('0x1c')]?_0x2d931a['options']['where']||null:null,'attributes':_0x2d931a[_0x0d8d('0x1c')]?_0x2d931a[_0x0d8d('0x1c')][_0x0d8d('0x1e')]||null:null,'limit':_0x2d931a[_0x0d8d('0x1c')]?_0x2d931a[_0x0d8d('0x1c')]['limit']||null:null,'include':_0x2d931a[_0x0d8d('0x1c')]?_0x2d931a['options'][_0x0d8d('0x1f')]?_[_0x0d8d('0x20')](_0x2d931a[_0x0d8d('0x1c')][_0x0d8d('0x1f')],function(_0x29b13b){return{'model':db[_0x29b13b[_0x0d8d('0x21')]],'as':_0x29b13b['as'],'attributes':_0x29b13b[_0x0d8d('0x1e')],'include':_0x29b13b['include']?_[_0x0d8d('0x20')](_0x29b13b[_0x0d8d('0x1f')],function(_0x4b1faf){return{'model':db[_0x4b1faf[_0x0d8d('0x21')]],'as':_0x4b1faf['as'],'attributes':_0x4b1faf[_0x0d8d('0x1e')],'include':_0x4b1faf[_0x0d8d('0x1f')]?_[_0x0d8d('0x20')](_0x4b1faf[_0x0d8d('0x1f')],function(_0x274a05){return{'model':db[_0x274a05[_0x0d8d('0x21')]],'as':_0x274a05['as'],'attributes':_0x274a05['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d8d('0x11')](function(_0x188ceb){logger[_0x0d8d('0x19')](_0x0d8d('0x22'),_0x2d931a);logger[_0x0d8d('0x13')](_0x0d8d('0x22'),_0x2d931a,JSON[_0x0d8d('0x16')](_0x188ceb));_0x58089e(_0x188ceb);})[_0x0d8d('0x1a')](function(_0x293778){logger['error']('GetSmsQueue',_0x293778[_0x0d8d('0x18')],_0x2d931a);_0x4dd696(_0x1f9f39[_0x0d8d('0x17')](0x1f4,_0x293778[_0x0d8d('0x18')]));});});};exports[_0x0d8d('0x23')]=function(_0x59d49e){var _0x2299a3=this;return new Promise(function(_0x2bf927,_0x292cd9){return db[_0x0d8d('0x1b')][_0x0d8d('0x24')]({'raw':_0x59d49e[_0x0d8d('0x1c')]?_0x59d49e[_0x0d8d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x59d49e['options']?_0x59d49e[_0x0d8d('0x1c')][_0x0d8d('0x25')]||null:null,'attributes':_0x59d49e['options']?_0x59d49e[_0x0d8d('0x1c')]['attributes']||null:null,'include':_0x59d49e['options']?_0x59d49e[_0x0d8d('0x1c')][_0x0d8d('0x1f')]?_[_0x0d8d('0x20')](_0x59d49e['options'][_0x0d8d('0x1f')],function(_0xc8b5d8){return{'model':db[_0xc8b5d8[_0x0d8d('0x21')]],'as':_0xc8b5d8['as'],'attributes':_0xc8b5d8[_0x0d8d('0x1e')],'include':_0xc8b5d8['include']?_[_0x0d8d('0x20')](_0xc8b5d8[_0x0d8d('0x1f')],function(_0x27fcef){return{'model':db[_0x27fcef[_0x0d8d('0x21')]],'as':_0x27fcef['as'],'attributes':_0x27fcef[_0x0d8d('0x1e')],'include':_0x27fcef[_0x0d8d('0x1f')]?_[_0x0d8d('0x20')](_0x27fcef[_0x0d8d('0x1f')],function(_0x2f2eeb){return{'model':db[_0x2f2eeb[_0x0d8d('0x21')]],'as':_0x2f2eeb['as'],'attributes':_0x2f2eeb[_0x0d8d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d20ad){logger[_0x0d8d('0x19')](_0x0d8d('0x23'),_0x59d49e);logger[_0x0d8d('0x13')]('ShowSmsQueue',_0x59d49e,JSON[_0x0d8d('0x16')](_0x3d20ad));_0x2bf927(_0x3d20ad);})['catch'](function(_0x32d7c7){logger[_0x0d8d('0x17')](_0x0d8d('0x23'),_0x32d7c7[_0x0d8d('0x18')],_0x59d49e);_0x292cd9(_0x2299a3[_0x0d8d('0x17')](0x1f4,_0x32d7c7[_0x0d8d('0x18')]));});});};
\ No newline at end of file
index a737941..bd403cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fb4=['smsQueue:','save','remove','update','removeListener','register','length'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0x4fb4,0x190));var _0x44fb=function(_0x5a2801,_0x35263d){_0x5a2801=_0x5a2801-0x0;var _0x7ebb5b=_0x4fb4[_0x5a2801];return _0x7ebb5b;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x44fb('0x0'),_0x44fb('0x1'),_0x44fb('0x2')];function createListener(_0x29a2fe,_0x24e38d){return function(_0x42dbbb){_0x24e38d['emit'](_0x29a2fe,_0x42dbbb);};}function removeListener(_0xec6dce,_0x953327){return function(){SmsQueueEvents[_0x44fb('0x3')](_0xec6dce,_0x953327);};}exports[_0x44fb('0x4')]=function(_0x375d33){for(var _0x173e70=0x0,_0x464af5=events[_0x44fb('0x5')];_0x173e70<_0x464af5;_0x173e70++){var _0x59aa6d=events[_0x173e70];var _0x87f716=createListener(_0x44fb('0x6')+_0x59aa6d,_0x375d33);SmsQueueEvents['on'](_0x59aa6d,_0x87f716);}};
\ No newline at end of file
+var _0x63f2=['update','emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0x63f2,0x19b));var _0x263f=function(_0x59b759,_0x11e778){_0x59b759=_0x59b759-0x0;var _0x114c8d=_0x63f2[_0x59b759];return _0x114c8d;};'use strict';var SmsQueueEvents=require(_0x263f('0x0'));var events=[_0x263f('0x1'),_0x263f('0x2'),_0x263f('0x3')];function createListener(_0x158423,_0x390545){return function(_0x15660c){_0x390545[_0x263f('0x4')](_0x158423,_0x15660c);};}function removeListener(_0x3e39a0,_0x5926d1){return function(){SmsQueueEvents[_0x263f('0x5')](_0x3e39a0,_0x5926d1);};}exports[_0x263f('0x6')]=function(_0x4c13d7){for(var _0x4551c2=0x0,_0x2efa76=events[_0x263f('0x7')];_0x4551c2<_0x2efa76;_0x4551c2++){var _0x48ddcc=events[_0x4551c2];var _0x2d8236=createListener(_0x263f('0x8')+_0x48ddcc,_0x4c13d7);SmsQueueEvents['on'](_0x48ddcc,_0x2d8236);}};
\ No newline at end of file
index 77a9aa9..ec256db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26d1=['connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','path'];(function(_0x16b334,_0x58bd7f){var _0x54aff2=function(_0x366b0e){while(--_0x366b0e){_0x16b334['push'](_0x16b334['shift']());}};_0x54aff2(++_0x58bd7f);}(_0x26d1,0x8e));var _0x126d=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x26d1[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x126d('0x0'));var util=require('util');var path=require(_0x126d('0x1'));var timeout=require(_0x126d('0x2'));var express=require(_0x126d('0x3'));var router=express[_0x126d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x126d('0x5'));var controller=require('./smsQueueReport.controller');router[_0x126d('0x6')]('/',auth[_0x126d('0x7')](),controller[_0x126d('0x8')]);router[_0x126d('0x6')](_0x126d('0x9'),auth['isAuthenticated'](),controller[_0x126d('0xa')]);router[_0x126d('0x6')](_0x126d('0xb'),auth[_0x126d('0x7')](),controller[_0x126d('0xc')]);router[_0x126d('0xd')]('/',auth[_0x126d('0x7')](),controller['create']);router[_0x126d('0xe')](_0x126d('0xb'),auth[_0x126d('0x7')](),controller[_0x126d('0xf')]);router[_0x126d('0x10')]('/:id',auth[_0x126d('0x7')](),controller['destroy']);module[_0x126d('0x11')]=router;
\ No newline at end of file
+var _0xf494=['../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x39b7fd,_0x6370e1){var _0x29f9c7=function(_0x3f9adf){while(--_0x3f9adf){_0x39b7fd['push'](_0x39b7fd['shift']());}};_0x29f9c7(++_0x6370e1);}(_0xf494,0x1c6));var _0x4f49=function(_0x35cf38,_0x284f0e){_0x35cf38=_0x35cf38-0x0;var _0x3ca1bc=_0xf494[_0x35cf38];return _0x3ca1bc;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xb')]);router[_0x4f49('0x9')](_0x4f49('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x4f49('0x9')](_0x4f49('0xd'),auth[_0x4f49('0xa')](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')]('/:id',auth[_0x4f49('0xa')](),controller[_0x4f49('0x12')]);router['delete'](_0x4f49('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f49('0x13')]=router;
\ No newline at end of file
index 8f3addd..8b49da0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaa6=['exports','STRING','DATE','sequelize'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0xeaa6,0x153));var _0x6eaa=function(_0x3076a7,_0x4fe956){_0x3076a7=_0x3076a7-0x0;var _0x1f8f1a=_0xeaa6[_0x3076a7];return _0x1f8f1a;};'use strict';var moment=require('moment');var Sequelize=require(_0x6eaa('0x0'));module[_0x6eaa('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x6eaa('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6eaa('0x3')]},'acceptAt':{'type':Sequelize[_0x6eaa('0x3')]},'exitAt':{'type':Sequelize[_0x6eaa('0x3')]},'reason':{'type':Sequelize[_0x6eaa('0x2')]}};
\ No newline at end of file
+var _0x4445=['STRING','DATE','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4445,0x146));var _0x5444=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0x4445[_0x4be8ba];return _0x1af822;};'use strict';var moment=require('moment');var Sequelize=require(_0x5444('0x0'));module[_0x5444('0x1')]={'uniqueid':{'type':Sequelize[_0x5444('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5444('0x2')]},'joinAt':{'type':Sequelize[_0x5444('0x3')]},'leaveAt':{'type':Sequelize[_0x5444('0x3')]},'acceptAt':{'type':Sequelize[_0x5444('0x3')]},'exitAt':{'type':Sequelize[_0x5444('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index ac3c10e..bea6a4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7017=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','then','end','sendStatus','name','send','index','SmsQueueReport','model','query','dateEnd','dateStart','filters','attributes','fields','nolimit','order','sort','where','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','length','includeAll','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','squel','crypto'];(function(_0x2eccc6,_0x448168){var _0x5d12d4=function(_0x4ba26c){while(--_0x4ba26c){_0x2eccc6['push'](_0x2eccc6['shift']());}};_0x5d12d4(++_0x448168);}(_0x7017,0x8d));var _0x7701=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7017[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require(_0x7701('0x0'));var emlformat=require(_0x7701('0x1'));var rimraf=require(_0x7701('0x2'));var zipdir=require(_0x7701('0x3'));var jsonpatch=require(_0x7701('0x4'));var rp=require('request-promise');var moment=require(_0x7701('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7701('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7701('0x7'));var csv=require('to-csv');var ejs=require(_0x7701('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7701('0x9'));var crypto=require(_0x7701('0xa'));var jsforce=require(_0x7701('0xb'));var deskjs=require(_0x7701('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7701('0xd'));var Papa=require('papaparse');var Redis=require(_0x7701('0xe'));var qs=require(_0x7701('0xf'));var logger=require(_0x7701('0x10'))(_0x7701('0x11'));var utils=require(_0x7701('0x12'));var config=require(_0x7701('0x13'));var db=require(_0x7701('0x14'))['db'];function respondWithStatusCode(_0x3e7c70,_0x115d1a){_0x115d1a=_0x115d1a||0xcc;return function(_0x2f8039){if(_0x2f8039){return _0x3e7c70['sendStatus'](_0x115d1a);}return _0x3e7c70[_0x7701('0x15')](_0x115d1a)['end']();};}function respondWithResult(_0xaed348,_0x1b2186){_0x1b2186=_0x1b2186||0xc8;return function(_0x229f89){if(_0x229f89){return _0xaed348[_0x7701('0x15')](_0x1b2186)[_0x7701('0x16')](_0x229f89);}};}function respondWithFilteredResult(_0x451a15,_0x5ba0e6){return function(_0x175901){if(_0x175901){var _0x15e238=_0x175901[_0x7701('0x17')],_0x3ac53c=_0x5ba0e6[_0x7701('0x18')],_0x4e71e1=_0x5ba0e6[_0x7701('0x18')]+_0x5ba0e6[_0x7701('0x19')],_0x379a7b;if(_0x4e71e1>=_0x15e238){_0x4e71e1=_0x15e238;_0x379a7b=0xc8;}else{_0x379a7b=0xce;}_0x451a15['status'](_0x379a7b);return _0x451a15[_0x7701('0x1a')](_0x7701('0x1b'),_0x3ac53c+'-'+_0x4e71e1+'/'+_0x15e238)[_0x7701('0x16')](_0x175901);}return null;};}function patchUpdates(_0x29627e){return function(_0x16507d){try{jsonpatch['apply'](_0x16507d,_0x29627e,!![]);}catch(_0x23cbd5){return BPromise[_0x7701('0x1c')](_0x23cbd5);}return _0x16507d[_0x7701('0x1d')]();};}function saveUpdates(_0x5b1f8d,_0x50249f){return function(_0x38ff68){if(_0x38ff68){return _0x38ff68['update'](_0x5b1f8d)[_0x7701('0x1e')](function(_0x55cd18){return _0x55cd18;});}return null;};}function removeEntity(_0x2d1c20,_0x2c2464){return function(_0x329585){if(_0x329585){return _0x329585['destroy']()[_0x7701('0x1e')](function(){_0x2d1c20[_0x7701('0x15')](0xcc)[_0x7701('0x1f')]();});}};}function handleEntityNotFound(_0x7e9e3e,_0x3150d4){return function(_0x26da69){if(!_0x26da69){_0x7e9e3e[_0x7701('0x20')](0x194);}return _0x26da69;};}function handleError(_0x4c2916,_0x4c5c68){_0x4c5c68=_0x4c5c68||0x1f4;return function(_0x29d119){logger['error'](_0x29d119['stack']);if(_0x29d119[_0x7701('0x21')]){delete _0x29d119[_0x7701('0x21')];}_0x4c2916[_0x7701('0x15')](_0x4c5c68)[_0x7701('0x22')](_0x29d119);};}exports[_0x7701('0x23')]=function(_0x7a0283,_0x5c90d7){var _0x34dcb7={},_0x188871={},_0x29f164={'count':0x0,'rows':[]};var _0x5572dd=db[_0x7701('0x24')]['rawAttributes'];_0x188871[_0x7701('0x25')]=_['keys'](_0x5572dd);var _0x377ad0={'dateStart':_0x7a0283['query']['dateStart'],'dateEnd':_0x7a0283[_0x7701('0x26')][_0x7701('0x27')]};delete _0x7a0283['query'][_0x7701('0x28')];delete _0x7a0283[_0x7701('0x26')]['dateEnd'];_0x188871[_0x7701('0x26')]=_['keys'](_0x7a0283[_0x7701('0x26')]);_0x188871[_0x7701('0x29')]=_['intersection'](_0x188871[_0x7701('0x25')],_0x188871[_0x7701('0x26')]);_0x34dcb7[_0x7701('0x2a')]=_['intersection'](_0x188871[_0x7701('0x25')],qs[_0x7701('0x2b')](_0x7a0283['query']['fields']));_0x34dcb7[_0x7701('0x2a')]=_0x34dcb7[_0x7701('0x2a')]['length']?_0x34dcb7[_0x7701('0x2a')]:_0x188871[_0x7701('0x25')];if(!_0x7a0283[_0x7701('0x26')]['hasOwnProperty'](_0x7701('0x2c'))){_0x34dcb7[_0x7701('0x19')]=qs[_0x7701('0x19')](_0x7a0283['query'][_0x7701('0x19')]);_0x34dcb7[_0x7701('0x18')]=qs[_0x7701('0x18')](_0x7a0283[_0x7701('0x26')][_0x7701('0x18')]);}_0x34dcb7[_0x7701('0x2d')]=qs[_0x7701('0x2e')](_0x7a0283[_0x7701('0x26')]['sort']);_0x34dcb7[_0x7701('0x2f')]=qs[_0x7701('0x29')](_[_0x7701('0x30')](_0x7a0283['query'],_0x188871[_0x7701('0x29')]));if(_0x377ad0[_0x7701('0x28')]){if(_0x377ad0['dateEnd']){_0x377ad0['dateEnd']=moment(_0x377ad0[_0x7701('0x27')])[_0x7701('0x31')](0x1,_0x7701('0x32'));}else{_0x377ad0['dateEnd']=moment(_0x377ad0[_0x7701('0x28')])[_0x7701('0x31')](0x1,_0x7701('0x32'));}_[_0x7701('0x33')](_0x34dcb7[_0x7701('0x2f')],{'createdAt':{'$gte':_0x377ad0[_0x7701('0x28')],'$lte':_0x377ad0[_0x7701('0x27')]}});}if(_0x7a0283[_0x7701('0x26')][_0x7701('0x34')]){_0x34dcb7[_0x7701('0x2f')]=_[_0x7701('0x33')](_0x34dcb7[_0x7701('0x2f')],{'$or':_[_0x7701('0x35')](_0x5572dd,function(_0x2bd568){if(_0x2bd568[_0x7701('0x36')][_0x7701('0x37')]!==_0x7701('0x38')){var _0x3b8d8a={};_0x3b8d8a[_0x2bd568[_0x7701('0x39')]]={'$like':'%'+_0x7a0283[_0x7701('0x26')][_0x7701('0x34')]+'%'};return _0x3b8d8a;}})});}_0x34dcb7=_[_0x7701('0x33')]({},_0x34dcb7,_0x7a0283[_0x7701('0x3a')]);var _0x2ade07={'where':_0x34dcb7['where']};return db['SmsQueueReport']['count'](_0x2ade07)[_0x7701('0x1e')](function(_0x33e9fd){_0x29f164[_0x7701('0x17')]=_0x33e9fd;if(_0x7a0283[_0x7701('0x26')]['includeAll']){_0x34dcb7[_0x7701('0x3b')]=[{'all':!![]}];}return db[_0x7701('0x24')][_0x7701('0x3c')](_0x34dcb7);})[_0x7701('0x1e')](function(_0x2063aa){_0x29f164[_0x7701('0x3d')]=_0x2063aa;return _0x29f164;})[_0x7701('0x1e')](respondWithFilteredResult(_0x5c90d7,_0x34dcb7))[_0x7701('0x3e')](handleError(_0x5c90d7,null));};exports[_0x7701('0x3f')]=function(_0x194ccc,_0x743f84){var _0x249198={'raw':!![],'where':{'id':_0x194ccc[_0x7701('0x40')]['id']}},_0x4ac186={};_0x4ac186[_0x7701('0x25')]=_[_0x7701('0x41')](db[_0x7701('0x24')][_0x7701('0x42')]);_0x4ac186[_0x7701('0x26')]=_['keys'](_0x194ccc['query']);_0x4ac186['filters']=_['intersection'](_0x4ac186[_0x7701('0x25')],_0x4ac186[_0x7701('0x26')]);_0x249198[_0x7701('0x2a')]=_[_0x7701('0x43')](_0x4ac186[_0x7701('0x25')],qs[_0x7701('0x2b')](_0x194ccc[_0x7701('0x26')]['fields']));_0x249198[_0x7701('0x2a')]=_0x249198[_0x7701('0x2a')][_0x7701('0x44')]?_0x249198[_0x7701('0x2a')]:_0x4ac186[_0x7701('0x25')];if(_0x194ccc[_0x7701('0x26')][_0x7701('0x45')]){_0x249198[_0x7701('0x3b')]=[{'all':!![]}];}_0x249198=_[_0x7701('0x33')]({},_0x249198,_0x194ccc[_0x7701('0x3a')]);return db[_0x7701('0x24')][_0x7701('0x46')](_0x249198)[_0x7701('0x1e')](handleEntityNotFound(_0x743f84,null))[_0x7701('0x1e')](respondWithResult(_0x743f84,null))[_0x7701('0x3e')](handleError(_0x743f84,null));};exports[_0x7701('0x47')]=function(_0x2c7f6b,_0xfc07b2){return db[_0x7701('0x24')][_0x7701('0x47')](_0x2c7f6b[_0x7701('0x48')],{})[_0x7701('0x1e')](respondWithResult(_0xfc07b2,0xc9))['catch'](handleError(_0xfc07b2,null));};exports[_0x7701('0x49')]=function(_0xc755b2,_0x1b1bc3){if(_0xc755b2[_0x7701('0x48')]['id']){delete _0xc755b2['body']['id'];}return db[_0x7701('0x24')][_0x7701('0x46')]({'where':{'id':_0xc755b2[_0x7701('0x40')]['id']}})[_0x7701('0x1e')](handleEntityNotFound(_0x1b1bc3,null))[_0x7701('0x1e')](saveUpdates(_0xc755b2[_0x7701('0x48')],null))[_0x7701('0x1e')](respondWithResult(_0x1b1bc3,null))[_0x7701('0x3e')](handleError(_0x1b1bc3,null));};exports[_0x7701('0x4a')]=function(_0xd66d05,_0x4fe3ee){return db[_0x7701('0x24')][_0x7701('0x46')]({'where':{'id':_0xd66d05['params']['id']}})[_0x7701('0x1e')](handleEntityNotFound(_0x4fe3ee,null))[_0x7701('0x1e')](removeEntity(_0x4fe3ee,null))[_0x7701('0x3e')](handleError(_0x4fe3ee,null));};exports[_0x7701('0x4b')]=function(_0x4664c9,_0x3c67da){return db['SmsQueueReport'][_0x7701('0x4b')]()[_0x7701('0x1e')](respondWithResult(_0x3c67da,null))['catch'](handleError(_0x3c67da,null));};
\ No newline at end of file
+var _0x431f=['length','hasOwnProperty','order','sort','where','pick','dateStart','add','day','merge','map','type','VIRTUAL','field','filter','options','SmsQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','save','then','destroy','stack','name','send','index','rawAttributes','model','query','dateEnd','keys','filters','intersection','attributes','fields'];(function(_0x45ec0b,_0x260c5d){var _0x99a3d8=function(_0x524391){while(--_0x524391){_0x45ec0b['push'](_0x45ec0b['shift']());}};_0x99a3d8(++_0x260c5d);}(_0x431f,0x12c));var _0xf431=function(_0x175cde,_0x1cf2a7){_0x175cde=_0x175cde-0x0;var _0x34df53=_0x431f[_0x175cde];return _0x34df53;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf431('0x0'));var rimraf=require(_0xf431('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf431('0x2'));var rp=require('request-promise');var moment=require(_0xf431('0x3'));var BPromise=require(_0xf431('0x4'));var Mustache=require(_0xf431('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf431('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf431('0x7'));var squel=require(_0xf431('0x8'));var crypto=require(_0xf431('0x9'));var jsforce=require(_0xf431('0xa'));var deskjs=require(_0xf431('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf431('0xc'));var Papa=require(_0xf431('0xd'));var Redis=require(_0xf431('0xe'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf431('0xf'));var utils=require(_0xf431('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x233364,_0x3ceba5){_0x3ceba5=_0x3ceba5||0xcc;return function(_0x490f66){if(_0x490f66){return _0x233364[_0xf431('0x11')](_0x3ceba5);}return _0x233364['status'](_0x3ceba5)[_0xf431('0x12')]();};}function respondWithResult(_0x64105e,_0x4249ba){_0x4249ba=_0x4249ba||0xc8;return function(_0x43d90d){if(_0x43d90d){return _0x64105e[_0xf431('0x13')](_0x4249ba)[_0xf431('0x14')](_0x43d90d);}};}function respondWithFilteredResult(_0x5bbbb3,_0x4c926c){return function(_0x3f1cbb){if(_0x3f1cbb){var _0x59de1a=_0x3f1cbb[_0xf431('0x15')],_0x247803=_0x4c926c['offset'],_0x4b2f33=_0x4c926c[_0xf431('0x16')]+_0x4c926c[_0xf431('0x17')],_0x93b81d;if(_0x4b2f33>=_0x59de1a){_0x4b2f33=_0x59de1a;_0x93b81d=0xc8;}else{_0x93b81d=0xce;}_0x5bbbb3[_0xf431('0x13')](_0x93b81d);return _0x5bbbb3['set']('Content-Range',_0x247803+'-'+_0x4b2f33+'/'+_0x59de1a)[_0xf431('0x14')](_0x3f1cbb);}return null;};}function patchUpdates(_0x37645d){return function(_0x259d81){try{jsonpatch['apply'](_0x259d81,_0x37645d,!![]);}catch(_0x37baee){return BPromise['reject'](_0x37baee);}return _0x259d81[_0xf431('0x18')]();};}function saveUpdates(_0x214c7c,_0x590117){return function(_0x3e2c1e){if(_0x3e2c1e){return _0x3e2c1e['update'](_0x214c7c)[_0xf431('0x19')](function(_0x4f9c6e){return _0x4f9c6e;});}return null;};}function removeEntity(_0x19040c,_0x4cf6a7){return function(_0x48e4ad){if(_0x48e4ad){return _0x48e4ad[_0xf431('0x1a')]()['then'](function(){_0x19040c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x755157,_0x227f9e){return function(_0xbb9d22){if(!_0xbb9d22){_0x755157[_0xf431('0x11')](0x194);}return _0xbb9d22;};}function handleError(_0x1d5dfb,_0x591059){_0x591059=_0x591059||0x1f4;return function(_0x3bf744){logger['error'](_0x3bf744[_0xf431('0x1b')]);if(_0x3bf744[_0xf431('0x1c')]){delete _0x3bf744[_0xf431('0x1c')];}_0x1d5dfb[_0xf431('0x13')](_0x591059)[_0xf431('0x1d')](_0x3bf744);};}exports[_0xf431('0x1e')]=function(_0x43cd4d,_0x34c7ee){var _0x2f2476={},_0x1207d2={},_0x46ec29={'count':0x0,'rows':[]};var _0x50be2d=db['SmsQueueReport'][_0xf431('0x1f')];_0x1207d2[_0xf431('0x20')]=_['keys'](_0x50be2d);var _0x4ba3ea={'dateStart':_0x43cd4d[_0xf431('0x21')]['dateStart'],'dateEnd':_0x43cd4d[_0xf431('0x21')][_0xf431('0x22')]};delete _0x43cd4d[_0xf431('0x21')]['dateStart'];delete _0x43cd4d['query'][_0xf431('0x22')];_0x1207d2[_0xf431('0x21')]=_[_0xf431('0x23')](_0x43cd4d['query']);_0x1207d2[_0xf431('0x24')]=_[_0xf431('0x25')](_0x1207d2['model'],_0x1207d2[_0xf431('0x21')]);_0x2f2476[_0xf431('0x26')]=_[_0xf431('0x25')](_0x1207d2['model'],qs['fields'](_0x43cd4d['query'][_0xf431('0x27')]));_0x2f2476[_0xf431('0x26')]=_0x2f2476[_0xf431('0x26')][_0xf431('0x28')]?_0x2f2476['attributes']:_0x1207d2[_0xf431('0x20')];if(!_0x43cd4d[_0xf431('0x21')][_0xf431('0x29')]('nolimit')){_0x2f2476['limit']=qs[_0xf431('0x17')](_0x43cd4d[_0xf431('0x21')]['limit']);_0x2f2476[_0xf431('0x16')]=qs[_0xf431('0x16')](_0x43cd4d[_0xf431('0x21')][_0xf431('0x16')]);}_0x2f2476[_0xf431('0x2a')]=qs[_0xf431('0x2b')](_0x43cd4d[_0xf431('0x21')]['sort']);_0x2f2476[_0xf431('0x2c')]=qs[_0xf431('0x24')](_[_0xf431('0x2d')](_0x43cd4d[_0xf431('0x21')],_0x1207d2[_0xf431('0x24')]));if(_0x4ba3ea[_0xf431('0x2e')]){if(_0x4ba3ea[_0xf431('0x22')]){_0x4ba3ea[_0xf431('0x22')]=moment(_0x4ba3ea[_0xf431('0x22')])[_0xf431('0x2f')](0x1,_0xf431('0x30'));}else{_0x4ba3ea[_0xf431('0x22')]=moment(_0x4ba3ea[_0xf431('0x2e')])[_0xf431('0x2f')](0x1,_0xf431('0x30'));}_[_0xf431('0x31')](_0x2f2476[_0xf431('0x2c')],{'createdAt':{'$gte':_0x4ba3ea[_0xf431('0x2e')],'$lte':_0x4ba3ea[_0xf431('0x22')]}});}if(_0x43cd4d[_0xf431('0x21')]['filter']){_0x2f2476[_0xf431('0x2c')]=_['merge'](_0x2f2476[_0xf431('0x2c')],{'$or':_[_0xf431('0x32')](_0x50be2d,function(_0x1ea987){if(_0x1ea987[_0xf431('0x33')]['key']!==_0xf431('0x34')){var _0x295d87={};_0x295d87[_0x1ea987[_0xf431('0x35')]]={'$like':'%'+_0x43cd4d[_0xf431('0x21')][_0xf431('0x36')]+'%'};return _0x295d87;}})});}_0x2f2476=_['merge']({},_0x2f2476,_0x43cd4d[_0xf431('0x37')]);var _0x417920={'where':_0x2f2476[_0xf431('0x2c')]};return db[_0xf431('0x38')]['count'](_0x417920)[_0xf431('0x19')](function(_0x521ea0){_0x46ec29[_0xf431('0x15')]=_0x521ea0;if(_0x43cd4d[_0xf431('0x21')][_0xf431('0x39')]){_0x2f2476[_0xf431('0x3a')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xf431('0x3b')](_0x2f2476);})[_0xf431('0x19')](function(_0x52fbfe){_0x46ec29[_0xf431('0x3c')]=_0x52fbfe;return _0x46ec29;})[_0xf431('0x19')](respondWithFilteredResult(_0x34c7ee,_0x2f2476))[_0xf431('0x3d')](handleError(_0x34c7ee,null));};exports[_0xf431('0x3e')]=function(_0x4ea8d3,_0x1bed18){var _0x333c41={'raw':!![],'where':{'id':_0x4ea8d3[_0xf431('0x3f')]['id']}},_0x16d2df={};_0x16d2df[_0xf431('0x20')]=_[_0xf431('0x23')](db[_0xf431('0x38')][_0xf431('0x1f')]);_0x16d2df['query']=_[_0xf431('0x23')](_0x4ea8d3[_0xf431('0x21')]);_0x16d2df[_0xf431('0x24')]=_['intersection'](_0x16d2df[_0xf431('0x20')],_0x16d2df['query']);_0x333c41[_0xf431('0x26')]=_[_0xf431('0x25')](_0x16d2df[_0xf431('0x20')],qs['fields'](_0x4ea8d3[_0xf431('0x21')]['fields']));_0x333c41[_0xf431('0x26')]=_0x333c41[_0xf431('0x26')]['length']?_0x333c41[_0xf431('0x26')]:_0x16d2df[_0xf431('0x20')];if(_0x4ea8d3[_0xf431('0x21')]['includeAll']){_0x333c41[_0xf431('0x3a')]=[{'all':!![]}];}_0x333c41=_[_0xf431('0x31')]({},_0x333c41,_0x4ea8d3[_0xf431('0x37')]);return db[_0xf431('0x38')][_0xf431('0x40')](_0x333c41)['then'](handleEntityNotFound(_0x1bed18,null))[_0xf431('0x19')](respondWithResult(_0x1bed18,null))[_0xf431('0x3d')](handleError(_0x1bed18,null));};exports['create']=function(_0x28258f,_0x1fc3a){return db[_0xf431('0x38')][_0xf431('0x41')](_0x28258f[_0xf431('0x42')],{})['then'](respondWithResult(_0x1fc3a,0xc9))[_0xf431('0x3d')](handleError(_0x1fc3a,null));};exports['update']=function(_0x29a6e5,_0x12fbb8){if(_0x29a6e5[_0xf431('0x42')]['id']){delete _0x29a6e5['body']['id'];}return db['SmsQueueReport'][_0xf431('0x40')]({'where':{'id':_0x29a6e5[_0xf431('0x3f')]['id']}})[_0xf431('0x19')](handleEntityNotFound(_0x12fbb8,null))[_0xf431('0x19')](saveUpdates(_0x29a6e5[_0xf431('0x42')],null))[_0xf431('0x19')](respondWithResult(_0x12fbb8,null))[_0xf431('0x3d')](handleError(_0x12fbb8,null));};exports[_0xf431('0x1a')]=function(_0x240d89,_0x18b3d7){return db[_0xf431('0x38')][_0xf431('0x40')]({'where':{'id':_0x240d89['params']['id']}})[_0xf431('0x19')](handleEntityNotFound(_0x18b3d7,null))[_0xf431('0x19')](removeEntity(_0x18b3d7,null))[_0xf431('0x3d')](handleError(_0x18b3d7,null));};exports[_0xf431('0x43')]=function(_0x166fa1,_0x399770){return db[_0xf431('0x38')]['describe']()[_0xf431('0x19')](respondWithResult(_0x399770,null))[_0xf431('0x3d')](handleError(_0x399770,null));};
\ No newline at end of file
index f3f2373..87cf798 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x787c=['lodash','util','api','moment','bluebird','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue'];(function(_0x1fa64d,_0x143a50){var _0x35c45a=function(_0x359705){while(--_0x359705){_0x1fa64d['push'](_0x1fa64d['shift']());}};_0x35c45a(++_0x143a50);}(_0x787c,0xbe));var _0xc787=function(_0x17f1ef,_0xe6e333){_0x17f1ef=_0x17f1ef-0x0;var _0x1ddcf7=_0x787c[_0x17f1ef];return _0x1ddcf7;};'use strict';var _=require(_0xc787('0x0'));var util=require(_0xc787('0x1'));var logger=require('../../config/logger')(_0xc787('0x2'));var moment=require(_0xc787('0x3'));var BPromise=require(_0xc787('0x4'));var rp=require('request-promise');var attributes=require(_0xc787('0x5'));module[_0xc787('0x6')]=function(_0x32626d,_0xad016e){return _0x32626d[_0xc787('0x7')](_0xc787('0x8'),attributes,{'tableName':_0xc787('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b84=['api','moment','request-promise','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x121195,_0x2cd8b8){var _0x363aea=function(_0xa148f9){while(--_0xa148f9){_0x121195['push'](_0x121195['shift']());}};_0x363aea(++_0x2cd8b8);}(_0x5b84,0x106));var _0x45b8=function(_0x2ed9df,_0x505fe4){_0x2ed9df=_0x2ed9df-0x0;var _0x474f0d=_0x5b84[_0x2ed9df];return _0x474f0d;};'use strict';var _=require(_0x45b8('0x0'));var util=require(_0x45b8('0x1'));var logger=require('../../config/logger')(_0x45b8('0x2'));var moment=require(_0x45b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x45b8('0x4'));var attributes=require(_0x45b8('0x5'));module[_0x45b8('0x6')]=function(_0x32fa51,_0x4fcf56){return _0x32fa51[_0x45b8('0x7')](_0x45b8('0x8'),attributes,{'tableName':_0x45b8('0x9'),'paranoid':![],'indexes':[{'name':_0x45b8('0xa'),'fields':[_0x45b8('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index c753ebd..98b1af3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf35=['attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','raw','where'];(function(_0x544f46,_0x4ffa1a){var _0xfd7bb1=function(_0x1cb0a4){while(--_0x1cb0a4){_0x544f46['push'](_0x544f46['shift']());}};_0xfd7bb1(++_0x4ffa1a);}(_0xdf35,0x1c9));var _0x5df3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xdf35[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5df3('0x0'));var util=require(_0x5df3('0x1'));var moment=require(_0x5df3('0x2'));var BPromise=require('bluebird');var rs=require(_0x5df3('0x3'));var fs=require('fs');var Redis=require(_0x5df3('0x4'));var db=require(_0x5df3('0x5'))['db'];var utils=require(_0x5df3('0x6'));var logger=require(_0x5df3('0x7'))(_0x5df3('0x8'));var config=require('../../config/environment');var jayson=require(_0x5df3('0x9'));var client=jayson[_0x5df3('0xa')][_0x5df3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44567d,_0x1393dc,_0x39f112){return new BPromise(function(_0x3cb6a1,_0x3a3f9c){return client[_0x5df3('0xc')](_0x44567d,_0x39f112)[_0x5df3('0xd')](function(_0xe8b735){logger[_0x5df3('0xe')](_0x5df3('0xf'),_0x1393dc,'request\x20sent');logger[_0x5df3('0x10')](_0x5df3('0x11'),_0x1393dc,'request\x20sent',JSON[_0x5df3('0x12')](_0xe8b735));if(_0xe8b735['error']){if(_0xe8b735['error'][_0x5df3('0x13')]===0x1f4){logger[_0x5df3('0x14')](_0x5df3('0xf'),_0x1393dc,_0xe8b735[_0x5df3('0x14')][_0x5df3('0x15')]);return _0x3a3f9c(_0xe8b735[_0x5df3('0x14')]['message']);}logger[_0x5df3('0x14')](_0x5df3('0xf'),_0x1393dc,_0xe8b735[_0x5df3('0x14')][_0x5df3('0x15')]);return _0x3cb6a1(_0xe8b735['error'][_0x5df3('0x15')]);}else{logger[_0x5df3('0xe')](_0x5df3('0xf'),_0x1393dc,_0x5df3('0x16'));_0x3cb6a1(_0xe8b735[_0x5df3('0x17')][_0x5df3('0x15')]);}})[_0x5df3('0x18')](function(_0x560bec){logger['error'](_0x5df3('0xf'),_0x1393dc,_0x560bec);_0x3a3f9c(_0x560bec);});});}exports[_0x5df3('0x19')]=function(_0x12ba53){var _0x1972a2=this;return new Promise(function(_0x4d626a,_0x5b30ff){return db[_0x5df3('0x1a')][_0x5df3('0x1b')](_0x12ba53[_0x5df3('0x1c')],{'raw':_0x12ba53[_0x5df3('0x1d')]?_0x12ba53[_0x5df3('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x5df3('0xd')](function(_0x159335){logger['info']('CreateSmsQueueReport',_0x12ba53);logger[_0x5df3('0x10')](_0x5df3('0x19'),_0x12ba53,JSON[_0x5df3('0x12')](_0x159335));_0x4d626a(_0x159335);})[_0x5df3('0x18')](function(_0x3d753c){logger['error'](_0x5df3('0x19'),_0x3d753c[_0x5df3('0x15')],_0x12ba53);_0x5b30ff(_0x1972a2['error'](0x1f4,_0x3d753c[_0x5df3('0x15')]));});});};exports[_0x5df3('0x1e')]=function(_0x270c52){var _0x5a82db=this;return new Promise(function(_0x12dd36,_0x2086e2){return db['SmsQueueReport']['update'](_0x270c52[_0x5df3('0x1c')],{'raw':_0x270c52[_0x5df3('0x1d')]?_0x270c52['options'][_0x5df3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270c52[_0x5df3('0x1d')]?_0x270c52[_0x5df3('0x1d')][_0x5df3('0x20')]||null:null,'attributes':_0x270c52['options']?_0x270c52[_0x5df3('0x1d')][_0x5df3('0x21')]||null:null,'limit':_0x270c52[_0x5df3('0x1d')]?_0x270c52['options'][_0x5df3('0x22')]||null:null})[_0x5df3('0xd')](function(_0x574582){logger[_0x5df3('0xe')](_0x5df3('0x1e'),_0x270c52);logger[_0x5df3('0x10')](_0x5df3('0x1e'),_0x270c52,JSON['stringify'](_0x574582));_0x12dd36(_0x574582);})[_0x5df3('0x18')](function(_0x9e27d4){logger[_0x5df3('0x14')](_0x5df3('0x1e'),_0x9e27d4['message'],_0x270c52);_0x2086e2(_0x5a82db['error'](0x1f4,_0x9e27d4[_0x5df3('0x15')]));});});};
\ No newline at end of file
+var _0x5bc5=['catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','update','attributes','limit','then','UpdateSmsQueueReport','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5bc5,0x114));var _0x55bc=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x5bc5[_0x138d06];return _0x1a01eb;};'use strict';var _=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var moment=require(_0x55bc('0x2'));var BPromise=require(_0x55bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x55bc('0x5'));var logger=require(_0x55bc('0x6'))(_0x55bc('0x7'));var config=require('../../config/environment');var jayson=require(_0x55bc('0x8'));var client=jayson[_0x55bc('0x9')][_0x55bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd673db,_0x3065ab,_0x3a31f9){return new BPromise(function(_0x29ca4f,_0x363c63){return client[_0x55bc('0xb')](_0xd673db,_0x3a31f9)['then'](function(_0x3f65fe){logger[_0x55bc('0xc')](_0x55bc('0xd'),_0x3065ab,'request\x20sent');logger['debug'](_0x55bc('0xe'),_0x3065ab,_0x55bc('0xf'),JSON[_0x55bc('0x10')](_0x3f65fe));if(_0x3f65fe['error']){if(_0x3f65fe['error'][_0x55bc('0x11')]===0x1f4){logger[_0x55bc('0x12')](_0x55bc('0xd'),_0x3065ab,_0x3f65fe['error'][_0x55bc('0x13')]);return _0x363c63(_0x3f65fe['error'][_0x55bc('0x13')]);}logger['error'](_0x55bc('0xd'),_0x3065ab,_0x3f65fe[_0x55bc('0x12')][_0x55bc('0x13')]);return _0x29ca4f(_0x3f65fe[_0x55bc('0x12')][_0x55bc('0x13')]);}else{logger['info'](_0x55bc('0xd'),_0x3065ab,'request\x20sent');_0x29ca4f(_0x3f65fe[_0x55bc('0x14')][_0x55bc('0x13')]);}})[_0x55bc('0x15')](function(_0x4a8e84){logger[_0x55bc('0x12')](_0x55bc('0xd'),_0x3065ab,_0x4a8e84);_0x363c63(_0x4a8e84);});});}exports[_0x55bc('0x16')]=function(_0x4b578e){var _0x1f34a1=this;return new Promise(function(_0x341dc9,_0xbeff90){return db[_0x55bc('0x17')][_0x55bc('0x18')](_0x4b578e[_0x55bc('0x19')],{'raw':_0x4b578e[_0x55bc('0x1a')]?_0x4b578e[_0x55bc('0x1a')][_0x55bc('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2fb69){logger['info'](_0x55bc('0x16'),_0x4b578e);logger['debug'](_0x55bc('0x16'),_0x4b578e,JSON[_0x55bc('0x10')](_0x2fb69));_0x341dc9(_0x2fb69);})[_0x55bc('0x15')](function(_0x40d1e4){logger['error'](_0x55bc('0x16'),_0x40d1e4['message'],_0x4b578e);_0xbeff90(_0x1f34a1['error'](0x1f4,_0x40d1e4[_0x55bc('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x4b0c26){var _0x2fa8fa=this;return new Promise(function(_0x165238,_0x196f58){return db[_0x55bc('0x17')][_0x55bc('0x1c')](_0x4b0c26[_0x55bc('0x19')],{'raw':_0x4b0c26[_0x55bc('0x1a')]?_0x4b0c26[_0x55bc('0x1a')][_0x55bc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b0c26[_0x55bc('0x1a')]?_0x4b0c26[_0x55bc('0x1a')]['where']||null:null,'attributes':_0x4b0c26['options']?_0x4b0c26['options'][_0x55bc('0x1d')]||null:null,'limit':_0x4b0c26[_0x55bc('0x1a')]?_0x4b0c26[_0x55bc('0x1a')][_0x55bc('0x1e')]||null:null})[_0x55bc('0x1f')](function(_0x5b12cc){logger['info']('UpdateSmsQueueReport',_0x4b0c26);logger['debug']('UpdateSmsQueueReport',_0x4b0c26,JSON['stringify'](_0x5b12cc));_0x165238(_0x5b12cc);})[_0x55bc('0x15')](function(_0x3f35b1){logger[_0x55bc('0x12')](_0x55bc('0x20'),_0x3f35b1['message'],_0x4b0c26);_0x196f58(_0x2fa8fa[_0x55bc('0x12')](0x1f4,_0x3f35b1[_0x55bc('0x13')]));});});};
\ No newline at end of file
index 412fb75..00e4959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d6f=['show','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6d6f,0x16f));var _0xf6d6=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x6d6f[_0x402c8f];return _0x11e809;};'use strict';var multer=require(_0xf6d6('0x0'));var util=require('util');var path=require(_0xf6d6('0x1'));var timeout=require(_0xf6d6('0x2'));var express=require(_0xf6d6('0x3'));var router=express[_0xf6d6('0x4')]();var auth=require(_0xf6d6('0x5'));var interaction=require(_0xf6d6('0x6'));var config=require(_0xf6d6('0x7'));var controller=require(_0xf6d6('0x8'));router[_0xf6d6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6d6('0x9')]('/describe',auth[_0xf6d6('0xa')](),controller[_0xf6d6('0xb')]);router[_0xf6d6('0x9')](_0xf6d6('0xc'),auth[_0xf6d6('0xa')](),controller[_0xf6d6('0xd')]);router[_0xf6d6('0xe')]('/',auth[_0xf6d6('0xa')](),controller['create']);router[_0xf6d6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf6d6('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf6d6('0x11')]);module[_0xf6d6('0x12')]=router;
\ No newline at end of file
+var _0x6a3e=['delete','exports','util','path','connect-timeout','express','Router','../../config/environment','./smsTransferReport.controller','get','/describe','/:id','isAuthenticated','show','post','put'];(function(_0x3cc026,_0x44a688){var _0x17f773=function(_0x877fb2){while(--_0x877fb2){_0x3cc026['push'](_0x3cc026['shift']());}};_0x17f773(++_0x44a688);}(_0x6a3e,0x142));var _0xe6a3=function(_0x1ea49c,_0x5e1302){_0x1ea49c=_0x1ea49c-0x0;var _0x3f3646=_0x6a3e[_0x1ea49c];return _0x3f3646;};'use strict';var multer=require('multer');var util=require(_0xe6a3('0x0'));var path=require(_0xe6a3('0x1'));var timeout=require(_0xe6a3('0x2'));var express=require(_0xe6a3('0x3'));var router=express[_0xe6a3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe6a3('0x5'));var controller=require(_0xe6a3('0x6'));router[_0xe6a3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe6a3('0x7')](_0xe6a3('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xe6a3('0x7')](_0xe6a3('0x9'),auth[_0xe6a3('0xa')](),controller[_0xe6a3('0xb')]);router[_0xe6a3('0xc')]('/',auth[_0xe6a3('0xa')](),controller['create']);router[_0xe6a3('0xd')](_0xe6a3('0x9'),auth[_0xe6a3('0xa')](),controller['update']);router[_0xe6a3('0xe')](_0xe6a3('0x9'),auth[_0xe6a3('0xa')](),controller['destroy']);module[_0xe6a3('0xf')]=router;
\ No newline at end of file
index 3f79fde..9f37b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc07=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x3d0d1c,_0x3e3f1c){var _0x118969=function(_0x32b928){while(--_0x32b928){_0x3d0d1c['push'](_0x3d0d1c['shift']());}};_0x118969(++_0x3e3f1c);}(_0xcc07,0x1d5));var _0x7cc0=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0xcc07[_0x58ae8a];return _0x2f0b6b;};'use strict';var moment=require(_0x7cc0('0x0'));var Sequelize=require(_0x7cc0('0x1'));module[_0x7cc0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7cc0('0x3')](_0x7cc0('0x4'),_0x7cc0('0x5'),_0x7cc0('0x6')),'allowNull':![],'defaultValue':_0x7cc0('0x6')},'transferredAt':{'type':Sequelize[_0x7cc0('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x7cc0('0x8')]}};
\ No newline at end of file
+var _0x51b7=['exports','STRING','account','agent','queue','DATE','NOW','moment'];(function(_0x189c37,_0x32dd62){var _0x5cbe05=function(_0x568d05){while(--_0x568d05){_0x189c37['push'](_0x189c37['shift']());}};_0x5cbe05(++_0x32dd62);}(_0x51b7,0x13f));var _0x751b=function(_0xc47e79,_0x28a87a){_0xc47e79=_0xc47e79-0x0;var _0x237c85=_0x51b7[_0xc47e79];return _0x237c85;};'use strict';var moment=require(_0x751b('0x0'));var Sequelize=require('sequelize');module[_0x751b('0x1')]={'uniqueid':{'type':Sequelize[_0x751b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x751b('0x3'),_0x751b('0x4'),'queue'),'allowNull':![],'defaultValue':_0x751b('0x5')},'transferredAt':{'type':Sequelize[_0x751b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x751b('0x7')]}};
\ No newline at end of file
index 93c23ba..fd16c0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e2c=['then','destroy','sendStatus','error','stack','name','send','index','SmsTransferReport','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','add','merge','filter','type','key','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','end','status','json','count','offset','Content-Range','apply','reject','save','update'];(function(_0x56ffb4,_0x7c386a){var _0x14a736=function(_0x35003b){while(--_0x35003b){_0x56ffb4['push'](_0x56ffb4['shift']());}};_0x14a736(++_0x7c386a);}(_0x9e2c,0x70));var _0xc9e2=function(_0x4d31a4,_0x50adb1){_0x4d31a4=_0x4d31a4-0x0;var _0x1b16d9=_0x9e2c[_0x4d31a4];return _0x1b16d9;};'use strict';var pdf=require(_0xc9e2('0x0'));var emlformat=require(_0xc9e2('0x1'));var rimraf=require(_0xc9e2('0x2'));var zipdir=require(_0xc9e2('0x3'));var jsonpatch=require(_0xc9e2('0x4'));var rp=require(_0xc9e2('0x5'));var moment=require(_0xc9e2('0x6'));var BPromise=require(_0xc9e2('0x7'));var Mustache=require(_0xc9e2('0x8'));var util=require(_0xc9e2('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xc9e2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc9e2('0xb'));var squel=require(_0xc9e2('0xc'));var crypto=require(_0xc9e2('0xd'));var jsforce=require(_0xc9e2('0xe'));var deskjs=require(_0xc9e2('0xf'));var toCsv=require(_0xc9e2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc9e2('0x10'));var qs=require(_0xc9e2('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc9e2('0x12'));var db=require(_0xc9e2('0x13'))['db'];function respondWithStatusCode(_0x17f568,_0x1a15e0){_0x1a15e0=_0x1a15e0||0xcc;return function(_0x5de228){if(_0x5de228){return _0x17f568['sendStatus'](_0x1a15e0);}return _0x17f568['status'](_0x1a15e0)[_0xc9e2('0x14')]();};}function respondWithResult(_0x3791dc,_0x48d3a1){_0x48d3a1=_0x48d3a1||0xc8;return function(_0xdae38){if(_0xdae38){return _0x3791dc[_0xc9e2('0x15')](_0x48d3a1)[_0xc9e2('0x16')](_0xdae38);}};}function respondWithFilteredResult(_0x513496,_0x55abcd){return function(_0x283c08){if(_0x283c08){var _0x378fa1=_0x283c08[_0xc9e2('0x17')],_0x249057=_0x55abcd[_0xc9e2('0x18')],_0x4a0c99=_0x55abcd['offset']+_0x55abcd['limit'],_0x27887b;if(_0x4a0c99>=_0x378fa1){_0x4a0c99=_0x378fa1;_0x27887b=0xc8;}else{_0x27887b=0xce;}_0x513496[_0xc9e2('0x15')](_0x27887b);return _0x513496['set'](_0xc9e2('0x19'),_0x249057+'-'+_0x4a0c99+'/'+_0x378fa1)[_0xc9e2('0x16')](_0x283c08);}return null;};}function patchUpdates(_0x8673d0){return function(_0x3003e7){try{jsonpatch[_0xc9e2('0x1a')](_0x3003e7,_0x8673d0,!![]);}catch(_0x189762){return BPromise[_0xc9e2('0x1b')](_0x189762);}return _0x3003e7[_0xc9e2('0x1c')]();};}function saveUpdates(_0x206e36,_0x3738d8){return function(_0x549493){if(_0x549493){return _0x549493[_0xc9e2('0x1d')](_0x206e36)[_0xc9e2('0x1e')](function(_0x32c646){return _0x32c646;});}return null;};}function removeEntity(_0x212124,_0x5c7193){return function(_0x4fc38d){if(_0x4fc38d){return _0x4fc38d[_0xc9e2('0x1f')]()[_0xc9e2('0x1e')](function(){_0x212124['status'](0xcc)[_0xc9e2('0x14')]();});}};}function handleEntityNotFound(_0x59ef6c,_0x23c756){return function(_0x440bc9){if(!_0x440bc9){_0x59ef6c[_0xc9e2('0x20')](0x194);}return _0x440bc9;};}function handleError(_0x536838,_0x44c5ca){_0x44c5ca=_0x44c5ca||0x1f4;return function(_0x1e8f74){logger[_0xc9e2('0x21')](_0x1e8f74[_0xc9e2('0x22')]);if(_0x1e8f74[_0xc9e2('0x23')]){delete _0x1e8f74[_0xc9e2('0x23')];}_0x536838[_0xc9e2('0x15')](_0x44c5ca)[_0xc9e2('0x24')](_0x1e8f74);};}exports[_0xc9e2('0x25')]=function(_0x52ea2d,_0x376d4c){var _0x149aab={},_0x5933e6={},_0x56e84f={'count':0x0,'rows':[]};var _0x468db1=db[_0xc9e2('0x26')]['rawAttributes'];_0x5933e6[_0xc9e2('0x27')]=_[_0xc9e2('0x28')](_0x468db1);var _0x5d1ec1={'dateStart':_0x52ea2d[_0xc9e2('0x29')][_0xc9e2('0x2a')],'dateEnd':_0x52ea2d[_0xc9e2('0x29')][_0xc9e2('0x2b')]};delete _0x52ea2d[_0xc9e2('0x29')]['dateStart'];delete _0x52ea2d[_0xc9e2('0x29')]['dateEnd'];_0x5933e6[_0xc9e2('0x29')]=_[_0xc9e2('0x28')](_0x52ea2d[_0xc9e2('0x29')]);_0x5933e6[_0xc9e2('0x2c')]=_[_0xc9e2('0x2d')](_0x5933e6[_0xc9e2('0x27')],_0x5933e6[_0xc9e2('0x29')]);_0x149aab[_0xc9e2('0x2e')]=_['intersection'](_0x5933e6[_0xc9e2('0x27')],qs[_0xc9e2('0x2f')](_0x52ea2d['query'][_0xc9e2('0x2f')]));_0x149aab[_0xc9e2('0x2e')]=_0x149aab[_0xc9e2('0x2e')][_0xc9e2('0x30')]?_0x149aab[_0xc9e2('0x2e')]:_0x5933e6[_0xc9e2('0x27')];if(!_0x52ea2d[_0xc9e2('0x29')][_0xc9e2('0x31')]('nolimit')){_0x149aab[_0xc9e2('0x32')]=qs[_0xc9e2('0x32')](_0x52ea2d[_0xc9e2('0x29')]['limit']);_0x149aab[_0xc9e2('0x18')]=qs['offset'](_0x52ea2d['query']['offset']);}_0x149aab['order']=qs['sort'](_0x52ea2d[_0xc9e2('0x29')][_0xc9e2('0x33')]);_0x149aab[_0xc9e2('0x34')]=qs['filters'](_[_0xc9e2('0x35')](_0x52ea2d[_0xc9e2('0x29')],_0x5933e6[_0xc9e2('0x2c')]));if(_0x5d1ec1[_0xc9e2('0x2a')]){if(_0x5d1ec1[_0xc9e2('0x2b')]){_0x5d1ec1[_0xc9e2('0x2b')]=moment(_0x5d1ec1[_0xc9e2('0x2b')])[_0xc9e2('0x36')](0x1,'day');}else{_0x5d1ec1[_0xc9e2('0x2b')]=moment(_0x5d1ec1[_0xc9e2('0x2a')])[_0xc9e2('0x36')](0x1,'day');}_[_0xc9e2('0x37')](_0x149aab['where'],{'createdAt':{'$gte':_0x5d1ec1[_0xc9e2('0x2a')],'$lte':_0x5d1ec1[_0xc9e2('0x2b')]}});}if(_0x52ea2d[_0xc9e2('0x29')][_0xc9e2('0x38')]){_0x149aab[_0xc9e2('0x34')]=_[_0xc9e2('0x37')](_0x149aab[_0xc9e2('0x34')],{'$or':_['map'](_0x468db1,function(_0x3124f5){if(_0x3124f5[_0xc9e2('0x39')][_0xc9e2('0x3a')]!==_0xc9e2('0x3b')){var _0x579162={};_0x579162[_0x3124f5['field']]={'$like':'%'+_0x52ea2d[_0xc9e2('0x29')]['filter']+'%'};return _0x579162;}})});}_0x149aab=_[_0xc9e2('0x37')]({},_0x149aab,_0x52ea2d['options']);var _0x4429e1={'where':_0x149aab[_0xc9e2('0x34')]};return db['SmsTransferReport'][_0xc9e2('0x17')](_0x4429e1)['then'](function(_0x208b23){_0x56e84f[_0xc9e2('0x17')]=_0x208b23;if(_0x52ea2d[_0xc9e2('0x29')]['includeAll']){_0x149aab[_0xc9e2('0x3c')]=[{'all':!![]}];}return db[_0xc9e2('0x26')][_0xc9e2('0x3d')](_0x149aab);})['then'](function(_0x328607){_0x56e84f[_0xc9e2('0x3e')]=_0x328607;return _0x56e84f;})[_0xc9e2('0x1e')](respondWithFilteredResult(_0x376d4c,_0x149aab))[_0xc9e2('0x3f')](handleError(_0x376d4c,null));};exports[_0xc9e2('0x40')]=function(_0x139961,_0x4dc77f){var _0x2a6380={'raw':!![],'where':{'id':_0x139961[_0xc9e2('0x41')]['id']}},_0x42ef8a={};_0x42ef8a[_0xc9e2('0x27')]=_[_0xc9e2('0x28')](db[_0xc9e2('0x26')]['rawAttributes']);_0x42ef8a[_0xc9e2('0x29')]=_[_0xc9e2('0x28')](_0x139961[_0xc9e2('0x29')]);_0x42ef8a[_0xc9e2('0x2c')]=_[_0xc9e2('0x2d')](_0x42ef8a[_0xc9e2('0x27')],_0x42ef8a[_0xc9e2('0x29')]);_0x2a6380['attributes']=_[_0xc9e2('0x2d')](_0x42ef8a[_0xc9e2('0x27')],qs[_0xc9e2('0x2f')](_0x139961[_0xc9e2('0x29')][_0xc9e2('0x2f')]));_0x2a6380[_0xc9e2('0x2e')]=_0x2a6380[_0xc9e2('0x2e')][_0xc9e2('0x30')]?_0x2a6380[_0xc9e2('0x2e')]:_0x42ef8a[_0xc9e2('0x27')];if(_0x139961[_0xc9e2('0x29')][_0xc9e2('0x42')]){_0x2a6380[_0xc9e2('0x3c')]=[{'all':!![]}];}_0x2a6380=_[_0xc9e2('0x37')]({},_0x2a6380,_0x139961[_0xc9e2('0x43')]);return db[_0xc9e2('0x26')][_0xc9e2('0x44')](_0x2a6380)['then'](handleEntityNotFound(_0x4dc77f,null))[_0xc9e2('0x1e')](respondWithResult(_0x4dc77f,null))[_0xc9e2('0x3f')](handleError(_0x4dc77f,null));};exports['create']=function(_0x2e042c,_0x3c6a33){return db['SmsTransferReport'][_0xc9e2('0x45')](_0x2e042c[_0xc9e2('0x46')],{})[_0xc9e2('0x1e')](respondWithResult(_0x3c6a33,0xc9))[_0xc9e2('0x3f')](handleError(_0x3c6a33,null));};exports[_0xc9e2('0x1d')]=function(_0x368d1e,_0x19da82){if(_0x368d1e['body']['id']){delete _0x368d1e[_0xc9e2('0x46')]['id'];}return db[_0xc9e2('0x26')][_0xc9e2('0x44')]({'where':{'id':_0x368d1e['params']['id']}})[_0xc9e2('0x1e')](handleEntityNotFound(_0x19da82,null))[_0xc9e2('0x1e')](saveUpdates(_0x368d1e[_0xc9e2('0x46')],null))[_0xc9e2('0x1e')](respondWithResult(_0x19da82,null))[_0xc9e2('0x3f')](handleError(_0x19da82,null));};exports[_0xc9e2('0x1f')]=function(_0x5b6bc2,_0x18abbd){return db['SmsTransferReport']['find']({'where':{'id':_0x5b6bc2['params']['id']}})[_0xc9e2('0x1e')](handleEntityNotFound(_0x18abbd,null))['then'](removeEntity(_0x18abbd,null))[_0xc9e2('0x3f')](handleError(_0x18abbd,null));};exports['describe']=function(_0x27e19b,_0x560530){return db['SmsTransferReport']['describe']()['then'](respondWithResult(_0x560530,null))[_0xc9e2('0x3f')](handleError(_0x560530,null));};
\ No newline at end of file
+var _0x9851=['filter','map','type','key','VIRTUAL','options','SmsTransferReport','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','model','keys','query','dateStart','dateEnd','filters','attributes','fields','nolimit','order','sort','where','pick','add','day','merge'];(function(_0x374d13,_0x5f2d22){var _0x26f0e4=function(_0x29969c){while(--_0x29969c){_0x374d13['push'](_0x374d13['shift']());}};_0x26f0e4(++_0x5f2d22);}(_0x9851,0xf5));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x1985('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1985('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1985('0x2'));var rp=require(_0x1985('0x3'));var moment=require(_0x1985('0x4'));var BPromise=require(_0x1985('0x5'));var Mustache=require(_0x1985('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1985('0x7'));var csv=require(_0x1985('0x8'));var ejs=require(_0x1985('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1985('0xa'));var crypto=require('crypto');var jsforce=require(_0x1985('0xb'));var deskjs=require(_0x1985('0xc'));var toCsv=require(_0x1985('0x8'));var querystring=require(_0x1985('0xd'));var Papa=require(_0x1985('0xe'));var Redis=require(_0x1985('0xf'));var qs=require(_0x1985('0x10'));var logger=require(_0x1985('0x11'))('api');var utils=require(_0x1985('0x12'));var config=require('../../config/environment');var db=require(_0x1985('0x13'))['db'];function respondWithStatusCode(_0x4f9067,_0x4584eb){_0x4584eb=_0x4584eb||0xcc;return function(_0x24ebf3){if(_0x24ebf3){return _0x4f9067[_0x1985('0x14')](_0x4584eb);}return _0x4f9067[_0x1985('0x15')](_0x4584eb)[_0x1985('0x16')]();};}function respondWithResult(_0x27b76c,_0x27e860){_0x27e860=_0x27e860||0xc8;return function(_0x10a36f){if(_0x10a36f){return _0x27b76c['status'](_0x27e860)[_0x1985('0x17')](_0x10a36f);}};}function respondWithFilteredResult(_0x42f7f5,_0x53f583){return function(_0x52f511){if(_0x52f511){var _0x2017ae=_0x52f511[_0x1985('0x18')],_0x42296b=_0x53f583[_0x1985('0x19')],_0x4fec65=_0x53f583['offset']+_0x53f583[_0x1985('0x1a')],_0x5d217b;if(_0x4fec65>=_0x2017ae){_0x4fec65=_0x2017ae;_0x5d217b=0xc8;}else{_0x5d217b=0xce;}_0x42f7f5[_0x1985('0x15')](_0x5d217b);return _0x42f7f5[_0x1985('0x1b')](_0x1985('0x1c'),_0x42296b+'-'+_0x4fec65+'/'+_0x2017ae)[_0x1985('0x17')](_0x52f511);}return null;};}function patchUpdates(_0xba2e1a){return function(_0x56fab9){try{jsonpatch[_0x1985('0x1d')](_0x56fab9,_0xba2e1a,!![]);}catch(_0x47169a){return BPromise[_0x1985('0x1e')](_0x47169a);}return _0x56fab9['save']();};}function saveUpdates(_0x3100be,_0x2d0e45){return function(_0x33d1d8){if(_0x33d1d8){return _0x33d1d8[_0x1985('0x1f')](_0x3100be)[_0x1985('0x20')](function(_0x288dc6){return _0x288dc6;});}return null;};}function removeEntity(_0x10a933,_0x5ef8a8){return function(_0x15aa45){if(_0x15aa45){return _0x15aa45[_0x1985('0x21')]()[_0x1985('0x20')](function(){_0x10a933[_0x1985('0x15')](0xcc)[_0x1985('0x16')]();});}};}function handleEntityNotFound(_0x1b86a7,_0x419ed9){return function(_0xcd1358){if(!_0xcd1358){_0x1b86a7['sendStatus'](0x194);}return _0xcd1358;};}function handleError(_0x189eb5,_0x48f25f){_0x48f25f=_0x48f25f||0x1f4;return function(_0x3f2c8f){logger[_0x1985('0x22')](_0x3f2c8f[_0x1985('0x23')]);if(_0x3f2c8f[_0x1985('0x24')]){delete _0x3f2c8f[_0x1985('0x24')];}_0x189eb5[_0x1985('0x15')](_0x48f25f)[_0x1985('0x25')](_0x3f2c8f);};}exports[_0x1985('0x26')]=function(_0x507381,_0x49a2f8){var _0x43c827={},_0x447ad2={},_0x3f226d={'count':0x0,'rows':[]};var _0x249352=db['SmsTransferReport']['rawAttributes'];_0x447ad2[_0x1985('0x27')]=_[_0x1985('0x28')](_0x249352);var _0x5818b5={'dateStart':_0x507381[_0x1985('0x29')][_0x1985('0x2a')],'dateEnd':_0x507381[_0x1985('0x29')][_0x1985('0x2b')]};delete _0x507381[_0x1985('0x29')]['dateStart'];delete _0x507381['query'][_0x1985('0x2b')];_0x447ad2[_0x1985('0x29')]=_[_0x1985('0x28')](_0x507381[_0x1985('0x29')]);_0x447ad2[_0x1985('0x2c')]=_['intersection'](_0x447ad2[_0x1985('0x27')],_0x447ad2[_0x1985('0x29')]);_0x43c827[_0x1985('0x2d')]=_['intersection'](_0x447ad2[_0x1985('0x27')],qs['fields'](_0x507381[_0x1985('0x29')][_0x1985('0x2e')]));_0x43c827[_0x1985('0x2d')]=_0x43c827[_0x1985('0x2d')]['length']?_0x43c827[_0x1985('0x2d')]:_0x447ad2[_0x1985('0x27')];if(!_0x507381[_0x1985('0x29')]['hasOwnProperty'](_0x1985('0x2f'))){_0x43c827[_0x1985('0x1a')]=qs[_0x1985('0x1a')](_0x507381[_0x1985('0x29')][_0x1985('0x1a')]);_0x43c827[_0x1985('0x19')]=qs['offset'](_0x507381[_0x1985('0x29')][_0x1985('0x19')]);}_0x43c827[_0x1985('0x30')]=qs[_0x1985('0x31')](_0x507381['query'][_0x1985('0x31')]);_0x43c827[_0x1985('0x32')]=qs[_0x1985('0x2c')](_[_0x1985('0x33')](_0x507381[_0x1985('0x29')],_0x447ad2[_0x1985('0x2c')]));if(_0x5818b5[_0x1985('0x2a')]){if(_0x5818b5[_0x1985('0x2b')]){_0x5818b5['dateEnd']=moment(_0x5818b5['dateEnd'])[_0x1985('0x34')](0x1,_0x1985('0x35'));}else{_0x5818b5[_0x1985('0x2b')]=moment(_0x5818b5[_0x1985('0x2a')])[_0x1985('0x34')](0x1,'day');}_[_0x1985('0x36')](_0x43c827[_0x1985('0x32')],{'createdAt':{'$gte':_0x5818b5[_0x1985('0x2a')],'$lte':_0x5818b5[_0x1985('0x2b')]}});}if(_0x507381[_0x1985('0x29')][_0x1985('0x37')]){_0x43c827[_0x1985('0x32')]=_[_0x1985('0x36')](_0x43c827[_0x1985('0x32')],{'$or':_[_0x1985('0x38')](_0x249352,function(_0x8dfd71){if(_0x8dfd71[_0x1985('0x39')][_0x1985('0x3a')]!==_0x1985('0x3b')){var _0x27a108={};_0x27a108[_0x8dfd71['field']]={'$like':'%'+_0x507381[_0x1985('0x29')][_0x1985('0x37')]+'%'};return _0x27a108;}})});}_0x43c827=_[_0x1985('0x36')]({},_0x43c827,_0x507381[_0x1985('0x3c')]);var _0x3f7211={'where':_0x43c827['where']};return db[_0x1985('0x3d')][_0x1985('0x18')](_0x3f7211)[_0x1985('0x20')](function(_0x527097){_0x3f226d[_0x1985('0x18')]=_0x527097;if(_0x507381[_0x1985('0x29')][_0x1985('0x3e')]){_0x43c827[_0x1985('0x3f')]=[{'all':!![]}];}return db[_0x1985('0x3d')][_0x1985('0x40')](_0x43c827);})['then'](function(_0x38c5f4){_0x3f226d[_0x1985('0x41')]=_0x38c5f4;return _0x3f226d;})[_0x1985('0x20')](respondWithFilteredResult(_0x49a2f8,_0x43c827))['catch'](handleError(_0x49a2f8,null));};exports[_0x1985('0x42')]=function(_0x2b4d72,_0x2dcab7){var _0x255264={'raw':!![],'where':{'id':_0x2b4d72[_0x1985('0x43')]['id']}},_0x316b05={};_0x316b05[_0x1985('0x27')]=_[_0x1985('0x28')](db[_0x1985('0x3d')]['rawAttributes']);_0x316b05['query']=_[_0x1985('0x28')](_0x2b4d72[_0x1985('0x29')]);_0x316b05[_0x1985('0x2c')]=_[_0x1985('0x44')](_0x316b05[_0x1985('0x27')],_0x316b05['query']);_0x255264[_0x1985('0x2d')]=_[_0x1985('0x44')](_0x316b05[_0x1985('0x27')],qs[_0x1985('0x2e')](_0x2b4d72['query'][_0x1985('0x2e')]));_0x255264[_0x1985('0x2d')]=_0x255264[_0x1985('0x2d')][_0x1985('0x45')]?_0x255264[_0x1985('0x2d')]:_0x316b05[_0x1985('0x27')];if(_0x2b4d72[_0x1985('0x29')][_0x1985('0x3e')]){_0x255264[_0x1985('0x3f')]=[{'all':!![]}];}_0x255264=_[_0x1985('0x36')]({},_0x255264,_0x2b4d72[_0x1985('0x3c')]);return db['SmsTransferReport'][_0x1985('0x46')](_0x255264)[_0x1985('0x20')](handleEntityNotFound(_0x2dcab7,null))[_0x1985('0x20')](respondWithResult(_0x2dcab7,null))[_0x1985('0x47')](handleError(_0x2dcab7,null));};exports[_0x1985('0x48')]=function(_0x33d440,_0x5e37ad){return db['SmsTransferReport'][_0x1985('0x48')](_0x33d440[_0x1985('0x49')],{})[_0x1985('0x20')](respondWithResult(_0x5e37ad,0xc9))['catch'](handleError(_0x5e37ad,null));};exports[_0x1985('0x1f')]=function(_0x164fed,_0x376433){if(_0x164fed[_0x1985('0x49')]['id']){delete _0x164fed[_0x1985('0x49')]['id'];}return db[_0x1985('0x3d')][_0x1985('0x46')]({'where':{'id':_0x164fed[_0x1985('0x43')]['id']}})['then'](handleEntityNotFound(_0x376433,null))[_0x1985('0x20')](saveUpdates(_0x164fed[_0x1985('0x49')],null))[_0x1985('0x20')](respondWithResult(_0x376433,null))['catch'](handleError(_0x376433,null));};exports['destroy']=function(_0x177813,_0x5655fa){return db[_0x1985('0x3d')][_0x1985('0x46')]({'where':{'id':_0x177813['params']['id']}})[_0x1985('0x20')](handleEntityNotFound(_0x5655fa,null))[_0x1985('0x20')](removeEntity(_0x5655fa,null))['catch'](handleError(_0x5655fa,null));};exports['describe']=function(_0x4d8e67,_0x10195d){return db[_0x1985('0x3d')][_0x1985('0x4a')]()[_0x1985('0x20')](respondWithResult(_0x10195d,null))[_0x1985('0x47')](handleError(_0x10195d,null));};
\ No newline at end of file
index 55a600f..f462f2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb821=['../../config/logger','bluebird','exports','define','report_sms_transfer','uniqueid','util'];(function(_0x5e6bbd,_0x280bc4){var _0x2fabac=function(_0x5bb4d3){while(--_0x5bb4d3){_0x5e6bbd['push'](_0x5e6bbd['shift']());}};_0x2fabac(++_0x280bc4);}(_0xb821,0xa7));var _0x1b82=function(_0x1d679c,_0x250533){_0x1d679c=_0x1d679c-0x0;var _0x50bf67=_0xb821[_0x1d679c];return _0x50bf67;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var attributes=require('./smsTransferReport.attributes');module[_0x1b82('0x3')]=function(_0x1403ab,_0x3fadf0){return _0x1403ab[_0x1b82('0x4')]('SmsTransferReport',attributes,{'tableName':_0x1b82('0x5'),'paranoid':![],'indexes':[{'name':_0x1b82('0x6'),'fields':[_0x1b82('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdace=['../../config/logger','api','moment','request-promise','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x11c6b8,_0x5b2d7b){var _0x38b38f=function(_0x641ad0){while(--_0x641ad0){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x38b38f(++_0x5b2d7b);}(_0xdace,0xc5));var _0xedac=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0xdace[_0x21b359];return _0x57b8e7;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var attributes=require(_0xedac('0x5'));module[_0xedac('0x6')]=function(_0xefb142,_0x5a97c0){return _0xefb142[_0xedac('0x7')](_0xedac('0x8'),attributes,{'tableName':_0xedac('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xedac('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index aa64b16..6c72754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x793b=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0x793b,0x189));var _0xb793=function(_0x515c47,_0x3ec55c){_0x515c47=_0x515c47-0x0;var _0x62df5b=_0x793b[_0x515c47];return _0x62df5b;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require(_0xb793('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb793('0x5'))['db'];var utils=require(_0xb793('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb793('0x7'));var jayson=require(_0xb793('0x8'));var client=jayson[_0xb793('0x9')][_0xb793('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39f110,_0x42d0c7,_0x134ac4){return new BPromise(function(_0x23a718,_0x149720){return client[_0xb793('0xb')](_0x39f110,_0x134ac4)[_0xb793('0xc')](function(_0x22c9ea){logger[_0xb793('0xd')](_0xb793('0xe'),_0x42d0c7,'request\x20sent');logger[_0xb793('0xf')](_0xb793('0x10'),_0x42d0c7,'request\x20sent',JSON['stringify'](_0x22c9ea));if(_0x22c9ea[_0xb793('0x11')]){if(_0x22c9ea[_0xb793('0x11')]['code']===0x1f4){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea['error'][_0xb793('0x12')]);return _0x149720(_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);}logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x22c9ea[_0xb793('0x11')][_0xb793('0x12')]);return _0x23a718(_0x22c9ea['error'][_0xb793('0x12')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x42d0c7,_0xb793('0x13'));_0x23a718(_0x22c9ea[_0xb793('0x14')][_0xb793('0x12')]);}})[_0xb793('0x15')](function(_0x38d9f2){logger[_0xb793('0x11')](_0xb793('0xe'),_0x42d0c7,_0x38d9f2);_0x149720(_0x38d9f2);});});}
\ No newline at end of file
+var _0x49fe=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis'];(function(_0x480c2b,_0x70e451){var _0x497694=function(_0x5997){while(--_0x5997){_0x480c2b['push'](_0x480c2b['shift']());}};_0x497694(++_0x70e451);}(_0x49fe,0x75));var _0xe49f=function(_0xc1a9d5,_0x124c62){_0xc1a9d5=_0xc1a9d5-0x0;var _0x1b847b=_0x49fe[_0xc1a9d5];return _0x1b847b;};'use strict';var _=require(_0xe49f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe49f('0x1'));var fs=require('fs');var Redis=require(_0xe49f('0x2'));var db=require(_0xe49f('0x3'))['db'];var utils=require(_0xe49f('0x4'));var logger=require(_0xe49f('0x5'))(_0xe49f('0x6'));var config=require(_0xe49f('0x7'));var jayson=require(_0xe49f('0x8'));var client=jayson[_0xe49f('0x9')][_0xe49f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe0591c,_0x2a7c98,_0x6f1120){return new BPromise(function(_0x574f52,_0x306059){return client[_0xe49f('0xb')](_0xe0591c,_0x6f1120)['then'](function(_0x1eefb2){logger['info'](_0xe49f('0xc'),_0x2a7c98,_0xe49f('0xd'));logger['debug'](_0xe49f('0xe'),_0x2a7c98,_0xe49f('0xd'),JSON[_0xe49f('0xf')](_0x1eefb2));if(_0x1eefb2[_0xe49f('0x10')]){if(_0x1eefb2[_0xe49f('0x10')]['code']===0x1f4){logger[_0xe49f('0x10')](_0xe49f('0xc'),_0x2a7c98,_0x1eefb2['error'][_0xe49f('0x11')]);return _0x306059(_0x1eefb2[_0xe49f('0x10')][_0xe49f('0x11')]);}logger[_0xe49f('0x10')](_0xe49f('0xc'),_0x2a7c98,_0x1eefb2['error'][_0xe49f('0x11')]);return _0x574f52(_0x1eefb2[_0xe49f('0x10')]['message']);}else{logger['info'](_0xe49f('0xc'),_0x2a7c98,_0xe49f('0xd'));_0x574f52(_0x1eefb2[_0xe49f('0x12')][_0xe49f('0x11')]);}})[_0xe49f('0x13')](function(_0x35e3ed){logger['error'](_0xe49f('0xc'),_0x2a7c98,_0x35e3ed);_0x306059(_0x35e3ed);});});}
\ No newline at end of file
index 6c99837..a36555e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e7=['update','delete','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','root','originalname','replace','format','basename','extname','now','post','single','file'];(function(_0x4566db,_0x5da9a1){var _0x3167e6=function(_0x154ed8){while(--_0x154ed8){_0x4566db['push'](_0x4566db['shift']());}};_0x3167e6(++_0x5da9a1);}(_0x28e7,0xd6));var _0x728e=function(_0x4a34c7,_0x534015){_0x4a34c7=_0x4a34c7-0x0;var _0x2e5b10=_0x28e7[_0x4a34c7];return _0x2e5b10;};'use strict';var multer=require(_0x728e('0x0'));var util=require(_0x728e('0x1'));var path=require('path');var timeout=require(_0x728e('0x2'));var express=require(_0x728e('0x3'));var router=express[_0x728e('0x4')]();var auth=require(_0x728e('0x5'));var interaction=require(_0x728e('0x6'));var config=require(_0x728e('0x7'));var controller=require(_0x728e('0x8'));router[_0x728e('0x9')]('/',auth[_0x728e('0xa')](),controller[_0x728e('0xb')]);router[_0x728e('0x9')]('/:id',auth[_0x728e('0xa')](),controller[_0x728e('0xc')]);router[_0x728e('0x9')](_0x728e('0xd'),auth['isAuthenticated'](),controller[_0x728e('0xe')]);var upload=multer({'storage':multer[_0x728e('0xf')]({'destination':function(_0x9a574f,_0x48bed1,_0x1584c5){_0x1584c5(null,path['join'](config[_0x728e('0x10')],'server/files/sounds/original/'));},'filename':function(_0x4431f8,_0x1ff9e9,_0x407c40){_0x1ff9e9['originalname']=_0x1ff9e9[_0x728e('0x11')][_0x728e('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x407c40(null,util[_0x728e('0x13')]('%s-%s%s',path[_0x728e('0x14')](_0x1ff9e9[_0x728e('0x11')],path[_0x728e('0x15')](_0x1ff9e9['originalname'])),Date[_0x728e('0x16')](),path[_0x728e('0x15')](_0x1ff9e9[_0x728e('0x11')])));}})});router[_0x728e('0x17')]('/',upload[_0x728e('0x18')](_0x728e('0x19')),controller['create']);router['put']('/:id',auth[_0x728e('0xa')](),controller[_0x728e('0x1a')]);router[_0x728e('0x1b')](_0x728e('0x1c'),auth[_0x728e('0xa')](),controller[_0x728e('0x1b')]);module[_0x728e('0x1d')]=router;
\ No newline at end of file
+var _0x4ee7=['single','file','create','put','update','delete','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','/:id','show','isAuthenticated','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now'];(function(_0x1ba8f5,_0x534fae){var _0x5cf88c=function(_0x2f171f){while(--_0x2f171f){_0x1ba8f5['push'](_0x1ba8f5['shift']());}};_0x5cf88c(++_0x534fae);}(_0x4ee7,0x1aa));var _0x74ee=function(_0x253b67,_0x3019fd){_0x253b67=_0x253b67-0x0;var _0xb2c987=_0x4ee7[_0x253b67];return _0xb2c987;};'use strict';var multer=require(_0x74ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x74ee('0x1'));var express=require('express');var router=express[_0x74ee('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x74ee('0x3'));var config=require(_0x74ee('0x4'));var controller=require(_0x74ee('0x5'));router[_0x74ee('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x74ee('0x7'),auth['isAuthenticated'](),controller[_0x74ee('0x8')]);router['get']('/:id/download',auth[_0x74ee('0x9')](),controller[_0x74ee('0xa')]);var upload=multer({'storage':multer[_0x74ee('0xb')]({'destination':function(_0x2155db,_0x16bf88,_0x54d717){_0x54d717(null,path[_0x74ee('0xc')](config[_0x74ee('0xd')],_0x74ee('0xe')));},'filename':function(_0x5d1f4a,_0x219acd,_0x31b433){_0x219acd[_0x74ee('0xf')]=_0x219acd['originalname'][_0x74ee('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x31b433(null,util[_0x74ee('0x11')](_0x74ee('0x12'),path[_0x74ee('0x13')](_0x219acd[_0x74ee('0xf')],path[_0x74ee('0x14')](_0x219acd[_0x74ee('0xf')])),Date[_0x74ee('0x15')](),path[_0x74ee('0x14')](_0x219acd[_0x74ee('0xf')])));}})});router['post']('/',upload[_0x74ee('0x16')](_0x74ee('0x17')),controller[_0x74ee('0x18')]);router[_0x74ee('0x19')](_0x74ee('0x7'),auth['isAuthenticated'](),controller[_0x74ee('0x1a')]);router[_0x74ee('0x1b')]('/:id',auth[_0x74ee('0x9')](),controller[_0x74ee('0x1b')]);module['exports']=router;
\ No newline at end of file
index 48e649e..dd85f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7039=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x5e3631,_0x53c480){var _0x43c03a=function(_0x292014){while(--_0x292014){_0x5e3631['push'](_0x5e3631['shift']());}};_0x43c03a(++_0x53c480);}(_0x7039,0x16b));var _0x9703=function(_0x190697,_0x29ba9d){_0x190697=_0x190697-0x0;var _0x15309c=_0x7039[_0x190697];return _0x15309c;};'use strict';var Sequelize=require(_0x9703('0x0'));module[_0x9703('0x1')]={'name':{'type':Sequelize[_0x9703('0x2')],'unique':_0x9703('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x9703('0x4')]},'original_sampleCount':{'type':Sequelize[_0x9703('0x5')]},'original_channelCount':{'type':Sequelize[_0x9703('0x6')]},'original_bitRate':{'type':Sequelize[_0x9703('0x5')]},'original_sampleRate':{'type':Sequelize[_0x9703('0x6')]},'converted_format':{'type':Sequelize[_0x9703('0x2')]},'converted_duration':{'type':Sequelize[_0x9703('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x9703('0x5')]},'converted_channelCount':{'type':Sequelize[_0x9703('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x9703('0x6')]}};
\ No newline at end of file
+var _0x4436=['INTEGER','FLOAT','sequelize','exports','STRING','BIGINT'];(function(_0x5d6249,_0x178ca1){var _0x1bceb6=function(_0x4b2841){while(--_0x4b2841){_0x5d6249['push'](_0x5d6249['shift']());}};_0x1bceb6(++_0x178ca1);}(_0x4436,0x9e));var _0x6443=function(_0x3c8da4,_0x468b52){_0x3c8da4=_0x3c8da4-0x0;var _0x889c98=_0x4436[_0x3c8da4];return _0x889c98;};'use strict';var Sequelize=require(_0x6443('0x0'));module[_0x6443('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x6443('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x6443('0x2')]},'original_format':{'type':Sequelize[_0x6443('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x6443('0x3')]},'original_channelCount':{'type':Sequelize[_0x6443('0x4')]},'original_bitRate':{'type':Sequelize[_0x6443('0x3')]},'original_sampleRate':{'type':Sequelize[_0x6443('0x4')]},'converted_format':{'type':Sequelize[_0x6443('0x2')]},'converted_duration':{'type':Sequelize[_0x6443('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x6443('0x3')]},'converted_channelCount':{'type':Sequelize[_0x6443('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index ac725f2..418d6fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','description','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','Sound','rawAttributes','query','dateStart','dateEnd','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','type','field','findAll','catch','show','keys','fields','length','includeAll','find','download','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','root','format','%s.%s','create','basename','file','originalname','extname','filename','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','wav','unlinkSync','src'];(function(_0x5e3388,_0x4c9dab){var _0x325ee3=function(_0x505d4d){while(--_0x505d4d){_0x5e3388['push'](_0x5e3388['shift']());}};_0x325ee3(++_0x4c9dab);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 qs=require(_0x7995('0x13'));var logger=require(_0x7995('0x14'))(_0x7995('0x15'));var utils=require(_0x7995('0x16'));var config=require('../../config/environment');var db=require(_0x7995('0x17'))['db'];function respondWithStatusCode(_0x41c652,_0x581f22){_0x581f22=_0x581f22||0xcc;return function(_0xb0c872){if(_0xb0c872){return _0x41c652[_0x7995('0x18')](_0x581f22);}return _0x41c652[_0x7995('0x19')](_0x581f22)[_0x7995('0x1a')]();};}function respondWithResult(_0x281576,_0x23999f){_0x23999f=_0x23999f||0xc8;return function(_0x2bbe7a){if(_0x2bbe7a){return _0x281576['status'](_0x23999f)['json'](_0x2bbe7a);}};}function respondWithFilteredResult(_0x2b4e94,_0x2233dd){return function(_0x24b5bb){if(_0x24b5bb){var _0x321ae8=_0x24b5bb[_0x7995('0x1b')],_0x3f1d3e=_0x2233dd['offset'],_0x1a5310=_0x2233dd[_0x7995('0x1c')]+_0x2233dd['limit'],_0x2202ce;if(_0x1a5310>=_0x321ae8){_0x1a5310=_0x321ae8;_0x2202ce=0xc8;}else{_0x2202ce=0xce;}_0x2b4e94[_0x7995('0x19')](_0x2202ce);return _0x2b4e94[_0x7995('0x1d')](_0x7995('0x1e'),_0x3f1d3e+'-'+_0x1a5310+'/'+_0x321ae8)[_0x7995('0x1f')](_0x24b5bb);}return null;};}function patchUpdates(_0x1e1415){return function(_0x37a7d4){try{jsonpatch['apply'](_0x37a7d4,_0x1e1415,!![]);}catch(_0x54c9ae){return BPromise[_0x7995('0x20')](_0x54c9ae);}return _0x37a7d4['save']();};}function saveUpdates(_0x555f74,_0x3ec178){return function(_0x3d463e){if(_0x3d463e){return _0x3d463e['update'](_0x555f74)[_0x7995('0x21')](function(_0x51f276){return _0x51f276;});}return null;};}function removeEntity(_0x4b1a8e,_0x3e4c54){return function(_0x327b1f){if(_0x327b1f){return _0x327b1f[_0x7995('0x22')]()[_0x7995('0x21')](function(){var _0x460924=_0x327b1f[_0x7995('0x23')]({'plain':!![]});var _0x5d40ae=_0x7995('0x24');return db[_0x7995('0x25')][_0x7995('0x22')]({'where':{'type':_0x5d40ae,'resourceId':_0x460924['id']}})[_0x7995('0x21')](function(){return _0x327b1f;});})[_0x7995('0x21')](function(){_0x4b1a8e[_0x7995('0x19')](0xcc)[_0x7995('0x1a')]();});}};}function handleEntityNotFound(_0x472195,_0x59405a){return function(_0x39df42){if(!_0x39df42){_0x472195[_0x7995('0x18')](0x194);}return _0x39df42;};}function handleError(_0x401dc3,_0x268ce7){_0x268ce7=_0x268ce7||0x1f4;return function(_0x3a3fcf){logger[_0x7995('0x26')](_0x3a3fcf['stack']);if(_0x3a3fcf[_0x7995('0x27')]){delete _0x3a3fcf['name'];}_0x401dc3[_0x7995('0x19')](_0x268ce7)[_0x7995('0x28')](_0x3a3fcf);};}exports[_0x7995('0x29')]=function(_0x132a42,_0x11c1eb){var _0x4b6f99={},_0x9b2a15={},_0x514445={'count':0x0,'rows':[]};var _0x456a28=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x9b2a15['model']=_['keys'](_0x456a28);var _0x48e573={'dateStart':_0x132a42[_0x7995('0x2c')][_0x7995('0x2d')],'dateEnd':_0x132a42[_0x7995('0x2c')][_0x7995('0x2e')]};delete _0x132a42[_0x7995('0x2c')][_0x7995('0x2d')];delete _0x132a42['query']['dateEnd'];_0x9b2a15[_0x7995('0x2c')]=_['keys'](_0x132a42[_0x7995('0x2c')]);_0x9b2a15[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x9b2a15[_0x7995('0x31')],_0x9b2a15[_0x7995('0x2c')]);_0x4b6f99['attributes']=_[_0x7995('0x30')](_0x9b2a15[_0x7995('0x31')],qs['fields'](_0x132a42['query']['fields']));_0x4b6f99[_0x7995('0x32')]=_0x4b6f99[_0x7995('0x32')]['length']?_0x4b6f99[_0x7995('0x32')]:_0x9b2a15['model'];if(!_0x132a42[_0x7995('0x2c')][_0x7995('0x33')](_0x7995('0x34'))){_0x4b6f99['limit']=qs['limit'](_0x132a42[_0x7995('0x2c')]['limit']);_0x4b6f99['offset']=qs[_0x7995('0x1c')](_0x132a42[_0x7995('0x2c')]['offset']);}_0x4b6f99[_0x7995('0x35')]=qs[_0x7995('0x36')](_0x132a42[_0x7995('0x2c')][_0x7995('0x36')]);_0x4b6f99[_0x7995('0x37')]=qs['filters'](_[_0x7995('0x38')](_0x132a42[_0x7995('0x2c')],_0x9b2a15[_0x7995('0x2f')]));if(_0x48e573[_0x7995('0x2d')]){if(_0x48e573['dateEnd']){_0x48e573[_0x7995('0x2e')]=moment(_0x48e573[_0x7995('0x2e')])[_0x7995('0x39')](0x1,_0x7995('0x3a'));}else{_0x48e573[_0x7995('0x2e')]=moment(_0x48e573[_0x7995('0x2d')])['add'](0x1,_0x7995('0x3a'));}_[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x37')],{'createdAt':{'$gte':_0x48e573[_0x7995('0x2d')],'$lte':_0x48e573[_0x7995('0x2e')]}});}if(_0x132a42[_0x7995('0x2c')][_0x7995('0x3c')]){_0x4b6f99[_0x7995('0x37')]=_[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x37')],{'$or':_[_0x7995('0x3d')](_0x456a28,function(_0x270d52){if(_0x270d52[_0x7995('0x3e')]['key']!=='VIRTUAL'){var _0x334dff={};_0x334dff[_0x270d52[_0x7995('0x3f')]]={'$like':'%'+_0x132a42['query']['filter']+'%'};return _0x334dff;}})});}_0x4b6f99=_[_0x7995('0x3b')]({},_0x4b6f99,_0x132a42['options']);var _0x504a33={'where':_0x4b6f99[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1b')](_0x504a33)['then'](function(_0x46ac4f){_0x514445['count']=_0x46ac4f;if(_0x132a42[_0x7995('0x2c')]['includeAll']){_0x4b6f99['include']=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x40')](_0x4b6f99);})[_0x7995('0x21')](function(_0x3f1c35){_0x514445['rows']=_0x3f1c35;return _0x514445;})[_0x7995('0x21')](respondWithFilteredResult(_0x11c1eb,_0x4b6f99))[_0x7995('0x41')](handleError(_0x11c1eb,null));};exports[_0x7995('0x42')]=function(_0x6c7bec,_0x4e09b7){var _0x5f28e7={'raw':!![],'where':{'id':_0x6c7bec['params']['id']}},_0x1c37c6={};_0x1c37c6[_0x7995('0x31')]=_['keys'](db[_0x7995('0x2a')]['rawAttributes']);_0x1c37c6[_0x7995('0x2c')]=_[_0x7995('0x43')](_0x6c7bec['query']);_0x1c37c6[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x1c37c6[_0x7995('0x31')],_0x1c37c6[_0x7995('0x2c')]);_0x5f28e7['attributes']=_[_0x7995('0x30')](_0x1c37c6[_0x7995('0x31')],qs[_0x7995('0x44')](_0x6c7bec['query'][_0x7995('0x44')]));_0x5f28e7[_0x7995('0x32')]=_0x5f28e7[_0x7995('0x32')][_0x7995('0x45')]?_0x5f28e7[_0x7995('0x32')]:_0x1c37c6['model'];if(_0x6c7bec[_0x7995('0x2c')][_0x7995('0x46')]){_0x5f28e7['include']=[{'all':!![]}];}_0x5f28e7=_[_0x7995('0x3b')]({},_0x5f28e7,_0x6c7bec['options']);return db[_0x7995('0x2a')][_0x7995('0x47')](_0x5f28e7)[_0x7995('0x21')](handleEntityNotFound(_0x4e09b7,null))[_0x7995('0x21')](respondWithResult(_0x4e09b7,null))[_0x7995('0x41')](handleError(_0x4e09b7,null));};exports[_0x7995('0x48')]=function(_0x1579b9,_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x1579b9['params']['id']},'attributes':[_0x7995('0x27'),_0x7995('0x49'),_0x7995('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x4d46bc,null))['then'](function(_0x5a592e){if(_0x5a592e){if(!fs[_0x7995('0x4b')](path[_0x7995('0x4c')](config['root'],_0x7995('0x4d'),_0x5a592e[_0x7995('0x49')]+'.'+_0x5a592e[_0x7995('0x4a')]))){throw new db[(_0x7995('0x4e'))][(_0x7995('0x4f'))]('Sound\x20not\x20found');}return _0x4d46bc[_0x7995('0x48')](path['join'](config[_0x7995('0x50')],_0x7995('0x4d'),util[_0x7995('0x51')]('%s.%s',_0x5a592e['save_name'],_0x5a592e['converted_format'])),util['format'](_0x7995('0x52'),_0x5a592e[_0x7995('0x27')],_0x5a592e[_0x7995('0x4a')]));}return null;})[_0x7995('0x41')](handleError(_0x4d46bc,null));};exports[_0x7995('0x53')]=function(_0x357e60,_0x1f4270,_0xda6ce8){var _0x328671={'name':path[_0x7995('0x54')](_0x357e60[_0x7995('0x55')][_0x7995('0x56')],path[_0x7995('0x57')](_0x357e60[_0x7995('0x55')][_0x7995('0x56')])),'save_name':path[_0x7995('0x54')](_0x357e60[_0x7995('0x55')][_0x7995('0x58')],path[_0x7995('0x57')](_0x357e60['file'][_0x7995('0x58')])),'original_format':path[_0x7995('0x57')](_0x357e60[_0x7995('0x55')][_0x7995('0x56')])['substring'](0x1),'converted_format':'wav'};var _0x402fa0=path[_0x7995('0x4c')](config[_0x7995('0x50')],_0x7995('0x59'),_0x357e60['file'][_0x7995('0x58')]);var _0x74ff38=path[_0x7995('0x4c')](config[_0x7995('0x50')],'server/files/sounds/converted',util['format'](_0x7995('0x52'),path[_0x7995('0x54')](_0x357e60[_0x7995('0x55')][_0x7995('0x58')],path[_0x7995('0x57')](_0x357e60[_0x7995('0x55')][_0x7995('0x58')])),_0x328671[_0x7995('0x4a')]));logger[_0x7995('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x402fa0);logger[_0x7995('0x5a')](_0x7995('0x5b'),_0x74ff38);try{fs[_0x7995('0x5c')](_0x402fa0,parseInt(_0x7995('0x5d'),0x8));var _0x59c5aa=sox['transcode'](_0x402fa0,_0x74ff38,{'sampleRate':0x1f40,'format':_0x7995('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x59c5aa['on'](_0x7995('0x26'),function(_0x47d5d7){fs[_0x7995('0x5f')](_0x402fa0);_0x1f4270[_0x7995('0x19')](0x1f4)[_0x7995('0x28')](_0x47d5d7);});_0x59c5aa['on'](_0x7995('0x60'),function(_0x32cb04){_0x328671['original_duration']=isNaN(_0x32cb04[_0x7995('0x61')])?null:_0x32cb04['duration']*0x3e8;_0x328671[_0x7995('0x62')]=isNaN(_0x32cb04[_0x7995('0x63')])?null:_0x32cb04[_0x7995('0x63')];_0x328671[_0x7995('0x64')]=isNaN(_0x32cb04[_0x7995('0x65')])?null:_0x32cb04[_0x7995('0x65')];_0x328671[_0x7995('0x66')]=isNaN(_0x32cb04[_0x7995('0x67')])?null:_0x32cb04[_0x7995('0x67')];_0x328671[_0x7995('0x68')]=isNaN(_0x32cb04[_0x7995('0x69')])?null:_0x32cb04[_0x7995('0x69')];});_0x59c5aa['on']('dest',function(_0x45351d){_0x328671[_0x7995('0x6a')]=isNaN(_0x45351d[_0x7995('0x61')])?null:_0x45351d[_0x7995('0x61')]*0x3e8;_0x328671[_0x7995('0x6b')]=isNaN(_0x45351d['sampleCount'])?null:_0x45351d['sampleCount'];_0x328671[_0x7995('0x6c')]=isNaN(_0x45351d[_0x7995('0x65')])?null:_0x45351d[_0x7995('0x65')];_0x328671[_0x7995('0x6d')]=isNaN(_0x45351d['bitRate'])?null:_0x45351d[_0x7995('0x67')];_0x328671['converted_sampleRate']=isNaN(_0x45351d['sampleRate'])?null:_0x45351d[_0x7995('0x69')];});_0x59c5aa['on'](_0x7995('0x1a'),function(){fs[_0x7995('0x5c')](_0x74ff38,parseInt(_0x7995('0x5d'),0x8));return db[_0x7995('0x2a')][_0x7995('0x53')](_0x328671)[_0x7995('0x21')](function(_0x13dc73){var _0x3fde86={'role':_0x357e60[_0x7995('0x6e')]['role'],'userProfileId':_0x357e60[_0x7995('0x6e')][_0x7995('0x6f')]};if(!_0x3fde86)throw new Error(_0x7995('0x70'));if(_0x3fde86['role']===_0x7995('0x71')){var _0x1d2f9d=_0x13dc73[_0x7995('0x23')]({'plain':!![]});return db[_0x7995('0x72')][_0x7995('0x47')]({'where':{'name':_0x7995('0x24'),'userProfileId':_0x3fde86[_0x7995('0x6f')]},'raw':!![]})[_0x7995('0x21')](function(_0x2f94c4){if(_0x2f94c4&&_0x2f94c4[_0x7995('0x73')]===0x0){return db[_0x7995('0x25')]['create']({'name':_0x1d2f9d['name'],'resourceId':_0x1d2f9d['id'],'type':_0x2f94c4[_0x7995('0x27')],'sectionId':_0x2f94c4['id']},{})[_0x7995('0x21')](function(){return _0x13dc73;});}else{return _0x13dc73;}})[_0x7995('0x41')](function(_0x35aaec){logger['error'](_0x7995('0x74'),_0x35aaec);throw _0x35aaec;});}return _0x13dc73;})[_0x7995('0x21')](respondWithResult(_0x1f4270,null))['catch'](handleError(_0x1f4270,null));});_0x59c5aa['start']();}catch(_0x3253b5){_0x1f4270[_0x7995('0x19')](0x1f4)['send'](_0x3253b5);}};exports[_0x7995('0x75')]=function(_0x5b1cba,_0x3758f9,_0xea9aba){return db['Sound']['find']({'where':{'id':_0x5b1cba[_0x7995('0x76')]['id']}})['then'](handleEntityNotFound(_0x3758f9,null))[_0x7995('0x21')](saveUpdates(_[_0x7995('0x38')](_0x5b1cba[_0x7995('0x6e')],[_0x7995('0x27'),_0x7995('0x77')]),null))[_0x7995('0x21')](respondWithResult(_0x3758f9,null))[_0x7995('0x41')](handleError(_0x3758f9,null));};exports[_0x7995('0x78')]=function(_0x29e0ee,_0x117317,_0x1ab590){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x29e0ee[_0x7995('0x76')]['id']}})[_0x7995('0x21')](function(_0x3773de){if(_0x3773de){return _0x3773de[_0x7995('0x22')]();}})[_0x7995('0x21')](function(_0x2ff7ba){var _0xa2fc8e=path[_0x7995('0x4c')](config[_0x7995('0x50')],_0x7995('0x59'),util[_0x7995('0x51')](_0x7995('0x52'),_0x2ff7ba[_0x7995('0x49')],_0x2ff7ba[_0x7995('0x79')]));var _0x34724d=path['join'](config[_0x7995('0x50')],_0x7995('0x4d'),util['format']('%s.%s',_0x2ff7ba[_0x7995('0x49')],_0x2ff7ba[_0x7995('0x4a')]));fs[_0x7995('0x5f')](_0xa2fc8e);fs[_0x7995('0x5f')](_0x34724d);return _0x2ff7ba;})[_0x7995('0x21')](function(_0x2491fe){if(_0x2491fe){return _0x117317['status'](0xcc)[_0x7995('0x1a')]();}})[_0x7995('0x21')](handleEntityNotFound(_0x117317,null))[_0x7995('0x41')](handleError(_0x117317,null));};
\ No newline at end of file
+var _0x3e74=['body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','params','pick','delete','original_format','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','get','Sounds','error','stack','index','Sound','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','length','order','sort','where','add','day','merge','filter','map','key','VIRTUAL','field','options','count','includeAll','findAll','rows','fields','include','catch','download','find','name','existsSync','join','root','server/files/sounds/converted','save_name','converted_format','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','original_duration','duration','original_sampleCount','original_channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','channelCount','converted_bitRate'];(function(_0x31770a,_0x36cc98){var _0x54475f=function(_0x1478ed){while(--_0x1478ed){_0x31770a['push'](_0x31770a['shift']());}};_0x54475f(++_0x36cc98);}(_0x3e74,0x175));var _0x43e7=function(_0x113d11,_0x3a0f16){_0x113d11=_0x113d11-0x0;var _0x289ac1=_0x3e74[_0x113d11];return _0x289ac1;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0xf'))(_0x43e7('0x10'));var utils=require('../../config/utils');var config=require(_0x43e7('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7c520,_0x37302c){_0x37302c=_0x37302c||0xcc;return function(_0x4ebc8e){if(_0x4ebc8e){return _0xf7c520[_0x43e7('0x12')](_0x37302c);}return _0xf7c520[_0x43e7('0x13')](_0x37302c)[_0x43e7('0x14')]();};}function respondWithResult(_0x3bb83f,_0x4e008c){_0x4e008c=_0x4e008c||0xc8;return function(_0x583d85){if(_0x583d85){return _0x3bb83f[_0x43e7('0x13')](_0x4e008c)[_0x43e7('0x15')](_0x583d85);}};}function respondWithFilteredResult(_0x44b0bd,_0x51b974){return function(_0x5e641c){if(_0x5e641c){var _0x16849c=_0x5e641c['count'],_0x14c146=_0x51b974['offset'],_0x203378=_0x51b974[_0x43e7('0x16')]+_0x51b974[_0x43e7('0x17')],_0x328445;if(_0x203378>=_0x16849c){_0x203378=_0x16849c;_0x328445=0xc8;}else{_0x328445=0xce;}_0x44b0bd[_0x43e7('0x13')](_0x328445);return _0x44b0bd['set']('Content-Range',_0x14c146+'-'+_0x203378+'/'+_0x16849c)[_0x43e7('0x15')](_0x5e641c);}return null;};}function patchUpdates(_0x1ca758){return function(_0x9037d3){try{jsonpatch[_0x43e7('0x18')](_0x9037d3,_0x1ca758,!![]);}catch(_0x3776f5){return BPromise[_0x43e7('0x19')](_0x3776f5);}return _0x9037d3[_0x43e7('0x1a')]();};}function saveUpdates(_0x1441ef,_0x2377a3){return function(_0xab63cf){if(_0xab63cf){return _0xab63cf[_0x43e7('0x1b')](_0x1441ef)[_0x43e7('0x1c')](function(_0x4b5d64){return _0x4b5d64;});}return null;};}function removeEntity(_0xef1a5a,_0x3c6625){return function(_0x4b386b){if(_0x4b386b){return _0x4b386b[_0x43e7('0x1d')]()[_0x43e7('0x1c')](function(){var _0x3945bb=_0x4b386b[_0x43e7('0x1e')]({'plain':!![]});var _0x4077fb=_0x43e7('0x1f');return db['UserProfileResource'][_0x43e7('0x1d')]({'where':{'type':_0x4077fb,'resourceId':_0x3945bb['id']}})['then'](function(){return _0x4b386b;});})['then'](function(){_0xef1a5a[_0x43e7('0x13')](0xcc)[_0x43e7('0x14')]();});}};}function handleEntityNotFound(_0x4b2b9f,_0x1f0673){return function(_0x4ca5cf){if(!_0x4ca5cf){_0x4b2b9f[_0x43e7('0x12')](0x194);}return _0x4ca5cf;};}function handleError(_0x5c5e67,_0x1af208){_0x1af208=_0x1af208||0x1f4;return function(_0x1b5f50){logger[_0x43e7('0x20')](_0x1b5f50[_0x43e7('0x21')]);if(_0x1b5f50['name']){delete _0x1b5f50['name'];}_0x5c5e67[_0x43e7('0x13')](_0x1af208)['send'](_0x1b5f50);};}exports[_0x43e7('0x22')]=function(_0x40dc8f,_0x3565cf){var _0xb1fc63={},_0x5087d7={},_0x33a1a5={'count':0x0,'rows':[]};var _0x4690a6=db[_0x43e7('0x23')][_0x43e7('0x24')];_0x5087d7[_0x43e7('0x25')]=_[_0x43e7('0x26')](_0x4690a6);var _0x2b85a5={'dateStart':_0x40dc8f[_0x43e7('0x27')][_0x43e7('0x28')],'dateEnd':_0x40dc8f[_0x43e7('0x27')][_0x43e7('0x29')]};delete _0x40dc8f[_0x43e7('0x27')][_0x43e7('0x28')];delete _0x40dc8f[_0x43e7('0x27')]['dateEnd'];_0x5087d7[_0x43e7('0x27')]=_[_0x43e7('0x26')](_0x40dc8f[_0x43e7('0x27')]);_0x5087d7[_0x43e7('0x2a')]=_[_0x43e7('0x2b')](_0x5087d7['model'],_0x5087d7[_0x43e7('0x27')]);_0xb1fc63[_0x43e7('0x2c')]=_[_0x43e7('0x2b')](_0x5087d7[_0x43e7('0x25')],qs['fields'](_0x40dc8f['query']['fields']));_0xb1fc63[_0x43e7('0x2c')]=_0xb1fc63[_0x43e7('0x2c')][_0x43e7('0x2d')]?_0xb1fc63[_0x43e7('0x2c')]:_0x5087d7[_0x43e7('0x25')];if(!_0x40dc8f[_0x43e7('0x27')]['hasOwnProperty']('nolimit')){_0xb1fc63['limit']=qs['limit'](_0x40dc8f['query']['limit']);_0xb1fc63['offset']=qs[_0x43e7('0x16')](_0x40dc8f['query'][_0x43e7('0x16')]);}_0xb1fc63[_0x43e7('0x2e')]=qs[_0x43e7('0x2f')](_0x40dc8f[_0x43e7('0x27')][_0x43e7('0x2f')]);_0xb1fc63[_0x43e7('0x30')]=qs[_0x43e7('0x2a')](_['pick'](_0x40dc8f['query'],_0x5087d7['filters']));if(_0x2b85a5[_0x43e7('0x28')]){if(_0x2b85a5[_0x43e7('0x29')]){_0x2b85a5[_0x43e7('0x29')]=moment(_0x2b85a5[_0x43e7('0x29')])[_0x43e7('0x31')](0x1,_0x43e7('0x32'));}else{_0x2b85a5[_0x43e7('0x29')]=moment(_0x2b85a5[_0x43e7('0x28')])['add'](0x1,_0x43e7('0x32'));}_[_0x43e7('0x33')](_0xb1fc63['where'],{'createdAt':{'$gte':_0x2b85a5[_0x43e7('0x28')],'$lte':_0x2b85a5['dateEnd']}});}if(_0x40dc8f[_0x43e7('0x27')][_0x43e7('0x34')]){_0xb1fc63[_0x43e7('0x30')]=_[_0x43e7('0x33')](_0xb1fc63[_0x43e7('0x30')],{'$or':_[_0x43e7('0x35')](_0x4690a6,function(_0x5e731b){if(_0x5e731b['type'][_0x43e7('0x36')]!==_0x43e7('0x37')){var _0x44b6ae={};_0x44b6ae[_0x5e731b[_0x43e7('0x38')]]={'$like':'%'+_0x40dc8f[_0x43e7('0x27')]['filter']+'%'};return _0x44b6ae;}})});}_0xb1fc63=_[_0x43e7('0x33')]({},_0xb1fc63,_0x40dc8f[_0x43e7('0x39')]);var _0x575439={'where':_0xb1fc63[_0x43e7('0x30')]};return db['Sound'][_0x43e7('0x3a')](_0x575439)['then'](function(_0x3d81ae){_0x33a1a5[_0x43e7('0x3a')]=_0x3d81ae;if(_0x40dc8f[_0x43e7('0x27')][_0x43e7('0x3b')]){_0xb1fc63['include']=[{'all':!![]}];}return db['Sound'][_0x43e7('0x3c')](_0xb1fc63);})[_0x43e7('0x1c')](function(_0xe979b5){_0x33a1a5[_0x43e7('0x3d')]=_0xe979b5;return _0x33a1a5;})['then'](respondWithFilteredResult(_0x3565cf,_0xb1fc63))['catch'](handleError(_0x3565cf,null));};exports['show']=function(_0x35e4fb,_0x57f5d0){var _0x2ab022={'raw':!![],'where':{'id':_0x35e4fb['params']['id']}},_0x4b3a59={};_0x4b3a59[_0x43e7('0x25')]=_['keys'](db[_0x43e7('0x23')][_0x43e7('0x24')]);_0x4b3a59[_0x43e7('0x27')]=_[_0x43e7('0x26')](_0x35e4fb['query']);_0x4b3a59[_0x43e7('0x2a')]=_[_0x43e7('0x2b')](_0x4b3a59[_0x43e7('0x25')],_0x4b3a59[_0x43e7('0x27')]);_0x2ab022[_0x43e7('0x2c')]=_[_0x43e7('0x2b')](_0x4b3a59['model'],qs['fields'](_0x35e4fb[_0x43e7('0x27')][_0x43e7('0x3e')]));_0x2ab022[_0x43e7('0x2c')]=_0x2ab022['attributes']['length']?_0x2ab022['attributes']:_0x4b3a59[_0x43e7('0x25')];if(_0x35e4fb[_0x43e7('0x27')]['includeAll']){_0x2ab022[_0x43e7('0x3f')]=[{'all':!![]}];}_0x2ab022=_[_0x43e7('0x33')]({},_0x2ab022,_0x35e4fb[_0x43e7('0x39')]);return db['Sound']['find'](_0x2ab022)['then'](handleEntityNotFound(_0x57f5d0,null))['then'](respondWithResult(_0x57f5d0,null))[_0x43e7('0x40')](handleError(_0x57f5d0,null));};exports[_0x43e7('0x41')]=function(_0x52fea5,_0x23e7cb,_0x82d32f){return db[_0x43e7('0x23')][_0x43e7('0x42')]({'where':{'id':_0x52fea5['params']['id']},'attributes':[_0x43e7('0x43'),'save_name','converted_format'],'raw':!![]})[_0x43e7('0x1c')](handleEntityNotFound(_0x23e7cb,null))[_0x43e7('0x1c')](function(_0x22d98e){if(_0x22d98e){if(!fs[_0x43e7('0x44')](path[_0x43e7('0x45')](config[_0x43e7('0x46')],_0x43e7('0x47'),_0x22d98e[_0x43e7('0x48')]+'.'+_0x22d98e[_0x43e7('0x49')]))){throw new db[(_0x43e7('0x4a'))]['ValidationError'](_0x43e7('0x4b'));}return _0x23e7cb[_0x43e7('0x41')](path['join'](config[_0x43e7('0x46')],'server/files/sounds/converted',util[_0x43e7('0x4c')](_0x43e7('0x4d'),_0x22d98e[_0x43e7('0x48')],_0x22d98e[_0x43e7('0x49')])),util[_0x43e7('0x4c')]('%s.%s',_0x22d98e['name'],_0x22d98e[_0x43e7('0x49')]));}return null;})[_0x43e7('0x40')](handleError(_0x23e7cb,null));};exports[_0x43e7('0x4e')]=function(_0x29c53d,_0x23d835,_0x25bb44){var _0xa47464={'name':path[_0x43e7('0x4f')](_0x29c53d[_0x43e7('0x50')][_0x43e7('0x51')],path[_0x43e7('0x52')](_0x29c53d['file'][_0x43e7('0x51')])),'save_name':path[_0x43e7('0x4f')](_0x29c53d['file'][_0x43e7('0x53')],path[_0x43e7('0x52')](_0x29c53d[_0x43e7('0x50')]['filename'])),'original_format':path['extname'](_0x29c53d[_0x43e7('0x50')][_0x43e7('0x51')])['substring'](0x1),'converted_format':_0x43e7('0x54')};var _0x54506d=path['join'](config[_0x43e7('0x46')],_0x43e7('0x55'),_0x29c53d[_0x43e7('0x50')][_0x43e7('0x53')]);var _0x68697=path['join'](config[_0x43e7('0x46')],_0x43e7('0x47'),util['format'](_0x43e7('0x4d'),path[_0x43e7('0x4f')](_0x29c53d[_0x43e7('0x50')]['filename'],path['extname'](_0x29c53d['file'][_0x43e7('0x53')])),_0xa47464[_0x43e7('0x49')]));logger[_0x43e7('0x56')](_0x43e7('0x57'),_0x54506d);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x68697);try{fs[_0x43e7('0x58')](_0x54506d,parseInt(_0x43e7('0x59'),0x8));var _0x140438=sox[_0x43e7('0x5a')](_0x54506d,_0x68697,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x140438['on'](_0x43e7('0x20'),function(_0x1a7cb5){fs[_0x43e7('0x5b')](_0x54506d);_0x23d835[_0x43e7('0x13')](0x1f4)[_0x43e7('0x5c')](_0x1a7cb5);});_0x140438['on'](_0x43e7('0x5d'),function(_0x4665db){_0xa47464[_0x43e7('0x5e')]=isNaN(_0x4665db[_0x43e7('0x5f')])?null:_0x4665db[_0x43e7('0x5f')]*0x3e8;_0xa47464[_0x43e7('0x60')]=isNaN(_0x4665db['sampleCount'])?null:_0x4665db['sampleCount'];_0xa47464[_0x43e7('0x61')]=isNaN(_0x4665db['channelCount'])?null:_0x4665db['channelCount'];_0xa47464['original_bitRate']=isNaN(_0x4665db[_0x43e7('0x62')])?null:_0x4665db[_0x43e7('0x62')];_0xa47464['original_sampleRate']=isNaN(_0x4665db[_0x43e7('0x63')])?null:_0x4665db[_0x43e7('0x63')];});_0x140438['on'](_0x43e7('0x64'),function(_0x537a53){_0xa47464[_0x43e7('0x65')]=isNaN(_0x537a53[_0x43e7('0x5f')])?null:_0x537a53[_0x43e7('0x5f')]*0x3e8;_0xa47464[_0x43e7('0x66')]=isNaN(_0x537a53[_0x43e7('0x67')])?null:_0x537a53[_0x43e7('0x67')];_0xa47464[_0x43e7('0x68')]=isNaN(_0x537a53['channelCount'])?null:_0x537a53[_0x43e7('0x69')];_0xa47464[_0x43e7('0x6a')]=isNaN(_0x537a53[_0x43e7('0x62')])?null:_0x537a53['bitRate'];_0xa47464['converted_sampleRate']=isNaN(_0x537a53[_0x43e7('0x63')])?null:_0x537a53['sampleRate'];});_0x140438['on']('end',function(){fs[_0x43e7('0x58')](_0x68697,parseInt(_0x43e7('0x59'),0x8));return db['Sound'][_0x43e7('0x4e')](_0xa47464)[_0x43e7('0x1c')](function(_0x1e2fed){var _0x3401ec={'role':_0x29c53d[_0x43e7('0x6b')][_0x43e7('0x6c')],'userProfileId':_0x29c53d[_0x43e7('0x6b')]['userProfileId']};if(!_0x3401ec)throw new Error(_0x43e7('0x6d'));if(_0x3401ec[_0x43e7('0x6c')]==='user'){var _0x418213=_0x1e2fed['get']({'plain':!![]});return db[_0x43e7('0x6e')][_0x43e7('0x42')]({'where':{'name':_0x43e7('0x1f'),'userProfileId':_0x3401ec[_0x43e7('0x6f')]},'raw':!![]})['then'](function(_0x2d25b5){if(_0x2d25b5&&_0x2d25b5[_0x43e7('0x70')]===0x0){return db[_0x43e7('0x71')]['create']({'name':_0x418213[_0x43e7('0x43')],'resourceId':_0x418213['id'],'type':_0x2d25b5[_0x43e7('0x43')],'sectionId':_0x2d25b5['id']},{})[_0x43e7('0x1c')](function(){return _0x1e2fed;});}else{return _0x1e2fed;}})[_0x43e7('0x40')](function(_0x2da9b4){logger['error'](_0x43e7('0x72'),_0x2da9b4);throw _0x2da9b4;});}return _0x1e2fed;})[_0x43e7('0x1c')](respondWithResult(_0x23d835,null))[_0x43e7('0x40')](handleError(_0x23d835,null));});_0x140438[_0x43e7('0x73')]();}catch(_0x433d3c){_0x23d835[_0x43e7('0x13')](0x1f4)[_0x43e7('0x5c')](_0x433d3c);}};exports['update']=function(_0x499ee9,_0x405faa,_0x536477){return db['Sound']['find']({'where':{'id':_0x499ee9[_0x43e7('0x74')]['id']}})[_0x43e7('0x1c')](handleEntityNotFound(_0x405faa,null))[_0x43e7('0x1c')](saveUpdates(_[_0x43e7('0x75')](_0x499ee9[_0x43e7('0x6b')],[_0x43e7('0x43'),'description']),null))[_0x43e7('0x1c')](respondWithResult(_0x405faa,null))[_0x43e7('0x40')](handleError(_0x405faa,null));};exports[_0x43e7('0x76')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){return db[_0x43e7('0x23')][_0x43e7('0x42')]({'where':{'id':_0x5b4c76[_0x43e7('0x74')]['id']}})[_0x43e7('0x1c')](function(_0x1d4a29){if(_0x1d4a29){return _0x1d4a29[_0x43e7('0x1d')]();}})['then'](function(_0x52c757){var _0x55990c=path[_0x43e7('0x45')](config[_0x43e7('0x46')],'server/files/sounds/original',util[_0x43e7('0x4c')](_0x43e7('0x4d'),_0x52c757[_0x43e7('0x48')],_0x52c757[_0x43e7('0x77')]));var _0x5a5565=path['join'](config['root'],_0x43e7('0x47'),util[_0x43e7('0x4c')]('%s.%s',_0x52c757['save_name'],_0x52c757[_0x43e7('0x49')]));fs[_0x43e7('0x5b')](_0x55990c);fs[_0x43e7('0x5b')](_0x5a5565);return _0x52c757;})['then'](function(_0x80334){if(_0x80334){return _0x2abca0[_0x43e7('0x13')](0xcc)[_0x43e7('0x14')]();}})[_0x43e7('0x1c')](handleEntityNotFound(_0x2abca0,null))['catch'](handleError(_0x2abca0,null));};
\ No newline at end of file
index 9f3c9ab..18244d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8515=['util','../../config/logger','api','bluebird','request-promise','./sound.attributes','define','Sound','tools_sounds','lodash'];(function(_0xb1ddc7,_0x18e100){var _0x557d99=function(_0x31f670){while(--_0x31f670){_0xb1ddc7['push'](_0xb1ddc7['shift']());}};_0x557d99(++_0x18e100);}(_0x8515,0x95));var _0x5851=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x8515[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require(_0x5851('0x0'));var util=require(_0x5851('0x1'));var logger=require(_0x5851('0x2'))(_0x5851('0x3'));var moment=require('moment');var BPromise=require(_0x5851('0x4'));var rp=require(_0x5851('0x5'));var attributes=require(_0x5851('0x6'));module['exports']=function(_0x1b60f7,_0xb08893){return _0x1b60f7[_0x5851('0x7')](_0x5851('0x8'),attributes,{'tableName':_0x5851('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ed9=['lodash','util','../../config/logger','api','moment','request-promise','./sound.attributes','define','Sound','tools_sounds'];(function(_0x2e5244,_0x173ca9){var _0x4804cd=function(_0x7711c0){while(--_0x7711c0){_0x2e5244['push'](_0x2e5244['shift']());}};_0x4804cd(++_0x173ca9);}(_0x2ed9,0x168));var _0x92ed=function(_0x4559c1,_0x276738){_0x4559c1=_0x4559c1-0x0;var _0x10510f=_0x2ed9[_0x4559c1];return _0x10510f;};'use strict';var _=require(_0x92ed('0x0'));var util=require(_0x92ed('0x1'));var logger=require(_0x92ed('0x2'))(_0x92ed('0x3'));var moment=require(_0x92ed('0x4'));var BPromise=require('bluebird');var rp=require(_0x92ed('0x5'));var attributes=require(_0x92ed('0x6'));module['exports']=function(_0xb081b7,_0x837c40){return _0xb081b7[_0x92ed('0x7')](_0x92ed('0x8'),attributes,{'tableName':_0x92ed('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index efabb2a..91f7200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0x1c04a3,_0x1d1bc){var _0x185c03=function(_0x1049d6){while(--_0x1049d6){_0x1c04a3['push'](_0x1c04a3['shift']());}};_0x185c03(++_0x1d1bc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});};
\ No newline at end of file
+var _0xd8b0=['request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','model','attributes','map','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Sound,\x20%s,\x20%s'];(function(_0xff7940,_0x16038b){var _0x15ecf2=function(_0x21d2e6){while(--_0x21d2e6){_0xff7940['push'](_0xff7940['shift']());}};_0x15ecf2(++_0x16038b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['find']({'raw':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x19')]===undefined?!![]:![]:!![],'where':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')][_0x0d8b('0x1a')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x18')]?_0x5fecbd[_0x0d8b('0x18')]['attributes']||null:null,'include':_0x5fecbd['options']?_0x5fecbd[_0x0d8b('0x18')]['include']?_['map'](_0x5fecbd['options'][_0x0d8b('0x1b')],function(_0x2b924f){return{'model':db[_0x2b924f[_0x0d8b('0x1c')]],'as':_0x2b924f['as'],'attributes':_0x2b924f[_0x0d8b('0x1d')],'include':_0x2b924f[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x2b924f[_0x0d8b('0x1b')],function(_0x4562cb){return{'model':db[_0x4562cb[_0x0d8b('0x1c')]],'as':_0x4562cb['as'],'attributes':_0x4562cb['attributes'],'include':_0x4562cb[_0x0d8b('0x1b')]?_[_0x0d8b('0x1e')](_0x4562cb['include'],function(_0xe1ef20){return{'model':db[_0xe1ef20['model']],'as':_0xe1ef20['as'],'attributes':_0xe1ef20[_0x0d8b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xa')](function(_0xa2af02){logger['info']('ShowSound',_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON['stringify'](_0xa2af02));_0x18dd2d(_0xa2af02);})[_0x0d8b('0x15')](function(_0x59aa83){logger[_0x0d8b('0x11')]('ShowSound',_0x59aa83[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674['error'](0x1f4,_0x59aa83[_0x0d8b('0x13')]));});});};
\ No newline at end of file
index 35fee8a..a681be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9990=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9990,0xf6));var _0x0999=function(_0x13696a,_0x533911){_0x13696a=_0x13696a-0x0;var _0x985801=_0x9990[_0x13696a];return _0x985801;};'use strict';var multer=require('multer');var util=require(_0x0999('0x0'));var path=require(_0x0999('0x1'));var timeout=require(_0x0999('0x2'));var express=require(_0x0999('0x3'));var router=express[_0x0999('0x4')]();var auth=require(_0x0999('0x5'));var interaction=require(_0x0999('0x6'));var config=require(_0x0999('0x7'));var controller=require('./squareMessage.controller');router[_0x0999('0x8')]('/',auth[_0x0999('0x9')](),controller[_0x0999('0xa')]);router['get'](_0x0999('0xb'),auth[_0x0999('0x9')](),controller[_0x0999('0xc')]);router[_0x0999('0xd')]('/',auth[_0x0999('0x9')](),controller[_0x0999('0xe')]);router[_0x0999('0xf')]('/:id',auth[_0x0999('0x9')](),controller[_0x0999('0x10')]);router[_0x0999('0x11')]('/:id',auth[_0x0999('0x9')](),controller[_0x0999('0x12')]);module[_0x0999('0x13')]=router;
\ No newline at end of file
+var _0x15ec=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','show','post','create','/:id','destroy','util','path','connect-timeout','express'];(function(_0xeb6462,_0x467f3e){var _0x19bf5b=function(_0x20db37){while(--_0x20db37){_0xeb6462['push'](_0xeb6462['shift']());}};_0x19bf5b(++_0x467f3e);}(_0x15ec,0x16c));var _0xc15e=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x15ec[_0x3826ad];return _0x17b900;};'use strict';var multer=require('multer');var util=require(_0xc15e('0x0'));var path=require(_0xc15e('0x1'));var timeout=require(_0xc15e('0x2'));var express=require(_0xc15e('0x3'));var router=express[_0xc15e('0x4')]();var auth=require(_0xc15e('0x5'));var interaction=require(_0xc15e('0x6'));var config=require(_0xc15e('0x7'));var controller=require(_0xc15e('0x8'));router[_0xc15e('0x9')]('/',auth[_0xc15e('0xa')](),controller['index']);router[_0xc15e('0x9')]('/:id',auth[_0xc15e('0xa')](),controller[_0xc15e('0xb')]);router[_0xc15e('0xc')]('/',auth[_0xc15e('0xa')](),controller[_0xc15e('0xd')]);router['put'](_0xc15e('0xe'),auth[_0xc15e('0xa')](),controller['update']);router['delete'](_0xc15e('0xe'),auth[_0xc15e('0xa')](),controller[_0xc15e('0xf')]);module['exports']=router;
\ No newline at end of file
index 64e0085..0bb0a9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cc6=['TEXT','medium','out','exports'];(function(_0x4f4a6c,_0x4d3bda){var _0x5523eb=function(_0x3c55d3){while(--_0x3c55d3){_0x4f4a6c['push'](_0x4f4a6c['shift']());}};_0x5523eb(++_0x4d3bda);}(_0x0cc6,0x123));var _0x60cc=function(_0x441038,_0x318ade){_0x441038=_0x441038-0x0;var _0x373b31=_0x0cc6[_0x441038];return _0x373b31;};'use strict';var Sequelize=require('sequelize');module[_0x60cc('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x60cc('0x1')](_0x60cc('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x60cc('0x3')),'defaultValue':_0x60cc('0x3'),'allowNull':![]}};
\ No newline at end of file
+var _0x08d8=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x1f5f75,_0x11f6af){var _0x5b73ac=function(_0x4c33b4){while(--_0x4c33b4){_0x1f5f75['push'](_0x1f5f75['shift']());}};_0x5b73ac(++_0x11f6af);}(_0x08d8,0x170));var _0x808d=function(_0x4ad37c,_0x2e7490){_0x4ad37c=_0x4ad37c-0x0;var _0x288919=_0x08d8[_0x4ad37c];return _0x288919;};'use strict';var Sequelize=require(_0x808d('0x0'));module[_0x808d('0x1')]={'uniqueid':{'type':Sequelize[_0x808d('0x2')]},'body':{'type':Sequelize[_0x808d('0x3')](_0x808d('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x808d('0x5')]('in',_0x808d('0x6')),'defaultValue':'out','allowNull':![]}};
\ No newline at end of file
index 033880c..45b3e6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['reject','then','sendStatus','stack','SquareMessage','rawAttributes','model','query','dateStart','dateEnd','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','add','day','merge','filter','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','update','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3342('0x0'));var zipdir=require(_0x3342('0x1'));var jsonpatch=require(_0x3342('0x2'));var rp=require(_0x3342('0x3'));var moment=require(_0x3342('0x4'));var BPromise=require(_0x3342('0x5'));var Mustache=require(_0x3342('0x6'));var util=require(_0x3342('0x7'));var path=require(_0x3342('0x8'));var sox=require(_0x3342('0x9'));var csv=require(_0x3342('0xa'));var ejs=require(_0x3342('0xb'));var fs=require('fs');var _=require(_0x3342('0xc'));var squel=require(_0x3342('0xd'));var crypto=require(_0x3342('0xe'));var jsforce=require(_0x3342('0xf'));var deskjs=require(_0x3342('0x10'));var toCsv=require(_0x3342('0xa'));var querystring=require(_0x3342('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0x3342('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3342('0x13'))['db'];function respondWithStatusCode(_0x2f3c47,_0x51496d){_0x51496d=_0x51496d||0xcc;return function(_0x2d14c4){if(_0x2d14c4){return _0x2f3c47['sendStatus'](_0x51496d);}return _0x2f3c47[_0x3342('0x14')](_0x51496d)[_0x3342('0x15')]();};}function respondWithResult(_0x592ba8,_0x3e418d){_0x3e418d=_0x3e418d||0xc8;return function(_0x334f0e){if(_0x334f0e){return _0x592ba8[_0x3342('0x14')](_0x3e418d)[_0x3342('0x16')](_0x334f0e);}};}function respondWithFilteredResult(_0x61fcc0,_0x104077){return function(_0x34a306){if(_0x34a306){var _0x59be1d=_0x34a306[_0x3342('0x17')],_0x3e44f3=_0x104077[_0x3342('0x18')],_0x19bd71=_0x104077['offset']+_0x104077['limit'],_0x49afe3;if(_0x19bd71>=_0x59be1d){_0x19bd71=_0x59be1d;_0x49afe3=0xc8;}else{_0x49afe3=0xce;}_0x61fcc0[_0x3342('0x14')](_0x49afe3);return _0x61fcc0[_0x3342('0x19')](_0x3342('0x1a'),_0x3e44f3+'-'+_0x19bd71+'/'+_0x59be1d)[_0x3342('0x16')](_0x34a306);}return null;};}function patchUpdates(_0x12947a){return function(_0x156c24){try{jsonpatch[_0x3342('0x1b')](_0x156c24,_0x12947a,!![]);}catch(_0x3ebf6b){return BPromise[_0x3342('0x1c')](_0x3ebf6b);}return _0x156c24['save']();};}function saveUpdates(_0x283fc1,_0xda235a){return function(_0x2f6395){if(_0x2f6395){return _0x2f6395['update'](_0x283fc1)[_0x3342('0x1d')](function(_0x463324){return _0x463324;});}return null;};}function removeEntity(_0x52f7b7,_0xe774b7){return function(_0x28528b){if(_0x28528b){return _0x28528b['destroy']()[_0x3342('0x1d')](function(){_0x52f7b7['status'](0xcc)[_0x3342('0x15')]();});}};}function handleEntityNotFound(_0x38994e,_0xa23053){return function(_0x2dbad1){if(!_0x2dbad1){_0x38994e[_0x3342('0x1e')](0x194);}return _0x2dbad1;};}function handleError(_0x2925a2,_0x26eb87){_0x26eb87=_0x26eb87||0x1f4;return function(_0x2d8622){logger['error'](_0x2d8622[_0x3342('0x1f')]);if(_0x2d8622['name']){delete _0x2d8622['name'];}_0x2925a2[_0x3342('0x14')](_0x26eb87)['send'](_0x2d8622);};}exports['index']=function(_0x247ee4,_0x58f0f5){var _0x37df78={},_0x543ec3={},_0x524286={'count':0x0,'rows':[]};var _0x55cddd=db[_0x3342('0x20')][_0x3342('0x21')];_0x543ec3[_0x3342('0x22')]=_['keys'](_0x55cddd);var _0xc275a1={'dateStart':_0x247ee4[_0x3342('0x23')][_0x3342('0x24')],'dateEnd':_0x247ee4[_0x3342('0x23')]['dateEnd']};delete _0x247ee4[_0x3342('0x23')][_0x3342('0x24')];delete _0x247ee4[_0x3342('0x23')][_0x3342('0x25')];_0x543ec3[_0x3342('0x23')]=_[_0x3342('0x26')](_0x247ee4[_0x3342('0x23')]);_0x543ec3['filters']=_[_0x3342('0x27')](_0x543ec3['model'],_0x543ec3[_0x3342('0x23')]);_0x37df78[_0x3342('0x28')]=_['intersection'](_0x543ec3[_0x3342('0x22')],qs[_0x3342('0x29')](_0x247ee4[_0x3342('0x23')][_0x3342('0x29')]));_0x37df78['attributes']=_0x37df78[_0x3342('0x28')][_0x3342('0x2a')]?_0x37df78[_0x3342('0x28')]:_0x543ec3[_0x3342('0x22')];if(!_0x247ee4[_0x3342('0x23')][_0x3342('0x2b')](_0x3342('0x2c'))){_0x37df78[_0x3342('0x2d')]=qs[_0x3342('0x2d')](_0x247ee4[_0x3342('0x23')][_0x3342('0x2d')]);_0x37df78[_0x3342('0x18')]=qs['offset'](_0x247ee4['query'][_0x3342('0x18')]);}_0x37df78['order']=qs[_0x3342('0x2e')](_0x247ee4[_0x3342('0x23')][_0x3342('0x2e')]);_0x37df78[_0x3342('0x2f')]=qs[_0x3342('0x30')](_[_0x3342('0x31')](_0x247ee4[_0x3342('0x23')],_0x543ec3['filters']));if(_0xc275a1[_0x3342('0x24')]){if(_0xc275a1[_0x3342('0x25')]){_0xc275a1[_0x3342('0x25')]=moment(_0xc275a1[_0x3342('0x25')])[_0x3342('0x32')](0x1,'day');}else{_0xc275a1[_0x3342('0x25')]=moment(_0xc275a1['dateStart'])[_0x3342('0x32')](0x1,_0x3342('0x33'));}_[_0x3342('0x34')](_0x37df78[_0x3342('0x2f')],{'createdAt':{'$gte':_0xc275a1['dateStart'],'$lte':_0xc275a1[_0x3342('0x25')]}});}if(_0x247ee4['query'][_0x3342('0x35')]){_0x37df78[_0x3342('0x2f')]=_[_0x3342('0x34')](_0x37df78[_0x3342('0x2f')],{'$or':_[_0x3342('0x36')](_0x55cddd,function(_0xf83613){if(_0xf83613[_0x3342('0x37')]['key']!==_0x3342('0x38')){var _0x355e83={};_0x355e83[_0xf83613['field']]={'$like':'%'+_0x247ee4[_0x3342('0x23')][_0x3342('0x35')]+'%'};return _0x355e83;}})});}_0x37df78=_['merge']({},_0x37df78,_0x247ee4[_0x3342('0x39')]);var _0x29f0a0={'where':_0x37df78['where']};return db['SquareMessage']['count'](_0x29f0a0)[_0x3342('0x1d')](function(_0x41e727){_0x524286['count']=_0x41e727;if(_0x247ee4[_0x3342('0x23')][_0x3342('0x3a')]){_0x37df78[_0x3342('0x3b')]=[{'all':!![]}];}return db[_0x3342('0x20')][_0x3342('0x3c')](_0x37df78);})[_0x3342('0x1d')](function(_0x34de7b){_0x524286[_0x3342('0x3d')]=_0x34de7b;return _0x524286;})['then'](respondWithFilteredResult(_0x58f0f5,_0x37df78))['catch'](handleError(_0x58f0f5,null));};exports[_0x3342('0x3e')]=function(_0x7341fa,_0x474196){var _0xee717e={'raw':!![],'where':{'id':_0x7341fa[_0x3342('0x3f')]['id']}},_0x717946={};_0x717946['model']=_[_0x3342('0x26')](db[_0x3342('0x20')][_0x3342('0x21')]);_0x717946[_0x3342('0x23')]=_[_0x3342('0x26')](_0x7341fa[_0x3342('0x23')]);_0x717946['filters']=_[_0x3342('0x27')](_0x717946['model'],_0x717946[_0x3342('0x23')]);_0xee717e[_0x3342('0x28')]=_[_0x3342('0x27')](_0x717946[_0x3342('0x22')],qs['fields'](_0x7341fa[_0x3342('0x23')][_0x3342('0x29')]));_0xee717e['attributes']=_0xee717e[_0x3342('0x28')][_0x3342('0x2a')]?_0xee717e[_0x3342('0x28')]:_0x717946[_0x3342('0x22')];if(_0x7341fa['query'][_0x3342('0x3a')]){_0xee717e[_0x3342('0x3b')]=[{'all':!![]}];}_0xee717e=_['merge']({},_0xee717e,_0x7341fa[_0x3342('0x39')]);return db['SquareMessage']['find'](_0xee717e)[_0x3342('0x1d')](handleEntityNotFound(_0x474196,null))[_0x3342('0x1d')](respondWithResult(_0x474196,null))[_0x3342('0x40')](handleError(_0x474196,null));};exports[_0x3342('0x41')]=function(_0x23925e,_0x171387){return db[_0x3342('0x20')]['create'](_0x23925e['body'],{})[_0x3342('0x1d')](respondWithResult(_0x171387,0xc9))['catch'](handleError(_0x171387,null));};exports[_0x3342('0x42')]=function(_0x5e1202,_0x4c9214){if(_0x5e1202['body']['id']){delete _0x5e1202[_0x3342('0x43')]['id'];}return db[_0x3342('0x20')][_0x3342('0x44')]({'where':{'id':_0x5e1202[_0x3342('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4c9214,null))[_0x3342('0x1d')](saveUpdates(_0x5e1202[_0x3342('0x43')],null))['then'](respondWithResult(_0x4c9214,null))[_0x3342('0x40')](handleError(_0x4c9214,null));};exports[_0x3342('0x45')]=function(_0x43c27a,_0x4c0dc0){return db[_0x3342('0x20')][_0x3342('0x44')]({'where':{'id':_0x43c27a[_0x3342('0x3f')]['id']}})[_0x3342('0x1d')](handleEntityNotFound(_0x4c0dc0,null))[_0x3342('0x1d')](removeEntity(_0x4c0dc0,null))['catch'](handleError(_0x4c0dc0,null));};
\ No newline at end of file
+var _0x9c00=['rawAttributes','keys','dateStart','dateEnd','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','filter','map','type','VIRTUAL','field','merge','options','count','includeAll','include','rows','catch','show','find','create','body','params','destroy','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','stack','name','send','index','SquareMessage'];(function(_0x339ded,_0xaf5015){var _0x23a54e=function(_0x216491){while(--_0x216491){_0x339ded['push'](_0x339ded['shift']());}};_0x23a54e(++_0xaf5015);}(_0x9c00,0x1a0));var _0x09c0=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x9c00[_0x1af05b];return _0x5be7cc;};'use strict';var pdf=require(_0x09c0('0x0'));var emlformat=require(_0x09c0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x09c0('0x2'));var rp=require(_0x09c0('0x3'));var moment=require('moment');var BPromise=require(_0x09c0('0x4'));var Mustache=require(_0x09c0('0x5'));var util=require(_0x09c0('0x6'));var path=require(_0x09c0('0x7'));var sox=require(_0x09c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var qs=require(_0x09c0('0x11'));var logger=require(_0x09c0('0x12'))(_0x09c0('0x13'));var utils=require(_0x09c0('0x14'));var config=require(_0x09c0('0x15'));var db=require(_0x09c0('0x16'))['db'];function respondWithStatusCode(_0x4523ea,_0x179b1b){_0x179b1b=_0x179b1b||0xcc;return function(_0x2a8262){if(_0x2a8262){return _0x4523ea[_0x09c0('0x17')](_0x179b1b);}return _0x4523ea[_0x09c0('0x18')](_0x179b1b)[_0x09c0('0x19')]();};}function respondWithResult(_0x331905,_0x6149a8){_0x6149a8=_0x6149a8||0xc8;return function(_0x2a86da){if(_0x2a86da){return _0x331905[_0x09c0('0x18')](_0x6149a8)[_0x09c0('0x1a')](_0x2a86da);}};}function respondWithFilteredResult(_0x16e490,_0x254598){return function(_0x152140){if(_0x152140){var _0x45a265=_0x152140['count'],_0x33c3d6=_0x254598['offset'],_0x2fdf11=_0x254598[_0x09c0('0x1b')]+_0x254598[_0x09c0('0x1c')],_0x4ff6b7;if(_0x2fdf11>=_0x45a265){_0x2fdf11=_0x45a265;_0x4ff6b7=0xc8;}else{_0x4ff6b7=0xce;}_0x16e490[_0x09c0('0x18')](_0x4ff6b7);return _0x16e490[_0x09c0('0x1d')]('Content-Range',_0x33c3d6+'-'+_0x2fdf11+'/'+_0x45a265)[_0x09c0('0x1a')](_0x152140);}return null;};}function patchUpdates(_0x4aa8a5){return function(_0x4c29a7){try{jsonpatch[_0x09c0('0x1e')](_0x4c29a7,_0x4aa8a5,!![]);}catch(_0x50fccc){return BPromise[_0x09c0('0x1f')](_0x50fccc);}return _0x4c29a7[_0x09c0('0x20')]();};}function saveUpdates(_0x2da257,_0x49064c){return function(_0x23bc34){if(_0x23bc34){return _0x23bc34[_0x09c0('0x21')](_0x2da257)[_0x09c0('0x22')](function(_0x3447c5){return _0x3447c5;});}return null;};}function removeEntity(_0x12bba7,_0xa5d16f){return function(_0x8c6b9a){if(_0x8c6b9a){return _0x8c6b9a['destroy']()[_0x09c0('0x22')](function(){_0x12bba7[_0x09c0('0x18')](0xcc)[_0x09c0('0x19')]();});}};}function handleEntityNotFound(_0x1d18e9,_0x59a76a){return function(_0x4f6824){if(!_0x4f6824){_0x1d18e9[_0x09c0('0x17')](0x194);}return _0x4f6824;};}function handleError(_0x25fdb5,_0x1e8a1c){_0x1e8a1c=_0x1e8a1c||0x1f4;return function(_0x3a5370){logger['error'](_0x3a5370[_0x09c0('0x23')]);if(_0x3a5370[_0x09c0('0x24')]){delete _0x3a5370['name'];}_0x25fdb5[_0x09c0('0x18')](_0x1e8a1c)[_0x09c0('0x25')](_0x3a5370);};}exports[_0x09c0('0x26')]=function(_0x30c2a1,_0x1f8131){var _0x1d2d9d={},_0x45cc64={},_0x35b61c={'count':0x0,'rows':[]};var _0x1ea951=db[_0x09c0('0x27')][_0x09c0('0x28')];_0x45cc64['model']=_[_0x09c0('0x29')](_0x1ea951);var _0x1bdde9={'dateStart':_0x30c2a1['query'][_0x09c0('0x2a')],'dateEnd':_0x30c2a1['query'][_0x09c0('0x2b')]};delete _0x30c2a1['query'][_0x09c0('0x2a')];delete _0x30c2a1[_0x09c0('0x2c')][_0x09c0('0x2b')];_0x45cc64[_0x09c0('0x2c')]=_['keys'](_0x30c2a1['query']);_0x45cc64[_0x09c0('0x2d')]=_[_0x09c0('0x2e')](_0x45cc64[_0x09c0('0x2f')],_0x45cc64['query']);_0x1d2d9d[_0x09c0('0x30')]=_['intersection'](_0x45cc64[_0x09c0('0x2f')],qs[_0x09c0('0x31')](_0x30c2a1[_0x09c0('0x2c')]['fields']));_0x1d2d9d[_0x09c0('0x30')]=_0x1d2d9d[_0x09c0('0x30')][_0x09c0('0x32')]?_0x1d2d9d[_0x09c0('0x30')]:_0x45cc64[_0x09c0('0x2f')];if(!_0x30c2a1[_0x09c0('0x2c')][_0x09c0('0x33')]('nolimit')){_0x1d2d9d[_0x09c0('0x1c')]=qs[_0x09c0('0x1c')](_0x30c2a1[_0x09c0('0x2c')][_0x09c0('0x1c')]);_0x1d2d9d[_0x09c0('0x1b')]=qs['offset'](_0x30c2a1[_0x09c0('0x2c')][_0x09c0('0x1b')]);}_0x1d2d9d[_0x09c0('0x34')]=qs[_0x09c0('0x35')](_0x30c2a1[_0x09c0('0x2c')]['sort']);_0x1d2d9d[_0x09c0('0x36')]=qs[_0x09c0('0x2d')](_[_0x09c0('0x37')](_0x30c2a1[_0x09c0('0x2c')],_0x45cc64[_0x09c0('0x2d')]));if(_0x1bdde9[_0x09c0('0x2a')]){if(_0x1bdde9[_0x09c0('0x2b')]){_0x1bdde9['dateEnd']=moment(_0x1bdde9[_0x09c0('0x2b')])[_0x09c0('0x38')](0x1,_0x09c0('0x39'));}else{_0x1bdde9[_0x09c0('0x2b')]=moment(_0x1bdde9[_0x09c0('0x2a')])['add'](0x1,'day');}_['merge'](_0x1d2d9d['where'],{'createdAt':{'$gte':_0x1bdde9[_0x09c0('0x2a')],'$lte':_0x1bdde9[_0x09c0('0x2b')]}});}if(_0x30c2a1[_0x09c0('0x2c')][_0x09c0('0x3a')]){_0x1d2d9d[_0x09c0('0x36')]=_['merge'](_0x1d2d9d[_0x09c0('0x36')],{'$or':_[_0x09c0('0x3b')](_0x1ea951,function(_0x5374fa){if(_0x5374fa[_0x09c0('0x3c')]['key']!==_0x09c0('0x3d')){var _0x5c80a2={};_0x5c80a2[_0x5374fa[_0x09c0('0x3e')]]={'$like':'%'+_0x30c2a1[_0x09c0('0x2c')]['filter']+'%'};return _0x5c80a2;}})});}_0x1d2d9d=_[_0x09c0('0x3f')]({},_0x1d2d9d,_0x30c2a1[_0x09c0('0x40')]);var _0x5d69fd={'where':_0x1d2d9d[_0x09c0('0x36')]};return db[_0x09c0('0x27')][_0x09c0('0x41')](_0x5d69fd)[_0x09c0('0x22')](function(_0xeb8191){_0x35b61c[_0x09c0('0x41')]=_0xeb8191;if(_0x30c2a1['query'][_0x09c0('0x42')]){_0x1d2d9d[_0x09c0('0x43')]=[{'all':!![]}];}return db[_0x09c0('0x27')]['findAll'](_0x1d2d9d);})[_0x09c0('0x22')](function(_0x30c0c5){_0x35b61c[_0x09c0('0x44')]=_0x30c0c5;return _0x35b61c;})['then'](respondWithFilteredResult(_0x1f8131,_0x1d2d9d))[_0x09c0('0x45')](handleError(_0x1f8131,null));};exports[_0x09c0('0x46')]=function(_0x52cd5c,_0x5bbf4e){var _0x397e73={'raw':!![],'where':{'id':_0x52cd5c['params']['id']}},_0x471078={};_0x471078[_0x09c0('0x2f')]=_[_0x09c0('0x29')](db['SquareMessage'][_0x09c0('0x28')]);_0x471078[_0x09c0('0x2c')]=_[_0x09c0('0x29')](_0x52cd5c[_0x09c0('0x2c')]);_0x471078[_0x09c0('0x2d')]=_['intersection'](_0x471078[_0x09c0('0x2f')],_0x471078['query']);_0x397e73['attributes']=_[_0x09c0('0x2e')](_0x471078[_0x09c0('0x2f')],qs[_0x09c0('0x31')](_0x52cd5c[_0x09c0('0x2c')][_0x09c0('0x31')]));_0x397e73[_0x09c0('0x30')]=_0x397e73['attributes']['length']?_0x397e73['attributes']:_0x471078[_0x09c0('0x2f')];if(_0x52cd5c[_0x09c0('0x2c')][_0x09c0('0x42')]){_0x397e73['include']=[{'all':!![]}];}_0x397e73=_[_0x09c0('0x3f')]({},_0x397e73,_0x52cd5c[_0x09c0('0x40')]);return db[_0x09c0('0x27')][_0x09c0('0x47')](_0x397e73)[_0x09c0('0x22')](handleEntityNotFound(_0x5bbf4e,null))[_0x09c0('0x22')](respondWithResult(_0x5bbf4e,null))[_0x09c0('0x45')](handleError(_0x5bbf4e,null));};exports[_0x09c0('0x48')]=function(_0x3f6d14,_0x38085c){return db[_0x09c0('0x27')][_0x09c0('0x48')](_0x3f6d14[_0x09c0('0x49')],{})[_0x09c0('0x22')](respondWithResult(_0x38085c,0xc9))[_0x09c0('0x45')](handleError(_0x38085c,null));};exports[_0x09c0('0x21')]=function(_0x37e043,_0x14c834){if(_0x37e043[_0x09c0('0x49')]['id']){delete _0x37e043[_0x09c0('0x49')]['id'];}return db['SquareMessage'][_0x09c0('0x47')]({'where':{'id':_0x37e043[_0x09c0('0x4a')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x14c834,null))[_0x09c0('0x22')](saveUpdates(_0x37e043[_0x09c0('0x49')],null))['then'](respondWithResult(_0x14c834,null))[_0x09c0('0x45')](handleError(_0x14c834,null));};exports[_0x09c0('0x4b')]=function(_0x1823c2,_0x4a92c0){return db[_0x09c0('0x27')][_0x09c0('0x47')]({'where':{'id':_0x1823c2[_0x09c0('0x4a')]['id']}})[_0x09c0('0x22')](handleEntityNotFound(_0x4a92c0,null))[_0x09c0('0x22')](removeEntity(_0x4a92c0,null))[_0x09c0('0x45')](handleError(_0x4a92c0,null));};
\ No newline at end of file
index 9a2c473..b33818b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x979e=['util','../../config/logger','api','bluebird','request-promise','./squareMessage.attributes','exports','define','SquareMessage','square_messages'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0x979e,0x1b8));var _0xe979=function(_0x4e3bb5,_0x190041){_0x4e3bb5=_0x4e3bb5-0x0;var _0x2fab02=_0x979e[_0x4e3bb5];return _0x2fab02;};'use strict';var _=require('lodash');var util=require(_0xe979('0x0'));var logger=require(_0xe979('0x1'))(_0xe979('0x2'));var moment=require('moment');var BPromise=require(_0xe979('0x3'));var rp=require(_0xe979('0x4'));var attributes=require(_0xe979('0x5'));module[_0xe979('0x6')]=function(_0x1a3fa9,_0x386b53){return _0x1a3fa9[_0xe979('0x7')](_0xe979('0x8'),attributes,{'tableName':_0xe979('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0273=['square_messages','lodash','util','../../config/logger','api','moment','request-promise','define','SquareMessage'];(function(_0x46367c,_0x25d4ca){var _0x48ffca=function(_0x521473){while(--_0x521473){_0x46367c['push'](_0x46367c['shift']());}};_0x48ffca(++_0x25d4ca);}(_0x0273,0xeb));var _0x3027=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0273[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3027('0x0'));var util=require(_0x3027('0x1'));var logger=require(_0x3027('0x2'))(_0x3027('0x3'));var moment=require(_0x3027('0x4'));var BPromise=require('bluebird');var rp=require(_0x3027('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x1cda05,_0x5d23aa){return _0x1cda05[_0x3027('0x6')](_0x3027('0x7'),attributes,{'tableName':_0x3027('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a38c616..f7b2927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bc3=['catch','CreateSquareMessage','SquareMessage','create','body','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x3d1257,_0x182816){var _0x2dd9bb=function(_0x154115){while(--_0x154115){_0x3d1257['push'](_0x3d1257['shift']());}};_0x2dd9bb(++_0x182816);}(_0x6bc3,0x1f4));var _0x36bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x36bc('0x0'));var util=require(_0x36bc('0x1'));var moment=require('moment');var BPromise=require(_0x36bc('0x2'));var rs=require(_0x36bc('0x3'));var fs=require('fs');var Redis=require(_0x36bc('0x4'));var db=require(_0x36bc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x36bc('0x6'))(_0x36bc('0x7'));var config=require(_0x36bc('0x8'));var jayson=require(_0x36bc('0x9'));var client=jayson[_0x36bc('0xa')][_0x36bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xeca71b,_0x490c37,_0x2dd4dc){return new BPromise(function(_0x26b806,_0x29f11d){return client[_0x36bc('0xc')](_0xeca71b,_0x2dd4dc)[_0x36bc('0xd')](function(_0x24db36){logger['info'](_0x36bc('0xe'),_0x490c37,_0x36bc('0xf'));logger['debug'](_0x36bc('0x10'),_0x490c37,_0x36bc('0xf'),JSON['stringify'](_0x24db36));if(_0x24db36['error']){if(_0x24db36[_0x36bc('0x11')][_0x36bc('0x12')]===0x1f4){logger[_0x36bc('0x11')](_0x36bc('0xe'),_0x490c37,_0x24db36[_0x36bc('0x11')][_0x36bc('0x13')]);return _0x29f11d(_0x24db36['error'][_0x36bc('0x13')]);}logger[_0x36bc('0x11')](_0x36bc('0xe'),_0x490c37,_0x24db36['error']['message']);return _0x26b806(_0x24db36['error']['message']);}else{logger[_0x36bc('0x14')](_0x36bc('0xe'),_0x490c37,_0x36bc('0xf'));_0x26b806(_0x24db36[_0x36bc('0x15')][_0x36bc('0x13')]);}})[_0x36bc('0x16')](function(_0x2962f2){logger[_0x36bc('0x11')](_0x36bc('0xe'),_0x490c37,_0x2962f2);_0x29f11d(_0x2962f2);});});}exports[_0x36bc('0x17')]=function(_0x28d7da){var _0x3674ef=this;return new Promise(function(_0x8bb5d2,_0x58c65c){return db[_0x36bc('0x18')][_0x36bc('0x19')](_0x28d7da[_0x36bc('0x1a')],{'raw':_0x28d7da['options']?_0x28d7da['options']['raw']===undefined?!![]:![]:!![]})[_0x36bc('0xd')](function(_0x4be3ce){logger[_0x36bc('0x14')](_0x36bc('0x17'),_0x28d7da);logger[_0x36bc('0x1b')]('CreateSquareMessage',_0x28d7da,JSON[_0x36bc('0x1c')](_0x4be3ce));_0x8bb5d2(_0x4be3ce);})[_0x36bc('0x16')](function(_0x2405fc){logger['error'](_0x36bc('0x17'),_0x2405fc[_0x36bc('0x13')],_0x28d7da);_0x58c65c(_0x3674ef[_0x36bc('0x11')](0x1f4,_0x2405fc[_0x36bc('0x13')]));});});};
\ No newline at end of file
+var _0x9d1a=['message','result','catch','CreateSquareMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x338c8e,_0x5b1bc3){var _0x5e5be3=function(_0x475696){while(--_0x475696){_0x338c8e['push'](_0x338c8e['shift']());}};_0x5e5be3(++_0x5b1bc3);}(_0x9d1a,0x173));var _0xa9d1=function(_0x34a10c,_0x7ce96a){_0x34a10c=_0x34a10c-0x0;var _0x3015ab=_0x9d1a[_0x34a10c];return _0x3015ab;};'use strict';var _=require(_0xa9d1('0x0'));var util=require(_0xa9d1('0x1'));var moment=require(_0xa9d1('0x2'));var BPromise=require('bluebird');var rs=require(_0xa9d1('0x3'));var fs=require('fs');var Redis=require(_0xa9d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9d1('0x5'));var logger=require(_0xa9d1('0x6'))(_0xa9d1('0x7'));var config=require(_0xa9d1('0x8'));var jayson=require(_0xa9d1('0x9'));var client=jayson[_0xa9d1('0xa')][_0xa9d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x67ee5d,_0x38fbeb,_0xbaab9c){return new BPromise(function(_0x22615b,_0x41bd8b){return client[_0xa9d1('0xc')](_0x67ee5d,_0xbaab9c)[_0xa9d1('0xd')](function(_0x332b2e){logger[_0xa9d1('0xe')](_0xa9d1('0xf'),_0x38fbeb,_0xa9d1('0x10'));logger[_0xa9d1('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x38fbeb,_0xa9d1('0x10'),JSON[_0xa9d1('0x12')](_0x332b2e));if(_0x332b2e['error']){if(_0x332b2e['error'][_0xa9d1('0x13')]===0x1f4){logger[_0xa9d1('0x14')]('SquareMessage,\x20%s,\x20%s',_0x38fbeb,_0x332b2e[_0xa9d1('0x14')][_0xa9d1('0x15')]);return _0x41bd8b(_0x332b2e[_0xa9d1('0x14')][_0xa9d1('0x15')]);}logger[_0xa9d1('0x14')]('SquareMessage,\x20%s,\x20%s',_0x38fbeb,_0x332b2e[_0xa9d1('0x14')][_0xa9d1('0x15')]);return _0x22615b(_0x332b2e[_0xa9d1('0x14')][_0xa9d1('0x15')]);}else{logger[_0xa9d1('0xe')](_0xa9d1('0xf'),_0x38fbeb,_0xa9d1('0x10'));_0x22615b(_0x332b2e[_0xa9d1('0x16')]['message']);}})[_0xa9d1('0x17')](function(_0x50733c){logger[_0xa9d1('0x14')](_0xa9d1('0xf'),_0x38fbeb,_0x50733c);_0x41bd8b(_0x50733c);});});}exports[_0xa9d1('0x18')]=function(_0x3708f7){var _0x130dc7=this;return new Promise(function(_0x3a1e31,_0x29b2c9){return db['SquareMessage']['create'](_0x3708f7[_0xa9d1('0x19')],{'raw':_0x3708f7[_0xa9d1('0x1a')]?_0x3708f7[_0xa9d1('0x1a')][_0xa9d1('0x1b')]===undefined?!![]:![]:!![]})[_0xa9d1('0xd')](function(_0x28d7c7){logger['info']('CreateSquareMessage',_0x3708f7);logger[_0xa9d1('0x11')]('CreateSquareMessage',_0x3708f7,JSON[_0xa9d1('0x12')](_0x28d7c7));_0x3a1e31(_0x28d7c7);})[_0xa9d1('0x17')](function(_0x5ef18a){logger[_0xa9d1('0x14')]('CreateSquareMessage',_0x5ef18a[_0xa9d1('0x15')],_0x3708f7);_0x29b2c9(_0x130dc7[_0xa9d1('0x14')](0x1f4,_0x5ef18a[_0xa9d1('0x15')]));});});};
\ No newline at end of file
index 7b44336..03a8fd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8db0=['get','show','/:id/test','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x8db0,0x65));var _0x08db=function(_0x4a9beb,_0x159482){_0x4a9beb=_0x4a9beb-0x0;var _0x2d4c58=_0x8db0[_0x4a9beb];return _0x2d4c58;};'use strict';var multer=require(_0x08db('0x0'));var util=require(_0x08db('0x1'));var path=require('path');var timeout=require(_0x08db('0x2'));var express=require(_0x08db('0x3'));var router=express[_0x08db('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x08db('0x5'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router['get']('/',auth[_0x08db('0x6')](),controller['index']);router[_0x08db('0x7')]('/:id',auth[_0x08db('0x6')](),controller[_0x08db('0x8')]);router[_0x08db('0x7')](_0x08db('0x9'),auth[_0x08db('0x6')](),timeout('15s'),controller['test']);router[_0x08db('0xa')]('/',auth[_0x08db('0x6')](),controller[_0x08db('0xb')]);router[_0x08db('0xc')](_0x08db('0xd'),auth[_0x08db('0x6')](),controller[_0x08db('0xe')]);router[_0x08db('0xf')](_0x08db('0xd'),auth[_0x08db('0x6')](),controller[_0x08db('0x10')]);module[_0x08db('0x11')]=router;
\ No newline at end of file
+var _0x22a4=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','post','put','/:id','update','delete','exports','multer','util','path'];(function(_0x35f22f,_0x2cacb5){var _0x42a005=function(_0x538b38){while(--_0x538b38){_0x35f22f['push'](_0x35f22f['shift']());}};_0x42a005(++_0x2cacb5);}(_0x22a4,0x1cb));var _0x422a=function(_0x1c44f5,_0x1de2bd){_0x1c44f5=_0x1c44f5-0x0;var _0x527ce0=_0x22a4[_0x1c44f5];return _0x527ce0;};'use strict';var multer=require(_0x422a('0x0'));var util=require(_0x422a('0x1'));var path=require(_0x422a('0x2'));var timeout=require(_0x422a('0x3'));var express=require(_0x422a('0x4'));var router=express[_0x422a('0x5')]();var auth=require(_0x422a('0x6'));var interaction=require(_0x422a('0x7'));var config=require('../../config/environment');var controller=require(_0x422a('0x8'));router[_0x422a('0x9')]('/',auth[_0x422a('0xa')](),controller[_0x422a('0xb')]);router[_0x422a('0x9')]('/:id',auth[_0x422a('0xa')](),controller[_0x422a('0xc')]);router[_0x422a('0x9')](_0x422a('0xd'),auth[_0x422a('0xa')](),timeout(_0x422a('0xe')),controller[_0x422a('0xf')]);router[_0x422a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x422a('0x11')](_0x422a('0x12'),auth[_0x422a('0xa')](),controller[_0x422a('0x13')]);router[_0x422a('0x14')](_0x422a('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x422a('0x15')]=router;
\ No newline at end of file
index 1849d98..31b9d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6047=['exports','STRING','name'];(function(_0x37e553,_0x3fe6fb){var _0x2edff7=function(_0x1f4e47){while(--_0x1f4e47){_0x37e553['push'](_0x37e553['shift']());}};_0x2edff7(++_0x3fe6fb);}(_0x6047,0x75));var _0x7604=function(_0xcf3920,_0x20b569){_0xcf3920=_0xcf3920-0x0;var _0x2222c6=_0x6047[_0xcf3920];return _0x2222c6;};'use strict';var Sequelize=require('sequelize');module[_0x7604('0x0')]={'name':{'type':Sequelize[_0x7604('0x1')],'unique':_0x7604('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7604('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfd8c=['STRING','name','sequelize'];(function(_0x427473,_0x5c801c){var _0x50ae3d=function(_0x3769c6){while(--_0x3769c6){_0x427473['push'](_0x427473['shift']());}};_0x50ae3d(++_0x5c801c);}(_0xfd8c,0x9e));var _0xcfd8=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0xfd8c[_0x4cd21c];return _0x5d8e5e;};'use strict';var Sequelize=require(_0xcfd8('0x0'));module['exports']={'name':{'type':Sequelize[_0xcfd8('0x1')],'unique':_0xcfd8('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcfd8('0x1')]}};
\ No newline at end of file
index 9d8c508..80329d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcea0=['query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','type','key','VIRTUAL','field','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','ODBC','UserProfileResource','error','stack','send','index','SquareOdbc','rawAttributes','model','keys','dateStart'];(function(_0x7e9e04,_0xb3b10){var _0x1e501b=function(_0x885d17){while(--_0x885d17){_0x7e9e04['push'](_0x7e9e04['shift']());}};_0x1e501b(++_0xb3b10);}(_0xcea0,0x198));var _0x0cea=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xcea0[_0x4792c8];return _0x35edb1;};'use strict';var pdf=require(_0x0cea('0x0'));var emlformat=require(_0x0cea('0x1'));var rimraf=require(_0x0cea('0x2'));var zipdir=require(_0x0cea('0x3'));var jsonpatch=require(_0x0cea('0x4'));var rp=require(_0x0cea('0x5'));var moment=require(_0x0cea('0x6'));var BPromise=require(_0x0cea('0x7'));var Mustache=require(_0x0cea('0x8'));var util=require(_0x0cea('0x9'));var path=require(_0x0cea('0xa'));var sox=require(_0x0cea('0xb'));var csv=require(_0x0cea('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0cea('0xd'));var squel=require(_0x0cea('0xe'));var crypto=require('crypto');var jsforce=require(_0x0cea('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0cea('0xc'));var querystring=require(_0x0cea('0x10'));var Papa=require(_0x0cea('0x11'));var Redis=require(_0x0cea('0x12'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x0cea('0x13'));var utils=require('../../config/utils');var config=require(_0x0cea('0x14'));var db=require(_0x0cea('0x15'))['db'];function respondWithStatusCode(_0x4ce08e,_0x236090){_0x236090=_0x236090||0xcc;return function(_0x33edce){if(_0x33edce){return _0x4ce08e[_0x0cea('0x16')](_0x236090);}return _0x4ce08e[_0x0cea('0x17')](_0x236090)[_0x0cea('0x18')]();};}function respondWithResult(_0x46171d,_0xa35560){_0xa35560=_0xa35560||0xc8;return function(_0x3f94d0){if(_0x3f94d0){return _0x46171d[_0x0cea('0x17')](_0xa35560)[_0x0cea('0x19')](_0x3f94d0);}};}function respondWithFilteredResult(_0x472b20,_0xfc777c){return function(_0x4176de){if(_0x4176de){var _0x5c6e62=_0x4176de[_0x0cea('0x1a')],_0x5507b4=_0xfc777c[_0x0cea('0x1b')],_0x3cda71=_0xfc777c['offset']+_0xfc777c[_0x0cea('0x1c')],_0x468dd9;if(_0x3cda71>=_0x5c6e62){_0x3cda71=_0x5c6e62;_0x468dd9=0xc8;}else{_0x468dd9=0xce;}_0x472b20[_0x0cea('0x17')](_0x468dd9);return _0x472b20[_0x0cea('0x1d')](_0x0cea('0x1e'),_0x5507b4+'-'+_0x3cda71+'/'+_0x5c6e62)[_0x0cea('0x19')](_0x4176de);}return null;};}function patchUpdates(_0x517b91){return function(_0x48efd1){try{jsonpatch[_0x0cea('0x1f')](_0x48efd1,_0x517b91,!![]);}catch(_0x1a4ba7){return BPromise['reject'](_0x1a4ba7);}return _0x48efd1[_0x0cea('0x20')]();};}function saveUpdates(_0x8c6ba,_0x14335b){return function(_0x348575){if(_0x348575){return _0x348575[_0x0cea('0x21')](_0x8c6ba)[_0x0cea('0x22')](function(_0x1aa72f){return _0x1aa72f;});}return null;};}function removeEntity(_0x3b1b0c,_0x565250){return function(_0x2114ab){if(_0x2114ab){return _0x2114ab[_0x0cea('0x23')]()[_0x0cea('0x22')](function(){var _0x295fae=_0x2114ab['get']({'plain':!![]});var _0x5c07bc=_0x0cea('0x24');return db[_0x0cea('0x25')][_0x0cea('0x23')]({'where':{'type':_0x5c07bc,'resourceId':_0x295fae['id']}})[_0x0cea('0x22')](function(){return _0x2114ab;});})[_0x0cea('0x22')](function(){_0x3b1b0c['status'](0xcc)[_0x0cea('0x18')]();});}};}function handleEntityNotFound(_0x1e5a8b,_0x3f8ac2){return function(_0x13bdcb){if(!_0x13bdcb){_0x1e5a8b[_0x0cea('0x16')](0x194);}return _0x13bdcb;};}function handleError(_0x4fee9f,_0x3ac600){_0x3ac600=_0x3ac600||0x1f4;return function(_0x29eec7){logger[_0x0cea('0x26')](_0x29eec7[_0x0cea('0x27')]);if(_0x29eec7['name']){delete _0x29eec7['name'];}_0x4fee9f[_0x0cea('0x17')](_0x3ac600)[_0x0cea('0x28')](_0x29eec7);};}exports[_0x0cea('0x29')]=function(_0x26c06f,_0x15f1b7){var _0x50af80={},_0x1ef185={},_0x5e5edc={'count':0x0,'rows':[]};var _0x29c51f=db[_0x0cea('0x2a')][_0x0cea('0x2b')];_0x1ef185[_0x0cea('0x2c')]=_[_0x0cea('0x2d')](_0x29c51f);var _0xd13265={'dateStart':_0x26c06f['query'][_0x0cea('0x2e')],'dateEnd':_0x26c06f[_0x0cea('0x2f')][_0x0cea('0x30')]};delete _0x26c06f['query'][_0x0cea('0x2e')];delete _0x26c06f[_0x0cea('0x2f')][_0x0cea('0x30')];_0x1ef185[_0x0cea('0x2f')]=_[_0x0cea('0x2d')](_0x26c06f['query']);_0x1ef185[_0x0cea('0x31')]=_[_0x0cea('0x32')](_0x1ef185[_0x0cea('0x2c')],_0x1ef185[_0x0cea('0x2f')]);_0x50af80[_0x0cea('0x33')]=_[_0x0cea('0x32')](_0x1ef185['model'],qs[_0x0cea('0x34')](_0x26c06f[_0x0cea('0x2f')][_0x0cea('0x34')]));_0x50af80[_0x0cea('0x33')]=_0x50af80['attributes'][_0x0cea('0x35')]?_0x50af80[_0x0cea('0x33')]:_0x1ef185[_0x0cea('0x2c')];if(!_0x26c06f[_0x0cea('0x2f')][_0x0cea('0x36')]('nolimit')){_0x50af80[_0x0cea('0x1c')]=qs[_0x0cea('0x1c')](_0x26c06f[_0x0cea('0x2f')][_0x0cea('0x1c')]);_0x50af80[_0x0cea('0x1b')]=qs[_0x0cea('0x1b')](_0x26c06f[_0x0cea('0x2f')][_0x0cea('0x1b')]);}_0x50af80[_0x0cea('0x37')]=qs[_0x0cea('0x38')](_0x26c06f['query'][_0x0cea('0x38')]);_0x50af80[_0x0cea('0x39')]=qs[_0x0cea('0x31')](_[_0x0cea('0x3a')](_0x26c06f[_0x0cea('0x2f')],_0x1ef185[_0x0cea('0x31')]));if(_0xd13265[_0x0cea('0x2e')]){if(_0xd13265[_0x0cea('0x30')]){_0xd13265[_0x0cea('0x30')]=moment(_0xd13265['dateEnd'])[_0x0cea('0x3b')](0x1,_0x0cea('0x3c'));}else{_0xd13265[_0x0cea('0x30')]=moment(_0xd13265[_0x0cea('0x2e')])[_0x0cea('0x3b')](0x1,_0x0cea('0x3c'));}_[_0x0cea('0x3d')](_0x50af80[_0x0cea('0x39')],{'createdAt':{'$gte':_0xd13265['dateStart'],'$lte':_0xd13265[_0x0cea('0x30')]}});}if(_0x26c06f[_0x0cea('0x2f')][_0x0cea('0x3e')]){_0x50af80[_0x0cea('0x39')]=_['merge'](_0x50af80[_0x0cea('0x39')],{'$or':_['map'](_0x29c51f,function(_0x479f51){if(_0x479f51[_0x0cea('0x3f')][_0x0cea('0x40')]!==_0x0cea('0x41')){var _0x122240={};_0x122240[_0x479f51[_0x0cea('0x42')]]={'$like':'%'+_0x26c06f[_0x0cea('0x2f')][_0x0cea('0x3e')]+'%'};return _0x122240;}})});}_0x50af80=_[_0x0cea('0x3d')]({},_0x50af80,_0x26c06f['options']);var _0x4a6761={'where':_0x50af80[_0x0cea('0x39')]};return db[_0x0cea('0x2a')][_0x0cea('0x1a')](_0x4a6761)[_0x0cea('0x22')](function(_0xb61a9f){_0x5e5edc[_0x0cea('0x1a')]=_0xb61a9f;if(_0x26c06f['query'][_0x0cea('0x43')]){_0x50af80[_0x0cea('0x44')]=[{'all':!![]}];}return db[_0x0cea('0x2a')][_0x0cea('0x45')](_0x50af80);})[_0x0cea('0x22')](function(_0x18516b){_0x5e5edc['rows']=_0x18516b;return _0x5e5edc;})[_0x0cea('0x22')](respondWithFilteredResult(_0x15f1b7,_0x50af80))[_0x0cea('0x46')](handleError(_0x15f1b7,null));};exports[_0x0cea('0x47')]=function(_0x39c69b,_0x34b4ca){var _0x31a7a8={'raw':!![],'where':{'id':_0x39c69b[_0x0cea('0x48')]['id']}},_0x136abe={};_0x136abe[_0x0cea('0x2c')]=_[_0x0cea('0x2d')](db[_0x0cea('0x2a')][_0x0cea('0x2b')]);_0x136abe['query']=_[_0x0cea('0x2d')](_0x39c69b[_0x0cea('0x2f')]);_0x136abe[_0x0cea('0x31')]=_['intersection'](_0x136abe[_0x0cea('0x2c')],_0x136abe['query']);_0x31a7a8[_0x0cea('0x33')]=_['intersection'](_0x136abe[_0x0cea('0x2c')],qs[_0x0cea('0x34')](_0x39c69b['query'][_0x0cea('0x34')]));_0x31a7a8[_0x0cea('0x33')]=_0x31a7a8[_0x0cea('0x33')][_0x0cea('0x35')]?_0x31a7a8['attributes']:_0x136abe[_0x0cea('0x2c')];if(_0x39c69b['query']['includeAll']){_0x31a7a8[_0x0cea('0x44')]=[{'all':!![]}];}_0x31a7a8=_[_0x0cea('0x3d')]({},_0x31a7a8,_0x39c69b[_0x0cea('0x49')]);return db[_0x0cea('0x2a')][_0x0cea('0x4a')](_0x31a7a8)[_0x0cea('0x22')](handleEntityNotFound(_0x34b4ca,null))[_0x0cea('0x22')](respondWithResult(_0x34b4ca,null))[_0x0cea('0x46')](handleError(_0x34b4ca,null));};exports[_0x0cea('0x4b')]=function(_0x1f971b,_0x2d9123){return db[_0x0cea('0x2a')][_0x0cea('0x4b')](_0x1f971b[_0x0cea('0x4c')],{})[_0x0cea('0x22')](function(_0x51cfb9){var _0x5c0283=_0x1f971b[_0x0cea('0x4d')][_0x0cea('0x4e')]({'plain':!![]});if(!_0x5c0283)throw new Error(_0x0cea('0x4f'));if(_0x5c0283[_0x0cea('0x50')]===_0x0cea('0x4d')){var _0x3aee93=_0x51cfb9[_0x0cea('0x4e')]({'plain':!![]});var _0x50d04f=_0x0cea('0x24');return db[_0x0cea('0x51')][_0x0cea('0x4a')]({'where':{'name':_0x50d04f,'userProfileId':_0x5c0283[_0x0cea('0x52')]},'raw':!![]})[_0x0cea('0x22')](function(_0x492620){if(_0x492620&&_0x492620[_0x0cea('0x53')]===0x0){return db[_0x0cea('0x25')]['create']({'name':_0x3aee93[_0x0cea('0x54')],'resourceId':_0x3aee93['id'],'type':_0x492620[_0x0cea('0x54')],'sectionId':_0x492620['id']},{})['then'](function(){return _0x51cfb9;});}else{return _0x51cfb9;}})[_0x0cea('0x46')](function(_0x36616e){logger[_0x0cea('0x26')](_0x0cea('0x55'),_0x36616e);throw _0x36616e;});}return _0x51cfb9;})['then'](respondWithResult(_0x2d9123,0xc9))['catch'](handleError(_0x2d9123,null));};exports[_0x0cea('0x21')]=function(_0x54643d,_0x542234){if(_0x54643d['body']['id']){delete _0x54643d['body']['id'];}return db[_0x0cea('0x2a')]['find']({'where':{'id':_0x54643d[_0x0cea('0x48')]['id']}})[_0x0cea('0x22')](handleEntityNotFound(_0x542234,null))[_0x0cea('0x22')](saveUpdates(_0x54643d[_0x0cea('0x4c')],null))['then'](respondWithResult(_0x542234,null))['catch'](handleError(_0x542234,null));};exports[_0x0cea('0x23')]=function(_0x38d88e,_0x551a27){return db['SquareOdbc'][_0x0cea('0x4a')]({'where':{'id':_0x38d88e[_0x0cea('0x48')]['id']}})[_0x0cea('0x22')](handleEntityNotFound(_0x551a27,null))[_0x0cea('0x22')](removeEntity(_0x551a27,null))['catch'](handleError(_0x551a27,null));};exports[_0x0cea('0x56')]=function(_0x4624f9,_0x520d6b,_0x2a01c5){var _0x17a9e1;return db[_0x0cea('0x2a')][_0x0cea('0x4a')]({'where':{'id':_0x4624f9[_0x0cea('0x48')]['id']},'attributes':['id',_0x0cea('0x57')]})[_0x0cea('0x22')](handleEntityNotFound(_0x520d6b,null))[_0x0cea('0x22')](function(_0xb8ab58){if(_0xb8ab58){var _0x590d63=require(_0x0cea('0x58'))();_0x590d63[_0x0cea('0x59')](_0xb8ab58[_0x0cea('0x57')]);_0x590d63[_0x0cea('0x5a')]();return _0xb8ab58;}})[_0x0cea('0x22')](respondWithResult(_0x520d6b,null))[_0x0cea('0x46')](handleError(_0x520d6b,null));};
\ No newline at end of file
+var _0x978c=['get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','order','sort','where','pick','add','day','filter','map','type','key','options','SquareOdbc','include','show','params','rawAttributes','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','catch','update','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','reject','save','then'];(function(_0x11b364,_0x385d3c){var _0x547f33=function(_0x157c00){while(--_0x157c00){_0x11b364['push'](_0x11b364['shift']());}};_0x547f33(++_0x385d3c);}(_0x978c,0x82));var _0xc978=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x978c[_0x5d4607];return _0x5e4a86;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc978('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc978('0x1'));var jsonpatch=require(_0xc978('0x2'));var rp=require(_0xc978('0x3'));var moment=require(_0xc978('0x4'));var BPromise=require(_0xc978('0x5'));var Mustache=require(_0xc978('0x6'));var util=require(_0xc978('0x7'));var path=require(_0xc978('0x8'));var sox=require('sox');var csv=require(_0xc978('0x9'));var ejs=require(_0xc978('0xa'));var fs=require('fs');var _=require(_0xc978('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc978('0xc'));var deskjs=require(_0xc978('0xd'));var toCsv=require(_0xc978('0x9'));var querystring=require(_0xc978('0xe'));var Papa=require(_0xc978('0xf'));var Redis=require(_0xc978('0x10'));var qs=require(_0xc978('0x11'));var logger=require(_0xc978('0x12'))('api');var utils=require(_0xc978('0x13'));var config=require(_0xc978('0x14'));var db=require(_0xc978('0x15'))['db'];function respondWithStatusCode(_0x2c08a1,_0x4299a7){_0x4299a7=_0x4299a7||0xcc;return function(_0x495823){if(_0x495823){return _0x2c08a1[_0xc978('0x16')](_0x4299a7);}return _0x2c08a1['status'](_0x4299a7)[_0xc978('0x17')]();};}function respondWithResult(_0x47ad89,_0x5a1c38){_0x5a1c38=_0x5a1c38||0xc8;return function(_0x5265e3){if(_0x5265e3){return _0x47ad89[_0xc978('0x18')](_0x5a1c38)[_0xc978('0x19')](_0x5265e3);}};}function respondWithFilteredResult(_0x24158e,_0xcc3d48){return function(_0x237c74){if(_0x237c74){var _0x22c1ca=_0x237c74[_0xc978('0x1a')],_0x227fa5=_0xcc3d48[_0xc978('0x1b')],_0x52446e=_0xcc3d48[_0xc978('0x1b')]+_0xcc3d48[_0xc978('0x1c')],_0x146041;if(_0x52446e>=_0x22c1ca){_0x52446e=_0x22c1ca;_0x146041=0xc8;}else{_0x146041=0xce;}_0x24158e[_0xc978('0x18')](_0x146041);return _0x24158e['set']('Content-Range',_0x227fa5+'-'+_0x52446e+'/'+_0x22c1ca)[_0xc978('0x19')](_0x237c74);}return null;};}function patchUpdates(_0x1d6a7f){return function(_0x2d293a){try{jsonpatch['apply'](_0x2d293a,_0x1d6a7f,!![]);}catch(_0x1bfe18){return BPromise[_0xc978('0x1d')](_0x1bfe18);}return _0x2d293a[_0xc978('0x1e')]();};}function saveUpdates(_0x21d021,_0x4516f5){return function(_0x3832c8){if(_0x3832c8){return _0x3832c8['update'](_0x21d021)[_0xc978('0x1f')](function(_0x417448){return _0x417448;});}return null;};}function removeEntity(_0x4f688f,_0x3d420e){return function(_0x5a5a52){if(_0x5a5a52){return _0x5a5a52['destroy']()[_0xc978('0x1f')](function(){var _0x398c15=_0x5a5a52[_0xc978('0x20')]({'plain':!![]});var _0x2a3cee=_0xc978('0x21');return db[_0xc978('0x22')][_0xc978('0x23')]({'where':{'type':_0x2a3cee,'resourceId':_0x398c15['id']}})['then'](function(){return _0x5a5a52;});})[_0xc978('0x1f')](function(){_0x4f688f[_0xc978('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1de53a,_0xd7f5c5){return function(_0x485943){if(!_0x485943){_0x1de53a['sendStatus'](0x194);}return _0x485943;};}function handleError(_0x50e8fa,_0xf1ce42){_0xf1ce42=_0xf1ce42||0x1f4;return function(_0x11bdf0){logger[_0xc978('0x24')](_0x11bdf0[_0xc978('0x25')]);if(_0x11bdf0[_0xc978('0x26')]){delete _0x11bdf0[_0xc978('0x26')];}_0x50e8fa[_0xc978('0x18')](_0xf1ce42)[_0xc978('0x27')](_0x11bdf0);};}exports[_0xc978('0x28')]=function(_0x4a0ea6,_0x4c1944){var _0x56af61={},_0x39770c={},_0x5789d3={'count':0x0,'rows':[]};var _0x156180=db['SquareOdbc']['rawAttributes'];_0x39770c[_0xc978('0x29')]=_['keys'](_0x156180);var _0x49064f={'dateStart':_0x4a0ea6[_0xc978('0x2a')][_0xc978('0x2b')],'dateEnd':_0x4a0ea6[_0xc978('0x2a')][_0xc978('0x2c')]};delete _0x4a0ea6[_0xc978('0x2a')][_0xc978('0x2b')];delete _0x4a0ea6[_0xc978('0x2a')][_0xc978('0x2c')];_0x39770c[_0xc978('0x2a')]=_[_0xc978('0x2d')](_0x4a0ea6['query']);_0x39770c[_0xc978('0x2e')]=_[_0xc978('0x2f')](_0x39770c[_0xc978('0x29')],_0x39770c[_0xc978('0x2a')]);_0x56af61[_0xc978('0x30')]=_[_0xc978('0x2f')](_0x39770c[_0xc978('0x29')],qs[_0xc978('0x31')](_0x4a0ea6[_0xc978('0x2a')][_0xc978('0x31')]));_0x56af61[_0xc978('0x30')]=_0x56af61[_0xc978('0x30')]['length']?_0x56af61[_0xc978('0x30')]:_0x39770c[_0xc978('0x29')];if(!_0x4a0ea6[_0xc978('0x2a')]['hasOwnProperty']('nolimit')){_0x56af61[_0xc978('0x1c')]=qs[_0xc978('0x1c')](_0x4a0ea6[_0xc978('0x2a')][_0xc978('0x1c')]);_0x56af61[_0xc978('0x1b')]=qs[_0xc978('0x1b')](_0x4a0ea6[_0xc978('0x2a')]['offset']);}_0x56af61[_0xc978('0x32')]=qs[_0xc978('0x33')](_0x4a0ea6[_0xc978('0x2a')][_0xc978('0x33')]);_0x56af61[_0xc978('0x34')]=qs[_0xc978('0x2e')](_[_0xc978('0x35')](_0x4a0ea6[_0xc978('0x2a')],_0x39770c[_0xc978('0x2e')]));if(_0x49064f[_0xc978('0x2b')]){if(_0x49064f['dateEnd']){_0x49064f[_0xc978('0x2c')]=moment(_0x49064f[_0xc978('0x2c')])[_0xc978('0x36')](0x1,_0xc978('0x37'));}else{_0x49064f[_0xc978('0x2c')]=moment(_0x49064f[_0xc978('0x2b')])[_0xc978('0x36')](0x1,_0xc978('0x37'));}_['merge'](_0x56af61[_0xc978('0x34')],{'createdAt':{'$gte':_0x49064f[_0xc978('0x2b')],'$lte':_0x49064f['dateEnd']}});}if(_0x4a0ea6[_0xc978('0x2a')][_0xc978('0x38')]){_0x56af61['where']=_['merge'](_0x56af61[_0xc978('0x34')],{'$or':_[_0xc978('0x39')](_0x156180,function(_0x48a588){if(_0x48a588[_0xc978('0x3a')][_0xc978('0x3b')]!=='VIRTUAL'){var _0x307a02={};_0x307a02[_0x48a588['field']]={'$like':'%'+_0x4a0ea6['query']['filter']+'%'};return _0x307a02;}})});}_0x56af61=_['merge']({},_0x56af61,_0x4a0ea6[_0xc978('0x3c')]);var _0x5703b8={'where':_0x56af61[_0xc978('0x34')]};return db[_0xc978('0x3d')][_0xc978('0x1a')](_0x5703b8)[_0xc978('0x1f')](function(_0x96854f){_0x5789d3[_0xc978('0x1a')]=_0x96854f;if(_0x4a0ea6['query']['includeAll']){_0x56af61[_0xc978('0x3e')]=[{'all':!![]}];}return db[_0xc978('0x3d')]['findAll'](_0x56af61);})[_0xc978('0x1f')](function(_0x4ed3d7){_0x5789d3['rows']=_0x4ed3d7;return _0x5789d3;})['then'](respondWithFilteredResult(_0x4c1944,_0x56af61))['catch'](handleError(_0x4c1944,null));};exports[_0xc978('0x3f')]=function(_0x36d3c7,_0x17adb6){var _0x110cd9={'raw':!![],'where':{'id':_0x36d3c7[_0xc978('0x40')]['id']}},_0x7e6ba9={};_0x7e6ba9[_0xc978('0x29')]=_[_0xc978('0x2d')](db[_0xc978('0x3d')][_0xc978('0x41')]);_0x7e6ba9[_0xc978('0x2a')]=_[_0xc978('0x2d')](_0x36d3c7[_0xc978('0x2a')]);_0x7e6ba9[_0xc978('0x2e')]=_[_0xc978('0x2f')](_0x7e6ba9[_0xc978('0x29')],_0x7e6ba9[_0xc978('0x2a')]);_0x110cd9[_0xc978('0x30')]=_[_0xc978('0x2f')](_0x7e6ba9[_0xc978('0x29')],qs[_0xc978('0x31')](_0x36d3c7[_0xc978('0x2a')]['fields']));_0x110cd9[_0xc978('0x30')]=_0x110cd9[_0xc978('0x30')]['length']?_0x110cd9[_0xc978('0x30')]:_0x7e6ba9[_0xc978('0x29')];if(_0x36d3c7['query'][_0xc978('0x42')]){_0x110cd9[_0xc978('0x3e')]=[{'all':!![]}];}_0x110cd9=_['merge']({},_0x110cd9,_0x36d3c7['options']);return db[_0xc978('0x3d')][_0xc978('0x43')](_0x110cd9)[_0xc978('0x1f')](handleEntityNotFound(_0x17adb6,null))[_0xc978('0x1f')](respondWithResult(_0x17adb6,null))['catch'](handleError(_0x17adb6,null));};exports['create']=function(_0x5836d5,_0x221c58){return db[_0xc978('0x3d')]['create'](_0x5836d5[_0xc978('0x44')],{})[_0xc978('0x1f')](function(_0x3a1411){var _0x2511bf=_0x5836d5[_0xc978('0x45')][_0xc978('0x20')]({'plain':!![]});if(!_0x2511bf)throw new Error(_0xc978('0x46'));if(_0x2511bf['role']===_0xc978('0x45')){var _0x2ecc04=_0x3a1411[_0xc978('0x20')]({'plain':!![]});var _0x563a35='ODBC';return db[_0xc978('0x47')]['find']({'where':{'name':_0x563a35,'userProfileId':_0x2511bf[_0xc978('0x48')]},'raw':!![]})[_0xc978('0x1f')](function(_0x290d88){if(_0x290d88&&_0x290d88['autoAssociation']===0x0){return db[_0xc978('0x22')][_0xc978('0x49')]({'name':_0x2ecc04['name'],'resourceId':_0x2ecc04['id'],'type':_0x290d88[_0xc978('0x26')],'sectionId':_0x290d88['id']},{})[_0xc978('0x1f')](function(){return _0x3a1411;});}else{return _0x3a1411;}})[_0xc978('0x4a')](function(_0x2b2361){logger[_0xc978('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b2361);throw _0x2b2361;});}return _0x3a1411;})[_0xc978('0x1f')](respondWithResult(_0x221c58,0xc9))['catch'](handleError(_0x221c58,null));};exports[_0xc978('0x4b')]=function(_0x63a86a,_0x41b389){if(_0x63a86a['body']['id']){delete _0x63a86a[_0xc978('0x44')]['id'];}return db[_0xc978('0x3d')][_0xc978('0x43')]({'where':{'id':_0x63a86a[_0xc978('0x40')]['id']}})[_0xc978('0x1f')](handleEntityNotFound(_0x41b389,null))[_0xc978('0x1f')](saveUpdates(_0x63a86a[_0xc978('0x44')],null))[_0xc978('0x1f')](respondWithResult(_0x41b389,null))['catch'](handleError(_0x41b389,null));};exports[_0xc978('0x23')]=function(_0x4ea23c,_0x4c187c){return db[_0xc978('0x3d')][_0xc978('0x43')]({'where':{'id':_0x4ea23c[_0xc978('0x40')]['id']}})[_0xc978('0x1f')](handleEntityNotFound(_0x4c187c,null))['then'](removeEntity(_0x4c187c,null))['catch'](handleError(_0x4c187c,null));};exports[_0xc978('0x4c')]=function(_0x5b6a46,_0x4034a9,_0x39e90e){var _0x4f0b0e;return db['SquareOdbc'][_0xc978('0x43')]({'where':{'id':_0x5b6a46[_0xc978('0x40')]['id']},'attributes':['id',_0xc978('0x4d')]})[_0xc978('0x1f')](handleEntityNotFound(_0x4034a9,null))[_0xc978('0x1f')](function(_0x59ddb3){if(_0x59ddb3){var _0x621103=require(_0xc978('0x4e'))();_0x621103[_0xc978('0x4f')](_0x59ddb3[_0xc978('0x4d')]);_0x621103[_0xc978('0x50')]();return _0x59ddb3;}})[_0xc978('0x1f')](respondWithResult(_0x4034a9,null))['catch'](handleError(_0x4034a9,null));};
\ No newline at end of file
index 65d8c43..7f40008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['util','../../config/logger','api','bluebird','./squareOdbc.attributes','define','square_odbc'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x91a7,0xe7));var _0x791a=function(_0x423a05,_0xbc2e26){_0x423a05=_0x423a05-0x0;var _0x33f2a1=_0x91a7[_0x423a05];return _0x33f2a1;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var attributes=require(_0x791a('0x4'));module['exports']=function(_0x50ab29,_0x32fe2b){return _0x50ab29[_0x791a('0x5')]('SquareOdbc',attributes,{'tableName':_0x791a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x668b=['lodash','util','api','moment','request-promise','exports','SquareOdbc','square_odbc'];(function(_0x5dd959,_0x3c4125){var _0xcc3966=function(_0x4251f2){while(--_0x4251f2){_0x5dd959['push'](_0x5dd959['shift']());}};_0xcc3966(++_0x3c4125);}(_0x668b,0x140));var _0xb668=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x668b[_0x590b63];return _0x3c9380;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var attributes=require('./squareOdbc.attributes');module[_0xb668('0x5')]=function(_0x4092a6,_0x2960f5){return _0x4092a6['define'](_0xb668('0x6'),attributes,{'tableName':_0xb668('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2a76e3e..d0ec6bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7316=['rpc','../../config/environment','jayson/promise','http','then','info','debug','request\x20sent','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','map','include','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x4a6fa2,_0x497854){var _0x1ccea1=function(_0x33caa6){while(--_0x33caa6){_0x4a6fa2['push'](_0x4a6fa2['shift']());}};_0x1ccea1(++_0x497854);}(_0x7316,0x108));var _0x6731=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x7316[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x6731('0x0'));var util=require(_0x6731('0x1'));var moment=require('moment');var BPromise=require(_0x6731('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6731('0x3'));var db=require(_0x6731('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6731('0x5'))(_0x6731('0x6'));var config=require(_0x6731('0x7'));var jayson=require(_0x6731('0x8'));var client=jayson['client'][_0x6731('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a7e41,_0x2faf91,_0x10d1f4){return new BPromise(function(_0x2f231a,_0x1c34f4){return client['request'](_0x4a7e41,_0x10d1f4)[_0x6731('0xa')](function(_0x18644e){logger[_0x6731('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x2faf91,'request\x20sent');logger[_0x6731('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x2faf91,_0x6731('0xd'),JSON[_0x6731('0xe')](_0x18644e));if(_0x18644e[_0x6731('0xf')]){if(_0x18644e['error'][_0x6731('0x10')]===0x1f4){logger[_0x6731('0xf')](_0x6731('0x11'),_0x2faf91,_0x18644e[_0x6731('0xf')]['message']);return _0x1c34f4(_0x18644e[_0x6731('0xf')][_0x6731('0x12')]);}logger[_0x6731('0xf')](_0x6731('0x11'),_0x2faf91,_0x18644e[_0x6731('0xf')][_0x6731('0x12')]);return _0x2f231a(_0x18644e[_0x6731('0xf')][_0x6731('0x12')]);}else{logger[_0x6731('0xb')](_0x6731('0x11'),_0x2faf91,_0x6731('0xd'));_0x2f231a(_0x18644e[_0x6731('0x13')][_0x6731('0x12')]);}})[_0x6731('0x14')](function(_0x3e748b){logger[_0x6731('0xf')](_0x6731('0x11'),_0x2faf91,_0x3e748b);_0x1c34f4(_0x3e748b);});});}exports[_0x6731('0x15')]=function(_0x35ea73){var _0x282d6b=this;return new Promise(function(_0x35ea94,_0x3e5625){return db[_0x6731('0x16')]['find']({'raw':_0x35ea73[_0x6731('0x17')]?_0x35ea73[_0x6731('0x17')][_0x6731('0x18')]===undefined?!![]:![]:!![],'where':_0x35ea73['options']?_0x35ea73[_0x6731('0x17')][_0x6731('0x19')]||null:null,'attributes':_0x35ea73[_0x6731('0x17')]?_0x35ea73['options'][_0x6731('0x1a')]||null:null,'include':_0x35ea73[_0x6731('0x17')]?_0x35ea73[_0x6731('0x17')]['include']?_[_0x6731('0x1b')](_0x35ea73['options'][_0x6731('0x1c')],function(_0x1c15cc){return{'model':db[_0x1c15cc[_0x6731('0x1d')]],'as':_0x1c15cc['as'],'attributes':_0x1c15cc[_0x6731('0x1a')],'include':_0x1c15cc[_0x6731('0x1c')]?_['map'](_0x1c15cc['include'],function(_0x25cf23){return{'model':db[_0x25cf23[_0x6731('0x1d')]],'as':_0x25cf23['as'],'attributes':_0x25cf23[_0x6731('0x1a')],'include':_0x25cf23[_0x6731('0x1c')]?_[_0x6731('0x1b')](_0x25cf23['include'],function(_0x4e1395){return{'model':db[_0x4e1395[_0x6731('0x1d')]],'as':_0x4e1395['as'],'attributes':_0x4e1395['attributes']};}):[]};}):[]};}):[]:[]})[_0x6731('0xa')](function(_0x5a6dff){logger['info'](_0x6731('0x15'),_0x35ea73);logger['debug'](_0x6731('0x15'),_0x35ea73,JSON[_0x6731('0xe')](_0x5a6dff));_0x35ea94(_0x5a6dff);})[_0x6731('0x14')](function(_0x53970e){logger['error'](_0x6731('0x15'),_0x53970e[_0x6731('0x12')],_0x35ea73);_0x3e5625(_0x282d6b[_0x6731('0xf')](0x1f4,_0x53970e['message']));});});};
\ No newline at end of file
+var _0xb2bf=['then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x498f2a,_0x1e7ab3){var _0xfab8a5=function(_0x285840){while(--_0x285840){_0x498f2a['push'](_0x498f2a['shift']());}};_0xfab8a5(++_0x1e7ab3);}(_0xb2bf,0x105));var _0xfb2b=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb2bf[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xfb2b('0x0'));var util=require(_0xfb2b('0x1'));var moment=require(_0xfb2b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfb2b('0x3'));var logger=require(_0xfb2b('0x4'))('rpc');var config=require(_0xfb2b('0x5'));var jayson=require(_0xfb2b('0x6'));var client=jayson[_0xfb2b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55c05a,_0x5b258b,_0x5c59ed){return new BPromise(function(_0x2fec61,_0x11f535){return client[_0xfb2b('0x8')](_0x55c05a,_0x5c59ed)[_0xfb2b('0x9')](function(_0x49903f){logger[_0xfb2b('0xa')](_0xfb2b('0xb'),_0x5b258b,'request\x20sent');logger[_0xfb2b('0xc')](_0xfb2b('0xd'),_0x5b258b,_0xfb2b('0xe'),JSON[_0xfb2b('0xf')](_0x49903f));if(_0x49903f['error']){if(_0x49903f[_0xfb2b('0x10')]['code']===0x1f4){logger[_0xfb2b('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x5b258b,_0x49903f[_0xfb2b('0x10')]['message']);return _0x11f535(_0x49903f['error'][_0xfb2b('0x11')]);}logger[_0xfb2b('0x10')](_0xfb2b('0xb'),_0x5b258b,_0x49903f[_0xfb2b('0x10')]['message']);return _0x2fec61(_0x49903f[_0xfb2b('0x10')][_0xfb2b('0x11')]);}else{logger[_0xfb2b('0xa')](_0xfb2b('0xb'),_0x5b258b,_0xfb2b('0xe'));_0x2fec61(_0x49903f[_0xfb2b('0x12')][_0xfb2b('0x11')]);}})[_0xfb2b('0x13')](function(_0xd772a){logger['error'](_0xfb2b('0xb'),_0x5b258b,_0xd772a);_0x11f535(_0xd772a);});});}exports['ShowSquareOdbc']=function(_0x54c9d0){var _0x256a67=this;return new Promise(function(_0x1156b9,_0x40a92d){return db[_0xfb2b('0x14')][_0xfb2b('0x15')]({'raw':_0x54c9d0['options']?_0x54c9d0[_0xfb2b('0x16')][_0xfb2b('0x17')]===undefined?!![]:![]:!![],'where':_0x54c9d0[_0xfb2b('0x16')]?_0x54c9d0[_0xfb2b('0x16')][_0xfb2b('0x18')]||null:null,'attributes':_0x54c9d0[_0xfb2b('0x16')]?_0x54c9d0[_0xfb2b('0x16')][_0xfb2b('0x19')]||null:null,'include':_0x54c9d0[_0xfb2b('0x16')]?_0x54c9d0[_0xfb2b('0x16')][_0xfb2b('0x1a')]?_[_0xfb2b('0x1b')](_0x54c9d0[_0xfb2b('0x16')][_0xfb2b('0x1a')],function(_0x4e6f07){return{'model':db[_0x4e6f07[_0xfb2b('0x1c')]],'as':_0x4e6f07['as'],'attributes':_0x4e6f07['attributes'],'include':_0x4e6f07['include']?_[_0xfb2b('0x1b')](_0x4e6f07['include'],function(_0x447ffe){return{'model':db[_0x447ffe[_0xfb2b('0x1c')]],'as':_0x447ffe['as'],'attributes':_0x447ffe[_0xfb2b('0x19')],'include':_0x447ffe[_0xfb2b('0x1a')]?_[_0xfb2b('0x1b')](_0x447ffe['include'],function(_0x4b1e6b){return{'model':db[_0x4b1e6b[_0xfb2b('0x1c')]],'as':_0x4b1e6b['as'],'attributes':_0x4b1e6b[_0xfb2b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfb2b('0x9')](function(_0x1ecf3d){logger[_0xfb2b('0xa')]('ShowSquareOdbc',_0x54c9d0);logger[_0xfb2b('0xc')](_0xfb2b('0x1d'),_0x54c9d0,JSON[_0xfb2b('0xf')](_0x1ecf3d));_0x1156b9(_0x1ecf3d);})[_0xfb2b('0x13')](function(_0x5a89f5){logger[_0xfb2b('0x10')](_0xfb2b('0x1d'),_0x5a89f5[_0xfb2b('0x11')],_0x54c9d0);_0x40a92d(_0x256a67[_0xfb2b('0x10')](0x1f4,_0x5a89f5[_0xfb2b('0x11')]));});});};
\ No newline at end of file
index 7a51aa0..a285d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e3=['./squareProject.controller','isAuthenticated','get','show','getUsers','post','/:id/users','addUsers','put','update','delete','/:id','destroy','removeUsers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x50e3,0xc7));var _0x350e=function(_0x1840e7,_0x32c8bd){_0x1840e7=_0x1840e7-0x0;var _0x144452=_0x50e3[_0x1840e7];return _0x144452;};'use strict';var multer=require(_0x350e('0x0'));var util=require(_0x350e('0x1'));var path=require(_0x350e('0x2'));var timeout=require(_0x350e('0x3'));var express=require('express');var router=express[_0x350e('0x4')]();var auth=require(_0x350e('0x5'));var interaction=require(_0x350e('0x6'));var config=require(_0x350e('0x7'));var controller=require(_0x350e('0x8'));router['get']('/',auth[_0x350e('0x9')](),controller['index']);router[_0x350e('0xa')]('/:id',auth[_0x350e('0x9')](),controller[_0x350e('0xb')]);router['get']('/:id/users',auth[_0x350e('0x9')](),controller[_0x350e('0xc')]);router[_0x350e('0xd')]('/',auth[_0x350e('0x9')](),controller['create']);router[_0x350e('0xd')](_0x350e('0xe'),auth[_0x350e('0x9')](),controller[_0x350e('0xf')]);router[_0x350e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x350e('0x11')]);router[_0x350e('0x12')](_0x350e('0x13'),auth[_0x350e('0x9')](),controller[_0x350e('0x14')]);router[_0x350e('0x12')](_0x350e('0xe'),auth[_0x350e('0x9')](),controller[_0x350e('0x15')]);module[_0x350e('0x16')]=router;
\ No newline at end of file
+var _0xc575=['put','update','destroy','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create'];(function(_0x588582,_0x198c3d){var _0x3db01d=function(_0x257005){while(--_0x257005){_0x588582['push'](_0x588582['shift']());}};_0x3db01d(++_0x198c3d);}(_0xc575,0x102));var _0x5c57=function(_0x51b7c5,_0x218969){_0x51b7c5=_0x51b7c5-0x0;var _0x3355d7=_0xc575[_0x51b7c5];return _0x3355d7;};'use strict';var multer=require('multer');var util=require(_0x5c57('0x0'));var path=require(_0x5c57('0x1'));var timeout=require(_0x5c57('0x2'));var express=require(_0x5c57('0x3'));var router=express[_0x5c57('0x4')]();var auth=require(_0x5c57('0x5'));var interaction=require(_0x5c57('0x6'));var config=require(_0x5c57('0x7'));var controller=require(_0x5c57('0x8'));router[_0x5c57('0x9')]('/',auth[_0x5c57('0xa')](),controller[_0x5c57('0xb')]);router[_0x5c57('0x9')](_0x5c57('0xc'),auth[_0x5c57('0xa')](),controller[_0x5c57('0xd')]);router[_0x5c57('0x9')](_0x5c57('0xe'),auth['isAuthenticated'](),controller[_0x5c57('0xf')]);router[_0x5c57('0x10')]('/',auth['isAuthenticated'](),controller[_0x5c57('0x11')]);router[_0x5c57('0x10')]('/:id/users',auth['isAuthenticated'](),controller['addUsers']);router[_0x5c57('0x12')](_0x5c57('0xc'),auth[_0x5c57('0xa')](),controller[_0x5c57('0x13')]);router['delete']('/:id',auth[_0x5c57('0xa')](),controller[_0x5c57('0x14')]);router[_0x5c57('0x15')](_0x5c57('0xe'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x5c57('0x16')]=router;
\ No newline at end of file
index c423575..2a2da0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5da=['utf8','BLOB','production','sequelize','exports','name','STRING','TEXT','long','preproduction','getDataValue','toString'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xd5da,0x9f));var _0xad5d=function(_0x366eef,_0x16584f){_0x366eef=_0x366eef-0x0;var _0x2e06b8=_0xd5da[_0x366eef];return _0x2e06b8;};'use strict';var Sequelize=require(_0xad5d('0x0'));module[_0xad5d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xad5d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xad5d('0x3')]},'notes':{'type':Sequelize[_0xad5d('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0xad5d('0x5')),'get':function(){if(this['getDataValue'](_0xad5d('0x6'))){return this[_0xad5d('0x7')](_0xad5d('0x6'))[_0xad5d('0x8')](_0xad5d('0x9'));}}},'production':{'type':Sequelize[_0xad5d('0xa')](_0xad5d('0x5')),'get':function(){if(this[_0xad5d('0x7')](_0xad5d('0xb'))){return this['getDataValue'](_0xad5d('0xb'))[_0xad5d('0x8')]('utf8');}}}};
\ No newline at end of file
+var _0x4af9=['toString','utf8','production','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x57aa9d,_0x40382c){var _0x43fd79=function(_0x4cfd97){while(--_0x4cfd97){_0x57aa9d['push'](_0x57aa9d['shift']());}};_0x43fd79(++_0x40382c);}(_0x4af9,0x12c));var _0x94af=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4af9[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x94af('0x0'));module[_0x94af('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x94af('0x2')]},'notes':{'type':Sequelize[_0x94af('0x3')]},'preproduction':{'type':Sequelize[_0x94af('0x4')](_0x94af('0x5')),'get':function(){if(this[_0x94af('0x6')](_0x94af('0x7'))){return this[_0x94af('0x6')]('preproduction')[_0x94af('0x8')](_0x94af('0x9'));}}},'production':{'type':Sequelize[_0x94af('0x4')](_0x94af('0x5')),'get':function(){if(this['getDataValue'](_0x94af('0xa'))){return this[_0x94af('0x6')](_0x94af('0xa'))['toString']('utf8');}}}};
\ No newline at end of file
index 3b23105..68842d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fca=['findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','destroy','sendStatus','error','stack','name','index','SquareProject','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','add','day','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fca,0x1a5));var _0xa5fc=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0x5fca[_0x3b594b];return _0x1ea5f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa5fc('0x0'));var rimraf=require(_0xa5fc('0x1'));var zipdir=require(_0xa5fc('0x2'));var jsonpatch=require(_0xa5fc('0x3'));var rp=require(_0xa5fc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa5fc('0x5'));var util=require(_0xa5fc('0x6'));var path=require(_0xa5fc('0x7'));var sox=require('sox');var csv=require(_0xa5fc('0x8'));var ejs=require(_0xa5fc('0x9'));var fs=require('fs');var _=require(_0xa5fc('0xa'));var squel=require(_0xa5fc('0xb'));var crypto=require(_0xa5fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa5fc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa5fc('0xe'));var Papa=require('papaparse');var Redis=require(_0xa5fc('0xf'));var qs=require(_0xa5fc('0x10'));var logger=require(_0xa5fc('0x11'))(_0xa5fc('0x12'));var utils=require(_0xa5fc('0x13'));var config=require(_0xa5fc('0x14'));var db=require('../../mysqldb')['db'];config[_0xa5fc('0x15')]=_[_0xa5fc('0x16')](config[_0xa5fc('0x15')],{'host':_0xa5fc('0x17'),'port':0x18eb});var socket=require(_0xa5fc('0x18'))(new Redis(config[_0xa5fc('0x15')]));require('./squareProject.socket')[_0xa5fc('0x19')](socket);function respondWithStatusCode(_0x1fe18d,_0x50f21c){_0x50f21c=_0x50f21c||0xcc;return function(_0x320a08){if(_0x320a08){return _0x1fe18d['sendStatus'](_0x50f21c);}return _0x1fe18d[_0xa5fc('0x1a')](_0x50f21c)[_0xa5fc('0x1b')]();};}function respondWithResult(_0x33fe83,_0x552579){_0x552579=_0x552579||0xc8;return function(_0x29ddc2){if(_0x29ddc2){return _0x33fe83['status'](_0x552579)[_0xa5fc('0x1c')](_0x29ddc2);}};}function respondWithFilteredResult(_0x3fd206,_0x1bf843){return function(_0xedbb8e){if(_0xedbb8e){var _0x41b2ca=_0xedbb8e[_0xa5fc('0x1d')],_0x1d64a7=_0x1bf843[_0xa5fc('0x1e')],_0x5943c5=_0x1bf843[_0xa5fc('0x1e')]+_0x1bf843['limit'],_0x279f0d;if(_0x5943c5>=_0x41b2ca){_0x5943c5=_0x41b2ca;_0x279f0d=0xc8;}else{_0x279f0d=0xce;}_0x3fd206[_0xa5fc('0x1a')](_0x279f0d);return _0x3fd206[_0xa5fc('0x1f')](_0xa5fc('0x20'),_0x1d64a7+'-'+_0x5943c5+'/'+_0x41b2ca)[_0xa5fc('0x1c')](_0xedbb8e);}return null;};}function patchUpdates(_0x234078){return function(_0x277a71){try{jsonpatch[_0xa5fc('0x21')](_0x277a71,_0x234078,!![]);}catch(_0x758642){return BPromise[_0xa5fc('0x22')](_0x758642);}return _0x277a71[_0xa5fc('0x23')]();};}function saveUpdates(_0x43495b,_0x38ad04){return function(_0x4a0b75){if(_0x4a0b75){return _0x4a0b75[_0xa5fc('0x24')](_0x43495b)['then'](function(_0x3990cf){return _0x3990cf;});}return null;};}function removeEntity(_0x2a6326,_0x5fd457){return function(_0x35da95){if(_0x35da95){return _0x35da95['destroy']()[_0xa5fc('0x25')](function(){var _0x4b1dd2=_0x35da95[_0xa5fc('0x26')]({'plain':!![]});var _0x465018='SquareProjects';return db['UserProfileResource'][_0xa5fc('0x27')]({'where':{'type':_0x465018,'resourceId':_0x4b1dd2['id']}})['then'](function(){return _0x35da95;});})['then'](function(){_0x2a6326[_0xa5fc('0x1a')](0xcc)[_0xa5fc('0x1b')]();});}};}function handleEntityNotFound(_0x170f8c,_0xc4eb49){return function(_0x311617){if(!_0x311617){_0x170f8c[_0xa5fc('0x28')](0x194);}return _0x311617;};}function handleError(_0x4c1ea6,_0x4d463c){_0x4d463c=_0x4d463c||0x1f4;return function(_0x2e897d){logger[_0xa5fc('0x29')](_0x2e897d[_0xa5fc('0x2a')]);if(_0x2e897d['name']){delete _0x2e897d[_0xa5fc('0x2b')];}_0x4c1ea6[_0xa5fc('0x1a')](_0x4d463c)['send'](_0x2e897d);};}exports[_0xa5fc('0x2c')]=function(_0x3c5c1e,_0x6cfce9){var _0xf72db3={},_0x12ef07={},_0xa8be24={'count':0x0,'rows':[]};var _0x41a1a3=db[_0xa5fc('0x2d')][_0xa5fc('0x2e')];_0x12ef07[_0xa5fc('0x2f')]=_[_0xa5fc('0x30')](_0x41a1a3);var _0x768389={'dateStart':_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x32')],'dateEnd':_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x33')]};delete _0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x32')];delete _0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x33')];_0x12ef07[_0xa5fc('0x31')]=_['keys'](_0x3c5c1e[_0xa5fc('0x31')]);_0x12ef07[_0xa5fc('0x34')]=_['intersection'](_0x12ef07['model'],_0x12ef07[_0xa5fc('0x31')]);_0xf72db3[_0xa5fc('0x35')]=_[_0xa5fc('0x36')](_0x12ef07[_0xa5fc('0x2f')],qs['fields'](_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x37')]));_0xf72db3[_0xa5fc('0x35')]=_0xf72db3[_0xa5fc('0x35')]['length']?_0xf72db3['attributes']:_0x12ef07[_0xa5fc('0x2f')];if(!_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x38')](_0xa5fc('0x39'))){_0xf72db3['limit']=qs[_0xa5fc('0x3a')](_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x3a')]);_0xf72db3[_0xa5fc('0x1e')]=qs['offset'](_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x1e')]);}_0xf72db3[_0xa5fc('0x3b')]=qs['sort'](_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x3c')]);_0xf72db3[_0xa5fc('0x3d')]=qs['filters'](_['pick'](_0x3c5c1e['query'],_0x12ef07[_0xa5fc('0x34')]));if(_0x768389[_0xa5fc('0x32')]){if(_0x768389[_0xa5fc('0x33')]){_0x768389[_0xa5fc('0x33')]=moment(_0x768389[_0xa5fc('0x33')])[_0xa5fc('0x3e')](0x1,'day');}else{_0x768389[_0xa5fc('0x33')]=moment(_0x768389['dateStart'])[_0xa5fc('0x3e')](0x1,_0xa5fc('0x3f'));}_[_0xa5fc('0x40')](_0xf72db3[_0xa5fc('0x3d')],{'createdAt':{'$gte':_0x768389[_0xa5fc('0x32')],'$lte':_0x768389['dateEnd']}});}if(_0x3c5c1e['query']['filter']){_0xf72db3['where']=_[_0xa5fc('0x40')](_0xf72db3[_0xa5fc('0x3d')],{'$or':_[_0xa5fc('0x41')](_0x41a1a3,function(_0x28d897){if(_0x28d897[_0xa5fc('0x42')][_0xa5fc('0x43')]!==_0xa5fc('0x44')){var _0x54f91d={};_0x54f91d[_0x28d897[_0xa5fc('0x45')]]={'$like':'%'+_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x46')]+'%'};return _0x54f91d;}})});}_0xf72db3=_['merge']({},_0xf72db3,_0x3c5c1e[_0xa5fc('0x47')]);var _0x31362f={'where':_0xf72db3['where']};return db['SquareProject'][_0xa5fc('0x1d')](_0x31362f)['then'](function(_0x47eae0){_0xa8be24['count']=_0x47eae0;if(_0x3c5c1e[_0xa5fc('0x31')][_0xa5fc('0x48')]){_0xf72db3[_0xa5fc('0x49')]=[{'all':!![]}];}return db[_0xa5fc('0x2d')][_0xa5fc('0x4a')](_0xf72db3);})['then'](function(_0x1f092b){_0xa8be24[_0xa5fc('0x4b')]=_0x1f092b;return _0xa8be24;})[_0xa5fc('0x25')](respondWithFilteredResult(_0x6cfce9,_0xf72db3))[_0xa5fc('0x4c')](handleError(_0x6cfce9,null));};exports[_0xa5fc('0x4d')]=function(_0x1d89e4,_0x37d227){var _0x29bd42={'raw':![],'where':{'id':_0x1d89e4[_0xa5fc('0x4e')]['id']}},_0x1f1e1b={};_0x1f1e1b[_0xa5fc('0x2f')]=_[_0xa5fc('0x30')](db['SquareProject']['rawAttributes']);_0x1f1e1b[_0xa5fc('0x31')]=_[_0xa5fc('0x30')](_0x1d89e4[_0xa5fc('0x31')]);_0x1f1e1b['filters']=_[_0xa5fc('0x36')](_0x1f1e1b[_0xa5fc('0x2f')],_0x1f1e1b[_0xa5fc('0x31')]);_0x29bd42[_0xa5fc('0x35')]=_['intersection'](_0x1f1e1b[_0xa5fc('0x2f')],qs['fields'](_0x1d89e4[_0xa5fc('0x31')]['fields']));_0x29bd42['attributes']=_0x29bd42[_0xa5fc('0x35')][_0xa5fc('0x4f')]?_0x29bd42[_0xa5fc('0x35')]:_0x1f1e1b['model'];if(_0x1d89e4[_0xa5fc('0x31')][_0xa5fc('0x48')]){_0x29bd42[_0xa5fc('0x49')]=[{'all':!![]}];}_0x29bd42=_[_0xa5fc('0x40')]({},_0x29bd42,_0x1d89e4[_0xa5fc('0x47')]);return db[_0xa5fc('0x2d')][_0xa5fc('0x50')](_0x29bd42)[_0xa5fc('0x25')](handleEntityNotFound(_0x37d227,null))[_0xa5fc('0x25')](respondWithResult(_0x37d227,null))[_0xa5fc('0x4c')](handleError(_0x37d227,null));};exports[_0xa5fc('0x51')]=function(_0x14ca25,_0x597c31){return db[_0xa5fc('0x2d')]['create'](_0x14ca25[_0xa5fc('0x52')],{})['then'](function(_0x4fdab0){var _0x2b5b0f=_0x14ca25[_0xa5fc('0x53')][_0xa5fc('0x26')]({'plain':!![]});if(!_0x2b5b0f)throw new Error(_0xa5fc('0x54'));if(_0x2b5b0f['role']===_0xa5fc('0x53')){var _0x425821=_0x4fdab0[_0xa5fc('0x26')]({'plain':!![]});var _0x1c1e5c=_0xa5fc('0x55');return db[_0xa5fc('0x56')][_0xa5fc('0x50')]({'where':{'name':_0x1c1e5c,'userProfileId':_0x2b5b0f[_0xa5fc('0x57')]},'raw':!![]})['then'](function(_0x54362c){if(_0x54362c&&_0x54362c[_0xa5fc('0x58')]===0x0){return db[_0xa5fc('0x59')][_0xa5fc('0x51')]({'name':_0x425821[_0xa5fc('0x2b')],'resourceId':_0x425821['id'],'type':_0x54362c[_0xa5fc('0x2b')],'sectionId':_0x54362c['id']},{})[_0xa5fc('0x25')](function(){return _0x4fdab0;});}else{return _0x4fdab0;}})[_0xa5fc('0x4c')](function(_0x5c351e){logger[_0xa5fc('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c351e);throw _0x5c351e;});}return _0x4fdab0;})[_0xa5fc('0x25')](respondWithResult(_0x597c31,0xc9))[_0xa5fc('0x4c')](handleError(_0x597c31,null));};exports['update']=function(_0x217f16,_0x1371d9){if(_0x217f16[_0xa5fc('0x52')]['id']){delete _0x217f16['body']['id'];}return db[_0xa5fc('0x2d')][_0xa5fc('0x50')]({'where':{'id':_0x217f16[_0xa5fc('0x4e')]['id']}})[_0xa5fc('0x25')](handleEntityNotFound(_0x1371d9,null))['then'](saveUpdates(_0x217f16[_0xa5fc('0x52')],null))[_0xa5fc('0x25')](respondWithResult(_0x1371d9,null))['catch'](handleError(_0x1371d9,null));};exports[_0xa5fc('0x27')]=function(_0x24999,_0x48cfbf){return db[_0xa5fc('0x2d')]['find']({'where':{'id':_0x24999[_0xa5fc('0x4e')]['id']}})[_0xa5fc('0x25')](handleEntityNotFound(_0x48cfbf,null))[_0xa5fc('0x25')](removeEntity(_0x48cfbf,null))[_0xa5fc('0x4c')](handleError(_0x48cfbf,null));};exports['addUsers']=function(_0x1df47b,_0x2dac61,_0x31c00c){return db[_0xa5fc('0x2d')][_0xa5fc('0x50')]({'where':{'id':_0x1df47b[_0xa5fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2dac61,null))[_0xa5fc('0x25')](function(_0x5533c2){if(_0x5533c2){return _0x5533c2[_0xa5fc('0x5a')](_0x1df47b[_0xa5fc('0x52')][_0xa5fc('0x5b')],_[_0xa5fc('0x5c')](_0x1df47b[_0xa5fc('0x52')],['ids','id'])||{});}})[_0xa5fc('0x25')](respondWithResult(_0x2dac61,null))['catch'](handleError(_0x2dac61,null));};exports[_0xa5fc('0x5d')]=function(_0x35b80b,_0x397017,_0x1eaaa1){var _0x3aba9d;return db[_0xa5fc('0x2d')]['find']({'where':{'id':_0x35b80b['params']['id']}})[_0xa5fc('0x25')](handleEntityNotFound(_0x397017,null))['then'](function(_0x1a6284){if(_0x1a6284){return _0x1a6284[_0xa5fc('0x5d')](_0x35b80b[_0xa5fc('0x31')][_0xa5fc('0x5b')])['then'](function(_0x42e35f){if(_[_0xa5fc('0x5e')](_0x35b80b['query'][_0xa5fc('0x5b')])){for(var _0x7db4f6=0x0;_0x7db4f6<_0x35b80b[_0xa5fc('0x31')][_0xa5fc('0x5b')][_0xa5fc('0x4f')];_0x7db4f6+=0x1){socket['emit'](_0xa5fc('0x5f'),{'UserId':_0x35b80b[_0xa5fc('0x31')][_0xa5fc('0x5b')][_0x7db4f6],'SquareProjectId':_0x35b80b['params']['id']});}}else{socket[_0xa5fc('0x60')](_0xa5fc('0x5f'),{'UserId':_0x35b80b['query'][_0xa5fc('0x5b')],'SquareProjectId':_0x35b80b[_0xa5fc('0x4e')]['id']});}});}})[_0xa5fc('0x25')](respondWithStatusCode(_0x397017,null))[_0xa5fc('0x4c')](handleError(_0x397017,null));};exports['getUsers']=function(_0x16f468,_0x408673,_0x199eeb){var _0x419b68={};var _0x2625d0={};var _0x11855d;var _0x2d004e;return db[_0xa5fc('0x2d')][_0xa5fc('0x61')]({'where':{'id':_0x16f468[_0xa5fc('0x4e')]['id']}})[_0xa5fc('0x25')](handleEntityNotFound(_0x408673,null))[_0xa5fc('0x25')](function(_0x4dc953){if(_0x4dc953){_0x11855d=_0x4dc953;_0x2625d0[_0xa5fc('0x2f')]=_[_0xa5fc('0x30')](db[_0xa5fc('0x62')][_0xa5fc('0x2e')]);_0x2625d0[_0xa5fc('0x31')]=_['keys'](_0x16f468[_0xa5fc('0x31')]);_0x2625d0['filters']=_[_0xa5fc('0x36')](_0x2625d0[_0xa5fc('0x2f')],_0x2625d0[_0xa5fc('0x31')]);_0x419b68[_0xa5fc('0x35')]=_[_0xa5fc('0x36')](_0x2625d0[_0xa5fc('0x2f')],qs['fields'](_0x16f468[_0xa5fc('0x31')]['fields']));_0x419b68[_0xa5fc('0x35')]=_0x419b68[_0xa5fc('0x35')][_0xa5fc('0x4f')]?_0x419b68['attributes']:_0x2625d0[_0xa5fc('0x2f')];_0x419b68[_0xa5fc('0x3b')]=qs[_0xa5fc('0x3c')](_0x16f468['query'][_0xa5fc('0x3c')]);_0x419b68[_0xa5fc('0x3d')]=qs[_0xa5fc('0x34')](_['pick'](_0x16f468[_0xa5fc('0x31')],_0x2625d0[_0xa5fc('0x34')]));if(_0x16f468[_0xa5fc('0x31')][_0xa5fc('0x46')]){_0x419b68[_0xa5fc('0x3d')]=_[_0xa5fc('0x40')](_0x419b68['where'],{'$or':_['map'](_0x419b68[_0xa5fc('0x35')],function(_0x5b408b){var _0x17dd60={};_0x17dd60[_0x5b408b]={'$like':'%'+_0x16f468[_0xa5fc('0x31')]['filter']+'%'};return _0x17dd60;})});}_0x419b68=_[_0xa5fc('0x40')]({},_0x419b68,_0x16f468[_0xa5fc('0x47')]);return _0x11855d['getUsers'](_0x419b68);}})[_0xa5fc('0x25')](function(_0x500124){if(_0x500124){_0x2d004e=_0x500124[_0xa5fc('0x4f')];if(!_0x16f468['query'][_0xa5fc('0x38')](_0xa5fc('0x39'))){_0x419b68[_0xa5fc('0x3a')]=qs[_0xa5fc('0x3a')](_0x16f468['query'][_0xa5fc('0x3a')]);_0x419b68['offset']=qs[_0xa5fc('0x1e')](_0x16f468[_0xa5fc('0x31')][_0xa5fc('0x1e')]);}return _0x11855d['getUsers'](_0x419b68);}})[_0xa5fc('0x25')](function(_0x141a65){if(_0x141a65){return _0x141a65?{'count':_0x2d004e,'rows':_0x141a65}:null;}})[_0xa5fc('0x25')](respondWithResult(_0x408673,null))['catch'](handleError(_0x408673,null));};
\ No newline at end of file
+var _0xaa4c=['emit','userSquareProject:remove','getUsers','findOne','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','send','SquareProject','model','keys','dateStart','dateEnd','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','type','key','field','options','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','removeUsers','ids','isArray'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xaa4c,0x190));var _0xcaa4=function(_0x4c5cae,_0x203d4f){_0x4c5cae=_0x4c5cae-0x0;var _0x15874c=_0xaa4c[_0x4c5cae];return _0x15874c;};'use strict';var pdf=require(_0xcaa4('0x0'));var emlformat=require(_0xcaa4('0x1'));var rimraf=require(_0xcaa4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaa4('0x3'));var rp=require('request-promise');var moment=require(_0xcaa4('0x4'));var BPromise=require(_0xcaa4('0x5'));var Mustache=require(_0xcaa4('0x6'));var util=require(_0xcaa4('0x7'));var path=require(_0xcaa4('0x8'));var sox=require(_0xcaa4('0x9'));var csv=require(_0xcaa4('0xa'));var ejs=require(_0xcaa4('0xb'));var fs=require('fs');var _=require(_0xcaa4('0xc'));var squel=require(_0xcaa4('0xd'));var crypto=require(_0xcaa4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcaa4('0xf'));var toCsv=require(_0xcaa4('0xa'));var querystring=require(_0xcaa4('0x10'));var Papa=require(_0xcaa4('0x11'));var Redis=require(_0xcaa4('0x12'));var qs=require(_0xcaa4('0x13'));var logger=require(_0xcaa4('0x14'))(_0xcaa4('0x15'));var utils=require(_0xcaa4('0x16'));var config=require(_0xcaa4('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcaa4('0x18')](config[_0xcaa4('0x19')],{'host':_0xcaa4('0x1a'),'port':0x18eb});var socket=require(_0xcaa4('0x1b'))(new Redis(config[_0xcaa4('0x19')]));require(_0xcaa4('0x1c'))[_0xcaa4('0x1d')](socket);function respondWithStatusCode(_0x2d4a2b,_0x428084){_0x428084=_0x428084||0xcc;return function(_0x3395f5){if(_0x3395f5){return _0x2d4a2b[_0xcaa4('0x1e')](_0x428084);}return _0x2d4a2b[_0xcaa4('0x1f')](_0x428084)[_0xcaa4('0x20')]();};}function respondWithResult(_0x47150f,_0x3e09d7){_0x3e09d7=_0x3e09d7||0xc8;return function(_0x10ab69){if(_0x10ab69){return _0x47150f['status'](_0x3e09d7)[_0xcaa4('0x21')](_0x10ab69);}};}function respondWithFilteredResult(_0x16eaee,_0x594e85){return function(_0xaea152){if(_0xaea152){var _0x28cbdf=_0xaea152[_0xcaa4('0x22')],_0x2aae6c=_0x594e85['offset'],_0x735322=_0x594e85[_0xcaa4('0x23')]+_0x594e85[_0xcaa4('0x24')],_0x3b16c8;if(_0x735322>=_0x28cbdf){_0x735322=_0x28cbdf;_0x3b16c8=0xc8;}else{_0x3b16c8=0xce;}_0x16eaee[_0xcaa4('0x1f')](_0x3b16c8);return _0x16eaee[_0xcaa4('0x25')](_0xcaa4('0x26'),_0x2aae6c+'-'+_0x735322+'/'+_0x28cbdf)[_0xcaa4('0x21')](_0xaea152);}return null;};}function patchUpdates(_0x1b09f7){return function(_0x232aea){try{jsonpatch[_0xcaa4('0x27')](_0x232aea,_0x1b09f7,!![]);}catch(_0xebcb18){return BPromise[_0xcaa4('0x28')](_0xebcb18);}return _0x232aea['save']();};}function saveUpdates(_0xecc07e,_0x16e47f){return function(_0x405619){if(_0x405619){return _0x405619[_0xcaa4('0x29')](_0xecc07e)[_0xcaa4('0x2a')](function(_0x332f4b){return _0x332f4b;});}return null;};}function removeEntity(_0x148dae,_0x314eb0){return function(_0x329b13){if(_0x329b13){return _0x329b13[_0xcaa4('0x2b')]()['then'](function(){var _0x413359=_0x329b13[_0xcaa4('0x2c')]({'plain':!![]});var _0x106837='SquareProjects';return db[_0xcaa4('0x2d')][_0xcaa4('0x2b')]({'where':{'type':_0x106837,'resourceId':_0x413359['id']}})[_0xcaa4('0x2a')](function(){return _0x329b13;});})[_0xcaa4('0x2a')](function(){_0x148dae[_0xcaa4('0x1f')](0xcc)[_0xcaa4('0x20')]();});}};}function handleEntityNotFound(_0x4e600d,_0x1b98c9){return function(_0x41906e){if(!_0x41906e){_0x4e600d[_0xcaa4('0x1e')](0x194);}return _0x41906e;};}function handleError(_0x2a4c59,_0x5b4740){_0x5b4740=_0x5b4740||0x1f4;return function(_0x5b459d){logger[_0xcaa4('0x2e')](_0x5b459d['stack']);if(_0x5b459d['name']){delete _0x5b459d['name'];}_0x2a4c59[_0xcaa4('0x1f')](_0x5b4740)[_0xcaa4('0x2f')](_0x5b459d);};}exports['index']=function(_0x2d8f9d,_0x57582f){var _0x1b7560={},_0x2c9431={},_0x47b0e3={'count':0x0,'rows':[]};var _0x581d23=db[_0xcaa4('0x30')]['rawAttributes'];_0x2c9431[_0xcaa4('0x31')]=_[_0xcaa4('0x32')](_0x581d23);var _0x4e9f77={'dateStart':_0x2d8f9d['query'][_0xcaa4('0x33')],'dateEnd':_0x2d8f9d['query'][_0xcaa4('0x34')]};delete _0x2d8f9d['query'][_0xcaa4('0x33')];delete _0x2d8f9d[_0xcaa4('0x35')][_0xcaa4('0x34')];_0x2c9431['query']=_['keys'](_0x2d8f9d[_0xcaa4('0x35')]);_0x2c9431[_0xcaa4('0x36')]=_[_0xcaa4('0x37')](_0x2c9431[_0xcaa4('0x31')],_0x2c9431['query']);_0x1b7560['attributes']=_[_0xcaa4('0x37')](_0x2c9431[_0xcaa4('0x31')],qs[_0xcaa4('0x38')](_0x2d8f9d[_0xcaa4('0x35')][_0xcaa4('0x38')]));_0x1b7560[_0xcaa4('0x39')]=_0x1b7560[_0xcaa4('0x39')][_0xcaa4('0x3a')]?_0x1b7560[_0xcaa4('0x39')]:_0x2c9431[_0xcaa4('0x31')];if(!_0x2d8f9d[_0xcaa4('0x35')][_0xcaa4('0x3b')](_0xcaa4('0x3c'))){_0x1b7560[_0xcaa4('0x24')]=qs[_0xcaa4('0x24')](_0x2d8f9d['query'][_0xcaa4('0x24')]);_0x1b7560[_0xcaa4('0x23')]=qs[_0xcaa4('0x23')](_0x2d8f9d['query'][_0xcaa4('0x23')]);}_0x1b7560[_0xcaa4('0x3d')]=qs[_0xcaa4('0x3e')](_0x2d8f9d[_0xcaa4('0x35')][_0xcaa4('0x3e')]);_0x1b7560[_0xcaa4('0x3f')]=qs[_0xcaa4('0x36')](_[_0xcaa4('0x40')](_0x2d8f9d[_0xcaa4('0x35')],_0x2c9431[_0xcaa4('0x36')]));if(_0x4e9f77['dateStart']){if(_0x4e9f77[_0xcaa4('0x34')]){_0x4e9f77[_0xcaa4('0x34')]=moment(_0x4e9f77[_0xcaa4('0x34')])[_0xcaa4('0x41')](0x1,_0xcaa4('0x42'));}else{_0x4e9f77[_0xcaa4('0x34')]=moment(_0x4e9f77[_0xcaa4('0x33')])[_0xcaa4('0x41')](0x1,_0xcaa4('0x42'));}_[_0xcaa4('0x43')](_0x1b7560[_0xcaa4('0x3f')],{'createdAt':{'$gte':_0x4e9f77[_0xcaa4('0x33')],'$lte':_0x4e9f77[_0xcaa4('0x34')]}});}if(_0x2d8f9d[_0xcaa4('0x35')][_0xcaa4('0x44')]){_0x1b7560[_0xcaa4('0x3f')]=_[_0xcaa4('0x43')](_0x1b7560[_0xcaa4('0x3f')],{'$or':_[_0xcaa4('0x45')](_0x581d23,function(_0x3d9311){if(_0x3d9311[_0xcaa4('0x46')][_0xcaa4('0x47')]!=='VIRTUAL'){var _0x2aca97={};_0x2aca97[_0x3d9311[_0xcaa4('0x48')]]={'$like':'%'+_0x2d8f9d[_0xcaa4('0x35')][_0xcaa4('0x44')]+'%'};return _0x2aca97;}})});}_0x1b7560=_[_0xcaa4('0x43')]({},_0x1b7560,_0x2d8f9d[_0xcaa4('0x49')]);var _0x14ead2={'where':_0x1b7560[_0xcaa4('0x3f')]};return db[_0xcaa4('0x30')]['count'](_0x14ead2)[_0xcaa4('0x2a')](function(_0x384dce){_0x47b0e3[_0xcaa4('0x22')]=_0x384dce;if(_0x2d8f9d[_0xcaa4('0x35')]['includeAll']){_0x1b7560[_0xcaa4('0x4a')]=[{'all':!![]}];}return db[_0xcaa4('0x30')][_0xcaa4('0x4b')](_0x1b7560);})[_0xcaa4('0x2a')](function(_0x181367){_0x47b0e3[_0xcaa4('0x4c')]=_0x181367;return _0x47b0e3;})['then'](respondWithFilteredResult(_0x57582f,_0x1b7560))[_0xcaa4('0x4d')](handleError(_0x57582f,null));};exports[_0xcaa4('0x4e')]=function(_0xe8111c,_0x38f250){var _0x2aa4b6={'raw':![],'where':{'id':_0xe8111c['params']['id']}},_0x4875f6={};_0x4875f6[_0xcaa4('0x31')]=_[_0xcaa4('0x32')](db[_0xcaa4('0x30')][_0xcaa4('0x4f')]);_0x4875f6[_0xcaa4('0x35')]=_[_0xcaa4('0x32')](_0xe8111c[_0xcaa4('0x35')]);_0x4875f6[_0xcaa4('0x36')]=_['intersection'](_0x4875f6['model'],_0x4875f6[_0xcaa4('0x35')]);_0x2aa4b6[_0xcaa4('0x39')]=_[_0xcaa4('0x37')](_0x4875f6['model'],qs[_0xcaa4('0x38')](_0xe8111c[_0xcaa4('0x35')][_0xcaa4('0x38')]));_0x2aa4b6['attributes']=_0x2aa4b6[_0xcaa4('0x39')][_0xcaa4('0x3a')]?_0x2aa4b6['attributes']:_0x4875f6['model'];if(_0xe8111c['query']['includeAll']){_0x2aa4b6[_0xcaa4('0x4a')]=[{'all':!![]}];}_0x2aa4b6=_[_0xcaa4('0x43')]({},_0x2aa4b6,_0xe8111c[_0xcaa4('0x49')]);return db[_0xcaa4('0x30')][_0xcaa4('0x50')](_0x2aa4b6)[_0xcaa4('0x2a')](handleEntityNotFound(_0x38f250,null))['then'](respondWithResult(_0x38f250,null))[_0xcaa4('0x4d')](handleError(_0x38f250,null));};exports[_0xcaa4('0x51')]=function(_0x1c1646,_0x43d23f){return db[_0xcaa4('0x30')][_0xcaa4('0x51')](_0x1c1646[_0xcaa4('0x52')],{})['then'](function(_0x28c55b){var _0x460df9=_0x1c1646[_0xcaa4('0x53')][_0xcaa4('0x2c')]({'plain':!![]});if(!_0x460df9)throw new Error(_0xcaa4('0x54'));if(_0x460df9[_0xcaa4('0x55')]===_0xcaa4('0x53')){var _0x33267b=_0x28c55b[_0xcaa4('0x2c')]({'plain':!![]});var _0x58bd1b=_0xcaa4('0x56');return db['UserProfileSection'][_0xcaa4('0x50')]({'where':{'name':_0x58bd1b,'userProfileId':_0x460df9[_0xcaa4('0x57')]},'raw':!![]})[_0xcaa4('0x2a')](function(_0x13e596){if(_0x13e596&&_0x13e596['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x33267b[_0xcaa4('0x58')],'resourceId':_0x33267b['id'],'type':_0x13e596['name'],'sectionId':_0x13e596['id']},{})[_0xcaa4('0x2a')](function(){return _0x28c55b;});}else{return _0x28c55b;}})['catch'](function(_0x2bb9eb){logger['error'](_0xcaa4('0x59'),_0x2bb9eb);throw _0x2bb9eb;});}return _0x28c55b;})[_0xcaa4('0x2a')](respondWithResult(_0x43d23f,0xc9))['catch'](handleError(_0x43d23f,null));};exports[_0xcaa4('0x29')]=function(_0x49a779,_0x2963d3){if(_0x49a779[_0xcaa4('0x52')]['id']){delete _0x49a779[_0xcaa4('0x52')]['id'];}return db[_0xcaa4('0x30')][_0xcaa4('0x50')]({'where':{'id':_0x49a779[_0xcaa4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2963d3,null))[_0xcaa4('0x2a')](saveUpdates(_0x49a779['body'],null))[_0xcaa4('0x2a')](respondWithResult(_0x2963d3,null))[_0xcaa4('0x4d')](handleError(_0x2963d3,null));};exports['destroy']=function(_0x50f363,_0x16d54d){return db[_0xcaa4('0x30')]['find']({'where':{'id':_0x50f363[_0xcaa4('0x5a')]['id']}})[_0xcaa4('0x2a')](handleEntityNotFound(_0x16d54d,null))['then'](removeEntity(_0x16d54d,null))[_0xcaa4('0x4d')](handleError(_0x16d54d,null));};exports[_0xcaa4('0x5b')]=function(_0x15a608,_0x6384ed,_0x2f715){return db[_0xcaa4('0x30')][_0xcaa4('0x50')]({'where':{'id':_0x15a608[_0xcaa4('0x5a')]['id']}})[_0xcaa4('0x2a')](handleEntityNotFound(_0x6384ed,null))[_0xcaa4('0x2a')](function(_0x1db92a){if(_0x1db92a){return _0x1db92a['addUsers'](_0x15a608['body']['ids'],_['omit'](_0x15a608[_0xcaa4('0x52')],['ids','id'])||{});}})[_0xcaa4('0x2a')](respondWithResult(_0x6384ed,null))['catch'](handleError(_0x6384ed,null));};exports[_0xcaa4('0x5c')]=function(_0x2f34f2,_0x589d6f,_0x13dcb2){var _0x36766a;return db[_0xcaa4('0x30')]['find']({'where':{'id':_0x2f34f2[_0xcaa4('0x5a')]['id']}})[_0xcaa4('0x2a')](handleEntityNotFound(_0x589d6f,null))[_0xcaa4('0x2a')](function(_0xb98d7c){if(_0xb98d7c){return _0xb98d7c['removeUsers'](_0x2f34f2[_0xcaa4('0x35')][_0xcaa4('0x5d')])[_0xcaa4('0x2a')](function(_0x39a16b){if(_[_0xcaa4('0x5e')](_0x2f34f2[_0xcaa4('0x35')][_0xcaa4('0x5d')])){for(var _0x57cdc0=0x0;_0x57cdc0<_0x2f34f2[_0xcaa4('0x35')][_0xcaa4('0x5d')][_0xcaa4('0x3a')];_0x57cdc0+=0x1){socket[_0xcaa4('0x5f')](_0xcaa4('0x60'),{'UserId':_0x2f34f2[_0xcaa4('0x35')][_0xcaa4('0x5d')][_0x57cdc0],'SquareProjectId':_0x2f34f2[_0xcaa4('0x5a')]['id']});}}else{socket['emit'](_0xcaa4('0x60'),{'UserId':_0x2f34f2[_0xcaa4('0x35')]['ids'],'SquareProjectId':_0x2f34f2[_0xcaa4('0x5a')]['id']});}});}})['then'](respondWithStatusCode(_0x589d6f,null))[_0xcaa4('0x4d')](handleError(_0x589d6f,null));};exports[_0xcaa4('0x61')]=function(_0x5ef5ca,_0x53ad21,_0x4287ef){var _0x1504a={};var _0x1e35f8={};var _0x453e3f;var _0x5c46da;return db[_0xcaa4('0x30')][_0xcaa4('0x62')]({'where':{'id':_0x5ef5ca[_0xcaa4('0x5a')]['id']}})[_0xcaa4('0x2a')](handleEntityNotFound(_0x53ad21,null))[_0xcaa4('0x2a')](function(_0x232d6a){if(_0x232d6a){_0x453e3f=_0x232d6a;_0x1e35f8[_0xcaa4('0x31')]=_[_0xcaa4('0x32')](db['User'][_0xcaa4('0x4f')]);_0x1e35f8[_0xcaa4('0x35')]=_[_0xcaa4('0x32')](_0x5ef5ca['query']);_0x1e35f8[_0xcaa4('0x36')]=_[_0xcaa4('0x37')](_0x1e35f8[_0xcaa4('0x31')],_0x1e35f8[_0xcaa4('0x35')]);_0x1504a[_0xcaa4('0x39')]=_[_0xcaa4('0x37')](_0x1e35f8[_0xcaa4('0x31')],qs[_0xcaa4('0x38')](_0x5ef5ca[_0xcaa4('0x35')]['fields']));_0x1504a[_0xcaa4('0x39')]=_0x1504a[_0xcaa4('0x39')][_0xcaa4('0x3a')]?_0x1504a['attributes']:_0x1e35f8[_0xcaa4('0x31')];_0x1504a[_0xcaa4('0x3d')]=qs[_0xcaa4('0x3e')](_0x5ef5ca[_0xcaa4('0x35')]['sort']);_0x1504a[_0xcaa4('0x3f')]=qs[_0xcaa4('0x36')](_[_0xcaa4('0x40')](_0x5ef5ca['query'],_0x1e35f8[_0xcaa4('0x36')]));if(_0x5ef5ca[_0xcaa4('0x35')][_0xcaa4('0x44')]){_0x1504a[_0xcaa4('0x3f')]=_[_0xcaa4('0x43')](_0x1504a['where'],{'$or':_[_0xcaa4('0x45')](_0x1504a[_0xcaa4('0x39')],function(_0x4261c8){var _0xf2eea3={};_0xf2eea3[_0x4261c8]={'$like':'%'+_0x5ef5ca[_0xcaa4('0x35')][_0xcaa4('0x44')]+'%'};return _0xf2eea3;})});}_0x1504a=_[_0xcaa4('0x43')]({},_0x1504a,_0x5ef5ca['options']);return _0x453e3f[_0xcaa4('0x61')](_0x1504a);}})[_0xcaa4('0x2a')](function(_0x2fc292){if(_0x2fc292){_0x5c46da=_0x2fc292[_0xcaa4('0x3a')];if(!_0x5ef5ca['query'][_0xcaa4('0x3b')](_0xcaa4('0x3c'))){_0x1504a[_0xcaa4('0x24')]=qs[_0xcaa4('0x24')](_0x5ef5ca[_0xcaa4('0x35')][_0xcaa4('0x24')]);_0x1504a['offset']=qs[_0xcaa4('0x23')](_0x5ef5ca[_0xcaa4('0x35')]['offset']);}return _0x453e3f['getUsers'](_0x1504a);}})['then'](function(_0x5ec3f3){if(_0x5ec3f3){return _0x5ec3f3?{'count':_0x5c46da,'rows':_0x5ec3f3}:null;}})[_0xcaa4('0x2a')](respondWithResult(_0x53ad21,null))[_0xcaa4('0x4d')](handleError(_0x53ad21,null));};
\ No newline at end of file
index ea3be0b..e49cda6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8c8=['setMaxListeners','emit','hook','exports','events','../../mysqldb'];(function(_0x11fbaa,_0x52dc16){var _0x1831fd=function(_0x2bbced){while(--_0x2bbced){_0x11fbaa['push'](_0x11fbaa['shift']());}};_0x1831fd(++_0x52dc16);}(_0xa8c8,0x1d2));var _0x8a8c=function(_0x328b20,_0x39cabe){_0x328b20=_0x328b20-0x0;var _0x111db2=_0xa8c8[_0x328b20];return _0x111db2;};'use strict';var EventEmitter=require(_0x8a8c('0x0'));var SquareProject=require(_0x8a8c('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8a8c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b143d){return function(_0x11c84c,_0xfeb2eb,_0x18207c){SquareProjectEvents[_0x8a8c('0x3')](_0x5b143d+':'+_0x11c84c['id'],_0x11c84c);SquareProjectEvents[_0x8a8c('0x3')](_0x5b143d,_0x11c84c);_0x18207c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8a8c('0x4')](e,emitEvent(event));}}module[_0x8a8c('0x5')]=SquareProjectEvents;
\ No newline at end of file
+var _0xb630=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x5c0af7,_0x834452){var _0x146598=function(_0x4ba16d){while(--_0x4ba16d){_0x5c0af7['push'](_0x5c0af7['shift']());}};_0x146598(++_0x834452);}(_0xb630,0xb1));var _0x0b63=function(_0x18b165,_0x40a7ea){_0x18b165=_0x18b165-0x0;var _0x1d8e19=_0xb630[_0x18b165];return _0x1d8e19;};'use strict';var EventEmitter=require(_0x0b63('0x0'));var SquareProject=require(_0x0b63('0x1'))['db'][_0x0b63('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0b63('0x3')](0x0);var events={'afterCreate':_0x0b63('0x4'),'afterUpdate':_0x0b63('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4332d4){return function(_0x2b3447,_0x4fd82e,_0x49b145){SquareProjectEvents[_0x0b63('0x6')](_0x4332d4+':'+_0x2b3447['id'],_0x2b3447);SquareProjectEvents[_0x0b63('0x6')](_0x4332d4,_0x2b3447);_0x49b145(null);};}for(var e in events){if(events[_0x0b63('0x7')](e)){var event=events[e];SquareProject[_0x0b63('0x8')](e,emitEvent(event));}}module[_0x0b63('0x9')]=SquareProjectEvents;
\ No newline at end of file
index 1eda058..68a438c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3301=['SquareProject','lodash','util','../../config/logger','bluebird','request-promise','./squareProject.attributes','exports'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x3301,0x1b9));var _0x1330=function(_0x522e32,_0x440e6d){_0x522e32=_0x522e32-0x0;var _0x216842=_0x3301[_0x522e32];return _0x216842;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var logger=require(_0x1330('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1330('0x3'));var rp=require(_0x1330('0x4'));var attributes=require(_0x1330('0x5'));module[_0x1330('0x6')]=function(_0x37f9f6,_0x20d75a){return _0x37f9f6['define'](_0x1330('0x7'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22a5=['SquareProject','square_projects','lodash','util','../../config/logger','api','bluebird','request-promise','./squareProject.attributes','exports','define'];(function(_0x219d8d,_0x5b0f30){var _0x8fc5e1=function(_0x4c1de0){while(--_0x4c1de0){_0x219d8d['push'](_0x219d8d['shift']());}};_0x8fc5e1(++_0x5b0f30);}(_0x22a5,0xb2));var _0x522a=function(_0x582aa0,_0x2dc466){_0x582aa0=_0x582aa0-0x0;var _0x4512c3=_0x22a5[_0x582aa0];return _0x4512c3;};'use strict';var _=require(_0x522a('0x0'));var util=require(_0x522a('0x1'));var logger=require(_0x522a('0x2'))(_0x522a('0x3'));var moment=require('moment');var BPromise=require(_0x522a('0x4'));var rp=require(_0x522a('0x5'));var attributes=require(_0x522a('0x6'));module[_0x522a('0x7')]=function(_0x545dd5,_0x33b62e){return _0x545dd5[_0x522a('0x8')](_0x522a('0x9'),attributes,{'tableName':_0x522a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b57f983..78cc96b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x1843b3,_0x10995a){var _0x3c7de0=function(_0xe28643){while(--_0xe28643){_0x1843b3['push'](_0x1843b3['shift']());}};_0x3c7de0(++_0x10995a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});};
\ No newline at end of file
+var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x247550,_0x20e5f1){var _0x17bab3=function(_0x21f38b){while(--_0x21f38b){_0x247550['push'](_0x247550['shift']());}};_0x17bab3(++_0x20e5f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});};
\ No newline at end of file
index 54d0b82..f0f168a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa62c=['./squareProject.events','save','remove','update','removeListener','register','length','squareProject:'];(function(_0x19ce9c,_0x3c7cfc){var _0x1a69ec=function(_0x4c3684){while(--_0x4c3684){_0x19ce9c['push'](_0x19ce9c['shift']());}};_0x1a69ec(++_0x3c7cfc);}(_0xa62c,0x70));var _0xca62=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xa62c[_0xe15270];return _0x1e813b;};'use strict';var SquareProjectEvents=require(_0xca62('0x0'));var events=[_0xca62('0x1'),_0xca62('0x2'),_0xca62('0x3')];function createListener(_0x27ee5c,_0x1eed11){return function(_0x11ad76){_0x1eed11['emit'](_0x27ee5c,_0x11ad76);};}function removeListener(_0x35180a,_0x3da6b7){return function(){SquareProjectEvents[_0xca62('0x4')](_0x35180a,_0x3da6b7);};}exports[_0xca62('0x5')]=function(_0x1e51ba){for(var _0x31d267=0x0,_0x310378=events[_0xca62('0x6')];_0x31d267<_0x310378;_0x31d267++){var _0x5da9b9=events[_0x31d267];var _0x2160c4=createListener(_0xca62('0x7')+_0x5da9b9,_0x1e51ba);SquareProjectEvents['on'](_0x5da9b9,_0x2160c4);}};
\ No newline at end of file
+var _0x028d=['register','length','squareProject:','save','remove','emit'];(function(_0xdd0c9d,_0x423eb2){var _0x4ca277=function(_0xcabeeb){while(--_0xcabeeb){_0xdd0c9d['push'](_0xdd0c9d['shift']());}};_0x4ca277(++_0x423eb2);}(_0x028d,0xff));var _0xd028=function(_0x1b6daf,_0x25c63e){_0x1b6daf=_0x1b6daf-0x0;var _0x216a87=_0x028d[_0x1b6daf];return _0x216a87;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xd028('0x0'),_0xd028('0x1'),'update'];function createListener(_0x35e90f,_0x362847){return function(_0x157cf4){_0x362847[_0xd028('0x2')](_0x35e90f,_0x157cf4);};}function removeListener(_0x2dc43c,_0x67d150){return function(){SquareProjectEvents['removeListener'](_0x2dc43c,_0x67d150);};}exports[_0xd028('0x3')]=function(_0x4592fd){for(var _0x20588f=0x0,_0x35b879=events[_0xd028('0x4')];_0x20588f<_0x35b879;_0x20588f++){var _0xb35f34=events[_0x20588f];var _0xab6e68=createListener(_0xd028('0x5')+_0xb35f34,_0x4592fd);SquareProjectEvents['on'](_0xb35f34,_0xab6e68);}};
\ No newline at end of file
index 2eafc3b..828540f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf354=['delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','download','post','create','put','update'];(function(_0x1b19bb,_0x4b2200){var _0x3d0639=function(_0x27edff){while(--_0x27edff){_0x1b19bb['push'](_0x1b19bb['shift']());}};_0x3d0639(++_0x4b2200);}(_0xf354,0x17c));var _0x4f35=function(_0x2d64f3,_0x4b58e3){_0x2d64f3=_0x2d64f3-0x0;var _0x13a2cf=_0xf354[_0x2d64f3];return _0x13a2cf;};'use strict';var multer=require(_0x4f35('0x0'));var util=require(_0x4f35('0x1'));var path=require('path');var timeout=require(_0x4f35('0x2'));var express=require('express');var router=express[_0x4f35('0x3')]();var auth=require(_0x4f35('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4f35('0x5'));router[_0x4f35('0x6')]('/',auth[_0x4f35('0x7')](),controller[_0x4f35('0x8')]);router[_0x4f35('0x6')](_0x4f35('0x9'),auth[_0x4f35('0x7')](),controller[_0x4f35('0xa')]);router[_0x4f35('0x6')]('/:id/download',auth[_0x4f35('0x7')](),controller[_0x4f35('0xb')]);router[_0x4f35('0xc')]('/',auth[_0x4f35('0x7')](),controller[_0x4f35('0xd')]);router[_0x4f35('0xe')](_0x4f35('0x9'),auth['isAuthenticated'](),controller[_0x4f35('0xf')]);router[_0x4f35('0x10')](_0x4f35('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x4f35('0x11')]=router;
\ No newline at end of file
+var _0xe84e=['index','/:id','show','post','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','./squareRecording.controller','get','isAuthenticated'];(function(_0x2fccff,_0x26ff27){var _0x43e7d8=function(_0x22fda7){while(--_0x22fda7){_0x2fccff['push'](_0x2fccff['shift']());}};_0x43e7d8(++_0x26ff27);}(_0xe84e,0xf7));var _0xee84=function(_0x448313,_0x2b5e0f){_0x448313=_0x448313-0x0;var _0x3740be=_0xe84e[_0x448313];return _0x3740be;};'use strict';var multer=require(_0xee84('0x0'));var util=require(_0xee84('0x1'));var path=require(_0xee84('0x2'));var timeout=require(_0xee84('0x3'));var express=require(_0xee84('0x4'));var router=express['Router']();var auth=require(_0xee84('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee84('0x6'));router[_0xee84('0x7')]('/',auth[_0xee84('0x8')](),controller[_0xee84('0x9')]);router[_0xee84('0x7')](_0xee84('0xa'),auth[_0xee84('0x8')](),controller[_0xee84('0xb')]);router[_0xee84('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xee84('0xc')]('/',auth[_0xee84('0x8')](),controller['create']);router['put']('/:id',auth[_0xee84('0x8')](),controller[_0xee84('0xd')]);router[_0xee84('0xe')]('/:id',auth[_0xee84('0x8')](),controller[_0xee84('0xf')]);module['exports']=router;
\ No newline at end of file
index e40004b..418d73c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8a9=['exports','STRING','sequelize'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xf8a9,0x18b));var _0x9f8a=function(_0x160662,_0x458682){_0x160662=_0x160662-0x0;var _0x4bd9cd=_0xf8a9[_0x160662];return _0x4bd9cd;};'use strict';var Sequelize=require(_0x9f8a('0x0'));module[_0x9f8a('0x1')]={'uniqueid':{'type':Sequelize[_0x9f8a('0x2')]},'callerid':{'type':Sequelize[_0x9f8a('0x2')]},'calleridname':{'type':Sequelize[_0x9f8a('0x2')]},'context':{'type':Sequelize[_0x9f8a('0x2')]},'extension':{'type':Sequelize[_0x9f8a('0x2')]},'priority':{'type':Sequelize[_0x9f8a('0x2')]},'accountcode':{'type':Sequelize[_0x9f8a('0x2')]},'dnid':{'type':Sequelize[_0x9f8a('0x2')]},'projectName':{'type':Sequelize[_0x9f8a('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x9f8a('0x2')]},'savePath':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe102=['exports','STRING','sequelize'];(function(_0x40d078,_0x541e13){var _0x52c06b=function(_0x151fb5){while(--_0x151fb5){_0x40d078['push'](_0x40d078['shift']());}};_0x52c06b(++_0x541e13);}(_0xe102,0x1d3));var _0x2e10=function(_0x3cf60b,_0x22cca0){_0x3cf60b=_0x3cf60b-0x0;var _0x9806b8=_0xe102[_0x3cf60b];return _0x9806b8;};'use strict';var Sequelize=require(_0x2e10('0x0'));module[_0x2e10('0x1')]={'uniqueid':{'type':Sequelize[_0x2e10('0x2')]},'callerid':{'type':Sequelize[_0x2e10('0x2')]},'calleridname':{'type':Sequelize[_0x2e10('0x2')]},'context':{'type':Sequelize[_0x2e10('0x2')]},'extension':{'type':Sequelize[_0x2e10('0x2')]},'priority':{'type':Sequelize[_0x2e10('0x2')]},'accountcode':{'type':Sequelize[_0x2e10('0x2')]},'dnid':{'type':Sequelize[_0x2e10('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x2e10('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x2e10('0x2')]}};
\ No newline at end of file
index 59c8c4a..d906ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbacd=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query','dateEnd','dateStart','filters','attributes','intersection','fields','length','limit','order','sort','where','pick','add','day','filter','merge','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','value','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x162b8e,_0xe6a0d7){var _0x1b87b0=function(_0x4fa0a9){while(--_0x4fa0a9){_0x162b8e['push'](_0x162b8e['shift']());}};_0x1b87b0(++_0xe6a0d7);}(_0xbacd,0x1c5));var _0xdbac=function(_0x5acefa,_0x50e7d1){_0x5acefa=_0x5acefa-0x0;var _0x1590b9=_0xbacd[_0x5acefa];return _0x1590b9;};'use strict';var pdf=require(_0xdbac('0x0'));var emlformat=require(_0xdbac('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdbac('0x2'));var jsonpatch=require(_0xdbac('0x3'));var rp=require(_0xdbac('0x4'));var moment=require('moment');var BPromise=require(_0xdbac('0x5'));var Mustache=require(_0xdbac('0x6'));var util=require(_0xdbac('0x7'));var path=require(_0xdbac('0x8'));var sox=require(_0xdbac('0x9'));var csv=require(_0xdbac('0xa'));var ejs=require(_0xdbac('0xb'));var fs=require('fs');var _=require(_0xdbac('0xc'));var squel=require(_0xdbac('0xd'));var crypto=require(_0xdbac('0xe'));var jsforce=require(_0xdbac('0xf'));var deskjs=require(_0xdbac('0x10'));var toCsv=require(_0xdbac('0xa'));var querystring=require(_0xdbac('0x11'));var Papa=require(_0xdbac('0x12'));var Redis=require('ioredis');var qs=require(_0xdbac('0x13'));var logger=require(_0xdbac('0x14'))('api');var utils=require(_0xdbac('0x15'));var config=require('../../config/environment');var db=require(_0xdbac('0x16'))['db'];function respondWithStatusCode(_0x354884,_0x27689f){_0x27689f=_0x27689f||0xcc;return function(_0x29d151){if(_0x29d151){return _0x354884[_0xdbac('0x17')](_0x27689f);}return _0x354884[_0xdbac('0x18')](_0x27689f)[_0xdbac('0x19')]();};}function respondWithResult(_0x2c7f44,_0xe2d3ab){_0xe2d3ab=_0xe2d3ab||0xc8;return function(_0x519738){if(_0x519738){return _0x2c7f44[_0xdbac('0x18')](_0xe2d3ab)[_0xdbac('0x1a')](_0x519738);}};}function respondWithFilteredResult(_0x1eed36,_0x14ebaa){return function(_0x3c6740){if(_0x3c6740){var _0x1fc4ba=_0x3c6740[_0xdbac('0x1b')],_0x94a61=_0x14ebaa[_0xdbac('0x1c')],_0x176da6=_0x14ebaa[_0xdbac('0x1c')]+_0x14ebaa['limit'],_0x574e58;if(_0x176da6>=_0x1fc4ba){_0x176da6=_0x1fc4ba;_0x574e58=0xc8;}else{_0x574e58=0xce;}_0x1eed36[_0xdbac('0x18')](_0x574e58);return _0x1eed36[_0xdbac('0x1d')](_0xdbac('0x1e'),_0x94a61+'-'+_0x176da6+'/'+_0x1fc4ba)[_0xdbac('0x1a')](_0x3c6740);}return null;};}function patchUpdates(_0x50206a){return function(_0x1a9690){try{jsonpatch[_0xdbac('0x1f')](_0x1a9690,_0x50206a,!![]);}catch(_0x43fea9){return BPromise[_0xdbac('0x20')](_0x43fea9);}return _0x1a9690[_0xdbac('0x21')]();};}function saveUpdates(_0x4598d9,_0x9c74a5){return function(_0x5ec67c){if(_0x5ec67c){return _0x5ec67c[_0xdbac('0x22')](_0x4598d9)[_0xdbac('0x23')](function(_0x4e4af9){return _0x4e4af9;});}return null;};}function removeEntity(_0x29a665,_0x582c0b){return function(_0x1db731){if(_0x1db731){return _0x1db731['destroy']()[_0xdbac('0x23')](function(){_0x29a665[_0xdbac('0x18')](0xcc)[_0xdbac('0x19')]();});}};}function handleEntityNotFound(_0x4263c4,_0x200630){return function(_0x4148fc){if(!_0x4148fc){_0x4263c4[_0xdbac('0x17')](0x194);}return _0x4148fc;};}function handleError(_0x4e68b0,_0x361930){_0x361930=_0x361930||0x1f4;return function(_0x822567){logger[_0xdbac('0x24')](_0x822567[_0xdbac('0x25')]);if(_0x822567[_0xdbac('0x26')]){delete _0x822567[_0xdbac('0x26')];}_0x4e68b0[_0xdbac('0x18')](_0x361930)[_0xdbac('0x27')](_0x822567);};}exports[_0xdbac('0x28')]=function(_0x175ebc,_0x2cb8b4){var _0x1ea3c3={},_0x16c7bc={},_0x3c8bfc={'count':0x0,'rows':[]};var _0x35a7f0=db[_0xdbac('0x29')][_0xdbac('0x2a')];_0x16c7bc[_0xdbac('0x2b')]=_[_0xdbac('0x2c')](_0x35a7f0);var _0xe744cc={'dateStart':_0x175ebc[_0xdbac('0x2d')]['dateStart'],'dateEnd':_0x175ebc[_0xdbac('0x2d')][_0xdbac('0x2e')]};delete _0x175ebc[_0xdbac('0x2d')][_0xdbac('0x2f')];delete _0x175ebc['query']['dateEnd'];_0x16c7bc[_0xdbac('0x2d')]=_[_0xdbac('0x2c')](_0x175ebc[_0xdbac('0x2d')]);_0x16c7bc[_0xdbac('0x30')]=_['intersection'](_0x16c7bc[_0xdbac('0x2b')],_0x16c7bc[_0xdbac('0x2d')]);_0x1ea3c3[_0xdbac('0x31')]=_[_0xdbac('0x32')](_0x16c7bc[_0xdbac('0x2b')],qs[_0xdbac('0x33')](_0x175ebc[_0xdbac('0x2d')][_0xdbac('0x33')]));_0x1ea3c3['attributes']=_0x1ea3c3['attributes'][_0xdbac('0x34')]?_0x1ea3c3[_0xdbac('0x31')]:_0x16c7bc[_0xdbac('0x2b')];if(!_0x175ebc[_0xdbac('0x2d')]['hasOwnProperty']('nolimit')){_0x1ea3c3[_0xdbac('0x35')]=qs[_0xdbac('0x35')](_0x175ebc[_0xdbac('0x2d')][_0xdbac('0x35')]);_0x1ea3c3[_0xdbac('0x1c')]=qs[_0xdbac('0x1c')](_0x175ebc[_0xdbac('0x2d')][_0xdbac('0x1c')]);}_0x1ea3c3[_0xdbac('0x36')]=qs[_0xdbac('0x37')](_0x175ebc[_0xdbac('0x2d')][_0xdbac('0x37')]);_0x1ea3c3[_0xdbac('0x38')]=qs['filters'](_[_0xdbac('0x39')](_0x175ebc['query'],_0x16c7bc[_0xdbac('0x30')]));if(_0xe744cc[_0xdbac('0x2f')]){if(_0xe744cc[_0xdbac('0x2e')]){_0xe744cc[_0xdbac('0x2e')]=moment(_0xe744cc['dateEnd'])[_0xdbac('0x3a')](0x1,_0xdbac('0x3b'));}else{_0xe744cc['dateEnd']=moment(_0xe744cc['dateStart'])[_0xdbac('0x3a')](0x1,'day');}_['merge'](_0x1ea3c3[_0xdbac('0x38')],{'createdAt':{'$gte':_0xe744cc[_0xdbac('0x2f')],'$lte':_0xe744cc[_0xdbac('0x2e')]}});}if(_0x175ebc['query'][_0xdbac('0x3c')]){_0x1ea3c3[_0xdbac('0x38')]=_[_0xdbac('0x3d')](_0x1ea3c3[_0xdbac('0x38')],{'$or':_['map'](_0x35a7f0,function(_0x49c5b0){if(_0x49c5b0[_0xdbac('0x3e')][_0xdbac('0x3f')]!==_0xdbac('0x40')){var _0x2edbb0={};_0x2edbb0[_0x49c5b0[_0xdbac('0x41')]]={'$like':'%'+_0x175ebc['query'][_0xdbac('0x3c')]+'%'};return _0x2edbb0;}})});}_0x1ea3c3=_[_0xdbac('0x3d')]({},_0x1ea3c3,_0x175ebc['options']);var _0x182a97={'where':_0x1ea3c3[_0xdbac('0x38')]};return db[_0xdbac('0x29')][_0xdbac('0x1b')](_0x182a97)[_0xdbac('0x23')](function(_0x575b59){_0x3c8bfc[_0xdbac('0x1b')]=_0x575b59;if(_0x175ebc[_0xdbac('0x2d')][_0xdbac('0x42')]){_0x1ea3c3[_0xdbac('0x43')]=[{'all':!![]}];}return db[_0xdbac('0x29')][_0xdbac('0x44')](_0x1ea3c3);})[_0xdbac('0x23')](function(_0x3c1894){_0x3c8bfc[_0xdbac('0x45')]=_0x3c1894;return _0x3c8bfc;})[_0xdbac('0x23')](respondWithFilteredResult(_0x2cb8b4,_0x1ea3c3))[_0xdbac('0x46')](handleError(_0x2cb8b4,null));};exports[_0xdbac('0x47')]=function(_0x575384,_0x5395fd){var _0x5b10e9={'raw':!![],'where':{'id':_0x575384[_0xdbac('0x48')]['id']}},_0x5495eb={};_0x5495eb[_0xdbac('0x2b')]=_[_0xdbac('0x2c')](db[_0xdbac('0x29')][_0xdbac('0x2a')]);_0x5495eb[_0xdbac('0x2d')]=_[_0xdbac('0x2c')](_0x575384[_0xdbac('0x2d')]);_0x5495eb[_0xdbac('0x30')]=_['intersection'](_0x5495eb['model'],_0x5495eb['query']);_0x5b10e9[_0xdbac('0x31')]=_[_0xdbac('0x32')](_0x5495eb['model'],qs['fields'](_0x575384['query'][_0xdbac('0x33')]));_0x5b10e9[_0xdbac('0x31')]=_0x5b10e9[_0xdbac('0x31')]['length']?_0x5b10e9[_0xdbac('0x31')]:_0x5495eb[_0xdbac('0x2b')];if(_0x575384[_0xdbac('0x2d')][_0xdbac('0x42')]){_0x5b10e9[_0xdbac('0x43')]=[{'all':!![]}];}_0x5b10e9=_['merge']({},_0x5b10e9,_0x575384[_0xdbac('0x49')]);return db[_0xdbac('0x29')][_0xdbac('0x4a')](_0x5b10e9)[_0xdbac('0x23')](handleEntityNotFound(_0x5395fd,null))['then'](respondWithResult(_0x5395fd,null))[_0xdbac('0x46')](handleError(_0x5395fd,null));};exports[_0xdbac('0x4b')]=function(_0x1463ca,_0x5d6e86){return db[_0xdbac('0x29')][_0xdbac('0x4b')](_0x1463ca[_0xdbac('0x4c')],{})[_0xdbac('0x23')](respondWithResult(_0x5d6e86,0xc9))[_0xdbac('0x46')](handleError(_0x5d6e86,null));};exports[_0xdbac('0x22')]=function(_0x5563e4,_0x357c03){if(_0x5563e4[_0xdbac('0x4c')]['id']){delete _0x5563e4['body']['id'];}return db[_0xdbac('0x29')][_0xdbac('0x4a')]({'where':{'id':_0x5563e4[_0xdbac('0x48')]['id']}})[_0xdbac('0x23')](handleEntityNotFound(_0x357c03,null))['then'](saveUpdates(_0x5563e4['body'],null))[_0xdbac('0x23')](respondWithResult(_0x357c03,null))[_0xdbac('0x46')](handleError(_0x357c03,null));};exports['destroy']=function(_0x4d9bd7,_0x3f0b35){return db['SquareRecording'][_0xdbac('0x4a')]({'where':{'id':_0x4d9bd7[_0xdbac('0x48')]['id']}})[_0xdbac('0x23')](handleEntityNotFound(_0x3f0b35,null))['then'](removeEntity(_0x3f0b35,null))['catch'](handleError(_0x3f0b35,null));};exports[_0xdbac('0x4d')]=function(_0x1fb86d,_0x36155e,_0x107f36){var _0x16f9bc=require(_0xdbac('0x4e'));var _0x1641b3=![];var _0x50a29b={};if(_0x1fb86d['query'][_0xdbac('0x3e')]&&_0x1fb86d[_0xdbac('0x2d')][_0xdbac('0x3e')]===_0xdbac('0x4f')){_0x50a29b[_0xdbac('0x4f')]=_0x1fb86d[_0xdbac('0x48')]['id'];}else{_0x50a29b['id']=_0x1fb86d['params']['id'];}return db[_0xdbac('0x29')][_0xdbac('0x4a')]({'where':_0x50a29b,'attributes':['id',_0xdbac('0x50'),_0xdbac('0x51')],'raw':!![]})[_0xdbac('0x23')](handleEntityNotFound(_0x36155e,null))['then'](function(_0x49fcf5){if(_0x49fcf5){var _0xf7c0db=util['format'](_0xdbac('0x52'),_0x49fcf5[_0xdbac('0x53')]);if(fs['existsSync'](_0xf7c0db)){_0x1641b3=!![];return _0x16f9bc[_0xdbac('0x54')](_0xf7c0db,_0x49fcf5['savePath'],config['secrets'][_0xdbac('0x55')])[_0xdbac('0x23')](function(){return _0x49fcf5;});}return _0x49fcf5;}})['then'](function(_0x50d459){if(_0x50d459){if(!fs[_0xdbac('0x56')](_0x50d459['savePath'])){throw new db[(_0xdbac('0x57'))][(_0xdbac('0x58'))](_0xdbac('0x59'));}if(_0x50d459['filename']){return _0x36155e['download'](_0x50d459[_0xdbac('0x50')],_0x50d459[_0xdbac('0x51')]+path[_0xdbac('0x5a')](_0x50d459['savePath']),function(){if(_0x1641b3){fs[_0xdbac('0x5b')](_0x50d459[_0xdbac('0x50')]);}});}else{return _0x36155e['download'](_0x50d459[_0xdbac('0x50')],function(_0x4dd190){if(_0x1641b3){fs['unlink'](_0x50d459[_0xdbac('0x50')]);}});}}})[_0xdbac('0x46')](handleError(_0x36155e,null));};
\ No newline at end of file
+var _0x1b65=['path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','SquareRecording','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','add','day','merge','filter','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','uniqueid','savePath','filename','format','%s.cypher','value','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','unlink','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x3c49b2,_0x285e48){var _0x2d9203=function(_0x486d6f){while(--_0x486d6f){_0x3c49b2['push'](_0x3c49b2['shift']());}};_0x2d9203(++_0x285e48);}(_0x1b65,0x1b4));var _0x51b6=function(_0x19f8ee,_0x3e08c2){_0x19f8ee=_0x19f8ee-0x0;var _0x3b68f2=_0x1b65[_0x19f8ee];return _0x3b68f2;};'use strict';var pdf=require(_0x51b6('0x0'));var emlformat=require(_0x51b6('0x1'));var rimraf=require(_0x51b6('0x2'));var zipdir=require(_0x51b6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51b6('0x4'));var moment=require(_0x51b6('0x5'));var BPromise=require(_0x51b6('0x6'));var Mustache=require(_0x51b6('0x7'));var util=require(_0x51b6('0x8'));var path=require(_0x51b6('0x9'));var sox=require(_0x51b6('0xa'));var csv=require('to-csv');var ejs=require(_0x51b6('0xb'));var fs=require('fs');var _=require(_0x51b6('0xc'));var squel=require(_0x51b6('0xd'));var crypto=require(_0x51b6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x51b6('0xf'));var toCsv=require(_0x51b6('0x10'));var querystring=require('querystring');var Papa=require(_0x51b6('0x11'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x51b6('0x12'))(_0x51b6('0x13'));var utils=require(_0x51b6('0x14'));var config=require(_0x51b6('0x15'));var db=require(_0x51b6('0x16'))['db'];function respondWithStatusCode(_0x5f0c78,_0x4a7bcf){_0x4a7bcf=_0x4a7bcf||0xcc;return function(_0x44616b){if(_0x44616b){return _0x5f0c78['sendStatus'](_0x4a7bcf);}return _0x5f0c78['status'](_0x4a7bcf)[_0x51b6('0x17')]();};}function respondWithResult(_0x4ca143,_0x2c2aff){_0x2c2aff=_0x2c2aff||0xc8;return function(_0x48ab57){if(_0x48ab57){return _0x4ca143[_0x51b6('0x18')](_0x2c2aff)[_0x51b6('0x19')](_0x48ab57);}};}function respondWithFilteredResult(_0x2890ee,_0x235d8c){return function(_0x5049df){if(_0x5049df){var _0x29a458=_0x5049df[_0x51b6('0x1a')],_0x4c6cd0=_0x235d8c['offset'],_0x23549b=_0x235d8c[_0x51b6('0x1b')]+_0x235d8c['limit'],_0x596863;if(_0x23549b>=_0x29a458){_0x23549b=_0x29a458;_0x596863=0xc8;}else{_0x596863=0xce;}_0x2890ee[_0x51b6('0x18')](_0x596863);return _0x2890ee[_0x51b6('0x1c')](_0x51b6('0x1d'),_0x4c6cd0+'-'+_0x23549b+'/'+_0x29a458)[_0x51b6('0x19')](_0x5049df);}return null;};}function patchUpdates(_0x1bc6c5){return function(_0x22c6da){try{jsonpatch['apply'](_0x22c6da,_0x1bc6c5,!![]);}catch(_0x3d883e){return BPromise['reject'](_0x3d883e);}return _0x22c6da[_0x51b6('0x1e')]();};}function saveUpdates(_0x444da9,_0x506367){return function(_0x3e2d90){if(_0x3e2d90){return _0x3e2d90[_0x51b6('0x1f')](_0x444da9)[_0x51b6('0x20')](function(_0x471783){return _0x471783;});}return null;};}function removeEntity(_0x21c90c,_0x663b44){return function(_0x3e3015){if(_0x3e3015){return _0x3e3015[_0x51b6('0x21')]()['then'](function(){_0x21c90c[_0x51b6('0x18')](0xcc)[_0x51b6('0x17')]();});}};}function handleEntityNotFound(_0x1bffee,_0x2d5e1b){return function(_0x53e709){if(!_0x53e709){_0x1bffee[_0x51b6('0x22')](0x194);}return _0x53e709;};}function handleError(_0x3680af,_0x51c013){_0x51c013=_0x51c013||0x1f4;return function(_0x5de6e3){logger[_0x51b6('0x23')](_0x5de6e3[_0x51b6('0x24')]);if(_0x5de6e3[_0x51b6('0x25')]){delete _0x5de6e3['name'];}_0x3680af['status'](_0x51c013)[_0x51b6('0x26')](_0x5de6e3);};}exports[_0x51b6('0x27')]=function(_0x8c0881,_0x4a5ff8){var _0x2842b2={},_0x3372b2={},_0x5a8a5b={'count':0x0,'rows':[]};var _0x2df2fa=db[_0x51b6('0x28')][_0x51b6('0x29')];_0x3372b2[_0x51b6('0x2a')]=_[_0x51b6('0x2b')](_0x2df2fa);var _0x51b505={'dateStart':_0x8c0881[_0x51b6('0x2c')][_0x51b6('0x2d')],'dateEnd':_0x8c0881[_0x51b6('0x2c')]['dateEnd']};delete _0x8c0881[_0x51b6('0x2c')][_0x51b6('0x2d')];delete _0x8c0881[_0x51b6('0x2c')][_0x51b6('0x2e')];_0x3372b2['query']=_[_0x51b6('0x2b')](_0x8c0881['query']);_0x3372b2[_0x51b6('0x2f')]=_[_0x51b6('0x30')](_0x3372b2['model'],_0x3372b2['query']);_0x2842b2[_0x51b6('0x31')]=_[_0x51b6('0x30')](_0x3372b2['model'],qs[_0x51b6('0x32')](_0x8c0881[_0x51b6('0x2c')]['fields']));_0x2842b2[_0x51b6('0x31')]=_0x2842b2[_0x51b6('0x31')][_0x51b6('0x33')]?_0x2842b2['attributes']:_0x3372b2[_0x51b6('0x2a')];if(!_0x8c0881['query'][_0x51b6('0x34')](_0x51b6('0x35'))){_0x2842b2[_0x51b6('0x36')]=qs[_0x51b6('0x36')](_0x8c0881[_0x51b6('0x2c')][_0x51b6('0x36')]);_0x2842b2[_0x51b6('0x1b')]=qs[_0x51b6('0x1b')](_0x8c0881['query'][_0x51b6('0x1b')]);}_0x2842b2[_0x51b6('0x37')]=qs['sort'](_0x8c0881[_0x51b6('0x2c')]['sort']);_0x2842b2[_0x51b6('0x38')]=qs[_0x51b6('0x2f')](_[_0x51b6('0x39')](_0x8c0881['query'],_0x3372b2[_0x51b6('0x2f')]));if(_0x51b505[_0x51b6('0x2d')]){if(_0x51b505['dateEnd']){_0x51b505[_0x51b6('0x2e')]=moment(_0x51b505[_0x51b6('0x2e')])[_0x51b6('0x3a')](0x1,_0x51b6('0x3b'));}else{_0x51b505[_0x51b6('0x2e')]=moment(_0x51b505[_0x51b6('0x2d')])[_0x51b6('0x3a')](0x1,_0x51b6('0x3b'));}_[_0x51b6('0x3c')](_0x2842b2[_0x51b6('0x38')],{'createdAt':{'$gte':_0x51b505[_0x51b6('0x2d')],'$lte':_0x51b505[_0x51b6('0x2e')]}});}if(_0x8c0881[_0x51b6('0x2c')][_0x51b6('0x3d')]){_0x2842b2[_0x51b6('0x38')]=_[_0x51b6('0x3c')](_0x2842b2['where'],{'$or':_[_0x51b6('0x3e')](_0x2df2fa,function(_0x53db8e){if(_0x53db8e[_0x51b6('0x3f')]['key']!==_0x51b6('0x40')){var _0x2e7f79={};_0x2e7f79[_0x53db8e['field']]={'$like':'%'+_0x8c0881[_0x51b6('0x2c')][_0x51b6('0x3d')]+'%'};return _0x2e7f79;}})});}_0x2842b2=_['merge']({},_0x2842b2,_0x8c0881[_0x51b6('0x41')]);var _0x4570a8={'where':_0x2842b2[_0x51b6('0x38')]};return db[_0x51b6('0x28')][_0x51b6('0x1a')](_0x4570a8)['then'](function(_0x588a05){_0x5a8a5b['count']=_0x588a05;if(_0x8c0881[_0x51b6('0x2c')][_0x51b6('0x42')]){_0x2842b2[_0x51b6('0x43')]=[{'all':!![]}];}return db[_0x51b6('0x28')][_0x51b6('0x44')](_0x2842b2);})['then'](function(_0x498717){_0x5a8a5b[_0x51b6('0x45')]=_0x498717;return _0x5a8a5b;})[_0x51b6('0x20')](respondWithFilteredResult(_0x4a5ff8,_0x2842b2))[_0x51b6('0x46')](handleError(_0x4a5ff8,null));};exports['show']=function(_0x183dce,_0x524a16){var _0x131143={'raw':!![],'where':{'id':_0x183dce[_0x51b6('0x47')]['id']}},_0x5a1ebc={};_0x5a1ebc[_0x51b6('0x2a')]=_[_0x51b6('0x2b')](db['SquareRecording'][_0x51b6('0x29')]);_0x5a1ebc[_0x51b6('0x2c')]=_[_0x51b6('0x2b')](_0x183dce[_0x51b6('0x2c')]);_0x5a1ebc[_0x51b6('0x2f')]=_['intersection'](_0x5a1ebc[_0x51b6('0x2a')],_0x5a1ebc[_0x51b6('0x2c')]);_0x131143['attributes']=_[_0x51b6('0x30')](_0x5a1ebc[_0x51b6('0x2a')],qs['fields'](_0x183dce['query']['fields']));_0x131143['attributes']=_0x131143['attributes']['length']?_0x131143[_0x51b6('0x31')]:_0x5a1ebc['model'];if(_0x183dce[_0x51b6('0x2c')][_0x51b6('0x42')]){_0x131143[_0x51b6('0x43')]=[{'all':!![]}];}_0x131143=_[_0x51b6('0x3c')]({},_0x131143,_0x183dce[_0x51b6('0x41')]);return db[_0x51b6('0x28')]['find'](_0x131143)[_0x51b6('0x20')](handleEntityNotFound(_0x524a16,null))['then'](respondWithResult(_0x524a16,null))[_0x51b6('0x46')](handleError(_0x524a16,null));};exports[_0x51b6('0x48')]=function(_0x594bb2,_0x44f9d4){return db[_0x51b6('0x28')][_0x51b6('0x48')](_0x594bb2[_0x51b6('0x49')],{})['then'](respondWithResult(_0x44f9d4,0xc9))[_0x51b6('0x46')](handleError(_0x44f9d4,null));};exports[_0x51b6('0x1f')]=function(_0x47162e,_0x3055bc){if(_0x47162e[_0x51b6('0x49')]['id']){delete _0x47162e[_0x51b6('0x49')]['id'];}return db[_0x51b6('0x28')][_0x51b6('0x4a')]({'where':{'id':_0x47162e[_0x51b6('0x47')]['id']}})[_0x51b6('0x20')](handleEntityNotFound(_0x3055bc,null))[_0x51b6('0x20')](saveUpdates(_0x47162e['body'],null))[_0x51b6('0x20')](respondWithResult(_0x3055bc,null))[_0x51b6('0x46')](handleError(_0x3055bc,null));};exports[_0x51b6('0x21')]=function(_0x449132,_0x75e143){return db[_0x51b6('0x28')][_0x51b6('0x4a')]({'where':{'id':_0x449132[_0x51b6('0x47')]['id']}})[_0x51b6('0x20')](handleEntityNotFound(_0x75e143,null))[_0x51b6('0x20')](removeEntity(_0x75e143,null))[_0x51b6('0x46')](handleError(_0x75e143,null));};exports['download']=function(_0x29b2b6,_0x59099f,_0xa622d0){var _0x1a2d1a=require('../../components/encryptor');var _0x51f807=![];var _0x3ddcd4={};if(_0x29b2b6['query'][_0x51b6('0x3f')]&&_0x29b2b6[_0x51b6('0x2c')][_0x51b6('0x3f')]===_0x51b6('0x4b')){_0x3ddcd4['uniqueid']=_0x29b2b6[_0x51b6('0x47')]['id'];}else{_0x3ddcd4['id']=_0x29b2b6[_0x51b6('0x47')]['id'];}return db[_0x51b6('0x28')]['find']({'where':_0x3ddcd4,'attributes':['id',_0x51b6('0x4c'),_0x51b6('0x4d')],'raw':!![]})[_0x51b6('0x20')](handleEntityNotFound(_0x59099f,null))[_0x51b6('0x20')](function(_0x5d59d4){if(_0x5d59d4){var _0x5c312d=util[_0x51b6('0x4e')](_0x51b6('0x4f'),_0x5d59d4[_0x51b6('0x50')]);if(fs['existsSync'](_0x5c312d)){_0x51f807=!![];return _0x1a2d1a[_0x51b6('0x51')](_0x5c312d,_0x5d59d4[_0x51b6('0x4c')],config['secrets'][_0x51b6('0x52')])['then'](function(){return _0x5d59d4;});}return _0x5d59d4;}})[_0x51b6('0x20')](function(_0x5f2a89){if(_0x5f2a89){if(!fs[_0x51b6('0x53')](_0x5f2a89[_0x51b6('0x4c')])){throw new db[(_0x51b6('0x54'))][(_0x51b6('0x55'))](_0x51b6('0x56'));}if(_0x5f2a89['filename']){return _0x59099f[_0x51b6('0x57')](_0x5f2a89[_0x51b6('0x4c')],_0x5f2a89[_0x51b6('0x4d')]+path['extname'](_0x5f2a89['savePath']),function(){if(_0x51f807){fs[_0x51b6('0x58')](_0x5f2a89[_0x51b6('0x4c')]);}});}else{return _0x59099f[_0x51b6('0x57')](_0x5f2a89['savePath'],function(_0x4111c1){if(_0x51f807){fs['unlink'](_0x5f2a89[_0x51b6('0x4c')]);}});}}})['catch'](handleError(_0x59099f,null));};
\ No newline at end of file
index 93d7ef2..759d914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb94=['./squareRecording.attributes','exports','SquareRecording','square_recordings','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x625f2,_0x216119){var _0x19a553=function(_0x5a583a){while(--_0x5a583a){_0x625f2['push'](_0x625f2['shift']());}};_0x19a553(++_0x216119);}(_0xdb94,0xe5));var _0x4db9=function(_0x3b1f9b,_0x42ff72){_0x3b1f9b=_0x3b1f9b-0x0;var _0x25f073=_0xdb94[_0x3b1f9b];return _0x25f073;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var logger=require(_0x4db9('0x1'))('api');var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var attributes=require(_0x4db9('0x5'));module[_0x4db9('0x6')]=function(_0x592097,_0x39eccb){return _0x592097['define'](_0x4db9('0x7'),attributes,{'tableName':_0x4db9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6726=['define','SquareRecording','util','../../config/logger','moment','bluebird','./squareRecording.attributes'];(function(_0x4c5443,_0x5953f2){var _0x9544da=function(_0x1f8f7f){while(--_0x1f8f7f){_0x4c5443['push'](_0x4c5443['shift']());}};_0x9544da(++_0x5953f2);}(_0x6726,0xdb));var _0x6672=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x6726[_0x39bc44];return _0x2916d8;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var logger=require(_0x6672('0x1'))('api');var moment=require(_0x6672('0x2'));var BPromise=require(_0x6672('0x3'));var rp=require('request-promise');var attributes=require(_0x6672('0x4'));module['exports']=function(_0x32e5c6,_0x9a70f7){return _0x32e5c6[_0x6672('0x5')](_0x6672('0x6'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a1ebd7..a9eec2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa202=['body','raw','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','info','catch','CreateSquareRecording','SquareRecording','create'];(function(_0x1fd75a,_0xb05b06){var _0x28cb17=function(_0x34246e){while(--_0x34246e){_0x1fd75a['push'](_0x1fd75a['shift']());}};_0x28cb17(++_0xb05b06);}(_0xa202,0x192));var _0x2a20=function(_0x2e8ba9,_0x19b29c){_0x2e8ba9=_0x2e8ba9-0x0;var _0x5e356e=_0xa202[_0x2e8ba9];return _0x5e356e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2a20('0x0'));var BPromise=require(_0x2a20('0x1'));var rs=require(_0x2a20('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2a20('0x3'));var logger=require(_0x2a20('0x4'))(_0x2a20('0x5'));var config=require('../../config/environment');var jayson=require(_0x2a20('0x6'));var client=jayson[_0x2a20('0x7')][_0x2a20('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x592ce0,_0x47ed88,_0xdb1c4d){return new BPromise(function(_0x4c7357,_0xaf50b2){return client[_0x2a20('0x9')](_0x592ce0,_0xdb1c4d)[_0x2a20('0xa')](function(_0x58860c){logger['info']('SquareRecording,\x20%s,\x20%s',_0x47ed88,_0x2a20('0xb'));logger[_0x2a20('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x47ed88,_0x2a20('0xb'),JSON[_0x2a20('0xd')](_0x58860c));if(_0x58860c[_0x2a20('0xe')]){if(_0x58860c[_0x2a20('0xe')][_0x2a20('0xf')]===0x1f4){logger[_0x2a20('0xe')]('SquareRecording,\x20%s,\x20%s',_0x47ed88,_0x58860c[_0x2a20('0xe')][_0x2a20('0x10')]);return _0xaf50b2(_0x58860c['error'][_0x2a20('0x10')]);}logger[_0x2a20('0xe')](_0x2a20('0x11'),_0x47ed88,_0x58860c[_0x2a20('0xe')][_0x2a20('0x10')]);return _0x4c7357(_0x58860c['error'][_0x2a20('0x10')]);}else{logger[_0x2a20('0x12')](_0x2a20('0x11'),_0x47ed88,_0x2a20('0xb'));_0x4c7357(_0x58860c['result'][_0x2a20('0x10')]);}})[_0x2a20('0x13')](function(_0x3cf17b){logger[_0x2a20('0xe')](_0x2a20('0x11'),_0x47ed88,_0x3cf17b);_0xaf50b2(_0x3cf17b);});});}exports[_0x2a20('0x14')]=function(_0x477054){var _0x398db3=this;return new Promise(function(_0x2b84a8,_0x22d19b){return db[_0x2a20('0x15')][_0x2a20('0x16')](_0x477054[_0x2a20('0x17')],{'raw':_0x477054['options']?_0x477054['options'][_0x2a20('0x18')]===undefined?!![]:![]:!![]})[_0x2a20('0xa')](function(_0x2c01df){logger[_0x2a20('0x12')]('CreateSquareRecording',_0x477054);logger[_0x2a20('0xc')](_0x2a20('0x14'),_0x477054,JSON[_0x2a20('0xd')](_0x2c01df));_0x2b84a8(_0x2c01df);})[_0x2a20('0x13')](function(_0x14db8d){logger[_0x2a20('0xe')](_0x2a20('0x14'),_0x14db8d[_0x2a20('0x10')],_0x477054);_0x22d19b(_0x398db3[_0x2a20('0xe')](0x1f4,_0x14db8d['message']));});});};
\ No newline at end of file
+var _0xd97f=['jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SquareRecording','create','body','options','raw','stringify','CreateSquareRecording','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xd97f,0xb6));var _0xfd97=function(_0x18adab,_0x4cd1a6){_0x18adab=_0x18adab-0x0;var _0x3c313f=_0xd97f[_0x18adab];return _0x3c313f;};'use strict';var _=require(_0xfd97('0x0'));var util=require('util');var moment=require(_0xfd97('0x1'));var BPromise=require(_0xfd97('0x2'));var rs=require(_0xfd97('0x3'));var fs=require('fs');var Redis=require(_0xfd97('0x4'));var db=require(_0xfd97('0x5'))['db'];var utils=require(_0xfd97('0x6'));var logger=require(_0xfd97('0x7'))(_0xfd97('0x8'));var config=require(_0xfd97('0x9'));var jayson=require(_0xfd97('0xa'));var client=jayson[_0xfd97('0xb')][_0xfd97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d1a46,_0x5afc90,_0x3bb6a8){return new BPromise(function(_0x79c798,_0x1480f9){return client[_0xfd97('0xd')](_0x4d1a46,_0x3bb6a8)[_0xfd97('0xe')](function(_0x42ab30){logger[_0xfd97('0xf')](_0xfd97('0x10'),_0x5afc90,_0xfd97('0x11'));logger[_0xfd97('0x12')](_0xfd97('0x13'),_0x5afc90,_0xfd97('0x11'),JSON['stringify'](_0x42ab30));if(_0x42ab30[_0xfd97('0x14')]){if(_0x42ab30[_0xfd97('0x14')][_0xfd97('0x15')]===0x1f4){logger['error'](_0xfd97('0x10'),_0x5afc90,_0x42ab30['error'][_0xfd97('0x16')]);return _0x1480f9(_0x42ab30[_0xfd97('0x14')][_0xfd97('0x16')]);}logger[_0xfd97('0x14')](_0xfd97('0x10'),_0x5afc90,_0x42ab30[_0xfd97('0x14')]['message']);return _0x79c798(_0x42ab30[_0xfd97('0x14')][_0xfd97('0x16')]);}else{logger[_0xfd97('0xf')](_0xfd97('0x10'),_0x5afc90,_0xfd97('0x11'));_0x79c798(_0x42ab30[_0xfd97('0x17')][_0xfd97('0x16')]);}})[_0xfd97('0x18')](function(_0x56e1a5){logger[_0xfd97('0x14')](_0xfd97('0x10'),_0x5afc90,_0x56e1a5);_0x1480f9(_0x56e1a5);});});}exports['CreateSquareRecording']=function(_0x212785){var _0x33d263=this;return new Promise(function(_0x45fbc0,_0x126ea5){return db[_0xfd97('0x19')][_0xfd97('0x1a')](_0x212785[_0xfd97('0x1b')],{'raw':_0x212785[_0xfd97('0x1c')]?_0x212785[_0xfd97('0x1c')][_0xfd97('0x1d')]===undefined?!![]:![]:!![]})[_0xfd97('0xe')](function(_0x2f0301){logger[_0xfd97('0xf')]('CreateSquareRecording',_0x212785);logger[_0xfd97('0x12')]('CreateSquareRecording',_0x212785,JSON[_0xfd97('0x1e')](_0x2f0301));_0x45fbc0(_0x2f0301);})['catch'](function(_0x371cdb){logger[_0xfd97('0x14')](_0xfd97('0x1f'),_0x371cdb[_0xfd97('0x16')],_0x212785);_0x126ea5(_0x33d263[_0xfd97('0x14')](0x1f4,_0x371cdb['message']));});});};
\ No newline at end of file
index 6580bd2..14da061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b2f=['update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x293564,_0x1dd2d1){var _0x34c8aa=function(_0x50354d){while(--_0x50354d){_0x293564['push'](_0x293564['shift']());}};_0x34c8aa(++_0x1dd2d1);}(_0x8b2f,0x158));var _0xf8b2=function(_0x21d4cf,_0x4f8969){_0x21d4cf=_0x21d4cf-0x0;var _0x51e9f8=_0x8b2f[_0x21d4cf];return _0x51e9f8;};'use strict';var multer=require(_0xf8b2('0x0'));var util=require(_0xf8b2('0x1'));var path=require(_0xf8b2('0x2'));var timeout=require(_0xf8b2('0x3'));var express=require('express');var router=express[_0xf8b2('0x4')]();var auth=require(_0xf8b2('0x5'));var interaction=require(_0xf8b2('0x6'));var config=require('../../config/environment');var controller=require(_0xf8b2('0x7'));router[_0xf8b2('0x8')]('/',auth[_0xf8b2('0x9')](),controller[_0xf8b2('0xa')]);router[_0xf8b2('0x8')]('/describe',auth[_0xf8b2('0x9')](),controller[_0xf8b2('0xb')]);router[_0xf8b2('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf8b2('0xc')]);router[_0xf8b2('0xd')]('/',auth[_0xf8b2('0x9')](),controller[_0xf8b2('0xe')]);router[_0xf8b2('0xf')](_0xf8b2('0x10'),auth[_0xf8b2('0x9')](),controller[_0xf8b2('0x11')]);router['delete'](_0xf8b2('0x10'),auth[_0xf8b2('0x9')](),controller[_0xf8b2('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x1c68=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','isAuthenticated','index','/describe','get','post','create','/:id','update','delete','destroy','exports','path'];(function(_0x2ade4e,_0x577891){var _0x5d4646=function(_0x435c9c){while(--_0x435c9c){_0x2ade4e['push'](_0x2ade4e['shift']());}};_0x5d4646(++_0x577891);}(_0x1c68,0xd0));var _0x81c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c68[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x81c6('0x0'));var timeout=require(_0x81c6('0x1'));var express=require(_0x81c6('0x2'));var router=express[_0x81c6('0x3')]();var auth=require(_0x81c6('0x4'));var interaction=require(_0x81c6('0x5'));var config=require(_0x81c6('0x6'));var controller=require(_0x81c6('0x7'));router['get']('/',auth[_0x81c6('0x8')](),controller[_0x81c6('0x9')]);router['get'](_0x81c6('0xa'),auth[_0x81c6('0x8')](),controller['describe']);router[_0x81c6('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x81c6('0xc')]('/',auth['isAuthenticated'](),controller[_0x81c6('0xd')]);router['put'](_0x81c6('0xe'),auth[_0x81c6('0x8')](),controller[_0x81c6('0xf')]);router[_0x81c6('0x10')]('/:id',auth[_0x81c6('0x8')](),controller[_0x81c6('0x11')]);module[_0x81c6('0x12')]=router;
\ No newline at end of file
index 1fbd275..951d1d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ee2=['sequelize','exports','STRING','DATE'];(function(_0x56ab7e,_0x3d47af){var _0x4205b9=function(_0x362220){while(--_0x362220){_0x56ab7e['push'](_0x56ab7e['shift']());}};_0x4205b9(++_0x3d47af);}(_0x1ee2,0x11c));var _0x21ee=function(_0x4731b4,_0x3e3b3e){_0x4731b4=_0x4731b4-0x0;var _0x1c840f=_0x1ee2[_0x4731b4];return _0x1c840f;};'use strict';var Sequelize=require(_0x21ee('0x0'));module[_0x21ee('0x1')]={'network':{'type':Sequelize[_0x21ee('0x2')]},'network_script':{'type':Sequelize[_0x21ee('0x2')]},'request':{'type':Sequelize[_0x21ee('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x21ee('0x2')]},'type':{'type':Sequelize[_0x21ee('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x21ee('0x2')]},'calleridname':{'type':Sequelize[_0x21ee('0x2')]},'callingpres':{'type':Sequelize[_0x21ee('0x2')]},'callingani2':{'type':Sequelize[_0x21ee('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x21ee('0x2')]},'dnid':{'type':Sequelize[_0x21ee('0x2')]},'rdnis':{'type':Sequelize[_0x21ee('0x2')]},'context':{'type':Sequelize[_0x21ee('0x2')]},'extension':{'type':Sequelize[_0x21ee('0x2')]},'priority':{'type':Sequelize[_0x21ee('0x2')]},'enhanced':{'type':Sequelize[_0x21ee('0x2')]},'accountcode':{'type':Sequelize[_0x21ee('0x2')]},'threadid':{'type':Sequelize[_0x21ee('0x2')]},'project_name':{'type':Sequelize[_0x21ee('0x2')]},'joinAt':{'type':Sequelize[_0x21ee('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x8ebf=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x8ebf[_0x119280];return _0x481797;};'use strict';var Sequelize=require(_0xf8eb('0x0'));module[_0xf8eb('0x1')]={'network':{'type':Sequelize[_0xf8eb('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0xf8eb('0x2')]},'channel':{'type':Sequelize[_0xf8eb('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf8eb('0x2')]},'uniqueid':{'type':Sequelize[_0xf8eb('0x2')]},'version':{'type':Sequelize[_0xf8eb('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf8eb('0x2')]},'callingpres':{'type':Sequelize[_0xf8eb('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xf8eb('0x2')]},'callingtns':{'type':Sequelize[_0xf8eb('0x2')]},'dnid':{'type':Sequelize[_0xf8eb('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf8eb('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf8eb('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf8eb('0x2')]},'threadid':{'type':Sequelize[_0xf8eb('0x2')]},'project_name':{'type':Sequelize[_0xf8eb('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf8eb('0x3')]},'bot':{'type':Sequelize[_0xf8eb('0x4')],'defaultValue':![]}};
\ No newline at end of file
index f59076a..8a9291f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ec=['to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','error','stack','name','model','keys','dateStart','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','dateEnd','add','day','merge','filter','map','type','VIRTUAL','field','options','SquareReport','includeAll','findAll','rows','catch','params','rawAttributes','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x77ec,0x1ab));var _0xc77e=function(_0x1cf7bf,_0x3a2518){_0x1cf7bf=_0x1cf7bf-0x0;var _0xe65d17=_0x77ec[_0x1cf7bf];return _0xe65d17;};'use strict';var pdf=require(_0xc77e('0x0'));var emlformat=require(_0xc77e('0x1'));var rimraf=require(_0xc77e('0x2'));var zipdir=require(_0xc77e('0x3'));var jsonpatch=require(_0xc77e('0x4'));var rp=require(_0xc77e('0x5'));var moment=require(_0xc77e('0x6'));var BPromise=require(_0xc77e('0x7'));var Mustache=require(_0xc77e('0x8'));var util=require('util');var path=require(_0xc77e('0x9'));var sox=require(_0xc77e('0xa'));var csv=require(_0xc77e('0xb'));var ejs=require(_0xc77e('0xc'));var fs=require('fs');var _=require(_0xc77e('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc77e('0xe'));var deskjs=require(_0xc77e('0xf'));var toCsv=require(_0xc77e('0xb'));var querystring=require(_0xc77e('0x10'));var Papa=require(_0xc77e('0x11'));var Redis=require('ioredis');var qs=require(_0xc77e('0x12'));var logger=require(_0xc77e('0x13'))('api');var utils=require(_0xc77e('0x14'));var config=require(_0xc77e('0x15'));var db=require(_0xc77e('0x16'))['db'];function respondWithStatusCode(_0x334068,_0x386281){_0x386281=_0x386281||0xcc;return function(_0x4858ad){if(_0x4858ad){return _0x334068[_0xc77e('0x17')](_0x386281);}return _0x334068[_0xc77e('0x18')](_0x386281)[_0xc77e('0x19')]();};}function respondWithResult(_0x1be7f,_0x18dde2){_0x18dde2=_0x18dde2||0xc8;return function(_0x39ec09){if(_0x39ec09){return _0x1be7f[_0xc77e('0x18')](_0x18dde2)[_0xc77e('0x1a')](_0x39ec09);}};}function respondWithFilteredResult(_0x133bc4,_0x20688){return function(_0x443806){if(_0x443806){var _0x5f398d=_0x443806[_0xc77e('0x1b')],_0x5c5378=_0x20688[_0xc77e('0x1c')],_0x29238c=_0x20688['offset']+_0x20688[_0xc77e('0x1d')],_0x3e8795;if(_0x29238c>=_0x5f398d){_0x29238c=_0x5f398d;_0x3e8795=0xc8;}else{_0x3e8795=0xce;}_0x133bc4[_0xc77e('0x18')](_0x3e8795);return _0x133bc4['set'](_0xc77e('0x1e'),_0x5c5378+'-'+_0x29238c+'/'+_0x5f398d)[_0xc77e('0x1a')](_0x443806);}return null;};}function patchUpdates(_0x4cee74){return function(_0x358a57){try{jsonpatch['apply'](_0x358a57,_0x4cee74,!![]);}catch(_0x1cefff){return BPromise[_0xc77e('0x1f')](_0x1cefff);}return _0x358a57['save']();};}function saveUpdates(_0x367d48,_0x5584e7){return function(_0x2c542a){if(_0x2c542a){return _0x2c542a[_0xc77e('0x20')](_0x367d48)[_0xc77e('0x21')](function(_0x53d7d8){return _0x53d7d8;});}return null;};}function removeEntity(_0x5a5dfb,_0x1bde53){return function(_0x395d41){if(_0x395d41){return _0x395d41[_0xc77e('0x22')]()['then'](function(){_0x5a5dfb[_0xc77e('0x18')](0xcc)[_0xc77e('0x19')]();});}};}function handleEntityNotFound(_0x561787,_0x12bd4b){return function(_0x2fe911){if(!_0x2fe911){_0x561787[_0xc77e('0x17')](0x194);}return _0x2fe911;};}function handleError(_0x320afc,_0x4bf963){_0x4bf963=_0x4bf963||0x1f4;return function(_0x57a91b){logger[_0xc77e('0x23')](_0x57a91b[_0xc77e('0x24')]);if(_0x57a91b[_0xc77e('0x25')]){delete _0x57a91b['name'];}_0x320afc['status'](_0x4bf963)['send'](_0x57a91b);};}exports['index']=function(_0x1fe21d,_0x4bc457){var _0x558099={},_0x3a4eec={},_0x22b31={'count':0x0,'rows':[]};var _0x3d6c05=db['SquareReport']['rawAttributes'];_0x3a4eec[_0xc77e('0x26')]=_[_0xc77e('0x27')](_0x3d6c05);var _0x1a2a13={'dateStart':_0x1fe21d['query'][_0xc77e('0x28')],'dateEnd':_0x1fe21d['query']['dateEnd']};delete _0x1fe21d[_0xc77e('0x29')][_0xc77e('0x28')];delete _0x1fe21d['query']['dateEnd'];_0x3a4eec[_0xc77e('0x29')]=_[_0xc77e('0x27')](_0x1fe21d[_0xc77e('0x29')]);_0x3a4eec[_0xc77e('0x2a')]=_[_0xc77e('0x2b')](_0x3a4eec[_0xc77e('0x26')],_0x3a4eec[_0xc77e('0x29')]);_0x558099[_0xc77e('0x2c')]=_[_0xc77e('0x2b')](_0x3a4eec[_0xc77e('0x26')],qs['fields'](_0x1fe21d[_0xc77e('0x29')][_0xc77e('0x2d')]));_0x558099[_0xc77e('0x2c')]=_0x558099[_0xc77e('0x2c')]['length']?_0x558099['attributes']:_0x3a4eec['model'];if(!_0x1fe21d[_0xc77e('0x29')][_0xc77e('0x2e')](_0xc77e('0x2f'))){_0x558099[_0xc77e('0x1d')]=qs[_0xc77e('0x1d')](_0x1fe21d[_0xc77e('0x29')]['limit']);_0x558099['offset']=qs['offset'](_0x1fe21d['query'][_0xc77e('0x1c')]);}_0x558099['order']=qs[_0xc77e('0x30')](_0x1fe21d[_0xc77e('0x29')][_0xc77e('0x30')]);_0x558099[_0xc77e('0x31')]=qs[_0xc77e('0x2a')](_[_0xc77e('0x32')](_0x1fe21d[_0xc77e('0x29')],_0x3a4eec[_0xc77e('0x2a')]));if(_0x1a2a13[_0xc77e('0x28')]){if(_0x1a2a13['dateEnd']){_0x1a2a13[_0xc77e('0x33')]=moment(_0x1a2a13[_0xc77e('0x33')])[_0xc77e('0x34')](0x1,_0xc77e('0x35'));}else{_0x1a2a13['dateEnd']=moment(_0x1a2a13['dateStart'])['add'](0x1,_0xc77e('0x35'));}_[_0xc77e('0x36')](_0x558099[_0xc77e('0x31')],{'createdAt':{'$gte':_0x1a2a13[_0xc77e('0x28')],'$lte':_0x1a2a13['dateEnd']}});}if(_0x1fe21d[_0xc77e('0x29')][_0xc77e('0x37')]){_0x558099[_0xc77e('0x31')]=_[_0xc77e('0x36')](_0x558099[_0xc77e('0x31')],{'$or':_[_0xc77e('0x38')](_0x3d6c05,function(_0x2a5683){if(_0x2a5683[_0xc77e('0x39')]['key']!==_0xc77e('0x3a')){var _0x2dffea={};_0x2dffea[_0x2a5683[_0xc77e('0x3b')]]={'$like':'%'+_0x1fe21d[_0xc77e('0x29')]['filter']+'%'};return _0x2dffea;}})});}_0x558099=_['merge']({},_0x558099,_0x1fe21d[_0xc77e('0x3c')]);var _0x4cb683={'where':_0x558099[_0xc77e('0x31')]};return db[_0xc77e('0x3d')]['count'](_0x4cb683)[_0xc77e('0x21')](function(_0x195998){_0x22b31[_0xc77e('0x1b')]=_0x195998;if(_0x1fe21d[_0xc77e('0x29')][_0xc77e('0x3e')]){_0x558099['include']=[{'all':!![]}];}return db[_0xc77e('0x3d')][_0xc77e('0x3f')](_0x558099);})[_0xc77e('0x21')](function(_0x47ed85){_0x22b31[_0xc77e('0x40')]=_0x47ed85;return _0x22b31;})['then'](respondWithFilteredResult(_0x4bc457,_0x558099))[_0xc77e('0x41')](handleError(_0x4bc457,null));};exports['show']=function(_0x524337,_0x2b9f89){var _0x3efb25={'raw':!![],'where':{'id':_0x524337[_0xc77e('0x42')]['id']}},_0x2dc716={};_0x2dc716[_0xc77e('0x26')]=_[_0xc77e('0x27')](db[_0xc77e('0x3d')][_0xc77e('0x43')]);_0x2dc716[_0xc77e('0x29')]=_[_0xc77e('0x27')](_0x524337[_0xc77e('0x29')]);_0x2dc716[_0xc77e('0x2a')]=_[_0xc77e('0x2b')](_0x2dc716['model'],_0x2dc716[_0xc77e('0x29')]);_0x3efb25[_0xc77e('0x2c')]=_['intersection'](_0x2dc716[_0xc77e('0x26')],qs[_0xc77e('0x2d')](_0x524337[_0xc77e('0x29')][_0xc77e('0x2d')]));_0x3efb25[_0xc77e('0x2c')]=_0x3efb25['attributes'][_0xc77e('0x44')]?_0x3efb25[_0xc77e('0x2c')]:_0x2dc716['model'];if(_0x524337[_0xc77e('0x29')][_0xc77e('0x3e')]){_0x3efb25['include']=[{'all':!![]}];}_0x3efb25=_[_0xc77e('0x36')]({},_0x3efb25,_0x524337[_0xc77e('0x3c')]);return db[_0xc77e('0x3d')][_0xc77e('0x45')](_0x3efb25)[_0xc77e('0x21')](handleEntityNotFound(_0x2b9f89,null))[_0xc77e('0x21')](respondWithResult(_0x2b9f89,null))[_0xc77e('0x41')](handleError(_0x2b9f89,null));};exports[_0xc77e('0x46')]=function(_0x44a3ff,_0x93ec5e){return db[_0xc77e('0x3d')]['create'](_0x44a3ff[_0xc77e('0x47')],{})[_0xc77e('0x21')](respondWithResult(_0x93ec5e,0xc9))[_0xc77e('0x41')](handleError(_0x93ec5e,null));};exports[_0xc77e('0x20')]=function(_0x34fce8,_0x1a252b){if(_0x34fce8['body']['id']){delete _0x34fce8[_0xc77e('0x47')]['id'];}return db[_0xc77e('0x3d')][_0xc77e('0x45')]({'where':{'id':_0x34fce8[_0xc77e('0x42')]['id']}})[_0xc77e('0x21')](handleEntityNotFound(_0x1a252b,null))[_0xc77e('0x21')](saveUpdates(_0x34fce8[_0xc77e('0x47')],null))['then'](respondWithResult(_0x1a252b,null))[_0xc77e('0x41')](handleError(_0x1a252b,null));};exports[_0xc77e('0x22')]=function(_0x50e9f7,_0x1aa5d4){return db[_0xc77e('0x3d')][_0xc77e('0x45')]({'where':{'id':_0x50e9f7[_0xc77e('0x42')]['id']}})['then'](handleEntityNotFound(_0x1aa5d4,null))[_0xc77e('0x21')](removeEntity(_0x1aa5d4,null))[_0xc77e('0x41')](handleError(_0x1aa5d4,null));};exports[_0xc77e('0x48')]=function(_0x36e531,_0x37e235){return db[_0xc77e('0x3d')][_0xc77e('0x48')]()[_0xc77e('0x21')](respondWithResult(_0x37e235,null))[_0xc77e('0x41')](handleError(_0x37e235,null));};
\ No newline at end of file
+var _0x25e9=['nolimit','order','sort','where','pick','dateEnd','day','merge','filter','type','VIRTUAL','field','count','includeAll','findAll','catch','params','rawAttributes','find','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','set','reject','save','then','destroy','send','index','SquareReport','model','keys','query','dateStart','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25e9,0x1a3));var _0x925e=function(_0x12a06b,_0x417b51){_0x12a06b=_0x12a06b-0x0;var _0x5d0bb8=_0x25e9[_0x12a06b];return _0x5d0bb8;};'use strict';var pdf=require(_0x925e('0x0'));var emlformat=require(_0x925e('0x1'));var rimraf=require(_0x925e('0x2'));var zipdir=require(_0x925e('0x3'));var jsonpatch=require(_0x925e('0x4'));var rp=require(_0x925e('0x5'));var moment=require(_0x925e('0x6'));var BPromise=require(_0x925e('0x7'));var Mustache=require(_0x925e('0x8'));var util=require('util');var path=require('path');var sox=require(_0x925e('0x9'));var csv=require(_0x925e('0xa'));var ejs=require(_0x925e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x925e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x925e('0xd'));var Papa=require(_0x925e('0xe'));var Redis=require(_0x925e('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x925e('0x10'))(_0x925e('0x11'));var utils=require('../../config/utils');var config=require(_0x925e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24274a,_0x547388){_0x547388=_0x547388||0xcc;return function(_0x4137bc){if(_0x4137bc){return _0x24274a[_0x925e('0x13')](_0x547388);}return _0x24274a[_0x925e('0x14')](_0x547388)[_0x925e('0x15')]();};}function respondWithResult(_0x4f7226,_0x41065d){_0x41065d=_0x41065d||0xc8;return function(_0x2875d5){if(_0x2875d5){return _0x4f7226[_0x925e('0x14')](_0x41065d)[_0x925e('0x16')](_0x2875d5);}};}function respondWithFilteredResult(_0x789486,_0x5151be){return function(_0x3ec012){if(_0x3ec012){var _0x4de27b=_0x3ec012['count'],_0x550436=_0x5151be[_0x925e('0x17')],_0x2db3a2=_0x5151be[_0x925e('0x17')]+_0x5151be[_0x925e('0x18')],_0xf980dd;if(_0x2db3a2>=_0x4de27b){_0x2db3a2=_0x4de27b;_0xf980dd=0xc8;}else{_0xf980dd=0xce;}_0x789486['status'](_0xf980dd);return _0x789486[_0x925e('0x19')]('Content-Range',_0x550436+'-'+_0x2db3a2+'/'+_0x4de27b)[_0x925e('0x16')](_0x3ec012);}return null;};}function patchUpdates(_0x1f96e5){return function(_0x273b85){try{jsonpatch['apply'](_0x273b85,_0x1f96e5,!![]);}catch(_0x29c76a){return BPromise[_0x925e('0x1a')](_0x29c76a);}return _0x273b85[_0x925e('0x1b')]();};}function saveUpdates(_0x704a1f,_0x4ec5a0){return function(_0x17d032){if(_0x17d032){return _0x17d032['update'](_0x704a1f)[_0x925e('0x1c')](function(_0x1245c2){return _0x1245c2;});}return null;};}function removeEntity(_0x5d342a,_0x2baaa8){return function(_0xe86ea5){if(_0xe86ea5){return _0xe86ea5[_0x925e('0x1d')]()[_0x925e('0x1c')](function(){_0x5d342a[_0x925e('0x14')](0xcc)[_0x925e('0x15')]();});}};}function handleEntityNotFound(_0x162ece,_0x28bb9b){return function(_0x466eea){if(!_0x466eea){_0x162ece[_0x925e('0x13')](0x194);}return _0x466eea;};}function handleError(_0x412e58,_0x4f3618){_0x4f3618=_0x4f3618||0x1f4;return function(_0x15128b){logger['error'](_0x15128b['stack']);if(_0x15128b['name']){delete _0x15128b['name'];}_0x412e58[_0x925e('0x14')](_0x4f3618)[_0x925e('0x1e')](_0x15128b);};}exports[_0x925e('0x1f')]=function(_0x1010d4,_0x36b143){var _0x195baa={},_0x4ef689={},_0x571873={'count':0x0,'rows':[]};var _0x5030be=db[_0x925e('0x20')]['rawAttributes'];_0x4ef689[_0x925e('0x21')]=_[_0x925e('0x22')](_0x5030be);var _0x4b6313={'dateStart':_0x1010d4[_0x925e('0x23')][_0x925e('0x24')],'dateEnd':_0x1010d4[_0x925e('0x23')]['dateEnd']};delete _0x1010d4['query'][_0x925e('0x24')];delete _0x1010d4[_0x925e('0x23')]['dateEnd'];_0x4ef689[_0x925e('0x23')]=_[_0x925e('0x22')](_0x1010d4['query']);_0x4ef689[_0x925e('0x25')]=_[_0x925e('0x26')](_0x4ef689[_0x925e('0x21')],_0x4ef689[_0x925e('0x23')]);_0x195baa[_0x925e('0x27')]=_[_0x925e('0x26')](_0x4ef689['model'],qs[_0x925e('0x28')](_0x1010d4['query'][_0x925e('0x28')]));_0x195baa[_0x925e('0x27')]=_0x195baa['attributes'][_0x925e('0x29')]?_0x195baa[_0x925e('0x27')]:_0x4ef689['model'];if(!_0x1010d4[_0x925e('0x23')][_0x925e('0x2a')](_0x925e('0x2b'))){_0x195baa['limit']=qs['limit'](_0x1010d4[_0x925e('0x23')][_0x925e('0x18')]);_0x195baa['offset']=qs[_0x925e('0x17')](_0x1010d4['query'][_0x925e('0x17')]);}_0x195baa[_0x925e('0x2c')]=qs[_0x925e('0x2d')](_0x1010d4[_0x925e('0x23')][_0x925e('0x2d')]);_0x195baa[_0x925e('0x2e')]=qs['filters'](_[_0x925e('0x2f')](_0x1010d4[_0x925e('0x23')],_0x4ef689[_0x925e('0x25')]));if(_0x4b6313[_0x925e('0x24')]){if(_0x4b6313['dateEnd']){_0x4b6313[_0x925e('0x30')]=moment(_0x4b6313[_0x925e('0x30')])['add'](0x1,_0x925e('0x31'));}else{_0x4b6313[_0x925e('0x30')]=moment(_0x4b6313[_0x925e('0x24')])['add'](0x1,_0x925e('0x31'));}_[_0x925e('0x32')](_0x195baa[_0x925e('0x2e')],{'createdAt':{'$gte':_0x4b6313[_0x925e('0x24')],'$lte':_0x4b6313[_0x925e('0x30')]}});}if(_0x1010d4[_0x925e('0x23')][_0x925e('0x33')]){_0x195baa[_0x925e('0x2e')]=_['merge'](_0x195baa[_0x925e('0x2e')],{'$or':_['map'](_0x5030be,function(_0x1dcae8){if(_0x1dcae8[_0x925e('0x34')]['key']!==_0x925e('0x35')){var _0x508e7a={};_0x508e7a[_0x1dcae8[_0x925e('0x36')]]={'$like':'%'+_0x1010d4[_0x925e('0x23')][_0x925e('0x33')]+'%'};return _0x508e7a;}})});}_0x195baa=_[_0x925e('0x32')]({},_0x195baa,_0x1010d4['options']);var _0x5a5a52={'where':_0x195baa[_0x925e('0x2e')]};return db[_0x925e('0x20')][_0x925e('0x37')](_0x5a5a52)[_0x925e('0x1c')](function(_0x79a218){_0x571873[_0x925e('0x37')]=_0x79a218;if(_0x1010d4['query'][_0x925e('0x38')]){_0x195baa['include']=[{'all':!![]}];}return db[_0x925e('0x20')][_0x925e('0x39')](_0x195baa);})[_0x925e('0x1c')](function(_0x1eb8d1){_0x571873['rows']=_0x1eb8d1;return _0x571873;})[_0x925e('0x1c')](respondWithFilteredResult(_0x36b143,_0x195baa))[_0x925e('0x3a')](handleError(_0x36b143,null));};exports['show']=function(_0x21a6bb,_0x1de5e7){var _0x22d9f7={'raw':!![],'where':{'id':_0x21a6bb[_0x925e('0x3b')]['id']}},_0x5c04b6={};_0x5c04b6[_0x925e('0x21')]=_[_0x925e('0x22')](db[_0x925e('0x20')][_0x925e('0x3c')]);_0x5c04b6[_0x925e('0x23')]=_['keys'](_0x21a6bb[_0x925e('0x23')]);_0x5c04b6[_0x925e('0x25')]=_[_0x925e('0x26')](_0x5c04b6[_0x925e('0x21')],_0x5c04b6['query']);_0x22d9f7[_0x925e('0x27')]=_[_0x925e('0x26')](_0x5c04b6[_0x925e('0x21')],qs[_0x925e('0x28')](_0x21a6bb[_0x925e('0x23')][_0x925e('0x28')]));_0x22d9f7['attributes']=_0x22d9f7[_0x925e('0x27')][_0x925e('0x29')]?_0x22d9f7[_0x925e('0x27')]:_0x5c04b6['model'];if(_0x21a6bb['query'][_0x925e('0x38')]){_0x22d9f7['include']=[{'all':!![]}];}_0x22d9f7=_[_0x925e('0x32')]({},_0x22d9f7,_0x21a6bb['options']);return db[_0x925e('0x20')][_0x925e('0x3d')](_0x22d9f7)[_0x925e('0x1c')](handleEntityNotFound(_0x1de5e7,null))['then'](respondWithResult(_0x1de5e7,null))[_0x925e('0x3a')](handleError(_0x1de5e7,null));};exports[_0x925e('0x3e')]=function(_0x38f478,_0x55564c){return db[_0x925e('0x20')][_0x925e('0x3e')](_0x38f478['body'],{})[_0x925e('0x1c')](respondWithResult(_0x55564c,0xc9))[_0x925e('0x3a')](handleError(_0x55564c,null));};exports[_0x925e('0x3f')]=function(_0x5f3742,_0x4f3385){if(_0x5f3742['body']['id']){delete _0x5f3742[_0x925e('0x40')]['id'];}return db[_0x925e('0x20')][_0x925e('0x3d')]({'where':{'id':_0x5f3742['params']['id']}})[_0x925e('0x1c')](handleEntityNotFound(_0x4f3385,null))[_0x925e('0x1c')](saveUpdates(_0x5f3742[_0x925e('0x40')],null))[_0x925e('0x1c')](respondWithResult(_0x4f3385,null))['catch'](handleError(_0x4f3385,null));};exports[_0x925e('0x1d')]=function(_0x547cfc,_0x3731c4){return db[_0x925e('0x20')]['find']({'where':{'id':_0x547cfc[_0x925e('0x3b')]['id']}})[_0x925e('0x1c')](handleEntityNotFound(_0x3731c4,null))['then'](removeEntity(_0x3731c4,null))[_0x925e('0x3a')](handleError(_0x3731c4,null));};exports[_0x925e('0x41')]=function(_0x36416b,_0x3c088c){return db['SquareReport'][_0x925e('0x41')]()[_0x925e('0x1c')](respondWithResult(_0x3c088c,null))[_0x925e('0x3a')](handleError(_0x3c088c,null));};
\ No newline at end of file
index a699a4a..3dbaf06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb56f=['request-promise','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','../../config/logger','moment','bluebird'];(function(_0x5661f3,_0x234246){var _0x5c98ca=function(_0x10e331){while(--_0x10e331){_0x5661f3['push'](_0x5661f3['shift']());}};_0x5c98ca(++_0x234246);}(_0xb56f,0x8b));var _0xfb56=function(_0x1847fd,_0x1840c5){_0x1847fd=_0x1847fd-0x0;var _0x58fc46=_0xb56f[_0x1847fd];return _0x58fc46;};'use strict';var _=require(_0xfb56('0x0'));var util=require('util');var logger=require(_0xfb56('0x1'))('api');var moment=require(_0xfb56('0x2'));var BPromise=require(_0xfb56('0x3'));var rp=require(_0xfb56('0x4'));var attributes=require(_0xfb56('0x5'));module[_0xfb56('0x6')]=function(_0x2b3703,_0x3d491d){return _0x2b3703['define'](_0xfb56('0x7'),attributes,{'tableName':_0xfb56('0x8'),'paranoid':![],'indexes':[{'name':_0xfb56('0x9'),'fields':[_0xfb56('0xa'),_0xfb56('0xb')]},{'name':_0xfb56('0xc'),'fields':[_0xfb56('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1604=['request-promise','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','../../config/logger','api','bluebird'];(function(_0x4120ae,_0x1c5bc2){var _0x76338e=function(_0x37456f){while(--_0x37456f){_0x4120ae['push'](_0x4120ae['shift']());}};_0x76338e(++_0x1c5bc2);}(_0x1604,0x1b9));var _0x4160=function(_0x524a17,_0x1dae29){_0x524a17=_0x524a17-0x0;var _0x1851bb=_0x1604[_0x524a17];return _0x1851bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4160('0x0'))(_0x4160('0x1'));var moment=require('moment');var BPromise=require(_0x4160('0x2'));var rp=require(_0x4160('0x3'));var attributes=require(_0x4160('0x4'));module[_0x4160('0x5')]=function(_0x2845b9,_0x4bde42){return _0x2845b9[_0x4160('0x6')](_0x4160('0x7'),attributes,{'tableName':_0x4160('0x8'),'paranoid':![],'indexes':[{'name':_0x4160('0x9'),'fields':['uniqueid',_0x4160('0xa')]},{'name':_0x4160('0xb'),'fields':[_0x4160('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 41fc332..cf07241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2318=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','where','attributes','lodash','moment','bluebird','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2318,0x1a0));var _0x8231=function(_0x21704e,_0x1e2061){_0x21704e=_0x21704e-0x0;var _0x4ee8b7=_0x2318[_0x21704e];return _0x4ee8b7;};'use strict';var _=require(_0x8231('0x0'));var util=require('util');var moment=require(_0x8231('0x1'));var BPromise=require(_0x8231('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8231('0x3'))['db'];var utils=require(_0x8231('0x4'));var logger=require(_0x8231('0x5'))(_0x8231('0x6'));var config=require(_0x8231('0x7'));var jayson=require(_0x8231('0x8'));var client=jayson['client'][_0x8231('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x281f33,_0x1c587b,_0x45b91a){return new BPromise(function(_0x4ebcc6,_0x5262c1){return client[_0x8231('0xa')](_0x281f33,_0x45b91a)[_0x8231('0xb')](function(_0x307002){logger[_0x8231('0xc')](_0x8231('0xd'),_0x1c587b,_0x8231('0xe'));logger[_0x8231('0xf')](_0x8231('0x10'),_0x1c587b,_0x8231('0xe'),JSON[_0x8231('0x11')](_0x307002));if(_0x307002[_0x8231('0x12')]){if(_0x307002['error'][_0x8231('0x13')]===0x1f4){logger[_0x8231('0x12')](_0x8231('0xd'),_0x1c587b,_0x307002[_0x8231('0x12')][_0x8231('0x14')]);return _0x5262c1(_0x307002[_0x8231('0x12')][_0x8231('0x14')]);}logger[_0x8231('0x12')]('SquareReport,\x20%s,\x20%s',_0x1c587b,_0x307002[_0x8231('0x12')][_0x8231('0x14')]);return _0x4ebcc6(_0x307002[_0x8231('0x12')][_0x8231('0x14')]);}else{logger[_0x8231('0xc')](_0x8231('0xd'),_0x1c587b,'request\x20sent');_0x4ebcc6(_0x307002['result'][_0x8231('0x14')]);}})[_0x8231('0x15')](function(_0x964334){logger[_0x8231('0x12')](_0x8231('0xd'),_0x1c587b,_0x964334);_0x5262c1(_0x964334);});});}exports[_0x8231('0x16')]=function(_0x2034fe){var _0xacd0f2=this;return new Promise(function(_0x5406ff,_0x30838b){return db[_0x8231('0x17')]['create'](_0x2034fe[_0x8231('0x18')],{'raw':_0x2034fe[_0x8231('0x19')]?_0x2034fe['options'][_0x8231('0x1a')]===undefined?!![]:![]:!![]})[_0x8231('0xb')](function(_0x1a75ee){logger[_0x8231('0xc')]('CreateSquareReport',_0x2034fe);logger[_0x8231('0xf')]('CreateSquareReport',_0x2034fe,JSON[_0x8231('0x11')](_0x1a75ee));_0x5406ff(_0x1a75ee);})['catch'](function(_0x3f8004){logger[_0x8231('0x12')](_0x8231('0x16'),_0x3f8004[_0x8231('0x14')],_0x2034fe);_0x30838b(_0xacd0f2[_0x8231('0x12')](0x1f4,_0x3f8004['message']));});});};exports[_0x8231('0x1b')]=function(_0xc4788e){var _0x129df5=this;return new Promise(function(_0x275179,_0x50ae42){return db[_0x8231('0x17')]['update'](_0xc4788e[_0x8231('0x18')],{'raw':_0xc4788e[_0x8231('0x19')]?_0xc4788e['options'][_0x8231('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc4788e[_0x8231('0x19')]?_0xc4788e['options'][_0x8231('0x1c')]||null:null,'attributes':_0xc4788e[_0x8231('0x19')]?_0xc4788e[_0x8231('0x19')][_0x8231('0x1d')]||null:null,'limit':_0xc4788e['options']?_0xc4788e[_0x8231('0x19')]['limit']||null:null})[_0x8231('0xb')](function(_0x395e30){logger['info'](_0x8231('0x1b'),_0xc4788e);logger[_0x8231('0xf')](_0x8231('0x1b'),_0xc4788e,JSON[_0x8231('0x11')](_0x395e30));_0x275179(_0x395e30);})[_0x8231('0x15')](function(_0x246162){logger[_0x8231('0x12')](_0x8231('0x1b'),_0x246162[_0x8231('0x14')],_0xc4788e);_0x50ae42(_0x129df5[_0x8231('0x12')](0x1f4,_0x246162[_0x8231('0x14')]));});});};
\ No newline at end of file
+var _0xdace=['stringify','error','code','message','catch','SquareReport','body','options','raw','CreateSquareReport','UpdateSquareReport','attributes','limit','debug','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s'];(function(_0x98459f,_0x4dfb55){var _0x128f94=function(_0xe6315c){while(--_0xe6315c){_0x98459f['push'](_0x98459f['shift']());}};_0x128f94(++_0x4dfb55);}(_0xdace,0x9f));var _0xedac=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xdace[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0xedac('0x0'));var moment=require(_0xedac('0x1'));var BPromise=require('bluebird');var rs=require(_0xedac('0x2'));var fs=require('fs');var Redis=require(_0xedac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xedac('0x4'));var logger=require('../../config/logger')(_0xedac('0x5'));var config=require(_0xedac('0x6'));var jayson=require(_0xedac('0x7'));var client=jayson[_0xedac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22662d,_0x511949,_0xe3371f){return new BPromise(function(_0x29dcc2,_0x1fceca){return client[_0xedac('0x9')](_0x22662d,_0xe3371f)[_0xedac('0xa')](function(_0x2a8524){logger[_0xedac('0xb')](_0xedac('0xc'),_0x511949,_0xedac('0xd'));logger['debug'](_0xedac('0xe'),_0x511949,_0xedac('0xd'),JSON[_0xedac('0xf')](_0x2a8524));if(_0x2a8524[_0xedac('0x10')]){if(_0x2a8524[_0xedac('0x10')][_0xedac('0x11')]===0x1f4){logger[_0xedac('0x10')](_0xedac('0xc'),_0x511949,_0x2a8524[_0xedac('0x10')]['message']);return _0x1fceca(_0x2a8524[_0xedac('0x10')]['message']);}logger['error'](_0xedac('0xc'),_0x511949,_0x2a8524[_0xedac('0x10')]['message']);return _0x29dcc2(_0x2a8524[_0xedac('0x10')][_0xedac('0x12')]);}else{logger[_0xedac('0xb')](_0xedac('0xc'),_0x511949,_0xedac('0xd'));_0x29dcc2(_0x2a8524['result'][_0xedac('0x12')]);}})[_0xedac('0x13')](function(_0x4e579b){logger[_0xedac('0x10')]('SquareReport,\x20%s,\x20%s',_0x511949,_0x4e579b);_0x1fceca(_0x4e579b);});});}exports['CreateSquareReport']=function(_0xfb6631){var _0x23dea8=this;return new Promise(function(_0x2f02f2,_0x1fd0e3){return db[_0xedac('0x14')]['create'](_0xfb6631[_0xedac('0x15')],{'raw':_0xfb6631[_0xedac('0x16')]?_0xfb6631[_0xedac('0x16')][_0xedac('0x17')]===undefined?!![]:![]:!![]})[_0xedac('0xa')](function(_0x3bc9a3){logger[_0xedac('0xb')](_0xedac('0x18'),_0xfb6631);logger['debug']('CreateSquareReport',_0xfb6631,JSON[_0xedac('0xf')](_0x3bc9a3));_0x2f02f2(_0x3bc9a3);})[_0xedac('0x13')](function(_0xdccccc){logger['error'](_0xedac('0x18'),_0xdccccc['message'],_0xfb6631);_0x1fd0e3(_0x23dea8[_0xedac('0x10')](0x1f4,_0xdccccc['message']));});});};exports[_0xedac('0x19')]=function(_0x8359de){var _0x1871ff=this;return new Promise(function(_0x29a0f5,_0x238182){return db[_0xedac('0x14')]['update'](_0x8359de[_0xedac('0x15')],{'raw':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8359de[_0xedac('0x16')]?_0x8359de['options']['where']||null:null,'attributes':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x1a')]||null:null,'limit':_0x8359de[_0xedac('0x16')]?_0x8359de[_0xedac('0x16')][_0xedac('0x1b')]||null:null})[_0xedac('0xa')](function(_0x2a8f44){logger[_0xedac('0xb')](_0xedac('0x19'),_0x8359de);logger[_0xedac('0x1c')](_0xedac('0x19'),_0x8359de,JSON[_0xedac('0xf')](_0x2a8f44));_0x29a0f5(_0x2a8f44);})[_0xedac('0x13')](function(_0x4aa9c3){logger[_0xedac('0x10')]('UpdateSquareReport',_0x4aa9c3[_0xedac('0x12')],_0x8359de);_0x238182(_0x1871ff[_0xedac('0x10')](0x1f4,_0x4aa9c3['message']));});});};
\ No newline at end of file
index d419b4b..2a6dfa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1089=['/describe','describe','show','create','put','/:id','update','delete','exports','util','path','connect-timeout','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index'];(function(_0x1a471c,_0x4399bd){var _0x46c6ae=function(_0xeef15e){while(--_0xeef15e){_0x1a471c['push'](_0x1a471c['shift']());}};_0x46c6ae(++_0x4399bd);}(_0x1089,0x190));var _0x9108=function(_0x74e651,_0x7db2c0){_0x74e651=_0x74e651-0x0;var _0x32ed9d=_0x1089[_0x74e651];return _0x32ed9d;};'use strict';var multer=require('multer');var util=require(_0x9108('0x0'));var path=require(_0x9108('0x1'));var timeout=require(_0x9108('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9108('0x3'));var config=require('../../config/environment');var controller=require(_0x9108('0x4'));router[_0x9108('0x5')]('/',auth[_0x9108('0x6')](),controller[_0x9108('0x7')]);router[_0x9108('0x5')](_0x9108('0x8'),auth[_0x9108('0x6')](),controller[_0x9108('0x9')]);router['get']('/:id',auth[_0x9108('0x6')](),controller[_0x9108('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9108('0xb')]);router[_0x9108('0xc')](_0x9108('0xd'),auth['isAuthenticated'](),controller[_0x9108('0xe')]);router[_0x9108('0xf')](_0x9108('0xd'),auth[_0x9108('0x6')](),controller['destroy']);module[_0x9108('0x10')]=router;
\ No newline at end of file
+var _0x0813=['get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller'];(function(_0x2da4f8,_0x4b8a7b){var _0xe06375=function(_0x2bb9af){while(--_0x2bb9af){_0x2da4f8['push'](_0x2da4f8['shift']());}};_0xe06375(++_0x4b8a7b);}(_0x0813,0x1d5));var _0x3081=function(_0x176273,_0x39a396){_0x176273=_0x176273-0x0;var _0x266c1e=_0x0813[_0x176273];return _0x266c1e;};'use strict';var multer=require('multer');var util=require(_0x3081('0x0'));var path=require(_0x3081('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3081('0x2')]();var auth=require(_0x3081('0x3'));var interaction=require(_0x3081('0x4'));var config=require('../../config/environment');var controller=require(_0x3081('0x5'));router[_0x3081('0x6')]('/',auth['isAuthenticated'](),controller[_0x3081('0x7')]);router[_0x3081('0x6')](_0x3081('0x8'),auth[_0x3081('0x9')](),controller[_0x3081('0xa')]);router[_0x3081('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x3081('0xb')]);router[_0x3081('0xc')]('/',auth['isAuthenticated'](),controller[_0x3081('0xd')]);router[_0x3081('0xe')](_0x3081('0xf'),auth[_0x3081('0x9')](),controller[_0x3081('0x10')]);router[_0x3081('0x11')](_0x3081('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x3081('0x12')]=router;
\ No newline at end of file
index 03a96e3..04f9c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb73=['STRING','TEXT','sequelize','exports'];(function(_0x1224d2,_0x271db9){var _0x1bb4f0=function(_0x54c1c3){while(--_0x54c1c3){_0x1224d2['push'](_0x1224d2['shift']());}};_0x1bb4f0(++_0x271db9);}(_0xbb73,0x156));var _0x3bb7=function(_0x18c3d8,_0x1a4d2b){_0x18c3d8=_0x18c3d8-0x0;var _0x432944=_0xbb73[_0x18c3d8];return _0x432944;};'use strict';var Sequelize=require(_0x3bb7('0x0'));module[_0x3bb7('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x3bb7('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x3bb7('0x3')]},'project_name':{'type':Sequelize[_0x3bb7('0x2')]},'callerid':{'type':Sequelize[_0x3bb7('0x2')]}};
\ No newline at end of file
+var _0x0aa5=['TEXT','exports','STRING'];(function(_0x4fc7b3,_0x510416){var _0x106e4b=function(_0x20a8e0){while(--_0x20a8e0){_0x4fc7b3['push'](_0x4fc7b3['shift']());}};_0x106e4b(++_0x510416);}(_0x0aa5,0x17e));var _0x50aa=function(_0x1d7786,_0x376983){_0x1d7786=_0x1d7786-0x0;var _0x104f15=_0x0aa5[_0x1d7786];return _0x104f15;};'use strict';var Sequelize=require('sequelize');module[_0x50aa('0x0')]={'uniqueid':{'type':Sequelize[_0x50aa('0x1')]},'node':{'type':Sequelize[_0x50aa('0x1')]},'application':{'type':Sequelize[_0x50aa('0x1')]},'data':{'type':Sequelize[_0x50aa('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x50aa('0x1')]}};
\ No newline at end of file
index a529d21..5e239a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde50=['dateEnd','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','rawAttributes','filters','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','SquareDetailsReport','keys','query','dateStart'];(function(_0x6f9546,_0x1186b1){var _0x5f2738=function(_0x2e5bbf){while(--_0x2e5bbf){_0x6f9546['push'](_0x6f9546['shift']());}};_0x5f2738(++_0x1186b1);}(_0xde50,0x6a));var _0x0de5=function(_0x1835cd,_0x170652){_0x1835cd=_0x1835cd-0x0;var _0x11584a=_0xde50[_0x1835cd];return _0x11584a;};'use strict';var pdf=require(_0x0de5('0x0'));var emlformat=require(_0x0de5('0x1'));var rimraf=require(_0x0de5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0de5('0x3'));var rp=require(_0x0de5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0de5('0x5'));var util=require(_0x0de5('0x6'));var path=require(_0x0de5('0x7'));var sox=require(_0x0de5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0de5('0x9'));var crypto=require('crypto');var jsforce=require(_0x0de5('0xa'));var deskjs=require(_0x0de5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0de5('0xc'));var Papa=require(_0x0de5('0xd'));var Redis=require(_0x0de5('0xe'));var qs=require(_0x0de5('0xf'));var logger=require(_0x0de5('0x10'))('api');var utils=require(_0x0de5('0x11'));var config=require(_0x0de5('0x12'));var db=require(_0x0de5('0x13'))['db'];function respondWithStatusCode(_0x384c16,_0x342683){_0x342683=_0x342683||0xcc;return function(_0x42ea07){if(_0x42ea07){return _0x384c16[_0x0de5('0x14')](_0x342683);}return _0x384c16[_0x0de5('0x15')](_0x342683)['end']();};}function respondWithResult(_0x416587,_0x4f6293){_0x4f6293=_0x4f6293||0xc8;return function(_0x2ef5f0){if(_0x2ef5f0){return _0x416587[_0x0de5('0x15')](_0x4f6293)[_0x0de5('0x16')](_0x2ef5f0);}};}function respondWithFilteredResult(_0x3e2cb2,_0x181c9e){return function(_0x476e9c){if(_0x476e9c){var _0x529b07=_0x476e9c[_0x0de5('0x17')],_0xb0c69d=_0x181c9e[_0x0de5('0x18')],_0x36032c=_0x181c9e[_0x0de5('0x18')]+_0x181c9e[_0x0de5('0x19')],_0x5449fa;if(_0x36032c>=_0x529b07){_0x36032c=_0x529b07;_0x5449fa=0xc8;}else{_0x5449fa=0xce;}_0x3e2cb2['status'](_0x5449fa);return _0x3e2cb2[_0x0de5('0x1a')](_0x0de5('0x1b'),_0xb0c69d+'-'+_0x36032c+'/'+_0x529b07)[_0x0de5('0x16')](_0x476e9c);}return null;};}function patchUpdates(_0x16122a){return function(_0x1fc4f1){try{jsonpatch[_0x0de5('0x1c')](_0x1fc4f1,_0x16122a,!![]);}catch(_0x55cced){return BPromise[_0x0de5('0x1d')](_0x55cced);}return _0x1fc4f1[_0x0de5('0x1e')]();};}function saveUpdates(_0x63915c,_0x482a7f){return function(_0x383959){if(_0x383959){return _0x383959[_0x0de5('0x1f')](_0x63915c)['then'](function(_0x467c92){return _0x467c92;});}return null;};}function removeEntity(_0x4d61a0,_0x1e6c83){return function(_0x2365e7){if(_0x2365e7){return _0x2365e7[_0x0de5('0x20')]()[_0x0de5('0x21')](function(){_0x4d61a0[_0x0de5('0x15')](0xcc)[_0x0de5('0x22')]();});}};}function handleEntityNotFound(_0x1de34b,_0x4d30d6){return function(_0x434c59){if(!_0x434c59){_0x1de34b[_0x0de5('0x14')](0x194);}return _0x434c59;};}function handleError(_0x5a6af8,_0x2f6be8){_0x2f6be8=_0x2f6be8||0x1f4;return function(_0xbe0ee1){logger[_0x0de5('0x23')](_0xbe0ee1[_0x0de5('0x24')]);if(_0xbe0ee1[_0x0de5('0x25')]){delete _0xbe0ee1[_0x0de5('0x25')];}_0x5a6af8[_0x0de5('0x15')](_0x2f6be8)[_0x0de5('0x26')](_0xbe0ee1);};}exports[_0x0de5('0x27')]=function(_0x3cd53e,_0x2ffec0){var _0x172e98={},_0x3eeb47={},_0x2b5ea2={'count':0x0,'rows':[]};var _0x124353=db[_0x0de5('0x28')]['rawAttributes'];_0x3eeb47['model']=_[_0x0de5('0x29')](_0x124353);var _0x43be2a={'dateStart':_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x2b')],'dateEnd':_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x2c')]};delete _0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x2b')];delete _0x3cd53e['query'][_0x0de5('0x2c')];_0x3eeb47[_0x0de5('0x2a')]=_[_0x0de5('0x29')](_0x3cd53e[_0x0de5('0x2a')]);_0x3eeb47['filters']=_[_0x0de5('0x2d')](_0x3eeb47[_0x0de5('0x2e')],_0x3eeb47[_0x0de5('0x2a')]);_0x172e98[_0x0de5('0x2f')]=_[_0x0de5('0x2d')](_0x3eeb47[_0x0de5('0x2e')],qs[_0x0de5('0x30')](_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x30')]));_0x172e98['attributes']=_0x172e98['attributes'][_0x0de5('0x31')]?_0x172e98[_0x0de5('0x2f')]:_0x3eeb47[_0x0de5('0x2e')];if(!_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x32')]('nolimit')){_0x172e98['limit']=qs['limit'](_0x3cd53e[_0x0de5('0x2a')]['limit']);_0x172e98[_0x0de5('0x18')]=qs[_0x0de5('0x18')](_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x18')]);}_0x172e98[_0x0de5('0x33')]=qs[_0x0de5('0x34')](_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x34')]);_0x172e98[_0x0de5('0x35')]=qs['filters'](_[_0x0de5('0x36')](_0x3cd53e[_0x0de5('0x2a')],_0x3eeb47['filters']));if(_0x43be2a[_0x0de5('0x2b')]){if(_0x43be2a[_0x0de5('0x2c')]){_0x43be2a[_0x0de5('0x2c')]=moment(_0x43be2a[_0x0de5('0x2c')])[_0x0de5('0x37')](0x1,'day');}else{_0x43be2a[_0x0de5('0x2c')]=moment(_0x43be2a['dateStart'])[_0x0de5('0x37')](0x1,_0x0de5('0x38'));}_[_0x0de5('0x39')](_0x172e98['where'],{'createdAt':{'$gte':_0x43be2a[_0x0de5('0x2b')],'$lte':_0x43be2a[_0x0de5('0x2c')]}});}if(_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x3a')]){_0x172e98['where']=_[_0x0de5('0x39')](_0x172e98[_0x0de5('0x35')],{'$or':_['map'](_0x124353,function(_0x36c8af){if(_0x36c8af['type'][_0x0de5('0x3b')]!==_0x0de5('0x3c')){var _0x2692bd={};_0x2692bd[_0x36c8af[_0x0de5('0x3d')]]={'$like':'%'+_0x3cd53e[_0x0de5('0x2a')][_0x0de5('0x3a')]+'%'};return _0x2692bd;}})});}_0x172e98=_['merge']({},_0x172e98,_0x3cd53e[_0x0de5('0x3e')]);var _0x1fdca6={'where':_0x172e98[_0x0de5('0x35')]};return db['SquareDetailsReport'][_0x0de5('0x17')](_0x1fdca6)[_0x0de5('0x21')](function(_0x37f9ba){_0x2b5ea2[_0x0de5('0x17')]=_0x37f9ba;if(_0x3cd53e['query'][_0x0de5('0x3f')]){_0x172e98[_0x0de5('0x40')]=[{'all':!![]}];}return db[_0x0de5('0x28')][_0x0de5('0x41')](_0x172e98);})[_0x0de5('0x21')](function(_0x395402){_0x2b5ea2['rows']=_0x395402;return _0x2b5ea2;})['then'](respondWithFilteredResult(_0x2ffec0,_0x172e98))[_0x0de5('0x42')](handleError(_0x2ffec0,null));};exports[_0x0de5('0x43')]=function(_0x19ebe5,_0x5ab430){var _0xfca218={'raw':!![],'where':{'id':_0x19ebe5['params']['id']}},_0x7ccaf={};_0x7ccaf[_0x0de5('0x2e')]=_[_0x0de5('0x29')](db['SquareDetailsReport'][_0x0de5('0x44')]);_0x7ccaf[_0x0de5('0x2a')]=_['keys'](_0x19ebe5[_0x0de5('0x2a')]);_0x7ccaf[_0x0de5('0x45')]=_[_0x0de5('0x2d')](_0x7ccaf[_0x0de5('0x2e')],_0x7ccaf[_0x0de5('0x2a')]);_0xfca218['attributes']=_[_0x0de5('0x2d')](_0x7ccaf[_0x0de5('0x2e')],qs['fields'](_0x19ebe5[_0x0de5('0x2a')][_0x0de5('0x30')]));_0xfca218[_0x0de5('0x2f')]=_0xfca218[_0x0de5('0x2f')][_0x0de5('0x31')]?_0xfca218['attributes']:_0x7ccaf[_0x0de5('0x2e')];if(_0x19ebe5[_0x0de5('0x2a')][_0x0de5('0x3f')]){_0xfca218['include']=[{'all':!![]}];}_0xfca218=_[_0x0de5('0x39')]({},_0xfca218,_0x19ebe5[_0x0de5('0x3e')]);return db[_0x0de5('0x28')][_0x0de5('0x46')](_0xfca218)[_0x0de5('0x21')](handleEntityNotFound(_0x5ab430,null))[_0x0de5('0x21')](respondWithResult(_0x5ab430,null))[_0x0de5('0x42')](handleError(_0x5ab430,null));};exports['create']=function(_0x21a787,_0x165078){return db[_0x0de5('0x28')][_0x0de5('0x47')](_0x21a787[_0x0de5('0x48')],{})['then'](respondWithResult(_0x165078,0xc9))[_0x0de5('0x42')](handleError(_0x165078,null));};exports['update']=function(_0x4bcaa5,_0x2fc915){if(_0x4bcaa5['body']['id']){delete _0x4bcaa5[_0x0de5('0x48')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x4bcaa5[_0x0de5('0x49')]['id']}})[_0x0de5('0x21')](handleEntityNotFound(_0x2fc915,null))[_0x0de5('0x21')](saveUpdates(_0x4bcaa5['body'],null))[_0x0de5('0x21')](respondWithResult(_0x2fc915,null))[_0x0de5('0x42')](handleError(_0x2fc915,null));};exports['destroy']=function(_0x397e6d,_0xeed6a6){return db[_0x0de5('0x28')][_0x0de5('0x46')]({'where':{'id':_0x397e6d[_0x0de5('0x49')]['id']}})['then'](handleEntityNotFound(_0xeed6a6,null))[_0x0de5('0x21')](removeEntity(_0xeed6a6,null))[_0x0de5('0x42')](handleError(_0xeed6a6,null));};exports['describe']=function(_0x36e707,_0x5452b3){return db['SquareDetailsReport'][_0x0de5('0x4a')]()['then'](respondWithResult(_0x5452b3,null))['catch'](handleError(_0x5452b3,null));};
\ No newline at end of file
+var _0x05c2=['bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','reject','save','destroy','error','stack','name','SquareDetailsReport','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','add','day','where','filter','map','field','merge','count','then','include','findAll','catch','params','includeAll','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x16920c,_0x314a4e){var _0x47f8aa=function(_0xa98b55){while(--_0xa98b55){_0x16920c['push'](_0x16920c['shift']());}};_0x47f8aa(++_0x314a4e);}(_0x05c2,0x1ca));var _0x205c=function(_0xd08cf8,_0xa62511){_0xd08cf8=_0xd08cf8-0x0;var _0x151c3c=_0x05c2[_0xd08cf8];return _0x151c3c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x205c('0x0'));var rimraf=require(_0x205c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x205c('0x2'));var rp=require(_0x205c('0x3'));var moment=require('moment');var BPromise=require(_0x205c('0x4'));var Mustache=require('mustache');var util=require(_0x205c('0x5'));var path=require(_0x205c('0x6'));var sox=require(_0x205c('0x7'));var csv=require(_0x205c('0x8'));var ejs=require(_0x205c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x205c('0xa'));var crypto=require(_0x205c('0xb'));var jsforce=require(_0x205c('0xc'));var deskjs=require(_0x205c('0xd'));var toCsv=require(_0x205c('0x8'));var querystring=require(_0x205c('0xe'));var Papa=require(_0x205c('0xf'));var Redis=require('ioredis');var qs=require(_0x205c('0x10'));var logger=require(_0x205c('0x11'))('api');var utils=require(_0x205c('0x12'));var config=require('../../config/environment');var db=require(_0x205c('0x13'))['db'];function respondWithStatusCode(_0x28ef9f,_0x521518){_0x521518=_0x521518||0xcc;return function(_0x133260){if(_0x133260){return _0x28ef9f[_0x205c('0x14')](_0x521518);}return _0x28ef9f['status'](_0x521518)[_0x205c('0x15')]();};}function respondWithResult(_0x1bbaf5,_0x13baad){_0x13baad=_0x13baad||0xc8;return function(_0x399b83){if(_0x399b83){return _0x1bbaf5[_0x205c('0x16')](_0x13baad)[_0x205c('0x17')](_0x399b83);}};}function respondWithFilteredResult(_0x5d0027,_0x14a63c){return function(_0x4feecc){if(_0x4feecc){var _0x56f95d=_0x4feecc['count'],_0x48d1da=_0x14a63c['offset'],_0x5dbf2d=_0x14a63c[_0x205c('0x18')]+_0x14a63c[_0x205c('0x19')],_0x485643;if(_0x5dbf2d>=_0x56f95d){_0x5dbf2d=_0x56f95d;_0x485643=0xc8;}else{_0x485643=0xce;}_0x5d0027[_0x205c('0x16')](_0x485643);return _0x5d0027['set']('Content-Range',_0x48d1da+'-'+_0x5dbf2d+'/'+_0x56f95d)[_0x205c('0x17')](_0x4feecc);}return null;};}function patchUpdates(_0x3184e5){return function(_0x5b2bd9){try{jsonpatch['apply'](_0x5b2bd9,_0x3184e5,!![]);}catch(_0x20b149){return BPromise[_0x205c('0x1a')](_0x20b149);}return _0x5b2bd9[_0x205c('0x1b')]();};}function saveUpdates(_0x38f81d,_0xca7036){return function(_0x540462){if(_0x540462){return _0x540462['update'](_0x38f81d)['then'](function(_0x4ff0c1){return _0x4ff0c1;});}return null;};}function removeEntity(_0x173a4a,_0xbe5b57){return function(_0x4bd464){if(_0x4bd464){return _0x4bd464[_0x205c('0x1c')]()['then'](function(){_0x173a4a[_0x205c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x451991,_0x3831fb){return function(_0x3be531){if(!_0x3be531){_0x451991['sendStatus'](0x194);}return _0x3be531;};}function handleError(_0xfc7465,_0x490e8f){_0x490e8f=_0x490e8f||0x1f4;return function(_0x253c5b){logger[_0x205c('0x1d')](_0x253c5b[_0x205c('0x1e')]);if(_0x253c5b[_0x205c('0x1f')]){delete _0x253c5b[_0x205c('0x1f')];}_0xfc7465[_0x205c('0x16')](_0x490e8f)['send'](_0x253c5b);};}exports['index']=function(_0x5ef1a0,_0x14dca1){var _0x281cd5={},_0x34a12b={},_0x4bbad9={'count':0x0,'rows':[]};var _0x2d6dce=db[_0x205c('0x20')]['rawAttributes'];_0x34a12b[_0x205c('0x21')]=_[_0x205c('0x22')](_0x2d6dce);var _0x223845={'dateStart':_0x5ef1a0[_0x205c('0x23')][_0x205c('0x24')],'dateEnd':_0x5ef1a0[_0x205c('0x23')]['dateEnd']};delete _0x5ef1a0[_0x205c('0x23')][_0x205c('0x24')];delete _0x5ef1a0['query'][_0x205c('0x25')];_0x34a12b[_0x205c('0x23')]=_[_0x205c('0x22')](_0x5ef1a0[_0x205c('0x23')]);_0x34a12b[_0x205c('0x26')]=_[_0x205c('0x27')](_0x34a12b[_0x205c('0x21')],_0x34a12b[_0x205c('0x23')]);_0x281cd5[_0x205c('0x28')]=_[_0x205c('0x27')](_0x34a12b[_0x205c('0x21')],qs[_0x205c('0x29')](_0x5ef1a0['query'][_0x205c('0x29')]));_0x281cd5[_0x205c('0x28')]=_0x281cd5[_0x205c('0x28')][_0x205c('0x2a')]?_0x281cd5[_0x205c('0x28')]:_0x34a12b[_0x205c('0x21')];if(!_0x5ef1a0[_0x205c('0x23')]['hasOwnProperty'](_0x205c('0x2b'))){_0x281cd5[_0x205c('0x19')]=qs['limit'](_0x5ef1a0[_0x205c('0x23')]['limit']);_0x281cd5[_0x205c('0x18')]=qs[_0x205c('0x18')](_0x5ef1a0[_0x205c('0x23')]['offset']);}_0x281cd5[_0x205c('0x2c')]=qs[_0x205c('0x2d')](_0x5ef1a0[_0x205c('0x23')][_0x205c('0x2d')]);_0x281cd5['where']=qs['filters'](_[_0x205c('0x2e')](_0x5ef1a0[_0x205c('0x23')],_0x34a12b[_0x205c('0x26')]));if(_0x223845[_0x205c('0x24')]){if(_0x223845['dateEnd']){_0x223845[_0x205c('0x25')]=moment(_0x223845['dateEnd'])[_0x205c('0x2f')](0x1,_0x205c('0x30'));}else{_0x223845[_0x205c('0x25')]=moment(_0x223845[_0x205c('0x24')])['add'](0x1,_0x205c('0x30'));}_['merge'](_0x281cd5[_0x205c('0x31')],{'createdAt':{'$gte':_0x223845[_0x205c('0x24')],'$lte':_0x223845['dateEnd']}});}if(_0x5ef1a0[_0x205c('0x23')][_0x205c('0x32')]){_0x281cd5[_0x205c('0x31')]=_['merge'](_0x281cd5[_0x205c('0x31')],{'$or':_[_0x205c('0x33')](_0x2d6dce,function(_0x43264e){if(_0x43264e['type']['key']!=='VIRTUAL'){var _0x502676={};_0x502676[_0x43264e[_0x205c('0x34')]]={'$like':'%'+_0x5ef1a0[_0x205c('0x23')][_0x205c('0x32')]+'%'};return _0x502676;}})});}_0x281cd5=_[_0x205c('0x35')]({},_0x281cd5,_0x5ef1a0['options']);var _0x37b4da={'where':_0x281cd5[_0x205c('0x31')]};return db[_0x205c('0x20')][_0x205c('0x36')](_0x37b4da)[_0x205c('0x37')](function(_0x428429){_0x4bbad9[_0x205c('0x36')]=_0x428429;if(_0x5ef1a0[_0x205c('0x23')]['includeAll']){_0x281cd5[_0x205c('0x38')]=[{'all':!![]}];}return db[_0x205c('0x20')][_0x205c('0x39')](_0x281cd5);})[_0x205c('0x37')](function(_0xda1c6){_0x4bbad9['rows']=_0xda1c6;return _0x4bbad9;})[_0x205c('0x37')](respondWithFilteredResult(_0x14dca1,_0x281cd5))[_0x205c('0x3a')](handleError(_0x14dca1,null));};exports['show']=function(_0x2b8825,_0x275c68){var _0x1986c3={'raw':!![],'where':{'id':_0x2b8825[_0x205c('0x3b')]['id']}},_0x227a1c={};_0x227a1c[_0x205c('0x21')]=_['keys'](db[_0x205c('0x20')]['rawAttributes']);_0x227a1c[_0x205c('0x23')]=_['keys'](_0x2b8825['query']);_0x227a1c[_0x205c('0x26')]=_[_0x205c('0x27')](_0x227a1c[_0x205c('0x21')],_0x227a1c[_0x205c('0x23')]);_0x1986c3[_0x205c('0x28')]=_[_0x205c('0x27')](_0x227a1c['model'],qs['fields'](_0x2b8825[_0x205c('0x23')]['fields']));_0x1986c3['attributes']=_0x1986c3[_0x205c('0x28')][_0x205c('0x2a')]?_0x1986c3[_0x205c('0x28')]:_0x227a1c[_0x205c('0x21')];if(_0x2b8825['query'][_0x205c('0x3c')]){_0x1986c3['include']=[{'all':!![]}];}_0x1986c3=_['merge']({},_0x1986c3,_0x2b8825['options']);return db[_0x205c('0x20')][_0x205c('0x3d')](_0x1986c3)[_0x205c('0x37')](handleEntityNotFound(_0x275c68,null))['then'](respondWithResult(_0x275c68,null))['catch'](handleError(_0x275c68,null));};exports[_0x205c('0x3e')]=function(_0x5d3e63,_0x36b67a){return db['SquareDetailsReport'][_0x205c('0x3e')](_0x5d3e63[_0x205c('0x3f')],{})[_0x205c('0x37')](respondWithResult(_0x36b67a,0xc9))[_0x205c('0x3a')](handleError(_0x36b67a,null));};exports[_0x205c('0x40')]=function(_0x4040a6,_0x1c9e8c){if(_0x4040a6[_0x205c('0x3f')]['id']){delete _0x4040a6[_0x205c('0x3f')]['id'];}return db[_0x205c('0x20')][_0x205c('0x3d')]({'where':{'id':_0x4040a6[_0x205c('0x3b')]['id']}})[_0x205c('0x37')](handleEntityNotFound(_0x1c9e8c,null))['then'](saveUpdates(_0x4040a6['body'],null))[_0x205c('0x37')](respondWithResult(_0x1c9e8c,null))['catch'](handleError(_0x1c9e8c,null));};exports[_0x205c('0x1c')]=function(_0x1a5284,_0xac36e2){return db['SquareDetailsReport'][_0x205c('0x3d')]({'where':{'id':_0x1a5284[_0x205c('0x3b')]['id']}})['then'](handleEntityNotFound(_0xac36e2,null))['then'](removeEntity(_0xac36e2,null))['catch'](handleError(_0xac36e2,null));};exports['describe']=function(_0x4578fe,_0x8fbd5f){return db[_0x205c('0x20')][_0x205c('0x41')]()[_0x205c('0x37')](respondWithResult(_0x8fbd5f,null))[_0x205c('0x3a')](handleError(_0x8fbd5f,null));};
\ No newline at end of file
index d0eb720..cdb3c02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b82=['request-promise','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','../../config/logger','moment','bluebird'];(function(_0x17318b,_0x1d9516){var _0x4bef2e=function(_0x3bc178){while(--_0x3bc178){_0x17318b['push'](_0x17318b['shift']());}};_0x4bef2e(++_0x1d9516);}(_0x5b82,0x16d));var _0x25b8=function(_0x35117e,_0x1e2d7c){_0x35117e=_0x35117e-0x0;var _0x1a3aa9=_0x5b82[_0x35117e];return _0x1a3aa9;};'use strict';var _=require(_0x25b8('0x0'));var util=require('util');var logger=require(_0x25b8('0x1'))('api');var moment=require(_0x25b8('0x2'));var BPromise=require(_0x25b8('0x3'));var rp=require(_0x25b8('0x4'));var attributes=require(_0x25b8('0x5'));module[_0x25b8('0x6')]=function(_0x1d606d,_0x408c27){return _0x1d606d[_0x25b8('0x7')](_0x25b8('0x8'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7729=['define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','./squareReportDetail.attributes'];(function(_0x420542,_0x29859f){var _0x1bfec1=function(_0x4cdc8b){while(--_0x4cdc8b){_0x420542['push'](_0x420542['shift']());}};_0x1bfec1(++_0x29859f);}(_0x7729,0x11b));var _0x9772=function(_0x198752,_0x410d18){_0x198752=_0x198752-0x0;var _0x3e749b=_0x7729[_0x198752];return _0x3e749b;};'use strict';var _=require(_0x9772('0x0'));var util=require(_0x9772('0x1'));var logger=require(_0x9772('0x2'))(_0x9772('0x3'));var moment=require(_0x9772('0x4'));var BPromise=require(_0x9772('0x5'));var rp=require('request-promise');var attributes=require(_0x9772('0x6'));module['exports']=function(_0x59d6d2,_0x3ebe35){return _0x59d6d2[_0x9772('0x7')](_0x9772('0x8'),attributes,{'tableName':_0x9772('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5e6a3e9..4514f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc43c=['then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','raw'];(function(_0x455391,_0x383b48){var _0x1445b9=function(_0x128842){while(--_0x128842){_0x455391['push'](_0x455391['shift']());}};_0x1445b9(++_0x383b48);}(_0xc43c,0x152));var _0xcc43=function(_0x4f07f0,_0x7921d6){_0x4f07f0=_0x4f07f0-0x0;var _0x5738d3=_0xc43c[_0x4f07f0];return _0x5738d3;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var BPromise=require(_0xcc43('0x3'));var rs=require(_0xcc43('0x4'));var fs=require('fs');var Redis=require(_0xcc43('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc43('0x6'));var logger=require(_0xcc43('0x7'))('rpc');var config=require(_0xcc43('0x8'));var jayson=require(_0xcc43('0x9'));var client=jayson[_0xcc43('0xa')][_0xcc43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9140b6,_0x13c316,_0x298aa7){return new BPromise(function(_0x3b8857,_0x1913c6){return client[_0xcc43('0xc')](_0x9140b6,_0x298aa7)['then'](function(_0x3f017e){logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));logger[_0xcc43('0x10')](_0xcc43('0x11'),_0x13c316,'request\x20sent',JSON[_0xcc43('0x12')](_0x3f017e));if(_0x3f017e[_0xcc43('0x13')]){if(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x14')]===0x1f4){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x1913c6(_0x3f017e['error'][_0xcc43('0x15')]);}logger[_0xcc43('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x13c316,_0x3f017e['error'][_0xcc43('0x15')]);return _0x3b8857(_0x3f017e[_0xcc43('0x13')][_0xcc43('0x15')]);}else{logger[_0xcc43('0xd')](_0xcc43('0xe'),_0x13c316,_0xcc43('0xf'));_0x3b8857(_0x3f017e['result']['message']);}})[_0xcc43('0x16')](function(_0x9b6dc){logger[_0xcc43('0x13')](_0xcc43('0xe'),_0x13c316,_0x9b6dc);_0x1913c6(_0x9b6dc);});});}exports['CreateSquareDetailsReport']=function(_0x33fe3a){var _0x3893af=this;return new Promise(function(_0x266af8,_0x56b27f){return db['SquareDetailsReport'][_0xcc43('0x17')](_0x33fe3a[_0xcc43('0x18')],{'raw':_0x33fe3a['options']?_0x33fe3a['options'][_0xcc43('0x19')]===undefined?!![]:![]:!![]})[_0xcc43('0x1a')](function(_0x2418d3){logger[_0xcc43('0xd')](_0xcc43('0x1b'),_0x33fe3a);logger[_0xcc43('0x10')](_0xcc43('0x1b'),_0x33fe3a,JSON[_0xcc43('0x12')](_0x2418d3));_0x266af8(_0x2418d3);})[_0xcc43('0x16')](function(_0x188edd){logger['error'](_0xcc43('0x1b'),_0x188edd[_0xcc43('0x15')],_0x33fe3a);_0x56b27f(_0x3893af[_0xcc43('0x13')](0x1f4,_0x188edd[_0xcc43('0x15')]));});});};
\ No newline at end of file
+var _0xf698=['jayson/promise','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xf698,0x1de));var _0x8f69=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0xf698[_0x4a7e98];return _0x27d10d;};'use strict';var _=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var moment=require('moment');var BPromise=require(_0x8f69('0x2'));var rs=require(_0x8f69('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f69('0x4'))['db'];var utils=require(_0x8f69('0x5'));var logger=require(_0x8f69('0x6'))(_0x8f69('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f69('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c9267,_0x1978e2,_0x177146){return new BPromise(function(_0x29202e,_0x2f6f5c){return client[_0x8f69('0x9')](_0x4c9267,_0x177146)[_0x8f69('0xa')](function(_0x443afd){logger[_0x8f69('0xb')](_0x8f69('0xc'),_0x1978e2,_0x8f69('0xd'));logger[_0x8f69('0xe')](_0x8f69('0xf'),_0x1978e2,'request\x20sent',JSON[_0x8f69('0x10')](_0x443afd));if(_0x443afd['error']){if(_0x443afd[_0x8f69('0x11')]['code']===0x1f4){logger[_0x8f69('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x1978e2,_0x443afd[_0x8f69('0x11')][_0x8f69('0x12')]);return _0x2f6f5c(_0x443afd[_0x8f69('0x11')]['message']);}logger['error'](_0x8f69('0xc'),_0x1978e2,_0x443afd[_0x8f69('0x11')]['message']);return _0x29202e(_0x443afd[_0x8f69('0x11')][_0x8f69('0x12')]);}else{logger[_0x8f69('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x1978e2,_0x8f69('0xd'));_0x29202e(_0x443afd[_0x8f69('0x13')][_0x8f69('0x12')]);}})['catch'](function(_0x2aa302){logger[_0x8f69('0x11')](_0x8f69('0xc'),_0x1978e2,_0x2aa302);_0x2f6f5c(_0x2aa302);});});}exports[_0x8f69('0x14')]=function(_0x377622){var _0x191315=this;return new Promise(function(_0x4a0066,_0x1d07c9){return db[_0x8f69('0x15')][_0x8f69('0x16')](_0x377622[_0x8f69('0x17')],{'raw':_0x377622['options']?_0x377622[_0x8f69('0x18')][_0x8f69('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2b2978){logger[_0x8f69('0xb')]('CreateSquareDetailsReport',_0x377622);logger['debug'](_0x8f69('0x14'),_0x377622,JSON[_0x8f69('0x10')](_0x2b2978));_0x4a0066(_0x2b2978);})[_0x8f69('0x1a')](function(_0x256178){logger[_0x8f69('0x11')]('CreateSquareDetailsReport',_0x256178[_0x8f69('0x12')],_0x377622);_0x1d07c9(_0x191315['error'](0x1f4,_0x256178['message']));});});};
\ No newline at end of file
index c2567b1..f125b29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c1f=['exports','Router','../../components/auth/service','./system.controller','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x106a3e,_0x506911){var _0xdaa0c5=function(_0x326ee1){while(--_0x326ee1){_0x106a3e['push'](_0x106a3e['shift']());}};_0xdaa0c5(++_0x506911);}(_0x8c1f,0xbe));var _0xf8c1=function(_0x4eea58,_0x3786ec){_0x4eea58=_0x4eea58-0x0;var _0xa0abbe=_0x8c1f[_0x4eea58];return _0xa0abbe;};'use strict';var express=require('express');var router=express[_0xf8c1('0x0')]();var auth=require(_0xf8c1('0x1'));var controller=require(_0xf8c1('0x2'));router['get']('/',auth[_0xf8c1('0x3')](),controller['index']);router['get'](_0xf8c1('0x4'),auth['isAuthenticated'](),controller[_0xf8c1('0x5')]);module[_0xf8c1('0x6')]=router;
\ No newline at end of file
+var _0x5ccd=['./system.controller','get','isAuthenticated','index','killProcess','exports','express'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x5ccd,0x187));var _0xd5cc=function(_0x2c6047,_0x485481){_0x2c6047=_0x2c6047-0x0;var _0x5a9f17=_0x5ccd[_0x2c6047];return _0x5a9f17;};'use strict';var express=require(_0xd5cc('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xd5cc('0x1'));router[_0xd5cc('0x2')]('/',auth[_0xd5cc('0x3')](),controller[_0xd5cc('0x4')]);router[_0xd5cc('0x2')]('/process/:pid/kill',auth[_0xd5cc('0x3')](),controller[_0xd5cc('0x5')]);module[_0xd5cc('0x6')]=router;
\ No newline at end of file
index 2afb4a1..a080727 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6606=['<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','index','then','status','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','kill','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6606,0x1c0));var _0x6660=function(_0xcf7ea1,_0x2e91ad){_0xcf7ea1=_0xcf7ea1-0x0;var _0x42ebbb=_0x6606[_0xcf7ea1];return _0x42ebbb;};'use strict';var info=require(_0x6660('0x0'));var exec=require(_0x6660('0x1'))['exec'];var logger=require(_0x6660('0x2'))(_0x6660('0x3'));var util=require(_0x6660('0x4'));var BPromise=require(_0x6660('0x5'));var _=require(_0x6660('0x6'));function handleError(_0x3945a7,_0x15b71b,_0x3d7867){_0x15b71b=_0x15b71b||0x1f4;return function(_0x200493){logger[_0x6660('0x7')](_0x6660('0x8'),_0x3d7867,_0x15b71b,util[_0x6660('0x9')](_0x200493,{'showHidden':![],'depth':null}));delete _0x200493[_0x6660('0xa')];_0x3945a7['status'](_0x15b71b)['send'](_0x200493);};}exports[_0x6660('0xb')]=function(_0xd2d61f,_0x150f56){return info['getAllData']()[_0x6660('0xc')](function(_0x3f9f0b){return _0x150f56[_0x6660('0xd')](0xc8)[_0x6660('0xe')](_0x3f9f0b);})['catch'](function(_0x4f7f74){return _0x150f56['status'](0x1f4)['json'](_0x4f7f74);});};exports[_0x6660('0xf')]=function(_0x1d3ada,_0x3ec24a){var _0x96232b=['components/import/cm'];return new BPromise(function(_0x1801be,_0x5b790d){return exec(util[_0x6660('0x10')](_0x6660('0x11'),_0x1d3ada[_0x6660('0x12')][_0x6660('0x13')]),function(_0x54b9bd,_0x511ab6,_0x1fe780){if(_0x54b9bd){return _0x5b790d(_0x54b9bd);}return _0x1801be(_0x511ab6);});})['then'](function(_0x2ae13a){var _0x193d0a=![];var _0x1bb04b=_0x2ae13a[_0x6660('0x14')](/\n/);for(var _0x52b3ab=0x0,_0x261206=_0x96232b[_0x6660('0x15')];_0x52b3ab<_0x261206,_0x193d0a===![];_0x52b3ab+=0x1){if(_0x2ae13a[_0x6660('0x16')](_0x96232b[_0x52b3ab])>=0x0){_0x193d0a=!![];}}if(!_0x193d0a){throw new Error(util[_0x6660('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1d3ada[_0x6660('0x12')][_0x6660('0x13')]));}process[_0x6660('0x17')](_0x1d3ada['params'][_0x6660('0x13')],'SIGINT');return _0x3ec24a[_0x6660('0xd')](0xc8)[_0x6660('0xe')]({'message':util[_0x6660('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1d3ada[_0x6660('0x12')][_0x6660('0x13')])});})['catch'](handleError(_0x3ec24a,null,_0x6660('0xf')));};
\ No newline at end of file
+var _0xdd5e=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdd5e,0x75));var _0xedd5=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xdd5e[_0x28669c];return _0x4a3af6;};'use strict';var info=require(_0xedd5('0x0'));var exec=require(_0xedd5('0x1'))[_0xedd5('0x2')];var logger=require(_0xedd5('0x3'))(_0xedd5('0x4'));var util=require(_0xedd5('0x5'));var BPromise=require(_0xedd5('0x6'));var _=require(_0xedd5('0x7'));function handleError(_0x58f7a2,_0x5cccb9,_0x6cbdd8){_0x5cccb9=_0x5cccb9||0x1f4;return function(_0x5131fd){logger['error'](_0xedd5('0x8'),_0x6cbdd8,_0x5cccb9,util['inspect'](_0x5131fd,{'showHidden':![],'depth':null}));delete _0x5131fd['name'];_0x58f7a2[_0xedd5('0x9')](_0x5cccb9)[_0xedd5('0xa')](_0x5131fd);};}exports[_0xedd5('0xb')]=function(_0x3e13ea,_0x433de7){return info[_0xedd5('0xc')]()[_0xedd5('0xd')](function(_0x3fc414){return _0x433de7[_0xedd5('0x9')](0xc8)[_0xedd5('0xe')](_0x3fc414);})[_0xedd5('0xf')](function(_0x5c5d29){return _0x433de7[_0xedd5('0x9')](0x1f4)[_0xedd5('0xe')](_0x5c5d29);});};exports[_0xedd5('0x10')]=function(_0x53e96d,_0x3e8bd6){var _0x48ab04=[_0xedd5('0x11')];return new BPromise(function(_0x4598cc,_0x16fb58){return exec(util[_0xedd5('0x12')](_0xedd5('0x13'),_0x53e96d[_0xedd5('0x14')][_0xedd5('0x15')]),function(_0x48cb81,_0x2f25d4,_0x30cc13){if(_0x48cb81){return _0x16fb58(_0x48cb81);}return _0x4598cc(_0x2f25d4);});})[_0xedd5('0xd')](function(_0x136268){var _0x4c2ef7=![];var _0x583ab4=_0x136268[_0xedd5('0x16')](/\n/);for(var _0x504961=0x0,_0x353ae8=_0x48ab04[_0xedd5('0x17')];_0x504961<_0x353ae8,_0x4c2ef7===![];_0x504961+=0x1){if(_0x136268[_0xedd5('0x18')](_0x48ab04[_0x504961])>=0x0){_0x4c2ef7=!![];}}if(!_0x4c2ef7){throw new Error(util['format'](_0xedd5('0x19'),_0x53e96d[_0xedd5('0x14')][_0xedd5('0x15')]));}process[_0xedd5('0x1a')](_0x53e96d[_0xedd5('0x14')][_0xedd5('0x15')],_0xedd5('0x1b'));return _0x3e8bd6[_0xedd5('0x9')](0xc8)[_0xedd5('0xe')]({'message':util[_0xedd5('0x12')](_0xedd5('0x1c'),_0x53e96d['params'][_0xedd5('0x15')])});})[_0xedd5('0xf')](handleError(_0x3e8bd6,null,_0xedd5('0x10')));};
\ No newline at end of file
index 1ef56b3..0329d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['show','post','create','put','update','delete','/:id','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index'];(function(_0x3ec936,_0x543fce){var _0x399302=function(_0x41c053){while(--_0x41c053){_0x3ec936['push'](_0x3ec936['shift']());}};_0x399302(++_0x543fce);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')]('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0xb')]);router[_0x65f6('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xf'),auth[_0x65f6('0x7')](),controller['destroy']);module[_0x65f6('0x10')]=router;
\ No newline at end of file
+var _0x757a=['exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x757a,0xde));var _0xa757=function(_0x5544ee,_0x2e4a26){_0x5544ee=_0x5544ee-0x0;var _0x69c798=_0x757a[_0x5544ee];return _0x69c798;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa757('0x2'));var interaction=require(_0xa757('0x3'));var config=require(_0xa757('0x4'));var controller=require(_0xa757('0x5'));router[_0xa757('0x6')]('/',auth[_0xa757('0x7')](),controller['index']);router[_0xa757('0x6')](_0xa757('0x8'),auth['isAuthenticated'](),controller[_0xa757('0x9')]);router[_0xa757('0xa')]('/',auth[_0xa757('0x7')](),controller[_0xa757('0xb')]);router[_0xa757('0xc')]('/:id',auth[_0xa757('0x7')](),controller[_0xa757('0xd')]);router[_0xa757('0xe')](_0xa757('0x8'),auth[_0xa757('0x7')](),controller[_0xa757('0xf')]);module[_0xa757('0x10')]=router;
\ No newline at end of file
index 99585c2..04adfa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec5=['sequelize','exports','STRING','name','#0091EA'];(function(_0x3b545c,_0x491912){var _0xc9eb90=function(_0x35aeec){while(--_0x35aeec){_0x3b545c['push'](_0x3b545c['shift']());}};_0xc9eb90(++_0x491912);}(_0x0ec5,0x195));var _0x50ec=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0ec5[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x50ec('0x0'));module[_0x50ec('0x1')]={'name':{'type':Sequelize[_0x50ec('0x2')],'unique':_0x50ec('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x50ec('0x2')],'defaultValue':_0x50ec('0x4')},'description':{'type':Sequelize[_0x50ec('0x2')]}};
\ No newline at end of file
+var _0x05d4=['exports','STRING','name','#0091EA','sequelize'];(function(_0x345de7,_0x1de531){var _0x26ffc7=function(_0x5b8539){while(--_0x5b8539){_0x345de7['push'](_0x345de7['shift']());}};_0x26ffc7(++_0x1de531);}(_0x05d4,0xc2));var _0x405d=function(_0x4442f5,_0x58ff30){_0x4442f5=_0x4442f5-0x0;var _0x4b064d=_0x05d4[_0x4442f5];return _0x4b064d;};'use strict';var Sequelize=require(_0x405d('0x0'));module[_0x405d('0x1')]={'name':{'type':Sequelize[_0x405d('0x2')],'unique':_0x405d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x405d('0x4')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cc321fc..d13d371 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','update','then','UserProfileResource','stack','name','send','index','Tag','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','day','add','filter','where','merge','type','key','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0x31cb91,_0x46e2cf){var _0x338b73=function(_0x33feab){while(--_0x33feab){_0x31cb91['push'](_0x31cb91['shift']());}};_0x338b73(++_0x46e2cf);}(_0x668b,0x140));var _0xb668=function(_0x592df4,_0x4e719b){_0x592df4=_0x592df4-0x0;var _0x3b4fe4=_0x668b[_0x592df4];return _0x3b4fe4;};'use strict';var pdf=require(_0xb668('0x0'));var emlformat=require(_0xb668('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb668('0x2'));var jsonpatch=require(_0xb668('0x3'));var rp=require('request-promise');var moment=require(_0xb668('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb668('0x5'));var util=require(_0xb668('0x6'));var path=require(_0xb668('0x7'));var sox=require('sox');var csv=require(_0xb668('0x8'));var ejs=require(_0xb668('0x9'));var fs=require('fs');var _=require(_0xb668('0xa'));var squel=require(_0xb668('0xb'));var crypto=require(_0xb668('0xc'));var jsforce=require(_0xb668('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb668('0x8'));var querystring=require(_0xb668('0xe'));var Papa=require(_0xb668('0xf'));var Redis=require(_0xb668('0x10'));var qs=require(_0xb668('0x11'));var logger=require(_0xb668('0x12'))(_0xb668('0x13'));var utils=require(_0xb668('0x14'));var config=require('../../config/environment');var db=require(_0xb668('0x15'))['db'];function respondWithStatusCode(_0x27dbf7,_0x27de15){_0x27de15=_0x27de15||0xcc;return function(_0x2ea5fc){if(_0x2ea5fc){return _0x27dbf7[_0xb668('0x16')](_0x27de15);}return _0x27dbf7[_0xb668('0x17')](_0x27de15)[_0xb668('0x18')]();};}function respondWithResult(_0x10ed24,_0x3e5be0){_0x3e5be0=_0x3e5be0||0xc8;return function(_0x25c5c5){if(_0x25c5c5){return _0x10ed24[_0xb668('0x17')](_0x3e5be0)[_0xb668('0x19')](_0x25c5c5);}};}function respondWithFilteredResult(_0x3aed25,_0xd0450f){return function(_0x2ec706){if(_0x2ec706){var _0x3b0c84=_0x2ec706[_0xb668('0x1a')],_0x1ca6e7=_0xd0450f[_0xb668('0x1b')],_0x222cad=_0xd0450f[_0xb668('0x1b')]+_0xd0450f['limit'],_0x4fa32a;if(_0x222cad>=_0x3b0c84){_0x222cad=_0x3b0c84;_0x4fa32a=0xc8;}else{_0x4fa32a=0xce;}_0x3aed25[_0xb668('0x17')](_0x4fa32a);return _0x3aed25['set'](_0xb668('0x1c'),_0x1ca6e7+'-'+_0x222cad+'/'+_0x3b0c84)[_0xb668('0x19')](_0x2ec706);}return null;};}function patchUpdates(_0x5438ff){return function(_0x38595d){try{jsonpatch[_0xb668('0x1d')](_0x38595d,_0x5438ff,!![]);}catch(_0x53ff78){return BPromise[_0xb668('0x1e')](_0x53ff78);}return _0x38595d['save']();};}function saveUpdates(_0x12fb3f,_0x178a5d){return function(_0x253ba5){if(_0x253ba5){return _0x253ba5[_0xb668('0x1f')](_0x12fb3f)['then'](function(_0x2b7f96){return _0x2b7f96;});}return null;};}function removeEntity(_0xfe4595,_0x25e5be){return function(_0x52de83){if(_0x52de83){return _0x52de83['destroy']()[_0xb668('0x20')](function(){var _0x1e5620=_0x52de83['get']({'plain':!![]});var _0x61de4a='Tags';return db[_0xb668('0x21')]['destroy']({'where':{'type':_0x61de4a,'resourceId':_0x1e5620['id']}})[_0xb668('0x20')](function(){return _0x52de83;});})[_0xb668('0x20')](function(){_0xfe4595[_0xb668('0x17')](0xcc)[_0xb668('0x18')]();});}};}function handleEntityNotFound(_0x2a5b3d,_0xabb342){return function(_0x4d4bf8){if(!_0x4d4bf8){_0x2a5b3d[_0xb668('0x16')](0x194);}return _0x4d4bf8;};}function handleError(_0x10d767,_0x2ab8c2){_0x2ab8c2=_0x2ab8c2||0x1f4;return function(_0x49abfd){logger['error'](_0x49abfd[_0xb668('0x22')]);if(_0x49abfd[_0xb668('0x23')]){delete _0x49abfd[_0xb668('0x23')];}_0x10d767['status'](_0x2ab8c2)[_0xb668('0x24')](_0x49abfd);};}exports[_0xb668('0x25')]=function(_0x1616e5,_0x4c78a0){var _0x5709e2={},_0x12919c={},_0x2619a4={'count':0x0,'rows':[]};var _0x589c58=db[_0xb668('0x26')][_0xb668('0x27')];_0x12919c[_0xb668('0x28')]=_[_0xb668('0x29')](_0x589c58);var _0x256a8={'dateStart':_0x1616e5['query'][_0xb668('0x2a')],'dateEnd':_0x1616e5[_0xb668('0x2b')]['dateEnd']};delete _0x1616e5[_0xb668('0x2b')]['dateStart'];delete _0x1616e5[_0xb668('0x2b')][_0xb668('0x2c')];_0x12919c[_0xb668('0x2b')]=_[_0xb668('0x29')](_0x1616e5[_0xb668('0x2b')]);_0x12919c[_0xb668('0x2d')]=_[_0xb668('0x2e')](_0x12919c[_0xb668('0x28')],_0x12919c[_0xb668('0x2b')]);_0x5709e2['attributes']=_[_0xb668('0x2e')](_0x12919c[_0xb668('0x28')],qs[_0xb668('0x2f')](_0x1616e5['query'][_0xb668('0x2f')]));_0x5709e2[_0xb668('0x30')]=_0x5709e2[_0xb668('0x30')][_0xb668('0x31')]?_0x5709e2['attributes']:_0x12919c[_0xb668('0x28')];if(!_0x1616e5[_0xb668('0x2b')][_0xb668('0x32')](_0xb668('0x33'))){_0x5709e2[_0xb668('0x34')]=qs[_0xb668('0x34')](_0x1616e5[_0xb668('0x2b')]['limit']);_0x5709e2[_0xb668('0x1b')]=qs[_0xb668('0x1b')](_0x1616e5['query'][_0xb668('0x1b')]);}_0x5709e2['order']=qs['sort'](_0x1616e5[_0xb668('0x2b')][_0xb668('0x35')]);_0x5709e2['where']=qs[_0xb668('0x2d')](_['pick'](_0x1616e5[_0xb668('0x2b')],_0x12919c['filters']));if(_0x256a8['dateStart']){if(_0x256a8[_0xb668('0x2c')]){_0x256a8[_0xb668('0x2c')]=moment(_0x256a8['dateEnd'])['add'](0x1,_0xb668('0x36'));}else{_0x256a8[_0xb668('0x2c')]=moment(_0x256a8[_0xb668('0x2a')])[_0xb668('0x37')](0x1,_0xb668('0x36'));}_['merge'](_0x5709e2['where'],{'createdAt':{'$gte':_0x256a8[_0xb668('0x2a')],'$lte':_0x256a8[_0xb668('0x2c')]}});}if(_0x1616e5[_0xb668('0x2b')][_0xb668('0x38')]){_0x5709e2[_0xb668('0x39')]=_[_0xb668('0x3a')](_0x5709e2['where'],{'$or':_['map'](_0x589c58,function(_0x2715a4){if(_0x2715a4[_0xb668('0x3b')][_0xb668('0x3c')]!==_0xb668('0x3d')){var _0x74ccb6={};_0x74ccb6[_0x2715a4['field']]={'$like':'%'+_0x1616e5[_0xb668('0x2b')][_0xb668('0x38')]+'%'};return _0x74ccb6;}})});}_0x5709e2=_['merge']({},_0x5709e2,_0x1616e5[_0xb668('0x3e')]);var _0x2621c0={'where':_0x5709e2[_0xb668('0x39')]};return db[_0xb668('0x26')]['count'](_0x2621c0)['then'](function(_0x4b7192){_0x2619a4[_0xb668('0x1a')]=_0x4b7192;if(_0x1616e5['query']['includeAll']){_0x5709e2['include']=[{'all':!![]}];}return db['Tag'][_0xb668('0x3f')](_0x5709e2);})['then'](function(_0x14b269){_0x2619a4[_0xb668('0x40')]=_0x14b269;return _0x2619a4;})[_0xb668('0x20')](respondWithFilteredResult(_0x4c78a0,_0x5709e2))[_0xb668('0x41')](handleError(_0x4c78a0,null));};exports[_0xb668('0x42')]=function(_0x5ece02,_0x2fecfa){var _0x29b0ee={'raw':!![],'where':{'id':_0x5ece02[_0xb668('0x43')]['id']}},_0xb8ac84={};_0xb8ac84[_0xb668('0x28')]=_[_0xb668('0x29')](db[_0xb668('0x26')][_0xb668('0x27')]);_0xb8ac84[_0xb668('0x2b')]=_[_0xb668('0x29')](_0x5ece02[_0xb668('0x2b')]);_0xb8ac84['filters']=_[_0xb668('0x2e')](_0xb8ac84[_0xb668('0x28')],_0xb8ac84[_0xb668('0x2b')]);_0x29b0ee['attributes']=_['intersection'](_0xb8ac84[_0xb668('0x28')],qs['fields'](_0x5ece02[_0xb668('0x2b')]['fields']));_0x29b0ee['attributes']=_0x29b0ee['attributes'][_0xb668('0x31')]?_0x29b0ee[_0xb668('0x30')]:_0xb8ac84['model'];if(_0x5ece02[_0xb668('0x2b')][_0xb668('0x44')]){_0x29b0ee[_0xb668('0x45')]=[{'all':!![]}];}_0x29b0ee=_[_0xb668('0x3a')]({},_0x29b0ee,_0x5ece02[_0xb668('0x3e')]);return db[_0xb668('0x26')][_0xb668('0x46')](_0x29b0ee)[_0xb668('0x20')](handleEntityNotFound(_0x2fecfa,null))[_0xb668('0x20')](respondWithResult(_0x2fecfa,null))[_0xb668('0x41')](handleError(_0x2fecfa,null));};exports['create']=function(_0x3c6c8a,_0x415aba){return db[_0xb668('0x26')][_0xb668('0x47')](_0x3c6c8a[_0xb668('0x48')],{})[_0xb668('0x20')](function(_0x381694){var _0x1bff79=_0x3c6c8a[_0xb668('0x49')]['get']({'plain':!![]});if(!_0x1bff79)throw new Error(_0xb668('0x4a'));if(_0x1bff79[_0xb668('0x4b')]===_0xb668('0x49')){var _0x4c9eab=_0x381694['get']({'plain':!![]});var _0x25c2a0=_0xb668('0x4c');return db[_0xb668('0x4d')]['find']({'where':{'name':_0x25c2a0,'userProfileId':_0x1bff79[_0xb668('0x4e')]},'raw':!![]})['then'](function(_0x51a5d3){if(_0x51a5d3&&_0x51a5d3[_0xb668('0x4f')]===0x0){return db[_0xb668('0x21')][_0xb668('0x47')]({'name':_0x4c9eab[_0xb668('0x23')],'resourceId':_0x4c9eab['id'],'type':_0x51a5d3[_0xb668('0x23')],'sectionId':_0x51a5d3['id']},{})[_0xb668('0x20')](function(){return _0x381694;});}else{return _0x381694;}})[_0xb668('0x41')](function(_0x1af19a){logger[_0xb668('0x50')](_0xb668('0x51'),_0x1af19a);throw _0x1af19a;});}return _0x381694;})[_0xb668('0x20')](respondWithResult(_0x415aba,0xc9))[_0xb668('0x41')](handleError(_0x415aba,null));};exports[_0xb668('0x1f')]=function(_0x41750e,_0x2899ef){if(_0x41750e[_0xb668('0x48')]['id']){delete _0x41750e[_0xb668('0x48')]['id'];}return db[_0xb668('0x26')][_0xb668('0x46')]({'where':{'id':_0x41750e[_0xb668('0x43')]['id']}})[_0xb668('0x20')](handleEntityNotFound(_0x2899ef,null))[_0xb668('0x20')](saveUpdates(_0x41750e[_0xb668('0x48')],null))[_0xb668('0x20')](respondWithResult(_0x2899ef,null))[_0xb668('0x41')](handleError(_0x2899ef,null));};exports[_0xb668('0x52')]=function(_0x44724d,_0x46abfb){return db[_0xb668('0x26')][_0xb668('0x46')]({'where':{'id':_0x44724d['params']['id']}})[_0xb668('0x20')](handleEntityNotFound(_0x46abfb,null))[_0xb668('0x20')](removeEntity(_0x46abfb,null))[_0xb668('0x41')](handleError(_0x46abfb,null));};
\ No newline at end of file
+var _0xd957=['eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','Tag','rawAttributes','model','keys','dateStart','dateEnd','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','add','day','merge','filter','map','type','key','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf'];(function(_0x532b7e,_0x189a10){var _0x5d143d=function(_0x1dcc74){while(--_0x1dcc74){_0x532b7e['push'](_0x532b7e['shift']());}};_0x5d143d(++_0x189a10);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x7d95('0x0'));var emlformat=require(_0x7d95('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7d95('0x2'));var jsonpatch=require(_0x7d95('0x3'));var rp=require('request-promise');var moment=require(_0x7d95('0x4'));var BPromise=require(_0x7d95('0x5'));var Mustache=require(_0x7d95('0x6'));var util=require(_0x7d95('0x7'));var path=require(_0x7d95('0x8'));var sox=require(_0x7d95('0x9'));var csv=require(_0x7d95('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d95('0xb'));var squel=require(_0x7d95('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d95('0xd'));var deskjs=require(_0x7d95('0xe'));var toCsv=require(_0x7d95('0xa'));var querystring=require(_0x7d95('0xf'));var Papa=require(_0x7d95('0x10'));var Redis=require('ioredis');var qs=require(_0x7d95('0x11'));var logger=require(_0x7d95('0x12'))(_0x7d95('0x13'));var utils=require(_0x7d95('0x14'));var config=require(_0x7d95('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f34b9,_0x2ed92b){_0x2ed92b=_0x2ed92b||0xcc;return function(_0x4efb7b){if(_0x4efb7b){return _0x5f34b9['sendStatus'](_0x2ed92b);}return _0x5f34b9[_0x7d95('0x16')](_0x2ed92b)[_0x7d95('0x17')]();};}function respondWithResult(_0x310657,_0x396fa4){_0x396fa4=_0x396fa4||0xc8;return function(_0x389e96){if(_0x389e96){return _0x310657[_0x7d95('0x16')](_0x396fa4)['json'](_0x389e96);}};}function respondWithFilteredResult(_0x82ac5f,_0x56e18f){return function(_0x253133){if(_0x253133){var _0x5ac56a=_0x253133[_0x7d95('0x18')],_0x9b5091=_0x56e18f[_0x7d95('0x19')],_0x4f333d=_0x56e18f[_0x7d95('0x19')]+_0x56e18f['limit'],_0x3b519a;if(_0x4f333d>=_0x5ac56a){_0x4f333d=_0x5ac56a;_0x3b519a=0xc8;}else{_0x3b519a=0xce;}_0x82ac5f['status'](_0x3b519a);return _0x82ac5f[_0x7d95('0x1a')](_0x7d95('0x1b'),_0x9b5091+'-'+_0x4f333d+'/'+_0x5ac56a)[_0x7d95('0x1c')](_0x253133);}return null;};}function patchUpdates(_0x33a7ab){return function(_0x57197c){try{jsonpatch[_0x7d95('0x1d')](_0x57197c,_0x33a7ab,!![]);}catch(_0x2e8f80){return BPromise['reject'](_0x2e8f80);}return _0x57197c[_0x7d95('0x1e')]();};}function saveUpdates(_0x1b5629,_0x2d0627){return function(_0x265c10){if(_0x265c10){return _0x265c10[_0x7d95('0x1f')](_0x1b5629)[_0x7d95('0x20')](function(_0x3ae23a){return _0x3ae23a;});}return null;};}function removeEntity(_0x45bec0,_0x46da03){return function(_0x489e8a){if(_0x489e8a){return _0x489e8a[_0x7d95('0x21')]()['then'](function(){var _0x1e2b58=_0x489e8a['get']({'plain':!![]});var _0x49386b=_0x7d95('0x22');return db[_0x7d95('0x23')][_0x7d95('0x21')]({'where':{'type':_0x49386b,'resourceId':_0x1e2b58['id']}})['then'](function(){return _0x489e8a;});})[_0x7d95('0x20')](function(){_0x45bec0[_0x7d95('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1938a5,_0x4e97c9){return function(_0x4ec676){if(!_0x4ec676){_0x1938a5['sendStatus'](0x194);}return _0x4ec676;};}function handleError(_0x3d869f,_0x285890){_0x285890=_0x285890||0x1f4;return function(_0x4c6b9f){logger[_0x7d95('0x24')](_0x4c6b9f[_0x7d95('0x25')]);if(_0x4c6b9f[_0x7d95('0x26')]){delete _0x4c6b9f['name'];}_0x3d869f[_0x7d95('0x16')](_0x285890)[_0x7d95('0x27')](_0x4c6b9f);};}exports[_0x7d95('0x28')]=function(_0x5c0664,_0x41c8c1){var _0x57b751={},_0x216fa6={},_0x3be6fa={'count':0x0,'rows':[]};var _0x3d3bb8=db[_0x7d95('0x29')][_0x7d95('0x2a')];_0x216fa6[_0x7d95('0x2b')]=_[_0x7d95('0x2c')](_0x3d3bb8);var _0x32ac56={'dateStart':_0x5c0664['query'][_0x7d95('0x2d')],'dateEnd':_0x5c0664['query'][_0x7d95('0x2e')]};delete _0x5c0664['query'][_0x7d95('0x2d')];delete _0x5c0664[_0x7d95('0x2f')][_0x7d95('0x2e')];_0x216fa6[_0x7d95('0x2f')]=_[_0x7d95('0x2c')](_0x5c0664[_0x7d95('0x2f')]);_0x216fa6['filters']=_[_0x7d95('0x30')](_0x216fa6[_0x7d95('0x2b')],_0x216fa6[_0x7d95('0x2f')]);_0x57b751[_0x7d95('0x31')]=_[_0x7d95('0x30')](_0x216fa6[_0x7d95('0x2b')],qs['fields'](_0x5c0664[_0x7d95('0x2f')][_0x7d95('0x32')]));_0x57b751['attributes']=_0x57b751['attributes'][_0x7d95('0x33')]?_0x57b751[_0x7d95('0x31')]:_0x216fa6['model'];if(!_0x5c0664[_0x7d95('0x2f')][_0x7d95('0x34')](_0x7d95('0x35'))){_0x57b751[_0x7d95('0x36')]=qs[_0x7d95('0x36')](_0x5c0664[_0x7d95('0x2f')][_0x7d95('0x36')]);_0x57b751['offset']=qs[_0x7d95('0x19')](_0x5c0664[_0x7d95('0x2f')][_0x7d95('0x19')]);}_0x57b751['order']=qs[_0x7d95('0x37')](_0x5c0664[_0x7d95('0x2f')]['sort']);_0x57b751[_0x7d95('0x38')]=qs[_0x7d95('0x39')](_[_0x7d95('0x3a')](_0x5c0664[_0x7d95('0x2f')],_0x216fa6['filters']));if(_0x32ac56['dateStart']){if(_0x32ac56['dateEnd']){_0x32ac56['dateEnd']=moment(_0x32ac56['dateEnd'])['add'](0x1,'day');}else{_0x32ac56[_0x7d95('0x2e')]=moment(_0x32ac56[_0x7d95('0x2d')])[_0x7d95('0x3b')](0x1,_0x7d95('0x3c'));}_[_0x7d95('0x3d')](_0x57b751[_0x7d95('0x38')],{'createdAt':{'$gte':_0x32ac56[_0x7d95('0x2d')],'$lte':_0x32ac56[_0x7d95('0x2e')]}});}if(_0x5c0664[_0x7d95('0x2f')][_0x7d95('0x3e')]){_0x57b751['where']=_[_0x7d95('0x3d')](_0x57b751[_0x7d95('0x38')],{'$or':_[_0x7d95('0x3f')](_0x3d3bb8,function(_0x3fbb25){if(_0x3fbb25[_0x7d95('0x40')][_0x7d95('0x41')]!==_0x7d95('0x42')){var _0x265fa8={};_0x265fa8[_0x3fbb25['field']]={'$like':'%'+_0x5c0664[_0x7d95('0x2f')][_0x7d95('0x3e')]+'%'};return _0x265fa8;}})});}_0x57b751=_['merge']({},_0x57b751,_0x5c0664[_0x7d95('0x43')]);var _0x2fa998={'where':_0x57b751['where']};return db[_0x7d95('0x29')]['count'](_0x2fa998)['then'](function(_0x332f5a){_0x3be6fa[_0x7d95('0x18')]=_0x332f5a;if(_0x5c0664[_0x7d95('0x2f')][_0x7d95('0x44')]){_0x57b751[_0x7d95('0x45')]=[{'all':!![]}];}return db[_0x7d95('0x29')][_0x7d95('0x46')](_0x57b751);})[_0x7d95('0x20')](function(_0x205a6e){_0x3be6fa['rows']=_0x205a6e;return _0x3be6fa;})[_0x7d95('0x20')](respondWithFilteredResult(_0x41c8c1,_0x57b751))['catch'](handleError(_0x41c8c1,null));};exports[_0x7d95('0x47')]=function(_0x2d4a5b,_0x360034){var _0x2bf854={'raw':!![],'where':{'id':_0x2d4a5b[_0x7d95('0x48')]['id']}},_0x2a9d77={};_0x2a9d77[_0x7d95('0x2b')]=_[_0x7d95('0x2c')](db[_0x7d95('0x29')][_0x7d95('0x2a')]);_0x2a9d77['query']=_[_0x7d95('0x2c')](_0x2d4a5b[_0x7d95('0x2f')]);_0x2a9d77[_0x7d95('0x39')]=_[_0x7d95('0x30')](_0x2a9d77[_0x7d95('0x2b')],_0x2a9d77[_0x7d95('0x2f')]);_0x2bf854['attributes']=_['intersection'](_0x2a9d77[_0x7d95('0x2b')],qs[_0x7d95('0x32')](_0x2d4a5b['query'][_0x7d95('0x32')]));_0x2bf854[_0x7d95('0x31')]=_0x2bf854['attributes'][_0x7d95('0x33')]?_0x2bf854[_0x7d95('0x31')]:_0x2a9d77[_0x7d95('0x2b')];if(_0x2d4a5b[_0x7d95('0x2f')][_0x7d95('0x44')]){_0x2bf854[_0x7d95('0x45')]=[{'all':!![]}];}_0x2bf854=_[_0x7d95('0x3d')]({},_0x2bf854,_0x2d4a5b[_0x7d95('0x43')]);return db[_0x7d95('0x29')]['find'](_0x2bf854)[_0x7d95('0x20')](handleEntityNotFound(_0x360034,null))['then'](respondWithResult(_0x360034,null))[_0x7d95('0x49')](handleError(_0x360034,null));};exports['create']=function(_0x29d3c2,_0x44cfdc){return db[_0x7d95('0x29')][_0x7d95('0x4a')](_0x29d3c2[_0x7d95('0x4b')],{})[_0x7d95('0x20')](function(_0x19fa68){var _0x25bf9f=_0x29d3c2[_0x7d95('0x4c')]['get']({'plain':!![]});if(!_0x25bf9f)throw new Error(_0x7d95('0x4d'));if(_0x25bf9f[_0x7d95('0x4e')]===_0x7d95('0x4c')){var _0x43a853=_0x19fa68[_0x7d95('0x4f')]({'plain':!![]});var _0x118ff0=_0x7d95('0x22');return db[_0x7d95('0x50')][_0x7d95('0x51')]({'where':{'name':_0x118ff0,'userProfileId':_0x25bf9f[_0x7d95('0x52')]},'raw':!![]})[_0x7d95('0x20')](function(_0x2e927b){if(_0x2e927b&&_0x2e927b[_0x7d95('0x53')]===0x0){return db[_0x7d95('0x23')]['create']({'name':_0x43a853[_0x7d95('0x26')],'resourceId':_0x43a853['id'],'type':_0x2e927b[_0x7d95('0x26')],'sectionId':_0x2e927b['id']},{})[_0x7d95('0x20')](function(){return _0x19fa68;});}else{return _0x19fa68;}})[_0x7d95('0x49')](function(_0x5c3d8){logger[_0x7d95('0x24')](_0x7d95('0x54'),_0x5c3d8);throw _0x5c3d8;});}return _0x19fa68;})[_0x7d95('0x20')](respondWithResult(_0x44cfdc,0xc9))[_0x7d95('0x49')](handleError(_0x44cfdc,null));};exports[_0x7d95('0x1f')]=function(_0x29b971,_0x280247){if(_0x29b971[_0x7d95('0x4b')]['id']){delete _0x29b971[_0x7d95('0x4b')]['id'];}return db[_0x7d95('0x29')][_0x7d95('0x51')]({'where':{'id':_0x29b971['params']['id']}})['then'](handleEntityNotFound(_0x280247,null))[_0x7d95('0x20')](saveUpdates(_0x29b971[_0x7d95('0x4b')],null))[_0x7d95('0x20')](respondWithResult(_0x280247,null))['catch'](handleError(_0x280247,null));};exports[_0x7d95('0x21')]=function(_0x22b302,_0x3218e4){return db[_0x7d95('0x29')][_0x7d95('0x51')]({'where':{'id':_0x22b302[_0x7d95('0x48')]['id']}})['then'](handleEntityNotFound(_0x3218e4,null))['then'](removeEntity(_0x3218e4,null))[_0x7d95('0x49')](handleError(_0x3218e4,null));};
\ No newline at end of file
index 3da8be8..9bd6b12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd68c=['request-promise','exports','define','Tag','tools_tags','lodash','api','moment','bluebird'];(function(_0x5e43f4,_0x47ea74){var _0x3bcd34=function(_0x121c71){while(--_0x121c71){_0x5e43f4['push'](_0x5e43f4['shift']());}};_0x3bcd34(++_0x47ea74);}(_0xd68c,0x113));var _0xcd68=function(_0x5dad01,_0x51ee76){_0x5dad01=_0x5dad01-0x0;var _0x596e37=_0xd68c[_0x5dad01];return _0x596e37;};'use strict';var _=require(_0xcd68('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcd68('0x1'));var moment=require(_0xcd68('0x2'));var BPromise=require(_0xcd68('0x3'));var rp=require(_0xcd68('0x4'));var attributes=require('./tag.attributes');module[_0xcd68('0x5')]=function(_0x3d8727,_0x30e2aa){return _0x3d8727[_0xcd68('0x6')](_0xcd68('0x7'),attributes,{'tableName':_0xcd68('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xced9=['./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a5b7e,_0x5465d6){var _0x47c1f3=function(_0x530b73){while(--_0x530b73){_0x1a5b7e['push'](_0x1a5b7e['shift']());}};_0x47c1f3(++_0x5465d6);}(_0xced9,0x12e));var _0x9ced=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xced9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x9ced('0x0'));var util=require(_0x9ced('0x1'));var logger=require(_0x9ced('0x2'))(_0x9ced('0x3'));var moment=require(_0x9ced('0x4'));var BPromise=require(_0x9ced('0x5'));var rp=require('request-promise');var attributes=require(_0x9ced('0x6'));module[_0x9ced('0x7')]=function(_0x16c9be,_0x588343){return _0x16c9be[_0x9ced('0x8')](_0x9ced('0x9'),attributes,{'tableName':_0x9ced('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7cec108..88086a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc421=['debug','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','then','info','Tag,\x20%s,\x20%s'];(function(_0x575a31,_0x56336f){var _0x5d7dad=function(_0x2c8c09){while(--_0x2c8c09){_0x575a31['push'](_0x575a31['shift']());}};_0x5d7dad(++_0x56336f);}(_0xc421,0x97));var _0x1c42=function(_0x3e3921,_0x2d6be8){_0x3e3921=_0x3e3921-0x0;var _0x5e15cd=_0xc421[_0x3e3921];return _0x5e15cd;};'use strict';var _=require(_0x1c42('0x0'));var util=require('util');var moment=require(_0x1c42('0x1'));var BPromise=require(_0x1c42('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c42('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c42('0x4'));var logger=require(_0x1c42('0x5'))('rpc');var config=require(_0x1c42('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1c42('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x128af7,_0x1bbe6a,_0x176a6d){return new BPromise(function(_0x171a30,_0x1dae73){return client['request'](_0x128af7,_0x176a6d)[_0x1c42('0x8')](function(_0x2b036f){logger[_0x1c42('0x9')](_0x1c42('0xa'),_0x1bbe6a,'request\x20sent');logger[_0x1c42('0xb')]('Tag,\x20%s,\x20%s,\x20%s',_0x1bbe6a,_0x1c42('0xc'),JSON[_0x1c42('0xd')](_0x2b036f));if(_0x2b036f[_0x1c42('0xe')]){if(_0x2b036f['error']['code']===0x1f4){logger[_0x1c42('0xe')](_0x1c42('0xa'),_0x1bbe6a,_0x2b036f[_0x1c42('0xe')]['message']);return _0x1dae73(_0x2b036f[_0x1c42('0xe')]['message']);}logger['error'](_0x1c42('0xa'),_0x1bbe6a,_0x2b036f[_0x1c42('0xe')][_0x1c42('0xf')]);return _0x171a30(_0x2b036f[_0x1c42('0xe')]['message']);}else{logger[_0x1c42('0x9')](_0x1c42('0xa'),_0x1bbe6a,_0x1c42('0xc'));_0x171a30(_0x2b036f[_0x1c42('0x10')][_0x1c42('0xf')]);}})[_0x1c42('0x11')](function(_0x443201){logger[_0x1c42('0xe')](_0x1c42('0xa'),_0x1bbe6a,_0x443201);_0x1dae73(_0x443201);});});}
\ No newline at end of file
+var _0x2065=['client','request','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3ce7f0,_0x197eb5){var _0x35c3ca=function(_0x58241b){while(--_0x58241b){_0x3ce7f0['push'](_0x3ce7f0['shift']());}};_0x35c3ca(++_0x197eb5);}(_0x2065,0x170));var _0x5206=function(_0x12d05b,_0x235dd8){_0x12d05b=_0x12d05b-0x0;var _0x341836=_0x2065[_0x12d05b];return _0x341836;};'use strict';var _=require(_0x5206('0x0'));var util=require(_0x5206('0x1'));var moment=require(_0x5206('0x2'));var BPromise=require(_0x5206('0x3'));var rs=require(_0x5206('0x4'));var fs=require('fs');var Redis=require(_0x5206('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5206('0x6'));var logger=require(_0x5206('0x7'))(_0x5206('0x8'));var config=require('../../config/environment');var jayson=require(_0x5206('0x9'));var client=jayson[_0x5206('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x78cf5e,_0x223d77,_0x1bdfb1){return new BPromise(function(_0x81d7,_0x424e2f){return client[_0x5206('0xb')](_0x78cf5e,_0x1bdfb1)['then'](function(_0x5810b6){logger[_0x5206('0xc')](_0x5206('0xd'),_0x223d77,_0x5206('0xe'));logger['debug'](_0x5206('0xf'),_0x223d77,_0x5206('0xe'),JSON[_0x5206('0x10')](_0x5810b6));if(_0x5810b6[_0x5206('0x11')]){if(_0x5810b6[_0x5206('0x11')]['code']===0x1f4){logger['error'](_0x5206('0xd'),_0x223d77,_0x5810b6[_0x5206('0x11')]['message']);return _0x424e2f(_0x5810b6[_0x5206('0x11')][_0x5206('0x12')]);}logger[_0x5206('0x11')]('Tag,\x20%s,\x20%s',_0x223d77,_0x5810b6[_0x5206('0x11')]['message']);return _0x81d7(_0x5810b6[_0x5206('0x11')][_0x5206('0x12')]);}else{logger[_0x5206('0xc')](_0x5206('0xd'),_0x223d77,'request\x20sent');_0x81d7(_0x5810b6[_0x5206('0x13')]['message']);}})[_0x5206('0x14')](function(_0xcd5ca9){logger[_0x5206('0x11')](_0x5206('0xd'),_0x223d77,_0xcd5ca9);_0x424e2f(_0xcd5ca9);});});}
\ No newline at end of file
index 3abe2e0..fcb82c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86c6=['get','isAuthenticated','index','/:id','show','getQueues','/:id/users','getAgents','post','create','/:id/queues','addQueues','delete','destroy','removeQueues','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x86c6,0x197));var _0x686c=function(_0xd9211e,_0xed67ef){_0xd9211e=_0xd9211e-0x0;var _0x3a8b8e=_0x86c6[_0xd9211e];return _0x3a8b8e;};'use strict';var multer=require('multer');var util=require(_0x686c('0x0'));var path=require(_0x686c('0x1'));var timeout=require(_0x686c('0x2'));var express=require(_0x686c('0x3'));var router=express[_0x686c('0x4')]();var auth=require(_0x686c('0x5'));var interaction=require(_0x686c('0x6'));var config=require('../../config/environment');var controller=require('./team.controller');router[_0x686c('0x7')]('/',auth[_0x686c('0x8')](),controller[_0x686c('0x9')]);router[_0x686c('0x7')](_0x686c('0xa'),auth['isAuthenticated'](),controller[_0x686c('0xb')]);router[_0x686c('0x7')]('/:id/queues',auth['isAuthenticated'](),controller[_0x686c('0xc')]);router[_0x686c('0x7')](_0x686c('0xd'),auth[_0x686c('0x8')](),controller[_0x686c('0xe')]);router[_0x686c('0xf')]('/',auth['isAuthenticated'](),controller[_0x686c('0x10')]);router[_0x686c('0xf')](_0x686c('0x11'),auth[_0x686c('0x8')](),controller[_0x686c('0x12')]);router['post'](_0x686c('0xd'),auth[_0x686c('0x8')](),controller['addAgents']);router['put'](_0x686c('0xa'),auth[_0x686c('0x8')](),controller['update']);router[_0x686c('0x13')](_0x686c('0xa'),auth[_0x686c('0x8')](),controller[_0x686c('0x14')]);router[_0x686c('0x13')]('/:id/queues',auth[_0x686c('0x8')](),controller[_0x686c('0x15')]);router[_0x686c('0x13')](_0x686c('0xd'),auth[_0x686c('0x8')](),controller[_0x686c('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x7919=['delete','destroy','removeQueues','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','/:id/users','getAgents','create','addQueues','post','addAgents','put','update'];(function(_0x4a688a,_0x278266){var _0x381409=function(_0x3ca1a5){while(--_0x3ca1a5){_0x4a688a['push'](_0x4a688a['shift']());}};_0x381409(++_0x278266);}(_0x7919,0x75));var _0x9791=function(_0x19d751,_0x21938e){_0x19d751=_0x19d751-0x0;var _0x337c88=_0x7919[_0x19d751];return _0x337c88;};'use strict';var multer=require(_0x9791('0x0'));var util=require(_0x9791('0x1'));var path=require(_0x9791('0x2'));var timeout=require('connect-timeout');var express=require(_0x9791('0x3'));var router=express[_0x9791('0x4')]();var auth=require(_0x9791('0x5'));var interaction=require(_0x9791('0x6'));var config=require(_0x9791('0x7'));var controller=require('./team.controller');router[_0x9791('0x8')]('/',auth[_0x9791('0x9')](),controller[_0x9791('0xa')]);router[_0x9791('0x8')](_0x9791('0xb'),auth[_0x9791('0x9')](),controller[_0x9791('0xc')]);router[_0x9791('0x8')](_0x9791('0xd'),auth[_0x9791('0x9')](),controller[_0x9791('0xe')]);router['get'](_0x9791('0xf'),auth[_0x9791('0x9')](),controller[_0x9791('0x10')]);router['post']('/',auth[_0x9791('0x9')](),controller[_0x9791('0x11')]);router['post'](_0x9791('0xd'),auth[_0x9791('0x9')](),controller[_0x9791('0x12')]);router[_0x9791('0x13')](_0x9791('0xf'),auth[_0x9791('0x9')](),controller[_0x9791('0x14')]);router[_0x9791('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9791('0x16')]);router[_0x9791('0x17')](_0x9791('0xb'),auth[_0x9791('0x9')](),controller[_0x9791('0x18')]);router[_0x9791('0x17')]('/:id/queues',auth[_0x9791('0x9')](),controller[_0x9791('0x19')]);router[_0x9791('0x17')](_0x9791('0xf'),auth['isAuthenticated'](),controller[_0x9791('0x1a')]);module[_0x9791('0x1b')]=router;
\ No newline at end of file
index 98b7043..b7b0f4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd881=['STRING','sequelize'];(function(_0x16b6db,_0x1c8615){var _0x193759=function(_0x3195c8){while(--_0x3195c8){_0x16b6db['push'](_0x16b6db['shift']());}};_0x193759(++_0x1c8615);}(_0xd881,0x12d));var _0x1d88=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd881[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x1d88('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d88('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2013=['sequelize','exports'];(function(_0x30acf5,_0x7f8049){var _0x38b06d=function(_0x5ebf8f){while(--_0x5ebf8f){_0x30acf5['push'](_0x30acf5['shift']());}};_0x38b06d(++_0x7f8049);}(_0x2013,0xcc));var _0x3201=function(_0xed9df3,_0x3cd19b){_0xed9df3=_0xed9df3-0x0;var _0x3605ec=_0x2013[_0xed9df3];return _0x3605ec;};'use strict';var Sequelize=require(_0x3201('0x0'));module[_0x3201('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d14ea33..9458ab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','sort','toLowerCase','Queues','addQueues','Sequelize','ids','remove','each','voice','chat','mail','fax','openchannel','addAgents','voicePause','interface','upsert','isNil','format','SIP/%s','omit','spread','emit','userTeam:save','removeAgents','sms','userTeam:remove','getAgents','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./team.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','Teams','error','name','send','index','Team','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','order','where','pick','add','day','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb10b,0x12a));var _0xbb10=function(_0x99a230,_0xe70e96){_0x99a230=_0x99a230-0x0;var _0xd903cf=_0xb10b[_0x99a230];return _0xd903cf;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var qs=require(_0xbb10('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xbb10('0x14'));var config=require(_0xbb10('0x15'));var db=require(_0xbb10('0x16'))['db'];config['redis']=_[_0xbb10('0x17')](config['redis'],{'host':_0xbb10('0x18'),'port':0x18eb});var socket=require(_0xbb10('0x19'))(new Redis(config[_0xbb10('0x1a')]));require(_0xbb10('0x1b'))[_0xbb10('0x1c')](socket);function respondWithStatusCode(_0x147230,_0x58a612){_0x58a612=_0x58a612||0xcc;return function(_0x26e021){if(_0x26e021){return _0x147230[_0xbb10('0x1d')](_0x58a612);}return _0x147230[_0xbb10('0x1e')](_0x58a612)[_0xbb10('0x1f')]();};}function respondWithResult(_0x3df17b,_0x2f2ebf){_0x2f2ebf=_0x2f2ebf||0xc8;return function(_0x24a57b){if(_0x24a57b){return _0x3df17b[_0xbb10('0x1e')](_0x2f2ebf)[_0xbb10('0x20')](_0x24a57b);}};}function respondWithFilteredResult(_0x2b184e,_0x4a2bfc){return function(_0x2eca0f){if(_0x2eca0f){var _0x1145f1=_0x2eca0f[_0xbb10('0x21')],_0x133ac2=_0x4a2bfc[_0xbb10('0x22')],_0x42db98=_0x4a2bfc[_0xbb10('0x22')]+_0x4a2bfc[_0xbb10('0x23')],_0x378da8;if(_0x42db98>=_0x1145f1){_0x42db98=_0x1145f1;_0x378da8=0xc8;}else{_0x378da8=0xce;}_0x2b184e[_0xbb10('0x1e')](_0x378da8);return _0x2b184e['set'](_0xbb10('0x24'),_0x133ac2+'-'+_0x42db98+'/'+_0x1145f1)[_0xbb10('0x20')](_0x2eca0f);}return null;};}function patchUpdates(_0x388fab){return function(_0x109908){try{jsonpatch[_0xbb10('0x25')](_0x109908,_0x388fab,!![]);}catch(_0x44e563){return BPromise['reject'](_0x44e563);}return _0x109908[_0xbb10('0x26')]();};}function saveUpdates(_0x12ef77,_0x50aea1){return function(_0x4c4b0d){if(_0x4c4b0d){return _0x4c4b0d[_0xbb10('0x27')](_0x12ef77)[_0xbb10('0x28')](function(_0x2e911d){return _0x2e911d;});}return null;};}function removeEntity(_0x317da4,_0x445761){return function(_0x1824b7){if(_0x1824b7){return _0x1824b7[_0xbb10('0x29')]()[_0xbb10('0x28')](function(){var _0x7f2377=_0x1824b7[_0xbb10('0x2a')]({'plain':!![]});var _0x3ba6cd=_0xbb10('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x3ba6cd,'resourceId':_0x7f2377['id']}})['then'](function(){return _0x1824b7;});})[_0xbb10('0x28')](function(){_0x317da4[_0xbb10('0x1e')](0xcc)[_0xbb10('0x1f')]();});}};}function handleEntityNotFound(_0x4e25ff,_0x2fdde9){return function(_0x24d586){if(!_0x24d586){_0x4e25ff[_0xbb10('0x1d')](0x194);}return _0x24d586;};}function handleError(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0x1f4;return function(_0x20d946){logger[_0xbb10('0x2c')](_0x20d946['stack']);if(_0x20d946[_0xbb10('0x2d')]){delete _0x20d946[_0xbb10('0x2d')];}_0x1d5e95[_0xbb10('0x1e')](_0x1acce9)[_0xbb10('0x2e')](_0x20d946);};}exports[_0xbb10('0x2f')]=function(_0x2ff4c1,_0x5d5c80){var _0x221624={},_0x4ee02e={},_0x448d5c={'count':0x0,'rows':[]};var _0x56f2da=db[_0xbb10('0x30')][_0xbb10('0x31')];_0x4ee02e[_0xbb10('0x32')]=_['keys'](_0x56f2da);var _0x518d47={'dateStart':_0x2ff4c1[_0xbb10('0x33')][_0xbb10('0x34')],'dateEnd':_0x2ff4c1['query'][_0xbb10('0x35')]};delete _0x2ff4c1[_0xbb10('0x33')][_0xbb10('0x34')];delete _0x2ff4c1[_0xbb10('0x33')][_0xbb10('0x35')];_0x4ee02e[_0xbb10('0x33')]=_[_0xbb10('0x36')](_0x2ff4c1['query']);_0x4ee02e[_0xbb10('0x37')]=_[_0xbb10('0x38')](_0x4ee02e[_0xbb10('0x32')],_0x4ee02e[_0xbb10('0x33')]);_0x221624[_0xbb10('0x39')]=_[_0xbb10('0x38')](_0x4ee02e[_0xbb10('0x32')],qs[_0xbb10('0x3a')](_0x2ff4c1[_0xbb10('0x33')]['fields']));_0x221624[_0xbb10('0x39')]=_0x221624[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x221624[_0xbb10('0x39')]:_0x4ee02e['model'];if(!_0x2ff4c1[_0xbb10('0x33')]['hasOwnProperty']('nolimit')){_0x221624[_0xbb10('0x23')]=qs[_0xbb10('0x23')](_0x2ff4c1[_0xbb10('0x33')][_0xbb10('0x23')]);_0x221624[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x2ff4c1['query'][_0xbb10('0x22')]);}_0x221624[_0xbb10('0x3c')]=qs['sort'](_0x2ff4c1['query']['sort']);_0x221624[_0xbb10('0x3d')]=qs[_0xbb10('0x37')](_[_0xbb10('0x3e')](_0x2ff4c1['query'],_0x4ee02e[_0xbb10('0x37')]));if(_0x518d47[_0xbb10('0x34')]){if(_0x518d47[_0xbb10('0x35')]){_0x518d47['dateEnd']=moment(_0x518d47[_0xbb10('0x35')])[_0xbb10('0x3f')](0x1,_0xbb10('0x40'));}else{_0x518d47[_0xbb10('0x35')]=moment(_0x518d47['dateStart'])[_0xbb10('0x3f')](0x1,_0xbb10('0x40'));}_['merge'](_0x221624[_0xbb10('0x3d')],{'createdAt':{'$gte':_0x518d47[_0xbb10('0x34')],'$lte':_0x518d47[_0xbb10('0x35')]}});}if(_0x2ff4c1[_0xbb10('0x33')][_0xbb10('0x41')]){_0x221624[_0xbb10('0x3d')]=_['merge'](_0x221624[_0xbb10('0x3d')],{'$or':_[_0xbb10('0x42')](_0x56f2da,function(_0x3e7b4c){if(_0x3e7b4c[_0xbb10('0x43')]['key']!==_0xbb10('0x44')){var _0x331751={};_0x331751[_0x3e7b4c[_0xbb10('0x45')]]={'$like':'%'+_0x2ff4c1[_0xbb10('0x33')]['filter']+'%'};return _0x331751;}})});}_0x221624=_[_0xbb10('0x46')]({},_0x221624,_0x2ff4c1[_0xbb10('0x47')]);var _0x54ac18={'where':_0x221624['where']};return db[_0xbb10('0x30')]['count'](_0x54ac18)[_0xbb10('0x28')](function(_0x180933){_0x448d5c['count']=_0x180933;if(_0x2ff4c1[_0xbb10('0x33')][_0xbb10('0x48')]){_0x221624[_0xbb10('0x49')]=[{'all':!![]}];}return db['Team'][_0xbb10('0x4a')](_0x221624);})[_0xbb10('0x28')](function(_0x3b9fdf){_0x448d5c[_0xbb10('0x4b')]=_0x3b9fdf;return _0x448d5c;})[_0xbb10('0x28')](respondWithFilteredResult(_0x5d5c80,_0x221624))[_0xbb10('0x4c')](handleError(_0x5d5c80,null));};exports[_0xbb10('0x4d')]=function(_0x3efa96,_0x205bb4){var _0x43b948={'raw':![],'where':{'id':_0x3efa96[_0xbb10('0x4e')]['id']}},_0x197871={};_0x197871['model']=_[_0xbb10('0x36')](db[_0xbb10('0x30')]['rawAttributes']);_0x197871[_0xbb10('0x33')]=_[_0xbb10('0x36')](_0x3efa96[_0xbb10('0x33')]);_0x197871[_0xbb10('0x37')]=_[_0xbb10('0x38')](_0x197871[_0xbb10('0x32')],_0x197871[_0xbb10('0x33')]);_0x43b948['attributes']=_['intersection'](_0x197871[_0xbb10('0x32')],qs[_0xbb10('0x3a')](_0x3efa96[_0xbb10('0x33')]['fields']));_0x43b948['attributes']=_0x43b948[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x43b948[_0xbb10('0x39')]:_0x197871[_0xbb10('0x32')];if(_0x3efa96[_0xbb10('0x33')][_0xbb10('0x48')]){_0x43b948[_0xbb10('0x49')]=[{'all':!![]}];}_0x43b948=_[_0xbb10('0x46')]({},_0x43b948,_0x3efa96[_0xbb10('0x47')]);return db[_0xbb10('0x30')]['find'](_0x43b948)['then'](handleEntityNotFound(_0x205bb4,null))[_0xbb10('0x28')](respondWithResult(_0x205bb4,null))[_0xbb10('0x4c')](handleError(_0x205bb4,null));};exports[_0xbb10('0x4f')]=function(_0xb014b0,_0x36aa7d){return db[_0xbb10('0x30')][_0xbb10('0x4f')](_0xb014b0[_0xbb10('0x50')],{})[_0xbb10('0x28')](function(_0x1214f7){var _0x19ca3e=_0xb014b0[_0xbb10('0x51')][_0xbb10('0x2a')]({'plain':!![]});if(!_0x19ca3e)throw new Error(_0xbb10('0x52'));if(_0x19ca3e[_0xbb10('0x53')]==='user'){var _0x124052=_0x1214f7['get']({'plain':!![]});var _0x33d60a=_0xbb10('0x2b');return db[_0xbb10('0x54')][_0xbb10('0x55')]({'where':{'name':_0x33d60a,'userProfileId':_0x19ca3e[_0xbb10('0x56')]},'raw':!![]})[_0xbb10('0x28')](function(_0x2e3326){if(_0x2e3326&&_0x2e3326[_0xbb10('0x57')]===0x0){return db[_0xbb10('0x58')][_0xbb10('0x4f')]({'name':_0x124052[_0xbb10('0x2d')],'resourceId':_0x124052['id'],'type':_0x2e3326[_0xbb10('0x2d')],'sectionId':_0x2e3326['id']},{})[_0xbb10('0x28')](function(){return _0x1214f7;});}else{return _0x1214f7;}})[_0xbb10('0x4c')](function(_0x4475e1){logger['error'](_0xbb10('0x59'),_0x4475e1);throw _0x4475e1;});}return _0x1214f7;})[_0xbb10('0x28')](respondWithResult(_0x36aa7d,0xc9))[_0xbb10('0x4c')](handleError(_0x36aa7d,null));};exports[_0xbb10('0x27')]=function(_0xbffa3c,_0x379d8c){if(_0xbffa3c['body']['id']){delete _0xbffa3c[_0xbb10('0x50')]['id'];}return db[_0xbb10('0x30')][_0xbb10('0x55')]({'where':{'id':_0xbffa3c[_0xbb10('0x4e')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x379d8c,null))[_0xbb10('0x28')](saveUpdates(_0xbffa3c[_0xbb10('0x50')],null))[_0xbb10('0x28')](respondWithResult(_0x379d8c,null))[_0xbb10('0x4c')](handleError(_0x379d8c,null));};exports[_0xbb10('0x29')]=function(_0x2eb05a,_0x2a1ce1){return db[_0xbb10('0x30')]['find']({'where':{'id':_0x2eb05a['params']['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x2a1ce1,null))[_0xbb10('0x28')](removeEntity(_0x2a1ce1,null))[_0xbb10('0x4c')](handleError(_0x2a1ce1,null));};exports[_0xbb10('0x5a')]=function(_0x5573bb,_0x506498,_0x79411e){return db[_0xbb10('0x30')][_0xbb10('0x5b')]({'where':{'id':_0x5573bb[_0xbb10('0x4e')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x506498,null))[_0xbb10('0x28')](function(_0x45c0dc){if(!_0x5573bb['query'][_0xbb10('0x5c')]||!utils[_0xbb10('0x5d')](_0x5573bb['query']['channel'])){throw new db['Sequelize'][(_0xbb10('0x5e'))](_0xbb10('0x5f'));}var _0x155dc5={};var _0x5bd1c0={};_0x5bd1c0['model']=_['keys'](db[_[_0xbb10('0x60')](_0x5573bb[_0xbb10('0x33')][_0xbb10('0x5c')]['toLowerCase']())+_0xbb10('0x61')][_0xbb10('0x31')]);_0x5bd1c0['query']=_['keys'](_0x5573bb[_0xbb10('0x33')]);_0x5bd1c0[_0xbb10('0x37')]=_[_0xbb10('0x38')](_0x5bd1c0[_0xbb10('0x32')],_0x5bd1c0['query']);_0x155dc5[_0xbb10('0x39')]=_[_0xbb10('0x38')](_0x5bd1c0[_0xbb10('0x32')],qs['fields'](_0x5573bb[_0xbb10('0x33')][_0xbb10('0x3a')]));_0x155dc5[_0xbb10('0x39')]=_0x155dc5['attributes'][_0xbb10('0x3b')]?_0x155dc5[_0xbb10('0x39')]:_0x5bd1c0[_0xbb10('0x32')];_0x155dc5[_0xbb10('0x23')]=qs['limit'](_0x5573bb[_0xbb10('0x33')][_0xbb10('0x23')]);_0x155dc5[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x5573bb['query'][_0xbb10('0x22')]);_0x155dc5[_0xbb10('0x3c')]=qs[_0xbb10('0x62')](_0x5573bb[_0xbb10('0x33')][_0xbb10('0x62')]);_0x155dc5[_0xbb10('0x3d')]=qs[_0xbb10('0x37')](_['pick'](_0x5573bb['query'],_0x5bd1c0['filters']));_0x155dc5=_[_0xbb10('0x46')]({},_0x155dc5,_0x5573bb[_0xbb10('0x47')]);return _0x45c0dc[_0xbb10('0x2a')+_['capitalize'](_0x5573bb['query'][_0xbb10('0x5c')][_0xbb10('0x63')]())+_0xbb10('0x64')](_0x155dc5);})[_0xbb10('0x28')](respondWithResult(_0x506498,null))[_0xbb10('0x4c')](handleError(_0x506498,null));};exports[_0xbb10('0x65')]=function(_0x4cf2f3,_0x1a5ca5,_0x15fae2){return db[_0xbb10('0x30')][_0xbb10('0x5b')]({'where':{'id':_0x4cf2f3[_0xbb10('0x4e')]['id']}})['then'](function(_0x56094a){if(_0x56094a){if(!_0x4cf2f3['body'][_0xbb10('0x5c')]||!utils[_0xbb10('0x5d')](_0x4cf2f3[_0xbb10('0x50')][_0xbb10('0x5c')])){throw new db[(_0xbb10('0x66'))][(_0xbb10('0x5e'))]('Unknown\x20channel');}return _0x56094a[_0xbb10('0x3f')+_['capitalize'](_0x4cf2f3['body']['channel'][_0xbb10('0x63')]())+_0xbb10('0x64')](_0x4cf2f3[_0xbb10('0x50')][_0xbb10('0x67')]);}return null;})['then'](handleEntityNotFound(_0x1a5ca5,null))[_0xbb10('0x28')](respondWithStatusCode(_0x1a5ca5,null))['catch'](handleError(_0x1a5ca5,null));};exports['removeQueues']=function(_0x165fe9,_0xfe3db0,_0x29529c){return db[_0xbb10('0x30')][_0xbb10('0x5b')]({'where':{'id':_0x165fe9['params']['id']}})[_0xbb10('0x28')](function(_0x19fcec){if(_0x19fcec){if(!_0x165fe9[_0xbb10('0x33')][_0xbb10('0x5c')]||!utils[_0xbb10('0x5d')](_0x165fe9[_0xbb10('0x33')][_0xbb10('0x5c')])){throw new db['Sequelize'][(_0xbb10('0x5e'))](_0xbb10('0x5f'));}return _0x19fcec[_0xbb10('0x68')+_[_0xbb10('0x60')](_0x165fe9[_0xbb10('0x33')][_0xbb10('0x5c')][_0xbb10('0x63')]())+_0xbb10('0x64')](_0x165fe9['query'][_0xbb10('0x67')]);}return null;})[_0xbb10('0x28')](handleEntityNotFound(_0xfe3db0,null))[_0xbb10('0x28')](respondWithStatusCode(_0xfe3db0,null))['catch'](handleError(_0xfe3db0,null));};exports['addAgents']=function(_0x4b923a,_0x23286d,_0x5a3c44){return db['Team'][_0xbb10('0x55')]({'where':{'id':_0x4b923a[_0xbb10('0x4e')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x23286d,null))[_0xbb10('0x28')](function(_0x32ec27){if(_0x32ec27){return BPromise[_0xbb10('0x69')]([_0xbb10('0x6a'),_0xbb10('0x6b'),_0xbb10('0x6c'),'sms',_0xbb10('0x6d'),_0xbb10('0x6e')],function(_0x46b6d2){return _0x32ec27[_0xbb10('0x2a')+_['capitalize'](_0x46b6d2)+'Queues']({'attributes':['id',_0xbb10('0x2d')]})[_0xbb10('0x28')](function(_0x30f0a4){return BPromise[_0xbb10('0x69')](_0x30f0a4,function(_0x5ee705){return _0x5ee705[_0xbb10('0x6f')](_0x4b923a[_0xbb10('0x50')][_0xbb10('0x67')])[_0xbb10('0x28')](function(){if(_0x46b6d2===_0xbb10('0x6a')){return db['User']['findAll']({'where':{'id':_0x4b923a[_0xbb10('0x50')][_0xbb10('0x67')]},'attributes':['id',_0xbb10('0x2d'),'loginInPause',_0xbb10('0x70'),_0xbb10('0x71')],'raw':!![]});}})['then'](function(_0x5caa06){if(_0x46b6d2===_0xbb10('0x6a')){return BPromise[_0xbb10('0x69')](_0x5caa06,function(_0x177f77){return db['UserVoiceQueueRt'][_0xbb10('0x72')]({'membername':_0x177f77[_0xbb10('0x2d')],'UserId':_0x177f77['id'],'queue_name':_0x5ee705[_0xbb10('0x2d')],'VoiceQueueId':_0x5ee705['id'],'interface':_[_0xbb10('0x73')](_0x177f77[_0xbb10('0x71')])?util[_0xbb10('0x74')](_0xbb10('0x75'),_0x177f77[_0xbb10('0x2d')]):_0x177f77[_0xbb10('0x71')],'paused':_0x177f77['voicePause']||![],'penalty':0x0});});}});});})[_0xbb10('0x28')](function(){return _0x32ec27;});})[_0xbb10('0x28')](function(){return _0x32ec27;});}})[_0xbb10('0x28')](function(_0xdb7d3e){if(_0xdb7d3e){return _0xdb7d3e[_0xbb10('0x6f')](_0x4b923a[_0xbb10('0x50')][_0xbb10('0x67')],_[_0xbb10('0x76')](_0x4b923a[_0xbb10('0x50')],[_0xbb10('0x67'),'id'])||{})[_0xbb10('0x77')](function(_0x2a4278){for(var _0x59e985=0x0;_0x59e985<_0x4b923a['body'][_0xbb10('0x67')][_0xbb10('0x3b')];_0x59e985+=0x1){socket[_0xbb10('0x78')](_0xbb10('0x79'),{'UserId':_0x4b923a[_0xbb10('0x50')]['ids'][_0x59e985],'TeamId':_0x4b923a[_0xbb10('0x4e')]['id']});}return _0x2a4278;});}})[_0xbb10('0x28')](respondWithResult(_0x23286d,null))[_0xbb10('0x4c')](handleError(_0x23286d,null));};exports[_0xbb10('0x7a')]=function(_0x19694d,_0x379d49,_0x546db5){var _0xb25e71;return db[_0xbb10('0x30')]['find']({'where':{'id':_0x19694d[_0xbb10('0x4e')]['id']}})['then'](handleEntityNotFound(_0x379d49,null))[_0xbb10('0x28')](function(_0x28bd76){if(_0x28bd76){return BPromise[_0xbb10('0x69')]([_0xbb10('0x6a'),_0xbb10('0x6b'),'mail',_0xbb10('0x7b'),'fax',_0xbb10('0x6e')],function(_0x37ec93){return _0x28bd76['get'+_['capitalize'](_0x37ec93)+_0xbb10('0x64')]({'attributes':['id',_0xbb10('0x2d')]})[_0xbb10('0x28')](function(_0x283bab){return BPromise[_0xbb10('0x69')](_0x283bab,function(_0x1cb22f){return _0x1cb22f[_0xbb10('0x7a')](_0x19694d[_0xbb10('0x33')][_0xbb10('0x67')])[_0xbb10('0x28')](function(){if(_0x37ec93===_0xbb10('0x6a')){return db['UserVoiceQueueRt'][_0xbb10('0x29')]({'where':{'VoiceQueueId':_0x1cb22f['id'],'UserId':_0x19694d[_0xbb10('0x33')][_0xbb10('0x67')]}});}});});})[_0xbb10('0x28')](function(){return _0x28bd76;});})[_0xbb10('0x28')](function(){return _0x28bd76;});}})[_0xbb10('0x28')](function(_0xfefa17){if(_0xfefa17){return _0xfefa17[_0xbb10('0x7a')](_0x19694d[_0xbb10('0x33')][_0xbb10('0x67')])[_0xbb10('0x28')](function(_0x2d3e98){if(_['isArray'](_0x19694d[_0xbb10('0x33')]['ids'])){for(var _0x1b6d7d=0x0;_0x1b6d7d<_0x19694d[_0xbb10('0x33')][_0xbb10('0x67')][_0xbb10('0x3b')];_0x1b6d7d+=0x1){socket[_0xbb10('0x78')]('userTeam:remove',{'UserId':_0x19694d[_0xbb10('0x33')][_0xbb10('0x67')][_0x1b6d7d],'TeamId':_0x19694d[_0xbb10('0x4e')]['id']});}}else{socket[_0xbb10('0x78')](_0xbb10('0x7c'),{'UserId':_0x19694d[_0xbb10('0x33')]['ids'],'TeamId':_0x19694d['params']['id']});}});}})[_0xbb10('0x28')](respondWithStatusCode(_0x379d49,null))[_0xbb10('0x4c')](handleError(_0x379d49,null));};exports[_0xbb10('0x7d')]=function(_0x57d5a1,_0x124b32,_0x3d6a91){var _0x514fdf={};var _0x2831de={};var _0xaede56;var _0x5642c3;return db[_0xbb10('0x30')]['findOne']({'where':{'id':_0x57d5a1[_0xbb10('0x4e')]['id']}})[_0xbb10('0x28')](handleEntityNotFound(_0x124b32,null))['then'](function(_0x34a5a3){if(_0x34a5a3){_0xaede56=_0x34a5a3;_0x2831de[_0xbb10('0x32')]=_['keys'](db['User'][_0xbb10('0x31')]);_0x2831de[_0xbb10('0x33')]=_[_0xbb10('0x36')](_0x57d5a1[_0xbb10('0x33')]);_0x2831de[_0xbb10('0x37')]=_['intersection'](_0x2831de[_0xbb10('0x32')],_0x2831de[_0xbb10('0x33')]);_0x514fdf[_0xbb10('0x39')]=_['intersection'](_0x2831de[_0xbb10('0x32')],qs[_0xbb10('0x3a')](_0x57d5a1[_0xbb10('0x33')][_0xbb10('0x3a')]));_0x514fdf[_0xbb10('0x39')]=_0x514fdf[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x514fdf[_0xbb10('0x39')]:_0x2831de[_0xbb10('0x32')];_0x514fdf['order']=qs['sort'](_0x57d5a1[_0xbb10('0x33')][_0xbb10('0x62')]);_0x514fdf[_0xbb10('0x3d')]=qs[_0xbb10('0x37')](_[_0xbb10('0x3e')](_0x57d5a1[_0xbb10('0x33')],_0x2831de[_0xbb10('0x37')]));if(_0x57d5a1[_0xbb10('0x33')][_0xbb10('0x41')]){_0x514fdf[_0xbb10('0x3d')]=_[_0xbb10('0x46')](_0x514fdf[_0xbb10('0x3d')],{'$or':_[_0xbb10('0x42')](_0x514fdf['attributes'],function(_0x1e022d){var _0x123587={};_0x123587[_0x1e022d]={'$like':'%'+_0x57d5a1[_0xbb10('0x33')][_0xbb10('0x41')]+'%'};return _0x123587;})});}_0x514fdf=_[_0xbb10('0x46')]({},_0x514fdf,_0x57d5a1[_0xbb10('0x47')]);return _0xaede56[_0xbb10('0x7d')](_0x514fdf);}})[_0xbb10('0x28')](function(_0x3c6c45){if(_0x3c6c45){_0x5642c3=_0x3c6c45[_0xbb10('0x3b')];if(!_0x57d5a1[_0xbb10('0x33')]['hasOwnProperty'](_0xbb10('0x7e'))){_0x514fdf['limit']=qs[_0xbb10('0x23')](_0x57d5a1[_0xbb10('0x33')][_0xbb10('0x23')]);_0x514fdf[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x57d5a1[_0xbb10('0x33')]['offset']);}return _0xaede56[_0xbb10('0x7d')](_0x514fdf);}})['then'](function(_0xd82ce1){if(_0xd82ce1){return _0xd82ce1?{'count':_0x5642c3,'rows':_0xd82ce1}:null;}})[_0xbb10('0x28')](respondWithResult(_0x124b32,null))[_0xbb10('0x4c')](handleError(_0x124b32,null));};
\ No newline at end of file
+var _0x5f2f=['moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','count','offset','limit','set','reject','update','then','destroy','Teams','UserProfileResource','error','name','send','model','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','order','sort','where','pick','add','day','filter','merge','type','key','options','Team','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','Sequelize','ValidationError','ids','removeQueues','addAgents','each','chat','mail','sms','fax','openchannel','voice','User','loginInPause','interface','upsert','isNil','format','voicePause','omit','spread','emit','userTeam:save','removeAgents','UserVoiceQueueRt','userTeam:remove','map','getAgents','hasOwnProperty','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18b27e,_0x45810b){_0x18b27e=_0x18b27e-0x0;var _0x558ea2=_0x5f2f[_0x18b27e];return _0x558ea2;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var qs=require(_0xf5f2('0x12'));var logger=require('../../config/logger')(_0xf5f2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf5f2('0x14'))['db'];config[_0xf5f2('0x15')]=_['defaults'](config[_0xf5f2('0x15')],{'host':_0xf5f2('0x16'),'port':0x18eb});var socket=require(_0xf5f2('0x17'))(new Redis(config[_0xf5f2('0x15')]));require(_0xf5f2('0x18'))[_0xf5f2('0x19')](socket);function respondWithStatusCode(_0x5c01b8,_0x5850f4){_0x5850f4=_0x5850f4||0xcc;return function(_0xea612c){if(_0xea612c){return _0x5c01b8[_0xf5f2('0x1a')](_0x5850f4);}return _0x5c01b8[_0xf5f2('0x1b')](_0x5850f4)[_0xf5f2('0x1c')]();};}function respondWithResult(_0x4d97fc,_0xafe430){_0xafe430=_0xafe430||0xc8;return function(_0x286197){if(_0x286197){return _0x4d97fc[_0xf5f2('0x1b')](_0xafe430)[_0xf5f2('0x1d')](_0x286197);}};}function respondWithFilteredResult(_0x23e23a,_0x3a9dbb){return function(_0xdb61b3){if(_0xdb61b3){var _0x395a5a=_0xdb61b3[_0xf5f2('0x1e')],_0x11f702=_0x3a9dbb[_0xf5f2('0x1f')],_0x228ace=_0x3a9dbb[_0xf5f2('0x1f')]+_0x3a9dbb[_0xf5f2('0x20')],_0x20fccd;if(_0x228ace>=_0x395a5a){_0x228ace=_0x395a5a;_0x20fccd=0xc8;}else{_0x20fccd=0xce;}_0x23e23a[_0xf5f2('0x1b')](_0x20fccd);return _0x23e23a[_0xf5f2('0x21')]('Content-Range',_0x11f702+'-'+_0x228ace+'/'+_0x395a5a)[_0xf5f2('0x1d')](_0xdb61b3);}return null;};}function patchUpdates(_0x47101e){return function(_0x49dac2){try{jsonpatch['apply'](_0x49dac2,_0x47101e,!![]);}catch(_0x2d2805){return BPromise[_0xf5f2('0x22')](_0x2d2805);}return _0x49dac2['save']();};}function saveUpdates(_0x45b74f,_0x170042){return function(_0x39e44a){if(_0x39e44a){return _0x39e44a[_0xf5f2('0x23')](_0x45b74f)[_0xf5f2('0x24')](function(_0x4c691a){return _0x4c691a;});}return null;};}function removeEntity(_0x21cd91,_0x4669a6){return function(_0x4e8bda){if(_0x4e8bda){return _0x4e8bda[_0xf5f2('0x25')]()[_0xf5f2('0x24')](function(){var _0x5bdf4a=_0x4e8bda['get']({'plain':!![]});var _0x5f1124=_0xf5f2('0x26');return db[_0xf5f2('0x27')][_0xf5f2('0x25')]({'where':{'type':_0x5f1124,'resourceId':_0x5bdf4a['id']}})[_0xf5f2('0x24')](function(){return _0x4e8bda;});})[_0xf5f2('0x24')](function(){_0x21cd91[_0xf5f2('0x1b')](0xcc)[_0xf5f2('0x1c')]();});}};}function handleEntityNotFound(_0x294414,_0x4ab014){return function(_0xaa2602){if(!_0xaa2602){_0x294414[_0xf5f2('0x1a')](0x194);}return _0xaa2602;};}function handleError(_0x375ca8,_0x31bfcb){_0x31bfcb=_0x31bfcb||0x1f4;return function(_0x198c73){logger[_0xf5f2('0x28')](_0x198c73['stack']);if(_0x198c73['name']){delete _0x198c73[_0xf5f2('0x29')];}_0x375ca8[_0xf5f2('0x1b')](_0x31bfcb)[_0xf5f2('0x2a')](_0x198c73);};}exports['index']=function(_0x5a2c7e,_0x29571b){var _0x50b8a2={},_0x17394a={},_0x153924={'count':0x0,'rows':[]};var _0x1b381e=db['Team']['rawAttributes'];_0x17394a[_0xf5f2('0x2b')]=_['keys'](_0x1b381e);var _0xb744b9={'dateStart':_0x5a2c7e['query'][_0xf5f2('0x2c')],'dateEnd':_0x5a2c7e[_0xf5f2('0x2d')][_0xf5f2('0x2e')]};delete _0x5a2c7e[_0xf5f2('0x2d')][_0xf5f2('0x2c')];delete _0x5a2c7e[_0xf5f2('0x2d')][_0xf5f2('0x2e')];_0x17394a[_0xf5f2('0x2d')]=_['keys'](_0x5a2c7e[_0xf5f2('0x2d')]);_0x17394a[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x17394a[_0xf5f2('0x2b')],_0x17394a[_0xf5f2('0x2d')]);_0x50b8a2[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x17394a['model'],qs[_0xf5f2('0x32')](_0x5a2c7e[_0xf5f2('0x2d')]['fields']));_0x50b8a2[_0xf5f2('0x31')]=_0x50b8a2['attributes'][_0xf5f2('0x33')]?_0x50b8a2[_0xf5f2('0x31')]:_0x17394a[_0xf5f2('0x2b')];if(!_0x5a2c7e[_0xf5f2('0x2d')]['hasOwnProperty']('nolimit')){_0x50b8a2[_0xf5f2('0x20')]=qs[_0xf5f2('0x20')](_0x5a2c7e[_0xf5f2('0x2d')]['limit']);_0x50b8a2[_0xf5f2('0x1f')]=qs['offset'](_0x5a2c7e[_0xf5f2('0x2d')]['offset']);}_0x50b8a2[_0xf5f2('0x34')]=qs[_0xf5f2('0x35')](_0x5a2c7e['query'][_0xf5f2('0x35')]);_0x50b8a2[_0xf5f2('0x36')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x37')](_0x5a2c7e['query'],_0x17394a['filters']));if(_0xb744b9[_0xf5f2('0x2c')]){if(_0xb744b9[_0xf5f2('0x2e')]){_0xb744b9[_0xf5f2('0x2e')]=moment(_0xb744b9[_0xf5f2('0x2e')])[_0xf5f2('0x38')](0x1,_0xf5f2('0x39'));}else{_0xb744b9[_0xf5f2('0x2e')]=moment(_0xb744b9['dateStart'])[_0xf5f2('0x38')](0x1,_0xf5f2('0x39'));}_['merge'](_0x50b8a2[_0xf5f2('0x36')],{'createdAt':{'$gte':_0xb744b9[_0xf5f2('0x2c')],'$lte':_0xb744b9[_0xf5f2('0x2e')]}});}if(_0x5a2c7e[_0xf5f2('0x2d')][_0xf5f2('0x3a')]){_0x50b8a2[_0xf5f2('0x36')]=_[_0xf5f2('0x3b')](_0x50b8a2[_0xf5f2('0x36')],{'$or':_['map'](_0x1b381e,function(_0x31c3c){if(_0x31c3c[_0xf5f2('0x3c')][_0xf5f2('0x3d')]!=='VIRTUAL'){var _0x509dbc={};_0x509dbc[_0x31c3c['field']]={'$like':'%'+_0x5a2c7e[_0xf5f2('0x2d')][_0xf5f2('0x3a')]+'%'};return _0x509dbc;}})});}_0x50b8a2=_['merge']({},_0x50b8a2,_0x5a2c7e[_0xf5f2('0x3e')]);var _0xeed03d={'where':_0x50b8a2[_0xf5f2('0x36')]};return db[_0xf5f2('0x3f')][_0xf5f2('0x1e')](_0xeed03d)[_0xf5f2('0x24')](function(_0x1a6ec1){_0x153924[_0xf5f2('0x1e')]=_0x1a6ec1;if(_0x5a2c7e[_0xf5f2('0x2d')][_0xf5f2('0x40')]){_0x50b8a2[_0xf5f2('0x41')]=[{'all':!![]}];}return db[_0xf5f2('0x3f')][_0xf5f2('0x42')](_0x50b8a2);})[_0xf5f2('0x24')](function(_0x4faeed){_0x153924[_0xf5f2('0x43')]=_0x4faeed;return _0x153924;})['then'](respondWithFilteredResult(_0x29571b,_0x50b8a2))[_0xf5f2('0x44')](handleError(_0x29571b,null));};exports[_0xf5f2('0x45')]=function(_0x218def,_0x36a4b0){var _0x31bf0e={'raw':![],'where':{'id':_0x218def['params']['id']}},_0x3721c4={};_0x3721c4[_0xf5f2('0x2b')]=_[_0xf5f2('0x46')](db[_0xf5f2('0x3f')][_0xf5f2('0x47')]);_0x3721c4[_0xf5f2('0x2d')]=_[_0xf5f2('0x46')](_0x218def[_0xf5f2('0x2d')]);_0x3721c4[_0xf5f2('0x2f')]=_['intersection'](_0x3721c4[_0xf5f2('0x2b')],_0x3721c4[_0xf5f2('0x2d')]);_0x31bf0e[_0xf5f2('0x31')]=_['intersection'](_0x3721c4[_0xf5f2('0x2b')],qs[_0xf5f2('0x32')](_0x218def[_0xf5f2('0x2d')]['fields']));_0x31bf0e['attributes']=_0x31bf0e[_0xf5f2('0x31')][_0xf5f2('0x33')]?_0x31bf0e['attributes']:_0x3721c4[_0xf5f2('0x2b')];if(_0x218def['query'][_0xf5f2('0x40')]){_0x31bf0e['include']=[{'all':!![]}];}_0x31bf0e=_[_0xf5f2('0x3b')]({},_0x31bf0e,_0x218def['options']);return db[_0xf5f2('0x3f')][_0xf5f2('0x48')](_0x31bf0e)[_0xf5f2('0x24')](handleEntityNotFound(_0x36a4b0,null))[_0xf5f2('0x24')](respondWithResult(_0x36a4b0,null))['catch'](handleError(_0x36a4b0,null));};exports[_0xf5f2('0x49')]=function(_0x2b782f,_0x4f6b01){return db['Team'][_0xf5f2('0x49')](_0x2b782f[_0xf5f2('0x4a')],{})['then'](function(_0x22b645){var _0xe0ce7f=_0x2b782f[_0xf5f2('0x4b')][_0xf5f2('0x4c')]({'plain':!![]});if(!_0xe0ce7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe0ce7f['role']===_0xf5f2('0x4b')){var _0xa3cc67=_0x22b645['get']({'plain':!![]});var _0x40eef=_0xf5f2('0x26');return db[_0xf5f2('0x4d')][_0xf5f2('0x48')]({'where':{'name':_0x40eef,'userProfileId':_0xe0ce7f[_0xf5f2('0x4e')]},'raw':!![]})[_0xf5f2('0x24')](function(_0x14ee10){if(_0x14ee10&&_0x14ee10['autoAssociation']===0x0){return db['UserProfileResource'][_0xf5f2('0x49')]({'name':_0xa3cc67[_0xf5f2('0x29')],'resourceId':_0xa3cc67['id'],'type':_0x14ee10[_0xf5f2('0x29')],'sectionId':_0x14ee10['id']},{})[_0xf5f2('0x24')](function(){return _0x22b645;});}else{return _0x22b645;}})[_0xf5f2('0x44')](function(_0x5a861d){logger[_0xf5f2('0x28')](_0xf5f2('0x4f'),_0x5a861d);throw _0x5a861d;});}return _0x22b645;})[_0xf5f2('0x24')](respondWithResult(_0x4f6b01,0xc9))['catch'](handleError(_0x4f6b01,null));};exports[_0xf5f2('0x23')]=function(_0x4c749f,_0x78f1d2){if(_0x4c749f[_0xf5f2('0x4a')]['id']){delete _0x4c749f[_0xf5f2('0x4a')]['id'];}return db[_0xf5f2('0x3f')]['find']({'where':{'id':_0x4c749f['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x78f1d2,null))['then'](saveUpdates(_0x4c749f[_0xf5f2('0x4a')],null))[_0xf5f2('0x24')](respondWithResult(_0x78f1d2,null))['catch'](handleError(_0x78f1d2,null));};exports[_0xf5f2('0x25')]=function(_0xa4c0be,_0x2a8f6d){return db['Team'][_0xf5f2('0x48')]({'where':{'id':_0xa4c0be[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x2a8f6d,null))[_0xf5f2('0x24')](removeEntity(_0x2a8f6d,null))['catch'](handleError(_0x2a8f6d,null));};exports[_0xf5f2('0x51')]=function(_0x506fe5,_0x2cbe1e,_0x2a773d){return db[_0xf5f2('0x3f')][_0xf5f2('0x52')]({'where':{'id':_0x506fe5[_0xf5f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x2cbe1e,null))[_0xf5f2('0x24')](function(_0xacd80){if(!_0x506fe5[_0xf5f2('0x2d')][_0xf5f2('0x53')]||!utils[_0xf5f2('0x54')](_0x506fe5['query'][_0xf5f2('0x53')])){throw new db['Sequelize']['ValidationError'](_0xf5f2('0x55'));}var _0x4802c5={};var _0x10f2b8={};_0x10f2b8[_0xf5f2('0x2b')]=_[_0xf5f2('0x46')](db[_[_0xf5f2('0x56')](_0x506fe5['query'][_0xf5f2('0x53')][_0xf5f2('0x57')]())+_0xf5f2('0x58')][_0xf5f2('0x47')]);_0x10f2b8[_0xf5f2('0x2d')]=_[_0xf5f2('0x46')](_0x506fe5[_0xf5f2('0x2d')]);_0x10f2b8['filters']=_[_0xf5f2('0x30')](_0x10f2b8[_0xf5f2('0x2b')],_0x10f2b8[_0xf5f2('0x2d')]);_0x4802c5[_0xf5f2('0x31')]=_['intersection'](_0x10f2b8[_0xf5f2('0x2b')],qs['fields'](_0x506fe5[_0xf5f2('0x2d')][_0xf5f2('0x32')]));_0x4802c5['attributes']=_0x4802c5[_0xf5f2('0x31')][_0xf5f2('0x33')]?_0x4802c5[_0xf5f2('0x31')]:_0x10f2b8[_0xf5f2('0x2b')];_0x4802c5[_0xf5f2('0x20')]=qs['limit'](_0x506fe5[_0xf5f2('0x2d')][_0xf5f2('0x20')]);_0x4802c5[_0xf5f2('0x1f')]=qs[_0xf5f2('0x1f')](_0x506fe5[_0xf5f2('0x2d')][_0xf5f2('0x1f')]);_0x4802c5['order']=qs[_0xf5f2('0x35')](_0x506fe5[_0xf5f2('0x2d')]['sort']);_0x4802c5[_0xf5f2('0x36')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x37')](_0x506fe5['query'],_0x10f2b8['filters']));_0x4802c5=_['merge']({},_0x4802c5,_0x506fe5[_0xf5f2('0x3e')]);return _0xacd80[_0xf5f2('0x4c')+_[_0xf5f2('0x56')](_0x506fe5[_0xf5f2('0x2d')][_0xf5f2('0x53')]['toLowerCase']())+_0xf5f2('0x59')](_0x4802c5);})[_0xf5f2('0x24')](respondWithResult(_0x2cbe1e,null))[_0xf5f2('0x44')](handleError(_0x2cbe1e,null));};exports[_0xf5f2('0x5a')]=function(_0x794e0c,_0x1cbe86,_0x11c302){return db[_0xf5f2('0x3f')][_0xf5f2('0x52')]({'where':{'id':_0x794e0c[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x24')](function(_0x5679bc){if(_0x5679bc){if(!_0x794e0c['body']['channel']||!utils[_0xf5f2('0x54')](_0x794e0c[_0xf5f2('0x4a')][_0xf5f2('0x53')])){throw new db[(_0xf5f2('0x5b'))][(_0xf5f2('0x5c'))]('Unknown\x20channel');}return _0x5679bc[_0xf5f2('0x38')+_[_0xf5f2('0x56')](_0x794e0c[_0xf5f2('0x4a')][_0xf5f2('0x53')][_0xf5f2('0x57')]())+'Queues'](_0x794e0c[_0xf5f2('0x4a')][_0xf5f2('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x1cbe86,null))[_0xf5f2('0x24')](respondWithStatusCode(_0x1cbe86,null))[_0xf5f2('0x44')](handleError(_0x1cbe86,null));};exports[_0xf5f2('0x5e')]=function(_0x30ac41,_0x588434,_0x40b36e){return db[_0xf5f2('0x3f')][_0xf5f2('0x52')]({'where':{'id':_0x30ac41[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x24')](function(_0x4f47e1){if(_0x4f47e1){if(!_0x30ac41['query'][_0xf5f2('0x53')]||!utils[_0xf5f2('0x54')](_0x30ac41[_0xf5f2('0x2d')][_0xf5f2('0x53')])){throw new db['Sequelize']['ValidationError'](_0xf5f2('0x55'));}return _0x4f47e1['remove'+_['capitalize'](_0x30ac41['query']['channel'][_0xf5f2('0x57')]())+_0xf5f2('0x59')](_0x30ac41[_0xf5f2('0x2d')][_0xf5f2('0x5d')]);}return null;})[_0xf5f2('0x24')](handleEntityNotFound(_0x588434,null))[_0xf5f2('0x24')](respondWithStatusCode(_0x588434,null))[_0xf5f2('0x44')](handleError(_0x588434,null));};exports[_0xf5f2('0x5f')]=function(_0x421984,_0x26b251,_0x9afb3c){return db[_0xf5f2('0x3f')][_0xf5f2('0x48')]({'where':{'id':_0x421984[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x26b251,null))[_0xf5f2('0x24')](function(_0x154a8b){if(_0x154a8b){return BPromise[_0xf5f2('0x60')](['voice',_0xf5f2('0x61'),_0xf5f2('0x62'),_0xf5f2('0x63'),_0xf5f2('0x64'),_0xf5f2('0x65')],function(_0x308220){return _0x154a8b[_0xf5f2('0x4c')+_[_0xf5f2('0x56')](_0x308220)+'Queues']({'attributes':['id',_0xf5f2('0x29')]})['then'](function(_0x4bc51a){return BPromise['each'](_0x4bc51a,function(_0x53449e){return _0x53449e['addAgents'](_0x421984['body'][_0xf5f2('0x5d')])[_0xf5f2('0x24')](function(){if(_0x308220===_0xf5f2('0x66')){return db[_0xf5f2('0x67')][_0xf5f2('0x42')]({'where':{'id':_0x421984[_0xf5f2('0x4a')]['ids']},'attributes':['id','name',_0xf5f2('0x68'),'voicePause',_0xf5f2('0x69')],'raw':!![]});}})[_0xf5f2('0x24')](function(_0x59161c){if(_0x308220==='voice'){return BPromise[_0xf5f2('0x60')](_0x59161c,function(_0x274aa3){return db['UserVoiceQueueRt'][_0xf5f2('0x6a')]({'membername':_0x274aa3[_0xf5f2('0x29')],'UserId':_0x274aa3['id'],'queue_name':_0x53449e['name'],'VoiceQueueId':_0x53449e['id'],'interface':_[_0xf5f2('0x6b')](_0x274aa3[_0xf5f2('0x69')])?util[_0xf5f2('0x6c')]('SIP/%s',_0x274aa3[_0xf5f2('0x29')]):_0x274aa3[_0xf5f2('0x69')],'paused':_0x274aa3[_0xf5f2('0x6d')]||![],'penalty':0x0});});}});});})[_0xf5f2('0x24')](function(){return _0x154a8b;});})[_0xf5f2('0x24')](function(){return _0x154a8b;});}})[_0xf5f2('0x24')](function(_0x25974b){if(_0x25974b){return _0x25974b[_0xf5f2('0x5f')](_0x421984[_0xf5f2('0x4a')][_0xf5f2('0x5d')],_[_0xf5f2('0x6e')](_0x421984[_0xf5f2('0x4a')],[_0xf5f2('0x5d'),'id'])||{})[_0xf5f2('0x6f')](function(_0xe900ea){for(var _0x28b9cd=0x0;_0x28b9cd<_0x421984[_0xf5f2('0x4a')][_0xf5f2('0x5d')][_0xf5f2('0x33')];_0x28b9cd+=0x1){socket[_0xf5f2('0x70')](_0xf5f2('0x71'),{'UserId':_0x421984['body'][_0xf5f2('0x5d')][_0x28b9cd],'TeamId':_0x421984[_0xf5f2('0x50')]['id']});}return _0xe900ea;});}})['then'](respondWithResult(_0x26b251,null))[_0xf5f2('0x44')](handleError(_0x26b251,null));};exports[_0xf5f2('0x72')]=function(_0x4e0a34,_0xb56304,_0x2f54eb){var _0x335d9b;return db['Team']['find']({'where':{'id':_0x4e0a34[_0xf5f2('0x50')]['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0xb56304,null))[_0xf5f2('0x24')](function(_0x5ba275){if(_0x5ba275){return BPromise['each']([_0xf5f2('0x66'),_0xf5f2('0x61'),_0xf5f2('0x62'),'sms','fax','openchannel'],function(_0x53880f){return _0x5ba275['get'+_[_0xf5f2('0x56')](_0x53880f)+'Queues']({'attributes':['id',_0xf5f2('0x29')]})[_0xf5f2('0x24')](function(_0xec3c35){return BPromise[_0xf5f2('0x60')](_0xec3c35,function(_0x29ab74){return _0x29ab74[_0xf5f2('0x72')](_0x4e0a34[_0xf5f2('0x2d')][_0xf5f2('0x5d')])[_0xf5f2('0x24')](function(){if(_0x53880f===_0xf5f2('0x66')){return db[_0xf5f2('0x73')][_0xf5f2('0x25')]({'where':{'VoiceQueueId':_0x29ab74['id'],'UserId':_0x4e0a34[_0xf5f2('0x2d')]['ids']}});}});});})[_0xf5f2('0x24')](function(){return _0x5ba275;});})[_0xf5f2('0x24')](function(){return _0x5ba275;});}})['then'](function(_0x4c3369){if(_0x4c3369){return _0x4c3369[_0xf5f2('0x72')](_0x4e0a34['query'][_0xf5f2('0x5d')])[_0xf5f2('0x24')](function(_0x281f61){if(_['isArray'](_0x4e0a34[_0xf5f2('0x2d')][_0xf5f2('0x5d')])){for(var _0x59cab4=0x0;_0x59cab4<_0x4e0a34[_0xf5f2('0x2d')][_0xf5f2('0x5d')][_0xf5f2('0x33')];_0x59cab4+=0x1){socket['emit'](_0xf5f2('0x74'),{'UserId':_0x4e0a34['query'][_0xf5f2('0x5d')][_0x59cab4],'TeamId':_0x4e0a34['params']['id']});}}else{socket[_0xf5f2('0x70')](_0xf5f2('0x74'),{'UserId':_0x4e0a34[_0xf5f2('0x2d')][_0xf5f2('0x5d')],'TeamId':_0x4e0a34['params']['id']});}});}})[_0xf5f2('0x24')](respondWithStatusCode(_0xb56304,null))['catch'](handleError(_0xb56304,null));};exports['getAgents']=function(_0x4b4d7f,_0x2a253a,_0x3c47a6){var _0x5ece9e={};var _0x3c8a1b={};var _0x15025d;var _0x35790b;return db[_0xf5f2('0x3f')][_0xf5f2('0x52')]({'where':{'id':_0x4b4d7f[_0xf5f2('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a253a,null))[_0xf5f2('0x24')](function(_0x2b6763){if(_0x2b6763){_0x15025d=_0x2b6763;_0x3c8a1b['model']=_[_0xf5f2('0x46')](db[_0xf5f2('0x67')]['rawAttributes']);_0x3c8a1b[_0xf5f2('0x2d')]=_[_0xf5f2('0x46')](_0x4b4d7f[_0xf5f2('0x2d')]);_0x3c8a1b[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x3c8a1b[_0xf5f2('0x2b')],_0x3c8a1b['query']);_0x5ece9e[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3c8a1b[_0xf5f2('0x2b')],qs[_0xf5f2('0x32')](_0x4b4d7f[_0xf5f2('0x2d')][_0xf5f2('0x32')]));_0x5ece9e[_0xf5f2('0x31')]=_0x5ece9e[_0xf5f2('0x31')][_0xf5f2('0x33')]?_0x5ece9e['attributes']:_0x3c8a1b[_0xf5f2('0x2b')];_0x5ece9e[_0xf5f2('0x34')]=qs[_0xf5f2('0x35')](_0x4b4d7f[_0xf5f2('0x2d')][_0xf5f2('0x35')]);_0x5ece9e[_0xf5f2('0x36')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x37')](_0x4b4d7f[_0xf5f2('0x2d')],_0x3c8a1b[_0xf5f2('0x2f')]));if(_0x4b4d7f['query']['filter']){_0x5ece9e[_0xf5f2('0x36')]=_[_0xf5f2('0x3b')](_0x5ece9e[_0xf5f2('0x36')],{'$or':_[_0xf5f2('0x75')](_0x5ece9e['attributes'],function(_0x3d38d6){var _0xffb639={};_0xffb639[_0x3d38d6]={'$like':'%'+_0x4b4d7f[_0xf5f2('0x2d')][_0xf5f2('0x3a')]+'%'};return _0xffb639;})});}_0x5ece9e=_[_0xf5f2('0x3b')]({},_0x5ece9e,_0x4b4d7f['options']);return _0x15025d[_0xf5f2('0x76')](_0x5ece9e);}})[_0xf5f2('0x24')](function(_0x4bdb72){if(_0x4bdb72){_0x35790b=_0x4bdb72[_0xf5f2('0x33')];if(!_0x4b4d7f[_0xf5f2('0x2d')][_0xf5f2('0x77')](_0xf5f2('0x78'))){_0x5ece9e['limit']=qs[_0xf5f2('0x20')](_0x4b4d7f[_0xf5f2('0x2d')][_0xf5f2('0x20')]);_0x5ece9e['offset']=qs['offset'](_0x4b4d7f[_0xf5f2('0x2d')][_0xf5f2('0x1f')]);}return _0x15025d[_0xf5f2('0x76')](_0x5ece9e);}})[_0xf5f2('0x24')](function(_0xbe2fb6){if(_0xbe2fb6){return _0xbe2fb6?{'count':_0x35790b,'rows':_0xbe2fb6}:null;}})[_0xf5f2('0x24')](respondWithResult(_0x2a253a,null))['catch'](handleError(_0x2a253a,null));};
\ No newline at end of file
index 3754619..1a41794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d79=['hasOwnProperty','hook','events','../../mysqldb','Team','update','remove','emit'];(function(_0x5079f3,_0x40992f){var _0x4e4fa8=function(_0xb29faa){while(--_0xb29faa){_0x5079f3['push'](_0x5079f3['shift']());}};_0x4e4fa8(++_0x40992f);}(_0x8d79,0x10a));var _0x98d7=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8d79[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0x98d7('0x0'));var Team=require(_0x98d7('0x1'))['db'][_0x98d7('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x98d7('0x3'),'afterDestroy':_0x98d7('0x4')};function emitEvent(_0x17d888){return function(_0x556b27,_0x4d1db3,_0x4a824d){TeamEvents[_0x98d7('0x5')](_0x17d888+':'+_0x556b27['id'],_0x556b27);TeamEvents[_0x98d7('0x5')](_0x17d888,_0x556b27);_0x4a824d(null);};}for(var e in events){if(events[_0x98d7('0x6')](e)){var event=events[e];Team[_0x98d7('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
+var _0x60d7=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x5ab774,_0x3e7ffb){var _0x390bd9=function(_0x4fb080){while(--_0x4fb080){_0x5ab774['push'](_0x5ab774['shift']());}};_0x390bd9(++_0x3e7ffb);}(_0x60d7,0x17d));var _0x760d=function(_0x57e2fb,_0x32382d){_0x57e2fb=_0x57e2fb-0x0;var _0x2e545d=_0x60d7[_0x57e2fb];return _0x2e545d;};'use strict';var EventEmitter=require(_0x760d('0x0'));var Team=require(_0x760d('0x1'))['db'][_0x760d('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x760d('0x3')](0x0);var events={'afterCreate':_0x760d('0x4'),'afterUpdate':_0x760d('0x5'),'afterDestroy':_0x760d('0x6')};function emitEvent(_0x587ebf){return function(_0xff491c,_0x17294b,_0x3c8701){TeamEvents[_0x760d('0x7')](_0x587ebf+':'+_0xff491c['id'],_0xff491c);TeamEvents[_0x760d('0x7')](_0x587ebf,_0xff491c);_0x3c8701(null);};}for(var e in events){if(events[_0x760d('0x8')](e)){var event=events[e];Team[_0x760d('0x9')](e,emitEvent(event));}}module[_0x760d('0xa')]=TeamEvents;
\ No newline at end of file
index f586283..98ab007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['moment','./team.attributes','define','Team','teams','lodash','../../config/logger','api'];(function(_0x2aae10,_0x4c4283){var _0xc26056=function(_0x1fbf4c){while(--_0x1fbf4c){_0x2aae10['push'](_0x2aae10['shift']());}};_0xc26056(++_0x4c4283);}(_0x3e74,0x175));var _0x43e7=function(_0x393a0a,_0x1f7d72){_0x393a0a=_0x393a0a-0x0;var _0x4f4c94=_0x3e74[_0x393a0a];return _0x4f4c94;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x43e7('0x4'));module['exports']=function(_0x128b0f,_0xe838b4){return _0x128b0f[_0x43e7('0x5')](_0x43e7('0x6'),attributes,{'tableName':_0x43e7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['exports','define','teams','lodash','util','../../config/logger','bluebird','./team.attributes'];(function(_0x52dc60,_0x1ba181){var _0x56a7e4=function(_0x94b710){while(--_0x94b710){_0x52dc60['push'](_0x52dc60['shift']());}};_0x56a7e4(++_0x1ba181);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var attributes=require(_0x0a9e('0x4'));module[_0x0a9e('0x5')]=function(_0x2ab90b,_0x991246){return _0x2ab90b[_0x0a9e('0x6')]('Team',attributes,{'tableName':_0x0a9e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b53d271..1260d51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2202=['./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x45349b,_0x198248){var _0x3e0f23=function(_0x4026e5){while(--_0x4026e5){_0x45349b['push'](_0x45349b['shift']());}};_0x3e0f23(++_0x198248);}(_0x2202,0x12c));var _0x2220=function(_0x1a29c8,_0x4490b7){_0x1a29c8=_0x1a29c8-0x0;var _0x5e6869=_0x2202[_0x1a29c8];return _0x5e6869;};'use strict';var _=require(_0x2220('0x0'));var util=require('util');var moment=require(_0x2220('0x1'));var BPromise=require(_0x2220('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2220('0x3'))['db'];var utils=require(_0x2220('0x4'));var logger=require(_0x2220('0x5'))(_0x2220('0x6'));var config=require('../../config/environment');var jayson=require(_0x2220('0x7'));var client=jayson['client'][_0x2220('0x8')]({'port':0x232a});config[_0x2220('0x9')]=_[_0x2220('0xa')](config[_0x2220('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2220('0xb'))(new Redis(config['redis']));require(_0x2220('0xc'))['register'](socket);function respondWithRpcPromise(_0x1adc2b,_0x16279b,_0x10c6da){return new BPromise(function(_0xf607a8,_0x4f5392){return client[_0x2220('0xd')](_0x1adc2b,_0x10c6da)[_0x2220('0xe')](function(_0x11b423){logger[_0x2220('0xf')](_0x2220('0x10'),_0x16279b,_0x2220('0x11'));logger[_0x2220('0x12')](_0x2220('0x13'),_0x16279b,'request\x20sent',JSON[_0x2220('0x14')](_0x11b423));if(_0x11b423[_0x2220('0x15')]){if(_0x11b423[_0x2220('0x15')][_0x2220('0x16')]===0x1f4){logger[_0x2220('0x15')](_0x2220('0x10'),_0x16279b,_0x11b423[_0x2220('0x15')][_0x2220('0x17')]);return _0x4f5392(_0x11b423[_0x2220('0x15')][_0x2220('0x17')]);}logger[_0x2220('0x15')](_0x2220('0x10'),_0x16279b,_0x11b423[_0x2220('0x15')][_0x2220('0x17')]);return _0xf607a8(_0x11b423[_0x2220('0x15')][_0x2220('0x17')]);}else{logger[_0x2220('0xf')](_0x2220('0x10'),_0x16279b,_0x2220('0x11'));_0xf607a8(_0x11b423[_0x2220('0x18')][_0x2220('0x17')]);}})[_0x2220('0x19')](function(_0x5c1ea9){logger[_0x2220('0x15')](_0x2220('0x10'),_0x16279b,_0x5c1ea9);_0x4f5392(_0x5c1ea9);});});}
\ No newline at end of file
+var _0x4312=['request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','message','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./team.socket','register','request','Team,\x20%s,\x20%s'];(function(_0x4e8a1e,_0x1ae595){var _0x58e187=function(_0x37a0a2){while(--_0x37a0a2){_0x4e8a1e['push'](_0x4e8a1e['shift']());}};_0x58e187(++_0x1ae595);}(_0x4312,0xec));var _0x2431=function(_0x3e0816,_0x18d9d3){_0x3e0816=_0x3e0816-0x0;var _0x4386f2=_0x4312[_0x3e0816];return _0x4386f2;};'use strict';var _=require('lodash');var util=require(_0x2431('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2431('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2431('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2431('0x3'))(_0x2431('0x4'));var config=require(_0x2431('0x5'));var jayson=require(_0x2431('0x6'));var client=jayson[_0x2431('0x7')][_0x2431('0x8')]({'port':0x232a});config['redis']=_[_0x2431('0x9')](config[_0x2431('0xa')],{'host':_0x2431('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2431('0xa')]));require(_0x2431('0xc'))[_0x2431('0xd')](socket);function respondWithRpcPromise(_0x1c77ac,_0x3111ec,_0x4982ca){return new BPromise(function(_0x5552f4,_0x568756){return client[_0x2431('0xe')](_0x1c77ac,_0x4982ca)['then'](function(_0x30b524){logger['info'](_0x2431('0xf'),_0x3111ec,_0x2431('0x10'));logger[_0x2431('0x11')](_0x2431('0x12'),_0x3111ec,_0x2431('0x10'),JSON['stringify'](_0x30b524));if(_0x30b524[_0x2431('0x13')]){if(_0x30b524[_0x2431('0x13')]['code']===0x1f4){logger[_0x2431('0x13')](_0x2431('0xf'),_0x3111ec,_0x30b524[_0x2431('0x13')]['message']);return _0x568756(_0x30b524['error'][_0x2431('0x14')]);}logger[_0x2431('0x13')](_0x2431('0xf'),_0x3111ec,_0x30b524['error']['message']);return _0x5552f4(_0x30b524[_0x2431('0x13')][_0x2431('0x14')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x3111ec,'request\x20sent');_0x5552f4(_0x30b524['result'][_0x2431('0x14')]);}})['catch'](function(_0x3a4618){logger['error'](_0x2431('0xf'),_0x3111ec,_0x3a4618);_0x568756(_0x3a4618);});});}
\ No newline at end of file
index 6469ebf..58da4f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0be=['emit','removeListener','team:','./team.events','save','remove','update'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0xe0be,0x1c3));var _0xee0b=function(_0x3fe34c,_0x2a15b9){_0x3fe34c=_0x3fe34c-0x0;var _0x4a5413=_0xe0be[_0x3fe34c];return _0x4a5413;};'use strict';var TeamEvents=require(_0xee0b('0x0'));var events=[_0xee0b('0x1'),_0xee0b('0x2'),_0xee0b('0x3')];function createListener(_0x5f24fd,_0xc4fc00){return function(_0x2ec21c){_0xc4fc00[_0xee0b('0x4')](_0x5f24fd,_0x2ec21c);};}function removeListener(_0x2c2ecd,_0x307070){return function(){TeamEvents[_0xee0b('0x5')](_0x2c2ecd,_0x307070);};}exports['register']=function(_0x5db6a0){for(var _0x20b154=0x0,_0x3303bd=events['length'];_0x20b154<_0x3303bd;_0x20b154++){var _0x42d14b=events[_0x20b154];var _0x5c85a7=createListener(_0xee0b('0x6')+_0x42d14b,_0x5db6a0);TeamEvents['on'](_0x42d14b,_0x5c85a7);}};
\ No newline at end of file
+var _0x81d4=['length','team:','./team.events','save','remove','update','emit','register'];(function(_0x5e8ff8,_0x3e8081){var _0x258962=function(_0x4e5023){while(--_0x4e5023){_0x5e8ff8['push'](_0x5e8ff8['shift']());}};_0x258962(++_0x3e8081);}(_0x81d4,0x92));var _0x481d=function(_0x36c04e,_0x41ea8f){_0x36c04e=_0x36c04e-0x0;var _0x445a49=_0x81d4[_0x36c04e];return _0x445a49;};'use strict';var TeamEvents=require(_0x481d('0x0'));var events=[_0x481d('0x1'),_0x481d('0x2'),_0x481d('0x3')];function createListener(_0x3a088f,_0x1f62d7){return function(_0x5f562a){_0x1f62d7[_0x481d('0x4')](_0x3a088f,_0x5f562a);};}function removeListener(_0x465c82,_0x52b606){return function(){TeamEvents['removeListener'](_0x465c82,_0x52b606);};}exports[_0x481d('0x5')]=function(_0x44e3d9){for(var _0x1702b2=0x0,_0x209359=events[_0x481d('0x6')];_0x1702b2<_0x209359;_0x1702b2++){var _0x272863=events[_0x1702b2];var _0x23aad2=createListener(_0x481d('0x7')+_0x272863,_0x44e3d9);TeamEvents['on'](_0x272863,_0x23aad2);}};
\ No newline at end of file
index 1eabc9d..fbcc3b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa715=['show','create','put','delete','destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0xa715,0xe6));var _0x5a71=function(_0x3b3295,_0x3e8170){_0x3b3295=_0x3b3295-0x0;var _0x3c60f4=_0xa715[_0x3b3295];return _0x3c60f4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a71('0x0'));var timeout=require(_0x5a71('0x1'));var express=require('express');var router=express[_0x5a71('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5a71('0x3'));var config=require(_0x5a71('0x4'));var controller=require(_0x5a71('0x5'));router[_0x5a71('0x6')]('/',auth[_0x5a71('0x7')](),controller[_0x5a71('0x8')]);router[_0x5a71('0x6')](_0x5a71('0x9'),auth[_0x5a71('0x7')](),controller[_0x5a71('0xa')]);router['post']('/',auth[_0x5a71('0x7')](),controller[_0x5a71('0xb')]);router[_0x5a71('0xc')](_0x5a71('0x9'),auth[_0x5a71('0x7')](),controller['update']);router[_0x5a71('0xd')](_0x5a71('0x9'),auth[_0x5a71('0x7')](),controller[_0x5a71('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x9867=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2d7bf5,_0xf16275){var _0x51d043=function(_0x58137b){while(--_0x58137b){_0x2d7bf5['push'](_0x2d7bf5['shift']());}};_0x51d043(++_0xf16275);}(_0x9867,0xea));var _0x7986=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9867[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7986('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7986('0x1'));var express=require(_0x7986('0x2'));var router=express[_0x7986('0x3')]();var auth=require(_0x7986('0x4'));var interaction=require(_0x7986('0x5'));var config=require('../../config/environment');var controller=require(_0x7986('0x6'));router['get']('/',auth[_0x7986('0x7')](),controller[_0x7986('0x8')]);router['get'](_0x7986('0x9'),auth['isAuthenticated'](),controller[_0x7986('0xa')]);router[_0x7986('0xb')]('/',auth['isAuthenticated'](),controller[_0x7986('0xc')]);router[_0x7986('0xd')](_0x7986('0x9'),auth[_0x7986('0x7')](),controller[_0x7986('0xe')]);router[_0x7986('0xf')](_0x7986('0x9'),auth[_0x7986('0x7')](),controller[_0x7986('0x10')]);module[_0x7986('0x11')]=router;
\ No newline at end of file
index f41ad82..100a186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a7d=['sequelize','exports','STRING','TEXT'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x0a7d,0x160));var _0xd0a7=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0x0a7d[_0x48c4ef];return _0x435715;};'use strict';var Sequelize=require(_0xd0a7('0x0'));module[_0xd0a7('0x1')]={'name':{'type':Sequelize[_0xd0a7('0x2')]},'description':{'type':Sequelize[_0xd0a7('0x2')]},'html':{'type':Sequelize[_0xd0a7('0x3')]}};
\ No newline at end of file
+var _0xab52=['STRING','sequelize'];(function(_0x1db787,_0x3ecef9){var _0x2c8a5b=function(_0xdef678){while(--_0xdef678){_0x1db787['push'](_0x1db787['shift']());}};_0x2c8a5b(++_0x3ecef9);}(_0xab52,0xdd));var _0x2ab5=function(_0x49cdfa,_0x219c2e){_0x49cdfa=_0x49cdfa-0x0;var _0x33223a=_0xab52[_0x49cdfa];return _0x33223a;};'use strict';var Sequelize=require(_0x2ab5('0x0'));module['exports']={'name':{'type':Sequelize[_0x2ab5('0x1')]},'description':{'type':Sequelize[_0x2ab5('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index bab32c8..1a76bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['add','day','merge','map','type','key','filter','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','create','body','get','role','Templates','find','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','UserProfileResource','destroy','error','name','send','Template','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x27e4bc,_0x1f1775){var _0x1db4d6=function(_0x320032){while(--_0x320032){_0x27e4bc['push'](_0x27e4bc['shift']());}};_0x1db4d6(++_0x1f1775);}(_0x781d,0x14a));var _0xd781=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x781d[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0xd781('0x0'));var emlformat=require(_0xd781('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd781('0x2'));var rp=require(_0xd781('0x3'));var moment=require(_0xd781('0x4'));var BPromise=require(_0xd781('0x5'));var Mustache=require(_0xd781('0x6'));var util=require(_0xd781('0x7'));var path=require(_0xd781('0x8'));var sox=require(_0xd781('0x9'));var csv=require(_0xd781('0xa'));var ejs=require(_0xd781('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var qs=require(_0xd781('0x12'));var logger=require('../../config/logger')(_0xd781('0x13'));var utils=require(_0xd781('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40a900,_0x28b74c){_0x28b74c=_0x28b74c||0xcc;return function(_0x36f086){if(_0x36f086){return _0x40a900[_0xd781('0x15')](_0x28b74c);}return _0x40a900[_0xd781('0x16')](_0x28b74c)[_0xd781('0x17')]();};}function respondWithResult(_0xc7758f,_0x3eb78){_0x3eb78=_0x3eb78||0xc8;return function(_0xb895a1){if(_0xb895a1){return _0xc7758f[_0xd781('0x16')](_0x3eb78)[_0xd781('0x18')](_0xb895a1);}};}function respondWithFilteredResult(_0x587953,_0x477bdc){return function(_0x115e00){if(_0x115e00){var _0x498674=_0x115e00[_0xd781('0x19')],_0x3a1f48=_0x477bdc[_0xd781('0x1a')],_0x48bffc=_0x477bdc[_0xd781('0x1a')]+_0x477bdc[_0xd781('0x1b')],_0x294e5a;if(_0x48bffc>=_0x498674){_0x48bffc=_0x498674;_0x294e5a=0xc8;}else{_0x294e5a=0xce;}_0x587953[_0xd781('0x16')](_0x294e5a);return _0x587953[_0xd781('0x1c')]('Content-Range',_0x3a1f48+'-'+_0x48bffc+'/'+_0x498674)[_0xd781('0x18')](_0x115e00);}return null;};}function patchUpdates(_0x3f2922){return function(_0x395d9c){try{jsonpatch[_0xd781('0x1d')](_0x395d9c,_0x3f2922,!![]);}catch(_0x3bf805){return BPromise[_0xd781('0x1e')](_0x3bf805);}return _0x395d9c[_0xd781('0x1f')]();};}function saveUpdates(_0x1d6fc7,_0x5a5ff5){return function(_0x32e15e){if(_0x32e15e){return _0x32e15e[_0xd781('0x20')](_0x1d6fc7)[_0xd781('0x21')](function(_0x103758){return _0x103758;});}return null;};}function removeEntity(_0x36d320,_0x274665){return function(_0x1adcbd){if(_0x1adcbd){return _0x1adcbd['destroy']()[_0xd781('0x21')](function(){var _0x4e2c56=_0x1adcbd['get']({'plain':!![]});var _0x187a5a='Templates';return db[_0xd781('0x22')][_0xd781('0x23')]({'where':{'type':_0x187a5a,'resourceId':_0x4e2c56['id']}})[_0xd781('0x21')](function(){return _0x1adcbd;});})[_0xd781('0x21')](function(){_0x36d320[_0xd781('0x16')](0xcc)[_0xd781('0x17')]();});}};}function handleEntityNotFound(_0x221f14,_0x316d43){return function(_0x10940b){if(!_0x10940b){_0x221f14['sendStatus'](0x194);}return _0x10940b;};}function handleError(_0x529ca1,_0x3f575a){_0x3f575a=_0x3f575a||0x1f4;return function(_0x849587){logger[_0xd781('0x24')](_0x849587['stack']);if(_0x849587[_0xd781('0x25')]){delete _0x849587['name'];}_0x529ca1['status'](_0x3f575a)[_0xd781('0x26')](_0x849587);};}exports['index']=function(_0x3e868,_0x123a6a){var _0x5c3848={},_0x5b6b9d={},_0x43cc74={'count':0x0,'rows':[]};var _0x5b0464=db[_0xd781('0x27')]['rawAttributes'];_0x5b6b9d[_0xd781('0x28')]=_[_0xd781('0x29')](_0x5b0464);var _0x556127={'dateStart':_0x3e868['query'][_0xd781('0x2a')],'dateEnd':_0x3e868[_0xd781('0x2b')][_0xd781('0x2c')]};delete _0x3e868['query']['dateStart'];delete _0x3e868[_0xd781('0x2b')][_0xd781('0x2c')];_0x5b6b9d[_0xd781('0x2b')]=_['keys'](_0x3e868['query']);_0x5b6b9d[_0xd781('0x2d')]=_[_0xd781('0x2e')](_0x5b6b9d['model'],_0x5b6b9d[_0xd781('0x2b')]);_0x5c3848[_0xd781('0x2f')]=_['intersection'](_0x5b6b9d[_0xd781('0x28')],qs[_0xd781('0x30')](_0x3e868[_0xd781('0x2b')][_0xd781('0x30')]));_0x5c3848['attributes']=_0x5c3848[_0xd781('0x2f')][_0xd781('0x31')]?_0x5c3848[_0xd781('0x2f')]:_0x5b6b9d[_0xd781('0x28')];if(!_0x3e868['query'][_0xd781('0x32')](_0xd781('0x33'))){_0x5c3848['limit']=qs[_0xd781('0x1b')](_0x3e868['query'][_0xd781('0x1b')]);_0x5c3848[_0xd781('0x1a')]=qs['offset'](_0x3e868[_0xd781('0x2b')][_0xd781('0x1a')]);}_0x5c3848['order']=qs[_0xd781('0x34')](_0x3e868['query'][_0xd781('0x34')]);_0x5c3848[_0xd781('0x35')]=qs['filters'](_[_0xd781('0x36')](_0x3e868[_0xd781('0x2b')],_0x5b6b9d['filters']));if(_0x556127[_0xd781('0x2a')]){if(_0x556127[_0xd781('0x2c')]){_0x556127[_0xd781('0x2c')]=moment(_0x556127['dateEnd'])[_0xd781('0x37')](0x1,_0xd781('0x38'));}else{_0x556127[_0xd781('0x2c')]=moment(_0x556127[_0xd781('0x2a')])[_0xd781('0x37')](0x1,_0xd781('0x38'));}_[_0xd781('0x39')](_0x5c3848[_0xd781('0x35')],{'createdAt':{'$gte':_0x556127[_0xd781('0x2a')],'$lte':_0x556127['dateEnd']}});}if(_0x3e868[_0xd781('0x2b')]['filter']){_0x5c3848[_0xd781('0x35')]=_[_0xd781('0x39')](_0x5c3848['where'],{'$or':_[_0xd781('0x3a')](_0x5b0464,function(_0x3d49f4){if(_0x3d49f4[_0xd781('0x3b')][_0xd781('0x3c')]!=='VIRTUAL'){var _0x242381={};_0x242381[_0x3d49f4['field']]={'$like':'%'+_0x3e868[_0xd781('0x2b')][_0xd781('0x3d')]+'%'};return _0x242381;}})});}_0x5c3848=_['merge']({},_0x5c3848,_0x3e868['options']);var _0x1fb267={'where':_0x5c3848[_0xd781('0x35')]};return db[_0xd781('0x27')][_0xd781('0x19')](_0x1fb267)['then'](function(_0x46e7f6){_0x43cc74[_0xd781('0x19')]=_0x46e7f6;if(_0x3e868['query']['includeAll']){_0x5c3848[_0xd781('0x3e')]=[{'all':!![]}];}return db[_0xd781('0x27')][_0xd781('0x3f')](_0x5c3848);})['then'](function(_0x594f85){_0x43cc74[_0xd781('0x40')]=_0x594f85;return _0x43cc74;})[_0xd781('0x21')](respondWithFilteredResult(_0x123a6a,_0x5c3848))[_0xd781('0x41')](handleError(_0x123a6a,null));};exports[_0xd781('0x42')]=function(_0x43b9ac,_0x15f584){var _0x557078={'raw':!![],'where':{'id':_0x43b9ac[_0xd781('0x43')]['id']}},_0x5d1c9a={};_0x5d1c9a[_0xd781('0x28')]=_[_0xd781('0x29')](db[_0xd781('0x27')][_0xd781('0x44')]);_0x5d1c9a['query']=_[_0xd781('0x29')](_0x43b9ac[_0xd781('0x2b')]);_0x5d1c9a[_0xd781('0x2d')]=_['intersection'](_0x5d1c9a[_0xd781('0x28')],_0x5d1c9a[_0xd781('0x2b')]);_0x557078[_0xd781('0x2f')]=_['intersection'](_0x5d1c9a[_0xd781('0x28')],qs[_0xd781('0x30')](_0x43b9ac['query']['fields']));_0x557078[_0xd781('0x2f')]=_0x557078[_0xd781('0x2f')][_0xd781('0x31')]?_0x557078['attributes']:_0x5d1c9a[_0xd781('0x28')];if(_0x43b9ac[_0xd781('0x2b')][_0xd781('0x45')]){_0x557078[_0xd781('0x3e')]=[{'all':!![]}];}_0x557078=_[_0xd781('0x39')]({},_0x557078,_0x43b9ac[_0xd781('0x46')]);return db[_0xd781('0x27')]['find'](_0x557078)[_0xd781('0x21')](handleEntityNotFound(_0x15f584,null))[_0xd781('0x21')](respondWithResult(_0x15f584,null))[_0xd781('0x41')](handleError(_0x15f584,null));};exports['create']=function(_0x1cdff5,_0x1cfdbc){return db['Template'][_0xd781('0x47')](_0x1cdff5[_0xd781('0x48')],{})[_0xd781('0x21')](function(_0x207546){var _0x42a2f9=_0x1cdff5['user'][_0xd781('0x49')]({'plain':!![]});if(!_0x42a2f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42a2f9[_0xd781('0x4a')]==='user'){var _0x2ce1f6=_0x207546[_0xd781('0x49')]({'plain':!![]});var _0x4f9e37=_0xd781('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x4f9e37,'userProfileId':_0x42a2f9['userProfileId']},'raw':!![]})[_0xd781('0x21')](function(_0x174fcd){if(_0x174fcd&&_0x174fcd['autoAssociation']===0x0){return db[_0xd781('0x22')]['create']({'name':_0x2ce1f6[_0xd781('0x25')],'resourceId':_0x2ce1f6['id'],'type':_0x174fcd[_0xd781('0x25')],'sectionId':_0x174fcd['id']},{})[_0xd781('0x21')](function(){return _0x207546;});}else{return _0x207546;}})[_0xd781('0x41')](function(_0x5d95fa){logger[_0xd781('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d95fa);throw _0x5d95fa;});}return _0x207546;})[_0xd781('0x21')](respondWithResult(_0x1cfdbc,0xc9))['catch'](handleError(_0x1cfdbc,null));};exports[_0xd781('0x20')]=function(_0x3b7f12,_0x5644bf){if(_0x3b7f12[_0xd781('0x48')]['id']){delete _0x3b7f12[_0xd781('0x48')]['id'];}return db[_0xd781('0x27')][_0xd781('0x4c')]({'where':{'id':_0x3b7f12[_0xd781('0x43')]['id']}})[_0xd781('0x21')](handleEntityNotFound(_0x5644bf,null))['then'](saveUpdates(_0x3b7f12['body'],null))[_0xd781('0x21')](respondWithResult(_0x5644bf,null))[_0xd781('0x41')](handleError(_0x5644bf,null));};exports[_0xd781('0x23')]=function(_0x15cad9,_0x5e995c){return db[_0xd781('0x27')]['find']({'where':{'id':_0x15cad9[_0xd781('0x43')]['id']}})[_0xd781('0x21')](handleEntityNotFound(_0x5e995c,null))[_0xd781('0x21')](removeEntity(_0x5e995c,null))[_0xd781('0x41')](handleError(_0x5e995c,null));};
\ No newline at end of file
+var _0x2ef3=['findAll','rows','catch','show','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','get','sendStatus','error','stack','name','send','index','Template','rawAttributes','model','query','dateStart','dateEnd','keys','intersection','attributes','length','order','sort','where','filters','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','count','includeAll'];(function(_0x57aa33,_0x23a313){var _0x495d20=function(_0x2c8082){while(--_0x2c8082){_0x57aa33['push'](_0x57aa33['shift']());}};_0x495d20(++_0x23a313);}(_0x2ef3,0xba));var _0x32ef=function(_0x57cdcd,_0x426146){_0x57cdcd=_0x57cdcd-0x0;var _0x6e27ba=_0x2ef3[_0x57cdcd];return _0x6e27ba;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var qs=require(_0x32ef('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x32ef('0x14'));var config=require(_0x32ef('0x15'));var db=require(_0x32ef('0x16'))['db'];function respondWithStatusCode(_0x1499c2,_0x5af651){_0x5af651=_0x5af651||0xcc;return function(_0x193714){if(_0x193714){return _0x1499c2['sendStatus'](_0x5af651);}return _0x1499c2[_0x32ef('0x17')](_0x5af651)['end']();};}function respondWithResult(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xc8;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['status'](_0x1ef1ae)[_0x32ef('0x18')](_0x5c3eb9);}};}function respondWithFilteredResult(_0x4d8009,_0x326fce){return function(_0x40a6e6){if(_0x40a6e6){var _0x93d492=_0x40a6e6['count'],_0x54c7f5=_0x326fce[_0x32ef('0x19')],_0x57aff1=_0x326fce[_0x32ef('0x19')]+_0x326fce[_0x32ef('0x1a')],_0x55bf0b;if(_0x57aff1>=_0x93d492){_0x57aff1=_0x93d492;_0x55bf0b=0xc8;}else{_0x55bf0b=0xce;}_0x4d8009['status'](_0x55bf0b);return _0x4d8009['set'](_0x32ef('0x1b'),_0x54c7f5+'-'+_0x57aff1+'/'+_0x93d492)[_0x32ef('0x18')](_0x40a6e6);}return null;};}function patchUpdates(_0x286bfb){return function(_0x57863c){try{jsonpatch[_0x32ef('0x1c')](_0x57863c,_0x286bfb,!![]);}catch(_0x33e230){return BPromise['reject'](_0x33e230);}return _0x57863c[_0x32ef('0x1d')]();};}function saveUpdates(_0x314ef1,_0x26aff3){return function(_0x251084){if(_0x251084){return _0x251084[_0x32ef('0x1e')](_0x314ef1)[_0x32ef('0x1f')](function(_0x4de441){return _0x4de441;});}return null;};}function removeEntity(_0x3c5b78,_0x5cc3ef){return function(_0x309866){if(_0x309866){return _0x309866[_0x32ef('0x20')]()['then'](function(){var _0x1af371=_0x309866[_0x32ef('0x21')]({'plain':!![]});var _0x5e8898='Templates';return db['UserProfileResource'][_0x32ef('0x20')]({'where':{'type':_0x5e8898,'resourceId':_0x1af371['id']}})[_0x32ef('0x1f')](function(){return _0x309866;});})[_0x32ef('0x1f')](function(){_0x3c5b78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ea6,_0x4d584b){return function(_0x51a412){if(!_0x51a412){_0x19ea6[_0x32ef('0x22')](0x194);}return _0x51a412;};}function handleError(_0x14d4b3,_0x371540){_0x371540=_0x371540||0x1f4;return function(_0x1dbe98){logger[_0x32ef('0x23')](_0x1dbe98[_0x32ef('0x24')]);if(_0x1dbe98[_0x32ef('0x25')]){delete _0x1dbe98[_0x32ef('0x25')];}_0x14d4b3[_0x32ef('0x17')](_0x371540)[_0x32ef('0x26')](_0x1dbe98);};}exports[_0x32ef('0x27')]=function(_0xba4b3f,_0x5a88a5){var _0xd65fde={},_0x2f5d06={},_0x5a04cd={'count':0x0,'rows':[]};var _0x12de1a=db[_0x32ef('0x28')][_0x32ef('0x29')];_0x2f5d06[_0x32ef('0x2a')]=_['keys'](_0x12de1a);var _0x10e38c={'dateStart':_0xba4b3f[_0x32ef('0x2b')][_0x32ef('0x2c')],'dateEnd':_0xba4b3f[_0x32ef('0x2b')][_0x32ef('0x2d')]};delete _0xba4b3f[_0x32ef('0x2b')][_0x32ef('0x2c')];delete _0xba4b3f['query'][_0x32ef('0x2d')];_0x2f5d06['query']=_[_0x32ef('0x2e')](_0xba4b3f[_0x32ef('0x2b')]);_0x2f5d06['filters']=_[_0x32ef('0x2f')](_0x2f5d06[_0x32ef('0x2a')],_0x2f5d06[_0x32ef('0x2b')]);_0xd65fde[_0x32ef('0x30')]=_[_0x32ef('0x2f')](_0x2f5d06['model'],qs['fields'](_0xba4b3f[_0x32ef('0x2b')]['fields']));_0xd65fde[_0x32ef('0x30')]=_0xd65fde[_0x32ef('0x30')][_0x32ef('0x31')]?_0xd65fde[_0x32ef('0x30')]:_0x2f5d06[_0x32ef('0x2a')];if(!_0xba4b3f[_0x32ef('0x2b')]['hasOwnProperty']('nolimit')){_0xd65fde['limit']=qs[_0x32ef('0x1a')](_0xba4b3f[_0x32ef('0x2b')][_0x32ef('0x1a')]);_0xd65fde['offset']=qs['offset'](_0xba4b3f[_0x32ef('0x2b')][_0x32ef('0x19')]);}_0xd65fde[_0x32ef('0x32')]=qs['sort'](_0xba4b3f['query'][_0x32ef('0x33')]);_0xd65fde[_0x32ef('0x34')]=qs[_0x32ef('0x35')](_[_0x32ef('0x36')](_0xba4b3f[_0x32ef('0x2b')],_0x2f5d06[_0x32ef('0x35')]));if(_0x10e38c[_0x32ef('0x2c')]){if(_0x10e38c[_0x32ef('0x2d')]){_0x10e38c[_0x32ef('0x2d')]=moment(_0x10e38c['dateEnd'])[_0x32ef('0x37')](0x1,_0x32ef('0x38'));}else{_0x10e38c[_0x32ef('0x2d')]=moment(_0x10e38c['dateStart'])[_0x32ef('0x37')](0x1,_0x32ef('0x38'));}_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x34')],{'createdAt':{'$gte':_0x10e38c[_0x32ef('0x2c')],'$lte':_0x10e38c[_0x32ef('0x2d')]}});}if(_0xba4b3f[_0x32ef('0x2b')][_0x32ef('0x3a')]){_0xd65fde[_0x32ef('0x34')]=_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x34')],{'$or':_[_0x32ef('0x3b')](_0x12de1a,function(_0x48e071){if(_0x48e071[_0x32ef('0x3c')][_0x32ef('0x3d')]!==_0x32ef('0x3e')){var _0x1733e3={};_0x1733e3[_0x48e071[_0x32ef('0x3f')]]={'$like':'%'+_0xba4b3f[_0x32ef('0x2b')][_0x32ef('0x3a')]+'%'};return _0x1733e3;}})});}_0xd65fde=_['merge']({},_0xd65fde,_0xba4b3f['options']);var _0x399caa={'where':_0xd65fde[_0x32ef('0x34')]};return db[_0x32ef('0x28')][_0x32ef('0x40')](_0x399caa)['then'](function(_0x2901a1){_0x5a04cd[_0x32ef('0x40')]=_0x2901a1;if(_0xba4b3f['query'][_0x32ef('0x41')]){_0xd65fde['include']=[{'all':!![]}];}return db[_0x32ef('0x28')][_0x32ef('0x42')](_0xd65fde);})[_0x32ef('0x1f')](function(_0x3be46d){_0x5a04cd[_0x32ef('0x43')]=_0x3be46d;return _0x5a04cd;})[_0x32ef('0x1f')](respondWithFilteredResult(_0x5a88a5,_0xd65fde))[_0x32ef('0x44')](handleError(_0x5a88a5,null));};exports[_0x32ef('0x45')]=function(_0x3de659,_0x37da36){var _0x57800c={'raw':!![],'where':{'id':_0x3de659['params']['id']}},_0x18b943={};_0x18b943[_0x32ef('0x2a')]=_[_0x32ef('0x2e')](db[_0x32ef('0x28')]['rawAttributes']);_0x18b943[_0x32ef('0x2b')]=_[_0x32ef('0x2e')](_0x3de659[_0x32ef('0x2b')]);_0x18b943[_0x32ef('0x35')]=_[_0x32ef('0x2f')](_0x18b943[_0x32ef('0x2a')],_0x18b943[_0x32ef('0x2b')]);_0x57800c['attributes']=_['intersection'](_0x18b943[_0x32ef('0x2a')],qs[_0x32ef('0x46')](_0x3de659[_0x32ef('0x2b')][_0x32ef('0x46')]));_0x57800c[_0x32ef('0x30')]=_0x57800c[_0x32ef('0x30')][_0x32ef('0x31')]?_0x57800c[_0x32ef('0x30')]:_0x18b943[_0x32ef('0x2a')];if(_0x3de659[_0x32ef('0x2b')][_0x32ef('0x41')]){_0x57800c[_0x32ef('0x47')]=[{'all':!![]}];}_0x57800c=_[_0x32ef('0x39')]({},_0x57800c,_0x3de659['options']);return db[_0x32ef('0x28')][_0x32ef('0x48')](_0x57800c)[_0x32ef('0x1f')](handleEntityNotFound(_0x37da36,null))[_0x32ef('0x1f')](respondWithResult(_0x37da36,null))[_0x32ef('0x44')](handleError(_0x37da36,null));};exports[_0x32ef('0x49')]=function(_0x278696,_0x1acded){return db[_0x32ef('0x28')][_0x32ef('0x49')](_0x278696[_0x32ef('0x4a')],{})[_0x32ef('0x1f')](function(_0x272377){var _0x326445=_0x278696[_0x32ef('0x4b')][_0x32ef('0x21')]({'plain':!![]});if(!_0x326445)throw new Error(_0x32ef('0x4c'));if(_0x326445[_0x32ef('0x4d')]==='user'){var _0x515ac9=_0x272377[_0x32ef('0x21')]({'plain':!![]});var _0x259c32=_0x32ef('0x4e');return db[_0x32ef('0x4f')][_0x32ef('0x48')]({'where':{'name':_0x259c32,'userProfileId':_0x326445[_0x32ef('0x50')]},'raw':!![]})[_0x32ef('0x1f')](function(_0x1f105a){if(_0x1f105a&&_0x1f105a[_0x32ef('0x51')]===0x0){return db[_0x32ef('0x52')][_0x32ef('0x49')]({'name':_0x515ac9['name'],'resourceId':_0x515ac9['id'],'type':_0x1f105a[_0x32ef('0x25')],'sectionId':_0x1f105a['id']},{})[_0x32ef('0x1f')](function(){return _0x272377;});}else{return _0x272377;}})[_0x32ef('0x44')](function(_0x3fe01f){logger[_0x32ef('0x23')](_0x32ef('0x53'),_0x3fe01f);throw _0x3fe01f;});}return _0x272377;})['then'](respondWithResult(_0x1acded,0xc9))[_0x32ef('0x44')](handleError(_0x1acded,null));};exports[_0x32ef('0x1e')]=function(_0x31d5d8,_0x56b7ce){if(_0x31d5d8[_0x32ef('0x4a')]['id']){delete _0x31d5d8['body']['id'];}return db[_0x32ef('0x28')][_0x32ef('0x48')]({'where':{'id':_0x31d5d8['params']['id']}})[_0x32ef('0x1f')](handleEntityNotFound(_0x56b7ce,null))['then'](saveUpdates(_0x31d5d8[_0x32ef('0x4a')],null))[_0x32ef('0x1f')](respondWithResult(_0x56b7ce,null))[_0x32ef('0x44')](handleError(_0x56b7ce,null));};exports[_0x32ef('0x20')]=function(_0x2c7bee,_0x30e377){return db[_0x32ef('0x28')]['find']({'where':{'id':_0x2c7bee['params']['id']}})[_0x32ef('0x1f')](handleEntityNotFound(_0x30e377,null))['then'](removeEntity(_0x30e377,null))['catch'](handleError(_0x30e377,null));};
\ No newline at end of file
index 2a2e9b1..e22ddb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c3=['api','moment','bluebird','request-promise','./template.attributes','define','Template','lodash','util','../../config/logger'];(function(_0x37546a,_0x51ed8b){var _0x3c182a=function(_0x2c9bcc){while(--_0x2c9bcc){_0x37546a['push'](_0x37546a['shift']());}};_0x3c182a(++_0x51ed8b);}(_0x19c3,0x115));var _0x319c=function(_0x3f9588,_0x4b26c2){_0x3f9588=_0x3f9588-0x0;var _0x25d35a=_0x19c3[_0x3f9588];return _0x25d35a;};'use strict';var _=require(_0x319c('0x0'));var util=require(_0x319c('0x1'));var logger=require(_0x319c('0x2'))(_0x319c('0x3'));var moment=require(_0x319c('0x4'));var BPromise=require(_0x319c('0x5'));var rp=require(_0x319c('0x6'));var attributes=require(_0x319c('0x7'));module['exports']=function(_0x403424,_0x1c0db5){return _0x403424[_0x319c('0x8')](_0x319c('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x09b1=['api','moment','request-promise','exports','define','Template','tools_templates','lodash','util'];(function(_0x54b907,_0x29ff96){var _0x363d89=function(_0x184d8f){while(--_0x184d8f){_0x54b907['push'](_0x54b907['shift']());}};_0x363d89(++_0x29ff96);}(_0x09b1,0x1d2));var _0x109b=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x09b1[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x109b('0x0'));var util=require(_0x109b('0x1'));var logger=require('../../config/logger')(_0x109b('0x2'));var moment=require(_0x109b('0x3'));var BPromise=require('bluebird');var rp=require(_0x109b('0x4'));var attributes=require('./template.attributes');module[_0x109b('0x5')]=function(_0x37d867,_0x2a9ce7){return _0x37d867[_0x109b('0x6')](_0x109b('0x7'),attributes,{'tableName':_0x109b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7d228a8..5701e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20de=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x20de,0x151));var _0xe20d=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x20de[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xe20d('0x0'));var util=require(_0xe20d('0x1'));var moment=require(_0xe20d('0x2'));var BPromise=require(_0xe20d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe20d('0x4'));var db=require(_0xe20d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe20d('0x6'))(_0xe20d('0x7'));var config=require(_0xe20d('0x8'));var jayson=require(_0xe20d('0x9'));var client=jayson[_0xe20d('0xa')][_0xe20d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x233e8c,_0x3ffee3,_0x2655ce){return new BPromise(function(_0xff72f7,_0xdde123){return client[_0xe20d('0xc')](_0x233e8c,_0x2655ce)[_0xe20d('0xd')](function(_0x3f1cb0){logger[_0xe20d('0xe')](_0xe20d('0xf'),_0x3ffee3,_0xe20d('0x10'));logger[_0xe20d('0x11')](_0xe20d('0x12'),_0x3ffee3,'request\x20sent',JSON[_0xe20d('0x13')](_0x3f1cb0));if(_0x3f1cb0['error']){if(_0x3f1cb0[_0xe20d('0x14')]['code']===0x1f4){logger[_0xe20d('0x14')](_0xe20d('0xf'),_0x3ffee3,_0x3f1cb0[_0xe20d('0x14')][_0xe20d('0x15')]);return _0xdde123(_0x3f1cb0[_0xe20d('0x14')][_0xe20d('0x15')]);}logger[_0xe20d('0x14')]('Template,\x20%s,\x20%s',_0x3ffee3,_0x3f1cb0['error'][_0xe20d('0x15')]);return _0xff72f7(_0x3f1cb0[_0xe20d('0x14')][_0xe20d('0x15')]);}else{logger['info'](_0xe20d('0xf'),_0x3ffee3,_0xe20d('0x10'));_0xff72f7(_0x3f1cb0[_0xe20d('0x16')][_0xe20d('0x15')]);}})[_0xe20d('0x17')](function(_0xf6dcd9){logger[_0xe20d('0x14')](_0xe20d('0xf'),_0x3ffee3,_0xf6dcd9);_0xdde123(_0xf6dcd9);});});}exports[_0xe20d('0x18')]=function(_0x887202){var _0x48294d=this;return new Promise(function(_0x3adbb5,_0x3bd450){return db['Template'][_0xe20d('0x19')]({'raw':_0x887202['options']?_0x887202[_0xe20d('0x1a')][_0xe20d('0x1b')]===undefined?!![]:![]:!![],'where':_0x887202[_0xe20d('0x1a')]?_0x887202[_0xe20d('0x1a')][_0xe20d('0x1c')]||null:null,'attributes':_0x887202[_0xe20d('0x1a')]?_0x887202[_0xe20d('0x1a')][_0xe20d('0x1d')]||null:null,'limit':_0x887202['options']?_0x887202[_0xe20d('0x1a')][_0xe20d('0x1e')]||null:null,'include':_0x887202[_0xe20d('0x1a')]?_0x887202[_0xe20d('0x1a')][_0xe20d('0x1f')]?_[_0xe20d('0x20')](_0x887202[_0xe20d('0x1a')][_0xe20d('0x1f')],function(_0x383f24){return{'model':db[_0x383f24['model']],'as':_0x383f24['as'],'attributes':_0x383f24[_0xe20d('0x1d')],'include':_0x383f24[_0xe20d('0x1f')]?_[_0xe20d('0x20')](_0x383f24['include'],function(_0x158504){return{'model':db[_0x158504[_0xe20d('0x21')]],'as':_0x158504['as'],'attributes':_0x158504['attributes'],'include':_0x158504[_0xe20d('0x1f')]?_[_0xe20d('0x20')](_0x158504[_0xe20d('0x1f')],function(_0x143240){return{'model':db[_0x143240[_0xe20d('0x21')]],'as':_0x143240['as'],'attributes':_0x143240[_0xe20d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe20d('0xd')](function(_0x4446c9){logger['info']('GetTemplate',_0x887202);logger[_0xe20d('0x11')](_0xe20d('0x18'),_0x887202,JSON['stringify'](_0x4446c9));_0x3adbb5(_0x4446c9);})['catch'](function(_0xba2207){logger[_0xe20d('0x14')]('GetTemplate',_0xba2207[_0xe20d('0x15')],_0x887202);_0x3bd450(_0x48294d[_0xe20d('0x14')](0x1f4,_0xba2207[_0xe20d('0x15')]));});});};
\ No newline at end of file
+var _0xc6c5=['Template','findAll','options','raw','where','attributes','limit','include','map','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetTemplate'];(function(_0x1b5f3a,_0x3ec783){var _0x13f8fb=function(_0x1cb65f){while(--_0x1cb65f){_0x1b5f3a['push'](_0x1b5f3a['shift']());}};_0x13f8fb(++_0x3ec783);}(_0xc6c5,0xa6));var _0x5c6c=function(_0x22f5b3,_0x1644ad){_0x22f5b3=_0x22f5b3-0x0;var _0x457024=_0xc6c5[_0x22f5b3];return _0x457024;};'use strict';var _=require('lodash');var util=require(_0x5c6c('0x0'));var moment=require(_0x5c6c('0x1'));var BPromise=require(_0x5c6c('0x2'));var rs=require(_0x5c6c('0x3'));var fs=require('fs');var Redis=require(_0x5c6c('0x4'));var db=require(_0x5c6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c6c('0x6'))('rpc');var config=require(_0x5c6c('0x7'));var jayson=require(_0x5c6c('0x8'));var client=jayson[_0x5c6c('0x9')][_0x5c6c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb82b2c,_0x596709,_0x59d82d){return new BPromise(function(_0x1dd588,_0x512c94){return client['request'](_0xb82b2c,_0x59d82d)['then'](function(_0x460ec7){logger[_0x5c6c('0xb')](_0x5c6c('0xc'),_0x596709,_0x5c6c('0xd'));logger[_0x5c6c('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x596709,'request\x20sent',JSON[_0x5c6c('0xf')](_0x460ec7));if(_0x460ec7[_0x5c6c('0x10')]){if(_0x460ec7[_0x5c6c('0x10')]['code']===0x1f4){logger[_0x5c6c('0x10')](_0x5c6c('0xc'),_0x596709,_0x460ec7[_0x5c6c('0x10')]['message']);return _0x512c94(_0x460ec7[_0x5c6c('0x10')]['message']);}logger[_0x5c6c('0x10')](_0x5c6c('0xc'),_0x596709,_0x460ec7['error'][_0x5c6c('0x11')]);return _0x1dd588(_0x460ec7['error'][_0x5c6c('0x11')]);}else{logger['info'](_0x5c6c('0xc'),_0x596709,_0x5c6c('0xd'));_0x1dd588(_0x460ec7[_0x5c6c('0x12')]['message']);}})['catch'](function(_0x18c4b0){logger[_0x5c6c('0x10')](_0x5c6c('0xc'),_0x596709,_0x18c4b0);_0x512c94(_0x18c4b0);});});}exports[_0x5c6c('0x13')]=function(_0x225e95){var _0x30df08=this;return new Promise(function(_0x2a51b6,_0x582f27){return db[_0x5c6c('0x14')][_0x5c6c('0x15')]({'raw':_0x225e95[_0x5c6c('0x16')]?_0x225e95[_0x5c6c('0x16')][_0x5c6c('0x17')]===undefined?!![]:![]:!![],'where':_0x225e95[_0x5c6c('0x16')]?_0x225e95[_0x5c6c('0x16')][_0x5c6c('0x18')]||null:null,'attributes':_0x225e95[_0x5c6c('0x16')]?_0x225e95[_0x5c6c('0x16')][_0x5c6c('0x19')]||null:null,'limit':_0x225e95[_0x5c6c('0x16')]?_0x225e95['options'][_0x5c6c('0x1a')]||null:null,'include':_0x225e95[_0x5c6c('0x16')]?_0x225e95[_0x5c6c('0x16')][_0x5c6c('0x1b')]?_[_0x5c6c('0x1c')](_0x225e95[_0x5c6c('0x16')][_0x5c6c('0x1b')],function(_0x23386a){return{'model':db[_0x23386a['model']],'as':_0x23386a['as'],'attributes':_0x23386a['attributes'],'include':_0x23386a['include']?_['map'](_0x23386a[_0x5c6c('0x1b')],function(_0x2584ce){return{'model':db[_0x2584ce[_0x5c6c('0x1d')]],'as':_0x2584ce['as'],'attributes':_0x2584ce[_0x5c6c('0x19')],'include':_0x2584ce[_0x5c6c('0x1b')]?_[_0x5c6c('0x1c')](_0x2584ce[_0x5c6c('0x1b')],function(_0x19bcd6){return{'model':db[_0x19bcd6[_0x5c6c('0x1d')]],'as':_0x19bcd6['as'],'attributes':_0x19bcd6[_0x5c6c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5c6c('0x1e')](function(_0x4b71f9){logger[_0x5c6c('0xb')]('GetTemplate',_0x225e95);logger[_0x5c6c('0xe')]('GetTemplate',_0x225e95,JSON['stringify'](_0x4b71f9));_0x2a51b6(_0x4b71f9);})['catch'](function(_0x441b78){logger['error'](_0x5c6c('0x13'),_0x441b78[_0x5c6c('0x11')],_0x225e95);_0x582f27(_0x30df08[_0x5c6c('0x10')](0x1f4,_0x441b78[_0x5c6c('0x11')]));});});};
\ No newline at end of file
index 16c31f6..f7757a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61f=['express','Router','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xf61f,0x15b));var _0xff61=function(_0x469218,_0x440d05){_0x469218=_0x469218-0x0;var _0x187b4a=_0xf61f[_0x469218];return _0x187b4a;};'use strict';var multer=require(_0xff61('0x0'));var util=require('util');var path=require(_0xff61('0x1'));var timeout=require(_0xff61('0x2'));var express=require(_0xff61('0x3'));var router=express[_0xff61('0x4')]();var auth=require(_0xff61('0x5'));var interaction=require(_0xff61('0x6'));var config=require('../../config/environment');var controller=require(_0xff61('0x7'));router[_0xff61('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xff61('0x9')](),controller[_0xff61('0xa')]);router[_0xff61('0x8')](_0xff61('0xb'),auth[_0xff61('0x9')](),controller[_0xff61('0xc')]);router['get'](_0xff61('0xd'),auth[_0xff61('0x9')](),controller['getAnyConditions']);router[_0xff61('0x8')]('/:id/actions',auth[_0xff61('0x9')](),controller[_0xff61('0xe')]);router[_0xff61('0xf')]('/',auth[_0xff61('0x9')](),controller[_0xff61('0x10')]);router[_0xff61('0xf')](_0xff61('0xb'),auth[_0xff61('0x9')](),controller[_0xff61('0x11')]);router[_0xff61('0xf')](_0xff61('0xd'),auth[_0xff61('0x9')](),controller[_0xff61('0x12')]);router[_0xff61('0xf')](_0xff61('0x13'),auth[_0xff61('0x9')](),controller['addAction']);router['put'](_0xff61('0x14'),auth['isAuthenticated'](),controller[_0xff61('0x15')]);router[_0xff61('0x16')](_0xff61('0x14'),auth['isAuthenticated'](),controller[_0xff61('0x17')]);module[_0xff61('0x18')]=router;
\ No newline at end of file
+var _0xd6d3=['getActions','post','create','/:id/all_conditions','addAllCondition','/:id/any_conditions','/:id/actions','addAction','put','delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','get','show','isAuthenticated','getAllConditions','getAnyConditions'];(function(_0x46ee3c,_0x1c08f0){var _0x530a97=function(_0x194bba){while(--_0x194bba){_0x46ee3c['push'](_0x46ee3c['shift']());}};_0x530a97(++_0x1c08f0);}(_0xd6d3,0xd4));var _0x3d6d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd6d3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3d6d('0x0'));var util=require('util');var path=require(_0x3d6d('0x1'));var timeout=require(_0x3d6d('0x2'));var express=require(_0x3d6d('0x3'));var router=express[_0x3d6d('0x4')]();var auth=require(_0x3d6d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3d6d('0x6'));var controller=require(_0x3d6d('0x7'));router[_0x3d6d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3d6d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3d6d('0x9')]);router[_0x3d6d('0x8')]('/:id/all_conditions',auth[_0x3d6d('0xa')](),controller[_0x3d6d('0xb')]);router[_0x3d6d('0x8')]('/:id/any_conditions',auth[_0x3d6d('0xa')](),controller[_0x3d6d('0xc')]);router[_0x3d6d('0x8')]('/:id/actions',auth[_0x3d6d('0xa')](),controller[_0x3d6d('0xd')]);router[_0x3d6d('0xe')]('/',auth[_0x3d6d('0xa')](),controller[_0x3d6d('0xf')]);router['post'](_0x3d6d('0x10'),auth['isAuthenticated'](),controller[_0x3d6d('0x11')]);router[_0x3d6d('0xe')](_0x3d6d('0x12'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x3d6d('0xe')](_0x3d6d('0x13'),auth[_0x3d6d('0xa')](),controller[_0x3d6d('0x14')]);router[_0x3d6d('0x15')]('/:id',auth[_0x3d6d('0xa')](),controller['update']);router[_0x3d6d('0x16')](_0x3d6d('0x17'),auth[_0x3d6d('0xa')](),controller['destroy']);module[_0x3d6d('0x18')]=router;
\ No newline at end of file
index 3fe5958..d5cdb53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45b2=['BOOLEAN','sequelize','exports','STRING'];(function(_0x410e71,_0x5185fa){var _0xaaf4a5=function(_0x43b635){while(--_0x43b635){_0x410e71['push'](_0x410e71['shift']());}};_0xaaf4a5(++_0x5185fa);}(_0x45b2,0x75));var _0x245b=function(_0x43ff0d,_0x4d1101){_0x43ff0d=_0x43ff0d-0x0;var _0x338570=_0x45b2[_0x43ff0d];return _0x338570;};'use strict';var Sequelize=require(_0x245b('0x0'));module[_0x245b('0x1')]={'name':{'type':Sequelize[_0x245b('0x2')]},'channel':{'type':Sequelize[_0x245b('0x2')]},'description':{'type':Sequelize[_0x245b('0x2')]},'status':{'type':Sequelize[_0x245b('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa7a6=['BOOLEAN','sequelize','exports','STRING'];(function(_0x45b97d,_0x2028a1){var _0x4efe21=function(_0x37b7cb){while(--_0x37b7cb){_0x45b97d['push'](_0x45b97d['shift']());}};_0x4efe21(++_0x2028a1);}(_0xa7a6,0x1bd));var _0x6a7a=function(_0x158a58,_0x28e8e7){_0x158a58=_0x158a58-0x0;var _0x4935d9=_0xa7a6[_0x158a58];return _0x4935d9;};'use strict';var Sequelize=require(_0x6a7a('0x0'));module[_0x6a7a('0x1')]={'name':{'type':Sequelize[_0x6a7a('0x2')]},'channel':{'type':Sequelize[_0x6a7a('0x2')]},'description':{'type':Sequelize[_0x6a7a('0x2')]},'status':{'type':Sequelize[_0x6a7a('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 96b50db..f44f2de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2626=['count','offset','limit','apply','reject','save','update','destroy','then','get','Triggers','UserProfileResource','error','stack','send','rawAttributes','query','dateStart','dateEnd','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','add','day','merge','where','filter','map','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','nolimit','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json'];(function(_0x404d41,_0xd7d0ea){var _0x3dd5a3=function(_0x4cdda7){while(--_0x4cdda7){_0x404d41['push'](_0x404d41['shift']());}};_0x3dd5a3(++_0xd7d0ea);}(_0x2626,0x159));var _0x6262=function(_0x4ac9b1,_0x2f7e72){_0x4ac9b1=_0x4ac9b1-0x0;var _0x3f2978=_0x2626[_0x4ac9b1];return _0x3f2978;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6262('0x0'));var rimraf=require(_0x6262('0x1'));var zipdir=require(_0x6262('0x2'));var jsonpatch=require(_0x6262('0x3'));var rp=require(_0x6262('0x4'));var moment=require(_0x6262('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6262('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6262('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6262('0x8'));var crypto=require(_0x6262('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6262('0xa'));var toCsv=require('to-csv');var querystring=require(_0x6262('0xb'));var Papa=require(_0x6262('0xc'));var Redis=require(_0x6262('0xd'));var qs=require(_0x6262('0xe'));var logger=require('../../config/logger')(_0x6262('0xf'));var utils=require(_0x6262('0x10'));var config=require(_0x6262('0x11'));var db=require(_0x6262('0x12'))['db'];function respondWithStatusCode(_0x309e20,_0x36d077){_0x36d077=_0x36d077||0xcc;return function(_0x495cbe){if(_0x495cbe){return _0x309e20[_0x6262('0x13')](_0x36d077);}return _0x309e20['status'](_0x36d077)[_0x6262('0x14')]();};}function respondWithResult(_0x2c4a84,_0x2e3749){_0x2e3749=_0x2e3749||0xc8;return function(_0x5803cf){if(_0x5803cf){return _0x2c4a84[_0x6262('0x15')](_0x2e3749)[_0x6262('0x16')](_0x5803cf);}};}function respondWithFilteredResult(_0x532078,_0x3e6301){return function(_0x3ab6db){if(_0x3ab6db){var _0x3295a1=_0x3ab6db[_0x6262('0x17')],_0x2f1733=_0x3e6301[_0x6262('0x18')],_0x2e23c5=_0x3e6301[_0x6262('0x18')]+_0x3e6301[_0x6262('0x19')],_0x42a253;if(_0x2e23c5>=_0x3295a1){_0x2e23c5=_0x3295a1;_0x42a253=0xc8;}else{_0x42a253=0xce;}_0x532078[_0x6262('0x15')](_0x42a253);return _0x532078['set']('Content-Range',_0x2f1733+'-'+_0x2e23c5+'/'+_0x3295a1)[_0x6262('0x16')](_0x3ab6db);}return null;};}function patchUpdates(_0x37b911){return function(_0x42a6f3){try{jsonpatch[_0x6262('0x1a')](_0x42a6f3,_0x37b911,!![]);}catch(_0x211d60){return BPromise[_0x6262('0x1b')](_0x211d60);}return _0x42a6f3[_0x6262('0x1c')]();};}function saveUpdates(_0x1fa427,_0x45b4bb){return function(_0x5be745){if(_0x5be745){return _0x5be745[_0x6262('0x1d')](_0x1fa427)['then'](function(_0x1ee816){return _0x1ee816;});}return null;};}function removeEntity(_0x183add,_0x5a7da0){return function(_0x38a2f9){if(_0x38a2f9){return _0x38a2f9[_0x6262('0x1e')]()[_0x6262('0x1f')](function(){var _0xd82c12=_0x38a2f9[_0x6262('0x20')]({'plain':!![]});var _0x9cfee1=_0x6262('0x21');return db[_0x6262('0x22')][_0x6262('0x1e')]({'where':{'type':_0x9cfee1,'resourceId':_0xd82c12['id']}})[_0x6262('0x1f')](function(){return _0x38a2f9;});})[_0x6262('0x1f')](function(){_0x183add[_0x6262('0x15')](0xcc)[_0x6262('0x14')]();});}};}function handleEntityNotFound(_0x52a2ca,_0x221113){return function(_0x2206a7){if(!_0x2206a7){_0x52a2ca['sendStatus'](0x194);}return _0x2206a7;};}function handleError(_0xf2020b,_0x420706){_0x420706=_0x420706||0x1f4;return function(_0x1cf3d6){logger[_0x6262('0x23')](_0x1cf3d6[_0x6262('0x24')]);if(_0x1cf3d6['name']){delete _0x1cf3d6['name'];}_0xf2020b[_0x6262('0x15')](_0x420706)[_0x6262('0x25')](_0x1cf3d6);};}exports['index']=function(_0x3939d8,_0x2acb13){var _0x56e367={},_0x4f1094={},_0x1868cf={'count':0x0,'rows':[]};var _0x404949=db['Trigger'][_0x6262('0x26')];_0x4f1094['model']=_['keys'](_0x404949);var _0x2b0ac2={'dateStart':_0x3939d8[_0x6262('0x27')][_0x6262('0x28')],'dateEnd':_0x3939d8[_0x6262('0x27')][_0x6262('0x29')]};delete _0x3939d8[_0x6262('0x27')][_0x6262('0x28')];delete _0x3939d8[_0x6262('0x27')]['dateEnd'];_0x4f1094[_0x6262('0x27')]=_[_0x6262('0x2a')](_0x3939d8[_0x6262('0x27')]);_0x4f1094[_0x6262('0x2b')]=_[_0x6262('0x2c')](_0x4f1094['model'],_0x4f1094[_0x6262('0x27')]);_0x56e367[_0x6262('0x2d')]=_['intersection'](_0x4f1094[_0x6262('0x2e')],qs[_0x6262('0x2f')](_0x3939d8[_0x6262('0x27')][_0x6262('0x2f')]));_0x56e367[_0x6262('0x2d')]=_0x56e367[_0x6262('0x2d')][_0x6262('0x30')]?_0x56e367[_0x6262('0x2d')]:_0x4f1094[_0x6262('0x2e')];if(!_0x3939d8['query'][_0x6262('0x31')]('nolimit')){_0x56e367[_0x6262('0x19')]=qs[_0x6262('0x19')](_0x3939d8[_0x6262('0x27')][_0x6262('0x19')]);_0x56e367['offset']=qs[_0x6262('0x18')](_0x3939d8['query']['offset']);}_0x56e367[_0x6262('0x32')]=qs['sort'](_0x3939d8[_0x6262('0x27')][_0x6262('0x33')]);_0x56e367['where']=qs[_0x6262('0x2b')](_[_0x6262('0x34')](_0x3939d8['query'],_0x4f1094[_0x6262('0x2b')]));if(_0x2b0ac2['dateStart']){if(_0x2b0ac2[_0x6262('0x29')]){_0x2b0ac2[_0x6262('0x29')]=moment(_0x2b0ac2[_0x6262('0x29')])[_0x6262('0x35')](0x1,_0x6262('0x36'));}else{_0x2b0ac2[_0x6262('0x29')]=moment(_0x2b0ac2[_0x6262('0x28')])[_0x6262('0x35')](0x1,_0x6262('0x36'));}_[_0x6262('0x37')](_0x56e367[_0x6262('0x38')],{'createdAt':{'$gte':_0x2b0ac2['dateStart'],'$lte':_0x2b0ac2[_0x6262('0x29')]}});}if(_0x3939d8[_0x6262('0x27')][_0x6262('0x39')]){_0x56e367['where']=_[_0x6262('0x37')](_0x56e367[_0x6262('0x38')],{'$or':_[_0x6262('0x3a')](_0x404949,function(_0x59befe){if(_0x59befe['type'][_0x6262('0x3b')]!==_0x6262('0x3c')){var _0xd37000={};_0xd37000[_0x59befe[_0x6262('0x3d')]]={'$like':'%'+_0x3939d8[_0x6262('0x27')][_0x6262('0x39')]+'%'};return _0xd37000;}})});}_0x56e367=_['merge']({},_0x56e367,_0x3939d8[_0x6262('0x3e')]);var _0x3b686d={'where':_0x56e367[_0x6262('0x38')]};return db['Trigger'][_0x6262('0x17')](_0x3b686d)['then'](function(_0x3477ab){_0x1868cf[_0x6262('0x17')]=_0x3477ab;if(_0x3939d8[_0x6262('0x27')][_0x6262('0x3f')]){_0x56e367[_0x6262('0x40')]=[{'all':!![]}];}return db[_0x6262('0x41')]['findAll'](_0x56e367);})['then'](function(_0x1c1790){_0x1868cf[_0x6262('0x42')]=_0x1c1790;return _0x1868cf;})[_0x6262('0x1f')](respondWithFilteredResult(_0x2acb13,_0x56e367))[_0x6262('0x43')](handleError(_0x2acb13,null));};exports[_0x6262('0x44')]=function(_0x14e4be,_0x41ebc3){var _0x4b92e0={'raw':![],'where':{'id':_0x14e4be[_0x6262('0x45')]['id']}},_0x34284f={};_0x34284f['model']=_['keys'](db[_0x6262('0x41')]['rawAttributes']);_0x34284f[_0x6262('0x27')]=_[_0x6262('0x2a')](_0x14e4be['query']);_0x34284f['filters']=_[_0x6262('0x2c')](_0x34284f[_0x6262('0x2e')],_0x34284f[_0x6262('0x27')]);_0x4b92e0[_0x6262('0x2d')]=_['intersection'](_0x34284f['model'],qs[_0x6262('0x2f')](_0x14e4be[_0x6262('0x27')]['fields']));_0x4b92e0[_0x6262('0x2d')]=_0x4b92e0[_0x6262('0x2d')]['length']?_0x4b92e0[_0x6262('0x2d')]:_0x34284f[_0x6262('0x2e')];if(_0x14e4be[_0x6262('0x27')][_0x6262('0x3f')]){_0x4b92e0['include']=[{'all':!![]}];}_0x4b92e0=_[_0x6262('0x37')]({},_0x4b92e0,_0x14e4be['options']);return db['Trigger']['find'](_0x4b92e0)[_0x6262('0x1f')](handleEntityNotFound(_0x41ebc3,null))[_0x6262('0x1f')](respondWithResult(_0x41ebc3,null))['catch'](handleError(_0x41ebc3,null));};exports[_0x6262('0x46')]=function(_0x31d6f0,_0x1b2e63){return db[_0x6262('0x41')]['create'](_0x31d6f0['body'],{})[_0x6262('0x1f')](function(_0x20bab4){var _0x3a4e86=_0x31d6f0[_0x6262('0x47')]['get']({'plain':!![]});if(!_0x3a4e86)throw new Error(_0x6262('0x48'));if(_0x3a4e86[_0x6262('0x49')]===_0x6262('0x47')){var _0xc5642a=_0x20bab4[_0x6262('0x20')]({'plain':!![]});var _0x5491f3=_0x6262('0x21');return db[_0x6262('0x4a')][_0x6262('0x4b')]({'where':{'name':_0x5491f3,'userProfileId':_0x3a4e86[_0x6262('0x4c')]},'raw':!![]})[_0x6262('0x1f')](function(_0x38ef80){if(_0x38ef80&&_0x38ef80[_0x6262('0x4d')]===0x0){return db[_0x6262('0x22')]['create']({'name':_0xc5642a[_0x6262('0x4e')],'resourceId':_0xc5642a['id'],'type':_0x38ef80['name'],'sectionId':_0x38ef80['id']},{})[_0x6262('0x1f')](function(){return _0x20bab4;});}else{return _0x20bab4;}})[_0x6262('0x43')](function(_0x1a90ad){logger['error'](_0x6262('0x4f'),_0x1a90ad);throw _0x1a90ad;});}return _0x20bab4;})[_0x6262('0x1f')](respondWithResult(_0x1b2e63,0xc9))[_0x6262('0x43')](handleError(_0x1b2e63,null));};exports[_0x6262('0x1d')]=function(_0x3af6d4,_0x4ffb44){if(_0x3af6d4[_0x6262('0x50')]['id']){delete _0x3af6d4['body']['id'];}return db[_0x6262('0x41')][_0x6262('0x4b')]({'where':{'id':_0x3af6d4[_0x6262('0x45')]['id']}})[_0x6262('0x1f')](handleEntityNotFound(_0x4ffb44,null))['then'](saveUpdates(_0x3af6d4[_0x6262('0x50')],null))[_0x6262('0x1f')](respondWithResult(_0x4ffb44,null))['catch'](handleError(_0x4ffb44,null));};exports[_0x6262('0x1e')]=function(_0x2e0431,_0x577a7f){return db['Trigger'][_0x6262('0x4b')]({'where':{'id':_0x2e0431['params']['id']}})[_0x6262('0x1f')](handleEntityNotFound(_0x577a7f,null))[_0x6262('0x1f')](removeEntity(_0x577a7f,null))[_0x6262('0x43')](handleError(_0x577a7f,null));};exports['addAllCondition']=function(_0x272abc,_0x3c732f,_0x553f36){if(_0x272abc['body']['id']){delete _0x272abc[_0x6262('0x50')]['id'];}return db[_0x6262('0x41')]['find']({'where':{'id':_0x272abc['params']['id']}})[_0x6262('0x1f')](handleEntityNotFound(_0x3c732f,null))['then'](function(_0x595b03){if(_0x595b03){_0x272abc['body'][_0x6262('0x51')]=_0x595b03['id'];return db[_0x6262('0x52')][_0x6262('0x46')](_0x272abc['body']);}})[_0x6262('0x1f')](respondWithResult(_0x3c732f,null))[_0x6262('0x43')](handleError(_0x3c732f,null));};exports[_0x6262('0x53')]=function(_0x3eb496,_0x3c47d2,_0x25a7e8){if(_0x3eb496['body']['id']){delete _0x3eb496[_0x6262('0x50')]['id'];}return db['Trigger']['find']({'where':{'id':_0x3eb496[_0x6262('0x45')]['id']}})[_0x6262('0x1f')](handleEntityNotFound(_0x3c47d2,null))[_0x6262('0x1f')](function(_0x30bb65){if(_0x30bb65){_0x3eb496[_0x6262('0x50')][_0x6262('0x54')]=_0x30bb65['id'];return db[_0x6262('0x52')]['create'](_0x3eb496['body']);}})[_0x6262('0x1f')](respondWithResult(_0x3c47d2,null))[_0x6262('0x43')](handleError(_0x3c47d2,null));};exports[_0x6262('0x55')]=function(_0x101a1c,_0x145355,_0xd0d9f8){var _0x4398c3={};var _0x18682a={};var _0xf1a62a;var _0x4a6d7a;return db[_0x6262('0x41')][_0x6262('0x56')]({'where':{'id':_0x101a1c[_0x6262('0x45')]['id']}})[_0x6262('0x1f')](handleEntityNotFound(_0x145355,null))[_0x6262('0x1f')](function(_0xca6002){if(_0xca6002){_0xf1a62a=_0xca6002;_0x18682a[_0x6262('0x2e')]=_['keys'](db[_0x6262('0x52')][_0x6262('0x26')]);_0x18682a[_0x6262('0x27')]=_[_0x6262('0x2a')](_0x101a1c['query']);_0x18682a[_0x6262('0x2b')]=_['intersection'](_0x18682a[_0x6262('0x2e')],_0x18682a[_0x6262('0x27')]);_0x4398c3['attributes']=_[_0x6262('0x2c')](_0x18682a[_0x6262('0x2e')],qs[_0x6262('0x2f')](_0x101a1c[_0x6262('0x27')]['fields']));_0x4398c3[_0x6262('0x2d')]=_0x4398c3[_0x6262('0x2d')]['length']?_0x4398c3[_0x6262('0x2d')]:_0x18682a[_0x6262('0x2e')];_0x4398c3[_0x6262('0x32')]=qs[_0x6262('0x33')](_0x101a1c[_0x6262('0x27')][_0x6262('0x33')]);_0x4398c3[_0x6262('0x38')]=qs[_0x6262('0x2b')](_[_0x6262('0x34')](_0x101a1c[_0x6262('0x27')],_0x18682a[_0x6262('0x2b')]));if(_0x101a1c['query'][_0x6262('0x39')]){_0x4398c3[_0x6262('0x38')]=_['merge'](_0x4398c3['where'],{'$or':_[_0x6262('0x3a')](_0x4398c3[_0x6262('0x2d')],function(_0x1c5e89){var _0x4e29a0={};_0x4e29a0[_0x1c5e89]={'$like':'%'+_0x101a1c['query']['filter']+'%'};return _0x4e29a0;})});}_0x4398c3=_[_0x6262('0x37')]({},_0x4398c3,_0x101a1c['options']);return _0xf1a62a['getAllConditions'](_0x4398c3);}})['then'](function(_0x24eb09){if(_0x24eb09){_0x4a6d7a=_0x24eb09[_0x6262('0x30')];if(!_0x101a1c[_0x6262('0x27')]['hasOwnProperty'](_0x6262('0x57'))){_0x4398c3[_0x6262('0x19')]=qs[_0x6262('0x19')](_0x101a1c[_0x6262('0x27')][_0x6262('0x19')]);_0x4398c3[_0x6262('0x18')]=qs['offset'](_0x101a1c[_0x6262('0x27')][_0x6262('0x18')]);}return _0xf1a62a['getAllConditions'](_0x4398c3);}})[_0x6262('0x1f')](function(_0x34b9d9){if(_0x34b9d9){return _0x34b9d9?{'count':_0x4a6d7a,'rows':_0x34b9d9}:null;}})[_0x6262('0x1f')](respondWithResult(_0x145355,null))[_0x6262('0x43')](handleError(_0x145355,null));};exports[_0x6262('0x58')]=function(_0x420bd0,_0x5267e7,_0x41dfde){var _0x1f28a2={};var _0x2759be={};var _0x38f435;var _0x2b6d82;return db[_0x6262('0x41')][_0x6262('0x56')]({'where':{'id':_0x420bd0[_0x6262('0x45')]['id']}})[_0x6262('0x1f')](handleEntityNotFound(_0x5267e7,null))[_0x6262('0x1f')](function(_0x486999){if(_0x486999){_0x38f435=_0x486999;_0x2759be[_0x6262('0x2e')]=_[_0x6262('0x2a')](db[_0x6262('0x52')]['rawAttributes']);_0x2759be[_0x6262('0x27')]=_['keys'](_0x420bd0[_0x6262('0x27')]);_0x2759be['filters']=_['intersection'](_0x2759be[_0x6262('0x2e')],_0x2759be[_0x6262('0x27')]);_0x1f28a2[_0x6262('0x2d')]=_[_0x6262('0x2c')](_0x2759be['model'],qs['fields'](_0x420bd0[_0x6262('0x27')][_0x6262('0x2f')]));_0x1f28a2[_0x6262('0x2d')]=_0x1f28a2[_0x6262('0x2d')][_0x6262('0x30')]?_0x1f28a2[_0x6262('0x2d')]:_0x2759be['model'];_0x1f28a2['order']=qs[_0x6262('0x33')](_0x420bd0[_0x6262('0x27')][_0x6262('0x33')]);_0x1f28a2[_0x6262('0x38')]=qs['filters'](_['pick'](_0x420bd0[_0x6262('0x27')],_0x2759be[_0x6262('0x2b')]));if(_0x420bd0[_0x6262('0x27')][_0x6262('0x39')]){_0x1f28a2[_0x6262('0x38')]=_[_0x6262('0x37')](_0x1f28a2['where'],{'$or':_['map'](_0x1f28a2[_0x6262('0x2d')],function(_0x335e7b){var _0x1ce3c2={};_0x1ce3c2[_0x335e7b]={'$like':'%'+_0x420bd0['query'][_0x6262('0x39')]+'%'};return _0x1ce3c2;})});}_0x1f28a2=_[_0x6262('0x37')]({},_0x1f28a2,_0x420bd0[_0x6262('0x3e')]);return _0x38f435[_0x6262('0x58')](_0x1f28a2);}})[_0x6262('0x1f')](function(_0x5636f9){if(_0x5636f9){_0x2b6d82=_0x5636f9[_0x6262('0x30')];if(!_0x420bd0['query'][_0x6262('0x31')](_0x6262('0x57'))){_0x1f28a2['limit']=qs[_0x6262('0x19')](_0x420bd0[_0x6262('0x27')]['limit']);_0x1f28a2['offset']=qs[_0x6262('0x18')](_0x420bd0['query'][_0x6262('0x18')]);}return _0x38f435[_0x6262('0x58')](_0x1f28a2);}})['then'](function(_0x11e8b6){if(_0x11e8b6){return _0x11e8b6?{'count':_0x2b6d82,'rows':_0x11e8b6}:null;}})[_0x6262('0x1f')](respondWithResult(_0x5267e7,null))[_0x6262('0x43')](handleError(_0x5267e7,null));};exports['addAction']=function(_0x341eb5,_0x50ca56,_0x189d86){if(_0x341eb5['body']['id']){delete _0x341eb5['body']['id'];}return db[_0x6262('0x41')][_0x6262('0x4b')]({'where':{'id':_0x341eb5[_0x6262('0x45')]['id']}})[_0x6262('0x1f')](handleEntityNotFound(_0x50ca56,null))[_0x6262('0x1f')](function(_0x233014){if(_0x233014){_0x341eb5[_0x6262('0x50')][_0x6262('0x59')]=_0x233014['id'];return db[_0x6262('0x5a')]['create'](_0x341eb5['body']);}})[_0x6262('0x1f')](respondWithResult(_0x50ca56,null))['catch'](handleError(_0x50ca56,null));};exports[_0x6262('0x5b')]=function(_0xd09e8d,_0x37817b,_0x8f0948){var _0x2e6277={};var _0x3fd67b={};var _0x24d5b9;var _0x1b016b;return db['Trigger'][_0x6262('0x56')]({'where':{'id':_0xd09e8d[_0x6262('0x45')]['id']}})['then'](handleEntityNotFound(_0x37817b,null))[_0x6262('0x1f')](function(_0x4a9371){if(_0x4a9371){_0x24d5b9=_0x4a9371;_0x3fd67b[_0x6262('0x2e')]=_['keys'](db['Action'][_0x6262('0x26')]);_0x3fd67b[_0x6262('0x27')]=_[_0x6262('0x2a')](_0xd09e8d[_0x6262('0x27')]);_0x3fd67b[_0x6262('0x2b')]=_[_0x6262('0x2c')](_0x3fd67b['model'],_0x3fd67b['query']);_0x2e6277['attributes']=_[_0x6262('0x2c')](_0x3fd67b['model'],qs[_0x6262('0x2f')](_0xd09e8d[_0x6262('0x27')][_0x6262('0x2f')]));_0x2e6277[_0x6262('0x2d')]=_0x2e6277[_0x6262('0x2d')][_0x6262('0x30')]?_0x2e6277['attributes']:_0x3fd67b['model'];_0x2e6277[_0x6262('0x32')]=qs['sort'](_0xd09e8d[_0x6262('0x27')][_0x6262('0x33')]);_0x2e6277[_0x6262('0x38')]=qs[_0x6262('0x2b')](_[_0x6262('0x34')](_0xd09e8d[_0x6262('0x27')],_0x3fd67b[_0x6262('0x2b')]));if(_0xd09e8d[_0x6262('0x27')][_0x6262('0x39')]){_0x2e6277[_0x6262('0x38')]=_[_0x6262('0x37')](_0x2e6277['where'],{'$or':_[_0x6262('0x3a')](_0x2e6277[_0x6262('0x2d')],function(_0x4e36a6){var _0x140570={};_0x140570[_0x4e36a6]={'$like':'%'+_0xd09e8d[_0x6262('0x27')][_0x6262('0x39')]+'%'};return _0x140570;})});}_0x2e6277=_[_0x6262('0x37')]({},_0x2e6277,_0xd09e8d[_0x6262('0x3e')]);return _0x24d5b9['getActions'](_0x2e6277);}})[_0x6262('0x1f')](function(_0x446fb9){if(_0x446fb9){_0x1b016b=_0x446fb9[_0x6262('0x30')];if(!_0xd09e8d['query'][_0x6262('0x31')](_0x6262('0x57'))){_0x2e6277['limit']=qs[_0x6262('0x19')](_0xd09e8d[_0x6262('0x27')]['limit']);_0x2e6277['offset']=qs[_0x6262('0x18')](_0xd09e8d[_0x6262('0x27')][_0x6262('0x18')]);}return _0x24d5b9[_0x6262('0x5b')](_0x2e6277);}})[_0x6262('0x1f')](function(_0x4ec566){if(_0x4ec566){return _0x4ec566?{'count':_0x1b016b,'rows':_0x4ec566}:null;}})[_0x6262('0x1f')](respondWithResult(_0x37817b,null))[_0x6262('0x43')](handleError(_0x37817b,null));};
\ No newline at end of file
+var _0x6b7a=['Triggers','UserProfileSection','userProfileId','autoAssociation','catch','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','getAnyConditions','findOne','order','addAction','TriggerId','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','index','Trigger','rawAttributes','model','query','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','add','dateStart','day','merge','filter','map','key','field','options','includeAll','include','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6b7a,0x1e4));var _0xa6b7=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x6b7a[_0x236c89];return _0x3b2a15;};'use strict';var pdf=require(_0xa6b7('0x0'));var emlformat=require(_0xa6b7('0x1'));var rimraf=require(_0xa6b7('0x2'));var zipdir=require(_0xa6b7('0x3'));var jsonpatch=require(_0xa6b7('0x4'));var rp=require('request-promise');var moment=require(_0xa6b7('0x5'));var BPromise=require(_0xa6b7('0x6'));var Mustache=require(_0xa6b7('0x7'));var util=require(_0xa6b7('0x8'));var path=require(_0xa6b7('0x9'));var sox=require(_0xa6b7('0xa'));var csv=require(_0xa6b7('0xb'));var ejs=require(_0xa6b7('0xc'));var fs=require('fs');var _=require(_0xa6b7('0xd'));var squel=require(_0xa6b7('0xe'));var crypto=require(_0xa6b7('0xf'));var jsforce=require(_0xa6b7('0x10'));var deskjs=require(_0xa6b7('0x11'));var toCsv=require(_0xa6b7('0xb'));var querystring=require('querystring');var Papa=require(_0xa6b7('0x12'));var Redis=require('ioredis');var qs=require(_0xa6b7('0x13'));var logger=require(_0xa6b7('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x590284,_0x36f9b7){_0x36f9b7=_0x36f9b7||0xcc;return function(_0x1d11eb){if(_0x1d11eb){return _0x590284[_0xa6b7('0x15')](_0x36f9b7);}return _0x590284['status'](_0x36f9b7)[_0xa6b7('0x16')]();};}function respondWithResult(_0x32d907,_0x57d385){_0x57d385=_0x57d385||0xc8;return function(_0x21bcba){if(_0x21bcba){return _0x32d907[_0xa6b7('0x17')](_0x57d385)[_0xa6b7('0x18')](_0x21bcba);}};}function respondWithFilteredResult(_0x58c452,_0x47b3eb){return function(_0x9c4e29){if(_0x9c4e29){var _0x1b4a45=_0x9c4e29[_0xa6b7('0x19')],_0x31bd67=_0x47b3eb[_0xa6b7('0x1a')],_0x48daac=_0x47b3eb[_0xa6b7('0x1a')]+_0x47b3eb[_0xa6b7('0x1b')],_0x20c5d7;if(_0x48daac>=_0x1b4a45){_0x48daac=_0x1b4a45;_0x20c5d7=0xc8;}else{_0x20c5d7=0xce;}_0x58c452[_0xa6b7('0x17')](_0x20c5d7);return _0x58c452['set'](_0xa6b7('0x1c'),_0x31bd67+'-'+_0x48daac+'/'+_0x1b4a45)[_0xa6b7('0x18')](_0x9c4e29);}return null;};}function patchUpdates(_0x540095){return function(_0x303a7c){try{jsonpatch[_0xa6b7('0x1d')](_0x303a7c,_0x540095,!![]);}catch(_0x3ed0b5){return BPromise[_0xa6b7('0x1e')](_0x3ed0b5);}return _0x303a7c[_0xa6b7('0x1f')]();};}function saveUpdates(_0x4ccf9c,_0x214d3f){return function(_0x586492){if(_0x586492){return _0x586492['update'](_0x4ccf9c)[_0xa6b7('0x20')](function(_0x297087){return _0x297087;});}return null;};}function removeEntity(_0x357a68,_0x4a2a48){return function(_0x12290c){if(_0x12290c){return _0x12290c[_0xa6b7('0x21')]()['then'](function(){var _0x4b264f=_0x12290c['get']({'plain':!![]});var _0x10a97c='Triggers';return db[_0xa6b7('0x22')]['destroy']({'where':{'type':_0x10a97c,'resourceId':_0x4b264f['id']}})['then'](function(){return _0x12290c;});})[_0xa6b7('0x20')](function(){_0x357a68[_0xa6b7('0x17')](0xcc)[_0xa6b7('0x16')]();});}};}function handleEntityNotFound(_0x56d8a5,_0x1384e5){return function(_0x42a382){if(!_0x42a382){_0x56d8a5[_0xa6b7('0x15')](0x194);}return _0x42a382;};}function handleError(_0x139fe7,_0x25ac57){_0x25ac57=_0x25ac57||0x1f4;return function(_0x4f16ab){logger[_0xa6b7('0x23')](_0x4f16ab[_0xa6b7('0x24')]);if(_0x4f16ab[_0xa6b7('0x25')]){delete _0x4f16ab[_0xa6b7('0x25')];}_0x139fe7[_0xa6b7('0x17')](_0x25ac57)['send'](_0x4f16ab);};}exports[_0xa6b7('0x26')]=function(_0x4d17de,_0x1b63d8){var _0x5cb988={},_0x59d0fc={},_0x2065e8={'count':0x0,'rows':[]};var _0x33c2fd=db[_0xa6b7('0x27')][_0xa6b7('0x28')];_0x59d0fc[_0xa6b7('0x29')]=_['keys'](_0x33c2fd);var _0x167d97={'dateStart':_0x4d17de['query']['dateStart'],'dateEnd':_0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x2b')]};delete _0x4d17de[_0xa6b7('0x2a')]['dateStart'];delete _0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x2b')];_0x59d0fc[_0xa6b7('0x2a')]=_[_0xa6b7('0x2c')](_0x4d17de['query']);_0x59d0fc[_0xa6b7('0x2d')]=_[_0xa6b7('0x2e')](_0x59d0fc[_0xa6b7('0x29')],_0x59d0fc[_0xa6b7('0x2a')]);_0x5cb988[_0xa6b7('0x2f')]=_[_0xa6b7('0x2e')](_0x59d0fc[_0xa6b7('0x29')],qs[_0xa6b7('0x30')](_0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x30')]));_0x5cb988[_0xa6b7('0x2f')]=_0x5cb988[_0xa6b7('0x2f')][_0xa6b7('0x31')]?_0x5cb988[_0xa6b7('0x2f')]:_0x59d0fc[_0xa6b7('0x29')];if(!_0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x32')]('nolimit')){_0x5cb988[_0xa6b7('0x1b')]=qs[_0xa6b7('0x1b')](_0x4d17de['query'][_0xa6b7('0x1b')]);_0x5cb988[_0xa6b7('0x1a')]=qs[_0xa6b7('0x1a')](_0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x1a')]);}_0x5cb988['order']=qs['sort'](_0x4d17de['query'][_0xa6b7('0x33')]);_0x5cb988[_0xa6b7('0x34')]=qs[_0xa6b7('0x2d')](_[_0xa6b7('0x35')](_0x4d17de[_0xa6b7('0x2a')],_0x59d0fc['filters']));if(_0x167d97['dateStart']){if(_0x167d97[_0xa6b7('0x2b')]){_0x167d97[_0xa6b7('0x2b')]=moment(_0x167d97[_0xa6b7('0x2b')])[_0xa6b7('0x36')](0x1,'day');}else{_0x167d97[_0xa6b7('0x2b')]=moment(_0x167d97[_0xa6b7('0x37')])['add'](0x1,_0xa6b7('0x38'));}_[_0xa6b7('0x39')](_0x5cb988[_0xa6b7('0x34')],{'createdAt':{'$gte':_0x167d97['dateStart'],'$lte':_0x167d97['dateEnd']}});}if(_0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x3a')]){_0x5cb988[_0xa6b7('0x34')]=_[_0xa6b7('0x39')](_0x5cb988[_0xa6b7('0x34')],{'$or':_[_0xa6b7('0x3b')](_0x33c2fd,function(_0x2cac70){if(_0x2cac70['type'][_0xa6b7('0x3c')]!=='VIRTUAL'){var _0x286d6f={};_0x286d6f[_0x2cac70[_0xa6b7('0x3d')]]={'$like':'%'+_0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x3a')]+'%'};return _0x286d6f;}})});}_0x5cb988=_['merge']({},_0x5cb988,_0x4d17de[_0xa6b7('0x3e')]);var _0x136b12={'where':_0x5cb988[_0xa6b7('0x34')]};return db[_0xa6b7('0x27')][_0xa6b7('0x19')](_0x136b12)[_0xa6b7('0x20')](function(_0x9f26b3){_0x2065e8['count']=_0x9f26b3;if(_0x4d17de[_0xa6b7('0x2a')][_0xa6b7('0x3f')]){_0x5cb988[_0xa6b7('0x40')]=[{'all':!![]}];}return db[_0xa6b7('0x27')]['findAll'](_0x5cb988);})[_0xa6b7('0x20')](function(_0x291c16){_0x2065e8[_0xa6b7('0x41')]=_0x291c16;return _0x2065e8;})[_0xa6b7('0x20')](respondWithFilteredResult(_0x1b63d8,_0x5cb988))['catch'](handleError(_0x1b63d8,null));};exports[_0xa6b7('0x42')]=function(_0x3bb460,_0x230d42){var _0x749c86={'raw':![],'where':{'id':_0x3bb460[_0xa6b7('0x43')]['id']}},_0x148175={};_0x148175[_0xa6b7('0x29')]=_[_0xa6b7('0x2c')](db[_0xa6b7('0x27')]['rawAttributes']);_0x148175['query']=_['keys'](_0x3bb460['query']);_0x148175[_0xa6b7('0x2d')]=_[_0xa6b7('0x2e')](_0x148175[_0xa6b7('0x29')],_0x148175[_0xa6b7('0x2a')]);_0x749c86[_0xa6b7('0x2f')]=_[_0xa6b7('0x2e')](_0x148175[_0xa6b7('0x29')],qs[_0xa6b7('0x30')](_0x3bb460[_0xa6b7('0x2a')][_0xa6b7('0x30')]));_0x749c86[_0xa6b7('0x2f')]=_0x749c86[_0xa6b7('0x2f')][_0xa6b7('0x31')]?_0x749c86[_0xa6b7('0x2f')]:_0x148175[_0xa6b7('0x29')];if(_0x3bb460[_0xa6b7('0x2a')][_0xa6b7('0x3f')]){_0x749c86[_0xa6b7('0x40')]=[{'all':!![]}];}_0x749c86=_[_0xa6b7('0x39')]({},_0x749c86,_0x3bb460['options']);return db[_0xa6b7('0x27')][_0xa6b7('0x44')](_0x749c86)[_0xa6b7('0x20')](handleEntityNotFound(_0x230d42,null))[_0xa6b7('0x20')](respondWithResult(_0x230d42,null))['catch'](handleError(_0x230d42,null));};exports[_0xa6b7('0x45')]=function(_0x4aec1b,_0x80acc9){return db[_0xa6b7('0x27')][_0xa6b7('0x45')](_0x4aec1b['body'],{})['then'](function(_0x27b51c){var _0x249ee6=_0x4aec1b[_0xa6b7('0x46')]['get']({'plain':!![]});if(!_0x249ee6)throw new Error(_0xa6b7('0x47'));if(_0x249ee6[_0xa6b7('0x48')]===_0xa6b7('0x46')){var _0x4ba7b1=_0x27b51c[_0xa6b7('0x49')]({'plain':!![]});var _0x77a763=_0xa6b7('0x4a');return db[_0xa6b7('0x4b')][_0xa6b7('0x44')]({'where':{'name':_0x77a763,'userProfileId':_0x249ee6[_0xa6b7('0x4c')]},'raw':!![]})[_0xa6b7('0x20')](function(_0x2604f4){if(_0x2604f4&&_0x2604f4[_0xa6b7('0x4d')]===0x0){return db[_0xa6b7('0x22')][_0xa6b7('0x45')]({'name':_0x4ba7b1[_0xa6b7('0x25')],'resourceId':_0x4ba7b1['id'],'type':_0x2604f4[_0xa6b7('0x25')],'sectionId':_0x2604f4['id']},{})[_0xa6b7('0x20')](function(){return _0x27b51c;});}else{return _0x27b51c;}})[_0xa6b7('0x4e')](function(_0xe071bb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe071bb);throw _0xe071bb;});}return _0x27b51c;})[_0xa6b7('0x20')](respondWithResult(_0x80acc9,0xc9))[_0xa6b7('0x4e')](handleError(_0x80acc9,null));};exports['update']=function(_0x39b2da,_0x27be65){if(_0x39b2da[_0xa6b7('0x4f')]['id']){delete _0x39b2da[_0xa6b7('0x4f')]['id'];}return db['Trigger'][_0xa6b7('0x44')]({'where':{'id':_0x39b2da[_0xa6b7('0x43')]['id']}})[_0xa6b7('0x20')](handleEntityNotFound(_0x27be65,null))[_0xa6b7('0x20')](saveUpdates(_0x39b2da['body'],null))[_0xa6b7('0x20')](respondWithResult(_0x27be65,null))[_0xa6b7('0x4e')](handleError(_0x27be65,null));};exports[_0xa6b7('0x21')]=function(_0x3f3858,_0xb950b6){return db[_0xa6b7('0x27')][_0xa6b7('0x44')]({'where':{'id':_0x3f3858[_0xa6b7('0x43')]['id']}})[_0xa6b7('0x20')](handleEntityNotFound(_0xb950b6,null))[_0xa6b7('0x20')](removeEntity(_0xb950b6,null))['catch'](handleError(_0xb950b6,null));};exports[_0xa6b7('0x50')]=function(_0x47af27,_0x4f8972,_0x15fefd){if(_0x47af27[_0xa6b7('0x4f')]['id']){delete _0x47af27[_0xa6b7('0x4f')]['id'];}return db['Trigger'][_0xa6b7('0x44')]({'where':{'id':_0x47af27[_0xa6b7('0x43')]['id']}})[_0xa6b7('0x20')](handleEntityNotFound(_0x4f8972,null))[_0xa6b7('0x20')](function(_0x132189){if(_0x132189){_0x47af27[_0xa6b7('0x4f')][_0xa6b7('0x51')]=_0x132189['id'];return db[_0xa6b7('0x52')][_0xa6b7('0x45')](_0x47af27[_0xa6b7('0x4f')]);}})[_0xa6b7('0x20')](respondWithResult(_0x4f8972,null))[_0xa6b7('0x4e')](handleError(_0x4f8972,null));};exports[_0xa6b7('0x53')]=function(_0xcd7c11,_0x5486a0,_0x3e9d21){if(_0xcd7c11[_0xa6b7('0x4f')]['id']){delete _0xcd7c11[_0xa6b7('0x4f')]['id'];}return db['Trigger'][_0xa6b7('0x44')]({'where':{'id':_0xcd7c11[_0xa6b7('0x43')]['id']}})[_0xa6b7('0x20')](handleEntityNotFound(_0x5486a0,null))[_0xa6b7('0x20')](function(_0x10d300){if(_0x10d300){_0xcd7c11[_0xa6b7('0x4f')][_0xa6b7('0x54')]=_0x10d300['id'];return db[_0xa6b7('0x52')][_0xa6b7('0x45')](_0xcd7c11['body']);}})['then'](respondWithResult(_0x5486a0,null))['catch'](handleError(_0x5486a0,null));};exports[_0xa6b7('0x55')]=function(_0x445b7d,_0x107dcc,_0x13f68e){var _0x525ccb={};var _0x57d0e0={};var _0x41b062;var _0x19b29b;return db['Trigger']['findOne']({'where':{'id':_0x445b7d[_0xa6b7('0x43')]['id']}})[_0xa6b7('0x20')](handleEntityNotFound(_0x107dcc,null))['then'](function(_0xbd7917){if(_0xbd7917){_0x41b062=_0xbd7917;_0x57d0e0[_0xa6b7('0x29')]=_[_0xa6b7('0x2c')](db[_0xa6b7('0x52')][_0xa6b7('0x28')]);_0x57d0e0[_0xa6b7('0x2a')]=_[_0xa6b7('0x2c')](_0x445b7d['query']);_0x57d0e0[_0xa6b7('0x2d')]=_['intersection'](_0x57d0e0[_0xa6b7('0x29')],_0x57d0e0[_0xa6b7('0x2a')]);_0x525ccb['attributes']=_[_0xa6b7('0x2e')](_0x57d0e0[_0xa6b7('0x29')],qs['fields'](_0x445b7d[_0xa6b7('0x2a')]['fields']));_0x525ccb[_0xa6b7('0x2f')]=_0x525ccb[_0xa6b7('0x2f')][_0xa6b7('0x31')]?_0x525ccb[_0xa6b7('0x2f')]:_0x57d0e0[_0xa6b7('0x29')];_0x525ccb['order']=qs[_0xa6b7('0x33')](_0x445b7d['query']['sort']);_0x525ccb[_0xa6b7('0x34')]=qs['filters'](_[_0xa6b7('0x35')](_0x445b7d['query'],_0x57d0e0[_0xa6b7('0x2d')]));if(_0x445b7d[_0xa6b7('0x2a')][_0xa6b7('0x3a')]){_0x525ccb[_0xa6b7('0x34')]=_[_0xa6b7('0x39')](_0x525ccb[_0xa6b7('0x34')],{'$or':_[_0xa6b7('0x3b')](_0x525ccb['attributes'],function(_0x1a0769){var _0x1a0b60={};_0x1a0b60[_0x1a0769]={'$like':'%'+_0x445b7d['query'][_0xa6b7('0x3a')]+'%'};return _0x1a0b60;})});}_0x525ccb=_[_0xa6b7('0x39')]({},_0x525ccb,_0x445b7d['options']);return _0x41b062['getAllConditions'](_0x525ccb);}})[_0xa6b7('0x20')](function(_0x5e89c5){if(_0x5e89c5){_0x19b29b=_0x5e89c5[_0xa6b7('0x31')];if(!_0x445b7d[_0xa6b7('0x2a')][_0xa6b7('0x32')](_0xa6b7('0x56'))){_0x525ccb[_0xa6b7('0x1b')]=qs[_0xa6b7('0x1b')](_0x445b7d[_0xa6b7('0x2a')]['limit']);_0x525ccb[_0xa6b7('0x1a')]=qs[_0xa6b7('0x1a')](_0x445b7d[_0xa6b7('0x2a')]['offset']);}return _0x41b062[_0xa6b7('0x55')](_0x525ccb);}})[_0xa6b7('0x20')](function(_0x46e963){if(_0x46e963){return _0x46e963?{'count':_0x19b29b,'rows':_0x46e963}:null;}})[_0xa6b7('0x20')](respondWithResult(_0x107dcc,null))[_0xa6b7('0x4e')](handleError(_0x107dcc,null));};exports[_0xa6b7('0x57')]=function(_0x37d1f8,_0x5efe5b,_0x386eba){var _0x3e2010={};var _0x8c4641={};var _0x25ee3e;var _0x1fc3da;return db['Trigger'][_0xa6b7('0x58')]({'where':{'id':_0x37d1f8[_0xa6b7('0x43')]['id']}})[_0xa6b7('0x20')](handleEntityNotFound(_0x5efe5b,null))[_0xa6b7('0x20')](function(_0x3b8520){if(_0x3b8520){_0x25ee3e=_0x3b8520;_0x8c4641[_0xa6b7('0x29')]=_['keys'](db['Condition'][_0xa6b7('0x28')]);_0x8c4641[_0xa6b7('0x2a')]=_['keys'](_0x37d1f8[_0xa6b7('0x2a')]);_0x8c4641[_0xa6b7('0x2d')]=_[_0xa6b7('0x2e')](_0x8c4641['model'],_0x8c4641[_0xa6b7('0x2a')]);_0x3e2010[_0xa6b7('0x2f')]=_[_0xa6b7('0x2e')](_0x8c4641[_0xa6b7('0x29')],qs['fields'](_0x37d1f8[_0xa6b7('0x2a')]['fields']));_0x3e2010['attributes']=_0x3e2010[_0xa6b7('0x2f')][_0xa6b7('0x31')]?_0x3e2010[_0xa6b7('0x2f')]:_0x8c4641[_0xa6b7('0x29')];_0x3e2010[_0xa6b7('0x59')]=qs['sort'](_0x37d1f8['query'][_0xa6b7('0x33')]);_0x3e2010[_0xa6b7('0x34')]=qs[_0xa6b7('0x2d')](_[_0xa6b7('0x35')](_0x37d1f8['query'],_0x8c4641[_0xa6b7('0x2d')]));if(_0x37d1f8[_0xa6b7('0x2a')]['filter']){_0x3e2010['where']=_[_0xa6b7('0x39')](_0x3e2010[_0xa6b7('0x34')],{'$or':_[_0xa6b7('0x3b')](_0x3e2010['attributes'],function(_0x41f734){var _0x2867ae={};_0x2867ae[_0x41f734]={'$like':'%'+_0x37d1f8[_0xa6b7('0x2a')][_0xa6b7('0x3a')]+'%'};return _0x2867ae;})});}_0x3e2010=_['merge']({},_0x3e2010,_0x37d1f8[_0xa6b7('0x3e')]);return _0x25ee3e[_0xa6b7('0x57')](_0x3e2010);}})['then'](function(_0x2e4da0){if(_0x2e4da0){_0x1fc3da=_0x2e4da0[_0xa6b7('0x31')];if(!_0x37d1f8[_0xa6b7('0x2a')][_0xa6b7('0x32')](_0xa6b7('0x56'))){_0x3e2010[_0xa6b7('0x1b')]=qs[_0xa6b7('0x1b')](_0x37d1f8['query']['limit']);_0x3e2010['offset']=qs['offset'](_0x37d1f8[_0xa6b7('0x2a')]['offset']);}return _0x25ee3e['getAnyConditions'](_0x3e2010);}})[_0xa6b7('0x20')](function(_0x1d5a29){if(_0x1d5a29){return _0x1d5a29?{'count':_0x1fc3da,'rows':_0x1d5a29}:null;}})[_0xa6b7('0x20')](respondWithResult(_0x5efe5b,null))[_0xa6b7('0x4e')](handleError(_0x5efe5b,null));};exports[_0xa6b7('0x5a')]=function(_0x40ada3,_0x7f0e5,_0x52d210){if(_0x40ada3[_0xa6b7('0x4f')]['id']){delete _0x40ada3[_0xa6b7('0x4f')]['id'];}return db[_0xa6b7('0x27')][_0xa6b7('0x44')]({'where':{'id':_0x40ada3[_0xa6b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x7f0e5,null))[_0xa6b7('0x20')](function(_0x372275){if(_0x372275){_0x40ada3[_0xa6b7('0x4f')][_0xa6b7('0x5b')]=_0x372275['id'];return db['Action'][_0xa6b7('0x45')](_0x40ada3[_0xa6b7('0x4f')]);}})[_0xa6b7('0x20')](respondWithResult(_0x7f0e5,null))['catch'](handleError(_0x7f0e5,null));};exports[_0xa6b7('0x5c')]=function(_0x2f0e19,_0x1e9186,_0xbeff94){var _0x5591e6={};var _0x141dfd={};var _0x3a19fb;var _0x10b016;return db['Trigger'][_0xa6b7('0x58')]({'where':{'id':_0x2f0e19[_0xa6b7('0x43')]['id']}})['then'](handleEntityNotFound(_0x1e9186,null))[_0xa6b7('0x20')](function(_0xc84a8a){if(_0xc84a8a){_0x3a19fb=_0xc84a8a;_0x141dfd[_0xa6b7('0x29')]=_[_0xa6b7('0x2c')](db['Action'][_0xa6b7('0x28')]);_0x141dfd[_0xa6b7('0x2a')]=_['keys'](_0x2f0e19['query']);_0x141dfd[_0xa6b7('0x2d')]=_[_0xa6b7('0x2e')](_0x141dfd['model'],_0x141dfd[_0xa6b7('0x2a')]);_0x5591e6['attributes']=_[_0xa6b7('0x2e')](_0x141dfd['model'],qs['fields'](_0x2f0e19[_0xa6b7('0x2a')][_0xa6b7('0x30')]));_0x5591e6[_0xa6b7('0x2f')]=_0x5591e6[_0xa6b7('0x2f')][_0xa6b7('0x31')]?_0x5591e6['attributes']:_0x141dfd[_0xa6b7('0x29')];_0x5591e6[_0xa6b7('0x59')]=qs[_0xa6b7('0x33')](_0x2f0e19[_0xa6b7('0x2a')][_0xa6b7('0x33')]);_0x5591e6['where']=qs[_0xa6b7('0x2d')](_['pick'](_0x2f0e19['query'],_0x141dfd[_0xa6b7('0x2d')]));if(_0x2f0e19['query'][_0xa6b7('0x3a')]){_0x5591e6[_0xa6b7('0x34')]=_[_0xa6b7('0x39')](_0x5591e6['where'],{'$or':_[_0xa6b7('0x3b')](_0x5591e6[_0xa6b7('0x2f')],function(_0x3fd146){var _0x24f10b={};_0x24f10b[_0x3fd146]={'$like':'%'+_0x2f0e19[_0xa6b7('0x2a')][_0xa6b7('0x3a')]+'%'};return _0x24f10b;})});}_0x5591e6=_[_0xa6b7('0x39')]({},_0x5591e6,_0x2f0e19['options']);return _0x3a19fb[_0xa6b7('0x5c')](_0x5591e6);}})[_0xa6b7('0x20')](function(_0x52608e){if(_0x52608e){_0x10b016=_0x52608e[_0xa6b7('0x31')];if(!_0x2f0e19[_0xa6b7('0x2a')][_0xa6b7('0x32')](_0xa6b7('0x56'))){_0x5591e6[_0xa6b7('0x1b')]=qs['limit'](_0x2f0e19[_0xa6b7('0x2a')][_0xa6b7('0x1b')]);_0x5591e6['offset']=qs[_0xa6b7('0x1a')](_0x2f0e19[_0xa6b7('0x2a')][_0xa6b7('0x1a')]);}return _0x3a19fb[_0xa6b7('0x5c')](_0x5591e6);}})[_0xa6b7('0x20')](function(_0x3c99de){if(_0x3c99de){return _0x3c99de?{'count':_0x10b016,'rows':_0x3c99de}:null;}})[_0xa6b7('0x20')](respondWithResult(_0x1e9186,null))[_0xa6b7('0x4e')](handleError(_0x1e9186,null));};
\ No newline at end of file
index a518552..8cf5f44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33ef=['request-promise','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0x33ef,0x1be));var _0xf33e=function(_0x4c7dc9,_0x30c45d){_0x4c7dc9=_0x4c7dc9-0x0;var _0x47091b=_0x33ef[_0x4c7dc9];return _0x47091b;};'use strict';var _=require(_0xf33e('0x0'));var util=require(_0xf33e('0x1'));var logger=require(_0xf33e('0x2'))(_0xf33e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf33e('0x4'));var attributes=require(_0xf33e('0x5'));module[_0xf33e('0x6')]=function(_0x18f0f6,_0x11729a){return _0x18f0f6[_0xf33e('0x7')](_0xf33e('0x8'),attributes,{'tableName':_0xf33e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80a2=['bluebird','request-promise','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','moment'];(function(_0x39ccc9,_0x3e98e4){var _0x2a2e3a=function(_0x201950){while(--_0x201950){_0x39ccc9['push'](_0x39ccc9['shift']());}};_0x2a2e3a(++_0x3e98e4);}(_0x80a2,0xf9));var _0x280a=function(_0x22bd04,_0x24f11a){_0x22bd04=_0x22bd04-0x0;var _0x2ee138=_0x80a2[_0x22bd04];return _0x2ee138;};'use strict';var _=require(_0x280a('0x0'));var util=require(_0x280a('0x1'));var logger=require(_0x280a('0x2'))('api');var moment=require(_0x280a('0x3'));var BPromise=require(_0x280a('0x4'));var rp=require(_0x280a('0x5'));var attributes=require(_0x280a('0x6'));module[_0x280a('0x7')]=function(_0x375ea2,_0xda9572){return _0x375ea2[_0x280a('0x8')](_0x280a('0x9'),attributes,{'tableName':_0x280a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fae2054..963f402 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e6e=['then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetTrigger','findAll','options','raw','where','include','map','model','attributes','ShowTrigger','Trigger','find','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x505df9,_0x14138e){var _0x1cc025=function(_0x5d2a1f){while(--_0x5d2a1f){_0x505df9['push'](_0x505df9['shift']());}};_0x1cc025(++_0x14138e);}(_0x1e6e,0xb6));var _0xe1e6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x1e6e[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0xe1e6('0x0'));var util=require('util');var moment=require(_0xe1e6('0x1'));var BPromise=require(_0xe1e6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1e6('0x3'))['db'];var utils=require(_0xe1e6('0x4'));var logger=require(_0xe1e6('0x5'))('rpc');var config=require(_0xe1e6('0x6'));var jayson=require(_0xe1e6('0x7'));var client=jayson[_0xe1e6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46cfde,_0xa0a675,_0x1e5edf){return new BPromise(function(_0x3251b5,_0x2fa39f){return client[_0xe1e6('0x9')](_0x46cfde,_0x1e5edf)[_0xe1e6('0xa')](function(_0x5529c8){logger[_0xe1e6('0xb')](_0xe1e6('0xc'),_0xa0a675,_0xe1e6('0xd'));logger[_0xe1e6('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0xa0a675,_0xe1e6('0xd'),JSON[_0xe1e6('0xf')](_0x5529c8));if(_0x5529c8[_0xe1e6('0x10')]){if(_0x5529c8[_0xe1e6('0x10')]['code']===0x1f4){logger[_0xe1e6('0x10')]('Trigger,\x20%s,\x20%s',_0xa0a675,_0x5529c8[_0xe1e6('0x10')][_0xe1e6('0x11')]);return _0x2fa39f(_0x5529c8[_0xe1e6('0x10')][_0xe1e6('0x11')]);}logger[_0xe1e6('0x10')](_0xe1e6('0xc'),_0xa0a675,_0x5529c8[_0xe1e6('0x10')][_0xe1e6('0x11')]);return _0x3251b5(_0x5529c8[_0xe1e6('0x10')][_0xe1e6('0x11')]);}else{logger[_0xe1e6('0xb')](_0xe1e6('0xc'),_0xa0a675,'request\x20sent');_0x3251b5(_0x5529c8[_0xe1e6('0x12')][_0xe1e6('0x11')]);}})[_0xe1e6('0x13')](function(_0x5efda2){logger[_0xe1e6('0x10')](_0xe1e6('0xc'),_0xa0a675,_0x5efda2);_0x2fa39f(_0x5efda2);});});}exports[_0xe1e6('0x14')]=function(_0x49426d){var _0x570985=this;return new Promise(function(_0x58602e,_0x582f0d){return db['Trigger'][_0xe1e6('0x15')]({'raw':_0x49426d['options']?_0x49426d[_0xe1e6('0x16')][_0xe1e6('0x17')]===undefined?!![]:![]:!![],'where':_0x49426d[_0xe1e6('0x16')]?_0x49426d[_0xe1e6('0x16')][_0xe1e6('0x18')]||null:null,'attributes':_0x49426d['options']?_0x49426d[_0xe1e6('0x16')]['attributes']||null:null,'limit':_0x49426d[_0xe1e6('0x16')]?_0x49426d[_0xe1e6('0x16')]['limit']||null:null,'include':_0x49426d[_0xe1e6('0x16')]?_0x49426d[_0xe1e6('0x16')][_0xe1e6('0x19')]?_[_0xe1e6('0x1a')](_0x49426d[_0xe1e6('0x16')][_0xe1e6('0x19')],function(_0x15ccc1){return{'model':db[_0x15ccc1[_0xe1e6('0x1b')]],'as':_0x15ccc1['as'],'attributes':_0x15ccc1[_0xe1e6('0x1c')],'include':_0x15ccc1['include']?_[_0xe1e6('0x1a')](_0x15ccc1['include'],function(_0x56692b){return{'model':db[_0x56692b[_0xe1e6('0x1b')]],'as':_0x56692b['as'],'attributes':_0x56692b[_0xe1e6('0x1c')],'include':_0x56692b['include']?_['map'](_0x56692b[_0xe1e6('0x19')],function(_0x479635){return{'model':db[_0x479635[_0xe1e6('0x1b')]],'as':_0x479635['as'],'attributes':_0x479635[_0xe1e6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe1e6('0xa')](function(_0x2d8197){logger[_0xe1e6('0xb')](_0xe1e6('0x14'),_0x49426d);logger[_0xe1e6('0xe')](_0xe1e6('0x14'),_0x49426d,JSON[_0xe1e6('0xf')](_0x2d8197));_0x58602e(_0x2d8197);})['catch'](function(_0x1c7466){logger['error'](_0xe1e6('0x14'),_0x1c7466[_0xe1e6('0x11')],_0x49426d);_0x582f0d(_0x570985[_0xe1e6('0x10')](0x1f4,_0x1c7466[_0xe1e6('0x11')]));});});};exports[_0xe1e6('0x1d')]=function(_0x58c9c9){var _0x7fde09=this;return new Promise(function(_0x3aa5a7,_0x257718){return db[_0xe1e6('0x1e')][_0xe1e6('0x1f')]({'raw':_0x58c9c9[_0xe1e6('0x16')]?_0x58c9c9[_0xe1e6('0x16')][_0xe1e6('0x17')]===undefined?!![]:![]:!![],'where':_0x58c9c9[_0xe1e6('0x16')]?_0x58c9c9['options']['where']||null:null,'attributes':_0x58c9c9[_0xe1e6('0x16')]?_0x58c9c9[_0xe1e6('0x16')][_0xe1e6('0x1c')]||null:null,'include':_0x58c9c9[_0xe1e6('0x16')]?_0x58c9c9['options'][_0xe1e6('0x19')]?_[_0xe1e6('0x1a')](_0x58c9c9[_0xe1e6('0x16')][_0xe1e6('0x19')],function(_0x13bec7){return{'model':db[_0x13bec7[_0xe1e6('0x1b')]],'as':_0x13bec7['as'],'attributes':_0x13bec7[_0xe1e6('0x1c')],'include':_0x13bec7[_0xe1e6('0x19')]?_[_0xe1e6('0x1a')](_0x13bec7[_0xe1e6('0x19')],function(_0x20fe33){return{'model':db[_0x20fe33[_0xe1e6('0x1b')]],'as':_0x20fe33['as'],'attributes':_0x20fe33[_0xe1e6('0x1c')],'include':_0x20fe33['include']?_[_0xe1e6('0x1a')](_0x20fe33['include'],function(_0x55b07b){return{'model':db[_0x55b07b['model']],'as':_0x55b07b['as'],'attributes':_0x55b07b[_0xe1e6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe1e6('0xa')](function(_0x393708){logger['info'](_0xe1e6('0x1d'),_0x58c9c9);logger[_0xe1e6('0xe')](_0xe1e6('0x1d'),_0x58c9c9,JSON[_0xe1e6('0xf')](_0x393708));_0x3aa5a7(_0x393708);})[_0xe1e6('0x13')](function(_0x1e3cb4){logger[_0xe1e6('0x10')](_0xe1e6('0x1d'),_0x1e3cb4[_0xe1e6('0x11')],_0x58c9c9);_0x257718(_0x7fde09[_0xe1e6('0x10')](0x1f4,_0x1e3cb4[_0xe1e6('0x11')]));});});};
\ No newline at end of file
+var _0xeb2d=['message','info','result','GetTrigger','Trigger','options','raw','attributes','limit','include','map','model','stringify','catch','find','where','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x658f62,_0x417091){var _0x3b6e9a=function(_0x460406){while(--_0x460406){_0x658f62['push'](_0x658f62['shift']());}};_0x3b6e9a(++_0x417091);}(_0xeb2d,0x1cd));var _0xdeb2=function(_0x213cf6,_0x334452){_0x213cf6=_0x213cf6-0x0;var _0x406fc0=_0xeb2d[_0x213cf6];return _0x406fc0;};'use strict';var _=require(_0xdeb2('0x0'));var util=require(_0xdeb2('0x1'));var moment=require(_0xdeb2('0x2'));var BPromise=require(_0xdeb2('0x3'));var rs=require(_0xdeb2('0x4'));var fs=require('fs');var Redis=require(_0xdeb2('0x5'));var db=require(_0xdeb2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdeb2('0x7'))(_0xdeb2('0x8'));var config=require(_0xdeb2('0x9'));var jayson=require(_0xdeb2('0xa'));var client=jayson['client'][_0xdeb2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x128e1e,_0x12851e,_0xaa0b67){return new BPromise(function(_0x37269b,_0x32a2a6){return client[_0xdeb2('0xc')](_0x128e1e,_0xaa0b67)[_0xdeb2('0xd')](function(_0x3304b3){logger['info'](_0xdeb2('0xe'),_0x12851e,_0xdeb2('0xf'));logger[_0xdeb2('0x10')](_0xdeb2('0x11'),_0x12851e,_0xdeb2('0xf'),JSON['stringify'](_0x3304b3));if(_0x3304b3[_0xdeb2('0x12')]){if(_0x3304b3['error'][_0xdeb2('0x13')]===0x1f4){logger[_0xdeb2('0x12')](_0xdeb2('0xe'),_0x12851e,_0x3304b3[_0xdeb2('0x12')][_0xdeb2('0x14')]);return _0x32a2a6(_0x3304b3[_0xdeb2('0x12')]['message']);}logger[_0xdeb2('0x12')](_0xdeb2('0xe'),_0x12851e,_0x3304b3[_0xdeb2('0x12')]['message']);return _0x37269b(_0x3304b3[_0xdeb2('0x12')][_0xdeb2('0x14')]);}else{logger[_0xdeb2('0x15')](_0xdeb2('0xe'),_0x12851e,_0xdeb2('0xf'));_0x37269b(_0x3304b3[_0xdeb2('0x16')][_0xdeb2('0x14')]);}})['catch'](function(_0x197024){logger[_0xdeb2('0x12')](_0xdeb2('0xe'),_0x12851e,_0x197024);_0x32a2a6(_0x197024);});});}exports[_0xdeb2('0x17')]=function(_0x1b536c){var _0x1ab4fd=this;return new Promise(function(_0x46bb97,_0x265b8f){return db[_0xdeb2('0x18')]['findAll']({'raw':_0x1b536c[_0xdeb2('0x19')]?_0x1b536c['options'][_0xdeb2('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b536c[_0xdeb2('0x19')]?_0x1b536c['options']['where']||null:null,'attributes':_0x1b536c[_0xdeb2('0x19')]?_0x1b536c[_0xdeb2('0x19')][_0xdeb2('0x1b')]||null:null,'limit':_0x1b536c[_0xdeb2('0x19')]?_0x1b536c[_0xdeb2('0x19')][_0xdeb2('0x1c')]||null:null,'include':_0x1b536c[_0xdeb2('0x19')]?_0x1b536c[_0xdeb2('0x19')][_0xdeb2('0x1d')]?_[_0xdeb2('0x1e')](_0x1b536c[_0xdeb2('0x19')][_0xdeb2('0x1d')],function(_0x20e69f){return{'model':db[_0x20e69f['model']],'as':_0x20e69f['as'],'attributes':_0x20e69f[_0xdeb2('0x1b')],'include':_0x20e69f[_0xdeb2('0x1d')]?_[_0xdeb2('0x1e')](_0x20e69f[_0xdeb2('0x1d')],function(_0x22813a){return{'model':db[_0x22813a[_0xdeb2('0x1f')]],'as':_0x22813a['as'],'attributes':_0x22813a[_0xdeb2('0x1b')],'include':_0x22813a[_0xdeb2('0x1d')]?_[_0xdeb2('0x1e')](_0x22813a[_0xdeb2('0x1d')],function(_0x5e1f3a){return{'model':db[_0x5e1f3a[_0xdeb2('0x1f')]],'as':_0x5e1f3a['as'],'attributes':_0x5e1f3a[_0xdeb2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdeb2('0xd')](function(_0x50c87c){logger[_0xdeb2('0x15')]('GetTrigger',_0x1b536c);logger[_0xdeb2('0x10')]('GetTrigger',_0x1b536c,JSON[_0xdeb2('0x20')](_0x50c87c));_0x46bb97(_0x50c87c);})[_0xdeb2('0x21')](function(_0x14e399){logger[_0xdeb2('0x12')]('GetTrigger',_0x14e399[_0xdeb2('0x14')],_0x1b536c);_0x265b8f(_0x1ab4fd[_0xdeb2('0x12')](0x1f4,_0x14e399[_0xdeb2('0x14')]));});});};exports['ShowTrigger']=function(_0x2ff987){var _0x427d60=this;return new Promise(function(_0x1584b9,_0x45d572){return db['Trigger'][_0xdeb2('0x22')]({'raw':_0x2ff987['options']?_0x2ff987[_0xdeb2('0x19')][_0xdeb2('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ff987[_0xdeb2('0x19')]?_0x2ff987[_0xdeb2('0x19')][_0xdeb2('0x23')]||null:null,'attributes':_0x2ff987['options']?_0x2ff987[_0xdeb2('0x19')][_0xdeb2('0x1b')]||null:null,'include':_0x2ff987[_0xdeb2('0x19')]?_0x2ff987[_0xdeb2('0x19')][_0xdeb2('0x1d')]?_[_0xdeb2('0x1e')](_0x2ff987[_0xdeb2('0x19')][_0xdeb2('0x1d')],function(_0x2db4e1){return{'model':db[_0x2db4e1[_0xdeb2('0x1f')]],'as':_0x2db4e1['as'],'attributes':_0x2db4e1[_0xdeb2('0x1b')],'include':_0x2db4e1[_0xdeb2('0x1d')]?_[_0xdeb2('0x1e')](_0x2db4e1[_0xdeb2('0x1d')],function(_0x432d7b){return{'model':db[_0x432d7b[_0xdeb2('0x1f')]],'as':_0x432d7b['as'],'attributes':_0x432d7b[_0xdeb2('0x1b')],'include':_0x432d7b[_0xdeb2('0x1d')]?_[_0xdeb2('0x1e')](_0x432d7b['include'],function(_0x24affe){return{'model':db[_0x24affe[_0xdeb2('0x1f')]],'as':_0x24affe['as'],'attributes':_0x24affe['attributes']};}):[]};}):[]};}):[]:[]})[_0xdeb2('0xd')](function(_0x54aa8d){logger['info'](_0xdeb2('0x24'),_0x2ff987);logger[_0xdeb2('0x10')](_0xdeb2('0x24'),_0x2ff987,JSON['stringify'](_0x54aa8d));_0x1584b9(_0x54aa8d);})[_0xdeb2('0x21')](function(_0x5cfd0a){logger[_0xdeb2('0x12')]('ShowTrigger',_0x5cfd0a[_0xdeb2('0x14')],_0x2ff987);_0x45d572(_0x427d60[_0xdeb2('0x12')](0x1f4,_0x5cfd0a['message']));});});};
\ No newline at end of file
index 77c1565..248cc2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ed6=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','post','/:id/clone','clone'];(function(_0x4aefca,_0x3b2fd8){var _0x47277c=function(_0x664764){while(--_0x664764){_0x4aefca['push'](_0x4aefca['shift']());}};_0x47277c(++_0x3b2fd8);}(_0x7ed6,0x1e5));var _0x67ed=function(_0x302cad,_0x8da3a6){_0x302cad=_0x302cad-0x0;var _0xa0f441=_0x7ed6[_0x302cad];return _0xa0f441;};'use strict';var multer=require(_0x67ed('0x0'));var util=require(_0x67ed('0x1'));var path=require(_0x67ed('0x2'));var timeout=require(_0x67ed('0x3'));var express=require(_0x67ed('0x4'));var router=express[_0x67ed('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x67ed('0x6'));var config=require(_0x67ed('0x7'));var controller=require(_0x67ed('0x8'));router[_0x67ed('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x67ed('0x9')]('/:id',auth[_0x67ed('0xa')](),controller[_0x67ed('0xb')]);router[_0x67ed('0xc')](_0x67ed('0xd'),auth[_0x67ed('0xa')](),controller[_0x67ed('0xe')]);router[_0x67ed('0xc')]('/',auth[_0x67ed('0xa')](),controller['create']);router['put'](_0x67ed('0xf'),auth[_0x67ed('0xa')](),controller[_0x67ed('0x10')]);router[_0x67ed('0x11')]('/:id',auth[_0x67ed('0xa')](),controller[_0x67ed('0x12')]);module[_0x67ed('0x13')]=router;
\ No newline at end of file
+var _0xc510=['../../config/environment','get','isAuthenticated','/:id','post','/:id/clone','clone','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4e39f6,_0xc3c89e){var _0x2a13b9=function(_0x5163df){while(--_0x5163df){_0x4e39f6['push'](_0x4e39f6['shift']());}};_0x2a13b9(++_0xc3c89e);}(_0xc510,0x150));var _0x0c51=function(_0x2f7d20,_0x3f8989){_0x2f7d20=_0x2f7d20-0x0;var _0x4e00fe=_0xc510[_0x2f7d20];return _0x4e00fe;};'use strict';var multer=require('multer');var util=require(_0x0c51('0x0'));var path=require(_0x0c51('0x1'));var timeout=require(_0x0c51('0x2'));var express=require(_0x0c51('0x3'));var router=express[_0x0c51('0x4')]();var auth=require(_0x0c51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0c51('0x6'));var controller=require('./trunk.controller');router[_0x0c51('0x7')]('/',auth[_0x0c51('0x8')](),controller['index']);router[_0x0c51('0x7')](_0x0c51('0x9'),auth[_0x0c51('0x8')](),controller['show']);router[_0x0c51('0xa')](_0x0c51('0xb'),auth[_0x0c51('0x8')](),controller[_0x0c51('0xc')]);router[_0x0c51('0xa')]('/',auth[_0x0c51('0x8')](),controller[_0x0c51('0xd')]);router[_0x0c51('0xe')](_0x0c51('0x9'),auth[_0x0c51('0x8')](),controller[_0x0c51('0xf')]);router['delete']('/:id',auth[_0x0c51('0x8')](),controller[_0x0c51('0x10')]);module[_0x0c51('0x11')]=router;
\ No newline at end of file
index 6863975..acbad24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x44cacf,_0x3d39eb){var _0x439ebb=function(_0x623e42){while(--_0x623e42){_0x44cacf['push'](_0x44cacf['shift']());}};_0x439ebb(++_0x3d39eb);}(_0xb10b,0x12a));var _0xbb10=function(_0x17eb11,_0x25d8c6){_0x17eb11=_0x17eb11-0x0;var _0x559093=_0xb10b[_0x17eb11];return _0x559093;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('friend',_0xbb10('0x4'),_0xbb10('0x5')),'allowNull':![],'defaultValue':_0xbb10('0x6')},'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x7')},'callingpres':{'type':Sequelize[_0xbb10('0x3')]('ALLOWED_NOT_SCREENED',_0xbb10('0x8'),_0xbb10('0x9'),'ALLOWED',_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc'),_0xbb10('0xd'))},'deny':{'type':Sequelize[_0xbb10('0x1')]},'permit':{'type':Sequelize[_0xbb10('0x1')]},'secret':{'type':Sequelize[_0xbb10('0x1')]},'md5secret':{'type':Sequelize[_0xbb10('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xe'),'set':function(_0x118a74){this[_0xbb10('0xf')]('transport',_0x118a74?_0x118a74[_0xbb10('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x11'))?this[_0xbb10('0x12')](_0xbb10('0x11'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x14')},'dtmfmode':{'type':Sequelize[_0xbb10('0x3')]('rfc2833',_0xbb10('0x15'),_0xbb10('0x16'),_0xbb10('0x17'),_0xbb10('0x18')),'defaultValue':_0xbb10('0x19')},'directmedia':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb10('0x1')]},'nat':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x1e'),'set':function(_0x1682a4){this[_0xbb10('0xf')](_0xbb10('0x1f'),_0x1682a4?_0x1682a4[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')]('nat')?this[_0xbb10('0x12')](_0xbb10('0x1f'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x20')},'callgroup':{'type':Sequelize[_0xbb10('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb10('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x1')]},'language':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x21')},'allow':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x22'),'set':function(_0x317da4){this[_0xbb10('0xf')](_0xbb10('0x23'),_0x317da4?_0x317da4[_0xbb10('0x10')](';'):_0xbb10('0x22'));},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x23'))?this[_0xbb10('0x12')](_0xbb10('0x23'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'insecure':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x24'),'set':function(_0x4e25ff){this[_0xbb10('0xf')](_0xbb10('0x25'),_0x4e25ff?_0x4e25ff[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x25'))?this[_0xbb10('0x12')](_0xbb10('0x25'))['split'](','):null;},'comment':_0xbb10('0x26')},'trustrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbb10('0x28')](0xb)},'setvar':{'type':Sequelize[_0xbb10('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbb10('0x1')]},'callcounter':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':_0xbb10('0x1a')},'busylevel':{'type':Sequelize[_0xbb10('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbb10('0x1')]},'template':{'type':Sequelize[_0xbb10('0x1')]},'videosupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbb10('0x1')]},'session_timers':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2a'),_0xbb10('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xbb10('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbb10('0x2c'),_0xbb10('0x2d')),'defaultValue':_0xbb10('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x1')]},'regexten':{'type':Sequelize[_0xbb10('0x1')]},'fromdomain':{'type':Sequelize[_0xbb10('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb10('0x1')]},'defaultuser':{'type':Sequelize[_0xbb10('0x1')]},'rtptimeout':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x1')]},'callbackextension':{'type':Sequelize[_0xbb10('0x1')]},'timert1':{'type':Sequelize[_0xbb10('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbb10('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbb10('0x1')]},'contactdeny':{'type':Sequelize[_0xbb10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbb10('0x1')]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x1')]},'maxforwards':{'type':Sequelize[_0xbb10('0x28')](0xb)},'encryption':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xbb10('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbb10('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbb10('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2f'),'passive',_0xbb10('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x1')]},'usereqphone':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb10('0x1')]},'call_limit':{'type':Sequelize[_0xbb10('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbb10('0x1')]},'mohinterpret':{'type':Sequelize[_0xbb10('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb10('0x1')]},'parkinglot':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x31')},'canreinvite':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb10('0x1')]},'otherFields':{'type':Sequelize[_0xbb10('0x1')]},'active':{'type':Sequelize[_0xbb10('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xb10b=['udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','fingerprint','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x3bc95c,_0x4dfaab){var _0xc4d749=function(_0x214dc1){while(--_0x214dc1){_0x3bc95c['push'](_0x3bc95c['shift']());}};_0xc4d749(++_0x4dfaab);}(_0xb10b,0x12a));var _0xbb10=function(_0x7a2a2f,_0x26057a){_0x7a2a2f=_0x7a2a2f-0x0;var _0x4fbb2a=_0xb10b[_0x7a2a2f];return _0x4fbb2a;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbb10('0x3')]('friend',_0xbb10('0x4'),_0xbb10('0x5')),'allowNull':![],'defaultValue':_0xbb10('0x6')},'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x7')},'callingpres':{'type':Sequelize[_0xbb10('0x3')]('ALLOWED_NOT_SCREENED',_0xbb10('0x8'),_0xbb10('0x9'),'ALLOWED',_0xbb10('0xa'),_0xbb10('0xb'),_0xbb10('0xc'),_0xbb10('0xd'))},'deny':{'type':Sequelize[_0xbb10('0x1')]},'permit':{'type':Sequelize[_0xbb10('0x1')]},'secret':{'type':Sequelize[_0xbb10('0x1')]},'md5secret':{'type':Sequelize[_0xbb10('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xe'),'set':function(_0x118a74){this[_0xbb10('0xf')]('transport',_0x118a74?_0x118a74[_0xbb10('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xbb10('0x11'))?this[_0xbb10('0x12')](_0xbb10('0x11'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x14')},'dtmfmode':{'type':Sequelize[_0xbb10('0x3')]('rfc2833',_0xbb10('0x15'),_0xbb10('0x16'),_0xbb10('0x17'),_0xbb10('0x18')),'defaultValue':_0xbb10('0x19')},'directmedia':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbb10('0x1')]},'directmediadeny':{'type':Sequelize[_0xbb10('0x1')]},'nat':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x1e'),'set':function(_0x1682a4){this[_0xbb10('0xf')](_0xbb10('0x1f'),_0x1682a4?_0x1682a4[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')]('nat')?this[_0xbb10('0x12')](_0xbb10('0x1f'))[_0xbb10('0x13')](','):null;},'comment':_0xbb10('0x20')},'callgroup':{'type':Sequelize[_0xbb10('0x1')]},'namedcallgroup':{'type':Sequelize[_0xbb10('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbb10('0x1')]},'language':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x21')},'allow':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x22'),'set':function(_0x317da4){this[_0xbb10('0xf')](_0xbb10('0x23'),_0x317da4?_0x317da4[_0xbb10('0x10')](';'):_0xbb10('0x22'));},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x23'))?this[_0xbb10('0x12')](_0xbb10('0x23'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'insecure':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':_0xbb10('0x24'),'set':function(_0x4e25ff){this[_0xbb10('0xf')](_0xbb10('0x25'),_0x4e25ff?_0x4e25ff[_0xbb10('0x10')](','):null);},'get':function(){return this[_0xbb10('0x12')](_0xbb10('0x25'))?this[_0xbb10('0x12')](_0xbb10('0x25'))['split'](','):null;},'comment':_0xbb10('0x26')},'trustrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x27'))},'promiscredir':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xbb10('0x28')](0xb)},'setvar':{'type':Sequelize[_0xbb10('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xbb10('0x1')]},'callcounter':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':_0xbb10('0x1a')},'busylevel':{'type':Sequelize[_0xbb10('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xbb10('0x1')]},'template':{'type':Sequelize[_0xbb10('0x1')]},'videosupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xbb10('0x1')]},'session_timers':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2a'),_0xbb10('0x2b'),'originate')},'session_expires':{'type':Sequelize[_0xbb10('0x28')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xbb10('0x2c'),_0xbb10('0x2d')),'defaultValue':_0xbb10('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0xbb10('0x1')]},'regexten':{'type':Sequelize[_0xbb10('0x1')]},'fromdomain':{'type':Sequelize[_0xbb10('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xbb10('0x28')](0x5)},'qualify':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xbb10('0x1')]},'defaultuser':{'type':Sequelize[_0xbb10('0x1')]},'rtptimeout':{'type':Sequelize[_0xbb10('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xbb10('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbb10('0x1')]},'callbackextension':{'type':Sequelize[_0xbb10('0x1')]},'timert1':{'type':Sequelize[_0xbb10('0x28')](0xb)},'timerb':{'type':Sequelize[_0xbb10('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xbb10('0x1')]},'contactdeny':{'type':Sequelize[_0xbb10('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xbb10('0x1')]},'use_q850_reason':{'type':Sequelize[_0xbb10('0x1')]},'maxforwards':{'type':Sequelize[_0xbb10('0x28')](0xb)},'encryption':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbb10('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xbb10('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no',_0xbb10('0x2e'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xbb10('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xbb10('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xbb10('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x2f'),'passive',_0xbb10('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbb10('0x1')]},'usereqphone':{'type':Sequelize[_0xbb10('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbb10('0x1')]},'recordofffeature':{'type':Sequelize[_0xbb10('0x1')]},'call_limit':{'type':Sequelize[_0xbb10('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xbb10('0x3')](_0xbb10('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xbb10('0x1')]},'mohinterpret':{'type':Sequelize[_0xbb10('0x1')]},'mohsuggest':{'type':Sequelize[_0xbb10('0x1')]},'parkinglot':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0x31')},'canreinvite':{'type':Sequelize[_0xbb10('0x3')]('yes','no',_0xbb10('0x1b'),_0xbb10('0x1c'),_0xbb10('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xbb10('0x1')]},'otherFields':{'type':Sequelize[_0xbb10('0x1')]},'active':{'type':Sequelize[_0xbb10('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index 780c9a3..9add258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63ce=['utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','server/files/templates/registry.ejs','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','set','Content-Range','save','update','destroy','get','Trunks','UserProfileResource','then','stack','name','send','index','Trunk','model','keys','query','dateStart','intersection','attributes','length','limit','order','sort','where','pick','filters','dateEnd','add','day','merge','filter','map','type','field','options','count','includeAll','findAll','show','params','rawAttributes','fields','include','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs'];(function(_0x4fdbc9,_0x38184f){var _0x1afd74=function(_0x5106fb){while(--_0x5106fb){_0x4fdbc9['push'](_0x4fdbc9['shift']());}};_0x1afd74(++_0x38184f);}(_0x63ce,0x147));var _0xe63c=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x63ce[_0x152678];return _0x311a9;};'use strict';var pdf=require(_0xe63c('0x0'));var emlformat=require(_0xe63c('0x1'));var rimraf=require(_0xe63c('0x2'));var zipdir=require(_0xe63c('0x3'));var jsonpatch=require(_0xe63c('0x4'));var rp=require(_0xe63c('0x5'));var moment=require('moment');var BPromise=require(_0xe63c('0x6'));var Mustache=require(_0xe63c('0x7'));var util=require(_0xe63c('0x8'));var path=require(_0xe63c('0x9'));var sox=require('sox');var csv=require(_0xe63c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe63c('0xb'));var jsforce=require(_0xe63c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe63c('0xa'));var querystring=require(_0xe63c('0xd'));var Papa=require('papaparse');var Redis=require(_0xe63c('0xe'));var qs=require(_0xe63c('0xf'));var logger=require(_0xe63c('0x10'))(_0xe63c('0x11'));var utils=require(_0xe63c('0x12'));var config=require('../../config/environment');var db=require(_0xe63c('0x13'))['db'];var jayson=require(_0xe63c('0x14'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x245962,_0x2e4cbf,_0x5f0c6c,_0xa24a15){return new BPromise(function(_0x2c1f7f,_0x4eae80){var _0x5c0e61=_0xa24a15||client;return _0x5c0e61['request'](_0x245962,_0x5f0c6c)['then'](function(_0xf3046a){logger[_0xe63c('0x15')](_0xe63c('0x16'),_0x2e4cbf,_0xe63c('0x17'));logger[_0xe63c('0x18')](_0xe63c('0x19'),_0x2e4cbf,_0xe63c('0x17'),JSON[_0xe63c('0x1a')](_0xf3046a));if(_0xf3046a[_0xe63c('0x1b')]){if(_0xf3046a[_0xe63c('0x1b')]['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2e4cbf,_0xf3046a[_0xe63c('0x1b')][_0xe63c('0x1c')]);return _0x4eae80(_0xf3046a['error'][_0xe63c('0x1c')]);}logger[_0xe63c('0x1b')]('Trunk,\x20%s,\x20%s',_0x2e4cbf,_0xf3046a[_0xe63c('0x1b')][_0xe63c('0x1c')]);return _0x2c1f7f(_0xf3046a[_0xe63c('0x1b')][_0xe63c('0x1c')]);}else{logger['info'](_0xe63c('0x16'),_0x2e4cbf,'request\x20sent');_0x2c1f7f(_0xf3046a['result'][_0xe63c('0x1c')]);}})[_0xe63c('0x1d')](function(_0x4022a4){logger['error']('Trunk,\x20%s,\x20%s',_0x2e4cbf,_0x4022a4);_0x4eae80(_0x4022a4);});});}function respondWithStatusCode(_0x54b1a7,_0x2eb368){_0x2eb368=_0x2eb368||0xcc;return function(_0x43f8fa){if(_0x43f8fa){return _0x54b1a7[_0xe63c('0x1e')](_0x2eb368);}return _0x54b1a7[_0xe63c('0x1f')](_0x2eb368)[_0xe63c('0x20')]();};}function respondWithResult(_0x51b31,_0x13ceaf){_0x13ceaf=_0x13ceaf||0xc8;return function(_0x34da92){if(_0x34da92){return _0x51b31[_0xe63c('0x1f')](_0x13ceaf)[_0xe63c('0x21')](_0x34da92);}};}function respondWithFilteredResult(_0x3ad4b6,_0x8f585){return function(_0x19a190){if(_0x19a190){var _0x45f2d2=_0x19a190['count'],_0x4d26f2=_0x8f585[_0xe63c('0x22')],_0x27d4a1=_0x8f585[_0xe63c('0x22')]+_0x8f585['limit'],_0x10d0fd;if(_0x27d4a1>=_0x45f2d2){_0x27d4a1=_0x45f2d2;_0x10d0fd=0xc8;}else{_0x10d0fd=0xce;}_0x3ad4b6['status'](_0x10d0fd);return _0x3ad4b6[_0xe63c('0x23')](_0xe63c('0x24'),_0x4d26f2+'-'+_0x27d4a1+'/'+_0x45f2d2)[_0xe63c('0x21')](_0x19a190);}return null;};}function patchUpdates(_0x27519d){return function(_0x51569a){try{jsonpatch['apply'](_0x51569a,_0x27519d,!![]);}catch(_0x2dfbc7){return BPromise['reject'](_0x2dfbc7);}return _0x51569a[_0xe63c('0x25')]();};}function saveUpdates(_0x35ec1a,_0x1563bc){return function(_0x16b52e){if(_0x16b52e){return _0x16b52e[_0xe63c('0x26')](_0x35ec1a)['then'](function(_0x5cf687){return _0x5cf687;});}return null;};}function removeEntity(_0x33ede4,_0x333bf1){return function(_0x58c4a6){if(_0x58c4a6){return _0x58c4a6[_0xe63c('0x27')]()['then'](function(){var _0x36b43a=_0x58c4a6[_0xe63c('0x28')]({'plain':!![]});var _0x3eb6a2=_0xe63c('0x29');return db[_0xe63c('0x2a')]['destroy']({'where':{'type':_0x3eb6a2,'resourceId':_0x36b43a['id']}})['then'](function(){return _0x58c4a6;});})[_0xe63c('0x2b')](function(){_0x33ede4[_0xe63c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14f1e6,_0x4a8ed7){return function(_0x563ed8){if(!_0x563ed8){_0x14f1e6[_0xe63c('0x1e')](0x194);}return _0x563ed8;};}function handleError(_0x12fc75,_0x9b6073){_0x9b6073=_0x9b6073||0x1f4;return function(_0x4668a2){logger[_0xe63c('0x1b')](_0x4668a2[_0xe63c('0x2c')]);if(_0x4668a2[_0xe63c('0x2d')]){delete _0x4668a2['name'];}_0x12fc75[_0xe63c('0x1f')](_0x9b6073)[_0xe63c('0x2e')](_0x4668a2);};}exports[_0xe63c('0x2f')]=function(_0x40d06b,_0xf4d778){var _0x26b518={},_0x392828={},_0xab866f={'count':0x0,'rows':[]};var _0x20dbfa=db[_0xe63c('0x30')]['rawAttributes'];_0x392828[_0xe63c('0x31')]=_[_0xe63c('0x32')](_0x20dbfa);var _0x158fee={'dateStart':_0x40d06b[_0xe63c('0x33')][_0xe63c('0x34')],'dateEnd':_0x40d06b['query']['dateEnd']};delete _0x40d06b[_0xe63c('0x33')][_0xe63c('0x34')];delete _0x40d06b[_0xe63c('0x33')]['dateEnd'];_0x392828[_0xe63c('0x33')]=_[_0xe63c('0x32')](_0x40d06b['query']);_0x392828['filters']=_[_0xe63c('0x35')](_0x392828[_0xe63c('0x31')],_0x392828[_0xe63c('0x33')]);_0x26b518['attributes']=_['intersection'](_0x392828[_0xe63c('0x31')],qs['fields'](_0x40d06b[_0xe63c('0x33')]['fields']));_0x26b518[_0xe63c('0x36')]=_0x26b518['attributes'][_0xe63c('0x37')]?_0x26b518['attributes']:_0x392828[_0xe63c('0x31')];if(!_0x40d06b[_0xe63c('0x33')]['hasOwnProperty']('nolimit')){_0x26b518['limit']=qs['limit'](_0x40d06b['query'][_0xe63c('0x38')]);_0x26b518['offset']=qs[_0xe63c('0x22')](_0x40d06b[_0xe63c('0x33')][_0xe63c('0x22')]);}_0x26b518[_0xe63c('0x39')]=qs[_0xe63c('0x3a')](_0x40d06b[_0xe63c('0x33')][_0xe63c('0x3a')]);_0x26b518[_0xe63c('0x3b')]=qs['filters'](_[_0xe63c('0x3c')](_0x40d06b['query'],_0x392828[_0xe63c('0x3d')]));if(_0x158fee[_0xe63c('0x34')]){if(_0x158fee[_0xe63c('0x3e')]){_0x158fee['dateEnd']=moment(_0x158fee[_0xe63c('0x3e')])[_0xe63c('0x3f')](0x1,_0xe63c('0x40'));}else{_0x158fee['dateEnd']=moment(_0x158fee[_0xe63c('0x34')])[_0xe63c('0x3f')](0x1,_0xe63c('0x40'));}_[_0xe63c('0x41')](_0x26b518['where'],{'createdAt':{'$gte':_0x158fee[_0xe63c('0x34')],'$lte':_0x158fee['dateEnd']}});}if(_0x40d06b[_0xe63c('0x33')][_0xe63c('0x42')]){_0x26b518['where']=_[_0xe63c('0x41')](_0x26b518[_0xe63c('0x3b')],{'$or':_[_0xe63c('0x43')](_0x20dbfa,function(_0x181e2b){if(_0x181e2b[_0xe63c('0x44')]['key']!=='VIRTUAL'){var _0x4d9bd2={};_0x4d9bd2[_0x181e2b[_0xe63c('0x45')]]={'$like':'%'+_0x40d06b[_0xe63c('0x33')]['filter']+'%'};return _0x4d9bd2;}})});}_0x26b518=_[_0xe63c('0x41')]({},_0x26b518,_0x40d06b[_0xe63c('0x46')]);var _0x153f37={'where':_0x26b518[_0xe63c('0x3b')]};return db[_0xe63c('0x30')][_0xe63c('0x47')](_0x153f37)[_0xe63c('0x2b')](function(_0x592fb8){_0xab866f[_0xe63c('0x47')]=_0x592fb8;if(_0x40d06b[_0xe63c('0x33')][_0xe63c('0x48')]){_0x26b518['include']=[{'all':!![]}];}return db[_0xe63c('0x30')][_0xe63c('0x49')](_0x26b518);})[_0xe63c('0x2b')](function(_0x173dc4){_0xab866f['rows']=_0x173dc4;return _0xab866f;})[_0xe63c('0x2b')](respondWithFilteredResult(_0xf4d778,_0x26b518))[_0xe63c('0x1d')](handleError(_0xf4d778,null));};exports[_0xe63c('0x4a')]=function(_0x46de9b,_0x5c3e63){var _0x227168={'raw':![],'where':{'id':_0x46de9b[_0xe63c('0x4b')]['id']}},_0x26297f={};_0x26297f[_0xe63c('0x31')]=_['keys'](db[_0xe63c('0x30')][_0xe63c('0x4c')]);_0x26297f[_0xe63c('0x33')]=_[_0xe63c('0x32')](_0x46de9b[_0xe63c('0x33')]);_0x26297f['filters']=_[_0xe63c('0x35')](_0x26297f[_0xe63c('0x31')],_0x26297f[_0xe63c('0x33')]);_0x227168[_0xe63c('0x36')]=_[_0xe63c('0x35')](_0x26297f[_0xe63c('0x31')],qs[_0xe63c('0x4d')](_0x46de9b[_0xe63c('0x33')][_0xe63c('0x4d')]));_0x227168['attributes']=_0x227168[_0xe63c('0x36')][_0xe63c('0x37')]?_0x227168[_0xe63c('0x36')]:_0x26297f[_0xe63c('0x31')];if(_0x46de9b[_0xe63c('0x33')][_0xe63c('0x48')]){_0x227168[_0xe63c('0x4e')]=[{'all':!![]}];}_0x227168=_[_0xe63c('0x41')]({},_0x227168,_0x46de9b[_0xe63c('0x46')]);return db[_0xe63c('0x30')][_0xe63c('0x4f')](_0x227168)[_0xe63c('0x2b')](handleEntityNotFound(_0x5c3e63,null))['then'](respondWithResult(_0x5c3e63,null))[_0xe63c('0x1d')](handleError(_0x5c3e63,null));};exports[_0xe63c('0x50')]=function(_0x2ad67e,_0x31c1ab){var _0x9e290f={'raw':![],'where':{'id':_0x2ad67e[_0xe63c('0x4b')]['id']}},_0x1fa559={};_0x1fa559[_0xe63c('0x31')]=_[_0xe63c('0x32')](db[_0xe63c('0x30')][_0xe63c('0x4c')]);_0x9e290f[_0xe63c('0x36')]=_[_0xe63c('0x35')](_0x1fa559['model'],qs[_0xe63c('0x4d')](_0x2ad67e[_0xe63c('0x33')][_0xe63c('0x4d')]));_0x9e290f[_0xe63c('0x36')]=_0x9e290f[_0xe63c('0x36')][_0xe63c('0x37')]?_0x9e290f[_0xe63c('0x36')]:_0x1fa559[_0xe63c('0x31')];if(_0x2ad67e[_0xe63c('0x33')][_0xe63c('0x48')]){_0x9e290f[_0xe63c('0x4e')]=[{'all':!![]}];}_0x9e290f=_[_0xe63c('0x41')]({},_0x9e290f,_0x2ad67e[_0xe63c('0x46')]);return db[_0xe63c('0x30')][_0xe63c('0x4f')](_0x9e290f)['then'](handleEntityNotFound(_0x31c1ab,null))[_0xe63c('0x2b')](function(_0x3504a7){if(_0x3504a7){var _0x26032d=_0x3504a7[_0xe63c('0x28')]({'plain':!![]});_0x26032d=qs[_0xe63c('0x51')](_0x26032d,['id',_0xe63c('0x52'),_0xe63c('0x53')]);_0x2ad67e[_0xe63c('0x54')]=_['omit'](_0x2ad67e[_0xe63c('0x54')],['id',_0xe63c('0x52'),_0xe63c('0x53')]);return db[_0xe63c('0x30')]['create'](_[_0xe63c('0x41')](_0x26032d,_0x2ad67e[_0xe63c('0x54')]),{'include':_0x2ad67e['query'][_0xe63c('0x48')]?[{'all':!![]}]:undefined})[_0xe63c('0x2b')](function(_0x5acf3e){var _0x109ab2=_0x2ad67e[_0xe63c('0x55')][_0xe63c('0x28')]({'plain':!![]});if(!_0x109ab2)throw new Error(_0xe63c('0x56'));if(_0x109ab2[_0xe63c('0x57')]===_0xe63c('0x55')){var _0x18f77a=_0x5acf3e[_0xe63c('0x28')]({'plain':!![]});var _0x564cc1='Trunks';return db[_0xe63c('0x58')][_0xe63c('0x4f')]({'where':{'name':_0x564cc1,'userProfileId':_0x109ab2[_0xe63c('0x59')]},'raw':!![]})[_0xe63c('0x2b')](function(_0x50be7d){if(_0x50be7d&&_0x50be7d[_0xe63c('0x5a')]===0x0){return db[_0xe63c('0x2a')][_0xe63c('0x5b')]({'name':_0x18f77a[_0xe63c('0x2d')],'resourceId':_0x18f77a['id'],'type':_0x50be7d[_0xe63c('0x2d')],'sectionId':_0x50be7d['id']},{})[_0xe63c('0x2b')](function(){return _0x5acf3e;});}else{return _0x5acf3e;}})[_0xe63c('0x1d')](function(_0x5ce565){logger[_0xe63c('0x1b')](_0xe63c('0x5c'),_0x5ce565);throw _0x5ce565;});}return _0x5acf3e;});}})[_0xe63c('0x2b')](respondWithResult(_0x31c1ab,0xc9))[_0xe63c('0x1d')](handleError(_0x31c1ab,null));};exports['create']=function(_0x3856fb,_0x23a069,_0x3f2ffb){var _0x27d352;return db[_0xe63c('0x30')]['create'](_0x3856fb[_0xe63c('0x54')],{'raw':!![]})[_0xe63c('0x2b')](function(_0x53cc3e){_0x27d352=_0x53cc3e;return db[_0xe63c('0x30')][_0xe63c('0x49')]({'raw':!![]});})[_0xe63c('0x2b')](function(_0x16a973){var _0x2e661f=fs[_0xe63c('0x5d')](path[_0xe63c('0x5e')](config[_0xe63c('0x5f')],_0xe63c('0x60')),'utf8');var _0x52e838=fs[_0xe63c('0x5d')](path[_0xe63c('0x5e')](config[_0xe63c('0x5f')],'server/files/templates/registry.ejs'),_0xe63c('0x61'));var _0x1960b5=ejs[_0xe63c('0x62')](_0x2e661f,{'trunks':_0x16a973||[]});fs[_0xe63c('0x63')](_0xe63c('0x64'),_0x1960b5);if(_0x27d352[_0xe63c('0x65')]){var _0x2eaf7b=ejs[_0xe63c('0x62')](_0x52e838,{'trunks':_0x16a973||[]});fs[_0xe63c('0x63')](_0xe63c('0x66'),_0x2eaf7b);}})[_0xe63c('0x2b')](function(){return respondWithRpcPromise(_0xe63c('0x67'),_0xe63c('0x5b'),{'module':'chan_sip.so'});})[_0xe63c('0x2b')](function(){var _0x5719e5=_0x3856fb[_0xe63c('0x55')][_0xe63c('0x28')]({'plain':!![]});if(!_0x5719e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5719e5[_0xe63c('0x57')]===_0xe63c('0x55')){var _0x15d394=_0x27d352[_0xe63c('0x28')]({'plain':!![]});return db[_0xe63c('0x58')][_0xe63c('0x4f')]({'where':{'name':_0xe63c('0x29'),'userProfileId':_0x5719e5['userProfileId']},'raw':!![]})[_0xe63c('0x2b')](function(_0x8e8b5d){if(_0x8e8b5d&&_0x8e8b5d[_0xe63c('0x5a')]===0x0){return db[_0xe63c('0x2a')][_0xe63c('0x5b')]({'name':_0x15d394[_0xe63c('0x2d')],'resourceId':_0x15d394['id'],'type':_0x8e8b5d[_0xe63c('0x2d')],'sectionId':_0x8e8b5d['id']},{})[_0xe63c('0x2b')](function(){return _0x27d352;});}else{return _0x27d352;}})[_0xe63c('0x1d')](function(_0x3ab834){logger[_0xe63c('0x1b')](_0xe63c('0x5c'),_0x3ab834);throw _0x3ab834;});}return _0x27d352;})[_0xe63c('0x2b')](respondWithResult(_0x23a069,0xc9))[_0xe63c('0x1d')](handleError(_0x23a069,null));};exports[_0xe63c('0x26')]=function(_0x31be8b,_0x54647d,_0x58697f){var _0x5a2f17;return db[_0xe63c('0x30')]['find']({'where':{'id':_0x31be8b[_0xe63c('0x4b')]['id']}})[_0xe63c('0x2b')](handleEntityNotFound(_0x54647d,null))[_0xe63c('0x2b')](saveUpdates(_0x31be8b[_0xe63c('0x54')],null))[_0xe63c('0x2b')](function(_0x4fbe36){if(_0x4fbe36){_0x5a2f17=_0x4fbe36;return db[_0xe63c('0x30')][_0xe63c('0x49')]({'raw':!![]});}})[_0xe63c('0x2b')](function(_0x167c88){if(_0x167c88){var _0x2a75f5=fs['readFileSync'](path['join'](config[_0xe63c('0x5f')],_0xe63c('0x60')),_0xe63c('0x61'));var _0x152850=fs[_0xe63c('0x5d')](path[_0xe63c('0x5e')](config['root'],'server/files/templates/registry.ejs'),_0xe63c('0x61'));var _0x55e200=ejs['render'](_0x2a75f5,{'trunks':_0x167c88||[]});fs[_0xe63c('0x63')]('/etc/asterisk/sip_xcally_trunks.conf',_0x55e200);var _0x4e0704=ejs['render'](_0x152850,{'trunks':_0x167c88||[]});fs[_0xe63c('0x63')]('/etc/asterisk/sip_xcally_registers.conf',_0x4e0704);return respondWithRpcPromise(_0xe63c('0x67'),'update',{'module':_0xe63c('0x68')});}return null;})['then'](function(_0x374170){if(_0x374170){return _0x5a2f17;}})[_0xe63c('0x2b')](respondWithResult(_0x54647d,null))['catch'](handleError(_0x54647d,null));};exports[_0xe63c('0x27')]=function(_0x118da1,_0x912ba,_0x1394de){var _0x241151;return db['Trunk']['find']({'where':{'id':_0x118da1[_0xe63c('0x4b')]['id']}})[_0xe63c('0x2b')](handleEntityNotFound(_0x912ba,null))[_0xe63c('0x2b')](removeEntity(_0x912ba,null))[_0xe63c('0x2b')](function(){return db[_0xe63c('0x30')]['findAll']({'raw':!![]});})['then'](function(_0x26e257){var _0x36621a=fs[_0xe63c('0x5d')](path[_0xe63c('0x5e')](config[_0xe63c('0x5f')],_0xe63c('0x60')),_0xe63c('0x61'));var _0x45880a=fs[_0xe63c('0x5d')](path['join'](config[_0xe63c('0x5f')],_0xe63c('0x69')),_0xe63c('0x61'));var _0x1c2d1c=ejs[_0xe63c('0x62')](_0x36621a,{'trunks':_0x26e257});var _0x500891=ejs[_0xe63c('0x62')](_0x45880a,{'trunks':_0x26e257});fs['writeFileSync'](_0xe63c('0x64'),_0x1c2d1c);fs[_0xe63c('0x63')](_0xe63c('0x66'),_0x500891);return respondWithRpcPromise(_0xe63c('0x67'),_0xe63c('0x27'),{'module':'chan_sip.so'});})[_0xe63c('0x1d')](handleError(_0x912ba,null));};
\ No newline at end of file
+var _0x0d2a=['merge','filter','where','type','key','VIRTUAL','field','options','Trunk','includeAll','include','findAll','params','clone','find','createdAt','omit','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','add','day'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x0d2a,0x170));var _0xa0d2=function(_0x5f3969,_0x22d0d4){_0x5f3969=_0x5f3969-0x0;var _0x13ecd8=_0x0d2a[_0x5f3969];return _0x13ecd8;};'use strict';var pdf=require(_0xa0d2('0x0'));var emlformat=require(_0xa0d2('0x1'));var rimraf=require(_0xa0d2('0x2'));var zipdir=require(_0xa0d2('0x3'));var jsonpatch=require(_0xa0d2('0x4'));var rp=require(_0xa0d2('0x5'));var moment=require(_0xa0d2('0x6'));var BPromise=require(_0xa0d2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa0d2('0x8'));var sox=require(_0xa0d2('0x9'));var csv=require(_0xa0d2('0xa'));var ejs=require(_0xa0d2('0xb'));var fs=require('fs');var _=require(_0xa0d2('0xc'));var squel=require('squel');var crypto=require(_0xa0d2('0xd'));var jsforce=require(_0xa0d2('0xe'));var deskjs=require(_0xa0d2('0xf'));var toCsv=require(_0xa0d2('0xa'));var querystring=require(_0xa0d2('0x10'));var Papa=require(_0xa0d2('0x11'));var Redis=require('ioredis');var qs=require(_0xa0d2('0x12'));var logger=require('../../config/logger')(_0xa0d2('0x13'));var utils=require(_0xa0d2('0x14'));var config=require(_0xa0d2('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa0d2('0x16'));var client=jayson[_0xa0d2('0x17')][_0xa0d2('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1ed83c,_0x4413ee,_0x1d9c1e,_0x58eebb){return new BPromise(function(_0x445af3,_0x2875d9){var _0x5cc240=_0x58eebb||client;return _0x5cc240[_0xa0d2('0x19')](_0x1ed83c,_0x1d9c1e)[_0xa0d2('0x1a')](function(_0x3fad44){logger[_0xa0d2('0x1b')](_0xa0d2('0x1c'),_0x4413ee,_0xa0d2('0x1d'));logger[_0xa0d2('0x1e')](_0xa0d2('0x1f'),_0x4413ee,'request\x20sent',JSON[_0xa0d2('0x20')](_0x3fad44));if(_0x3fad44[_0xa0d2('0x21')]){if(_0x3fad44['error'][_0xa0d2('0x22')]===0x1f4){logger['error'](_0xa0d2('0x1c'),_0x4413ee,_0x3fad44['error'][_0xa0d2('0x23')]);return _0x2875d9(_0x3fad44[_0xa0d2('0x21')]['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x4413ee,_0x3fad44['error'][_0xa0d2('0x23')]);return _0x445af3(_0x3fad44[_0xa0d2('0x21')][_0xa0d2('0x23')]);}else{logger[_0xa0d2('0x1b')](_0xa0d2('0x1c'),_0x4413ee,_0xa0d2('0x1d'));_0x445af3(_0x3fad44['result'][_0xa0d2('0x23')]);}})[_0xa0d2('0x24')](function(_0x21caf3){logger[_0xa0d2('0x21')](_0xa0d2('0x1c'),_0x4413ee,_0x21caf3);_0x2875d9(_0x21caf3);});});}function respondWithStatusCode(_0x5f33bd,_0x228412){_0x228412=_0x228412||0xcc;return function(_0x1e458c){if(_0x1e458c){return _0x5f33bd[_0xa0d2('0x25')](_0x228412);}return _0x5f33bd[_0xa0d2('0x26')](_0x228412)[_0xa0d2('0x27')]();};}function respondWithResult(_0x1c9e0a,_0x5136d5){_0x5136d5=_0x5136d5||0xc8;return function(_0x34c372){if(_0x34c372){return _0x1c9e0a[_0xa0d2('0x26')](_0x5136d5)[_0xa0d2('0x28')](_0x34c372);}};}function respondWithFilteredResult(_0x5311af,_0x3d91e4){return function(_0x144a67){if(_0x144a67){var _0x1b2690=_0x144a67[_0xa0d2('0x29')],_0x3dfe77=_0x3d91e4[_0xa0d2('0x2a')],_0x58c6a1=_0x3d91e4['offset']+_0x3d91e4[_0xa0d2('0x2b')],_0x325c3a;if(_0x58c6a1>=_0x1b2690){_0x58c6a1=_0x1b2690;_0x325c3a=0xc8;}else{_0x325c3a=0xce;}_0x5311af[_0xa0d2('0x26')](_0x325c3a);return _0x5311af[_0xa0d2('0x2c')]('Content-Range',_0x3dfe77+'-'+_0x58c6a1+'/'+_0x1b2690)[_0xa0d2('0x28')](_0x144a67);}return null;};}function patchUpdates(_0x38e60d){return function(_0x393190){try{jsonpatch['apply'](_0x393190,_0x38e60d,!![]);}catch(_0x4248c0){return BPromise[_0xa0d2('0x2d')](_0x4248c0);}return _0x393190['save']();};}function saveUpdates(_0x3ccee2,_0x698124){return function(_0x5a6563){if(_0x5a6563){return _0x5a6563[_0xa0d2('0x2e')](_0x3ccee2)[_0xa0d2('0x1a')](function(_0x5b6033){return _0x5b6033;});}return null;};}function removeEntity(_0x4796d6,_0x54b3d3){return function(_0x2f2e0e){if(_0x2f2e0e){return _0x2f2e0e[_0xa0d2('0x2f')]()['then'](function(){var _0x49c8d0=_0x2f2e0e[_0xa0d2('0x30')]({'plain':!![]});var _0x8088c1=_0xa0d2('0x31');return db[_0xa0d2('0x32')][_0xa0d2('0x2f')]({'where':{'type':_0x8088c1,'resourceId':_0x49c8d0['id']}})[_0xa0d2('0x1a')](function(){return _0x2f2e0e;});})[_0xa0d2('0x1a')](function(){_0x4796d6[_0xa0d2('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a62e6,_0x4ec556){return function(_0x2a3ea1){if(!_0x2a3ea1){_0x5a62e6[_0xa0d2('0x25')](0x194);}return _0x2a3ea1;};}function handleError(_0x5b4e68,_0x56daa0){_0x56daa0=_0x56daa0||0x1f4;return function(_0x1f1980){logger[_0xa0d2('0x21')](_0x1f1980[_0xa0d2('0x33')]);if(_0x1f1980[_0xa0d2('0x34')]){delete _0x1f1980['name'];}_0x5b4e68['status'](_0x56daa0)[_0xa0d2('0x35')](_0x1f1980);};}exports[_0xa0d2('0x36')]=function(_0x483e5f,_0x437337){var _0x44e57c={},_0x1d7fb1={},_0x34954e={'count':0x0,'rows':[]};var _0x2f9ba6=db['Trunk'][_0xa0d2('0x37')];_0x1d7fb1['model']=_[_0xa0d2('0x38')](_0x2f9ba6);var _0x1ad221={'dateStart':_0x483e5f[_0xa0d2('0x39')][_0xa0d2('0x3a')],'dateEnd':_0x483e5f[_0xa0d2('0x39')][_0xa0d2('0x3b')]};delete _0x483e5f['query']['dateStart'];delete _0x483e5f[_0xa0d2('0x39')][_0xa0d2('0x3b')];_0x1d7fb1['query']=_[_0xa0d2('0x38')](_0x483e5f[_0xa0d2('0x39')]);_0x1d7fb1[_0xa0d2('0x3c')]=_[_0xa0d2('0x3d')](_0x1d7fb1['model'],_0x1d7fb1[_0xa0d2('0x39')]);_0x44e57c[_0xa0d2('0x3e')]=_[_0xa0d2('0x3d')](_0x1d7fb1[_0xa0d2('0x3f')],qs[_0xa0d2('0x40')](_0x483e5f['query'][_0xa0d2('0x40')]));_0x44e57c[_0xa0d2('0x3e')]=_0x44e57c[_0xa0d2('0x3e')][_0xa0d2('0x41')]?_0x44e57c[_0xa0d2('0x3e')]:_0x1d7fb1[_0xa0d2('0x3f')];if(!_0x483e5f[_0xa0d2('0x39')][_0xa0d2('0x42')](_0xa0d2('0x43'))){_0x44e57c[_0xa0d2('0x2b')]=qs['limit'](_0x483e5f[_0xa0d2('0x39')][_0xa0d2('0x2b')]);_0x44e57c['offset']=qs['offset'](_0x483e5f[_0xa0d2('0x39')]['offset']);}_0x44e57c['order']=qs[_0xa0d2('0x44')](_0x483e5f[_0xa0d2('0x39')]['sort']);_0x44e57c['where']=qs[_0xa0d2('0x3c')](_[_0xa0d2('0x45')](_0x483e5f[_0xa0d2('0x39')],_0x1d7fb1[_0xa0d2('0x3c')]));if(_0x1ad221[_0xa0d2('0x3a')]){if(_0x1ad221[_0xa0d2('0x3b')]){_0x1ad221[_0xa0d2('0x3b')]=moment(_0x1ad221[_0xa0d2('0x3b')])[_0xa0d2('0x46')](0x1,_0xa0d2('0x47'));}else{_0x1ad221[_0xa0d2('0x3b')]=moment(_0x1ad221['dateStart'])['add'](0x1,_0xa0d2('0x47'));}_[_0xa0d2('0x48')](_0x44e57c['where'],{'createdAt':{'$gte':_0x1ad221['dateStart'],'$lte':_0x1ad221[_0xa0d2('0x3b')]}});}if(_0x483e5f[_0xa0d2('0x39')][_0xa0d2('0x49')]){_0x44e57c['where']=_['merge'](_0x44e57c[_0xa0d2('0x4a')],{'$or':_['map'](_0x2f9ba6,function(_0x17f00f){if(_0x17f00f[_0xa0d2('0x4b')][_0xa0d2('0x4c')]!==_0xa0d2('0x4d')){var _0x4c074c={};_0x4c074c[_0x17f00f[_0xa0d2('0x4e')]]={'$like':'%'+_0x483e5f[_0xa0d2('0x39')]['filter']+'%'};return _0x4c074c;}})});}_0x44e57c=_[_0xa0d2('0x48')]({},_0x44e57c,_0x483e5f[_0xa0d2('0x4f')]);var _0x408b05={'where':_0x44e57c[_0xa0d2('0x4a')]};return db[_0xa0d2('0x50')][_0xa0d2('0x29')](_0x408b05)[_0xa0d2('0x1a')](function(_0x2084b8){_0x34954e[_0xa0d2('0x29')]=_0x2084b8;if(_0x483e5f[_0xa0d2('0x39')][_0xa0d2('0x51')]){_0x44e57c[_0xa0d2('0x52')]=[{'all':!![]}];}return db[_0xa0d2('0x50')][_0xa0d2('0x53')](_0x44e57c);})[_0xa0d2('0x1a')](function(_0x4a33d8){_0x34954e['rows']=_0x4a33d8;return _0x34954e;})[_0xa0d2('0x1a')](respondWithFilteredResult(_0x437337,_0x44e57c))['catch'](handleError(_0x437337,null));};exports['show']=function(_0x582f2e,_0x358e4f){var _0x552a71={'raw':![],'where':{'id':_0x582f2e[_0xa0d2('0x54')]['id']}},_0x19a7cf={};_0x19a7cf[_0xa0d2('0x3f')]=_[_0xa0d2('0x38')](db[_0xa0d2('0x50')]['rawAttributes']);_0x19a7cf[_0xa0d2('0x39')]=_[_0xa0d2('0x38')](_0x582f2e['query']);_0x19a7cf['filters']=_[_0xa0d2('0x3d')](_0x19a7cf[_0xa0d2('0x3f')],_0x19a7cf['query']);_0x552a71['attributes']=_['intersection'](_0x19a7cf[_0xa0d2('0x3f')],qs[_0xa0d2('0x40')](_0x582f2e[_0xa0d2('0x39')][_0xa0d2('0x40')]));_0x552a71[_0xa0d2('0x3e')]=_0x552a71['attributes'][_0xa0d2('0x41')]?_0x552a71[_0xa0d2('0x3e')]:_0x19a7cf[_0xa0d2('0x3f')];if(_0x582f2e[_0xa0d2('0x39')][_0xa0d2('0x51')]){_0x552a71['include']=[{'all':!![]}];}_0x552a71=_[_0xa0d2('0x48')]({},_0x552a71,_0x582f2e[_0xa0d2('0x4f')]);return db[_0xa0d2('0x50')]['find'](_0x552a71)[_0xa0d2('0x1a')](handleEntityNotFound(_0x358e4f,null))[_0xa0d2('0x1a')](respondWithResult(_0x358e4f,null))['catch'](handleError(_0x358e4f,null));};exports[_0xa0d2('0x55')]=function(_0x37cee7,_0x23781c){var _0x4d7847={'raw':![],'where':{'id':_0x37cee7['params']['id']}},_0x5a2ea6={};_0x5a2ea6[_0xa0d2('0x3f')]=_['keys'](db[_0xa0d2('0x50')]['rawAttributes']);_0x4d7847[_0xa0d2('0x3e')]=_[_0xa0d2('0x3d')](_0x5a2ea6[_0xa0d2('0x3f')],qs[_0xa0d2('0x40')](_0x37cee7[_0xa0d2('0x39')][_0xa0d2('0x40')]));_0x4d7847[_0xa0d2('0x3e')]=_0x4d7847['attributes'][_0xa0d2('0x41')]?_0x4d7847[_0xa0d2('0x3e')]:_0x5a2ea6['model'];if(_0x37cee7['query']['includeAll']){_0x4d7847['include']=[{'all':!![]}];}_0x4d7847=_[_0xa0d2('0x48')]({},_0x4d7847,_0x37cee7[_0xa0d2('0x4f')]);return db[_0xa0d2('0x50')][_0xa0d2('0x56')](_0x4d7847)['then'](handleEntityNotFound(_0x23781c,null))[_0xa0d2('0x1a')](function(_0xfc677){if(_0xfc677){var _0x58523f=_0xfc677[_0xa0d2('0x30')]({'plain':!![]});_0x58523f=qs['omit'](_0x58523f,['id',_0xa0d2('0x57'),'updatedAt']);_0x37cee7['body']=_[_0xa0d2('0x58')](_0x37cee7[_0xa0d2('0x59')],['id','createdAt','updatedAt']);return db['Trunk'][_0xa0d2('0x5a')](_['merge'](_0x58523f,_0x37cee7[_0xa0d2('0x59')]),{'include':_0x37cee7[_0xa0d2('0x39')][_0xa0d2('0x51')]?[{'all':!![]}]:undefined})[_0xa0d2('0x1a')](function(_0x80662){var _0x61f9ea=_0x37cee7[_0xa0d2('0x5b')][_0xa0d2('0x30')]({'plain':!![]});if(!_0x61f9ea)throw new Error(_0xa0d2('0x5c'));if(_0x61f9ea[_0xa0d2('0x5d')]===_0xa0d2('0x5b')){var _0x330ccb=_0x80662['get']({'plain':!![]});var _0x183cdc='Trunks';return db[_0xa0d2('0x5e')][_0xa0d2('0x56')]({'where':{'name':_0x183cdc,'userProfileId':_0x61f9ea[_0xa0d2('0x5f')]},'raw':!![]})['then'](function(_0x1588ff){if(_0x1588ff&&_0x1588ff[_0xa0d2('0x60')]===0x0){return db[_0xa0d2('0x32')][_0xa0d2('0x5a')]({'name':_0x330ccb['name'],'resourceId':_0x330ccb['id'],'type':_0x1588ff[_0xa0d2('0x34')],'sectionId':_0x1588ff['id']},{})[_0xa0d2('0x1a')](function(){return _0x80662;});}else{return _0x80662;}})[_0xa0d2('0x24')](function(_0x1c0e7d){logger[_0xa0d2('0x21')](_0xa0d2('0x61'),_0x1c0e7d);throw _0x1c0e7d;});}return _0x80662;});}})[_0xa0d2('0x1a')](respondWithResult(_0x23781c,0xc9))[_0xa0d2('0x24')](handleError(_0x23781c,null));};exports['create']=function(_0x45e8a5,_0x23e4f4,_0xe2333b){var _0x3b87ef;return db[_0xa0d2('0x50')]['create'](_0x45e8a5[_0xa0d2('0x59')],{'raw':!![]})[_0xa0d2('0x1a')](function(_0x13deac){_0x3b87ef=_0x13deac;return db[_0xa0d2('0x50')]['findAll']({'raw':!![]});})['then'](function(_0x289157){var _0x327d16=fs['readFileSync'](path[_0xa0d2('0x62')](config[_0xa0d2('0x63')],_0xa0d2('0x64')),_0xa0d2('0x65'));var _0x4b4d13=fs[_0xa0d2('0x66')](path[_0xa0d2('0x62')](config[_0xa0d2('0x63')],_0xa0d2('0x67')),'utf8');var _0x4c1294=ejs[_0xa0d2('0x68')](_0x327d16,{'trunks':_0x289157||[]});fs[_0xa0d2('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4c1294);if(_0x3b87ef['registry']){var _0x477b8d=ejs[_0xa0d2('0x68')](_0x4b4d13,{'trunks':_0x289157||[]});fs[_0xa0d2('0x69')](_0xa0d2('0x6a'),_0x477b8d);}})['then'](function(){return respondWithRpcPromise(_0xa0d2('0x6b'),'create',{'module':_0xa0d2('0x6c')});})[_0xa0d2('0x1a')](function(){var _0x50af6e=_0x45e8a5[_0xa0d2('0x5b')]['get']({'plain':!![]});if(!_0x50af6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50af6e['role']==='user'){var _0x3da2f1=_0x3b87ef['get']({'plain':!![]});return db[_0xa0d2('0x5e')][_0xa0d2('0x56')]({'where':{'name':_0xa0d2('0x31'),'userProfileId':_0x50af6e['userProfileId']},'raw':!![]})['then'](function(_0x435d9b){if(_0x435d9b&&_0x435d9b[_0xa0d2('0x60')]===0x0){return db[_0xa0d2('0x32')][_0xa0d2('0x5a')]({'name':_0x3da2f1[_0xa0d2('0x34')],'resourceId':_0x3da2f1['id'],'type':_0x435d9b['name'],'sectionId':_0x435d9b['id']},{})[_0xa0d2('0x1a')](function(){return _0x3b87ef;});}else{return _0x3b87ef;}})[_0xa0d2('0x24')](function(_0x548416){logger[_0xa0d2('0x21')](_0xa0d2('0x61'),_0x548416);throw _0x548416;});}return _0x3b87ef;})[_0xa0d2('0x1a')](respondWithResult(_0x23e4f4,0xc9))[_0xa0d2('0x24')](handleError(_0x23e4f4,null));};exports[_0xa0d2('0x2e')]=function(_0x40fec4,_0x36d904,_0xabe4aa){var _0x43b334;return db[_0xa0d2('0x50')]['find']({'where':{'id':_0x40fec4['params']['id']}})[_0xa0d2('0x1a')](handleEntityNotFound(_0x36d904,null))[_0xa0d2('0x1a')](saveUpdates(_0x40fec4[_0xa0d2('0x59')],null))[_0xa0d2('0x1a')](function(_0x82da99){if(_0x82da99){_0x43b334=_0x82da99;return db[_0xa0d2('0x50')]['findAll']({'raw':!![]});}})[_0xa0d2('0x1a')](function(_0x2df350){if(_0x2df350){var _0x4dba0f=fs[_0xa0d2('0x66')](path[_0xa0d2('0x62')](config[_0xa0d2('0x63')],_0xa0d2('0x64')),'utf8');var _0x111ac1=fs['readFileSync'](path[_0xa0d2('0x62')](config[_0xa0d2('0x63')],_0xa0d2('0x67')),_0xa0d2('0x65'));var _0x52ab2d=ejs[_0xa0d2('0x68')](_0x4dba0f,{'trunks':_0x2df350||[]});fs['writeFileSync'](_0xa0d2('0x6d'),_0x52ab2d);var _0x132407=ejs['render'](_0x111ac1,{'trunks':_0x2df350||[]});fs['writeFileSync'](_0xa0d2('0x6a'),_0x132407);return respondWithRpcPromise('Reload',_0xa0d2('0x2e'),{'module':_0xa0d2('0x6c')});}return null;})['then'](function(_0x310652){if(_0x310652){return _0x43b334;}})['then'](respondWithResult(_0x36d904,null))['catch'](handleError(_0x36d904,null));};exports[_0xa0d2('0x2f')]=function(_0x4905be,_0x3e13a6,_0x3b38c6){var _0x2f5d9d;return db[_0xa0d2('0x50')][_0xa0d2('0x56')]({'where':{'id':_0x4905be[_0xa0d2('0x54')]['id']}})[_0xa0d2('0x1a')](handleEntityNotFound(_0x3e13a6,null))['then'](removeEntity(_0x3e13a6,null))['then'](function(){return db[_0xa0d2('0x50')][_0xa0d2('0x53')]({'raw':!![]});})[_0xa0d2('0x1a')](function(_0x4be5d2){var _0x3cbaf1=fs['readFileSync'](path[_0xa0d2('0x62')](config[_0xa0d2('0x63')],_0xa0d2('0x64')),_0xa0d2('0x65'));var _0x1abfc3=fs[_0xa0d2('0x66')](path[_0xa0d2('0x62')](config[_0xa0d2('0x63')],'server/files/templates/registry.ejs'),'utf8');var _0x536b81=ejs[_0xa0d2('0x68')](_0x3cbaf1,{'trunks':_0x4be5d2});var _0x6848ca=ejs[_0xa0d2('0x68')](_0x1abfc3,{'trunks':_0x4be5d2});fs['writeFileSync'](_0xa0d2('0x6d'),_0x536b81);fs[_0xa0d2('0x69')](_0xa0d2('0x6a'),_0x6848ca);return respondWithRpcPromise(_0xa0d2('0x6b'),'destroy',{'module':'chan_sip.so'});})[_0xa0d2('0x24')](handleError(_0x3e13a6,null));};
\ No newline at end of file
index eb57ec9..fe77b2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83fa=['request-promise','./trunk.attributes','exports','define','Trunk','lodash','../../config/logger','moment'];(function(_0xaa3cb4,_0x3b9757){var _0x30fe5b=function(_0x58b145){while(--_0x58b145){_0xaa3cb4['push'](_0xaa3cb4['shift']());}};_0x30fe5b(++_0x3b9757);}(_0x83fa,0x8d));var _0xa83f=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x83fa[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0xa83f('0x0'));var util=require('util');var logger=require(_0xa83f('0x1'))('api');var moment=require(_0xa83f('0x2'));var BPromise=require('bluebird');var rp=require(_0xa83f('0x3'));var attributes=require(_0xa83f('0x4'));module[_0xa83f('0x5')]=function(_0x219467,_0x3df41c){return _0x219467[_0xa83f('0x6')](_0xa83f('0x7'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1835=['exports','define','Trunk','lodash','api','moment','bluebird','request-promise','./trunk.attributes'];(function(_0x3f2507,_0x308e92){var _0x456615=function(_0x5f01e9){while(--_0x5f01e9){_0x3f2507['push'](_0x3f2507['shift']());}};_0x456615(++_0x308e92);}(_0x1835,0x123));var _0x5183=function(_0x57973e,_0x2781e3){_0x57973e=_0x57973e-0x0;var _0x422672=_0x1835[_0x57973e];return _0x422672;};'use strict';var _=require(_0x5183('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5183('0x1'));var moment=require(_0x5183('0x2'));var BPromise=require(_0x5183('0x3'));var rp=require(_0x5183('0x4'));var attributes=require(_0x5183('0x5'));module[_0x5183('0x6')]=function(_0x2ca416,_0x2f4f4b){return _0x2ca416[_0x5183('0x7')](_0x5183('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e3b82ee..c588b49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7750=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Trunk','options','raw','attributes','limit','include','map','model','GetTrunk','debug','ShowTrunk','stringify'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0x7750,0x108));var _0x0775=function(_0x396c65,_0x81aa7b){_0x396c65=_0x396c65-0x0;var _0x354bfd=_0x7750[_0x396c65];return _0x354bfd;};'use strict';var _=require(_0x0775('0x0'));var util=require(_0x0775('0x1'));var moment=require(_0x0775('0x2'));var BPromise=require(_0x0775('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0775('0x4'));var db=require(_0x0775('0x5'))['db'];var utils=require(_0x0775('0x6'));var logger=require('../../config/logger')(_0x0775('0x7'));var config=require('../../config/environment');var jayson=require(_0x0775('0x8'));var client=jayson[_0x0775('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ada74,_0x23aefe,_0x409d0f){return new BPromise(function(_0xe8bae0,_0x43af7b){return client[_0x0775('0xa')](_0x2ada74,_0x409d0f)[_0x0775('0xb')](function(_0x25c086){logger[_0x0775('0xc')](_0x0775('0xd'),_0x23aefe,_0x0775('0xe'));logger['debug'](_0x0775('0xf'),_0x23aefe,_0x0775('0xe'),JSON['stringify'](_0x25c086));if(_0x25c086[_0x0775('0x10')]){if(_0x25c086[_0x0775('0x10')][_0x0775('0x11')]===0x1f4){logger[_0x0775('0x10')](_0x0775('0xd'),_0x23aefe,_0x25c086['error'][_0x0775('0x12')]);return _0x43af7b(_0x25c086[_0x0775('0x10')][_0x0775('0x12')]);}logger[_0x0775('0x10')](_0x0775('0xd'),_0x23aefe,_0x25c086['error']['message']);return _0xe8bae0(_0x25c086[_0x0775('0x10')][_0x0775('0x12')]);}else{logger[_0x0775('0xc')](_0x0775('0xd'),_0x23aefe,_0x0775('0xe'));_0xe8bae0(_0x25c086[_0x0775('0x13')][_0x0775('0x12')]);}})[_0x0775('0x14')](function(_0x301dcb){logger['error'](_0x0775('0xd'),_0x23aefe,_0x301dcb);_0x43af7b(_0x301dcb);});});}exports['GetTrunk']=function(_0x4c7a05){var _0x13f986=this;return new Promise(function(_0x5a5813,_0x11ba81){return db[_0x0775('0x15')]['findAll']({'raw':_0x4c7a05['options']?_0x4c7a05[_0x0775('0x16')][_0x0775('0x17')]===undefined?!![]:![]:!![],'where':_0x4c7a05[_0x0775('0x16')]?_0x4c7a05[_0x0775('0x16')]['where']||null:null,'attributes':_0x4c7a05['options']?_0x4c7a05[_0x0775('0x16')][_0x0775('0x18')]||null:null,'limit':_0x4c7a05[_0x0775('0x16')]?_0x4c7a05[_0x0775('0x16')][_0x0775('0x19')]||null:null,'include':_0x4c7a05[_0x0775('0x16')]?_0x4c7a05['options'][_0x0775('0x1a')]?_[_0x0775('0x1b')](_0x4c7a05[_0x0775('0x16')][_0x0775('0x1a')],function(_0x8ab718){return{'model':db[_0x8ab718[_0x0775('0x1c')]],'as':_0x8ab718['as'],'attributes':_0x8ab718[_0x0775('0x18')],'include':_0x8ab718['include']?_[_0x0775('0x1b')](_0x8ab718['include'],function(_0x17d918){return{'model':db[_0x17d918[_0x0775('0x1c')]],'as':_0x17d918['as'],'attributes':_0x17d918[_0x0775('0x18')],'include':_0x17d918[_0x0775('0x1a')]?_[_0x0775('0x1b')](_0x17d918['include'],function(_0x506877){return{'model':db[_0x506877[_0x0775('0x1c')]],'as':_0x506877['as'],'attributes':_0x506877[_0x0775('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0775('0xb')](function(_0x3a19fe){logger['info'](_0x0775('0x1d'),_0x4c7a05);logger[_0x0775('0x1e')]('GetTrunk',_0x4c7a05,JSON['stringify'](_0x3a19fe));_0x5a5813(_0x3a19fe);})[_0x0775('0x14')](function(_0x18e972){logger[_0x0775('0x10')](_0x0775('0x1d'),_0x18e972['message'],_0x4c7a05);_0x11ba81(_0x13f986[_0x0775('0x10')](0x1f4,_0x18e972['message']));});});};exports[_0x0775('0x1f')]=function(_0x5455aa){var _0x4cf78b=this;return new Promise(function(_0x3b7a3b,_0x43e21c){return db[_0x0775('0x15')]['find']({'raw':_0x5455aa['options']?_0x5455aa['options'][_0x0775('0x17')]===undefined?!![]:![]:!![],'where':_0x5455aa[_0x0775('0x16')]?_0x5455aa[_0x0775('0x16')]['where']||null:null,'attributes':_0x5455aa[_0x0775('0x16')]?_0x5455aa[_0x0775('0x16')]['attributes']||null:null,'include':_0x5455aa[_0x0775('0x16')]?_0x5455aa[_0x0775('0x16')]['include']?_[_0x0775('0x1b')](_0x5455aa[_0x0775('0x16')][_0x0775('0x1a')],function(_0x59ec53){return{'model':db[_0x59ec53[_0x0775('0x1c')]],'as':_0x59ec53['as'],'attributes':_0x59ec53[_0x0775('0x18')],'include':_0x59ec53[_0x0775('0x1a')]?_[_0x0775('0x1b')](_0x59ec53[_0x0775('0x1a')],function(_0x390c9b){return{'model':db[_0x390c9b[_0x0775('0x1c')]],'as':_0x390c9b['as'],'attributes':_0x390c9b[_0x0775('0x18')],'include':_0x390c9b[_0x0775('0x1a')]?_[_0x0775('0x1b')](_0x390c9b[_0x0775('0x1a')],function(_0x456332){return{'model':db[_0x456332[_0x0775('0x1c')]],'as':_0x456332['as'],'attributes':_0x456332['attributes']};}):[]};}):[]};}):[]:[]})[_0x0775('0xb')](function(_0x383a47){logger['info']('ShowTrunk',_0x5455aa);logger[_0x0775('0x1e')](_0x0775('0x1f'),_0x5455aa,JSON[_0x0775('0x20')](_0x383a47));_0x3b7a3b(_0x383a47);})[_0x0775('0x14')](function(_0x42d4b5){logger['error'](_0x0775('0x1f'),_0x42d4b5[_0x0775('0x12')],_0x5455aa);_0x43e21c(_0x4cf78b[_0x0775('0x10')](0x1f4,_0x42d4b5[_0x0775('0x12')]));});});};
\ No newline at end of file
+var _0xc2c9=['message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','catch','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s'];(function(_0x2bcafb,_0x22eb28){var _0x506cee=function(_0x269252){while(--_0x269252){_0x2bcafb['push'](_0x2bcafb['shift']());}};_0x506cee(++_0x22eb28);}(_0xc2c9,0x184));var _0x9c2c=function(_0x40d3c9,_0x1c96e0){_0x40d3c9=_0x40d3c9-0x0;var _0x191c18=_0xc2c9[_0x40d3c9];return _0x191c18;};'use strict';var _=require(_0x9c2c('0x0'));var util=require(_0x9c2c('0x1'));var moment=require(_0x9c2c('0x2'));var BPromise=require(_0x9c2c('0x3'));var rs=require(_0x9c2c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c2c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c2c('0x6'))(_0x9c2c('0x7'));var config=require(_0x9c2c('0x8'));var jayson=require(_0x9c2c('0x9'));var client=jayson[_0x9c2c('0xa')][_0x9c2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bb419,_0x4b6836,_0x50d106){return new BPromise(function(_0x589bef,_0x5b657d){return client[_0x9c2c('0xc')](_0x4bb419,_0x50d106)['then'](function(_0x7fd057){logger[_0x9c2c('0xd')]('Trunk,\x20%s,\x20%s',_0x4b6836,_0x9c2c('0xe'));logger[_0x9c2c('0xf')](_0x9c2c('0x10'),_0x4b6836,'request\x20sent',JSON['stringify'](_0x7fd057));if(_0x7fd057[_0x9c2c('0x11')]){if(_0x7fd057[_0x9c2c('0x11')]['code']===0x1f4){logger[_0x9c2c('0x11')](_0x9c2c('0x12'),_0x4b6836,_0x7fd057['error'][_0x9c2c('0x13')]);return _0x5b657d(_0x7fd057[_0x9c2c('0x11')]['message']);}logger[_0x9c2c('0x11')]('Trunk,\x20%s,\x20%s',_0x4b6836,_0x7fd057['error'][_0x9c2c('0x13')]);return _0x589bef(_0x7fd057[_0x9c2c('0x11')][_0x9c2c('0x13')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x4b6836,_0x9c2c('0xe'));_0x589bef(_0x7fd057[_0x9c2c('0x14')][_0x9c2c('0x13')]);}})['catch'](function(_0x2e75c5){logger['error']('Trunk,\x20%s,\x20%s',_0x4b6836,_0x2e75c5);_0x5b657d(_0x2e75c5);});});}exports[_0x9c2c('0x15')]=function(_0x35217d){var _0x39bdd0=this;return new Promise(function(_0x2eead4,_0x4067c3){return db[_0x9c2c('0x16')][_0x9c2c('0x17')]({'raw':_0x35217d[_0x9c2c('0x18')]?_0x35217d[_0x9c2c('0x18')][_0x9c2c('0x19')]===undefined?!![]:![]:!![],'where':_0x35217d['options']?_0x35217d[_0x9c2c('0x18')][_0x9c2c('0x1a')]||null:null,'attributes':_0x35217d[_0x9c2c('0x18')]?_0x35217d[_0x9c2c('0x18')][_0x9c2c('0x1b')]||null:null,'limit':_0x35217d['options']?_0x35217d[_0x9c2c('0x18')][_0x9c2c('0x1c')]||null:null,'include':_0x35217d[_0x9c2c('0x18')]?_0x35217d[_0x9c2c('0x18')][_0x9c2c('0x1d')]?_[_0x9c2c('0x1e')](_0x35217d[_0x9c2c('0x18')][_0x9c2c('0x1d')],function(_0x56daf5){return{'model':db[_0x56daf5[_0x9c2c('0x1f')]],'as':_0x56daf5['as'],'attributes':_0x56daf5[_0x9c2c('0x1b')],'include':_0x56daf5[_0x9c2c('0x1d')]?_[_0x9c2c('0x1e')](_0x56daf5[_0x9c2c('0x1d')],function(_0x48797d){return{'model':db[_0x48797d[_0x9c2c('0x1f')]],'as':_0x48797d['as'],'attributes':_0x48797d[_0x9c2c('0x1b')],'include':_0x48797d['include']?_['map'](_0x48797d[_0x9c2c('0x1d')],function(_0x18802b){return{'model':db[_0x18802b[_0x9c2c('0x1f')]],'as':_0x18802b['as'],'attributes':_0x18802b[_0x9c2c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9c2c('0x20')](function(_0x141cce){logger[_0x9c2c('0xd')](_0x9c2c('0x15'),_0x35217d);logger[_0x9c2c('0xf')](_0x9c2c('0x15'),_0x35217d,JSON[_0x9c2c('0x21')](_0x141cce));_0x2eead4(_0x141cce);})[_0x9c2c('0x22')](function(_0x214493){logger[_0x9c2c('0x11')](_0x9c2c('0x15'),_0x214493['message'],_0x35217d);_0x4067c3(_0x39bdd0['error'](0x1f4,_0x214493[_0x9c2c('0x13')]));});});};exports[_0x9c2c('0x23')]=function(_0x383b6d){var _0x5a3f03=this;return new Promise(function(_0x45cced,_0x51cfb3){return db[_0x9c2c('0x16')][_0x9c2c('0x24')]({'raw':_0x383b6d[_0x9c2c('0x18')]?_0x383b6d['options'][_0x9c2c('0x19')]===undefined?!![]:![]:!![],'where':_0x383b6d[_0x9c2c('0x18')]?_0x383b6d[_0x9c2c('0x18')]['where']||null:null,'attributes':_0x383b6d[_0x9c2c('0x18')]?_0x383b6d[_0x9c2c('0x18')][_0x9c2c('0x1b')]||null:null,'include':_0x383b6d[_0x9c2c('0x18')]?_0x383b6d[_0x9c2c('0x18')][_0x9c2c('0x1d')]?_[_0x9c2c('0x1e')](_0x383b6d['options']['include'],function(_0x509c8f){return{'model':db[_0x509c8f[_0x9c2c('0x1f')]],'as':_0x509c8f['as'],'attributes':_0x509c8f[_0x9c2c('0x1b')],'include':_0x509c8f[_0x9c2c('0x1d')]?_[_0x9c2c('0x1e')](_0x509c8f[_0x9c2c('0x1d')],function(_0x26952c){return{'model':db[_0x26952c[_0x9c2c('0x1f')]],'as':_0x26952c['as'],'attributes':_0x26952c[_0x9c2c('0x1b')],'include':_0x26952c[_0x9c2c('0x1d')]?_[_0x9c2c('0x1e')](_0x26952c[_0x9c2c('0x1d')],function(_0x4b92c8){return{'model':db[_0x4b92c8['model']],'as':_0x4b92c8['as'],'attributes':_0x4b92c8[_0x9c2c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9c2c('0x20')](function(_0x19844e){logger['info'](_0x9c2c('0x23'),_0x383b6d);logger['debug'](_0x9c2c('0x23'),_0x383b6d,JSON[_0x9c2c('0x21')](_0x19844e));_0x45cced(_0x19844e);})[_0x9c2c('0x22')](function(_0x380846){logger[_0x9c2c('0x11')](_0x9c2c('0x23'),_0x380846[_0x9c2c('0x13')],_0x383b6d);_0x51cfb3(_0x5a3f03[_0x9c2c('0x11')](0x1f4,_0x380846['message']));});});};
\ No newline at end of file
index 7bc5dc8..554e13f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cc1=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/avatar','getAvatar','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','bulkCreate','addContacts','diskStorage','join','root','server/files/images/','format','now','originalname','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects','put','update','/:id/password','removeQueues','delete','removeTeams','/:id/chat_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','exports'];(function(_0x4cac03,_0xde04ff){var _0x13f07b=function(_0x4c26b2){while(--_0x4c26b2){_0x4cac03['push'](_0x4cac03['shift']());}};_0x13f07b(++_0xde04ff);}(_0x9cc1,0x18c));var _0x19cc=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x9cc1[_0x175e89];return _0x2ed996;};'use strict';var multer=require(_0x19cc('0x0'));var util=require(_0x19cc('0x1'));var path=require(_0x19cc('0x2'));var timeout=require(_0x19cc('0x3'));var express=require(_0x19cc('0x4'));var router=express[_0x19cc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x19cc('0x6'));var config=require(_0x19cc('0x7'));var controller=require(_0x19cc('0x8'));router[_0x19cc('0x9')]('/',auth[_0x19cc('0xa')](),controller[_0x19cc('0xb')]);router[_0x19cc('0x9')](_0x19cc('0xc'),auth[_0x19cc('0xa')](),controller['describe']);router['get'](_0x19cc('0xd'),auth['isAuthenticated'](),controller[_0x19cc('0xe')]);router[_0x19cc('0x9')](_0x19cc('0xf'),controller[_0x19cc('0x10')]);router[_0x19cc('0x9')]('/:id/contacts',auth[_0x19cc('0xa')](),controller[_0x19cc('0x11')]);router[_0x19cc('0x9')](_0x19cc('0x12'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x13')]);router[_0x19cc('0x9')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x19cc('0x14')]);router[_0x19cc('0x9')]('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router[_0x19cc('0x9')](_0x19cc('0x15'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x19cc('0x9')](_0x19cc('0x16'),auth['isAuthenticated'](),controller[_0x19cc('0x17')]);router[_0x19cc('0x9')](_0x19cc('0x18'),auth[_0x19cc('0xa')](),controller['getOpenchannelInteractions']);router[_0x19cc('0x9')](_0x19cc('0x19'),auth[_0x19cc('0xa')](),controller['getMailInteractions']);router[_0x19cc('0x9')](_0x19cc('0x1a'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x1b')]);router[_0x19cc('0x9')](_0x19cc('0x1c'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x1d')]);router['get'](_0x19cc('0x1e'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x1f')]);router[_0x19cc('0x9')](_0x19cc('0x20'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x21')]);router['get']('/:id/agents',auth[_0x19cc('0xa')](),controller[_0x19cc('0x22')]);router['get']('/:id/prefixes',auth[_0x19cc('0xa')](),controller[_0x19cc('0x23')]);router['get'](_0x19cc('0x24'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x25')]);router['get']('/:id/mail_accounts',auth[_0x19cc('0xa')](),controller[_0x19cc('0x26')]);router[_0x19cc('0x9')](_0x19cc('0x27'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x28')]);router['get'](_0x19cc('0x29'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x19cc('0x9')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x19cc('0x2a')]);router[_0x19cc('0x9')](_0x19cc('0x2b'),auth['isAuthenticated'](),controller[_0x19cc('0x2c')]);router['get'](_0x19cc('0x2d'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x2e')]);router[_0x19cc('0x2f')]('/create_many',auth[_0x19cc('0xa')](),controller[_0x19cc('0x30')]);router[_0x19cc('0x2f')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x19cc('0x31')]);router[_0x19cc('0x2f')]('/',auth[_0x19cc('0xa')](),controller['create']);router[_0x19cc('0x2f')](_0x19cc('0x12'),auth[_0x19cc('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x19cc('0x32')]({'destination':function(_0x3e3e3a,_0x4fc887,_0x50b852){_0x50b852(null,path[_0x19cc('0x33')](config[_0x19cc('0x34')],_0x19cc('0x35')));},'filename':function(_0x498c79,_0x652d80,_0x844ca5){_0x844ca5(null,util[_0x19cc('0x36')]('%s-%s',Date[_0x19cc('0x37')](),_0x652d80[_0x19cc('0x38')]));}})});router[_0x19cc('0x2f')](_0x19cc('0xf'),upload['single'](_0x19cc('0x39')),controller[_0x19cc('0x3a')]);router['post'](_0x19cc('0x3b'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x3c')]);router[_0x19cc('0x2f')]('/:id/logout',auth['isAuthenticated'](),controller[_0x19cc('0x3d')]);router[_0x19cc('0x2f')](_0x19cc('0x3e'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x3f')]);router[_0x19cc('0x2f')](_0x19cc('0x40'),auth['isAuthenticated'](),controller[_0x19cc('0x41')]);router['post'](_0x19cc('0x1e'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x42')]);router[_0x19cc('0x2f')]('/:id/chat_interactions',auth[_0x19cc('0xa')](),controller[_0x19cc('0x43')]);router['post'](_0x19cc('0x44'),auth[_0x19cc('0xa')](),controller['addMailInteractions']);router[_0x19cc('0x2f')]('/:id/fax_interactions',auth[_0x19cc('0xa')](),controller[_0x19cc('0x45')]);router[_0x19cc('0x2f')](_0x19cc('0x46'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x47')]);router['post'](_0x19cc('0x48'),auth[_0x19cc('0xa')](),controller['addOpenchannelInteractions']);router['post']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x19cc('0x49')]);router[_0x19cc('0x2f')](_0x19cc('0x4a'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x4b')]);router[_0x19cc('0x2f')](_0x19cc('0x27'),auth['isAuthenticated'](),controller[_0x19cc('0x4c')]);router[_0x19cc('0x2f')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x19cc('0x4d')]);router['post'](_0x19cc('0x4e'),auth['isAuthenticated'](),controller[_0x19cc('0x4f')]);router['post'](_0x19cc('0x2b'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x50')]);router[_0x19cc('0x51')](_0x19cc('0xd'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x52')]);router[_0x19cc('0x51')](_0x19cc('0x53'),auth[_0x19cc('0xa')](),controller['changePassword']);router['delete'](_0x19cc('0x12'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x54')]);router[_0x19cc('0x55')]('/:id/teams',auth[_0x19cc('0xa')](),controller[_0x19cc('0x56')]);router[_0x19cc('0x55')](_0x19cc('0xd'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x19cc('0x57'),auth[_0x19cc('0xa')](),controller['removeChatInteractions']);router[_0x19cc('0x55')](_0x19cc('0x44'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x58')]);router[_0x19cc('0x55')](_0x19cc('0x59'),auth['isAuthenticated'](),controller[_0x19cc('0x5a')]);router['delete'](_0x19cc('0x46'),auth['isAuthenticated'](),controller[_0x19cc('0x5b')]);router[_0x19cc('0x55')](_0x19cc('0x48'),auth['isAuthenticated'](),controller[_0x19cc('0x5c')]);router[_0x19cc('0x55')](_0x19cc('0x24'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x5d')]);router[_0x19cc('0x55')](_0x19cc('0x4a'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x5e')]);router[_0x19cc('0x55')](_0x19cc('0x27'),auth[_0x19cc('0xa')](),controller['removeOpenchannelAccounts']);router[_0x19cc('0x55')](_0x19cc('0x29'),auth[_0x19cc('0xa')](),controller[_0x19cc('0x5f')]);router['delete']('/:id/chat_websites',auth[_0x19cc('0xa')](),controller[_0x19cc('0x60')]);router[_0x19cc('0x55')](_0x19cc('0x2b'),auth['isAuthenticated'](),controller[_0x19cc('0x61')]);module[_0x19cc('0x62')]=router;
\ No newline at end of file
+var _0x268d=['/:id/groups','getGroups','/:id/recordings','/:id/chat/interactions','getChatInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/create_many','bulkCreate','post','addContacts','create','/:id/queues','addQueues','join','root','server/files/images/','now','single','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects','put','update','/:id/password','removeQueues','delete','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeSquareProjects','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','describe','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt'];(function(_0x28d4a4,_0x7800c0){var _0x1a807b=function(_0x30aa29){while(--_0x30aa29){_0x28d4a4['push'](_0x28d4a4['shift']());}};_0x1a807b(++_0x7800c0);}(_0x268d,0x1cc));var _0xd268=function(_0xe7dc5c,_0x2881fd){_0xe7dc5c=_0xe7dc5c-0x0;var _0x539726=_0x268d[_0xe7dc5c];return _0x539726;};'use strict';var multer=require(_0xd268('0x0'));var util=require(_0xd268('0x1'));var path=require(_0xd268('0x2'));var timeout=require('connect-timeout');var express=require(_0xd268('0x3'));var router=express[_0xd268('0x4')]();var auth=require(_0xd268('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd268('0x6'));var controller=require(_0xd268('0x7'));router[_0xd268('0x8')]('/',auth[_0xd268('0x9')](),controller[_0xd268('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd268('0xb')]);router['get'](_0xd268('0xc'),auth[_0xd268('0x9')](),controller[_0xd268('0xd')]);router[_0xd268('0x8')](_0xd268('0xe'),controller[_0xd268('0xf')]);router[_0xd268('0x8')](_0xd268('0x10'),auth[_0xd268('0x9')](),controller[_0xd268('0x11')]);router[_0xd268('0x8')]('/:id/queues',auth[_0xd268('0x9')](),controller[_0xd268('0x12')]);router[_0xd268('0x8')]('/:id/queues_rt',auth[_0xd268('0x9')](),controller[_0xd268('0x13')]);router['get'](_0xd268('0x14'),auth[_0xd268('0x9')](),controller[_0xd268('0x15')]);router['get'](_0xd268('0x16'),auth[_0xd268('0x9')](),controller['getRecordings']);router['get'](_0xd268('0x17'),auth[_0xd268('0x9')](),controller[_0xd268('0x18')]);router[_0xd268('0x8')]('/:id/openchannel/interactions',auth[_0xd268('0x9')](),controller['getOpenchannelInteractions']);router[_0xd268('0x8')](_0xd268('0x19'),auth[_0xd268('0x9')](),controller[_0xd268('0x1a')]);router[_0xd268('0x8')]('/:id/sms/interactions',auth[_0xd268('0x9')](),controller['getSmsInteractions']);router[_0xd268('0x8')](_0xd268('0x1b'),auth[_0xd268('0x9')](),controller['getFaxInteractions']);router['get'](_0xd268('0x1c'),auth[_0xd268('0x9')](),controller[_0xd268('0x1d')]);router[_0xd268('0x8')](_0xd268('0x1e'),auth[_0xd268('0x9')](),controller[_0xd268('0x1f')]);router[_0xd268('0x8')](_0xd268('0x20'),auth[_0xd268('0x9')](),controller['getAgents']);router[_0xd268('0x8')]('/:id/prefixes',auth[_0xd268('0x9')](),controller['getVoicePrefixes']);router[_0xd268('0x8')](_0xd268('0x21'),auth['isAuthenticated'](),controller[_0xd268('0x22')]);router[_0xd268('0x8')](_0xd268('0x23'),auth[_0xd268('0x9')](),controller[_0xd268('0x24')]);router[_0xd268('0x8')]('/:id/openchannel_accounts',auth[_0xd268('0x9')](),controller[_0xd268('0x25')]);router['get'](_0xd268('0x26'),auth[_0xd268('0x9')](),controller['getSmsAccounts']);router[_0xd268('0x8')](_0xd268('0x27'),auth[_0xd268('0x9')](),controller[_0xd268('0x28')]);router['get'](_0xd268('0x29'),auth[_0xd268('0x9')](),controller[_0xd268('0x2a')]);router[_0xd268('0x8')](_0xd268('0x2b'),auth[_0xd268('0x9')](),controller['getScheduledCalls']);router['post'](_0xd268('0x2c'),auth[_0xd268('0x9')](),controller[_0xd268('0x2d')]);router[_0xd268('0x2e')](_0xd268('0x10'),auth[_0xd268('0x9')](),controller[_0xd268('0x2f')]);router['post']('/',auth[_0xd268('0x9')](),controller[_0xd268('0x30')]);router[_0xd268('0x2e')](_0xd268('0x31'),auth[_0xd268('0x9')](),controller[_0xd268('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e3e92,_0x2bb637,_0x11d3a4){_0x11d3a4(null,path[_0xd268('0x33')](config[_0xd268('0x34')],_0xd268('0x35')));},'filename':function(_0x3ea549,_0x426e70,_0x364cf0){_0x364cf0(null,util['format']('%s-%s',Date[_0xd268('0x36')](),_0x426e70['originalname']));}})});router[_0xd268('0x2e')](_0xd268('0xe'),upload[_0xd268('0x37')](_0xd268('0x38')),controller[_0xd268('0x39')]);router['post'](_0xd268('0x3a'),auth[_0xd268('0x9')](),controller[_0xd268('0x3b')]);router['post']('/:id/logout',auth[_0xd268('0x9')](),controller[_0xd268('0x3c')]);router['post'](_0xd268('0x3d'),auth['isAuthenticated'](),controller[_0xd268('0x3e')]);router['post'](_0xd268('0x3f'),auth[_0xd268('0x9')](),controller[_0xd268('0x40')]);router[_0xd268('0x2e')](_0xd268('0x1c'),auth[_0xd268('0x9')](),controller[_0xd268('0x41')]);router[_0xd268('0x2e')]('/:id/chat_interactions',auth[_0xd268('0x9')](),controller['addChatInteractions']);router[_0xd268('0x2e')]('/:id/mail_interactions',auth[_0xd268('0x9')](),controller[_0xd268('0x42')]);router[_0xd268('0x2e')](_0xd268('0x43'),auth[_0xd268('0x9')](),controller[_0xd268('0x44')]);router[_0xd268('0x2e')](_0xd268('0x45'),auth['isAuthenticated'](),controller[_0xd268('0x46')]);router[_0xd268('0x2e')](_0xd268('0x47'),auth[_0xd268('0x9')](),controller[_0xd268('0x48')]);router[_0xd268('0x2e')](_0xd268('0x21'),auth['isAuthenticated'](),controller[_0xd268('0x49')]);router[_0xd268('0x2e')]('/:id/mail_accounts',auth[_0xd268('0x9')](),controller[_0xd268('0x4a')]);router['post'](_0xd268('0x4b'),auth[_0xd268('0x9')](),controller[_0xd268('0x4c')]);router[_0xd268('0x2e')](_0xd268('0x26'),auth[_0xd268('0x9')](),controller[_0xd268('0x4d')]);router[_0xd268('0x2e')](_0xd268('0x27'),auth[_0xd268('0x9')](),controller['addChatWebsites']);router[_0xd268('0x2e')](_0xd268('0x29'),auth['isAuthenticated'](),controller[_0xd268('0x4e')]);router[_0xd268('0x4f')](_0xd268('0xc'),auth[_0xd268('0x9')](),controller[_0xd268('0x50')]);router[_0xd268('0x4f')](_0xd268('0x51'),auth[_0xd268('0x9')](),controller['changePassword']);router['delete'](_0xd268('0x31'),auth['isAuthenticated'](),controller[_0xd268('0x52')]);router[_0xd268('0x53')]('/:id/teams',auth[_0xd268('0x9')](),controller['removeTeams']);router['delete'](_0xd268('0xc'),auth['isAuthenticated'](),controller[_0xd268('0x54')]);router[_0xd268('0x53')](_0xd268('0x55'),auth[_0xd268('0x9')](),controller[_0xd268('0x56')]);router[_0xd268('0x53')](_0xd268('0x57'),auth[_0xd268('0x9')](),controller[_0xd268('0x58')]);router['delete'](_0xd268('0x43'),auth[_0xd268('0x9')](),controller[_0xd268('0x59')]);router[_0xd268('0x53')](_0xd268('0x45'),auth[_0xd268('0x9')](),controller[_0xd268('0x5a')]);router[_0xd268('0x53')](_0xd268('0x47'),auth[_0xd268('0x9')](),controller['removeOpenchannelInteractions']);router[_0xd268('0x53')](_0xd268('0x21'),auth[_0xd268('0x9')](),controller[_0xd268('0x5b')]);router[_0xd268('0x53')](_0xd268('0x23'),auth[_0xd268('0x9')](),controller[_0xd268('0x5c')]);router['delete']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0xd268('0x53')](_0xd268('0x27'),auth['isAuthenticated'](),controller[_0xd268('0x5d')]);router['delete'](_0xd268('0x29'),auth[_0xd268('0x9')](),controller[_0xd268('0x5e')]);module[_0xd268('0x5f')]=router;
\ No newline at end of file
index d07a994..796cbd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5050=['from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','never','\x22\x22\x20<>','always','accept','refuse','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','TEXT','permissions','map','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','telephone','INTEGER','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x5050,0x192));var _0x0505=function(_0x47cbbf,_0x1d0e40){_0x47cbbf=_0x47cbbf-0x0;var _0x119c80=_0x5050[_0x47cbbf];return _0x119c80;};'use strict';var Sequelize=require(_0x0505('0x0'));var moment=require(_0x0505('0x1'));var util=require(_0x0505('0x2'));var _=require(_0x0505('0x3'));module[_0x0505('0x4')]={'name':{'type':Sequelize[_0x0505('0x5')],'allowNull':![],'unique':_0x0505('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1cb6ee){this[_0x0505('0x7')](_0x0505('0x6'),_0x1cb6ee);this[_0x0505('0x7')](_0x0505('0x8'),_0x1cb6ee);},'comment':_0x0505('0x9')},'fullname':{'type':Sequelize[_0x0505('0x5')],'allowNull':![],'set':function(_0x246a2e){this[_0x0505('0x7')](_0x0505('0xa'),_0x246a2e);this[_0x0505('0x7')](_0x0505('0xb'),util[_0x0505('0xc')](_0x0505('0xd'),_0x246a2e,this[_0x0505('0xe')](_0x0505('0xf'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0505('0x5')],'allowNull':![],'unique':_0x0505('0x10'),'validate':{'isEmail':!![]},'set':function(_0x36ff55){if(_0x36ff55){this[_0x0505('0x7')](_0x0505('0x10'),_0x36ff55[_0x0505('0x11')]());}}},'role':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x13'),_0x0505('0x14'),'agent',_0x0505('0x15')),'allowNull':![]},'password':{'type':Sequelize[_0x0505('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':![],'unique':_0x0505('0xf'),'set':function(_0x29fb1b){this[_0x0505('0x7')](_0x0505('0xf'),_0x29fb1b);this[_0x0505('0x7')]('accountcode',_0x29fb1b);this[_0x0505('0x7')](_0x0505('0xb'),util[_0x0505('0xc')](_0x0505('0xd'),this[_0x0505('0xe')](_0x0505('0xa')),_0x29fb1b));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0505('0x5')]},'mobile':{'type':Sequelize[_0x0505('0x5')]},'address':{'type':Sequelize[_0x0505('0x5')]},'zipcode':{'type':Sequelize[_0x0505('0x5')]},'userpic':{'type':Sequelize[_0x0505('0x5')]},'city':{'type':Sequelize[_0x0505('0x5')]},'country':{'type':Sequelize[_0x0505('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0505('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0505('0x5')],'defaultValue':_0x0505('0x19')},'lastPauseAt':{'type':Sequelize[_0x0505('0x17')]},'chatCapacity':{'type':Sequelize[_0x0505('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0505('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0505('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0505('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0505('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0505('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![],'defaultValue':_0x0505('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0505('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x1b'),'user','peer'),'allowNull':!![],'defaultValue':_0x0505('0x1b')},'context':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![],'defaultValue':_0x0505('0x1c')},'callingpres':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x1d'),_0x0505('0x1e'),_0x0505('0x1f'),_0x0505('0x20'),_0x0505('0x21'),_0x0505('0x22'),_0x0505('0x23'),_0x0505('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![],'defaultValue':_0x0505('0x25'),'set':function(_0x2aca71){this[_0x0505('0x7')](_0x0505('0x26'),_0x2aca71?_0x2aca71[_0x0505('0x27')](','):null);},'get':function(){return this[_0x0505('0xe')]('transport')?this[_0x0505('0xe')](_0x0505('0x26'))['split'](','):null;},'comment':_0x0505('0x28')},'dtmfmode':{'type':Sequelize[_0x0505('0x12')]('rfc2833',_0x0505('0x29'),_0x0505('0x2a'),_0x0505('0x2b'),_0x0505('0x2c')),'allowNull':!![],'defaultValue':_0x0505('0x2d')},'directmedia':{'type':Sequelize[_0x0505('0x12')]('yes','no',_0x0505('0x2e'),_0x0505('0x2f'),_0x0505('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0505('0x12')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0505('0x31'),'set':function(_0x17964b){this[_0x0505('0x7')](_0x0505('0x32'),_0x17964b?_0x17964b[_0x0505('0x27')](','):null);},'get':function(){return this[_0x0505('0xe')]('nat')?this[_0x0505('0xe')](_0x0505('0x32'))[_0x0505('0x33')](','):null;},'comment':_0x0505('0x34')},'callgroup':{'type':Sequelize[_0x0505('0x5')]},'namedcallgroup':{'type':Sequelize[_0x0505('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x0505('0x5')]},'language':{'type':Sequelize[_0x0505('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0505('0x5')]},'disallow':{'type':Sequelize[_0x0505('0x5')],'allowNull':![],'defaultValue':_0x0505('0x35')},'allow':{'type':Sequelize[_0x0505('0x5')],'allowNull':![],'defaultValue':_0x0505('0x36'),'set':function(_0x43984e){this[_0x0505('0x7')](_0x0505('0x37'),_0x43984e?_0x43984e[_0x0505('0x27')](';'):_0x0505('0x36'));},'get':function(){return this[_0x0505('0xe')](_0x0505('0x37'))?this[_0x0505('0xe')](_0x0505('0x37'))[_0x0505('0x33')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0505('0x12')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![],'set':function(_0xe7ddf7){this[_0x0505('0x7')]('insecure',_0xe7ddf7?_0xe7ddf7['join'](','):null);},'get':function(){return this[_0x0505('0xe')]('insecure')?this['getDataValue'](_0x0505('0x38'))['split'](','):null;},'comment':_0x0505('0x39')},'trustrpid':{'type':Sequelize['ENUM'](_0x0505('0x3a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no',_0x0505('0x3b')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0505('0x3c')},'amaflags':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x0505('0x3a'),'no'),'allowNull':!![],'defaultValue':_0x0505('0x3a')},'busylevel':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0505('0x3a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0505('0x12')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x0505('0x3d')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0505('0x3e'),_0x0505('0x3f'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![],'defaultValue':_0x0505('0x3a')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0505('0x3a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0505('0x3a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0505('0x12')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0505('0x12')]('yes','no',_0x0505('0x40'),_0x0505('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x42'),_0x0505('0x43'),_0x0505('0x44')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0505('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0505('0x12')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0505('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no',_0x0505('0x2e'),_0x0505('0x2f'),_0x0505('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0505('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x0505('0x17')]},'showWebBar':{'type':Sequelize[_0x0505('0x16')],'defaultValue':0x0,'set':function(_0x5f0981){this[_0x0505('0x7')](_0x0505('0x46'),_0x5f0981);var _0x629d41=this[_0x0505('0x47')]({'plain':!![]});switch(_0x5f0981){case 0x0:case 0x1:var _0x2f0669=_0x629d41[_0x0505('0x26')]?_['isArray'](_0x629d41[_0x0505('0x26')])?_0x629d41[_0x0505('0x26')][_0x0505('0x27')]():_0x629d41[_0x0505('0x26')]:_0x0505('0x25');if(_0x2f0669===_0x0505('0x48')){_0x2f0669=_0x0505('0x25');}this[_0x0505('0x7')]('transport',_0x2f0669);this[_0x0505('0x7')](_0x0505('0x49'),'no');this[_0x0505('0x7')](_0x0505('0x4a'),null);this['setDataValue']('force_avp',null);this[_0x0505('0x7')](_0x0505('0x4b'),null);this[_0x0505('0x7')](_0x0505('0x4c'),null);this[_0x0505('0x7')](_0x0505('0x4d'),null);this[_0x0505('0x7')](_0x0505('0x4e'),null);this[_0x0505('0x7')](_0x0505('0x4f'),null);this[_0x0505('0x7')]('dtlsprivatekey',null);this['setDataValue'](_0x0505('0x50'),'no');break;case 0x2:this[_0x0505('0x7')](_0x0505('0x26'),'wss');this[_0x0505('0x7')](_0x0505('0x49'),_0x0505('0x3a'));this['setDataValue']('avpf',_0x0505('0x3a'));this['setDataValue']('force_avp','yes');this[_0x0505('0x7')](_0x0505('0x4b'),_0x0505('0x3a'));this[_0x0505('0x7')]('dtlsenable',_0x0505('0x3a'));this[_0x0505('0x7')]('dtlsverify','no');this[_0x0505('0x7')](_0x0505('0x4e'),_0x0505('0x44'));this[_0x0505('0x7')](_0x0505('0x4f'),_0x629d41['dtlscertfile']||_0x0505('0x51'));this[_0x0505('0x7')]('dtlsprivatekey',_0x629d41[_0x0505('0x52')]||'/etc/pki/tls/private/motion.key');this[_0x0505('0x7')](_0x0505('0x50'),_0x0505('0x3a'));break;default:}}},'permissions':{'type':Sequelize[_0x0505('0x53')],'set':function(_0x203298){this[_0x0505('0x7')](_0x0505('0x54'),_0x203298?_0x203298[_0x0505('0x27')](','):[]);},'get':function(){return this[_0x0505('0xe')](_0x0505('0x54'))?_[_0x0505('0x55')](this[_0x0505('0xe')]('permissions')[_0x0505('0x33')](','),function(_0x8d798c){return parseInt(_0x8d798c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0505('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0505('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0505('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0505('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0505('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0505('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0505('0x12')](_0x0505('0x3a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0505('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize[_0x0505('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0505('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0505('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x581d=['sequelize','util','lodash','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','telephone','BOOLEAN','DATE','INTEGER','ENUM','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','yes','nonat','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','dtlsenable','actpass','dtlsprivatekey','TEXT','permissions','map'];(function(_0x50284e,_0x5e67a9){var _0x103bdb=function(_0x23c1b2){while(--_0x23c1b2){_0x50284e['push'](_0x50284e['shift']());}};_0x103bdb(++_0x5e67a9);}(_0x581d,0xe7));var _0xd581=function(_0x3082e3,_0x38e71d){_0x3082e3=_0x3082e3-0x0;var _0x5643c2=_0x581d[_0x3082e3];return _0x5643c2;};'use strict';var Sequelize=require(_0xd581('0x0'));var moment=require('moment');var util=require(_0xd581('0x1'));var _=require(_0xd581('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd581('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3aa3d6){this[_0xd581('0x4')](_0xd581('0x3'),_0x3aa3d6);this[_0xd581('0x4')](_0xd581('0x5'),_0x3aa3d6);},'comment':_0xd581('0x6')},'fullname':{'type':Sequelize[_0xd581('0x7')],'allowNull':![],'set':function(_0xad2b01){this['setDataValue'](_0xd581('0x8'),_0xad2b01);this['setDataValue'](_0xd581('0x9'),util[_0xd581('0xa')](_0xd581('0xb'),_0xad2b01,this[_0xd581('0xc')](_0xd581('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd581('0x7')],'allowNull':![],'unique':_0xd581('0xe'),'validate':{'isEmail':!![]},'set':function(_0x5438b2){if(_0x5438b2){this[_0xd581('0x4')]('email',_0x5438b2[_0xd581('0xf')]());}}},'role':{'type':Sequelize['ENUM'](_0xd581('0x10'),_0xd581('0x11'),_0xd581('0x12'),_0xd581('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xd581('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xd581('0xd'),'set':function(_0x531f71){this['setDataValue'](_0xd581('0xd'),_0x531f71);this['setDataValue']('accountcode',_0x531f71);this[_0xd581('0x4')](_0xd581('0x9'),util['format'](_0xd581('0xb'),this[_0xd581('0xc')](_0xd581('0x8')),_0x531f71));}},'salt':{'type':Sequelize[_0xd581('0x7')]},'phone':{'type':Sequelize[_0xd581('0x7')]},'mobile':{'type':Sequelize[_0xd581('0x7')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xd581('0x7')]},'country':{'type':Sequelize[_0xd581('0x7')]},'online':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xd581('0x15')]},'chatCapacity':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd581('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xd581('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xd581('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'host':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0xd581('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x18'),'user','peer'),'allowNull':!![],'defaultValue':_0xd581('0x18')},'context':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x19'),_0xd581('0x1a'),_0xd581('0x1b'),_0xd581('0x1c'),'PROHIB_NOT_SCREENED',_0xd581('0x1d'),'PROHIB_FAILED_SCREEN',_0xd581('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'secret':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd581('0x1f'),'set':function(_0x5a17b1){this[_0xd581('0x4')](_0xd581('0x20'),_0x5a17b1?_0x5a17b1[_0xd581('0x21')](','):null);},'get':function(){return this[_0xd581('0xc')](_0xd581('0x20'))?this[_0xd581('0xc')](_0xd581('0x20'))[_0xd581('0x22')](','):null;},'comment':_0xd581('0x23')},'dtmfmode':{'type':Sequelize[_0xd581('0x17')]('rfc2833',_0xd581('0x24'),'shortinfo',_0xd581('0x25'),_0xd581('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no',_0xd581('0x28'),_0xd581('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd581('0x17')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd581('0x2a'),'set':function(_0x2d3a4a){this['setDataValue'](_0xd581('0x2b'),_0x2d3a4a?_0x2d3a4a[_0xd581('0x21')](','):null);},'get':function(){return this[_0xd581('0xc')]('nat')?this[_0xd581('0xc')](_0xd581('0x2b'))[_0xd581('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xd581('0x7')]},'namedcallgroup':{'type':Sequelize[_0xd581('0x7')]},'pickupgroup':{'type':Sequelize[_0xd581('0x7')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd581('0x7')]},'disallow':{'type':Sequelize[_0xd581('0x7')],'allowNull':![],'defaultValue':_0xd581('0x2c')},'allow':{'type':Sequelize[_0xd581('0x7')],'allowNull':![],'defaultValue':_0xd581('0x2d'),'set':function(_0x25ddda){this['setDataValue'](_0xd581('0x2e'),_0x25ddda?_0x25ddda['join'](';'):_0xd581('0x2d'));},'get':function(){return this[_0xd581('0xc')](_0xd581('0x2e'))?this[_0xd581('0xc')](_0xd581('0x2e'))[_0xd581('0x22')](';'):null;},'comment':_0xd581('0x2f')},'autoframing':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![],'set':function(_0x419b24){this['setDataValue'](_0xd581('0x30'),_0x419b24?_0x419b24['join'](','):null);},'get':function(){return this[_0xd581('0xc')]('insecure')?this['getDataValue'](_0xd581('0x30'))[_0xd581('0x22')](','):null;},'comment':_0xd581('0x31')},'trustrpid':{'type':Sequelize['ENUM'](_0xd581('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd581('0x32')},'amaflags':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xd581('0x27'),'no'),'allowNull':!![],'defaultValue':_0xd581('0x27')},'busylevel':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xd581('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xd581('0x17')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd581('0x17')]('yes','no',_0xd581('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd581('0x17')]('accept',_0xd581('0x34'),_0xd581('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xd581('0x17')]('uac','uas'),'allowNull':!![],'defaultValue':_0xd581('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![],'defaultValue':_0xd581('0x27')},'keepalive':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd581('0x17')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd581('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xd581('0x27'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no',_0xd581('0x37'),_0xd581('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd581('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd581('0x17')]('active',_0xd581('0x39'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xd581('0x17')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd581('0x17')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd581('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xd581('0x17')](_0xd581('0x27'),'no',_0xd581('0x28'),'update',_0xd581('0x3a')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd581('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0xd581('0x15')]},'showWebBar':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0,'set':function(_0x5cce48){this[_0xd581('0x4')](_0xd581('0x3b'),_0x5cce48);var _0x1ca6ef=this[_0xd581('0x3c')]({'plain':!![]});switch(_0x5cce48){case 0x0:case 0x1:var _0x1390a8=_0x1ca6ef['transport']?_[_0xd581('0x3d')](_0x1ca6ef['transport'])?_0x1ca6ef['transport']['join']():_0x1ca6ef['transport']:_0xd581('0x1f');if(_0x1390a8===_0xd581('0x3e')){_0x1390a8='udp';}this[_0xd581('0x4')]('transport',_0x1390a8);this['setDataValue'](_0xd581('0x3f'),'no');this[_0xd581('0x4')](_0xd581('0x40'),null);this['setDataValue'](_0xd581('0x41'),null);this[_0xd581('0x4')](_0xd581('0x42'),null);this[_0xd581('0x4')]('dtlsenable',null);this['setDataValue'](_0xd581('0x43'),null);this[_0xd581('0x4')](_0xd581('0x44'),null);this[_0xd581('0x4')](_0xd581('0x45'),null);this[_0xd581('0x4')]('dtlsprivatekey',null);this[_0xd581('0x4')](_0xd581('0x46'),'no');break;case 0x2:this[_0xd581('0x4')](_0xd581('0x20'),'wss');this['setDataValue'](_0xd581('0x3f'),_0xd581('0x27'));this[_0xd581('0x4')](_0xd581('0x40'),_0xd581('0x27'));this['setDataValue']('force_avp','yes');this[_0xd581('0x4')]('icesupport',_0xd581('0x27'));this[_0xd581('0x4')](_0xd581('0x47'),_0xd581('0x27'));this[_0xd581('0x4')]('dtlsverify','no');this['setDataValue'](_0xd581('0x44'),_0xd581('0x48'));this[_0xd581('0x4')](_0xd581('0x45'),_0x1ca6ef['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0xd581('0x4')](_0xd581('0x49'),_0x1ca6ef[_0xd581('0x49')]||'/etc/pki/tls/private/motion.key');this[_0xd581('0x4')](_0xd581('0x46'),_0xd581('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0xd581('0x4a')],'set':function(_0x35ea45){this[_0xd581('0x4')](_0xd581('0x4b'),_0x35ea45?_0x35ea45[_0xd581('0x21')](','):[]);},'get':function(){return this[_0xd581('0xc')](_0xd581('0x4b'))?_[_0xd581('0x4c')](this['getDataValue']('permissions')[_0xd581('0x22')](','),function(_0x53021b){return parseInt(_0x53021b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd581('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0xd581('0x7')]},'phoneBarUnconditional':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd581('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xd581('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xd581('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd581('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd581('0x17')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd581('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd581('0x7')]},'passwordResetAt':{'type':Sequelize[_0xd581('0x15')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xd581('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xd581('0x14')],'defaultValue':![]}};
\ No newline at end of file
index 62ebdf1..d47a3a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb37=['Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','loginInPause','voicePause','interface','isValidChannel','channel','capitalize','toLowerCase','Queues','ids','spread','QueueId','emit','Queue:save','voice','VoiceQueue','findAll','push','format','penalty','each','remove','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','join','server/files/images/logos/default_profile.png','existsSync','root','server/files/images/','download','getContacts','CmContact','options','CmList','List','Tag','Tags','color','tag','getQueues','findOne','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','headers','connection','socket','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','concat','logout','all','pause','QueuePause','updateAttributes','getChannels','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','mail','chat','fax','sms','openchannel','manual','set','%s%s','Pause','getTeams','addTeams','removeTeams','getLists','getAgents','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','CmHopper','firstName','Contact','dialActive','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','User,\x20%s,\x20%s','sendStatus','end','status','count','Content-Range','json','apply','reject','save','update','then','destroy','Users','Agents','agent','Telephones','filter','value','includes','role','find','name','stack','index','User','rawAttributes','model','keys','password','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','add','day','merge','map','sequelize','lower','col','field','includeAll','include','rows','show','params','bulkCreate','body','describe','addContacts','agent\x20role','telephone','admin','user','../../config/license/util','getLicense','users','isNil','License\x20limit\x20reached','create','internal','Setting','findById','max','SELECT','from','voicemail','fullname','email','102','103','110','104','105','106','107','109','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password'];(function(_0x3284e0,_0x2febaa){var _0x578198=function(_0xabb6f2){while(--_0xabb6f2){_0x3284e0['push'](_0x3284e0['shift']());}};_0x578198(++_0x2febaa);}(_0xbb37,0xb3));var _0x7bb3=function(_0x34a14d,_0xc49d24){_0x34a14d=_0x34a14d-0x0;var _0x2015f2=_0xbb37[_0x34a14d];return _0x2015f2;};'use strict';var pdf=require(_0x7bb3('0x0'));var emlformat=require(_0x7bb3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7bb3('0x2'));var jsonpatch=require(_0x7bb3('0x3'));var rp=require('request-promise');var moment=require(_0x7bb3('0x4'));var BPromise=require(_0x7bb3('0x5'));var Mustache=require(_0x7bb3('0x6'));var util=require(_0x7bb3('0x7'));var path=require('path');var sox=require(_0x7bb3('0x8'));var csv=require(_0x7bb3('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7bb3('0xa'));var crypto=require('crypto');var jsforce=require(_0x7bb3('0xb'));var deskjs=require(_0x7bb3('0xc'));var toCsv=require(_0x7bb3('0x9'));var querystring=require('querystring');var Papa=require(_0x7bb3('0xd'));var Redis=require('ioredis');var qs=require(_0x7bb3('0xe'));var logger=require(_0x7bb3('0xf'))(_0x7bb3('0x10'));var utils=require(_0x7bb3('0x11'));var config=require(_0x7bb3('0x12'));var db=require(_0x7bb3('0x13'))['db'];config['redis']=_['defaults'](config[_0x7bb3('0x14')],{'host':_0x7bb3('0x15'),'port':0x18eb});var socket=require(_0x7bb3('0x16'))(new Redis(config[_0x7bb3('0x14')]));require('./user.socket')[_0x7bb3('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7bb3('0x18')][_0x7bb3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xd02606,_0x4e32a3,_0x3422db,_0x88ff14){return new BPromise(function(_0x578ff4,_0x269ece){var _0xa600b9=_0x88ff14||client;return _0xa600b9[_0x7bb3('0x1a')](_0xd02606,_0x3422db)['then'](function(_0x166425){logger['info']('User,\x20%s,\x20%s',_0x4e32a3,_0x7bb3('0x1b'));logger[_0x7bb3('0x1c')](_0x7bb3('0x1d'),_0x4e32a3,_0x7bb3('0x1b'),JSON[_0x7bb3('0x1e')](_0x166425));if(_0x166425[_0x7bb3('0x1f')]){if(_0x166425[_0x7bb3('0x1f')][_0x7bb3('0x20')]===0x1f4){logger[_0x7bb3('0x1f')]('User,\x20%s,\x20%s',_0x4e32a3,_0x166425[_0x7bb3('0x1f')][_0x7bb3('0x21')]);return _0x269ece(_0x166425[_0x7bb3('0x1f')][_0x7bb3('0x21')]);}logger[_0x7bb3('0x1f')]('User,\x20%s,\x20%s',_0x4e32a3,_0x166425[_0x7bb3('0x1f')][_0x7bb3('0x21')]);return _0x578ff4(_0x166425[_0x7bb3('0x1f')][_0x7bb3('0x21')]);}else{logger[_0x7bb3('0x22')]('User,\x20%s,\x20%s',_0x4e32a3,_0x7bb3('0x1b'));_0x578ff4(_0x166425[_0x7bb3('0x23')][_0x7bb3('0x21')]);}})[_0x7bb3('0x24')](function(_0x1a21a8){logger[_0x7bb3('0x1f')](_0x7bb3('0x25'),_0x4e32a3,_0x1a21a8);_0x269ece(_0x1a21a8);});});}function respondWithStatusCode(_0x10a7a2,_0x405e1c){_0x405e1c=_0x405e1c||0xcc;return function(_0xd751dc){if(_0xd751dc){return _0x10a7a2[_0x7bb3('0x26')](_0x405e1c);}return _0x10a7a2['status'](_0x405e1c)[_0x7bb3('0x27')]();};}function respondWithResult(_0x172f9,_0x554459){_0x554459=_0x554459||0xc8;return function(_0x2a1295){if(_0x2a1295){return _0x172f9[_0x7bb3('0x28')](_0x554459)['json'](_0x2a1295);}};}function respondWithFilteredResult(_0x27a5b3,_0x2d9b79){return function(_0x30198e){if(_0x30198e){var _0x10120d=_0x30198e[_0x7bb3('0x29')],_0xc891b6=_0x2d9b79['offset'],_0x422683=_0x2d9b79['offset']+_0x2d9b79['limit'],_0x5d4f13;if(_0x422683>=_0x10120d){_0x422683=_0x10120d;_0x5d4f13=0xc8;}else{_0x5d4f13=0xce;}_0x27a5b3[_0x7bb3('0x28')](_0x5d4f13);return _0x27a5b3['set'](_0x7bb3('0x2a'),_0xc891b6+'-'+_0x422683+'/'+_0x10120d)[_0x7bb3('0x2b')](_0x30198e);}return null;};}function patchUpdates(_0xb6b391){return function(_0x480dad){try{jsonpatch[_0x7bb3('0x2c')](_0x480dad,_0xb6b391,!![]);}catch(_0x3a1c5f){return BPromise[_0x7bb3('0x2d')](_0x3a1c5f);}return _0x480dad[_0x7bb3('0x2e')]();};}function saveUpdates(_0x47bbbf,_0x36ca42){return function(_0x56371e){if(_0x56371e){return _0x56371e[_0x7bb3('0x2f')](_0x47bbbf)[_0x7bb3('0x30')](function(_0x2ecadb){return _0x2ecadb;});}return null;};}function removeEntity(_0x2ea05b,_0x486e52){return function(_0x37903e){if(_0x37903e){return _0x37903e[_0x7bb3('0x31')]()[_0x7bb3('0x30')](function(){var _0x13740e=_0x37903e['get']({'plain':!![]});var _0x545882=[{'name':_0x7bb3('0x32'),'value':'user','ignore':!![]},{'name':_0x7bb3('0x33'),'value':_0x7bb3('0x34'),'ignore':![]},{'name':_0x7bb3('0x35'),'value':'telephone','ignore':![]}];var _0x3ff509=_(_0x545882)[_0x7bb3('0x36')]('ignore')['map'](_0x7bb3('0x37'))[_0x7bb3('0x37')]();if(_[_0x7bb3('0x38')](_0x3ff509,_0x13740e[_0x7bb3('0x39')])){return;}var _0x53a302=_[_0x7bb3('0x3a')](_0x545882,[_0x7bb3('0x37'),_0x13740e[_0x7bb3('0x39')]])[_0x7bb3('0x3b')];return db['UserProfileResource'][_0x7bb3('0x31')]({'where':{'type':_0x53a302,'resourceId':_0x13740e['id']}})['then'](function(){return _0x37903e;});})[_0x7bb3('0x30')](function(){_0x2ea05b[_0x7bb3('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5fb6,_0x55704c){return function(_0x4ada53){if(!_0x4ada53){_0x1e5fb6[_0x7bb3('0x26')](0x194);}return _0x4ada53;};}function handleError(_0x53e3a0,_0x265c0f){_0x265c0f=_0x265c0f||0x1f4;return function(_0x1cba5d){logger[_0x7bb3('0x1f')](_0x1cba5d[_0x7bb3('0x3c')]);if(_0x1cba5d['name']){delete _0x1cba5d[_0x7bb3('0x3b')];}_0x53e3a0[_0x7bb3('0x28')](_0x265c0f)['send'](_0x1cba5d);};}exports[_0x7bb3('0x3d')]=function(_0x33999b,_0x3ef81a){var _0x31f83e={},_0x1aad4d={},_0x288c90={'count':0x0,'rows':[]};var _0x2a98e0=db[_0x7bb3('0x3e')][_0x7bb3('0x3f')];_0x1aad4d[_0x7bb3('0x40')]=_['differenceBy'](_[_0x7bb3('0x41')](_0x2a98e0),[_0x7bb3('0x42'),'salt']);var _0x1e40e6={'dateStart':_0x33999b['query'][_0x7bb3('0x43')],'dateEnd':_0x33999b[_0x7bb3('0x44')][_0x7bb3('0x45')]};delete _0x33999b[_0x7bb3('0x44')]['dateStart'];delete _0x33999b['query']['dateEnd'];_0x1aad4d[_0x7bb3('0x44')]=_['keys'](_0x33999b[_0x7bb3('0x44')]);_0x1aad4d[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x1aad4d[_0x7bb3('0x40')],_0x1aad4d[_0x7bb3('0x44')]);_0x31f83e[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x1aad4d[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x33999b['query'][_0x7bb3('0x49')]));_0x31f83e[_0x7bb3('0x48')]=_0x31f83e[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x31f83e[_0x7bb3('0x48')]:_0x1aad4d['model'];if(!_0x33999b['query'][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x31f83e[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x33999b[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x31f83e[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x33999b[_0x7bb3('0x44')]['offset']);}_0x31f83e[_0x7bb3('0x4f')]=qs['sort'](_0x33999b[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x31f83e[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x33999b[_0x7bb3('0x44')],_0x1aad4d['filters']));if(_0x1e40e6['dateStart']){if(_0x1e40e6['dateEnd']){_0x1e40e6[_0x7bb3('0x45')]=moment(_0x1e40e6[_0x7bb3('0x45')])[_0x7bb3('0x53')](0x1,_0x7bb3('0x54'));}else{_0x1e40e6[_0x7bb3('0x45')]=moment(_0x1e40e6['dateStart'])[_0x7bb3('0x53')](0x1,_0x7bb3('0x54'));}_[_0x7bb3('0x55')](_0x31f83e[_0x7bb3('0x51')],{'createdAt':{'$gte':_0x1e40e6['dateStart'],'$lte':_0x1e40e6['dateEnd']}});}if(_0x33999b[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x31f83e[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x31f83e['where'],{'$or':_[_0x7bb3('0x56')](_0x2a98e0,function(_0x2321be){return db[_0x7bb3('0x57')][_0x7bb3('0x51')](db['sequelize']['fn'](_0x7bb3('0x58'),db[_0x7bb3('0x57')][_0x7bb3('0x59')](_0x2321be[_0x7bb3('0x5a')])),{'$like':db['sequelize']['fn'](_0x7bb3('0x58'),'%'+_0x33999b[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%')});})});}_0x31f83e=_[_0x7bb3('0x55')]({},_0x31f83e,_0x33999b['options']);var _0x290a69={'where':_0x31f83e[_0x7bb3('0x51')]};return db[_0x7bb3('0x3e')][_0x7bb3('0x29')](_0x290a69)[_0x7bb3('0x30')](function(_0x4ed8bc){_0x288c90[_0x7bb3('0x29')]=_0x4ed8bc;if(_0x33999b[_0x7bb3('0x44')][_0x7bb3('0x5b')]){_0x31f83e[_0x7bb3('0x5c')]=[{'all':!![]}];}return db[_0x7bb3('0x3e')]['findAll'](_0x31f83e);})[_0x7bb3('0x30')](function(_0x1d290b){_0x288c90[_0x7bb3('0x5d')]=_0x1d290b;return _0x288c90;})[_0x7bb3('0x30')](respondWithFilteredResult(_0x3ef81a,_0x31f83e))[_0x7bb3('0x24')](handleError(_0x3ef81a,null));};exports[_0x7bb3('0x5e')]=function(_0x18820f,_0x14072e){var _0x8ca1d7={'raw':![],'where':{'id':_0x18820f[_0x7bb3('0x5f')]['id']}},_0x599d4e={};_0x599d4e[_0x7bb3('0x40')]=_['differenceBy'](_['keys'](db[_0x7bb3('0x3e')][_0x7bb3('0x3f')]),[_0x7bb3('0x42'),'salt']);_0x599d4e['query']=_[_0x7bb3('0x41')](_0x18820f['query']);_0x599d4e[_0x7bb3('0x46')]=_['intersection'](_0x599d4e[_0x7bb3('0x40')],_0x599d4e['query']);_0x8ca1d7[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x599d4e['model'],qs[_0x7bb3('0x49')](_0x18820f['query'][_0x7bb3('0x49')]));_0x8ca1d7['attributes']=_0x8ca1d7['attributes'][_0x7bb3('0x4a')]?_0x8ca1d7['attributes']:_0x599d4e[_0x7bb3('0x40')];if(_0x18820f[_0x7bb3('0x44')][_0x7bb3('0x5b')]){_0x8ca1d7[_0x7bb3('0x5c')]=[{'all':!![]}];}_0x8ca1d7=_[_0x7bb3('0x55')]({},_0x8ca1d7,_0x18820f['options']);return db['User'][_0x7bb3('0x3a')](_0x8ca1d7)[_0x7bb3('0x30')](handleEntityNotFound(_0x14072e,null))[_0x7bb3('0x30')](respondWithResult(_0x14072e,null))[_0x7bb3('0x24')](handleError(_0x14072e,null));};exports[_0x7bb3('0x60')]=function(_0x39d8dc,_0x3b3795){return db[_0x7bb3('0x3e')][_0x7bb3('0x60')](_0x39d8dc[_0x7bb3('0x61')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3b3795,0xc9))[_0x7bb3('0x24')](handleError(_0x3b3795,null));};exports['update']=function(_0x5156c0,_0x12b1c8){if(_0x5156c0[_0x7bb3('0x61')]['id']){delete _0x5156c0[_0x7bb3('0x61')]['id'];}return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x5156c0[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x12b1c8,null))[_0x7bb3('0x30')](saveUpdates(_0x5156c0[_0x7bb3('0x61')],null))['then'](respondWithResult(_0x12b1c8,null))[_0x7bb3('0x24')](handleError(_0x12b1c8,null));};exports[_0x7bb3('0x62')]=function(_0x5ee036,_0x5aeb2b){return db[_0x7bb3('0x3e')][_0x7bb3('0x62')]()[_0x7bb3('0x30')](respondWithResult(_0x5aeb2b,null))['catch'](handleError(_0x5aeb2b,null));};exports[_0x7bb3('0x63')]=function(_0x5e99f8,_0x36bfbc,_0x206e27){return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x5e99f8[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x36bfbc,null))['then'](function(_0x1f55fb){if(_0x1f55fb){return _0x1f55fb['addContacts'](_0x5e99f8[_0x7bb3('0x61')]['ids'],_['omit'](_0x5e99f8[_0x7bb3('0x61')],['ids','id'])||{});}})[_0x7bb3('0x30')](respondWithResult(_0x36bfbc,null))['catch'](handleError(_0x36bfbc,null));};var getLicense=function(_0x189727){return new BPromise(function(_0x5c86bb,_0x3ffb57){var _0x28ef91=0x0;_0x189727[_0x7bb3('0x61')]['role']==='agent'&&_0x5c86bb(_0x7bb3('0x64'));return db[_0x7bb3('0x3e')][_0x7bb3('0x29')]({'where':{'$or':[{'role':_0x189727[_0x7bb3('0x61')]['role']===_0x7bb3('0x65')?_0x7bb3('0x65'):[_0x7bb3('0x66'),_0x7bb3('0x67')]}]}})['then'](function(_0x1832d1){_0x28ef91=_0x1832d1;return require(_0x7bb3('0x68'))[_0x7bb3('0x69')]();})[_0x7bb3('0x30')](function(_0x5e814d){var _0x2d8f33=_0x189727[_0x7bb3('0x61')][_0x7bb3('0x39')]===_0x7bb3('0x65')?'telephones':_0x7bb3('0x6a');if(!_[_0x7bb3('0x6b')](_0x5e814d[_0x2d8f33])&&_0x28ef91>=_0x5e814d[_0x2d8f33]){return _0x3ffb57({'message':_0x7bb3('0x6c')});}return _0x5c86bb(util['format']('count\x20%s:\x20%s',_0x2d8f33,_0x28ef91));})[_0x7bb3('0x24')](function(_0x1ef64a){return _0x3ffb57(_0x1ef64a);});});};exports[_0x7bb3('0x6d')]=function(_0x253a66,_0xf28bea){return getLicense(_0x253a66)[_0x7bb3('0x30')](function(_0x972ebc){if(!_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x6e')]){var _0x322e2f;return db[_0x7bb3('0x6f')][_0x7bb3('0x70')](0x1)[_0x7bb3('0x30')](function(_0x4f9f92){_0x322e2f=_0x4f9f92['min_internal'];return db['User'][_0x7bb3('0x71')](_0x7bb3('0x6e'));})[_0x7bb3('0x30')](function(_0x5dbcb7){if(_[_0x7bb3('0x6b')](_0x5dbcb7)){if(_0x322e2f){_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x6e')]=_0x322e2f;}else{_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x6e')]=0x1;}}else{if(_['isNil'](_0x322e2f)||_0x322e2f==_0x5dbcb7){_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x6e')]=_0x5dbcb7+0x1;}else if(_0x322e2f>_0x5dbcb7){_0x253a66['body'][_0x7bb3('0x6e')]=_0x322e2f;}else{return db[_0x7bb3('0x57')][_0x7bb3('0x44')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x7bb3('0x57')]['QueryTypes'][_0x7bb3('0x72')]})['then'](function(_0x3358d0){if(_0x3358d0&&_0x3358d0[_0x7bb3('0x4a')]){for(var _0x430984=0x0,_0x417ce4=_0x3358d0[_0x7bb3('0x4a')];_0x430984<_0x417ce4&&_[_0x7bb3('0x6b')](_0x253a66[_0x7bb3('0x61')]['internal']);_0x430984++){if(_0x322e2f<=_0x3358d0[_0x430984]['from']){_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x6e')]=_0x3358d0[_0x430984][_0x7bb3('0x73')];}else if(_0x322e2f>_0x3358d0[_0x430984][_0x7bb3('0x73')]&&_0x322e2f<=_0x3358d0[_0x430984]['to']){_0x253a66['body'][_0x7bb3('0x6e')]=_0x322e2f;}}}if(_[_0x7bb3('0x6b')](_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x6e')])){_0x253a66['body'][_0x7bb3('0x6e')]=_0x5dbcb7+0x1;}});}}});}})[_0x7bb3('0x30')](function(){if(_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x74')]){_0x253a66[_0x7bb3('0x61')]['mailbox']=_0x253a66['body'][_0x7bb3('0x6e')];_0x253a66['body']['VoiceMail']={'mailbox':_0x253a66['body']['internal'],'password':_0x253a66[_0x7bb3('0x61')]['password'],'fullname':_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x75')],'email':_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x76')]};}if(_0x253a66[_0x7bb3('0x61')]&&_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x39')]==='agent'){_0x253a66[_0x7bb3('0x61')]['permissions']=['101',_0x7bb3('0x77'),_0x7bb3('0x78'),_0x7bb3('0x79'),_0x7bb3('0x7a'),_0x7bb3('0x7b'),_0x7bb3('0x7c'),_0x7bb3('0x7d'),'108',_0x7bb3('0x7e'),'100','111'];}return db[_0x7bb3('0x3e')][_0x7bb3('0x6d')](_0x253a66['body'],{'include':[{'model':db[_0x7bb3('0x7f')],'as':_0x7bb3('0x7f')}]});})[_0x7bb3('0x30')](function(_0x1c8a92){if(_0x253a66[_0x7bb3('0x61')][_0x7bb3('0x39')]===_0x7bb3('0x67'))return _0x1c8a92;var _0x22bbef=_0x253a66[_0x7bb3('0x67')]['get']({'plain':!![]});if(!_0x22bbef)throw new Error(_0x7bb3('0x80'));if(_0x22bbef[_0x7bb3('0x39')]===_0x7bb3('0x67')){var _0x35863f=_0x1c8a92[_0x7bb3('0x81')]({'plain':!![]});var _0x59deaf=[{'name':_0x7bb3('0x33'),'value':_0x7bb3('0x34')},{'name':_0x7bb3('0x35'),'value':_0x7bb3('0x65')}];var _0x49749f=_[_0x7bb3('0x3a')](_0x59deaf,['value',_0x35863f['role']])[_0x7bb3('0x3b')];return db[_0x7bb3('0x82')][_0x7bb3('0x3a')]({'where':{'name':_0x49749f,'userProfileId':_0x22bbef[_0x7bb3('0x83')]},'raw':!![]})['then'](function(_0x4a72de){if(_0x4a72de&&_0x4a72de[_0x7bb3('0x84')]===0x0){return db['UserProfileResource']['create']({'name':_0x35863f[_0x7bb3('0x3b')],'resourceId':_0x35863f['id'],'type':_0x4a72de[_0x7bb3('0x3b')],'sectionId':_0x4a72de['id']},{})[_0x7bb3('0x30')](function(){return _0x1c8a92;});}else{return _0x1c8a92;}})[_0x7bb3('0x24')](function(_0x12feda){logger['error'](_0x7bb3('0x85'),_0x12feda);throw _0x12feda;});}return _0x1c8a92;})[_0x7bb3('0x30')](respondWithResult(_0xf28bea,0xc9))[_0x7bb3('0x24')](handleError(_0xf28bea,null));};exports[_0x7bb3('0x86')]=function(_0x4e8508,_0xf6cb77,_0x3990f8){if(_0x4e8508[_0x7bb3('0x61')]['id']){delete _0x4e8508[_0x7bb3('0x61')]['id'];}return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x4e8508[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](function(_0x5e3ecd){if(_0x5e3ecd){if(_0x5e3ecd['id']==_0x4e8508[_0x7bb3('0x67')]['id']){if(!_0x4e8508[_0x7bb3('0x61')]['oldPassword']||!_0x4e8508['body'][_0x7bb3('0x87')]){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))](_0x7bb3('0x8a'));}if(!_0x5e3ecd[_0x7bb3('0x8b')](_0x4e8508[_0x7bb3('0x61')][_0x7bb3('0x8c')])){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))](_0x7bb3('0x8d'));}if(_0x4e8508[_0x7bb3('0x61')]['oldPassword']==_0x4e8508['body']['newPassword']){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))](_0x7bb3('0x8e'));}return _0x5e3ecd;}else if(_0x4e8508[_0x7bb3('0x67')][_0x7bb3('0x39')]==_0x7bb3('0x66')){if(!_0x4e8508[_0x7bb3('0x61')][_0x7bb3('0x87')]){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x5e3ecd;}else if(_0x4e8508[_0x7bb3('0x67')][_0x7bb3('0x39')]==_0x7bb3('0x67')){if(!_0x4e8508[_0x7bb3('0x61')][_0x7bb3('0x87')]){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))](_0x7bb3('0x8f'));}if(_0x5e3ecd[_0x7bb3('0x39')]!=_0x7bb3('0x34')){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))](_0x7bb3('0x90'));}return _0x5e3ecd;}else{throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))]('Unauthorized');}}return null;})[_0x7bb3('0x30')](handleEntityNotFound(_0xf6cb77,null))['then'](saveUpdates({'password':_0x4e8508[_0x7bb3('0x61')][_0x7bb3('0x87')],'passwordResetAt':_0x4e8508[_0x7bb3('0x67')]['id']==_0x4e8508[_0x7bb3('0x5f')]['id']?moment():null},null))[_0x7bb3('0x30')](respondWithResult(_0xf6cb77,null))[_0x7bb3('0x24')](handleError(_0xf6cb77,null));};exports['addQueues']=function(_0x8082f,_0x439c3a,_0x4075bb){var _0x14a1a9;return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x8082f[_0x7bb3('0x5f')]['id']},'attributes':['id','name',_0x7bb3('0x39'),_0x7bb3('0x91'),_0x7bb3('0x92'),_0x7bb3('0x93')]})['then'](handleEntityNotFound(_0x439c3a,null))[_0x7bb3('0x30')](function(_0x570e74){if(_0x570e74){_0x14a1a9=_0x570e74;if(!utils[_0x7bb3('0x94')](_0x8082f[_0x7bb3('0x61')][_0x7bb3('0x95')])){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))]('Unknown\x20channel');}return _0x570e74[_0x7bb3('0x53')+_[_0x7bb3('0x96')](_0x8082f[_0x7bb3('0x61')]['channel'][_0x7bb3('0x97')]())+_0x7bb3('0x98')](_0x8082f[_0x7bb3('0x61')][_0x7bb3('0x99')],{'penalty':_0x8082f['body']['penalty']||0x0});}})[_0x7bb3('0x9a')](function(_0x34d504){for(var _0x197b86=0x0;_0x197b86<_0x8082f[_0x7bb3('0x61')]['ids'][_0x7bb3('0x4a')];_0x197b86+=0x1){var _0x4e0d24={'UserId':_0x8082f[_0x7bb3('0x5f')]['id']};_0x4e0d24[_[_0x7bb3('0x96')](_0x8082f['body'][_0x7bb3('0x95')][_0x7bb3('0x97')]())+_0x7bb3('0x9b')]=_0x8082f[_0x7bb3('0x61')][_0x7bb3('0x99')][_0x197b86];socket[_0x7bb3('0x9c')](_0x7bb3('0x67')+_['capitalize'](_0x8082f[_0x7bb3('0x61')][_0x7bb3('0x95')][_0x7bb3('0x97')]())+_0x7bb3('0x9d'),_0x4e0d24);}return _0x34d504;})[_0x7bb3('0x30')](function(){if(_0x8082f[_0x7bb3('0x61')][_0x7bb3('0x95')]===_0x7bb3('0x9e')){return db[_0x7bb3('0x9f')][_0x7bb3('0xa0')]({'where':{'id':_0x8082f[_0x7bb3('0x61')][_0x7bb3('0x99')]||[]},'raw':!![],'attributes':['id',_0x7bb3('0x3b')]});}})[_0x7bb3('0x30')](function(_0x3ec5d3){var _0x67bb7c=[];if(_0x8082f['body'][_0x7bb3('0x95')]==='voice'&&_0x14a1a9['role']===_0x7bb3('0x34')){for(var _0x461637=0x0;_0x461637<_0x3ec5d3[_0x7bb3('0x4a')];_0x461637+=0x1){_0x67bb7c[_0x7bb3('0xa1')]({'membername':_0x14a1a9['name'],'UserId':_0x14a1a9['id'],'queue_name':_0x3ec5d3[_0x461637][_0x7bb3('0x3b')],'VoiceQueueId':_0x3ec5d3[_0x461637]['id'],'interface':_[_0x7bb3('0x6b')](_0x14a1a9[_0x7bb3('0x93')])?util[_0x7bb3('0xa2')]('SIP/%s',_0x14a1a9[_0x7bb3('0x3b')]):_0x14a1a9[_0x7bb3('0x93')],'paused':_0x14a1a9[_0x7bb3('0x92')]||![],'penalty':_0x8082f[_0x7bb3('0x61')][_0x7bb3('0xa3')]||0x0});}return BPromise[_0x7bb3('0xa4')](_0x67bb7c,function(_0x371006){return db['UserVoiceQueueRt']['upsert'](_0x371006);});}return _0x14a1a9;})[_0x7bb3('0x30')](respondWithStatusCode(_0x439c3a,null))['catch'](handleError(_0x439c3a,null));};exports['removeQueues']=function(_0x32262f,_0x2eac1a,_0x36a493){var _0x2dacad;return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x32262f[_0x7bb3('0x5f')]['id']},'attributes':['id',_0x7bb3('0x3b'),_0x7bb3('0x39')]})[_0x7bb3('0x30')](handleEntityNotFound(_0x2eac1a,null))[_0x7bb3('0x30')](function(_0x1d223d){if(_0x1d223d){_0x2dacad=_0x1d223d;if(!_0x32262f[_0x7bb3('0x44')][_0x7bb3('0x95')]||!utils[_0x7bb3('0x94')](_0x32262f[_0x7bb3('0x44')]['channel'])){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))]('Unknown\x20channel');}return _0x1d223d[_0x7bb3('0xa5')+_[_0x7bb3('0x96')](_0x32262f['query'][_0x7bb3('0x95')][_0x7bb3('0x97')]())+_0x7bb3('0x98')](_0x32262f[_0x7bb3('0x44')][_0x7bb3('0x99')]);}})[_0x7bb3('0x30')](function(_0x4ac53e){for(var _0x1502e4=0x0;_0x1502e4<_0x32262f[_0x7bb3('0x44')][_0x7bb3('0x99')]['length'];_0x1502e4+=0x1){var _0x47bbca={'UserId':_0x32262f['params']['id']};_0x47bbca[_[_0x7bb3('0x96')](_0x32262f[_0x7bb3('0x44')][_0x7bb3('0x95')]['toLowerCase']())+_0x7bb3('0x9b')]=_0x32262f['query'][_0x7bb3('0x99')][_0x1502e4];socket[_0x7bb3('0x9c')](_0x7bb3('0x67')+_[_0x7bb3('0x96')](_0x32262f[_0x7bb3('0x44')]['channel'][_0x7bb3('0x97')]())+_0x7bb3('0xa6'),_0x47bbca);}return _0x4ac53e;})[_0x7bb3('0x30')](function(){if(_0x32262f['query']['channel']===_0x7bb3('0x9e')){return db[_0x7bb3('0xa7')][_0x7bb3('0x31')]({'where':{'UserId':_0x32262f[_0x7bb3('0x5f')]['id'],'VoiceQueueId':_0x32262f[_0x7bb3('0x44')]['ids']},'individualHooks':!![]})['then'](function(){return _0x2dacad;});}return _0x2dacad;})['then'](respondWithStatusCode(_0x2eac1a,null))[_0x7bb3('0x24')](handleError(_0x2eac1a,null));};exports[_0x7bb3('0xa8')]=function(_0xa7cdba,_0x5f53e3,_0x51cdb9){_0xa7cdba[_0x7bb3('0x61')][_0x7bb3('0xa9')]=_0xa7cdba[_0x7bb3('0xaa')]['filename'];return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0xa7cdba[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5f53e3,null))[_0x7bb3('0x30')](saveUpdates(_0xa7cdba[_0x7bb3('0x61')],null))[_0x7bb3('0x30')](respondWithResult(_0x5f53e3,null))[_0x7bb3('0x24')](handleError(_0x5f53e3,null));};exports['getAvatar']=function(_0x6335f1,_0x2076dc,_0x56a251){var _0x55bcec=path[_0x7bb3('0xab')](config['root'],_0x7bb3('0xac'));return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x6335f1[_0x7bb3('0x5f')]['id']},'attributes':['id',_0x7bb3('0xa9')],'raw':!![]})[_0x7bb3('0x30')](handleEntityNotFound(_0x2076dc,null))[_0x7bb3('0x30')](function(_0x25b8ca){if(_0x25b8ca){if(_[_0x7bb3('0x6b')](_0x25b8ca[_0x7bb3('0xa9')])){return _0x2076dc['download'](_0x55bcec);}else{if(!fs[_0x7bb3('0xad')](path[_0x7bb3('0xab')](config[_0x7bb3('0xae')],_0x7bb3('0xaf'),_0x25b8ca[_0x7bb3('0xa9')]))){return _0x2076dc[_0x7bb3('0xb0')](_0x55bcec);}return _0x2076dc[_0x7bb3('0xb0')](path['join'](config[_0x7bb3('0xae')],_0x7bb3('0xaf'),_0x25b8ca['userpic']));}}})[_0x7bb3('0x24')](handleError(_0x2076dc,null));};exports[_0x7bb3('0xb1')]=function(_0x22d345,_0x27dc62,_0x289dbf){var _0x2cc5c7={};var _0x257220={};var _0x172baa;var _0x55b681;return db[_0x7bb3('0x3e')]['findOne']({'where':{'id':_0x22d345[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x27dc62,null))['then'](function(_0x42ec70){if(_0x42ec70){_0x172baa=_0x42ec70;_0x257220[_0x7bb3('0x40')]=_['keys'](db[_0x7bb3('0xb2')][_0x7bb3('0x3f')]);_0x257220[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x22d345[_0x7bb3('0x44')]);_0x257220[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x257220['model'],_0x257220[_0x7bb3('0x44')]);_0x2cc5c7[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x257220[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x22d345[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x2cc5c7[_0x7bb3('0x48')]=_0x2cc5c7['attributes'][_0x7bb3('0x4a')]?_0x2cc5c7[_0x7bb3('0x48')]:_0x257220[_0x7bb3('0x40')];_0x2cc5c7['order']=qs[_0x7bb3('0x50')](_0x22d345[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x2cc5c7[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x22d345['query'],_0x257220[_0x7bb3('0x46')]));if(_0x22d345[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x2cc5c7[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x2cc5c7[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x2cc5c7[_0x7bb3('0x48')],function(_0x1defb0){var _0x56f987={};_0x56f987[_0x1defb0]={'$like':'%'+_0x22d345[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x56f987;})});}_0x2cc5c7=_['merge']({},_0x2cc5c7,_0x22d345[_0x7bb3('0xb3')]);return _0x172baa[_0x7bb3('0xb1')](_0x2cc5c7);}})[_0x7bb3('0x30')](function(_0x4c4aac){if(_0x4c4aac){_0x55b681=_0x4c4aac[_0x7bb3('0x4a')];if(_0x22d345['query'][_0x7bb3('0x4b')]('includeAll')){_0x2cc5c7[_0x7bb3('0x5c')]=[{'model':db[_0x7bb3('0xb4')],'as':_0x7bb3('0xb5'),'required':![]},{'model':db[_0x7bb3('0xb6')],'as':_0x7bb3('0xb7'),'attributes':['id',_0x7bb3('0x3b'),_0x7bb3('0xb8')],'where':_0x22d345[_0x7bb3('0x44')][_0x7bb3('0xb9')]?{'id':_0x22d345[_0x7bb3('0x44')][_0x7bb3('0xb9')]}:undefined,'required':_0x22d345['query'][_0x7bb3('0xb9')]?!![]:![]}];}if(!_0x22d345[_0x7bb3('0x44')][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x2cc5c7[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x22d345[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x2cc5c7['offset']=qs[_0x7bb3('0x4e')](_0x22d345[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x172baa[_0x7bb3('0xb1')](_0x2cc5c7);}})[_0x7bb3('0x30')](function(_0x3c1d6d){if(_0x3c1d6d){return _0x3c1d6d?{'count':_0x55b681,'rows':_0x3c1d6d}:null;}})['then'](respondWithResult(_0x27dc62,null))[_0x7bb3('0x24')](handleError(_0x27dc62,null));};exports[_0x7bb3('0xba')]=function(_0x9bc9dc,_0x60d3a,_0x3e14f7){var _0x2ea72d;var _0x18bc17;var _0x238d95={};var _0x111822;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x9bc9dc[_0x7bb3('0x5f')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x60d3a,null))[_0x7bb3('0x30')](function(_0x4b0cb2){if(!utils[_0x7bb3('0x94')](_0x9bc9dc['query'][_0x7bb3('0x95')])){throw new db[(_0x7bb3('0x88'))]['ValidationError']('Unknown\x20channel');}_0x2ea72d=_0x4b0cb2;var _0x2de199={};_0x2de199[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db[_[_0x7bb3('0x96')](_0x9bc9dc[_0x7bb3('0x44')]['channel'])+_0x7bb3('0xbc')][_0x7bb3('0x3f')]);_0x2de199['query']=_[_0x7bb3('0x41')](_0x9bc9dc[_0x7bb3('0x44')]);_0x2de199[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x2de199['model'],_0x2de199[_0x7bb3('0x44')]);_0x238d95['attributes']=_['intersection'](_0x2de199[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x9bc9dc[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x238d95[_0x7bb3('0x48')]=_0x238d95[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x238d95[_0x7bb3('0x48')]:_0x2de199[_0x7bb3('0x40')];_0x238d95[_0x7bb3('0x4f')]=qs['sort'](_0x9bc9dc['query'][_0x7bb3('0x50')]);_0x238d95['where']=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x9bc9dc['query'],_0x2de199[_0x7bb3('0x46')]));if(_0x9bc9dc['query'][_0x7bb3('0x36')]){_0x238d95[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x238d95[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x238d95[_0x7bb3('0x48')],function(_0x4305c4){var _0x70dab9={};_0x70dab9[_0x4305c4]={'$like':'%'+_0x9bc9dc[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x70dab9;})});}_0x238d95=_[_0x7bb3('0x55')]({},_0x238d95,_0x9bc9dc[_0x7bb3('0xb3')]);switch(_0x2ea72d['role']){case _0x7bb3('0x66'):return db[_['capitalize'](_0x9bc9dc[_0x7bb3('0x44')][_0x7bb3('0x95')])+_0x7bb3('0xbc')]['findAll'](_0x238d95);case _0x7bb3('0x67'):case _0x7bb3('0x34'):return _0x2ea72d[_0x7bb3('0x81')+_[_0x7bb3('0x96')](_0x9bc9dc[_0x7bb3('0x44')][_0x7bb3('0x95')])+_0x7bb3('0x98')](_0x238d95);default:throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))](_0x7bb3('0xbd'));}})[_0x7bb3('0x30')](function(_0x2a380a){_0x111822=_0x2a380a[_0x7bb3('0x4a')];if(!_0x9bc9dc[_0x7bb3('0x44')]['hasOwnProperty'](_0x7bb3('0x4c'))){_0x238d95['limit']=qs['limit'](_0x9bc9dc[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x238d95['offset']=qs[_0x7bb3('0x4e')](_0x9bc9dc[_0x7bb3('0x44')]['offset']);}switch(_0x2ea72d['role']){case _0x7bb3('0x66'):return db[_[_0x7bb3('0x96')](_0x9bc9dc[_0x7bb3('0x44')][_0x7bb3('0x95')])+_0x7bb3('0xbc')]['findAll'](_0x238d95);case _0x7bb3('0x67'):case _0x7bb3('0x34'):return _0x2ea72d[_0x7bb3('0x81')+_[_0x7bb3('0x96')](_0x9bc9dc['query'][_0x7bb3('0x95')])+_0x7bb3('0x98')](_0x238d95);}})[_0x7bb3('0x30')](function(_0x40ec9d){return{'count':_0x111822,'rows':_0x40ec9d};})['then'](respondWithResult(_0x60d3a,null))[_0x7bb3('0x24')](handleError(_0x60d3a,null));};exports[_0x7bb3('0xbe')]=function(_0x228932,_0x310dce,_0x59a5f4){var _0x1fb7cf={};var _0x27c664={};var _0x35a535;var _0x2e32d8;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x228932['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x310dce,null))[_0x7bb3('0x30')](function(_0x5b51ac){if(_0x5b51ac){_0x35a535=_0x5b51ac;_0x27c664[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db[_0x7bb3('0xa7')][_0x7bb3('0x3f')]);_0x27c664[_0x7bb3('0x44')]=_['keys'](_0x228932['query']);_0x27c664[_0x7bb3('0x46')]=_['intersection'](_0x27c664['model'],_0x27c664[_0x7bb3('0x44')]);_0x1fb7cf['attributes']=_[_0x7bb3('0x47')](_0x27c664[_0x7bb3('0x40')],qs['fields'](_0x228932[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x1fb7cf[_0x7bb3('0x48')]=_0x1fb7cf[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x1fb7cf[_0x7bb3('0x48')]:_0x27c664[_0x7bb3('0x40')];_0x1fb7cf[_0x7bb3('0x4f')]=qs['sort'](_0x228932[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x1fb7cf['where']=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x228932[_0x7bb3('0x44')],_0x27c664[_0x7bb3('0x46')]));if(_0x228932[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x1fb7cf['where']=_['merge'](_0x1fb7cf[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x1fb7cf[_0x7bb3('0x48')],function(_0x3ceec7){var _0x2b47dd={};_0x2b47dd[_0x3ceec7]={'$like':'%'+_0x228932[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x2b47dd;})});}_0x1fb7cf=_[_0x7bb3('0x55')]({},_0x1fb7cf,_0x228932[_0x7bb3('0xb3')]);return _0x35a535['getVoiceQueuesRt'](_0x1fb7cf);}})[_0x7bb3('0x30')](function(_0x553746){if(_0x553746){_0x2e32d8=_0x553746['length'];if(!_0x228932['query'][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x1fb7cf[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x228932[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x1fb7cf['offset']=qs[_0x7bb3('0x4e')](_0x228932[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x35a535['getVoiceQueuesRt'](_0x1fb7cf);}})[_0x7bb3('0x30')](function(_0x55322f){if(_0x55322f){return _0x55322f?{'count':_0x2e32d8,'rows':_0x55322f}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x310dce,null))[_0x7bb3('0x24')](handleError(_0x310dce,null));};exports[_0x7bb3('0xbf')]=function(_0x254fb6,_0x11b898,_0x22b2ac){var _0x7a7528={};var _0x5e82e3={};var _0x1b021c;var _0x5ee1bc;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x254fb6['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x11b898,null))[_0x7bb3('0x30')](function(_0x18a91e){if(_0x18a91e){_0x1b021c=_0x18a91e;_0x5e82e3[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db['ChatGroup'][_0x7bb3('0x3f')]);_0x5e82e3[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x254fb6[_0x7bb3('0x44')]);_0x5e82e3[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x5e82e3[_0x7bb3('0x40')],_0x5e82e3[_0x7bb3('0x44')]);_0x7a7528[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x5e82e3[_0x7bb3('0x40')],qs['fields'](_0x254fb6[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x7a7528[_0x7bb3('0x48')]=_0x7a7528['attributes'][_0x7bb3('0x4a')]?_0x7a7528[_0x7bb3('0x48')]:_0x5e82e3[_0x7bb3('0x40')];_0x7a7528[_0x7bb3('0x4f')]=qs['sort'](_0x254fb6[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x7a7528['where']=qs[_0x7bb3('0x46')](_['pick'](_0x254fb6[_0x7bb3('0x44')],_0x5e82e3[_0x7bb3('0x46')]));if(_0x254fb6['query'][_0x7bb3('0x36')]){_0x7a7528['where']=_[_0x7bb3('0x55')](_0x7a7528['where'],{'$or':_[_0x7bb3('0x56')](_0x7a7528[_0x7bb3('0x48')],function(_0x2faf4f){var _0x1c59b1={};_0x1c59b1[_0x2faf4f]={'$like':'%'+_0x254fb6[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x1c59b1;})});}_0x7a7528=_[_0x7bb3('0x55')]({},_0x7a7528,_0x254fb6['options']);return _0x1b021c[_0x7bb3('0xbf')](_0x7a7528);}})['then'](function(_0x4146b8){if(_0x4146b8){_0x5ee1bc=_0x4146b8['length'];if(!_0x254fb6[_0x7bb3('0x44')][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x7a7528[_0x7bb3('0x4d')]=qs['limit'](_0x254fb6[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x7a7528[_0x7bb3('0x4e')]=qs['offset'](_0x254fb6[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x1b021c['getGroups'](_0x7a7528);}})['then'](function(_0x52af78){if(_0x52af78){return _0x52af78?{'count':_0x5ee1bc,'rows':_0x52af78}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x11b898,null))[_0x7bb3('0x24')](handleError(_0x11b898,null));};exports[_0x7bb3('0xc0')]=function(_0x2866b3,_0x22147c,_0x37e361){var _0x497b5f={'raw':!![],'where':{}};var _0x492159={};var _0x1f9e48={'count':0x0,'rows':[]};return db['User'][_0x7bb3('0xbb')]({'where':{'id':_0x2866b3[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x22147c,null))[_0x7bb3('0x30')](function(_0x15cc28){if(_0x15cc28){_0x492159[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db['VoiceRecording']['rawAttributes']);_0x492159[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x2866b3['query']);_0x492159['filters']=_[_0x7bb3('0x47')](_0x492159[_0x7bb3('0x40')],_0x492159[_0x7bb3('0x44')]);_0x497b5f[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x492159[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x2866b3[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x497b5f[_0x7bb3('0x48')]=_0x497b5f['attributes']['length']?_0x497b5f[_0x7bb3('0x48')]:_0x492159['model'];if(!_0x2866b3['query'][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x497b5f[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x2866b3[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x497b5f[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x2866b3['query']['offset']);}_0x497b5f[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x2866b3[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x497b5f[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_['pick'](_0x2866b3[_0x7bb3('0x44')],_0x492159[_0x7bb3('0x46')]));_0x497b5f[_0x7bb3('0x51')][_0x7bb3('0xc1')]=_0x15cc28['id'];if(_0x2866b3[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x497b5f[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x497b5f[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x497b5f['attributes'],function(_0x19ce9c){var _0x247b2c={};_0x247b2c[_0x19ce9c]={'$like':'%'+_0x2866b3[_0x7bb3('0x44')]['filter']+'%'};return _0x247b2c;})});}_0x497b5f=_['merge']({},_0x497b5f,_0x2866b3['options']);return db[_0x7bb3('0xc2')]['count']({'where':_0x497b5f['where']})[_0x7bb3('0x30')](function(_0x384a02){_0x1f9e48[_0x7bb3('0x29')]=_0x384a02;if(_0x2866b3[_0x7bb3('0x44')]['includeAll']){_0x497b5f[_0x7bb3('0x5c')]=[{'all':!![]}];}return db[_0x7bb3('0xc2')][_0x7bb3('0xa0')](_0x497b5f);})[_0x7bb3('0x30')](function(_0x5a9f83){_0x1f9e48['rows']=_0x5a9f83;return _0x1f9e48;});}})[_0x7bb3('0x30')](respondWithFilteredResult(_0x22147c,_0x497b5f))['catch'](handleError(_0x22147c,null));};exports[_0x7bb3('0xc3')]=function(_0xe0899d,_0x5aeaf4,_0x1bf65f){var _0xb8c7bc={};var _0x35b1a4={};var _0x174b5f;var _0x17d978;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0xe0899d[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x5aeaf4,null))['then'](function(_0xe672a8){if(_0xe672a8){_0x174b5f=_0xe672a8;_0x35b1a4['model']=_[_0x7bb3('0x41')](db['ChatInteraction'][_0x7bb3('0x3f')]);_0x35b1a4[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0xe0899d[_0x7bb3('0x44')]);_0x35b1a4[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x35b1a4[_0x7bb3('0x40')],_0x35b1a4[_0x7bb3('0x44')]);_0xb8c7bc[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x35b1a4[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0xe0899d['query']['fields']));_0xb8c7bc['attributes']=_0xb8c7bc[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0xb8c7bc[_0x7bb3('0x48')]:_0x35b1a4[_0x7bb3('0x40')];_0xb8c7bc['order']=qs[_0x7bb3('0x50')](_0xe0899d[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0xb8c7bc[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0xe0899d['query'],_0x35b1a4['filters']));if(_0xe0899d[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0xb8c7bc[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0xb8c7bc[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0xb8c7bc['attributes'],function(_0x41d21a){var _0x105794={};_0x105794[_0x41d21a]={'$like':'%'+_0xe0899d[_0x7bb3('0x44')]['filter']+'%'};return _0x105794;})});}_0xb8c7bc=_[_0x7bb3('0x55')]({},_0xb8c7bc,_0xe0899d[_0x7bb3('0xb3')]);return _0x174b5f[_0x7bb3('0xc3')](_0xb8c7bc);}})[_0x7bb3('0x30')](function(_0x32d7f1){if(_0x32d7f1){_0x17d978=_0x32d7f1['length'];if(!_0xe0899d['query']['hasOwnProperty'](_0x7bb3('0x4c'))){_0xb8c7bc[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0xe0899d[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0xb8c7bc[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0xe0899d[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x174b5f[_0x7bb3('0xc3')](_0xb8c7bc);}})[_0x7bb3('0x30')](function(_0xac2b3){if(_0xac2b3){return _0xac2b3?{'count':_0x17d978,'rows':_0xac2b3}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x5aeaf4,null))[_0x7bb3('0x24')](handleError(_0x5aeaf4,null));};exports['getOpenchannelInteractions']=function(_0x2d582f,_0x177574,_0x3432a6){var _0x5bed27={};var _0x181df5={};var _0x4fe750;var _0x212265;return db['User'][_0x7bb3('0xbb')]({'where':{'id':_0x2d582f['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x177574,null))[_0x7bb3('0x30')](function(_0x4c1c9b){if(_0x4c1c9b){_0x4fe750=_0x4c1c9b;_0x181df5[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db[_0x7bb3('0xc4')][_0x7bb3('0x3f')]);_0x181df5[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x2d582f[_0x7bb3('0x44')]);_0x181df5[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x181df5[_0x7bb3('0x40')],_0x181df5['query']);_0x5bed27[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x181df5[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x2d582f['query'][_0x7bb3('0x49')]));_0x5bed27['attributes']=_0x5bed27[_0x7bb3('0x48')]['length']?_0x5bed27[_0x7bb3('0x48')]:_0x181df5['model'];_0x5bed27[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x2d582f[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x5bed27[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x2d582f[_0x7bb3('0x44')],_0x181df5[_0x7bb3('0x46')]));if(_0x2d582f[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x5bed27['where']=_[_0x7bb3('0x55')](_0x5bed27[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x5bed27[_0x7bb3('0x48')],function(_0x2521a3){var _0x313dc1={};_0x313dc1[_0x2521a3]={'$like':'%'+_0x2d582f[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x313dc1;})});}_0x5bed27=_[_0x7bb3('0x55')]({},_0x5bed27,_0x2d582f[_0x7bb3('0xb3')]);return _0x4fe750[_0x7bb3('0xc5')](_0x5bed27);}})['then'](function(_0x4a850e){if(_0x4a850e){_0x212265=_0x4a850e[_0x7bb3('0x4a')];if(!_0x2d582f[_0x7bb3('0x44')][_0x7bb3('0x4b')]('nolimit')){_0x5bed27['limit']=qs[_0x7bb3('0x4d')](_0x2d582f['query'][_0x7bb3('0x4d')]);_0x5bed27[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x2d582f['query'][_0x7bb3('0x4e')]);}return _0x4fe750[_0x7bb3('0xc5')](_0x5bed27);}})['then'](function(_0x294e33){if(_0x294e33){return _0x294e33?{'count':_0x212265,'rows':_0x294e33}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x177574,null))[_0x7bb3('0x24')](handleError(_0x177574,null));};exports['getMailInteractions']=function(_0x57040c,_0x5efa30,_0x1d2ef5){var _0x25f000={'raw':!![],'where':{}};var _0x2d37e7={};var _0x3e4790={'count':0x0,'rows':[]};return db[_0x7bb3('0x3e')]['findOne']({'where':{'id':_0x57040c[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x5efa30,null))['then'](function(_0x247292){if(_0x247292){_0x2d37e7[_0x7bb3('0x40')]=_['keys'](db[_0x7bb3('0xc6')][_0x7bb3('0x3f')]);_0x2d37e7[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x57040c[_0x7bb3('0x44')]);_0x2d37e7[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x2d37e7[_0x7bb3('0x40')],_0x2d37e7['query']);_0x25f000['attributes']=_[_0x7bb3('0x47')](_0x2d37e7['model'],qs[_0x7bb3('0x49')](_0x57040c[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x25f000[_0x7bb3('0x48')]=_0x25f000[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x25f000['attributes']:_0x2d37e7['model'];if(!_0x57040c[_0x7bb3('0x44')]['hasOwnProperty']('nolimit')){_0x25f000['limit']=qs['limit'](_0x57040c[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x25f000[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x57040c[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}_0x25f000[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x57040c[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x25f000[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x57040c['query'],_0x2d37e7['filters']));_0x25f000[_0x7bb3('0x51')][_0x7bb3('0xc1')]=_0x247292['id'];if(_0x57040c['query'][_0x7bb3('0x36')]){_0x25f000['where']=_['merge'](_0x25f000['where'],{'$or':_[_0x7bb3('0x56')](_0x25f000[_0x7bb3('0x48')],function(_0x4a5230){var _0x2c8f8a={};_0x2c8f8a[_0x4a5230]={'$like':'%'+_0x57040c[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x2c8f8a;})});}_0x25f000=_['merge']({},_0x25f000,_0x57040c[_0x7bb3('0xb3')]);return db[_0x7bb3('0xc6')]['count']({'where':_0x25f000[_0x7bb3('0x51')]})[_0x7bb3('0x30')](function(_0x3ac20d){_0x3e4790[_0x7bb3('0x29')]=_0x3ac20d;if(_0x57040c[_0x7bb3('0x44')]['includeAll']){_0x25f000[_0x7bb3('0x5c')]=[{'all':!![]}];}return db[_0x7bb3('0xc6')][_0x7bb3('0xa0')](_0x25f000);})['then'](function(_0x17f67f){_0x3e4790[_0x7bb3('0x5d')]=_0x17f67f;return _0x3e4790;});}})['then'](respondWithFilteredResult(_0x5efa30,_0x25f000))['catch'](handleError(_0x5efa30,null));};exports[_0x7bb3('0xc7')]=function(_0x1d7e70,_0x2a2718,_0x31460b){var _0x50a0f3={};var _0x3975e9={};var _0x39368b;var _0xed03ea;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x1d7e70['params']['id']}})['then'](handleEntityNotFound(_0x2a2718,null))['then'](function(_0x4732d9){if(_0x4732d9){_0x39368b=_0x4732d9;_0x3975e9[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db[_0x7bb3('0xc8')]['rawAttributes']);_0x3975e9['query']=_['keys'](_0x1d7e70[_0x7bb3('0x44')]);_0x3975e9[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x3975e9[_0x7bb3('0x40')],_0x3975e9[_0x7bb3('0x44')]);_0x50a0f3[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x3975e9[_0x7bb3('0x40')],qs['fields'](_0x1d7e70['query'][_0x7bb3('0x49')]));_0x50a0f3[_0x7bb3('0x48')]=_0x50a0f3[_0x7bb3('0x48')]['length']?_0x50a0f3[_0x7bb3('0x48')]:_0x3975e9[_0x7bb3('0x40')];_0x50a0f3[_0x7bb3('0x4f')]=qs['sort'](_0x1d7e70[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x50a0f3[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x1d7e70['query'],_0x3975e9[_0x7bb3('0x46')]));if(_0x1d7e70[_0x7bb3('0x44')]['filter']){_0x50a0f3[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x50a0f3[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x50a0f3[_0x7bb3('0x48')],function(_0x30305c){var _0x32d340={};_0x32d340[_0x30305c]={'$like':'%'+_0x1d7e70[_0x7bb3('0x44')]['filter']+'%'};return _0x32d340;})});}_0x50a0f3=_[_0x7bb3('0x55')]({},_0x50a0f3,_0x1d7e70[_0x7bb3('0xb3')]);return _0x39368b[_0x7bb3('0xc7')](_0x50a0f3);}})[_0x7bb3('0x30')](function(_0x3d6ad5){if(_0x3d6ad5){_0xed03ea=_0x3d6ad5[_0x7bb3('0x4a')];if(!_0x1d7e70[_0x7bb3('0x44')]['hasOwnProperty'](_0x7bb3('0x4c'))){_0x50a0f3['limit']=qs[_0x7bb3('0x4d')](_0x1d7e70[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x50a0f3[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x1d7e70[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x39368b['getSmsInteractions'](_0x50a0f3);}})[_0x7bb3('0x30')](function(_0x1883a8){if(_0x1883a8){return _0x1883a8?{'count':_0xed03ea,'rows':_0x1883a8}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x2a2718,null))[_0x7bb3('0x24')](handleError(_0x2a2718,null));};exports['getFaxInteractions']=function(_0x4793c7,_0x440d07,_0x10df4d){var _0x288cd0={};var _0x36ed40={};var _0x3b0c2a;var _0x40e04e;return db['User'][_0x7bb3('0xbb')]({'where':{'id':_0x4793c7[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x440d07,null))[_0x7bb3('0x30')](function(_0x12a33b){if(_0x12a33b){_0x3b0c2a=_0x12a33b;_0x36ed40[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db[_0x7bb3('0xc9')][_0x7bb3('0x3f')]);_0x36ed40[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x4793c7[_0x7bb3('0x44')]);_0x36ed40[_0x7bb3('0x46')]=_['intersection'](_0x36ed40['model'],_0x36ed40['query']);_0x288cd0[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x36ed40[_0x7bb3('0x40')],qs['fields'](_0x4793c7[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x288cd0[_0x7bb3('0x48')]=_0x288cd0['attributes']['length']?_0x288cd0[_0x7bb3('0x48')]:_0x36ed40['model'];_0x288cd0[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x4793c7[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x288cd0[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x4793c7['query'],_0x36ed40[_0x7bb3('0x46')]));if(_0x4793c7['query'][_0x7bb3('0x36')]){_0x288cd0['where']=_[_0x7bb3('0x55')](_0x288cd0[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x288cd0[_0x7bb3('0x48')],function(_0x36b628){var _0x17e0af={};_0x17e0af[_0x36b628]={'$like':'%'+_0x4793c7[_0x7bb3('0x44')]['filter']+'%'};return _0x17e0af;})});}_0x288cd0=_[_0x7bb3('0x55')]({},_0x288cd0,_0x4793c7[_0x7bb3('0xb3')]);return _0x3b0c2a['getFaxInteractions'](_0x288cd0);}})[_0x7bb3('0x30')](function(_0x3bf817){if(_0x3bf817){_0x40e04e=_0x3bf817[_0x7bb3('0x4a')];if(!_0x4793c7['query'][_0x7bb3('0x4b')]('nolimit')){_0x288cd0[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x4793c7[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x288cd0[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x4793c7['query'][_0x7bb3('0x4e')]);}return _0x3b0c2a[_0x7bb3('0xca')](_0x288cd0);}})['then'](function(_0xf35bb5){if(_0xf35bb5){return _0xf35bb5?{'count':_0x40e04e,'rows':_0xf35bb5}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x440d07,null))[_0x7bb3('0x24')](handleError(_0x440d07,null));};exports[_0x7bb3('0xcb')]=function(_0x5750f4,_0x38bf35,_0x250141){var _0x2b215a;var _0x53025a;var _0x6b68d8;return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x5750f4[_0x7bb3('0x5f')]['id'],'role':_0x7bb3('0x34')},'attributes':['id','name',_0x7bb3('0xcc'),_0x7bb3('0xcd'),_0x7bb3('0x39'),_0x7bb3('0x6e'),_0x7bb3('0x91')]})['then'](handleEntityNotFound(_0x38bf35,null))[_0x7bb3('0x30')](function(_0x5b2e00){if(_0x5b2e00){_0x2b215a=_0x5b2e00;if(_0x5750f4[_0x7bb3('0x61')]['interface']){_0x6b68d8=util[_0x7bb3('0xa2')](_0x7bb3('0xce'),_0x2b215a[_0x5750f4['body'][_0x7bb3('0x93')]]);}else if(_0x5750f4[_0x7bb3('0x61')][_0x7bb3('0xcf')]){_0x6b68d8=util[_0x7bb3('0xa2')](_0x7bb3('0xd0'),_0x5750f4[_0x7bb3('0x61')]['intrf']);}else{_0x6b68d8=util[_0x7bb3('0xa2')]('SIP/%s',_0x2b215a['name']);}socket['to'](util[_0x7bb3('0xa2')]('user:%s',_0x2b215a['name']))['emit']('user:forcelogout',{'ip':_0x5750f4[_0x7bb3('0xd1')]['x-forwarded-for']||_0x5750f4[_0x7bb3('0xd2')]['remoteAddress']||_0x5750f4[_0x7bb3('0xd3')]['remoteAddress']||_0x5750f4[_0x7bb3('0xd2')][_0x7bb3('0xd3')][_0x7bb3('0xd4')]});return db[_0x7bb3('0xa7')][_0x7bb3('0x31')]({'where':{'membername':_0x2b215a[_0x7bb3('0x3b')]},'individualHooks':!![]});}})['then'](function(_0x465bb){if(_0x2b215a){return _0x2b215a[_0x7bb3('0xd5')]({'raw':!![]});}})[_0x7bb3('0x30')](function(_0x3ee5a4){var _0x17d8b6=[];if(_0x3ee5a4){_0x53025a=_0x3ee5a4;if(_0x53025a[_0x7bb3('0x4a')]){for(var _0x2e81c4=0x0;_0x2e81c4<_0x53025a[_0x7bb3('0x4a')];_0x2e81c4++){_0x17d8b6[_0x7bb3('0xa1')]({'membername':_0x2b215a[_0x7bb3('0x3b')],'UserId':_0x2b215a['id'],'queue_name':_0x53025a[_0x2e81c4][_0x7bb3('0x3b')],'VoiceQueueId':_0x53025a[_0x2e81c4]['id'],'interface':_0x6b68d8,'paused':_0x2b215a['loginInPause']||![],'penalty':_0x53025a[_0x2e81c4][_0x7bb3('0xd6')]||0x0});}return BPromise[_0x7bb3('0xa4')](_0x17d8b6,function(_0x758027){return db[_0x7bb3('0xa7')]['upsert'](_0x758027);});}}})[_0x7bb3('0x30')](function(){return db[_0x7bb3('0xd7')][_0x7bb3('0xa0')]({'where':{'membername':_0x2b215a[_0x7bb3('0x3b')],'exitAt':null}});})[_0x7bb3('0x30')](function(_0x41e2e2){var _0x48e52e=[];_0x41e2e2[_0x7bb3('0xd8')](function(_0x188bd6){_0x48e52e[_0x7bb3('0xa1')](_0x188bd6['update']({'exitAt':moment()['format'](_0x7bb3('0xd9'))}));});return BPromise['all'](_0x48e52e);})[_0x7bb3('0x30')](function(){var _0x3dcf20=[];var _0x549e2d=[];var _0x45c733=utils['getChannels']();var _0x1e0913={'membername':_0x2b215a['name'],'interface':_0x6b68d8,'enterAt':moment()[_0x7bb3('0xa2')](_0x7bb3('0xd9')),'role':_0x2b215a[_0x7bb3('0x39')],'internal':_0x2b215a[_0x7bb3('0x6e')]};_0x45c733[_0x7bb3('0xd8')](function(_0x30c544){_0x3dcf20['push'](_[_0x7bb3('0x55')]({'channel':_0x30c544,'type':_0x7bb3('0xda'),'data1':_0x5750f4[_0x7bb3('0x61')][_0x7bb3('0xdb')],'data2':_0x6b68d8},_0x1e0913));if(_0x2b215a['loginInPause']){_0x549e2d[_0x7bb3('0xa1')](_[_0x7bb3('0x55')]({'channel':_0x30c544,'type':_0x7bb3('0xdc'),'data1':_0x7bb3('0xdd')},_0x1e0913));}});return db['MemberReport']['bulkCreate'](_0x3dcf20[_0x7bb3('0xde')](_0x549e2d),{'individualHooks':!![]});})[_0x7bb3('0x30')](function(){return _0x2b215a[_0x7bb3('0x2f')]({'online':!![],'lastLoginAt':moment()[_0x7bb3('0xa2')](_0x7bb3('0xd9')),'voicePause':_0x2b215a[_0x7bb3('0x91')]||![],'mailPause':_0x2b215a[_0x7bb3('0x91')]||![],'chatPause':_0x2b215a['loginInPause']||![],'faxPause':_0x2b215a[_0x7bb3('0x91')]||![],'smsPause':_0x2b215a[_0x7bb3('0x91')]||![],'openchannelPause':_0x2b215a[_0x7bb3('0x91')]||![],'pauseType':_0x2b215a[_0x7bb3('0x91')]?'LOGININPAUSE':null,'interface':_0x6b68d8,'lastPauseAt':moment()[_0x7bb3('0xa2')](_0x7bb3('0xd9'))});})[_0x7bb3('0x30')](respondWithResult(_0x38bf35,null))[_0x7bb3('0x24')](handleError(_0x38bf35,null));};exports[_0x7bb3('0xdf')]=function(_0x3c6a42,_0x29d967,_0x3aaf72){var _0x782030;return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x3c6a42[_0x7bb3('0x5f')]['id'],'role':_0x7bb3('0x34')},'attributes':['id','name','role']})[_0x7bb3('0x30')](handleEntityNotFound(_0x29d967,null))[_0x7bb3('0x30')](function(_0x1d086a){if(_0x1d086a){_0x782030=_0x1d086a;return db[_0x7bb3('0xa7')]['destroy']({'where':{'membername':_0x782030[_0x7bb3('0x3b')]},'individualHooks':!![]});}})[_0x7bb3('0x30')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x782030['name'],'exitAt':null}});})[_0x7bb3('0x30')](function(_0x2e1206){var _0x3f5cf1=[];_0x2e1206['forEach'](function(_0x3c0dca){_0x3f5cf1['push'](_0x3c0dca[_0x7bb3('0x2f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7bb3('0xe0')](_0x3f5cf1);})[_0x7bb3('0x30')](function(){return _0x782030[_0x7bb3('0x2f')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x29d967,null))[_0x7bb3('0x24')](handleError(_0x29d967,null));};exports[_0x7bb3('0xe1')]=function(_0x55eeee,_0x4227ec,_0x3d3ec2){var _0x9446fc;return db[_0x7bb3('0xa7')][_0x7bb3('0x2f')]({'paused':0x1},{'where':{'UserId':_0x55eeee[_0x7bb3('0x5f')]['id']},'individualHooks':!![]})[_0x7bb3('0x30')](function(){return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x55eeee['params']['id'],'role':_0x7bb3('0x34')},'attributes':['id',_0x7bb3('0x3b'),_0x7bb3('0x39'),_0x7bb3('0x6e'),_0x7bb3('0x93')]});})['then'](handleEntityNotFound(_0x4227ec,null))[_0x7bb3('0x30')](function(_0x219cd8){if(_0x219cd8){_0x9446fc=_0x219cd8;return respondWithRpcPromise(_0x7bb3('0xe2'),'pause',{'id':_0x9446fc['id'],'name':_0x9446fc[_0x7bb3('0x3b')],'pause':!![]});}})[_0x7bb3('0x30')](function(){if(_0x9446fc){return db[_0x7bb3('0xd7')][_0x7bb3('0xa0')]({'where':{'membername':_0x9446fc[_0x7bb3('0x3b')],'type':_0x7bb3('0xdc'),'exitAt':null}});}})['then'](function(_0x172e3b){if(_0x172e3b[_0x7bb3('0x4a')]){var _0x51aa16=moment()[_0x7bb3('0xa2')](_0x7bb3('0xd9'));for(var _0x16b35f=0x0,_0x2da5e1=_0x172e3b['length'];_0x16b35f<_0x2da5e1;_0x16b35f++){_0x172e3b[_0x16b35f][_0x7bb3('0xe3')]({'exitAt':_0x51aa16});}}})['then'](function(){var _0x3d758f=[];var _0x223650=utils[_0x7bb3('0xe4')]();_0x223650[_0x7bb3('0xd8')](function(_0x811d0b){_0x3d758f[_0x7bb3('0xa1')]({'channel':_0x811d0b,'membername':_0x9446fc[_0x7bb3('0x3b')],'interface':_[_0x7bb3('0x6b')](_0x9446fc[_0x7bb3('0x93')])?util[_0x7bb3('0xa2')](_0x7bb3('0xd0'),_0x9446fc['name']):_0x9446fc[_0x7bb3('0x93')],'type':_0x7bb3('0xdc'),'enterAt':moment()[_0x7bb3('0xa2')](_0x7bb3('0xd9')),'data1':_0x55eeee[_0x7bb3('0x61')][_0x7bb3('0xe5')]||'DEFAULT\x20PAUSE','role':_0x9446fc[_0x7bb3('0x39')],'internal':_0x9446fc[_0x7bb3('0x6e')]});});return db[_0x7bb3('0xd7')][_0x7bb3('0x60')](_0x3d758f,{'individualHooks':!![]});})['then'](function(){return _0x9446fc[_0x7bb3('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x55eeee[_0x7bb3('0x61')][_0x7bb3('0xe5')]||_0x7bb3('0xe6'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7bb3('0x30')](respondWithResult(_0x4227ec,null))[_0x7bb3('0x24')](handleError(_0x4227ec,null));};exports[_0x7bb3('0xe7')]=function(_0xc456f5,_0x5464b5,_0xafa559){var _0x19f00f;return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0xc456f5[_0x7bb3('0x5f')]['id']},'attributes':['id',_0x7bb3('0x3b'),'role',_0x7bb3('0x92'),_0x7bb3('0xe8'),_0x7bb3('0xe9'),_0x7bb3('0xea'),_0x7bb3('0xeb'),_0x7bb3('0xec'),_0x7bb3('0xed'),_0x7bb3('0xee')]})[_0x7bb3('0x30')](handleEntityNotFound(_0x5464b5,null))['then'](function(_0x4a777f){if(_0x4a777f){_0x19f00f=_0x4a777f;if(_0xc456f5[_0x7bb3('0x61')][_0x7bb3('0x95')]&&!utils['isValidChannel'](_0xc456f5[_0x7bb3('0x61')]['channel'])){throw new db[(_0x7bb3('0x88'))][(_0x7bb3('0x89'))]('Unknown\x20channel');}switch(_0xc456f5[_0x7bb3('0x61')][_0x7bb3('0x95')]){case _0x7bb3('0x9e'):return respondWithRpcPromise('QueuePause',_0x7bb3('0xe7'),{'id':_0x19f00f['id'],'name':_0x19f00f[_0x7bb3('0x3b')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x19f00f['id']},'individualHooks':!![]});})['then'](function(){return db[_0x7bb3('0xd7')][_0x7bb3('0x3a')]({'where':{'channel':_0xc456f5[_0x7bb3('0x61')][_0x7bb3('0x95')],'membername':_0x19f00f[_0x7bb3('0x3b')],'type':_0x7bb3('0xdc'),'exitAt':null}});})['then'](function(_0x2710fb){if(_0x2710fb){return _0x2710fb[_0x7bb3('0x2f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x7bb3('0x30')](function(){return _0x19f00f['update']({'voicePause':![]});});case _0x7bb3('0xef'):case _0x7bb3('0xf0'):case _0x7bb3('0xf1'):case _0x7bb3('0xf2'):case _0x7bb3('0xf3'):return db[_0x7bb3('0xd7')][_0x7bb3('0x3a')]({'where':{'channel':_0xc456f5[_0x7bb3('0x61')][_0x7bb3('0x95')],'membername':_0x19f00f[_0x7bb3('0x3b')],'type':_0x7bb3('0xdc'),'exitAt':null}})[_0x7bb3('0x30')](function(_0x1ee40b){if(_0x1ee40b){return _0x1ee40b['update']({'exitAt':moment()[_0x7bb3('0xa2')](_0x7bb3('0xd9')),'data2':_0x7bb3('0xf4')},{'individualHooks':!![]});}return null;})[_0x7bb3('0x30')](function(){var _0xd87633={};_[_0x7bb3('0xf5')](_0xd87633,util['format'](_0x7bb3('0xf6'),_0xc456f5['body'][_0x7bb3('0x95')],_0x7bb3('0xf7')),![]);return _0x19f00f[_0x7bb3('0x2f')](_0xd87633);});default:return respondWithRpcPromise('QueuePause','unpause',{'id':_0x19f00f['id'],'name':_0x19f00f[_0x7bb3('0x3b')],'pause':![]})[_0x7bb3('0x30')](function(){return db[_0x7bb3('0xa7')]['update']({'paused':0x0},{'where':{'UserId':_0x19f00f['id']}});})[_0x7bb3('0x30')](function(){return db[_0x7bb3('0xd7')][_0x7bb3('0xa0')]({'where':{'membername':_0x19f00f[_0x7bb3('0x3b')],'type':_0x7bb3('0xdc'),'exitAt':null}});})['then'](function(_0x2345c3){var _0x22a5cd=[];_0x2345c3[_0x7bb3('0xd8')](function(_0x50226c){_0x22a5cd[_0x7bb3('0xa1')](_0x50226c[_0x7bb3('0x2f')]({'exitAt':moment()['format'](_0x7bb3('0xd9')),'data2':_0x7bb3('0xf4')}));});return BPromise['all'](_0x22a5cd);})[_0x7bb3('0x30')](function(){return _0x19f00f[_0x7bb3('0x2f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x7bb3('0x30')](respondWithResult(_0x5464b5,null))[_0x7bb3('0x24')](handleError(_0x5464b5,null));};exports[_0x7bb3('0xf8')]=function(_0x41b2dd,_0x4384a3,_0x579a17){var _0x3d59a4={};var _0x2a52ca={};var _0x8fb4a7;var _0x45497f;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x41b2dd['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x4384a3,null))[_0x7bb3('0x30')](function(_0x5e08ae){if(_0x5e08ae){_0x8fb4a7=_0x5e08ae;_0x2a52ca[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db['Team']['rawAttributes']);_0x2a52ca['query']=_[_0x7bb3('0x41')](_0x41b2dd[_0x7bb3('0x44')]);_0x2a52ca[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x2a52ca[_0x7bb3('0x40')],_0x2a52ca[_0x7bb3('0x44')]);_0x3d59a4[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x2a52ca['model'],qs[_0x7bb3('0x49')](_0x41b2dd[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x3d59a4[_0x7bb3('0x48')]=_0x3d59a4[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x3d59a4['attributes']:_0x2a52ca['model'];_0x3d59a4[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x41b2dd[_0x7bb3('0x44')]['sort']);_0x3d59a4[_0x7bb3('0x51')]=qs['filters'](_[_0x7bb3('0x52')](_0x41b2dd[_0x7bb3('0x44')],_0x2a52ca[_0x7bb3('0x46')]));if(_0x41b2dd[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x3d59a4[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x3d59a4[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x3d59a4[_0x7bb3('0x48')],function(_0x3ae3a8){var _0x4bb104={};_0x4bb104[_0x3ae3a8]={'$like':'%'+_0x41b2dd[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x4bb104;})});}_0x3d59a4=_[_0x7bb3('0x55')]({},_0x3d59a4,_0x41b2dd[_0x7bb3('0xb3')]);return _0x8fb4a7['getTeams'](_0x3d59a4);}})['then'](function(_0x5d79bc){if(_0x5d79bc){_0x45497f=_0x5d79bc[_0x7bb3('0x4a')];if(!_0x41b2dd[_0x7bb3('0x44')][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x3d59a4[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x41b2dd[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x3d59a4['offset']=qs[_0x7bb3('0x4e')](_0x41b2dd['query'][_0x7bb3('0x4e')]);}return _0x8fb4a7[_0x7bb3('0xf8')](_0x3d59a4);}})[_0x7bb3('0x30')](function(_0x3858f2){if(_0x3858f2){return _0x3858f2?{'count':_0x45497f,'rows':_0x3858f2}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x4384a3,null))[_0x7bb3('0x24')](handleError(_0x4384a3,null));};exports[_0x7bb3('0xf9')]=function(_0x3212e6,_0x47bd13,_0x5c1431){return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x3212e6[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x47bd13,null))['then'](function(_0x26e173){if(_0x26e173){return _0x26e173[_0x7bb3('0xf9')](_0x3212e6[_0x7bb3('0x61')]['ids'],_['omit'](_0x3212e6[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{});}})[_0x7bb3('0x30')](respondWithResult(_0x47bd13,null))[_0x7bb3('0x24')](handleError(_0x47bd13,null));};exports['removeTeams']=function(_0x1a0f20,_0x50d1cb,_0x57f0bd){var _0x17b22c;return db['User']['find']({'where':{'id':_0x1a0f20[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x50d1cb,null))['then'](function(_0x23454d){if(_0x23454d){return _0x23454d[_0x7bb3('0xfa')](_0x1a0f20[_0x7bb3('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x50d1cb,null))[_0x7bb3('0x24')](handleError(_0x50d1cb,null));};exports[_0x7bb3('0xfb')]=function(_0x2b6ba6,_0x46934b,_0x584105){var _0x4eeccc={};var _0x3524a6={};var _0x9e1195;var _0x564daf;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x2b6ba6[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x46934b,null))[_0x7bb3('0x30')](function(_0xad97f6){if(_0xad97f6){_0x9e1195=_0xad97f6;_0x3524a6[_0x7bb3('0x40')]=_['keys'](db[_0x7bb3('0xb4')][_0x7bb3('0x3f')]);_0x3524a6[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x2b6ba6['query']);_0x3524a6[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x3524a6[_0x7bb3('0x40')],_0x3524a6[_0x7bb3('0x44')]);_0x4eeccc[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x3524a6[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x2b6ba6[_0x7bb3('0x44')]['fields']));_0x4eeccc[_0x7bb3('0x48')]=_0x4eeccc['attributes']['length']?_0x4eeccc[_0x7bb3('0x48')]:_0x3524a6[_0x7bb3('0x40')];_0x4eeccc[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x2b6ba6[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x4eeccc[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x2b6ba6[_0x7bb3('0x44')],_0x3524a6['filters']));if(_0x2b6ba6[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x4eeccc[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x4eeccc['where'],{'$or':_['map'](_0x4eeccc[_0x7bb3('0x48')],function(_0x3c9fec){var _0x5b6661={};_0x5b6661[_0x3c9fec]={'$like':'%'+_0x2b6ba6[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x5b6661;})});}_0x4eeccc=_[_0x7bb3('0x55')]({},_0x4eeccc,_0x2b6ba6[_0x7bb3('0xb3')]);return _0x9e1195[_0x7bb3('0xfb')](_0x4eeccc);}})[_0x7bb3('0x30')](function(_0x4c5505){if(_0x4c5505){_0x564daf=_0x4c5505['length'];if(!_0x2b6ba6['query'][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x4eeccc[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x2b6ba6[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x4eeccc['offset']=qs[_0x7bb3('0x4e')](_0x2b6ba6[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x9e1195[_0x7bb3('0xfb')](_0x4eeccc);}})[_0x7bb3('0x30')](function(_0x51fb1b){if(_0x51fb1b){return _0x51fb1b?{'count':_0x564daf,'rows':_0x51fb1b}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x46934b,null))[_0x7bb3('0x24')](handleError(_0x46934b,null));};exports[_0x7bb3('0xfc')]=function(_0x446e7e,_0x4b5394,_0x50a993){var _0x558050={};var _0x1a2359={};var _0x3d70e0;var _0x33d55a;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x446e7e[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x4b5394,null))[_0x7bb3('0x30')](function(_0x5752ff){if(_0x5752ff){_0x3d70e0=_0x5752ff;_0x1a2359[_0x7bb3('0x40')]=_['keys'](db[_0x7bb3('0x3e')]['rawAttributes']);_0x1a2359[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x446e7e[_0x7bb3('0x44')]);_0x1a2359[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x1a2359[_0x7bb3('0x40')],_0x1a2359[_0x7bb3('0x44')]);_0x558050[_0x7bb3('0x48')]=_['intersection'](_0x1a2359[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x446e7e['query']['fields']));_0x558050[_0x7bb3('0x48')]=_0x558050[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x558050[_0x7bb3('0x48')]:_0x1a2359[_0x7bb3('0x40')];_0x558050[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x446e7e[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x558050['where']=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x446e7e[_0x7bb3('0x44')],_0x1a2359[_0x7bb3('0x46')]));if(_0x446e7e[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x558050[_0x7bb3('0x51')]=_['merge'](_0x558050[_0x7bb3('0x51')],{'$or':_['map'](_0x558050['attributes'],function(_0x46899d){var _0x878a4c={};_0x878a4c[_0x46899d]={'$like':'%'+_0x446e7e[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x878a4c;})});}_0x558050[_0x7bb3('0x40')]=db[_0x7bb3('0x3e')];_0x558050['as']=_0x7bb3('0x33');_0x558050=_[_0x7bb3('0x55')]({},_0x558050,_0x446e7e[_0x7bb3('0xb3')]);return _0x3d70e0[_0x7bb3('0xd5')]({'include':[_0x558050]});}})['then'](function(_0x54cfe9){if(_0x54cfe9){var _0xe9013a={},_0x3ff709=[],_0x4caf28=0x0;for(var _0x38fa07=0x0;_0x38fa07<_0x54cfe9[_0x7bb3('0x4a')];_0x38fa07+=0x1){for(var _0x22f2c2=0x0,_0x19da21;_0x22f2c2<_0x54cfe9[_0x38fa07][_0x7bb3('0x33')][_0x7bb3('0x4a')];_0x22f2c2+=0x1){_0x19da21=_0x54cfe9[_0x38fa07][_0x7bb3('0x33')][_0x22f2c2]['get']({'plain':!![]});_0xe9013a[_0x19da21['id']]=_0x19da21;}}_0xe9013a=_['values'](_0xe9013a);for(var _0x14599c=qs[_0x7bb3('0x4e')](_0x446e7e[_0x7bb3('0x44')]['offset']);_0x14599c<_0xe9013a[_0x7bb3('0x4a')]&&_0x3ff709['length']<qs['limit'](_0x446e7e[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x14599c+=0x1){if(_0xe9013a[_0x14599c]){_0x3ff709['push'](_0xe9013a[_0x14599c]);}}return{'count':_0xe9013a[_0x7bb3('0x4a')],'rows':_0x3ff709};}})['then'](respondWithResult(_0x4b5394,null))[_0x7bb3('0x24')](handleError(_0x4b5394,null));};exports[_0x7bb3('0x31')]=function(_0x348619,_0x23dc46){if(_0x348619[_0x7bb3('0x67')]['id']==_0x348619['params']['id']){return _0x23dc46[_0x7bb3('0x28')](0x1f4)[_0x7bb3('0xfd')]({'message':_0x7bb3('0xfe')});}return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x348619[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x23dc46,null))[_0x7bb3('0x30')](removeEntity(_0x23dc46,null))[_0x7bb3('0x24')](handleError(_0x23dc46,null));};exports['addChatInteractions']=function(_0x377db8,_0x3796f9,_0x305741){return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x377db8[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x3796f9,null))[_0x7bb3('0x30')](function(_0x1e1ed4){if(_0x1e1ed4){return _0x1e1ed4[_0x7bb3('0xff')](_0x377db8[_0x7bb3('0x61')][_0x7bb3('0x99')],_[_0x7bb3('0x100')](_0x377db8['body'],[_0x7bb3('0x99'),'id'])||{})['spread'](function(){for(var _0x5550e0=0x0;_0x5550e0<_0x377db8['body']['ids'][_0x7bb3('0x4a')];_0x5550e0+=0x1){socket[_0x7bb3('0x9c')](_0x7bb3('0x101'),{'ChatInteractionId':Number(_0x377db8[_0x7bb3('0x61')][_0x7bb3('0x99')][_0x5550e0]),'UserId':Number(_0x377db8['params']['id'])});}return _0x377db8[_0x7bb3('0x61')][_0x7bb3('0x99')];});}})['then'](respondWithResult(_0x3796f9,null))[_0x7bb3('0x24')](handleError(_0x3796f9,null));};exports[_0x7bb3('0x102')]=function(_0x5c3dd6,_0x2f5f51,_0x1169e5){var _0x10ad3f;return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x5c3dd6['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x2f5f51,null))[_0x7bb3('0x30')](function(_0x12834f){if(_0x12834f){return _0x12834f[_0x7bb3('0x102')](_0x5c3dd6[_0x7bb3('0x44')][_0x7bb3('0x99')])[_0x7bb3('0x30')](function(_0x4f1a3e){if(_[_0x7bb3('0x103')](_0x5c3dd6[_0x7bb3('0x44')][_0x7bb3('0x99')])){for(var _0x189aa0=0x0;_0x189aa0<_0x5c3dd6[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x7bb3('0x4a')];_0x189aa0+=0x1){socket[_0x7bb3('0x9c')](_0x7bb3('0x104'),{'ChatInteractionId':Number(_0x5c3dd6[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x189aa0]),'UserId':Number(_0x5c3dd6[_0x7bb3('0x5f')]['id'])});}}else{socket[_0x7bb3('0x9c')](_0x7bb3('0x104'),{'ChatInteractionId':Number(_0x5c3dd6['query'][_0x7bb3('0x99')]),'UserId':Number(_0x5c3dd6[_0x7bb3('0x5f')]['id'])});}});}})[_0x7bb3('0x30')](respondWithStatusCode(_0x2f5f51,null))[_0x7bb3('0x24')](handleError(_0x2f5f51,null));};exports[_0x7bb3('0x105')]=function(_0x5026be,_0x1657a4,_0x4d3f99){return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x5026be['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x1657a4,null))[_0x7bb3('0x30')](function(_0x50bc31){if(_0x50bc31){return _0x50bc31[_0x7bb3('0x105')](_0x5026be['body']['ids'],_[_0x7bb3('0x100')](_0x5026be[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{})['spread'](function(){for(var _0x16a26f=0x0;_0x16a26f<_0x5026be[_0x7bb3('0x61')][_0x7bb3('0x99')][_0x7bb3('0x4a')];_0x16a26f+=0x1){socket[_0x7bb3('0x9c')](_0x7bb3('0x106'),{'MailInteractionId':Number(_0x5026be['body'][_0x7bb3('0x99')][_0x16a26f]),'UserId':Number(_0x5026be['params']['id'])});}return _0x5026be[_0x7bb3('0x61')][_0x7bb3('0x99')];});}})[_0x7bb3('0x30')](respondWithResult(_0x1657a4,null))[_0x7bb3('0x24')](handleError(_0x1657a4,null));};exports['removeMailInteractions']=function(_0x51afcc,_0x3e418b,_0x56bad3){var _0x548147;return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x51afcc[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x3e418b,null))[_0x7bb3('0x30')](function(_0x29d7e8){if(_0x29d7e8){return _0x29d7e8[_0x7bb3('0x107')](_0x51afcc['query'][_0x7bb3('0x99')])[_0x7bb3('0x30')](function(_0x4f52d9){if(_[_0x7bb3('0x103')](_0x51afcc[_0x7bb3('0x44')][_0x7bb3('0x99')])){for(var _0x539b86=0x0;_0x539b86<_0x51afcc[_0x7bb3('0x44')]['ids'][_0x7bb3('0x4a')];_0x539b86+=0x1){socket[_0x7bb3('0x9c')](_0x7bb3('0x108'),{'MailInteractionId':Number(_0x51afcc[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x539b86]),'UserId':Number(_0x51afcc['params']['id'])});}}else{socket['emit'](_0x7bb3('0x108'),{'MailInteractionId':Number(_0x51afcc['query'][_0x7bb3('0x99')]),'UserId':Number(_0x51afcc[_0x7bb3('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x3e418b,null))[_0x7bb3('0x24')](handleError(_0x3e418b,null));};exports[_0x7bb3('0x109')]=function(_0x331a1b,_0x323be2,_0x1576ea){return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x331a1b['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x323be2,null))[_0x7bb3('0x30')](function(_0x145c61){if(_0x145c61){return _0x145c61['addFaxInteractions'](_0x331a1b[_0x7bb3('0x61')][_0x7bb3('0x99')],_[_0x7bb3('0x100')](_0x331a1b['body'],['ids','id'])||{})[_0x7bb3('0x9a')](function(){for(var _0x319f76=0x0;_0x319f76<_0x331a1b[_0x7bb3('0x61')][_0x7bb3('0x99')][_0x7bb3('0x4a')];_0x319f76+=0x1){socket[_0x7bb3('0x9c')](_0x7bb3('0x10a'),{'FaxInteractionId':Number(_0x331a1b['body'][_0x7bb3('0x99')][_0x319f76]),'UserId':Number(_0x331a1b[_0x7bb3('0x5f')]['id'])});}return _0x331a1b[_0x7bb3('0x61')]['ids'];});}})[_0x7bb3('0x30')](respondWithResult(_0x323be2,null))['catch'](handleError(_0x323be2,null));};exports[_0x7bb3('0x10b')]=function(_0x4b4325,_0x28119e,_0x7bcd28){var _0xd9d704;return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x4b4325['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x28119e,null))[_0x7bb3('0x30')](function(_0xd08fa4){if(_0xd08fa4){return _0xd08fa4[_0x7bb3('0x10b')](_0x4b4325['query'][_0x7bb3('0x99')])[_0x7bb3('0x30')](function(_0x5c2486){if(_[_0x7bb3('0x103')](_0x4b4325[_0x7bb3('0x44')][_0x7bb3('0x99')])){for(var _0x2ba775=0x0;_0x2ba775<_0x4b4325[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x7bb3('0x4a')];_0x2ba775+=0x1){socket[_0x7bb3('0x9c')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4b4325[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x2ba775]),'UserId':Number(_0x4b4325[_0x7bb3('0x5f')]['id'])});}}else{socket[_0x7bb3('0x9c')](_0x7bb3('0x10c'),{'FaxInteractionId':Number(_0x4b4325[_0x7bb3('0x44')][_0x7bb3('0x99')]),'UserId':Number(_0x4b4325[_0x7bb3('0x5f')]['id'])});}});}})[_0x7bb3('0x30')](respondWithStatusCode(_0x28119e,null))[_0x7bb3('0x24')](handleError(_0x28119e,null));};exports['addSmsInteractions']=function(_0x1f492b,_0x401ed9,_0x132598){return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x1f492b[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x401ed9,null))['then'](function(_0x1e85b7){if(_0x1e85b7){return _0x1e85b7[_0x7bb3('0x10d')](_0x1f492b[_0x7bb3('0x61')]['ids'],_[_0x7bb3('0x100')](_0x1f492b['body'],[_0x7bb3('0x99'),'id'])||{})[_0x7bb3('0x9a')](function(){for(var _0x35e59c=0x0;_0x35e59c<_0x1f492b[_0x7bb3('0x61')][_0x7bb3('0x99')]['length'];_0x35e59c+=0x1){socket[_0x7bb3('0x9c')](_0x7bb3('0x10e'),{'SmsInteractionId':Number(_0x1f492b['body']['ids'][_0x35e59c]),'UserId':Number(_0x1f492b[_0x7bb3('0x5f')]['id'])});}return _0x1f492b['body'][_0x7bb3('0x99')];});}})[_0x7bb3('0x30')](respondWithResult(_0x401ed9,null))[_0x7bb3('0x24')](handleError(_0x401ed9,null));};exports['removeSmsInteractions']=function(_0x564373,_0xde2e5e,_0x50e23d){var _0x270d89;return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x564373['params']['id']}})['then'](handleEntityNotFound(_0xde2e5e,null))[_0x7bb3('0x30')](function(_0x2a145c){if(_0x2a145c){return _0x2a145c[_0x7bb3('0x10f')](_0x564373['query'][_0x7bb3('0x99')])[_0x7bb3('0x30')](function(_0x200ad6){if(_[_0x7bb3('0x103')](_0x564373['query']['ids'])){for(var _0x4d2fcf=0x0;_0x4d2fcf<_0x564373[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x7bb3('0x4a')];_0x4d2fcf+=0x1){socket[_0x7bb3('0x9c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x564373['query'][_0x7bb3('0x99')][_0x4d2fcf]),'UserId':Number(_0x564373[_0x7bb3('0x5f')]['id'])});}}else{socket[_0x7bb3('0x9c')](_0x7bb3('0x110'),{'SmsInteractionId':Number(_0x564373[_0x7bb3('0x44')][_0x7bb3('0x99')]),'UserId':Number(_0x564373[_0x7bb3('0x5f')]['id'])});}});}})[_0x7bb3('0x30')](respondWithStatusCode(_0xde2e5e,null))[_0x7bb3('0x24')](handleError(_0xde2e5e,null));};exports['addOpenchannelInteractions']=function(_0x5f52d1,_0x575cbc,_0x351c83){return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x5f52d1[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x575cbc,null))['then'](function(_0x5a64e5){if(_0x5a64e5){return _0x5a64e5[_0x7bb3('0x111')](_0x5f52d1[_0x7bb3('0x61')][_0x7bb3('0x99')],_[_0x7bb3('0x100')](_0x5f52d1[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{})[_0x7bb3('0x9a')](function(){for(var _0xff5cfa=0x0;_0xff5cfa<_0x5f52d1[_0x7bb3('0x61')][_0x7bb3('0x99')][_0x7bb3('0x4a')];_0xff5cfa+=0x1){socket[_0x7bb3('0x9c')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x5f52d1[_0x7bb3('0x61')][_0x7bb3('0x99')][_0xff5cfa]),'UserId':Number(_0x5f52d1['params']['id'])});}return _0x5f52d1[_0x7bb3('0x61')][_0x7bb3('0x99')];});}})[_0x7bb3('0x30')](respondWithResult(_0x575cbc,null))[_0x7bb3('0x24')](handleError(_0x575cbc,null));};exports[_0x7bb3('0x112')]=function(_0x1f4c14,_0x5e5445,_0x1c6319){var _0x272527;return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x1f4c14['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x5e5445,null))['then'](function(_0x21f54b){if(_0x21f54b){return _0x21f54b[_0x7bb3('0x112')](_0x1f4c14[_0x7bb3('0x44')][_0x7bb3('0x99')])[_0x7bb3('0x30')](function(_0xe1d659){if(_[_0x7bb3('0x103')](_0x1f4c14[_0x7bb3('0x44')][_0x7bb3('0x99')])){for(var _0x4dae32=0x0;_0x4dae32<_0x1f4c14[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x7bb3('0x4a')];_0x4dae32+=0x1){socket['emit'](_0x7bb3('0x113'),{'OpenchannelInteractionId':Number(_0x1f4c14[_0x7bb3('0x44')][_0x7bb3('0x99')][_0x4dae32]),'UserId':Number(_0x1f4c14[_0x7bb3('0x5f')]['id'])});}}else{socket[_0x7bb3('0x9c')](_0x7bb3('0x113'),{'OpenchannelInteractionId':Number(_0x1f4c14['query'][_0x7bb3('0x99')]),'UserId':Number(_0x1f4c14[_0x7bb3('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x5e5445,null))[_0x7bb3('0x24')](handleError(_0x5e5445,null));};exports['getVoicePrefixes']=function(_0x442ddd,_0x4fed5b,_0x3eb332){var _0x24168a={};var _0x5abe6c={};var _0x3a74c1;var _0x2d3194;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x442ddd[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x4fed5b,null))[_0x7bb3('0x30')](function(_0x19cf14){if(_0x19cf14){_0x3a74c1=_0x19cf14;_0x5abe6c[_0x7bb3('0x40')]=_['keys'](db[_0x7bb3('0x114')][_0x7bb3('0x3f')]);_0x5abe6c['query']=_[_0x7bb3('0x41')](_0x442ddd[_0x7bb3('0x44')]);_0x5abe6c[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x5abe6c[_0x7bb3('0x40')],_0x5abe6c['query']);_0x24168a[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x5abe6c[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x442ddd['query'][_0x7bb3('0x49')]));_0x24168a['attributes']=_0x24168a[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x24168a['attributes']:_0x5abe6c[_0x7bb3('0x40')];_0x24168a['order']=qs[_0x7bb3('0x50')](_0x442ddd['query']['sort']);_0x24168a[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x442ddd[_0x7bb3('0x44')],_0x5abe6c['filters']));if(_0x442ddd[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x24168a[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x24168a['where'],{'$or':_['map'](_0x24168a[_0x7bb3('0x48')],function(_0x305323){var _0x784afc={};_0x784afc[_0x305323]={'$like':'%'+_0x442ddd[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x784afc;})});}_0x24168a=_[_0x7bb3('0x55')]({},_0x24168a,_0x442ddd[_0x7bb3('0xb3')]);return _0x3a74c1[_0x7bb3('0x115')](_0x24168a);}})['then'](function(_0x2b0c70){if(_0x2b0c70){_0x2d3194=_0x2b0c70[_0x7bb3('0x4a')];if(!_0x442ddd[_0x7bb3('0x44')][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x24168a['limit']=qs[_0x7bb3('0x4d')](_0x442ddd[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x24168a[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x442ddd[_0x7bb3('0x44')]['offset']);}return _0x3a74c1[_0x7bb3('0x115')](_0x24168a);}})[_0x7bb3('0x30')](function(_0x2f3aa1){if(_0x2f3aa1){return _0x2f3aa1?{'count':_0x2d3194,'rows':_0x2f3aa1}:null;}})['then'](respondWithResult(_0x4fed5b,null))['catch'](handleError(_0x4fed5b,null));};exports[_0x7bb3('0x116')]=function(_0x32146f,_0x6b8861,_0x5412e9){var _0x5665ed={};var _0x3fa01e={};var _0x15bc89;var _0x40f1d4;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0x32146f[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x6b8861,null))[_0x7bb3('0x30')](function(_0x41947b){if(_0x41947b){_0x15bc89=_0x41947b;_0x3fa01e[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db[_0x7bb3('0x117')][_0x7bb3('0x3f')]);_0x3fa01e[_0x7bb3('0x44')]=_['keys'](_0x32146f[_0x7bb3('0x44')]);_0x3fa01e['filters']=_[_0x7bb3('0x47')](_0x3fa01e[_0x7bb3('0x40')],_0x3fa01e['query']);_0x5665ed[_0x7bb3('0x48')]=_['intersection'](_0x3fa01e['model'],qs[_0x7bb3('0x49')](_0x32146f['query'][_0x7bb3('0x49')]));_0x5665ed[_0x7bb3('0x48')]=_0x5665ed[_0x7bb3('0x48')]['length']?_0x5665ed[_0x7bb3('0x48')]:_0x3fa01e[_0x7bb3('0x40')];_0x5665ed[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x32146f['query']['sort']);_0x5665ed[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_['pick'](_0x32146f[_0x7bb3('0x44')],_0x3fa01e[_0x7bb3('0x46')]));if(_0x32146f[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x5665ed[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x5665ed[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x5665ed[_0x7bb3('0x48')],function(_0x2d64f4){var _0x4243cd={};_0x4243cd[_0x2d64f4]={'$like':'%'+_0x32146f[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x4243cd;})});}_0x5665ed=_['merge']({},_0x5665ed,_0x32146f[_0x7bb3('0xb3')]);return _0x15bc89[_0x7bb3('0x116')](_0x5665ed);}})['then'](function(_0x2c2c56){if(_0x2c2c56){_0x40f1d4=_0x2c2c56[_0x7bb3('0x4a')];if(!_0x32146f[_0x7bb3('0x44')][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x5665ed[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x32146f[_0x7bb3('0x44')]['limit']);_0x5665ed[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x32146f[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x15bc89['getFaxAccounts'](_0x5665ed);}})[_0x7bb3('0x30')](function(_0x3f44e4){if(_0x3f44e4){return _0x3f44e4?{'count':_0x40f1d4,'rows':_0x3f44e4}:null;}})['then'](respondWithResult(_0x6b8861,null))[_0x7bb3('0x24')](handleError(_0x6b8861,null));};exports[_0x7bb3('0x118')]=function(_0xf7497,_0xfe0448,_0x4330ee){return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0xf7497['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0xfe0448,null))[_0x7bb3('0x30')](function(_0x7ca52e){if(_0x7ca52e){return _0x7ca52e['addFaxAccounts'](_0xf7497['body']['ids'],_[_0x7bb3('0x100')](_0xf7497[_0x7bb3('0x61')],['ids','id'])||{});}})[_0x7bb3('0x30')](respondWithResult(_0xfe0448,null))[_0x7bb3('0x24')](handleError(_0xfe0448,null));};exports[_0x7bb3('0x119')]=function(_0x5cc3aa,_0x7865e4,_0x30c9d2){var _0x376256;return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x5cc3aa['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x7865e4,null))[_0x7bb3('0x30')](function(_0x56072c){if(_0x56072c){return _0x56072c[_0x7bb3('0x119')](_0x5cc3aa[_0x7bb3('0x44')][_0x7bb3('0x99')]);}})[_0x7bb3('0x30')](respondWithStatusCode(_0x7865e4,null))[_0x7bb3('0x24')](handleError(_0x7865e4,null));};exports[_0x7bb3('0x11a')]=function(_0x418239,_0x234d51,_0x4318a1){var _0x3b59b8={};var _0x93a9b3={};var _0x30e2c8;var _0x2f53a4;return db[_0x7bb3('0x3e')]['findOne']({'where':{'id':_0x418239['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x234d51,null))[_0x7bb3('0x30')](function(_0x48df57){if(_0x48df57){_0x30e2c8=_0x48df57;_0x93a9b3['model']=_[_0x7bb3('0x41')](db['MailAccount'][_0x7bb3('0x3f')]);_0x93a9b3[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x418239['query']);_0x93a9b3['filters']=_[_0x7bb3('0x47')](_0x93a9b3[_0x7bb3('0x40')],_0x93a9b3[_0x7bb3('0x44')]);_0x3b59b8['attributes']=_['intersection'](_0x93a9b3[_0x7bb3('0x40')],qs['fields'](_0x418239[_0x7bb3('0x44')]['fields']));_0x3b59b8[_0x7bb3('0x48')]=_0x3b59b8[_0x7bb3('0x48')]['length']?_0x3b59b8['attributes']:_0x93a9b3[_0x7bb3('0x40')];_0x3b59b8[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x418239['query'][_0x7bb3('0x50')]);_0x3b59b8[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x418239[_0x7bb3('0x44')],_0x93a9b3[_0x7bb3('0x46')]));if(_0x418239[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x3b59b8[_0x7bb3('0x51')]=_['merge'](_0x3b59b8['where'],{'$or':_[_0x7bb3('0x56')](_0x3b59b8[_0x7bb3('0x48')],function(_0x2756da){var _0x57664b={};_0x57664b[_0x2756da]={'$like':'%'+_0x418239['query'][_0x7bb3('0x36')]+'%'};return _0x57664b;})});}_0x3b59b8=_[_0x7bb3('0x55')]({},_0x3b59b8,_0x418239[_0x7bb3('0xb3')]);return _0x30e2c8[_0x7bb3('0x11a')](_0x3b59b8);}})[_0x7bb3('0x30')](function(_0x16849b){if(_0x16849b){_0x2f53a4=_0x16849b[_0x7bb3('0x4a')];if(!_0x418239[_0x7bb3('0x44')][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x3b59b8['limit']=qs[_0x7bb3('0x4d')](_0x418239[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x3b59b8[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x418239[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x30e2c8[_0x7bb3('0x11a')](_0x3b59b8);}})[_0x7bb3('0x30')](function(_0x15646f){if(_0x15646f){return _0x15646f?{'count':_0x2f53a4,'rows':_0x15646f}:null;}})[_0x7bb3('0x30')](respondWithResult(_0x234d51,null))[_0x7bb3('0x24')](handleError(_0x234d51,null));};exports[_0x7bb3('0x11b')]=function(_0x405aa6,_0x5ef638,_0x593046){return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x405aa6[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x5ef638,null))['then'](function(_0xbf4e2f){if(_0xbf4e2f){return _0xbf4e2f[_0x7bb3('0x11b')](_0x405aa6[_0x7bb3('0x61')][_0x7bb3('0x99')],_[_0x7bb3('0x100')](_0x405aa6[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{});}})[_0x7bb3('0x30')](respondWithResult(_0x5ef638,null))['catch'](handleError(_0x5ef638,null));};exports[_0x7bb3('0x11c')]=function(_0x1669cc,_0x2d5a30,_0x4a3dca){var _0x28ea11;return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x1669cc[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2d5a30,null))['then'](function(_0x4ab93e){if(_0x4ab93e){return _0x4ab93e[_0x7bb3('0x11c')](_0x1669cc[_0x7bb3('0x44')][_0x7bb3('0x99')]);}})['then'](respondWithStatusCode(_0x2d5a30,null))[_0x7bb3('0x24')](handleError(_0x2d5a30,null));};exports[_0x7bb3('0x11d')]=function(_0x21645a,_0xa3a4ab,_0x2c4d96){var _0x186123={};var _0x121676={};var _0x225c57;var _0x356552;return db[_0x7bb3('0x3e')]['findOne']({'where':{'id':_0x21645a['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0xa3a4ab,null))['then'](function(_0x24aa5f){if(_0x24aa5f){_0x225c57=_0x24aa5f;_0x121676[_0x7bb3('0x40')]=_['keys'](db[_0x7bb3('0x11e')]['rawAttributes']);_0x121676[_0x7bb3('0x44')]=_['keys'](_0x21645a[_0x7bb3('0x44')]);_0x121676[_0x7bb3('0x46')]=_['intersection'](_0x121676['model'],_0x121676[_0x7bb3('0x44')]);_0x186123['attributes']=_[_0x7bb3('0x47')](_0x121676[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x21645a[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x186123['attributes']=_0x186123[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x186123[_0x7bb3('0x48')]:_0x121676[_0x7bb3('0x40')];_0x186123[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x21645a['query'][_0x7bb3('0x50')]);_0x186123[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0x21645a['query'],_0x121676[_0x7bb3('0x46')]));if(_0x21645a[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x186123['where']=_[_0x7bb3('0x55')](_0x186123['where'],{'$or':_[_0x7bb3('0x56')](_0x186123[_0x7bb3('0x48')],function(_0x56bb2b){var _0xb35726={};_0xb35726[_0x56bb2b]={'$like':'%'+_0x21645a['query'][_0x7bb3('0x36')]+'%'};return _0xb35726;})});}_0x186123=_[_0x7bb3('0x55')]({},_0x186123,_0x21645a[_0x7bb3('0xb3')]);return _0x225c57[_0x7bb3('0x11d')](_0x186123);}})[_0x7bb3('0x30')](function(_0xd622c4){if(_0xd622c4){_0x356552=_0xd622c4[_0x7bb3('0x4a')];if(!_0x21645a['query'][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x186123[_0x7bb3('0x4d')]=qs['limit'](_0x21645a[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x186123[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x21645a['query'][_0x7bb3('0x4e')]);}return _0x225c57[_0x7bb3('0x11d')](_0x186123);}})[_0x7bb3('0x30')](function(_0x26cd0b){if(_0x26cd0b){return _0x26cd0b?{'count':_0x356552,'rows':_0x26cd0b}:null;}})[_0x7bb3('0x30')](respondWithResult(_0xa3a4ab,null))[_0x7bb3('0x24')](handleError(_0xa3a4ab,null));};exports[_0x7bb3('0x11f')]=function(_0x195986,_0x5c8ba3,_0x55ca8c){return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x195986[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x5c8ba3,null))[_0x7bb3('0x30')](function(_0xc30ead){if(_0xc30ead){return _0xc30ead[_0x7bb3('0x11f')](_0x195986['body'][_0x7bb3('0x99')],_[_0x7bb3('0x100')](_0x195986[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{});}})['then'](respondWithResult(_0x5c8ba3,null))[_0x7bb3('0x24')](handleError(_0x5c8ba3,null));};exports['removeOpenchannelAccounts']=function(_0xf7c918,_0x42d41b,_0xd85044){var _0x55eadb;return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0xf7c918[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x42d41b,null))[_0x7bb3('0x30')](function(_0x47862a){if(_0x47862a){return _0x47862a[_0x7bb3('0x120')](_0xf7c918[_0x7bb3('0x44')][_0x7bb3('0x99')]);}})[_0x7bb3('0x30')](respondWithStatusCode(_0x42d41b,null))[_0x7bb3('0x24')](handleError(_0x42d41b,null));};exports['getSmsAccounts']=function(_0xf2b3a7,_0xa3abb6,_0x4e6135){var _0x27717c={};var _0x1aa7f4={};var _0x260834;var _0x49adae;return db[_0x7bb3('0x3e')][_0x7bb3('0xbb')]({'where':{'id':_0xf2b3a7[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0xa3abb6,null))['then'](function(_0x4ad2b1){if(_0x4ad2b1){_0x260834=_0x4ad2b1;_0x1aa7f4['model']=_[_0x7bb3('0x41')](db[_0x7bb3('0x121')][_0x7bb3('0x3f')]);_0x1aa7f4[_0x7bb3('0x44')]=_['keys'](_0xf2b3a7[_0x7bb3('0x44')]);_0x1aa7f4[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x1aa7f4[_0x7bb3('0x40')],_0x1aa7f4[_0x7bb3('0x44')]);_0x27717c[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x1aa7f4[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0xf2b3a7[_0x7bb3('0x44')]['fields']));_0x27717c['attributes']=_0x27717c['attributes'][_0x7bb3('0x4a')]?_0x27717c[_0x7bb3('0x48')]:_0x1aa7f4[_0x7bb3('0x40')];_0x27717c[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0xf2b3a7[_0x7bb3('0x44')][_0x7bb3('0x50')]);_0x27717c[_0x7bb3('0x51')]=qs[_0x7bb3('0x46')](_[_0x7bb3('0x52')](_0xf2b3a7[_0x7bb3('0x44')],_0x1aa7f4[_0x7bb3('0x46')]));if(_0xf2b3a7[_0x7bb3('0x44')]['filter']){_0x27717c[_0x7bb3('0x51')]=_['merge'](_0x27717c[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x27717c[_0x7bb3('0x48')],function(_0x1194cf){var _0x4596bb={};_0x4596bb[_0x1194cf]={'$like':'%'+_0xf2b3a7[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x4596bb;})});}_0x27717c=_[_0x7bb3('0x55')]({},_0x27717c,_0xf2b3a7[_0x7bb3('0xb3')]);return _0x260834['getSmsAccounts'](_0x27717c);}})[_0x7bb3('0x30')](function(_0x483861){if(_0x483861){_0x49adae=_0x483861[_0x7bb3('0x4a')];if(!_0xf2b3a7[_0x7bb3('0x44')][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x27717c[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0xf2b3a7[_0x7bb3('0x44')][_0x7bb3('0x4d')]);_0x27717c['offset']=qs[_0x7bb3('0x4e')](_0xf2b3a7[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x260834[_0x7bb3('0x122')](_0x27717c);}})[_0x7bb3('0x30')](function(_0x17bbb6){if(_0x17bbb6){return _0x17bbb6?{'count':_0x49adae,'rows':_0x17bbb6}:null;}})[_0x7bb3('0x30')](respondWithResult(_0xa3abb6,null))[_0x7bb3('0x24')](handleError(_0xa3abb6,null));};exports[_0x7bb3('0x123')]=function(_0x108e90,_0x4e84b5,_0x11ab92){return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x108e90[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x4e84b5,null))[_0x7bb3('0x30')](function(_0x3c6136){if(_0x3c6136){return _0x3c6136[_0x7bb3('0x123')](_0x108e90[_0x7bb3('0x61')]['ids'],_[_0x7bb3('0x100')](_0x108e90[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{});}})[_0x7bb3('0x30')](respondWithResult(_0x4e84b5,null))['catch'](handleError(_0x4e84b5,null));};exports[_0x7bb3('0x124')]=function(_0x1c4e69,_0x1e5ce8,_0x2b8c84){var _0x5374b9;return db[_0x7bb3('0x3e')][_0x7bb3('0x3a')]({'where':{'id':_0x1c4e69['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x1e5ce8,null))[_0x7bb3('0x30')](function(_0xf680d3){if(_0xf680d3){return _0xf680d3[_0x7bb3('0x124')](_0x1c4e69[_0x7bb3('0x44')][_0x7bb3('0x99')]);}})[_0x7bb3('0x30')](respondWithStatusCode(_0x1e5ce8,null))[_0x7bb3('0x24')](handleError(_0x1e5ce8,null));};exports['getChatWebsites']=function(_0x2f35a1,_0x1f37c2,_0x5bfbdd){var _0x482a3a={};var _0xa29b75={};var _0x4de12f;var _0x9d5b0b;return db['User']['findOne']({'where':{'id':_0x2f35a1['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x1f37c2,null))['then'](function(_0x45cf79){if(_0x45cf79){_0x4de12f=_0x45cf79;_0xa29b75[_0x7bb3('0x40')]=_[_0x7bb3('0x41')](db[_0x7bb3('0x125')][_0x7bb3('0x3f')]);_0xa29b75[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x2f35a1[_0x7bb3('0x44')]);_0xa29b75[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0xa29b75['model'],_0xa29b75[_0x7bb3('0x44')]);_0x482a3a[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0xa29b75[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x2f35a1[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x482a3a[_0x7bb3('0x48')]=_0x482a3a['attributes'][_0x7bb3('0x4a')]?_0x482a3a['attributes']:_0xa29b75['model'];_0x482a3a[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x2f35a1[_0x7bb3('0x44')]['sort']);_0x482a3a[_0x7bb3('0x51')]=qs['filters'](_['pick'](_0x2f35a1[_0x7bb3('0x44')],_0xa29b75[_0x7bb3('0x46')]));if(_0x2f35a1[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x482a3a[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x482a3a[_0x7bb3('0x51')],{'$or':_['map'](_0x482a3a['attributes'],function(_0x135208){var _0x36cad5={};_0x36cad5[_0x135208]={'$like':'%'+_0x2f35a1[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x36cad5;})});}_0x482a3a=_['merge']({},_0x482a3a,_0x2f35a1[_0x7bb3('0xb3')]);return _0x4de12f[_0x7bb3('0x126')](_0x482a3a);}})['then'](function(_0x37ca3e){if(_0x37ca3e){_0x9d5b0b=_0x37ca3e[_0x7bb3('0x4a')];if(!_0x2f35a1['query'][_0x7bb3('0x4b')]('nolimit')){_0x482a3a[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x2f35a1['query'][_0x7bb3('0x4d')]);_0x482a3a[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x2f35a1[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x4de12f[_0x7bb3('0x126')](_0x482a3a);}})[_0x7bb3('0x30')](function(_0x2e65f9){if(_0x2e65f9){return _0x2e65f9?{'count':_0x9d5b0b,'rows':_0x2e65f9}:null;}})['then'](respondWithResult(_0x1f37c2,null))[_0x7bb3('0x24')](handleError(_0x1f37c2,null));};exports[_0x7bb3('0x127')]=function(_0x40e4e0,_0x5a8c19,_0x4f70d5){return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x40e4e0[_0x7bb3('0x5f')]['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x5a8c19,null))[_0x7bb3('0x30')](function(_0x578ab3){if(_0x578ab3){return _0x578ab3[_0x7bb3('0x127')](_0x40e4e0[_0x7bb3('0x61')][_0x7bb3('0x99')],_[_0x7bb3('0x100')](_0x40e4e0[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{});}})['then'](respondWithResult(_0x5a8c19,null))[_0x7bb3('0x24')](handleError(_0x5a8c19,null));};exports[_0x7bb3('0x128')]=function(_0x49ca72,_0xaba8b5,_0x2d05f6){var _0x45c808;return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x49ca72[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0xaba8b5,null))[_0x7bb3('0x30')](function(_0x535f1f){if(_0x535f1f){return _0x535f1f[_0x7bb3('0x128')](_0x49ca72[_0x7bb3('0x44')][_0x7bb3('0x99')]);}})[_0x7bb3('0x30')](respondWithStatusCode(_0xaba8b5,null))['catch'](handleError(_0xaba8b5,null));};exports[_0x7bb3('0x129')]=function(_0x1d0b48,_0xce30b2,_0x1dcf8a){var _0x10d118={};var _0x4008f8={};var _0x226099;var _0x327755;return db['User'][_0x7bb3('0xbb')]({'where':{'id':_0x1d0b48[_0x7bb3('0x5f')]['id']}})['then'](handleEntityNotFound(_0xce30b2,null))[_0x7bb3('0x30')](function(_0x4335e0){if(_0x4335e0){_0x226099=_0x4335e0;_0x4008f8['model']=_[_0x7bb3('0x41')](db['SquareProject'][_0x7bb3('0x3f')]);_0x4008f8[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x1d0b48['query']);_0x4008f8[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x4008f8[_0x7bb3('0x40')],_0x4008f8['query']);_0x10d118[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x4008f8[_0x7bb3('0x40')],qs['fields'](_0x1d0b48[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x10d118[_0x7bb3('0x48')]=_0x10d118[_0x7bb3('0x48')][_0x7bb3('0x4a')]?_0x10d118[_0x7bb3('0x48')]:_0x4008f8['model'];_0x10d118[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x1d0b48['query']['sort']);_0x10d118[_0x7bb3('0x51')]=qs['filters'](_[_0x7bb3('0x52')](_0x1d0b48['query'],_0x4008f8['filters']));if(_0x1d0b48[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x10d118[_0x7bb3('0x51')]=_[_0x7bb3('0x55')](_0x10d118[_0x7bb3('0x51')],{'$or':_[_0x7bb3('0x56')](_0x10d118[_0x7bb3('0x48')],function(_0x259527){var _0x3d08a5={};_0x3d08a5[_0x259527]={'$like':'%'+_0x1d0b48['query'][_0x7bb3('0x36')]+'%'};return _0x3d08a5;})});}_0x10d118=_[_0x7bb3('0x55')]({},_0x10d118,_0x1d0b48[_0x7bb3('0xb3')]);return _0x226099[_0x7bb3('0x129')](_0x10d118);}})['then'](function(_0x58e744){if(_0x58e744){_0x327755=_0x58e744[_0x7bb3('0x4a')];if(!_0x1d0b48['query'][_0x7bb3('0x4b')]('nolimit')){_0x10d118[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x1d0b48[_0x7bb3('0x44')]['limit']);_0x10d118[_0x7bb3('0x4e')]=qs['offset'](_0x1d0b48[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}return _0x226099[_0x7bb3('0x129')](_0x10d118);}})[_0x7bb3('0x30')](function(_0x53bc8e){if(_0x53bc8e){return _0x53bc8e?{'count':_0x327755,'rows':_0x53bc8e}:null;}})[_0x7bb3('0x30')](respondWithResult(_0xce30b2,null))[_0x7bb3('0x24')](handleError(_0xce30b2,null));};exports[_0x7bb3('0x12a')]=function(_0x2ef33b,_0x15bed2,_0x2145af){return db[_0x7bb3('0x3e')]['find']({'where':{'id':_0x2ef33b['params']['id']}})['then'](handleEntityNotFound(_0x15bed2,null))[_0x7bb3('0x30')](function(_0x38578f){if(_0x38578f){return _0x38578f[_0x7bb3('0x12a')](_0x2ef33b['body'][_0x7bb3('0x99')],_[_0x7bb3('0x100')](_0x2ef33b[_0x7bb3('0x61')],[_0x7bb3('0x99'),'id'])||{});}})[_0x7bb3('0x30')](respondWithResult(_0x15bed2,null))[_0x7bb3('0x24')](handleError(_0x15bed2,null));};exports[_0x7bb3('0x12b')]=function(_0x4f5e9f,_0x4441ac,_0x5b73c7){var _0x590471;return db['User'][_0x7bb3('0x3a')]({'where':{'id':_0x4f5e9f['params']['id']}})[_0x7bb3('0x30')](handleEntityNotFound(_0x4441ac,null))['then'](function(_0x425418){if(_0x425418){return _0x425418[_0x7bb3('0x12b')](_0x4f5e9f[_0x7bb3('0x44')]['ids']);}})[_0x7bb3('0x30')](respondWithStatusCode(_0x4441ac,null))[_0x7bb3('0x24')](handleError(_0x4441ac,null));};exports[_0x7bb3('0x12c')]=function(_0x48da58,_0x4985ed){var _0x4f4a67={},_0x84a19a={},_0x558250={'count':0x0,'rows':[]};var _0x382afb=db['CmHopper']['rawAttributes'];_0x84a19a[_0x7bb3('0x40')]=_['keys'](_0x382afb);var _0x3cd5dc={'dateStart':_0x48da58[_0x7bb3('0x44')]['dateStart'],'dateEnd':_0x48da58[_0x7bb3('0x44')][_0x7bb3('0x45')]};delete _0x48da58['query'][_0x7bb3('0x43')];delete _0x48da58[_0x7bb3('0x44')]['dateEnd'];_0x84a19a[_0x7bb3('0x44')]=_[_0x7bb3('0x41')](_0x48da58[_0x7bb3('0x44')]);_0x84a19a[_0x7bb3('0x46')]=_[_0x7bb3('0x47')](_0x84a19a[_0x7bb3('0x40')],_0x84a19a[_0x7bb3('0x44')]);_0x84a19a['filters']=_[_0x7bb3('0xde')](_0x84a19a[_0x7bb3('0x46')],[_0x7bb3('0x12d'),_0x7bb3('0x12e'),_0x7bb3('0x12f'),_0x7bb3('0x130'),_0x7bb3('0x131'),_0x7bb3('0x132'),_0x7bb3('0x133'),_0x7bb3('0x134'),'$not','$between',_0x7bb3('0x135'),'$in',_0x7bb3('0x136'),_0x7bb3('0x137'),_0x7bb3('0x138'),_0x7bb3('0x139'),_0x7bb3('0x13a'),_0x7bb3('0x137'),'$overlap',_0x7bb3('0x13b'),_0x7bb3('0x13c'),_0x7bb3('0x13d')]);_0x4f4a67[_0x7bb3('0x48')]=_[_0x7bb3('0x47')](_0x84a19a[_0x7bb3('0x40')],qs[_0x7bb3('0x49')](_0x48da58[_0x7bb3('0x44')][_0x7bb3('0x49')]));_0x4f4a67[_0x7bb3('0x48')]=_0x4f4a67[_0x7bb3('0x48')]['length']?_0x4f4a67[_0x7bb3('0x48')]:_0x84a19a[_0x7bb3('0x40')];if(!_0x48da58['query'][_0x7bb3('0x4b')](_0x7bb3('0x4c'))){_0x4f4a67[_0x7bb3('0x4d')]=qs[_0x7bb3('0x4d')](_0x48da58['query'][_0x7bb3('0x4d')]);_0x4f4a67[_0x7bb3('0x4e')]=qs[_0x7bb3('0x4e')](_0x48da58[_0x7bb3('0x44')][_0x7bb3('0x4e')]);}_0x4f4a67[_0x7bb3('0x4f')]=qs[_0x7bb3('0x50')](_0x48da58[_0x7bb3('0x44')]['sort']);_0x4f4a67[_0x7bb3('0x51')]=qs['filters'](_[_0x7bb3('0x52')](_0x48da58[_0x7bb3('0x44')],_0x84a19a[_0x7bb3('0x46')]));if(_0x3cd5dc[_0x7bb3('0x43')]){if(_0x3cd5dc[_0x7bb3('0x45')]){_0x3cd5dc[_0x7bb3('0x45')]=moment(_0x3cd5dc[_0x7bb3('0x45')])['add'](0x1,'day');}else{_0x3cd5dc[_0x7bb3('0x45')]=moment(_0x3cd5dc[_0x7bb3('0x43')])[_0x7bb3('0x53')](0x1,_0x7bb3('0x54'));}_['merge'](_0x4f4a67['where'],{'scheduledat':{'$gte':_0x3cd5dc[_0x7bb3('0x43')],'$lte':_0x3cd5dc[_0x7bb3('0x45')]}});}if(_0x48da58[_0x7bb3('0x44')][_0x7bb3('0x36')]){_0x4f4a67['where']=_[_0x7bb3('0x55')](_0x4f4a67[_0x7bb3('0x51')],{'$or':_['map'](_0x4f4a67['attributes'],function(_0x1f52d0){var _0x1807de={};_0x1807de[_0x1f52d0]={'$like':'%'+_0x48da58[_0x7bb3('0x44')][_0x7bb3('0x36')]+'%'};return _0x1807de;})});}_0x4f4a67[_0x7bb3('0x51')]={'$and':[_0x4f4a67[_0x7bb3('0x51')],{'$or':[{'UserId':_0x48da58[_0x7bb3('0x5f')]['id']},{'OwnerId':_0x48da58[_0x7bb3('0x5f')]['id']}]}]};_0x4f4a67=_[_0x7bb3('0x55')]({},_0x4f4a67,_0x48da58['options']);var _0x3ef7c4={'where':_0x4f4a67[_0x7bb3('0x51')]};return db[_0x7bb3('0x13e')][_0x7bb3('0x29')](_0x3ef7c4)[_0x7bb3('0x30')](function(_0x2fd43c){_0x558250[_0x7bb3('0x29')]=_0x2fd43c;if(_0x48da58[_0x7bb3('0x44')][_0x7bb3('0x5b')]){_0x4f4a67[_0x7bb3('0x5c')]=[{'attributes':['id',_0x7bb3('0x13f'),'lastName',_0x7bb3('0xcc')],'model':db[_0x7bb3('0xb2')],'as':_0x7bb3('0x140')},{'attributes':['id',_0x7bb3('0x3b'),_0x7bb3('0x141')],'model':db[_0x7bb3('0x9f')],'as':_0x7bb3('0xbc')}];}return db[_0x7bb3('0x13e')][_0x7bb3('0xa0')](_0x4f4a67);})[_0x7bb3('0x30')](function(_0x23a9b7){_0x558250['rows']=_0x23a9b7;return _0x558250;})[_0x7bb3('0x30')](respondWithFilteredResult(_0x4985ed,_0x4f4a67))['catch'](handleError(_0x4985ed,null));};
\ No newline at end of file
+var _0xfba6=['Unknown\x20channel','channel','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','Queue:save','voice','findAll','SIP/%s','interface','voicePause','each','UserVoiceQueueRt','upsert','remove','addAvatar','userpic','getAvatar','join','server/files/images/logos/default_profile.png','existsSync','root','server/files/images/','download','getContacts','findOne','CmContact','pick','hasOwnProperty','includeAll','CmList','List','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','headers','connection','remoteAddress','socket','getVoiceQueues','push','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','concat','logout','forEach','all','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','faxPause','smsPause','pauseType','manual','mail','chat','fax','sms','%s%s','Pause','Team','getTeams','addTeams','removeTeams','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$gte','$lt','$lte','$eq','$between','$notBetween','$in','$notIn','$like','$notILike','$overlap','$contains','$any','firstName','phone','VoiceQueue','eml-format','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./user.socket','register','jayson/promise','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','get','Users','user','Agents','agent','Telephones','filter','ignore','map','value','includes','role','find','name','destroy','stack','send','index','User','rawAttributes','model','differenceBy','keys','password','salt','dateStart','query','dateEnd','filters','attributes','fields','length','nolimit','order','sort','where','add','day','merge','sequelize','lower','col','field','include','rows','intersection','options','bulkCreate','body','describe','addContacts','params','ids','omit','agent\x20role','admin','../../config/license/util','getLicense','telephone','users','isNil','License\x20limit\x20reached','format','create','internal','findById','min_internal','max','from','voicemail','mailbox','VoiceMail','email','permissions','101','102','103','110','104','105','106','107','109','100','111','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','loginInPause','isValidChannel'];(function(_0x48f2fa,_0x22b14d){var _0x5e88e8=function(_0x1ab754){while(--_0x1ab754){_0x48f2fa['push'](_0x48f2fa['shift']());}};_0x5e88e8(++_0x22b14d);}(_0xfba6,0xa9));var _0x6fba=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0xfba6[_0x4fbb15];return _0x436338;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6fba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6fba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fba('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6fba('0x3'));var util=require(_0x6fba('0x4'));var path=require(_0x6fba('0x5'));var sox=require('sox');var csv=require(_0x6fba('0x6'));var ejs=require(_0x6fba('0x7'));var fs=require('fs');var _=require(_0x6fba('0x8'));var squel=require(_0x6fba('0x9'));var crypto=require(_0x6fba('0xa'));var jsforce=require(_0x6fba('0xb'));var deskjs=require(_0x6fba('0xc'));var toCsv=require(_0x6fba('0x6'));var querystring=require(_0x6fba('0xd'));var Papa=require(_0x6fba('0xe'));var Redis=require(_0x6fba('0xf'));var qs=require(_0x6fba('0x10'));var logger=require(_0x6fba('0x11'))(_0x6fba('0x12'));var utils=require(_0x6fba('0x13'));var config=require(_0x6fba('0x14'));var db=require(_0x6fba('0x15'))['db'];config['redis']=_['defaults'](config[_0x6fba('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x6fba('0x17'))(new Redis(config[_0x6fba('0x16')]));require(_0x6fba('0x18'))[_0x6fba('0x19')](socket);var jayson=require(_0x6fba('0x1a'));var client=jayson[_0x6fba('0x1b')][_0x6fba('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4d081f,_0x4b5bb5,_0x3597f4,_0x4af61b){return new BPromise(function(_0xad6845,_0x3ea1b3){var _0x3f507e=_0x4af61b||client;return _0x3f507e[_0x6fba('0x1d')](_0x4d081f,_0x3597f4)[_0x6fba('0x1e')](function(_0x2b5ddd){logger[_0x6fba('0x1f')](_0x6fba('0x20'),_0x4b5bb5,_0x6fba('0x21'));logger[_0x6fba('0x22')](_0x6fba('0x23'),_0x4b5bb5,_0x6fba('0x21'),JSON[_0x6fba('0x24')](_0x2b5ddd));if(_0x2b5ddd[_0x6fba('0x25')]){if(_0x2b5ddd[_0x6fba('0x25')][_0x6fba('0x26')]===0x1f4){logger[_0x6fba('0x25')](_0x6fba('0x20'),_0x4b5bb5,_0x2b5ddd[_0x6fba('0x25')][_0x6fba('0x27')]);return _0x3ea1b3(_0x2b5ddd[_0x6fba('0x25')][_0x6fba('0x27')]);}logger[_0x6fba('0x25')](_0x6fba('0x20'),_0x4b5bb5,_0x2b5ddd['error'][_0x6fba('0x27')]);return _0xad6845(_0x2b5ddd[_0x6fba('0x25')][_0x6fba('0x27')]);}else{logger[_0x6fba('0x1f')](_0x6fba('0x20'),_0x4b5bb5,_0x6fba('0x21'));_0xad6845(_0x2b5ddd[_0x6fba('0x28')][_0x6fba('0x27')]);}})[_0x6fba('0x29')](function(_0x1cb1bb){logger['error']('User,\x20%s,\x20%s',_0x4b5bb5,_0x1cb1bb);_0x3ea1b3(_0x1cb1bb);});});}function respondWithStatusCode(_0x1a821a,_0x1862e4){_0x1862e4=_0x1862e4||0xcc;return function(_0x52cbfd){if(_0x52cbfd){return _0x1a821a[_0x6fba('0x2a')](_0x1862e4);}return _0x1a821a['status'](_0x1862e4)[_0x6fba('0x2b')]();};}function respondWithResult(_0x535cbc,_0x4eddc4){_0x4eddc4=_0x4eddc4||0xc8;return function(_0x58fc74){if(_0x58fc74){return _0x535cbc[_0x6fba('0x2c')](_0x4eddc4)[_0x6fba('0x2d')](_0x58fc74);}};}function respondWithFilteredResult(_0x484021,_0x18d02f){return function(_0x1021ac){if(_0x1021ac){var _0x2b089d=_0x1021ac[_0x6fba('0x2e')],_0x4ff085=_0x18d02f[_0x6fba('0x2f')],_0x4dde68=_0x18d02f[_0x6fba('0x2f')]+_0x18d02f[_0x6fba('0x30')],_0x54240c;if(_0x4dde68>=_0x2b089d){_0x4dde68=_0x2b089d;_0x54240c=0xc8;}else{_0x54240c=0xce;}_0x484021[_0x6fba('0x2c')](_0x54240c);return _0x484021[_0x6fba('0x31')](_0x6fba('0x32'),_0x4ff085+'-'+_0x4dde68+'/'+_0x2b089d)[_0x6fba('0x2d')](_0x1021ac);}return null;};}function patchUpdates(_0x243595){return function(_0x419830){try{jsonpatch[_0x6fba('0x33')](_0x419830,_0x243595,!![]);}catch(_0x291ebf){return BPromise['reject'](_0x291ebf);}return _0x419830[_0x6fba('0x34')]();};}function saveUpdates(_0x32da13,_0x5abde2){return function(_0x5d11a4){if(_0x5d11a4){return _0x5d11a4[_0x6fba('0x35')](_0x32da13)[_0x6fba('0x1e')](function(_0x42e993){return _0x42e993;});}return null;};}function removeEntity(_0x1e346f,_0x56a51f){return function(_0x5b777f){if(_0x5b777f){return _0x5b777f['destroy']()[_0x6fba('0x1e')](function(){var _0x1a4c96=_0x5b777f[_0x6fba('0x36')]({'plain':!![]});var _0xa167ee=[{'name':_0x6fba('0x37'),'value':_0x6fba('0x38'),'ignore':!![]},{'name':_0x6fba('0x39'),'value':_0x6fba('0x3a'),'ignore':![]},{'name':_0x6fba('0x3b'),'value':'telephone','ignore':![]}];var _0xdaa501=_(_0xa167ee)[_0x6fba('0x3c')](_0x6fba('0x3d'))[_0x6fba('0x3e')](_0x6fba('0x3f'))[_0x6fba('0x3f')]();if(_[_0x6fba('0x40')](_0xdaa501,_0x1a4c96[_0x6fba('0x41')])){return;}var _0x5be764=_[_0x6fba('0x42')](_0xa167ee,['value',_0x1a4c96[_0x6fba('0x41')]])[_0x6fba('0x43')];return db['UserProfileResource'][_0x6fba('0x44')]({'where':{'type':_0x5be764,'resourceId':_0x1a4c96['id']}})[_0x6fba('0x1e')](function(){return _0x5b777f;});})[_0x6fba('0x1e')](function(){_0x1e346f[_0x6fba('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10b8d,_0x2b0691){return function(_0x2f5b1d){if(!_0x2f5b1d){_0x10b8d[_0x6fba('0x2a')](0x194);}return _0x2f5b1d;};}function handleError(_0x4aa15e,_0x245fa4){_0x245fa4=_0x245fa4||0x1f4;return function(_0x56c967){logger[_0x6fba('0x25')](_0x56c967[_0x6fba('0x45')]);if(_0x56c967[_0x6fba('0x43')]){delete _0x56c967[_0x6fba('0x43')];}_0x4aa15e[_0x6fba('0x2c')](_0x245fa4)[_0x6fba('0x46')](_0x56c967);};}exports[_0x6fba('0x47')]=function(_0x3d7348,_0x3db574){var _0x22c168={},_0x308130={},_0x237b88={'count':0x0,'rows':[]};var _0x442c73=db[_0x6fba('0x48')][_0x6fba('0x49')];_0x308130[_0x6fba('0x4a')]=_[_0x6fba('0x4b')](_[_0x6fba('0x4c')](_0x442c73),[_0x6fba('0x4d'),_0x6fba('0x4e')]);var _0x1b9f6e={'dateStart':_0x3d7348['query']['dateStart'],'dateEnd':_0x3d7348['query']['dateEnd']};delete _0x3d7348['query'][_0x6fba('0x4f')];delete _0x3d7348[_0x6fba('0x50')][_0x6fba('0x51')];_0x308130['query']=_[_0x6fba('0x4c')](_0x3d7348[_0x6fba('0x50')]);_0x308130[_0x6fba('0x52')]=_['intersection'](_0x308130[_0x6fba('0x4a')],_0x308130[_0x6fba('0x50')]);_0x22c168[_0x6fba('0x53')]=_['intersection'](_0x308130[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x3d7348[_0x6fba('0x50')][_0x6fba('0x54')]));_0x22c168[_0x6fba('0x53')]=_0x22c168['attributes'][_0x6fba('0x55')]?_0x22c168[_0x6fba('0x53')]:_0x308130[_0x6fba('0x4a')];if(!_0x3d7348['query']['hasOwnProperty'](_0x6fba('0x56'))){_0x22c168[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x3d7348[_0x6fba('0x50')][_0x6fba('0x30')]);_0x22c168['offset']=qs[_0x6fba('0x2f')](_0x3d7348['query'][_0x6fba('0x2f')]);}_0x22c168[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x3d7348[_0x6fba('0x50')][_0x6fba('0x58')]);_0x22c168[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_['pick'](_0x3d7348[_0x6fba('0x50')],_0x308130[_0x6fba('0x52')]));if(_0x1b9f6e['dateStart']){if(_0x1b9f6e[_0x6fba('0x51')]){_0x1b9f6e[_0x6fba('0x51')]=moment(_0x1b9f6e['dateEnd'])[_0x6fba('0x5a')](0x1,_0x6fba('0x5b'));}else{_0x1b9f6e['dateEnd']=moment(_0x1b9f6e[_0x6fba('0x4f')])[_0x6fba('0x5a')](0x1,_0x6fba('0x5b'));}_[_0x6fba('0x5c')](_0x22c168[_0x6fba('0x59')],{'createdAt':{'$gte':_0x1b9f6e[_0x6fba('0x4f')],'$lte':_0x1b9f6e[_0x6fba('0x51')]}});}if(_0x3d7348['query'][_0x6fba('0x3c')]){_0x22c168[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x22c168[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x442c73,function(_0x221bad){return db[_0x6fba('0x5d')]['where'](db[_0x6fba('0x5d')]['fn'](_0x6fba('0x5e'),db[_0x6fba('0x5d')][_0x6fba('0x5f')](_0x221bad[_0x6fba('0x60')])),{'$like':db[_0x6fba('0x5d')]['fn'](_0x6fba('0x5e'),'%'+_0x3d7348[_0x6fba('0x50')][_0x6fba('0x3c')]+'%')});})});}_0x22c168=_[_0x6fba('0x5c')]({},_0x22c168,_0x3d7348['options']);var _0x2d233c={'where':_0x22c168['where']};return db[_0x6fba('0x48')][_0x6fba('0x2e')](_0x2d233c)[_0x6fba('0x1e')](function(_0x400695){_0x237b88[_0x6fba('0x2e')]=_0x400695;if(_0x3d7348[_0x6fba('0x50')]['includeAll']){_0x22c168[_0x6fba('0x61')]=[{'all':!![]}];}return db[_0x6fba('0x48')]['findAll'](_0x22c168);})[_0x6fba('0x1e')](function(_0x1737d3){_0x237b88[_0x6fba('0x62')]=_0x1737d3;return _0x237b88;})[_0x6fba('0x1e')](respondWithFilteredResult(_0x3db574,_0x22c168))['catch'](handleError(_0x3db574,null));};exports['show']=function(_0x441791,_0x4ca469){var _0x1385ad={'raw':![],'where':{'id':_0x441791['params']['id']}},_0x411eaa={};_0x411eaa[_0x6fba('0x4a')]=_['differenceBy'](_['keys'](db['User'][_0x6fba('0x49')]),[_0x6fba('0x4d'),'salt']);_0x411eaa['query']=_[_0x6fba('0x4c')](_0x441791['query']);_0x411eaa[_0x6fba('0x52')]=_['intersection'](_0x411eaa['model'],_0x411eaa[_0x6fba('0x50')]);_0x1385ad[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x411eaa[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x441791[_0x6fba('0x50')][_0x6fba('0x54')]));_0x1385ad[_0x6fba('0x53')]=_0x1385ad[_0x6fba('0x53')]['length']?_0x1385ad[_0x6fba('0x53')]:_0x411eaa[_0x6fba('0x4a')];if(_0x441791[_0x6fba('0x50')]['includeAll']){_0x1385ad[_0x6fba('0x61')]=[{'all':!![]}];}_0x1385ad=_[_0x6fba('0x5c')]({},_0x1385ad,_0x441791[_0x6fba('0x64')]);return db[_0x6fba('0x48')][_0x6fba('0x42')](_0x1385ad)['then'](handleEntityNotFound(_0x4ca469,null))[_0x6fba('0x1e')](respondWithResult(_0x4ca469,null))[_0x6fba('0x29')](handleError(_0x4ca469,null));};exports[_0x6fba('0x65')]=function(_0x57b12f,_0x460f98){return db[_0x6fba('0x48')][_0x6fba('0x65')](_0x57b12f['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x460f98,0xc9))[_0x6fba('0x29')](handleError(_0x460f98,null));};exports['update']=function(_0x453061,_0x4c2387){if(_0x453061['body']['id']){delete _0x453061[_0x6fba('0x66')]['id'];}return db[_0x6fba('0x48')]['find']({'where':{'id':_0x453061['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x4c2387,null))[_0x6fba('0x1e')](saveUpdates(_0x453061[_0x6fba('0x66')],null))[_0x6fba('0x1e')](respondWithResult(_0x4c2387,null))[_0x6fba('0x29')](handleError(_0x4c2387,null));};exports[_0x6fba('0x67')]=function(_0x5b6d6f,_0x1cbc96){return db[_0x6fba('0x48')][_0x6fba('0x67')]()[_0x6fba('0x1e')](respondWithResult(_0x1cbc96,null))[_0x6fba('0x29')](handleError(_0x1cbc96,null));};exports[_0x6fba('0x68')]=function(_0x4c04c6,_0x4917bf,_0x114efe){return db[_0x6fba('0x48')]['find']({'where':{'id':_0x4c04c6[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x4917bf,null))[_0x6fba('0x1e')](function(_0x30dfd1){if(_0x30dfd1){return _0x30dfd1[_0x6fba('0x68')](_0x4c04c6[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x4c04c6[_0x6fba('0x66')],['ids','id'])||{});}})['then'](respondWithResult(_0x4917bf,null))['catch'](handleError(_0x4917bf,null));};var getLicense=function(_0x31ce76){return new BPromise(function(_0x170804,_0x50cba2){var _0x368ff2=0x0;_0x31ce76[_0x6fba('0x66')][_0x6fba('0x41')]==='agent'&&_0x170804(_0x6fba('0x6c'));return db['User']['count']({'where':{'$or':[{'role':_0x31ce76[_0x6fba('0x66')][_0x6fba('0x41')]==='telephone'?'telephone':[_0x6fba('0x6d'),_0x6fba('0x38')]}]}})[_0x6fba('0x1e')](function(_0x5a3193){_0x368ff2=_0x5a3193;return require(_0x6fba('0x6e'))[_0x6fba('0x6f')]();})[_0x6fba('0x1e')](function(_0x33fdf0){var _0x44001f=_0x31ce76[_0x6fba('0x66')]['role']===_0x6fba('0x70')?'telephones':_0x6fba('0x71');if(!_[_0x6fba('0x72')](_0x33fdf0[_0x44001f])&&_0x368ff2>=_0x33fdf0[_0x44001f]){return _0x50cba2({'message':_0x6fba('0x73')});}return _0x170804(util[_0x6fba('0x74')]('count\x20%s:\x20%s',_0x44001f,_0x368ff2));})[_0x6fba('0x29')](function(_0x3a7808){return _0x50cba2(_0x3a7808);});});};exports[_0x6fba('0x75')]=function(_0x156342,_0x39cc62){return getLicense(_0x156342)[_0x6fba('0x1e')](function(_0x4b951d){if(!_0x156342['body'][_0x6fba('0x76')]){var _0x55d55;return db['Setting'][_0x6fba('0x77')](0x1)[_0x6fba('0x1e')](function(_0x3363f0){_0x55d55=_0x3363f0[_0x6fba('0x78')];return db[_0x6fba('0x48')][_0x6fba('0x79')](_0x6fba('0x76'));})[_0x6fba('0x1e')](function(_0x11f2ba){if(_[_0x6fba('0x72')](_0x11f2ba)){if(_0x55d55){_0x156342[_0x6fba('0x66')][_0x6fba('0x76')]=_0x55d55;}else{_0x156342[_0x6fba('0x66')][_0x6fba('0x76')]=0x1;}}else{if(_[_0x6fba('0x72')](_0x55d55)||_0x55d55==_0x11f2ba){_0x156342[_0x6fba('0x66')][_0x6fba('0x76')]=_0x11f2ba+0x1;}else if(_0x55d55>_0x11f2ba){_0x156342[_0x6fba('0x66')]['internal']=_0x55d55;}else{return db[_0x6fba('0x5d')][_0x6fba('0x50')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x6fba('0x5d')]['QueryTypes']['SELECT']})[_0x6fba('0x1e')](function(_0x4f85a6){if(_0x4f85a6&&_0x4f85a6[_0x6fba('0x55')]){for(var _0x9601a4=0x0,_0x3d6a14=_0x4f85a6[_0x6fba('0x55')];_0x9601a4<_0x3d6a14&&_[_0x6fba('0x72')](_0x156342[_0x6fba('0x66')][_0x6fba('0x76')]);_0x9601a4++){if(_0x55d55<=_0x4f85a6[_0x9601a4][_0x6fba('0x7a')]){_0x156342['body']['internal']=_0x4f85a6[_0x9601a4][_0x6fba('0x7a')];}else if(_0x55d55>_0x4f85a6[_0x9601a4]['from']&&_0x55d55<=_0x4f85a6[_0x9601a4]['to']){_0x156342['body'][_0x6fba('0x76')]=_0x55d55;}}}if(_['isNil'](_0x156342['body'][_0x6fba('0x76')])){_0x156342[_0x6fba('0x66')][_0x6fba('0x76')]=_0x11f2ba+0x1;}});}}});}})[_0x6fba('0x1e')](function(){if(_0x156342['body'][_0x6fba('0x7b')]){_0x156342[_0x6fba('0x66')][_0x6fba('0x7c')]=_0x156342[_0x6fba('0x66')]['internal'];_0x156342['body'][_0x6fba('0x7d')]={'mailbox':_0x156342[_0x6fba('0x66')]['internal'],'password':_0x156342['body'][_0x6fba('0x4d')],'fullname':_0x156342[_0x6fba('0x66')]['fullname'],'email':_0x156342['body'][_0x6fba('0x7e')]};}if(_0x156342[_0x6fba('0x66')]&&_0x156342[_0x6fba('0x66')][_0x6fba('0x41')]==='agent'){_0x156342[_0x6fba('0x66')][_0x6fba('0x7f')]=[_0x6fba('0x80'),_0x6fba('0x81'),_0x6fba('0x82'),_0x6fba('0x83'),_0x6fba('0x84'),_0x6fba('0x85'),_0x6fba('0x86'),_0x6fba('0x87'),'108',_0x6fba('0x88'),_0x6fba('0x89'),_0x6fba('0x8a')];}return db[_0x6fba('0x48')][_0x6fba('0x75')](_0x156342[_0x6fba('0x66')],{'include':[{'model':db[_0x6fba('0x7d')],'as':_0x6fba('0x7d')}]});})[_0x6fba('0x1e')](function(_0x72d18f){if(_0x156342['body']['role']===_0x6fba('0x38'))return _0x72d18f;var _0x3101f9=_0x156342['user'][_0x6fba('0x36')]({'plain':!![]});if(!_0x3101f9)throw new Error(_0x6fba('0x8b'));if(_0x3101f9[_0x6fba('0x41')]===_0x6fba('0x38')){var _0x128676=_0x72d18f[_0x6fba('0x36')]({'plain':!![]});var _0x3daeb7=[{'name':_0x6fba('0x39'),'value':_0x6fba('0x3a')},{'name':'Telephones','value':_0x6fba('0x70')}];var _0x123ed6=_[_0x6fba('0x42')](_0x3daeb7,[_0x6fba('0x3f'),_0x128676[_0x6fba('0x41')]])[_0x6fba('0x43')];return db[_0x6fba('0x8c')][_0x6fba('0x42')]({'where':{'name':_0x123ed6,'userProfileId':_0x3101f9[_0x6fba('0x8d')]},'raw':!![]})[_0x6fba('0x1e')](function(_0x5c55d0){if(_0x5c55d0&&_0x5c55d0[_0x6fba('0x8e')]===0x0){return db[_0x6fba('0x8f')][_0x6fba('0x75')]({'name':_0x128676[_0x6fba('0x43')],'resourceId':_0x128676['id'],'type':_0x5c55d0['name'],'sectionId':_0x5c55d0['id']},{})[_0x6fba('0x1e')](function(){return _0x72d18f;});}else{return _0x72d18f;}})[_0x6fba('0x29')](function(_0x43ce87){logger['error'](_0x6fba('0x90'),_0x43ce87);throw _0x43ce87;});}return _0x72d18f;})[_0x6fba('0x1e')](respondWithResult(_0x39cc62,0xc9))[_0x6fba('0x29')](handleError(_0x39cc62,null));};exports[_0x6fba('0x91')]=function(_0x583834,_0x3aff94,_0x90ed0e){if(_0x583834[_0x6fba('0x66')]['id']){delete _0x583834['body']['id'];}return db[_0x6fba('0x48')]['find']({'where':{'id':_0x583834[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](function(_0x200957){if(_0x200957){if(_0x200957['id']==_0x583834[_0x6fba('0x38')]['id']){if(!_0x583834[_0x6fba('0x66')][_0x6fba('0x92')]||!_0x583834['body'][_0x6fba('0x93')]){throw new db[(_0x6fba('0x94'))]['ValidationError'](_0x6fba('0x95'));}if(!_0x200957['authenticate'](_0x583834[_0x6fba('0x66')][_0x6fba('0x92')])){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))]('Wrong\x20credentials');}if(_0x583834[_0x6fba('0x66')][_0x6fba('0x92')]==_0x583834[_0x6fba('0x66')]['newPassword']){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x200957;}else if(_0x583834[_0x6fba('0x38')][_0x6fba('0x41')]==_0x6fba('0x6d')){if(!_0x583834[_0x6fba('0x66')][_0x6fba('0x93')]){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x200957;}else if(_0x583834[_0x6fba('0x38')][_0x6fba('0x41')]==_0x6fba('0x38')){if(!_0x583834[_0x6fba('0x66')][_0x6fba('0x93')]){throw new db['Sequelize'][(_0x6fba('0x96'))](_0x6fba('0x97'));}if(_0x200957[_0x6fba('0x41')]!=_0x6fba('0x3a')){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))](_0x6fba('0x98'));}return _0x200957;}else{throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))](_0x6fba('0x98'));}}return null;})[_0x6fba('0x1e')](handleEntityNotFound(_0x3aff94,null))[_0x6fba('0x1e')](saveUpdates({'password':_0x583834[_0x6fba('0x66')][_0x6fba('0x93')],'passwordResetAt':_0x583834[_0x6fba('0x38')]['id']==_0x583834[_0x6fba('0x69')]['id']?moment():null},null))[_0x6fba('0x1e')](respondWithResult(_0x3aff94,null))['catch'](handleError(_0x3aff94,null));};exports[_0x6fba('0x99')]=function(_0x508969,_0x2753c2,_0xb99497){var _0x9e5806;return db['User'][_0x6fba('0x42')]({'where':{'id':_0x508969['params']['id']},'attributes':['id',_0x6fba('0x43'),_0x6fba('0x41'),_0x6fba('0x9a'),'voicePause','interface']})['then'](handleEntityNotFound(_0x2753c2,null))['then'](function(_0x15fe1b){if(_0x15fe1b){_0x9e5806=_0x15fe1b;if(!utils[_0x6fba('0x9b')](_0x508969['body']['channel'])){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))](_0x6fba('0x9c'));}return _0x15fe1b[_0x6fba('0x5a')+_['capitalize'](_0x508969[_0x6fba('0x66')][_0x6fba('0x9d')][_0x6fba('0x9e')]())+_0x6fba('0x9f')](_0x508969[_0x6fba('0x66')][_0x6fba('0x6a')],{'penalty':_0x508969['body'][_0x6fba('0xa0')]||0x0});}})[_0x6fba('0xa1')](function(_0x2e0784){for(var _0x24495d=0x0;_0x24495d<_0x508969[_0x6fba('0x66')][_0x6fba('0x6a')][_0x6fba('0x55')];_0x24495d+=0x1){var _0x4eb38e={'UserId':_0x508969[_0x6fba('0x69')]['id']};_0x4eb38e[_[_0x6fba('0xa2')](_0x508969['body'][_0x6fba('0x9d')][_0x6fba('0x9e')]())+_0x6fba('0xa3')]=_0x508969[_0x6fba('0x66')][_0x6fba('0x6a')][_0x24495d];socket[_0x6fba('0xa4')]('user'+_[_0x6fba('0xa2')](_0x508969[_0x6fba('0x66')][_0x6fba('0x9d')][_0x6fba('0x9e')]())+_0x6fba('0xa5'),_0x4eb38e);}return _0x2e0784;})[_0x6fba('0x1e')](function(){if(_0x508969['body'][_0x6fba('0x9d')]===_0x6fba('0xa6')){return db['VoiceQueue'][_0x6fba('0xa7')]({'where':{'id':_0x508969[_0x6fba('0x66')]['ids']||[]},'raw':!![],'attributes':['id',_0x6fba('0x43')]});}})['then'](function(_0x50d387){var _0x7501e=[];if(_0x508969['body'][_0x6fba('0x9d')]===_0x6fba('0xa6')&&_0x9e5806['role']===_0x6fba('0x3a')){for(var _0x18ecc9=0x0;_0x18ecc9<_0x50d387[_0x6fba('0x55')];_0x18ecc9+=0x1){_0x7501e['push']({'membername':_0x9e5806['name'],'UserId':_0x9e5806['id'],'queue_name':_0x50d387[_0x18ecc9][_0x6fba('0x43')],'VoiceQueueId':_0x50d387[_0x18ecc9]['id'],'interface':_[_0x6fba('0x72')](_0x9e5806['interface'])?util[_0x6fba('0x74')](_0x6fba('0xa8'),_0x9e5806['name']):_0x9e5806[_0x6fba('0xa9')],'paused':_0x9e5806[_0x6fba('0xaa')]||![],'penalty':_0x508969[_0x6fba('0x66')][_0x6fba('0xa0')]||0x0});}return BPromise[_0x6fba('0xab')](_0x7501e,function(_0x5c2983){return db[_0x6fba('0xac')][_0x6fba('0xad')](_0x5c2983);});}return _0x9e5806;})[_0x6fba('0x1e')](respondWithStatusCode(_0x2753c2,null))[_0x6fba('0x29')](handleError(_0x2753c2,null));};exports['removeQueues']=function(_0x2e9856,_0x40ebd8,_0x4783b9){var _0x461e61;return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x2e9856[_0x6fba('0x69')]['id']},'attributes':['id','name',_0x6fba('0x41')]})[_0x6fba('0x1e')](handleEntityNotFound(_0x40ebd8,null))[_0x6fba('0x1e')](function(_0x1f2ad2){if(_0x1f2ad2){_0x461e61=_0x1f2ad2;if(!_0x2e9856['query'][_0x6fba('0x9d')]||!utils['isValidChannel'](_0x2e9856[_0x6fba('0x50')][_0x6fba('0x9d')])){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))](_0x6fba('0x9c'));}return _0x1f2ad2[_0x6fba('0xae')+_[_0x6fba('0xa2')](_0x2e9856[_0x6fba('0x50')][_0x6fba('0x9d')][_0x6fba('0x9e')]())+_0x6fba('0x9f')](_0x2e9856['query']['ids']);}})[_0x6fba('0x1e')](function(_0xde2d55){for(var _0x1ac5b5=0x0;_0x1ac5b5<_0x2e9856['query'][_0x6fba('0x6a')][_0x6fba('0x55')];_0x1ac5b5+=0x1){var _0x53fa39={'UserId':_0x2e9856[_0x6fba('0x69')]['id']};_0x53fa39[_[_0x6fba('0xa2')](_0x2e9856[_0x6fba('0x50')]['channel'][_0x6fba('0x9e')]())+_0x6fba('0xa3')]=_0x2e9856[_0x6fba('0x50')]['ids'][_0x1ac5b5];socket['emit'](_0x6fba('0x38')+_[_0x6fba('0xa2')](_0x2e9856['query'][_0x6fba('0x9d')]['toLowerCase']())+'Queue:remove',_0x53fa39);}return _0xde2d55;})['then'](function(){if(_0x2e9856[_0x6fba('0x50')]['channel']==='voice'){return db[_0x6fba('0xac')][_0x6fba('0x44')]({'where':{'UserId':_0x2e9856[_0x6fba('0x69')]['id'],'VoiceQueueId':_0x2e9856[_0x6fba('0x50')][_0x6fba('0x6a')]},'individualHooks':!![]})[_0x6fba('0x1e')](function(){return _0x461e61;});}return _0x461e61;})[_0x6fba('0x1e')](respondWithStatusCode(_0x40ebd8,null))[_0x6fba('0x29')](handleError(_0x40ebd8,null));};exports[_0x6fba('0xaf')]=function(_0x5ab5d2,_0x5be289,_0x4c87d4){_0x5ab5d2[_0x6fba('0x66')][_0x6fba('0xb0')]=_0x5ab5d2['file']['filename'];return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x5ab5d2[_0x6fba('0x69')]['id']}})['then'](handleEntityNotFound(_0x5be289,null))[_0x6fba('0x1e')](saveUpdates(_0x5ab5d2[_0x6fba('0x66')],null))[_0x6fba('0x1e')](respondWithResult(_0x5be289,null))[_0x6fba('0x29')](handleError(_0x5be289,null));};exports[_0x6fba('0xb1')]=function(_0x3e43f6,_0x5b3ce7,_0x5742d2){var _0x6709c6=path[_0x6fba('0xb2')](config['root'],_0x6fba('0xb3'));return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x3e43f6[_0x6fba('0x69')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x5b3ce7,null))[_0x6fba('0x1e')](function(_0x3f1834){if(_0x3f1834){if(_[_0x6fba('0x72')](_0x3f1834[_0x6fba('0xb0')])){return _0x5b3ce7['download'](_0x6709c6);}else{if(!fs[_0x6fba('0xb4')](path[_0x6fba('0xb2')](config[_0x6fba('0xb5')],_0x6fba('0xb6'),_0x3f1834[_0x6fba('0xb0')]))){return _0x5b3ce7[_0x6fba('0xb7')](_0x6709c6);}return _0x5b3ce7[_0x6fba('0xb7')](path[_0x6fba('0xb2')](config[_0x6fba('0xb5')],_0x6fba('0xb6'),_0x3f1834['userpic']));}}})[_0x6fba('0x29')](handleError(_0x5b3ce7,null));};exports[_0x6fba('0xb8')]=function(_0x3b4a22,_0x324bb7,_0x5b7653){var _0x5b8696={};var _0x49dec4={};var _0x3a04c7;var _0xa52606;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x3b4a22[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x324bb7,null))['then'](function(_0x1bd3b3){if(_0x1bd3b3){_0x3a04c7=_0x1bd3b3;_0x49dec4['model']=_[_0x6fba('0x4c')](db[_0x6fba('0xba')][_0x6fba('0x49')]);_0x49dec4['query']=_[_0x6fba('0x4c')](_0x3b4a22['query']);_0x49dec4[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x49dec4[_0x6fba('0x4a')],_0x49dec4[_0x6fba('0x50')]);_0x5b8696[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x49dec4[_0x6fba('0x4a')],qs['fields'](_0x3b4a22[_0x6fba('0x50')][_0x6fba('0x54')]));_0x5b8696[_0x6fba('0x53')]=_0x5b8696[_0x6fba('0x53')][_0x6fba('0x55')]?_0x5b8696['attributes']:_0x49dec4[_0x6fba('0x4a')];_0x5b8696[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x3b4a22[_0x6fba('0x50')][_0x6fba('0x58')]);_0x5b8696['where']=qs['filters'](_[_0x6fba('0xbb')](_0x3b4a22[_0x6fba('0x50')],_0x49dec4[_0x6fba('0x52')]));if(_0x3b4a22[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x5b8696[_0x6fba('0x59')]=_['merge'](_0x5b8696[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x5b8696[_0x6fba('0x53')],function(_0x493751){var _0x53d0cb={};_0x53d0cb[_0x493751]={'$like':'%'+_0x3b4a22[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x53d0cb;})});}_0x5b8696=_[_0x6fba('0x5c')]({},_0x5b8696,_0x3b4a22['options']);return _0x3a04c7[_0x6fba('0xb8')](_0x5b8696);}})[_0x6fba('0x1e')](function(_0x55d82f){if(_0x55d82f){_0xa52606=_0x55d82f[_0x6fba('0x55')];if(_0x3b4a22['query'][_0x6fba('0xbc')](_0x6fba('0xbd'))){_0x5b8696[_0x6fba('0x61')]=[{'model':db[_0x6fba('0xbe')],'as':_0x6fba('0xbf'),'required':![]},{'model':db[_0x6fba('0xc0')],'as':_0x6fba('0xc1'),'attributes':['id',_0x6fba('0x43'),_0x6fba('0xc2')],'where':_0x3b4a22[_0x6fba('0x50')][_0x6fba('0xc3')]?{'id':_0x3b4a22[_0x6fba('0x50')][_0x6fba('0xc3')]}:undefined,'required':_0x3b4a22[_0x6fba('0x50')][_0x6fba('0xc3')]?!![]:![]}];}if(!_0x3b4a22[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x5b8696['limit']=qs['limit'](_0x3b4a22[_0x6fba('0x50')][_0x6fba('0x30')]);_0x5b8696[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x3b4a22['query'][_0x6fba('0x2f')]);}return _0x3a04c7[_0x6fba('0xb8')](_0x5b8696);}})[_0x6fba('0x1e')](function(_0x3492bd){if(_0x3492bd){return _0x3492bd?{'count':_0xa52606,'rows':_0x3492bd}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x324bb7,null))[_0x6fba('0x29')](handleError(_0x324bb7,null));};exports[_0x6fba('0xc4')]=function(_0x1d73b4,_0x4333bc,_0x3103c6){var _0x18a30d;var _0x4266ab;var _0x514bd1={};var _0x169f95;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x1d73b4['params']['id']},'attributes':['id',_0x6fba('0x43'),_0x6fba('0x41')]})[_0x6fba('0x1e')](handleEntityNotFound(_0x4333bc,null))[_0x6fba('0x1e')](function(_0xb1ef5b){if(!utils[_0x6fba('0x9b')](_0x1d73b4[_0x6fba('0x50')]['channel'])){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))](_0x6fba('0x9c'));}_0x18a30d=_0xb1ef5b;var _0x1d4329={};_0x1d4329[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_['capitalize'](_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x9d')])+_0x6fba('0xc5')][_0x6fba('0x49')]);_0x1d4329[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x1d73b4[_0x6fba('0x50')]);_0x1d4329[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x1d4329[_0x6fba('0x4a')],_0x1d4329['query']);_0x514bd1['attributes']=_[_0x6fba('0x63')](_0x1d4329[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x54')]));_0x514bd1[_0x6fba('0x53')]=_0x514bd1['attributes'][_0x6fba('0x55')]?_0x514bd1[_0x6fba('0x53')]:_0x1d4329['model'];_0x514bd1[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x58')]);_0x514bd1['where']=qs[_0x6fba('0x52')](_[_0x6fba('0xbb')](_0x1d73b4['query'],_0x1d4329[_0x6fba('0x52')]));if(_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x514bd1[_0x6fba('0x59')]=_['merge'](_0x514bd1[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x514bd1[_0x6fba('0x53')],function(_0x47c95d){var _0x2baf93={};_0x2baf93[_0x47c95d]={'$like':'%'+_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x2baf93;})});}_0x514bd1=_['merge']({},_0x514bd1,_0x1d73b4[_0x6fba('0x64')]);switch(_0x18a30d[_0x6fba('0x41')]){case _0x6fba('0x6d'):return db[_[_0x6fba('0xa2')](_0x1d73b4[_0x6fba('0x50')]['channel'])+'Queue'][_0x6fba('0xa7')](_0x514bd1);case _0x6fba('0x38'):case _0x6fba('0x3a'):return _0x18a30d[_0x6fba('0x36')+_[_0x6fba('0xa2')](_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x9d')])+'Queues'](_0x514bd1);default:throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))](_0x6fba('0xc6'));}})[_0x6fba('0x1e')](function(_0x4e7c7b){_0x169f95=_0x4e7c7b[_0x6fba('0x55')];if(!_0x1d73b4['query']['hasOwnProperty'](_0x6fba('0x56'))){_0x514bd1['limit']=qs[_0x6fba('0x30')](_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x30')]);_0x514bd1['offset']=qs[_0x6fba('0x2f')](_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x2f')]);}switch(_0x18a30d[_0x6fba('0x41')]){case _0x6fba('0x6d'):return db[_[_0x6fba('0xa2')](_0x1d73b4[_0x6fba('0x50')][_0x6fba('0x9d')])+'Queue']['findAll'](_0x514bd1);case _0x6fba('0x38'):case _0x6fba('0x3a'):return _0x18a30d[_0x6fba('0x36')+_[_0x6fba('0xa2')](_0x1d73b4[_0x6fba('0x50')]['channel'])+_0x6fba('0x9f')](_0x514bd1);}})[_0x6fba('0x1e')](function(_0x51585b){return{'count':_0x169f95,'rows':_0x51585b};})[_0x6fba('0x1e')](respondWithResult(_0x4333bc,null))[_0x6fba('0x29')](handleError(_0x4333bc,null));};exports[_0x6fba('0xc7')]=function(_0x19bd6e,_0x5d160a,_0x3b0911){var _0x1bd8fd={};var _0x5604f2={};var _0x39eb2a;var _0xb53d47;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x19bd6e[_0x6fba('0x69')]['id']}})['then'](handleEntityNotFound(_0x5d160a,null))[_0x6fba('0x1e')](function(_0x415f27){if(_0x415f27){_0x39eb2a=_0x415f27;_0x5604f2[_0x6fba('0x4a')]=_['keys'](db['UserVoiceQueueRt'][_0x6fba('0x49')]);_0x5604f2['query']=_[_0x6fba('0x4c')](_0x19bd6e[_0x6fba('0x50')]);_0x5604f2[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x5604f2[_0x6fba('0x4a')],_0x5604f2[_0x6fba('0x50')]);_0x1bd8fd[_0x6fba('0x53')]=_['intersection'](_0x5604f2['model'],qs['fields'](_0x19bd6e[_0x6fba('0x50')]['fields']));_0x1bd8fd[_0x6fba('0x53')]=_0x1bd8fd[_0x6fba('0x53')][_0x6fba('0x55')]?_0x1bd8fd[_0x6fba('0x53')]:_0x5604f2['model'];_0x1bd8fd['order']=qs[_0x6fba('0x58')](_0x19bd6e[_0x6fba('0x50')][_0x6fba('0x58')]);_0x1bd8fd[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_[_0x6fba('0xbb')](_0x19bd6e[_0x6fba('0x50')],_0x5604f2[_0x6fba('0x52')]));if(_0x19bd6e[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x1bd8fd[_0x6fba('0x59')]=_['merge'](_0x1bd8fd[_0x6fba('0x59')],{'$or':_['map'](_0x1bd8fd[_0x6fba('0x53')],function(_0x1e5996){var _0x4abd8f={};_0x4abd8f[_0x1e5996]={'$like':'%'+_0x19bd6e['query'][_0x6fba('0x3c')]+'%'};return _0x4abd8f;})});}_0x1bd8fd=_['merge']({},_0x1bd8fd,_0x19bd6e['options']);return _0x39eb2a[_0x6fba('0xc7')](_0x1bd8fd);}})[_0x6fba('0x1e')](function(_0x60abf5){if(_0x60abf5){_0xb53d47=_0x60abf5[_0x6fba('0x55')];if(!_0x19bd6e[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x1bd8fd[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x19bd6e['query'][_0x6fba('0x30')]);_0x1bd8fd[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x19bd6e[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x39eb2a[_0x6fba('0xc7')](_0x1bd8fd);}})[_0x6fba('0x1e')](function(_0x2dcdbc){if(_0x2dcdbc){return _0x2dcdbc?{'count':_0xb53d47,'rows':_0x2dcdbc}:null;}})['then'](respondWithResult(_0x5d160a,null))['catch'](handleError(_0x5d160a,null));};exports[_0x6fba('0xc8')]=function(_0x29f52,_0x4c5d91,_0x2a24d4){var _0x53b2cf={};var _0x24455f={};var _0x377fa5;var _0x33c15e;return db['User'][_0x6fba('0xb9')]({'where':{'id':_0x29f52[_0x6fba('0x69')]['id']}})['then'](handleEntityNotFound(_0x4c5d91,null))[_0x6fba('0x1e')](function(_0x34cfba){if(_0x34cfba){_0x377fa5=_0x34cfba;_0x24455f[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0xc9')]['rawAttributes']);_0x24455f[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x29f52[_0x6fba('0x50')]);_0x24455f[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x24455f['model'],_0x24455f[_0x6fba('0x50')]);_0x53b2cf[_0x6fba('0x53')]=_['intersection'](_0x24455f[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x29f52[_0x6fba('0x50')][_0x6fba('0x54')]));_0x53b2cf[_0x6fba('0x53')]=_0x53b2cf[_0x6fba('0x53')][_0x6fba('0x55')]?_0x53b2cf[_0x6fba('0x53')]:_0x24455f[_0x6fba('0x4a')];_0x53b2cf['order']=qs[_0x6fba('0x58')](_0x29f52[_0x6fba('0x50')][_0x6fba('0x58')]);_0x53b2cf[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_[_0x6fba('0xbb')](_0x29f52[_0x6fba('0x50')],_0x24455f[_0x6fba('0x52')]));if(_0x29f52[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x53b2cf[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x53b2cf[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x53b2cf['attributes'],function(_0x3f79dc){var _0x58a1c={};_0x58a1c[_0x3f79dc]={'$like':'%'+_0x29f52['query'][_0x6fba('0x3c')]+'%'};return _0x58a1c;})});}_0x53b2cf=_[_0x6fba('0x5c')]({},_0x53b2cf,_0x29f52[_0x6fba('0x64')]);return _0x377fa5[_0x6fba('0xc8')](_0x53b2cf);}})['then'](function(_0x5defa7){if(_0x5defa7){_0x33c15e=_0x5defa7[_0x6fba('0x55')];if(!_0x29f52[_0x6fba('0x50')]['hasOwnProperty'](_0x6fba('0x56'))){_0x53b2cf['limit']=qs['limit'](_0x29f52[_0x6fba('0x50')]['limit']);_0x53b2cf[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x29f52[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x377fa5['getGroups'](_0x53b2cf);}})['then'](function(_0x26458b){if(_0x26458b){return _0x26458b?{'count':_0x33c15e,'rows':_0x26458b}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x4c5d91,null))[_0x6fba('0x29')](handleError(_0x4c5d91,null));};exports[_0x6fba('0xca')]=function(_0x5d19a6,_0x2760fc,_0x333e55){var _0x427357={'raw':!![],'where':{}};var _0x38912e={};var _0x1a3e97={'count':0x0,'rows':[]};return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x5d19a6[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x2760fc,null))[_0x6fba('0x1e')](function(_0x5e0619){if(_0x5e0619){_0x38912e['model']=_[_0x6fba('0x4c')](db[_0x6fba('0xcb')][_0x6fba('0x49')]);_0x38912e[_0x6fba('0x50')]=_['keys'](_0x5d19a6[_0x6fba('0x50')]);_0x38912e[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x38912e['model'],_0x38912e[_0x6fba('0x50')]);_0x427357[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x38912e[_0x6fba('0x4a')],qs['fields'](_0x5d19a6['query'][_0x6fba('0x54')]));_0x427357[_0x6fba('0x53')]=_0x427357[_0x6fba('0x53')][_0x6fba('0x55')]?_0x427357[_0x6fba('0x53')]:_0x38912e['model'];if(!_0x5d19a6[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x427357[_0x6fba('0x30')]=qs['limit'](_0x5d19a6['query']['limit']);_0x427357[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x5d19a6['query'][_0x6fba('0x2f')]);}_0x427357[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x5d19a6[_0x6fba('0x50')][_0x6fba('0x58')]);_0x427357[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_['pick'](_0x5d19a6['query'],_0x38912e['filters']));_0x427357[_0x6fba('0x59')][_0x6fba('0xcc')]=_0x5e0619['id'];if(_0x5d19a6[_0x6fba('0x50')]['filter']){_0x427357[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x427357[_0x6fba('0x59')],{'$or':_['map'](_0x427357[_0x6fba('0x53')],function(_0x56a87b){var _0x3a3e3a={};_0x3a3e3a[_0x56a87b]={'$like':'%'+_0x5d19a6[_0x6fba('0x50')]['filter']+'%'};return _0x3a3e3a;})});}_0x427357=_[_0x6fba('0x5c')]({},_0x427357,_0x5d19a6[_0x6fba('0x64')]);return db[_0x6fba('0xcb')][_0x6fba('0x2e')]({'where':_0x427357[_0x6fba('0x59')]})[_0x6fba('0x1e')](function(_0xaf1917){_0x1a3e97['count']=_0xaf1917;if(_0x5d19a6[_0x6fba('0x50')][_0x6fba('0xbd')]){_0x427357[_0x6fba('0x61')]=[{'all':!![]}];}return db[_0x6fba('0xcb')][_0x6fba('0xa7')](_0x427357);})[_0x6fba('0x1e')](function(_0x242990){_0x1a3e97['rows']=_0x242990;return _0x1a3e97;});}})[_0x6fba('0x1e')](respondWithFilteredResult(_0x2760fc,_0x427357))[_0x6fba('0x29')](handleError(_0x2760fc,null));};exports[_0x6fba('0xcd')]=function(_0x451c81,_0x314240,_0x2012d4){var _0x534584={};var _0x446c15={};var _0x115e75;var _0x579799;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x451c81['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x314240,null))[_0x6fba('0x1e')](function(_0x8e7a1d){if(_0x8e7a1d){_0x115e75=_0x8e7a1d;_0x446c15['model']=_[_0x6fba('0x4c')](db[_0x6fba('0xce')][_0x6fba('0x49')]);_0x446c15['query']=_[_0x6fba('0x4c')](_0x451c81['query']);_0x446c15['filters']=_['intersection'](_0x446c15['model'],_0x446c15[_0x6fba('0x50')]);_0x534584[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x446c15[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x451c81[_0x6fba('0x50')]['fields']));_0x534584[_0x6fba('0x53')]=_0x534584['attributes'][_0x6fba('0x55')]?_0x534584[_0x6fba('0x53')]:_0x446c15[_0x6fba('0x4a')];_0x534584[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x451c81[_0x6fba('0x50')][_0x6fba('0x58')]);_0x534584[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_[_0x6fba('0xbb')](_0x451c81['query'],_0x446c15[_0x6fba('0x52')]));if(_0x451c81[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x534584[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x534584[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x534584[_0x6fba('0x53')],function(_0x2c5473){var _0x2bbb51={};_0x2bbb51[_0x2c5473]={'$like':'%'+_0x451c81['query'][_0x6fba('0x3c')]+'%'};return _0x2bbb51;})});}_0x534584=_['merge']({},_0x534584,_0x451c81[_0x6fba('0x64')]);return _0x115e75['getChatInteractions'](_0x534584);}})['then'](function(_0x9b275a){if(_0x9b275a){_0x579799=_0x9b275a[_0x6fba('0x55')];if(!_0x451c81['query']['hasOwnProperty'](_0x6fba('0x56'))){_0x534584[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x451c81['query'][_0x6fba('0x30')]);_0x534584[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x451c81[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x115e75['getChatInteractions'](_0x534584);}})[_0x6fba('0x1e')](function(_0x3c0b29){if(_0x3c0b29){return _0x3c0b29?{'count':_0x579799,'rows':_0x3c0b29}:null;}})['then'](respondWithResult(_0x314240,null))['catch'](handleError(_0x314240,null));};exports[_0x6fba('0xcf')]=function(_0x2e021c,_0x56b024,_0x194bd9){var _0x379792={};var _0x135a7b={};var _0x407fc6;var _0x3b418e;return db['User'][_0x6fba('0xb9')]({'where':{'id':_0x2e021c[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x56b024,null))['then'](function(_0x161db5){if(_0x161db5){_0x407fc6=_0x161db5;_0x135a7b[_0x6fba('0x4a')]=_['keys'](db[_0x6fba('0xd0')][_0x6fba('0x49')]);_0x135a7b['query']=_[_0x6fba('0x4c')](_0x2e021c['query']);_0x135a7b[_0x6fba('0x52')]=_['intersection'](_0x135a7b[_0x6fba('0x4a')],_0x135a7b[_0x6fba('0x50')]);_0x379792[_0x6fba('0x53')]=_['intersection'](_0x135a7b[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x2e021c['query'][_0x6fba('0x54')]));_0x379792['attributes']=_0x379792[_0x6fba('0x53')][_0x6fba('0x55')]?_0x379792[_0x6fba('0x53')]:_0x135a7b['model'];_0x379792['order']=qs[_0x6fba('0x58')](_0x2e021c[_0x6fba('0x50')]['sort']);_0x379792[_0x6fba('0x59')]=qs['filters'](_[_0x6fba('0xbb')](_0x2e021c[_0x6fba('0x50')],_0x135a7b[_0x6fba('0x52')]));if(_0x2e021c[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x379792[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x379792[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x379792['attributes'],function(_0x43f289){var _0x34c3b5={};_0x34c3b5[_0x43f289]={'$like':'%'+_0x2e021c[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x34c3b5;})});}_0x379792=_[_0x6fba('0x5c')]({},_0x379792,_0x2e021c[_0x6fba('0x64')]);return _0x407fc6['getOpenchannelInteractions'](_0x379792);}})[_0x6fba('0x1e')](function(_0x1af45c){if(_0x1af45c){_0x3b418e=_0x1af45c[_0x6fba('0x55')];if(!_0x2e021c['query'][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x379792[_0x6fba('0x30')]=qs['limit'](_0x2e021c[_0x6fba('0x50')]['limit']);_0x379792[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x2e021c[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x407fc6[_0x6fba('0xcf')](_0x379792);}})['then'](function(_0x1ebbd3){if(_0x1ebbd3){return _0x1ebbd3?{'count':_0x3b418e,'rows':_0x1ebbd3}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x56b024,null))[_0x6fba('0x29')](handleError(_0x56b024,null));};exports[_0x6fba('0xd1')]=function(_0x11beec,_0x5a4fbe,_0x4778e2){var _0x2b50d3={'raw':!![],'where':{}};var _0x3b9dc2={};var _0x1c2b12={'count':0x0,'rows':[]};return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x11beec[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x5a4fbe,null))[_0x6fba('0x1e')](function(_0x1f8412){if(_0x1f8412){_0x3b9dc2['model']=_['keys'](db[_0x6fba('0xd2')][_0x6fba('0x49')]);_0x3b9dc2[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x11beec['query']);_0x3b9dc2[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x3b9dc2['model'],_0x3b9dc2[_0x6fba('0x50')]);_0x2b50d3[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x3b9dc2['model'],qs[_0x6fba('0x54')](_0x11beec[_0x6fba('0x50')]['fields']));_0x2b50d3[_0x6fba('0x53')]=_0x2b50d3[_0x6fba('0x53')][_0x6fba('0x55')]?_0x2b50d3['attributes']:_0x3b9dc2[_0x6fba('0x4a')];if(!_0x11beec[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x2b50d3['limit']=qs['limit'](_0x11beec[_0x6fba('0x50')]['limit']);_0x2b50d3[_0x6fba('0x2f')]=qs['offset'](_0x11beec[_0x6fba('0x50')][_0x6fba('0x2f')]);}_0x2b50d3['order']=qs[_0x6fba('0x58')](_0x11beec['query'][_0x6fba('0x58')]);_0x2b50d3['where']=qs['filters'](_[_0x6fba('0xbb')](_0x11beec['query'],_0x3b9dc2[_0x6fba('0x52')]));_0x2b50d3[_0x6fba('0x59')]['UserId']=_0x1f8412['id'];if(_0x11beec[_0x6fba('0x50')]['filter']){_0x2b50d3[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x2b50d3['where'],{'$or':_['map'](_0x2b50d3[_0x6fba('0x53')],function(_0x519304){var _0x1f0341={};_0x1f0341[_0x519304]={'$like':'%'+_0x11beec['query'][_0x6fba('0x3c')]+'%'};return _0x1f0341;})});}_0x2b50d3=_[_0x6fba('0x5c')]({},_0x2b50d3,_0x11beec[_0x6fba('0x64')]);return db[_0x6fba('0xd2')][_0x6fba('0x2e')]({'where':_0x2b50d3[_0x6fba('0x59')]})['then'](function(_0x40a9fc){_0x1c2b12['count']=_0x40a9fc;if(_0x11beec[_0x6fba('0x50')][_0x6fba('0xbd')]){_0x2b50d3[_0x6fba('0x61')]=[{'all':!![]}];}return db[_0x6fba('0xd2')][_0x6fba('0xa7')](_0x2b50d3);})[_0x6fba('0x1e')](function(_0x530729){_0x1c2b12[_0x6fba('0x62')]=_0x530729;return _0x1c2b12;});}})[_0x6fba('0x1e')](respondWithFilteredResult(_0x5a4fbe,_0x2b50d3))['catch'](handleError(_0x5a4fbe,null));};exports[_0x6fba('0xd3')]=function(_0x1545d3,_0x18bd9d,_0x1a95c7){var _0x50e106={};var _0x1e5fed={};var _0x3422c9;var _0x5f2aec;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x1545d3[_0x6fba('0x69')]['id']}})['then'](handleEntityNotFound(_0x18bd9d,null))[_0x6fba('0x1e')](function(_0x558edc){if(_0x558edc){_0x3422c9=_0x558edc;_0x1e5fed[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0xd4')]['rawAttributes']);_0x1e5fed[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x1545d3[_0x6fba('0x50')]);_0x1e5fed['filters']=_['intersection'](_0x1e5fed[_0x6fba('0x4a')],_0x1e5fed['query']);_0x50e106[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x1e5fed[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x1545d3['query'][_0x6fba('0x54')]));_0x50e106[_0x6fba('0x53')]=_0x50e106[_0x6fba('0x53')][_0x6fba('0x55')]?_0x50e106[_0x6fba('0x53')]:_0x1e5fed[_0x6fba('0x4a')];_0x50e106['order']=qs['sort'](_0x1545d3[_0x6fba('0x50')][_0x6fba('0x58')]);_0x50e106[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_[_0x6fba('0xbb')](_0x1545d3[_0x6fba('0x50')],_0x1e5fed[_0x6fba('0x52')]));if(_0x1545d3[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x50e106['where']=_[_0x6fba('0x5c')](_0x50e106[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x50e106[_0x6fba('0x53')],function(_0x31f62a){var _0x4a9c93={};_0x4a9c93[_0x31f62a]={'$like':'%'+_0x1545d3[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x4a9c93;})});}_0x50e106=_[_0x6fba('0x5c')]({},_0x50e106,_0x1545d3[_0x6fba('0x64')]);return _0x3422c9['getSmsInteractions'](_0x50e106);}})[_0x6fba('0x1e')](function(_0x3a6709){if(_0x3a6709){_0x5f2aec=_0x3a6709[_0x6fba('0x55')];if(!_0x1545d3[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x50e106['limit']=qs[_0x6fba('0x30')](_0x1545d3[_0x6fba('0x50')][_0x6fba('0x30')]);_0x50e106[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x1545d3[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x3422c9[_0x6fba('0xd3')](_0x50e106);}})[_0x6fba('0x1e')](function(_0x4a4b10){if(_0x4a4b10){return _0x4a4b10?{'count':_0x5f2aec,'rows':_0x4a4b10}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x18bd9d,null))['catch'](handleError(_0x18bd9d,null));};exports['getFaxInteractions']=function(_0x2f7931,_0x51f49a,_0x2c9f58){var _0x3062c4={};var _0x97fba8={};var _0x45ad70;var _0x20ebce;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x2f7931[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x51f49a,null))[_0x6fba('0x1e')](function(_0x197f6){if(_0x197f6){_0x45ad70=_0x197f6;_0x97fba8[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0xd5')]['rawAttributes']);_0x97fba8['query']=_[_0x6fba('0x4c')](_0x2f7931[_0x6fba('0x50')]);_0x97fba8['filters']=_[_0x6fba('0x63')](_0x97fba8[_0x6fba('0x4a')],_0x97fba8[_0x6fba('0x50')]);_0x3062c4[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x97fba8['model'],qs[_0x6fba('0x54')](_0x2f7931[_0x6fba('0x50')][_0x6fba('0x54')]));_0x3062c4[_0x6fba('0x53')]=_0x3062c4[_0x6fba('0x53')]['length']?_0x3062c4[_0x6fba('0x53')]:_0x97fba8[_0x6fba('0x4a')];_0x3062c4[_0x6fba('0x57')]=qs['sort'](_0x2f7931[_0x6fba('0x50')][_0x6fba('0x58')]);_0x3062c4['where']=qs[_0x6fba('0x52')](_['pick'](_0x2f7931['query'],_0x97fba8[_0x6fba('0x52')]));if(_0x2f7931['query'][_0x6fba('0x3c')]){_0x3062c4[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x3062c4[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x3062c4[_0x6fba('0x53')],function(_0x30354f){var _0x3fa633={};_0x3fa633[_0x30354f]={'$like':'%'+_0x2f7931[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x3fa633;})});}_0x3062c4=_[_0x6fba('0x5c')]({},_0x3062c4,_0x2f7931[_0x6fba('0x64')]);return _0x45ad70['getFaxInteractions'](_0x3062c4);}})[_0x6fba('0x1e')](function(_0x11a330){if(_0x11a330){_0x20ebce=_0x11a330[_0x6fba('0x55')];if(!_0x2f7931['query'][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x3062c4[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x2f7931[_0x6fba('0x50')]['limit']);_0x3062c4[_0x6fba('0x2f')]=qs['offset'](_0x2f7931[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x45ad70[_0x6fba('0xd6')](_0x3062c4);}})[_0x6fba('0x1e')](function(_0x3a65dc){if(_0x3a65dc){return _0x3a65dc?{'count':_0x20ebce,'rows':_0x3a65dc}:null;}})['then'](respondWithResult(_0x51f49a,null))[_0x6fba('0x29')](handleError(_0x51f49a,null));};exports['login']=function(_0x31cf6c,_0x4617b2,_0x250f56){var _0x11be03;var _0x41826f;var _0x1acb05;return db['User']['find']({'where':{'id':_0x31cf6c[_0x6fba('0x69')]['id'],'role':'agent'},'attributes':['id',_0x6fba('0x43'),'phone',_0x6fba('0xd7'),_0x6fba('0x41'),_0x6fba('0x76'),_0x6fba('0x9a')]})[_0x6fba('0x1e')](handleEntityNotFound(_0x4617b2,null))[_0x6fba('0x1e')](function(_0x143d77){if(_0x143d77){_0x11be03=_0x143d77;if(_0x31cf6c['body']['interface']){_0x1acb05=util[_0x6fba('0x74')](_0x6fba('0xd8'),_0x11be03[_0x31cf6c[_0x6fba('0x66')][_0x6fba('0xa9')]]);}else if(_0x31cf6c[_0x6fba('0x66')][_0x6fba('0xd9')]){_0x1acb05=util['format'](_0x6fba('0xa8'),_0x31cf6c[_0x6fba('0x66')][_0x6fba('0xd9')]);}else{_0x1acb05=util['format']('SIP/%s',_0x11be03[_0x6fba('0x43')]);}socket['to'](util['format'](_0x6fba('0xda'),_0x11be03['name']))[_0x6fba('0xa4')]('user:forcelogout',{'ip':_0x31cf6c[_0x6fba('0xdb')]['x-forwarded-for']||_0x31cf6c[_0x6fba('0xdc')][_0x6fba('0xdd')]||_0x31cf6c['socket'][_0x6fba('0xdd')]||_0x31cf6c[_0x6fba('0xdc')][_0x6fba('0xde')][_0x6fba('0xdd')]});return db['UserVoiceQueueRt'][_0x6fba('0x44')]({'where':{'membername':_0x11be03[_0x6fba('0x43')]},'individualHooks':!![]});}})[_0x6fba('0x1e')](function(_0x2315cd){if(_0x11be03){return _0x11be03[_0x6fba('0xdf')]({'raw':!![]});}})[_0x6fba('0x1e')](function(_0x34db30){var _0x89a409=[];if(_0x34db30){_0x41826f=_0x34db30;if(_0x41826f[_0x6fba('0x55')]){for(var _0x2bb9ef=0x0;_0x2bb9ef<_0x41826f['length'];_0x2bb9ef++){_0x89a409[_0x6fba('0xe0')]({'membername':_0x11be03['name'],'UserId':_0x11be03['id'],'queue_name':_0x41826f[_0x2bb9ef]['name'],'VoiceQueueId':_0x41826f[_0x2bb9ef]['id'],'interface':_0x1acb05,'paused':_0x11be03[_0x6fba('0x9a')]||![],'penalty':_0x41826f[_0x2bb9ef][_0x6fba('0xe1')]||0x0});}return BPromise['each'](_0x89a409,function(_0x570a8c){return db[_0x6fba('0xac')][_0x6fba('0xad')](_0x570a8c);});}}})[_0x6fba('0x1e')](function(){return db['MemberReport'][_0x6fba('0xa7')]({'where':{'membername':_0x11be03[_0x6fba('0x43')],'exitAt':null}});})[_0x6fba('0x1e')](function(_0x53f102){var _0x2c4c2a=[];_0x53f102['forEach'](function(_0x3af1bd){_0x2c4c2a[_0x6fba('0xe0')](_0x3af1bd['update']({'exitAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2'))}));});return BPromise['all'](_0x2c4c2a);})[_0x6fba('0x1e')](function(){var _0x241d4d=[];var _0x366611=[];var _0x4a588e=utils[_0x6fba('0xe3')]();var _0x24d9e8={'membername':_0x11be03[_0x6fba('0x43')],'interface':_0x1acb05,'enterAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2')),'role':_0x11be03['role'],'internal':_0x11be03[_0x6fba('0x76')]};_0x4a588e['forEach'](function(_0x5ec8d5){_0x241d4d[_0x6fba('0xe0')](_[_0x6fba('0x5c')]({'channel':_0x5ec8d5,'type':_0x6fba('0xe4'),'data1':_0x31cf6c[_0x6fba('0x66')][_0x6fba('0xe5')],'data2':_0x1acb05},_0x24d9e8));if(_0x11be03[_0x6fba('0x9a')]){_0x366611[_0x6fba('0xe0')](_[_0x6fba('0x5c')]({'channel':_0x5ec8d5,'type':_0x6fba('0xe6'),'data1':_0x6fba('0xe7')},_0x24d9e8));}});return db[_0x6fba('0xe8')]['bulkCreate'](_0x241d4d[_0x6fba('0xe9')](_0x366611),{'individualHooks':!![]});})[_0x6fba('0x1e')](function(){return _0x11be03[_0x6fba('0x35')]({'online':!![],'lastLoginAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2')),'voicePause':_0x11be03['loginInPause']||![],'mailPause':_0x11be03[_0x6fba('0x9a')]||![],'chatPause':_0x11be03[_0x6fba('0x9a')]||![],'faxPause':_0x11be03[_0x6fba('0x9a')]||![],'smsPause':_0x11be03[_0x6fba('0x9a')]||![],'openchannelPause':_0x11be03[_0x6fba('0x9a')]||![],'pauseType':_0x11be03[_0x6fba('0x9a')]?'LOGININPAUSE':null,'interface':_0x1acb05,'lastPauseAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2'))});})['then'](respondWithResult(_0x4617b2,null))['catch'](handleError(_0x4617b2,null));};exports[_0x6fba('0xea')]=function(_0x31cc63,_0x885083,_0x491fff){var _0x55206a;return db['User'][_0x6fba('0x42')]({'where':{'id':_0x31cc63[_0x6fba('0x69')]['id'],'role':_0x6fba('0x3a')},'attributes':['id','name',_0x6fba('0x41')]})[_0x6fba('0x1e')](handleEntityNotFound(_0x885083,null))[_0x6fba('0x1e')](function(_0x419f37){if(_0x419f37){_0x55206a=_0x419f37;return db[_0x6fba('0xac')][_0x6fba('0x44')]({'where':{'membername':_0x55206a['name']},'individualHooks':!![]});}})[_0x6fba('0x1e')](function(){return db[_0x6fba('0xe8')][_0x6fba('0xa7')]({'where':{'membername':_0x55206a[_0x6fba('0x43')],'exitAt':null}});})[_0x6fba('0x1e')](function(_0x27da4d){var _0x4e7ec9=[];_0x27da4d[_0x6fba('0xeb')](function(_0x243880){_0x4e7ec9[_0x6fba('0xe0')](_0x243880[_0x6fba('0x35')]({'exitAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2'))}));});return BPromise[_0x6fba('0xec')](_0x4e7ec9);})['then'](function(){return _0x55206a[_0x6fba('0x35')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x885083,null))[_0x6fba('0x29')](handleError(_0x885083,null));};exports[_0x6fba('0xed')]=function(_0x4521b1,_0x21b55b,_0x45fc4d){var _0x35ad9b;return db[_0x6fba('0xac')][_0x6fba('0x35')]({'paused':0x1},{'where':{'UserId':_0x4521b1[_0x6fba('0x69')]['id']},'individualHooks':!![]})[_0x6fba('0x1e')](function(){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x4521b1[_0x6fba('0x69')]['id'],'role':_0x6fba('0x3a')},'attributes':['id',_0x6fba('0x43'),_0x6fba('0x41'),_0x6fba('0x76'),'interface']});})[_0x6fba('0x1e')](handleEntityNotFound(_0x21b55b,null))['then'](function(_0x42224f){if(_0x42224f){_0x35ad9b=_0x42224f;return respondWithRpcPromise(_0x6fba('0xee'),_0x6fba('0xed'),{'id':_0x35ad9b['id'],'name':_0x35ad9b['name'],'pause':!![]});}})[_0x6fba('0x1e')](function(){if(_0x35ad9b){return db[_0x6fba('0xe8')][_0x6fba('0xa7')]({'where':{'membername':_0x35ad9b[_0x6fba('0x43')],'type':_0x6fba('0xe6'),'exitAt':null}});}})[_0x6fba('0x1e')](function(_0x5470d0){if(_0x5470d0[_0x6fba('0x55')]){var _0x2c1ad4=moment()[_0x6fba('0x74')](_0x6fba('0xe2'));for(var _0x331bc3=0x0,_0x405c1a=_0x5470d0['length'];_0x331bc3<_0x405c1a;_0x331bc3++){_0x5470d0[_0x331bc3][_0x6fba('0xef')]({'exitAt':_0x2c1ad4});}}})[_0x6fba('0x1e')](function(){var _0x25df64=[];var _0x3e9c01=utils[_0x6fba('0xe3')]();_0x3e9c01[_0x6fba('0xeb')](function(_0x20e067){_0x25df64[_0x6fba('0xe0')]({'channel':_0x20e067,'membername':_0x35ad9b[_0x6fba('0x43')],'interface':_['isNil'](_0x35ad9b[_0x6fba('0xa9')])?util['format']('SIP/%s',_0x35ad9b[_0x6fba('0x43')]):_0x35ad9b[_0x6fba('0xa9')],'type':_0x6fba('0xe6'),'enterAt':moment()['format'](_0x6fba('0xe2')),'data1':_0x4521b1[_0x6fba('0x66')][_0x6fba('0xf0')]||_0x6fba('0xf1'),'role':_0x35ad9b['role'],'internal':_0x35ad9b['internal']});});return db[_0x6fba('0xe8')][_0x6fba('0x65')](_0x25df64,{'individualHooks':!![]});})['then'](function(){return _0x35ad9b['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4521b1[_0x6fba('0x66')][_0x6fba('0xf0')]||_0x6fba('0xf1'),'lastPauseAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2'))});})[_0x6fba('0x1e')](respondWithResult(_0x21b55b,null))[_0x6fba('0x29')](handleError(_0x21b55b,null));};exports[_0x6fba('0xf2')]=function(_0x4543f8,_0x544757,_0x38d3f9){var _0x426cc6;return db['User'][_0x6fba('0x42')]({'where':{'id':_0x4543f8[_0x6fba('0x69')]['id']},'attributes':['id',_0x6fba('0x43'),_0x6fba('0x41'),'voicePause','mailPause','chatPause',_0x6fba('0xf3'),'openchannelPause',_0x6fba('0xf4'),_0x6fba('0xf5'),'lastPauseAt']})[_0x6fba('0x1e')](handleEntityNotFound(_0x544757,null))['then'](function(_0x9bd12){if(_0x9bd12){_0x426cc6=_0x9bd12;if(_0x4543f8[_0x6fba('0x66')][_0x6fba('0x9d')]&&!utils[_0x6fba('0x9b')](_0x4543f8[_0x6fba('0x66')][_0x6fba('0x9d')])){throw new db[(_0x6fba('0x94'))][(_0x6fba('0x96'))](_0x6fba('0x9c'));}switch(_0x4543f8[_0x6fba('0x66')][_0x6fba('0x9d')]){case'voice':return respondWithRpcPromise(_0x6fba('0xee'),'unpause',{'id':_0x426cc6['id'],'name':_0x426cc6[_0x6fba('0x43')],'pause':![]})[_0x6fba('0x1e')](function(){return db[_0x6fba('0xac')][_0x6fba('0x35')]({'paused':0x0},{'where':{'UserId':_0x426cc6['id']},'individualHooks':!![]});})[_0x6fba('0x1e')](function(){return db[_0x6fba('0xe8')][_0x6fba('0x42')]({'where':{'channel':_0x4543f8[_0x6fba('0x66')][_0x6fba('0x9d')],'membername':_0x426cc6[_0x6fba('0x43')],'type':_0x6fba('0xe6'),'exitAt':null}});})['then'](function(_0x5cbcec){if(_0x5cbcec){return _0x5cbcec['update']({'exitAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2')),'data2':_0x6fba('0xf6')},{'individualHooks':!![]});}return null;})[_0x6fba('0x1e')](function(){return _0x426cc6[_0x6fba('0x35')]({'voicePause':![]});});case _0x6fba('0xf7'):case _0x6fba('0xf8'):case _0x6fba('0xf9'):case _0x6fba('0xfa'):case'openchannel':return db['MemberReport']['find']({'where':{'channel':_0x4543f8[_0x6fba('0x66')][_0x6fba('0x9d')],'membername':_0x426cc6[_0x6fba('0x43')],'type':'PAUSE','exitAt':null}})[_0x6fba('0x1e')](function(_0x146b48){if(_0x146b48){return _0x146b48[_0x6fba('0x35')]({'exitAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2')),'data2':_0x6fba('0xf6')},{'individualHooks':!![]});}return null;})[_0x6fba('0x1e')](function(){var _0x875e76={};_['set'](_0x875e76,util[_0x6fba('0x74')](_0x6fba('0xfb'),_0x4543f8[_0x6fba('0x66')]['channel'],_0x6fba('0xfc')),![]);return _0x426cc6['update'](_0x875e76);});default:return respondWithRpcPromise(_0x6fba('0xee'),_0x6fba('0xf2'),{'id':_0x426cc6['id'],'name':_0x426cc6['name'],'pause':![]})[_0x6fba('0x1e')](function(){return db[_0x6fba('0xac')][_0x6fba('0x35')]({'paused':0x0},{'where':{'UserId':_0x426cc6['id']}});})[_0x6fba('0x1e')](function(){return db[_0x6fba('0xe8')]['findAll']({'where':{'membername':_0x426cc6[_0x6fba('0x43')],'type':_0x6fba('0xe6'),'exitAt':null}});})['then'](function(_0x4d79ba){var _0x16b7f4=[];_0x4d79ba[_0x6fba('0xeb')](function(_0x33b6f8){_0x16b7f4[_0x6fba('0xe0')](_0x33b6f8[_0x6fba('0x35')]({'exitAt':moment()[_0x6fba('0x74')](_0x6fba('0xe2')),'data2':_0x6fba('0xf6')}));});return BPromise[_0x6fba('0xec')](_0x16b7f4);})[_0x6fba('0x1e')](function(){return _0x426cc6['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x6fba('0x1e')](respondWithResult(_0x544757,null))[_0x6fba('0x29')](handleError(_0x544757,null));};exports['getTeams']=function(_0xf33ea2,_0x1ab106,_0x1389d2){var _0x5123ac={};var _0x3d1717={};var _0x2d9f00;var _0x17310b;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0xf33ea2[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x1ab106,null))[_0x6fba('0x1e')](function(_0x54a59a){if(_0x54a59a){_0x2d9f00=_0x54a59a;_0x3d1717[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0xfd')][_0x6fba('0x49')]);_0x3d1717[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0xf33ea2[_0x6fba('0x50')]);_0x3d1717['filters']=_[_0x6fba('0x63')](_0x3d1717[_0x6fba('0x4a')],_0x3d1717[_0x6fba('0x50')]);_0x5123ac[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x3d1717['model'],qs[_0x6fba('0x54')](_0xf33ea2[_0x6fba('0x50')][_0x6fba('0x54')]));_0x5123ac[_0x6fba('0x53')]=_0x5123ac[_0x6fba('0x53')][_0x6fba('0x55')]?_0x5123ac[_0x6fba('0x53')]:_0x3d1717[_0x6fba('0x4a')];_0x5123ac['order']=qs[_0x6fba('0x58')](_0xf33ea2[_0x6fba('0x50')][_0x6fba('0x58')]);_0x5123ac['where']=qs['filters'](_[_0x6fba('0xbb')](_0xf33ea2['query'],_0x3d1717[_0x6fba('0x52')]));if(_0xf33ea2[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x5123ac['where']=_['merge'](_0x5123ac[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x5123ac[_0x6fba('0x53')],function(_0xa32185){var _0x5ba243={};_0x5ba243[_0xa32185]={'$like':'%'+_0xf33ea2['query'][_0x6fba('0x3c')]+'%'};return _0x5ba243;})});}_0x5123ac=_[_0x6fba('0x5c')]({},_0x5123ac,_0xf33ea2[_0x6fba('0x64')]);return _0x2d9f00[_0x6fba('0xfe')](_0x5123ac);}})['then'](function(_0x15cb41){if(_0x15cb41){_0x17310b=_0x15cb41['length'];if(!_0xf33ea2[_0x6fba('0x50')]['hasOwnProperty']('nolimit')){_0x5123ac[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0xf33ea2[_0x6fba('0x50')][_0x6fba('0x30')]);_0x5123ac['offset']=qs['offset'](_0xf33ea2['query'][_0x6fba('0x2f')]);}return _0x2d9f00[_0x6fba('0xfe')](_0x5123ac);}})['then'](function(_0x49a341){if(_0x49a341){return _0x49a341?{'count':_0x17310b,'rows':_0x49a341}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x1ab106,null))[_0x6fba('0x29')](handleError(_0x1ab106,null));};exports[_0x6fba('0xff')]=function(_0x50908a,_0x55fc59,_0x2d30c1){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x50908a['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x55fc59,null))['then'](function(_0x412ddd){if(_0x412ddd){return _0x412ddd[_0x6fba('0xff')](_0x50908a['body'][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x50908a['body'],[_0x6fba('0x6a'),'id'])||{});}})[_0x6fba('0x1e')](respondWithResult(_0x55fc59,null))[_0x6fba('0x29')](handleError(_0x55fc59,null));};exports[_0x6fba('0x100')]=function(_0x1eab5c,_0x48461b,_0x5a943a){var _0x555d3c;return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x1eab5c[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x48461b,null))['then'](function(_0x21d8f5){if(_0x21d8f5){return _0x21d8f5[_0x6fba('0x100')](_0x1eab5c[_0x6fba('0x50')][_0x6fba('0x6a')]);}})[_0x6fba('0x1e')](respondWithStatusCode(_0x48461b,null))[_0x6fba('0x29')](handleError(_0x48461b,null));};exports[_0x6fba('0x101')]=function(_0xf1c6b6,_0x1af3e0,_0x7c31a6){var _0x9148e4={};var _0x4bff68={};var _0x40e840;var _0x180c40;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0xf1c6b6['params']['id']}})['then'](handleEntityNotFound(_0x1af3e0,null))['then'](function(_0x3b50d6){if(_0x3b50d6){_0x40e840=_0x3b50d6;_0x4bff68['model']=_[_0x6fba('0x4c')](db[_0x6fba('0xbe')][_0x6fba('0x49')]);_0x4bff68[_0x6fba('0x50')]=_['keys'](_0xf1c6b6['query']);_0x4bff68[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x4bff68[_0x6fba('0x4a')],_0x4bff68[_0x6fba('0x50')]);_0x9148e4[_0x6fba('0x53')]=_['intersection'](_0x4bff68['model'],qs[_0x6fba('0x54')](_0xf1c6b6[_0x6fba('0x50')][_0x6fba('0x54')]));_0x9148e4[_0x6fba('0x53')]=_0x9148e4[_0x6fba('0x53')]['length']?_0x9148e4['attributes']:_0x4bff68['model'];_0x9148e4[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0xf1c6b6[_0x6fba('0x50')][_0x6fba('0x58')]);_0x9148e4[_0x6fba('0x59')]=qs['filters'](_[_0x6fba('0xbb')](_0xf1c6b6[_0x6fba('0x50')],_0x4bff68['filters']));if(_0xf1c6b6[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x9148e4[_0x6fba('0x59')]=_['merge'](_0x9148e4[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x9148e4['attributes'],function(_0x1daecd){var _0x1847e6={};_0x1847e6[_0x1daecd]={'$like':'%'+_0xf1c6b6[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x1847e6;})});}_0x9148e4=_[_0x6fba('0x5c')]({},_0x9148e4,_0xf1c6b6[_0x6fba('0x64')]);return _0x40e840[_0x6fba('0x101')](_0x9148e4);}})[_0x6fba('0x1e')](function(_0x1328fe){if(_0x1328fe){_0x180c40=_0x1328fe[_0x6fba('0x55')];if(!_0xf1c6b6[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x9148e4[_0x6fba('0x30')]=qs['limit'](_0xf1c6b6['query'][_0x6fba('0x30')]);_0x9148e4[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0xf1c6b6[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x40e840[_0x6fba('0x101')](_0x9148e4);}})['then'](function(_0xb3c276){if(_0xb3c276){return _0xb3c276?{'count':_0x180c40,'rows':_0xb3c276}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x1af3e0,null))['catch'](handleError(_0x1af3e0,null));};exports[_0x6fba('0x102')]=function(_0x5595d7,_0x52b2c3,_0x5d0d8b){var _0x3a5acf={};var _0x385a4f={};var _0xb60530;var _0x2f7bf;return db[_0x6fba('0x48')]['findOne']({'where':{'id':_0x5595d7[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x52b2c3,null))[_0x6fba('0x1e')](function(_0x1827e3){if(_0x1827e3){_0xb60530=_0x1827e3;_0x385a4f[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0x48')][_0x6fba('0x49')]);_0x385a4f[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x5595d7[_0x6fba('0x50')]);_0x385a4f[_0x6fba('0x52')]=_['intersection'](_0x385a4f['model'],_0x385a4f[_0x6fba('0x50')]);_0x3a5acf[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x385a4f['model'],qs[_0x6fba('0x54')](_0x5595d7[_0x6fba('0x50')]['fields']));_0x3a5acf['attributes']=_0x3a5acf['attributes'][_0x6fba('0x55')]?_0x3a5acf['attributes']:_0x385a4f[_0x6fba('0x4a')];_0x3a5acf[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x5595d7[_0x6fba('0x50')][_0x6fba('0x58')]);_0x3a5acf[_0x6fba('0x59')]=qs['filters'](_['pick'](_0x5595d7[_0x6fba('0x50')],_0x385a4f['filters']));if(_0x5595d7[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x3a5acf[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x3a5acf['where'],{'$or':_['map'](_0x3a5acf[_0x6fba('0x53')],function(_0x13afe2){var _0x53d52a={};_0x53d52a[_0x13afe2]={'$like':'%'+_0x5595d7[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x53d52a;})});}_0x3a5acf[_0x6fba('0x4a')]=db[_0x6fba('0x48')];_0x3a5acf['as']=_0x6fba('0x39');_0x3a5acf=_['merge']({},_0x3a5acf,_0x5595d7[_0x6fba('0x64')]);return _0xb60530[_0x6fba('0xdf')]({'include':[_0x3a5acf]});}})[_0x6fba('0x1e')](function(_0x344050){if(_0x344050){var _0x50ebab={},_0x1f5f70=[],_0x35ab5e=0x0;for(var _0x550d0e=0x0;_0x550d0e<_0x344050['length'];_0x550d0e+=0x1){for(var _0x410af6=0x0,_0x24801b;_0x410af6<_0x344050[_0x550d0e][_0x6fba('0x39')]['length'];_0x410af6+=0x1){_0x24801b=_0x344050[_0x550d0e][_0x6fba('0x39')][_0x410af6][_0x6fba('0x36')]({'plain':!![]});_0x50ebab[_0x24801b['id']]=_0x24801b;}}_0x50ebab=_[_0x6fba('0x103')](_0x50ebab);for(var _0x5e2ce0=qs[_0x6fba('0x2f')](_0x5595d7[_0x6fba('0x50')][_0x6fba('0x2f')]);_0x5e2ce0<_0x50ebab[_0x6fba('0x55')]&&_0x1f5f70[_0x6fba('0x55')]<qs[_0x6fba('0x30')](_0x5595d7[_0x6fba('0x50')]['limit']);_0x5e2ce0+=0x1){if(_0x50ebab[_0x5e2ce0]){_0x1f5f70['push'](_0x50ebab[_0x5e2ce0]);}}return{'count':_0x50ebab[_0x6fba('0x55')],'rows':_0x1f5f70};}})['then'](respondWithResult(_0x52b2c3,null))[_0x6fba('0x29')](handleError(_0x52b2c3,null));};exports['destroy']=function(_0xe9e2f4,_0x2f9ee3){if(_0xe9e2f4['user']['id']==_0xe9e2f4[_0x6fba('0x69')]['id']){return _0x2f9ee3['status'](0x1f4)[_0x6fba('0x46')]({'message':_0x6fba('0x104')});}return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0xe9e2f4[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x2f9ee3,null))[_0x6fba('0x1e')](removeEntity(_0x2f9ee3,null))[_0x6fba('0x29')](handleError(_0x2f9ee3,null));};exports[_0x6fba('0x105')]=function(_0x3dea54,_0x3ce75b,_0x225c99){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x3dea54[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x3ce75b,null))[_0x6fba('0x1e')](function(_0x246be7){if(_0x246be7){return _0x246be7[_0x6fba('0x105')](_0x3dea54[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x3dea54[_0x6fba('0x66')],['ids','id'])||{})['spread'](function(){for(var _0x4e0c90=0x0;_0x4e0c90<_0x3dea54[_0x6fba('0x66')][_0x6fba('0x6a')][_0x6fba('0x55')];_0x4e0c90+=0x1){socket[_0x6fba('0xa4')](_0x6fba('0x106'),{'ChatInteractionId':Number(_0x3dea54[_0x6fba('0x66')]['ids'][_0x4e0c90]),'UserId':Number(_0x3dea54[_0x6fba('0x69')]['id'])});}return _0x3dea54['body'][_0x6fba('0x6a')];});}})[_0x6fba('0x1e')](respondWithResult(_0x3ce75b,null))[_0x6fba('0x29')](handleError(_0x3ce75b,null));};exports[_0x6fba('0x107')]=function(_0x47b180,_0x2724e3,_0x1b4dcf){var _0x102d0a;return db['User'][_0x6fba('0x42')]({'where':{'id':_0x47b180[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x2724e3,null))[_0x6fba('0x1e')](function(_0x2e1cb2){if(_0x2e1cb2){return _0x2e1cb2[_0x6fba('0x107')](_0x47b180[_0x6fba('0x50')][_0x6fba('0x6a')])[_0x6fba('0x1e')](function(_0xb5f15e){if(_['isArray'](_0x47b180[_0x6fba('0x50')][_0x6fba('0x6a')])){for(var _0x278ab4=0x0;_0x278ab4<_0x47b180[_0x6fba('0x50')]['ids'][_0x6fba('0x55')];_0x278ab4+=0x1){socket[_0x6fba('0xa4')](_0x6fba('0x108'),{'ChatInteractionId':Number(_0x47b180[_0x6fba('0x50')]['ids'][_0x278ab4]),'UserId':Number(_0x47b180[_0x6fba('0x69')]['id'])});}}else{socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x47b180['query']['ids']),'UserId':Number(_0x47b180['params']['id'])});}});}})[_0x6fba('0x1e')](respondWithStatusCode(_0x2724e3,null))[_0x6fba('0x29')](handleError(_0x2724e3,null));};exports['addMailInteractions']=function(_0x56b44e,_0x327df3,_0x325ed1){return db['User']['find']({'where':{'id':_0x56b44e[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x327df3,null))['then'](function(_0x176946){if(_0x176946){return _0x176946[_0x6fba('0x109')](_0x56b44e[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x56b44e[_0x6fba('0x66')],[_0x6fba('0x6a'),'id'])||{})['spread'](function(){for(var _0x4f40e0=0x0;_0x4f40e0<_0x56b44e[_0x6fba('0x66')][_0x6fba('0x6a')][_0x6fba('0x55')];_0x4f40e0+=0x1){socket['emit'](_0x6fba('0x10a'),{'MailInteractionId':Number(_0x56b44e[_0x6fba('0x66')][_0x6fba('0x6a')][_0x4f40e0]),'UserId':Number(_0x56b44e[_0x6fba('0x69')]['id'])});}return _0x56b44e[_0x6fba('0x66')][_0x6fba('0x6a')];});}})['then'](respondWithResult(_0x327df3,null))[_0x6fba('0x29')](handleError(_0x327df3,null));};exports[_0x6fba('0x10b')]=function(_0xe5b9eb,_0x1a329a,_0x22fbf9){var _0x3a9813;return db['User'][_0x6fba('0x42')]({'where':{'id':_0xe5b9eb['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x1a329a,null))['then'](function(_0x5933bf){if(_0x5933bf){return _0x5933bf['removeMailInteractions'](_0xe5b9eb[_0x6fba('0x50')][_0x6fba('0x6a')])['then'](function(_0x418efa){if(_[_0x6fba('0x10c')](_0xe5b9eb[_0x6fba('0x50')][_0x6fba('0x6a')])){for(var _0x304e8c=0x0;_0x304e8c<_0xe5b9eb[_0x6fba('0x50')][_0x6fba('0x6a')][_0x6fba('0x55')];_0x304e8c+=0x1){socket[_0x6fba('0xa4')](_0x6fba('0x10d'),{'MailInteractionId':Number(_0xe5b9eb[_0x6fba('0x50')][_0x6fba('0x6a')][_0x304e8c]),'UserId':Number(_0xe5b9eb[_0x6fba('0x69')]['id'])});}}else{socket[_0x6fba('0xa4')](_0x6fba('0x10d'),{'MailInteractionId':Number(_0xe5b9eb[_0x6fba('0x50')][_0x6fba('0x6a')]),'UserId':Number(_0xe5b9eb[_0x6fba('0x69')]['id'])});}});}})[_0x6fba('0x1e')](respondWithStatusCode(_0x1a329a,null))[_0x6fba('0x29')](handleError(_0x1a329a,null));};exports['addFaxInteractions']=function(_0x72f5b0,_0x38f1d5,_0x5140a8){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x72f5b0[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x38f1d5,null))['then'](function(_0x49a0f1){if(_0x49a0f1){return _0x49a0f1[_0x6fba('0x10e')](_0x72f5b0[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x72f5b0['body'],[_0x6fba('0x6a'),'id'])||{})['spread'](function(){for(var _0x4e5f85=0x0;_0x4e5f85<_0x72f5b0['body'][_0x6fba('0x6a')][_0x6fba('0x55')];_0x4e5f85+=0x1){socket[_0x6fba('0xa4')](_0x6fba('0x10f'),{'FaxInteractionId':Number(_0x72f5b0[_0x6fba('0x66')][_0x6fba('0x6a')][_0x4e5f85]),'UserId':Number(_0x72f5b0[_0x6fba('0x69')]['id'])});}return _0x72f5b0[_0x6fba('0x66')]['ids'];});}})[_0x6fba('0x1e')](respondWithResult(_0x38f1d5,null))[_0x6fba('0x29')](handleError(_0x38f1d5,null));};exports[_0x6fba('0x110')]=function(_0x2958c5,_0x2cc59d,_0x16ad45){var _0x41dbbd;return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x2958c5[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x2cc59d,null))[_0x6fba('0x1e')](function(_0x1e76ba){if(_0x1e76ba){return _0x1e76ba[_0x6fba('0x110')](_0x2958c5['query'][_0x6fba('0x6a')])['then'](function(_0x1400f9){if(_[_0x6fba('0x10c')](_0x2958c5[_0x6fba('0x50')][_0x6fba('0x6a')])){for(var _0x4bf30b=0x0;_0x4bf30b<_0x2958c5[_0x6fba('0x50')][_0x6fba('0x6a')][_0x6fba('0x55')];_0x4bf30b+=0x1){socket[_0x6fba('0xa4')](_0x6fba('0x111'),{'FaxInteractionId':Number(_0x2958c5[_0x6fba('0x50')][_0x6fba('0x6a')][_0x4bf30b]),'UserId':Number(_0x2958c5['params']['id'])});}}else{socket[_0x6fba('0xa4')](_0x6fba('0x111'),{'FaxInteractionId':Number(_0x2958c5['query']['ids']),'UserId':Number(_0x2958c5[_0x6fba('0x69')]['id'])});}});}})[_0x6fba('0x1e')](respondWithStatusCode(_0x2cc59d,null))[_0x6fba('0x29')](handleError(_0x2cc59d,null));};exports[_0x6fba('0x112')]=function(_0x59b030,_0x132720,_0x17bb3e){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x59b030[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x132720,null))['then'](function(_0x1a628f){if(_0x1a628f){return _0x1a628f[_0x6fba('0x112')](_0x59b030[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x59b030['body'],[_0x6fba('0x6a'),'id'])||{})['spread'](function(){for(var _0x348b61=0x0;_0x348b61<_0x59b030[_0x6fba('0x66')][_0x6fba('0x6a')][_0x6fba('0x55')];_0x348b61+=0x1){socket[_0x6fba('0xa4')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x59b030[_0x6fba('0x66')]['ids'][_0x348b61]),'UserId':Number(_0x59b030[_0x6fba('0x69')]['id'])});}return _0x59b030[_0x6fba('0x66')]['ids'];});}})[_0x6fba('0x1e')](respondWithResult(_0x132720,null))['catch'](handleError(_0x132720,null));};exports['removeSmsInteractions']=function(_0x58ac51,_0x5df634,_0x1ed668){var _0x43229e;return db['User'][_0x6fba('0x42')]({'where':{'id':_0x58ac51[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x5df634,null))[_0x6fba('0x1e')](function(_0x4d5d5a){if(_0x4d5d5a){return _0x4d5d5a[_0x6fba('0x113')](_0x58ac51[_0x6fba('0x50')][_0x6fba('0x6a')])[_0x6fba('0x1e')](function(_0x480ad7){if(_['isArray'](_0x58ac51['query']['ids'])){for(var _0x1655b0=0x0;_0x1655b0<_0x58ac51[_0x6fba('0x50')][_0x6fba('0x6a')][_0x6fba('0x55')];_0x1655b0+=0x1){socket[_0x6fba('0xa4')](_0x6fba('0x114'),{'SmsInteractionId':Number(_0x58ac51[_0x6fba('0x50')][_0x6fba('0x6a')][_0x1655b0]),'UserId':Number(_0x58ac51[_0x6fba('0x69')]['id'])});}}else{socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x58ac51[_0x6fba('0x50')][_0x6fba('0x6a')]),'UserId':Number(_0x58ac51[_0x6fba('0x69')]['id'])});}});}})[_0x6fba('0x1e')](respondWithStatusCode(_0x5df634,null))[_0x6fba('0x29')](handleError(_0x5df634,null));};exports['addOpenchannelInteractions']=function(_0x5be762,_0x469901,_0x1d92f2){return db['User'][_0x6fba('0x42')]({'where':{'id':_0x5be762['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x469901,null))[_0x6fba('0x1e')](function(_0x51182f){if(_0x51182f){return _0x51182f[_0x6fba('0x115')](_0x5be762[_0x6fba('0x66')][_0x6fba('0x6a')],_['omit'](_0x5be762[_0x6fba('0x66')],['ids','id'])||{})[_0x6fba('0xa1')](function(){for(var _0xd0438d=0x0;_0xd0438d<_0x5be762[_0x6fba('0x66')]['ids'][_0x6fba('0x55')];_0xd0438d+=0x1){socket[_0x6fba('0xa4')](_0x6fba('0x116'),{'OpenchannelInteractionId':Number(_0x5be762[_0x6fba('0x66')]['ids'][_0xd0438d]),'UserId':Number(_0x5be762[_0x6fba('0x69')]['id'])});}return _0x5be762['body'][_0x6fba('0x6a')];});}})[_0x6fba('0x1e')](respondWithResult(_0x469901,null))['catch'](handleError(_0x469901,null));};exports[_0x6fba('0x117')]=function(_0x18d725,_0x511e73,_0x3f5c6d){var _0x158f44;return db[_0x6fba('0x48')]['find']({'where':{'id':_0x18d725[_0x6fba('0x69')]['id']}})['then'](handleEntityNotFound(_0x511e73,null))['then'](function(_0x35d611){if(_0x35d611){return _0x35d611['removeOpenchannelInteractions'](_0x18d725['query'][_0x6fba('0x6a')])[_0x6fba('0x1e')](function(_0x5c224d){if(_[_0x6fba('0x10c')](_0x18d725['query'][_0x6fba('0x6a')])){for(var _0x14b0d4=0x0;_0x14b0d4<_0x18d725[_0x6fba('0x50')]['ids']['length'];_0x14b0d4+=0x1){socket['emit'](_0x6fba('0x118'),{'OpenchannelInteractionId':Number(_0x18d725['query']['ids'][_0x14b0d4]),'UserId':Number(_0x18d725[_0x6fba('0x69')]['id'])});}}else{socket[_0x6fba('0xa4')](_0x6fba('0x118'),{'OpenchannelInteractionId':Number(_0x18d725['query'][_0x6fba('0x6a')]),'UserId':Number(_0x18d725['params']['id'])});}});}})[_0x6fba('0x1e')](respondWithStatusCode(_0x511e73,null))['catch'](handleError(_0x511e73,null));};exports[_0x6fba('0x119')]=function(_0x297339,_0x459212,_0x36165f){var _0x4613a1={};var _0x2dc792={};var _0x35bfe2;var _0x2c3856;return db['User'][_0x6fba('0xb9')]({'where':{'id':_0x297339[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x459212,null))[_0x6fba('0x1e')](function(_0x5a8e2b){if(_0x5a8e2b){_0x35bfe2=_0x5a8e2b;_0x2dc792['model']=_['keys'](db['VoicePrefix']['rawAttributes']);_0x2dc792['query']=_['keys'](_0x297339['query']);_0x2dc792[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x2dc792['model'],_0x2dc792['query']);_0x4613a1[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x2dc792[_0x6fba('0x4a')],qs['fields'](_0x297339[_0x6fba('0x50')][_0x6fba('0x54')]));_0x4613a1[_0x6fba('0x53')]=_0x4613a1[_0x6fba('0x53')][_0x6fba('0x55')]?_0x4613a1[_0x6fba('0x53')]:_0x2dc792[_0x6fba('0x4a')];_0x4613a1[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x297339[_0x6fba('0x50')][_0x6fba('0x58')]);_0x4613a1[_0x6fba('0x59')]=qs['filters'](_[_0x6fba('0xbb')](_0x297339[_0x6fba('0x50')],_0x2dc792[_0x6fba('0x52')]));if(_0x297339['query'][_0x6fba('0x3c')]){_0x4613a1[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x4613a1[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x4613a1[_0x6fba('0x53')],function(_0x1ae7fd){var _0x525009={};_0x525009[_0x1ae7fd]={'$like':'%'+_0x297339['query'][_0x6fba('0x3c')]+'%'};return _0x525009;})});}_0x4613a1=_[_0x6fba('0x5c')]({},_0x4613a1,_0x297339[_0x6fba('0x64')]);return _0x35bfe2[_0x6fba('0x119')](_0x4613a1);}})[_0x6fba('0x1e')](function(_0x51d53e){if(_0x51d53e){_0x2c3856=_0x51d53e['length'];if(!_0x297339[_0x6fba('0x50')][_0x6fba('0xbc')]('nolimit')){_0x4613a1[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x297339['query'][_0x6fba('0x30')]);_0x4613a1[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x297339[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x35bfe2[_0x6fba('0x119')](_0x4613a1);}})[_0x6fba('0x1e')](function(_0x140b2d){if(_0x140b2d){return _0x140b2d?{'count':_0x2c3856,'rows':_0x140b2d}:null;}})['then'](respondWithResult(_0x459212,null))[_0x6fba('0x29')](handleError(_0x459212,null));};exports['getFaxAccounts']=function(_0x55149f,_0x3e1a25,_0x5aa23f){var _0x1ca060={};var _0xb54869={};var _0x30a360;var _0x2cafa9;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x55149f['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x3e1a25,null))[_0x6fba('0x1e')](function(_0x5a4447){if(_0x5a4447){_0x30a360=_0x5a4447;_0xb54869['model']=_[_0x6fba('0x4c')](db['FaxAccount']['rawAttributes']);_0xb54869[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x55149f[_0x6fba('0x50')]);_0xb54869[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0xb54869[_0x6fba('0x4a')],_0xb54869[_0x6fba('0x50')]);_0x1ca060[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0xb54869[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x55149f[_0x6fba('0x50')][_0x6fba('0x54')]));_0x1ca060['attributes']=_0x1ca060[_0x6fba('0x53')][_0x6fba('0x55')]?_0x1ca060[_0x6fba('0x53')]:_0xb54869[_0x6fba('0x4a')];_0x1ca060['order']=qs[_0x6fba('0x58')](_0x55149f['query']['sort']);_0x1ca060[_0x6fba('0x59')]=qs['filters'](_[_0x6fba('0xbb')](_0x55149f[_0x6fba('0x50')],_0xb54869['filters']));if(_0x55149f['query']['filter']){_0x1ca060[_0x6fba('0x59')]=_['merge'](_0x1ca060['where'],{'$or':_[_0x6fba('0x3e')](_0x1ca060[_0x6fba('0x53')],function(_0xcb29a){var _0x5540c1={};_0x5540c1[_0xcb29a]={'$like':'%'+_0x55149f[_0x6fba('0x50')]['filter']+'%'};return _0x5540c1;})});}_0x1ca060=_[_0x6fba('0x5c')]({},_0x1ca060,_0x55149f[_0x6fba('0x64')]);return _0x30a360[_0x6fba('0x11a')](_0x1ca060);}})[_0x6fba('0x1e')](function(_0x3e7f41){if(_0x3e7f41){_0x2cafa9=_0x3e7f41[_0x6fba('0x55')];if(!_0x55149f[_0x6fba('0x50')]['hasOwnProperty'](_0x6fba('0x56'))){_0x1ca060['limit']=qs['limit'](_0x55149f[_0x6fba('0x50')]['limit']);_0x1ca060[_0x6fba('0x2f')]=qs['offset'](_0x55149f[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x30a360[_0x6fba('0x11a')](_0x1ca060);}})[_0x6fba('0x1e')](function(_0x334b0a){if(_0x334b0a){return _0x334b0a?{'count':_0x2cafa9,'rows':_0x334b0a}:null;}})['then'](respondWithResult(_0x3e1a25,null))[_0x6fba('0x29')](handleError(_0x3e1a25,null));};exports[_0x6fba('0x11b')]=function(_0x207eed,_0x1a6cf9,_0x5d0dbe){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x207eed[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x1a6cf9,null))[_0x6fba('0x1e')](function(_0x28a7ad){if(_0x28a7ad){return _0x28a7ad[_0x6fba('0x11b')](_0x207eed[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x207eed[_0x6fba('0x66')],['ids','id'])||{});}})[_0x6fba('0x1e')](respondWithResult(_0x1a6cf9,null))[_0x6fba('0x29')](handleError(_0x1a6cf9,null));};exports[_0x6fba('0x11c')]=function(_0x46fa24,_0x5d5120,_0x4e58c5){var _0x212889;return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x46fa24['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x5d5120,null))[_0x6fba('0x1e')](function(_0x15210c){if(_0x15210c){return _0x15210c[_0x6fba('0x11c')](_0x46fa24['query'][_0x6fba('0x6a')]);}})[_0x6fba('0x1e')](respondWithStatusCode(_0x5d5120,null))[_0x6fba('0x29')](handleError(_0x5d5120,null));};exports[_0x6fba('0x11d')]=function(_0x4f5b31,_0x5269d6,_0x342405){var _0x4f03f3={};var _0x4cb1f3={};var _0x56c3d1;var _0x47b747;return db['User'][_0x6fba('0xb9')]({'where':{'id':_0x4f5b31['params']['id']}})['then'](handleEntityNotFound(_0x5269d6,null))[_0x6fba('0x1e')](function(_0x2ed330){if(_0x2ed330){_0x56c3d1=_0x2ed330;_0x4cb1f3[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0x11e')]['rawAttributes']);_0x4cb1f3[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x4f5b31[_0x6fba('0x50')]);_0x4cb1f3[_0x6fba('0x52')]=_['intersection'](_0x4cb1f3[_0x6fba('0x4a')],_0x4cb1f3[_0x6fba('0x50')]);_0x4f03f3[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x4cb1f3[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x4f5b31[_0x6fba('0x50')][_0x6fba('0x54')]));_0x4f03f3[_0x6fba('0x53')]=_0x4f03f3[_0x6fba('0x53')][_0x6fba('0x55')]?_0x4f03f3['attributes']:_0x4cb1f3[_0x6fba('0x4a')];_0x4f03f3['order']=qs[_0x6fba('0x58')](_0x4f5b31['query'][_0x6fba('0x58')]);_0x4f03f3['where']=qs['filters'](_[_0x6fba('0xbb')](_0x4f5b31['query'],_0x4cb1f3[_0x6fba('0x52')]));if(_0x4f5b31[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x4f03f3[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x4f03f3[_0x6fba('0x59')],{'$or':_['map'](_0x4f03f3[_0x6fba('0x53')],function(_0x21fa00){var _0x18d35c={};_0x18d35c[_0x21fa00]={'$like':'%'+_0x4f5b31[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x18d35c;})});}_0x4f03f3=_[_0x6fba('0x5c')]({},_0x4f03f3,_0x4f5b31[_0x6fba('0x64')]);return _0x56c3d1[_0x6fba('0x11d')](_0x4f03f3);}})[_0x6fba('0x1e')](function(_0x559c97){if(_0x559c97){_0x47b747=_0x559c97[_0x6fba('0x55')];if(!_0x4f5b31[_0x6fba('0x50')]['hasOwnProperty']('nolimit')){_0x4f03f3[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x4f5b31[_0x6fba('0x50')][_0x6fba('0x30')]);_0x4f03f3['offset']=qs[_0x6fba('0x2f')](_0x4f5b31[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x56c3d1['getMailAccounts'](_0x4f03f3);}})[_0x6fba('0x1e')](function(_0x186d4d){if(_0x186d4d){return _0x186d4d?{'count':_0x47b747,'rows':_0x186d4d}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x5269d6,null))[_0x6fba('0x29')](handleError(_0x5269d6,null));};exports[_0x6fba('0x11f')]=function(_0x3ed704,_0x4f3a75,_0x150938){return db['User'][_0x6fba('0x42')]({'where':{'id':_0x3ed704[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x4f3a75,null))[_0x6fba('0x1e')](function(_0x2cd547){if(_0x2cd547){return _0x2cd547[_0x6fba('0x11f')](_0x3ed704[_0x6fba('0x66')]['ids'],_[_0x6fba('0x6b')](_0x3ed704['body'],['ids','id'])||{});}})[_0x6fba('0x1e')](respondWithResult(_0x4f3a75,null))[_0x6fba('0x29')](handleError(_0x4f3a75,null));};exports[_0x6fba('0x120')]=function(_0x48e032,_0x5bba15,_0x4c892c){var _0x413580;return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x48e032[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x5bba15,null))[_0x6fba('0x1e')](function(_0x58dc69){if(_0x58dc69){return _0x58dc69[_0x6fba('0x120')](_0x48e032[_0x6fba('0x50')][_0x6fba('0x6a')]);}})[_0x6fba('0x1e')](respondWithStatusCode(_0x5bba15,null))[_0x6fba('0x29')](handleError(_0x5bba15,null));};exports[_0x6fba('0x121')]=function(_0x448820,_0x78f337,_0xc05422){var _0x1c5401={};var _0x42a484={};var _0x271c74;var _0x457f52;return db[_0x6fba('0x48')]['findOne']({'where':{'id':_0x448820[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x78f337,null))[_0x6fba('0x1e')](function(_0x4465cb){if(_0x4465cb){_0x271c74=_0x4465cb;_0x42a484[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0x122')]['rawAttributes']);_0x42a484[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x448820[_0x6fba('0x50')]);_0x42a484[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x42a484['model'],_0x42a484[_0x6fba('0x50')]);_0x1c5401[_0x6fba('0x53')]=_['intersection'](_0x42a484[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x448820['query']['fields']));_0x1c5401[_0x6fba('0x53')]=_0x1c5401[_0x6fba('0x53')][_0x6fba('0x55')]?_0x1c5401['attributes']:_0x42a484[_0x6fba('0x4a')];_0x1c5401['order']=qs[_0x6fba('0x58')](_0x448820['query'][_0x6fba('0x58')]);_0x1c5401[_0x6fba('0x59')]=qs['filters'](_[_0x6fba('0xbb')](_0x448820[_0x6fba('0x50')],_0x42a484[_0x6fba('0x52')]));if(_0x448820[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x1c5401[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x1c5401[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x1c5401[_0x6fba('0x53')],function(_0x53f5ac){var _0x17fff8={};_0x17fff8[_0x53f5ac]={'$like':'%'+_0x448820[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x17fff8;})});}_0x1c5401=_[_0x6fba('0x5c')]({},_0x1c5401,_0x448820['options']);return _0x271c74[_0x6fba('0x121')](_0x1c5401);}})[_0x6fba('0x1e')](function(_0x1c4d93){if(_0x1c4d93){_0x457f52=_0x1c4d93[_0x6fba('0x55')];if(!_0x448820[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x1c5401[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x448820[_0x6fba('0x50')][_0x6fba('0x30')]);_0x1c5401[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x448820[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x271c74[_0x6fba('0x121')](_0x1c5401);}})[_0x6fba('0x1e')](function(_0x1abd95){if(_0x1abd95){return _0x1abd95?{'count':_0x457f52,'rows':_0x1abd95}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x78f337,null))['catch'](handleError(_0x78f337,null));};exports['addOpenchannelAccounts']=function(_0x39d30a,_0x308d34,_0x351d4e){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x39d30a[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x308d34,null))[_0x6fba('0x1e')](function(_0x48d8c2){if(_0x48d8c2){return _0x48d8c2[_0x6fba('0x123')](_0x39d30a[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x39d30a[_0x6fba('0x66')],[_0x6fba('0x6a'),'id'])||{});}})[_0x6fba('0x1e')](respondWithResult(_0x308d34,null))[_0x6fba('0x29')](handleError(_0x308d34,null));};exports[_0x6fba('0x124')]=function(_0x358330,_0x31a38f,_0x4abc61){var _0x2c9b61;return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x358330[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x31a38f,null))[_0x6fba('0x1e')](function(_0x553990){if(_0x553990){return _0x553990[_0x6fba('0x124')](_0x358330['query'][_0x6fba('0x6a')]);}})[_0x6fba('0x1e')](respondWithStatusCode(_0x31a38f,null))[_0x6fba('0x29')](handleError(_0x31a38f,null));};exports[_0x6fba('0x125')]=function(_0x18b4d6,_0x12396c,_0x1dceae){var _0x51cc32={};var _0x367a19={};var _0x201080;var _0x99878;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x18b4d6['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x12396c,null))[_0x6fba('0x1e')](function(_0x586e6b){if(_0x586e6b){_0x201080=_0x586e6b;_0x367a19[_0x6fba('0x4a')]=_['keys'](db[_0x6fba('0x126')]['rawAttributes']);_0x367a19[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x18b4d6[_0x6fba('0x50')]);_0x367a19[_0x6fba('0x52')]=_['intersection'](_0x367a19[_0x6fba('0x4a')],_0x367a19[_0x6fba('0x50')]);_0x51cc32[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x367a19[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x18b4d6[_0x6fba('0x50')][_0x6fba('0x54')]));_0x51cc32[_0x6fba('0x53')]=_0x51cc32[_0x6fba('0x53')][_0x6fba('0x55')]?_0x51cc32[_0x6fba('0x53')]:_0x367a19[_0x6fba('0x4a')];_0x51cc32['order']=qs[_0x6fba('0x58')](_0x18b4d6[_0x6fba('0x50')]['sort']);_0x51cc32[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_[_0x6fba('0xbb')](_0x18b4d6[_0x6fba('0x50')],_0x367a19[_0x6fba('0x52')]));if(_0x18b4d6['query']['filter']){_0x51cc32[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x51cc32[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x51cc32[_0x6fba('0x53')],function(_0x3cbb0f){var _0x34712b={};_0x34712b[_0x3cbb0f]={'$like':'%'+_0x18b4d6[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x34712b;})});}_0x51cc32=_[_0x6fba('0x5c')]({},_0x51cc32,_0x18b4d6[_0x6fba('0x64')]);return _0x201080[_0x6fba('0x125')](_0x51cc32);}})[_0x6fba('0x1e')](function(_0x1354dc){if(_0x1354dc){_0x99878=_0x1354dc[_0x6fba('0x55')];if(!_0x18b4d6['query'][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x51cc32[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x18b4d6[_0x6fba('0x50')]['limit']);_0x51cc32[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x18b4d6[_0x6fba('0x50')]['offset']);}return _0x201080['getSmsAccounts'](_0x51cc32);}})[_0x6fba('0x1e')](function(_0x4581c7){if(_0x4581c7){return _0x4581c7?{'count':_0x99878,'rows':_0x4581c7}:null;}})['then'](respondWithResult(_0x12396c,null))[_0x6fba('0x29')](handleError(_0x12396c,null));};exports[_0x6fba('0x127')]=function(_0x1a99d0,_0xc4bf85,_0x4cf5fe){return db['User']['find']({'where':{'id':_0x1a99d0[_0x6fba('0x69')]['id']}})['then'](handleEntityNotFound(_0xc4bf85,null))['then'](function(_0xa5b2f9){if(_0xa5b2f9){return _0xa5b2f9['addSmsAccounts'](_0x1a99d0[_0x6fba('0x66')][_0x6fba('0x6a')],_[_0x6fba('0x6b')](_0x1a99d0[_0x6fba('0x66')],[_0x6fba('0x6a'),'id'])||{});}})[_0x6fba('0x1e')](respondWithResult(_0xc4bf85,null))['catch'](handleError(_0xc4bf85,null));};exports[_0x6fba('0x128')]=function(_0x5a558e,_0x3abc79,_0x1ee5ce){var _0x16fe7b;return db[_0x6fba('0x48')]['find']({'where':{'id':_0x5a558e['params']['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x3abc79,null))[_0x6fba('0x1e')](function(_0x4ec4a0){if(_0x4ec4a0){return _0x4ec4a0[_0x6fba('0x128')](_0x5a558e['query'][_0x6fba('0x6a')]);}})[_0x6fba('0x1e')](respondWithStatusCode(_0x3abc79,null))['catch'](handleError(_0x3abc79,null));};exports['getChatWebsites']=function(_0x13328e,_0x4f4d0c,_0x2abb42){var _0x23c64d={};var _0x18228c={};var _0x2fbf62;var _0x9d19c;return db[_0x6fba('0x48')][_0x6fba('0xb9')]({'where':{'id':_0x13328e[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x4f4d0c,null))[_0x6fba('0x1e')](function(_0x1cda6e){if(_0x1cda6e){_0x2fbf62=_0x1cda6e;_0x18228c['model']=_['keys'](db[_0x6fba('0x129')][_0x6fba('0x49')]);_0x18228c['query']=_[_0x6fba('0x4c')](_0x13328e[_0x6fba('0x50')]);_0x18228c['filters']=_[_0x6fba('0x63')](_0x18228c[_0x6fba('0x4a')],_0x18228c[_0x6fba('0x50')]);_0x23c64d[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x18228c[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x13328e['query'][_0x6fba('0x54')]));_0x23c64d[_0x6fba('0x53')]=_0x23c64d[_0x6fba('0x53')][_0x6fba('0x55')]?_0x23c64d[_0x6fba('0x53')]:_0x18228c['model'];_0x23c64d[_0x6fba('0x57')]=qs[_0x6fba('0x58')](_0x13328e[_0x6fba('0x50')][_0x6fba('0x58')]);_0x23c64d[_0x6fba('0x59')]=qs['filters'](_[_0x6fba('0xbb')](_0x13328e[_0x6fba('0x50')],_0x18228c['filters']));if(_0x13328e[_0x6fba('0x50')]['filter']){_0x23c64d[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x23c64d[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x23c64d['attributes'],function(_0x52c62d){var _0x34915f={};_0x34915f[_0x52c62d]={'$like':'%'+_0x13328e[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x34915f;})});}_0x23c64d=_[_0x6fba('0x5c')]({},_0x23c64d,_0x13328e[_0x6fba('0x64')]);return _0x2fbf62[_0x6fba('0x12a')](_0x23c64d);}})[_0x6fba('0x1e')](function(_0x2a2fc9){if(_0x2a2fc9){_0x9d19c=_0x2a2fc9[_0x6fba('0x55')];if(!_0x13328e[_0x6fba('0x50')]['hasOwnProperty'](_0x6fba('0x56'))){_0x23c64d['limit']=qs['limit'](_0x13328e['query'][_0x6fba('0x30')]);_0x23c64d[_0x6fba('0x2f')]=qs[_0x6fba('0x2f')](_0x13328e[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x2fbf62['getChatWebsites'](_0x23c64d);}})[_0x6fba('0x1e')](function(_0x3de09d){if(_0x3de09d){return _0x3de09d?{'count':_0x9d19c,'rows':_0x3de09d}:null;}})[_0x6fba('0x1e')](respondWithResult(_0x4f4d0c,null))[_0x6fba('0x29')](handleError(_0x4f4d0c,null));};exports[_0x6fba('0x12b')]=function(_0x58e7ad,_0x23c367,_0x478978){return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x58e7ad[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x23c367,null))[_0x6fba('0x1e')](function(_0x32ee4c){if(_0x32ee4c){return _0x32ee4c['addChatWebsites'](_0x58e7ad[_0x6fba('0x66')]['ids'],_[_0x6fba('0x6b')](_0x58e7ad[_0x6fba('0x66')],[_0x6fba('0x6a'),'id'])||{});}})[_0x6fba('0x1e')](respondWithResult(_0x23c367,null))['catch'](handleError(_0x23c367,null));};exports['removeChatWebsites']=function(_0x51a377,_0x11458a,_0x5f18b5){var _0x3eb0b0;return db['User'][_0x6fba('0x42')]({'where':{'id':_0x51a377[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x11458a,null))[_0x6fba('0x1e')](function(_0x371ba8){if(_0x371ba8){return _0x371ba8[_0x6fba('0x12c')](_0x51a377[_0x6fba('0x50')]['ids']);}})[_0x6fba('0x1e')](respondWithStatusCode(_0x11458a,null))[_0x6fba('0x29')](handleError(_0x11458a,null));};exports[_0x6fba('0x12d')]=function(_0x2ba5f4,_0x1cbef6,_0x1b6b22){var _0x456103={};var _0x5e8260={};var _0x36d647;var _0x2a9f35;return db['User'][_0x6fba('0xb9')]({'where':{'id':_0x2ba5f4[_0x6fba('0x69')]['id']}})[_0x6fba('0x1e')](handleEntityNotFound(_0x1cbef6,null))[_0x6fba('0x1e')](function(_0x2683dd){if(_0x2683dd){_0x36d647=_0x2683dd;_0x5e8260[_0x6fba('0x4a')]=_[_0x6fba('0x4c')](db[_0x6fba('0x12e')][_0x6fba('0x49')]);_0x5e8260[_0x6fba('0x50')]=_[_0x6fba('0x4c')](_0x2ba5f4[_0x6fba('0x50')]);_0x5e8260[_0x6fba('0x52')]=_[_0x6fba('0x63')](_0x5e8260[_0x6fba('0x4a')],_0x5e8260[_0x6fba('0x50')]);_0x456103[_0x6fba('0x53')]=_[_0x6fba('0x63')](_0x5e8260[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x2ba5f4[_0x6fba('0x50')][_0x6fba('0x54')]));_0x456103[_0x6fba('0x53')]=_0x456103[_0x6fba('0x53')][_0x6fba('0x55')]?_0x456103['attributes']:_0x5e8260[_0x6fba('0x4a')];_0x456103[_0x6fba('0x57')]=qs['sort'](_0x2ba5f4[_0x6fba('0x50')][_0x6fba('0x58')]);_0x456103[_0x6fba('0x59')]=qs[_0x6fba('0x52')](_['pick'](_0x2ba5f4[_0x6fba('0x50')],_0x5e8260[_0x6fba('0x52')]));if(_0x2ba5f4[_0x6fba('0x50')][_0x6fba('0x3c')]){_0x456103[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x456103[_0x6fba('0x59')],{'$or':_[_0x6fba('0x3e')](_0x456103[_0x6fba('0x53')],function(_0x22002f){var _0x172713={};_0x172713[_0x22002f]={'$like':'%'+_0x2ba5f4[_0x6fba('0x50')][_0x6fba('0x3c')]+'%'};return _0x172713;})});}_0x456103=_[_0x6fba('0x5c')]({},_0x456103,_0x2ba5f4[_0x6fba('0x64')]);return _0x36d647[_0x6fba('0x12d')](_0x456103);}})[_0x6fba('0x1e')](function(_0x4b027c){if(_0x4b027c){_0x2a9f35=_0x4b027c[_0x6fba('0x55')];if(!_0x2ba5f4[_0x6fba('0x50')][_0x6fba('0xbc')](_0x6fba('0x56'))){_0x456103[_0x6fba('0x30')]=qs[_0x6fba('0x30')](_0x2ba5f4[_0x6fba('0x50')][_0x6fba('0x30')]);_0x456103['offset']=qs[_0x6fba('0x2f')](_0x2ba5f4[_0x6fba('0x50')][_0x6fba('0x2f')]);}return _0x36d647[_0x6fba('0x12d')](_0x456103);}})[_0x6fba('0x1e')](function(_0x1f1b44){if(_0x1f1b44){return _0x1f1b44?{'count':_0x2a9f35,'rows':_0x1f1b44}:null;}})['then'](respondWithResult(_0x1cbef6,null))[_0x6fba('0x29')](handleError(_0x1cbef6,null));};exports[_0x6fba('0x12f')]=function(_0x1588bd,_0x501734,_0x3ecbe1){return db[_0x6fba('0x48')]['find']({'where':{'id':_0x1588bd['params']['id']}})['then'](handleEntityNotFound(_0x501734,null))[_0x6fba('0x1e')](function(_0x4e9e23){if(_0x4e9e23){return _0x4e9e23[_0x6fba('0x12f')](_0x1588bd['body'][_0x6fba('0x6a')],_['omit'](_0x1588bd[_0x6fba('0x66')],[_0x6fba('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x501734,null))[_0x6fba('0x29')](handleError(_0x501734,null));};exports[_0x6fba('0x130')]=function(_0x42ff30,_0x9270bd,_0x5340a3){var _0x2e97bd;return db[_0x6fba('0x48')][_0x6fba('0x42')]({'where':{'id':_0x42ff30[_0x6fba('0x69')]['id']}})['then'](handleEntityNotFound(_0x9270bd,null))[_0x6fba('0x1e')](function(_0x49ca72){if(_0x49ca72){return _0x49ca72[_0x6fba('0x130')](_0x42ff30[_0x6fba('0x50')][_0x6fba('0x6a')]);}})[_0x6fba('0x1e')](respondWithStatusCode(_0x9270bd,null))['catch'](handleError(_0x9270bd,null));};exports[_0x6fba('0x131')]=function(_0x55320b,_0x2740bd){var _0x92c50d={},_0x3ef59f={},_0x38fd8f={'count':0x0,'rows':[]};var _0x300c15=db[_0x6fba('0x132')][_0x6fba('0x49')];_0x3ef59f['model']=_[_0x6fba('0x4c')](_0x300c15);var _0x171a2e={'dateStart':_0x55320b[_0x6fba('0x50')][_0x6fba('0x4f')],'dateEnd':_0x55320b[_0x6fba('0x50')][_0x6fba('0x51')]};delete _0x55320b[_0x6fba('0x50')][_0x6fba('0x4f')];delete _0x55320b[_0x6fba('0x50')]['dateEnd'];_0x3ef59f[_0x6fba('0x50')]=_['keys'](_0x55320b[_0x6fba('0x50')]);_0x3ef59f['filters']=_['intersection'](_0x3ef59f[_0x6fba('0x4a')],_0x3ef59f['query']);_0x3ef59f[_0x6fba('0x52')]=_[_0x6fba('0xe9')](_0x3ef59f[_0x6fba('0x52')],[_0x6fba('0x133'),'$or',_0x6fba('0x134'),_0x6fba('0x135'),_0x6fba('0x136'),_0x6fba('0x137'),'$ne',_0x6fba('0x138'),'$not',_0x6fba('0x139'),_0x6fba('0x13a'),_0x6fba('0x13b'),_0x6fba('0x13c'),_0x6fba('0x13d'),'$notLike','$iLike',_0x6fba('0x13e'),_0x6fba('0x13d'),_0x6fba('0x13f'),_0x6fba('0x140'),'$contained',_0x6fba('0x141')]);_0x92c50d[_0x6fba('0x53')]=_['intersection'](_0x3ef59f[_0x6fba('0x4a')],qs[_0x6fba('0x54')](_0x55320b['query'][_0x6fba('0x54')]));_0x92c50d[_0x6fba('0x53')]=_0x92c50d[_0x6fba('0x53')][_0x6fba('0x55')]?_0x92c50d[_0x6fba('0x53')]:_0x3ef59f['model'];if(!_0x55320b[_0x6fba('0x50')][_0x6fba('0xbc')]('nolimit')){_0x92c50d['limit']=qs[_0x6fba('0x30')](_0x55320b['query']['limit']);_0x92c50d[_0x6fba('0x2f')]=qs['offset'](_0x55320b['query'][_0x6fba('0x2f')]);}_0x92c50d[_0x6fba('0x57')]=qs['sort'](_0x55320b[_0x6fba('0x50')]['sort']);_0x92c50d[_0x6fba('0x59')]=qs['filters'](_[_0x6fba('0xbb')](_0x55320b['query'],_0x3ef59f[_0x6fba('0x52')]));if(_0x171a2e[_0x6fba('0x4f')]){if(_0x171a2e[_0x6fba('0x51')]){_0x171a2e[_0x6fba('0x51')]=moment(_0x171a2e[_0x6fba('0x51')])['add'](0x1,_0x6fba('0x5b'));}else{_0x171a2e[_0x6fba('0x51')]=moment(_0x171a2e[_0x6fba('0x4f')])['add'](0x1,'day');}_[_0x6fba('0x5c')](_0x92c50d[_0x6fba('0x59')],{'scheduledat':{'$gte':_0x171a2e[_0x6fba('0x4f')],'$lte':_0x171a2e[_0x6fba('0x51')]}});}if(_0x55320b[_0x6fba('0x50')]['filter']){_0x92c50d[_0x6fba('0x59')]=_[_0x6fba('0x5c')](_0x92c50d['where'],{'$or':_['map'](_0x92c50d[_0x6fba('0x53')],function(_0x23434e){var _0xd33683={};_0xd33683[_0x23434e]={'$like':'%'+_0x55320b['query'][_0x6fba('0x3c')]+'%'};return _0xd33683;})});}_0x92c50d[_0x6fba('0x59')]={'$and':[_0x92c50d[_0x6fba('0x59')],{'$or':[{'UserId':_0x55320b[_0x6fba('0x69')]['id']},{'OwnerId':_0x55320b['params']['id']}]}]};_0x92c50d=_[_0x6fba('0x5c')]({},_0x92c50d,_0x55320b['options']);var _0x331c88={'where':_0x92c50d[_0x6fba('0x59')]};return db[_0x6fba('0x132')][_0x6fba('0x2e')](_0x331c88)[_0x6fba('0x1e')](function(_0x1ef602){_0x38fd8f[_0x6fba('0x2e')]=_0x1ef602;if(_0x55320b[_0x6fba('0x50')][_0x6fba('0xbd')]){_0x92c50d[_0x6fba('0x61')]=[{'attributes':['id',_0x6fba('0x142'),'lastName',_0x6fba('0x143')],'model':db[_0x6fba('0xba')],'as':'Contact'},{'attributes':['id','name','dialActive'],'model':db[_0x6fba('0x144')],'as':_0x6fba('0xc5')}];}return db[_0x6fba('0x132')][_0x6fba('0xa7')](_0x92c50d);})[_0x6fba('0x1e')](function(_0x2de02e){_0x38fd8f[_0x6fba('0x62')]=_0x2de02e;return _0x38fd8f;})[_0x6fba('0x1e')](respondWithFilteredResult(_0x2740bd,_0x92c50d))[_0x6fba('0x29')](handleError(_0x2740bd,null));};
\ No newline at end of file
index 2a22598..a62136f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','User'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53ec,0x192));var _0xc53e=function(_0x1fcde8,_0x44c01d){_0x1fcde8=_0x1fcde8-0x0;var _0x5b3541=_0x53ec[_0x1fcde8];return _0x5b3541;};'use strict';var EventEmitter=require(_0xc53e('0x0'));var User=require(_0xc53e('0x1'))['db'][_0xc53e('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xc53e('0x3')](0x0);var events={'afterCreate':_0xc53e('0x4'),'afterUpdate':_0xc53e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x266c42){return function(_0x4e954a,_0x2b90f6,_0x38033d){UserEvents['emit'](_0x266c42+':'+_0x4e954a['id'],_0x4e954a);UserEvents[_0xc53e('0x6')](_0x266c42,_0x4e954a);_0x38033d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0xc53e('0x7')](e,emitEvent(event));}}module[_0xc53e('0x8')]=UserEvents;
\ No newline at end of file
+var _0xf494=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','User','save','update'];(function(_0x4c3bbf,_0x50badb){var _0x4569e0=function(_0xe0574e){while(--_0xe0574e){_0x4c3bbf['push'](_0x4c3bbf['shift']());}};_0x4569e0(++_0x50badb);}(_0xf494,0x1c6));var _0x4f49=function(_0xa72b78,_0x30ca61){_0xa72b78=_0xa72b78-0x0;var _0x42ae5e=_0xf494[_0xa72b78];return _0x42ae5e;};'use strict';var EventEmitter=require(_0x4f49('0x0'));var User=require(_0x4f49('0x1'))['db'][_0x4f49('0x2')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f49('0x3'),'afterUpdate':_0x4f49('0x4'),'afterDestroy':_0x4f49('0x5')};function emitEvent(_0x25677c){return function(_0x20c0d7,_0x2a15fb,_0x3267c1){UserEvents[_0x4f49('0x6')](_0x25677c+':'+_0x20c0d7['id'],_0x20c0d7);UserEvents[_0x4f49('0x6')](_0x25677c,_0x20c0d7);_0x3267c1(null);};}for(var e in events){if(events[_0x4f49('0x7')](e)){var event=events[e];User[_0x4f49('0x8')](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
index d0f0dae..e5365f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['findAll','internal','concat','catch','exports','define','User','users','utf8','utf8_bin','updateMd5Password','changed','updatePassword','bulkCreate','chanspy','then','VoiceExtension','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','base64','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','md5secret','bluebird','crypto','util','./user.attributes','length','context','from-sip','system','format','%s%s','prefix','record','push','merge','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','wav','gsm','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults'];(function(_0x28e657,_0x33d163){var _0xbf5776=function(_0x35d54b){while(--_0x35d54b){_0x28e657['push'](_0x28e657['shift']());}};_0xbf5776(++_0x33d163);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var md5=require('md5');var _=require('lodash');var attributes=require(_0x0a9e('0x3'));var authTypes=['google'];var validatePresenceOf=function(_0x333808){return _0x333808&&_0x333808[_0x0a9e('0x4')];};var getChanSpyApplications=function(_0x2ab90b,_0x991246,_0x981158){var _0x57b080={'context':_0x2ab90b[_0x0a9e('0x5')]||_0x0a9e('0x6'),'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x2ab90b['id']};var _0x5f41ea=[];for(var _0x503809=0x0,_0xe42b77=0x1;_0x503809<_0x981158['length'];_0x503809++,_0xe42b77=0x1){var _0x52cace={'exten':util[_0x0a9e('0x8')](_0x0a9e('0x9'),_0x981158[_0x503809][_0x0a9e('0xa')],_0x991246),'ChanSpyId':_0x981158[_0x503809]['id']};if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0x981158[_0x503809]['recordingFormat']),'priority':_0xe42b77++},_0x57b080,_0x52cace));}if(_0x981158[_0x503809][_0x0a9e('0xe')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':_0x0a9e('0xf'),'appdata':_0x981158[_0x503809][_0x0a9e('0x10')],'priority':_0xe42b77++},_0x57b080,_0x52cace));}_0x5f41ea[_0x0a9e('0xc')](_['merge']({'app':_0x0a9e('0x11'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x12'),_0x2ab90b[_0x0a9e('0x13')],_0x981158[_0x503809][_0x0a9e('0x14')]?_0x981158[_0x503809][_0x0a9e('0x14')]['join'](''):''),'priority':_0xe42b77++},_0x57b080,_0x52cace));if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea['push'](_[_0x0a9e('0xd')]({'app':'StopMixMonitor','priority':_0xe42b77++},_0x57b080,_0x52cace));}}return _0x5f41ea;};var getUserApplications=function(_0x16033c,_0x12066b){var _0x48f32d=[_0x0a9e('0x15'),'WAV',_0x0a9e('0x16')];var _0x478723={'context':_0x16033c[_0x0a9e('0x5')]||_0x0a9e('0x6'),'exten':_0x12066b,'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x16033c['id']};var _0x2eb11f=[{'app':_0x0a9e('0x17'),'appdata':_0x0a9e('0x18')}];if(_0x16033c[_0x0a9e('0x19')]&&_[_0x0a9e('0x1a')](_0x48f32d,_0x16033c[_0x0a9e('0x19')])){_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':_0x0a9e('0x1b')});_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':util[_0x0a9e('0x8')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x16033c['extensionMonitor'])});_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1d'),_0x16033c['name'])});}else{_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1e'),_0x16033c[_0x0a9e('0x13')])});}_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1f')});for(var _0x5ea472=0x0;_0x5ea472<_0x2eb11f['length'];_0x5ea472++){_0x2eb11f[_0x5ea472][_0x0a9e('0x20')]=_0x5ea472+0x1;_0x2eb11f[_0x5ea472]=_[_0x0a9e('0x21')](_0x2eb11f[_0x5ea472],_0x478723);}return _0x2eb11f;};var getChanSpyPromise=function(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){return _0x40c424['VoiceChanSpy'][_0x0a9e('0x22')]()['then'](function(_0x1dc186){if(_0x1dc186){var _0x34dc65=getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x23')],_0x1dc186);if(_0x33161b[_0x0a9e('0x23')]!=_0x33161b[_0x0a9e('0x13')]){_0x34dc65=_0x34dc65[_0x0a9e('0x24')](getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x13')],_0x1dc186));}return _0x526cf3(_0x34dc65);}return _0x526cf3([]);})[_0x0a9e('0x25')](function(_0x5a101a){_0x384319(_0x5a101a);});});};module[_0x0a9e('0x26')]=function(_0x468813,_0x2b1f27){var _0x2ec755=_0x468813['models'];return _0x468813[_0x0a9e('0x27')](_0x0a9e('0x28'),attributes,{'tableName':_0x0a9e('0x29'),'charset':_0x0a9e('0x2a'),'collate':_0x0a9e('0x2b'),'hooks':{'beforeCreate':function(_0x563b45,_0x296f41,_0x2e8759){_0x563b45[_0x0a9e('0x2c')]();_0x563b45['updatePassword'](_0x2e8759);},'beforeUpdate':function(_0x426950,_0x5d1e0e,_0x2407f9){if(_0x426950[_0x0a9e('0x2d')](_0x0a9e('0x10'))){_0x426950[_0x0a9e('0x2c')]();return _0x426950[_0x0a9e('0x2e')](_0x2407f9);}_0x2407f9();},'afterCreate':function(_0x5180f1,_0x66c1d2,_0x46f0a5){var _0x40cb85=getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x23')]);if(_0x5180f1[_0x0a9e('0x23')]!=_0x5180f1[_0x0a9e('0x13')]){_0x40cb85=_0x40cb85[_0x0a9e('0x24')](getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x13')]));}return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x40cb85)['then'](function(){if(_0x5180f1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x5180f1);}})[_0x0a9e('0x31')](function(_0x2b7e7f){if(_0x2b7e7f&&_0x2b7e7f[_0x0a9e('0x4')]){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x2b7e7f);}})[_0x0a9e('0x31')](function(){_0x46f0a5();})[_0x0a9e('0x25')](function(_0x15de0e){_0x46f0a5(_0x15de0e);});},'afterUpdate':function(_0x4853b1,_0x54135e,_0x1e8694){return BPromise['resolve']()[_0x0a9e('0x31')](function(){if(_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x30'))||_0x4853b1[_0x0a9e('0x2d')]('context')){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0x4853b1['id'],'type':_0x0a9e('0x7'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x4853b1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x4853b1)[_0x0a9e('0x31')](function(_0x289467){if(_0x289467&&_0x289467['length']){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x289467);}});}});}})[_0x0a9e('0x31')](function(){if(_0x4853b1['changed'](_0x0a9e('0x19'))||_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x5'))){return _0x2ec755[_0x0a9e('0x32')]['destroy']({'where':{'UserId':_0x4853b1['id'],'type':'system','ChanSpyId':null}})[_0x0a9e('0x31')](function(){var _0x45b3d0=getUserApplications(_0x4853b1,_0x4853b1['internal']);if(_0x4853b1[_0x0a9e('0x23')]!=_0x4853b1[_0x0a9e('0x13')]){_0x45b3d0=_0x45b3d0[_0x0a9e('0x24')](getUserApplications(_0x4853b1,_0x4853b1['name']));}return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x2f')](_0x45b3d0);});}})[_0x0a9e('0x31')](function(){_0x1e8694();})[_0x0a9e('0x25')](function(_0x13cb1f){_0x1e8694(_0x13cb1f);});},'afterDestroy':function(_0xeaa5e5,_0x2881b3){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0xeaa5e5['id'],'type':_0x0a9e('0x7')}});}},'instanceMethods':{'authenticate':function(_0x2c3711,_0x148007){if(!_0x148007){return this[_0x0a9e('0x10')]===this[_0x0a9e('0x34')](_0x2c3711);}var _0x37f6cc=this;this['encryptPassword'](_0x2c3711,function(_0x52628e,_0x473fdc){if(_0x52628e){_0x148007(_0x52628e);}if(_0x37f6cc[_0x0a9e('0x10')]===_0x473fdc){_0x148007(null,!![]);}else{_0x148007(null,![]);}});},'makeSalt':function(_0x405c8f,_0x315881){var _0x1a69dd=0x10;if(typeof arguments[0x0]===_0x0a9e('0x35')){_0x315881=arguments[0x0];_0x405c8f=_0x1a69dd;}else if(typeof arguments[0x1]===_0x0a9e('0x35')){_0x315881=arguments[0x1];}else{throw new Error(_0x0a9e('0x36'));}if(!_0x405c8f){_0x405c8f=_0x1a69dd;}return crypto[_0x0a9e('0x37')](_0x405c8f,function(_0x25c6e6,_0x2c2cb0){if(_0x25c6e6){_0x315881(_0x25c6e6);}return _0x315881(null,_0x2c2cb0[_0x0a9e('0x38')]('base64'));});},'encryptPassword':function(_0x117c99,_0x138b8b){if(!_0x117c99||!this[_0x0a9e('0x39')]){return _0x138b8b?_0x138b8b(null):null;}var _0xfbd5ad=0x2710;var _0x2e8caf=0x40;var _0xbe9d19=new Buffer(this[_0x0a9e('0x39')],_0x0a9e('0x3a'));if(!_0x138b8b){return crypto['pbkdf2Sync'](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'))['toString'](_0x0a9e('0x3a'));}return crypto[_0x0a9e('0x3c')](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'),function(_0x562fb4,_0x14bec2){if(_0x562fb4){_0x138b8b(_0x562fb4);}return _0x138b8b(null,_0x14bec2[_0x0a9e('0x38')](_0x0a9e('0x3a')));});},'updatePassword':function(_0x34aa5a){if(!this[_0x0a9e('0x10')]){return _0x34aa5a(null);}if(!validatePresenceOf(this[_0x0a9e('0x10')])&&authTypes[_0x0a9e('0x3d')](this['provider'])===-0x1){_0x34aa5a(new Error(_0x0a9e('0x3e')));}var _0x1bde3c=this;this[_0x0a9e('0x3f')](function(_0x16f976,_0x409789){if(_0x16f976){return _0x34aa5a(_0x16f976);}_0x1bde3c[_0x0a9e('0x39')]=_0x409789;_0x1bde3c[_0x0a9e('0x34')](_0x1bde3c[_0x0a9e('0x10')],function(_0x34febd,_0x58a5c2){if(_0x34febd){_0x34aa5a(_0x34febd);}_0x1bde3c[_0x0a9e('0x10')]=_0x58a5c2;_0x34aa5a(null);});});},'updateMd5Password':function(){this[_0x0a9e('0x40')]=md5(this['name']+':asterisk:'+this['password']);return this[_0x0a9e('0x40')];}}});};
\ No newline at end of file
+var _0xa9e0=['findAll','internal','concat','catch','exports','define','User','users','utf8','utf8_bin','updateMd5Password','changed','updatePassword','bulkCreate','chanspy','then','VoiceExtension','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','salt','base64','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','md5secret','bluebird','crypto','util','./user.attributes','length','context','from-sip','system','format','%s%s','prefix','record','push','merge','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','wav','gsm','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults'];(function(_0x27bb30,_0x523749){var _0x375b57=function(_0x2ed716){while(--_0x2ed716){_0x27bb30['push'](_0x27bb30['shift']());}};_0x375b57(++_0x523749);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var BPromise=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var md5=require('md5');var _=require('lodash');var attributes=require(_0x0a9e('0x3'));var authTypes=['google'];var validatePresenceOf=function(_0x333808){return _0x333808&&_0x333808[_0x0a9e('0x4')];};var getChanSpyApplications=function(_0x2ab90b,_0x991246,_0x981158){var _0x57b080={'context':_0x2ab90b[_0x0a9e('0x5')]||_0x0a9e('0x6'),'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x2ab90b['id']};var _0x5f41ea=[];for(var _0x503809=0x0,_0xe42b77=0x1;_0x503809<_0x981158['length'];_0x503809++,_0xe42b77=0x1){var _0x52cace={'exten':util[_0x0a9e('0x8')](_0x0a9e('0x9'),_0x981158[_0x503809][_0x0a9e('0xa')],_0x991246),'ChanSpyId':_0x981158[_0x503809]['id']};if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0x981158[_0x503809]['recordingFormat']),'priority':_0xe42b77++},_0x57b080,_0x52cace));}if(_0x981158[_0x503809][_0x0a9e('0xe')]){_0x5f41ea[_0x0a9e('0xc')](_[_0x0a9e('0xd')]({'app':_0x0a9e('0xf'),'appdata':_0x981158[_0x503809][_0x0a9e('0x10')],'priority':_0xe42b77++},_0x57b080,_0x52cace));}_0x5f41ea[_0x0a9e('0xc')](_['merge']({'app':_0x0a9e('0x11'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x12'),_0x2ab90b[_0x0a9e('0x13')],_0x981158[_0x503809][_0x0a9e('0x14')]?_0x981158[_0x503809][_0x0a9e('0x14')]['join'](''):''),'priority':_0xe42b77++},_0x57b080,_0x52cace));if(_0x981158[_0x503809][_0x0a9e('0xb')]){_0x5f41ea['push'](_[_0x0a9e('0xd')]({'app':'StopMixMonitor','priority':_0xe42b77++},_0x57b080,_0x52cace));}}return _0x5f41ea;};var getUserApplications=function(_0x16033c,_0x12066b){var _0x48f32d=[_0x0a9e('0x15'),'WAV',_0x0a9e('0x16')];var _0x478723={'context':_0x16033c[_0x0a9e('0x5')]||_0x0a9e('0x6'),'exten':_0x12066b,'type':_0x0a9e('0x7'),'isApp':![],'UserId':_0x16033c['id']};var _0x2eb11f=[{'app':_0x0a9e('0x17'),'appdata':_0x0a9e('0x18')}];if(_0x16033c[_0x0a9e('0x19')]&&_[_0x0a9e('0x1a')](_0x48f32d,_0x16033c[_0x0a9e('0x19')])){_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':_0x0a9e('0x1b')});_0x2eb11f[_0x0a9e('0xc')]({'app':'Set','appdata':util[_0x0a9e('0x8')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x16033c['extensionMonitor'])});_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1d'),_0x16033c['name'])});}else{_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1c'),'appdata':util[_0x0a9e('0x8')](_0x0a9e('0x1e'),_0x16033c[_0x0a9e('0x13')])});}_0x2eb11f[_0x0a9e('0xc')]({'app':_0x0a9e('0x1f')});for(var _0x5ea472=0x0;_0x5ea472<_0x2eb11f['length'];_0x5ea472++){_0x2eb11f[_0x5ea472][_0x0a9e('0x20')]=_0x5ea472+0x1;_0x2eb11f[_0x5ea472]=_[_0x0a9e('0x21')](_0x2eb11f[_0x5ea472],_0x478723);}return _0x2eb11f;};var getChanSpyPromise=function(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){return _0x40c424['VoiceChanSpy'][_0x0a9e('0x22')]()['then'](function(_0x1dc186){if(_0x1dc186){var _0x34dc65=getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x23')],_0x1dc186);if(_0x33161b[_0x0a9e('0x23')]!=_0x33161b[_0x0a9e('0x13')]){_0x34dc65=_0x34dc65[_0x0a9e('0x24')](getChanSpyApplications(_0x33161b,_0x33161b[_0x0a9e('0x13')],_0x1dc186));}return _0x526cf3(_0x34dc65);}return _0x526cf3([]);})[_0x0a9e('0x25')](function(_0x5a101a){_0x384319(_0x5a101a);});});};module[_0x0a9e('0x26')]=function(_0x468813,_0x2b1f27){var _0x2ec755=_0x468813['models'];return _0x468813[_0x0a9e('0x27')](_0x0a9e('0x28'),attributes,{'tableName':_0x0a9e('0x29'),'charset':_0x0a9e('0x2a'),'collate':_0x0a9e('0x2b'),'hooks':{'beforeCreate':function(_0x563b45,_0x296f41,_0x2e8759){_0x563b45[_0x0a9e('0x2c')]();_0x563b45['updatePassword'](_0x2e8759);},'beforeUpdate':function(_0x426950,_0x5d1e0e,_0x2407f9){if(_0x426950[_0x0a9e('0x2d')](_0x0a9e('0x10'))){_0x426950[_0x0a9e('0x2c')]();return _0x426950[_0x0a9e('0x2e')](_0x2407f9);}_0x2407f9();},'afterCreate':function(_0x5180f1,_0x66c1d2,_0x46f0a5){var _0x40cb85=getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x23')]);if(_0x5180f1[_0x0a9e('0x23')]!=_0x5180f1[_0x0a9e('0x13')]){_0x40cb85=_0x40cb85[_0x0a9e('0x24')](getUserApplications(_0x5180f1,_0x5180f1[_0x0a9e('0x13')]));}return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x40cb85)['then'](function(){if(_0x5180f1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x5180f1);}})[_0x0a9e('0x31')](function(_0x2b7e7f){if(_0x2b7e7f&&_0x2b7e7f[_0x0a9e('0x4')]){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x2b7e7f);}})[_0x0a9e('0x31')](function(){_0x46f0a5();})[_0x0a9e('0x25')](function(_0x15de0e){_0x46f0a5(_0x15de0e);});},'afterUpdate':function(_0x4853b1,_0x54135e,_0x1e8694){return BPromise['resolve']()[_0x0a9e('0x31')](function(){if(_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x30'))||_0x4853b1[_0x0a9e('0x2d')]('context')){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0x4853b1['id'],'type':_0x0a9e('0x7'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x4853b1[_0x0a9e('0x30')]){return getChanSpyPromise(_0x2ec755,_0x4853b1)[_0x0a9e('0x31')](function(_0x289467){if(_0x289467&&_0x289467['length']){return _0x2ec755['VoiceExtension'][_0x0a9e('0x2f')](_0x289467);}});}});}})[_0x0a9e('0x31')](function(){if(_0x4853b1['changed'](_0x0a9e('0x19'))||_0x4853b1[_0x0a9e('0x2d')](_0x0a9e('0x5'))){return _0x2ec755[_0x0a9e('0x32')]['destroy']({'where':{'UserId':_0x4853b1['id'],'type':'system','ChanSpyId':null}})[_0x0a9e('0x31')](function(){var _0x45b3d0=getUserApplications(_0x4853b1,_0x4853b1['internal']);if(_0x4853b1[_0x0a9e('0x23')]!=_0x4853b1[_0x0a9e('0x13')]){_0x45b3d0=_0x45b3d0[_0x0a9e('0x24')](getUserApplications(_0x4853b1,_0x4853b1['name']));}return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x2f')](_0x45b3d0);});}})[_0x0a9e('0x31')](function(){_0x1e8694();})[_0x0a9e('0x25')](function(_0x13cb1f){_0x1e8694(_0x13cb1f);});},'afterDestroy':function(_0xeaa5e5,_0x2881b3){return _0x2ec755[_0x0a9e('0x32')][_0x0a9e('0x33')]({'where':{'UserId':_0xeaa5e5['id'],'type':_0x0a9e('0x7')}});}},'instanceMethods':{'authenticate':function(_0x2c3711,_0x148007){if(!_0x148007){return this[_0x0a9e('0x10')]===this[_0x0a9e('0x34')](_0x2c3711);}var _0x37f6cc=this;this['encryptPassword'](_0x2c3711,function(_0x52628e,_0x473fdc){if(_0x52628e){_0x148007(_0x52628e);}if(_0x37f6cc[_0x0a9e('0x10')]===_0x473fdc){_0x148007(null,!![]);}else{_0x148007(null,![]);}});},'makeSalt':function(_0x405c8f,_0x315881){var _0x1a69dd=0x10;if(typeof arguments[0x0]===_0x0a9e('0x35')){_0x315881=arguments[0x0];_0x405c8f=_0x1a69dd;}else if(typeof arguments[0x1]===_0x0a9e('0x35')){_0x315881=arguments[0x1];}else{throw new Error(_0x0a9e('0x36'));}if(!_0x405c8f){_0x405c8f=_0x1a69dd;}return crypto[_0x0a9e('0x37')](_0x405c8f,function(_0x25c6e6,_0x2c2cb0){if(_0x25c6e6){_0x315881(_0x25c6e6);}return _0x315881(null,_0x2c2cb0[_0x0a9e('0x38')]('base64'));});},'encryptPassword':function(_0x117c99,_0x138b8b){if(!_0x117c99||!this[_0x0a9e('0x39')]){return _0x138b8b?_0x138b8b(null):null;}var _0xfbd5ad=0x2710;var _0x2e8caf=0x40;var _0xbe9d19=new Buffer(this[_0x0a9e('0x39')],_0x0a9e('0x3a'));if(!_0x138b8b){return crypto['pbkdf2Sync'](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'))['toString'](_0x0a9e('0x3a'));}return crypto[_0x0a9e('0x3c')](_0x117c99,_0xbe9d19,_0xfbd5ad,_0x2e8caf,_0x0a9e('0x3b'),function(_0x562fb4,_0x14bec2){if(_0x562fb4){_0x138b8b(_0x562fb4);}return _0x138b8b(null,_0x14bec2[_0x0a9e('0x38')](_0x0a9e('0x3a')));});},'updatePassword':function(_0x34aa5a){if(!this[_0x0a9e('0x10')]){return _0x34aa5a(null);}if(!validatePresenceOf(this[_0x0a9e('0x10')])&&authTypes[_0x0a9e('0x3d')](this['provider'])===-0x1){_0x34aa5a(new Error(_0x0a9e('0x3e')));}var _0x1bde3c=this;this[_0x0a9e('0x3f')](function(_0x16f976,_0x409789){if(_0x16f976){return _0x34aa5a(_0x16f976);}_0x1bde3c[_0x0a9e('0x39')]=_0x409789;_0x1bde3c[_0x0a9e('0x34')](_0x1bde3c[_0x0a9e('0x10')],function(_0x34febd,_0x58a5c2){if(_0x34febd){_0x34aa5a(_0x34febd);}_0x1bde3c[_0x0a9e('0x10')]=_0x58a5c2;_0x34aa5a(null);});});},'updateMd5Password':function(){this[_0x0a9e('0x40')]=md5(this['name']+':asterisk:'+this['password']);return this[_0x0a9e('0x40')];}}});};
\ No newline at end of file
index 87bcb6a..821a91d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x105a35,_0x2e9145){var _0x1b89e6=function(_0x8182d8){while(--_0x8182d8){_0x105a35['push'](_0x105a35['shift']());}};_0x1b89e6(++_0x2e9145);}(_0xb10b,0x12a));var _0xbb10=function(_0x559233,_0x4f4408){_0x559233=_0x559233-0x0;var _0x1a9acb=_0xb10b[_0x559233];return _0x1a9acb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});};
\ No newline at end of file
+var _0xd8b0=['util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser','User','findAll','raw','options','attributes','limit','include','model','map','ShowUser','find','where','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','length','forEach','push','format','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','uniqueid','MemberReport','bulkCreate','type','UnpauseUser','channel','Unknown\x20channel','voice','system','mail','chat','fax','sms','set','%s%s','Pause','PAUSE','findOne','destroy','all','LoginUser','mobile','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash'];(function(_0x31c83d,_0x414282){var _0x2a7f0c=function(_0x2bec37){while(--_0x2bec37){_0x31c83d['push'](_0x31c83d['shift']());}};_0x2a7f0c(++_0x414282);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});config[_0x0d8b('0x9')]=_['defaults'](config[_0x0d8b('0x9')],{'host':_0x0d8b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d8b('0x9')]));require(_0x0d8b('0xb'))[_0x0d8b('0xc')](socket);function respondWithRpcPromise(_0x1f4800,_0x28ff7f,_0x1cac62){return new BPromise(function(_0x2c5e9e,_0x28f87c){return client['request'](_0x1f4800,_0x1cac62)[_0x0d8b('0xd')](function(_0x4e0269){logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));logger[_0x0d8b('0x11')](_0x0d8b('0x12'),_0x28ff7f,_0x0d8b('0x10'),JSON[_0x0d8b('0x13')](_0x4e0269));if(_0x4e0269[_0x0d8b('0x14')]){if(_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x15')]===0x1f4){logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x28f87c(_0x4e0269['error'][_0x0d8b('0x16')]);}logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x2c5e9e(_0x4e0269['error'][_0x0d8b('0x16')]);}else{logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));_0x2c5e9e(_0x4e0269[_0x0d8b('0x17')][_0x0d8b('0x16')]);}})[_0x0d8b('0x18')](function(_0xa3612a){logger['error'](_0x0d8b('0xf'),_0x28ff7f,_0xa3612a);_0x28f87c(_0xa3612a);});});}exports[_0x0d8b('0x19')]=function(_0x196c0a){var _0x143372=this;return new Promise(function(_0x24e8ed,_0x5b709c){return db[_0x0d8b('0x1a')][_0x0d8b('0x1b')]({'raw':_0x196c0a['options']?_0x196c0a['options'][_0x0d8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x196c0a['options']?_0x196c0a['options']['where']||null:null,'attributes':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x1e')]||null:null,'limit':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x1f')]||null:null,'include':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x20')]?_['map'](_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x20')],function(_0x5363e3){return{'model':db[_0x5363e3[_0x0d8b('0x21')]],'as':_0x5363e3['as'],'attributes':_0x5363e3['attributes'],'include':_0x5363e3[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x5363e3[_0x0d8b('0x20')],function(_0x4fe6f9){return{'model':db[_0x4fe6f9['model']],'as':_0x4fe6f9['as'],'attributes':_0x4fe6f9[_0x0d8b('0x1e')],'include':_0x4fe6f9[_0x0d8b('0x20')]?_['map'](_0x4fe6f9[_0x0d8b('0x20')],function(_0x59aa83){return{'model':db[_0x59aa83[_0x0d8b('0x21')]],'as':_0x59aa83['as'],'attributes':_0x59aa83['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xd')](function(_0x48f24f){logger[_0x0d8b('0xe')]('GetUser',_0x196c0a);logger[_0x0d8b('0x11')]('GetUser',_0x196c0a,JSON[_0x0d8b('0x13')](_0x48f24f));_0x24e8ed(_0x48f24f);})[_0x0d8b('0x18')](function(_0x2c058d){logger['error']('GetUser',_0x2c058d['message'],_0x196c0a);_0x5b709c(_0x143372[_0x0d8b('0x14')](0x1f4,_0x2c058d['message']));});});};exports[_0x0d8b('0x23')]=function(_0x54f6f3){var _0x5d05fc=this;return new Promise(function(_0x36017a,_0x1b6920){return db[_0x0d8b('0x1a')][_0x0d8b('0x24')]({'raw':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3[_0x0d8b('0x1d')][_0x0d8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3['options'][_0x0d8b('0x25')]||null:null,'attributes':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3['options'][_0x0d8b('0x1e')]||null:null,'include':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3[_0x0d8b('0x1d')]['include']?_[_0x0d8b('0x22')](_0x54f6f3[_0x0d8b('0x1d')][_0x0d8b('0x20')],function(_0x31ceba){return{'model':db[_0x31ceba[_0x0d8b('0x21')]],'as':_0x31ceba['as'],'attributes':_0x31ceba['attributes'],'include':_0x31ceba[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x31ceba['include'],function(_0x1180ac){return{'model':db[_0x1180ac[_0x0d8b('0x21')]],'as':_0x1180ac['as'],'attributes':_0x1180ac[_0x0d8b('0x1e')],'include':_0x1180ac[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x1180ac['include'],function(_0x497a71){return{'model':db[_0x497a71[_0x0d8b('0x21')]],'as':_0x497a71['as'],'attributes':_0x497a71['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xc179bd){logger[_0x0d8b('0xe')](_0x0d8b('0x23'),_0x54f6f3);logger[_0x0d8b('0x11')](_0x0d8b('0x23'),_0x54f6f3,JSON[_0x0d8b('0x13')](_0xc179bd));_0x36017a(_0xc179bd);})['catch'](function(_0x6e5bab){logger[_0x0d8b('0x14')](_0x0d8b('0x23'),_0x6e5bab[_0x0d8b('0x16')],_0x54f6f3);_0x1b6920(_0x5d05fc[_0x0d8b('0x14')](0x1f4,_0x6e5bab[_0x0d8b('0x16')]));});});};exports[_0x0d8b('0x26')]=function(_0x5c980b){var _0x1d06b6=this;return new Promise(function(_0x34acb5,_0x3fa955){var _0x1f196d;return db['User'][_0x0d8b('0x24')]({'where':_0x5c980b['options'][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27'),_0x0d8b('0x28'),_0x0d8b('0x29'),_0x0d8b('0x2a')]})[_0x0d8b('0xd')](function(_0x1ff17d){if(_0x1ff17d){_0x1f196d=_0x1ff17d;return db[_0x0d8b('0x2b')][_0x0d8b('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1f196d['id']},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x1f196d){return db['MemberReport']['findAll']({'where':{'membername':_0x1f196d['name'],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x1a46f6){if(_0x1f196d){if(_0x1a46f6&&_0x1a46f6[_0x0d8b('0x2d')]){var _0x1e2433=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1b216d=0x0,_0x192de1=_0x1a46f6[_0x0d8b('0x2d')];_0x1b216d<_0x192de1;_0x1b216d++){_0x1a46f6[_0x1b216d]['updateAttributes']({'exitAt':_0x1e2433});}}}})[_0x0d8b('0xd')](function(){if(_0x1f196d){var _0x26941a=[];var _0x5059ad=utils['getChannels']();_0x5059ad[_0x0d8b('0x2e')](function(_0x495870){_0x26941a[_0x0d8b('0x2f')]({'channel':_0x495870,'membername':_0x1f196d['name'],'interface':_['isNil'](_0x1f196d[_0x0d8b('0x2a')])?util[_0x0d8b('0x30')]('SIP/%s',_0x1f196d['name']):_0x1f196d['interface'],'type':'PAUSE','enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data1':_0x5c980b[_0x0d8b('0x32')]['type']||_0x0d8b('0x33'),'role':_0x1f196d[_0x0d8b('0x28')],'internal':_0x1f196d[_0x0d8b('0x29')],'uniqueid':_0x5c980b[_0x0d8b('0x32')][_0x0d8b('0x34')]||null});});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x26941a,{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x1f196d){return _0x1f196d[_0x0d8b('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x5c980b[_0x0d8b('0x32')][_0x0d8b('0x37')]||_0x0d8b('0x33'),'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))});}})[_0x0d8b('0xd')](function(_0xdfcf32){_0x34acb5(_0xdfcf32);})[_0x0d8b('0x18')](function(_0x1e162c){_0x3fa955(_0x1d06b6[_0x0d8b('0x14')](0x1f4,_0x1e162c['message']));});});};exports[_0x0d8b('0x38')]=function(_0x4d8850){var _0x5d29ab=this;return new Promise(function(_0x39a31d,_0x113fb7){var _0x3f943a;return db[_0x0d8b('0x1a')]['findOne']({'where':_0x4d8850[_0x0d8b('0x1d')][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27')]})[_0x0d8b('0xd')](function(_0x45cd22){if(_0x45cd22){_0x3f943a=_0x45cd22;if(_0x4d8850['body']['channel']&&!utils['isValidChannel'](_0x4d8850['body'][_0x0d8b('0x39')])){throw new Error(_0x0d8b('0x3a'));}switch(_0x4d8850['body']['channel']){case _0x0d8b('0x3b'):return db[_0x0d8b('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x3f943a['id']}})['then'](function(){return db[_0x0d8b('0x35')][_0x0d8b('0x24')]({'where':{'channel':_0x4d8850[_0x0d8b('0x32')][_0x0d8b('0x39')],'membername':_0x3f943a[_0x0d8b('0x27')],'type':'PAUSE','exitAt':null}});})[_0x0d8b('0xd')](function(_0x2afe34){if(_0x2afe34){return _0x2afe34['update']({'exitAt':moment()['format'](_0x0d8b('0x31')),'data2':_0x0d8b('0x3c')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3f943a['update']({'voicePause':![]});});case _0x0d8b('0x3d'):case _0x0d8b('0x3e'):case _0x0d8b('0x3f'):case _0x0d8b('0x40'):case'openchannel':return db[_0x0d8b('0x35')]['find']({'where':{'channel':_0x4d8850['body'][_0x0d8b('0x39')],'membername':_0x3f943a[_0x0d8b('0x27')],'type':'PAUSE','exitAt':null}})['then'](function(_0x44ed23){return _0x44ed23[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data2':_0x0d8b('0x3c')},{'individualHooks':!![]});})[_0x0d8b('0xd')](function(){var _0x3978e5={};_[_0x0d8b('0x41')](_0x3978e5,util['format'](_0x0d8b('0x42'),_0x4d8850[_0x0d8b('0x32')][_0x0d8b('0x39')],_0x0d8b('0x43')),![]);return _0x3f943a[_0x0d8b('0x2c')](_0x3978e5);});default:return db[_0x0d8b('0x2b')][_0x0d8b('0x2c')]({'paused':0x0},{'where':{'UserId':_0x3f943a['id']}})[_0x0d8b('0xd')](function(){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x3f943a[_0x0d8b('0x27')],'type':_0x0d8b('0x44'),'exitAt':null}});})[_0x0d8b('0xd')](function(_0x23de9e){var _0x43ad22=[];_0x23de9e['forEach'](function(_0x1e1dce){_0x43ad22[_0x0d8b('0x2f')](_0x1e1dce[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data2':'system'}));});return BPromise['all'](_0x43ad22);})[_0x0d8b('0xd')](function(){return _0x3f943a[_0x0d8b('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x0d8b('0xd')](function(_0xbbb520){_0x39a31d(_0xbbb520);})['catch'](function(_0x199122){_0x113fb7(_0x5d29ab[_0x0d8b('0x14')](0x1f4,_0x199122[_0x0d8b('0x16')]));});});};exports['LogoutUser']=function(_0x2f19f4){var _0x532a85=this;return new Promise(function(_0x2fce07,_0x3ed63e){var _0x1efce6;return db[_0x0d8b('0x1a')][_0x0d8b('0x45')]({'where':_0x2f19f4[_0x0d8b('0x1d')]['where']||{},'attributes':['id',_0x0d8b('0x27')]})['then'](function(_0x71e8d8){if(_0x71e8d8){_0x1efce6=_0x71e8d8;return db[_0x0d8b('0x2b')][_0x0d8b('0x46')]({'where':{'membername':_0x1efce6[_0x0d8b('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x1efce6){return db[_0x0d8b('0x35')][_0x0d8b('0x1b')]({'where':{'membername':_0x1efce6[_0x0d8b('0x27')],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x2ccdae){if(_0x1efce6){if(_0x2ccdae&&_0x2ccdae[_0x0d8b('0x2d')]){var _0x223fd8=[];_0x2ccdae[_0x0d8b('0x2e')](function(_0x2ce282){_0x223fd8[_0x0d8b('0x2f')](_0x2ce282['update']({'exitAt':moment()['format'](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x223fd8);}}})['then'](function(){if(_0x1efce6){return _0x1efce6[_0x0d8b('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x5cc960){_0x2fce07(_0x5cc960);})[_0x0d8b('0x18')](function(_0x1c4e96){_0x3ed63e(_0x532a85['error'](0x1f4,_0x1c4e96['message']));});});};exports[_0x0d8b('0x48')]=function(_0x1c007b){var _0x70e4b2=this;return new Promise(function(_0x435090,_0x2ab72b){var _0x156859;var _0x40d265;var _0x5b4402;var _0x1ca60c;return db['User'][_0x0d8b('0x45')]({'where':_0x1c007b[_0x0d8b('0x1d')][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27'),'role',_0x0d8b('0x49'),'phone',_0x0d8b('0x29'),_0x0d8b('0x4a'),_0x0d8b('0x2a')]})[_0x0d8b('0xd')](function(_0xc5c35f){if(_0xc5c35f){_0x156859=_0xc5c35f;_0x1ca60c=_0x1c007b[_0x0d8b('0x32')][_0x0d8b('0x2a')]?_0x1c007b[_0x0d8b('0x32')][_0x0d8b('0x2a')]:util[_0x0d8b('0x30')]('SIP/%s',_0x156859[_0x0d8b('0x27')]);return db['User'][_0x0d8b('0x4b')]({'where':{'role':_0x0d8b('0x4c'),'online':!![],'id':{'$ne':_0x156859['id']}}});}})['then'](function(_0x1a62b9){if(_0x1a62b9){_0x5b4402=_0x1a62b9;return require('../../config/license/util')[_0x0d8b('0x4d')]();}})[_0x0d8b('0xd')](function(_0x24f75){if(_0x24f75&&_0x24f75[_0x0d8b('0x4e')]&&_0x5b4402>=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});};
\ No newline at end of file
index 9714b54..6c69d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60a3=['remove','update','emit','register','length','./user.events','save'];(function(_0x4f0c2b,_0x2c9d14){var _0x526436=function(_0x2e13b6){while(--_0x2e13b6){_0x4f0c2b['push'](_0x4f0c2b['shift']());}};_0x526436(++_0x2c9d14);}(_0x60a3,0x155));var _0x360a=function(_0xbb43a9,_0x49a46b){_0xbb43a9=_0xbb43a9-0x0;var _0x59d23e=_0x60a3[_0xbb43a9];return _0x59d23e;};'use strict';var UserEvents=require(_0x360a('0x0'));var events=[_0x360a('0x1'),_0x360a('0x2'),_0x360a('0x3')];function createListener(_0x26dec4,_0x2d36f0){return function(_0xad23a5){_0x2d36f0[_0x360a('0x4')](_0x26dec4,_0xad23a5);};}function removeListener(_0x227dc3,_0x31e17b){return function(){UserEvents['removeListener'](_0x227dc3,_0x31e17b);};}exports[_0x360a('0x5')]=function(_0x4ea1f7){for(var _0x25b4d1=0x0,_0x506c08=events[_0x360a('0x6')];_0x25b4d1<_0x506c08;_0x25b4d1++){var _0x51c0f7=events[_0x25b4d1];var _0x2c0b1a=createListener('user:'+_0x51c0f7,_0x4ea1f7);UserEvents['on'](_0x51c0f7,_0x2c0b1a);}};
\ No newline at end of file
+var _0x4579=['register','length','user:','./user.events','save','remove','update','emit','removeListener'];(function(_0x9a323e,_0x3e0c9d){var _0x48cd86=function(_0x303ea9){while(--_0x303ea9){_0x9a323e['push'](_0x9a323e['shift']());}};_0x48cd86(++_0x3e0c9d);}(_0x4579,0xa5));var _0x9457=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4579[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0x9457('0x0'));var events=[_0x9457('0x1'),_0x9457('0x2'),_0x9457('0x3')];function createListener(_0x33ee3b,_0xfb8c26){return function(_0x3d9622){_0xfb8c26[_0x9457('0x4')](_0x33ee3b,_0x3d9622);};}function removeListener(_0x1b0a0c,_0x1377a0){return function(){UserEvents[_0x9457('0x5')](_0x1b0a0c,_0x1377a0);};}exports[_0x9457('0x6')]=function(_0x2d78bb){for(var _0x10a119=0x0,_0x5ee473=events[_0x9457('0x7')];_0x10a119<_0x5ee473;_0x10a119++){var _0x1ed873=events[_0x10a119];var _0x20191b=createListener(_0x9457('0x8')+_0x1ed873,_0x2d78bb);UserEvents['on'](_0x1ed873,_0x20191b);}};
\ No newline at end of file
index a5f8921..3acfd62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a6b=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','express'];(function(_0x3a4e68,_0x51a37a){var _0x10ff21=function(_0x1e06f0){while(--_0x1e06f0){_0x3a4e68['push'](_0x3a4e68['shift']());}};_0x10ff21(++_0x51a37a);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x3ef9a2,_0x3cd67f){_0x3ef9a2=_0x3ef9a2-0x0;var _0x52a458=_0x0a6b[_0x3ef9a2];return _0x52a458;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var auth=require(_0xb0a6('0x2'));var interaction=require(_0xb0a6('0x3'));var config=require(_0xb0a6('0x4'));module['exports']=router;
\ No newline at end of file
+var _0x6365=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6365,0x148));var _0x5636=function(_0x29e4f3,_0x17fe10){_0x29e4f3=_0x29e4f3-0x0;var _0x182601=_0x6365[_0x29e4f3];return _0x182601;};'use strict';var multer=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var path=require(_0x5636('0x2'));var timeout=require(_0x5636('0x3'));var express=require('express');var router=express[_0x5636('0x4')]();var auth=require(_0x5636('0x5'));var interaction=require(_0x5636('0x6'));var config=require(_0x5636('0x7'));module[_0x5636('0x8')]=router;
\ No newline at end of file
index 9d56102..6203d79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e5f=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e5f,0x168));var _0xf5e5=function(_0x244623,_0x12c304){_0x244623=_0x244623-0x0;var _0x27e317=_0x5e5f[_0x244623];return _0x27e317;};'use strict';var Sequelize=require(_0xf5e5('0x0'));module[_0xf5e5('0x1')]={'penalty':{'type':Sequelize[_0xf5e5('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcf02=['sequelize'];(function(_0x2f7c0d,_0x29f1f2){var _0x2505a6=function(_0x63cd5f){while(--_0x63cd5f){_0x2f7c0d['push'](_0x2f7c0d['shift']());}};_0x2505a6(++_0x29f1f2);}(_0xcf02,0x1c4));var _0x2cf0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcf02[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x2cf0('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ea8d59b..43a5983 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f2=['exports','define','UserChatQueue','lodash','util','../../config/logger','api','moment','request-promise','./userChatQueue.attributes'];(function(_0x5cce8f,_0x45f400){var _0x2f30ac=function(_0x52b913){while(--_0x52b913){_0x5cce8f['push'](_0x5cce8f['shift']());}};_0x2f30ac(++_0x45f400);}(_0x28f2,0x193));var _0x228f=function(_0x4914cf,_0x9745fd){_0x4914cf=_0x4914cf-0x0;var _0x5ead11=_0x28f2[_0x4914cf];return _0x5ead11;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var logger=require(_0x228f('0x2'))(_0x228f('0x3'));var moment=require(_0x228f('0x4'));var BPromise=require('bluebird');var rp=require(_0x228f('0x5'));var attributes=require(_0x228f('0x6'));module[_0x228f('0x7')]=function(_0x4303c3,_0x2bb7d7){return _0x4303c3[_0x228f('0x8')](_0x228f('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c9b=['../../config/logger','api','moment','bluebird','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','util'];(function(_0x4aed4e,_0x7b930c){var _0x21133a=function(_0x22c7f9){while(--_0x22c7f9){_0x4aed4e['push'](_0x4aed4e['shift']());}};_0x21133a(++_0x7b930c);}(_0x9c9b,0x194));var _0xb9c9=function(_0x2d254f,_0xcb0501){_0x2d254f=_0x2d254f-0x0;var _0xce880=_0x9c9b[_0x2d254f];return _0xce880;};'use strict';var _=require('lodash');var util=require(_0xb9c9('0x0'));var logger=require(_0xb9c9('0x1'))(_0xb9c9('0x2'));var moment=require(_0xb9c9('0x3'));var BPromise=require(_0xb9c9('0x4'));var rp=require('request-promise');var attributes=require(_0xb9c9('0x5'));module[_0xb9c9('0x6')]=function(_0x4f800e,_0x5d92f4){return _0x4f800e['define'](_0xb9c9('0x7'),attributes,{'tableName':_0xb9c9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 50aafe2..22c5140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f78=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0x9f78,0x76));var _0x89f7=function(_0x271d24,_0x26b059){_0x271d24=_0x271d24-0x0;var _0x8f31e2=_0x9f78[_0x271d24];return _0x8f31e2;};'use strict';var _=require(_0x89f7('0x0'));var util=require(_0x89f7('0x1'));var moment=require(_0x89f7('0x2'));var BPromise=require(_0x89f7('0x3'));var rs=require(_0x89f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89f7('0x5'))['db'];var utils=require(_0x89f7('0x6'));var logger=require('../../config/logger')(_0x89f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x89f7('0x8'));var client=jayson[_0x89f7('0x9')][_0x89f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3400f7,_0xa9269b,_0x4b8d40){return new BPromise(function(_0x3bf576,_0x5e1074){return client['request'](_0x3400f7,_0x4b8d40)[_0x89f7('0xb')](function(_0x5e302c){logger[_0x89f7('0xc')](_0x89f7('0xd'),_0xa9269b,_0x89f7('0xe'));logger[_0x89f7('0xf')](_0x89f7('0x10'),_0xa9269b,_0x89f7('0xe'),JSON[_0x89f7('0x11')](_0x5e302c));if(_0x5e302c[_0x89f7('0x12')]){if(_0x5e302c[_0x89f7('0x12')][_0x89f7('0x13')]===0x1f4){logger['error'](_0x89f7('0xd'),_0xa9269b,_0x5e302c[_0x89f7('0x12')][_0x89f7('0x14')]);return _0x5e1074(_0x5e302c[_0x89f7('0x12')]['message']);}logger[_0x89f7('0x12')](_0x89f7('0xd'),_0xa9269b,_0x5e302c[_0x89f7('0x12')]['message']);return _0x3bf576(_0x5e302c[_0x89f7('0x12')][_0x89f7('0x14')]);}else{logger[_0x89f7('0xc')](_0x89f7('0xd'),_0xa9269b,'request\x20sent');_0x3bf576(_0x5e302c[_0x89f7('0x15')][_0x89f7('0x14')]);}})[_0x89f7('0x16')](function(_0x56e7f8){logger[_0x89f7('0x12')](_0x89f7('0xd'),_0xa9269b,_0x56e7f8);_0x5e1074(_0x56e7f8);});});}
\ No newline at end of file
+var _0x01d0=['code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x01d0,0x14e));var _0x001d=function(_0x3ab1b6,_0x1a0def){_0x3ab1b6=_0x3ab1b6-0x0;var _0x24e8b0=_0x01d0[_0x3ab1b6];return _0x24e8b0;};'use strict';var _=require(_0x001d('0x0'));var util=require(_0x001d('0x1'));var moment=require(_0x001d('0x2'));var BPromise=require(_0x001d('0x3'));var rs=require(_0x001d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x001d('0x5'))['db'];var utils=require(_0x001d('0x6'));var logger=require(_0x001d('0x7'))(_0x001d('0x8'));var config=require(_0x001d('0x9'));var jayson=require(_0x001d('0xa'));var client=jayson[_0x001d('0xb')][_0x001d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3558b5,_0x390050,_0x1c4c4f){return new BPromise(function(_0x12eb0b,_0x3ee8cd){return client['request'](_0x3558b5,_0x1c4c4f)[_0x001d('0xd')](function(_0x1cbf30){logger[_0x001d('0xe')](_0x001d('0xf'),_0x390050,'request\x20sent');logger['debug'](_0x001d('0x10'),_0x390050,'request\x20sent',JSON['stringify'](_0x1cbf30));if(_0x1cbf30[_0x001d('0x11')]){if(_0x1cbf30['error'][_0x001d('0x12')]===0x1f4){logger['error'](_0x001d('0xf'),_0x390050,_0x1cbf30[_0x001d('0x11')][_0x001d('0x13')]);return _0x3ee8cd(_0x1cbf30[_0x001d('0x11')]['message']);}logger['error'](_0x001d('0xf'),_0x390050,_0x1cbf30[_0x001d('0x11')]['message']);return _0x12eb0b(_0x1cbf30[_0x001d('0x11')][_0x001d('0x13')]);}else{logger[_0x001d('0xe')](_0x001d('0xf'),_0x390050,_0x001d('0x14'));_0x12eb0b(_0x1cbf30['result']['message']);}})[_0x001d('0x15')](function(_0x13de95){logger[_0x001d('0x11')](_0x001d('0xf'),_0x390050,_0x13de95);_0x3ee8cd(_0x13de95);});});}
\ No newline at end of file
index 650952f..5690bf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cad=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x576543,_0x1155e8){var _0x10bd36=function(_0x603c6b){while(--_0x603c6b){_0x576543['push'](_0x576543['shift']());}};_0x10bd36(++_0x1155e8);}(_0x8cad,0xfe));var _0xd8ca=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x8cad[_0x22b68a];return _0x1ac67a;};'use strict';var multer=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var path=require(_0xd8ca('0x2'));var timeout=require(_0xd8ca('0x3'));var express=require(_0xd8ca('0x4'));var router=express[_0xd8ca('0x5')]();var auth=require(_0xd8ca('0x6'));var interaction=require(_0xd8ca('0x7'));var config=require(_0xd8ca('0x8'));module[_0xd8ca('0x9')]=router;
\ No newline at end of file
+var _0x9a5a=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x9a5a,0x194));var _0xa9a5=function(_0x5f1565,_0x1d36d6){_0x5f1565=_0x5f1565-0x0;var _0x4389a9=_0x9a5a[_0x5f1565];return _0x4389a9;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var auth=require(_0xa9a5('0x5'));var interaction=require(_0xa9a5('0x6'));var config=require(_0xa9a5('0x7'));module[_0xa9a5('0x8')]=router;
\ No newline at end of file
index a20eb30..54ac995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd3=['sequelize','exports','INTEGER','STRING'];(function(_0x47da40,_0xc5227a){var _0x111013=function(_0x3981ad){while(--_0x3981ad){_0x47da40['push'](_0x47da40['shift']());}};_0x111013(++_0xc5227a);}(_0x5cd3,0x160));var _0x35cd=function(_0x4790c7,_0x12537a){_0x4790c7=_0x4790c7-0x0;var _0x154a0b=_0x5cd3[_0x4790c7];return _0x154a0b;};'use strict';var Sequelize=require(_0x35cd('0x0'));module[_0x35cd('0x1')]={'penalty':{'type':Sequelize[_0x35cd('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x35cd('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x35cd('0x3')]}};
\ No newline at end of file
+var _0xb731=['INTEGER','STRING','sequelize','exports'];(function(_0x2c4605,_0x39834c){var _0x243431=function(_0x2ec345){while(--_0x2ec345){_0x2c4605['push'](_0x2c4605['shift']());}};_0x243431(++_0x39834c);}(_0xb731,0x15e));var _0x1b73=function(_0x147078,_0x4e509c){_0x147078=_0x147078-0x0;var _0x2d2f5c=_0xb731[_0x147078];return _0x2d2f5c;};'use strict';var Sequelize=require(_0x1b73('0x0'));module[_0x1b73('0x1')]={'penalty':{'type':Sequelize[_0x1b73('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1b73('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1b73('0x3')]}};
\ No newline at end of file
index 27c72b5..31c4617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x984b=['bluebird','exports','UserFaxQueue','user_has_fax_queues','api','moment'];(function(_0x3622a7,_0x4dd6ee){var _0xeb6889=function(_0x4610f5){while(--_0x4610f5){_0x3622a7['push'](_0x3622a7['shift']());}};_0xeb6889(++_0x4dd6ee);}(_0x984b,0xee));var _0xb984=function(_0x1ac401,_0x438813){_0x1ac401=_0x1ac401-0x0;var _0x26cdd8=_0x984b[_0x1ac401];return _0x26cdd8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb984('0x0'));var moment=require(_0xb984('0x1'));var BPromise=require(_0xb984('0x2'));var rp=require('request-promise');var attributes=require('./userFaxQueue.attributes');module[_0xb984('0x3')]=function(_0x340f2c,_0x4d8f6a){return _0x340f2c['define'](_0xb984('0x4'),attributes,{'tableName':_0xb984('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c44=['../../config/logger','api','moment','bluebird','request-promise','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues'];(function(_0x50f9ec,_0xeadc57){var _0x142c31=function(_0x222bc5){while(--_0x222bc5){_0x50f9ec['push'](_0x50f9ec['shift']());}};_0x142c31(++_0xeadc57);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var attributes=require(_0x49c4('0x5'));module['exports']=function(_0x4941f1,_0x41a183){return _0x4941f1['define'](_0x49c4('0x6'),attributes,{'tableName':_0x49c4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a1de1c6..badc08e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce21=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0xce21,0x1c3));var _0x1ce2=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0xce21[_0x12bcf7];return _0x2825a;};'use strict';var _=require(_0x1ce2('0x0'));var util=require(_0x1ce2('0x1'));var moment=require(_0x1ce2('0x2'));var BPromise=require(_0x1ce2('0x3'));var rs=require(_0x1ce2('0x4'));var fs=require('fs');var Redis=require(_0x1ce2('0x5'));var db=require(_0x1ce2('0x6'))['db'];var utils=require(_0x1ce2('0x7'));var logger=require(_0x1ce2('0x8'))(_0x1ce2('0x9'));var config=require('../../config/environment');var jayson=require(_0x1ce2('0xa'));var client=jayson[_0x1ce2('0xb')][_0x1ce2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d5773,_0x3f695c,_0x4e5255){return new BPromise(function(_0x188cf8,_0x562701){return client[_0x1ce2('0xd')](_0x1d5773,_0x4e5255)[_0x1ce2('0xe')](function(_0x4becbb){logger[_0x1ce2('0xf')](_0x1ce2('0x10'),_0x3f695c,_0x1ce2('0x11'));logger[_0x1ce2('0x12')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x3f695c,_0x1ce2('0x11'),JSON[_0x1ce2('0x13')](_0x4becbb));if(_0x4becbb[_0x1ce2('0x14')]){if(_0x4becbb['error'][_0x1ce2('0x15')]===0x1f4){logger[_0x1ce2('0x14')](_0x1ce2('0x10'),_0x3f695c,_0x4becbb['error'][_0x1ce2('0x16')]);return _0x562701(_0x4becbb[_0x1ce2('0x14')][_0x1ce2('0x16')]);}logger[_0x1ce2('0x14')](_0x1ce2('0x10'),_0x3f695c,_0x4becbb[_0x1ce2('0x14')][_0x1ce2('0x16')]);return _0x188cf8(_0x4becbb[_0x1ce2('0x14')][_0x1ce2('0x16')]);}else{logger[_0x1ce2('0xf')](_0x1ce2('0x10'),_0x3f695c,'request\x20sent');_0x188cf8(_0x4becbb['result'][_0x1ce2('0x16')]);}})[_0x1ce2('0x17')](function(_0x2755ed){logger['error'](_0x1ce2('0x10'),_0x3f695c,_0x2755ed);_0x562701(_0x2755ed);});});}
\ No newline at end of file
+var _0x02d9=['lodash','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x486647,_0xc5b7c){var _0x1934dc=function(_0x43a0e9){while(--_0x43a0e9){_0x486647['push'](_0x486647['shift']());}};_0x1934dc(++_0xc5b7c);}(_0x02d9,0xff));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x902d('0x0'));var util=require('util');var moment=require(_0x902d('0x1'));var BPromise=require(_0x902d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x902d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x902d('0x4'))('rpc');var config=require(_0x902d('0x5'));var jayson=require(_0x902d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x436e29,_0x3c7647,_0x5e037c){return new BPromise(function(_0x2d4051,_0xae3720){return client[_0x902d('0x7')](_0x436e29,_0x5e037c)['then'](function(_0x5ec169){logger[_0x902d('0x8')](_0x902d('0x9'),_0x3c7647,'request\x20sent');logger[_0x902d('0xa')](_0x902d('0xb'),_0x3c7647,_0x902d('0xc'),JSON[_0x902d('0xd')](_0x5ec169));if(_0x5ec169[_0x902d('0xe')]){if(_0x5ec169[_0x902d('0xe')]['code']===0x1f4){logger[_0x902d('0xe')](_0x902d('0x9'),_0x3c7647,_0x5ec169[_0x902d('0xe')]['message']);return _0xae3720(_0x5ec169['error']['message']);}logger[_0x902d('0xe')](_0x902d('0x9'),_0x3c7647,_0x5ec169['error']['message']);return _0x2d4051(_0x5ec169[_0x902d('0xe')][_0x902d('0xf')]);}else{logger[_0x902d('0x8')](_0x902d('0x9'),_0x3c7647,_0x902d('0xc'));_0x2d4051(_0x5ec169[_0x902d('0x10')][_0x902d('0xf')]);}})['catch'](function(_0x4fbc32){logger['error'](_0x902d('0x9'),_0x3c7647,_0x4fbc32);_0xae3720(_0x4fbc32);});});}
\ No newline at end of file
index db90861..1096d19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf52f=['../../components/auth/service','../../config/environment','exports','multer','util','path','express','Router'];(function(_0x301e0a,_0x13ae40){var _0x4a25f8=function(_0xfd570){while(--_0xfd570){_0x301e0a['push'](_0x301e0a['shift']());}};_0x4a25f8(++_0x13ae40);}(_0xf52f,0x113));var _0xff52=function(_0x3e29df,_0x42fdf8){_0x3e29df=_0x3e29df-0x0;var _0x3e3ba9=_0xf52f[_0x3e29df];return _0x3e3ba9;};'use strict';var multer=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var path=require(_0xff52('0x2'));var timeout=require('connect-timeout');var express=require(_0xff52('0x3'));var router=express[_0xff52('0x4')]();var auth=require(_0xff52('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xff52('0x6'));module[_0xff52('0x7')]=router;
\ No newline at end of file
+var _0xed54=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2befbb,_0x37c981){var _0x5b4c59=function(_0x41436d){while(--_0x41436d){_0x2befbb['push'](_0x2befbb['shift']());}};_0x5b4c59(++_0x37c981);}(_0xed54,0xfc));var _0x4ed5=function(_0x3b6a90,_0x3c5649){_0x3b6a90=_0x3b6a90-0x0;var _0x2561d7=_0xed54[_0x3b6a90];return _0x2561d7;};'use strict';var multer=require('multer');var util=require(_0x4ed5('0x0'));var path=require(_0x4ed5('0x1'));var timeout=require(_0x4ed5('0x2'));var express=require(_0x4ed5('0x3'));var router=express['Router']();var auth=require(_0x4ed5('0x4'));var interaction=require(_0x4ed5('0x5'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
index a2bb158..bd6664b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x868e=['sequelize','exports'];(function(_0x3b8394,_0x120adc){var _0x14ff06=function(_0x4aece7){while(--_0x4aece7){_0x3b8394['push'](_0x3b8394['shift']());}};_0x14ff06(++_0x120adc);}(_0x868e,0x162));var _0xe868=function(_0x3b79fb,_0x3710a8){_0x3b79fb=_0x3b79fb-0x0;var _0x5c95af=_0x868e[_0x3b79fb];return _0x5c95af;};'use strict';var Sequelize=require(_0xe868('0x0'));module[_0xe868('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc57e=['sequelize'];(function(_0x409019,_0x4f59c9){var _0x5ca074=function(_0x259431){while(--_0x259431){_0x409019['push'](_0x409019['shift']());}};_0x5ca074(++_0x4f59c9);}(_0xc57e,0x1dc));var _0xec57=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc57e[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xec57('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index cf81e24..c3a380c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45d8=['moment','bluebird','./userMailQueue.attributes','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x13184e,_0xae7d87){var _0x579aa2=function(_0x19eb9f){while(--_0x19eb9f){_0x13184e['push'](_0x13184e['shift']());}};_0x579aa2(++_0xae7d87);}(_0x45d8,0x174));var _0x845d=function(_0x42bd43,_0x59fb77){_0x42bd43=_0x42bd43-0x0;var _0x421e88=_0x45d8[_0x42bd43];return _0x421e88;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var logger=require(_0x845d('0x2'))(_0x845d('0x3'));var moment=require(_0x845d('0x4'));var BPromise=require(_0x845d('0x5'));var rp=require('request-promise');var attributes=require(_0x845d('0x6'));module['exports']=function(_0x20faae,_0x34ad81){return _0x20faae['define']('UserMailQueue',attributes,{'tableName':_0x845d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd237=['exports','UserMailQueue','lodash','util','../../config/logger','api','bluebird','request-promise','./userMailQueue.attributes'];(function(_0x2b9f8e,_0x1612c7){var _0x274bf6=function(_0x1baa86){while(--_0x1baa86){_0x2b9f8e['push'](_0x2b9f8e['shift']());}};_0x274bf6(++_0x1612c7);}(_0xd237,0x14f));var _0x7d23=function(_0x288eae,_0x16e06d){_0x288eae=_0x288eae-0x0;var _0x31841e=_0xd237[_0x288eae];return _0x31841e;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var logger=require(_0x7d23('0x2'))(_0x7d23('0x3'));var moment=require('moment');var BPromise=require(_0x7d23('0x4'));var rp=require(_0x7d23('0x5'));var attributes=require(_0x7d23('0x6'));module[_0x7d23('0x7')]=function(_0x160178,_0x14977a){return _0x160178['define'](_0x7d23('0x8'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7956244..d90c990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f13=['info','UserMailQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x280dd8,_0x5c8eb8){var _0x2a6aa6=function(_0x118d85){while(--_0x118d85){_0x280dd8['push'](_0x280dd8['shift']());}};_0x2a6aa6(++_0x5c8eb8);}(_0x1f13,0x15d));var _0x31f1=function(_0x255de7,_0x5cf047){_0x255de7=_0x255de7-0x0;var _0x51816e=_0x1f13[_0x255de7];return _0x51816e;};'use strict';var _=require(_0x31f1('0x0'));var util=require('util');var moment=require(_0x31f1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31f1('0x2'));var db=require(_0x31f1('0x3'))['db'];var utils=require(_0x31f1('0x4'));var logger=require(_0x31f1('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x31f1('0x6'));var client=jayson[_0x31f1('0x7')][_0x31f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11e598,_0x121c03,_0x43231d){return new BPromise(function(_0x1884a2,_0x2005f1){return client[_0x31f1('0x9')](_0x11e598,_0x43231d)[_0x31f1('0xa')](function(_0x2bb9fd){logger[_0x31f1('0xb')](_0x31f1('0xc'),_0x121c03,'request\x20sent');logger[_0x31f1('0xd')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x121c03,'request\x20sent',JSON[_0x31f1('0xe')](_0x2bb9fd));if(_0x2bb9fd[_0x31f1('0xf')]){if(_0x2bb9fd[_0x31f1('0xf')][_0x31f1('0x10')]===0x1f4){logger[_0x31f1('0xf')](_0x31f1('0xc'),_0x121c03,_0x2bb9fd['error'][_0x31f1('0x11')]);return _0x2005f1(_0x2bb9fd['error'][_0x31f1('0x11')]);}logger[_0x31f1('0xf')](_0x31f1('0xc'),_0x121c03,_0x2bb9fd[_0x31f1('0xf')][_0x31f1('0x11')]);return _0x1884a2(_0x2bb9fd['error']['message']);}else{logger[_0x31f1('0xb')]('UserMailQueue,\x20%s,\x20%s',_0x121c03,_0x31f1('0x12'));_0x1884a2(_0x2bb9fd['result'][_0x31f1('0x11')]);}})[_0x31f1('0x13')](function(_0x58c45f){logger[_0x31f1('0xf')](_0x31f1('0xc'),_0x121c03,_0x58c45f);_0x2005f1(_0x58c45f);});});}
\ No newline at end of file
+var _0x5267=['../../config/utils','../../config/logger','rpc','client','request','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x231497,_0xe3108){var _0x2eb065=function(_0xa2f52c){while(--_0xa2f52c){_0x231497['push'](_0x231497['shift']());}};_0x2eb065(++_0xe3108);}(_0x5267,0xeb));var _0x7526=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5267[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7526('0x0'));var util=require(_0x7526('0x1'));var moment=require(_0x7526('0x2'));var BPromise=require('bluebird');var rs=require(_0x7526('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7526('0x4'))['db'];var utils=require(_0x7526('0x5'));var logger=require(_0x7526('0x6'))(_0x7526('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7526('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce95c,_0xb63495,_0x5afb62){return new BPromise(function(_0x13c5d4,_0xc391ae){return client[_0x7526('0x9')](_0x1ce95c,_0x5afb62)['then'](function(_0x5a9a37){logger['info']('UserMailQueue,\x20%s,\x20%s',_0xb63495,_0x7526('0xa'));logger[_0x7526('0xb')](_0x7526('0xc'),_0xb63495,_0x7526('0xa'),JSON[_0x7526('0xd')](_0x5a9a37));if(_0x5a9a37[_0x7526('0xe')]){if(_0x5a9a37[_0x7526('0xe')][_0x7526('0xf')]===0x1f4){logger[_0x7526('0xe')](_0x7526('0x10'),_0xb63495,_0x5a9a37[_0x7526('0xe')]['message']);return _0xc391ae(_0x5a9a37[_0x7526('0xe')][_0x7526('0x11')]);}logger['error'](_0x7526('0x10'),_0xb63495,_0x5a9a37[_0x7526('0xe')][_0x7526('0x11')]);return _0x13c5d4(_0x5a9a37['error'][_0x7526('0x11')]);}else{logger[_0x7526('0x12')]('UserMailQueue,\x20%s,\x20%s',_0xb63495,'request\x20sent');_0x13c5d4(_0x5a9a37['result'][_0x7526('0x11')]);}})[_0x7526('0x13')](function(_0x4c747f){logger[_0x7526('0xe')](_0x7526('0x10'),_0xb63495,_0x4c747f);_0xc391ae(_0x4c747f);});});}
\ No newline at end of file
index 01b84fe..a64bf89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb194=['../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0xb194,0x1b2));var _0x4b19=function(_0x5bcb11,_0x5b5d84){_0x5bcb11=_0x5bcb11-0x0;var _0x3daa19=_0xb194[_0x5bcb11];return _0x3daa19;};'use strict';var multer=require(_0x4b19('0x0'));var util=require('util');var path=require(_0x4b19('0x1'));var timeout=require(_0x4b19('0x2'));var express=require(_0x4b19('0x3'));var router=express[_0x4b19('0x4')]();var auth=require(_0x4b19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b19('0x6'));module[_0x4b19('0x7')]=router;
\ No newline at end of file
+var _0x0272=['../../components/interaction/service','../../config/environment','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x576b7b,_0x6b0d39){var _0x58eab3=function(_0x3ef878){while(--_0x3ef878){_0x576b7b['push'](_0x576b7b['shift']());}};_0x58eab3(++_0x6b0d39);}(_0x0272,0x15a));var _0x2027=function(_0x5b3277,_0x127b1d){_0x5b3277=_0x5b3277-0x0;var _0x4e3cd1=_0x0272[_0x5b3277];return _0x4e3cd1;};'use strict';var multer=require(_0x2027('0x0'));var util=require(_0x2027('0x1'));var path=require('path');var timeout=require(_0x2027('0x2'));var express=require(_0x2027('0x3'));var router=express[_0x2027('0x4')]();var auth=require(_0x2027('0x5'));var interaction=require(_0x2027('0x6'));var config=require(_0x2027('0x7'));module['exports']=router;
\ No newline at end of file
index d0709d0..f4efb79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf06=['exports','INTEGER','sequelize'];(function(_0x44fee6,_0x4afc8d){var _0x23662d=function(_0x59cd70){while(--_0x59cd70){_0x44fee6['push'](_0x44fee6['shift']());}};_0x23662d(++_0x4afc8d);}(_0xaf06,0x185));var _0x6af0=function(_0x3aeae1,_0x861450){_0x3aeae1=_0x3aeae1-0x0;var _0x5b0a8f=_0xaf06[_0x3aeae1];return _0x5b0a8f;};'use strict';var Sequelize=require(_0x6af0('0x0'));module[_0x6af0('0x1')]={'penalty':{'type':Sequelize[_0x6af0('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcae6=['INTEGER','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xcae6,0xfd));var _0x6cae=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0xcae6[_0x47242d];return _0x30273a;};'use strict';var Sequelize=require(_0x6cae('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6cae('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 736bf30..1d2df72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x202e=['../../config/logger','moment','request-promise','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0x202e,0x14b));var _0xe202=function(_0x5d614f,_0x52a558){_0x5d614f=_0x5d614f-0x0;var _0x2017eb=_0x202e[_0x5d614f];return _0x2017eb;};'use strict';var _=require(_0xe202('0x0'));var util=require(_0xe202('0x1'));var logger=require(_0xe202('0x2'))('api');var moment=require(_0xe202('0x3'));var BPromise=require('bluebird');var rp=require(_0xe202('0x4'));var attributes=require(_0xe202('0x5'));module[_0xe202('0x6')]=function(_0x5bf45b,_0x4e4788){return _0x5bf45b[_0xe202('0x7')]('UserOpenchannelQueue',attributes,{'tableName':_0xe202('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf5a=['lodash','../../config/logger','api','moment','bluebird','request-promise','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues'];(function(_0x5abeeb,_0x3cb886){var _0x18b695=function(_0x11c92c){while(--_0x11c92c){_0x5abeeb['push'](_0x5abeeb['shift']());}};_0x18b695(++_0x3cb886);}(_0xaf5a,0xb4));var _0xaaf5=function(_0x5de237,_0x2058e8){_0x5de237=_0x5de237-0x0;var _0x3b3d4d=_0xaf5a[_0x5de237];return _0x3b3d4d;};'use strict';var _=require(_0xaaf5('0x0'));var util=require('util');var logger=require(_0xaaf5('0x1'))(_0xaaf5('0x2'));var moment=require(_0xaaf5('0x3'));var BPromise=require(_0xaaf5('0x4'));var rp=require(_0xaaf5('0x5'));var attributes=require(_0xaaf5('0x6'));module[_0xaaf5('0x7')]=function(_0x408458,_0x528797){return _0x408458[_0xaaf5('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0xaaf5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 54641f8..88a7b9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1468=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1468,0xca));var _0x8146=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x1468[_0x163040];return _0x364667;};'use strict';var _=require(_0x8146('0x0'));var util=require('util');var moment=require(_0x8146('0x1'));var BPromise=require(_0x8146('0x2'));var rs=require(_0x8146('0x3'));var fs=require('fs');var Redis=require(_0x8146('0x4'));var db=require(_0x8146('0x5'))['db'];var utils=require(_0x8146('0x6'));var logger=require('../../config/logger')(_0x8146('0x7'));var config=require(_0x8146('0x8'));var jayson=require(_0x8146('0x9'));var client=jayson[_0x8146('0xa')][_0x8146('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e7f61,_0x1314ef,_0x352da5){return new BPromise(function(_0x5a85c3,_0x7c2786){return client['request'](_0x1e7f61,_0x352da5)[_0x8146('0xc')](function(_0x240d4b){logger[_0x8146('0xd')](_0x8146('0xe'),_0x1314ef,_0x8146('0xf'));logger[_0x8146('0x10')](_0x8146('0x11'),_0x1314ef,_0x8146('0xf'),JSON[_0x8146('0x12')](_0x240d4b));if(_0x240d4b[_0x8146('0x13')]){if(_0x240d4b['error'][_0x8146('0x14')]===0x1f4){logger[_0x8146('0x13')](_0x8146('0xe'),_0x1314ef,_0x240d4b[_0x8146('0x13')][_0x8146('0x15')]);return _0x7c2786(_0x240d4b[_0x8146('0x13')][_0x8146('0x15')]);}logger[_0x8146('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1314ef,_0x240d4b['error'][_0x8146('0x15')]);return _0x5a85c3(_0x240d4b[_0x8146('0x13')]['message']);}else{logger[_0x8146('0xd')](_0x8146('0xe'),_0x1314ef,_0x8146('0xf'));_0x5a85c3(_0x240d4b[_0x8146('0x16')][_0x8146('0x15')]);}})['catch'](function(_0x2a63aa){logger[_0x8146('0x13')](_0x8146('0xe'),_0x1314ef,_0x2a63aa);_0x7c2786(_0x2a63aa);});});}
\ No newline at end of file
+var _0x3f22=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5df791,_0x488175){var _0x2a32c8=function(_0x4d5dfb){while(--_0x4d5dfb){_0x5df791['push'](_0x5df791['shift']());}};_0x2a32c8(++_0x488175);}(_0x3f22,0xca));var _0x23f2=function(_0x321127,_0x11caf7){_0x321127=_0x321127-0x0;var _0xff7567=_0x3f22[_0x321127];return _0xff7567;};'use strict';var _=require(_0x23f2('0x0'));var util=require('util');var moment=require(_0x23f2('0x1'));var BPromise=require(_0x23f2('0x2'));var rs=require(_0x23f2('0x3'));var fs=require('fs');var Redis=require(_0x23f2('0x4'));var db=require(_0x23f2('0x5'))['db'];var utils=require(_0x23f2('0x6'));var logger=require(_0x23f2('0x7'))('rpc');var config=require(_0x23f2('0x8'));var jayson=require(_0x23f2('0x9'));var client=jayson[_0x23f2('0xa')][_0x23f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20c149,_0x3dbd2f,_0x3cf5ae){return new BPromise(function(_0x3ce5e3,_0x1059f9){return client[_0x23f2('0xc')](_0x20c149,_0x3cf5ae)[_0x23f2('0xd')](function(_0x4f130a){logger[_0x23f2('0xe')](_0x23f2('0xf'),_0x3dbd2f,_0x23f2('0x10'));logger[_0x23f2('0x11')](_0x23f2('0x12'),_0x3dbd2f,_0x23f2('0x10'),JSON['stringify'](_0x4f130a));if(_0x4f130a['error']){if(_0x4f130a[_0x23f2('0x13')][_0x23f2('0x14')]===0x1f4){logger[_0x23f2('0x13')](_0x23f2('0xf'),_0x3dbd2f,_0x4f130a['error'][_0x23f2('0x15')]);return _0x1059f9(_0x4f130a[_0x23f2('0x13')]['message']);}logger[_0x23f2('0x13')](_0x23f2('0xf'),_0x3dbd2f,_0x4f130a[_0x23f2('0x13')]['message']);return _0x3ce5e3(_0x4f130a[_0x23f2('0x13')][_0x23f2('0x15')]);}else{logger[_0x23f2('0xe')](_0x23f2('0xf'),_0x3dbd2f,_0x23f2('0x10'));_0x3ce5e3(_0x4f130a[_0x23f2('0x16')][_0x23f2('0x15')]);}})[_0x23f2('0x17')](function(_0x2f81ed){logger[_0x23f2('0x13')](_0x23f2('0xf'),_0x3dbd2f,_0x2f81ed);_0x1059f9(_0x2f81ed);});});}
\ No newline at end of file
index 988fe6d..bd94301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3138=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/resources','post','create','/:id/clone','/:id/sections','put','delete','destroy','removeResources','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3138,0x176));var _0x8313=function(_0x40741a,_0x41f657){_0x40741a=_0x40741a-0x0;var _0x34c353=_0x3138[_0x40741a];return _0x34c353;};'use strict';var multer=require(_0x8313('0x0'));var util=require(_0x8313('0x1'));var path=require(_0x8313('0x2'));var timeout=require(_0x8313('0x3'));var express=require(_0x8313('0x4'));var router=express[_0x8313('0x5')]();var auth=require(_0x8313('0x6'));var interaction=require(_0x8313('0x7'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x8313('0x8')]('/',auth[_0x8313('0x9')](),controller[_0x8313('0xa')]);router['get'](_0x8313('0xb'),auth[_0x8313('0x9')](),controller[_0x8313('0xc')]);router['get'](_0x8313('0xd'),auth[_0x8313('0x9')](),controller[_0x8313('0xe')]);router[_0x8313('0x8')](_0x8313('0xf'),auth[_0x8313('0x9')](),controller['getResources']);router[_0x8313('0x10')]('/',auth[_0x8313('0x9')](),controller[_0x8313('0x11')]);router[_0x8313('0x10')](_0x8313('0x12'),auth[_0x8313('0x9')](),controller['clone']);router[_0x8313('0x10')](_0x8313('0x13'),auth[_0x8313('0x9')](),controller['addSections']);router[_0x8313('0x10')](_0x8313('0xf'),auth['isAuthenticated'](),controller['addResources']);router[_0x8313('0x14')]('/:id',auth[_0x8313('0x9')](),controller['update']);router[_0x8313('0x15')](_0x8313('0xd'),auth['isAuthenticated'](),controller[_0x8313('0x16')]);router[_0x8313('0x15')](_0x8313('0x13'),auth[_0x8313('0x9')](),controller['removeSections']);router[_0x8313('0x15')]('/:id/resources',auth[_0x8313('0x9')](),controller[_0x8313('0x17')]);module[_0x8313('0x18')]=router;
\ No newline at end of file
+var _0xc380=['../../components/interaction/service','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/resources','getResources','create','post','/:id/clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','util','path','express','Router','../../components/auth/service'];(function(_0x4c3540,_0x11ce62){var _0x1d43a7=function(_0x22c0b6){while(--_0x22c0b6){_0x4c3540['push'](_0x4c3540['shift']());}};_0x1d43a7(++_0x11ce62);}(_0xc380,0x13a));var _0x0c38=function(_0xf1cf49,_0x26c4b7){_0xf1cf49=_0xf1cf49-0x0;var _0x2f3ff3=_0xc380[_0xf1cf49];return _0x2f3ff3;};'use strict';var multer=require('multer');var util=require(_0x0c38('0x0'));var path=require(_0x0c38('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c38('0x2'));var router=express[_0x0c38('0x3')]();var auth=require(_0x0c38('0x4'));var interaction=require(_0x0c38('0x5'));var config=require('../../config/environment');var controller=require(_0x0c38('0x6'));router[_0x0c38('0x7')]('/',auth['isAuthenticated'](),controller[_0x0c38('0x8')]);router[_0x0c38('0x7')](_0x0c38('0x9'),auth[_0x0c38('0xa')](),controller[_0x0c38('0xb')]);router[_0x0c38('0x7')](_0x0c38('0xc'),auth[_0x0c38('0xa')](),controller[_0x0c38('0xd')]);router['get'](_0x0c38('0xe'),auth['isAuthenticated'](),controller[_0x0c38('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0c38('0x10')]);router[_0x0c38('0x11')](_0x0c38('0x12'),auth[_0x0c38('0xa')](),controller['clone']);router[_0x0c38('0x11')](_0x0c38('0x13'),auth[_0x0c38('0xa')](),controller[_0x0c38('0x14')]);router[_0x0c38('0x11')](_0x0c38('0xe'),auth[_0x0c38('0xa')](),controller[_0x0c38('0x15')]);router[_0x0c38('0x16')](_0x0c38('0xc'),auth[_0x0c38('0xa')](),controller[_0x0c38('0x17')]);router[_0x0c38('0x18')](_0x0c38('0xc'),auth['isAuthenticated'](),controller[_0x0c38('0x19')]);router[_0x0c38('0x18')]('/:id/sections',auth[_0x0c38('0xa')](),controller[_0x0c38('0x1a')]);router[_0x0c38('0x18')]('/:id/resources',auth[_0x0c38('0xa')](),controller[_0x0c38('0x1b')]);module[_0x0c38('0x1c')]=router;
\ No newline at end of file
index 1a1d45b..7706e95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb18=['crudPermissions','join','getDataValue','split','STRING','name','setDataValue'];(function(_0x5d4bb8,_0x435166){var _0x5162de=function(_0x36a900){while(--_0x36a900){_0x5d4bb8['push'](_0x5d4bb8['shift']());}};_0x5162de(++_0x435166);}(_0xeb18,0xf9));var _0x8eb1=function(_0x48b724,_0x5a8e26){_0x48b724=_0x48b724-0x0;var _0x4d38b3=_0xeb18[_0x48b724];return _0x4d38b3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8eb1('0x0')],'allowNull':![],'unique':_0x8eb1('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x154e0a){this[_0x8eb1('0x2')](_0x8eb1('0x3'),_0x154e0a?_0x154e0a[_0x8eb1('0x4')](''):[]);},'get':function(){return this[_0x8eb1('0x5')](_0x8eb1('0x3'))?this['getDataValue'](_0x8eb1('0x3'))[_0x8eb1('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8eb1('0x0')],'allowNull':!![]}};
\ No newline at end of file
+var _0xa667=['sequelize','exports','STRING','setDataValue','join','getDataValue','crudPermissions','split'];(function(_0x54f894,_0x3be5a1){var _0xcd34f7=function(_0x715c5f){while(--_0x715c5f){_0x54f894['push'](_0x54f894['shift']());}};_0xcd34f7(++_0x3be5a1);}(_0xa667,0x1a0));var _0x7a66=function(_0x20f972,_0x427c17){_0x20f972=_0x20f972-0x0;var _0x1e6021=_0xa667[_0x20f972];return _0x1e6021;};'use strict';var Sequelize=require(_0x7a66('0x0'));module[_0x7a66('0x1')]={'name':{'type':Sequelize[_0x7a66('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x7a66('0x2')],'set':function(_0x490209){this[_0x7a66('0x3')]('crudPermissions',_0x490209?_0x490209[_0x7a66('0x4')](''):[]);},'get':function(){return this[_0x7a66('0x5')](_0x7a66('0x6'))?this['getDataValue'](_0x7a66('0x6'))[_0x7a66('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7a66('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 729d9a8..2bcd6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','sequelize','removeSections','ids','addResources','bulkCreate','removeResources','section','undefined','Sequelize','Unknown\x20section','mergeResources','ValidationError','parentSections','findOne','push','all','isEmpty','union','ignore','childModel','limit','foreignKey','resourceIds','forEach','key','VIRTUAL','AnalyticExtractedReport','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','CmContact','Tag','Tags','ThroughTags','tag','value','resourceFields','resourceId','toLowerCase','squareprojects','SquareProject','odbc','squarerecordings','SquareRecording','projects','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','VoiceQueues','queue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','teams','Team','voicequeues','VoiceQueue','QueueCampaigns','users','agents','telephones','Users','admin','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','Trunk','variables','Variable','Plugin','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','count','offset','apply','save','update','then','destroy','error','name','send','index','UserProfile','rawAttributes','query','dateStart','dateEnd','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','add','day','merge','filter','map','type','field','findAll','catch','show','keys','fields','length','includeAll','find','create','body','clone','params','include','options','get','omit','createdAt','updatedAt'];(function(_0x11b417,_0x85dab6){var _0x46563e=function(_0x261260){while(--_0x261260){_0x11b417['push'](_0x11b417['shift']());}};_0x46563e(++_0x85dab6);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 qs=require(_0x7995('0x13'));var logger=require(_0x7995('0x14'))(_0x7995('0x15'));var utils=require(_0x7995('0x16'));var config=require('../../config/environment');var db=require(_0x7995('0x17'))['db'];config[_0x7995('0x18')]=_['defaults'](config[_0x7995('0x18')],{'host':_0x7995('0x19'),'port':0x18eb});var socket=require(_0x7995('0x1a'))(new Redis(config[_0x7995('0x18')]));require(_0x7995('0x1b'))[_0x7995('0x1c')](socket);function respondWithStatusCode(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xcc;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1d')](_0x4cc004);}return _0x2bbe7a[_0x7995('0x1e')](_0x4cc004)[_0x7995('0x1f')]();};}function respondWithResult(_0x321ae8,_0x3f1d3e){_0x3f1d3e=_0x3f1d3e||0xc8;return function(_0x1a5310){if(_0x1a5310){return _0x321ae8[_0x7995('0x1e')](_0x3f1d3e)[_0x7995('0x20')](_0x1a5310);}};}function respondWithFilteredResult(_0x5377e5,_0x2eeacc){return function(_0x565d97){if(_0x565d97){var _0x2f832e=_0x565d97[_0x7995('0x21')],_0x37f297=_0x2eeacc[_0x7995('0x22')],_0x43d4b8=_0x2eeacc['offset']+_0x2eeacc['limit'],_0x291317;if(_0x43d4b8>=_0x2f832e){_0x43d4b8=_0x2f832e;_0x291317=0xc8;}else{_0x291317=0xce;}_0x5377e5[_0x7995('0x1e')](_0x291317);return _0x5377e5['set']('Content-Range',_0x37f297+'-'+_0x43d4b8+'/'+_0x2f832e)[_0x7995('0x20')](_0x565d97);}return null;};}function patchUpdates(_0x3d463e){return function(_0x4cbe10){try{jsonpatch[_0x7995('0x23')](_0x4cbe10,_0x3d463e,!![]);}catch(_0x51f276){return BPromise['reject'](_0x51f276);}return _0x4cbe10[_0x7995('0x24')]();};}function saveUpdates(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x25')](_0x327b1f)[_0x7995('0x26')](function(_0x5d40ae){return _0x5d40ae;});}return null;};}function removeEntity(_0x32a09a,_0x46ee4b){return function(_0x204507){if(_0x204507){return _0x204507[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x32a09a[_0x7995('0x1e')](0xcc)[_0x7995('0x1f')]();});}};}function handleEntityNotFound(_0x472195,_0x59405a){return function(_0x39df42){if(!_0x39df42){_0x472195[_0x7995('0x1d')](0x194);}return _0x39df42;};}function handleError(_0x401dc3,_0x268ce7){_0x268ce7=_0x268ce7||0x1f4;return function(_0x3a3fcf){logger[_0x7995('0x28')](_0x3a3fcf['stack']);if(_0x3a3fcf[_0x7995('0x29')]){delete _0x3a3fcf['name'];}_0x401dc3[_0x7995('0x1e')](_0x268ce7)[_0x7995('0x2a')](_0x3a3fcf);};}exports[_0x7995('0x2b')]=function(_0x132a42,_0x11c1eb){var _0x4b6f99={},_0x9b2a15={},_0x514445={'count':0x0,'rows':[]};var _0x456a28=db[_0x7995('0x2c')][_0x7995('0x2d')];_0x9b2a15['model']=_['keys'](_0x456a28);var _0x48e573={'dateStart':_0x132a42[_0x7995('0x2e')][_0x7995('0x2f')],'dateEnd':_0x132a42[_0x7995('0x2e')][_0x7995('0x30')]};delete _0x132a42[_0x7995('0x2e')][_0x7995('0x2f')];delete _0x132a42['query']['dateEnd'];_0x9b2a15[_0x7995('0x2e')]=_['keys'](_0x132a42[_0x7995('0x2e')]);_0x9b2a15[_0x7995('0x31')]=_[_0x7995('0x32')](_0x9b2a15[_0x7995('0x33')],_0x9b2a15[_0x7995('0x2e')]);_0x4b6f99['attributes']=_[_0x7995('0x32')](_0x9b2a15[_0x7995('0x33')],qs['fields'](_0x132a42['query']['fields']));_0x4b6f99[_0x7995('0x34')]=_0x4b6f99[_0x7995('0x34')]['length']?_0x4b6f99[_0x7995('0x34')]:_0x9b2a15['model'];if(!_0x132a42[_0x7995('0x2e')][_0x7995('0x35')](_0x7995('0x36'))){_0x4b6f99['limit']=qs['limit'](_0x132a42[_0x7995('0x2e')]['limit']);_0x4b6f99['offset']=qs[_0x7995('0x22')](_0x132a42[_0x7995('0x2e')]['offset']);}_0x4b6f99[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x132a42[_0x7995('0x2e')][_0x7995('0x38')]);_0x4b6f99[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x132a42[_0x7995('0x2e')],_0x9b2a15[_0x7995('0x31')]));if(_0x48e573[_0x7995('0x2f')]){if(_0x48e573['dateEnd']){_0x48e573[_0x7995('0x30')]=moment(_0x48e573[_0x7995('0x30')])[_0x7995('0x3b')](0x1,_0x7995('0x3c'));}else{_0x48e573[_0x7995('0x30')]=moment(_0x48e573[_0x7995('0x2f')])['add'](0x1,_0x7995('0x3c'));}_[_0x7995('0x3d')](_0x4b6f99[_0x7995('0x39')],{'createdAt':{'$gte':_0x48e573[_0x7995('0x2f')],'$lte':_0x48e573[_0x7995('0x30')]}});}if(_0x132a42[_0x7995('0x2e')][_0x7995('0x3e')]){_0x4b6f99[_0x7995('0x39')]=_[_0x7995('0x3d')](_0x4b6f99[_0x7995('0x39')],{'$or':_[_0x7995('0x3f')](_0x456a28,function(_0x270d52){if(_0x270d52[_0x7995('0x40')]['key']!=='VIRTUAL'){var _0x334dff={};_0x334dff[_0x270d52[_0x7995('0x41')]]={'$like':'%'+_0x132a42['query']['filter']+'%'};return _0x334dff;}})});}_0x4b6f99=_[_0x7995('0x3d')]({},_0x4b6f99,_0x132a42['options']);var _0x504a33={'where':_0x4b6f99[_0x7995('0x39')]};return db[_0x7995('0x2c')][_0x7995('0x21')](_0x504a33)['then'](function(_0x46ac4f){_0x514445['count']=_0x46ac4f;if(_0x132a42[_0x7995('0x2e')]['includeAll']){_0x4b6f99['include']=[{'all':!![]}];}return db[_0x7995('0x2c')][_0x7995('0x42')](_0x4b6f99);})[_0x7995('0x26')](function(_0x3f1c35){_0x514445['rows']=_0x3f1c35;return _0x514445;})[_0x7995('0x26')](respondWithFilteredResult(_0x11c1eb,_0x4b6f99))[_0x7995('0x43')](handleError(_0x11c1eb,null));};exports[_0x7995('0x44')]=function(_0x6c7bec,_0x4e09b7){var _0x5f28e7={'raw':![],'where':{'id':_0x6c7bec['params']['id']}},_0x1c37c6={};_0x1c37c6[_0x7995('0x33')]=_['keys'](db[_0x7995('0x2c')]['rawAttributes']);_0x1c37c6[_0x7995('0x2e')]=_[_0x7995('0x45')](_0x6c7bec['query']);_0x1c37c6[_0x7995('0x31')]=_[_0x7995('0x32')](_0x1c37c6[_0x7995('0x33')],_0x1c37c6[_0x7995('0x2e')]);_0x5f28e7['attributes']=_[_0x7995('0x32')](_0x1c37c6[_0x7995('0x33')],qs[_0x7995('0x46')](_0x6c7bec['query'][_0x7995('0x46')]));_0x5f28e7[_0x7995('0x34')]=_0x5f28e7[_0x7995('0x34')][_0x7995('0x47')]?_0x5f28e7[_0x7995('0x34')]:_0x1c37c6['model'];if(_0x6c7bec[_0x7995('0x2e')][_0x7995('0x48')]){_0x5f28e7['include']=[{'all':!![]}];}_0x5f28e7=_[_0x7995('0x3d')]({},_0x5f28e7,_0x6c7bec['options']);return db[_0x7995('0x2c')][_0x7995('0x49')](_0x5f28e7)[_0x7995('0x26')](handleEntityNotFound(_0x4e09b7,null))[_0x7995('0x26')](respondWithResult(_0x4e09b7,null))[_0x7995('0x43')](handleError(_0x4e09b7,null));};exports[_0x7995('0x4a')]=function(_0x1579b9,_0x4d46bc){return db[_0x7995('0x2c')][_0x7995('0x4a')](_0x1579b9[_0x7995('0x4b')],{})['then'](respondWithResult(_0x4d46bc,0xc9))[_0x7995('0x43')](handleError(_0x4d46bc,null));};exports[_0x7995('0x4c')]=function(_0x12d4b8,_0x47d1d8){var _0x4ec548={'raw':![],'where':{'id':_0x12d4b8[_0x7995('0x4d')]['id']}},_0x5a592e={};_0x5a592e[_0x7995('0x33')]=_['keys'](db[_0x7995('0x2c')][_0x7995('0x2d')]);_0x4ec548[_0x7995('0x34')]=_[_0x7995('0x32')](_0x5a592e[_0x7995('0x33')],qs['fields'](_0x12d4b8[_0x7995('0x2e')]['fields']));_0x4ec548[_0x7995('0x34')]=_0x4ec548[_0x7995('0x34')][_0x7995('0x47')]?_0x4ec548['attributes']:_0x5a592e['model'];if(_0x12d4b8['query']['includeAll']){_0x4ec548[_0x7995('0x4e')]=[{'all':!![]}];}_0x4ec548=_[_0x7995('0x3d')]({},_0x4ec548,_0x12d4b8[_0x7995('0x4f')]);return db[_0x7995('0x2c')][_0x7995('0x49')](_0x4ec548)[_0x7995('0x26')](handleEntityNotFound(_0x47d1d8,null))[_0x7995('0x26')](function(_0xda6ce8){if(_0xda6ce8){var _0x328671=_0xda6ce8[_0x7995('0x50')]({'plain':!![]});_0x328671=qs[_0x7995('0x51')](_0x328671,['id',_0x7995('0x52'),_0x7995('0x53'),_0x7995('0x54')]);_0x12d4b8[_0x7995('0x4b')]=_[_0x7995('0x51')](_0x12d4b8[_0x7995('0x4b')],['id',_0x7995('0x52'),_0x7995('0x53')]);return db['sequelize'][_0x7995('0x55')](function(_0x630737){return db[_0x7995('0x2c')][_0x7995('0x4a')](_['merge'](_0x328671,_0x12d4b8['body']),{'include':_0x12d4b8[_0x7995('0x2e')][_0x7995('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x630737})[_0x7995('0x26')](function(_0x332a85){var _0x51c50b=_0x332a85[_0x7995('0x50')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x42')]({'where':{'userProfileId':_0x12d4b8[_0x7995('0x4d')]['id']},'raw':!![]})['then'](function(_0x5e2d97){if(_0x5e2d97){return BPromise[_0x7995('0x57')](_0x5e2d97,function(_0x398fac){return new BPromise(function(_0x6c0221,_0x1d69ce){if(_0x398fac[_0x7995('0x58')]===null||_0x398fac[_0x7995('0x58')]===0x1)_0x6c0221(null);return db[_0x7995('0x59')][_0x7995('0x42')]({'where':{'sectionId':_0x398fac['id']},'raw':!![]})[_0x7995('0x26')](function(_0x50caf5){var _0x18f230=_[_0x7995('0x3f')](_0x50caf5,function(_0xdf9e38){return qs[_0x7995('0x51')](_0xdf9e38,['id','createdAt','updatedAt',_0x7995('0x5a')]);});_0x6c0221(_0x18f230);})[_0x7995('0x43')](function(_0x47d5d7){_0x1d69ce(_0x47d5d7);});})[_0x7995('0x26')](function(_0x375fc9){var _0x2e3421=qs[_0x7995('0x51')](_0x398fac,['id',_0x7995('0x52'),'updatedAt']);_0x2e3421[_0x7995('0x5b')]=_0x51c50b['id'];if(_0x375fc9)_0x2e3421['Resources']=_0x375fc9;return _0x2e3421;})[_0x7995('0x26')](function(_0xe31dcb){return db[_0x7995('0x56')][_0x7995('0x4a')](_0xe31dcb,{'include':[{'model':db[_0x7995('0x59')],'as':_0x7995('0x5c')}],'raw':!![],'transaction':_0x630737});});})[_0x7995('0x26')](function(){return _0x51c50b;});}});});});}})[_0x7995('0x26')](respondWithResult(_0x47d1d8,0xc9))[_0x7995('0x43')](handleError(_0x47d1d8,null));};exports[_0x7995('0x25')]=function(_0x2618c4,_0x234d8d){if(_0x2618c4['body']['id']){delete _0x2618c4[_0x7995('0x4b')]['id'];}return db[_0x7995('0x2c')][_0x7995('0x49')]({'where':{'id':_0x2618c4[_0x7995('0x4d')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x234d8d,null))['then'](saveUpdates(_0x2618c4['body'],null))[_0x7995('0x26')](respondWithResult(_0x234d8d,null))[_0x7995('0x43')](handleError(_0x234d8d,null));};exports[_0x7995('0x27')]=function(_0xae6166,_0x5aa2ec){return db[_0x7995('0x2c')]['find']({'where':{'id':_0xae6166['params']['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5aa2ec,null))[_0x7995('0x26')](removeEntity(_0x5aa2ec,null))[_0x7995('0x43')](handleError(_0x5aa2ec,null));};exports[_0x7995('0x5d')]=function(_0x290eae,_0x25d9a4){return db[_0x7995('0x2c')][_0x7995('0x5d')]()[_0x7995('0x26')](respondWithResult(_0x25d9a4,null))[_0x7995('0x43')](handleError(_0x25d9a4,null));};exports['addSections']=function(_0x2dc1f7,_0x8908cd){var _0x3c5802=_0x2dc1f7['body'];return db[_0x7995('0x2c')][_0x7995('0x49')]({'where':{'id':_0x2dc1f7[_0x7995('0x4d')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x8908cd,null))[_0x7995('0x26')](function(_0x51ab1e){if(_0x51ab1e){return db[_0x7995('0x5e')][_0x7995('0x55')](function(_0x2f94c4){return db[_0x7995('0x56')][_0x7995('0x27')]({'where':{'userProfileId':_0x2dc1f7['params']['id'],'sectionId':_['map'](_0x3c5802,function(_0xd07c1c){return _0xd07c1c[_0x7995('0x5a')];})},'transaction':_0x2f94c4})[_0x7995('0x26')](function(){var _0x35aaec=_['map'](_0x3c5802,function(_0x3b45e8){_0x3b45e8[_0x7995('0x5b')]=_0x2dc1f7['params']['id'];return _0x3b45e8;});var _0x480fdb=[];return BPromise[_0x7995('0x57')](_0x35aaec,function(_0x305b5a){return db['UserProfileSection'][_0x7995('0x4a')](_0x305b5a,{'include':[{'model':db['UserProfileResource'],'as':_0x7995('0x5c')}],'raw':!![],'transaction':_0x2f94c4})[_0x7995('0x26')](function(_0x4ff9ff){_0x480fdb['push'](_0x4ff9ff[_0x7995('0x50')]({'plain':!![]}));});})['then'](function(){return _0x480fdb;});});});}})[_0x7995('0x26')](function(_0xa41fff){return _0xa41fff;})[_0x7995('0x26')](respondWithResult(_0x8908cd,null))[_0x7995('0x43')](handleError(_0x8908cd,null));};exports[_0x7995('0x5f')]=function(_0x18cff7,_0x8af865){var _0x14cb17;return db[_0x7995('0x2c')][_0x7995('0x49')]({'where':{'id':_0x18cff7[_0x7995('0x4d')]['id']},'attributes':['id',_0x7995('0x29')]})[_0x7995('0x26')](handleEntityNotFound(_0x8af865,null))[_0x7995('0x26')](function(_0x36e3a7){if(_0x36e3a7){_0x14cb17=_0x36e3a7;return db[_0x7995('0x56')][_0x7995('0x27')]({'where':{'userProfileId':_0x18cff7[_0x7995('0x4d')]['id'],'sectionId':_0x18cff7[_0x7995('0x2e')][_0x7995('0x60')]}});}})[_0x7995('0x26')](function(){return _0x14cb17;})[_0x7995('0x26')](respondWithStatusCode(_0x8af865,null))[_0x7995('0x43')](handleError(_0x8af865,null));};exports[_0x7995('0x61')]=function(_0x260ef1,_0x33479a){return db[_0x7995('0x2c')][_0x7995('0x49')]({'where':{'id':_0x260ef1['params']['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x33479a,null))[_0x7995('0x26')](function(_0x5683b2){if(_0x5683b2){return db['sequelize'][_0x7995('0x55')](function(_0x3fe8fc){return db[_0x7995('0x56')][_0x7995('0x42')]({'where':{'userProfileId':_0x260ef1[_0x7995('0x4d')]['id']},'attributes':['id'],'raw':!![]})[_0x7995('0x26')](function(_0x5507a0){if(_0x5507a0){return db[_0x7995('0x56')][_0x7995('0x27')]({'where':{'userProfileId':_0x260ef1[_0x7995('0x4d')]['id'],'id':_[_0x7995('0x3f')](_0x5507a0,function(_0x7d9c6e){return _0x7d9c6e['id'];})},'transaction':_0x3fe8fc});}})[_0x7995('0x26')](function(_0x151d99){var _0xc93dcb=_['map'](_0x260ef1[_0x7995('0x4b')],function(_0x2b8217){_0x2b8217['userProfileId']=_0x260ef1['params']['id'];return _0x2b8217;});return db[_0x7995('0x56')][_0x7995('0x62')](_0xc93dcb,{'raw':!![],'transaction':_0x3fe8fc});})[_0x7995('0x26')](function(_0x3db7a9){var _0xe42797=_['filter'](_[_0x7995('0x3f')](_0x3db7a9,function(_0x406054){return _0x406054['get']({'plain':!![]});}),{'includeAll':![]});if(_0xe42797){return db[_0x7995('0x56')][_0x7995('0x42')]({'where':{'userProfileId':_0x260ef1['params']['id'],'sectionId':_[_0x7995('0x3f')](_0xe42797,function(_0x4a5bc5){return _0x4a5bc5[_0x7995('0x5a')];})},'attributes':['id',_0x7995('0x5a')],'raw':!![]})[_0x7995('0x26')](function(_0x428a1b){var _0x460fa6=_['map'](_0x260ef1[_0x7995('0x4b')],function(_0x345080){_0x345080[_0x7995('0x5b')]=_0x260ef1['params']['id'];return _0x345080;});return db[_0x7995('0x59')][_0x7995('0x62')](_0x460fa6,{'raw':!![],'transaction':_0x3fe8fc});});}})[_0x7995('0x43')](handleError(_0x33479a,null));});}})[_0x7995('0x26')](function(_0x5d7018){var _0x3356fd=_[_0x7995('0x3f')](_0x5d7018,function(_0x3a5f5e){return _0x3a5f5e['get']({'plain':!![]});});})['then'](respondWithResult(_0x33479a,null))[_0x7995('0x43')](handleError(_0x33479a,null));};exports[_0x7995('0x63')]=function(_0x4800a8,_0x590373,_0x2e3dfe){var _0x1e50b1;return db[_0x7995('0x2c')][_0x7995('0x49')]({'where':{'id':_0x4800a8[_0x7995('0x4d')]['id']}})['then'](handleEntityNotFound(_0x590373,null))['then'](function(_0x393cb7){if(_0x393cb7){return _0x393cb7['removeResources'](_0x4800a8['query'][_0x7995('0x60')]);}})[_0x7995('0x26')](respondWithStatusCode(_0x590373,null))[_0x7995('0x43')](handleError(_0x590373,null));};exports['getResources']=function(_0x3b1309,_0x3cb1d2){var _0x2b0b79={'raw':![],'where':{}};var _0x27889a={};var _0x267a7f={'count':0x0,'rows':[]};var _0x5799d1=_0x3b1309[_0x7995('0x2e')][_0x7995('0x64')];if(typeof _0x5799d1===_0x7995('0x65')){throw new db[(_0x7995('0x66'))]['ValidationError'](_0x7995('0x67'));}var _0x38064a=_0x3b1309['query'][_0x7995('0x68')]||![];var _0x20683e=getQueryModels(_0x5799d1,_0x38064a);if(typeof _0x20683e['childModel']===_0x7995('0x65')){throw new db['Sequelize'][(_0x7995('0x69'))]('Invalid\x20section\x20\x27'+_0x5799d1+'\x27');}var _0x21f496=[];if(!_['isEmpty'](_0x20683e[_0x7995('0x6a')])){_0x21f496=_0x20683e[_0x7995('0x6a')];}else{_0x21f496=[{'name':_0x5799d1}];}return db['UserProfile'][_0x7995('0x6b')]({'where':{'id':_0x3b1309['params']['id']}})['then'](handleEntityNotFound(_0x3cb1d2,null))[_0x7995('0x26')](function(_0x14812d){if(_0x14812d){var _0x784492=[];for(var _0xb7c078=0x0;_0xb7c078<_0x21f496['length'];_0xb7c078++){_0x784492[_0x7995('0x6c')](db[_0x7995('0x56')]['findOne']({'where':{'userProfileId':_0x14812d['id'],'name':_0x21f496[_0xb7c078]['name']},'raw':!![]}));}return BPromise[_0x7995('0x6d')](_0x784492);}})['then'](function(_0x395670){var _0x1446cc=_[_0x7995('0x3e')](_0x395670,function(_0x5b42be){return _0x5b42be?_0x5b42be:undefined;});var _0x48cfb7=_[_0x7995('0x3e')](_0x21f496,['ignore',!![]]);var _0x12e9d9=_[_0x7995('0x6e')](_0x1446cc)&&_[_0x7995('0x6e')](_0x48cfb7)?null:_[_0x7995('0x6f')](_0x48cfb7,_0x1446cc);if(_0x12e9d9){var _0x4ff5e7=[];for(var _0x52d102=0x0;_0x52d102<_0x12e9d9['length'];_0x52d102++){var _0x2d1c71=_[_0x7995('0x49')](_0x21f496,function(_0x23b4c3){return _0x12e9d9[_0x52d102]?_0x23b4c3[_0x7995('0x29')]===_0x12e9d9[_0x52d102][_0x7995('0x29')]:null;});if(_0x2d1c71){if(_0x12e9d9[_0x52d102][_0x7995('0x70')]){_0x4ff5e7['push'](getAllResources(_0x20683e['childModel'],_0x12e9d9[_0x52d102]));}else{if(!_0x12e9d9[_0x52d102][_0x7995('0x58')]){_0x4ff5e7['push'](getAllowedResources(_0x2d1c71,_0x12e9d9[_0x52d102]));}else{if(_0x2d1c71['model']){_0x4ff5e7[_0x7995('0x6c')](getAllFilteredResources(_0x2d1c71,_0x12e9d9[_0x52d102]));}}}}}return BPromise['all'](_0x4ff5e7);}else{return null;}})['then'](function(_0x35c3f3){var _0x3541d7=_0x35c3f3;var _0x3873f3=null;if(_0x3541d7){_0x3873f3=_0x3541d7['length']===0x1?_0x3541d7[0x0]:null;}if(_0x3873f3||_0x3541d7){var _0x21b2db=db[_0x20683e[_0x7995('0x71')]][_0x7995('0x2d')];_0x27889a[_0x7995('0x33')]=_[_0x7995('0x45')](_0x21b2db);_0x27889a[_0x7995('0x2e')]=_[_0x7995('0x45')](_0x3b1309[_0x7995('0x2e')]);_0x27889a[_0x7995('0x31')]=_['intersection'](_0x27889a[_0x7995('0x33')],_0x27889a[_0x7995('0x2e')]);_0x2b0b79[_0x7995('0x34')]=_[_0x7995('0x32')](_0x27889a[_0x7995('0x33')],qs['fields'](_0x3b1309[_0x7995('0x2e')][_0x7995('0x46')]));_0x2b0b79[_0x7995('0x34')]=_0x2b0b79['attributes']['length']?_0x2b0b79['attributes']:_0x27889a[_0x7995('0x33')];if(!_0x3b1309[_0x7995('0x2e')][_0x7995('0x35')](_0x7995('0x36'))){_0x2b0b79[_0x7995('0x72')]=qs[_0x7995('0x72')](_0x3b1309['query'][_0x7995('0x72')]);_0x2b0b79['offset']=qs[_0x7995('0x22')](_0x3b1309[_0x7995('0x2e')][_0x7995('0x22')]);}_0x2b0b79[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x3b1309[_0x7995('0x2e')][_0x7995('0x38')]);_0x2b0b79[_0x7995('0x39')]=qs[_0x7995('0x31')](_[_0x7995('0x3a')](_0x3b1309[_0x7995('0x2e')],_0x27889a['filters']));var _0x281477=[];if(_0x3873f3){var _0x3c9b3c=_[_0x7995('0x49')](_0x21f496,[_0x7995('0x29'),_0x3873f3['name']]);if(_0x3c9b3c['field']){var _0x41b0d5={};_0x41b0d5[_0x3c9b3c[_0x7995('0x73')]]=_0x3873f3[_0x7995('0x74')];_0x281477[_0x7995('0x6c')](_0x41b0d5);}else{_0x2b0b79[_0x7995('0x39')]['id']=_0x3873f3[_0x7995('0x74')];}}else{var _0x281477=[];for(var _0x3a29b8=0x0;_0x3a29b8<_0x3541d7[_0x7995('0x47')];_0x3a29b8++){var _0x3c9b3c=_[_0x7995('0x49')](_0x21f496,[_0x7995('0x29'),_0x3541d7[_0x3a29b8]['name']]);if(_0x3c9b3c['field']){var _0x41b0d5={};if(_0x3c9b3c[_0x7995('0x41')]==='id'){_0x41b0d5[_0x3c9b3c[_0x7995('0x73')]]=_0x3541d7[_0x3a29b8][_0x7995('0x74')];}else{_0x41b0d5[_0x3c9b3c[_0x7995('0x73')]]=_0x3541d7[_0x3a29b8]['resourceFields'];}}else{if(!_0x2b0b79[_0x7995('0x39')]['id'])_0x2b0b79[_0x7995('0x39')]['id']=[];_0x3541d7[_0x3a29b8]['resourceIds'][_0x7995('0x75')](function(_0x53d693){_0x2b0b79[_0x7995('0x39')]['id'][_0x7995('0x6c')](_0x53d693);});}}}if(!_[_0x7995('0x6e')](_0x281477)){_0x2b0b79['where']=_[_0x7995('0x3d')](_0x2b0b79[_0x7995('0x39')],{'$or':_0x281477});}if(_0x3b1309[_0x7995('0x2e')][_0x7995('0x3e')]){_0x2b0b79[_0x7995('0x39')]=_[_0x7995('0x3d')](_0x2b0b79[_0x7995('0x39')],{'$or':_['map'](_0x21b2db,function(_0x4c0a67){if(_0x4c0a67['type'][_0x7995('0x76')]!==_0x7995('0x77')){var _0x5a78e9={};_0x5a78e9[_0x4c0a67['field']]={'$like':'%'+_0x3b1309[_0x7995('0x2e')][_0x7995('0x3e')]+'%'};return _0x5a78e9;}})});}_0x2b0b79=_['merge']({},_0x2b0b79,_0x3b1309['options']);if(_0x3873f3&&!_0x3873f3['autoAssociation']&&_0x20683e['childModel']===_0x7995('0x78')){if(_0x3b1309[_0x7995('0x2e')][_0x7995('0x48')]){_0x2b0b79[_0x7995('0x4e')]=[{'all':!![]}];}return db[_0x20683e['childModel']][_0x7995('0x42')](_0x2b0b79)[_0x7995('0x26')](function(_0x58c3e8){var _0x1fc3a1=[];_0x58c3e8[_0x7995('0x75')](function(_0x1f9652){var _0x580917;switch(_0x1f9652[_0x7995('0x79')]){case _0x7995('0x7a'):_0x580917=_['find'](_0x3873f3[_0x7995('0x74')],function(_0x3fc60f){return _0x3fc60f['id']===_0x1f9652[_0x7995('0x7b')]&&_0x3fc60f[_0x7995('0x40')]===_0x7995('0x7c');});break;case _0x7995('0x7d'):_0x580917=_[_0x7995('0x49')](_0x3873f3[_0x7995('0x74')],function(_0x4254de){return _0x4254de['id']===_0x1f9652[_0x7995('0x7b')]&&_0x4254de[_0x7995('0x40')]===_0x7995('0x7e');});break;}if(_0x580917)_0x1fc3a1[_0x7995('0x6c')](_0x1f9652);});_0x267a7f['count']=_0x1fc3a1[_0x7995('0x47')];_0x267a7f[_0x7995('0x7f')]=_0x1fc3a1;return _0x267a7f;});}else{return db[_0x20683e[_0x7995('0x71')]][_0x7995('0x21')]({'where':_0x2b0b79['where']})[_0x7995('0x26')](function(_0x2e6f4e){_0x267a7f[_0x7995('0x21')]=_0x2e6f4e;if(_0x3b1309['query'][_0x7995('0x48')]){if(_0x20683e[_0x7995('0x71')]===_0x7995('0x80')){_0x2b0b79[_0x7995('0x4e')]=[{'model':db[_0x7995('0x81')],'as':_0x7995('0x82'),'attributes':['id',_0x7995('0x29'),'color'],'required':_0x3b1309[_0x7995('0x2e')]['tag']?!![]:![]},{'model':db[_0x7995('0x81')],'as':_0x7995('0x83'),'attributes':['id',_0x7995('0x29'),'color'],'through':_0x3b1309[_0x7995('0x2e')]['tag']?{'attributes':[],'where':{'TagId':_0x3b1309['query']['tag']||undefined}}:{},'required':_0x3b1309['query'][_0x7995('0x84')]?!![]:![]}];}else{_0x2b0b79[_0x7995('0x4e')]=[{'all':!![]}];}}return db[_0x20683e['childModel']][_0x7995('0x42')](_0x2b0b79);})[_0x7995('0x26')](function(_0x50fccd){_0x267a7f[_0x7995('0x7f')]=_0x50fccd;return _0x267a7f;});}}else{return _0x267a7f;}})[_0x7995('0x26')](respondWithFilteredResult(_0x3cb1d2,_0x2b0b79))[_0x7995('0x43')](handleError(_0x3cb1d2,null));};function getAllResources(_0x45a479,_0x443863){return new BPromise(function(_0x56b5ff,_0x38ea3e){if(_0x443863){var _0x1df81d=_0x443863[_0x7995('0x3e')]?{[_0x443863[_0x7995('0x3e')]['field']]:_0x443863[_0x7995('0x3e')][_0x7995('0x85')]}:undefined;return db[_0x45a479][_0x7995('0x42')]({'where':_0x1df81d,'raw':!![]})[_0x7995('0x26')](function(_0x370bd9){_0x443863[_0x7995('0x74')]=_[_0x7995('0x3f')](_0x370bd9,'id');_0x56b5ff(_0x443863);})[_0x7995('0x43')](function(_0x1c3074){_0x38ea3e(_0x1c3074);});}else{_0x56b5ff(null);}});}function getAllFilteredResources(_0x1fda95,_0x5e08fa){return new BPromise(function(_0x3440e2,_0x521712){var _0x139204=_0x1fda95[_0x7995('0x3e')]?{[_0x1fda95[_0x7995('0x3e')]['field']]:_0x1fda95['filter'][_0x7995('0x85')]}:undefined;return db[_0x1fda95[_0x7995('0x33')]]['findAll']({'where':_0x139204,'raw':!![]})[_0x7995('0x26')](function(_0x5f1abc){_0x5e08fa[_0x7995('0x86')]=_[_0x7995('0x3f')](_0x5f1abc,function(_0x27b1c2){return _0x27b1c2[_0x7995('0x29')];});_0x3440e2(_0x5e08fa);})['catch'](function(_0x4c090a){_0x521712(_0x4c090a);});});}function getAllowedResources(_0x3f57dd,_0x1dee3f){return new BPromise(function(_0x365318,_0x27cb4c){if(_0x1dee3f){return db['UserProfileResource'][_0x7995('0x42')]({'where':{'sectionId':_0x1dee3f['id']},'raw':!![]})[_0x7995('0x26')](function(_0x8b820b){if(_0x3f57dd[_0x7995('0x41')]&&_0x3f57dd[_0x7995('0x41')]!=='id'){_0x1dee3f['resourceFields']=_['map'](_0x8b820b,function(_0x47989f){return _0x47989f[_0x3f57dd[_0x7995('0x41')]];});}else{if(_0x3f57dd[_0x7995('0x71')]==='AnalyticExtractedReport'){_0x1dee3f[_0x7995('0x74')]=_['map'](_0x8b820b,function(_0x29c0f4){return{'id':_0x29c0f4[_0x7995('0x87')],'type':_0x29c0f4[_0x7995('0x40')]};});}else{_0x1dee3f[_0x7995('0x74')]=_['map'](_0x8b820b,function(_0x3fbafb){return _0x3fbafb[_0x7995('0x87')];});}}_0x365318(_0x1dee3f);})[_0x7995('0x43')](function(_0x1d7866){_0x27cb4c(_0x1d7866);});}else{_0x365318(null);}});}function getQueryModels(_0x2023a7,_0x197adc){var _0x1d200d=_0x2023a7[_0x7995('0x88')]();var _0x3323a3={'childModel':undefined,'parentSections':[]};switch(_0x1d200d){case _0x7995('0x89'):_0x3323a3[_0x7995('0x71')]=_0x7995('0x8a');break;case _0x7995('0x8b'):_0x3323a3[_0x7995('0x71')]='SquareOdbc';break;case _0x7995('0x8c'):_0x3323a3['childModel']=_0x7995('0x8d');_0x3323a3[_0x7995('0x6a')]=[{'name':'SquareProjects','field':_0x7995('0x29'),'foreignKey':'projectName'}];break;case _0x7995('0x8e'):_0x3323a3[_0x7995('0x71')]='JscriptyProject';break;case'contacts':_0x3323a3['childModel']=_0x7995('0x80');_0x3323a3[_0x7995('0x6a')]=[{'name':_0x7995('0x8f'),'field':'id','foreignKey':_0x7995('0x90')}];break;case'lists':_0x3323a3[_0x7995('0x71')]=_0x7995('0x91');break;case _0x7995('0x92'):_0x3323a3[_0x7995('0x71')]=_0x7995('0x93');break;case _0x7995('0x94'):_0x3323a3[_0x7995('0x71')]=_0x7995('0x95');break;case'chatqueues':_0x3323a3[_0x7995('0x71')]=_0x7995('0x96');break;case _0x7995('0x97'):_0x3323a3[_0x7995('0x71')]='ChatWebsite';break;case _0x7995('0x98'):_0x3323a3[_0x7995('0x71')]=_0x7995('0x99');break;case _0x7995('0x9a'):_0x3323a3[_0x7995('0x71')]=_0x7995('0x9b');break;case'inboundroutes':case _0x7995('0x9c'):case _0x7995('0x9d'):_0x3323a3[_0x7995('0x71')]=_0x7995('0x9e');break;case _0x7995('0x9f'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xa0');break;case _0x7995('0xa1'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xa2');break;case _0x7995('0xa3'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xa4');_0x3323a3[_0x7995('0x6a')]=[{'name':_0x7995('0xa5'),'field':_0x7995('0x29'),'foreignKey':_0x7995('0xa6'),'model':_0x7995('0xa7'),'filter':{'field':_0x7995('0xa8'),'value':[_0x7995('0xa9')]}},{'name':_0x7995('0xaa'),'field':'name','foreignKey':'membername','model':_0x7995('0xa7'),'filter':{'field':_0x7995('0xa8'),'value':['telephone']}},{'name':_0x7995('0xab'),'field':'name','foreignKey':_0x7995('0xac'),'model':'VoiceQueue'}];break;case _0x7995('0xad'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xae');break;case _0x7995('0xaf'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xb0');break;case _0x7995('0xb1'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xb2');break;case _0x7995('0xb3'):_0x3323a3['childModel']=_0x7995('0xb4');break;case _0x7995('0xb5'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xb6');break;case'mailaccounts':_0x3323a3[_0x7995('0x71')]=_0x7995('0xb7');break;case _0x7995('0xb8'):_0x3323a3[_0x7995('0x71')]='MailSubstatus';break;case _0x7995('0xb9'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xba');break;case _0x7995('0xbb'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xbc');break;case _0x7995('0xbd'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xbe');break;case'smsaccounts':_0x3323a3[_0x7995('0x71')]='SmsAccount';break;case _0x7995('0xbf'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xc0');break;case _0x7995('0xc1'):case'queuecampaigns':_0x3323a3[_0x7995('0x71')]=_0x7995('0xc2');if(_0x197adc){_0x3323a3[_0x7995('0x6a')]=[{'name':_0x7995('0xab')},{'name':_0x7995('0xc3')}];}break;case _0x7995('0xc4'):case _0x7995('0xc5'):case _0x7995('0xc6'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xa7');if(_0x197adc){_0x3323a3[_0x7995('0x6a')]=[{'name':_0x7995('0xc7'),'filter':{'field':_0x7995('0xa8'),'value':[_0x7995('0xc8'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x7995('0xaa')}];}break;case _0x7995('0xc9'):_0x3323a3[_0x7995('0x71')]='ZendeskAccount';break;case _0x7995('0xca'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xcb');break;case'freshdeskaccounts':_0x3323a3[_0x7995('0x71')]=_0x7995('0xcc');break;case _0x7995('0xcd'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xce');break;case _0x7995('0xcf'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xd0');break;case _0x7995('0xd1'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xd2');break;case'vtigeraccounts':_0x3323a3['childModel']=_0x7995('0xa7');break;case'cannedanswers':_0x3323a3[_0x7995('0x71')]=_0x7995('0xd3');break;case _0x7995('0xd4'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xd5');break;case'customdashboards':_0x3323a3['childModel']=_0x7995('0xd6');break;case _0x7995('0xd7'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xd8');break;case _0x7995('0xd9'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xda');break;case _0x7995('0xdb'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xdc');break;case'sounds':_0x3323a3[_0x7995('0x71')]=_0x7995('0xdd');break;case _0x7995('0xde'):_0x3323a3[_0x7995('0x71')]='Tag';break;case'templates':_0x3323a3['childModel']='Template';break;case'triggers':_0x3323a3[_0x7995('0x71')]='Trigger';break;case'trunks':_0x3323a3[_0x7995('0x71')]=_0x7995('0xdf');break;case _0x7995('0xe0'):_0x3323a3['childModel']=_0x7995('0xe1');break;case'plugins':_0x3323a3[_0x7995('0x71')]=_0x7995('0xe2');break;case _0x7995('0xe3'):_0x3323a3['childModel']=_0x7995('0x78');_0x3323a3[_0x7995('0x6a')]=[{'name':_0x7995('0xe4'),'field':'id','foreignKey':'reportId'}];break;case _0x7995('0xe5'):_0x3323a3[_0x7995('0x71')]=_0x7995('0xe6');break;default:return _0x3323a3;}return _0x3323a3;}
\ No newline at end of file
+var _0x5d17=['VoiceQueue','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','teams','Team','voicequeues','VoiceQueues','users','telephones','Users','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','templates','Template','triggers','Trigger','trunks','Trunk','variables','plugins','Plugin','extractedreports','metrics','AnalyticMetric','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','end','status','json','count','offset','set','apply','reject','update','then','destroy','sendStatus','error','send','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','add','merge','map','type','key','VIRTUAL','field','filter','options','UserProfile','findAll','catch','show','params','includeAll','include','find','create','clone','omit','createdAt','crudPermissions','body','updatedAt','sequelize','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','transaction','push','get','removeSections','name','ids','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','isEmpty','parentSections','findOne','all','ignore','union','pick','foreignKey','resourceIds','forEach','AnalyticExtractedReport','reportType','default','reportId','DefaultReports','custom','CustomReports','rows','CmContact','Tag','Tags','tag','ThroughTags','color','resourceFields','resourceId','SquareProject','odbc','SquareOdbc','SquareRecording','projectName','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','User','role','Telephones','telephone','queue'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0x5d17,0x114));var _0x75d1=function(_0x4f2801,_0x366dd1){_0x4f2801=_0x4f2801-0x0;var _0x3ac22a=_0x5d17[_0x4f2801];return _0x3ac22a;};'use strict';var pdf=require(_0x75d1('0x0'));var emlformat=require(_0x75d1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75d1('0x2'));var rp=require(_0x75d1('0x3'));var moment=require(_0x75d1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x75d1('0x5'));var util=require(_0x75d1('0x6'));var path=require(_0x75d1('0x7'));var sox=require(_0x75d1('0x8'));var csv=require('to-csv');var ejs=require(_0x75d1('0x9'));var fs=require('fs');var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0x10'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x75d1('0x11'));var utils=require(_0x75d1('0x12'));var config=require('../../config/environment');var db=require(_0x75d1('0x13'))['db'];config[_0x75d1('0x14')]=_[_0x75d1('0x15')](config[_0x75d1('0x14')],{'host':_0x75d1('0x16'),'port':0x18eb});var socket=require(_0x75d1('0x17'))(new Redis(config['redis']));require(_0x75d1('0x18'))[_0x75d1('0x19')](socket);function respondWithStatusCode(_0x3af408,_0x314a71){_0x314a71=_0x314a71||0xcc;return function(_0x49d723){if(_0x49d723){return _0x3af408['sendStatus'](_0x314a71);}return _0x3af408['status'](_0x314a71)[_0x75d1('0x1a')]();};}function respondWithResult(_0x12fa32,_0x2fd022){_0x2fd022=_0x2fd022||0xc8;return function(_0x52e649){if(_0x52e649){return _0x12fa32[_0x75d1('0x1b')](_0x2fd022)[_0x75d1('0x1c')](_0x52e649);}};}function respondWithFilteredResult(_0x1d30f3,_0x269e82){return function(_0x1160ca){if(_0x1160ca){var _0x39a26b=_0x1160ca[_0x75d1('0x1d')],_0x2845bc=_0x269e82[_0x75d1('0x1e')],_0x59dead=_0x269e82['offset']+_0x269e82['limit'],_0x1bc5de;if(_0x59dead>=_0x39a26b){_0x59dead=_0x39a26b;_0x1bc5de=0xc8;}else{_0x1bc5de=0xce;}_0x1d30f3[_0x75d1('0x1b')](_0x1bc5de);return _0x1d30f3[_0x75d1('0x1f')]('Content-Range',_0x2845bc+'-'+_0x59dead+'/'+_0x39a26b)[_0x75d1('0x1c')](_0x1160ca);}return null;};}function patchUpdates(_0x406143){return function(_0x579731){try{jsonpatch[_0x75d1('0x20')](_0x579731,_0x406143,!![]);}catch(_0xa42dbe){return BPromise[_0x75d1('0x21')](_0xa42dbe);}return _0x579731['save']();};}function saveUpdates(_0x1d9d25,_0x522924){return function(_0x501cc7){if(_0x501cc7){return _0x501cc7[_0x75d1('0x22')](_0x1d9d25)[_0x75d1('0x23')](function(_0x526f6c){return _0x526f6c;});}return null;};}function removeEntity(_0x2c0c21,_0x5e70ec){return function(_0x3a85c0){if(_0x3a85c0){return _0x3a85c0[_0x75d1('0x24')]()[_0x75d1('0x23')](function(){_0x2c0c21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4590ac,_0x45b18f){return function(_0x315ce5){if(!_0x315ce5){_0x4590ac[_0x75d1('0x25')](0x194);}return _0x315ce5;};}function handleError(_0x51d043,_0x280498){_0x280498=_0x280498||0x1f4;return function(_0x2b5848){logger[_0x75d1('0x26')](_0x2b5848['stack']);if(_0x2b5848['name']){delete _0x2b5848['name'];}_0x51d043[_0x75d1('0x1b')](_0x280498)[_0x75d1('0x27')](_0x2b5848);};}exports[_0x75d1('0x28')]=function(_0x468bf0,_0x38653d){var _0x519ceb={},_0x4d292e={},_0x410e16={'count':0x0,'rows':[]};var _0x197f52=db['UserProfile'][_0x75d1('0x29')];_0x4d292e['model']=_[_0x75d1('0x2a')](_0x197f52);var _0x244da6={'dateStart':_0x468bf0[_0x75d1('0x2b')][_0x75d1('0x2c')],'dateEnd':_0x468bf0[_0x75d1('0x2b')]['dateEnd']};delete _0x468bf0[_0x75d1('0x2b')][_0x75d1('0x2c')];delete _0x468bf0[_0x75d1('0x2b')][_0x75d1('0x2d')];_0x4d292e['query']=_[_0x75d1('0x2a')](_0x468bf0['query']);_0x4d292e[_0x75d1('0x2e')]=_[_0x75d1('0x2f')](_0x4d292e['model'],_0x4d292e[_0x75d1('0x2b')]);_0x519ceb[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x4d292e[_0x75d1('0x31')],qs[_0x75d1('0x32')](_0x468bf0['query'][_0x75d1('0x32')]));_0x519ceb[_0x75d1('0x30')]=_0x519ceb[_0x75d1('0x30')][_0x75d1('0x33')]?_0x519ceb['attributes']:_0x4d292e['model'];if(!_0x468bf0['query'][_0x75d1('0x34')](_0x75d1('0x35'))){_0x519ceb[_0x75d1('0x36')]=qs[_0x75d1('0x36')](_0x468bf0[_0x75d1('0x2b')][_0x75d1('0x36')]);_0x519ceb[_0x75d1('0x1e')]=qs[_0x75d1('0x1e')](_0x468bf0[_0x75d1('0x2b')]['offset']);}_0x519ceb[_0x75d1('0x37')]=qs[_0x75d1('0x38')](_0x468bf0[_0x75d1('0x2b')][_0x75d1('0x38')]);_0x519ceb[_0x75d1('0x39')]=qs['filters'](_['pick'](_0x468bf0['query'],_0x4d292e[_0x75d1('0x2e')]));if(_0x244da6[_0x75d1('0x2c')]){if(_0x244da6[_0x75d1('0x2d')]){_0x244da6[_0x75d1('0x2d')]=moment(_0x244da6[_0x75d1('0x2d')])[_0x75d1('0x3a')](0x1,'day');}else{_0x244da6['dateEnd']=moment(_0x244da6['dateStart'])[_0x75d1('0x3a')](0x1,'day');}_['merge'](_0x519ceb[_0x75d1('0x39')],{'createdAt':{'$gte':_0x244da6[_0x75d1('0x2c')],'$lte':_0x244da6[_0x75d1('0x2d')]}});}if(_0x468bf0[_0x75d1('0x2b')]['filter']){_0x519ceb[_0x75d1('0x39')]=_[_0x75d1('0x3b')](_0x519ceb[_0x75d1('0x39')],{'$or':_[_0x75d1('0x3c')](_0x197f52,function(_0x33bbe7){if(_0x33bbe7[_0x75d1('0x3d')][_0x75d1('0x3e')]!==_0x75d1('0x3f')){var _0x2c88f2={};_0x2c88f2[_0x33bbe7[_0x75d1('0x40')]]={'$like':'%'+_0x468bf0[_0x75d1('0x2b')][_0x75d1('0x41')]+'%'};return _0x2c88f2;}})});}_0x519ceb=_[_0x75d1('0x3b')]({},_0x519ceb,_0x468bf0[_0x75d1('0x42')]);var _0x16550e={'where':_0x519ceb[_0x75d1('0x39')]};return db[_0x75d1('0x43')][_0x75d1('0x1d')](_0x16550e)[_0x75d1('0x23')](function(_0x2384aa){_0x410e16[_0x75d1('0x1d')]=_0x2384aa;if(_0x468bf0[_0x75d1('0x2b')]['includeAll']){_0x519ceb['include']=[{'all':!![]}];}return db[_0x75d1('0x43')][_0x75d1('0x44')](_0x519ceb);})[_0x75d1('0x23')](function(_0x1d9853){_0x410e16['rows']=_0x1d9853;return _0x410e16;})[_0x75d1('0x23')](respondWithFilteredResult(_0x38653d,_0x519ceb))[_0x75d1('0x45')](handleError(_0x38653d,null));};exports[_0x75d1('0x46')]=function(_0x329cec,_0x570251){var _0x1c5255={'raw':![],'where':{'id':_0x329cec[_0x75d1('0x47')]['id']}},_0xfa2137={};_0xfa2137[_0x75d1('0x31')]=_['keys'](db[_0x75d1('0x43')]['rawAttributes']);_0xfa2137[_0x75d1('0x2b')]=_[_0x75d1('0x2a')](_0x329cec[_0x75d1('0x2b')]);_0xfa2137[_0x75d1('0x2e')]=_[_0x75d1('0x2f')](_0xfa2137[_0x75d1('0x31')],_0xfa2137['query']);_0x1c5255[_0x75d1('0x30')]=_['intersection'](_0xfa2137['model'],qs[_0x75d1('0x32')](_0x329cec[_0x75d1('0x2b')][_0x75d1('0x32')]));_0x1c5255[_0x75d1('0x30')]=_0x1c5255[_0x75d1('0x30')][_0x75d1('0x33')]?_0x1c5255[_0x75d1('0x30')]:_0xfa2137['model'];if(_0x329cec['query'][_0x75d1('0x48')]){_0x1c5255[_0x75d1('0x49')]=[{'all':!![]}];}_0x1c5255=_['merge']({},_0x1c5255,_0x329cec[_0x75d1('0x42')]);return db[_0x75d1('0x43')][_0x75d1('0x4a')](_0x1c5255)['then'](handleEntityNotFound(_0x570251,null))[_0x75d1('0x23')](respondWithResult(_0x570251,null))[_0x75d1('0x45')](handleError(_0x570251,null));};exports[_0x75d1('0x4b')]=function(_0x3be4b5,_0x352208){return db[_0x75d1('0x43')][_0x75d1('0x4b')](_0x3be4b5['body'],{})[_0x75d1('0x23')](respondWithResult(_0x352208,0xc9))[_0x75d1('0x45')](handleError(_0x352208,null));};exports[_0x75d1('0x4c')]=function(_0x395e0b,_0x43bd9d){var _0x326f42={'raw':![],'where':{'id':_0x395e0b['params']['id']}},_0x40a179={};_0x40a179[_0x75d1('0x31')]=_[_0x75d1('0x2a')](db[_0x75d1('0x43')]['rawAttributes']);_0x326f42[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x40a179[_0x75d1('0x31')],qs[_0x75d1('0x32')](_0x395e0b[_0x75d1('0x2b')][_0x75d1('0x32')]));_0x326f42['attributes']=_0x326f42[_0x75d1('0x30')][_0x75d1('0x33')]?_0x326f42[_0x75d1('0x30')]:_0x40a179[_0x75d1('0x31')];if(_0x395e0b[_0x75d1('0x2b')][_0x75d1('0x48')]){_0x326f42[_0x75d1('0x49')]=[{'all':!![]}];}_0x326f42=_[_0x75d1('0x3b')]({},_0x326f42,_0x395e0b[_0x75d1('0x42')]);return db[_0x75d1('0x43')][_0x75d1('0x4a')](_0x326f42)[_0x75d1('0x23')](handleEntityNotFound(_0x43bd9d,null))['then'](function(_0x5ba7aa){if(_0x5ba7aa){var _0x41d54f=_0x5ba7aa['get']({'plain':!![]});_0x41d54f=qs[_0x75d1('0x4d')](_0x41d54f,['id',_0x75d1('0x4e'),'updatedAt',_0x75d1('0x4f')]);_0x395e0b[_0x75d1('0x50')]=_[_0x75d1('0x4d')](_0x395e0b[_0x75d1('0x50')],['id',_0x75d1('0x4e'),_0x75d1('0x51')]);return db[_0x75d1('0x52')]['transaction'](function(_0x3c5da6){return db[_0x75d1('0x43')][_0x75d1('0x4b')](_[_0x75d1('0x3b')](_0x41d54f,_0x395e0b[_0x75d1('0x50')]),{'include':_0x395e0b[_0x75d1('0x2b')][_0x75d1('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x3c5da6})[_0x75d1('0x23')](function(_0x22c75a){var _0x349134=_0x22c75a['get']({'plain':!![]});return db['UserProfileSection'][_0x75d1('0x44')]({'where':{'userProfileId':_0x395e0b[_0x75d1('0x47')]['id']},'raw':!![]})[_0x75d1('0x23')](function(_0x49d9ca){if(_0x49d9ca){return BPromise[_0x75d1('0x53')](_0x49d9ca,function(_0x586acb){return new BPromise(function(_0x2005d1,_0x36859a){if(_0x586acb[_0x75d1('0x54')]===null||_0x586acb[_0x75d1('0x54')]===0x1)_0x2005d1(null);return db['UserProfileResource'][_0x75d1('0x44')]({'where':{'sectionId':_0x586acb['id']},'raw':!![]})['then'](function(_0x4b1943){var _0x18d8f3=_[_0x75d1('0x3c')](_0x4b1943,function(_0x286658){return qs[_0x75d1('0x4d')](_0x286658,['id','createdAt','updatedAt',_0x75d1('0x55')]);});_0x2005d1(_0x18d8f3);})[_0x75d1('0x45')](function(_0x4ec3c5){_0x36859a(_0x4ec3c5);});})[_0x75d1('0x23')](function(_0x3fb2eb){var _0x5bcd3a=qs[_0x75d1('0x4d')](_0x586acb,['id',_0x75d1('0x4e'),_0x75d1('0x51')]);_0x5bcd3a[_0x75d1('0x56')]=_0x349134['id'];if(_0x3fb2eb)_0x5bcd3a[_0x75d1('0x57')]=_0x3fb2eb;return _0x5bcd3a;})[_0x75d1('0x23')](function(_0x463d41){return db[_0x75d1('0x58')][_0x75d1('0x4b')](_0x463d41,{'include':[{'model':db[_0x75d1('0x59')],'as':_0x75d1('0x57')}],'raw':!![],'transaction':_0x3c5da6});});})['then'](function(){return _0x349134;});}});});});}})[_0x75d1('0x23')](respondWithResult(_0x43bd9d,0xc9))[_0x75d1('0x45')](handleError(_0x43bd9d,null));};exports[_0x75d1('0x22')]=function(_0x2f0218,_0x3754b1){if(_0x2f0218[_0x75d1('0x50')]['id']){delete _0x2f0218[_0x75d1('0x50')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x2f0218[_0x75d1('0x47')]['id']}})[_0x75d1('0x23')](handleEntityNotFound(_0x3754b1,null))[_0x75d1('0x23')](saveUpdates(_0x2f0218[_0x75d1('0x50')],null))[_0x75d1('0x23')](respondWithResult(_0x3754b1,null))['catch'](handleError(_0x3754b1,null));};exports['destroy']=function(_0x15c5e8,_0x3754d5){return db['UserProfile'][_0x75d1('0x4a')]({'where':{'id':_0x15c5e8[_0x75d1('0x47')]['id']}})[_0x75d1('0x23')](handleEntityNotFound(_0x3754d5,null))[_0x75d1('0x23')](removeEntity(_0x3754d5,null))[_0x75d1('0x45')](handleError(_0x3754d5,null));};exports[_0x75d1('0x5a')]=function(_0x5a4abc,_0x5142d4){return db[_0x75d1('0x43')][_0x75d1('0x5a')]()['then'](respondWithResult(_0x5142d4,null))[_0x75d1('0x45')](handleError(_0x5142d4,null));};exports['addSections']=function(_0x37098c,_0x2730f6){var _0x30fd13=_0x37098c['body'];return db[_0x75d1('0x43')][_0x75d1('0x4a')]({'where':{'id':_0x37098c[_0x75d1('0x47')]['id']}})[_0x75d1('0x23')](handleEntityNotFound(_0x2730f6,null))[_0x75d1('0x23')](function(_0x50d202){if(_0x50d202){return db['sequelize'][_0x75d1('0x5b')](function(_0x58d20b){return db[_0x75d1('0x58')][_0x75d1('0x24')]({'where':{'userProfileId':_0x37098c[_0x75d1('0x47')]['id'],'sectionId':_['map'](_0x30fd13,function(_0x4dcc2d){return _0x4dcc2d[_0x75d1('0x55')];})},'transaction':_0x58d20b})['then'](function(){var _0x419983=_[_0x75d1('0x3c')](_0x30fd13,function(_0x12ebba){_0x12ebba['userProfileId']=_0x37098c[_0x75d1('0x47')]['id'];return _0x12ebba;});var _0x353bec=[];return BPromise[_0x75d1('0x53')](_0x419983,function(_0x41981f){return db[_0x75d1('0x58')][_0x75d1('0x4b')](_0x41981f,{'include':[{'model':db[_0x75d1('0x59')],'as':_0x75d1('0x57')}],'raw':!![],'transaction':_0x58d20b})[_0x75d1('0x23')](function(_0x1ca2ee){_0x353bec[_0x75d1('0x5c')](_0x1ca2ee[_0x75d1('0x5d')]({'plain':!![]}));});})[_0x75d1('0x23')](function(){return _0x353bec;});});});}})[_0x75d1('0x23')](function(_0x4b4a52){return _0x4b4a52;})['then'](respondWithResult(_0x2730f6,null))[_0x75d1('0x45')](handleError(_0x2730f6,null));};exports[_0x75d1('0x5e')]=function(_0x58079c,_0xf54f){var _0x59ec25;return db['UserProfile']['find']({'where':{'id':_0x58079c[_0x75d1('0x47')]['id']},'attributes':['id',_0x75d1('0x5f')]})[_0x75d1('0x23')](handleEntityNotFound(_0xf54f,null))[_0x75d1('0x23')](function(_0x353ec1){if(_0x353ec1){_0x59ec25=_0x353ec1;return db['UserProfileSection'][_0x75d1('0x24')]({'where':{'userProfileId':_0x58079c[_0x75d1('0x47')]['id'],'sectionId':_0x58079c[_0x75d1('0x2b')][_0x75d1('0x60')]}});}})[_0x75d1('0x23')](function(){return _0x59ec25;})['then'](respondWithStatusCode(_0xf54f,null))[_0x75d1('0x45')](handleError(_0xf54f,null));};exports['addResources']=function(_0xfb371c,_0x26e1ad){return db[_0x75d1('0x43')]['find']({'where':{'id':_0xfb371c['params']['id']}})['then'](handleEntityNotFound(_0x26e1ad,null))[_0x75d1('0x23')](function(_0x71f8f9){if(_0x71f8f9){return db[_0x75d1('0x52')][_0x75d1('0x5b')](function(_0x17ec6d){return db[_0x75d1('0x58')]['findAll']({'where':{'userProfileId':_0xfb371c[_0x75d1('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x75d1('0x23')](function(_0x51b0c0){if(_0x51b0c0){return db[_0x75d1('0x58')]['destroy']({'where':{'userProfileId':_0xfb371c['params']['id'],'id':_['map'](_0x51b0c0,function(_0x301b05){return _0x301b05['id'];})},'transaction':_0x17ec6d});}})['then'](function(_0x5852b3){var _0x3f582c=_['map'](_0xfb371c[_0x75d1('0x50')],function(_0x13179c){_0x13179c[_0x75d1('0x56')]=_0xfb371c[_0x75d1('0x47')]['id'];return _0x13179c;});return db[_0x75d1('0x58')][_0x75d1('0x61')](_0x3f582c,{'raw':!![],'transaction':_0x17ec6d});})[_0x75d1('0x23')](function(_0x217347){var _0x51b682=_[_0x75d1('0x41')](_['map'](_0x217347,function(_0x9ec663){return _0x9ec663[_0x75d1('0x5d')]({'plain':!![]});}),{'includeAll':![]});if(_0x51b682){return db[_0x75d1('0x58')]['findAll']({'where':{'userProfileId':_0xfb371c[_0x75d1('0x47')]['id'],'sectionId':_[_0x75d1('0x3c')](_0x51b682,function(_0x3ae1ad){return _0x3ae1ad[_0x75d1('0x55')];})},'attributes':['id',_0x75d1('0x55')],'raw':!![]})[_0x75d1('0x23')](function(_0x1bb574){var _0x5f24ee=_[_0x75d1('0x3c')](_0xfb371c[_0x75d1('0x50')],function(_0x339321){_0x339321[_0x75d1('0x56')]=_0xfb371c[_0x75d1('0x47')]['id'];return _0x339321;});return db['UserProfileResource']['bulkCreate'](_0x5f24ee,{'raw':!![],'transaction':_0x17ec6d});});}})[_0x75d1('0x45')](handleError(_0x26e1ad,null));});}})['then'](function(_0x2339c2){var _0x406d5c=_[_0x75d1('0x3c')](_0x2339c2,function(_0x3cc03d){return _0x3cc03d['get']({'plain':!![]});});})['then'](respondWithResult(_0x26e1ad,null))[_0x75d1('0x45')](handleError(_0x26e1ad,null));};exports[_0x75d1('0x62')]=function(_0x2cf6e0,_0x26ab88,_0x35e630){var _0x4bc6a7;return db[_0x75d1('0x43')][_0x75d1('0x4a')]({'where':{'id':_0x2cf6e0['params']['id']}})[_0x75d1('0x23')](handleEntityNotFound(_0x26ab88,null))[_0x75d1('0x23')](function(_0xa906a6){if(_0xa906a6){return _0xa906a6[_0x75d1('0x62')](_0x2cf6e0[_0x75d1('0x2b')][_0x75d1('0x60')]);}})['then'](respondWithStatusCode(_0x26ab88,null))[_0x75d1('0x45')](handleError(_0x26ab88,null));};exports[_0x75d1('0x63')]=function(_0x39084f,_0x1437ba){var _0x41a561={'raw':![],'where':{}};var _0x348a5c={};var _0x488828={'count':0x0,'rows':[]};var _0x30214e=_0x39084f['query'][_0x75d1('0x64')];if(typeof _0x30214e===_0x75d1('0x65')){throw new db[(_0x75d1('0x66'))][(_0x75d1('0x67'))](_0x75d1('0x68'));}var _0x338675=_0x39084f['query'][_0x75d1('0x69')]||![];var _0x8a5c20=getQueryModels(_0x30214e,_0x338675);if(typeof _0x8a5c20[_0x75d1('0x6a')]==='undefined'){throw new db[(_0x75d1('0x66'))][(_0x75d1('0x67'))]('Invalid\x20section\x20\x27'+_0x30214e+'\x27');}var _0x5767f4=[];if(!_[_0x75d1('0x6b')](_0x8a5c20[_0x75d1('0x6c')])){_0x5767f4=_0x8a5c20[_0x75d1('0x6c')];}else{_0x5767f4=[{'name':_0x30214e}];}return db[_0x75d1('0x43')][_0x75d1('0x6d')]({'where':{'id':_0x39084f[_0x75d1('0x47')]['id']}})[_0x75d1('0x23')](handleEntityNotFound(_0x1437ba,null))[_0x75d1('0x23')](function(_0x57653d){if(_0x57653d){var _0x24280b=[];for(var _0x3af2a9=0x0;_0x3af2a9<_0x5767f4['length'];_0x3af2a9++){_0x24280b[_0x75d1('0x5c')](db[_0x75d1('0x58')]['findOne']({'where':{'userProfileId':_0x57653d['id'],'name':_0x5767f4[_0x3af2a9]['name']},'raw':!![]}));}return BPromise[_0x75d1('0x6e')](_0x24280b);}})[_0x75d1('0x23')](function(_0x4d8e5d){var _0x1f3a7e=_['filter'](_0x4d8e5d,function(_0x3f4df3){return _0x3f4df3?_0x3f4df3:undefined;});var _0x559b80=_[_0x75d1('0x41')](_0x5767f4,[_0x75d1('0x6f'),!![]]);var _0x12839c=_[_0x75d1('0x6b')](_0x1f3a7e)&&_[_0x75d1('0x6b')](_0x559b80)?null:_[_0x75d1('0x70')](_0x559b80,_0x1f3a7e);if(_0x12839c){var _0x2e4e88=[];for(var _0x205e82=0x0;_0x205e82<_0x12839c[_0x75d1('0x33')];_0x205e82++){var _0x709c95=_[_0x75d1('0x4a')](_0x5767f4,function(_0x2c4863){return _0x12839c[_0x205e82]?_0x2c4863[_0x75d1('0x5f')]===_0x12839c[_0x205e82][_0x75d1('0x5f')]:null;});if(_0x709c95){if(_0x12839c[_0x205e82][_0x75d1('0x6f')]){_0x2e4e88[_0x75d1('0x5c')](getAllResources(_0x8a5c20[_0x75d1('0x6a')],_0x12839c[_0x205e82]));}else{if(!_0x12839c[_0x205e82]['autoAssociation']){_0x2e4e88[_0x75d1('0x5c')](getAllowedResources(_0x709c95,_0x12839c[_0x205e82]));}else{if(_0x709c95[_0x75d1('0x31')]){_0x2e4e88[_0x75d1('0x5c')](getAllFilteredResources(_0x709c95,_0x12839c[_0x205e82]));}}}}}return BPromise[_0x75d1('0x6e')](_0x2e4e88);}else{return null;}})[_0x75d1('0x23')](function(_0x104ef2){var _0x37891f=_0x104ef2;var _0x479a43=null;if(_0x37891f){_0x479a43=_0x37891f[_0x75d1('0x33')]===0x1?_0x37891f[0x0]:null;}if(_0x479a43||_0x37891f){var _0x443707=db[_0x8a5c20[_0x75d1('0x6a')]][_0x75d1('0x29')];_0x348a5c[_0x75d1('0x31')]=_[_0x75d1('0x2a')](_0x443707);_0x348a5c[_0x75d1('0x2b')]=_[_0x75d1('0x2a')](_0x39084f[_0x75d1('0x2b')]);_0x348a5c[_0x75d1('0x2e')]=_[_0x75d1('0x2f')](_0x348a5c[_0x75d1('0x31')],_0x348a5c[_0x75d1('0x2b')]);_0x41a561[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x348a5c['model'],qs['fields'](_0x39084f[_0x75d1('0x2b')]['fields']));_0x41a561[_0x75d1('0x30')]=_0x41a561[_0x75d1('0x30')]['length']?_0x41a561[_0x75d1('0x30')]:_0x348a5c[_0x75d1('0x31')];if(!_0x39084f['query'][_0x75d1('0x34')](_0x75d1('0x35'))){_0x41a561[_0x75d1('0x36')]=qs[_0x75d1('0x36')](_0x39084f['query'][_0x75d1('0x36')]);_0x41a561['offset']=qs[_0x75d1('0x1e')](_0x39084f[_0x75d1('0x2b')][_0x75d1('0x1e')]);}_0x41a561[_0x75d1('0x37')]=qs[_0x75d1('0x38')](_0x39084f['query']['sort']);_0x41a561[_0x75d1('0x39')]=qs[_0x75d1('0x2e')](_[_0x75d1('0x71')](_0x39084f[_0x75d1('0x2b')],_0x348a5c[_0x75d1('0x2e')]));var _0x2b3150=[];if(_0x479a43){var _0x14a3ac=_[_0x75d1('0x4a')](_0x5767f4,[_0x75d1('0x5f'),_0x479a43[_0x75d1('0x5f')]]);if(_0x14a3ac[_0x75d1('0x40')]){var _0x371c50={};_0x371c50[_0x14a3ac[_0x75d1('0x72')]]=_0x479a43[_0x75d1('0x73')];_0x2b3150[_0x75d1('0x5c')](_0x371c50);}else{_0x41a561['where']['id']=_0x479a43[_0x75d1('0x73')];}}else{var _0x2b3150=[];for(var _0x5ec65f=0x0;_0x5ec65f<_0x37891f['length'];_0x5ec65f++){var _0x14a3ac=_['find'](_0x5767f4,[_0x75d1('0x5f'),_0x37891f[_0x5ec65f][_0x75d1('0x5f')]]);if(_0x14a3ac[_0x75d1('0x40')]){var _0x371c50={};if(_0x14a3ac['field']==='id'){_0x371c50[_0x14a3ac[_0x75d1('0x72')]]=_0x37891f[_0x5ec65f][_0x75d1('0x73')];}else{_0x371c50[_0x14a3ac['foreignKey']]=_0x37891f[_0x5ec65f]['resourceFields'];}}else{if(!_0x41a561['where']['id'])_0x41a561[_0x75d1('0x39')]['id']=[];_0x37891f[_0x5ec65f][_0x75d1('0x73')][_0x75d1('0x74')](function(_0x4c681f){_0x41a561[_0x75d1('0x39')]['id'][_0x75d1('0x5c')](_0x4c681f);});}}}if(!_[_0x75d1('0x6b')](_0x2b3150)){_0x41a561[_0x75d1('0x39')]=_[_0x75d1('0x3b')](_0x41a561['where'],{'$or':_0x2b3150});}if(_0x39084f[_0x75d1('0x2b')][_0x75d1('0x41')]){_0x41a561[_0x75d1('0x39')]=_[_0x75d1('0x3b')](_0x41a561[_0x75d1('0x39')],{'$or':_['map'](_0x443707,function(_0x386d97){if(_0x386d97[_0x75d1('0x3d')][_0x75d1('0x3e')]!==_0x75d1('0x3f')){var _0x2e7824={};_0x2e7824[_0x386d97['field']]={'$like':'%'+_0x39084f[_0x75d1('0x2b')][_0x75d1('0x41')]+'%'};return _0x2e7824;}})});}_0x41a561=_[_0x75d1('0x3b')]({},_0x41a561,_0x39084f[_0x75d1('0x42')]);if(_0x479a43&&!_0x479a43[_0x75d1('0x54')]&&_0x8a5c20[_0x75d1('0x6a')]===_0x75d1('0x75')){if(_0x39084f[_0x75d1('0x2b')][_0x75d1('0x48')]){_0x41a561[_0x75d1('0x49')]=[{'all':!![]}];}return db[_0x8a5c20[_0x75d1('0x6a')]]['findAll'](_0x41a561)[_0x75d1('0x23')](function(_0x2970b2){var _0x4aa74b=[];_0x2970b2[_0x75d1('0x74')](function(_0x39a941){var _0x9ff4f2;switch(_0x39a941[_0x75d1('0x76')]){case _0x75d1('0x77'):_0x9ff4f2=_[_0x75d1('0x4a')](_0x479a43[_0x75d1('0x73')],function(_0x319cc8){return _0x319cc8['id']===_0x39a941[_0x75d1('0x78')]&&_0x319cc8[_0x75d1('0x3d')]===_0x75d1('0x79');});break;case _0x75d1('0x7a'):_0x9ff4f2=_[_0x75d1('0x4a')](_0x479a43['resourceIds'],function(_0x122a61){return _0x122a61['id']===_0x39a941[_0x75d1('0x78')]&&_0x122a61[_0x75d1('0x3d')]===_0x75d1('0x7b');});break;}if(_0x9ff4f2)_0x4aa74b[_0x75d1('0x5c')](_0x39a941);});_0x488828['count']=_0x4aa74b[_0x75d1('0x33')];_0x488828[_0x75d1('0x7c')]=_0x4aa74b;return _0x488828;});}else{return db[_0x8a5c20[_0x75d1('0x6a')]][_0x75d1('0x1d')]({'where':_0x41a561[_0x75d1('0x39')]})[_0x75d1('0x23')](function(_0x82b1f){_0x488828[_0x75d1('0x1d')]=_0x82b1f;if(_0x39084f[_0x75d1('0x2b')]['includeAll']){if(_0x8a5c20[_0x75d1('0x6a')]===_0x75d1('0x7d')){_0x41a561[_0x75d1('0x49')]=[{'model':db[_0x75d1('0x7e')],'as':_0x75d1('0x7f'),'attributes':['id','name','color'],'required':_0x39084f[_0x75d1('0x2b')][_0x75d1('0x80')]?!![]:![]},{'model':db[_0x75d1('0x7e')],'as':_0x75d1('0x81'),'attributes':['id',_0x75d1('0x5f'),_0x75d1('0x82')],'through':_0x39084f[_0x75d1('0x2b')][_0x75d1('0x80')]?{'attributes':[],'where':{'TagId':_0x39084f[_0x75d1('0x2b')][_0x75d1('0x80')]||undefined}}:{},'required':_0x39084f[_0x75d1('0x2b')][_0x75d1('0x80')]?!![]:![]}];}else{_0x41a561[_0x75d1('0x49')]=[{'all':!![]}];}}return db[_0x8a5c20['childModel']][_0x75d1('0x44')](_0x41a561);})[_0x75d1('0x23')](function(_0x594256){_0x488828[_0x75d1('0x7c')]=_0x594256;return _0x488828;});}}else{return _0x488828;}})[_0x75d1('0x23')](respondWithFilteredResult(_0x1437ba,_0x41a561))[_0x75d1('0x45')](handleError(_0x1437ba,null));};function getAllResources(_0x1d7749,_0x2865e9){return new BPromise(function(_0x3e22d8,_0x3ec6ab){if(_0x2865e9){var _0x3775e1=_0x2865e9[_0x75d1('0x41')]?{[_0x2865e9[_0x75d1('0x41')][_0x75d1('0x40')]]:_0x2865e9[_0x75d1('0x41')]['value']}:undefined;return db[_0x1d7749]['findAll']({'where':_0x3775e1,'raw':!![]})[_0x75d1('0x23')](function(_0x4e27b3){_0x2865e9['resourceIds']=_[_0x75d1('0x3c')](_0x4e27b3,'id');_0x3e22d8(_0x2865e9);})[_0x75d1('0x45')](function(_0x101eb8){_0x3ec6ab(_0x101eb8);});}else{_0x3e22d8(null);}});}function getAllFilteredResources(_0x4596fd,_0x458718){return new BPromise(function(_0x1b2881,_0x44c5cb){var _0x228b9b=_0x4596fd[_0x75d1('0x41')]?{[_0x4596fd['filter'][_0x75d1('0x40')]]:_0x4596fd[_0x75d1('0x41')]['value']}:undefined;return db[_0x4596fd[_0x75d1('0x31')]][_0x75d1('0x44')]({'where':_0x228b9b,'raw':!![]})['then'](function(_0x1fff26){_0x458718[_0x75d1('0x83')]=_['map'](_0x1fff26,function(_0x1666d6){return _0x1666d6[_0x75d1('0x5f')];});_0x1b2881(_0x458718);})[_0x75d1('0x45')](function(_0x5cfaa0){_0x44c5cb(_0x5cfaa0);});});}function getAllowedResources(_0x24a3c5,_0x208afd){return new BPromise(function(_0x5485dd,_0x4b7436){if(_0x208afd){return db[_0x75d1('0x59')]['findAll']({'where':{'sectionId':_0x208afd['id']},'raw':!![]})[_0x75d1('0x23')](function(_0x56cd47){if(_0x24a3c5['field']&&_0x24a3c5[_0x75d1('0x40')]!=='id'){_0x208afd[_0x75d1('0x83')]=_[_0x75d1('0x3c')](_0x56cd47,function(_0x52b23c){return _0x52b23c[_0x24a3c5[_0x75d1('0x40')]];});}else{if(_0x24a3c5['childModel']===_0x75d1('0x75')){_0x208afd[_0x75d1('0x73')]=_[_0x75d1('0x3c')](_0x56cd47,function(_0x2f1196){return{'id':_0x2f1196[_0x75d1('0x84')],'type':_0x2f1196[_0x75d1('0x3d')]};});}else{_0x208afd['resourceIds']=_[_0x75d1('0x3c')](_0x56cd47,function(_0x2716fa){return _0x2716fa[_0x75d1('0x84')];});}}_0x5485dd(_0x208afd);})[_0x75d1('0x45')](function(_0x53e64c){_0x4b7436(_0x53e64c);});}else{_0x5485dd(null);}});}function getQueryModels(_0x2cf744,_0x461dd1){var _0x201ee4=_0x2cf744['toLowerCase']();var _0x3a4734={'childModel':undefined,'parentSections':[]};switch(_0x201ee4){case'squareprojects':_0x3a4734['childModel']=_0x75d1('0x85');break;case _0x75d1('0x86'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x87');break;case'squarerecordings':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x88');_0x3a4734[_0x75d1('0x6c')]=[{'name':'SquareProjects','field':_0x75d1('0x5f'),'foreignKey':_0x75d1('0x89')}];break;case'projects':_0x3a4734[_0x75d1('0x6a')]='JscriptyProject';break;case _0x75d1('0x8a'):_0x3a4734['childModel']=_0x75d1('0x7d');_0x3a4734[_0x75d1('0x6c')]=[{'name':_0x75d1('0x8b'),'field':'id','foreignKey':'ListId'}];break;case _0x75d1('0x8c'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x8d');break;case _0x75d1('0x8e'):_0x3a4734['childModel']=_0x75d1('0x8f');break;case _0x75d1('0x90'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x91');break;case'chatqueues':_0x3a4734[_0x75d1('0x6a')]='ChatQueue';break;case _0x75d1('0x92'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x93');break;case _0x75d1('0x94'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x95');break;case'faxaccounts':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x96');break;case _0x75d1('0x97'):case _0x75d1('0x98'):case _0x75d1('0x99'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x9a');break;case _0x75d1('0x9b'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x9c');break;case'voicemails':_0x3a4734[_0x75d1('0x6a')]='VoiceMail';break;case _0x75d1('0x9d'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x9e');_0x3a4734[_0x75d1('0x6c')]=[{'name':_0x75d1('0x9f'),'field':_0x75d1('0x5f'),'foreignKey':_0x75d1('0xa0'),'model':_0x75d1('0xa1'),'filter':{'field':_0x75d1('0xa2'),'value':['agent']}},{'name':_0x75d1('0xa3'),'field':_0x75d1('0x5f'),'foreignKey':_0x75d1('0xa0'),'model':_0x75d1('0xa1'),'filter':{'field':_0x75d1('0xa2'),'value':[_0x75d1('0xa4')]}},{'name':'VoiceQueues','field':_0x75d1('0x5f'),'foreignKey':_0x75d1('0xa5'),'model':_0x75d1('0xa6')}];break;case'musiconholds':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xa7');break;case _0x75d1('0xa8'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xa9');break;case _0x75d1('0xaa'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xab');break;case _0x75d1('0xac'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xad');break;case'mailqueues':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xae');break;case _0x75d1('0xaf'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xb0');break;case _0x75d1('0xb1'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xb2');break;case _0x75d1('0xb3'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xb4');break;case _0x75d1('0xb5'):_0x3a4734[_0x75d1('0x6a')]='OpenchannelAccount';break;case _0x75d1('0xb6'):_0x3a4734['childModel']='SmsQueue';break;case _0x75d1('0xb7'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xb8');break;case _0x75d1('0xb9'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xba');break;case _0x75d1('0xbb'):case'queuecampaigns':_0x3a4734['childModel']=_0x75d1('0xa6');if(_0x461dd1){_0x3a4734[_0x75d1('0x6c')]=[{'name':_0x75d1('0xbc')},{'name':'QueueCampaigns'}];}break;case _0x75d1('0xbd'):case'agents':case _0x75d1('0xbe'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xa1');if(_0x461dd1){_0x3a4734[_0x75d1('0x6c')]=[{'name':_0x75d1('0xbf'),'filter':{'field':_0x75d1('0xa2'),'value':['admin','user']},'ignore':!![]},{'name':_0x75d1('0x9f')},{'name':_0x75d1('0xa3')}];}break;case _0x75d1('0xc0'):_0x3a4734[_0x75d1('0x6a')]='ZendeskAccount';break;case'salesforceaccounts':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xc1');break;case _0x75d1('0xc2'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xc3');break;case'sugarcrmaccounts':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xc4');break;case _0x75d1('0xc5'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xc6');break;case'zohoaccounts':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xc7');break;case'vtigeraccounts':_0x3a4734['childModel']=_0x75d1('0xa1');break;case'cannedanswers':_0x3a4734['childModel']=_0x75d1('0xc8');break;case'dispositions':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xc9');break;case _0x75d1('0xca'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xcb');break;case _0x75d1('0xcc'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xcd');break;case'pauses':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xce');break;case _0x75d1('0xcf'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xd0');break;case'sounds':_0x3a4734['childModel']='Sound';break;case'tags':_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0x7e');break;case _0x75d1('0xd1'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xd2');break;case _0x75d1('0xd3'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xd4');break;case _0x75d1('0xd5'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xd6');break;case _0x75d1('0xd7'):_0x3a4734[_0x75d1('0x6a')]='Variable';break;case _0x75d1('0xd8'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xd9');break;case _0x75d1('0xda'):_0x3a4734['childModel']='AnalyticExtractedReport';_0x3a4734['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x75d1('0x78')}];break;case _0x75d1('0xdb'):_0x3a4734[_0x75d1('0x6a')]=_0x75d1('0xdc');break;default:return _0x3a4734;}return _0x3a4734;}
\ No newline at end of file
index 33f1132..7aa7a32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72bd=['UserProfile','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x45cfcd,_0x20f351){var _0x187bfa=function(_0x5e4cee){while(--_0x5e4cee){_0x45cfcd['push'](_0x45cfcd['shift']());}};_0x187bfa(++_0x20f351);}(_0x72bd,0xcf));var _0xd72b=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x72bd[_0x16d10f];return _0x50c823;};'use strict';var EventEmitter=require(_0xd72b('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xd72b('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd72b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd72b('0x3')};function emitEvent(_0x4a85d8){return function(_0x2f0211,_0x3cd5c2,_0x265f26){UserProfileEvents['emit'](_0x4a85d8+':'+_0x2f0211['id'],_0x2f0211);UserProfileEvents[_0xd72b('0x4')](_0x4a85d8,_0x2f0211);_0x265f26(null);};}for(var e in events){if(events[_0xd72b('0x5')](e)){var event=events[e];UserProfile[_0xd72b('0x6')](e,emitEvent(event));}}module[_0xd72b('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0x214e=['update','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x31c259,_0x52de91){var _0x486262=function(_0x2e04fc){while(--_0x2e04fc){_0x31c259['push'](_0x31c259['shift']());}};_0x486262(++_0x52de91);}(_0x214e,0x148));var _0xe214=function(_0x44843e,_0x5e245f){_0x44843e=_0x44843e-0x0;var _0x9732f1=_0x214e[_0x44843e];return _0x9732f1;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xe214('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe214('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe214('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2384b9){return function(_0x531f72,_0x28d16d,_0x237c87){UserProfileEvents['emit'](_0x2384b9+':'+_0x531f72['id'],_0x531f72);UserProfileEvents['emit'](_0x2384b9,_0x531f72);_0x237c87(null);};}for(var e in events){if(events[_0xe214('0x3')](e)){var event=events[e];UserProfile[_0xe214('0x4')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 4704b48..03edb2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4790=['request-promise','./userProfile.attributes','exports','UserProfile','user_profiles','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5964ec,_0x1b92b9){var _0x328d30=function(_0x6f8716){while(--_0x6f8716){_0x5964ec['push'](_0x5964ec['shift']());}};_0x328d30(++_0x1b92b9);}(_0x4790,0x13b));var _0x0479=function(_0xdae8e6,_0x34854a){_0xdae8e6=_0xdae8e6-0x0;var _0x24c7a7=_0x4790[_0xdae8e6];return _0x24c7a7;};'use strict';var _=require(_0x0479('0x0'));var util=require(_0x0479('0x1'));var logger=require(_0x0479('0x2'))('api');var moment=require(_0x0479('0x3'));var BPromise=require(_0x0479('0x4'));var rp=require(_0x0479('0x5'));var attributes=require(_0x0479('0x6'));module[_0x0479('0x7')]=function(_0x1427f3,_0x354a68){return _0x1427f3['define'](_0x0479('0x8'),attributes,{'tableName':_0x0479('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x41e0=['../../config/logger','request-promise','./userProfile.attributes','exports','user_profiles','lodash','util'];(function(_0x53c0be,_0x51fb39){var _0x1f1a51=function(_0x551411){while(--_0x551411){_0x53c0be['push'](_0x53c0be['shift']());}};_0x1f1a51(++_0x51fb39);}(_0x41e0,0x15c));var _0x041e=function(_0x4bb3c1,_0x560d47){_0x4bb3c1=_0x4bb3c1-0x0;var _0x5d7551=_0x41e0[_0x4bb3c1];return _0x5d7551;};'use strict';var _=require(_0x041e('0x0'));var util=require(_0x041e('0x1'));var logger=require(_0x041e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x041e('0x3'));var attributes=require(_0x041e('0x4'));module[_0x041e('0x5')]=function(_0x1621ca,_0x1b21e1){return _0x1621ca['define']('UserProfile',attributes,{'tableName':_0x041e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3a07f80..b3f2c5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fcc=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./userProfile.socket','register'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5fcc,0x169));var _0xc5fc=function(_0x3505f6,_0x391493){_0x3505f6=_0x3505f6-0x0;var _0x404698=_0x5fcc[_0x3505f6];return _0x404698;};'use strict';var _=require(_0xc5fc('0x0'));var util=require(_0xc5fc('0x1'));var moment=require(_0xc5fc('0x2'));var BPromise=require(_0xc5fc('0x3'));var rs=require(_0xc5fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc5fc('0x5'));var logger=require(_0xc5fc('0x6'))(_0xc5fc('0x7'));var config=require(_0xc5fc('0x8'));var jayson=require(_0xc5fc('0x9'));var client=jayson['client'][_0xc5fc('0xa')]({'port':0x232a});config[_0xc5fc('0xb')]=_['defaults'](config[_0xc5fc('0xb')],{'host':_0xc5fc('0xc'),'port':0x18eb});var socket=require(_0xc5fc('0xd'))(new Redis(config[_0xc5fc('0xb')]));require(_0xc5fc('0xe'))[_0xc5fc('0xf')](socket);function respondWithRpcPromise(_0x20a427,_0x58260f,_0x3a05e1){return new BPromise(function(_0x27edc3,_0x2d14bf){return client[_0xc5fc('0x10')](_0x20a427,_0x3a05e1)[_0xc5fc('0x11')](function(_0x10fdc9){logger[_0xc5fc('0x12')](_0xc5fc('0x13'),_0x58260f,_0xc5fc('0x14'));logger[_0xc5fc('0x15')](_0xc5fc('0x16'),_0x58260f,_0xc5fc('0x14'),JSON[_0xc5fc('0x17')](_0x10fdc9));if(_0x10fdc9[_0xc5fc('0x18')]){if(_0x10fdc9['error'][_0xc5fc('0x19')]===0x1f4){logger['error'](_0xc5fc('0x13'),_0x58260f,_0x10fdc9[_0xc5fc('0x18')][_0xc5fc('0x1a')]);return _0x2d14bf(_0x10fdc9[_0xc5fc('0x18')]['message']);}logger[_0xc5fc('0x18')](_0xc5fc('0x13'),_0x58260f,_0x10fdc9[_0xc5fc('0x18')]['message']);return _0x27edc3(_0x10fdc9['error'][_0xc5fc('0x1a')]);}else{logger[_0xc5fc('0x12')]('UserProfile,\x20%s,\x20%s',_0x58260f,_0xc5fc('0x14'));_0x27edc3(_0x10fdc9[_0xc5fc('0x1b')][_0xc5fc('0x1a')]);}})[_0xc5fc('0x1c')](function(_0x10b204){logger[_0xc5fc('0x18')]('UserProfile,\x20%s,\x20%s',_0x58260f,_0x10b204);_0x2d14bf(_0x10b204);});});}
\ No newline at end of file
+var _0x8d6b=['then','info','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','UserProfile,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x43f63a,_0x240637){var _0x18ced7=function(_0x5adc57){while(--_0x5adc57){_0x43f63a['push'](_0x43f63a['shift']());}};_0x18ced7(++_0x240637);}(_0x8d6b,0x1cb));var _0xb8d6=function(_0x53b949,_0x4e90bd){_0x53b949=_0x53b949-0x0;var _0x2fcc12=_0x8d6b[_0x53b949];return _0x2fcc12;};'use strict';var _=require(_0xb8d6('0x0'));var util=require('util');var moment=require(_0xb8d6('0x1'));var BPromise=require(_0xb8d6('0x2'));var rs=require(_0xb8d6('0x3'));var fs=require('fs');var Redis=require(_0xb8d6('0x4'));var db=require(_0xb8d6('0x5'))['db'];var utils=require(_0xb8d6('0x6'));var logger=require('../../config/logger')(_0xb8d6('0x7'));var config=require(_0xb8d6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb8d6('0x9')]['http']({'port':0x232a});config[_0xb8d6('0xa')]=_[_0xb8d6('0xb')](config[_0xb8d6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8d6('0xc'))(new Redis(config['redis']));require(_0xb8d6('0xd'))[_0xb8d6('0xe')](socket);function respondWithRpcPromise(_0x7c4f31,_0x24661a,_0x59ecc0){return new BPromise(function(_0x459044,_0x542243){return client[_0xb8d6('0xf')](_0x7c4f31,_0x59ecc0)[_0xb8d6('0x10')](function(_0x2b4b1e){logger[_0xb8d6('0x11')]('UserProfile,\x20%s,\x20%s',_0x24661a,_0xb8d6('0x12'));logger['debug'](_0xb8d6('0x13'),_0x24661a,'request\x20sent',JSON['stringify'](_0x2b4b1e));if(_0x2b4b1e[_0xb8d6('0x14')]){if(_0x2b4b1e[_0xb8d6('0x14')][_0xb8d6('0x15')]===0x1f4){logger[_0xb8d6('0x14')]('UserProfile,\x20%s,\x20%s',_0x24661a,_0x2b4b1e[_0xb8d6('0x14')][_0xb8d6('0x16')]);return _0x542243(_0x2b4b1e['error'][_0xb8d6('0x16')]);}logger[_0xb8d6('0x14')](_0xb8d6('0x17'),_0x24661a,_0x2b4b1e['error']['message']);return _0x459044(_0x2b4b1e[_0xb8d6('0x14')][_0xb8d6('0x16')]);}else{logger[_0xb8d6('0x11')]('UserProfile,\x20%s,\x20%s',_0x24661a,_0xb8d6('0x12'));_0x459044(_0x2b4b1e[_0xb8d6('0x18')][_0xb8d6('0x16')]);}})['catch'](function(_0xa5b974){logger['error']('UserProfile,\x20%s,\x20%s',_0x24661a,_0xa5b974);_0x542243(_0xa5b974);});});}
\ No newline at end of file
index 863929b..d91ac86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d8=['remove','update','emit','length','userProfile:','./userProfile.events','save'];(function(_0x4f6309,_0xe71e00){var _0x1c43af=function(_0x1be001){while(--_0x1be001){_0x4f6309['push'](_0x4f6309['shift']());}};_0x1c43af(++_0xe71e00);}(_0x85d8,0x1b0));var _0x885d=function(_0x168c43,_0x4d81d7){_0x168c43=_0x168c43-0x0;var _0x910e13=_0x85d8[_0x168c43];return _0x910e13;};'use strict';var UserProfileEvents=require(_0x885d('0x0'));var events=[_0x885d('0x1'),_0x885d('0x2'),_0x885d('0x3')];function createListener(_0x3e5eab,_0x5bad48){return function(_0x328261){_0x5bad48[_0x885d('0x4')](_0x3e5eab,_0x328261);};}function removeListener(_0x320d7d,_0x3fe8a0){return function(){UserProfileEvents['removeListener'](_0x320d7d,_0x3fe8a0);};}exports['register']=function(_0x186504){for(var _0x30dcc2=0x0,_0x3715b4=events[_0x885d('0x5')];_0x30dcc2<_0x3715b4;_0x30dcc2++){var _0x18428b=events[_0x30dcc2];var _0x11e6d7=createListener(_0x885d('0x6')+_0x18428b,_0x186504);UserProfileEvents['on'](_0x18428b,_0x11e6d7);}};
\ No newline at end of file
+var _0x142c=['removeListener','length','./userProfile.events','remove','update','emit'];(function(_0x580971,_0x10984d){var _0x16d873=function(_0x594084){while(--_0x594084){_0x580971['push'](_0x580971['shift']());}};_0x16d873(++_0x10984d);}(_0x142c,0x86));var _0xc142=function(_0x104354,_0x1d5cdc){_0x104354=_0x104354-0x0;var _0x5ce198=_0x142c[_0x104354];return _0x5ce198;};'use strict';var UserProfileEvents=require(_0xc142('0x0'));var events=['save',_0xc142('0x1'),_0xc142('0x2')];function createListener(_0x10367,_0x4e9d02){return function(_0x30e881){_0x4e9d02[_0xc142('0x3')](_0x10367,_0x30e881);};}function removeListener(_0x4fa56e,_0x47e43a){return function(){UserProfileEvents[_0xc142('0x4')](_0x4fa56e,_0x47e43a);};}exports['register']=function(_0x4033e9){for(var _0x53b32f=0x0,_0x2d6796=events[_0xc142('0x5')];_0x53b32f<_0x2d6796;_0x53b32f++){var _0x30bf01=events[_0x53b32f];var _0x4ba28e=createListener('userProfile:'+_0x30bf01,_0x4033e9);UserProfileEvents['on'](_0x30bf01,_0x4ba28e);}};
\ No newline at end of file
index 48834fa..16f91f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6629=['describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','index','/describe'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0x6629,0x1c2));var _0x9662=function(_0x59ae11,_0x2e6c3d){_0x59ae11=_0x59ae11-0x0;var _0x47bd29=_0x6629[_0x59ae11];return _0x47bd29;};'use strict';var multer=require(_0x9662('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9662('0x1'));var express=require(_0x9662('0x2'));var router=express[_0x9662('0x3')]();var auth=require(_0x9662('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9662('0x5'));var controller=require(_0x9662('0x6'));router[_0x9662('0x7')]('/',auth['isAuthenticated'](),controller[_0x9662('0x8')]);router[_0x9662('0x7')](_0x9662('0x9'),auth['isAuthenticated'](),controller[_0x9662('0xa')]);router['get'](_0x9662('0xb'),auth[_0x9662('0xc')](),controller[_0x9662('0xd')]);router[_0x9662('0xe')]('/',auth[_0x9662('0xc')](),controller[_0x9662('0xf')]);router[_0x9662('0x10')](_0x9662('0xb'),auth[_0x9662('0xc')](),controller[_0x9662('0x11')]);router[_0x9662('0x12')]('/:id',auth[_0x9662('0xc')](),controller['destroy']);module[_0x9662('0x13')]=router;
\ No newline at end of file
+var _0x5800=['index','get','isAuthenticated','show','post','create','put','/:id','delete','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller'];(function(_0x1f1f99,_0xafa8be){var _0x33a42e=function(_0x56f314){while(--_0x56f314){_0x1f1f99['push'](_0x1f1f99['shift']());}};_0x33a42e(++_0xafa8be);}(_0x5800,0x1b9));var _0x0580=function(_0x3698d1,_0x3df610){_0x3698d1=_0x3698d1-0x0;var _0x173508=_0x5800[_0x3698d1];return _0x173508;};'use strict';var multer=require('multer');var util=require(_0x0580('0x0'));var path=require(_0x0580('0x1'));var timeout=require(_0x0580('0x2'));var express=require(_0x0580('0x3'));var router=express['Router']();var auth=require(_0x0580('0x4'));var interaction=require(_0x0580('0x5'));var config=require('../../config/environment');var controller=require(_0x0580('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0580('0x7')]);router[_0x0580('0x8')]('/describe',auth[_0x0580('0x9')](),controller['describe']);router[_0x0580('0x8')]('/:id',auth[_0x0580('0x9')](),controller[_0x0580('0xa')]);router[_0x0580('0xb')]('/',auth[_0x0580('0x9')](),controller[_0x0580('0xc')]);router[_0x0580('0xd')](_0x0580('0xe'),auth[_0x0580('0x9')](),controller['update']);router[_0x0580('0xf')](_0x0580('0xe'),auth[_0x0580('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 78e1817..a9af3e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa08=['INTEGER','exports','STRING'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xaa08,0x1ba));var _0x8aa0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaa08[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x8aa0('0x0')]={'name':{'type':Sequelize[_0x8aa0('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8aa0('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x1a48=['exports','STRING'];(function(_0x3ac163,_0x18633f){var _0x4a42fa=function(_0x4e59dd){while(--_0x4e59dd){_0x3ac163['push'](_0x3ac163['shift']());}};_0x4a42fa(++_0x18633f);}(_0x1a48,0x190));var _0x81a4=function(_0x5630b6,_0x78f481){_0x5630b6=_0x5630b6-0x0;var _0x254ed4=_0x1a48[_0x5630b6];return _0x254ed4;};'use strict';var Sequelize=require('sequelize');module[_0x81a4('0x0')]={'name':{'type':Sequelize[_0x81a4('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x81a4('0x1')],'allowNull':![]}};
\ No newline at end of file
index a61e9c9..b1dfd06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51c4=['ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','day','merge','filter','map','field','options','includeAll','include','UserProfileResource','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x51c4,0x80));var _0x451c=function(_0x2af590,_0x24c418){_0x2af590=_0x2af590-0x0;var _0x14558a=_0x51c4[_0x2af590];return _0x14558a;};'use strict';var pdf=require(_0x451c('0x0'));var emlformat=require(_0x451c('0x1'));var rimraf=require(_0x451c('0x2'));var zipdir=require(_0x451c('0x3'));var jsonpatch=require(_0x451c('0x4'));var rp=require(_0x451c('0x5'));var moment=require(_0x451c('0x6'));var BPromise=require(_0x451c('0x7'));var Mustache=require('mustache');var util=require(_0x451c('0x8'));var path=require(_0x451c('0x9'));var sox=require(_0x451c('0xa'));var csv=require('to-csv');var ejs=require(_0x451c('0xb'));var fs=require('fs');var _=require(_0x451c('0xc'));var squel=require(_0x451c('0xd'));var crypto=require(_0x451c('0xe'));var jsforce=require(_0x451c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x451c('0x10'));var querystring=require(_0x451c('0x11'));var Papa=require('papaparse');var Redis=require(_0x451c('0x12'));var qs=require(_0x451c('0x13'));var logger=require('../../config/logger')(_0x451c('0x14'));var utils=require(_0x451c('0x15'));var config=require('../../config/environment');var db=require(_0x451c('0x16'))['db'];function respondWithStatusCode(_0xe8939,_0x32c548){_0x32c548=_0x32c548||0xcc;return function(_0x120b51){if(_0x120b51){return _0xe8939[_0x451c('0x17')](_0x32c548);}return _0xe8939[_0x451c('0x18')](_0x32c548)['end']();};}function respondWithResult(_0xb2147d,_0xa0249){_0xa0249=_0xa0249||0xc8;return function(_0x26f95e){if(_0x26f95e){return _0xb2147d[_0x451c('0x18')](_0xa0249)[_0x451c('0x19')](_0x26f95e);}};}function respondWithFilteredResult(_0x7493eb,_0x43e756){return function(_0x352ca4){if(_0x352ca4){var _0xe2366c=_0x352ca4[_0x451c('0x1a')],_0x247bb0=_0x43e756['offset'],_0x28ac4c=_0x43e756['offset']+_0x43e756[_0x451c('0x1b')],_0x4c1fe2;if(_0x28ac4c>=_0xe2366c){_0x28ac4c=_0xe2366c;_0x4c1fe2=0xc8;}else{_0x4c1fe2=0xce;}_0x7493eb[_0x451c('0x18')](_0x4c1fe2);return _0x7493eb[_0x451c('0x1c')]('Content-Range',_0x247bb0+'-'+_0x28ac4c+'/'+_0xe2366c)[_0x451c('0x19')](_0x352ca4);}return null;};}function patchUpdates(_0x39a93a){return function(_0x59359f){try{jsonpatch['apply'](_0x59359f,_0x39a93a,!![]);}catch(_0x48464b){return BPromise[_0x451c('0x1d')](_0x48464b);}return _0x59359f[_0x451c('0x1e')]();};}function saveUpdates(_0x689125,_0x1ca084){return function(_0x49da6b){if(_0x49da6b){return _0x49da6b[_0x451c('0x1f')](_0x689125)[_0x451c('0x20')](function(_0x4899e7){return _0x4899e7;});}return null;};}function removeEntity(_0x53015f,_0x40400b){return function(_0x3f8ded){if(_0x3f8ded){return _0x3f8ded[_0x451c('0x21')]()[_0x451c('0x20')](function(){_0x53015f['status'](0xcc)[_0x451c('0x22')]();});}};}function handleEntityNotFound(_0x4f2a8b,_0x391395){return function(_0x4815e4){if(!_0x4815e4){_0x4f2a8b[_0x451c('0x17')](0x194);}return _0x4815e4;};}function handleError(_0x5896f8,_0x598f24){_0x598f24=_0x598f24||0x1f4;return function(_0x2044e0){logger[_0x451c('0x23')](_0x2044e0[_0x451c('0x24')]);if(_0x2044e0['name']){delete _0x2044e0[_0x451c('0x25')];}_0x5896f8[_0x451c('0x18')](_0x598f24)[_0x451c('0x26')](_0x2044e0);};}exports['index']=function(_0x4e40d5,_0x535f0e){var _0xe80311={},_0x5113d2={},_0x18a244={'count':0x0,'rows':[]};var _0x5d5fe1=db['UserProfileResource'][_0x451c('0x27')];_0x5113d2['model']=_[_0x451c('0x28')](_0x5d5fe1);var _0x446738={'dateStart':_0x4e40d5[_0x451c('0x29')][_0x451c('0x2a')],'dateEnd':_0x4e40d5[_0x451c('0x29')][_0x451c('0x2b')]};delete _0x4e40d5[_0x451c('0x29')][_0x451c('0x2a')];delete _0x4e40d5[_0x451c('0x29')][_0x451c('0x2b')];_0x5113d2[_0x451c('0x29')]=_[_0x451c('0x28')](_0x4e40d5[_0x451c('0x29')]);_0x5113d2[_0x451c('0x2c')]=_[_0x451c('0x2d')](_0x5113d2[_0x451c('0x2e')],_0x5113d2['query']);_0xe80311[_0x451c('0x2f')]=_['intersection'](_0x5113d2['model'],qs[_0x451c('0x30')](_0x4e40d5['query'][_0x451c('0x30')]));_0xe80311[_0x451c('0x2f')]=_0xe80311[_0x451c('0x2f')][_0x451c('0x31')]?_0xe80311[_0x451c('0x2f')]:_0x5113d2['model'];if(!_0x4e40d5['query'][_0x451c('0x32')](_0x451c('0x33'))){_0xe80311['limit']=qs['limit'](_0x4e40d5[_0x451c('0x29')][_0x451c('0x1b')]);_0xe80311[_0x451c('0x34')]=qs[_0x451c('0x34')](_0x4e40d5[_0x451c('0x29')][_0x451c('0x34')]);}_0xe80311[_0x451c('0x35')]=qs[_0x451c('0x36')](_0x4e40d5[_0x451c('0x29')][_0x451c('0x36')]);_0xe80311[_0x451c('0x37')]=qs[_0x451c('0x2c')](_[_0x451c('0x38')](_0x4e40d5['query'],_0x5113d2[_0x451c('0x2c')]));if(_0x446738['dateStart']){if(_0x446738[_0x451c('0x2b')]){_0x446738[_0x451c('0x2b')]=moment(_0x446738[_0x451c('0x2b')])['add'](0x1,_0x451c('0x39'));}else{_0x446738['dateEnd']=moment(_0x446738[_0x451c('0x2a')])['add'](0x1,_0x451c('0x39'));}_[_0x451c('0x3a')](_0xe80311['where'],{'createdAt':{'$gte':_0x446738['dateStart'],'$lte':_0x446738[_0x451c('0x2b')]}});}if(_0x4e40d5[_0x451c('0x29')][_0x451c('0x3b')]){_0xe80311[_0x451c('0x37')]=_[_0x451c('0x3a')](_0xe80311[_0x451c('0x37')],{'$or':_[_0x451c('0x3c')](_0x5d5fe1,function(_0xdbc7a5){if(_0xdbc7a5['type']['key']!=='VIRTUAL'){var _0x26bb24={};_0x26bb24[_0xdbc7a5[_0x451c('0x3d')]]={'$like':'%'+_0x4e40d5['query']['filter']+'%'};return _0x26bb24;}})});}_0xe80311=_[_0x451c('0x3a')]({},_0xe80311,_0x4e40d5[_0x451c('0x3e')]);var _0x58c473={'where':_0xe80311[_0x451c('0x37')]};return db['UserProfileResource'][_0x451c('0x1a')](_0x58c473)[_0x451c('0x20')](function(_0x2f0435){_0x18a244[_0x451c('0x1a')]=_0x2f0435;if(_0x4e40d5[_0x451c('0x29')][_0x451c('0x3f')]){_0xe80311[_0x451c('0x40')]=[{'all':!![]}];}return db[_0x451c('0x41')]['findAll'](_0xe80311);})[_0x451c('0x20')](function(_0x2a8ca5){_0x18a244['rows']=_0x2a8ca5;return _0x18a244;})[_0x451c('0x20')](respondWithFilteredResult(_0x535f0e,_0xe80311))[_0x451c('0x42')](handleError(_0x535f0e,null));};exports[_0x451c('0x43')]=function(_0x1a3fbe,_0x12224f){var _0x2f35ef={'raw':![],'where':{'id':_0x1a3fbe['params']['id']}},_0x5393b0={};_0x5393b0[_0x451c('0x2e')]=_[_0x451c('0x28')](db[_0x451c('0x41')][_0x451c('0x27')]);_0x5393b0[_0x451c('0x29')]=_[_0x451c('0x28')](_0x1a3fbe[_0x451c('0x29')]);_0x5393b0['filters']=_[_0x451c('0x2d')](_0x5393b0[_0x451c('0x2e')],_0x5393b0[_0x451c('0x29')]);_0x2f35ef['attributes']=_['intersection'](_0x5393b0[_0x451c('0x2e')],qs[_0x451c('0x30')](_0x1a3fbe[_0x451c('0x29')][_0x451c('0x30')]));_0x2f35ef[_0x451c('0x2f')]=_0x2f35ef['attributes']['length']?_0x2f35ef[_0x451c('0x2f')]:_0x5393b0[_0x451c('0x2e')];if(_0x1a3fbe[_0x451c('0x29')]['includeAll']){_0x2f35ef[_0x451c('0x40')]=[{'all':!![]}];}_0x2f35ef=_[_0x451c('0x3a')]({},_0x2f35ef,_0x1a3fbe['options']);return db[_0x451c('0x41')][_0x451c('0x44')](_0x2f35ef)[_0x451c('0x20')](handleEntityNotFound(_0x12224f,null))[_0x451c('0x20')](respondWithResult(_0x12224f,null))['catch'](handleError(_0x12224f,null));};exports[_0x451c('0x45')]=function(_0x9aafab,_0x30d4e7){return db[_0x451c('0x41')][_0x451c('0x45')](_0x9aafab[_0x451c('0x46')],{})[_0x451c('0x20')](respondWithResult(_0x30d4e7,0xc9))[_0x451c('0x42')](handleError(_0x30d4e7,null));};exports['update']=function(_0x2edb9a,_0x3c0d5c){if(_0x2edb9a[_0x451c('0x46')]['id']){delete _0x2edb9a[_0x451c('0x46')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x2edb9a['params']['id']}})[_0x451c('0x20')](handleEntityNotFound(_0x3c0d5c,null))[_0x451c('0x20')](saveUpdates(_0x2edb9a[_0x451c('0x46')],null))['then'](respondWithResult(_0x3c0d5c,null))['catch'](handleError(_0x3c0d5c,null));};exports[_0x451c('0x21')]=function(_0x109c3e,_0x49910a){return db[_0x451c('0x41')][_0x451c('0x44')]({'where':{'id':_0x109c3e[_0x451c('0x47')]['id']}})['then'](handleEntityNotFound(_0x49910a,null))[_0x451c('0x20')](removeEntity(_0x49910a,null))['catch'](handleError(_0x49910a,null));};exports[_0x451c('0x48')]=function(_0xe852d3,_0x25c128){return db[_0x451c('0x41')][_0x451c('0x48')]()['then'](respondWithResult(_0x25c128,null))[_0x451c('0x42')](handleError(_0x25c128,null));};
\ No newline at end of file
+var _0xeb6e=['rows','params','keys','catch','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','model','query','dateEnd','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','dateStart','add','day','merge','filter','map','key','VIRTUAL','field','options','count','includeAll','include','findAll'];(function(_0xf05774,_0x495051){var _0x191123=function(_0x2de2f8){while(--_0x2de2f8){_0xf05774['push'](_0xf05774['shift']());}};_0x191123(++_0x495051);}(_0xeb6e,0xf0));var _0xeeb6=function(_0x501bd7,_0x10728b){_0x501bd7=_0x501bd7-0x0;var _0x1222c0=_0xeb6e[_0x501bd7];return _0x1222c0;};'use strict';var pdf=require(_0xeeb6('0x0'));var emlformat=require(_0xeeb6('0x1'));var rimraf=require(_0xeeb6('0x2'));var zipdir=require(_0xeeb6('0x3'));var jsonpatch=require(_0xeeb6('0x4'));var rp=require(_0xeeb6('0x5'));var moment=require('moment');var BPromise=require(_0xeeb6('0x6'));var Mustache=require(_0xeeb6('0x7'));var util=require(_0xeeb6('0x8'));var path=require('path');var sox=require(_0xeeb6('0x9'));var csv=require('to-csv');var ejs=require(_0xeeb6('0xa'));var fs=require('fs');var _=require(_0xeeb6('0xb'));var squel=require(_0xeeb6('0xc'));var crypto=require(_0xeeb6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeeb6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeeb6('0xf'));var Papa=require(_0xeeb6('0x10'));var Redis=require(_0xeeb6('0x11'));var qs=require(_0xeeb6('0x12'));var logger=require('../../config/logger')(_0xeeb6('0x13'));var utils=require(_0xeeb6('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc458c3,_0x3a9982){_0x3a9982=_0x3a9982||0xcc;return function(_0xad0aba){if(_0xad0aba){return _0xc458c3[_0xeeb6('0x15')](_0x3a9982);}return _0xc458c3[_0xeeb6('0x16')](_0x3a9982)[_0xeeb6('0x17')]();};}function respondWithResult(_0x142708,_0x4e8805){_0x4e8805=_0x4e8805||0xc8;return function(_0x2ed781){if(_0x2ed781){return _0x142708[_0xeeb6('0x16')](_0x4e8805)[_0xeeb6('0x18')](_0x2ed781);}};}function respondWithFilteredResult(_0x18bd98,_0x3db6bd){return function(_0xd526cc){if(_0xd526cc){var _0x2ef22b=_0xd526cc['count'],_0x5dad40=_0x3db6bd['offset'],_0x4e00c4=_0x3db6bd['offset']+_0x3db6bd[_0xeeb6('0x19')],_0x50dd0e;if(_0x4e00c4>=_0x2ef22b){_0x4e00c4=_0x2ef22b;_0x50dd0e=0xc8;}else{_0x50dd0e=0xce;}_0x18bd98[_0xeeb6('0x16')](_0x50dd0e);return _0x18bd98[_0xeeb6('0x1a')](_0xeeb6('0x1b'),_0x5dad40+'-'+_0x4e00c4+'/'+_0x2ef22b)[_0xeeb6('0x18')](_0xd526cc);}return null;};}function patchUpdates(_0x4ebf2a){return function(_0x1d3343){try{jsonpatch[_0xeeb6('0x1c')](_0x1d3343,_0x4ebf2a,!![]);}catch(_0x497362){return BPromise[_0xeeb6('0x1d')](_0x497362);}return _0x1d3343['save']();};}function saveUpdates(_0x325041,_0x256851){return function(_0x348092){if(_0x348092){return _0x348092['update'](_0x325041)[_0xeeb6('0x1e')](function(_0x149e93){return _0x149e93;});}return null;};}function removeEntity(_0x344a83,_0x301054){return function(_0x2aab94){if(_0x2aab94){return _0x2aab94[_0xeeb6('0x1f')]()[_0xeeb6('0x1e')](function(){_0x344a83[_0xeeb6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425fee,_0x200ef2){return function(_0x127550){if(!_0x127550){_0x425fee[_0xeeb6('0x15')](0x194);}return _0x127550;};}function handleError(_0x1b6352,_0x6bd746){_0x6bd746=_0x6bd746||0x1f4;return function(_0xb3f31c){logger[_0xeeb6('0x20')](_0xb3f31c[_0xeeb6('0x21')]);if(_0xb3f31c[_0xeeb6('0x22')]){delete _0xb3f31c[_0xeeb6('0x22')];}_0x1b6352[_0xeeb6('0x16')](_0x6bd746)[_0xeeb6('0x23')](_0xb3f31c);};}exports[_0xeeb6('0x24')]=function(_0x260a98,_0x4c7f18){var _0x91ff9c={},_0x21e2f0={},_0xa7c333={'count':0x0,'rows':[]};var _0x26d8d0=db[_0xeeb6('0x25')][_0xeeb6('0x26')];_0x21e2f0[_0xeeb6('0x27')]=_['keys'](_0x26d8d0);var _0x5a73fb={'dateStart':_0x260a98['query']['dateStart'],'dateEnd':_0x260a98[_0xeeb6('0x28')][_0xeeb6('0x29')]};delete _0x260a98[_0xeeb6('0x28')]['dateStart'];delete _0x260a98[_0xeeb6('0x28')][_0xeeb6('0x29')];_0x21e2f0['query']=_['keys'](_0x260a98[_0xeeb6('0x28')]);_0x21e2f0['filters']=_[_0xeeb6('0x2a')](_0x21e2f0[_0xeeb6('0x27')],_0x21e2f0[_0xeeb6('0x28')]);_0x91ff9c[_0xeeb6('0x2b')]=_[_0xeeb6('0x2a')](_0x21e2f0[_0xeeb6('0x27')],qs[_0xeeb6('0x2c')](_0x260a98['query']['fields']));_0x91ff9c[_0xeeb6('0x2b')]=_0x91ff9c[_0xeeb6('0x2b')][_0xeeb6('0x2d')]?_0x91ff9c[_0xeeb6('0x2b')]:_0x21e2f0['model'];if(!_0x260a98[_0xeeb6('0x28')][_0xeeb6('0x2e')](_0xeeb6('0x2f'))){_0x91ff9c[_0xeeb6('0x19')]=qs['limit'](_0x260a98[_0xeeb6('0x28')][_0xeeb6('0x19')]);_0x91ff9c[_0xeeb6('0x30')]=qs[_0xeeb6('0x30')](_0x260a98[_0xeeb6('0x28')]['offset']);}_0x91ff9c[_0xeeb6('0x31')]=qs[_0xeeb6('0x32')](_0x260a98[_0xeeb6('0x28')][_0xeeb6('0x32')]);_0x91ff9c[_0xeeb6('0x33')]=qs['filters'](_[_0xeeb6('0x34')](_0x260a98[_0xeeb6('0x28')],_0x21e2f0[_0xeeb6('0x35')]));if(_0x5a73fb[_0xeeb6('0x36')]){if(_0x5a73fb[_0xeeb6('0x29')]){_0x5a73fb[_0xeeb6('0x29')]=moment(_0x5a73fb[_0xeeb6('0x29')])[_0xeeb6('0x37')](0x1,'day');}else{_0x5a73fb[_0xeeb6('0x29')]=moment(_0x5a73fb[_0xeeb6('0x36')])[_0xeeb6('0x37')](0x1,_0xeeb6('0x38'));}_[_0xeeb6('0x39')](_0x91ff9c[_0xeeb6('0x33')],{'createdAt':{'$gte':_0x5a73fb[_0xeeb6('0x36')],'$lte':_0x5a73fb[_0xeeb6('0x29')]}});}if(_0x260a98[_0xeeb6('0x28')][_0xeeb6('0x3a')]){_0x91ff9c[_0xeeb6('0x33')]=_[_0xeeb6('0x39')](_0x91ff9c[_0xeeb6('0x33')],{'$or':_[_0xeeb6('0x3b')](_0x26d8d0,function(_0x19da91){if(_0x19da91['type'][_0xeeb6('0x3c')]!==_0xeeb6('0x3d')){var _0x4596f4={};_0x4596f4[_0x19da91[_0xeeb6('0x3e')]]={'$like':'%'+_0x260a98['query'][_0xeeb6('0x3a')]+'%'};return _0x4596f4;}})});}_0x91ff9c=_[_0xeeb6('0x39')]({},_0x91ff9c,_0x260a98[_0xeeb6('0x3f')]);var _0x1ac77e={'where':_0x91ff9c[_0xeeb6('0x33')]};return db[_0xeeb6('0x25')][_0xeeb6('0x40')](_0x1ac77e)[_0xeeb6('0x1e')](function(_0x243e7c){_0xa7c333[_0xeeb6('0x40')]=_0x243e7c;if(_0x260a98['query'][_0xeeb6('0x41')]){_0x91ff9c[_0xeeb6('0x42')]=[{'all':!![]}];}return db[_0xeeb6('0x25')][_0xeeb6('0x43')](_0x91ff9c);})['then'](function(_0x2a3df8){_0xa7c333[_0xeeb6('0x44')]=_0x2a3df8;return _0xa7c333;})[_0xeeb6('0x1e')](respondWithFilteredResult(_0x4c7f18,_0x91ff9c))['catch'](handleError(_0x4c7f18,null));};exports['show']=function(_0x27bc12,_0x150344){var _0x18c71a={'raw':![],'where':{'id':_0x27bc12[_0xeeb6('0x45')]['id']}},_0x1af38a={};_0x1af38a[_0xeeb6('0x27')]=_[_0xeeb6('0x46')](db[_0xeeb6('0x25')]['rawAttributes']);_0x1af38a[_0xeeb6('0x28')]=_[_0xeeb6('0x46')](_0x27bc12[_0xeeb6('0x28')]);_0x1af38a[_0xeeb6('0x35')]=_[_0xeeb6('0x2a')](_0x1af38a['model'],_0x1af38a[_0xeeb6('0x28')]);_0x18c71a[_0xeeb6('0x2b')]=_[_0xeeb6('0x2a')](_0x1af38a['model'],qs[_0xeeb6('0x2c')](_0x27bc12[_0xeeb6('0x28')][_0xeeb6('0x2c')]));_0x18c71a['attributes']=_0x18c71a[_0xeeb6('0x2b')][_0xeeb6('0x2d')]?_0x18c71a[_0xeeb6('0x2b')]:_0x1af38a['model'];if(_0x27bc12[_0xeeb6('0x28')]['includeAll']){_0x18c71a[_0xeeb6('0x42')]=[{'all':!![]}];}_0x18c71a=_[_0xeeb6('0x39')]({},_0x18c71a,_0x27bc12[_0xeeb6('0x3f')]);return db[_0xeeb6('0x25')]['find'](_0x18c71a)[_0xeeb6('0x1e')](handleEntityNotFound(_0x150344,null))[_0xeeb6('0x1e')](respondWithResult(_0x150344,null))[_0xeeb6('0x47')](handleError(_0x150344,null));};exports[_0xeeb6('0x48')]=function(_0x4fe2a7,_0x40f6c8){return db[_0xeeb6('0x25')][_0xeeb6('0x48')](_0x4fe2a7[_0xeeb6('0x49')],{})['then'](respondWithResult(_0x40f6c8,0xc9))[_0xeeb6('0x47')](handleError(_0x40f6c8,null));};exports[_0xeeb6('0x4a')]=function(_0x2165c5,_0x14d035){if(_0x2165c5[_0xeeb6('0x49')]['id']){delete _0x2165c5['body']['id'];}return db['UserProfileResource'][_0xeeb6('0x4b')]({'where':{'id':_0x2165c5['params']['id']}})['then'](handleEntityNotFound(_0x14d035,null))['then'](saveUpdates(_0x2165c5[_0xeeb6('0x49')],null))[_0xeeb6('0x1e')](respondWithResult(_0x14d035,null))['catch'](handleError(_0x14d035,null));};exports[_0xeeb6('0x1f')]=function(_0x26b600,_0x1fabad){return db['UserProfileResource'][_0xeeb6('0x4b')]({'where':{'id':_0x26b600[_0xeeb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fabad,null))['then'](removeEntity(_0x1fabad,null))[_0xeeb6('0x47')](handleError(_0x1fabad,null));};exports[_0xeeb6('0x4c')]=function(_0x592452,_0x3f277b){return db[_0xeeb6('0x25')][_0xeeb6('0x4c')]()[_0xeeb6('0x1e')](respondWithResult(_0x3f277b,null))['catch'](handleError(_0x3f277b,null));};
\ No newline at end of file
index 19468c3..4b25602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac7a=['util','../../config/logger','api','moment','bluebird','request-promise','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x2c2102,_0x77743f){var _0x5d736e=function(_0x5f56b5){while(--_0x5f56b5){_0x2c2102['push'](_0x2c2102['shift']());}};_0x5d736e(++_0x77743f);}(_0xac7a,0x75));var _0xaac7=function(_0x32f931,_0x2c0f99){_0x32f931=_0x32f931-0x0;var _0x11e051=_0xac7a[_0x32f931];return _0x11e051;};'use strict';var _=require('lodash');var util=require(_0xaac7('0x0'));var logger=require(_0xaac7('0x1'))(_0xaac7('0x2'));var moment=require(_0xaac7('0x3'));var BPromise=require(_0xaac7('0x4'));var rp=require(_0xaac7('0x5'));var attributes=require(_0xaac7('0x6'));module[_0xaac7('0x7')]=function(_0x478419,_0x30cd36){return _0x478419['define'](_0xaac7('0x8'),attributes,{'tableName':_0xaac7('0x9'),'paranoid':![],'indexes':[{'name':_0xaac7('0xa'),'fields':[_0xaac7('0xb'),_0xaac7('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x99de=['./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28c81b,_0x153e31){var _0x22fa3c=function(_0x6f5d34){while(--_0x6f5d34){_0x28c81b['push'](_0x28c81b['shift']());}};_0x22fa3c(++_0x153e31);}(_0x99de,0x1a6));var _0xe99d=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x99de[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0xe99d('0x0'));var util=require(_0xe99d('0x1'));var logger=require(_0xe99d('0x2'))(_0xe99d('0x3'));var moment=require(_0xe99d('0x4'));var BPromise=require(_0xe99d('0x5'));var rp=require(_0xe99d('0x6'));var attributes=require(_0xe99d('0x7'));module[_0xe99d('0x8')]=function(_0xe3fa66,_0x303710){return _0xe3fa66[_0xe99d('0x9')]('UserProfileResource',attributes,{'tableName':_0xe99d('0xa'),'paranoid':![],'indexes':[{'name':_0xe99d('0xb'),'fields':['resourceId',_0xe99d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 310986e..b757398 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0309=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xd05e35,_0x5599e6){var _0x55899d=function(_0x524d0c){while(--_0x524d0c){_0xd05e35['push'](_0xd05e35['shift']());}};_0x55899d(++_0x5599e6);}(_0x0309,0x165));var _0x9030=function(_0x483eb2,_0x35593e){_0x483eb2=_0x483eb2-0x0;var _0x5cb984=_0x0309[_0x483eb2];return _0x5cb984;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105c15,_0x4f2d84,_0xb53eb4){return new BPromise(function(_0x4e6c7b,_0x1e2360){return client[_0x9030('0xa')](_0x105c15,_0xb53eb4)[_0x9030('0xb')](function(_0x5711b4){logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));logger['debug'](_0x9030('0xf'),_0x4f2d84,_0x9030('0xe'),JSON[_0x9030('0x10')](_0x5711b4));if(_0x5711b4[_0x9030('0x11')]){if(_0x5711b4[_0x9030('0x11')][_0x9030('0x12')]===0x1f4){logger[_0x9030('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x1e2360(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}logger['error'](_0x9030('0xd'),_0x4f2d84,_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);return _0x4e6c7b(_0x5711b4[_0x9030('0x11')][_0x9030('0x13')]);}else{logger[_0x9030('0xc')](_0x9030('0xd'),_0x4f2d84,_0x9030('0xe'));_0x4e6c7b(_0x5711b4[_0x9030('0x14')]['message']);}})[_0x9030('0x15')](function(_0x17e80d){logger[_0x9030('0x11')](_0x9030('0xd'),_0x4f2d84,_0x17e80d);_0x1e2360(_0x17e80d);});});}
\ No newline at end of file
+var _0xfdbd=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x532c99,_0x445420){var _0x52a3dd=function(_0xf9fe7){while(--_0xf9fe7){_0x532c99['push'](_0x532c99['shift']());}};_0x52a3dd(++_0x445420);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0xfdbd[_0x30f5bb];return _0x1cfc00;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rs=require(_0xdfdb('0x4'));var fs=require('fs');var Redis=require(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var utils=require(_0xdfdb('0x7'));var logger=require(_0xdfdb('0x8'))('rpc');var config=require(_0xdfdb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfdb('0xa')][_0xdfdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489f19,_0x556dc0,_0x590b5d){return new BPromise(function(_0x188508,_0xf72a24){return client['request'](_0x489f19,_0x590b5d)[_0xdfdb('0xc')](function(_0x444c19){logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));logger[_0xdfdb('0x10')](_0xdfdb('0x11'),_0x556dc0,'request\x20sent',JSON[_0xdfdb('0x12')](_0x444c19));if(_0x444c19[_0xdfdb('0x13')]){if(_0x444c19['error'][_0xdfdb('0x14')]===0x1f4){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);return _0xf72a24(_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);}logger[_0xdfdb('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x556dc0,_0x444c19['error'][_0xdfdb('0x15')]);return _0x188508(_0x444c19['error'][_0xdfdb('0x15')]);}else{logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));_0x188508(_0x444c19[_0xdfdb('0x16')][_0xdfdb('0x15')]);}})['catch'](function(_0x4fd3d5){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x4fd3d5);_0xf72a24(_0x4fd3d5);});});}
\ No newline at end of file
index 6a9cf91..d4780e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbba=['get','/describe','show','post','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xdbba,0x1d5));var _0xadbb=function(_0x535e3e,_0xca3409){_0x535e3e=_0x535e3e-0x0;var _0x48459f=_0xdbba[_0x535e3e];return _0x48459f;};'use strict';var multer=require(_0xadbb('0x0'));var util=require(_0xadbb('0x1'));var path=require(_0xadbb('0x2'));var timeout=require('connect-timeout');var express=require(_0xadbb('0x3'));var router=express[_0xadbb('0x4')]();var auth=require(_0xadbb('0x5'));var interaction=require(_0xadbb('0x6'));var config=require(_0xadbb('0x7'));var controller=require(_0xadbb('0x8'));router['get']('/',auth[_0xadbb('0x9')](),controller[_0xadbb('0xa')]);router[_0xadbb('0xb')](_0xadbb('0xc'),auth[_0xadbb('0x9')](),controller['describe']);router[_0xadbb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xadbb('0xd')]);router[_0xadbb('0xe')]('/',auth[_0xadbb('0x9')](),controller['create']);router[_0xadbb('0xf')](_0xadbb('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xadbb('0x11')]('/:id',auth[_0xadbb('0x9')](),controller[_0xadbb('0x12')]);module[_0xadbb('0x13')]=router;
\ No newline at end of file
+var _0xc998=['../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','path','express','Router'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc998,0x10c));var _0x8c99=function(_0x5c305f,_0x1dce75){_0x5c305f=_0x5c305f-0x0;var _0x8db7d3=_0xc998[_0x5c305f];return _0x8db7d3;};'use strict';var multer=require(_0x8c99('0x0'));var util=require('util');var path=require(_0x8c99('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c99('0x2'));var router=express[_0x8c99('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8c99('0x4'));var config=require('../../config/environment');var controller=require(_0x8c99('0x5'));router['get']('/',auth[_0x8c99('0x6')](),controller[_0x8c99('0x7')]);router['get'](_0x8c99('0x8'),auth['isAuthenticated'](),controller[_0x8c99('0x9')]);router['get'](_0x8c99('0xa'),auth[_0x8c99('0x6')](),controller[_0x8c99('0xb')]);router[_0x8c99('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c99('0xd')](_0x8c99('0xa'),auth[_0x8c99('0x6')](),controller['update']);router[_0x8c99('0xe')]('/:id',auth[_0x8c99('0x6')](),controller[_0x8c99('0xf')]);module[_0x8c99('0x10')]=router;
\ No newline at end of file
index 96fa0de..b3dc094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['crudPermissions','join','getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue'];(function(_0x419058,_0x573222){var _0x4f9272=function(_0x522e8e){while(--_0x522e8e){_0x419058['push'](_0x419058['shift']());}};_0x4f9272(++_0x573222);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0a9e('0x2')],'set':function(_0x432180){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x432180?_0x432180[_0x0a9e('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x0a9e('0x5'))?this[_0x0a9e('0x7')](_0x0a9e('0x5'))['split'](''):[];}}};
\ No newline at end of file
+var _0x9c44=['BOOLEAN','crudPermissions','getDataValue','split','STRING','INTEGER'];(function(_0x67d53d,_0x2e1cce){var _0x2e9b4c=function(_0x17fb54){while(--_0x17fb54){_0x67d53d['push'](_0x67d53d['shift']());}};_0x2e9b4c(++_0x2e1cce);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x49c4('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x49c4('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x49c4('0x0')],'set':function(_0x4e0313){this['setDataValue'](_0x49c4('0x3'),_0x4e0313?_0x4e0313['join'](''):[]);},'get':function(){return this[_0x49c4('0x4')](_0x49c4('0x3'))?this[_0x49c4('0x4')](_0x49c4('0x3'))[_0x49c4('0x5')](''):[];}}};
\ No newline at end of file
index e406d3b..ae82a7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bae=['fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','day','add','merge','map','type','key','field','filter','options','includeAll','include','rows','catch','params','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','set','apply','reject','save','update','then','destroy','name','UserProfileSection','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model'];(function(_0x4491d9,_0x5856ec){var _0x3e9dba=function(_0x2a6302){while(--_0x2a6302){_0x4491d9['push'](_0x4491d9['shift']());}};_0x3e9dba(++_0x5856ec);}(_0x7bae,0x13b));var _0xe7ba=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7bae[_0x4709c0];return _0x13348b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7ba('0x0'));var zipdir=require(_0xe7ba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7ba('0x2'));var moment=require('moment');var BPromise=require(_0xe7ba('0x3'));var Mustache=require(_0xe7ba('0x4'));var util=require(_0xe7ba('0x5'));var path=require(_0xe7ba('0x6'));var sox=require(_0xe7ba('0x7'));var csv=require(_0xe7ba('0x8'));var ejs=require(_0xe7ba('0x9'));var fs=require('fs');var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x8'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var qs=require(_0xe7ba('0x11'));var logger=require(_0xe7ba('0x12'))(_0xe7ba('0x13'));var utils=require(_0xe7ba('0x14'));var config=require(_0xe7ba('0x15'));var db=require(_0xe7ba('0x16'))['db'];function respondWithStatusCode(_0x448bcc,_0x194447){_0x194447=_0x194447||0xcc;return function(_0x4b6597){if(_0x4b6597){return _0x448bcc[_0xe7ba('0x17')](_0x194447);}return _0x448bcc['status'](_0x194447)[_0xe7ba('0x18')]();};}function respondWithResult(_0x45229c,_0x390596){_0x390596=_0x390596||0xc8;return function(_0x17e4e6){if(_0x17e4e6){return _0x45229c[_0xe7ba('0x19')](_0x390596)[_0xe7ba('0x1a')](_0x17e4e6);}};}function respondWithFilteredResult(_0x561dbb,_0x561c48){return function(_0x2a5183){if(_0x2a5183){var _0x7ba72a=_0x2a5183['count'],_0x359f6f=_0x561c48['offset'],_0x5d1d03=_0x561c48['offset']+_0x561c48[_0xe7ba('0x1b')],_0x4390e3;if(_0x5d1d03>=_0x7ba72a){_0x5d1d03=_0x7ba72a;_0x4390e3=0xc8;}else{_0x4390e3=0xce;}_0x561dbb['status'](_0x4390e3);return _0x561dbb[_0xe7ba('0x1c')]('Content-Range',_0x359f6f+'-'+_0x5d1d03+'/'+_0x7ba72a)['json'](_0x2a5183);}return null;};}function patchUpdates(_0x5a82b5){return function(_0x3f326a){try{jsonpatch[_0xe7ba('0x1d')](_0x3f326a,_0x5a82b5,!![]);}catch(_0x39ca38){return BPromise[_0xe7ba('0x1e')](_0x39ca38);}return _0x3f326a[_0xe7ba('0x1f')]();};}function saveUpdates(_0x58550c,_0x149c62){return function(_0x20c653){if(_0x20c653){return _0x20c653[_0xe7ba('0x20')](_0x58550c)[_0xe7ba('0x21')](function(_0x4aaf35){return _0x4aaf35;});}return null;};}function removeEntity(_0x1076c5,_0x2936b7){return function(_0x5a158f){if(_0x5a158f){return _0x5a158f[_0xe7ba('0x22')]()[_0xe7ba('0x21')](function(){_0x1076c5[_0xe7ba('0x19')](0xcc)[_0xe7ba('0x18')]();});}};}function handleEntityNotFound(_0x394b69,_0x2acfc2){return function(_0x293b14){if(!_0x293b14){_0x394b69[_0xe7ba('0x17')](0x194);}return _0x293b14;};}function handleError(_0x41cbd9,_0xa72f1c){_0xa72f1c=_0xa72f1c||0x1f4;return function(_0x58cf43){logger['error'](_0x58cf43['stack']);if(_0x58cf43['name']){delete _0x58cf43[_0xe7ba('0x23')];}_0x41cbd9['status'](_0xa72f1c)['send'](_0x58cf43);};}exports['index']=function(_0x255def,_0x32cc00){var _0xe32862={},_0x2ea78a={},_0x3435c6={'count':0x0,'rows':[]};var _0xc88099=db[_0xe7ba('0x24')][_0xe7ba('0x25')];_0x2ea78a['model']=_[_0xe7ba('0x26')](_0xc88099);var _0x48c869={'dateStart':_0x255def[_0xe7ba('0x27')][_0xe7ba('0x28')],'dateEnd':_0x255def[_0xe7ba('0x27')]['dateEnd']};delete _0x255def['query'][_0xe7ba('0x28')];delete _0x255def[_0xe7ba('0x27')][_0xe7ba('0x29')];_0x2ea78a[_0xe7ba('0x27')]=_[_0xe7ba('0x26')](_0x255def['query']);_0x2ea78a[_0xe7ba('0x2a')]=_[_0xe7ba('0x2b')](_0x2ea78a['model'],_0x2ea78a[_0xe7ba('0x27')]);_0xe32862['attributes']=_['intersection'](_0x2ea78a[_0xe7ba('0x2c')],qs[_0xe7ba('0x2d')](_0x255def[_0xe7ba('0x27')]['fields']));_0xe32862[_0xe7ba('0x2e')]=_0xe32862['attributes'][_0xe7ba('0x2f')]?_0xe32862[_0xe7ba('0x2e')]:_0x2ea78a[_0xe7ba('0x2c')];if(!_0x255def[_0xe7ba('0x27')][_0xe7ba('0x30')]('nolimit')){_0xe32862[_0xe7ba('0x1b')]=qs[_0xe7ba('0x1b')](_0x255def['query'][_0xe7ba('0x1b')]);_0xe32862[_0xe7ba('0x31')]=qs[_0xe7ba('0x31')](_0x255def['query'][_0xe7ba('0x31')]);}_0xe32862[_0xe7ba('0x32')]=qs['sort'](_0x255def[_0xe7ba('0x27')][_0xe7ba('0x33')]);_0xe32862[_0xe7ba('0x34')]=qs['filters'](_[_0xe7ba('0x35')](_0x255def[_0xe7ba('0x27')],_0x2ea78a['filters']));if(_0x48c869[_0xe7ba('0x28')]){if(_0x48c869[_0xe7ba('0x29')]){_0x48c869[_0xe7ba('0x29')]=moment(_0x48c869['dateEnd'])['add'](0x1,_0xe7ba('0x36'));}else{_0x48c869[_0xe7ba('0x29')]=moment(_0x48c869[_0xe7ba('0x28')])[_0xe7ba('0x37')](0x1,_0xe7ba('0x36'));}_['merge'](_0xe32862[_0xe7ba('0x34')],{'createdAt':{'$gte':_0x48c869[_0xe7ba('0x28')],'$lte':_0x48c869[_0xe7ba('0x29')]}});}if(_0x255def[_0xe7ba('0x27')]['filter']){_0xe32862[_0xe7ba('0x34')]=_[_0xe7ba('0x38')](_0xe32862[_0xe7ba('0x34')],{'$or':_[_0xe7ba('0x39')](_0xc88099,function(_0x35a5f3){if(_0x35a5f3[_0xe7ba('0x3a')][_0xe7ba('0x3b')]!=='VIRTUAL'){var _0x3429fa={};_0x3429fa[_0x35a5f3[_0xe7ba('0x3c')]]={'$like':'%'+_0x255def[_0xe7ba('0x27')][_0xe7ba('0x3d')]+'%'};return _0x3429fa;}})});}_0xe32862=_[_0xe7ba('0x38')]({},_0xe32862,_0x255def[_0xe7ba('0x3e')]);var _0x220c3b={'where':_0xe32862[_0xe7ba('0x34')]};return db[_0xe7ba('0x24')]['count'](_0x220c3b)[_0xe7ba('0x21')](function(_0x417734){_0x3435c6['count']=_0x417734;if(_0x255def['query'][_0xe7ba('0x3f')]){_0xe32862[_0xe7ba('0x40')]=[{'all':!![]}];}return db[_0xe7ba('0x24')]['findAll'](_0xe32862);})[_0xe7ba('0x21')](function(_0x82246e){_0x3435c6[_0xe7ba('0x41')]=_0x82246e;return _0x3435c6;})[_0xe7ba('0x21')](respondWithFilteredResult(_0x32cc00,_0xe32862))[_0xe7ba('0x42')](handleError(_0x32cc00,null));};exports['show']=function(_0x165558,_0x54ef49){var _0x30a1c8={'raw':![],'where':{'id':_0x165558[_0xe7ba('0x43')]['id']}},_0x2d9d85={};_0x2d9d85[_0xe7ba('0x2c')]=_[_0xe7ba('0x26')](db[_0xe7ba('0x24')][_0xe7ba('0x25')]);_0x2d9d85[_0xe7ba('0x27')]=_['keys'](_0x165558[_0xe7ba('0x27')]);_0x2d9d85[_0xe7ba('0x2a')]=_[_0xe7ba('0x2b')](_0x2d9d85[_0xe7ba('0x2c')],_0x2d9d85[_0xe7ba('0x27')]);_0x30a1c8[_0xe7ba('0x2e')]=_[_0xe7ba('0x2b')](_0x2d9d85[_0xe7ba('0x2c')],qs[_0xe7ba('0x2d')](_0x165558[_0xe7ba('0x27')]['fields']));_0x30a1c8[_0xe7ba('0x2e')]=_0x30a1c8['attributes'][_0xe7ba('0x2f')]?_0x30a1c8[_0xe7ba('0x2e')]:_0x2d9d85[_0xe7ba('0x2c')];if(_0x165558[_0xe7ba('0x27')][_0xe7ba('0x3f')]){_0x30a1c8[_0xe7ba('0x40')]=[{'all':!![]}];}_0x30a1c8=_['merge']({},_0x30a1c8,_0x165558[_0xe7ba('0x3e')]);return db[_0xe7ba('0x24')][_0xe7ba('0x44')](_0x30a1c8)[_0xe7ba('0x21')](handleEntityNotFound(_0x54ef49,null))[_0xe7ba('0x21')](respondWithResult(_0x54ef49,null))[_0xe7ba('0x42')](handleError(_0x54ef49,null));};exports[_0xe7ba('0x45')]=function(_0x266ace,_0x272cb9){return db[_0xe7ba('0x24')][_0xe7ba('0x45')](_0x266ace['body'],{})[_0xe7ba('0x21')](respondWithResult(_0x272cb9,0xc9))[_0xe7ba('0x42')](handleError(_0x272cb9,null));};exports[_0xe7ba('0x20')]=function(_0x24c7d9,_0x3ae802){if(_0x24c7d9[_0xe7ba('0x46')]['id']){delete _0x24c7d9['body']['id'];}return db[_0xe7ba('0x24')][_0xe7ba('0x44')]({'where':{'id':_0x24c7d9['params']['id']}})[_0xe7ba('0x21')](handleEntityNotFound(_0x3ae802,null))[_0xe7ba('0x21')](saveUpdates(_0x24c7d9[_0xe7ba('0x46')],null))[_0xe7ba('0x21')](respondWithResult(_0x3ae802,null))['catch'](handleError(_0x3ae802,null));};exports['destroy']=function(_0xa80cf,_0x2cfdc3){return db[_0xe7ba('0x24')]['find']({'where':{'id':_0xa80cf[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x21')](handleEntityNotFound(_0x2cfdc3,null))[_0xe7ba('0x21')](removeEntity(_0x2cfdc3,null))[_0xe7ba('0x42')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x47')]=function(_0x6b6f1,_0xf3a41f){return db['UserProfileSection'][_0xe7ba('0x47')]()[_0xe7ba('0x21')](respondWithResult(_0xf3a41f,null))[_0xe7ba('0x42')](handleError(_0xf3a41f,null));};
\ No newline at end of file
+var _0xbd50=['sendStatus','stack','name','send','UserProfileSection','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','add','day','merge','filter','where','map','type','key','VIRTUAL','field','options','includeAll','include','catch','show','length','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0xbd50,0x196));var _0x0bd5=function(_0xabcff1,_0x2a482e){_0xabcff1=_0xabcff1-0x0;var _0x250f87=_0xbd50[_0xabcff1];return _0x250f87;};'use strict';var pdf=require(_0x0bd5('0x0'));var emlformat=require(_0x0bd5('0x1'));var rimraf=require(_0x0bd5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bd5('0x3'));var rp=require(_0x0bd5('0x4'));var moment=require(_0x0bd5('0x5'));var BPromise=require(_0x0bd5('0x6'));var Mustache=require(_0x0bd5('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0bd5('0x8'));var ejs=require(_0x0bd5('0x9'));var fs=require('fs');var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0x8'));var querystring=require(_0x0bd5('0xd'));var Papa=require(_0x0bd5('0xe'));var Redis=require('ioredis');var qs=require(_0x0bd5('0xf'));var logger=require(_0x0bd5('0x10'))('api');var utils=require(_0x0bd5('0x11'));var config=require(_0x0bd5('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ce7dd,_0x130723){_0x130723=_0x130723||0xcc;return function(_0x1aa818){if(_0x1aa818){return _0x1ce7dd['sendStatus'](_0x130723);}return _0x1ce7dd[_0x0bd5('0x13')](_0x130723)[_0x0bd5('0x14')]();};}function respondWithResult(_0x2f9588,_0xc5b4cd){_0xc5b4cd=_0xc5b4cd||0xc8;return function(_0xfa1eed){if(_0xfa1eed){return _0x2f9588[_0x0bd5('0x13')](_0xc5b4cd)[_0x0bd5('0x15')](_0xfa1eed);}};}function respondWithFilteredResult(_0x1e961d,_0x4f485b){return function(_0x78f9b8){if(_0x78f9b8){var _0x325e43=_0x78f9b8[_0x0bd5('0x16')],_0x574315=_0x4f485b[_0x0bd5('0x17')],_0x31349f=_0x4f485b['offset']+_0x4f485b[_0x0bd5('0x18')],_0x23ef4e;if(_0x31349f>=_0x325e43){_0x31349f=_0x325e43;_0x23ef4e=0xc8;}else{_0x23ef4e=0xce;}_0x1e961d[_0x0bd5('0x13')](_0x23ef4e);return _0x1e961d[_0x0bd5('0x19')](_0x0bd5('0x1a'),_0x574315+'-'+_0x31349f+'/'+_0x325e43)[_0x0bd5('0x15')](_0x78f9b8);}return null;};}function patchUpdates(_0x23be38){return function(_0xc58e12){try{jsonpatch[_0x0bd5('0x1b')](_0xc58e12,_0x23be38,!![]);}catch(_0x29fa4c){return BPromise[_0x0bd5('0x1c')](_0x29fa4c);}return _0xc58e12[_0x0bd5('0x1d')]();};}function saveUpdates(_0x415d8f,_0x4008bd){return function(_0x2dc1e5){if(_0x2dc1e5){return _0x2dc1e5['update'](_0x415d8f)['then'](function(_0x596b6a){return _0x596b6a;});}return null;};}function removeEntity(_0x4ed64e,_0x47d74a){return function(_0x6c06bd){if(_0x6c06bd){return _0x6c06bd[_0x0bd5('0x1e')]()[_0x0bd5('0x1f')](function(){_0x4ed64e[_0x0bd5('0x13')](0xcc)[_0x0bd5('0x14')]();});}};}function handleEntityNotFound(_0x4c74c9,_0x440f85){return function(_0x3b235b){if(!_0x3b235b){_0x4c74c9[_0x0bd5('0x20')](0x194);}return _0x3b235b;};}function handleError(_0x5a8139,_0x5b6dde){_0x5b6dde=_0x5b6dde||0x1f4;return function(_0x4a8787){logger['error'](_0x4a8787[_0x0bd5('0x21')]);if(_0x4a8787[_0x0bd5('0x22')]){delete _0x4a8787[_0x0bd5('0x22')];}_0x5a8139['status'](_0x5b6dde)[_0x0bd5('0x23')](_0x4a8787);};}exports['index']=function(_0x456e87,_0x3ffb08){var _0x18cec3={},_0x2b6b53={},_0x3ff237={'count':0x0,'rows':[]};var _0x2023d5=db[_0x0bd5('0x24')][_0x0bd5('0x25')];_0x2b6b53[_0x0bd5('0x26')]=_[_0x0bd5('0x27')](_0x2023d5);var _0x15561b={'dateStart':_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x29')],'dateEnd':_0x456e87[_0x0bd5('0x28')]['dateEnd']};delete _0x456e87[_0x0bd5('0x28')][_0x0bd5('0x29')];delete _0x456e87['query'][_0x0bd5('0x2a')];_0x2b6b53[_0x0bd5('0x28')]=_['keys'](_0x456e87[_0x0bd5('0x28')]);_0x2b6b53[_0x0bd5('0x2b')]=_[_0x0bd5('0x2c')](_0x2b6b53[_0x0bd5('0x26')],_0x2b6b53['query']);_0x18cec3[_0x0bd5('0x2d')]=_[_0x0bd5('0x2c')](_0x2b6b53[_0x0bd5('0x26')],qs[_0x0bd5('0x2e')](_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x2e')]));_0x18cec3['attributes']=_0x18cec3[_0x0bd5('0x2d')]['length']?_0x18cec3[_0x0bd5('0x2d')]:_0x2b6b53[_0x0bd5('0x26')];if(!_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x2f')](_0x0bd5('0x30'))){_0x18cec3[_0x0bd5('0x18')]=qs[_0x0bd5('0x18')](_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x18')]);_0x18cec3[_0x0bd5('0x17')]=qs[_0x0bd5('0x17')](_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x17')]);}_0x18cec3['order']=qs[_0x0bd5('0x31')](_0x456e87[_0x0bd5('0x28')]['sort']);_0x18cec3['where']=qs[_0x0bd5('0x2b')](_[_0x0bd5('0x32')](_0x456e87[_0x0bd5('0x28')],_0x2b6b53[_0x0bd5('0x2b')]));if(_0x15561b[_0x0bd5('0x29')]){if(_0x15561b[_0x0bd5('0x2a')]){_0x15561b[_0x0bd5('0x2a')]=moment(_0x15561b[_0x0bd5('0x2a')])[_0x0bd5('0x33')](0x1,_0x0bd5('0x34'));}else{_0x15561b[_0x0bd5('0x2a')]=moment(_0x15561b[_0x0bd5('0x29')])[_0x0bd5('0x33')](0x1,'day');}_[_0x0bd5('0x35')](_0x18cec3['where'],{'createdAt':{'$gte':_0x15561b[_0x0bd5('0x29')],'$lte':_0x15561b[_0x0bd5('0x2a')]}});}if(_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x36')]){_0x18cec3[_0x0bd5('0x37')]=_[_0x0bd5('0x35')](_0x18cec3['where'],{'$or':_[_0x0bd5('0x38')](_0x2023d5,function(_0x975fff){if(_0x975fff[_0x0bd5('0x39')][_0x0bd5('0x3a')]!==_0x0bd5('0x3b')){var _0x493089={};_0x493089[_0x975fff[_0x0bd5('0x3c')]]={'$like':'%'+_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x36')]+'%'};return _0x493089;}})});}_0x18cec3=_['merge']({},_0x18cec3,_0x456e87[_0x0bd5('0x3d')]);var _0x554d79={'where':_0x18cec3[_0x0bd5('0x37')]};return db[_0x0bd5('0x24')]['count'](_0x554d79)[_0x0bd5('0x1f')](function(_0x166200){_0x3ff237[_0x0bd5('0x16')]=_0x166200;if(_0x456e87[_0x0bd5('0x28')][_0x0bd5('0x3e')]){_0x18cec3[_0x0bd5('0x3f')]=[{'all':!![]}];}return db[_0x0bd5('0x24')]['findAll'](_0x18cec3);})['then'](function(_0x994f24){_0x3ff237['rows']=_0x994f24;return _0x3ff237;})['then'](respondWithFilteredResult(_0x3ffb08,_0x18cec3))[_0x0bd5('0x40')](handleError(_0x3ffb08,null));};exports[_0x0bd5('0x41')]=function(_0x480d1b,_0x544275){var _0x5cb5ae={'raw':![],'where':{'id':_0x480d1b['params']['id']}},_0xcf09de={};_0xcf09de['model']=_[_0x0bd5('0x27')](db[_0x0bd5('0x24')]['rawAttributes']);_0xcf09de['query']=_[_0x0bd5('0x27')](_0x480d1b[_0x0bd5('0x28')]);_0xcf09de[_0x0bd5('0x2b')]=_[_0x0bd5('0x2c')](_0xcf09de['model'],_0xcf09de[_0x0bd5('0x28')]);_0x5cb5ae[_0x0bd5('0x2d')]=_[_0x0bd5('0x2c')](_0xcf09de[_0x0bd5('0x26')],qs[_0x0bd5('0x2e')](_0x480d1b[_0x0bd5('0x28')]['fields']));_0x5cb5ae[_0x0bd5('0x2d')]=_0x5cb5ae[_0x0bd5('0x2d')][_0x0bd5('0x42')]?_0x5cb5ae['attributes']:_0xcf09de[_0x0bd5('0x26')];if(_0x480d1b[_0x0bd5('0x28')][_0x0bd5('0x3e')]){_0x5cb5ae['include']=[{'all':!![]}];}_0x5cb5ae=_[_0x0bd5('0x35')]({},_0x5cb5ae,_0x480d1b[_0x0bd5('0x3d')]);return db[_0x0bd5('0x24')][_0x0bd5('0x43')](_0x5cb5ae)[_0x0bd5('0x1f')](handleEntityNotFound(_0x544275,null))['then'](respondWithResult(_0x544275,null))[_0x0bd5('0x40')](handleError(_0x544275,null));};exports[_0x0bd5('0x44')]=function(_0x4d00c3,_0x2db9b0){return db[_0x0bd5('0x24')][_0x0bd5('0x44')](_0x4d00c3[_0x0bd5('0x45')],{})[_0x0bd5('0x1f')](respondWithResult(_0x2db9b0,0xc9))['catch'](handleError(_0x2db9b0,null));};exports[_0x0bd5('0x46')]=function(_0x128df9,_0x5cd889){if(_0x128df9[_0x0bd5('0x45')]['id']){delete _0x128df9['body']['id'];}return db[_0x0bd5('0x24')][_0x0bd5('0x43')]({'where':{'id':_0x128df9[_0x0bd5('0x47')]['id']}})[_0x0bd5('0x1f')](handleEntityNotFound(_0x5cd889,null))['then'](saveUpdates(_0x128df9[_0x0bd5('0x45')],null))['then'](respondWithResult(_0x5cd889,null))['catch'](handleError(_0x5cd889,null));};exports[_0x0bd5('0x1e')]=function(_0x1b473f,_0x172393){return db['UserProfileSection'][_0x0bd5('0x43')]({'where':{'id':_0x1b473f['params']['id']}})[_0x0bd5('0x1f')](handleEntityNotFound(_0x172393,null))[_0x0bd5('0x1f')](removeEntity(_0x172393,null))[_0x0bd5('0x40')](handleError(_0x172393,null));};exports['describe']=function(_0x512fe3,_0x4f0467){return db[_0x0bd5('0x24')][_0x0bd5('0x48')]()[_0x0bd5('0x1f')](respondWithResult(_0x4f0467,null))['catch'](handleError(_0x4f0467,null));};
\ No newline at end of file
index f2d9fc6..e0c6277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeda=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','api','moment','bluebird','request-promise','./userProfileSection.attributes','define','UserProfileSection'];(function(_0x3ae38b,_0x4c7866){var _0x192be8=function(_0x545eca){while(--_0x545eca){_0x3ae38b['push'](_0x3ae38b['shift']());}};_0x192be8(++_0x4c7866);}(_0xaeda,0x1b4));var _0xaaed=function(_0x58b58f,_0x247656){_0x58b58f=_0x58b58f-0x0;var _0xcb3948=_0xaeda[_0x58b58f];return _0xcb3948;};'use strict';var _=require(_0xaaed('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaaed('0x1'));var moment=require(_0xaaed('0x2'));var BPromise=require(_0xaaed('0x3'));var rp=require(_0xaaed('0x4'));var attributes=require(_0xaaed('0x5'));module['exports']=function(_0x3e76ba,_0x2c31f8){return _0x3e76ba[_0xaaed('0x6')](_0xaaed('0x7'),attributes,{'tableName':_0xaaed('0x8'),'paranoid':![],'indexes':[{'name':_0xaaed('0x9'),'fields':[_0xaaed('0xa'),_0xaaed('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x294b=['./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4dd5de,_0x11f4f7){var _0x47613e=function(_0x3f0baf){while(--_0x3f0baf){_0x4dd5de['push'](_0x4dd5de['shift']());}};_0x47613e(++_0x11f4f7);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var logger=require(_0xb294('0x1'))(_0xb294('0x2'));var moment=require(_0xb294('0x3'));var BPromise=require(_0xb294('0x4'));var rp=require(_0xb294('0x5'));var attributes=require(_0xb294('0x6'));module['exports']=function(_0x5c0237,_0xba5c68){return _0x5c0237[_0xb294('0x7')](_0xb294('0x8'),attributes,{'tableName':_0xb294('0x9'),'paranoid':![],'indexes':[{'name':_0xb294('0xa'),'fields':['sectionId',_0xb294('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index f69be45..bed4a02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba48=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x806a40,_0x5181cd){var _0x58b632=function(_0xf3ed9d){while(--_0xf3ed9d){_0x806a40['push'](_0x806a40['shift']());}};_0x58b632(++_0x5181cd);}(_0xba48,0xd3));var _0x8ba4=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xba48[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x8ba4('0x0'));var util=require(_0x8ba4('0x1'));var moment=require(_0x8ba4('0x2'));var BPromise=require(_0x8ba4('0x3'));var rs=require(_0x8ba4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ba4('0x5'))['db'];var utils=require(_0x8ba4('0x6'));var logger=require(_0x8ba4('0x7'))(_0x8ba4('0x8'));var config=require(_0x8ba4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8ba4('0xa')][_0x8ba4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1083e4,_0x4eb615,_0x2bf9b0){return new BPromise(function(_0x525fa6,_0x30a731){return client[_0x8ba4('0xc')](_0x1083e4,_0x2bf9b0)[_0x8ba4('0xd')](function(_0x163c62){logger[_0x8ba4('0xe')](_0x8ba4('0xf'),_0x4eb615,_0x8ba4('0x10'));logger[_0x8ba4('0x11')](_0x8ba4('0x12'),_0x4eb615,'request\x20sent',JSON[_0x8ba4('0x13')](_0x163c62));if(_0x163c62[_0x8ba4('0x14')]){if(_0x163c62['error'][_0x8ba4('0x15')]===0x1f4){logger[_0x8ba4('0x14')](_0x8ba4('0xf'),_0x4eb615,_0x163c62['error'][_0x8ba4('0x16')]);return _0x30a731(_0x163c62[_0x8ba4('0x14')][_0x8ba4('0x16')]);}logger[_0x8ba4('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x4eb615,_0x163c62['error']['message']);return _0x525fa6(_0x163c62[_0x8ba4('0x14')][_0x8ba4('0x16')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x4eb615,'request\x20sent');_0x525fa6(_0x163c62['result'][_0x8ba4('0x16')]);}})[_0x8ba4('0x17')](function(_0x37b6fd){logger[_0x8ba4('0x14')](_0x8ba4('0xf'),_0x4eb615,_0x37b6fd);_0x30a731(_0x37b6fd);});});}
\ No newline at end of file
+var _0x5a45=['catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x5a45,0x143));var _0x55a4=function(_0x8d13fa,_0x2a7e7b){_0x8d13fa=_0x8d13fa-0x0;var _0x3d207b=_0x5a45[_0x8d13fa];return _0x3d207b;};'use strict';var _=require('lodash');var util=require(_0x55a4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x55a4('0x1'));var fs=require('fs');var Redis=require(_0x55a4('0x2'));var db=require(_0x55a4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x55a4('0x4'))(_0x55a4('0x5'));var config=require(_0x55a4('0x6'));var jayson=require(_0x55a4('0x7'));var client=jayson[_0x55a4('0x8')][_0x55a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b8b66,_0x408d4a,_0x8a31bc){return new BPromise(function(_0x2eca4b,_0x44f334){return client[_0x55a4('0xa')](_0x5b8b66,_0x8a31bc)[_0x55a4('0xb')](function(_0x427d27){logger[_0x55a4('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x408d4a,_0x55a4('0xd'));logger[_0x55a4('0xe')](_0x55a4('0xf'),_0x408d4a,_0x55a4('0xd'),JSON[_0x55a4('0x10')](_0x427d27));if(_0x427d27[_0x55a4('0x11')]){if(_0x427d27[_0x55a4('0x11')][_0x55a4('0x12')]===0x1f4){logger[_0x55a4('0x11')](_0x55a4('0x13'),_0x408d4a,_0x427d27[_0x55a4('0x11')]['message']);return _0x44f334(_0x427d27[_0x55a4('0x11')][_0x55a4('0x14')]);}logger[_0x55a4('0x11')](_0x55a4('0x13'),_0x408d4a,_0x427d27[_0x55a4('0x11')]['message']);return _0x2eca4b(_0x427d27[_0x55a4('0x11')][_0x55a4('0x14')]);}else{logger['info'](_0x55a4('0x13'),_0x408d4a,_0x55a4('0xd'));_0x2eca4b(_0x427d27[_0x55a4('0x15')][_0x55a4('0x14')]);}})[_0x55a4('0x16')](function(_0x1677f8){logger[_0x55a4('0x11')](_0x55a4('0x13'),_0x408d4a,_0x1677f8);_0x44f334(_0x1677f8);});});}
\ No newline at end of file
index 011f254..7a85702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc46=['../../config/environment','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfc46,0x9a));var _0x6fc4=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0xfc46[_0x3b96cf];return _0x2e315a;};'use strict';var multer=require(_0x6fc4('0x0'));var util=require('util');var path=require(_0x6fc4('0x1'));var timeout=require(_0x6fc4('0x2'));var express=require(_0x6fc4('0x3'));var router=express['Router']();var auth=require(_0x6fc4('0x4'));var interaction=require(_0x6fc4('0x5'));var config=require(_0x6fc4('0x6'));module[_0x6fc4('0x7')]=router;
\ No newline at end of file
+var _0x6eed=['express','../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6eed,0xff));var _0xd6ee=function(_0x10c6ef,_0x5534fe){_0x10c6ef=_0x10c6ef-0x0;var _0x160322=_0x6eed[_0x10c6ef];return _0x160322;};'use strict';var multer=require(_0xd6ee('0x0'));var util=require(_0xd6ee('0x1'));var path=require(_0xd6ee('0x2'));var timeout=require(_0xd6ee('0x3'));var express=require(_0xd6ee('0x4'));var router=express['Router']();var auth=require(_0xd6ee('0x5'));var interaction=require(_0xd6ee('0x6'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
index 1e499ce..9014493 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebbf=['sequelize','exports'];(function(_0x17e4ac,_0x315ed6){var _0x7a9a6a=function(_0x5ec68f){while(--_0x5ec68f){_0x17e4ac['push'](_0x17e4ac['shift']());}};_0x7a9a6a(++_0x315ed6);}(_0xebbf,0xe4));var _0xfebb=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xebbf[_0xf26c2e];return _0x46ecb4;};'use strict';var Sequelize=require(_0xfebb('0x0'));module[_0xfebb('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8ac9=['INTEGER','exports'];(function(_0x51b698,_0x2fd161){var _0xfa0590=function(_0x3741ce){while(--_0x3741ce){_0x51b698['push'](_0x51b698['shift']());}};_0xfa0590(++_0x2fd161);}(_0x8ac9,0xe5));var _0x98ac=function(_0x1dfdaf,_0x30c59e){_0x1dfdaf=_0x1dfdaf-0x0;var _0x22da12=_0x8ac9[_0x1dfdaf];return _0x22da12;};'use strict';var Sequelize=require('sequelize');module[_0x98ac('0x0')]={'penalty':{'type':Sequelize[_0x98ac('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index c4e7972..eb5794f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ae7=['bluebird','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','../../config/logger','api','moment'];(function(_0x2c4357,_0xdcd049){var _0x4244f0=function(_0x35f8ec){while(--_0x35f8ec){_0x2c4357['push'](_0x2c4357['shift']());}};_0x4244f0(++_0xdcd049);}(_0x2ae7,0xc2));var _0x72ae=function(_0x5284f8,_0x3ee8c6){_0x5284f8=_0x5284f8-0x0;var _0x209766=_0x2ae7[_0x5284f8];return _0x209766;};'use strict';var _=require(_0x72ae('0x0'));var util=require('util');var logger=require(_0x72ae('0x1'))(_0x72ae('0x2'));var moment=require(_0x72ae('0x3'));var BPromise=require(_0x72ae('0x4'));var rp=require('request-promise');var attributes=require(_0x72ae('0x5'));module[_0x72ae('0x6')]=function(_0x1ff07c,_0x50d49d){return _0x1ff07c[_0x72ae('0x7')](_0x72ae('0x8'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfbf=['bluebird','request-promise','exports','define','user_has_sms_queues','../../config/logger','api','moment'];(function(_0xf13ff7,_0x2f1bd7){var _0x594472=function(_0x1ef5d9){while(--_0x1ef5d9){_0xf13ff7['push'](_0xf13ff7['shift']());}};_0x594472(++_0x2f1bd7);}(_0xbfbf,0x155));var _0xfbfb=function(_0x4e3216,_0x5d2930){_0x4e3216=_0x4e3216-0x0;var _0x1875b8=_0xbfbf[_0x4e3216];return _0x1875b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfbfb('0x0'))(_0xfbfb('0x1'));var moment=require(_0xfbfb('0x2'));var BPromise=require(_0xfbfb('0x3'));var rp=require(_0xfbfb('0x4'));var attributes=require('./userSmsQueue.attributes');module[_0xfbfb('0x5')]=function(_0x253021,_0x265cdf){return _0x253021[_0xfbfb('0x6')]('UserSmsQueue',attributes,{'tableName':_0xfbfb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f478ba..4700275 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe13c,0x167));var _0xce13=function(_0x591c47,_0x1079ac){_0x591c47=_0x591c47-0x0;var _0x3b5811=_0xe13c[_0x591c47];return _0x3b5811;};'use strict';var _=require(_0xce13('0x0'));var util=require(_0xce13('0x1'));var moment=require(_0xce13('0x2'));var BPromise=require(_0xce13('0x3'));var rs=require(_0xce13('0x4'));var fs=require('fs');var Redis=require(_0xce13('0x5'));var db=require(_0xce13('0x6'))['db'];var utils=require(_0xce13('0x7'));var logger=require(_0xce13('0x8'))('rpc');var config=require(_0xce13('0x9'));var jayson=require(_0xce13('0xa'));var client=jayson[_0xce13('0xb')][_0xce13('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12f343,_0x5f572a,_0xb7f5a1){return new BPromise(function(_0x30e198,_0xd6834e){return client[_0xce13('0xd')](_0x12f343,_0xb7f5a1)[_0xce13('0xe')](function(_0x106311){logger[_0xce13('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x5f572a,_0xce13('0x10'));logger[_0xce13('0x11')](_0xce13('0x12'),_0x5f572a,'request\x20sent',JSON[_0xce13('0x13')](_0x106311));if(_0x106311[_0xce13('0x14')]){if(_0x106311[_0xce13('0x14')][_0xce13('0x15')]===0x1f4){logger['error'](_0xce13('0x16'),_0x5f572a,_0x106311[_0xce13('0x14')]['message']);return _0xd6834e(_0x106311[_0xce13('0x14')][_0xce13('0x17')]);}logger[_0xce13('0x14')](_0xce13('0x16'),_0x5f572a,_0x106311[_0xce13('0x14')][_0xce13('0x17')]);return _0x30e198(_0x106311[_0xce13('0x14')][_0xce13('0x17')]);}else{logger[_0xce13('0xf')](_0xce13('0x16'),_0x5f572a,_0xce13('0x10'));_0x30e198(_0x106311[_0xce13('0x18')][_0xce13('0x17')]);}})[_0xce13('0x19')](function(_0x704cf9){logger['error'](_0xce13('0x16'),_0x5f572a,_0x704cf9);_0xd6834e(_0x704cf9);});});}
\ No newline at end of file
+var _0x4098=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','catch','lodash'];(function(_0x104d23,_0x39fb6c){var _0x1988c5=function(_0x1c839f){while(--_0x1c839f){_0x104d23['push'](_0x104d23['shift']());}};_0x1988c5(++_0x39fb6c);}(_0x4098,0x1da));var _0x8409=function(_0x51f11f,_0x3db7fa){_0x51f11f=_0x51f11f-0x0;var _0xe64231=_0x4098[_0x51f11f];return _0xe64231;};'use strict';var _=require(_0x8409('0x0'));var util=require(_0x8409('0x1'));var moment=require(_0x8409('0x2'));var BPromise=require(_0x8409('0x3'));var rs=require(_0x8409('0x4'));var fs=require('fs');var Redis=require(_0x8409('0x5'));var db=require(_0x8409('0x6'))['db'];var utils=require(_0x8409('0x7'));var logger=require(_0x8409('0x8'))(_0x8409('0x9'));var config=require(_0x8409('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8409('0xb')][_0x8409('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f2a93,_0x27790a,_0x26396f){return new BPromise(function(_0x2da74c,_0x31c8b1){return client[_0x8409('0xd')](_0x1f2a93,_0x26396f)[_0x8409('0xe')](function(_0x593e54){logger[_0x8409('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x27790a,'request\x20sent');logger[_0x8409('0x10')](_0x8409('0x11'),_0x27790a,_0x8409('0x12'),JSON[_0x8409('0x13')](_0x593e54));if(_0x593e54['error']){if(_0x593e54[_0x8409('0x14')][_0x8409('0x15')]===0x1f4){logger[_0x8409('0x14')](_0x8409('0x16'),_0x27790a,_0x593e54[_0x8409('0x14')][_0x8409('0x17')]);return _0x31c8b1(_0x593e54[_0x8409('0x14')]['message']);}logger[_0x8409('0x14')](_0x8409('0x16'),_0x27790a,_0x593e54[_0x8409('0x14')]['message']);return _0x2da74c(_0x593e54[_0x8409('0x14')]['message']);}else{logger[_0x8409('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x27790a,'request\x20sent');_0x2da74c(_0x593e54['result']['message']);}})[_0x8409('0x18')](function(_0x2a0b37){logger[_0x8409('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x27790a,_0x2a0b37);_0x31c8b1(_0x2a0b37);});});}
\ No newline at end of file
index 651f436..dba0cd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1203=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x1203,0x8c));var _0x3120=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1203[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x3120('0x0'));var util=require(_0x3120('0x1'));var path=require(_0x3120('0x2'));var timeout=require(_0x3120('0x3'));var express=require(_0x3120('0x4'));var router=express[_0x3120('0x5')]();var auth=require(_0x3120('0x6'));var interaction=require(_0x3120('0x7'));var config=require(_0x3120('0x8'));module[_0x3120('0x9')]=router;
\ No newline at end of file
+var _0x9c63=['express','../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x9c63,0x1a7));var _0x39c6=function(_0x5282fb,_0x5b2693){_0x5282fb=_0x5282fb-0x0;var _0x4ac1ec=_0x9c63[_0x5282fb];return _0x4ac1ec;};'use strict';var multer=require(_0x39c6('0x0'));var util=require(_0x39c6('0x1'));var path=require(_0x39c6('0x2'));var timeout=require(_0x39c6('0x3'));var express=require(_0x39c6('0x4'));var router=express['Router']();var auth=require(_0x39c6('0x5'));var interaction=require(_0x39c6('0x6'));var config=require('../../config/environment');module['exports']=router;
\ No newline at end of file
index 236954b..3409c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2930=['sequelize','exports','INTEGER'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x2930,0x177));var _0x0293=function(_0x3b5493,_0x47ea1c){_0x3b5493=_0x3b5493-0x0;var _0x4bcdc4=_0x2930[_0x3b5493];return _0x4bcdc4;};'use strict';var Sequelize=require(_0x0293('0x0'));module[_0x0293('0x1')]={'penalty':{'type':Sequelize[_0x0293('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3c9b=['exports','INTEGER','sequelize'];(function(_0x4eecd1,_0x1164e8){var _0x457c2c=function(_0x5b92f0){while(--_0x5b92f0){_0x4eecd1['push'](_0x4eecd1['shift']());}};_0x457c2c(++_0x1164e8);}(_0x3c9b,0x77));var _0xb3c9=function(_0x3e2c06,_0x7732b4){_0x3e2c06=_0x3e2c06-0x0;var _0x10fc0d=_0x3c9b[_0x3e2c06];return _0x10fc0d;};'use strict';var Sequelize=require(_0xb3c9('0x0'));module[_0xb3c9('0x1')]={'penalty':{'type':Sequelize[_0xb3c9('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 367539c..e6781ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc69a=['util','api','moment','bluebird','request-promise','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc69a,0xc0));var _0xac69=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc69a[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xac69('0x0'));var logger=require('../../config/logger')(_0xac69('0x1'));var moment=require(_0xac69('0x2'));var BPromise=require(_0xac69('0x3'));var rp=require(_0xac69('0x4'));var attributes=require(_0xac69('0x5'));module['exports']=function(_0x50e854,_0x44f579){return _0x50e854['define'](_0xac69('0x6'),attributes,{'tableName':_0xac69('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b2a=['lodash','../../config/logger','moment','bluebird','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues'];(function(_0x16e49e,_0x520e54){var _0x2a9354=function(_0x55b5cd){while(--_0x55b5cd){_0x16e49e['push'](_0x16e49e['shift']());}};_0x2a9354(++_0x520e54);}(_0x0b2a,0x88));var _0xa0b2=function(_0x298ff1,_0x535819){_0x298ff1=_0x298ff1-0x0;var _0x1a7e32=_0x0b2a[_0x298ff1];return _0x1a7e32;};'use strict';var _=require(_0xa0b2('0x0'));var util=require('util');var logger=require(_0xa0b2('0x1'))('api');var moment=require(_0xa0b2('0x2'));var BPromise=require(_0xa0b2('0x3'));var rp=require('request-promise');var attributes=require(_0xa0b2('0x4'));module[_0xa0b2('0x5')]=function(_0x6d3ec1,_0x237a8a){return _0x6d3ec1['define'](_0xa0b2('0x6'),attributes,{'tableName':_0xa0b2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 69cfbaa..b153cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceae=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x559aca,_0x41a249){var _0x5627fe=function(_0x570760){while(--_0x570760){_0x559aca['push'](_0x559aca['shift']());}};_0x5627fe(++_0x41a249);}(_0xceae,0x1f3));var _0xecea=function(_0x15caa5,_0x206c67){_0x15caa5=_0x15caa5-0x0;var _0x1200c7=_0xceae[_0x15caa5];return _0x1200c7;};'use strict';var _=require(_0xecea('0x0'));var util=require(_0xecea('0x1'));var moment=require('moment');var BPromise=require(_0xecea('0x2'));var rs=require(_0xecea('0x3'));var fs=require('fs');var Redis=require(_0xecea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xecea('0x5'));var logger=require(_0xecea('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xecea('0x7'));var client=jayson[_0xecea('0x8')][_0xecea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14be13,_0x3b8b22,_0x2a11d1){return new BPromise(function(_0x37d2e7,_0x2591a5){return client['request'](_0x14be13,_0x2a11d1)[_0xecea('0xa')](function(_0x2b5a99){logger['info'](_0xecea('0xb'),_0x3b8b22,_0xecea('0xc'));logger[_0xecea('0xd')](_0xecea('0xe'),_0x3b8b22,_0xecea('0xc'),JSON[_0xecea('0xf')](_0x2b5a99));if(_0x2b5a99[_0xecea('0x10')]){if(_0x2b5a99[_0xecea('0x10')][_0xecea('0x11')]===0x1f4){logger['error'](_0xecea('0xb'),_0x3b8b22,_0x2b5a99[_0xecea('0x10')][_0xecea('0x12')]);return _0x2591a5(_0x2b5a99[_0xecea('0x10')][_0xecea('0x12')]);}logger[_0xecea('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x3b8b22,_0x2b5a99[_0xecea('0x10')][_0xecea('0x12')]);return _0x37d2e7(_0x2b5a99[_0xecea('0x10')]['message']);}else{logger['info'](_0xecea('0xb'),_0x3b8b22,'request\x20sent');_0x37d2e7(_0x2b5a99['result'][_0xecea('0x12')]);}})[_0xecea('0x13')](function(_0xf55f4){logger[_0xecea('0x10')](_0xecea('0xb'),_0x3b8b22,_0xf55f4);_0x2591a5(_0xf55f4);});});}
\ No newline at end of file
+var _0x762e=['rpc','../../config/environment','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/logger'];(function(_0x2bab64,_0x51be9d){var _0x385962=function(_0x1d74c8){while(--_0x1d74c8){_0x2bab64['push'](_0x2bab64['shift']());}};_0x385962(++_0x51be9d);}(_0x762e,0xa2));var _0xe762=function(_0x1af790,_0x24a1e9){_0x1af790=_0x1af790-0x0;var _0x13c10b=_0x762e[_0x1af790];return _0x13c10b;};'use strict';var _=require(_0xe762('0x0'));var util=require(_0xe762('0x1'));var moment=require(_0xe762('0x2'));var BPromise=require(_0xe762('0x3'));var rs=require(_0xe762('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe762('0x5'))(_0xe762('0x6'));var config=require(_0xe762('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe762('0x8')][_0xe762('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58c35,_0x2a0c82,_0x45407e){return new BPromise(function(_0x46e739,_0x43c836){return client['request'](_0x58c35,_0x45407e)[_0xe762('0xa')](function(_0x456ea9){logger[_0xe762('0xb')](_0xe762('0xc'),_0x2a0c82,_0xe762('0xd'));logger[_0xe762('0xe')](_0xe762('0xf'),_0x2a0c82,'request\x20sent',JSON[_0xe762('0x10')](_0x456ea9));if(_0x456ea9[_0xe762('0x11')]){if(_0x456ea9[_0xe762('0x11')][_0xe762('0x12')]===0x1f4){logger[_0xe762('0x11')](_0xe762('0xc'),_0x2a0c82,_0x456ea9[_0xe762('0x11')][_0xe762('0x13')]);return _0x43c836(_0x456ea9[_0xe762('0x11')]['message']);}logger['error'](_0xe762('0xc'),_0x2a0c82,_0x456ea9[_0xe762('0x11')][_0xe762('0x13')]);return _0x46e739(_0x456ea9[_0xe762('0x11')][_0xe762('0x13')]);}else{logger[_0xe762('0xb')](_0xe762('0xc'),_0x2a0c82,'request\x20sent');_0x46e739(_0x456ea9['result'][_0xe762('0x13')]);}})[_0xe762('0x14')](function(_0x4c0fdc){logger[_0xe762('0x11')](_0xe762('0xc'),_0x2a0c82,_0x4c0fdc);_0x43c836(_0x4c0fdc);});});}
\ No newline at end of file
index 28079a9..b947fc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d91=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x0d91,0x76));var _0x10d9=function(_0x5d7747,_0x55c074){_0x5d7747=_0x5d7747-0x0;var _0x291142=_0x0d91[_0x5d7747];return _0x291142;};'use strict';var multer=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var path=require(_0x10d9('0x2'));var timeout=require(_0x10d9('0x3'));var express=require('express');var router=express[_0x10d9('0x4')]();var auth=require(_0x10d9('0x5'));var interaction=require(_0x10d9('0x6'));var config=require('../../config/environment');module[_0x10d9('0x7')]=router;
\ No newline at end of file
+var _0x4351=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x111cc4,_0x4854a3){var _0x4814f3=function(_0x330c24){while(--_0x330c24){_0x111cc4['push'](_0x111cc4['shift']());}};_0x4814f3(++_0x4854a3);}(_0x4351,0x1b5));var _0x1435=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x4351[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require(_0x1435('0x2'));var timeout=require(_0x1435('0x3'));var express=require(_0x1435('0x4'));var router=express[_0x1435('0x5')]();var auth=require(_0x1435('0x6'));var interaction=require(_0x1435('0x7'));var config=require(_0x1435('0x8'));module[_0x1435('0x9')]=router;
\ No newline at end of file
index 5e2a51a..9e3e724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2344=['Required\x20by\x20Asterisk','INTEGER','STRING','queue_interface','exports'];(function(_0x3ff788,_0x1ca33d){var _0x3724b6=function(_0x3e0d43){while(--_0x3e0d43){_0x3ff788['push'](_0x3ff788['shift']());}};_0x3724b6(++_0x1ca33d);}(_0x2344,0x1e4));var _0x4234=function(_0x3f1081,_0x7ace74){_0x3f1081=_0x3f1081-0x0;var _0x2d749f=_0x2344[_0x3f1081];return _0x2d749f;};'use strict';var Sequelize=require('sequelize');module[_0x4234('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4234('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x4234('0x1')},'UserId':{'type':Sequelize[_0x4234('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4234('0x3')],'allowNull':![],'unique':_0x4234('0x4'),'comment':_0x4234('0x1')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x4234('0x3')],'allowNull':![],'unique':_0x4234('0x4'),'comment':_0x4234('0x1')},'penalty':{'type':Sequelize[_0x4234('0x2')](0xb),'defaultValue':0x0,'comment':_0x4234('0x1')},'paused':{'type':Sequelize[_0x4234('0x2')](0xb),'defaultValue':0x0,'comment':_0x4234('0x1')}};
\ No newline at end of file
+var _0x444c=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x444c,0x125));var _0xc444=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x444c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc444('0x0'));module[_0xc444('0x1')]={'uniqueid':{'type':Sequelize[_0xc444('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xc444('0x3')],'allowNull':![],'comment':_0xc444('0x4')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc444('0x5'),'comment':_0xc444('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc444('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xc444('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xc444('0x4')},'penalty':{'type':Sequelize[_0xc444('0x2')](0xb),'defaultValue':0x0,'comment':_0xc444('0x4')},'paused':{'type':Sequelize[_0xc444('0x2')](0xb),'defaultValue':0x0,'comment':_0xc444('0x4')}};
\ No newline at end of file
index 67d4768..cd93d30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74b2=['save','update','remove','emit','exports','../../mysqldb','setMaxListeners'];(function(_0x457c28,_0x1d4053){var _0x310cbc=function(_0x2d94c1){while(--_0x2d94c1){_0x457c28['push'](_0x457c28['shift']());}};_0x310cbc(++_0x1d4053);}(_0x74b2,0x1c5));var _0x274b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74b2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x274b('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x274b('0x1')](0x0);var events={'afterCreate':_0x274b('0x2'),'afterUpdate':_0x274b('0x3'),'afterDestroy':_0x274b('0x4')};function emitEvent(_0x1b2583){return function(_0x2dbc0e,_0x4a877f,_0x494d23){UserVoiceQueueRtEvents[_0x274b('0x5')](_0x1b2583+':'+_0x2dbc0e['id'],_0x2dbc0e);UserVoiceQueueRtEvents[_0x274b('0x5')](_0x1b2583,_0x2dbc0e);_0x494d23(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x274b('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xb9f0=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1f4b29,_0x1aaf91){var _0x16e309=function(_0x50e27a){while(--_0x50e27a){_0x1f4b29['push'](_0x1f4b29['shift']());}};_0x16e309(++_0x1aaf91);}(_0xb9f0,0x12c));var _0x0b9f=function(_0x270416,_0x4e9e3e){_0x270416=_0x270416-0x0;var _0x24799b=_0xb9f0[_0x270416];return _0x24799b;};'use strict';var EventEmitter=require(_0x0b9f('0x0'));var UserVoiceQueueRt=require(_0x0b9f('0x1'))['db'][_0x0b9f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0b9f('0x3')](0x0);var events={'afterCreate':_0x0b9f('0x4'),'afterUpdate':_0x0b9f('0x5'),'afterDestroy':_0x0b9f('0x6')};function emitEvent(_0x3b2878){return function(_0x4889e6,_0x22338e,_0x45a558){UserVoiceQueueRtEvents[_0x0b9f('0x7')](_0x3b2878+':'+_0x4889e6['id'],_0x4889e6);UserVoiceQueueRtEvents[_0x0b9f('0x7')](_0x3b2878,_0x4889e6);_0x45a558(null);};}for(var e in events){if(events[_0x0b9f('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x0b9f('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
index 151ec17..c1586c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe568=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','bluebird','request-promise','./userVoiceQueueRt.attributes','exports','define'];(function(_0x240290,_0x53f8bb){var _0x17c8cf=function(_0x2ea15d){while(--_0x2ea15d){_0x240290['push'](_0x240290['shift']());}};_0x17c8cf(++_0x53f8bb);}(_0xe568,0x1ce));var _0x8e56=function(_0x23f8d2,_0x301fec){_0x23f8d2=_0x23f8d2-0x0;var _0x5d174b=_0xe568[_0x23f8d2];return _0x5d174b;};'use strict';var _=require(_0x8e56('0x0'));var util=require(_0x8e56('0x1'));var logger=require(_0x8e56('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8e56('0x3'));var rp=require(_0x8e56('0x4'));var attributes=require(_0x8e56('0x5'));module[_0x8e56('0x6')]=function(_0x537c96,_0x2e194d){return _0x537c96[_0x8e56('0x7')](_0x8e56('0x8'),attributes,{'tableName':_0x8e56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x098b=['define','user_has_voice_queues_rt','lodash','util','api','bluebird','request-promise','./userVoiceQueueRt.attributes','exports'];(function(_0x45872a,_0x4e1103){var _0x37d69f=function(_0xc9e893){while(--_0xc9e893){_0x45872a['push'](_0x45872a['shift']());}};_0x37d69f(++_0x4e1103);}(_0x098b,0x13d));var _0xb098=function(_0x31ecaf,_0x341af0){_0x31ecaf=_0x31ecaf-0x0;var _0x554883=_0x098b[_0x31ecaf];return _0x554883;};'use strict';var _=require(_0xb098('0x0'));var util=require(_0xb098('0x1'));var logger=require('../../config/logger')(_0xb098('0x2'));var moment=require('moment');var BPromise=require(_0xb098('0x3'));var rp=require(_0xb098('0x4'));var attributes=require(_0xb098('0x5'));module[_0xb098('0x6')]=function(_0x55022d,_0x59c762){return _0x55022d[_0xb098('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xb098('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf42ec5..f780348 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb99=['client','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42fef2,_0xdf1543){var _0x340e9d=function(_0x42d4fe){while(--_0x42d4fe){_0x42fef2['push'](_0x42fef2['shift']());}};_0x340e9d(++_0xdf1543);}(_0xfb99,0x95));var _0x9fb9=function(_0x1abd92,_0x357253){_0x1abd92=_0x1abd92-0x0;var _0x449268=_0xfb99[_0x1abd92];return _0x449268;};'use strict';var _=require(_0x9fb9('0x0'));var util=require(_0x9fb9('0x1'));var moment=require(_0x9fb9('0x2'));var BPromise=require(_0x9fb9('0x3'));var rs=require(_0x9fb9('0x4'));var fs=require('fs');var Redis=require(_0x9fb9('0x5'));var db=require(_0x9fb9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fb9('0x7'))(_0x9fb9('0x8'));var config=require(_0x9fb9('0x9'));var jayson=require(_0x9fb9('0xa'));var client=jayson[_0x9fb9('0xb')]['http']({'port':0x232a});config[_0x9fb9('0xc')]=_[_0x9fb9('0xd')](config[_0x9fb9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9fb9('0xe'))(new Redis(config[_0x9fb9('0xc')]));require(_0x9fb9('0xf'))[_0x9fb9('0x10')](socket);function respondWithRpcPromise(_0x5a93ea,_0x361fc6,_0x18ddec){return new BPromise(function(_0x3f45c0,_0x52a37c){return client[_0x9fb9('0x11')](_0x5a93ea,_0x18ddec)[_0x9fb9('0x12')](function(_0x4e8480){logger[_0x9fb9('0x13')](_0x9fb9('0x14'),_0x361fc6,_0x9fb9('0x15'));logger[_0x9fb9('0x16')](_0x9fb9('0x17'),_0x361fc6,_0x9fb9('0x15'),JSON[_0x9fb9('0x18')](_0x4e8480));if(_0x4e8480[_0x9fb9('0x19')]){if(_0x4e8480[_0x9fb9('0x19')][_0x9fb9('0x1a')]===0x1f4){logger[_0x9fb9('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x361fc6,_0x4e8480[_0x9fb9('0x19')]['message']);return _0x52a37c(_0x4e8480[_0x9fb9('0x19')][_0x9fb9('0x1b')]);}logger[_0x9fb9('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x361fc6,_0x4e8480[_0x9fb9('0x19')]['message']);return _0x3f45c0(_0x4e8480[_0x9fb9('0x19')][_0x9fb9('0x1b')]);}else{logger[_0x9fb9('0x13')](_0x9fb9('0x14'),_0x361fc6,'request\x20sent');_0x3f45c0(_0x4e8480[_0x9fb9('0x1c')]['message']);}})[_0x9fb9('0x1d')](function(_0x500ace){logger[_0x9fb9('0x19')](_0x9fb9('0x14'),_0x361fc6,_0x500ace);_0x52a37c(_0x500ace);});});}exports[_0x9fb9('0x1e')]=function(_0x582104){var _0x1dcdd3=this;return new Promise(function(_0x16c0f9,_0xebdde2){return db[_0x9fb9('0x1f')][_0x9fb9('0x20')]({'raw':_0x582104[_0x9fb9('0x21')]?_0x582104[_0x9fb9('0x21')][_0x9fb9('0x22')]===undefined?!![]:![]:!![],'where':_0x582104['options']?_0x582104[_0x9fb9('0x21')]['where']||null:null,'attributes':[[db[_0x9fb9('0x23')]['fn'](_0x9fb9('0x24'),db[_0x9fb9('0x23')]['fn']('IF',db[_0x9fb9('0x23')][_0x9fb9('0x25')](_0x9fb9('0x26')))),_0x9fb9('0x27')]]})[_0x9fb9('0x12')](function(_0x2d9c7c){logger[_0x9fb9('0x13')]('GetVoiceQueueRtPauses',_0x582104);logger[_0x9fb9('0x16')](_0x9fb9('0x1e'),_0x582104,JSON[_0x9fb9('0x18')](_0x2d9c7c));_0x16c0f9(_0x2d9c7c);})[_0x9fb9('0x1d')](function(_0x1de8f8){logger[_0x9fb9('0x19')](_0x9fb9('0x1e'),_0x1de8f8['message'],_0x582104);_0xebdde2(_0x1dcdd3[_0x9fb9('0x19')](0x1f4,_0x1de8f8[_0x9fb9('0x1b')]));});});};
\ No newline at end of file
+var _0xadb3=['./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','literal','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xadb3,0x89));var _0x3adb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xadb3[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x3adb('0x0'));var moment=require(_0x3adb('0x1'));var BPromise=require(_0x3adb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3adb('0x4'));var logger=require(_0x3adb('0x5'))(_0x3adb('0x6'));var config=require(_0x3adb('0x7'));var jayson=require(_0x3adb('0x8'));var client=jayson[_0x3adb('0x9')][_0x3adb('0xa')]({'port':0x232a});config[_0x3adb('0xb')]=_[_0x3adb('0xc')](config[_0x3adb('0xb')],{'host':_0x3adb('0xd'),'port':0x18eb});var socket=require(_0x3adb('0xe'))(new Redis(config[_0x3adb('0xb')]));require(_0x3adb('0xf'))[_0x3adb('0x10')](socket);function respondWithRpcPromise(_0x481675,_0x3687f5,_0x120d92){return new BPromise(function(_0x10118e,_0x2d1e3e){return client[_0x3adb('0x11')](_0x481675,_0x120d92)[_0x3adb('0x12')](function(_0x76e5a7){logger[_0x3adb('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3687f5,_0x3adb('0x14'));logger[_0x3adb('0x15')](_0x3adb('0x16'),_0x3687f5,_0x3adb('0x14'),JSON[_0x3adb('0x17')](_0x76e5a7));if(_0x76e5a7[_0x3adb('0x18')]){if(_0x76e5a7[_0x3adb('0x18')][_0x3adb('0x19')]===0x1f4){logger[_0x3adb('0x18')](_0x3adb('0x1a'),_0x3687f5,_0x76e5a7[_0x3adb('0x18')][_0x3adb('0x1b')]);return _0x2d1e3e(_0x76e5a7[_0x3adb('0x18')][_0x3adb('0x1b')]);}logger[_0x3adb('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3687f5,_0x76e5a7['error'][_0x3adb('0x1b')]);return _0x10118e(_0x76e5a7[_0x3adb('0x18')][_0x3adb('0x1b')]);}else{logger[_0x3adb('0x13')](_0x3adb('0x1a'),_0x3687f5,_0x3adb('0x14'));_0x10118e(_0x76e5a7[_0x3adb('0x1c')][_0x3adb('0x1b')]);}})['catch'](function(_0x371e0e){logger[_0x3adb('0x18')](_0x3adb('0x1a'),_0x3687f5,_0x371e0e);_0x2d1e3e(_0x371e0e);});});}exports[_0x3adb('0x1d')]=function(_0x27ce1d){var _0x1a2d1a=this;return new Promise(function(_0x16b3b4,_0x19d278){return db['UserVoiceQueueRt'][_0x3adb('0x1e')]({'raw':_0x27ce1d[_0x3adb('0x1f')]?_0x27ce1d[_0x3adb('0x1f')][_0x3adb('0x20')]===undefined?!![]:![]:!![],'where':_0x27ce1d[_0x3adb('0x1f')]?_0x27ce1d[_0x3adb('0x1f')][_0x3adb('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0x3adb('0x22'),db[_0x3adb('0x23')]['fn']('IF',db[_0x3adb('0x23')][_0x3adb('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x3adb('0x12')](function(_0x3c20f4){logger[_0x3adb('0x13')](_0x3adb('0x1d'),_0x27ce1d);logger[_0x3adb('0x15')](_0x3adb('0x1d'),_0x27ce1d,JSON[_0x3adb('0x17')](_0x3c20f4));_0x16b3b4(_0x3c20f4);})[_0x3adb('0x25')](function(_0xf0f823){logger['error'](_0x3adb('0x1d'),_0xf0f823[_0x3adb('0x1b')],_0x27ce1d);_0x19d278(_0x1a2d1a[_0x3adb('0x18')](0x1f4,_0xf0f823['message']));});});};
\ No newline at end of file
index 9e86d17..6dc5ccf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3831=['removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update'];(function(_0x14dda7,_0x16b0c8){var _0x1f8642=function(_0x39fda1){while(--_0x39fda1){_0x14dda7['push'](_0x14dda7['shift']());}};_0x1f8642(++_0x16b0c8);}(_0x3831,0x14c));var _0x1383=function(_0x48051b,_0x339115){_0x48051b=_0x48051b-0x0;var _0x2a4f6e=_0x3831[_0x48051b];return _0x2a4f6e;};'use strict';var UserVoiceQueueRtEvents=require(_0x1383('0x0'));var events=['save',_0x1383('0x1'),_0x1383('0x2')];function createListener(_0x3a25fd,_0x15e6b5){return function(_0x391bef){_0x15e6b5['emit'](_0x3a25fd,_0x391bef);};}function removeListener(_0x2fdf72,_0x573874){return function(){UserVoiceQueueRtEvents[_0x1383('0x3')](_0x2fdf72,_0x573874);};}exports['register']=function(_0x5b64b1){for(var _0x5eb4d8=0x0,_0x45a030=events['length'];_0x5eb4d8<_0x45a030;_0x5eb4d8++){var _0x187027=events[_0x5eb4d8];var _0x1ddd4c=createListener(_0x1383('0x4')+_0x187027,_0x5b64b1);UserVoiceQueueRtEvents['on'](_0x187027,_0x1ddd4c);}};
\ No newline at end of file
+var _0xc949=['userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit','removeListener','register','length'];(function(_0x4da1fb,_0xe089b6){var _0x5c3b30=function(_0x126b49){while(--_0x126b49){_0x4da1fb['push'](_0x4da1fb['shift']());}};_0x5c3b30(++_0xe089b6);}(_0xc949,0x181));var _0x9c94=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xc949[_0x34bc30];return _0x5706de;};'use strict';var UserVoiceQueueRtEvents=require(_0x9c94('0x0'));var events=['save',_0x9c94('0x1'),_0x9c94('0x2')];function createListener(_0x209cd8,_0x27613f){return function(_0x54facf){_0x27613f[_0x9c94('0x3')](_0x209cd8,_0x54facf);};}function removeListener(_0x231762,_0x528a17){return function(){UserVoiceQueueRtEvents[_0x9c94('0x4')](_0x231762,_0x528a17);};}exports[_0x9c94('0x5')]=function(_0x46d560){for(var _0x1357ac=0x0,_0x57fcd7=events[_0x9c94('0x6')];_0x1357ac<_0x57fcd7;_0x1357ac++){var _0x360e7b=events[_0x1357ac];var _0x25ecd0=createListener(_0x9c94('0x7')+_0x360e7b,_0x46d560);UserVoiceQueueRtEvents['on'](_0x360e7b,_0x25ecd0);}};
\ No newline at end of file
index 806925d..9dcc1e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x70e0,0x17b));var _0x070e=function(_0xe33b98,_0x498070){_0xe33b98=_0xe33b98-0x0;var _0x3ca4b9=_0x70e0[_0xe33b98];return _0x3ca4b9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./variable.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')](_0x070e('0xe'),auth[_0x070e('0xb')](),controller['update']);router['delete'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router;
\ No newline at end of file
+var _0xbdb7=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','post','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3e2826,_0x479673){var _0x286f46=function(_0x2ffb8c){while(--_0x2ffb8c){_0x3e2826['push'](_0x3e2826['shift']());}};_0x286f46(++_0x479673);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x34217f,_0x4954d9){_0x34217f=_0x34217f-0x0;var _0x533721=_0xbdb7[_0x34217f];return _0x533721;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var auth=require(_0x7bdb('0x6'));var interaction=require(_0x7bdb('0x7'));var config=require(_0x7bdb('0x8'));var controller=require('./variable.controller');router[_0x7bdb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7bdb('0x9')](_0x7bdb('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x7bdb('0xb')]('/',auth[_0x7bdb('0xc')](),controller['create']);router['put'](_0x7bdb('0xa'),auth[_0x7bdb('0xc')](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xe')](_0x7bdb('0xa'),auth[_0x7bdb('0xc')](),controller[_0x7bdb('0xf')]);module[_0x7bdb('0x10')]=router;
\ No newline at end of file
index 2f04921..9963abc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd43e=['name','sequelize','STRING'];(function(_0x189de1,_0x1c3fb3){var _0x211f9e=function(_0x3145a2){while(--_0x3145a2){_0x189de1['push'](_0x189de1['shift']());}};_0x211f9e(++_0x1c3fb3);}(_0xd43e,0x88));var _0xed43=function(_0x142461,_0x7cd223){_0x142461=_0x142461-0x0;var _0x1c4241=_0xd43e[_0x142461];return _0x1c4241;};'use strict';var Sequelize=require(_0xed43('0x0'));module['exports']={'name':{'type':Sequelize[_0xed43('0x1')],'unique':_0xed43('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xed43('0x1')]}};
\ No newline at end of file
+var _0x5ce6=['exports','STRING','name','sequelize'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5ce6,0x1cf));var _0x65ce=function(_0x1497be,_0x178fa9){_0x1497be=_0x1497be-0x0;var _0xb9c869=_0x5ce6[_0x1497be];return _0xb9c869;};'use strict';var Sequelize=require(_0x65ce('0x0'));module[_0x65ce('0x1')]={'name':{'type':Sequelize[_0x65ce('0x2')],'unique':_0x65ce('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 51850be..b370887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['add','day','merge','where','filter','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','Variable','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0baf('0x0'));var rimraf=require(_0x0baf('0x1'));var zipdir=require(_0x0baf('0x2'));var jsonpatch=require(_0x0baf('0x3'));var rp=require(_0x0baf('0x4'));var moment=require(_0x0baf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0baf('0x6'));var util=require(_0x0baf('0x7'));var path=require(_0x0baf('0x8'));var sox=require(_0x0baf('0x9'));var csv=require(_0x0baf('0xa'));var ejs=require(_0x0baf('0xb'));var fs=require('fs');var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var qs=require(_0x0baf('0x13'));var logger=require(_0x0baf('0x14'))(_0x0baf('0x15'));var utils=require(_0x0baf('0x16'));var config=require(_0x0baf('0x17'));var db=require(_0x0baf('0x18'))['db'];function respondWithStatusCode(_0x1d60a2,_0x904f4a){_0x904f4a=_0x904f4a||0xcc;return function(_0x51d93c){if(_0x51d93c){return _0x1d60a2['sendStatus'](_0x904f4a);}return _0x1d60a2[_0x0baf('0x19')](_0x904f4a)[_0x0baf('0x1a')]();};}function respondWithResult(_0x5db689,_0x13df17){_0x13df17=_0x13df17||0xc8;return function(_0x5a0583){if(_0x5a0583){return _0x5db689[_0x0baf('0x19')](_0x13df17)['json'](_0x5a0583);}};}function respondWithFilteredResult(_0x1c76a8,_0x1f50c3){return function(_0x7fbf67){if(_0x7fbf67){var _0x2bc381=_0x7fbf67['count'],_0xb8339e=_0x1f50c3[_0x0baf('0x1b')],_0x469599=_0x1f50c3[_0x0baf('0x1b')]+_0x1f50c3[_0x0baf('0x1c')],_0x4f80a8;if(_0x469599>=_0x2bc381){_0x469599=_0x2bc381;_0x4f80a8=0xc8;}else{_0x4f80a8=0xce;}_0x1c76a8[_0x0baf('0x19')](_0x4f80a8);return _0x1c76a8[_0x0baf('0x1d')](_0x0baf('0x1e'),_0xb8339e+'-'+_0x469599+'/'+_0x2bc381)['json'](_0x7fbf67);}return null;};}function patchUpdates(_0x63c820){return function(_0xfbecec){try{jsonpatch[_0x0baf('0x1f')](_0xfbecec,_0x63c820,!![]);}catch(_0x3e9cb4){return BPromise[_0x0baf('0x20')](_0x3e9cb4);}return _0xfbecec[_0x0baf('0x21')]();};}function saveUpdates(_0x4ff793,_0x5cff5d){return function(_0x1410ec){if(_0x1410ec){return _0x1410ec[_0x0baf('0x22')](_0x4ff793)[_0x0baf('0x23')](function(_0x1848e8){return _0x1848e8;});}return null;};}function removeEntity(_0x1fa92b,_0x3e3e20){return function(_0x210cd8){if(_0x210cd8){return _0x210cd8[_0x0baf('0x24')]()[_0x0baf('0x23')](function(){var _0x15a2c3=_0x210cd8['get']({'plain':!![]});var _0x334bd6='Variables';return db[_0x0baf('0x25')]['destroy']({'where':{'type':_0x334bd6,'resourceId':_0x15a2c3['id']}})['then'](function(){return _0x210cd8;});})[_0x0baf('0x23')](function(){_0x1fa92b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47c4b,_0x27b59c){return function(_0x34e264){if(!_0x34e264){_0x47c4b[_0x0baf('0x26')](0x194);}return _0x34e264;};}function handleError(_0x3a1ba1,_0x56b299){_0x56b299=_0x56b299||0x1f4;return function(_0x448617){logger[_0x0baf('0x27')](_0x448617[_0x0baf('0x28')]);if(_0x448617[_0x0baf('0x29')]){delete _0x448617[_0x0baf('0x29')];}_0x3a1ba1[_0x0baf('0x19')](_0x56b299)[_0x0baf('0x2a')](_0x448617);};}exports['index']=function(_0x1590b4,_0x393a5a){var _0xcaf13d={},_0x265915={},_0x55c715={'count':0x0,'rows':[]};var _0x29dbdf=db[_0x0baf('0x2b')]['rawAttributes'];_0x265915[_0x0baf('0x2c')]=_[_0x0baf('0x2d')](_0x29dbdf);var _0x478ce8={'dateStart':_0x1590b4[_0x0baf('0x2e')][_0x0baf('0x2f')],'dateEnd':_0x1590b4[_0x0baf('0x2e')][_0x0baf('0x30')]};delete _0x1590b4['query'][_0x0baf('0x2f')];delete _0x1590b4[_0x0baf('0x2e')][_0x0baf('0x30')];_0x265915[_0x0baf('0x2e')]=_[_0x0baf('0x2d')](_0x1590b4[_0x0baf('0x2e')]);_0x265915[_0x0baf('0x31')]=_[_0x0baf('0x32')](_0x265915[_0x0baf('0x2c')],_0x265915[_0x0baf('0x2e')]);_0xcaf13d[_0x0baf('0x33')]=_[_0x0baf('0x32')](_0x265915[_0x0baf('0x2c')],qs[_0x0baf('0x34')](_0x1590b4['query'][_0x0baf('0x34')]));_0xcaf13d['attributes']=_0xcaf13d[_0x0baf('0x33')][_0x0baf('0x35')]?_0xcaf13d[_0x0baf('0x33')]:_0x265915[_0x0baf('0x2c')];if(!_0x1590b4['query'][_0x0baf('0x36')](_0x0baf('0x37'))){_0xcaf13d['limit']=qs[_0x0baf('0x1c')](_0x1590b4[_0x0baf('0x2e')][_0x0baf('0x1c')]);_0xcaf13d[_0x0baf('0x1b')]=qs[_0x0baf('0x1b')](_0x1590b4[_0x0baf('0x2e')][_0x0baf('0x1b')]);}_0xcaf13d[_0x0baf('0x38')]=qs['sort'](_0x1590b4[_0x0baf('0x2e')][_0x0baf('0x39')]);_0xcaf13d['where']=qs[_0x0baf('0x31')](_['pick'](_0x1590b4['query'],_0x265915[_0x0baf('0x31')]));if(_0x478ce8[_0x0baf('0x2f')]){if(_0x478ce8['dateEnd']){_0x478ce8['dateEnd']=moment(_0x478ce8[_0x0baf('0x30')])[_0x0baf('0x3a')](0x1,_0x0baf('0x3b'));}else{_0x478ce8[_0x0baf('0x30')]=moment(_0x478ce8[_0x0baf('0x2f')])[_0x0baf('0x3a')](0x1,_0x0baf('0x3b'));}_[_0x0baf('0x3c')](_0xcaf13d[_0x0baf('0x3d')],{'createdAt':{'$gte':_0x478ce8[_0x0baf('0x2f')],'$lte':_0x478ce8[_0x0baf('0x30')]}});}if(_0x1590b4[_0x0baf('0x2e')][_0x0baf('0x3e')]){_0xcaf13d[_0x0baf('0x3d')]=_['merge'](_0xcaf13d[_0x0baf('0x3d')],{'$or':_[_0x0baf('0x3f')](_0x29dbdf,function(_0x4f1de9){if(_0x4f1de9[_0x0baf('0x40')][_0x0baf('0x41')]!==_0x0baf('0x42')){var _0x299f93={};_0x299f93[_0x4f1de9[_0x0baf('0x43')]]={'$like':'%'+_0x1590b4[_0x0baf('0x2e')]['filter']+'%'};return _0x299f93;}})});}_0xcaf13d=_[_0x0baf('0x3c')]({},_0xcaf13d,_0x1590b4[_0x0baf('0x44')]);var _0x540c41={'where':_0xcaf13d[_0x0baf('0x3d')]};return db[_0x0baf('0x2b')][_0x0baf('0x45')](_0x540c41)[_0x0baf('0x23')](function(_0x504031){_0x55c715[_0x0baf('0x45')]=_0x504031;if(_0x1590b4[_0x0baf('0x2e')][_0x0baf('0x46')]){_0xcaf13d[_0x0baf('0x47')]=[{'all':!![]}];}return db[_0x0baf('0x2b')][_0x0baf('0x48')](_0xcaf13d);})[_0x0baf('0x23')](function(_0x1fa237){_0x55c715[_0x0baf('0x49')]=_0x1fa237;return _0x55c715;})[_0x0baf('0x23')](respondWithFilteredResult(_0x393a5a,_0xcaf13d))['catch'](handleError(_0x393a5a,null));};exports[_0x0baf('0x4a')]=function(_0x2bc755,_0x1daf1d){var _0x339aff={'raw':!![],'where':{'id':_0x2bc755['params']['id']}},_0x22207a={};_0x22207a[_0x0baf('0x2c')]=_[_0x0baf('0x2d')](db[_0x0baf('0x2b')][_0x0baf('0x4b')]);_0x22207a[_0x0baf('0x2e')]=_['keys'](_0x2bc755[_0x0baf('0x2e')]);_0x22207a[_0x0baf('0x31')]=_[_0x0baf('0x32')](_0x22207a[_0x0baf('0x2c')],_0x22207a[_0x0baf('0x2e')]);_0x339aff[_0x0baf('0x33')]=_[_0x0baf('0x32')](_0x22207a['model'],qs[_0x0baf('0x34')](_0x2bc755[_0x0baf('0x2e')][_0x0baf('0x34')]));_0x339aff['attributes']=_0x339aff[_0x0baf('0x33')][_0x0baf('0x35')]?_0x339aff[_0x0baf('0x33')]:_0x22207a[_0x0baf('0x2c')];if(_0x2bc755[_0x0baf('0x2e')][_0x0baf('0x46')]){_0x339aff[_0x0baf('0x47')]=[{'all':!![]}];}_0x339aff=_['merge']({},_0x339aff,_0x2bc755[_0x0baf('0x44')]);return db[_0x0baf('0x2b')][_0x0baf('0x4c')](_0x339aff)[_0x0baf('0x23')](handleEntityNotFound(_0x1daf1d,null))[_0x0baf('0x23')](respondWithResult(_0x1daf1d,null))[_0x0baf('0x4d')](handleError(_0x1daf1d,null));};exports[_0x0baf('0x4e')]=function(_0x1af4aa,_0x2be7fe){return db[_0x0baf('0x2b')][_0x0baf('0x4e')](_0x1af4aa['body'],{})['then'](function(_0x354329){var _0x3d6b19=_0x1af4aa[_0x0baf('0x4f')][_0x0baf('0x50')]({'plain':!![]});if(!_0x3d6b19)throw new Error(_0x0baf('0x51'));if(_0x3d6b19[_0x0baf('0x52')]===_0x0baf('0x4f')){var _0x4b492c=_0x354329[_0x0baf('0x50')]({'plain':!![]});var _0x2ef4c1=_0x0baf('0x53');return db[_0x0baf('0x54')][_0x0baf('0x4c')]({'where':{'name':_0x2ef4c1,'userProfileId':_0x3d6b19[_0x0baf('0x55')]},'raw':!![]})['then'](function(_0x3eebe5){if(_0x3eebe5&&_0x3eebe5['autoAssociation']===0x0){return db[_0x0baf('0x25')]['create']({'name':_0x4b492c[_0x0baf('0x29')],'resourceId':_0x4b492c['id'],'type':_0x3eebe5['name'],'sectionId':_0x3eebe5['id']},{})[_0x0baf('0x23')](function(){return _0x354329;});}else{return _0x354329;}})['catch'](function(_0x1b66fa){logger[_0x0baf('0x27')](_0x0baf('0x56'),_0x1b66fa);throw _0x1b66fa;});}return _0x354329;})[_0x0baf('0x23')](respondWithResult(_0x2be7fe,0xc9))[_0x0baf('0x4d')](handleError(_0x2be7fe,null));};exports['update']=function(_0x21f179,_0x36b7d2){if(_0x21f179[_0x0baf('0x57')]['id']){delete _0x21f179[_0x0baf('0x57')]['id'];}return db[_0x0baf('0x2b')][_0x0baf('0x4c')]({'where':{'id':_0x21f179['params']['id']}})[_0x0baf('0x23')](handleEntityNotFound(_0x36b7d2,null))[_0x0baf('0x23')](saveUpdates(_0x21f179[_0x0baf('0x57')],null))[_0x0baf('0x23')](respondWithResult(_0x36b7d2,null))[_0x0baf('0x4d')](handleError(_0x36b7d2,null));};exports[_0x0baf('0x24')]=function(_0x3834a2,_0x565292){return db['Variable'][_0x0baf('0x4c')]({'where':{'id':_0x3834a2[_0x0baf('0x58')]['id']}})[_0x0baf('0x23')](handleEntityNotFound(_0x565292,null))[_0x0baf('0x23')](removeEntity(_0x565292,null))[_0x0baf('0x4d')](handleError(_0x565292,null));};
\ No newline at end of file
+var _0xd8b0=['find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','Variables','UserProfileResource','error','stack','name','send','index','rawAttributes','keys','query','dateStart','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','dateEnd','add','day','merge','where','filter','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','Variable'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var qs=require(_0x0d8b('0xf'));var logger=require(_0x0d8b('0x10'))(_0x0d8b('0x11'));var utils=require(_0x0d8b('0x12'));var config=require('../../config/environment');var db=require(_0x0d8b('0x13'))['db'];function respondWithStatusCode(_0x4e0269,_0x4225c4){_0x4225c4=_0x4225c4||0xcc;return function(_0xc574a3){if(_0xc574a3){return _0x4e0269[_0x0d8b('0x14')](_0x4225c4);}return _0x4e0269[_0x0d8b('0x15')](_0x4225c4)[_0x0d8b('0x16')]();};}function respondWithResult(_0x32bb1a,_0x15dd0f){_0x15dd0f=_0x15dd0f||0xc8;return function(_0x31a8cc){if(_0x31a8cc){return _0x32bb1a[_0x0d8b('0x15')](_0x15dd0f)[_0x0d8b('0x17')](_0x31a8cc);}};}function respondWithFilteredResult(_0x5ad086,_0xe65334){return function(_0x1567ce){if(_0x1567ce){var _0x2d4e1c=_0x1567ce[_0x0d8b('0x18')],_0x4f6f21=_0xe65334[_0x0d8b('0x19')],_0x23eb7b=_0xe65334[_0x0d8b('0x19')]+_0xe65334['limit'],_0xa86349;if(_0x23eb7b>=_0x2d4e1c){_0x23eb7b=_0x2d4e1c;_0xa86349=0xc8;}else{_0xa86349=0xce;}_0x5ad086[_0x0d8b('0x15')](_0xa86349);return _0x5ad086[_0x0d8b('0x1a')](_0x0d8b('0x1b'),_0x4f6f21+'-'+_0x23eb7b+'/'+_0x2d4e1c)[_0x0d8b('0x17')](_0x1567ce);}return null;};}function patchUpdates(_0x333674){return function(_0x18dd2d){try{jsonpatch[_0x0d8b('0x1c')](_0x18dd2d,_0x333674,!![]);}catch(_0xa3612a){return BPromise['reject'](_0xa3612a);}return _0x18dd2d[_0x0d8b('0x1d')]();};}function saveUpdates(_0x23d58f,_0x196c0a){return function(_0x143372){if(_0x143372){return _0x143372[_0x0d8b('0x1e')](_0x23d58f)[_0x0d8b('0x1f')](function(_0x393beb){return _0x393beb;});}return null;};}function removeEntity(_0x352c17,_0x50ec1e){return function(_0x4f0a1a){if(_0x4f0a1a){return _0x4f0a1a[_0x0d8b('0x20')]()['then'](function(){var _0x56c729=_0x4f0a1a['get']({'plain':!![]});var _0x238728=_0x0d8b('0x21');return db[_0x0d8b('0x22')][_0x0d8b('0x20')]({'where':{'type':_0x238728,'resourceId':_0x56c729['id']}})[_0x0d8b('0x1f')](function(){return _0x4f0a1a;});})[_0x0d8b('0x1f')](function(){_0x352c17[_0x0d8b('0x15')](0xcc)[_0x0d8b('0x16')]();});}};}function handleEntityNotFound(_0x27b695,_0x5e5bc3){return function(_0xe8bbee){if(!_0xe8bbee){_0x27b695[_0x0d8b('0x14')](0x194);}return _0xe8bbee;};}function handleError(_0x5363e3,_0xe1ef20){_0xe1ef20=_0xe1ef20||0x1f4;return function(_0x4a0ae4){logger[_0x0d8b('0x23')](_0x4a0ae4[_0x0d8b('0x24')]);if(_0x4a0ae4[_0x0d8b('0x25')]){delete _0x4a0ae4['name'];}_0x5363e3['status'](_0xe1ef20)[_0x0d8b('0x26')](_0x4a0ae4);};}exports[_0x0d8b('0x27')]=function(_0x4c05ee,_0xcbc4ac){var _0x59aa83={},_0x1b2b59={},_0x4b59e5={'count':0x0,'rows':[]};var _0x97050a=db['Variable'][_0x0d8b('0x28')];_0x1b2b59['model']=_[_0x0d8b('0x29')](_0x97050a);var _0x544735={'dateStart':_0x4c05ee[_0x0d8b('0x2a')][_0x0d8b('0x2b')],'dateEnd':_0x4c05ee[_0x0d8b('0x2a')]['dateEnd']};delete _0x4c05ee['query']['dateStart'];delete _0x4c05ee[_0x0d8b('0x2a')]['dateEnd'];_0x1b2b59[_0x0d8b('0x2a')]=_['keys'](_0x4c05ee['query']);_0x1b2b59[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0x1b2b59[_0x0d8b('0x2e')],_0x1b2b59[_0x0d8b('0x2a')]);_0x59aa83[_0x0d8b('0x2f')]=_[_0x0d8b('0x2d')](_0x1b2b59[_0x0d8b('0x2e')],qs[_0x0d8b('0x30')](_0x4c05ee['query'][_0x0d8b('0x30')]));_0x59aa83[_0x0d8b('0x2f')]=_0x59aa83['attributes'][_0x0d8b('0x31')]?_0x59aa83[_0x0d8b('0x2f')]:_0x1b2b59[_0x0d8b('0x2e')];if(!_0x4c05ee['query'][_0x0d8b('0x32')](_0x0d8b('0x33'))){_0x59aa83[_0x0d8b('0x34')]=qs[_0x0d8b('0x34')](_0x4c05ee[_0x0d8b('0x2a')]['limit']);_0x59aa83[_0x0d8b('0x19')]=qs[_0x0d8b('0x19')](_0x4c05ee['query'][_0x0d8b('0x19')]);}_0x59aa83[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x4c05ee[_0x0d8b('0x2a')][_0x0d8b('0x36')]);_0x59aa83['where']=qs['filters'](_[_0x0d8b('0x37')](_0x4c05ee['query'],_0x1b2b59['filters']));if(_0x544735[_0x0d8b('0x2b')]){if(_0x544735[_0x0d8b('0x38')]){_0x544735[_0x0d8b('0x38')]=moment(_0x544735[_0x0d8b('0x38')])[_0x0d8b('0x39')](0x1,_0x0d8b('0x3a'));}else{_0x544735['dateEnd']=moment(_0x544735[_0x0d8b('0x2b')])[_0x0d8b('0x39')](0x1,_0x0d8b('0x3a'));}_[_0x0d8b('0x3b')](_0x59aa83[_0x0d8b('0x3c')],{'createdAt':{'$gte':_0x544735[_0x0d8b('0x2b')],'$lte':_0x544735[_0x0d8b('0x38')]}});}if(_0x4c05ee['query'][_0x0d8b('0x3d')]){_0x59aa83[_0x0d8b('0x3c')]=_[_0x0d8b('0x3b')](_0x59aa83[_0x0d8b('0x3c')],{'$or':_['map'](_0x97050a,function(_0xe0bf42){if(_0xe0bf42['type'][_0x0d8b('0x3e')]!==_0x0d8b('0x3f')){var _0x32d7d7={};_0x32d7d7[_0xe0bf42[_0x0d8b('0x40')]]={'$like':'%'+_0x4c05ee[_0x0d8b('0x2a')][_0x0d8b('0x3d')]+'%'};return _0x32d7d7;}})});}_0x59aa83=_[_0x0d8b('0x3b')]({},_0x59aa83,_0x4c05ee[_0x0d8b('0x41')]);var _0x89ab0d={'where':_0x59aa83[_0x0d8b('0x3c')]};return db['Variable']['count'](_0x89ab0d)['then'](function(_0x4d0811){_0x4b59e5['count']=_0x4d0811;if(_0x4c05ee[_0x0d8b('0x2a')][_0x0d8b('0x42')]){_0x59aa83[_0x0d8b('0x43')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x59aa83);})[_0x0d8b('0x1f')](function(_0x192de1){_0x4b59e5[_0x0d8b('0x44')]=_0x192de1;return _0x4b59e5;})['then'](respondWithFilteredResult(_0xcbc4ac,_0x59aa83))[_0x0d8b('0x45')](handleError(_0xcbc4ac,null));};exports[_0x0d8b('0x46')]=function(_0x5059ad,_0x4d7bb0){var _0x372740={'raw':!![],'where':{'id':_0x5059ad[_0x0d8b('0x47')]['id']}},_0x495870={};_0x495870['model']=_['keys'](db[_0x0d8b('0x48')][_0x0d8b('0x28')]);_0x495870['query']=_['keys'](_0x5059ad['query']);_0x495870['filters']=_[_0x0d8b('0x2d')](_0x495870[_0x0d8b('0x2e')],_0x495870[_0x0d8b('0x2a')]);_0x372740['attributes']=_[_0x0d8b('0x2d')](_0x495870[_0x0d8b('0x2e')],qs[_0x0d8b('0x30')](_0x5059ad[_0x0d8b('0x2a')][_0x0d8b('0x30')]));_0x372740[_0x0d8b('0x2f')]=_0x372740[_0x0d8b('0x2f')][_0x0d8b('0x31')]?_0x372740[_0x0d8b('0x2f')]:_0x495870[_0x0d8b('0x2e')];if(_0x5059ad[_0x0d8b('0x2a')][_0x0d8b('0x42')]){_0x372740[_0x0d8b('0x43')]=[{'all':!![]}];}_0x372740=_[_0x0d8b('0x3b')]({},_0x372740,_0x5059ad[_0x0d8b('0x41')]);return db[_0x0d8b('0x48')][_0x0d8b('0x49')](_0x372740)[_0x0d8b('0x1f')](handleEntityNotFound(_0x4d7bb0,null))[_0x0d8b('0x1f')](respondWithResult(_0x4d7bb0,null))['catch'](handleError(_0x4d7bb0,null));};exports[_0x0d8b('0x4a')]=function(_0x4d8850,_0x5d29ab){return db[_0x0d8b('0x48')][_0x0d8b('0x4a')](_0x4d8850[_0x0d8b('0x4b')],{})[_0x0d8b('0x1f')](function(_0x505d22){var _0x131579=_0x4d8850[_0x0d8b('0x4c')][_0x0d8b('0x4d')]({'plain':!![]});if(!_0x131579)throw new Error(_0x0d8b('0x4e'));if(_0x131579[_0x0d8b('0x4f')]==='user'){var _0x5c0824=_0x505d22['get']({'plain':!![]});var _0x573f4f=_0x0d8b('0x21');return db[_0x0d8b('0x50')]['find']({'where':{'name':_0x573f4f,'userProfileId':_0x131579['userProfileId']},'raw':!![]})[_0x0d8b('0x1f')](function(_0x3d3cb6){if(_0x3d3cb6&&_0x3d3cb6['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d8b('0x4a')]({'name':_0x5c0824[_0x0d8b('0x25')],'resourceId':_0x5c0824['id'],'type':_0x3d3cb6[_0x0d8b('0x25')],'sectionId':_0x3d3cb6['id']},{})[_0x0d8b('0x1f')](function(){return _0x505d22;});}else{return _0x505d22;}})[_0x0d8b('0x45')](function(_0x506a79){logger[_0x0d8b('0x23')](_0x0d8b('0x51'),_0x506a79);throw _0x506a79;});}return _0x505d22;})['then'](respondWithResult(_0x5d29ab,0xc9))['catch'](handleError(_0x5d29ab,null));};exports[_0x0d8b('0x1e')]=function(_0x3f2d95,_0x546fef){if(_0x3f2d95['body']['id']){delete _0x3f2d95[_0x0d8b('0x4b')]['id'];}return db[_0x0d8b('0x48')][_0x0d8b('0x49')]({'where':{'id':_0x3f2d95[_0x0d8b('0x47')]['id']}})['then'](handleEntityNotFound(_0x546fef,null))[_0x0d8b('0x1f')](saveUpdates(_0x3f2d95['body'],null))['then'](respondWithResult(_0x546fef,null))[_0x0d8b('0x45')](handleError(_0x546fef,null));};exports[_0x0d8b('0x20')]=function(_0x54aa03,_0x4a8f33){return db[_0x0d8b('0x48')][_0x0d8b('0x49')]({'where':{'id':_0x54aa03[_0x0d8b('0x47')]['id']}})[_0x0d8b('0x1f')](handleEntityNotFound(_0x4a8f33,null))[_0x0d8b('0x1f')](removeEntity(_0x4a8f33,null))[_0x0d8b('0x45')](handleError(_0x4a8f33,null));};
\ No newline at end of file
index 73ecc41..e6f8abf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['api','moment','bluebird','./variable.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x240a76,_0x9b4ac8){var _0xf8d53b=function(_0x253204){while(--_0x253204){_0x240a76['push'](_0x240a76['shift']());}};_0xf8d53b(++_0x9b4ac8);}(_0x2ef3,0xba));var _0x32ef=function(_0x30c746,_0x34aab6){_0x30c746=_0x30c746-0x0;var _0x4c458b=_0x2ef3[_0x30c746];return _0x4c458b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var attributes=require(_0x32ef('0x6'));module[_0x32ef('0x7')]=function(_0x524ab6,_0x402857){return _0x524ab6[_0x32ef('0x8')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabce=['./variable.attributes','exports','Variable','lodash','util','../../config/logger','api','moment'];(function(_0x2ffdc7,_0x900af){var _0x262149=function(_0x2ba118){while(--_0x2ba118){_0x2ffdc7['push'](_0x2ffdc7['shift']());}};_0x262149(++_0x900af);}(_0xabce,0x103));var _0xeabc=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xabce[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xeabc('0x5'));module[_0xeabc('0x6')]=function(_0x1a88a7,_0x5e9e2d){return _0x1a88a7['define'](_0xeabc('0x7'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3746ef5..1940dae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2711=['then','Variable,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x2711,0x6b));var _0x1271=function(_0x5e84a5,_0x33b638){_0x5e84a5=_0x5e84a5-0x0;var _0xb3a0e5=_0x2711[_0x5e84a5];return _0xb3a0e5;};'use strict';var _=require(_0x1271('0x0'));var util=require(_0x1271('0x1'));var moment=require(_0x1271('0x2'));var BPromise=require('bluebird');var rs=require(_0x1271('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1271('0x4'));var logger=require(_0x1271('0x5'))(_0x1271('0x6'));var config=require(_0x1271('0x7'));var jayson=require(_0x1271('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59902b,_0xd58acb,_0x53109d){return new BPromise(function(_0x149d78,_0x210251){return client['request'](_0x59902b,_0x53109d)[_0x1271('0x9')](function(_0x2f7dd2){logger['info'](_0x1271('0xa'),_0xd58acb,_0x1271('0xb'));logger[_0x1271('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0xd58acb,_0x1271('0xb'),JSON[_0x1271('0xd')](_0x2f7dd2));if(_0x2f7dd2[_0x1271('0xe')]){if(_0x2f7dd2['error'][_0x1271('0xf')]===0x1f4){logger[_0x1271('0xe')](_0x1271('0xa'),_0xd58acb,_0x2f7dd2[_0x1271('0xe')][_0x1271('0x10')]);return _0x210251(_0x2f7dd2['error'][_0x1271('0x10')]);}logger['error'](_0x1271('0xa'),_0xd58acb,_0x2f7dd2[_0x1271('0xe')][_0x1271('0x10')]);return _0x149d78(_0x2f7dd2[_0x1271('0xe')][_0x1271('0x10')]);}else{logger[_0x1271('0x11')]('Variable,\x20%s,\x20%s',_0xd58acb,_0x1271('0xb'));_0x149d78(_0x2f7dd2['result'][_0x1271('0x10')]);}})[_0x1271('0x12')](function(_0x4f7a53){logger[_0x1271('0xe')](_0x1271('0xa'),_0xd58acb,_0x4f7a53);_0x210251(_0x4f7a53);});});}exports[_0x1271('0x13')]=function(_0x5f4951){var _0x26e3d3=this;return new Promise(function(_0x21b4ca,_0x40a6e5){return db[_0x1271('0x14')][_0x1271('0x15')]({'raw':_0x5f4951['options']?_0x5f4951[_0x1271('0x16')][_0x1271('0x17')]===undefined?!![]:![]:!![],'where':_0x5f4951[_0x1271('0x16')]?_0x5f4951[_0x1271('0x16')][_0x1271('0x18')]||null:null,'attributes':_0x5f4951[_0x1271('0x16')]?_0x5f4951['options'][_0x1271('0x19')]||null:null,'include':_0x5f4951[_0x1271('0x16')]?_0x5f4951[_0x1271('0x16')][_0x1271('0x1a')]?_[_0x1271('0x1b')](_0x5f4951[_0x1271('0x16')][_0x1271('0x1a')],function(_0x3c9af8){return{'model':db[_0x3c9af8[_0x1271('0x1c')]],'as':_0x3c9af8['as'],'attributes':_0x3c9af8[_0x1271('0x19')],'include':_0x3c9af8[_0x1271('0x1a')]?_[_0x1271('0x1b')](_0x3c9af8['include'],function(_0x4deb57){return{'model':db[_0x4deb57[_0x1271('0x1c')]],'as':_0x4deb57['as'],'attributes':_0x4deb57[_0x1271('0x19')],'include':_0x4deb57[_0x1271('0x1a')]?_[_0x1271('0x1b')](_0x4deb57['include'],function(_0x275bca){return{'model':db[_0x275bca['model']],'as':_0x275bca['as'],'attributes':_0x275bca[_0x1271('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1271('0x9')](function(_0x4495b1){logger[_0x1271('0x11')]('ShowVariable',_0x5f4951);logger[_0x1271('0xc')](_0x1271('0x13'),_0x5f4951,JSON[_0x1271('0xd')](_0x4495b1));_0x21b4ca(_0x4495b1);})[_0x1271('0x12')](function(_0x17daec){logger['error'](_0x1271('0x13'),_0x17daec['message'],_0x5f4951);_0x40a6e5(_0x26e3d3[_0x1271('0xe')](0x1f4,_0x17daec[_0x1271('0x10')]));});});};
\ No newline at end of file
+var _0x4461=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','include','model','map','lodash','util','moment'];(function(_0x369610,_0x2d0639){var _0x57bf5f=function(_0x5a15b9){while(--_0x5a15b9){_0x369610['push'](_0x369610['shift']());}};_0x57bf5f(++_0x2d0639);}(_0x4461,0x19d));var _0x1446=function(_0x565270,_0x15bb29){_0x565270=_0x565270-0x0;var _0x597b30=_0x4461[_0x565270];return _0x597b30;};'use strict';var _=require(_0x1446('0x0'));var util=require(_0x1446('0x1'));var moment=require(_0x1446('0x2'));var BPromise=require(_0x1446('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1446('0x4'));var db=require(_0x1446('0x5'))['db'];var utils=require(_0x1446('0x6'));var logger=require('../../config/logger')(_0x1446('0x7'));var config=require('../../config/environment');var jayson=require(_0x1446('0x8'));var client=jayson['client'][_0x1446('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x409c03,_0x135858,_0x5e2aa1){return new BPromise(function(_0x11e66d,_0x350481){return client['request'](_0x409c03,_0x5e2aa1)[_0x1446('0xa')](function(_0x30bfe9){logger[_0x1446('0xb')](_0x1446('0xc'),_0x135858,_0x1446('0xd'));logger[_0x1446('0xe')](_0x1446('0xf'),_0x135858,_0x1446('0xd'),JSON[_0x1446('0x10')](_0x30bfe9));if(_0x30bfe9[_0x1446('0x11')]){if(_0x30bfe9[_0x1446('0x11')][_0x1446('0x12')]===0x1f4){logger[_0x1446('0x11')](_0x1446('0xc'),_0x135858,_0x30bfe9[_0x1446('0x11')]['message']);return _0x350481(_0x30bfe9[_0x1446('0x11')][_0x1446('0x13')]);}logger[_0x1446('0x11')](_0x1446('0xc'),_0x135858,_0x30bfe9[_0x1446('0x11')][_0x1446('0x13')]);return _0x11e66d(_0x30bfe9[_0x1446('0x11')][_0x1446('0x13')]);}else{logger[_0x1446('0xb')]('Variable,\x20%s,\x20%s',_0x135858,_0x1446('0xd'));_0x11e66d(_0x30bfe9[_0x1446('0x14')][_0x1446('0x13')]);}})[_0x1446('0x15')](function(_0x51ab74){logger[_0x1446('0x11')](_0x1446('0xc'),_0x135858,_0x51ab74);_0x350481(_0x51ab74);});});}exports[_0x1446('0x16')]=function(_0x5852f6){var _0x19998c=this;return new Promise(function(_0x4c94ae,_0x15edc5){return db[_0x1446('0x17')][_0x1446('0x18')]({'raw':_0x5852f6['options']?_0x5852f6[_0x1446('0x19')][_0x1446('0x1a')]===undefined?!![]:![]:!![],'where':_0x5852f6[_0x1446('0x19')]?_0x5852f6[_0x1446('0x19')][_0x1446('0x1b')]||null:null,'attributes':_0x5852f6[_0x1446('0x19')]?_0x5852f6[_0x1446('0x19')][_0x1446('0x1c')]||null:null,'include':_0x5852f6[_0x1446('0x19')]?_0x5852f6[_0x1446('0x19')][_0x1446('0x1d')]?_['map'](_0x5852f6[_0x1446('0x19')][_0x1446('0x1d')],function(_0x3d33db){return{'model':db[_0x3d33db[_0x1446('0x1e')]],'as':_0x3d33db['as'],'attributes':_0x3d33db[_0x1446('0x1c')],'include':_0x3d33db[_0x1446('0x1d')]?_[_0x1446('0x1f')](_0x3d33db[_0x1446('0x1d')],function(_0x46788e){return{'model':db[_0x46788e[_0x1446('0x1e')]],'as':_0x46788e['as'],'attributes':_0x46788e[_0x1446('0x1c')],'include':_0x46788e[_0x1446('0x1d')]?_[_0x1446('0x1f')](_0x46788e[_0x1446('0x1d')],function(_0x133294){return{'model':db[_0x133294['model']],'as':_0x133294['as'],'attributes':_0x133294[_0x1446('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1446('0xa')](function(_0x386fc7){logger[_0x1446('0xb')]('ShowVariable',_0x5852f6);logger[_0x1446('0xe')](_0x1446('0x16'),_0x5852f6,JSON[_0x1446('0x10')](_0x386fc7));_0x4c94ae(_0x386fc7);})[_0x1446('0x15')](function(_0x444196){logger[_0x1446('0x11')]('ShowVariable',_0x444196[_0x1446('0x13')],_0x5852f6);_0x15edc5(_0x19998c[_0x1446('0x11')](0x1f4,_0x444196['message']));});});};
\ No newline at end of file
index f564f73..b725c7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7852=['canUpdate','fetch','isAuthenticated','reset','/pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch'];(function(_0x930ce2,_0x476469){var _0x359175=function(_0x36bbc4){while(--_0x36bbc4){_0x930ce2['push'](_0x930ce2['shift']());}};_0x359175(++_0x476469);}(_0x7852,0xfa));var _0x2785=function(_0x36397d,_0x1f3130){_0x36397d=_0x36397d-0x0;var _0x5558ee=_0x7852[_0x36397d];return _0x5558ee;};'use strict';var express=require('express');var router=express[_0x2785('0x0')]();var auth=require(_0x2785('0x1'));var controller=require(_0x2785('0x2'));router[_0x2785('0x3')]('/',controller[_0x2785('0x4')]);router[_0x2785('0x3')](_0x2785('0x5'),auth['isAuthenticated'](),auth[_0x2785('0x6')](),controller[_0x2785('0x7')]);router['get']('/reset',auth[_0x2785('0x8')](),auth[_0x2785('0x6')](),controller[_0x2785('0x9')]);router['get'](_0x2785('0xa'),auth[_0x2785('0x8')](),auth[_0x2785('0x6')](),controller['pull']);router[_0x2785('0x3')](_0x2785('0xb'),auth[_0x2785('0x8')](),controller[_0x2785('0xc')]);router[_0x2785('0x3')](_0x2785('0xd'),controller[_0x2785('0xe')]);module[_0x2785('0xf')]=router;
\ No newline at end of file
+var _0xd880=['/pull','pull','/restart','restart','/migrations','migrations','./version.controller','get','/fetch','isAuthenticated','canUpdate','/reset','reset'];(function(_0x644504,_0x36b35){var _0xa6068a=function(_0x1c7154){while(--_0x1c7154){_0x644504['push'](_0x644504['shift']());}};_0xa6068a(++_0x36b35);}(_0xd880,0x1cd));var _0x0d88=function(_0x14e468,_0x35ab64){_0x14e468=_0x14e468-0x0;var _0x2dbe81=_0xd880[_0x14e468];return _0x2dbe81;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x0d88('0x0'));router[_0x0d88('0x1')]('/',controller['index']);router[_0x0d88('0x1')](_0x0d88('0x2'),auth[_0x0d88('0x3')](),auth[_0x0d88('0x4')](),controller['fetch']);router['get'](_0x0d88('0x5'),auth['isAuthenticated'](),auth[_0x0d88('0x4')](),controller[_0x0d88('0x6')]);router[_0x0d88('0x1')](_0x0d88('0x7'),auth[_0x0d88('0x3')](),auth[_0x0d88('0x4')](),controller[_0x0d88('0x8')]);router[_0x0d88('0x1')](_0x0d88('0x9'),auth['isAuthenticated'](),controller[_0x0d88('0xa')]);router['get'](_0x0d88('0xb'),controller[_0x0d88('0xc')]);module['exports']=router;
\ No newline at end of file
index 34dd51e..1190801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20Migration\x20Completed!','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x3c1282,_0x189948){var _0x426489=function(_0x1c04ce){while(--_0x1c04ce){_0x3c1282['push'](_0x3c1282['shift']());}};_0x426489(++_0x189948);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Umzug=require(_0x7995('0x0'));var path=require(_0x7995('0x1'));var pkginfo=require(_0x7995('0x2'))(module,_0x7995('0x3'));var exec=require('child_process')[_0x7995('0x4')];var db=require(_0x7995('0x5'))['db'];var config=require(_0x7995('0x6'));var pm2=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var git=require(_0x7995('0x9'))(config[_0x7995('0xa')]);exports[_0x7995('0xb')]=function(_0xbda126,_0x326741){var _0x4996ca={'current':module[_0x7995('0xc')][_0x7995('0x3')],'phonebar':0x2};if(_0xbda126['query']&&_0xbda126[_0x7995('0xd')][_0x7995('0xe')]){return git[_0x7995('0xf')]()[_0x7995('0x10')](function(_0x3c1d19,_0x1e400a){_0x4996ca[_0x7995('0xe')]=(_0x3c1d19?module['exports'][_0x7995('0x3')]:_0x1e400a[_0x7995('0xe')])||'2.0.0';return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);});}else{return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);}};exports[_0x7995('0xf')]=function(_0x23999f,_0x2bbe7a){return git['fetch'](['origin',_0x7995('0x13')],function(_0x2233dd){if(_0x2233dd){logger[_0x7995('0x14')](_0x2233dd);return _0x2bbe7a[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x2233dd);}logger[_0x7995('0x15')](_0x7995('0x16'));return _0x2bbe7a[_0x7995('0x11')](0xc8)['json']({'output':_0x7995('0x17')});});};exports['reset']=function(_0x2f832e,_0x37f297){return git[_0x7995('0x18')]([_0x7995('0x19'),_0x7995('0x1a')],function(_0x37a7d4){if(_0x37a7d4){logger['error'](_0x37a7d4);return _0x37f297['status'](0x1f4)[_0x7995('0x12')](_0x37a7d4);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x37f297[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x7995('0x1b')]=function(_0x51f276,_0x4b1a8e){exec(_0x7995('0x1c'),function(_0x327b1f,_0x350fd9,_0x1a8568){logger[_0x7995('0x15')](_0x350fd9);logger[_0x7995('0x15')](_0x1a8568);if(_0x327b1f){logger['error'](_0x327b1f);return _0x4b1a8e[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x350fd9});});};exports[_0x7995('0x1d')]=function(_0x13bc35,_0x475351){return pm2[_0x7995('0x1d')]('motion2')[_0x7995('0x1e')](function(_0x34e70c){logger[_0x7995('0x15')](_0x7995('0x1f'),_0x34e70c);return _0x475351[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7995('0x20')](function(_0x5911c3){logger[_0x7995('0x14')](_0x5911c3);return _0x475351[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x5911c3);});};exports[_0x7995('0x21')]=function(_0x11c1eb,_0x4b6f99){var _0x9b2a15=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7995('0x22')],'modelName':_0x7995('0x22'),'columnName':_0x7995('0x3')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x7995('0x23')],function(){throw new Error(_0x7995('0x24'));}],'path':path[_0x7995('0x25')](config[_0x7995('0xa')],_0x7995('0x26'),_0x7995('0x21')),'pattern':/\.js$/}});_0x9b2a15['up']({'from':module['exports']['version']+_0x7995('0x27')})['then'](function(){return _0x4b6f99[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x7995('0x28')});})[_0x7995('0x20')](function(_0x1f7d27){return _0x4b6f99['status'](0x1f4)[_0x7995('0x12')](_0x1f7d27);});};
\ No newline at end of file
+var _0x9957=['status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','.js','Database\x20Migration\x20Completed!','umzug','path','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags'];(function(_0x1098f3,_0x2d9803){var _0x37a3aa=function(_0x393789){while(--_0x393789){_0x1098f3['push'](_0x1098f3['shift']());}};_0x37a3aa(++_0x2d9803);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Umzug=require(_0x7995('0x0'));var path=require(_0x7995('0x1'));var pkginfo=require(_0x7995('0x2'))(module,_0x7995('0x3'));var exec=require('child_process')[_0x7995('0x4')];var db=require(_0x7995('0x5'))['db'];var config=require(_0x7995('0x6'));var pm2=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var git=require(_0x7995('0x9'))(config[_0x7995('0xa')]);exports[_0x7995('0xb')]=function(_0xbda126,_0x326741){var _0x4996ca={'current':module[_0x7995('0xc')][_0x7995('0x3')],'phonebar':0x2};if(_0xbda126['query']&&_0xbda126[_0x7995('0xd')][_0x7995('0xe')]){return git[_0x7995('0xf')]()[_0x7995('0x10')](function(_0x3c1d19,_0x1e400a){_0x4996ca[_0x7995('0xe')]=(_0x3c1d19?module['exports'][_0x7995('0x3')]:_0x1e400a[_0x7995('0xe')])||'2.0.0';return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);});}else{return _0x326741[_0x7995('0x11')](0xc8)[_0x7995('0x12')](_0x4996ca);}};exports[_0x7995('0xf')]=function(_0x23999f,_0x2bbe7a){return git['fetch'](['origin',_0x7995('0x13')],function(_0x2233dd){if(_0x2233dd){logger[_0x7995('0x14')](_0x2233dd);return _0x2bbe7a[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x2233dd);}logger[_0x7995('0x15')](_0x7995('0x16'));return _0x2bbe7a[_0x7995('0x11')](0xc8)['json']({'output':_0x7995('0x17')});});};exports['reset']=function(_0x2f832e,_0x37f297){return git[_0x7995('0x18')]([_0x7995('0x19'),_0x7995('0x1a')],function(_0x37a7d4){if(_0x37a7d4){logger['error'](_0x37a7d4);return _0x37f297['status'](0x1f4)[_0x7995('0x12')](_0x37a7d4);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x37f297[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0x7995('0x1b')]=function(_0x51f276,_0x4b1a8e){exec(_0x7995('0x1c'),function(_0x327b1f,_0x350fd9,_0x1a8568){logger[_0x7995('0x15')](_0x350fd9);logger[_0x7995('0x15')](_0x1a8568);if(_0x327b1f){logger['error'](_0x327b1f);return _0x4b1a8e[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x350fd9});});};exports[_0x7995('0x1d')]=function(_0x13bc35,_0x475351){return pm2[_0x7995('0x1d')]('motion2')[_0x7995('0x1e')](function(_0x34e70c){logger[_0x7995('0x15')](_0x7995('0x1f'),_0x34e70c);return _0x475351[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7995('0x20')](function(_0x5911c3){logger[_0x7995('0x14')](_0x5911c3);return _0x475351[_0x7995('0x11')](0x1f4)[_0x7995('0x12')](_0x5911c3);});};exports[_0x7995('0x21')]=function(_0x11c1eb,_0x4b6f99){var _0x9b2a15=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x7995('0x22')],'modelName':_0x7995('0x22'),'columnName':_0x7995('0x3')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x7995('0x23')],function(){throw new Error(_0x7995('0x24'));}],'path':path[_0x7995('0x25')](config[_0x7995('0xa')],_0x7995('0x26'),_0x7995('0x21')),'pattern':/\.js$/}});_0x9b2a15['up']({'from':module['exports']['version']+_0x7995('0x27')})['then'](function(){return _0x4b6f99[_0x7995('0x11')](0xc8)[_0x7995('0x12')]({'output':_0x7995('0x28')});})[_0x7995('0x20')](function(_0x1f7d27){return _0x4b6f99['status'](0x1f4)[_0x7995('0x12')](_0x1f7d27);});};
\ No newline at end of file
index 2491db4..e1fd405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x430c=['exports','multer','connect-timeout','express','Router','get','isAuthenticated','describe','/:id','show','post','create','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x430c,0x1a1));var _0xc430=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x430c[_0x220f3f];return _0x1f170e;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xc430('0x4')]('/',auth[_0xc430('0x5')](),controller['index']);router[_0xc430('0x4')]('/describe',auth[_0xc430('0x5')](),controller[_0xc430('0x6')]);router[_0xc430('0x4')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0x8')]);router[_0xc430('0x9')]('/',auth[_0xc430('0x5')](),controller[_0xc430('0xa')]);router['put'](_0xc430('0x7'),auth[_0xc430('0x5')](),controller['update']);router[_0xc430('0xb')]('/:id',auth[_0xc430('0x5')](),controller['destroy']);module[_0xc430('0xc')]=router;
\ No newline at end of file
+var _0x6a55=['delete','destroy','exports','multer','express','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update'];(function(_0x20409d,_0x34497b){var _0x47852a=function(_0x246d6e){while(--_0x246d6e){_0x20409d['push'](_0x20409d['shift']());}};_0x47852a(++_0x34497b);}(_0x6a55,0xdb));var _0x56a5=function(_0x170941,_0x38d105){_0x170941=_0x170941-0x0;var _0x50e48d=_0x6a55[_0x170941];return _0x50e48d;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x56a5('0x2'));var config=require('../../config/environment');var controller=require(_0x56a5('0x3'));router['get']('/',auth[_0x56a5('0x4')](),controller[_0x56a5('0x5')]);router[_0x56a5('0x6')](_0x56a5('0x7'),auth[_0x56a5('0x4')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x6')](_0x56a5('0x9'),auth['isAuthenticated'](),controller[_0x56a5('0xa')]);router[_0x56a5('0xb')]('/',auth[_0x56a5('0x4')](),controller[_0x56a5('0xc')]);router[_0x56a5('0xd')](_0x56a5('0x9'),auth[_0x56a5('0x4')](),controller[_0x56a5('0xe')]);router[_0x56a5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x56a5('0x10')]);module[_0x56a5('0x11')]=router;
\ No newline at end of file
index dcf9433..ccb0481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d2b=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x18129a,_0x5c4a20){var _0x5ae32b=function(_0x1f548b){while(--_0x1f548b){_0x18129a['push'](_0x18129a['shift']());}};_0x5ae32b(++_0x5c4a20);}(_0x0d2b,0x146));var _0xb0d2=function(_0x3e2b4e,_0x5cba62){_0x3e2b4e=_0x3e2b4e-0x0;var _0xa545e9=_0x0d2b[_0x3e2b4e];return _0xa545e9;};'use strict';var Sequelize=require(_0xb0d2('0x0'));module[_0xb0d2('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb0d2('0x2')]},'calleridnum':{'type':Sequelize[_0xb0d2('0x2')]},'calleridname':{'type':Sequelize[_0xb0d2('0x2')]},'queue':{'type':Sequelize[_0xb0d2('0x2')]},'interface':{'type':Sequelize[_0xb0d2('0x2')]},'membername':{'type':Sequelize[_0xb0d2('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xb0d2('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xb0d2('0x3')]},'holdtime':{'type':Sequelize[_0xb0d2('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb0d2('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb0d2('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xb0d2('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xb0d2('0x2')]},'lastevent':{'type':Sequelize[_0xb0d2('0x2')]},'channel':{'type':Sequelize[_0xb0d2('0x2')]},'channelstate':{'type':Sequelize[_0xb0d2('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb0d2('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb0d2('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb0d2('0x2')]},'exten':{'type':Sequelize[_0xb0d2('0x2')]},'priority':{'type':Sequelize[_0xb0d2('0x2')]},'destchannel':{'type':Sequelize[_0xb0d2('0x2')]},'destchannelstate':{'type':Sequelize[_0xb0d2('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb0d2('0x2')]},'destcalleridname':{'type':Sequelize[_0xb0d2('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb0d2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb0d2('0x2')]},'destlanguage':{'type':Sequelize[_0xb0d2('0x2')]},'destaccountcode':{'type':Sequelize[_0xb0d2('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xb0d2('0x2')]},'destpriority':{'type':Sequelize[_0xb0d2('0x2')]},'destuniqueid':{'type':Sequelize[_0xb0d2('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xb0d2('0x2')]}};
\ No newline at end of file
+var _0xc4fe=['DATE','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xc4fe,0x170));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xec4f('0x0'));module['exports']={'type':{'type':Sequelize[_0xec4f('0x1')]},'uniqueid':{'type':Sequelize[_0xec4f('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xec4f('0x1')]},'queue':{'type':Sequelize[_0xec4f('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xec4f('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xec4f('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xec4f('0x2')]},'agentdumpAt':{'type':Sequelize[_0xec4f('0x2')]},'holdtime':{'type':Sequelize[_0xec4f('0x3')]},'agentcomplete':{'type':Sequelize[_0xec4f('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xec4f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xec4f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xec4f('0x3')]},'agentacw':{'type':Sequelize[_0xec4f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xec4f('0x3')]},'reason':{'type':Sequelize[_0xec4f('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xec4f('0x1')]},'channelstate':{'type':Sequelize[_0xec4f('0x3')]},'channelstatedesc':{'type':Sequelize[_0xec4f('0x1')]},'connectedlinenum':{'type':Sequelize[_0xec4f('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xec4f('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xec4f('0x1')]},'destchannel':{'type':Sequelize[_0xec4f('0x1')]},'destchannelstate':{'type':Sequelize[_0xec4f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xec4f('0x1')]},'destcalleridnum':{'type':Sequelize[_0xec4f('0x1')]},'destcalleridname':{'type':Sequelize[_0xec4f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xec4f('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xec4f('0x1')]},'destaccountcode':{'type':Sequelize[_0xec4f('0x1')]},'destcontext':{'type':Sequelize[_0xec4f('0x1')]},'destexten':{'type':Sequelize[_0xec4f('0x1')]},'destpriority':{'type':Sequelize[_0xec4f('0x1')]},'destuniqueid':{'type':Sequelize[_0xec4f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xec4f('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xec4f('0x1')]}};
\ No newline at end of file
index 4579595..26dd9b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcb8=['papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','add','day','filter','merge','map','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','describe','html-pdf','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xdcb8,0xd6));var _0x8dcb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdcb8[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x8dcb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8dcb('0x1'));var zipdir=require(_0x8dcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8dcb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8dcb('0x4'));var util=require(_0x8dcb('0x5'));var path=require('path');var sox=require(_0x8dcb('0x6'));var csv=require(_0x8dcb('0x7'));var ejs=require(_0x8dcb('0x8'));var fs=require('fs');var _=require(_0x8dcb('0x9'));var squel=require(_0x8dcb('0xa'));var crypto=require(_0x8dcb('0xb'));var jsforce=require(_0x8dcb('0xc'));var deskjs=require(_0x8dcb('0xd'));var toCsv=require(_0x8dcb('0x7'));var querystring=require('querystring');var Papa=require(_0x8dcb('0xe'));var Redis=require(_0x8dcb('0xf'));var qs=require(_0x8dcb('0x10'));var logger=require('../../config/logger')(_0x8dcb('0x11'));var utils=require('../../config/utils');var config=require(_0x8dcb('0x12'));var db=require(_0x8dcb('0x13'))['db'];function respondWithStatusCode(_0x12d1c9,_0x6b0be2){_0x6b0be2=_0x6b0be2||0xcc;return function(_0xa46749){if(_0xa46749){return _0x12d1c9[_0x8dcb('0x14')](_0x6b0be2);}return _0x12d1c9[_0x8dcb('0x15')](_0x6b0be2)[_0x8dcb('0x16')]();};}function respondWithResult(_0x4b6ca3,_0x3f8ebb){_0x3f8ebb=_0x3f8ebb||0xc8;return function(_0x4f27b8){if(_0x4f27b8){return _0x4b6ca3[_0x8dcb('0x15')](_0x3f8ebb)['json'](_0x4f27b8);}};}function respondWithFilteredResult(_0x122b97,_0x1d77f6){return function(_0x39e52){if(_0x39e52){var _0x26706f=_0x39e52[_0x8dcb('0x17')],_0x29745f=_0x1d77f6[_0x8dcb('0x18')],_0x543aa1=_0x1d77f6[_0x8dcb('0x18')]+_0x1d77f6[_0x8dcb('0x19')],_0x5ef397;if(_0x543aa1>=_0x26706f){_0x543aa1=_0x26706f;_0x5ef397=0xc8;}else{_0x5ef397=0xce;}_0x122b97['status'](_0x5ef397);return _0x122b97[_0x8dcb('0x1a')](_0x8dcb('0x1b'),_0x29745f+'-'+_0x543aa1+'/'+_0x26706f)[_0x8dcb('0x1c')](_0x39e52);}return null;};}function patchUpdates(_0x4f7b27){return function(_0x1e457e){try{jsonpatch[_0x8dcb('0x1d')](_0x1e457e,_0x4f7b27,!![]);}catch(_0x2b7166){return BPromise[_0x8dcb('0x1e')](_0x2b7166);}return _0x1e457e[_0x8dcb('0x1f')]();};}function saveUpdates(_0x5758e9,_0x2df2d0){return function(_0x4e80c9){if(_0x4e80c9){return _0x4e80c9[_0x8dcb('0x20')](_0x5758e9)[_0x8dcb('0x21')](function(_0x150d17){return _0x150d17;});}return null;};}function removeEntity(_0x11117f,_0x581f8b){return function(_0x28382e){if(_0x28382e){return _0x28382e['destroy']()['then'](function(){_0x11117f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240415,_0x19d55f){return function(_0x32ad00){if(!_0x32ad00){_0x240415[_0x8dcb('0x14')](0x194);}return _0x32ad00;};}function handleError(_0x4d36c1,_0x14efcf){_0x14efcf=_0x14efcf||0x1f4;return function(_0x1bd79d){logger[_0x8dcb('0x22')](_0x1bd79d[_0x8dcb('0x23')]);if(_0x1bd79d[_0x8dcb('0x24')]){delete _0x1bd79d[_0x8dcb('0x24')];}_0x4d36c1[_0x8dcb('0x15')](_0x14efcf)[_0x8dcb('0x25')](_0x1bd79d);};}exports[_0x8dcb('0x26')]=function(_0x464769,_0xcf56ea){var _0xdfae12={},_0x5cb18c={},_0x536fed={'count':0x0,'rows':[]};var _0x324221=db[_0x8dcb('0x27')][_0x8dcb('0x28')];_0x5cb18c[_0x8dcb('0x29')]=_[_0x8dcb('0x2a')](_0x324221);var _0x492165={'dateStart':_0x464769[_0x8dcb('0x2b')][_0x8dcb('0x2c')],'dateEnd':_0x464769[_0x8dcb('0x2b')][_0x8dcb('0x2d')]};delete _0x464769[_0x8dcb('0x2b')][_0x8dcb('0x2c')];delete _0x464769[_0x8dcb('0x2b')][_0x8dcb('0x2d')];_0x5cb18c['query']=_[_0x8dcb('0x2a')](_0x464769['query']);_0x5cb18c[_0x8dcb('0x2e')]=_[_0x8dcb('0x2f')](_0x5cb18c[_0x8dcb('0x29')],_0x5cb18c[_0x8dcb('0x2b')]);_0xdfae12[_0x8dcb('0x30')]=_[_0x8dcb('0x2f')](_0x5cb18c[_0x8dcb('0x29')],qs[_0x8dcb('0x31')](_0x464769[_0x8dcb('0x2b')][_0x8dcb('0x31')]));_0xdfae12[_0x8dcb('0x30')]=_0xdfae12[_0x8dcb('0x30')][_0x8dcb('0x32')]?_0xdfae12[_0x8dcb('0x30')]:_0x5cb18c[_0x8dcb('0x29')];if(!_0x464769[_0x8dcb('0x2b')]['hasOwnProperty'](_0x8dcb('0x33'))){_0xdfae12[_0x8dcb('0x19')]=qs[_0x8dcb('0x19')](_0x464769[_0x8dcb('0x2b')][_0x8dcb('0x19')]);_0xdfae12[_0x8dcb('0x18')]=qs[_0x8dcb('0x18')](_0x464769[_0x8dcb('0x2b')][_0x8dcb('0x18')]);}_0xdfae12[_0x8dcb('0x34')]=qs[_0x8dcb('0x35')](_0x464769[_0x8dcb('0x2b')][_0x8dcb('0x35')]);_0xdfae12[_0x8dcb('0x36')]=qs[_0x8dcb('0x2e')](_[_0x8dcb('0x37')](_0x464769[_0x8dcb('0x2b')],_0x5cb18c['filters']));if(_0x492165[_0x8dcb('0x2c')]){if(_0x492165[_0x8dcb('0x2d')]){_0x492165[_0x8dcb('0x2d')]=moment(_0x492165[_0x8dcb('0x2d')])[_0x8dcb('0x38')](0x1,'day');}else{_0x492165[_0x8dcb('0x2d')]=moment(_0x492165['dateStart'])[_0x8dcb('0x38')](0x1,_0x8dcb('0x39'));}_['merge'](_0xdfae12[_0x8dcb('0x36')],{'createdAt':{'$gte':_0x492165[_0x8dcb('0x2c')],'$lte':_0x492165[_0x8dcb('0x2d')]}});}if(_0x464769[_0x8dcb('0x2b')][_0x8dcb('0x3a')]){_0xdfae12[_0x8dcb('0x36')]=_[_0x8dcb('0x3b')](_0xdfae12[_0x8dcb('0x36')],{'$or':_[_0x8dcb('0x3c')](_0x324221,function(_0x1f3b41){if(_0x1f3b41[_0x8dcb('0x3d')]['key']!==_0x8dcb('0x3e')){var _0x22b786={};_0x22b786[_0x1f3b41['field']]={'$like':'%'+_0x464769['query'][_0x8dcb('0x3a')]+'%'};return _0x22b786;}})});}_0xdfae12=_[_0x8dcb('0x3b')]({},_0xdfae12,_0x464769[_0x8dcb('0x3f')]);var _0x345861={'where':_0xdfae12[_0x8dcb('0x36')]};return db[_0x8dcb('0x27')][_0x8dcb('0x17')](_0x345861)[_0x8dcb('0x21')](function(_0x2c0dd4){_0x536fed['count']=_0x2c0dd4;if(_0x464769[_0x8dcb('0x2b')]['includeAll']){_0xdfae12[_0x8dcb('0x40')]=[{'all':!![]}];}return db[_0x8dcb('0x27')][_0x8dcb('0x41')](_0xdfae12);})['then'](function(_0x8172c1){_0x536fed[_0x8dcb('0x42')]=_0x8172c1;return _0x536fed;})['then'](respondWithFilteredResult(_0xcf56ea,_0xdfae12))[_0x8dcb('0x43')](handleError(_0xcf56ea,null));};exports[_0x8dcb('0x44')]=function(_0x5bcdc9,_0x1a1f59){var _0x3772fb={'raw':![],'where':{'id':_0x5bcdc9[_0x8dcb('0x45')]['id']}},_0x5848c9={};_0x5848c9[_0x8dcb('0x29')]=_['keys'](db[_0x8dcb('0x27')][_0x8dcb('0x28')]);_0x5848c9['query']=_[_0x8dcb('0x2a')](_0x5bcdc9[_0x8dcb('0x2b')]);_0x5848c9[_0x8dcb('0x2e')]=_[_0x8dcb('0x2f')](_0x5848c9[_0x8dcb('0x29')],_0x5848c9[_0x8dcb('0x2b')]);_0x3772fb[_0x8dcb('0x30')]=_[_0x8dcb('0x2f')](_0x5848c9[_0x8dcb('0x29')],qs[_0x8dcb('0x31')](_0x5bcdc9[_0x8dcb('0x2b')]['fields']));_0x3772fb[_0x8dcb('0x30')]=_0x3772fb['attributes'][_0x8dcb('0x32')]?_0x3772fb[_0x8dcb('0x30')]:_0x5848c9['model'];if(_0x5bcdc9[_0x8dcb('0x2b')][_0x8dcb('0x46')]){_0x3772fb['include']=[{'all':!![]}];}_0x3772fb=_[_0x8dcb('0x3b')]({},_0x3772fb,_0x5bcdc9[_0x8dcb('0x3f')]);return db[_0x8dcb('0x27')]['find'](_0x3772fb)['then'](handleEntityNotFound(_0x1a1f59,null))['then'](respondWithResult(_0x1a1f59,null))[_0x8dcb('0x43')](handleError(_0x1a1f59,null));};exports[_0x8dcb('0x47')]=function(_0x47b303,_0x3c5fcc){return db['VoiceAgentReport'][_0x8dcb('0x47')](_0x47b303['body'],{})[_0x8dcb('0x21')](respondWithResult(_0x3c5fcc,0xc9))['catch'](handleError(_0x3c5fcc,null));};exports[_0x8dcb('0x20')]=function(_0x13e476,_0x2be905){if(_0x13e476[_0x8dcb('0x48')]['id']){delete _0x13e476['body']['id'];}return db['VoiceAgentReport'][_0x8dcb('0x49')]({'where':{'id':_0x13e476['params']['id']}})[_0x8dcb('0x21')](handleEntityNotFound(_0x2be905,null))[_0x8dcb('0x21')](saveUpdates(_0x13e476['body'],null))[_0x8dcb('0x21')](respondWithResult(_0x2be905,null))[_0x8dcb('0x43')](handleError(_0x2be905,null));};exports[_0x8dcb('0x4a')]=function(_0x50ef41,_0x115078){return db[_0x8dcb('0x27')][_0x8dcb('0x49')]({'where':{'id':_0x50ef41[_0x8dcb('0x45')]['id']}})[_0x8dcb('0x21')](handleEntityNotFound(_0x115078,null))[_0x8dcb('0x21')](removeEntity(_0x115078,null))['catch'](handleError(_0x115078,null));};exports[_0x8dcb('0x4b')]=function(_0x4616c0,_0x4dced5){return db['VoiceAgentReport'][_0x8dcb('0x4b')]()[_0x8dcb('0x21')](respondWithResult(_0x4dced5,null))[_0x8dcb('0x43')](handleError(_0x4dced5,null));};
\ No newline at end of file
+var _0x1038=['add','day','merge','filter','map','key','VIRTUAL','field','options','VoiceAgentReport','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick'];(function(_0x4a2c1d,_0x10a33e){var _0x1cdc3a=function(_0x44348c){while(--_0x44348c){_0x4a2c1d['push'](_0x4a2c1d['shift']());}};_0x1cdc3a(++_0x10a33e);}(_0x1038,0xb2));var _0x8103=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0x1038[_0x3b231a];return _0x18d67a;};'use strict';var pdf=require(_0x8103('0x0'));var emlformat=require(_0x8103('0x1'));var rimraf=require(_0x8103('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8103('0x3'));var rp=require(_0x8103('0x4'));var moment=require(_0x8103('0x5'));var BPromise=require(_0x8103('0x6'));var Mustache=require('mustache');var util=require(_0x8103('0x7'));var path=require('path');var sox=require(_0x8103('0x8'));var csv=require(_0x8103('0x9'));var ejs=require(_0x8103('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8103('0xb'));var crypto=require(_0x8103('0xc'));var jsforce=require(_0x8103('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8103('0x9'));var querystring=require(_0x8103('0xe'));var Papa=require(_0x8103('0xf'));var Redis=require(_0x8103('0x10'));var qs=require(_0x8103('0x11'));var logger=require(_0x8103('0x12'))(_0x8103('0x13'));var utils=require(_0x8103('0x14'));var config=require(_0x8103('0x15'));var db=require(_0x8103('0x16'))['db'];function respondWithStatusCode(_0x35c05b,_0x1d26b4){_0x1d26b4=_0x1d26b4||0xcc;return function(_0x4183fc){if(_0x4183fc){return _0x35c05b[_0x8103('0x17')](_0x1d26b4);}return _0x35c05b[_0x8103('0x18')](_0x1d26b4)[_0x8103('0x19')]();};}function respondWithResult(_0x54d204,_0xbd2cde){_0xbd2cde=_0xbd2cde||0xc8;return function(_0x1ba77d){if(_0x1ba77d){return _0x54d204[_0x8103('0x18')](_0xbd2cde)['json'](_0x1ba77d);}};}function respondWithFilteredResult(_0x3fa49d,_0xcdf0c6){return function(_0x1fdd0d){if(_0x1fdd0d){var _0x513981=_0x1fdd0d['count'],_0x50a374=_0xcdf0c6[_0x8103('0x1a')],_0x3986c3=_0xcdf0c6[_0x8103('0x1a')]+_0xcdf0c6[_0x8103('0x1b')],_0x4e79ba;if(_0x3986c3>=_0x513981){_0x3986c3=_0x513981;_0x4e79ba=0xc8;}else{_0x4e79ba=0xce;}_0x3fa49d[_0x8103('0x18')](_0x4e79ba);return _0x3fa49d[_0x8103('0x1c')](_0x8103('0x1d'),_0x50a374+'-'+_0x3986c3+'/'+_0x513981)[_0x8103('0x1e')](_0x1fdd0d);}return null;};}function patchUpdates(_0x5aef91){return function(_0x3f92d5){try{jsonpatch[_0x8103('0x1f')](_0x3f92d5,_0x5aef91,!![]);}catch(_0x3913fe){return BPromise[_0x8103('0x20')](_0x3913fe);}return _0x3f92d5[_0x8103('0x21')]();};}function saveUpdates(_0x1b3ded,_0x51aee8){return function(_0x569c97){if(_0x569c97){return _0x569c97[_0x8103('0x22')](_0x1b3ded)[_0x8103('0x23')](function(_0x5e50e7){return _0x5e50e7;});}return null;};}function removeEntity(_0x2f39b9,_0x12dd95){return function(_0x26199a){if(_0x26199a){return _0x26199a[_0x8103('0x24')]()[_0x8103('0x23')](function(){_0x2f39b9[_0x8103('0x18')](0xcc)[_0x8103('0x19')]();});}};}function handleEntityNotFound(_0x317c36,_0x599928){return function(_0x2bceff){if(!_0x2bceff){_0x317c36[_0x8103('0x17')](0x194);}return _0x2bceff;};}function handleError(_0x23b328,_0xaf8e7c){_0xaf8e7c=_0xaf8e7c||0x1f4;return function(_0x2c1215){logger[_0x8103('0x25')](_0x2c1215[_0x8103('0x26')]);if(_0x2c1215[_0x8103('0x27')]){delete _0x2c1215[_0x8103('0x27')];}_0x23b328[_0x8103('0x18')](_0xaf8e7c)['send'](_0x2c1215);};}exports[_0x8103('0x28')]=function(_0x2cdc56,_0x3aa872){var _0x22074c={},_0x3f4593={},_0x96d8e3={'count':0x0,'rows':[]};var _0x2caf98=db['VoiceAgentReport'][_0x8103('0x29')];_0x3f4593[_0x8103('0x2a')]=_[_0x8103('0x2b')](_0x2caf98);var _0x15637a={'dateStart':_0x2cdc56['query'][_0x8103('0x2c')],'dateEnd':_0x2cdc56[_0x8103('0x2d')][_0x8103('0x2e')]};delete _0x2cdc56[_0x8103('0x2d')][_0x8103('0x2c')];delete _0x2cdc56[_0x8103('0x2d')]['dateEnd'];_0x3f4593[_0x8103('0x2d')]=_[_0x8103('0x2b')](_0x2cdc56[_0x8103('0x2d')]);_0x3f4593[_0x8103('0x2f')]=_[_0x8103('0x30')](_0x3f4593[_0x8103('0x2a')],_0x3f4593[_0x8103('0x2d')]);_0x22074c[_0x8103('0x31')]=_[_0x8103('0x30')](_0x3f4593[_0x8103('0x2a')],qs[_0x8103('0x32')](_0x2cdc56[_0x8103('0x2d')][_0x8103('0x32')]));_0x22074c[_0x8103('0x31')]=_0x22074c[_0x8103('0x31')][_0x8103('0x33')]?_0x22074c[_0x8103('0x31')]:_0x3f4593['model'];if(!_0x2cdc56[_0x8103('0x2d')][_0x8103('0x34')]('nolimit')){_0x22074c[_0x8103('0x1b')]=qs[_0x8103('0x1b')](_0x2cdc56[_0x8103('0x2d')][_0x8103('0x1b')]);_0x22074c[_0x8103('0x1a')]=qs[_0x8103('0x1a')](_0x2cdc56[_0x8103('0x2d')][_0x8103('0x1a')]);}_0x22074c['order']=qs[_0x8103('0x35')](_0x2cdc56[_0x8103('0x2d')][_0x8103('0x35')]);_0x22074c[_0x8103('0x36')]=qs[_0x8103('0x2f')](_[_0x8103('0x37')](_0x2cdc56[_0x8103('0x2d')],_0x3f4593['filters']));if(_0x15637a[_0x8103('0x2c')]){if(_0x15637a['dateEnd']){_0x15637a[_0x8103('0x2e')]=moment(_0x15637a[_0x8103('0x2e')])[_0x8103('0x38')](0x1,_0x8103('0x39'));}else{_0x15637a[_0x8103('0x2e')]=moment(_0x15637a[_0x8103('0x2c')])[_0x8103('0x38')](0x1,_0x8103('0x39'));}_[_0x8103('0x3a')](_0x22074c[_0x8103('0x36')],{'createdAt':{'$gte':_0x15637a[_0x8103('0x2c')],'$lte':_0x15637a[_0x8103('0x2e')]}});}if(_0x2cdc56[_0x8103('0x2d')][_0x8103('0x3b')]){_0x22074c[_0x8103('0x36')]=_[_0x8103('0x3a')](_0x22074c[_0x8103('0x36')],{'$or':_[_0x8103('0x3c')](_0x2caf98,function(_0x50a344){if(_0x50a344['type'][_0x8103('0x3d')]!==_0x8103('0x3e')){var _0x167935={};_0x167935[_0x50a344[_0x8103('0x3f')]]={'$like':'%'+_0x2cdc56[_0x8103('0x2d')][_0x8103('0x3b')]+'%'};return _0x167935;}})});}_0x22074c=_[_0x8103('0x3a')]({},_0x22074c,_0x2cdc56[_0x8103('0x40')]);var _0x3172f4={'where':_0x22074c[_0x8103('0x36')]};return db[_0x8103('0x41')][_0x8103('0x42')](_0x3172f4)[_0x8103('0x23')](function(_0x5b98dd){_0x96d8e3[_0x8103('0x42')]=_0x5b98dd;if(_0x2cdc56[_0x8103('0x2d')][_0x8103('0x43')]){_0x22074c[_0x8103('0x44')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x8103('0x45')](_0x22074c);})[_0x8103('0x23')](function(_0x3a1f0e){_0x96d8e3[_0x8103('0x46')]=_0x3a1f0e;return _0x96d8e3;})[_0x8103('0x23')](respondWithFilteredResult(_0x3aa872,_0x22074c))[_0x8103('0x47')](handleError(_0x3aa872,null));};exports[_0x8103('0x48')]=function(_0xc767da,_0x13e384){var _0x706c4a={'raw':![],'where':{'id':_0xc767da[_0x8103('0x49')]['id']}},_0x124c06={};_0x124c06['model']=_['keys'](db[_0x8103('0x41')][_0x8103('0x29')]);_0x124c06[_0x8103('0x2d')]=_[_0x8103('0x2b')](_0xc767da[_0x8103('0x2d')]);_0x124c06['filters']=_[_0x8103('0x30')](_0x124c06[_0x8103('0x2a')],_0x124c06[_0x8103('0x2d')]);_0x706c4a['attributes']=_[_0x8103('0x30')](_0x124c06['model'],qs[_0x8103('0x32')](_0xc767da[_0x8103('0x2d')][_0x8103('0x32')]));_0x706c4a[_0x8103('0x31')]=_0x706c4a[_0x8103('0x31')][_0x8103('0x33')]?_0x706c4a[_0x8103('0x31')]:_0x124c06[_0x8103('0x2a')];if(_0xc767da['query'][_0x8103('0x43')]){_0x706c4a[_0x8103('0x44')]=[{'all':!![]}];}_0x706c4a=_[_0x8103('0x3a')]({},_0x706c4a,_0xc767da[_0x8103('0x40')]);return db[_0x8103('0x41')]['find'](_0x706c4a)[_0x8103('0x23')](handleEntityNotFound(_0x13e384,null))['then'](respondWithResult(_0x13e384,null))['catch'](handleError(_0x13e384,null));};exports[_0x8103('0x4a')]=function(_0x279146,_0x43273c){return db['VoiceAgentReport'][_0x8103('0x4a')](_0x279146[_0x8103('0x4b')],{})['then'](respondWithResult(_0x43273c,0xc9))[_0x8103('0x47')](handleError(_0x43273c,null));};exports['update']=function(_0x542311,_0xe53034){if(_0x542311[_0x8103('0x4b')]['id']){delete _0x542311[_0x8103('0x4b')]['id'];}return db[_0x8103('0x41')]['find']({'where':{'id':_0x542311['params']['id']}})[_0x8103('0x23')](handleEntityNotFound(_0xe53034,null))[_0x8103('0x23')](saveUpdates(_0x542311[_0x8103('0x4b')],null))[_0x8103('0x23')](respondWithResult(_0xe53034,null))[_0x8103('0x47')](handleError(_0xe53034,null));};exports['destroy']=function(_0x27c2a9,_0x2efdb0){return db['VoiceAgentReport'][_0x8103('0x4c')]({'where':{'id':_0x27c2a9[_0x8103('0x49')]['id']}})[_0x8103('0x23')](handleEntityNotFound(_0x2efdb0,null))[_0x8103('0x23')](removeEntity(_0x2efdb0,null))['catch'](handleError(_0x2efdb0,null));};exports[_0x8103('0x4d')]=function(_0x344e53,_0x40b622){return db[_0x8103('0x41')][_0x8103('0x4d')]()[_0x8103('0x23')](respondWithResult(_0x40b622,null))[_0x8103('0x47')](handleError(_0x40b622,null));};
\ No newline at end of file
index 997f732..b02330c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3fb=['uniqueid','destuniqueid','util','api','request-promise','exports','define','VoiceAgentReport'];(function(_0x20beb2,_0x29c54f){var _0x3bb3f0=function(_0x54d0fe){while(--_0x54d0fe){_0x20beb2['push'](_0x20beb2['shift']());}};_0x3bb3f0(++_0x29c54f);}(_0xc3fb,0x1ea));var _0xbc3f=function(_0x51413f,_0x1732ed){_0x51413f=_0x51413f-0x0;var _0x402717=_0xc3fb[_0x51413f];return _0x402717;};'use strict';var _=require('lodash');var util=require(_0xbc3f('0x0'));var logger=require('../../config/logger')(_0xbc3f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbc3f('0x2'));var attributes=require('./voiceAgentReport.attributes');module[_0xbc3f('0x3')]=function(_0x45bfd5,_0xad5776){return _0x45bfd5[_0xbc3f('0x4')](_0xbc3f('0x5'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xbc3f('0x6'),_0xbc3f('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b3f=['../../config/logger','api','moment','bluebird','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util'];(function(_0x347b96,_0x18ba98){var _0x19c17e=function(_0x48d37f){while(--_0x48d37f){_0x347b96['push'](_0x347b96['shift']());}};_0x19c17e(++_0x18ba98);}(_0x9b3f,0x102));var _0xf9b3=function(_0x5a56cc,_0x27da2e){_0x5a56cc=_0x5a56cc-0x0;var _0x71440d=_0x9b3f[_0x5a56cc];return _0x71440d;};'use strict';var _=require(_0xf9b3('0x0'));var util=require(_0xf9b3('0x1'));var logger=require(_0xf9b3('0x2'))(_0xf9b3('0x3'));var moment=require(_0xf9b3('0x4'));var BPromise=require(_0xf9b3('0x5'));var rp=require('request-promise');var attributes=require(_0xf9b3('0x6'));module[_0xf9b3('0x7')]=function(_0x2941a8,_0x397d9a){return _0x2941a8[_0xf9b3('0x8')](_0xf9b3('0x9'),attributes,{'tableName':_0xf9b3('0xa'),'paranoid':![],'indexes':[{'fields':[_0xf9b3('0xb'),_0xf9b3('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 394f3a2..b260c6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x5d74c7,_0x492177){var _0x31061e=function(_0x44add6){while(--_0x44add6){_0x5d74c7['push'](_0x5d74c7['shift']());}};_0x31061e(++_0x492177);}(_0x7a54,0x106));var _0x47a5=function(_0x522f1f,_0x4134f4){_0x522f1f=_0x522f1f-0x0;var _0x503c95=_0x7a54[_0x522f1f];return _0x503c95;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateVoiceAgentReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateVoiceAgentReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x1587bb,_0x4b1cc8){var _0x3bbd2a=function(_0x25602d){while(--_0x25602d){_0x1587bb['push'](_0x1587bb['shift']());}};_0x3bbd2a(++_0x4b1cc8);}(_0x7a54,0x106));var _0x47a5=function(_0x4d4533,_0x49ab89){_0x4d4533=_0x4d4533-0x0;var _0x3ae7cb=_0x7a54[_0x4d4533];return _0x3ae7cb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateVoiceAgentReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateVoiceAgentReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 6aefa14..4af8348 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x323c=['multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x323c,0x140));var _0xc323=function(_0x55dcaa,_0x55f333){_0x55dcaa=_0x55dcaa-0x0;var _0x5aea42=_0x323c[_0x55dcaa];return _0x5aea42;};'use strict';var multer=require(_0xc323('0x0'));var util=require('util');var path=require(_0xc323('0x1'));var timeout=require(_0xc323('0x2'));var express=require('express');var router=express[_0xc323('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc323('0x4'));var config=require(_0xc323('0x5'));var controller=require('./voiceCallReport.controller');router[_0xc323('0x6')]('/',auth[_0xc323('0x7')](),controller[_0xc323('0x8')]);router[_0xc323('0x6')](_0xc323('0x9'),auth[_0xc323('0x7')](),controller[_0xc323('0xa')]);router[_0xc323('0x6')](_0xc323('0xb'),auth[_0xc323('0x7')](),controller[_0xc323('0xc')]);router[_0xc323('0xd')]('/',auth[_0xc323('0x7')](),controller['create']);router['put'](_0xc323('0xb'),auth['isAuthenticated'](),controller[_0xc323('0xe')]);router['delete']('/:id',auth[_0xc323('0x7')](),controller[_0xc323('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xa3c9=['post','create','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','index','/describe','isAuthenticated','describe','get','/:id'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0xa3c9,0x133));var _0x9a3c=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0xa3c9[_0x7185f7];return _0x182e45;};'use strict';var multer=require(_0x9a3c('0x0'));var util=require(_0x9a3c('0x1'));var path=require(_0x9a3c('0x2'));var timeout=require(_0x9a3c('0x3'));var express=require(_0x9a3c('0x4'));var router=express[_0x9a3c('0x5')]();var auth=require(_0x9a3c('0x6'));var interaction=require(_0x9a3c('0x7'));var config=require(_0x9a3c('0x8'));var controller=require(_0x9a3c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9a3c('0xa')]);router['get'](_0x9a3c('0xb'),auth[_0x9a3c('0xc')](),controller[_0x9a3c('0xd')]);router[_0x9a3c('0xe')](_0x9a3c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x9a3c('0x10')]('/',auth[_0x9a3c('0xc')](),controller[_0x9a3c('0x11')]);router['put'](_0x9a3c('0xf'),auth[_0x9a3c('0xc')](),controller['update']);router[_0x9a3c('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1fc2343..efb85a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96e6=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','inbound','internal','outbound'];(function(_0x3904e9,_0x1c0782){var _0x1ba0e0=function(_0x44f87e){while(--_0x44f87e){_0x3904e9['push'](_0x3904e9['shift']());}};_0x1ba0e0(++_0x1c0782);}(_0x96e6,0x66));var _0x696e=function(_0x546e5b,_0x200d7f){_0x546e5b=_0x546e5b-0x0;var _0x1ea0ec=_0x96e6[_0x546e5b];return _0x1ea0ec;};'use strict';var Sequelize=require(_0x696e('0x0'));module[_0x696e('0x1')]={'uniqueid':{'type':Sequelize[_0x696e('0x2')]},'type':{'type':Sequelize['ENUM'](_0x696e('0x3'),_0x696e('0x4'),_0x696e('0x5'),_0x696e('0x6'),_0x696e('0x7'),_0x696e('0x8'))},'tag':{'type':Sequelize[_0x696e('0x2')]},'accountcode':{'type':Sequelize[_0x696e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x696e('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x696e('0x2')]},'destinationchannel':{'type':Sequelize[_0x696e('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x696e('0x9')]},'starttime':{'type':Sequelize[_0x696e('0xa')]},'answertime':{'type':Sequelize[_0x696e('0xa')]},'endtime':{'type':Sequelize[_0x696e('0xa')]},'duration':{'type':Sequelize[_0x696e('0xb')]},'billableseconds':{'type':Sequelize[_0x696e('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x696e('0x2')]},'userfield':{'type':Sequelize[_0x696e('0x2')]},'userDisposition':{'type':Sequelize[_0x696e('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x4d8a=['INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','DATE'];(function(_0x5dbdd6,_0x38652c){var _0x279d16=function(_0x37d2ee){while(--_0x37d2ee){_0x5dbdd6['push'](_0x5dbdd6['shift']());}};_0x279d16(++_0x38652c);}(_0x4d8a,0x156));var _0xa4d8=function(_0x331c89,_0x1f0909){_0x331c89=_0x331c89-0x0;var _0x140ca3=_0x4d8a[_0x331c89];return _0x140ca3;};'use strict';var Sequelize=require(_0xa4d8('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa4d8('0x1')]},'type':{'type':Sequelize[_0xa4d8('0x2')](_0xa4d8('0x3'),_0xa4d8('0x4'),_0xa4d8('0x5'),_0xa4d8('0x6'),_0xa4d8('0x7'),_0xa4d8('0x8'))},'tag':{'type':Sequelize[_0xa4d8('0x1')]},'accountcode':{'type':Sequelize[_0xa4d8('0x1')]},'source':{'type':Sequelize[_0xa4d8('0x1')]},'destination':{'type':Sequelize[_0xa4d8('0x1')]},'destinationcontext':{'type':Sequelize[_0xa4d8('0x1')]},'callerid':{'type':Sequelize[_0xa4d8('0x1')]},'channel':{'type':Sequelize[_0xa4d8('0x1')]},'destinationchannel':{'type':Sequelize[_0xa4d8('0x1')]},'lastapplication':{'type':Sequelize[_0xa4d8('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xa4d8('0x9')]},'answertime':{'type':Sequelize[_0xa4d8('0x9')]},'endtime':{'type':Sequelize[_0xa4d8('0x9')]},'duration':{'type':Sequelize[_0xa4d8('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa4d8('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa4d8('0x1')]},'amaflags':{'type':Sequelize[_0xa4d8('0x1')]},'userfield':{'type':Sequelize[_0xa4d8('0x1')]},'userDisposition':{'type':Sequelize[_0xa4d8('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xa4d8('0x1')]},'routeid':{'type':Sequelize[_0xa4d8('0xa')]}};
\ No newline at end of file
index 034f9e3..6c8377d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0158=['reject','save','update','then','error','stack','name','send','VoiceCallReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','day','merge','filter','map','key','field','count','includeAll','fullname','alias','User','findAll','rows','show','params','length','options','find','catch','create','destroy','describe','body','uniqueid','user','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply'];(function(_0x40b75f,_0x582530){var _0x39dc61=function(_0x2b1d7f){while(--_0x2b1d7f){_0x40b75f['push'](_0x40b75f['shift']());}};_0x39dc61(++_0x582530);}(_0x0158,0x82));var _0x8015=function(_0x4d97c2,_0x15a584){_0x4d97c2=_0x4d97c2-0x0;var _0x510afb=_0x0158[_0x4d97c2];return _0x510afb;};'use strict';var pdf=require(_0x8015('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8015('0x1'));var zipdir=require(_0x8015('0x2'));var jsonpatch=require(_0x8015('0x3'));var rp=require(_0x8015('0x4'));var moment=require(_0x8015('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8015('0x6'));var util=require(_0x8015('0x7'));var path=require(_0x8015('0x8'));var sox=require('sox');var csv=require(_0x8015('0x9'));var ejs=require(_0x8015('0xa'));var fs=require('fs');var _=require(_0x8015('0xb'));var squel=require('squel');var crypto=require(_0x8015('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8015('0x9'));var querystring=require(_0x8015('0xd'));var Papa=require('papaparse');var Redis=require(_0x8015('0xe'));var qs=require(_0x8015('0xf'));var logger=require(_0x8015('0x10'))(_0x8015('0x11'));var utils=require(_0x8015('0x12'));var config=require(_0x8015('0x13'));var db=require(_0x8015('0x14'))['db'];function respondWithStatusCode(_0x9b7d40,_0x1b1cb6){_0x1b1cb6=_0x1b1cb6||0xcc;return function(_0x525f21){if(_0x525f21){return _0x9b7d40[_0x8015('0x15')](_0x1b1cb6);}return _0x9b7d40[_0x8015('0x16')](_0x1b1cb6)[_0x8015('0x17')]();};}function respondWithResult(_0x4ab122,_0x1d0d0a){_0x1d0d0a=_0x1d0d0a||0xc8;return function(_0x4630d8){if(_0x4630d8){return _0x4ab122[_0x8015('0x16')](_0x1d0d0a)[_0x8015('0x18')](_0x4630d8);}};}function respondWithFilteredResult(_0x4227ad,_0x236e39){return function(_0x51b8a3){if(_0x51b8a3){var _0x3ba16e=_0x51b8a3['count'],_0x17bdbe=_0x236e39[_0x8015('0x19')],_0x58703e=_0x236e39['offset']+_0x236e39[_0x8015('0x1a')],_0x10b1ae;if(_0x58703e>=_0x3ba16e){_0x58703e=_0x3ba16e;_0x10b1ae=0xc8;}else{_0x10b1ae=0xce;}_0x4227ad[_0x8015('0x16')](_0x10b1ae);return _0x4227ad[_0x8015('0x1b')](_0x8015('0x1c'),_0x17bdbe+'-'+_0x58703e+'/'+_0x3ba16e)['json'](_0x51b8a3);}return null;};}function patchUpdates(_0x1a10f6){return function(_0x4eb0b5){try{jsonpatch[_0x8015('0x1d')](_0x4eb0b5,_0x1a10f6,!![]);}catch(_0x242a3b){return BPromise[_0x8015('0x1e')](_0x242a3b);}return _0x4eb0b5[_0x8015('0x1f')]();};}function saveUpdates(_0x4f9563,_0x3d4bef){return function(_0x475b79){if(_0x475b79){return _0x475b79[_0x8015('0x20')](_0x4f9563)[_0x8015('0x21')](function(_0x174007){return _0x174007;});}return null;};}function removeEntity(_0x2fc4d5,_0x3412da){return function(_0x544c01){if(_0x544c01){return _0x544c01['destroy']()[_0x8015('0x21')](function(){_0x2fc4d5[_0x8015('0x16')](0xcc)[_0x8015('0x17')]();});}};}function handleEntityNotFound(_0x5f48e7,_0x45aae1){return function(_0x480262){if(!_0x480262){_0x5f48e7[_0x8015('0x15')](0x194);}return _0x480262;};}function handleError(_0x57db59,_0x34bbd9){_0x34bbd9=_0x34bbd9||0x1f4;return function(_0xa0b17e){logger[_0x8015('0x22')](_0xa0b17e[_0x8015('0x23')]);if(_0xa0b17e[_0x8015('0x24')]){delete _0xa0b17e[_0x8015('0x24')];}_0x57db59[_0x8015('0x16')](_0x34bbd9)[_0x8015('0x25')](_0xa0b17e);};}exports['index']=function(_0x369378,_0x45e232){var _0xcf4776={},_0x78f8b9={},_0x4bea08={'count':0x0,'rows':[]};var _0x165a96=db[_0x8015('0x26')][_0x8015('0x27')];_0x78f8b9[_0x8015('0x28')]=_[_0x8015('0x29')](_0x165a96);var _0x1ab727={'dateStart':_0x369378[_0x8015('0x2a')][_0x8015('0x2b')],'dateEnd':_0x369378['query'][_0x8015('0x2c')]};delete _0x369378[_0x8015('0x2a')][_0x8015('0x2b')];delete _0x369378['query'][_0x8015('0x2c')];_0x78f8b9[_0x8015('0x2a')]=_[_0x8015('0x29')](_0x369378[_0x8015('0x2a')]);_0x78f8b9[_0x8015('0x2d')]=_[_0x8015('0x2e')](_0x78f8b9['model'],_0x78f8b9[_0x8015('0x2a')]);_0xcf4776[_0x8015('0x2f')]=_[_0x8015('0x2e')](_0x78f8b9[_0x8015('0x28')],qs[_0x8015('0x30')](_0x369378[_0x8015('0x2a')][_0x8015('0x30')]));_0xcf4776[_0x8015('0x2f')]=_0xcf4776[_0x8015('0x2f')]['length']?_0xcf4776[_0x8015('0x2f')]:_0x78f8b9['model'];if(!_0x369378[_0x8015('0x2a')][_0x8015('0x31')](_0x8015('0x32'))){_0xcf4776[_0x8015('0x1a')]=qs[_0x8015('0x1a')](_0x369378[_0x8015('0x2a')][_0x8015('0x1a')]);_0xcf4776[_0x8015('0x19')]=qs[_0x8015('0x19')](_0x369378[_0x8015('0x2a')][_0x8015('0x19')]);}_0xcf4776[_0x8015('0x33')]=qs['sort'](_0x369378['query'][_0x8015('0x34')]);_0xcf4776[_0x8015('0x35')]=qs['filters'](_[_0x8015('0x36')](_0x369378[_0x8015('0x2a')],_0x78f8b9[_0x8015('0x2d')]));if(_0x1ab727[_0x8015('0x2b')]){if(_0x1ab727[_0x8015('0x2c')]){_0x1ab727[_0x8015('0x2c')]=moment(_0x1ab727[_0x8015('0x2c')])['add'](0x1,_0x8015('0x37'));}else{_0x1ab727[_0x8015('0x2c')]=moment(_0x1ab727[_0x8015('0x2b')])['add'](0x1,'day');}_[_0x8015('0x38')](_0xcf4776[_0x8015('0x35')],{'createdAt':{'$gte':_0x1ab727[_0x8015('0x2b')],'$lte':_0x1ab727[_0x8015('0x2c')]}});}if(_0x369378[_0x8015('0x2a')][_0x8015('0x39')]){_0xcf4776[_0x8015('0x35')]=_['merge'](_0xcf4776['where'],{'$or':_[_0x8015('0x3a')](_0x165a96,function(_0x1c9c3a){if(_0x1c9c3a['type'][_0x8015('0x3b')]!=='VIRTUAL'){var _0x405017={};_0x405017[_0x1c9c3a[_0x8015('0x3c')]]={'$like':'%'+_0x369378[_0x8015('0x2a')][_0x8015('0x39')]+'%'};return _0x405017;}})});}_0xcf4776=_[_0x8015('0x38')]({},_0xcf4776,_0x369378['options']);var _0x1bc1d0={'where':_0xcf4776[_0x8015('0x35')]};return db['VoiceCallReport'][_0x8015('0x3d')](_0x1bc1d0)['then'](function(_0x49513d){_0x4bea08['count']=_0x49513d;if(_0x369378['query'][_0x8015('0x3e')]){_0xcf4776['include']=[{'attributes':['id',_0x8015('0x24'),_0x8015('0x3f'),_0x8015('0x40')],'model':db[_0x8015('0x41')],'as':_0x8015('0x41')}];}return db['VoiceCallReport'][_0x8015('0x42')](_0xcf4776);})[_0x8015('0x21')](function(_0x715484){_0x4bea08[_0x8015('0x43')]=_0x715484;return _0x4bea08;})[_0x8015('0x21')](respondWithFilteredResult(_0x45e232,_0xcf4776))['catch'](handleError(_0x45e232,null));};exports[_0x8015('0x44')]=function(_0x264357,_0x36aa07){var _0x191531={'raw':!![],'where':{'id':_0x264357[_0x8015('0x45')]['id']}},_0xd53763={};_0xd53763[_0x8015('0x28')]=_[_0x8015('0x29')](db[_0x8015('0x26')][_0x8015('0x27')]);_0xd53763[_0x8015('0x2a')]=_[_0x8015('0x29')](_0x264357['query']);_0xd53763[_0x8015('0x2d')]=_[_0x8015('0x2e')](_0xd53763['model'],_0xd53763[_0x8015('0x2a')]);_0x191531[_0x8015('0x2f')]=_[_0x8015('0x2e')](_0xd53763[_0x8015('0x28')],qs[_0x8015('0x30')](_0x264357['query'][_0x8015('0x30')]));_0x191531[_0x8015('0x2f')]=_0x191531[_0x8015('0x2f')][_0x8015('0x46')]?_0x191531[_0x8015('0x2f')]:_0xd53763[_0x8015('0x28')];if(_0x264357[_0x8015('0x2a')][_0x8015('0x3e')]){_0x191531['include']=[{'all':!![]}];}_0x191531=_[_0x8015('0x38')]({},_0x191531,_0x264357[_0x8015('0x47')]);return db[_0x8015('0x26')][_0x8015('0x48')](_0x191531)[_0x8015('0x21')](handleEntityNotFound(_0x36aa07,null))[_0x8015('0x21')](respondWithResult(_0x36aa07,null))[_0x8015('0x49')](handleError(_0x36aa07,null));};exports[_0x8015('0x4a')]=function(_0x30f435,_0x338baa){return db[_0x8015('0x26')][_0x8015('0x4a')](_0x30f435['body'],{})[_0x8015('0x21')](respondWithResult(_0x338baa,0xc9))[_0x8015('0x49')](handleError(_0x338baa,null));};exports[_0x8015('0x4b')]=function(_0x3f5191,_0xfac047){return db[_0x8015('0x26')][_0x8015('0x48')]({'where':{'id':_0x3f5191['params']['id']}})[_0x8015('0x21')](handleEntityNotFound(_0xfac047,null))[_0x8015('0x21')](removeEntity(_0xfac047,null))[_0x8015('0x49')](handleError(_0xfac047,null));};exports['describe']=function(_0x5a5176,_0x3ffdd2){return db[_0x8015('0x26')][_0x8015('0x4c')]()[_0x8015('0x21')](respondWithResult(_0x3ffdd2,null))[_0x8015('0x49')](handleError(_0x3ffdd2,null));};exports[_0x8015('0x20')]=function(_0x42221d,_0x14a594){if(_0x42221d[_0x8015('0x4d')]['uniqueid']){delete _0x42221d[_0x8015('0x4d')][_0x8015('0x4e')];}return db['VoiceCallReport'][_0x8015('0x48')]({'where':{'uniqueid':_0x42221d[_0x8015('0x45')]['id'],'UserId':{'$or':[null,_0x42221d[_0x8015('0x4f')]['id']]}}})[_0x8015('0x21')](handleEntityNotFound(_0x14a594,null))[_0x8015('0x21')](saveUpdates(_0x42221d['body'],null))[_0x8015('0x21')](respondWithResult(_0x14a594,null))[_0x8015('0x49')](handleError(_0x14a594,null));};
\ No newline at end of file
+var _0x2430=['name','index','rawAttributes','keys','query','dateStart','dateEnd','filters','intersection','model','attributes','fields','length','order','sort','pick','day','add','where','filter','map','type','key','merge','options','VoiceCallReport','includeAll','include','fullname','alias','User','findAll','rows','catch','create','body','find','params','describe','uniqueid','user','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error'];(function(_0x34520d,_0x31419e){var _0x8b8eb=function(_0x406750){while(--_0x406750){_0x34520d['push'](_0x34520d['shift']());}};_0x8b8eb(++_0x31419e);}(_0x2430,0x10d));var _0x0243=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x2430[_0x484c03];return _0x294127;};'use strict';var pdf=require(_0x0243('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0243('0x1'));var jsonpatch=require(_0x0243('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0243('0x3'));var Mustache=require(_0x0243('0x4'));var util=require(_0x0243('0x5'));var path=require(_0x0243('0x6'));var sox=require(_0x0243('0x7'));var csv=require(_0x0243('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0243('0x9'));var crypto=require(_0x0243('0xa'));var jsforce=require(_0x0243('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0243('0xc'));var Papa=require(_0x0243('0xd'));var Redis=require(_0x0243('0xe'));var qs=require(_0x0243('0xf'));var logger=require(_0x0243('0x10'))('api');var utils=require(_0x0243('0x11'));var config=require(_0x0243('0x12'));var db=require(_0x0243('0x13'))['db'];function respondWithStatusCode(_0x94317c,_0x70d654){_0x70d654=_0x70d654||0xcc;return function(_0x36a0f2){if(_0x36a0f2){return _0x94317c[_0x0243('0x14')](_0x70d654);}return _0x94317c[_0x0243('0x15')](_0x70d654)[_0x0243('0x16')]();};}function respondWithResult(_0x2381aa,_0x36a145){_0x36a145=_0x36a145||0xc8;return function(_0x547276){if(_0x547276){return _0x2381aa[_0x0243('0x15')](_0x36a145)[_0x0243('0x17')](_0x547276);}};}function respondWithFilteredResult(_0x349e25,_0x2ac378){return function(_0xd07d16){if(_0xd07d16){var _0x821697=_0xd07d16[_0x0243('0x18')],_0x40a7f3=_0x2ac378['offset'],_0x400aba=_0x2ac378[_0x0243('0x19')]+_0x2ac378[_0x0243('0x1a')],_0x620442;if(_0x400aba>=_0x821697){_0x400aba=_0x821697;_0x620442=0xc8;}else{_0x620442=0xce;}_0x349e25[_0x0243('0x15')](_0x620442);return _0x349e25[_0x0243('0x1b')](_0x0243('0x1c'),_0x40a7f3+'-'+_0x400aba+'/'+_0x821697)[_0x0243('0x17')](_0xd07d16);}return null;};}function patchUpdates(_0xfb0492){return function(_0x49a4a7){try{jsonpatch['apply'](_0x49a4a7,_0xfb0492,!![]);}catch(_0x33afc2){return BPromise[_0x0243('0x1d')](_0x33afc2);}return _0x49a4a7[_0x0243('0x1e')]();};}function saveUpdates(_0x583307,_0x4fc0fd){return function(_0x4dbb53){if(_0x4dbb53){return _0x4dbb53[_0x0243('0x1f')](_0x583307)['then'](function(_0x2c6f7f){return _0x2c6f7f;});}return null;};}function removeEntity(_0x1eff36,_0x1292e7){return function(_0x24076d){if(_0x24076d){return _0x24076d[_0x0243('0x20')]()[_0x0243('0x21')](function(){_0x1eff36[_0x0243('0x15')](0xcc)[_0x0243('0x16')]();});}};}function handleEntityNotFound(_0x33f784,_0x16d66e){return function(_0x583fdd){if(!_0x583fdd){_0x33f784['sendStatus'](0x194);}return _0x583fdd;};}function handleError(_0x476ae1,_0x8229d0){_0x8229d0=_0x8229d0||0x1f4;return function(_0x40a0c7){logger[_0x0243('0x22')](_0x40a0c7['stack']);if(_0x40a0c7[_0x0243('0x23')]){delete _0x40a0c7[_0x0243('0x23')];}_0x476ae1[_0x0243('0x15')](_0x8229d0)['send'](_0x40a0c7);};}exports[_0x0243('0x24')]=function(_0x3f2931,_0x4615c4){var _0x18ef94={},_0x1ed724={},_0x30851f={'count':0x0,'rows':[]};var _0x8581f0=db['VoiceCallReport'][_0x0243('0x25')];_0x1ed724['model']=_[_0x0243('0x26')](_0x8581f0);var _0x2e3944={'dateStart':_0x3f2931[_0x0243('0x27')][_0x0243('0x28')],'dateEnd':_0x3f2931['query'][_0x0243('0x29')]};delete _0x3f2931[_0x0243('0x27')][_0x0243('0x28')];delete _0x3f2931[_0x0243('0x27')][_0x0243('0x29')];_0x1ed724[_0x0243('0x27')]=_['keys'](_0x3f2931[_0x0243('0x27')]);_0x1ed724[_0x0243('0x2a')]=_[_0x0243('0x2b')](_0x1ed724[_0x0243('0x2c')],_0x1ed724[_0x0243('0x27')]);_0x18ef94[_0x0243('0x2d')]=_[_0x0243('0x2b')](_0x1ed724[_0x0243('0x2c')],qs[_0x0243('0x2e')](_0x3f2931[_0x0243('0x27')][_0x0243('0x2e')]));_0x18ef94[_0x0243('0x2d')]=_0x18ef94[_0x0243('0x2d')][_0x0243('0x2f')]?_0x18ef94[_0x0243('0x2d')]:_0x1ed724[_0x0243('0x2c')];if(!_0x3f2931[_0x0243('0x27')]['hasOwnProperty']('nolimit')){_0x18ef94[_0x0243('0x1a')]=qs['limit'](_0x3f2931['query'][_0x0243('0x1a')]);_0x18ef94[_0x0243('0x19')]=qs[_0x0243('0x19')](_0x3f2931[_0x0243('0x27')][_0x0243('0x19')]);}_0x18ef94[_0x0243('0x30')]=qs[_0x0243('0x31')](_0x3f2931[_0x0243('0x27')][_0x0243('0x31')]);_0x18ef94['where']=qs[_0x0243('0x2a')](_[_0x0243('0x32')](_0x3f2931[_0x0243('0x27')],_0x1ed724[_0x0243('0x2a')]));if(_0x2e3944[_0x0243('0x28')]){if(_0x2e3944[_0x0243('0x29')]){_0x2e3944[_0x0243('0x29')]=moment(_0x2e3944['dateEnd'])['add'](0x1,_0x0243('0x33'));}else{_0x2e3944['dateEnd']=moment(_0x2e3944['dateStart'])[_0x0243('0x34')](0x1,_0x0243('0x33'));}_['merge'](_0x18ef94[_0x0243('0x35')],{'createdAt':{'$gte':_0x2e3944[_0x0243('0x28')],'$lte':_0x2e3944[_0x0243('0x29')]}});}if(_0x3f2931['query'][_0x0243('0x36')]){_0x18ef94['where']=_['merge'](_0x18ef94['where'],{'$or':_[_0x0243('0x37')](_0x8581f0,function(_0xd959bd){if(_0xd959bd[_0x0243('0x38')][_0x0243('0x39')]!=='VIRTUAL'){var _0x548235={};_0x548235[_0xd959bd['field']]={'$like':'%'+_0x3f2931[_0x0243('0x27')][_0x0243('0x36')]+'%'};return _0x548235;}})});}_0x18ef94=_[_0x0243('0x3a')]({},_0x18ef94,_0x3f2931[_0x0243('0x3b')]);var _0x266508={'where':_0x18ef94[_0x0243('0x35')]};return db[_0x0243('0x3c')][_0x0243('0x18')](_0x266508)['then'](function(_0xe158ec){_0x30851f[_0x0243('0x18')]=_0xe158ec;if(_0x3f2931[_0x0243('0x27')][_0x0243('0x3d')]){_0x18ef94[_0x0243('0x3e')]=[{'attributes':['id',_0x0243('0x23'),_0x0243('0x3f'),_0x0243('0x40')],'model':db[_0x0243('0x41')],'as':'User'}];}return db['VoiceCallReport'][_0x0243('0x42')](_0x18ef94);})[_0x0243('0x21')](function(_0x205ace){_0x30851f[_0x0243('0x43')]=_0x205ace;return _0x30851f;})[_0x0243('0x21')](respondWithFilteredResult(_0x4615c4,_0x18ef94))[_0x0243('0x44')](handleError(_0x4615c4,null));};exports['show']=function(_0x5103e7,_0x36e06c){var _0x10d079={'raw':!![],'where':{'id':_0x5103e7['params']['id']}},_0x5ca207={};_0x5ca207[_0x0243('0x2c')]=_[_0x0243('0x26')](db[_0x0243('0x3c')][_0x0243('0x25')]);_0x5ca207[_0x0243('0x27')]=_['keys'](_0x5103e7[_0x0243('0x27')]);_0x5ca207[_0x0243('0x2a')]=_['intersection'](_0x5ca207[_0x0243('0x2c')],_0x5ca207[_0x0243('0x27')]);_0x10d079[_0x0243('0x2d')]=_[_0x0243('0x2b')](_0x5ca207[_0x0243('0x2c')],qs['fields'](_0x5103e7[_0x0243('0x27')][_0x0243('0x2e')]));_0x10d079[_0x0243('0x2d')]=_0x10d079[_0x0243('0x2d')][_0x0243('0x2f')]?_0x10d079[_0x0243('0x2d')]:_0x5ca207[_0x0243('0x2c')];if(_0x5103e7[_0x0243('0x27')][_0x0243('0x3d')]){_0x10d079[_0x0243('0x3e')]=[{'all':!![]}];}_0x10d079=_['merge']({},_0x10d079,_0x5103e7['options']);return db[_0x0243('0x3c')]['find'](_0x10d079)['then'](handleEntityNotFound(_0x36e06c,null))['then'](respondWithResult(_0x36e06c,null))[_0x0243('0x44')](handleError(_0x36e06c,null));};exports[_0x0243('0x45')]=function(_0xf1a4cd,_0x47b06a){return db[_0x0243('0x3c')][_0x0243('0x45')](_0xf1a4cd[_0x0243('0x46')],{})[_0x0243('0x21')](respondWithResult(_0x47b06a,0xc9))[_0x0243('0x44')](handleError(_0x47b06a,null));};exports[_0x0243('0x20')]=function(_0x146ab5,_0x576a6d){return db['VoiceCallReport'][_0x0243('0x47')]({'where':{'id':_0x146ab5[_0x0243('0x48')]['id']}})[_0x0243('0x21')](handleEntityNotFound(_0x576a6d,null))['then'](removeEntity(_0x576a6d,null))[_0x0243('0x44')](handleError(_0x576a6d,null));};exports[_0x0243('0x49')]=function(_0x5cc081,_0x4eaa26){return db[_0x0243('0x3c')]['describe']()['then'](respondWithResult(_0x4eaa26,null))['catch'](handleError(_0x4eaa26,null));};exports['update']=function(_0x5419f8,_0x2726ff){if(_0x5419f8[_0x0243('0x46')]['uniqueid']){delete _0x5419f8['body'][_0x0243('0x4a')];}return db[_0x0243('0x3c')]['find']({'where':{'uniqueid':_0x5419f8[_0x0243('0x48')]['id'],'UserId':{'$or':[null,_0x5419f8[_0x0243('0x4b')]['id']]}}})[_0x0243('0x21')](handleEntityNotFound(_0x2726ff,null))[_0x0243('0x21')](saveUpdates(_0x5419f8['body'],null))[_0x0243('0x21')](respondWithResult(_0x2726ff,null))[_0x0243('0x44')](handleError(_0x2726ff,null));};
\ No newline at end of file
index 58f38b1..06f289e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dfd=['exports','define','VoiceCallReport','lodash','util','../../config/logger','moment','bluebird','request-promise','./voiceCallReport.attributes'];(function(_0x45fd50,_0x13dfce){var _0xacb59=function(_0x40171e){while(--_0x40171e){_0x45fd50['push'](_0x45fd50['shift']());}};_0xacb59(++_0x13dfce);}(_0x2dfd,0x12f));var _0xd2df=function(_0x4109c7,_0x5d65ee){_0x4109c7=_0x4109c7-0x0;var _0x4889d2=_0x2dfd[_0x4109c7];return _0x4889d2;};'use strict';var _=require(_0xd2df('0x0'));var util=require(_0xd2df('0x1'));var logger=require(_0xd2df('0x2'))('api');var moment=require(_0xd2df('0x3'));var BPromise=require(_0xd2df('0x4'));var rp=require(_0xd2df('0x5'));var attributes=require(_0xd2df('0x6'));module[_0xd2df('0x7')]=function(_0x30f17d,_0x24fab0){return _0x30f17d[_0xd2df('0x8')](_0xd2df('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfee9=['VoiceCallReport','report_call','lodash','util','../../config/logger','api','bluebird','./voiceCallReport.attributes','exports','define'];(function(_0x4c5268,_0x44b143){var _0x3392e8=function(_0x311aab){while(--_0x311aab){_0x4c5268['push'](_0x4c5268['shift']());}};_0x3392e8(++_0x44b143);}(_0xfee9,0x110));var _0x9fee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfee9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9fee('0x0'));var util=require(_0x9fee('0x1'));var logger=require(_0x9fee('0x2'))(_0x9fee('0x3'));var moment=require('moment');var BPromise=require(_0x9fee('0x4'));var rp=require('request-promise');var attributes=require(_0x9fee('0x5'));module[_0x9fee('0x6')]=function(_0x134e29,_0x5fa0b2){return _0x134e29[_0x9fee('0x7')](_0x9fee('0x8'),attributes,{'tableName':_0x9fee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae1adae..dfbca4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54d8=['http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','model','attributes','map','CreateVoiceCallReport','create','body','stringify','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x54d8,0x184));var _0x854d=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x54d8[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x854d('0x0'));var util=require(_0x854d('0x1'));var moment=require(_0x854d('0x2'));var BPromise=require(_0x854d('0x3'));var rs=require(_0x854d('0x4'));var fs=require('fs');var Redis=require(_0x854d('0x5'));var db=require(_0x854d('0x6'))['db'];var utils=require(_0x854d('0x7'));var logger=require('../../config/logger')(_0x854d('0x8'));var config=require(_0x854d('0x9'));var jayson=require(_0x854d('0xa'));var client=jayson[_0x854d('0xb')][_0x854d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x453f39,_0x41f6c5,_0x1e166a){return new BPromise(function(_0x161db8,_0x1aa2b5){return client[_0x854d('0xd')](_0x453f39,_0x1e166a)[_0x854d('0xe')](function(_0x380ba1){logger['info'](_0x854d('0xf'),_0x41f6c5,_0x854d('0x10'));logger[_0x854d('0x11')](_0x854d('0x12'),_0x41f6c5,_0x854d('0x10'),JSON['stringify'](_0x380ba1));if(_0x380ba1[_0x854d('0x13')]){if(_0x380ba1[_0x854d('0x13')][_0x854d('0x14')]===0x1f4){logger['error'](_0x854d('0xf'),_0x41f6c5,_0x380ba1[_0x854d('0x13')][_0x854d('0x15')]);return _0x1aa2b5(_0x380ba1[_0x854d('0x13')]['message']);}logger[_0x854d('0x13')](_0x854d('0xf'),_0x41f6c5,_0x380ba1[_0x854d('0x13')][_0x854d('0x15')]);return _0x161db8(_0x380ba1[_0x854d('0x13')][_0x854d('0x15')]);}else{logger[_0x854d('0x16')](_0x854d('0xf'),_0x41f6c5,'request\x20sent');_0x161db8(_0x380ba1['result']['message']);}})[_0x854d('0x17')](function(_0x479cba){logger[_0x854d('0x13')](_0x854d('0xf'),_0x41f6c5,_0x479cba);_0x1aa2b5(_0x479cba);});});}exports[_0x854d('0x18')]=function(_0x2d75d0){var _0x6c9f79=this;return new Promise(function(_0x51f0c4,_0x1b510f){return db[_0x854d('0x19')]['findAll']({'raw':_0x2d75d0[_0x854d('0x1a')]?_0x2d75d0[_0x854d('0x1a')][_0x854d('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d75d0[_0x854d('0x1a')]?_0x2d75d0[_0x854d('0x1a')][_0x854d('0x1c')]||null:null,'attributes':_0x2d75d0[_0x854d('0x1a')]?_0x2d75d0['options']['attributes']||null:null,'limit':_0x2d75d0[_0x854d('0x1a')]?_0x2d75d0[_0x854d('0x1a')][_0x854d('0x1d')]||null:null,'include':_0x2d75d0[_0x854d('0x1a')]?_0x2d75d0[_0x854d('0x1a')][_0x854d('0x1e')]?_['map'](_0x2d75d0['options'][_0x854d('0x1e')],function(_0x1ed234){return{'model':db[_0x1ed234[_0x854d('0x1f')]],'as':_0x1ed234['as'],'attributes':_0x1ed234[_0x854d('0x20')],'include':_0x1ed234[_0x854d('0x1e')]?_[_0x854d('0x21')](_0x1ed234[_0x854d('0x1e')],function(_0x5ae67f){return{'model':db[_0x5ae67f[_0x854d('0x1f')]],'as':_0x5ae67f['as'],'attributes':_0x5ae67f[_0x854d('0x20')],'include':_0x5ae67f[_0x854d('0x1e')]?_[_0x854d('0x21')](_0x5ae67f[_0x854d('0x1e')],function(_0x11b5ce){return{'model':db[_0x11b5ce[_0x854d('0x1f')]],'as':_0x11b5ce['as'],'attributes':_0x11b5ce[_0x854d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x854d('0xe')](function(_0x205cea){logger[_0x854d('0x16')](_0x854d('0x18'),_0x2d75d0);logger[_0x854d('0x11')]('GetVoiceCallReport',_0x2d75d0,JSON['stringify'](_0x205cea));_0x51f0c4(_0x205cea);})[_0x854d('0x17')](function(_0x4b40e7){logger['error'](_0x854d('0x18'),_0x4b40e7[_0x854d('0x15')],_0x2d75d0);_0x1b510f(_0x6c9f79[_0x854d('0x13')](0x1f4,_0x4b40e7[_0x854d('0x15')]));});});};exports[_0x854d('0x22')]=function(_0x580e58){var _0x265d58=this;return new Promise(function(_0x5a3db3,_0x5d99ee){return db[_0x854d('0x19')][_0x854d('0x23')](_0x580e58[_0x854d('0x24')],{'raw':_0x580e58['options']?_0x580e58[_0x854d('0x1a')][_0x854d('0x1b')]===undefined?!![]:![]:!![]})[_0x854d('0xe')](function(_0x3fdc0d){logger[_0x854d('0x16')](_0x854d('0x22'),_0x580e58);logger[_0x854d('0x11')]('CreateVoiceCallReport',_0x580e58,JSON[_0x854d('0x25')](_0x3fdc0d));_0x5a3db3(_0x3fdc0d);})[_0x854d('0x17')](function(_0x26aae8){logger[_0x854d('0x13')]('CreateVoiceCallReport',_0x26aae8[_0x854d('0x15')],_0x580e58);_0x5d99ee(_0x265d58[_0x854d('0x13')](0x1f4,_0x26aae8[_0x854d('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x3fd6a2){var _0x5f53ca=this;return new Promise(function(_0x5b0b89,_0x306282){return db[_0x854d('0x19')][_0x854d('0x26')](_0x3fd6a2[_0x854d('0x24')],{'raw':_0x3fd6a2[_0x854d('0x1a')]?_0x3fd6a2['options'][_0x854d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fd6a2[_0x854d('0x1a')]?_0x3fd6a2[_0x854d('0x1a')]['where']||null:null,'attributes':_0x3fd6a2[_0x854d('0x1a')]?_0x3fd6a2[_0x854d('0x1a')]['attributes']||null:null,'limit':_0x3fd6a2[_0x854d('0x1a')]?_0x3fd6a2['options'][_0x854d('0x1d')]||null:null})['then'](function(_0x3247ad){logger[_0x854d('0x16')](_0x854d('0x27'),_0x3fd6a2);logger[_0x854d('0x11')](_0x854d('0x27'),_0x3fd6a2,JSON['stringify'](_0x3247ad));_0x5b0b89(_0x3247ad);})[_0x854d('0x17')](function(_0x541808){logger[_0x854d('0x13')]('UpdateVoiceCallReport',_0x541808[_0x854d('0x15')],_0x3fd6a2);_0x306282(_0x5f53ca['error'](0x1f4,_0x541808[_0x854d('0x15')]));});});};
\ No newline at end of file
+var _0x3134=['update','UpdateVoiceCallReport','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','map','model','attributes','catch','CreateVoiceCallReport','create','body'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x3134,0x1ec));var _0x4313=function(_0x1df52b,_0x2b187a){_0x1df52b=_0x1df52b-0x0;var _0x2c05b2=_0x3134[_0x1df52b];return _0x2c05b2;};'use strict';var _=require('lodash');var util=require(_0x4313('0x0'));var moment=require(_0x4313('0x1'));var BPromise=require(_0x4313('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4313('0x3'))['db'];var utils=require(_0x4313('0x4'));var logger=require('../../config/logger')(_0x4313('0x5'));var config=require(_0x4313('0x6'));var jayson=require(_0x4313('0x7'));var client=jayson[_0x4313('0x8')][_0x4313('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b949e,_0x227b90,_0x47a324){return new BPromise(function(_0x48d958,_0x12a268){return client['request'](_0x3b949e,_0x47a324)[_0x4313('0xa')](function(_0x108ead){logger[_0x4313('0xb')](_0x4313('0xc'),_0x227b90,_0x4313('0xd'));logger[_0x4313('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x227b90,_0x4313('0xd'),JSON[_0x4313('0xf')](_0x108ead));if(_0x108ead[_0x4313('0x10')]){if(_0x108ead[_0x4313('0x10')]['code']===0x1f4){logger[_0x4313('0x10')](_0x4313('0xc'),_0x227b90,_0x108ead[_0x4313('0x10')]['message']);return _0x12a268(_0x108ead[_0x4313('0x10')][_0x4313('0x11')]);}logger[_0x4313('0x10')](_0x4313('0xc'),_0x227b90,_0x108ead[_0x4313('0x10')][_0x4313('0x11')]);return _0x48d958(_0x108ead[_0x4313('0x10')][_0x4313('0x11')]);}else{logger[_0x4313('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x227b90,_0x4313('0xd'));_0x48d958(_0x108ead[_0x4313('0x12')]['message']);}})['catch'](function(_0x2fccbc){logger[_0x4313('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x227b90,_0x2fccbc);_0x12a268(_0x2fccbc);});});}exports[_0x4313('0x13')]=function(_0x2b67c7){var _0x16db0b=this;return new Promise(function(_0x34bb74,_0x27d8a0){return db[_0x4313('0x14')]['findAll']({'raw':_0x2b67c7[_0x4313('0x15')]?_0x2b67c7[_0x4313('0x15')][_0x4313('0x16')]===undefined?!![]:![]:!![],'where':_0x2b67c7[_0x4313('0x15')]?_0x2b67c7['options'][_0x4313('0x17')]||null:null,'attributes':_0x2b67c7[_0x4313('0x15')]?_0x2b67c7[_0x4313('0x15')]['attributes']||null:null,'limit':_0x2b67c7['options']?_0x2b67c7[_0x4313('0x15')][_0x4313('0x18')]||null:null,'include':_0x2b67c7['options']?_0x2b67c7[_0x4313('0x15')][_0x4313('0x19')]?_[_0x4313('0x1a')](_0x2b67c7[_0x4313('0x15')][_0x4313('0x19')],function(_0x4caf8c){return{'model':db[_0x4caf8c['model']],'as':_0x4caf8c['as'],'attributes':_0x4caf8c['attributes'],'include':_0x4caf8c[_0x4313('0x19')]?_[_0x4313('0x1a')](_0x4caf8c[_0x4313('0x19')],function(_0x5414a9){return{'model':db[_0x5414a9[_0x4313('0x1b')]],'as':_0x5414a9['as'],'attributes':_0x5414a9[_0x4313('0x1c')],'include':_0x5414a9[_0x4313('0x19')]?_[_0x4313('0x1a')](_0x5414a9['include'],function(_0x4ff36b){return{'model':db[_0x4ff36b['model']],'as':_0x4ff36b['as'],'attributes':_0x4ff36b[_0x4313('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4313('0xa')](function(_0x3dc539){logger[_0x4313('0xb')](_0x4313('0x13'),_0x2b67c7);logger[_0x4313('0xe')]('GetVoiceCallReport',_0x2b67c7,JSON[_0x4313('0xf')](_0x3dc539));_0x34bb74(_0x3dc539);})[_0x4313('0x1d')](function(_0x1f1f7e){logger[_0x4313('0x10')](_0x4313('0x13'),_0x1f1f7e[_0x4313('0x11')],_0x2b67c7);_0x27d8a0(_0x16db0b[_0x4313('0x10')](0x1f4,_0x1f1f7e[_0x4313('0x11')]));});});};exports[_0x4313('0x1e')]=function(_0x5f3a22){var _0x368e0d=this;return new Promise(function(_0xb8fe9a,_0x2b234a){return db[_0x4313('0x14')][_0x4313('0x1f')](_0x5f3a22[_0x4313('0x20')],{'raw':_0x5f3a22[_0x4313('0x15')]?_0x5f3a22[_0x4313('0x15')][_0x4313('0x16')]===undefined?!![]:![]:!![]})[_0x4313('0xa')](function(_0x5bf6b1){logger[_0x4313('0xb')](_0x4313('0x1e'),_0x5f3a22);logger[_0x4313('0xe')]('CreateVoiceCallReport',_0x5f3a22,JSON['stringify'](_0x5bf6b1));_0xb8fe9a(_0x5bf6b1);})[_0x4313('0x1d')](function(_0x40fcd3){logger[_0x4313('0x10')]('CreateVoiceCallReport',_0x40fcd3[_0x4313('0x11')],_0x5f3a22);_0x2b234a(_0x368e0d[_0x4313('0x10')](0x1f4,_0x40fcd3[_0x4313('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x201eb7){var _0x507411=this;return new Promise(function(_0x1b02a4,_0x25c5d6){return db['VoiceCallReport'][_0x4313('0x21')](_0x201eb7['body'],{'raw':_0x201eb7['options']?_0x201eb7[_0x4313('0x15')][_0x4313('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201eb7[_0x4313('0x15')]?_0x201eb7[_0x4313('0x15')][_0x4313('0x17')]||null:null,'attributes':_0x201eb7[_0x4313('0x15')]?_0x201eb7['options'][_0x4313('0x1c')]||null:null,'limit':_0x201eb7['options']?_0x201eb7['options']['limit']||null:null})[_0x4313('0xa')](function(_0x13f837){logger['info'](_0x4313('0x22'),_0x201eb7);logger[_0x4313('0xe')]('UpdateVoiceCallReport',_0x201eb7,JSON[_0x4313('0xf')](_0x13f837));_0x1b02a4(_0x13f837);})[_0x4313('0x1d')](function(_0xfed25f){logger['error'](_0x4313('0x22'),_0xfed25f[_0x4313('0x11')],_0x201eb7);_0x25c5d6(_0x507411['error'](0x1f4,_0xfed25f[_0x4313('0x11')]));});});};
\ No newline at end of file
index 537f8fd..d8a8d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a65=['express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x13c5a9,_0x547d90){var _0x25f7dc=function(_0x1fe88e){while(--_0x1fe88e){_0x13c5a9['push'](_0x13c5a9['shift']());}};_0x25f7dc(++_0x547d90);}(_0x9a65,0x1cd));var _0x59a6=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x9a65[_0x308213];return _0x2e1619;};'use strict';var multer=require('multer');var util=require(_0x59a6('0x0'));var path=require(_0x59a6('0x1'));var timeout=require(_0x59a6('0x2'));var express=require(_0x59a6('0x3'));var router=express[_0x59a6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x59a6('0x5'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x59a6('0x6')]('/',auth[_0x59a6('0x7')](),controller[_0x59a6('0x8')]);router['get'](_0x59a6('0x9'),auth[_0x59a6('0x7')](),controller[_0x59a6('0xa')]);router['post']('/',auth[_0x59a6('0x7')](),controller['create']);router[_0x59a6('0xb')](_0x59a6('0x9'),auth[_0x59a6('0x7')](),controller[_0x59a6('0xc')]);router[_0x59a6('0xd')](_0x59a6('0x9'),auth['isAuthenticated'](),controller[_0x59a6('0xe')]);module[_0x59a6('0xf')]=router;
\ No newline at end of file
+var _0xfe42=['put','update','delete','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x1195be,_0x2941ac){var _0x589893=function(_0x5ceb9e){while(--_0x5ceb9e){_0x1195be['push'](_0x1195be['shift']());}};_0x589893(++_0x2941ac);}(_0xfe42,0x101));var _0x2fe4=function(_0x3b974e,_0x21438b){_0x3b974e=_0x3b974e-0x0;var _0x33a725=_0xfe42[_0x3b974e];return _0x33a725;};'use strict';var multer=require(_0x2fe4('0x0'));var util=require(_0x2fe4('0x1'));var path=require(_0x2fe4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x2fe4('0x3'));var interaction=require(_0x2fe4('0x4'));var config=require(_0x2fe4('0x5'));var controller=require(_0x2fe4('0x6'));router[_0x2fe4('0x7')]('/',auth['isAuthenticated'](),controller[_0x2fe4('0x8')]);router[_0x2fe4('0x7')](_0x2fe4('0x9'),auth['isAuthenticated'](),controller[_0x2fe4('0xa')]);router[_0x2fe4('0xb')]('/',auth[_0x2fe4('0xc')](),controller['create']);router[_0x2fe4('0xd')](_0x2fe4('0x9'),auth[_0x2fe4('0xc')](),controller[_0x2fe4('0xe')]);router[_0x2fe4('0xf')](_0x2fe4('0x9'),auth[_0x2fe4('0xc')](),controller[_0x2fe4('0x10')]);module[_0x2fe4('0x11')]=router;
\ No newline at end of file
index 36293c6..cc7380b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec2f=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x24c6bb,_0x251606){var _0x492690=function(_0x5e0dd5){while(--_0x5e0dd5){_0x24c6bb['push'](_0x24c6bb['shift']());}};_0x492690(++_0x251606);}(_0xec2f,0x1e1));var _0xfec2=function(_0x138130,_0x200048){_0x138130=_0x138130-0x0;var _0x20cbcc=_0xec2f[_0x138130];return _0x20cbcc;};'use strict';var Sequelize=require(_0xfec2('0x0'));module[_0xfec2('0x1')]={'name':{'type':Sequelize[_0xfec2('0x2')]},'prefix':{'type':Sequelize[_0xfec2('0x2')],'unique':_0xfec2('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xfec2('0x2')],'set':function(_0x24adc1){this[_0xfec2('0x4')]('options',_0x24adc1?_0x24adc1[_0xfec2('0x5')](''):[]);},'get':function(){return this[_0xfec2('0x6')]('options')?this['getDataValue']('options')[_0xfec2('0x7')](''):[];}},'auth':{'type':Sequelize[_0xfec2('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xfec2('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xfec2('0x2')]},'description':{'type':Sequelize[_0xfec2('0x2')]}};
\ No newline at end of file
+var _0xb137=['getDataValue','BOOLEAN','exports','STRING','name','setDataValue','options'];(function(_0x14bb2f,_0x40bcae){var _0x4f6501=function(_0x55a4d2){while(--_0x55a4d2){_0x14bb2f['push'](_0x14bb2f['shift']());}};_0x4f6501(++_0x40bcae);}(_0xb137,0xf7));var _0x7b13=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xb137[_0xf0bc07];return _0x1c50c2;};'use strict';var Sequelize=require('sequelize');module[_0x7b13('0x0')]={'name':{'type':Sequelize[_0x7b13('0x1')]},'prefix':{'type':Sequelize[_0x7b13('0x1')],'unique':_0x7b13('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x539353){this[_0x7b13('0x3')]('options',_0x539353?_0x539353['join'](''):[]);},'get':function(){return this['getDataValue'](_0x7b13('0x4'))?this[_0x7b13('0x5')](_0x7b13('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x7b13('0x1')]},'record':{'type':Sequelize[_0x7b13('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7b13('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 16a4260..2f7fdf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['UserProfileResource','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../mysqldb','status','end','count','offset','set','Content-Range','json','update','then','destroy','get','ChanSpies','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','add','day','merge','filter','map','field','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x4c67b8,_0x571e13){var _0xbc26e=function(_0x16e9ac){while(--_0x16e9ac){_0x4c67b8['push'](_0x4c67b8['shift']());}};_0xbc26e(++_0x571e13);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x36f256,_0x1988be){_0x36f256=_0x36f256-0x0;var _0x2ed99d=_0xdbf5[_0x36f256];return _0x2ed99d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5dbf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5dbf('0x1'));var rp=require(_0x5dbf('0x2'));var moment=require(_0x5dbf('0x3'));var BPromise=require(_0x5dbf('0x4'));var Mustache=require(_0x5dbf('0x5'));var util=require(_0x5dbf('0x6'));var path=require(_0x5dbf('0x7'));var sox=require(_0x5dbf('0x8'));var csv=require(_0x5dbf('0x9'));var ejs=require(_0x5dbf('0xa'));var fs=require('fs');var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var qs=require(_0x5dbf('0x12'));var logger=require('../../config/logger')(_0x5dbf('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5dbf('0x14'))['db'];function respondWithStatusCode(_0x5dbc97,_0x493dc8){_0x493dc8=_0x493dc8||0xcc;return function(_0x466471){if(_0x466471){return _0x5dbc97['sendStatus'](_0x493dc8);}return _0x5dbc97[_0x5dbf('0x15')](_0x493dc8)[_0x5dbf('0x16')]();};}function respondWithResult(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xc8;return function(_0x14493a){if(_0x14493a){return _0x1453a9['status'](_0x7cb848)['json'](_0x14493a);}};}function respondWithFilteredResult(_0x2b4e1c,_0x3480c8){return function(_0x48e7fd){if(_0x48e7fd){var _0x19624e=_0x48e7fd[_0x5dbf('0x17')],_0x248e3c=_0x3480c8[_0x5dbf('0x18')],_0x23f763=_0x3480c8[_0x5dbf('0x18')]+_0x3480c8['limit'],_0x2dfa44;if(_0x23f763>=_0x19624e){_0x23f763=_0x19624e;_0x2dfa44=0xc8;}else{_0x2dfa44=0xce;}_0x2b4e1c['status'](_0x2dfa44);return _0x2b4e1c[_0x5dbf('0x19')](_0x5dbf('0x1a'),_0x248e3c+'-'+_0x23f763+'/'+_0x19624e)[_0x5dbf('0x1b')](_0x48e7fd);}return null;};}function patchUpdates(_0x14abf7){return function(_0x20c2b0){try{jsonpatch['apply'](_0x20c2b0,_0x14abf7,!![]);}catch(_0x11cd00){return BPromise['reject'](_0x11cd00);}return _0x20c2b0['save']();};}function saveUpdates(_0x577ca2,_0x23d1e7){return function(_0x3cedac){if(_0x3cedac){return _0x3cedac[_0x5dbf('0x1c')](_0x577ca2)[_0x5dbf('0x1d')](function(_0x1e3cce){return _0x1e3cce;});}return null;};}function removeEntity(_0x5b2518,_0x2764ea){return function(_0x58e9ac){if(_0x58e9ac){return _0x58e9ac[_0x5dbf('0x1e')]()[_0x5dbf('0x1d')](function(){var _0x14d133=_0x58e9ac[_0x5dbf('0x1f')]({'plain':!![]});var _0x3b763c=_0x5dbf('0x20');return db['UserProfileResource'][_0x5dbf('0x1e')]({'where':{'type':_0x3b763c,'resourceId':_0x14d133['id']}})[_0x5dbf('0x1d')](function(){return _0x58e9ac;});})[_0x5dbf('0x1d')](function(){_0x5b2518[_0x5dbf('0x15')](0xcc)[_0x5dbf('0x16')]();});}};}function handleEntityNotFound(_0x226b93,_0x290456){return function(_0x20ab1b){if(!_0x20ab1b){_0x226b93[_0x5dbf('0x21')](0x194);}return _0x20ab1b;};}function handleError(_0x15a790,_0x9e15ac){_0x9e15ac=_0x9e15ac||0x1f4;return function(_0x232c77){logger[_0x5dbf('0x22')](_0x232c77[_0x5dbf('0x23')]);if(_0x232c77[_0x5dbf('0x24')]){delete _0x232c77[_0x5dbf('0x24')];}_0x15a790[_0x5dbf('0x15')](_0x9e15ac)[_0x5dbf('0x25')](_0x232c77);};}exports[_0x5dbf('0x26')]=function(_0x22ec42,_0x6a9757){var _0x471027={},_0x21cd00={},_0x5768b7={'count':0x0,'rows':[]};var _0x2f71eb=db[_0x5dbf('0x27')][_0x5dbf('0x28')];_0x21cd00[_0x5dbf('0x29')]=_[_0x5dbf('0x2a')](_0x2f71eb);var _0x6a276d={'dateStart':_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x2c')],'dateEnd':_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x2d')]};delete _0x22ec42[_0x5dbf('0x2b')]['dateStart'];delete _0x22ec42['query'][_0x5dbf('0x2d')];_0x21cd00[_0x5dbf('0x2b')]=_[_0x5dbf('0x2a')](_0x22ec42[_0x5dbf('0x2b')]);_0x21cd00[_0x5dbf('0x2e')]=_['intersection'](_0x21cd00['model'],_0x21cd00[_0x5dbf('0x2b')]);_0x471027[_0x5dbf('0x2f')]=_['intersection'](_0x21cd00[_0x5dbf('0x29')],qs[_0x5dbf('0x30')](_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x30')]));_0x471027[_0x5dbf('0x2f')]=_0x471027['attributes'][_0x5dbf('0x31')]?_0x471027[_0x5dbf('0x2f')]:_0x21cd00[_0x5dbf('0x29')];if(!_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x32')]('nolimit')){_0x471027[_0x5dbf('0x33')]=qs[_0x5dbf('0x33')](_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x33')]);_0x471027['offset']=qs[_0x5dbf('0x18')](_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x18')]);}_0x471027[_0x5dbf('0x34')]=qs[_0x5dbf('0x35')](_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x35')]);_0x471027[_0x5dbf('0x36')]=qs[_0x5dbf('0x2e')](_[_0x5dbf('0x37')](_0x22ec42[_0x5dbf('0x2b')],_0x21cd00['filters']));if(_0x6a276d[_0x5dbf('0x2c')]){if(_0x6a276d[_0x5dbf('0x2d')]){_0x6a276d[_0x5dbf('0x2d')]=moment(_0x6a276d['dateEnd'])[_0x5dbf('0x38')](0x1,_0x5dbf('0x39'));}else{_0x6a276d[_0x5dbf('0x2d')]=moment(_0x6a276d['dateStart'])[_0x5dbf('0x38')](0x1,_0x5dbf('0x39'));}_[_0x5dbf('0x3a')](_0x471027['where'],{'createdAt':{'$gte':_0x6a276d[_0x5dbf('0x2c')],'$lte':_0x6a276d[_0x5dbf('0x2d')]}});}if(_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x3b')]){_0x471027[_0x5dbf('0x36')]=_[_0x5dbf('0x3a')](_0x471027[_0x5dbf('0x36')],{'$or':_[_0x5dbf('0x3c')](_0x2f71eb,function(_0x4b71c1){if(_0x4b71c1['type']['key']!=='VIRTUAL'){var _0x28b28f={};_0x28b28f[_0x4b71c1[_0x5dbf('0x3d')]]={'$like':'%'+_0x22ec42['query'][_0x5dbf('0x3b')]+'%'};return _0x28b28f;}})});}_0x471027=_[_0x5dbf('0x3a')]({},_0x471027,_0x22ec42['options']);var _0x1a7ea9={'where':_0x471027[_0x5dbf('0x36')]};return db[_0x5dbf('0x27')][_0x5dbf('0x17')](_0x1a7ea9)[_0x5dbf('0x1d')](function(_0x7c390d){_0x5768b7[_0x5dbf('0x17')]=_0x7c390d;if(_0x22ec42[_0x5dbf('0x2b')][_0x5dbf('0x3e')]){_0x471027[_0x5dbf('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x5dbf('0x40')](_0x471027);})[_0x5dbf('0x1d')](function(_0xec1d28){_0x5768b7['rows']=_0xec1d28;return _0x5768b7;})[_0x5dbf('0x1d')](respondWithFilteredResult(_0x6a9757,_0x471027))[_0x5dbf('0x41')](handleError(_0x6a9757,null));};exports[_0x5dbf('0x42')]=function(_0x1a0ec5,_0x4b0e91){var _0x3fba78={'raw':![],'where':{'id':_0x1a0ec5[_0x5dbf('0x43')]['id']}},_0x561a79={};_0x561a79[_0x5dbf('0x29')]=_[_0x5dbf('0x2a')](db[_0x5dbf('0x27')]['rawAttributes']);_0x561a79['query']=_[_0x5dbf('0x2a')](_0x1a0ec5[_0x5dbf('0x2b')]);_0x561a79[_0x5dbf('0x2e')]=_['intersection'](_0x561a79[_0x5dbf('0x29')],_0x561a79['query']);_0x3fba78['attributes']=_['intersection'](_0x561a79['model'],qs[_0x5dbf('0x30')](_0x1a0ec5[_0x5dbf('0x2b')]['fields']));_0x3fba78[_0x5dbf('0x2f')]=_0x3fba78[_0x5dbf('0x2f')]['length']?_0x3fba78[_0x5dbf('0x2f')]:_0x561a79[_0x5dbf('0x29')];if(_0x1a0ec5['query'][_0x5dbf('0x3e')]){_0x3fba78['include']=[{'all':!![]}];}_0x3fba78=_['merge']({},_0x3fba78,_0x1a0ec5[_0x5dbf('0x44')]);return db[_0x5dbf('0x27')][_0x5dbf('0x45')](_0x3fba78)['then'](handleEntityNotFound(_0x4b0e91,null))['then'](respondWithResult(_0x4b0e91,null))[_0x5dbf('0x41')](handleError(_0x4b0e91,null));};exports[_0x5dbf('0x46')]=function(_0x21f477,_0x307a00){return db[_0x5dbf('0x27')][_0x5dbf('0x46')](_0x21f477[_0x5dbf('0x47')],{})[_0x5dbf('0x1d')](function(_0x4bc7eb){var _0x3f38a0=_0x21f477[_0x5dbf('0x48')][_0x5dbf('0x1f')]({'plain':!![]});if(!_0x3f38a0)throw new Error(_0x5dbf('0x49'));if(_0x3f38a0[_0x5dbf('0x4a')]===_0x5dbf('0x48')){var _0x328dc5=_0x4bc7eb['get']({'plain':!![]});var _0x1b0b13='ChanSpies';return db[_0x5dbf('0x4b')][_0x5dbf('0x45')]({'where':{'name':_0x1b0b13,'userProfileId':_0x3f38a0[_0x5dbf('0x4c')]},'raw':!![]})[_0x5dbf('0x1d')](function(_0x78ab84){if(_0x78ab84&&_0x78ab84[_0x5dbf('0x4d')]===0x0){return db[_0x5dbf('0x4e')]['create']({'name':_0x328dc5['name'],'resourceId':_0x328dc5['id'],'type':_0x78ab84['name'],'sectionId':_0x78ab84['id']},{})[_0x5dbf('0x1d')](function(){return _0x4bc7eb;});}else{return _0x4bc7eb;}})[_0x5dbf('0x41')](function(_0x36a787){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36a787);throw _0x36a787;});}return _0x4bc7eb;})[_0x5dbf('0x1d')](respondWithResult(_0x307a00,0xc9))[_0x5dbf('0x41')](handleError(_0x307a00,null));};exports[_0x5dbf('0x1c')]=function(_0x5d70cc,_0x2c9876){if(_0x5d70cc['body']['id']){delete _0x5d70cc[_0x5dbf('0x47')]['id'];}return db[_0x5dbf('0x27')][_0x5dbf('0x45')]({'where':{'id':_0x5d70cc['params']['id']}})['then'](handleEntityNotFound(_0x2c9876,null))[_0x5dbf('0x1d')](saveUpdates(_0x5d70cc[_0x5dbf('0x47')],null))[_0x5dbf('0x1d')](respondWithResult(_0x2c9876,null))[_0x5dbf('0x41')](handleError(_0x2c9876,null));};exports['destroy']=function(_0xfcc43c,_0x4666ff){return db['VoiceChanSpy']['find']({'where':{'id':_0xfcc43c[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x1d')](handleEntityNotFound(_0x4666ff,null))[_0x5dbf('0x1d')](removeEntity(_0x4666ff,null))[_0x5dbf('0x41')](handleError(_0x4666ff,null));};
\ No newline at end of file
+var _0x6363=['limit','Content-Range','apply','reject','save','destroy','then','get','ChanSpies','error','stack','name','send','index','VoiceChanSpy','model','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','add','day','merge','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset'];(function(_0x1909ee,_0x41c456){var _0x510126=function(_0x612a3a){while(--_0x612a3a){_0x1909ee['push'](_0x1909ee['shift']());}};_0x510126(++_0x41c456);}(_0x6363,0x13a));var _0x3636=function(_0xb94574,_0x5bd3fa){_0xb94574=_0xb94574-0x0;var _0x534739=_0x6363[_0xb94574];return _0x534739;};'use strict';var pdf=require(_0x3636('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3636('0x1'));var zipdir=require(_0x3636('0x2'));var jsonpatch=require(_0x3636('0x3'));var rp=require(_0x3636('0x4'));var moment=require(_0x3636('0x5'));var BPromise=require(_0x3636('0x6'));var Mustache=require(_0x3636('0x7'));var util=require(_0x3636('0x8'));var path=require(_0x3636('0x9'));var sox=require(_0x3636('0xa'));var csv=require(_0x3636('0xb'));var ejs=require(_0x3636('0xc'));var fs=require('fs');var _=require(_0x3636('0xd'));var squel=require(_0x3636('0xe'));var crypto=require('crypto');var jsforce=require(_0x3636('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3636('0xb'));var querystring=require(_0x3636('0x10'));var Papa=require(_0x3636('0x11'));var Redis=require(_0x3636('0x12'));var qs=require(_0x3636('0x13'));var logger=require(_0x3636('0x14'))(_0x3636('0x15'));var utils=require(_0x3636('0x16'));var config=require(_0x3636('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e1c4c,_0xa3db7b){_0xa3db7b=_0xa3db7b||0xcc;return function(_0x5100d5){if(_0x5100d5){return _0x5e1c4c[_0x3636('0x18')](_0xa3db7b);}return _0x5e1c4c[_0x3636('0x19')](_0xa3db7b)[_0x3636('0x1a')]();};}function respondWithResult(_0x13ca35,_0xfcfee7){_0xfcfee7=_0xfcfee7||0xc8;return function(_0x319cd7){if(_0x319cd7){return _0x13ca35[_0x3636('0x19')](_0xfcfee7)[_0x3636('0x1b')](_0x319cd7);}};}function respondWithFilteredResult(_0x3295ab,_0x7b4b16){return function(_0x102f90){if(_0x102f90){var _0xaacadb=_0x102f90[_0x3636('0x1c')],_0xcb2aa3=_0x7b4b16[_0x3636('0x1d')],_0x3fc712=_0x7b4b16['offset']+_0x7b4b16[_0x3636('0x1e')],_0x23cc34;if(_0x3fc712>=_0xaacadb){_0x3fc712=_0xaacadb;_0x23cc34=0xc8;}else{_0x23cc34=0xce;}_0x3295ab[_0x3636('0x19')](_0x23cc34);return _0x3295ab['set'](_0x3636('0x1f'),_0xcb2aa3+'-'+_0x3fc712+'/'+_0xaacadb)['json'](_0x102f90);}return null;};}function patchUpdates(_0x5e85f2){return function(_0xae6469){try{jsonpatch[_0x3636('0x20')](_0xae6469,_0x5e85f2,!![]);}catch(_0xdba761){return BPromise[_0x3636('0x21')](_0xdba761);}return _0xae6469[_0x3636('0x22')]();};}function saveUpdates(_0x39e367,_0xa2b8fe){return function(_0x122aae){if(_0x122aae){return _0x122aae['update'](_0x39e367)['then'](function(_0x316930){return _0x316930;});}return null;};}function removeEntity(_0x34a975,_0x42b271){return function(_0x587780){if(_0x587780){return _0x587780[_0x3636('0x23')]()[_0x3636('0x24')](function(){var _0x15a0b3=_0x587780[_0x3636('0x25')]({'plain':!![]});var _0x325dce=_0x3636('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x325dce,'resourceId':_0x15a0b3['id']}})[_0x3636('0x24')](function(){return _0x587780;});})['then'](function(){_0x34a975['status'](0xcc)[_0x3636('0x1a')]();});}};}function handleEntityNotFound(_0x57f7c6,_0x4182b7){return function(_0x4c24cf){if(!_0x4c24cf){_0x57f7c6[_0x3636('0x18')](0x194);}return _0x4c24cf;};}function handleError(_0x477c34,_0xbf9a67){_0xbf9a67=_0xbf9a67||0x1f4;return function(_0x201ea1){logger[_0x3636('0x27')](_0x201ea1[_0x3636('0x28')]);if(_0x201ea1[_0x3636('0x29')]){delete _0x201ea1[_0x3636('0x29')];}_0x477c34[_0x3636('0x19')](_0xbf9a67)[_0x3636('0x2a')](_0x201ea1);};}exports[_0x3636('0x2b')]=function(_0x550443,_0x43811e){var _0x236f54={},_0x2d644c={},_0x22b12f={'count':0x0,'rows':[]};var _0xd37c62=db[_0x3636('0x2c')]['rawAttributes'];_0x2d644c[_0x3636('0x2d')]=_[_0x3636('0x2e')](_0xd37c62);var _0x5ce0ee={'dateStart':_0x550443[_0x3636('0x2f')][_0x3636('0x30')],'dateEnd':_0x550443[_0x3636('0x2f')][_0x3636('0x31')]};delete _0x550443[_0x3636('0x2f')]['dateStart'];delete _0x550443[_0x3636('0x2f')][_0x3636('0x31')];_0x2d644c[_0x3636('0x2f')]=_[_0x3636('0x2e')](_0x550443[_0x3636('0x2f')]);_0x2d644c[_0x3636('0x32')]=_[_0x3636('0x33')](_0x2d644c[_0x3636('0x2d')],_0x2d644c[_0x3636('0x2f')]);_0x236f54['attributes']=_['intersection'](_0x2d644c[_0x3636('0x2d')],qs['fields'](_0x550443['query'][_0x3636('0x34')]));_0x236f54[_0x3636('0x35')]=_0x236f54[_0x3636('0x35')]['length']?_0x236f54[_0x3636('0x35')]:_0x2d644c[_0x3636('0x2d')];if(!_0x550443[_0x3636('0x2f')][_0x3636('0x36')](_0x3636('0x37'))){_0x236f54[_0x3636('0x1e')]=qs[_0x3636('0x1e')](_0x550443[_0x3636('0x2f')][_0x3636('0x1e')]);_0x236f54[_0x3636('0x1d')]=qs[_0x3636('0x1d')](_0x550443[_0x3636('0x2f')][_0x3636('0x1d')]);}_0x236f54['order']=qs[_0x3636('0x38')](_0x550443[_0x3636('0x2f')][_0x3636('0x38')]);_0x236f54[_0x3636('0x39')]=qs['filters'](_['pick'](_0x550443[_0x3636('0x2f')],_0x2d644c[_0x3636('0x32')]));if(_0x5ce0ee[_0x3636('0x30')]){if(_0x5ce0ee['dateEnd']){_0x5ce0ee[_0x3636('0x31')]=moment(_0x5ce0ee[_0x3636('0x31')])['add'](0x1,'day');}else{_0x5ce0ee[_0x3636('0x31')]=moment(_0x5ce0ee['dateStart'])[_0x3636('0x3a')](0x1,_0x3636('0x3b'));}_[_0x3636('0x3c')](_0x236f54[_0x3636('0x39')],{'createdAt':{'$gte':_0x5ce0ee[_0x3636('0x30')],'$lte':_0x5ce0ee[_0x3636('0x31')]}});}if(_0x550443[_0x3636('0x2f')][_0x3636('0x3d')]){_0x236f54[_0x3636('0x39')]=_['merge'](_0x236f54[_0x3636('0x39')],{'$or':_[_0x3636('0x3e')](_0xd37c62,function(_0x261f67){if(_0x261f67[_0x3636('0x3f')][_0x3636('0x40')]!==_0x3636('0x41')){var _0x28d6fb={};_0x28d6fb[_0x261f67[_0x3636('0x42')]]={'$like':'%'+_0x550443[_0x3636('0x2f')]['filter']+'%'};return _0x28d6fb;}})});}_0x236f54=_[_0x3636('0x3c')]({},_0x236f54,_0x550443[_0x3636('0x43')]);var _0xfb3438={'where':_0x236f54[_0x3636('0x39')]};return db[_0x3636('0x2c')][_0x3636('0x1c')](_0xfb3438)[_0x3636('0x24')](function(_0x401281){_0x22b12f[_0x3636('0x1c')]=_0x401281;if(_0x550443[_0x3636('0x2f')][_0x3636('0x44')]){_0x236f54[_0x3636('0x45')]=[{'all':!![]}];}return db[_0x3636('0x2c')][_0x3636('0x46')](_0x236f54);})[_0x3636('0x24')](function(_0x534a73){_0x22b12f[_0x3636('0x47')]=_0x534a73;return _0x22b12f;})[_0x3636('0x24')](respondWithFilteredResult(_0x43811e,_0x236f54))[_0x3636('0x48')](handleError(_0x43811e,null));};exports[_0x3636('0x49')]=function(_0x92a1b4,_0x453df3){var _0x1f2dc6={'raw':![],'where':{'id':_0x92a1b4[_0x3636('0x4a')]['id']}},_0x402a98={};_0x402a98[_0x3636('0x2d')]=_[_0x3636('0x2e')](db[_0x3636('0x2c')][_0x3636('0x4b')]);_0x402a98['query']=_['keys'](_0x92a1b4['query']);_0x402a98[_0x3636('0x32')]=_['intersection'](_0x402a98['model'],_0x402a98[_0x3636('0x2f')]);_0x1f2dc6[_0x3636('0x35')]=_[_0x3636('0x33')](_0x402a98['model'],qs[_0x3636('0x34')](_0x92a1b4[_0x3636('0x2f')][_0x3636('0x34')]));_0x1f2dc6[_0x3636('0x35')]=_0x1f2dc6[_0x3636('0x35')][_0x3636('0x4c')]?_0x1f2dc6[_0x3636('0x35')]:_0x402a98[_0x3636('0x2d')];if(_0x92a1b4[_0x3636('0x2f')]['includeAll']){_0x1f2dc6[_0x3636('0x45')]=[{'all':!![]}];}_0x1f2dc6=_[_0x3636('0x3c')]({},_0x1f2dc6,_0x92a1b4[_0x3636('0x43')]);return db[_0x3636('0x2c')][_0x3636('0x4d')](_0x1f2dc6)[_0x3636('0x24')](handleEntityNotFound(_0x453df3,null))['then'](respondWithResult(_0x453df3,null))[_0x3636('0x48')](handleError(_0x453df3,null));};exports[_0x3636('0x4e')]=function(_0x2c8543,_0x1595ea){return db[_0x3636('0x2c')]['create'](_0x2c8543[_0x3636('0x4f')],{})[_0x3636('0x24')](function(_0xa61651){var _0x61522d=_0x2c8543[_0x3636('0x50')]['get']({'plain':!![]});if(!_0x61522d)throw new Error(_0x3636('0x51'));if(_0x61522d['role']==='user'){var _0x2f2b0c=_0xa61651[_0x3636('0x25')]({'plain':!![]});var _0x2575ba=_0x3636('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x2575ba,'userProfileId':_0x61522d[_0x3636('0x52')]},'raw':!![]})[_0x3636('0x24')](function(_0x40367c){if(_0x40367c&&_0x40367c[_0x3636('0x53')]===0x0){return db[_0x3636('0x54')][_0x3636('0x4e')]({'name':_0x2f2b0c['name'],'resourceId':_0x2f2b0c['id'],'type':_0x40367c[_0x3636('0x29')],'sectionId':_0x40367c['id']},{})[_0x3636('0x24')](function(){return _0xa61651;});}else{return _0xa61651;}})[_0x3636('0x48')](function(_0x433fbf){logger[_0x3636('0x27')](_0x3636('0x55'),_0x433fbf);throw _0x433fbf;});}return _0xa61651;})[_0x3636('0x24')](respondWithResult(_0x1595ea,0xc9))[_0x3636('0x48')](handleError(_0x1595ea,null));};exports['update']=function(_0xa195a5,_0x5b2b74){if(_0xa195a5[_0x3636('0x4f')]['id']){delete _0xa195a5['body']['id'];}return db[_0x3636('0x2c')][_0x3636('0x4d')]({'where':{'id':_0xa195a5[_0x3636('0x4a')]['id']}})[_0x3636('0x24')](handleEntityNotFound(_0x5b2b74,null))[_0x3636('0x24')](saveUpdates(_0xa195a5[_0x3636('0x4f')],null))['then'](respondWithResult(_0x5b2b74,null))[_0x3636('0x48')](handleError(_0x5b2b74,null));};exports['destroy']=function(_0x10db7e,_0x449657){return db[_0x3636('0x2c')][_0x3636('0x4d')]({'where':{'id':_0x10db7e['params']['id']}})[_0x3636('0x24')](handleEntityNotFound(_0x449657,null))[_0x3636('0x24')](removeEntity(_0x449657,null))[_0x3636('0x48')](handleError(_0x449657,null));};
\ No newline at end of file
index 3f1dd9f..fee3235 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c11=['%s%s','prefix','push','record','${UNIQUEID}.%s,ab','auth','merge','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','internal','name','concat','findAll','agent','then','catch','exports','models','define','length','VoiceExtension','bulkCreate','destroy','util','bluebird','api','./voiceChanSpy.attributes','from-sip','system','format'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0x0c11,0xee));var _0x10c1=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x0c11[_0x439d59];return _0x3670c7;};'use strict';var _=require('lodash');var util=require(_0x10c1('0x0'));var BPromise=require(_0x10c1('0x1'));var logger=require('../../config/logger')(_0x10c1('0x2'));var attributes=require(_0x10c1('0x3'));var getUserApplications=function(_0x51cae7,_0x219256,_0x376edd){var _0x256d32=0x1;var _0x4dc474=[];var _0x1c6826={'context':_0x10c1('0x4'),'type':_0x10c1('0x5'),'isApp':![]};var _0x1f1a18={'exten':util[_0x10c1('0x6')](_0x10c1('0x7'),_0x51cae7[_0x10c1('0x8')],_0x376edd),'ChanSpyId':_0x51cae7['id'],'UserId':_0x219256['id']};_0x4dc474[_0x10c1('0x9')](_['merge']({'app':'Set','appdata':util[_0x10c1('0x6')]('CDR(type)=%s','chanspy'),'priority':_0x256d32++},_0x1c6826,_0x1f1a18));if(_0x51cae7[_0x10c1('0xa')]){_0x4dc474[_0x10c1('0x9')](_['merge']({'app':'MixMonitor','appdata':util['format'](_0x10c1('0xb'),_0x51cae7['recordingFormat']),'priority':_0x256d32++},_0x1c6826,_0x1f1a18));}if(_0x51cae7[_0x10c1('0xc')]){_0x4dc474[_0x10c1('0x9')](_[_0x10c1('0xd')]({'app':_0x10c1('0xe'),'appdata':_0x51cae7[_0x10c1('0xf')],'priority':_0x256d32++},_0x1c6826,_0x1f1a18));}_0x4dc474['push'](_[_0x10c1('0xd')]({'app':_0x10c1('0x10'),'appdata':util[_0x10c1('0x6')](_0x10c1('0x11'),_0x219256['name'],_0x51cae7[_0x10c1('0x12')]?_0x51cae7[_0x10c1('0x12')][_0x10c1('0x13')](''):''),'priority':_0x256d32++},_0x1c6826,_0x1f1a18));if(_0x51cae7[_0x10c1('0xa')]){_0x4dc474[_0x10c1('0x9')](_['merge']({'app':_0x10c1('0x14'),'priority':_0x256d32++},_0x1c6826,_0x1f1a18));}return _0x4dc474;};var getChanSpyApplications=function(_0x421037,_0x1eef62){var _0x335b1d=[];for(var _0x4574cf=0x0,_0x22fb2c=0x1;_0x4574cf<_0x1eef62['length'];_0x4574cf++,_0x22fb2c=0x1){var _0x1ec5ff=getUserApplications(_0x421037,_0x1eef62[_0x4574cf],_0x1eef62[_0x4574cf][_0x10c1('0x15')]);var _0x24e35f=getUserApplications(_0x421037,_0x1eef62[_0x4574cf],_0x1eef62[_0x4574cf][_0x10c1('0x16')]);_0x335b1d=_0x335b1d[_0x10c1('0x17')](_0x1ec5ff,_0x24e35f);}return _0x335b1d;};var getChanSpyPromise=function(_0x201b58,_0x3af5d2){return new BPromise(function(_0x1c7581,_0x59ec47){return _0x201b58['User'][_0x10c1('0x18')]({'attributes':['id',_0x10c1('0x16'),_0x10c1('0x15')],'where':{'role':_0x10c1('0x19'),'chanspy':!![]},'raw':!![]})[_0x10c1('0x1a')](function(_0x161107){if(_0x161107){return _0x1c7581(getChanSpyApplications(_0x3af5d2,_0x161107));}return _0x1c7581([]);})[_0x10c1('0x1b')](function(_0x42c0f5){_0x59ec47(_0x42c0f5);});});};module[_0x10c1('0x1c')]=function(_0x533200,_0x54aeee){var _0x804bc1=_0x533200[_0x10c1('0x1d')];return _0x533200[_0x10c1('0x1e')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xa7b847,_0x447b98,_0x12c432){return getChanSpyPromise(_0x804bc1,_0xa7b847)[_0x10c1('0x1a')](function(_0x245642){if(_0x245642&&_0x245642[_0x10c1('0x1f')]){return _0x804bc1[_0x10c1('0x20')][_0x10c1('0x21')](_0x245642);}})[_0x10c1('0x1a')](function(){_0x12c432();})['catch'](function(_0x1110ad){_0x12c432(_0x1110ad);});},'afterUpdate':function(_0x2e4c58,_0x300721,_0x4529a5){return _0x804bc1['VoiceExtension'][_0x10c1('0x22')]({'where':{'ChanSpyId':_0x2e4c58['id']}})[_0x10c1('0x1a')](function(){return getChanSpyPromise(_0x804bc1,_0x2e4c58);})['then'](function(_0xe36f20){if(_0xe36f20&&_0xe36f20[_0x10c1('0x1f')]){return _0x804bc1[_0x10c1('0x20')][_0x10c1('0x21')](_0xe36f20);}})[_0x10c1('0x1a')](function(){_0x4529a5();})[_0x10c1('0x1b')](function(_0x34a11c){_0x4529a5(_0x34a11c);});},'afterDestroy':function(_0x30a288,_0x53d51d,_0x4cbf3e){return _0x804bc1[_0x10c1('0x20')][_0x10c1('0x22')]({'where':{'ChanSpyId':_0x30a288['id']}})[_0x10c1('0x1a')](function(){_0x4cbf3e();})[_0x10c1('0x1b')](function(_0x4f08b3){_0x4cbf3e(_0x4f08b3);});}}});};
\ No newline at end of file
+var _0xb501=['prefix','push','merge','chanspy','record','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','options','StopMixMonitor','length','internal','name','User','findAll','agent','then','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','catch','VoiceExtension','destroy','lodash','util','bluebird','../../config/logger','api','from-sip','system','format','%s%s'];(function(_0x258c94,_0x28f8bb){var _0xb82932=function(_0x17d248){while(--_0x17d248){_0x258c94['push'](_0x258c94['shift']());}};_0xb82932(++_0x28f8bb);}(_0xb501,0x1ef));var _0x1b50=function(_0xcf98bf,_0x285bcd){_0xcf98bf=_0xcf98bf-0x0;var _0x417159=_0xb501[_0xcf98bf];return _0x417159;};'use strict';var _=require(_0x1b50('0x0'));var util=require(_0x1b50('0x1'));var BPromise=require(_0x1b50('0x2'));var logger=require(_0x1b50('0x3'))(_0x1b50('0x4'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x32724b,_0x2cf79c,_0xaf983d){var _0x51b1de=0x1;var _0x3db6c4=[];var _0x3fd52b={'context':_0x1b50('0x5'),'type':_0x1b50('0x6'),'isApp':![]};var _0x85f603={'exten':util[_0x1b50('0x7')](_0x1b50('0x8'),_0x32724b[_0x1b50('0x9')],_0xaf983d),'ChanSpyId':_0x32724b['id'],'UserId':_0x2cf79c['id']};_0x3db6c4[_0x1b50('0xa')](_[_0x1b50('0xb')]({'app':'Set','appdata':util[_0x1b50('0x7')]('CDR(type)=%s',_0x1b50('0xc')),'priority':_0x51b1de++},_0x3fd52b,_0x85f603));if(_0x32724b[_0x1b50('0xd')]){_0x3db6c4[_0x1b50('0xa')](_[_0x1b50('0xb')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,ab',_0x32724b[_0x1b50('0xe')]),'priority':_0x51b1de++},_0x3fd52b,_0x85f603));}if(_0x32724b['auth']){_0x3db6c4[_0x1b50('0xa')](_[_0x1b50('0xb')]({'app':_0x1b50('0xf'),'appdata':_0x32724b[_0x1b50('0x10')],'priority':_0x51b1de++},_0x3fd52b,_0x85f603));}_0x3db6c4['push'](_['merge']({'app':_0x1b50('0x11'),'appdata':util[_0x1b50('0x7')](_0x1b50('0x12'),_0x2cf79c['name'],_0x32724b[_0x1b50('0x13')]?_0x32724b['options']['join'](''):''),'priority':_0x51b1de++},_0x3fd52b,_0x85f603));if(_0x32724b[_0x1b50('0xd')]){_0x3db6c4[_0x1b50('0xa')](_[_0x1b50('0xb')]({'app':_0x1b50('0x14'),'priority':_0x51b1de++},_0x3fd52b,_0x85f603));}return _0x3db6c4;};var getChanSpyApplications=function(_0x148af8,_0x30890d){var _0x3aa5e2=[];for(var _0x2b4717=0x0,_0x52a3bd=0x1;_0x2b4717<_0x30890d[_0x1b50('0x15')];_0x2b4717++,_0x52a3bd=0x1){var _0xc9b1e6=getUserApplications(_0x148af8,_0x30890d[_0x2b4717],_0x30890d[_0x2b4717][_0x1b50('0x16')]);var _0x4f476d=getUserApplications(_0x148af8,_0x30890d[_0x2b4717],_0x30890d[_0x2b4717][_0x1b50('0x17')]);_0x3aa5e2=_0x3aa5e2['concat'](_0xc9b1e6,_0x4f476d);}return _0x3aa5e2;};var getChanSpyPromise=function(_0x53bd48,_0x1b185d){return new BPromise(function(_0x1ad360,_0x1006e7){return _0x53bd48[_0x1b50('0x18')][_0x1b50('0x19')]({'attributes':['id',_0x1b50('0x17'),'internal'],'where':{'role':_0x1b50('0x1a'),'chanspy':!![]},'raw':!![]})[_0x1b50('0x1b')](function(_0x1b6dd6){if(_0x1b6dd6){return _0x1ad360(getChanSpyApplications(_0x1b185d,_0x1b6dd6));}return _0x1ad360([]);})['catch'](function(_0x45f400){_0x1006e7(_0x45f400);});});};module['exports']=function(_0x3b3315,_0x1f98ea){var _0x310555=_0x3b3315[_0x1b50('0x1c')];return _0x3b3315[_0x1b50('0x1d')](_0x1b50('0x1e'),attributes,{'tableName':_0x1b50('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x16f68d,_0x469adf,_0xc7a6dc){return getChanSpyPromise(_0x310555,_0x16f68d)[_0x1b50('0x1b')](function(_0x5ba785){if(_0x5ba785&&_0x5ba785['length']){return _0x310555['VoiceExtension'][_0x1b50('0x20')](_0x5ba785);}})[_0x1b50('0x1b')](function(){_0xc7a6dc();})[_0x1b50('0x21')](function(_0x2257a2){_0xc7a6dc(_0x2257a2);});},'afterUpdate':function(_0x42eb02,_0x364269,_0x3e2e0b){return _0x310555[_0x1b50('0x22')][_0x1b50('0x23')]({'where':{'ChanSpyId':_0x42eb02['id']}})[_0x1b50('0x1b')](function(){return getChanSpyPromise(_0x310555,_0x42eb02);})['then'](function(_0x24ff40){if(_0x24ff40&&_0x24ff40[_0x1b50('0x15')]){return _0x310555[_0x1b50('0x22')]['bulkCreate'](_0x24ff40);}})[_0x1b50('0x1b')](function(){_0x3e2e0b();})[_0x1b50('0x21')](function(_0x2571be){_0x3e2e0b(_0x2571be);});},'afterDestroy':function(_0x212654,_0x7da05c,_0xef5b13){return _0x310555[_0x1b50('0x22')][_0x1b50('0x23')]({'where':{'ChanSpyId':_0x212654['id']}})[_0x1b50('0x1b')](function(){_0xef5b13();})[_0x1b50('0x21')](function(_0x458294){_0xef5b13(_0x458294);});}}});};
\ No newline at end of file
index bf4bc94..df26631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc73=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc73,0x1e5));var _0x3fc7=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xfc73[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var moment=require('moment');var BPromise=require(_0x3fc7('0x2'));var rs=require(_0x3fc7('0x3'));var fs=require('fs');var Redis=require(_0x3fc7('0x4'));var db=require(_0x3fc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3fc7('0x6'));var config=require(_0x3fc7('0x7'));var jayson=require(_0x3fc7('0x8'));var client=jayson[_0x3fc7('0x9')][_0x3fc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34b33b,_0x5f069e,_0x34d90f){return new BPromise(function(_0x56de64,_0x2211c9){return client[_0x3fc7('0xb')](_0x34b33b,_0x34d90f)[_0x3fc7('0xc')](function(_0x1acda9){logger[_0x3fc7('0xd')](_0x3fc7('0xe'),_0x5f069e,_0x3fc7('0xf'));logger[_0x3fc7('0x10')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x5f069e,_0x3fc7('0xf'),JSON['stringify'](_0x1acda9));if(_0x1acda9[_0x3fc7('0x11')]){if(_0x1acda9['error'][_0x3fc7('0x12')]===0x1f4){logger[_0x3fc7('0x11')](_0x3fc7('0xe'),_0x5f069e,_0x1acda9['error'][_0x3fc7('0x13')]);return _0x2211c9(_0x1acda9[_0x3fc7('0x11')][_0x3fc7('0x13')]);}logger['error'](_0x3fc7('0xe'),_0x5f069e,_0x1acda9[_0x3fc7('0x11')]['message']);return _0x56de64(_0x1acda9['error'][_0x3fc7('0x13')]);}else{logger[_0x3fc7('0xd')](_0x3fc7('0xe'),_0x5f069e,_0x3fc7('0xf'));_0x56de64(_0x1acda9[_0x3fc7('0x14')]['message']);}})[_0x3fc7('0x15')](function(_0x3d9e5b){logger[_0x3fc7('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x5f069e,_0x3d9e5b);_0x2211c9(_0x3d9e5b);});});}
\ No newline at end of file
+var _0x4a9a=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4a9a,0x164));var _0xa4a9=function(_0x4b7fc5,_0x2040f5){_0x4b7fc5=_0x4b7fc5-0x0;var _0x32c59a=_0x4a9a[_0x4b7fc5];return _0x32c59a;};'use strict';var _=require(_0xa4a9('0x0'));var util=require(_0xa4a9('0x1'));var moment=require(_0xa4a9('0x2'));var BPromise=require(_0xa4a9('0x3'));var rs=require(_0xa4a9('0x4'));var fs=require('fs');var Redis=require(_0xa4a9('0x5'));var db=require(_0xa4a9('0x6'))['db'];var utils=require(_0xa4a9('0x7'));var logger=require(_0xa4a9('0x8'))(_0xa4a9('0x9'));var config=require(_0xa4a9('0xa'));var jayson=require(_0xa4a9('0xb'));var client=jayson[_0xa4a9('0xc')][_0xa4a9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3446bc,_0x40cbd3,_0xade4b6){return new BPromise(function(_0x4068b8,_0xf214d7){return client[_0xa4a9('0xe')](_0x3446bc,_0xade4b6)[_0xa4a9('0xf')](function(_0x41e462){logger[_0xa4a9('0x10')](_0xa4a9('0x11'),_0x40cbd3,_0xa4a9('0x12'));logger[_0xa4a9('0x13')](_0xa4a9('0x14'),_0x40cbd3,'request\x20sent',JSON[_0xa4a9('0x15')](_0x41e462));if(_0x41e462['error']){if(_0x41e462[_0xa4a9('0x16')][_0xa4a9('0x17')]===0x1f4){logger['error'](_0xa4a9('0x11'),_0x40cbd3,_0x41e462['error'][_0xa4a9('0x18')]);return _0xf214d7(_0x41e462[_0xa4a9('0x16')][_0xa4a9('0x18')]);}logger[_0xa4a9('0x16')](_0xa4a9('0x11'),_0x40cbd3,_0x41e462[_0xa4a9('0x16')][_0xa4a9('0x18')]);return _0x4068b8(_0x41e462[_0xa4a9('0x16')][_0xa4a9('0x18')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x40cbd3,_0xa4a9('0x12'));_0x4068b8(_0x41e462[_0xa4a9('0x19')][_0xa4a9('0x18')]);}})[_0xa4a9('0x1a')](function(_0x1b4b3f){logger[_0xa4a9('0x16')]('VoiceChanSpy,\x20%s,\x20%s',_0x40cbd3,_0x1b4b3f);_0xf214d7(_0x1b4b3f);});});}
\ No newline at end of file
index 6a3ff76..35c517e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8cb=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','index','get','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path'];(function(_0x5b47cb,_0x21cfc4){var _0x1e615b=function(_0xd18fb){while(--_0xd18fb){_0x5b47cb['push'](_0x5b47cb['shift']());}};_0x1e615b(++_0x21cfc4);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x45154d,_0x8474d7){_0x45154d=_0x45154d-0x0;var _0x462db8=_0xb8cb[_0x45154d];return _0x462db8;};'use strict';var multer=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var path=require(_0xbb8c('0x2'));var timeout=require(_0xbb8c('0x3'));var express=require(_0xbb8c('0x4'));var router=express[_0xbb8c('0x5')]();var auth=require(_0xbb8c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb8c('0x7'));var controller=require(_0xbb8c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb8c('0x9')]);router[_0xbb8c('0xa')](_0xbb8c('0xb'),auth['isAuthenticated'](),controller[_0xbb8c('0xc')]);router[_0xbb8c('0xd')]('/',auth[_0xbb8c('0xe')](),controller[_0xbb8c('0xf')]);router[_0xbb8c('0x10')](_0xbb8c('0xb'),auth[_0xbb8c('0xe')](),controller[_0xbb8c('0x11')]);router[_0xbb8c('0x12')](_0xbb8c('0xb'),auth[_0xbb8c('0xe')](),controller[_0xbb8c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x93e9=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceContext.controller','get','isAuthenticated','index','/:id'];(function(_0x5f4b6e,_0x496dce){var _0x50be49=function(_0x545c98){while(--_0x545c98){_0x5f4b6e['push'](_0x5f4b6e['shift']());}};_0x50be49(++_0x496dce);}(_0x93e9,0xcc));var _0x993e=function(_0x83b3d3,_0x2db9c4){_0x83b3d3=_0x83b3d3-0x0;var _0x2409f9=_0x93e9[_0x83b3d3];return _0x2409f9;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var auth=require(_0x993e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x993e('0x7'));router[_0x993e('0x8')]('/',auth[_0x993e('0x9')](),controller[_0x993e('0xa')]);router[_0x993e('0x8')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xc')]);router['post']('/',auth[_0x993e('0x9')](),controller[_0x993e('0xd')]);router[_0x993e('0xe')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xf')]);router[_0x993e('0x10')]('/:id',auth[_0x993e('0x9')](),controller[_0x993e('0x11')]);module['exports']=router;
\ No newline at end of file
index f17873b..ae8f68a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a85=['BOOLEAN','exports','name','STRING'];(function(_0x7846d3,_0x338a67){var _0x8041a6=function(_0x2dd003){while(--_0x2dd003){_0x7846d3['push'](_0x7846d3['shift']());}};_0x8041a6(++_0x338a67);}(_0x2a85,0x171));var _0x52a8=function(_0x445c8b,_0x34f554){_0x445c8b=_0x445c8b-0x0;var _0x4b1011=_0x2a85[_0x445c8b];return _0x4b1011;};'use strict';var Sequelize=require('sequelize');module[_0x52a8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x52a8('0x1')},'description':{'type':Sequelize[_0x52a8('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x52a8('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0e9a=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0e9a,0x142));var _0xa0e9=function(_0x2292ff,_0x134b90){_0x2292ff=_0x2292ff-0x0;var _0x4004af=_0x0e9a[_0x2292ff];return _0x4004af;};'use strict';var Sequelize=require(_0xa0e9('0x0'));module[_0xa0e9('0x1')]={'name':{'type':Sequelize[_0xa0e9('0x2')],'unique':_0xa0e9('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa0e9('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index bf6c281..4f1fa7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cd6=['add','day','merge','where','filter','type','VIRTUAL','field','options','VoiceContext','count','findAll','rows','params','includeAll','include','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','querystring','ioredis','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','limit','json','reject','save','update','destroy','get','Contexts','end','name','index','rawAttributes','model','keys','query','dateStart','dateEnd','intersection','attributes','fields','hasOwnProperty','order','sort','filters'];(function(_0x1c3be6,_0x39bb99){var _0x25a7d1=function(_0x222bbf){while(--_0x222bbf){_0x1c3be6['push'](_0x1c3be6['shift']());}};_0x25a7d1(++_0x39bb99);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x4bfb35,_0x472fed){_0x4bfb35=_0x4bfb35-0x0;var _0x22a404=_0x7cd6[_0x4bfb35];return _0x22a404;};'use strict';var pdf=require(_0x67cd('0x0'));var emlformat=require(_0x67cd('0x1'));var rimraf=require(_0x67cd('0x2'));var zipdir=require(_0x67cd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x67cd('0x4'));var BPromise=require(_0x67cd('0x5'));var Mustache=require(_0x67cd('0x6'));var util=require('util');var path=require(_0x67cd('0x7'));var sox=require('sox');var csv=require(_0x67cd('0x8'));var ejs=require(_0x67cd('0x9'));var fs=require('fs');var _=require(_0x67cd('0xa'));var squel=require(_0x67cd('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67cd('0x8'));var querystring=require(_0x67cd('0xc'));var Papa=require('papaparse');var Redis=require(_0x67cd('0xd'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var utils=require(_0x67cd('0xe'));var config=require(_0x67cd('0xf'));var db=require(_0x67cd('0x10'))['db'];var jayson=require(_0x67cd('0x11'));var client=jayson[_0x67cd('0x12')][_0x67cd('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x478ad8,_0x2a0a05,_0x39c6ca,_0x1693d7){return new BPromise(function(_0xc61879,_0x20645c){var _0x2ab0e7=_0x1693d7||client;return _0x2ab0e7[_0x67cd('0x14')](_0x478ad8,_0x39c6ca)[_0x67cd('0x15')](function(_0x15da7d){logger[_0x67cd('0x16')](_0x67cd('0x17'),_0x2a0a05,_0x67cd('0x18'));logger['debug'](_0x67cd('0x19'),_0x2a0a05,_0x67cd('0x18'),JSON[_0x67cd('0x1a')](_0x15da7d));if(_0x15da7d[_0x67cd('0x1b')]){if(_0x15da7d[_0x67cd('0x1b')]['code']===0x1f4){logger[_0x67cd('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x2a0a05,_0x15da7d[_0x67cd('0x1b')]['message']);return _0x20645c(_0x15da7d['error']['message']);}logger[_0x67cd('0x1b')](_0x67cd('0x17'),_0x2a0a05,_0x15da7d[_0x67cd('0x1b')][_0x67cd('0x1c')]);return _0xc61879(_0x15da7d[_0x67cd('0x1b')][_0x67cd('0x1c')]);}else{logger[_0x67cd('0x16')](_0x67cd('0x17'),_0x2a0a05,_0x67cd('0x18'));_0xc61879(_0x15da7d[_0x67cd('0x1d')]['message']);}})[_0x67cd('0x1e')](function(_0x145c7f){logger[_0x67cd('0x1b')](_0x67cd('0x17'),_0x2a0a05,_0x145c7f);_0x20645c(_0x145c7f);});});}function respondWithStatusCode(_0x512760,_0x48b1ec){_0x48b1ec=_0x48b1ec||0xcc;return function(_0x3bb52e){if(_0x3bb52e){return _0x512760[_0x67cd('0x1f')](_0x48b1ec);}return _0x512760[_0x67cd('0x20')](_0x48b1ec)['end']();};}function respondWithResult(_0x2230c1,_0x38ddf2){_0x38ddf2=_0x38ddf2||0xc8;return function(_0x4ecad0){if(_0x4ecad0){return _0x2230c1[_0x67cd('0x20')](_0x38ddf2)['json'](_0x4ecad0);}};}function respondWithFilteredResult(_0x6b9e7,_0x3958bc){return function(_0xbd0ca7){if(_0xbd0ca7){var _0x3a1caf=_0xbd0ca7['count'],_0x128a7f=_0x3958bc[_0x67cd('0x21')],_0x4d6ee1=_0x3958bc[_0x67cd('0x21')]+_0x3958bc[_0x67cd('0x22')],_0x9c9b8a;if(_0x4d6ee1>=_0x3a1caf){_0x4d6ee1=_0x3a1caf;_0x9c9b8a=0xc8;}else{_0x9c9b8a=0xce;}_0x6b9e7[_0x67cd('0x20')](_0x9c9b8a);return _0x6b9e7['set']('Content-Range',_0x128a7f+'-'+_0x4d6ee1+'/'+_0x3a1caf)[_0x67cd('0x23')](_0xbd0ca7);}return null;};}function patchUpdates(_0x185308){return function(_0x1b905e){try{jsonpatch['apply'](_0x1b905e,_0x185308,!![]);}catch(_0x56ff0a){return BPromise[_0x67cd('0x24')](_0x56ff0a);}return _0x1b905e[_0x67cd('0x25')]();};}function saveUpdates(_0x3aa655,_0x3868af){return function(_0x49e1e2){if(_0x49e1e2){return _0x49e1e2[_0x67cd('0x26')](_0x3aa655)[_0x67cd('0x15')](function(_0x331aba){return _0x331aba;});}return null;};}function removeEntity(_0x554566,_0x505718){return function(_0x27422e){if(_0x27422e){return _0x27422e[_0x67cd('0x27')]()['then'](function(){var _0x3f3e00=_0x27422e[_0x67cd('0x28')]({'plain':!![]});var _0x3f3047=_0x67cd('0x29');return db['UserProfileResource'][_0x67cd('0x27')]({'where':{'type':_0x3f3047,'resourceId':_0x3f3e00['id']}})[_0x67cd('0x15')](function(){return _0x27422e;});})[_0x67cd('0x15')](function(){_0x554566[_0x67cd('0x20')](0xcc)[_0x67cd('0x2a')]();});}};}function handleEntityNotFound(_0xa3b704,_0x171937){return function(_0x40e16e){if(!_0x40e16e){_0xa3b704[_0x67cd('0x1f')](0x194);}return _0x40e16e;};}function handleError(_0x1c5f3e,_0x49c838){_0x49c838=_0x49c838||0x1f4;return function(_0x5bc5d9){logger[_0x67cd('0x1b')](_0x5bc5d9['stack']);if(_0x5bc5d9[_0x67cd('0x2b')]){delete _0x5bc5d9[_0x67cd('0x2b')];}_0x1c5f3e[_0x67cd('0x20')](_0x49c838)['send'](_0x5bc5d9);};}exports[_0x67cd('0x2c')]=function(_0xf7934e,_0x4d837d){var _0x5d7514={},_0x5dace0={},_0x4b2572={'count':0x0,'rows':[]};var _0x244a35=db['VoiceContext'][_0x67cd('0x2d')];_0x5dace0[_0x67cd('0x2e')]=_[_0x67cd('0x2f')](_0x244a35);var _0x4131b1={'dateStart':_0xf7934e[_0x67cd('0x30')][_0x67cd('0x31')],'dateEnd':_0xf7934e[_0x67cd('0x30')][_0x67cd('0x32')]};delete _0xf7934e['query'][_0x67cd('0x31')];delete _0xf7934e[_0x67cd('0x30')][_0x67cd('0x32')];_0x5dace0[_0x67cd('0x30')]=_[_0x67cd('0x2f')](_0xf7934e['query']);_0x5dace0['filters']=_[_0x67cd('0x33')](_0x5dace0[_0x67cd('0x2e')],_0x5dace0[_0x67cd('0x30')]);_0x5d7514[_0x67cd('0x34')]=_['intersection'](_0x5dace0['model'],qs[_0x67cd('0x35')](_0xf7934e[_0x67cd('0x30')][_0x67cd('0x35')]));_0x5d7514[_0x67cd('0x34')]=_0x5d7514[_0x67cd('0x34')]['length']?_0x5d7514[_0x67cd('0x34')]:_0x5dace0[_0x67cd('0x2e')];if(!_0xf7934e[_0x67cd('0x30')][_0x67cd('0x36')]('nolimit')){_0x5d7514[_0x67cd('0x22')]=qs[_0x67cd('0x22')](_0xf7934e[_0x67cd('0x30')][_0x67cd('0x22')]);_0x5d7514[_0x67cd('0x21')]=qs[_0x67cd('0x21')](_0xf7934e[_0x67cd('0x30')][_0x67cd('0x21')]);}_0x5d7514[_0x67cd('0x37')]=qs[_0x67cd('0x38')](_0xf7934e['query'][_0x67cd('0x38')]);_0x5d7514['where']=qs[_0x67cd('0x39')](_['pick'](_0xf7934e[_0x67cd('0x30')],_0x5dace0[_0x67cd('0x39')]));if(_0x4131b1[_0x67cd('0x31')]){if(_0x4131b1[_0x67cd('0x32')]){_0x4131b1[_0x67cd('0x32')]=moment(_0x4131b1[_0x67cd('0x32')])[_0x67cd('0x3a')](0x1,_0x67cd('0x3b'));}else{_0x4131b1[_0x67cd('0x32')]=moment(_0x4131b1[_0x67cd('0x31')])[_0x67cd('0x3a')](0x1,_0x67cd('0x3b'));}_[_0x67cd('0x3c')](_0x5d7514[_0x67cd('0x3d')],{'createdAt':{'$gte':_0x4131b1[_0x67cd('0x31')],'$lte':_0x4131b1['dateEnd']}});}if(_0xf7934e[_0x67cd('0x30')][_0x67cd('0x3e')]){_0x5d7514[_0x67cd('0x3d')]=_['merge'](_0x5d7514[_0x67cd('0x3d')],{'$or':_['map'](_0x244a35,function(_0x1c7d7e){if(_0x1c7d7e[_0x67cd('0x3f')]['key']!==_0x67cd('0x40')){var _0x1ff346={};_0x1ff346[_0x1c7d7e[_0x67cd('0x41')]]={'$like':'%'+_0xf7934e[_0x67cd('0x30')][_0x67cd('0x3e')]+'%'};return _0x1ff346;}})});}_0x5d7514=_[_0x67cd('0x3c')]({},_0x5d7514,_0xf7934e[_0x67cd('0x42')]);var _0x3a0a92={'where':_0x5d7514[_0x67cd('0x3d')]};return db[_0x67cd('0x43')]['count'](_0x3a0a92)[_0x67cd('0x15')](function(_0x591450){_0x4b2572[_0x67cd('0x44')]=_0x591450;if(_0xf7934e[_0x67cd('0x30')]['includeAll']){_0x5d7514['include']=[{'all':!![]}];}return db['VoiceContext'][_0x67cd('0x45')](_0x5d7514);})['then'](function(_0x564846){_0x4b2572[_0x67cd('0x46')]=_0x564846;return _0x4b2572;})[_0x67cd('0x15')](respondWithFilteredResult(_0x4d837d,_0x5d7514))['catch'](handleError(_0x4d837d,null));};exports['show']=function(_0x3cff64,_0x7c94ac){var _0x4eb7d8={'raw':![],'where':{'id':_0x3cff64[_0x67cd('0x47')]['id']}},_0x43e191={};_0x43e191[_0x67cd('0x2e')]=_[_0x67cd('0x2f')](db['VoiceContext'][_0x67cd('0x2d')]);_0x43e191['query']=_['keys'](_0x3cff64['query']);_0x43e191[_0x67cd('0x39')]=_[_0x67cd('0x33')](_0x43e191['model'],_0x43e191['query']);_0x4eb7d8[_0x67cd('0x34')]=_[_0x67cd('0x33')](_0x43e191[_0x67cd('0x2e')],qs[_0x67cd('0x35')](_0x3cff64[_0x67cd('0x30')][_0x67cd('0x35')]));_0x4eb7d8['attributes']=_0x4eb7d8[_0x67cd('0x34')]['length']?_0x4eb7d8[_0x67cd('0x34')]:_0x43e191[_0x67cd('0x2e')];if(_0x3cff64[_0x67cd('0x30')][_0x67cd('0x48')]){_0x4eb7d8[_0x67cd('0x49')]=[{'all':!![]}];}_0x4eb7d8=_[_0x67cd('0x3c')]({},_0x4eb7d8,_0x3cff64[_0x67cd('0x42')]);return db[_0x67cd('0x43')][_0x67cd('0x4a')](_0x4eb7d8)['then'](handleEntityNotFound(_0x7c94ac,null))['then'](respondWithResult(_0x7c94ac,null))[_0x67cd('0x1e')](handleError(_0x7c94ac,null));};exports[_0x67cd('0x4b')]=function(_0x413d6c,_0x7725c3,_0x415e74){var _0x53fc6a;return db[_0x67cd('0x43')][_0x67cd('0x4b')](_0x413d6c[_0x67cd('0x4c')],{'raw':!![]})['then'](function(_0x272b17){_0x53fc6a=_0x272b17;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x67cd('0x15')](function(_0x3dacaa){var _0x15234d=fs[_0x67cd('0x4d')](path['join'](config[_0x67cd('0x4e')],_0x67cd('0x4f')),_0x67cd('0x50'));var _0x11a139=ejs[_0x67cd('0x51')](_0x15234d,{'contexts':_0x3dacaa||[]});fs[_0x67cd('0x52')](_0x67cd('0x53'),_0x11a139);})['then'](function(){return respondWithRpcPromise(_0x67cd('0x54'),_0x67cd('0x4b'),{'module':_0x67cd('0x55')});})[_0x67cd('0x15')](function(){var _0x54570a=_0x413d6c[_0x67cd('0x56')][_0x67cd('0x28')]({'plain':!![]});if(!_0x54570a)throw new Error(_0x67cd('0x57'));if(_0x54570a['role']===_0x67cd('0x56')){var _0x381a75=_0x53fc6a[_0x67cd('0x28')]({'plain':!![]});return db[_0x67cd('0x58')]['find']({'where':{'name':_0x67cd('0x29'),'userProfileId':_0x54570a['userProfileId']},'raw':!![]})[_0x67cd('0x15')](function(_0x51d701){if(_0x51d701&&_0x51d701[_0x67cd('0x59')]===0x0){return db[_0x67cd('0x5a')][_0x67cd('0x4b')]({'name':_0x381a75['name'],'resourceId':_0x381a75['id'],'type':_0x51d701[_0x67cd('0x2b')],'sectionId':_0x51d701['id']},{})[_0x67cd('0x15')](function(){return _0x53fc6a;});}else{return _0x53fc6a;}})[_0x67cd('0x1e')](function(_0x54bd24){logger[_0x67cd('0x1b')](_0x67cd('0x5b'),_0x54bd24);throw _0x54bd24;});}return _0x53fc6a;})['then'](respondWithResult(_0x7725c3,0xc9))[_0x67cd('0x1e')](handleError(_0x7725c3,null));};exports['update']=function(_0x6eb5a5,_0x36838e,_0x296fc3){var _0x31cb01;return db['VoiceContext'][_0x67cd('0x4a')]({'where':{'id':_0x6eb5a5[_0x67cd('0x47')]['id']}})[_0x67cd('0x15')](handleEntityNotFound(_0x36838e,null))['then'](saveUpdates(_0x6eb5a5['body'],null))[_0x67cd('0x15')](function(_0x43d3f7){if(_0x43d3f7){_0x31cb01=_0x43d3f7;return db[_0x67cd('0x43')]['findAll']({'raw':!![]});}})[_0x67cd('0x15')](function(_0x56a159){var _0x2745d3=fs[_0x67cd('0x4d')](path[_0x67cd('0x5c')](config['root'],'server/files/templates/context.ejs'),_0x67cd('0x50'));var _0x5366ba=ejs[_0x67cd('0x51')](_0x2745d3,{'contexts':_0x56a159||[]});fs['writeFileSync'](_0x67cd('0x53'),_0x5366ba);})[_0x67cd('0x15')](function(){return respondWithRpcPromise(_0x67cd('0x54'),_0x67cd('0x26'),{'module':'chan_sip.so'});})[_0x67cd('0x15')](function(){return _0x31cb01;})[_0x67cd('0x15')](respondWithResult(_0x36838e,null))[_0x67cd('0x1e')](handleError(_0x36838e,null));};exports[_0x67cd('0x27')]=function(_0x3527b0,_0x282f3c,_0x631683){var _0x3d745d;return db[_0x67cd('0x43')][_0x67cd('0x4a')]({'where':{'id':_0x3527b0[_0x67cd('0x47')]['id']}})[_0x67cd('0x15')](handleEntityNotFound(_0x282f3c,null))['then'](removeEntity(_0x282f3c,null))[_0x67cd('0x15')](function(){return db[_0x67cd('0x43')][_0x67cd('0x45')]({'raw':!![]});})[_0x67cd('0x15')](function(_0x366bde){var _0x36a02e=fs[_0x67cd('0x4d')](path[_0x67cd('0x5c')](config[_0x67cd('0x4e')],_0x67cd('0x4f')),'utf8');var _0x36947a=ejs[_0x67cd('0x51')](_0x36a02e,{'contexts':_0x366bde});fs[_0x67cd('0x52')](_0x67cd('0x53'),_0x36947a);return respondWithRpcPromise('Reload',_0x67cd('0x27'),{'module':_0x67cd('0x55')});})[_0x67cd('0x1e')](handleError(_0x282f3c,null));};
\ No newline at end of file
+var _0xb5fa=['order','sort','where','pick','add','day','merge','filter','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','create','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','join','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','send','VoiceContext','rawAttributes','model','dateStart','query','dateEnd','keys','filters','attributes','intersection','fields','length','nolimit','limit'];(function(_0x49e15f,_0x481721){var _0x2247f0=function(_0x28d818){while(--_0x28d818){_0x49e15f['push'](_0x49e15f['shift']());}};_0x2247f0(++_0x481721);}(_0xb5fa,0xf8));var _0xab5f=function(_0x3a5ebd,_0x493272){_0x3a5ebd=_0x3a5ebd-0x0;var _0x3ff829=_0xb5fa[_0x3a5ebd];return _0x3ff829;};'use strict';var pdf=require(_0xab5f('0x0'));var emlformat=require(_0xab5f('0x1'));var rimraf=require(_0xab5f('0x2'));var zipdir=require(_0xab5f('0x3'));var jsonpatch=require(_0xab5f('0x4'));var rp=require(_0xab5f('0x5'));var moment=require(_0xab5f('0x6'));var BPromise=require(_0xab5f('0x7'));var Mustache=require(_0xab5f('0x8'));var util=require(_0xab5f('0x9'));var path=require(_0xab5f('0xa'));var sox=require(_0xab5f('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xab5f('0xc'));var crypto=require(_0xab5f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xab5f('0xe'));var toCsv=require(_0xab5f('0xf'));var querystring=require(_0xab5f('0x10'));var Papa=require(_0xab5f('0x11'));var Redis=require(_0xab5f('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xab5f('0x13'))('api');var utils=require(_0xab5f('0x14'));var config=require('../../config/environment');var db=require(_0xab5f('0x15'))['db'];var jayson=require(_0xab5f('0x16'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0910,_0x3d9f16,_0x32fca3,_0x56d072){return new BPromise(function(_0xe5612d,_0x429920){var _0x405b4c=_0x56d072||client;return _0x405b4c[_0xab5f('0x17')](_0x4a0910,_0x32fca3)[_0xab5f('0x18')](function(_0x4101ee){logger[_0xab5f('0x19')](_0xab5f('0x1a'),_0x3d9f16,_0xab5f('0x1b'));logger[_0xab5f('0x1c')](_0xab5f('0x1d'),_0x3d9f16,_0xab5f('0x1b'),JSON[_0xab5f('0x1e')](_0x4101ee));if(_0x4101ee[_0xab5f('0x1f')]){if(_0x4101ee[_0xab5f('0x1f')][_0xab5f('0x20')]===0x1f4){logger[_0xab5f('0x1f')](_0xab5f('0x1a'),_0x3d9f16,_0x4101ee['error'][_0xab5f('0x21')]);return _0x429920(_0x4101ee['error'][_0xab5f('0x21')]);}logger[_0xab5f('0x1f')](_0xab5f('0x1a'),_0x3d9f16,_0x4101ee[_0xab5f('0x1f')]['message']);return _0xe5612d(_0x4101ee[_0xab5f('0x1f')][_0xab5f('0x21')]);}else{logger[_0xab5f('0x19')](_0xab5f('0x1a'),_0x3d9f16,_0xab5f('0x1b'));_0xe5612d(_0x4101ee[_0xab5f('0x22')]['message']);}})[_0xab5f('0x23')](function(_0x298de2){logger[_0xab5f('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x3d9f16,_0x298de2);_0x429920(_0x298de2);});});}function respondWithStatusCode(_0xb47124,_0x134a23){_0x134a23=_0x134a23||0xcc;return function(_0x811e76){if(_0x811e76){return _0xb47124[_0xab5f('0x24')](_0x134a23);}return _0xb47124[_0xab5f('0x25')](_0x134a23)[_0xab5f('0x26')]();};}function respondWithResult(_0x4b3127,_0x55daaf){_0x55daaf=_0x55daaf||0xc8;return function(_0x3c5847){if(_0x3c5847){return _0x4b3127[_0xab5f('0x25')](_0x55daaf)[_0xab5f('0x27')](_0x3c5847);}};}function respondWithFilteredResult(_0x39bf0f,_0x3fb403){return function(_0x49972a){if(_0x49972a){var _0x3db1a6=_0x49972a[_0xab5f('0x28')],_0x38d793=_0x3fb403[_0xab5f('0x29')],_0x4944b6=_0x3fb403[_0xab5f('0x29')]+_0x3fb403['limit'],_0x1dad1d;if(_0x4944b6>=_0x3db1a6){_0x4944b6=_0x3db1a6;_0x1dad1d=0xc8;}else{_0x1dad1d=0xce;}_0x39bf0f[_0xab5f('0x25')](_0x1dad1d);return _0x39bf0f[_0xab5f('0x2a')](_0xab5f('0x2b'),_0x38d793+'-'+_0x4944b6+'/'+_0x3db1a6)[_0xab5f('0x27')](_0x49972a);}return null;};}function patchUpdates(_0x5e43a5){return function(_0x173688){try{jsonpatch[_0xab5f('0x2c')](_0x173688,_0x5e43a5,!![]);}catch(_0x36ec77){return BPromise[_0xab5f('0x2d')](_0x36ec77);}return _0x173688[_0xab5f('0x2e')]();};}function saveUpdates(_0x4ff4ed,_0x5c6229){return function(_0x7f5308){if(_0x7f5308){return _0x7f5308[_0xab5f('0x2f')](_0x4ff4ed)[_0xab5f('0x18')](function(_0x274951){return _0x274951;});}return null;};}function removeEntity(_0x4bd729,_0x56a8e9){return function(_0x4df603){if(_0x4df603){return _0x4df603['destroy']()['then'](function(){var _0xcfaa90=_0x4df603[_0xab5f('0x30')]({'plain':!![]});var _0x18ca34=_0xab5f('0x31');return db[_0xab5f('0x32')][_0xab5f('0x33')]({'where':{'type':_0x18ca34,'resourceId':_0xcfaa90['id']}})[_0xab5f('0x18')](function(){return _0x4df603;});})['then'](function(){_0x4bd729[_0xab5f('0x25')](0xcc)[_0xab5f('0x26')]();});}};}function handleEntityNotFound(_0x24a340,_0x8cbb48){return function(_0x2ba2e6){if(!_0x2ba2e6){_0x24a340[_0xab5f('0x24')](0x194);}return _0x2ba2e6;};}function handleError(_0x4e86d2,_0x39c74d){_0x39c74d=_0x39c74d||0x1f4;return function(_0x529c2d){logger[_0xab5f('0x1f')](_0x529c2d['stack']);if(_0x529c2d['name']){delete _0x529c2d['name'];}_0x4e86d2['status'](_0x39c74d)[_0xab5f('0x34')](_0x529c2d);};}exports['index']=function(_0x3cc017,_0x137502){var _0x41023a={},_0x6fb3fc={},_0x2b295d={'count':0x0,'rows':[]};var _0x1497af=db[_0xab5f('0x35')][_0xab5f('0x36')];_0x6fb3fc[_0xab5f('0x37')]=_['keys'](_0x1497af);var _0x10064e={'dateStart':_0x3cc017['query'][_0xab5f('0x38')],'dateEnd':_0x3cc017[_0xab5f('0x39')][_0xab5f('0x3a')]};delete _0x3cc017['query'][_0xab5f('0x38')];delete _0x3cc017[_0xab5f('0x39')][_0xab5f('0x3a')];_0x6fb3fc[_0xab5f('0x39')]=_[_0xab5f('0x3b')](_0x3cc017[_0xab5f('0x39')]);_0x6fb3fc[_0xab5f('0x3c')]=_['intersection'](_0x6fb3fc[_0xab5f('0x37')],_0x6fb3fc[_0xab5f('0x39')]);_0x41023a[_0xab5f('0x3d')]=_[_0xab5f('0x3e')](_0x6fb3fc[_0xab5f('0x37')],qs[_0xab5f('0x3f')](_0x3cc017[_0xab5f('0x39')][_0xab5f('0x3f')]));_0x41023a['attributes']=_0x41023a['attributes'][_0xab5f('0x40')]?_0x41023a[_0xab5f('0x3d')]:_0x6fb3fc['model'];if(!_0x3cc017[_0xab5f('0x39')]['hasOwnProperty'](_0xab5f('0x41'))){_0x41023a[_0xab5f('0x42')]=qs['limit'](_0x3cc017[_0xab5f('0x39')]['limit']);_0x41023a[_0xab5f('0x29')]=qs[_0xab5f('0x29')](_0x3cc017[_0xab5f('0x39')][_0xab5f('0x29')]);}_0x41023a[_0xab5f('0x43')]=qs[_0xab5f('0x44')](_0x3cc017['query'][_0xab5f('0x44')]);_0x41023a[_0xab5f('0x45')]=qs[_0xab5f('0x3c')](_[_0xab5f('0x46')](_0x3cc017[_0xab5f('0x39')],_0x6fb3fc[_0xab5f('0x3c')]));if(_0x10064e['dateStart']){if(_0x10064e[_0xab5f('0x3a')]){_0x10064e[_0xab5f('0x3a')]=moment(_0x10064e['dateEnd'])[_0xab5f('0x47')](0x1,'day');}else{_0x10064e[_0xab5f('0x3a')]=moment(_0x10064e[_0xab5f('0x38')])['add'](0x1,_0xab5f('0x48'));}_[_0xab5f('0x49')](_0x41023a[_0xab5f('0x45')],{'createdAt':{'$gte':_0x10064e[_0xab5f('0x38')],'$lte':_0x10064e[_0xab5f('0x3a')]}});}if(_0x3cc017[_0xab5f('0x39')][_0xab5f('0x4a')]){_0x41023a[_0xab5f('0x45')]=_['merge'](_0x41023a[_0xab5f('0x45')],{'$or':_[_0xab5f('0x4b')](_0x1497af,function(_0x271c3d){if(_0x271c3d['type'][_0xab5f('0x4c')]!==_0xab5f('0x4d')){var _0x432163={};_0x432163[_0x271c3d[_0xab5f('0x4e')]]={'$like':'%'+_0x3cc017[_0xab5f('0x39')][_0xab5f('0x4a')]+'%'};return _0x432163;}})});}_0x41023a=_[_0xab5f('0x49')]({},_0x41023a,_0x3cc017[_0xab5f('0x4f')]);var _0xe003df={'where':_0x41023a[_0xab5f('0x45')]};return db[_0xab5f('0x35')][_0xab5f('0x28')](_0xe003df)[_0xab5f('0x18')](function(_0x28a126){_0x2b295d['count']=_0x28a126;if(_0x3cc017[_0xab5f('0x39')][_0xab5f('0x50')]){_0x41023a[_0xab5f('0x51')]=[{'all':!![]}];}return db[_0xab5f('0x35')][_0xab5f('0x52')](_0x41023a);})['then'](function(_0x5d1daf){_0x2b295d[_0xab5f('0x53')]=_0x5d1daf;return _0x2b295d;})[_0xab5f('0x18')](respondWithFilteredResult(_0x137502,_0x41023a))['catch'](handleError(_0x137502,null));};exports[_0xab5f('0x54')]=function(_0x3fb478,_0x85fd96){var _0x256029={'raw':![],'where':{'id':_0x3fb478['params']['id']}},_0x50b63b={};_0x50b63b[_0xab5f('0x37')]=_[_0xab5f('0x3b')](db['VoiceContext'][_0xab5f('0x36')]);_0x50b63b[_0xab5f('0x39')]=_['keys'](_0x3fb478['query']);_0x50b63b[_0xab5f('0x3c')]=_['intersection'](_0x50b63b[_0xab5f('0x37')],_0x50b63b[_0xab5f('0x39')]);_0x256029[_0xab5f('0x3d')]=_[_0xab5f('0x3e')](_0x50b63b[_0xab5f('0x37')],qs[_0xab5f('0x3f')](_0x3fb478[_0xab5f('0x39')][_0xab5f('0x3f')]));_0x256029[_0xab5f('0x3d')]=_0x256029[_0xab5f('0x3d')]['length']?_0x256029[_0xab5f('0x3d')]:_0x50b63b['model'];if(_0x3fb478['query'][_0xab5f('0x50')]){_0x256029['include']=[{'all':!![]}];}_0x256029=_[_0xab5f('0x49')]({},_0x256029,_0x3fb478[_0xab5f('0x4f')]);return db[_0xab5f('0x35')][_0xab5f('0x55')](_0x256029)[_0xab5f('0x18')](handleEntityNotFound(_0x85fd96,null))[_0xab5f('0x18')](respondWithResult(_0x85fd96,null))[_0xab5f('0x23')](handleError(_0x85fd96,null));};exports[_0xab5f('0x56')]=function(_0x4651e1,_0x51b5d5,_0x29be04){var _0x201896;return db[_0xab5f('0x35')][_0xab5f('0x56')](_0x4651e1['body'],{'raw':!![]})[_0xab5f('0x18')](function(_0x438c04){_0x201896=_0x438c04;return db[_0xab5f('0x35')][_0xab5f('0x52')]({'raw':!![]});})[_0xab5f('0x18')](function(_0x4cee7a){var _0x95788d=fs[_0xab5f('0x57')](path['join'](config[_0xab5f('0x58')],_0xab5f('0x59')),_0xab5f('0x5a'));var _0x146df2=ejs[_0xab5f('0x5b')](_0x95788d,{'contexts':_0x4cee7a||[]});fs[_0xab5f('0x5c')](_0xab5f('0x5d'),_0x146df2);})['then'](function(){return respondWithRpcPromise(_0xab5f('0x5e'),_0xab5f('0x56'),{'module':_0xab5f('0x5f')});})[_0xab5f('0x18')](function(){var _0x20f8fb=_0x4651e1[_0xab5f('0x60')]['get']({'plain':!![]});if(!_0x20f8fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20f8fb[_0xab5f('0x61')]===_0xab5f('0x60')){var _0x52ec9b=_0x201896[_0xab5f('0x30')]({'plain':!![]});return db[_0xab5f('0x62')]['find']({'where':{'name':_0xab5f('0x31'),'userProfileId':_0x20f8fb[_0xab5f('0x63')]},'raw':!![]})[_0xab5f('0x18')](function(_0x6a0c3){if(_0x6a0c3&&_0x6a0c3['autoAssociation']===0x0){return db['UserProfileResource'][_0xab5f('0x56')]({'name':_0x52ec9b[_0xab5f('0x64')],'resourceId':_0x52ec9b['id'],'type':_0x6a0c3[_0xab5f('0x64')],'sectionId':_0x6a0c3['id']},{})['then'](function(){return _0x201896;});}else{return _0x201896;}})[_0xab5f('0x23')](function(_0x2396df){logger['error'](_0xab5f('0x65'),_0x2396df);throw _0x2396df;});}return _0x201896;})[_0xab5f('0x18')](respondWithResult(_0x51b5d5,0xc9))[_0xab5f('0x23')](handleError(_0x51b5d5,null));};exports[_0xab5f('0x2f')]=function(_0x2f8e1c,_0x476a2d,_0x129e9){var _0x3b8f62;return db[_0xab5f('0x35')][_0xab5f('0x55')]({'where':{'id':_0x2f8e1c[_0xab5f('0x66')]['id']}})['then'](handleEntityNotFound(_0x476a2d,null))[_0xab5f('0x18')](saveUpdates(_0x2f8e1c[_0xab5f('0x67')],null))[_0xab5f('0x18')](function(_0x391b32){if(_0x391b32){_0x3b8f62=_0x391b32;return db['VoiceContext'][_0xab5f('0x52')]({'raw':!![]});}})[_0xab5f('0x18')](function(_0x513fc3){var _0x22d042=fs[_0xab5f('0x57')](path['join'](config['root'],_0xab5f('0x59')),_0xab5f('0x5a'));var _0x8df120=ejs[_0xab5f('0x5b')](_0x22d042,{'contexts':_0x513fc3||[]});fs[_0xab5f('0x5c')](_0xab5f('0x5d'),_0x8df120);})[_0xab5f('0x18')](function(){return respondWithRpcPromise(_0xab5f('0x5e'),'update',{'module':_0xab5f('0x5f')});})[_0xab5f('0x18')](function(){return _0x3b8f62;})[_0xab5f('0x18')](respondWithResult(_0x476a2d,null))[_0xab5f('0x23')](handleError(_0x476a2d,null));};exports[_0xab5f('0x33')]=function(_0x1bc0bd,_0x1bf11e,_0xfcebcb){var _0x1939ab;return db[_0xab5f('0x35')]['find']({'where':{'id':_0x1bc0bd['params']['id']}})['then'](handleEntityNotFound(_0x1bf11e,null))[_0xab5f('0x18')](removeEntity(_0x1bf11e,null))['then'](function(){return db[_0xab5f('0x35')][_0xab5f('0x52')]({'raw':!![]});})['then'](function(_0x53aeed){var _0x1db10e=fs[_0xab5f('0x57')](path[_0xab5f('0x68')](config['root'],_0xab5f('0x59')),_0xab5f('0x5a'));var _0x3f738e=ejs[_0xab5f('0x5b')](_0x1db10e,{'contexts':_0x53aeed});fs[_0xab5f('0x5c')](_0xab5f('0x5d'),_0x3f738e);return respondWithRpcPromise(_0xab5f('0x5e'),_0xab5f('0x33'),{'module':_0xab5f('0x5f')});})[_0xab5f('0x23')](handleError(_0x1bf11e,null));};
\ No newline at end of file
index 458b75b..68b2bd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa152=['voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x1bcd8d,_0x21761c){var _0x6b9e62=function(_0x46f5b6){while(--_0x46f5b6){_0x1bcd8d['push'](_0x1bcd8d['shift']());}};_0x6b9e62(++_0x21761c);}(_0xa152,0x97));var _0x2a15=function(_0x3cca7a,_0x109a23){_0x3cca7a=_0x3cca7a-0x0;var _0x34e717=_0xa152[_0x3cca7a];return _0x34e717;};'use strict';var _=require(_0x2a15('0x0'));var util=require(_0x2a15('0x1'));var logger=require(_0x2a15('0x2'))(_0x2a15('0x3'));var moment=require(_0x2a15('0x4'));var BPromise=require(_0x2a15('0x5'));var rp=require(_0x2a15('0x6'));var attributes=require('./voiceContext.attributes');module[_0x2a15('0x7')]=function(_0x31bebc,_0x369332){return _0x31bebc[_0x2a15('0x8')]('VoiceContext',attributes,{'tableName':_0x2a15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4f2=['moment','request-promise','./voiceContext.attributes','exports','VoiceContext','lodash','util','../../config/logger','api'];(function(_0x27aedc,_0x58634d){var _0x1fa411=function(_0x417c0e){while(--_0x417c0e){_0x27aedc['push'](_0x27aedc['shift']());}};_0x1fa411(++_0x58634d);}(_0xb4f2,0x1eb));var _0x2b4f=function(_0x212b68,_0x11c6e0){_0x212b68=_0x212b68-0x0;var _0x175f0d=_0xb4f2[_0x212b68];return _0x175f0d;};'use strict';var _=require(_0x2b4f('0x0'));var util=require(_0x2b4f('0x1'));var logger=require(_0x2b4f('0x2'))(_0x2b4f('0x3'));var moment=require(_0x2b4f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b4f('0x5'));var attributes=require(_0x2b4f('0x6'));module[_0x2b4f('0x7')]=function(_0x6a9c7c,_0xef4606){return _0x6a9c7c['define'](_0x2b4f('0x8'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3d654e5..8fde01a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x289f=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x1877e2,_0x2b76d4){var _0x44e96a=function(_0x8760bf){while(--_0x8760bf){_0x1877e2['push'](_0x1877e2['shift']());}};_0x44e96a(++_0x2b76d4);}(_0x289f,0x86));var _0xf289=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x289f[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0xf289('0x0'));var util=require(_0xf289('0x1'));var moment=require(_0xf289('0x2'));var BPromise=require(_0xf289('0x3'));var rs=require(_0xf289('0x4'));var fs=require('fs');var Redis=require(_0xf289('0x5'));var db=require(_0xf289('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf289('0x7'))(_0xf289('0x8'));var config=require(_0xf289('0x9'));var jayson=require(_0xf289('0xa'));var client=jayson[_0xf289('0xb')][_0xf289('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16219c,_0x43ec21,_0x30cb79){return new BPromise(function(_0x4c5c31,_0x2415fd){return client[_0xf289('0xd')](_0x16219c,_0x30cb79)[_0xf289('0xe')](function(_0xd811ab){logger[_0xf289('0xf')](_0xf289('0x10'),_0x43ec21,_0xf289('0x11'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x43ec21,_0xf289('0x11'),JSON[_0xf289('0x12')](_0xd811ab));if(_0xd811ab[_0xf289('0x13')]){if(_0xd811ab[_0xf289('0x13')][_0xf289('0x14')]===0x1f4){logger[_0xf289('0x13')](_0xf289('0x10'),_0x43ec21,_0xd811ab[_0xf289('0x13')][_0xf289('0x15')]);return _0x2415fd(_0xd811ab['error'][_0xf289('0x15')]);}logger['error'](_0xf289('0x10'),_0x43ec21,_0xd811ab[_0xf289('0x13')][_0xf289('0x15')]);return _0x4c5c31(_0xd811ab['error'][_0xf289('0x15')]);}else{logger[_0xf289('0xf')](_0xf289('0x10'),_0x43ec21,_0xf289('0x11'));_0x4c5c31(_0xd811ab[_0xf289('0x16')][_0xf289('0x15')]);}})['catch'](function(_0x1a7bef){logger[_0xf289('0x13')](_0xf289('0x10'),_0x43ec21,_0x1a7bef);_0x2415fd(_0x1a7bef);});});}
\ No newline at end of file
+var _0x7b67=['../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x2e9519,_0x205cc9){var _0x1a05c6=function(_0x3e825b){while(--_0x3e825b){_0x2e9519['push'](_0x2e9519['shift']());}};_0x1a05c6(++_0x205cc9);}(_0x7b67,0x172));var _0x77b6=function(_0x562cb5,_0x29e170){_0x562cb5=_0x562cb5-0x0;var _0x163464=_0x7b67[_0x562cb5];return _0x163464;};'use strict';var _=require(_0x77b6('0x0'));var util=require(_0x77b6('0x1'));var moment=require(_0x77b6('0x2'));var BPromise=require(_0x77b6('0x3'));var rs=require(_0x77b6('0x4'));var fs=require('fs');var Redis=require(_0x77b6('0x5'));var db=require(_0x77b6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x77b6('0x7'));var config=require(_0x77b6('0x8'));var jayson=require(_0x77b6('0x9'));var client=jayson['client'][_0x77b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x395393,_0x46bf67,_0x25a6b1){return new BPromise(function(_0x3d46fb,_0x543e3c){return client[_0x77b6('0xb')](_0x395393,_0x25a6b1)[_0x77b6('0xc')](function(_0x34ee1b){logger[_0x77b6('0xd')](_0x77b6('0xe'),_0x46bf67,'request\x20sent');logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x46bf67,_0x77b6('0xf'),JSON[_0x77b6('0x10')](_0x34ee1b));if(_0x34ee1b[_0x77b6('0x11')]){if(_0x34ee1b['error'][_0x77b6('0x12')]===0x1f4){logger[_0x77b6('0x11')](_0x77b6('0xe'),_0x46bf67,_0x34ee1b['error']['message']);return _0x543e3c(_0x34ee1b[_0x77b6('0x11')][_0x77b6('0x13')]);}logger[_0x77b6('0x11')](_0x77b6('0xe'),_0x46bf67,_0x34ee1b['error'][_0x77b6('0x13')]);return _0x3d46fb(_0x34ee1b['error'][_0x77b6('0x13')]);}else{logger[_0x77b6('0xd')](_0x77b6('0xe'),_0x46bf67,_0x77b6('0xf'));_0x3d46fb(_0x34ee1b['result'][_0x77b6('0x13')]);}})[_0x77b6('0x14')](function(_0x2332d0){logger[_0x77b6('0x11')](_0x77b6('0xe'),_0x46bf67,_0x2332d0);_0x543e3c(_0x2332d0);});});}
\ No newline at end of file
index 4058f9f..c849948 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7b5=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update'];(function(_0x17358b,_0x263b98){var _0x514bfb=function(_0xfd8732){while(--_0xfd8732){_0x17358b['push'](_0x17358b['shift']());}};_0x514bfb(++_0x263b98);}(_0xb7b5,0x13e));var _0x5b7b=function(_0x2ecb33,_0x4e1f74){_0x2ecb33=_0x2ecb33-0x0;var _0x38c528=_0xb7b5[_0x2ecb33];return _0x38c528;};'use strict';var multer=require(_0x5b7b('0x0'));var util=require('util');var path=require(_0x5b7b('0x1'));var timeout=require(_0x5b7b('0x2'));var express=require(_0x5b7b('0x3'));var router=express[_0x5b7b('0x4')]();var auth=require(_0x5b7b('0x5'));var interaction=require(_0x5b7b('0x6'));var config=require(_0x5b7b('0x7'));var controller=require('./voiceDialReport.controller');router[_0x5b7b('0x8')]('/',auth[_0x5b7b('0x9')](),controller['index']);router[_0x5b7b('0x8')](_0x5b7b('0xa'),auth[_0x5b7b('0x9')](),controller[_0x5b7b('0xb')]);router[_0x5b7b('0x8')]('/:id',auth[_0x5b7b('0x9')](),controller[_0x5b7b('0xc')]);router[_0x5b7b('0xd')]('/',auth[_0x5b7b('0x9')](),controller[_0x5b7b('0xe')]);router[_0x5b7b('0xf')](_0x5b7b('0x10'),auth[_0x5b7b('0x9')](),controller[_0x5b7b('0x11')]);router[_0x5b7b('0x12')](_0x5b7b('0x10'),auth['isAuthenticated'](),controller[_0x5b7b('0x13')]);module[_0x5b7b('0x14')]=router;
\ No newline at end of file
+var _0xe2fd=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update'];(function(_0x42d0ed,_0x91a115){var _0x3f63f6=function(_0x2e961b){while(--_0x2e961b){_0x42d0ed['push'](_0x42d0ed['shift']());}};_0x3f63f6(++_0x91a115);}(_0xe2fd,0x7a));var _0xde2f=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xe2fd[_0x39e84d];return _0x1991bc;};'use strict';var multer=require(_0xde2f('0x0'));var util=require(_0xde2f('0x1'));var path=require(_0xde2f('0x2'));var timeout=require(_0xde2f('0x3'));var express=require(_0xde2f('0x4'));var router=express[_0xde2f('0x5')]();var auth=require(_0xde2f('0x6'));var interaction=require(_0xde2f('0x7'));var config=require('../../config/environment');var controller=require(_0xde2f('0x8'));router[_0xde2f('0x9')]('/',auth[_0xde2f('0xa')](),controller[_0xde2f('0xb')]);router[_0xde2f('0x9')](_0xde2f('0xc'),auth[_0xde2f('0xa')](),controller[_0xde2f('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xde2f('0xa')](),controller[_0xde2f('0xe')]);router[_0xde2f('0xf')](_0xde2f('0x10'),auth['isAuthenticated'](),controller[_0xde2f('0x11')]);router[_0xde2f('0x12')](_0xde2f('0x10'),auth[_0xde2f('0xa')](),controller['destroy']);module[_0xde2f('0x13')]=router;
\ No newline at end of file
index 031b548..1f0643c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce77=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x144f4a,_0x4738f7){var _0x1781e2=function(_0x172bb4){while(--_0x172bb4){_0x144f4a['push'](_0x144f4a['shift']());}};_0x1781e2(++_0x4738f7);}(_0xce77,0xa7));var _0x7ce7=function(_0x365433,_0x1aacef){_0x365433=_0x365433-0x0;var _0x3d45aa=_0xce77[_0x365433];return _0x3d45aa;};'use strict';var Sequelize=require('sequelize');module[_0x7ce7('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7ce7('0x1')]},'channelstate':{'type':Sequelize[_0x7ce7('0x2')]},'channelstatedesc':{'type':Sequelize[_0x7ce7('0x1')]},'calleridnum':{'type':Sequelize[_0x7ce7('0x1')]},'calleridname':{'type':Sequelize[_0x7ce7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7ce7('0x1')]},'language':{'type':Sequelize[_0x7ce7('0x1')]},'accountcode':{'type':Sequelize[_0x7ce7('0x1')]},'context':{'type':Sequelize[_0x7ce7('0x1')]},'exten':{'type':Sequelize[_0x7ce7('0x1')]},'priority':{'type':Sequelize[_0x7ce7('0x2')]},'uniqueid':{'type':Sequelize[_0x7ce7('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7ce7('0x1')]},'destchannelstate':{'type':Sequelize[_0x7ce7('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7ce7('0x1')]},'destcalleridname':{'type':Sequelize[_0x7ce7('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7ce7('0x1')]},'destlanguage':{'type':Sequelize[_0x7ce7('0x1')]},'destaccountcode':{'type':Sequelize[_0x7ce7('0x1')]},'destcontext':{'type':Sequelize[_0x7ce7('0x1')]},'destexten':{'type':Sequelize[_0x7ce7('0x1')]},'destpriority':{'type':Sequelize[_0x7ce7('0x2')]},'destuniqueid':{'type':Sequelize[_0x7ce7('0x1')]},'destlinkedid':{'type':Sequelize[_0x7ce7('0x1')]},'dialstring':{'type':Sequelize[_0x7ce7('0x1')]},'dialstatus':{'type':Sequelize[_0x7ce7('0x1')]},'starttime':{'type':Sequelize[_0x7ce7('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7ce7('0x3')]},'lastevent':{'type':Sequelize[_0x7ce7('0x1')],'comment':_0x7ce7('0x4')},'routeId':{'type':Sequelize[_0x7ce7('0x2')]},'duration':{'type':Sequelize[_0x7ce7('0x2')]},'holdtime':{'type':Sequelize[_0x7ce7('0x2')]},'billableseconds':{'type':Sequelize[_0x7ce7('0x2')]}};
\ No newline at end of file
+var _0xe234=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0xb505b,_0xc25878){var _0x885398=function(_0x4b8f3){while(--_0x4b8f3){_0xb505b['push'](_0xb505b['shift']());}};_0x885398(++_0xc25878);}(_0xe234,0xfe));var _0x4e23=function(_0xbacd85,_0x585d42){_0xbacd85=_0xbacd85-0x0;var _0x56e589=_0xe234[_0xbacd85];return _0x56e589;};'use strict';var Sequelize=require('sequelize');module[_0x4e23('0x0')]={'privilege':{'type':Sequelize[_0x4e23('0x1')]},'channel':{'type':Sequelize[_0x4e23('0x1')]},'channelstate':{'type':Sequelize[_0x4e23('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4e23('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4e23('0x1')]},'connectedlinename':{'type':Sequelize[_0x4e23('0x1')]},'language':{'type':Sequelize[_0x4e23('0x1')]},'accountcode':{'type':Sequelize[_0x4e23('0x1')]},'context':{'type':Sequelize[_0x4e23('0x1')]},'exten':{'type':Sequelize[_0x4e23('0x1')]},'priority':{'type':Sequelize[_0x4e23('0x2')]},'uniqueid':{'type':Sequelize[_0x4e23('0x1')]},'linkedid':{'type':Sequelize[_0x4e23('0x1')]},'destchannel':{'type':Sequelize[_0x4e23('0x1')]},'destchannelstate':{'type':Sequelize[_0x4e23('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x4e23('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4e23('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4e23('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4e23('0x1')]},'destlanguage':{'type':Sequelize[_0x4e23('0x1')]},'destaccountcode':{'type':Sequelize[_0x4e23('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x4e23('0x2')]},'destuniqueid':{'type':Sequelize[_0x4e23('0x1')]},'destlinkedid':{'type':Sequelize[_0x4e23('0x1')]},'dialstring':{'type':Sequelize[_0x4e23('0x1')]},'dialstatus':{'type':Sequelize[_0x4e23('0x1')]},'starttime':{'type':Sequelize[_0x4e23('0x3')]},'answertime':{'type':Sequelize[_0x4e23('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0x4e23('0x4')},'routeId':{'type':Sequelize[_0x4e23('0x2')]},'duration':{'type':Sequelize[_0x4e23('0x2')]},'holdtime':{'type':Sequelize[_0x4e23('0x2')]},'billableseconds':{'type':Sequelize[_0x4e23('0x2')]}};
\ No newline at end of file
index 10eac29..5bac10f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1169=['stack','name','send','index','VoiceDialReport','rawAttributes','model','keys','dateStart','query','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','day','merge','filter','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x1169,0x1f2));var _0x9116=function(_0x22f398,_0x45cdec){_0x22f398=_0x22f398-0x0;var _0x3cd7f9=_0x1169[_0x22f398];return _0x3cd7f9;};'use strict';var pdf=require(_0x9116('0x0'));var emlformat=require(_0x9116('0x1'));var rimraf=require(_0x9116('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9116('0x3'));var moment=require('moment');var BPromise=require(_0x9116('0x4'));var Mustache=require('mustache');var util=require(_0x9116('0x5'));var path=require('path');var sox=require(_0x9116('0x6'));var csv=require('to-csv');var ejs=require(_0x9116('0x7'));var fs=require('fs');var _=require(_0x9116('0x8'));var squel=require('squel');var crypto=require(_0x9116('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9116('0xa'));var toCsv=require(_0x9116('0xb'));var querystring=require(_0x9116('0xc'));var Papa=require(_0x9116('0xd'));var Redis=require(_0x9116('0xe'));var qs=require(_0x9116('0xf'));var logger=require(_0x9116('0x10'))(_0x9116('0x11'));var utils=require(_0x9116('0x12'));var config=require('../../config/environment');var db=require(_0x9116('0x13'))['db'];function respondWithStatusCode(_0x185cf3,_0x31f3c9){_0x31f3c9=_0x31f3c9||0xcc;return function(_0x1a630d){if(_0x1a630d){return _0x185cf3[_0x9116('0x14')](_0x31f3c9);}return _0x185cf3['status'](_0x31f3c9)[_0x9116('0x15')]();};}function respondWithResult(_0x43f3bc,_0x5cb679){_0x5cb679=_0x5cb679||0xc8;return function(_0x52ead9){if(_0x52ead9){return _0x43f3bc[_0x9116('0x16')](_0x5cb679)[_0x9116('0x17')](_0x52ead9);}};}function respondWithFilteredResult(_0x1c8187,_0x246e29){return function(_0x343415){if(_0x343415){var _0x21c0f1=_0x343415[_0x9116('0x18')],_0x2875ac=_0x246e29[_0x9116('0x19')],_0x5cb1dd=_0x246e29[_0x9116('0x19')]+_0x246e29['limit'],_0x1f7d3e;if(_0x5cb1dd>=_0x21c0f1){_0x5cb1dd=_0x21c0f1;_0x1f7d3e=0xc8;}else{_0x1f7d3e=0xce;}_0x1c8187[_0x9116('0x16')](_0x1f7d3e);return _0x1c8187['set'](_0x9116('0x1a'),_0x2875ac+'-'+_0x5cb1dd+'/'+_0x21c0f1)[_0x9116('0x17')](_0x343415);}return null;};}function patchUpdates(_0x2bee11){return function(_0x365fe4){try{jsonpatch[_0x9116('0x1b')](_0x365fe4,_0x2bee11,!![]);}catch(_0x197602){return BPromise[_0x9116('0x1c')](_0x197602);}return _0x365fe4[_0x9116('0x1d')]();};}function saveUpdates(_0x1322a5,_0x4c0313){return function(_0x5338cb){if(_0x5338cb){return _0x5338cb[_0x9116('0x1e')](_0x1322a5)[_0x9116('0x1f')](function(_0x29d1fd){return _0x29d1fd;});}return null;};}function removeEntity(_0x4078a4,_0x32aabd){return function(_0x492ff8){if(_0x492ff8){return _0x492ff8[_0x9116('0x20')]()['then'](function(){_0x4078a4[_0x9116('0x16')](0xcc)[_0x9116('0x15')]();});}};}function handleEntityNotFound(_0x159a89,_0x2d39e5){return function(_0x363843){if(!_0x363843){_0x159a89[_0x9116('0x14')](0x194);}return _0x363843;};}function handleError(_0x42aad5,_0x2f51a7){_0x2f51a7=_0x2f51a7||0x1f4;return function(_0x265b6f){logger[_0x9116('0x21')](_0x265b6f[_0x9116('0x22')]);if(_0x265b6f[_0x9116('0x23')]){delete _0x265b6f[_0x9116('0x23')];}_0x42aad5['status'](_0x2f51a7)[_0x9116('0x24')](_0x265b6f);};}exports[_0x9116('0x25')]=function(_0x299ee9,_0x8c0d27){var _0x3b15ea={},_0x8f3ff1={},_0x15da41={'count':0x0,'rows':[]};var _0x31a716=db[_0x9116('0x26')][_0x9116('0x27')];_0x8f3ff1[_0x9116('0x28')]=_[_0x9116('0x29')](_0x31a716);var _0x5ed232={'dateStart':_0x299ee9['query'][_0x9116('0x2a')],'dateEnd':_0x299ee9[_0x9116('0x2b')][_0x9116('0x2c')]};delete _0x299ee9[_0x9116('0x2b')]['dateStart'];delete _0x299ee9['query']['dateEnd'];_0x8f3ff1['query']=_[_0x9116('0x29')](_0x299ee9[_0x9116('0x2b')]);_0x8f3ff1[_0x9116('0x2d')]=_[_0x9116('0x2e')](_0x8f3ff1[_0x9116('0x28')],_0x8f3ff1[_0x9116('0x2b')]);_0x3b15ea[_0x9116('0x2f')]=_['intersection'](_0x8f3ff1[_0x9116('0x28')],qs[_0x9116('0x30')](_0x299ee9[_0x9116('0x2b')][_0x9116('0x30')]));_0x3b15ea[_0x9116('0x2f')]=_0x3b15ea[_0x9116('0x2f')][_0x9116('0x31')]?_0x3b15ea['attributes']:_0x8f3ff1[_0x9116('0x28')];if(!_0x299ee9[_0x9116('0x2b')][_0x9116('0x32')](_0x9116('0x33'))){_0x3b15ea[_0x9116('0x34')]=qs[_0x9116('0x34')](_0x299ee9[_0x9116('0x2b')][_0x9116('0x34')]);_0x3b15ea[_0x9116('0x19')]=qs[_0x9116('0x19')](_0x299ee9[_0x9116('0x2b')][_0x9116('0x19')]);}_0x3b15ea[_0x9116('0x35')]=qs[_0x9116('0x36')](_0x299ee9[_0x9116('0x2b')][_0x9116('0x36')]);_0x3b15ea[_0x9116('0x37')]=qs[_0x9116('0x2d')](_[_0x9116('0x38')](_0x299ee9['query'],_0x8f3ff1[_0x9116('0x2d')]));if(_0x5ed232[_0x9116('0x2a')]){if(_0x5ed232[_0x9116('0x2c')]){_0x5ed232[_0x9116('0x2c')]=moment(_0x5ed232[_0x9116('0x2c')])['add'](0x1,_0x9116('0x39'));}else{_0x5ed232[_0x9116('0x2c')]=moment(_0x5ed232[_0x9116('0x2a')])['add'](0x1,_0x9116('0x39'));}_[_0x9116('0x3a')](_0x3b15ea[_0x9116('0x37')],{'createdAt':{'$gte':_0x5ed232[_0x9116('0x2a')],'$lte':_0x5ed232[_0x9116('0x2c')]}});}if(_0x299ee9[_0x9116('0x2b')][_0x9116('0x3b')]){_0x3b15ea[_0x9116('0x37')]=_[_0x9116('0x3a')](_0x3b15ea[_0x9116('0x37')],{'$or':_[_0x9116('0x3c')](_0x31a716,function(_0x1af821){if(_0x1af821['type'][_0x9116('0x3d')]!==_0x9116('0x3e')){var _0x4f5381={};_0x4f5381[_0x1af821[_0x9116('0x3f')]]={'$like':'%'+_0x299ee9['query'][_0x9116('0x3b')]+'%'};return _0x4f5381;}})});}_0x3b15ea=_[_0x9116('0x3a')]({},_0x3b15ea,_0x299ee9[_0x9116('0x40')]);var _0x4942c5={'where':_0x3b15ea['where']};return db[_0x9116('0x26')]['count'](_0x4942c5)[_0x9116('0x1f')](function(_0x3d30f2){_0x15da41[_0x9116('0x18')]=_0x3d30f2;if(_0x299ee9[_0x9116('0x2b')][_0x9116('0x41')]){_0x3b15ea[_0x9116('0x42')]=[{'all':!![]}];}return db[_0x9116('0x26')][_0x9116('0x43')](_0x3b15ea);})[_0x9116('0x1f')](function(_0x2aefe9){_0x15da41[_0x9116('0x44')]=_0x2aefe9;return _0x15da41;})['then'](respondWithFilteredResult(_0x8c0d27,_0x3b15ea))[_0x9116('0x45')](handleError(_0x8c0d27,null));};exports[_0x9116('0x46')]=function(_0x4ffb9e,_0x83e45){var _0x4d8476={'raw':!![],'where':{'id':_0x4ffb9e[_0x9116('0x47')]['id']}},_0xe9eade={};_0xe9eade[_0x9116('0x28')]=_['keys'](db[_0x9116('0x26')][_0x9116('0x27')]);_0xe9eade[_0x9116('0x2b')]=_[_0x9116('0x29')](_0x4ffb9e[_0x9116('0x2b')]);_0xe9eade[_0x9116('0x2d')]=_[_0x9116('0x2e')](_0xe9eade[_0x9116('0x28')],_0xe9eade[_0x9116('0x2b')]);_0x4d8476[_0x9116('0x2f')]=_[_0x9116('0x2e')](_0xe9eade[_0x9116('0x28')],qs[_0x9116('0x30')](_0x4ffb9e[_0x9116('0x2b')]['fields']));_0x4d8476[_0x9116('0x2f')]=_0x4d8476['attributes'][_0x9116('0x31')]?_0x4d8476[_0x9116('0x2f')]:_0xe9eade[_0x9116('0x28')];if(_0x4ffb9e[_0x9116('0x2b')]['includeAll']){_0x4d8476['include']=[{'all':!![]}];}_0x4d8476=_[_0x9116('0x3a')]({},_0x4d8476,_0x4ffb9e[_0x9116('0x40')]);return db[_0x9116('0x26')][_0x9116('0x48')](_0x4d8476)[_0x9116('0x1f')](handleEntityNotFound(_0x83e45,null))[_0x9116('0x1f')](respondWithResult(_0x83e45,null))[_0x9116('0x45')](handleError(_0x83e45,null));};exports[_0x9116('0x49')]=function(_0x5a72a7,_0x290787){return db[_0x9116('0x26')][_0x9116('0x49')](_0x5a72a7[_0x9116('0x4a')],{})[_0x9116('0x1f')](respondWithResult(_0x290787,0xc9))[_0x9116('0x45')](handleError(_0x290787,null));};exports['update']=function(_0x487e9c,_0x39ade6){if(_0x487e9c[_0x9116('0x4a')]['id']){delete _0x487e9c[_0x9116('0x4a')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x487e9c[_0x9116('0x47')]['id']}})[_0x9116('0x1f')](handleEntityNotFound(_0x39ade6,null))[_0x9116('0x1f')](saveUpdates(_0x487e9c[_0x9116('0x4a')],null))[_0x9116('0x1f')](respondWithResult(_0x39ade6,null))['catch'](handleError(_0x39ade6,null));};exports['destroy']=function(_0x34069b,_0x42426d){return db[_0x9116('0x26')][_0x9116('0x48')]({'where':{'id':_0x34069b[_0x9116('0x47')]['id']}})[_0x9116('0x1f')](handleEntityNotFound(_0x42426d,null))['then'](removeEntity(_0x42426d,null))[_0x9116('0x45')](handleError(_0x42426d,null));};exports['describe']=function(_0x11119c,_0x55e166){return db['VoiceDialReport'][_0x9116('0x4b')]()[_0x9116('0x1f')](respondWithResult(_0x55e166,null))[_0x9116('0x45')](handleError(_0x55e166,null));};
\ No newline at end of file
+var _0xbf41=['html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','VoiceDialReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','add','day','merge','filter','map','type','key','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe'];(function(_0x203dba,_0x2db495){var _0x216a45=function(_0x266922){while(--_0x266922){_0x203dba['push'](_0x203dba['shift']());}};_0x216a45(++_0x2db495);}(_0xbf41,0xdb));var _0x1bf4=function(_0x34121e,_0x420ca3){_0x34121e=_0x34121e-0x0;var _0x488aa8=_0xbf41[_0x34121e];return _0x488aa8;};'use strict';var pdf=require(_0x1bf4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1bf4('0x1'));var zipdir=require(_0x1bf4('0x2'));var jsonpatch=require(_0x1bf4('0x3'));var rp=require(_0x1bf4('0x4'));var moment=require(_0x1bf4('0x5'));var BPromise=require(_0x1bf4('0x6'));var Mustache=require(_0x1bf4('0x7'));var util=require(_0x1bf4('0x8'));var path=require(_0x1bf4('0x9'));var sox=require('sox');var csv=require(_0x1bf4('0xa'));var ejs=require(_0x1bf4('0xb'));var fs=require('fs');var _=require(_0x1bf4('0xc'));var squel=require('squel');var crypto=require(_0x1bf4('0xd'));var jsforce=require(_0x1bf4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1bf4('0xa'));var querystring=require(_0x1bf4('0xf'));var Papa=require(_0x1bf4('0x10'));var Redis=require(_0x1bf4('0x11'));var qs=require(_0x1bf4('0x12'));var logger=require(_0x1bf4('0x13'))('api');var utils=require(_0x1bf4('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35a15d,_0x1f2b6e){_0x1f2b6e=_0x1f2b6e||0xcc;return function(_0xd2ce){if(_0xd2ce){return _0x35a15d[_0x1bf4('0x15')](_0x1f2b6e);}return _0x35a15d[_0x1bf4('0x16')](_0x1f2b6e)['end']();};}function respondWithResult(_0x40a6af,_0x5c8329){_0x5c8329=_0x5c8329||0xc8;return function(_0xd5ba0a){if(_0xd5ba0a){return _0x40a6af[_0x1bf4('0x16')](_0x5c8329)[_0x1bf4('0x17')](_0xd5ba0a);}};}function respondWithFilteredResult(_0x17bcef,_0x4ef49f){return function(_0x118b67){if(_0x118b67){var _0x5c1173=_0x118b67[_0x1bf4('0x18')],_0x19decc=_0x4ef49f[_0x1bf4('0x19')],_0x45e5cf=_0x4ef49f['offset']+_0x4ef49f[_0x1bf4('0x1a')],_0x1271a2;if(_0x45e5cf>=_0x5c1173){_0x45e5cf=_0x5c1173;_0x1271a2=0xc8;}else{_0x1271a2=0xce;}_0x17bcef[_0x1bf4('0x16')](_0x1271a2);return _0x17bcef['set'](_0x1bf4('0x1b'),_0x19decc+'-'+_0x45e5cf+'/'+_0x5c1173)[_0x1bf4('0x17')](_0x118b67);}return null;};}function patchUpdates(_0x1061de){return function(_0x1589bf){try{jsonpatch[_0x1bf4('0x1c')](_0x1589bf,_0x1061de,!![]);}catch(_0x3354a8){return BPromise[_0x1bf4('0x1d')](_0x3354a8);}return _0x1589bf[_0x1bf4('0x1e')]();};}function saveUpdates(_0x1bee76,_0x33951e){return function(_0x4bd19c){if(_0x4bd19c){return _0x4bd19c[_0x1bf4('0x1f')](_0x1bee76)[_0x1bf4('0x20')](function(_0x4ca394){return _0x4ca394;});}return null;};}function removeEntity(_0x427a4c,_0x97684){return function(_0xc9f492){if(_0xc9f492){return _0xc9f492[_0x1bf4('0x21')]()['then'](function(){_0x427a4c[_0x1bf4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x446112,_0x410499){return function(_0x394ef2){if(!_0x394ef2){_0x446112[_0x1bf4('0x15')](0x194);}return _0x394ef2;};}function handleError(_0x40db8c,_0x13e919){_0x13e919=_0x13e919||0x1f4;return function(_0x257b4e){logger[_0x1bf4('0x22')](_0x257b4e[_0x1bf4('0x23')]);if(_0x257b4e[_0x1bf4('0x24')]){delete _0x257b4e[_0x1bf4('0x24')];}_0x40db8c['status'](_0x13e919)['send'](_0x257b4e);};}exports['index']=function(_0x429e10,_0x53f0dd){var _0x5a7cb8={},_0x5cbcbf={},_0x33d3aa={'count':0x0,'rows':[]};var _0x2f9225=db[_0x1bf4('0x25')][_0x1bf4('0x26')];_0x5cbcbf[_0x1bf4('0x27')]=_[_0x1bf4('0x28')](_0x2f9225);var _0xe8a16e={'dateStart':_0x429e10[_0x1bf4('0x29')]['dateStart'],'dateEnd':_0x429e10[_0x1bf4('0x29')]['dateEnd']};delete _0x429e10[_0x1bf4('0x29')][_0x1bf4('0x2a')];delete _0x429e10['query'][_0x1bf4('0x2b')];_0x5cbcbf[_0x1bf4('0x29')]=_['keys'](_0x429e10['query']);_0x5cbcbf[_0x1bf4('0x2c')]=_[_0x1bf4('0x2d')](_0x5cbcbf[_0x1bf4('0x27')],_0x5cbcbf[_0x1bf4('0x29')]);_0x5a7cb8[_0x1bf4('0x2e')]=_[_0x1bf4('0x2d')](_0x5cbcbf['model'],qs[_0x1bf4('0x2f')](_0x429e10['query']['fields']));_0x5a7cb8[_0x1bf4('0x2e')]=_0x5a7cb8[_0x1bf4('0x2e')][_0x1bf4('0x30')]?_0x5a7cb8[_0x1bf4('0x2e')]:_0x5cbcbf[_0x1bf4('0x27')];if(!_0x429e10[_0x1bf4('0x29')][_0x1bf4('0x31')](_0x1bf4('0x32'))){_0x5a7cb8[_0x1bf4('0x1a')]=qs[_0x1bf4('0x1a')](_0x429e10[_0x1bf4('0x29')]['limit']);_0x5a7cb8['offset']=qs[_0x1bf4('0x19')](_0x429e10[_0x1bf4('0x29')][_0x1bf4('0x19')]);}_0x5a7cb8[_0x1bf4('0x33')]=qs['sort'](_0x429e10[_0x1bf4('0x29')][_0x1bf4('0x34')]);_0x5a7cb8[_0x1bf4('0x35')]=qs[_0x1bf4('0x2c')](_['pick'](_0x429e10[_0x1bf4('0x29')],_0x5cbcbf[_0x1bf4('0x2c')]));if(_0xe8a16e['dateStart']){if(_0xe8a16e[_0x1bf4('0x2b')]){_0xe8a16e[_0x1bf4('0x2b')]=moment(_0xe8a16e[_0x1bf4('0x2b')])[_0x1bf4('0x36')](0x1,_0x1bf4('0x37'));}else{_0xe8a16e[_0x1bf4('0x2b')]=moment(_0xe8a16e[_0x1bf4('0x2a')])[_0x1bf4('0x36')](0x1,_0x1bf4('0x37'));}_[_0x1bf4('0x38')](_0x5a7cb8[_0x1bf4('0x35')],{'createdAt':{'$gte':_0xe8a16e['dateStart'],'$lte':_0xe8a16e[_0x1bf4('0x2b')]}});}if(_0x429e10[_0x1bf4('0x29')][_0x1bf4('0x39')]){_0x5a7cb8[_0x1bf4('0x35')]=_['merge'](_0x5a7cb8[_0x1bf4('0x35')],{'$or':_[_0x1bf4('0x3a')](_0x2f9225,function(_0x18ab29){if(_0x18ab29[_0x1bf4('0x3b')][_0x1bf4('0x3c')]!=='VIRTUAL'){var _0x3098ba={};_0x3098ba[_0x18ab29['field']]={'$like':'%'+_0x429e10[_0x1bf4('0x29')][_0x1bf4('0x39')]+'%'};return _0x3098ba;}})});}_0x5a7cb8=_[_0x1bf4('0x38')]({},_0x5a7cb8,_0x429e10[_0x1bf4('0x3d')]);var _0x105745={'where':_0x5a7cb8[_0x1bf4('0x35')]};return db[_0x1bf4('0x25')][_0x1bf4('0x18')](_0x105745)[_0x1bf4('0x20')](function(_0x3231bc){_0x33d3aa[_0x1bf4('0x18')]=_0x3231bc;if(_0x429e10[_0x1bf4('0x29')][_0x1bf4('0x3e')]){_0x5a7cb8[_0x1bf4('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x1bf4('0x40')](_0x5a7cb8);})[_0x1bf4('0x20')](function(_0x1b627b){_0x33d3aa[_0x1bf4('0x41')]=_0x1b627b;return _0x33d3aa;})['then'](respondWithFilteredResult(_0x53f0dd,_0x5a7cb8))[_0x1bf4('0x42')](handleError(_0x53f0dd,null));};exports[_0x1bf4('0x43')]=function(_0x3486b1,_0x57b074){var _0x4c7a43={'raw':!![],'where':{'id':_0x3486b1['params']['id']}},_0x2c0c77={};_0x2c0c77[_0x1bf4('0x27')]=_['keys'](db[_0x1bf4('0x25')][_0x1bf4('0x26')]);_0x2c0c77[_0x1bf4('0x29')]=_['keys'](_0x3486b1['query']);_0x2c0c77[_0x1bf4('0x2c')]=_[_0x1bf4('0x2d')](_0x2c0c77[_0x1bf4('0x27')],_0x2c0c77[_0x1bf4('0x29')]);_0x4c7a43[_0x1bf4('0x2e')]=_['intersection'](_0x2c0c77[_0x1bf4('0x27')],qs[_0x1bf4('0x2f')](_0x3486b1[_0x1bf4('0x29')][_0x1bf4('0x2f')]));_0x4c7a43['attributes']=_0x4c7a43[_0x1bf4('0x2e')]['length']?_0x4c7a43['attributes']:_0x2c0c77[_0x1bf4('0x27')];if(_0x3486b1[_0x1bf4('0x29')][_0x1bf4('0x3e')]){_0x4c7a43['include']=[{'all':!![]}];}_0x4c7a43=_['merge']({},_0x4c7a43,_0x3486b1[_0x1bf4('0x3d')]);return db[_0x1bf4('0x25')][_0x1bf4('0x44')](_0x4c7a43)[_0x1bf4('0x20')](handleEntityNotFound(_0x57b074,null))[_0x1bf4('0x20')](respondWithResult(_0x57b074,null))['catch'](handleError(_0x57b074,null));};exports['create']=function(_0x581ea4,_0x43cb9b){return db[_0x1bf4('0x25')][_0x1bf4('0x45')](_0x581ea4['body'],{})[_0x1bf4('0x20')](respondWithResult(_0x43cb9b,0xc9))[_0x1bf4('0x42')](handleError(_0x43cb9b,null));};exports[_0x1bf4('0x1f')]=function(_0x43b3b7,_0x569122){if(_0x43b3b7['body']['id']){delete _0x43b3b7[_0x1bf4('0x46')]['id'];}return db[_0x1bf4('0x25')][_0x1bf4('0x44')]({'where':{'id':_0x43b3b7[_0x1bf4('0x47')]['id']}})[_0x1bf4('0x20')](handleEntityNotFound(_0x569122,null))[_0x1bf4('0x20')](saveUpdates(_0x43b3b7[_0x1bf4('0x46')],null))[_0x1bf4('0x20')](respondWithResult(_0x569122,null))['catch'](handleError(_0x569122,null));};exports['destroy']=function(_0x5f47ca,_0x531aba){return db[_0x1bf4('0x25')][_0x1bf4('0x44')]({'where':{'id':_0x5f47ca[_0x1bf4('0x47')]['id']}})[_0x1bf4('0x20')](handleEntityNotFound(_0x531aba,null))[_0x1bf4('0x20')](removeEntity(_0x531aba,null))[_0x1bf4('0x42')](handleError(_0x531aba,null));};exports[_0x1bf4('0x48')]=function(_0x4fb96e,_0x35b254){return db[_0x1bf4('0x25')][_0x1bf4('0x48')]()[_0x1bf4('0x20')](respondWithResult(_0x35b254,null))[_0x1bf4('0x42')](handleError(_0x35b254,null));};
\ No newline at end of file
index b4d59a3..0f41e73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0abd=['request-promise','exports','VoiceDialReport','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0abd,0xee));var _0xd0ab=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x0abd[_0x4b6778];return _0x22dbb9;};'use strict';var _=require('lodash');var util=require(_0xd0ab('0x0'));var logger=require(_0xd0ab('0x1'))(_0xd0ab('0x2'));var moment=require(_0xd0ab('0x3'));var BPromise=require(_0xd0ab('0x4'));var rp=require(_0xd0ab('0x5'));var attributes=require('./voiceDialReport.attributes');module[_0xd0ab('0x6')]=function(_0x5bba31,_0x3f1af9){return _0x5bba31['define'](_0xd0ab('0x7'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xd0ab('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd661=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','bluebird','./voiceDialReport.attributes','exports'];(function(_0x1b3d6a,_0x331af1){var _0x21e5e1=function(_0x4c8d8a){while(--_0x4c8d8a){_0x1b3d6a['push'](_0x1b3d6a['shift']());}};_0x21e5e1(++_0x331af1);}(_0xd661,0x13a));var _0x1d66=function(_0x12902e,_0x2f230a){_0x12902e=_0x12902e-0x0;var _0x356854=_0xd661[_0x12902e];return _0x356854;};'use strict';var _=require(_0x1d66('0x0'));var util=require(_0x1d66('0x1'));var logger=require('../../config/logger')(_0x1d66('0x2'));var moment=require('moment');var BPromise=require(_0x1d66('0x3'));var rp=require('request-promise');var attributes=require(_0x1d66('0x4'));module[_0x1d66('0x5')]=function(_0x3d173a,_0x1dceb8){return _0x3d173a[_0x1d66('0x6')](_0x1d66('0x7'),attributes,{'tableName':_0x1d66('0x8'),'paranoid':![],'indexes':[{'fields':[_0x1d66('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 95fe8b0..f43921a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74d=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','UpdateVoiceDialReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5348b2,_0x56f74a){var _0x53af03=function(_0x319d8a){while(--_0x319d8a){_0x5348b2['push'](_0x5348b2['shift']());}};_0x53af03(++_0x56f74a);}(_0xa74d,0x1cf));var _0xda74=function(_0x189a66,_0x245d35){_0x189a66=_0x189a66-0x0;var _0x44fb31=_0xa74d[_0x189a66];return _0x44fb31;};'use strict';var _=require('lodash');var util=require(_0xda74('0x0'));var moment=require(_0xda74('0x1'));var BPromise=require(_0xda74('0x2'));var rs=require(_0xda74('0x3'));var fs=require('fs');var Redis=require(_0xda74('0x4'));var db=require(_0xda74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda74('0x6'))(_0xda74('0x7'));var config=require(_0xda74('0x8'));var jayson=require(_0xda74('0x9'));var client=jayson[_0xda74('0xa')][_0xda74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2113f2,_0x3fa4e7,_0x5da443){return new BPromise(function(_0x23d5f5,_0x517251){return client['request'](_0x2113f2,_0x5da443)[_0xda74('0xc')](function(_0x411790){logger['info'](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));logger[_0xda74('0xf')](_0xda74('0x10'),_0x3fa4e7,_0xda74('0xe'),JSON[_0xda74('0x11')](_0x411790));if(_0x411790[_0xda74('0x12')]){if(_0x411790[_0xda74('0x12')]['code']===0x1f4){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')]['message']);return _0x517251(_0x411790[_0xda74('0x12')][_0xda74('0x13')]);}logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')][_0xda74('0x13')]);return _0x23d5f5(_0x411790[_0xda74('0x12')]['message']);}else{logger[_0xda74('0x14')](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));_0x23d5f5(_0x411790[_0xda74('0x15')][_0xda74('0x13')]);}})['catch'](function(_0x1535d3){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x1535d3);_0x517251(_0x1535d3);});});}exports[_0xda74('0x16')]=function(_0x28baa9){var _0xd22576=this;return new Promise(function(_0x179a63,_0x504c77){return db[_0xda74('0x17')][_0xda74('0x18')](_0x28baa9[_0xda74('0x19')],{'raw':_0x28baa9[_0xda74('0x1a')]?_0x28baa9[_0xda74('0x1a')][_0xda74('0x1b')]===undefined?!![]:![]:!![]})[_0xda74('0xc')](function(_0x291dd6){logger['info']('CreateVoiceDialReport',_0x28baa9);logger['debug'](_0xda74('0x16'),_0x28baa9,JSON[_0xda74('0x11')](_0x291dd6));_0x179a63(_0x291dd6);})[_0xda74('0x1c')](function(_0x4494ad){logger['error']('CreateVoiceDialReport',_0x4494ad[_0xda74('0x13')],_0x28baa9);_0x504c77(_0xd22576[_0xda74('0x12')](0x1f4,_0x4494ad[_0xda74('0x13')]));});});};exports[_0xda74('0x1d')]=function(_0x34e2c9){var _0x4124cf=this;return new Promise(function(_0x504d58,_0x5d0bf8){return db[_0xda74('0x17')][_0xda74('0x1e')](_0x34e2c9[_0xda74('0x19')],{'raw':_0x34e2c9['options']?_0x34e2c9[_0xda74('0x1a')][_0xda74('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34e2c9['options']?_0x34e2c9[_0xda74('0x1a')][_0xda74('0x1f')]||null:null,'attributes':_0x34e2c9[_0xda74('0x1a')]?_0x34e2c9[_0xda74('0x1a')][_0xda74('0x20')]||null:null,'limit':_0x34e2c9['options']?_0x34e2c9['options'][_0xda74('0x21')]||null:null})['then'](function(_0x1651aa){logger[_0xda74('0x14')]('UpdateVoiceDialReport',_0x34e2c9);logger[_0xda74('0xf')]('UpdateVoiceDialReport',_0x34e2c9,JSON[_0xda74('0x11')](_0x1651aa));_0x504d58(_0x1651aa);})[_0xda74('0x1c')](function(_0x309353){logger['error'](_0xda74('0x1d'),_0x309353[_0xda74('0x13')],_0x34e2c9);_0x5d0bf8(_0x4124cf[_0xda74('0x12')](0x1f4,_0x309353[_0xda74('0x13')]));});});};
\ No newline at end of file
+var _0x3eec=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','VoiceDialReport,\x20%s,\x20%s','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','update','where','limit','lodash'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x42ab5b,_0x3eea3f){_0x42ab5b=_0x42ab5b-0x0;var _0x319c51=_0x3eec[_0x42ab5b];return _0x319c51;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')](_0x219db0[_0xc3ee('0x1b')],{'raw':_0x219db0[_0xc3ee('0x1c')]?_0x219db0[_0xc3ee('0x1c')][_0xc3ee('0x1d')]===undefined?!![]:![]:!![]})[_0xc3ee('0xd')](function(_0x3e7224){logger[_0xc3ee('0x15')](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x1e')](_0x3e7224));_0x3acb0c(_0x3e7224);})[_0xc3ee('0x17')](function(_0x493fea){logger['error'](_0xc3ee('0x18'),_0x493fea[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x493fea[_0xc3ee('0x13')]));});});};exports[_0xc3ee('0x1f')]=function(_0x238df7){var _0x57ab05=this;return new Promise(function(_0x450cd1,_0x3f8f7b){return db[_0xc3ee('0x19')][_0xc3ee('0x20')](_0x238df7[_0xc3ee('0x1b')],{'raw':_0x238df7['options']?_0x238df7['options'][_0xc3ee('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238df7[_0xc3ee('0x1c')]?_0x238df7[_0xc3ee('0x1c')][_0xc3ee('0x21')]||null:null,'attributes':_0x238df7[_0xc3ee('0x1c')]?_0x238df7['options']['attributes']||null:null,'limit':_0x238df7['options']?_0x238df7[_0xc3ee('0x1c')][_0xc3ee('0x22')]||null:null})[_0xc3ee('0xd')](function(_0x2fba96){logger[_0xc3ee('0x15')]('UpdateVoiceDialReport',_0x238df7);logger[_0xc3ee('0xf')](_0xc3ee('0x1f'),_0x238df7,JSON[_0xc3ee('0x1e')](_0x2fba96));_0x450cd1(_0x2fba96);})[_0xc3ee('0x17')](function(_0x1f7b3a){logger[_0xc3ee('0x11')](_0xc3ee('0x1f'),_0x1f7b3a['message'],_0x238df7);_0x3f8f7b(_0x57ab05[_0xc3ee('0x11')](0x1f4,_0x1f7b3a[_0xc3ee('0x13')]));});});};
\ No newline at end of file
index 28ba994..7fc25f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['/:id/applications','isAuthenticated','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','index','show','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd943,0x15d));var _0x3d94=function(_0x42e8e4,_0x4c13f1){_0x42e8e4=_0x42e8e4-0x0;var _0x1dff80=_0xd943[_0x42e8e4];return _0x1dff80;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var auth=require(_0x3d94('0x5'));var interaction=require(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var controller=require(_0x3d94('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x3d94('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3d94('0xa')]);router[_0x3d94('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3d94('0xb')](_0x3d94('0xc'),auth[_0x3d94('0xd')](),controller['addApplications']);router[_0x3d94('0xe')]('/:id',auth[_0x3d94('0xd')](),controller[_0x3d94('0xf')]);router['delete'](_0x3d94('0x10'),auth[_0x3d94('0xd')](),controller[_0x3d94('0x11')]);module[_0x3d94('0x12')]=router;
\ No newline at end of file
+var _0x8caf=['index','show','post','/:id/applications','addApplications','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0x4e5b30,_0x4aaf7e){var _0x42a5a5=function(_0x18701f){while(--_0x18701f){_0x4e5b30['push'](_0x4e5b30['shift']());}};_0x42a5a5(++_0x4aaf7e);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x6622a2,_0x401a17){_0x6622a2=_0x6622a2-0x0;var _0x52252e=_0x8caf[_0x6622a2];return _0x52252e;};'use strict';var multer=require('multer');var util=require(_0xf8ca('0x0'));var path=require(_0xf8ca('0x1'));var timeout=require(_0xf8ca('0x2'));var express=require(_0xf8ca('0x3'));var router=express[_0xf8ca('0x4')]();var auth=require(_0xf8ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf8ca('0x6'));var controller=require(_0xf8ca('0x7'));router[_0xf8ca('0x8')]('/',auth[_0xf8ca('0x9')](),controller[_0xf8ca('0xa')]);router[_0xf8ca('0x8')]('/:id',auth[_0xf8ca('0x9')](),controller[_0xf8ca('0xb')]);router[_0xf8ca('0xc')]('/',auth[_0xf8ca('0x9')](),controller['create']);router['post'](_0xf8ca('0xd'),auth['isAuthenticated'](),controller[_0xf8ca('0xe')]);router[_0xf8ca('0xf')](_0xf8ca('0x10'),auth[_0xf8ca('0x9')](),controller['update']);router[_0xf8ca('0x11')](_0xf8ca('0x10'),auth[_0xf8ca('0x9')](),controller[_0xf8ca('0x12')]);module['exports']=router;
\ No newline at end of file
index 31be2f5..384196d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x579c=['system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax'];(function(_0x43a870,_0x4c2a20){var _0x363c09=function(_0x430a76){while(--_0x430a76){_0x43a870['push'](_0x43a870['shift']());}};_0x363c09(++_0x4c2a20);}(_0x579c,0xda));var _0xc579=function(_0x16dbab,_0x3ac1e1){_0x16dbab=_0x16dbab-0x0;var _0x59b0b2=_0x579c[_0x16dbab];return _0x59b0b2;};'use strict';var Sequelize=require(_0xc579('0x0'));module[_0xc579('0x1')]={'context':{'type':Sequelize[_0xc579('0x2')],'allowNull':![],'unique':_0xc579('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc579('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xc579('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xc579('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc579('0x2')],'allowNull':![],'defaultValue':_0xc579('0x4')},'appdata':{'type':Sequelize[_0xc579('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc579('0x5')](_0xc579('0x6'),_0xc579('0x7'),'internal',_0xc579('0x8'),_0xc579('0x9'),_0xc579('0xa'),_0xc579('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xc579('0x2')]},'interval':{'type':Sequelize[_0xc579('0x2')],'allowNull':![],'defaultValue':_0xc579('0xc')},'IntervalId':{'type':Sequelize[_0xc579('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc579('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc579('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc579('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc579('0xd')]},'recordingFormat':{'type':Sequelize[_0xc579('0x2')],'defaultValue':_0xc579('0xf')},'answer':{'type':Sequelize[_0xc579('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc579('0x10')],'get':function(_0x421812){return this[_0xc579('0x11')](_0xc579('0x12'));}}};
\ No newline at end of file
+var _0x13f6=['any','INTEGER','BOOLEAN','VIRTUAL','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','system'];(function(_0x58411c,_0xdc29e3){var _0x183939=function(_0x12352b){while(--_0x12352b){_0x58411c['push'](_0x58411c['shift']());}};_0x183939(++_0xdc29e3);}(_0x13f6,0x124));var _0x613f=function(_0x4af765,_0x34e7f5){_0x4af765=_0x4af765-0x0;var _0xe1d7d6=_0x13f6[_0x4af765];return _0xe1d7d6;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x613f('0x2')],'allowNull':![],'unique':_0x613f('0x3')},'priority':{'type':Sequelize[_0x613f('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x613f('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x613f('0x2')],'allowNull':![],'defaultValue':_0x613f('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x613f('0x5')](_0x613f('0x6'),'outbound','internal','inbound-fax','outbound-fax',_0x613f('0x7'),_0x613f('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x613f('0x2')]},'interval':{'type':Sequelize[_0x613f('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x613f('0x9')]},'isApp':{'type':Sequelize[_0x613f('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x613f('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x613f('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x613f('0x9')]},'recordingFormat':{'type':Sequelize[_0x613f('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x613f('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x613f('0xb')],'get':function(_0x542230){return this['getDataValue']('exten');}}};
\ No newline at end of file
index 3391058..684e6c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a3f=['hasOwnProperty','nolimit','limit','order','sort','where','pick','add','day','merge','field','options','VoiceExtension','count','include','findAll','rows','catch','show','includeAll','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','context','recordingFormat','cutdigits','addApplications','findOne','sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','Content-Range','reject','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','attributes','intersection','fields','length'];(function(_0x361ae6,_0x22e345){var _0x49febb=function(_0x5e9bd9){while(--_0x5e9bd9){_0x361ae6['push'](_0x361ae6['shift']());}};_0x49febb(++_0x22e345);}(_0x1a3f,0x177));var _0xf1a3=function(_0x4624e9,_0x1a3d3b){_0x4624e9=_0x4624e9-0x0;var _0x5e80dc=_0x1a3f[_0x4624e9];return _0x5e80dc;};'use strict';var pdf=require(_0xf1a3('0x0'));var emlformat=require(_0xf1a3('0x1'));var rimraf=require(_0xf1a3('0x2'));var zipdir=require(_0xf1a3('0x3'));var jsonpatch=require(_0xf1a3('0x4'));var rp=require(_0xf1a3('0x5'));var moment=require('moment');var BPromise=require(_0xf1a3('0x6'));var Mustache=require(_0xf1a3('0x7'));var util=require(_0xf1a3('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf1a3('0x9'));var ejs=require(_0xf1a3('0xa'));var fs=require('fs');var _=require(_0xf1a3('0xb'));var squel=require(_0xf1a3('0xc'));var crypto=require(_0xf1a3('0xd'));var jsforce=require(_0xf1a3('0xe'));var deskjs=require(_0xf1a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf1a3('0x10'));var Papa=require(_0xf1a3('0x11'));var Redis=require(_0xf1a3('0x12'));var qs=require(_0xf1a3('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf1a3('0x14'));var config=require(_0xf1a3('0x15'));var db=require(_0xf1a3('0x16'))['db'];config[_0xf1a3('0x17')]=_[_0xf1a3('0x18')](config[_0xf1a3('0x17')],{'host':_0xf1a3('0x19'),'port':0x18eb});var socket=require(_0xf1a3('0x1a'))(new Redis(config['redis']));require(_0xf1a3('0x1b'))['register'](socket);function respondWithStatusCode(_0x1bd075,_0x33f8c3){_0x33f8c3=_0x33f8c3||0xcc;return function(_0x12d818){if(_0x12d818){return _0x1bd075[_0xf1a3('0x1c')](_0x33f8c3);}return _0x1bd075[_0xf1a3('0x1d')](_0x33f8c3)[_0xf1a3('0x1e')]();};}function respondWithResult(_0x17f70c,_0x2aed31){_0x2aed31=_0x2aed31||0xc8;return function(_0x40009e){if(_0x40009e){return _0x17f70c[_0xf1a3('0x1d')](_0x2aed31)[_0xf1a3('0x1f')](_0x40009e);}};}function respondWithFilteredResult(_0x3cc577,_0x1269aa){return function(_0x11d19c){if(_0x11d19c){var _0x2bd7f8=_0x11d19c['count'],_0x1200ad=_0x1269aa[_0xf1a3('0x20')],_0x3ee7d1=_0x1269aa['offset']+_0x1269aa['limit'],_0x1b3b18;if(_0x3ee7d1>=_0x2bd7f8){_0x3ee7d1=_0x2bd7f8;_0x1b3b18=0xc8;}else{_0x1b3b18=0xce;}_0x3cc577[_0xf1a3('0x1d')](_0x1b3b18);return _0x3cc577['set'](_0xf1a3('0x21'),_0x1200ad+'-'+_0x3ee7d1+'/'+_0x2bd7f8)['json'](_0x11d19c);}return null;};}function patchUpdates(_0x20398c){return function(_0x1159c0){try{jsonpatch['apply'](_0x1159c0,_0x20398c,!![]);}catch(_0x62c3f3){return BPromise[_0xf1a3('0x22')](_0x62c3f3);}return _0x1159c0['save']();};}function saveUpdates(_0x29f90a,_0x1bdcf8){return function(_0x59ecbd){if(_0x59ecbd){return _0x59ecbd[_0xf1a3('0x23')](_0x29f90a)[_0xf1a3('0x24')](function(_0x216c13){return _0x216c13;});}return null;};}function removeEntity(_0xe1e23c,_0x366de7){return function(_0x1fb6d9){if(_0x1fb6d9){return _0x1fb6d9[_0xf1a3('0x25')]()[_0xf1a3('0x24')](function(){var _0x59fe99=_0x1fb6d9[_0xf1a3('0x26')]({'plain':!![]});var _0x18823d=[{'name':_0xf1a3('0x27'),'value':_0xf1a3('0x28'),'ignore':![]},{'name':_0xf1a3('0x29'),'value':_0xf1a3('0x2a'),'ignore':![]},{'name':_0xf1a3('0x2b'),'value':_0xf1a3('0x2c'),'ignore':![]}];var _0x29b18e=_(_0x18823d)[_0xf1a3('0x2d')](_0xf1a3('0x2e'))[_0xf1a3('0x2f')](_0xf1a3('0x30'))[_0xf1a3('0x30')]();if(_[_0xf1a3('0x31')](_0x29b18e,_0x59fe99[_0xf1a3('0x32')])){return;}var _0x28f928=_[_0xf1a3('0x33')](_0x18823d,[_0xf1a3('0x30'),_0x59fe99[_0xf1a3('0x32')]])[_0xf1a3('0x34')];return db[_0xf1a3('0x35')]['destroy']({'where':{'type':_0x28f928,'resourceId':_0x59fe99['id']}})[_0xf1a3('0x24')](function(){return _0x1fb6d9;});})['then'](function(){_0xe1e23c[_0xf1a3('0x1d')](0xcc)[_0xf1a3('0x1e')]();});}};}function handleEntityNotFound(_0x1769fc,_0x23dd49){return function(_0x55120d){if(!_0x55120d){_0x1769fc[_0xf1a3('0x1c')](0x194);}return _0x55120d;};}function handleError(_0xe55e40,_0x50033f){_0x50033f=_0x50033f||0x1f4;return function(_0x2cc1c5){logger[_0xf1a3('0x36')](_0x2cc1c5[_0xf1a3('0x37')]);if(_0x2cc1c5[_0xf1a3('0x34')]){delete _0x2cc1c5['name'];}_0xe55e40[_0xf1a3('0x1d')](_0x50033f)[_0xf1a3('0x38')](_0x2cc1c5);};}exports[_0xf1a3('0x39')]=function(_0x57f22c,_0x5d35ee){var _0x3c48b3={},_0x4ab0a3={},_0x5569c7={'count':0x0,'rows':[]};var _0x471d67=db['VoiceExtension'][_0xf1a3('0x3a')];_0x4ab0a3[_0xf1a3('0x3b')]=_[_0xf1a3('0x3c')](_0x471d67);var _0x5cf7dc={'dateStart':_0x57f22c[_0xf1a3('0x3d')][_0xf1a3('0x3e')],'dateEnd':_0x57f22c[_0xf1a3('0x3d')][_0xf1a3('0x3f')]};delete _0x57f22c['query']['dateStart'];delete _0x57f22c['query'][_0xf1a3('0x3f')];_0x4ab0a3['query']=_['keys'](_0x57f22c[_0xf1a3('0x3d')]);_0x4ab0a3[_0xf1a3('0x40')]=_['intersection'](_0x4ab0a3[_0xf1a3('0x3b')],_0x4ab0a3['query']);_0x3c48b3[_0xf1a3('0x41')]=_[_0xf1a3('0x42')](_0x4ab0a3[_0xf1a3('0x3b')],qs[_0xf1a3('0x43')](_0x57f22c[_0xf1a3('0x3d')]['fields']));_0x3c48b3[_0xf1a3('0x41')]=_0x3c48b3[_0xf1a3('0x41')][_0xf1a3('0x44')]?_0x3c48b3[_0xf1a3('0x41')]:_0x4ab0a3['model'];if(!_0x57f22c[_0xf1a3('0x3d')][_0xf1a3('0x45')](_0xf1a3('0x46'))){_0x3c48b3['limit']=qs[_0xf1a3('0x47')](_0x57f22c[_0xf1a3('0x3d')][_0xf1a3('0x47')]);_0x3c48b3[_0xf1a3('0x20')]=qs[_0xf1a3('0x20')](_0x57f22c[_0xf1a3('0x3d')][_0xf1a3('0x20')]);}_0x3c48b3[_0xf1a3('0x48')]=qs[_0xf1a3('0x49')](_0x57f22c[_0xf1a3('0x3d')]['sort']);_0x3c48b3[_0xf1a3('0x4a')]=qs['filters'](_[_0xf1a3('0x4b')](_0x57f22c[_0xf1a3('0x3d')],_0x4ab0a3[_0xf1a3('0x40')]));if(_0x5cf7dc[_0xf1a3('0x3e')]){if(_0x5cf7dc[_0xf1a3('0x3f')]){_0x5cf7dc['dateEnd']=moment(_0x5cf7dc[_0xf1a3('0x3f')])[_0xf1a3('0x4c')](0x1,_0xf1a3('0x4d'));}else{_0x5cf7dc[_0xf1a3('0x3f')]=moment(_0x5cf7dc['dateStart'])[_0xf1a3('0x4c')](0x1,_0xf1a3('0x4d'));}_[_0xf1a3('0x4e')](_0x3c48b3[_0xf1a3('0x4a')],{'createdAt':{'$gte':_0x5cf7dc['dateStart'],'$lte':_0x5cf7dc[_0xf1a3('0x3f')]}});}if(_0x57f22c[_0xf1a3('0x3d')][_0xf1a3('0x2d')]){_0x3c48b3[_0xf1a3('0x4a')]=_[_0xf1a3('0x4e')](_0x3c48b3[_0xf1a3('0x4a')],{'$or':_[_0xf1a3('0x2f')](_0x471d67,function(_0x4a86b3){if(_0x4a86b3[_0xf1a3('0x32')]['key']!=='VIRTUAL'){var _0x4ef60b={};_0x4ef60b[_0x4a86b3[_0xf1a3('0x4f')]]={'$like':'%'+_0x57f22c['query']['filter']+'%'};return _0x4ef60b;}})});}_0x3c48b3=_[_0xf1a3('0x4e')]({},_0x3c48b3,_0x57f22c[_0xf1a3('0x50')]);var _0x2018fc={'where':_0x3c48b3[_0xf1a3('0x4a')]};return db[_0xf1a3('0x51')][_0xf1a3('0x52')](_0x2018fc)[_0xf1a3('0x24')](function(_0x514289){_0x5569c7['count']=_0x514289;if(_0x57f22c[_0xf1a3('0x3d')]['includeAll']){_0x3c48b3[_0xf1a3('0x53')]=[{'all':!![]}];}return db['VoiceExtension'][_0xf1a3('0x54')](_0x3c48b3);})[_0xf1a3('0x24')](function(_0xc89c38){_0x5569c7[_0xf1a3('0x55')]=_0xc89c38;return _0x5569c7;})[_0xf1a3('0x24')](respondWithFilteredResult(_0x5d35ee,_0x3c48b3))[_0xf1a3('0x56')](handleError(_0x5d35ee,null));};exports[_0xf1a3('0x57')]=function(_0x2d133e,_0x537499){var _0x1dc056={'raw':![],'where':{'id':_0x2d133e['params']['id']}},_0x4eb43e={};_0x4eb43e[_0xf1a3('0x3b')]=_[_0xf1a3('0x3c')](db[_0xf1a3('0x51')][_0xf1a3('0x3a')]);_0x4eb43e[_0xf1a3('0x3d')]=_['keys'](_0x2d133e[_0xf1a3('0x3d')]);_0x4eb43e['filters']=_['intersection'](_0x4eb43e[_0xf1a3('0x3b')],_0x4eb43e['query']);_0x1dc056['attributes']=_[_0xf1a3('0x42')](_0x4eb43e[_0xf1a3('0x3b')],qs[_0xf1a3('0x43')](_0x2d133e[_0xf1a3('0x3d')]['fields']));_0x1dc056[_0xf1a3('0x41')]=_0x1dc056[_0xf1a3('0x41')][_0xf1a3('0x44')]?_0x1dc056[_0xf1a3('0x41')]:_0x4eb43e['model'];if(_0x2d133e['query'][_0xf1a3('0x58')]){_0x1dc056[_0xf1a3('0x53')]=[{'all':!![]}];}_0x1dc056=_[_0xf1a3('0x4e')]({},_0x1dc056,_0x2d133e[_0xf1a3('0x50')]);return db[_0xf1a3('0x51')][_0xf1a3('0x33')](_0x1dc056)['then'](handleEntityNotFound(_0x537499,null))[_0xf1a3('0x24')](respondWithResult(_0x537499,null))[_0xf1a3('0x56')](handleError(_0x537499,null));};exports[_0xf1a3('0x25')]=function(_0x2b23c4,_0x46b613){return db[_0xf1a3('0x51')][_0xf1a3('0x33')]({'where':{'id':_0x2b23c4['params']['id']}})['then'](handleEntityNotFound(_0x46b613,null))['then'](removeEntity(_0x46b613,null))['catch'](handleError(_0x46b613,null));};exports['create']=function(_0x27cab1,_0x2b589c){if(_0x27cab1[_0xf1a3('0x59')][_0xf1a3('0x32')]===_0xf1a3('0x2a')&&!_[_0xf1a3('0x5a')](_0x27cab1[_0xf1a3('0x59')][_0xf1a3('0x5b')],'_')){_0x27cab1['body'][_0xf1a3('0x5b')]='_'[_0xf1a3('0x5c')](_0x27cab1['body'][_0xf1a3('0x5b')]);}return db[_0xf1a3('0x51')][_0xf1a3('0x5d')](_0x27cab1[_0xf1a3('0x59')],{'raw':![]})[_0xf1a3('0x24')](function(_0x130f3b){var _0x16b253=_0x27cab1[_0xf1a3('0x5e')][_0xf1a3('0x26')]({'plain':!![]});if(!_0x16b253)throw new Error(_0xf1a3('0x5f'));if(_0x16b253[_0xf1a3('0x60')]===_0xf1a3('0x5e')){var _0x4d9e3d=_0x130f3b[_0xf1a3('0x26')]({'plain':!![]});var _0x4184f8=[{'name':_0xf1a3('0x27'),'value':'inbound'},{'name':_0xf1a3('0x29'),'value':_0xf1a3('0x2a')},{'name':_0xf1a3('0x2b'),'value':_0xf1a3('0x2c')}];var _0x1293f7=_[_0xf1a3('0x33')](_0x4184f8,[_0xf1a3('0x30'),_0x4d9e3d[_0xf1a3('0x32')]])[_0xf1a3('0x34')];return db[_0xf1a3('0x61')][_0xf1a3('0x33')]({'where':{'name':_0x1293f7,'userProfileId':_0x16b253[_0xf1a3('0x62')]},'raw':!![]})[_0xf1a3('0x24')](function(_0x3fe991){if(_0x3fe991&&_0x3fe991['autoAssociation']===0x0){return db[_0xf1a3('0x35')][_0xf1a3('0x5d')]({'name':_0x4d9e3d[_0xf1a3('0x34')],'resourceId':_0x4d9e3d['id'],'type':_0x3fe991['name'],'sectionId':_0x3fe991['id']},{})[_0xf1a3('0x24')](function(){return _0x130f3b;});}else{return _0x130f3b;}})[_0xf1a3('0x56')](function(_0xbb97d2){logger[_0xf1a3('0x36')](_0xf1a3('0x63'),_0xbb97d2);throw _0xbb97d2;});}return _0x130f3b;})[_0xf1a3('0x24')](respondWithResult(_0x2b589c,0xc9))[_0xf1a3('0x56')](handleError(_0x2b589c,null));};exports[_0xf1a3('0x23')]=function(_0xec17bd,_0x53dc8e){if(_0xec17bd[_0xf1a3('0x59')]['id']){delete _0xec17bd[_0xf1a3('0x59')]['id'];}return db[_0xf1a3('0x51')][_0xf1a3('0x33')]({'where':{'id':_0xec17bd[_0xf1a3('0x64')]['id']}})['then'](handleEntityNotFound(_0x53dc8e,null))[_0xf1a3('0x24')](function(_0x5d0f40){if(_0x5d0f40){return db['VoiceExtension'][_0xf1a3('0x23')](_[_0xf1a3('0x4b')](_0xec17bd[_0xf1a3('0x59')],[_0xf1a3('0x5b'),_0xf1a3('0x65'),'description',_0xf1a3('0x66'),_0xf1a3('0x67')]),{'where':{'context':_0x5d0f40[_0xf1a3('0x65')],'exten':_0x5d0f40[_0xf1a3('0x5b')]},'individualHooks':!![]})[_0xf1a3('0x24')](function(_0x3a0e25){return _0x3a0e25;});}return null;})[_0xf1a3('0x24')](respondWithStatusCode(_0x53dc8e,null))[_0xf1a3('0x56')](handleError(_0x53dc8e,null));};exports[_0xf1a3('0x68')]=function(_0x1ca9ab,_0xa67759,_0x1224f4){return db['VoiceExtension'][_0xf1a3('0x69')]({'where':{'id':_0x1ca9ab[_0xf1a3('0x64')]['id']}})[_0xf1a3('0x24')](handleEntityNotFound(_0xa67759,null))[_0xf1a3('0x24')](function(_0x5e2823){if(_0x5e2823){return db[_0xf1a3('0x6a')]['transaction'](function(_0x28f1da){return db[_0xf1a3('0x51')]['destroy']({'where':{'VoiceExtensionId':_0x1ca9ab[_0xf1a3('0x64')]['id']},'transaction':_0x28f1da})[_0xf1a3('0x24')](function(_0x5ccdc){var _0x17527a=_[_0xf1a3('0x2f')](_0x1ca9ab[_0xf1a3('0x59')],function(_0xa40b40){_0xa40b40[_0xf1a3('0x6b')]=_0x1ca9ab[_0xf1a3('0x64')]['id'];return _0xa40b40;});return db[_0xf1a3('0x51')][_0xf1a3('0x6c')](_0x17527a,{'transaction':_0x28f1da});});})[_0xf1a3('0x24')](function(){return db[_0xf1a3('0x51')][_0xf1a3('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1ca9ab['params']['id']},'order':_0xf1a3('0x6e')});});}})[_0xf1a3('0x24')](respondWithResult(_0xa67759,null))[_0xf1a3('0x56')](handleError(_0xa67759,null));};
\ No newline at end of file
+var _0xeb9c=['query','dateStart','dateEnd','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','add','day','where','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','params','length','create','body','outbound','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','addApplications','findOne','sequelize','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','value','includes','type','find','UserProfileResource','error','stack','name','send','index','VoiceExtension','rawAttributes','model','keys'];(function(_0x1f3b7a,_0x143d2c){var _0x11309e=function(_0x5ef883){while(--_0x5ef883){_0x1f3b7a['push'](_0x1f3b7a['shift']());}};_0x11309e(++_0x143d2c);}(_0xeb9c,0x10c));var _0xceb9=function(_0x549933,_0x238fea){_0x549933=_0x549933-0x0;var _0x412356=_0xeb9c[_0x549933];return _0x412356;};'use strict';var pdf=require(_0xceb9('0x0'));var emlformat=require(_0xceb9('0x1'));var rimraf=require(_0xceb9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xceb9('0x3'));var rp=require(_0xceb9('0x4'));var moment=require(_0xceb9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xceb9('0x6'));var path=require(_0xceb9('0x7'));var sox=require(_0xceb9('0x8'));var csv=require(_0xceb9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xceb9('0xa'));var squel=require(_0xceb9('0xb'));var crypto=require(_0xceb9('0xc'));var jsforce=require(_0xceb9('0xd'));var deskjs=require(_0xceb9('0xe'));var toCsv=require(_0xceb9('0x9'));var querystring=require('querystring');var Papa=require(_0xceb9('0xf'));var Redis=require(_0xceb9('0x10'));var qs=require(_0xceb9('0x11'));var logger=require(_0xceb9('0x12'))(_0xceb9('0x13'));var utils=require(_0xceb9('0x14'));var config=require(_0xceb9('0x15'));var db=require('../../mysqldb')['db'];config[_0xceb9('0x16')]=_['defaults'](config[_0xceb9('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xceb9('0x17'))(new Redis(config[_0xceb9('0x16')]));require(_0xceb9('0x18'))[_0xceb9('0x19')](socket);function respondWithStatusCode(_0x381128,_0x2a3d60){_0x2a3d60=_0x2a3d60||0xcc;return function(_0x448c93){if(_0x448c93){return _0x381128[_0xceb9('0x1a')](_0x2a3d60);}return _0x381128[_0xceb9('0x1b')](_0x2a3d60)[_0xceb9('0x1c')]();};}function respondWithResult(_0x39591f,_0x2bcdbb){_0x2bcdbb=_0x2bcdbb||0xc8;return function(_0x421e2e){if(_0x421e2e){return _0x39591f[_0xceb9('0x1b')](_0x2bcdbb)[_0xceb9('0x1d')](_0x421e2e);}};}function respondWithFilteredResult(_0x2cc99d,_0x3b7984){return function(_0x1e454c){if(_0x1e454c){var _0x4d5929=_0x1e454c[_0xceb9('0x1e')],_0x2e5011=_0x3b7984[_0xceb9('0x1f')],_0x568125=_0x3b7984[_0xceb9('0x1f')]+_0x3b7984['limit'],_0x3a684b;if(_0x568125>=_0x4d5929){_0x568125=_0x4d5929;_0x3a684b=0xc8;}else{_0x3a684b=0xce;}_0x2cc99d[_0xceb9('0x1b')](_0x3a684b);return _0x2cc99d[_0xceb9('0x20')]('Content-Range',_0x2e5011+'-'+_0x568125+'/'+_0x4d5929)[_0xceb9('0x1d')](_0x1e454c);}return null;};}function patchUpdates(_0x533c13){return function(_0x534379){try{jsonpatch[_0xceb9('0x21')](_0x534379,_0x533c13,!![]);}catch(_0x4fa1df){return BPromise['reject'](_0x4fa1df);}return _0x534379[_0xceb9('0x22')]();};}function saveUpdates(_0x3ba87c,_0x13eab9){return function(_0x2fb487){if(_0x2fb487){return _0x2fb487[_0xceb9('0x23')](_0x3ba87c)[_0xceb9('0x24')](function(_0x401fb1){return _0x401fb1;});}return null;};}function removeEntity(_0x4bb862,_0x4de147){return function(_0x3a10d7){if(_0x3a10d7){return _0x3a10d7[_0xceb9('0x25')]()[_0xceb9('0x24')](function(){var _0x29d6ea=_0x3a10d7['get']({'plain':!![]});var _0x14b7ab=[{'name':_0xceb9('0x26'),'value':_0xceb9('0x27'),'ignore':![]},{'name':_0xceb9('0x28'),'value':'outbound','ignore':![]},{'name':_0xceb9('0x29'),'value':_0xceb9('0x2a'),'ignore':![]}];var _0xa3f04d=_(_0x14b7ab)[_0xceb9('0x2b')](_0xceb9('0x2c'))['map'](_0xceb9('0x2d'))[_0xceb9('0x2d')]();if(_[_0xceb9('0x2e')](_0xa3f04d,_0x29d6ea[_0xceb9('0x2f')])){return;}var _0x1984ca=_[_0xceb9('0x30')](_0x14b7ab,['value',_0x29d6ea['type']])['name'];return db[_0xceb9('0x31')][_0xceb9('0x25')]({'where':{'type':_0x1984ca,'resourceId':_0x29d6ea['id']}})[_0xceb9('0x24')](function(){return _0x3a10d7;});})[_0xceb9('0x24')](function(){_0x4bb862[_0xceb9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29b3ee,_0x4d5714){return function(_0x30c5fd){if(!_0x30c5fd){_0x29b3ee[_0xceb9('0x1a')](0x194);}return _0x30c5fd;};}function handleError(_0x404c06,_0x57982f){_0x57982f=_0x57982f||0x1f4;return function(_0x56786d){logger[_0xceb9('0x32')](_0x56786d[_0xceb9('0x33')]);if(_0x56786d[_0xceb9('0x34')]){delete _0x56786d['name'];}_0x404c06[_0xceb9('0x1b')](_0x57982f)[_0xceb9('0x35')](_0x56786d);};}exports[_0xceb9('0x36')]=function(_0x576217,_0x4e2356){var _0x32f29c={},_0x5f003f={},_0x33a7ca={'count':0x0,'rows':[]};var _0x2f7c80=db[_0xceb9('0x37')][_0xceb9('0x38')];_0x5f003f[_0xceb9('0x39')]=_[_0xceb9('0x3a')](_0x2f7c80);var _0x3b02cd={'dateStart':_0x576217[_0xceb9('0x3b')]['dateStart'],'dateEnd':_0x576217['query']['dateEnd']};delete _0x576217[_0xceb9('0x3b')][_0xceb9('0x3c')];delete _0x576217[_0xceb9('0x3b')][_0xceb9('0x3d')];_0x5f003f[_0xceb9('0x3b')]=_[_0xceb9('0x3a')](_0x576217['query']);_0x5f003f[_0xceb9('0x3e')]=_[_0xceb9('0x3f')](_0x5f003f[_0xceb9('0x39')],_0x5f003f[_0xceb9('0x3b')]);_0x32f29c[_0xceb9('0x40')]=_[_0xceb9('0x3f')](_0x5f003f['model'],qs[_0xceb9('0x41')](_0x576217[_0xceb9('0x3b')][_0xceb9('0x41')]));_0x32f29c[_0xceb9('0x40')]=_0x32f29c[_0xceb9('0x40')]['length']?_0x32f29c['attributes']:_0x5f003f[_0xceb9('0x39')];if(!_0x576217[_0xceb9('0x3b')][_0xceb9('0x42')]('nolimit')){_0x32f29c[_0xceb9('0x43')]=qs[_0xceb9('0x43')](_0x576217[_0xceb9('0x3b')][_0xceb9('0x43')]);_0x32f29c[_0xceb9('0x1f')]=qs[_0xceb9('0x1f')](_0x576217['query'][_0xceb9('0x1f')]);}_0x32f29c[_0xceb9('0x44')]=qs[_0xceb9('0x45')](_0x576217['query'][_0xceb9('0x45')]);_0x32f29c['where']=qs[_0xceb9('0x3e')](_[_0xceb9('0x46')](_0x576217[_0xceb9('0x3b')],_0x5f003f[_0xceb9('0x3e')]));if(_0x3b02cd[_0xceb9('0x3c')]){if(_0x3b02cd[_0xceb9('0x3d')]){_0x3b02cd['dateEnd']=moment(_0x3b02cd[_0xceb9('0x3d')])[_0xceb9('0x47')](0x1,_0xceb9('0x48'));}else{_0x3b02cd['dateEnd']=moment(_0x3b02cd[_0xceb9('0x3c')])[_0xceb9('0x47')](0x1,_0xceb9('0x48'));}_['merge'](_0x32f29c[_0xceb9('0x49')],{'createdAt':{'$gte':_0x3b02cd['dateStart'],'$lte':_0x3b02cd[_0xceb9('0x3d')]}});}if(_0x576217[_0xceb9('0x3b')][_0xceb9('0x2b')]){_0x32f29c[_0xceb9('0x49')]=_[_0xceb9('0x4a')](_0x32f29c[_0xceb9('0x49')],{'$or':_['map'](_0x2f7c80,function(_0x44f19e){if(_0x44f19e[_0xceb9('0x2f')][_0xceb9('0x4b')]!==_0xceb9('0x4c')){var _0x140c5c={};_0x140c5c[_0x44f19e[_0xceb9('0x4d')]]={'$like':'%'+_0x576217[_0xceb9('0x3b')]['filter']+'%'};return _0x140c5c;}})});}_0x32f29c=_['merge']({},_0x32f29c,_0x576217[_0xceb9('0x4e')]);var _0x867ce2={'where':_0x32f29c[_0xceb9('0x49')]};return db[_0xceb9('0x37')][_0xceb9('0x1e')](_0x867ce2)[_0xceb9('0x24')](function(_0x312f8e){_0x33a7ca[_0xceb9('0x1e')]=_0x312f8e;if(_0x576217['query'][_0xceb9('0x4f')]){_0x32f29c[_0xceb9('0x50')]=[{'all':!![]}];}return db[_0xceb9('0x37')][_0xceb9('0x51')](_0x32f29c);})[_0xceb9('0x24')](function(_0x48157f){_0x33a7ca[_0xceb9('0x52')]=_0x48157f;return _0x33a7ca;})[_0xceb9('0x24')](respondWithFilteredResult(_0x4e2356,_0x32f29c))['catch'](handleError(_0x4e2356,null));};exports['show']=function(_0x8f6cf,_0x1ef421){var _0x24fcc7={'raw':![],'where':{'id':_0x8f6cf[_0xceb9('0x53')]['id']}},_0x2de0a5={};_0x2de0a5[_0xceb9('0x39')]=_[_0xceb9('0x3a')](db[_0xceb9('0x37')]['rawAttributes']);_0x2de0a5[_0xceb9('0x3b')]=_['keys'](_0x8f6cf[_0xceb9('0x3b')]);_0x2de0a5[_0xceb9('0x3e')]=_[_0xceb9('0x3f')](_0x2de0a5[_0xceb9('0x39')],_0x2de0a5[_0xceb9('0x3b')]);_0x24fcc7[_0xceb9('0x40')]=_[_0xceb9('0x3f')](_0x2de0a5[_0xceb9('0x39')],qs[_0xceb9('0x41')](_0x8f6cf[_0xceb9('0x3b')][_0xceb9('0x41')]));_0x24fcc7[_0xceb9('0x40')]=_0x24fcc7[_0xceb9('0x40')][_0xceb9('0x54')]?_0x24fcc7[_0xceb9('0x40')]:_0x2de0a5['model'];if(_0x8f6cf['query'][_0xceb9('0x4f')]){_0x24fcc7['include']=[{'all':!![]}];}_0x24fcc7=_[_0xceb9('0x4a')]({},_0x24fcc7,_0x8f6cf[_0xceb9('0x4e')]);return db[_0xceb9('0x37')][_0xceb9('0x30')](_0x24fcc7)[_0xceb9('0x24')](handleEntityNotFound(_0x1ef421,null))['then'](respondWithResult(_0x1ef421,null))['catch'](handleError(_0x1ef421,null));};exports['destroy']=function(_0x2fbc6c,_0x59c3ec){return db[_0xceb9('0x37')][_0xceb9('0x30')]({'where':{'id':_0x2fbc6c[_0xceb9('0x53')]['id']}})[_0xceb9('0x24')](handleEntityNotFound(_0x59c3ec,null))[_0xceb9('0x24')](removeEntity(_0x59c3ec,null))['catch'](handleError(_0x59c3ec,null));};exports[_0xceb9('0x55')]=function(_0x29c7b9,_0x586323){if(_0x29c7b9[_0xceb9('0x56')][_0xceb9('0x2f')]===_0xceb9('0x57')&&!_[_0xceb9('0x58')](_0x29c7b9[_0xceb9('0x56')][_0xceb9('0x59')],'_')){_0x29c7b9['body'][_0xceb9('0x59')]='_'[_0xceb9('0x5a')](_0x29c7b9['body']['exten']);}return db[_0xceb9('0x37')][_0xceb9('0x55')](_0x29c7b9[_0xceb9('0x56')],{'raw':![]})[_0xceb9('0x24')](function(_0x4b4455){var _0xbb6c2c=_0x29c7b9[_0xceb9('0x5b')]['get']({'plain':!![]});if(!_0xbb6c2c)throw new Error(_0xceb9('0x5c'));if(_0xbb6c2c[_0xceb9('0x5d')]==='user'){var _0x194d09=_0x4b4455[_0xceb9('0x5e')]({'plain':!![]});var _0x82b091=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xceb9('0x28'),'value':_0xceb9('0x57')},{'name':_0xceb9('0x29'),'value':_0xceb9('0x2a')}];var _0xfa4944=_[_0xceb9('0x30')](_0x82b091,[_0xceb9('0x2d'),_0x194d09[_0xceb9('0x2f')]])['name'];return db[_0xceb9('0x5f')][_0xceb9('0x30')]({'where':{'name':_0xfa4944,'userProfileId':_0xbb6c2c['userProfileId']},'raw':!![]})[_0xceb9('0x24')](function(_0x176534){if(_0x176534&&_0x176534[_0xceb9('0x60')]===0x0){return db['UserProfileResource'][_0xceb9('0x55')]({'name':_0x194d09[_0xceb9('0x34')],'resourceId':_0x194d09['id'],'type':_0x176534[_0xceb9('0x34')],'sectionId':_0x176534['id']},{})[_0xceb9('0x24')](function(){return _0x4b4455;});}else{return _0x4b4455;}})[_0xceb9('0x61')](function(_0x517de5){logger[_0xceb9('0x32')](_0xceb9('0x62'),_0x517de5);throw _0x517de5;});}return _0x4b4455;})['then'](respondWithResult(_0x586323,0xc9))[_0xceb9('0x61')](handleError(_0x586323,null));};exports[_0xceb9('0x23')]=function(_0x5bd91c,_0x1d17c6){if(_0x5bd91c[_0xceb9('0x56')]['id']){delete _0x5bd91c[_0xceb9('0x56')]['id'];}return db[_0xceb9('0x37')][_0xceb9('0x30')]({'where':{'id':_0x5bd91c[_0xceb9('0x53')]['id']}})[_0xceb9('0x24')](handleEntityNotFound(_0x1d17c6,null))[_0xceb9('0x24')](function(_0x446504){if(_0x446504){return db[_0xceb9('0x37')][_0xceb9('0x23')](_[_0xceb9('0x46')](_0x5bd91c['body'],[_0xceb9('0x59'),_0xceb9('0x63'),'description',_0xceb9('0x64'),_0xceb9('0x65')]),{'where':{'context':_0x446504[_0xceb9('0x63')],'exten':_0x446504['exten']},'individualHooks':!![]})[_0xceb9('0x24')](function(_0x58f826){return _0x58f826;});}return null;})['then'](respondWithStatusCode(_0x1d17c6,null))['catch'](handleError(_0x1d17c6,null));};exports[_0xceb9('0x66')]=function(_0x1418ae,_0x1db343,_0x59f5ce){return db['VoiceExtension'][_0xceb9('0x67')]({'where':{'id':_0x1418ae[_0xceb9('0x53')]['id']}})[_0xceb9('0x24')](handleEntityNotFound(_0x1db343,null))['then'](function(_0x59c3ab){if(_0x59c3ab){return db[_0xceb9('0x68')]['transaction'](function(_0x5125da){return db[_0xceb9('0x37')][_0xceb9('0x25')]({'where':{'VoiceExtensionId':_0x1418ae[_0xceb9('0x53')]['id']},'transaction':_0x5125da})[_0xceb9('0x24')](function(_0x133cc5){var _0x1035ca=_['map'](_0x1418ae[_0xceb9('0x56')],function(_0x206e14){_0x206e14[_0xceb9('0x69')]=_0x1418ae['params']['id'];return _0x206e14;});return db['VoiceExtension'][_0xceb9('0x6a')](_0x1035ca,{'transaction':_0x5125da});});})[_0xceb9('0x24')](function(){return db[_0xceb9('0x37')][_0xceb9('0x6b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1418ae[_0xceb9('0x53')]['id']},'order':_0xceb9('0x6c')});});}})['then'](respondWithResult(_0x1db343,null))['catch'](handleError(_0x1db343,null));};
\ No newline at end of file
index f54ca5f..38a7ce7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68a4=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x3837c4,_0xa59d76){var _0xacdd80=function(_0x46d330){while(--_0x46d330){_0x3837c4['push'](_0x3837c4['shift']());}};_0xacdd80(++_0xa59d76);}(_0x68a4,0x193));var _0x468a=function(_0x2876a0,_0x5a09e3){_0x2876a0=_0x2876a0-0x0;var _0x5c4aae=_0x68a4[_0x2876a0];return _0x5c4aae;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x468a('0x0'))['db'][_0x468a('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x468a('0x2')](0x0);var events={'afterCreate':_0x468a('0x3'),'afterUpdate':_0x468a('0x4'),'afterDestroy':_0x468a('0x5')};function emitEvent(_0xa6ef35){return function(_0x252bfb,_0x52d94a,_0x22a881){VoiceExtensionEvents[_0x468a('0x6')](_0xa6ef35+':'+_0x252bfb['id'],_0x252bfb);VoiceExtensionEvents[_0x468a('0x6')](_0xa6ef35,_0x252bfb);_0x22a881(null);};}for(var e in events){if(events[_0x468a('0x7')](e)){var event=events[e];VoiceExtension[_0x468a('0x8')](e,emitEvent(event));}}module[_0x468a('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xe08e=['save','update','remove','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x141cdc,_0xa038e9){var _0x2d7d88=function(_0x5d161f){while(--_0x5d161f){_0x141cdc['push'](_0x141cdc['shift']());}};_0x2d7d88(++_0xa038e9);}(_0xe08e,0x94));var _0xee08=function(_0x4cf42c,_0x553eff){_0x4cf42c=_0x4cf42c-0x0;var _0x2f7a16=_0xe08e[_0x4cf42c];return _0x2f7a16;};'use strict';var EventEmitter=require(_0xee08('0x0'));var VoiceExtension=require(_0xee08('0x1'))['db'][_0xee08('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xee08('0x3')](0x0);var events={'afterCreate':_0xee08('0x4'),'afterUpdate':_0xee08('0x5'),'afterDestroy':_0xee08('0x6')};function emitEvent(_0x31e74d){return function(_0x4f54a4,_0x53fad0,_0x4ab391){VoiceExtensionEvents['emit'](_0x31e74d+':'+_0x4f54a4['id'],_0x4f54a4);VoiceExtensionEvents['emit'](_0x31e74d,_0x4f54a4);_0x4ab391(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xee08('0x7')]=VoiceExtensionEvents;
\ No newline at end of file
index 501cbd9..262ed21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98eb=['moment','bluebird','request-promise','./voiceExtension.attributes','VoiceExtension','lodash','util','../../config/logger','api'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x98eb,0x164));var _0xb98e=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x98eb[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0xb98e('0x0'));var util=require(_0xb98e('0x1'));var logger=require(_0xb98e('0x2'))(_0xb98e('0x3'));var moment=require(_0xb98e('0x4'));var BPromise=require(_0xb98e('0x5'));var rp=require(_0xb98e('0x6'));var attributes=require(_0xb98e('0x7'));module['exports']=function(_0x1d8666,_0x30d375){return _0x1d8666['define'](_0xb98e('0x8'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb9f6=['define','VoiceExtension','lodash','../../config/logger','api','bluebird','request-promise','./voiceExtension.attributes','exports'];(function(_0x348912,_0xf9beaa){var _0x28dd18=function(_0x13f520){while(--_0x13f520){_0x348912['push'](_0x348912['shift']());}};_0x28dd18(++_0xf9beaa);}(_0xb9f6,0x173));var _0x6b9f=function(_0x427848,_0x2d5116){_0x427848=_0x427848-0x0;var _0xb21e94=_0xb9f6[_0x427848];return _0xb21e94;};'use strict';var _=require(_0x6b9f('0x0'));var util=require('util');var logger=require(_0x6b9f('0x1'))(_0x6b9f('0x2'));var moment=require('moment');var BPromise=require(_0x6b9f('0x3'));var rp=require(_0x6b9f('0x4'));var attributes=require(_0x6b9f('0x5'));module[_0x6b9f('0x6')]=function(_0x38a4d0,_0x233ce3){return _0x38a4d0[_0x6b9f('0x7')](_0x6b9f('0x8'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97e3c68..64798a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x496f08,_0xeba77b){var _0x218602=function(_0x3b5bb7){while(--_0x3b5bb7){_0x496f08['push'](_0x496f08['shift']());}};_0x218602(++_0xeba77b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x383584,_0x503aff){_0x383584=_0x383584-0x0;var _0x58db5e=_0x9ffd[_0x383584];return _0x58db5e;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});}exports[_0xd9ff('0x1b')]=function(_0x39ef37){var _0x46a6ab=this;return new Promise(function(_0x4c8740,_0x4cf8ec){return db[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'raw':_0x39ef37['options']?_0x39ef37['options']['raw']===undefined?!![]:![]:!![],'where':_0x39ef37['options']?_0x39ef37[_0xd9ff('0x1e')]['where']||null:null,'attributes':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x1f')]||null:null,'limit':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x20')]||null:null,'include':_0x39ef37['options']?_0x39ef37['options'][_0xd9ff('0x21')]?_['map'](_0x39ef37[_0xd9ff('0x1e')]['include'],function(_0x285002){return{'model':db[_0x285002['model']],'as':_0x285002['as'],'attributes':_0x285002[_0xd9ff('0x1f')],'include':_0x285002[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x285002[_0xd9ff('0x21')],function(_0x5d685e){return{'model':db[_0x5d685e[_0xd9ff('0x23')]],'as':_0x5d685e['as'],'attributes':_0x5d685e[_0xd9ff('0x1f')],'include':_0x5d685e[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x5d685e['include'],function(_0x1d3684){return{'model':db[_0x1d3684[_0xd9ff('0x23')]],'as':_0x1d3684['as'],'attributes':_0x1d3684[_0xd9ff('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd9ff('0x11')](function(_0x263d3a){logger[_0xd9ff('0x12')](_0xd9ff('0x1b'),_0x39ef37);logger[_0xd9ff('0x24')](_0xd9ff('0x1b'),_0x39ef37,JSON['stringify'](_0x263d3a));_0x4c8740(_0x263d3a);})[_0xd9ff('0x1a')](function(_0x4ba2be){logger[_0xd9ff('0x16')](_0xd9ff('0x1b'),_0x4ba2be[_0xd9ff('0x18')],_0x39ef37);_0x4cf8ec(_0x46a6ab['error'](0x1f4,_0x4ba2be[_0xd9ff('0x18')]));});});};
\ No newline at end of file
+var _0xac4a=['ioredis','../../config/logger','rpc','../../config/environment','client','redis','localhost','./voiceExtension.socket','request','then','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','info','lodash','util','moment','bluebird','randomstring'];(function(_0x4c19e7,_0x2c32ce){var _0x2866fc=function(_0x38bf07){while(--_0x38bf07){_0x4c19e7['push'](_0x4c19e7['shift']());}};_0x2866fc(++_0x2c32ce);}(_0xac4a,0x13f));var _0xaac4=function(_0x1786e0,_0x34bbac){_0x1786e0=_0x1786e0-0x0;var _0x11fe5a=_0xac4a[_0x1786e0];return _0x11fe5a;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});config[_0xaac4('0xa')]=_['defaults'](config[_0xaac4('0xa')],{'host':_0xaac4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaac4('0xc'))['register'](socket);function respondWithRpcPromise(_0x452573,_0x59b992,_0x4f4c84){return new BPromise(function(_0xeb6b9a,_0x22cea4){return client[_0xaac4('0xd')](_0x452573,_0x4f4c84)[_0xaac4('0xe')](function(_0x3a983c){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x59b992,_0xaac4('0xf'));logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x59b992,'request\x20sent',JSON[_0xaac4('0x12')](_0x3a983c));if(_0x3a983c[_0xaac4('0x13')]){if(_0x3a983c['error'][_0xaac4('0x14')]===0x1f4){logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);return _0x22cea4(_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);}logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);return _0xeb6b9a(_0x3a983c[_0xaac4('0x13')][_0xaac4('0x16')]);}else{logger['info'](_0xaac4('0x15'),_0x59b992,'request\x20sent');_0xeb6b9a(_0x3a983c[_0xaac4('0x17')]['message']);}})[_0xaac4('0x18')](function(_0x27fe7b){logger[_0xaac4('0x13')](_0xaac4('0x15'),_0x59b992,_0x27fe7b);_0x22cea4(_0x27fe7b);});});}exports[_0xaac4('0x19')]=function(_0x2f3deb){var _0x44f0e8=this;return new Promise(function(_0x25b946,_0x4166ee){return db['VoiceExtension'][_0xaac4('0x1a')]({'raw':_0x2f3deb['options']?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x1d')]||null:null,'attributes':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb['options'][_0xaac4('0x1e')]||null:null,'limit':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x1f')]||null:null,'include':_0x2f3deb[_0xaac4('0x1b')]?_0x2f3deb[_0xaac4('0x1b')][_0xaac4('0x20')]?_['map'](_0x2f3deb[_0xaac4('0x1b')]['include'],function(_0x54203b){return{'model':db[_0x54203b['model']],'as':_0x54203b['as'],'attributes':_0x54203b['attributes'],'include':_0x54203b[_0xaac4('0x20')]?_[_0xaac4('0x21')](_0x54203b[_0xaac4('0x20')],function(_0xe93120){return{'model':db[_0xe93120[_0xaac4('0x22')]],'as':_0xe93120['as'],'attributes':_0xe93120[_0xaac4('0x1e')],'include':_0xe93120[_0xaac4('0x20')]?_[_0xaac4('0x21')](_0xe93120[_0xaac4('0x20')],function(_0x386c9b){return{'model':db[_0x386c9b['model']],'as':_0x386c9b['as'],'attributes':_0x386c9b[_0xaac4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaac4('0xe')](function(_0xda10b6){logger[_0xaac4('0x23')](_0xaac4('0x19'),_0x2f3deb);logger[_0xaac4('0x10')]('GetVoiceExtension',_0x2f3deb,JSON[_0xaac4('0x12')](_0xda10b6));_0x25b946(_0xda10b6);})['catch'](function(_0x2df7e3){logger[_0xaac4('0x13')](_0xaac4('0x19'),_0x2df7e3[_0xaac4('0x16')],_0x2f3deb);_0x4166ee(_0x44f0e8['error'](0x1f4,_0x2df7e3['message']));});});};
\ No newline at end of file
index eeb328a..1844121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9792=['length','voiceExtension:','./voiceExtension.events','save','removeListener','register'];(function(_0x530ec8,_0x3b402d){var _0xdd83a5=function(_0x55b080){while(--_0x55b080){_0x530ec8['push'](_0x530ec8['shift']());}};_0xdd83a5(++_0x3b402d);}(_0x9792,0xf2));var _0x2979=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9792[_0x53ccf2];return _0x5a2964;};'use strict';var VoiceExtensionEvents=require(_0x2979('0x0'));var events=[_0x2979('0x1'),'remove','update'];function createListener(_0xe3f528,_0x1ab362){return function(_0x366afc){_0x1ab362['emit'](_0xe3f528,_0x366afc);};}function removeListener(_0x474e5b,_0x316fa8){return function(){VoiceExtensionEvents[_0x2979('0x2')](_0x474e5b,_0x316fa8);};}exports[_0x2979('0x3')]=function(_0x50fd67){for(var _0x1a4e0b=0x0,_0x51ba17=events[_0x2979('0x4')];_0x1a4e0b<_0x51ba17;_0x1a4e0b++){var _0x22c143=events[_0x1a4e0b];var _0x5c118b=createListener(_0x2979('0x5')+_0x22c143,_0x50fd67);VoiceExtensionEvents['on'](_0x22c143,_0x5c118b);}};
\ No newline at end of file
+var _0x3025=['length','voiceExtension:','save','emit','removeListener','register'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x3025,0x19a));var _0x5302=function(_0x1f2be5,_0x4af22b){_0x1f2be5=_0x1f2be5-0x0;var _0x5e65ba=_0x3025[_0x1f2be5];return _0x5e65ba;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x5302('0x0'),'remove','update'];function createListener(_0x4388fb,_0xfdfce9){return function(_0x5a4efb){_0xfdfce9[_0x5302('0x1')](_0x4388fb,_0x5a4efb);};}function removeListener(_0x30e897,_0x54ee65){return function(){VoiceExtensionEvents[_0x5302('0x2')](_0x30e897,_0x54ee65);};}exports[_0x5302('0x3')]=function(_0x143f34){for(var _0x1b9719=0x0,_0x254cda=events[_0x5302('0x4')];_0x1b9719<_0x254cda;_0x1b9719++){var _0x3b2c62=events[_0x1b9719];var _0x1b4cab=createListener(_0x5302('0x5')+_0x3b2c62,_0x143f34);VoiceExtensionEvents['on'](_0x3b2c62,_0x1b4cab);}};
\ No newline at end of file
index 51b72cf..0877317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde00=['/:id/messages','post','put','update','destroy','multer','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x38c205,_0x5a34e9){var _0x51407f=function(_0x1bc521){while(--_0x1bc521){_0x38c205['push'](_0x38c205['shift']());}};_0x51407f(++_0x5a34e9);}(_0xde00,0x75));var _0x0de0=function(_0x273f77,_0xe5b0cb){_0x273f77=_0x273f77-0x0;var _0x71e147=_0xde00[_0x273f77];return _0x71e147;};'use strict';var multer=require(_0x0de0('0x0'));var util=require(_0x0de0('0x1'));var path=require(_0x0de0('0x2'));var timeout=require('connect-timeout');var express=require(_0x0de0('0x3'));var router=express[_0x0de0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0de0('0x5'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x0de0('0x6')]('/',auth[_0x0de0('0x7')](),controller[_0x0de0('0x8')]);router['get'](_0x0de0('0x9'),auth[_0x0de0('0x7')](),controller[_0x0de0('0xa')]);router['get'](_0x0de0('0xb'),auth[_0x0de0('0x7')](),controller['getMessages']);router[_0x0de0('0xc')]('/',auth[_0x0de0('0x7')](),controller['create']);router[_0x0de0('0xd')](_0x0de0('0x9'),auth['isAuthenticated'](),controller[_0x0de0('0xe')]);router['delete'](_0x0de0('0x9'),auth[_0x0de0('0x7')](),controller[_0x0de0('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1998=['post','create','put','update','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','show','getMessages'];(function(_0x4d0264,_0x4c177f){var _0x452e09=function(_0x59c9e5){while(--_0x59c9e5){_0x4d0264['push'](_0x4d0264['shift']());}};_0x452e09(++_0x4c177f);}(_0x1998,0x124));var _0x8199=function(_0x3ae6e7,_0x4f9453){_0x3ae6e7=_0x3ae6e7-0x0;var _0x426d19=_0x1998[_0x3ae6e7];return _0x426d19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8199('0x0'));var timeout=require('connect-timeout');var express=require(_0x8199('0x1'));var router=express[_0x8199('0x2')]();var auth=require(_0x8199('0x3'));var interaction=require(_0x8199('0x4'));var config=require(_0x8199('0x5'));var controller=require(_0x8199('0x6'));router['get']('/',auth[_0x8199('0x7')](),controller[_0x8199('0x8')]);router[_0x8199('0x9')]('/:id',auth[_0x8199('0x7')](),controller[_0x8199('0xa')]);router[_0x8199('0x9')]('/:id/messages',auth[_0x8199('0x7')](),controller[_0x8199('0xb')]);router[_0x8199('0xc')]('/',auth[_0x8199('0x7')](),controller[_0x8199('0xd')]);router[_0x8199('0xe')]('/:id',auth[_0x8199('0x7')](),controller[_0x8199('0xf')]);router['delete']('/:id',auth[_0x8199('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 45ce5d3..fa4e264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdddf=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0xdddf,0xb9));var _0xfddd=function(_0x42697e,_0x2785b9){_0x42697e=_0x42697e-0x0;var _0x2fd76b=_0xdddf[_0x42697e];return _0x2fd76b;};'use strict';var Sequelize=require(_0xfddd('0x0'));module[_0xfddd('0x1')]={'customer_id':{'type':Sequelize[_0xfddd('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xfddd('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xfddd('0x4')},'password':{'type':Sequelize[_0xfddd('0x2')]},'fullname':{'type':Sequelize[_0xfddd('0x2')]},'email':{'type':Sequelize[_0xfddd('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3fb1a0){this[_0xfddd('0x5')]('email',typeof _0x3fb1a0===_0xfddd('0x6')&&_0x3fb1a0[_0xfddd('0x7')]()?_0x3fb1a0[_0xfddd('0x7')]():null);}},'pager':{'type':Sequelize[_0xfddd('0x2')]},'tz':{'type':Sequelize[_0xfddd('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':_0xfddd('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xfddd('0x9'),'no'),'defaultValue':_0xfddd('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfddd('0x2')]},'callback':{'type':Sequelize[_0xfddd('0x2')]},'review':{'type':Sequelize['ENUM'](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfddd('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':_0xfddd('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xfddd('0x8')](_0xfddd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xfddd('0x9'),'allowNull':![]},'stamp':{'type':_0xfddd('0xb')},'emailsubject':{'type':Sequelize[_0xfddd('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xfddd('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xfddd('0xd')],'get':function(){return this[_0xfddd('0xe')](_0xfddd('0xf'))+_0xfddd('0x10')+this[_0xfddd('0xe')](_0xfddd('0x11'));}}};
\ No newline at end of file
+var _0xb623=['yes','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','string','central','ENUM'];(function(_0x35158c,_0x9fe124){var _0x2df28d=function(_0x58276b){while(--_0x58276b){_0x35158c['push'](_0x35158c['shift']());}};_0x2df28d(++_0x9fe124);}(_0xb623,0x115));var _0x3b62=function(_0x5bacc3,_0xe665fa){_0x5bacc3=_0x5bacc3-0x0;var _0x42ed1c=_0xb623[_0x5bacc3];return _0x42ed1c;};'use strict';var Sequelize=require(_0x3b62('0x0'));module[_0x3b62('0x1')]={'customer_id':{'type':Sequelize[_0x3b62('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x3b62('0x3'),'unique':_0x3b62('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x3b62('0x4')},'password':{'type':Sequelize[_0x3b62('0x2')]},'fullname':{'type':Sequelize[_0x3b62('0x2')]},'email':{'type':Sequelize[_0x3b62('0x2')],'validate':{'isEmail':!![]},'set':function(_0x19901f){this['setDataValue']('email',typeof _0x19901f===_0x3b62('0x5')&&_0x19901f['trim']()?_0x19901f['trim']():null);}},'pager':{'type':Sequelize[_0x3b62('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x3b62('0x6')},'attach':{'type':Sequelize[_0x3b62('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3b62('0x7')]('yes','no'),'defaultValue':_0x3b62('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3b62('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x3b62('0x7')](_0x3b62('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3b62('0x7')](_0x3b62('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3b62('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3b62('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3b62('0x7')](_0x3b62('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3b62('0x7')](_0x3b62('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3b62('0x7')](_0x3b62('0x8'),'no'),'defaultValue':_0x3b62('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3b62('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3b62('0x7')](_0x3b62('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3b62('0x7')](_0x3b62('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3b62('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x3b62('0x2')]},'maxsecs':{'type':Sequelize[_0x3b62('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3b62('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3b62('0xb')],'get':function(){return this['getDataValue']('fullname')+_0x3b62('0xc')+this[_0x3b62('0xd')](_0x3b62('0xe'));}}};
\ No newline at end of file
index 56039a5..2a80486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba57=['dateStart','dateEnd','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','day','merge','where','filter','type','key','field','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','get','Voicemails','UserProfileResource','destroy','stack','name','send','index','VoiceMail','query'];(function(_0x342874,_0xae5304){var _0x503c39=function(_0xd68ca4){while(--_0xd68ca4){_0x342874['push'](_0x342874['shift']());}};_0x503c39(++_0xae5304);}(_0xba57,0x16f));var _0x7ba5=function(_0x57d0f0,_0x1b94c7){_0x57d0f0=_0x57d0f0-0x0;var _0x3d0b3b=_0xba57[_0x57d0f0];return _0x3d0b3b;};'use strict';var pdf=require(_0x7ba5('0x0'));var emlformat=require(_0x7ba5('0x1'));var rimraf=require(_0x7ba5('0x2'));var zipdir=require(_0x7ba5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7ba5('0x4'));var BPromise=require(_0x7ba5('0x5'));var Mustache=require('mustache');var util=require(_0x7ba5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7ba5('0x7'));var ejs=require(_0x7ba5('0x8'));var fs=require('fs');var _=require(_0x7ba5('0x9'));var squel=require(_0x7ba5('0xa'));var crypto=require('crypto');var jsforce=require(_0x7ba5('0xb'));var deskjs=require(_0x7ba5('0xc'));var toCsv=require(_0x7ba5('0x7'));var querystring=require(_0x7ba5('0xd'));var Papa=require(_0x7ba5('0xe'));var Redis=require('ioredis');var qs=require(_0x7ba5('0xf'));var logger=require(_0x7ba5('0x10'))(_0x7ba5('0x11'));var utils=require(_0x7ba5('0x12'));var config=require(_0x7ba5('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47bf31,_0x37e314){_0x37e314=_0x37e314||0xcc;return function(_0x33e966){if(_0x33e966){return _0x47bf31[_0x7ba5('0x14')](_0x37e314);}return _0x47bf31['status'](_0x37e314)[_0x7ba5('0x15')]();};}function respondWithResult(_0x202dfb,_0x2f43a9){_0x2f43a9=_0x2f43a9||0xc8;return function(_0x35c222){if(_0x35c222){return _0x202dfb[_0x7ba5('0x16')](_0x2f43a9)[_0x7ba5('0x17')](_0x35c222);}};}function respondWithFilteredResult(_0x2f8939,_0x5704ac){return function(_0x4c0586){if(_0x4c0586){var _0xce645f=_0x4c0586[_0x7ba5('0x18')],_0x57a701=_0x5704ac[_0x7ba5('0x19')],_0x2ad991=_0x5704ac['offset']+_0x5704ac[_0x7ba5('0x1a')],_0x2fe7f0;if(_0x2ad991>=_0xce645f){_0x2ad991=_0xce645f;_0x2fe7f0=0xc8;}else{_0x2fe7f0=0xce;}_0x2f8939[_0x7ba5('0x16')](_0x2fe7f0);return _0x2f8939[_0x7ba5('0x1b')]('Content-Range',_0x57a701+'-'+_0x2ad991+'/'+_0xce645f)[_0x7ba5('0x17')](_0x4c0586);}return null;};}function patchUpdates(_0x56d978){return function(_0x1c0de8){try{jsonpatch[_0x7ba5('0x1c')](_0x1c0de8,_0x56d978,!![]);}catch(_0x309865){return BPromise[_0x7ba5('0x1d')](_0x309865);}return _0x1c0de8[_0x7ba5('0x1e')]();};}function saveUpdates(_0x5e1a2e,_0x58ca68){return function(_0x3d766c){if(_0x3d766c){return _0x3d766c[_0x7ba5('0x1f')](_0x5e1a2e)[_0x7ba5('0x20')](function(_0x304113){return _0x304113;});}return null;};}function removeEntity(_0x2d7faf,_0x35122f){return function(_0x350286){if(_0x350286){return _0x350286['destroy']()[_0x7ba5('0x20')](function(){var _0x30cf0f=_0x350286[_0x7ba5('0x21')]({'plain':!![]});var _0x46a753=_0x7ba5('0x22');return db[_0x7ba5('0x23')][_0x7ba5('0x24')]({'where':{'type':_0x46a753,'resourceId':_0x30cf0f['id']}})[_0x7ba5('0x20')](function(){return _0x350286;});})['then'](function(){_0x2d7faf[_0x7ba5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35eaa4,_0x1185e0){return function(_0x591b8e){if(!_0x591b8e){_0x35eaa4[_0x7ba5('0x14')](0x194);}return _0x591b8e;};}function handleError(_0x59c4d6,_0x2798a9){_0x2798a9=_0x2798a9||0x1f4;return function(_0x40a518){logger['error'](_0x40a518[_0x7ba5('0x25')]);if(_0x40a518[_0x7ba5('0x26')]){delete _0x40a518[_0x7ba5('0x26')];}_0x59c4d6[_0x7ba5('0x16')](_0x2798a9)[_0x7ba5('0x27')](_0x40a518);};}exports[_0x7ba5('0x28')]=function(_0x3ff921,_0x103edb){var _0x1b562={},_0x5a50b6={},_0xc55ebf={'count':0x0,'rows':[]};var _0x36b3be=db[_0x7ba5('0x29')]['rawAttributes'];_0x5a50b6['model']=_['keys'](_0x36b3be);var _0x169e94={'dateStart':_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x2b')],'dateEnd':_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x2c')]};delete _0x3ff921[_0x7ba5('0x2a')]['dateStart'];delete _0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x2c')];_0x5a50b6['query']=_[_0x7ba5('0x2d')](_0x3ff921['query']);_0x5a50b6[_0x7ba5('0x2e')]=_['intersection'](_0x5a50b6[_0x7ba5('0x2f')],_0x5a50b6[_0x7ba5('0x2a')]);_0x1b562[_0x7ba5('0x30')]=_[_0x7ba5('0x31')](_0x5a50b6['model'],qs[_0x7ba5('0x32')](_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x32')]));_0x1b562['attributes']=_0x1b562['attributes']['length']?_0x1b562['attributes']:_0x5a50b6[_0x7ba5('0x2f')];if(!_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x33')](_0x7ba5('0x34'))){_0x1b562[_0x7ba5('0x1a')]=qs['limit'](_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x1a')]);_0x1b562[_0x7ba5('0x19')]=qs[_0x7ba5('0x19')](_0x3ff921['query'][_0x7ba5('0x19')]);}_0x1b562['order']=qs[_0x7ba5('0x35')](_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x35')]);_0x1b562['where']=qs['filters'](_['pick'](_0x3ff921[_0x7ba5('0x2a')],_0x5a50b6[_0x7ba5('0x2e')]));if(_0x169e94[_0x7ba5('0x2b')]){if(_0x169e94[_0x7ba5('0x2c')]){_0x169e94[_0x7ba5('0x2c')]=moment(_0x169e94[_0x7ba5('0x2c')])['add'](0x1,_0x7ba5('0x36'));}else{_0x169e94[_0x7ba5('0x2c')]=moment(_0x169e94[_0x7ba5('0x2b')])['add'](0x1,_0x7ba5('0x36'));}_[_0x7ba5('0x37')](_0x1b562[_0x7ba5('0x38')],{'createdAt':{'$gte':_0x169e94[_0x7ba5('0x2b')],'$lte':_0x169e94[_0x7ba5('0x2c')]}});}if(_0x3ff921['query'][_0x7ba5('0x39')]){_0x1b562['where']=_[_0x7ba5('0x37')](_0x1b562[_0x7ba5('0x38')],{'$or':_['map'](_0x36b3be,function(_0x8b13c7){if(_0x8b13c7[_0x7ba5('0x3a')][_0x7ba5('0x3b')]!=='VIRTUAL'){var _0x3d02d6={};_0x3d02d6[_0x8b13c7[_0x7ba5('0x3c')]]={'$like':'%'+_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x39')]+'%'};return _0x3d02d6;}})});}_0x1b562=_['merge']({},_0x1b562,_0x3ff921['options']);var _0x38e5f8={'where':_0x1b562[_0x7ba5('0x38')]};return db['VoiceMail'][_0x7ba5('0x18')](_0x38e5f8)['then'](function(_0x5815d4){_0xc55ebf['count']=_0x5815d4;if(_0x3ff921[_0x7ba5('0x2a')][_0x7ba5('0x3d')]){_0x1b562[_0x7ba5('0x3e')]=[{'all':!![]}];}return db[_0x7ba5('0x29')][_0x7ba5('0x3f')](_0x1b562);})[_0x7ba5('0x20')](function(_0x16149e){_0xc55ebf[_0x7ba5('0x40')]=_0x16149e;return _0xc55ebf;})[_0x7ba5('0x20')](respondWithFilteredResult(_0x103edb,_0x1b562))[_0x7ba5('0x41')](handleError(_0x103edb,null));};exports[_0x7ba5('0x42')]=function(_0x1ad1b8,_0x206770){var _0x10c1f8={'raw':!![],'where':{'id':_0x1ad1b8[_0x7ba5('0x43')]['id']}},_0x5bd7f1={};_0x5bd7f1[_0x7ba5('0x2f')]=_['keys'](db[_0x7ba5('0x29')]['rawAttributes']);_0x5bd7f1['query']=_[_0x7ba5('0x2d')](_0x1ad1b8[_0x7ba5('0x2a')]);_0x5bd7f1[_0x7ba5('0x2e')]=_[_0x7ba5('0x31')](_0x5bd7f1[_0x7ba5('0x2f')],_0x5bd7f1[_0x7ba5('0x2a')]);_0x10c1f8[_0x7ba5('0x30')]=_[_0x7ba5('0x31')](_0x5bd7f1[_0x7ba5('0x2f')],qs[_0x7ba5('0x32')](_0x1ad1b8[_0x7ba5('0x2a')][_0x7ba5('0x32')]));_0x10c1f8[_0x7ba5('0x30')]=_0x10c1f8[_0x7ba5('0x30')][_0x7ba5('0x44')]?_0x10c1f8[_0x7ba5('0x30')]:_0x5bd7f1[_0x7ba5('0x2f')];if(_0x1ad1b8[_0x7ba5('0x2a')]['includeAll']){_0x10c1f8['include']=[{'all':!![]}];}_0x10c1f8=_[_0x7ba5('0x37')]({},_0x10c1f8,_0x1ad1b8[_0x7ba5('0x45')]);return db['VoiceMail'][_0x7ba5('0x46')](_0x10c1f8)[_0x7ba5('0x20')](handleEntityNotFound(_0x206770,null))[_0x7ba5('0x20')](respondWithResult(_0x206770,null))[_0x7ba5('0x41')](handleError(_0x206770,null));};exports['create']=function(_0x30f780,_0x106bf4){return db[_0x7ba5('0x29')][_0x7ba5('0x47')](_0x30f780[_0x7ba5('0x48')],{})['then'](function(_0x550829){var _0x25ecce=_0x30f780[_0x7ba5('0x49')][_0x7ba5('0x21')]({'plain':!![]});if(!_0x25ecce)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25ecce[_0x7ba5('0x4a')]==='user'){var _0x156b34=_0x550829['get']({'plain':!![]});var _0x2b29f3=_0x7ba5('0x22');return db[_0x7ba5('0x4b')]['find']({'where':{'name':_0x2b29f3,'userProfileId':_0x25ecce[_0x7ba5('0x4c')]},'raw':!![]})[_0x7ba5('0x20')](function(_0x82d408){if(_0x82d408&&_0x82d408[_0x7ba5('0x4d')]===0x0){return db[_0x7ba5('0x23')][_0x7ba5('0x47')]({'name':_0x156b34['name'],'resourceId':_0x156b34['id'],'type':_0x82d408[_0x7ba5('0x26')],'sectionId':_0x82d408['id']},{})[_0x7ba5('0x20')](function(){return _0x550829;});}else{return _0x550829;}})['catch'](function(_0x3a3f84){logger[_0x7ba5('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a3f84);throw _0x3a3f84;});}return _0x550829;})[_0x7ba5('0x20')](respondWithResult(_0x106bf4,0xc9))['catch'](handleError(_0x106bf4,null));};exports[_0x7ba5('0x1f')]=function(_0x41a9b8,_0xb46fc3){if(_0x41a9b8[_0x7ba5('0x48')]['id']){delete _0x41a9b8[_0x7ba5('0x48')]['id'];}return db[_0x7ba5('0x29')]['find']({'where':{'id':_0x41a9b8['params']['id']}})[_0x7ba5('0x20')](handleEntityNotFound(_0xb46fc3,null))['then'](saveUpdates(_0x41a9b8[_0x7ba5('0x48')],null))['then'](respondWithResult(_0xb46fc3,null))[_0x7ba5('0x41')](handleError(_0xb46fc3,null));};exports[_0x7ba5('0x24')]=function(_0x24c415,_0x293811){return db['VoiceMail']['find']({'where':{'id':_0x24c415[_0x7ba5('0x43')]['id']}})[_0x7ba5('0x20')](handleEntityNotFound(_0x293811,null))[_0x7ba5('0x20')](removeEntity(_0x293811,null))[_0x7ba5('0x41')](handleError(_0x293811,null));};exports['getMessages']=function(_0x3f24b3,_0x161bed,_0x1c2fcd){return db['VoiceMail']['findOne']({'where':{'id':_0x3f24b3['params']['id']}})['then'](handleEntityNotFound(_0x161bed,null))[_0x7ba5('0x20')](function(_0x5c654a){var _0x4f7e1b;var _0xc080e6={},_0x512bb3={};_0x512bb3[_0x7ba5('0x2f')]=_[_0x7ba5('0x2d')](db[_0x7ba5('0x4f')]['rawAttributes']);_0x512bb3[_0x7ba5('0x2a')]=_[_0x7ba5('0x2d')](_0x3f24b3[_0x7ba5('0x2a')]);_0x512bb3[_0x7ba5('0x2e')]=_[_0x7ba5('0x31')](_0x512bb3[_0x7ba5('0x2f')],_0x512bb3['query']);_0xc080e6[_0x7ba5('0x30')]=_[_0x7ba5('0x31')](_0x512bb3['model'],qs[_0x7ba5('0x32')](_0x3f24b3[_0x7ba5('0x2a')][_0x7ba5('0x32')]));_0xc080e6['attributes']=_0xc080e6[_0x7ba5('0x30')][_0x7ba5('0x44')]?_0xc080e6['attributes']:_0x512bb3[_0x7ba5('0x2f')];if(!_0x3f24b3['query']['hasOwnProperty'](_0x7ba5('0x34'))){_0xc080e6['limit']=qs[_0x7ba5('0x1a')](_0x3f24b3[_0x7ba5('0x2a')][_0x7ba5('0x1a')]);_0xc080e6[_0x7ba5('0x19')]=qs[_0x7ba5('0x19')](_0x3f24b3['query'][_0x7ba5('0x19')]);}_0xc080e6['order']=qs[_0x7ba5('0x35')](_0x3f24b3['query'][_0x7ba5('0x35')]);_0xc080e6['where']=qs[_0x7ba5('0x2e')](_['pick'](_0x3f24b3[_0x7ba5('0x2a')],_0x512bb3['filters']));if(_0x3f24b3[_0x7ba5('0x2a')][_0x7ba5('0x39')]){_0xc080e6[_0x7ba5('0x38')]=_[_0x7ba5('0x37')](_0xc080e6[_0x7ba5('0x38')],{'$or':_['map'](_0xc080e6[_0x7ba5('0x30')],function(_0xeaa8a2){var _0x455135={};_0x455135[_0xeaa8a2]={'$like':'%'+_0x3f24b3['query'][_0x7ba5('0x39')]+'%'};return _0x455135;})});}_0xc080e6[_0x7ba5('0x38')]=_[_0x7ba5('0x37')](_0xc080e6[_0x7ba5('0x38')],{'mailboxuser':_0x5c654a[_0x7ba5('0x50')]});_0xc080e6=_[_0x7ba5('0x37')]({},_0xc080e6,_0x3f24b3[_0x7ba5('0x45')]);return db['VoiceMailMessage'][_0x7ba5('0x51')](_0xc080e6)[_0x7ba5('0x20')](respondWithFilteredResult(_0x161bed,_0xc080e6));})[_0x7ba5('0x41')](handleError(_0x161bed,null));};
\ No newline at end of file
+var _0xba89=['VoiceMail','rawAttributes','model','query','dateStart','dateEnd','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','add','day','merge','filter','key','VIRTUAL','field','options','include','rows','catch','show','params','includeAll','create','body','user','find','userProfileId','autoAssociation','getMessages','findOne','VoiceMailMessage','nolimit','map','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','reject','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index'];(function(_0x2081aa,_0x31d653){var _0x36485d=function(_0x4381f5){while(--_0x4381f5){_0x2081aa['push'](_0x2081aa['shift']());}};_0x36485d(++_0x31d653);}(_0xba89,0x7e));var _0x9ba8=function(_0x104072,_0x3f331e){_0x104072=_0x104072-0x0;var _0x2a7893=_0xba89[_0x104072];return _0x2a7893;};'use strict';var pdf=require(_0x9ba8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ba8('0x1'));var zipdir=require(_0x9ba8('0x2'));var jsonpatch=require(_0x9ba8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9ba8('0x4'));var Mustache=require('mustache');var util=require(_0x9ba8('0x5'));var path=require(_0x9ba8('0x6'));var sox=require(_0x9ba8('0x7'));var csv=require(_0x9ba8('0x8'));var ejs=require(_0x9ba8('0x9'));var fs=require('fs');var _=require(_0x9ba8('0xa'));var squel=require(_0x9ba8('0xb'));var crypto=require(_0x9ba8('0xc'));var jsforce=require(_0x9ba8('0xd'));var deskjs=require(_0x9ba8('0xe'));var toCsv=require(_0x9ba8('0x8'));var querystring=require(_0x9ba8('0xf'));var Papa=require('papaparse');var Redis=require(_0x9ba8('0x10'));var qs=require(_0x9ba8('0x11'));var logger=require(_0x9ba8('0x12'))('api');var utils=require(_0x9ba8('0x13'));var config=require(_0x9ba8('0x14'));var db=require(_0x9ba8('0x15'))['db'];function respondWithStatusCode(_0x193b2a,_0x1b5a69){_0x1b5a69=_0x1b5a69||0xcc;return function(_0x2b7d00){if(_0x2b7d00){return _0x193b2a['sendStatus'](_0x1b5a69);}return _0x193b2a['status'](_0x1b5a69)[_0x9ba8('0x16')]();};}function respondWithResult(_0x5b8062,_0x58a43c){_0x58a43c=_0x58a43c||0xc8;return function(_0x489d96){if(_0x489d96){return _0x5b8062[_0x9ba8('0x17')](_0x58a43c)['json'](_0x489d96);}};}function respondWithFilteredResult(_0xa98a51,_0x57ed5f){return function(_0x5c962f){if(_0x5c962f){var _0x2afb68=_0x5c962f[_0x9ba8('0x18')],_0x2c3e44=_0x57ed5f[_0x9ba8('0x19')],_0x3c8163=_0x57ed5f[_0x9ba8('0x19')]+_0x57ed5f[_0x9ba8('0x1a')],_0x25fddb;if(_0x3c8163>=_0x2afb68){_0x3c8163=_0x2afb68;_0x25fddb=0xc8;}else{_0x25fddb=0xce;}_0xa98a51[_0x9ba8('0x17')](_0x25fddb);return _0xa98a51[_0x9ba8('0x1b')](_0x9ba8('0x1c'),_0x2c3e44+'-'+_0x3c8163+'/'+_0x2afb68)[_0x9ba8('0x1d')](_0x5c962f);}return null;};}function patchUpdates(_0x2cbcfb){return function(_0x1c996c){try{jsonpatch['apply'](_0x1c996c,_0x2cbcfb,!![]);}catch(_0x6774ed){return BPromise[_0x9ba8('0x1e')](_0x6774ed);}return _0x1c996c['save']();};}function saveUpdates(_0x44036e,_0x349635){return function(_0x53742b){if(_0x53742b){return _0x53742b[_0x9ba8('0x1f')](_0x44036e)['then'](function(_0x44a7c4){return _0x44a7c4;});}return null;};}function removeEntity(_0x262e66,_0x161369){return function(_0x2dfee8){if(_0x2dfee8){return _0x2dfee8[_0x9ba8('0x20')]()[_0x9ba8('0x21')](function(){var _0x1a5d3e=_0x2dfee8[_0x9ba8('0x22')]({'plain':!![]});var _0x591bba='Voicemails';return db[_0x9ba8('0x23')]['destroy']({'where':{'type':_0x591bba,'resourceId':_0x1a5d3e['id']}})[_0x9ba8('0x21')](function(){return _0x2dfee8;});})[_0x9ba8('0x21')](function(){_0x262e66[_0x9ba8('0x17')](0xcc)[_0x9ba8('0x16')]();});}};}function handleEntityNotFound(_0x3ea9ba,_0x3e1fd6){return function(_0x5eb2a1){if(!_0x5eb2a1){_0x3ea9ba[_0x9ba8('0x24')](0x194);}return _0x5eb2a1;};}function handleError(_0x3e27a2,_0x2eb5b8){_0x2eb5b8=_0x2eb5b8||0x1f4;return function(_0x82234){logger[_0x9ba8('0x25')](_0x82234[_0x9ba8('0x26')]);if(_0x82234[_0x9ba8('0x27')]){delete _0x82234[_0x9ba8('0x27')];}_0x3e27a2[_0x9ba8('0x17')](_0x2eb5b8)[_0x9ba8('0x28')](_0x82234);};}exports[_0x9ba8('0x29')]=function(_0x33f1e2,_0x25ded0){var _0xf46f29={},_0x2cfd99={},_0x54184a={'count':0x0,'rows':[]};var _0x20968e=db[_0x9ba8('0x2a')][_0x9ba8('0x2b')];_0x2cfd99[_0x9ba8('0x2c')]=_['keys'](_0x20968e);var _0x1a68f5={'dateStart':_0x33f1e2[_0x9ba8('0x2d')][_0x9ba8('0x2e')],'dateEnd':_0x33f1e2[_0x9ba8('0x2d')]['dateEnd']};delete _0x33f1e2[_0x9ba8('0x2d')][_0x9ba8('0x2e')];delete _0x33f1e2[_0x9ba8('0x2d')][_0x9ba8('0x2f')];_0x2cfd99[_0x9ba8('0x2d')]=_[_0x9ba8('0x30')](_0x33f1e2[_0x9ba8('0x2d')]);_0x2cfd99[_0x9ba8('0x31')]=_[_0x9ba8('0x32')](_0x2cfd99[_0x9ba8('0x2c')],_0x2cfd99[_0x9ba8('0x2d')]);_0xf46f29[_0x9ba8('0x33')]=_[_0x9ba8('0x32')](_0x2cfd99[_0x9ba8('0x2c')],qs[_0x9ba8('0x34')](_0x33f1e2['query'][_0x9ba8('0x34')]));_0xf46f29['attributes']=_0xf46f29[_0x9ba8('0x33')][_0x9ba8('0x35')]?_0xf46f29[_0x9ba8('0x33')]:_0x2cfd99['model'];if(!_0x33f1e2['query'][_0x9ba8('0x36')]('nolimit')){_0xf46f29['limit']=qs[_0x9ba8('0x1a')](_0x33f1e2[_0x9ba8('0x2d')][_0x9ba8('0x1a')]);_0xf46f29['offset']=qs[_0x9ba8('0x19')](_0x33f1e2[_0x9ba8('0x2d')][_0x9ba8('0x19')]);}_0xf46f29[_0x9ba8('0x37')]=qs[_0x9ba8('0x38')](_0x33f1e2['query'][_0x9ba8('0x38')]);_0xf46f29[_0x9ba8('0x39')]=qs[_0x9ba8('0x31')](_[_0x9ba8('0x3a')](_0x33f1e2[_0x9ba8('0x2d')],_0x2cfd99['filters']));if(_0x1a68f5[_0x9ba8('0x2e')]){if(_0x1a68f5[_0x9ba8('0x2f')]){_0x1a68f5[_0x9ba8('0x2f')]=moment(_0x1a68f5['dateEnd'])[_0x9ba8('0x3b')](0x1,_0x9ba8('0x3c'));}else{_0x1a68f5[_0x9ba8('0x2f')]=moment(_0x1a68f5[_0x9ba8('0x2e')])[_0x9ba8('0x3b')](0x1,'day');}_[_0x9ba8('0x3d')](_0xf46f29[_0x9ba8('0x39')],{'createdAt':{'$gte':_0x1a68f5[_0x9ba8('0x2e')],'$lte':_0x1a68f5[_0x9ba8('0x2f')]}});}if(_0x33f1e2[_0x9ba8('0x2d')][_0x9ba8('0x3e')]){_0xf46f29[_0x9ba8('0x39')]=_[_0x9ba8('0x3d')](_0xf46f29['where'],{'$or':_['map'](_0x20968e,function(_0xac42ec){if(_0xac42ec['type'][_0x9ba8('0x3f')]!==_0x9ba8('0x40')){var _0x7246ac={};_0x7246ac[_0xac42ec[_0x9ba8('0x41')]]={'$like':'%'+_0x33f1e2[_0x9ba8('0x2d')]['filter']+'%'};return _0x7246ac;}})});}_0xf46f29=_[_0x9ba8('0x3d')]({},_0xf46f29,_0x33f1e2[_0x9ba8('0x42')]);var _0x23fecc={'where':_0xf46f29[_0x9ba8('0x39')]};return db[_0x9ba8('0x2a')][_0x9ba8('0x18')](_0x23fecc)[_0x9ba8('0x21')](function(_0x4c8df7){_0x54184a[_0x9ba8('0x18')]=_0x4c8df7;if(_0x33f1e2[_0x9ba8('0x2d')]['includeAll']){_0xf46f29[_0x9ba8('0x43')]=[{'all':!![]}];}return db[_0x9ba8('0x2a')]['findAll'](_0xf46f29);})['then'](function(_0x2b292a){_0x54184a[_0x9ba8('0x44')]=_0x2b292a;return _0x54184a;})[_0x9ba8('0x21')](respondWithFilteredResult(_0x25ded0,_0xf46f29))[_0x9ba8('0x45')](handleError(_0x25ded0,null));};exports[_0x9ba8('0x46')]=function(_0x310407,_0x41434b){var _0x36ce90={'raw':!![],'where':{'id':_0x310407[_0x9ba8('0x47')]['id']}},_0x33f5c3={};_0x33f5c3['model']=_[_0x9ba8('0x30')](db[_0x9ba8('0x2a')]['rawAttributes']);_0x33f5c3[_0x9ba8('0x2d')]=_['keys'](_0x310407[_0x9ba8('0x2d')]);_0x33f5c3[_0x9ba8('0x31')]=_[_0x9ba8('0x32')](_0x33f5c3['model'],_0x33f5c3['query']);_0x36ce90[_0x9ba8('0x33')]=_['intersection'](_0x33f5c3['model'],qs['fields'](_0x310407[_0x9ba8('0x2d')]['fields']));_0x36ce90[_0x9ba8('0x33')]=_0x36ce90[_0x9ba8('0x33')]['length']?_0x36ce90['attributes']:_0x33f5c3['model'];if(_0x310407[_0x9ba8('0x2d')][_0x9ba8('0x48')]){_0x36ce90['include']=[{'all':!![]}];}_0x36ce90=_[_0x9ba8('0x3d')]({},_0x36ce90,_0x310407[_0x9ba8('0x42')]);return db[_0x9ba8('0x2a')]['find'](_0x36ce90)[_0x9ba8('0x21')](handleEntityNotFound(_0x41434b,null))[_0x9ba8('0x21')](respondWithResult(_0x41434b,null))[_0x9ba8('0x45')](handleError(_0x41434b,null));};exports[_0x9ba8('0x49')]=function(_0x5882c8,_0x40f46c){return db[_0x9ba8('0x2a')][_0x9ba8('0x49')](_0x5882c8[_0x9ba8('0x4a')],{})[_0x9ba8('0x21')](function(_0x2c4f75){var _0x92c726=_0x5882c8['user']['get']({'plain':!![]});if(!_0x92c726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x92c726['role']===_0x9ba8('0x4b')){var _0x3da0b7=_0x2c4f75[_0x9ba8('0x22')]({'plain':!![]});var _0x4091dc='Voicemails';return db['UserProfileSection'][_0x9ba8('0x4c')]({'where':{'name':_0x4091dc,'userProfileId':_0x92c726[_0x9ba8('0x4d')]},'raw':!![]})[_0x9ba8('0x21')](function(_0x25df37){if(_0x25df37&&_0x25df37[_0x9ba8('0x4e')]===0x0){return db[_0x9ba8('0x23')][_0x9ba8('0x49')]({'name':_0x3da0b7[_0x9ba8('0x27')],'resourceId':_0x3da0b7['id'],'type':_0x25df37[_0x9ba8('0x27')],'sectionId':_0x25df37['id']},{})[_0x9ba8('0x21')](function(){return _0x2c4f75;});}else{return _0x2c4f75;}})[_0x9ba8('0x45')](function(_0x577ebb){logger[_0x9ba8('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x577ebb);throw _0x577ebb;});}return _0x2c4f75;})[_0x9ba8('0x21')](respondWithResult(_0x40f46c,0xc9))['catch'](handleError(_0x40f46c,null));};exports[_0x9ba8('0x1f')]=function(_0x16d382,_0xf8fe9){if(_0x16d382[_0x9ba8('0x4a')]['id']){delete _0x16d382[_0x9ba8('0x4a')]['id'];}return db['VoiceMail'][_0x9ba8('0x4c')]({'where':{'id':_0x16d382[_0x9ba8('0x47')]['id']}})['then'](handleEntityNotFound(_0xf8fe9,null))['then'](saveUpdates(_0x16d382[_0x9ba8('0x4a')],null))[_0x9ba8('0x21')](respondWithResult(_0xf8fe9,null))[_0x9ba8('0x45')](handleError(_0xf8fe9,null));};exports[_0x9ba8('0x20')]=function(_0x2bc165,_0xf74be4){return db[_0x9ba8('0x2a')][_0x9ba8('0x4c')]({'where':{'id':_0x2bc165[_0x9ba8('0x47')]['id']}})[_0x9ba8('0x21')](handleEntityNotFound(_0xf74be4,null))[_0x9ba8('0x21')](removeEntity(_0xf74be4,null))[_0x9ba8('0x45')](handleError(_0xf74be4,null));};exports[_0x9ba8('0x4f')]=function(_0x1a289c,_0x399980,_0x5af61b){return db[_0x9ba8('0x2a')][_0x9ba8('0x50')]({'where':{'id':_0x1a289c[_0x9ba8('0x47')]['id']}})[_0x9ba8('0x21')](handleEntityNotFound(_0x399980,null))[_0x9ba8('0x21')](function(_0xb2da11){var _0x2639ff;var _0x3ba075={},_0x24f01c={};_0x24f01c[_0x9ba8('0x2c')]=_['keys'](db[_0x9ba8('0x51')][_0x9ba8('0x2b')]);_0x24f01c[_0x9ba8('0x2d')]=_['keys'](_0x1a289c['query']);_0x24f01c['filters']=_['intersection'](_0x24f01c['model'],_0x24f01c[_0x9ba8('0x2d')]);_0x3ba075[_0x9ba8('0x33')]=_[_0x9ba8('0x32')](_0x24f01c[_0x9ba8('0x2c')],qs[_0x9ba8('0x34')](_0x1a289c[_0x9ba8('0x2d')][_0x9ba8('0x34')]));_0x3ba075[_0x9ba8('0x33')]=_0x3ba075['attributes']['length']?_0x3ba075[_0x9ba8('0x33')]:_0x24f01c['model'];if(!_0x1a289c['query']['hasOwnProperty'](_0x9ba8('0x52'))){_0x3ba075['limit']=qs['limit'](_0x1a289c[_0x9ba8('0x2d')][_0x9ba8('0x1a')]);_0x3ba075[_0x9ba8('0x19')]=qs[_0x9ba8('0x19')](_0x1a289c[_0x9ba8('0x2d')][_0x9ba8('0x19')]);}_0x3ba075[_0x9ba8('0x37')]=qs[_0x9ba8('0x38')](_0x1a289c[_0x9ba8('0x2d')]['sort']);_0x3ba075[_0x9ba8('0x39')]=qs[_0x9ba8('0x31')](_[_0x9ba8('0x3a')](_0x1a289c['query'],_0x24f01c['filters']));if(_0x1a289c[_0x9ba8('0x2d')][_0x9ba8('0x3e')]){_0x3ba075[_0x9ba8('0x39')]=_[_0x9ba8('0x3d')](_0x3ba075['where'],{'$or':_[_0x9ba8('0x53')](_0x3ba075[_0x9ba8('0x33')],function(_0x529337){var _0x145fa9={};_0x145fa9[_0x529337]={'$like':'%'+_0x1a289c[_0x9ba8('0x2d')][_0x9ba8('0x3e')]+'%'};return _0x145fa9;})});}_0x3ba075[_0x9ba8('0x39')]=_[_0x9ba8('0x3d')](_0x3ba075[_0x9ba8('0x39')],{'mailboxuser':_0xb2da11['mailbox']});_0x3ba075=_['merge']({},_0x3ba075,_0x1a289c[_0x9ba8('0x42')]);return db[_0x9ba8('0x51')]['findAndCountAll'](_0x3ba075)[_0x9ba8('0x21')](respondWithFilteredResult(_0x399980,_0x3ba075));})['catch'](handleError(_0x399980,null));};
\ No newline at end of file
index a304713..b13209b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7576=['../../config/logger','moment','bluebird','request-promise','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','util'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x7576,0x12b));var _0x6757=function(_0x4e2273,_0x5a71f2){_0x4e2273=_0x4e2273-0x0;var _0x352132=_0x7576[_0x4e2273];return _0x352132;};'use strict';var _=require('lodash');var util=require(_0x6757('0x0'));var logger=require(_0x6757('0x1'))('api');var moment=require(_0x6757('0x2'));var BPromise=require(_0x6757('0x3'));var rp=require(_0x6757('0x4'));var attributes=require('./voiceMail.attributes');module[_0x6757('0x5')]=function(_0x5b6d62,_0x1e8730){return _0x5b6d62['define'](_0x6757('0x6'),attributes,{'tableName':_0x6757('0x7'),'paranoid':![],'indexes':[{'name':_0x6757('0x8'),'fields':[_0x6757('0x9'),'context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9812=['./voiceMail.attributes','define','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x39c249,_0x254733){var _0x44e22f=function(_0x21680a){while(--_0x21680a){_0x39c249['push'](_0x39c249['shift']());}};_0x44e22f(++_0x254733);}(_0x9812,0x6e));var _0x2981=function(_0x2b2b94,_0x55fa3d){_0x2b2b94=_0x2b2b94-0x0;var _0x4d1505=_0x9812[_0x2b2b94];return _0x4d1505;};'use strict';var _=require(_0x2981('0x0'));var util=require(_0x2981('0x1'));var logger=require(_0x2981('0x2'))(_0x2981('0x3'));var moment=require(_0x2981('0x4'));var BPromise=require(_0x2981('0x5'));var rp=require(_0x2981('0x6'));var attributes=require(_0x2981('0x7'));module['exports']=function(_0x4fad10,_0x4855e0){return _0x4fad10[_0x2981('0x8')]('VoiceMail',attributes,{'tableName':_0x2981('0x9'),'paranoid':![],'indexes':[{'name':_0x2981('0xa'),'fields':[_0x2981('0xb'),_0x2981('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 48ade61..e1654fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf4e=['catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf4e,0x79));var _0xebf4=function(_0x3d602e,_0x577559){_0x3d602e=_0x3d602e-0x0;var _0x5e8a7a=_0xbf4e[_0x3d602e];return _0x5e8a7a;};'use strict';var _=require('lodash');var util=require(_0xebf4('0x0'));var moment=require('moment');var BPromise=require(_0xebf4('0x1'));var rs=require(_0xebf4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebf4('0x3'))['db'];var utils=require(_0xebf4('0x4'));var logger=require('../../config/logger')(_0xebf4('0x5'));var config=require('../../config/environment');var jayson=require(_0xebf4('0x6'));var client=jayson[_0xebf4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x595968,_0x19d272,_0xdf3651){return new BPromise(function(_0x500d01,_0x3af7f3){return client['request'](_0x595968,_0xdf3651)[_0xebf4('0x8')](function(_0x4cd88f){logger[_0xebf4('0x9')](_0xebf4('0xa'),_0x19d272,'request\x20sent');logger[_0xebf4('0xb')](_0xebf4('0xc'),_0x19d272,_0xebf4('0xd'),JSON[_0xebf4('0xe')](_0x4cd88f));if(_0x4cd88f[_0xebf4('0xf')]){if(_0x4cd88f[_0xebf4('0xf')][_0xebf4('0x10')]===0x1f4){logger[_0xebf4('0xf')](_0xebf4('0xa'),_0x19d272,_0x4cd88f[_0xebf4('0xf')][_0xebf4('0x11')]);return _0x3af7f3(_0x4cd88f[_0xebf4('0xf')][_0xebf4('0x11')]);}logger[_0xebf4('0xf')](_0xebf4('0xa'),_0x19d272,_0x4cd88f['error'][_0xebf4('0x11')]);return _0x500d01(_0x4cd88f[_0xebf4('0xf')][_0xebf4('0x11')]);}else{logger[_0xebf4('0x9')](_0xebf4('0xa'),_0x19d272,_0xebf4('0xd'));_0x500d01(_0x4cd88f[_0xebf4('0x12')][_0xebf4('0x11')]);}})[_0xebf4('0x13')](function(_0x22f414){logger[_0xebf4('0xf')]('VoiceMail,\x20%s,\x20%s',_0x19d272,_0x22f414);_0x3af7f3(_0x22f414);});});}
\ No newline at end of file
+var _0x6a20=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x26869b,_0x50b2ca){var _0x32a648=function(_0xa05620){while(--_0xa05620){_0x26869b['push'](_0x26869b['shift']());}};_0x32a648(++_0x50b2ca);}(_0x6a20,0x8b));var _0x06a2=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0x6a20[_0x565fed];return _0x3e018f;};'use strict';var _=require(_0x06a2('0x0'));var util=require('util');var moment=require(_0x06a2('0x1'));var BPromise=require(_0x06a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06a2('0x3'));var db=require(_0x06a2('0x4'))['db'];var utils=require(_0x06a2('0x5'));var logger=require('../../config/logger')(_0x06a2('0x6'));var config=require('../../config/environment');var jayson=require(_0x06a2('0x7'));var client=jayson[_0x06a2('0x8')][_0x06a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9b3eba,_0x2c3b3e,_0x3f4aac){return new BPromise(function(_0x79ebe5,_0x5dd2ef){return client['request'](_0x9b3eba,_0x3f4aac)[_0x06a2('0xa')](function(_0x39ff0b){logger[_0x06a2('0xb')](_0x06a2('0xc'),_0x2c3b3e,_0x06a2('0xd'));logger[_0x06a2('0xe')](_0x06a2('0xf'),_0x2c3b3e,_0x06a2('0xd'),JSON[_0x06a2('0x10')](_0x39ff0b));if(_0x39ff0b['error']){if(_0x39ff0b['error'][_0x06a2('0x11')]===0x1f4){logger[_0x06a2('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2c3b3e,_0x39ff0b[_0x06a2('0x12')][_0x06a2('0x13')]);return _0x5dd2ef(_0x39ff0b[_0x06a2('0x12')][_0x06a2('0x13')]);}logger['error'](_0x06a2('0xc'),_0x2c3b3e,_0x39ff0b[_0x06a2('0x12')][_0x06a2('0x13')]);return _0x79ebe5(_0x39ff0b[_0x06a2('0x12')][_0x06a2('0x13')]);}else{logger[_0x06a2('0xb')](_0x06a2('0xc'),_0x2c3b3e,_0x06a2('0xd'));_0x79ebe5(_0x39ff0b[_0x06a2('0x14')]['message']);}})[_0x06a2('0x15')](function(_0x5888d4){logger[_0x06a2('0x12')](_0x06a2('0xc'),_0x2c3b3e,_0x5888d4);_0x5dd2ef(_0x5888d4);});});}
\ No newline at end of file
index 2f0e861..2fbf14c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d8d=['util','path','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','show','/:id/download','post','create','put','destroy','exports','multer'];(function(_0x2b811d,_0x5496ba){var _0x4be7d8=function(_0x5208c9){while(--_0x5208c9){_0x2b811d['push'](_0x2b811d['shift']());}};_0x4be7d8(++_0x5496ba);}(_0x1d8d,0x155));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd1d8('0x0'));var util=require(_0xd1d8('0x1'));var path=require(_0xd1d8('0x2'));var timeout=require('connect-timeout');var express=require(_0xd1d8('0x3'));var router=express[_0xd1d8('0x4')]();var auth=require(_0xd1d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd1d8('0x6'));var controller=require(_0xd1d8('0x7'));router['get']('/',auth[_0xd1d8('0x8')](),controller[_0xd1d8('0x9')]);router['get'](_0xd1d8('0xa'),auth[_0xd1d8('0x8')](),controller[_0xd1d8('0xb')]);router['get'](_0xd1d8('0xc'),auth[_0xd1d8('0x8')](),controller['download']);router[_0xd1d8('0xd')]('/',auth[_0xd1d8('0x8')](),controller[_0xd1d8('0xe')]);router[_0xd1d8('0xf')](_0xd1d8('0xa'),auth[_0xd1d8('0x8')](),controller['update']);router['delete'](_0xd1d8('0xa'),auth[_0xd1d8('0x8')](),controller[_0xd1d8('0x10')]);module[_0xd1d8('0x11')]=router;
\ No newline at end of file
+var _0x893c=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x893c,0x11b));var _0xc893=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x893c[_0x67f95e];return _0x538f5a;};'use strict';var multer=require(_0xc893('0x0'));var util=require(_0xc893('0x1'));var path=require(_0xc893('0x2'));var timeout=require(_0xc893('0x3'));var express=require(_0xc893('0x4'));var router=express[_0xc893('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc893('0x6'));var config=require(_0xc893('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xc893('0x8')]('/',auth[_0xc893('0x9')](),controller[_0xc893('0xa')]);router[_0xc893('0x8')](_0xc893('0xb'),auth[_0xc893('0x9')](),controller[_0xc893('0xc')]);router[_0xc893('0x8')]('/:id/download',auth[_0xc893('0x9')](),controller[_0xc893('0xd')]);router[_0xc893('0xe')]('/',auth[_0xc893('0x9')](),controller['create']);router[_0xc893('0xf')]('/:id',auth[_0xc893('0x9')](),controller[_0xc893('0x10')]);router['delete'](_0xc893('0xb'),auth[_0xc893('0x9')](),controller['destroy']);module[_0xc893('0x11')]=router;
\ No newline at end of file
index add72d6..a7d1665 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5acc=['INTEGER','STRING','BLOB','TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0x1f523a,_0x188a63){var _0x39c0cd=function(_0x1cac98){while(--_0x1cac98){_0x1f523a['push'](_0x1f523a['shift']());}};_0x39c0cd(++_0x188a63);}(_0x5acc,0xdd));var _0xc5ac=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5acc[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0xc5ac('0x0')]={'name':{'type':Sequelize[_0xc5ac('0x1')],'get':function(_0x2cea00){return this[_0xc5ac('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xc5ac('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xc5ac('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xc5ac('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xc5ac('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xc5ac('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc5ac('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xc5ac('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xc5ac('0x6'),'allowNull':![]}};
\ No newline at end of file
+var _0xaa02=['sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long'];(function(_0x100d8b,_0x1f7d98){var _0x384eee=function(_0x6e1d98){while(--_0x6e1d98){_0x100d8b['push'](_0x100d8b['shift']());}};_0x384eee(++_0x1f7d98);}(_0xaa02,0x18f));var _0x2aa0=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xaa02[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0x2aa0('0x0'));module[_0x2aa0('0x1')]={'name':{'type':Sequelize[_0x2aa0('0x2')],'get':function(_0x2bc763){return this[_0x2aa0('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x2aa0('0x5')](_0x2aa0('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2aa0('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}};
\ No newline at end of file
index 8027402..08c9ea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51eb=['create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','VoiceMailMessage','rawAttributes','model','differenceBy','keys','query','dateStart','dateEnd','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','add','day','merge','filter','map','type','key','VIRTUAL','field','include','findAll','rows','show','params','includeAll','find','catch'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0x51eb,0x169));var _0xb51e=function(_0x7b8f80,_0xf34541){_0x7b8f80=_0x7b8f80-0x0;var _0x54eff0=_0x51eb[_0x7b8f80];return _0x54eff0;};'use strict';var pdf=require(_0xb51e('0x0'));var emlformat=require(_0xb51e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb51e('0x2'));var rp=require(_0xb51e('0x3'));var moment=require(_0xb51e('0x4'));var BPromise=require(_0xb51e('0x5'));var Mustache=require(_0xb51e('0x6'));var util=require(_0xb51e('0x7'));var path=require('path');var sox=require(_0xb51e('0x8'));var csv=require(_0xb51e('0x9'));var ejs=require(_0xb51e('0xa'));var fs=require('fs');var _=require(_0xb51e('0xb'));var squel=require('squel');var crypto=require(_0xb51e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb51e('0xd'));var toCsv=require(_0xb51e('0x9'));var querystring=require(_0xb51e('0xe'));var Papa=require(_0xb51e('0xf'));var Redis=require(_0xb51e('0x10'));var qs=require(_0xb51e('0x11'));var logger=require('../../config/logger')(_0xb51e('0x12'));var utils=require('../../config/utils');var config=require(_0xb51e('0x13'));var db=require(_0xb51e('0x14'))['db'];function respondWithStatusCode(_0xd02986,_0x3de574){_0x3de574=_0x3de574||0xcc;return function(_0x917310){if(_0x917310){return _0xd02986[_0xb51e('0x15')](_0x3de574);}return _0xd02986[_0xb51e('0x16')](_0x3de574)[_0xb51e('0x17')]();};}function respondWithResult(_0x15d8f8,_0x33f18c){_0x33f18c=_0x33f18c||0xc8;return function(_0x33344b){if(_0x33344b){return _0x15d8f8[_0xb51e('0x16')](_0x33f18c)[_0xb51e('0x18')](_0x33344b);}};}function respondWithFilteredResult(_0x1bd997,_0x3c5c77){return function(_0x3bd7d9){if(_0x3bd7d9){var _0x336a9a=_0x3bd7d9[_0xb51e('0x19')],_0x123b59=_0x3c5c77[_0xb51e('0x1a')],_0x1ec5ae=_0x3c5c77['offset']+_0x3c5c77[_0xb51e('0x1b')],_0x28e7ae;if(_0x1ec5ae>=_0x336a9a){_0x1ec5ae=_0x336a9a;_0x28e7ae=0xc8;}else{_0x28e7ae=0xce;}_0x1bd997['status'](_0x28e7ae);return _0x1bd997[_0xb51e('0x1c')](_0xb51e('0x1d'),_0x123b59+'-'+_0x1ec5ae+'/'+_0x336a9a)[_0xb51e('0x18')](_0x3bd7d9);}return null;};}function patchUpdates(_0x1e580b){return function(_0x2c3433){try{jsonpatch[_0xb51e('0x1e')](_0x2c3433,_0x1e580b,!![]);}catch(_0xefbff1){return BPromise['reject'](_0xefbff1);}return _0x2c3433[_0xb51e('0x1f')]();};}function saveUpdates(_0x2c684c,_0x886bf9){return function(_0x5a3410){if(_0x5a3410){return _0x5a3410[_0xb51e('0x20')](_0x2c684c)[_0xb51e('0x21')](function(_0x38df53){return _0x38df53;});}return null;};}function removeEntity(_0x29d7ce,_0x25e1a9){return function(_0x2cf48b){if(_0x2cf48b){return _0x2cf48b[_0xb51e('0x22')]()[_0xb51e('0x21')](function(){_0x29d7ce[_0xb51e('0x16')](0xcc)[_0xb51e('0x17')]();});}};}function handleEntityNotFound(_0x178842,_0x551d10){return function(_0x47b07c){if(!_0x47b07c){_0x178842[_0xb51e('0x15')](0x194);}return _0x47b07c;};}function handleError(_0x335033,_0x436520){_0x436520=_0x436520||0x1f4;return function(_0x3ff8f5){logger[_0xb51e('0x23')](_0x3ff8f5['stack']);if(_0x3ff8f5[_0xb51e('0x24')]){delete _0x3ff8f5['name'];}_0x335033[_0xb51e('0x16')](_0x436520)[_0xb51e('0x25')](_0x3ff8f5);};}exports[_0xb51e('0x26')]=function(_0x4be060,_0xe6adcb){var _0x27785e={},_0x2c4225={},_0x8a9c77={'count':0x0,'rows':[]};var _0x1cbab2=db[_0xb51e('0x27')][_0xb51e('0x28')];_0x2c4225[_0xb51e('0x29')]=_[_0xb51e('0x2a')](_[_0xb51e('0x2b')](_0x1cbab2),[_0xb51e('0x24')]);var _0x290eea={'dateStart':_0x4be060[_0xb51e('0x2c')][_0xb51e('0x2d')],'dateEnd':_0x4be060[_0xb51e('0x2c')]['dateEnd']};delete _0x4be060[_0xb51e('0x2c')]['dateStart'];delete _0x4be060[_0xb51e('0x2c')][_0xb51e('0x2e')];_0x2c4225[_0xb51e('0x2c')]=_[_0xb51e('0x2b')](_0x4be060[_0xb51e('0x2c')]);_0x2c4225['filters']=_[_0xb51e('0x2f')](_0x2c4225['model'],_0x2c4225['query']);_0x27785e['attributes']=_['intersection'](_0x2c4225[_0xb51e('0x29')],qs['fields'](_0x4be060['query'][_0xb51e('0x30')]));_0x27785e['attributes']=_0x27785e[_0xb51e('0x31')][_0xb51e('0x32')]?_0x27785e['attributes']:_0x2c4225['model'];if(!_0x4be060['query']['hasOwnProperty'](_0xb51e('0x33'))){_0x27785e[_0xb51e('0x1b')]=qs['limit'](_0x4be060[_0xb51e('0x2c')][_0xb51e('0x1b')]);_0x27785e[_0xb51e('0x1a')]=qs[_0xb51e('0x1a')](_0x4be060[_0xb51e('0x2c')]['offset']);}_0x27785e[_0xb51e('0x34')]=qs[_0xb51e('0x35')](_0x4be060[_0xb51e('0x2c')][_0xb51e('0x35')]);_0x27785e[_0xb51e('0x36')]=qs[_0xb51e('0x37')](_[_0xb51e('0x38')](_0x4be060['query'],_0x2c4225[_0xb51e('0x37')]));if(_0x290eea[_0xb51e('0x2d')]){if(_0x290eea[_0xb51e('0x2e')]){_0x290eea[_0xb51e('0x2e')]=moment(_0x290eea[_0xb51e('0x2e')])[_0xb51e('0x39')](0x1,'day');}else{_0x290eea['dateEnd']=moment(_0x290eea[_0xb51e('0x2d')])[_0xb51e('0x39')](0x1,_0xb51e('0x3a'));}_[_0xb51e('0x3b')](_0x27785e[_0xb51e('0x36')],{'createdAt':{'$gte':_0x290eea[_0xb51e('0x2d')],'$lte':_0x290eea['dateEnd']}});}if(_0x4be060[_0xb51e('0x2c')][_0xb51e('0x3c')]){_0x27785e[_0xb51e('0x36')]=_[_0xb51e('0x3b')](_0x27785e[_0xb51e('0x36')],{'$or':_[_0xb51e('0x3d')](_0x1cbab2,function(_0x461613){if(_0x461613[_0xb51e('0x3e')][_0xb51e('0x3f')]!==_0xb51e('0x40')){var _0x266371={};_0x266371[_0x461613[_0xb51e('0x41')]]={'$like':'%'+_0x4be060[_0xb51e('0x2c')]['filter']+'%'};return _0x266371;}})});}_0x27785e=_['merge']({},_0x27785e,_0x4be060['options']);var _0x52cf1b={'where':_0x27785e[_0xb51e('0x36')]};return db['VoiceMailMessage'][_0xb51e('0x19')](_0x52cf1b)[_0xb51e('0x21')](function(_0x5a5762){_0x8a9c77[_0xb51e('0x19')]=_0x5a5762;if(_0x4be060[_0xb51e('0x2c')]['includeAll']){_0x27785e[_0xb51e('0x42')]=[{'all':!![]}];}return db[_0xb51e('0x27')][_0xb51e('0x43')](_0x27785e);})[_0xb51e('0x21')](function(_0x516bb8){_0x8a9c77[_0xb51e('0x44')]=_0x516bb8;return _0x8a9c77;})[_0xb51e('0x21')](respondWithFilteredResult(_0xe6adcb,_0x27785e))['catch'](handleError(_0xe6adcb,null));};exports[_0xb51e('0x45')]=function(_0x120c5c,_0x466de1){var _0x37fde2={'raw':!![],'where':{'id':_0x120c5c[_0xb51e('0x46')]['id']}},_0x4c5e68={};_0x4c5e68[_0xb51e('0x29')]=_[_0xb51e('0x2b')](db[_0xb51e('0x27')][_0xb51e('0x28')]);_0x4c5e68[_0xb51e('0x2c')]=_[_0xb51e('0x2b')](_0x120c5c[_0xb51e('0x2c')]);_0x4c5e68[_0xb51e('0x37')]=_[_0xb51e('0x2f')](_0x4c5e68[_0xb51e('0x29')],_0x4c5e68[_0xb51e('0x2c')]);_0x37fde2[_0xb51e('0x31')]=_[_0xb51e('0x2f')](_0x4c5e68[_0xb51e('0x29')],qs[_0xb51e('0x30')](_0x120c5c['query'][_0xb51e('0x30')]));_0x37fde2[_0xb51e('0x31')]=_0x37fde2[_0xb51e('0x31')][_0xb51e('0x32')]?_0x37fde2[_0xb51e('0x31')]:_0x4c5e68['model'];if(_0x120c5c['query'][_0xb51e('0x47')]){_0x37fde2['include']=[{'all':!![]}];}_0x37fde2=_[_0xb51e('0x3b')]({},_0x37fde2,_0x120c5c['options']);return db[_0xb51e('0x27')][_0xb51e('0x48')](_0x37fde2)['then'](handleEntityNotFound(_0x466de1,null))[_0xb51e('0x21')](respondWithResult(_0x466de1,null))[_0xb51e('0x49')](handleError(_0x466de1,null));};exports[_0xb51e('0x4a')]=function(_0x39e0d0,_0x1814cc){return db['VoiceMailMessage'][_0xb51e('0x4a')](_0x39e0d0[_0xb51e('0x4b')],{})['then'](respondWithResult(_0x1814cc,0xc9))['catch'](handleError(_0x1814cc,null));};exports[_0xb51e('0x20')]=function(_0x455892,_0x41bfac){if(_0x455892[_0xb51e('0x4b')]['id']){delete _0x455892['body']['id'];}return db['VoiceMailMessage'][_0xb51e('0x48')]({'where':{'id':_0x455892[_0xb51e('0x46')]['id']}})[_0xb51e('0x21')](handleEntityNotFound(_0x41bfac,null))[_0xb51e('0x21')](saveUpdates(_0x455892[_0xb51e('0x4b')],null))[_0xb51e('0x21')](respondWithResult(_0x41bfac,null))['catch'](handleError(_0x41bfac,null));};exports[_0xb51e('0x22')]=function(_0x44f87a,_0x2efcd0){return db[_0xb51e('0x27')]['find']({'where':{'id':_0x44f87a[_0xb51e('0x46')]['id']}})['then'](handleEntityNotFound(_0x2efcd0,null))[_0xb51e('0x21')](removeEntity(_0x2efcd0,null))[_0xb51e('0x49')](handleError(_0x2efcd0,null));};exports[_0xb51e('0x4c')]=function(_0xea7f41,_0x32a3d4,_0x1c2ed2){return db[_0xb51e('0x27')]['find']({'where':{'id':_0xea7f41['params']['id']},'attributes':['id',_0xb51e('0x4d'),'msg_id']})[_0xb51e('0x21')](handleEntityNotFound(_0x32a3d4,null))[_0xb51e('0x21')](function(_0x2629ed){if(_0x2629ed){if(!_0x2629ed[_0xb51e('0x4d')]){throw new db[(_0xb51e('0x4e'))][(_0xb51e('0x4f'))](_0xb51e('0x50'));}var _0x20d414={'Content-Type':_0xb51e('0x51'),'Content-Disposition':_0xb51e('0x52')};if(_0x2629ed[_0xb51e('0x53')]){_0x20d414[_0xb51e('0x54')]=_0xb51e('0x55')+_0x2629ed['msg_id']+_0xb51e('0x56');}_0x32a3d4[_0xb51e('0x1c')](_0x20d414);return _0x32a3d4['send'](new Buffer(_0x2629ed[_0xb51e('0x4d')]));}})[_0xb51e('0x49')](handleError(_0x32a3d4,null));};
\ No newline at end of file
+var _0xd2f5=['differenceBy','keys','query','dateStart','dateEnd','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','add','day','merge','where','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','show','params','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','VoiceMailMessage','rawAttributes','model'];(function(_0x4a1960,_0x34b8ba){var _0x54d0ee=function(_0x4ddab8){while(--_0x4ddab8){_0x4a1960['push'](_0x4a1960['shift']());}};_0x54d0ee(++_0x34b8ba);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x35821f,_0x1f5d35){_0x35821f=_0x35821f-0x0;var _0x49a8cc=_0xd2f5[_0x35821f];return _0x49a8cc;};'use strict';var pdf=require(_0x5d2f('0x0'));var emlformat=require(_0x5d2f('0x1'));var rimraf=require(_0x5d2f('0x2'));var zipdir=require(_0x5d2f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d2f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d2f('0x5'));var util=require(_0x5d2f('0x6'));var path=require(_0x5d2f('0x7'));var sox=require('sox');var csv=require(_0x5d2f('0x8'));var ejs=require(_0x5d2f('0x9'));var fs=require('fs');var _=require(_0x5d2f('0xa'));var squel=require('squel');var crypto=require(_0x5d2f('0xb'));var jsforce=require(_0x5d2f('0xc'));var deskjs=require(_0x5d2f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5d2f('0xe'));var Redis=require(_0x5d2f('0xf'));var qs=require('../../components/parsers/qs');var logger=require(_0x5d2f('0x10'))(_0x5d2f('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5d2f('0x12'))['db'];function respondWithStatusCode(_0x458f43,_0x4bcd92){_0x4bcd92=_0x4bcd92||0xcc;return function(_0x5b27d0){if(_0x5b27d0){return _0x458f43[_0x5d2f('0x13')](_0x4bcd92);}return _0x458f43[_0x5d2f('0x14')](_0x4bcd92)[_0x5d2f('0x15')]();};}function respondWithResult(_0x2b5b44,_0x3bb36e){_0x3bb36e=_0x3bb36e||0xc8;return function(_0x149e68){if(_0x149e68){return _0x2b5b44['status'](_0x3bb36e)['json'](_0x149e68);}};}function respondWithFilteredResult(_0x4eb5de,_0x4c7551){return function(_0x1a76eb){if(_0x1a76eb){var _0x4ca0d6=_0x1a76eb[_0x5d2f('0x16')],_0x3bd6a1=_0x4c7551['offset'],_0x405455=_0x4c7551[_0x5d2f('0x17')]+_0x4c7551[_0x5d2f('0x18')],_0x25b409;if(_0x405455>=_0x4ca0d6){_0x405455=_0x4ca0d6;_0x25b409=0xc8;}else{_0x25b409=0xce;}_0x4eb5de['status'](_0x25b409);return _0x4eb5de[_0x5d2f('0x19')](_0x5d2f('0x1a'),_0x3bd6a1+'-'+_0x405455+'/'+_0x4ca0d6)[_0x5d2f('0x1b')](_0x1a76eb);}return null;};}function patchUpdates(_0x19983c){return function(_0x283544){try{jsonpatch[_0x5d2f('0x1c')](_0x283544,_0x19983c,!![]);}catch(_0x12c3e3){return BPromise[_0x5d2f('0x1d')](_0x12c3e3);}return _0x283544[_0x5d2f('0x1e')]();};}function saveUpdates(_0x2c66e3,_0x279cfc){return function(_0x2c0b4d){if(_0x2c0b4d){return _0x2c0b4d[_0x5d2f('0x1f')](_0x2c66e3)['then'](function(_0x33d889){return _0x33d889;});}return null;};}function removeEntity(_0x25fd87,_0x5994ba){return function(_0x43fe3f){if(_0x43fe3f){return _0x43fe3f[_0x5d2f('0x20')]()[_0x5d2f('0x21')](function(){_0x25fd87[_0x5d2f('0x14')](0xcc)[_0x5d2f('0x15')]();});}};}function handleEntityNotFound(_0x20d95e,_0x364b85){return function(_0x2d6d01){if(!_0x2d6d01){_0x20d95e[_0x5d2f('0x13')](0x194);}return _0x2d6d01;};}function handleError(_0x8a6d54,_0x284c8a){_0x284c8a=_0x284c8a||0x1f4;return function(_0x53bc35){logger[_0x5d2f('0x22')](_0x53bc35[_0x5d2f('0x23')]);if(_0x53bc35[_0x5d2f('0x24')]){delete _0x53bc35[_0x5d2f('0x24')];}_0x8a6d54[_0x5d2f('0x14')](_0x284c8a)[_0x5d2f('0x25')](_0x53bc35);};}exports[_0x5d2f('0x26')]=function(_0x1e8501,_0x363e7a){var _0x4952ef={},_0x33cde5={},_0x208fc4={'count':0x0,'rows':[]};var _0x493344=db[_0x5d2f('0x27')][_0x5d2f('0x28')];_0x33cde5[_0x5d2f('0x29')]=_[_0x5d2f('0x2a')](_[_0x5d2f('0x2b')](_0x493344),[_0x5d2f('0x24')]);var _0x4d368f={'dateStart':_0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x2d')],'dateEnd':_0x1e8501['query']['dateEnd']};delete _0x1e8501['query']['dateStart'];delete _0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x2e')];_0x33cde5[_0x5d2f('0x2c')]=_[_0x5d2f('0x2b')](_0x1e8501['query']);_0x33cde5[_0x5d2f('0x2f')]=_[_0x5d2f('0x30')](_0x33cde5[_0x5d2f('0x29')],_0x33cde5[_0x5d2f('0x2c')]);_0x4952ef['attributes']=_[_0x5d2f('0x30')](_0x33cde5['model'],qs[_0x5d2f('0x31')](_0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x31')]));_0x4952ef[_0x5d2f('0x32')]=_0x4952ef['attributes'][_0x5d2f('0x33')]?_0x4952ef['attributes']:_0x33cde5[_0x5d2f('0x29')];if(!_0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x34')]('nolimit')){_0x4952ef[_0x5d2f('0x18')]=qs[_0x5d2f('0x18')](_0x1e8501[_0x5d2f('0x2c')]['limit']);_0x4952ef['offset']=qs[_0x5d2f('0x17')](_0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x17')]);}_0x4952ef[_0x5d2f('0x35')]=qs[_0x5d2f('0x36')](_0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x36')]);_0x4952ef['where']=qs['filters'](_[_0x5d2f('0x37')](_0x1e8501[_0x5d2f('0x2c')],_0x33cde5[_0x5d2f('0x2f')]));if(_0x4d368f[_0x5d2f('0x2d')]){if(_0x4d368f['dateEnd']){_0x4d368f['dateEnd']=moment(_0x4d368f['dateEnd'])[_0x5d2f('0x38')](0x1,'day');}else{_0x4d368f['dateEnd']=moment(_0x4d368f[_0x5d2f('0x2d')])[_0x5d2f('0x38')](0x1,_0x5d2f('0x39'));}_[_0x5d2f('0x3a')](_0x4952ef[_0x5d2f('0x3b')],{'createdAt':{'$gte':_0x4d368f[_0x5d2f('0x2d')],'$lte':_0x4d368f[_0x5d2f('0x2e')]}});}if(_0x1e8501['query']['filter']){_0x4952ef[_0x5d2f('0x3b')]=_[_0x5d2f('0x3a')](_0x4952ef[_0x5d2f('0x3b')],{'$or':_[_0x5d2f('0x3c')](_0x493344,function(_0xacee1c){if(_0xacee1c[_0x5d2f('0x3d')][_0x5d2f('0x3e')]!==_0x5d2f('0x3f')){var _0x2d37e7={};_0x2d37e7[_0xacee1c[_0x5d2f('0x40')]]={'$like':'%'+_0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x41')]+'%'};return _0x2d37e7;}})});}_0x4952ef=_['merge']({},_0x4952ef,_0x1e8501[_0x5d2f('0x42')]);var _0xa7552b={'where':_0x4952ef['where']};return db[_0x5d2f('0x27')][_0x5d2f('0x16')](_0xa7552b)[_0x5d2f('0x21')](function(_0x888d63){_0x208fc4['count']=_0x888d63;if(_0x1e8501[_0x5d2f('0x2c')][_0x5d2f('0x43')]){_0x4952ef[_0x5d2f('0x44')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x4952ef);})['then'](function(_0xe6d87){_0x208fc4[_0x5d2f('0x45')]=_0xe6d87;return _0x208fc4;})[_0x5d2f('0x21')](respondWithFilteredResult(_0x363e7a,_0x4952ef))[_0x5d2f('0x46')](handleError(_0x363e7a,null));};exports[_0x5d2f('0x47')]=function(_0x348b4b,_0x1b68f8){var _0x45aeb8={'raw':!![],'where':{'id':_0x348b4b[_0x5d2f('0x48')]['id']}},_0x3ec8f5={};_0x3ec8f5['model']=_[_0x5d2f('0x2b')](db['VoiceMailMessage'][_0x5d2f('0x28')]);_0x3ec8f5[_0x5d2f('0x2c')]=_['keys'](_0x348b4b['query']);_0x3ec8f5[_0x5d2f('0x2f')]=_[_0x5d2f('0x30')](_0x3ec8f5[_0x5d2f('0x29')],_0x3ec8f5[_0x5d2f('0x2c')]);_0x45aeb8['attributes']=_['intersection'](_0x3ec8f5[_0x5d2f('0x29')],qs[_0x5d2f('0x31')](_0x348b4b[_0x5d2f('0x2c')][_0x5d2f('0x31')]));_0x45aeb8[_0x5d2f('0x32')]=_0x45aeb8[_0x5d2f('0x32')]['length']?_0x45aeb8[_0x5d2f('0x32')]:_0x3ec8f5['model'];if(_0x348b4b[_0x5d2f('0x2c')][_0x5d2f('0x43')]){_0x45aeb8[_0x5d2f('0x44')]=[{'all':!![]}];}_0x45aeb8=_[_0x5d2f('0x3a')]({},_0x45aeb8,_0x348b4b['options']);return db[_0x5d2f('0x27')][_0x5d2f('0x49')](_0x45aeb8)[_0x5d2f('0x21')](handleEntityNotFound(_0x1b68f8,null))['then'](respondWithResult(_0x1b68f8,null))[_0x5d2f('0x46')](handleError(_0x1b68f8,null));};exports[_0x5d2f('0x4a')]=function(_0x5dad99,_0x4de38d){return db[_0x5d2f('0x27')]['create'](_0x5dad99[_0x5d2f('0x4b')],{})['then'](respondWithResult(_0x4de38d,0xc9))['catch'](handleError(_0x4de38d,null));};exports[_0x5d2f('0x1f')]=function(_0x22619d,_0x2f7e14){if(_0x22619d[_0x5d2f('0x4b')]['id']){delete _0x22619d['body']['id'];}return db[_0x5d2f('0x27')]['find']({'where':{'id':_0x22619d[_0x5d2f('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7e14,null))[_0x5d2f('0x21')](saveUpdates(_0x22619d[_0x5d2f('0x4b')],null))[_0x5d2f('0x21')](respondWithResult(_0x2f7e14,null))[_0x5d2f('0x46')](handleError(_0x2f7e14,null));};exports[_0x5d2f('0x20')]=function(_0x1bae3a,_0xdc155d){return db[_0x5d2f('0x27')][_0x5d2f('0x49')]({'where':{'id':_0x1bae3a[_0x5d2f('0x48')]['id']}})[_0x5d2f('0x21')](handleEntityNotFound(_0xdc155d,null))[_0x5d2f('0x21')](removeEntity(_0xdc155d,null))[_0x5d2f('0x46')](handleError(_0xdc155d,null));};exports[_0x5d2f('0x4c')]=function(_0x177ed7,_0x5b86f3,_0x521bc2){return db['VoiceMailMessage']['find']({'where':{'id':_0x177ed7[_0x5d2f('0x48')]['id']},'attributes':['id',_0x5d2f('0x4d'),_0x5d2f('0x4e')]})['then'](handleEntityNotFound(_0x5b86f3,null))[_0x5d2f('0x21')](function(_0x8b886a){if(_0x8b886a){if(!_0x8b886a['recording']){throw new db[(_0x5d2f('0x4f'))][(_0x5d2f('0x50'))](_0x5d2f('0x51'));}var _0x11b301={'Content-Type':_0x5d2f('0x52'),'Content-Disposition':_0x5d2f('0x53')};if(_0x8b886a['msg_id']){_0x11b301[_0x5d2f('0x54')]='attachment;\x20filename=\x22'+_0x8b886a['msg_id']+_0x5d2f('0x55');}_0x5b86f3['set'](_0x11b301);return _0x5b86f3[_0x5d2f('0x25')](new Buffer(_0x8b886a[_0x5d2f('0x4d')]));}})[_0x5d2f('0x46')](handleError(_0x5b86f3,null));};
\ No newline at end of file
index 2cce216..c34e354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c0f=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','api','moment','bluebird','request-promise','./voiceMailMessage.attributes','exports'];(function(_0x5e3066,_0x320f07){var _0x3296ba=function(_0x1b7d1c){while(--_0x1b7d1c){_0x5e3066['push'](_0x5e3066['shift']());}};_0x3296ba(++_0x320f07);}(_0x5c0f,0x1e3));var _0xf5c0=function(_0x27ef3c,_0x5918d4){_0x27ef3c=_0x27ef3c-0x0;var _0x6f3ef1=_0x5c0f[_0x27ef3c];return _0x6f3ef1;};'use strict';var _=require(_0xf5c0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf5c0('0x1'));var moment=require(_0xf5c0('0x2'));var BPromise=require(_0xf5c0('0x3'));var rp=require(_0xf5c0('0x4'));var attributes=require(_0xf5c0('0x5'));module[_0xf5c0('0x6')]=function(_0x530d95,_0x21d4ff){return _0x530d95['define'](_0xf5c0('0x7'),attributes,{'tableName':_0xf5c0('0x8'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xf5c0('0x9')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xd6e3=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','./voiceMailMessage.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd6e3,0x95));var _0x3d6e=function(_0x4ca845,_0x5962a8){_0x4ca845=_0x4ca845-0x0;var _0x4c96f3=_0xd6e3[_0x4ca845];return _0x4c96f3;};'use strict';var _=require(_0x3d6e('0x0'));var util=require(_0x3d6e('0x1'));var logger=require(_0x3d6e('0x2'))(_0x3d6e('0x3'));var moment=require(_0x3d6e('0x4'));var BPromise=require(_0x3d6e('0x5'));var rp=require('request-promise');var attributes=require(_0x3d6e('0x6'));module[_0x3d6e('0x7')]=function(_0x33ee17,_0x46a91e){return _0x33ee17[_0x3d6e('0x8')](_0x3d6e('0x9'),attributes,{'tableName':_0x3d6e('0xa'),'paranoid':![],'indexes':[{'name':_0x3d6e('0xb'),'fields':[_0x3d6e('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index 7ffe895..c2d9a9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddc8=['error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbc5a3a,_0x36a3fc){var _0x5aa475=function(_0x40516e){while(--_0x40516e){_0xbc5a3a['push'](_0xbc5a3a['shift']());}};_0x5aa475(++_0x36a3fc);}(_0xddc8,0x1d2));var _0x8ddc=function(_0x3c945b,_0x1e46ab){_0x3c945b=_0x3c945b-0x0;var _0x407495=_0xddc8[_0x3c945b];return _0x407495;};'use strict';var _=require(_0x8ddc('0x0'));var util=require(_0x8ddc('0x1'));var moment=require(_0x8ddc('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ddc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ddc('0x4'))['db'];var utils=require(_0x8ddc('0x5'));var logger=require(_0x8ddc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8ddc('0x7'));var client=jayson[_0x8ddc('0x8')][_0x8ddc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x215a3d,_0x2b2900,_0x1c4341){return new BPromise(function(_0x3f60b0,_0x39c209){return client[_0x8ddc('0xa')](_0x215a3d,_0x1c4341)[_0x8ddc('0xb')](function(_0x17ce19){logger[_0x8ddc('0xc')](_0x8ddc('0xd'),_0x2b2900,_0x8ddc('0xe'));logger[_0x8ddc('0xf')](_0x8ddc('0x10'),_0x2b2900,_0x8ddc('0xe'),JSON[_0x8ddc('0x11')](_0x17ce19));if(_0x17ce19['error']){if(_0x17ce19[_0x8ddc('0x12')][_0x8ddc('0x13')]===0x1f4){logger[_0x8ddc('0x12')](_0x8ddc('0xd'),_0x2b2900,_0x17ce19['error'][_0x8ddc('0x14')]);return _0x39c209(_0x17ce19[_0x8ddc('0x12')][_0x8ddc('0x14')]);}logger[_0x8ddc('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x2b2900,_0x17ce19[_0x8ddc('0x12')][_0x8ddc('0x14')]);return _0x3f60b0(_0x17ce19[_0x8ddc('0x12')][_0x8ddc('0x14')]);}else{logger[_0x8ddc('0xc')](_0x8ddc('0xd'),_0x2b2900,'request\x20sent');_0x3f60b0(_0x17ce19[_0x8ddc('0x15')][_0x8ddc('0x14')]);}})['catch'](function(_0x55df92){logger[_0x8ddc('0x12')](_0x8ddc('0xd'),_0x2b2900,_0x55df92);_0x39c209(_0x55df92);});});}
\ No newline at end of file
+var _0x5b92=['stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x411ca8,_0x46cee1){var _0x416a97=function(_0x5cd15c){while(--_0x5cd15c){_0x411ca8['push'](_0x411ca8['shift']());}};_0x416a97(++_0x46cee1);}(_0x5b92,0x8f));var _0x25b9=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x5b92[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require(_0x25b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b9('0x3'));var fs=require('fs');var Redis=require(_0x25b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25b9('0x5'));var logger=require(_0x25b9('0x6'))(_0x25b9('0x7'));var config=require('../../config/environment');var jayson=require(_0x25b9('0x8'));var client=jayson[_0x25b9('0x9')][_0x25b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59fe18,_0x2aa0cc,_0x617080){return new BPromise(function(_0x3437b5,_0x3e6e4b){return client[_0x25b9('0xb')](_0x59fe18,_0x617080)[_0x25b9('0xc')](function(_0x3584b6){logger[_0x25b9('0xd')](_0x25b9('0xe'),_0x2aa0cc,_0x25b9('0xf'));logger[_0x25b9('0x10')](_0x25b9('0x11'),_0x2aa0cc,_0x25b9('0xf'),JSON[_0x25b9('0x12')](_0x3584b6));if(_0x3584b6[_0x25b9('0x13')]){if(_0x3584b6[_0x25b9('0x13')][_0x25b9('0x14')]===0x1f4){logger['error'](_0x25b9('0xe'),_0x2aa0cc,_0x3584b6[_0x25b9('0x13')]['message']);return _0x3e6e4b(_0x3584b6[_0x25b9('0x13')][_0x25b9('0x15')]);}logger[_0x25b9('0x13')](_0x25b9('0xe'),_0x2aa0cc,_0x3584b6[_0x25b9('0x13')][_0x25b9('0x15')]);return _0x3437b5(_0x3584b6[_0x25b9('0x13')][_0x25b9('0x15')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x2aa0cc,'request\x20sent');_0x3437b5(_0x3584b6[_0x25b9('0x16')]['message']);}})['catch'](function(_0xb00fc0){logger[_0x25b9('0x13')](_0x25b9('0xe'),_0x2aa0cc,_0xb00fc0);_0x3e6e4b(_0xb00fc0);});});}
\ No newline at end of file
index 7619bca..912e533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['util','connect-timeout','express','Router','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','create','addSound','destroy','delete','/:id/sounds/:id2','removeSound','exports'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0x9f62,0x154));var _0x29f6=function(_0x5c623f,_0x58dc13){_0x5c623f=_0x5c623f-0x0;var _0x3c9521=_0x9f62[_0x5c623f];return _0x3c9521;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0x6')]('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0x29f6('0x7')](),controller[_0x29f6('0xa')]);router['post']('/:id/sounds',auth[_0x29f6('0x7')](),controller[_0x29f6('0xb')]);router['put'](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x29f6('0xc')]);router[_0x29f6('0xd')](_0x29f6('0xe'),auth[_0x29f6('0x7')](),controller[_0x29f6('0xf')]);module[_0x29f6('0x10')]=router;
\ No newline at end of file
+var _0x222f=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','get','/:id','show','getSounds','post','create','addSound','put','update','delete','destroy','/:id/sounds/:id2'];(function(_0x5be222,_0x32c73b){var _0x5d55f3=function(_0x4ab69d){while(--_0x4ab69d){_0x5be222['push'](_0x5be222['shift']());}};_0x5d55f3(++_0x32c73b);}(_0x222f,0x1a4));var _0xf222=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x222f[_0xcfc44];return _0x307a25;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf222('0x4'));var interaction=require(_0xf222('0x5'));var config=require(_0xf222('0x6'));var controller=require(_0xf222('0x7'));router['get']('/',auth[_0xf222('0x8')](),controller['index']);router[_0xf222('0x9')](_0xf222('0xa'),auth['isAuthenticated'](),controller[_0xf222('0xb')]);router[_0xf222('0x9')]('/:id/sounds',auth[_0xf222('0x8')](),controller[_0xf222('0xc')]);router[_0xf222('0xd')]('/',auth[_0xf222('0x8')](),controller[_0xf222('0xe')]);router[_0xf222('0xd')]('/:id/sounds',auth[_0xf222('0x8')](),controller[_0xf222('0xf')]);router[_0xf222('0x10')](_0xf222('0xa'),auth['isAuthenticated'](),controller[_0xf222('0x11')]);router[_0xf222('0x12')](_0xf222('0xa'),auth[_0xf222('0x8')](),controller[_0xf222('0x13')]);router[_0xf222('0x12')](_0xf222('0x14'),auth[_0xf222('0x8')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
index a01fbf3..43bbc7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb92=['files','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','quietmp3nb','mp3'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xfb92,0x1b0));var _0x2fb9=function(_0x552787,_0x59be28){_0x552787=_0x552787-0x0;var _0x18b7f5=_0xfb92[_0x552787];return _0x18b7f5;};'use strict';var Sequelize=require(_0x2fb9('0x0'));module[_0x2fb9('0x1')]={'name':{'type':Sequelize[_0x2fb9('0x2')],'allowNull':![],'unique':_0x2fb9('0x3')},'mode':{'type':Sequelize[_0x2fb9('0x4')](_0x2fb9('0x5'),'files','mp3nb',_0x2fb9('0x6'),'quietmp3',_0x2fb9('0x7')),'allowNull':!![],'defaultValue':_0x2fb9('0x8')},'directory':{'type':Sequelize[_0x2fb9('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x2fb9('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x2fb9('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2fb9('0x2')],'allowNull':!![]},'stamp':{'type':_0x2fb9('0x9')},'defaultEntry':{'type':Sequelize[_0x2fb9('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbd69=['exports','ENUM','custom','mp3nb','quietmp3nb','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x4fa1c7,_0x5b2ce3){var _0x31c4e9=function(_0x5b0d2e){while(--_0x5b0d2e){_0x4fa1c7['push'](_0x4fa1c7['shift']());}};_0x31c4e9(++_0x5b2ce3);}(_0xbd69,0x107));var _0x9bd6=function(_0x1fcd5e,_0x119463){_0x1fcd5e=_0x1fcd5e-0x0;var _0x1c910b=_0xbd69[_0x1fcd5e];return _0x1c910b;};'use strict';var Sequelize=require(_0x9bd6('0x0'));module[_0x9bd6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x9bd6('0x2')](_0x9bd6('0x3'),'files',_0x9bd6('0x4'),_0x9bd6('0x5'),'quietmp3',_0x9bd6('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x9bd6('0x7')],'allowNull':!![]},'application':{'type':Sequelize[_0x9bd6('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9bd6('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9bd6('0x7')],'allowNull':!![],'defaultValue':_0x9bd6('0x8')},'format':{'type':Sequelize[_0x9bd6('0x7')],'allowNull':!![]},'stamp':{'type':_0x9bd6('0x9')},'defaultEntry':{'type':Sequelize[_0x9bd6('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index c2126ee..87c2ba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16f9=['dateEnd','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','add','day','merge','filter','type','key','VIRTUAL','options','VoiceMusicOnHold','count','includeAll','include','findAll','rows','show','params','find','catch','body','create','sequelize','transaction','mode','files','join','root','server/files/moh','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','Sound','findOne','createdAt','format','%s.%s','basename','save_name','converted_format','symlinkSync','message','removeSound','id2','getSounds','order','pick','map','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','MusicOnHolds','UserProfileResource','then','status','error','name','send','index','rawAttributes','model','keys','dateStart'];(function(_0x43b702,_0x5b6a66){var _0x4ba7c7=function(_0x563c7b){while(--_0x563c7b){_0x43b702['push'](_0x43b702['shift']());}};_0x4ba7c7(++_0x5b6a66);}(_0x16f9,0x130));var _0x916f=function(_0x1c15bd,_0x15e665){_0x1c15bd=_0x1c15bd-0x0;var _0xc0abd2=_0x16f9[_0x1c15bd];return _0xc0abd2;};'use strict';var pdf=require(_0x916f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x916f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x916f('0x2'));var rp=require(_0x916f('0x3'));var moment=require(_0x916f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x916f('0x5'));var util=require(_0x916f('0x6'));var path=require(_0x916f('0x7'));var sox=require(_0x916f('0x8'));var csv=require(_0x916f('0x9'));var ejs=require(_0x916f('0xa'));var fs=require('fs');var _=require(_0x916f('0xb'));var squel=require(_0x916f('0xc'));var crypto=require(_0x916f('0xd'));var jsforce=require(_0x916f('0xe'));var deskjs=require(_0x916f('0xf'));var toCsv=require(_0x916f('0x9'));var querystring=require(_0x916f('0x10'));var Papa=require('papaparse');var Redis=require(_0x916f('0x11'));var qs=require(_0x916f('0x12'));var logger=require(_0x916f('0x13'))(_0x916f('0x14'));var utils=require(_0x916f('0x15'));var config=require(_0x916f('0x16'));var db=require(_0x916f('0x17'))['db'];function respondWithStatusCode(_0x56231a,_0x4f0958){_0x4f0958=_0x4f0958||0xcc;return function(_0x11e97f){if(_0x11e97f){return _0x56231a[_0x916f('0x18')](_0x4f0958);}return _0x56231a['status'](_0x4f0958)[_0x916f('0x19')]();};}function respondWithResult(_0x16bdd2,_0xe323d4){_0xe323d4=_0xe323d4||0xc8;return function(_0x1cf6df){if(_0x1cf6df){return _0x16bdd2['status'](_0xe323d4)[_0x916f('0x1a')](_0x1cf6df);}};}function respondWithFilteredResult(_0x6ddd10,_0x5eb399){return function(_0x55a00e){if(_0x55a00e){var _0x30a626=_0x55a00e['count'],_0x3b2439=_0x5eb399[_0x916f('0x1b')],_0x272fdf=_0x5eb399[_0x916f('0x1b')]+_0x5eb399['limit'],_0x3c24df;if(_0x272fdf>=_0x30a626){_0x272fdf=_0x30a626;_0x3c24df=0xc8;}else{_0x3c24df=0xce;}_0x6ddd10['status'](_0x3c24df);return _0x6ddd10[_0x916f('0x1c')](_0x916f('0x1d'),_0x3b2439+'-'+_0x272fdf+'/'+_0x30a626)['json'](_0x55a00e);}return null;};}function patchUpdates(_0x303679){return function(_0x168f25){try{jsonpatch[_0x916f('0x1e')](_0x168f25,_0x303679,!![]);}catch(_0x3e098c){return BPromise[_0x916f('0x1f')](_0x3e098c);}return _0x168f25[_0x916f('0x20')]();};}function saveUpdates(_0x57a279,_0x3b3a41){return function(_0x33f464){if(_0x33f464){return _0x33f464[_0x916f('0x21')](_0x57a279)['then'](function(_0x45e781){return _0x45e781;});}return null;};}function removeEntity(_0x31a99b,_0x3b7db1){return function(_0x47daf3){if(_0x47daf3){return _0x47daf3[_0x916f('0x22')]()['then'](function(){var _0x115233=_0x47daf3['get']({'plain':!![]});var _0x2b889d=_0x916f('0x23');return db[_0x916f('0x24')][_0x916f('0x22')]({'where':{'type':_0x2b889d,'resourceId':_0x115233['id']}})[_0x916f('0x25')](function(){return _0x47daf3;});})['then'](function(){_0x31a99b[_0x916f('0x26')](0xcc)[_0x916f('0x19')]();});}};}function handleEntityNotFound(_0x17aea1,_0x2ce0e4){return function(_0xc96b3b){if(!_0xc96b3b){_0x17aea1['sendStatus'](0x194);}return _0xc96b3b;};}function handleError(_0x11a413,_0x1db1e4){_0x1db1e4=_0x1db1e4||0x1f4;return function(_0x370510){logger[_0x916f('0x27')](_0x370510['stack']);if(_0x370510[_0x916f('0x28')]){delete _0x370510[_0x916f('0x28')];}_0x11a413[_0x916f('0x26')](_0x1db1e4)[_0x916f('0x29')](_0x370510);};}exports[_0x916f('0x2a')]=function(_0x25a9a9,_0x38bd11){var _0x4bbb19={},_0xa8835={},_0x1bddfd={'count':0x0,'rows':[]};var _0x1001ad=db['VoiceMusicOnHold'][_0x916f('0x2b')];_0xa8835[_0x916f('0x2c')]=_[_0x916f('0x2d')](_0x1001ad);var _0x58add5={'dateStart':_0x25a9a9['query'][_0x916f('0x2e')],'dateEnd':_0x25a9a9['query'][_0x916f('0x2f')]};delete _0x25a9a9[_0x916f('0x30')]['dateStart'];delete _0x25a9a9[_0x916f('0x30')]['dateEnd'];_0xa8835[_0x916f('0x30')]=_[_0x916f('0x2d')](_0x25a9a9[_0x916f('0x30')]);_0xa8835[_0x916f('0x31')]=_[_0x916f('0x32')](_0xa8835['model'],_0xa8835[_0x916f('0x30')]);_0x4bbb19[_0x916f('0x33')]=_[_0x916f('0x32')](_0xa8835[_0x916f('0x2c')],qs[_0x916f('0x34')](_0x25a9a9[_0x916f('0x30')][_0x916f('0x34')]));_0x4bbb19[_0x916f('0x33')]=_0x4bbb19[_0x916f('0x33')][_0x916f('0x35')]?_0x4bbb19['attributes']:_0xa8835['model'];if(!_0x25a9a9[_0x916f('0x30')][_0x916f('0x36')](_0x916f('0x37'))){_0x4bbb19[_0x916f('0x38')]=qs['limit'](_0x25a9a9[_0x916f('0x30')]['limit']);_0x4bbb19[_0x916f('0x1b')]=qs[_0x916f('0x1b')](_0x25a9a9[_0x916f('0x30')][_0x916f('0x1b')]);}_0x4bbb19['order']=qs[_0x916f('0x39')](_0x25a9a9[_0x916f('0x30')][_0x916f('0x39')]);_0x4bbb19[_0x916f('0x3a')]=qs[_0x916f('0x31')](_['pick'](_0x25a9a9['query'],_0xa8835[_0x916f('0x31')]));if(_0x58add5[_0x916f('0x2e')]){if(_0x58add5[_0x916f('0x2f')]){_0x58add5['dateEnd']=moment(_0x58add5[_0x916f('0x2f')])[_0x916f('0x3b')](0x1,_0x916f('0x3c'));}else{_0x58add5[_0x916f('0x2f')]=moment(_0x58add5[_0x916f('0x2e')])[_0x916f('0x3b')](0x1,_0x916f('0x3c'));}_[_0x916f('0x3d')](_0x4bbb19[_0x916f('0x3a')],{'createdAt':{'$gte':_0x58add5[_0x916f('0x2e')],'$lte':_0x58add5[_0x916f('0x2f')]}});}if(_0x25a9a9[_0x916f('0x30')][_0x916f('0x3e')]){_0x4bbb19[_0x916f('0x3a')]=_['merge'](_0x4bbb19['where'],{'$or':_['map'](_0x1001ad,function(_0x50e190){if(_0x50e190[_0x916f('0x3f')][_0x916f('0x40')]!==_0x916f('0x41')){var _0x5ea82a={};_0x5ea82a[_0x50e190['field']]={'$like':'%'+_0x25a9a9[_0x916f('0x30')]['filter']+'%'};return _0x5ea82a;}})});}_0x4bbb19=_['merge']({},_0x4bbb19,_0x25a9a9[_0x916f('0x42')]);var _0x413a93={'where':_0x4bbb19['where']};return db[_0x916f('0x43')][_0x916f('0x44')](_0x413a93)[_0x916f('0x25')](function(_0x5bcdfc){_0x1bddfd['count']=_0x5bcdfc;if(_0x25a9a9[_0x916f('0x30')][_0x916f('0x45')]){_0x4bbb19[_0x916f('0x46')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x916f('0x47')](_0x4bbb19);})[_0x916f('0x25')](function(_0x15089a){_0x1bddfd[_0x916f('0x48')]=_0x15089a;return _0x1bddfd;})['then'](respondWithFilteredResult(_0x38bd11,_0x4bbb19))['catch'](handleError(_0x38bd11,null));};exports[_0x916f('0x49')]=function(_0x21a046,_0x448484){var _0x4946ef={'raw':![],'where':{'id':_0x21a046[_0x916f('0x4a')]['id']}},_0x2dbd56={};_0x2dbd56[_0x916f('0x2c')]=_['keys'](db[_0x916f('0x43')][_0x916f('0x2b')]);_0x2dbd56[_0x916f('0x30')]=_[_0x916f('0x2d')](_0x21a046[_0x916f('0x30')]);_0x2dbd56[_0x916f('0x31')]=_[_0x916f('0x32')](_0x2dbd56[_0x916f('0x2c')],_0x2dbd56[_0x916f('0x30')]);_0x4946ef[_0x916f('0x33')]=_[_0x916f('0x32')](_0x2dbd56[_0x916f('0x2c')],qs[_0x916f('0x34')](_0x21a046[_0x916f('0x30')][_0x916f('0x34')]));_0x4946ef[_0x916f('0x33')]=_0x4946ef['attributes'][_0x916f('0x35')]?_0x4946ef[_0x916f('0x33')]:_0x2dbd56['model'];if(_0x21a046[_0x916f('0x30')][_0x916f('0x45')]){_0x4946ef[_0x916f('0x46')]=[{'all':!![]}];}_0x4946ef=_[_0x916f('0x3d')]({},_0x4946ef,_0x21a046[_0x916f('0x42')]);return db[_0x916f('0x43')][_0x916f('0x4b')](_0x4946ef)['then'](handleEntityNotFound(_0x448484,null))['then'](respondWithResult(_0x448484,null))[_0x916f('0x4c')](handleError(_0x448484,null));};exports['update']=function(_0x4739ec,_0x13432e){if(_0x4739ec[_0x916f('0x4d')]['id']){delete _0x4739ec[_0x916f('0x4d')]['id'];}return db[_0x916f('0x43')][_0x916f('0x4b')]({'where':{'id':_0x4739ec[_0x916f('0x4a')]['id']}})[_0x916f('0x25')](handleEntityNotFound(_0x13432e,null))[_0x916f('0x25')](saveUpdates(_0x4739ec[_0x916f('0x4d')],null))['then'](respondWithResult(_0x13432e,null))[_0x916f('0x4c')](handleError(_0x13432e,null));};exports[_0x916f('0x4e')]=function(_0x6091e3,_0x47e11f,_0x4e3907){return db[_0x916f('0x4f')][_0x916f('0x50')](function(_0x570742){if(_0x6091e3[_0x916f('0x4d')][_0x916f('0x51')]===_0x916f('0x52')){_0x6091e3[_0x916f('0x4d')]['directory']=path[_0x916f('0x53')](config[_0x916f('0x54')],_0x916f('0x55'),_0x6091e3[_0x916f('0x4d')][_0x916f('0x28')]);}return db[_0x916f('0x43')][_0x916f('0x4e')](_0x6091e3['body'],{'transaction':_0x570742})['then'](function(_0x1dedca){if(_0x6091e3[_0x916f('0x4d')][_0x916f('0x51')]==='files'){fs['mkdirSync'](_0x1dedca['directory'],parseInt(_0x916f('0x56'),0x8));}var _0x438eac=_0x6091e3[_0x916f('0x57')][_0x916f('0x58')]({'plain':!![]});if(!_0x438eac)throw new Error(_0x916f('0x59'));if(_0x438eac[_0x916f('0x5a')]===_0x916f('0x57')){var _0x493759=_0x1dedca['get']({'plain':!![]});return db[_0x916f('0x5b')][_0x916f('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x438eac[_0x916f('0x5c')]},'raw':!![]})[_0x916f('0x25')](function(_0x5e4fc9){if(_0x5e4fc9&&_0x5e4fc9[_0x916f('0x5d')]===0x0){return db[_0x916f('0x24')]['create']({'name':_0x493759[_0x916f('0x28')],'resourceId':_0x493759['id'],'type':_0x5e4fc9[_0x916f('0x28')],'sectionId':_0x5e4fc9['id']},{})[_0x916f('0x25')](function(){return _0x1dedca;});}else{return _0x1dedca;}})[_0x916f('0x4c')](function(_0x3d20c2){logger['error'](_0x916f('0x5e'),_0x3d20c2);});}return _0x1dedca;});})['then'](respondWithResult(_0x47e11f,0xc9))['catch'](handleError(_0x47e11f,null));};exports[_0x916f('0x22')]=function(_0x5f1975,_0x4a4621,_0x5d9285){var _0x1d18a8;return db['VoiceMusicOnHold'][_0x916f('0x4b')]({'where':{'id':_0x5f1975['params']['id']}})[_0x916f('0x25')](function(_0x59da93){if(_0x59da93){return db['sequelize'][_0x916f('0x50')](function(_0x4d0bf9){return _0x59da93['destroy']({'transaction':_0x4d0bf9,'raw':!![]})[_0x916f('0x25')](function(_0x3b9051){if(_0x3b9051[_0x916f('0x5f')]){fs[_0x916f('0x60')](_0x3b9051[_0x916f('0x5f')])['forEach'](function(_0x1a416b){fs[_0x916f('0x61')](path[_0x916f('0x53')](_0x3b9051[_0x916f('0x5f')],_0x1a416b));});fs[_0x916f('0x62')](_0x3b9051['directory']);}return _0x3b9051;});})['catch'](function(_0x5cdb55){throw new db[(_0x916f('0x63'))][(_0x916f('0x64'))](_0x5cdb55['message']);});}})['then'](handleEntityNotFound(_0x4a4621,null))[_0x916f('0x25')](removeEntity(_0x4a4621,null))[_0x916f('0x4c')](handleError(_0x4a4621,null));};exports['addSound']=function(_0x1ca490,_0x4aeb3c,_0x48dc28){return db['sequelize']['transaction'](function(_0x35f644){var _0x1d8fb0;return db['VoiceMusicOnHold'][_0x916f('0x4b')]({'where':{'id':_0x1ca490['params']['id']}})[_0x916f('0x25')](function(_0x518f1a){if(_0x518f1a){_0x1d8fb0=_0x518f1a;return _0x518f1a['addSound'](_0x1ca490[_0x916f('0x4d')]['id'],{'transaction':_0x35f644});}})['then'](function(_0x5634d6){if(_0x5634d6){return db[_0x916f('0x65')][_0x916f('0x66')]({'where':{'id':_0x1ca490[_0x916f('0x4d')]['id']},'attributes':['id',_0x916f('0x28'),'save_name','converted_format',_0x916f('0x67')],'raw':!![]});}})[_0x916f('0x25')](function(_0x193e5d){if(_0x193e5d){var _0x4cac37=path[_0x916f('0x53')](config['root'],'server/files/sounds/converted',util[_0x916f('0x68')](_0x916f('0x69'),path[_0x916f('0x6a')](_0x193e5d[_0x916f('0x6b')],path['extname'](_0x193e5d[_0x916f('0x6b')])),_0x193e5d[_0x916f('0x6c')]));var _0x33bddb=path[_0x916f('0x53')](config[_0x916f('0x54')],_0x916f('0x55'),_0x1d8fb0[_0x916f('0x28')],util['format'](_0x916f('0x69'),_0x193e5d[_0x916f('0x28')],_0x193e5d[_0x916f('0x6c')]));fs[_0x916f('0x6d')](_0x4cac37,_0x33bddb);return _0x193e5d;}})[_0x916f('0x4c')](function(_0x4b80ca){throw new db[(_0x916f('0x63'))][(_0x916f('0x64'))](_0x4b80ca[_0x916f('0x6e')]);});})[_0x916f('0x25')](handleEntityNotFound(_0x4aeb3c,null))[_0x916f('0x25')](respondWithResult(_0x4aeb3c,0xc9))[_0x916f('0x4c')](handleError(_0x4aeb3c,null));};exports[_0x916f('0x6f')]=function(_0x5aa1bb,_0x457832,_0x5d8231){return db['sequelize'][_0x916f('0x50')](function(_0x22c84e){var _0x1addf7;return db[_0x916f('0x43')][_0x916f('0x66')]({'where':{'id':_0x5aa1bb[_0x916f('0x4a')]['id']}})[_0x916f('0x25')](handleEntityNotFound(_0x457832,null))[_0x916f('0x25')](function(_0x7c4dd6){if(_0x7c4dd6){_0x1addf7=_0x7c4dd6;return _0x7c4dd6['removeSound'](_0x5aa1bb['params'][_0x916f('0x70')]);}})[_0x916f('0x25')](function(_0x9f936e){if(_0x9f936e){return db[_0x916f('0x65')]['findOne']({'where':{'id':_0x5aa1bb['params']['id2']},'attributes':['id',_0x916f('0x28'),_0x916f('0x6b'),_0x916f('0x6c'),_0x916f('0x67')],'raw':!![]});}})['then'](function(_0x49cf8e){if(_0x49cf8e){fs[_0x916f('0x61')](path[_0x916f('0x53')](_0x1addf7[_0x916f('0x5f')],util[_0x916f('0x68')](_0x916f('0x69'),_0x49cf8e[_0x916f('0x28')],_0x49cf8e[_0x916f('0x6c')])));return _0x49cf8e;}})[_0x916f('0x4c')](function(_0x4ea904){throw new db[(_0x916f('0x63'))]['ValidationError'](_0x4ea904['message']);});})[_0x916f('0x25')](handleEntityNotFound(_0x457832,null))[_0x916f('0x25')](respondWithStatusCode(_0x457832,0xcc))[_0x916f('0x4c')](handleError(_0x457832,null));};exports[_0x916f('0x71')]=function(_0x35ab4a,_0x204a6b,_0x1d7ce9){var _0x7eb8fe={};var _0x35d7c2={};var _0x48dfbd;var _0x56306e;return db[_0x916f('0x43')]['findOne']({'where':{'id':_0x35ab4a['params']['id']}})['then'](handleEntityNotFound(_0x204a6b,null))[_0x916f('0x25')](function(_0x25f95a){if(_0x25f95a){_0x48dfbd=_0x25f95a;_0x35d7c2['model']=_[_0x916f('0x2d')](db[_0x916f('0x65')][_0x916f('0x2b')]);_0x35d7c2[_0x916f('0x30')]=_['keys'](_0x35ab4a[_0x916f('0x30')]);_0x35d7c2['filters']=_['intersection'](_0x35d7c2[_0x916f('0x2c')],_0x35d7c2[_0x916f('0x30')]);_0x7eb8fe['attributes']=_['intersection'](_0x35d7c2[_0x916f('0x2c')],qs['fields'](_0x35ab4a[_0x916f('0x30')][_0x916f('0x34')]));_0x7eb8fe['attributes']=_0x7eb8fe[_0x916f('0x33')][_0x916f('0x35')]?_0x7eb8fe[_0x916f('0x33')]:_0x35d7c2[_0x916f('0x2c')];_0x7eb8fe[_0x916f('0x72')]=qs['sort'](_0x35ab4a[_0x916f('0x30')][_0x916f('0x39')]);_0x7eb8fe[_0x916f('0x3a')]=qs[_0x916f('0x31')](_[_0x916f('0x73')](_0x35ab4a[_0x916f('0x30')],_0x35d7c2['filters']));if(_0x35ab4a[_0x916f('0x30')][_0x916f('0x3e')]){_0x7eb8fe['where']=_['merge'](_0x7eb8fe[_0x916f('0x3a')],{'$or':_[_0x916f('0x74')](_0x7eb8fe[_0x916f('0x33')],function(_0x348e62){var _0xa1b958={};_0xa1b958[_0x348e62]={'$like':'%'+_0x35ab4a[_0x916f('0x30')]['filter']+'%'};return _0xa1b958;})});}_0x7eb8fe=_[_0x916f('0x3d')]({},_0x7eb8fe,_0x35ab4a[_0x916f('0x42')]);return _0x48dfbd[_0x916f('0x71')](_0x7eb8fe);}})[_0x916f('0x25')](function(_0x28e609){if(_0x28e609){_0x56306e=_0x28e609[_0x916f('0x35')];if(!_0x35ab4a[_0x916f('0x30')][_0x916f('0x36')](_0x916f('0x37'))){_0x7eb8fe['limit']=qs[_0x916f('0x38')](_0x35ab4a[_0x916f('0x30')][_0x916f('0x38')]);_0x7eb8fe['offset']=qs[_0x916f('0x1b')](_0x35ab4a['query'][_0x916f('0x1b')]);}return _0x48dfbd['getSounds'](_0x7eb8fe);}})['then'](function(_0xf714ef){if(_0xf714ef){return _0xf714ef?{'count':_0x56306e,'rows':_0xf714ef}:null;}})[_0x916f('0x25')](respondWithResult(_0x204a6b,null))[_0x916f('0x4c')](handleError(_0x204a6b,null));};
\ No newline at end of file
+var _0x9889=['sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','VoiceMusicOnHold','rawAttributes','model','keys','dateStart','query','dateEnd','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','add','day','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','intersection','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','removeSound','id2','getSounds','map','nolimit','html-pdf','eml-format','zip-dir','request-promise','moment','mustache'];(function(_0x5cae89,_0x26e21f){var _0x2b1f81=function(_0x192626){while(--_0x192626){_0x5cae89['push'](_0x5cae89['shift']());}};_0x2b1f81(++_0x26e21f);}(_0x9889,0x1aa));var _0x9988=function(_0xbad6f7,_0x5ac406){_0xbad6f7=_0xbad6f7-0x0;var _0x245d9e=_0x9889[_0xbad6f7];return _0x245d9e;};'use strict';var pdf=require(_0x9988('0x0'));var emlformat=require(_0x9988('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9988('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9988('0x3'));var moment=require(_0x9988('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9988('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9988('0x6'));var csv=require(_0x9988('0x7'));var ejs=require(_0x9988('0x8'));var fs=require('fs');var _=require(_0x9988('0x9'));var squel=require(_0x9988('0xa'));var crypto=require(_0x9988('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9988('0xc'));var Redis=require('ioredis');var qs=require(_0x9988('0xd'));var logger=require(_0x9988('0xe'))(_0x9988('0xf'));var utils=require('../../config/utils');var config=require(_0x9988('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4015c0,_0xb338b4){_0xb338b4=_0xb338b4||0xcc;return function(_0x569350){if(_0x569350){return _0x4015c0[_0x9988('0x11')](_0xb338b4);}return _0x4015c0['status'](_0xb338b4)[_0x9988('0x12')]();};}function respondWithResult(_0x3f4ce1,_0x489a71){_0x489a71=_0x489a71||0xc8;return function(_0x5d1fea){if(_0x5d1fea){return _0x3f4ce1[_0x9988('0x13')](_0x489a71)[_0x9988('0x14')](_0x5d1fea);}};}function respondWithFilteredResult(_0x200f2a,_0x473588){return function(_0x4ac56d){if(_0x4ac56d){var _0x1066b3=_0x4ac56d[_0x9988('0x15')],_0x509d64=_0x473588[_0x9988('0x16')],_0x80ec7=_0x473588['offset']+_0x473588[_0x9988('0x17')],_0x59130e;if(_0x80ec7>=_0x1066b3){_0x80ec7=_0x1066b3;_0x59130e=0xc8;}else{_0x59130e=0xce;}_0x200f2a['status'](_0x59130e);return _0x200f2a[_0x9988('0x18')](_0x9988('0x19'),_0x509d64+'-'+_0x80ec7+'/'+_0x1066b3)['json'](_0x4ac56d);}return null;};}function patchUpdates(_0x4afaaf){return function(_0x49d4fd){try{jsonpatch[_0x9988('0x1a')](_0x49d4fd,_0x4afaaf,!![]);}catch(_0x163ced){return BPromise[_0x9988('0x1b')](_0x163ced);}return _0x49d4fd[_0x9988('0x1c')]();};}function saveUpdates(_0xc870a0,_0x511bc9){return function(_0x5717e5){if(_0x5717e5){return _0x5717e5['update'](_0xc870a0)[_0x9988('0x1d')](function(_0x25f34a){return _0x25f34a;});}return null;};}function removeEntity(_0x3f3779,_0x20ca76){return function(_0x2b5ea9){if(_0x2b5ea9){return _0x2b5ea9[_0x9988('0x1e')]()['then'](function(){var _0x1519cd=_0x2b5ea9[_0x9988('0x1f')]({'plain':!![]});var _0x40ef14=_0x9988('0x20');return db[_0x9988('0x21')]['destroy']({'where':{'type':_0x40ef14,'resourceId':_0x1519cd['id']}})[_0x9988('0x1d')](function(){return _0x2b5ea9;});})[_0x9988('0x1d')](function(){_0x3f3779[_0x9988('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b289b,_0x1edb68){return function(_0x2cdcd5){if(!_0x2cdcd5){_0x1b289b['sendStatus'](0x194);}return _0x2cdcd5;};}function handleError(_0x532870,_0x2cdb77){_0x2cdb77=_0x2cdb77||0x1f4;return function(_0x33335e){logger[_0x9988('0x22')](_0x33335e['stack']);if(_0x33335e[_0x9988('0x23')]){delete _0x33335e[_0x9988('0x23')];}_0x532870['status'](_0x2cdb77)['send'](_0x33335e);};}exports['index']=function(_0x30b1fc,_0xd1e9dc){var _0x164e49={},_0x5bcb48={},_0x41396f={'count':0x0,'rows':[]};var _0x47e720=db[_0x9988('0x24')][_0x9988('0x25')];_0x5bcb48[_0x9988('0x26')]=_[_0x9988('0x27')](_0x47e720);var _0x466808={'dateStart':_0x30b1fc['query'][_0x9988('0x28')],'dateEnd':_0x30b1fc[_0x9988('0x29')][_0x9988('0x2a')]};delete _0x30b1fc[_0x9988('0x29')][_0x9988('0x28')];delete _0x30b1fc[_0x9988('0x29')][_0x9988('0x2a')];_0x5bcb48[_0x9988('0x29')]=_['keys'](_0x30b1fc[_0x9988('0x29')]);_0x5bcb48['filters']=_['intersection'](_0x5bcb48[_0x9988('0x26')],_0x5bcb48['query']);_0x164e49[_0x9988('0x2b')]=_['intersection'](_0x5bcb48[_0x9988('0x26')],qs['fields'](_0x30b1fc[_0x9988('0x29')][_0x9988('0x2c')]));_0x164e49[_0x9988('0x2b')]=_0x164e49[_0x9988('0x2b')][_0x9988('0x2d')]?_0x164e49['attributes']:_0x5bcb48[_0x9988('0x26')];if(!_0x30b1fc[_0x9988('0x29')][_0x9988('0x2e')]('nolimit')){_0x164e49['limit']=qs[_0x9988('0x17')](_0x30b1fc['query'][_0x9988('0x17')]);_0x164e49['offset']=qs[_0x9988('0x16')](_0x30b1fc['query'][_0x9988('0x16')]);}_0x164e49[_0x9988('0x2f')]=qs[_0x9988('0x30')](_0x30b1fc[_0x9988('0x29')][_0x9988('0x30')]);_0x164e49[_0x9988('0x31')]=qs['filters'](_[_0x9988('0x32')](_0x30b1fc[_0x9988('0x29')],_0x5bcb48[_0x9988('0x33')]));if(_0x466808[_0x9988('0x28')]){if(_0x466808[_0x9988('0x2a')]){_0x466808[_0x9988('0x2a')]=moment(_0x466808[_0x9988('0x2a')])[_0x9988('0x34')](0x1,_0x9988('0x35'));}else{_0x466808[_0x9988('0x2a')]=moment(_0x466808[_0x9988('0x28')])[_0x9988('0x34')](0x1,_0x9988('0x35'));}_['merge'](_0x164e49[_0x9988('0x31')],{'createdAt':{'$gte':_0x466808[_0x9988('0x28')],'$lte':_0x466808[_0x9988('0x2a')]}});}if(_0x30b1fc[_0x9988('0x29')][_0x9988('0x36')]){_0x164e49[_0x9988('0x31')]=_[_0x9988('0x37')](_0x164e49['where'],{'$or':_['map'](_0x47e720,function(_0x3cd428){if(_0x3cd428[_0x9988('0x38')][_0x9988('0x39')]!==_0x9988('0x3a')){var _0x12c057={};_0x12c057[_0x3cd428[_0x9988('0x3b')]]={'$like':'%'+_0x30b1fc[_0x9988('0x29')][_0x9988('0x36')]+'%'};return _0x12c057;}})});}_0x164e49=_[_0x9988('0x37')]({},_0x164e49,_0x30b1fc[_0x9988('0x3c')]);var _0x3ac87f={'where':_0x164e49[_0x9988('0x31')]};return db['VoiceMusicOnHold'][_0x9988('0x15')](_0x3ac87f)[_0x9988('0x1d')](function(_0x2e4fdf){_0x41396f[_0x9988('0x15')]=_0x2e4fdf;if(_0x30b1fc['query'][_0x9988('0x3d')]){_0x164e49['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x9988('0x3e')](_0x164e49);})[_0x9988('0x1d')](function(_0x1c1359){_0x41396f[_0x9988('0x3f')]=_0x1c1359;return _0x41396f;})[_0x9988('0x1d')](respondWithFilteredResult(_0xd1e9dc,_0x164e49))[_0x9988('0x40')](handleError(_0xd1e9dc,null));};exports['show']=function(_0x259bc9,_0x127cac){var _0x405689={'raw':![],'where':{'id':_0x259bc9[_0x9988('0x41')]['id']}},_0x511f4f={};_0x511f4f[_0x9988('0x26')]=_[_0x9988('0x27')](db[_0x9988('0x24')][_0x9988('0x25')]);_0x511f4f['query']=_['keys'](_0x259bc9[_0x9988('0x29')]);_0x511f4f[_0x9988('0x33')]=_[_0x9988('0x42')](_0x511f4f[_0x9988('0x26')],_0x511f4f[_0x9988('0x29')]);_0x405689['attributes']=_['intersection'](_0x511f4f[_0x9988('0x26')],qs[_0x9988('0x2c')](_0x259bc9[_0x9988('0x29')]['fields']));_0x405689[_0x9988('0x2b')]=_0x405689['attributes'][_0x9988('0x2d')]?_0x405689[_0x9988('0x2b')]:_0x511f4f[_0x9988('0x26')];if(_0x259bc9['query'][_0x9988('0x3d')]){_0x405689['include']=[{'all':!![]}];}_0x405689=_[_0x9988('0x37')]({},_0x405689,_0x259bc9[_0x9988('0x3c')]);return db['VoiceMusicOnHold'][_0x9988('0x43')](_0x405689)[_0x9988('0x1d')](handleEntityNotFound(_0x127cac,null))[_0x9988('0x1d')](respondWithResult(_0x127cac,null))['catch'](handleError(_0x127cac,null));};exports[_0x9988('0x44')]=function(_0x1069fb,_0x5ebd6d){if(_0x1069fb[_0x9988('0x45')]['id']){delete _0x1069fb[_0x9988('0x45')]['id'];}return db[_0x9988('0x24')][_0x9988('0x43')]({'where':{'id':_0x1069fb[_0x9988('0x41')]['id']}})[_0x9988('0x1d')](handleEntityNotFound(_0x5ebd6d,null))[_0x9988('0x1d')](saveUpdates(_0x1069fb[_0x9988('0x45')],null))[_0x9988('0x1d')](respondWithResult(_0x5ebd6d,null))['catch'](handleError(_0x5ebd6d,null));};exports[_0x9988('0x46')]=function(_0x85ef37,_0x33714c,_0x1853b7){return db[_0x9988('0x47')][_0x9988('0x48')](function(_0x47aaa9){if(_0x85ef37[_0x9988('0x45')][_0x9988('0x49')]===_0x9988('0x4a')){_0x85ef37['body'][_0x9988('0x4b')]=path[_0x9988('0x4c')](config[_0x9988('0x4d')],_0x9988('0x4e'),_0x85ef37[_0x9988('0x45')][_0x9988('0x23')]);}return db[_0x9988('0x24')][_0x9988('0x46')](_0x85ef37[_0x9988('0x45')],{'transaction':_0x47aaa9})[_0x9988('0x1d')](function(_0x4650f2){if(_0x85ef37[_0x9988('0x45')][_0x9988('0x49')]===_0x9988('0x4a')){fs[_0x9988('0x4f')](_0x4650f2['directory'],parseInt(_0x9988('0x50'),0x8));}var _0x238101=_0x85ef37[_0x9988('0x51')][_0x9988('0x1f')]({'plain':!![]});if(!_0x238101)throw new Error(_0x9988('0x52'));if(_0x238101['role']===_0x9988('0x51')){var _0x4aad2d=_0x4650f2[_0x9988('0x1f')]({'plain':!![]});return db[_0x9988('0x53')][_0x9988('0x43')]({'where':{'name':_0x9988('0x20'),'userProfileId':_0x238101['userProfileId']},'raw':!![]})[_0x9988('0x1d')](function(_0x139f3e){if(_0x139f3e&&_0x139f3e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4aad2d[_0x9988('0x23')],'resourceId':_0x4aad2d['id'],'type':_0x139f3e[_0x9988('0x23')],'sectionId':_0x139f3e['id']},{})[_0x9988('0x1d')](function(){return _0x4650f2;});}else{return _0x4650f2;}})['catch'](function(_0x461f35){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x461f35);});}return _0x4650f2;});})['then'](respondWithResult(_0x33714c,0xc9))[_0x9988('0x40')](handleError(_0x33714c,null));};exports[_0x9988('0x1e')]=function(_0x5cf6ad,_0x282c64,_0xb59623){var _0x9a2f4a;return db[_0x9988('0x24')][_0x9988('0x43')]({'where':{'id':_0x5cf6ad[_0x9988('0x41')]['id']}})[_0x9988('0x1d')](function(_0x5ae770){if(_0x5ae770){return db[_0x9988('0x47')][_0x9988('0x48')](function(_0x3d5aac){return _0x5ae770[_0x9988('0x1e')]({'transaction':_0x3d5aac,'raw':!![]})[_0x9988('0x1d')](function(_0x5ef908){if(_0x5ef908[_0x9988('0x4b')]){fs[_0x9988('0x54')](_0x5ef908[_0x9988('0x4b')])[_0x9988('0x55')](function(_0x15ca53){fs[_0x9988('0x56')](path[_0x9988('0x4c')](_0x5ef908[_0x9988('0x4b')],_0x15ca53));});fs[_0x9988('0x57')](_0x5ef908[_0x9988('0x4b')]);}return _0x5ef908;});})['catch'](function(_0x5d8e74){throw new db[(_0x9988('0x58'))][(_0x9988('0x59'))](_0x5d8e74[_0x9988('0x5a')]);});}})[_0x9988('0x1d')](handleEntityNotFound(_0x282c64,null))[_0x9988('0x1d')](removeEntity(_0x282c64,null))['catch'](handleError(_0x282c64,null));};exports[_0x9988('0x5b')]=function(_0x1243b1,_0x170625,_0x5d5a4b){return db['sequelize'][_0x9988('0x48')](function(_0x1ba7be){var _0x5342a9;return db[_0x9988('0x24')][_0x9988('0x43')]({'where':{'id':_0x1243b1[_0x9988('0x41')]['id']}})[_0x9988('0x1d')](function(_0x14d5d8){if(_0x14d5d8){_0x5342a9=_0x14d5d8;return _0x14d5d8[_0x9988('0x5b')](_0x1243b1[_0x9988('0x45')]['id'],{'transaction':_0x1ba7be});}})[_0x9988('0x1d')](function(_0x469cc3){if(_0x469cc3){return db[_0x9988('0x5c')][_0x9988('0x5d')]({'where':{'id':_0x1243b1[_0x9988('0x45')]['id']},'attributes':['id',_0x9988('0x23'),_0x9988('0x5e'),_0x9988('0x5f'),_0x9988('0x60')],'raw':!![]});}})[_0x9988('0x1d')](function(_0x1c0e2d){if(_0x1c0e2d){var _0x208d79=path['join'](config[_0x9988('0x4d')],_0x9988('0x61'),util[_0x9988('0x62')]('%s.%s',path[_0x9988('0x63')](_0x1c0e2d[_0x9988('0x5e')],path[_0x9988('0x64')](_0x1c0e2d[_0x9988('0x5e')])),_0x1c0e2d[_0x9988('0x5f')]));var _0x3053f2=path[_0x9988('0x4c')](config[_0x9988('0x4d')],'server/files/moh',_0x5342a9[_0x9988('0x23')],util[_0x9988('0x62')](_0x9988('0x65'),_0x1c0e2d[_0x9988('0x23')],_0x1c0e2d[_0x9988('0x5f')]));fs[_0x9988('0x66')](_0x208d79,_0x3053f2);return _0x1c0e2d;}})['catch'](function(_0xbefdd7){throw new db[(_0x9988('0x58'))][(_0x9988('0x59'))](_0xbefdd7[_0x9988('0x5a')]);});})['then'](handleEntityNotFound(_0x170625,null))[_0x9988('0x1d')](respondWithResult(_0x170625,0xc9))[_0x9988('0x40')](handleError(_0x170625,null));};exports['removeSound']=function(_0x53363b,_0x252bce,_0x517902){return db[_0x9988('0x47')][_0x9988('0x48')](function(_0x38509d){var _0x5e07cb;return db['VoiceMusicOnHold'][_0x9988('0x5d')]({'where':{'id':_0x53363b[_0x9988('0x41')]['id']}})[_0x9988('0x1d')](handleEntityNotFound(_0x252bce,null))[_0x9988('0x1d')](function(_0x42483d){if(_0x42483d){_0x5e07cb=_0x42483d;return _0x42483d[_0x9988('0x67')](_0x53363b[_0x9988('0x41')][_0x9988('0x68')]);}})[_0x9988('0x1d')](function(_0x360da3){if(_0x360da3){return db[_0x9988('0x5c')][_0x9988('0x5d')]({'where':{'id':_0x53363b[_0x9988('0x41')]['id2']},'attributes':['id',_0x9988('0x23'),_0x9988('0x5e'),_0x9988('0x5f'),_0x9988('0x60')],'raw':!![]});}})[_0x9988('0x1d')](function(_0x29e72c){if(_0x29e72c){fs[_0x9988('0x56')](path[_0x9988('0x4c')](_0x5e07cb['directory'],util[_0x9988('0x62')](_0x9988('0x65'),_0x29e72c[_0x9988('0x23')],_0x29e72c[_0x9988('0x5f')])));return _0x29e72c;}})['catch'](function(_0x5a4c4e){throw new db['Sequelize'][(_0x9988('0x59'))](_0x5a4c4e['message']);});})[_0x9988('0x1d')](handleEntityNotFound(_0x252bce,null))[_0x9988('0x1d')](respondWithStatusCode(_0x252bce,0xcc))[_0x9988('0x40')](handleError(_0x252bce,null));};exports[_0x9988('0x69')]=function(_0x4295c7,_0x102db6,_0x277840){var _0x5e9c55={};var _0x523d44={};var _0x298615;var _0x339c7d;return db['VoiceMusicOnHold'][_0x9988('0x5d')]({'where':{'id':_0x4295c7[_0x9988('0x41')]['id']}})[_0x9988('0x1d')](handleEntityNotFound(_0x102db6,null))[_0x9988('0x1d')](function(_0x2eb790){if(_0x2eb790){_0x298615=_0x2eb790;_0x523d44[_0x9988('0x26')]=_[_0x9988('0x27')](db[_0x9988('0x5c')]['rawAttributes']);_0x523d44[_0x9988('0x29')]=_['keys'](_0x4295c7['query']);_0x523d44[_0x9988('0x33')]=_[_0x9988('0x42')](_0x523d44['model'],_0x523d44['query']);_0x5e9c55[_0x9988('0x2b')]=_[_0x9988('0x42')](_0x523d44[_0x9988('0x26')],qs['fields'](_0x4295c7['query'][_0x9988('0x2c')]));_0x5e9c55[_0x9988('0x2b')]=_0x5e9c55[_0x9988('0x2b')][_0x9988('0x2d')]?_0x5e9c55[_0x9988('0x2b')]:_0x523d44['model'];_0x5e9c55[_0x9988('0x2f')]=qs[_0x9988('0x30')](_0x4295c7['query']['sort']);_0x5e9c55[_0x9988('0x31')]=qs[_0x9988('0x33')](_[_0x9988('0x32')](_0x4295c7[_0x9988('0x29')],_0x523d44[_0x9988('0x33')]));if(_0x4295c7[_0x9988('0x29')][_0x9988('0x36')]){_0x5e9c55[_0x9988('0x31')]=_[_0x9988('0x37')](_0x5e9c55[_0x9988('0x31')],{'$or':_[_0x9988('0x6a')](_0x5e9c55[_0x9988('0x2b')],function(_0xdbccae){var _0x2f3bee={};_0x2f3bee[_0xdbccae]={'$like':'%'+_0x4295c7[_0x9988('0x29')][_0x9988('0x36')]+'%'};return _0x2f3bee;})});}_0x5e9c55=_[_0x9988('0x37')]({},_0x5e9c55,_0x4295c7[_0x9988('0x3c')]);return _0x298615[_0x9988('0x69')](_0x5e9c55);}})[_0x9988('0x1d')](function(_0x36e056){if(_0x36e056){_0x339c7d=_0x36e056[_0x9988('0x2d')];if(!_0x4295c7['query'][_0x9988('0x2e')](_0x9988('0x6b'))){_0x5e9c55['limit']=qs[_0x9988('0x17')](_0x4295c7[_0x9988('0x29')][_0x9988('0x17')]);_0x5e9c55['offset']=qs[_0x9988('0x16')](_0x4295c7[_0x9988('0x29')][_0x9988('0x16')]);}return _0x298615['getSounds'](_0x5e9c55);}})[_0x9988('0x1d')](function(_0x43aba7){if(_0x43aba7){return _0x43aba7?{'count':_0x339c7d,'rows':_0x43aba7}:null;}})[_0x9988('0x1d')](respondWithResult(_0x102db6,null))['catch'](handleError(_0x102db6,null));};
\ No newline at end of file
index 097bbee..534d3b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6700=['util','../../config/logger','api','bluebird','request-promise','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x20b626,_0x699183){var _0x11e715=function(_0x2e170c){while(--_0x2e170c){_0x20b626['push'](_0x20b626['shift']());}};_0x11e715(++_0x699183);}(_0x6700,0xb3));var _0x0670=function(_0x58b671,_0x387471){_0x58b671=_0x58b671-0x0;var _0x4157be=_0x6700[_0x58b671];return _0x4157be;};'use strict';var _=require(_0x0670('0x0'));var util=require(_0x0670('0x1'));var logger=require(_0x0670('0x2'))(_0x0670('0x3'));var moment=require('moment');var BPromise=require(_0x0670('0x4'));var rp=require(_0x0670('0x5'));var attributes=require(_0x0670('0x6'));module[_0x0670('0x7')]=function(_0x7436b1,_0x1760bc){return _0x7436b1['define'](_0x0670('0x8'),attributes,{'tableName':_0x0670('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d43=['lodash','../../config/logger','api','bluebird','request-promise','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7d43,0x12c));var _0x37d4=function(_0x5e2b05,_0x547d4e){_0x5e2b05=_0x5e2b05-0x0;var _0x5c9299=_0x7d43[_0x5e2b05];return _0x5c9299;};'use strict';var _=require(_0x37d4('0x0'));var util=require('util');var logger=require(_0x37d4('0x1'))(_0x37d4('0x2'));var moment=require('moment');var BPromise=require(_0x37d4('0x3'));var rp=require(_0x37d4('0x4'));var attributes=require(_0x37d4('0x5'));module[_0x37d4('0x6')]=function(_0x584cc3,_0x2e1b22){return _0x584cc3[_0x37d4('0x7')](_0x37d4('0x8'),attributes,{'tableName':_0x37d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7039f10..feaacb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0582=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0582,0x150));var _0x2058=function(_0x57781a,_0x24cff3){_0x57781a=_0x57781a-0x0;var _0x20cf93=_0x0582[_0x57781a];return _0x20cf93;};'use strict';var _=require('lodash');var util=require(_0x2058('0x0'));var moment=require(_0x2058('0x1'));var BPromise=require(_0x2058('0x2'));var rs=require(_0x2058('0x3'));var fs=require('fs');var Redis=require(_0x2058('0x4'));var db=require(_0x2058('0x5'))['db'];var utils=require(_0x2058('0x6'));var logger=require(_0x2058('0x7'))(_0x2058('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2058('0x9')][_0x2058('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37980d,_0x3121c5,_0x105b0f){return new BPromise(function(_0x1481ce,_0x5e62b4){return client['request'](_0x37980d,_0x105b0f)['then'](function(_0x4bff13){logger[_0x2058('0xb')](_0x2058('0xc'),_0x3121c5,_0x2058('0xd'));logger[_0x2058('0xe')](_0x2058('0xf'),_0x3121c5,_0x2058('0xd'),JSON[_0x2058('0x10')](_0x4bff13));if(_0x4bff13[_0x2058('0x11')]){if(_0x4bff13[_0x2058('0x11')]['code']===0x1f4){logger['error'](_0x2058('0xc'),_0x3121c5,_0x4bff13['error'][_0x2058('0x12')]);return _0x5e62b4(_0x4bff13[_0x2058('0x11')][_0x2058('0x12')]);}logger[_0x2058('0x11')](_0x2058('0xc'),_0x3121c5,_0x4bff13[_0x2058('0x11')]['message']);return _0x1481ce(_0x4bff13['error'][_0x2058('0x12')]);}else{logger[_0x2058('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3121c5,_0x2058('0xd'));_0x1481ce(_0x4bff13[_0x2058('0x13')]['message']);}})['catch'](function(_0x5ba6dc){logger['error'](_0x2058('0xc'),_0x3121c5,_0x5ba6dc);_0x5e62b4(_0x5ba6dc);});});}
\ No newline at end of file
+var _0xa1b3=['request\x20sent','debug','stringify','error','message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0x583f70,_0x88f208){var _0x20e8cb=function(_0x27ec09){while(--_0x27ec09){_0x583f70['push'](_0x583f70['shift']());}};_0x20e8cb(++_0x88f208);}(_0xa1b3,0x67));var _0x3a1b=function(_0x43cb01,_0x4f5908){_0x43cb01=_0x43cb01-0x0;var _0x1b8e3f=_0xa1b3[_0x43cb01];return _0x1b8e3f;};'use strict';var _=require(_0x3a1b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a1b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a1b('0x2'));var db=require(_0x3a1b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a1b('0x4'))(_0x3a1b('0x5'));var config=require('../../config/environment');var jayson=require(_0x3a1b('0x6'));var client=jayson['client'][_0x3a1b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5a52b5,_0x49f0b4,_0x3df3a8){return new BPromise(function(_0x395cd0,_0x220ce5){return client[_0x3a1b('0x8')](_0x5a52b5,_0x3df3a8)[_0x3a1b('0x9')](function(_0x3cf695){logger['info'](_0x3a1b('0xa'),_0x49f0b4,_0x3a1b('0xb'));logger[_0x3a1b('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x49f0b4,_0x3a1b('0xb'),JSON[_0x3a1b('0xd')](_0x3cf695));if(_0x3cf695[_0x3a1b('0xe')]){if(_0x3cf695[_0x3a1b('0xe')]['code']===0x1f4){logger[_0x3a1b('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x49f0b4,_0x3cf695[_0x3a1b('0xe')]['message']);return _0x220ce5(_0x3cf695[_0x3a1b('0xe')]['message']);}logger['error'](_0x3a1b('0xa'),_0x49f0b4,_0x3cf695[_0x3a1b('0xe')][_0x3a1b('0xf')]);return _0x395cd0(_0x3cf695[_0x3a1b('0xe')][_0x3a1b('0xf')]);}else{logger[_0x3a1b('0x10')](_0x3a1b('0xa'),_0x49f0b4,_0x3a1b('0xb'));_0x395cd0(_0x3cf695[_0x3a1b('0x11')][_0x3a1b('0xf')]);}})[_0x3a1b('0x12')](function(_0x4fc660){logger[_0x3a1b('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x49f0b4,_0x4fc660);_0x220ce5(_0x4fc660);});});}
\ No newline at end of file
index 92ae3ba..7562e5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd01f=['post','create','addAgents','put','update','delete','removeAgents','exports','multer','path','express','Router','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','/:id','show','/:id/users','getAgents'];(function(_0x57ce26,_0x34b0c4){var _0x59df84=function(_0x411d4e){while(--_0x411d4e){_0x57ce26['push'](_0x57ce26['shift']());}};_0x59df84(++_0x34b0c4);}(_0xd01f,0x1d6));var _0xfd01=function(_0x3289bc,_0x2b86bc){_0x3289bc=_0x3289bc-0x0;var _0xeabd30=_0xd01f[_0x3289bc];return _0xeabd30;};'use strict';var multer=require(_0xfd01('0x0'));var util=require('util');var path=require(_0xfd01('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd01('0x2'));var router=express[_0xfd01('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xfd01('0x4'));var config=require('../../config/environment');var controller=require(_0xfd01('0x5'));router[_0xfd01('0x6')]('/',auth[_0xfd01('0x7')](),controller['index']);router[_0xfd01('0x6')](_0xfd01('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xfd01('0x6')](_0xfd01('0x9'),auth[_0xfd01('0x7')](),controller[_0xfd01('0xa')]);router[_0xfd01('0x6')](_0xfd01('0xb'),auth[_0xfd01('0x7')](),controller[_0xfd01('0xc')]);router[_0xfd01('0xd')]('/',auth[_0xfd01('0x7')](),controller[_0xfd01('0xe')]);router[_0xfd01('0xd')]('/:id/users',auth[_0xfd01('0x7')](),controller[_0xfd01('0xf')]);router[_0xfd01('0x10')](_0xfd01('0x9'),auth[_0xfd01('0x7')](),controller[_0xfd01('0x11')]);router[_0xfd01('0x12')](_0xfd01('0x9'),auth[_0xfd01('0x7')](),controller['destroy']);router['delete'](_0xfd01('0xb'),auth[_0xfd01('0x7')](),controller[_0xfd01('0x13')]);module[_0xfd01('0x14')]=router;
\ No newline at end of file
+var _0x3678=['put','update','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','create','post','addAgents'];(function(_0x1c7067,_0x468800){var _0x3cfb5b=function(_0x5a97c8){while(--_0x5a97c8){_0x1c7067['push'](_0x1c7067['shift']());}};_0x3cfb5b(++_0x468800);}(_0x3678,0x81));var _0x8367=function(_0x3559c4,_0x47580b){_0x3559c4=_0x3559c4-0x0;var _0x124053=_0x3678[_0x3559c4];return _0x124053;};'use strict';var multer=require(_0x8367('0x0'));var util=require(_0x8367('0x1'));var path=require(_0x8367('0x2'));var timeout=require(_0x8367('0x3'));var express=require(_0x8367('0x4'));var router=express[_0x8367('0x5')]();var auth=require(_0x8367('0x6'));var interaction=require(_0x8367('0x7'));var config=require(_0x8367('0x8'));var controller=require(_0x8367('0x9'));router[_0x8367('0xa')]('/',auth[_0x8367('0xb')](),controller[_0x8367('0xc')]);router[_0x8367('0xa')](_0x8367('0xd'),auth[_0x8367('0xb')](),controller['describe']);router[_0x8367('0xa')](_0x8367('0xe'),auth[_0x8367('0xb')](),controller[_0x8367('0xf')]);router[_0x8367('0xa')](_0x8367('0x10'),auth[_0x8367('0xb')](),controller[_0x8367('0x11')]);router['post']('/',auth[_0x8367('0xb')](),controller[_0x8367('0x12')]);router[_0x8367('0x13')]('/:id/users',auth[_0x8367('0xb')](),controller[_0x8367('0x14')]);router[_0x8367('0x15')]('/:id',auth[_0x8367('0xb')](),controller[_0x8367('0x16')]);router['delete']('/:id',auth[_0x8367('0xb')](),controller[_0x8367('0x17')]);router['delete'](_0x8367('0x10'),auth[_0x8367('0xb')](),controller[_0x8367('0x18')]);module['exports']=router;
\ No newline at end of file
index 3594203..6a65244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa757=['exports','name','VIRTUAL','system-','getDataValue','STRING','sequelize'];(function(_0x549ed1,_0x1ebfba){var _0x4bbc07=function(_0x43f8c2){while(--_0x43f8c2){_0x549ed1['push'](_0x549ed1['shift']());}};_0x4bbc07(++_0x1ebfba);}(_0xa757,0x179));var _0x7a75=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xa757[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x7a75('0x0'));module[_0x7a75('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7a75('0x2')},'prefix':{'type':Sequelize[_0x7a75('0x3')],'get':function(_0xa024c){return _0x7a75('0x4')+this[_0x7a75('0x5')](_0x7a75('0x2'))+'-';}},'description':{'type':Sequelize[_0x7a75('0x6')]},'callerIdAll':{'type':Sequelize[_0x7a75('0x6')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x9ae5=['getDataValue','STRING','INTEGER','exports','name','VIRTUAL','system-'];(function(_0x19a72c,_0x2229cb){var _0x3c6199=function(_0x4293e9){while(--_0x4293e9){_0x19a72c['push'](_0x19a72c['shift']());}};_0x3c6199(++_0x2229cb);}(_0x9ae5,0x1c3));var _0x59ae=function(_0x2d25a3,_0x2664bf){_0x2d25a3=_0x2d25a3-0x0;var _0x520004=_0x9ae5[_0x2d25a3];return _0x520004;};'use strict';var Sequelize=require('sequelize');module[_0x59ae('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x59ae('0x1')},'prefix':{'type':Sequelize[_0x59ae('0x2')],'get':function(_0x28e620){return _0x59ae('0x3')+this[_0x59ae('0x4')](_0x59ae('0x1'))+'-';}},'description':{'type':Sequelize[_0x59ae('0x5')]},'callerIdAll':{'type':Sequelize[_0x59ae('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x59ae('0x6')]}};
\ No newline at end of file
index 4236b2b..705047c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['order','map','getAgents','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','get','VoicePrefixes','destroy','end','error','stack','name','send','index','VoicePrefix','rawAttributes','model','keys','query','dateStart','dateEnd','attributes','intersection','fields','nolimit','sort','where','filters','pick','add','day','merge','filter','type','VIRTUAL','field','options','show','params','includeAll','include','find','catch','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','length','charAt','system-','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','findOne','User'];(function(_0x2bc441,_0x3af951){var _0xabf4b7=function(_0x4990f7){while(--_0x4990f7){_0x2bc441['push'](_0x2bc441['shift']());}};_0xabf4b7(++_0x3af951);}(_0x3e74,0x175));var _0x43e7=function(_0x551b60,_0x2cdb3f){_0x551b60=_0x551b60-0x0;var _0x199cdf=_0x3e74[_0x551b60];return _0x199cdf;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0xf'))(_0x43e7('0x10'));var utils=require('../../config/utils');var config=require(_0x43e7('0x11'));var db=require('../../mysqldb')['db'];config[_0x43e7('0x12')]=_[_0x43e7('0x13')](config['redis'],{'host':_0x43e7('0x14'),'port':0x18eb});var socket=require(_0x43e7('0x15'))(new Redis(config[_0x43e7('0x12')]));require(_0x43e7('0x16'))['register'](socket);function respondWithStatusCode(_0x583d85,_0x2fcb36){_0x2fcb36=_0x2fcb36||0xcc;return function(_0x21fdd3){if(_0x21fdd3){return _0x583d85[_0x43e7('0x17')](_0x2fcb36);}return _0x583d85['status'](_0x2fcb36)['end']();};}function respondWithResult(_0x16849c,_0x14c146){_0x14c146=_0x14c146||0xc8;return function(_0x203378){if(_0x203378){return _0x16849c[_0x43e7('0x18')](_0x14c146)['json'](_0x203378);}};}function respondWithFilteredResult(_0x5c4eaa,_0xdf16c){return function(_0x264575){if(_0x264575){var _0x273a32=_0x264575[_0x43e7('0x19')],_0x5d346f=_0xdf16c[_0x43e7('0x1a')],_0x4b5a6b=_0xdf16c[_0x43e7('0x1a')]+_0xdf16c[_0x43e7('0x1b')],_0x446986;if(_0x4b5a6b>=_0x273a32){_0x4b5a6b=_0x273a32;_0x446986=0xc8;}else{_0x446986=0xce;}_0x5c4eaa[_0x43e7('0x18')](_0x446986);return _0x5c4eaa[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x5d346f+'-'+_0x4b5a6b+'/'+_0x273a32)[_0x43e7('0x1e')](_0x264575);}return null;};}function patchUpdates(_0xab63cf){return function(_0x191dd5){try{jsonpatch[_0x43e7('0x1f')](_0x191dd5,_0xab63cf,!![]);}catch(_0x4b5d64){return BPromise[_0x43e7('0x20')](_0x4b5d64);}return _0x191dd5[_0x43e7('0x21')]();};}function saveUpdates(_0x4b386b,_0x2898b5){return function(_0x3e281e){if(_0x3e281e){return _0x3e281e[_0x43e7('0x22')](_0x4b386b)[_0x43e7('0x23')](function(_0x4077fb){return _0x4077fb;});}return null;};}function removeEntity(_0x2f4cb4,_0x54a9e7){return function(_0x454359){if(_0x454359){return _0x454359['destroy']()['then'](function(){var _0x47204e=_0x454359[_0x43e7('0x24')]({'plain':!![]});var _0x4b2b9f=_0x43e7('0x25');return db['UserProfileResource'][_0x43e7('0x26')]({'where':{'type':_0x4b2b9f,'resourceId':_0x47204e['id']}})['then'](function(){return _0x454359;});})[_0x43e7('0x23')](function(){_0x2f4cb4[_0x43e7('0x18')](0xcc)[_0x43e7('0x27')]();});}};}function handleEntityNotFound(_0x405f85,_0x51f4d7){return function(_0x52b7b3){if(!_0x52b7b3){_0x405f85[_0x43e7('0x17')](0x194);}return _0x52b7b3;};}function handleError(_0x501551,_0x2dd5f){_0x2dd5f=_0x2dd5f||0x1f4;return function(_0x40dc8f){logger[_0x43e7('0x28')](_0x40dc8f[_0x43e7('0x29')]);if(_0x40dc8f['name']){delete _0x40dc8f[_0x43e7('0x2a')];}_0x501551[_0x43e7('0x18')](_0x2dd5f)[_0x43e7('0x2b')](_0x40dc8f);};}exports[_0x43e7('0x2c')]=function(_0x442c3b,_0x84dd4d){var _0x2b85a5={},_0x31b2a6={},_0x3bf475={'count':0x0,'rows':[]};var _0x35dbcd=db[_0x43e7('0x2d')][_0x43e7('0x2e')];_0x31b2a6[_0x43e7('0x2f')]=_[_0x43e7('0x30')](_0x35dbcd);var _0x4bdb17={'dateStart':_0x442c3b[_0x43e7('0x31')][_0x43e7('0x32')],'dateEnd':_0x442c3b[_0x43e7('0x31')][_0x43e7('0x33')]};delete _0x442c3b[_0x43e7('0x31')]['dateStart'];delete _0x442c3b[_0x43e7('0x31')][_0x43e7('0x33')];_0x31b2a6[_0x43e7('0x31')]=_[_0x43e7('0x30')](_0x442c3b['query']);_0x31b2a6['filters']=_['intersection'](_0x31b2a6[_0x43e7('0x2f')],_0x31b2a6[_0x43e7('0x31')]);_0x2b85a5[_0x43e7('0x34')]=_[_0x43e7('0x35')](_0x31b2a6[_0x43e7('0x2f')],qs[_0x43e7('0x36')](_0x442c3b['query']['fields']));_0x2b85a5['attributes']=_0x2b85a5['attributes']['length']?_0x2b85a5['attributes']:_0x31b2a6['model'];if(!_0x442c3b[_0x43e7('0x31')]['hasOwnProperty'](_0x43e7('0x37'))){_0x2b85a5[_0x43e7('0x1b')]=qs[_0x43e7('0x1b')](_0x442c3b[_0x43e7('0x31')][_0x43e7('0x1b')]);_0x2b85a5[_0x43e7('0x1a')]=qs[_0x43e7('0x1a')](_0x442c3b['query']['offset']);}_0x2b85a5['order']=qs[_0x43e7('0x38')](_0x442c3b[_0x43e7('0x31')][_0x43e7('0x38')]);_0x2b85a5[_0x43e7('0x39')]=qs[_0x43e7('0x3a')](_[_0x43e7('0x3b')](_0x442c3b[_0x43e7('0x31')],_0x31b2a6[_0x43e7('0x3a')]));if(_0x4bdb17['dateStart']){if(_0x4bdb17[_0x43e7('0x33')]){_0x4bdb17[_0x43e7('0x33')]=moment(_0x4bdb17['dateEnd'])[_0x43e7('0x3c')](0x1,'day');}else{_0x4bdb17[_0x43e7('0x33')]=moment(_0x4bdb17[_0x43e7('0x32')])[_0x43e7('0x3c')](0x1,_0x43e7('0x3d'));}_[_0x43e7('0x3e')](_0x2b85a5[_0x43e7('0x39')],{'createdAt':{'$gte':_0x4bdb17['dateStart'],'$lte':_0x4bdb17['dateEnd']}});}if(_0x442c3b[_0x43e7('0x31')][_0x43e7('0x3f')]){_0x2b85a5[_0x43e7('0x39')]=_[_0x43e7('0x3e')](_0x2b85a5[_0x43e7('0x39')],{'$or':_['map'](_0x35dbcd,function(_0x32a451){if(_0x32a451[_0x43e7('0x40')]['key']!==_0x43e7('0x41')){var _0x51a69c={};_0x51a69c[_0x32a451[_0x43e7('0x42')]]={'$like':'%'+_0x442c3b['query'][_0x43e7('0x3f')]+'%'};return _0x51a69c;}})});}_0x2b85a5=_[_0x43e7('0x3e')]({},_0x2b85a5,_0x442c3b[_0x43e7('0x43')]);var _0x1c2c6b={'where':_0x2b85a5['where']};return db['VoicePrefix'][_0x43e7('0x19')](_0x1c2c6b)[_0x43e7('0x23')](function(_0xe979b5){_0x3bf475[_0x43e7('0x19')]=_0xe979b5;if(_0x442c3b['query']['includeAll']){_0x2b85a5['include']=[{'all':!![]}];}return db[_0x43e7('0x2d')]['findAll'](_0x2b85a5);})[_0x43e7('0x23')](function(_0x4b3a59){_0x3bf475['rows']=_0x4b3a59;return _0x3bf475;})[_0x43e7('0x23')](respondWithFilteredResult(_0x84dd4d,_0x2b85a5))['catch'](handleError(_0x84dd4d,null));};exports[_0x43e7('0x44')]=function(_0x39db7f,_0x257bd8){var _0x99b9e1={'raw':![],'where':{'id':_0x39db7f[_0x43e7('0x45')]['id']}},_0x4fc5e8={};_0x4fc5e8[_0x43e7('0x2f')]=_[_0x43e7('0x30')](db[_0x43e7('0x2d')][_0x43e7('0x2e')]);_0x4fc5e8[_0x43e7('0x31')]=_['keys'](_0x39db7f['query']);_0x4fc5e8[_0x43e7('0x3a')]=_[_0x43e7('0x35')](_0x4fc5e8[_0x43e7('0x2f')],_0x4fc5e8['query']);_0x99b9e1['attributes']=_['intersection'](_0x4fc5e8[_0x43e7('0x2f')],qs[_0x43e7('0x36')](_0x39db7f['query'][_0x43e7('0x36')]));_0x99b9e1[_0x43e7('0x34')]=_0x99b9e1[_0x43e7('0x34')]['length']?_0x99b9e1['attributes']:_0x4fc5e8['model'];if(_0x39db7f['query'][_0x43e7('0x46')]){_0x99b9e1[_0x43e7('0x47')]=[{'all':!![]}];}_0x99b9e1=_['merge']({},_0x99b9e1,_0x39db7f[_0x43e7('0x43')]);return db[_0x43e7('0x2d')][_0x43e7('0x48')](_0x99b9e1)[_0x43e7('0x23')](handleEntityNotFound(_0x257bd8,null))['then'](respondWithResult(_0x257bd8,null))[_0x43e7('0x49')](handleError(_0x257bd8,null));};exports['destroy']=function(_0x4bebd4,_0x3e97da){return db[_0x43e7('0x2d')][_0x43e7('0x48')]({'where':{'id':_0x4bebd4[_0x43e7('0x45')]['id']}})[_0x43e7('0x23')](handleEntityNotFound(_0x3e97da,null))[_0x43e7('0x23')](removeEntity(_0x3e97da,null))[_0x43e7('0x49')](handleError(_0x3e97da,null));};exports[_0x43e7('0x4a')]=function(_0x473fca,_0x2b5515){return db['VoicePrefix'][_0x43e7('0x4a')]()[_0x43e7('0x23')](respondWithResult(_0x2b5515,null))['catch'](handleError(_0x2b5515,null));};exports[_0x43e7('0x4b')]=function(_0x4e6f6d,_0x35b799){var _0x520857;return db[_0x43e7('0x4c')][_0x43e7('0x4d')](function(_0xfe13fa){return db['VoicePrefix']['create'](_0x4e6f6d[_0x43e7('0x4e')],{'transaction':_0xfe13fa})[_0x43e7('0x23')](function(_0x399942){_0x520857=_0x399942[_0x43e7('0x24')]({'plain':!![]});return db[_0x43e7('0x4f')][_0x43e7('0x48')]({'where':{'id':_0x520857[_0x43e7('0x50')]},'raw':!![]})[_0x43e7('0x23')](function(_0x26d86c){return createVoicePrefixExtensions(_0x520857,_0x26d86c,_0xfe13fa);});});})[_0x43e7('0x23')](function(){var _0x312306=_0x4e6f6d['user'][_0x43e7('0x24')]({'plain':!![]});if(!_0x312306)throw new Error(_0x43e7('0x51'));if(_0x312306['role']===_0x43e7('0x52')){var _0x220bf2=_0x520857;return db[_0x43e7('0x53')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x312306[_0x43e7('0x54')]},'raw':!![]})[_0x43e7('0x23')](function(_0x4ebdde){if(_0x4ebdde&&_0x4ebdde[_0x43e7('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x220bf2[_0x43e7('0x2a')],'resourceId':_0x220bf2['id'],'type':_0x4ebdde[_0x43e7('0x2a')],'sectionId':_0x4ebdde['id']},{})[_0x43e7('0x23')](function(){return _0x520857;});}else{return _0x520857;}})[_0x43e7('0x49')](function(_0x68697){logger['error'](_0x43e7('0x56'),_0x68697);throw _0x68697;});}return _0x520857;})[_0x43e7('0x23')](respondWithResult(_0x35b799,null))['catch'](handleError(_0x35b799,null));};function Extension(_0x20283b,_0x1267c5,_0x296a0d,_0x5bb536){this['context']='from-sip';this[_0x43e7('0x57')]=_0x20283b;this[_0x43e7('0x58')]=_0x296a0d;this[_0x43e7('0x40')]=_0x43e7('0x59');this['description']='Voice\x20Prefix\x20Extension';this[_0x43e7('0x5a')]=_0x1267c5;this[_0x43e7('0x5b')]=_0x5bb536;}function createVoicePrefixExtensions(_0x140438,_0x5dd349,_0x5ea0db){return new BPromise(function(_0x4438c0,_0x1a7cb5){var _0x23595c=new Extension(formatPrefixName(_0x140438[_0x43e7('0x5c')]),0x1,_0x43e7('0x5d'),_0x43e7('0x5e'));_0x23595c[_0x43e7('0x5f')]=_0x140438['id'];return db[_0x43e7('0x4f')][_0x43e7('0x4b')](_0x23595c,{'transaction':_0x5ea0db})[_0x43e7('0x23')](function(_0x252f00){var _0x57fdfe=_0x252f00['get']({'plain':!![]});var _0x2b0711=_['map'](addVoicePrefixExtensions(_0x140438,_0x5dd349),function(_0x501616){_0x501616['VoiceExtensionId']=_0x57fdfe['id'];_0x501616[_0x43e7('0x5f')]=_0x140438['id'];return _0x501616;});return db[_0x43e7('0x4f')]['bulkCreate'](_0x2b0711,{'transaction':_0x5ea0db})[_0x43e7('0x23')](function(_0x135791){if(!_0x135791){return _0x1a7cb5(_0x43e7('0x60'));}else{return _0x4438c0(_0x135791);}})['catch'](function(_0x2b7406){return _0x1a7cb5(_0x2b7406);});});;});};function addVoicePrefixExtensions(_0x9771ad,_0x289f86){var _0xc9723=[];var _0x2f43d7=formatPrefixName(_0x9771ad[_0x43e7('0x5c')]);_0xc9723[_0x43e7('0x61')](new Extension(_0x2f43d7,0x2,'Set',_0x43e7('0x62')+_0x9771ad[_0x43e7('0x2a')]));if(_0x9771ad[_0x43e7('0x63')]){_0xc9723['push'](new Extension(_0x2f43d7,0x3,'Set',_0x43e7('0x64')+_0x9771ad['callerIdAll']));}else{_0xc9723['push'](new Extension(_0x2f43d7,0x3,_0x43e7('0x5d'),_0x43e7('0x65')));}_0xc9723['push'](new Extension(_0x2f43d7,0x4,_0x43e7('0x66'),_0x289f86[_0x43e7('0x67')]+','+_0x43e7('0x68')+(0x8+_0x9771ad[_0x43e7('0x2a')][_0x43e7('0x69')])+'}'+','+0x1));return _0xc9723;}function formatPrefixName(_0x13ef5c){var _0x398a78='_';for(var _0x4ce33c=0x0;_0x4ce33c<_0x13ef5c[_0x43e7('0x69')];_0x4ce33c++){if(_0x13ef5c[_0x43e7('0x6a')](_0x4ce33c)=='-'){_0x398a78+=_0x13ef5c['charAt'](_0x4ce33c);}else{_0x398a78+='['+_0x13ef5c[_0x43e7('0x6a')](_0x4ce33c)+']';}}_0x398a78+='.';return _0x398a78;}exports['update']=function(_0x26ee52,_0x248936,_0x37301b){var _0x1ca24b=_0x26ee52['body'];_0x1ca24b[_0x43e7('0x5c')]=_0x43e7('0x6b')+_0x1ca24b[_0x43e7('0x2a')]+'-';return db['sequelize'][_0x43e7('0x4d')](function(_0x38fa5b){return db[_0x43e7('0x2d')][_0x43e7('0x22')](_0x1ca24b,{'where':{'id':_0x1ca24b['id']},'transaction':_0x38fa5b})[_0x43e7('0x23')](function(){return db['VoiceExtension'][_0x43e7('0x26')]({'where':{'VoicePrefixId':_0x1ca24b['id']},'transaction':_0x38fa5b})[_0x43e7('0x23')](function(){return db[_0x43e7('0x4f')][_0x43e7('0x48')]({'where':{'id':_0x1ca24b[_0x43e7('0x50')]},'raw':!![]})[_0x43e7('0x23')](function(_0x438754){return createVoicePrefixExtensions(_0x1ca24b,_0x438754,_0x38fa5b);});});});})['then'](function(){return db['VoicePrefix'][_0x43e7('0x6c')](_0x1ca24b['id']);})['then'](respondWithResult(_0x248936,null))['catch'](handleError(_0x248936,null));};exports['addAgents']=function(_0x43daec,_0x88be29,_0x230fda){return db[_0x43e7('0x2d')][_0x43e7('0x48')]({'where':{'id':_0x43daec[_0x43e7('0x45')]['id']}})['then'](handleEntityNotFound(_0x88be29,null))[_0x43e7('0x23')](function(_0x1ead5b){if(_0x1ead5b){return _0x1ead5b[_0x43e7('0x6d')](_0x43daec['body'][_0x43e7('0x6e')],_[_0x43e7('0x6f')](_0x43daec[_0x43e7('0x4e')],[_0x43e7('0x6e'),'id'])||{})[_0x43e7('0x70')](function(_0xeb6340){for(var _0x1d4a29=0x0;_0x1d4a29<_0x43daec[_0x43e7('0x4e')]['ids']['length'];_0x1d4a29+=0x1){socket['emit'](_0x43e7('0x71'),{'UserId':_0x43daec[_0x43e7('0x4e')]['ids'][_0x1d4a29],'VoicePrefixId':_0x43daec[_0x43e7('0x45')]['id']});}return _0xeb6340;});}})[_0x43e7('0x23')](respondWithResult(_0x88be29,null))[_0x43e7('0x49')](handleError(_0x88be29,null));};exports[_0x43e7('0x72')]=function(_0x5a5565,_0x5d1da4,_0x5f5ac9){var _0x177a7a;return db[_0x43e7('0x2d')]['find']({'where':{'id':_0x5a5565['params']['id']}})[_0x43e7('0x23')](handleEntityNotFound(_0x5d1da4,null))[_0x43e7('0x23')](function(_0x3b7e5b){if(_0x3b7e5b){return _0x3b7e5b['removeAgents'](_0x5a5565[_0x43e7('0x31')][_0x43e7('0x6e')])[_0x43e7('0x23')](function(_0xb04082){if(_['isArray'](_0x5a5565[_0x43e7('0x31')]['ids'])){for(var _0xa66309=0x0;_0xa66309<_0x5a5565[_0x43e7('0x31')][_0x43e7('0x6e')][_0x43e7('0x69')];_0xa66309+=0x1){socket[_0x43e7('0x73')](_0x43e7('0x74'),{'UserId':_0x5a5565[_0x43e7('0x31')]['ids'][_0xa66309],'VoicePrefixId':_0x5a5565[_0x43e7('0x45')]['id']});}}else{socket[_0x43e7('0x73')](_0x43e7('0x74'),{'UserId':_0x5a5565[_0x43e7('0x31')]['ids'],'VoicePrefixId':_0x5a5565['params']['id']});}});}})['then'](respondWithStatusCode(_0x5d1da4,null))[_0x43e7('0x49')](handleError(_0x5d1da4,null));};exports['getAgents']=function(_0x240f0d,_0x36b768,_0x2d02bf){var _0x7387f6={};var _0xa75254={};var _0x9cd323;var _0x28a962;return db[_0x43e7('0x2d')][_0x43e7('0x75')]({'where':{'id':_0x240f0d[_0x43e7('0x45')]['id']}})[_0x43e7('0x23')](handleEntityNotFound(_0x36b768,null))['then'](function(_0xeaef5c){if(_0xeaef5c){_0x9cd323=_0xeaef5c;_0xa75254[_0x43e7('0x2f')]=_[_0x43e7('0x30')](db[_0x43e7('0x76')][_0x43e7('0x2e')]);_0xa75254['query']=_['keys'](_0x240f0d[_0x43e7('0x31')]);_0xa75254[_0x43e7('0x3a')]=_['intersection'](_0xa75254[_0x43e7('0x2f')],_0xa75254[_0x43e7('0x31')]);_0x7387f6['attributes']=_['intersection'](_0xa75254[_0x43e7('0x2f')],qs[_0x43e7('0x36')](_0x240f0d[_0x43e7('0x31')][_0x43e7('0x36')]));_0x7387f6[_0x43e7('0x34')]=_0x7387f6['attributes']['length']?_0x7387f6[_0x43e7('0x34')]:_0xa75254[_0x43e7('0x2f')];_0x7387f6[_0x43e7('0x77')]=qs[_0x43e7('0x38')](_0x240f0d['query'][_0x43e7('0x38')]);_0x7387f6[_0x43e7('0x39')]=qs[_0x43e7('0x3a')](_[_0x43e7('0x3b')](_0x240f0d['query'],_0xa75254[_0x43e7('0x3a')]));if(_0x240f0d[_0x43e7('0x31')][_0x43e7('0x3f')]){_0x7387f6[_0x43e7('0x39')]=_[_0x43e7('0x3e')](_0x7387f6['where'],{'$or':_[_0x43e7('0x78')](_0x7387f6[_0x43e7('0x34')],function(_0x509d8d){var _0xac0d64={};_0xac0d64[_0x509d8d]={'$like':'%'+_0x240f0d[_0x43e7('0x31')][_0x43e7('0x3f')]+'%'};return _0xac0d64;})});}_0x7387f6=_[_0x43e7('0x3e')]({},_0x7387f6,_0x240f0d['options']);return _0x9cd323[_0x43e7('0x79')](_0x7387f6);}})['then'](function(_0x130b41){if(_0x130b41){_0x28a962=_0x130b41[_0x43e7('0x69')];if(!_0x240f0d[_0x43e7('0x31')][_0x43e7('0x7a')](_0x43e7('0x37'))){_0x7387f6[_0x43e7('0x1b')]=qs[_0x43e7('0x1b')](_0x240f0d[_0x43e7('0x31')][_0x43e7('0x1b')]);_0x7387f6['offset']=qs[_0x43e7('0x1a')](_0x240f0d[_0x43e7('0x31')][_0x43e7('0x1a')]);}return _0x9cd323[_0x43e7('0x79')](_0x7387f6);}})['then'](function(_0x519523){if(_0x519523){return _0x519523?{'count':_0x28a962,'rows':_0x519523}:null;}})[_0x43e7('0x23')](respondWithResult(_0x36b768,null))[_0x43e7('0x49')](handleError(_0x36b768,null));};
\ No newline at end of file
+var _0x55ca=['show','params','includeAll','options','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','transaction','addAgents','ids','spread','emit','isArray','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','index','VoicePrefix','rawAttributes','model','query','dateStart','dateEnd','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','add','day','merge','where','filter','map','type','field','include','catch'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x55ca,0x126));var _0xa55c=function(_0x111494,_0x1d73da){_0x111494=_0x111494-0x0;var _0x1d0d8b=_0x55ca[_0x111494];return _0x1d0d8b;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');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('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0xa55c('0xe'));var logger=require(_0xa55c('0xf'))(_0xa55c('0x10'));var utils=require(_0xa55c('0x11'));var config=require(_0xa55c('0x12'));var db=require(_0xa55c('0x13'))['db'];config[_0xa55c('0x14')]=_[_0xa55c('0x15')](config[_0xa55c('0x14')],{'host':_0xa55c('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa55c('0x17'))['register'](socket);function respondWithStatusCode(_0x5a3672,_0x59ea8d){_0x59ea8d=_0x59ea8d||0xcc;return function(_0x18ee85){if(_0x18ee85){return _0x5a3672[_0xa55c('0x18')](_0x59ea8d);}return _0x5a3672[_0xa55c('0x19')](_0x59ea8d)[_0xa55c('0x1a')]();};}function respondWithResult(_0x458480,_0x247e77){_0x247e77=_0x247e77||0xc8;return function(_0x4e0b2f){if(_0x4e0b2f){return _0x458480[_0xa55c('0x19')](_0x247e77)[_0xa55c('0x1b')](_0x4e0b2f);}};}function respondWithFilteredResult(_0x25934f,_0x31e10d){return function(_0x1c4cfd){if(_0x1c4cfd){var _0x3ae86b=_0x1c4cfd['count'],_0x51590e=_0x31e10d[_0xa55c('0x1c')],_0x2d09d8=_0x31e10d[_0xa55c('0x1c')]+_0x31e10d[_0xa55c('0x1d')],_0x24783b;if(_0x2d09d8>=_0x3ae86b){_0x2d09d8=_0x3ae86b;_0x24783b=0xc8;}else{_0x24783b=0xce;}_0x25934f[_0xa55c('0x19')](_0x24783b);return _0x25934f[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x51590e+'-'+_0x2d09d8+'/'+_0x3ae86b)['json'](_0x1c4cfd);}return null;};}function patchUpdates(_0x5f5158){return function(_0xd643cc){try{jsonpatch[_0xa55c('0x20')](_0xd643cc,_0x5f5158,!![]);}catch(_0xade4c4){return BPromise['reject'](_0xade4c4);}return _0xd643cc[_0xa55c('0x21')]();};}function saveUpdates(_0x2fcb90,_0x54945a){return function(_0x187a87){if(_0x187a87){return _0x187a87[_0xa55c('0x22')](_0x2fcb90)[_0xa55c('0x23')](function(_0x1965f1){return _0x1965f1;});}return null;};}function removeEntity(_0x234372,_0x49ed04){return function(_0x1fc828){if(_0x1fc828){return _0x1fc828['destroy']()['then'](function(){var _0x59d89a=_0x1fc828[_0xa55c('0x24')]({'plain':!![]});var _0x54b038=_0xa55c('0x25');return db[_0xa55c('0x26')][_0xa55c('0x27')]({'where':{'type':_0x54b038,'resourceId':_0x59d89a['id']}})[_0xa55c('0x23')](function(){return _0x1fc828;});})[_0xa55c('0x23')](function(){_0x234372[_0xa55c('0x19')](0xcc)[_0xa55c('0x1a')]();});}};}function handleEntityNotFound(_0x11e7f7,_0x192df2){return function(_0x3cd152){if(!_0x3cd152){_0x11e7f7[_0xa55c('0x18')](0x194);}return _0x3cd152;};}function handleError(_0x57f271,_0x430d55){_0x430d55=_0x430d55||0x1f4;return function(_0x28814f){logger[_0xa55c('0x28')](_0x28814f[_0xa55c('0x29')]);if(_0x28814f['name']){delete _0x28814f[_0xa55c('0x2a')];}_0x57f271[_0xa55c('0x19')](_0x430d55)[_0xa55c('0x2b')](_0x28814f);};}exports[_0xa55c('0x2c')]=function(_0x45ee8d,_0x3c3cb5){var _0x52d37f={},_0x23e698={},_0x490b7d={'count':0x0,'rows':[]};var _0x35c9c2=db[_0xa55c('0x2d')][_0xa55c('0x2e')];_0x23e698[_0xa55c('0x2f')]=_['keys'](_0x35c9c2);var _0x3d28fb={'dateStart':_0x45ee8d[_0xa55c('0x30')][_0xa55c('0x31')],'dateEnd':_0x45ee8d[_0xa55c('0x30')][_0xa55c('0x32')]};delete _0x45ee8d[_0xa55c('0x30')][_0xa55c('0x31')];delete _0x45ee8d[_0xa55c('0x30')][_0xa55c('0x32')];_0x23e698[_0xa55c('0x30')]=_[_0xa55c('0x33')](_0x45ee8d['query']);_0x23e698['filters']=_[_0xa55c('0x34')](_0x23e698[_0xa55c('0x2f')],_0x23e698['query']);_0x52d37f[_0xa55c('0x35')]=_[_0xa55c('0x34')](_0x23e698[_0xa55c('0x2f')],qs[_0xa55c('0x36')](_0x45ee8d[_0xa55c('0x30')][_0xa55c('0x36')]));_0x52d37f[_0xa55c('0x35')]=_0x52d37f[_0xa55c('0x35')][_0xa55c('0x37')]?_0x52d37f['attributes']:_0x23e698['model'];if(!_0x45ee8d['query'][_0xa55c('0x38')](_0xa55c('0x39'))){_0x52d37f[_0xa55c('0x1d')]=qs['limit'](_0x45ee8d[_0xa55c('0x30')]['limit']);_0x52d37f[_0xa55c('0x1c')]=qs['offset'](_0x45ee8d[_0xa55c('0x30')][_0xa55c('0x1c')]);}_0x52d37f[_0xa55c('0x3a')]=qs['sort'](_0x45ee8d[_0xa55c('0x30')][_0xa55c('0x3b')]);_0x52d37f['where']=qs[_0xa55c('0x3c')](_[_0xa55c('0x3d')](_0x45ee8d['query'],_0x23e698['filters']));if(_0x3d28fb[_0xa55c('0x31')]){if(_0x3d28fb['dateEnd']){_0x3d28fb[_0xa55c('0x32')]=moment(_0x3d28fb[_0xa55c('0x32')])['add'](0x1,'day');}else{_0x3d28fb['dateEnd']=moment(_0x3d28fb['dateStart'])[_0xa55c('0x3e')](0x1,_0xa55c('0x3f'));}_[_0xa55c('0x40')](_0x52d37f[_0xa55c('0x41')],{'createdAt':{'$gte':_0x3d28fb[_0xa55c('0x31')],'$lte':_0x3d28fb['dateEnd']}});}if(_0x45ee8d[_0xa55c('0x30')][_0xa55c('0x42')]){_0x52d37f[_0xa55c('0x41')]=_[_0xa55c('0x40')](_0x52d37f[_0xa55c('0x41')],{'$or':_[_0xa55c('0x43')](_0x35c9c2,function(_0x554620){if(_0x554620[_0xa55c('0x44')]['key']!=='VIRTUAL'){var _0x404e7f={};_0x404e7f[_0x554620[_0xa55c('0x45')]]={'$like':'%'+_0x45ee8d['query'][_0xa55c('0x42')]+'%'};return _0x404e7f;}})});}_0x52d37f=_['merge']({},_0x52d37f,_0x45ee8d['options']);var _0x2f8449={'where':_0x52d37f[_0xa55c('0x41')]};return db[_0xa55c('0x2d')]['count'](_0x2f8449)[_0xa55c('0x23')](function(_0xd5a006){_0x490b7d['count']=_0xd5a006;if(_0x45ee8d[_0xa55c('0x30')]['includeAll']){_0x52d37f[_0xa55c('0x46')]=[{'all':!![]}];}return db[_0xa55c('0x2d')]['findAll'](_0x52d37f);})[_0xa55c('0x23')](function(_0x1dae70){_0x490b7d['rows']=_0x1dae70;return _0x490b7d;})[_0xa55c('0x23')](respondWithFilteredResult(_0x3c3cb5,_0x52d37f))[_0xa55c('0x47')](handleError(_0x3c3cb5,null));};exports[_0xa55c('0x48')]=function(_0x59a6c8,_0x334f52){var _0x582901={'raw':![],'where':{'id':_0x59a6c8[_0xa55c('0x49')]['id']}},_0x2f9717={};_0x2f9717[_0xa55c('0x2f')]=_['keys'](db[_0xa55c('0x2d')][_0xa55c('0x2e')]);_0x2f9717['query']=_[_0xa55c('0x33')](_0x59a6c8[_0xa55c('0x30')]);_0x2f9717['filters']=_[_0xa55c('0x34')](_0x2f9717[_0xa55c('0x2f')],_0x2f9717['query']);_0x582901[_0xa55c('0x35')]=_[_0xa55c('0x34')](_0x2f9717[_0xa55c('0x2f')],qs[_0xa55c('0x36')](_0x59a6c8['query'][_0xa55c('0x36')]));_0x582901['attributes']=_0x582901[_0xa55c('0x35')][_0xa55c('0x37')]?_0x582901[_0xa55c('0x35')]:_0x2f9717['model'];if(_0x59a6c8[_0xa55c('0x30')][_0xa55c('0x4a')]){_0x582901['include']=[{'all':!![]}];}_0x582901=_[_0xa55c('0x40')]({},_0x582901,_0x59a6c8[_0xa55c('0x4b')]);return db[_0xa55c('0x2d')][_0xa55c('0x4c')](_0x582901)[_0xa55c('0x23')](handleEntityNotFound(_0x334f52,null))[_0xa55c('0x23')](respondWithResult(_0x334f52,null))[_0xa55c('0x47')](handleError(_0x334f52,null));};exports[_0xa55c('0x27')]=function(_0x3c147b,_0x3376a1){return db['VoicePrefix'][_0xa55c('0x4c')]({'where':{'id':_0x3c147b[_0xa55c('0x49')]['id']}})[_0xa55c('0x23')](handleEntityNotFound(_0x3376a1,null))['then'](removeEntity(_0x3376a1,null))[_0xa55c('0x47')](handleError(_0x3376a1,null));};exports[_0xa55c('0x4d')]=function(_0x4f5ecd,_0x21b760){return db['VoicePrefix'][_0xa55c('0x4d')]()[_0xa55c('0x23')](respondWithResult(_0x21b760,null))[_0xa55c('0x47')](handleError(_0x21b760,null));};exports[_0xa55c('0x4e')]=function(_0x2ecf79,_0x5b1cf3){var _0x44b7c1;return db[_0xa55c('0x4f')]['transaction'](function(_0x3929a6){return db[_0xa55c('0x2d')][_0xa55c('0x4e')](_0x2ecf79[_0xa55c('0x50')],{'transaction':_0x3929a6})['then'](function(_0x4def35){_0x44b7c1=_0x4def35[_0xa55c('0x24')]({'plain':!![]});return db[_0xa55c('0x51')][_0xa55c('0x4c')]({'where':{'id':_0x44b7c1[_0xa55c('0x52')]},'raw':!![]})['then'](function(_0x30c0c9){return createVoicePrefixExtensions(_0x44b7c1,_0x30c0c9,_0x3929a6);});});})['then'](function(){var _0x2742e4=_0x2ecf79[_0xa55c('0x53')][_0xa55c('0x24')]({'plain':!![]});if(!_0x2742e4)throw new Error(_0xa55c('0x54'));if(_0x2742e4[_0xa55c('0x55')]==='user'){var _0x1cb73b=_0x44b7c1;return db['UserProfileSection'][_0xa55c('0x4c')]({'where':{'name':_0xa55c('0x25'),'userProfileId':_0x2742e4[_0xa55c('0x56')]},'raw':!![]})[_0xa55c('0x23')](function(_0x19aaf5){if(_0x19aaf5&&_0x19aaf5[_0xa55c('0x57')]===0x0){return db[_0xa55c('0x26')]['create']({'name':_0x1cb73b[_0xa55c('0x2a')],'resourceId':_0x1cb73b['id'],'type':_0x19aaf5[_0xa55c('0x2a')],'sectionId':_0x19aaf5['id']},{})[_0xa55c('0x23')](function(){return _0x44b7c1;});}else{return _0x44b7c1;}})[_0xa55c('0x47')](function(_0x3fa00f){logger['error'](_0xa55c('0x58'),_0x3fa00f);throw _0x3fa00f;});}return _0x44b7c1;})[_0xa55c('0x23')](respondWithResult(_0x5b1cf3,null))[_0xa55c('0x47')](handleError(_0x5b1cf3,null));};function Extension(_0x20e53c,_0x3cbb63,_0x493f51,_0xdd92c1){this[_0xa55c('0x59')]=_0xa55c('0x5a');this[_0xa55c('0x5b')]=_0x20e53c;this[_0xa55c('0x5c')]=_0x493f51;this['type']=_0xa55c('0x5d');this['description']=_0xa55c('0x5e');this['priority']=_0x3cbb63;this[_0xa55c('0x5f')]=_0xdd92c1;}function createVoicePrefixExtensions(_0x5a8897,_0x34edc5,_0x1333da){return new BPromise(function(_0x21d6b4,_0x2f811e){var _0x4cb38c=new Extension(formatPrefixName(_0x5a8897[_0xa55c('0x60')]),0x1,_0xa55c('0x61'),_0xa55c('0x62'));_0x4cb38c[_0xa55c('0x63')]=_0x5a8897['id'];return db[_0xa55c('0x51')]['create'](_0x4cb38c,{'transaction':_0x1333da})[_0xa55c('0x23')](function(_0x311bb9){var _0x4ef914=_0x311bb9[_0xa55c('0x24')]({'plain':!![]});var _0x2b8b88=_[_0xa55c('0x43')](addVoicePrefixExtensions(_0x5a8897,_0x34edc5),function(_0x9fe234){_0x9fe234[_0xa55c('0x52')]=_0x4ef914['id'];_0x9fe234[_0xa55c('0x63')]=_0x5a8897['id'];return _0x9fe234;});return db[_0xa55c('0x51')][_0xa55c('0x64')](_0x2b8b88,{'transaction':_0x1333da})['then'](function(_0x1dfaf7){if(!_0x1dfaf7){return _0x2f811e(_0xa55c('0x65'));}else{return _0x21d6b4(_0x1dfaf7);}})[_0xa55c('0x47')](function(_0xd309a9){return _0x2f811e(_0xd309a9);});});;});};function addVoicePrefixExtensions(_0x1a52b9,_0x1bcb40){var _0x2f1237=[];var _0x4249c1=formatPrefixName(_0x1a52b9[_0xa55c('0x60')]);_0x2f1237['push'](new Extension(_0x4249c1,0x2,_0xa55c('0x66'),_0xa55c('0x67')+_0x1a52b9[_0xa55c('0x2a')]));if(_0x1a52b9[_0xa55c('0x68')]){_0x2f1237[_0xa55c('0x69')](new Extension(_0x4249c1,0x3,_0xa55c('0x66'),_0xa55c('0x6a')+_0x1a52b9[_0xa55c('0x68')]));}else{_0x2f1237[_0xa55c('0x69')](new Extension(_0x4249c1,0x3,_0xa55c('0x61'),_0xa55c('0x6b')));}_0x2f1237['push'](new Extension(_0x4249c1,0x4,_0xa55c('0x6c'),_0x1bcb40['context']+','+_0xa55c('0x6d')+(0x8+_0x1a52b9[_0xa55c('0x2a')][_0xa55c('0x37')])+'}'+','+0x1));return _0x2f1237;}function formatPrefixName(_0x4f2a7b){var _0x4d9722='_';for(var _0x2640a1=0x0;_0x2640a1<_0x4f2a7b[_0xa55c('0x37')];_0x2640a1++){if(_0x4f2a7b[_0xa55c('0x6e')](_0x2640a1)=='-'){_0x4d9722+=_0x4f2a7b[_0xa55c('0x6e')](_0x2640a1);}else{_0x4d9722+='['+_0x4f2a7b['charAt'](_0x2640a1)+']';}}_0x4d9722+='.';return _0x4d9722;}exports[_0xa55c('0x22')]=function(_0xd02251,_0x8ea1c6,_0x3a9910){var _0x21fc9b=_0xd02251['body'];_0x21fc9b['prefix']=_0xa55c('0x6f')+_0x21fc9b[_0xa55c('0x2a')]+'-';return db[_0xa55c('0x4f')][_0xa55c('0x70')](function(_0x1af9d5){return db['VoicePrefix'][_0xa55c('0x22')](_0x21fc9b,{'where':{'id':_0x21fc9b['id']},'transaction':_0x1af9d5})[_0xa55c('0x23')](function(){return db['VoiceExtension'][_0xa55c('0x27')]({'where':{'VoicePrefixId':_0x21fc9b['id']},'transaction':_0x1af9d5})[_0xa55c('0x23')](function(){return db[_0xa55c('0x51')]['find']({'where':{'id':_0x21fc9b[_0xa55c('0x52')]},'raw':!![]})[_0xa55c('0x23')](function(_0xdf94b3){return createVoicePrefixExtensions(_0x21fc9b,_0xdf94b3,_0x1af9d5);});});});})[_0xa55c('0x23')](function(){return db[_0xa55c('0x2d')]['findById'](_0x21fc9b['id']);})[_0xa55c('0x23')](respondWithResult(_0x8ea1c6,null))[_0xa55c('0x47')](handleError(_0x8ea1c6,null));};exports['addAgents']=function(_0x550dc1,_0x194ddc,_0x4e1cbd){return db[_0xa55c('0x2d')][_0xa55c('0x4c')]({'where':{'id':_0x550dc1[_0xa55c('0x49')]['id']}})[_0xa55c('0x23')](handleEntityNotFound(_0x194ddc,null))[_0xa55c('0x23')](function(_0x3f1132){if(_0x3f1132){return _0x3f1132[_0xa55c('0x71')](_0x550dc1[_0xa55c('0x50')][_0xa55c('0x72')],_['omit'](_0x550dc1[_0xa55c('0x50')],[_0xa55c('0x72'),'id'])||{})[_0xa55c('0x73')](function(_0x20ddd0){for(var _0x4f0a26=0x0;_0x4f0a26<_0x550dc1[_0xa55c('0x50')][_0xa55c('0x72')][_0xa55c('0x37')];_0x4f0a26+=0x1){socket[_0xa55c('0x74')]('userVoicePrefix:save',{'UserId':_0x550dc1['body'][_0xa55c('0x72')][_0x4f0a26],'VoicePrefixId':_0x550dc1[_0xa55c('0x49')]['id']});}return _0x20ddd0;});}})[_0xa55c('0x23')](respondWithResult(_0x194ddc,null))[_0xa55c('0x47')](handleError(_0x194ddc,null));};exports['removeAgents']=function(_0x55ee0d,_0x40663,_0x3b2a5c){var _0xd33c9c;return db[_0xa55c('0x2d')][_0xa55c('0x4c')]({'where':{'id':_0x55ee0d[_0xa55c('0x49')]['id']}})[_0xa55c('0x23')](handleEntityNotFound(_0x40663,null))['then'](function(_0x19497b){if(_0x19497b){return _0x19497b['removeAgents'](_0x55ee0d[_0xa55c('0x30')]['ids'])[_0xa55c('0x23')](function(_0x313cdc){if(_[_0xa55c('0x75')](_0x55ee0d[_0xa55c('0x30')][_0xa55c('0x72')])){for(var _0x402f02=0x0;_0x402f02<_0x55ee0d[_0xa55c('0x30')][_0xa55c('0x72')]['length'];_0x402f02+=0x1){socket['emit'](_0xa55c('0x76'),{'UserId':_0x55ee0d[_0xa55c('0x30')][_0xa55c('0x72')][_0x402f02],'VoicePrefixId':_0x55ee0d[_0xa55c('0x49')]['id']});}}else{socket[_0xa55c('0x74')](_0xa55c('0x76'),{'UserId':_0x55ee0d['query'][_0xa55c('0x72')],'VoicePrefixId':_0x55ee0d[_0xa55c('0x49')]['id']});}});}})[_0xa55c('0x23')](respondWithStatusCode(_0x40663,null))[_0xa55c('0x47')](handleError(_0x40663,null));};exports[_0xa55c('0x77')]=function(_0x3b1cd7,_0xeb45b0,_0x27ce81){var _0x58b670={};var _0x25d09d={};var _0xb29c7c;var _0x42d773;return db[_0xa55c('0x2d')][_0xa55c('0x78')]({'where':{'id':_0x3b1cd7['params']['id']}})[_0xa55c('0x23')](handleEntityNotFound(_0xeb45b0,null))[_0xa55c('0x23')](function(_0x58296a){if(_0x58296a){_0xb29c7c=_0x58296a;_0x25d09d['model']=_[_0xa55c('0x33')](db[_0xa55c('0x79')]['rawAttributes']);_0x25d09d['query']=_['keys'](_0x3b1cd7['query']);_0x25d09d[_0xa55c('0x3c')]=_[_0xa55c('0x34')](_0x25d09d[_0xa55c('0x2f')],_0x25d09d[_0xa55c('0x30')]);_0x58b670[_0xa55c('0x35')]=_[_0xa55c('0x34')](_0x25d09d['model'],qs[_0xa55c('0x36')](_0x3b1cd7[_0xa55c('0x30')][_0xa55c('0x36')]));_0x58b670[_0xa55c('0x35')]=_0x58b670['attributes'][_0xa55c('0x37')]?_0x58b670[_0xa55c('0x35')]:_0x25d09d[_0xa55c('0x2f')];_0x58b670['order']=qs[_0xa55c('0x3b')](_0x3b1cd7['query']['sort']);_0x58b670[_0xa55c('0x41')]=qs[_0xa55c('0x3c')](_[_0xa55c('0x3d')](_0x3b1cd7[_0xa55c('0x30')],_0x25d09d[_0xa55c('0x3c')]));if(_0x3b1cd7[_0xa55c('0x30')][_0xa55c('0x42')]){_0x58b670['where']=_['merge'](_0x58b670[_0xa55c('0x41')],{'$or':_[_0xa55c('0x43')](_0x58b670[_0xa55c('0x35')],function(_0x1f4bc8){var _0x195c86={};_0x195c86[_0x1f4bc8]={'$like':'%'+_0x3b1cd7[_0xa55c('0x30')][_0xa55c('0x42')]+'%'};return _0x195c86;})});}_0x58b670=_[_0xa55c('0x40')]({},_0x58b670,_0x3b1cd7[_0xa55c('0x4b')]);return _0xb29c7c[_0xa55c('0x77')](_0x58b670);}})['then'](function(_0xc9c3fa){if(_0xc9c3fa){_0x42d773=_0xc9c3fa[_0xa55c('0x37')];if(!_0x3b1cd7['query'][_0xa55c('0x38')]('nolimit')){_0x58b670[_0xa55c('0x1d')]=qs[_0xa55c('0x1d')](_0x3b1cd7[_0xa55c('0x30')][_0xa55c('0x1d')]);_0x58b670[_0xa55c('0x1c')]=qs['offset'](_0x3b1cd7[_0xa55c('0x30')][_0xa55c('0x1c')]);}return _0xb29c7c[_0xa55c('0x77')](_0x58b670);}})[_0xa55c('0x23')](function(_0x3300a9){if(_0x3300a9){return _0x3300a9?{'count':_0x42d773,'rows':_0x3300a9}:null;}})[_0xa55c('0x23')](respondWithResult(_0xeb45b0,null))[_0xa55c('0x47')](handleError(_0xeb45b0,null));};
\ No newline at end of file
index 1dcee6b..9cf3eca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x34e8,0x12c));var _0x834e=function(_0x1a18b9,_0x458d2b){_0x1a18b9=_0x1a18b9-0x0;var _0x15ec30=_0x34e8[_0x1a18b9];return _0x15ec30;};'use strict';var EventEmitter=require(_0x834e('0x0'));var VoicePrefix=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){VoicePrefixEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);VoicePrefixEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x5292=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x3100f0,_0x28deea){var _0x747711=function(_0x496c0a){while(--_0x496c0a){_0x3100f0['push'](_0x3100f0['shift']());}};_0x747711(++_0x28deea);}(_0x5292,0xf7));var _0x2529=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x5292[_0x3203a1];return _0x24215e;};'use strict';var EventEmitter=require(_0x2529('0x0'));var VoicePrefix=require(_0x2529('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2529('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2529('0x3'),'afterDestroy':_0x2529('0x4')};function emitEvent(_0x29576c){return function(_0x228165,_0x5d25dc,_0x28c08d){VoicePrefixEvents['emit'](_0x29576c+':'+_0x228165['id'],_0x228165);VoicePrefixEvents['emit'](_0x29576c,_0x228165);_0x28c08d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x2529('0x5')](e,emitEvent(event));}}module[_0x2529('0x6')]=VoicePrefixEvents;
\ No newline at end of file
index d6049c9..995aa94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4f5=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','bluebird','request-promise'];(function(_0x37eca7,_0x3e016e){var _0x222bce=function(_0xebd0b7){while(--_0xebd0b7){_0x37eca7['push'](_0x37eca7['shift']());}};_0x222bce(++_0x3e016e);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x455e00,_0x29577f){_0x455e00=_0x455e00-0x0;var _0x568400=_0xc4f5[_0x455e00];return _0x568400;};'use strict';var _=require('lodash');var util=require(_0x5c4f('0x0'));var logger=require(_0x5c4f('0x1'))(_0x5c4f('0x2'));var moment=require('moment');var BPromise=require(_0x5c4f('0x3'));var rp=require(_0x5c4f('0x4'));var attributes=require(_0x5c4f('0x5'));module[_0x5c4f('0x6')]=function(_0x2676f7,_0x56e601){return _0x2676f7[_0x5c4f('0x7')](_0x5c4f('0x8'),attributes,{'tableName':_0x5c4f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeedb=['request-promise','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','moment','bluebird'];(function(_0x458daf,_0x1fd7c7){var _0x42d2cd=function(_0x30eb46){while(--_0x30eb46){_0x458daf['push'](_0x458daf['shift']());}};_0x42d2cd(++_0x1fd7c7);}(_0xeedb,0x159));var _0xbeed=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xeedb[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xbeed('0x0'));var util=require('util');var logger=require(_0xbeed('0x1'))(_0xbeed('0x2'));var moment=require(_0xbeed('0x3'));var BPromise=require(_0xbeed('0x4'));var rp=require(_0xbeed('0x5'));var attributes=require(_0xbeed('0x6'));module['exports']=function(_0x6eaa85,_0x18f1ee){return _0x6eaa85[_0xbeed('0x7')](_0xbeed('0x8'),attributes,{'tableName':_0xbeed('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ab8431a..ef9b4c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30fd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x17a8c6,_0x437670){var _0x1c5d39=function(_0x4c3df8){while(--_0x4c3df8){_0x17a8c6['push'](_0x17a8c6['shift']());}};_0x1c5d39(++_0x437670);}(_0x30fd,0x102));var _0xd30f=function(_0x347ffb,_0x156d2b){_0x347ffb=_0x347ffb-0x0;var _0x330474=_0x30fd[_0x347ffb];return _0x330474;};'use strict';var _=require(_0xd30f('0x0'));var util=require(_0xd30f('0x1'));var moment=require('moment');var BPromise=require(_0xd30f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd30f('0x3'));var db=require(_0xd30f('0x4'))['db'];var utils=require(_0xd30f('0x5'));var logger=require(_0xd30f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd30f('0x7'));var client=jayson[_0xd30f('0x8')][_0xd30f('0x9')]({'port':0x232a});config[_0xd30f('0xa')]=_[_0xd30f('0xb')](config[_0xd30f('0xa')],{'host':_0xd30f('0xc'),'port':0x18eb});var socket=require(_0xd30f('0xd'))(new Redis(config[_0xd30f('0xa')]));require(_0xd30f('0xe'))[_0xd30f('0xf')](socket);function respondWithRpcPromise(_0x9b4c9f,_0x332b89,_0x582e92){return new BPromise(function(_0x39d90d,_0x1a9090){return client[_0xd30f('0x10')](_0x9b4c9f,_0x582e92)[_0xd30f('0x11')](function(_0x573222){logger[_0xd30f('0x12')](_0xd30f('0x13'),_0x332b89,_0xd30f('0x14'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x332b89,'request\x20sent',JSON[_0xd30f('0x15')](_0x573222));if(_0x573222[_0xd30f('0x16')]){if(_0x573222[_0xd30f('0x16')][_0xd30f('0x17')]===0x1f4){logger[_0xd30f('0x16')](_0xd30f('0x13'),_0x332b89,_0x573222[_0xd30f('0x16')][_0xd30f('0x18')]);return _0x1a9090(_0x573222[_0xd30f('0x16')][_0xd30f('0x18')]);}logger[_0xd30f('0x16')](_0xd30f('0x13'),_0x332b89,_0x573222[_0xd30f('0x16')]['message']);return _0x39d90d(_0x573222[_0xd30f('0x16')][_0xd30f('0x18')]);}else{logger[_0xd30f('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x332b89,_0xd30f('0x14'));_0x39d90d(_0x573222[_0xd30f('0x19')][_0xd30f('0x18')]);}})['catch'](function(_0x3452b8){logger[_0xd30f('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x332b89,_0x3452b8);_0x1a9090(_0x3452b8);});});}
\ No newline at end of file
+var _0x9696=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x396d22,_0x51d62b){var _0x2a8274=function(_0x4ddf9c){while(--_0x4ddf9c){_0x396d22['push'](_0x396d22['shift']());}};_0x2a8274(++_0x51d62b);}(_0x9696,0xc8));var _0x6969=function(_0x490725,_0xa2fff9){_0x490725=_0x490725-0x0;var _0x5edb31=_0x9696[_0x490725];return _0x5edb31;};'use strict';var _=require(_0x6969('0x0'));var util=require(_0x6969('0x1'));var moment=require('moment');var BPromise=require(_0x6969('0x2'));var rs=require(_0x6969('0x3'));var fs=require('fs');var Redis=require(_0x6969('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6969('0x5'));var logger=require(_0x6969('0x6'))(_0x6969('0x7'));var config=require(_0x6969('0x8'));var jayson=require(_0x6969('0x9'));var client=jayson[_0x6969('0xa')][_0x6969('0xb')]({'port':0x232a});config[_0x6969('0xc')]=_[_0x6969('0xd')](config[_0x6969('0xc')],{'host':_0x6969('0xe'),'port':0x18eb});var socket=require(_0x6969('0xf'))(new Redis(config['redis']));require(_0x6969('0x10'))['register'](socket);function respondWithRpcPromise(_0x14645f,_0x1b3513,_0x2b4291){return new BPromise(function(_0x4ebeef,_0x518e5d){return client['request'](_0x14645f,_0x2b4291)['then'](function(_0x4ba349){logger[_0x6969('0x11')](_0x6969('0x12'),_0x1b3513,_0x6969('0x13'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1b3513,_0x6969('0x13'),JSON[_0x6969('0x14')](_0x4ba349));if(_0x4ba349[_0x6969('0x15')]){if(_0x4ba349[_0x6969('0x15')]['code']===0x1f4){logger[_0x6969('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x1b3513,_0x4ba349[_0x6969('0x15')][_0x6969('0x16')]);return _0x518e5d(_0x4ba349[_0x6969('0x15')][_0x6969('0x16')]);}logger[_0x6969('0x15')](_0x6969('0x12'),_0x1b3513,_0x4ba349[_0x6969('0x15')][_0x6969('0x16')]);return _0x4ebeef(_0x4ba349[_0x6969('0x15')][_0x6969('0x16')]);}else{logger['info'](_0x6969('0x12'),_0x1b3513,_0x6969('0x13'));_0x4ebeef(_0x4ba349[_0x6969('0x17')][_0x6969('0x16')]);}})[_0x6969('0x18')](function(_0x2f967a){logger[_0x6969('0x15')](_0x6969('0x12'),_0x1b3513,_0x2f967a);_0x518e5d(_0x2f967a);});});}
\ No newline at end of file
index 86c6b54..edf19c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa506=['remove','emit','removeListener','register','voicePrefix:','./voicePrefix.events'];(function(_0x2b3087,_0x5bad3a){var _0x39bb6a=function(_0x51f8d4){while(--_0x51f8d4){_0x2b3087['push'](_0x2b3087['shift']());}};_0x39bb6a(++_0x5bad3a);}(_0xa506,0x125));var _0x6a50=function(_0x489a3d,_0x294419){_0x489a3d=_0x489a3d-0x0;var _0x1f5b2e=_0xa506[_0x489a3d];return _0x1f5b2e;};'use strict';var VoicePrefixEvents=require(_0x6a50('0x0'));var events=['save',_0x6a50('0x1'),'update'];function createListener(_0x4ae6ef,_0x597d85){return function(_0x18fb87){_0x597d85[_0x6a50('0x2')](_0x4ae6ef,_0x18fb87);};}function removeListener(_0x22dd49,_0x5dc529){return function(){VoicePrefixEvents[_0x6a50('0x3')](_0x22dd49,_0x5dc529);};}exports[_0x6a50('0x4')]=function(_0x23eb79){for(var _0x4f723a=0x0,_0x4f1eae=events['length'];_0x4f723a<_0x4f1eae;_0x4f723a++){var _0x22ff09=events[_0x4f723a];var _0x2a3d0e=createListener(_0x6a50('0x5')+_0x22ff09,_0x23eb79);VoicePrefixEvents['on'](_0x22ff09,_0x2a3d0e);}};
\ No newline at end of file
+var _0x6819=['remove','emit','removeListener','length'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6819,0x134));var _0x9681=function(_0x76ef30,_0x5a9c20){_0x76ef30=_0x76ef30-0x0;var _0x58d4a2=_0x6819[_0x76ef30];return _0x58d4a2;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x9681('0x0'),'update'];function createListener(_0x17c53c,_0x4d6a32){return function(_0x4a19a0){_0x4d6a32[_0x9681('0x1')](_0x17c53c,_0x4a19a0);};}function removeListener(_0x491989,_0x36c0ba){return function(){VoicePrefixEvents[_0x9681('0x2')](_0x491989,_0x36c0ba);};}exports['register']=function(_0x317e36){for(var _0x8aaeb9=0x0,_0x1dd1bb=events[_0x9681('0x3')];_0x8aaeb9<_0x1dd1bb;_0x8aaeb9++){var _0x111980=events[_0x8aaeb9];var _0x35bffd=createListener('voicePrefix:'+_0x111980,_0x317e36);VoicePrefixEvents['on'](_0x111980,_0x35bffd);}};
\ No newline at end of file
index a59a88a..e7bc539 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['removeTeams','removeBlackLists','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addTeams','addAgents','addBlackLists','put','update','delete','destroy'];(function(_0x393659,_0x2f34c4){var _0x191210=function(_0x2f1f82){while(--_0x2f1f82){_0x393659['push'](_0x393659['shift']());}};_0x191210(++_0x2f34c4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x7')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router['get'](_0x0a9e('0x11'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x7')](_0x0a9e('0x13'),auth[_0x0a9e('0x8')](),controller['getMembers']);router[_0x0a9e('0x7')]('/:id/lists',auth[_0x0a9e('0x8')](),controller['getLists']);router[_0x0a9e('0x7')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x16')]);router[_0x0a9e('0x17')](_0x0a9e('0x18'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x17')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x17')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x17')]('/:id/lists',auth[_0x0a9e('0x8')](),controller['addLists']);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x1d')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x1e')]);router[_0x0a9e('0x1f')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x1f')]('/:id/teams',auth['isAuthenticated'](),controller[_0x0a9e('0x21')]);router[_0x0a9e('0x1f')](_0x0a9e('0x11'),auth[_0x0a9e('0x8')](),controller['removeAgents']);router[_0x0a9e('0x1f')]('/:id/lists',auth[_0x0a9e('0x8')](),controller['removeLists']);router[_0x0a9e('0x1f')](_0x0a9e('0x14'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x22')]);module[_0x0a9e('0x23')]=router;
\ No newline at end of file
+var _0xb10b=['/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/users','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated'];(function(_0x9c00e3,_0xb89cfe){var _0x2e8e77=function(_0x4ab069){while(--_0x4ab069){_0x9c00e3['push'](_0x9c00e3['shift']());}};_0x2e8e77(++_0xb89cfe);}(_0xb10b,0x12a));var _0xbb10=function(_0x47c39d,_0x3eea90){_0x47c39d=_0x47c39d-0x0;var _0xd41416=_0xb10b[_0x47c39d];return _0xd41416;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getHopperHistories']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x8')](_0xbb10('0x13'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x8')]('/:id/users',auth[_0xbb10('0x9')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x8')](_0xbb10('0x16'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x8')](_0xbb10('0x18'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x19')]);router['get'](_0xbb10('0x1a'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x1c')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1d')]);router[_0xbb10('0x1c')](_0xbb10('0x1e'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1f')]);router['post'](_0xbb10('0x13'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1c')](_0xbb10('0x21'),auth[_0xbb10('0x9')](),controller['addAgents']);router[_0xbb10('0x1c')](_0xbb10('0x18'),auth['isAuthenticated'](),controller['addLists']);router[_0xbb10('0x1c')](_0xbb10('0x1a'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x22')]);router[_0xbb10('0x23')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x26')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x21'),auth['isAuthenticated'](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x29')]);router[_0xbb10('0x25')](_0xbb10('0x1a'),auth['isAuthenticated'](),controller[_0xbb10('0x2a')]);module[_0xbb10('0x2b')]=router;
\ No newline at end of file
index 246cef0..167186f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','ENUM','inbound','default','leastrecent','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod'];(function(_0x17598a,_0x522cc6){var _0x4cd046=function(_0x496f1a){while(--_0x496f1a){_0x17598a['push'](_0x17598a['shift']());}};_0x4cd046(++_0x522cc6);}(_0x7a54,0x106));var _0x47a5=function(_0x3d1df5,_0x5bbbfb){_0x3d1df5=_0x3d1df5-0x0;var _0xeaa2f1=_0x7a54[_0x3d1df5];return _0xeaa2f1;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x47a5('0x4')},'musiconhold':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x5')},'announce':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x47a5('0x3')]('rr','ringall',_0x47a5('0x6'),'fewestcalls',_0x47a5('0x7'),_0x47a5('0x8'),'linear',_0x47a5('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x582352){this[_0x47a5('0xa')](_0x47a5('0xb'),_0x582352?_0x582352:'rrmemory');},'get':function(){var _0x2eb0dd=this['getDataValue']('type');var _0x1f47f4=this[_0x47a5('0xc')](_0x47a5('0xd'));var _0x250fad=this[_0x47a5('0xc')](_0x47a5('0xb'));if(_0x2eb0dd===_0x47a5('0x4')){return _0x250fad;}if(_0x1f47f4==='booked'&&_0x250fad===_0x47a5('0x8')||_0x1f47f4===_0x47a5('0xe')&&_0x250fad===_0x47a5('0xf')){return _0x250fad;}if(_0x1f47f4===_0x47a5('0x10')||_0x1f47f4===_0x47a5('0x11')||_0x1f47f4===_0x47a5('0x12')){return _0x250fad;}return null;}},'servicelevel':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x47a5('0x2')]},'weight':{'type':Sequelize[_0x47a5('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x47a5('0x14')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x47a5('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x47a5('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x47a5('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x47a5('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no',_0x47a5('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x47a5('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x47a5('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x47a5('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x47a5('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x47a5('0x2')]},'queue_quantity1':{'type':Sequelize[_0x47a5('0x2')]},'queue_quantity2':{'type':Sequelize[_0x47a5('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x47a5('0x2')]},'queue_less_than':{'type':Sequelize[_0x47a5('0x2')]},'periodic_announce':{'type':Sequelize[_0x47a5('0x17')],'set':function(_0x528582){this[_0x47a5('0xa')]('periodic_announce',_0x528582?_0x528582[_0x47a5('0x18')](','):[]);},'get':function(){return this[_0x47a5('0xc')](_0x47a5('0x19'))?this['getDataValue'](_0x47a5('0x19'))[_0x47a5('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x14'),'set':function(_0x51cc81){this['setDataValue'](_0x47a5('0x1b'),_0x51cc81?_0x51cc81[_0x47a5('0x18')](','):[]);},'get':function(){return this['getDataValue']('joinempty')?this[_0x47a5('0xc')](_0x47a5('0x1b'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'no','set':function(_0x53119b){this[_0x47a5('0xa')](_0x47a5('0x1c'),_0x53119b?_0x53119b['join'](','):[]);},'get':function(){return this['getDataValue'](_0x47a5('0x1c'))?this['getDataValue'](_0x47a5('0x1c'))[_0x47a5('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x47a5('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':0x0,'set':function(_0x3534cb){this[_0x47a5('0xa')](_0x47a5('0x1e'),_0x3534cb);if(_0x3534cb){if(this[_0x47a5('0xc')](_0x47a5('0x1f'))<0x2){this[_0x47a5('0xa')](_0x47a5('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x47a5('0x20')},'dialMethod':{'type':Sequelize[_0x47a5('0x3')]('preview',_0x47a5('0x10'),_0x47a5('0x12'),_0x47a5('0x11'),'booked'),'defaultValue':_0x47a5('0x10'),'comment':_0x47a5('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x47a5('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x47a5('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x47a5('0x24')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x47a5('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x26'),_0x47a5('0x27')),'defaultValue':_0x47a5('0x27'),'comment':_0x47a5('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x47a5('0x24')](0x2)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x47a5('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x47a5('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x47a5('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47a5('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'tTxX','comment':_0x47a5('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x47a5('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47a5('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0x3,'comment':_0x47a5('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)[_0x47a5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x47a5('0x33')},'dialTimezone':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x34')},'dialPrefix':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x35'),'never',_0x47a5('0x36')),'defaultValue':_0x47a5('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x47a5('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x47a5('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47a5('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x47a5('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x47a5('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x47a5('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x47a5('0x13')](0x5)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x47a5('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x47a5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47a5('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x47a5('0x3f')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x47a5('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x41'),_0x47a5('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x47a5('0x2')],'comment':_0x47a5('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x47a5('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x47a5('0x44')}};
\ No newline at end of file
+var _0x7a54=['booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','ENUM','inbound','default','leastrecent','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod'];(function(_0x1017c3,_0x7127ba){var _0x335335=function(_0x26a87e){while(--_0x26a87e){_0x1017c3['push'](_0x1017c3['shift']());}};_0x335335(++_0x7127ba);}(_0x7a54,0x106));var _0x47a5=function(_0x1d2771,_0x161ad3){_0x1d2771=_0x1d2771-0x0;var _0x39b226=_0x7a54[_0x1d2771];return _0x39b226;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x47a5('0x4')},'musiconhold':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x5')},'announce':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x47a5('0x3')]('rr','ringall',_0x47a5('0x6'),'fewestcalls',_0x47a5('0x7'),_0x47a5('0x8'),'linear',_0x47a5('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x582352){this[_0x47a5('0xa')](_0x47a5('0xb'),_0x582352?_0x582352:'rrmemory');},'get':function(){var _0x2eb0dd=this['getDataValue']('type');var _0x1f47f4=this[_0x47a5('0xc')](_0x47a5('0xd'));var _0x250fad=this[_0x47a5('0xc')](_0x47a5('0xb'));if(_0x2eb0dd===_0x47a5('0x4')){return _0x250fad;}if(_0x1f47f4==='booked'&&_0x250fad===_0x47a5('0x8')||_0x1f47f4===_0x47a5('0xe')&&_0x250fad===_0x47a5('0xf')){return _0x250fad;}if(_0x1f47f4===_0x47a5('0x10')||_0x1f47f4===_0x47a5('0x11')||_0x1f47f4===_0x47a5('0x12')){return _0x250fad;}return null;}},'servicelevel':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x47a5('0x2')]},'weight':{'type':Sequelize[_0x47a5('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x47a5('0x14')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x47a5('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x47a5('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x47a5('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x47a5('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x14'),'no',_0x47a5('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x47a5('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x47a5('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x47a5('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x47a5('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x47a5('0x2')]},'queue_quantity1':{'type':Sequelize[_0x47a5('0x2')]},'queue_quantity2':{'type':Sequelize[_0x47a5('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x47a5('0x2')]},'queue_less_than':{'type':Sequelize[_0x47a5('0x2')]},'periodic_announce':{'type':Sequelize[_0x47a5('0x17')],'set':function(_0x528582){this[_0x47a5('0xa')]('periodic_announce',_0x528582?_0x528582[_0x47a5('0x18')](','):[]);},'get':function(){return this[_0x47a5('0xc')](_0x47a5('0x19'))?this['getDataValue'](_0x47a5('0x19'))[_0x47a5('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x14'),'set':function(_0x51cc81){this['setDataValue'](_0x47a5('0x1b'),_0x51cc81?_0x51cc81[_0x47a5('0x18')](','):[]);},'get':function(){return this['getDataValue']('joinempty')?this[_0x47a5('0xc')](_0x47a5('0x1b'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'no','set':function(_0x53119b){this[_0x47a5('0xa')](_0x47a5('0x1c'),_0x53119b?_0x53119b['join'](','):[]);},'get':function(){return this['getDataValue'](_0x47a5('0x1c'))?this['getDataValue'](_0x47a5('0x1c'))[_0x47a5('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x47a5('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x47a5('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':0x0,'set':function(_0x3534cb){this[_0x47a5('0xa')](_0x47a5('0x1e'),_0x3534cb);if(_0x3534cb){if(this[_0x47a5('0xc')](_0x47a5('0x1f'))<0x2){this[_0x47a5('0xa')](_0x47a5('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x47a5('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x47a5('0x20')},'dialMethod':{'type':Sequelize[_0x47a5('0x3')]('preview',_0x47a5('0x10'),_0x47a5('0x12'),_0x47a5('0x11'),'booked'),'defaultValue':_0x47a5('0x10'),'comment':_0x47a5('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x47a5('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x47a5('0x23')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x47a5('0x24')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x47a5('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x26'),_0x47a5('0x27')),'defaultValue':_0x47a5('0x27'),'comment':_0x47a5('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x47a5('0x24')](0x2)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x47a5('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x47a5('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x47a5('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47a5('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':'tTxX','comment':_0x47a5('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x47a5('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x47a5('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'defaultValue':0x3,'comment':_0x47a5('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x47a5('0x13')](0x5)[_0x47a5('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x47a5('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x47a5('0x33')},'dialTimezone':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':_0x47a5('0x34')},'dialPrefix':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x35'),'never',_0x47a5('0x36')),'defaultValue':_0x47a5('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x47a5('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x47a5('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x47a5('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47a5('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x47a5('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x47a5('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x47a5('0x13')](0x9)[_0x47a5('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x47a5('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x47a5('0x13')](0x5)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x47a5('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x47a5('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x47a5('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x47a5('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x47a5('0x3f')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x47a5('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0x47a5('0x3')](_0x47a5('0x41'),_0x47a5('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x47a5('0x2')],'comment':_0x47a5('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x47a5('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x47a5('0x13')](0x3)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x47a5('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x47a5('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x47a5('0x44')}};
\ No newline at end of file
index 93a3904..c88a269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58de=['realtime','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','CmListId','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','all','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','json','count','offset','status','Content-Range','apply','reject','save','then','destroy','VoiceQueues','inbound','outbound','filter','map','value','includes','find','type','error','stack','name','send','index','VoiceQueue','rawAttributes','model','keys','dateStart','query','dateEnd','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','add','day','merge','key','options','include','findAll','show','params','includeAll','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','UserProfileSection','autoAssociation','update','getHoppers','findOne','VoiceQueueId','CmHopper','rows','getHopperHistories','nolimit','CmHopperHistory','CmHopperFinal','CmHopperBlack','Team','getTeams','addTeams','ids','Agents','union','removeTeams','User','removeAgents','addAgents','omit','spread','emit','userVoiceQueue:save','loginInPause','UserVoiceQueueRt','upsert','interface','format','SIP/%s','penalty','userVoiceQueue:remove'];(function(_0x56273c,_0x574e50){var _0x974fc3=function(_0x4b607d){while(--_0x4b607d){_0x56273c['push'](_0x56273c['shift']());}};_0x974fc3(++_0x574e50);}(_0x58de,0x171));var _0xe58d=function(_0x1353aa,_0x2402bd){_0x1353aa=_0x1353aa-0x0;var _0x1c94bc=_0x58de[_0x1353aa];return _0x1c94bc;};'use strict';var pdf=require(_0xe58d('0x0'));var emlformat=require(_0xe58d('0x1'));var rimraf=require(_0xe58d('0x2'));var zipdir=require(_0xe58d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe58d('0x4'));var moment=require(_0xe58d('0x5'));var BPromise=require(_0xe58d('0x6'));var Mustache=require(_0xe58d('0x7'));var util=require(_0xe58d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xe58d('0x9'));var ejs=require(_0xe58d('0xa'));var fs=require('fs');var _=require(_0xe58d('0xb'));var squel=require(_0xe58d('0xc'));var crypto=require(_0xe58d('0xd'));var jsforce=require(_0xe58d('0xe'));var deskjs=require(_0xe58d('0xf'));var toCsv=require(_0xe58d('0x9'));var querystring=require(_0xe58d('0x10'));var Papa=require('papaparse');var Redis=require(_0xe58d('0x11'));var qs=require(_0xe58d('0x12'));var logger=require(_0xe58d('0x13'))(_0xe58d('0x14'));var utils=require(_0xe58d('0x15'));var config=require('../../config/environment');var db=require(_0xe58d('0x16'))['db'];config[_0xe58d('0x17')]=_[_0xe58d('0x18')](config[_0xe58d('0x17')],{'host':_0xe58d('0x19'),'port':0x18eb});var socket=require(_0xe58d('0x1a'))(new Redis(config[_0xe58d('0x17')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x168acf,_0x11d836){_0x11d836=_0x11d836||0xcc;return function(_0x217f17){if(_0x217f17){return _0x168acf[_0xe58d('0x1b')](_0x11d836);}return _0x168acf['status'](_0x11d836)[_0xe58d('0x1c')]();};}function respondWithResult(_0x250e42,_0x148244){_0x148244=_0x148244||0xc8;return function(_0x1af2a8){if(_0x1af2a8){return _0x250e42['status'](_0x148244)[_0xe58d('0x1d')](_0x1af2a8);}};}function respondWithFilteredResult(_0x439c41,_0x3e24a8){return function(_0x4e7680){if(_0x4e7680){var _0x340d1a=_0x4e7680[_0xe58d('0x1e')],_0x160a29=_0x3e24a8['offset'],_0x33d4d8=_0x3e24a8[_0xe58d('0x1f')]+_0x3e24a8['limit'],_0x1b5bb5;if(_0x33d4d8>=_0x340d1a){_0x33d4d8=_0x340d1a;_0x1b5bb5=0xc8;}else{_0x1b5bb5=0xce;}_0x439c41[_0xe58d('0x20')](_0x1b5bb5);return _0x439c41['set'](_0xe58d('0x21'),_0x160a29+'-'+_0x33d4d8+'/'+_0x340d1a)['json'](_0x4e7680);}return null;};}function patchUpdates(_0x5770b9){return function(_0x7e8069){try{jsonpatch[_0xe58d('0x22')](_0x7e8069,_0x5770b9,!![]);}catch(_0x10f66f){return BPromise[_0xe58d('0x23')](_0x10f66f);}return _0x7e8069[_0xe58d('0x24')]();};}function saveUpdates(_0x4b2d93,_0x1620f9){return function(_0x55ba8a){if(_0x55ba8a){return _0x55ba8a['update'](_0x4b2d93)[_0xe58d('0x25')](function(_0x320821){return _0x320821;});}return null;};}function removeEntity(_0x3cc373,_0x41a631){return function(_0x5dbd1a){if(_0x5dbd1a){return _0x5dbd1a[_0xe58d('0x26')]()['then'](function(){var _0x32056e=_0x5dbd1a['get']({'plain':!![]});var _0x2bc99d=[{'name':_0xe58d('0x27'),'value':_0xe58d('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xe58d('0x29'),'ignore':![]}];var _0x50fac3=_(_0x2bc99d)[_0xe58d('0x2a')]('ignore')[_0xe58d('0x2b')](_0xe58d('0x2c'))[_0xe58d('0x2c')]();if(_[_0xe58d('0x2d')](_0x50fac3,_0x32056e['type'])){return;}var _0x352d6a=_[_0xe58d('0x2e')](_0x2bc99d,[_0xe58d('0x2c'),_0x32056e[_0xe58d('0x2f')]])['name'];return db['UserProfileResource'][_0xe58d('0x26')]({'where':{'type':_0x352d6a,'resourceId':_0x32056e['id']}})[_0xe58d('0x25')](function(){return _0x5dbd1a;});})[_0xe58d('0x25')](function(){_0x3cc373[_0xe58d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58b9c2,_0x48b9ee){return function(_0x491e21){if(!_0x491e21){_0x58b9c2[_0xe58d('0x1b')](0x194);}return _0x491e21;};}function handleError(_0x5cdb50,_0x3c0b26){_0x3c0b26=_0x3c0b26||0x1f4;return function(_0x49d9d7){logger[_0xe58d('0x30')](_0x49d9d7[_0xe58d('0x31')]);if(_0x49d9d7[_0xe58d('0x32')]){delete _0x49d9d7[_0xe58d('0x32')];}_0x5cdb50[_0xe58d('0x20')](_0x3c0b26)[_0xe58d('0x33')](_0x49d9d7);};}exports[_0xe58d('0x34')]=function(_0x5a86a2,_0x484a77){var _0x30d509={},_0x18aba3={},_0x172400={'count':0x0,'rows':[]};var _0x5127f8=db[_0xe58d('0x35')][_0xe58d('0x36')];_0x18aba3[_0xe58d('0x37')]=_[_0xe58d('0x38')](_0x5127f8);var _0x377703={'dateStart':_0x5a86a2['query'][_0xe58d('0x39')],'dateEnd':_0x5a86a2[_0xe58d('0x3a')][_0xe58d('0x3b')]};delete _0x5a86a2[_0xe58d('0x3a')]['dateStart'];delete _0x5a86a2[_0xe58d('0x3a')]['dateEnd'];_0x18aba3[_0xe58d('0x3a')]=_[_0xe58d('0x38')](_0x5a86a2[_0xe58d('0x3a')]);_0x18aba3['filters']=_[_0xe58d('0x3c')](_0x18aba3[_0xe58d('0x37')],_0x18aba3['query']);_0x30d509[_0xe58d('0x3d')]=_['intersection'](_0x18aba3[_0xe58d('0x37')],qs['fields'](_0x5a86a2['query'][_0xe58d('0x3e')]));_0x30d509['attributes']=_0x30d509['attributes'][_0xe58d('0x3f')]?_0x30d509[_0xe58d('0x3d')]:_0x18aba3['model'];if(!_0x5a86a2[_0xe58d('0x3a')][_0xe58d('0x40')]('nolimit')){_0x30d509[_0xe58d('0x41')]=qs[_0xe58d('0x41')](_0x5a86a2['query']['limit']);_0x30d509[_0xe58d('0x1f')]=qs[_0xe58d('0x1f')](_0x5a86a2['query']['offset']);}_0x30d509[_0xe58d('0x42')]=qs[_0xe58d('0x43')](_0x5a86a2[_0xe58d('0x3a')][_0xe58d('0x43')]);_0x30d509[_0xe58d('0x44')]=qs[_0xe58d('0x45')](_[_0xe58d('0x46')](_0x5a86a2[_0xe58d('0x3a')],_0x18aba3[_0xe58d('0x45')]));if(_0x377703[_0xe58d('0x39')]){if(_0x377703[_0xe58d('0x3b')]){_0x377703[_0xe58d('0x3b')]=moment(_0x377703[_0xe58d('0x3b')])[_0xe58d('0x47')](0x1,_0xe58d('0x48'));}else{_0x377703[_0xe58d('0x3b')]=moment(_0x377703[_0xe58d('0x39')])['add'](0x1,_0xe58d('0x48'));}_[_0xe58d('0x49')](_0x30d509['where'],{'createdAt':{'$gte':_0x377703[_0xe58d('0x39')],'$lte':_0x377703[_0xe58d('0x3b')]}});}if(_0x5a86a2[_0xe58d('0x3a')][_0xe58d('0x2a')]){_0x30d509['where']=_[_0xe58d('0x49')](_0x30d509[_0xe58d('0x44')],{'$or':_[_0xe58d('0x2b')](_0x5127f8,function(_0x20e22e){if(_0x20e22e[_0xe58d('0x2f')][_0xe58d('0x4a')]!=='VIRTUAL'){var _0x2cc923={};_0x2cc923[_0x20e22e['field']]={'$like':'%'+_0x5a86a2[_0xe58d('0x3a')][_0xe58d('0x2a')]+'%'};return _0x2cc923;}})});}_0x30d509=_[_0xe58d('0x49')]({},_0x30d509,_0x5a86a2[_0xe58d('0x4b')]);var _0x38a103={'where':_0x30d509[_0xe58d('0x44')]};return db['VoiceQueue'][_0xe58d('0x1e')](_0x38a103)[_0xe58d('0x25')](function(_0x199b6e){_0x172400['count']=_0x199b6e;if(_0x5a86a2[_0xe58d('0x3a')]['includeAll']){_0x30d509[_0xe58d('0x4c')]=[{'all':!![]}];}return db[_0xe58d('0x35')][_0xe58d('0x4d')](_0x30d509);})[_0xe58d('0x25')](function(_0x22ac71){_0x172400['rows']=_0x22ac71;return _0x172400;})[_0xe58d('0x25')](respondWithFilteredResult(_0x484a77,_0x30d509))['catch'](handleError(_0x484a77,null));};exports[_0xe58d('0x4e')]=function(_0x1c730b,_0x4578ff){var _0x1ebfeb={'raw':![],'where':{'id':_0x1c730b[_0xe58d('0x4f')]['id']}},_0x500103={};_0x500103[_0xe58d('0x37')]=_[_0xe58d('0x38')](db[_0xe58d('0x35')]['rawAttributes']);_0x500103[_0xe58d('0x3a')]=_['keys'](_0x1c730b[_0xe58d('0x3a')]);_0x500103[_0xe58d('0x45')]=_['intersection'](_0x500103[_0xe58d('0x37')],_0x500103['query']);_0x1ebfeb[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x500103[_0xe58d('0x37')],qs['fields'](_0x1c730b['query'][_0xe58d('0x3e')]));_0x1ebfeb[_0xe58d('0x3d')]=_0x1ebfeb[_0xe58d('0x3d')]['length']?_0x1ebfeb[_0xe58d('0x3d')]:_0x500103[_0xe58d('0x37')];if(_0x1c730b[_0xe58d('0x3a')][_0xe58d('0x50')]){_0x1ebfeb['include']=[{'all':!![]}];}_0x1ebfeb=_[_0xe58d('0x49')]({},_0x1ebfeb,_0x1c730b[_0xe58d('0x4b')]);return db['VoiceQueue'][_0xe58d('0x2e')](_0x1ebfeb)[_0xe58d('0x25')](handleEntityNotFound(_0x4578ff,null))['then'](respondWithResult(_0x4578ff,null))[_0xe58d('0x51')](handleError(_0x4578ff,null));};exports['create']=function(_0xf0e113,_0x311601){return db['VoiceQueue'][_0xe58d('0x52')](_0xf0e113[_0xe58d('0x53')],{})['then'](function(_0x2ae1e4){var _0x1c151f=_0xf0e113[_0xe58d('0x54')][_0xe58d('0x55')]({'plain':!![]});if(!_0x1c151f)throw new Error(_0xe58d('0x56'));if(_0x1c151f[_0xe58d('0x57')]===_0xe58d('0x54')){var _0x28cc3b=_0x2ae1e4[_0xe58d('0x55')]({'plain':!![]});var _0x160dd7=[{'name':_0xe58d('0x27'),'value':_0xe58d('0x28')},{'name':_0xe58d('0x58'),'value':_0xe58d('0x29')}];var _0x19451e=_['find'](_0x160dd7,['value',_0x28cc3b[_0xe58d('0x2f')]])[_0xe58d('0x32')];return db['UserProfileSection']['find']({'where':{'name':_0x19451e,'userProfileId':_0x1c151f['userProfileId']},'raw':!![]})['then'](function(_0x194831){if(_0x194831&&_0x194831['autoAssociation']===0x0){return db[_0xe58d('0x59')][_0xe58d('0x52')]({'name':_0x28cc3b['name'],'resourceId':_0x28cc3b['id'],'type':_0x194831['name'],'sectionId':_0x194831['id']},{})['then'](function(){return _0x2ae1e4;});}else{return _0x2ae1e4;}})[_0xe58d('0x51')](function(_0x4e7ca5){logger[_0xe58d('0x30')](_0xe58d('0x5a'),_0x4e7ca5);throw _0x4e7ca5;});}return _0x2ae1e4;})['then'](respondWithResult(_0x311601,0xc9))[_0xe58d('0x51')](handleError(_0x311601,null));};exports[_0xe58d('0x5b')]=function(_0x385325,_0x1fdc4b){var _0x5b9b8c={'raw':![],'where':{'id':_0x385325['params']['id']}},_0x56925a={};_0x56925a[_0xe58d('0x37')]=_[_0xe58d('0x38')](db[_0xe58d('0x35')]['rawAttributes']);_0x5b9b8c[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x56925a['model'],qs[_0xe58d('0x3e')](_0x385325[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x5b9b8c[_0xe58d('0x3d')]=_0x5b9b8c[_0xe58d('0x3d')][_0xe58d('0x3f')]?_0x5b9b8c[_0xe58d('0x3d')]:_0x56925a[_0xe58d('0x37')];if(_0x385325[_0xe58d('0x3a')]['includeAll']){_0x5b9b8c['include']=[{'all':!![]}];}_0x5b9b8c=_[_0xe58d('0x49')]({},_0x5b9b8c,_0x385325['options']);return db[_0xe58d('0x35')][_0xe58d('0x2e')](_0x5b9b8c)[_0xe58d('0x25')](handleEntityNotFound(_0x1fdc4b,null))['then'](function(_0x3a8e70){if(_0x3a8e70){var _0x3fbe92=_0x3a8e70[_0xe58d('0x55')]({'plain':!![]});_0x3fbe92=qs['omit'](_0x3fbe92,['id',_0xe58d('0x5c'),_0xe58d('0x5d')]);_0x385325[_0xe58d('0x53')]=_['omit'](_0x385325[_0xe58d('0x53')],['id',_0xe58d('0x5c'),'updatedAt']);return db[_0xe58d('0x35')][_0xe58d('0x52')](_[_0xe58d('0x49')](_0x3fbe92,_0x385325[_0xe58d('0x53')]),{'include':_0x385325[_0xe58d('0x3a')][_0xe58d('0x50')]?[{'all':!![]}]:undefined})['then'](function(_0xbd503){var _0x34bc3e=_0x385325[_0xe58d('0x54')][_0xe58d('0x55')]({'plain':!![]});if(!_0x34bc3e)throw new Error(_0xe58d('0x56'));if(_0x34bc3e['role']===_0xe58d('0x54')){var _0xfcd04e=_0xbd503['get']({'plain':!![]});var _0x2caea5=[{'name':_0xe58d('0x27'),'value':_0xe58d('0x28')},{'name':_0xe58d('0x58'),'value':_0xe58d('0x29')}];var _0x1d8857=_[_0xe58d('0x2e')](_0x2caea5,[_0xe58d('0x2c'),_0xfcd04e['type']])[_0xe58d('0x32')];return db[_0xe58d('0x5e')][_0xe58d('0x2e')]({'where':{'name':_0x1d8857,'userProfileId':_0x34bc3e['userProfileId']},'raw':!![]})[_0xe58d('0x25')](function(_0xceda32){if(_0xceda32&&_0xceda32[_0xe58d('0x5f')]===0x0){return db[_0xe58d('0x59')][_0xe58d('0x52')]({'name':_0xfcd04e[_0xe58d('0x32')],'resourceId':_0xfcd04e['id'],'type':_0xceda32[_0xe58d('0x32')],'sectionId':_0xceda32['id']},{})[_0xe58d('0x25')](function(){return _0xbd503;});}else{return _0xbd503;}})['catch'](function(_0x169f2a){logger[_0xe58d('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x169f2a);throw _0x169f2a;});}return _0xbd503;});}})[_0xe58d('0x25')](respondWithResult(_0x1fdc4b,0xc9))[_0xe58d('0x51')](handleError(_0x1fdc4b,null));};exports[_0xe58d('0x60')]=function(_0x451d9f,_0x5c6116){if(_0x451d9f[_0xe58d('0x53')]['id']){delete _0x451d9f['body']['id'];}return db[_0xe58d('0x35')][_0xe58d('0x2e')]({'where':{'id':_0x451d9f['params']['id']}})['then'](handleEntityNotFound(_0x5c6116,null))['then'](saveUpdates(_0x451d9f[_0xe58d('0x53')],null))[_0xe58d('0x25')](respondWithResult(_0x5c6116,null))[_0xe58d('0x51')](handleError(_0x5c6116,null));};exports[_0xe58d('0x26')]=function(_0x4be4ea,_0x225b0e){return db[_0xe58d('0x35')][_0xe58d('0x2e')]({'where':{'id':_0x4be4ea[_0xe58d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x225b0e,null))['then'](removeEntity(_0x225b0e,null))['catch'](handleError(_0x225b0e,null));};exports[_0xe58d('0x61')]=function(_0x5bcb04,_0x537ce2,_0x1e8f6e){var _0x369b53={'raw':![],'where':{}};var _0x2fabc4={};var _0x14c561={'count':0x0,'rows':[]};return db[_0xe58d('0x35')][_0xe58d('0x62')]({'where':{'id':_0x5bcb04['params']['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x537ce2,null))['then'](function(_0x1a3891){if(_0x1a3891){_0x2fabc4['model']=_[_0xe58d('0x38')](db['CmHopper'][_0xe58d('0x36')]);_0x2fabc4['query']=_['keys'](_0x5bcb04[_0xe58d('0x3a')]);_0x2fabc4[_0xe58d('0x45')]=_[_0xe58d('0x3c')](_0x2fabc4[_0xe58d('0x37')],_0x2fabc4['query']);_0x369b53[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x2fabc4['model'],qs[_0xe58d('0x3e')](_0x5bcb04[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x369b53[_0xe58d('0x3d')]=_0x369b53[_0xe58d('0x3d')][_0xe58d('0x3f')]?_0x369b53[_0xe58d('0x3d')]:_0x2fabc4[_0xe58d('0x37')];if(!_0x5bcb04[_0xe58d('0x3a')][_0xe58d('0x40')]('nolimit')){_0x369b53[_0xe58d('0x41')]=qs[_0xe58d('0x41')](_0x5bcb04[_0xe58d('0x3a')][_0xe58d('0x41')]);_0x369b53[_0xe58d('0x1f')]=qs['offset'](_0x5bcb04['query'][_0xe58d('0x1f')]);}_0x369b53['order']=qs[_0xe58d('0x43')](_0x5bcb04['query'][_0xe58d('0x43')]);_0x369b53[_0xe58d('0x44')]=qs['filters'](_['pick'](_0x5bcb04[_0xe58d('0x3a')],_0x2fabc4['filters']));_0x369b53[_0xe58d('0x44')][_0xe58d('0x63')]=_0x1a3891['id'];if(_0x5bcb04['query'][_0xe58d('0x2a')]){_0x369b53[_0xe58d('0x44')]=_[_0xe58d('0x49')](_0x369b53['where'],{'$or':_[_0xe58d('0x2b')](_0x369b53[_0xe58d('0x3d')],function(_0x388c94){var _0x4c9f80={};_0x4c9f80[_0x388c94]={'$like':'%'+_0x5bcb04[_0xe58d('0x3a')][_0xe58d('0x2a')]+'%'};return _0x4c9f80;})});}_0x369b53=_[_0xe58d('0x49')]({},_0x369b53,_0x5bcb04[_0xe58d('0x4b')]);return db[_0xe58d('0x64')][_0xe58d('0x1e')]({'where':_0x369b53[_0xe58d('0x44')]})[_0xe58d('0x25')](function(_0x36dad4){_0x14c561['count']=_0x36dad4;if(_0x5bcb04[_0xe58d('0x3a')]['includeAll']){_0x369b53[_0xe58d('0x4c')]=[{'all':!![]}];}return db[_0xe58d('0x64')][_0xe58d('0x4d')](_0x369b53);})['then'](function(_0x2e2b68){_0x14c561[_0xe58d('0x65')]=_0x2e2b68;return _0x14c561;});}})[_0xe58d('0x25')](respondWithFilteredResult(_0x537ce2,_0x369b53))[_0xe58d('0x51')](handleError(_0x537ce2,null));};exports[_0xe58d('0x66')]=function(_0x2a80e0,_0x3779df,_0x330b45){var _0x37b46d={'raw':!![],'where':{}};var _0x488b29={};var _0x17640e={'count':0x0,'rows':[]};return db[_0xe58d('0x35')]['findOne']({'where':{'id':_0x2a80e0[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x3779df,null))[_0xe58d('0x25')](function(_0x3ed30c){if(_0x3ed30c){_0x488b29[_0xe58d('0x37')]=_['keys'](db['CmHopperHistory'][_0xe58d('0x36')]);_0x488b29[_0xe58d('0x3a')]=_[_0xe58d('0x38')](_0x2a80e0[_0xe58d('0x3a')]);_0x488b29[_0xe58d('0x45')]=_[_0xe58d('0x3c')](_0x488b29[_0xe58d('0x37')],_0x488b29['query']);_0x37b46d[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x488b29[_0xe58d('0x37')],qs[_0xe58d('0x3e')](_0x2a80e0[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x37b46d[_0xe58d('0x3d')]=_0x37b46d[_0xe58d('0x3d')][_0xe58d('0x3f')]?_0x37b46d[_0xe58d('0x3d')]:_0x488b29[_0xe58d('0x37')];if(!_0x2a80e0[_0xe58d('0x3a')][_0xe58d('0x40')](_0xe58d('0x67'))){_0x37b46d[_0xe58d('0x41')]=qs[_0xe58d('0x41')](_0x2a80e0['query'][_0xe58d('0x41')]);_0x37b46d[_0xe58d('0x1f')]=qs[_0xe58d('0x1f')](_0x2a80e0[_0xe58d('0x3a')]['offset']);}_0x37b46d[_0xe58d('0x42')]=qs[_0xe58d('0x43')](_0x2a80e0[_0xe58d('0x3a')][_0xe58d('0x43')]);_0x37b46d['where']=qs[_0xe58d('0x45')](_[_0xe58d('0x46')](_0x2a80e0[_0xe58d('0x3a')],_0x488b29[_0xe58d('0x45')]));_0x37b46d[_0xe58d('0x44')][_0xe58d('0x63')]=_0x3ed30c['id'];if(_0x2a80e0[_0xe58d('0x3a')][_0xe58d('0x2a')]){_0x37b46d['where']=_[_0xe58d('0x49')](_0x37b46d[_0xe58d('0x44')],{'$or':_[_0xe58d('0x2b')](_0x37b46d[_0xe58d('0x3d')],function(_0xf3908e){var _0x8c21d5={};_0x8c21d5[_0xf3908e]={'$like':'%'+_0x2a80e0['query'][_0xe58d('0x2a')]+'%'};return _0x8c21d5;})});}_0x37b46d=_[_0xe58d('0x49')]({},_0x37b46d,_0x2a80e0[_0xe58d('0x4b')]);return db[_0xe58d('0x68')][_0xe58d('0x1e')]({'where':_0x37b46d[_0xe58d('0x44')]})[_0xe58d('0x25')](function(_0x7a60b8){_0x17640e[_0xe58d('0x1e')]=_0x7a60b8;if(_0x2a80e0[_0xe58d('0x3a')][_0xe58d('0x50')]){_0x37b46d[_0xe58d('0x4c')]=[{'all':!![]}];}return db[_0xe58d('0x68')][_0xe58d('0x4d')](_0x37b46d);})[_0xe58d('0x25')](function(_0x2c1f2b){_0x17640e[_0xe58d('0x65')]=_0x2c1f2b;return _0x17640e;});}})[_0xe58d('0x25')](respondWithFilteredResult(_0x3779df,_0x37b46d))[_0xe58d('0x51')](handleError(_0x3779df,null));};exports['getHopperFinals']=function(_0x21f780,_0x267486,_0x3af643){var _0x53596d={'raw':!![],'where':{}};var _0x1f6d91={};var _0x42df82={'count':0x0,'rows':[]};return db[_0xe58d('0x35')]['findOne']({'where':{'id':_0x21f780[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x267486,null))[_0xe58d('0x25')](function(_0x527996){if(_0x527996){_0x1f6d91['model']=_[_0xe58d('0x38')](db[_0xe58d('0x69')][_0xe58d('0x36')]);_0x1f6d91[_0xe58d('0x3a')]=_[_0xe58d('0x38')](_0x21f780[_0xe58d('0x3a')]);_0x1f6d91['filters']=_[_0xe58d('0x3c')](_0x1f6d91['model'],_0x1f6d91[_0xe58d('0x3a')]);_0x53596d[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x1f6d91[_0xe58d('0x37')],qs['fields'](_0x21f780[_0xe58d('0x3a')]['fields']));_0x53596d[_0xe58d('0x3d')]=_0x53596d[_0xe58d('0x3d')]['length']?_0x53596d[_0xe58d('0x3d')]:_0x1f6d91[_0xe58d('0x37')];if(!_0x21f780[_0xe58d('0x3a')][_0xe58d('0x40')](_0xe58d('0x67'))){_0x53596d[_0xe58d('0x41')]=qs['limit'](_0x21f780[_0xe58d('0x3a')][_0xe58d('0x41')]);_0x53596d[_0xe58d('0x1f')]=qs['offset'](_0x21f780['query'][_0xe58d('0x1f')]);}_0x53596d['order']=qs[_0xe58d('0x43')](_0x21f780[_0xe58d('0x3a')][_0xe58d('0x43')]);_0x53596d[_0xe58d('0x44')]=qs[_0xe58d('0x45')](_[_0xe58d('0x46')](_0x21f780[_0xe58d('0x3a')],_0x1f6d91[_0xe58d('0x45')]));_0x53596d[_0xe58d('0x44')][_0xe58d('0x63')]=_0x527996['id'];if(_0x21f780[_0xe58d('0x3a')]['filter']){_0x53596d[_0xe58d('0x44')]=_[_0xe58d('0x49')](_0x53596d['where'],{'$or':_[_0xe58d('0x2b')](_0x53596d[_0xe58d('0x3d')],function(_0x320200){var _0x20dc31={};_0x20dc31[_0x320200]={'$like':'%'+_0x21f780['query'][_0xe58d('0x2a')]+'%'};return _0x20dc31;})});}_0x53596d=_[_0xe58d('0x49')]({},_0x53596d,_0x21f780[_0xe58d('0x4b')]);return db[_0xe58d('0x69')][_0xe58d('0x1e')]({'where':_0x53596d[_0xe58d('0x44')]})['then'](function(_0x4156e1){_0x42df82['count']=_0x4156e1;if(_0x21f780[_0xe58d('0x3a')][_0xe58d('0x50')]){_0x53596d[_0xe58d('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x53596d);})['then'](function(_0x3dc740){_0x42df82[_0xe58d('0x65')]=_0x3dc740;return _0x42df82;});}})[_0xe58d('0x25')](respondWithFilteredResult(_0x267486,_0x53596d))[_0xe58d('0x51')](handleError(_0x267486,null));};exports['getHopperBlacks']=function(_0x4e11c2,_0x27de86,_0x330cd1){var _0x410a03={'raw':!![],'where':{}};var _0xef6b46={};var _0xffd67={'count':0x0,'rows':[]};return db[_0xe58d('0x35')][_0xe58d('0x62')]({'where':{'id':_0x4e11c2[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x27de86,null))['then'](function(_0x16164a){if(_0x16164a){_0xef6b46[_0xe58d('0x37')]=_[_0xe58d('0x38')](db[_0xe58d('0x6a')][_0xe58d('0x36')]);_0xef6b46[_0xe58d('0x3a')]=_['keys'](_0x4e11c2[_0xe58d('0x3a')]);_0xef6b46['filters']=_[_0xe58d('0x3c')](_0xef6b46[_0xe58d('0x37')],_0xef6b46[_0xe58d('0x3a')]);_0x410a03['attributes']=_[_0xe58d('0x3c')](_0xef6b46[_0xe58d('0x37')],qs[_0xe58d('0x3e')](_0x4e11c2[_0xe58d('0x3a')]['fields']));_0x410a03[_0xe58d('0x3d')]=_0x410a03[_0xe58d('0x3d')]['length']?_0x410a03[_0xe58d('0x3d')]:_0xef6b46[_0xe58d('0x37')];if(!_0x4e11c2[_0xe58d('0x3a')]['hasOwnProperty'](_0xe58d('0x67'))){_0x410a03['limit']=qs[_0xe58d('0x41')](_0x4e11c2['query'][_0xe58d('0x41')]);_0x410a03[_0xe58d('0x1f')]=qs[_0xe58d('0x1f')](_0x4e11c2['query'][_0xe58d('0x1f')]);}_0x410a03[_0xe58d('0x42')]=qs[_0xe58d('0x43')](_0x4e11c2[_0xe58d('0x3a')][_0xe58d('0x43')]);_0x410a03['where']=qs['filters'](_[_0xe58d('0x46')](_0x4e11c2['query'],_0xef6b46[_0xe58d('0x45')]));_0x410a03['where'][_0xe58d('0x63')]=_0x16164a['id'];if(_0x4e11c2['query'][_0xe58d('0x2a')]){_0x410a03[_0xe58d('0x44')]=_[_0xe58d('0x49')](_0x410a03['where'],{'$or':_[_0xe58d('0x2b')](_0x410a03[_0xe58d('0x3d')],function(_0x3ae506){var _0x5b2b79={};_0x5b2b79[_0x3ae506]={'$like':'%'+_0x4e11c2[_0xe58d('0x3a')]['filter']+'%'};return _0x5b2b79;})});}_0x410a03=_[_0xe58d('0x49')]({},_0x410a03,_0x4e11c2[_0xe58d('0x4b')]);return db['CmHopperBlack']['count']({'where':_0x410a03['where']})['then'](function(_0x3d2698){_0xffd67[_0xe58d('0x1e')]=_0x3d2698;if(_0x4e11c2[_0xe58d('0x3a')][_0xe58d('0x50')]){_0x410a03[_0xe58d('0x4c')]=[{'all':!![]}];}return db[_0xe58d('0x6a')][_0xe58d('0x4d')](_0x410a03);})[_0xe58d('0x25')](function(_0x2cfa9e){_0xffd67['rows']=_0x2cfa9e;return _0xffd67;});}})[_0xe58d('0x25')](respondWithFilteredResult(_0x27de86,_0x410a03))['catch'](handleError(_0x27de86,null));};exports['getTeams']=function(_0x10bf27,_0x250c54,_0x48038c){var _0x3e72e9={};var _0x2bb57f={};var _0x605fe1;var _0x131613;return db[_0xe58d('0x35')][_0xe58d('0x62')]({'where':{'id':_0x10bf27[_0xe58d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x250c54,null))[_0xe58d('0x25')](function(_0x428f36){if(_0x428f36){_0x605fe1=_0x428f36;_0x2bb57f['model']=_[_0xe58d('0x38')](db[_0xe58d('0x6b')]['rawAttributes']);_0x2bb57f[_0xe58d('0x3a')]=_[_0xe58d('0x38')](_0x10bf27[_0xe58d('0x3a')]);_0x2bb57f['filters']=_[_0xe58d('0x3c')](_0x2bb57f[_0xe58d('0x37')],_0x2bb57f['query']);_0x3e72e9[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x2bb57f['model'],qs[_0xe58d('0x3e')](_0x10bf27[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x3e72e9[_0xe58d('0x3d')]=_0x3e72e9[_0xe58d('0x3d')]['length']?_0x3e72e9['attributes']:_0x2bb57f[_0xe58d('0x37')];_0x3e72e9['order']=qs[_0xe58d('0x43')](_0x10bf27[_0xe58d('0x3a')]['sort']);_0x3e72e9['where']=qs[_0xe58d('0x45')](_[_0xe58d('0x46')](_0x10bf27[_0xe58d('0x3a')],_0x2bb57f[_0xe58d('0x45')]));if(_0x10bf27['query'][_0xe58d('0x2a')]){_0x3e72e9[_0xe58d('0x44')]=_[_0xe58d('0x49')](_0x3e72e9[_0xe58d('0x44')],{'$or':_[_0xe58d('0x2b')](_0x3e72e9[_0xe58d('0x3d')],function(_0x4ee0ac){var _0x413194={};_0x413194[_0x4ee0ac]={'$like':'%'+_0x10bf27[_0xe58d('0x3a')][_0xe58d('0x2a')]+'%'};return _0x413194;})});}_0x3e72e9=_[_0xe58d('0x49')]({},_0x3e72e9,_0x10bf27[_0xe58d('0x4b')]);return _0x605fe1[_0xe58d('0x6c')](_0x3e72e9);}})[_0xe58d('0x25')](function(_0x195624){if(_0x195624){_0x131613=_0x195624[_0xe58d('0x3f')];if(!_0x10bf27[_0xe58d('0x3a')][_0xe58d('0x40')](_0xe58d('0x67'))){_0x3e72e9[_0xe58d('0x41')]=qs[_0xe58d('0x41')](_0x10bf27['query'][_0xe58d('0x41')]);_0x3e72e9[_0xe58d('0x1f')]=qs[_0xe58d('0x1f')](_0x10bf27[_0xe58d('0x3a')]['offset']);}return _0x605fe1[_0xe58d('0x6c')](_0x3e72e9);}})['then'](function(_0x32e2d6){if(_0x32e2d6){return _0x32e2d6?{'count':_0x131613,'rows':_0x32e2d6}:null;}})[_0xe58d('0x25')](respondWithResult(_0x250c54,null))['catch'](handleError(_0x250c54,null));};exports[_0xe58d('0x6d')]=function(_0x2b6657,_0x464f55,_0xcaa2e){var _0x302168=[];var _0x53dbef;return db['Team'][_0xe58d('0x4d')]({'where':{'id':_0x2b6657[_0xe58d('0x53')][_0xe58d('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe58d('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xe58d('0x25')](function(_0x537fc7){if(_0x537fc7){for(var _0x4eb402=0x0;_0x4eb402<_0x537fc7[_0xe58d('0x3f')];_0x4eb402+=0x1){for(var _0x587b4e=0x0;_0x587b4e<_0x537fc7[_0x4eb402][_0xe58d('0x6f')]['length'];_0x587b4e+=0x1){_0x302168=_[_0xe58d('0x70')](_0x302168,[_0x537fc7[_0x4eb402][_0xe58d('0x6f')][_0x587b4e]['id']]);}}return _0x302168;}})[_0xe58d('0x25')](function(_0x523667){if(_0x523667){return db[_0xe58d('0x35')][_0xe58d('0x2e')]({'where':{'id':_0x2b6657[_0xe58d('0x4f')]['id']}});}})['then'](function(_0xea3673){if(_0xea3673){_0x53dbef=_0xea3673;return _0x53dbef['addAgents'](_0x302168,{'penalty':_0x2b6657[_0xe58d('0x53')]['penalty']});}})[_0xe58d('0x25')](function(_0x43f8db){if(_0x43f8db){return _0x53dbef['addTeams'](_0x2b6657[_0xe58d('0x53')][_0xe58d('0x6e')]);}})[_0xe58d('0x25')](handleEntityNotFound(_0x464f55,null))[_0xe58d('0x25')](respondWithStatusCode(_0x464f55,null))['catch'](handleError(_0x464f55,null));};exports[_0xe58d('0x71')]=function(_0x14ecf6,_0x5e83f5,_0x129efd){var _0x205e54=[];var _0x366fe3;return db[_0xe58d('0x6b')][_0xe58d('0x4d')]({'where':{'id':_0x14ecf6[_0xe58d('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe58d('0x72')],'as':_0xe58d('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xe58d('0x25')](function(_0x969238){if(_0x969238){for(var _0xb22ae0=0x0;_0xb22ae0<_0x969238[_0xe58d('0x3f')];_0xb22ae0+=0x1){for(var _0x353d27=0x0;_0x353d27<_0x969238[_0xb22ae0]['Agents'][_0xe58d('0x3f')];_0x353d27+=0x1){_0x205e54=_[_0xe58d('0x70')](_0x205e54,[_0x969238[_0xb22ae0][_0xe58d('0x6f')][_0x353d27]['id']]);}}return _0x205e54;}})['then'](function(_0x4b4ec3){if(_0x4b4ec3){return db[_0xe58d('0x35')][_0xe58d('0x2e')]({'where':{'id':_0x14ecf6[_0xe58d('0x4f')]['id']}});}})[_0xe58d('0x25')](function(_0x5e7d94){if(_0x5e7d94){_0x366fe3=_0x5e7d94;return _0x366fe3[_0xe58d('0x73')](_0x205e54);}})[_0xe58d('0x25')](function(_0x33dcd9){if(_0x366fe3){return _0x366fe3[_0xe58d('0x71')](_0x14ecf6[_0xe58d('0x3a')]['ids']);}})[_0xe58d('0x25')](handleEntityNotFound(_0x5e83f5,null))['then'](respondWithStatusCode(_0x5e83f5,null))[_0xe58d('0x51')](handleError(_0x5e83f5,null));};exports[_0xe58d('0x74')]=function(_0x2c5798,_0x24a17c,_0x4fd3d9){var _0x176396,_0x4b882d;return db['VoiceQueue'][_0xe58d('0x2e')]({'where':{'id':_0x2c5798[_0xe58d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x24a17c,null))[_0xe58d('0x25')](function(_0x3dfe23){if(_0x3dfe23){_0x4b882d=_0x3dfe23;return _0x3dfe23[_0xe58d('0x74')](_0x2c5798[_0xe58d('0x53')][_0xe58d('0x6e')],_[_0xe58d('0x75')](_0x2c5798[_0xe58d('0x53')],[_0xe58d('0x6e'),'id'])||{})[_0xe58d('0x76')](function(_0x569f98){for(var _0x148cde=0x0;_0x148cde<_0x2c5798[_0xe58d('0x53')]['ids'][_0xe58d('0x3f')];_0x148cde+=0x1){socket[_0xe58d('0x77')](_0xe58d('0x78'),{'UserId':_0x2c5798[_0xe58d('0x53')][_0xe58d('0x6e')][_0x148cde],'VoiceQueueId':_0x2c5798[_0xe58d('0x4f')]['id']});}return _0x569f98;});}})[_0xe58d('0x25')](function(_0x33adca){_0x176396=_0x33adca||[];if(_0x4b882d){return db[_0xe58d('0x72')][_0xe58d('0x4d')]({'where':{'id':_0x2c5798[_0xe58d('0x53')][_0xe58d('0x6e')]},'attributes':['id',_0xe58d('0x32'),_0xe58d('0x79'),'voicePause','interface'],'raw':!![]});}})[_0xe58d('0x25')](function(_0x58f344){if(_0x58f344&&_0x58f344[_0xe58d('0x3f')]){var _0x4e1c7c=[];for(var _0xac9a63=0x0;_0xac9a63<_0x58f344[_0xe58d('0x3f')];_0xac9a63++){_0x4e1c7c['push'](db[_0xe58d('0x7a')][_0xe58d('0x7b')]({'membername':_0x58f344[_0xac9a63][_0xe58d('0x32')],'UserId':_0x58f344[_0xac9a63]['id'],'queue_name':_0x4b882d['name'],'VoiceQueueId':_0x4b882d['id'],'interface':_['isNil'](_0x58f344[_0xac9a63][_0xe58d('0x7c')])?util[_0xe58d('0x7d')](_0xe58d('0x7e'),_0x58f344[_0xac9a63][_0xe58d('0x32')]):_0x58f344[_0xac9a63][_0xe58d('0x7c')],'paused':_0x58f344[_0xac9a63]['voicePause']||![],'penalty':_0x2c5798[_0xe58d('0x53')][_0xe58d('0x7f')]||0x0}));}return BPromise['all'](_0x4e1c7c);}})[_0xe58d('0x25')](function(_0x20bd73){return _0x176396;})['then'](respondWithResult(_0x24a17c,null))[_0xe58d('0x51')](handleError(_0x24a17c,null));};exports['removeAgents']=function(_0x1abec2,_0x42fa35,_0xf4e9bc){var _0x1aff8b;return db[_0xe58d('0x35')][_0xe58d('0x2e')]({'where':{'id':_0x1abec2[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x42fa35,null))[_0xe58d('0x25')](function(_0x1f1054){if(_0x1f1054){return _0x1f1054['removeAgents'](_0x1abec2[_0xe58d('0x3a')][_0xe58d('0x6e')])[_0xe58d('0x25')](function(_0x27c2c5){if(_['isArray'](_0x1abec2[_0xe58d('0x3a')][_0xe58d('0x6e')])){for(var _0x1b47d4=0x0;_0x1b47d4<_0x1abec2[_0xe58d('0x3a')][_0xe58d('0x6e')][_0xe58d('0x3f')];_0x1b47d4+=0x1){socket[_0xe58d('0x77')]('userVoiceQueue:remove',{'UserId':_0x1abec2[_0xe58d('0x3a')][_0xe58d('0x6e')][_0x1b47d4],'VoiceQueueId':_0x1abec2[_0xe58d('0x4f')]['id']});}}else{socket['emit'](_0xe58d('0x80'),{'UserId':_0x1abec2[_0xe58d('0x3a')][_0xe58d('0x6e')],'VoiceQueueId':_0x1abec2[_0xe58d('0x4f')]['id']});}});}})['then'](function(_0x32d7b1){if(_0x1abec2[_0xe58d('0x3a')][_0xe58d('0x81')]){_0x1aff8b=_0x32d7b1;return db[_0xe58d('0x7a')][_0xe58d('0x26')]({'where':{'VoiceQueueId':_0x1abec2[_0xe58d('0x4f')]['id'],'UserId':_0x1abec2[_0xe58d('0x3a')]['ids']}})[_0xe58d('0x25')](function(){return _0x1aff8b;});}})[_0xe58d('0x25')](respondWithStatusCode(_0x42fa35,null))[_0xe58d('0x51')](handleError(_0x42fa35,null));};exports[_0xe58d('0x82')]=function(_0x22848f,_0x266d79,_0x5ae823){var _0x2592a9={};var _0x57694e={};var _0xffb503;var _0x446106;return db[_0xe58d('0x35')]['findOne']({'where':{'id':_0x22848f['params']['id']}})['then'](handleEntityNotFound(_0x266d79,null))[_0xe58d('0x25')](function(_0x5300d7){if(_0x5300d7){_0xffb503=_0x5300d7;_0x57694e[_0xe58d('0x37')]=_['keys'](db['User'][_0xe58d('0x36')]);_0x57694e[_0xe58d('0x3a')]=_['keys'](_0x22848f[_0xe58d('0x3a')]);_0x57694e[_0xe58d('0x45')]=_[_0xe58d('0x3c')](_0x57694e[_0xe58d('0x37')],_0x57694e[_0xe58d('0x3a')]);_0x2592a9[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x57694e[_0xe58d('0x37')],qs['fields'](_0x22848f[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x2592a9[_0xe58d('0x3d')]=_0x2592a9[_0xe58d('0x3d')][_0xe58d('0x3f')]?_0x2592a9[_0xe58d('0x3d')]:_0x57694e[_0xe58d('0x37')];_0x2592a9[_0xe58d('0x42')]=qs[_0xe58d('0x43')](_0x22848f['query'][_0xe58d('0x43')]);_0x2592a9[_0xe58d('0x44')]=qs['filters'](_[_0xe58d('0x46')](_0x22848f[_0xe58d('0x3a')],_0x57694e[_0xe58d('0x45')]));if(_0x22848f[_0xe58d('0x3a')]['filter']){_0x2592a9['where']=_[_0xe58d('0x49')](_0x2592a9[_0xe58d('0x44')],{'$or':_['map'](_0x2592a9[_0xe58d('0x3d')],function(_0x6d31f8){var _0x4fd94f={};_0x4fd94f[_0x6d31f8]={'$like':'%'+_0x22848f[_0xe58d('0x3a')][_0xe58d('0x2a')]+'%'};return _0x4fd94f;})});}_0x2592a9=_['merge']({},_0x2592a9,_0x22848f[_0xe58d('0x4b')]);return _0xffb503[_0xe58d('0x82')](_0x2592a9);}})[_0xe58d('0x25')](function(_0x58e487){if(_0x58e487){_0x446106=_0x58e487[_0xe58d('0x3f')];if(!_0x22848f[_0xe58d('0x3a')][_0xe58d('0x40')](_0xe58d('0x67'))){_0x2592a9[_0xe58d('0x41')]=qs[_0xe58d('0x41')](_0x22848f[_0xe58d('0x3a')][_0xe58d('0x41')]);_0x2592a9[_0xe58d('0x1f')]=qs['offset'](_0x22848f[_0xe58d('0x3a')][_0xe58d('0x1f')]);}return _0xffb503['getAgents'](_0x2592a9);}})[_0xe58d('0x25')](function(_0x48773f){if(_0x48773f){return _0x48773f?{'count':_0x446106,'rows':_0x48773f}:null;}})[_0xe58d('0x25')](respondWithResult(_0x266d79,null))[_0xe58d('0x51')](handleError(_0x266d79,null));};exports[_0xe58d('0x83')]=function(_0x35b850,_0xa14302,_0x3fb06d){var _0x41d56b={};var _0x2ae693={};var _0xc2190c;var _0x144662;return db[_0xe58d('0x35')][_0xe58d('0x62')]({'where':{'id':_0x35b850[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0xa14302,null))['then'](function(_0x39a165){if(_0x39a165){_0xc2190c=_0x39a165;_0x2ae693[_0xe58d('0x37')]=_[_0xe58d('0x38')](db[_0xe58d('0x7a')][_0xe58d('0x36')]);_0x2ae693[_0xe58d('0x3a')]=_[_0xe58d('0x38')](_0x35b850[_0xe58d('0x3a')]);_0x2ae693['filters']=_['intersection'](_0x2ae693['model'],_0x2ae693[_0xe58d('0x3a')]);_0x41d56b[_0xe58d('0x3d')]=_[_0xe58d('0x3c')](_0x2ae693[_0xe58d('0x37')],qs[_0xe58d('0x3e')](_0x35b850[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x41d56b['attributes']=_0x41d56b[_0xe58d('0x3d')][_0xe58d('0x3f')]?_0x41d56b['attributes']:_0x2ae693[_0xe58d('0x37')];_0x41d56b[_0xe58d('0x42')]=qs[_0xe58d('0x43')](_0x35b850[_0xe58d('0x3a')]['sort']);_0x41d56b['where']=qs[_0xe58d('0x45')](_[_0xe58d('0x46')](_0x35b850[_0xe58d('0x3a')],_0x2ae693[_0xe58d('0x45')]));if(_0x35b850[_0xe58d('0x3a')][_0xe58d('0x2a')]){_0x41d56b[_0xe58d('0x44')]=_[_0xe58d('0x49')](_0x41d56b['where'],{'$or':_[_0xe58d('0x2b')](_0x41d56b[_0xe58d('0x3d')],function(_0x5b2f5b){var _0x22cb5d={};_0x22cb5d[_0x5b2f5b]={'$like':'%'+_0x35b850[_0xe58d('0x3a')][_0xe58d('0x2a')]+'%'};return _0x22cb5d;})});}_0x41d56b=_['merge']({},_0x41d56b,_0x35b850[_0xe58d('0x4b')]);return _0xc2190c[_0xe58d('0x83')](_0x41d56b);}})[_0xe58d('0x25')](function(_0x2b0f46){if(_0x2b0f46){_0x144662=_0x2b0f46['length'];if(!_0x35b850[_0xe58d('0x3a')][_0xe58d('0x40')](_0xe58d('0x67'))){_0x41d56b[_0xe58d('0x41')]=qs[_0xe58d('0x41')](_0x35b850[_0xe58d('0x3a')][_0xe58d('0x41')]);_0x41d56b[_0xe58d('0x1f')]=qs[_0xe58d('0x1f')](_0x35b850[_0xe58d('0x3a')][_0xe58d('0x1f')]);}return _0xc2190c[_0xe58d('0x83')](_0x41d56b);}})[_0xe58d('0x25')](function(_0x4d9728){return _0x4d9728?{'count':_0x144662,'rows':_0x4d9728}:null;})['then'](respondWithResult(_0xa14302,null))[_0xe58d('0x51')](handleError(_0xa14302,null));};exports[_0xe58d('0x84')]=function(_0x55171d,_0xf5c211,_0x214c83){var _0x421aa5={};var _0xc9b559={};var _0xf82754;var _0x225ca5;return db['VoiceQueue'][_0xe58d('0x62')]({'where':{'id':_0x55171d[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0xf5c211,null))[_0xe58d('0x25')](function(_0x282885){if(_0x282885){_0xf82754=_0x282885;_0xc9b559[_0xe58d('0x37')]=_[_0xe58d('0x38')](db[_0xe58d('0x85')][_0xe58d('0x36')]);_0xc9b559[_0xe58d('0x3a')]=_[_0xe58d('0x38')](_0x55171d[_0xe58d('0x3a')]);_0xc9b559[_0xe58d('0x45')]=_[_0xe58d('0x3c')](_0xc9b559['model'],_0xc9b559[_0xe58d('0x3a')]);_0x421aa5[_0xe58d('0x3d')]=_['intersection'](_0xc9b559[_0xe58d('0x37')],qs[_0xe58d('0x3e')](_0x55171d[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x421aa5[_0xe58d('0x3d')]=_0x421aa5[_0xe58d('0x3d')][_0xe58d('0x3f')]?_0x421aa5[_0xe58d('0x3d')]:_0xc9b559[_0xe58d('0x37')];_0x421aa5[_0xe58d('0x42')]=qs['sort'](_0x55171d[_0xe58d('0x3a')][_0xe58d('0x43')]);_0x421aa5['where']=qs[_0xe58d('0x45')](_[_0xe58d('0x46')](_0x55171d[_0xe58d('0x3a')],_0xc9b559[_0xe58d('0x45')]));if(_0x55171d[_0xe58d('0x3a')][_0xe58d('0x2a')]){_0x421aa5[_0xe58d('0x44')]=_[_0xe58d('0x49')](_0x421aa5['where'],{'$or':_[_0xe58d('0x2b')](_0x421aa5['attributes'],function(_0x37da46){var _0x3add14={};_0x3add14[_0x37da46]={'$like':'%'+_0x55171d[_0xe58d('0x3a')][_0xe58d('0x2a')]+'%'};return _0x3add14;})});}_0x421aa5=_[_0xe58d('0x49')]({},_0x421aa5,_0x55171d['options']);return _0xf82754[_0xe58d('0x84')](_0x421aa5);}})[_0xe58d('0x25')](function(_0x1ac3b4){if(_0x1ac3b4){_0x225ca5=_0x1ac3b4[_0xe58d('0x3f')];if(!_0x55171d[_0xe58d('0x3a')][_0xe58d('0x40')]('nolimit')){_0x421aa5['limit']=qs[_0xe58d('0x41')](_0x55171d['query'][_0xe58d('0x41')]);_0x421aa5['offset']=qs[_0xe58d('0x1f')](_0x55171d['query'][_0xe58d('0x1f')]);}return _0xf82754['getLists'](_0x421aa5);}})[_0xe58d('0x25')](function(_0x1653ab){if(_0x1653ab){return _0x1653ab?{'count':_0x225ca5,'rows':_0x1653ab}:null;}})[_0xe58d('0x25')](respondWithResult(_0xf5c211,null))['catch'](handleError(_0xf5c211,null));};exports[_0xe58d('0x86')]=function(_0x180b9f,_0x3063cc,_0x39b60b){var _0x423e9f,_0x1b5ced;return db[_0xe58d('0x35')][_0xe58d('0x2e')]({'where':{'id':_0x180b9f[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x3063cc,null))[_0xe58d('0x25')](function(_0x4b4213){if(_0x4b4213){_0x1b5ced=_0x4b4213;return _0x4b4213[_0xe58d('0x86')](_0x180b9f[_0xe58d('0x53')][_0xe58d('0x6e')],_['omit'](_0x180b9f[_0xe58d('0x53')],[_0xe58d('0x6e'),'id'])||{});}return null;})['spread'](function(_0x3a2275){var _0x440ede;_0x423e9f=_0x3a2275||[];var _0x1c05ae=[];if(_0x3a2275){for(var _0x2951b9=0x0;_0x2951b9<_0x3a2275[_0xe58d('0x3f')];_0x2951b9+=0x1){var _0x22a95f=_0x3a2275[_0x2951b9]['get']({'plain':!![]});_0x1b5ced[_0xe58d('0x87')]=_0x180b9f['body'][_0xe58d('0x87')]?_0x180b9f[_0xe58d('0x53')][_0xe58d('0x87')]:_0x1b5ced[_0xe58d('0x87')];switch(_0x1b5ced[_0xe58d('0x87')]){case _0xe58d('0x88'):_0x440ede=squel[_0xe58d('0x89')]()[_0xe58d('0x8a')](_0xe58d('0x8b'))[_0xe58d('0x8c')]([_0xe58d('0x8d'),_0xe58d('0x8e'),_0xe58d('0x8f'),_0xe58d('0x90'),_0xe58d('0x63'),'createdAt',_0xe58d('0x5d')],squel[_0xe58d('0x91')]()[_0xe58d('0x92')](_0xe58d('0x8d'),_0xe58d('0x8d'))['field']('NOW()','scheduledAt')[_0xe58d('0x92')]('id',_0xe58d('0x8f'))[_0xe58d('0x92')](_0x22a95f['CmListId']['toString'](),'ListId')['field'](_0x180b9f[_0xe58d('0x4f')]['id']['toString'](),_0xe58d('0x63'))[_0xe58d('0x92')](_0xe58d('0x93'),'createdAt')[_0xe58d('0x92')](_0xe58d('0x93'),_0xe58d('0x5d'))['from'](_0xe58d('0x94'))[_0xe58d('0x44')](_0xe58d('0x95'))[_0xe58d('0x44')](_0xe58d('0x96'),_0x22a95f['CmListId'][_0xe58d('0x97')]())['where'](_0xe58d('0x98'))[_0xe58d('0x44')](_0xe58d('0x99'),squel[_0xe58d('0x91')]()[_0xe58d('0x92')]('calleridnum')[_0xe58d('0x9a')](_0xe58d('0x9b'))['where'](_0xe58d('0x9c'),_0x180b9f['params']['id'][_0xe58d('0x97')]()))['where'](_0xe58d('0x99'),squel[_0xe58d('0x91')]()[_0xe58d('0x92')](_0xe58d('0x8d'))[_0xe58d('0x9a')]('cm_hopper')[_0xe58d('0x44')](_0xe58d('0x9c'),_0x180b9f['params']['id'][_0xe58d('0x97')]())))[_0xe58d('0x97')]();break;case'onlyIfOpen':_0x440ede=squel[_0xe58d('0x89')]()[_0xe58d('0x8a')]('cm_hopper')[_0xe58d('0x8c')]([_0xe58d('0x8d'),'scheduledAt',_0xe58d('0x8f'),_0xe58d('0x90'),_0xe58d('0x63'),_0xe58d('0x5c'),'updatedAt'],squel[_0xe58d('0x91')]()[_0xe58d('0x92')](_0xe58d('0x8d'),_0xe58d('0x8d'))[_0xe58d('0x92')](_0xe58d('0x93'),'scheduledAt')[_0xe58d('0x92')]('id',_0xe58d('0x8f'))['field'](_0x22a95f[_0xe58d('0x9d')][_0xe58d('0x97')](),_0xe58d('0x90'))[_0xe58d('0x92')](_0x180b9f[_0xe58d('0x4f')]['id'][_0xe58d('0x97')](),_0xe58d('0x63'))[_0xe58d('0x92')](_0xe58d('0x93'),_0xe58d('0x5c'))[_0xe58d('0x92')]('NOW()',_0xe58d('0x5d'))[_0xe58d('0x9a')](_0xe58d('0x94'))['where'](_0xe58d('0x95'))[_0xe58d('0x44')]('ListId\x20=\x20?',_0x22a95f['CmListId'][_0xe58d('0x97')]())[_0xe58d('0x44')](_0xe58d('0x98'))['where'](_0xe58d('0x99'),squel[_0xe58d('0x91')]()[_0xe58d('0x92')](_0xe58d('0x8d'))[_0xe58d('0x9a')]('cm_hopper')[_0xe58d('0x44')]('VoiceQueueId\x20=\x20?',_0x180b9f['params']['id'][_0xe58d('0x97')]())))[_0xe58d('0x97')]();break;default:_0x440ede=squel[_0xe58d('0x89')]()[_0xe58d('0x8a')]('cm_hopper')[_0xe58d('0x8c')]([_0xe58d('0x8d'),_0xe58d('0x8e'),_0xe58d('0x8f'),'ListId',_0xe58d('0x63'),_0xe58d('0x5c'),'updatedAt'],squel['select']()[_0xe58d('0x92')](_0xe58d('0x8d'),_0xe58d('0x8d'))[_0xe58d('0x92')](_0xe58d('0x93'),_0xe58d('0x8e'))[_0xe58d('0x92')]('id',_0xe58d('0x8f'))[_0xe58d('0x92')](_0x22a95f[_0xe58d('0x9d')][_0xe58d('0x97')](),_0xe58d('0x90'))['field'](_0x180b9f[_0xe58d('0x4f')]['id']['toString'](),_0xe58d('0x63'))['field']('NOW()',_0xe58d('0x5c'))['field'](_0xe58d('0x93'),_0xe58d('0x5d'))['from'](_0xe58d('0x94'))[_0xe58d('0x44')](_0xe58d('0x95'))['where'](_0xe58d('0x96'),_0x22a95f['CmListId'][_0xe58d('0x97')]())[_0xe58d('0x44')](_0xe58d('0x98')))[_0xe58d('0x97')]();}_0x1c05ae[_0xe58d('0x9e')](db['sequelize'][_0xe58d('0x3a')](_0x440ede));}return BPromise['all'](_0x1c05ae);}})[_0xe58d('0x25')](function(){return _0x423e9f;})[_0xe58d('0x25')](respondWithResult(_0x3063cc,null))[_0xe58d('0x51')](handleError(_0x3063cc,null));};exports[_0xe58d('0x9f')]=function(_0x1c6bf3,_0xe98ce2,_0x5c5210){var _0x1d1c92;return db[_0xe58d('0x35')][_0xe58d('0x2e')]({'where':{'id':_0x1c6bf3[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0xe98ce2,null))[_0xe58d('0x25')](function(_0x211bd5){if(_0x211bd5){return _0x211bd5[_0xe58d('0x9f')](_0x1c6bf3[_0xe58d('0x3a')][_0xe58d('0x6e')]);}})[_0xe58d('0x25')](function(_0x2af247){if(_0x2af247){_0x1d1c92=_0x2af247;return db[_0xe58d('0x64')][_0xe58d('0x26')]({'where':{'ListId':_0x1c6bf3['query']['ids'],'VoiceQueueId':_0x1c6bf3[_0xe58d('0x4f')]['id']}})['then'](function(){return _0x1d1c92;});}})[_0xe58d('0x25')](respondWithStatusCode(_0xe98ce2,null))[_0xe58d('0x51')](handleError(_0xe98ce2,null));};exports[_0xe58d('0xa0')]=function(_0x5f0909,_0x20173a,_0x3f803b){var _0x5be906={};var _0x1f8065={};var _0x2300d9;var _0x567a3e;return db[_0xe58d('0x35')][_0xe58d('0x62')]({'where':{'id':_0x5f0909[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x20173a,null))[_0xe58d('0x25')](function(_0x2582b1){if(_0x2582b1){_0x2300d9=_0x2582b1;_0x1f8065[_0xe58d('0x37')]=_[_0xe58d('0x38')](db[_0xe58d('0x85')]['rawAttributes']);_0x1f8065[_0xe58d('0x3a')]=_[_0xe58d('0x38')](_0x5f0909[_0xe58d('0x3a')]);_0x1f8065[_0xe58d('0x45')]=_['intersection'](_0x1f8065[_0xe58d('0x37')],_0x1f8065['query']);_0x5be906['attributes']=_['intersection'](_0x1f8065[_0xe58d('0x37')],qs[_0xe58d('0x3e')](_0x5f0909[_0xe58d('0x3a')][_0xe58d('0x3e')]));_0x5be906[_0xe58d('0x3d')]=_0x5be906[_0xe58d('0x3d')]['length']?_0x5be906['attributes']:_0x1f8065[_0xe58d('0x37')];_0x5be906['order']=qs[_0xe58d('0x43')](_0x5f0909['query'][_0xe58d('0x43')]);_0x5be906['where']=qs['filters'](_[_0xe58d('0x46')](_0x5f0909['query'],_0x1f8065['filters']));if(_0x5f0909[_0xe58d('0x3a')][_0xe58d('0x2a')]){_0x5be906[_0xe58d('0x44')]=_[_0xe58d('0x49')](_0x5be906[_0xe58d('0x44')],{'$or':_[_0xe58d('0x2b')](_0x5be906[_0xe58d('0x3d')],function(_0x3e2cf4){var _0x16c0b5={};_0x16c0b5[_0x3e2cf4]={'$like':'%'+_0x5f0909[_0xe58d('0x3a')][_0xe58d('0x2a')]+'%'};return _0x16c0b5;})});}_0x5be906=_['merge']({},_0x5be906,_0x5f0909['options']);return _0x2300d9[_0xe58d('0xa0')](_0x5be906);}})[_0xe58d('0x25')](function(_0x5d27da){if(_0x5d27da){_0x567a3e=_0x5d27da[_0xe58d('0x3f')];if(!_0x5f0909[_0xe58d('0x3a')][_0xe58d('0x40')](_0xe58d('0x67'))){_0x5be906[_0xe58d('0x41')]=qs[_0xe58d('0x41')](_0x5f0909['query'][_0xe58d('0x41')]);_0x5be906[_0xe58d('0x1f')]=qs[_0xe58d('0x1f')](_0x5f0909[_0xe58d('0x3a')][_0xe58d('0x1f')]);}return _0x2300d9[_0xe58d('0xa0')](_0x5be906);}})[_0xe58d('0x25')](function(_0x53deb3){if(_0x53deb3){return _0x53deb3?{'count':_0x567a3e,'rows':_0x53deb3}:null;}})['then'](respondWithResult(_0x20173a,null))['catch'](handleError(_0x20173a,null));};exports[_0xe58d('0xa1')]=function(_0x14b838,_0x5a79a6,_0x148173){var _0x454353,_0x2ada77;return db['VoiceQueue'][_0xe58d('0x2e')]({'where':{'id':_0x14b838['params']['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x5a79a6,null))['then'](function(_0x15116c){if(_0x15116c){_0x2ada77=_0x15116c;return _0x15116c[_0xe58d('0xa1')](_0x14b838[_0xe58d('0x53')][_0xe58d('0x6e')],_[_0xe58d('0x75')](_0x14b838['body'],['ids','id'])||{});}return null;})[_0xe58d('0x76')](function(_0x4bfd57){var _0x2f62df;_0x454353=_0x4bfd57||[];var _0xeb6fe0=[];if(_0x4bfd57){for(var _0x556534=0x0;_0x556534<_0x4bfd57[_0xe58d('0x3f')];_0x556534+=0x1){var _0x4f5e7f=_0x4bfd57[_0x556534][_0xe58d('0x55')]({'plain':!![]});_0x2f62df=squel['insert']()['into'](_0xe58d('0xa2'))['fromQuery']([_0xe58d('0x8d'),_0xe58d('0x8f'),_0xe58d('0x90'),_0xe58d('0x63'),_0xe58d('0x5c'),_0xe58d('0x5d')],squel[_0xe58d('0x91')]()[_0xe58d('0x92')]('phone',_0xe58d('0x8d'))[_0xe58d('0x92')]('id',_0xe58d('0x8f'))[_0xe58d('0x92')](_0x4f5e7f[_0xe58d('0x9d')][_0xe58d('0x97')](),_0xe58d('0x90'))['field'](_0x14b838[_0xe58d('0x4f')]['id'][_0xe58d('0x97')](),_0xe58d('0x63'))['field'](_0xe58d('0x93'),_0xe58d('0x5c'))[_0xe58d('0x92')]('NOW()',_0xe58d('0x5d'))[_0xe58d('0x9a')](_0xe58d('0x94'))[_0xe58d('0x44')](_0xe58d('0x95'))[_0xe58d('0x44')](_0xe58d('0x96'),_0x4f5e7f[_0xe58d('0x9d')]['toString']())['where'](_0xe58d('0x98')))['toString']();_0xeb6fe0['push'](db[_0xe58d('0xa3')]['query'](_0x2f62df));}return BPromise[_0xe58d('0xa4')](_0xeb6fe0);}})[_0xe58d('0x25')](function(){return _0x454353;})[_0xe58d('0x25')](respondWithResult(_0x5a79a6,null))[_0xe58d('0x51')](handleError(_0x5a79a6,null));};exports[_0xe58d('0xa5')]=function(_0x4756f1,_0x375bfb,_0x349131){var _0x1f1021;return db['VoiceQueue'][_0xe58d('0x2e')]({'where':{'id':_0x4756f1[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](handleEntityNotFound(_0x375bfb,null))['then'](function(_0x11c14c){if(_0x11c14c){return _0x11c14c[_0xe58d('0xa5')](_0x4756f1[_0xe58d('0x3a')][_0xe58d('0x6e')]);}})[_0xe58d('0x25')](function(_0x3f6d28){if(_0x3f6d28){_0x1f1021=_0x3f6d28;return db[_0xe58d('0x6a')][_0xe58d('0x26')]({'where':{'ListId':_0x4756f1[_0xe58d('0x3a')]['ids'],'VoiceQueueId':_0x4756f1[_0xe58d('0x4f')]['id']}})[_0xe58d('0x25')](function(){return _0x1f1021;});}})[_0xe58d('0x25')](respondWithStatusCode(_0x375bfb,null))[_0xe58d('0x51')](handleError(_0x375bfb,null));};
\ No newline at end of file
+var _0xf55d=['model','attributes','fields','length','nolimit','sort','filters','add','day','merge','VIRTUAL','field','options','where','includeAll','include','findAll','rows','catch','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','omit','createdAt','updatedAt','body','findOne','CmHopper','order','pick','VoiceQueueId','getHopperHistories','hasOwnProperty','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','ids','User','Agents','union','addAgents','penalty','addTeams','removeTeams','loginInPause','voicePause','interface','upsert','isNil','all','removeAgents','isArray','emit','userVoiceQueue:remove','realtime','UserVoiceQueueRt','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','cm_hopper','VoiceQueueId\x20=\x20?','onlyIfOpen','into','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','push','sequelize','addBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','type','find','name','end','error','stack','index','VoiceQueue','rawAttributes','keys','query','dateStart','dateEnd','intersection'];(function(_0x1f28c8,_0x2c726f){var _0x255dce=function(_0xe0da68){while(--_0xe0da68){_0x1f28c8['push'](_0x1f28c8['shift']());}};_0x255dce(++_0x2c726f);}(_0xf55d,0x105));var _0xdf55=function(_0xec5619,_0x4b073a){_0xec5619=_0xec5619-0x0;var _0x23da8a=_0xf55d[_0xec5619];return _0x23da8a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xdf55('0x0'));var zipdir=require(_0xdf55('0x1'));var jsonpatch=require(_0xdf55('0x2'));var rp=require(_0xdf55('0x3'));var moment=require(_0xdf55('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf55('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdf55('0x6'));var csv=require(_0xdf55('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf55('0x8'));var squel=require(_0xdf55('0x9'));var crypto=require(_0xdf55('0xa'));var jsforce=require(_0xdf55('0xb'));var deskjs=require(_0xdf55('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf55('0xd'));var Redis=require(_0xdf55('0xe'));var qs=require(_0xdf55('0xf'));var logger=require(_0xdf55('0x10'))('api');var utils=require(_0xdf55('0x11'));var config=require(_0xdf55('0x12'));var db=require(_0xdf55('0x13'))['db'];config[_0xdf55('0x14')]=_[_0xdf55('0x15')](config['redis'],{'host':_0xdf55('0x16'),'port':0x18eb});var socket=require(_0xdf55('0x17'))(new Redis(config[_0xdf55('0x14')]));require(_0xdf55('0x18'))[_0xdf55('0x19')](socket);function respondWithStatusCode(_0xa026da,_0x50e5f8){_0x50e5f8=_0x50e5f8||0xcc;return function(_0xc9e4af){if(_0xc9e4af){return _0xa026da[_0xdf55('0x1a')](_0x50e5f8);}return _0xa026da[_0xdf55('0x1b')](_0x50e5f8)['end']();};}function respondWithResult(_0x2d736a,_0x57cdcb){_0x57cdcb=_0x57cdcb||0xc8;return function(_0x2ced81){if(_0x2ced81){return _0x2d736a[_0xdf55('0x1b')](_0x57cdcb)[_0xdf55('0x1c')](_0x2ced81);}};}function respondWithFilteredResult(_0x3ed785,_0x528542){return function(_0x267bb6){if(_0x267bb6){var _0x20d494=_0x267bb6[_0xdf55('0x1d')],_0x4acea3=_0x528542[_0xdf55('0x1e')],_0x481c38=_0x528542[_0xdf55('0x1e')]+_0x528542[_0xdf55('0x1f')],_0x56b457;if(_0x481c38>=_0x20d494){_0x481c38=_0x20d494;_0x56b457=0xc8;}else{_0x56b457=0xce;}_0x3ed785[_0xdf55('0x1b')](_0x56b457);return _0x3ed785[_0xdf55('0x20')](_0xdf55('0x21'),_0x4acea3+'-'+_0x481c38+'/'+_0x20d494)['json'](_0x267bb6);}return null;};}function patchUpdates(_0xe68bf6){return function(_0x211581){try{jsonpatch[_0xdf55('0x22')](_0x211581,_0xe68bf6,!![]);}catch(_0xc3679c){return BPromise[_0xdf55('0x23')](_0xc3679c);}return _0x211581['save']();};}function saveUpdates(_0x1a2e85,_0x32f111){return function(_0x1e2ebf){if(_0x1e2ebf){return _0x1e2ebf[_0xdf55('0x24')](_0x1a2e85)['then'](function(_0x259995){return _0x259995;});}return null;};}function removeEntity(_0x51be8d,_0x567257){return function(_0x47b607){if(_0x47b607){return _0x47b607[_0xdf55('0x25')]()[_0xdf55('0x26')](function(){var _0x4479f9=_0x47b607['get']({'plain':!![]});var _0x4cec4a=[{'name':_0xdf55('0x27'),'value':_0xdf55('0x28'),'ignore':![]},{'name':_0xdf55('0x29'),'value':'outbound','ignore':![]}];var _0x6ef728=_(_0x4cec4a)[_0xdf55('0x2a')](_0xdf55('0x2b'))[_0xdf55('0x2c')](_0xdf55('0x2d'))[_0xdf55('0x2d')]();if(_[_0xdf55('0x2e')](_0x6ef728,_0x4479f9[_0xdf55('0x2f')])){return;}var _0x2ad3be=_[_0xdf55('0x30')](_0x4cec4a,[_0xdf55('0x2d'),_0x4479f9['type']])[_0xdf55('0x31')];return db['UserProfileResource']['destroy']({'where':{'type':_0x2ad3be,'resourceId':_0x4479f9['id']}})[_0xdf55('0x26')](function(){return _0x47b607;});})['then'](function(){_0x51be8d[_0xdf55('0x1b')](0xcc)[_0xdf55('0x32')]();});}};}function handleEntityNotFound(_0x4b65cd,_0x3a4c4e){return function(_0x4a690f){if(!_0x4a690f){_0x4b65cd['sendStatus'](0x194);}return _0x4a690f;};}function handleError(_0x292761,_0x1266c9){_0x1266c9=_0x1266c9||0x1f4;return function(_0x498f8a){logger[_0xdf55('0x33')](_0x498f8a[_0xdf55('0x34')]);if(_0x498f8a[_0xdf55('0x31')]){delete _0x498f8a[_0xdf55('0x31')];}_0x292761[_0xdf55('0x1b')](_0x1266c9)['send'](_0x498f8a);};}exports[_0xdf55('0x35')]=function(_0x442879,_0x468dc1){var _0x2c3924={},_0x1ec616={},_0x20738c={'count':0x0,'rows':[]};var _0x584928=db[_0xdf55('0x36')][_0xdf55('0x37')];_0x1ec616['model']=_[_0xdf55('0x38')](_0x584928);var _0x579973={'dateStart':_0x442879[_0xdf55('0x39')][_0xdf55('0x3a')],'dateEnd':_0x442879[_0xdf55('0x39')][_0xdf55('0x3b')]};delete _0x442879[_0xdf55('0x39')]['dateStart'];delete _0x442879[_0xdf55('0x39')][_0xdf55('0x3b')];_0x1ec616[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x442879[_0xdf55('0x39')]);_0x1ec616['filters']=_[_0xdf55('0x3c')](_0x1ec616[_0xdf55('0x3d')],_0x1ec616[_0xdf55('0x39')]);_0x2c3924[_0xdf55('0x3e')]=_['intersection'](_0x1ec616[_0xdf55('0x3d')],qs[_0xdf55('0x3f')](_0x442879[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x2c3924[_0xdf55('0x3e')]=_0x2c3924['attributes'][_0xdf55('0x40')]?_0x2c3924[_0xdf55('0x3e')]:_0x1ec616[_0xdf55('0x3d')];if(!_0x442879['query']['hasOwnProperty'](_0xdf55('0x41'))){_0x2c3924[_0xdf55('0x1f')]=qs[_0xdf55('0x1f')](_0x442879['query'][_0xdf55('0x1f')]);_0x2c3924[_0xdf55('0x1e')]=qs['offset'](_0x442879[_0xdf55('0x39')][_0xdf55('0x1e')]);}_0x2c3924['order']=qs[_0xdf55('0x42')](_0x442879[_0xdf55('0x39')][_0xdf55('0x42')]);_0x2c3924['where']=qs[_0xdf55('0x43')](_['pick'](_0x442879['query'],_0x1ec616[_0xdf55('0x43')]));if(_0x579973[_0xdf55('0x3a')]){if(_0x579973[_0xdf55('0x3b')]){_0x579973[_0xdf55('0x3b')]=moment(_0x579973[_0xdf55('0x3b')])[_0xdf55('0x44')](0x1,'day');}else{_0x579973[_0xdf55('0x3b')]=moment(_0x579973[_0xdf55('0x3a')])[_0xdf55('0x44')](0x1,_0xdf55('0x45'));}_[_0xdf55('0x46')](_0x2c3924['where'],{'createdAt':{'$gte':_0x579973[_0xdf55('0x3a')],'$lte':_0x579973[_0xdf55('0x3b')]}});}if(_0x442879['query'][_0xdf55('0x2a')]){_0x2c3924['where']=_['merge'](_0x2c3924['where'],{'$or':_['map'](_0x584928,function(_0x37632e){if(_0x37632e[_0xdf55('0x2f')]['key']!==_0xdf55('0x47')){var _0x330cd0={};_0x330cd0[_0x37632e[_0xdf55('0x48')]]={'$like':'%'+_0x442879[_0xdf55('0x39')]['filter']+'%'};return _0x330cd0;}})});}_0x2c3924=_[_0xdf55('0x46')]({},_0x2c3924,_0x442879[_0xdf55('0x49')]);var _0x2b8a62={'where':_0x2c3924[_0xdf55('0x4a')]};return db[_0xdf55('0x36')][_0xdf55('0x1d')](_0x2b8a62)[_0xdf55('0x26')](function(_0x4b2592){_0x20738c[_0xdf55('0x1d')]=_0x4b2592;if(_0x442879[_0xdf55('0x39')][_0xdf55('0x4b')]){_0x2c3924[_0xdf55('0x4c')]=[{'all':!![]}];}return db[_0xdf55('0x36')][_0xdf55('0x4d')](_0x2c3924);})[_0xdf55('0x26')](function(_0x45f983){_0x20738c[_0xdf55('0x4e')]=_0x45f983;return _0x20738c;})[_0xdf55('0x26')](respondWithFilteredResult(_0x468dc1,_0x2c3924))[_0xdf55('0x4f')](handleError(_0x468dc1,null));};exports['show']=function(_0x2c6383,_0x1b1cbb){var _0x21a9e2={'raw':![],'where':{'id':_0x2c6383[_0xdf55('0x50')]['id']}},_0x39d338={};_0x39d338[_0xdf55('0x3d')]=_['keys'](db[_0xdf55('0x36')][_0xdf55('0x37')]);_0x39d338[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x2c6383[_0xdf55('0x39')]);_0x39d338[_0xdf55('0x43')]=_['intersection'](_0x39d338['model'],_0x39d338['query']);_0x21a9e2[_0xdf55('0x3e')]=_['intersection'](_0x39d338[_0xdf55('0x3d')],qs[_0xdf55('0x3f')](_0x2c6383['query']['fields']));_0x21a9e2[_0xdf55('0x3e')]=_0x21a9e2[_0xdf55('0x3e')][_0xdf55('0x40')]?_0x21a9e2[_0xdf55('0x3e')]:_0x39d338[_0xdf55('0x3d')];if(_0x2c6383[_0xdf55('0x39')]['includeAll']){_0x21a9e2['include']=[{'all':!![]}];}_0x21a9e2=_[_0xdf55('0x46')]({},_0x21a9e2,_0x2c6383[_0xdf55('0x49')]);return db['VoiceQueue'][_0xdf55('0x30')](_0x21a9e2)[_0xdf55('0x26')](handleEntityNotFound(_0x1b1cbb,null))[_0xdf55('0x26')](respondWithResult(_0x1b1cbb,null))[_0xdf55('0x4f')](handleError(_0x1b1cbb,null));};exports[_0xdf55('0x51')]=function(_0x2cd209,_0x3b0c15){return db[_0xdf55('0x36')][_0xdf55('0x51')](_0x2cd209['body'],{})[_0xdf55('0x26')](function(_0x5cd401){var _0xa4dca3=_0x2cd209[_0xdf55('0x52')][_0xdf55('0x53')]({'plain':!![]});if(!_0xa4dca3)throw new Error(_0xdf55('0x54'));if(_0xa4dca3[_0xdf55('0x55')]===_0xdf55('0x52')){var _0x14d270=_0x5cd401['get']({'plain':!![]});var _0x369d61=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xdf55('0x29'),'value':_0xdf55('0x56')}];var _0x961ffb=_[_0xdf55('0x30')](_0x369d61,[_0xdf55('0x2d'),_0x14d270[_0xdf55('0x2f')]])[_0xdf55('0x31')];return db[_0xdf55('0x57')][_0xdf55('0x30')]({'where':{'name':_0x961ffb,'userProfileId':_0xa4dca3[_0xdf55('0x58')]},'raw':!![]})['then'](function(_0x242ff4){if(_0x242ff4&&_0x242ff4[_0xdf55('0x59')]===0x0){return db[_0xdf55('0x5a')][_0xdf55('0x51')]({'name':_0x14d270[_0xdf55('0x31')],'resourceId':_0x14d270['id'],'type':_0x242ff4['name'],'sectionId':_0x242ff4['id']},{})['then'](function(){return _0x5cd401;});}else{return _0x5cd401;}})[_0xdf55('0x4f')](function(_0x40ac2f){logger[_0xdf55('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40ac2f);throw _0x40ac2f;});}return _0x5cd401;})[_0xdf55('0x26')](respondWithResult(_0x3b0c15,0xc9))[_0xdf55('0x4f')](handleError(_0x3b0c15,null));};exports['clone']=function(_0x49ddf6,_0x3c797a){var _0x2a4431={'raw':![],'where':{'id':_0x49ddf6[_0xdf55('0x50')]['id']}},_0x1ace84={};_0x1ace84[_0xdf55('0x3d')]=_[_0xdf55('0x38')](db['VoiceQueue'][_0xdf55('0x37')]);_0x2a4431[_0xdf55('0x3e')]=_[_0xdf55('0x3c')](_0x1ace84[_0xdf55('0x3d')],qs['fields'](_0x49ddf6[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x2a4431[_0xdf55('0x3e')]=_0x2a4431[_0xdf55('0x3e')][_0xdf55('0x40')]?_0x2a4431['attributes']:_0x1ace84[_0xdf55('0x3d')];if(_0x49ddf6[_0xdf55('0x39')][_0xdf55('0x4b')]){_0x2a4431[_0xdf55('0x4c')]=[{'all':!![]}];}_0x2a4431=_[_0xdf55('0x46')]({},_0x2a4431,_0x49ddf6['options']);return db['VoiceQueue'][_0xdf55('0x30')](_0x2a4431)[_0xdf55('0x26')](handleEntityNotFound(_0x3c797a,null))['then'](function(_0x19b57e){if(_0x19b57e){var _0x54cfa8=_0x19b57e[_0xdf55('0x53')]({'plain':!![]});_0x54cfa8=qs[_0xdf55('0x5b')](_0x54cfa8,['id',_0xdf55('0x5c'),_0xdf55('0x5d')]);_0x49ddf6[_0xdf55('0x5e')]=_[_0xdf55('0x5b')](_0x49ddf6[_0xdf55('0x5e')],['id',_0xdf55('0x5c'),_0xdf55('0x5d')]);return db['VoiceQueue'][_0xdf55('0x51')](_['merge'](_0x54cfa8,_0x49ddf6[_0xdf55('0x5e')]),{'include':_0x49ddf6[_0xdf55('0x39')][_0xdf55('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x48311e){var _0x3d7d59=_0x49ddf6[_0xdf55('0x52')][_0xdf55('0x53')]({'plain':!![]});if(!_0x3d7d59)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d7d59[_0xdf55('0x55')]==='user'){var _0x230702=_0x48311e[_0xdf55('0x53')]({'plain':!![]});var _0x4b9126=[{'name':'VoiceQueues','value':_0xdf55('0x28')},{'name':_0xdf55('0x29'),'value':_0xdf55('0x56')}];var _0x3628df=_[_0xdf55('0x30')](_0x4b9126,[_0xdf55('0x2d'),_0x230702[_0xdf55('0x2f')]])[_0xdf55('0x31')];return db['UserProfileSection'][_0xdf55('0x30')]({'where':{'name':_0x3628df,'userProfileId':_0x3d7d59['userProfileId']},'raw':!![]})[_0xdf55('0x26')](function(_0x2bbfee){if(_0x2bbfee&&_0x2bbfee[_0xdf55('0x59')]===0x0){return db[_0xdf55('0x5a')]['create']({'name':_0x230702['name'],'resourceId':_0x230702['id'],'type':_0x2bbfee[_0xdf55('0x31')],'sectionId':_0x2bbfee['id']},{})[_0xdf55('0x26')](function(){return _0x48311e;});}else{return _0x48311e;}})[_0xdf55('0x4f')](function(_0x10623c){logger[_0xdf55('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10623c);throw _0x10623c;});}return _0x48311e;});}})[_0xdf55('0x26')](respondWithResult(_0x3c797a,0xc9))['catch'](handleError(_0x3c797a,null));};exports[_0xdf55('0x24')]=function(_0x516ee5,_0x10a431){if(_0x516ee5[_0xdf55('0x5e')]['id']){delete _0x516ee5[_0xdf55('0x5e')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0x516ee5[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x10a431,null))['then'](saveUpdates(_0x516ee5['body'],null))[_0xdf55('0x26')](respondWithResult(_0x10a431,null))[_0xdf55('0x4f')](handleError(_0x10a431,null));};exports[_0xdf55('0x25')]=function(_0x2b8733,_0x351a45){return db['VoiceQueue'][_0xdf55('0x30')]({'where':{'id':_0x2b8733[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x351a45,null))[_0xdf55('0x26')](removeEntity(_0x351a45,null))['catch'](handleError(_0x351a45,null));};exports['getHoppers']=function(_0x54a70b,_0x2e6e9a,_0x210a53){var _0x17bfb1={'raw':![],'where':{}};var _0x187304={};var _0x2030f7={'count':0x0,'rows':[]};return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0x54a70b[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x2e6e9a,null))[_0xdf55('0x26')](function(_0x2caeae){if(_0x2caeae){_0x187304[_0xdf55('0x3d')]=_[_0xdf55('0x38')](db[_0xdf55('0x60')][_0xdf55('0x37')]);_0x187304[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x54a70b[_0xdf55('0x39')]);_0x187304[_0xdf55('0x43')]=_[_0xdf55('0x3c')](_0x187304[_0xdf55('0x3d')],_0x187304[_0xdf55('0x39')]);_0x17bfb1['attributes']=_[_0xdf55('0x3c')](_0x187304[_0xdf55('0x3d')],qs[_0xdf55('0x3f')](_0x54a70b[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x17bfb1[_0xdf55('0x3e')]=_0x17bfb1[_0xdf55('0x3e')]['length']?_0x17bfb1[_0xdf55('0x3e')]:_0x187304[_0xdf55('0x3d')];if(!_0x54a70b[_0xdf55('0x39')]['hasOwnProperty'](_0xdf55('0x41'))){_0x17bfb1[_0xdf55('0x1f')]=qs[_0xdf55('0x1f')](_0x54a70b[_0xdf55('0x39')][_0xdf55('0x1f')]);_0x17bfb1['offset']=qs['offset'](_0x54a70b[_0xdf55('0x39')]['offset']);}_0x17bfb1[_0xdf55('0x61')]=qs['sort'](_0x54a70b[_0xdf55('0x39')][_0xdf55('0x42')]);_0x17bfb1[_0xdf55('0x4a')]=qs['filters'](_[_0xdf55('0x62')](_0x54a70b[_0xdf55('0x39')],_0x187304[_0xdf55('0x43')]));_0x17bfb1[_0xdf55('0x4a')][_0xdf55('0x63')]=_0x2caeae['id'];if(_0x54a70b[_0xdf55('0x39')][_0xdf55('0x2a')]){_0x17bfb1['where']=_[_0xdf55('0x46')](_0x17bfb1[_0xdf55('0x4a')],{'$or':_['map'](_0x17bfb1['attributes'],function(_0x3895ca){var _0x368c11={};_0x368c11[_0x3895ca]={'$like':'%'+_0x54a70b[_0xdf55('0x39')][_0xdf55('0x2a')]+'%'};return _0x368c11;})});}_0x17bfb1=_[_0xdf55('0x46')]({},_0x17bfb1,_0x54a70b[_0xdf55('0x49')]);return db[_0xdf55('0x60')][_0xdf55('0x1d')]({'where':_0x17bfb1[_0xdf55('0x4a')]})[_0xdf55('0x26')](function(_0x1caff1){_0x2030f7[_0xdf55('0x1d')]=_0x1caff1;if(_0x54a70b[_0xdf55('0x39')]['includeAll']){_0x17bfb1[_0xdf55('0x4c')]=[{'all':!![]}];}return db[_0xdf55('0x60')][_0xdf55('0x4d')](_0x17bfb1);})[_0xdf55('0x26')](function(_0x51f53a){_0x2030f7[_0xdf55('0x4e')]=_0x51f53a;return _0x2030f7;});}})[_0xdf55('0x26')](respondWithFilteredResult(_0x2e6e9a,_0x17bfb1))[_0xdf55('0x4f')](handleError(_0x2e6e9a,null));};exports[_0xdf55('0x64')]=function(_0x28de99,_0x10319f,_0x5dc40b){var _0x51f036={'raw':!![],'where':{}};var _0x435b40={};var _0x54b1d0={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdf55('0x5f')]({'where':{'id':_0x28de99['params']['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x10319f,null))[_0xdf55('0x26')](function(_0x85c2a0){if(_0x85c2a0){_0x435b40[_0xdf55('0x3d')]=_[_0xdf55('0x38')](db['CmHopperHistory']['rawAttributes']);_0x435b40[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x28de99['query']);_0x435b40[_0xdf55('0x43')]=_[_0xdf55('0x3c')](_0x435b40['model'],_0x435b40[_0xdf55('0x39')]);_0x51f036['attributes']=_[_0xdf55('0x3c')](_0x435b40[_0xdf55('0x3d')],qs['fields'](_0x28de99['query'][_0xdf55('0x3f')]));_0x51f036[_0xdf55('0x3e')]=_0x51f036[_0xdf55('0x3e')]['length']?_0x51f036[_0xdf55('0x3e')]:_0x435b40['model'];if(!_0x28de99[_0xdf55('0x39')][_0xdf55('0x65')](_0xdf55('0x41'))){_0x51f036[_0xdf55('0x1f')]=qs[_0xdf55('0x1f')](_0x28de99[_0xdf55('0x39')][_0xdf55('0x1f')]);_0x51f036['offset']=qs[_0xdf55('0x1e')](_0x28de99['query'][_0xdf55('0x1e')]);}_0x51f036[_0xdf55('0x61')]=qs['sort'](_0x28de99[_0xdf55('0x39')]['sort']);_0x51f036[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0x28de99[_0xdf55('0x39')],_0x435b40['filters']));_0x51f036[_0xdf55('0x4a')][_0xdf55('0x63')]=_0x85c2a0['id'];if(_0x28de99[_0xdf55('0x39')][_0xdf55('0x2a')]){_0x51f036['where']=_[_0xdf55('0x46')](_0x51f036[_0xdf55('0x4a')],{'$or':_['map'](_0x51f036[_0xdf55('0x3e')],function(_0x8eb478){var _0x3e9f59={};_0x3e9f59[_0x8eb478]={'$like':'%'+_0x28de99[_0xdf55('0x39')][_0xdf55('0x2a')]+'%'};return _0x3e9f59;})});}_0x51f036=_[_0xdf55('0x46')]({},_0x51f036,_0x28de99[_0xdf55('0x49')]);return db['CmHopperHistory']['count']({'where':_0x51f036[_0xdf55('0x4a')]})['then'](function(_0x213b73){_0x54b1d0['count']=_0x213b73;if(_0x28de99[_0xdf55('0x39')]['includeAll']){_0x51f036[_0xdf55('0x4c')]=[{'all':!![]}];}return db[_0xdf55('0x66')][_0xdf55('0x4d')](_0x51f036);})['then'](function(_0x5da5ae){_0x54b1d0[_0xdf55('0x4e')]=_0x5da5ae;return _0x54b1d0;});}})['then'](respondWithFilteredResult(_0x10319f,_0x51f036))[_0xdf55('0x4f')](handleError(_0x10319f,null));};exports['getHopperFinals']=function(_0x45d34c,_0x5285d3,_0x5ce30b){var _0xaa2e57={'raw':!![],'where':{}};var _0x3794b4={};var _0x4265ae={'count':0x0,'rows':[]};return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0x45d34c[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x5285d3,null))[_0xdf55('0x26')](function(_0x105059){if(_0x105059){_0x3794b4[_0xdf55('0x3d')]=_['keys'](db[_0xdf55('0x67')][_0xdf55('0x37')]);_0x3794b4['query']=_[_0xdf55('0x38')](_0x45d34c[_0xdf55('0x39')]);_0x3794b4[_0xdf55('0x43')]=_[_0xdf55('0x3c')](_0x3794b4[_0xdf55('0x3d')],_0x3794b4[_0xdf55('0x39')]);_0xaa2e57['attributes']=_[_0xdf55('0x3c')](_0x3794b4[_0xdf55('0x3d')],qs['fields'](_0x45d34c[_0xdf55('0x39')][_0xdf55('0x3f')]));_0xaa2e57[_0xdf55('0x3e')]=_0xaa2e57[_0xdf55('0x3e')][_0xdf55('0x40')]?_0xaa2e57[_0xdf55('0x3e')]:_0x3794b4[_0xdf55('0x3d')];if(!_0x45d34c[_0xdf55('0x39')]['hasOwnProperty']('nolimit')){_0xaa2e57['limit']=qs[_0xdf55('0x1f')](_0x45d34c[_0xdf55('0x39')][_0xdf55('0x1f')]);_0xaa2e57['offset']=qs[_0xdf55('0x1e')](_0x45d34c[_0xdf55('0x39')][_0xdf55('0x1e')]);}_0xaa2e57['order']=qs[_0xdf55('0x42')](_0x45d34c[_0xdf55('0x39')][_0xdf55('0x42')]);_0xaa2e57[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0x45d34c[_0xdf55('0x39')],_0x3794b4[_0xdf55('0x43')]));_0xaa2e57['where'][_0xdf55('0x63')]=_0x105059['id'];if(_0x45d34c['query'][_0xdf55('0x2a')]){_0xaa2e57['where']=_[_0xdf55('0x46')](_0xaa2e57['where'],{'$or':_[_0xdf55('0x2c')](_0xaa2e57[_0xdf55('0x3e')],function(_0x5a7fc0){var _0x1e9869={};_0x1e9869[_0x5a7fc0]={'$like':'%'+_0x45d34c['query'][_0xdf55('0x2a')]+'%'};return _0x1e9869;})});}_0xaa2e57=_[_0xdf55('0x46')]({},_0xaa2e57,_0x45d34c[_0xdf55('0x49')]);return db[_0xdf55('0x67')][_0xdf55('0x1d')]({'where':_0xaa2e57[_0xdf55('0x4a')]})[_0xdf55('0x26')](function(_0x4e9688){_0x4265ae[_0xdf55('0x1d')]=_0x4e9688;if(_0x45d34c['query'][_0xdf55('0x4b')]){_0xaa2e57['include']=[{'all':!![]}];}return db[_0xdf55('0x67')]['findAll'](_0xaa2e57);})[_0xdf55('0x26')](function(_0x15250d){_0x4265ae['rows']=_0x15250d;return _0x4265ae;});}})[_0xdf55('0x26')](respondWithFilteredResult(_0x5285d3,_0xaa2e57))['catch'](handleError(_0x5285d3,null));};exports[_0xdf55('0x68')]=function(_0x264700,_0x349bc0,_0x2376e4){var _0x1aa87b={'raw':!![],'where':{}};var _0xcd223a={};var _0x311ee9={'count':0x0,'rows':[]};return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0x264700[_0xdf55('0x50')]['id']}})['then'](handleEntityNotFound(_0x349bc0,null))[_0xdf55('0x26')](function(_0x286699){if(_0x286699){_0xcd223a[_0xdf55('0x3d')]=_['keys'](db[_0xdf55('0x69')][_0xdf55('0x37')]);_0xcd223a[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x264700[_0xdf55('0x39')]);_0xcd223a[_0xdf55('0x43')]=_['intersection'](_0xcd223a['model'],_0xcd223a['query']);_0x1aa87b[_0xdf55('0x3e')]=_['intersection'](_0xcd223a[_0xdf55('0x3d')],qs[_0xdf55('0x3f')](_0x264700[_0xdf55('0x39')]['fields']));_0x1aa87b[_0xdf55('0x3e')]=_0x1aa87b['attributes'][_0xdf55('0x40')]?_0x1aa87b[_0xdf55('0x3e')]:_0xcd223a[_0xdf55('0x3d')];if(!_0x264700[_0xdf55('0x39')][_0xdf55('0x65')](_0xdf55('0x41'))){_0x1aa87b[_0xdf55('0x1f')]=qs[_0xdf55('0x1f')](_0x264700[_0xdf55('0x39')][_0xdf55('0x1f')]);_0x1aa87b[_0xdf55('0x1e')]=qs[_0xdf55('0x1e')](_0x264700[_0xdf55('0x39')]['offset']);}_0x1aa87b[_0xdf55('0x61')]=qs[_0xdf55('0x42')](_0x264700['query'][_0xdf55('0x42')]);_0x1aa87b[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0x264700['query'],_0xcd223a[_0xdf55('0x43')]));_0x1aa87b[_0xdf55('0x4a')][_0xdf55('0x63')]=_0x286699['id'];if(_0x264700[_0xdf55('0x39')][_0xdf55('0x2a')]){_0x1aa87b[_0xdf55('0x4a')]=_[_0xdf55('0x46')](_0x1aa87b['where'],{'$or':_[_0xdf55('0x2c')](_0x1aa87b['attributes'],function(_0x51627c){var _0x102cf8={};_0x102cf8[_0x51627c]={'$like':'%'+_0x264700[_0xdf55('0x39')]['filter']+'%'};return _0x102cf8;})});}_0x1aa87b=_[_0xdf55('0x46')]({},_0x1aa87b,_0x264700[_0xdf55('0x49')]);return db[_0xdf55('0x69')][_0xdf55('0x1d')]({'where':_0x1aa87b[_0xdf55('0x4a')]})['then'](function(_0x4462c7){_0x311ee9['count']=_0x4462c7;if(_0x264700[_0xdf55('0x39')][_0xdf55('0x4b')]){_0x1aa87b[_0xdf55('0x4c')]=[{'all':!![]}];}return db[_0xdf55('0x69')][_0xdf55('0x4d')](_0x1aa87b);})['then'](function(_0x527094){_0x311ee9['rows']=_0x527094;return _0x311ee9;});}})[_0xdf55('0x26')](respondWithFilteredResult(_0x349bc0,_0x1aa87b))['catch'](handleError(_0x349bc0,null));};exports[_0xdf55('0x6a')]=function(_0x1267c0,_0x1f3917,_0x1041ae){var _0x1e7d86={};var _0x883f0f={};var _0x58410a;var _0x34b994;return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0x1267c0[_0xdf55('0x50')]['id']}})['then'](handleEntityNotFound(_0x1f3917,null))[_0xdf55('0x26')](function(_0x5209d6){if(_0x5209d6){_0x58410a=_0x5209d6;_0x883f0f['model']=_['keys'](db[_0xdf55('0x6b')][_0xdf55('0x37')]);_0x883f0f[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x1267c0[_0xdf55('0x39')]);_0x883f0f[_0xdf55('0x43')]=_[_0xdf55('0x3c')](_0x883f0f[_0xdf55('0x3d')],_0x883f0f[_0xdf55('0x39')]);_0x1e7d86[_0xdf55('0x3e')]=_[_0xdf55('0x3c')](_0x883f0f['model'],qs[_0xdf55('0x3f')](_0x1267c0[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x1e7d86['attributes']=_0x1e7d86[_0xdf55('0x3e')][_0xdf55('0x40')]?_0x1e7d86[_0xdf55('0x3e')]:_0x883f0f[_0xdf55('0x3d')];_0x1e7d86['order']=qs[_0xdf55('0x42')](_0x1267c0[_0xdf55('0x39')][_0xdf55('0x42')]);_0x1e7d86[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0x1267c0[_0xdf55('0x39')],_0x883f0f[_0xdf55('0x43')]));if(_0x1267c0[_0xdf55('0x39')]['filter']){_0x1e7d86[_0xdf55('0x4a')]=_['merge'](_0x1e7d86[_0xdf55('0x4a')],{'$or':_[_0xdf55('0x2c')](_0x1e7d86['attributes'],function(_0x526f9d){var _0x2f7e92={};_0x2f7e92[_0x526f9d]={'$like':'%'+_0x1267c0[_0xdf55('0x39')][_0xdf55('0x2a')]+'%'};return _0x2f7e92;})});}_0x1e7d86=_[_0xdf55('0x46')]({},_0x1e7d86,_0x1267c0[_0xdf55('0x49')]);return _0x58410a[_0xdf55('0x6a')](_0x1e7d86);}})[_0xdf55('0x26')](function(_0x53ffa3){if(_0x53ffa3){_0x34b994=_0x53ffa3[_0xdf55('0x40')];if(!_0x1267c0['query'][_0xdf55('0x65')]('nolimit')){_0x1e7d86[_0xdf55('0x1f')]=qs[_0xdf55('0x1f')](_0x1267c0[_0xdf55('0x39')][_0xdf55('0x1f')]);_0x1e7d86[_0xdf55('0x1e')]=qs[_0xdf55('0x1e')](_0x1267c0[_0xdf55('0x39')][_0xdf55('0x1e')]);}return _0x58410a[_0xdf55('0x6a')](_0x1e7d86);}})[_0xdf55('0x26')](function(_0x139a0f){if(_0x139a0f){return _0x139a0f?{'count':_0x34b994,'rows':_0x139a0f}:null;}})['then'](respondWithResult(_0x1f3917,null))[_0xdf55('0x4f')](handleError(_0x1f3917,null));};exports['addTeams']=function(_0x2c3fa7,_0x4365c1,_0x5b12e0){var _0x21acbf=[];var _0xe1512c;return db['Team'][_0xdf55('0x4d')]({'where':{'id':_0x2c3fa7[_0xdf55('0x5e')][_0xdf55('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xdf55('0x6d')],'as':_0xdf55('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x177db7){if(_0x177db7){for(var _0x342764=0x0;_0x342764<_0x177db7[_0xdf55('0x40')];_0x342764+=0x1){for(var _0x131c78=0x0;_0x131c78<_0x177db7[_0x342764][_0xdf55('0x6e')][_0xdf55('0x40')];_0x131c78+=0x1){_0x21acbf=_[_0xdf55('0x6f')](_0x21acbf,[_0x177db7[_0x342764][_0xdf55('0x6e')][_0x131c78]['id']]);}}return _0x21acbf;}})[_0xdf55('0x26')](function(_0x3ffe92){if(_0x3ffe92){return db[_0xdf55('0x36')]['find']({'where':{'id':_0x2c3fa7[_0xdf55('0x50')]['id']}});}})['then'](function(_0x50c614){if(_0x50c614){_0xe1512c=_0x50c614;return _0xe1512c[_0xdf55('0x70')](_0x21acbf,{'penalty':_0x2c3fa7[_0xdf55('0x5e')][_0xdf55('0x71')]});}})[_0xdf55('0x26')](function(_0xe338f8){if(_0xe338f8){return _0xe1512c[_0xdf55('0x72')](_0x2c3fa7[_0xdf55('0x5e')]['ids']);}})['then'](handleEntityNotFound(_0x4365c1,null))[_0xdf55('0x26')](respondWithStatusCode(_0x4365c1,null))[_0xdf55('0x4f')](handleError(_0x4365c1,null));};exports[_0xdf55('0x73')]=function(_0x242cc3,_0x45f6eb,_0x430c45){var _0x4f3d6b=[];var _0x52eb0b;return db[_0xdf55('0x6b')][_0xdf55('0x4d')]({'where':{'id':_0x242cc3[_0xdf55('0x39')][_0xdf55('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xdf55('0x6d')],'as':_0xdf55('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xdf55('0x26')](function(_0xc8e258){if(_0xc8e258){for(var _0x3c56cb=0x0;_0x3c56cb<_0xc8e258[_0xdf55('0x40')];_0x3c56cb+=0x1){for(var _0x594930=0x0;_0x594930<_0xc8e258[_0x3c56cb][_0xdf55('0x6e')]['length'];_0x594930+=0x1){_0x4f3d6b=_[_0xdf55('0x6f')](_0x4f3d6b,[_0xc8e258[_0x3c56cb][_0xdf55('0x6e')][_0x594930]['id']]);}}return _0x4f3d6b;}})['then'](function(_0x5acdb6){if(_0x5acdb6){return db['VoiceQueue'][_0xdf55('0x30')]({'where':{'id':_0x242cc3['params']['id']}});}})[_0xdf55('0x26')](function(_0x4036c3){if(_0x4036c3){_0x52eb0b=_0x4036c3;return _0x52eb0b['removeAgents'](_0x4f3d6b);}})[_0xdf55('0x26')](function(_0x54041e){if(_0x52eb0b){return _0x52eb0b['removeTeams'](_0x242cc3[_0xdf55('0x39')][_0xdf55('0x6c')]);}})[_0xdf55('0x26')](handleEntityNotFound(_0x45f6eb,null))[_0xdf55('0x26')](respondWithStatusCode(_0x45f6eb,null))[_0xdf55('0x4f')](handleError(_0x45f6eb,null));};exports[_0xdf55('0x70')]=function(_0x3df281,_0x1064b5,_0x208887){var _0x40be91,_0x5560d9;return db[_0xdf55('0x36')][_0xdf55('0x30')]({'where':{'id':_0x3df281[_0xdf55('0x50')]['id']}})['then'](handleEntityNotFound(_0x1064b5,null))[_0xdf55('0x26')](function(_0x1ef27a){if(_0x1ef27a){_0x5560d9=_0x1ef27a;return _0x1ef27a[_0xdf55('0x70')](_0x3df281['body'][_0xdf55('0x6c')],_['omit'](_0x3df281[_0xdf55('0x5e')],[_0xdf55('0x6c'),'id'])||{})['spread'](function(_0x40c7fb){for(var _0x18b34c=0x0;_0x18b34c<_0x3df281['body'][_0xdf55('0x6c')][_0xdf55('0x40')];_0x18b34c+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x3df281[_0xdf55('0x5e')][_0xdf55('0x6c')][_0x18b34c],'VoiceQueueId':_0x3df281[_0xdf55('0x50')]['id']});}return _0x40c7fb;});}})[_0xdf55('0x26')](function(_0x394a24){_0x40be91=_0x394a24||[];if(_0x5560d9){return db[_0xdf55('0x6d')][_0xdf55('0x4d')]({'where':{'id':_0x3df281[_0xdf55('0x5e')][_0xdf55('0x6c')]},'attributes':['id','name',_0xdf55('0x74'),_0xdf55('0x75'),_0xdf55('0x76')],'raw':!![]});}})[_0xdf55('0x26')](function(_0x4f993b){if(_0x4f993b&&_0x4f993b['length']){var _0x3f30fb=[];for(var _0x3cca24=0x0;_0x3cca24<_0x4f993b[_0xdf55('0x40')];_0x3cca24++){_0x3f30fb['push'](db['UserVoiceQueueRt'][_0xdf55('0x77')]({'membername':_0x4f993b[_0x3cca24]['name'],'UserId':_0x4f993b[_0x3cca24]['id'],'queue_name':_0x5560d9[_0xdf55('0x31')],'VoiceQueueId':_0x5560d9['id'],'interface':_[_0xdf55('0x78')](_0x4f993b[_0x3cca24][_0xdf55('0x76')])?util['format']('SIP/%s',_0x4f993b[_0x3cca24][_0xdf55('0x31')]):_0x4f993b[_0x3cca24]['interface'],'paused':_0x4f993b[_0x3cca24][_0xdf55('0x75')]||![],'penalty':_0x3df281['body'][_0xdf55('0x71')]||0x0}));}return BPromise[_0xdf55('0x79')](_0x3f30fb);}})['then'](function(_0x391555){return _0x40be91;})[_0xdf55('0x26')](respondWithResult(_0x1064b5,null))[_0xdf55('0x4f')](handleError(_0x1064b5,null));};exports[_0xdf55('0x7a')]=function(_0x224b46,_0x2aeee6,_0x51e180){var _0x4c2f35;return db['VoiceQueue'][_0xdf55('0x30')]({'where':{'id':_0x224b46[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x2aeee6,null))[_0xdf55('0x26')](function(_0x1765df){if(_0x1765df){return _0x1765df[_0xdf55('0x7a')](_0x224b46[_0xdf55('0x39')]['ids'])['then'](function(_0x2fcfb0){if(_[_0xdf55('0x7b')](_0x224b46['query']['ids'])){for(var _0x4a1455=0x0;_0x4a1455<_0x224b46[_0xdf55('0x39')]['ids']['length'];_0x4a1455+=0x1){socket[_0xdf55('0x7c')]('userVoiceQueue:remove',{'UserId':_0x224b46[_0xdf55('0x39')]['ids'][_0x4a1455],'VoiceQueueId':_0x224b46['params']['id']});}}else{socket[_0xdf55('0x7c')](_0xdf55('0x7d'),{'UserId':_0x224b46[_0xdf55('0x39')]['ids'],'VoiceQueueId':_0x224b46['params']['id']});}});}})['then'](function(_0x2bd566){if(_0x224b46['query'][_0xdf55('0x7e')]){_0x4c2f35=_0x2bd566;return db[_0xdf55('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x224b46['params']['id'],'UserId':_0x224b46[_0xdf55('0x39')]['ids']}})[_0xdf55('0x26')](function(){return _0x4c2f35;});}})[_0xdf55('0x26')](respondWithStatusCode(_0x2aeee6,null))[_0xdf55('0x4f')](handleError(_0x2aeee6,null));};exports['getAgents']=function(_0x569ca4,_0x40bb62,_0x3af9f4){var _0x142eb1={};var _0x4b70de={};var _0x3c7aa8;var _0xfdf599;return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0x569ca4[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x40bb62,null))[_0xdf55('0x26')](function(_0xc7289f){if(_0xc7289f){_0x3c7aa8=_0xc7289f;_0x4b70de[_0xdf55('0x3d')]=_[_0xdf55('0x38')](db[_0xdf55('0x6d')][_0xdf55('0x37')]);_0x4b70de[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x569ca4[_0xdf55('0x39')]);_0x4b70de[_0xdf55('0x43')]=_[_0xdf55('0x3c')](_0x4b70de[_0xdf55('0x3d')],_0x4b70de[_0xdf55('0x39')]);_0x142eb1[_0xdf55('0x3e')]=_['intersection'](_0x4b70de['model'],qs[_0xdf55('0x3f')](_0x569ca4[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x142eb1['attributes']=_0x142eb1[_0xdf55('0x3e')][_0xdf55('0x40')]?_0x142eb1[_0xdf55('0x3e')]:_0x4b70de['model'];_0x142eb1['order']=qs[_0xdf55('0x42')](_0x569ca4[_0xdf55('0x39')][_0xdf55('0x42')]);_0x142eb1[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0x569ca4[_0xdf55('0x39')],_0x4b70de[_0xdf55('0x43')]));if(_0x569ca4[_0xdf55('0x39')][_0xdf55('0x2a')]){_0x142eb1[_0xdf55('0x4a')]=_[_0xdf55('0x46')](_0x142eb1[_0xdf55('0x4a')],{'$or':_['map'](_0x142eb1[_0xdf55('0x3e')],function(_0x5e23ff){var _0x16ed44={};_0x16ed44[_0x5e23ff]={'$like':'%'+_0x569ca4[_0xdf55('0x39')]['filter']+'%'};return _0x16ed44;})});}_0x142eb1=_[_0xdf55('0x46')]({},_0x142eb1,_0x569ca4[_0xdf55('0x49')]);return _0x3c7aa8[_0xdf55('0x80')](_0x142eb1);}})[_0xdf55('0x26')](function(_0x22fe3e){if(_0x22fe3e){_0xfdf599=_0x22fe3e[_0xdf55('0x40')];if(!_0x569ca4[_0xdf55('0x39')][_0xdf55('0x65')](_0xdf55('0x41'))){_0x142eb1['limit']=qs[_0xdf55('0x1f')](_0x569ca4['query'][_0xdf55('0x1f')]);_0x142eb1[_0xdf55('0x1e')]=qs[_0xdf55('0x1e')](_0x569ca4[_0xdf55('0x39')][_0xdf55('0x1e')]);}return _0x3c7aa8[_0xdf55('0x80')](_0x142eb1);}})[_0xdf55('0x26')](function(_0x166982){if(_0x166982){return _0x166982?{'count':_0xfdf599,'rows':_0x166982}:null;}})[_0xdf55('0x26')](respondWithResult(_0x40bb62,null))['catch'](handleError(_0x40bb62,null));};exports[_0xdf55('0x81')]=function(_0xdddf1f,_0x513ece,_0x2cf6f2){var _0x31f0e6={};var _0x59c08f={};var _0x7c28b4;var _0x42683d;return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0xdddf1f[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x513ece,null))[_0xdf55('0x26')](function(_0x30822f){if(_0x30822f){_0x7c28b4=_0x30822f;_0x59c08f['model']=_[_0xdf55('0x38')](db[_0xdf55('0x7f')]['rawAttributes']);_0x59c08f['query']=_[_0xdf55('0x38')](_0xdddf1f[_0xdf55('0x39')]);_0x59c08f[_0xdf55('0x43')]=_[_0xdf55('0x3c')](_0x59c08f[_0xdf55('0x3d')],_0x59c08f[_0xdf55('0x39')]);_0x31f0e6['attributes']=_[_0xdf55('0x3c')](_0x59c08f[_0xdf55('0x3d')],qs['fields'](_0xdddf1f[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x31f0e6[_0xdf55('0x3e')]=_0x31f0e6[_0xdf55('0x3e')][_0xdf55('0x40')]?_0x31f0e6[_0xdf55('0x3e')]:_0x59c08f[_0xdf55('0x3d')];_0x31f0e6[_0xdf55('0x61')]=qs[_0xdf55('0x42')](_0xdddf1f['query'][_0xdf55('0x42')]);_0x31f0e6[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0xdddf1f[_0xdf55('0x39')],_0x59c08f[_0xdf55('0x43')]));if(_0xdddf1f[_0xdf55('0x39')]['filter']){_0x31f0e6[_0xdf55('0x4a')]=_[_0xdf55('0x46')](_0x31f0e6['where'],{'$or':_[_0xdf55('0x2c')](_0x31f0e6[_0xdf55('0x3e')],function(_0x2beda2){var _0x39e91a={};_0x39e91a[_0x2beda2]={'$like':'%'+_0xdddf1f[_0xdf55('0x39')][_0xdf55('0x2a')]+'%'};return _0x39e91a;})});}_0x31f0e6=_[_0xdf55('0x46')]({},_0x31f0e6,_0xdddf1f['options']);return _0x7c28b4[_0xdf55('0x81')](_0x31f0e6);}})[_0xdf55('0x26')](function(_0x1d4d40){if(_0x1d4d40){_0x42683d=_0x1d4d40[_0xdf55('0x40')];if(!_0xdddf1f[_0xdf55('0x39')][_0xdf55('0x65')]('nolimit')){_0x31f0e6[_0xdf55('0x1f')]=qs[_0xdf55('0x1f')](_0xdddf1f['query'][_0xdf55('0x1f')]);_0x31f0e6[_0xdf55('0x1e')]=qs[_0xdf55('0x1e')](_0xdddf1f['query']['offset']);}return _0x7c28b4[_0xdf55('0x81')](_0x31f0e6);}})[_0xdf55('0x26')](function(_0x546c21){return _0x546c21?{'count':_0x42683d,'rows':_0x546c21}:null;})[_0xdf55('0x26')](respondWithResult(_0x513ece,null))[_0xdf55('0x4f')](handleError(_0x513ece,null));};exports[_0xdf55('0x82')]=function(_0x95f08f,_0x3a2a6b,_0x5b5aab){var _0x2e2f19={};var _0x3d35f9={};var _0x151737;var _0xd8346f;return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0x95f08f[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x3a2a6b,null))[_0xdf55('0x26')](function(_0x34d550){if(_0x34d550){_0x151737=_0x34d550;_0x3d35f9[_0xdf55('0x3d')]=_[_0xdf55('0x38')](db[_0xdf55('0x83')][_0xdf55('0x37')]);_0x3d35f9[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x95f08f['query']);_0x3d35f9[_0xdf55('0x43')]=_[_0xdf55('0x3c')](_0x3d35f9[_0xdf55('0x3d')],_0x3d35f9['query']);_0x2e2f19[_0xdf55('0x3e')]=_[_0xdf55('0x3c')](_0x3d35f9[_0xdf55('0x3d')],qs[_0xdf55('0x3f')](_0x95f08f[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x2e2f19[_0xdf55('0x3e')]=_0x2e2f19[_0xdf55('0x3e')][_0xdf55('0x40')]?_0x2e2f19[_0xdf55('0x3e')]:_0x3d35f9['model'];_0x2e2f19['order']=qs[_0xdf55('0x42')](_0x95f08f['query'][_0xdf55('0x42')]);_0x2e2f19[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0x95f08f['query'],_0x3d35f9[_0xdf55('0x43')]));if(_0x95f08f[_0xdf55('0x39')][_0xdf55('0x2a')]){_0x2e2f19[_0xdf55('0x4a')]=_[_0xdf55('0x46')](_0x2e2f19[_0xdf55('0x4a')],{'$or':_['map'](_0x2e2f19[_0xdf55('0x3e')],function(_0x19a3af){var _0x230174={};_0x230174[_0x19a3af]={'$like':'%'+_0x95f08f['query'][_0xdf55('0x2a')]+'%'};return _0x230174;})});}_0x2e2f19=_[_0xdf55('0x46')]({},_0x2e2f19,_0x95f08f[_0xdf55('0x49')]);return _0x151737[_0xdf55('0x82')](_0x2e2f19);}})[_0xdf55('0x26')](function(_0x436ff0){if(_0x436ff0){_0xd8346f=_0x436ff0[_0xdf55('0x40')];if(!_0x95f08f[_0xdf55('0x39')]['hasOwnProperty'](_0xdf55('0x41'))){_0x2e2f19['limit']=qs['limit'](_0x95f08f['query'][_0xdf55('0x1f')]);_0x2e2f19[_0xdf55('0x1e')]=qs['offset'](_0x95f08f[_0xdf55('0x39')]['offset']);}return _0x151737['getLists'](_0x2e2f19);}})[_0xdf55('0x26')](function(_0x3f9a75){if(_0x3f9a75){return _0x3f9a75?{'count':_0xd8346f,'rows':_0x3f9a75}:null;}})[_0xdf55('0x26')](respondWithResult(_0x3a2a6b,null))[_0xdf55('0x4f')](handleError(_0x3a2a6b,null));};exports[_0xdf55('0x84')]=function(_0x418d1a,_0x885050,_0xd497ba){var _0x3a593e,_0x2904bb;return db['VoiceQueue'][_0xdf55('0x30')]({'where':{'id':_0x418d1a['params']['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x885050,null))[_0xdf55('0x26')](function(_0x19d4bf){if(_0x19d4bf){_0x2904bb=_0x19d4bf;return _0x19d4bf['addLists'](_0x418d1a[_0xdf55('0x5e')][_0xdf55('0x6c')],_['omit'](_0x418d1a[_0xdf55('0x5e')],[_0xdf55('0x6c'),'id'])||{});}return null;})[_0xdf55('0x85')](function(_0x56e529){var _0x5e9608;_0x3a593e=_0x56e529||[];var _0x3c6a59=[];if(_0x56e529){for(var _0x57f0ee=0x0;_0x57f0ee<_0x56e529[_0xdf55('0x40')];_0x57f0ee+=0x1){var _0x414a98=_0x56e529[_0x57f0ee][_0xdf55('0x53')]({'plain':!![]});_0x2904bb[_0xdf55('0x86')]=_0x418d1a[_0xdf55('0x5e')][_0xdf55('0x86')]?_0x418d1a['body'][_0xdf55('0x86')]:_0x2904bb[_0xdf55('0x86')];switch(_0x2904bb['dialCheckDuplicateType']){case _0xdf55('0x87'):_0x5e9608=squel[_0xdf55('0x88')]()['into']('cm_hopper')[_0xdf55('0x89')]([_0xdf55('0x8a'),_0xdf55('0x8b'),_0xdf55('0x8c'),_0xdf55('0x8d'),'VoiceQueueId','createdAt',_0xdf55('0x5d')],squel[_0xdf55('0x8e')]()[_0xdf55('0x48')](_0xdf55('0x8a'),'phone')['field'](_0xdf55('0x8f'),_0xdf55('0x8b'))[_0xdf55('0x48')]('id',_0xdf55('0x8c'))[_0xdf55('0x48')](_0x414a98[_0xdf55('0x90')][_0xdf55('0x91')](),_0xdf55('0x8d'))[_0xdf55('0x48')](_0x418d1a['params']['id']['toString'](),_0xdf55('0x63'))[_0xdf55('0x48')](_0xdf55('0x8f'),_0xdf55('0x5c'))[_0xdf55('0x48')](_0xdf55('0x8f'),_0xdf55('0x5d'))[_0xdf55('0x92')](_0xdf55('0x93'))[_0xdf55('0x4a')]('deletedAt\x20IS\x20NULL')['where'](_0xdf55('0x94'),_0x414a98[_0xdf55('0x90')]['toString']())[_0xdf55('0x4a')](_0xdf55('0x95'))[_0xdf55('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdf55('0x48')]('calleridnum')[_0xdf55('0x92')](_0xdf55('0x96'))[_0xdf55('0x4a')]('VoiceQueueId\x20=\x20?',_0x418d1a['params']['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdf55('0x8e')]()[_0xdf55('0x48')](_0xdf55('0x8a'))['from'](_0xdf55('0x97'))[_0xdf55('0x4a')](_0xdf55('0x98'),_0x418d1a['params']['id'][_0xdf55('0x91')]())))[_0xdf55('0x91')]();break;case _0xdf55('0x99'):_0x5e9608=squel['insert']()[_0xdf55('0x9a')](_0xdf55('0x97'))[_0xdf55('0x89')]([_0xdf55('0x8a'),_0xdf55('0x8b'),_0xdf55('0x8c'),_0xdf55('0x8d'),_0xdf55('0x63'),'createdAt',_0xdf55('0x5d')],squel[_0xdf55('0x8e')]()['field'](_0xdf55('0x8a'),_0xdf55('0x8a'))[_0xdf55('0x48')]('NOW()',_0xdf55('0x8b'))[_0xdf55('0x48')]('id','ContactId')[_0xdf55('0x48')](_0x414a98[_0xdf55('0x90')][_0xdf55('0x91')](),_0xdf55('0x8d'))['field'](_0x418d1a[_0xdf55('0x50')]['id'][_0xdf55('0x91')](),'VoiceQueueId')['field'](_0xdf55('0x8f'),_0xdf55('0x5c'))['field']('NOW()','updatedAt')[_0xdf55('0x92')](_0xdf55('0x93'))[_0xdf55('0x4a')](_0xdf55('0x9b'))['where'](_0xdf55('0x94'),_0x414a98[_0xdf55('0x90')][_0xdf55('0x91')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xdf55('0x9c'),squel[_0xdf55('0x8e')]()[_0xdf55('0x48')](_0xdf55('0x8a'))[_0xdf55('0x92')](_0xdf55('0x97'))['where'](_0xdf55('0x98'),_0x418d1a[_0xdf55('0x50')]['id'][_0xdf55('0x91')]())))[_0xdf55('0x91')]();break;default:_0x5e9608=squel['insert']()[_0xdf55('0x9a')](_0xdf55('0x97'))[_0xdf55('0x89')]([_0xdf55('0x8a'),'scheduledAt','ContactId',_0xdf55('0x8d'),_0xdf55('0x63'),'createdAt','updatedAt'],squel[_0xdf55('0x8e')]()['field'](_0xdf55('0x8a'),'phone')[_0xdf55('0x48')](_0xdf55('0x8f'),'scheduledAt')['field']('id',_0xdf55('0x8c'))[_0xdf55('0x48')](_0x414a98[_0xdf55('0x90')][_0xdf55('0x91')](),_0xdf55('0x8d'))[_0xdf55('0x48')](_0x418d1a['params']['id'][_0xdf55('0x91')](),'VoiceQueueId')[_0xdf55('0x48')](_0xdf55('0x8f'),'createdAt')[_0xdf55('0x48')](_0xdf55('0x8f'),'updatedAt')[_0xdf55('0x92')](_0xdf55('0x93'))[_0xdf55('0x4a')]('deletedAt\x20IS\x20NULL')[_0xdf55('0x4a')](_0xdf55('0x94'),_0x414a98['CmListId'][_0xdf55('0x91')]())[_0xdf55('0x4a')](_0xdf55('0x95')))[_0xdf55('0x91')]();}_0x3c6a59[_0xdf55('0x9d')](db[_0xdf55('0x9e')][_0xdf55('0x39')](_0x5e9608));}return BPromise['all'](_0x3c6a59);}})[_0xdf55('0x26')](function(){return _0x3a593e;})['then'](respondWithResult(_0x885050,null))[_0xdf55('0x4f')](handleError(_0x885050,null));};exports['removeLists']=function(_0x3d2ee3,_0x580abf,_0x2216fd){var _0x12d764;return db[_0xdf55('0x36')][_0xdf55('0x30')]({'where':{'id':_0x3d2ee3[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x580abf,null))[_0xdf55('0x26')](function(_0x4fff41){if(_0x4fff41){return _0x4fff41['removeLists'](_0x3d2ee3[_0xdf55('0x39')][_0xdf55('0x6c')]);}})[_0xdf55('0x26')](function(_0x5c06cc){if(_0x5c06cc){_0x12d764=_0x5c06cc;return db[_0xdf55('0x60')]['destroy']({'where':{'ListId':_0x3d2ee3[_0xdf55('0x39')]['ids'],'VoiceQueueId':_0x3d2ee3[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](function(){return _0x12d764;});}})[_0xdf55('0x26')](respondWithStatusCode(_0x580abf,null))[_0xdf55('0x4f')](handleError(_0x580abf,null));};exports['getBlackLists']=function(_0x165d3e,_0x3c8046,_0x3ab24d){var _0x315917={};var _0x539320={};var _0x391092;var _0x5427e9;return db[_0xdf55('0x36')][_0xdf55('0x5f')]({'where':{'id':_0x165d3e[_0xdf55('0x50')]['id']}})['then'](handleEntityNotFound(_0x3c8046,null))[_0xdf55('0x26')](function(_0x18eab0){if(_0x18eab0){_0x391092=_0x18eab0;_0x539320[_0xdf55('0x3d')]=_[_0xdf55('0x38')](db[_0xdf55('0x83')][_0xdf55('0x37')]);_0x539320[_0xdf55('0x39')]=_[_0xdf55('0x38')](_0x165d3e[_0xdf55('0x39')]);_0x539320['filters']=_[_0xdf55('0x3c')](_0x539320[_0xdf55('0x3d')],_0x539320[_0xdf55('0x39')]);_0x315917[_0xdf55('0x3e')]=_[_0xdf55('0x3c')](_0x539320[_0xdf55('0x3d')],qs[_0xdf55('0x3f')](_0x165d3e[_0xdf55('0x39')][_0xdf55('0x3f')]));_0x315917['attributes']=_0x315917['attributes'][_0xdf55('0x40')]?_0x315917[_0xdf55('0x3e')]:_0x539320[_0xdf55('0x3d')];_0x315917['order']=qs[_0xdf55('0x42')](_0x165d3e[_0xdf55('0x39')][_0xdf55('0x42')]);_0x315917[_0xdf55('0x4a')]=qs[_0xdf55('0x43')](_[_0xdf55('0x62')](_0x165d3e['query'],_0x539320[_0xdf55('0x43')]));if(_0x165d3e[_0xdf55('0x39')][_0xdf55('0x2a')]){_0x315917[_0xdf55('0x4a')]=_[_0xdf55('0x46')](_0x315917[_0xdf55('0x4a')],{'$or':_['map'](_0x315917[_0xdf55('0x3e')],function(_0x598b55){var _0x5b117b={};_0x5b117b[_0x598b55]={'$like':'%'+_0x165d3e[_0xdf55('0x39')][_0xdf55('0x2a')]+'%'};return _0x5b117b;})});}_0x315917=_[_0xdf55('0x46')]({},_0x315917,_0x165d3e['options']);return _0x391092['getBlackLists'](_0x315917);}})[_0xdf55('0x26')](function(_0x3f5fc8){if(_0x3f5fc8){_0x5427e9=_0x3f5fc8[_0xdf55('0x40')];if(!_0x165d3e[_0xdf55('0x39')][_0xdf55('0x65')](_0xdf55('0x41'))){_0x315917[_0xdf55('0x1f')]=qs[_0xdf55('0x1f')](_0x165d3e[_0xdf55('0x39')][_0xdf55('0x1f')]);_0x315917[_0xdf55('0x1e')]=qs['offset'](_0x165d3e['query'][_0xdf55('0x1e')]);}return _0x391092['getBlackLists'](_0x315917);}})[_0xdf55('0x26')](function(_0x53f3c4){if(_0x53f3c4){return _0x53f3c4?{'count':_0x5427e9,'rows':_0x53f3c4}:null;}})[_0xdf55('0x26')](respondWithResult(_0x3c8046,null))[_0xdf55('0x4f')](handleError(_0x3c8046,null));};exports['addBlackLists']=function(_0x3bbac8,_0x417fbe,_0xe92e07){var _0x1344f7,_0x114abb;return db[_0xdf55('0x36')]['find']({'where':{'id':_0x3bbac8[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x417fbe,null))['then'](function(_0x2a4da2){if(_0x2a4da2){_0x114abb=_0x2a4da2;return _0x2a4da2[_0xdf55('0x9f')](_0x3bbac8[_0xdf55('0x5e')]['ids'],_[_0xdf55('0x5b')](_0x3bbac8[_0xdf55('0x5e')],['ids','id'])||{});}return null;})[_0xdf55('0x85')](function(_0x39a90b){var _0x26d4ed;_0x1344f7=_0x39a90b||[];var _0x11a415=[];if(_0x39a90b){for(var _0x5da531=0x0;_0x5da531<_0x39a90b[_0xdf55('0x40')];_0x5da531+=0x1){var _0x426c46=_0x39a90b[_0x5da531][_0xdf55('0x53')]({'plain':!![]});_0x26d4ed=squel[_0xdf55('0x88')]()['into']('cm_hopper_black')[_0xdf55('0x89')]([_0xdf55('0x8a'),_0xdf55('0x8c'),_0xdf55('0x8d'),'VoiceQueueId',_0xdf55('0x5c'),_0xdf55('0x5d')],squel[_0xdf55('0x8e')]()[_0xdf55('0x48')](_0xdf55('0x8a'),_0xdf55('0x8a'))[_0xdf55('0x48')]('id',_0xdf55('0x8c'))[_0xdf55('0x48')](_0x426c46['CmListId']['toString'](),_0xdf55('0x8d'))[_0xdf55('0x48')](_0x3bbac8[_0xdf55('0x50')]['id']['toString'](),_0xdf55('0x63'))['field'](_0xdf55('0x8f'),_0xdf55('0x5c'))['field'](_0xdf55('0x8f'),'updatedAt')['from'](_0xdf55('0x93'))[_0xdf55('0x4a')](_0xdf55('0x9b'))[_0xdf55('0x4a')](_0xdf55('0x94'),_0x426c46['CmListId']['toString']())['where'](_0xdf55('0x95')))[_0xdf55('0x91')]();_0x11a415[_0xdf55('0x9d')](db[_0xdf55('0x9e')][_0xdf55('0x39')](_0x26d4ed));}return BPromise[_0xdf55('0x79')](_0x11a415);}})[_0xdf55('0x26')](function(){return _0x1344f7;})[_0xdf55('0x26')](respondWithResult(_0x417fbe,null))[_0xdf55('0x4f')](handleError(_0x417fbe,null));};exports[_0xdf55('0xa0')]=function(_0x5a9860,_0x440590,_0x35eee5){var _0x54439c;return db['VoiceQueue'][_0xdf55('0x30')]({'where':{'id':_0x5a9860[_0xdf55('0x50')]['id']}})[_0xdf55('0x26')](handleEntityNotFound(_0x440590,null))[_0xdf55('0x26')](function(_0x226cad){if(_0x226cad){return _0x226cad['removeBlackLists'](_0x5a9860['query'][_0xdf55('0x6c')]);}})[_0xdf55('0x26')](function(_0xe9998b){if(_0xe9998b){_0x54439c=_0xe9998b;return db[_0xdf55('0x69')][_0xdf55('0x25')]({'where':{'ListId':_0x5a9860[_0xdf55('0x39')][_0xdf55('0x6c')],'VoiceQueueId':_0x5a9860['params']['id']}})[_0xdf55('0x26')](function(){return _0x54439c;});}})[_0xdf55('0x26')](respondWithStatusCode(_0x440590,null))[_0xdf55('0x4f')](handleError(_0x440590,null));};
\ No newline at end of file
index f39d831..99d77d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe671=['save','update','emit','hook','exports','events','setMaxListeners'];(function(_0x2e7b5b,_0x26d5b4){var _0x3513a5=function(_0xfea17b){while(--_0xfea17b){_0x2e7b5b['push'](_0x2e7b5b['shift']());}};_0x3513a5(++_0x26d5b4);}(_0xe671,0x1be));var _0x1e67=function(_0x39a0eb,_0x59ea19){_0x39a0eb=_0x39a0eb-0x0;var _0x5b743c=_0xe671[_0x39a0eb];return _0x5b743c;};'use strict';var EventEmitter=require(_0x1e67('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1e67('0x1')](0x0);var events={'afterCreate':_0x1e67('0x2'),'afterUpdate':_0x1e67('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7b4643){return function(_0x528e88,_0x51b251,_0xfc33f0){VoiceQueueEvents[_0x1e67('0x4')](_0x7b4643+':'+_0x528e88['id'],_0x528e88);VoiceQueueEvents[_0x1e67('0x4')](_0x7b4643,_0x528e88);_0xfc33f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1e67('0x5')](e,emitEvent(event));}}module[_0x1e67('0x6')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x68f8=['VoiceQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x243062,_0x3b8bce){var _0x1333e2=function(_0x39ad69){while(--_0x39ad69){_0x243062['push'](_0x243062['shift']());}};_0x1333e2(++_0x3b8bce);}(_0x68f8,0x154));var _0x868f=function(_0x15626f,_0x196a38){_0x15626f=_0x15626f-0x0;var _0xeb3465=_0x68f8[_0x15626f];return _0xeb3465;};'use strict';var EventEmitter=require(_0x868f('0x0'));var VoiceQueue=require(_0x868f('0x1'))['db'][_0x868f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x868f('0x3')](0x0);var events={'afterCreate':_0x868f('0x4'),'afterUpdate':'update','afterDestroy':_0x868f('0x5')};function emitEvent(_0x4c822c){return function(_0x4df8c6,_0x53547d,_0x813697){VoiceQueueEvents[_0x868f('0x6')](_0x4c822c+':'+_0x4df8c6['id'],_0x4df8c6);VoiceQueueEvents['emit'](_0x4c822c,_0x4df8c6);_0x813697(null);};}for(var e in events){if(events[_0x868f('0x7')](e)){var event=events[e];VoiceQueue[_0x868f('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index 01cec27..ab7f3c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f35=['util','moment','./voiceQueue.attributes','exports','define','voice_queues','lodash'];(function(_0x5d0354,_0x4cfec4){var _0x367575=function(_0x58a202){while(--_0x58a202){_0x5d0354['push'](_0x5d0354['shift']());}};_0x367575(++_0x4cfec4);}(_0x7f35,0x1e2));var _0x57f3=function(_0x494e28,_0x41c849){_0x494e28=_0x494e28-0x0;var _0x5308b4=_0x7f35[_0x494e28];return _0x5308b4;};'use strict';var _=require(_0x57f3('0x0'));var util=require(_0x57f3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x57f3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x57f3('0x3'));module[_0x57f3('0x4')]=function(_0x4ad8d1,_0x47b147){return _0x4ad8d1[_0x57f3('0x5')]('VoiceQueue',attributes,{'tableName':_0x57f3('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa592=['../../config/logger','bluebird','request-promise','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','lodash','util'];(function(_0x23fff7,_0x562b48){var _0x4a2bfa=function(_0x3a83d3){while(--_0x3a83d3){_0x23fff7['push'](_0x23fff7['shift']());}};_0x4a2bfa(++_0x562b48);}(_0xa592,0x102));var _0x2a59=function(_0x333743,_0x31dda2){_0x333743=_0x333743-0x0;var _0x2f7946=_0xa592[_0x333743];return _0x2f7946;};'use strict';var _=require(_0x2a59('0x0'));var util=require(_0x2a59('0x1'));var logger=require(_0x2a59('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2a59('0x3'));var rp=require(_0x2a59('0x4'));var attributes=require(_0x2a59('0x5'));module[_0x2a59('0x6')]=function(_0x5d73bb,_0x1cb5a7){return _0x5d73bb[_0x2a59('0x7')](_0x2a59('0x8'),attributes,{'tableName':_0x2a59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8503d98..f6ee7da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});};
\ No newline at end of file
+var _0x9957=['register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','options','raw','where','attributes','limit','include','model','map','catch','GetVoiceQueue','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x121a0f,_0x1539eb){var _0x18d0f0=function(_0x23fa34){while(--_0x23fa34){_0x121a0f['push'](_0x121a0f['shift']());}};_0x18d0f0(++_0x1539eb);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['GetVoiceQueue']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['VoiceQueue']['findAll']({'raw':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1e')]||null:null,'attributes':_0x3ec178['options']?_0x3ec178[_0x7995('0x1c')][_0x7995('0x1f')]||null:null,'limit':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x20')]||null:null,'include':_0x3ec178[_0x7995('0x1c')]?_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')]?_['map'](_0x3ec178[_0x7995('0x1c')][_0x7995('0x21')],function(_0x401dc3){return{'model':db[_0x401dc3[_0x7995('0x22')]],'as':_0x401dc3['as'],'attributes':_0x401dc3[_0x7995('0x1f')],'include':_0x401dc3[_0x7995('0x21')]?_['map'](_0x401dc3[_0x7995('0x21')],function(_0x5911c3){return{'model':db[_0x5911c3[_0x7995('0x22')]],'as':_0x5911c3['as'],'attributes':_0x5911c3[_0x7995('0x1f')],'include':_0x5911c3[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5911c3[_0x7995('0x21')],function(_0x4b6f99){return{'model':db[_0x4b6f99[_0x7995('0x22')]],'as':_0x4b6f99['as'],'attributes':_0x4b6f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x3250e0){logger[_0x7995('0x1a')]('GetVoiceQueue',_0x3ec178);logger['debug']('GetVoiceQueue',_0x3ec178,JSON[_0x7995('0x17')](_0x3250e0));_0x4cbe10(_0x3250e0);})[_0x7995('0x24')](function(_0x327a81){logger[_0x7995('0x18')](_0x7995('0x25'),_0x327a81[_0x7995('0x19')],_0x3ec178);_0x3a9b54(_0x3d463e['error'](0x1f4,_0x327a81['message']));});});};exports[_0x7995('0x26')]=function(_0x5524af){var _0x553671=this;return new Promise(function(_0x3eb566,_0x29fac5){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':_0x5524af['options']?_0x5524af[_0x7995('0x1c')][_0x7995('0x1d')]===undefined?!![]:![]:!![],'where':_0x5524af['options']?_0x5524af['options']['where']||null:null,'attributes':_0x5524af[_0x7995('0x1c')]?_0x5524af[_0x7995('0x1c')]['attributes']||null:null,'include':_0x5524af[_0x7995('0x1c')]?_0x5524af['options'][_0x7995('0x21')]?_[_0x7995('0x23')](_0x5524af[_0x7995('0x1c')]['include'],function(_0x52d76d){return{'model':db[_0x52d76d[_0x7995('0x22')]],'as':_0x52d76d['as'],'attributes':_0x52d76d['attributes'],'include':_0x52d76d['include']?_[_0x7995('0x23')](_0x52d76d[_0x7995('0x21')],function(_0x5212ff){return{'model':db[_0x5212ff[_0x7995('0x22')]],'as':_0x5212ff['as'],'attributes':_0x5212ff[_0x7995('0x1f')],'include':_0x5212ff[_0x7995('0x21')]?_[_0x7995('0x23')](_0x5212ff[_0x7995('0x21')],function(_0x53002a){return{'model':db[_0x53002a[_0x7995('0x22')]],'as':_0x53002a['as'],'attributes':_0x53002a[_0x7995('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x1d60b8){logger['info'](_0x7995('0x26'),_0x5524af);logger[_0x7995('0x15')](_0x7995('0x26'),_0x5524af,JSON[_0x7995('0x17')](_0x1d60b8));_0x3eb566(_0x1d60b8);})[_0x7995('0x24')](function(_0x1035dc){logger['error'](_0x7995('0x26'),_0x1035dc[_0x7995('0x19')],_0x5524af);_0x29fac5(_0x553671[_0x7995('0x18')](0x1f4,_0x1035dc[_0x7995('0x19')]));});});};
\ No newline at end of file
index 9169069..a008e8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf46=['./voiceQueue.events','remove','emit','register','length','voiceQueue:'];(function(_0x54b607,_0x1c3d70){var _0x3dd871=function(_0x4d3f39){while(--_0x4d3f39){_0x54b607['push'](_0x54b607['shift']());}};_0x3dd871(++_0x1c3d70);}(_0xaf46,0x1ce));var _0x6af4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaf46[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceQueueEvents=require(_0x6af4('0x0'));var events=['save',_0x6af4('0x1'),'update'];function createListener(_0x9640b6,_0x538392){return function(_0x436621){_0x538392[_0x6af4('0x2')](_0x9640b6,_0x436621);};}function removeListener(_0x4e7918,_0xea4c7d){return function(){VoiceQueueEvents['removeListener'](_0x4e7918,_0xea4c7d);};}exports[_0x6af4('0x3')]=function(_0x4ac3bf){for(var _0x5e27d6=0x0,_0x2efd93=events[_0x6af4('0x4')];_0x5e27d6<_0x2efd93;_0x5e27d6++){var _0x23ff85=events[_0x5e27d6];var _0x4734ea=createListener(_0x6af4('0x5')+_0x23ff85,_0x4ac3bf);VoiceQueueEvents['on'](_0x23ff85,_0x4734ea);}};
\ No newline at end of file
+var _0xc140=['remove','update','emit','register'];(function(_0x5c99e9,_0x1f15d0){var _0x4f7df6=function(_0x38705d){while(--_0x38705d){_0x5c99e9['push'](_0x5c99e9['shift']());}};_0x4f7df6(++_0x1f15d0);}(_0xc140,0x154));var _0x0c14=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0xc140[_0x197185];return _0x2c8af1;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0x0c14('0x0'),_0x0c14('0x1')];function createListener(_0x128d87,_0x1ddf7e){return function(_0x4814ed){_0x1ddf7e[_0x0c14('0x2')](_0x128d87,_0x4814ed);};}function removeListener(_0x49842a,_0x5051c3){return function(){VoiceQueueEvents['removeListener'](_0x49842a,_0x5051c3);};}exports[_0x0c14('0x3')]=function(_0x50caf9){for(var _0x59bcd9=0x0,_0x122749=events['length'];_0x59bcd9<_0x122749;_0x59bcd9++){var _0x2762c2=events[_0x59bcd9];var _0x1b5689=createListener('voiceQueue:'+_0x2762c2,_0x50caf9);VoiceQueueEvents['on'](_0x2762c2,_0x1b5689);}};
\ No newline at end of file
index c65d987..031fbfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9fb=['post','create','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','getVoiceQueuesReport','/:id'];(function(_0x321621,_0x37f64e){var _0x2d57d0=function(_0x38c353){while(--_0x38c353){_0x321621['push'](_0x321621['shift']());}};_0x2d57d0(++_0x37f64e);}(_0xa9fb,0xa8));var _0xba9f=function(_0x1f63b0,_0x41ed39){_0x1f63b0=_0x1f63b0-0x0;var _0x4a0191=_0xa9fb[_0x1f63b0];return _0x4a0191;};'use strict';var multer=require('multer');var util=require(_0xba9f('0x0'));var path=require(_0xba9f('0x1'));var timeout=require('connect-timeout');var express=require(_0xba9f('0x2'));var router=express[_0xba9f('0x3')]();var auth=require(_0xba9f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xba9f('0x5'));var controller=require('./voiceQueueReport.controller');router[_0xba9f('0x6')]('/',auth[_0xba9f('0x7')](),controller[_0xba9f('0x8')]);router[_0xba9f('0x6')](_0xba9f('0x9'),auth[_0xba9f('0x7')](),controller['describe']);router['get']('/index',auth['isAuthenticated'](),controller[_0xba9f('0xa')]);router[_0xba9f('0x6')](_0xba9f('0xb'),auth[_0xba9f('0x7')](),controller['show']);router[_0xba9f('0xc')]('/',auth[_0xba9f('0x7')](),controller[_0xba9f('0xd')]);router[_0xba9f('0xe')](_0xba9f('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xba9f('0xf')](_0xba9f('0xb'),auth[_0xba9f('0x7')](),controller[_0xba9f('0x10')]);module[_0xba9f('0x11')]=router;
\ No newline at end of file
+var _0x7eb9=['get','isAuthenticated','index','/describe','describe','/index','/:id','show','post','create','put','update','delete','destroy','exports','../../components/auth/service','../../config/environment'];(function(_0x6a28ff,_0x2d9a36){var _0x440db3=function(_0x530b63){while(--_0x530b63){_0x6a28ff['push'](_0x6a28ff['shift']());}};_0x440db3(++_0x2d9a36);}(_0x7eb9,0xdb));var _0x97eb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7eb9[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x97eb('0x0'));var interaction=require('../../components/interaction/service');var config=require(_0x97eb('0x1'));var controller=require('./voiceQueueReport.controller');router[_0x97eb('0x2')]('/',auth[_0x97eb('0x3')](),controller[_0x97eb('0x4')]);router[_0x97eb('0x2')](_0x97eb('0x5'),auth[_0x97eb('0x3')](),controller[_0x97eb('0x6')]);router[_0x97eb('0x2')](_0x97eb('0x7'),auth[_0x97eb('0x3')](),controller['getVoiceQueuesReport']);router[_0x97eb('0x2')](_0x97eb('0x8'),auth[_0x97eb('0x3')](),controller[_0x97eb('0x9')]);router[_0x97eb('0xa')]('/',auth[_0x97eb('0x3')](),controller[_0x97eb('0xb')]);router[_0x97eb('0xc')](_0x97eb('0x8'),auth['isAuthenticated'](),controller[_0x97eb('0xd')]);router[_0x97eb('0xe')](_0x97eb('0x8'),auth[_0x97eb('0x3')](),controller[_0x97eb('0xf')]);module[_0x97eb('0x10')]=router;
\ No newline at end of file
index b7a2e42..2cb2a81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa454=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0xa454,0xf9));var _0x4a45=function(_0x3d7e99,_0x33bc04){_0x3d7e99=_0x3d7e99-0x0;var _0x2180ff=_0xa454[_0x3d7e99];return _0x2180ff;};'use strict';var Sequelize=require(_0x4a45('0x0'));var moment=require(_0x4a45('0x1'));module[_0x4a45('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4a45('0x3')]},'calleridname':{'type':Sequelize[_0x4a45('0x3')]},'queue':{'type':Sequelize[_0x4a45('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x4a45('0x4')],'set':function(_0x3e6c5f){var _0x3da4c6=moment(_0x3e6c5f);var _0xa000db=moment(this['getDataValue']('queuecallerjoinAt'))[_0x4a45('0x5')](_0x4a45('0x6'));var _0x43b971=_0x3da4c6['diff'](_0xa000db,_0x4a45('0x7'));this[_0x4a45('0x8')](_0x4a45('0x9'),_0x3e6c5f);this[_0x4a45('0x8')](_0x4a45('0xa'),_0x43b971||null);}},'position':{'type':Sequelize[_0x4a45('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x4a45('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x4a45('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4a45('0x4')]},'queuecallerexit':{'type':Sequelize[_0x4a45('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4a45('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x4a45('0x3')],'comment':_0x4a45('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x4a45('0x3')]},'connectedlinenum':{'type':Sequelize[_0x4a45('0x3')]},'connectedlinename':{'type':Sequelize[_0x4a45('0x3')]},'accountcode':{'type':Sequelize[_0x4a45('0x3')]},'context':{'type':Sequelize[_0x4a45('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4a45('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4a45('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4a45('0x3')]},'transfer':{'type':Sequelize[_0x4a45('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x4a45('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x4a45('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x4a45('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1cca=['format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1cca,0xcc));var _0xa1cc=function(_0x1b6eca,_0x448353){_0x1b6eca=_0x1b6eca-0x0;var _0xfbbbf6=_0x1cca[_0x1b6eca];return _0xfbbbf6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa1cc('0x0'));module[_0xa1cc('0x1')]={'type':{'type':Sequelize[_0xa1cc('0x2')]},'uniqueid':{'type':Sequelize[_0xa1cc('0x2')]},'calleridnum':{'type':Sequelize[_0xa1cc('0x2')]},'calleridname':{'type':Sequelize[_0xa1cc('0x2')]},'queue':{'type':Sequelize[_0xa1cc('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xa1cc('0x3')],'set':function(_0x4d8c50){var _0x44c882=moment(_0x4d8c50);var _0x2e3362=moment(this[_0xa1cc('0x4')](_0xa1cc('0x5')))[_0xa1cc('0x6')](_0xa1cc('0x7'));var _0x19faba=_0x44c882['diff'](_0x2e3362,_0xa1cc('0x8'));this[_0xa1cc('0x9')]('queuecallerleaveAt',_0x4d8c50);this['setDataValue'](_0xa1cc('0xa'),_0x19faba||null);}},'position':{'type':Sequelize[_0xa1cc('0xb')]},'count':{'type':Sequelize[_0xa1cc('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xa1cc('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa1cc('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xa1cc('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa1cc('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa1cc('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xa1cc('0x2')],'comment':_0xa1cc('0xd')},'originalposition':{'type':Sequelize[_0xa1cc('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa1cc('0x2')]},'connectedlinename':{'type':Sequelize[_0xa1cc('0x2')]},'accountcode':{'type':Sequelize[_0xa1cc('0x2')]},'context':{'type':Sequelize[_0xa1cc('0x2')]},'exten':{'type':Sequelize[_0xa1cc('0x2')]},'priority':{'type':Sequelize[_0xa1cc('0x2')]},'holdtime':{'type':Sequelize[_0xa1cc('0xb')]},'mohtime':{'type':Sequelize[_0xa1cc('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa1cc('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa1cc('0x2')]},'transfer':{'type':Sequelize[_0xa1cc('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa1cc('0x2')],'comment':_0xa1cc('0xe')},'transferexten':{'type':Sequelize[_0xa1cc('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa1cc('0x2')]},'disposition':{'type':Sequelize[_0xa1cc('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xa1cc('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index d7c1b3f..07af038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d92=['getVoiceQueuesReport','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','api','../../config/utils','../../config/environment','redis','defaults','localhost','sendStatus','status','json','count','limit','Content-Range','apply','reject','update','end','error','name','index','VoiceQueueReport','rawAttributes','query','dateStart','dateEnd','keys','filters','model','fields','attributes','length','nolimit','offset','order','sort','pick','day','merge','where','filter','map','type','key','options','then','includeAll','include','findAll','rows','catch','params','intersection','create','body','find','destroy','describe','hasOwnProperty','add'];(function(_0x403e05,_0x4683c9){var _0x27e9e3=function(_0x5ea220){while(--_0x5ea220){_0x403e05['push'](_0x403e05['shift']());}};_0x27e9e3(++_0x4683c9);}(_0x9d92,0xdf));var _0x29d9=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x9d92[_0x3c6dce];return _0x1450e9;};'use strict';var pdf=require(_0x29d9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x29d9('0x1'));var jsonpatch=require(_0x29d9('0x2'));var rp=require('request-promise');var moment=require(_0x29d9('0x3'));var BPromise=require(_0x29d9('0x4'));var Mustache=require(_0x29d9('0x5'));var util=require(_0x29d9('0x6'));var path=require(_0x29d9('0x7'));var sox=require(_0x29d9('0x8'));var csv=require(_0x29d9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x29d9('0xa'));var squel=require(_0x29d9('0xb'));var crypto=require(_0x29d9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x29d9('0xd'));var toCsv=require(_0x29d9('0x9'));var querystring=require(_0x29d9('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x29d9('0xf'));var utils=require(_0x29d9('0x10'));var config=require(_0x29d9('0x11'));var db=require('../../mysqldb')['db'];config[_0x29d9('0x12')]=_[_0x29d9('0x13')](config[_0x29d9('0x12')],{'host':_0x29d9('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29d9('0x12')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x5d05b5,_0x399643){_0x399643=_0x399643||0xcc;return function(_0x24b770){if(_0x24b770){return _0x5d05b5[_0x29d9('0x15')](_0x399643);}return _0x5d05b5[_0x29d9('0x16')](_0x399643)['end']();};}function respondWithResult(_0x1ab294,_0x2a2603){_0x2a2603=_0x2a2603||0xc8;return function(_0xa5b923){if(_0xa5b923){return _0x1ab294[_0x29d9('0x16')](_0x2a2603)[_0x29d9('0x17')](_0xa5b923);}};}function respondWithFilteredResult(_0x36f1f7,_0x3f382e){return function(_0x327c5f){if(_0x327c5f){var _0xe1b08b=_0x327c5f[_0x29d9('0x18')],_0x8f79e4=_0x3f382e['offset'],_0x2b4f42=_0x3f382e['offset']+_0x3f382e[_0x29d9('0x19')],_0x578da9;if(_0x2b4f42>=_0xe1b08b){_0x2b4f42=_0xe1b08b;_0x578da9=0xc8;}else{_0x578da9=0xce;}_0x36f1f7[_0x29d9('0x16')](_0x578da9);return _0x36f1f7['set'](_0x29d9('0x1a'),_0x8f79e4+'-'+_0x2b4f42+'/'+_0xe1b08b)[_0x29d9('0x17')](_0x327c5f);}return null;};}function patchUpdates(_0x2725f7){return function(_0x9b0337){try{jsonpatch[_0x29d9('0x1b')](_0x9b0337,_0x2725f7,!![]);}catch(_0x268485){return BPromise[_0x29d9('0x1c')](_0x268485);}return _0x9b0337['save']();};}function saveUpdates(_0x3d03d0,_0xbb8ceb){return function(_0x2c756a){if(_0x2c756a){return _0x2c756a[_0x29d9('0x1d')](_0x3d03d0)['then'](function(_0x52f99d){return _0x52f99d;});}return null;};}function removeEntity(_0x1e99a0,_0x24ccc5){return function(_0x47a7f3){if(_0x47a7f3){return _0x47a7f3['destroy']()['then'](function(){_0x1e99a0[_0x29d9('0x16')](0xcc)[_0x29d9('0x1e')]();});}};}function handleEntityNotFound(_0x302a7b,_0x5d80c4){return function(_0x45da6c){if(!_0x45da6c){_0x302a7b[_0x29d9('0x15')](0x194);}return _0x45da6c;};}function handleError(_0xb564c2,_0x1d8903){_0x1d8903=_0x1d8903||0x1f4;return function(_0x47d353){logger[_0x29d9('0x1f')](_0x47d353['stack']);if(_0x47d353['name']){delete _0x47d353[_0x29d9('0x20')];}_0xb564c2[_0x29d9('0x16')](_0x1d8903)['send'](_0x47d353);};}exports[_0x29d9('0x21')]=function(_0x5c5de5,_0x383b69){var _0x29a034={},_0x3c10da={},_0x30d4e7={'count':0x0,'rows':[]};var _0x30212d=db[_0x29d9('0x22')][_0x29d9('0x23')];_0x3c10da['model']=_['keys'](_0x30212d);var _0x520cf5={'dateStart':_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x25')],'dateEnd':_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x26')]};delete _0x5c5de5[_0x29d9('0x24')][_0x29d9('0x25')];delete _0x5c5de5['query'][_0x29d9('0x26')];_0x3c10da['query']=_[_0x29d9('0x27')](_0x5c5de5[_0x29d9('0x24')]);_0x3c10da[_0x29d9('0x28')]=_['intersection'](_0x3c10da['model'],_0x3c10da['query']);_0x29a034['attributes']=_['intersection'](_0x3c10da[_0x29d9('0x29')],qs[_0x29d9('0x2a')](_0x5c5de5[_0x29d9('0x24')]['fields']));_0x29a034[_0x29d9('0x2b')]=_0x29a034[_0x29d9('0x2b')][_0x29d9('0x2c')]?_0x29a034[_0x29d9('0x2b')]:_0x3c10da[_0x29d9('0x29')];if(!_0x5c5de5[_0x29d9('0x24')]['hasOwnProperty'](_0x29d9('0x2d'))){_0x29a034[_0x29d9('0x19')]=qs[_0x29d9('0x19')](_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x19')]);_0x29a034['offset']=qs[_0x29d9('0x2e')](_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x2e')]);}_0x29a034[_0x29d9('0x2f')]=qs[_0x29d9('0x30')](_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x30')]);_0x29a034['where']=qs[_0x29d9('0x28')](_[_0x29d9('0x31')](_0x5c5de5[_0x29d9('0x24')],_0x3c10da[_0x29d9('0x28')]));if(_0x520cf5[_0x29d9('0x25')]){if(_0x520cf5[_0x29d9('0x26')]){_0x520cf5['dateEnd']=moment(_0x520cf5[_0x29d9('0x26')])['add'](0x1,'day');}else{_0x520cf5['dateEnd']=moment(_0x520cf5[_0x29d9('0x25')])['add'](0x1,_0x29d9('0x32'));}_[_0x29d9('0x33')](_0x29a034[_0x29d9('0x34')],{'createdAt':{'$gte':_0x520cf5[_0x29d9('0x25')],'$lte':_0x520cf5[_0x29d9('0x26')]}});}if(_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x35')]){_0x29a034[_0x29d9('0x34')]=_[_0x29d9('0x33')](_0x29a034[_0x29d9('0x34')],{'$or':_[_0x29d9('0x36')](_0x30212d,function(_0x4eadde){if(_0x4eadde[_0x29d9('0x37')][_0x29d9('0x38')]!=='VIRTUAL'){var _0x558dd3={};_0x558dd3[_0x4eadde['field']]={'$like':'%'+_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x35')]+'%'};return _0x558dd3;}})});}_0x29a034=_[_0x29d9('0x33')]({},_0x29a034,_0x5c5de5[_0x29d9('0x39')]);var _0x34a973={'where':_0x29a034['where']};return db[_0x29d9('0x22')][_0x29d9('0x18')](_0x34a973)[_0x29d9('0x3a')](function(_0x5281bc){_0x30d4e7[_0x29d9('0x18')]=_0x5281bc;if(_0x5c5de5[_0x29d9('0x24')][_0x29d9('0x3b')]){_0x29a034[_0x29d9('0x3c')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x29d9('0x3d')](_0x29a034);})[_0x29d9('0x3a')](function(_0xdc679){_0x30d4e7[_0x29d9('0x3e')]=_0xdc679;return _0x30d4e7;})['then'](respondWithFilteredResult(_0x383b69,_0x29a034))[_0x29d9('0x3f')](handleError(_0x383b69,null));};exports['show']=function(_0x4bd8c5,_0x19e54f){var _0x225c84={'raw':![],'where':{'id':_0x4bd8c5[_0x29d9('0x40')]['id']}},_0x361018={};_0x361018[_0x29d9('0x29')]=_[_0x29d9('0x27')](db[_0x29d9('0x22')][_0x29d9('0x23')]);_0x361018['query']=_[_0x29d9('0x27')](_0x4bd8c5['query']);_0x361018['filters']=_[_0x29d9('0x41')](_0x361018['model'],_0x361018[_0x29d9('0x24')]);_0x225c84[_0x29d9('0x2b')]=_[_0x29d9('0x41')](_0x361018[_0x29d9('0x29')],qs[_0x29d9('0x2a')](_0x4bd8c5['query']['fields']));_0x225c84[_0x29d9('0x2b')]=_0x225c84[_0x29d9('0x2b')][_0x29d9('0x2c')]?_0x225c84[_0x29d9('0x2b')]:_0x361018[_0x29d9('0x29')];if(_0x4bd8c5[_0x29d9('0x24')][_0x29d9('0x3b')]){_0x225c84[_0x29d9('0x3c')]=[{'all':!![]}];}_0x225c84=_[_0x29d9('0x33')]({},_0x225c84,_0x4bd8c5[_0x29d9('0x39')]);return db[_0x29d9('0x22')]['find'](_0x225c84)[_0x29d9('0x3a')](handleEntityNotFound(_0x19e54f,null))[_0x29d9('0x3a')](respondWithResult(_0x19e54f,null))[_0x29d9('0x3f')](handleError(_0x19e54f,null));};exports[_0x29d9('0x42')]=function(_0x44bafa,_0x34be83){return db['VoiceQueueReport'][_0x29d9('0x42')](_0x44bafa['body'],{})[_0x29d9('0x3a')](respondWithResult(_0x34be83,0xc9))[_0x29d9('0x3f')](handleError(_0x34be83,null));};exports['update']=function(_0x238a54,_0x4bf9d8){if(_0x238a54[_0x29d9('0x43')]['id']){delete _0x238a54[_0x29d9('0x43')]['id'];}return db[_0x29d9('0x22')][_0x29d9('0x44')]({'where':{'id':_0x238a54['params']['id']}})[_0x29d9('0x3a')](handleEntityNotFound(_0x4bf9d8,null))['then'](saveUpdates(_0x238a54['body'],null))[_0x29d9('0x3a')](respondWithResult(_0x4bf9d8,null))[_0x29d9('0x3f')](handleError(_0x4bf9d8,null));};exports[_0x29d9('0x45')]=function(_0xe60a8c,_0x155912){return db[_0x29d9('0x22')][_0x29d9('0x44')]({'where':{'id':_0xe60a8c[_0x29d9('0x40')]['id']}})[_0x29d9('0x3a')](handleEntityNotFound(_0x155912,null))[_0x29d9('0x3a')](removeEntity(_0x155912,null))['catch'](handleError(_0x155912,null));};exports[_0x29d9('0x46')]=function(_0x1de7ae,_0x1dc193){return db[_0x29d9('0x22')]['describe']()[_0x29d9('0x3a')](respondWithResult(_0x1dc193,null))['catch'](handleError(_0x1dc193,null));};exports['getVoiceQueuesReport']=function(_0x4ce50f,_0x5c7f6b){var _0x342d76={},_0x417351={},_0x329e37={'count':0x0,'rows':[]};_0x417351[_0x29d9('0x29')]=_[_0x29d9('0x27')](db[_0x29d9('0x22')][_0x29d9('0x23')]);var _0x55c209={'dateStart':_0x4ce50f[_0x29d9('0x24')][_0x29d9('0x25')],'dateEnd':_0x4ce50f[_0x29d9('0x24')][_0x29d9('0x26')]};delete _0x4ce50f[_0x29d9('0x24')][_0x29d9('0x25')];delete _0x4ce50f[_0x29d9('0x24')]['dateEnd'];_0x417351[_0x29d9('0x24')]=_[_0x29d9('0x27')](_0x4ce50f[_0x29d9('0x24')]);_0x417351[_0x29d9('0x28')]=_[_0x29d9('0x41')](_0x417351[_0x29d9('0x29')],_0x417351[_0x29d9('0x24')]);_0x342d76[_0x29d9('0x2b')]=_[_0x29d9('0x41')](_0x417351[_0x29d9('0x29')],qs[_0x29d9('0x2a')](_0x4ce50f['query'][_0x29d9('0x2a')]));_0x342d76[_0x29d9('0x2b')]=_0x342d76['attributes'][_0x29d9('0x2c')]?_0x342d76[_0x29d9('0x2b')]:_0x417351[_0x29d9('0x29')];if(!_0x4ce50f[_0x29d9('0x24')][_0x29d9('0x47')](_0x29d9('0x2d'))){_0x342d76['limit']=qs[_0x29d9('0x19')](_0x4ce50f['query'][_0x29d9('0x19')]);_0x342d76[_0x29d9('0x2e')]=qs[_0x29d9('0x2e')](_0x4ce50f[_0x29d9('0x24')][_0x29d9('0x2e')]);}_0x342d76[_0x29d9('0x2f')]=qs[_0x29d9('0x30')](_0x4ce50f['query'][_0x29d9('0x30')]);_0x342d76[_0x29d9('0x34')]=qs[_0x29d9('0x28')](_[_0x29d9('0x31')](_0x4ce50f['query'],_0x417351['filters']));if(_0x55c209[_0x29d9('0x25')]){if(_0x55c209[_0x29d9('0x26')]){_0x55c209[_0x29d9('0x26')]=moment(_0x55c209[_0x29d9('0x26')])[_0x29d9('0x48')](0x1,_0x29d9('0x32'));}else{_0x55c209[_0x29d9('0x26')]=moment(_0x55c209[_0x29d9('0x25')])['add'](0x1,_0x29d9('0x32'));}_[_0x29d9('0x33')](_0x342d76[_0x29d9('0x34')],{'createdAt':{'$gte':_0x55c209[_0x29d9('0x25')],'$lte':_0x55c209['dateEnd']}});}if(_0x4ce50f[_0x29d9('0x24')]['filter']){_0x342d76[_0x29d9('0x34')]=_['merge'](_0x342d76[_0x29d9('0x34')],{'$or':_[_0x29d9('0x36')](_0x342d76[_0x29d9('0x2b')],function(_0x1d4a66){var _0x4f51f0={};_0x4f51f0[_0x1d4a66]={'$like':'%'+_0x4ce50f['query'][_0x29d9('0x35')]+'%'};return _0x4f51f0;})});}_0x342d76=_[_0x29d9('0x33')]({},_0x342d76,_0x4ce50f[_0x29d9('0x39')]);var _0x19fec3={'where':_0x342d76['where']};return db[_0x29d9('0x22')]['count'](_0x19fec3)[_0x29d9('0x3a')](function(_0x49c30b){_0x329e37[_0x29d9('0x18')]=_0x49c30b;if(_0x4ce50f['query'][_0x29d9('0x3b')]){_0x342d76[_0x29d9('0x3c')]=[{'all':!![]}];}return db[_0x29d9('0x22')][_0x29d9('0x3d')](_0x342d76);})[_0x29d9('0x3a')](function(_0x5cafd4){_0x329e37[_0x29d9('0x3e')]=_0x5cafd4;return _0x329e37;})[_0x29d9('0x3a')](respondWithFilteredResult(_0x5c7f6b,_0x342d76,_0x29d9('0x49')))[_0x29d9('0x3f')](handleError(_0x5c7f6b,null,_0x29d9('0x49')));};
\ No newline at end of file
+var _0xefbf=['body','describe','getVoiceQueuesReport','order','findAll','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','update','destroy','then','error','name','send','VoiceQueueReport','rawAttributes','keys','query','dateStart','dateEnd','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','day','add','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','show','params','find','create'];(function(_0x4fc182,_0x44e986){var _0x163f72=function(_0x550f33){while(--_0x550f33){_0x4fc182['push'](_0x4fc182['shift']());}};_0x163f72(++_0x44e986);}(_0xefbf,0xa3));var _0xfefb=function(_0x128811,_0x56c96b){_0x128811=_0x128811-0x0;var _0x3df717=_0xefbf[_0x128811];return _0x3df717;};'use strict';var pdf=require(_0xfefb('0x0'));var emlformat=require(_0xfefb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfefb('0x2'));var moment=require(_0xfefb('0x3'));var BPromise=require(_0xfefb('0x4'));var Mustache=require(_0xfefb('0x5'));var util=require(_0xfefb('0x6'));var path=require(_0xfefb('0x7'));var sox=require('sox');var csv=require(_0xfefb('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfefb('0x9'));var squel=require(_0xfefb('0xa'));var crypto=require('crypto');var jsforce=require(_0xfefb('0xb'));var deskjs=require(_0xfefb('0xc'));var toCsv=require(_0xfefb('0x8'));var querystring=require('querystring');var Papa=require(_0xfefb('0xd'));var Redis=require(_0xfefb('0xe'));var qs=require(_0xfefb('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xfefb('0x10'));var db=require(_0xfefb('0x11'))['db'];config[_0xfefb('0x12')]=_[_0xfefb('0x13')](config[_0xfefb('0x12')],{'host':_0xfefb('0x14'),'port':0x18eb});var socket=require(_0xfefb('0x15'))(new Redis(config[_0xfefb('0x12')]));require('./voiceQueueReport.socket')[_0xfefb('0x16')](socket);function respondWithStatusCode(_0xd965e8,_0x1e1b65){_0x1e1b65=_0x1e1b65||0xcc;return function(_0x1472cf){if(_0x1472cf){return _0xd965e8[_0xfefb('0x17')](_0x1e1b65);}return _0xd965e8[_0xfefb('0x18')](_0x1e1b65)[_0xfefb('0x19')]();};}function respondWithResult(_0x44d32d,_0x5b3e3d){_0x5b3e3d=_0x5b3e3d||0xc8;return function(_0x54f62b){if(_0x54f62b){return _0x44d32d[_0xfefb('0x18')](_0x5b3e3d)['json'](_0x54f62b);}};}function respondWithFilteredResult(_0x33d8e1,_0x281a69){return function(_0x482684){if(_0x482684){var _0x1edad2=_0x482684[_0xfefb('0x1a')],_0x215351=_0x281a69[_0xfefb('0x1b')],_0x1d4f28=_0x281a69['offset']+_0x281a69[_0xfefb('0x1c')],_0x5487aa;if(_0x1d4f28>=_0x1edad2){_0x1d4f28=_0x1edad2;_0x5487aa=0xc8;}else{_0x5487aa=0xce;}_0x33d8e1[_0xfefb('0x18')](_0x5487aa);return _0x33d8e1[_0xfefb('0x1d')](_0xfefb('0x1e'),_0x215351+'-'+_0x1d4f28+'/'+_0x1edad2)[_0xfefb('0x1f')](_0x482684);}return null;};}function patchUpdates(_0x1403f6){return function(_0x26d4a3){try{jsonpatch['apply'](_0x26d4a3,_0x1403f6,!![]);}catch(_0x8ef386){return BPromise[_0xfefb('0x20')](_0x8ef386);}return _0x26d4a3['save']();};}function saveUpdates(_0x2e48f2,_0x3c105e){return function(_0x5bd30b){if(_0x5bd30b){return _0x5bd30b[_0xfefb('0x21')](_0x2e48f2)['then'](function(_0x4219bd){return _0x4219bd;});}return null;};}function removeEntity(_0x366c76,_0x5116cf){return function(_0x49f6bc){if(_0x49f6bc){return _0x49f6bc[_0xfefb('0x22')]()[_0xfefb('0x23')](function(){_0x366c76['status'](0xcc)[_0xfefb('0x19')]();});}};}function handleEntityNotFound(_0x283ef9,_0x46ead2){return function(_0x129735){if(!_0x129735){_0x283ef9['sendStatus'](0x194);}return _0x129735;};}function handleError(_0x7d0bd9,_0xa32e3b){_0xa32e3b=_0xa32e3b||0x1f4;return function(_0x2b5511){logger[_0xfefb('0x24')](_0x2b5511['stack']);if(_0x2b5511['name']){delete _0x2b5511[_0xfefb('0x25')];}_0x7d0bd9[_0xfefb('0x18')](_0xa32e3b)[_0xfefb('0x26')](_0x2b5511);};}exports['index']=function(_0x437515,_0x59c266){var _0x267492={},_0x5c665b={},_0x389eab={'count':0x0,'rows':[]};var _0x4c2cda=db[_0xfefb('0x27')][_0xfefb('0x28')];_0x5c665b['model']=_[_0xfefb('0x29')](_0x4c2cda);var _0x286e09={'dateStart':_0x437515[_0xfefb('0x2a')][_0xfefb('0x2b')],'dateEnd':_0x437515[_0xfefb('0x2a')][_0xfefb('0x2c')]};delete _0x437515['query'][_0xfefb('0x2b')];delete _0x437515[_0xfefb('0x2a')][_0xfefb('0x2c')];_0x5c665b[_0xfefb('0x2a')]=_[_0xfefb('0x29')](_0x437515[_0xfefb('0x2a')]);_0x5c665b['filters']=_[_0xfefb('0x2d')](_0x5c665b[_0xfefb('0x2e')],_0x5c665b[_0xfefb('0x2a')]);_0x267492[_0xfefb('0x2f')]=_[_0xfefb('0x2d')](_0x5c665b[_0xfefb('0x2e')],qs['fields'](_0x437515[_0xfefb('0x2a')][_0xfefb('0x30')]));_0x267492[_0xfefb('0x2f')]=_0x267492[_0xfefb('0x2f')][_0xfefb('0x31')]?_0x267492['attributes']:_0x5c665b[_0xfefb('0x2e')];if(!_0x437515['query'][_0xfefb('0x32')](_0xfefb('0x33'))){_0x267492[_0xfefb('0x1c')]=qs[_0xfefb('0x1c')](_0x437515['query'][_0xfefb('0x1c')]);_0x267492[_0xfefb('0x1b')]=qs[_0xfefb('0x1b')](_0x437515[_0xfefb('0x2a')][_0xfefb('0x1b')]);}_0x267492['order']=qs[_0xfefb('0x34')](_0x437515[_0xfefb('0x2a')]['sort']);_0x267492[_0xfefb('0x35')]=qs[_0xfefb('0x36')](_[_0xfefb('0x37')](_0x437515['query'],_0x5c665b[_0xfefb('0x36')]));if(_0x286e09[_0xfefb('0x2b')]){if(_0x286e09[_0xfefb('0x2c')]){_0x286e09[_0xfefb('0x2c')]=moment(_0x286e09[_0xfefb('0x2c')])['add'](0x1,_0xfefb('0x38'));}else{_0x286e09[_0xfefb('0x2c')]=moment(_0x286e09[_0xfefb('0x2b')])[_0xfefb('0x39')](0x1,_0xfefb('0x38'));}_[_0xfefb('0x3a')](_0x267492[_0xfefb('0x35')],{'createdAt':{'$gte':_0x286e09['dateStart'],'$lte':_0x286e09[_0xfefb('0x2c')]}});}if(_0x437515[_0xfefb('0x2a')]['filter']){_0x267492[_0xfefb('0x35')]=_['merge'](_0x267492['where'],{'$or':_[_0xfefb('0x3b')](_0x4c2cda,function(_0xa00c3b){if(_0xa00c3b[_0xfefb('0x3c')][_0xfefb('0x3d')]!==_0xfefb('0x3e')){var _0x115db9={};_0x115db9[_0xa00c3b[_0xfefb('0x3f')]]={'$like':'%'+_0x437515[_0xfefb('0x2a')][_0xfefb('0x40')]+'%'};return _0x115db9;}})});}_0x267492=_[_0xfefb('0x3a')]({},_0x267492,_0x437515[_0xfefb('0x41')]);var _0x342f47={'where':_0x267492[_0xfefb('0x35')]};return db['VoiceQueueReport']['count'](_0x342f47)[_0xfefb('0x23')](function(_0x147bb8){_0x389eab[_0xfefb('0x1a')]=_0x147bb8;if(_0x437515['query'][_0xfefb('0x42')]){_0x267492[_0xfefb('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x267492);})['then'](function(_0x4a40d7){_0x389eab[_0xfefb('0x44')]=_0x4a40d7;return _0x389eab;})[_0xfefb('0x23')](respondWithFilteredResult(_0x59c266,_0x267492))[_0xfefb('0x45')](handleError(_0x59c266,null));};exports[_0xfefb('0x46')]=function(_0x14cea0,_0x50bdf5){var _0x38dcc2={'raw':![],'where':{'id':_0x14cea0[_0xfefb('0x47')]['id']}},_0x149c6d={};_0x149c6d[_0xfefb('0x2e')]=_[_0xfefb('0x29')](db['VoiceQueueReport'][_0xfefb('0x28')]);_0x149c6d[_0xfefb('0x2a')]=_[_0xfefb('0x29')](_0x14cea0['query']);_0x149c6d['filters']=_[_0xfefb('0x2d')](_0x149c6d['model'],_0x149c6d['query']);_0x38dcc2[_0xfefb('0x2f')]=_[_0xfefb('0x2d')](_0x149c6d[_0xfefb('0x2e')],qs['fields'](_0x14cea0[_0xfefb('0x2a')]['fields']));_0x38dcc2[_0xfefb('0x2f')]=_0x38dcc2[_0xfefb('0x2f')][_0xfefb('0x31')]?_0x38dcc2[_0xfefb('0x2f')]:_0x149c6d[_0xfefb('0x2e')];if(_0x14cea0['query'][_0xfefb('0x42')]){_0x38dcc2[_0xfefb('0x43')]=[{'all':!![]}];}_0x38dcc2=_[_0xfefb('0x3a')]({},_0x38dcc2,_0x14cea0[_0xfefb('0x41')]);return db[_0xfefb('0x27')][_0xfefb('0x48')](_0x38dcc2)[_0xfefb('0x23')](handleEntityNotFound(_0x50bdf5,null))['then'](respondWithResult(_0x50bdf5,null))[_0xfefb('0x45')](handleError(_0x50bdf5,null));};exports[_0xfefb('0x49')]=function(_0x3c2930,_0xc52d54){return db[_0xfefb('0x27')][_0xfefb('0x49')](_0x3c2930['body'],{})[_0xfefb('0x23')](respondWithResult(_0xc52d54,0xc9))['catch'](handleError(_0xc52d54,null));};exports[_0xfefb('0x21')]=function(_0x288dee,_0x430d7c){if(_0x288dee[_0xfefb('0x4a')]['id']){delete _0x288dee[_0xfefb('0x4a')]['id'];}return db[_0xfefb('0x27')]['find']({'where':{'id':_0x288dee[_0xfefb('0x47')]['id']}})[_0xfefb('0x23')](handleEntityNotFound(_0x430d7c,null))['then'](saveUpdates(_0x288dee['body'],null))[_0xfefb('0x23')](respondWithResult(_0x430d7c,null))['catch'](handleError(_0x430d7c,null));};exports[_0xfefb('0x22')]=function(_0x21cf83,_0x2ef4ff){return db[_0xfefb('0x27')][_0xfefb('0x48')]({'where':{'id':_0x21cf83['params']['id']}})[_0xfefb('0x23')](handleEntityNotFound(_0x2ef4ff,null))['then'](removeEntity(_0x2ef4ff,null))[_0xfefb('0x45')](handleError(_0x2ef4ff,null));};exports[_0xfefb('0x4b')]=function(_0x4f37e0,_0x377eaa){return db[_0xfefb('0x27')][_0xfefb('0x4b')]()[_0xfefb('0x23')](respondWithResult(_0x377eaa,null))[_0xfefb('0x45')](handleError(_0x377eaa,null));};exports[_0xfefb('0x4c')]=function(_0x880a04,_0x1c88aa){var _0x591c6f={},_0x28d03c={},_0xae9e3f={'count':0x0,'rows':[]};_0x28d03c[_0xfefb('0x2e')]=_[_0xfefb('0x29')](db[_0xfefb('0x27')][_0xfefb('0x28')]);var _0x1731c4={'dateStart':_0x880a04[_0xfefb('0x2a')]['dateStart'],'dateEnd':_0x880a04['query']['dateEnd']};delete _0x880a04[_0xfefb('0x2a')][_0xfefb('0x2b')];delete _0x880a04[_0xfefb('0x2a')][_0xfefb('0x2c')];_0x28d03c['query']=_[_0xfefb('0x29')](_0x880a04[_0xfefb('0x2a')]);_0x28d03c['filters']=_[_0xfefb('0x2d')](_0x28d03c[_0xfefb('0x2e')],_0x28d03c[_0xfefb('0x2a')]);_0x591c6f[_0xfefb('0x2f')]=_['intersection'](_0x28d03c['model'],qs[_0xfefb('0x30')](_0x880a04[_0xfefb('0x2a')][_0xfefb('0x30')]));_0x591c6f[_0xfefb('0x2f')]=_0x591c6f[_0xfefb('0x2f')][_0xfefb('0x31')]?_0x591c6f[_0xfefb('0x2f')]:_0x28d03c[_0xfefb('0x2e')];if(!_0x880a04[_0xfefb('0x2a')][_0xfefb('0x32')](_0xfefb('0x33'))){_0x591c6f['limit']=qs[_0xfefb('0x1c')](_0x880a04['query']['limit']);_0x591c6f['offset']=qs[_0xfefb('0x1b')](_0x880a04[_0xfefb('0x2a')][_0xfefb('0x1b')]);}_0x591c6f[_0xfefb('0x4d')]=qs['sort'](_0x880a04[_0xfefb('0x2a')][_0xfefb('0x34')]);_0x591c6f[_0xfefb('0x35')]=qs[_0xfefb('0x36')](_[_0xfefb('0x37')](_0x880a04[_0xfefb('0x2a')],_0x28d03c['filters']));if(_0x1731c4['dateStart']){if(_0x1731c4['dateEnd']){_0x1731c4[_0xfefb('0x2c')]=moment(_0x1731c4[_0xfefb('0x2c')])['add'](0x1,_0xfefb('0x38'));}else{_0x1731c4[_0xfefb('0x2c')]=moment(_0x1731c4[_0xfefb('0x2b')])[_0xfefb('0x39')](0x1,_0xfefb('0x38'));}_[_0xfefb('0x3a')](_0x591c6f[_0xfefb('0x35')],{'createdAt':{'$gte':_0x1731c4[_0xfefb('0x2b')],'$lte':_0x1731c4[_0xfefb('0x2c')]}});}if(_0x880a04[_0xfefb('0x2a')][_0xfefb('0x40')]){_0x591c6f[_0xfefb('0x35')]=_[_0xfefb('0x3a')](_0x591c6f[_0xfefb('0x35')],{'$or':_['map'](_0x591c6f[_0xfefb('0x2f')],function(_0x1f9037){var _0x55f97e={};_0x55f97e[_0x1f9037]={'$like':'%'+_0x880a04['query'][_0xfefb('0x40')]+'%'};return _0x55f97e;})});}_0x591c6f=_['merge']({},_0x591c6f,_0x880a04[_0xfefb('0x41')]);var _0x3ff4b5={'where':_0x591c6f[_0xfefb('0x35')]};return db['VoiceQueueReport'][_0xfefb('0x1a')](_0x3ff4b5)[_0xfefb('0x23')](function(_0xb53520){_0xae9e3f[_0xfefb('0x1a')]=_0xb53520;if(_0x880a04[_0xfefb('0x2a')]['includeAll']){_0x591c6f[_0xfefb('0x43')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xfefb('0x4e')](_0x591c6f);})[_0xfefb('0x23')](function(_0x2194d9){_0xae9e3f['rows']=_0x2194d9;return _0xae9e3f;})[_0xfefb('0x23')](respondWithFilteredResult(_0x1c88aa,_0x591c6f,_0xfefb('0x4c')))['catch'](handleError(_0x1c88aa,null,_0xfefb('0x4c')));};
\ No newline at end of file
index 466d368..45622d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x206a=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x455b41,_0x55840a){var _0x3143ae=function(_0x3ddb59){while(--_0x3ddb59){_0x455b41['push'](_0x455b41['shift']());}};_0x3143ae(++_0x55840a);}(_0x206a,0xef));var _0xa206=function(_0xa68a32,_0x54036d){_0xa68a32=_0xa68a32-0x0;var _0x1e4b16=_0x206a[_0xa68a32];return _0x1e4b16;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xa206('0x0'))['db'][_0xa206('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa206('0x2')](0x0);var events={'afterCreate':_0xa206('0x3'),'afterUpdate':_0xa206('0x4'),'afterDestroy':_0xa206('0x5')};function emitEvent(_0x37cbb9){return function(_0x171bae,_0x42e701,_0x538040){VoiceQueueReportEvents['emit'](_0x37cbb9+':'+_0x171bae['id'],_0x171bae);VoiceQueueReportEvents[_0xa206('0x6')](_0x37cbb9,_0x171bae);_0x538040(null);};}for(var e in events){if(events[_0xa206('0x7')](e)){var event=events[e];VoiceQueueReport[_0xa206('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xe91e=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0xeb6fe0,_0xc4c6fe){var _0x2fa2ee=function(_0x516bcc){while(--_0x516bcc){_0xeb6fe0['push'](_0xeb6fe0['shift']());}};_0x2fa2ee(++_0xc4c6fe);}(_0xe91e,0x1bc));var _0xee91=function(_0x2577d9,_0x8f2f28){_0x2577d9=_0x2577d9-0x0;var _0x36fe58=_0xe91e[_0x2577d9];return _0x36fe58;};'use strict';var EventEmitter=require(_0xee91('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee91('0x1'),'afterUpdate':_0xee91('0x2'),'afterDestroy':_0xee91('0x3')};function emitEvent(_0x1649a1){return function(_0x59f309,_0x2d563c,_0x549af9){VoiceQueueReportEvents[_0xee91('0x4')](_0x1649a1+':'+_0x59f309['id'],_0x59f309);VoiceQueueReportEvents['emit'](_0x1649a1,_0x59f309);_0x549af9(null);};}for(var e in events){if(events[_0xee91('0x5')](e)){var event=events[e];VoiceQueueReport[_0xee91('0x6')](e,emitEvent(event));}}module[_0xee91('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
index a5b9cf9..4f952c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9cd=['report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','bluebird','request-promise','./voiceQueueReport.attributes','exports','define','VoiceQueueReport'];(function(_0x3c3ec0,_0xe6883c){var _0x4cd47c=function(_0x4338b4){while(--_0x4338b4){_0x3c3ec0['push'](_0x3c3ec0['shift']());}};_0x4cd47c(++_0xe6883c);}(_0xc9cd,0x16f));var _0xdc9c=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0xc9cd[_0x5f42f1];return _0x5534ee;};'use strict';var _=require(_0xdc9c('0x0'));var util=require('util');var logger=require(_0xdc9c('0x1'))(_0xdc9c('0x2'));var moment=require(_0xdc9c('0x3'));var BPromise=require(_0xdc9c('0x4'));var rp=require(_0xdc9c('0x5'));var attributes=require(_0xdc9c('0x6'));module[_0xdc9c('0x7')]=function(_0x2d7065,_0x1bf95f){return _0x2d7065[_0xdc9c('0x8')](_0xdc9c('0x9'),attributes,{'tableName':_0xdc9c('0xa'),'paranoid':![],'indexes':[{'fields':[_0xdc9c('0xb')]},{'fields':[_0xdc9c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a37=['uniqueid','calleridnum','lodash','util','api','moment','bluebird','request-promise','exports','VoiceQueueReport','report_queue'];(function(_0x28cd86,_0x89c3c9){var _0x43864b=function(_0x424685){while(--_0x424685){_0x28cd86['push'](_0x28cd86['shift']());}};_0x43864b(++_0x89c3c9);}(_0x9a37,0x199));var _0x79a3=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x9a37[_0x25c988];return _0x45fcc2;};'use strict';var _=require(_0x79a3('0x0'));var util=require(_0x79a3('0x1'));var logger=require('../../config/logger')(_0x79a3('0x2'));var moment=require(_0x79a3('0x3'));var BPromise=require(_0x79a3('0x4'));var rp=require(_0x79a3('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0x79a3('0x6')]=function(_0x57071e,_0x187512){return _0x57071e['define'](_0x79a3('0x7'),attributes,{'tableName':_0x79a3('0x8'),'paranoid':![],'indexes':[{'fields':[_0x79a3('0x9')]},{'fields':[_0x79a3('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 7939f58..26cafab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa298=['then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','map','include','model','body','raw','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request'];(function(_0x3ebfcd,_0x595578){var _0x16afe2=function(_0xe8681f){while(--_0xe8681f){_0x3ebfcd['push'](_0x3ebfcd['shift']());}};_0x16afe2(++_0x595578);}(_0xa298,0x14d));var _0x8a29=function(_0x28ec47,_0x32cbe3){_0x28ec47=_0x28ec47-0x0;var _0x3ab24d=_0xa298[_0x28ec47];return _0x3ab24d;};'use strict';var _=require('lodash');var util=require(_0x8a29('0x0'));var moment=require(_0x8a29('0x1'));var BPromise=require(_0x8a29('0x2'));var rs=require(_0x8a29('0x3'));var fs=require('fs');var Redis=require(_0x8a29('0x4'));var db=require(_0x8a29('0x5'))['db'];var utils=require(_0x8a29('0x6'));var logger=require(_0x8a29('0x7'))(_0x8a29('0x8'));var config=require(_0x8a29('0x9'));var jayson=require(_0x8a29('0xa'));var client=jayson[_0x8a29('0xb')][_0x8a29('0xc')]({'port':0x232a});config[_0x8a29('0xd')]=_[_0x8a29('0xe')](config[_0x8a29('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a29('0xf'))(new Redis(config[_0x8a29('0xd')]));require(_0x8a29('0x10'))[_0x8a29('0x11')](socket);function respondWithRpcPromise(_0x4dfff5,_0x490840,_0x4c9ad5){return new BPromise(function(_0x2e0bab,_0x9eb7f6){return client[_0x8a29('0x12')](_0x4dfff5,_0x4c9ad5)[_0x8a29('0x13')](function(_0x441213){logger[_0x8a29('0x14')](_0x8a29('0x15'),_0x490840,_0x8a29('0x16'));logger[_0x8a29('0x17')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x490840,_0x8a29('0x16'),JSON[_0x8a29('0x18')](_0x441213));if(_0x441213[_0x8a29('0x19')]){if(_0x441213['error']['code']===0x1f4){logger['error'](_0x8a29('0x15'),_0x490840,_0x441213[_0x8a29('0x19')][_0x8a29('0x1a')]);return _0x9eb7f6(_0x441213['error'][_0x8a29('0x1a')]);}logger['error'](_0x8a29('0x15'),_0x490840,_0x441213[_0x8a29('0x19')][_0x8a29('0x1a')]);return _0x2e0bab(_0x441213['error'][_0x8a29('0x1a')]);}else{logger[_0x8a29('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x490840,'request\x20sent');_0x2e0bab(_0x441213[_0x8a29('0x1b')]['message']);}})[_0x8a29('0x1c')](function(_0x50ee0d){logger[_0x8a29('0x19')](_0x8a29('0x15'),_0x490840,_0x50ee0d);_0x9eb7f6(_0x50ee0d);});});}exports[_0x8a29('0x1d')]=function(_0xa69688){var _0xc1e591=this;return new Promise(function(_0x1771d1,_0x269999){return db[_0x8a29('0x1e')][_0x8a29('0x1f')]({'raw':_0xa69688['options']?_0xa69688[_0x8a29('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xa69688['options']?_0xa69688[_0x8a29('0x20')][_0x8a29('0x21')]||null:null,'attributes':_0xa69688['options']?_0xa69688[_0x8a29('0x20')][_0x8a29('0x22')]||null:null,'limit':_0xa69688['options']?_0xa69688[_0x8a29('0x20')][_0x8a29('0x23')]||null:null,'include':_0xa69688[_0x8a29('0x20')]?_0xa69688['options']['include']?_[_0x8a29('0x24')](_0xa69688['options'][_0x8a29('0x25')],function(_0x5254d7){return{'model':db[_0x5254d7[_0x8a29('0x26')]],'as':_0x5254d7['as'],'attributes':_0x5254d7['attributes'],'include':_0x5254d7[_0x8a29('0x25')]?_[_0x8a29('0x24')](_0x5254d7[_0x8a29('0x25')],function(_0x22efbf){return{'model':db[_0x22efbf[_0x8a29('0x26')]],'as':_0x22efbf['as'],'attributes':_0x22efbf[_0x8a29('0x22')],'include':_0x22efbf['include']?_['map'](_0x22efbf[_0x8a29('0x25')],function(_0x2a9866){return{'model':db[_0x2a9866[_0x8a29('0x26')]],'as':_0x2a9866['as'],'attributes':_0x2a9866[_0x8a29('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8a29('0x13')](function(_0x51313a){logger[_0x8a29('0x14')](_0x8a29('0x1d'),_0xa69688);logger['debug'](_0x8a29('0x1d'),_0xa69688,JSON[_0x8a29('0x18')](_0x51313a));_0x1771d1(_0x51313a);})[_0x8a29('0x1c')](function(_0x3e719a){logger['error'](_0x8a29('0x1d'),_0x3e719a[_0x8a29('0x1a')],_0xa69688);_0x269999(_0xc1e591[_0x8a29('0x19')](0x1f4,_0x3e719a[_0x8a29('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x179ea8){var _0x22e666=this;return new Promise(function(_0x57bce9,_0x226ded){return db['VoiceQueueReport']['create'](_0x179ea8[_0x8a29('0x27')],{'raw':_0x179ea8[_0x8a29('0x20')]?_0x179ea8[_0x8a29('0x20')][_0x8a29('0x28')]===undefined?!![]:![]:!![]})[_0x8a29('0x13')](function(_0x3e3158){logger[_0x8a29('0x14')](_0x8a29('0x29'),_0x179ea8);logger[_0x8a29('0x17')](_0x8a29('0x29'),_0x179ea8,JSON[_0x8a29('0x18')](_0x3e3158));_0x57bce9(_0x3e3158);})[_0x8a29('0x1c')](function(_0x2f5226){logger[_0x8a29('0x19')]('CreateVoiceQueueReport',_0x2f5226[_0x8a29('0x1a')],_0x179ea8);_0x226ded(_0x22e666['error'](0x1f4,_0x2f5226[_0x8a29('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x443856){var _0x4d3532=this;return new Promise(function(_0x544d31,_0x10530f){return db[_0x8a29('0x1e')][_0x8a29('0x2a')](_0x443856['body'],{'raw':_0x443856['options']?_0x443856[_0x8a29('0x20')][_0x8a29('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x443856[_0x8a29('0x20')]?_0x443856[_0x8a29('0x20')][_0x8a29('0x21')]||null:null,'attributes':_0x443856[_0x8a29('0x20')]?_0x443856[_0x8a29('0x20')][_0x8a29('0x22')]||null:null,'limit':_0x443856[_0x8a29('0x20')]?_0x443856[_0x8a29('0x20')][_0x8a29('0x23')]||null:null})['then'](function(_0x124770){logger[_0x8a29('0x14')]('UpdateVoiceQueueReport',_0x443856);logger[_0x8a29('0x17')](_0x8a29('0x2b'),_0x443856,JSON[_0x8a29('0x18')](_0x124770));_0x544d31(_0x124770);})[_0x8a29('0x1c')](function(_0x45df89){logger[_0x8a29('0x19')]('UpdateVoiceQueueReport',_0x45df89[_0x8a29('0x1a')],_0x443856);_0x10530f(_0x4d3532['error'](0x1f4,_0x45df89[_0x8a29('0x1a')]));});});};
\ No newline at end of file
+var _0x7196=['catch','update','UpdateVoiceQueueReport','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voiceQueueReport.socket','register','then','debug','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','result','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','info'];(function(_0x459ee0,_0x1e950d){var _0x1b87c8=function(_0x377855){while(--_0x377855){_0x459ee0['push'](_0x459ee0['shift']());}};_0x1b87c8(++_0x1e950d);}(_0x7196,0x17f));var _0x6719=function(_0x42b66d,_0x48ca02){_0x42b66d=_0x42b66d-0x0;var _0x49d0df=_0x7196[_0x42b66d];return _0x49d0df;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6719('0x0'));var BPromise=require('bluebird');var rs=require(_0x6719('0x1'));var fs=require('fs');var Redis=require(_0x6719('0x2'));var db=require(_0x6719('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6719('0x4'));var jayson=require(_0x6719('0x5'));var client=jayson['client'][_0x6719('0x6')]({'port':0x232a});config[_0x6719('0x7')]=_[_0x6719('0x8')](config[_0x6719('0x7')],{'host':_0x6719('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6719('0x7')]));require(_0x6719('0xa'))[_0x6719('0xb')](socket);function respondWithRpcPromise(_0x6027a3,_0x1647e6,_0x22d97b){return new BPromise(function(_0x4ab724,_0x148c53){return client['request'](_0x6027a3,_0x22d97b)[_0x6719('0xc')](function(_0x3904ea){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x1647e6,'request\x20sent');logger[_0x6719('0xd')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1647e6,'request\x20sent',JSON[_0x6719('0xe')](_0x3904ea));if(_0x3904ea[_0x6719('0xf')]){if(_0x3904ea['error'][_0x6719('0x10')]===0x1f4){logger[_0x6719('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x1647e6,_0x3904ea[_0x6719('0xf')]['message']);return _0x148c53(_0x3904ea['error'][_0x6719('0x11')]);}logger[_0x6719('0xf')](_0x6719('0x12'),_0x1647e6,_0x3904ea['error'][_0x6719('0x11')]);return _0x4ab724(_0x3904ea[_0x6719('0xf')][_0x6719('0x11')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x1647e6,_0x6719('0x13'));_0x4ab724(_0x3904ea[_0x6719('0x14')]['message']);}})['catch'](function(_0x4e4fc1){logger[_0x6719('0xf')](_0x6719('0x12'),_0x1647e6,_0x4e4fc1);_0x148c53(_0x4e4fc1);});});}exports['GetVoiceQueueReport']=function(_0xbc5d05){var _0x4d22dc=this;return new Promise(function(_0xf4c0d6,_0x12259e){return db[_0x6719('0x15')][_0x6719('0x16')]({'raw':_0xbc5d05[_0x6719('0x17')]?_0xbc5d05['options'][_0x6719('0x18')]===undefined?!![]:![]:!![],'where':_0xbc5d05['options']?_0xbc5d05[_0x6719('0x17')][_0x6719('0x19')]||null:null,'attributes':_0xbc5d05[_0x6719('0x17')]?_0xbc5d05[_0x6719('0x17')][_0x6719('0x1a')]||null:null,'limit':_0xbc5d05[_0x6719('0x17')]?_0xbc5d05[_0x6719('0x17')][_0x6719('0x1b')]||null:null,'include':_0xbc5d05[_0x6719('0x17')]?_0xbc5d05['options'][_0x6719('0x1c')]?_[_0x6719('0x1d')](_0xbc5d05[_0x6719('0x17')][_0x6719('0x1c')],function(_0x5a8e55){return{'model':db[_0x5a8e55[_0x6719('0x1e')]],'as':_0x5a8e55['as'],'attributes':_0x5a8e55['attributes'],'include':_0x5a8e55['include']?_[_0x6719('0x1d')](_0x5a8e55[_0x6719('0x1c')],function(_0x2ecaa2){return{'model':db[_0x2ecaa2['model']],'as':_0x2ecaa2['as'],'attributes':_0x2ecaa2['attributes'],'include':_0x2ecaa2[_0x6719('0x1c')]?_[_0x6719('0x1d')](_0x2ecaa2['include'],function(_0x1c2617){return{'model':db[_0x1c2617['model']],'as':_0x1c2617['as'],'attributes':_0x1c2617[_0x6719('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6719('0xc')](function(_0x619bcc){logger['info']('GetVoiceQueueReport',_0xbc5d05);logger['debug']('GetVoiceQueueReport',_0xbc5d05,JSON[_0x6719('0xe')](_0x619bcc));_0xf4c0d6(_0x619bcc);})['catch'](function(_0x16bf8d){logger[_0x6719('0xf')]('GetVoiceQueueReport',_0x16bf8d[_0x6719('0x11')],_0xbc5d05);_0x12259e(_0x4d22dc['error'](0x1f4,_0x16bf8d[_0x6719('0x11')]));});});};exports[_0x6719('0x1f')]=function(_0x3f86f5){var _0x75d928=this;return new Promise(function(_0x5777e8,_0x4ab42b){return db[_0x6719('0x15')][_0x6719('0x20')](_0x3f86f5[_0x6719('0x21')],{'raw':_0x3f86f5['options']?_0x3f86f5[_0x6719('0x17')][_0x6719('0x18')]===undefined?!![]:![]:!![]})[_0x6719('0xc')](function(_0x334053){logger[_0x6719('0x22')](_0x6719('0x1f'),_0x3f86f5);logger[_0x6719('0xd')](_0x6719('0x1f'),_0x3f86f5,JSON[_0x6719('0xe')](_0x334053));_0x5777e8(_0x334053);})[_0x6719('0x23')](function(_0x271a6b){logger[_0x6719('0xf')]('CreateVoiceQueueReport',_0x271a6b['message'],_0x3f86f5);_0x4ab42b(_0x75d928[_0x6719('0xf')](0x1f4,_0x271a6b[_0x6719('0x11')]));});});};exports['UpdateVoiceQueueReport']=function(_0x46c3ff){var _0x4ff78d=this;return new Promise(function(_0x396354,_0x924529){return db[_0x6719('0x15')][_0x6719('0x24')](_0x46c3ff[_0x6719('0x21')],{'raw':_0x46c3ff['options']?_0x46c3ff[_0x6719('0x17')][_0x6719('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46c3ff[_0x6719('0x17')]?_0x46c3ff[_0x6719('0x17')][_0x6719('0x19')]||null:null,'attributes':_0x46c3ff[_0x6719('0x17')]?_0x46c3ff[_0x6719('0x17')][_0x6719('0x1a')]||null:null,'limit':_0x46c3ff[_0x6719('0x17')]?_0x46c3ff[_0x6719('0x17')]['limit']||null:null})[_0x6719('0xc')](function(_0x2e5417){logger[_0x6719('0x22')]('UpdateVoiceQueueReport',_0x46c3ff);logger['debug'](_0x6719('0x25'),_0x46c3ff,JSON[_0x6719('0xe')](_0x2e5417));_0x396354(_0x2e5417);})['catch'](function(_0x7b64fb){logger[_0x6719('0xf')]('UpdateVoiceQueueReport',_0x7b64fb[_0x6719('0x11')],_0x46c3ff);_0x924529(_0x4ff78d[_0x6719('0xf')](0x1f4,_0x7b64fb[_0x6719('0x11')]));});});};
\ No newline at end of file
index eb02166..ebc8838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34be=['voiceQueueReport:','save','register','length'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0x34be,0x139));var _0xe34b=function(_0x178668,_0x1ec300){_0x178668=_0x178668-0x0;var _0x26107d=_0x34be[_0x178668];return _0x26107d;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xe34b('0x0'),'remove','update'];function createListener(_0x4e3bb3,_0x52be12){return function(_0x54a4a8){_0x52be12['emit'](_0x4e3bb3,_0x54a4a8);};}function removeListener(_0x83c7c,_0x3e57f7){return function(){VoiceQueueReportEvents['removeListener'](_0x83c7c,_0x3e57f7);};}exports[_0xe34b('0x1')]=function(_0x5f4c78){for(var _0x2c7e9d=0x0,_0x4d4d19=events[_0xe34b('0x2')];_0x2c7e9d<_0x4d4d19;_0x2c7e9d++){var _0x55ebde=events[_0x2c7e9d];var _0x3bcd66=createListener(_0xe34b('0x3')+_0x55ebde,_0x5f4c78);VoiceQueueReportEvents['on'](_0x55ebde,_0x3bcd66);}};
\ No newline at end of file
+var _0x6216=['./voiceQueueReport.events','save','remove','update','emit','removeListener','register','length','voiceQueueReport:'];(function(_0x98760,_0xbd5a86){var _0x2db508=function(_0x136c9c){while(--_0x136c9c){_0x98760['push'](_0x98760['shift']());}};_0x2db508(++_0xbd5a86);}(_0x6216,0x90));var _0x6621=function(_0x4a2d48,_0x4c8529){_0x4a2d48=_0x4a2d48-0x0;var _0x5b30f3=_0x6216[_0x4a2d48];return _0x5b30f3;};'use strict';var VoiceQueueReportEvents=require(_0x6621('0x0'));var events=[_0x6621('0x1'),_0x6621('0x2'),_0x6621('0x3')];function createListener(_0x1553a2,_0x190626){return function(_0x1f66ab){_0x190626[_0x6621('0x4')](_0x1553a2,_0x1f66ab);};}function removeListener(_0x1aa3c8,_0x3b9a48){return function(){VoiceQueueReportEvents[_0x6621('0x5')](_0x1aa3c8,_0x3b9a48);};}exports[_0x6621('0x6')]=function(_0x449c91){for(var _0x17ee66=0x0,_0x3dcd4b=events[_0x6621('0x7')];_0x17ee66<_0x3dcd4b;_0x17ee66++){var _0x3b7714=events[_0x17ee66];var _0x20ccee=createListener(_0x6621('0x8')+_0x3b7714,_0x449c91);VoiceQueueReportEvents['on'](_0x3b7714,_0x20ccee);}};
\ No newline at end of file
index 7ca0563..5ccc568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bb8=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','multer','util'];(function(_0x592060,_0x447690){var _0x35aada=function(_0x446f0d){while(--_0x446f0d){_0x592060['push'](_0x592060['shift']());}};_0x35aada(++_0x447690);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x89bb('0x0'));var util=require(_0x89bb('0x1'));var path=require(_0x89bb('0x2'));var timeout=require(_0x89bb('0x3'));var express=require(_0x89bb('0x4'));var router=express[_0x89bb('0x5')]();var auth=require(_0x89bb('0x6'));var interaction=require(_0x89bb('0x7'));var config=require(_0x89bb('0x8'));var controller=require(_0x89bb('0x9'));router[_0x89bb('0xa')]('/',auth[_0x89bb('0xb')](),controller['index']);router[_0x89bb('0xa')](_0x89bb('0xc'),auth[_0x89bb('0xb')](),controller[_0x89bb('0xd')]);router[_0x89bb('0xe')]('/',auth[_0x89bb('0xb')](),controller['create']);router[_0x89bb('0xf')](_0x89bb('0xc'),auth['isAuthenticated'](),controller[_0x89bb('0x10')]);router['delete'](_0x89bb('0xc'),auth['isAuthenticated'](),controller[_0x89bb('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x4d87=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create'];(function(_0x23dad9,_0x5dc8f2){var _0x527967=function(_0x2d9dc2){while(--_0x2d9dc2){_0x23dad9['push'](_0x23dad9['shift']());}};_0x527967(++_0x5dc8f2);}(_0x4d87,0xf0));var _0x74d8=function(_0x1c9a2a,_0xdcb0bf){_0x1c9a2a=_0x1c9a2a-0x0;var _0x560145=_0x4d87[_0x1c9a2a];return _0x560145;};'use strict';var multer=require('multer');var util=require(_0x74d8('0x0'));var path=require(_0x74d8('0x1'));var timeout=require(_0x74d8('0x2'));var express=require('express');var router=express[_0x74d8('0x3')]();var auth=require(_0x74d8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x74d8('0x5'));router[_0x74d8('0x6')]('/',auth[_0x74d8('0x7')](),controller[_0x74d8('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x74d8('0x9')]);router[_0x74d8('0xa')]('/',auth[_0x74d8('0x7')](),controller[_0x74d8('0xb')]);router[_0x74d8('0xc')](_0x74d8('0xd'),auth['isAuthenticated'](),controller[_0x74d8('0xe')]);router[_0x74d8('0xf')](_0x74d8('0xd'),auth[_0x74d8('0x7')](),controller[_0x74d8('0x10')]);module[_0x74d8('0x11')]=router;
\ No newline at end of file
index 2dc9dfe..bac59b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x16feb7,_0x1311a6){var _0x2f8144=function(_0x55cf6b){while(--_0x55cf6b){_0x16feb7['push'](_0x16feb7['shift']());}};_0x2f8144(++_0x1311a6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5f2260,_0x1eea44){_0x5f2260=_0x5f2260-0x0;var _0x3cae37=_0x8d0e[_0x5f2260];return _0x3cae37;};'use strict';var Sequelize=require(_0xe8d0('0x0'));var moment=require(_0xe8d0('0x1'));module[_0xe8d0('0x2')]={'time':{'type':Sequelize[_0xe8d0('0x3')]},'callid':{'type':Sequelize[_0xe8d0('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe8d0('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe8d0('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe8d0('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe8d0('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe8d0('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe8d0('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe8d0('0x4')],'allowNull':![],'defaultValue':moment()[_0xe8d0('0x5')](_0xe8d0('0x6'))}};
\ No newline at end of file
+var _0x4b84=['sequelize','moment','STRING','format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x4b84[_0x5534fe];return _0x3d1dc2;};'use strict';var Sequelize=require(_0x44b8('0x0'));var moment=require(_0x44b8('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x44b8('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
index b8a564e..495a750 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0df=['params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','VoiceQueuesLog','model','dateStart','query','dateEnd','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','add','day','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','options','find','catch','create','body'];(function(_0xcf8e2a,_0x5c5170){var _0x4be1e1=function(_0x1d3d07){while(--_0x1d3d07){_0xcf8e2a['push'](_0xcf8e2a['shift']());}};_0x4be1e1(++_0x5c5170);}(_0xc0df,0x1e7));var _0xfc0d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0df[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xfc0d('0x0'));var emlformat=require(_0xfc0d('0x1'));var rimraf=require(_0xfc0d('0x2'));var zipdir=require(_0xfc0d('0x3'));var jsonpatch=require(_0xfc0d('0x4'));var rp=require(_0xfc0d('0x5'));var moment=require(_0xfc0d('0x6'));var BPromise=require(_0xfc0d('0x7'));var Mustache=require(_0xfc0d('0x8'));var util=require(_0xfc0d('0x9'));var path=require(_0xfc0d('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfc0d('0xb'));var fs=require('fs');var _=require(_0xfc0d('0xc'));var squel=require(_0xfc0d('0xd'));var crypto=require(_0xfc0d('0xe'));var jsforce=require(_0xfc0d('0xf'));var deskjs=require(_0xfc0d('0x10'));var toCsv=require(_0xfc0d('0x11'));var querystring=require(_0xfc0d('0x12'));var Papa=require(_0xfc0d('0x13'));var Redis=require(_0xfc0d('0x14'));var qs=require(_0xfc0d('0x15'));var logger=require(_0xfc0d('0x16'))(_0xfc0d('0x17'));var utils=require(_0xfc0d('0x18'));var config=require(_0xfc0d('0x19'));var db=require(_0xfc0d('0x1a'))['db'];function respondWithStatusCode(_0x14e7b0,_0x243991){_0x243991=_0x243991||0xcc;return function(_0x5406f5){if(_0x5406f5){return _0x14e7b0[_0xfc0d('0x1b')](_0x243991);}return _0x14e7b0['status'](_0x243991)[_0xfc0d('0x1c')]();};}function respondWithResult(_0x688f04,_0x13770d){_0x13770d=_0x13770d||0xc8;return function(_0x5e5adb){if(_0x5e5adb){return _0x688f04[_0xfc0d('0x1d')](_0x13770d)['json'](_0x5e5adb);}};}function respondWithFilteredResult(_0x483714,_0x159e83){return function(_0x30c9a9){if(_0x30c9a9){var _0x30fe2a=_0x30c9a9['count'],_0x4aaf53=_0x159e83[_0xfc0d('0x1e')],_0x4b1636=_0x159e83[_0xfc0d('0x1e')]+_0x159e83['limit'],_0x1fe84b;if(_0x4b1636>=_0x30fe2a){_0x4b1636=_0x30fe2a;_0x1fe84b=0xc8;}else{_0x1fe84b=0xce;}_0x483714[_0xfc0d('0x1d')](_0x1fe84b);return _0x483714[_0xfc0d('0x1f')](_0xfc0d('0x20'),_0x4aaf53+'-'+_0x4b1636+'/'+_0x30fe2a)[_0xfc0d('0x21')](_0x30c9a9);}return null;};}function patchUpdates(_0x5613a5){return function(_0x32a863){try{jsonpatch[_0xfc0d('0x22')](_0x32a863,_0x5613a5,!![]);}catch(_0xbf7066){return BPromise[_0xfc0d('0x23')](_0xbf7066);}return _0x32a863[_0xfc0d('0x24')]();};}function saveUpdates(_0x4bd98a,_0x42a81d){return function(_0x1f619f){if(_0x1f619f){return _0x1f619f[_0xfc0d('0x25')](_0x4bd98a)[_0xfc0d('0x26')](function(_0x394fd7){return _0x394fd7;});}return null;};}function removeEntity(_0xf20115,_0x4b90ec){return function(_0x3df039){if(_0x3df039){return _0x3df039[_0xfc0d('0x27')]()[_0xfc0d('0x26')](function(){_0xf20115[_0xfc0d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f20a1,_0x1cfd56){return function(_0x2151ef){if(!_0x2151ef){_0x4f20a1[_0xfc0d('0x1b')](0x194);}return _0x2151ef;};}function handleError(_0x22fb7c,_0x38a74c){_0x38a74c=_0x38a74c||0x1f4;return function(_0x2df8e8){logger[_0xfc0d('0x28')](_0x2df8e8[_0xfc0d('0x29')]);if(_0x2df8e8[_0xfc0d('0x2a')]){delete _0x2df8e8['name'];}_0x22fb7c['status'](_0x38a74c)['send'](_0x2df8e8);};}exports[_0xfc0d('0x2b')]=function(_0x34111e,_0x53e642){var _0x58c3a2={},_0x2aa5a7={},_0x471dcc={'count':0x0,'rows':[]};var _0x476288=db[_0xfc0d('0x2c')]['rawAttributes'];_0x2aa5a7[_0xfc0d('0x2d')]=_['keys'](_0x476288);var _0x32be74={'dateStart':_0x34111e['query'][_0xfc0d('0x2e')],'dateEnd':_0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x30')]};delete _0x34111e['query'][_0xfc0d('0x2e')];delete _0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x30')];_0x2aa5a7['query']=_[_0xfc0d('0x31')](_0x34111e[_0xfc0d('0x2f')]);_0x2aa5a7[_0xfc0d('0x32')]=_[_0xfc0d('0x33')](_0x2aa5a7['model'],_0x2aa5a7[_0xfc0d('0x2f')]);_0x58c3a2['attributes']=_[_0xfc0d('0x33')](_0x2aa5a7[_0xfc0d('0x2d')],qs[_0xfc0d('0x34')](_0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x34')]));_0x58c3a2[_0xfc0d('0x35')]=_0x58c3a2['attributes'][_0xfc0d('0x36')]?_0x58c3a2['attributes']:_0x2aa5a7[_0xfc0d('0x2d')];if(!_0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x37')](_0xfc0d('0x38'))){_0x58c3a2[_0xfc0d('0x39')]=qs['limit'](_0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x39')]);_0x58c3a2[_0xfc0d('0x1e')]=qs[_0xfc0d('0x1e')](_0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x1e')]);}_0x58c3a2['order']=qs[_0xfc0d('0x3a')](_0x34111e[_0xfc0d('0x2f')]['sort']);_0x58c3a2[_0xfc0d('0x3b')]=qs[_0xfc0d('0x32')](_[_0xfc0d('0x3c')](_0x34111e[_0xfc0d('0x2f')],_0x2aa5a7[_0xfc0d('0x32')]));if(_0x32be74[_0xfc0d('0x2e')]){if(_0x32be74['dateEnd']){_0x32be74[_0xfc0d('0x30')]=moment(_0x32be74['dateEnd'])[_0xfc0d('0x3d')](0x1,_0xfc0d('0x3e'));}else{_0x32be74[_0xfc0d('0x30')]=moment(_0x32be74['dateStart'])[_0xfc0d('0x3d')](0x1,_0xfc0d('0x3e'));}_['merge'](_0x58c3a2[_0xfc0d('0x3b')],{'createdAt':{'$gte':_0x32be74[_0xfc0d('0x2e')],'$lte':_0x32be74['dateEnd']}});}if(_0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x3f')]){_0x58c3a2['where']=_[_0xfc0d('0x40')](_0x58c3a2['where'],{'$or':_[_0xfc0d('0x41')](_0x476288,function(_0x382aca){if(_0x382aca[_0xfc0d('0x42')][_0xfc0d('0x43')]!==_0xfc0d('0x44')){var _0x42b991={};_0x42b991[_0x382aca[_0xfc0d('0x45')]]={'$like':'%'+_0x34111e['query'][_0xfc0d('0x3f')]+'%'};return _0x42b991;}})});}_0x58c3a2=_[_0xfc0d('0x40')]({},_0x58c3a2,_0x34111e['options']);var _0x221454={'where':_0x58c3a2[_0xfc0d('0x3b')]};return db[_0xfc0d('0x2c')][_0xfc0d('0x46')](_0x221454)[_0xfc0d('0x26')](function(_0x1e6c59){_0x471dcc['count']=_0x1e6c59;if(_0x34111e[_0xfc0d('0x2f')][_0xfc0d('0x47')]){_0x58c3a2[_0xfc0d('0x48')]=[{'all':!![]}];}return db[_0xfc0d('0x2c')][_0xfc0d('0x49')](_0x58c3a2);})[_0xfc0d('0x26')](function(_0x329a21){_0x471dcc[_0xfc0d('0x4a')]=_0x329a21;return _0x471dcc;})[_0xfc0d('0x26')](respondWithFilteredResult(_0x53e642,_0x58c3a2))['catch'](handleError(_0x53e642,null));};exports['show']=function(_0x59922f,_0x391516){var _0x101914={'raw':!![],'where':{'id':_0x59922f['params']['id']}},_0x3eb48b={};_0x3eb48b[_0xfc0d('0x2d')]=_['keys'](db[_0xfc0d('0x2c')]['rawAttributes']);_0x3eb48b[_0xfc0d('0x2f')]=_[_0xfc0d('0x31')](_0x59922f[_0xfc0d('0x2f')]);_0x3eb48b['filters']=_[_0xfc0d('0x33')](_0x3eb48b['model'],_0x3eb48b[_0xfc0d('0x2f')]);_0x101914['attributes']=_[_0xfc0d('0x33')](_0x3eb48b[_0xfc0d('0x2d')],qs[_0xfc0d('0x34')](_0x59922f['query'][_0xfc0d('0x34')]));_0x101914[_0xfc0d('0x35')]=_0x101914[_0xfc0d('0x35')][_0xfc0d('0x36')]?_0x101914[_0xfc0d('0x35')]:_0x3eb48b[_0xfc0d('0x2d')];if(_0x59922f[_0xfc0d('0x2f')]['includeAll']){_0x101914[_0xfc0d('0x48')]=[{'all':!![]}];}_0x101914=_['merge']({},_0x101914,_0x59922f[_0xfc0d('0x4b')]);return db[_0xfc0d('0x2c')][_0xfc0d('0x4c')](_0x101914)['then'](handleEntityNotFound(_0x391516,null))['then'](respondWithResult(_0x391516,null))[_0xfc0d('0x4d')](handleError(_0x391516,null));};exports[_0xfc0d('0x4e')]=function(_0x11869c,_0x21f440){return db[_0xfc0d('0x2c')][_0xfc0d('0x4e')](_0x11869c[_0xfc0d('0x4f')],{})[_0xfc0d('0x26')](respondWithResult(_0x21f440,0xc9))[_0xfc0d('0x4d')](handleError(_0x21f440,null));};exports[_0xfc0d('0x25')]=function(_0x4ba86c,_0x8ee4d3){if(_0x4ba86c[_0xfc0d('0x4f')]['id']){delete _0x4ba86c[_0xfc0d('0x4f')]['id'];}return db[_0xfc0d('0x2c')][_0xfc0d('0x4c')]({'where':{'id':_0x4ba86c[_0xfc0d('0x50')]['id']}})['then'](handleEntityNotFound(_0x8ee4d3,null))['then'](saveUpdates(_0x4ba86c[_0xfc0d('0x4f')],null))['then'](respondWithResult(_0x8ee4d3,null))[_0xfc0d('0x4d')](handleError(_0x8ee4d3,null));};exports[_0xfc0d('0x27')]=function(_0x5b04d4,_0x1ae3ee){return db[_0xfc0d('0x2c')][_0xfc0d('0x4c')]({'where':{'id':_0x5b04d4[_0xfc0d('0x50')]['id']}})[_0xfc0d('0x26')](handleEntityNotFound(_0x1ae3ee,null))[_0xfc0d('0x26')](removeEntity(_0x1ae3ee,null))[_0xfc0d('0x4d')](handleError(_0x1ae3ee,null));};
\ No newline at end of file
+var _0x150e=['pick','add','day','merge','map','type','VIRTUAL','field','VoiceQueuesLog','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','end','stack','name','index','rawAttributes','keys','query','dateStart','dateEnd','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters'];(function(_0x36a6ce,_0x2e9429){var _0x2c102a=function(_0x5b2acd){while(--_0x5b2acd){_0x36a6ce['push'](_0x36a6ce['shift']());}};_0x2c102a(++_0x2e9429);}(_0x150e,0x190));var _0xe150=function(_0x2a07c9,_0x185c10){_0x2a07c9=_0x2a07c9-0x0;var _0x4e5723=_0x150e[_0x2a07c9];return _0x4e5723;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe150('0x0'));var zipdir=require(_0xe150('0x1'));var jsonpatch=require(_0xe150('0x2'));var rp=require(_0xe150('0x3'));var moment=require('moment');var BPromise=require(_0xe150('0x4'));var Mustache=require(_0xe150('0x5'));var util=require(_0xe150('0x6'));var path=require(_0xe150('0x7'));var sox=require(_0xe150('0x8'));var csv=require('to-csv');var ejs=require(_0xe150('0x9'));var fs=require('fs');var _=require(_0xe150('0xa'));var squel=require(_0xe150('0xb'));var crypto=require(_0xe150('0xc'));var jsforce=require(_0xe150('0xd'));var deskjs=require(_0xe150('0xe'));var toCsv=require(_0xe150('0xf'));var querystring=require(_0xe150('0x10'));var Papa=require(_0xe150('0x11'));var Redis=require(_0xe150('0x12'));var qs=require('../../components/parsers/qs');var logger=require(_0xe150('0x13'))(_0xe150('0x14'));var utils=require(_0xe150('0x15'));var config=require(_0xe150('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x336a57,_0x5aa046){_0x5aa046=_0x5aa046||0xcc;return function(_0x3e18c2){if(_0x3e18c2){return _0x336a57[_0xe150('0x17')](_0x5aa046);}return _0x336a57['status'](_0x5aa046)['end']();};}function respondWithResult(_0x8d5838,_0xc543e3){_0xc543e3=_0xc543e3||0xc8;return function(_0x4b2d6d){if(_0x4b2d6d){return _0x8d5838[_0xe150('0x18')](_0xc543e3)[_0xe150('0x19')](_0x4b2d6d);}};}function respondWithFilteredResult(_0xabf413,_0x1b46a7){return function(_0x11e41b){if(_0x11e41b){var _0x596ff4=_0x11e41b[_0xe150('0x1a')],_0x36f128=_0x1b46a7[_0xe150('0x1b')],_0x150315=_0x1b46a7[_0xe150('0x1b')]+_0x1b46a7['limit'],_0x42a300;if(_0x150315>=_0x596ff4){_0x150315=_0x596ff4;_0x42a300=0xc8;}else{_0x42a300=0xce;}_0xabf413[_0xe150('0x18')](_0x42a300);return _0xabf413[_0xe150('0x1c')](_0xe150('0x1d'),_0x36f128+'-'+_0x150315+'/'+_0x596ff4)[_0xe150('0x19')](_0x11e41b);}return null;};}function patchUpdates(_0x83be3a){return function(_0x1ae484){try{jsonpatch[_0xe150('0x1e')](_0x1ae484,_0x83be3a,!![]);}catch(_0xfce06b){return BPromise[_0xe150('0x1f')](_0xfce06b);}return _0x1ae484['save']();};}function saveUpdates(_0x408845,_0x2b187c){return function(_0x484575){if(_0x484575){return _0x484575[_0xe150('0x20')](_0x408845)['then'](function(_0x51c30e){return _0x51c30e;});}return null;};}function removeEntity(_0x4b4310,_0x58a99f){return function(_0xe4bfac){if(_0xe4bfac){return _0xe4bfac[_0xe150('0x21')]()[_0xe150('0x22')](function(){_0x4b4310['status'](0xcc)[_0xe150('0x23')]();});}};}function handleEntityNotFound(_0x182707,_0x346020){return function(_0x5a3b27){if(!_0x5a3b27){_0x182707['sendStatus'](0x194);}return _0x5a3b27;};}function handleError(_0x19a19c,_0x1b69ec){_0x1b69ec=_0x1b69ec||0x1f4;return function(_0x345896){logger['error'](_0x345896[_0xe150('0x24')]);if(_0x345896[_0xe150('0x25')]){delete _0x345896['name'];}_0x19a19c[_0xe150('0x18')](_0x1b69ec)['send'](_0x345896);};}exports[_0xe150('0x26')]=function(_0x198460,_0x4474ab){var _0x1a7d8a={},_0xd83cab={},_0x1069ca={'count':0x0,'rows':[]};var _0x4e6443=db['VoiceQueuesLog'][_0xe150('0x27')];_0xd83cab['model']=_[_0xe150('0x28')](_0x4e6443);var _0x2991a6={'dateStart':_0x198460[_0xe150('0x29')][_0xe150('0x2a')],'dateEnd':_0x198460[_0xe150('0x29')][_0xe150('0x2b')]};delete _0x198460[_0xe150('0x29')][_0xe150('0x2a')];delete _0x198460[_0xe150('0x29')]['dateEnd'];_0xd83cab[_0xe150('0x29')]=_[_0xe150('0x28')](_0x198460[_0xe150('0x29')]);_0xd83cab['filters']=_['intersection'](_0xd83cab['model'],_0xd83cab['query']);_0x1a7d8a[_0xe150('0x2c')]=_[_0xe150('0x2d')](_0xd83cab[_0xe150('0x2e')],qs[_0xe150('0x2f')](_0x198460[_0xe150('0x29')]['fields']));_0x1a7d8a[_0xe150('0x2c')]=_0x1a7d8a['attributes'][_0xe150('0x30')]?_0x1a7d8a['attributes']:_0xd83cab['model'];if(!_0x198460['query'][_0xe150('0x31')](_0xe150('0x32'))){_0x1a7d8a[_0xe150('0x33')]=qs[_0xe150('0x33')](_0x198460[_0xe150('0x29')][_0xe150('0x33')]);_0x1a7d8a[_0xe150('0x1b')]=qs[_0xe150('0x1b')](_0x198460['query'][_0xe150('0x1b')]);}_0x1a7d8a[_0xe150('0x34')]=qs[_0xe150('0x35')](_0x198460[_0xe150('0x29')][_0xe150('0x35')]);_0x1a7d8a[_0xe150('0x36')]=qs[_0xe150('0x37')](_[_0xe150('0x38')](_0x198460['query'],_0xd83cab[_0xe150('0x37')]));if(_0x2991a6['dateStart']){if(_0x2991a6[_0xe150('0x2b')]){_0x2991a6[_0xe150('0x2b')]=moment(_0x2991a6[_0xe150('0x2b')])[_0xe150('0x39')](0x1,_0xe150('0x3a'));}else{_0x2991a6['dateEnd']=moment(_0x2991a6['dateStart'])[_0xe150('0x39')](0x1,'day');}_['merge'](_0x1a7d8a[_0xe150('0x36')],{'createdAt':{'$gte':_0x2991a6['dateStart'],'$lte':_0x2991a6[_0xe150('0x2b')]}});}if(_0x198460['query']['filter']){_0x1a7d8a[_0xe150('0x36')]=_[_0xe150('0x3b')](_0x1a7d8a[_0xe150('0x36')],{'$or':_[_0xe150('0x3c')](_0x4e6443,function(_0x18080a){if(_0x18080a[_0xe150('0x3d')]['key']!==_0xe150('0x3e')){var _0x59705a={};_0x59705a[_0x18080a[_0xe150('0x3f')]]={'$like':'%'+_0x198460['query']['filter']+'%'};return _0x59705a;}})});}_0x1a7d8a=_['merge']({},_0x1a7d8a,_0x198460['options']);var _0x3ebe3b={'where':_0x1a7d8a[_0xe150('0x36')]};return db[_0xe150('0x40')][_0xe150('0x1a')](_0x3ebe3b)[_0xe150('0x22')](function(_0x278935){_0x1069ca[_0xe150('0x1a')]=_0x278935;if(_0x198460['query'][_0xe150('0x41')]){_0x1a7d8a[_0xe150('0x42')]=[{'all':!![]}];}return db[_0xe150('0x40')][_0xe150('0x43')](_0x1a7d8a);})['then'](function(_0x56ccfa){_0x1069ca[_0xe150('0x44')]=_0x56ccfa;return _0x1069ca;})[_0xe150('0x22')](respondWithFilteredResult(_0x4474ab,_0x1a7d8a))[_0xe150('0x45')](handleError(_0x4474ab,null));};exports[_0xe150('0x46')]=function(_0x467b09,_0x3b5a2f){var _0x583ca9={'raw':!![],'where':{'id':_0x467b09['params']['id']}},_0x86b2cb={};_0x86b2cb[_0xe150('0x2e')]=_[_0xe150('0x28')](db['VoiceQueuesLog'][_0xe150('0x27')]);_0x86b2cb[_0xe150('0x29')]=_['keys'](_0x467b09[_0xe150('0x29')]);_0x86b2cb[_0xe150('0x37')]=_[_0xe150('0x2d')](_0x86b2cb['model'],_0x86b2cb[_0xe150('0x29')]);_0x583ca9['attributes']=_[_0xe150('0x2d')](_0x86b2cb[_0xe150('0x2e')],qs[_0xe150('0x2f')](_0x467b09['query'][_0xe150('0x2f')]));_0x583ca9[_0xe150('0x2c')]=_0x583ca9[_0xe150('0x2c')]['length']?_0x583ca9[_0xe150('0x2c')]:_0x86b2cb[_0xe150('0x2e')];if(_0x467b09[_0xe150('0x29')][_0xe150('0x41')]){_0x583ca9['include']=[{'all':!![]}];}_0x583ca9=_[_0xe150('0x3b')]({},_0x583ca9,_0x467b09[_0xe150('0x47')]);return db['VoiceQueuesLog'][_0xe150('0x48')](_0x583ca9)[_0xe150('0x22')](handleEntityNotFound(_0x3b5a2f,null))[_0xe150('0x22')](respondWithResult(_0x3b5a2f,null))[_0xe150('0x45')](handleError(_0x3b5a2f,null));};exports['create']=function(_0x153fa9,_0x211ad2){return db[_0xe150('0x40')][_0xe150('0x49')](_0x153fa9[_0xe150('0x4a')],{})[_0xe150('0x22')](respondWithResult(_0x211ad2,0xc9))[_0xe150('0x45')](handleError(_0x211ad2,null));};exports[_0xe150('0x20')]=function(_0x4c8bd5,_0x60e0d0){if(_0x4c8bd5[_0xe150('0x4a')]['id']){delete _0x4c8bd5['body']['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x4c8bd5['params']['id']}})[_0xe150('0x22')](handleEntityNotFound(_0x60e0d0,null))[_0xe150('0x22')](saveUpdates(_0x4c8bd5[_0xe150('0x4a')],null))[_0xe150('0x22')](respondWithResult(_0x60e0d0,null))['catch'](handleError(_0x60e0d0,null));};exports[_0xe150('0x21')]=function(_0x23c1a8,_0x204c8c){return db['VoiceQueuesLog'][_0xe150('0x48')]({'where':{'id':_0x23c1a8[_0xe150('0x4b')]['id']}})[_0xe150('0x22')](handleEntityNotFound(_0x204c8c,null))['then'](removeEntity(_0x204c8c,null))[_0xe150('0x45')](handleError(_0x204c8c,null));};
\ No newline at end of file
index 5c7c440..72a0630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x444a=['lodash','../../config/logger','./voiceQueuesLog.attributes','define','voice_queues_log','dtm'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x444a,0xa2));var _0xa444=function(_0x4283c0,_0xc694d5){_0x4283c0=_0x4283c0-0x0;var _0x6b47ab=_0x444a[_0x4283c0];return _0x6b47ab;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var logger=require(_0xa444('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0xa444('0x2'));module['exports']=function(_0x3c0c53,_0x4c348c){return _0x3c0c53[_0xa444('0x3')]('VoiceQueuesLog',attributes,{'tableName':_0xa444('0x4'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0xa444('0x5')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xd61c=['moment','request-promise','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger'];(function(_0x4e5960,_0x7474f3){var _0x2f6fc7=function(_0x4c063a){while(--_0x4c063a){_0x4e5960['push'](_0x4e5960['shift']());}};_0x2f6fc7(++_0x7474f3);}(_0xd61c,0xb1));var _0xcd61=function(_0x1be00a,_0x507081){_0x1be00a=_0x1be00a-0x0;var _0x33f8a8=_0xd61c[_0x1be00a];return _0x33f8a8;};'use strict';var _=require(_0xcd61('0x0'));var util=require(_0xcd61('0x1'));var logger=require(_0xcd61('0x2'))('api');var moment=require(_0xcd61('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd61('0x4'));var attributes=require(_0xcd61('0x5'));module[_0xcd61('0x6')]=function(_0x3be823,_0x16c4c3){return _0x3be823[_0xcd61('0x7')](_0xcd61('0x8'),attributes,{'tableName':_0xcd61('0x9'),'paranoid':![],'indexes':[{'name':_0xcd61('0xa'),'fields':[_0xcd61('0xb'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
index 168da36..6f3f898 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9cb=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x557f28,_0xc7a5a6){var _0x2ffa93=function(_0x57abe2){while(--_0x57abe2){_0x557f28['push'](_0x557f28['shift']());}};_0x2ffa93(++_0xc7a5a6);}(_0xc9cb,0x14d));var _0xbc9c=function(_0x3cd394,_0x206454){_0x3cd394=_0x3cd394-0x0;var _0x3a5967=_0xc9cb[_0x3cd394];return _0x3a5967;};'use strict';var _=require(_0xbc9c('0x0'));var util=require('util');var moment=require(_0xbc9c('0x1'));var BPromise=require(_0xbc9c('0x2'));var rs=require(_0xbc9c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc9c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc9c('0x5'))(_0xbc9c('0x6'));var config=require(_0xbc9c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbc9c('0x8')][_0xbc9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x221b33,_0x48db53,_0x3cc98a){return new BPromise(function(_0x47e724,_0x34d10a){return client[_0xbc9c('0xa')](_0x221b33,_0x3cc98a)[_0xbc9c('0xb')](function(_0x23ddf5){logger[_0xbc9c('0xc')](_0xbc9c('0xd'),_0x48db53,_0xbc9c('0xe'));logger['debug'](_0xbc9c('0xf'),_0x48db53,_0xbc9c('0xe'),JSON['stringify'](_0x23ddf5));if(_0x23ddf5[_0xbc9c('0x10')]){if(_0x23ddf5[_0xbc9c('0x10')][_0xbc9c('0x11')]===0x1f4){logger[_0xbc9c('0x10')](_0xbc9c('0xd'),_0x48db53,_0x23ddf5[_0xbc9c('0x10')][_0xbc9c('0x12')]);return _0x34d10a(_0x23ddf5[_0xbc9c('0x10')][_0xbc9c('0x12')]);}logger[_0xbc9c('0x10')](_0xbc9c('0xd'),_0x48db53,_0x23ddf5[_0xbc9c('0x10')][_0xbc9c('0x12')]);return _0x47e724(_0x23ddf5['error'][_0xbc9c('0x12')]);}else{logger['info'](_0xbc9c('0xd'),_0x48db53,_0xbc9c('0xe'));_0x47e724(_0x23ddf5[_0xbc9c('0x13')]['message']);}})[_0xbc9c('0x14')](function(_0x245f46){logger[_0xbc9c('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x48db53,_0x245f46);_0x34d10a(_0x245f46);});});}
\ No newline at end of file
+var _0xa33a=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3b28bf,_0xf59e){var _0x4244a0=function(_0x26571a){while(--_0x26571a){_0x3b28bf['push'](_0x3b28bf['shift']());}};_0x4244a0(++_0xf59e);}(_0xa33a,0xd0));var _0xaa33=function(_0x14a5d9,_0x44a5bf){_0x14a5d9=_0x14a5d9-0x0;var _0x1c3f9d=_0xa33a[_0x14a5d9];return _0x1c3f9d;};'use strict';var _=require(_0xaa33('0x0'));var util=require(_0xaa33('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaa33('0x2'));var fs=require('fs');var Redis=require(_0xaa33('0x3'));var db=require(_0xaa33('0x4'))['db'];var utils=require(_0xaa33('0x5'));var logger=require(_0xaa33('0x6'))(_0xaa33('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa33('0x8'));var client=jayson[_0xaa33('0x9')][_0xaa33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e86a8,_0xef831e,_0x5e3e2b){return new BPromise(function(_0xf22fee,_0xa144d){return client[_0xaa33('0xb')](_0x4e86a8,_0x5e3e2b)['then'](function(_0xeea6f2){logger[_0xaa33('0xc')](_0xaa33('0xd'),_0xef831e,_0xaa33('0xe'));logger[_0xaa33('0xf')](_0xaa33('0x10'),_0xef831e,_0xaa33('0xe'),JSON[_0xaa33('0x11')](_0xeea6f2));if(_0xeea6f2[_0xaa33('0x12')]){if(_0xeea6f2[_0xaa33('0x12')][_0xaa33('0x13')]===0x1f4){logger['error'](_0xaa33('0xd'),_0xef831e,_0xeea6f2[_0xaa33('0x12')][_0xaa33('0x14')]);return _0xa144d(_0xeea6f2[_0xaa33('0x12')][_0xaa33('0x14')]);}logger[_0xaa33('0x12')](_0xaa33('0xd'),_0xef831e,_0xeea6f2[_0xaa33('0x12')]['message']);return _0xf22fee(_0xeea6f2[_0xaa33('0x12')]['message']);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0xef831e,_0xaa33('0xe'));_0xf22fee(_0xeea6f2[_0xaa33('0x15')]['message']);}})[_0xaa33('0x16')](function(_0x4cb7f9){logger[_0xaa33('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0xef831e,_0x4cb7f9);_0xa144d(_0x4cb7f9);});});}
\ No newline at end of file
index ee74355..e65c20c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcea2=['./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/download','download','/:id/downloads','downloads','post','put','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcea2,0x15a));var _0x2cea=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xcea2[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var auth=require(_0x2cea('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2cea('0x5'));var controller=require(_0x2cea('0x6'));router[_0x2cea('0x7')]('/',auth['isAuthenticated'](),controller[_0x2cea('0x8')]);router['get'](_0x2cea('0x9'),auth[_0x2cea('0xa')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x7')](_0x2cea('0xc'),auth[_0x2cea('0xa')](),controller['show']);router[_0x2cea('0x7')](_0x2cea('0xd'),auth[_0x2cea('0xa')](),controller[_0x2cea('0xe')]);router[_0x2cea('0x7')](_0x2cea('0xf'),controller[_0x2cea('0x10')]);router[_0x2cea('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2cea('0x12')](_0x2cea('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2cea('0x13')]('/:id',auth[_0x2cea('0xa')](),controller[_0x2cea('0x14')]);module[_0x2cea('0x15')]=router;
\ No newline at end of file
+var _0x1b73=['/:id/downloads','downloads','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','describe','/:id','show','download'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x1b73,0x1d5));var _0x31b7=function(_0x48f9ee,_0x7f330c){_0x48f9ee=_0x48f9ee-0x0;var _0x1f5b26=_0x1b73[_0x48f9ee];return _0x1f5b26;};'use strict';var multer=require('multer');var util=require(_0x31b7('0x0'));var path=require(_0x31b7('0x1'));var timeout=require(_0x31b7('0x2'));var express=require(_0x31b7('0x3'));var router=express['Router']();var auth=require(_0x31b7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x31b7('0x5'));var controller=require(_0x31b7('0x6'));router['get']('/',auth[_0x31b7('0x7')](),controller[_0x31b7('0x8')]);router[_0x31b7('0x9')]('/describe',auth[_0x31b7('0x7')](),controller[_0x31b7('0xa')]);router[_0x31b7('0x9')](_0x31b7('0xb'),auth[_0x31b7('0x7')](),controller[_0x31b7('0xc')]);router[_0x31b7('0x9')]('/:id/download',auth[_0x31b7('0x7')](),controller[_0x31b7('0xd')]);router[_0x31b7('0x9')](_0x31b7('0xe'),controller[_0x31b7('0xf')]);router[_0x31b7('0x10')]('/',auth[_0x31b7('0x7')](),controller[_0x31b7('0x11')]);router[_0x31b7('0x12')](_0x31b7('0xb'),auth['isAuthenticated'](),controller[_0x31b7('0x13')]);router[_0x31b7('0x14')](_0x31b7('0xb'),auth[_0x31b7('0x7')](),controller[_0x31b7('0x15')]);module[_0x31b7('0x16')]=router;
\ No newline at end of file
index 2d6d994..5d327c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc87d=['STRING','setDataValue','channel','split','INTEGER','DATE','format','toString','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','path','exports','VIRTUAL','value','getDataValue'];(function(_0x2c8850,_0x3816e8){var _0x49e77a=function(_0x3ace7e){while(--_0x3ace7e){_0x2c8850['push'](_0x2c8850['shift']());}};_0x49e77a(++_0x3816e8);}(_0xc87d,0x17a));var _0xdc87=function(_0x594aaf,_0x4a9273){_0x594aaf=_0x594aaf-0x0;var _0x2692aa=_0xc87d[_0x594aaf];return _0x2692aa;};'use strict';var Sequelize=require(_0xdc87('0x0'));var moment=require('moment');var path=require(_0xdc87('0x1'));module[_0xdc87('0x2')]={'format':{'type':Sequelize[_0xdc87('0x3')],'get':function(){return this['getDataValue'](_0xdc87('0x4'))?path['extname'](this[_0xdc87('0x5')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0xdc87('0x6')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x4ca0ce){if(_0x4ca0ce){this[_0xdc87('0x7')](_0xdc87('0x8'),_0x4ca0ce);this[_0xdc87('0x7')]('membername',_0x4ca0ce[_0xdc87('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xdc87('0x6')]},'calleridnum':{'type':Sequelize[_0xdc87('0x6')]},'calleridname':{'type':Sequelize[_0xdc87('0x6')]},'connectedlinenum':{'type':Sequelize[_0xdc87('0x6')]},'connectedlinename':{'type':Sequelize[_0xdc87('0x6')]},'accountcode':{'type':Sequelize[_0xdc87('0x6')]},'context':{'type':Sequelize[_0xdc87('0x6')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0xdc87('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xdc87('0x6')]},'userDisposition':{'type':Sequelize[_0xdc87('0x6')]},'createdAt':{'type':Sequelize[_0xdc87('0xb')],'get':function(){return moment(this[_0xdc87('0x5')]('createdAt'))[_0xdc87('0xc')]('MM-DD-YYYY\x20HH:mm')[_0xdc87('0xd')]();}},'updatedAt':{'type':Sequelize[_0xdc87('0xb')],'get':function(){return moment(this[_0xdc87('0x5')](_0xdc87('0xe')))[_0xdc87('0xc')](_0xdc87('0xf'))[_0xdc87('0xd')]();}}};
\ No newline at end of file
+var _0x9329=['exports','VIRTUAL','getDataValue','STRING','setDataValue','membername','split','INTEGER','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x9329,0x1c8));var _0x9932=function(_0x24f7eb,_0xc1208d){_0x24f7eb=_0x24f7eb-0x0;var _0x458922=_0x9329[_0x24f7eb];return _0x458922;};'use strict';var Sequelize=require(_0x9932('0x0'));var moment=require(_0x9932('0x1'));var path=require(_0x9932('0x2'));module[_0x9932('0x3')]={'format':{'type':Sequelize[_0x9932('0x4')],'get':function(){return this[_0x9932('0x5')]('value')?path['extname'](this[_0x9932('0x5')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x9932('0x6')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x85ffa1){if(_0x85ffa1){this[_0x9932('0x7')]('channel',_0x85ffa1);this['setDataValue'](_0x9932('0x8'),_0x85ffa1[_0x9932('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9932('0x6')]},'connectedlinenum':{'type':Sequelize[_0x9932('0x6')]},'connectedlinename':{'type':Sequelize[_0x9932('0x6')]},'accountcode':{'type':Sequelize[_0x9932('0x6')]},'context':{'type':Sequelize[_0x9932('0x6')]},'exten':{'type':Sequelize[_0x9932('0x6')]},'value':{'type':Sequelize[_0x9932('0x6')]},'type':{'type':Sequelize[_0x9932('0x6')]},'rating':{'type':Sequelize[_0x9932('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x9932('0x6')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x9932('0xb')))[_0x9932('0xc')](_0x9932('0xd'))[_0x9932('0xe')]();}},'updatedAt':{'type':Sequelize[_0x9932('0xf')],'get':function(){return moment(this['getDataValue'](_0x9932('0x10')))[_0x9932('0xc')]('MM-DD-YYYY\x20HH:mm')['toString']();}}};
\ No newline at end of file
index fd6598a..5e9772b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54a9=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','destroy','name','send','index','VoiceRecording','rawAttributes','differenceBy','keys','query','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','dateStart','add','day','merge','map','type','VIRTUAL','field','filter','includeAll','include','findAll','catch','show','params','options','find','body','update','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','Sequelize','filename','extname','unlink','sequelize','MD5','col','$and','push','decryptFile','ValidationError','VoiceRecording\x20not\x20found','html-pdf','rimraf'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x54a9,0x186));var _0x954a=function(_0x2766fe,_0x1f6024){_0x2766fe=_0x2766fe-0x0;var _0x10210a=_0x54a9[_0x2766fe];return _0x10210a;};'use strict';var pdf=require(_0x954a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x954a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x954a('0x2'));var rp=require(_0x954a('0x3'));var moment=require(_0x954a('0x4'));var BPromise=require(_0x954a('0x5'));var Mustache=require(_0x954a('0x6'));var util=require(_0x954a('0x7'));var path=require(_0x954a('0x8'));var sox=require('sox');var csv=require(_0x954a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x954a('0xa'));var squel=require(_0x954a('0xb'));var crypto=require(_0x954a('0xc'));var jsforce=require(_0x954a('0xd'));var deskjs=require(_0x954a('0xe'));var toCsv=require(_0x954a('0x9'));var querystring=require(_0x954a('0xf'));var Papa=require(_0x954a('0x10'));var Redis=require(_0x954a('0x11'));var qs=require('../../components/parsers/qs');var logger=require(_0x954a('0x12'))(_0x954a('0x13'));var utils=require(_0x954a('0x14'));var config=require(_0x954a('0x15'));var db=require(_0x954a('0x16'))['db'];function respondWithStatusCode(_0x4b2522,_0x388c7d){_0x388c7d=_0x388c7d||0xcc;return function(_0x4f0a44){if(_0x4f0a44){return _0x4b2522[_0x954a('0x17')](_0x388c7d);}return _0x4b2522[_0x954a('0x18')](_0x388c7d)[_0x954a('0x19')]();};}function respondWithResult(_0x3dcc4a,_0x26c450){_0x26c450=_0x26c450||0xc8;return function(_0xaa23de){if(_0xaa23de){return _0x3dcc4a[_0x954a('0x18')](_0x26c450)[_0x954a('0x1a')](_0xaa23de);}};}function respondWithFilteredResult(_0x163ce3,_0x11d574){return function(_0x3daee6){if(_0x3daee6){var _0x159be2=_0x3daee6[_0x954a('0x1b')],_0x1f393c=_0x11d574[_0x954a('0x1c')],_0x488b8c=_0x11d574[_0x954a('0x1c')]+_0x11d574['limit'],_0x22e60f;if(_0x488b8c>=_0x159be2){_0x488b8c=_0x159be2;_0x22e60f=0xc8;}else{_0x22e60f=0xce;}_0x163ce3[_0x954a('0x18')](_0x22e60f);return _0x163ce3['set'](_0x954a('0x1d'),_0x1f393c+'-'+_0x488b8c+'/'+_0x159be2)[_0x954a('0x1a')](_0x3daee6);}return null;};}function patchUpdates(_0x1a69ec){return function(_0x5af6bc){try{jsonpatch[_0x954a('0x1e')](_0x5af6bc,_0x1a69ec,!![]);}catch(_0x51a796){return BPromise[_0x954a('0x1f')](_0x51a796);}return _0x5af6bc[_0x954a('0x20')]();};}function saveUpdates(_0x212093,_0x428895){return function(_0x2a2511){if(_0x2a2511){return _0x2a2511['update'](_0x212093)[_0x954a('0x21')](function(_0x17d17b){return _0x17d17b;});}return null;};}function removeEntity(_0x2c123c,_0x1cd21a){return function(_0x3a3766){if(_0x3a3766){return _0x3a3766[_0x954a('0x22')]()[_0x954a('0x21')](function(){_0x2c123c[_0x954a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x549c20,_0x56af4b){return function(_0x163f2f){if(!_0x163f2f){_0x549c20[_0x954a('0x17')](0x194);}return _0x163f2f;};}function handleError(_0x4b013d,_0x5328c7){_0x5328c7=_0x5328c7||0x1f4;return function(_0x221a2c){logger['error'](_0x221a2c['stack']);if(_0x221a2c[_0x954a('0x23')]){delete _0x221a2c[_0x954a('0x23')];}_0x4b013d[_0x954a('0x18')](_0x5328c7)[_0x954a('0x24')](_0x221a2c);};}exports[_0x954a('0x25')]=function(_0x21b602,_0x49fb5c){var _0x6c1fb7={},_0x3703cc={},_0x3f2ced={'count':0x0,'rows':[]};var _0x462b83=db[_0x954a('0x26')][_0x954a('0x27')];_0x3703cc['model']=_[_0x954a('0x28')](_[_0x954a('0x29')](_0x462b83),['format']);var _0x533705={'dateStart':_0x21b602[_0x954a('0x2a')]['dateStart'],'dateEnd':_0x21b602[_0x954a('0x2a')]['dateEnd']};delete _0x21b602[_0x954a('0x2a')]['dateStart'];delete _0x21b602[_0x954a('0x2a')][_0x954a('0x2b')];_0x3703cc[_0x954a('0x2a')]=_[_0x954a('0x29')](_0x21b602['query']);_0x3703cc[_0x954a('0x2c')]=_[_0x954a('0x2d')](_0x3703cc[_0x954a('0x2e')],_0x3703cc[_0x954a('0x2a')]);_0x6c1fb7[_0x954a('0x2f')]=_['intersection'](_0x3703cc[_0x954a('0x2e')],qs['fields'](_0x21b602['query'][_0x954a('0x30')]));_0x6c1fb7['attributes']=_0x6c1fb7[_0x954a('0x2f')][_0x954a('0x31')]?_0x6c1fb7[_0x954a('0x2f')]:_0x3703cc[_0x954a('0x2e')];if(!_0x21b602[_0x954a('0x2a')][_0x954a('0x32')](_0x954a('0x33'))){_0x6c1fb7['limit']=qs[_0x954a('0x34')](_0x21b602[_0x954a('0x2a')][_0x954a('0x34')]);_0x6c1fb7[_0x954a('0x1c')]=qs[_0x954a('0x1c')](_0x21b602[_0x954a('0x2a')][_0x954a('0x1c')]);}_0x6c1fb7[_0x954a('0x35')]=qs[_0x954a('0x36')](_0x21b602[_0x954a('0x2a')]['sort']);_0x6c1fb7[_0x954a('0x37')]=qs[_0x954a('0x2c')](_[_0x954a('0x38')](_0x21b602['query'],_0x3703cc[_0x954a('0x2c')]));if(_0x533705[_0x954a('0x39')]){if(_0x533705['dateEnd']){_0x533705[_0x954a('0x2b')]=moment(_0x533705['dateEnd'])[_0x954a('0x3a')](0x1,_0x954a('0x3b'));}else{_0x533705[_0x954a('0x2b')]=moment(_0x533705[_0x954a('0x39')])[_0x954a('0x3a')](0x1,_0x954a('0x3b'));}_['merge'](_0x6c1fb7[_0x954a('0x37')],{'createdAt':{'$gte':_0x533705[_0x954a('0x39')],'$lte':_0x533705['dateEnd']}});}if(_0x21b602[_0x954a('0x2a')]['filter']){_0x6c1fb7['where']=_[_0x954a('0x3c')](_0x6c1fb7[_0x954a('0x37')],{'$or':_[_0x954a('0x3d')](_0x462b83,function(_0x229070){if(_0x229070[_0x954a('0x3e')]['key']!==_0x954a('0x3f')){var _0x4e5b2b={};_0x4e5b2b[_0x229070[_0x954a('0x40')]]={'$like':'%'+_0x21b602[_0x954a('0x2a')][_0x954a('0x41')]+'%'};return _0x4e5b2b;}})});}_0x6c1fb7=_[_0x954a('0x3c')]({},_0x6c1fb7,_0x21b602['options']);var _0x1782e1={'where':_0x6c1fb7[_0x954a('0x37')]};return db[_0x954a('0x26')][_0x954a('0x1b')](_0x1782e1)['then'](function(_0x419a42){_0x3f2ced['count']=_0x419a42;if(_0x21b602[_0x954a('0x2a')][_0x954a('0x42')]){_0x6c1fb7[_0x954a('0x43')]=[{'all':!![]}];}return db[_0x954a('0x26')][_0x954a('0x44')](_0x6c1fb7);})['then'](function(_0x1f7eb6){_0x3f2ced['rows']=_0x1f7eb6;return _0x3f2ced;})[_0x954a('0x21')](respondWithFilteredResult(_0x49fb5c,_0x6c1fb7))[_0x954a('0x45')](handleError(_0x49fb5c,null));};exports[_0x954a('0x46')]=function(_0x5e3949,_0x4355c8){var _0x3b2351={'raw':![],'where':{'id':_0x5e3949[_0x954a('0x47')]['id']}},_0x12210d={};_0x12210d[_0x954a('0x2e')]=_[_0x954a('0x29')](db[_0x954a('0x26')][_0x954a('0x27')]);_0x12210d[_0x954a('0x2a')]=_[_0x954a('0x29')](_0x5e3949[_0x954a('0x2a')]);_0x12210d['filters']=_[_0x954a('0x2d')](_0x12210d[_0x954a('0x2e')],_0x12210d['query']);_0x3b2351['attributes']=_[_0x954a('0x2d')](_0x12210d[_0x954a('0x2e')],qs['fields'](_0x5e3949[_0x954a('0x2a')]['fields']));_0x3b2351[_0x954a('0x2f')]=_0x3b2351['attributes'][_0x954a('0x31')]?_0x3b2351[_0x954a('0x2f')]:_0x12210d[_0x954a('0x2e')];if(_0x5e3949[_0x954a('0x2a')][_0x954a('0x42')]){_0x3b2351['include']=[{'all':!![]}];}_0x3b2351=_[_0x954a('0x3c')]({},_0x3b2351,_0x5e3949[_0x954a('0x48')]);return db[_0x954a('0x26')][_0x954a('0x49')](_0x3b2351)[_0x954a('0x21')](handleEntityNotFound(_0x4355c8,null))['then'](respondWithResult(_0x4355c8,null))[_0x954a('0x45')](handleError(_0x4355c8,null));};exports['create']=function(_0x5f36a0,_0x226f4f){return db['VoiceRecording']['create'](_0x5f36a0[_0x954a('0x4a')],{})[_0x954a('0x21')](respondWithResult(_0x226f4f,0xc9))[_0x954a('0x45')](handleError(_0x226f4f,null));};exports[_0x954a('0x4b')]=function(_0x42ebb4,_0x3465ab){if(_0x42ebb4['body']['id']){delete _0x42ebb4['body']['id'];}return db[_0x954a('0x26')][_0x954a('0x49')]({'where':{'id':_0x42ebb4[_0x954a('0x47')]['id']}})[_0x954a('0x21')](handleEntityNotFound(_0x3465ab,null))[_0x954a('0x21')](saveUpdates(_0x42ebb4[_0x954a('0x4a')],null))[_0x954a('0x21')](respondWithResult(_0x3465ab,null))['catch'](handleError(_0x3465ab,null));};exports['destroy']=function(_0x11c038,_0x564e16){return db['VoiceRecording'][_0x954a('0x49')]({'where':{'id':_0x11c038[_0x954a('0x47')]['id']}})[_0x954a('0x21')](handleEntityNotFound(_0x564e16,null))[_0x954a('0x21')](removeEntity(_0x564e16,null))[_0x954a('0x45')](handleError(_0x564e16,null));};exports[_0x954a('0x4c')]=function(_0xb1896d,_0xe3a70c){return db['VoiceRecording'][_0x954a('0x4c')]()[_0x954a('0x21')](respondWithResult(_0xe3a70c,null))[_0x954a('0x45')](handleError(_0xe3a70c,null));};exports[_0x954a('0x4d')]=function(_0xce6a89,_0x3b84d1,_0xd13152){var _0x11a494=require(_0x954a('0x4e'));var _0x4d2ccb=![];var _0x5b5969={};if(_0xce6a89[_0x954a('0x2a')][_0x954a('0x3e')]&&_0xce6a89[_0x954a('0x2a')][_0x954a('0x3e')]===_0x954a('0x4f')){_0x5b5969[_0x954a('0x4f')]=_0xce6a89[_0x954a('0x47')]['id'];}else{_0x5b5969['id']=_0xce6a89[_0x954a('0x47')]['id'];}return db[_0x954a('0x26')]['find']({'where':_0x5b5969,'attributes':['id',_0x954a('0x50')],'raw':!![]})[_0x954a('0x21')](handleEntityNotFound(_0x3b84d1,null))[_0x954a('0x21')](function(_0x30f645){if(_0x30f645){var _0x5280e3=util[_0x954a('0x51')](_0x954a('0x52'),_0x30f645[_0x954a('0x50')]);if(fs[_0x954a('0x53')](_0x5280e3)){_0x4d2ccb=!![];return _0x11a494['decryptFile'](_0x5280e3,_0x30f645[_0x954a('0x50')],config[_0x954a('0x54')][_0x954a('0x55')])[_0x954a('0x21')](function(){return _0x30f645;});}return _0x30f645;}})['then'](function(_0x99797){if(_0x99797){if(!fs[_0x954a('0x53')](_0x99797[_0x954a('0x50')])){throw new db[(_0x954a('0x56'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x99797[_0x954a('0x57')]){return _0x3b84d1['download'](_0x99797[_0x954a('0x50')],_0x99797[_0x954a('0x57')]+path[_0x954a('0x58')](_0x99797['value']),function(){if(_0x4d2ccb){fs[_0x954a('0x59')](_0x99797[_0x954a('0x50')]);}});}else{return _0x3b84d1[_0x954a('0x4d')](_0x99797['value'],function(_0x4f7eae){if(_0x4d2ccb){fs[_0x954a('0x59')](_0x99797[_0x954a('0x50')]);}});}}})[_0x954a('0x45')](handleError(_0x3b84d1,null));};exports['downloads']=function(_0xa86eb1,_0x230d1e,_0x36bb4d){var _0x1f2eea=require(_0x954a('0x4e'));var _0x351a3b=![];var _0x252e4b={'$and':[db[_0x954a('0x5a')][_0x954a('0x37')](db[_0x954a('0x5a')]['fn'](_0x954a('0x5b'),db[_0x954a('0x5a')][_0x954a('0x5c')](_0x954a('0x4f'))),_0xa86eb1['query']['token'])]};if(_0xa86eb1[_0x954a('0x2a')][_0x954a('0x3e')]&&_0xa86eb1[_0x954a('0x2a')]['type']==='uniqueid'){_0x252e4b[_0x954a('0x5d')][_0x954a('0x5e')]({'uniqueid':_0xa86eb1[_0x954a('0x47')]['id']});}else{_0x252e4b[_0x954a('0x5d')][_0x954a('0x5e')]({'id':_0xa86eb1[_0x954a('0x47')]['id']});}return db['VoiceRecording'][_0x954a('0x49')]({'where':_0x252e4b,'attributes':['id',_0x954a('0x50')],'raw':!![]})[_0x954a('0x21')](handleEntityNotFound(_0x230d1e,null))[_0x954a('0x21')](function(_0x344c23){if(_0x344c23){var _0x5bcc82=util['format'](_0x954a('0x52'),_0x344c23[_0x954a('0x50')]);if(fs[_0x954a('0x53')](_0x5bcc82)){_0x351a3b=!![];return _0x1f2eea[_0x954a('0x5f')](_0x5bcc82,_0x344c23['value'],config[_0x954a('0x54')]['recording'])[_0x954a('0x21')](function(){return _0x344c23;});}return _0x344c23;}})['then'](function(_0x2ab6c0){if(_0x2ab6c0){if(!fs[_0x954a('0x53')](_0x2ab6c0[_0x954a('0x50')])){throw new db[(_0x954a('0x56'))][(_0x954a('0x60'))](_0x954a('0x61'));}if(_0x2ab6c0['filename']){return _0x230d1e['download'](_0x2ab6c0[_0x954a('0x50')],_0x2ab6c0[_0x954a('0x57')]+path[_0x954a('0x58')](_0x2ab6c0['value']),function(){if(_0x351a3b){fs[_0x954a('0x59')](_0x2ab6c0['value']);}});}else{return _0x230d1e[_0x954a('0x4d')](_0x2ab6c0[_0x954a('0x50')],function(_0x4148a9){if(_0x351a3b){fs[_0x954a('0x59')](_0x2ab6c0['value']);}});}}})[_0x954a('0x45')](handleError(_0x230d1e,null));};
\ No newline at end of file
+var _0x1499=['ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','update','then','destroy','error','stack','name','send','index','VoiceRecording','rawAttributes','model','differenceBy','keys','format','query','dateStart','dateEnd','filters','intersection','attributes','length','hasOwnProperty','sort','where','add','day','merge','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','fields','find','catch','body','describe','download','type','uniqueid','value','%s.cypher','existsSync','secrets','Sequelize','ValidationError','filename','extname','unlink','downloads','sequelize','MD5','token','$and','push','decryptFile','recording','VoiceRecording\x20not\x20found','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','sox'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1499,0xb5));var _0x9149=function(_0x5e289a,_0x39e126){_0x5e289a=_0x5e289a-0x0;var _0x2885ce=_0x1499[_0x5e289a];return _0x2885ce;};'use strict';var pdf=require(_0x9149('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9149('0x1'));var zipdir=require(_0x9149('0x2'));var jsonpatch=require(_0x9149('0x3'));var rp=require('request-promise');var moment=require(_0x9149('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9149('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9149('0x6'));var csv=require('to-csv');var ejs=require(_0x9149('0x7'));var fs=require('fs');var _=require(_0x9149('0x8'));var squel=require(_0x9149('0x9'));var crypto=require(_0x9149('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9149('0xb'));var toCsv=require(_0x9149('0xc'));var querystring=require(_0x9149('0xd'));var Papa=require(_0x9149('0xe'));var Redis=require(_0x9149('0xf'));var qs=require(_0x9149('0x10'));var logger=require(_0x9149('0x11'))(_0x9149('0x12'));var utils=require(_0x9149('0x13'));var config=require('../../config/environment');var db=require(_0x9149('0x14'))['db'];function respondWithStatusCode(_0x2a7ec7,_0x1851b8){_0x1851b8=_0x1851b8||0xcc;return function(_0x13e0c5){if(_0x13e0c5){return _0x2a7ec7[_0x9149('0x15')](_0x1851b8);}return _0x2a7ec7[_0x9149('0x16')](_0x1851b8)[_0x9149('0x17')]();};}function respondWithResult(_0x3724c2,_0x512848){_0x512848=_0x512848||0xc8;return function(_0x4c76d9){if(_0x4c76d9){return _0x3724c2['status'](_0x512848)[_0x9149('0x18')](_0x4c76d9);}};}function respondWithFilteredResult(_0x9f0002,_0x119ca1){return function(_0x144970){if(_0x144970){var _0x206e74=_0x144970[_0x9149('0x19')],_0x235b59=_0x119ca1[_0x9149('0x1a')],_0x5d58c3=_0x119ca1[_0x9149('0x1a')]+_0x119ca1[_0x9149('0x1b')],_0x1fac5b;if(_0x5d58c3>=_0x206e74){_0x5d58c3=_0x206e74;_0x1fac5b=0xc8;}else{_0x1fac5b=0xce;}_0x9f0002[_0x9149('0x16')](_0x1fac5b);return _0x9f0002[_0x9149('0x1c')]('Content-Range',_0x235b59+'-'+_0x5d58c3+'/'+_0x206e74)[_0x9149('0x18')](_0x144970);}return null;};}function patchUpdates(_0x40113e){return function(_0x26c2ea){try{jsonpatch[_0x9149('0x1d')](_0x26c2ea,_0x40113e,!![]);}catch(_0x1f0d07){return BPromise['reject'](_0x1f0d07);}return _0x26c2ea['save']();};}function saveUpdates(_0x2697ff,_0x457dc5){return function(_0x264514){if(_0x264514){return _0x264514[_0x9149('0x1e')](_0x2697ff)[_0x9149('0x1f')](function(_0x3db44f){return _0x3db44f;});}return null;};}function removeEntity(_0x3f42b9,_0x107f9c){return function(_0x3adab5){if(_0x3adab5){return _0x3adab5[_0x9149('0x20')]()[_0x9149('0x1f')](function(){_0x3f42b9[_0x9149('0x16')](0xcc)[_0x9149('0x17')]();});}};}function handleEntityNotFound(_0x3ac03c,_0x56eb5b){return function(_0x30b567){if(!_0x30b567){_0x3ac03c[_0x9149('0x15')](0x194);}return _0x30b567;};}function handleError(_0x1f7da2,_0x4aa3b8){_0x4aa3b8=_0x4aa3b8||0x1f4;return function(_0x421c9b){logger[_0x9149('0x21')](_0x421c9b[_0x9149('0x22')]);if(_0x421c9b[_0x9149('0x23')]){delete _0x421c9b[_0x9149('0x23')];}_0x1f7da2[_0x9149('0x16')](_0x4aa3b8)[_0x9149('0x24')](_0x421c9b);};}exports[_0x9149('0x25')]=function(_0x3a1600,_0x521387){var _0x56208c={},_0x1ed305={},_0x5b2958={'count':0x0,'rows':[]};var _0x21d374=db[_0x9149('0x26')][_0x9149('0x27')];_0x1ed305[_0x9149('0x28')]=_[_0x9149('0x29')](_[_0x9149('0x2a')](_0x21d374),[_0x9149('0x2b')]);var _0xa88f40={'dateStart':_0x3a1600['query']['dateStart'],'dateEnd':_0x3a1600[_0x9149('0x2c')]['dateEnd']};delete _0x3a1600[_0x9149('0x2c')][_0x9149('0x2d')];delete _0x3a1600[_0x9149('0x2c')][_0x9149('0x2e')];_0x1ed305[_0x9149('0x2c')]=_[_0x9149('0x2a')](_0x3a1600['query']);_0x1ed305[_0x9149('0x2f')]=_[_0x9149('0x30')](_0x1ed305[_0x9149('0x28')],_0x1ed305[_0x9149('0x2c')]);_0x56208c[_0x9149('0x31')]=_['intersection'](_0x1ed305[_0x9149('0x28')],qs['fields'](_0x3a1600[_0x9149('0x2c')]['fields']));_0x56208c['attributes']=_0x56208c['attributes'][_0x9149('0x32')]?_0x56208c[_0x9149('0x31')]:_0x1ed305[_0x9149('0x28')];if(!_0x3a1600[_0x9149('0x2c')][_0x9149('0x33')]('nolimit')){_0x56208c[_0x9149('0x1b')]=qs[_0x9149('0x1b')](_0x3a1600[_0x9149('0x2c')][_0x9149('0x1b')]);_0x56208c[_0x9149('0x1a')]=qs[_0x9149('0x1a')](_0x3a1600[_0x9149('0x2c')]['offset']);}_0x56208c['order']=qs[_0x9149('0x34')](_0x3a1600[_0x9149('0x2c')][_0x9149('0x34')]);_0x56208c[_0x9149('0x35')]=qs[_0x9149('0x2f')](_['pick'](_0x3a1600['query'],_0x1ed305['filters']));if(_0xa88f40['dateStart']){if(_0xa88f40[_0x9149('0x2e')]){_0xa88f40[_0x9149('0x2e')]=moment(_0xa88f40[_0x9149('0x2e')])[_0x9149('0x36')](0x1,'day');}else{_0xa88f40[_0x9149('0x2e')]=moment(_0xa88f40[_0x9149('0x2d')])['add'](0x1,_0x9149('0x37'));}_[_0x9149('0x38')](_0x56208c[_0x9149('0x35')],{'createdAt':{'$gte':_0xa88f40[_0x9149('0x2d')],'$lte':_0xa88f40[_0x9149('0x2e')]}});}if(_0x3a1600[_0x9149('0x2c')]['filter']){_0x56208c[_0x9149('0x35')]=_['merge'](_0x56208c[_0x9149('0x35')],{'$or':_['map'](_0x21d374,function(_0x43e5f0){if(_0x43e5f0['type'][_0x9149('0x39')]!==_0x9149('0x3a')){var _0x212170={};_0x212170[_0x43e5f0[_0x9149('0x3b')]]={'$like':'%'+_0x3a1600[_0x9149('0x2c')][_0x9149('0x3c')]+'%'};return _0x212170;}})});}_0x56208c=_['merge']({},_0x56208c,_0x3a1600[_0x9149('0x3d')]);var _0x4a3239={'where':_0x56208c['where']};return db[_0x9149('0x26')]['count'](_0x4a3239)['then'](function(_0x1ef5e8){_0x5b2958['count']=_0x1ef5e8;if(_0x3a1600['query'][_0x9149('0x3e')]){_0x56208c[_0x9149('0x3f')]=[{'all':!![]}];}return db['VoiceRecording'][_0x9149('0x40')](_0x56208c);})[_0x9149('0x1f')](function(_0x189fe6){_0x5b2958[_0x9149('0x41')]=_0x189fe6;return _0x5b2958;})[_0x9149('0x1f')](respondWithFilteredResult(_0x521387,_0x56208c))['catch'](handleError(_0x521387,null));};exports[_0x9149('0x42')]=function(_0x1ecf57,_0x245d7a){var _0x5d14f4={'raw':![],'where':{'id':_0x1ecf57[_0x9149('0x43')]['id']}},_0x16ca48={};_0x16ca48['model']=_[_0x9149('0x2a')](db[_0x9149('0x26')]['rawAttributes']);_0x16ca48[_0x9149('0x2c')]=_['keys'](_0x1ecf57[_0x9149('0x2c')]);_0x16ca48[_0x9149('0x2f')]=_[_0x9149('0x30')](_0x16ca48[_0x9149('0x28')],_0x16ca48[_0x9149('0x2c')]);_0x5d14f4[_0x9149('0x31')]=_[_0x9149('0x30')](_0x16ca48['model'],qs[_0x9149('0x44')](_0x1ecf57[_0x9149('0x2c')][_0x9149('0x44')]));_0x5d14f4['attributes']=_0x5d14f4[_0x9149('0x31')][_0x9149('0x32')]?_0x5d14f4[_0x9149('0x31')]:_0x16ca48[_0x9149('0x28')];if(_0x1ecf57['query']['includeAll']){_0x5d14f4[_0x9149('0x3f')]=[{'all':!![]}];}_0x5d14f4=_[_0x9149('0x38')]({},_0x5d14f4,_0x1ecf57[_0x9149('0x3d')]);return db['VoiceRecording'][_0x9149('0x45')](_0x5d14f4)['then'](handleEntityNotFound(_0x245d7a,null))[_0x9149('0x1f')](respondWithResult(_0x245d7a,null))[_0x9149('0x46')](handleError(_0x245d7a,null));};exports['create']=function(_0x130da8,_0xe7d714){return db[_0x9149('0x26')]['create'](_0x130da8[_0x9149('0x47')],{})[_0x9149('0x1f')](respondWithResult(_0xe7d714,0xc9))['catch'](handleError(_0xe7d714,null));};exports[_0x9149('0x1e')]=function(_0x59894d,_0xd68001){if(_0x59894d['body']['id']){delete _0x59894d[_0x9149('0x47')]['id'];}return db[_0x9149('0x26')][_0x9149('0x45')]({'where':{'id':_0x59894d[_0x9149('0x43')]['id']}})['then'](handleEntityNotFound(_0xd68001,null))['then'](saveUpdates(_0x59894d[_0x9149('0x47')],null))['then'](respondWithResult(_0xd68001,null))[_0x9149('0x46')](handleError(_0xd68001,null));};exports[_0x9149('0x20')]=function(_0x50809f,_0x4ea6c1){return db[_0x9149('0x26')][_0x9149('0x45')]({'where':{'id':_0x50809f[_0x9149('0x43')]['id']}})[_0x9149('0x1f')](handleEntityNotFound(_0x4ea6c1,null))[_0x9149('0x1f')](removeEntity(_0x4ea6c1,null))[_0x9149('0x46')](handleError(_0x4ea6c1,null));};exports[_0x9149('0x48')]=function(_0x4fae6a,_0x4dd1cc){return db[_0x9149('0x26')][_0x9149('0x48')]()['then'](respondWithResult(_0x4dd1cc,null))[_0x9149('0x46')](handleError(_0x4dd1cc,null));};exports[_0x9149('0x49')]=function(_0x629423,_0x5bbcf7,_0x3a95df){var _0x30be2d=require('../../components/encryptor');var _0x3e1477=![];var _0x924c66={};if(_0x629423['query'][_0x9149('0x4a')]&&_0x629423[_0x9149('0x2c')][_0x9149('0x4a')]===_0x9149('0x4b')){_0x924c66['uniqueid']=_0x629423[_0x9149('0x43')]['id'];}else{_0x924c66['id']=_0x629423[_0x9149('0x43')]['id'];}return db[_0x9149('0x26')][_0x9149('0x45')]({'where':_0x924c66,'attributes':['id',_0x9149('0x4c')],'raw':!![]})[_0x9149('0x1f')](handleEntityNotFound(_0x5bbcf7,null))[_0x9149('0x1f')](function(_0x2d1bfc){if(_0x2d1bfc){var _0x4d26de=util[_0x9149('0x2b')](_0x9149('0x4d'),_0x2d1bfc[_0x9149('0x4c')]);if(fs[_0x9149('0x4e')](_0x4d26de)){_0x3e1477=!![];return _0x30be2d['decryptFile'](_0x4d26de,_0x2d1bfc['value'],config[_0x9149('0x4f')]['recording'])['then'](function(){return _0x2d1bfc;});}return _0x2d1bfc;}})[_0x9149('0x1f')](function(_0x5758c7){if(_0x5758c7){if(!fs[_0x9149('0x4e')](_0x5758c7[_0x9149('0x4c')])){throw new db[(_0x9149('0x50'))][(_0x9149('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x5758c7[_0x9149('0x52')]){return _0x5bbcf7[_0x9149('0x49')](_0x5758c7['value'],_0x5758c7['filename']+path[_0x9149('0x53')](_0x5758c7['value']),function(){if(_0x3e1477){fs[_0x9149('0x54')](_0x5758c7[_0x9149('0x4c')]);}});}else{return _0x5bbcf7['download'](_0x5758c7[_0x9149('0x4c')],function(_0x5ccca6){if(_0x3e1477){fs[_0x9149('0x54')](_0x5758c7[_0x9149('0x4c')]);}});}}})[_0x9149('0x46')](handleError(_0x5bbcf7,null));};exports[_0x9149('0x55')]=function(_0x35f1c0,_0x3295ff,_0x489173){var _0x15264b=require('../../components/encryptor');var _0x8bb84b=![];var _0x1b3c0e={'$and':[db['sequelize'][_0x9149('0x35')](db[_0x9149('0x56')]['fn'](_0x9149('0x57'),db[_0x9149('0x56')]['col'](_0x9149('0x4b'))),_0x35f1c0[_0x9149('0x2c')][_0x9149('0x58')])]};if(_0x35f1c0[_0x9149('0x2c')][_0x9149('0x4a')]&&_0x35f1c0[_0x9149('0x2c')]['type']==='uniqueid'){_0x1b3c0e['$and']['push']({'uniqueid':_0x35f1c0['params']['id']});}else{_0x1b3c0e[_0x9149('0x59')][_0x9149('0x5a')]({'id':_0x35f1c0[_0x9149('0x43')]['id']});}return db[_0x9149('0x26')][_0x9149('0x45')]({'where':_0x1b3c0e,'attributes':['id',_0x9149('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x3295ff,null))[_0x9149('0x1f')](function(_0x312f5e){if(_0x312f5e){var _0x26dd3a=util[_0x9149('0x2b')]('%s.cypher',_0x312f5e['value']);if(fs[_0x9149('0x4e')](_0x26dd3a)){_0x8bb84b=!![];return _0x15264b[_0x9149('0x5b')](_0x26dd3a,_0x312f5e['value'],config[_0x9149('0x4f')][_0x9149('0x5c')])['then'](function(){return _0x312f5e;});}return _0x312f5e;}})[_0x9149('0x1f')](function(_0x490955){if(_0x490955){if(!fs[_0x9149('0x4e')](_0x490955[_0x9149('0x4c')])){throw new db['Sequelize'][(_0x9149('0x51'))](_0x9149('0x5d'));}if(_0x490955[_0x9149('0x52')]){return _0x3295ff[_0x9149('0x49')](_0x490955['value'],_0x490955[_0x9149('0x52')]+path['extname'](_0x490955['value']),function(){if(_0x8bb84b){fs['unlink'](_0x490955[_0x9149('0x4c')]);}});}else{return _0x3295ff[_0x9149('0x49')](_0x490955['value'],function(_0x363c1b){if(_0x8bb84b){fs[_0x9149('0x54')](_0x490955[_0x9149('0x4c')]);}});}}})[_0x9149('0x46')](handleError(_0x3295ff,null));};
\ No newline at end of file
index eb15d0b..4c7f64a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb63=['exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','./voiceRecording.attributes'];(function(_0x46b2b9,_0x10349d){var _0x36c39c=function(_0x300f5a){while(--_0x300f5a){_0x46b2b9['push'](_0x46b2b9['shift']());}};_0x36c39c(++_0x10349d);}(_0xfb63,0x1e1));var _0x3fb6=function(_0x5d6e9c,_0xc28379){_0x5d6e9c=_0x5d6e9c-0x0;var _0x17c875=_0xfb63[_0x5d6e9c];return _0x17c875;};'use strict';var _=require(_0x3fb6('0x0'));var util=require(_0x3fb6('0x1'));var logger=require(_0x3fb6('0x2'))(_0x3fb6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x3fb6('0x4'));module[_0x3fb6('0x5')]=function(_0x51a4b6,_0x4120a5){return _0x51a4b6[_0x3fb6('0x6')]('VoiceRecording',attributes,{'tableName':_0x3fb6('0x7'),'paranoid':![],'indexes':[{'name':_0x3fb6('0x8'),'fields':[_0x3fb6('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5f4=['uniqueid','api','moment','./voiceRecording.attributes','exports','define','voice_recordings'];(function(_0x32c6b5,_0x13f0a1){var _0x109436=function(_0x58c95b){while(--_0x58c95b){_0x32c6b5['push'](_0x32c6b5['shift']());}};_0x109436(++_0x13f0a1);}(_0xe5f4,0x7f));var _0x4e5f=function(_0x34e79d,_0x1fb826){_0x34e79d=_0x34e79d-0x0;var _0x56afa8=_0xe5f4[_0x34e79d];return _0x56afa8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4e5f('0x0'));var moment=require(_0x4e5f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var attributes=require(_0x4e5f('0x2'));module[_0x4e5f('0x3')]=function(_0x553d16,_0x147203){return _0x553d16[_0x4e5f('0x4')]('VoiceRecording',attributes,{'tableName':_0x4e5f('0x5'),'paranoid':![],'indexes':[{'name':_0x4e5f('0x6'),'fields':[_0x4e5f('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
index f9a73cf..38dba53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5939=['format','CreateVoiceRecording\x20file\x20encrypted','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','VoiceRecording','create','existsSync','value'];(function(_0x3481d7,_0x4fb52a){var _0xf50029=function(_0x648fd8){while(--_0x648fd8){_0x3481d7['push'](_0x3481d7['shift']());}};_0xf50029(++_0x4fb52a);}(_0x5939,0xf2));var _0x9593=function(_0x217ae9,_0x1be506){_0x217ae9=_0x217ae9-0x0;var _0xf2d705=_0x5939[_0x217ae9];return _0xf2d705;};'use strict';var _=require(_0x9593('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9593('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9593('0x2'));var db=require(_0x9593('0x3'))['db'];var utils=require(_0x9593('0x4'));var logger=require(_0x9593('0x5'))('rpc');var config=require(_0x9593('0x6'));var jayson=require(_0x9593('0x7'));var client=jayson['client'][_0x9593('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10b26d,_0x3550e3,_0x361e9a){return new BPromise(function(_0x4e142b,_0x1c0b75){return client[_0x9593('0x9')](_0x10b26d,_0x361e9a)[_0x9593('0xa')](function(_0x32aab4){logger[_0x9593('0xb')](_0x9593('0xc'),_0x3550e3,_0x9593('0xd'));logger[_0x9593('0xe')](_0x9593('0xf'),_0x3550e3,_0x9593('0xd'),JSON[_0x9593('0x10')](_0x32aab4));if(_0x32aab4['error']){if(_0x32aab4[_0x9593('0x11')][_0x9593('0x12')]===0x1f4){logger[_0x9593('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x3550e3,_0x32aab4['error'][_0x9593('0x13')]);return _0x1c0b75(_0x32aab4[_0x9593('0x11')][_0x9593('0x13')]);}logger['error'](_0x9593('0xc'),_0x3550e3,_0x32aab4['error']['message']);return _0x4e142b(_0x32aab4[_0x9593('0x11')][_0x9593('0x13')]);}else{logger[_0x9593('0xb')](_0x9593('0xc'),_0x3550e3,_0x9593('0xd'));_0x4e142b(_0x32aab4[_0x9593('0x14')][_0x9593('0x13')]);}})[_0x9593('0x15')](function(_0x52780f){logger['error'](_0x9593('0xc'),_0x3550e3,_0x52780f);_0x1c0b75(_0x52780f);});});}exports[_0x9593('0x16')]=function(_0x4565f4){var _0x3ee4c1=this;return new Promise(function(_0x1253d5,_0x31503f){return db['VoiceRecording'][_0x9593('0x17')](_0x4565f4[_0x9593('0x18')],{'raw':_0x4565f4[_0x9593('0x19')]?_0x4565f4['options'][_0x9593('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4565f4[_0x9593('0x19')]?_0x4565f4[_0x9593('0x19')][_0x9593('0x1b')]||null:null,'attributes':_0x4565f4[_0x9593('0x19')]?_0x4565f4[_0x9593('0x19')][_0x9593('0x1c')]||null:null,'limit':_0x4565f4['options']?_0x4565f4[_0x9593('0x19')][_0x9593('0x1d')]||null:null})[_0x9593('0xa')](function(_0x16108b){logger[_0x9593('0xb')](_0x9593('0x16'),_0x4565f4);logger[_0x9593('0xe')]('UpdateVoiceRecording',_0x4565f4,JSON[_0x9593('0x10')](_0x16108b));_0x1253d5(_0x16108b);})[_0x9593('0x15')](function(_0x33a0c8){logger['error']('UpdateVoiceRecording',_0x33a0c8[_0x9593('0x13')],_0x4565f4);_0x31503f(_0x3ee4c1[_0x9593('0x11')](0x1f4,_0x33a0c8['message']));});});};exports[_0x9593('0x1e')]=function(_0x23a6b1){var _0x37c6cc=this;return new Promise(function(_0x5d1c6b,_0x1b331b){var _0x3a040d=require(_0x9593('0x1f'));var _0xfc7121;return db[_0x9593('0x20')]['findOne']({'attributes':['id',_0x9593('0x21')],'where':{'id':0x1},'raw':!![]})[_0x9593('0xa')](function(_0x40c047){_0xfc7121=_0x40c047;return db[_0x9593('0x22')][_0x9593('0x23')](_0x23a6b1[_0x9593('0x18')]);})[_0x9593('0xa')](function(_0xf383e2){if(_0xfc7121[_0x9593('0x21')]&&fs[_0x9593('0x24')](_0xf383e2[_0x9593('0x25')])){var _0x12782e=util[_0x9593('0x26')]('%s.cypher',_0xf383e2[_0x9593('0x25')]);return _0x3a040d['encryptFile'](_0xf383e2[_0x9593('0x25')],_0x12782e,config['secrets']['recording'])[_0x9593('0xa')](function(){fs['unlink'](_0xf383e2['value']);logger[_0x9593('0xb')](_0x9593('0x27'));return _0xf383e2;});}return _0xf383e2;})[_0x9593('0xa')](function(_0xe18b9){logger[_0x9593('0xb')]('CreateVoiceRecording',_0x23a6b1);logger['debug'](_0x9593('0x1e'),_0x23a6b1,JSON[_0x9593('0x10')](_0xe18b9));_0x5d1c6b(_0xe18b9);})[_0x9593('0x15')](function(_0x207b20){logger[_0x9593('0x11')](_0x9593('0x1e'),_0x207b20[_0x9593('0x13')],_0x23a6b1);_0x1b331b(_0x37c6cc[_0x9593('0x11')](0x1f4,_0x207b20[_0x9593('0x13')]));});});};
\ No newline at end of file
+var _0xa8f8=['Setting','findOne','callRecordingEncryption','create','body','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','attributes','limit','then','info','CreateVoiceRecording'];(function(_0x45943c,_0x292e90){var _0xe1cf98=function(_0x4ba1ae){while(--_0x4ba1ae){_0x45943c['push'](_0x45943c['shift']());}};_0xe1cf98(++_0x292e90);}(_0xa8f8,0xc1));var _0x8a8f=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0xa8f8[_0x1e175d];return _0x3a3ce5;};'use strict';var _=require(_0x8a8f('0x0'));var util=require(_0x8a8f('0x1'));var moment=require(_0x8a8f('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a8f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a8f('0x5'))(_0x8a8f('0x6'));var config=require(_0x8a8f('0x7'));var jayson=require(_0x8a8f('0x8'));var client=jayson[_0x8a8f('0x9')][_0x8a8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a47a6,_0x2e8ae8,_0x470efd){return new BPromise(function(_0x4cbe7e,_0x48d031){return client['request'](_0x4a47a6,_0x470efd)['then'](function(_0x1fd3c0){logger['info'](_0x8a8f('0xb'),_0x2e8ae8,_0x8a8f('0xc'));logger[_0x8a8f('0xd')](_0x8a8f('0xe'),_0x2e8ae8,_0x8a8f('0xc'),JSON[_0x8a8f('0xf')](_0x1fd3c0));if(_0x1fd3c0[_0x8a8f('0x10')]){if(_0x1fd3c0['error'][_0x8a8f('0x11')]===0x1f4){logger[_0x8a8f('0x10')](_0x8a8f('0xb'),_0x2e8ae8,_0x1fd3c0[_0x8a8f('0x10')][_0x8a8f('0x12')]);return _0x48d031(_0x1fd3c0[_0x8a8f('0x10')][_0x8a8f('0x12')]);}logger['error'](_0x8a8f('0xb'),_0x2e8ae8,_0x1fd3c0[_0x8a8f('0x10')][_0x8a8f('0x12')]);return _0x4cbe7e(_0x1fd3c0[_0x8a8f('0x10')]['message']);}else{logger['info'](_0x8a8f('0xb'),_0x2e8ae8,_0x8a8f('0xc'));_0x4cbe7e(_0x1fd3c0[_0x8a8f('0x13')][_0x8a8f('0x12')]);}})[_0x8a8f('0x14')](function(_0x5a00b1){logger[_0x8a8f('0x10')](_0x8a8f('0xb'),_0x2e8ae8,_0x5a00b1);_0x48d031(_0x5a00b1);});});}exports[_0x8a8f('0x15')]=function(_0x1efaae){var _0x561f1e=this;return new Promise(function(_0x332151,_0x3a7359){return db[_0x8a8f('0x16')][_0x8a8f('0x17')](_0x1efaae['body'],{'raw':_0x1efaae[_0x8a8f('0x18')]?_0x1efaae[_0x8a8f('0x18')][_0x8a8f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1efaae['options']?_0x1efaae[_0x8a8f('0x18')][_0x8a8f('0x1a')]||null:null,'attributes':_0x1efaae['options']?_0x1efaae['options'][_0x8a8f('0x1b')]||null:null,'limit':_0x1efaae[_0x8a8f('0x18')]?_0x1efaae['options'][_0x8a8f('0x1c')]||null:null})[_0x8a8f('0x1d')](function(_0x23a4b9){logger[_0x8a8f('0x1e')](_0x8a8f('0x15'),_0x1efaae);logger['debug'](_0x8a8f('0x15'),_0x1efaae,JSON['stringify'](_0x23a4b9));_0x332151(_0x23a4b9);})['catch'](function(_0x353de6){logger['error'](_0x8a8f('0x15'),_0x353de6[_0x8a8f('0x12')],_0x1efaae);_0x3a7359(_0x561f1e[_0x8a8f('0x10')](0x1f4,_0x353de6[_0x8a8f('0x12')]));});});};exports[_0x8a8f('0x1f')]=function(_0x38b4b7){var _0xf0eaa8=this;return new Promise(function(_0x52dec6,_0x4783d1){var _0x1fb2a5=require('../../components/encryptor');var _0x5e0d2a;return db[_0x8a8f('0x20')][_0x8a8f('0x21')]({'attributes':['id',_0x8a8f('0x22')],'where':{'id':0x1},'raw':!![]})[_0x8a8f('0x1d')](function(_0x4b5089){_0x5e0d2a=_0x4b5089;return db[_0x8a8f('0x16')][_0x8a8f('0x23')](_0x38b4b7[_0x8a8f('0x24')]);})['then'](function(_0x487c31){if(_0x5e0d2a[_0x8a8f('0x22')]&&fs[_0x8a8f('0x25')](_0x487c31[_0x8a8f('0x26')])){var _0x17d1af=util['format'](_0x8a8f('0x27'),_0x487c31[_0x8a8f('0x26')]);return _0x1fb2a5[_0x8a8f('0x28')](_0x487c31['value'],_0x17d1af,config[_0x8a8f('0x29')][_0x8a8f('0x2a')])[_0x8a8f('0x1d')](function(){fs[_0x8a8f('0x2b')](_0x487c31['value']);logger[_0x8a8f('0x1e')](_0x8a8f('0x2c'));return _0x487c31;});}return _0x487c31;})['then'](function(_0x1d5552){logger[_0x8a8f('0x1e')](_0x8a8f('0x1f'),_0x38b4b7);logger[_0x8a8f('0xd')]('CreateVoiceRecording',_0x38b4b7,JSON['stringify'](_0x1d5552));_0x52dec6(_0x1d5552);})[_0x8a8f('0x14')](function(_0x18ef5b){logger['error'](_0x8a8f('0x1f'),_0x18ef5b[_0x8a8f('0x12')],_0x38b4b7);_0x4783d1(_0xf0eaa8[_0x8a8f('0x10')](0x1f4,_0x18ef5b['message']));});});};
\ No newline at end of file
index 7eb4621..27614d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d53=['isAuthenticated','create','put','/:id','update','delete','multer','util','express','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','show','post'];(function(_0x147df9,_0x230cb1){var _0x477e2d=function(_0x293a5f){while(--_0x293a5f){_0x147df9['push'](_0x147df9['shift']());}};_0x477e2d(++_0x230cb1);}(_0x8d53,0x76));var _0x38d5=function(_0x867a3e,_0x496e41){_0x867a3e=_0x867a3e-0x0;var _0x56c5ae=_0x8d53[_0x867a3e];return _0x56c5ae;};'use strict';var multer=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38d5('0x2'));var router=express[_0x38d5('0x3')]();var auth=require(_0x38d5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x38d5('0x5'));var controller=require(_0x38d5('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x38d5('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x38d5('0x8')]);router[_0x38d5('0x9')]('/',auth[_0x38d5('0xa')](),controller[_0x38d5('0xb')]);router[_0x38d5('0xc')](_0x38d5('0xd'),auth[_0x38d5('0xa')](),controller[_0x38d5('0xe')]);router[_0x38d5('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8729=['show','create','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','index','get','/:id','isAuthenticated'];(function(_0x495e29,_0x4ad361){var _0x1b7092=function(_0x3f4298){while(--_0x3f4298){_0x495e29['push'](_0x495e29['shift']());}};_0x1b7092(++_0x4ad361);}(_0x8729,0x124));var _0x9872=function(_0x1554d8,_0x59cd7a){_0x1554d8=_0x1554d8-0x0;var _0x3f01ba=_0x8729[_0x1554d8];return _0x3f01ba;};'use strict';var multer=require(_0x9872('0x0'));var util=require('util');var path=require(_0x9872('0x1'));var timeout=require(_0x9872('0x2'));var express=require(_0x9872('0x3'));var router=express[_0x9872('0x4')]();var auth=require(_0x9872('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9872('0x6'));var controller=require(_0x9872('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9872('0x8')]);router[_0x9872('0x9')](_0x9872('0xa'),auth[_0x9872('0xb')](),controller[_0x9872('0xc')]);router['post']('/',auth[_0x9872('0xb')](),controller[_0x9872('0xd')]);router['put'](_0x9872('0xa'),auth[_0x9872('0xb')](),controller[_0x9872('0xe')]);router['delete'](_0x9872('0xa'),auth[_0x9872('0xb')](),controller[_0x9872('0xf')]);module['exports']=router;
\ No newline at end of file
index 39ba36e..efd5737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72ef=['STRING','sequelize','ENUM','blind','attended'];(function(_0x28167a,_0x5dee70){var _0x574937=function(_0x3909ff){while(--_0x3909ff){_0x28167a['push'](_0x28167a['shift']());}};_0x574937(++_0x5dee70);}(_0x72ef,0x141));var _0xf72e=function(_0x595000,_0x3d973a){_0x595000=_0x595000-0x0;var _0x2c8b11=_0x72ef[_0x595000];return _0x2c8b11;};'use strict';var Sequelize=require(_0xf72e('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xf72e('0x1')](_0xf72e('0x2'),_0xf72e('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xf72e('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xf72e('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf72e('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xf72e('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xf72e('0x4')]},'transferercontext':{'type':Sequelize[_0xf72e('0x4')]},'transfererexten':{'type':Sequelize[_0xf72e('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xf72e('0x4')]},'transfereechannel':{'type':Sequelize[_0xf72e('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xf72e('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xf72e('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf72e('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xf72e('0x4')]},'transfereecontext':{'type':Sequelize[_0xf72e('0x4')]},'transfereeexten':{'type':Sequelize[_0xf72e('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xf72e('0x4')]},'isexternal':{'type':Sequelize[_0xf72e('0x1')]('Yes','No')},'context':{'type':Sequelize[_0xf72e('0x4')]},'extension':{'type':Sequelize[_0xf72e('0x4')]}};
\ No newline at end of file
+var _0xc0fa=['STRING','moment','ENUM','blind','attended'];(function(_0x31318a,_0x392de0){var _0x1fb4ec=function(_0x485d78){while(--_0x485d78){_0x31318a['push'](_0x31318a['shift']());}};_0x1fb4ec(++_0x392de0);}(_0xc0fa,0xc4));var _0xac0f=function(_0x360af4,_0x34f939){_0x360af4=_0x360af4-0x0;var _0x2cb5a4=_0xc0fa[_0x360af4];return _0x2cb5a4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xac0f('0x0'));module['exports']={'type':{'type':Sequelize[_0xac0f('0x1')](_0xac0f('0x2'),_0xac0f('0x3'))},'result':{'type':Sequelize[_0xac0f('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xac0f('0x4')]},'transferercalleridname':{'type':Sequelize[_0xac0f('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xac0f('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xac0f('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xac0f('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xac0f('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xac0f('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xac0f('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xac0f('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xac0f('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xac0f('0x1')]('Yes','No')},'context':{'type':Sequelize[_0xac0f('0x4')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d56b116..66bcc00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde9e=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','add','day','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','VoiceTransferReport','rows','params','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x277025,_0x29b4f0){var _0x232beb=function(_0x49f5aa){while(--_0x49f5aa){_0x277025['push'](_0x277025['shift']());}};_0x232beb(++_0x29b4f0);}(_0xde9e,0x1ae));var _0xede9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde9e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xede9('0x0'));var emlformat=require(_0xede9('0x1'));var rimraf=require(_0xede9('0x2'));var zipdir=require(_0xede9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xede9('0x4'));var moment=require(_0xede9('0x5'));var BPromise=require(_0xede9('0x6'));var Mustache=require(_0xede9('0x7'));var util=require(_0xede9('0x8'));var path=require(_0xede9('0x9'));var sox=require(_0xede9('0xa'));var csv=require('to-csv');var ejs=require(_0xede9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xede9('0xc'));var crypto=require(_0xede9('0xd'));var jsforce=require(_0xede9('0xe'));var deskjs=require(_0xede9('0xf'));var toCsv=require(_0xede9('0x10'));var querystring=require(_0xede9('0x11'));var Papa=require(_0xede9('0x12'));var Redis=require(_0xede9('0x13'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xede9('0x14'));var utils=require(_0xede9('0x15'));var config=require(_0xede9('0x16'));var db=require(_0xede9('0x17'))['db'];function respondWithStatusCode(_0x2605d9,_0x2cdbad){_0x2cdbad=_0x2cdbad||0xcc;return function(_0x35a262){if(_0x35a262){return _0x2605d9[_0xede9('0x18')](_0x2cdbad);}return _0x2605d9['status'](_0x2cdbad)[_0xede9('0x19')]();};}function respondWithResult(_0x232803,_0x5bdee6){_0x5bdee6=_0x5bdee6||0xc8;return function(_0x5dc44e){if(_0x5dc44e){return _0x232803[_0xede9('0x1a')](_0x5bdee6)['json'](_0x5dc44e);}};}function respondWithFilteredResult(_0x5366f0,_0x248349){return function(_0x2eb957){if(_0x2eb957){var _0x1f858d=_0x2eb957['count'],_0x404783=_0x248349['offset'],_0x577a3f=_0x248349[_0xede9('0x1b')]+_0x248349[_0xede9('0x1c')],_0x32ab9b;if(_0x577a3f>=_0x1f858d){_0x577a3f=_0x1f858d;_0x32ab9b=0xc8;}else{_0x32ab9b=0xce;}_0x5366f0[_0xede9('0x1a')](_0x32ab9b);return _0x5366f0[_0xede9('0x1d')](_0xede9('0x1e'),_0x404783+'-'+_0x577a3f+'/'+_0x1f858d)[_0xede9('0x1f')](_0x2eb957);}return null;};}function patchUpdates(_0x545eed){return function(_0x30590d){try{jsonpatch[_0xede9('0x20')](_0x30590d,_0x545eed,!![]);}catch(_0x2cb5ce){return BPromise[_0xede9('0x21')](_0x2cb5ce);}return _0x30590d[_0xede9('0x22')]();};}function saveUpdates(_0x4e3aeb,_0x7659c5){return function(_0x56696a){if(_0x56696a){return _0x56696a[_0xede9('0x23')](_0x4e3aeb)[_0xede9('0x24')](function(_0x4861e1){return _0x4861e1;});}return null;};}function removeEntity(_0x345daf,_0x4f1b5a){return function(_0x400dd3){if(_0x400dd3){return _0x400dd3[_0xede9('0x25')]()['then'](function(){_0x345daf[_0xede9('0x1a')](0xcc)[_0xede9('0x19')]();});}};}function handleEntityNotFound(_0x5802cf,_0x5ee0fa){return function(_0x23132b){if(!_0x23132b){_0x5802cf[_0xede9('0x18')](0x194);}return _0x23132b;};}function handleError(_0x4301b0,_0x294b5c){_0x294b5c=_0x294b5c||0x1f4;return function(_0x5b0976){logger[_0xede9('0x26')](_0x5b0976[_0xede9('0x27')]);if(_0x5b0976[_0xede9('0x28')]){delete _0x5b0976[_0xede9('0x28')];}_0x4301b0[_0xede9('0x1a')](_0x294b5c)['send'](_0x5b0976);};}exports[_0xede9('0x29')]=function(_0x4ae823,_0x5d1af4){var _0x1c0dd3={},_0x3acadd={},_0x528731={'count':0x0,'rows':[]};var _0x24001e=db['VoiceTransferReport'][_0xede9('0x2a')];_0x3acadd[_0xede9('0x2b')]=_[_0xede9('0x2c')](_0x24001e);var _0x474ee3={'dateStart':_0x4ae823[_0xede9('0x2d')][_0xede9('0x2e')],'dateEnd':_0x4ae823[_0xede9('0x2d')][_0xede9('0x2f')]};delete _0x4ae823[_0xede9('0x2d')][_0xede9('0x2e')];delete _0x4ae823[_0xede9('0x2d')]['dateEnd'];_0x3acadd[_0xede9('0x2d')]=_[_0xede9('0x2c')](_0x4ae823[_0xede9('0x2d')]);_0x3acadd[_0xede9('0x30')]=_[_0xede9('0x31')](_0x3acadd[_0xede9('0x2b')],_0x3acadd['query']);_0x1c0dd3[_0xede9('0x32')]=_['intersection'](_0x3acadd[_0xede9('0x2b')],qs[_0xede9('0x33')](_0x4ae823['query']['fields']));_0x1c0dd3[_0xede9('0x32')]=_0x1c0dd3[_0xede9('0x32')][_0xede9('0x34')]?_0x1c0dd3[_0xede9('0x32')]:_0x3acadd[_0xede9('0x2b')];if(!_0x4ae823['query'][_0xede9('0x35')](_0xede9('0x36'))){_0x1c0dd3['limit']=qs[_0xede9('0x1c')](_0x4ae823[_0xede9('0x2d')][_0xede9('0x1c')]);_0x1c0dd3[_0xede9('0x1b')]=qs[_0xede9('0x1b')](_0x4ae823[_0xede9('0x2d')][_0xede9('0x1b')]);}_0x1c0dd3['order']=qs[_0xede9('0x37')](_0x4ae823[_0xede9('0x2d')][_0xede9('0x37')]);_0x1c0dd3[_0xede9('0x38')]=qs[_0xede9('0x30')](_[_0xede9('0x39')](_0x4ae823[_0xede9('0x2d')],_0x3acadd['filters']));if(_0x474ee3['dateStart']){if(_0x474ee3[_0xede9('0x2f')]){_0x474ee3[_0xede9('0x2f')]=moment(_0x474ee3[_0xede9('0x2f')])[_0xede9('0x3a')](0x1,'day');}else{_0x474ee3[_0xede9('0x2f')]=moment(_0x474ee3['dateStart'])[_0xede9('0x3a')](0x1,_0xede9('0x3b'));}_['merge'](_0x1c0dd3[_0xede9('0x38')],{'createdAt':{'$gte':_0x474ee3[_0xede9('0x2e')],'$lte':_0x474ee3[_0xede9('0x2f')]}});}if(_0x4ae823['query'][_0xede9('0x3c')]){_0x1c0dd3[_0xede9('0x38')]=_[_0xede9('0x3d')](_0x1c0dd3[_0xede9('0x38')],{'$or':_[_0xede9('0x3e')](_0x24001e,function(_0x5b64b5){if(_0x5b64b5[_0xede9('0x3f')]['key']!==_0xede9('0x40')){var _0xf2acc1={};_0xf2acc1[_0x5b64b5['field']]={'$like':'%'+_0x4ae823[_0xede9('0x2d')][_0xede9('0x3c')]+'%'};return _0xf2acc1;}})});}_0x1c0dd3=_[_0xede9('0x3d')]({},_0x1c0dd3,_0x4ae823[_0xede9('0x41')]);var _0x21559b={'where':_0x1c0dd3[_0xede9('0x38')]};return db['VoiceTransferReport'][_0xede9('0x42')](_0x21559b)[_0xede9('0x24')](function(_0x2d1982){_0x528731['count']=_0x2d1982;if(_0x4ae823['query'][_0xede9('0x43')]){_0x1c0dd3[_0xede9('0x44')]=[{'all':!![]}];}return db[_0xede9('0x45')]['findAll'](_0x1c0dd3);})[_0xede9('0x24')](function(_0x1918ea){_0x528731[_0xede9('0x46')]=_0x1918ea;return _0x528731;})[_0xede9('0x24')](respondWithFilteredResult(_0x5d1af4,_0x1c0dd3))['catch'](handleError(_0x5d1af4,null));};exports['show']=function(_0x410617,_0x12c2eb){var _0x20d496={'raw':!![],'where':{'id':_0x410617[_0xede9('0x47')]['id']}},_0x166753={};_0x166753[_0xede9('0x2b')]=_[_0xede9('0x2c')](db[_0xede9('0x45')][_0xede9('0x2a')]);_0x166753[_0xede9('0x2d')]=_[_0xede9('0x2c')](_0x410617['query']);_0x166753[_0xede9('0x30')]=_[_0xede9('0x31')](_0x166753[_0xede9('0x2b')],_0x166753['query']);_0x20d496[_0xede9('0x32')]=_[_0xede9('0x31')](_0x166753[_0xede9('0x2b')],qs[_0xede9('0x33')](_0x410617[_0xede9('0x2d')][_0xede9('0x33')]));_0x20d496[_0xede9('0x32')]=_0x20d496['attributes'][_0xede9('0x34')]?_0x20d496[_0xede9('0x32')]:_0x166753[_0xede9('0x2b')];if(_0x410617[_0xede9('0x2d')][_0xede9('0x43')]){_0x20d496[_0xede9('0x44')]=[{'all':!![]}];}_0x20d496=_[_0xede9('0x3d')]({},_0x20d496,_0x410617['options']);return db[_0xede9('0x45')]['find'](_0x20d496)[_0xede9('0x24')](handleEntityNotFound(_0x12c2eb,null))[_0xede9('0x24')](respondWithResult(_0x12c2eb,null))[_0xede9('0x48')](handleError(_0x12c2eb,null));};exports[_0xede9('0x49')]=function(_0x3da5ca,_0x1859a7){return db[_0xede9('0x45')][_0xede9('0x49')](_0x3da5ca[_0xede9('0x4a')],{})[_0xede9('0x24')](respondWithResult(_0x1859a7,0xc9))['catch'](handleError(_0x1859a7,null));};exports[_0xede9('0x23')]=function(_0x26c91a,_0x46dfdd){if(_0x26c91a[_0xede9('0x4a')]['id']){delete _0x26c91a['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x26c91a[_0xede9('0x47')]['id']}})[_0xede9('0x24')](handleEntityNotFound(_0x46dfdd,null))[_0xede9('0x24')](saveUpdates(_0x26c91a[_0xede9('0x4a')],null))[_0xede9('0x24')](respondWithResult(_0x46dfdd,null))[_0xede9('0x48')](handleError(_0x46dfdd,null));};exports['destroy']=function(_0x55c0d7,_0x241ebc){return db[_0xede9('0x45')]['find']({'where':{'id':_0x55c0d7['params']['id']}})[_0xede9('0x24')](handleEntityNotFound(_0x241ebc,null))['then'](removeEntity(_0x241ebc,null))[_0xede9('0x48')](handleError(_0x241ebc,null));};
\ No newline at end of file
+var _0x8fe1=['then','stack','name','index','VoiceTransferReport','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','add','day','where','merge','type','key','VIRTUAL','field','filter','options','includeAll','rows','show','params','include','body','catch','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','reject','save','destroy'];(function(_0x559eb9,_0x1a39cd){var _0x5c5135=function(_0x4462c6){while(--_0x4462c6){_0x559eb9['push'](_0x559eb9['shift']());}};_0x5c5135(++_0x1a39cd);}(_0x8fe1,0x108));var _0x18fe=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x8fe1[_0x588011];return _0x3b3773;};'use strict';var pdf=require(_0x18fe('0x0'));var emlformat=require(_0x18fe('0x1'));var rimraf=require(_0x18fe('0x2'));var zipdir=require(_0x18fe('0x3'));var jsonpatch=require(_0x18fe('0x4'));var rp=require(_0x18fe('0x5'));var moment=require(_0x18fe('0x6'));var BPromise=require(_0x18fe('0x7'));var Mustache=require(_0x18fe('0x8'));var util=require(_0x18fe('0x9'));var path=require('path');var sox=require(_0x18fe('0xa'));var csv=require(_0x18fe('0xb'));var ejs=require(_0x18fe('0xc'));var fs=require('fs');var _=require(_0x18fe('0xd'));var squel=require(_0x18fe('0xe'));var crypto=require(_0x18fe('0xf'));var jsforce=require(_0x18fe('0x10'));var deskjs=require(_0x18fe('0x11'));var toCsv=require(_0x18fe('0xb'));var querystring=require(_0x18fe('0x12'));var Papa=require(_0x18fe('0x13'));var Redis=require(_0x18fe('0x14'));var qs=require(_0x18fe('0x15'));var logger=require(_0x18fe('0x16'))('api');var utils=require(_0x18fe('0x17'));var config=require(_0x18fe('0x18'));var db=require(_0x18fe('0x19'))['db'];function respondWithStatusCode(_0x5356bc,_0x51d538){_0x51d538=_0x51d538||0xcc;return function(_0x4bb71a){if(_0x4bb71a){return _0x5356bc['sendStatus'](_0x51d538);}return _0x5356bc[_0x18fe('0x1a')](_0x51d538)[_0x18fe('0x1b')]();};}function respondWithResult(_0x154412,_0x45bc91){_0x45bc91=_0x45bc91||0xc8;return function(_0xcb4fbc){if(_0xcb4fbc){return _0x154412[_0x18fe('0x1a')](_0x45bc91)[_0x18fe('0x1c')](_0xcb4fbc);}};}function respondWithFilteredResult(_0x57937c,_0x17f1fd){return function(_0x45f3a3){if(_0x45f3a3){var _0x1cc6e2=_0x45f3a3[_0x18fe('0x1d')],_0x1218d7=_0x17f1fd[_0x18fe('0x1e')],_0xc1d276=_0x17f1fd[_0x18fe('0x1e')]+_0x17f1fd[_0x18fe('0x1f')],_0x57ade1;if(_0xc1d276>=_0x1cc6e2){_0xc1d276=_0x1cc6e2;_0x57ade1=0xc8;}else{_0x57ade1=0xce;}_0x57937c['status'](_0x57ade1);return _0x57937c['set'](_0x18fe('0x20'),_0x1218d7+'-'+_0xc1d276+'/'+_0x1cc6e2)[_0x18fe('0x1c')](_0x45f3a3);}return null;};}function patchUpdates(_0x1fd3ad){return function(_0x53ef26){try{jsonpatch['apply'](_0x53ef26,_0x1fd3ad,!![]);}catch(_0x480c5c){return BPromise[_0x18fe('0x21')](_0x480c5c);}return _0x53ef26[_0x18fe('0x22')]();};}function saveUpdates(_0x197dcf,_0x43605e){return function(_0x4bc1c0){if(_0x4bc1c0){return _0x4bc1c0['update'](_0x197dcf)['then'](function(_0x59d57f){return _0x59d57f;});}return null;};}function removeEntity(_0x4dec70,_0x2fafe0){return function(_0x473729){if(_0x473729){return _0x473729[_0x18fe('0x23')]()[_0x18fe('0x24')](function(){_0x4dec70[_0x18fe('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7742,_0x1d2043){return function(_0x8f3d2a){if(!_0x8f3d2a){_0x3e7742['sendStatus'](0x194);}return _0x8f3d2a;};}function handleError(_0x17ad68,_0x445c83){_0x445c83=_0x445c83||0x1f4;return function(_0x431e91){logger['error'](_0x431e91[_0x18fe('0x25')]);if(_0x431e91['name']){delete _0x431e91[_0x18fe('0x26')];}_0x17ad68['status'](_0x445c83)['send'](_0x431e91);};}exports[_0x18fe('0x27')]=function(_0x336f3d,_0x41719f){var _0x16a518={},_0x34f899={},_0xb90d18={'count':0x0,'rows':[]};var _0x474296=db[_0x18fe('0x28')][_0x18fe('0x29')];_0x34f899[_0x18fe('0x2a')]=_[_0x18fe('0x2b')](_0x474296);var _0x5e708b={'dateStart':_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x2d')],'dateEnd':_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x2e')]};delete _0x336f3d[_0x18fe('0x2c')][_0x18fe('0x2d')];delete _0x336f3d[_0x18fe('0x2c')][_0x18fe('0x2e')];_0x34f899[_0x18fe('0x2c')]=_[_0x18fe('0x2b')](_0x336f3d[_0x18fe('0x2c')]);_0x34f899[_0x18fe('0x2f')]=_[_0x18fe('0x30')](_0x34f899['model'],_0x34f899[_0x18fe('0x2c')]);_0x16a518[_0x18fe('0x31')]=_['intersection'](_0x34f899['model'],qs[_0x18fe('0x32')](_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x32')]));_0x16a518[_0x18fe('0x31')]=_0x16a518[_0x18fe('0x31')][_0x18fe('0x33')]?_0x16a518[_0x18fe('0x31')]:_0x34f899['model'];if(!_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x34')](_0x18fe('0x35'))){_0x16a518[_0x18fe('0x1f')]=qs['limit'](_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x1f')]);_0x16a518[_0x18fe('0x1e')]=qs[_0x18fe('0x1e')](_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x1e')]);}_0x16a518[_0x18fe('0x36')]=qs[_0x18fe('0x37')](_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x37')]);_0x16a518['where']=qs[_0x18fe('0x2f')](_[_0x18fe('0x38')](_0x336f3d[_0x18fe('0x2c')],_0x34f899[_0x18fe('0x2f')]));if(_0x5e708b['dateStart']){if(_0x5e708b[_0x18fe('0x2e')]){_0x5e708b[_0x18fe('0x2e')]=moment(_0x5e708b['dateEnd'])[_0x18fe('0x39')](0x1,_0x18fe('0x3a'));}else{_0x5e708b['dateEnd']=moment(_0x5e708b[_0x18fe('0x2d')])['add'](0x1,_0x18fe('0x3a'));}_['merge'](_0x16a518['where'],{'createdAt':{'$gte':_0x5e708b['dateStart'],'$lte':_0x5e708b['dateEnd']}});}if(_0x336f3d[_0x18fe('0x2c')]['filter']){_0x16a518[_0x18fe('0x3b')]=_[_0x18fe('0x3c')](_0x16a518[_0x18fe('0x3b')],{'$or':_['map'](_0x474296,function(_0x2db29b){if(_0x2db29b[_0x18fe('0x3d')][_0x18fe('0x3e')]!==_0x18fe('0x3f')){var _0x25a8aa={};_0x25a8aa[_0x2db29b[_0x18fe('0x40')]]={'$like':'%'+_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x41')]+'%'};return _0x25a8aa;}})});}_0x16a518=_[_0x18fe('0x3c')]({},_0x16a518,_0x336f3d[_0x18fe('0x42')]);var _0x4bb2f2={'where':_0x16a518[_0x18fe('0x3b')]};return db['VoiceTransferReport'][_0x18fe('0x1d')](_0x4bb2f2)[_0x18fe('0x24')](function(_0x4cd1ed){_0xb90d18['count']=_0x4cd1ed;if(_0x336f3d[_0x18fe('0x2c')][_0x18fe('0x43')]){_0x16a518['include']=[{'all':!![]}];}return db[_0x18fe('0x28')]['findAll'](_0x16a518);})['then'](function(_0x2b93b9){_0xb90d18[_0x18fe('0x44')]=_0x2b93b9;return _0xb90d18;})[_0x18fe('0x24')](respondWithFilteredResult(_0x41719f,_0x16a518))['catch'](handleError(_0x41719f,null));};exports[_0x18fe('0x45')]=function(_0x4ed815,_0x430ef4){var _0x164f8b={'raw':!![],'where':{'id':_0x4ed815[_0x18fe('0x46')]['id']}},_0x397ae6={};_0x397ae6['model']=_[_0x18fe('0x2b')](db[_0x18fe('0x28')]['rawAttributes']);_0x397ae6[_0x18fe('0x2c')]=_[_0x18fe('0x2b')](_0x4ed815[_0x18fe('0x2c')]);_0x397ae6[_0x18fe('0x2f')]=_['intersection'](_0x397ae6[_0x18fe('0x2a')],_0x397ae6['query']);_0x164f8b[_0x18fe('0x31')]=_[_0x18fe('0x30')](_0x397ae6[_0x18fe('0x2a')],qs['fields'](_0x4ed815[_0x18fe('0x2c')][_0x18fe('0x32')]));_0x164f8b[_0x18fe('0x31')]=_0x164f8b[_0x18fe('0x31')][_0x18fe('0x33')]?_0x164f8b[_0x18fe('0x31')]:_0x397ae6[_0x18fe('0x2a')];if(_0x4ed815[_0x18fe('0x2c')][_0x18fe('0x43')]){_0x164f8b[_0x18fe('0x47')]=[{'all':!![]}];}_0x164f8b=_[_0x18fe('0x3c')]({},_0x164f8b,_0x4ed815[_0x18fe('0x42')]);return db['VoiceTransferReport']['find'](_0x164f8b)[_0x18fe('0x24')](handleEntityNotFound(_0x430ef4,null))['then'](respondWithResult(_0x430ef4,null))['catch'](handleError(_0x430ef4,null));};exports['create']=function(_0x16708a,_0xd04e2a){return db[_0x18fe('0x28')]['create'](_0x16708a[_0x18fe('0x48')],{})[_0x18fe('0x24')](respondWithResult(_0xd04e2a,0xc9))[_0x18fe('0x49')](handleError(_0xd04e2a,null));};exports[_0x18fe('0x4a')]=function(_0x296363,_0x406289){if(_0x296363['body']['id']){delete _0x296363[_0x18fe('0x48')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x296363[_0x18fe('0x46')]['id']}})[_0x18fe('0x24')](handleEntityNotFound(_0x406289,null))['then'](saveUpdates(_0x296363[_0x18fe('0x48')],null))[_0x18fe('0x24')](respondWithResult(_0x406289,null))[_0x18fe('0x49')](handleError(_0x406289,null));};exports['destroy']=function(_0x2d31c2,_0x51935b){return db[_0x18fe('0x28')]['find']({'where':{'id':_0x2d31c2[_0x18fe('0x46')]['id']}})[_0x18fe('0x24')](handleEntityNotFound(_0x51935b,null))[_0x18fe('0x24')](removeEntity(_0x51935b,null))[_0x18fe('0x49')](handleError(_0x51935b,null));};
\ No newline at end of file
index a000f08..431e577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde52=['api','moment','bluebird','request-promise','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xde52,0x110));var _0x2de5=function(_0x11f1f4,_0x189cf3){_0x11f1f4=_0x11f1f4-0x0;var _0x6d3dec=_0xde52[_0x11f1f4];return _0x6d3dec;};'use strict';var _=require(_0x2de5('0x0'));var util=require(_0x2de5('0x1'));var logger=require(_0x2de5('0x2'))(_0x2de5('0x3'));var moment=require(_0x2de5('0x4'));var BPromise=require(_0x2de5('0x5'));var rp=require(_0x2de5('0x6'));var attributes=require(_0x2de5('0x7'));module[_0x2de5('0x8')]=function(_0x6fd984,_0x2f2893){return _0x6fd984[_0x2de5('0x9')](_0x2de5('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5717=['moment','bluebird','request-promise','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api'];(function(_0x32ec76,_0x685259){var _0xba2082=function(_0x38d286){while(--_0x38d286){_0x32ec76['push'](_0x32ec76['shift']());}};_0xba2082(++_0x685259);}(_0x5717,0x179));var _0x7571=function(_0x497d72,_0x2ab1a6){_0x497d72=_0x497d72-0x0;var _0x3b92bc=_0x5717[_0x497d72];return _0x3b92bc;};'use strict';var _=require(_0x7571('0x0'));var util=require(_0x7571('0x1'));var logger=require('../../config/logger')(_0x7571('0x2'));var moment=require(_0x7571('0x3'));var BPromise=require(_0x7571('0x4'));var rp=require(_0x7571('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0x7571('0x6')]=function(_0x1448c5,_0x26863e){return _0x1448c5[_0x7571('0x7')](_0x7571('0x8'),attributes,{'tableName':_0x7571('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d7f04de..605df08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4a2=['../../config/environment','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x16bce9,_0x6d3fab){var _0xa0f8c5=function(_0x1cce18){while(--_0x1cce18){_0x16bce9['push'](_0x16bce9['shift']());}};_0xa0f8c5(++_0x6d3fab);}(_0xc4a2,0x13c));var _0x2c4a=function(_0x49c907,_0x1cd620){_0x49c907=_0x49c907-0x0;var _0x314597=_0xc4a2[_0x49c907];return _0x314597;};'use strict';var _=require(_0x2c4a('0x0'));var util=require(_0x2c4a('0x1'));var moment=require(_0x2c4a('0x2'));var BPromise=require(_0x2c4a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c4a('0x4'))['db'];var utils=require(_0x2c4a('0x5'));var logger=require(_0x2c4a('0x6'))(_0x2c4a('0x7'));var config=require(_0x2c4a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2c4a('0x9')][_0x2c4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d17b3,_0x23d018,_0x2b70e1){return new BPromise(function(_0x4ef844,_0x5862f3){return client['request'](_0x1d17b3,_0x2b70e1)['then'](function(_0x45616c){logger[_0x2c4a('0xb')](_0x2c4a('0xc'),_0x23d018,_0x2c4a('0xd'));logger[_0x2c4a('0xe')](_0x2c4a('0xf'),_0x23d018,_0x2c4a('0xd'),JSON[_0x2c4a('0x10')](_0x45616c));if(_0x45616c['error']){if(_0x45616c[_0x2c4a('0x11')]['code']===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x23d018,_0x45616c[_0x2c4a('0x11')]['message']);return _0x5862f3(_0x45616c[_0x2c4a('0x11')][_0x2c4a('0x12')]);}logger[_0x2c4a('0x11')](_0x2c4a('0xc'),_0x23d018,_0x45616c[_0x2c4a('0x11')][_0x2c4a('0x12')]);return _0x4ef844(_0x45616c[_0x2c4a('0x11')][_0x2c4a('0x12')]);}else{logger[_0x2c4a('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x23d018,_0x2c4a('0xd'));_0x4ef844(_0x45616c['result'][_0x2c4a('0x12')]);}})[_0x2c4a('0x13')](function(_0x39ae58){logger[_0x2c4a('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x23d018,_0x39ae58);_0x5862f3(_0x39ae58);});});}exports[_0x2c4a('0x14')]=function(_0x3d1ea5){var _0x305639=this;return new Promise(function(_0x1e1c38,_0x58fb53){return db[_0x2c4a('0x15')][_0x2c4a('0x16')](_0x3d1ea5[_0x2c4a('0x17')],{'raw':_0x3d1ea5[_0x2c4a('0x18')]?_0x3d1ea5[_0x2c4a('0x18')][_0x2c4a('0x19')]===undefined?!![]:![]:!![]})[_0x2c4a('0x1a')](function(_0x4a7685){logger[_0x2c4a('0xb')](_0x2c4a('0x14'),_0x3d1ea5);logger[_0x2c4a('0xe')]('CreateVoiceTransferReport',_0x3d1ea5,JSON[_0x2c4a('0x10')](_0x4a7685));_0x1e1c38(_0x4a7685);})['catch'](function(_0x39e0be){logger[_0x2c4a('0x11')]('CreateVoiceTransferReport',_0x39e0be[_0x2c4a('0x12')],_0x3d1ea5);_0x58fb53(_0x305639['error'](0x1f4,_0x39e0be[_0x2c4a('0x12')]));});});};
\ No newline at end of file
+var _0xf2f9=['VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf2f9,0x194));var _0x9f2f=function(_0x39acf8,_0x158e5a){_0x39acf8=_0x39acf8-0x0;var _0x378ac3=_0xf2f9[_0x39acf8];return _0x378ac3;};'use strict';var _=require(_0x9f2f('0x0'));var util=require('util');var moment=require(_0x9f2f('0x1'));var BPromise=require(_0x9f2f('0x2'));var rs=require(_0x9f2f('0x3'));var fs=require('fs');var Redis=require(_0x9f2f('0x4'));var db=require(_0x9f2f('0x5'))['db'];var utils=require(_0x9f2f('0x6'));var logger=require(_0x9f2f('0x7'))(_0x9f2f('0x8'));var config=require(_0x9f2f('0x9'));var jayson=require(_0x9f2f('0xa'));var client=jayson[_0x9f2f('0xb')][_0x9f2f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x313770,_0x4f7729,_0x17cac6){return new BPromise(function(_0x3ef80c,_0x28e94b){return client[_0x9f2f('0xd')](_0x313770,_0x17cac6)[_0x9f2f('0xe')](function(_0xe9937b){logger['info'](_0x9f2f('0xf'),_0x4f7729,'request\x20sent');logger['debug'](_0x9f2f('0x10'),_0x4f7729,_0x9f2f('0x11'),JSON['stringify'](_0xe9937b));if(_0xe9937b[_0x9f2f('0x12')]){if(_0xe9937b[_0x9f2f('0x12')]['code']===0x1f4){logger['error'](_0x9f2f('0xf'),_0x4f7729,_0xe9937b[_0x9f2f('0x12')][_0x9f2f('0x13')]);return _0x28e94b(_0xe9937b['error'][_0x9f2f('0x13')]);}logger['error'](_0x9f2f('0xf'),_0x4f7729,_0xe9937b[_0x9f2f('0x12')][_0x9f2f('0x13')]);return _0x3ef80c(_0xe9937b[_0x9f2f('0x12')]['message']);}else{logger['info'](_0x9f2f('0xf'),_0x4f7729,_0x9f2f('0x11'));_0x3ef80c(_0xe9937b[_0x9f2f('0x14')][_0x9f2f('0x13')]);}})[_0x9f2f('0x15')](function(_0x5a6804){logger[_0x9f2f('0x12')](_0x9f2f('0xf'),_0x4f7729,_0x5a6804);_0x28e94b(_0x5a6804);});});}exports[_0x9f2f('0x16')]=function(_0x3680f0){var _0x1978ab=this;return new Promise(function(_0x4b87a4,_0x4d90ff){return db[_0x9f2f('0x17')][_0x9f2f('0x18')](_0x3680f0[_0x9f2f('0x19')],{'raw':_0x3680f0[_0x9f2f('0x1a')]?_0x3680f0[_0x9f2f('0x1a')][_0x9f2f('0x1b')]===undefined?!![]:![]:!![]})[_0x9f2f('0xe')](function(_0x30e061){logger[_0x9f2f('0x1c')](_0x9f2f('0x16'),_0x3680f0);logger[_0x9f2f('0x1d')](_0x9f2f('0x16'),_0x3680f0,JSON['stringify'](_0x30e061));_0x4b87a4(_0x30e061);})[_0x9f2f('0x15')](function(_0x11bdf9){logger[_0x9f2f('0x12')](_0x9f2f('0x16'),_0x11bdf9[_0x9f2f('0x13')],_0x3680f0);_0x4d90ff(_0x1978ab['error'](0x1f4,_0x11bdf9[_0x9f2f('0x13')]));});});};
\ No newline at end of file
index 8b60356..eddcd9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d0e=['./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','listen','start','then','info','filter','online','name','join','status','None','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7d0e,0x18a));var _0xe7d0=function(_0x492743,_0x2660fa){_0x492743=_0x492743-0x0;var _0x354816=_0x7d0e[_0x492743];return _0x354816;};'use strict';var _=require(_0xe7d0('0x0'));var mysqldb=require(_0xe7d0('0x1'));var rpc=require(_0xe7d0('0x2'));var config=require(_0xe7d0('0x3'));var logger=require('./config/logger')(_0xe7d0('0x4'));var pm2=require(_0xe7d0('0x5'));var pm2Config=require(_0xe7d0('0x6'));var schedule=require(_0xe7d0('0x7'));var chat=require(_0xe7d0('0x8'));function main(){return mysqldb['db'][_0xe7d0('0x9')][_0xe7d0('0xa')]()['then'](function(){return rpc[_0xe7d0('0xb')]();})['then'](function(_0x5bd01e){logger['info'](_0x5bd01e);return chat[_0xe7d0('0xc')]();})[_0xe7d0('0xd')](function(){return schedule[_0xe7d0('0xc')]();})[_0xe7d0('0xd')](function(_0x4c9050){logger[_0xe7d0('0xe')](_0x4c9050);return pm2[_0xe7d0('0xc')](pm2Config);})['then'](function(_0x5bdd22){logger[_0xe7d0('0xe')]('Online\x20apps:',_['map'](_[_0xe7d0('0xf')](_0x5bdd22,{'status':_0xe7d0('0x10')}),_0xe7d0('0x11'))[_0xe7d0('0x12')]());logger[_0xe7d0('0xe')]('Offline\x20apps:',_['map'](_[_0xe7d0('0xf')](_0x5bdd22,function(_0x592b1f){return _0x592b1f[_0xe7d0('0x13')]!==_0xe7d0('0x10');}),'name')['join']()||_0xe7d0('0x14'));config['seedDB']&&require('./config/seedDB')[_0xe7d0('0x15')]();require('./config/license')[_0xe7d0('0x15')]();})['catch'](function(_0x21da98){logger[_0xe7d0('0x16')](_0xe7d0('0x17'),_0x21da98);process[_0xe7d0('0x18')](0x1);});}main();
\ No newline at end of file
+var _0xc2a1=['map','filter','online','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','info','start','Online\x20apps:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2a1,0x65));var _0x1c2a=function(_0x27fdcc,_0x421cb5){_0x27fdcc=_0x27fdcc-0x0;var _0x17c2de=_0xc2a1[_0x27fdcc];return _0x17c2de;};'use strict';var _=require(_0x1c2a('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x1c2a('0x1'));var config=require(_0x1c2a('0x2'));var logger=require(_0x1c2a('0x3'))(_0x1c2a('0x4'));var pm2=require(_0x1c2a('0x5'));var pm2Config=require(_0x1c2a('0x6'));var schedule=require(_0x1c2a('0x7'));var chat=require(_0x1c2a('0x8'));function main(){return mysqldb['db'][_0x1c2a('0x9')][_0x1c2a('0xa')]()[_0x1c2a('0xb')](function(){return rpc['listen']();})[_0x1c2a('0xb')](function(_0x5dec50){logger[_0x1c2a('0xc')](_0x5dec50);return chat[_0x1c2a('0xd')]();})[_0x1c2a('0xb')](function(){return schedule['start']();})[_0x1c2a('0xb')](function(_0x943776){logger[_0x1c2a('0xc')](_0x943776);return pm2[_0x1c2a('0xd')](pm2Config);})[_0x1c2a('0xb')](function(_0x128bca){logger[_0x1c2a('0xc')](_0x1c2a('0xe'),_[_0x1c2a('0xf')](_[_0x1c2a('0x10')](_0x128bca,{'status':_0x1c2a('0x11')}),'name')[_0x1c2a('0x12')]());logger[_0x1c2a('0xc')](_0x1c2a('0x13'),_[_0x1c2a('0xf')](_[_0x1c2a('0x10')](_0x128bca,function(_0x40d882){return _0x40d882[_0x1c2a('0x14')]!==_0x1c2a('0x11');}),'name')[_0x1c2a('0x12')]()||_0x1c2a('0x15'));config[_0x1c2a('0x16')]&&require(_0x1c2a('0x17'))[_0x1c2a('0x18')]();require(_0x1c2a('0x19'))[_0x1c2a('0x18')]();})[_0x1c2a('0x1a')](function(_0x5df696){logger[_0x1c2a('0x1b')](_0x1c2a('0x1c'),_0x5df696);process['exit'](0x1);});}main();
\ No newline at end of file
index 1f5fc4e..3120df2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe45d=['name','internal','voicePause','chatPause','faxPause','smsPause','pauseType','showWebBar','interface','userProfileId','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','disposition','json','unmanaged','Unmanaged.','Forbidden.','headers','startsWith','authorization','Basic','User','find','then','authenticate','status','user','catch','Bearer','Unknown\x20authorization\x20format.','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','getLicense','update','Forbidden','canUpdate','sign','secrets','session','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','indexOf','userRoles','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','motion.user','stringify','pick','/dashboards/general','../../mysqldb','jsonwebtoken','express-jwt','composable-middleware','basic-auth','ipaddr.js','role','fullname'];(function(_0x6f63de,_0x132d5f){var _0x100a9f=function(_0x38e58c){while(--_0x38e58c){_0x6f63de['push'](_0x6f63de['shift']());}};_0x100a9f(++_0x132d5f);}(_0xe45d,0xfc));var _0xde45=function(_0x341fd6,_0x9d0e71){_0x341fd6=_0x341fd6-0x0;var _0x3755d3=_0xe45d[_0x341fd6];return _0x3755d3;};'use strict';var db=require(_0xde45('0x0'))['db'];var config=require('../../config/environment');var _=require('lodash');var jwt=require(_0xde45('0x1'));var expressJwt=require(_0xde45('0x2'));var compose=require(_0xde45('0x3'));var basicAuth=require(_0xde45('0x4'));var ipaddr=require(_0xde45('0x5'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xde45('0x6'),_0xde45('0x7'),_0xde45('0x8'),_0xde45('0x9'),'email','userpic','permissions',_0xde45('0xa'),_0xde45('0xb'),'mailPause',_0xde45('0xc'),_0xde45('0xd'),'openchannelPause',_0xde45('0xe'),_0xde45('0xf'),'phoneBarRemoteControlPort','phoneBarRemoteControl',_0xde45('0x10'),_0xde45('0x11')];exports[_0xde45('0x12')]=function(){return isAuthenticated(!![])[_0xde45('0x13')](function(_0x519ffc,_0xc3f2ec,_0x181d36){if(_0x519ffc['user']){_0x181d36();}else{return db[_0xde45('0x14')][_0xde45('0x15')]({'where':{'id':_0x519ffc[_0xde45('0x16')]['id']},'attributes':['id',_0xde45('0x17'),_0xde45('0x18')],'raw':!![]})['then'](function(_0x3e6503){if(_0x3e6503&&_0x3e6503[_0xde45('0x17')]){return _0xc3f2ec['status'](_0x3e6503[_0xde45('0x18')]==='unmanaged'?0x195:0x193)[_0xde45('0x19')]({'message':_0x3e6503[_0xde45('0x18')]===_0xde45('0x1a')?_0xde45('0x1b'):_0xde45('0x1c')});}else{_0x181d36();}})['catch'](function(_0x191dc4){_0x181d36(_0x191dc4);});}});};function isAuthenticated(_0x30fb1b){return compose()['use'](function(_0x629308,_0x320d68,_0x6e999b){if(_0x629308[_0xde45('0x1d')]['authorization']){if(_[_0xde45('0x1e')](_0x629308[_0xde45('0x1d')][_0xde45('0x1f')],_0xde45('0x20'))){var _0x320074=basicAuth(_0x629308);db[_0xde45('0x21')][_0xde45('0x22')]({'where':{'name':_0x320074[_0xde45('0x8')]}})[_0xde45('0x23')](function(_0x4f9457){if(!_0x4f9457||!_0x4f9457[_0xde45('0x24')](_0x320074['pass'])){return _0x320d68[_0xde45('0x25')](0x191)[_0xde45('0x19')]({'message':'Wrong\x20credentials.'});}_0x629308[_0xde45('0x26')]={'id':_0x4f9457['id']};_0x6e999b();})[_0xde45('0x27')](function(_0x5307b3){_0x6e999b(_0x5307b3);});}else if(_['startsWith'](_0x629308['headers'][_0xde45('0x1f')],_0xde45('0x28'))){validateJwt(_0x629308,_0x320d68,_0x6e999b);}}else{if(_0x30fb1b){_0x6e999b();}else{return _0x320d68[_0xde45('0x25')](0x191)[_0xde45('0x19')]({'message':_0xde45('0x29')});}}})['use'](function(_0x68b0aa,_0x3675b7,_0x4f740d){if(_0x68b0aa[_0xde45('0x26')]){db['User'][_0xde45('0x22')]({'where':{'id':_0x68b0aa['user']['id']},'attributes':userAttributes})[_0xde45('0x23')](function(_0xdc300e){if(!_0xdc300e){return _0x3675b7[_0xde45('0x25')](0x194)[_0xde45('0x19')]({'message':_0xde45('0x2a')});}_0x68b0aa[_0xde45('0x26')]=_0xdc300e;_0x4f740d();})[_0xde45('0x27')](function(_0x5542ff){_0x4f740d(_0x5542ff);});}else if(_0x30fb1b){_0x4f740d();}else{return _0x3675b7['status'](0x194)['json']({'message':_0xde45('0x2b')});}});}exports[_0xde45('0x2c')]=isAuthenticated;function canUpdate(){return compose()[_0xde45('0x13')](function(_0x466bc5,_0x3b3534,_0x3b58b6){return require('../../config/license/util')[_0xde45('0x2d')]()[_0xde45('0x23')](function(_0x31ec3a){if(_0x31ec3a[_0xde45('0x2e')]){_0x3b58b6();}else{return _0x3b3534[_0xde45('0x25')](0x193)[_0xde45('0x19')]({'message':_0xde45('0x2f')});}})[_0xde45('0x27')](function(_0xbbb6b){_0x3b58b6(_0xbbb6b);});});}exports[_0xde45('0x30')]=canUpdate;function signToken(_0x3d5189,_0x565005){return jwt[_0xde45('0x31')]({'id':_0x3d5189,'role':_0x565005},config[_0xde45('0x32')][_0xde45('0x33')],{'expiresIn':0x15180});}exports[_0xde45('0x34')]=signToken;exports[_0xde45('0x35')]=function(_0x44bcb1){if(!_0x44bcb1){throw new Error(_0xde45('0x36'));}return compose()[_0xde45('0x13')](isAuthenticated())['use'](function meetsRequirements(_0x3d5a2b,_0x59616a,_0x74422c){if(config['userRoles'][_0xde45('0x37')](_0x3d5a2b[_0xde45('0x26')][_0xde45('0x6')])>=config[_0xde45('0x38')][_0xde45('0x37')](_0x44bcb1)){return _0x74422c();}else{return _0x59616a[_0xde45('0x25')](0x193)[_0xde45('0x19')]({'message':'Forbidden'});}});};exports[_0xde45('0x39')]=function(_0x1c2df0,_0x4fd5bb){if(!_0x1c2df0[_0xde45('0x26')]){return _0x4fd5bb[_0xde45('0x25')](0x194)[_0xde45('0x19')]({'message':_0xde45('0x3a')});}var _0x438be7=signToken(_0x1c2df0[_0xde45('0x26')]['id'],_0x1c2df0[_0xde45('0x26')][_0xde45('0x6')]);_0x4fd5bb[_0xde45('0x3b')](_0xde45('0x3c'),_0x438be7);_0x4fd5bb['cookie'](_0xde45('0x3d'),JSON[_0xde45('0x3e')](_[_0xde45('0x3f')](_0x1c2df0[_0xde45('0x26')],userAttributes)));_0x4fd5bb['redirect'](_0xde45('0x40'));};
\ No newline at end of file
+var _0x3d9a=['getLicense','update','canUpdate','sign','secrets','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','role','Forbidden','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.user','stringify','../../config/environment','express-jwt','basic-auth','ipaddr.js','session','fullname','name','email','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','catch','startsWith','headers','authorization','Basic','User','authenticate','Wrong\x20credentials.','Bearer','json','Unknown\x20authorization\x20format.','find','User\x20not\x20found.','isAuthenticated','../../config/license/util'];(function(_0x1725bb,_0x28a801){var _0x119be2=function(_0x2f959c){while(--_0x2f959c){_0x1725bb['push'](_0x1725bb['shift']());}};_0x119be2(++_0x28a801);}(_0x3d9a,0x150));var _0xa3d9=function(_0x60c5c8,_0x3ad014){_0x60c5c8=_0x60c5c8-0x0;var _0x596c29=_0x3d9a[_0x60c5c8];return _0x596c29;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xa3d9('0x0'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0xa3d9('0x1'));var compose=require('composable-middleware');var basicAuth=require(_0xa3d9('0x2'));var ipaddr=require(_0xa3d9('0x3'));var validateJwt=expressJwt({'secret':config['secrets'][_0xa3d9('0x4')]});var userAttributes=['id','role',_0xa3d9('0x5'),_0xa3d9('0x6'),'internal',_0xa3d9('0x7'),'userpic',_0xa3d9('0x8'),'voicePause',_0xa3d9('0x9'),_0xa3d9('0xa'),_0xa3d9('0xb'),_0xa3d9('0xc'),_0xa3d9('0xd'),_0xa3d9('0xe'),_0xa3d9('0xf'),_0xa3d9('0x10'),_0xa3d9('0x11'),_0xa3d9('0x12'),_0xa3d9('0x13')];exports[_0xa3d9('0x14')]=function(){return isAuthenticated(!![])[_0xa3d9('0x15')](function(_0x1a6e3e,_0x1afcf1,_0x1af15c){if(_0x1a6e3e[_0xa3d9('0x16')]){_0x1af15c();}else{return db[_0xa3d9('0x17')][_0xa3d9('0x18')]({'where':{'id':_0x1a6e3e[_0xa3d9('0x19')]['id']},'attributes':['id',_0xa3d9('0x1a'),_0xa3d9('0x1b')],'raw':!![]})[_0xa3d9('0x1c')](function(_0x34a4c9){if(_0x34a4c9&&_0x34a4c9[_0xa3d9('0x1a')]){return _0x1afcf1[_0xa3d9('0x1d')](_0x34a4c9[_0xa3d9('0x1b')]===_0xa3d9('0x1e')?0x195:0x193)['json']({'message':_0x34a4c9[_0xa3d9('0x1b')]==='unmanaged'?_0xa3d9('0x1f'):_0xa3d9('0x20')});}else{_0x1af15c();}})[_0xa3d9('0x21')](function(_0x564da2){_0x1af15c(_0x564da2);});}});};function isAuthenticated(_0x29cd00){return compose()['use'](function(_0x5113d7,_0x56aad6,_0x56161d){if(_0x5113d7['headers']['authorization']){if(_[_0xa3d9('0x22')](_0x5113d7[_0xa3d9('0x23')][_0xa3d9('0x24')],_0xa3d9('0x25'))){var _0x18db01=basicAuth(_0x5113d7);db[_0xa3d9('0x26')]['find']({'where':{'name':_0x18db01[_0xa3d9('0x6')]}})[_0xa3d9('0x1c')](function(_0x3d8219){if(!_0x3d8219||!_0x3d8219[_0xa3d9('0x27')](_0x18db01['pass'])){return _0x56aad6[_0xa3d9('0x1d')](0x191)['json']({'message':_0xa3d9('0x28')});}_0x5113d7[_0xa3d9('0x16')]={'id':_0x3d8219['id']};_0x56161d();})['catch'](function(_0x50947b){_0x56161d(_0x50947b);});}else if(_[_0xa3d9('0x22')](_0x5113d7['headers']['authorization'],_0xa3d9('0x29'))){validateJwt(_0x5113d7,_0x56aad6,_0x56161d);}}else{if(_0x29cd00){_0x56161d();}else{return _0x56aad6[_0xa3d9('0x1d')](0x191)[_0xa3d9('0x2a')]({'message':_0xa3d9('0x2b')});}}})['use'](function(_0x4833e,_0x532786,_0x1d77cc){if(_0x4833e[_0xa3d9('0x16')]){db[_0xa3d9('0x26')][_0xa3d9('0x2c')]({'where':{'id':_0x4833e[_0xa3d9('0x16')]['id']},'attributes':userAttributes})['then'](function(_0x45cbc1){if(!_0x45cbc1){return _0x532786['status'](0x194)['json']({'message':_0xa3d9('0x2d')});}_0x4833e[_0xa3d9('0x16')]=_0x45cbc1;_0x1d77cc();})[_0xa3d9('0x21')](function(_0x421127){_0x1d77cc(_0x421127);});}else if(_0x29cd00){_0x1d77cc();}else{return _0x532786['status'](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});}exports[_0xa3d9('0x2e')]=isAuthenticated;function canUpdate(){return compose()[_0xa3d9('0x15')](function(_0x25d607,_0x154a44,_0x25de9a){return require(_0xa3d9('0x2f'))[_0xa3d9('0x30')]()[_0xa3d9('0x1c')](function(_0xda5dbd){if(_0xda5dbd[_0xa3d9('0x31')]){_0x25de9a();}else{return _0x154a44[_0xa3d9('0x1d')](0x193)['json']({'message':'Forbidden'});}})[_0xa3d9('0x21')](function(_0x3f5273){_0x25de9a(_0x3f5273);});});}exports[_0xa3d9('0x32')]=canUpdate;function signToken(_0x10c4d7,_0x2c47e6){return jwt[_0xa3d9('0x33')]({'id':_0x10c4d7,'role':_0x2c47e6},config[_0xa3d9('0x34')][_0xa3d9('0x4')],{'expiresIn':0x15180});}exports[_0xa3d9('0x35')]=signToken;exports[_0xa3d9('0x36')]=function(_0x5df681){if(!_0x5df681){throw new Error(_0xa3d9('0x37'));}return compose()[_0xa3d9('0x15')](isAuthenticated())[_0xa3d9('0x15')](function meetsRequirements(_0x1d1e2b,_0x433706,_0x4a4e03){if(config[_0xa3d9('0x38')][_0xa3d9('0x39')](_0x1d1e2b[_0xa3d9('0x16')][_0xa3d9('0x3a')])>=config['userRoles'][_0xa3d9('0x39')](_0x5df681)){return _0x4a4e03();}else{return _0x433706['status'](0x193)['json']({'message':_0xa3d9('0x3b')});}});};exports[_0xa3d9('0x3c')]=function(_0x390e81,_0xac2f19){if(!_0x390e81[_0xa3d9('0x16')]){return _0xac2f19[_0xa3d9('0x1d')](0x194)['json']({'message':_0xa3d9('0x3d')});}var _0x2e8755=signToken(_0x390e81[_0xa3d9('0x16')]['id'],_0x390e81[_0xa3d9('0x16')][_0xa3d9('0x3a')]);_0xac2f19['cookie']('motion.token',_0x2e8755);_0xac2f19['cookie'](_0xa3d9('0x3e'),JSON[_0xa3d9('0x3f')](_['pick'](_0x390e81[_0xa3d9('0x16')],userAttributes)));_0xac2f19['redirect']('/dashboards/general');};
\ No newline at end of file
index 5ed23b1..4105c70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e08=['encryptFile','createWriteStream','algorithm','update','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','data','bluebird','aes192','hasOwnProperty'];(function(_0x57c87e,_0x2413fe){var _0x10fde1=function(_0x39aaeb){while(--_0x39aaeb){_0x57c87e['push'](_0x57c87e['shift']());}};_0x10fde1(++_0x2413fe);}(_0x3e08,0x12f));var _0x83e0=function(_0x4f5fbc,_0x74cb4e){_0x4f5fbc=_0x4f5fbc-0x0;var _0x486e0e=_0x3e08[_0x4f5fbc];return _0x486e0e;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x83e0('0x0'));var defaultOptions={'algorithm':_0x83e0('0x1')};function combineOptions(_0x1fee72){var _0x52323c={};for(var _0x398223 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x398223)){_0x52323c[_0x398223]=defaultOptions[_0x398223];}}if(_0x1fee72){for(var _0x51ac58 in _0x1fee72){if(_0x1fee72[_0x83e0('0x2')](_0x51ac58)){_0x52323c[_0x51ac58]=_0x1fee72[_0x51ac58];}}}return _0x52323c;}exports[_0x83e0('0x3')]=function(_0x57caad,_0x3f5599,_0x413878,_0x3ae68a){return new BPromise(function(_0x17d63a,_0x2b39b9){_0x3ae68a=combineOptions(_0x3ae68a);var _0xd2beab=new Buffer(_0x413878);var _0x1b953b=fs['createReadStream'](_0x57caad);var _0x47ed14=fs[_0x83e0('0x4')](_0x3f5599);var _0x591379=crypto['createCipher'](_0x3ae68a[_0x83e0('0x5')],_0xd2beab);_0x1b953b['on']('data',function(_0x522fbe){var _0xf2dae9=new Buffer(_0x591379[_0x83e0('0x6')](_0x522fbe),_0x83e0('0x7'));_0x47ed14['write'](_0xf2dae9);});_0x1b953b['on'](_0x83e0('0x8'),function(){try{var _0x484855=new Buffer(_0x591379[_0x83e0('0x9')](_0x83e0('0x7')),_0x83e0('0x7'));_0x47ed14[_0x83e0('0xa')](_0x484855);_0x47ed14[_0x83e0('0x8')]();_0x47ed14['on'](_0x83e0('0xb'),function(){return _0x17d63a(_0x3f5599);});}catch(_0x53d5f4){fs[_0x83e0('0xc')](_0x3f5599);return _0x2b39b9(_0x53d5f4);}});});};exports[_0x83e0('0xd')]=function(_0x250e07,_0x47b287,_0xf5d602,_0x54d727){return new BPromise(function(_0x5d28c4,_0x34e8f9){_0x54d727=combineOptions(_0x54d727);var _0x12a643=new Buffer(_0xf5d602);var _0x293000=fs[_0x83e0('0xe')](_0x250e07);var _0x1019d7=fs[_0x83e0('0x4')](_0x47b287);var _0xfa746f=crypto[_0x83e0('0xf')](_0x54d727[_0x83e0('0x5')],_0x12a643);_0x293000['on'](_0x83e0('0x10'),function(_0xaf9009){var _0x2a7630=new Buffer(_0xfa746f[_0x83e0('0x6')](_0xaf9009),_0x83e0('0x7'));_0x1019d7['write'](_0x2a7630);});_0x293000['on']('end',function(){try{var _0xe3b0a4=new Buffer(_0xfa746f['final'](_0x83e0('0x7')),'binary');_0x1019d7[_0x83e0('0xa')](_0xe3b0a4);_0x1019d7[_0x83e0('0x8')]();_0x1019d7['on'](_0x83e0('0xb'),function(){return _0x5d28c4(_0x47b287);});}catch(_0x206752){fs[_0x83e0('0xc')](_0x47b287);return _0x34e8f9(_0x206752);}});});};
\ No newline at end of file
+var _0x2695=['write','close','unlink','decryptFile','algorithm','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','final'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x2695,0x1c7));var _0x5269=function(_0x329c2b,_0x462c61){_0x329c2b=_0x329c2b-0x0;var _0x4d7a00=_0x2695[_0x329c2b];return _0x4d7a00;};'use strict';var crypto=require(_0x5269('0x0'));var fs=require('fs');var BPromise=require(_0x5269('0x1'));var defaultOptions={'algorithm':_0x5269('0x2')};function combineOptions(_0x3a9838){var _0x1b48e5={};for(var _0x549850 in defaultOptions){if(defaultOptions[_0x5269('0x3')](_0x549850)){_0x1b48e5[_0x549850]=defaultOptions[_0x549850];}}if(_0x3a9838){for(var _0x5b76b3 in _0x3a9838){if(_0x3a9838['hasOwnProperty'](_0x5b76b3)){_0x1b48e5[_0x5b76b3]=_0x3a9838[_0x5b76b3];}}}return _0x1b48e5;}exports[_0x5269('0x4')]=function(_0x2ec186,_0x313ae6,_0x564648,_0x50e8dd){return new BPromise(function(_0x4dfa33,_0x16ed70){_0x50e8dd=combineOptions(_0x50e8dd);var _0x2fe07b=new Buffer(_0x564648);var _0x22e8e3=fs[_0x5269('0x5')](_0x2ec186);var _0x3a2626=fs[_0x5269('0x6')](_0x313ae6);var _0x4f231f=crypto[_0x5269('0x7')](_0x50e8dd['algorithm'],_0x2fe07b);_0x22e8e3['on'](_0x5269('0x8'),function(_0x5cae38){var _0x7f662c=new Buffer(_0x4f231f[_0x5269('0x9')](_0x5cae38),_0x5269('0xa'));_0x3a2626['write'](_0x7f662c);});_0x22e8e3['on'](_0x5269('0xb'),function(){try{var _0x467c9d=new Buffer(_0x4f231f[_0x5269('0xc')](_0x5269('0xa')),_0x5269('0xa'));_0x3a2626[_0x5269('0xd')](_0x467c9d);_0x3a2626[_0x5269('0xb')]();_0x3a2626['on'](_0x5269('0xe'),function(){return _0x4dfa33(_0x313ae6);});}catch(_0x4acb15){fs[_0x5269('0xf')](_0x313ae6);return _0x16ed70(_0x4acb15);}});});};exports[_0x5269('0x10')]=function(_0x12ef90,_0x45a1db,_0x30c1f3,_0x38698a){return new BPromise(function(_0x3536de,_0x2e1017){_0x38698a=combineOptions(_0x38698a);var _0x38d05f=new Buffer(_0x30c1f3);var _0x237452=fs[_0x5269('0x5')](_0x12ef90);var _0x5e9d58=fs[_0x5269('0x6')](_0x45a1db);var _0x4df977=crypto['createDecipher'](_0x38698a[_0x5269('0x11')],_0x38d05f);_0x237452['on'](_0x5269('0x8'),function(_0x3e413f){var _0x141cd7=new Buffer(_0x4df977[_0x5269('0x9')](_0x3e413f),_0x5269('0xa'));_0x5e9d58[_0x5269('0xd')](_0x141cd7);});_0x237452['on'](_0x5269('0xb'),function(){try{var _0x45380d=new Buffer(_0x4df977['final'](_0x5269('0xa')),'binary');_0x5e9d58['write'](_0x45380d);_0x5e9d58[_0x5269('0xb')]();_0x5e9d58['on'](_0x5269('0xe'),function(){return _0x3536de(_0x45a1db);});}catch(_0x607a57){fs[_0x5269('0xf')](_0x45a1db);return _0x2e1017(_0x607a57);}});});};
\ No newline at end of file
index c65f5f6..bf8583a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd84d=['writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','to-csv','bluebird','../../mysqldb','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','Empty','format','push','basename','.csv','split','existsSync','join','each','length','%s%d.%s','%s.%s','csv'];(function(_0x2cbe09,_0x3df4b3){var _0x3576e0=function(_0x4ae30a){while(--_0x4ae30a){_0x2cbe09['push'](_0x2cbe09['shift']());}};_0x3576e0(++_0x3df4b3);}(_0xd84d,0x13f));var _0xdd84=function(_0x24258d,_0x11ff80){_0x24258d=_0x24258d-0x0;var _0x3ec633=_0xd84d[_0x24258d];return _0x3ec633;};'use strict';var util=require('util');var path=require(_0xdd84('0x0'));var _=require('lodash');var csv=require(_0xdd84('0x1'));var fs=require('fs');var BPromise=require(_0xdd84('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xdd84('0x3'))['db'];var dbH=require(_0xdd84('0x3'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xdd84('0x4')][0x2]);var QUERY=process[_0xdd84('0x4')][0x3];var PATH=process[_0xdd84('0x4')][0x4];function analyticExtractedReport(_0x59447c,_0x2240d8){var _0xa93ff2={'status':_0x59447c};var _0x438f59={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2240d8){_0xa93ff2[_0xdd84('0x5')]=_0x2240d8;}return db['AnalyticExtractedReport'][_0xdd84('0x6')](_0xa93ff2,_0x438f59);}function main(){var _0x19e850=0x1388;var _0x138ba0;logger[_0xdd84('0x7')](util['format'](_0xdd84('0x8'),EXTRACTED_REPORT_ID,_0xdd84('0x9')));return db[_0xdd84('0xa')][_0xdd84('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdd84('0xc')]})[_0xdd84('0xd')](function(_0x271794){if(_0x271794){_0x138ba0=_0x271794;_0x19e850=_0x138ba0[_0xdd84('0xc')]||0x1388;}})['then'](function(){return dbH[_0xdd84('0xe')][_0xdd84('0xf')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xdd84('0x10')][_0xdd84('0x11')]});})[_0xdd84('0xd')](function(_0x45ac7e){if(!_0x45ac7e[0x0][_0xdd84('0x12')]){return analyticExtractedReport(_0xdd84('0x13'));}var _0x54bbe6=[];var _0x217e4f=0x0;var _0x291d1d=!![];if(_0x45ac7e&&_0x45ac7e['length']){var _0x139ff6=_0x45ac7e[0x0][_0xdd84('0x12')]%(_0x217e4f+_0x19e850);if(_0x138ba0['split']){for(;_0x291d1d;_0x217e4f+=_0x19e850,_0x139ff6=_0x45ac7e[0x0][_0xdd84('0x12')]%(_0x217e4f+_0x19e850)){if(_0x139ff6==0x0||_0x139ff6==_0x45ac7e[0x0][_0xdd84('0x12')]){_0x291d1d=![];}_0x54bbe6['push'](dbH[_0xdd84('0xe')][_0xdd84('0xf')](util[_0xdd84('0x14')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x19e850,_0x217e4f),{'type':dbH[_0xdd84('0xe')][_0xdd84('0x10')]['SELECT']}));}}else{_0x54bbe6[_0xdd84('0x15')](dbH['sequelize'][_0xdd84('0xf')](QUERY,{'type':dbH[_0xdd84('0xe')][_0xdd84('0x10')]['SELECT']}));}}var _0x51762d=path['dirname'](PATH);var _0x1f8117=path[_0xdd84('0x16')](PATH,_0xdd84('0x17'));var _0xf505c=_0x138ba0[_0xdd84('0x18')]&&_0x54bbe6['length']>0x1;var _0x162103=[];if(!fs[_0xdd84('0x19')](path['join'](_0x51762d,_0x1f8117))&&_0xf505c){fs['mkdirSync'](path[_0xdd84('0x1a')](_0x51762d,_0x1f8117));}return BPromise[_0xdd84('0x1b')](_0x54bbe6,function(_0x9457c0){_0x162103[_0xdd84('0x15')](_0x9457c0);})[_0xdd84('0xd')](function(){for(var _0x56d20d=0x0;_0x56d20d<_0x162103[_0xdd84('0x1c')];_0x56d20d+=0x1){var _0x421593;var _0x1f9a1b=_0x162103[_0x56d20d];if(_0xf505c){_0x421593=path[_0xdd84('0x1a')](_0x51762d,_0x1f8117,util[_0xdd84('0x14')](_0xdd84('0x1d'),_0x1f8117,_0x56d20d,'csv'));}else{_0x421593=path[_0xdd84('0x1a')](_0x51762d,util[_0xdd84('0x14')](_0xdd84('0x1e'),_0x1f8117,_0xdd84('0x1f')));}fs[_0xdd84('0x20')](_0x421593,csv(_0x1f9a1b));}})[_0xdd84('0xd')](function(){if(_0xf505c){zipdir(path[_0xdd84('0x1a')](_0x51762d,_0x1f8117),{'saveTo':path[_0xdd84('0x1a')](_0x51762d,util[_0xdd84('0x14')](_0xdd84('0x1e'),_0x1f8117,_0xdd84('0x21')))},function(_0x4819fd,_0xf31a30){});rimraf(path['join'](_0x51762d,_0x1f8117),function(){});}})['then'](function(){logger[_0xdd84('0x7')](util[_0xdd84('0x14')](_0xdd84('0x22'),EXTRACTED_REPORT_ID,_0xdd84('0x9')));return analyticExtractedReport(_0xdd84('0x23'),_0xf505c?util['format'](_0xdd84('0x1e'),_0x1f8117,_0xf505c?_0xdd84('0x21'):_0xdd84('0x1f')):null);});})['catch'](function(_0x254439){logger[_0xdd84('0x7')](util[_0xdd84('0x14')](_0xdd84('0x24'),EXTRACTED_REPORT_ID,'CSV'),util[_0xdd84('0x25')](_0x254439,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xdd84('0x26'));});}main();
\ No newline at end of file
+var _0x14d5=['../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','to-csv','bluebird','rimraf'];(function(_0x4b0c3e,_0x50754a){var _0xa99d4e=function(_0x1034a2){while(--_0x1034a2){_0x4b0c3e['push'](_0x4b0c3e['shift']());}};_0xa99d4e(++_0x50754a);}(_0x14d5,0x1bd));var _0x514d=function(_0x29cc56,_0x572e53){_0x29cc56=_0x29cc56-0x0;var _0x816a75=_0x14d5[_0x29cc56];return _0x816a75;};'use strict';var util=require('util');var path=require(_0x514d('0x0'));var _=require(_0x514d('0x1'));var csv=require(_0x514d('0x2'));var fs=require('fs');var BPromise=require(_0x514d('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x514d('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x514d('0x5'))[_0x514d('0x6')];var logger=require(_0x514d('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x514d('0x8')][0x2]);var QUERY=process[_0x514d('0x8')][0x3];var PATH=process[_0x514d('0x8')][0x4];function analyticExtractedReport(_0x443d1a,_0x51b766){var _0x5a963e={'status':_0x443d1a};var _0x107901={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51b766){_0x5a963e['savename']=_0x51b766;}return db[_0x514d('0x9')]['update'](_0x5a963e,_0x107901);}function main(){var _0x4d0b95=0x1388;var _0x45b191;logger[_0x514d('0xa')](util[_0x514d('0xb')](_0x514d('0xc'),EXTRACTED_REPORT_ID,_0x514d('0xd')));return db[_0x514d('0xe')][_0x514d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x514d('0x10'),'splitSizeCsv']})['then'](function(_0x490473){if(_0x490473){_0x45b191=_0x490473;_0x4d0b95=_0x45b191[_0x514d('0x11')]||0x1388;}})[_0x514d('0x12')](function(){return dbH[_0x514d('0x13')][_0x514d('0x14')](util[_0x514d('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x514d('0x13')][_0x514d('0x15')][_0x514d('0x16')]});})['then'](function(_0x3b829c){if(!_0x3b829c[0x0][_0x514d('0x17')]){return analyticExtractedReport(_0x514d('0x18'));}var _0x2ccdb4=[];var _0x278036=0x0;var _0x10fcb8=!![];if(_0x3b829c&&_0x3b829c[_0x514d('0x19')]){var _0x30255d=_0x3b829c[0x0][_0x514d('0x17')]%(_0x278036+_0x4d0b95);if(_0x45b191['split']){for(;_0x10fcb8;_0x278036+=_0x4d0b95,_0x30255d=_0x3b829c[0x0]['num']%(_0x278036+_0x4d0b95)){if(_0x30255d==0x0||_0x30255d==_0x3b829c[0x0]['num']){_0x10fcb8=![];}_0x2ccdb4[_0x514d('0x1a')](dbH['sequelize']['query'](util['format'](_0x514d('0x1b'),QUERY,_0x4d0b95,_0x278036),{'type':dbH[_0x514d('0x13')]['QueryTypes'][_0x514d('0x16')]}));}}else{_0x2ccdb4[_0x514d('0x1a')](dbH[_0x514d('0x13')][_0x514d('0x14')](QUERY,{'type':dbH[_0x514d('0x13')][_0x514d('0x15')][_0x514d('0x16')]}));}}var _0x386c99=path[_0x514d('0x1c')](PATH);var _0x48657a=path[_0x514d('0x1d')](PATH,_0x514d('0x1e'));var _0x2f3777=_0x45b191['split']&&_0x2ccdb4[_0x514d('0x19')]>0x1;var _0x114040=[];if(!fs[_0x514d('0x1f')](path[_0x514d('0x20')](_0x386c99,_0x48657a))&&_0x2f3777){fs[_0x514d('0x21')](path[_0x514d('0x20')](_0x386c99,_0x48657a));}return BPromise[_0x514d('0x22')](_0x2ccdb4,function(_0x2199ca){_0x114040[_0x514d('0x1a')](_0x2199ca);})[_0x514d('0x12')](function(){for(var _0x165c81=0x0;_0x165c81<_0x114040[_0x514d('0x19')];_0x165c81+=0x1){var _0x2b70c8;var _0xdb9f49=_0x114040[_0x165c81];if(_0x2f3777){_0x2b70c8=path[_0x514d('0x20')](_0x386c99,_0x48657a,util[_0x514d('0xb')](_0x514d('0x23'),_0x48657a,_0x165c81,_0x514d('0x24')));}else{_0x2b70c8=path[_0x514d('0x20')](_0x386c99,util[_0x514d('0xb')](_0x514d('0x25'),_0x48657a,_0x514d('0x24')));}fs['writeFileSync'](_0x2b70c8,csv(_0xdb9f49));}})[_0x514d('0x12')](function(){if(_0x2f3777){zipdir(path[_0x514d('0x20')](_0x386c99,_0x48657a),{'saveTo':path[_0x514d('0x20')](_0x386c99,util[_0x514d('0xb')](_0x514d('0x25'),_0x48657a,_0x514d('0x26')))},function(_0x295474,_0x34f2cd){});rimraf(path[_0x514d('0x20')](_0x386c99,_0x48657a),function(){});}})[_0x514d('0x12')](function(){logger[_0x514d('0xa')](util['format'](_0x514d('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x514d('0x28'),_0x2f3777?util[_0x514d('0xb')]('%s.%s',_0x48657a,_0x2f3777?'zip':'csv'):null);});})[_0x514d('0x29')](function(_0x5210ba){logger[_0x514d('0xa')](util[_0x514d('0xb')](_0x514d('0x2a'),EXTRACTED_REPORT_ID,'CSV'),util[_0x514d('0x2b')](_0x5210ba,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x514d('0x2c'));});}main();
\ No newline at end of file
index eb4fd87..1062175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec44=['black','toString','body','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Italic.ttf','createPdfKitDocument','pdf','pipe','createWriteStream','finish','log','err','end','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','inspect','Failed','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','hasOwnProperty','push','tableHeader','num','Empty','dirname','.pdf','Setting','find','split','splitSizePdf','then','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header'];(function(_0x46c0ac,_0x54c2f2){var _0x10686e=function(_0x3f4208){while(--_0x3f4208){_0x46c0ac['push'](_0x46c0ac['shift']());}};_0x10686e(++_0x54c2f2);}(_0xec44,0x1ed));var _0x4ec4=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0xec44[_0x3452a8];return _0x233814;};'use strict';var _=require('lodash');var fs=require('fs');var BPromise=require(_0x4ec4('0x0'));var util=require(_0x4ec4('0x1'));var path=require(_0x4ec4('0x2'));var moment=require(_0x4ec4('0x3'));var PdfPrinter=require(_0x4ec4('0x4'));var zipdir=require(_0x4ec4('0x5'));var rimraf=require(_0x4ec4('0x6'));var db=require(_0x4ec4('0x7'))['db'];var dbH=require(_0x4ec4('0x7'))[_0x4ec4('0x8')];var logger=require(_0x4ec4('0x9'))(_0x4ec4('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x4ec4('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x4ec4('0xb')][0x5];var FORMAT=_0x4ec4('0xc');var _extractedReport;function analyticExtractedReport(_0x3f48ce,_0x50c97b){var _0x12c201={'status':_0x3f48ce};var _0x2da304={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x50c97b){_0x12c201['savename']=_0x50c97b;}return db[_0x4ec4('0xd')]['update'](_0x12c201,_0x2da304);}function getHeader(_0x5985a3){var _0x19f92c=[];for(var _0x5c49bb in _0x5985a3){if(_0x5985a3[_0x4ec4('0xe')](_0x5c49bb)){_0x19f92c[_0x4ec4('0xf')]({'text':_0x5c49bb,'style':_0x4ec4('0x10')});}}return _0x19f92c;}function extractReport(_0x5a01a6){var _0x3a4a01=0x1388;var _0x3ed3aa;if(!_0x5a01a6[0x0][_0x4ec4('0x11')]){return analyticExtractedReport(_0x4ec4('0x12'));}var _0x2eb3f0=[];var _0x1c2616=0x0;var _0x293804=!![];var _0x5425db=path[_0x4ec4('0x13')](PATH);var _0x362709=path['basename'](PATH,_0x4ec4('0x14'));var _0x1886ee=![];var _0x128535=[];return db[_0x4ec4('0x15')][_0x4ec4('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4ec4('0x17'),_0x4ec4('0x18')]})[_0x4ec4('0x19')](function(_0x50f18e){if(_0x50f18e){_0x3ed3aa=_0x50f18e;_0x3a4a01=_0x3ed3aa[_0x4ec4('0x18')]||0x3e8;}})[_0x4ec4('0x19')](function(){if(_0x5a01a6&&_0x5a01a6[_0x4ec4('0x1a')]){var _0xe8aafd=_0x5a01a6[0x0]['num']%(_0x1c2616+_0x3a4a01);if(_0x3ed3aa[_0x4ec4('0x17')]){for(;_0x293804;_0x1c2616+=_0x3a4a01,_0xe8aafd=_0x5a01a6[0x0][_0x4ec4('0x11')]%(_0x1c2616+_0x3a4a01)){if(_0xe8aafd==0x0||_0xe8aafd==_0x5a01a6[0x0][_0x4ec4('0x11')]){_0x293804=![];}_0x2eb3f0['push'](dbH[_0x4ec4('0x1b')][_0x4ec4('0x1c')](util[_0x4ec4('0x1d')](_0x4ec4('0x1e'),QUERY,_0x3a4a01,_0x1c2616),{'type':dbH[_0x4ec4('0x1b')][_0x4ec4('0x1f')][_0x4ec4('0x20')]}));}}else{_0x2eb3f0['push'](dbH[_0x4ec4('0x1b')][_0x4ec4('0x1c')](QUERY,{'type':dbH[_0x4ec4('0x1b')][_0x4ec4('0x1f')][_0x4ec4('0x20')]}));}}_0x1886ee=_0x3ed3aa['split']&&_0x2eb3f0[_0x4ec4('0x1a')]>0x1;if(!fs[_0x4ec4('0x21')](path[_0x4ec4('0x22')](_0x5425db,_0x362709))&&_0x1886ee){fs[_0x4ec4('0x23')](path[_0x4ec4('0x22')](_0x5425db,_0x362709));}return BPromise[_0x4ec4('0x24')](_0x2eb3f0,function(_0x498d79){_0x128535[_0x4ec4('0xf')](_0x498d79);});})[_0x4ec4('0x19')](function(){return BPromise[_0x4ec4('0x24')](_0x2eb3f0,function(_0x361ccf,_0x2d24c6){var _0x59f7f0;var _0x591d06=util[_0x4ec4('0x1d')](_0x4ec4('0x25'),NAME,_extractedReport[_0x4ec4('0x26')],moment(_extractedReport[_0x4ec4('0x27')])['format'](FORMAT),moment(_extractedReport[_0x4ec4('0x28')])['format'](FORMAT));var _0x356f48={'pageSize':'A4','pageOrientation':_0x4ec4('0x29'),'content':[{'text':_0x591d06,'style':_0x4ec4('0x2a')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x4ec4('0x2b')}}};var _0x1438b9={'headerRows':0x1,'body':[]};_0x1438b9['body'][_0x4ec4('0xf')](getHeader(_0x361ccf[0x0]));var _0x4cd7a8;for(var _0xf6d5e6=0x0;_0xf6d5e6<_0x361ccf['length'];_0xf6d5e6+=0x1){_0x4cd7a8=[];for(var _0x538fa8 in _0x361ccf[_0xf6d5e6]){if(_0x361ccf[_0xf6d5e6][_0x4ec4('0xe')](_0x538fa8)){_0x4cd7a8['push'](_0x361ccf[_0xf6d5e6][_0x538fa8]?_[_0x4ec4('0x2c')](_0x361ccf[_0xf6d5e6][_0x538fa8]):'');}}_0x1438b9[_0x4ec4('0x2d')][_0x4ec4('0xf')](_0x4cd7a8);}_0x356f48['content'][_0x4ec4('0xf')]({'table':_0x1438b9});return new BPromise(function(_0x4ced96,_0x5859e1){var _0x344043=new PdfPrinter({'Roboto':{'normal':__dirname+_0x4ec4('0x2e'),'bold':__dirname+'/fonts/Roboto-Medium.ttf','italics':__dirname+_0x4ec4('0x2f'),'bolditalics':__dirname+'/fonts/Roboto-MediumItalic.ttf'}});var _0x456a22=_0x344043[_0x4ec4('0x30')](_0x356f48);if(_0x1886ee){_0x59f7f0=path[_0x4ec4('0x22')](_0x5425db,_0x362709,util[_0x4ec4('0x1d')]('%s%d.%s',_0x362709,_0x2d24c6,_0x4ec4('0x31')));}else{_0x59f7f0=path[_0x4ec4('0x22')](_0x5425db,util['format']('%s.%s',_0x362709,'pdf'));}var _0x1a5d40=_0x456a22[_0x4ec4('0x32')](fs[_0x4ec4('0x33')](_0x59f7f0));_0x1a5d40['on'](_0x4ec4('0x34'),function(){_0x4ced96();});_0x1a5d40['on']('error',function(_0x32d805){console[_0x4ec4('0x35')](_0x4ec4('0x36'),_0x32d805);_0x5859e1(_0x32d805);});_0x456a22[_0x4ec4('0x37')]();});});})[_0x4ec4('0x19')](function(){if(_0x1886ee){return new BPromise(function(_0x4010cd,_0x27ab19){zipdir(path[_0x4ec4('0x22')](_0x5425db,_0x362709),{'saveTo':path['join'](_0x5425db,util[_0x4ec4('0x1d')](_0x4ec4('0x38'),_0x362709,_0x4ec4('0x39')))},function(_0x4c9719){if(_0x4c9719){_0x27ab19(_0x4c9719);}else{_0x4010cd();}});});}})[_0x4ec4('0x19')](function(){if(_0x1886ee){rimraf(path[_0x4ec4('0x22')](_0x5425db,_0x362709),function(){});}})['then'](function(){logger[_0x4ec4('0x3a')](util['format'](_0x4ec4('0x3b'),EXTRACTED_REPORT_ID,_0x4ec4('0x3c')));return analyticExtractedReport('Completed',_0x1886ee?util['format'](_0x4ec4('0x38'),_0x362709,_0x1886ee?_0x4ec4('0x39'):_0x4ec4('0x31')):null);});}function main(){logger[_0x4ec4('0x3a')](util[_0x4ec4('0x1d')](_0x4ec4('0x3d'),EXTRACTED_REPORT_ID,_0x4ec4('0x3e')));return db[_0x4ec4('0xd')][_0x4ec4('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4ec4('0x19')](function(_0x58c2a2){_extractedReport=_0x58c2a2;return dbH[_0x4ec4('0x1b')]['query'](util[_0x4ec4('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x4ec4('0x20')]});})[_0x4ec4('0x19')](extractReport)[_0x4ec4('0x40')](function(_0xa56706){logger[_0x4ec4('0x3a')](util[_0x4ec4('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4ec4('0x3e')),util[_0x4ec4('0x41')](_0xa56706,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x4ec4('0x42'));});}main();
\ No newline at end of file
+var _0x7dd7=['push','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header','black','body','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-MediumItalic.ttf','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','finish','error','log','err','end','info','CSV','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7dd7,0x1a5));var _0x77dd=function(_0x44c935,_0x3653f0){_0x44c935=_0x44c935-0x0;var _0x465bee=_0x7dd7[_0x44c935];return _0x465bee;};'use strict';var _=require(_0x77dd('0x0'));var fs=require('fs');var BPromise=require(_0x77dd('0x1'));var util=require(_0x77dd('0x2'));var path=require(_0x77dd('0x3'));var moment=require(_0x77dd('0x4'));var PdfPrinter=require(_0x77dd('0x5'));var zipdir=require(_0x77dd('0x6'));var rimraf=require(_0x77dd('0x7'));var db=require(_0x77dd('0x8'))['db'];var dbH=require(_0x77dd('0x8'))['dbH'];var logger=require(_0x77dd('0x9'))(_0x77dd('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x77dd('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x77dd('0xb')][0x5];var FORMAT=_0x77dd('0xc');var _extractedReport;function analyticExtractedReport(_0x305e1a,_0x112323){var _0x4cc538={'status':_0x305e1a};var _0x4f7556={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x112323){_0x4cc538[_0x77dd('0xd')]=_0x112323;}return db[_0x77dd('0xe')][_0x77dd('0xf')](_0x4cc538,_0x4f7556);}function getHeader(_0x5335de){var _0x40b9f6=[];for(var _0xa90c2a in _0x5335de){if(_0x5335de[_0x77dd('0x10')](_0xa90c2a)){_0x40b9f6[_0x77dd('0x11')]({'text':_0xa90c2a,'style':_0x77dd('0x12')});}}return _0x40b9f6;}function extractReport(_0x31b523){var _0x2dc680=0x1388;var _0x40e47e;if(!_0x31b523[0x0][_0x77dd('0x13')]){return analyticExtractedReport(_0x77dd('0x14'));}var _0x2f0e0b=[];var _0x3f3bdb=0x0;var _0x56d760=!![];var _0xb34cc4=path[_0x77dd('0x15')](PATH);var _0xfe2034=path[_0x77dd('0x16')](PATH,_0x77dd('0x17'));var _0x21aad8=![];var _0x404d12=[];return db[_0x77dd('0x18')][_0x77dd('0x19')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x77dd('0x1a'),'splitSizePdf']})[_0x77dd('0x1b')](function(_0x35a066){if(_0x35a066){_0x40e47e=_0x35a066;_0x2dc680=_0x40e47e[_0x77dd('0x1c')]||0x3e8;}})['then'](function(){if(_0x31b523&&_0x31b523[_0x77dd('0x1d')]){var _0x49563c=_0x31b523[0x0][_0x77dd('0x13')]%(_0x3f3bdb+_0x2dc680);if(_0x40e47e[_0x77dd('0x1a')]){for(;_0x56d760;_0x3f3bdb+=_0x2dc680,_0x49563c=_0x31b523[0x0][_0x77dd('0x13')]%(_0x3f3bdb+_0x2dc680)){if(_0x49563c==0x0||_0x49563c==_0x31b523[0x0][_0x77dd('0x13')]){_0x56d760=![];}_0x2f0e0b['push'](dbH[_0x77dd('0x1e')][_0x77dd('0x1f')](util[_0x77dd('0x20')](_0x77dd('0x21'),QUERY,_0x2dc680,_0x3f3bdb),{'type':dbH[_0x77dd('0x1e')][_0x77dd('0x22')]['SELECT']}));}}else{_0x2f0e0b[_0x77dd('0x11')](dbH['sequelize'][_0x77dd('0x1f')](QUERY,{'type':dbH[_0x77dd('0x1e')]['QueryTypes'][_0x77dd('0x23')]}));}}_0x21aad8=_0x40e47e[_0x77dd('0x1a')]&&_0x2f0e0b[_0x77dd('0x1d')]>0x1;if(!fs[_0x77dd('0x24')](path[_0x77dd('0x25')](_0xb34cc4,_0xfe2034))&&_0x21aad8){fs[_0x77dd('0x26')](path[_0x77dd('0x25')](_0xb34cc4,_0xfe2034));}return BPromise[_0x77dd('0x27')](_0x2f0e0b,function(_0x3df092){_0x404d12['push'](_0x3df092);});})['then'](function(){return BPromise[_0x77dd('0x27')](_0x2f0e0b,function(_0x5ca7fd,_0x2e0143){var _0x147f08;var _0x31e3e9=util[_0x77dd('0x20')](_0x77dd('0x28'),NAME,_extractedReport[_0x77dd('0x29')],moment(_extractedReport[_0x77dd('0x2a')])[_0x77dd('0x20')](FORMAT),moment(_extractedReport[_0x77dd('0x2b')])['format'](FORMAT));var _0x1a69f9={'pageSize':'A4','pageOrientation':_0x77dd('0x2c'),'content':[{'text':_0x31e3e9,'style':_0x77dd('0x2d')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x77dd('0x2e')}}};var _0x1149de={'headerRows':0x1,'body':[]};_0x1149de[_0x77dd('0x2f')][_0x77dd('0x11')](getHeader(_0x5ca7fd[0x0]));var _0x2200b3;for(var _0x52dbed=0x0;_0x52dbed<_0x5ca7fd['length'];_0x52dbed+=0x1){_0x2200b3=[];for(var _0x3d07c6 in _0x5ca7fd[_0x52dbed]){if(_0x5ca7fd[_0x52dbed][_0x77dd('0x10')](_0x3d07c6)){_0x2200b3[_0x77dd('0x11')](_0x5ca7fd[_0x52dbed][_0x3d07c6]?_['toString'](_0x5ca7fd[_0x52dbed][_0x3d07c6]):'');}}_0x1149de[_0x77dd('0x2f')]['push'](_0x2200b3);}_0x1a69f9[_0x77dd('0x30')]['push']({'table':_0x1149de});return new BPromise(function(_0x47e29b,_0x2d59dd){var _0x421e72=new PdfPrinter({'Roboto':{'normal':__dirname+_0x77dd('0x31'),'bold':__dirname+_0x77dd('0x32'),'italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+_0x77dd('0x33')}});var _0x2ed455=_0x421e72['createPdfKitDocument'](_0x1a69f9);if(_0x21aad8){_0x147f08=path[_0x77dd('0x25')](_0xb34cc4,_0xfe2034,util[_0x77dd('0x20')](_0x77dd('0x34'),_0xfe2034,_0x2e0143,_0x77dd('0x35')));}else{_0x147f08=path[_0x77dd('0x25')](_0xb34cc4,util[_0x77dd('0x20')](_0x77dd('0x36'),_0xfe2034,_0x77dd('0x35')));}var _0x1c1113=_0x2ed455[_0x77dd('0x37')](fs[_0x77dd('0x38')](_0x147f08));_0x1c1113['on'](_0x77dd('0x39'),function(){_0x47e29b();});_0x1c1113['on'](_0x77dd('0x3a'),function(_0x27a121){console[_0x77dd('0x3b')](_0x77dd('0x3c'),_0x27a121);_0x2d59dd(_0x27a121);});_0x2ed455[_0x77dd('0x3d')]();});});})['then'](function(){if(_0x21aad8){return new BPromise(function(_0x47e655,_0xced460){zipdir(path[_0x77dd('0x25')](_0xb34cc4,_0xfe2034),{'saveTo':path[_0x77dd('0x25')](_0xb34cc4,util['format'](_0x77dd('0x36'),_0xfe2034,'zip'))},function(_0x278426){if(_0x278426){_0xced460(_0x278426);}else{_0x47e655();}});});}})[_0x77dd('0x1b')](function(){if(_0x21aad8){rimraf(path[_0x77dd('0x25')](_0xb34cc4,_0xfe2034),function(){});}})[_0x77dd('0x1b')](function(){logger[_0x77dd('0x3e')](util[_0x77dd('0x20')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x77dd('0x3f')));return analyticExtractedReport(_0x77dd('0x40'),_0x21aad8?util[_0x77dd('0x20')](_0x77dd('0x36'),_0xfe2034,_0x21aad8?_0x77dd('0x41'):_0x77dd('0x35')):null);});}function main(){logger[_0x77dd('0x3e')](util[_0x77dd('0x20')](_0x77dd('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x77dd('0xe')][_0x77dd('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x77dd('0x1b')](function(_0x11dd05){_extractedReport=_0x11dd05;return dbH[_0x77dd('0x1e')][_0x77dd('0x1f')](util[_0x77dd('0x20')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x77dd('0x1e')][_0x77dd('0x22')][_0x77dd('0x23')]});})['then'](extractReport)[_0x77dd('0x44')](function(_0x9e7e73){logger[_0x77dd('0x3e')](util['format'](_0x77dd('0x45'),EXTRACTED_REPORT_ID,_0x77dd('0x46')),util[_0x77dd('0x47')](_0x9e7e73,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x77dd('0x48'));});}main();
\ No newline at end of file
index 964978c..c063dc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb770=['join','xlsx','%s.%s','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','then','splitSizeXlsx','sequelize','query','QueryTypes','SELECT','num','length','push','basename','.xlsx','existsSync','mkdirSync'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb770,0x12a));var _0x0b77=function(_0x11cc54,_0x1b3e76){_0x11cc54=_0x11cc54-0x0;var _0x2b04c0=_0xb770[_0x11cc54];return _0x2b04c0;};'use strict';var util=require(_0x0b77('0x0'));var path=require(_0x0b77('0x1'));var _=require(_0x0b77('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x0b77('0x3'));var rimraf=require(_0x0b77('0x4'));var db=require(_0x0b77('0x5'))['db'];var dbH=require(_0x0b77('0x5'))['dbH'];var logger=require(_0x0b77('0x6'))(_0x0b77('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0b77('0x8')][0x3];var PATH=process[_0x0b77('0x8')][0x4];function analyticExtractedReport(_0x51811a,_0x14c43f){var _0x38f9f0={'status':_0x51811a};var _0x13a9f0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x14c43f){_0x38f9f0['savename']=_0x14c43f;}return db[_0x0b77('0x9')][_0x0b77('0xa')](_0x38f9f0,_0x13a9f0);}function main(){var _0x4af6b7=0x1388;var _0x48c62c;logger[_0x0b77('0xb')](util[_0x0b77('0xc')](_0x0b77('0xd'),EXTRACTED_REPORT_ID,_0x0b77('0xe')));return db[_0x0b77('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0b77('0x10'),'splitSizeXlsx']})[_0x0b77('0x11')](function(_0x103cab){if(_0x103cab){_0x48c62c=_0x103cab;_0x4af6b7=_0x48c62c[_0x0b77('0x12')]||0x1388;}})[_0x0b77('0x11')](function(){return dbH[_0x0b77('0x13')][_0x0b77('0x14')](util[_0x0b77('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x0b77('0x15')][_0x0b77('0x16')]});})[_0x0b77('0x11')](function(_0x5769a1){if(!_0x5769a1[0x0][_0x0b77('0x17')]){return analyticExtractedReport('Empty');}var _0x18d47e=[];var _0x54bf58=0x0;var _0x4c80ed=!![];if(_0x48c62c[_0x0b77('0x10')]){if(_0x5769a1&&_0x5769a1[_0x0b77('0x18')]){var _0x38110f=_0x5769a1[0x0]['num']%(_0x54bf58+_0x4af6b7);for(;_0x4c80ed;_0x54bf58+=_0x4af6b7,_0x38110f=_0x5769a1[0x0][_0x0b77('0x17')]%(_0x54bf58+_0x4af6b7)){if(_0x38110f==0x0||_0x38110f==_0x5769a1[0x0]['num']){_0x4c80ed=![];}_0x18d47e[_0x0b77('0x19')](dbH[_0x0b77('0x13')][_0x0b77('0x14')](util[_0x0b77('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4af6b7,_0x54bf58),{'type':dbH['sequelize'][_0x0b77('0x15')][_0x0b77('0x16')]}));}}}else{_0x18d47e['push'](dbH[_0x0b77('0x13')][_0x0b77('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x5f5d04=path['dirname'](PATH);var _0x11fec4=path[_0x0b77('0x1a')](PATH,_0x0b77('0x1b'));var _0x289a9b=_0x48c62c[_0x0b77('0x10')]&&_0x18d47e[_0x0b77('0x18')]>0x1;var _0x30a1f4=[];if(!fs[_0x0b77('0x1c')](path['join'](_0x5f5d04,_0x11fec4))&&_0x289a9b){fs[_0x0b77('0x1d')](path['join'](_0x5f5d04,_0x11fec4));}return BPromise['each'](_0x18d47e,function(_0x2b96bc){_0x30a1f4[_0x0b77('0x19')](_0x2b96bc);})['then'](function(){for(var _0x4377cd=0x0;_0x4377cd<_0x30a1f4[_0x0b77('0x18')];_0x4377cd+=0x1){var _0x326755;var _0x864fdd=_0x30a1f4[_0x4377cd];if(_0x289a9b){_0x326755=path[_0x0b77('0x1e')](_0x5f5d04,_0x11fec4,util['format']('%s%d.%s',_0x11fec4,_0x4377cd,_0x0b77('0x1f')));}else{_0x326755=path['join'](_0x5f5d04,util['format'](_0x0b77('0x20'),_0x11fec4,_0x0b77('0x1f')));}fs['writeFileSync'](_0x326755,json2xls(_0x864fdd),_0x0b77('0x21'));}})[_0x0b77('0x11')](function(){if(_0x289a9b){zipdir(path[_0x0b77('0x1e')](_0x5f5d04,_0x11fec4),{'saveTo':path[_0x0b77('0x1e')](_0x5f5d04,util['format'](_0x0b77('0x20'),_0x11fec4,_0x0b77('0x22')))},function(_0x1be104,_0x130bd4){});rimraf(path[_0x0b77('0x1e')](_0x5f5d04,_0x11fec4),function(){});}})[_0x0b77('0x11')](function(){logger[_0x0b77('0xb')](util[_0x0b77('0xc')](_0x0b77('0x23'),EXTRACTED_REPORT_ID,_0x0b77('0xe')));return analyticExtractedReport(_0x0b77('0x24'),_0x289a9b?util[_0x0b77('0xc')](_0x0b77('0x20'),_0x11fec4,_0x289a9b?_0x0b77('0x22'):'xlsx'):null);});})[_0x0b77('0x25')](function(_0x5954fa){logger['info'](util[_0x0b77('0xc')](_0x0b77('0x26'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x0b77('0x27')](_0x5954fa,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0b77('0x28'));});}main();
\ No newline at end of file
+var _0xeef1=['join','each','length','%s%d.%s','xlsx','%s.%s','binary','Completed','zip','catch','info','inspect','Failed','util','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','XLSX','Setting','find','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync'];(function(_0x503af,_0x29a735){var _0x48d20b=function(_0x4c651f){while(--_0x4c651f){_0x503af['push'](_0x503af['shift']());}};_0x48d20b(++_0x29a735);}(_0xeef1,0x199));var _0x1eef=function(_0x2e7f67,_0x3c3f8c){_0x2e7f67=_0x2e7f67-0x0;var _0x1f0485=_0xeef1[_0x2e7f67];return _0x1f0485;};'use strict';var util=require(_0x1eef('0x0'));var path=require(_0x1eef('0x1'));var _=require(_0x1eef('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x1eef('0x3'));var zipdir=require(_0x1eef('0x4'));var rimraf=require('rimraf');var db=require(_0x1eef('0x5'))['db'];var dbH=require(_0x1eef('0x5'))[_0x1eef('0x6')];var logger=require(_0x1eef('0x7'))(_0x1eef('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x1eef('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1eef('0x9')][0x4];function analyticExtractedReport(_0x1dd89d,_0x1bb22a){var _0x3d92a4={'status':_0x1dd89d};var _0x4193cc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1bb22a){_0x3d92a4[_0x1eef('0xa')]=_0x1bb22a;}return db[_0x1eef('0xb')][_0x1eef('0xc')](_0x3d92a4,_0x4193cc);}function main(){var _0x28c993=0x1388;var _0x4477da;logger['info'](util[_0x1eef('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1eef('0xe')));return db[_0x1eef('0xf')][_0x1eef('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1eef('0x11'),_0x1eef('0x12')]})[_0x1eef('0x13')](function(_0x54f251){if(_0x54f251){_0x4477da=_0x54f251;_0x28c993=_0x4477da[_0x1eef('0x12')]||0x1388;}})[_0x1eef('0x13')](function(){return dbH['sequelize']['query'](util[_0x1eef('0xd')](_0x1eef('0x14'),QUERY),{'type':dbH[_0x1eef('0x15')][_0x1eef('0x16')][_0x1eef('0x17')]});})['then'](function(_0x14a9bb){if(!_0x14a9bb[0x0][_0x1eef('0x18')]){return analyticExtractedReport('Empty');}var _0x11c7db=[];var _0x50d0d2=0x0;var _0x101466=!![];if(_0x4477da['split']){if(_0x14a9bb&&_0x14a9bb['length']){var _0x26b2eb=_0x14a9bb[0x0]['num']%(_0x50d0d2+_0x28c993);for(;_0x101466;_0x50d0d2+=_0x28c993,_0x26b2eb=_0x14a9bb[0x0]['num']%(_0x50d0d2+_0x28c993)){if(_0x26b2eb==0x0||_0x26b2eb==_0x14a9bb[0x0][_0x1eef('0x18')]){_0x101466=![];}_0x11c7db[_0x1eef('0x19')](dbH[_0x1eef('0x15')][_0x1eef('0x1a')](util[_0x1eef('0xd')](_0x1eef('0x1b'),QUERY,_0x28c993,_0x50d0d2),{'type':dbH[_0x1eef('0x15')]['QueryTypes']['SELECT']}));}}}else{_0x11c7db['push'](dbH['sequelize'][_0x1eef('0x1a')](QUERY,{'type':dbH[_0x1eef('0x15')]['QueryTypes'][_0x1eef('0x17')]}));}var _0x60116=path[_0x1eef('0x1c')](PATH);var _0x520c7e=path[_0x1eef('0x1d')](PATH,'.xlsx');var _0x406546=_0x4477da['split']&&_0x11c7db['length']>0x1;var _0x5dbebb=[];if(!fs[_0x1eef('0x1e')](path['join'](_0x60116,_0x520c7e))&&_0x406546){fs['mkdirSync'](path[_0x1eef('0x1f')](_0x60116,_0x520c7e));}return BPromise[_0x1eef('0x20')](_0x11c7db,function(_0x2b49aa){_0x5dbebb[_0x1eef('0x19')](_0x2b49aa);})[_0x1eef('0x13')](function(){for(var _0x146f83=0x0;_0x146f83<_0x5dbebb[_0x1eef('0x21')];_0x146f83+=0x1){var _0x464df7;var _0x25b910=_0x5dbebb[_0x146f83];if(_0x406546){_0x464df7=path[_0x1eef('0x1f')](_0x60116,_0x520c7e,util[_0x1eef('0xd')](_0x1eef('0x22'),_0x520c7e,_0x146f83,_0x1eef('0x23')));}else{_0x464df7=path[_0x1eef('0x1f')](_0x60116,util[_0x1eef('0xd')](_0x1eef('0x24'),_0x520c7e,'xlsx'));}fs['writeFileSync'](_0x464df7,json2xls(_0x25b910),_0x1eef('0x25'));}})['then'](function(){if(_0x406546){zipdir(path[_0x1eef('0x1f')](_0x60116,_0x520c7e),{'saveTo':path[_0x1eef('0x1f')](_0x60116,util[_0x1eef('0xd')](_0x1eef('0x24'),_0x520c7e,'zip'))},function(_0x3bb1ae,_0x1b95ea){});rimraf(path[_0x1eef('0x1f')](_0x60116,_0x520c7e),function(){});}})['then'](function(){logger['info'](util[_0x1eef('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1eef('0xe')));return analyticExtractedReport(_0x1eef('0x26'),_0x406546?util[_0x1eef('0xd')](_0x1eef('0x24'),_0x520c7e,_0x406546?_0x1eef('0x27'):_0x1eef('0x23')):null);});})[_0x1eef('0x28')](function(_0x4933ef){logger[_0x1eef('0x29')](util[_0x1eef('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1eef('0xe')),util[_0x1eef('0x2a')](_0x4933ef,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1eef('0x2b'));});}main();
\ No newline at end of file
index c8922ab..82ca753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f7a=[',ab','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','util','models','then','intervals','VoiceExtension','findAll','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','playback','hasOwnProperty','answer','progress','priority','extensions','push','type','context','Set','format','VoiceExtensionId','length','createdAt','*,*,*,*','interval','IntervalId','filter','tag','CDR(tag)=','CALLERID(all)=','callerID','indexOf','app','toLowerCase','appType','custom','Answer','Progress','record','recordingFormat','MixMonitor','${UNIQUEID}.'];(function(_0x5d8782,_0x31c702){var _0x26c389=function(_0xe25cc6){while(--_0xe25cc6){_0x5d8782['push'](_0x5d8782['shift']());}};_0x26c389(++_0x31c702);}(_0x5f7a,0x16f));var _0xa5f7=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5f7a[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xa5f7('0x0'));var util=require(_0xa5f7('0x1'));function rewrite(_0x396b23,_0x50b7a9){var _0x594601=this;return _0x396b23[_0xa5f7('0x2')]['Interval']['findAll']({'raw':!![]})[_0xa5f7('0x3')](function(_0x5a9df3){_0x594601[_0xa5f7('0x4')]=_0x5a9df3;return _0x396b23[_0xa5f7('0x2')][_0xa5f7('0x5')][_0xa5f7('0x6')]({'where':{'IntervalId':_0x50b7a9['IntervalId']},'raw':!![]});})['then'](function(_0x2e80a9){return _0x396b23[_0xa5f7('0x2')][_0xa5f7('0x5')][_0xa5f7('0x6')]({'where':{'exten':{'$in':_[_0xa5f7('0x7')](_[_0xa5f7('0x8')](_0x2e80a9,_0xa5f7('0x9')))},'isApp':!![]},'order':[{'raw':_0xa5f7('0xa')}],'raw':!![]});})[_0xa5f7('0x3')](function(_0x1b02b0){var _0x2f6c53=_[_0xa5f7('0xb')](_0x1b02b0,_0xa5f7('0x9'));var _0x3ac6c4=[_0xa5f7('0xc'),_0xa5f7('0xd')];var _0x1b2b43=[];var _0x3c12fe=[];for(var _0x27e6a7 in _0x2f6c53){if(_0x2f6c53[_0xa5f7('0xe')](_0x27e6a7)){_0x594601[_0xa5f7('0xf')]=![];_0x594601[_0xa5f7('0x10')]=![];_0x594601[_0xa5f7('0x11')]=0x2;_0x594601[_0xa5f7('0x12')]=[];_0x594601[_0xa5f7('0x12')][_0xa5f7('0x13')]({'type':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x14')],'context':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x15')],'exten':_0x2f6c53[_0x27e6a7][0x0]['exten'],'priority':_0x594601['priority']++,'app':_0xa5f7('0x16'),'appdata':util[_0xa5f7('0x17')]('CDR(type)=%s',_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x14')]),'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x18')]});for(var _0x59faa7=0x0,_0x42afd5=0x0;_0x59faa7<_0x2f6c53[_0x27e6a7][_0xa5f7('0x19')];_0x59faa7+=0x1,_0x42afd5=0x0){var _0x4245bc=_0x2f6c53[_0x27e6a7][_0x59faa7];var _0x103e97=[];var _0x469879=[];delete _0x4245bc['id'];delete _0x4245bc[_0xa5f7('0x1a')];delete _0x4245bc['updatedAt'];var _0x3fb93a=_0x4245bc['interval']!==_0xa5f7('0x1b')?[_0x4245bc[_0xa5f7('0x1c')]]:_0x4245bc[_0xa5f7('0x1d')]?_[_0xa5f7('0x8')](_[_0xa5f7('0x1e')](_0x594601['intervals'],{'IntervalId':_0x4245bc[_0xa5f7('0x1d')]}),'interval'):[];if(_0x4245bc[_0xa5f7('0xe')](_0xa5f7('0x1f'))){if(_0x4245bc[_0xa5f7('0x1f')]&&_0x4245bc[_0xa5f7('0x1f')]!=='--'){_0x103e97['push']({'type':_0x4245bc[_0xa5f7('0x14')],'app':_0xa5f7('0x16'),'appdata':_0xa5f7('0x20')+_0x4245bc[_0xa5f7('0x1f')],'context':_0x4245bc[_0xa5f7('0x15')],'exten':_0x4245bc[_0xa5f7('0x9')],'priority':_0x3fb93a['length']+_0x594601['priority']+_0x42afd5++,'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x18')]});}}if(_0x4245bc[_0xa5f7('0xe')]('callerID')){if(_0x4245bc['callerID']){_0x103e97[_0xa5f7('0x13')]({'type':_0x4245bc[_0xa5f7('0x14')],'app':'Set','appdata':_0xa5f7('0x21')+_0x4245bc[_0xa5f7('0x22')],'context':_0x4245bc[_0xa5f7('0x15')],'exten':_0x4245bc[_0xa5f7('0x9')],'priority':_0x3fb93a[_0xa5f7('0x19')]+_0x594601['priority']+_0x42afd5++,'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0]['VoiceExtensionId']});}}if(_0x4245bc['hasOwnProperty']('answer')){if(_0x3ac6c4[_0xa5f7('0x23')](_0x4245bc[_0xa5f7('0x24')][_0xa5f7('0x25')]())>=0x0&&_0x4245bc[_0xa5f7('0x26')]!==_0xa5f7('0x27')){if(!_0x594601[_0xa5f7('0xf')]&&_0x4245bc['answer']){_0x594601[_0xa5f7('0xf')]=!![];_0x103e97[_0xa5f7('0x13')]({'type':_0x4245bc['type'],'app':_0xa5f7('0x28'),'context':_0x4245bc[_0xa5f7('0x15')],'exten':_0x4245bc[_0xa5f7('0x9')],'priority':_0x3fb93a[_0xa5f7('0x19')]+_0x594601['priority']+_0x42afd5++,'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0]['VoiceExtensionId']});}if(!_0x594601[_0xa5f7('0xf')]&&!_0x594601[_0xa5f7('0x10')]&&!_0x4245bc[_0xa5f7('0xf')]){_0x594601[_0xa5f7('0x10')]=!![];_0x103e97['push']({'type':_0x4245bc[_0xa5f7('0x14')],'app':_0xa5f7('0x29'),'context':_0x4245bc['context'],'exten':_0x4245bc[_0xa5f7('0x9')],'priority':_0x3fb93a['length']+_0x594601[_0xa5f7('0x11')]+_0x42afd5++,'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x18')]});}}}if(_0x4245bc['hasOwnProperty'](_0xa5f7('0x2a'))&&_0x4245bc[_0xa5f7('0xe')](_0xa5f7('0x2b'))){if(_0x4245bc[_0xa5f7('0x2a')]){_0x103e97['push']({'type':_0x4245bc['type'],'app':_0xa5f7('0x2c'),'appdata':_0xa5f7('0x2d')+_0x4245bc['recordingFormat']+_0xa5f7('0x2e'),'context':_0x4245bc[_0xa5f7('0x15')],'exten':_0x4245bc['exten'],'priority':_0x3fb93a[_0xa5f7('0x19')]+_0x594601[_0xa5f7('0x11')]+_0x42afd5++,'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x18')]});}}if(_0x4245bc[_0xa5f7('0xe')]('record')&&_0x4245bc['hasOwnProperty'](_0xa5f7('0x2b'))){if(_0x4245bc[_0xa5f7('0x2a')]){_0x469879[_0xa5f7('0x13')]({'type':_0x4245bc['type'],'app':'StopMixMonitor','appdata':null,'context':_0x4245bc['context'],'exten':_0x4245bc[_0xa5f7('0x9')],'priority':_0x3fb93a[_0xa5f7('0x19')]+_0x594601[_0xa5f7('0x11')]+_0x42afd5++ +0x1,'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0]['VoiceExtensionId']});}}for(var _0x32e060=0x0;_0x32e060<_0x3fb93a[_0xa5f7('0x19')];_0x32e060+=0x1){var _0x527095=_0x594601[_0xa5f7('0x11')]+_0x3fb93a[_0xa5f7('0x19')];var _0x35aafc=_0x32e060===_0x3fb93a['length']-0x1?_0x594601['priority']+_0x103e97[_0xa5f7('0x19')]+_0x469879['length']+0x2:_0x594601[_0xa5f7('0x11')]+_0x32e060+0x1;_0x103e97[_0xa5f7('0x2f')](_0x32e060,0x0,{'type':_0x4245bc[_0xa5f7('0x14')],'app':_0xa5f7('0x30'),'appdata':_0x3fb93a[_0x32e060]+'?'+_0x4245bc['context']+_0xa5f7('0x31')+_0x527095+':'+_0x4245bc[_0xa5f7('0x15')]+_0xa5f7('0x31')+_0x35aafc,'exten':_0x4245bc[_0xa5f7('0x9')],'context':_0x4245bc['context'],'priority':_0x594601['priority']+_0x32e060,'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x18')]});}_0x4245bc[_0xa5f7('0x11')]=_0x103e97['length']?_[_0xa5f7('0x32')](_0x103e97)[_0xa5f7('0x11')]+0x1:_0x594601[_0xa5f7('0x11')];_0x594601[_0xa5f7('0x11')]=(_0x469879[_0xa5f7('0x19')]?_['last'](_0x469879)[_0xa5f7('0x11')]:_0x4245bc[_0xa5f7('0x11')])+0x1;_0x594601[_0xa5f7('0x12')]=_[_0xa5f7('0x33')](_0x594601[_0xa5f7('0x12')],_0x103e97,[_0x4245bc],_0x469879);}_0x594601[_0xa5f7('0x12')][_0xa5f7('0x13')]({'type':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x14')],'app':_0xa5f7('0x34'),'exten':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x9')],'context':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x15')],'priority':_0x594601[_0xa5f7('0x11')],'VoiceExtensionId':_0x2f6c53[_0x27e6a7][0x0][_0xa5f7('0x18')]});_0x1b2b43[_0xa5f7('0x13')](_0x2f6c53[_0x27e6a7][0x0]['VoiceExtensionId']);_0x3c12fe=_['concat'](_0x3c12fe,_0x594601[_0xa5f7('0x12')]);}}return _0x396b23[_0xa5f7('0x35')](function(_0x45b724){return _0x396b23[_0xa5f7('0x2')][_0xa5f7('0x5')][_0xa5f7('0x36')]({'where':{'VoiceExtensionId':{'$in':_0x1b2b43}},'transaction':_0x45b724})['then'](function(_0x23c74d){return _0x396b23[_0xa5f7('0x2')][_0xa5f7('0x5')][_0xa5f7('0x37')](_['sortBy'](_0x3c12fe,'priority'),{'transaction':_0x45b724});});});})[_0xa5f7('0x38')](function(_0x131f07){console[_0xa5f7('0x39')](_0x131f07);});}exports[_0xa5f7('0x3a')]=rewrite;
\ No newline at end of file
+var _0xb56d=['util','then','intervals','models','VoiceExtension','findAll','IntervalId','map','exten','queue','playback','answer','progress','priority','extensions','type','context','Set','CDR(type)=%s','VoiceExtensionId','length','updatedAt','interval','hasOwnProperty','tag','CDR(tag)=','callerID','push','CALLERID(all)=','app','toLowerCase','custom','Progress','record','MixMonitor','${UNIQUEID}.','recordingFormat','StopMixMonitor','splice','last','concat','Hangup','transaction','destroy','sortBy','error','rewrite','lodash'];(function(_0x594ef5,_0x16f835){var _0x1e4b1a=function(_0x4c4166){while(--_0x4c4166){_0x594ef5['push'](_0x594ef5['shift']());}};_0x1e4b1a(++_0x16f835);}(_0xb56d,0xbf));var _0xdb56=function(_0x2d1eff,_0x108723){_0x2d1eff=_0x2d1eff-0x0;var _0x42610e=_0xb56d[_0x2d1eff];return _0x42610e;};'use strict';var _=require(_0xdb56('0x0'));var util=require(_0xdb56('0x1'));function rewrite(_0x54c436,_0x59ccd4){var _0x31f386=this;return _0x54c436['models']['Interval']['findAll']({'raw':!![]})[_0xdb56('0x2')](function(_0x527078){_0x31f386[_0xdb56('0x3')]=_0x527078;return _0x54c436[_0xdb56('0x4')][_0xdb56('0x5')][_0xdb56('0x6')]({'where':{'IntervalId':_0x59ccd4[_0xdb56('0x7')]},'raw':!![]});})[_0xdb56('0x2')](function(_0x30f06c){return _0x54c436[_0xdb56('0x4')][_0xdb56('0x5')][_0xdb56('0x6')]({'where':{'exten':{'$in':_['uniq'](_[_0xdb56('0x8')](_0x30f06c,_0xdb56('0x9')))},'isApp':!![]},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xdb56('0x2')](function(_0x5967ae){var _0x2a23fa=_['groupBy'](_0x5967ae,'exten');var _0x220acf=[_0xdb56('0xa'),_0xdb56('0xb')];var _0x2020be=[];var _0x45269b=[];for(var _0x17f8d1 in _0x2a23fa){if(_0x2a23fa['hasOwnProperty'](_0x17f8d1)){_0x31f386[_0xdb56('0xc')]=![];_0x31f386[_0xdb56('0xd')]=![];_0x31f386[_0xdb56('0xe')]=0x2;_0x31f386[_0xdb56('0xf')]=[];_0x31f386[_0xdb56('0xf')]['push']({'type':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x10')],'context':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x11')],'exten':_0x2a23fa[_0x17f8d1][0x0]['exten'],'priority':_0x31f386[_0xdb56('0xe')]++,'app':_0xdb56('0x12'),'appdata':util['format'](_0xdb56('0x13'),_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x10')]),'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x14')]});for(var _0x444ca3=0x0,_0x989992=0x0;_0x444ca3<_0x2a23fa[_0x17f8d1][_0xdb56('0x15')];_0x444ca3+=0x1,_0x989992=0x0){var _0x1a9330=_0x2a23fa[_0x17f8d1][_0x444ca3];var _0x1b9a7d=[];var _0x1d79c8=[];delete _0x1a9330['id'];delete _0x1a9330['createdAt'];delete _0x1a9330[_0xdb56('0x16')];var _0x293e47=_0x1a9330[_0xdb56('0x17')]!=='*,*,*,*'?[_0x1a9330[_0xdb56('0x17')]]:_0x1a9330['IntervalId']?_[_0xdb56('0x8')](_['filter'](_0x31f386['intervals'],{'IntervalId':_0x1a9330[_0xdb56('0x7')]}),_0xdb56('0x17')):[];if(_0x1a9330[_0xdb56('0x18')]('tag')){if(_0x1a9330[_0xdb56('0x19')]&&_0x1a9330[_0xdb56('0x19')]!=='--'){_0x1b9a7d['push']({'type':_0x1a9330['type'],'app':'Set','appdata':_0xdb56('0x1a')+_0x1a9330['tag'],'context':_0x1a9330[_0xdb56('0x11')],'exten':_0x1a9330[_0xdb56('0x9')],'priority':_0x293e47[_0xdb56('0x15')]+_0x31f386[_0xdb56('0xe')]+_0x989992++,'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0]['VoiceExtensionId']});}}if(_0x1a9330[_0xdb56('0x18')](_0xdb56('0x1b'))){if(_0x1a9330[_0xdb56('0x1b')]){_0x1b9a7d[_0xdb56('0x1c')]({'type':_0x1a9330[_0xdb56('0x10')],'app':'Set','appdata':_0xdb56('0x1d')+_0x1a9330[_0xdb56('0x1b')],'context':_0x1a9330[_0xdb56('0x11')],'exten':_0x1a9330[_0xdb56('0x9')],'priority':_0x293e47[_0xdb56('0x15')]+_0x31f386[_0xdb56('0xe')]+_0x989992++,'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x14')]});}}if(_0x1a9330[_0xdb56('0x18')](_0xdb56('0xc'))){if(_0x220acf['indexOf'](_0x1a9330[_0xdb56('0x1e')][_0xdb56('0x1f')]())>=0x0&&_0x1a9330['appType']!==_0xdb56('0x20')){if(!_0x31f386[_0xdb56('0xc')]&&_0x1a9330[_0xdb56('0xc')]){_0x31f386['answer']=!![];_0x1b9a7d['push']({'type':_0x1a9330[_0xdb56('0x10')],'app':'Answer','context':_0x1a9330['context'],'exten':_0x1a9330[_0xdb56('0x9')],'priority':_0x293e47[_0xdb56('0x15')]+_0x31f386[_0xdb56('0xe')]+_0x989992++,'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x14')]});}if(!_0x31f386['answer']&&!_0x31f386[_0xdb56('0xd')]&&!_0x1a9330[_0xdb56('0xc')]){_0x31f386[_0xdb56('0xd')]=!![];_0x1b9a7d[_0xdb56('0x1c')]({'type':_0x1a9330[_0xdb56('0x10')],'app':_0xdb56('0x21'),'context':_0x1a9330['context'],'exten':_0x1a9330[_0xdb56('0x9')],'priority':_0x293e47[_0xdb56('0x15')]+_0x31f386[_0xdb56('0xe')]+_0x989992++,'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0]['VoiceExtensionId']});}}}if(_0x1a9330[_0xdb56('0x18')](_0xdb56('0x22'))&&_0x1a9330[_0xdb56('0x18')]('recordingFormat')){if(_0x1a9330[_0xdb56('0x22')]){_0x1b9a7d[_0xdb56('0x1c')]({'type':_0x1a9330['type'],'app':_0xdb56('0x23'),'appdata':_0xdb56('0x24')+_0x1a9330[_0xdb56('0x25')]+',ab','context':_0x1a9330['context'],'exten':_0x1a9330[_0xdb56('0x9')],'priority':_0x293e47[_0xdb56('0x15')]+_0x31f386['priority']+_0x989992++,'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0]['VoiceExtensionId']});}}if(_0x1a9330[_0xdb56('0x18')](_0xdb56('0x22'))&&_0x1a9330[_0xdb56('0x18')](_0xdb56('0x25'))){if(_0x1a9330[_0xdb56('0x22')]){_0x1d79c8[_0xdb56('0x1c')]({'type':_0x1a9330[_0xdb56('0x10')],'app':_0xdb56('0x26'),'appdata':null,'context':_0x1a9330[_0xdb56('0x11')],'exten':_0x1a9330[_0xdb56('0x9')],'priority':_0x293e47[_0xdb56('0x15')]+_0x31f386['priority']+_0x989992++ +0x1,'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x14')]});}}for(var _0x2017ee=0x0;_0x2017ee<_0x293e47[_0xdb56('0x15')];_0x2017ee+=0x1){var _0x494195=_0x31f386[_0xdb56('0xe')]+_0x293e47[_0xdb56('0x15')];var _0x20be00=_0x2017ee===_0x293e47[_0xdb56('0x15')]-0x1?_0x31f386[_0xdb56('0xe')]+_0x1b9a7d[_0xdb56('0x15')]+_0x1d79c8[_0xdb56('0x15')]+0x2:_0x31f386['priority']+_0x2017ee+0x1;_0x1b9a7d[_0xdb56('0x27')](_0x2017ee,0x0,{'type':_0x1a9330[_0xdb56('0x10')],'app':'GotoIfTime','appdata':_0x293e47[_0x2017ee]+'?'+_0x1a9330[_0xdb56('0x11')]+',${EXTEN},'+_0x494195+':'+_0x1a9330['context']+',${EXTEN},'+_0x20be00,'exten':_0x1a9330['exten'],'context':_0x1a9330[_0xdb56('0x11')],'priority':_0x31f386[_0xdb56('0xe')]+_0x2017ee,'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x14')]});}_0x1a9330[_0xdb56('0xe')]=_0x1b9a7d['length']?_[_0xdb56('0x28')](_0x1b9a7d)[_0xdb56('0xe')]+0x1:_0x31f386['priority'];_0x31f386['priority']=(_0x1d79c8[_0xdb56('0x15')]?_['last'](_0x1d79c8)[_0xdb56('0xe')]:_0x1a9330[_0xdb56('0xe')])+0x1;_0x31f386[_0xdb56('0xf')]=_[_0xdb56('0x29')](_0x31f386[_0xdb56('0xf')],_0x1b9a7d,[_0x1a9330],_0x1d79c8);}_0x31f386['extensions']['push']({'type':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x10')],'app':_0xdb56('0x2a'),'exten':_0x2a23fa[_0x17f8d1][0x0]['exten'],'context':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x11')],'priority':_0x31f386[_0xdb56('0xe')],'VoiceExtensionId':_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x14')]});_0x2020be[_0xdb56('0x1c')](_0x2a23fa[_0x17f8d1][0x0][_0xdb56('0x14')]);_0x45269b=_[_0xdb56('0x29')](_0x45269b,_0x31f386[_0xdb56('0xf')]);}}return _0x54c436[_0xdb56('0x2b')](function(_0x52720a){return _0x54c436[_0xdb56('0x4')][_0xdb56('0x5')][_0xdb56('0x2c')]({'where':{'VoiceExtensionId':{'$in':_0x2020be}},'transaction':_0x52720a})['then'](function(_0x5ebfd9){return _0x54c436[_0xdb56('0x4')][_0xdb56('0x5')]['bulkCreate'](_[_0xdb56('0x2d')](_0x45269b,_0xdb56('0xe')),{'transaction':_0x52720a});});});})['catch'](function(_0x2dfe84){console[_0xdb56('0x2e')](_0x2dfe84);});}exports[_0xdb56('0x2f')]=rewrite;
\ No newline at end of file
index 2a5a534..70825ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36b2=['\x20=\x20?','createdAt','select','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','stringify','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','split','Missing\x20ListId\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','updatedAt','field','NOW()','ContactId','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0x2a2397,_0x32b017){var _0x1408f8=function(_0x132cb7){while(--_0x132cb7){_0x2a2397['push'](_0x2a2397['shift']());}};_0x1408f8(++_0x32b017);}(_0x36b2,0x18a));var _0x236b=function(_0x4e2e6e,_0x2890de){_0x4e2e6e=_0x4e2e6e-0x0;var _0x2f333e=_0x36b2[_0x4e2e6e];return _0x2f333e;};'use strict';var BPromise=require(_0x236b('0x0'));var util=require(_0x236b('0x1'));var _=require(_0x236b('0x2'));var fs=require('fs');var squel=require(_0x236b('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x236b('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x236b('0x5'))(_0x236b('0x6'));config[_0x236b('0x7')]=_[_0x236b('0x8')](config[_0x236b('0x7')],{'host':_0x236b('0x9'),'port':0x18eb});var socket=require(_0x236b('0xa'))(new Redis(config['redis']));require(_0x236b('0xb'))['register'](socket);try{if(!process[_0x236b('0xc')][0x2]||process['argv'][0x2]===_0x236b('0xd')||process[_0x236b('0xc')][0x2]==='null'){throw new Error(_0x236b('0xe'));}var FILEPATH=process[_0x236b('0xc')][0x2];if(!process[_0x236b('0xc')][0x3]||process[_0x236b('0xc')][0x3]===_0x236b('0xd')||process['argv'][0x3]===_0x236b('0xf')||!process[_0x236b('0xc')][0x4]||process[_0x236b('0xc')][0x4]===_0x236b('0xd')||process[_0x236b('0xc')][0x4]===_0x236b('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process[_0x236b('0xc')][0x3]['split'](','),process[_0x236b('0xc')][0x4][_0x236b('0x10')](','));if(!process['argv'][0x5]||process[_0x236b('0xc')][0x5]==='undefined'||process[_0x236b('0xc')][0x5]===_0x236b('0xf')){throw new Error(_0x236b('0x11'));}var LISTID=process[_0x236b('0xc')][0x5];var COMPANYID=process[_0x236b('0xc')][0x6]&&process[_0x236b('0xc')][0x6]!==_0x236b('0xd')&&process['argv'][0x6]!==_0x236b('0xf')?process[_0x236b('0xc')][0x6]:null;var DUPLICATES=process[_0x236b('0xc')][0x7]&&process[_0x236b('0xc')][0x7]!=='undefined'&&process[_0x236b('0xc')][0x7]!==_0x236b('0xf')?process[_0x236b('0xc')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x236b('0xd')||process[_0x236b('0xc')][0x8]===_0x236b('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x3a9648){logger[_0x236b('0x12')](_0x3a9648);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x155f9e,_0x25f419,_0x975acb,_0x3046bb){var _0x47c761={'message':_0x25f419};_0x47c761[_0x155f9e]=!![];if(_0x975acb){_0x47c761[_0x236b('0x13')]=_0x975acb;}if(_0x3046bb){_0x47c761[_0x236b('0x14')]=_0x3046bb;}return _0x47c761;}function isEmail(_0x57a006){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x236b('0x15')](_0x57a006);}function checkRow(_0x351565,_0x2a434a,_0x425465){return new BPromise(function(_0x584162,_0x37505c){if(_['isNil'](_0x351565)){return _0x37505c(handleCheckRowError(_0x236b('0x12'),_0x236b('0x16'),null,_0x425465));}if(_0x351565[_0x236b('0x17')]&&_0x351565[_0x236b('0x17')][_0x236b('0x18')]){var _0x49035e=_[_0x236b('0x19')](_0x351565['errors'],'message')['join'](';');return _0x37505c(handleCheckRowError(_0x236b('0x12'),_0x49035e,null,_0x425465));}var _0x147420={};for(var _0x4d3f6e in FIELDS){if(FIELDS[_0x236b('0x1a')](_0x4d3f6e)&&FIELDS[_0x4d3f6e]){_0x147420[_0x4d3f6e]=_0x351565[_0x236b('0x1b')][0x0][FIELDS[_0x4d3f6e]]||_0x351565['data'][0x0]['\ufeff'+FIELDS[_0x4d3f6e]];}}if(!_0x147420[_0x236b('0x1c')]){return _0x37505c(handleCheckRowError(_0x236b('0x12'),_0x236b('0x1d'),null,_0x425465));}if(!_0x147420[_0x236b('0x1e')]){return _0x37505c(handleCheckRowError(_0x236b('0x12'),_0x236b('0x1f'),null,_0x425465));}if(_0x147420[_0x236b('0x20')]){var _0x549dbd=moment(_0x147420[_0x236b('0x20')],_0x236b('0x21'));if(!_0x549dbd[_0x236b('0x22')]()){return _0x37505c(handleCheckRowError(_0x236b('0x12'),_0x236b('0x23'),null,_0x425465));}}if(_0x147420[_0x236b('0x24')]){if(!isEmail(_0x147420[_0x236b('0x24')])){return _0x37505c(handleCheckRowError('error',_0x236b('0x25'),null,_0x425465));}}_0x147420[_0x236b('0x26')]=LISTID;_0x147420[_0x236b('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2a434a){var _0x8ad765={};for(var _0x4c0f16=0x0,_0x519c58=DUPLICATES[_0x236b('0x18')];_0x4c0f16<_0x519c58;_0x4c0f16+=0x1){_0x8ad765[DUPLICATES[_0x4c0f16]]=_0x147420[DUPLICATES[_0x4c0f16]];}var _0x1bb076=_[_0x236b('0x28')](_0x2a434a,_0x8ad765);if(_0x1bb076){return _0x37505c(handleCheckRowError(_0x236b('0x29'),_0x236b('0x2a'),_0x1bb076,_0x425465));}}return db[_0x236b('0x2b')][_0x236b('0x2c')](_0x147420,{'raw':!![],'hooks':![],'fields':_['keys'](_0x147420)})[_0x236b('0x2d')](function(_0x4bdf61){if(DUPLICATES&&DUPLICATES[_0x236b('0x18')]&&_0x2a434a){_0x2a434a[_0x236b('0x2e')](_[_0x236b('0x2f')](_0x147420,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4bdf61['id'];return _0x584162();})[_0x236b('0x30')](function(_0x53f68c){return _0x37505c(handleCheckRowError(_0x236b('0x12'),_0x236b('0x31')+(_0x53f68c[_0x236b('0x32')]||JSON['stringify'](_0x53f68c)),null,_0x425465));});});}function checkHopper(){function _0x596bb8(){return function(_0x38d12d){logger[_0x236b('0x12')](_0x236b('0x33'),_0x236b('0x34'),util[_0x236b('0x35')](_0x38d12d,{'showHidden':![],'depth':null}));};}var _0x1ef3a1=function(_0x11ed25,_0x3066d3){var _0x536ede=squel[_0x236b('0x36')]()[_0x236b('0x37')](_0x236b('0x38'))[_0x236b('0x39')](['phone',_0x236b('0x3a'),'ContactId',_0x236b('0x26'),_0x3066d3,'createdAt',_0x236b('0x3b')],squel['select']()[_0x236b('0x3c')](_0x236b('0x1e'),_0x236b('0x1e'))[_0x236b('0x3c')](_0x236b('0x3d'),_0x236b('0x3a'))[_0x236b('0x3c')]('id',_0x236b('0x3e'))[_0x236b('0x3c')](LISTID[_0x236b('0x3f')](),'ListId')['field'](_0x11ed25['id'][_0x236b('0x3f')](),_0x3066d3)[_0x236b('0x3c')](_0x236b('0x3d'),'createdAt')['field']('NOW()',_0x236b('0x3b'))[_0x236b('0x40')](_0x236b('0x41'))[_0x236b('0x42')]('deletedAt\x20IS\x20NULL')[_0x236b('0x42')](_0x236b('0x43'),LISTID['toString']())['where'](_0x236b('0x44'))[_0x236b('0x42')](_0x236b('0x45'),squel['select']()[_0x236b('0x3c')](_0x236b('0x1e'))[_0x236b('0x40')](_0x236b('0x38'))['where'](_0x3066d3+_0x236b('0x46'),_0x11ed25['id'][_0x236b('0x3f')]())))[_0x236b('0x3f')]();return _0x536ede;};var _0x4e7e6b=function(_0x1bc8f3,_0x530e9b){var _0xd94256=squel['insert']()['into'](_0x236b('0x38'))['fromQuery']([_0x236b('0x1e'),_0x236b('0x3a'),_0x236b('0x3e'),_0x236b('0x26'),_0x530e9b,_0x236b('0x47'),_0x236b('0x3b')],squel[_0x236b('0x48')]()[_0x236b('0x3c')]('phone',_0x236b('0x1e'))[_0x236b('0x3c')](_0x236b('0x3d'),_0x236b('0x3a'))[_0x236b('0x3c')]('id',_0x236b('0x3e'))[_0x236b('0x3c')](LISTID[_0x236b('0x3f')](),'ListId')[_0x236b('0x3c')](_0x1bc8f3['id'][_0x236b('0x3f')](),_0x530e9b)['field'](_0x236b('0x3d'),_0x236b('0x47'))[_0x236b('0x3c')](_0x236b('0x3d'),_0x236b('0x3b'))[_0x236b('0x40')](_0x236b('0x41'))[_0x236b('0x42')](_0x236b('0x49'))['where'](_0x236b('0x43'),LISTID['toString']())['where'](_0x236b('0x4a'),squel[_0x236b('0x4b')](hopperContacts))[_0x236b('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x236b('0x42')](_0x236b('0x45'),squel['select']()['field'](_0x236b('0x4c'))['from'](_0x236b('0x4d'))[_0x236b('0x42')](_0x530e9b+_0x236b('0x46'),_0x1bc8f3['id'][_0x236b('0x3f')]()))[_0x236b('0x42')](_0x236b('0x45'),squel['select']()[_0x236b('0x3c')]('phone')[_0x236b('0x40')]('cm_hopper')[_0x236b('0x42')](_0x530e9b+_0x236b('0x46'),_0x1bc8f3['id'][_0x236b('0x3f')]())))[_0x236b('0x3f')]();return _0xd94256;};function _0x1b203a(_0x2354ea,_0x445f14){var _0x34cd8a=squel['insert']()['into'](_0x236b('0x38'))['fromQuery']([_0x236b('0x1e'),_0x236b('0x3a'),'ContactId',_0x236b('0x26'),_0x445f14,_0x236b('0x47'),'updatedAt'],squel['select']()[_0x236b('0x3c')](_0x236b('0x1e'),_0x236b('0x1e'))['field']('NOW()','scheduledAt')[_0x236b('0x3c')]('id',_0x236b('0x3e'))[_0x236b('0x3c')](LISTID['toString'](),_0x236b('0x26'))[_0x236b('0x3c')](_0x2354ea['id'][_0x236b('0x3f')](),_0x445f14)[_0x236b('0x3c')](_0x236b('0x3d'),_0x236b('0x47'))[_0x236b('0x3c')](_0x236b('0x3d'),_0x236b('0x3b'))[_0x236b('0x40')](_0x236b('0x41'))[_0x236b('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x236b('0x43'),LISTID[_0x236b('0x3f')]())[_0x236b('0x42')](_0x236b('0x4a'),squel[_0x236b('0x4b')](hopperContacts))[_0x236b('0x42')](_0x236b('0x44')))[_0x236b('0x3f')]();return _0x34cd8a;}function _0x50b97a(_0x66679a,_0x528cbe){var _0x414f25=squel[_0x236b('0x36')]()[_0x236b('0x37')](_0x236b('0x4e'))[_0x236b('0x39')]([_0x236b('0x1e'),_0x236b('0x3e'),_0x236b('0x26'),_0x528cbe,_0x236b('0x47'),_0x236b('0x3b')],squel[_0x236b('0x48')]()[_0x236b('0x3c')](_0x236b('0x1e'),_0x236b('0x1e'))[_0x236b('0x3c')]('id',_0x236b('0x3e'))[_0x236b('0x3c')](LISTID[_0x236b('0x3f')](),_0x236b('0x26'))[_0x236b('0x3c')](_0x66679a['id'][_0x236b('0x3f')](),_0x528cbe)[_0x236b('0x3c')]('NOW()',_0x236b('0x47'))[_0x236b('0x3c')](_0x236b('0x3d'),_0x236b('0x3b'))['from'](_0x236b('0x41'))['where'](_0x236b('0x49'))['where'](_0x236b('0x43'),LISTID[_0x236b('0x3f')]())['where'](_0x236b('0x4a'),squel[_0x236b('0x4b')](hopperContacts))[_0x236b('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x236b('0x3f')]();return _0x414f25;}return db[_0x236b('0x4f')][_0x236b('0x50')]({'where':{'type':_0x236b('0x51')},'attributes':['id',_0x236b('0x52')],'include':[{'model':db[_0x236b('0x53')],'as':_0x236b('0x54'),'where':{'id':LISTID}}]})[_0x236b('0x2d')](function(_0x4f4e89){var _0x378037=[];if(_0x4f4e89){var _0x35dd84;for(var _0x29593f=0x0,_0x4b53b0;_0x29593f<_0x4f4e89[_0x236b('0x18')];_0x29593f+=0x1){_0x4b53b0=_0x4f4e89[_0x29593f][_0x236b('0x55')]({'plain':!![]});switch(_0x4b53b0[_0x236b('0x52')]){case _0x236b('0x56'):_0x378037[_0x236b('0x2e')](db[_0x236b('0x57')][_0x236b('0x58')](_0x4e7e6b(_0x4b53b0,_0x236b('0x59')))[_0x236b('0x2d')](function(){})[_0x236b('0x30')](_0x596bb8()));break;case _0x236b('0x5a'):_0x378037[_0x236b('0x2e')](db[_0x236b('0x57')]['query'](_0x1ef3a1(_0x4b53b0,_0x236b('0x59')))[_0x236b('0x2d')](function(){})['catch'](_0x596bb8()));break;default:_0x378037['push'](db[_0x236b('0x57')]['query'](_0x1b203a(_0x4b53b0,_0x236b('0x59')))['then'](function(){})[_0x236b('0x30')](_0x596bb8()));}}}return _0x378037;})['all']()['then'](function(){return db[_0x236b('0x4f')][_0x236b('0x50')]({'where':{'type':_0x236b('0x51')},'attributes':['id'],'include':[{'model':db[_0x236b('0x53')],'as':_0x236b('0x5b'),'where':{'id':LISTID}}]})[_0x236b('0x2d')](function(_0x2c162a){var _0x3ecd0d=[];if(_0x2c162a){var _0xf98dc2;for(var _0x11bee3=0x0,_0x33da71;_0x11bee3<_0x2c162a[_0x236b('0x18')];_0x11bee3+=0x1){_0x33da71=_0x2c162a[_0x11bee3][_0x236b('0x55')]({'plain':!![]});_0x3ecd0d[_0x236b('0x2e')](db['sequelize']['query'](_0x50b97a(_0x33da71,_0x236b('0x59')))['then'](function(){})['catch'](_0x596bb8()));}}return _0x3ecd0d;})[_0x236b('0x5c')]();})[_0x236b('0x2d')](function(){return db[_0x236b('0x5d')][_0x236b('0x50')]({'attributes':['id',_0x236b('0x52')],'include':[{'model':db['CmList'],'as':_0x236b('0x54'),'where':{'id':LISTID}}]})[_0x236b('0x2d')](function(_0x397289){var _0x56ba7a=[];if(_0x397289){for(var _0x3f3e3b=0x0,_0x2d20c9;_0x3f3e3b<_0x397289['length'];_0x3f3e3b+=0x1){_0x2d20c9=_0x397289[_0x3f3e3b]['get']({'plain':!![]});switch(_0x2d20c9[_0x236b('0x52')]){case'always':_0x56ba7a[_0x236b('0x2e')](db['sequelize'][_0x236b('0x58')](_0x4e7e6b(_0x2d20c9,_0x236b('0x5e')))[_0x236b('0x2d')](function(){})[_0x236b('0x30')](_0x596bb8()));break;case _0x236b('0x5a'):_0x56ba7a[_0x236b('0x2e')](db[_0x236b('0x57')][_0x236b('0x58')](_0x1ef3a1(_0x2d20c9,_0x236b('0x5e')))['then'](function(){})[_0x236b('0x30')](_0x596bb8()));break;default:_0x56ba7a[_0x236b('0x2e')](db[_0x236b('0x57')][_0x236b('0x58')](_0x1b203a(_0x2d20c9,_0x236b('0x5e')))[_0x236b('0x2d')](function(){})[_0x236b('0x30')](_0x596bb8()));}}}return _0x56ba7a;})[_0x236b('0x5c')]();})['then'](function(){return db[_0x236b('0x5d')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x236b('0x53')],'as':_0x236b('0x5b'),'where':{'id':LISTID}}]})[_0x236b('0x2d')](function(_0x1994c7){var _0x22e859=[];if(_0x1994c7){for(var _0x234b63=0x0,_0x252331;_0x234b63<_0x1994c7[_0x236b('0x18')];_0x234b63+=0x1){_0x252331=_0x1994c7[_0x234b63][_0x236b('0x55')]({'plain':!![]});_0x22e859[_0x236b('0x2e')](db['sequelize'][_0x236b('0x58')](_0x50b97a(_0x252331,'CampaignId'))[_0x236b('0x2d')](function(){})[_0x236b('0x30')](_0x596bb8()));}}return _0x22e859;})[_0x236b('0x5c')]();})[_0x236b('0x30')](function(_0xc3a7da){logger[_0x236b('0x12')](_0x236b('0x5f'),_0x236b('0x60'),_0xc3a7da[_0x236b('0x32')]);});}var processPromises=function(_0x52e131){return BPromise['all'](promises)[_0x236b('0x2d')](function(_0x556700){})[_0x236b('0x30')](function(_0x3c4b8a){logger[_0x236b('0x12')](_0x236b('0x61'),JSON['stringify'](_0x3c4b8a));})[_0x236b('0x62')](function(){socket[_0x236b('0x63')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x52e131){return _0x52e131[_0x236b('0x64')]();}});};var endCsv=function(){return BPromise[_0x236b('0x65')]()[_0x236b('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x236b('0x2d')](function(){socket[_0x236b('0x63')](_0x236b('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x236b('0x67')](FILEPATH);}catch(_0x141381){logger['error'](_0x236b('0x68'),JSON['stringify'](_0x141381));}finally{process[_0x236b('0x69')](0x0);}});};process['on'](_0x236b('0x6a'),function(){logger[_0x236b('0x6b')](_0x236b('0x6c'));endCsv();});function main(){return BPromise[_0x236b('0x65')]()[_0x236b('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x236b('0x10')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x236b('0x2d')](function(_0x475e12){var _0x3eb4f4=fs[_0x236b('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x236b('0x6e')](_0x3eb4f4,{'header':!![],'skipEmptyLines':!![],'step':function(_0x40dc4e,_0x22be05){total+=0x1;var _0x36bcb5=total;promises[_0x236b('0x2e')](checkRow(_0x40dc4e,_0x475e12,_0x36bcb5)['then'](function(){success+=0x1;})[_0x236b('0x30')](function(_0x39e279){if(_0x39e279[_0x236b('0x12')]){errors+=0x1;delete _0x39e279[_0x236b('0x12')];}else if(_0x39e279[_0x236b('0x29')]){duplicates+=0x1;delete _0x39e279['duplicate'];}rows['push'](_0x39e279);}));if(total%0xc8===0x0){_0x22be05[_0x236b('0x6f')]();return processPromises(_0x22be05);}},'complete':function(){return processPromises()[_0x236b('0x2d')](function(){logger[_0x236b('0x6b')](_0x236b('0x70'));endCsv();});},'error':function(_0x38483b,_0x210c8a){logger[_0x236b('0x6b')](_0x236b('0x71'),JSON[_0x236b('0x72')](_0x38483b));endCsv();}});})[_0x236b('0x30')](function(_0x4078a6){logger[_0x236b('0x12')](_0x236b('0x73'),JSON[_0x236b('0x72')](_0x4078a6));});}main();
\ No newline at end of file
+var _0xec76=['updatedAt','select','field','toString','NOW()','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueue','BlackLists','VoiceQueueId','all','Campaign','onlyIfOpen','CampaignId','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','papaparse','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt'];(function(_0x325673,_0x13c10b){var _0x741c5b=function(_0x33eeb2){while(--_0x33eeb2){_0x325673['push'](_0x325673['shift']());}};_0x741c5b(++_0x13c10b);}(_0xec76,0x109));var _0x6ec7=function(_0x578366,_0x491482){_0x578366=_0x578366-0x0;var _0x2b08b9=_0xec76[_0x578366];return _0x2b08b9;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x6ec7('0x0'));var Redis=require('ioredis');var db=require(_0x6ec7('0x1'))['db'];var config=require(_0x6ec7('0x2'));var logger=require('../../../config/logger')(_0x6ec7('0x3'));config[_0x6ec7('0x4')]=_[_0x6ec7('0x5')](config[_0x6ec7('0x4')],{'host':_0x6ec7('0x6'),'port':0x18eb});var socket=require(_0x6ec7('0x7'))(new Redis(config['redis']));require(_0x6ec7('0x8'))[_0x6ec7('0x9')](socket);try{if(!process['argv'][0x2]||process[_0x6ec7('0xa')][0x2]===_0x6ec7('0xb')||process[_0x6ec7('0xa')][0x2]==='null'){throw new Error(_0x6ec7('0xc'));}var FILEPATH=process[_0x6ec7('0xa')][0x2];if(!process[_0x6ec7('0xa')][0x3]||process[_0x6ec7('0xa')][0x3]===_0x6ec7('0xb')||process['argv'][0x3]===_0x6ec7('0xd')||!process['argv'][0x4]||process[_0x6ec7('0xa')][0x4]===_0x6ec7('0xb')||process['argv'][0x4]===_0x6ec7('0xd')){throw new Error(_0x6ec7('0xe'));}var FIELDS=_[_0x6ec7('0xf')](process['argv'][0x3]['split'](','),process['argv'][0x4][_0x6ec7('0x10')](','));if(!process[_0x6ec7('0xa')][0x5]||process[_0x6ec7('0xa')][0x5]===_0x6ec7('0xb')||process['argv'][0x5]===_0x6ec7('0xd')){throw new Error(_0x6ec7('0x11'));}var LISTID=process[_0x6ec7('0xa')][0x5];var COMPANYID=process[_0x6ec7('0xa')][0x6]&&process[_0x6ec7('0xa')][0x6]!==_0x6ec7('0xb')&&process[_0x6ec7('0xa')][0x6]!==_0x6ec7('0xd')?process['argv'][0x6]:null;var DUPLICATES=process[_0x6ec7('0xa')][0x7]&&process['argv'][0x7]!==_0x6ec7('0xb')&&process[_0x6ec7('0xa')][0x7]!==_0x6ec7('0xd')?process[_0x6ec7('0xa')][0x7]:null;if(!process[_0x6ec7('0xa')][0x8]||process['argv'][0x8]===_0x6ec7('0xb')||process[_0x6ec7('0xa')][0x8]===_0x6ec7('0xd')){throw new Error(_0x6ec7('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x410f66){logger[_0x6ec7('0x13')](_0x410f66);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x1c8f6a,_0x2fe506,_0x282e84,_0x5ccfe4){var _0x48c9e0={'message':_0x2fe506};_0x48c9e0[_0x1c8f6a]=!![];if(_0x282e84){_0x48c9e0[_0x6ec7('0x14')]=_0x282e84;}if(_0x5ccfe4){_0x48c9e0[_0x6ec7('0x15')]=_0x5ccfe4;}return _0x48c9e0;}function isEmail(_0x503a97){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x6ec7('0x16')](_0x503a97);}function checkRow(_0x2fed2c,_0x1e3df3,_0x4f9d02){return new BPromise(function(_0x45436a,_0x1bfcad){if(_[_0x6ec7('0x17')](_0x2fed2c)){return _0x1bfcad(handleCheckRowError(_0x6ec7('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4f9d02));}if(_0x2fed2c[_0x6ec7('0x18')]&&_0x2fed2c[_0x6ec7('0x18')][_0x6ec7('0x19')]){var _0x29ec1b=_[_0x6ec7('0x1a')](_0x2fed2c[_0x6ec7('0x18')],_0x6ec7('0x1b'))[_0x6ec7('0x1c')](';');return _0x1bfcad(handleCheckRowError(_0x6ec7('0x13'),_0x29ec1b,null,_0x4f9d02));}var _0x357c78={};for(var _0x2e8722 in FIELDS){if(FIELDS[_0x6ec7('0x1d')](_0x2e8722)&&FIELDS[_0x2e8722]){_0x357c78[_0x2e8722]=_0x2fed2c['data'][0x0][FIELDS[_0x2e8722]]||_0x2fed2c[_0x6ec7('0x1e')][0x0]['\ufeff'+FIELDS[_0x2e8722]];}}if(!_0x357c78[_0x6ec7('0x1f')]){return _0x1bfcad(handleCheckRowError(_0x6ec7('0x13'),_0x6ec7('0x20'),null,_0x4f9d02));}if(!_0x357c78[_0x6ec7('0x21')]){return _0x1bfcad(handleCheckRowError(_0x6ec7('0x13'),_0x6ec7('0x22'),null,_0x4f9d02));}if(_0x357c78[_0x6ec7('0x23')]){var _0x39fbdb=moment(_0x357c78[_0x6ec7('0x23')],_0x6ec7('0x24'));if(!_0x39fbdb[_0x6ec7('0x25')]()){return _0x1bfcad(handleCheckRowError(_0x6ec7('0x13'),_0x6ec7('0x26'),null,_0x4f9d02));}}if(_0x357c78[_0x6ec7('0x27')]){if(!isEmail(_0x357c78[_0x6ec7('0x27')])){return _0x1bfcad(handleCheckRowError(_0x6ec7('0x13'),_0x6ec7('0x28'),null,_0x4f9d02));}}_0x357c78[_0x6ec7('0x29')]=LISTID;_0x357c78[_0x6ec7('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6ec7('0x19')]&&_0x1e3df3){var _0x454d4e={};for(var _0x5458ef=0x0,_0x1e71fc=DUPLICATES[_0x6ec7('0x19')];_0x5458ef<_0x1e71fc;_0x5458ef+=0x1){_0x454d4e[DUPLICATES[_0x5458ef]]=_0x357c78[DUPLICATES[_0x5458ef]];}var _0x2165a6=_['find'](_0x1e3df3,_0x454d4e);if(_0x2165a6){return _0x1bfcad(handleCheckRowError(_0x6ec7('0x2b'),_0x6ec7('0x2c'),_0x2165a6,_0x4f9d02));}}return db[_0x6ec7('0x2d')][_0x6ec7('0x2e')](_0x357c78,{'raw':!![],'hooks':![],'fields':_['keys'](_0x357c78)})[_0x6ec7('0x2f')](function(_0x3868eb){if(DUPLICATES&&DUPLICATES[_0x6ec7('0x19')]&&_0x1e3df3){_0x1e3df3[_0x6ec7('0x30')](_[_0x6ec7('0x31')](_0x357c78,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3868eb['id'];return _0x45436a();})[_0x6ec7('0x32')](function(_0x4f099f){return _0x1bfcad(handleCheckRowError(_0x6ec7('0x13'),_0x6ec7('0x33')+(_0x4f099f[_0x6ec7('0x1b')]||JSON[_0x6ec7('0x34')](_0x4f099f)),null,_0x4f9d02));});});}function checkHopper(){function _0x29f4bf(){return function(_0x2f2b3c){logger['error']('cmContact',_0x6ec7('0x35'),util[_0x6ec7('0x36')](_0x2f2b3c,{'showHidden':![],'depth':null}));};}var _0x306d55=function(_0x11d090,_0x533f24){var _0x105ca6=squel[_0x6ec7('0x37')]()[_0x6ec7('0x38')](_0x6ec7('0x39'))[_0x6ec7('0x3a')]([_0x6ec7('0x21'),_0x6ec7('0x3b'),_0x6ec7('0x3c'),_0x6ec7('0x29'),_0x533f24,_0x6ec7('0x3d'),_0x6ec7('0x3e')],squel[_0x6ec7('0x3f')]()[_0x6ec7('0x40')](_0x6ec7('0x21'),_0x6ec7('0x21'))[_0x6ec7('0x40')]('NOW()','scheduledAt')[_0x6ec7('0x40')]('id',_0x6ec7('0x3c'))[_0x6ec7('0x40')](LISTID['toString'](),_0x6ec7('0x29'))[_0x6ec7('0x40')](_0x11d090['id'][_0x6ec7('0x41')](),_0x533f24)['field'](_0x6ec7('0x42'),'createdAt')[_0x6ec7('0x40')](_0x6ec7('0x42'),_0x6ec7('0x3e'))['from'](_0x6ec7('0x43'))[_0x6ec7('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x6ec7('0x45'),LISTID['toString']())[_0x6ec7('0x44')](_0x6ec7('0x46'))[_0x6ec7('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6ec7('0x40')](_0x6ec7('0x21'))['from']('cm_hopper')[_0x6ec7('0x44')](_0x533f24+'\x20=\x20?',_0x11d090['id'][_0x6ec7('0x41')]())))[_0x6ec7('0x41')]();return _0x105ca6;};var _0xa35ff4=function(_0x275b9d,_0x2eb05e){var _0xa3c5b0=squel[_0x6ec7('0x37')]()[_0x6ec7('0x38')](_0x6ec7('0x39'))['fromQuery']([_0x6ec7('0x21'),_0x6ec7('0x3b'),'ContactId',_0x6ec7('0x29'),_0x2eb05e,_0x6ec7('0x3d'),_0x6ec7('0x3e')],squel[_0x6ec7('0x3f')]()[_0x6ec7('0x40')](_0x6ec7('0x21'),_0x6ec7('0x21'))[_0x6ec7('0x40')]('NOW()','scheduledAt')[_0x6ec7('0x40')]('id',_0x6ec7('0x3c'))[_0x6ec7('0x40')](LISTID[_0x6ec7('0x41')](),_0x6ec7('0x29'))[_0x6ec7('0x40')](_0x275b9d['id'][_0x6ec7('0x41')](),_0x2eb05e)[_0x6ec7('0x40')](_0x6ec7('0x42'),'createdAt')['field']('NOW()',_0x6ec7('0x3e'))[_0x6ec7('0x47')](_0x6ec7('0x43'))[_0x6ec7('0x44')](_0x6ec7('0x48'))[_0x6ec7('0x44')](_0x6ec7('0x45'),LISTID[_0x6ec7('0x41')]())[_0x6ec7('0x44')](_0x6ec7('0x49'),squel[_0x6ec7('0x4a')](hopperContacts))[_0x6ec7('0x44')](_0x6ec7('0x46'))[_0x6ec7('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6ec7('0x3f')]()[_0x6ec7('0x40')]('calleridnum')[_0x6ec7('0x47')](_0x6ec7('0x4b'))['where'](_0x2eb05e+_0x6ec7('0x4c'),_0x275b9d['id']['toString']()))['where'](_0x6ec7('0x4d'),squel[_0x6ec7('0x3f')]()['field'](_0x6ec7('0x21'))[_0x6ec7('0x47')]('cm_hopper')[_0x6ec7('0x44')](_0x2eb05e+'\x20=\x20?',_0x275b9d['id']['toString']())))[_0x6ec7('0x41')]();return _0xa3c5b0;};function _0x2217e1(_0x3fff5,_0x341be8){var _0x387aaa=squel[_0x6ec7('0x37')]()[_0x6ec7('0x38')](_0x6ec7('0x39'))[_0x6ec7('0x3a')]([_0x6ec7('0x21'),_0x6ec7('0x3b'),_0x6ec7('0x3c'),_0x6ec7('0x29'),_0x341be8,'createdAt','updatedAt'],squel['select']()[_0x6ec7('0x40')](_0x6ec7('0x21'),'phone')[_0x6ec7('0x40')](_0x6ec7('0x42'),'scheduledAt')['field']('id',_0x6ec7('0x3c'))['field'](LISTID[_0x6ec7('0x41')](),_0x6ec7('0x29'))[_0x6ec7('0x40')](_0x3fff5['id'][_0x6ec7('0x41')](),_0x341be8)[_0x6ec7('0x40')](_0x6ec7('0x42'),_0x6ec7('0x3d'))[_0x6ec7('0x40')]('NOW()',_0x6ec7('0x3e'))[_0x6ec7('0x47')](_0x6ec7('0x43'))[_0x6ec7('0x44')](_0x6ec7('0x48'))[_0x6ec7('0x44')](_0x6ec7('0x45'),LISTID[_0x6ec7('0x41')]())[_0x6ec7('0x44')](_0x6ec7('0x49'),squel[_0x6ec7('0x4a')](hopperContacts))[_0x6ec7('0x44')](_0x6ec7('0x46')))[_0x6ec7('0x41')]();return _0x387aaa;}function _0x2f6646(_0x53e743,_0x17e0da){var _0x3c5f29=squel[_0x6ec7('0x37')]()[_0x6ec7('0x38')](_0x6ec7('0x4e'))[_0x6ec7('0x3a')](['phone',_0x6ec7('0x3c'),_0x6ec7('0x29'),_0x17e0da,_0x6ec7('0x3d'),_0x6ec7('0x3e')],squel[_0x6ec7('0x3f')]()[_0x6ec7('0x40')](_0x6ec7('0x21'),_0x6ec7('0x21'))[_0x6ec7('0x40')]('id',_0x6ec7('0x3c'))['field'](LISTID['toString'](),_0x6ec7('0x29'))['field'](_0x53e743['id'][_0x6ec7('0x41')](),_0x17e0da)[_0x6ec7('0x40')]('NOW()','createdAt')[_0x6ec7('0x40')]('NOW()',_0x6ec7('0x3e'))[_0x6ec7('0x47')]('cm_contacts')[_0x6ec7('0x44')](_0x6ec7('0x48'))[_0x6ec7('0x44')](_0x6ec7('0x45'),LISTID[_0x6ec7('0x41')]())['where'](_0x6ec7('0x49'),squel[_0x6ec7('0x4a')](hopperContacts))[_0x6ec7('0x44')](_0x6ec7('0x46')))['toString']();return _0x3c5f29;}return db['VoiceQueue'][_0x6ec7('0x4f')]({'where':{'type':_0x6ec7('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6ec7('0x51')],'as':_0x6ec7('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x299b72){var _0x185c60=[];if(_0x299b72){var _0x140af9;for(var _0x142491=0x0,_0x401e55;_0x142491<_0x299b72[_0x6ec7('0x19')];_0x142491+=0x1){_0x401e55=_0x299b72[_0x142491][_0x6ec7('0x53')]({'plain':!![]});switch(_0x401e55[_0x6ec7('0x54')]){case _0x6ec7('0x55'):_0x185c60['push'](db[_0x6ec7('0x56')][_0x6ec7('0x57')](_0xa35ff4(_0x401e55,'VoiceQueueId'))[_0x6ec7('0x2f')](function(){})[_0x6ec7('0x32')](_0x29f4bf()));break;case'onlyIfOpen':_0x185c60[_0x6ec7('0x30')](db[_0x6ec7('0x56')]['query'](_0x306d55(_0x401e55,'VoiceQueueId'))['then'](function(){})[_0x6ec7('0x32')](_0x29f4bf()));break;default:_0x185c60['push'](db[_0x6ec7('0x56')][_0x6ec7('0x57')](_0x2217e1(_0x401e55,'VoiceQueueId'))['then'](function(){})[_0x6ec7('0x32')](_0x29f4bf()));}}}return _0x185c60;})['all']()['then'](function(){return db[_0x6ec7('0x58')][_0x6ec7('0x4f')]({'where':{'type':_0x6ec7('0x50')},'attributes':['id'],'include':[{'model':db[_0x6ec7('0x51')],'as':_0x6ec7('0x59'),'where':{'id':LISTID}}]})[_0x6ec7('0x2f')](function(_0x37b56e){var _0x44dc07=[];if(_0x37b56e){var _0x56a935;for(var _0x28e0c1=0x0,_0x584617;_0x28e0c1<_0x37b56e[_0x6ec7('0x19')];_0x28e0c1+=0x1){_0x584617=_0x37b56e[_0x28e0c1]['get']({'plain':!![]});_0x44dc07[_0x6ec7('0x30')](db[_0x6ec7('0x56')][_0x6ec7('0x57')](_0x2f6646(_0x584617,_0x6ec7('0x5a')))[_0x6ec7('0x2f')](function(){})[_0x6ec7('0x32')](_0x29f4bf()));}}return _0x44dc07;})[_0x6ec7('0x5b')]();})[_0x6ec7('0x2f')](function(){return db[_0x6ec7('0x5c')][_0x6ec7('0x4f')]({'attributes':['id',_0x6ec7('0x54')],'include':[{'model':db[_0x6ec7('0x51')],'as':_0x6ec7('0x52'),'where':{'id':LISTID}}]})[_0x6ec7('0x2f')](function(_0x306b79){var _0xb54492=[];if(_0x306b79){for(var _0x12f9d6=0x0,_0x4009cf;_0x12f9d6<_0x306b79[_0x6ec7('0x19')];_0x12f9d6+=0x1){_0x4009cf=_0x306b79[_0x12f9d6]['get']({'plain':!![]});switch(_0x4009cf[_0x6ec7('0x54')]){case'always':_0xb54492[_0x6ec7('0x30')](db[_0x6ec7('0x56')][_0x6ec7('0x57')](_0xa35ff4(_0x4009cf,'CampaignId'))['then'](function(){})[_0x6ec7('0x32')](_0x29f4bf()));break;case _0x6ec7('0x5d'):_0xb54492[_0x6ec7('0x30')](db[_0x6ec7('0x56')]['query'](_0x306d55(_0x4009cf,_0x6ec7('0x5e')))[_0x6ec7('0x2f')](function(){})[_0x6ec7('0x32')](_0x29f4bf()));break;default:_0xb54492[_0x6ec7('0x30')](db[_0x6ec7('0x56')]['query'](_0x2217e1(_0x4009cf,_0x6ec7('0x5e')))[_0x6ec7('0x2f')](function(){})['catch'](_0x29f4bf()));}}}return _0xb54492;})[_0x6ec7('0x5b')]();})[_0x6ec7('0x2f')](function(){return db['Campaign'][_0x6ec7('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x6ec7('0x51')],'as':_0x6ec7('0x59'),'where':{'id':LISTID}}]})[_0x6ec7('0x2f')](function(_0x197101){var _0x47784c=[];if(_0x197101){for(var _0xe2e5cc=0x0,_0x480aaa;_0xe2e5cc<_0x197101[_0x6ec7('0x19')];_0xe2e5cc+=0x1){_0x480aaa=_0x197101[_0xe2e5cc][_0x6ec7('0x53')]({'plain':!![]});_0x47784c[_0x6ec7('0x30')](db[_0x6ec7('0x56')][_0x6ec7('0x57')](_0x2f6646(_0x480aaa,_0x6ec7('0x5e')))[_0x6ec7('0x2f')](function(){})[_0x6ec7('0x32')](_0x29f4bf()));}}return _0x47784c;})[_0x6ec7('0x5b')]();})[_0x6ec7('0x32')](function(_0xb080f8){logger[_0x6ec7('0x13')]('cmContact,\x20%s,\x20%s',_0x6ec7('0x5f'),_0xb080f8['message']);});}var processPromises=function(_0x49c190){return BPromise[_0x6ec7('0x5b')](promises)[_0x6ec7('0x2f')](function(_0x420573){})[_0x6ec7('0x32')](function(_0x529985){logger[_0x6ec7('0x13')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x529985));})[_0x6ec7('0x60')](function(){socket[_0x6ec7('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x49c190){return _0x49c190[_0x6ec7('0x62')]();}});};var endCsv=function(){return BPromise[_0x6ec7('0x63')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x6ec7('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6ec7('0x65')](FILEPATH);}catch(_0x31fa36){logger[_0x6ec7('0x13')](_0x6ec7('0x66'),JSON[_0x6ec7('0x34')](_0x31fa36));}finally{process[_0x6ec7('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x6ec7('0x68')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x6ec7('0x63')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6ec7('0x10')](',');return db[_0x6ec7('0x2d')][_0x6ec7('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6ec7('0x2f')](function(_0x37a213){var _0x8dcd5a=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x8dcd5a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x323bd4,_0x594af1){total+=0x1;var _0x4d9ca3=total;promises['push'](checkRow(_0x323bd4,_0x37a213,_0x4d9ca3)[_0x6ec7('0x2f')](function(){success+=0x1;})[_0x6ec7('0x32')](function(_0x1129ba){if(_0x1129ba[_0x6ec7('0x13')]){errors+=0x1;delete _0x1129ba[_0x6ec7('0x13')];}else if(_0x1129ba[_0x6ec7('0x2b')]){duplicates+=0x1;delete _0x1129ba[_0x6ec7('0x2b')];}rows[_0x6ec7('0x30')](_0x1129ba);}));if(total%0xc8===0x0){_0x594af1[_0x6ec7('0x69')]();return processPromises(_0x594af1);}},'complete':function(){return processPromises()['then'](function(){logger[_0x6ec7('0x68')](_0x6ec7('0x6a'));endCsv();});},'error':function(_0x132bc5,_0xdaa9a2){logger['info'](_0x6ec7('0x6b'),JSON[_0x6ec7('0x34')](_0x132bc5));endCsv();}});})[_0x6ec7('0x32')](function(_0x2ca053){logger['error'](_0x6ec7('0x6c'),JSON[_0x6ec7('0x34')](_0x2ca053));});}main();
\ No newline at end of file
index 3db85a2..e4f88cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc56=['../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','createdAt','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','toString','keys','CompanyId','updatedAt',')\x20NOT\x20IN\x20?','id\x20IN\x20?','field','info','Received\x20SIGINT','error','message','exit','errors','push','code','query','spread','stringify','send','start','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','firstName','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','emit','unlink','complete','arguments\x20<filename>\x20<parameters>\x20<agents>','root','argv','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb'];(function(_0x4a4ffc,_0x4c2ffa){var _0x282301=function(_0x3196e3){while(--_0x3196e3){_0x4a4ffc['push'](_0x4a4ffc['shift']());}};_0x282301(++_0x4c2ffa);}(_0xbc56,0x17c));var _0x6bc5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbc56[_0x14add3];return _0x4a174f;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x6bc5('0x0'));var util=require(_0x6bc5('0x1'));var BPromise=require(_0x6bc5('0x2'));var moment=require(_0x6bc5('0x3'));var squel=require(_0x6bc5('0x4'));var Redis=require(_0x6bc5('0x5'));var db=require(_0x6bc5('0x6'))['db'];var config=require(_0x6bc5('0x7'));var logger=require(_0x6bc5('0x8'))(_0x6bc5('0x9'));config[_0x6bc5('0xa')]=_[_0x6bc5('0xb')](config[_0x6bc5('0xa')],{'host':_0x6bc5('0xc'),'port':0x18eb});var socket=require(_0x6bc5('0xd'))(new Redis(config[_0x6bc5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x6bc5('0xe')](_0x6bc5('0xf'));function isEmail(_0x42fbac){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x42fbac);}function selectNotIn(_0x5c1a9e,_0x201057,_0x566b8,_0x242a65,_0x1a9deb){return squel['select']()['field'](_0x6bc5('0x10'))[_0x6bc5('0x11')](_0x242a65)[_0x6bc5('0x12')](_0x201057,null,_0x201057+_0x6bc5('0x13')+_0x242a65+'.'+_0x566b8)['where'](_0x242a65+'.'+_0x566b8+_0x6bc5('0x14')+_0x5c1a9e+'.'+_0x566b8)[_0x6bc5('0x15')](_0x201057+_0x6bc5('0x16')+_0x1a9deb[_0x6bc5('0x12')]()+')');}function insertCmHopper(_0x54b6d0,_0x21bfda,_0x2b9ba8,_0x36905c,_0x5e0c6c){var _0x5c64d5=[_0x6bc5('0x17'),_0x6bc5('0x18'),_0x6bc5('0x19'),'cm_contacts.ListId',_0x21bfda+'.'+_0x36905c,_0x6bc5('0x1a'),'cm_contacts.updatedAt',_0x6bc5('0x1b'),_0x6bc5('0x1c'),'\x22'+_0x5e0c6c+'\x22'];return squel[_0x6bc5('0x1d')]()[_0x6bc5('0x1e')](_0x6bc5('0x1f'))[_0x6bc5('0x20')]([_0x6bc5('0x10'),_0x6bc5('0x21'),_0x6bc5('0x22'),_0x6bc5('0x23'),_0x36905c,'createdAt','updatedAt','priority','UserId',_0x6bc5('0x24')],squel[_0x6bc5('0x25')]()[_0x6bc5('0x26')](_0x5c64d5)[_0x6bc5('0x11')](_0x21bfda)['join'](_0x6bc5('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x21bfda+_0x6bc5('0x28'))['join'](_0x2b9ba8,null,_0x2b9ba8+_0x6bc5('0x13')+_0x21bfda+'.'+_0x36905c)['where'](_0x21bfda+_0x6bc5('0x29'),_0x54b6d0)[_0x6bc5('0x15')](_0x6bc5('0x2a'),NOW)['where'](_0x6bc5('0x2b'),selectNotIn(_0x21bfda,_0x2b9ba8,_0x36905c,_0x6bc5('0x1f'),[_0x6bc5('0x2c'),'\x22onlyIfOpen\x22']))[_0x6bc5('0x15')](_0x6bc5('0x2b'),selectNotIn(_0x21bfda,_0x2b9ba8,_0x36905c,_0x6bc5('0x1f'),[_0x6bc5('0x2c')])))['toString']();}function insertCmHopperBlack(_0x5eb71f,_0x15e2f2,_0x369f55,_0xdc28cd){var _0x4d38a2=['cm_contacts.phone','cm_contacts.id',_0x6bc5('0x2d'),_0x15e2f2+'.'+_0xdc28cd,_0x6bc5('0x1a'),_0x6bc5('0x2e')];return squel[_0x6bc5('0x1d')]()['into'](_0x6bc5('0x2f'))[_0x6bc5('0x20')]([_0x6bc5('0x10'),'ContactId',_0x6bc5('0x23'),_0xdc28cd,_0x6bc5('0x30'),'updatedAt'],squel['select']()['fields'](_0x4d38a2)['from'](_0x15e2f2)[_0x6bc5('0x12')](_0x6bc5('0x27'),null,_0x6bc5('0x31')+_0x15e2f2+_0x6bc5('0x28'))[_0x6bc5('0x12')](_0x369f55,null,_0x369f55+_0x6bc5('0x13')+_0x15e2f2+'.'+_0xdc28cd)[_0x6bc5('0x15')](_0x15e2f2+'.CmListId\x20=\x20?',_0x5eb71f)[_0x6bc5('0x15')](_0x6bc5('0x2a'),NOW)['where'](_0x6bc5('0x2b'),squel['select']()['field'](_0x6bc5('0x10'))[_0x6bc5('0x11')](_0x6bc5('0x2f'))['where'](_0x6bc5('0x32'),_0x5eb71f)[_0x6bc5('0x15')](_0xdc28cd+'\x20=\x20?',_0x15e2f2+'.'+_0xdc28cd)))[_0x6bc5('0x33')]();}function insertCmContact(_0x55da0c,_0x25f7ca,_0x143562,_0x543b67){var _0x2c25e4=_['concat'](_[_0x6bc5('0x34')](_0x543b67),[_0x6bc5('0x23'),_0x6bc5('0x35'),_0x6bc5('0x30'),_0x6bc5('0x36')]);return squel[_0x6bc5('0x1d')]()[_0x6bc5('0x1e')](_0x6bc5('0x27'))[_0x6bc5('0x20')](_0x2c25e4,squel[_0x6bc5('0x25')]()[_0x6bc5('0x26')](_0x2c25e4)[_0x6bc5('0x11')](_0x25f7ca)[_0x6bc5('0x15')]('('+_0x143562[_0x6bc5('0x12')](',')+_0x6bc5('0x37'),squel[_0x6bc5('0x25')]()[_0x6bc5('0x26')](_0x143562)[_0x6bc5('0x11')](_0x6bc5('0x27'))[_0x6bc5('0x15')]('ListId\x20=\x20?',_0x55da0c))[_0x6bc5('0x15')](_0x6bc5('0x38'),squel[_0x6bc5('0x25')]()[_0x6bc5('0x39')]('MIN(id)','min_id')[_0x6bc5('0x11')](_0x25f7ca)['group'](_0x143562[_0x6bc5('0x12')](','))))[_0x6bc5('0x33')]();}function handleStop(){logger[_0x6bc5('0x3a')](_0x6bc5('0x3b'));stopped=!![];}function handleUncaughtException(_0xcc6ff4){logger[_0x6bc5('0x3c')](_0xcc6ff4[_0x6bc5('0x3d')]);process[_0x6bc5('0x3e')](0x1);}function handleError(_0x2060ff,_0x27240d){stats[_0x6bc5('0x3f')][_0x6bc5('0x40')]({'name':_0x27240d[_0x6bc5('0x41')],'message':_0x27240d['message'],'row':_0x2060ff});}function handleQuery(_0x2a25bb){logger[_0x6bc5('0x3a')](_0x2a25bb);return db['sequelize'][_0x6bc5('0x42')](_0x2a25bb)[_0x6bc5('0x43')](function(_0x22910b){results['push'](_0x22910b);})['catch'](function(_0x426d02){logger[_0x6bc5('0x3c')](_0x426d02[_0x6bc5('0x3d')]);});}function main(_0x3a1093,_0xcd2f75,_0x29891d,_0x208938){logger[_0x6bc5('0x3a')]('main',_0x3a1093,JSON[_0x6bc5('0x44')](_0xcd2f75));process[_0x6bc5('0x45')](_0x6bc5('0x46'));var _0x463886=_0xcd2f75['binding'];var _0x4ac996=_0xcd2f75[_0x6bc5('0x47')];var _0x29de7a=path[_0x6bc5('0x12')](config['root'],_0x6bc5('0x48'),_0x4ac996+_0x6bc5('0x49'));var _0x301827=_[_0x6bc5('0x34')](_0x463886)[_0x6bc5('0x12')]();logger['info'](_0x6bc5('0x4a'),_0x301827);fs[_0x6bc5('0x4b')](_0x29de7a,_0x301827+'\x0a');Papa[_0x6bc5('0x4c')](fs[_0x6bc5('0x4d')](_0x3a1093),{'header':!![],'skipEmptyLines':!![],'step':function(_0xd47b2,_0x450875){try{for(var _0x3e1d5c=0x0,_0x3a982b=[];_0x3e1d5c<_0xd47b2[_0x6bc5('0x4e')][_0x6bc5('0x4f')];_0x3e1d5c++){stats[_0x6bc5('0x50')]+=0x1;if(_0xd47b2[_0x6bc5('0x3f')][_0x3e1d5c]){handleError(_0xd47b2[_0x6bc5('0x4e')][_0x3e1d5c],_0xd47b2[_0x6bc5('0x3f')][_0x3e1d5c]);}else{var _0x11337a=[];for(var _0xc312fa in _0x463886){if(_0x463886[_0x6bc5('0x51')](_0xc312fa)){if(_0xd47b2['data'][_0x3e1d5c][_0x463886[_0xc312fa]]){var _0x3047e9=_['trim'](_0xd47b2[_0x6bc5('0x4e')][_0x3e1d5c][_0x463886[_0xc312fa]][_0x6bc5('0x52')](/"/g,'\x27'));switch(_0xc312fa){case _0x6bc5('0x21'):var _0x5a45bd=moment(_0x3047e9,_0x6bc5('0xf'),!![]);if(_0x5a45bd[_0x6bc5('0x53')]()){_0x3a982b[_0x6bc5('0x40')]('\x22'+_0x3047e9+'\x22');}else{_0x11337a['push'](_0x6bc5('0x54'));}break;case _0x6bc5('0x55'):var _0x2e9003=parseInt(_0x3047e9);_0x3047e9=_[_0x6bc5('0x56')](_0x2e9003)||_0x2e9003<0x0||_0x2e9003>0x4?_0x208938?0x3:0x2:_0x2e9003;_0x3a982b[_0x6bc5('0x40')]('\x22'+_0x3047e9+'\x22');break;case'UserId':var _0x257c77=parseInt(_0x3047e9);if(_[_0x6bc5('0x57')](_0x257c77)&&_[_0x6bc5('0x58')](_0x29891d,_0x257c77)){_0x3a982b[_0x6bc5('0x40')]('\x22'+_0x257c77+'\x22');}else{_0x11337a['push'](_0x6bc5('0x59'));}break;case'email':if(isEmail(_0x3047e9)){_0x3a982b[_0x6bc5('0x40')]('\x22'+_0x3047e9+'\x22');}else{_0x11337a[_0x6bc5('0x40')](_0x6bc5('0x5a'));}break;case _0x6bc5('0x5b'):var _0x25ee04=moment(_0x3047e9,'YYYY-MM-DD',!![]);if(_0x25ee04['isValid']()){_0x3a982b[_0x6bc5('0x40')]('\x22'+_0x3047e9+'\x22');}else{_0x11337a[_0x6bc5('0x40')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x3a982b[_0x6bc5('0x40')]('\x22'+_0x3047e9+'\x22');}}else{switch(_0xc312fa){case _0x6bc5('0x5c'):case _0x6bc5('0x10'):_0x11337a[_0x6bc5('0x40')](_0xc312fa+'\x20not\x20specified');break;default:_0x3a982b['push']('\x22\x22');}}}}if(_0x11337a[_0x6bc5('0x4f')]){handleError(_0xd47b2[_0x6bc5('0x4e')][_0x3e1d5c],{'code':_0x6bc5('0x5d'),'message':_0x11337a['join']()});}else{fs[_0x6bc5('0x5e')](_0x29de7a,_0x3a982b['join']()+'\x0a');}_0x3a982b=[];}if(!(stats[_0x6bc5('0x50')]%0xc8)){socket['emit'](_0x6bc5('0x5f')+_0x4ac996,stats);stats[_0x6bc5('0x3f')]=[];}}if(stopped){logger[_0x6bc5('0x3a')](_0x6bc5('0x60'));_0x450875[_0x6bc5('0x61')]();}}catch(_0x423e8e){handleError(_0xd47b2[_0x6bc5('0x4e')][_0x3e1d5c],{'code':_0x6bc5('0x62'),'message':_0x423e8e[_0x6bc5('0x3d')]});logger[_0x6bc5('0x3c')](_0x6bc5('0x63'),_0x423e8e[_0x6bc5('0x3d')]);}},'complete':function(){try{var _0x38a8a8=[];var _0x3cdd4=_0x6bc5('0x27');if(_0xcd2f75['duplicates']&&_0xcd2f75[_0x6bc5('0x64')]['length']){_0x3cdd4=_0x6bc5('0x65')+_0x4ac996;_0x38a8a8[_0x6bc5('0x40')](_0x6bc5('0x66')+_0x3cdd4+'\x20LIKE\x20cm_contacts;');}var _0x40ce47=util[_0x6bc5('0xe')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x29de7a,_0x3cdd4,_0x301827,_0xcd2f75[_0x6bc5('0x23')],_0xcd2f75[_0x6bc5('0x35')]||null,NOW,NOW);if(_[_0x6bc5('0x67')](_0x463886[_0x6bc5('0x21')])){_0x40ce47+=_0x6bc5('0x68');}_0x38a8a8[_0x6bc5('0x40')](_0x40ce47);if(_0xcd2f75['duplicates']&&_0xcd2f75[_0x6bc5('0x64')][_0x6bc5('0x4f')]){_0x38a8a8[_0x6bc5('0x40')](insertCmContact(_0xcd2f75['ListId'],_0x3cdd4,_0xcd2f75[_0x6bc5('0x64')],_0x463886));_0x38a8a8[_0x6bc5('0x40')](_0x6bc5('0x69')+_0x3cdd4+';');}_0x38a8a8[_0x6bc5('0x40')](insertCmHopper(_0xcd2f75[_0x6bc5('0x23')],'voice_queues_has_cm_lists',_0x6bc5('0x6a'),'VoiceQueueId',_0x208938));_0x38a8a8['push'](insertCmHopperBlack(_0xcd2f75['ListId'],_0x6bc5('0x6b'),_0x6bc5('0x6a'),_0x6bc5('0x6c')));_0x38a8a8['push'](insertCmHopper(_0xcd2f75[_0x6bc5('0x23')],'campaigns_has_cm_lists','campaigns','CampaignId',_0x208938));_0x38a8a8[_0x6bc5('0x40')](insertCmHopperBlack(_0xcd2f75['ListId'],_0x6bc5('0x6d'),'campaigns',_0x6bc5('0x6e')));BPromise['each'](_0x38a8a8,handleQuery)[_0x6bc5('0x6f')](function(_0x5a41e7){stats[_0x6bc5('0x70')]=!![];stats[_0x6bc5('0x71')]=_0xcd2f75[_0x6bc5('0x64')]&&_0xcd2f75[_0x6bc5('0x64')]['length']?results[0x2][_0x6bc5('0x71')]:results[0x0][_0x6bc5('0x71')];socket[_0x6bc5('0x72')](_0x6bc5('0x5f')+_0x4ac996,stats);fs[_0x6bc5('0x73')](_0x3a1093);fs[_0x6bc5('0x73')](_0x29de7a);process[_0x6bc5('0x3e')](0x0);})['catch'](function(_0x26bb38){logger['error'](_0x26bb38['message']);process[_0x6bc5('0x3e')](0x1);});}catch(_0x338ffb){logger[_0x6bc5('0x3c')](_0x6bc5('0x74'),_0x338ffb[_0x6bc5('0x3d')]);process[_0x6bc5('0x3e')](0x1);}},'error':function(_0x24e616,_0x414dd0,_0x15812c,_0x274444){throw new Error(_0x274444);}});}function validate(){if(process['argv']&&process['argv'][_0x6bc5('0x4f')]<0x4){throw new Error(_0x6bc5('0x75'));}var _0xfe731e=path[_0x6bc5('0x12')](config[_0x6bc5('0x76')],_0x6bc5('0x48'),process[_0x6bc5('0x77')][0x2]);if(!fs[_0x6bc5('0x78')](_0xfe731e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x5effdb={};try{_0x5effdb=JSON[_0x6bc5('0x4c')](process[_0x6bc5('0x77')][0x3]);if(!_0x5effdb[_0x6bc5('0x79')]){throw new Error(_0x6bc5('0x7a'));}if(!_0x5effdb[_0x6bc5('0x79')]['phone']){throw new Error(_0x6bc5('0x7b'));}if(!_0x5effdb[_0x6bc5('0x79')][_0x6bc5('0x5c')]){throw new Error(_0x6bc5('0x7c'));}var _0x248702=0x0;if(_0x5effdb[_0x6bc5('0x79')]['UserId']){_0x248702=0x1;}if(!_0x5effdb[_0x6bc5('0x23')]){throw new Error(_0x6bc5('0x7d'));}}catch(_0x1506fd){throw new Error('body\x20id\x20mandatory');}var _0x2a8247=[];try{_0x2a8247=_[_0x6bc5('0x7e')](JSON[_0x6bc5('0x4c')](process[_0x6bc5('0x77')][0x4]),'id');}catch(_0x364b7e){logger['info'](_0x6bc5('0x7f'));}main(_0xfe731e,_0x5effdb,_0x2a8247,_0x248702);}validate();process['on'](_0x6bc5('0x80'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x2070=['path','papaparse','bluebird','squel','ioredis','../../../mysqldb','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','from','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','field','ListId\x20=\x20?','\x20=\x20?','CompanyId','fromQuery',')\x20NOT\x20IN\x20?','cm_contacts','id\x20IN\x20?','min_id','info','Received\x20SIGINT','message','errors','push','code','sequelize','query','spread','catch','error','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','keys','header','createReadStream','data','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','exit','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0x2070,0x1a1));var _0x0207=function(_0x15a251,_0x2f4e28){_0x15a251=_0x15a251-0x0;var _0x106f3d=_0x2070[_0x15a251];return _0x106f3d;};'use strict';var fs=require('fs');var path=require(_0x0207('0x0'));var _=require('lodash');var Papa=require(_0x0207('0x1'));var util=require('util');var BPromise=require(_0x0207('0x2'));var moment=require('moment');var squel=require(_0x0207('0x3'));var Redis=require(_0x0207('0x4'));var db=require(_0x0207('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0207('0x6'));config[_0x0207('0x7')]=_['defaults'](config[_0x0207('0x7')],{'host':_0x0207('0x8'),'port':0x18eb});var socket=require(_0x0207('0x9'))(new Redis(config[_0x0207('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x0207('0xa')](_0x0207('0xb'));function isEmail(_0x4d68d9){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x0207('0xc')](_0x4d68d9);}function selectNotIn(_0x54f9ac,_0xe01c77,_0x134b9d,_0x335282,_0x4864c1){return squel[_0x0207('0xd')]()['field']('phone')['from'](_0x335282)[_0x0207('0xe')](_0xe01c77,null,_0xe01c77+_0x0207('0xf')+_0x335282+'.'+_0x134b9d)[_0x0207('0x10')](_0x335282+'.'+_0x134b9d+_0x0207('0x11')+_0x54f9ac+'.'+_0x134b9d)[_0x0207('0x10')](_0xe01c77+_0x0207('0x12')+_0x4864c1[_0x0207('0xe')]()+')');}function insertCmHopper(_0x58bab2,_0x51f4d6,_0x463f43,_0x3fcb3a,_0x334e6f){var _0x537019=['cm_contacts.phone',_0x0207('0x13'),'cm_contacts.id',_0x0207('0x14'),_0x51f4d6+'.'+_0x3fcb3a,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x0207('0x15'),_0x0207('0x16'),'\x22'+_0x334e6f+'\x22'];return squel[_0x0207('0x17')]()[_0x0207('0x18')](_0x0207('0x19'))['fromQuery']([_0x0207('0x1a'),_0x0207('0x1b'),_0x0207('0x1c'),_0x0207('0x1d'),_0x3fcb3a,_0x0207('0x1e'),_0x0207('0x1f'),_0x0207('0x20'),_0x0207('0x21'),'recallme'],squel['select']()[_0x0207('0x22')](_0x537019)[_0x0207('0x23')](_0x51f4d6)[_0x0207('0xe')]('cm_contacts',null,_0x0207('0x24')+_0x51f4d6+_0x0207('0x25'))['join'](_0x463f43,null,_0x463f43+_0x0207('0xf')+_0x51f4d6+'.'+_0x3fcb3a)[_0x0207('0x10')](_0x51f4d6+_0x0207('0x26'),_0x58bab2)[_0x0207('0x10')](_0x0207('0x27'),NOW)[_0x0207('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x51f4d6,_0x463f43,_0x3fcb3a,'cm_hopper',[_0x0207('0x28'),_0x0207('0x29')]))[_0x0207('0x10')](_0x0207('0x2a'),selectNotIn(_0x51f4d6,_0x463f43,_0x3fcb3a,'cm_hopper',['\x22always\x22'])))[_0x0207('0x2b')]();}function insertCmHopperBlack(_0x18af14,_0x454b88,_0x33c913,_0x51c424){var _0x2b0ea1=[_0x0207('0x2c'),'cm_contacts.id',_0x0207('0x14'),_0x454b88+'.'+_0x51c424,_0x0207('0x2d'),_0x0207('0x2e')];return squel['insert']()['into'](_0x0207('0x2f'))['fromQuery'](['phone',_0x0207('0x1c'),_0x0207('0x1d'),_0x51c424,_0x0207('0x1e'),_0x0207('0x1f')],squel[_0x0207('0xd')]()[_0x0207('0x22')](_0x2b0ea1)[_0x0207('0x23')](_0x454b88)[_0x0207('0xe')]('cm_contacts',null,_0x0207('0x24')+_0x454b88+'.CmListId')[_0x0207('0xe')](_0x33c913,null,_0x33c913+_0x0207('0xf')+_0x454b88+'.'+_0x51c424)[_0x0207('0x10')](_0x454b88+'.CmListId\x20=\x20?',_0x18af14)['where'](_0x0207('0x27'),NOW)[_0x0207('0x10')](_0x0207('0x2a'),squel[_0x0207('0xd')]()[_0x0207('0x30')](_0x0207('0x1a'))[_0x0207('0x23')](_0x0207('0x2f'))['where'](_0x0207('0x31'),_0x18af14)[_0x0207('0x10')](_0x51c424+_0x0207('0x32'),_0x454b88+'.'+_0x51c424)))[_0x0207('0x2b')]();}function insertCmContact(_0x562a2d,_0x7a9b9a,_0x30f9b9,_0x41d5e5){var _0x2b493e=_['concat'](_['keys'](_0x41d5e5),[_0x0207('0x1d'),_0x0207('0x33'),_0x0207('0x1e'),'updatedAt']);return squel['insert']()[_0x0207('0x18')]('cm_contacts')[_0x0207('0x34')](_0x2b493e,squel['select']()[_0x0207('0x22')](_0x2b493e)['from'](_0x7a9b9a)['where']('('+_0x30f9b9[_0x0207('0xe')](',')+_0x0207('0x35'),squel['select']()[_0x0207('0x22')](_0x30f9b9)['from'](_0x0207('0x36'))[_0x0207('0x10')](_0x0207('0x31'),_0x562a2d))[_0x0207('0x10')](_0x0207('0x37'),squel[_0x0207('0xd')]()[_0x0207('0x30')]('MIN(id)',_0x0207('0x38'))[_0x0207('0x23')](_0x7a9b9a)['group'](_0x30f9b9[_0x0207('0xe')](','))))[_0x0207('0x2b')]();}function handleStop(){logger[_0x0207('0x39')](_0x0207('0x3a'));stopped=!![];}function handleUncaughtException(_0x35cb87){logger['error'](_0x35cb87[_0x0207('0x3b')]);process['exit'](0x1);}function handleError(_0xc43672,_0x4a155a){stats[_0x0207('0x3c')][_0x0207('0x3d')]({'name':_0x4a155a[_0x0207('0x3e')],'message':_0x4a155a[_0x0207('0x3b')],'row':_0xc43672});}function handleQuery(_0x46b1de){logger[_0x0207('0x39')](_0x46b1de);return db[_0x0207('0x3f')][_0x0207('0x40')](_0x46b1de)[_0x0207('0x41')](function(_0x54b5ab){results['push'](_0x54b5ab);})[_0x0207('0x42')](function(_0x192c12){logger[_0x0207('0x43')](_0x192c12['message']);});}function main(_0x4289f5,_0x32fc4f,_0x9ff128,_0x2b38b7){logger[_0x0207('0x39')](_0x0207('0x44'),_0x4289f5,JSON[_0x0207('0x45')](_0x32fc4f));process[_0x0207('0x46')](_0x0207('0x47'));var _0x5670f3=_0x32fc4f[_0x0207('0x48')];var _0x3f6e2e=_0x32fc4f[_0x0207('0x49')];var _0x295022=path['join'](config[_0x0207('0x4a')],_0x0207('0x4b'),_0x3f6e2e+_0x0207('0x4c'));var _0x26ac24=_[_0x0207('0x4d')](_0x5670f3)['join']();logger[_0x0207('0x39')](_0x0207('0x4e'),_0x26ac24);fs['writeFileSync'](_0x295022,_0x26ac24+'\x0a');Papa['parse'](fs[_0x0207('0x4f')](_0x4289f5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x307c54,_0x354be3){try{for(var _0x4edd5f=0x0,_0x48d00e=[];_0x4edd5f<_0x307c54[_0x0207('0x50')]['length'];_0x4edd5f++){stats['rows']+=0x1;if(_0x307c54['errors'][_0x4edd5f]){handleError(_0x307c54[_0x0207('0x50')][_0x4edd5f],_0x307c54[_0x0207('0x3c')][_0x4edd5f]);}else{var _0x33c6f1=[];for(var _0x536184 in _0x5670f3){if(_0x5670f3[_0x0207('0x51')](_0x536184)){if(_0x307c54[_0x0207('0x50')][_0x4edd5f][_0x5670f3[_0x536184]]){var _0xff8ab1=_[_0x0207('0x52')](_0x307c54[_0x0207('0x50')][_0x4edd5f][_0x5670f3[_0x536184]][_0x0207('0x53')](/"/g,'\x27'));switch(_0x536184){case _0x0207('0x1b'):var _0x53ed3d=moment(_0xff8ab1,_0x0207('0xb'),!![]);if(_0x53ed3d[_0x0207('0x54')]()){_0x48d00e[_0x0207('0x3d')]('\x22'+_0xff8ab1+'\x22');}else{_0x33c6f1['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x0207('0x20'):var _0xf3fe15=parseInt(_0xff8ab1);_0xff8ab1=_[_0x0207('0x55')](_0xf3fe15)||_0xf3fe15<0x0||_0xf3fe15>0x4?_0x2b38b7?0x3:0x2:_0xf3fe15;_0x48d00e[_0x0207('0x3d')]('\x22'+_0xff8ab1+'\x22');break;case _0x0207('0x21'):var _0x518c41=parseInt(_0xff8ab1);if(_[_0x0207('0x56')](_0x518c41)&&_[_0x0207('0x57')](_0x9ff128,_0x518c41)){_0x48d00e['push']('\x22'+_0x518c41+'\x22');}else{_0x33c6f1['push'](_0x0207('0x58'));}break;case _0x0207('0x59'):if(isEmail(_0xff8ab1)){_0x48d00e[_0x0207('0x3d')]('\x22'+_0xff8ab1+'\x22');}else{_0x33c6f1['push'](_0x0207('0x5a'));}break;case _0x0207('0x5b'):var _0x2762b6=moment(_0xff8ab1,_0x0207('0x5c'),!![]);if(_0x2762b6[_0x0207('0x54')]()){_0x48d00e[_0x0207('0x3d')]('\x22'+_0xff8ab1+'\x22');}else{_0x33c6f1[_0x0207('0x3d')](_0x0207('0x5d'));}break;default:_0x48d00e[_0x0207('0x3d')]('\x22'+_0xff8ab1+'\x22');}}else{switch(_0x536184){case _0x0207('0x5e'):case _0x0207('0x1a'):_0x33c6f1[_0x0207('0x3d')](_0x536184+_0x0207('0x5f'));break;default:_0x48d00e['push']('\x22\x22');}}}}if(_0x33c6f1[_0x0207('0x60')]){handleError(_0x307c54[_0x0207('0x50')][_0x4edd5f],{'code':_0x0207('0x61'),'message':_0x33c6f1[_0x0207('0xe')]()});}else{fs[_0x0207('0x62')](_0x295022,_0x48d00e['join']()+'\x0a');}_0x48d00e=[];}if(!(stats[_0x0207('0x63')]%0xc8)){socket[_0x0207('0x64')](_0x0207('0x65')+_0x3f6e2e,stats);stats[_0x0207('0x3c')]=[];}}if(stopped){logger[_0x0207('0x39')](_0x0207('0x66'));_0x354be3[_0x0207('0x67')]();}}catch(_0x16a5f3){handleError(_0x307c54[_0x0207('0x50')][_0x4edd5f],{'code':_0x0207('0x68'),'message':_0x16a5f3[_0x0207('0x3b')]});logger[_0x0207('0x43')](_0x0207('0x69'),_0x16a5f3[_0x0207('0x3b')]);}},'complete':function(){try{var _0x481061=[];var _0x52aa3c=_0x0207('0x36');if(_0x32fc4f['duplicates']&&_0x32fc4f[_0x0207('0x6a')][_0x0207('0x60')]){_0x52aa3c=_0x0207('0x6b')+_0x3f6e2e;_0x481061['push']('CREATE\x20TABLE\x20'+_0x52aa3c+_0x0207('0x6c'));}var _0x513988=util[_0x0207('0xa')](_0x0207('0x6d'),_0x295022,_0x52aa3c,_0x26ac24,_0x32fc4f[_0x0207('0x1d')],_0x32fc4f[_0x0207('0x33')]||null,NOW,NOW);if(_[_0x0207('0x6e')](_0x5670f3[_0x0207('0x1b')])){_0x513988+=_0x0207('0x6f');}_0x481061[_0x0207('0x3d')](_0x513988);if(_0x32fc4f['duplicates']&&_0x32fc4f[_0x0207('0x6a')]['length']){_0x481061[_0x0207('0x3d')](insertCmContact(_0x32fc4f[_0x0207('0x1d')],_0x52aa3c,_0x32fc4f[_0x0207('0x6a')],_0x5670f3));_0x481061['push'](_0x0207('0x70')+_0x52aa3c+';');}_0x481061[_0x0207('0x3d')](insertCmHopper(_0x32fc4f[_0x0207('0x1d')],_0x0207('0x71'),_0x0207('0x72'),_0x0207('0x73'),_0x2b38b7));_0x481061[_0x0207('0x3d')](insertCmHopperBlack(_0x32fc4f[_0x0207('0x1d')],_0x0207('0x74'),_0x0207('0x72'),_0x0207('0x73')));_0x481061[_0x0207('0x3d')](insertCmHopper(_0x32fc4f['ListId'],_0x0207('0x75'),_0x0207('0x76'),_0x0207('0x77'),_0x2b38b7));_0x481061[_0x0207('0x3d')](insertCmHopperBlack(_0x32fc4f['ListId'],_0x0207('0x78'),_0x0207('0x76'),_0x0207('0x77')));BPromise[_0x0207('0x79')](_0x481061,handleQuery)[_0x0207('0x7a')](function(_0x14e21d){stats[_0x0207('0x7b')]=!![];stats[_0x0207('0x7c')]=_0x32fc4f[_0x0207('0x6a')]&&_0x32fc4f[_0x0207('0x6a')][_0x0207('0x60')]?results[0x2][_0x0207('0x7c')]:results[0x0][_0x0207('0x7c')];socket[_0x0207('0x64')](_0x0207('0x65')+_0x3f6e2e,stats);fs[_0x0207('0x7d')](_0x4289f5);fs['unlink'](_0x295022);process[_0x0207('0x7e')](0x0);})['catch'](function(_0x2d89d5){logger[_0x0207('0x43')](_0x2d89d5[_0x0207('0x3b')]);process[_0x0207('0x7e')](0x1);});}catch(_0x6f41c2){logger[_0x0207('0x43')]('complete',_0x6f41c2[_0x0207('0x3b')]);process[_0x0207('0x7e')](0x1);}},'error':function(_0xa200fa,_0x17e1a1,_0x47ec78,_0x587625){throw new Error(_0x587625);}});}function validate(){if(process[_0x0207('0x7f')]&&process['argv'][_0x0207('0x60')]<0x4){throw new Error(_0x0207('0x80'));}var _0x220b3f=path[_0x0207('0xe')](config[_0x0207('0x4a')],'server/files/tmp',process[_0x0207('0x7f')][0x2]);if(!fs[_0x0207('0x81')](_0x220b3f)){throw new Error(_0x0207('0x82'));}var _0x43bf17={};try{_0x43bf17=JSON['parse'](process[_0x0207('0x7f')][0x3]);if(!_0x43bf17[_0x0207('0x48')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x43bf17[_0x0207('0x48')][_0x0207('0x1a')]){throw new Error(_0x0207('0x83'));}if(!_0x43bf17[_0x0207('0x48')][_0x0207('0x5e')]){throw new Error(_0x0207('0x84'));}var _0x441b7c=0x0;if(_0x43bf17[_0x0207('0x48')][_0x0207('0x21')]){_0x441b7c=0x1;}if(!_0x43bf17[_0x0207('0x1d')]){throw new Error(_0x0207('0x85'));}}catch(_0x24b242){throw new Error(_0x0207('0x86'));}var _0x13289e=[];try{_0x13289e=_[_0x0207('0x87')](JSON[_0x0207('0x88')](process[_0x0207('0x7f')][0x4]),'id');}catch(_0x546a4f){logger[_0x0207('0x39')](_0x0207('0x89'));}main(_0x220b3f,_0x43bf17,_0x13289e,_0x441b7c);}validate();process['on'](_0x0207('0x8a'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index a2005fb..ec7001c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc3=['destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','outbound','membername','UniqueId','uniqueid','starttime','Complete\x20Time','endtime','getSubjects','string','toLowerCase','voice','inbound','push','variable','queue','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','Date','agentcalledAt','***\x20Agent\x20Info\x20***'];(function(_0x5bbf59,_0xa0d46b){var _0x1010bd=function(_0x11c867){while(--_0x11c867){_0x5bbf59['push'](_0x5bbf59['shift']());}};_0x1010bd(++_0xa0d46b);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x4bc3[_0x2070da];return _0x4f9fe1;};'use strict';exports[_0x34bc('0x0')]=function(_0xaaf670,_0x4a6fe8){var _0x14787d=[{'type':_0x34bc('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0xaaf670[_0x34bc('0x2')]()){case _0x34bc('0x3'):switch(_0x4a6fe8[_0x34bc('0x2')]()){case _0x34bc('0x4'):_0x14787d[_0x34bc('0x5')]({'type':_0x34bc('0x6'),'content':'','variableName':_0x34bc('0x7')});_0x14787d['push']({'type':_0x34bc('0x6'),'content':'','variableName':'calleridnum'});break;case'outbound':_0x14787d[_0x34bc('0x5')]({'type':_0x34bc('0x1'),'content':_0x34bc('0x8'),'variableName':null});_0x14787d[_0x34bc('0x5')]({'type':_0x34bc('0x6'),'content':'','variableName':_0x34bc('0x9')});break;}}return _0x14787d;};exports['getDescriptions']=function(_0x5a478d,_0x2b8112){var _0x33025c=[];switch(_0x5a478d[_0x34bc('0x2')]()){case'voice':switch(_0x2b8112[_0x34bc('0x2')]()){case'inbound':_0x33025c=[{'type':_0x34bc('0x1'),'content':_0x34bc('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x34bc('0xb'),'content':'','key':'Caller\x20Number','keyType':_0x34bc('0x6'),'variableName':'calleridnum'},{'type':_0x34bc('0xb'),'content':'','key':_0x34bc('0xc'),'keyType':_0x34bc('0x6'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':_0x34bc('0xd'),'keyType':'variable','variableName':_0x34bc('0xe')},{'type':_0x34bc('0xb'),'content':'','key':_0x34bc('0xf'),'keyType':_0x34bc('0x6'),'variableName':_0x34bc('0x7')},{'type':_0x34bc('0xb'),'content':'','key':'UniqueId','keyType':'variable','variableName':'uniqueid'},{'type':_0x34bc('0xb'),'content':'','key':_0x34bc('0x10'),'keyType':_0x34bc('0x6'),'variableName':_0x34bc('0x11')},{'type':'string','content':_0x34bc('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0x34bc('0xb'),'content':'','key':'Agent\x20Name','keyType':_0x34bc('0x6'),'variableName':_0x34bc('0x13')},{'type':'keyValue','content':'','key':_0x34bc('0x14'),'keyType':_0x34bc('0x6'),'variableName':_0x34bc('0x9')},{'type':_0x34bc('0x1'),'content':_0x34bc('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x34bc('0xb'),'content':'','key':'Agent\x20Ring','keyType':_0x34bc('0x6'),'variableName':_0x34bc('0x11')},{'type':_0x34bc('0xb'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x34bc('0x16')},{'type':_0x34bc('0xb'),'content':'','key':_0x34bc('0x17'),'keyType':_0x34bc('0x6'),'variableName':_0x34bc('0x18')},{'type':_0x34bc('0xb'),'content':'','key':_0x34bc('0x19'),'keyType':_0x34bc('0x6'),'variableName':_0x34bc('0x1a')},{'type':_0x34bc('0xb'),'content':'','key':_0x34bc('0x1b'),'keyType':_0x34bc('0x6'),'variableName':'talktime'}];break;case _0x34bc('0x1c'):_0x33025c=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x34bc('0xb'),'content':'','key':'Called\x20Number','keyType':_0x34bc('0x6'),'keyContent':'','variableName':_0x34bc('0x9')},{'type':_0x34bc('0xb'),'content':'','key':'Member\x20Name','keyType':_0x34bc('0x6'),'keyContent':'','variableName':_0x34bc('0x1d')},{'type':_0x34bc('0xb'),'content':'','key':_0x34bc('0x1e'),'keyType':_0x34bc('0x6'),'keyContent':'','variableName':_0x34bc('0x1f')},{'type':'keyValue','content':'','key':_0x34bc('0x10'),'keyType':_0x34bc('0x6'),'keyContent':'','variableName':_0x34bc('0x20')},{'type':_0x34bc('0x1'),'content':_0x34bc('0x15')},{'type':_0x34bc('0xb'),'content':'','key':'Answer\x20Time','keyType':_0x34bc('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x34bc('0x21'),'keyType':'variable','keyContent':'','variableName':_0x34bc('0x22')}];break;}}return _0x33025c;};
\ No newline at end of file
+var _0x008c=['talktime','Member\x20Name','uniqueid','Date','Answer\x20Time','answertime','Complete\x20Time','endtime','getSubjects','string','toLowerCase','voice','inbound','push','variable','queue','outbound','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','agentcalledAt','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentcompleteAt','Hold\x20Time'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x008c,0x188));var _0xc008=function(_0x2e9d8e,_0x3a377e){_0x2e9d8e=_0x2e9d8e-0x0;var _0x4dfc9b=_0x008c[_0x2e9d8e];return _0x4dfc9b;};'use strict';exports[_0xc008('0x0')]=function(_0x3025e5,_0x15aadc){var _0xae17af=[{'type':_0xc008('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x3025e5[_0xc008('0x2')]()){case _0xc008('0x3'):switch(_0x15aadc[_0xc008('0x2')]()){case _0xc008('0x4'):_0xae17af[_0xc008('0x5')]({'type':_0xc008('0x6'),'content':'','variableName':_0xc008('0x7')});_0xae17af[_0xc008('0x5')]({'type':_0xc008('0x6'),'content':'','variableName':'calleridnum'});break;case _0xc008('0x8'):_0xae17af['push']({'type':_0xc008('0x1'),'content':'Outbound\x20Call','variableName':null});_0xae17af['push']({'type':_0xc008('0x6'),'content':'','variableName':_0xc008('0x9')});break;}}return _0xae17af;};exports['getDescriptions']=function(_0x51ba7d,_0x543eb8){var _0x1eacfa=[];switch(_0x51ba7d[_0xc008('0x2')]()){case'voice':switch(_0x543eb8[_0xc008('0x2')]()){case _0xc008('0x4'):_0x1eacfa=[{'type':_0xc008('0x1'),'content':_0xc008('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0xc'),'keyType':_0xc008('0x6'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xc008('0xd'),'keyType':'variable','variableName':_0xc008('0xe')},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0xf'),'keyType':_0xc008('0x6'),'variableName':_0xc008('0x10')},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':_0xc008('0x7')},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0x11'),'keyType':_0xc008('0x6'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':'variable','variableName':_0xc008('0x12')},{'type':_0xc008('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xc008('0xb'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0xc008('0x13'),'keyType':'variable','variableName':'destcalleridnum'},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xc008('0x14'),'keyType':_0xc008('0x6'),'variableName':_0xc008('0x12')},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0x15'),'keyType':_0xc008('0x6'),'variableName':'agentconnectAt'},{'type':_0xc008('0xb'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0xc008('0x16')},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0x17'),'keyType':_0xc008('0x6'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0xc008('0x6'),'variableName':_0xc008('0x18')}];break;case _0xc008('0x8'):_0x1eacfa=[{'type':_0xc008('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0x19'),'keyType':_0xc008('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0x11'),'keyType':_0xc008('0x6'),'keyContent':'','variableName':_0xc008('0x1a')},{'type':'keyValue','content':'','key':_0xc008('0x1b'),'keyType':_0xc008('0x6'),'keyContent':'','variableName':'starttime'},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0x1c'),'keyType':_0xc008('0x6'),'keyContent':'','variableName':_0xc008('0x1d')},{'type':_0xc008('0xb'),'content':'','key':_0xc008('0x1e'),'keyType':_0xc008('0x6'),'keyContent':'','variableName':_0xc008('0x1f')}];break;}}return _0x1eacfa;};
\ No newline at end of file
index 3042719..1fe3e3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdae=['fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne','then','update','info','catch','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xbdae,0x1ea));var _0xebda=function(_0xfacee2,_0x29c3b0){_0xfacee2=_0xfacee2-0x0;var _0x4cc9ea=_0xbdae[_0xfacee2];return _0x4cc9ea;};'use strict';var _=require(_0xebda('0x0'));var db=require(_0xebda('0x1'))['db'];var loggers={'openchannel':require(_0xebda('0x2'))(_0xebda('0x3')),'mail':require(_0xebda('0x2'))(_0xebda('0x4')),'fax':require(_0xebda('0x2'))(_0xebda('0x5')),'sms':require('../../config/logger')(_0xebda('0x6')),'chat':require(_0xebda('0x2'))(_0xebda('0x7'))};function getInteractionId(_0x58e506,_0x563292,_0x4d70e2){if(_0x58e506&&_0x58e506[_[_0xebda('0x8')](_0x4d70e2)+_0xebda('0x9')]){return _0x58e506[_[_0xebda('0x8')](_0x4d70e2)+_0xebda('0x9')];}else if(_0x58e506&&_0x58e506['id']){return _0x58e506['id'];}else if(_0x563292&&_0x563292['id']){return _0x563292['id'];}else{return _0xebda('0xa');}}function log(_0x433964,_0x1b7f31,_0x2894c4,_0x538284,_0x5970b8,_0x689f0f){loggers[_0x5970b8[_0xebda('0xb')]()][_0x433964](_0xebda('0xc'),_0x689f0f[_0xebda('0xd')](),_0x1b7f31?_0x1b7f31['id']:null,_0x1b7f31?_0x1b7f31[_0xebda('0xe')]:null,_0x1b7f31?_0x1b7f31[_0xebda('0xf')]:null,getInteractionId(_0x2894c4,_0x538284,_0x5970b8),_0x2894c4?JSON[_0xebda('0x10')](_0x2894c4):_0xebda('0x11'));}function updateUser(_0x37d1c0,_0xf5275f,_0x5e0b8f,_0x75232b,_0x5035ce){db[_[_0xebda('0x8')](_0x75232b)+'Interaction'][_0xebda('0x12')]({'where':{'id':getInteractionId(_0xf5275f,_0x5e0b8f,_0x75232b)}})[_0xebda('0x13')](function(_0x5017f9){if(_0x5017f9){return _0x5017f9[_0xebda('0x14')]({'UserId':_0x37d1c0?_0x37d1c0['id']:null});}})[_0xebda('0x13')](function(_0x96f7ea){if(_0x96f7ea){log(_0xebda('0x15'),_0x37d1c0,_0xf5275f,_0x5e0b8f,_0x75232b,_0x5035ce);}})[_0xebda('0x16')](function(){log('error',_0x37d1c0,_0xf5275f,_0x5e0b8f,_0x75232b,_0x5035ce);});}exports[_0xebda('0x17')]=function(_0x51ed59,_0x628f62){return function(_0x19b0c5,_0x3353aa,_0x602381){var _0x55b8be=_0x19b0c5[_0xebda('0x18')];var _0x4aac33={};var _0x52ab61=_0x19b0c5[_0xebda('0x19')];if(_0x4aac33){_0x4aac33=_[_0xebda('0x1a')](_0x19b0c5[_0xebda('0x1b')]);_0x4aac33=_[_0xebda('0x1c')](_0x4aac33,[_0xebda('0x1b'),_0xebda('0x1d'),_0xebda('0x1e'),_0xebda('0x1f'),_0xebda('0x20')]);}updateUser(_0x55b8be,_0x4aac33,_0x52ab61,_0x51ed59,_0x628f62);_0x602381(null);};};
\ No newline at end of file
+var _0x213f=['mobile','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','findOne','update','then','info','catch','error','user','query','body','omit','html'];(function(_0x11fcec,_0x27e42d){var _0x518940=function(_0x4d8c2e){while(--_0x4d8c2e){_0x11fcec['push'](_0x11fcec['shift']());}};_0x518940(++_0x27e42d);}(_0x213f,0x145));var _0xf213=function(_0x214372,_0x58fda1){_0x214372=_0x214372-0x0;var _0x133e4b=_0x213f[_0x214372];return _0x133e4b;};'use strict';var _=require('lodash');var db=require(_0xf213('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xf213('0x1')),'mail':require(_0xf213('0x2'))(_0xf213('0x3')),'fax':require(_0xf213('0x2'))(_0xf213('0x4')),'sms':require(_0xf213('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0xf213('0x5'))};function getInteractionId(_0x57efaf,_0x29f545,_0xb54862){if(_0x57efaf&&_0x57efaf[_[_0xf213('0x6')](_0xb54862)+_0xf213('0x7')]){return _0x57efaf[_[_0xf213('0x6')](_0xb54862)+'InteractionId'];}else if(_0x57efaf&&_0x57efaf['id']){return _0x57efaf['id'];}else if(_0x29f545&&_0x29f545['id']){return _0x29f545['id'];}else{return _0xf213('0x8');}}function log(_0x309d9a,_0x1140d5,_0xbf502,_0x5d1549,_0x26e2e0,_0x4b8356){loggers[_0x26e2e0[_0xf213('0x9')]()][_0x309d9a](_0xf213('0xa'),_0x4b8356[_0xf213('0xb')](),_0x1140d5?_0x1140d5['id']:null,_0x1140d5?_0x1140d5[_0xf213('0xc')]:null,_0x1140d5?_0x1140d5[_0xf213('0xd')]:null,getInteractionId(_0xbf502,_0x5d1549,_0x26e2e0),_0xbf502?JSON[_0xf213('0xe')](_0xbf502):'null');}function updateUser(_0x3c154f,_0x2ab564,_0x5211a9,_0x96883f,_0x1dd85a){db[_[_0xf213('0x6')](_0x96883f)+'Interaction'][_0xf213('0xf')]({'where':{'id':getInteractionId(_0x2ab564,_0x5211a9,_0x96883f)}})['then'](function(_0x367091){if(_0x367091){return _0x367091[_0xf213('0x10')]({'UserId':_0x3c154f?_0x3c154f['id']:null});}})[_0xf213('0x11')](function(_0x5b8c0c){if(_0x5b8c0c){log(_0xf213('0x12'),_0x3c154f,_0x2ab564,_0x5211a9,_0x96883f,_0x1dd85a);}})[_0xf213('0x13')](function(){log(_0xf213('0x14'),_0x3c154f,_0x2ab564,_0x5211a9,_0x96883f,_0x1dd85a);});}exports['tracked']=function(_0x5a6e26,_0x3c4f51){return function(_0x41fccb,_0x239cb8,_0x8c4999){var _0x4a4d65=_0x41fccb[_0xf213('0x15')];var _0x554daa={};var _0x11c4d9=_0x41fccb[_0xf213('0x16')];if(_0x554daa){_0x554daa=_['clone'](_0x41fccb[_0xf213('0x17')]);_0x554daa=_[_0xf213('0x18')](_0x554daa,[_0xf213('0x17'),_0xf213('0x19'),'phone','fax',_0xf213('0x1a')]);}updateUser(_0x4a4d65,_0x554daa,_0x11c4d9,_0x5a6e26,_0x3c4f51);_0x8c4999(null);};};
\ No newline at end of file
index bc1ef00..68d3416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fa0=['findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','../../mysqldb','../../config/environment','license','data1','split','aes-256-ctr','%s:%s:%s','update','utf8','final','parse','use'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0x9fa0,0x6c));var _0x09fa=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x9fa0[_0x484e36];return _0xafc85d;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0x09fa('0x0'))['db'];var config=require(_0x09fa('0x1'));function getValueFromLicense(_0x3b3f36,_0x1887d1){if(_0x3b3f36&&_0x1887d1){if(_0x1887d1['data1']&&_0x1887d1[_0x09fa('0x2')]){var _0x253c83=_0x1887d1[_0x09fa('0x3')];var _0x4af857=_0x1887d1[_0x09fa('0x2')];var _0x5c10d2=_0x253c83[_0x09fa('0x4')]('-')[0x4];var _0x2f536f=_0x253c83[_0x09fa('0x4')]('-')[0x0];var _0x1aefdb=crypto['createDecipher'](_0x09fa('0x5'),util['format'](_0x09fa('0x6'),_0x5c10d2,_0x253c83,_0x2f536f));var _0x5b3327=_0x1aefdb[_0x09fa('0x7')](_0x4af857,'base64',_0x09fa('0x8'));_0x5b3327+=_0x1aefdb[_0x09fa('0x9')](_0x09fa('0x8'));var _0x43853c=JSON[_0x09fa('0xa')](_0x5b3327);return _0x43853c['hasOwnProperty'](_0x3b3f36)?_0x43853c[_0x3b3f36]:null;}}return null;}function isLimit(_0x109b5f,_0x2243aa,_0xe62fee,_0x49c1a7){var _0x49d8f7=_0x2243aa;return compose()[_0x09fa('0xb')](function(_0x331536,_0x5eab97,_0x31595c){return db['License'][_0x09fa('0xc')]({'where':{'id':0x1},'raw':!![]})[_0x09fa('0xd')](function(_0x31d8aa){var _0x10e070=getValueFromLicense(_0x109b5f,_0x31d8aa);return _0x10e070?_0x10e070:_0x49d8f7;})[_0x09fa('0xd')](function(_0x2179cd){_0x49d8f7=_0x2179cd;return _0xe62fee[_0x09fa('0xe')](_0x49c1a7);})[_0x09fa('0xd')](function(_0x441d1b){if(_0x441d1b>=_0x49d8f7){return _0x5eab97[_0x09fa('0xf')](0x193)[_0x09fa('0x10')]({'message':util[_0x09fa('0x11')](_0x09fa('0x12'),_0x109b5f)});}_0x31595c();})[_0x09fa('0x13')](function(_0x5a7015){_0x31595c(_0x5a7015);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x09fa('0x14')],{'where':{'$or':[{'role':_0x09fa('0x15')},{'role':_0x09fa('0x16')}]}});}exports[_0x09fa('0x17')]=isUserLimit;
\ No newline at end of file
+var _0xdafc=['license','split','createDecipher','format','%s:%s:%s','update','base64','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','crypto','../../mysqldb','data1'];(function(_0x3fe335,_0x215086){var _0x32b6b5=function(_0x33ff28){while(--_0x33ff28){_0x3fe335['push'](_0x3fe335['shift']());}};_0x32b6b5(++_0x215086);}(_0xdafc,0x1a6));var _0xcdaf=function(_0x429692,_0x13189d){_0x429692=_0x429692-0x0;var _0xc9a0a4=_0xdafc[_0x429692];return _0xc9a0a4;};'use strict';var crypto=require(_0xcdaf('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0xcdaf('0x1'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x597b87,_0x15e81a){if(_0x597b87&&_0x15e81a){if(_0x15e81a[_0xcdaf('0x2')]&&_0x15e81a[_0xcdaf('0x3')]){var _0x22479b=_0x15e81a['data1'];var _0x21f6a4=_0x15e81a['license'];var _0x31d143=_0x22479b[_0xcdaf('0x4')]('-')[0x4];var _0x3b0c33=_0x22479b[_0xcdaf('0x4')]('-')[0x0];var _0x4873c7=crypto[_0xcdaf('0x5')]('aes-256-ctr',util[_0xcdaf('0x6')](_0xcdaf('0x7'),_0x31d143,_0x22479b,_0x3b0c33));var _0xd24786=_0x4873c7[_0xcdaf('0x8')](_0x21f6a4,_0xcdaf('0x9'),'utf8');_0xd24786+=_0x4873c7[_0xcdaf('0xa')]('utf8');var _0x2a280e=JSON[_0xcdaf('0xb')](_0xd24786);return _0x2a280e[_0xcdaf('0xc')](_0x597b87)?_0x2a280e[_0x597b87]:null;}}return null;}function isLimit(_0x33826c,_0x4423d2,_0x2eb56a,_0x33a774){var _0x1ef042=_0x4423d2;return compose()[_0xcdaf('0xd')](function(_0x4d0c44,_0x197983,_0x50ccca){return db[_0xcdaf('0xe')][_0xcdaf('0xf')]({'where':{'id':0x1},'raw':!![]})[_0xcdaf('0x10')](function(_0x1493bc){var _0x470e57=getValueFromLicense(_0x33826c,_0x1493bc);return _0x470e57?_0x470e57:_0x1ef042;})['then'](function(_0x31f587){_0x1ef042=_0x31f587;return _0x2eb56a[_0xcdaf('0x11')](_0x33a774);})['then'](function(_0x4dd6a4){if(_0x4dd6a4>=_0x1ef042){return _0x197983[_0xcdaf('0x12')](0x193)[_0xcdaf('0x13')]({'message':util['format'](_0xcdaf('0x14'),_0x33826c)});}_0x50ccca();})['catch'](function(_0x256ec5){_0x50ccca(_0x256ec5);});});}function isUserLimit(){return isLimit(_0xcdaf('0x15'),0x1,db[_0xcdaf('0x16')],{'where':{'$or':[{'role':_0xcdaf('0x17')},{'role':'user'}]}});}exports[_0xcdaf('0x18')]=isUserLimit;
\ No newline at end of file
index 65153ba..9be248a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcf8=['omit','isObject','length','unset','hasOwnProperty','lodash','sequelize','fields','filters','isEmpty','forOwn','parse','split','offset','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','isArray'];(function(_0x39b217,_0x2405af){var _0x4df191=function(_0x4945c1){while(--_0x4945c1){_0x39b217['push'](_0x39b217['shift']());}};_0x4df191(++_0x2405af);}(_0xdcf8,0x195));var _0x8dcf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdcf8[_0x432682];return _0x463d05;};'use strict';var _=require(_0x8dcf('0x0'));var sequelize=require(_0x8dcf('0x1'));var LIMIT_VALUE=0xfa;exports[_0x8dcf('0x2')]=function(_0x35ce11){var _0x311766=null;if(_0x35ce11){_0x311766=_0x35ce11['split'](',');}return _0x311766;};exports[_0x8dcf('0x3')]=function(_0x2e69f8){var _0x4f308f={};if(!_[_0x8dcf('0x4')](_0x2e69f8)){_0x4f308f={};_[_0x8dcf('0x5')](_0x2e69f8,function(_0x50b08e,_0x50a998){try{_0x4f308f[_0x50a998]=JSON[_0x8dcf('0x6')](_0x50b08e);}catch(_0x1b6a12){_0x4f308f[_0x50a998]=_0x50b08e[_0x8dcf('0x7')](',');}});}return _0x4f308f;};exports['limit']=function(_0x52e901){_0x52e901=parseInt(_0x52e901,0xa);if(!_0x52e901||_0x52e901<0x0){_0x52e901=LIMIT_VALUE;}return _0x52e901;};exports[_0x8dcf('0x8')]=function(_0x13ad7d){_0x13ad7d=parseInt(_0x13ad7d,0xa);if(!_0x13ad7d||_0x13ad7d<0x0){_0x13ad7d=0x0;}return _0x13ad7d;};exports[_0x8dcf('0x9')]=function(_0x2ecd72){var _0x379159,_0x285aa1=null;if(_0x2ecd72){_0x379159=_0x2ecd72[_0x8dcf('0x7')](',');_0x285aa1=_[_0x8dcf('0xa')](_0x379159,function(_0x498047){if(_0x498047[_0x8dcf('0xb')]('-')===0x0){return[_0x498047==='priority'?sequelize[_0x8dcf('0xc')](sequelize[_0x8dcf('0xd')](_0x8dcf('0xe')),_0x8dcf('0xf')):_0x498047[_0x8dcf('0x10')](0x1),_0x8dcf('0x11')];}else{return[_0x498047===_0x8dcf('0xe')?sequelize[_0x8dcf('0xc')](sequelize[_0x8dcf('0xd')]('priority'),_0x8dcf('0xf')):_0x498047,_0x8dcf('0x12')];}});}return _0x285aa1;};exports['omit']=function(_0x533230,_0x3faf8e){if(_[_0x8dcf('0x4')](_0x533230)){return _0x533230;}if(_[_0x8dcf('0x13')](_0x533230)){for(var _0x325831=0x0;_0x325831<_0x533230['length'];_0x325831+=0x1){_0x533230[_0x325831]=this[_0x8dcf('0x14')](_0x533230[_0x325831],_0x3faf8e);}return _0x533230;}if(!_[_0x8dcf('0x15')](_0x533230)){return _0x533230;}if(_['isString'](_0x3faf8e)){_0x3faf8e=[_0x3faf8e];}if(!_['isArray'](_0x3faf8e)){return _0x533230;}for(var _0x4c7f85=0x0;_0x4c7f85<_0x3faf8e[_0x8dcf('0x16')];_0x4c7f85+=0x1){_[_0x8dcf('0x17')](_0x533230,_0x3faf8e[_0x4c7f85]);}for(var _0x305e01 in _0x533230){if(_0x533230[_0x8dcf('0x18')](_0x305e01)){_0x533230[_0x305e01]=this[_0x8dcf('0x14')](_0x533230[_0x305e01],_0x3faf8e);}}return _0x533230;};
\ No newline at end of file
+var _0xbb80=['offset','sort','map','indexOf','priority','cast','col','unsigned','DESC','omit','isEmpty','isArray','length','isObject','isString','hasOwnProperty','lodash','sequelize','fields','split','filters','forOwn','parse'];(function(_0x39b5bd,_0x398098){var _0x3791cb=function(_0x2e2feb){while(--_0x2e2feb){_0x39b5bd['push'](_0x39b5bd['shift']());}};_0x3791cb(++_0x398098);}(_0xbb80,0xdf));var _0x0bb8=function(_0x22ecec,_0x24c3be){_0x22ecec=_0x22ecec-0x0;var _0x559790=_0xbb80[_0x22ecec];return _0x559790;};'use strict';var _=require(_0x0bb8('0x0'));var sequelize=require(_0x0bb8('0x1'));var LIMIT_VALUE=0xfa;exports[_0x0bb8('0x2')]=function(_0x169e9a){var _0x456983=null;if(_0x169e9a){_0x456983=_0x169e9a[_0x0bb8('0x3')](',');}return _0x456983;};exports[_0x0bb8('0x4')]=function(_0xa092b8){var _0x565bd8={};if(!_['isEmpty'](_0xa092b8)){_0x565bd8={};_[_0x0bb8('0x5')](_0xa092b8,function(_0x1d6599,_0x2dbb3f){try{_0x565bd8[_0x2dbb3f]=JSON[_0x0bb8('0x6')](_0x1d6599);}catch(_0x28bf4c){_0x565bd8[_0x2dbb3f]=_0x1d6599[_0x0bb8('0x3')](',');}});}return _0x565bd8;};exports['limit']=function(_0x326a92){_0x326a92=parseInt(_0x326a92,0xa);if(!_0x326a92||_0x326a92<0x0){_0x326a92=LIMIT_VALUE;}return _0x326a92;};exports[_0x0bb8('0x7')]=function(_0x12110a){_0x12110a=parseInt(_0x12110a,0xa);if(!_0x12110a||_0x12110a<0x0){_0x12110a=0x0;}return _0x12110a;};exports[_0x0bb8('0x8')]=function(_0x3d1d35){var _0x7f087c,_0x2b7947=null;if(_0x3d1d35){_0x7f087c=_0x3d1d35[_0x0bb8('0x3')](',');_0x2b7947=_[_0x0bb8('0x9')](_0x7f087c,function(_0x28a64b){if(_0x28a64b[_0x0bb8('0xa')]('-')===0x0){return[_0x28a64b===_0x0bb8('0xb')?sequelize[_0x0bb8('0xc')](sequelize[_0x0bb8('0xd')]('priority'),_0x0bb8('0xe')):_0x28a64b['substr'](0x1),_0x0bb8('0xf')];}else{return[_0x28a64b===_0x0bb8('0xb')?sequelize[_0x0bb8('0xc')](sequelize[_0x0bb8('0xd')](_0x0bb8('0xb')),'unsigned'):_0x28a64b,'ASC'];}});}return _0x2b7947;};exports[_0x0bb8('0x10')]=function(_0x20f9a9,_0x7f71f8){if(_[_0x0bb8('0x11')](_0x20f9a9)){return _0x20f9a9;}if(_[_0x0bb8('0x12')](_0x20f9a9)){for(var _0x52d0c2=0x0;_0x52d0c2<_0x20f9a9[_0x0bb8('0x13')];_0x52d0c2+=0x1){_0x20f9a9[_0x52d0c2]=this[_0x0bb8('0x10')](_0x20f9a9[_0x52d0c2],_0x7f71f8);}return _0x20f9a9;}if(!_[_0x0bb8('0x14')](_0x20f9a9)){return _0x20f9a9;}if(_[_0x0bb8('0x15')](_0x7f71f8)){_0x7f71f8=[_0x7f71f8];}if(!_[_0x0bb8('0x12')](_0x7f71f8)){return _0x20f9a9;}for(var _0x3accea=0x0;_0x3accea<_0x7f71f8[_0x0bb8('0x13')];_0x3accea+=0x1){_['unset'](_0x20f9a9,_0x7f71f8[_0x3accea]);}for(var _0xa1a458 in _0x20f9a9){if(_0x20f9a9[_0x0bb8('0x16')](_0xa1a458)){_0x20f9a9[_0xa1a458]=this['omit'](_0x20f9a9[_0xa1a458],_0x7f71f8);}}return _0x20f9a9;};
\ No newline at end of file
index 0a08f6c..e9e0396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['test','client','set','json\x20replacer','split','static','get','views','/server/views','engine','html','renderFile','view\x20engine','json','50mb','initialize','express','serve-favicon','body-parser','errorhandler','path','passport','cors','./environment','default','env','production','use','join','root','public','favicon.ico','development'];(function(_0x2c5346,_0x4e0184){var _0x44dacb=function(_0x3f335b){while(--_0x3f335b){_0x2c5346['push'](_0x2c5346['shift']());}};_0x44dacb(++_0x4e0184);}(_0x70e0,0x17b));var _0x070e=function(_0xa40fa,_0x24c3f6){_0xa40fa=_0xa40fa-0x0;var _0x57b32f=_0x70e0[_0xa40fa];return _0x57b32f;};'use strict';var express=require(_0x070e('0x0'));var favicon=require(_0x070e('0x1'));var bodyParser=require(_0x070e('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0x070e('0x3'));var path=require(_0x070e('0x4'));var passport=require(_0x070e('0x5'));var cors=require(_0x070e('0x6'));var moment=require('moment');var config=require(_0x070e('0x7'));var db=require('../mysqldb')['db'];exports[_0x070e('0x8')]=function(_0x4b041d){var _0x56e420=_0x4b041d['get'](_0x070e('0x9'));if(_0x56e420===_0x070e('0xa')){_0x4b041d[_0x070e('0xb')](favicon(path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0xe'),_0x070e('0xf'))));_0x4b041d['set']('appPath',path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0xe')));}if(_0x56e420===_0x070e('0x10')||_0x56e420===_0x070e('0x11')){_0x4b041d[_0x070e('0xb')](favicon(path[_0x070e('0xc')](config[_0x070e('0xd')],_0x070e('0x12'),_0x070e('0xf'))));_0x4b041d[_0x070e('0x13')]('appPath',path['join'](config[_0x070e('0xd')],'client'));_0x4b041d['use'](errorHandler());}_0x4b041d['set'](_0x070e('0x14'),function(_0x14c3fd,_0x51d14d){if(this[_0x14c3fd]instanceof Date){_0x51d14d=this[_0x14c3fd]['toISOString']()[_0x070e('0x15')]('.')[0x0]+'Z';}return _0x51d14d;});_0x4b041d[_0x070e('0xb')](express[_0x070e('0x16')](_0x4b041d[_0x070e('0x17')]('appPath')));_0x4b041d['set'](_0x070e('0x18'),config[_0x070e('0xd')]+_0x070e('0x19'));_0x4b041d[_0x070e('0x1a')](_0x070e('0x1b'),require('ejs')[_0x070e('0x1c')]);_0x4b041d[_0x070e('0x13')](_0x070e('0x1d'),_0x070e('0x1b'));_0x4b041d[_0x070e('0xb')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x4b041d['use'](bodyParser[_0x070e('0x1e')]({'limit':_0x070e('0x1f')}));_0x4b041d[_0x070e('0xb')](cors());_0x4b041d['use'](methodOverride());_0x4b041d[_0x070e('0xb')](cookieParser());_0x4b041d['use'](passport[_0x070e('0x20')]());};
\ No newline at end of file
+var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0xe706,0xa3));var _0x6e70=function(_0x526074,_0x5e5d09){_0x526074=_0x526074-0x0;var _0x83c6c8=_0xe706[_0x526074];return _0x83c6c8;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());};
\ No newline at end of file
index 1c91ceb..046f1f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7f0=['keys','filter','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update','getUuid','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','digest','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy'];(function(_0x59ac72,_0x231bc8){var _0x12923c=function(_0x5ea63f){while(--_0x5ea63f){_0x59ac72['push'](_0x59ac72['shift']());}};_0x12923c(++_0x231bc8);}(_0xb7f0,0x1c7));var _0x0b7f=function(_0x398140,_0x55b247){_0x398140=_0x398140-0x0;var _0x39f02f=_0xb7f0[_0x398140];return _0x39f02f;};'use strict';var _=require(_0x0b7f('0x0'));var os=require('os');var crypto=require(_0x0b7f('0x1'));var machine=require(_0x0b7f('0x2'));var exec=require(_0x0b7f('0x3'))[_0x0b7f('0x4')];function getInterfaces(){var _0x4c531b=[];var _0x3203b8=os[_0x0b7f('0x5')]();var _0x3cff7b=_[_0x0b7f('0x6')](_[_0x0b7f('0x7')](_0x3203b8));for(var _0x3d1ba1=0x0;_0x3d1ba1<_0x3cff7b['length'];_0x3d1ba1++){var _0x4b8226=_0x3203b8[_0x3cff7b[_0x3d1ba1]][_0x0b7f('0x8')](function(_0x4913a5){return _0x4913a5['family']==='IPv4'&&_0x4913a5[_0x0b7f('0x9')]===![];});_0x4c531b=_0x4c531b[_0x0b7f('0xa')](_0x4b8226);}return _0x4c531b;}function getFirstInterface(){var _0x44aa60=_[_0x0b7f('0xb')](getInterfaces());return{'macAddress':_0x44aa60&&_0x44aa60[_0x0b7f('0xc')]?_0x44aa60[_0x0b7f('0xc')]:_0x0b7f('0xd'),'ipAddress':_0x44aa60&&_0x44aa60[_0x0b7f('0xe')]?_0x44aa60[_0x0b7f('0xe')]:_0x0b7f('0xf')};}exports[_0x0b7f('0x10')]=getFirstInterface;function getCPUhash(){var _0x5249a8=_[_0x0b7f('0x6')](os[_0x0b7f('0x11')]()[_0x0b7f('0x12')](function(_0x464431){return _0x464431[_0x0b7f('0x13')];}))['join'](':');return crypto[_0x0b7f('0x14')](_0x0b7f('0x15'))[_0x0b7f('0x16')](_0x5249a8)['digest']('hex');}exports[_0x0b7f('0x17')]=function(){switch(os[_0x0b7f('0x18')]()){case'win32':return exec(_0x0b7f('0x19'),{'encoding':_0x0b7f('0x1a')})[_0x0b7f('0x1b')]('\x0d\x0a','');default:var _0x44500c=getFirstInterface();var _0x359491=getCPUhash();var _0x4f2b62=_0x359491+'|'+os['hostname']()+'|'+_0x44500c[_0x0b7f('0x1c')]+'|'+_0x44500c[_0x0b7f('0x1d')];var _0x495283=crypto[_0x0b7f('0x14')](_0x0b7f('0x15'))[_0x0b7f('0x16')](_0x4f2b62)[_0x0b7f('0x1e')](_0x0b7f('0x1f'));return _0x495283['substring'](0x0,0x8)+'-'+_0x495283[_0x0b7f('0x20')](0x8,0xc)+'-'+_0x495283[_0x0b7f('0x20')](0xc,0x10)+'-'+_0x495283[_0x0b7f('0x20')](0x10,0x14)+'-'+_0x495283[_0x0b7f('0x20')](0x14);}};
\ No newline at end of file
+var _0x0a00=['substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','filter','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','map','model','join','createHash','md5','hex','getUuid','platform','win32','replace','hostname','macAddress','update','digest'];(function(_0x2d21aa,_0x13fad7){var _0x5b9e22=function(_0x5d081e){while(--_0x5d081e){_0x2d21aa['push'](_0x2d21aa['shift']());}};_0x5b9e22(++_0x13fad7);}(_0x0a00,0x9c));var _0x00a0=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x0a00[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x00a0('0x0'));var os=require('os');var crypto=require(_0x00a0('0x1'));var machine=require(_0x00a0('0x2'));var exec=require(_0x00a0('0x3'))[_0x00a0('0x4')];function getInterfaces(){var _0x438730=[];var _0x39e000=os[_0x00a0('0x5')]();var _0x78cfe3=_[_0x00a0('0x6')](_['keys'](_0x39e000));for(var _0x545d5e=0x0;_0x545d5e<_0x78cfe3[_0x00a0('0x7')];_0x545d5e++){var _0x3684af=_0x39e000[_0x78cfe3[_0x545d5e]][_0x00a0('0x8')](function(_0x1d3a5b){return _0x1d3a5b['family']===_0x00a0('0x9')&&_0x1d3a5b[_0x00a0('0xa')]===![];});_0x438730=_0x438730[_0x00a0('0xb')](_0x3684af);}return _0x438730;}function getFirstInterface(){var _0x328867=_['head'](getInterfaces());return{'macAddress':_0x328867&&_0x328867[_0x00a0('0xc')]?_0x328867[_0x00a0('0xc')]:_0x00a0('0xd'),'ipAddress':_0x328867&&_0x328867[_0x00a0('0xe')]?_0x328867[_0x00a0('0xe')]:_0x00a0('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x44dfa2=_['orderBy'](os['cpus']()[_0x00a0('0x10')](function(_0x8f9804){return _0x8f9804[_0x00a0('0x11')];}))[_0x00a0('0x12')](':');return crypto[_0x00a0('0x13')](_0x00a0('0x14'))['update'](_0x44dfa2)['digest'](_0x00a0('0x15'));}exports[_0x00a0('0x16')]=function(){switch(os[_0x00a0('0x17')]()){case _0x00a0('0x18'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x00a0('0x19')]('\x0d\x0a','');default:var _0x9b1b9c=getFirstInterface();var _0x2fd595=getCPUhash();var _0x7e1a97=_0x2fd595+'|'+os[_0x00a0('0x1a')]()+'|'+_0x9b1b9c[_0x00a0('0x1b')]+'|'+_0x9b1b9c['ipAddress'];var _0x3fd74a=crypto[_0x00a0('0x13')](_0x00a0('0x14'))[_0x00a0('0x1c')](_0x7e1a97)[_0x00a0('0x1d')](_0x00a0('0x15'));return _0x3fd74a[_0x00a0('0x1e')](0x0,0x8)+'-'+_0x3fd74a['substring'](0x8,0xc)+'-'+_0x3fd74a[_0x00a0('0x1e')](0xc,0x10)+'-'+_0x3fd74a[_0x00a0('0x1e')](0x10,0x14)+'-'+_0x3fd74a[_0x00a0('0x1e')](0x14);}};
\ No newline at end of file
index 7bf4c50..f8b96d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e96=['application/json','setEncoding','utf8','end','parse','error','createCipher','aes-256-ctr','secrets','session','update','final','base64','||FIELD||VALUE||\x0a','User','findOne','admin','then','|uuid|','|machineUuid|','fullname','|email|','email','getFirstInterface','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','catch','message','finally','getUuid','findOrCreate','default','util','crypto','moment','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','license','../../api/jira/jira.controller','www.xcallymotion.com','format','/api/servers/%s/check?version=%s','GET'];(function(_0x14faa6,_0xccadc8){var _0x3ca44a=function(_0x414bb4){while(--_0x414bb4){_0x14faa6['push'](_0x14faa6['shift']());}};_0x3ca44a(++_0xccadc8);}(_0x0e96,0xed));var _0x60e9=function(_0x3ba4c8,_0x2dfaab){_0x3ba4c8=_0x3ba4c8-0x0;var _0x2cf5a2=_0x0e96[_0x3ba4c8];return _0x2cf5a2;};'use strict';var util=require(_0x60e9('0x0'));var https=require('https');var crypto=require(_0x60e9('0x1'));var moment=require(_0x60e9('0x2'));var BPromise=require(_0x60e9('0x3'));var pkginfo=require(_0x60e9('0x4'))(module,_0x60e9('0x5'));var db=require(_0x60e9('0x6'))['db'];var config=require(_0x60e9('0x7'));var hardware=require(_0x60e9('0x8'));var logger=require('../logger')(_0x60e9('0x9'));var jira=require(_0x60e9('0xa'));var HOST=_0x60e9('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;function httpRequest(_0x6650e8){return new BPromise(function(_0x33f722,_0x55fedc){var _0x3cea29={'host':HOST,'port':0x1bb,'path':util[_0x60e9('0xc')](_0x60e9('0xd'),_0x6650e8,module['exports'][_0x60e9('0x5')]),'method':_0x60e9('0xe'),'timeout':0xea60,'headers':{'Content-Type':_0x60e9('0xf')}};var _0x3badb1=https['request'](_0x3cea29,function(_0x2a837d){_0x2a837d[_0x60e9('0x10')](_0x60e9('0x11'));var _0x4e1d17='';_0x2a837d['on']('data',function(_0x3e32d7){_0x4e1d17+=_0x3e32d7;});_0x2a837d['on'](_0x60e9('0x12'),function(){try{_0x33f722(JSON[_0x60e9('0x13')](_0x4e1d17));}catch(_0x439a1f){_0x55fedc(_0x439a1f);}});});_0x3badb1['on'](_0x60e9('0x14'),_0x55fedc);_0x3badb1[_0x60e9('0x12')]();});}function encryptDate(_0x251f9e){var _0x5e43c4=crypto[_0x60e9('0x15')](_0x60e9('0x16'),config[_0x60e9('0x17')][_0x60e9('0x18')]);var _0x2605f0=_0x5e43c4[_0x60e9('0x19')](_0x251f9e,_0x60e9('0x11'),'base64');_0x2605f0+=_0x5e43c4[_0x60e9('0x1a')]('base64');return _0x2605f0;}function decryptDate(_0x279602){var _0xe849e6=crypto['createDecipher']('aes-256-ctr',config['secrets'][_0x60e9('0x18')]);var _0x1dec2f=_0xe849e6[_0x60e9('0x19')](_0x279602,_0x60e9('0x1b'),'utf8');_0x1dec2f+=_0xe849e6[_0x60e9('0x1a')]('utf8');return _0x1dec2f;}function sendJiraAlert(_0x5b0ce2,_0xce2438,_0x38706f){var _0x5725f8=_0x60e9('0x1c');return db[_0x60e9('0x1d')][_0x60e9('0x1e')]({'where':{'role':_0x60e9('0x1f')},'attributes':['fullname','email'],'raw':!![]})[_0x60e9('0x20')](function(_0x5cfab6){ADMIN=_0x5cfab6;_0x5725f8+='|reason|'+_0x38706f+'|\x0a';_0x5725f8+=_0x60e9('0x21')+_0x5b0ce2+'|\x0a';_0x5725f8+=_0x60e9('0x22')+_0xce2438+'|\x0a';_0x5725f8+='|name|'+ADMIN[_0x60e9('0x23')]+'|\x0a';_0x5725f8+=_0x60e9('0x24')+ADMIN[_0x60e9('0x25')]+'|\x0a';return _0x5725f8;})[_0x60e9('0x20')](function(_0x4b1503){var _0x438a3a=hardware[_0x60e9('0x26')]()['ipAddress'];return jira[_0x60e9('0x27')]({'key':_0x60e9('0x28'),'summary':_0x60e9('0x29'),'description':_0x4b1503,'issuetype':_0x60e9('0x2a'),'oldToken':_0x5b0ce2,'newToken':_0xce2438,'email':ADMIN[_0x60e9('0x25')],'name':ADMIN[_0x60e9('0x23')],'reason':GRAY_PERIOD_REASON,'ip':_0x438a3a});});}function manageLicense(_0x1c832d,_0x5e9b4f){var _0x2f355b=_0x5e9b4f[_0x60e9('0x2b')]({'plain':!![]});httpRequest(_0x1c832d)[_0x60e9('0x20')](function(_0x1c008c){if(_0x1c008c[_0x60e9('0x2c')]){if(!_0x2f355b['license']&&_0x2f355b[_0x60e9('0x9')]!=_0x1c008c[_0x60e9('0x9')]||_0x2f355b['license']&&_0x2f355b[_0x60e9('0x2d')]){logger[_0x60e9('0x2e')](_0x60e9('0x2f'));}if(_0x2f355b[_0x60e9('0x9')]&&!_0x2f355b[_0x60e9('0x2d')]&&_0x2f355b[_0x60e9('0x9')]!=_0x1c008c['license']){logger['info'](_0x60e9('0x30'));}if(_0x2f355b[_0x60e9('0x9')]&&!_0x2f355b[_0x60e9('0x2d')]&&_0x2f355b[_0x60e9('0x9')]==_0x1c008c[_0x60e9('0x9')]){return _0x5e9b4f;}return _0x5e9b4f[_0x60e9('0x19')]({'data1':_0x1c832d,'data2':null,'license':_0x1c008c['license']});}else{if(_0x1c008c[_0x60e9('0x9')]||_0x2f355b[_0x60e9('0x9')]){if(!_0x2f355b['data2']){if(_0x2f355b[_0x60e9('0x31')]==_0x1c832d){GRAY_PERIOD_REASON=_0x60e9('0x32');logger[_0x60e9('0x2e')](_0x60e9('0x33'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x60e9('0x2e')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2f355b[_0x60e9('0x31')],_0x1c832d);}sendJiraAlert(_0x2f355b['data1'],_0x1c008c[_0x60e9('0x34')],GRAY_PERIOD_REASON);logger[_0x60e9('0x2e')](_0x60e9('0x35'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x60e9('0x36')));return _0x5e9b4f[_0x60e9('0x19')]({'data2':encryptDate(moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x60e9('0x37')](decryptDate(_0x2f355b['data2']),_0x60e9('0x38'))>DAYS){logger[_0x60e9('0x2e')]('DEMO\x20START\x20AT\x20%s',moment()[_0x60e9('0xc')](_0x60e9('0x36')));return _0x5e9b4f[_0x60e9('0x19')]({'data1':_0x1c832d,'data2':null,'license':null});}}}else{if(_0x2f355b[_0x60e9('0x31')]!=_0x1c832d){logger[_0x60e9('0x2e')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2f355b['data1'],_0x1c832d);return _0x5e9b4f[_0x60e9('0x19')]({'data1':_0x1c832d,'data2':null,'license':null});}}}return _0x5e9b4f;})[_0x60e9('0x20')](function(_0x34278a){_0x5e9b4f=_0x34278a;})[_0x60e9('0x39')](function(_0x39c926){logger[_0x60e9('0x14')](_0x39c926[_0x60e9('0x3a')]);})[_0x60e9('0x3b')](function(){setTimeout(function(){manageLicense(hardware[_0x60e9('0x3c')](),_0x5e9b4f);},TIME);});}function defaultLicense(){var _0xc46eeb=hardware[_0x60e9('0x3c')]();if(_0xc46eeb){return db['License'][_0x60e9('0x3d')]({'where':{'id':0x1},'defaults':{'data1':_0xc46eeb}})['spread'](function(_0x1f56d1,_0x1b4deb){logger[_0x60e9('0x2e')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xc46eeb);manageLicense(_0xc46eeb,_0x1f56d1);})['catch'](function(_0x5a388e){logger['error'](_0x5a388e[_0x60e9('0x3a')]);});}}exports[_0x60e9('0x3e')]=defaultLicense;
\ No newline at end of file
+var _0xdbb5=['format','/api/servers/%s/check?version=%s','exports','version','GET','application/json','setEncoding','utf8','data','end','parse','error','createCipher','aes-256-ctr','secrets','update','final','base64','createDecipher','session','User','findOne','admin','fullname','email','then','|reason|','|machineUuid|','|email|','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','catch','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','crypto','moment','bluebird','pkginfo','../environment','license','../../api/jira/jira.controller','www.xcallymotion.com'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdbb5,0x18a));var _0x5dbb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbb5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var https=require('https');var crypto=require(_0x5dbb('0x0'));var moment=require(_0x5dbb('0x1'));var BPromise=require(_0x5dbb('0x2'));var pkginfo=require(_0x5dbb('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var config=require(_0x5dbb('0x4'));var hardware=require('./hardware');var logger=require('../logger')(_0x5dbb('0x5'));var jira=require(_0x5dbb('0x6'));var HOST=_0x5dbb('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;function httpRequest(_0x2e68a1){return new BPromise(function(_0x42a212,_0x11d1c4){var _0xf5383e={'host':HOST,'port':0x1bb,'path':util[_0x5dbb('0x8')](_0x5dbb('0x9'),_0x2e68a1,module[_0x5dbb('0xa')][_0x5dbb('0xb')]),'method':_0x5dbb('0xc'),'timeout':0xea60,'headers':{'Content-Type':_0x5dbb('0xd')}};var _0x376cda=https['request'](_0xf5383e,function(_0x361ff8){_0x361ff8[_0x5dbb('0xe')](_0x5dbb('0xf'));var _0x45db2b='';_0x361ff8['on'](_0x5dbb('0x10'),function(_0x3d79fb){_0x45db2b+=_0x3d79fb;});_0x361ff8['on'](_0x5dbb('0x11'),function(){try{_0x42a212(JSON[_0x5dbb('0x12')](_0x45db2b));}catch(_0x3a8b85){_0x11d1c4(_0x3a8b85);}});});_0x376cda['on'](_0x5dbb('0x13'),_0x11d1c4);_0x376cda[_0x5dbb('0x11')]();});}function encryptDate(_0xf6ad0f){var _0x49980d=crypto[_0x5dbb('0x14')](_0x5dbb('0x15'),config[_0x5dbb('0x16')]['session']);var _0x4e803f=_0x49980d[_0x5dbb('0x17')](_0xf6ad0f,'utf8','base64');_0x4e803f+=_0x49980d[_0x5dbb('0x18')](_0x5dbb('0x19'));return _0x4e803f;}function decryptDate(_0x4939ef){var _0x1e7cac=crypto[_0x5dbb('0x1a')](_0x5dbb('0x15'),config[_0x5dbb('0x16')][_0x5dbb('0x1b')]);var _0xf4acf1=_0x1e7cac[_0x5dbb('0x17')](_0x4939ef,_0x5dbb('0x19'),_0x5dbb('0xf'));_0xf4acf1+=_0x1e7cac[_0x5dbb('0x18')](_0x5dbb('0xf'));return _0xf4acf1;}function sendJiraAlert(_0x2902c4,_0x582cca,_0x109f86){var _0x162c00='||FIELD||VALUE||\x0a';return db[_0x5dbb('0x1c')][_0x5dbb('0x1d')]({'where':{'role':_0x5dbb('0x1e')},'attributes':[_0x5dbb('0x1f'),_0x5dbb('0x20')],'raw':!![]})[_0x5dbb('0x21')](function(_0x4a49d3){ADMIN=_0x4a49d3;_0x162c00+=_0x5dbb('0x22')+_0x109f86+'|\x0a';_0x162c00+='|uuid|'+_0x2902c4+'|\x0a';_0x162c00+=_0x5dbb('0x23')+_0x582cca+'|\x0a';_0x162c00+='|name|'+ADMIN[_0x5dbb('0x1f')]+'|\x0a';_0x162c00+=_0x5dbb('0x24')+ADMIN[_0x5dbb('0x20')]+'|\x0a';return _0x162c00;})['then'](function(_0xeba07c){var _0x4b6445=hardware['getFirstInterface']()['ipAddress'];return jira[_0x5dbb('0x25')]({'key':_0x5dbb('0x26'),'summary':_0x5dbb('0x27'),'description':_0xeba07c,'issuetype':_0x5dbb('0x28'),'oldToken':_0x2902c4,'newToken':_0x582cca,'email':ADMIN[_0x5dbb('0x20')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x4b6445});});}function manageLicense(_0x866f89,_0x493e8f){var _0x41063c=_0x493e8f[_0x5dbb('0x29')]({'plain':!![]});httpRequest(_0x866f89)['then'](function(_0x2ec91d){if(_0x2ec91d[_0x5dbb('0x2a')]){if(!_0x41063c[_0x5dbb('0x5')]&&_0x41063c[_0x5dbb('0x5')]!=_0x2ec91d[_0x5dbb('0x5')]||_0x41063c['license']&&_0x41063c[_0x5dbb('0x2b')]){logger['info'](_0x5dbb('0x2c'));}if(_0x41063c['license']&&!_0x41063c[_0x5dbb('0x2b')]&&_0x41063c['license']!=_0x2ec91d[_0x5dbb('0x5')]){logger['info'](_0x5dbb('0x2d'));}if(_0x41063c[_0x5dbb('0x5')]&&!_0x41063c[_0x5dbb('0x2b')]&&_0x41063c[_0x5dbb('0x5')]==_0x2ec91d['license']){return _0x493e8f;}return _0x493e8f[_0x5dbb('0x17')]({'data1':_0x866f89,'data2':null,'license':_0x2ec91d['license']});}else{if(_0x2ec91d['license']||_0x41063c[_0x5dbb('0x5')]){if(!_0x41063c['data2']){if(_0x41063c[_0x5dbb('0x2e')]==_0x866f89){GRAY_PERIOD_REASON=_0x5dbb('0x2f');logger[_0x5dbb('0x30')](_0x5dbb('0x31'));}else{GRAY_PERIOD_REASON=_0x5dbb('0x32');logger[_0x5dbb('0x30')](_0x5dbb('0x33'),_0x41063c[_0x5dbb('0x2e')],_0x866f89);}sendJiraAlert(_0x41063c[_0x5dbb('0x2e')],_0x2ec91d[_0x5dbb('0x34')],GRAY_PERIOD_REASON);logger[_0x5dbb('0x30')](_0x5dbb('0x35'),GRAY_PERIOD_REASON[_0x5dbb('0x36')](),moment()['format'](_0x5dbb('0x37')));return _0x493e8f['update']({'data2':encryptDate(moment()[_0x5dbb('0x8')](_0x5dbb('0x37')))});}else{if(moment()[_0x5dbb('0x38')](decryptDate(_0x41063c[_0x5dbb('0x2b')]),_0x5dbb('0x39'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x5dbb('0x8')](_0x5dbb('0x37')));return _0x493e8f[_0x5dbb('0x17')]({'data1':_0x866f89,'data2':null,'license':null});}}}else{if(_0x41063c[_0x5dbb('0x2e')]!=_0x866f89){logger['info'](_0x5dbb('0x33'),_0x41063c[_0x5dbb('0x2e')],_0x866f89);return _0x493e8f[_0x5dbb('0x17')]({'data1':_0x866f89,'data2':null,'license':null});}}}return _0x493e8f;})[_0x5dbb('0x21')](function(_0x28f5c0){_0x493e8f=_0x28f5c0;})[_0x5dbb('0x3a')](function(_0x5f002f){logger[_0x5dbb('0x13')](_0x5f002f[_0x5dbb('0x3b')]);})[_0x5dbb('0x3c')](function(){setTimeout(function(){manageLicense(hardware[_0x5dbb('0x3d')](),_0x493e8f);},TIME);});}function defaultLicense(){var _0x511169=hardware[_0x5dbb('0x3d')]();if(_0x511169){return db[_0x5dbb('0x3e')][_0x5dbb('0x3f')]({'where':{'id':0x1},'defaults':{'data1':_0x511169}})[_0x5dbb('0x40')](function(_0xbb4fbb,_0x4aacff){logger[_0x5dbb('0x30')](_0x5dbb('0x41'),_0x511169);manageLicense(_0x511169,_0xbb4fbb);})['catch'](function(_0x49a7ec){logger['error'](_0x49a7ec['message']);});}}exports[_0x5dbb('0x42')]=defaultLicense;
\ No newline at end of file
index 09df303..1cf935d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef22=['moment','./hardware','../../mysqldb','license','License\x20key\x20value\x20not\x20found','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','parse','uuid','machineUuid','getUuid','secrets','utf8','final','gray','days','grayReason','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','getLicense','License','find','then','checkLicense','crypto','util','lodash'];(function(_0x92a3d9,_0xcf3970){var _0x56458b=function(_0x36a48c){while(--_0x36a48c){_0x92a3d9['push'](_0x92a3d9['shift']());}};_0x56458b(++_0xcf3970);}(_0xef22,0x1c4));var _0x2ef2=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xef22[_0x92c450];return _0x2a9599;};'use strict';var crypto=require(_0x2ef2('0x0'));var util=require(_0x2ef2('0x1'));var _=require(_0x2ef2('0x2'));var moment=require(_0x2ef2('0x3'));var hardware=require(_0x2ef2('0x4'));var config=require('../environment');var db=require(_0x2ef2('0x5'))['db'];function checkLicense(_0x3e0c97,_0x45050f){if(_0x3e0c97){try{var _0x282d3c=_0x45050f||_0x3e0c97[_0x2ef2('0x6')];if(_['isEmpty'](_0x282d3c)){throw new Error(_0x2ef2('0x7'));}var _0xe88f36=_0x3e0c97[_0x2ef2('0x8')];var _0x38257a=_0x3e0c97['data2'];var _0x2c4cb2=_0xe88f36[_0x2ef2('0x9')]('-')[0x4];var _0x361057=_0xe88f36[_0x2ef2('0x9')]('-')[0x0];var _0x112d8d=crypto[_0x2ef2('0xa')](_0x2ef2('0xb'),util[_0x2ef2('0xc')](_0x2ef2('0xd'),_0x2c4cb2,_0xe88f36,_0x361057));var _0x291eb2=_0x112d8d[_0x2ef2('0xe')](_0x282d3c,_0x2ef2('0xf'),'utf8');_0x291eb2+=_0x112d8d['final']('utf8');var _0x1887fe=JSON[_0x2ef2('0x10')](_0x291eb2);_0x1887fe['demo']=![];_0x1887fe[_0x2ef2('0x11')]=_0xe88f36;_0x1887fe[_0x2ef2('0x12')]=hardware[_0x2ef2('0x13')]();if(_0x38257a){var _0x433b7f=crypto[_0x2ef2('0xa')](_0x2ef2('0xb'),config[_0x2ef2('0x14')]['session']);var _0x2333f0=_0x433b7f[_0x2ef2('0xe')](_0x38257a,_0x2ef2('0xf'),_0x2ef2('0x15'));_0x2333f0+=_0x433b7f[_0x2ef2('0x16')]('utf8');_0x1887fe[_0x2ef2('0x17')]=_0x2333f0;_0x1887fe['deadline']=moment(_0x2333f0)['add'](0x7,_0x2ef2('0x18'))[_0x2ef2('0xc')]();_0x1887fe[_0x2ef2('0x19')]=_0x1887fe['uuid']!=_0x1887fe[_0x2ef2('0x12')]?'changed':_0x2ef2('0x1a');}return _0x1887fe;}catch(_0x4adf11){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2ef2('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2ef2('0x1c'),'uuid':_0x3e0c97[_0x2ef2('0x8')],'machineUuid':hardware[_0x2ef2('0x13')](),'message':_0x4adf11[_0x2ef2('0x1d')],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2ef2('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Demo\x20license','uuid':_0x3e0c97[_0x2ef2('0x8')],'machineUuid':hardware[_0x2ef2('0x13')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0x2ef2('0x1e')]=function(_0x3b2544){return db[_0x2ef2('0x1f')][_0x2ef2('0x20')](_['defaults'](_0x3b2544,{'raw':!![],'where':{'id':0x1}}))[_0x2ef2('0x21')](function(_0x3407a3){return checkLicense(_0x3407a3,null);});};exports[_0x2ef2('0x22')]=checkLicense;
\ No newline at end of file
+var _0xc9ea=['data1','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','defaults','checkLicense','lodash','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','secrets','session','gray','deadline','add','days','grayReason','changed','disabled','Breaking\x20license'];(function(_0x402a4b,_0x44be6c){var _0x3253ba=function(_0x27d198){while(--_0x27d198){_0x402a4b['push'](_0x402a4b['shift']());}};_0x3253ba(++_0x44be6c);}(_0xc9ea,0x184));var _0xac9e=function(_0xd2fb39,_0x1ebd8e){_0xd2fb39=_0xd2fb39-0x0;var _0x29bb1e=_0xc9ea[_0xd2fb39];return _0x29bb1e;};'use strict';var crypto=require('crypto');var util=require('util');var _=require(_0xac9e('0x0'));var moment=require(_0xac9e('0x1'));var hardware=require(_0xac9e('0x2'));var config=require('../environment');var db=require(_0xac9e('0x3'))['db'];function checkLicense(_0xcbbd83,_0x767d3c){if(_0xcbbd83){try{var _0x2911d3=_0x767d3c||_0xcbbd83[_0xac9e('0x4')];if(_[_0xac9e('0x5')](_0x2911d3)){throw new Error(_0xac9e('0x6'));}var _0x372fb5=_0xcbbd83['data1'];var _0x36e96a=_0xcbbd83['data2'];var _0x342fc6=_0x372fb5[_0xac9e('0x7')]('-')[0x4];var _0x342d2c=_0x372fb5[_0xac9e('0x7')]('-')[0x0];var _0x16318e=crypto[_0xac9e('0x8')](_0xac9e('0x9'),util[_0xac9e('0xa')]('%s:%s:%s',_0x342fc6,_0x372fb5,_0x342d2c));var _0x3fff72=_0x16318e[_0xac9e('0xb')](_0x2911d3,_0xac9e('0xc'),_0xac9e('0xd'));_0x3fff72+=_0x16318e[_0xac9e('0xe')](_0xac9e('0xd'));var _0x2c8c29=JSON[_0xac9e('0xf')](_0x3fff72);_0x2c8c29[_0xac9e('0x10')]=![];_0x2c8c29[_0xac9e('0x11')]=_0x372fb5;_0x2c8c29[_0xac9e('0x12')]=hardware[_0xac9e('0x13')]();if(_0x36e96a){var _0x511b27=crypto['createDecipher'](_0xac9e('0x9'),config[_0xac9e('0x14')][_0xac9e('0x15')]);var _0x1e1a3b=_0x511b27[_0xac9e('0xb')](_0x36e96a,_0xac9e('0xc'),_0xac9e('0xd'));_0x1e1a3b+=_0x511b27[_0xac9e('0xe')](_0xac9e('0xd'));_0x2c8c29[_0xac9e('0x16')]=_0x1e1a3b;_0x2c8c29[_0xac9e('0x17')]=moment(_0x1e1a3b)[_0xac9e('0x18')](0x7,_0xac9e('0x19'))[_0xac9e('0xa')]();_0x2c8c29[_0xac9e('0x1a')]=_0x2c8c29[_0xac9e('0x11')]!=_0x2c8c29[_0xac9e('0x12')]?_0xac9e('0x1b'):_0xac9e('0x1c');}return _0x2c8c29;}catch(_0x42ccec){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xac9e('0x1d'),'uuid':_0xcbbd83[_0xac9e('0x1e')],'machineUuid':hardware[_0xac9e('0x13')](),'message':_0x42ccec[_0xac9e('0x1f')],'virtual':0x0,'voice':!![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xac9e('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xac9e('0x21'),'uuid':_0xcbbd83['data1'],'machineUuid':hardware[_0xac9e('0x13')](),'virtual':0x0,'voice':!![],'preferred':![]};}exports[_0xac9e('0x22')]=function(_0xe6bf40){return db[_0xac9e('0x23')]['find'](_[_0xac9e('0x24')](_0xe6bf40,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x241cda){return checkLicense(_0x241cda,null);});};exports[_0xac9e('0x25')]=checkLicense;
\ No newline at end of file
index 15948cb..7b4b5ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40ca=['exports','app-id','secret'];(function(_0x21cd0c,_0x58ab7e){var _0x9348a2=function(_0x1d77d4){while(--_0x1d77d4){_0x21cd0c['push'](_0x21cd0c['shift']());}};_0x9348a2(++_0x58ab7e);}(_0x40ca,0x1a1));var _0xa40c=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x40ca[_0x2ec461];return _0x28603d;};'use strict';module[_0xa40c('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xa40c('0x1'),'GOOGLE_SECRET':_0xa40c('0x2'),'DEBUG':''};
\ No newline at end of file
+var _0x063c=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x575934,_0x4a6760){var _0x109a3d=function(_0x1c20a1){while(--_0x1c20a1){_0x575934['push'](_0x575934['shift']());}};_0x109a3d(++_0x4a6760);}(_0x063c,0xba));var _0xc063=function(_0x3cdea2,_0x2898b5){_0x3cdea2=_0x3cdea2-0x0;var _0x372b2b=_0x063c[_0x3cdea2];return _0x372b2b;};'use strict';module['exports']={'DOMAIN':_0xc063('0x0'),'SESSION_SECRET':_0xc063('0x1'),'GOOGLE_ID':_0xc063('0x2'),'GOOGLE_SECRET':_0xc063('0x3'),'DEBUG':''};
\ No newline at end of file
index d6c6e75..0fcf6fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc10d=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','File','error','%s-%s','info','transports','Console','env','debugLevel','moment','util','path','INFO','log','xcally','%s-%s.log','format'];(function(_0x25a143,_0x65db13){var _0x106e24=function(_0x4dae2d){while(--_0x4dae2d){_0x25a143['push'](_0x25a143['shift']());}};_0x106e24(++_0x65db13);}(_0xc10d,0x17f));var _0xdc10=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xc10d[_0x311c35];return _0x5cc50c;};'use strict';var moment=require(_0xdc10('0x0'));var winston=require('winston');var util=require(_0xdc10('0x1'));var path=require(_0xdc10('0x2'));var debugLevel=_0xdc10('0x3');function filename(_0x715e7c,_0x208398){return path['join']('/var',_0xdc10('0x4'),_0xdc10('0x5'),util['format'](_0xdc10('0x6'),_0x715e7c,_0x208398));}function formatter(_0x265ef9,_0xae071c){return util[_0xdc10('0x7')](_0xdc10('0x8'),moment()[_0xdc10('0x7')](_0xdc10('0x9')),_0xae071c[_0xdc10('0xa')][_0xdc10('0xb')](),_0x265ef9,_0xae071c[_0xdc10('0xc')]);}module[_0xdc10('0xd')]=function(_0x514ee2){return new winston[(_0xdc10('0xe'))]({'transports':[new winston['transports'][(_0xdc10('0xf'))]({'name':util['format']('%s-%s',_0x514ee2,_0xdc10('0x10')),'filename':filename(_0x514ee2,_0xdc10('0x10')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5537ae){return formatter(_0x514ee2,_0x5537ae);}}),new winston['transports']['File']({'name':util['format'](_0xdc10('0x11'),_0x514ee2,_0xdc10('0x12')),'filename':filename(_0x514ee2,_0xdc10('0x12')),'level':_0xdc10('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x479452){return formatter(_0x514ee2,_0x479452);}}),new winston[(_0xdc10('0x13'))][(_0xdc10('0x14'))]({'level':process[_0xdc10('0x15')][_0xdc10('0x16')]||debugLevel,'json':![],'formatter':function(_0x4128bd){return formatter(_0x514ee2,_0x4128bd);}})]});};
\ No newline at end of file
+var _0x7f29=['[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','exports','Logger','transports','error','File','%s-%s','info','debugLevel','winston','util','path','INFO','join','/var','log','xcally','%s-%s.log','format'];(function(_0x59085e,_0x2671a6){var _0xf17991=function(_0x25cd27){while(--_0x25cd27){_0x59085e['push'](_0x59085e['shift']());}};_0xf17991(++_0x2671a6);}(_0x7f29,0x12a));var _0x97f2=function(_0x3ca7a5,_0x189ee2){_0x3ca7a5=_0x3ca7a5-0x0;var _0x346822=_0x7f29[_0x3ca7a5];return _0x346822;};'use strict';var moment=require('moment');var winston=require(_0x97f2('0x0'));var util=require(_0x97f2('0x1'));var path=require(_0x97f2('0x2'));var debugLevel=_0x97f2('0x3');function filename(_0x1bce0f,_0x57cd26){return path[_0x97f2('0x4')](_0x97f2('0x5'),_0x97f2('0x6'),_0x97f2('0x7'),util['format'](_0x97f2('0x8'),_0x1bce0f,_0x57cd26));}function formatter(_0x511356,_0x27ee85){return util[_0x97f2('0x9')](_0x97f2('0xa'),moment()[_0x97f2('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),_0x27ee85[_0x97f2('0xb')][_0x97f2('0xc')](),_0x511356,_0x27ee85[_0x97f2('0xd')]);}module[_0x97f2('0xe')]=function(_0x2d2ac9){return new winston[(_0x97f2('0xf'))]({'transports':[new winston[(_0x97f2('0x10'))]['File']({'name':util[_0x97f2('0x9')]('%s-%s',_0x2d2ac9,_0x97f2('0x11')),'filename':filename(_0x2d2ac9,_0x97f2('0x11')),'level':_0x97f2('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x45353a){return formatter(_0x2d2ac9,_0x45353a);}}),new winston[(_0x97f2('0x10'))][(_0x97f2('0x12'))]({'name':util['format'](_0x97f2('0x13'),_0x2d2ac9,'info'),'filename':filename(_0x2d2ac9,'info'),'level':_0x97f2('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1a3dde){return formatter(_0x2d2ac9,_0x1a3dde);}}),new winston[(_0x97f2('0x10'))]['Console']({'level':process['env'][_0x97f2('0x15')]||debugLevel,'json':![],'formatter':function(_0x500298){return formatter(_0x2d2ac9,_0x500298);}})]});};
\ No newline at end of file
index 5d0c493..5eefb02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeee0=['../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','join','../../services/express/index.js','ami'];(function(_0x4a2532,_0x4161c3){var _0x20c394=function(_0x4376dc){while(--_0x4376dc){_0x4a2532['push'](_0x4a2532['shift']());}};_0x20c394(++_0x4161c3);}(_0xeee0,0x183));var _0x0eee=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0xeee0[_0xdf3db6];return _0x4b7a65;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x0eee('0x0')](__dirname,_0x0eee('0x1'))},{'name':_0x0eee('0x2'),'script':path[_0x0eee('0x0')](__dirname,_0x0eee('0x3'))},{'name':_0x0eee('0x4'),'script':path[_0x0eee('0x0')](__dirname,_0x0eee('0x5'))},{'name':'email','script':path[_0x0eee('0x0')](__dirname,_0x0eee('0x6'))},{'name':'routing','script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x0eee('0x7'),'script':path[_0x0eee('0x0')](__dirname,_0x0eee('0x8'))}]};module[_0x0eee('0x9')]=config;
\ No newline at end of file
+var _0xf595=['../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','join','../../services/express/index.js','ami'];(function(_0x2ed951,_0xb8d4e2){var _0x3497f2=function(_0x2cd7bd){while(--_0x2cd7bd){_0x2ed951['push'](_0x2ed951['shift']());}};_0x3497f2(++_0xb8d4e2);}(_0xf595,0x1cb));var _0x5f59=function(_0x2ed06f,_0x5b2875){_0x2ed06f=_0x2ed06f-0x0;var _0x4918c8=_0xf595[_0x2ed06f];return _0x4918c8;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x5f59('0x0')](__dirname,_0x5f59('0x1'))},{'name':_0x5f59('0x2'),'script':path[_0x5f59('0x0')](__dirname,_0x5f59('0x3'))},{'name':'agi','script':path[_0x5f59('0x0')](__dirname,_0x5f59('0x4'))},{'name':_0x5f59('0x5'),'script':path[_0x5f59('0x0')](__dirname,_0x5f59('0x6'))},{'name':'routing','script':path['join'](__dirname,_0x5f59('0x7'))},{'name':_0x5f59('0x8'),'script':path[_0x5f59('0x0')](__dirname,_0x5f59('0x9'))}]};module[_0x5f59('0xa')]=config;
\ No newline at end of file
index d8877e4..ea8b4b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['describe','delete','dump','saved','./config','connect','connected','then','start','disconnect','restart','list'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x49c4('0x0'));function connect(){return new BPromise(function(_0x18bf2d,_0x26844b){return pm2[_0x49c4('0x1')](function(_0x455700){if(_0x455700){return _0x26844b(_0x455700);}return _0x18bf2d(_0x49c4('0x2'));});});};exports['start']=function(_0x4941f1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x57effd,_0xc1278f){return pm2[_0x49c4('0x4')](_0x4941f1,function(_0x69bc41,_0x2c4e2e){if(_0x69bc41){return _0xc1278f(_0x69bc41);}pm2[_0x49c4('0x5')]();return _0x57effd(_0x2c4e2e);});});});};exports['stop']=function(_0x11c586){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1d13fb,_0x4487ca){return pm2['stop'](_0x11c586,function(_0x5ab4a3,_0x451ea6){if(_0x5ab4a3){return _0x4487ca(_0x5ab4a3);}pm2[_0x49c4('0x5')]();return _0x1d13fb(_0x451ea6);});});});};exports['restart']=function(_0xb611a1){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x4adb3c,_0x536d42){return pm2[_0x49c4('0x6')](_0xb611a1,function(_0x6d1b08,_0x5487cd){if(_0x6d1b08){return _0x536d42(_0x6d1b08);}pm2[_0x49c4('0x5')]();return _0x4adb3c(_0x5487cd);});});});};exports[_0x49c4('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1909fe,_0x280996){return pm2[_0x49c4('0x7')](function(_0x2decee,_0x12777c){if(_0x2decee){return _0x280996(_0x2decee);}pm2[_0x49c4('0x5')]();return _0x1909fe(_0x12777c);});});});};exports[_0x49c4('0x8')]=function(_0x3de397){return connect()['then'](function(){return new BPromise(function(_0x3acd06,_0x141003){return pm2[_0x49c4('0x8')](_0x3de397,function(_0x81e831,_0x2abc78){if(_0x81e831){return _0x141003(_0x81e831);}pm2['disconnect']();return _0x3acd06(_0x2abc78);});});});};exports[_0x49c4('0x9')]=function(_0x2891f4){return connect()['then'](function(){return new BPromise(function(_0x512650,_0x3c782d){return pm2[_0x49c4('0x9')](_0x2891f4,function(_0x3addb2,_0x59f29b){if(_0x3addb2){return _0x3c782d(_0x3addb2);}pm2[_0x49c4('0x5')]();return _0x512650(_0x59f29b);});});});};exports['dump']=function(){return connect()[_0x49c4('0x3')](function(){return new BPromise(function(_0x1806c2,_0xe31fcc){return pm2[_0x49c4('0xa')](function(_0x382040){if(_0x382040){return _0xe31fcc(_0x382040);}return _0x1806c2(_0x49c4('0xb'));});});});};
\ No newline at end of file
+var _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x6a9ab6,_0x4c96b8){var _0x30d4c5=function(_0x4cdaaf){while(--_0x4cdaaf){_0x6a9ab6['push'](_0x6a9ab6['shift']());}};_0x30d4c5(++_0x4c96b8);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f8a35,_0x496a73){_0x1f8a35=_0x1f8a35-0x0;var _0x3fe941=_0xedd9[_0x1f8a35];return _0x3fe941;};'use strict';var pm2=require('pm2');var BPromise=require(_0x9edd('0x0'));var config=require(_0x9edd('0x1'));function connect(){return new BPromise(function(_0x2af857,_0x2c16b8){return pm2[_0x9edd('0x2')](function(_0x127cbe){if(_0x127cbe){return _0x2c16b8(_0x127cbe);}return _0x2af857(_0x9edd('0x3'));});});};exports[_0x9edd('0x4')]=function(_0x5943b3){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x2cd163,_0x268f9e){return pm2[_0x9edd('0x4')](_0x5943b3,function(_0x5319f7,_0xf0b2d8){if(_0x5319f7){return _0x268f9e(_0x5319f7);}pm2['disconnect']();return _0x2cd163(_0xf0b2d8);});});});};exports[_0x9edd('0x6')]=function(_0x190185){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x3280fd,_0x49d5e3){return pm2[_0x9edd('0x6')](_0x190185,function(_0x5d2f90,_0x2076fc){if(_0x5d2f90){return _0x49d5e3(_0x5d2f90);}pm2[_0x9edd('0x7')]();return _0x3280fd(_0x2076fc);});});});};exports['restart']=function(_0xbf9da6){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x5b6c00,_0x30c0d7){return pm2[_0x9edd('0x8')](_0xbf9da6,function(_0x25e64c,_0xfd544a){if(_0x25e64c){return _0x30c0d7(_0x25e64c);}pm2[_0x9edd('0x7')]();return _0x5b6c00(_0xfd544a);});});});};exports[_0x9edd('0x9')]=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0xef5498,_0x47eb64){return pm2[_0x9edd('0x9')](function(_0x44fc7c,_0x891832){if(_0x44fc7c){return _0x47eb64(_0x44fc7c);}pm2[_0x9edd('0x7')]();return _0xef5498(_0x891832);});});});};exports[_0x9edd('0xa')]=function(_0x338f3c){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x75a4ab,_0x4ea60f){return pm2[_0x9edd('0xa')](_0x338f3c,function(_0x448996,_0x449cee){if(_0x448996){return _0x4ea60f(_0x448996);}pm2['disconnect']();return _0x75a4ab(_0x449cee);});});});};exports[_0x9edd('0xb')]=function(_0x35f454){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x4d8f33,_0x43dc70){return pm2['delete'](_0x35f454,function(_0x2cdcef,_0x1083e4){if(_0x2cdcef){return _0x43dc70(_0x2cdcef);}pm2['disconnect']();return _0x4d8f33(_0x1083e4);});});});};exports['dump']=function(){return connect()[_0x9edd('0x5')](function(){return new BPromise(function(_0x50338f,_0x27a95a){return pm2['dump'](function(_0x535f37){if(_0x535f37){return _0x27a95a(_0x535f37);}return _0x50338f(_0x9edd('0xc'));});});});};
\ No newline at end of file
index 0d6b65e..b37d970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x188e=['lastMsgAt','subtract','minutes','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','map','length','chatInteraction:update','catch','error','start','moment','ioredis','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll'];(function(_0x194d38,_0x3838eb){var _0x58b14f=function(_0x441b26){while(--_0x441b26){_0x194d38['push'](_0x194d38['shift']());}};_0x58b14f(++_0x3838eb);}(_0x188e,0x1cf));var _0xe188=function(_0x4c556c,_0x2c701f){_0x4c556c=_0x4c556c-0x0;var _0x53869b=_0x188e[_0x4c556c];return _0x53869b;};'use strict';var _=require('lodash');var moment=require(_0xe188('0x0'));var Redis=require(_0xe188('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xe188('0x2'));config[_0xe188('0x3')]=_[_0xe188('0x4')](config[_0xe188('0x3')],{'host':_0xe188('0x5'),'port':0x18eb});var io=require(_0xe188('0x6'))(new Redis(config[_0xe188('0x3')]));function closeInteractions(){var _0x4cdf2f=0x0;var _0xe15d9c=[];return db[_0xe188('0x7')][_0xe188('0x8')]({'raw':!![],'attributes':['id',_0xe188('0x9')],'where':{'id':0x1}})[_0xe188('0xa')](function(_0x3080f0){_0x4cdf2f=_0x3080f0[_0xe188('0x9')];if(_0x4cdf2f){return db['ChatInteraction'][_0xe188('0xb')]({'raw':!![],'attributes':['id',_0xe188('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe188('0xd')](_0x3080f0[_0xe188('0x9')],_0xe188('0xe'))}}});}else{return[];}})[_0xe188('0xa')](function(_0x38fdf1){_0xe15d9c=_0x38fdf1;if(_0x4cdf2f){return db['ChatInteraction'][_0xe188('0xf')]({'closeReason':_0xe188('0x10'),'disposition':_0xe188('0x11'),'closed':!![],'closedAt':moment()['format'](_0xe188('0x12'))},{'where':{'id':_[_0xe188('0x13')](_0xe15d9c||[],'id')}});}})[_0xe188('0xa')](function(_0x231bd5){for(var _0x300739=0x0;_0x300739<_0xe15d9c[_0xe188('0x14')];_0x300739++){io['emit'](_0xe188('0x15'),{'id':_0xe15d9c[_0x300739]['id'],'closed':!![]});}})[_0xe188('0x16')](function(_0x2c190a){console[_0xe188('0x17')](_0x2c190a);});}exports[_0xe188('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x5393=['YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','start','lodash','moment','../../config/environment','defaults','redis','localhost','socket.io-emitter','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','ChatInteraction','update','timeout','format'];(function(_0x1bf926,_0x2f4ac7){var _0x1f3737=function(_0x129744){while(--_0x129744){_0x1bf926['push'](_0x1bf926['shift']());}};_0x1f3737(++_0x2f4ac7);}(_0x5393,0x1b6));var _0x3539=function(_0x405b6c,_0x5f3fa2){_0x405b6c=_0x405b6c-0x0;var _0x3349a6=_0x5393[_0x405b6c];return _0x3349a6;};'use strict';var _=require(_0x3539('0x0'));var moment=require(_0x3539('0x1'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0x3539('0x2'));config['redis']=_[_0x3539('0x3')](config[_0x3539('0x4')],{'host':_0x3539('0x5'),'port':0x18eb});var io=require(_0x3539('0x6'))(new Redis(config[_0x3539('0x4')]));function closeInteractions(){var _0x38b91b=0x0;var _0x5c2e3e=[];return db['Setting'][_0x3539('0x7')]({'raw':!![],'attributes':['id',_0x3539('0x8')],'where':{'id':0x1}})[_0x3539('0x9')](function(_0x50cca8){_0x38b91b=_0x50cca8[_0x3539('0x8')];if(_0x38b91b){return db['ChatInteraction'][_0x3539('0xa')]({'raw':!![],'attributes':['id',_0x3539('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3539('0xc')](_0x50cca8['chatTimeout'],_0x3539('0xd'))}}});}else{return[];}})[_0x3539('0x9')](function(_0x483ba0){_0x5c2e3e=_0x483ba0;if(_0x38b91b){return db[_0x3539('0xe')][_0x3539('0xf')]({'closeReason':'system','disposition':_0x3539('0x10'),'closed':!![],'closedAt':moment()[_0x3539('0x11')](_0x3539('0x12'))},{'where':{'id':_[_0x3539('0x13')](_0x5c2e3e||[],'id')}});}})[_0x3539('0x9')](function(_0x5b056b){for(var _0x8d7d28=0x0;_0x8d7d28<_0x5c2e3e[_0x3539('0x14')];_0x8d7d28++){io[_0x3539('0x15')]('chatInteraction:update',{'id':_0x5c2e3e[_0x8d7d28]['id'],'closed':!![]});}})[_0x3539('0x16')](function(_0x48c836){console['error'](_0x48c836);});}exports[_0x3539('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index b74eaa8..2146a31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa849=['update','update\x20cron','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','join','savename','%s.%s','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','stringify','email\x20sent','catch','error\x20mail','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','toString','keyBy','difference','intersection','length','exists','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','endAt','add','add\x20cron','stop','deleteJob','stop\x20cron','isBetween','startAt'];(function(_0x518e12,_0x3491ad){var _0x1da7ff=function(_0x528771){while(--_0x528771){_0x518e12['push'](_0x518e12['shift']());}};_0x1da7ff(++_0x3491ad);}(_0xa849,0x64));var _0x9a84=function(_0x3354d5,_0x203e02){_0x3354d5=_0x3354d5-0x0;var _0x35b6ae=_0xa849[_0x3354d5];return _0x35b6ae;};'use strict';var fs=require('fs');var util=require(_0x9a84('0x0'));var path=require(_0x9a84('0x1'));var _=require(_0x9a84('0x2'));var moment=require(_0x9a84('0x3'));var CronJobManager=require(_0x9a84('0x4'));var jayson=require(_0x9a84('0x5'));var BPromise=require(_0x9a84('0x6'));var logger=require(_0x9a84('0x7'))(_0x9a84('0x8'));var db=require(_0x9a84('0x9'))['db'];var analyticCustomReportController=require(_0x9a84('0xa'));var analyticDefaultReportController=require(_0x9a84('0xb'));var client=jayson[_0x9a84('0xc')][_0x9a84('0xd')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x433b56,_0x866976){return function(){logger[_0x9a84('0xe')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x433b56[_0x9a84('0xf')]);var _0x472d1c=!![];var _0xd06235={'tls':{'rejectUnauthorized':![]}};if(_0x433b56[_0x9a84('0x10')][_0x9a84('0x11')][_0x9a84('0x12')]){_0xd06235[_0x9a84('0x12')]=_0x433b56['MailAccount'][_0x9a84('0x11')][_0x9a84('0x12')];}else{_0xd06235['host']=_0x433b56['MailAccount']['Smtp'][_0x9a84('0x13')];_0xd06235[_0x9a84('0x14')]=_0x433b56[_0x9a84('0x10')][_0x9a84('0x11')]['port'];_0xd06235['secure']=_0x433b56[_0x9a84('0x10')][_0x9a84('0x11')][_0x9a84('0x15')];}if(_0x433b56[_0x9a84('0x10')]['Smtp'][_0x9a84('0x16')]){_0xd06235[_0x9a84('0x17')]={'user':_0x433b56['MailAccount']['Smtp'][_0x9a84('0x18')],'pass':_0x433b56[_0x9a84('0x10')][_0x9a84('0x11')][_0x9a84('0x19')]};}var _0xcbeb73={'account':_0xd06235,'message':{'from':util[_0x9a84('0x1a')](_0x9a84('0x1b'),_0x433b56['MailAccount']['name'],_0x433b56['MailAccount']['email']||_0x433b56[_0x9a84('0x10')][_0x9a84('0x11')]['user']),'to':_0x433b56[_0x9a84('0xf')],'cc':_0x433b56['cc'],'bcc':_0x433b56[_0x9a84('0x1c')],'subject':util['format'](_0x9a84('0x1d'),_0x866976[_0x9a84('0x1e')],_0x433b56[_0x9a84('0x1f')],_0x433b56['subtractUnit'])}};var _0x4c43b9=path[_0x9a84('0x20')](__dirname,'../../files/reports');var _0x12103a=_0x866976[_0x9a84('0x21')];var _0x288445=util['format'](_0x9a84('0x22'),path['basename'](_0x866976[_0x9a84('0x21')],path[_0x9a84('0x23')](_0x866976[_0x9a84('0x21')])),_0x9a84('0x24'));var _0x47e44b=path['join'](_0x4c43b9,_0x12103a);var _0xc9e710=path[_0x9a84('0x20')](_0x4c43b9,_0x288445);if(fs[_0x9a84('0x25')](_0x47e44b)){_0x866976[_0x9a84('0x26')]=_0x9a84('0x27');_0xcbeb73[_0x9a84('0x28')][_0x9a84('0x29')]=[{'filename':_0x12103a,'path':_0x47e44b}];_0xcbeb73[_0x9a84('0x28')][_0x9a84('0x2a')]=util['format'](_0x9a84('0x2b'),JSON['stringify'](_0x866976,null,0x2));}else if(fs['existsSync'](_0xc9e710)){_0x866976[_0x9a84('0x26')]=_0x9a84('0x27');_0xcbeb73[_0x9a84('0x28')][_0x9a84('0x29')]=[{'filename':_0x288445,'path':_0xc9e710}];}else{_0xcbeb73[_0x9a84('0x28')]['text']=_0x9a84('0x2c');if(!_0x433b56[_0x9a84('0x2d')]){_0x472d1c=![];logger['info'](_0x9a84('0x2e'));}}if(_0x472d1c){return client[_0x9a84('0x2f')](_0x9a84('0x30'),_0xcbeb73)[_0x9a84('0x31')](function(_0x575461){if(_0x575461[_0x9a84('0x32')]){return logger[_0x9a84('0x32')]('error\x20mail',JSON[_0x9a84('0x33')](_0x575461));}return logger[_0x9a84('0xe')](_0x9a84('0x34'));})[_0x9a84('0x35')](function(_0x109b84){return logger['error'](_0x9a84('0x36'),JSON[_0x9a84('0x33')](_0x109b84));});}};}function handleError(){return function(_0x90e08c){return logger[_0x9a84('0x32')](JSON['stringify'](_0x90e08c));};}function handleResult(_0x583032){return function(_0x1a1532){logger[_0x9a84('0xe')]('data',JSON['stringify'](_0x1a1532));if(_0x583032[_0x9a84('0x10')]&&_0x583032[_0x9a84('0x10')][_0x9a84('0x11')]&&!_[_0x9a84('0x37')](_0x583032['email'])){setTimeout(handleSendEmail(_0x583032,_0x1a1532),0x3c*0x3e8);}};}function handleJob(_0x2a0117){return function(){try{if(_[_0x9a84('0x37')](_0x2a0117['subtractNumber'])){return logger[_0x9a84('0xe')](_0x9a84('0x38'));}if(_[_0x9a84('0x37')](_0x2a0117[_0x9a84('0x39')])){return logger[_0x9a84('0xe')](_0x9a84('0x3a'));}var _0x18d262={'startDate':moment()['subtract'](_0x2a0117[_0x9a84('0x1f')],_0x2a0117[_0x9a84('0x39')])[_0x9a84('0x1a')](_0x9a84('0x3b')),'endDate':moment()[_0x9a84('0x1a')](_0x9a84('0x3b')),'type':_0x9a84('0x3c'),'output':_0x2a0117[_0x9a84('0x3d')],'name':_0x2a0117['name']};if(!_[_0x9a84('0x37')](_0x2a0117['DefaultReportId'])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x2a0117[_0x9a84('0x3e')]);return analyticDefaultReportController['runReport']({'id':_0x2a0117[_0x9a84('0x3e')]},_0x18d262)[_0x9a84('0x31')](handleResult(_0x2a0117))[_0x9a84('0x35')](handleError());}if(!_[_0x9a84('0x37')](_0x2a0117[_0x9a84('0x3f')])){logger['info'](_0x9a84('0x40'),_0x2a0117[_0x9a84('0x3f')]);return analyticCustomReportController[_0x9a84('0x41')]({'id':_0x2a0117[_0x9a84('0x3f')]},_0x18d262)[_0x9a84('0x31')](handleResult(_0x2a0117))[_0x9a84('0x35')](handleError());}}catch(_0x417586){logger[_0x9a84('0x32')](JSON[_0x9a84('0x33')](_0x417586));}return logger[_0x9a84('0xe')](_0x9a84('0x42'));};}function getJobs(_0x11e77a){var _0x18a5e1={};if(_0x11e77a){_0x18a5e1['id']=_0x11e77a;}return db[_0x9a84('0x43')][_0x9a84('0x44')]({'where':_0x18a5e1,'include':[{'model':db[_0x9a84('0x10')],'attributes':['id',_0x9a84('0x1e'),_0x9a84('0xf')],'include':[{'model':db[_0x9a84('0x45')],'as':_0x9a84('0x11')}]}]})[_0x9a84('0x31')](function(_0x3fce37){var _0x5c32d2=_[_0x9a84('0x46')](manager[_0x9a84('0x47')]);var _0x2fde53=_['map'](_0x3fce37,function(_0x4b12f2){return _0x4b12f2['id'][_0x9a84('0x48')]();});var _0x2c5946=_[_0x9a84('0x49')](_0x3fce37,function(_0x126c88){return _0x126c88['id'][_0x9a84('0x48')]();});var _0x4fbb1e=_0x11e77a?_0x2fde53:_[_0x9a84('0x4a')](_0x2fde53,_0x5c32d2);var _0x3ed204=_[_0x9a84('0x4b')](_0x2fde53,_0x5c32d2);var _0x509776=_['difference'](_0x5c32d2,_0x2fde53);var _0x3ed7c5;var _0x21fa4a;for(_0x3ed7c5=0x0;_0x3ed7c5<_0x509776[_0x9a84('0x4c')]&&!_0x11e77a;_0x3ed7c5+=0x1){_0x21fa4a=_0x509776[_0x3ed7c5][_0x9a84('0x48')]();if(manager[_0x9a84('0x4d')](_0x21fa4a)){manager['stop'](_0x21fa4a);manager['deleteJob'](_0x21fa4a);logger[_0x9a84('0xe')](_0x9a84('0x4e'),_0x21fa4a);}}logger[_0x9a84('0xe')](_0x9a84('0x4f'),JSON['stringify'](_0x4fbb1e));for(_0x3ed7c5=0x0;_0x3ed7c5<_0x4fbb1e['length'];_0x3ed7c5+=0x1){_0x21fa4a=_0x4fbb1e[_0x3ed7c5][_0x9a84('0x48')]();logger[_0x9a84('0xe')](_0x9a84('0x50'),_0x21fa4a);if(_0x11e77a){logger[_0x9a84('0xe')](_0x9a84('0x51'),_0x11e77a);logger[_0x9a84('0xe')](JSON[_0x9a84('0x33')](_0x2c5946[_0x21fa4a]));BPromise[_0x9a84('0x52')]()[_0x9a84('0x31')](handleJob(_0x2c5946[_0x21fa4a]));logger[_0x9a84('0xe')](_0x9a84('0x53'),_0x2c5946[_0x21fa4a][_0x9a84('0x1e')],_0x2c5946[_0x21fa4a][_0x9a84('0x54')]);}else if(_0x2c5946[_0x21fa4a]['cron']&&_0x2c5946[_0x21fa4a][_0x9a84('0x55')]&&moment()['isBetween'](_0x2c5946[_0x21fa4a]['startAt'],_0x2c5946[_0x21fa4a][_0x9a84('0x56')])){manager[_0x9a84('0x57')](_0x21fa4a,_0x2c5946[_0x21fa4a]['cron'],handleJob(_0x2c5946[_0x21fa4a]));manager['start'](_0x21fa4a);logger[_0x9a84('0xe')](_0x9a84('0x58'),_0x2c5946[_0x21fa4a]['name'],_0x2c5946[_0x21fa4a][_0x9a84('0x54')]);}else if(manager['exists'](_0x21fa4a)){manager[_0x9a84('0x59')](_0x21fa4a);manager[_0x9a84('0x5a')](_0x21fa4a);logger[_0x9a84('0xe')](_0x9a84('0x5b'),_0x2c5946[_0x21fa4a][_0x9a84('0x1e')],_0x2c5946[_0x21fa4a][_0x9a84('0x54')]);}}for(_0x3ed7c5=0x0,_0x21fa4a;_0x3ed7c5<_0x3ed204[_0x9a84('0x4c')]&&!_0x11e77a;_0x3ed7c5+=0x1){_0x21fa4a=_0x3ed204[_0x3ed7c5]['toString']();if(manager[_0x9a84('0x4d')](_0x21fa4a)){if(_0x2c5946[_0x21fa4a]['cron']&&_0x2c5946[_0x21fa4a][_0x9a84('0x55')]&&moment()[_0x9a84('0x5c')](_0x2c5946[_0x21fa4a][_0x9a84('0x5d')],_0x2c5946[_0x21fa4a][_0x9a84('0x56')])){manager[_0x9a84('0x5e')](_0x21fa4a,_0x2c5946[_0x21fa4a][_0x9a84('0x54')],handleJob(_0x2c5946[_0x21fa4a]));logger[_0x9a84('0xe')](_0x9a84('0x5f'),_0x2c5946[_0x21fa4a][_0x9a84('0x1e')],_0x2c5946[_0x21fa4a]['cron']);}else{manager[_0x9a84('0x59')](_0x21fa4a);manager[_0x9a84('0x5a')](_0x21fa4a);logger[_0x9a84('0xe')](_0x9a84('0x5b'),_0x2c5946[_0x21fa4a][_0x9a84('0x1e')],_0x2c5946[_0x21fa4a][_0x9a84('0x54')]);}}}})[_0x9a84('0x35')](function(_0x138dd6){logger[_0x9a84('0x32')](JSON[_0x9a84('0x33')](_0x138dd6));});}exports['run']=function(_0xf56dca){return getJobs(_0xf56dca);};exports[_0x9a84('0x60')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x2c35=['pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','savename','basename','extname','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','error','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','startAt','endAt','add','start','add\x20cron','stop\x20cron','active','isBetween','update','update\x20cron','run','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','host','port','MailAccount','secure','auth'];(function(_0x47c958,_0x3cfe09){var _0x573eab=function(_0x380ec6){while(--_0x380ec6){_0x47c958['push'](_0x47c958['shift']());}};_0x573eab(++_0x3cfe09);}(_0x2c35,0x15f));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x52c3('0x0'));var _=require(_0x52c3('0x1'));var moment=require(_0x52c3('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x52c3('0x3'));var BPromise=require(_0x52c3('0x4'));var logger=require(_0x52c3('0x5'))(_0x52c3('0x6'));var db=require(_0x52c3('0x7'))['db'];var analyticCustomReportController=require(_0x52c3('0x8'));var analyticDefaultReportController=require(_0x52c3('0x9'));var client=jayson[_0x52c3('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x55040e,_0x23d6ae){return function(){logger[_0x52c3('0xb')](_0x52c3('0xc'),_0x55040e[_0x52c3('0xd')]);var _0x243190=!![];var _0x43616b={'tls':{'rejectUnauthorized':![]}};if(_0x55040e['MailAccount'][_0x52c3('0xe')][_0x52c3('0xf')]){_0x43616b[_0x52c3('0xf')]=_0x55040e['MailAccount'][_0x52c3('0xe')]['service'];}else{_0x43616b[_0x52c3('0x10')]=_0x55040e['MailAccount'][_0x52c3('0xe')][_0x52c3('0x10')];_0x43616b[_0x52c3('0x11')]=_0x55040e[_0x52c3('0x12')]['Smtp'][_0x52c3('0x11')];_0x43616b[_0x52c3('0x13')]=_0x55040e[_0x52c3('0x12')]['Smtp']['secure'];}if(_0x55040e[_0x52c3('0x12')][_0x52c3('0xe')]['authentication']){_0x43616b[_0x52c3('0x14')]={'user':_0x55040e[_0x52c3('0x12')]['Smtp']['user'],'pass':_0x55040e[_0x52c3('0x12')]['Smtp'][_0x52c3('0x15')]};}var _0xb9e768={'account':_0x43616b,'message':{'from':util[_0x52c3('0x16')](_0x52c3('0x17'),_0x55040e['MailAccount'][_0x52c3('0x18')],_0x55040e[_0x52c3('0x12')][_0x52c3('0xd')]||_0x55040e['MailAccount'][_0x52c3('0xe')][_0x52c3('0x19')]),'to':_0x55040e[_0x52c3('0xd')],'cc':_0x55040e['cc'],'bcc':_0x55040e[_0x52c3('0x1a')],'subject':util[_0x52c3('0x16')](_0x52c3('0x1b'),_0x23d6ae[_0x52c3('0x18')],_0x55040e[_0x52c3('0x1c')],_0x55040e[_0x52c3('0x1d')])}};var _0x4fce23=path['join'](__dirname,'../../files/reports');var _0x22142c=_0x23d6ae[_0x52c3('0x1e')];var _0x56978f=util[_0x52c3('0x16')]('%s.%s',path[_0x52c3('0x1f')](_0x23d6ae['savename'],path[_0x52c3('0x20')](_0x23d6ae[_0x52c3('0x1e')])),'zip');var _0x315197=path[_0x52c3('0x21')](_0x4fce23,_0x22142c);var _0x1c4863=path[_0x52c3('0x21')](_0x4fce23,_0x56978f);if(fs[_0x52c3('0x22')](_0x315197)){_0x23d6ae[_0x52c3('0x23')]=_0x52c3('0x24');_0xb9e768[_0x52c3('0x25')][_0x52c3('0x26')]=[{'filename':_0x22142c,'path':_0x315197}];_0xb9e768['message'][_0x52c3('0x27')]=util[_0x52c3('0x16')](_0x52c3('0x28'),JSON['stringify'](_0x23d6ae,null,0x2));}else if(fs['existsSync'](_0x1c4863)){_0x23d6ae['status']=_0x52c3('0x24');_0xb9e768['message']['attachments']=[{'filename':_0x56978f,'path':_0x1c4863}];}else{_0xb9e768[_0x52c3('0x25')][_0x52c3('0x27')]=_0x52c3('0x29');if(!_0x55040e[_0x52c3('0x2a')]){_0x243190=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x243190){return client[_0x52c3('0x2b')](_0x52c3('0x2c'),_0xb9e768)['then'](function(_0x283734){if(_0x283734['error']){return logger[_0x52c3('0x2d')]('error\x20mail',JSON[_0x52c3('0x2e')](_0x283734));}return logger[_0x52c3('0xb')]('email\x20sent');})[_0x52c3('0x2f')](function(_0x554812){return logger[_0x52c3('0x2d')]('error\x20mail',JSON[_0x52c3('0x2e')](_0x554812));});}};}function handleError(){return function(_0x395ae0){return logger[_0x52c3('0x2d')](JSON[_0x52c3('0x2e')](_0x395ae0));};}function handleResult(_0x503184){return function(_0x36f069){logger['info'](_0x52c3('0x30'),JSON['stringify'](_0x36f069));if(_0x503184[_0x52c3('0x12')]&&_0x503184[_0x52c3('0x12')][_0x52c3('0xe')]&&!_[_0x52c3('0x31')](_0x503184[_0x52c3('0xd')])){setTimeout(handleSendEmail(_0x503184,_0x36f069),0x3c*0x3e8);}};}function handleJob(_0x17b6da){return function(){try{if(_[_0x52c3('0x31')](_0x17b6da[_0x52c3('0x1c')])){return logger[_0x52c3('0xb')](_0x52c3('0x32'));}if(_[_0x52c3('0x31')](_0x17b6da['subtractUnit'])){return logger[_0x52c3('0xb')](_0x52c3('0x33'));}var _0x35dd45={'startDate':moment()[_0x52c3('0x34')](_0x17b6da['subtractNumber'],_0x17b6da['subtractUnit'])[_0x52c3('0x16')](_0x52c3('0x35')),'endDate':moment()[_0x52c3('0x16')](_0x52c3('0x35')),'type':_0x52c3('0x36'),'output':_0x17b6da[_0x52c3('0x37')],'name':_0x17b6da['name']};if(!_[_0x52c3('0x31')](_0x17b6da[_0x52c3('0x38')])){logger[_0x52c3('0xb')](_0x52c3('0x39'),_0x17b6da[_0x52c3('0x38')]);return analyticDefaultReportController[_0x52c3('0x3a')]({'id':_0x17b6da['DefaultReportId']},_0x35dd45)[_0x52c3('0x3b')](handleResult(_0x17b6da))['catch'](handleError());}if(!_['isNil'](_0x17b6da[_0x52c3('0x3c')])){logger[_0x52c3('0xb')]('exec\x20custom\x20report\x20id:%s',_0x17b6da[_0x52c3('0x3c')]);return analyticCustomReportController[_0x52c3('0x3a')]({'id':_0x17b6da[_0x52c3('0x3c')]},_0x35dd45)[_0x52c3('0x3b')](handleResult(_0x17b6da))[_0x52c3('0x2f')](handleError());}}catch(_0x1c7088){logger[_0x52c3('0x2d')](JSON[_0x52c3('0x2e')](_0x1c7088));}return logger['info'](_0x52c3('0x3d'));};}function getJobs(_0x52f734){var _0x58466a={};if(_0x52f734){_0x58466a['id']=_0x52f734;}return db[_0x52c3('0x3e')][_0x52c3('0x3f')]({'where':_0x58466a,'include':[{'model':db[_0x52c3('0x12')],'attributes':['id',_0x52c3('0x18'),_0x52c3('0xd')],'include':[{'model':db[_0x52c3('0x40')],'as':_0x52c3('0xe')}]}]})[_0x52c3('0x3b')](function(_0x1d75c0){var _0x166322=_[_0x52c3('0x41')](manager[_0x52c3('0x42')]);var _0x2ce553=_[_0x52c3('0x43')](_0x1d75c0,function(_0x19bbbc){return _0x19bbbc['id'][_0x52c3('0x44')]();});var _0x50d977=_['keyBy'](_0x1d75c0,function(_0xbdd6ef){return _0xbdd6ef['id'][_0x52c3('0x44')]();});var _0x105689=_0x52f734?_0x2ce553:_[_0x52c3('0x45')](_0x2ce553,_0x166322);var _0x39604b=_[_0x52c3('0x46')](_0x2ce553,_0x166322);var _0x11ba7b=_['difference'](_0x166322,_0x2ce553);var _0x500627;var _0x34028e;for(_0x500627=0x0;_0x500627<_0x11ba7b['length']&&!_0x52f734;_0x500627+=0x1){_0x34028e=_0x11ba7b[_0x500627][_0x52c3('0x44')]();if(manager[_0x52c3('0x47')](_0x34028e)){manager[_0x52c3('0x48')](_0x34028e);manager[_0x52c3('0x49')](_0x34028e);logger[_0x52c3('0xb')](_0x52c3('0x4a'),_0x34028e);}}logger[_0x52c3('0xb')](_0x52c3('0x4b'),JSON[_0x52c3('0x2e')](_0x105689));for(_0x500627=0x0;_0x500627<_0x105689[_0x52c3('0x4c')];_0x500627+=0x1){_0x34028e=_0x105689[_0x500627][_0x52c3('0x44')]();logger[_0x52c3('0xb')](_0x52c3('0x4d'),_0x34028e);if(_0x52f734){logger[_0x52c3('0xb')](_0x52c3('0x4e'),_0x52f734);logger[_0x52c3('0xb')](JSON[_0x52c3('0x2e')](_0x50d977[_0x34028e]));BPromise[_0x52c3('0x4f')]()['then'](handleJob(_0x50d977[_0x34028e]));logger[_0x52c3('0xb')](_0x52c3('0x50'),_0x50d977[_0x34028e][_0x52c3('0x18')],_0x50d977[_0x34028e][_0x52c3('0x51')]);}else if(_0x50d977[_0x34028e][_0x52c3('0x51')]&&_0x50d977[_0x34028e]['active']&&moment()['isBetween'](_0x50d977[_0x34028e][_0x52c3('0x52')],_0x50d977[_0x34028e][_0x52c3('0x53')])){manager[_0x52c3('0x54')](_0x34028e,_0x50d977[_0x34028e]['cron'],handleJob(_0x50d977[_0x34028e]));manager[_0x52c3('0x55')](_0x34028e);logger[_0x52c3('0xb')](_0x52c3('0x56'),_0x50d977[_0x34028e][_0x52c3('0x18')],_0x50d977[_0x34028e]['cron']);}else if(manager['exists'](_0x34028e)){manager[_0x52c3('0x48')](_0x34028e);manager[_0x52c3('0x49')](_0x34028e);logger[_0x52c3('0xb')](_0x52c3('0x57'),_0x50d977[_0x34028e][_0x52c3('0x18')],_0x50d977[_0x34028e][_0x52c3('0x51')]);}}for(_0x500627=0x0,_0x34028e;_0x500627<_0x39604b[_0x52c3('0x4c')]&&!_0x52f734;_0x500627+=0x1){_0x34028e=_0x39604b[_0x500627]['toString']();if(manager['exists'](_0x34028e)){if(_0x50d977[_0x34028e][_0x52c3('0x51')]&&_0x50d977[_0x34028e][_0x52c3('0x58')]&&moment()[_0x52c3('0x59')](_0x50d977[_0x34028e][_0x52c3('0x52')],_0x50d977[_0x34028e][_0x52c3('0x53')])){manager[_0x52c3('0x5a')](_0x34028e,_0x50d977[_0x34028e]['cron'],handleJob(_0x50d977[_0x34028e]));logger[_0x52c3('0xb')](_0x52c3('0x5b'),_0x50d977[_0x34028e][_0x52c3('0x18')],_0x50d977[_0x34028e]['cron']);}else{manager['stop'](_0x34028e);manager['deleteJob'](_0x34028e);logger[_0x52c3('0xb')](_0x52c3('0x57'),_0x50d977[_0x34028e][_0x52c3('0x18')],_0x50d977[_0x34028e][_0x52c3('0x51')]);}}}})[_0x52c3('0x2f')](function(_0x3af0e8){logger[_0x52c3('0x2d')](JSON[_0x52c3('0x2e')](_0x3af0e8));});}exports[_0x52c3('0x5c')]=function(_0x1d3c12){return getJobs(_0x1d3c12);};exports[_0x52c3('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 9deebd2..a1e5ef8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4e6=['then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy'];(function(_0x5288b6,_0x429b55){var _0x233c12=function(_0x500328){while(--_0x500328){_0x5288b6['push'](_0x5288b6['shift']());}};_0x233c12(++_0x429b55);}(_0xf4e6,0x160));var _0x6f4e=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xf4e6[_0x5f1391];return _0x50ebe3;};'use strict';var util=require('util');var db=require(_0x6f4e('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x6f4e('0x1')+i,'lastName':_0x6f4e('0x2')+i,'phone':0xf879fb460+i,'email':_0x6f4e('0x3')+i+_0x6f4e('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6f4e('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x6f4e('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6f4e('0x6')](),'updatedAt':Date[_0x6f4e('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6f4e('0x5')]({'id':i,'firstName':_0x6f4e('0x1')+i,'lastName':_0x6f4e('0x2')+i,'phone':0xf879fb460+i,'email':_0x6f4e('0x3')+i+_0x6f4e('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x6f4e('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6f4e('0x6')](),'updatedAt':Date['now']()});}db[_0x6f4e('0x7')][_0x6f4e('0x8')]({'where':{}})[_0x6f4e('0x9')](function(){return db[_0x6f4e('0x7')][_0x6f4e('0xa')](contacts);})[_0x6f4e('0x9')](function(){console[_0x6f4e('0xb')](_0x6f4e('0xc'),_0x6f4e('0xd'));return db[_0x6f4e('0xe')][_0x6f4e('0x8')]({'where':{}});})[_0x6f4e('0x9')](function(){return db[_0x6f4e('0xe')][_0x6f4e('0xa')](hopper);})[_0x6f4e('0x9')](function(){console[_0x6f4e('0xb')](_0x6f4e('0xc'),_0x6f4e('0xf'));return db['CmContact'][_0x6f4e('0xa')](contacts2);})[_0x6f4e('0x9')](function(){console['log']('finished\x20populating',_0x6f4e('0x10'));return db[_0x6f4e('0xe')][_0x6f4e('0xa')](hopper2);})[_0x6f4e('0x9')](function(){console[_0x6f4e('0xb')](_0x6f4e('0xc'),_0x6f4e('0x11'));})[_0x6f4e('0x12')](function(_0x43e813){console['log'](_0x43e813);});
\ No newline at end of file
+var _0x6349=['destroy','bulkCreate','then','log','CmHopper','finished\x20populating','hopper1','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact'];(function(_0xe084ee,_0xc40f0b){var _0x18c11b=function(_0x11dc21){while(--_0x11dc21){_0xe084ee['push'](_0xe084ee['shift']());}};_0x18c11b(++_0xc40f0b);}(_0x6349,0x99));var _0x9634=function(_0x53537c,_0xc2178f){_0x53537c=_0x53537c-0x0;var _0x3feb3e=_0x6349[_0x53537c];return _0x3feb3e;};'use strict';var util=require(_0x9634('0x0'));var db=require(_0x9634('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9634('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9634('0x3')+i,'phone':0xf879fb460+i,'email':_0x9634('0x4')+i+_0x9634('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x9634('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9634('0x2')]({'id':i,'firstName':_0x9634('0x7')+i,'lastName':_0x9634('0x3')+i,'phone':0xf879fb460+i,'email':_0x9634('0x4')+i+_0x9634('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9634('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x9634('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9634('0x6')](),'updatedAt':Date['now']()});}db[_0x9634('0x8')][_0x9634('0x9')]({'where':{}})['then'](function(){return db[_0x9634('0x8')][_0x9634('0xa')](contacts);})[_0x9634('0xb')](function(){console[_0x9634('0xc')]('finished\x20populating','contacts1');return db[_0x9634('0xd')]['destroy']({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})['then'](function(){console[_0x9634('0xc')](_0x9634('0xe'),_0x9634('0xf'));return db[_0x9634('0x8')]['bulkCreate'](contacts2);})[_0x9634('0xb')](function(){console['log'](_0x9634('0xe'),'contacts2');return db['CmHopper'][_0x9634('0xa')](hopper2);})[_0x9634('0xb')](function(){console['log']('finished\x20populating',_0x9634('0x10'));})[_0x9634('0x11')](function(_0x5d3c17){console[_0x9634('0xc')](_0x5d3c17);});
\ No newline at end of file
index 1206e6d..2e3b8d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa723=['../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util'];(function(_0x1af47f,_0x578c68){var _0x8ef25f=function(_0x47f50d){while(--_0x47f50d){_0x1af47f['push'](_0x1af47f['shift']());}};_0x8ef25f(++_0x578c68);}(_0xa723,0x1a3));var _0x3a72=function(_0x45b1ba,_0x5a6a21){_0x45b1ba=_0x45b1ba-0x0;var _0x145ddb=_0xa723[_0x45b1ba];return _0x145ddb;};'use strict';var util=require(_0x3a72('0x0'));var db=require(_0x3a72('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3a72('0x2')]({'name':util['format']('%s%s','agent',i),'fullname':util[_0x3a72('0x3')](_0x3a72('0x4'),_0x3a72('0x5'),i),'email':util[_0x3a72('0x3')]('%s%s@xcally.com',_0x3a72('0x5'),i),'role':_0x3a72('0x5'),'password':_0x3a72('0x6'),'internal':0xfa0+i,'type':_0x3a72('0x7'),'transport':[_0x3a72('0x8'),'ws',_0x3a72('0x9')],'disallow':['all'],'allow':[_0x3a72('0xa')],'defaultuser':util[_0x3a72('0x3')](_0x3a72('0x4'),_0x3a72('0x5'),i),'encryption':'yes','avpf':_0x3a72('0xb'),'force_avp':_0x3a72('0xb'),'icesupport':_0x3a72('0xb'),'dtlsenable':_0x3a72('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3a72('0xc'),'dtlssetup':_0x3a72('0xd'),'callerid':util['format'](_0x3a72('0xe'),util[_0x3a72('0x3')](_0x3a72('0x4'),_0x3a72('0x5'),i),0xfa0+i)});}db['User'][_0x3a72('0xf')](users)[_0x3a72('0x10')](function(){console[_0x3a72('0x11')](_0x3a72('0x12'));})[_0x3a72('0x13')](function(_0x2b82a2){console['log'](_0x2b82a2);});
\ No newline at end of file
+var _0xc1bd=['User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','ulaw','yes','/etc/pki/tls/private/motion.key','actpass'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc1bd,0x16f));var _0xdc1b=function(_0x25e3d3,_0x1d2882){_0x25e3d3=_0x25e3d3-0x0;var _0x42ad83=_0xc1bd[_0x25e3d3];return _0x42ad83;};'use strict';var util=require(_0xdc1b('0x0'));var db=require(_0xdc1b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xdc1b('0x2')](_0xdc1b('0x3'),_0xdc1b('0x4'),i),'fullname':util[_0xdc1b('0x2')]('%s%s','agent',i),'email':util[_0xdc1b('0x2')](_0xdc1b('0x5'),_0xdc1b('0x4'),i),'role':'agent','password':_0xdc1b('0x6'),'internal':0xfa0+i,'type':_0xdc1b('0x7'),'transport':[_0xdc1b('0x8'),'ws','wss'],'disallow':['all'],'allow':[_0xdc1b('0x9')],'defaultuser':util[_0xdc1b('0x2')](_0xdc1b('0x3'),_0xdc1b('0x4'),i),'encryption':_0xdc1b('0xa'),'avpf':'yes','force_avp':'yes','icesupport':'yes','dtlsenable':_0xdc1b('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xdc1b('0xb'),'dtlssetup':_0xdc1b('0xc'),'callerid':util[_0xdc1b('0x2')]('\x22%s\x22\x20<%s>',util[_0xdc1b('0x2')](_0xdc1b('0x3'),_0xdc1b('0x4'),i),0xfa0+i)});}db[_0xdc1b('0xd')][_0xdc1b('0xe')](users)[_0xdc1b('0xf')](function(){console[_0xdc1b('0x10')](_0xdc1b('0x11'));})[_0xdc1b('0x12')](function(_0x5d0f80){console[_0xdc1b('0x10')](_0x5d0f80);});
\ No newline at end of file
index fc31490..0985a94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12ea=['disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','name','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','findAll','Trunks','resourceId','where','role','telephone','Campaign','format','Agents','length','user:%s','query','User','find','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','SmsQueues','SmsQueue','OpenchannelQueues','Telephones','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','mail','openchannel','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','catch','log','join','connection','address','request','remotePort','connectedAt','SocketIO\x20','nsp'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x12ea,0x120));var _0xa12e=function(_0x441d15,_0xdb2d50){_0x441d15=_0x441d15-0x0;var _0x363a8d=_0x12ea[_0x441d15];return _0x363a8d;};'use strict';var _=require('lodash');var util=require(_0xa12e('0x0'));var BPromise=require(_0xa12e('0x1'));var db=require(_0xa12e('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xa12e('0x3')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0xa12e('0x3'),'role'],'raw':!![],'where':{'role':_0xa12e('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa12e('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xa12e('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xa12e('0x3')],'where':{'role':_0xa12e('0x4')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa12e('0x3'),_0xa12e('0x5')],'where':{'type':_0xa12e('0x6')}};function getAssociatedResources(_0x3ccd46,_0x5008c7,_0xcf4163){return db['UserProfileSection'][_0xa12e('0x7')]({'where':{'name':_0x3ccd46,'userProfileId':_0x5008c7},'raw':!![]})[_0xa12e('0x8')](function(_0x3d473f){if(_0x3d473f){if(_0x3d473f[_0xa12e('0x9')]){switch(_0x3ccd46){case _0xa12e('0xa'):case _0xa12e('0xb'):case _0xa12e('0xc'):case'SmsQueues':case _0xa12e('0xd'):case'OpenchannelQueues':return db[_0xcf4163][_0xa12e('0xe')](queryQueues);case'Telephones':return db[_0xcf4163][_0xa12e('0xe')](queryTelephones);case _0xa12e('0xf'):return db[_0xcf4163][_0xa12e('0xe')](queryTrunks);case'IvrCampaigns':return db[_0xcf4163]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0xa12e('0xe')]({'attributes':['resourceId'],'where':{'sectionId':_0x3d473f['id']},'raw':!![]})[_0xa12e('0x8')](function(_0x2c825e){if(_0x2c825e){var _0xc6ebda={'where':{'id':_['map'](_0x2c825e,_0xa12e('0x10'))},'raw':!![]};switch(_0xcf4163){case'User':_0xc6ebda[_0xa12e('0x11')][_0xa12e('0x12')]=_0xa12e('0x13');break;case _0xa12e('0x14'):_0xc6ebda[_0xa12e('0x11')][_0xa12e('0x5')]='ivr';break;}return db[_0xcf4163][_0xa12e('0xe')](_0xc6ebda);}else{return[];}});}}else{return[];}})['then'](function(_0x4b3b54){return _0x4b3b54;});}function joinOrLeaveQueues(_0x3bf385,_0x134a47,_0x567452,_0x3d0e6a){_0x3bf385[_0x134a47](util[_0xa12e('0x15')]('%s:queue:%s',_0x567452,_0x3d0e6a[_0xa12e('0x3')]));if(_0x3d0e6a['Agents']){for(var _0x4efcc0=0x0;_0x4efcc0<_0x3d0e6a[_0xa12e('0x16')][_0xa12e('0x17')];_0x4efcc0+=0x1){_0x3bf385[_0x134a47](util[_0xa12e('0x15')](_0xa12e('0x18'),_0x3d0e6a[_0xa12e('0x16')][_0x4efcc0][_0xa12e('0x3')]));}}}function joinOrLeave(_0x5b810c,_0x75e187,_0x43c5f4){var _0x526d94;if(_0x5b810c['handshake'][_0xa12e('0x19')]['id']){db[_0xa12e('0x1a')][_0xa12e('0x1b')]({'attributes':['id',_0xa12e('0x3'),_0xa12e('0x12'),'userProfileId'],'where':{'id':_0x5b810c[_0xa12e('0x1c')]['query']['id']},'include':[{'model':db[_0xa12e('0x1d')],'as':_0xa12e('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0xa12e('0x1f')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa12e('0x20')],'as':_0xa12e('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xa12e('0x22')],'as':_0xa12e('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xa12e('0x24')],'as':_0xa12e('0x25'),'attributes':['id'],'raw':!![]}]})[_0xa12e('0x8')](function(_0x721c21){if(_0x721c21){_0x526d94=_0x721c21;_0x5b810c[_0x75e187](util['format'](_0xa12e('0x18'),_0x721c21[_0xa12e('0x3')]));var _0x1061d2=[];switch(_0x721c21['role']){case _0xa12e('0x26'):_0x5b810c[_0x75e187](_0xa12e('0x27'));_0x5b810c[_0x75e187](_0xa12e('0x28'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0xa12e('0x29')];}_0x1061d2[_0xa12e('0x2a')](db[_0xa12e('0x2b')][_0xa12e('0xe')](queryQueues));_0x1061d2['push'](db[_0xa12e('0x2c')][_0xa12e('0xe')](queryQueues));_0x1061d2[_0xa12e('0x2a')](db[_0xa12e('0x2d')][_0xa12e('0xe')](queryQueues));_0x1061d2['push'](db['SmsQueue'][_0xa12e('0xe')](queryQueues));_0x1061d2[_0xa12e('0x2a')](db[_0xa12e('0x2e')]['findAll'](queryQueues));_0x1061d2[_0xa12e('0x2a')](db[_0xa12e('0x2f')][_0xa12e('0xe')](queryQueues));_0x1061d2['push'](db[_0xa12e('0x1a')][_0xa12e('0xe')](queryTelephones));_0x1061d2[_0xa12e('0x2a')](db[_0xa12e('0x30')][_0xa12e('0xe')](queryTrunks));_0x1061d2['push'](db['Campaign']['findAll'](queryCampaigns));_0x1061d2[_0xa12e('0x2a')](db[_0xa12e('0x1a')][_0xa12e('0xe')](queryAgents));break;case _0xa12e('0x31'):_0x5b810c[_0x75e187](_0xa12e('0x27'));_0x5b810c[_0x75e187]('voice:outbound');_0x1061d2['push'](getAssociatedResources('VoiceQueues',_0x721c21[_0xa12e('0x32')],_0xa12e('0x2b')));_0x1061d2[_0xa12e('0x2a')](getAssociatedResources(_0xa12e('0xb'),_0x721c21[_0xa12e('0x32')],_0xa12e('0x2c')));_0x1061d2[_0xa12e('0x2a')](getAssociatedResources(_0xa12e('0xc'),_0x721c21[_0xa12e('0x32')],_0xa12e('0x2d')));_0x1061d2['push'](getAssociatedResources(_0xa12e('0x33'),_0x721c21[_0xa12e('0x32')],_0xa12e('0x34')));_0x1061d2[_0xa12e('0x2a')](getAssociatedResources(_0xa12e('0xd'),_0x721c21[_0xa12e('0x32')],_0xa12e('0x2e')));_0x1061d2['push'](getAssociatedResources(_0xa12e('0x35'),_0x721c21[_0xa12e('0x32')],_0xa12e('0x2f')));_0x1061d2[_0xa12e('0x2a')](getAssociatedResources(_0xa12e('0x36'),_0x721c21[_0xa12e('0x32')],'User'));_0x1061d2[_0xa12e('0x2a')](getAssociatedResources(_0xa12e('0xf'),_0x721c21[_0xa12e('0x32')],_0xa12e('0x30')));_0x1061d2['push'](getAssociatedResources(_0xa12e('0x37'),_0x721c21[_0xa12e('0x32')],_0xa12e('0x14')));_0x1061d2[_0xa12e('0x2a')](db[_0xa12e('0x1a')][_0xa12e('0xe')](queryAgents));break;case'agent':_0x5b810c[_0x75e187]('voice:inbound');_0x5b810c[_0x75e187](_0xa12e('0x28'));_0x1061d2[_0xa12e('0x2a')](_0x721c21[_0xa12e('0x38')]({'attributes':['id',_0xa12e('0x3')]}));_0x1061d2['push'](_0x721c21[_0xa12e('0x39')]({'attributes':['id',_0xa12e('0x3')]}));_0x1061d2[_0xa12e('0x2a')](_0x721c21[_0xa12e('0x3a')]({'attributes':['id','name']}));_0x1061d2[_0xa12e('0x2a')](_0x721c21[_0xa12e('0x3b')]({'attributes':['id',_0xa12e('0x3')]}));_0x1061d2[_0xa12e('0x2a')](_0x721c21[_0xa12e('0x3c')]({'attributes':['id',_0xa12e('0x3')]}));_0x1061d2['push'](_0x721c21[_0xa12e('0x3d')]({'attributes':['id',_0xa12e('0x3')]}));break;}return BPromise[_0xa12e('0x3e')](_0x1061d2);}})['then'](function(_0xb8d73c){if(_0xb8d73c&&_0xb8d73c[_0xa12e('0x17')]){for(var _0x2aba5a=0x0;_0x2aba5a<_0xb8d73c[_0xa12e('0x17')];_0x2aba5a+=0x1){for(var _0x25ecab=0x0;_0x25ecab<_0xb8d73c[_0x2aba5a][_0xa12e('0x17')];_0x25ecab+=0x1){switch(_0x2aba5a){case 0x0:joinOrLeaveQueues(_0x5b810c,_0x75e187,_0xa12e('0x3f'),_0xb8d73c[_0x2aba5a][_0x25ecab]);break;case 0x1:joinOrLeaveQueues(_0x5b810c,_0x75e187,_0xa12e('0x40'),_0xb8d73c[_0x2aba5a][_0x25ecab]);break;case 0x2:joinOrLeaveQueues(_0x5b810c,_0x75e187,_0xa12e('0x41'),_0xb8d73c[_0x2aba5a][_0x25ecab]);break;case 0x3:joinOrLeaveQueues(_0x5b810c,_0x75e187,'sms',_0xb8d73c[_0x2aba5a][_0x25ecab]);break;case 0x4:joinOrLeaveQueues(_0x5b810c,_0x75e187,_0xa12e('0x42'),_0xb8d73c[_0x2aba5a][_0x25ecab]);break;case 0x5:joinOrLeaveQueues(_0x5b810c,_0x75e187,_0xa12e('0x43'),_0xb8d73c[_0x2aba5a][_0x25ecab]);break;case 0x6:_0x5b810c[_0x75e187](util[_0xa12e('0x15')]('telephone:%s',_0xb8d73c[_0x2aba5a][_0x25ecab]['name']));break;case 0x7:_0x5b810c[_0x75e187](util[_0xa12e('0x15')](_0xa12e('0x44'),_0xb8d73c[_0x2aba5a][_0x25ecab][_0xa12e('0x3')]));break;case 0x8:_0x5b810c[_0x75e187](util[_0xa12e('0x15')](_0xa12e('0x45'),_0xb8d73c[_0x2aba5a][_0x25ecab][_0xa12e('0x5')],_0xb8d73c[_0x2aba5a][_0x25ecab][_0xa12e('0x3')]));break;case 0x9:_0x5b810c[_0x75e187](util[_0xa12e('0x15')]('user:%s',_0xb8d73c[_0x2aba5a][_0x25ecab][_0xa12e('0x3')]));break;}}}}})[_0xa12e('0x8')](function(){if(_0x75e187===_0xa12e('0x46')){var _0x164b90=_[_0xa12e('0x47')](_0x526d94[_0xa12e('0x1e')],'id');return _0x526d94[_0xa12e('0x48')](_0x164b90)[_0xa12e('0x8')](function(){for(var _0x196184=0x0;_0x196184<_0x164b90[_0xa12e('0x17')];_0x196184+=0x1){_0x43c5f4[_0xa12e('0x49')](_0xa12e('0x4a'),{'ChatInteractionId':Number(_0x164b90[_0x196184]),'UserId':Number(_0x526d94['id'])});}});}})['then'](function(){if(_0x75e187===_0xa12e('0x46')){var _0x5a6a1c=_[_0xa12e('0x47')](_0x526d94['MailInteractions'],'id');return _0x526d94[_0xa12e('0x4b')](_0x5a6a1c)[_0xa12e('0x8')](function(){for(var _0x1b6253=0x0;_0x1b6253<_0x5a6a1c[_0xa12e('0x17')];_0x1b6253+=0x1){_0x43c5f4[_0xa12e('0x49')](_0xa12e('0x4c'),{'MailInteractionId':Number(_0x5a6a1c[_0x1b6253]),'UserId':Number(_0x526d94['id'])});}});}})['then'](function(){if(_0x75e187===_0xa12e('0x46')){var _0x1d75a7=_[_0xa12e('0x47')](_0x526d94[_0xa12e('0x21')],'id');return _0x526d94[_0xa12e('0x4d')](_0x1d75a7)[_0xa12e('0x8')](function(){for(var _0xad1c03=0x0;_0xad1c03<_0x1d75a7[_0xa12e('0x17')];_0xad1c03+=0x1){_0x43c5f4[_0xa12e('0x49')](_0xa12e('0x4e'),{'FaxInteractionId':Number(_0x1d75a7[_0xad1c03]),'UserId':Number(_0x526d94['id'])});}});}})['then'](function(){if(_0x75e187===_0xa12e('0x46')){var _0x36746d=_['map'](_0x526d94[_0xa12e('0x23')],'id');return _0x526d94[_0xa12e('0x4f')](_0x36746d)[_0xa12e('0x8')](function(){for(var _0x48f6bb=0x0;_0x48f6bb<_0x36746d[_0xa12e('0x17')];_0x48f6bb+=0x1){_0x43c5f4[_0xa12e('0x49')](_0xa12e('0x50'),{'SmsInteractionId':Number(_0x36746d[_0x48f6bb]),'UserId':Number(_0x526d94['id'])});}});}})['then'](function(){if(_0x75e187===_0xa12e('0x46')){var _0x5ef8da=_[_0xa12e('0x47')](_0x526d94[_0xa12e('0x25')],'id');return _0x526d94[_0xa12e('0x51')](_0x5ef8da)[_0xa12e('0x8')](function(){for(var _0x431da8=0x0;_0x431da8<_0x5ef8da['length'];_0x431da8+=0x1){_0x43c5f4[_0xa12e('0x49')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5ef8da[_0x431da8]),'UserId':Number(_0x526d94['id'])});}});}})[_0xa12e('0x52')](function(_0x54c8dc){_0x5b810c[_0xa12e('0x53')](_0x54c8dc);});}}function onDisconnect(_0x1ae4a3,_0x3381bd){joinOrLeave(_0x1ae4a3,_0xa12e('0x46'),_0x3381bd);}function onConnect(_0xad6dbd){joinOrLeave(_0xad6dbd,_0xa12e('0x54'));}exports['default']=function(_0x352208){_0x352208['on'](_0xa12e('0x55'),function(_0x74463f){_0x74463f['setMaxListeners'](0x0);_0x74463f[_0xa12e('0x56')]=_0x74463f[_0xa12e('0x57')][_0xa12e('0x55')]['remoteAddress']+':'+_0x74463f[_0xa12e('0x57')][_0xa12e('0x55')][_0xa12e('0x58')];_0x74463f[_0xa12e('0x59')]=new Date();_0x74463f[_0xa12e('0x53')]=function(_0x14174d){console[_0xa12e('0x53')](_0xa12e('0x5a')+_0x74463f[_0xa12e('0x5b')][_0xa12e('0x3')]+'['+_0x74463f[_0xa12e('0x56')]+']',_0x14174d);};_0x74463f['on'](_0xa12e('0x5c'),function(){onDisconnect(_0x74463f,_0x352208);_0x74463f['log'](_0xa12e('0x5d'));});onConnect(_0x74463f);_0x74463f[_0xa12e('0x53')](_0xa12e('0x5e'));});};
\ No newline at end of file
+var _0xe264=['IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','ivr','format','%s:queue:%s','length','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','user:%s','voice:inbound','voice:outbound','include','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','VoiceQueue','ChatQueues','SmsQueues','MailQueue','OpenchannelQueues','getVoiceQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','util','../mysqldb','./environment','Agents','role','agent','name','telephone','type','UserProfileSection','findOne','then','FaxQueues','MailQueues','findAll','Trunks'];(function(_0x3639b4,_0x4c504e){var _0x720b7=function(_0x302f25){while(--_0x302f25){_0x3639b4['push'](_0x3639b4['shift']());}};_0x720b7(++_0x4c504e);}(_0xe264,0x1a8));var _0x4e26=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xe264[_0x261e29];return _0x25ef43;};'use strict';var _=require('lodash');var util=require(_0x4e26('0x0'));var BPromise=require('bluebird');var db=require(_0x4e26('0x1'))['db'];var config=require(_0x4e26('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x4e26('0x3'),'model':db['User'],'attributes':['id','name',_0x4e26('0x4')],'raw':!![],'where':{'role':_0x4e26('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4e26('0x6')],'where':{'role':_0x4e26('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x4e26('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x4e26('0x6')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x4e26('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0xa05c05,_0x2a8f00,_0x4e3f62){return db[_0x4e26('0x9')][_0x4e26('0xa')]({'where':{'name':_0xa05c05,'userProfileId':_0x2a8f00},'raw':!![]})[_0x4e26('0xb')](function(_0x46e33d){if(_0x46e33d){if(_0x46e33d['autoAssociation']){switch(_0xa05c05){case'VoiceQueues':case'ChatQueues':case _0x4e26('0xc'):case'SmsQueues':case _0x4e26('0xd'):case'OpenchannelQueues':return db[_0x4e3f62][_0x4e26('0xe')](queryQueues);case'Telephones':return db[_0x4e3f62]['findAll'](queryTelephones);case _0x4e26('0xf'):return db[_0x4e3f62][_0x4e26('0xe')](queryTrunks);case _0x4e26('0x10'):return db[_0x4e3f62][_0x4e26('0xe')](queryCampaigns);}}else{return db[_0x4e26('0x11')][_0x4e26('0xe')]({'attributes':[_0x4e26('0x12')],'where':{'sectionId':_0x46e33d['id']},'raw':!![]})[_0x4e26('0xb')](function(_0xa32e82){if(_0xa32e82){var _0x33c96f={'where':{'id':_[_0x4e26('0x13')](_0xa32e82,'resourceId')},'raw':!![]};switch(_0x4e3f62){case _0x4e26('0x14'):_0x33c96f['where'][_0x4e26('0x4')]=_0x4e26('0x7');break;case _0x4e26('0x15'):_0x33c96f['where'][_0x4e26('0x8')]=_0x4e26('0x16');break;}return db[_0x4e3f62][_0x4e26('0xe')](_0x33c96f);}else{return[];}});}}else{return[];}})[_0x4e26('0xb')](function(_0x54e936){return _0x54e936;});}function joinOrLeaveQueues(_0x18f055,_0x2742ff,_0x2e1690,_0x3e9826){_0x18f055[_0x2742ff](util[_0x4e26('0x17')](_0x4e26('0x18'),_0x2e1690,_0x3e9826[_0x4e26('0x6')]));if(_0x3e9826[_0x4e26('0x3')]){for(var _0x3e8321=0x0;_0x3e8321<_0x3e9826['Agents'][_0x4e26('0x19')];_0x3e8321+=0x1){_0x18f055[_0x2742ff](util['format']('user:%s',_0x3e9826['Agents'][_0x3e8321][_0x4e26('0x6')]));}}}function joinOrLeave(_0x1060ac,_0x366885,_0x40b2b1){var _0x3a08a1;if(_0x1060ac[_0x4e26('0x1a')][_0x4e26('0x1b')]['id']){db['User'][_0x4e26('0x1c')]({'attributes':['id',_0x4e26('0x6'),_0x4e26('0x4'),_0x4e26('0x1d')],'where':{'id':_0x1060ac['handshake']['query']['id']},'include':[{'model':db[_0x4e26('0x1e')],'as':_0x4e26('0x1f'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x4e26('0x20'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x4e26('0x21'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4e26('0x22')],'as':_0x4e26('0x23'),'attributes':['id'],'raw':!![]}]})[_0x4e26('0xb')](function(_0x2d6ccf){if(_0x2d6ccf){_0x3a08a1=_0x2d6ccf;_0x1060ac[_0x366885](util['format'](_0x4e26('0x24'),_0x2d6ccf[_0x4e26('0x6')]));var _0x56110a=[];switch(_0x2d6ccf[_0x4e26('0x4')]){case'admin':_0x1060ac[_0x366885](_0x4e26('0x25'));_0x1060ac[_0x366885](_0x4e26('0x26'));if(queryQueues['hasOwnProperty'](_0x4e26('0x27'))){delete queryQueues[_0x4e26('0x27')];}_0x56110a[_0x4e26('0x28')](db['VoiceQueue'][_0x4e26('0xe')](queryQueues));_0x56110a['push'](db[_0x4e26('0x29')][_0x4e26('0xe')](queryQueues));_0x56110a[_0x4e26('0x28')](db[_0x4e26('0x2a')][_0x4e26('0xe')](queryQueues));_0x56110a[_0x4e26('0x28')](db[_0x4e26('0x2b')][_0x4e26('0xe')](queryQueues));_0x56110a[_0x4e26('0x28')](db['MailQueue']['findAll'](queryQueues));_0x56110a[_0x4e26('0x28')](db[_0x4e26('0x2c')]['findAll'](queryQueues));_0x56110a[_0x4e26('0x28')](db[_0x4e26('0x14')]['findAll'](queryTelephones));_0x56110a[_0x4e26('0x28')](db[_0x4e26('0x2d')][_0x4e26('0xe')](queryTrunks));_0x56110a[_0x4e26('0x28')](db[_0x4e26('0x15')][_0x4e26('0xe')](queryCampaigns));_0x56110a[_0x4e26('0x28')](db['User'][_0x4e26('0xe')](queryAgents));break;case'user':_0x1060ac[_0x366885](_0x4e26('0x25'));_0x1060ac[_0x366885](_0x4e26('0x26'));_0x56110a[_0x4e26('0x28')](getAssociatedResources('VoiceQueues',_0x2d6ccf[_0x4e26('0x1d')],_0x4e26('0x2e')));_0x56110a[_0x4e26('0x28')](getAssociatedResources(_0x4e26('0x2f'),_0x2d6ccf[_0x4e26('0x1d')],_0x4e26('0x29')));_0x56110a[_0x4e26('0x28')](getAssociatedResources('FaxQueues',_0x2d6ccf[_0x4e26('0x1d')],'FaxQueue'));_0x56110a[_0x4e26('0x28')](getAssociatedResources(_0x4e26('0x30'),_0x2d6ccf['userProfileId'],_0x4e26('0x2b')));_0x56110a[_0x4e26('0x28')](getAssociatedResources('MailQueues',_0x2d6ccf[_0x4e26('0x1d')],_0x4e26('0x31')));_0x56110a['push'](getAssociatedResources(_0x4e26('0x32'),_0x2d6ccf['userProfileId'],_0x4e26('0x2c')));_0x56110a['push'](getAssociatedResources('Telephones',_0x2d6ccf[_0x4e26('0x1d')],_0x4e26('0x14')));_0x56110a[_0x4e26('0x28')](getAssociatedResources(_0x4e26('0xf'),_0x2d6ccf['userProfileId'],_0x4e26('0x2d')));_0x56110a[_0x4e26('0x28')](getAssociatedResources(_0x4e26('0x10'),_0x2d6ccf[_0x4e26('0x1d')],_0x4e26('0x15')));_0x56110a[_0x4e26('0x28')](db[_0x4e26('0x14')][_0x4e26('0xe')](queryAgents));break;case _0x4e26('0x5'):_0x1060ac[_0x366885](_0x4e26('0x25'));_0x1060ac[_0x366885](_0x4e26('0x26'));_0x56110a[_0x4e26('0x28')](_0x2d6ccf[_0x4e26('0x33')]({'attributes':['id',_0x4e26('0x6')]}));_0x56110a[_0x4e26('0x28')](_0x2d6ccf['getChatQueues']({'attributes':['id','name']}));_0x56110a['push'](_0x2d6ccf['getFaxQueues']({'attributes':['id',_0x4e26('0x6')]}));_0x56110a['push'](_0x2d6ccf[_0x4e26('0x34')]({'attributes':['id',_0x4e26('0x6')]}));_0x56110a[_0x4e26('0x28')](_0x2d6ccf[_0x4e26('0x35')]({'attributes':['id',_0x4e26('0x6')]}));_0x56110a[_0x4e26('0x28')](_0x2d6ccf[_0x4e26('0x36')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x56110a);}})[_0x4e26('0xb')](function(_0x541ae4){if(_0x541ae4&&_0x541ae4[_0x4e26('0x19')]){for(var _0x43a64b=0x0;_0x43a64b<_0x541ae4[_0x4e26('0x19')];_0x43a64b+=0x1){for(var _0x5a9afe=0x0;_0x5a9afe<_0x541ae4[_0x43a64b][_0x4e26('0x19')];_0x5a9afe+=0x1){switch(_0x43a64b){case 0x0:joinOrLeaveQueues(_0x1060ac,_0x366885,_0x4e26('0x37'),_0x541ae4[_0x43a64b][_0x5a9afe]);break;case 0x1:joinOrLeaveQueues(_0x1060ac,_0x366885,'chat',_0x541ae4[_0x43a64b][_0x5a9afe]);break;case 0x2:joinOrLeaveQueues(_0x1060ac,_0x366885,'fax',_0x541ae4[_0x43a64b][_0x5a9afe]);break;case 0x3:joinOrLeaveQueues(_0x1060ac,_0x366885,_0x4e26('0x38'),_0x541ae4[_0x43a64b][_0x5a9afe]);break;case 0x4:joinOrLeaveQueues(_0x1060ac,_0x366885,_0x4e26('0x39'),_0x541ae4[_0x43a64b][_0x5a9afe]);break;case 0x5:joinOrLeaveQueues(_0x1060ac,_0x366885,_0x4e26('0x3a'),_0x541ae4[_0x43a64b][_0x5a9afe]);break;case 0x6:_0x1060ac[_0x366885](util['format'](_0x4e26('0x3b'),_0x541ae4[_0x43a64b][_0x5a9afe][_0x4e26('0x6')]));break;case 0x7:_0x1060ac[_0x366885](util[_0x4e26('0x17')](_0x4e26('0x3c'),_0x541ae4[_0x43a64b][_0x5a9afe]['name']));break;case 0x8:_0x1060ac[_0x366885](util['format'](_0x4e26('0x3d'),_0x541ae4[_0x43a64b][_0x5a9afe][_0x4e26('0x8')],_0x541ae4[_0x43a64b][_0x5a9afe]['name']));break;case 0x9:_0x1060ac[_0x366885](util[_0x4e26('0x17')](_0x4e26('0x24'),_0x541ae4[_0x43a64b][_0x5a9afe][_0x4e26('0x6')]));break;}}}}})[_0x4e26('0xb')](function(){if(_0x366885==='leave'){var _0x53e0ba=_[_0x4e26('0x13')](_0x3a08a1[_0x4e26('0x1f')],'id');return _0x3a08a1[_0x4e26('0x3e')](_0x53e0ba)[_0x4e26('0xb')](function(){for(var _0x17fb4f=0x0;_0x17fb4f<_0x53e0ba[_0x4e26('0x19')];_0x17fb4f+=0x1){_0x40b2b1[_0x4e26('0x3f')](_0x4e26('0x40'),{'ChatInteractionId':Number(_0x53e0ba[_0x17fb4f]),'UserId':Number(_0x3a08a1['id'])});}});}})[_0x4e26('0xb')](function(){if(_0x366885===_0x4e26('0x41')){var _0x1e5673=_[_0x4e26('0x13')](_0x3a08a1['MailInteractions'],'id');return _0x3a08a1[_0x4e26('0x42')](_0x1e5673)[_0x4e26('0xb')](function(){for(var _0x1ac8e1=0x0;_0x1ac8e1<_0x1e5673[_0x4e26('0x19')];_0x1ac8e1+=0x1){_0x40b2b1[_0x4e26('0x3f')](_0x4e26('0x43'),{'MailInteractionId':Number(_0x1e5673[_0x1ac8e1]),'UserId':Number(_0x3a08a1['id'])});}});}})[_0x4e26('0xb')](function(){if(_0x366885===_0x4e26('0x41')){var _0x3a1973=_[_0x4e26('0x13')](_0x3a08a1[_0x4e26('0x21')],'id');return _0x3a08a1[_0x4e26('0x44')](_0x3a1973)[_0x4e26('0xb')](function(){for(var _0x3b39fa=0x0;_0x3b39fa<_0x3a1973['length'];_0x3b39fa+=0x1){_0x40b2b1['emit'](_0x4e26('0x45'),{'FaxInteractionId':Number(_0x3a1973[_0x3b39fa]),'UserId':Number(_0x3a08a1['id'])});}});}})[_0x4e26('0xb')](function(){if(_0x366885===_0x4e26('0x41')){var _0x2cd83a=_[_0x4e26('0x13')](_0x3a08a1[_0x4e26('0x46')],'id');return _0x3a08a1[_0x4e26('0x47')](_0x2cd83a)[_0x4e26('0xb')](function(){for(var _0x2ec046=0x0;_0x2ec046<_0x2cd83a['length'];_0x2ec046+=0x1){_0x40b2b1[_0x4e26('0x3f')](_0x4e26('0x48'),{'SmsInteractionId':Number(_0x2cd83a[_0x2ec046]),'UserId':Number(_0x3a08a1['id'])});}});}})[_0x4e26('0xb')](function(){if(_0x366885===_0x4e26('0x41')){var _0x37f68d=_['map'](_0x3a08a1[_0x4e26('0x23')],'id');return _0x3a08a1['removeOpenchannelInteractions'](_0x37f68d)[_0x4e26('0xb')](function(){for(var _0x595c6f=0x0;_0x595c6f<_0x37f68d[_0x4e26('0x19')];_0x595c6f+=0x1){_0x40b2b1[_0x4e26('0x3f')](_0x4e26('0x49'),{'OpenchannelInteractionId':Number(_0x37f68d[_0x595c6f]),'UserId':Number(_0x3a08a1['id'])});}});}})[_0x4e26('0x4a')](function(_0x236142){_0x1060ac[_0x4e26('0x4b')](_0x236142);});}}function onDisconnect(_0x231060,_0x3c2079){joinOrLeave(_0x231060,'leave',_0x3c2079);}function onConnect(_0x29adb7){joinOrLeave(_0x29adb7,_0x4e26('0x4c'));}exports[_0x4e26('0x4d')]=function(_0x4658b9){_0x4658b9['on'](_0x4e26('0x4e'),function(_0x58807c){_0x58807c['setMaxListeners'](0x0);_0x58807c[_0x4e26('0x4f')]=_0x58807c[_0x4e26('0x50')][_0x4e26('0x4e')][_0x4e26('0x51')]+':'+_0x58807c[_0x4e26('0x50')][_0x4e26('0x4e')][_0x4e26('0x52')];_0x58807c[_0x4e26('0x53')]=new Date();_0x58807c['log']=function(_0x2792d1){console[_0x4e26('0x4b')](_0x4e26('0x54')+_0x58807c[_0x4e26('0x55')][_0x4e26('0x6')]+'['+_0x58807c[_0x4e26('0x4f')]+']',_0x2792d1);};_0x58807c['on'](_0x4e26('0x56'),function(){onDisconnect(_0x58807c,_0x4658b9);_0x58807c[_0x4e26('0x4b')]('DISCONNECTED');});onConnect(_0x58807c);_0x58807c[_0x4e26('0x4b')](_0x4e26('0x57'));});};
\ No newline at end of file
index 533794f..14d1ae8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63e6=['Chat','afterUpdate','closedinteraction','Sms','SmsInteraction','SmsMessage','newmessage','FaxInteraction','Fax','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','UserId','User','find','name','format','SIP/%s','incomingmessage','outgoingmessage','opened','changed','closed','interface','default','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','triggers','client','http','ChatInteraction','afterCreate','newinteraction'];(function(_0xbedd48,_0x33062d){var _0xeff224=function(_0x105155){while(--_0x105155){_0xbedd48['push'](_0xbedd48['shift']());}};_0xeff224(++_0x33062d);}(_0x63e6,0xfc));var _0x663e=function(_0x10595e,_0x9bf938){_0x10595e=_0x10595e-0x0;var _0x55873f=_0x63e6[_0x10595e];return _0x55873f;};'use strict';var util=require(_0x663e('0x0'));var db=require(_0x663e('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0x663e('0x2'));var client=jayson[_0x663e('0x3')][_0x663e('0x4')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x663e('0x5'),'event':_0x663e('0x6'),'condition':_0x663e('0x7'),'callback':afterCreate},{'channel':_0x663e('0x8'),'model':'ChatInteraction','event':_0x663e('0x9'),'condition':_0x663e('0xa'),'callback':afterUpdate},{'channel':_0x663e('0x8'),'model':'ChatMessage','event':_0x663e('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x663e('0xb'),'model':_0x663e('0xc'),'event':'afterCreate','condition':_0x663e('0x7'),'callback':afterCreate},{'channel':_0x663e('0xb'),'model':_0x663e('0xc'),'event':_0x663e('0x9'),'condition':_0x663e('0xa'),'callback':afterUpdate},{'channel':'Sms','model':_0x663e('0xd'),'event':_0x663e('0x6'),'condition':_0x663e('0xe'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x663e('0xf'),'event':_0x663e('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x663e('0x10'),'model':'FaxInteraction','event':_0x663e('0x9'),'condition':_0x663e('0xa'),'callback':afterUpdate},{'channel':_0x663e('0x10'),'model':'FaxMessage','event':_0x663e('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x663e('0x11'),'event':_0x663e('0x6'),'condition':_0x663e('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0x663e('0x11'),'event':_0x663e('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x663e('0x12'),'model':_0x663e('0x13'),'event':_0x663e('0x6'),'condition':_0x663e('0xe'),'callback':afterCreateMessage},{'channel':_0x663e('0x14'),'model':'OpenchannelInteraction','event':_0x663e('0x6'),'condition':_0x663e('0x7'),'callback':afterCreate},{'channel':_0x663e('0x14'),'model':_0x663e('0x15'),'event':_0x663e('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x663e('0x14'),'model':'OpenchannelMessage','event':_0x663e('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x169cf){return client[_0x663e('0x16')](_0x663e('0x17'),_0x169cf)[_0x663e('0x18')](function(_0x4cdada){logger[_0x663e('0x19')](_0x663e('0x1a'),_0x663e('0x17'),_0x4cdada);if(_0x4cdada['error']){if(_0x4cdada[_0x663e('0x1b')][_0x663e('0x1c')]===0x1f4){logger[_0x663e('0x1b')](_0x663e('0x1a'),_0x663e('0x17'),_0x4cdada[_0x663e('0x1b')]);}}})[_0x663e('0x1d')](function(_0x3d39ea){logger['error'](_0x663e('0x1a'),'EventManager',_0x3d39ea);});}function afterCreateMessage(_0x4c2502,_0x426dec){return function(_0x3eba03,_0x557c87){_0x3eba03=_0x3eba03[_0x663e('0x1e')]({'plain':!![]});_0x3eba03[_0x663e('0x1f')]=_0x4c2502;_0x3eba03[_0x663e('0x20')]=_0x3eba03['direction'];if(_0x3eba03[_0x663e('0x21')]){return db[_0x663e('0x22')][_0x663e('0x23')]({'where':{'id':_0x3eba03[_0x663e('0x21')]},'attributes':['id',_0x663e('0x24')],'raw':!![]})['then'](function(_0x4ab95f){_0x3eba03['interface']=util[_0x663e('0x25')](_0x663e('0x26'),_0x4ab95f[_0x663e('0x24')]);_0x3eba03[_0x663e('0x1f')]=_0x4c2502;return request({'event':_0x663e('0x27'),'message':_0x3eba03});})[_0x663e('0x1d')](function(_0x59929a){console['error'](_0x59929a);});}else{return request({'event':_0x663e('0x28'),'message':_0x3eba03});}};}function afterCreate(_0xc51bc5,_0x23559){return function(_0x5adc4c,_0x55a63b){_0x5adc4c=_0x5adc4c[_0x663e('0x1e')]({'plain':!![]});_0x5adc4c[_0x663e('0x1f')]=_0xc51bc5;_0x5adc4c[_0x663e('0x20')]=_0x663e('0x29');return request({'event':_0x23559,'message':_0x5adc4c});};}function afterUpdate(_0x4ca792,_0x2e34c9){return function(_0xeace2d,_0x4dc2c5){if(_0xeace2d[_0x663e('0x2a')]('closed')&&_0xeace2d[_0x663e('0x2b')]){_0xeace2d=_0xeace2d['get']({'plain':!![]});_0xeace2d[_0x663e('0x1f')]=_0x4ca792;_0xeace2d[_0x663e('0x20')]=_0x663e('0x2b');if(_0xeace2d['UserId']){return db[_0x663e('0x22')][_0x663e('0x23')]({'where':{'id':_0xeace2d['UserId']},'attributes':['id',_0x663e('0x24')],'raw':!![]})['then'](function(_0x430a2b){_0xeace2d[_0x663e('0x2c')]=util[_0x663e('0x25')]('SIP/%s',_0x430a2b['name']);return request({'event':_0x2e34c9,'message':_0xeace2d});})[_0x663e('0x1d')](function(_0x1b0175){console['error'](_0x1b0175);});}else{return request({'event':_0x2e34c9,'message':_0xeace2d});}}};}exports[_0x663e('0x2d')]=function(){for(var _0x388433=0x0;_0x388433<triggers[_0x663e('0x2e')];_0x388433+=0x1){if(db['hasOwnProperty'](triggers[_0x388433][_0x663e('0x2f')])){db[triggers[_0x388433]['model']][_0x663e('0x30')](triggers[_0x388433][_0x663e('0x20')],triggers[_0x388433][_0x663e('0x31')](triggers[_0x388433]['channel'][_0x663e('0x32')](),triggers[_0x388433][_0x663e('0x33')]));}}};
\ No newline at end of file
+var _0x08b3=['../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','Trigger,\x20%s','error','code','get','channel','event','direction','User','find','interface','format','SIP/%s','name','incomingmessage','catch','closed','UserId','then','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x08b3,0x110));var _0x308b=function(_0x5e4446,_0x17ed8e){_0x5e4446=_0x5e4446-0x0;var _0x4e1f0b=_0x08b3[_0x5e4446];return _0x4e1f0b;};'use strict';var util=require(_0x308b('0x0'));var db=require(_0x308b('0x1'))['db'];var jayson=require(_0x308b('0x2'));var logger=require(_0x308b('0x3'))(_0x308b('0x4'));var client=jayson[_0x308b('0x5')][_0x308b('0x6')]({'port':0x232a});var triggers=[{'channel':_0x308b('0x7'),'model':_0x308b('0x8'),'event':_0x308b('0x9'),'condition':_0x308b('0xa'),'callback':afterCreate},{'channel':_0x308b('0x7'),'model':'ChatInteraction','event':_0x308b('0xb'),'condition':_0x308b('0xc'),'callback':afterUpdate},{'channel':_0x308b('0x7'),'model':_0x308b('0xd'),'event':_0x308b('0x9'),'condition':_0x308b('0xe'),'callback':afterCreateMessage},{'channel':_0x308b('0xf'),'model':_0x308b('0x10'),'event':_0x308b('0x9'),'condition':_0x308b('0xa'),'callback':afterCreate},{'channel':_0x308b('0xf'),'model':_0x308b('0x10'),'event':_0x308b('0xb'),'condition':_0x308b('0xc'),'callback':afterUpdate},{'channel':_0x308b('0xf'),'model':_0x308b('0x11'),'event':_0x308b('0x9'),'condition':_0x308b('0xe'),'callback':afterCreateMessage},{'channel':_0x308b('0x12'),'model':_0x308b('0x13'),'event':'afterCreate','condition':_0x308b('0xa'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':'afterUpdate','condition':_0x308b('0xc'),'callback':afterUpdate},{'channel':'Fax','model':_0x308b('0x14'),'event':'afterCreate','condition':_0x308b('0xe'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x308b('0x15'),'event':_0x308b('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':_0x308b('0x15'),'event':_0x308b('0xb'),'condition':_0x308b('0xc'),'callback':afterUpdate},{'channel':_0x308b('0x16'),'model':_0x308b('0x17'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x308b('0x18'),'model':_0x308b('0x19'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x308b('0x18'),'model':_0x308b('0x19'),'event':_0x308b('0xb'),'condition':_0x308b('0xc'),'callback':afterUpdate},{'channel':_0x308b('0x18'),'model':_0x308b('0x1a'),'event':_0x308b('0x9'),'condition':_0x308b('0xe'),'callback':afterCreateMessage}];function request(_0xd5ec02){return client[_0x308b('0x1b')](_0x308b('0x1c'),_0xd5ec02)['then'](function(_0x5ba64){logger['info'](_0x308b('0x1d'),_0x308b('0x1c'),_0x5ba64);if(_0x5ba64[_0x308b('0x1e')]){if(_0x5ba64['error'][_0x308b('0x1f')]===0x1f4){logger[_0x308b('0x1e')](_0x308b('0x1d'),_0x308b('0x1c'),_0x5ba64[_0x308b('0x1e')]);}}})['catch'](function(_0x15bada){logger[_0x308b('0x1e')](_0x308b('0x1d'),_0x308b('0x1c'),_0x15bada);});}function afterCreateMessage(_0x34dc63,_0x16d90c){return function(_0x11ae11,_0x250613){_0x11ae11=_0x11ae11[_0x308b('0x20')]({'plain':!![]});_0x11ae11[_0x308b('0x21')]=_0x34dc63;_0x11ae11[_0x308b('0x22')]=_0x11ae11[_0x308b('0x23')];if(_0x11ae11['UserId']){return db[_0x308b('0x24')][_0x308b('0x25')]({'where':{'id':_0x11ae11['UserId']},'attributes':['id','name'],'raw':!![]})['then'](function(_0x296ae3){_0x11ae11[_0x308b('0x26')]=util[_0x308b('0x27')](_0x308b('0x28'),_0x296ae3[_0x308b('0x29')]);_0x11ae11[_0x308b('0x21')]=_0x34dc63;return request({'event':_0x308b('0x2a'),'message':_0x11ae11});})[_0x308b('0x2b')](function(_0x95d37c){console[_0x308b('0x1e')](_0x95d37c);});}else{return request({'event':'outgoingmessage','message':_0x11ae11});}};}function afterCreate(_0x2778e3,_0x4203ab){return function(_0x463c2b,_0x24d0a0){_0x463c2b=_0x463c2b['get']({'plain':!![]});_0x463c2b[_0x308b('0x21')]=_0x2778e3;_0x463c2b[_0x308b('0x22')]='opened';return request({'event':_0x4203ab,'message':_0x463c2b});};}function afterUpdate(_0x275de1,_0x1be1d6){return function(_0x138375,_0xf33206){if(_0x138375['changed'](_0x308b('0x2c'))&&_0x138375[_0x308b('0x2c')]){_0x138375=_0x138375[_0x308b('0x20')]({'plain':!![]});_0x138375[_0x308b('0x21')]=_0x275de1;_0x138375[_0x308b('0x22')]='closed';if(_0x138375['UserId']){return db[_0x308b('0x24')][_0x308b('0x25')]({'where':{'id':_0x138375[_0x308b('0x2d')]},'attributes':['id','name'],'raw':!![]})[_0x308b('0x2e')](function(_0x13557f){_0x138375[_0x308b('0x26')]=util['format']('SIP/%s',_0x13557f[_0x308b('0x29')]);return request({'event':_0x1be1d6,'message':_0x138375});})[_0x308b('0x2b')](function(_0x5e1f29){console[_0x308b('0x1e')](_0x5e1f29);});}else{return request({'event':_0x1be1d6,'message':_0x138375});}}};}exports[_0x308b('0x2f')]=function(){for(var _0x5a6719=0x0;_0x5a6719<triggers[_0x308b('0x30')];_0x5a6719+=0x1){if(db[_0x308b('0x31')](triggers[_0x5a6719][_0x308b('0x32')])){db[triggers[_0x5a6719][_0x308b('0x32')]][_0x308b('0x33')](triggers[_0x5a6719][_0x308b('0x22')],triggers[_0x5a6719][_0x308b('0x34')](triggers[_0x5a6719]['channel'][_0x308b('0x35')](),triggers[_0x5a6719][_0x308b('0x36')]));}}};
\ No newline at end of file
index dafd9ff..b9acea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12ec=['fax','sms','openchannel','toLowerCase','includes','lodash','voice','mail','chat'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12ec,0x1d9));var _0xc12e=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x12ec[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0xc12e('0x0'));var channels=[_0xc12e('0x1'),_0xc12e('0x2'),_0xc12e('0x3'),_0xc12e('0x4'),_0xc12e('0x5'),_0xc12e('0x6')];module['exports']={'getChannels':function(){return channels;},'isValidChannel':function(_0x1f6b7c){_0x1f6b7c=_0x1f6b7c[_0xc12e('0x7')]();return _[_0xc12e('0x8')](channels,_0x1f6b7c);}};
\ No newline at end of file
+var _0x8bba=['voice','mail','chat','fax','sms','exports','toLowerCase','includes','lodash'];(function(_0x46b752,_0x18a3c1){var _0x5c7328=function(_0x3052f9){while(--_0x3052f9){_0x46b752['push'](_0x46b752['shift']());}};_0x5c7328(++_0x18a3c1);}(_0x8bba,0xe0));var _0xa8bb=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x8bba[_0x484c03];return _0x294127;};'use strict';var _=require(_0xa8bb('0x0'));var channels=[_0xa8bb('0x1'),_0xa8bb('0x2'),_0xa8bb('0x3'),_0xa8bb('0x4'),_0xa8bb('0x5'),'openchannel'];module[_0xa8bb('0x6')]={'getChannels':function(){return channels;},'isValidChannel':function(_0x3f9a0a){_0x3f9a0a=_0x3f9a0a[_0xa8bb('0x7')]();return _[_0xa8bb('0x8')](channels,_0x3f9a0a);}};
\ No newline at end of file
index 81bb5b3..b9d5344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7515=['status','404'];(function(_0x52b904,_0x20a577){var _0x150f25=function(_0x2071cc){while(--_0x2071cc){_0x52b904['push'](_0x52b904['shift']());}};_0x150f25(++_0x20a577);}(_0x7515,0x151));var _0x5751=function(_0x8fd79f,_0x1fd03a){_0x8fd79f=_0x8fd79f-0x0;var _0x410c0c=_0x7515[_0x8fd79f];return _0x410c0c;};'use strict';module['exports'][0x194]=function pageNotFound(_0x266fba,_0x592649){var _0x567901=_0x5751('0x0');var _0x3d1a8d=0x194;var _0x262dca={'status':_0x3d1a8d};_0x592649['status'](_0x262dca[_0x5751('0x1')]);_0x592649['render'](_0x567901,{},function(_0x9a3b0b,_0x4859fc){if(_0x9a3b0b){return _0x592649[_0x5751('0x1')](_0x262dca[_0x5751('0x1')])['json'](_0x262dca);}_0x592649['send'](_0x4859fc);});};
\ No newline at end of file
+var _0x6437=['status','render','json','send','exports','404'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0x6437,0x82));var _0x7643=function(_0x15cd41,_0x1dc846){_0x15cd41=_0x15cd41-0x0;var _0x38c383=_0x6437[_0x15cd41];return _0x38c383;};'use strict';module[_0x7643('0x0')][0x194]=function pageNotFound(_0x2c0729,_0x3861c3){var _0x15ff37=_0x7643('0x1');var _0x100e87=0x194;var _0x1b6a57={'status':_0x100e87};_0x3861c3[_0x7643('0x2')](_0x1b6a57[_0x7643('0x2')]);_0x3861c3[_0x7643('0x3')](_0x15ff37,{},function(_0x4f9ffa,_0x3614a9){if(_0x4f9ffa){return _0x3861c3[_0x7643('0x2')](_0x1b6a57['status'])[_0x7643('0x4')](_0x1b6a57);}_0x3861c3[_0x7643('0x5')](_0x3614a9);});};
\ No newline at end of file
index b213c50..d78c3e6 100644 (file)
@@ -5,7 +5,7 @@
 
     // Attributes
     iframe['id'] = 'motion-chat-iframe';
-    iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=1.0.10&{{{query}}}';
+    iframe['src'] = '{{{remote}}}/snippet?location=' + btoa(window.location.host) + '&version=1.0.11&{{{query}}}';
 
     // Style attributes
     iframe.style['position'] = 'fixed';
diff --git a/server/migrations/2.2.4.js b/server/migrations/2.2.4.js
new file mode 100644 (file)
index 0000000..e3389a0
--- /dev/null
@@ -0,0 +1,175 @@
+'use strict';
+
+var BPromise = require('bluebird');
+var util = require('util');
+
+var logger = require('../config/logger')('migration');
+
+var Sequence = function() {};
+
+Sequence.prototype.enqueue = function(fn) {
+    this.tail = this.tail ? this.tail.finally(fn) : fn();
+};
+
+var Migration = function(queryInterface) {
+    this.queryInterface = queryInterface;
+    this.sequence = new Sequence();
+};
+
+Migration.prototype.changeColumn = function(table, column, type) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface
+            .changeColumn(table, column, type)
+            .then(function() {
+                logger.info('Changed column %s in table %s', column, table);
+            })
+            .catch(function(err) {
+                logger.info(JSON.stringify(err));
+            });
+    });
+};
+
+Migration.prototype.addColumn = function(table, column, type) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface
+            .addColumn(table, column, type)
+            .then(function() {
+                logger.info('Added column %s to %s', column, table);
+            })
+            .catch(function(err) {
+                logger.info(JSON.stringify(err));
+            });
+    });
+};
+
+Migration.prototype.dropTable = function(table) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface
+            .dropTable(table, {
+                force: true
+            })
+            .then(function() {
+                logger.info('table dropped %s', table);
+            })
+            .catch(function(err) {
+                logger.info(JSON.stringify(err));
+            });
+    });
+};
+
+Migration.prototype.addIndex = function(table, column, indexName) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface
+            .addIndex(table, column, {
+                indexName: indexName
+            })
+            .then(function() {
+                logger.info('addIndex %s %s %s', table, column.join(','), indexName);
+            })
+            .catch(function(err) {
+                logger.info(JSON.stringify(err));
+            });
+    });
+};
+
+Migration.prototype.removeIndex = function(table, indexName) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface
+            .removeIndex(table, indexName)
+            .then(function() {
+                logger.info('removeIndex %s %s', table, indexName);
+            })
+            .catch(function(err) {
+                logger.info(JSON.stringify(err));
+            });
+    });
+};
+
+Migration.prototype.query = function(sql) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface.sequelize
+            .query(sql)
+            .then(function() {
+                logger.info('query %s', sql);
+            })
+            .catch(function(err) {
+                logger.info(JSON.stringify(err));
+            });
+    });
+};
+
+Migration.prototype.removeColumn = function(table, column) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface
+            .removeColumn(table, column)
+            .then(function() {
+                logger.info('Removed column %s from %s', column, table);
+            })
+            .catch(function(err) {
+                logger.info(
+                    util.inspect(err, {
+                        showHidden: false,
+                        depth: null
+                    })
+                );
+            });
+    });
+};
+
+Migration.prototype.renameColumn = function(table, oldColumn, newColumn) {
+    var _this = this;
+    this.sequence.enqueue(function() {
+        return _this.queryInterface
+            .renameColumn(table, oldColumn, newColumn)
+            .then(function() {
+                logger.info('Renamed column from %s to %s on %s', oldColumn, newColumn, table);
+            })
+            .catch(function(err) {
+                logger.info(
+                    util.inspect(err, {
+                        showHidden: false,
+                        depth: null
+                    })
+                );
+            });
+    });
+};
+
+Migration.prototype.final = function(resolve) {
+    this.sequence.enqueue(function() {
+        return resolve();
+    });
+};
+
+module.exports = {
+    up: function(queryInterface, Sequelize) {
+        return new BPromise(function(resolve) {
+            var migration = new Migration(queryInterface);
+
+            // START INTEGRATIONS
+            migration.query('ALTER TABLE int_desk_fields add UNIQUE INDEX desk_unique_index (idField, FieldId)');
+            migration.query('ALTER TABLE int_freshdesk_fields add UNIQUE INDEX desk_unique_index (idField, FieldId)');
+            migration.query('ALTER TABLE int_salesforce_fields add UNIQUE INDEX salesforce_unique_index (idField, FieldId)');
+            migration.query('ALTER TABLE int_sugarcrm_fields add UNIQUE INDEX sugarcrm_unique_index (idField, FieldId)');
+            migration.query('ALTER TABLE int_vtiger_fields add UNIQUE INDEX vtiger_unique_index (idField, FieldId)');
+            migration.query('ALTER TABLE int_zendesk_fields add UNIQUE INDEX zendesk_unique_index (idField, FieldId)');
+            migration.query('ALTER TABLE int_zoho_fields add UNIQUE INDEX zoho_unique_index (idField, FieldId)');
+            // END INTEGRATIONS
+
+            // START FINAL
+            migration.final(resolve);
+            // END FINAL
+        });
+    },
+
+    down: function(queryInterface, Sequelize) {
+        // var migration = new Migration(queryInterface);
+    }
+};
\ No newline at end of file
index 60fc734..d42945a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f17=['CmHopperHistory','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','IntervalId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','MailApplication','List','ListId','TemplateId','Teams','MailInteractionId','Account','mail_interaction_has_tags','Tags','Users','Attachments','restrict','Dashboard','Items','FaxApplication','FaxInteractionId','FaxAccountId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','TagId','SmsInteractionId','Owner','sms_interaction_has_tags','ThroughTags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueue','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','Queue','Website','ChatInteractionId','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','HopperFinals','OpenchannelInteractions','MailInteractions','cm_contact_has_tags','Agent','CampaignId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','Subject','FieldId','Description','Field','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZohoField','FreshdeskAccount','VtigerAccount','ChatQueueReport','ToId','JscriptyQuestionReport','SessionId','ProjectId','team_has_voice_queues','team_has_openchannel_queues','OpenchannelQueues','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','UserProfileSections','UserProfileResource','Resources','sectionId','path','sequelize','lodash','determine','defaultsDeep','motion2','127.0.0.1','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','mysql','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','Integration','../api/integration/integration.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','hasOne','UserId','hasMany','UserVoiceQueueRt','Extensions','HopperHistory','SmsInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','FaxInteractions','user_has_fax_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','UserOpenchannelQueue','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','cascade','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers'];(function(_0x9a9bd,_0x484f48){var _0x1a21a1=function(_0x465e71){while(--_0x465e71){_0x9a9bd['push'](_0x9a9bd['shift']());}};_0x1a21a1(++_0x484f48);}(_0x4f17,0x9e));var _0x74f1=function(_0x26393b,_0x449a84){_0x26393b=_0x26393b-0x0;var _0x57230a=_0x4f17[_0x26393b];return _0x57230a;};'use strict';var path=require(_0x74f1('0x0'));var config=require('../config/environment');var Sequelize=require(_0x74f1('0x1'));var _=require(_0x74f1('0x2'));var jstz=require('jstz');var timezone=jstz[_0x74f1('0x3')]();config[_0x74f1('0x1')]=_[_0x74f1('0x4')](config[_0x74f1('0x1')],{'database':_0x74f1('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x74f1('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x74f1('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x74f1('0x8'),'collate':_0x74f1('0x9')}}});config[_0x74f1('0xa')]=_['defaultsDeep'](config[_0x74f1('0xa')],{'database':'motion2','username':_0x74f1('0xb'),'password':'xC@LL1234','options':{'host':_0x74f1('0x6'),'port':0xcea,'dialect':_0x74f1('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x74f1('0x8'),'collate':_0x74f1('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x74f1('0x1')][_0x74f1('0xd')],config[_0x74f1('0x1')][_0x74f1('0xe')],config[_0x74f1('0x1')][_0x74f1('0xf')],config[_0x74f1('0x1')][_0x74f1('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x74f1('0xd')],config['sequelizeHistory'][_0x74f1('0xe')],config['sequelizeHistory'][_0x74f1('0xf')],config[_0x74f1('0xa')][_0x74f1('0x10')])};db[_0x74f1('0x11')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x12'));db[_0x74f1('0x13')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0x15'));db['VoiceContext']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x16'));db[_0x74f1('0x17')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x18'));db[_0x74f1('0x19')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x1a'));db[_0x74f1('0x1b')]=db['sequelize']['import']('../api/voiceQueue/voiceQueue.model');db[_0x74f1('0x1c')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x1d'));db[_0x74f1('0x1e')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x1f'));db[_0x74f1('0x20')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x21'));db[_0x74f1('0x22')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x23'));db['VoiceAgentReport']=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x74f1('0x24')]=db['sequelize']['import'](_0x74f1('0x25'));db[_0x74f1('0x26')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x27'));db[_0x74f1('0x28')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x29'));db[_0x74f1('0x2a')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x2b'));db['UserVoiceQueueRt']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x2c'));db[_0x74f1('0x2d')]=db['sequelize'][_0x74f1('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x74f1('0x2e')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x2f'));db['UserMailQueue']=db[_0x74f1('0x1')]['import'](_0x74f1('0x30'));db[_0x74f1('0x31')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x32'));db[_0x74f1('0x33')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x34'));db['UserOpenchannelQueue']=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x74f1('0x35')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x36'));db[_0x74f1('0x37')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x38'));db[_0x74f1('0x39')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x3a'));db[_0x74f1('0x3b')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x3c'));db[_0x74f1('0x3d')]=db['sequelize'][_0x74f1('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x74f1('0x3e')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x3f'));db[_0x74f1('0x40')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0x41'));db['MailApplication']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x42'));db[_0x74f1('0x43')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x44'));db[_0x74f1('0x45')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x46'));db[_0x74f1('0x47')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0x74f1('0x1')]['import'](_0x74f1('0x48'));db[_0x74f1('0x49')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x4a'));db[_0x74f1('0x4b')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x4c'));db[_0x74f1('0x4d')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0x74f1('0x1')]['import'](_0x74f1('0x4e'));db[_0x74f1('0x4f')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x50'));db[_0x74f1('0x51')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x52'));db[_0x74f1('0x53')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x54'));db['SmsMessage']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x55'));db[_0x74f1('0x56')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x57'));db[_0x74f1('0x58')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x59'));db[_0x74f1('0x5a')]=db[_0x74f1('0x1')]['import']('../api/openchannelApplication/openchannelApplication.model');db[_0x74f1('0x5b')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x5c'));db[_0x74f1('0x5d')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x5e'));db['OpenchannelQueue']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x5f'));db[_0x74f1('0x60')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0x74f1('0x61')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x62'));db[_0x74f1('0x63')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x64'));db[_0x74f1('0x65')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x66'));db[_0x74f1('0x67')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x68'));db[_0x74f1('0x69')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x6a'));db[_0x74f1('0x6b')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x6c'));db[_0x74f1('0x6d')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x6e'));db[_0x74f1('0x6f')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x74f1('0x70')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x71'));db[_0x74f1('0x72')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x73'));db[_0x74f1('0x74')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x75'));db[_0x74f1('0x76')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x77'));db[_0x74f1('0x78')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0x79'));db['CmHopperHistory']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x7a'));db[_0x74f1('0x7b')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x7c'));db['CmCustomField']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x7d'));db[_0x74f1('0x7e')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x7f'));db[_0x74f1('0x80')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x81'));db['CannedAnswer']=db['sequelize'][_0x74f1('0x14')](_0x74f1('0x82'));db[_0x74f1('0x83')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/disposition/disposition.model');db[_0x74f1('0x84')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x85'));db[_0x74f1('0x86')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x87'));db[_0x74f1('0x88')]=db[_0x74f1('0x1')]['import']('../api/pause/pause.model');db[_0x74f1('0x89')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0x8a'));db[_0x74f1('0x8b')]=db['sequelize'][_0x74f1('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x74f1('0x1')]['import'](_0x74f1('0x8c'));db[_0x74f1('0x8d')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x8e'));db[_0x74f1('0x8f')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x90'));db[_0x74f1('0x91')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x92'));db[_0x74f1('0x93')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x94'));db[_0x74f1('0x95')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x96'));db['Integration']=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x74f1('0x1')]['import'](_0x74f1('0x97'));db[_0x74f1('0x98')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x99'));db[_0x74f1('0x9a')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0x9b'));db[_0x74f1('0x9c')]=db[_0x74f1('0x1')]['import'](_0x74f1('0x9d'));db[_0x74f1('0x9e')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0x9f'));db[_0x74f1('0xa0')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xa1'));db[_0x74f1('0xa2')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xa3'));db[_0x74f1('0xa4')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xa5'));db['SalesforceConfiguration']=db[_0x74f1('0x1')]['import'](_0x74f1('0xa6'));db['SalesforceField']=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xa7'));db[_0x74f1('0xa8')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xa9'));db[_0x74f1('0xaa')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xab'));db[_0x74f1('0xac')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xad'));db[_0x74f1('0xae')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xaf'));db[_0x74f1('0xb0')]=db['sequelize']['import'](_0x74f1('0xb1'));db[_0x74f1('0xb2')]=db['sequelize']['import'](_0x74f1('0xb3'));db['ZohoAccount']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xb4'));db[_0x74f1('0xb5')]=db[_0x74f1('0x1')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/intZohoField/intZohoField.model');db[_0x74f1('0xb6')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x74f1('0xb7')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xb8'));db[_0x74f1('0xb9')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xba'));db['FreshdeskAccount']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xbb'));db[_0x74f1('0xbc')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xbd'));db[_0x74f1('0xbe')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xbf'));db['VtigerAccount']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xc0'));db[_0x74f1('0xc1')]=db['sequelize']['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x74f1('0xc2')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xc3'));db[_0x74f1('0xc4')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xc5'));db['Network']=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xc6'));db['ChatQueueReport']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xc7'));db[_0x74f1('0xc8')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x74f1('0xc9')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xca'));db['JscriptyQuestionReport']=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xcb'));db['JscriptySessionReport']=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xcc'));db[_0x74f1('0xcd')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xce'));db['SquareReport']=db['sequelize'][_0x74f1('0x14')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0x74f1('0x1')]['import'](_0x74f1('0xcf'));db[_0x74f1('0xd0')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xd1'));db[_0x74f1('0xd2')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xd3'));db[_0x74f1('0xd4')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xd5'));db[_0x74f1('0xd6')]=db[_0x74f1('0x1')]['import'](_0x74f1('0xd7'));db['SquareRecording']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xd8'));db[_0x74f1('0xd9')]=db[_0x74f1('0x1')]['import'](_0x74f1('0xda'));db[_0x74f1('0xdb')]=db[_0x74f1('0x1')]['import'](_0x74f1('0xdc'));db['License']=db[_0x74f1('0x1')]['import'](_0x74f1('0xdd'));db[_0x74f1('0xde')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xdf'));db[_0x74f1('0xe0')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/migration/migration.model');db[_0x74f1('0xe1')]=db[_0x74f1('0x1')]['import']('../api/attachment/attachment.model');db[_0x74f1('0xe2')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xe3'));db[_0x74f1('0xe4')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xe5'));db['ChatTransferReport']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xe6'));db[_0x74f1('0xe7')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xe8'));db[_0x74f1('0xe9')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xea'));db['SmsTransferReport']=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xeb'));db[_0x74f1('0xec')]=db[_0x74f1('0x1')][_0x74f1('0x14')](_0x74f1('0xed'));db['VoicePrefix']=db[_0x74f1('0x1')]['import'](_0x74f1('0xee'));db[_0x74f1('0xef')]=db['sequelize'][_0x74f1('0x14')](_0x74f1('0xf0'));db[_0x74f1('0xf1')]=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x74f1('0x1')][_0x74f1('0x14')]('../api/userProfileResource/userProfileResource.model');db['User'][_0x74f1('0xf2')](db[_0x74f1('0x1e')],{'as':_0x74f1('0x1e'),'onDelete':'cascade','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')][_0x74f1('0xf4')](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')][_0x74f1('0xf4')](db[_0x74f1('0xf5')],{'as':'VoiceQueuesRt','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')]['hasMany'](db[_0x74f1('0x17')],{'as':_0x74f1('0xf6'),'onDelete':'cascade','hooks':!![]});db[_0x74f1('0x11')][_0x74f1('0xf4')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')][_0x74f1('0xf4')](db['CmHopperHistory'],{'as':_0x74f1('0xf7'),'foreignKey':_0x74f1('0xf3')});db['User'][_0x74f1('0xf4')](db[_0x74f1('0x7b')],{'as':_0x74f1('0x7b'),'foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')][_0x74f1('0xf4')](db[_0x74f1('0x5b')],{'as':'OpenchannelInteractions','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')]['hasMany'](db[_0x74f1('0x65')],{'as':'ChatInteractions','foreignKey':_0x74f1('0xf3')});db['User'][_0x74f1('0xf4')](db['SmsInteraction'],{'as':_0x74f1('0xf8'),'foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')]['hasMany'](db[_0x74f1('0x49')],{'as':'FaxInteractions','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')][_0x74f1('0xf4')](db[_0x74f1('0x3e')],{'as':'MailInteractions','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x11')][_0x74f1('0xf9')](db[_0x74f1('0xef')],{'as':_0x74f1('0xef'),'foreignKey':_0x74f1('0xfa')});db['User'][_0x74f1('0xfb')](db[_0x74f1('0x6d')],{'as':_0x74f1('0xfc'),'through':_0x74f1('0xfd')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db['CmContact'],{'as':_0x74f1('0xfe'),'through':_0x74f1('0xff')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0xec')],{'as':_0x74f1('0x100'),'through':_0x74f1('0x101')});db[_0x74f1('0x11')]['belongsToMany'](db['Team'],{'through':_0x74f1('0x102')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x3e')],{'as':'MailInteractions','through':_0x74f1('0x103')});db['User'][_0x74f1('0xfb')](db['ChatInteraction'],{'as':_0x74f1('0x104'),'through':'user_has_chat_interactions'});db['User'][_0x74f1('0xfb')](db['FaxInteraction'],{'as':_0x74f1('0x105'),'through':_0x74f1('0x106')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x53')],{'as':_0x74f1('0xf8'),'through':'user_has_sms_interactions'});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x5b')],{'as':'OpenchannelInteractions','through':_0x74f1('0x107')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x1b')],{'as':_0x74f1('0x108'),'through':'UserVoiceQueue','required':![]});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x3b')],{'as':_0x74f1('0x109'),'through':_0x74f1('0x10a'),'required':![]});db[_0x74f1('0x11')]['belongsToMany'](db[_0x74f1('0x6b')],{'as':_0x74f1('0x10b'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x74f1('0x4d')],{'as':_0x74f1('0x10c'),'through':_0x74f1('0x31'),'required':![]});db[_0x74f1('0x11')][_0x74f1('0xfb')](db['SmsQueue'],{'as':_0x74f1('0x10d'),'through':_0x74f1('0x33'),'required':![]});db[_0x74f1('0x11')]['belongsToMany'](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x74f1('0x10e'),'required':![]});db[_0x74f1('0x11')][_0x74f1('0xfb')](db['CmList'],{'through':_0x74f1('0x101')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0x74f1('0x10f'),'required':![]});db['User'][_0x74f1('0xfb')](db[_0x74f1('0x60')],{'as':_0x74f1('0x110'),'through':_0x74f1('0x111')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x47')],{'as':_0x74f1('0x112'),'through':_0x74f1('0x113')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x39')],{'as':_0x74f1('0x114'),'through':_0x74f1('0x115')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db['OpenchannelAccount'],{'as':_0x74f1('0x116'),'through':_0x74f1('0x117')});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0x4f')],{'as':_0x74f1('0x118'),'through':'user_has_sms_accounts'});db[_0x74f1('0x11')][_0x74f1('0xfb')](db[_0x74f1('0xd6')],{'as':_0x74f1('0x119'),'through':_0x74f1('0x11a')});db[_0x74f1('0x13')][_0x74f1('0xf4')](db['VoiceExtension'],{'as':_0x74f1('0x11b'),'onDelete':'cascade','foreignKey':_0x74f1('0x11c')});db[_0x74f1('0x11d')][_0x74f1('0xf4')](db[_0x74f1('0x17')],{'onDelete':'cascade'});db['VoiceExtension']['hasMany'](db[_0x74f1('0x17')],{'as':_0x74f1('0x11e'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0x19')][_0x74f1('0xfb')](db[_0x74f1('0x8d')],{'as':_0x74f1('0x120'),'through':_0x74f1('0x121')});db[_0x74f1('0x1b')][_0x74f1('0xf4')](db['UserVoiceQueueRt'],{'as':_0x74f1('0x122'),'foreignKey':_0x74f1('0x123')});db[_0x74f1('0x1b')]['hasMany'](db[_0x74f1('0x74')],{'as':_0x74f1('0x124'),'foreignKey':_0x74f1('0x123')});db[_0x74f1('0x1b')][_0x74f1('0xf4')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x74f1('0x123')});db['VoiceQueue'][_0x74f1('0xf4')](db[_0x74f1('0x125')],{'as':_0x74f1('0x126'),'foreignKey':_0x74f1('0x123')});db[_0x74f1('0x1b')][_0x74f1('0xf4')](db[_0x74f1('0x7b')],{'as':_0x74f1('0x7b'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x74f1('0xf4')](db[_0x74f1('0x76')],{'as':_0x74f1('0x127'),'foreignKey':_0x74f1('0x123')});db[_0x74f1('0x1b')][_0x74f1('0xf4')](db[_0x74f1('0x128')],{'as':_0x74f1('0x129'),'foreignKey':'VoiceQueueId'});db[_0x74f1('0x1b')]['belongsTo'](db[_0x74f1('0x28')],{'as':_0x74f1('0x28'),'foreignKey':_0x74f1('0x12a')});db[_0x74f1('0x1b')][_0x74f1('0xf9')](db[_0x74f1('0x28')],{'as':_0x74f1('0x12b'),'foreignKey':'TrunkBackupId'});db[_0x74f1('0x1b')][_0x74f1('0xf9')](db[_0x74f1('0x86')],{'as':_0x74f1('0x86'),'foreignKey':_0x74f1('0x12c')});db[_0x74f1('0x1b')]['belongsToMany'](db[_0x74f1('0xec')],{'as':_0x74f1('0x100'),'through':_0x74f1('0x12d')});db[_0x74f1('0x1b')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':_0x74f1('0x12e'),'through':'UserVoiceQueue'});db[_0x74f1('0x1b')][_0x74f1('0xfb')](db['Team'],{'as':'Teams','through':'team_has_voice_queues'});db[_0x74f1('0x1b')][_0x74f1('0xfb')](db[_0x74f1('0xec')],{'as':_0x74f1('0x12f'),'through':_0x74f1('0x130')});db['VoiceRecording'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':'User','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x1e')][_0x74f1('0xf4')](db[_0x74f1('0x20')],{'as':_0x74f1('0x131'),'onDelete':_0x74f1('0x11f'),'foreignKey':'mailboxuser','sourceKey':_0x74f1('0x132')});db[_0x74f1('0x20')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x74f1('0x133'),'targetKey':_0x74f1('0x132')});db[_0x74f1('0x134')]['hasMany'](db[_0x74f1('0x24')],{'as':_0x74f1('0x135'),'foreignKey':_0x74f1('0x136'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x74f1('0x137')],{'as':_0x74f1('0x138'),'foreignKey':_0x74f1('0x136'),'constraints':![]});db[_0x74f1('0x134')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':_0x74f1('0x11'),'foreignKey':'UserId'});db[_0x74f1('0x134')][_0x74f1('0xf9')](db['CmContact'],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x35')][_0x74f1('0xf9')](db['MailAccount'],{'as':_0x74f1('0x39'),'foreignKey':_0x74f1('0x13b')});db['MailServerOut'][_0x74f1('0xf9')](db[_0x74f1('0x39')],{'as':'MailAccount','foreignKey':_0x74f1('0x13b')});db[_0x74f1('0x39')][_0x74f1('0xf2')](db[_0x74f1('0x35')],{'as':_0x74f1('0x13c'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0x39')][_0x74f1('0xf2')](db[_0x74f1('0x37')],{'as':_0x74f1('0x13d'),'onDelete':_0x74f1('0x11f')});db['MailAccount'][_0x74f1('0xf4')](db[_0x74f1('0x83')],{'as':_0x74f1('0x13e'),'foreignKey':_0x74f1('0x13b')});db[_0x74f1('0x39')]['hasMany'](db[_0x74f1('0x13f')],{'as':_0x74f1('0x140'),'foreignKey':_0x74f1('0x13b')});db[_0x74f1('0x39')]['hasMany'](db[_0x74f1('0x40')],{'as':_0x74f1('0x131'),'foreignKey':'MailAccountId'});db[_0x74f1('0x39')]['hasMany'](db['MailInteraction'],{'as':_0x74f1('0x141')});db[_0x74f1('0x39')][_0x74f1('0xf4')](db[_0x74f1('0x142')],{'as':_0x74f1('0x11e')});db[_0x74f1('0x39')][_0x74f1('0xf9')](db[_0x74f1('0xec')],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0x39')][_0x74f1('0xf9')](db[_0x74f1('0x91')],{'as':_0x74f1('0x91'),'foreignKey':_0x74f1('0x145')});db[_0x74f1('0x39')][_0x74f1('0xfb')](db['User'],{'as':'Agents','through':_0x74f1('0x115')});db[_0x74f1('0x3b')]['belongsToMany'](db[_0x74f1('0x11')],{'as':'Agents','through':_0x74f1('0x10a')});db['MailQueue'][_0x74f1('0xfb')](db[_0x74f1('0xdb')],{'through':'team_has_mail_queues','as':_0x74f1('0x146')});db[_0x74f1('0x3e')][_0x74f1('0xf4')](db[_0x74f1('0x40')],{'as':_0x74f1('0x131'),'onDelete':'cascade','foreignKey':_0x74f1('0x147')});db[_0x74f1('0x3e')][_0x74f1('0xf9')](db[_0x74f1('0x39')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x13b')});db['MailInteraction'][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':'Contact','foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x3e')]['belongsTo'](db[_0x74f1('0x11')],{'as':'Owner','foreignKey':_0x74f1('0xf3')});db['MailInteraction'][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':_0x74f1('0x149'),'as':_0x74f1('0x14a')});db['MailInteraction'][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x74f1('0x3e')][_0x74f1('0xfb')](db['User'],{'as':_0x74f1('0x14b'),'through':_0x74f1('0x103'),'foreignKey':_0x74f1('0x147')});db[_0x74f1('0x40')][_0x74f1('0xf4')](db[_0x74f1('0xe1')],{'as':_0x74f1('0x14c'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0x40')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':_0x74f1('0x11')});db[_0x74f1('0x40')]['belongsTo'](db[_0x74f1('0x72')],{'onDelete':_0x74f1('0x11f'),'as':_0x74f1('0x139')});db[_0x74f1('0x40')]['belongsTo'](db[_0x74f1('0x3e')],{'as':'Interaction','foreignKey':_0x74f1('0x147')});db['MailMessage']['belongsTo'](db[_0x74f1('0x39')],{'as':_0x74f1('0x148'),'foreignKey':'MailAccountId'});db['MailApplication'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'onDelete':_0x74f1('0x14d')});db['MailApplication'][_0x74f1('0xf9')](db[_0x74f1('0x3b')],{'onDelete':_0x74f1('0x14d')});db['MailApplication'][_0x74f1('0xf9')](db[_0x74f1('0x39')],{'onDelete':_0x74f1('0x14d')});db[_0x74f1('0x142')][_0x74f1('0xf9')](db[_0x74f1('0x86')],{'onDelete':_0x74f1('0x14d'),'foreignKey':_0x74f1('0x12c')});db[_0x74f1('0x142')][_0x74f1('0xf9')](db[_0x74f1('0x8f')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x74f1('0x43')][_0x74f1('0xf9')](db[_0x74f1('0x39')],{});db[_0x74f1('0x43')][_0x74f1('0xf9')](db[_0x74f1('0xec')],{'as':'List','foreignKey':_0x74f1('0x144')});db[_0x74f1('0x43')][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':'Contact','foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x43')][_0x74f1('0xf9')](db[_0x74f1('0x3e')],{});db[_0x74f1('0x43')]['belongsTo'](db[_0x74f1('0x40')],{});db[_0x74f1('0x43')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{});db[_0x74f1('0x43')][_0x74f1('0xf9')](db['MailQueue'],{});db[_0x74f1('0x14e')][_0x74f1('0xf4')](db[_0x74f1('0x45')],{'as':_0x74f1('0x14f'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0x47')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'FaxAccountId'});db[_0x74f1('0x47')][_0x74f1('0xf4')](db[_0x74f1('0x13f')],{'as':_0x74f1('0x140'),'foreignKey':'FaxAccountId'});db[_0x74f1('0x47')]['hasMany'](db['FaxInteraction'],{'as':_0x74f1('0x141')});db[_0x74f1('0x47')][_0x74f1('0xf4')](db[_0x74f1('0x150')],{'as':'Applications'});db['FaxAccount']['hasMany'](db[_0x74f1('0x17')],{'as':'Exntensions','onDelete':_0x74f1('0x11f')});db[_0x74f1('0x47')][_0x74f1('0xf4')](db[_0x74f1('0x4b')],{'as':_0x74f1('0x131')});db[_0x74f1('0x47')][_0x74f1('0xf9')](db[_0x74f1('0x28')],{'as':_0x74f1('0x28')});db[_0x74f1('0x47')]['belongsTo'](db[_0x74f1('0xec')],{'as':'List','foreignKey':_0x74f1('0x144')});db[_0x74f1('0x47')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':_0x74f1('0x12e'),'through':_0x74f1('0x113')});db[_0x74f1('0x150')][_0x74f1('0xf9')](db['User'],{'onDelete':_0x74f1('0x14d')});db[_0x74f1('0x150')][_0x74f1('0xf9')](db[_0x74f1('0x4d')],{'onDelete':'restrict'});db[_0x74f1('0x150')][_0x74f1('0xf9')](db[_0x74f1('0x47')],{'onDelete':'restrict'});db[_0x74f1('0x150')]['belongsTo'](db['Tag'],{'onDelete':_0x74f1('0x14d'),'foreignKey':'TagId'});db[_0x74f1('0x49')][_0x74f1('0xf4')](db[_0x74f1('0x4b')],{'as':'Messages','onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x151')});db[_0x74f1('0x49')][_0x74f1('0xf9')](db[_0x74f1('0x47')],{'as':'Account','foreignKey':_0x74f1('0x152')});db['FaxInteraction'][_0x74f1('0xf9')](db['CmContact'],{'as':_0x74f1('0x139'),'foreignKey':'ContactId'});db['FaxInteraction'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':'Owner','foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x49')][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':_0x74f1('0x153'),'as':_0x74f1('0x14a')});db[_0x74f1('0x49')][_0x74f1('0xfb')](db['Tag'],{'through':_0x74f1('0x153'),'as':'ThroughTags'});db['FaxInteraction'][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':_0x74f1('0x14b'),'through':_0x74f1('0x106'),'foreignKey':_0x74f1('0x151')});db[_0x74f1('0x4b')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'onDelete':_0x74f1('0x11f'),'as':_0x74f1('0x11')});db[_0x74f1('0x4b')]['belongsTo'](db[_0x74f1('0x49')],{'as':_0x74f1('0x154'),'foreignKey':_0x74f1('0x151')});db['FaxMessage']['belongsTo'](db[_0x74f1('0x72')],{'onDelete':_0x74f1('0x11f'),'as':'Contact'});db[_0x74f1('0x4b')][_0x74f1('0xf9')](db[_0x74f1('0xe1')],{'as':'Attachment','foreignKey':_0x74f1('0x155')});db[_0x74f1('0x4b')]['belongsTo'](db['FaxAccount'],{'as':_0x74f1('0x148'),'foreignKey':'FaxAccountId'});db[_0x74f1('0x4d')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':_0x74f1('0x12e'),'through':'UserFaxQueue'});db['FaxQueue']['belongsToMany'](db[_0x74f1('0xdb')],{'through':_0x74f1('0x156'),'as':_0x74f1('0x146')});db[_0x74f1('0x157')][_0x74f1('0xf9')](db[_0x74f1('0x47')],{});db[_0x74f1('0x157')][_0x74f1('0xf9')](db['CmList'],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0x157')][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db['FaxQueueReport'][_0x74f1('0xf9')](db['FaxInteraction'],{});db[_0x74f1('0x157')]['belongsTo'](db[_0x74f1('0x4b')],{});db[_0x74f1('0x157')][_0x74f1('0xf9')](db['User'],{});db[_0x74f1('0x157')]['belongsTo'](db[_0x74f1('0x4d')],{});db[_0x74f1('0x4f')][_0x74f1('0xf4')](db[_0x74f1('0x83')],{'as':'Dispositions','foreignKey':'SmsAccountId'});db[_0x74f1('0x4f')]['hasMany'](db[_0x74f1('0x13f')],{'as':'Answers','foreignKey':_0x74f1('0x158')});db[_0x74f1('0x4f')]['hasMany'](db[_0x74f1('0x159')],{'as':_0x74f1('0x131'),'foreignKey':_0x74f1('0x158')});db[_0x74f1('0x4f')][_0x74f1('0xf4')](db[_0x74f1('0x53')],{'as':_0x74f1('0x141')});db['SmsAccount'][_0x74f1('0xf4')](db[_0x74f1('0x51')],{'as':_0x74f1('0x11e')});db['SmsAccount'][_0x74f1('0xf9')](db[_0x74f1('0xec')],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0x4f')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':'Agents','through':'user_has_sms_accounts'});db['SmsApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x74f1('0x51')][_0x74f1('0xf9')](db[_0x74f1('0x56')],{'onDelete':_0x74f1('0x14d')});db[_0x74f1('0x51')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x74f1('0x14d')});db['SmsApplication'][_0x74f1('0xf9')](db[_0x74f1('0x86')],{'onDelete':_0x74f1('0x14d'),'foreignKey':_0x74f1('0x12c')});db['SmsApplication'][_0x74f1('0xf9')](db[_0x74f1('0x8f')],{'onDelete':'restrict','foreignKey':_0x74f1('0x15a')});db[_0x74f1('0x53')][_0x74f1('0xf4')](db['SmsMessage'],{'as':_0x74f1('0x131'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x15b')});db[_0x74f1('0x53')][_0x74f1('0xf9')](db[_0x74f1('0x4f')],{'as':'Account','foreignKey':_0x74f1('0x158')});db[_0x74f1('0x53')]['belongsTo'](db[_0x74f1('0x72')],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db['SmsInteraction'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':_0x74f1('0x15c'),'foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x53')][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':'sms_interaction_has_tags','as':_0x74f1('0x14a')});db[_0x74f1('0x53')]['belongsToMany'](db[_0x74f1('0x8f')],{'through':_0x74f1('0x15d'),'as':_0x74f1('0x15e')});db[_0x74f1('0x53')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x74f1('0x159')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':_0x74f1('0x11')});db[_0x74f1('0x159')]['belongsTo'](db['CmContact'],{'onDelete':_0x74f1('0x11f'),'as':'Contact'});db['SmsMessage'][_0x74f1('0xf9')](db['SmsInteraction'],{'onDelete':_0x74f1('0x11f'),'as':'Interaction','foreignKey':_0x74f1('0x15b')});db[_0x74f1('0x159')][_0x74f1('0xf9')](db[_0x74f1('0x4f')],{'as':_0x74f1('0x148'),'foreignKey':'SmsAccountId'});db[_0x74f1('0x56')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x74f1('0x33'),'foreignKey':_0x74f1('0x15f')});db['SmsQueue'][_0x74f1('0xfb')](db[_0x74f1('0xdb')],{'through':_0x74f1('0x160'),'as':_0x74f1('0x146')});db['OpenchannelAccount'][_0x74f1('0xf4')](db[_0x74f1('0x83')],{'as':_0x74f1('0x13e'),'foreignKey':_0x74f1('0x161')});db['OpenchannelAccount'][_0x74f1('0xf4')](db['CannedAnswer'],{'as':_0x74f1('0x140'),'foreignKey':_0x74f1('0x161')});db[_0x74f1('0x58')][_0x74f1('0xf4')](db[_0x74f1('0x5b')],{'as':_0x74f1('0x141'),'foreignKey':_0x74f1('0x161')});db['OpenchannelAccount'][_0x74f1('0xf4')](db[_0x74f1('0x5d')],{'as':_0x74f1('0x131'),'foreignKey':_0x74f1('0x161')});db[_0x74f1('0x58')][_0x74f1('0xf4')](db['OpenchannelApplication'],{'as':_0x74f1('0x11e'),'foreignKey':_0x74f1('0x161')});db['OpenchannelAccount'][_0x74f1('0xf9')](db['CmList'],{'as':_0x74f1('0x143'),'foreignKey':'ListId'});db[_0x74f1('0x58')][_0x74f1('0xfb')](db['User'],{'as':_0x74f1('0x12e'),'through':_0x74f1('0x117')});db[_0x74f1('0x5a')]['belongsTo'](db[_0x74f1('0x11')],{'onDelete':_0x74f1('0x14d')});db['OpenchannelApplication'][_0x74f1('0xf9')](db[_0x74f1('0x162')],{'onDelete':_0x74f1('0x14d'),'foreignKey':_0x74f1('0x163')});db[_0x74f1('0x5a')][_0x74f1('0xf9')](db[_0x74f1('0x58')],{'onDelete':_0x74f1('0x14d'),'foreignKey':_0x74f1('0x161')});db[_0x74f1('0x5a')][_0x74f1('0xf9')](db['Interval'],{'onDelete':_0x74f1('0x14d'),'foreignKey':_0x74f1('0x12c')});db[_0x74f1('0x5a')]['belongsTo'](db[_0x74f1('0x8f')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x74f1('0x5b')]['hasMany'](db[_0x74f1('0x5d')],{'as':'Messages','onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x164')});db['OpenchannelInteraction'][_0x74f1('0xf9')](db[_0x74f1('0x58')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x161')});db[_0x74f1('0x5b')][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':'Contact','foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x5b')][_0x74f1('0xf9')](db['User'],{'as':_0x74f1('0x15c'),'foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x5b')][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':'openchannel_interaction_has_tags','as':_0x74f1('0x14a')});db[_0x74f1('0x5b')][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':_0x74f1('0x165'),'as':_0x74f1('0x15e')});db['OpenchannelInteraction'][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':_0x74f1('0x14b'),'through':_0x74f1('0x107'),'foreignKey':_0x74f1('0x164')});db[_0x74f1('0x5d')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'onDelete':_0x74f1('0x11f'),'as':_0x74f1('0x11')});db['OpenchannelMessage'][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'onDelete':_0x74f1('0x11f'),'as':_0x74f1('0x139')});db[_0x74f1('0x5d')][_0x74f1('0xf9')](db[_0x74f1('0x5b')],{'onDelete':'cascade','as':_0x74f1('0x154'),'foreignKey':'OpenchannelInteractionId'});db[_0x74f1('0x5d')][_0x74f1('0xf9')](db[_0x74f1('0xe1')],{'as':_0x74f1('0xe1'),'foreignKey':_0x74f1('0x155')});db[_0x74f1('0x5d')][_0x74f1('0xf9')](db[_0x74f1('0x58')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x161')});db[_0x74f1('0x162')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':_0x74f1('0x12e'),'through':_0x74f1('0x10e'),'foreignKey':_0x74f1('0x163')});db['OpenchannelQueue']['belongsToMany'](db[_0x74f1('0xdb')],{'through':'team_has_openchannel_queues','as':_0x74f1('0x146')});db['ChatWebsite']['hasMany'](db['Disposition'],{'as':_0x74f1('0x13e'),'foreignKey':_0x74f1('0x166')});db['ChatWebsite'][_0x74f1('0xf4')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x74f1('0x166')});db[_0x74f1('0x60')][_0x74f1('0xf4')](db['ChatProactiveAction'],{'as':_0x74f1('0x167')});db[_0x74f1('0x60')][_0x74f1('0xf4')](db['ChatInteraction'],{'as':_0x74f1('0x141')});db[_0x74f1('0x60')][_0x74f1('0xf4')](db[_0x74f1('0x63')],{'as':_0x74f1('0x11e')});db[_0x74f1('0x60')][_0x74f1('0xf4')](db[_0x74f1('0x67')],{'as':_0x74f1('0x131')});db[_0x74f1('0x60')][_0x74f1('0xf9')](db[_0x74f1('0xec')],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0x60')]['belongsTo'](db['Interval'],{'as':_0x74f1('0x86'),'foreignKey':'IntervalId'});db[_0x74f1('0x60')]['belongsToMany'](db[_0x74f1('0x11')],{'as':_0x74f1('0x12e'),'through':_0x74f1('0x111')});db[_0x74f1('0x61')][_0x74f1('0xf9')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x74f1('0xf9')](db['CmList'],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0x61')][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x61')][_0x74f1('0xf9')](db[_0x74f1('0x5b')],{});db[_0x74f1('0x61')][_0x74f1('0xf9')](db[_0x74f1('0x5d')],{});db[_0x74f1('0x61')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{});db[_0x74f1('0x61')][_0x74f1('0xf9')](db[_0x74f1('0x162')],{});db[_0x74f1('0x63')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0x74f1('0x63')][_0x74f1('0xf9')](db[_0x74f1('0x6b')],{'as':_0x74f1('0x168'),'foreignKey':'ChatQueueId','onDelete':_0x74f1('0x14d')});db['ChatApplication'][_0x74f1('0xf9')](db[_0x74f1('0x60')],{'as':_0x74f1('0x169'),'foreignKey':_0x74f1('0x166'),'onDelete':_0x74f1('0x14d')});db['ChatApplication']['belongsTo'](db['Tag'],{'onDelete':_0x74f1('0x14d'),'foreignKey':_0x74f1('0x15a')});db[_0x74f1('0x65')][_0x74f1('0xf4')](db['ChatMessage'],{'as':'Messages','onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x16a')});db[_0x74f1('0x65')][_0x74f1('0xf9')](db['ChatWebsite'],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x166')});db[_0x74f1('0x65')]['belongsTo'](db[_0x74f1('0x72')],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db['ChatInteraction'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':_0x74f1('0x15c'),'foreignKey':_0x74f1('0xf3')});db[_0x74f1('0x65')]['belongsToMany'](db[_0x74f1('0x8f')],{'through':'chat_interaction_has_tags','as':_0x74f1('0x14a')});db[_0x74f1('0x65')][_0x74f1('0xfb')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x74f1('0x15e')});db[_0x74f1('0x65')][_0x74f1('0xfb')](db['User'],{'as':_0x74f1('0x14b'),'through':_0x74f1('0x16b'),'foreignKey':_0x74f1('0x16a')});db[_0x74f1('0x67')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'onDelete':'cascade','as':'User'});db[_0x74f1('0x67')][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'onDelete':'cascade','as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x67')][_0x74f1('0xf9')](db[_0x74f1('0x65')],{'onDelete':'cascade','as':_0x74f1('0x154'),'foreignKey':_0x74f1('0x16a')});db[_0x74f1('0x67')][_0x74f1('0xf9')](db[_0x74f1('0xe1')],{'as':_0x74f1('0xe1'),'foreignKey':_0x74f1('0x155')});db[_0x74f1('0x67')][_0x74f1('0xf9')](db[_0x74f1('0x60')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x166')});db[_0x74f1('0x69')][_0x74f1('0xf9')](db['CmContact'],{'onDelete':'cascade','as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x69')]['belongsTo'](db[_0x74f1('0x60')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x166')});db[_0x74f1('0x6b')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':'Agents','through':_0x74f1('0x2e'),'hooks':!![]});db['ChatQueue'][_0x74f1('0xfb')](db[_0x74f1('0xdb')],{'through':_0x74f1('0x16c'),'as':'Teams'});db[_0x74f1('0x6d')][_0x74f1('0xf4')](db[_0x74f1('0xc8')],{'as':_0x74f1('0x131'),'foreignKey':_0x74f1('0x16d'),'onDelete':'cascade'});db[_0x74f1('0x6d')][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':_0x74f1('0x122'),'through':_0x74f1('0xfd')});db['ChatProactiveAction'][_0x74f1('0xf9')](db[_0x74f1('0x60')],{'as':'Website','foreignKey':_0x74f1('0x166')});db[_0x74f1('0x70')][_0x74f1('0xf4')](db['CmContact'],{'as':_0x74f1('0xfe'),'foreignKey':_0x74f1('0x16e')});db['CmContact']['hasMany'](db[_0x74f1('0x74')],{'as':_0x74f1('0x124'),'foreignKey':'ContactId'});db[_0x74f1('0x72')][_0x74f1('0xf4')](db[_0x74f1('0x78')],{'as':_0x74f1('0x16f'),'foreignKey':_0x74f1('0x13a')});db['CmContact']['hasMany'](db[_0x74f1('0x125')],{'as':_0x74f1('0x126'),'foreignKey':_0x74f1('0x13a')});db['CmContact'][_0x74f1('0xf4')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x72')][_0x74f1('0xf4')](db[_0x74f1('0x128')],{'as':_0x74f1('0x129'),'foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x72')]['hasMany'](db[_0x74f1('0x5b')],{'as':_0x74f1('0x170'),'foreignKey':'ContactId','onDelete':_0x74f1('0x14d')});db[_0x74f1('0x72')][_0x74f1('0xf4')](db[_0x74f1('0x65')],{'as':_0x74f1('0x104'),'foreignKey':_0x74f1('0x13a'),'onDelete':_0x74f1('0x14d')});db[_0x74f1('0x72')]['hasMany'](db[_0x74f1('0x53')],{'as':'SmsInteractions','foreignKey':_0x74f1('0x13a'),'onDelete':_0x74f1('0x14d')});db[_0x74f1('0x72')][_0x74f1('0xf4')](db[_0x74f1('0x49')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0x74f1('0x14d')});db['CmContact'][_0x74f1('0xf4')](db[_0x74f1('0x3e')],{'as':_0x74f1('0x171'),'foreignKey':_0x74f1('0x13a'),'onDelete':_0x74f1('0x14d')});db[_0x74f1('0x72')][_0x74f1('0xf9')](db[_0x74f1('0x70')],{'as':'Company','foreignKey':'CompanyId'});db[_0x74f1('0x72')][_0x74f1('0xf9')](db['CmList'],{'as':_0x74f1('0x143'),'foreignKey':'ListId','onDelete':_0x74f1('0x11f')});db['CmContact'][_0x74f1('0xfb')](db['User'],{'as':_0x74f1('0x14b'),'through':_0x74f1('0xff')});db[_0x74f1('0x72')][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'as':_0x74f1('0x14a'),'through':_0x74f1('0x172')});db['CmContact'][_0x74f1('0xfb')](db['Tag'],{'through':_0x74f1('0x172'),'as':_0x74f1('0x15e')});db[_0x74f1('0x74')][_0x74f1('0xf9')](db['CmContact'],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0x74')][_0x74f1('0xf9')](db[_0x74f1('0xec')],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144'),'onDelete':'cascade'});db['CmHopper'][_0x74f1('0xf9')](db['User'],{'as':_0x74f1('0x173'),'foreignKey':'UserId'});db[_0x74f1('0x74')][_0x74f1('0xf9')](db[_0x74f1('0x1b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0x74f1('0xf9')](db[_0x74f1('0xde')],{'as':_0x74f1('0xde'),'foreignKey':_0x74f1('0x174'),'onDelete':_0x74f1('0x11f')});db['CmHopper'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'as':_0x74f1('0x15c'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0x76')][_0x74f1('0xf9')](db[_0x74f1('0xec')],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0x76')][_0x74f1('0xf9')](db[_0x74f1('0x1b')],{'as':_0x74f1('0x168'),'foreignKey':_0x74f1('0x123'),'onDelete':'cascade'});db[_0x74f1('0x76')][_0x74f1('0xf9')](db[_0x74f1('0xde')],{'as':'Campaign','foreignKey':_0x74f1('0x174'),'onDelete':_0x74f1('0x11f')});db['Automation']['hasMany'](db[_0x74f1('0x84')],{'as':{'plural':_0x74f1('0x175'),'singular':_0x74f1('0x176')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x74f1('0x80')][_0x74f1('0xf4')](db[_0x74f1('0x84')],{'as':{'plural':_0x74f1('0x177'),'singular':_0x74f1('0x178')},'foreignKey':_0x74f1('0x179'),'onDelete':_0x74f1('0x11f'),'hooks':!![]});db[_0x74f1('0x80')]['hasMany'](db[_0x74f1('0x7e')],{'as':_0x74f1('0x17a'),'foreignKey':_0x74f1('0x17b'),'onDelete':_0x74f1('0x11f'),'hooks':!![]});db[_0x74f1('0x86')]['hasMany'](db[_0x74f1('0x86')],{'as':_0x74f1('0x17c'),'foreignKey':_0x74f1('0x12c'),'onDelete':_0x74f1('0x11f'),'hooks':!![],'required':![]});db[_0x74f1('0x86')][_0x74f1('0xf4')](db[_0x74f1('0x17')],{'as':'Extensions','foreignKey':_0x74f1('0x12c'),'onDelete':'restrict'});db['Interval'][_0x74f1('0xf4')](db['MailApplication'],{'as':_0x74f1('0x17d'),'foreignKey':_0x74f1('0x12c')});db[_0x74f1('0x86')][_0x74f1('0xf4')](db[_0x74f1('0x63')],{'as':_0x74f1('0x17e'),'foreignKey':_0x74f1('0x12c')});db[_0x74f1('0x86')][_0x74f1('0xf4')](db[_0x74f1('0x150')],{'as':_0x74f1('0x17f'),'foreignKey':_0x74f1('0x12c')});db[_0x74f1('0x86')][_0x74f1('0xf4')](db['SmsApplication'],{'as':_0x74f1('0x180'),'foreignKey':_0x74f1('0x12c')});db['Schedule'][_0x74f1('0xf9')](db['MailAccount'],{});db[_0x74f1('0x181')][_0x74f1('0xf9')](db[_0x74f1('0x9a')],{'foreignKey':_0x74f1('0x182')});db[_0x74f1('0x181')][_0x74f1('0xf9')](db[_0x74f1('0x98')],{'foreignKey':'CustomReportId'});db['Sound']['belongsToMany'](db[_0x74f1('0x19')],{'as':_0x74f1('0x183'),'through':_0x74f1('0x121'),'onDelete':_0x74f1('0x14d')});db[_0x74f1('0x8f')][_0x74f1('0xfb')](db['CmContact'],{'through':_0x74f1('0x172')});db[_0x74f1('0x8f')][_0x74f1('0xfb')](db[_0x74f1('0x65')],{'through':'chat_interaction_has_tags'});db[_0x74f1('0x8f')][_0x74f1('0xfb')](db['MailInteraction'],{'through':_0x74f1('0x149')});db[_0x74f1('0x8f')][_0x74f1('0xfb')](db['SmsInteraction'],{'through':_0x74f1('0x15d')});db[_0x74f1('0x8f')][_0x74f1('0xfb')](db[_0x74f1('0x49')],{'through':_0x74f1('0x153')});db[_0x74f1('0x8f')]['belongsToMany'](db[_0x74f1('0x5b')],{'through':_0x74f1('0x165')});db[_0x74f1('0x93')]['hasMany'](db[_0x74f1('0x84')],{'as':{'plural':_0x74f1('0x184'),'singular':_0x74f1('0x185')},'foreignKey':_0x74f1('0x186'),'onDelete':_0x74f1('0x11f'),'hooks':!![]});db['Trigger'][_0x74f1('0xf4')](db[_0x74f1('0x84')],{'as':{'plural':'AnyConditions','singular':_0x74f1('0x187')},'foreignKey':'TriggerAnyId','onDelete':_0x74f1('0x11f'),'hooks':!![]});db[_0x74f1('0x93')][_0x74f1('0xf4')](db[_0x74f1('0x7e')],{'as':'Actions','foreignKey':_0x74f1('0x188'),'onDelete':_0x74f1('0x11f'),'hooks':!![]});db[_0x74f1('0x98')][_0x74f1('0xf4')](db[_0x74f1('0xa0')],{'as':_0x74f1('0x189'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x74f1('0x9a')][_0x74f1('0xf4')](db[_0x74f1('0xa0')],{'as':_0x74f1('0x189'),'onDelete':'cascade','foreignKey':_0x74f1('0x182')});db[_0x74f1('0x9e')][_0x74f1('0xf4')](db['AnalyticFieldReport'],{'as':_0x74f1('0x189'),'onDelete':_0x74f1('0x11f'),'foreignKey':'MetricId'});db[_0x74f1('0xa0')]['belongsTo'](db[_0x74f1('0x9e')],{'foreignKey':_0x74f1('0x18a')});db[_0x74f1('0xa4')][_0x74f1('0xf4')](db[_0x74f1('0x18b')],{'as':_0x74f1('0x18c'),'onDelete':'cascade','foreignKey':_0x74f1('0x18d')});db[_0x74f1('0x18b')][_0x74f1('0xf4')](db[_0x74f1('0x18e')],{'as':_0x74f1('0x18f'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x190')});db[_0x74f1('0x18b')][_0x74f1('0xf4')](db[_0x74f1('0x18e')],{'as':_0x74f1('0x191'),'onDelete':'cascade','foreignKey':_0x74f1('0x192')});db['SalesforceConfiguration'][_0x74f1('0xf4')](db['SalesforceField'],{'as':_0x74f1('0x189'),'onDelete':_0x74f1('0x11f'),'foreignKey':'FieldId'});db['SalesforceConfiguration']['belongsTo'](db[_0x74f1('0xa4')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x18d')});db[_0x74f1('0x18e')]['hasMany'](db[_0x74f1('0x18e')],{'as':_0x74f1('0x193'),'foreignKey':_0x74f1('0x190')});db[_0x74f1('0x18e')][_0x74f1('0xf4')](db[_0x74f1('0x18e')],{'as':'Description','foreignKey':_0x74f1('0x192')});db[_0x74f1('0x18e')][_0x74f1('0xf4')](db[_0x74f1('0x18e')],{'as':'Field','foreignKey':_0x74f1('0x194')});db['SalesforceField'][_0x74f1('0xf9')](db[_0x74f1('0x95')],{'as':'Variable','foreignKey':'VariableId'});db[_0x74f1('0xa8')][_0x74f1('0xf4')](db[_0x74f1('0xaa')],{'as':_0x74f1('0x18c'),'onDelete':_0x74f1('0x11f'),'foreignKey':'AccountId'});db[_0x74f1('0xaa')][_0x74f1('0xf4')](db[_0x74f1('0xac')],{'as':_0x74f1('0x18f'),'onDelete':'cascade','foreignKey':_0x74f1('0x190')});db['SugarcrmConfiguration'][_0x74f1('0xf4')](db[_0x74f1('0xac')],{'as':_0x74f1('0x191'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x192')});db[_0x74f1('0xaa')][_0x74f1('0xf4')](db[_0x74f1('0xac')],{'as':_0x74f1('0x189'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x194')});db['SugarcrmConfiguration'][_0x74f1('0xf9')](db[_0x74f1('0xa8')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x18d')});db['SugarcrmField'][_0x74f1('0xf4')](db[_0x74f1('0xac')],{'as':'Subject','foreignKey':_0x74f1('0x190')});db[_0x74f1('0xac')][_0x74f1('0xf4')](db[_0x74f1('0xac')],{'as':_0x74f1('0x195'),'foreignKey':_0x74f1('0x192')});db[_0x74f1('0xac')][_0x74f1('0xf4')](db['SugarcrmField'],{'as':_0x74f1('0x196'),'foreignKey':_0x74f1('0x194')});db[_0x74f1('0xac')]['belongsTo'](db[_0x74f1('0x95')],{'as':_0x74f1('0x95'),'foreignKey':_0x74f1('0x197')});db[_0x74f1('0xae')][_0x74f1('0xf4')](db[_0x74f1('0xb0')],{'as':_0x74f1('0x18c'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x18d')});db[_0x74f1('0xb0')][_0x74f1('0xf4')](db[_0x74f1('0xb2')],{'as':'Subjects','onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x190')});db['DeskConfiguration'][_0x74f1('0xf4')](db[_0x74f1('0xb2')],{'as':_0x74f1('0x191'),'onDelete':_0x74f1('0x11f'),'foreignKey':'DescriptionId'});db[_0x74f1('0xb0')][_0x74f1('0xf4')](db[_0x74f1('0xb2')],{'as':'Fields','onDelete':_0x74f1('0x11f'),'foreignKey':'FieldId'});db['DeskConfiguration']['belongsTo'](db['DeskAccount'],{'as':_0x74f1('0x148'),'foreignKey':'AccountId'});db[_0x74f1('0xb0')][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':_0x74f1('0x198')});db[_0x74f1('0xb2')][_0x74f1('0xf4')](db[_0x74f1('0xb2')],{'as':_0x74f1('0x193'),'foreignKey':_0x74f1('0x190')});db[_0x74f1('0xb2')][_0x74f1('0xf4')](db[_0x74f1('0xb2')],{'as':'Description','foreignKey':_0x74f1('0x192')});db[_0x74f1('0xb2')][_0x74f1('0xf4')](db[_0x74f1('0xb2')],{'as':_0x74f1('0x196'),'foreignKey':_0x74f1('0x194')});db['DeskField'][_0x74f1('0xf9')](db[_0x74f1('0x95')],{'as':'Variable','foreignKey':_0x74f1('0x197')});db[_0x74f1('0x199')][_0x74f1('0xf4')](db[_0x74f1('0xb5')],{'as':_0x74f1('0x18c'),'onDelete':_0x74f1('0x11f'),'foreignKey':'AccountId'});db[_0x74f1('0xb5')]['hasMany'](db['ZohoField'],{'as':_0x74f1('0x18f'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x190')});db[_0x74f1('0xb5')]['hasMany'](db[_0x74f1('0x19a')],{'as':_0x74f1('0x191'),'onDelete':_0x74f1('0x11f'),'foreignKey':'DescriptionId'});db['ZohoConfiguration']['hasMany'](db[_0x74f1('0x19a')],{'as':_0x74f1('0x189'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x194')});db['ZohoConfiguration'][_0x74f1('0xf9')](db[_0x74f1('0x199')],{'as':_0x74f1('0x148'),'foreignKey':'AccountId'});db[_0x74f1('0x19a')][_0x74f1('0xf4')](db[_0x74f1('0x19a')],{'as':_0x74f1('0x193'),'foreignKey':_0x74f1('0x190')});db[_0x74f1('0x19a')][_0x74f1('0xf4')](db[_0x74f1('0x19a')],{'as':'Description','foreignKey':_0x74f1('0x192')});db[_0x74f1('0x19a')][_0x74f1('0xf4')](db[_0x74f1('0x19a')],{'as':'Field','foreignKey':_0x74f1('0x194')});db['ZohoField']['belongsTo'](db[_0x74f1('0x95')],{'as':'Variable','foreignKey':_0x74f1('0x197')});db['ZendeskAccount']['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x18d')});db[_0x74f1('0xb7')][_0x74f1('0xf4')](db['ZendeskField'],{'as':_0x74f1('0x18f'),'foreignKey':'SubjectId'});db[_0x74f1('0xb7')][_0x74f1('0xf4')](db[_0x74f1('0xb9')],{'as':_0x74f1('0x191'),'foreignKey':_0x74f1('0x192')});db[_0x74f1('0xb7')][_0x74f1('0xf4')](db[_0x74f1('0xb9')],{'as':'Fields','foreignKey':_0x74f1('0x194')});db[_0x74f1('0xb7')][_0x74f1('0xf9')](db[_0x74f1('0xb6')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x18d')});db[_0x74f1('0xb7')][_0x74f1('0xfb')](db[_0x74f1('0x8f')],{'through':'int_zendesk_configuration_has_tags'});db[_0x74f1('0xb9')][_0x74f1('0xf4')](db['ZendeskField'],{'as':_0x74f1('0x193'),'foreignKey':'SubjectId'});db[_0x74f1('0xb9')][_0x74f1('0xf4')](db[_0x74f1('0xb9')],{'as':_0x74f1('0x195'),'foreignKey':'DescriptionId'});db[_0x74f1('0xb9')][_0x74f1('0xf4')](db[_0x74f1('0xb9')],{'as':_0x74f1('0x196'),'foreignKey':'FieldId'});db['ZendeskField'][_0x74f1('0xf9')](db[_0x74f1('0x95')],{'as':_0x74f1('0x95'),'foreignKey':_0x74f1('0x197')});db[_0x74f1('0x19b')]['hasMany'](db[_0x74f1('0xbc')],{'as':_0x74f1('0x18c'),'onDelete':_0x74f1('0x11f'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x74f1('0xf4')](db[_0x74f1('0xbe')],{'as':'Subjects','onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x190')});db['FreshdeskConfiguration'][_0x74f1('0xf4')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x192')});db[_0x74f1('0xbc')]['hasMany'](db[_0x74f1('0xbe')],{'as':'Fields','onDelete':_0x74f1('0x11f'),'foreignKey':'FieldId'});db[_0x74f1('0xbc')][_0x74f1('0xf9')](db['FreshdeskAccount'],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x18d')});db[_0x74f1('0xbc')][_0x74f1('0xfb')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x74f1('0xf4')](db[_0x74f1('0xbe')],{'as':'Subject','foreignKey':_0x74f1('0x190')});db[_0x74f1('0xbe')][_0x74f1('0xf4')](db[_0x74f1('0xbe')],{'as':_0x74f1('0x195'),'foreignKey':_0x74f1('0x192')});db[_0x74f1('0xbe')][_0x74f1('0xf4')](db[_0x74f1('0xbe')],{'as':'Field','foreignKey':_0x74f1('0x194')});db[_0x74f1('0xbe')][_0x74f1('0xf9')](db[_0x74f1('0x95')],{'as':'Variable','foreignKey':'VariableId'});db[_0x74f1('0x19c')][_0x74f1('0xf4')](db['VtigerConfiguration'],{'as':_0x74f1('0x18c'),'onDelete':'cascade','foreignKey':_0x74f1('0x18d')});db[_0x74f1('0xc1')][_0x74f1('0xf4')](db[_0x74f1('0xc2')],{'as':_0x74f1('0x18f'),'foreignKey':_0x74f1('0x190')});db[_0x74f1('0xc1')][_0x74f1('0xf4')](db[_0x74f1('0xc2')],{'as':_0x74f1('0x191'),'foreignKey':_0x74f1('0x192')});db[_0x74f1('0xc1')][_0x74f1('0xf4')](db[_0x74f1('0xc2')],{'as':_0x74f1('0x189'),'foreignKey':_0x74f1('0x194')});db[_0x74f1('0xc1')]['belongsTo'](db[_0x74f1('0x19c')],{'as':_0x74f1('0x148'),'foreignKey':_0x74f1('0x18d')});db[_0x74f1('0xc1')][_0x74f1('0xfb')](db['Tag'],{'through':'int_vtiger_configuration_has_tags'});db['VtigerField'][_0x74f1('0xf4')](db[_0x74f1('0xc2')],{'as':'Subject','foreignKey':_0x74f1('0x190')});db[_0x74f1('0xc2')]['hasMany'](db[_0x74f1('0xc2')],{'as':_0x74f1('0x195'),'foreignKey':'DescriptionId'});db[_0x74f1('0xc2')][_0x74f1('0xf4')](db[_0x74f1('0xc2')],{'as':_0x74f1('0x196'),'foreignKey':'FieldId'});db[_0x74f1('0xc2')][_0x74f1('0xf9')](db[_0x74f1('0x95')],{'as':_0x74f1('0x95'),'foreignKey':_0x74f1('0x197')});db[_0x74f1('0x19d')][_0x74f1('0xf9')](db[_0x74f1('0x60')],{});db[_0x74f1('0x19d')]['belongsTo'](db['CmList'],{'as':_0x74f1('0x143'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0x19d')][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':_0x74f1('0x139'),'foreignKey':_0x74f1('0x13a')});db[_0x74f1('0x19d')][_0x74f1('0xf9')](db['ChatInteraction'],{});db[_0x74f1('0x19d')][_0x74f1('0xf9')](db[_0x74f1('0x67')],{});db[_0x74f1('0x19d')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{});db[_0x74f1('0x19d')]['belongsTo'](db[_0x74f1('0x6b')],{});db['ChatInternalMessage'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'onDelete':_0x74f1('0x11f'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'onDelete':'cascade','foreignKey':_0x74f1('0x19e')});db[_0x74f1('0x128')][_0x74f1('0xf4')](db[_0x74f1('0x19f')],{'foreignKey':_0x74f1('0x1a0'),'onDelete':'cascade'});db[_0x74f1('0x128')][_0x74f1('0xf4')](db['JscriptyAnswerReport'],{'foreignKey':_0x74f1('0x1a0'),'onDelete':'cascade'});db[_0x74f1('0xcd')]['belongsTo'](db[_0x74f1('0x4f')],{});db[_0x74f1('0xcd')][_0x74f1('0xf9')](db[_0x74f1('0xec')],{'as':_0x74f1('0x143'),'foreignKey':'ListId'});db[_0x74f1('0xcd')][_0x74f1('0xf9')](db[_0x74f1('0x72')],{'as':_0x74f1('0x139'),'foreignKey':'ContactId'});db[_0x74f1('0xcd')][_0x74f1('0xf9')](db['SmsInteraction'],{});db[_0x74f1('0xcd')][_0x74f1('0xf9')](db[_0x74f1('0x159')],{});db['SmsQueueReport'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{});db[_0x74f1('0xcd')][_0x74f1('0xf9')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x74f1('0x1a1')});db[_0x74f1('0xd0')][_0x74f1('0xf4')](db['JscriptyQuestionReport'],{'foreignKey':_0x74f1('0x1a1')});db[_0x74f1('0xd0')][_0x74f1('0xf4')](db[_0x74f1('0xc9')],{'foreignKey':_0x74f1('0x1a1')});db['SquareProject'][_0x74f1('0xfb')](db['User'],{'as':'Users','through':'user_has_square_projects'});db[_0x74f1('0xdb')]['belongsToMany'](db[_0x74f1('0x11')],{'as':_0x74f1('0x12e'),'through':_0x74f1('0x102')});db[_0x74f1('0xdb')][_0x74f1('0xfb')](db[_0x74f1('0x1b')],{'through':_0x74f1('0x1a2'),'as':_0x74f1('0x108')});db['Team'][_0x74f1('0xfb')](db[_0x74f1('0x3b')],{'through':'team_has_mail_queues','as':_0x74f1('0x109')});db['Team']['belongsToMany'](db[_0x74f1('0x6b')],{'through':_0x74f1('0x16c'),'as':'ChatQueues'});db[_0x74f1('0xdb')][_0x74f1('0xfb')](db[_0x74f1('0x4d')],{'through':_0x74f1('0x156'),'as':_0x74f1('0x10c')});db[_0x74f1('0xdb')][_0x74f1('0xfb')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x74f1('0x10d')});db[_0x74f1('0xdb')][_0x74f1('0xfb')](db[_0x74f1('0x162')],{'through':_0x74f1('0x1a3'),'as':_0x74f1('0x1a4')});db['Campaign'][_0x74f1('0xf4')](db[_0x74f1('0x74')],{'as':_0x74f1('0x124'),'foreignKey':'CampaignId'});db[_0x74f1('0xde')]['hasMany'](db['CmHopperFinal'],{'as':_0x74f1('0x16f'),'foreignKey':_0x74f1('0x174')});db[_0x74f1('0xde')]['hasMany'](db[_0x74f1('0x125')],{'as':_0x74f1('0x126'),'foreignKey':_0x74f1('0x174')});db[_0x74f1('0xde')]['hasMany'](db[_0x74f1('0x76')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db['Campaign'][_0x74f1('0xf9')](db[_0x74f1('0x28')],{'as':_0x74f1('0x28'),'foreignKey':_0x74f1('0x12a')});db['Campaign'][_0x74f1('0xf9')](db[_0x74f1('0x28')],{'as':'TrunkBackup','foreignKey':_0x74f1('0x1a5')});db['Campaign'][_0x74f1('0xf9')](db[_0x74f1('0x86')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x74f1('0xde')][_0x74f1('0xf9')](db[_0x74f1('0xd6')],{'as':'SquareProject','foreignKey':_0x74f1('0x1a6')});db[_0x74f1('0xde')][_0x74f1('0xfb')](db['CmList'],{'as':_0x74f1('0x100'),'through':'campaigns_has_cm_lists'});db[_0x74f1('0xde')][_0x74f1('0xfb')](db[_0x74f1('0xec')],{'as':'BlackLists','through':_0x74f1('0x1a7')});db['MailTransferReport'][_0x74f1('0xf9')](db[_0x74f1('0x40')],{});db['MailTransferReport'][_0x74f1('0xf9')](db[_0x74f1('0x3e')],{});db[_0x74f1('0xe4')][_0x74f1('0xf9')](db[_0x74f1('0x39')],{'foreignKey':_0x74f1('0x1a8'),'as':_0x74f1('0x1a9')});db['MailTransferReport'][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'foreignKey':'FromUserId','as':_0x74f1('0x1aa')});db['MailTransferReport']['belongsTo'](db[_0x74f1('0x11')],{'foreignKey':_0x74f1('0x1ab'),'as':_0x74f1('0x1ac')});db[_0x74f1('0xe4')][_0x74f1('0xf9')](db[_0x74f1('0x3b')],{'foreignKey':'ToMailQueueId','as':_0x74f1('0x1ad')});db[_0x74f1('0xe4')]['belongsTo'](db[_0x74f1('0x39')],{'foreignKey':_0x74f1('0x1ae'),'as':_0x74f1('0x1af')});db[_0x74f1('0x1b0')][_0x74f1('0xf9')](db[_0x74f1('0x67')],{});db[_0x74f1('0x1b0')][_0x74f1('0xf9')](db[_0x74f1('0x65')],{});db[_0x74f1('0x1b0')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x74f1('0x1b1'),'as':_0x74f1('0x1a9')});db[_0x74f1('0x1b0')][_0x74f1('0xf9')](db['User'],{'foreignKey':_0x74f1('0x1b2'),'as':_0x74f1('0x1aa')});db[_0x74f1('0x1b0')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'foreignKey':'ToUserId','as':_0x74f1('0x1ac')});db[_0x74f1('0x1b0')][_0x74f1('0xf9')](db[_0x74f1('0x6b')],{'foreignKey':_0x74f1('0x1b3'),'as':_0x74f1('0x1ad')});db[_0x74f1('0x1b0')][_0x74f1('0xf9')](db[_0x74f1('0x60')],{'foreignKey':_0x74f1('0x1b4'),'as':_0x74f1('0x1af')});db[_0x74f1('0xe7')]['belongsTo'](db[_0x74f1('0x4b')],{});db[_0x74f1('0xe7')][_0x74f1('0xf9')](db[_0x74f1('0x49')],{});db['FaxTransferReport'][_0x74f1('0xf9')](db[_0x74f1('0x47')],{'foreignKey':_0x74f1('0x1b5'),'as':_0x74f1('0x1a9')});db[_0x74f1('0xe7')]['belongsTo'](db['User'],{'foreignKey':_0x74f1('0x1b2'),'as':_0x74f1('0x1aa')});db[_0x74f1('0xe7')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'foreignKey':_0x74f1('0x1ab'),'as':_0x74f1('0x1ac')});db[_0x74f1('0xe7')][_0x74f1('0xf9')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x74f1('0x1ad')});db['FaxTransferReport'][_0x74f1('0xf9')](db[_0x74f1('0x47')],{'foreignKey':_0x74f1('0x1b6'),'as':'ToAccount'});db[_0x74f1('0xe9')][_0x74f1('0xf9')](db[_0x74f1('0x5d')],{});db[_0x74f1('0xe9')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x74f1('0x58')],{'foreignKey':_0x74f1('0x1b7'),'as':_0x74f1('0x1a9')});db[_0x74f1('0xe9')][_0x74f1('0xf9')](db['User'],{'foreignKey':'FromUserId','as':_0x74f1('0x1aa')});db[_0x74f1('0xe9')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'foreignKey':_0x74f1('0x1ab'),'as':'ToAgent'});db[_0x74f1('0xe9')][_0x74f1('0xf9')](db['OpenchannelQueue'],{'foreignKey':_0x74f1('0x1b8'),'as':_0x74f1('0x1ad')});db[_0x74f1('0xe9')][_0x74f1('0xf9')](db[_0x74f1('0x58')],{'foreignKey':_0x74f1('0x1b9'),'as':_0x74f1('0x1af')});db[_0x74f1('0x1ba')][_0x74f1('0xf9')](db[_0x74f1('0x159')],{});db[_0x74f1('0x1ba')][_0x74f1('0xf9')](db[_0x74f1('0x53')],{});db[_0x74f1('0x1ba')]['belongsTo'](db[_0x74f1('0x4f')],{'foreignKey':_0x74f1('0x1bb'),'as':_0x74f1('0x1a9')});db[_0x74f1('0x1ba')][_0x74f1('0xf9')](db[_0x74f1('0x11')],{'foreignKey':_0x74f1('0x1b2'),'as':'FromAgent'});db[_0x74f1('0x1ba')][_0x74f1('0xf9')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x74f1('0x1ba')][_0x74f1('0xf9')](db['SmsQueue'],{'foreignKey':_0x74f1('0x1bc'),'as':_0x74f1('0x1ad')});db['SmsTransferReport']['belongsTo'](db[_0x74f1('0x4f')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList'][_0x74f1('0xf4')](db[_0x74f1('0x83')],{'as':_0x74f1('0x13e'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0xec')][_0x74f1('0xf4')](db[_0x74f1('0x1bd')],{'as':_0x74f1('0x1be'),'foreignKey':'ListId'});db[_0x74f1('0xec')][_0x74f1('0xf4')](db[_0x74f1('0x72')],{'as':_0x74f1('0xfe'),'onDelete':_0x74f1('0x11f'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0xec')][_0x74f1('0xf4')](db[_0x74f1('0x78')],{'as':_0x74f1('0x16f'),'foreignKey':_0x74f1('0x144')});db[_0x74f1('0xec')][_0x74f1('0xf4')](db[_0x74f1('0x125')],{'as':_0x74f1('0xf7'),'foreignKey':_0x74f1('0x144')});db['CmList'][_0x74f1('0xf4')](db['ReportAgentPreview'],{'as':_0x74f1('0x7b'),'foreignKey':_0x74f1('0x144')});db['CmList'][_0x74f1('0xfb')](db[_0x74f1('0x1b')],{'as':'Queues','through':_0x74f1('0x12d')});db['CmList'][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':'Agents','through':_0x74f1('0x101')});db['VoicePrefix'][_0x74f1('0xf4')](db['VoiceExtension'],{'as':_0x74f1('0xf6'),'onDelete':_0x74f1('0x14d')});db['VoicePrefix'][_0x74f1('0xfb')](db[_0x74f1('0x11')],{'as':'Agents','through':_0x74f1('0x10f')});db['UserProfile']['hasMany'](db[_0x74f1('0x11')],{'as':'Users','foreignKey':_0x74f1('0xfa')});db['UserProfile']['hasMany'](db[_0x74f1('0xf1')],{'as':_0x74f1('0x1bf'),'foreignKey':_0x74f1('0xfa'),'onDelete':_0x74f1('0x11f')});db[_0x74f1('0xf1')][_0x74f1('0xf4')](db[_0x74f1('0x1c0')],{'as':_0x74f1('0x1c1'),'foreignKey':_0x74f1('0x1c2'),'onDelete':_0x74f1('0x11f')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x34e8=['../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerField/intVtigerField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','UserProfile','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','UserOpenchannelQueue','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperBlacks','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','Messages','mailbox','mailboxuser','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Smtp','MailInteraction','Interactions','List','TemplateId','team_has_mail_queues','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','restrict','ListId','DashboardItem','Dispositions','FaxAccountId','Answers','Exntensions','TagId','FaxMessage','Account','fax_interaction_has_tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','UserFaxQueue','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','Interaction','ChatGroupId','CompanyId','CmHopper','HopperHistories','JscriptySessions','Company','cm_contact_has_tags','CampaignId','OwnerId','Condition','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','chat_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','Subject','SubjectId','Description','Field','Variable','SugarcrmConfiguration','FieldId','VariableId','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','int_vtiger_configuration_has_tags','ToId','SessionId','ProjectId','team_has_chat_queues','Hoppers','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','Queues','user_has_voice_prefixes','UserProfileSections','sectionId','exports','path','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','utf8mb4','database','username','options','User','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','IntegrationReport'];(function(_0x943194,_0x8edef9){var _0x1eb7a1=function(_0x3c1b4d){while(--_0x3c1b4d){_0x943194['push'](_0x943194['shift']());}};_0x1eb7a1(++_0x8edef9);}(_0x34e8,0x12c));var _0x834e=function(_0x144cf1,_0x55c592){_0x144cf1=_0x144cf1-0x0;var _0x28e092=_0x34e8[_0x144cf1];return _0x28e092;};'use strict';var path=require(_0x834e('0x0'));var config=require(_0x834e('0x1'));var Sequelize=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));var jstz=require('jstz');var timezone=jstz[_0x834e('0x4')]();config[_0x834e('0x2')]=_[_0x834e('0x5')](config[_0x834e('0x2')],{'database':_0x834e('0x6'),'username':_0x834e('0x7'),'password':_0x834e('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x834e('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x834e('0xa')](),'define':{'charset':_0x834e('0xb'),'collate':_0x834e('0xc')}}});config[_0x834e('0xd')]=_[_0x834e('0x5')](config[_0x834e('0xd')],{'database':_0x834e('0x6'),'username':_0x834e('0x7'),'password':_0x834e('0x8'),'options':{'host':_0x834e('0xe'),'port':0xcea,'dialect':_0x834e('0x9'),'dialectOptions':{'charset':_0x834e('0xf')},'logging':![],'timezone':timezone[_0x834e('0xa')](),'define':{'charset':_0x834e('0xb'),'collate':_0x834e('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x834e('0x2')][_0x834e('0x10')],config['sequelize'][_0x834e('0x11')],config[_0x834e('0x2')]['password'],config[_0x834e('0x2')][_0x834e('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x834e('0xd')][_0x834e('0x10')],config['sequelizeHistory'][_0x834e('0x11')],config[_0x834e('0xd')]['password'],config[_0x834e('0xd')]['options'])};db[_0x834e('0x13')]=db[_0x834e('0x2')]['import'](_0x834e('0x14'));db[_0x834e('0x15')]=db[_0x834e('0x2')]['import'](_0x834e('0x16'));db[_0x834e('0x17')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x19'));db[_0x834e('0x1a')]=db[_0x834e('0x2')]['import'](_0x834e('0x1b'));db[_0x834e('0x1c')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x834e('0x1d')]=db[_0x834e('0x2')]['import'](_0x834e('0x1e'));db[_0x834e('0x1f')]=db[_0x834e('0x2')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x834e('0x20')]=db[_0x834e('0x2')]['import'](_0x834e('0x21'));db[_0x834e('0x22')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x23'));db[_0x834e('0x24')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x25'));db['VoiceDialReport']=db['sequelize'][_0x834e('0x18')]('../api/voiceDialReport/voiceDialReport.model');db[_0x834e('0x26')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x27'));db[_0x834e('0x28')]=db[_0x834e('0x2')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db['sequelize'][_0x834e('0x18')](_0x834e('0x29'));db[_0x834e('0x2a')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x2b'));db[_0x834e('0x2c')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x2d'));db[_0x834e('0x2e')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x834e('0x2f')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x30'));db[_0x834e('0x31')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x32'));db[_0x834e('0x33')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x34'));db['UserFaxQueue']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x35'));db[_0x834e('0x36')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x37'));db['UserOpenchannelQueue']=db['sequelize']['import'](_0x834e('0x38'));db[_0x834e('0x39')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x3a'));db[_0x834e('0x3b')]=db['sequelize'][_0x834e('0x18')]('../api/mailServerOut/mailServerOut.model');db[_0x834e('0x3c')]=db[_0x834e('0x2')]['import'](_0x834e('0x3d'));db[_0x834e('0x3e')]=db['sequelize']['import'](_0x834e('0x3f'));db[_0x834e('0x40')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x41'));db['MailInteraction']=db[_0x834e('0x2')]['import']('../api/mailInteraction/mailInteraction.model');db[_0x834e('0x42')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x43'));db[_0x834e('0x44')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/mailApplication/mailApplication.model');db[_0x834e('0x45')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/mailQueueReport/mailQueueReport.model');db[_0x834e('0x46')]=db[_0x834e('0x2')]['import'](_0x834e('0x47'));db['DashboardItem']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x48'));db[_0x834e('0x49')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x4a'));db['FaxInteraction']=db[_0x834e('0x2')]['import'](_0x834e('0x4b'));db['FaxMessage']=db[_0x834e('0x2')]['import'](_0x834e('0x4c'));db[_0x834e('0x4d')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x4e'));db[_0x834e('0x4f')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x50'));db[_0x834e('0x51')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x52'));db['SmsApplication']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/smsApplication/smsApplication.model');db[_0x834e('0x53')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x54'));db[_0x834e('0x55')]=db[_0x834e('0x2')]['import']('../api/smsMessage/smsMessage.model');db[_0x834e('0x56')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x57'));db[_0x834e('0x58')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x59'));db[_0x834e('0x5a')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x5b'));db[_0x834e('0x5c')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x5d'));db[_0x834e('0x5e')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x5f'));db['OpenchannelQueue']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/openchannelQueue/openchannelQueue.model');db[_0x834e('0x60')]=db[_0x834e('0x2')]['import'](_0x834e('0x61'));db[_0x834e('0x62')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x63'));db[_0x834e('0x64')]=db[_0x834e('0x2')]['import'](_0x834e('0x65'));db[_0x834e('0x66')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x67'));db[_0x834e('0x68')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/chatMessage/chatMessage.model');db[_0x834e('0x69')]=db['sequelize'][_0x834e('0x18')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x834e('0x6a')]=db['sequelize']['import'](_0x834e('0x6b'));db[_0x834e('0x6c')]=db['sequelize']['import'](_0x834e('0x6d'));db[_0x834e('0x6e')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x6f'));db[_0x834e('0x70')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/cmCompany/cmCompany.model');db[_0x834e('0x71')]=db[_0x834e('0x2')]['import'](_0x834e('0x72'));db['CmHopper']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/cmHopper/cmHopper.model');db[_0x834e('0x73')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x74'));db['CmHopperFinal']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x75'));db['CmHopperHistory']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x76'));db[_0x834e('0x77')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x78'));db[_0x834e('0x79')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x7a'));db[_0x834e('0x7b')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x7c'));db[_0x834e('0x7d')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x7e'));db[_0x834e('0x7f')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/cannedAnswer/cannedAnswer.model');db[_0x834e('0x80')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x81'));db['Condition']=db[_0x834e('0x2')]['import']('../api/condition/condition.model');db[_0x834e('0x82')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x83'));db[_0x834e('0x84')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x85'));db['Cdr']=db[_0x834e('0x2')]['import'](_0x834e('0x86'));db[_0x834e('0x87')]=db['sequelize']['import'](_0x834e('0x88'));db[_0x834e('0x89')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x8a'));db['Sound']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x8b'));db[_0x834e('0x8c')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x8d'));db[_0x834e('0x8e')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/template/template.model');db[_0x834e('0x8f')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x90'));db['Variable']=db[_0x834e('0x2')]['import']('../api/variable/variable.model');db['Integration']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/integration/integration.model');db[_0x834e('0x91')]=db[_0x834e('0x2')]['import'](_0x834e('0x92'));db[_0x834e('0x93')]=db['sequelize']['import'](_0x834e('0x94'));db[_0x834e('0x95')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x96'));db['AnalyticExtractedReport']=db[_0x834e('0x2')]['import'](_0x834e('0x97'));db[_0x834e('0x98')]=db[_0x834e('0x2')]['import'](_0x834e('0x99'));db[_0x834e('0x9a')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x9b'));db[_0x834e('0x9c')]=db['sequelize'][_0x834e('0x18')](_0x834e('0x9d'));db[_0x834e('0x9e')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0x9f'));db[_0x834e('0xa0')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xa1'));db['SalesforceField']=db['sequelize']['import'](_0x834e('0xa2'));db[_0x834e('0xa3')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xa4'));db['SugarcrmConfiguration']=db['sequelize'][_0x834e('0x18')](_0x834e('0xa5'));db[_0x834e('0xa6')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x834e('0xa7')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/intDeskAccount/intDeskAccount.model');db[_0x834e('0xa8')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xa9'));db[_0x834e('0xaa')]=db['sequelize']['import'](_0x834e('0xab'));db[_0x834e('0xac')]=db['sequelize'][_0x834e('0x18')]('../api/intZohoAccount/intZohoAccount.model');db[_0x834e('0xad')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x834e('0xae')]=db['sequelize']['import']('../api/intZohoField/intZohoField.model');db[_0x834e('0xaf')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xb0'));db[_0x834e('0xb1')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xb2'));db[_0x834e('0xb3')]=db['sequelize'][_0x834e('0x18')]('../api/intZendeskField/intZendeskField.model');db[_0x834e('0xb4')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xb5'));db[_0x834e('0xb6')]=db[_0x834e('0x2')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x834e('0xb7')]=db[_0x834e('0x2')]['import'](_0x834e('0xb8'));db[_0x834e('0xb9')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xba'));db['VtigerConfiguration']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db['sequelize'][_0x834e('0x18')](_0x834e('0xbb'));db['Integration']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/integration/integration.model');db[_0x834e('0xbc')]=db['sequelize']['import'](_0x834e('0xbd'));db[_0x834e('0xbe')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/chatQueueReport/chatQueueReport.model');db[_0x834e('0xbf')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xc0'));db[_0x834e('0xc1')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xc2'));db[_0x834e('0xc3')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xc4'));db[_0x834e('0xc5')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xc6'));db[_0x834e('0xc7')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xc8'));db[_0x834e('0xc9')]=db[_0x834e('0x2')]['import'](_0x834e('0xca'));db[_0x834e('0xcb')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xcc'));db[_0x834e('0xcd')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xce'));db['Setting']=db['sequelize']['import'](_0x834e('0xcf'));db['SquareOdbc']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xd0'));db['SquareProject']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xd1'));db[_0x834e('0xd2')]=db[_0x834e('0x2')][_0x834e('0x18')]('../api/squareRecording/squareRecording.model');db[_0x834e('0xd3')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xd4'));db[_0x834e('0xd5')]=db['sequelize']['import']('../api/team/team.model');db['License']=db[_0x834e('0x2')][_0x834e('0x18')]('../api/license/license.model');db[_0x834e('0xd6')]=db[_0x834e('0x2')]['import'](_0x834e('0xd7'));db[_0x834e('0xd8')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xd9'));db[_0x834e('0xda')]=db['sequelize']['import'](_0x834e('0xdb'));db[_0x834e('0xdc')]=db[_0x834e('0x2')]['import'](_0x834e('0xdd'));db[_0x834e('0xde')]=db['sequelize'][_0x834e('0x18')](_0x834e('0xdf'));db[_0x834e('0xe0')]=db[_0x834e('0x2')]['import'](_0x834e('0xe1'));db['FaxTransferReport']=db['sequelize'][_0x834e('0x18')](_0x834e('0xe2'));db[_0x834e('0xe3')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xe4'));db['SmsTransferReport']=db['sequelize'][_0x834e('0x18')](_0x834e('0xe5'));db[_0x834e('0xe6')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xe7'));db[_0x834e('0xe8')]=db['sequelize'][_0x834e('0x18')](_0x834e('0xe9'));db['UserProfile']=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xea'));db[_0x834e('0xeb')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xec'));db[_0x834e('0xed')]=db[_0x834e('0x2')][_0x834e('0x18')](_0x834e('0xee'));db[_0x834e('0x13')][_0x834e('0xef')](db[_0x834e('0x20')],{'as':'VoiceMail','onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0xf1')});db['User'][_0x834e('0xf2')](db['VoiceRecording'],{'as':_0x834e('0xf3'),'foreignKey':'UserId'});db[_0x834e('0x13')]['hasMany'](db[_0x834e('0x2e')],{'as':_0x834e('0xf4'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x13')]['hasMany'](db[_0x834e('0x1a')],{'as':_0x834e('0xf5'),'onDelete':_0x834e('0xf0'),'hooks':!![]});db[_0x834e('0x13')][_0x834e('0xf2')](db[_0x834e('0xf6')],{'as':_0x834e('0xf7'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x13')][_0x834e('0xf2')](db[_0x834e('0xf8')],{'as':_0x834e('0xf9'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x13')][_0x834e('0xf2')](db[_0x834e('0x77')],{'as':_0x834e('0x77'),'foreignKey':'UserId'});db['User'][_0x834e('0xf2')](db[_0x834e('0x5c')],{'as':_0x834e('0xfa'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x13')][_0x834e('0xf2')](db[_0x834e('0x66')],{'as':_0x834e('0xfb'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x13')][_0x834e('0xf2')](db[_0x834e('0x53')],{'as':'SmsInteractions','foreignKey':_0x834e('0xf1')});db['User'][_0x834e('0xf2')](db[_0x834e('0xfc')],{'as':_0x834e('0xfd'),'foreignKey':'UserId'});db[_0x834e('0x13')][_0x834e('0xf2')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x834e('0xf1')});db[_0x834e('0x13')]['belongsTo'](db[_0x834e('0xfe')],{'as':_0x834e('0xfe'),'foreignKey':_0x834e('0xff')});db[_0x834e('0x13')][_0x834e('0x100')](db['ChatGroup'],{'as':'Groups','through':_0x834e('0x101')});db['User']['belongsToMany'](db['CmContact'],{'as':_0x834e('0x102'),'through':_0x834e('0x103')});db['User'][_0x834e('0x100')](db[_0x834e('0xe6')],{'as':_0x834e('0x104'),'through':_0x834e('0x105')});db['User'][_0x834e('0x100')](db[_0x834e('0xd5')],{'through':_0x834e('0x106')});db['User'][_0x834e('0x100')](db['MailInteraction'],{'as':_0x834e('0x107'),'through':'user_has_mail_interactions'});db[_0x834e('0x13')][_0x834e('0x100')](db['ChatInteraction'],{'as':_0x834e('0xfb'),'through':_0x834e('0x108')});db[_0x834e('0x13')][_0x834e('0x100')](db[_0x834e('0xfc')],{'as':_0x834e('0xfd'),'through':'user_has_fax_interactions'});db[_0x834e('0x13')][_0x834e('0x100')](db[_0x834e('0x53')],{'as':_0x834e('0x109'),'through':_0x834e('0x10a')});db[_0x834e('0x13')]['belongsToMany'](db[_0x834e('0x5c')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x834e('0x13')]['belongsToMany'](db['VoiceQueue'],{'as':_0x834e('0x10b'),'through':_0x834e('0x2f'),'required':![]});db[_0x834e('0x13')][_0x834e('0x100')](db[_0x834e('0x3e')],{'as':_0x834e('0x10c'),'through':_0x834e('0x33'),'required':![]});db[_0x834e('0x13')][_0x834e('0x100')](db[_0x834e('0x6a')],{'as':_0x834e('0x10d'),'through':_0x834e('0x31'),'required':![],'hooks':!![]});db[_0x834e('0x13')][_0x834e('0x100')](db['FaxQueue'],{'as':_0x834e('0x10e'),'through':'UserFaxQueue','required':![]});db[_0x834e('0x13')][_0x834e('0x100')](db[_0x834e('0x56')],{'as':_0x834e('0x10f'),'through':'UserSmsQueue','required':![]});db['User'][_0x834e('0x100')](db[_0x834e('0x110')],{'as':'OpenchannelQueues','through':_0x834e('0x111'),'required':![]});db[_0x834e('0x13')]['belongsToMany'](db[_0x834e('0xe6')],{'through':_0x834e('0x105')});db[_0x834e('0x13')][_0x834e('0x100')](db['VoicePrefix'],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db['User'][_0x834e('0x100')](db[_0x834e('0x60')],{'as':'ChatWebsites','through':_0x834e('0x112')});db['User'][_0x834e('0x100')](db[_0x834e('0x113')],{'as':_0x834e('0x114'),'through':_0x834e('0x115')});db[_0x834e('0x13')][_0x834e('0x100')](db[_0x834e('0x3c')],{'as':'MailAccounts','through':_0x834e('0x116')});db[_0x834e('0x13')]['belongsToMany'](db[_0x834e('0x58')],{'as':_0x834e('0x117'),'through':'user_has_openchannel_accounts'});db['User']['belongsToMany'](db[_0x834e('0x51')],{'as':_0x834e('0x118'),'through':_0x834e('0x119')});db['User'][_0x834e('0x100')](db[_0x834e('0x11a')],{'as':_0x834e('0x11b'),'through':_0x834e('0x11c')});db[_0x834e('0x15')][_0x834e('0xf2')](db[_0x834e('0x1a')],{'as':_0x834e('0x11d'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x11e')});db['VoiceContext']['hasMany'](db[_0x834e('0x1a')],{'onDelete':_0x834e('0xf0')});db[_0x834e('0x1a')][_0x834e('0xf2')](db[_0x834e('0x1a')],{'as':_0x834e('0x11f'),'onDelete':_0x834e('0xf0')});db[_0x834e('0x1c')][_0x834e('0x100')](db[_0x834e('0x120')],{'as':_0x834e('0x121'),'through':_0x834e('0x122')});db[_0x834e('0x1d')]['hasMany'](db[_0x834e('0x2e')],{'as':_0x834e('0x123'),'foreignKey':_0x834e('0x124')});db[_0x834e('0x1d')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x834e('0x124')});db[_0x834e('0x1d')][_0x834e('0xf2')](db[_0x834e('0xf6')],{'as':_0x834e('0xf7'),'foreignKey':_0x834e('0x124')});db[_0x834e('0x1d')][_0x834e('0xf2')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x834e('0xf2')](db[_0x834e('0x77')],{'as':_0x834e('0x77'),'foreignKey':_0x834e('0x124')});db[_0x834e('0x1d')][_0x834e('0xf2')](db[_0x834e('0x73')],{'as':_0x834e('0x125'),'foreignKey':_0x834e('0x124')});db['VoiceQueue']['hasMany'](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x834e('0x124')});db[_0x834e('0x1d')][_0x834e('0x126')](db[_0x834e('0x2a')],{'as':_0x834e('0x2a'),'foreignKey':_0x834e('0x127')});db[_0x834e('0x1d')][_0x834e('0x126')](db[_0x834e('0x2a')],{'as':_0x834e('0x128'),'foreignKey':_0x834e('0x129')});db[_0x834e('0x1d')][_0x834e('0x126')](db[_0x834e('0x82')],{'as':_0x834e('0x82'),'foreignKey':_0x834e('0x12a')});db['VoiceQueue'][_0x834e('0x100')](db['CmList'],{'as':_0x834e('0x104'),'through':_0x834e('0x12b')});db[_0x834e('0x1d')]['belongsToMany'](db[_0x834e('0x13')],{'as':_0x834e('0x12c'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x834e('0x100')](db[_0x834e('0xd5')],{'as':_0x834e('0x12d'),'through':_0x834e('0x12e')});db[_0x834e('0x1d')][_0x834e('0x100')](db[_0x834e('0xe6')],{'as':_0x834e('0x12f'),'through':'voice_queues_has_cm_blacklists'});db[_0x834e('0x1f')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':_0x834e('0x13'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x20')][_0x834e('0xf2')](db['VoiceMailMessage'],{'as':_0x834e('0x130'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x834e('0x131')});db[_0x834e('0x22')]['belongsTo'](db[_0x834e('0x20')],{'foreignKey':_0x834e('0x132'),'targetKey':'mailbox'});db[_0x834e('0x24')][_0x834e('0xf2')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x834e('0x133'),'constraints':![]});db[_0x834e('0x24')]['hasMany'](db['VoiceAgentReport'],{'as':_0x834e('0x134'),'foreignKey':_0x834e('0x133'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db['User'],{'as':'User','foreignKey':_0x834e('0xf1')});db['VoiceCallReport'][_0x834e('0x126')](db['CmContact'],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x39')][_0x834e('0x126')](db['MailAccount'],{'as':_0x834e('0x3c'),'foreignKey':_0x834e('0x137')});db[_0x834e('0x3b')][_0x834e('0x126')](db[_0x834e('0x3c')],{'as':_0x834e('0x3c'),'foreignKey':_0x834e('0x137')});db[_0x834e('0x3c')][_0x834e('0xef')](db[_0x834e('0x39')],{'as':'Imap','onDelete':_0x834e('0xf0')});db['MailAccount'][_0x834e('0xef')](db[_0x834e('0x3b')],{'as':_0x834e('0x138'),'onDelete':_0x834e('0xf0')});db[_0x834e('0x3c')]['hasMany'](db[_0x834e('0x80')],{'as':'Dispositions','foreignKey':'MailAccountId'});db[_0x834e('0x3c')][_0x834e('0xf2')](db[_0x834e('0x7f')],{'as':'Answers','foreignKey':_0x834e('0x137')});db[_0x834e('0x3c')][_0x834e('0xf2')](db[_0x834e('0x42')],{'as':_0x834e('0x130'),'foreignKey':_0x834e('0x137')});db[_0x834e('0x3c')][_0x834e('0xf2')](db[_0x834e('0x139')],{'as':_0x834e('0x13a')});db[_0x834e('0x3c')]['hasMany'](db[_0x834e('0x44')],{'as':_0x834e('0x11f')});db[_0x834e('0x3c')][_0x834e('0x126')](db[_0x834e('0xe6')],{'as':_0x834e('0x13b'),'foreignKey':'ListId'});db[_0x834e('0x3c')][_0x834e('0x126')](db[_0x834e('0x8e')],{'as':_0x834e('0x8e'),'foreignKey':_0x834e('0x13c')});db[_0x834e('0x3c')][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x12c'),'through':_0x834e('0x116')});db['MailQueue']['belongsToMany'](db[_0x834e('0x13')],{'as':'Agents','through':_0x834e('0x33')});db[_0x834e('0x3e')][_0x834e('0x100')](db[_0x834e('0xd5')],{'through':_0x834e('0x13d'),'as':_0x834e('0x12d')});db['MailInteraction'][_0x834e('0xf2')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x834e('0x13e')});db[_0x834e('0x139')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0x834e('0x137')});db[_0x834e('0x139')][_0x834e('0x126')](db['CmContact'],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x139')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':_0x834e('0x13f'),'foreignKey':'UserId'});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0x834e('0x140'),'as':_0x834e('0x141')});db[_0x834e('0x139')][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':_0x834e('0x140'),'as':_0x834e('0x142')});db[_0x834e('0x139')][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x143'),'through':_0x834e('0x144'),'foreignKey':_0x834e('0x13e')});db[_0x834e('0x42')][_0x834e('0xf2')](db['Attachment'],{'as':'Attachments','onDelete':_0x834e('0xf0')});db[_0x834e('0x42')][_0x834e('0x126')](db['User'],{'as':_0x834e('0x13')});db[_0x834e('0x42')][_0x834e('0x126')](db[_0x834e('0x71')],{'onDelete':_0x834e('0xf0'),'as':_0x834e('0x135')});db[_0x834e('0x42')][_0x834e('0x126')](db[_0x834e('0x139')],{'as':'Interaction','foreignKey':_0x834e('0x13e')});db[_0x834e('0x42')][_0x834e('0x126')](db[_0x834e('0x3c')],{'as':'Account','foreignKey':_0x834e('0x137')});db[_0x834e('0x44')][_0x834e('0x126')](db[_0x834e('0x13')],{'onDelete':_0x834e('0x145')});db[_0x834e('0x44')][_0x834e('0x126')](db[_0x834e('0x3e')],{'onDelete':_0x834e('0x145')});db['MailApplication'][_0x834e('0x126')](db['MailAccount'],{'onDelete':_0x834e('0x145')});db['MailApplication'][_0x834e('0x126')](db[_0x834e('0x82')],{'onDelete':_0x834e('0x145'),'foreignKey':_0x834e('0x12a')});db[_0x834e('0x44')]['belongsTo'](db[_0x834e('0x8c')],{'onDelete':_0x834e('0x145'),'foreignKey':'TagId'});db['MailQueueReport'][_0x834e('0x126')](db['MailAccount'],{});db['MailQueueReport']['belongsTo'](db[_0x834e('0xe6')],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146')});db[_0x834e('0x45')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':'ContactId'});db[_0x834e('0x45')][_0x834e('0x126')](db['MailInteraction'],{});db['MailQueueReport'][_0x834e('0x126')](db[_0x834e('0x42')],{});db['MailQueueReport']['belongsTo'](db[_0x834e('0x13')],{});db[_0x834e('0x45')][_0x834e('0x126')](db['MailQueue'],{});db[_0x834e('0x46')][_0x834e('0xf2')](db[_0x834e('0x147')],{'as':'Items','onDelete':_0x834e('0xf0')});db['FaxAccount'][_0x834e('0xf2')](db[_0x834e('0x80')],{'as':_0x834e('0x148'),'foreignKey':_0x834e('0x149')});db[_0x834e('0x113')]['hasMany'](db[_0x834e('0x7f')],{'as':_0x834e('0x14a'),'foreignKey':_0x834e('0x149')});db[_0x834e('0x113')][_0x834e('0xf2')](db['FaxInteraction'],{'as':'Interactions'});db[_0x834e('0x113')][_0x834e('0xf2')](db[_0x834e('0x49')],{'as':'Applications'});db[_0x834e('0x113')][_0x834e('0xf2')](db[_0x834e('0x1a')],{'as':_0x834e('0x14b'),'onDelete':'cascade'});db[_0x834e('0x113')][_0x834e('0xf2')](db['FaxMessage'],{'as':_0x834e('0x130')});db[_0x834e('0x113')][_0x834e('0x126')](db[_0x834e('0x2a')],{'as':'Trunk'});db[_0x834e('0x113')]['belongsTo'](db[_0x834e('0xe6')],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146')});db[_0x834e('0x113')][_0x834e('0x100')](db[_0x834e('0x13')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x834e('0x49')][_0x834e('0x126')](db['User'],{'onDelete':_0x834e('0x145')});db['FaxApplication'][_0x834e('0x126')](db[_0x834e('0x4d')],{'onDelete':_0x834e('0x145')});db[_0x834e('0x49')][_0x834e('0x126')](db[_0x834e('0x113')],{'onDelete':_0x834e('0x145')});db['FaxApplication'][_0x834e('0x126')](db[_0x834e('0x8c')],{'onDelete':_0x834e('0x145'),'foreignKey':_0x834e('0x14c')});db[_0x834e('0xfc')]['hasMany'](db[_0x834e('0x14d')],{'as':_0x834e('0x130'),'onDelete':_0x834e('0xf0'),'foreignKey':'FaxInteractionId'});db['FaxInteraction']['belongsTo'](db[_0x834e('0x113')],{'as':_0x834e('0x14e'),'foreignKey':_0x834e('0x149')});db[_0x834e('0xfc')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0xfc')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':'Owner','foreignKey':_0x834e('0xf1')});db[_0x834e('0xfc')][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':_0x834e('0x14f'),'as':_0x834e('0x141')});db[_0x834e('0xfc')][_0x834e('0x100')](db['Tag'],{'through':_0x834e('0x14f'),'as':_0x834e('0x142')});db['FaxInteraction'][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x143'),'through':_0x834e('0x150'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x834e('0x126')](db['User'],{'onDelete':_0x834e('0xf0'),'as':_0x834e('0x13')});db[_0x834e('0x14d')][_0x834e('0x126')](db[_0x834e('0xfc')],{'as':'Interaction','foreignKey':_0x834e('0x151')});db['FaxMessage']['belongsTo'](db[_0x834e('0x71')],{'onDelete':_0x834e('0xf0'),'as':_0x834e('0x135')});db[_0x834e('0x14d')][_0x834e('0x126')](db[_0x834e('0xda')],{'as':'Attachment','foreignKey':_0x834e('0x152')});db[_0x834e('0x14d')]['belongsTo'](db[_0x834e('0x113')],{'as':_0x834e('0x14e'),'foreignKey':'FaxAccountId'});db[_0x834e('0x4d')][_0x834e('0x100')](db['User'],{'as':_0x834e('0x12c'),'through':_0x834e('0x153')});db[_0x834e('0x4d')][_0x834e('0x100')](db[_0x834e('0xd5')],{'through':_0x834e('0x154'),'as':_0x834e('0x12d')});db[_0x834e('0x4f')][_0x834e('0x126')](db[_0x834e('0x113')],{});db['FaxQueueReport'][_0x834e('0x126')](db[_0x834e('0xe6')],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146')});db[_0x834e('0x4f')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x4f')][_0x834e('0x126')](db[_0x834e('0xfc')],{});db['FaxQueueReport'][_0x834e('0x126')](db[_0x834e('0x14d')],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db[_0x834e('0x4f')][_0x834e('0x126')](db[_0x834e('0x4d')],{});db[_0x834e('0x51')][_0x834e('0xf2')](db[_0x834e('0x80')],{'as':_0x834e('0x148'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db['CannedAnswer'],{'as':_0x834e('0x14a'),'foreignKey':_0x834e('0x155')});db[_0x834e('0x51')]['hasMany'](db['SmsMessage'],{'as':'Messages','foreignKey':_0x834e('0x155')});db['SmsAccount']['hasMany'](db[_0x834e('0x53')],{'as':_0x834e('0x13a')});db[_0x834e('0x51')][_0x834e('0xf2')](db[_0x834e('0x156')],{'as':_0x834e('0x11f')});db[_0x834e('0x51')]['belongsTo'](db[_0x834e('0xe6')],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146')});db[_0x834e('0x51')][_0x834e('0x100')](db['User'],{'as':_0x834e('0x12c'),'through':'user_has_sms_accounts'});db[_0x834e('0x156')][_0x834e('0x126')](db[_0x834e('0x13')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db['SmsQueue'],{'onDelete':_0x834e('0x145')});db[_0x834e('0x156')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x834e('0x145')});db[_0x834e('0x156')][_0x834e('0x126')](db['Interval'],{'onDelete':_0x834e('0x145'),'foreignKey':_0x834e('0x12a')});db[_0x834e('0x156')]['belongsTo'](db[_0x834e('0x8c')],{'onDelete':_0x834e('0x145'),'foreignKey':_0x834e('0x14c')});db[_0x834e('0x53')][_0x834e('0xf2')](db[_0x834e('0x55')],{'as':_0x834e('0x130'),'onDelete':'cascade','foreignKey':_0x834e('0x157')});db[_0x834e('0x53')][_0x834e('0x126')](db['SmsAccount'],{'as':_0x834e('0x14e'),'foreignKey':_0x834e('0x155')});db[_0x834e('0x53')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x53')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':_0x834e('0x13f'),'foreignKey':_0x834e('0xf1')});db['SmsInteraction'][_0x834e('0x100')](db['Tag'],{'through':_0x834e('0x158'),'as':'Tags'});db[_0x834e('0x53')][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':_0x834e('0x158'),'as':_0x834e('0x142')});db[_0x834e('0x53')][_0x834e('0x100')](db[_0x834e('0x13')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x834e('0x55')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':_0x834e('0x13')});db[_0x834e('0x55')][_0x834e('0x126')](db[_0x834e('0x71')],{'onDelete':_0x834e('0xf0'),'as':'Contact'});db['SmsMessage'][_0x834e('0x126')](db[_0x834e('0x53')],{'onDelete':_0x834e('0xf0'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0x834e('0x55')]['belongsTo'](db[_0x834e('0x51')],{'as':_0x834e('0x14e'),'foreignKey':_0x834e('0x155')});db['SmsQueue'][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x12c'),'through':_0x834e('0x36'),'foreignKey':_0x834e('0x159')});db[_0x834e('0x56')][_0x834e('0x100')](db['Team'],{'through':_0x834e('0x15a'),'as':_0x834e('0x12d')});db[_0x834e('0x58')][_0x834e('0xf2')](db[_0x834e('0x80')],{'as':_0x834e('0x148'),'foreignKey':_0x834e('0x15b')});db['OpenchannelAccount']['hasMany'](db[_0x834e('0x7f')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x834e('0x58')][_0x834e('0xf2')](db['OpenchannelInteraction'],{'as':_0x834e('0x13a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x834e('0xf2')](db['OpenchannelMessage'],{'as':_0x834e('0x130'),'foreignKey':_0x834e('0x15b')});db[_0x834e('0x58')][_0x834e('0xf2')](db[_0x834e('0x5a')],{'as':_0x834e('0x11f'),'foreignKey':_0x834e('0x15b')});db[_0x834e('0x58')][_0x834e('0x126')](db['CmList'],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146')});db[_0x834e('0x58')][_0x834e('0x100')](db['User'],{'as':'Agents','through':_0x834e('0x15c')});db[_0x834e('0x5a')]['belongsTo'](db[_0x834e('0x13')],{'onDelete':'restrict'});db[_0x834e('0x5a')][_0x834e('0x126')](db[_0x834e('0x110')],{'onDelete':_0x834e('0x145'),'foreignKey':_0x834e('0x15d')});db[_0x834e('0x5a')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x834e('0x15b')});db[_0x834e('0x5a')][_0x834e('0x126')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x834e('0x12a')});db[_0x834e('0x5a')][_0x834e('0x126')](db[_0x834e('0x8c')],{'onDelete':_0x834e('0x145'),'foreignKey':_0x834e('0x14c')});db[_0x834e('0x5c')][_0x834e('0xf2')](db[_0x834e('0x5e')],{'as':_0x834e('0x130'),'onDelete':_0x834e('0xf0'),'foreignKey':'OpenchannelInteractionId'});db[_0x834e('0x5c')][_0x834e('0x126')](db['OpenchannelAccount'],{'as':_0x834e('0x14e'),'foreignKey':_0x834e('0x15b')});db[_0x834e('0x5c')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x5c')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':_0x834e('0x13f'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x5c')][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':_0x834e('0x15e'),'as':_0x834e('0x141')});db[_0x834e('0x5c')][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':_0x834e('0x15e'),'as':_0x834e('0x142')});db[_0x834e('0x5c')]['belongsToMany'](db[_0x834e('0x13')],{'as':_0x834e('0x143'),'through':_0x834e('0x15f'),'foreignKey':_0x834e('0x160')});db[_0x834e('0x5e')][_0x834e('0x126')](db[_0x834e('0x13')],{'onDelete':_0x834e('0xf0'),'as':_0x834e('0x13')});db[_0x834e('0x5e')][_0x834e('0x126')](db[_0x834e('0x71')],{'onDelete':'cascade','as':_0x834e('0x135')});db[_0x834e('0x5e')]['belongsTo'](db[_0x834e('0x5c')],{'onDelete':_0x834e('0xf0'),'as':'Interaction','foreignKey':_0x834e('0x160')});db[_0x834e('0x5e')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0x834e('0x152')});db[_0x834e('0x5e')][_0x834e('0x126')](db[_0x834e('0x58')],{'as':'Account','foreignKey':_0x834e('0x15b')});db[_0x834e('0x110')][_0x834e('0x100')](db['User'],{'as':_0x834e('0x12c'),'through':_0x834e('0x111'),'foreignKey':_0x834e('0x15d')});db['OpenchannelQueue'][_0x834e('0x100')](db[_0x834e('0xd5')],{'through':'team_has_openchannel_queues','as':_0x834e('0x12d')});db[_0x834e('0x60')]['hasMany'](db[_0x834e('0x80')],{'as':_0x834e('0x148'),'foreignKey':_0x834e('0x161')});db[_0x834e('0x60')][_0x834e('0xf2')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x834e('0x161')});db[_0x834e('0x60')][_0x834e('0xf2')](db['ChatProactiveAction'],{'as':_0x834e('0x162')});db[_0x834e('0x60')][_0x834e('0xf2')](db[_0x834e('0x66')],{'as':_0x834e('0x13a')});db[_0x834e('0x60')]['hasMany'](db[_0x834e('0x64')],{'as':_0x834e('0x11f')});db[_0x834e('0x60')][_0x834e('0xf2')](db[_0x834e('0x68')],{'as':'Messages'});db['ChatWebsite'][_0x834e('0x126')](db['CmList'],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146')});db[_0x834e('0x60')][_0x834e('0x126')](db[_0x834e('0x82')],{'as':_0x834e('0x82'),'foreignKey':_0x834e('0x12a')});db['ChatWebsite'][_0x834e('0x100')](db[_0x834e('0x13')],{'as':'Agents','through':_0x834e('0x112')});db[_0x834e('0x62')][_0x834e('0x126')](db['OpenchannelAccount'],{});db[_0x834e('0x62')]['belongsTo'](db[_0x834e('0xe6')],{'as':'List','foreignKey':_0x834e('0x146')});db[_0x834e('0x62')]['belongsTo'](db[_0x834e('0x71')],{'as':'Contact','foreignKey':_0x834e('0x136')});db[_0x834e('0x62')][_0x834e('0x126')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x834e('0x126')](db[_0x834e('0x5e')],{});db[_0x834e('0x62')][_0x834e('0x126')](db[_0x834e('0x13')],{});db[_0x834e('0x62')][_0x834e('0x126')](db[_0x834e('0x110')],{});db[_0x834e('0x64')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':_0x834e('0x163'),'foreignKey':_0x834e('0xf1'),'onDelete':_0x834e('0x145')});db[_0x834e('0x64')][_0x834e('0x126')](db[_0x834e('0x6a')],{'as':_0x834e('0x164'),'foreignKey':_0x834e('0x165'),'onDelete':'restrict'});db[_0x834e('0x64')]['belongsTo'](db[_0x834e('0x60')],{'as':_0x834e('0x166'),'foreignKey':_0x834e('0x161'),'onDelete':_0x834e('0x145')});db[_0x834e('0x64')]['belongsTo'](db[_0x834e('0x8c')],{'onDelete':_0x834e('0x145'),'foreignKey':_0x834e('0x14c')});db[_0x834e('0x66')]['hasMany'](db['ChatMessage'],{'as':_0x834e('0x130'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x167')});db[_0x834e('0x66')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x834e('0x66')]['belongsTo'](db[_0x834e('0x71')],{'as':'Contact','foreignKey':_0x834e('0x136')});db[_0x834e('0x66')][_0x834e('0x126')](db['User'],{'as':_0x834e('0x13f'),'foreignKey':'UserId'});db[_0x834e('0x66')]['belongsToMany'](db[_0x834e('0x8c')],{'through':'chat_interaction_has_tags','as':_0x834e('0x141')});db[_0x834e('0x66')]['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x834e('0x66')][_0x834e('0x100')](db['User'],{'as':_0x834e('0x143'),'through':_0x834e('0x108'),'foreignKey':_0x834e('0x167')});db['ChatMessage']['belongsTo'](db['User'],{'onDelete':_0x834e('0xf0'),'as':_0x834e('0x13')});db[_0x834e('0x68')]['belongsTo'](db[_0x834e('0x71')],{'onDelete':_0x834e('0xf0'),'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x68')][_0x834e('0x126')](db['ChatInteraction'],{'onDelete':'cascade','as':_0x834e('0x168'),'foreignKey':_0x834e('0x167')});db[_0x834e('0x68')][_0x834e('0x126')](db[_0x834e('0xda')],{'as':_0x834e('0xda'),'foreignKey':_0x834e('0x152')});db[_0x834e('0x68')][_0x834e('0x126')](db[_0x834e('0x60')],{'as':'Account','foreignKey':_0x834e('0x161')});db['ChatOfflineMessage'][_0x834e('0x126')](db[_0x834e('0x71')],{'onDelete':_0x834e('0xf0'),'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x69')]['belongsTo'](db['ChatWebsite'],{'as':_0x834e('0x14e'),'foreignKey':'ChatWebsiteId'});db[_0x834e('0x6a')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x834e('0x31'),'hooks':!![]});db[_0x834e('0x6a')][_0x834e('0x100')](db[_0x834e('0xd5')],{'through':'team_has_chat_queues','as':_0x834e('0x12d')});db[_0x834e('0x6c')]['hasMany'](db['ChatInternalMessage'],{'as':_0x834e('0x130'),'foreignKey':_0x834e('0x169'),'onDelete':'cascade'});db[_0x834e('0x6c')][_0x834e('0x100')](db['User'],{'as':'Members','through':_0x834e('0x101')});db['ChatProactiveAction'][_0x834e('0x126')](db[_0x834e('0x60')],{'as':_0x834e('0x166'),'foreignKey':'ChatWebsiteId'});db[_0x834e('0x70')]['hasMany'](db[_0x834e('0x71')],{'as':_0x834e('0x102'),'foreignKey':_0x834e('0x16a')});db[_0x834e('0x71')][_0x834e('0xf2')](db[_0x834e('0x16b')],{'as':'Hoppers','foreignKey':_0x834e('0x136')});db[_0x834e('0x71')][_0x834e('0xf2')](db[_0x834e('0xf6')],{'as':_0x834e('0xf7'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x71')][_0x834e('0xf2')](db[_0x834e('0xf8')],{'as':_0x834e('0x16c'),'foreignKey':_0x834e('0x136')});db[_0x834e('0x71')][_0x834e('0xf2')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x834e('0x71')][_0x834e('0xf2')](db['JscriptySessionReport'],{'as':_0x834e('0x16d'),'foreignKey':'ContactId'});db[_0x834e('0x71')][_0x834e('0xf2')](db[_0x834e('0x5c')],{'as':'OpenchannelInteractions','foreignKey':_0x834e('0x136'),'onDelete':_0x834e('0x145')});db['CmContact']['hasMany'](db[_0x834e('0x66')],{'as':_0x834e('0xfb'),'foreignKey':_0x834e('0x136'),'onDelete':_0x834e('0x145')});db[_0x834e('0x71')][_0x834e('0xf2')](db[_0x834e('0x53')],{'as':'SmsInteractions','foreignKey':_0x834e('0x136'),'onDelete':'restrict'});db[_0x834e('0x71')][_0x834e('0xf2')](db[_0x834e('0xfc')],{'as':_0x834e('0xfd'),'foreignKey':'ContactId','onDelete':_0x834e('0x145')});db[_0x834e('0x71')]['hasMany'](db[_0x834e('0x139')],{'as':_0x834e('0x107'),'foreignKey':'ContactId','onDelete':_0x834e('0x145')});db[_0x834e('0x71')][_0x834e('0x126')](db[_0x834e('0x70')],{'as':_0x834e('0x16e'),'foreignKey':_0x834e('0x16a')});db[_0x834e('0x71')][_0x834e('0x126')](db[_0x834e('0xe6')],{'as':'List','foreignKey':_0x834e('0x146'),'onDelete':'cascade'});db['CmContact'][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x143'),'through':_0x834e('0x103')});db[_0x834e('0x71')][_0x834e('0x100')](db[_0x834e('0x8c')],{'as':_0x834e('0x141'),'through':_0x834e('0x16f')});db['CmContact'][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':_0x834e('0x16f'),'as':_0x834e('0x142')});db[_0x834e('0x16b')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':'ContactId','onDelete':_0x834e('0xf0')});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146'),'onDelete':_0x834e('0xf0')});db[_0x834e('0x16b')][_0x834e('0x126')](db[_0x834e('0x13')],{'as':_0x834e('0x163'),'foreignKey':_0x834e('0xf1')});db[_0x834e('0x16b')][_0x834e('0x126')](db[_0x834e('0x1d')],{'as':_0x834e('0x164'),'foreignKey':_0x834e('0x124'),'onDelete':_0x834e('0xf0')});db[_0x834e('0x16b')][_0x834e('0x126')](db[_0x834e('0xd6')],{'as':_0x834e('0xd6'),'foreignKey':_0x834e('0x170'),'onDelete':_0x834e('0xf0')});db[_0x834e('0x16b')]['belongsTo'](db[_0x834e('0x13')],{'as':_0x834e('0x13f'),'foreignKey':_0x834e('0x171')});db[_0x834e('0x73')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136'),'onDelete':_0x834e('0xf0')});db[_0x834e('0x73')][_0x834e('0x126')](db[_0x834e('0xe6')],{'as':'List','foreignKey':_0x834e('0x146'),'onDelete':'cascade'});db[_0x834e('0x73')]['belongsTo'](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x834e('0x124'),'onDelete':_0x834e('0xf0')});db[_0x834e('0x73')][_0x834e('0x126')](db[_0x834e('0xd6')],{'as':_0x834e('0xd6'),'foreignKey':_0x834e('0x170'),'onDelete':'cascade'});db[_0x834e('0x7d')][_0x834e('0xf2')](db[_0x834e('0x172')],{'as':{'plural':_0x834e('0x173'),'singular':_0x834e('0x174')},'foreignKey':'AutomationAllId','onDelete':_0x834e('0xf0'),'hooks':!![]});db['Automation'][_0x834e('0xf2')](db[_0x834e('0x172')],{'as':{'plural':_0x834e('0x175'),'singular':_0x834e('0x176')},'foreignKey':_0x834e('0x177'),'onDelete':_0x834e('0xf0'),'hooks':!![]});db['Automation'][_0x834e('0xf2')](db[_0x834e('0x7b')],{'as':_0x834e('0x178'),'foreignKey':_0x834e('0x179'),'onDelete':_0x834e('0xf0'),'hooks':!![]});db[_0x834e('0x82')]['hasMany'](db['Interval'],{'as':'Intervals','foreignKey':_0x834e('0x12a'),'onDelete':_0x834e('0xf0'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x834e('0x1a')],{'as':'Extensions','foreignKey':_0x834e('0x12a'),'onDelete':_0x834e('0x145')});db['Interval'][_0x834e('0xf2')](db[_0x834e('0x44')],{'as':_0x834e('0x17a'),'foreignKey':_0x834e('0x12a')});db[_0x834e('0x82')][_0x834e('0xf2')](db[_0x834e('0x64')],{'as':_0x834e('0x17b'),'foreignKey':_0x834e('0x12a')});db[_0x834e('0x82')]['hasMany'](db['FaxApplication'],{'as':_0x834e('0x17c'),'foreignKey':_0x834e('0x12a')});db[_0x834e('0x82')][_0x834e('0xf2')](db[_0x834e('0x156')],{'as':_0x834e('0x17d'),'foreignKey':'IntervalId'});db[_0x834e('0x89')][_0x834e('0x126')](db['MailAccount'],{});db[_0x834e('0x89')]['belongsTo'](db[_0x834e('0x95')],{'foreignKey':_0x834e('0x17e')});db['Schedule'][_0x834e('0x126')](db[_0x834e('0x93')],{'foreignKey':_0x834e('0x17f')});db[_0x834e('0x120')][_0x834e('0x100')](db['VoiceMusicOnHold'],{'as':_0x834e('0x180'),'through':_0x834e('0x122'),'onDelete':'restrict'});db['Tag'][_0x834e('0x100')](db[_0x834e('0x71')],{'through':_0x834e('0x16f')});db[_0x834e('0x8c')][_0x834e('0x100')](db[_0x834e('0x66')],{'through':_0x834e('0x181')});db[_0x834e('0x8c')][_0x834e('0x100')](db[_0x834e('0x139')],{'through':'mail_interaction_has_tags'});db['Tag'][_0x834e('0x100')](db['SmsInteraction'],{'through':_0x834e('0x158')});db['Tag'][_0x834e('0x100')](db['FaxInteraction'],{'through':_0x834e('0x14f')});db[_0x834e('0x8c')]['belongsToMany'](db[_0x834e('0x5c')],{'through':_0x834e('0x15e')});db[_0x834e('0x8f')]['hasMany'](db[_0x834e('0x172')],{'as':{'plural':'AllConditions','singular':_0x834e('0x182')},'foreignKey':_0x834e('0x183'),'onDelete':_0x834e('0xf0'),'hooks':!![]});db[_0x834e('0x8f')]['hasMany'](db[_0x834e('0x172')],{'as':{'plural':_0x834e('0x184'),'singular':_0x834e('0x185')},'foreignKey':_0x834e('0x186'),'onDelete':_0x834e('0xf0'),'hooks':!![]});db[_0x834e('0x8f')][_0x834e('0xf2')](db['Action'],{'as':_0x834e('0x178'),'foreignKey':_0x834e('0x187'),'onDelete':'cascade','hooks':!![]});db[_0x834e('0x93')][_0x834e('0xf2')](db[_0x834e('0x9a')],{'as':_0x834e('0x188'),'onDelete':_0x834e('0xf0'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x834e('0x95')][_0x834e('0xf2')](db['AnalyticFieldReport'],{'as':_0x834e('0x188'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x17e')});db['AnalyticMetric'][_0x834e('0xf2')](db[_0x834e('0x9a')],{'as':_0x834e('0x188'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x189')});db[_0x834e('0x9a')][_0x834e('0x126')](db[_0x834e('0x98')],{'foreignKey':_0x834e('0x189')});db[_0x834e('0x9e')][_0x834e('0xf2')](db[_0x834e('0xa0')],{'as':_0x834e('0x18a'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18b')});db[_0x834e('0xa0')]['hasMany'](db[_0x834e('0x18c')],{'as':_0x834e('0x18d'),'onDelete':_0x834e('0xf0'),'foreignKey':'SubjectId'});db[_0x834e('0xa0')][_0x834e('0xf2')](db[_0x834e('0x18c')],{'as':_0x834e('0x18e'),'onDelete':'cascade','foreignKey':_0x834e('0x18f')});db[_0x834e('0xa0')][_0x834e('0xf2')](db['SalesforceField'],{'as':_0x834e('0x188'),'onDelete':_0x834e('0xf0'),'foreignKey':'FieldId'});db[_0x834e('0xa0')]['belongsTo'](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x834e('0x18b')});db[_0x834e('0x18c')]['hasMany'](db['SalesforceField'],{'as':_0x834e('0x190'),'foreignKey':_0x834e('0x191')});db[_0x834e('0x18c')][_0x834e('0xf2')](db[_0x834e('0x18c')],{'as':_0x834e('0x192'),'foreignKey':_0x834e('0x18f')});db[_0x834e('0x18c')][_0x834e('0xf2')](db['SalesforceField'],{'as':_0x834e('0x193'),'foreignKey':'FieldId'});db[_0x834e('0x18c')][_0x834e('0x126')](db[_0x834e('0x194')],{'as':'Variable','foreignKey':'VariableId'});db['SugarcrmAccount'][_0x834e('0xf2')](db[_0x834e('0x195')],{'as':_0x834e('0x18a'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18b')});db[_0x834e('0x195')]['hasMany'](db['SugarcrmField'],{'as':_0x834e('0x18d'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x191')});db[_0x834e('0x195')]['hasMany'](db[_0x834e('0xa6')],{'as':_0x834e('0x18e'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18f')});db['SugarcrmConfiguration'][_0x834e('0xf2')](db[_0x834e('0xa6')],{'as':_0x834e('0x188'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x196')});db['SugarcrmConfiguration']['belongsTo'](db[_0x834e('0xa3')],{'as':_0x834e('0x14e'),'foreignKey':'AccountId'});db['SugarcrmField'][_0x834e('0xf2')](db[_0x834e('0xa6')],{'as':_0x834e('0x190'),'foreignKey':'SubjectId'});db[_0x834e('0xa6')][_0x834e('0xf2')](db[_0x834e('0xa6')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x834e('0xa6')][_0x834e('0xf2')](db[_0x834e('0xa6')],{'as':_0x834e('0x193'),'foreignKey':'FieldId'});db[_0x834e('0xa6')]['belongsTo'](db[_0x834e('0x194')],{'as':_0x834e('0x194'),'foreignKey':_0x834e('0x197')});db[_0x834e('0xa7')]['hasMany'](db[_0x834e('0xa8')],{'as':_0x834e('0x18a'),'onDelete':_0x834e('0xf0'),'foreignKey':'AccountId'});db[_0x834e('0xa8')][_0x834e('0xf2')](db[_0x834e('0xaa')],{'as':_0x834e('0x18d'),'onDelete':'cascade','foreignKey':_0x834e('0x191')});db[_0x834e('0xa8')]['hasMany'](db[_0x834e('0xaa')],{'as':_0x834e('0x18e'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18f')});db[_0x834e('0xa8')][_0x834e('0xf2')](db['DeskField'],{'as':_0x834e('0x188'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x196')});db['DeskConfiguration'][_0x834e('0x126')](db['DeskAccount'],{'as':_0x834e('0x14e'),'foreignKey':'AccountId'});db[_0x834e('0xa8')][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':'int_desk_configuration_has_tags'});db[_0x834e('0xaa')][_0x834e('0xf2')](db[_0x834e('0xaa')],{'as':_0x834e('0x190'),'foreignKey':_0x834e('0x191')});db['DeskField'][_0x834e('0xf2')](db[_0x834e('0xaa')],{'as':_0x834e('0x192'),'foreignKey':_0x834e('0x18f')});db['DeskField'][_0x834e('0xf2')](db[_0x834e('0xaa')],{'as':'Field','foreignKey':_0x834e('0x196')});db[_0x834e('0xaa')]['belongsTo'](db['Variable'],{'as':_0x834e('0x194'),'foreignKey':_0x834e('0x197')});db[_0x834e('0xac')][_0x834e('0xf2')](db[_0x834e('0xad')],{'as':_0x834e('0x18a'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18b')});db[_0x834e('0xad')][_0x834e('0xf2')](db[_0x834e('0xae')],{'as':_0x834e('0x18d'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x191')});db[_0x834e('0xad')]['hasMany'](db[_0x834e('0xae')],{'as':'Descriptions','onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18f')});db[_0x834e('0xad')][_0x834e('0xf2')](db['ZohoField'],{'as':'Fields','onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x196')});db[_0x834e('0xad')][_0x834e('0x126')](db['ZohoAccount'],{'as':_0x834e('0x14e'),'foreignKey':_0x834e('0x18b')});db[_0x834e('0xae')][_0x834e('0xf2')](db['ZohoField'],{'as':_0x834e('0x190'),'foreignKey':_0x834e('0x191')});db['ZohoField'][_0x834e('0xf2')](db['ZohoField'],{'as':_0x834e('0x192'),'foreignKey':_0x834e('0x18f')});db['ZohoField'][_0x834e('0xf2')](db['ZohoField'],{'as':_0x834e('0x193'),'foreignKey':'FieldId'});db[_0x834e('0xae')]['belongsTo'](db['Variable'],{'as':_0x834e('0x194'),'foreignKey':_0x834e('0x197')});db[_0x834e('0xaf')][_0x834e('0xf2')](db['ZendeskConfiguration'],{'as':_0x834e('0x18a'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18b')});db[_0x834e('0xb1')]['hasMany'](db[_0x834e('0xb3')],{'as':_0x834e('0x18d'),'foreignKey':_0x834e('0x191')});db[_0x834e('0xb1')]['hasMany'](db[_0x834e('0xb3')],{'as':_0x834e('0x18e'),'foreignKey':_0x834e('0x18f')});db[_0x834e('0xb1')]['hasMany'](db['ZendeskField'],{'as':_0x834e('0x188'),'foreignKey':'FieldId'});db[_0x834e('0xb1')][_0x834e('0x126')](db[_0x834e('0xaf')],{'as':'Account','foreignKey':_0x834e('0x18b')});db[_0x834e('0xb1')][_0x834e('0x100')](db[_0x834e('0x8c')],{'through':_0x834e('0x198')});db[_0x834e('0xb3')][_0x834e('0xf2')](db['ZendeskField'],{'as':_0x834e('0x190'),'foreignKey':_0x834e('0x191')});db[_0x834e('0xb3')][_0x834e('0xf2')](db[_0x834e('0xb3')],{'as':_0x834e('0x192'),'foreignKey':_0x834e('0x18f')});db[_0x834e('0xb3')][_0x834e('0xf2')](db[_0x834e('0xb3')],{'as':'Field','foreignKey':_0x834e('0x196')});db[_0x834e('0xb3')][_0x834e('0x126')](db[_0x834e('0x194')],{'as':_0x834e('0x194'),'foreignKey':_0x834e('0x197')});db['FreshdeskAccount'][_0x834e('0xf2')](db[_0x834e('0xb6')],{'as':_0x834e('0x18a'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18b')});db[_0x834e('0xb6')][_0x834e('0xf2')](db[_0x834e('0xb7')],{'as':_0x834e('0x18d'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x191')});db['FreshdeskConfiguration']['hasMany'](db[_0x834e('0xb7')],{'as':'Descriptions','onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x18f')});db[_0x834e('0xb6')][_0x834e('0xf2')](db[_0x834e('0xb7')],{'as':_0x834e('0x188'),'onDelete':'cascade','foreignKey':_0x834e('0x196')});db[_0x834e('0xb6')]['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x834e('0x18b')});db['FreshdeskConfiguration']['belongsToMany'](db[_0x834e('0x8c')],{'through':_0x834e('0x199')});db['FreshdeskField'][_0x834e('0xf2')](db['FreshdeskField'],{'as':_0x834e('0x190'),'foreignKey':_0x834e('0x191')});db['FreshdeskField']['hasMany'](db[_0x834e('0xb7')],{'as':_0x834e('0x192'),'foreignKey':'DescriptionId'});db[_0x834e('0xb7')]['hasMany'](db[_0x834e('0xb7')],{'as':_0x834e('0x193'),'foreignKey':_0x834e('0x196')});db[_0x834e('0xb7')][_0x834e('0x126')](db[_0x834e('0x194')],{'as':_0x834e('0x194'),'foreignKey':_0x834e('0x197')});db['VtigerAccount'][_0x834e('0xf2')](db[_0x834e('0x19a')],{'as':_0x834e('0x18a'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x834e('0x19a')][_0x834e('0xf2')](db[_0x834e('0x19b')],{'as':_0x834e('0x18d'),'foreignKey':'SubjectId'});db[_0x834e('0x19a')][_0x834e('0xf2')](db[_0x834e('0x19b')],{'as':_0x834e('0x18e'),'foreignKey':'DescriptionId'});db[_0x834e('0x19a')][_0x834e('0xf2')](db[_0x834e('0x19b')],{'as':_0x834e('0x188'),'foreignKey':_0x834e('0x196')});db[_0x834e('0x19a')]['belongsTo'](db[_0x834e('0xb9')],{'as':_0x834e('0x14e'),'foreignKey':_0x834e('0x18b')});db[_0x834e('0x19a')][_0x834e('0x100')](db['Tag'],{'through':_0x834e('0x19c')});db[_0x834e('0x19b')][_0x834e('0xf2')](db[_0x834e('0x19b')],{'as':_0x834e('0x190'),'foreignKey':'SubjectId'});db[_0x834e('0x19b')][_0x834e('0xf2')](db[_0x834e('0x19b')],{'as':_0x834e('0x192'),'foreignKey':_0x834e('0x18f')});db['VtigerField'][_0x834e('0xf2')](db['VtigerField'],{'as':_0x834e('0x193'),'foreignKey':'FieldId'});db[_0x834e('0x19b')]['belongsTo'](db[_0x834e('0x194')],{'as':_0x834e('0x194'),'foreignKey':_0x834e('0x197')});db['ChatQueueReport'][_0x834e('0x126')](db[_0x834e('0x60')],{});db[_0x834e('0xbe')][_0x834e('0x126')](db[_0x834e('0xe6')],{'as':'List','foreignKey':_0x834e('0x146')});db[_0x834e('0xbe')][_0x834e('0x126')](db['CmContact'],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0xbe')][_0x834e('0x126')](db[_0x834e('0x66')],{});db[_0x834e('0xbe')][_0x834e('0x126')](db['ChatMessage'],{});db['ChatQueueReport'][_0x834e('0x126')](db[_0x834e('0x13')],{});db[_0x834e('0xbe')][_0x834e('0x126')](db[_0x834e('0x6a')],{});db[_0x834e('0xbf')][_0x834e('0x126')](db[_0x834e('0x13')],{'onDelete':_0x834e('0xf0'),'foreignKey':'FromId'});db[_0x834e('0xbf')]['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x834e('0x19d')});db['JscriptySessionReport']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0x834e('0xf0')});db['JscriptySessionReport'][_0x834e('0xf2')](db['JscriptyAnswerReport'],{'foreignKey':_0x834e('0x19e'),'onDelete':_0x834e('0xf0')});db['SmsQueueReport'][_0x834e('0x126')](db[_0x834e('0x51')],{});db['SmsQueueReport'][_0x834e('0x126')](db[_0x834e('0xe6')],{'as':_0x834e('0x13b'),'foreignKey':_0x834e('0x146')});db[_0x834e('0xc7')][_0x834e('0x126')](db[_0x834e('0x71')],{'as':_0x834e('0x135'),'foreignKey':_0x834e('0x136')});db[_0x834e('0xc7')]['belongsTo'](db[_0x834e('0x53')],{});db['SmsQueueReport'][_0x834e('0x126')](db[_0x834e('0x55')],{});db['SmsQueueReport'][_0x834e('0x126')](db['User'],{});db[_0x834e('0xc7')][_0x834e('0x126')](db[_0x834e('0x56')],{});db['JscriptyProject'][_0x834e('0xf2')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x834e('0xcd')][_0x834e('0xf2')](db[_0x834e('0xc3')],{'foreignKey':_0x834e('0x19f')});db[_0x834e('0xcd')][_0x834e('0xf2')](db[_0x834e('0xc1')],{'foreignKey':_0x834e('0x19f')});db[_0x834e('0x11a')]['belongsToMany'](db[_0x834e('0x13')],{'as':_0x834e('0x143'),'through':_0x834e('0x11c')});db[_0x834e('0xd5')][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x12c'),'through':'user_has_teams'});db[_0x834e('0xd5')][_0x834e('0x100')](db[_0x834e('0x1d')],{'through':'team_has_voice_queues','as':'VoiceQueues'});db[_0x834e('0xd5')][_0x834e('0x100')](db[_0x834e('0x3e')],{'through':_0x834e('0x13d'),'as':_0x834e('0x10c')});db[_0x834e('0xd5')][_0x834e('0x100')](db[_0x834e('0x6a')],{'through':_0x834e('0x1a0'),'as':'ChatQueues'});db[_0x834e('0xd5')][_0x834e('0x100')](db[_0x834e('0x4d')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x834e('0xd5')]['belongsToMany'](db[_0x834e('0x56')],{'through':_0x834e('0x15a'),'as':_0x834e('0x10f')});db[_0x834e('0xd5')][_0x834e('0x100')](db[_0x834e('0x110')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x834e('0xd6')][_0x834e('0xf2')](db[_0x834e('0x16b')],{'as':_0x834e('0x1a1'),'foreignKey':_0x834e('0x170')});db[_0x834e('0xd6')][_0x834e('0xf2')](db['CmHopperFinal'],{'as':_0x834e('0xf7'),'foreignKey':_0x834e('0x170')});db[_0x834e('0xd6')][_0x834e('0xf2')](db[_0x834e('0xf8')],{'as':_0x834e('0x16c'),'foreignKey':'CampaignId'});db[_0x834e('0xd6')][_0x834e('0xf2')](db[_0x834e('0x73')],{'as':_0x834e('0x125'),'foreignKey':_0x834e('0x170')});db['Campaign'][_0x834e('0x126')](db['Trunk'],{'as':_0x834e('0x2a'),'foreignKey':'TrunkId'});db['Campaign'][_0x834e('0x126')](db['Trunk'],{'as':_0x834e('0x128'),'foreignKey':_0x834e('0x129')});db[_0x834e('0xd6')][_0x834e('0x126')](db[_0x834e('0x82')],{'as':_0x834e('0x82'),'foreignKey':_0x834e('0x12a')});db[_0x834e('0xd6')][_0x834e('0x126')](db[_0x834e('0x11a')],{'as':_0x834e('0x11a'),'foreignKey':_0x834e('0x1a2')});db[_0x834e('0xd6')][_0x834e('0x100')](db[_0x834e('0xe6')],{'as':'Lists','through':_0x834e('0x1a3')});db[_0x834e('0xd6')]['belongsToMany'](db[_0x834e('0xe6')],{'as':_0x834e('0x12f'),'through':_0x834e('0x1a4')});db[_0x834e('0xde')][_0x834e('0x126')](db[_0x834e('0x42')],{});db[_0x834e('0xde')][_0x834e('0x126')](db[_0x834e('0x139')],{});db[_0x834e('0xde')]['belongsTo'](db[_0x834e('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x834e('0x1a5')});db[_0x834e('0xde')][_0x834e('0x126')](db['User'],{'foreignKey':_0x834e('0x1a6'),'as':_0x834e('0x1a7')});db[_0x834e('0xde')]['belongsTo'](db[_0x834e('0x13')],{'foreignKey':_0x834e('0x1a8'),'as':'ToAgent'});db[_0x834e('0xde')][_0x834e('0x126')](db['MailQueue'],{'foreignKey':_0x834e('0x1a9'),'as':'ToQueue'});db[_0x834e('0xde')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x834e('0x1aa')});db[_0x834e('0xe0')][_0x834e('0x126')](db['ChatMessage'],{});db['ChatTransferReport'][_0x834e('0x126')](db[_0x834e('0x66')],{});db[_0x834e('0xe0')][_0x834e('0x126')](db[_0x834e('0x60')],{'foreignKey':_0x834e('0x1ab'),'as':_0x834e('0x1a5')});db['ChatTransferReport'][_0x834e('0x126')](db['User'],{'foreignKey':_0x834e('0x1a6'),'as':_0x834e('0x1a7')});db[_0x834e('0xe0')]['belongsTo'](db['User'],{'foreignKey':_0x834e('0x1a8'),'as':_0x834e('0x1ac')});db[_0x834e('0xe0')][_0x834e('0x126')](db[_0x834e('0x6a')],{'foreignKey':_0x834e('0x1ad'),'as':_0x834e('0x1ae')});db[_0x834e('0xe0')][_0x834e('0x126')](db['ChatWebsite'],{'foreignKey':_0x834e('0x1af'),'as':_0x834e('0x1aa')});db[_0x834e('0x1b0')][_0x834e('0x126')](db['FaxMessage'],{});db[_0x834e('0x1b0')]['belongsTo'](db[_0x834e('0xfc')],{});db['FaxTransferReport'][_0x834e('0x126')](db[_0x834e('0x113')],{'foreignKey':_0x834e('0x1b1'),'as':_0x834e('0x1a5')});db[_0x834e('0x1b0')][_0x834e('0x126')](db[_0x834e('0x13')],{'foreignKey':_0x834e('0x1a6'),'as':_0x834e('0x1a7')});db[_0x834e('0x1b0')][_0x834e('0x126')](db[_0x834e('0x13')],{'foreignKey':_0x834e('0x1a8'),'as':_0x834e('0x1ac')});db['FaxTransferReport'][_0x834e('0x126')](db['FaxQueue'],{'foreignKey':_0x834e('0x1b2'),'as':_0x834e('0x1ae')});db[_0x834e('0x1b0')][_0x834e('0x126')](db[_0x834e('0x113')],{'foreignKey':_0x834e('0x1b3'),'as':_0x834e('0x1aa')});db['OpenchannelTransferReport'][_0x834e('0x126')](db[_0x834e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x834e('0x5c')],{});db['OpenchannelTransferReport'][_0x834e('0x126')](db['OpenchannelAccount'],{'foreignKey':_0x834e('0x1b4'),'as':_0x834e('0x1a5')});db['OpenchannelTransferReport'][_0x834e('0x126')](db[_0x834e('0x13')],{'foreignKey':_0x834e('0x1a6'),'as':_0x834e('0x1a7')});db['OpenchannelTransferReport'][_0x834e('0x126')](db['User'],{'foreignKey':'ToUserId','as':_0x834e('0x1ac')});db[_0x834e('0xe3')][_0x834e('0x126')](db[_0x834e('0x110')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x834e('0xe3')][_0x834e('0x126')](db[_0x834e('0x58')],{'foreignKey':_0x834e('0x1b5'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db['SmsMessage'],{});db[_0x834e('0x1b6')]['belongsTo'](db['SmsInteraction'],{});db[_0x834e('0x1b6')][_0x834e('0x126')](db[_0x834e('0x51')],{'foreignKey':_0x834e('0x1b7'),'as':_0x834e('0x1a5')});db[_0x834e('0x1b6')][_0x834e('0x126')](db[_0x834e('0x13')],{'foreignKey':'FromUserId','as':_0x834e('0x1a7')});db['SmsTransferReport'][_0x834e('0x126')](db[_0x834e('0x13')],{'foreignKey':_0x834e('0x1a8'),'as':_0x834e('0x1ac')});db[_0x834e('0x1b6')][_0x834e('0x126')](db[_0x834e('0x56')],{'foreignKey':_0x834e('0x1b8'),'as':_0x834e('0x1ae')});db[_0x834e('0x1b6')][_0x834e('0x126')](db[_0x834e('0x51')],{'foreignKey':'ToSmsAccountId','as':_0x834e('0x1aa')});db[_0x834e('0xe6')][_0x834e('0xf2')](db[_0x834e('0x80')],{'as':_0x834e('0x148'),'foreignKey':_0x834e('0x146')});db[_0x834e('0xe6')][_0x834e('0xf2')](db[_0x834e('0x79')],{'as':'CustomFields','foreignKey':_0x834e('0x146')});db['CmList']['hasMany'](db[_0x834e('0x71')],{'as':_0x834e('0x102'),'onDelete':_0x834e('0xf0'),'foreignKey':_0x834e('0x146')});db[_0x834e('0xe6')]['hasMany'](db['CmHopperFinal'],{'as':_0x834e('0xf7'),'foreignKey':_0x834e('0x146')});db[_0x834e('0xe6')][_0x834e('0xf2')](db[_0x834e('0xf8')],{'as':'HopperHistory','foreignKey':_0x834e('0x146')});db[_0x834e('0xe6')][_0x834e('0xf2')](db[_0x834e('0x77')],{'as':_0x834e('0x77'),'foreignKey':_0x834e('0x146')});db['CmList']['belongsToMany'](db[_0x834e('0x1d')],{'as':_0x834e('0x1b9'),'through':_0x834e('0x12b')});db[_0x834e('0xe6')][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x12c'),'through':'cm_user_has_lists'});db[_0x834e('0xe8')][_0x834e('0xf2')](db[_0x834e('0x1a')],{'as':_0x834e('0xf5'),'onDelete':_0x834e('0x145')});db[_0x834e('0xe8')][_0x834e('0x100')](db[_0x834e('0x13')],{'as':_0x834e('0x12c'),'through':_0x834e('0x1ba')});db[_0x834e('0xfe')]['hasMany'](db[_0x834e('0x13')],{'as':_0x834e('0x143'),'foreignKey':_0x834e('0xff')});db[_0x834e('0xfe')][_0x834e('0xf2')](db[_0x834e('0xeb')],{'as':_0x834e('0x1bb'),'foreignKey':'userProfileId','onDelete':_0x834e('0xf0')});db['UserProfileSection'][_0x834e('0xf2')](db[_0x834e('0xed')],{'as':'Resources','foreignKey':_0x834e('0x1bc'),'onDelete':_0x834e('0xf0')});module[_0x834e('0x1bd')]={'db':db,'dbH':dbH};
\ No newline at end of file
index bb25b93..80bf82d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43f3=['./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','/apidoc','join','root','/www','/demo','static','/snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_name','test','use','/api/users','./api/user','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports'];(function(_0x4b1f7e,_0x19d08f){var _0x5c6d3b=function(_0x4387ba){while(--_0x4387ba){_0x4b1f7e['push'](_0x4b1f7e['shift']());}};_0x5c6d3b(++_0x19d08f);}(_0x43f3,0x141));var _0x343f=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x43f3[_0x53ccf2];return _0x5a2964;};'use strict';var path=require(_0x343f('0x0'));var express=require('express');var ewinston=require(_0x343f('0x1'));var util=require(_0x343f('0x2'));var errors=require(_0x343f('0x3'));var config=require(_0x343f('0x4'));var logger=require(_0x343f('0x5'))(_0x343f('0x6'));var authLogger=require(_0x343f('0x5'))(_0x343f('0x7'));exports[_0x343f('0x8')]=function(_0x28ac7f){_0x28ac7f['use'](ewinston[_0x343f('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x29d1f2,_0x4aeab3){return util[_0x343f('0xa')](_0x343f('0xb'),_0x29d1f2[_0x343f('0xc')],_0x29d1f2[_0x343f('0xd')][_0x343f('0xe')]?_0x29d1f2[_0x343f('0xd')][_0x343f('0xe')]:_0x29d1f2['connection'][_0x343f('0xf')]||_0x29d1f2['ip'],_0x29d1f2[_0x343f('0x10')],_0x4aeab3[_0x343f('0x11')],_0x4aeab3[_0x343f('0x12')],_0x29d1f2[_0x343f('0x13')]?_0x29d1f2[_0x343f('0x13')]['id']:null,_0x29d1f2['user']?_0x29d1f2[_0x343f('0x13')][_0x343f('0x14')]:null,_0x29d1f2[_0x343f('0x13')]?_0x29d1f2['user'][_0x343f('0x15')]:null);}}));_0x28ac7f['use'](ewinston[_0x343f('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4fe95c,_0x46eac1){var _0x279460=_0x343f('0x16');if(_0x4fe95c[_0x343f('0x17')]&&_0x4fe95c[_0x343f('0x17')][_0x343f('0x18')]&&_0x4fe95c[_0x343f('0x17')][_0x343f('0x19')]){_0x279460=_0x343f('0x1a');}return util[_0x343f('0xa')](_0x279460,_0x4fe95c['method'],_0x4fe95c['headers']['x-forwarded-for']?_0x4fe95c['headers'][_0x343f('0xe')]:_0x4fe95c[_0x343f('0x1b')]['remoteAddress']||_0x4fe95c['ip'],_0x4fe95c[_0x343f('0x10')],_0x46eac1[_0x343f('0x11')],_0x46eac1[_0x343f('0x12')],_0x4fe95c[_0x343f('0x13')]?_0x4fe95c[_0x343f('0x13')]['id']:null,_0x4fe95c['user']?_0x4fe95c[_0x343f('0x13')]['name']:null,_0x4fe95c[_0x343f('0x13')]?_0x4fe95c['user'][_0x343f('0x15')]:null,_0x4fe95c['body']&&_0x4fe95c[_0x343f('0x17')][_0x343f('0x18')]?_0x4fe95c[_0x343f('0x17')][_0x343f('0x18')]:_0x343f('0x1c'),_0x4fe95c[_0x343f('0x17')]&&_0x4fe95c[_0x343f('0x17')]['agent_id']?_0x4fe95c[_0x343f('0x17')][_0x343f('0x19')]:'',_0x4fe95c[_0x343f('0x17')]&&_0x4fe95c[_0x343f('0x17')][_0x343f('0x1d')]?_0x4fe95c['body'][_0x343f('0x1d')]:'');},'ignoreRoute':function(_0x5fa8a7){var _0x448944=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x448944[_0x343f('0x1e')](_0x5fa8a7[_0x343f('0x10')]);}}));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x20'),require(_0x343f('0x21')));_0x28ac7f[_0x343f('0x1f')]('/api/voice/chanspy',require(_0x343f('0x22')));_0x28ac7f[_0x343f('0x1f')]('/api/voice/contexts',require(_0x343f('0x23')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x24'),require(_0x343f('0x25')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x26'),require(_0x343f('0x27')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x28'),require('./api/voiceQueue'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x29'),require('./api/voiceRecording'));_0x28ac7f['use'](_0x343f('0x2a'),require(_0x343f('0x2b')));_0x28ac7f['use'](_0x343f('0x2c'),require(_0x343f('0x2d')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x2e'),require(_0x343f('0x2f')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x30'),require('./api/voiceDialReport'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x31'),require(_0x343f('0x32')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x33'),require(_0x343f('0x34')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x35'),require(_0x343f('0x36')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x37'),require(_0x343f('0x38')));_0x28ac7f['use'](_0x343f('0x39'),require(_0x343f('0x3a')));_0x28ac7f['use']('/api/mail/out_servers',require(_0x343f('0x3b')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x3c'),require(_0x343f('0x3d')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x3e'),require(_0x343f('0x3f')));_0x28ac7f['use'](_0x343f('0x40'),require(_0x343f('0x41')));_0x28ac7f['use']('/api/mail/interactions',require(_0x343f('0x42')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x43'),require(_0x343f('0x44')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x45'),require(_0x343f('0x46')));_0x28ac7f[_0x343f('0x1f')]('/api/mail/reports/queue',require(_0x343f('0x47')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x48'),require(_0x343f('0x49')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x4a'),require(_0x343f('0x4b')));_0x28ac7f[_0x343f('0x1f')]('/api/fax/accounts',require(_0x343f('0x4c')));_0x28ac7f['use']('/api/fax/applications',require(_0x343f('0x4d')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x4e'),require(_0x343f('0x4f')));_0x28ac7f['use'](_0x343f('0x50'),require(_0x343f('0x51')));_0x28ac7f[_0x343f('0x1f')]('/api/fax/queues',require('./api/faxQueue'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x52'),require(_0x343f('0x53')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x54'),require(_0x343f('0x55')));_0x28ac7f[_0x343f('0x1f')]('/api/sms/applications',require(_0x343f('0x56')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x57'),require(_0x343f('0x58')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x59'),require(_0x343f('0x5a')));_0x28ac7f['use'](_0x343f('0x5b'),require(_0x343f('0x5c')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x5d'),require('./api/openchannelAccount'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x5e'),require(_0x343f('0x5f')));_0x28ac7f[_0x343f('0x1f')]('/api/openchannel/interactions',require(_0x343f('0x60')));_0x28ac7f[_0x343f('0x1f')]('/api/openchannel/messages',require(_0x343f('0x61')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x62'),require('./api/openchannelQueue'));_0x28ac7f['use'](_0x343f('0x63'),require(_0x343f('0x64')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x65'),require(_0x343f('0x66')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x67'),require('./api/chatApplication'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x68'),require('./api/chatInteraction'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x69'),require(_0x343f('0x6a')));_0x28ac7f[_0x343f('0x1f')]('/api/chat/offline_messages',require(_0x343f('0x6b')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x6c'),require('./api/chatQueue'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x6d'),require(_0x343f('0x6e')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x6f'),require(_0x343f('0x70')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x71'),require(_0x343f('0x72')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x73'),require('./api/cmContact'));_0x28ac7f[_0x343f('0x1f')]('/api/cm/hopper',require(_0x343f('0x74')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x75'),require('./api/cmHopperBlack'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x76'),require(_0x343f('0x77')));_0x28ac7f['use'](_0x343f('0x78'),require('./api/cmHopperHistory'));_0x28ac7f['use'](_0x343f('0x79'),require('./api/cmCustomField'));_0x28ac7f['use'](_0x343f('0x7a'),require(_0x343f('0x7b')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x7c'),require(_0x343f('0x7d')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x7e'),require(_0x343f('0x7f')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x80'),require(_0x343f('0x81')));_0x28ac7f['use'](_0x343f('0x82'),require(_0x343f('0x83')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x84'),require('./api/interval'));_0x28ac7f['use'](_0x343f('0x85'),require(_0x343f('0x86')));_0x28ac7f['use'](_0x343f('0x87'),require(_0x343f('0x88')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x89'),require(_0x343f('0x8a')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x8b'),require('./api/schedule'));_0x28ac7f['use']('/api/sounds',require('./api/sound'));_0x28ac7f[_0x343f('0x1f')]('/api/tags',require('./api/tag'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x8c'),require(_0x343f('0x8d')));_0x28ac7f['use'](_0x343f('0x8e'),require('./api/trigger'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x8f'),require(_0x343f('0x90')));_0x28ac7f['use'](_0x343f('0x91'),require(_0x343f('0x92')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x93'),require(_0x343f('0x94')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x95'),require(_0x343f('0x96')));_0x28ac7f['use'](_0x343f('0x97'),require(_0x343f('0x98')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x99'),require('./api/analyticExtractedReport'));_0x28ac7f[_0x343f('0x1f')]('/api/analytics/metrics',require(_0x343f('0x9a')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x9b'),require(_0x343f('0x9c')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x9d'),require(_0x343f('0x9e')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0x9f'),require('./api/intSalesforceAccount'));_0x28ac7f[_0x343f('0x1f')]('/api/integrations/salesforce/configurations',require(_0x343f('0xa0')));_0x28ac7f[_0x343f('0x1f')]('/api/integrations/salesforce/fields',require(_0x343f('0xa1')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xa2'),require(_0x343f('0xa3')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xa4'),require('./api/intSugarcrmConfiguration'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xa5'),require(_0x343f('0xa6')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xa7'),require('./api/intDeskAccount'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xa8'),require(_0x343f('0xa9')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xaa'),require(_0x343f('0xab')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xac'),require(_0x343f('0xad')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xae'),require('./api/intZohoConfiguration'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xaf'),require('./api/intZohoField'));_0x28ac7f['use']('/api/integrations/zendesk/accounts',require(_0x343f('0xb0')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xb1'),require(_0x343f('0xb2')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xb3'),require(_0x343f('0xb4')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xb5'),require(_0x343f('0xb6')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xb7'),require(_0x343f('0xb8')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xb9'),require(_0x343f('0xba')));_0x28ac7f['use']('/api/integrations/vtiger/accounts',require(_0x343f('0xbb')));_0x28ac7f['use'](_0x343f('0xbc'),require('./api/intVtigerConfiguration'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xbd'),require(_0x343f('0xbe')));_0x28ac7f[_0x343f('0x1f')]('/api/networks',require(_0x343f('0xbf')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xc0'),require(_0x343f('0xc1')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xc2'),require(_0x343f('0xc3')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xc4'),require('./api/jscriptyAnswerReport'));_0x28ac7f[_0x343f('0x1f')]('/api/jscripty/questions/reports',require(_0x343f('0xc5')));_0x28ac7f['use'](_0x343f('0xc6'),require(_0x343f('0xc7')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xc8'),require(_0x343f('0xc9')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xca'),require(_0x343f('0xcb')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xcc'),require('./api/squareReportDetail'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xcd'),require(_0x343f('0xce')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xcf'),require(_0x343f('0xd0')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xd1'),require('./api/squareOdbc'));_0x28ac7f[_0x343f('0x1f')]('/api/square/projects',require(_0x343f('0xd2')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xd3'),require(_0x343f('0xd4')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xd5'),require('./api/squareMessage'));_0x28ac7f[_0x343f('0x1f')]('/api/teams',require(_0x343f('0xd6')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xd7'),require('./api/license'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xd8'),require(_0x343f('0xd9')));_0x28ac7f['use'](_0x343f('0xda'),require(_0x343f('0xdb')));_0x28ac7f['use'](_0x343f('0xdc'),require('./api/attachment'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xdd'),require('./api/plugin'));_0x28ac7f[_0x343f('0x1f')]('/api/mail/reports/transfer',require(_0x343f('0xde')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xdf'),require('./api/chatTransferReport'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xe0'),require(_0x343f('0xe1')));_0x28ac7f[_0x343f('0x1f')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x28ac7f['use'](_0x343f('0xe2'),require(_0x343f('0xe3')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xe4'),require(_0x343f('0xe5')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xe6'),require('./api/voicePrefix'));_0x28ac7f['use'](_0x343f('0xe7'),require('./api/userProfile'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xe8'),require(_0x343f('0xe9')));_0x28ac7f[_0x343f('0x1f')]('/api/userProfile/resources',require(_0x343f('0xea')));_0x28ac7f[_0x343f('0x1f')]('/api/auth/local',require(_0x343f('0xeb')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xec'),require(_0x343f('0xed')));_0x28ac7f['use'](_0x343f('0xee'),require(_0x343f('0xef')));_0x28ac7f['use']('/api/rpc',require(_0x343f('0xf0')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xf1'),require(_0x343f('0xf2')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xf3'),require('./api/system'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xf4'),require('./api/pm2'));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xf5'),express['static'](path[_0x343f('0xf6')](config['root'],'/apidoc')));_0x28ac7f[_0x343f('0x1f')]('/www',express['static'](path[_0x343f('0xf6')](config[_0x343f('0xf7')],_0x343f('0xf8'))));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xf9'),express[_0x343f('0xfa')](path['join'](config['root'],'/demo')));_0x28ac7f[_0x343f('0x1f')](_0x343f('0xfb'),express[_0x343f('0xfa')](path['join'](config[_0x343f('0xf7')],'snippet','1.0.10')));_0x28ac7f[_0x343f('0x1f')]('/plugins',express[_0x343f('0xfa')](path[_0x343f('0xf6')](config['root'],_0x343f('0xfc'))));_0x28ac7f[_0x343f('0xfd')](_0x343f('0xfe'))['get'](errors[0x194]);_0x28ac7f[_0x343f('0xfd')]('/*')[_0x343f('0xff')](function(_0x1003f7,_0x2b7049){_0x2b7049[_0x343f('0x100')](path[_0x343f('0x101')](_0x28ac7f[_0x343f('0xff')](_0x343f('0x102'))+_0x343f('0x103')));});};
\ No newline at end of file
+var _0x4c18=['/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.11','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','path','express','express-winston','util','./config/logger','api','auth','default','use','logger','format','method','x-forwarded-for','connection','remoteAddress','url','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','headers','other','agent_id','agent_name','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZendeskAccount','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x4c18,0x142));var _0x84c1=function(_0x435c69,_0x62058d){_0x435c69=_0x435c69-0x0;var _0x1b7644=_0x4c18[_0x435c69];return _0x1b7644;};'use strict';var path=require(_0x84c1('0x0'));var express=require(_0x84c1('0x1'));var ewinston=require(_0x84c1('0x2'));var util=require(_0x84c1('0x3'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x84c1('0x4'))(_0x84c1('0x5'));var authLogger=require(_0x84c1('0x4'))(_0x84c1('0x6'));exports[_0x84c1('0x7')]=function(_0x1b6e5e){_0x1b6e5e[_0x84c1('0x8')](ewinston[_0x84c1('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x12faa9,_0x37f4ab){return util[_0x84c1('0xa')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x12faa9[_0x84c1('0xb')],_0x12faa9['headers'][_0x84c1('0xc')]?_0x12faa9['headers'][_0x84c1('0xc')]:_0x12faa9[_0x84c1('0xd')][_0x84c1('0xe')]||_0x12faa9['ip'],_0x12faa9[_0x84c1('0xf')],_0x37f4ab['statusCode'],_0x37f4ab[_0x84c1('0x10')],_0x12faa9[_0x84c1('0x11')]?_0x12faa9[_0x84c1('0x11')]['id']:null,_0x12faa9[_0x84c1('0x11')]?_0x12faa9[_0x84c1('0x11')][_0x84c1('0x12')]:null,_0x12faa9[_0x84c1('0x11')]?_0x12faa9[_0x84c1('0x11')][_0x84c1('0x13')]:null);}}));_0x1b6e5e[_0x84c1('0x8')](ewinston[_0x84c1('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x163a42,_0x3297fb){var _0x457e5e=_0x84c1('0x14');if(_0x163a42[_0x84c1('0x15')]&&_0x163a42['body'][_0x84c1('0x16')]&&_0x163a42[_0x84c1('0x15')]['agent_id']){_0x457e5e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x84c1('0xa')](_0x457e5e,_0x163a42[_0x84c1('0xb')],_0x163a42[_0x84c1('0x17')]['x-forwarded-for']?_0x163a42[_0x84c1('0x17')][_0x84c1('0xc')]:_0x163a42[_0x84c1('0xd')][_0x84c1('0xe')]||_0x163a42['ip'],_0x163a42['url'],_0x3297fb['statusCode'],_0x3297fb['responseTime'],_0x163a42[_0x84c1('0x11')]?_0x163a42[_0x84c1('0x11')]['id']:null,_0x163a42[_0x84c1('0x11')]?_0x163a42[_0x84c1('0x11')][_0x84c1('0x12')]:null,_0x163a42[_0x84c1('0x11')]?_0x163a42['user']['role']:null,_0x163a42[_0x84c1('0x15')]&&_0x163a42[_0x84c1('0x15')][_0x84c1('0x16')]?_0x163a42[_0x84c1('0x15')][_0x84c1('0x16')]:_0x84c1('0x18'),_0x163a42['body']&&_0x163a42[_0x84c1('0x15')][_0x84c1('0x19')]?_0x163a42[_0x84c1('0x15')][_0x84c1('0x19')]:'',_0x163a42['body']&&_0x163a42['body'][_0x84c1('0x1a')]?_0x163a42['body'][_0x84c1('0x1a')]:'');},'ignoreRoute':function(_0x381699){var _0x34807e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x34807e['test'](_0x381699[_0x84c1('0xf')]);}}));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x1b'),require('./api/user'));_0x1b6e5e[_0x84c1('0x8')]('/api/voice/chanspy',require(_0x84c1('0x1c')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x1d'),require(_0x84c1('0x1e')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x1f'),require('./api/voiceExtension'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x20'),require(_0x84c1('0x21')));_0x1b6e5e[_0x84c1('0x8')]('/api/voice/queues',require(_0x84c1('0x22')));_0x1b6e5e['use'](_0x84c1('0x23'),require(_0x84c1('0x24')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x25'),require(_0x84c1('0x26')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x27'),require(_0x84c1('0x28')));_0x1b6e5e[_0x84c1('0x8')]('/api/voice/calls/reports',require(_0x84c1('0x29')));_0x1b6e5e[_0x84c1('0x8')]('/api/voice/dials/reports',require(_0x84c1('0x2a')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x2b'),require(_0x84c1('0x2c')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x2d'),require('./api/voiceQueueReport'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x2e'),require(_0x84c1('0x2f')));_0x1b6e5e['use'](_0x84c1('0x30'),require(_0x84c1('0x31')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x32'),require(_0x84c1('0x33')));_0x1b6e5e[_0x84c1('0x8')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x1b6e5e[_0x84c1('0x8')]('/api/mail/accounts',require('./api/mailAccount'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x34'),require(_0x84c1('0x35')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x36'),require(_0x84c1('0x37')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x38'),require(_0x84c1('0x39')));_0x1b6e5e['use']('/api/mail/messages',require(_0x84c1('0x3a')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x3b'),require(_0x84c1('0x3c')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x3d'),require(_0x84c1('0x3e')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x3f'),require(_0x84c1('0x40')));_0x1b6e5e['use'](_0x84c1('0x41'),require('./api/dashboardItem'));_0x1b6e5e['use'](_0x84c1('0x42'),require(_0x84c1('0x43')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x44'),require(_0x84c1('0x45')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x46'),require(_0x84c1('0x47')));_0x1b6e5e[_0x84c1('0x8')]('/api/fax/messages',require(_0x84c1('0x48')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x49'),require(_0x84c1('0x4a')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x4b'),require(_0x84c1('0x4c')));_0x1b6e5e['use'](_0x84c1('0x4d'),require(_0x84c1('0x4e')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x4f'),require(_0x84c1('0x50')));_0x1b6e5e['use'](_0x84c1('0x51'),require(_0x84c1('0x52')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x53'),require(_0x84c1('0x54')));_0x1b6e5e['use'](_0x84c1('0x55'),require(_0x84c1('0x56')));_0x1b6e5e['use']('/api/openchannel/accounts',require(_0x84c1('0x57')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x58'),require(_0x84c1('0x59')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x5a'),require('./api/openchannelInteraction'));_0x1b6e5e['use']('/api/openchannel/messages',require(_0x84c1('0x5b')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x5c'),require(_0x84c1('0x5d')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x5e'),require('./api/chatWebsite'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x5f'),require(_0x84c1('0x60')));_0x1b6e5e[_0x84c1('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x61'),require(_0x84c1('0x62')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x63'),require(_0x84c1('0x64')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x65'),require('./api/chatOfflineMessage'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x66'),require('./api/chatQueue'));_0x1b6e5e[_0x84c1('0x8')]('/api/chat/groups',require(_0x84c1('0x67')));_0x1b6e5e['use'](_0x84c1('0x68'),require(_0x84c1('0x69')));_0x1b6e5e['use'](_0x84c1('0x6a'),require(_0x84c1('0x6b')));_0x1b6e5e[_0x84c1('0x8')]('/api/cm/contacts',require(_0x84c1('0x6c')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x6d'),require(_0x84c1('0x6e')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x6f'),require(_0x84c1('0x70')));_0x1b6e5e[_0x84c1('0x8')]('/api/cm/hopper_final',require(_0x84c1('0x71')));_0x1b6e5e[_0x84c1('0x8')]('/api/cm/hopper_history',require(_0x84c1('0x72')));_0x1b6e5e[_0x84c1('0x8')]('/api/cm/custom_fields',require(_0x84c1('0x73')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x74'),require(_0x84c1('0x75')));_0x1b6e5e['use'](_0x84c1('0x76'),require('./api/automation'));_0x1b6e5e[_0x84c1('0x8')]('/api/canned_answers',require(_0x84c1('0x77')));_0x1b6e5e[_0x84c1('0x8')]('/api/dispositions',require(_0x84c1('0x78')));_0x1b6e5e['use'](_0x84c1('0x79'),require('./api/condition'));_0x1b6e5e['use'](_0x84c1('0x7a'),require('./api/interval'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x7b'),require('./api/pause'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x7c'),require('./api/cdr'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x7d'),require(_0x84c1('0x7e')));_0x1b6e5e['use'](_0x84c1('0x7f'),require(_0x84c1('0x80')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x81'),require(_0x84c1('0x82')));_0x1b6e5e['use'](_0x84c1('0x83'),require(_0x84c1('0x84')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x85'),require(_0x84c1('0x86')));_0x1b6e5e['use'](_0x84c1('0x87'),require('./api/trigger'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x88'),require('./api/variable'));_0x1b6e5e['use']('/api/integrations',require('./api/integration'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x89'),require(_0x84c1('0x8a')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x8b'),require(_0x84c1('0x8c')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x8d'),require(_0x84c1('0x8e')));_0x1b6e5e['use'](_0x84c1('0x8f'),require(_0x84c1('0x90')));_0x1b6e5e[_0x84c1('0x8')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x91'),require('./api/analyticFieldReport'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x92'),require(_0x84c1('0x93')));_0x1b6e5e['use'](_0x84c1('0x94'),require('./api/intSalesforceAccount'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x95'),require(_0x84c1('0x96')));_0x1b6e5e[_0x84c1('0x8')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x97'),require(_0x84c1('0x98')));_0x1b6e5e[_0x84c1('0x8')]('/api/integrations/sugarcrm/configurations',require(_0x84c1('0x99')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x9a'),require(_0x84c1('0x9b')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0x9c'),require(_0x84c1('0x9d')));_0x1b6e5e['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x1b6e5e['use'](_0x84c1('0x9e'),require('./api/intDeskField'));_0x1b6e5e['use']('/api/integrations/zoho/accounts',require(_0x84c1('0x9f')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xa0'),require('./api/intZohoConfiguration'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xa1'),require('./api/intZohoField'));_0x1b6e5e[_0x84c1('0x8')]('/api/integrations/zendesk/accounts',require(_0x84c1('0xa2')));_0x1b6e5e[_0x84c1('0x8')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x1b6e5e[_0x84c1('0x8')]('/api/integrations/zendesk/fields',require(_0x84c1('0xa3')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xa4'),require('./api/intFreshdeskAccount'));_0x1b6e5e['use'](_0x84c1('0xa5'),require(_0x84c1('0xa6')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xa7'),require(_0x84c1('0xa8')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xa9'),require('./api/intVtigerAccount'));_0x1b6e5e['use'](_0x84c1('0xaa'),require(_0x84c1('0xab')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xac'),require(_0x84c1('0xad')));_0x1b6e5e[_0x84c1('0x8')]('/api/networks',require(_0x84c1('0xae')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xaf'),require(_0x84c1('0xb0')));_0x1b6e5e['use'](_0x84c1('0xb1'),require(_0x84c1('0xb2')));_0x1b6e5e[_0x84c1('0x8')]('/api/jscripty/answers/reports',require(_0x84c1('0xb3')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xb4'),require(_0x84c1('0xb5')));_0x1b6e5e[_0x84c1('0x8')]('/api/jscripty/sessions/reports',require(_0x84c1('0xb6')));_0x1b6e5e['use'](_0x84c1('0xb7'),require(_0x84c1('0xb8')));_0x1b6e5e['use'](_0x84c1('0xb9'),require(_0x84c1('0xba')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xbb'),require(_0x84c1('0xbc')));_0x1b6e5e['use'](_0x84c1('0xbd'),require(_0x84c1('0xbe')));_0x1b6e5e[_0x84c1('0x8')]('/api/settings',require(_0x84c1('0xbf')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xc0'),require('./api/squareOdbc'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xc1'),require(_0x84c1('0xc2')));_0x1b6e5e[_0x84c1('0x8')]('/api/square/recordings',require('./api/squareRecording'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xc3'),require('./api/squareMessage'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xc4'),require(_0x84c1('0xc5')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xc6'),require(_0x84c1('0xc7')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xc8'),require(_0x84c1('0xc9')));_0x1b6e5e[_0x84c1('0x8')]('/api/migrations',require(_0x84c1('0xca')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xcb'),require(_0x84c1('0xcc')));_0x1b6e5e[_0x84c1('0x8')]('/api/plugins',require(_0x84c1('0xcd')));_0x1b6e5e[_0x84c1('0x8')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xce'),require(_0x84c1('0xcf')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xd0'),require('./api/faxTransferReport'));_0x1b6e5e['use']('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xd1'),require(_0x84c1('0xd2')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xd3'),require('./api/cmList'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xd4'),require(_0x84c1('0xd5')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xd6'),require('./api/userProfile'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xd7'),require(_0x84c1('0xd8')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xd9'),require(_0x84c1('0xda')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xdb'),require('./api/authLocal'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xdc'),require('./api/authGoogle'));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xdd'),require(_0x84c1('0xde')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xdf'),require(_0x84c1('0xe0')));_0x1b6e5e[_0x84c1('0x8')]('/api/version',require(_0x84c1('0xe1')));_0x1b6e5e['use'](_0x84c1('0xe2'),require(_0x84c1('0xe3')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xe4'),require(_0x84c1('0xe5')));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xe6'),express[_0x84c1('0xe7')](path[_0x84c1('0xe8')](config[_0x84c1('0xe9')],_0x84c1('0xe6'))));_0x1b6e5e[_0x84c1('0x8')]('/www',express[_0x84c1('0xe7')](path[_0x84c1('0xe8')](config[_0x84c1('0xe9')],_0x84c1('0xea'))));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xeb'),express['static'](path[_0x84c1('0xe8')](config[_0x84c1('0xe9')],_0x84c1('0xeb'))));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xec'),express[_0x84c1('0xe7')](path[_0x84c1('0xe8')](config[_0x84c1('0xe9')],_0x84c1('0xed'),_0x84c1('0xee'))));_0x1b6e5e[_0x84c1('0x8')](_0x84c1('0xef'),express[_0x84c1('0xe7')](path[_0x84c1('0xe8')](config['root'],_0x84c1('0xf0'))));_0x1b6e5e[_0x84c1('0xf1')](_0x84c1('0xf2'))[_0x84c1('0xf3')](errors[0x194]);_0x1b6e5e[_0x84c1('0xf1')]('/*')[_0x84c1('0xf3')](function(_0x1f19cf,_0xde9358){_0xde9358['sendFile'](path[_0x84c1('0xf4')](_0x1b6e5e[_0x84c1('0xf3')](_0x84c1('0xf5'))+'/index.html'));});};
\ No newline at end of file
index 8cda47c..0a4178b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','localhost','log','../config/triggers','default','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc'];(function(_0x1669ff,_0x43eb23){var _0x19977f=function(_0x2b47d1){while(--_0x2b47d1){_0x1669ff['push'](_0x1669ff['shift']());}};_0x19977f(++_0x43eb23);}(_0x814b,0x1a2));var _0xb814=function(_0xe56790,_0x5f304d){_0xe56790=_0xe56790-0x0;var _0x145cf7=_0x814b[_0xe56790];return _0x145cf7;};'use strict';var jayson=require(_0xb814('0x0'));var BPromise=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var config=require(_0xb814('0x3'));exports[_0xb814('0x4')]=function(){return new BPromise(function(_0x477725,_0x4a98af){var _0x38c21a={};_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x6')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x7')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require('../api/voiceQueue/voiceQueue.rpc'));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x8')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x9')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0xa')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0xb')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0xc')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0xd')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0xe')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0xf')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x10')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x11')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x12')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x13')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x14')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x15')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x16')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x17')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x18')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x19')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x1a')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x1b')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x1c')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x38c21a=_['merge'](_0x38c21a,require('../api/smsAccount/smsAccount.rpc'));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require('../api/smsInteraction/smsInteraction.rpc'));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x1d')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x1e')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x1f')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x20')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x21')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x22')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x23')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x24')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x25')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x26')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x27')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x28')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x29')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x2a')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x2b')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x2c')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require('../api/interval/interval.rpc'));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x2d')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x2e')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x2f')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x30')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require('../api/variable/variable.rpc'));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x31')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x32')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x33')));_0x38c21a=_['merge'](_0x38c21a,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x34')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x35')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x36')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x37')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x38')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x39')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x3a')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x3b')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x3c')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x3d')));_0x38c21a=_[_0xb814('0x5')](_0x38c21a,require(_0xb814('0x3e')));_0x38c21a=_['merge'](_0x38c21a,require(_0xb814('0x3f')));var _0xbdb3e9=jayson['server'](_0x38c21a)[_0xb814('0x40')]();var _0x2d0e27=config[_0xb814('0x41')][_0xb814('0x42')]||config[_0xb814('0x42')]+0x1;var _0x467cf9=config['rpc']['ip']||_0xb814('0x43');_0xbdb3e9['on']('error',function(_0x2aaf1c){return _0x4a98af(_0x2aaf1c);});_0xbdb3e9['listen'](_0x2d0e27,_0x467cf9,function(){console[_0xb814('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x467cf9,_0x2d0e27);require(_0xb814('0x45'))[_0xb814('0x46')]();return _0x477725('RPC\x20listening\x20on\x20'+_0x467cf9+':'+_0x2d0e27);});});};
\ No newline at end of file
+var _0x7a54=['../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc'];(function(_0x3116c9,_0x1db034){var _0x2ca671=function(_0x24dae4){while(--_0x24dae4){_0x3116c9['push'](_0x3116c9['shift']());}};_0x2ca671(++_0x1db034);}(_0x7a54,0x106));var _0x47a5=function(_0x7b854a,_0x511fd9){_0x7b854a=_0x7b854a-0x0;var _0x366ea4=_0x7a54[_0x7b854a];return _0x366ea4;};'use strict';var jayson=require(_0x47a5('0x0'));var BPromise=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var config=require('../config/environment');exports[_0x47a5('0x3')]=function(){return new BPromise(function(_0x4086cd,_0x4880bf){var _0x5f7f12={};_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x5')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x6')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x7')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x8')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5f7f12=_['merge'](_0x5f7f12,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x9')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0xa')));_0x5f7f12=_['merge'](_0x5f7f12,require('../api/trunk/trunk.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0xb')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0xc')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0xd')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/mailAccount/mailAccount.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0xe')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0xf')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x10')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x11')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x12')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x13')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x14')));_0x5f7f12=_['merge'](_0x5f7f12,require('../api/faxInteraction/faxInteraction.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/faxMessage/faxMessage.rpc'));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x15')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x16')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x17')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x18')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x19')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x1a')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x1b')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x1c')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x1d')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x1e')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/chatMessage/chatMessage.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x1f')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x20')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/cmHopper/cmHopper.rpc'));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x21')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x22')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x23')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x24')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x25')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x26')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x27')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x28')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x29')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x2a')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x2b')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x2c')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x2d')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x2e')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x2f')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x30')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/squareReport/squareReport.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x31')));_0x5f7f12=_['merge'](_0x5f7f12,require('../api/squareOdbc/squareOdbc.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/squareProject/squareProject.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require(_0x47a5('0x32')));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/squareMessage/squareMessage.rpc'));_0x5f7f12=_[_0x47a5('0x4')](_0x5f7f12,require('../api/campaign/campaign.rpc'));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x33')));_0x5f7f12=_['merge'](_0x5f7f12,require(_0x47a5('0x34')));var _0x5ef577=jayson[_0x47a5('0x35')](_0x5f7f12)[_0x47a5('0x36')]();var _0x38c8d4=config[_0x47a5('0x37')][_0x47a5('0x38')]||config[_0x47a5('0x38')]+0x1;var _0xee582c=config[_0x47a5('0x37')]['ip']||_0x47a5('0x39');_0x5ef577['on']('error',function(_0x396a9a){return _0x4880bf(_0x396a9a);});_0x5ef577[_0x47a5('0x3')](_0x38c8d4,_0xee582c,function(){console['log'](_0x47a5('0x3a'),_0xee582c,_0x38c8d4);require(_0x47a5('0x3b'))[_0x47a5('0x3c')]();return _0x4086cd('RPC\x20listening\x20on\x20'+_0xee582c+':'+_0x38c8d4);});});};
\ No newline at end of file
index 7e574cc..1a5738d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e0a=['utf8','setTimeout','headers','emit','ready','line','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','replace','result=','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','ANSWER','getData','beep','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','format','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./error','call','setEncoding'];(function(_0x5bed23,_0x5349c4){var _0x24fd14=function(_0x3a7e13){while(--_0x3a7e13){_0x5bed23['push'](_0x5bed23['shift']());}};_0x24fd14(++_0x5349c4);}(_0x5e0a,0xd7));var _0xa5e0=function(_0x13dd56,_0x2e454e){_0x13dd56=_0x13dd56-0x0;var _0x3b0aba=_0x5e0a[_0x13dd56];return _0x3b0aba;};'use strict';var util=require(_0xa5e0('0x0'));var _=require(_0xa5e0('0x1'));var EventEmitter=require(_0xa5e0('0x2'))[_0xa5e0('0x3')];var AGIReply=require('./reply');var AGIError=require(_0xa5e0('0x4'));function AGIChannel(_0x5451dc){var _0x4db788=this,_0x28f2c2=new AGIReply(),_0x4c9f07=![],_0x358621={};EventEmitter[_0xa5e0('0x5')](_0x4db788);_0x5451dc[_0xa5e0('0x6')](_0xa5e0('0x7'));_0x5451dc[_0xa5e0('0x8')](0x8*0x3c*0x3c*0x3e8);_0x28f2c2[_0xa5e0('0x6')](_0xa5e0('0x7'));_0x28f2c2['on'](_0xa5e0('0x9'),function(_0x41e49d){for(var _0x87457 in _0x41e49d){_0x4db788[_0x87457]=_0x41e49d[_0x87457];}_0x4db788[_0xa5e0('0xa')](_0xa5e0('0xb'));});_0x28f2c2['on'](_0xa5e0('0xc'),function(_0x1a78e7){if(_0x1a78e7['toLowerCase']()==_0xa5e0('0xd')){_0x4db788[_0xa5e0('0xa')](_0xa5e0('0xd'));return;}if(_0x1a78e7['substring'](0x0,0xb)==_0xa5e0('0xe')){_0x4c9f07=!![];}if(_0x4c9f07){_0x358621['rx']+=_0x1a78e7+'\x0a';if(_0x1a78e7[_0xa5e0('0xf')](_0xa5e0('0x10'))!=-0x1){_0x4c9f07=![];}}else{_0x358621['rx']=_0x1a78e7;}if(_0x4c9f07){return;}if(typeof _0x358621['cb']==_0xa5e0('0x11')){var _0x292b2e=_0x358621['rx'][_0xa5e0('0x12')](0x0,0x3),_0x15f88a=null,_0x417df0=null;_0x292b2e=parseInt(_0x292b2e);if(isNaN(_0x292b2e)){_0x358621['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x292b2e!=0xc8){_0x358621['cb'](null,{'code':_0x292b2e,'result':-0x1,'extra':'KO'});return;}_0x15f88a=_0x358621['rx'][_0xa5e0('0x12')](0x4)[_0xa5e0('0x13')](_0xa5e0('0x14'),'');if(_0x15f88a['indexOf']('\x20')!=-0x1){_0x15f88a=_0x15f88a[_0xa5e0('0x15')](0x0,_0x15f88a[_0xa5e0('0x16')]('\x20'));}if(_[_0xa5e0('0x17')](_0x15f88a,'-1')){_0x15f88a=parseInt(_0x15f88a);}_0x417df0=_0x358621['rx']['split']('\x20');if(_0x417df0['length']==0x3){_0x417df0=_0x417df0[0x2]['substring'](0x1,_0x417df0[0x2][_0xa5e0('0x18')]-0x1);}else if(_0x417df0[_0xa5e0('0x18')]>0x3){var _0x407fd1=/\((.+)\)/;var _0x3a7557=_0x358621['rx'][_0xa5e0('0x19')](_0x407fd1);if(_0x3a7557){_0x417df0=_0x3a7557[0x1];}else{_0x417df0=null;}}else{_0x417df0=null;}_0x358621['cb'](null,{'code':_0x292b2e,'result':_0x15f88a,'extra':_0x417df0});}});_0x5451dc['on']('error',function(_0xbabb12){_0x4db788[_0xa5e0('0xa')](_0xa5e0('0x1a'),new AGIError(_0xa5e0('0x1b'),_0xbabb12[_0xa5e0('0x1c')]));});_0x5451dc['on'](_0xa5e0('0x1d'),function(){_0x4db788[_0xa5e0('0xa')](_0xa5e0('0x1d'),new AGIError(_0xa5e0('0x1e')));});_0x5451dc['on'](_0xa5e0('0x1f'),function(){_0x4db788[_0xa5e0('0xa')](_0xa5e0('0x1f'),new AGIError(_0xa5e0('0x20')));_0x5451dc[_0xa5e0('0x21')]();});_0x5451dc[_0xa5e0('0x22')](_0x28f2c2);this[_0xa5e0('0x23')]=function(_0x44432f,_0x34f9fd){var _0x44432f=_0x44432f||'',_0x34f9fd=typeof _0x34f9fd==_0xa5e0('0x11')?_0x34f9fd:new Function();_0x358621={'tx':_0x44432f,'rx':'','cb':_0x34f9fd};_0x5451dc[_0xa5e0('0x24')](_0x44432f+'\x0a');},this['close']=function(){_0x5451dc[_0xa5e0('0x21')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x26')]=function(_0x1a7e06){return this[_0xa5e0('0x23')][_0xa5e0('0x27')](this,_0x1a7e06);};AGIChannel[_0xa5e0('0x25')]['answer']=function(){return this[_0xa5e0('0x26')](_0xa5e0('0x28'));};AGIChannel['prototype'][_0xa5e0('0x29')]=function(_0x495753,_0x45cd2a,_0x36c14d){_0x495753=_0x495753===undefined?_0xa5e0('0x2a'):_0x495753;_0x45cd2a=_0x45cd2a===undefined?'5':_0x45cd2a;_0x36c14d=_0x36c14d===undefined?'1':_0x36c14d;return this[_0xa5e0('0x26')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x495753,_0x45cd2a*0x3e8,_0x36c14d));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x2b')]=function(_0xc55429){_0xc55429=_0xc55429||_0xa5e0('0x2c');return this[_0xa5e0('0x26')](util['format'](_0xa5e0('0x2d'),_0xc55429));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x2e')]=function(_0x249ec1,_0x3c185f){if(_['isArray'](_0x3c185f)){return this['sendRequest'](util[_0xa5e0('0x2f')]('EXEC\x20%s\x20%s',_0x249ec1,_0x3c185f[_0xa5e0('0x30')](',')));}return this[_0xa5e0('0x26')](util[_0xa5e0('0x2f')]('EXEC\x20%s\x20%s',_0x249ec1,_0x3c185f));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x31')]=function(_0x35d939){return this['sendRequest'](util[_0xa5e0('0x2f')](_0xa5e0('0x32'),_0x35d939));};AGIChannel[_0xa5e0('0x25')]['setExtension']=function(_0x2d898c){return this[_0xa5e0('0x26')](util[_0xa5e0('0x2f')](_0xa5e0('0x33'),_0x2d898c));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x34')]=function(_0x3cb8f5){return this[_0xa5e0('0x26')](util[_0xa5e0('0x2f')]('SET\x20PRIORITY\x20%s',_0x3cb8f5));};AGIChannel['prototype'][_0xa5e0('0xd')]=function(){return this[_0xa5e0('0x26')](_0xa5e0('0x35'));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x36')]=function(_0x25fc80,_0x4f7f8e){return this[_0xa5e0('0x26')](util[_0xa5e0('0x2f')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x25fc80,_0x4f7f8e?_0x4f7f8e[_0xa5e0('0x37')]()[_0xa5e0('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xa5e0('0x38')]=function(_0x205773,_0x343a15){return this[_0xa5e0('0x26')](util[_0xa5e0('0x2f')](_0xa5e0('0x39'),_0x205773,_0x343a15));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x3a')]=function(_0x593d17,_0x2029db){return this[_0xa5e0('0x26')](util[_0xa5e0('0x2f')]('SAY\x20DIGITS\x20%s\x20%s',_0x593d17,_0x2029db));};AGIChannel['prototype'][_0xa5e0('0x3b')]=function(_0x28f05b,_0xdcfcc4){return this[_0xa5e0('0x26')](util['format'](_0xa5e0('0x3c'),_0x28f05b,_0xdcfcc4));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x3d')]=function(_0x1a72a6,_0x2b1751,_0x2a6ac7){_0x2b1751=_0x2b1751||this['extension'];_0x2a6ac7=_0x2a6ac7||0x1;this['setContext'](_0x1a72a6);this[_0xa5e0('0x3e')](_0x2b1751);this['setPriority'](_0x2a6ac7);return this[_0xa5e0('0x2b')](util[_0xa5e0('0x2f')](_0xa5e0('0x3f'),_0x1a72a6,_0x2b1751,_0x2a6ac7));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x40')]=function(_0x4bf5de){return this[_0xa5e0('0x26')](util[_0xa5e0('0x2f')](_0xa5e0('0x41'),_0x4bf5de));};AGIChannel[_0xa5e0('0x25')]['recordFile']=function(_0x2ef77f,_0x5353b9,_0x269180,_0x302ac9,_0x3af298,_0x4e72bb){_0x5353b9=_0x5353b9||_0xa5e0('0x42');_0x269180=_0x269180||'';_0x302ac9=_0x302ac9===undefined?-0x1:_0x302ac9==='-1'?-0x1:_0x302ac9*0x3e8;_0x3af298=_0x3af298===undefined?'':'s='+_0x3af298;_0x4e72bb=_0x4e72bb?_0xa5e0('0x43'):'';return this['sendRequest'](util[_0xa5e0('0x2f')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2ef77f,_0x5353b9,_0x269180,_0x302ac9,_0x4e72bb,_0x3af298));};AGIChannel[_0xa5e0('0x25')]['streamFile']=function(_0x5cbe61,_0x1da7e2){_0x1da7e2=_0x1da7e2||'';return this['sendRequest'](util[_0xa5e0('0x2f')](_0xa5e0('0x44'),_0x5cbe61,_0x1da7e2));};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x45')]=function(_0x5acc89){return this['exec']('AGI',_0x5acc89);};AGIChannel[_0xa5e0('0x25')][_0xa5e0('0x46')]=function(_0x2149cc){return this[_0xa5e0('0x2e')](_0xa5e0('0x47'),_0x2149cc);};AGIChannel[_0xa5e0('0x25')]['error']=function(_0xc1cdf7,_0x1a89e7){this['noop'](util['format'](_0xa5e0('0x48'),_0xc1cdf7['id'],_0xc1cdf7[_0xa5e0('0x49')],_0x1a89e7));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0xb087=['write','destroy','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','format','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','setEncoding','setTimeout','utf8','headers','emit','line','toLowerCase','hangup','search','520\x20End\x20of\x20proper','substring','replace','result=','indexOf','substr','startsWith','split','length','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','function'];(function(_0x1c7ed4,_0x1508a2){var _0x333ea6=function(_0x25c391){while(--_0x25c391){_0x1c7ed4['push'](_0x1c7ed4['shift']());}};_0x333ea6(++_0x1508a2);}(_0xb087,0x1b5));var _0x7b08=function(_0x130544,_0x550809){_0x130544=_0x130544-0x0;var _0x372be4=_0xb087[_0x130544];return _0x372be4;};'use strict';var util=require(_0x7b08('0x0'));var _=require(_0x7b08('0x1'));var EventEmitter=require(_0x7b08('0x2'))[_0x7b08('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x7b08('0x4'));function AGIChannel(_0x1269d5){var _0x54986e=this,_0x572ca5=new AGIReply(),_0xc6a6da=![],_0xaef4b9={};EventEmitter['call'](_0x54986e);_0x1269d5[_0x7b08('0x5')]('utf8');_0x1269d5[_0x7b08('0x6')](0x8*0x3c*0x3c*0x3e8);_0x572ca5[_0x7b08('0x5')](_0x7b08('0x7'));_0x572ca5['on'](_0x7b08('0x8'),function(_0x2f7a0c){for(var _0x5d9aeb in _0x2f7a0c){_0x54986e[_0x5d9aeb]=_0x2f7a0c[_0x5d9aeb];}_0x54986e[_0x7b08('0x9')]('ready');});_0x572ca5['on'](_0x7b08('0xa'),function(_0x26df1c){if(_0x26df1c[_0x7b08('0xb')]()==_0x7b08('0xc')){_0x54986e[_0x7b08('0x9')]('hangup');return;}if(_0x26df1c['substring'](0x0,0xb)=='520-Invalid'){_0xc6a6da=!![];}if(_0xc6a6da){_0xaef4b9['rx']+=_0x26df1c+'\x0a';if(_0x26df1c[_0x7b08('0xd')](_0x7b08('0xe'))!=-0x1){_0xc6a6da=![];}}else{_0xaef4b9['rx']=_0x26df1c;}if(_0xc6a6da){return;}if(typeof _0xaef4b9['cb']=='function'){var _0x3f5ead=_0xaef4b9['rx'][_0x7b08('0xf')](0x0,0x3),_0x1f5330=null,_0x6f9808=null;_0x3f5ead=parseInt(_0x3f5ead);if(isNaN(_0x3f5ead)){_0xaef4b9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3f5ead!=0xc8){_0xaef4b9['cb'](null,{'code':_0x3f5ead,'result':-0x1,'extra':'KO'});return;}_0x1f5330=_0xaef4b9['rx']['substring'](0x4)[_0x7b08('0x10')](_0x7b08('0x11'),'');if(_0x1f5330[_0x7b08('0x12')]('\x20')!=-0x1){_0x1f5330=_0x1f5330[_0x7b08('0x13')](0x0,_0x1f5330[_0x7b08('0x12')]('\x20'));}if(_[_0x7b08('0x14')](_0x1f5330,'-1')){_0x1f5330=parseInt(_0x1f5330);}_0x6f9808=_0xaef4b9['rx'][_0x7b08('0x15')]('\x20');if(_0x6f9808[_0x7b08('0x16')]==0x3){_0x6f9808=_0x6f9808[0x2][_0x7b08('0xf')](0x1,_0x6f9808[0x2][_0x7b08('0x16')]-0x1);}else if(_0x6f9808[_0x7b08('0x16')]>0x3){var _0x49d8bb=/\((.+)\)/;var _0x47f6d7=_0xaef4b9['rx']['match'](_0x49d8bb);if(_0x47f6d7){_0x6f9808=_0x47f6d7[0x1];}else{_0x6f9808=null;}}else{_0x6f9808=null;}_0xaef4b9['cb'](null,{'code':_0x3f5ead,'result':_0x1f5330,'extra':_0x6f9808});}});_0x1269d5['on'](_0x7b08('0x17'),function(_0x229f1a){_0x54986e[_0x7b08('0x9')](_0x7b08('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x229f1a[_0x7b08('0x18')]));});_0x1269d5['on'](_0x7b08('0x19'),function(){_0x54986e[_0x7b08('0x9')](_0x7b08('0x19'),new AGIError(_0x7b08('0x1a')));});_0x1269d5['on'](_0x7b08('0x1b'),function(){_0x54986e[_0x7b08('0x9')](_0x7b08('0x1b'),new AGIError(_0x7b08('0x1c')));_0x1269d5['destroy']();});_0x1269d5['pipe'](_0x572ca5);this[_0x7b08('0x1d')]=function(_0x47caf6,_0x336b9e){var _0x47caf6=_0x47caf6||'',_0x336b9e=typeof _0x336b9e==_0x7b08('0x1e')?_0x336b9e:new Function();_0xaef4b9={'tx':_0x47caf6,'rx':'','cb':_0x336b9e};_0x1269d5[_0x7b08('0x1f')](_0x47caf6+'\x0a');},this[_0x7b08('0x19')]=function(){_0x1269d5[_0x7b08('0x20')]();};}util[_0x7b08('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x7b08('0x22')][_0x7b08('0x23')]=function(_0x2ff41b){return this['command'][_0x7b08('0x24')](this,_0x2ff41b);};AGIChannel[_0x7b08('0x22')][_0x7b08('0x25')]=function(){return this['sendRequest'](_0x7b08('0x26'));};AGIChannel[_0x7b08('0x22')][_0x7b08('0x27')]=function(_0x244e4f,_0x4f475d,_0x104ea6){_0x244e4f=_0x244e4f===undefined?_0x7b08('0x28'):_0x244e4f;_0x4f475d=_0x4f475d===undefined?'5':_0x4f475d;_0x104ea6=_0x104ea6===undefined?'1':_0x104ea6;return this['sendRequest'](util['format'](_0x7b08('0x29'),_0x244e4f,_0x4f475d*0x3e8,_0x104ea6));};AGIChannel[_0x7b08('0x22')]['noop']=function(_0x331aa3){_0x331aa3=_0x331aa3||_0x7b08('0x2a');return this['sendRequest'](util['format'](_0x7b08('0x2b'),_0x331aa3));};AGIChannel[_0x7b08('0x22')][_0x7b08('0x2c')]=function(_0x494f5f,_0x36b8ec){if(_[_0x7b08('0x2d')](_0x36b8ec)){return this['sendRequest'](util[_0x7b08('0x2e')](_0x7b08('0x2f'),_0x494f5f,_0x36b8ec[_0x7b08('0x30')](',')));}return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x2f'),_0x494f5f,_0x36b8ec));};AGIChannel[_0x7b08('0x22')][_0x7b08('0x31')]=function(_0x42647b){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x32'),_0x42647b));};AGIChannel['prototype'][_0x7b08('0x33')]=function(_0x13774a){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x34'),_0x13774a));};AGIChannel['prototype'][_0x7b08('0x35')]=function(_0x4ed9de){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x36'),_0x4ed9de));};AGIChannel['prototype'][_0x7b08('0xc')]=function(){return this['sendRequest']('HANGUP');};AGIChannel['prototype'][_0x7b08('0x37')]=function(_0x174abe,_0x55d5aa){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x38'),_0x174abe,_0x55d5aa?_0x55d5aa[_0x7b08('0x39')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7b08('0x22')][_0x7b08('0x3a')]=function(_0x2cd35b,_0x2c1b3a){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x3b'),_0x2cd35b,_0x2c1b3a));};AGIChannel['prototype'][_0x7b08('0x3c')]=function(_0x855c86,_0x259e5c){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x3d'),_0x855c86,_0x259e5c));};AGIChannel['prototype'][_0x7b08('0x3e')]=function(_0x5b1637,_0x209b8b){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x3f'),_0x5b1637,_0x209b8b));};AGIChannel[_0x7b08('0x22')]['continueAt']=function(_0x5add52,_0x22157d,_0x4af951){_0x22157d=_0x22157d||this[_0x7b08('0x40')];_0x4af951=_0x4af951||0x1;this[_0x7b08('0x31')](_0x5add52);this[_0x7b08('0x33')](_0x22157d);this[_0x7b08('0x35')](_0x4af951);return this[_0x7b08('0x41')](util[_0x7b08('0x2e')](_0x7b08('0x42'),_0x5add52,_0x22157d,_0x4af951));};AGIChannel[_0x7b08('0x22')]['getVariable']=function(_0x391a4d){return this[_0x7b08('0x23')](util[_0x7b08('0x2e')](_0x7b08('0x43'),_0x391a4d));};AGIChannel[_0x7b08('0x22')][_0x7b08('0x44')]=function(_0x3f58db,_0x39e1c2,_0x3b4bde,_0x5d4fc6,_0x1c427a,_0x2fc55e){_0x39e1c2=_0x39e1c2||_0x7b08('0x45');_0x3b4bde=_0x3b4bde||'';_0x5d4fc6=_0x5d4fc6===undefined?-0x1:_0x5d4fc6==='-1'?-0x1:_0x5d4fc6*0x3e8;_0x1c427a=_0x1c427a===undefined?'':'s='+_0x1c427a;_0x2fc55e=_0x2fc55e?_0x7b08('0x46'):'';return this[_0x7b08('0x23')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3f58db,_0x39e1c2,_0x3b4bde,_0x5d4fc6,_0x2fc55e,_0x1c427a));};AGIChannel[_0x7b08('0x22')]['streamFile']=function(_0x4bee57,_0x100414){_0x100414=_0x100414||'';return this[_0x7b08('0x23')](util['format'](_0x7b08('0x47'),_0x4bee57,_0x100414));};AGIChannel[_0x7b08('0x22')][_0x7b08('0x48')]=function(_0x480764){return this[_0x7b08('0x2c')](_0x7b08('0x49'),_0x480764);};AGIChannel[_0x7b08('0x22')]['wait']=function(_0x300640){return this[_0x7b08('0x2c')](_0x7b08('0x4a'),_0x300640);};AGIChannel[_0x7b08('0x22')][_0x7b08('0x17')]=function(_0x5bc110,_0x198d43){this[_0x7b08('0x41')](util['format'](_0x7b08('0x4b'),_0x5bc110['id'],_0x5bc110[_0x7b08('0x4c')],_0x198d43));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7b08('0x4d')]=AGIChannel;
\ No newline at end of file
index 1dc37c7..9dbdf64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed71=['util','Undefined\x20error.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports'];(function(_0x41d623,_0x512249){var _0x4a6ec5=function(_0x3d57d5){while(--_0x3d57d5){_0x41d623['push'](_0x41d623['shift']());}};_0x4a6ec5(++_0x512249);}(_0xed71,0xb0));var _0x1ed7=function(_0x593683,_0x2b3213){_0x593683=_0x593683-0x0;var _0x44cc39=_0xed71[_0x593683];return _0x44cc39;};'use strict';var util=require(_0x1ed7('0x0'));var error={'E_AGI_UNDEFINED':_0x1ed7('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x1ed7('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x1ed7('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x1ed7('0x4'),'E_AGI_SOCKET_ERROR':_0x1ed7('0x5'),'E_AGI_SOCKET_CLOSE':_0x1ed7('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x1ed7('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1ed7('0x8'),'E_AGI_IVR_ENTRY':_0x1ed7('0x9')};function AGIError(_0x33a8f0){var _0x33a8f0=_0x33a8f0||null,_0xca502=_0xca502||[],_0x20c5b2=0x1,_0x4f1d6c='';if(!error[_0x33a8f0]){_0x33a8f0='E_AGI_UNDEFINED';}_0xca502[_0x1ed7('0xa')](error[_0x33a8f0]);while(arguments[_0x20c5b2]){_0xca502[_0x1ed7('0xa')](arguments[_0x20c5b2]);_0x20c5b2++;}_0x4f1d6c=util[_0x1ed7('0xb')][_0x1ed7('0xc')](util,_0xca502);this[_0x1ed7('0xd')]=_0x4f1d6c;this[_0x1ed7('0xe')]=_0x33a8f0;}module[_0x1ed7('0xf')]=AGIError;
\ No newline at end of file
+var _0x216e=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x216e,0x1bf));var _0xe216=function(_0x3e735b,_0x132d35){_0x3e735b=_0x3e735b-0x0;var _0x30752e=_0x216e[_0x3e735b];return _0x30752e;};'use strict';var util=require(_0xe216('0x0'));var error={'E_AGI_UNDEFINED':_0xe216('0x1'),'E_AGI_ARGUMENT_PORT':_0xe216('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xe216('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xe216('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xe216('0x5'),'E_AGI_SOCKET_CLOSE':_0xe216('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xe216('0x7'),'E_AGI_COMMAND_EMPTY':_0xe216('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xe216('0x9')};function AGIError(_0x343afd){var _0x343afd=_0x343afd||null,_0x388995=_0x388995||[],_0x28f167=0x1,_0xd13506='';if(!error[_0x343afd]){_0x343afd=_0xe216('0xa');}_0x388995[_0xe216('0xb')](error[_0x343afd]);while(arguments[_0x28f167]){_0x388995[_0xe216('0xb')](arguments[_0x28f167]);_0x28f167++;}_0xd13506=util[_0xe216('0xc')][_0xe216('0xd')](util,_0x388995);this['message']=_0xd13506;this[_0xe216('0xe')]=_0x343afd;}module['exports']=AGIError;
\ No newline at end of file
index bd63617..521bbc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5fc=['traverseBFS','agicommand','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','push','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','menu','invalid'];(function(_0x262f73,_0x5450c3){var _0x519cbe=function(_0x31c8b2){while(--_0x31c8b2){_0x262f73['push'](_0x262f73['shift']());}};_0x519cbe(++_0x5450c3);}(_0xd5fc,0xae));var _0xcd5f=function(_0x2aceb5,_0x10e7f4){_0x2aceb5=_0x2aceb5-0x0;var _0x34b772=_0xd5fc[_0x2aceb5];return _0x34b772;};'use strict';var _=require(_0xcd5f('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=['menu',_0xcd5f('0x1'),_0xcd5f('0x2')];var Graph=function(){this[_0xcd5f('0x3')]={};this[_0xcd5f('0x4')]={};this[_0xcd5f('0x5')]=0x0;};Graph[_0xcd5f('0x6')]['addVertex']=function(_0x3eeb6b){this['vertices'][_0x3eeb6b['id']]=_0x3eeb6b;this[_0xcd5f('0x4')][_0x3eeb6b['id']]=[];};Graph[_0xcd5f('0x6')]['addEdge']=function(_0x58d65d,_0x4e668e,_0x102ce9){this['edges'][_0x58d65d][_0xcd5f('0x7')]({'target':_0x4e668e,'condition':_0x102ce9});this[_0xcd5f('0x5')]+=0x1;};Graph['prototype'][_0xcd5f('0x8')]=function(){return _['size'](this[_0xcd5f('0x3')]);};Graph['prototype'][_0xcd5f('0x9')]=function(){return this[_0xcd5f('0x5')];};Graph[_0xcd5f('0x6')][_0xcd5f('0xa')]=function(_0x53a250){return this[_0xcd5f('0x3')][_0x53a250];};Graph[_0xcd5f('0x6')]['traverseBFS']=function(_0x14125f,_0x2c23a7){if(!this[_0xcd5f('0x3')][_0x14125f]){return logger[_0xcd5f('0xb')](_0xcd5f('0xc'));}var _0x4d2d39=_0x2c23a7(this[_0xcd5f('0x3')][_0x14125f]);if(!_0x4d2d39){return logger[_0xcd5f('0xb')](_0xcd5f('0xd'));}if(this[_0xcd5f('0x4')][_0x14125f][_0xcd5f('0xe')]===0x0){return logger[_0xcd5f('0xb')](_0xcd5f('0xf'));}for(var _0x503ab6=0x0,_0x398e16=[],_0x33ab1a=![];_0x503ab6<this[_0xcd5f('0x4')][_0x14125f][_0xcd5f('0xe')];_0x503ab6+=0x1){if(this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x10')]){_0x398e16=this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x10')][_0xcd5f('0x11')](',');for(var _0x48d5bb=0x0;_0x48d5bb<_0x398e16[_0xcd5f('0xe')];_0x48d5bb+=0x1){if(this[_0xcd5f('0x3')][_0x14125f]['agicommand']===_0xcd5f('0x12')&&_0x398e16[_0x48d5bb]==='-'){_0x33ab1a=this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x13')];logger['info']('default',_0x398e16[_0x48d5bb],this[_0xcd5f('0x4')][_0x14125f][_0x503ab6]['target']);}else if(this['vertices'][_0x14125f]['agicommand']===_0xcd5f('0x14')&&_0x398e16[_0x48d5bb]==='i'){_0x33ab1a=this['edges'][_0x14125f][_0x503ab6][_0xcd5f('0x13')];logger[_0xcd5f('0xb')](_0xcd5f('0x15'),_0x398e16[_0x48d5bb],this[_0xcd5f('0x4')][_0x14125f][_0x503ab6][_0xcd5f('0x13')]);}if(_0x398e16[_0x48d5bb]===_0x4d2d39){return this['traverseBFS'](this[_0xcd5f('0x4')][_0x14125f][_0x503ab6][_0xcd5f('0x13')],_0x2c23a7);}}}else{return this[_0xcd5f('0x16')](this[_0xcd5f('0x4')][_0x14125f][_0x503ab6][_0xcd5f('0x13')],_0x2c23a7);}}if(_0x398e16[_0xcd5f('0xe')]){if(this[_0xcd5f('0x3')][_0x14125f][_0xcd5f('0x17')]===_0xcd5f('0x12')){if(_0x33ab1a){return this[_0xcd5f('0x16')](_0x33ab1a,_0x2c23a7);}return logger[_0xcd5f('0xb')](_0xcd5f('0x18'));}else if(_[_0xcd5f('0x19')](verticesWithRetry,this[_0xcd5f('0x3')][_0x14125f][_0xcd5f('0x17')])){if(_0x4d2d39==='-'){return logger[_0xcd5f('0xb')](_0xcd5f('0x1a'));}if(_0x33ab1a&&_0x4d2d39!=='t'){return this['traverseBFS'](_0x33ab1a,_0x2c23a7);}return this[_0xcd5f('0x16')](_0x14125f,_0x2c23a7);}return logger[_0xcd5f('0xb')]('condition\x20not\x20found');}};module[_0xcd5f('0x1b')]=Graph;
\ No newline at end of file
+var _0xe5b5=['../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','traverseBFS','info','no\x20vertex\x20found','no\x20edge/s\x20available','condition','split','agicommand','target','default','invalid','vswitch','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash'];(function(_0x27b48b,_0x587b8b){var _0x4de673=function(_0x514f8e){while(--_0x514f8e){_0x27b48b['push'](_0x27b48b['shift']());}};_0x4de673(++_0x587b8b);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x21d0c3,_0x16c71c){_0x21d0c3=_0x21d0c3-0x0;var _0x4df18e=_0xe5b5[_0x21d0c3];return _0x4df18e;};'use strict';var _=require(_0x5e5b('0x0'));var logger=require(_0x5e5b('0x1'))(_0x5e5b('0x2'));var verticesWithRetry=[_0x5e5b('0x3'),_0x5e5b('0x4'),_0x5e5b('0x5')];var Graph=function(){this[_0x5e5b('0x6')]={};this[_0x5e5b('0x7')]={};this[_0x5e5b('0x8')]=0x0;};Graph[_0x5e5b('0x9')][_0x5e5b('0xa')]=function(_0x40bc5b){this[_0x5e5b('0x6')][_0x40bc5b['id']]=_0x40bc5b;this[_0x5e5b('0x7')][_0x40bc5b['id']]=[];};Graph[_0x5e5b('0x9')][_0x5e5b('0xb')]=function(_0xe089b1,_0xcbd478,_0x258414){this[_0x5e5b('0x7')][_0xe089b1][_0x5e5b('0xc')]({'target':_0xcbd478,'condition':_0x258414});this[_0x5e5b('0x8')]+=0x1;};Graph[_0x5e5b('0x9')]['size']=function(){return _[_0x5e5b('0xd')](this['vertices']);};Graph[_0x5e5b('0x9')][_0x5e5b('0xe')]=function(){return this[_0x5e5b('0x8')];};Graph[_0x5e5b('0x9')]['getVertex']=function(_0x4a1424){return this['vertices'][_0x4a1424];};Graph[_0x5e5b('0x9')][_0x5e5b('0xf')]=function(_0x4559a0,_0x1694ff){if(!this[_0x5e5b('0x6')][_0x4559a0]){return logger[_0x5e5b('0x10')](_0x5e5b('0x11'));}var _0x49edd0=_0x1694ff(this[_0x5e5b('0x6')][_0x4559a0]);if(!_0x49edd0){return logger[_0x5e5b('0x10')]('stop\x20traverse');}if(this[_0x5e5b('0x7')][_0x4559a0]['length']===0x0){return logger['info'](_0x5e5b('0x12'));}for(var _0x444435=0x0,_0xaf9ace=[],_0x5c7148=![];_0x444435<this[_0x5e5b('0x7')][_0x4559a0]['length'];_0x444435+=0x1){if(this[_0x5e5b('0x7')][_0x4559a0][_0x444435][_0x5e5b('0x13')]){_0xaf9ace=this['edges'][_0x4559a0][_0x444435][_0x5e5b('0x13')][_0x5e5b('0x14')](',');for(var _0x2281c8=0x0;_0x2281c8<_0xaf9ace['length'];_0x2281c8+=0x1){if(this[_0x5e5b('0x6')][_0x4559a0][_0x5e5b('0x15')]==='vswitch'&&_0xaf9ace[_0x2281c8]==='-'){_0x5c7148=this[_0x5e5b('0x7')][_0x4559a0][_0x444435][_0x5e5b('0x16')];logger[_0x5e5b('0x10')](_0x5e5b('0x17'),_0xaf9ace[_0x2281c8],this[_0x5e5b('0x7')][_0x4559a0][_0x444435][_0x5e5b('0x16')]);}else if(this[_0x5e5b('0x6')][_0x4559a0][_0x5e5b('0x15')]==='menu'&&_0xaf9ace[_0x2281c8]==='i'){_0x5c7148=this['edges'][_0x4559a0][_0x444435][_0x5e5b('0x16')];logger[_0x5e5b('0x10')](_0x5e5b('0x18'),_0xaf9ace[_0x2281c8],this[_0x5e5b('0x7')][_0x4559a0][_0x444435][_0x5e5b('0x16')]);}if(_0xaf9ace[_0x2281c8]===_0x49edd0){return this[_0x5e5b('0xf')](this[_0x5e5b('0x7')][_0x4559a0][_0x444435][_0x5e5b('0x16')],_0x1694ff);}}}else{return this[_0x5e5b('0xf')](this[_0x5e5b('0x7')][_0x4559a0][_0x444435][_0x5e5b('0x16')],_0x1694ff);}}if(_0xaf9ace['length']){if(this[_0x5e5b('0x6')][_0x4559a0][_0x5e5b('0x15')]===_0x5e5b('0x19')){if(_0x5c7148){return this['traverseBFS'](_0x5c7148,_0x1694ff);}return logger[_0x5e5b('0x10')](_0x5e5b('0x1a'));}else if(_['includes'](verticesWithRetry,this[_0x5e5b('0x6')][_0x4559a0][_0x5e5b('0x15')])){if(_0x49edd0==='-'){return logger[_0x5e5b('0x10')](_0x5e5b('0x1b'));}if(_0x5c7148&&_0x49edd0!=='t'){return this[_0x5e5b('0xf')](_0x5c7148,_0x1694ff);}return this[_0x5e5b('0xf')](_0x4559a0,_0x1694ff);}return logger[_0x5e5b('0x10')](_0x5e5b('0x1c'));}};module[_0x5e5b('0x1d')]=Graph;
\ No newline at end of file
index 0a50653..9c46108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9b1=['name','message','[ERROR]\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','toJson','mxGraphModel','root','hasOwnProperty','maxRetry','retry','addVertex','mxCell','length','source','target','getSquareProject','then','catch','createSquareReport','indexOf','agi_','inspect','variables','stringify','close','timeout','hangup','production','start','debug','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','toString','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','connection','syncho','util','moment','../../config/environment','../../config/logger','agi','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','port','info','format'];(function(_0xef88d0,_0x1b7c28){var _0x30f513=function(_0x566455){while(--_0x566455){_0xef88d0['push'](_0xef88d0['shift']());}};_0x30f513(++_0x1b7c28);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x1a9b('0x0'));var util=require(_0x1a9b('0x1'));var moment=require(_0x1a9b('0x2'));var config=require(_0x1a9b('0x3'));var logger=require(_0x1a9b('0x4'))(_0x1a9b('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x1a9b('0x6'));var Vertices=require(_0x1a9b('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x1a9b('0x5')]=_[_0x1a9b('0x8')](config[_0x1a9b('0x5')],{'ip':_0x1a9b('0x9'),'port':0x11dd});function connectionHandler(_0x263b84){process[_0x1a9b('0xa')](function(){syncho(function(){try{setChannelVariables(_0x263b84);agiHandler(_0x263b84);}catch(_0x29932a){logger[_0x1a9b('0xb')](_0x29932a[_0x1a9b('0xc')]);}});});}function listeningHandler(){console[_0x1a9b('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0x1a9b('0xe')]);logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config['agi'][_0x1a9b('0xe')]));}function errorHandler(_0x3a49dd){if(_0x3a49dd&&_0x3a49dd[_0x1a9b('0x11')]&&_0x3a49dd[_0x1a9b('0x12')]){logger[_0x1a9b('0xb')](util[_0x1a9b('0x10')]('[%s]\x20%s',_0x3a49dd[_0x1a9b('0x11')],_0x3a49dd[_0x1a9b('0x12')]));}else{logger[_0x1a9b('0xb')](util['format'](_0x1a9b('0x13'),_0x3a49dd[_0x1a9b('0xc')]));}}function closeHandler(){logger['info'](util[_0x1a9b('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1a9b('0x14')],this[_0x1a9b('0x15')],this[_0x1a9b('0x16')],this[_0x1a9b('0x17')],this[_0x1a9b('0x18')]));try{createSquareReport(this);}catch(_0x20b8dc){logger[_0x1a9b('0xb')](_0x20b8dc[_0x1a9b('0xc')]);}}function timeoutHandler(){logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1a9b('0x14')],this[_0x1a9b('0x15')],this[_0x1a9b('0x16')],this[_0x1a9b('0x17')],this['uniqueid']));}function hangupHandler(){logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1a9b('0x14')],this[_0x1a9b('0x15')],this[_0x1a9b('0x16')],this[_0x1a9b('0x17')],this[_0x1a9b('0x18')]));this['evtHangup']=!![];}function getRoot(_0x189e78){return parser[_0x1a9b('0x19')](_0x189e78,{'object':!![]})[_0x1a9b('0x1a')][_0x1a9b('0x1b')];}function addVertex(_0x36391a,_0x2e42f1,_0x28f937){_0x2e42f1['agicommand']=_0x28f937;if(_0x2e42f1[_0x1a9b('0x1c')]('retry')){_0x2e42f1[_0x1a9b('0x1d')]=parseInt(_0x2e42f1[_0x1a9b('0x1e')],0xa);}_0x36391a[_0x1a9b('0x1f')](_['omit'](_0x2e42f1,_0x1a9b('0x20')));}function initGraph(_0x3db708,_0x1521f4){var _0x181331=new Graph();for(var _0x18c9dd in _0x3db708){if(_0x3db708[_0x1a9b('0x1c')](_0x18c9dd)){if(_['isArray'](_0x3db708[_0x18c9dd])){for(var _0x3f7807=0x0;_0x3f7807<_0x3db708[_0x18c9dd][_0x1a9b('0x21')];_0x3f7807+=0x1){addVertex(_0x181331,_0x3db708[_0x18c9dd][_0x3f7807],_0x18c9dd);}}else{addVertex(_0x181331,_0x3db708[_0x18c9dd],_0x18c9dd);}}}for(var _0x566fb4=0x0;_0x566fb4<_0x1521f4[_0x1a9b('0x21')];_0x566fb4+=0x1){if(_0x1521f4[_0x566fb4][_0x1a9b('0x22')]&&_0x1521f4[_0x566fb4]['target']){_0x181331['addEdge'](_0x1521f4[_0x566fb4][_0x1a9b('0x22')],_0x1521f4[_0x566fb4][_0x1a9b('0x23')],_0x1521f4[_0x566fb4]['value']);}}return _0x181331;}function getSquareProject(_0x30278b,_0x4071dd){rpc[_0x1a9b('0x24')](_0x30278b)[_0x1a9b('0x25')](function(_0x1a5085){_0x4071dd(null,_0x1a5085);})[_0x1a9b('0x26')](function(_0x26949c){_0x4071dd(null,_0x26949c);});}function createSquareReport(_0x5ed1e3,_0x3ba2fe){rpc[_0x1a9b('0x27')](_0x5ed1e3)[_0x1a9b('0x25')](function(_0x4185ad){if(_0x3ba2fe){_0x3ba2fe(null,_0x4185ad);}})[_0x1a9b('0x26')](function(_0x284b5f){if(_0x3ba2fe){_0x3ba2fe(null,_0x284b5f);}});}function setChannelVariables(_0xe0dd38){for(var _0x3fadcd in _0xe0dd38){if(_0xe0dd38[_0x1a9b('0x1c')](_0x3fadcd)){if(_0x3fadcd[_0x1a9b('0x28')](_0x1a9b('0x29'))===0x0){_0xe0dd38[_0x3fadcd['substring'](0x4)]=_0xe0dd38[_0x3fadcd];delete _0xe0dd38[_0x3fadcd];}}}}function getLogFromObject(_0x579a34){return util[_0x1a9b('0x2a')](_0x579a34,{'showHidden':![],'depth':null});}function agiHandler(_0x1d0179){var _0x174cda,_0x47f470,_0x248a31,_0x50f835,_0x2595f1;logger['debug'](_0x1a9b('0x2b'),JSON[_0x1a9b('0x2c')](_0x1d0179,null,0x2));logger['info'](util[_0x1a9b('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1d0179[_0x1a9b('0x14')],_0x1d0179[_0x1a9b('0x15')],_0x1d0179[_0x1a9b('0x16')],_0x1d0179[_0x1a9b('0x17')],_0x1d0179['uniqueid']));_0x1d0179['on'](_0x1a9b('0xb'),errorHandler);_0x1d0179['on'](_0x1a9b('0x2d'),closeHandler);_0x1d0179['on'](_0x1a9b('0x2e'),timeoutHandler);_0x1d0179['evtHangup']=![];_0x1d0179['on'](_0x1a9b('0x2f'),hangupHandler);var _0x5be8b9=getSquareProject['sync'](null,_0x1d0179[_0x1a9b('0x14')]);if(_0x5be8b9){if(_0x5be8b9[_0x1a9b('0x30')]){_0x174cda=getRoot(_0x5be8b9[_0x1a9b('0x30')]);if(_0x174cda&&_0x174cda[_0x1a9b('0x31')]){logger[_0x1a9b('0x32')](_0x1a9b('0x1b'),JSON[_0x1a9b('0x2c')](_0x174cda,null,0x2));_0x1d0179['joinAt']=moment()[_0x1a9b('0x10')](_0x1a9b('0x33'));_0x47f470=initGraph(_[_0x1a9b('0x34')](_0x174cda,'mxCell'),_0x174cda[_0x1a9b('0x20')]);_0x248a31=new Vertices(_0x1d0179,rpc,mailRpc);logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')](_0x1a9b('0x35'),_0x1d0179['arg_1'],_0x1d0179['calleridname'],_0x1d0179[_0x1a9b('0x16')],_0x1d0179[_0x1a9b('0x17')],_0x1d0179[_0x1a9b('0x18')]));_0x47f470['traverseBFS'](_0x174cda['start']['id'],function(_0x2b9bcf){try{_0x2b9bcf=_0x248a31[_0x1a9b('0x36')](_0x2b9bcf);logger[_0x1a9b('0x32')](_0x1a9b('0x37'),JSON[_0x1a9b('0x2c')](_0x2b9bcf,null,0x2));if(_0x2b9bcf[_0x1a9b('0x38')]===_0x1a9b('0x39')){logger['info'](_0x1a9b('0x3a'));_0x1d0179[_0x1a9b('0x3b')]=_0x2b9bcf[_0x1a9b('0x3b')]||_0x1d0179[_0x1a9b('0x3b')];_0x1d0179[_0x1a9b('0x3c')]=_0x2b9bcf[_0x1a9b('0x3c')];_0x1d0179[_0x1a9b('0x3d')]=_0x2b9bcf[_0x1a9b('0x3d')]?_0x2b9bcf[_0x1a9b('0x3d')]-0x1:0x1;return null;}else if(_0x2b9bcf&&_0x248a31[_0x2b9bcf[_0x1a9b('0x38')]]){_0x2595f1=_0x248a31[_0x2b9bcf[_0x1a9b('0x38')]](_0x2b9bcf);logger[_0x1a9b('0xf')](_0x1a9b('0x3e'),JSON[_0x1a9b('0x2c')](_0x2595f1,null,0x2));if(_0x2595f1&&_0x2595f1[_0x1a9b('0x3f')]===AGI_CODE_SUCCESS&&_0x2595f1[_0x1a9b('0x40')]!==AGI_RESULT_ERROR&&!_0x1d0179['evtHangup']){logger[_0x1a9b('0x32')](_0x1a9b('0x3e'),getLogFromObject(_0x2595f1));return _['isUndefined'](_0x2595f1[_0x1a9b('0x40')])?null:_0x2595f1['result']['toString']();}else{logger[_0x1a9b('0xb')](_0x1a9b('0x3e'),getLogFromObject(_0x2595f1));return null;}}else{logger[_0x1a9b('0xb')](_0x1a9b('0x41'));return null;}}catch(_0x27acf0){logger[_0x1a9b('0xb')](_0x27acf0[_0x1a9b('0xc')]);return null;}});if(_0x174cda['finally']){logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')](_0x1a9b('0x42'),_0x1d0179[_0x1a9b('0x14')],_0x1d0179['calleridname'],_0x1d0179[_0x1a9b('0x16')],_0x1d0179[_0x1a9b('0x17')],_0x1d0179[_0x1a9b('0x18')]));_0x47f470[_0x1a9b('0x43')](_0x174cda['finally']['id'],function(_0x5ae813){try{_0x5ae813=_0x248a31[_0x1a9b('0x36')](_0x5ae813);logger[_0x1a9b('0x32')](_0x1a9b('0x37'),JSON[_0x1a9b('0x2c')](_0x5ae813,null,0x2));if(_0x5ae813&&_0x248a31[_0x5ae813['agicommand']]){_0x2595f1=_0x248a31[_0x5ae813['agicommand']](_0x5ae813);if(_0x2595f1){logger[_0x1a9b('0x32')](_0x1a9b('0x3e'),getLogFromObject(_0x2595f1));return _['isUndefined'](_0x2595f1['result'])?null:_0x2595f1[_0x1a9b('0x40')][_0x1a9b('0x44')]();}else{logger[_0x1a9b('0xb')]('response',getLogFromObject(_0x2595f1));return null;}}else{logger[_0x1a9b('0xb')](_0x1a9b('0x41'));return null;}}catch(_0x437ec9){logger[_0x1a9b('0xb')](_0x437ec9[_0x1a9b('0xc')]);return null;}});}logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1d0179['arg_1'],_0x1d0179['calleridname'],_0x1d0179[_0x1a9b('0x16')],_0x1d0179[_0x1a9b('0x17')],_0x1d0179[_0x1a9b('0x18')]));logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1d0179[_0x1a9b('0x3b')],_0x1d0179[_0x1a9b('0x3c')],parseInt(_0x1d0179[_0x1a9b('0x3d')],0xa)+0x1));_0x1d0179[_0x1a9b('0x45')](_0x1d0179[_0x1a9b('0x3b')],_0x1d0179[_0x1a9b('0x3c')],parseInt(_0x1d0179[_0x1a9b('0x3d')],0xa)+0x1);_0x1d0179[_0x1a9b('0x2d')]();}}else{logger[_0x1a9b('0xb')](util[_0x1a9b('0x10')](_0x1a9b('0x46'),_0x1d0179[_0x1a9b('0x14')]));_0x1d0179[_0x1a9b('0x45')](_0x1d0179[_0x1a9b('0x3b')],_0x1d0179[_0x1a9b('0x3c')],parseInt(_0x1d0179[_0x1a9b('0x3d')],0xa)+0x1);_0x1d0179[_0x1a9b('0x2d')]();}}else{logger[_0x1a9b('0xb')](util[_0x1a9b('0x10')](_0x1a9b('0x47'),_0x1d0179[_0x1a9b('0x14')]));_0x1d0179['continueAt'](_0x1d0179['context'],_0x1d0179[_0x1a9b('0x3c')],parseInt(_0x1d0179[_0x1a9b('0x3d')],0xa)+0x1);_0x1d0179[_0x1a9b('0x2d')]();}}function main(){var _0x13361f;return utilLicense['getLicense']()[_0x1a9b('0x25')](function(_0x4ba93b){if(_0x4ba93b){if(_0x4ba93b[_0x1a9b('0x48')]){if(_0x4ba93b[_0x1a9b('0x49')]&&_0x4ba93b[_0x1a9b('0x49')]>0x0){logger[_0x1a9b('0xf')](util[_0x1a9b('0x10')](_0x1a9b('0x4a'),_0x4ba93b[_0x1a9b('0x49')]));_0x13361f=_0x4ba93b[_0x1a9b('0x49')];}else{logger[_0x1a9b('0xf')](_0x1a9b('0x4b'));}}else{logger[_0x1a9b('0xf')](_0x1a9b('0x4c'));_0x13361f=-0x1;}}})[_0x1a9b('0x26')](function(_0x2d7981){logger[_0x1a9b('0xb')](_0x1a9b('0x4d'),_0x2d7981[_0x1a9b('0xc')]);})[_0x1a9b('0x4e')](function(){var _0x4e4eab=require(_0x1a9b('0x4f'))(config[_0x1a9b('0x5')][_0x1a9b('0xe')],config[_0x1a9b('0x5')]['ip'],_0x13361f);_0x4e4eab['on']('error',errorHandler);_0x4e4eab['on']('listening',listeningHandler);_0x4e4eab['on'](_0x1a9b('0x50'),connectionHandler);_0x4e4eab['on'](_0x1a9b('0x2d'),closeHandler);});}main();
\ No newline at end of file
+var _0x2fed=['production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','maxRetry','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','value','getSquareProject','then','createSquareReport','catch','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync'];(function(_0x32f01c,_0x1c1ee6){var _0x50726e=function(_0x4ef5eb){while(--_0x4ef5eb){_0x32f01c['push'](_0x32f01c['shift']());}};_0x50726e(++_0x1c1ee6);}(_0x2fed,0x7c));var _0xd2fe=function(_0xd0f52f,_0x30f9b2){_0xd0f52f=_0xd0f52f-0x0;var _0x2f56dd=_0x2fed[_0xd0f52f];return _0x2f56dd;};'use strict';var parser=require(_0xd2fe('0x0'));var _=require(_0xd2fe('0x1'));var syncho=require(_0xd2fe('0x2'));var util=require(_0xd2fe('0x3'));var moment=require(_0xd2fe('0x4'));var config=require('../../config/environment');var logger=require(_0xd2fe('0x5'))(_0xd2fe('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0xd2fe('0x7'));var Graph=require(_0xd2fe('0x8'));var Vertices=require(_0xd2fe('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xd2fe('0xa')](config[_0xd2fe('0x6')],{'ip':_0xd2fe('0xb'),'port':0x11dd});function connectionHandler(_0x42a8fb){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x42a8fb);agiHandler(_0x42a8fb);}catch(_0x1ab034){logger[_0xd2fe('0xc')](_0x1ab034[_0xd2fe('0xd')]);}});});}function listeningHandler(){console[_0xd2fe('0xe')](_0xd2fe('0xf'),config[_0xd2fe('0x6')][_0xd2fe('0x10')]);logger[_0xd2fe('0x11')](util[_0xd2fe('0x12')](_0xd2fe('0x13'),config[_0xd2fe('0x6')]['ip'],config[_0xd2fe('0x6')][_0xd2fe('0x10')]));}function errorHandler(_0x7017c8){if(_0x7017c8&&_0x7017c8[_0xd2fe('0x14')]&&_0x7017c8[_0xd2fe('0x15')]){logger[_0xd2fe('0xc')](util[_0xd2fe('0x12')]('[%s]\x20%s',_0x7017c8[_0xd2fe('0x14')],_0x7017c8[_0xd2fe('0x15')]));}else{logger[_0xd2fe('0xc')](util['format']('[ERROR]\x20%s',_0x7017c8['stack']));}}function closeHandler(){logger[_0xd2fe('0x11')](util['format'](_0xd2fe('0x16'),this[_0xd2fe('0x17')],this[_0xd2fe('0x18')],this[_0xd2fe('0x19')],this[_0xd2fe('0x1a')],this[_0xd2fe('0x1b')]));try{createSquareReport(this);}catch(_0x588d03){logger['error'](_0x588d03[_0xd2fe('0xd')]);}}function timeoutHandler(){logger[_0xd2fe('0x11')](util['format'](_0xd2fe('0x1c'),this[_0xd2fe('0x17')],this[_0xd2fe('0x18')],this[_0xd2fe('0x19')],this[_0xd2fe('0x1a')],this[_0xd2fe('0x1b')]));}function hangupHandler(){logger[_0xd2fe('0x11')](util[_0xd2fe('0x12')](_0xd2fe('0x1d'),this[_0xd2fe('0x17')],this['calleridname'],this[_0xd2fe('0x19')],this['dnid'],this[_0xd2fe('0x1b')]));this[_0xd2fe('0x1e')]=!![];}function getRoot(_0x123187){return parser[_0xd2fe('0x1f')](_0x123187,{'object':!![]})['mxGraphModel'][_0xd2fe('0x20')];}function addVertex(_0x574e6d,_0x39e7c,_0x39948a){_0x39e7c[_0xd2fe('0x21')]=_0x39948a;if(_0x39e7c['hasOwnProperty']('retry')){_0x39e7c[_0xd2fe('0x22')]=parseInt(_0x39e7c[_0xd2fe('0x23')],0xa);}_0x574e6d[_0xd2fe('0x24')](_[_0xd2fe('0x25')](_0x39e7c,_0xd2fe('0x26')));}function initGraph(_0x48f7ff,_0x487f8a){var _0x516340=new Graph();for(var _0x39e20a in _0x48f7ff){if(_0x48f7ff[_0xd2fe('0x27')](_0x39e20a)){if(_[_0xd2fe('0x28')](_0x48f7ff[_0x39e20a])){for(var _0x15d5bc=0x0;_0x15d5bc<_0x48f7ff[_0x39e20a]['length'];_0x15d5bc+=0x1){addVertex(_0x516340,_0x48f7ff[_0x39e20a][_0x15d5bc],_0x39e20a);}}else{addVertex(_0x516340,_0x48f7ff[_0x39e20a],_0x39e20a);}}}for(var _0x23682c=0x0;_0x23682c<_0x487f8a[_0xd2fe('0x29')];_0x23682c+=0x1){if(_0x487f8a[_0x23682c][_0xd2fe('0x2a')]&&_0x487f8a[_0x23682c][_0xd2fe('0x2b')]){_0x516340['addEdge'](_0x487f8a[_0x23682c][_0xd2fe('0x2a')],_0x487f8a[_0x23682c][_0xd2fe('0x2b')],_0x487f8a[_0x23682c][_0xd2fe('0x2c')]);}}return _0x516340;}function getSquareProject(_0x5a0ba4,_0x343a8b){rpc[_0xd2fe('0x2d')](_0x5a0ba4)[_0xd2fe('0x2e')](function(_0x21f2ac){_0x343a8b(null,_0x21f2ac);})['catch'](function(_0x1aebce){_0x343a8b(null,_0x1aebce);});}function createSquareReport(_0x328089,_0x11bea2){rpc[_0xd2fe('0x2f')](_0x328089)['then'](function(_0x36d50a){if(_0x11bea2){_0x11bea2(null,_0x36d50a);}})[_0xd2fe('0x30')](function(_0x1b4812){if(_0x11bea2){_0x11bea2(null,_0x1b4812);}});}function setChannelVariables(_0x425d1f){for(var _0x42c7b2 in _0x425d1f){if(_0x425d1f[_0xd2fe('0x27')](_0x42c7b2)){if(_0x42c7b2['indexOf'](_0xd2fe('0x31'))===0x0){_0x425d1f[_0x42c7b2[_0xd2fe('0x32')](0x4)]=_0x425d1f[_0x42c7b2];delete _0x425d1f[_0x42c7b2];}}}}function getLogFromObject(_0x56d8d7){return util[_0xd2fe('0x33')](_0x56d8d7,{'showHidden':![],'depth':null});}function agiHandler(_0x22fce7){var _0x29c5d1,_0x51cfa4,_0x4523e6,_0x13f01a,_0x53409a;logger[_0xd2fe('0x34')](_0xd2fe('0x35'),JSON[_0xd2fe('0x36')](_0x22fce7,null,0x2));logger[_0xd2fe('0x11')](util[_0xd2fe('0x12')](_0xd2fe('0x37'),_0x22fce7['arg_1'],_0x22fce7['calleridname'],_0x22fce7[_0xd2fe('0x19')],_0x22fce7['dnid'],_0x22fce7['uniqueid']));_0x22fce7['on'](_0xd2fe('0xc'),errorHandler);_0x22fce7['on'](_0xd2fe('0x38'),closeHandler);_0x22fce7['on'](_0xd2fe('0x39'),timeoutHandler);_0x22fce7[_0xd2fe('0x1e')]=![];_0x22fce7['on'](_0xd2fe('0x3a'),hangupHandler);var _0x4e0b4d=getSquareProject[_0xd2fe('0x3b')](null,_0x22fce7['arg_1']);if(_0x4e0b4d){if(_0x4e0b4d['production']){_0x29c5d1=getRoot(_0x4e0b4d[_0xd2fe('0x3c')]);if(_0x29c5d1&&_0x29c5d1[_0xd2fe('0x3d')]){logger[_0xd2fe('0x34')](_0xd2fe('0x20'),JSON[_0xd2fe('0x36')](_0x29c5d1,null,0x2));_0x22fce7[_0xd2fe('0x3e')]=moment()[_0xd2fe('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x51cfa4=initGraph(_[_0xd2fe('0x25')](_0x29c5d1,_0xd2fe('0x26')),_0x29c5d1[_0xd2fe('0x26')]);_0x4523e6=new Vertices(_0x22fce7,rpc,mailRpc);logger['info'](util['format'](_0xd2fe('0x3f'),_0x22fce7[_0xd2fe('0x17')],_0x22fce7[_0xd2fe('0x18')],_0x22fce7[_0xd2fe('0x19')],_0x22fce7[_0xd2fe('0x1a')],_0x22fce7[_0xd2fe('0x1b')]));_0x51cfa4[_0xd2fe('0x40')](_0x29c5d1['start']['id'],function(_0x2eb74f){try{_0x2eb74f=_0x4523e6[_0xd2fe('0x41')](_0x2eb74f);logger['debug'](_0xd2fe('0x42'),JSON[_0xd2fe('0x36')](_0x2eb74f,null,0x2));if(_0x2eb74f[_0xd2fe('0x21')]===_0xd2fe('0x43')){logger['info'](_0xd2fe('0x44'));_0x22fce7[_0xd2fe('0x45')]=_0x2eb74f[_0xd2fe('0x45')]||_0x22fce7[_0xd2fe('0x45')];_0x22fce7['extension']=_0x2eb74f[_0xd2fe('0x46')];_0x22fce7[_0xd2fe('0x47')]=_0x2eb74f[_0xd2fe('0x47')]?_0x2eb74f['priority']-0x1:0x1;return null;}else if(_0x2eb74f&&_0x4523e6[_0x2eb74f[_0xd2fe('0x21')]]){_0x53409a=_0x4523e6[_0x2eb74f[_0xd2fe('0x21')]](_0x2eb74f);logger[_0xd2fe('0x11')]('response',JSON[_0xd2fe('0x36')](_0x53409a,null,0x2));if(_0x53409a&&_0x53409a[_0xd2fe('0x48')]===AGI_CODE_SUCCESS&&_0x53409a['result']!==AGI_RESULT_ERROR&&!_0x22fce7['evtHangup']){logger['debug'](_0xd2fe('0x49'),getLogFromObject(_0x53409a));return _[_0xd2fe('0x4a')](_0x53409a['result'])?null:_0x53409a[_0xd2fe('0x4b')][_0xd2fe('0x4c')]();}else{logger[_0xd2fe('0xc')]('response',getLogFromObject(_0x53409a));return null;}}else{logger[_0xd2fe('0xc')](_0xd2fe('0x4d'));return null;}}catch(_0xe9791d){logger[_0xd2fe('0xc')](_0xe9791d[_0xd2fe('0xd')]);return null;}});if(_0x29c5d1[_0xd2fe('0x4e')]){logger[_0xd2fe('0x11')](util['format'](_0xd2fe('0x4f'),_0x22fce7[_0xd2fe('0x17')],_0x22fce7[_0xd2fe('0x18')],_0x22fce7[_0xd2fe('0x19')],_0x22fce7[_0xd2fe('0x1a')],_0x22fce7['uniqueid']));_0x51cfa4['traverseBFS'](_0x29c5d1[_0xd2fe('0x4e')]['id'],function(_0x3776cb){try{_0x3776cb=_0x4523e6[_0xd2fe('0x41')](_0x3776cb);logger['debug']('vertex',JSON[_0xd2fe('0x36')](_0x3776cb,null,0x2));if(_0x3776cb&&_0x4523e6[_0x3776cb[_0xd2fe('0x21')]]){_0x53409a=_0x4523e6[_0x3776cb[_0xd2fe('0x21')]](_0x3776cb);if(_0x53409a){logger[_0xd2fe('0x34')](_0xd2fe('0x49'),getLogFromObject(_0x53409a));return _[_0xd2fe('0x4a')](_0x53409a[_0xd2fe('0x4b')])?null:_0x53409a[_0xd2fe('0x4b')][_0xd2fe('0x4c')]();}else{logger[_0xd2fe('0xc')](_0xd2fe('0x49'),getLogFromObject(_0x53409a));return null;}}else{logger['error'](_0xd2fe('0x4d'));return null;}}catch(_0x18c099){logger[_0xd2fe('0xc')](_0x18c099['stack']);return null;}});}logger[_0xd2fe('0x11')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x22fce7[_0xd2fe('0x17')],_0x22fce7['calleridname'],_0x22fce7[_0xd2fe('0x19')],_0x22fce7['dnid'],_0x22fce7[_0xd2fe('0x1b')]));logger['info'](util[_0xd2fe('0x12')](_0xd2fe('0x50'),_0x22fce7['context'],_0x22fce7['extension'],parseInt(_0x22fce7[_0xd2fe('0x47')],0xa)+0x1));_0x22fce7[_0xd2fe('0x51')](_0x22fce7['context'],_0x22fce7[_0xd2fe('0x46')],parseInt(_0x22fce7[_0xd2fe('0x47')],0xa)+0x1);_0x22fce7[_0xd2fe('0x38')]();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20published',_0x22fce7[_0xd2fe('0x17')]));_0x22fce7['continueAt'](_0x22fce7[_0xd2fe('0x45')],_0x22fce7[_0xd2fe('0x46')],parseInt(_0x22fce7[_0xd2fe('0x47')],0xa)+0x1);_0x22fce7[_0xd2fe('0x38')]();}}else{logger[_0xd2fe('0xc')](util['format'](_0xd2fe('0x52'),_0x22fce7[_0xd2fe('0x17')]));_0x22fce7['continueAt'](_0x22fce7[_0xd2fe('0x45')],_0x22fce7[_0xd2fe('0x46')],parseInt(_0x22fce7['priority'],0xa)+0x1);_0x22fce7[_0xd2fe('0x38')]();}}function main(){var _0x2510d4;return utilLicense[_0xd2fe('0x53')]()[_0xd2fe('0x2e')](function(_0x49608a){if(_0x49608a){if(_0x49608a['voice']){if(_0x49608a[_0xd2fe('0x54')]&&_0x49608a[_0xd2fe('0x54')]>0x0){logger[_0xd2fe('0x11')](util['format'](_0xd2fe('0x55'),_0x49608a['callysquare']));_0x2510d4=_0x49608a[_0xd2fe('0x54')];}else{logger['info'](_0xd2fe('0x56'));}}else{logger['info'](_0xd2fe('0x57'));_0x2510d4=-0x1;}}})[_0xd2fe('0x30')](function(_0x46d41c){logger['error'](_0xd2fe('0x58'),_0x46d41c['stack']);})[_0xd2fe('0x4e')](function(){var _0x28737c=require(_0xd2fe('0x59'))(config[_0xd2fe('0x6')]['port'],config[_0xd2fe('0x6')]['ip'],_0x2510d4);_0x28737c['on']('error',errorHandler);_0x28737c['on'](_0xd2fe('0x5a'),listeningHandler);_0x28737c['on'](_0xd2fe('0x5b'),connectionHandler);_0x28737c['on'](_0xd2fe('0x38'),closeHandler);});}main();
\ No newline at end of file
index 7446c37..7ff80ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x2b86f0,_0xa5917b){var _0x4ce94d=function(_0x3af46c){while(--_0x3af46c){_0x2b86f0['push'](_0x2b86f0['shift']());}};_0x4ce94d(++_0xa5917b);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x19aec3,_0x55563a){var _0x10448f=function(_0x3959c5){while(--_0x3959c5){_0x19aec3['push'](_0x19aec3['shift']());}};_0x10448f(++_0x55563a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
index bd9a49f..a51bf18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xb10b,0x12a));var _0xbb10=function(_0x521e8d,_0x23a290){_0x521e8d=_0x521e8d-0x0;var _0x518bbd=_0xb10b[_0x521e8d];return _0x518bbd;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply;
\ No newline at end of file
+var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x18eb0b,_0x11077e){var _0x1ddc58=function(_0x42dffa){while(--_0x42dffa){_0x18eb0b['push'](_0x18eb0b['shift']());}};_0x1ddc58(++_0x11077e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c679b,_0x55d115){_0x2c679b=_0x2c679b-0x0;var _0x56da85=_0x5f2f[_0x2c679b];return _0x56da85;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply;
\ No newline at end of file
index e683c59..e408f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2af=['getSoundById','ShowSound','save_name','Interval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','LogoutUser','bluebird','moment','lodash','util','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk'];(function(_0x2f0798,_0x1f748c){var _0x53585a=function(_0xe620ff){while(--_0xe620ff){_0x2f0798['push'](_0x2f0798['shift']());}};_0x53585a(++_0x1f748c);}(_0xb2af,0xd2));var _0xfb2a=function(_0x43dddc,_0x425b1e){_0x43dddc=_0x43dddc-0x0;var _0x296404=_0xb2af[_0x43dddc];return _0x296404;};'use strict';var BPromise=require(_0xfb2a('0x0'));var moment=require(_0xfb2a('0x1'));var _=require(_0xfb2a('0x2'));var util=require(_0xfb2a('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xfb2a('0x4')][_0xfb2a('0x5')]({'port':0x2329});function request(_0x5aed73,_0x856b1){return new BPromise(function(_0xd63d49,_0x5b7553){return client[_0xfb2a('0x6')](_0x5aed73,_0x856b1)[_0xfb2a('0x7')](function(_0xb1be3f){if(_0xb1be3f['error']){return _0x5b7553(_0xb1be3f[_0xfb2a('0x8')][_0xfb2a('0x9')]);}else{return _0xd63d49(_0xb1be3f[_0xfb2a('0xa')]);}})[_0xfb2a('0xb')](function(_0x2c529e){return _0x5b7553(_0x2c529e);});});}exports[_0xfb2a('0xc')]=function(_0x3d3333){return request(_0xfb2a('0xd'),{'options':{'raw':![],'where':{'name':_0x3d3333},'attributes':[_0xfb2a('0xe')]}});};exports[_0xfb2a('0xf')]=function(_0x2f4f0e){return request(_0xfb2a('0x10'),{'options':{'raw':![],'where':{'id':_0x2f4f0e},'include':[{'model':_0xfb2a('0x11'),'as':_0xfb2a('0x12')}],'attributes':['id',_0xfb2a('0x13'),_0xfb2a('0x14')]}});};exports['getSquareProjectById']=function(_0x4dad44){return request('ShowSquareProject',{'options':{'where':{'id':_0x4dad44},'attributes':[_0xfb2a('0x13')]}});};exports[_0xfb2a('0x15')]=function(_0x422f6f){return request(_0xfb2a('0x16'),{'options':{'where':{'id':_0x422f6f},'attributes':['name']}});};exports[_0xfb2a('0x17')]=function(_0x5b8a45){return request('ShowVariable',{'options':{'where':{'id':_0x5b8a45},'attributes':[_0xfb2a('0x13')]}});};exports['getSquareOdbcById']=function(_0x55ab68){return request(_0xfb2a('0x18'),{'options':{'where':{'id':_0x55ab68},'attributes':[_0xfb2a('0x19')]}});};exports[_0xfb2a('0x1a')]=function(_0x193af1){return request(_0xfb2a('0x1b'),{'options':{'where':{'id':_0x193af1},'attributes':[_0xfb2a('0x13')]}});};exports[_0xfb2a('0x1c')]=function(_0x214051){return request(_0xfb2a('0x1d'),{'options':{'where':{'id':_0x214051},'attributes':['name']}});};exports[_0xfb2a('0x1e')]=function(_0xb5ff5c){return request(_0xfb2a('0x1f'),{'options':{'where':{'id':_0xb5ff5c},'attributes':[_0xfb2a('0x20')]}});};exports['getIntervalById']=function(_0x2644ed){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2644ed},'include':[{'model':_0xfb2a('0x21'),'as':_0xfb2a('0x22')}]}});};exports[_0xfb2a('0x23')]=function(_0x593291){return request('ShowSmsAccount',{'options':{'where':{'id':_0x593291},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x16671c){return request(_0xfb2a('0x24'),{'body':_0x16671c});};exports[_0xfb2a('0x25')]=function(_0x3145d3){return request(_0xfb2a('0x26'),{'body':_0x3145d3});};exports[_0xfb2a('0x27')]=function(_0x2a9504){return request(_0xfb2a('0x28'),{'body':_[_0xfb2a('0x29')](_0x2a9504,{'project_name':_0x2a9504[_0xfb2a('0x2a')],'prev_project_name':_0x2a9504['arg_2']||'','is_subproject':_0x2a9504[_0xfb2a('0x2b')]?!![]:![],'leaveAt':moment()['format'](_0xfb2a('0x2c'))})});};exports[_0xfb2a('0x2d')]=function(_0x5726b3){return request(_0xfb2a('0x2e'),{'body':_0x5726b3});};exports[_0xfb2a('0x2f')]=function(_0x4eb16e){return request(_0xfb2a('0x30'),{'body':_0x4eb16e});};exports[_0xfb2a('0x31')]=function(_0x4cdb14){return request(_0xfb2a('0x32'),{'options':{'raw':![],'where':{'phone':_0x4cdb14[_0xfb2a('0x33')],'ListId':_0x4cdb14[_0xfb2a('0x34')]}}})[_0xfb2a('0x7')](function(_0x3f9190){if(_0x3f9190){return _0x3f9190;}return request(_0xfb2a('0x35'),{'body':_0x4cdb14});});};exports[_0xfb2a('0x36')]=function(_0x3f3da3){return request(_0xfb2a('0x37'),{'options':{'where':{'id':_0x3f3da3},'attributes':[_0xfb2a('0x13')]}});};exports['agentLogin']=function(_0xbbf3b4,_0x3a4861){return request(_0xfb2a('0x38'),{'body':{'interface':_0x3a4861},'options':{'where':_0xbbf3b4}});};exports[_0xfb2a('0x39')]=function(_0x34d2b3,_0xe1a1cf,_0x2cecb){return request(_0xfb2a('0x3a'),{'body':{'type':_0xe1a1cf,'uniqueid':_0x2cecb},'options':{'where':_0x34d2b3}});};exports['agentUnpause']=function(_0x225e04){return request('UnpauseUser',{'body':{},'options':{'where':_0x225e04}});};exports['agentLogout']=function(_0x1c3551){return request(_0xfb2a('0x3b'),{'body':{},'options':{'where':_0x1c3551}});};
\ No newline at end of file
+var _0x7b04=['error','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','name','email','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','util','jayson/promise','client','request','then'];(function(_0x4c95fa,_0x393cb9){var _0xbaae9a=function(_0x3fd5d6){while(--_0x3fd5d6){_0x4c95fa['push'](_0x4c95fa['shift']());}};_0xbaae9a(++_0x393cb9);}(_0x7b04,0xd5));var _0x47b0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7b04[_0x40a045];return _0x1a687c;};'use strict';var BPromise=require(_0x47b0('0x0'));var moment=require('moment');var _=require(_0x47b0('0x1'));var util=require(_0x47b0('0x2'));var jayson=require(_0x47b0('0x3'));var client=jayson[_0x47b0('0x4')]['http']({'port':0x2329});function request(_0x9d2400,_0x230a07){return new BPromise(function(_0x3b499f,_0x4133b9){return client[_0x47b0('0x5')](_0x9d2400,_0x230a07)[_0x47b0('0x6')](function(_0x2751d4){if(_0x2751d4['error']){return _0x4133b9(_0x2751d4[_0x47b0('0x7')]['message']);}else{return _0x3b499f(_0x2751d4['result']);}})[_0x47b0('0x8')](function(_0xf6dd26){return _0x4133b9(_0xf6dd26);});});}exports[_0x47b0('0x9')]=function(_0x4b0936){return request(_0x47b0('0xa'),{'options':{'raw':![],'where':{'name':_0x4b0936},'attributes':[_0x47b0('0xb')]}});};exports[_0x47b0('0xc')]=function(_0x5066d2){return request(_0x47b0('0xd'),{'options':{'raw':![],'where':{'id':_0x5066d2},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x47b0('0xe'),_0x47b0('0xf')]}});};exports['getSquareProjectById']=function(_0x406e54){return request('ShowSquareProject',{'options':{'where':{'id':_0x406e54},'attributes':['name']}});};exports[_0x47b0('0x10')]=function(_0x47bfcb){return request(_0x47b0('0x11'),{'options':{'where':{'id':_0x47bfcb},'attributes':[_0x47b0('0xe')]}});};exports['getVariableById']=function(_0x503e3f){return request(_0x47b0('0x12'),{'options':{'where':{'id':_0x503e3f},'attributes':[_0x47b0('0xe')]}});};exports[_0x47b0('0x13')]=function(_0x5bcf24){return request(_0x47b0('0x14'),{'options':{'where':{'id':_0x5bcf24},'attributes':['dsn']}});};exports[_0x47b0('0x15')]=function(_0x39bfec){return request('ShowUser',{'options':{'where':{'id':_0x39bfec},'attributes':[_0x47b0('0xe')]}});};exports[_0x47b0('0x16')]=function(_0x495b95){return request(_0x47b0('0x17'),{'options':{'where':{'id':_0x495b95},'attributes':[_0x47b0('0xe')]}});};exports[_0x47b0('0x18')]=function(_0x39e2dd){return request('ShowSound',{'options':{'where':{'id':_0x39e2dd},'attributes':[_0x47b0('0x19')]}});};exports[_0x47b0('0x1a')]=function(_0x15f30c){return request(_0x47b0('0x1b'),{'options':{'raw':![],'where':{'id':_0x15f30c},'include':[{'model':_0x47b0('0x1c'),'as':_0x47b0('0x1d')}]}});};exports[_0x47b0('0x1e')]=function(_0xf9eec9){return request(_0x47b0('0x1f'),{'options':{'where':{'id':_0xf9eec9},'attributes':['id',_0x47b0('0xe')]}});};exports[_0x47b0('0x20')]=function(_0x4b756a){return request('CreateSmsMessage',{'body':_0x4b756a});};exports['createSquareDetailsReport']=function(_0x15ae10){return request(_0x47b0('0x21'),{'body':_0x15ae10});};exports[_0x47b0('0x22')]=function(_0x1e4dbf){return request('CreateSquareReport',{'body':_[_0x47b0('0x23')](_0x1e4dbf,{'project_name':_0x1e4dbf[_0x47b0('0x24')],'prev_project_name':_0x1e4dbf['arg_2']||'','is_subproject':_0x1e4dbf[_0x47b0('0x25')]?!![]:![],'leaveAt':moment()[_0x47b0('0x26')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x47b0('0x27')]=function(_0x5a132c){return request(_0x47b0('0x28'),{'body':_0x5a132c});};exports[_0x47b0('0x29')]=function(_0x4f13fd){return request(_0x47b0('0x2a'),{'body':_0x4f13fd});};exports[_0x47b0('0x2b')]=function(_0x2f75d0){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x2f75d0[_0x47b0('0x2c')],'ListId':_0x2f75d0[_0x47b0('0x2d')]}}})[_0x47b0('0x6')](function(_0x98e918){if(_0x98e918){return _0x98e918;}return request(_0x47b0('0x2e'),{'body':_0x2f75d0});});};exports['getPauseById']=function(_0x2bb6e1){return request(_0x47b0('0x2f'),{'options':{'where':{'id':_0x2bb6e1},'attributes':['name']}});};exports['agentLogin']=function(_0x4b6657,_0x440292){return request(_0x47b0('0x30'),{'body':{'interface':_0x440292},'options':{'where':_0x4b6657}});};exports[_0x47b0('0x31')]=function(_0x5133da,_0x462a44,_0x200994){return request(_0x47b0('0x32'),{'body':{'type':_0x462a44,'uniqueid':_0x200994},'options':{'where':_0x5133da}});};exports[_0x47b0('0x33')]=function(_0x188d3a){return request(_0x47b0('0x34'),{'body':{},'options':{'where':_0x188d3a}});};exports[_0x47b0('0x35')]=function(_0x2eb4c1){return request(_0x47b0('0x36'),{'body':{},'options':{'where':_0x2eb4c1}});};
\ No newline at end of file
index 887d068..282bd7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8dd=['./polly','./lex'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0xd8dd,0xf0));var _0xdd8d=function(_0x50a1f4,_0x27fec6){_0x50a1f4=_0x50a1f4-0x0;var _0xa9555a=_0xd8dd[_0x50a1f4];return _0xa9555a;};var polly=require(_0xdd8d('0x0'));var lex=require(_0xdd8d('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x3271=['exports','./polly'];(function(_0xc930ac,_0x25f008){var _0x2fafae=function(_0x39e532){while(--_0x39e532){_0xc930ac['push'](_0xc930ac['shift']());}};_0x2fafae(++_0x25f008);}(_0x3271,0xbd));var _0x1327=function(_0x1f8f7f,_0x46e316){_0x1f8f7f=_0x1f8f7f-0x0;var _0x33784a=_0x3271[_0x1f8f7f];return _0x33784a;};var polly=require(_0x1327('0x0'));var lex=require('./lex');module[_0x1327('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 524a6f0..5feb36a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var lex=require('./lib/api');module['exports']=function(_0x412fb1,_0x5ba407,_0x2b8a76,_0x2a0b30,_0x24f912,_0x1bf88c){return lex(_0x412fb1,_0x5ba407,_0x2b8a76,_0x2a0b30,_0x24f912,_0x1bf88c);};
\ No newline at end of file
+var _0x180f=['exports','./lib/api'];(function(_0x349ed1,_0x1d18b0){var _0x51cdf8=function(_0x3d09aa){while(--_0x3d09aa){_0x349ed1['push'](_0x349ed1['shift']());}};_0x51cdf8(++_0x1d18b0);}(_0x180f,0xf3));var _0xf180=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0x180f[_0x183256];return _0x5394a2;};'use strict';var lex=require(_0xf180('0x0'));module[_0xf180('0x1')]=function(_0x49bb6e,_0x43cae2,_0x3cc668,_0x5ca18d,_0x1bd2a7,_0x12cfa8){return lex(_0x49bb6e,_0x43cae2,_0x3cc668,_0x5ca18d,_0x1bd2a7,_0x12cfa8);};
\ No newline at end of file
index da6e80a..4239070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18a8=['$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','LexRuntime'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x18a8,0x71));var _0x818a=function(_0x5bb233,_0x35363e){_0x5bb233=_0x5bb233-0x0;var _0x4df1f7=_0x18a8[_0x5bb233];return _0x4df1f7;};'use strict';var BPromise=require(_0x818a('0x0'));var AWS=require(_0x818a('0x1'));function lexResult(_0x52b0a9,_0x4a5897){return new BPromise(function(_0x6f46db,_0x2c6da1){_0x52b0a9[_0x818a('0x2')](_0x4a5897,function(_0x231bd7,_0x40c104){if(_0x231bd7){_0x2c6da1(_0x231bd7);}if(_0x40c104['slots']){for(const _0x6fc7b8 in _0x40c104[_0x818a('0x3')]){if(_0x40c104[_0x818a('0x3')][_0x818a('0x4')](_0x6fc7b8)){var _0x26695a=_0x40c104[_0x818a('0x3')][_0x6fc7b8];_0x40c104[_0x818a('0x5')+_0x6fc7b8]=_0x26695a;}}}_0x6f46db(_0x40c104);});});}module['exports']=function(_0x1049f8,_0x4b3ff9,_0x411774,_0x2aebca,_0x20d797,_0x481dad){var _0x390458=new AWS[(_0x818a('0x6'))]({'accessKeyId':_0x4b3ff9,'secretAccessKey':_0x411774,'region':_0x2aebca});var _0x4418b9={'botAlias':_0x818a('0x7'),'botName':_0x481dad,'inputText':_0x20d797,'userId':_0x1049f8};return lexResult(_0x390458,_0x4418b9);};
\ No newline at end of file
+var _0x3094=['slot_','exports','LexRuntime','$LATEST','aws-sdk','postText','slots'];(function(_0x141aa1,_0x20b605){var _0xae04d8=function(_0x11a0cd){while(--_0x11a0cd){_0x141aa1['push'](_0x141aa1['shift']());}};_0xae04d8(++_0x20b605);}(_0x3094,0x162));var _0x4309=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3094[_0x167cc1];return _0x10bc4b;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x4309('0x0'));function lexResult(_0x1fff24,_0x2791de){return new BPromise(function(_0x34e30b,_0x5da54b){_0x1fff24[_0x4309('0x1')](_0x2791de,function(_0x139f7c,_0x296751){if(_0x139f7c){_0x5da54b(_0x139f7c);}if(_0x296751[_0x4309('0x2')]){for(const _0x521bc0 in _0x296751[_0x4309('0x2')]){if(_0x296751[_0x4309('0x2')]['hasOwnProperty'](_0x521bc0)){var _0xb7d76f=_0x296751[_0x4309('0x2')][_0x521bc0];_0x296751[_0x4309('0x3')+_0x521bc0]=_0xb7d76f;}}}_0x34e30b(_0x296751);});});}module[_0x4309('0x4')]=function(_0x4888c0,_0x4630ad,_0x485a10,_0x26dee8,_0x30d23b,_0x2722ef){var _0x12e864=new AWS[(_0x4309('0x5'))]({'accessKeyId':_0x4630ad,'secretAccessKey':_0x485a10,'region':_0x26dee8});var _0x58d115={'botAlias':_0x4309('0x6'),'botName':_0x2722ef,'inputText':_0x30d23b,'userId':_0x4888c0};return lexResult(_0x12e864,_0x58d115);};
\ No newline at end of file
index ed82770..04a26c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x692a=['./lib/api'];(function(_0x54706c,_0x4191b3){var _0x2a89f7=function(_0x233435){while(--_0x233435){_0x54706c['push'](_0x54706c['shift']());}};_0x2a89f7(++_0x4191b3);}(_0x692a,0x15b));var _0xa692=function(_0xf0a04b,_0x4d3070){_0xf0a04b=_0xf0a04b-0x0;var _0x4ca916=_0x692a[_0xf0a04b];return _0x4ca916;};'use strict';var polly=require(_0xa692('0x0'));module['exports']=function(_0x195996,_0x4898ff,_0x3d8266,_0x2b9d75,_0x13db3f,_0x1e39bd,_0x374747){return polly(_0x195996,_0x4898ff,_0x3d8266,_0x2b9d75,_0x13db3f,_0x1e39bd,_0x374747);};
\ No newline at end of file
+var _0xfa24=['./lib/api','exports'];(function(_0x8028fa,_0x473815){var _0x2a8c36=function(_0x3c18d8){while(--_0x3c18d8){_0x8028fa['push'](_0x8028fa['shift']());}};_0x2a8c36(++_0x473815);}(_0xfa24,0x17c));var _0x4fa2=function(_0x4aba15,_0x4e90aa){_0x4aba15=_0x4aba15-0x0;var _0x1c8122=_0xfa24[_0x4aba15];return _0x1c8122;};'use strict';var polly=require(_0x4fa2('0x0'));module[_0x4fa2('0x1')]=function(_0x33ff24,_0x345354,_0x496921,_0xa986b6,_0x4479f3,_0x48459f,_0x4938f4){return polly(_0x33ff24,_0x345354,_0x496921,_0xa986b6,_0x4479f3,_0x48459f,_0x4938f4);};
\ No newline at end of file
index 48fcddf..b78887b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb75c=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x337b7a,_0x2666e0){var _0x22cf27=function(_0x6608c7){while(--_0x6608c7){_0x337b7a['push'](_0x337b7a['shift']());}};_0x22cf27(++_0x2666e0);}(_0xb75c,0x1de));var _0xcb75=function(_0x57ae9a,_0xa0c20b){_0x57ae9a=_0x57ae9a-0x0;var _0x32ec44=_0xb75c[_0x57ae9a];return _0x32ec44;};'use strict';var fs=require('fs');var path=require(_0xcb75('0x0'));var BPromise=require(_0xcb75('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x27dcc9,_0x37d254,_0x5a4017){return new BPromise(function(_0x18148e,_0x230673){_0x27dcc9[_0xcb75('0x2')](_0x37d254,function(_0x3c6b46,_0xd320e0){if(_0x3c6b46){_0x230673(_0x3c6b46);}else if(_0xd320e0){if(_0xd320e0[_0xcb75('0x3')]instanceof Buffer){fs[_0xcb75('0x4')](_0x5a4017,_0xd320e0[_0xcb75('0x3')],function(_0x5aeecc){if(_0x5aeecc){_0x230673(_0x5aeecc);}else{_0x18148e();}});}else{_0x230673(new Error(_0xcb75('0x5')));}}else{_0x230673(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xcb75('0x6')]=function(_0xddd128,_0x34503e,_0x4ca0e0,_0x49dc76,_0x35f60e,_0x539e3e,_0x1b6b40){var _0x5582e2=new AWS[(_0xcb75('0x7'))]({'accessKeyId':_0xddd128,'secretAccessKey':_0x34503e,'region':_0x4ca0e0});var _0x4add38={'Text':_0x35f60e,'TextType':_0x539e3e||_0xcb75('0x8'),'OutputFormat':_0xcb75('0x9'),'VoiceId':_0x49dc76};return pollyResult(_0x5582e2,_0x4add38,_0x1b6b40);};
\ No newline at end of file
+var _0xe4e2=['bluebird','randomstring','aws-sdk','AudioStream','exports','text','mp3','path'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xe4e2,0x17f));var _0x2e4e=function(_0x17a842,_0x1ac67a){_0x17a842=_0x17a842-0x0;var _0x142199=_0xe4e2[_0x17a842];return _0x142199;};'use strict';var fs=require('fs');var path=require(_0x2e4e('0x0'));var BPromise=require(_0x2e4e('0x1'));var rs=require(_0x2e4e('0x2'));var AWS=require(_0x2e4e('0x3'));function pollyResult(_0x1ba5c2,_0xca7d72,_0x456bfb){return new BPromise(function(_0x3fb13e,_0x4c267d){_0x1ba5c2['synthesizeSpeech'](_0xca7d72,function(_0x1c8ac8,_0x3b89e4){if(_0x1c8ac8){_0x4c267d(_0x1c8ac8);}else if(_0x3b89e4){if(_0x3b89e4[_0x2e4e('0x4')]instanceof Buffer){fs['writeFile'](_0x456bfb,_0x3b89e4[_0x2e4e('0x4')],function(_0x463d63){if(_0x463d63){_0x4c267d(_0x463d63);}else{_0x3fb13e();}});}else{_0x4c267d(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4c267d(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x2e4e('0x5')]=function(_0x4e633f,_0x1d6e9c,_0x5bfc36,_0x5b9869,_0x429b4f,_0x2240dd,_0x4a6363){var _0x8e1ef1=new AWS['Polly']({'accessKeyId':_0x4e633f,'secretAccessKey':_0x1d6e9c,'region':_0x5bfc36});var _0x40e717={'Text':_0x429b4f,'TextType':_0x2240dd||_0x2e4e('0x6'),'OutputFormat':_0x2e4e('0x7'),'VoiceId':_0x5b9869};return pollyResult(_0x8e1ef1,_0x40e717,_0x4a6363);};
\ No newline at end of file
index c1f838b..5ec1a10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee0=['exports'];(function(_0x27c63e,_0x3ca7d4){var _0x403919=function(_0x569ca8){while(--_0x569ca8){_0x27c63e['push'](_0x27c63e['shift']());}};_0x403919(++_0x3ca7d4);}(_0xbee0,0x147));var _0x0bee=function(_0x2f8b2a,_0x49b531){_0x2f8b2a=_0x2f8b2a-0x0;var _0x235505=_0xbee0[_0x2f8b2a];return _0x235505;};'use strict';var asr=require('./lib/api');module[_0x0bee('0x0')]=function(_0x258133,_0x34531f,_0x37fcf4,_0x1e68ef){return asr(_0x258133,_0x34531f,_0x37fcf4);};
\ No newline at end of file
+var _0x55f1=['./lib/api'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x55f1,0x9b));var _0x155f=function(_0x17fb4d,_0x1c5e82){_0x17fb4d=_0x17fb4d-0x0;var _0xb86c9d=_0x55f1[_0x17fb4d];return _0xb86c9d;};'use strict';var asr=require(_0x155f('0x0'));module['exports']=function(_0x9fa58a,_0x476580,_0x2892cb,_0x2d4aab){return asr(_0x9fa58a,_0x476580,_0x2892cb);};
\ No newline at end of file
index 044e128..4f48283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aed=['readFileSync','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x7aed,0xc9));var _0xd7ae=function(_0x46c0e2,_0x431822){_0x46c0e2=_0x46c0e2-0x0;var _0x5ab592=_0x7aed[_0x46c0e2];return _0x5ab592;};'use strict';var url=require(_0xd7ae('0x0'));var BPromise=require(_0xd7ae('0x1'));var fs=require('fs');var host=_0xd7ae('0x2');module['exports']=function(_0x424d2d,_0x5b2255,_0x246335){return new BPromise(function(_0x41d19c,_0xc0b866){var _0x186870;if(typeof _0x424d2d!==_0xd7ae('0x3')||_0x424d2d['length']===0x0){return _0xc0b866('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x5b2255!==_0xd7ae('0x3')||_0x5b2255[_0xd7ae('0x4')]===0x0){return _0xc0b866(_0xd7ae('0x5'));}if(typeof _0x246335!==_0xd7ae('0x6')&&(typeof _0x246335!=='string'||_0x246335[_0xd7ae('0x4')]===0x0)){return _0xc0b866(_0xd7ae('0x7'));}try{_0x186870=fs[_0xd7ae('0x8')](_0x424d2d)['toString']('base64');}catch(_0x29240e){return _0xc0b866(_0x29240e);}return _0x41d19c({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x5b2255,'body':{'config':{'encoding':_0xd7ae('0x9'),'sampleRateHertz':_0xd7ae('0xa'),'languageCode':_0x246335},'audio':{'content':_0x186870}},'json':!![]});});};
\ No newline at end of file
+var _0xd0a4=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000','url','bluebird','exports','string'];(function(_0x31e817,_0x276690){var _0xdffdd8=function(_0x5271e0){while(--_0x5271e0){_0x31e817['push'](_0x31e817['shift']());}};_0xdffdd8(++_0x276690);}(_0xd0a4,0xbf));var _0x4d0a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd0a4[_0x3b380d];return _0x54502b;};'use strict';var url=require(_0x4d0a('0x0'));var BPromise=require(_0x4d0a('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x4d0a('0x2')]=function(_0x5e4034,_0xdf9597,_0x3ef137){return new BPromise(function(_0x368320,_0x13cb53){var _0x4b605c;if(typeof _0x5e4034!==_0x4d0a('0x3')||_0x5e4034[_0x4d0a('0x4')]===0x0){return _0x13cb53(_0x4d0a('0x5'));}if(typeof _0xdf9597!=='string'||_0xdf9597[_0x4d0a('0x4')]===0x0){return _0x13cb53(_0x4d0a('0x6'));}if(typeof _0x3ef137!=='undefined'&&(typeof _0x3ef137!==_0x4d0a('0x3')||_0x3ef137[_0x4d0a('0x4')]===0x0)){return _0x13cb53('lang\x20should\x20be\x20a\x20string');}try{_0x4b605c=fs[_0x4d0a('0x7')](_0x5e4034)[_0x4d0a('0x8')](_0x4d0a('0x9'));}catch(_0x4c68a4){return _0x13cb53(_0x4c68a4);}return _0x368320({'method':_0x4d0a('0xa'),'uri':host+'/v1/speech:recognize?key='+_0xdf9597,'body':{'config':{'encoding':_0x4d0a('0xb'),'sampleRateHertz':_0x4d0a('0xc'),'languageCode':_0x3ef137},'audio':{'content':_0x4b605c}},'json':!![]});});};
\ No newline at end of file
index 762ee43..cb4f28a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['exports'];(function(_0x5caffa,_0x2e4ccf){var _0x5b78e1=function(_0xfd372d){while(--_0xfd372d){_0x5caffa['push'](_0x5caffa['shift']());}};_0x5b78e1(++_0x2e4ccf);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ad75c,_0x1a8426){_0x1ad75c=_0x1ad75c-0x0;var _0x43052e=_0xedd9[_0x1ad75c];return _0x43052e;};var asr=require('./asr');module[_0x9edd('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x3e74=['./asr'];(function(_0x3000d1,_0x413768){var _0x1a01ec=function(_0x28f64f){while(--_0x28f64f){_0x3000d1['push'](_0x3000d1['shift']());}};_0x1a01ec(++_0x413768);}(_0x3e74,0x175));var _0x43e7=function(_0x1d83ab,_0x10150b){_0x1d83ab=_0x1d83ab-0x0;var _0x313166=_0x3e74[_0x1d83ab];return _0x313166;};var asr=require(_0x43e7('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 5a97526..e5b3bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0xc86616,_0x34ff3d){var _0x1873bd=function(_0x6317f1){while(--_0x6317f1){_0xc86616['push'](_0xc86616['shift']());}};_0x1873bd(++_0x34ff3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;};
\ No newline at end of file
+var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x5b71a2,_0xc22ab5){var _0x1ac69f=function(_0x441f75){while(--_0x441f75){_0x5b71a2['push'](_0x5b71a2['shift']());}};_0x1ac69f(++_0xc22ab5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;};
\ No newline at end of file
index b1b8fca..d67dd09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54f3=['./nda','exports'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x54f3,0xec));var _0x354f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x54f3[_0x199572];return _0x13cfa3;};var nda=require(_0x354f('0x0'));module[_0x354f('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x34f2=['./nda','exports'];(function(_0x274217,_0x4b577b){var _0xee0ebb=function(_0x386f9c){while(--_0x386f9c){_0x274217['push'](_0x274217['shift']());}};_0xee0ebb(++_0x4b577b);}(_0x34f2,0x15a));var _0x234f=function(_0x4981c5,_0x385761){_0x4981c5=_0x4981c5-0x0;var _0x14b73c=_0x34f2[_0x4981c5];return _0x14b73c;};var nda=require(_0x234f('0x0'));module[_0x234f('0x1')]={'nda':nda};
\ No newline at end of file
index 3995828..345be49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x465e=['ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData','info','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname','dnid','extension','Bearer\x20','project','body','channelData','ProjectName'];(function(_0x35505c,_0x4f5d22){var _0x55d0f6=function(_0x77248b){while(--_0x77248b){_0x35505c['push'](_0x35505c['shift']());}};_0x55d0f6(++_0x4f5d22);}(_0x465e,0x10b));var _0xe465=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x465e[_0x2a8c21];return _0x5f3061;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xe465('0x0'))(_0xe465('0x1'));module[_0xe465('0x2')]=function(_0x565032,_0x31fad1){var _0x5345ed={'method':_0xe465('0x3'),'uri':url[_0xe465('0x4')](_0x31fad1[_0xe465('0x5')],_0xe465('0x6')),'form':{'grant_type':_0xe465('0x7'),'username':_0x31fad1[_0xe465('0x8')],'password':_0x31fad1['password']},'json':!![]};return rp(_0x5345ed)[_0xe465('0x9')](function(_0x12a85c){var _0x4b0db5={'method':'POST','uri':url[_0xe465('0x4')](_0x31fad1[_0xe465('0xa')],_0xe465('0xb')),'body':{'type':_0x31fad1[_0xe465('0xc')]||_0xe465('0xd'),'channelId':'Nda','conversation':{'id':_0x565032[_0xe465('0xe')]},'from':{'id':_0x565032['callerid'],'name':_0x565032[_0xe465('0xf')]},'recipient':{'id':_0x565032[_0xe465('0x10')],'name':_0x565032[_0xe465('0x11')]},'text':_0x31fad1['text'],'channelData':{}},'headers':{'Authorization':_0xe465('0x12')+_0x12a85c['access_token']},'json':!![]};if(_0x31fad1[_0xe465('0x13')]){_0x4b0db5[_0xe465('0x14')][_0xe465('0x15')][_0xe465('0x16')]=_0x31fad1[_0xe465('0x13')];}if(_0x31fad1[_0xe465('0x17')]=='1'){_0x4b0db5[_0xe465('0x14')][_0xe465('0x15')][_0xe465('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe465('0x19')};}if(_0x31fad1[_0xe465('0x1a')]){_0x4b0db5['body'][_0xe465('0x15')]['CustomAction']=_0x31fad1[_0xe465('0x1a')];if(_0x31fad1['custom_action_data']){_0x4b0db5['body'][_0xe465('0x15')][_0xe465('0x1b')]=_0x31fad1['custom_action_data'];}}logger[_0xe465('0x1c')](JSON['stringify'](_0x4b0db5));return rp(_0x4b0db5);});};
\ No newline at end of file
+var _0x8b88=['Bearer\x20','access_token','project','channelData','ProjectName','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','resolve','/token','password','then','POST','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','extension'];(function(_0x37d8ae,_0x17e484){var _0x4de500=function(_0x538a36){while(--_0x538a36){_0x37d8ae['push'](_0x37d8ae['shift']());}};_0x4de500(++_0x17e484);}(_0x8b88,0x12f));var _0x88b8=function(_0x4c9b8f,_0x5bb160){_0x4c9b8f=_0x4c9b8f-0x0;var _0x5111ed=_0x8b88[_0x4c9b8f];return _0x5111ed;};'use strict';var rp=require(_0x88b8('0x0'));var url=require(_0x88b8('0x1'));var logger=require(_0x88b8('0x2'))(_0x88b8('0x3'));module['exports']=function(_0x1a8dc8,_0x355078){var _0x46d841={'method':'POST','uri':url[_0x88b8('0x4')](_0x355078['ndauth_url'],_0x88b8('0x5')),'form':{'grant_type':'password','username':_0x355078['username'],'password':_0x355078[_0x88b8('0x6')]},'json':!![]};return rp(_0x46d841)[_0x88b8('0x7')](function(_0x527510){var _0x369739={'method':_0x88b8('0x8'),'uri':url[_0x88b8('0x4')](_0x355078['ndassistant_url'],_0x88b8('0x9')),'body':{'type':_0x355078[_0x88b8('0xa')]||_0x88b8('0xb'),'channelId':'Nda','conversation':{'id':_0x1a8dc8[_0x88b8('0xc')]},'from':{'id':_0x1a8dc8[_0x88b8('0xd')],'name':_0x1a8dc8[_0x88b8('0xe')]},'recipient':{'id':_0x1a8dc8['dnid'],'name':_0x1a8dc8[_0x88b8('0xf')]},'text':_0x355078['text'],'channelData':{}},'headers':{'Authorization':_0x88b8('0x10')+_0x527510[_0x88b8('0x11')]},'json':!![]};if(_0x355078[_0x88b8('0x12')]){_0x369739['body'][_0x88b8('0x13')][_0x88b8('0x14')]=_0x355078['project'];}if(_0x355078['ndagenerate_audio']=='1'){_0x369739[_0x88b8('0x15')][_0x88b8('0x13')][_0x88b8('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x88b8('0x17')};}if(_0x355078[_0x88b8('0x18')]){_0x369739[_0x88b8('0x15')][_0x88b8('0x13')][_0x88b8('0x19')]=_0x355078[_0x88b8('0x18')];if(_0x355078[_0x88b8('0x1a')]){_0x369739[_0x88b8('0x15')]['channelData'][_0x88b8('0x1b')]=_0x355078[_0x88b8('0x1a')];}}logger[_0x88b8('0x1c')](JSON['stringify'](_0x369739));return rp(_0x369739);});};
\ No newline at end of file
index 2726076..29410da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x296f=['./lib/api'];(function(_0x4cf0fc,_0x1c8c52){var _0x3d1466=function(_0x200a84){while(--_0x200a84){_0x4cf0fc['push'](_0x4cf0fc['shift']());}};_0x3d1466(++_0x1c8c52);}(_0x296f,0xea));var _0xf296=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x296f[_0x199572];return _0x13cfa3;};'use strict';var asr=require(_0xf296('0x0'));module['exports']=function(_0x43f3e7,_0x3e57cf,_0x5d70a2,_0x4c7794){return asr(_0x43f3e7,_0x3e57cf,_0x5d70a2,_0x4c7794);};
\ No newline at end of file
+var _0xd5f0=['./lib/api','exports'];(function(_0x2c7e3b,_0x1a3d21){var _0x2fdbf6=function(_0x2c731a){while(--_0x2c731a){_0x2c7e3b['push'](_0x2c7e3b['shift']());}};_0x2fdbf6(++_0x1a3d21);}(_0xd5f0,0x18e));var _0x0d5f=function(_0x490f68,_0x31e90f){_0x490f68=_0x490f68-0x0;var _0x159c89=_0xd5f0[_0x490f68];return _0x159c89;};'use strict';var asr=require(_0x0d5f('0x0'));module[_0x0d5f('0x1')]=function(_0x39ad2e,_0x2d28d9,_0x4b4fa9,_0x2de5ac){return asr(_0x39ad2e,_0x2d28d9,_0x4b4fa9,_0x2de5ac);};
\ No newline at end of file
index 5afbab6..31c5c10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x659e=['transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses'];(function(_0x43b3aa,_0xe83a37){var _0x52952e=function(_0x230b5c){while(--_0x230b5c){_0x43b3aa['push'](_0x43b3aa['shift']());}};_0x52952e(++_0xe83a37);}(_0x659e,0x18f));var _0xe659=function(_0x1c484c,_0x58b6dd){_0x1c484c=_0x1c484c-0x0;var _0x2bab38=_0x659e[_0x1c484c];return _0x2bab38;};'use strict';var BPromise=require(_0xe659('0x0'));var _=require(_0xe659('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe659('0x2'));var crypto=require(_0xe659('0x3'));var logger=require(_0xe659('0x4'))(_0xe659('0x5'));module[_0xe659('0x6')]=function(_0x44ed55,_0x505bf6,_0x2a8ea8,_0x245680){return new BPromise(function(_0x18615f,_0x346c65){logger['info'](_0xe659('0x7'),_0x245680||_0xe659('0x8'));var _0xb5b9fe=new WebSocket(_0x245680||_0xe659('0x8'),{'perMessageDeflate':![]});var _0x2119b6='';var _0x443ad9='0';var _0x12267b='1';var _0x2e999a=_0xe659('0x9');function _0x2ce04c(_0x15cc0c){var _0x217ca5=crypto['createHash'](_0xe659('0xa'));_0x217ca5[_0xe659('0xb')](_0x15cc0c);return _0x217ca5[_0xe659('0xc')](_0xe659('0xd'));}function _0x1048dd(){try{logger[_0xe659('0xe')](_0xe659('0xf'));var _0x385c36=moment()[_0xe659('0x10')]();var _0x2f4eeb=_0x2ce04c(_0x385c36+_0x505bf6+_0x2a8ea8);_0xb5b9fe[_0xe659('0x11')](JSON[_0xe659('0x12')]({'appID':_0x505bf6,'timestamp':_0x385c36,'appKey':_0x2f4eeb}));var _0x30ace0=fs[_0xe659('0x13')](_0x44ed55);_0x30ace0['on'](_0xe659('0x14'),function(_0x57761a){_0xb5b9fe[_0xe659('0x11')](_0x57761a);});_0x30ace0['on'](_0xe659('0x15'),function(){_0xb5b9fe[_0xe659('0x11')](_0xe659('0x16'));});}catch(_0x4b5c36){logger[_0xe659('0x17')](_0xe659('0x18'),JSON['stringify'](_0x4b5c36));_0xb5b9fe[_0xe659('0x19')]();}}function _0x4f9519(_0x4d4d5b){try{if(_0x4d4d5b){var _0x547215=JSON[_0xe659('0x1a')](_0x4d4d5b);switch(_0x547215[_0xe659('0x1b')]){case 0x0:if(_0x547215[_0xe659('0x1c')]){if(_0x547215[_0xe659('0x1c')][_0xe659('0x1d')]){logger['info'](_0xe659('0x1e'),JSON[_0xe659('0x12')](_0x547215[_0xe659('0x1c')]['hypotheses']));_0x2119b6=_0x547215[_0xe659('0x1c')]['hypotheses'][0x0][_0xe659('0x1f')];_0x443ad9=_0x547215[_0xe659('0x1c')]['hypotheses'][0x0][_0xe659('0x20')];_0x12267b='0';_0x2e999a='Success.';_0xb5b9fe[_0xe659('0x19')]();}}break;case 0x1:logger['info'](_0xe659('0x9'));_0x12267b='1';_0x2e999a='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xe659('0xe')](_0xe659('0x21'));_0x12267b='2';_0x2e999a='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xe659('0xe')](_0xe659('0x22'));_0x12267b='9';_0x2e999a=_0xe659('0x22');break;case 0xa:logger[_0xe659('0xe')]('Authentication\x20failed.');_0x12267b='10';_0x2e999a=_0xe659('0x23');break;case 0xb:logger[_0xe659('0xe')](_0xe659('0x24'));_0x12267b='11';_0x2e999a=_0xe659('0x24');}}}catch(_0x1bedff){logger['error'](_0xe659('0x25'),JSON['stringify'](_0x1bedff));_0xb5b9fe['terminate']();}}function _0x457616(){logger[_0xe659('0xe')](_0xe659('0x26'));_0x18615f({'transcript':_0x2119b6,'confidence':_0x443ad9,'status':_0x12267b,'status_message':_0x2e999a});}function _0x596bfd(_0x398628){logger[_0xe659('0x17')](_0xe659('0x27'));if(!_[_0xe659('0x28')](_0x398628)){logger[_0xe659('0x17')](_['isObject'](_0x398628)?JSON[_0xe659('0x12')](_0x398628):_0x398628);}}_0xb5b9fe['on'](_0xe659('0x29'),_0x1048dd);_0xb5b9fe['on'](_0xe659('0x2a'),_0x4f9519);_0xb5b9fe['on'](_0xe659('0x15'),_0x457616);_0xb5b9fe['on'](_0xe659('0x17'),_0x596bfd);});};
\ No newline at end of file
+var _0x7813=['moment','crypto','../../../../../../config/logger','agi','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','info','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','close','EOS','terminate','parse','status','result','final','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash'];(function(_0x7d3830,_0x51541b){var _0x46c1de=function(_0xe7653){while(--_0xe7653){_0x7d3830['push'](_0x7d3830['shift']());}};_0x46c1de(++_0x51541b);}(_0x7813,0xdd));var _0x3781=function(_0x32e264,_0x41cee8){_0x32e264=_0x32e264-0x0;var _0x1d7175=_0x7813[_0x32e264];return _0x1d7175;};'use strict';var BPromise=require('bluebird');var _=require(_0x3781('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3781('0x1'));var crypto=require(_0x3781('0x2'));var logger=require(_0x3781('0x3'))(_0x3781('0x4'));module['exports']=function(_0x391dde,_0x3370c3,_0xac81cd,_0x4999a1){return new BPromise(function(_0x468ac1,_0x2e2275){logger['info'](_0x3781('0x5'),_0x4999a1||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x1d5a56=new WebSocket(_0x4999a1||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x156616='';var _0x1aadb3='0';var _0x2fe702='1';var _0x2b1083=_0x3781('0x6');function _0x26c042(_0x1092f6){var _0x1543ba=crypto[_0x3781('0x7')](_0x3781('0x8'));_0x1543ba[_0x3781('0x9')](_0x1092f6);return _0x1543ba['digest'](_0x3781('0xa'));}function _0x38ba4f(){try{logger[_0x3781('0xb')](_0x3781('0xc'));var _0x5384a2=moment()['unix']();var _0xddb09=_0x26c042(_0x5384a2+_0x3370c3+_0xac81cd);_0x1d5a56[_0x3781('0xd')](JSON[_0x3781('0xe')]({'appID':_0x3370c3,'timestamp':_0x5384a2,'appKey':_0xddb09}));var _0x3f222=fs[_0x3781('0xf')](_0x391dde);_0x3f222['on']('data',function(_0x52b12e){_0x1d5a56[_0x3781('0xd')](_0x52b12e);});_0x3f222['on'](_0x3781('0x10'),function(){_0x1d5a56[_0x3781('0xd')](_0x3781('0x11'));});}catch(_0x53757f){logger['error']('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x53757f));_0x1d5a56[_0x3781('0x12')]();}}function _0x1d116d(_0x139089){try{if(_0x139089){var _0x3b4137=JSON[_0x3781('0x13')](_0x139089);switch(_0x3b4137[_0x3781('0x14')]){case 0x0:if(_0x3b4137[_0x3781('0x15')]){if(_0x3b4137[_0x3781('0x15')][_0x3781('0x16')]){logger[_0x3781('0xb')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x3b4137[_0x3781('0x15')][_0x3781('0x17')]));_0x156616=_0x3b4137[_0x3781('0x15')][_0x3781('0x17')][0x0][_0x3781('0x18')];_0x1aadb3=_0x3b4137[_0x3781('0x15')][_0x3781('0x17')][0x0]['likelihood'];_0x2fe702='0';_0x2b1083=_0x3781('0x19');_0x1d5a56['terminate']();}}break;case 0x1:logger['info'](_0x3781('0x6'));_0x2fe702='1';_0x2b1083=_0x3781('0x6');break;case 0x2:logger['info'](_0x3781('0x1a'));_0x2fe702='2';_0x2b1083=_0x3781('0x1a');break;case 0x9:logger[_0x3781('0xb')](_0x3781('0x1b'));_0x2fe702='9';_0x2b1083='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x3781('0x1c'));_0x2fe702='10';_0x2b1083=_0x3781('0x1c');break;case 0xb:logger[_0x3781('0xb')](_0x3781('0x1d'));_0x2fe702='11';_0x2b1083=_0x3781('0x1d');}}}catch(_0x303b2b){logger[_0x3781('0x1e')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x3781('0xe')](_0x303b2b));_0x1d5a56['terminate']();}}function _0x2ebe94(){logger[_0x3781('0xb')](_0x3781('0x1f'));_0x468ac1({'transcript':_0x156616,'confidence':_0x1aadb3,'status':_0x2fe702,'status_message':_0x2b1083});}function _0x158df8(_0x44bb8c){logger['error'](_0x3781('0x20'));if(!_[_0x3781('0x21')](_0x44bb8c)){logger['error'](_[_0x3781('0x22')](_0x44bb8c)?JSON[_0x3781('0xe')](_0x44bb8c):_0x44bb8c);}}_0x1d5a56['on'](_0x3781('0x23'),_0x38ba4f);_0x1d5a56['on'](_0x3781('0x24'),_0x1d116d);_0x1d5a56['on']('close',_0x2ebe94);_0x1d5a56['on'](_0x3781('0x1e'),_0x158df8);});};
\ No newline at end of file
index 58baabc..5d60c07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['./asr','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x34e8,0x12c));var _0x834e=function(_0x40d804,_0x48393e){_0x40d804=_0x40d804-0x0;var _0x27962e=_0x34e8[_0x40d804];return _0x27962e;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xa9e0=['exports','./asr'];(function(_0x59664e,_0x18a1f5){var _0x5d1237=function(_0x218b12){while(--_0x218b12){_0x59664e['push'](_0x59664e['shift']());}};_0x5d1237(++_0x18a1f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};var asr=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'asr':asr};
\ No newline at end of file
index 7c0b8b6..9e18492 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebea=['E_AGI_SERVER_MAXCONNECTION','ready','connection','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','getConnections','E_AGI_SERVER_VOICE_DISABLED'];(function(_0x14a25d,_0x4a561a){var _0x4aa6b8=function(_0xcb5998){while(--_0xcb5998){_0x14a25d['push'](_0x14a25d['shift']());}};_0x4aa6b8(++_0x4a561a);}(_0xebea,0xec));var _0xaebe=function(_0x875832,_0x57f4b8){_0x875832=_0x875832-0x0;var _0x2512d7=_0xebea[_0x875832];return _0x2512d7;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require('events')[_0xaebe('0x0')];var AGIError=require(_0xaebe('0x1'));var AGIChannel=require('./channel');var AGIServer=function(_0x4ec2f8,_0x47495d,_0x3decf6){var _0x4ae639=this,_0x4ec2f8=_0x4ec2f8||0x11dd,_0x47495d=_0x47495d||_0xaebe('0x2'),_0x1050a1=null,_0x59aba5=0x0;EventEmitter[_0xaebe('0x3')](_0x4ae639);function _0x3716c8(){if(!_0x4ec2f8){_0x4ae639[_0xaebe('0x4')](_0xaebe('0x5'),new AGIError(_0xaebe('0x6')));return![];}_0x1050a1=net[_0xaebe('0x7')]();_0x1050a1['listen'](_0x4ec2f8,_0x47495d);_0x1050a1['on'](_0xaebe('0x8'),function(){_0x4ae639[_0xaebe('0x4')]('listening');});_0x1050a1['on']('connection',function(_0x3932ee){_0x1050a1[_0xaebe('0x9')](function(_0x31c156,_0x30eb2f){if(_0x31c156){_0x4ae639[_0xaebe('0x4')](_0xaebe('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x31c156));}else if(_0x3decf6&&_0x3decf6<0x0){_0x4ae639[_0xaebe('0x4')]('error',new AGIError(_0xaebe('0xa')));_0x3932ee['destroy']();}else if(_0x3decf6&&_0x3decf6>0x0&&_0x3decf6<_0x30eb2f){_0x59aba5+=0x1;_0x4ae639[_0xaebe('0x4')]('error',new AGIError(_0xaebe('0xb'),_0x59aba5));_0x3932ee['destroy']();}else{var _0x5565a7=new AGIChannel(_0x3932ee);_0x5565a7['on'](_0xaebe('0xc'),function(){_0x4ae639[_0xaebe('0x4')](_0xaebe('0xd'),_0x5565a7);});}});});_0x1050a1['on'](_0xaebe('0x5'),function(_0x5a669c){_0x4ae639[_0xaebe('0x4')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x5a669c['code']));});_0x1050a1['on']('close',function(){_0x4ae639[_0xaebe('0x4')](_0xaebe('0xe'),new AGIError(_0xaebe('0xf')));});}process[_0xaebe('0x10')](function(){_0x3716c8();});};util[_0xaebe('0x11')](AGIServer,EventEmitter);module[_0xaebe('0x12')]=function(_0x4b5d8e,_0x52df5b,_0x45a7bc){return new AGIServer(_0x4b5d8e,_0x52df5b,_0x45a7bc);};
\ No newline at end of file
+var _0x5c33=['listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5c33,0x199));var _0x35c3=function(_0x349614,_0x4bf906){_0x349614=_0x349614-0x0;var _0x48b781=_0x5c33[_0x349614];return _0x48b781;};'use strict';var util=require(_0x35c3('0x0'));var net=require(_0x35c3('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0x35c3('0x2'));var AGIChannel=require(_0x35c3('0x3'));var AGIServer=function(_0x2f3c9f,_0x3dd3ba,_0x5d5033){var _0x3f2205=this,_0x2f3c9f=_0x2f3c9f||0x11dd,_0x3dd3ba=_0x3dd3ba||_0x35c3('0x4'),_0x1bd970=null,_0x20ee59=0x0;EventEmitter[_0x35c3('0x5')](_0x3f2205);function _0x127032(){if(!_0x2f3c9f){_0x3f2205[_0x35c3('0x6')](_0x35c3('0x7'),new AGIError(_0x35c3('0x8')));return![];}_0x1bd970=net['createServer']();_0x1bd970[_0x35c3('0x9')](_0x2f3c9f,_0x3dd3ba);_0x1bd970['on'](_0x35c3('0xa'),function(){_0x3f2205[_0x35c3('0x6')](_0x35c3('0xa'));});_0x1bd970['on'](_0x35c3('0xb'),function(_0x1bf13a){_0x1bd970[_0x35c3('0xc')](function(_0x2fe504,_0x3693bd){if(_0x2fe504){_0x3f2205[_0x35c3('0x6')](_0x35c3('0x7'),new AGIError(_0x35c3('0xd'),_0x2fe504));}else if(_0x5d5033&&_0x5d5033<0x0){_0x3f2205[_0x35c3('0x6')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1bf13a[_0x35c3('0xe')]();}else if(_0x5d5033&&_0x5d5033>0x0&&_0x5d5033<_0x3693bd){_0x20ee59+=0x1;_0x3f2205[_0x35c3('0x6')](_0x35c3('0x7'),new AGIError(_0x35c3('0xf'),_0x20ee59));_0x1bf13a[_0x35c3('0xe')]();}else{var _0x5cf864=new AGIChannel(_0x1bf13a);_0x5cf864['on'](_0x35c3('0x10'),function(){_0x3f2205[_0x35c3('0x6')](_0x35c3('0xb'),_0x5cf864);});}});});_0x1bd970['on'](_0x35c3('0x7'),function(_0x541a8f){_0x3f2205[_0x35c3('0x6')](_0x35c3('0x7'),new AGIError(_0x35c3('0xd'),_0x541a8f[_0x35c3('0x11')]));});_0x1bd970['on'](_0x35c3('0x12'),function(){_0x3f2205['emit'](_0x35c3('0x12'),new AGIError(_0x35c3('0x13')));});}process[_0x35c3('0x14')](function(){_0x127032();});};util[_0x35c3('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x515331,_0x4999e2,_0x8516f7){return new AGIServer(_0x515331,_0x4999e2,_0x8516f7);};
\ No newline at end of file
index d98c22b..3756f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa668=['Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','shelljs','odbc','randomstring','moment','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','googleTTS','text','google_tts_language','googleDialogflow','key','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','result','setVariable','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','options','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','debug','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','bot','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','toUpperCase','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20%s\x20file\x20created','unlink','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','out','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','stringify','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s.%s','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','condition','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','url','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','secure','authentication','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes'];(function(_0x8b4939,_0x4a8076){var _0x40e5fb=function(_0x5c507f){while(--_0x5c507f){_0x8b4939['push'](_0x8b4939['shift']());}};_0x40e5fb(++_0x4a8076);}(_0xa668,0x1ac));var _0x8a66=function(_0x219dfe,_0xfec2b9){_0x219dfe=_0x219dfe-0x0;var _0x2d9fb8=_0xa668[_0x219dfe];return _0x2d9fb8;};'use strict';var fs=require('fs');var path=require(_0x8a66('0x0'));var util=require('util');var _=require('lodash');var sh=require(_0x8a66('0x1'));var odbc=require(_0x8a66('0x2'))();var rs=require(_0x8a66('0x3'));var moment=require(_0x8a66('0x4'));var Mustache=require('mustache');var logger=require('../../config/logger')(_0x8a66('0x5'));var config=require(_0x8a66('0x6'));var scripts=require(_0x8a66('0x7'));var FILES_PATH=_0x8a66('0x8');var verticesWithRetry=[_0x8a66('0x9'),'getdigits',_0x8a66('0xa')];var AGIVertices=function(_0x2b9d45,_0x2ef755,_0x54421b){this[_0x8a66('0xb')]=_0x2b9d45;this['rpc']=_0x2ef755;this[_0x8a66('0xc')]=_0x54421b;};AGIVertices[_0x8a66('0xd')][_0x8a66('0xe')]=function(_0x3ebd63,_0x377bda){this[_0x8a66('0xf')][_0x8a66('0x10')](_0x3ebd63)[_0x8a66('0x11')](function(_0x5b3b47){_0x377bda(null,_0x5b3b47?_0x5b3b47['name']:![]);})[_0x8a66('0x12')](function(_0x113327){_0x377bda(_0x113327);});};AGIVertices['prototype'][_0x8a66('0x13')]=function(_0x36740c,_0x5e6e6a){this[_0x8a66('0xf')][_0x8a66('0x14')](_0x36740c)[_0x8a66('0x11')](function(_0x3f4c27){_0x5e6e6a(null,_0x3f4c27?_0x3f4c27[_0x8a66('0x15')]:![]);})[_0x8a66('0x12')](function(_0x56daa2){_0x5e6e6a(_0x56daa2);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x16')]=function(_0x5bd11a,_0x150dfa){this[_0x8a66('0xf')][_0x8a66('0x17')](_0x5bd11a)[_0x8a66('0x11')](function(_0x14ee66){_0x150dfa(null,_0x14ee66?_0x14ee66[_0x8a66('0x15')]:![]);})[_0x8a66('0x12')](function(_0x68feb1){_0x150dfa(_0x68feb1);});};AGIVertices['prototype'][_0x8a66('0x18')]=function(_0x5281cb,_0x34a94a){this[_0x8a66('0xf')]['getSquareOdbcById'](_0x5281cb)[_0x8a66('0x11')](function(_0x1c6fb1){_0x34a94a(null,_0x1c6fb1?_0x1c6fb1[_0x8a66('0x19')]:![]);})['catch'](function(_0x3ab623){_0x34a94a(_0x3ab623);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x1a')]=function(_0x390f90,_0x3cc8f0){this[_0x8a66('0xf')]['getUserById'](_0x390f90)[_0x8a66('0x11')](function(_0x25f567){_0x3cc8f0(null,_0x25f567?_0x25f567[_0x8a66('0x15')]:![]);})['catch'](function(_0x3d7790){_0x3cc8f0(_0x3d7790);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x1b')]=function(_0x196d2d,_0x81ff28){this[_0x8a66('0xf')]['getTrunkById'](_0x196d2d)['then'](function(_0x17b38c){_0x81ff28(null,_0x17b38c?_0x17b38c[_0x8a66('0x15')]:![]);})[_0x8a66('0x12')](function(_0x1b9b1c){_0x81ff28(_0x1b9b1c);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x1c')]=function(_0x31cb34,_0x3a0c08){var _0x34b1c0=this;this[_0x8a66('0xf')][_0x8a66('0x1d')](_0x31cb34)[_0x8a66('0x11')](function(_0xa8e15e){_0x3a0c08(null,_0xa8e15e?_0x34b1c0[_0x8a66('0x1e')](_0xa8e15e[_0x8a66('0x1f')]):![]);})[_0x8a66('0x12')](function(_0x1bf565){_0x3a0c08(_0x1bf565);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x20')]=function(_0xdcda41,_0x4e6623){this['rpc'][_0x8a66('0x21')](_0xdcda41)[_0x8a66('0x11')](function(_0x76da30){_0x4e6623(null,_0x76da30?_0x76da30:![]);})[_0x8a66('0x12')](function(_0x18c35c){_0x4e6623(_0x18c35c);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x22')]=function(_0x502a93,_0x50ea16,_0x21e1da){this[_0x8a66('0xc')][_0x8a66('0x22')](_0x502a93,_0x50ea16)[_0x8a66('0x11')](function(){_0x21e1da(null);})[_0x8a66('0x12')](function(_0x525bc3){_0x21e1da(_0x525bc3);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x23')]=function(_0x46ca36,_0x41ccae){this[_0x8a66('0xf')]['getIntervalById'](_0x46ca36)['then'](function(_0xb01f0d){if(_0xb01f0d){if(_0xb01f0d['IntervalId']){_0x41ccae(null,[_0xb01f0d['interval']]);}else{_0x41ccae(null,_[_0x8a66('0x24')](_0xb01f0d[_0x8a66('0x25')],_0x8a66('0x26')));}}else{_0x41ccae(null,![]);}})[_0x8a66('0x12')](function(_0x33ebe7){_0x41ccae(_0x33ebe7);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x1e')]=function(_0x3918a2){return util[_0x8a66('0x27')](_0x8a66('0x28'),FILES_PATH,_0x3918a2);};AGIVertices[_0x8a66('0xd')][_0x8a66('0x29')]=function(_0x38cc62,_0x4b3670,_0x575d19){odbc[_0x8a66('0x2a')](_0x38cc62,function(_0x91ed15){if(_0x91ed15){logger[_0x8a66('0x2b')](_0x8a66('0x2c'),_0x91ed15);_0x575d19(_0x91ed15);}else{logger[_0x8a66('0x2d')](_0x8a66('0x2e'));odbc[_0x8a66('0x2f')](_0x4b3670,function(_0x25d9c4,_0x63804f){if(_0x25d9c4){logger[_0x8a66('0x2d')](_0x8a66('0x30'),_0x4b3670);_0x575d19(_0x25d9c4);}else{logger[_0x8a66('0x2d')](_0x8a66('0x31'),_0x4b3670);odbc[_0x8a66('0x32')](function(_0x4c06cb){if(_0x4c06cb){logger[_0x8a66('0x2b')](_0x8a66('0x33'),_0x4c06cb);}_0x575d19(null,_0x63804f);});}});}});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x34')]=function(_0xf47fad,_0x56e62c){this[_0x8a66('0xf')][_0x8a66('0x35')](_0xf47fad)[_0x8a66('0x11')](function(_0x2b7c0c){_0x56e62c(null,_0x2b7c0c?_0x2b7c0c:![]);})[_0x8a66('0x12')](function(_0x3a9bc0){_0x56e62c(_0x3a9bc0);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x36')]=function(_0xbd5a80,_0x546497){this[_0x8a66('0xf')][_0x8a66('0x36')](_0xbd5a80)[_0x8a66('0x11')](function(_0x138e3b){_0x546497(null,_0x138e3b);})[_0x8a66('0x12')](function(_0x432260){_0x546497(_0x432260);});};AGIVertices['prototype'][_0x8a66('0x37')]=function(_0x5dc038,_0x1c9ce2,_0x5ddcd6){this[_0x8a66('0xf')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x8a66('0x38')],'node':_0x5dc038[_0x8a66('0x39')],'application':_0x5dc038[_0x8a66('0x3a')],'data':_0x1c9ce2||null,'project_name':this['channel'][_0x8a66('0x3b')],'callerid':this['channel'][_0x8a66('0x3c')]})[_0x8a66('0x11')](function(_0x2e030c){if(_0x5ddcd6){_0x5ddcd6(null,_0x2e030c);}})[_0x8a66('0x12')](function(_0x2d254c){if(_0x5ddcd6){_0x5ddcd6(_0x2d254c);}});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x3d')]=function(_0x20d90a,_0x34f33f,_0x4f2f53,_0x4a25e6){this[_0x8a66('0xf')][_0x8a66('0x3d')]({'uniqueid':this[_0x8a66('0xb')][_0x8a66('0x38')],'callerid':this[_0x8a66('0xb')]['callerid'],'calleridname':this[_0x8a66('0xb')][_0x8a66('0x3e')],'context':this[_0x8a66('0xb')][_0x8a66('0x3f')],'extension':this[_0x8a66('0xb')][_0x8a66('0x40')],'priority':this[_0x8a66('0xb')]['priority'],'accountcode':this['channel'][_0x8a66('0x41')],'dnid':this[_0x8a66('0xb')][_0x8a66('0x42')],'projectName':this['channel'][_0x8a66('0x3b')],'saveName':_0x34f33f,'filename':_0x20d90a[_0x8a66('0x43')]||_0x34f33f,'savePath':_0x4f2f53})[_0x8a66('0x11')](function(_0x519b39){_0x4a25e6(null,_0x519b39);})[_0x8a66('0x12')](function(_0x2dc735){_0x4a25e6(_0x2dc735);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x44')]=function(_0x37bcee,_0x2cead6,_0x349fc3){this[_0x8a66('0xf')][_0x8a66('0x44')]({'uniqueid':this[_0x8a66('0xb')][_0x8a66('0x38')],'body':_0x37bcee,'direction':_0x2cead6})[_0x8a66('0x11')](function(_0x4cfaea){if(_0x349fc3){_0x349fc3(null,_0x4cfaea);}})[_0x8a66('0x12')](function(_0x5b471c){if(_0x349fc3){_0x349fc3(_0x5b471c);}});};AGIVertices['prototype'][_0x8a66('0x45')]=function(_0xc37b18,_0x56a50d){this[_0x8a66('0xf')][_0x8a66('0x45')]({'firstName':_[_0x8a66('0x46')](_0xc37b18[_0x8a66('0x15')])||_[_0x8a66('0x47')](_0xc37b18[_0x8a66('0x15')])?_0x8a66('0x48')+Math[_0x8a66('0x49')]():_0xc37b18[_0x8a66('0x15')],'lastName':_[_0x8a66('0x46')](_0xc37b18['lastName'])||_[_0x8a66('0x47')](_0xc37b18['lastName'])?null:_0xc37b18[_0x8a66('0x4a')],'phone':_0xc37b18[_0x8a66('0x4b')],'ListId':_0xc37b18[_0x8a66('0x4c')],'scheduledAt':_0xc37b18[_0x8a66('0x4d')],'callbackUniqueid':this[_0x8a66('0xb')][_0x8a66('0x38')],'tags':_0x8a66('0x4e'),'description':_0x8a66('0x4f')+_0xc37b18[_0x8a66('0x4d')][_0x8a66('0x50')](),'priority':_0xc37b18['callback_priority']})['then'](function(_0xcf8e59){_0x56a50d(null,_0xcf8e59);})[_0x8a66('0x12')](function(_0x25ea47){_0x56a50d(_0x25ea47);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x51')]=function(_0x534dbe,_0x46260c){this['rpc'][_0x8a66('0x52')](_0x534dbe)[_0x8a66('0x11')](function(_0x2d9055){_0x46260c(null,_0x2d9055?_0x2d9055['name']:![]);})[_0x8a66('0x12')](function(_0x5998d3){_0x46260c(_0x5998d3);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x53')]=function(_0x20b9b2,_0x66c682,_0x4757d3){var _0x8e9b3={'role':_0x8a66('0x54')};_0x8e9b3[_0x20b9b2]=this['channel']['callerid'];this['rpc']['agentPause'](_0x8e9b3,_0x66c682,this['channel']['uniqueid'])[_0x8a66('0x11')](function(_0xb4616a){_0x4757d3(null,_[_0x8a66('0x47')](_0xb4616a)?![]:!![]);})['catch'](function(_0x5eb6a4){logger[_0x8a66('0x2b')](_0x5eb6a4);_0x4757d3(null,![]);});};AGIVertices['prototype'][_0x8a66('0x55')]=function(_0xdae0de,_0x3f591b){var _0x17ae67={'role':_0x8a66('0x54')};_0x17ae67[_0xdae0de]=this[_0x8a66('0xb')][_0x8a66('0x3c')];this[_0x8a66('0xf')][_0x8a66('0x55')](_0x17ae67)[_0x8a66('0x11')](function(_0x15a70c){_0x3f591b(null,_['isNil'](_0x15a70c)?![]:!![]);})[_0x8a66('0x12')](function(_0x25f923){logger[_0x8a66('0x2b')](_0x25f923);_0x3f591b(null,![]);});};AGIVertices[_0x8a66('0xd')]['agentLogout']=function(_0x486fda,_0x483cbc){var _0x35ebbc={'role':_0x8a66('0x54')};_0x35ebbc[_0x486fda]=this[_0x8a66('0xb')]['callerid'];this[_0x8a66('0xf')][_0x8a66('0x56')](_0x35ebbc)[_0x8a66('0x11')](function(_0x230bf0){_0x483cbc(null,_[_0x8a66('0x47')](_0x230bf0)?![]:!![]);})['catch'](function(_0x10f298){logger[_0x8a66('0x2b')](_0x10f298);_0x483cbc(null,![]);});};AGIVertices['prototype'][_0x8a66('0x57')]=function(_0x3144f4,_0x1390a9){var _0x16b802={'role':_0x8a66('0x54')};_0x16b802[_0x3144f4]=this[_0x8a66('0xb')][_0x8a66('0x3c')];var _0xd62d59=_0x3144f4!=_0x8a66('0x58')?util['format'](_0x8a66('0x59'),_0x8a66('0x5a'),this[_0x8a66('0xb')]['callerid']):undefined;this[_0x8a66('0xf')][_0x8a66('0x57')](_0x16b802,_0xd62d59)[_0x8a66('0x11')](function(_0x1d0383){_0x1390a9(null,_[_0x8a66('0x47')](_0x1d0383)?![]:!![]);})[_0x8a66('0x12')](function(_0x118599){logger[_0x8a66('0x2b')](_0x118599);_0x1390a9(null,![]);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x5b')]=function(_0x20077e,_0x37573f){sh['exec'](_['trim'](_0x20077e),function(_0x3100e4,_0x19d44f){var _0x26ec22=_0x19d44f['replace'](/(\r\n|\n|\r)/gm,'');_0x37573f(null,_0x26ec22);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x5c')]=function(_0x4e3d23,_0xad43f3){scripts[_0x8a66('0x5c')](_0x4e3d23[_0x8a66('0x5d')],_0x4e3d23[_0x8a66('0x5e')]||'en',0x1)[_0x8a66('0x11')](function(_0xad9c2c){_0xad43f3(null,_0xad9c2c);})[_0x8a66('0x12')](function(_0x43907e){_0xad43f3(_0x43907e);});};AGIVertices['prototype'][_0x8a66('0x5f')]=function(_0x41d34b,_0x281f8d){scripts[_0x8a66('0x5f')](this['channel'][_0x8a66('0x38')],_0x41d34b[_0x8a66('0x60')],_0x41d34b[_0x8a66('0x5d')],_0x41d34b['dialogflow_language']||'en')[_0x8a66('0x11')](function(_0x54fb30){_0x281f8d(null,_0x54fb30);})[_0x8a66('0x12')](function(_0x439dac){_0x281f8d(_0x439dac);});};AGIVertices[_0x8a66('0xd')]['sestekNDA']=function(_0x1854fa,_0x4202f9){scripts['sestekNDA'](this[_0x8a66('0xb')],_0x1854fa)[_0x8a66('0x11')](function(_0x952c6b){_0x4202f9(null,_0x952c6b);})[_0x8a66('0x12')](function(_0x185a64){_0x4202f9(_0x185a64);});};AGIVertices[_0x8a66('0xd')]['ispeechTTS']=function(_0x2b9fc9,_0x25e80e){scripts[_0x8a66('0x61')](_0x2b9fc9[_0x8a66('0x60')],_0x2b9fc9[_0x8a66('0x5d')],_0x2b9fc9[_0x8a66('0x62')]||_0x8a66('0x63'),_0x2b9fc9[_0x8a66('0x64')])[_0x8a66('0x11')](function(_0x44f008){_0x25e80e(null,_0x44f008);})[_0x8a66('0x12')](function(_0x420591){_0x25e80e(_0x420591);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x65')]=function(_0x2ae28a,_0x7f9d73,_0x3da1cf){scripts[_0x8a66('0x65')](_0x7f9d73,_0x2ae28a[_0x8a66('0x60')],_0x2ae28a['ispeech_asr_language']||_0x8a66('0x63'),this[_0x8a66('0x66')](_0x2ae28a[_0x8a66('0x67')])?_0x2ae28a[_0x8a66('0x67')]:undefined)['then'](function(_0x326018){_0x3da1cf(null,_0x326018);})[_0x8a66('0x12')](function(_0x1937ef){_0x3da1cf(_0x1937ef);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x68')]=function(_0x28cba0,_0x2d1012){scripts[_0x8a66('0x68')](_0x28cba0[_0x8a66('0x69')],_0x28cba0['aws_secret_access_key'],_0x28cba0[_0x8a66('0x6a')],_0x28cba0[_0x8a66('0x6b')]||_0x8a66('0x6c'),_0x28cba0[_0x8a66('0x5d')],_0x28cba0[_0x8a66('0x6d')]||_0x8a66('0x5d'))[_0x8a66('0x11')](function(_0x377af9){_0x2d1012(null,_0x377af9);})[_0x8a66('0x12')](function(_0x575f8c){_0x2d1012(_0x575f8c);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x6e')]=function(_0x18ad60,_0x23f76f){scripts[_0x8a66('0x6e')](this[_0x8a66('0xb')][_0x8a66('0x38')],_0x18ad60[_0x8a66('0x69')],_0x18ad60[_0x8a66('0x6f')],_0x18ad60[_0x8a66('0x70')],_0x18ad60[_0x8a66('0x5d')],_0x18ad60[_0x8a66('0x71')])[_0x8a66('0x11')](function(_0x2c5817){_0x23f76f(null,_0x2c5817);})[_0x8a66('0x12')](function(_0x196d87){_0x23f76f(_0x196d87);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x72')]=function(_0x46b166,_0x2f1359,_0x28ecc7){scripts[_0x8a66('0x72')](_0x2f1359,_0x46b166[_0x8a66('0x60')],_0x46b166[_0x8a66('0x73')]||_0x8a66('0x63'))[_0x8a66('0x11')](function(_0x343e37){_0x28ecc7(null,_0x343e37);})[_0x8a66('0x12')](function(_0x34fc86){_0x28ecc7(_0x34fc86);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x74')]=function(_0x2aec9e,_0x552a89,_0x4cc83d){scripts[_0x8a66('0x74')](_0x552a89,_0x2aec9e[_0x8a66('0x75')],_0x2aec9e[_0x8a66('0x76')],_0x2aec9e[_0x8a66('0x77')])['then'](function(_0x99711d){_0x4cc83d(null,_0x99711d);})[_0x8a66('0x12')](function(_0xb05332){_0x4cc83d(_0xb05332);});};AGIVertices[_0x8a66('0xd')][_0x8a66('0x78')]=function(_0x119a38){var _0x579b48=_[_0x8a66('0x79')](verticesWithRetry,_0x119a38['agicommand'])?_0x119a38:_[_0x8a66('0x7a')](_0x119a38);for(var _0x48e204 in _0x579b48){if(_0x579b48[_0x8a66('0x7b')](_0x48e204)){if(_0x579b48[_0x48e204]&&_[_0x8a66('0x7c')](_0x579b48[_0x48e204])){_0x579b48[_0x48e204]=this[_0x8a66('0x7d')](_0x579b48[_0x48e204]);}}}return _0x579b48;};AGIVertices[_0x8a66('0xd')][_0x8a66('0x7d')]=function(_0x5968dc){var _0x180c99=_0x5968dc[_0x8a66('0x7e')]('{');for(var _0x3f3f15=0x1;_0x3f3f15<_0x180c99[_0x8a66('0x7f')];_0x3f3f15+=0x1){var _0x38338b=_0x180c99[_0x3f3f15][_0x8a66('0x7e')]('}');if(_0x38338b[_0x8a66('0x7f')]>0x1){_0x5968dc=_0x5968dc[_0x8a66('0x80')]('{'+_0x38338b[0x0]+'}',this[_0x8a66('0xb')]['getVariable'](_0x38338b[0x0])[_0x8a66('0x81')]||_0x38338b[0x0]);}}if(_0x180c99[_0x8a66('0x7f')]===0x1){return _0x5968dc[_0x8a66('0x50')]();}return this['replaceAllVariables'](_0x5968dc);};AGIVertices[_0x8a66('0xd')]['getAndSetVariable']=function(_0x6c4f49,_0xb18e4c){var _0x560c32=this['channel']['getVariable'](_0x6c4f49);if(_0x560c32[_0x8a66('0x82')]===-0x1){return _0x560c32;}logger[_0x8a66('0x2d')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xb18e4c,_0x560c32[_0x8a66('0x81')]));return this[_0x8a66('0xb')][_0x8a66('0x83')](_0xb18e4c,_0x560c32['extra']);};AGIVertices[_0x8a66('0xd')][_0x8a66('0x66')]=function(_0xf8a7ab){return _0xf8a7ab&&_0xf8a7ab!=='0'&&_0xf8a7ab!=='-1'&&_0xf8a7ab!=='';};AGIVertices['prototype'][_0x8a66('0x84')]=function(_0x326bf0){this[_0x8a66('0x37')][_0x8a66('0x85')](this,_0x326bf0,'-');_0x326bf0[_0x8a66('0x86')]=_0x326bf0[_0x8a66('0x84')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8a66('0xd')][_0x8a66('0x5')]=function(_0x4293b3){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x87'),_0x4293b3[_0x8a66('0x39')]));return this['channel'][_0x8a66('0x5')]([_0x4293b3['command'],_0x4293b3[_0x8a66('0x88')]]);};AGIVertices[_0x8a66('0xd')][_0x8a66('0x89')]=function(_0xb67f60){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0x8a'),_0xb67f60[_0x8a66('0x39')]));if(this[_0x8a66('0x66')](_0xb67f60[_0x8a66('0x8b')])){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0x8c'),_0xb67f60[_0x8a66('0x8b')]));var _0x4e82b4=this['channel'][_0x8a66('0x8d')](_0xb67f60[_0x8a66('0x8b')]);if(_0x4e82b4[_0x8a66('0x82')]===-0x1){return _0x4e82b4;}}return this[_0x8a66('0xb')][_0x8a66('0x89')]();};AGIVertices[_0x8a66('0xd')][_0x8a66('0x4e')]=function(_0x177469){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x8e'),_0x177469['label']));if(!this[_0x8a66('0x66')](_0x177469[_0x8a66('0x4c')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x177469,'no\x20list\x20selected');}_0x177469[_0x8a66('0x4d')]=moment();if(this['isConfigured'](_0x177469['delay'])){_0x177469['scheduledAt']=moment()['add'](_0x177469[_0x8a66('0x8f')],'minutes');}if(!this['isConfigured'](_0x177469[_0x8a66('0x90')])){_0x177469['callback_priority']=0x2;}this['createCmContact'][_0x8a66('0x85')](this,_0x177469);return this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x92'),_0x177469[_0x8a66('0x4b')],_0x177469['list_id'],_0x177469[_0x8a66('0x4d')]));};AGIVertices[_0x8a66('0xd')]['custom_app']=function(_0x3724e0){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x93'),_0x3724e0[_0x8a66('0x39')]));var _0x1cb4e4=this[_0x8a66('0xb')][_0x8a66('0x94')](_0x3724e0[_0x8a66('0x95')],_0x3724e0[_0x8a66('0x96')]);if(_0x1cb4e4[_0x8a66('0x82')]===-0x1){return _0x1cb4e4;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')]('Executed\x20command\x20%s\x20%s',_0x3724e0['application'],_0x3724e0[_0x8a66('0x96')]));};AGIVertices[_0x8a66('0xd')]['lumenvoxtts']=function(_0x47dc66){logger['info'](util[_0x8a66('0x27')](_0x8a66('0x97'),_0x47dc66['label']));if(!this[_0x8a66('0x66')](_0x47dc66['text'])){return this[_0x8a66('0xb')]['noop']('no\x20text\x20configured');}var _0x13c3dd='\x22'+_0x47dc66[_0x8a66('0x5d')]+'\x22';if(this[_0x8a66('0x66')](_0x47dc66[_0x8a66('0x96')])){_0x13c3dd+=','+_0x47dc66[_0x8a66('0x96')];}var _0x37c4ea=this[_0x8a66('0xb')]['exec'](_0x8a66('0x98'),_0x13c3dd);if(_0x37c4ea[_0x8a66('0x82')]===-0x1){return _0x37c4ea;}return this[_0x8a66('0xb')]['noop'](util[_0x8a66('0x27')](_0x8a66('0x99'),_0x13c3dd));};AGIVertices['prototype'][_0x8a66('0x9a')]=function(_0x634ab9){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x9b'),_0x634ab9[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x634ab9['text'])){return this[_0x8a66('0xb')]['noop'](_0x8a66('0x9c'));}var _0x49e54b='\x22'+_0x634ab9[_0x8a66('0x5d')]+'\x22';if(this['isConfigured'](_0x634ab9[_0x8a66('0x96')])){_0x49e54b+=','+_0x634ab9[_0x8a66('0x96')];}var _0x259703=this[_0x8a66('0xb')][_0x8a66('0x94')](_0x8a66('0x98'),_0x49e54b);if(_0x259703[_0x8a66('0x82')]===-0x1){return _0x259703;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x99'),_0x49e54b));};AGIVertices[_0x8a66('0xd')][_0x8a66('0x9d')]=function(_0x558d2f){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x9e'),_0x558d2f['label']));if(!this['isConfigured'](_0x558d2f[_0x8a66('0x9f')])){return this[_0x8a66('0xb')]['noop'](_0x8a66('0xa0'));}var _0x503473=_0x558d2f[_0x8a66('0x9f')];if(this['isConfigured'](_0x558d2f['options'])){_0x503473+=','+_0x558d2f[_0x8a66('0x96')];}var _0x3fcba3=this[_0x8a66('0xb')][_0x8a66('0x94')](_0x8a66('0xa1'),_0x503473);if(_0x3fcba3['result']===-0x1){return _0x3fcba3;}var _0x289ed1=this[_0x8a66('0xa2')](_0x8a66('0xa3'),_0x8a66('0xa4'));if(_0x289ed1['result']===-0x1){return _0x289ed1;}var _0x2830e7=this[_0x8a66('0xa2')](_0x8a66('0xa5'),_0x8a66('0xa6'));if(_0x2830e7[_0x8a66('0x82')]===-0x1){return _0x2830e7;}var _0x4267e7=this['getAndSetVariable'](_0x8a66('0xa7'),'LUMENVOX_ASR_INSTANCE');if(_0x4267e7[_0x8a66('0x82')]===-0x1){return _0x4267e7;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util['format'](_0x8a66('0xa8'),_0x503473));};AGIVertices[_0x8a66('0xd')][_0x8a66('0xa9')]=function(_0x2330b0){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0xaa'),_0x2330b0[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x2330b0[_0x8a66('0x9f')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xa0'));}var _0x7b794=_0x2330b0[_0x8a66('0x9f')];if(this['isConfigured'](_0x2330b0['options'])){_0x7b794+=','+_0x2330b0[_0x8a66('0x96')];}var _0x350510=this[_0x8a66('0xb')][_0x8a66('0x94')](_0x8a66('0xa1'),_0x7b794);if(_0x350510[_0x8a66('0x82')]===-0x1){return _0x350510;}var _0x82ba0d=this[_0x8a66('0xa2')](_0x8a66('0xa3'),'SESTEK_ASR_CONFIDENCE');if(_0x82ba0d[_0x8a66('0x82')]===-0x1){return _0x82ba0d;}var _0x458834=this[_0x8a66('0xa2')](_0x8a66('0xa5'),_0x8a66('0xab'));if(_0x458834['result']===-0x1){return _0x458834;}var _0x498d86=this[_0x8a66('0xa2')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x498d86['result']===-0x1){return _0x498d86;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util['format'](_0x8a66('0xa8'),_0x7b794));};AGIVertices[_0x8a66('0xd')][_0x8a66('0xac')]=function(_0x19d79b){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0xad'),_0x19d79b[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x19d79b[_0x8a66('0xae')])){return this['channel'][_0x8a66('0x2b')](_0x19d79b,'no\x20database\x20selected');}var _0x58a752=this[_0x8a66('0x18')]['sync'](this,_0x19d79b[_0x8a66('0xae')]);if(!_0x58a752){return this['channel'][_0x8a66('0x2b')](_0x19d79b,_0x8a66('0xaf'));}if(!this[_0x8a66('0x66')](_0x19d79b[_0x8a66('0x2f')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x19d79b,'no\x20query\x20configured');}var _0x3971ba=_0x19d79b[_0x8a66('0x2f')][_0x8a66('0xb0')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0xb1'),_0x3971ba));var _0x5a96a4=this['getQueryOdbc']['sync'](this,_0x58a752,_0x3971ba);this['createSquareDetailsReport'][_0x8a66('0x85')](this,_0x19d79b,_0x3971ba);if(!this[_0x8a66('0x66')](_0x19d79b[_0x8a66('0xb2')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xb3'));}var _0x3b2a4e=this[_0x8a66('0xe')]['sync'](this,_0x19d79b[_0x8a66('0xb2')]);if(!_0x3b2a4e){return this[_0x8a66('0xb')]['error'](_0x19d79b,_0x8a66('0xb4'));}var _0x206242=this;_0x5a96a4[_0x8a66('0xb5')](function(_0x4568a6,_0x323d4a){Object['keys'](_0x4568a6)[_0x8a66('0xb5')](function(_0x33dcc7){_0x206242[_0x8a66('0xb')]['setVariable'](util[_0x8a66('0x27')](_0x8a66('0xb6'),_0x3b2a4e,_0x323d4a,_0x33dcc7),_0x4568a6[_0x33dcc7]);});});this[_0x8a66('0xb')][_0x8a66('0x83')](util['format'](_0x8a66('0xb7'),_0x3b2a4e),_0x5a96a4[_0x8a66('0x7f')]);return this['channel']['noop'](util[_0x8a66('0x27')]('variable\x20%s\x20set',_0x3b2a4e));};AGIVertices[_0x8a66('0xd')]['dial']=function(_0x2cfbd4){logger[_0x8a66('0xb8')](util[_0x8a66('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2cfbd4[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x2cfbd4['sip_id'])){return this['channel'][_0x8a66('0x2b')](_0x2cfbd4,'no\x20user\x20selected');}var _0x2f4190=this[_0x8a66('0x1a')][_0x8a66('0x85')](this,_0x2cfbd4[_0x8a66('0xb9')]);if(!_0x2f4190){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x2cfbd4,_0x8a66('0xba'));}var _0x2e8b44=this[_0x8a66('0xb')][_0x8a66('0x94')](_0x8a66('0xbb'),[util['format'](_0x8a66('0xbc'),_0x2f4190),_0x2cfbd4[_0x8a66('0x8b')],_0x2cfbd4[_0x8a66('0xbd')],_0x2cfbd4['url']]);if(_0x2e8b44['result']===-0x1){return _0x2e8b44;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')]('Executed\x20command\x20%s',_0x8a66('0xbb')));};AGIVertices[_0x8a66('0xd')][_0x8a66('0xbe')]=function(_0x3b2b11){logger['info'](util[_0x8a66('0x27')](_0x8a66('0xbf'),_0x3b2b11[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x3b2b11[_0x8a66('0x60')])){return this['channel'][_0x8a66('0x91')](_0x8a66('0xc0'));}if(!this['isConfigured'](_0x3b2b11[_0x8a66('0x5d')])){return this['channel'][_0x8a66('0x91')](_0x8a66('0x9c'));}this[_0x8a66('0xb')]['bot']=!![];this[_0x8a66('0x37')](_0x3b2b11);this[_0x8a66('0x44')](_0x3b2b11[_0x8a66('0x5d')],'in');this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')]('Trying\x20Dialogflow:\x20%s',_0x3b2b11[_0x8a66('0x5d')]));var _0x330be2=this[_0x8a66('0x5f')][_0x8a66('0x85')](this,_0x3b2b11);if(_0x330be2){for(var _0x14e3b2 in _0x330be2){if(_0x330be2[_0x8a66('0x7b')](_0x14e3b2)){this[_0x8a66('0xb')][_0x8a66('0x83')](util[_0x8a66('0x27')](_0x8a66('0xc1'),_0x14e3b2['toUpperCase']()),_0x330be2[_0x14e3b2]);}}this[_0x8a66('0x44')](_0x330be2[_0x8a66('0xc2')],'out');return this['channel']['noop'](util['format'](_0x8a66('0xc3'),_0x330be2[_0x8a66('0xc2')]));}return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x3b2b11,_0x8a66('0xc4'));};AGIVertices[_0x8a66('0xd')][_0x8a66('0xc5')]=function(_0xd59547){logger['info'](util['format'](_0x8a66('0xc6'),_0xd59547[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0xd59547['ndauth_url'])){return this['channel'][_0x8a66('0x91')](_0x8a66('0xc7'));}if(!this[_0x8a66('0x66')](_0xd59547[_0x8a66('0xc8')])){return this['channel'][_0x8a66('0x91')](_0x8a66('0xc9'));}if(!this[_0x8a66('0x66')](_0xd59547[_0x8a66('0xca')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xcb'));}if(!this[_0x8a66('0x66')](_0xd59547[_0x8a66('0xcc')])){return this[_0x8a66('0xb')][_0x8a66('0x91')]('no\x20text\x20configured');}this[_0x8a66('0xb')][_0x8a66('0xcd')]=!![];this[_0x8a66('0x37')](_0xd59547);this['createSquareMessage'](_0xd59547[_0x8a66('0x5d')],'in');this[_0x8a66('0xb')]['noop'](util[_0x8a66('0x27')](_0x8a66('0xce'),_0xd59547[_0x8a66('0x5d')]));var _0x515fd3=this[_0x8a66('0xcf')][_0x8a66('0x85')](this,_0xd59547);if(_0x515fd3){for(var _0x53f009 in _0x515fd3){if(_0x515fd3[_0x8a66('0x7b')](_0x53f009)){this['channel']['setVariable'](util[_0x8a66('0x27')](_0x8a66('0xd0'),_0x53f009[_0x8a66('0xd1')]()),_0x515fd3[_0x53f009]);}}this[_0x8a66('0x44')](_0x515fd3['speech'],'out');if(_0x515fd3[_0x8a66('0xd2')]){this[_0x8a66('0xb')][_0x8a66('0x91')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x515fd3[_0x8a66('0xd2')]));var _0x33fbc8=this[_0x8a66('0xb')][_0x8a66('0xd3')](_0x515fd3['audiofile']);try{fs['unlink'](_0x515fd3[_0x8a66('0xd2')]+_0x8a66('0xd4'));}catch(_0x4c58e5){logger[_0x8a66('0x2b')](_0x4c58e5);}return _0x33fbc8;}else{return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0xd5'),_0x515fd3[_0x8a66('0xc2')]));}}return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0xd59547,_0x8a66('0xd6'));};AGIVertices['prototype'][_0x8a66('0xd7')]=function(_0x3f7e94){logger['info'](util['format'](_0x8a66('0xd8'),_0x3f7e94[_0x8a66('0x39')]));return this[_0x8a66('0xb')][_0x8a66('0x91')]('end');};AGIVertices[_0x8a66('0xd')][_0x8a66('0xd9')]=function(_0x5f2fa5){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5f2fa5[_0x8a66('0x39')]));var _0xda8fe8='';if(_0x5f2fa5[_0x8a66('0xda')]){if(!this[_0x8a66('0x66')](_0x5f2fa5[_0x8a66('0xda')])){return this['channel'][_0x8a66('0x2b')](_0x5f2fa5,_0x8a66('0xdb'));}else{var _0x5c7cbe=parseInt(_0x5f2fa5['trunk_id'],0xa);if(isNaN(_0x5c7cbe)){_0xda8fe8=_0x5f2fa5[_0x8a66('0xda')];}else{_0xda8fe8=this[_0x8a66('0x1b')][_0x8a66('0x85')](this,_0x5f2fa5[_0x8a66('0xda')]);if(!_0xda8fe8){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x5f2fa5,_0x8a66('0xdc'));}}}}else if(_0x5f2fa5[_0x8a66('0xdd')]){_0xda8fe8=_0x5f2fa5[_0x8a66('0xdd')];}else{return this['channel'][_0x8a66('0x2b')](_0x5f2fa5,_0x8a66('0xdb'));}var _0xe5f366=this[_0x8a66('0xb')]['exec']('DIAL',[util[_0x8a66('0x27')]('SIP/%s/%s',_0xda8fe8,_0x5f2fa5['phone']),_0x5f2fa5[_0x8a66('0x8b')],_0x5f2fa5['opts'],_0x5f2fa5['url']]);if(_0xe5f366[_0x8a66('0x82')]===-0x1){return _0xe5f366;}return this['channel'][_0x8a66('0x91')](util['format']('Executed\x20command\x20%s',_0x8a66('0xbb')));};AGIVertices[_0x8a66('0xd')][_0x8a66('0xde')]=function(_0x27b446){logger['info'](util[_0x8a66('0x27')](_0x8a66('0xdf'),_0x27b446[_0x8a66('0x39')]));return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xde'));};AGIVertices[_0x8a66('0xd')][_0x8a66('0xe0')]=function(_0x40d504){logger['info'](util[_0x8a66('0x27')](_0x8a66('0xe1'),_0x40d504['label']));if(_0x40d504[_0x8a66('0x86')]===0x0){return this[_0x8a66('0x84')](_0x40d504);}_0x40d504[_0x8a66('0x86')]-=0x1;if(!this['isConfigured'](_0x40d504[_0x8a66('0xe2')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x40d504,'no\x20file\x20audio\x20selected');}var _0x53b5c7=this['getSound'][_0x8a66('0x85')](this,_0x40d504[_0x8a66('0xe2')]);if(!_0x53b5c7){return this['channel'][_0x8a66('0x2b')](_0x40d504,'no\x20file\x20audio\x20found');}if(!this[_0x8a66('0x66')](_0x40d504[_0x8a66('0xb2')])){return this['channel'][_0x8a66('0x2b')](_0x8a66('0xb3'));}var _0x32f0f9=this[_0x8a66('0xb')][_0x8a66('0xe3')](_0x53b5c7,_0x40d504['response'],_0x40d504[_0x8a66('0xe4')]);var _0x540ea2=_0x32f0f9[_0x8a66('0x82')]?_0x32f0f9[_0x8a66('0x82')]['toString']():'';logger[_0x8a66('0x2d')](_0x8a66('0xe5'),JSON['stringify'](_0x32f0f9));if(_0x32f0f9[_0x8a66('0x82')]===-0x1){this[_0x8a66('0x37')][_0x8a66('0x85')](this,_0x40d504,_0x540ea2);return _0x32f0f9;}else if(_0x32f0f9[_0x8a66('0x81')]===_0x8a66('0x8b')){_0x32f0f9[_0x8a66('0x82')]=_0x540ea2[_0x8a66('0x7f')]>=parseInt(_0x40d504[_0x8a66('0xe6')])?'x':'i';}else{_0x32f0f9[_0x8a66('0x82')]=_0x540ea2[_0x8a66('0x7f')]>=parseInt(_0x40d504[_0x8a66('0xe6')])&&_0x540ea2[_0x8a66('0x7f')]<=parseInt(_0x40d504['maxdigit'])?'x':'i';}var _0x3e5068=this[_0x8a66('0xe')][_0x8a66('0x85')](this,_0x40d504[_0x8a66('0xb2')]);if(!_0x3e5068){return this[_0x8a66('0xb')]['error'](_0x40d504,_0x8a66('0xb4'));}this['channel'][_0x8a66('0x83')](_0x3e5068,_0x540ea2);if(this[_0x8a66('0x66')](_0x40d504[_0x8a66('0xe7')])){var _0x54225c=parseInt(_0x40d504['hiddendigitsnum'],0xa);var _0x286c5a=rs[_0x8a66('0xe8')]({'charset':'*','length':_0x54225c});var _0x536152=_0x540ea2['length'];if(_0x536152>0x0){if(_0x536152>_0x54225c){this['createSquareDetailsReport'][_0x8a66('0x85')](this,_0x40d504,_0x40d504[_0x8a66('0xe9')]==='first'?_0x286c5a+_0x540ea2['substr'](_0x54225c):_0x540ea2['substr'](0x0,_0x536152-_0x54225c)+_0x286c5a);}else{this['createSquareDetailsReport'][_0x8a66('0x85')](this,_0x40d504,rs[_0x8a66('0xe8')]({'charset':'*','length':_0x536152}));}}else{this[_0x8a66('0x37')][_0x8a66('0x85')](this,_0x40d504,'');}}else{this[_0x8a66('0x37')][_0x8a66('0x85')](this,_0x40d504,_0x540ea2);}return _0x32f0f9;};AGIVertices[_0x8a66('0xd')]['getsecretdigits']=function(_0x48ec42){logger['info'](util[_0x8a66('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x48ec42[_0x8a66('0x39')]));return this[_0x8a66('0xe0')](_0x48ec42);};AGIVertices[_0x8a66('0xd')]['goal']=function(_0x27a30d){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0xea'),_0x27a30d[_0x8a66('0x39')]));this['createSquareDetailsReport'][_0x8a66('0x85')](this,_0x27a30d,_0x27a30d['goalname']);return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0xeb'),_0x27a30d[_0x8a66('0xec')]));};AGIVertices['prototype']['awspolly']=function(_0x433dc1){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0xed'),_0x433dc1[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x433dc1[_0x8a66('0x69')])||!this['isConfigured'](_0x433dc1[_0x8a66('0x6f')])){return this[_0x8a66('0xb')][_0x8a66('0x91')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8a66('0x66')](_0x433dc1[_0x8a66('0x5d')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0x9c'));}this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x433dc1[_0x8a66('0x5d')]));var _0x38253f=this[_0x8a66('0x68')][_0x8a66('0x85')](this,_0x433dc1);if(_0x38253f){this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0xee'),_0x38253f));var _0x1e013b=this[_0x8a66('0xb')][_0x8a66('0xd3')](_0x38253f);try{fs[_0x8a66('0xef')](_0x38253f+_0x8a66('0xd4'));}catch(_0x44c9ff){logger[_0x8a66('0x2b')](_0x44c9ff);}return _0x1e013b;}return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x433dc1,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x8a66('0xd')]['awslex']=function(_0x58dd54){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0xf0'),_0x58dd54[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x58dd54[_0x8a66('0x69')])||!this[_0x8a66('0x66')](_0x58dd54[_0x8a66('0x6f')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xf1'));}if(!this[_0x8a66('0x66')](_0x58dd54[_0x8a66('0x71')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xf2'));}if(!this['isConfigured'](_0x58dd54['text'])){return this['channel'][_0x8a66('0x91')](_0x8a66('0x9c'));}this[_0x8a66('0xb')][_0x8a66('0xcd')]=!![];this[_0x8a66('0x37')](_0x58dd54);this['createSquareMessage'](_0x58dd54[_0x8a66('0x5d')],'in');this['channel']['noop'](util[_0x8a66('0x27')](_0x8a66('0xf3'),_0x58dd54[_0x8a66('0x5d')]));var _0x2cf003=this['awsLex']['sync'](this,_0x58dd54);if(_0x2cf003){for(var _0x264742 in _0x2cf003){if(_0x2cf003[_0x8a66('0x7b')](_0x264742)&&_[_0x8a66('0x7c')](_0x2cf003[_0x264742])){this[_0x8a66('0xb')]['setVariable'](util[_0x8a66('0x27')]('AWS_LEX_%s',_0x264742[_0x8a66('0xd1')]()),_0x2cf003[_0x264742]);}}if(_[_0x8a66('0x47')](_0x2cf003[_0x8a66('0xf4')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xf5'));}else{this[_0x8a66('0x44')](_0x2cf003[_0x8a66('0xf4')],_0x8a66('0xf6'));return this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0xf7'),_0x2cf003[_0x8a66('0xf4')]));}}return this[_0x8a66('0xb')]['error'](_0x58dd54,_0x8a66('0xf8'));};AGIVertices[_0x8a66('0xd')][_0x8a66('0xf9')]=function(_0x2f4dbf){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0xfa'),_0x2f4dbf[_0x8a66('0x39')],_0x2f4dbf[_0x8a66('0x8b')]));if(!this[_0x8a66('0x66')](_0x2f4dbf['key'])){return this['channel'][_0x8a66('0x91')](_0x8a66('0xc0'));}var _0x1e576b=_0x8a66('0xfb');var _0x22d756=util['format'](_0x8a66('0xfc'),FILES_PATH,rs[_0x8a66('0xe8')](0x4));var _0x148bbc=util[_0x8a66('0x27')]('%s.%s',_0x22d756,_0x1e576b);var _0x1bb941=!![];if(_0x2f4dbf[_0x8a66('0xfd')]==='NOBEEP'){_0x1bb941=![];}var _0x3e2e84=this['channel'][_0x8a66('0xfe')](_0x22d756,_0x1e576b,_0x2f4dbf[_0x8a66('0xff')],_0x2f4dbf[_0x8a66('0x8b')],undefined,_0x1bb941);if(_0x3e2e84['result']!==-0x1){this[_0x8a66('0xb')][_0x8a66('0x91')](util['format'](_0x8a66('0x100'),_0x148bbc));var _0x350545=this[_0x8a66('0x72')]['sync'](this,_0x2f4dbf,_0x148bbc);if(_0x350545){for(var _0x472ada in _0x350545){if(_0x350545[_0x8a66('0x7b')](_0x472ada)){this[_0x8a66('0xb')][_0x8a66('0x83')](util['format'](_0x8a66('0x101'),_0x472ada[_0x8a66('0xd1')]()),_0x350545[_0x472ada]);}}return this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x102'),JSON[_0x8a66('0x103')](_0x350545)));}}return _0x3e2e84;};AGIVertices['prototype']['tildeasr']=function(_0xdbfa2a){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0x104'),_0xdbfa2a[_0x8a66('0x39')]));if(!this['isConfigured'](_0xdbfa2a[_0x8a66('0x75')])){return this['channel'][_0x8a66('0x91')]('no\x20appid\x20configured');}if(!this[_0x8a66('0x66')](_0xdbfa2a[_0x8a66('0x76')])){return this['channel'][_0x8a66('0x91')](_0x8a66('0x105'));}var _0x59c0cc='wav';var _0x2b3d20=util[_0x8a66('0x27')](_0x8a66('0xfc'),FILES_PATH,rs[_0x8a66('0xe8')](0x4));var _0x197ceb=util[_0x8a66('0x27')](_0x8a66('0x106'),_0x2b3d20,_0x59c0cc);var _0x336d9c=!![];if(_0xdbfa2a[_0x8a66('0xfd')]===_0x8a66('0x107')){_0x336d9c=![];}var _0x5247ae=this['channel'][_0x8a66('0xfe')](_0x2b3d20,_0x59c0cc,_0xdbfa2a[_0x8a66('0xff')],_0xdbfa2a[_0x8a66('0x8b')],undefined,_0x336d9c);if(_0x5247ae['result']!==-0x1){this[_0x8a66('0xb')][_0x8a66('0x91')](util['format'](_0x8a66('0x108'),_0x197ceb));var _0x3a9b1f=this[_0x8a66('0x74')][_0x8a66('0x85')](this,_0xdbfa2a,_0x197ceb);if(_0x3a9b1f){for(var _0x29f809 in _0x3a9b1f){if(_0x3a9b1f['hasOwnProperty'](_0x29f809)){this[_0x8a66('0xb')]['setVariable'](util['format'](_0x8a66('0x109'),_0x29f809[_0x8a66('0xd1')]()),_0x3a9b1f[_0x29f809]);}}return this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x10a'),JSON[_0x8a66('0x103')](_0x3a9b1f)));}}return _0x5247ae;};AGIVertices[_0x8a66('0xd')][_0x8a66('0x10b')]=function(_0x4a2847){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x10c'),_0x4a2847['label']));return this[_0x8a66('0xb')][_0x8a66('0x10d')](_0x4a2847['context'],_0x4a2847[_0x8a66('0x40')],_0x4a2847[_0x8a66('0x10e')]);};AGIVertices['prototype'][_0x8a66('0x10f')]=function(_0x4476fc){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4476fc[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x4476fc['condition'])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x4476fc,'no\x20condition\x20configured');}try{var _0x59cc33=eval(_0x4476fc[_0x8a66('0x110')])?'true':_0x8a66('0x111');this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x112'),_0x4476fc[_0x8a66('0x110')],_0x59cc33));return{'code':0xc8,'result':_0x59cc33};}catch(_0x50c107){return{'code':0xc8,'result':_0x8a66('0x111')};}};AGIVertices['prototype'][_0x8a66('0x113')]=function(_0xcf5252){logger['info'](util[_0x8a66('0x27')](_0x8a66('0x114'),_0xcf5252[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0xcf5252[_0x8a66('0x115')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0xcf5252,_0x8a66('0x116'));}var _0x271af6=this[_0x8a66('0x23')][_0x8a66('0x85')](this,_0xcf5252[_0x8a66('0x115')]);if(!_0x271af6){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0xcf5252,'no\x20intervals\x20found');}for(var _0x3454a2=0x0;_0x3454a2<_0x271af6[_0x8a66('0x7f')];_0x3454a2+=0x1){var _0x231a47=this[_0x8a66('0xb')][_0x8a66('0xe')](util[_0x8a66('0x27')](_0x8a66('0x117'),_0x271af6[_0x3454a2]));if(_0x231a47[_0x8a66('0x82')]===-0x1){return _0x231a47;}logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x118'),_0x271af6[_0x3454a2],_0x231a47[_0x8a66('0x81')]));if(_0x231a47[_0x8a66('0x81')]===_0x8a66('0x119')){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('IFTIME\x20%s\x20%s',_0x271af6[_0x3454a2],'true'));this['channel']['noop'](util['format'](_0x8a66('0x118'),_0x271af6[_0x3454a2],_0x8a66('0x119')));return{'code':0xc8,'result':_0x8a66('0x119')};}else{logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('IFTIME\x20%s\x20%s',_0x271af6[_0x3454a2],_0x8a66('0x111')));this[_0x8a66('0xb')]['noop'](util[_0x8a66('0x27')](_0x8a66('0x118'),_0x271af6[_0x3454a2],_0x8a66('0x111')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x8a66('0xd')][_0x8a66('0x11a')]=function(_0x368878){logger['info'](util[_0x8a66('0x27')](_0x8a66('0x11b'),_0x368878[_0x8a66('0x39')]));return this[_0x8a66('0xb')][_0x8a66('0x11a')]();};AGIVertices[_0x8a66('0xd')][_0x8a66('0x11c')]=function(_0x1cff66){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0x11d'),_0x1cff66[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x1cff66['key'])){return this['channel'][_0x8a66('0x91')](_0x8a66('0xc0'));}var _0x58827f='wav';var _0x1eb50b=util[_0x8a66('0x27')](_0x8a66('0xfc'),FILES_PATH,rs[_0x8a66('0xe8')](0x4));var _0x344471=util[_0x8a66('0x27')]('%s.%s',_0x1eb50b,_0x58827f);var _0x25001f=!![];if(_0x1cff66[_0x8a66('0xfd')]===_0x8a66('0x107')){_0x25001f=![];}var _0x5bfcba=this['channel'][_0x8a66('0xfe')](_0x1eb50b,_0x58827f,_0x1cff66['intKey'],_0x1cff66[_0x8a66('0x8b')],undefined,_0x25001f);if(_0x5bfcba[_0x8a66('0x82')]!==-0x1){this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x11e'),_0x344471));var _0x26a163=this['ispeechASR'][_0x8a66('0x85')](this,_0x1cff66,_0x344471);if(_0x26a163){for(var _0x3dce31 in _0x26a163){if(_0x26a163[_0x8a66('0x7b')](_0x3dce31)){this[_0x8a66('0xb')][_0x8a66('0x83')](util[_0x8a66('0x27')]('ISPEECH_ASR_%s',_0x3dce31[_0x8a66('0xd1')]()),_0x26a163[_0x3dce31]);}}return this[_0x8a66('0xb')]['noop'](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x8a66('0x103')](_0x26a163)));}}return _0x5bfcba;};AGIVertices[_0x8a66('0xd')]['ispeechtts']=function(_0x1c4d53){logger['info'](util[_0x8a66('0x27')](_0x8a66('0x11f'),_0x1c4d53[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x1c4d53[_0x8a66('0x60')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xc0'));}if(!this[_0x8a66('0x66')](_0x1c4d53[_0x8a66('0x5d')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0x9c'));}this[_0x8a66('0xb')][_0x8a66('0x91')](util['format'](_0x8a66('0x120'),_0x1c4d53[_0x8a66('0x5d')]));var _0x5780c7=this[_0x8a66('0x61')][_0x8a66('0x85')](this,_0x1c4d53);if(_0x5780c7){this[_0x8a66('0xb')][_0x8a66('0x91')](util['format'](_0x8a66('0x11e'),_0x5780c7));var _0x4d0f4b=this[_0x8a66('0xb')][_0x8a66('0xd3')](_0x5780c7,_0x1c4d53[_0x8a66('0xff')]);try{fs[_0x8a66('0xef')](_0x5780c7+_0x8a66('0xd4'));}catch(_0x51b892){logger[_0x8a66('0x2b')](_0x51b892);}return _0x4d0f4b;}return this[_0x8a66('0xb')]['error'](_0x1c4d53,_0x8a66('0x121'));};AGIVertices[_0x8a66('0xd')][_0x8a66('0x122')]=function(_0x54e303){logger['info'](util[_0x8a66('0x27')](_0x8a66('0x123'),_0x54e303[_0x8a66('0x39')]));if(!this['isConfigured'](_0x54e303['findBy'])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x54e303,_0x8a66('0x124'));}logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x125'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x54e303[_0x8a66('0x126')]));var _0x4c6e0f=this['agentLogin']['sync'](this,_0x54e303[_0x8a66('0x126')]);if(_0x4c6e0f){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x127'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x54e303[_0x8a66('0x126')]));this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x127'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x54e303[_0x8a66('0x126')]));return{'code':0xc8,'result':_0x8a66('0x128')};}else{logger[_0x8a66('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x54e303[_0x8a66('0x126')]));this[_0x8a66('0xb')]['noop'](util['format'](_0x8a66('0x129'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x54e303[_0x8a66('0x126')]));return{'code':0xc8,'result':_0x8a66('0x12a')};}};AGIVertices[_0x8a66('0xd')][_0x8a66('0x12b')]=function(_0x125634){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x12c'),_0x125634['label']));if(!this[_0x8a66('0x66')](_0x125634['findBy'])){return this['channel'][_0x8a66('0x2b')](_0x125634,_0x8a66('0x124'));}logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x125'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x125634['findBy']));var _0x256f96=this[_0x8a66('0x56')][_0x8a66('0x85')](this,_0x125634['findBy']);if(_0x256f96){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x125634[_0x8a66('0x126')]));this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x127'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x125634[_0x8a66('0x126')]));return{'code':0xc8,'result':_0x8a66('0x128')};}else{logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x129'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x125634[_0x8a66('0x126')]));this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x129'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x125634[_0x8a66('0x126')]));return{'code':0xc8,'result':_0x8a66('0x12a')};}};AGIVertices[_0x8a66('0xd')]['math']=function(_0xbbbe88){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x12d'),_0xbbbe88[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0xbbbe88[_0x8a66('0x12e')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0xbbbe88,_0x8a66('0x12f'));}this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x130'),_0xbbbe88['operation']));var _0x44f361=eval(_0xbbbe88[_0x8a66('0x12e')]);if(!this[_0x8a66('0x66')](_0xbbbe88[_0x8a66('0xb2')])){return this[_0x8a66('0xb')]['noop'](_0x8a66('0xb3'));}var _0x1ca213=this[_0x8a66('0xe')][_0x8a66('0x85')](this,_0xbbbe88[_0x8a66('0xb2')]);if(!_0x1ca213){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0xbbbe88,_0x8a66('0xb4'));}if(_[_0x8a66('0x131')](_0x44f361)){var _0x54f254=this;_0x44f361[_0x8a66('0xb5')](function(_0x4b353d,_0xa07be){_0x54f254['channel'][_0x8a66('0x83')](util[_0x8a66('0x27')](_0x8a66('0x132'),_0x1ca213,_0xa07be),_0x4b353d);});return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x133'),_0x1ca213));}else{return this['channel'][_0x8a66('0x83')](_0x1ca213,_0x44f361);}};AGIVertices[_0x8a66('0xd')]['menu']=function(_0x2a5e49){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x134'),_0x2a5e49[_0x8a66('0x39')]));if(_0x2a5e49[_0x8a66('0x86')]===0x0){return this[_0x8a66('0x84')](_0x2a5e49);}_0x2a5e49['retry']-=0x1;if(!this['isConfigured'](_0x2a5e49[_0x8a66('0xe2')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x2a5e49,_0x8a66('0x135'));}var _0xed30b3=this[_0x8a66('0x1c')][_0x8a66('0x85')](this,_0x2a5e49[_0x8a66('0xe2')]);if(!_0xed30b3){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x2a5e49,_0x8a66('0x136'));}var _0x582d9a=this[_0x8a66('0xb')]['getData'](_0xed30b3,_0x2a5e49[_0x8a66('0x137')],_0x2a5e49[_0x8a66('0x138')]);var _0x144857=_0x582d9a[_0x8a66('0x82')];if(_0x582d9a[_0x8a66('0x82')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x2a5e49,'-1');return _0x582d9a;}else if(_0x582d9a['extra']==='timeout'){_0x582d9a['result']=_0x582d9a[_0x8a66('0x82')][_0x8a66('0x7f')]>0x0?_0x582d9a[_0x8a66('0x82')]:'t';}else if(_['isEmpty'](_0x582d9a[_0x8a66('0x82')])){_0x582d9a[_0x8a66('0x82')]='#';_0x144857='#';}if(!this[_0x8a66('0x66')](_0x2a5e49[_0x8a66('0xb2')])){this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0xb3'));}else{var _0x3c6eda=this['getVariable'][_0x8a66('0x85')](this,_0x2a5e49[_0x8a66('0xb2')]);if(!_0x3c6eda){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x2a5e49,_0x8a66('0xb4'));}this['channel'][_0x8a66('0x83')](_0x3c6eda,_0x144857);}this['createSquareDetailsReport']['sync'](this,_0x2a5e49,_0x144857);return _0x582d9a;};AGIVertices[_0x8a66('0xd')][_0x8a66('0x91')]=function(_0xb19d76){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x139'),_0xb19d76[_0x8a66('0x39')]));return this[_0x8a66('0xb')][_0x8a66('0x91')](_0xb19d76[_0x8a66('0x13a')]||_0xb19d76['label']);};AGIVertices[_0x8a66('0xd')][_0x8a66('0x13b')]=function(_0x348d9e){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x13c'),_0x348d9e['label']));if(!this[_0x8a66('0x66')](_0x348d9e['findBy'])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x348d9e,_0x8a66('0x124'));}logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x348d9e[_0x8a66('0x126')]));var _0x1c418f=this[_0x8a66('0x51')]['sync'](this,_0x348d9e[_0x8a66('0x13d')]);var _0x35c621=this[_0x8a66('0x53')]['sync'](this,_0x348d9e[_0x8a66('0x126')],_0x1c418f);if(_0x35c621){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x8a66('0xb')]['callerid'],_0x348d9e[_0x8a66('0x126')]));this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x127'),this[_0x8a66('0xb')]['callerid'],_0x348d9e[_0x8a66('0x126')]));return{'code':0xc8,'result':_0x8a66('0x128')};}else{logger['info'](util[_0x8a66('0x27')](_0x8a66('0x129'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x348d9e['findBy']));this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x127'),this[_0x8a66('0xb')]['callerid'],_0x348d9e[_0x8a66('0x126')]));return{'code':0xc8,'result':_0x8a66('0x12a')};}};AGIVertices[_0x8a66('0xd')][_0x8a66('0x13e')]=function(_0x1859e7){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x13f'),_0x1859e7[_0x8a66('0x39')]));if(!this['isConfigured'](_0x1859e7['file_id'])){return this['channel'][_0x8a66('0x2b')](_0x1859e7,'no\x20file\x20audio\x20selected');}var _0x169e49=this[_0x8a66('0x1c')][_0x8a66('0x85')](this,_0x1859e7['file_id']);if(!_0x169e49){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x1859e7,_0x8a66('0x136'));}var _0x435a68=this[_0x8a66('0xb')][_0x8a66('0x94')](_0x8a66('0x140'),[_0x169e49,_0x1859e7[_0x8a66('0xbd')]]);if(_0x435a68[_0x8a66('0x82')]===-0x1){return _0x435a68;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util['format'](_0x8a66('0x141'),'PLAYBACK',_0x169e49));};AGIVertices[_0x8a66('0xd')][_0x8a66('0x142')]=function(_0x110ec4){logger['info'](util[_0x8a66('0x27')](_0x8a66('0x143'),_0x110ec4['label']));if(!this[_0x8a66('0x66')](_0x110ec4[_0x8a66('0x144')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x110ec4,'no\x20queue\x20selected');}var _0x41b3f5='';var _0x172bab=parseInt(_0x110ec4[_0x8a66('0x144')],0xa);if(isNaN(_0x172bab)){_0x41b3f5=_0x110ec4[_0x8a66('0x144')];}else{_0x41b3f5=this[_0x8a66('0x13')][_0x8a66('0x85')](this,_0x110ec4[_0x8a66('0x144')]);if(!_0x41b3f5){return this['channel'][_0x8a66('0x2b')](_0x110ec4,_0x8a66('0x145'));}}var _0x50def3='';if(this[_0x8a66('0x66')](_0x110ec4[_0x8a66('0xe2')])){var _0xbf7cf5=this[_0x8a66('0x1c')]['sync'](this,_0x110ec4[_0x8a66('0xe2')]);if(_0xbf7cf5){_0x50def3=_0xbf7cf5;}}this[_0x8a66('0x37')]['sync'](this,_0x110ec4,_0x41b3f5);if(_0x110ec4['opts']['indexOf']('x')<0x0){_0x110ec4[_0x8a66('0xbd')]+='x';}if(_0x110ec4[_0x8a66('0xbd')][_0x8a66('0x146')]('X')<0x0){_0x110ec4[_0x8a66('0xbd')]+='X';}this[_0x8a66('0xb')][_0x8a66('0x83')]('XMCS-QUEUE',_0x41b3f5?_0x41b3f5[_0x8a66('0x147')]():'');var _0x5d96f2=this[_0x8a66('0xb')][_0x8a66('0x94')](_0x8a66('0x148'),[_0x41b3f5,_0x110ec4[_0x8a66('0xbd')],_0x110ec4[_0x8a66('0x149')],_0x50def3,_0x110ec4[_0x8a66('0x8b')],_0x110ec4[_0x8a66('0x5')],_0x110ec4[_0x8a66('0x14a')],_0x110ec4['gosub'],'',_0x110ec4[_0x8a66('0x14b')]]);if(_0x5d96f2[_0x8a66('0x82')]===-0x1){return _0x5d96f2;}return this['channel'][_0x8a66('0x91')](util['format'](_0x8a66('0x141'),_0x8a66('0x148'),_0x41b3f5));};AGIVertices['prototype']['record']=function(_0x5985b5){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0x14c'),_0x5985b5[_0x8a66('0x39')]));var _0x565ead=_0x5985b5[_0x8a66('0x14d')]||'wav';var _0x2d4766=util[_0x8a66('0x27')](_0x8a66('0x14e'),this[_0x8a66('0xb')][_0x8a66('0x38')],rs['generate'](0x5));var _0x49855c=util[_0x8a66('0x27')](_0x8a66('0x14f'),FILES_PATH,_0x2d4766,_0x565ead);var _0x5ce5a9=util['format'](_0x8a66('0xfc'),FILES_PATH,_0x2d4766);this[_0x8a66('0x3d')][_0x8a66('0x85')](this,_0x5985b5,_0x2d4766,_0x49855c);this[_0x8a66('0xb')][_0x8a66('0x83')](_0x8a66('0x150'),_0x2d4766);logger[_0x8a66('0x2d')](_0x8a66('0x151'),_0x5ce5a9,_0x565ead,_0x5985b5[_0x8a66('0x152')],_0x5985b5[_0x8a66('0x8b')]);return this[_0x8a66('0xb')]['recordFile'](_0x5ce5a9,_0x565ead,_0x5985b5['escape_digits'],_0x5985b5['timeout'],undefined,!![]);};AGIVertices[_0x8a66('0xd')][_0x8a66('0x153')]=function(_0x4a8e60){logger['info'](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x4a8e60[_0x8a66('0x39')]));return this[_0x8a66('0xb')][_0x8a66('0x154')](_0x4a8e60[_0x8a66('0x155')]['replace'](/\s+/g,''),_0x4a8e60[_0x8a66('0x152')]);};AGIVertices['prototype'][_0x8a66('0x156')]=function(_0x197d92){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0x157'),_0x197d92[_0x8a66('0x39')]));return this['channel'][_0x8a66('0x158')](_0x197d92[_0x8a66('0x159')][_0x8a66('0xb0')](/\s+/g,''),_0x197d92[_0x8a66('0x152')]);};AGIVertices['prototype'][_0x8a66('0x15a')]=function(_0x5aec6d){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x15b'),_0x5aec6d[_0x8a66('0x39')]));return this['channel'][_0x8a66('0x15c')](_0x5aec6d[_0x8a66('0x5d')],_0x5aec6d[_0x8a66('0x152')]);};AGIVertices[_0x8a66('0xd')][_0x8a66('0x15d')]=function(_0x3adda2){logger['info'](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3adda2[_0x8a66('0x39')]));if(!this['isConfigured'](_0x3adda2[_0x8a66('0x15e')])){return this['channel']['noop'](_0x8a66('0x15f'));}var _0xdcf22=this['getMailAccount'][_0x8a66('0x85')](this,_0x3adda2[_0x8a66('0x15e')]);if(!_0xdcf22||!_0xdcf22[_0x8a66('0x160')]){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x3adda2,_0x8a66('0x161'));}var _0x34733f={'from':util[_0x8a66('0x27')](_0x8a66('0x162'),_0xdcf22['name'],_0xdcf22[_0x8a66('0x163')]||_0xdcf22['Smtp'][_0x8a66('0x164')]),'to':_0x3adda2['to']||'','cc':_0x3adda2['cc']||'','bcc':_0x3adda2[_0x8a66('0x165')]||'','subject':_0x3adda2[_0x8a66('0x166')],'html':_0x3adda2[_0x8a66('0x5d')],'text':_0x3adda2[_0x8a66('0x5d')]};var _0x1b38ea={'tls':{'rejectUnauthorized':![]}};if(_0xdcf22[_0x8a66('0x160')][_0x8a66('0x167')]){_0x1b38ea[_0x8a66('0x167')]=_0xdcf22[_0x8a66('0x160')][_0x8a66('0x167')];}else{_0x1b38ea[_0x8a66('0x168')]=_0xdcf22['Smtp']['host'];_0x1b38ea['port']=_0xdcf22[_0x8a66('0x160')]['port'];_0x1b38ea[_0x8a66('0x169')]=_0xdcf22[_0x8a66('0x160')][_0x8a66('0x169')];}if(_0xdcf22['Smtp'][_0x8a66('0x16a')]){_0x1b38ea['auth']={'user':_0xdcf22[_0x8a66('0x160')][_0x8a66('0x164')],'pass':_0xdcf22[_0x8a66('0x160')]['pass']};}if(this[_0x8a66('0x66')](_0x3adda2[_0x8a66('0x16b')])){}logger[_0x8a66('0xb8')]('sendMail\x20message',JSON[_0x8a66('0x103')](_0x34733f));this[_0x8a66('0x37')][_0x8a66('0x85')](this,_0x3adda2,_0x3adda2[_0x8a66('0x15e')]);this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x16c'),_0xdcf22[_0x8a66('0x15')]));this[_0x8a66('0x22')][_0x8a66('0x85')](this,_0x1b38ea,_0x34733f);return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0x16d'));};AGIVertices[_0x8a66('0xd')][_0x8a66('0x16e')]=function(_0x4382aa){logger['info'](util[_0x8a66('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4382aa['label']));return this[_0x8a66('0xb')]['noop'](_0x8a66('0x16f'));};AGIVertices['prototype'][_0x8a66('0x170')]=function(_0xc78e13){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x171'),_0xc78e13[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0xc78e13['sms_account_id'])){return this[_0x8a66('0xb')]['noop']('no\x20sms\x20account\x20configured');}var _0x247d42=this[_0x8a66('0x34')][_0x8a66('0x85')](this,_0xc78e13['sms_account_id']);if(!_0x247d42){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0xc78e13,'no\x20sms\x20account\x20found');}var _0x23f5d3={'body':_0xc78e13[_0x8a66('0x172')],'phone':_0xc78e13['to']||'','SmsAccountId':_0x247d42['id']};logger['debug']('sendSMS\x20message',JSON[_0x8a66('0x103')](_0x23f5d3));this[_0x8a66('0x37')][_0x8a66('0x85')](this,_0xc78e13,_0xc78e13['sms_account_id']);this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x173'),_0x247d42[_0x8a66('0x15')]));this[_0x8a66('0x36')][_0x8a66('0x85')](this,_0x23f5d3);return this[_0x8a66('0xb')][_0x8a66('0x91')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x8a66('0xd')][_0x8a66('0x174')]=function(_0x58b623){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x58b623[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x58b623['variable_id'])){return this['channel'][_0x8a66('0x2b')](_0x58b623,_0x8a66('0x175'));}var _0x404f60=this[_0x8a66('0xe')][_0x8a66('0x85')](this,_0x58b623[_0x8a66('0xb2')]);if(!_0x404f60){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x58b623,_0x8a66('0xb4'));}return this[_0x8a66('0xb')][_0x8a66('0x83')](_0x404f60,_0x58b623[_0x8a66('0x176')]);};AGIVertices[_0x8a66('0xd')]['start']=function(_0x3dbd48){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x177'),_0x3dbd48[_0x8a66('0x39')]));this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0x178'));if(_0x3dbd48[_0x8a66('0x89')]===_0x8a66('0x179')){this[_0x8a66('0xb')]['noop'](_0x8a66('0x17a'));return this[_0x8a66('0xb')][_0x8a66('0x89')]();}return this['channel']['noop'](_0x8a66('0x17b'));};AGIVertices[_0x8a66('0xd')][_0x8a66('0x17c')]=function(_0x291341){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x17d'),_0x291341[_0x8a66('0x39')]));if(!this['isConfigured'](_0x291341[_0x8a66('0x17e')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x291341,_0x8a66('0x17f'));}var _0x590b20=this['getSquareProject']['sync'](this,_0x291341[_0x8a66('0x17e')]);if(!this[_0x8a66('0x66')](_0x590b20)){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x291341,util[_0x8a66('0x27')](_0x8a66('0x180'),_0x291341[_0x8a66('0x17e')]));}if(_0x590b20===this['channel'][_0x8a66('0x3b')]){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x291341,_0x8a66('0x181'));}this['createSquareDetailsReport'][_0x8a66('0x85')](this,_0x291341,_0x590b20);var _0x46b739=this[_0x8a66('0xb')]['exec']('AGI',util[_0x8a66('0x27')](_0x8a66('0x182'),config[_0x8a66('0x5')][_0x8a66('0x168')]||_0x8a66('0x183'),_0x590b20,this[_0x8a66('0xb')]['arg_1']));if(_0x46b739['result']===-0x1){return _0x46b739;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x141'),_0x8a66('0x184'),_0x590b20));};AGIVertices[_0x8a66('0xd')]['system']=function(_0x34702f){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x185'),_0x34702f[_0x8a66('0x39')]));var _0x45eaeb=this[_0x8a66('0x5b')][_0x8a66('0x85')](this,_0x34702f[_0x8a66('0x186')]);this[_0x8a66('0x37')][_0x8a66('0x85')](this,_0x34702f,_0x34702f[_0x8a66('0x186')]);if(this[_0x8a66('0x66')](_0x34702f[_0x8a66('0xb2')])){var _0x383ab1=this['getVariable'][_0x8a66('0x85')](this,_0x34702f['variable_id']);if(_0x383ab1){this[_0x8a66('0xb')][_0x8a66('0x83')](_0x383ab1,_0x45eaeb);return this[_0x8a66('0xb')]['noop'](util[_0x8a66('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x34702f[_0x8a66('0x186')],_0x383ab1));}}return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x187'),_0x34702f[_0x8a66('0x186')]));};AGIVertices[_0x8a66('0xd')]['tts']=function(_0x17a6c2){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x17a6c2['label']));if(!this['isConfigured'](_0x17a6c2[_0x8a66('0x5d')])){return this[_0x8a66('0xb')][_0x8a66('0x91')](_0x8a66('0x9c'));}this['channel']['noop'](util[_0x8a66('0x27')](_0x8a66('0x188'),_0x17a6c2[_0x8a66('0x5d')]));var _0x10fdee=this[_0x8a66('0x5c')][_0x8a66('0x85')](this,_0x17a6c2);if(_0x10fdee){this['channel'][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x189'),_0x10fdee));var _0x28248c=this[_0x8a66('0xb')][_0x8a66('0xd3')](_0x10fdee);try{fs[_0x8a66('0xef')](_0x10fdee+_0x8a66('0xd4'));}catch(_0x2941eb){logger[_0x8a66('0x2b')](_0x2941eb);}return _0x28248c;}return this[_0x8a66('0xb')]['error'](_0x17a6c2,_0x8a66('0x18a'));};AGIVertices[_0x8a66('0xd')][_0x8a66('0x18b')]=function(_0x3c7cc1){logger[_0x8a66('0x2d')](util[_0x8a66('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3c7cc1[_0x8a66('0x39')]));if(!this['isConfigured'](_0x3c7cc1[_0x8a66('0x126')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x3c7cc1,_0x8a66('0x124'));}logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x125'),this['channel']['callerid'],_0x3c7cc1['findBy']));var _0xab2867=this['agentUnpause'][_0x8a66('0x85')](this,_0x3c7cc1['findBy']);if(_0xab2867){logger['info'](util['format'](_0x8a66('0x127'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x3c7cc1[_0x8a66('0x126')]));this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x127'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x3c7cc1[_0x8a66('0x126')]));return{'code':0xc8,'result':_0x8a66('0x128')};}else{logger[_0x8a66('0x2d')](util[_0x8a66('0x27')](_0x8a66('0x129'),this[_0x8a66('0xb')][_0x8a66('0x3c')],_0x3c7cc1[_0x8a66('0x126')]));this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')](_0x8a66('0x129'),this['channel']['callerid'],_0x3c7cc1[_0x8a66('0x126')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8a66('0xd')][_0x8a66('0x18c')]=function(_0x47d302){logger['info'](util[_0x8a66('0x27')](_0x8a66('0x18d'),_0x47d302[_0x8a66('0x39')]));var _0x10dbbe=this['channel']['exec']('VOICEMAIL',[_0x47d302['mailbox'],_0x47d302['options']]);if(_0x10dbbe['result']===-0x1){return _0x10dbbe;}return this[_0x8a66('0xb')][_0x8a66('0x91')](util[_0x8a66('0x27')]('Executed\x20command\x20%s\x20%s',_0x8a66('0x18e'),_0x47d302[_0x8a66('0x18f')]));};AGIVertices[_0x8a66('0xd')]['vswitch']=function(_0x215c30){logger[_0x8a66('0x2d')](util['format'](_0x8a66('0x190'),_0x215c30[_0x8a66('0x39')]));if(!this[_0x8a66('0x66')](_0x215c30[_0x8a66('0xb2')])){return this[_0x8a66('0xb')][_0x8a66('0x2b')](_0x215c30,'no\x20variable\x20selected');}var _0x576904=this[_0x8a66('0xe')][_0x8a66('0x85')](this,_0x215c30['variable_id']);if(!_0x576904){return this['channel']['error'](_0x215c30,_0x8a66('0xb4'));}var _0x4c17a1=this['channel'][_0x8a66('0xe')](_0x576904);return{'code':0xc8,'result':_0x4c17a1[_0x8a66('0x81')]?_0x4c17a1['extra']:'-'};};String['prototype'][_0x8a66('0x80')]=function(_0x5028cd,_0x55e379){return this[_0x8a66('0x7e')](_0x5028cd)[_0x8a66('0x191')](_0x55e379);};module[_0x8a66('0x192')]=AGIVertices;
\ No newline at end of file
+var _0x9739=['callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clone','isString','replaceAllVariables','split','length','extra','getAndSetVariable','result','maxRetry','sync','command','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','options','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','opts','url','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','hasOwnProperty','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','stringify','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','isArray','forEach','variable\x20%s[key]\x20set','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','agi','gosub','position','QUEUE','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','saydigits','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','path','util','lodash','shelljs','odbc','moment','../../config/logger','../../config/environment','/var/opt/motion2/server/files','menu','getdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getSound','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone'];(function(_0x221517,_0x43b8ab){var _0x27f2f6=function(_0x4a7801){while(--_0x4a7801){_0x221517['push'](_0x221517['shift']());}};_0x27f2f6(++_0x43b8ab);}(_0x9739,0x158));var _0x9973=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x9739[_0x3df871];return _0x570f7b;};'use strict';var fs=require('fs');var path=require(_0x9973('0x0'));var util=require(_0x9973('0x1'));var _=require(_0x9973('0x2'));var sh=require(_0x9973('0x3'));var odbc=require(_0x9973('0x4'))();var rs=require('randomstring');var moment=require(_0x9973('0x5'));var Mustache=require('mustache');var logger=require(_0x9973('0x6'))('agi');var config=require(_0x9973('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x9973('0x8');var verticesWithRetry=[_0x9973('0x9'),_0x9973('0xa'),'getsecretdigits'];var AGIVertices=function(_0x384b6c,_0x423fa7,_0x1dec29){this['channel']=_0x384b6c;this[_0x9973('0xb')]=_0x423fa7;this[_0x9973('0xc')]=_0x1dec29;};AGIVertices[_0x9973('0xd')][_0x9973('0xe')]=function(_0x280ce6,_0x556421){this[_0x9973('0xb')][_0x9973('0xf')](_0x280ce6)[_0x9973('0x10')](function(_0x4fcbd1){_0x556421(null,_0x4fcbd1?_0x4fcbd1[_0x9973('0x11')]:![]);})[_0x9973('0x12')](function(_0x344f1e){_0x556421(_0x344f1e);});};AGIVertices[_0x9973('0xd')][_0x9973('0x13')]=function(_0x1d5eaa,_0x34e538){this[_0x9973('0xb')][_0x9973('0x14')](_0x1d5eaa)[_0x9973('0x10')](function(_0x59afe2){_0x34e538(null,_0x59afe2?_0x59afe2['name']:![]);})['catch'](function(_0x3f223e){_0x34e538(_0x3f223e);});};AGIVertices[_0x9973('0xd')][_0x9973('0x15')]=function(_0x2186fa,_0x1371f8){this['rpc'][_0x9973('0x16')](_0x2186fa)[_0x9973('0x10')](function(_0x1ce8bf){_0x1371f8(null,_0x1ce8bf?_0x1ce8bf['name']:![]);})[_0x9973('0x12')](function(_0x3392fd){_0x1371f8(_0x3392fd);});};AGIVertices[_0x9973('0xd')][_0x9973('0x17')]=function(_0x39350a,_0x5bfb08){this[_0x9973('0xb')][_0x9973('0x18')](_0x39350a)['then'](function(_0x40dda8){_0x5bfb08(null,_0x40dda8?_0x40dda8['dsn']:![]);})[_0x9973('0x12')](function(_0x2c225c){_0x5bfb08(_0x2c225c);});};AGIVertices[_0x9973('0xd')][_0x9973('0x19')]=function(_0x38570f,_0x3379d6){this['rpc'][_0x9973('0x1a')](_0x38570f)['then'](function(_0x29f7d9){_0x3379d6(null,_0x29f7d9?_0x29f7d9[_0x9973('0x11')]:![]);})[_0x9973('0x12')](function(_0x13b1f8){_0x3379d6(_0x13b1f8);});};AGIVertices['prototype']['getTrunk']=function(_0x2ead29,_0x41cafd){this[_0x9973('0xb')][_0x9973('0x1b')](_0x2ead29)[_0x9973('0x10')](function(_0x52f737){_0x41cafd(null,_0x52f737?_0x52f737[_0x9973('0x11')]:![]);})[_0x9973('0x12')](function(_0x19d3f5){_0x41cafd(_0x19d3f5);});};AGIVertices[_0x9973('0xd')][_0x9973('0x1c')]=function(_0x3096ca,_0x4a4be2){var _0x4f7aed=this;this['rpc']['getSoundById'](_0x3096ca)[_0x9973('0x10')](function(_0x10eb42){_0x4a4be2(null,_0x10eb42?_0x4f7aed[_0x9973('0x1d')](_0x10eb42['save_name']):![]);})[_0x9973('0x12')](function(_0x2cd1db){_0x4a4be2(_0x2cd1db);});};AGIVertices[_0x9973('0xd')][_0x9973('0x1e')]=function(_0x2965bb,_0x5d940e){this['rpc'][_0x9973('0x1f')](_0x2965bb)[_0x9973('0x10')](function(_0x4472d0){_0x5d940e(null,_0x4472d0?_0x4472d0:![]);})['catch'](function(_0x3db1be){_0x5d940e(_0x3db1be);});};AGIVertices[_0x9973('0xd')][_0x9973('0x20')]=function(_0x4d233a,_0x3da143,_0x369428){this[_0x9973('0xc')][_0x9973('0x20')](_0x4d233a,_0x3da143)[_0x9973('0x10')](function(){_0x369428(null);})[_0x9973('0x12')](function(_0x73cd9d){_0x369428(_0x73cd9d);});};AGIVertices[_0x9973('0xd')][_0x9973('0x21')]=function(_0x35340a,_0x51ad86){this[_0x9973('0xb')][_0x9973('0x22')](_0x35340a)[_0x9973('0x10')](function(_0x1c6886){if(_0x1c6886){if(_0x1c6886[_0x9973('0x23')]){_0x51ad86(null,[_0x1c6886[_0x9973('0x24')]]);}else{_0x51ad86(null,_['map'](_0x1c6886['Intervals'],'interval'));}}else{_0x51ad86(null,![]);}})[_0x9973('0x12')](function(_0x55ba98){_0x51ad86(_0x55ba98);});};AGIVertices[_0x9973('0xd')][_0x9973('0x1d')]=function(_0x1a60a9){return util[_0x9973('0x25')](_0x9973('0x26'),FILES_PATH,_0x1a60a9);};AGIVertices[_0x9973('0xd')]['getQueryOdbc']=function(_0x3483a2,_0x2d76f0,_0x458742){odbc[_0x9973('0x27')](_0x3483a2,function(_0x54ecb7){if(_0x54ecb7){logger[_0x9973('0x28')](_0x9973('0x29'),_0x54ecb7);_0x458742(_0x54ecb7);}else{logger['info'](_0x9973('0x2a'));odbc[_0x9973('0x2b')](_0x2d76f0,function(_0x418eee,_0x526977){if(_0x418eee){logger[_0x9973('0x2c')](_0x9973('0x2d'),_0x2d76f0);_0x458742(_0x418eee);}else{logger[_0x9973('0x2c')](_0x9973('0x2e'),_0x2d76f0);odbc[_0x9973('0x2f')](function(_0x499557){if(_0x499557){logger[_0x9973('0x28')](_0x9973('0x30'),_0x499557);}_0x458742(null,_0x526977);});}});}});};AGIVertices[_0x9973('0xd')][_0x9973('0x31')]=function(_0x27d3d2,_0x3e609f){this['rpc'][_0x9973('0x32')](_0x27d3d2)[_0x9973('0x10')](function(_0x1a395c){_0x3e609f(null,_0x1a395c?_0x1a395c:![]);})[_0x9973('0x12')](function(_0x455542){_0x3e609f(_0x455542);});};AGIVertices[_0x9973('0xd')][_0x9973('0x33')]=function(_0x51f34a,_0x1c8077){this[_0x9973('0xb')][_0x9973('0x33')](_0x51f34a)['then'](function(_0x16c5a2){_0x1c8077(null,_0x16c5a2);})[_0x9973('0x12')](function(_0x4a7cd0){_0x1c8077(_0x4a7cd0);});};AGIVertices['prototype'][_0x9973('0x34')]=function(_0x4ef727,_0x57041b,_0x47791e){this[_0x9973('0xb')][_0x9973('0x34')]({'uniqueid':this[_0x9973('0x35')][_0x9973('0x36')],'node':_0x4ef727[_0x9973('0x37')],'application':_0x4ef727[_0x9973('0x38')],'data':_0x57041b||null,'project_name':this[_0x9973('0x35')]['arg_1'],'callerid':this[_0x9973('0x35')]['callerid']})['then'](function(_0x342cb1){if(_0x47791e){_0x47791e(null,_0x342cb1);}})[_0x9973('0x12')](function(_0x1ec242){if(_0x47791e){_0x47791e(_0x1ec242);}});};AGIVertices['prototype'][_0x9973('0x39')]=function(_0x22be22,_0x1724db,_0x33314c,_0x24f2bb){this[_0x9973('0xb')][_0x9973('0x39')]({'uniqueid':this[_0x9973('0x35')][_0x9973('0x36')],'callerid':this['channel'][_0x9973('0x3a')],'calleridname':this[_0x9973('0x35')][_0x9973('0x3b')],'context':this[_0x9973('0x35')][_0x9973('0x3c')],'extension':this['channel'][_0x9973('0x3d')],'priority':this[_0x9973('0x35')][_0x9973('0x3e')],'accountcode':this[_0x9973('0x35')][_0x9973('0x3f')],'dnid':this[_0x9973('0x35')][_0x9973('0x40')],'projectName':this[_0x9973('0x35')]['arg_1'],'saveName':_0x1724db,'filename':_0x22be22['file']||_0x1724db,'savePath':_0x33314c})['then'](function(_0x46919e){_0x24f2bb(null,_0x46919e);})['catch'](function(_0x7dd0b1){_0x24f2bb(_0x7dd0b1);});};AGIVertices['prototype'][_0x9973('0x41')]=function(_0x606340,_0x9c02e5,_0x455115){this[_0x9973('0xb')][_0x9973('0x41')]({'uniqueid':this[_0x9973('0x35')][_0x9973('0x36')],'body':_0x606340,'direction':_0x9c02e5})[_0x9973('0x10')](function(_0xf45213){if(_0x455115){_0x455115(null,_0xf45213);}})[_0x9973('0x12')](function(_0x176694){if(_0x455115){_0x455115(_0x176694);}});};AGIVertices['prototype'][_0x9973('0x42')]=function(_0x3548ce,_0x4dba4a){this[_0x9973('0xb')][_0x9973('0x42')]({'firstName':_[_0x9973('0x43')](_0x3548ce[_0x9973('0x11')])||_[_0x9973('0x44')](_0x3548ce[_0x9973('0x11')])?'callback_'+Math['random']():_0x3548ce[_0x9973('0x11')],'lastName':_[_0x9973('0x43')](_0x3548ce['lastName'])||_[_0x9973('0x44')](_0x3548ce[_0x9973('0x45')])?null:_0x3548ce[_0x9973('0x45')],'phone':_0x3548ce[_0x9973('0x46')],'ListId':_0x3548ce['list_id'],'scheduledAt':_0x3548ce['scheduledAt'],'callbackUniqueid':this[_0x9973('0x35')][_0x9973('0x36')],'tags':_0x9973('0x47'),'description':_0x9973('0x48')+_0x3548ce[_0x9973('0x49')][_0x9973('0x4a')](),'priority':_0x3548ce[_0x9973('0x4b')]})[_0x9973('0x10')](function(_0x5d2e3a){_0x4dba4a(null,_0x5d2e3a);})[_0x9973('0x12')](function(_0x32f419){_0x4dba4a(_0x32f419);});};AGIVertices[_0x9973('0xd')][_0x9973('0x4c')]=function(_0x176f2,_0x439e2b){this[_0x9973('0xb')][_0x9973('0x4d')](_0x176f2)[_0x9973('0x10')](function(_0x1a36e5){_0x439e2b(null,_0x1a36e5?_0x1a36e5[_0x9973('0x11')]:![]);})[_0x9973('0x12')](function(_0x42dbc5){_0x439e2b(_0x42dbc5);});};AGIVertices['prototype'][_0x9973('0x4e')]=function(_0x2f4c34,_0x239391,_0x1198cc){var _0x188f0c={'role':_0x9973('0x4f')};_0x188f0c[_0x2f4c34]=this['channel'][_0x9973('0x3a')];this[_0x9973('0xb')][_0x9973('0x4e')](_0x188f0c,_0x239391,this[_0x9973('0x35')][_0x9973('0x36')])[_0x9973('0x10')](function(_0x342644){_0x1198cc(null,_[_0x9973('0x44')](_0x342644)?![]:!![]);})['catch'](function(_0x1e3b82){logger[_0x9973('0x28')](_0x1e3b82);_0x1198cc(null,![]);});};AGIVertices[_0x9973('0xd')][_0x9973('0x50')]=function(_0x597e30,_0x12a18a){var _0x2aabb5={'role':_0x9973('0x4f')};_0x2aabb5[_0x597e30]=this[_0x9973('0x35')][_0x9973('0x3a')];this[_0x9973('0xb')][_0x9973('0x50')](_0x2aabb5)['then'](function(_0x9e225d){_0x12a18a(null,_[_0x9973('0x44')](_0x9e225d)?![]:!![]);})[_0x9973('0x12')](function(_0x279e57){logger['error'](_0x279e57);_0x12a18a(null,![]);});};AGIVertices['prototype'][_0x9973('0x51')]=function(_0x537781,_0x2b4aeb){var _0x26f6c5={'role':_0x9973('0x4f')};_0x26f6c5[_0x537781]=this[_0x9973('0x35')][_0x9973('0x3a')];this[_0x9973('0xb')]['agentLogout'](_0x26f6c5)[_0x9973('0x10')](function(_0x28d1d7){_0x2b4aeb(null,_[_0x9973('0x44')](_0x28d1d7)?![]:!![]);})[_0x9973('0x12')](function(_0x55b15e){logger[_0x9973('0x28')](_0x55b15e);_0x2b4aeb(null,![]);});};AGIVertices[_0x9973('0xd')][_0x9973('0x52')]=function(_0x227258,_0x37c42b){var _0x37991e={'role':_0x9973('0x4f')};_0x37991e[_0x227258]=this[_0x9973('0x35')][_0x9973('0x3a')];var _0x21bfe3=_0x227258!='internal'?util[_0x9973('0x25')](_0x9973('0x53'),_0x9973('0x54'),this[_0x9973('0x35')][_0x9973('0x3a')]):undefined;this['rpc']['agentLogin'](_0x37991e,_0x21bfe3)[_0x9973('0x10')](function(_0x2e130e){_0x37c42b(null,_[_0x9973('0x44')](_0x2e130e)?![]:!![]);})['catch'](function(_0x2b8211){logger['error'](_0x2b8211);_0x37c42b(null,![]);});};AGIVertices[_0x9973('0xd')][_0x9973('0x55')]=function(_0x1f6199,_0x291da7){sh['exec'](_[_0x9973('0x56')](_0x1f6199),function(_0x243983,_0xbbb5f){var _0x5291e2=_0xbbb5f[_0x9973('0x57')](/(\r\n|\n|\r)/gm,'');_0x291da7(null,_0x5291e2);});};AGIVertices['prototype'][_0x9973('0x58')]=function(_0x5f2154,_0x386246){scripts['googleTTS'](_0x5f2154[_0x9973('0x59')],_0x5f2154[_0x9973('0x5a')]||'en',0x1)[_0x9973('0x10')](function(_0x357b57){_0x386246(null,_0x357b57);})[_0x9973('0x12')](function(_0x1c7f76){_0x386246(_0x1c7f76);});};AGIVertices[_0x9973('0xd')][_0x9973('0x5b')]=function(_0x28c60b,_0x450e1b){scripts['googleDialogflow'](this['channel'][_0x9973('0x36')],_0x28c60b[_0x9973('0x5c')],_0x28c60b[_0x9973('0x59')],_0x28c60b[_0x9973('0x5d')]||'en')['then'](function(_0x50da57){_0x450e1b(null,_0x50da57);})[_0x9973('0x12')](function(_0x4fb096){_0x450e1b(_0x4fb096);});};AGIVertices[_0x9973('0xd')][_0x9973('0x5e')]=function(_0x3a618b,_0x2fddb8){scripts[_0x9973('0x5e')](this[_0x9973('0x35')],_0x3a618b)[_0x9973('0x10')](function(_0x5a8177){_0x2fddb8(null,_0x5a8177);})[_0x9973('0x12')](function(_0x4c0260){_0x2fddb8(_0x4c0260);});};AGIVertices['prototype'][_0x9973('0x5f')]=function(_0x368964,_0x3dab71){scripts[_0x9973('0x5f')](_0x368964[_0x9973('0x5c')],_0x368964[_0x9973('0x59')],_0x368964[_0x9973('0x60')]||'en-US',_0x368964[_0x9973('0x61')])[_0x9973('0x10')](function(_0x1c1309){_0x3dab71(null,_0x1c1309);})[_0x9973('0x12')](function(_0x1bafc1){_0x3dab71(_0x1bafc1);});};AGIVertices['prototype'][_0x9973('0x62')]=function(_0x2e8cfe,_0x2a62a6,_0x40201a){scripts[_0x9973('0x62')](_0x2a62a6,_0x2e8cfe[_0x9973('0x5c')],_0x2e8cfe[_0x9973('0x63')]||_0x9973('0x64'),this[_0x9973('0x65')](_0x2e8cfe[_0x9973('0x66')])?_0x2e8cfe['model']:undefined)[_0x9973('0x10')](function(_0x184ec9){_0x40201a(null,_0x184ec9);})[_0x9973('0x12')](function(_0x44e8cf){_0x40201a(_0x44e8cf);});};AGIVertices[_0x9973('0xd')][_0x9973('0x67')]=function(_0x356c10,_0x47ff27){scripts[_0x9973('0x67')](_0x356c10[_0x9973('0x68')],_0x356c10[_0x9973('0x69')],_0x356c10[_0x9973('0x6a')],_0x356c10[_0x9973('0x6b')]||_0x9973('0x6c'),_0x356c10[_0x9973('0x59')],_0x356c10[_0x9973('0x6d')]||_0x9973('0x59'))['then'](function(_0x183ff4){_0x47ff27(null,_0x183ff4);})[_0x9973('0x12')](function(_0xb993a){_0x47ff27(_0xb993a);});};AGIVertices[_0x9973('0xd')][_0x9973('0x6e')]=function(_0x41da57,_0x3a6ab8){scripts[_0x9973('0x6e')](this['channel'][_0x9973('0x36')],_0x41da57['aws_access_key_id'],_0x41da57[_0x9973('0x69')],_0x41da57[_0x9973('0x6f')],_0x41da57[_0x9973('0x59')],_0x41da57[_0x9973('0x70')])['then'](function(_0x42ab2a){_0x3a6ab8(null,_0x42ab2a);})[_0x9973('0x12')](function(_0x2a49ba){_0x3a6ab8(_0x2a49ba);});};AGIVertices[_0x9973('0xd')][_0x9973('0x71')]=function(_0x3171e1,_0x25eb0d,_0x31d1b5){scripts[_0x9973('0x71')](_0x25eb0d,_0x3171e1[_0x9973('0x5c')],_0x3171e1[_0x9973('0x72')]||_0x9973('0x64'))[_0x9973('0x10')](function(_0x1ae753){_0x31d1b5(null,_0x1ae753);})[_0x9973('0x12')](function(_0x147194){_0x31d1b5(_0x147194);});};AGIVertices[_0x9973('0xd')][_0x9973('0x73')]=function(_0x12bd5a,_0x1e4a57,_0x54aedd){scripts[_0x9973('0x73')](_0x1e4a57,_0x12bd5a[_0x9973('0x74')],_0x12bd5a[_0x9973('0x75')],_0x12bd5a[_0x9973('0x76')])[_0x9973('0x10')](function(_0x4c7e8a){_0x54aedd(null,_0x4c7e8a);})[_0x9973('0x12')](function(_0x2ae087){_0x54aedd(_0x2ae087);});};AGIVertices['prototype']['clear']=function(_0x1a8652){var _0x59c99c=_['includes'](verticesWithRetry,_0x1a8652[_0x9973('0x38')])?_0x1a8652:_[_0x9973('0x77')](_0x1a8652);for(var _0x34985e in _0x59c99c){if(_0x59c99c['hasOwnProperty'](_0x34985e)){if(_0x59c99c[_0x34985e]&&_[_0x9973('0x78')](_0x59c99c[_0x34985e])){_0x59c99c[_0x34985e]=this[_0x9973('0x79')](_0x59c99c[_0x34985e]);}}}return _0x59c99c;};AGIVertices[_0x9973('0xd')]['replaceAllVariables']=function(_0x2b213d){var _0x45bfa6=_0x2b213d[_0x9973('0x7a')]('{');for(var _0x3bb52b=0x1;_0x3bb52b<_0x45bfa6[_0x9973('0x7b')];_0x3bb52b+=0x1){var _0x579d3f=_0x45bfa6[_0x3bb52b][_0x9973('0x7a')]('}');if(_0x579d3f['length']>0x1){_0x2b213d=_0x2b213d['replaceAll']('{'+_0x579d3f[0x0]+'}',this[_0x9973('0x35')][_0x9973('0xe')](_0x579d3f[0x0])[_0x9973('0x7c')]||_0x579d3f[0x0]);}}if(_0x45bfa6[_0x9973('0x7b')]===0x1){return _0x2b213d[_0x9973('0x4a')]();}return this[_0x9973('0x79')](_0x2b213d);};AGIVertices['prototype'][_0x9973('0x7d')]=function(_0x4a9221,_0x43d1b6){var _0x1cba5a=this[_0x9973('0x35')]['getVariable'](_0x4a9221);if(_0x1cba5a[_0x9973('0x7e')]===-0x1){return _0x1cba5a;}logger['info'](util[_0x9973('0x25')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x43d1b6,_0x1cba5a[_0x9973('0x7c')]));return this[_0x9973('0x35')]['setVariable'](_0x43d1b6,_0x1cba5a[_0x9973('0x7c')]);};AGIVertices[_0x9973('0xd')][_0x9973('0x65')]=function(_0x5036af){return _0x5036af&&_0x5036af!=='0'&&_0x5036af!=='-1'&&_0x5036af!=='';};AGIVertices['prototype'][_0x9973('0x7f')]=function(_0x374be1){this['createSquareDetailsReport'][_0x9973('0x80')](this,_0x374be1,'-');_0x374be1['retry']=_0x374be1['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9973('0xd')]['agi']=function(_0x3f1cdc){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3f1cdc[_0x9973('0x37')]));return this[_0x9973('0x35')]['agi']([_0x3f1cdc[_0x9973('0x81')],_0x3f1cdc['args']]);};AGIVertices[_0x9973('0xd')]['answer']=function(_0x547727){logger['info'](util[_0x9973('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x547727[_0x9973('0x37')]));if(this[_0x9973('0x65')](_0x547727[_0x9973('0x82')])){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x83'),_0x547727[_0x9973('0x82')]));var _0x2e8bc0=this[_0x9973('0x35')][_0x9973('0x84')](_0x547727['timeout']);if(_0x2e8bc0['result']===-0x1){return _0x2e8bc0;}}return this[_0x9973('0x35')][_0x9973('0x85')]();};AGIVertices[_0x9973('0xd')][_0x9973('0x47')]=function(_0xbd6ff9){logger[_0x9973('0x2c')](util['format'](_0x9973('0x86'),_0xbd6ff9[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0xbd6ff9[_0x9973('0x87')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0xbd6ff9,_0x9973('0x88'));}_0xbd6ff9[_0x9973('0x49')]=moment();if(this[_0x9973('0x65')](_0xbd6ff9['delay'])){_0xbd6ff9[_0x9973('0x49')]=moment()['add'](_0xbd6ff9[_0x9973('0x89')],_0x9973('0x8a'));}if(!this[_0x9973('0x65')](_0xbd6ff9[_0x9973('0x4b')])){_0xbd6ff9['callback_priority']=0x2;}this['createCmContact'][_0x9973('0x80')](this,_0xbd6ff9);return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x8c'),_0xbd6ff9[_0x9973('0x46')],_0xbd6ff9[_0x9973('0x87')],_0xbd6ff9[_0x9973('0x49')]));};AGIVertices[_0x9973('0xd')][_0x9973('0x8d')]=function(_0x1e9e90){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x8e'),_0x1e9e90[_0x9973('0x37')]));var _0x5781f1=this[_0x9973('0x35')][_0x9973('0x8f')](_0x1e9e90[_0x9973('0x90')],_0x1e9e90[_0x9973('0x91')]);if(_0x5781f1[_0x9973('0x7e')]===-0x1){return _0x5781f1;}return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x92'),_0x1e9e90[_0x9973('0x90')],_0x1e9e90[_0x9973('0x91')]));};AGIVertices['prototype'][_0x9973('0x93')]=function(_0x410d14){logger['info'](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x410d14[_0x9973('0x37')]));if(!this['isConfigured'](_0x410d14[_0x9973('0x59')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x94'));}var _0x2a020a='\x22'+_0x410d14[_0x9973('0x59')]+'\x22';if(this['isConfigured'](_0x410d14['options'])){_0x2a020a+=','+_0x410d14[_0x9973('0x91')];}var _0x703c6b=this[_0x9973('0x35')][_0x9973('0x8f')](_0x9973('0x95'),_0x2a020a);if(_0x703c6b['result']===-0x1){return _0x703c6b;}return this[_0x9973('0x35')][_0x9973('0x8b')](util['format'](_0x9973('0x96'),_0x2a020a));};AGIVertices[_0x9973('0xd')][_0x9973('0x97')]=function(_0x1de39e){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x1de39e[_0x9973('0x37')]));if(!this['isConfigured'](_0x1de39e['text'])){return this['channel'][_0x9973('0x8b')](_0x9973('0x94'));}var _0x1a6b6a='\x22'+_0x1de39e[_0x9973('0x59')]+'\x22';if(this['isConfigured'](_0x1de39e[_0x9973('0x91')])){_0x1a6b6a+=','+_0x1de39e[_0x9973('0x91')];}var _0x276a2e=this[_0x9973('0x35')][_0x9973('0x8f')](_0x9973('0x95'),_0x1a6b6a);if(_0x276a2e[_0x9973('0x7e')]===-0x1){return _0x276a2e;}return this[_0x9973('0x35')]['noop'](util[_0x9973('0x25')](_0x9973('0x96'),_0x1a6b6a));};AGIVertices[_0x9973('0xd')][_0x9973('0x98')]=function(_0x11c503){logger['info'](util[_0x9973('0x25')](_0x9973('0x99'),_0x11c503['label']));if(!this[_0x9973('0x65')](_0x11c503[_0x9973('0x9a')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x9b'));}var _0x4dbde9=_0x11c503[_0x9973('0x9a')];if(this['isConfigured'](_0x11c503[_0x9973('0x91')])){_0x4dbde9+=','+_0x11c503[_0x9973('0x91')];}var _0x447f96=this[_0x9973('0x35')][_0x9973('0x8f')](_0x9973('0x9c'),_0x4dbde9);if(_0x447f96[_0x9973('0x7e')]===-0x1){return _0x447f96;}var _0x561a1c=this[_0x9973('0x7d')](_0x9973('0x9d'),_0x9973('0x9e'));if(_0x561a1c[_0x9973('0x7e')]===-0x1){return _0x561a1c;}var _0x3953ac=this[_0x9973('0x7d')](_0x9973('0x9f'),_0x9973('0xa0'));if(_0x3953ac[_0x9973('0x7e')]===-0x1){return _0x3953ac;}var _0x494b35=this['getAndSetVariable'](_0x9973('0xa1'),_0x9973('0xa2'));if(_0x494b35[_0x9973('0x7e')]===-0x1){return _0x494b35;}return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0xa3'),_0x4dbde9));};AGIVertices[_0x9973('0xd')][_0x9973('0xa4')]=function(_0xb1fca6){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xa5'),_0xb1fca6['label']));if(!this[_0x9973('0x65')](_0xb1fca6[_0x9973('0x9a')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x9b'));}var _0x58d034=_0xb1fca6[_0x9973('0x9a')];if(this[_0x9973('0x65')](_0xb1fca6['options'])){_0x58d034+=','+_0xb1fca6[_0x9973('0x91')];}var _0x37a345=this[_0x9973('0x35')][_0x9973('0x8f')](_0x9973('0x9c'),_0x58d034);if(_0x37a345[_0x9973('0x7e')]===-0x1){return _0x37a345;}var _0x28d788=this[_0x9973('0x7d')](_0x9973('0x9d'),_0x9973('0xa6'));if(_0x28d788[_0x9973('0x7e')]===-0x1){return _0x28d788;}var _0x33c458=this[_0x9973('0x7d')](_0x9973('0x9f'),'SESTEK_ASR_TRANSCRIPT');if(_0x33c458[_0x9973('0x7e')]===-0x1){return _0x33c458;}var _0x5299bc=this[_0x9973('0x7d')](_0x9973('0xa1'),_0x9973('0xa7'));if(_0x5299bc[_0x9973('0x7e')]===-0x1){return _0x5299bc;}return this['channel'][_0x9973('0x8b')](util['format'](_0x9973('0xa3'),_0x58d034));};AGIVertices[_0x9973('0xd')]['database']=function(_0x322289){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xa8'),_0x322289[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x322289[_0x9973('0xa9')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x322289,_0x9973('0xaa'));}var _0x2b104f=this['getSquareOdbc']['sync'](this,_0x322289['odbc_id']);if(!_0x2b104f){return this[_0x9973('0x35')][_0x9973('0x28')](_0x322289,'no\x20odbc\x20database\x20found');}if(!this[_0x9973('0x65')](_0x322289[_0x9973('0x2b')])){return this[_0x9973('0x35')]['error'](_0x322289,'no\x20query\x20configured');}var _0xad98ef=_0x322289['query'][_0x9973('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0xab'),_0xad98ef));var _0x2aedb7=this[_0x9973('0xac')][_0x9973('0x80')](this,_0x2b104f,_0xad98ef);this[_0x9973('0x34')]['sync'](this,_0x322289,_0xad98ef);if(!this[_0x9973('0x65')](_0x322289[_0x9973('0xad')])){return this[_0x9973('0x35')]['noop'](_0x9973('0xae'));}var _0x5f4df2=this[_0x9973('0xe')][_0x9973('0x80')](this,_0x322289[_0x9973('0xad')]);if(!_0x5f4df2){return this['channel'][_0x9973('0x28')](_0x322289,_0x9973('0xaf'));}var _0x3db664=this;_0x2aedb7['forEach'](function(_0xf8e3ac,_0x4c75ac){Object[_0x9973('0xb0')](_0xf8e3ac)['forEach'](function(_0x4cd1db){_0x3db664[_0x9973('0x35')]['setVariable'](util[_0x9973('0x25')](_0x9973('0xb1'),_0x5f4df2,_0x4c75ac,_0x4cd1db),_0xf8e3ac[_0x4cd1db]);});});this[_0x9973('0x35')][_0x9973('0xb2')](util[_0x9973('0x25')](_0x9973('0xb3'),_0x5f4df2),_0x2aedb7[_0x9973('0x7b')]);return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0xb4'),_0x5f4df2));};AGIVertices[_0x9973('0xd')]['dial']=function(_0x3f4018){logger[_0x9973('0xb5')](util[_0x9973('0x25')](_0x9973('0xb6'),_0x3f4018[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x3f4018['sip_id'])){return this['channel'][_0x9973('0x28')](_0x3f4018,'no\x20user\x20selected');}var _0x907adf=this[_0x9973('0x19')][_0x9973('0x80')](this,_0x3f4018[_0x9973('0xb7')]);if(!_0x907adf){return this[_0x9973('0x35')]['error'](_0x3f4018,_0x9973('0xb8'));}var _0x2f2051=this[_0x9973('0x35')]['exec']('DIAL',[util[_0x9973('0x25')]('SIP/%s',_0x907adf),_0x3f4018[_0x9973('0x82')],_0x3f4018[_0x9973('0xb9')],_0x3f4018[_0x9973('0xba')]]);if(_0x2f2051[_0x9973('0x7e')]===-0x1){return _0x2f2051;}return this['channel'][_0x9973('0x8b')](util['format']('Executed\x20command\x20%s',_0x9973('0xbb')));};AGIVertices[_0x9973('0xd')][_0x9973('0xbc')]=function(_0x583dc9){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xbd'),_0x583dc9[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x583dc9[_0x9973('0x5c')])){return this[_0x9973('0x35')]['noop'](_0x9973('0xbe'));}if(!this[_0x9973('0x65')](_0x583dc9['text'])){return this['channel'][_0x9973('0x8b')](_0x9973('0x94'));}this[_0x9973('0x35')][_0x9973('0xbf')]=!![];this['createSquareDetailsReport'](_0x583dc9);this[_0x9973('0x41')](_0x583dc9['text'],'in');this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0xc0'),_0x583dc9['text']));var _0x2e5079=this[_0x9973('0x5b')][_0x9973('0x80')](this,_0x583dc9);if(_0x2e5079){for(var _0x4c1118 in _0x2e5079){if(_0x2e5079[_0x9973('0xc1')](_0x4c1118)){this[_0x9973('0x35')][_0x9973('0xb2')](util[_0x9973('0x25')](_0x9973('0xc2'),_0x4c1118[_0x9973('0xc3')]()),_0x2e5079[_0x4c1118]);}}this['createSquareMessage'](_0x2e5079['speech'],_0x9973('0xc4'));return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0xc5'),_0x2e5079[_0x9973('0xc6')]));}return this[_0x9973('0x35')][_0x9973('0x28')](_0x583dc9,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x9973('0xd')][_0x9973('0xc7')]=function(_0xb96cb5){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xc8'),_0xb96cb5[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0xb96cb5[_0x9973('0xc9')])){return this[_0x9973('0x35')]['noop'](_0x9973('0xca'));}if(!this[_0x9973('0x65')](_0xb96cb5[_0x9973('0xcb')])){return this[_0x9973('0x35')]['noop']('no\x20username\x20configured');}if(!this[_0x9973('0x65')](_0xb96cb5[_0x9973('0xcc')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0xcd'));}if(!this['isConfigured'](_0xb96cb5[_0x9973('0xce')])){return this[_0x9973('0x35')]['noop']('no\x20text\x20configured');}this[_0x9973('0x35')][_0x9973('0xbf')]=!![];this['createSquareDetailsReport'](_0xb96cb5);this['createSquareMessage'](_0xb96cb5[_0x9973('0x59')],'in');this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0xcf'),_0xb96cb5[_0x9973('0x59')]));var _0xfa7431=this[_0x9973('0x5e')][_0x9973('0x80')](this,_0xb96cb5);if(_0xfa7431){for(var _0xf4b32e in _0xfa7431){if(_0xfa7431[_0x9973('0xc1')](_0xf4b32e)){this['channel']['setVariable'](util['format'](_0x9973('0xd0'),_0xf4b32e[_0x9973('0xc3')]()),_0xfa7431[_0xf4b32e]);}}this[_0x9973('0x41')](_0xfa7431[_0x9973('0xc6')],_0x9973('0xc4'));if(_0xfa7431[_0x9973('0xd1')]){this['channel'][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0xd2'),_0xfa7431[_0x9973('0xd1')]));var _0x7e4a74=this[_0x9973('0x35')][_0x9973('0xd3')](_0xfa7431[_0x9973('0xd1')]);try{fs[_0x9973('0xd4')](_0xfa7431[_0x9973('0xd1')]+'.wav');}catch(_0x3cc60c){logger[_0x9973('0x28')](_0x3cc60c);}return _0x7e4a74;}else{return this[_0x9973('0x35')][_0x9973('0x8b')](util['format'](_0x9973('0xd5'),_0xfa7431[_0x9973('0xc6')]));}}return this[_0x9973('0x35')]['error'](_0xb96cb5,_0x9973('0xd6'));};AGIVertices['prototype'][_0x9973('0xd7')]=function(_0x330053){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xd8'),_0x330053[_0x9973('0x37')]));return this['channel'][_0x9973('0x8b')](_0x9973('0xd7'));};AGIVertices['prototype'][_0x9973('0xd9')]=function(_0x5b2443){logger[_0x9973('0x2c')](util['format'](_0x9973('0xda'),_0x5b2443['label']));var _0x3432eb='';if(_0x5b2443[_0x9973('0xdb')]){if(!this['isConfigured'](_0x5b2443[_0x9973('0xdb')])){return this['channel'][_0x9973('0x28')](_0x5b2443,_0x9973('0xdc'));}else{var _0x985050=parseInt(_0x5b2443[_0x9973('0xdb')],0xa);if(isNaN(_0x985050)){_0x3432eb=_0x5b2443[_0x9973('0xdb')];}else{_0x3432eb=this[_0x9973('0xdd')][_0x9973('0x80')](this,_0x5b2443[_0x9973('0xdb')]);if(!_0x3432eb){return this['channel'][_0x9973('0x28')](_0x5b2443,_0x9973('0xde'));}}}}else if(_0x5b2443[_0x9973('0xdf')]){_0x3432eb=_0x5b2443[_0x9973('0xdf')];}else{return this[_0x9973('0x35')][_0x9973('0x28')](_0x5b2443,_0x9973('0xdc'));}var _0x287c6b=this['channel'][_0x9973('0x8f')](_0x9973('0xbb'),[util[_0x9973('0x25')](_0x9973('0xe0'),_0x3432eb,_0x5b2443[_0x9973('0x46')]),_0x5b2443['timeout'],_0x5b2443['opts'],_0x5b2443[_0x9973('0xba')]]);if(_0x287c6b[_0x9973('0x7e')]===-0x1){return _0x287c6b;}return this['channel']['noop'](util[_0x9973('0x25')](_0x9973('0xe1'),_0x9973('0xbb')));};AGIVertices[_0x9973('0xd')][_0x9973('0xe2')]=function(_0x80183b){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xe3'),_0x80183b[_0x9973('0x37')]));return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0xe2'));};AGIVertices[_0x9973('0xd')][_0x9973('0xa')]=function(_0x512bc1){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xe4'),_0x512bc1[_0x9973('0x37')]));if(_0x512bc1[_0x9973('0xe5')]===0x0){return this['maxRetry'](_0x512bc1);}_0x512bc1['retry']-=0x1;if(!this[_0x9973('0x65')](_0x512bc1['file_id'])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x512bc1,_0x9973('0xe6'));}var _0x54acba=this['getSound'][_0x9973('0x80')](this,_0x512bc1['file_id']);if(!_0x54acba){return this[_0x9973('0x35')]['error'](_0x512bc1,_0x9973('0xe7'));}if(!this['isConfigured'](_0x512bc1['variable_id'])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x9973('0xae'));}var _0xd15faa=this[_0x9973('0x35')][_0x9973('0xe8')](_0x54acba,_0x512bc1[_0x9973('0xe9')],_0x512bc1['maxdigit']);var _0x24311e=_0xd15faa[_0x9973('0x7e')]?_0xd15faa[_0x9973('0x7e')]['toString']():'';logger['info'](_0x9973('0xea'),JSON['stringify'](_0xd15faa));if(_0xd15faa[_0x9973('0x7e')]===-0x1){this[_0x9973('0x34')]['sync'](this,_0x512bc1,_0x24311e);return _0xd15faa;}else if(_0xd15faa[_0x9973('0x7c')]===_0x9973('0x82')){_0xd15faa[_0x9973('0x7e')]=_0x24311e[_0x9973('0x7b')]>=parseInt(_0x512bc1[_0x9973('0xeb')])?'x':'i';}else{_0xd15faa[_0x9973('0x7e')]=_0x24311e[_0x9973('0x7b')]>=parseInt(_0x512bc1[_0x9973('0xeb')])&&_0x24311e[_0x9973('0x7b')]<=parseInt(_0x512bc1[_0x9973('0xec')])?'x':'i';}var _0x3983f0=this[_0x9973('0xe')][_0x9973('0x80')](this,_0x512bc1[_0x9973('0xad')]);if(!_0x3983f0){return this[_0x9973('0x35')][_0x9973('0x28')](_0x512bc1,_0x9973('0xaf'));}this[_0x9973('0x35')][_0x9973('0xb2')](_0x3983f0,_0x24311e);if(this['isConfigured'](_0x512bc1[_0x9973('0xed')])){var _0xcb626c=parseInt(_0x512bc1[_0x9973('0xed')],0xa);var _0x1d31c0=rs[_0x9973('0xee')]({'charset':'*','length':_0xcb626c});var _0x2bc625=_0x24311e[_0x9973('0x7b')];if(_0x2bc625>0x0){if(_0x2bc625>_0xcb626c){this[_0x9973('0x34')][_0x9973('0x80')](this,_0x512bc1,_0x512bc1[_0x9973('0xef')]===_0x9973('0xf0')?_0x1d31c0+_0x24311e[_0x9973('0xf1')](_0xcb626c):_0x24311e[_0x9973('0xf1')](0x0,_0x2bc625-_0xcb626c)+_0x1d31c0);}else{this[_0x9973('0x34')][_0x9973('0x80')](this,_0x512bc1,rs[_0x9973('0xee')]({'charset':'*','length':_0x2bc625}));}}else{this['createSquareDetailsReport']['sync'](this,_0x512bc1,'');}}else{this[_0x9973('0x34')][_0x9973('0x80')](this,_0x512bc1,_0x24311e);}return _0xd15faa;};AGIVertices['prototype'][_0x9973('0xf2')]=function(_0x32708e){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xf3'),_0x32708e[_0x9973('0x37')]));return this[_0x9973('0xa')](_0x32708e);};AGIVertices[_0x9973('0xd')][_0x9973('0xf4')]=function(_0xab7f72){logger['info'](util[_0x9973('0x25')](_0x9973('0xf5'),_0xab7f72[_0x9973('0x37')]));this[_0x9973('0x34')][_0x9973('0x80')](this,_0xab7f72,_0xab7f72['goalname']);return this[_0x9973('0x35')]['noop'](util[_0x9973('0x25')]('GOAL\x20%s',_0xab7f72[_0x9973('0xf6')]));};AGIVertices['prototype'][_0x9973('0xf7')]=function(_0x913baf){logger['info'](util[_0x9973('0x25')](_0x9973('0xf8'),_0x913baf[_0x9973('0x37')]));if(!this['isConfigured'](_0x913baf[_0x9973('0x68')])||!this[_0x9973('0x65')](_0x913baf[_0x9973('0x69')])){return this['channel'][_0x9973('0x8b')](_0x9973('0xf9'));}if(!this[_0x9973('0x65')](_0x913baf[_0x9973('0x59')])){return this[_0x9973('0x35')]['noop'](_0x9973('0x94'));}this[_0x9973('0x35')][_0x9973('0x8b')](util['format'](_0x9973('0xfa'),_0x913baf[_0x9973('0x59')]));var _0x3265cc=this[_0x9973('0x67')][_0x9973('0x80')](this,_0x913baf);if(_0x3265cc){this[_0x9973('0x35')][_0x9973('0x8b')](util['format'](_0x9973('0xfb'),_0x3265cc));var _0x49d801=this[_0x9973('0x35')][_0x9973('0xd3')](_0x3265cc);try{fs[_0x9973('0xd4')](_0x3265cc+_0x9973('0xfc'));}catch(_0x5b26bb){logger['error'](_0x5b26bb);}return _0x49d801;}return this[_0x9973('0x35')][_0x9973('0x28')](_0x913baf,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x9973('0xfd')]=function(_0x396b21){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0xfe'),_0x396b21['label']));if(!this['isConfigured'](_0x396b21[_0x9973('0x68')])||!this[_0x9973('0x65')](_0x396b21['aws_secret_access_key'])){return this[_0x9973('0x35')]['noop'](_0x9973('0xf9'));}if(!this[_0x9973('0x65')](_0x396b21[_0x9973('0x70')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0xff'));}if(!this[_0x9973('0x65')](_0x396b21['text'])){return this['channel']['noop'](_0x9973('0x94'));}this[_0x9973('0x35')]['bot']=!![];this[_0x9973('0x34')](_0x396b21);this[_0x9973('0x41')](_0x396b21['text'],'in');this[_0x9973('0x35')][_0x9973('0x8b')](util['format'](_0x9973('0x100'),_0x396b21[_0x9973('0x59')]));var _0x21d6e5=this['awsLex'][_0x9973('0x80')](this,_0x396b21);if(_0x21d6e5){for(var _0x55a3b7 in _0x21d6e5){if(_0x21d6e5[_0x9973('0xc1')](_0x55a3b7)&&_[_0x9973('0x78')](_0x21d6e5[_0x55a3b7])){this[_0x9973('0x35')][_0x9973('0xb2')](util['format']('AWS_LEX_%s',_0x55a3b7['toUpperCase']()),_0x21d6e5[_0x55a3b7]);}}if(_[_0x9973('0x44')](_0x21d6e5[_0x9973('0x101')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x102'));}else{this['createSquareMessage'](_0x21d6e5[_0x9973('0x101')],'out');return this[_0x9973('0x35')][_0x9973('0x8b')](util['format'](_0x9973('0x103'),_0x21d6e5['message']));}}return this['channel'][_0x9973('0x28')](_0x396b21,_0x9973('0x104'));};AGIVertices[_0x9973('0xd')][_0x9973('0x105')]=function(_0x4e96bb){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x106'),_0x4e96bb[_0x9973('0x37')],_0x4e96bb['timeout']));if(!this[_0x9973('0x65')](_0x4e96bb[_0x9973('0x5c')])){return this[_0x9973('0x35')]['noop'](_0x9973('0xbe'));}var _0x351aef=_0x9973('0x107');var _0x469ce1=util[_0x9973('0x25')](_0x9973('0x108'),FILES_PATH,rs[_0x9973('0xee')](0x4));var _0x3c6411=util[_0x9973('0x25')](_0x9973('0x109'),_0x469ce1,_0x351aef);var _0x4808ec=!![];if(_0x4e96bb[_0x9973('0x10a')]==='NOBEEP'){_0x4808ec=![];}var _0x13ec9b=this[_0x9973('0x35')][_0x9973('0x10b')](_0x469ce1,_0x351aef,_0x4e96bb[_0x9973('0x10c')],_0x4e96bb[_0x9973('0x82')],undefined,_0x4808ec);if(_0x13ec9b[_0x9973('0x7e')]!==-0x1){this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x10d'),_0x3c6411));var _0x1b0405=this['googleASR'][_0x9973('0x80')](this,_0x4e96bb,_0x3c6411);if(_0x1b0405){for(var _0x390b31 in _0x1b0405){if(_0x1b0405[_0x9973('0xc1')](_0x390b31)){this[_0x9973('0x35')]['setVariable'](util[_0x9973('0x25')](_0x9973('0x10e'),_0x390b31['toUpperCase']()),_0x1b0405[_0x390b31]);}}return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x10f'),JSON[_0x9973('0x110')](_0x1b0405)));}}return _0x13ec9b;};AGIVertices['prototype'][_0x9973('0x111')]=function(_0x51a8b3){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x112'),_0x51a8b3[_0x9973('0x37')]));if(!this['isConfigured'](_0x51a8b3['appid'])){return this[_0x9973('0x35')][_0x9973('0x8b')]('no\x20appid\x20configured');}if(!this[_0x9973('0x65')](_0x51a8b3[_0x9973('0x75')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x113'));}var _0x2e04d7=_0x9973('0x107');var _0xc2260c=util[_0x9973('0x25')](_0x9973('0x108'),FILES_PATH,rs[_0x9973('0xee')](0x4));var _0x47f51b=util[_0x9973('0x25')](_0x9973('0x109'),_0xc2260c,_0x2e04d7);var _0x4ca5b2=!![];if(_0x51a8b3[_0x9973('0x10a')]==='NOBEEP'){_0x4ca5b2=![];}var _0x2dc703=this[_0x9973('0x35')][_0x9973('0x10b')](_0xc2260c,_0x2e04d7,_0x51a8b3[_0x9973('0x10c')],_0x51a8b3[_0x9973('0x82')],undefined,_0x4ca5b2);if(_0x2dc703[_0x9973('0x7e')]!==-0x1){this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x114'),_0x47f51b));var _0x737906=this[_0x9973('0x73')][_0x9973('0x80')](this,_0x51a8b3,_0x47f51b);if(_0x737906){for(var _0x375a05 in _0x737906){if(_0x737906[_0x9973('0xc1')](_0x375a05)){this['channel']['setVariable'](util['format'](_0x9973('0x115'),_0x375a05[_0x9973('0xc3')]()),_0x737906[_0x375a05]);}}return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x116'),JSON[_0x9973('0x110')](_0x737906)));}}return _0x2dc703;};AGIVertices[_0x9973('0xd')][_0x9973('0x117')]=function(_0x3b2446){logger[_0x9973('0x2c')](util['format'](_0x9973('0x118'),_0x3b2446[_0x9973('0x37')]));return this[_0x9973('0x35')][_0x9973('0x119')](_0x3b2446['context'],_0x3b2446[_0x9973('0x3d')],_0x3b2446['priority']);};AGIVertices['prototype'][_0x9973('0x11a')]=function(_0x199d08){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x199d08[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x199d08[_0x9973('0x11b')])){return this['channel'][_0x9973('0x28')](_0x199d08,_0x9973('0x11c'));}try{var _0x52c01e=eval(_0x199d08[_0x9973('0x11b')])?'true':'false';this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x11d'),_0x199d08['condition'],_0x52c01e));return{'code':0xc8,'result':_0x52c01e};}catch(_0x46bc54){return{'code':0xc8,'result':_0x9973('0x11e')};}};AGIVertices['prototype']['gotoiftime']=function(_0x1be251){logger['info'](util[_0x9973('0x25')](_0x9973('0x11f'),_0x1be251[_0x9973('0x37')]));if(!this['isConfigured'](_0x1be251['interval_id'])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x1be251,_0x9973('0x120'));}var _0x37db84=this[_0x9973('0x21')][_0x9973('0x80')](this,_0x1be251[_0x9973('0x121')]);if(!_0x37db84){return this['channel'][_0x9973('0x28')](_0x1be251,_0x9973('0x122'));}for(var _0x4a8be2=0x0;_0x4a8be2<_0x37db84[_0x9973('0x7b')];_0x4a8be2+=0x1){var _0x555f34=this[_0x9973('0x35')][_0x9973('0xe')](util['format'](_0x9973('0x123'),_0x37db84[_0x4a8be2]));if(_0x555f34[_0x9973('0x7e')]===-0x1){return _0x555f34;}logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x124'),_0x37db84[_0x4a8be2],_0x555f34[_0x9973('0x7c')]));if(_0x555f34[_0x9973('0x7c')]===_0x9973('0x125')){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x124'),_0x37db84[_0x4a8be2],'true'));this[_0x9973('0x35')]['noop'](util[_0x9973('0x25')](_0x9973('0x124'),_0x37db84[_0x4a8be2],_0x9973('0x125')));return{'code':0xc8,'result':'true'};}else{logger[_0x9973('0x2c')](util[_0x9973('0x25')]('IFTIME\x20%s\x20%s',_0x37db84[_0x4a8be2],'false'));this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x124'),_0x37db84[_0x4a8be2],_0x9973('0x11e')));}}return{'code':0xc8,'result':_0x9973('0x11e')};};AGIVertices[_0x9973('0xd')][_0x9973('0x126')]=function(_0x4594a1){logger['info'](util[_0x9973('0x25')](_0x9973('0x127'),_0x4594a1[_0x9973('0x37')]));return this[_0x9973('0x35')][_0x9973('0x126')]();};AGIVertices[_0x9973('0xd')][_0x9973('0x128')]=function(_0xa0bc86){logger['info'](util[_0x9973('0x25')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0xa0bc86[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0xa0bc86[_0x9973('0x5c')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0xbe'));}var _0x55cab7=_0x9973('0x107');var _0x599046=util[_0x9973('0x25')](_0x9973('0x108'),FILES_PATH,rs[_0x9973('0xee')](0x4));var _0xd4aa6b=util[_0x9973('0x25')]('%s.%s',_0x599046,_0x55cab7);var _0x21237b=!![];if(_0xa0bc86[_0x9973('0x10a')]===_0x9973('0x129')){_0x21237b=![];}var _0x4850f7=this['channel'][_0x9973('0x10b')](_0x599046,_0x55cab7,_0xa0bc86[_0x9973('0x10c')],_0xa0bc86[_0x9973('0x82')],undefined,_0x21237b);if(_0x4850f7[_0x9973('0x7e')]!==-0x1){this['channel'][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x12a'),_0xd4aa6b));var _0x34e133=this[_0x9973('0x62')][_0x9973('0x80')](this,_0xa0bc86,_0xd4aa6b);if(_0x34e133){for(var _0x1509a3 in _0x34e133){if(_0x34e133['hasOwnProperty'](_0x1509a3)){this['channel']['setVariable'](util[_0x9973('0x25')](_0x9973('0x12b'),_0x1509a3[_0x9973('0xc3')]()),_0x34e133[_0x1509a3]);}}return this['channel']['noop'](util[_0x9973('0x25')](_0x9973('0x12c'),JSON[_0x9973('0x110')](_0x34e133)));}}return _0x4850f7;};AGIVertices[_0x9973('0xd')][_0x9973('0x12d')]=function(_0x3a51f9){logger[_0x9973('0x2c')](util['format'](_0x9973('0x12e'),_0x3a51f9[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x3a51f9[_0x9973('0x5c')])){return this[_0x9973('0x35')][_0x9973('0x8b')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x3a51f9[_0x9973('0x59')])){return this['channel'][_0x9973('0x8b')](_0x9973('0x94'));}this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x12f'),_0x3a51f9[_0x9973('0x59')]));var _0x13a9fb=this['ispeechTTS'][_0x9973('0x80')](this,_0x3a51f9);if(_0x13a9fb){this['channel'][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x12a'),_0x13a9fb));var _0x5e3dfa=this[_0x9973('0x35')]['streamFile'](_0x13a9fb,_0x3a51f9[_0x9973('0x10c')]);try{fs[_0x9973('0xd4')](_0x13a9fb+_0x9973('0xfc'));}catch(_0x5c0eee){logger[_0x9973('0x28')](_0x5c0eee);}return _0x5e3dfa;}return this[_0x9973('0x35')]['error'](_0x3a51f9,_0x9973('0x130'));};AGIVertices[_0x9973('0xd')][_0x9973('0x131')]=function(_0x445592){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x132'),_0x445592[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x445592[_0x9973('0x133')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x445592,_0x9973('0x134'));}logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x135'),this['channel'][_0x9973('0x3a')],_0x445592[_0x9973('0x133')]));var _0x35b8f6=this[_0x9973('0x52')][_0x9973('0x80')](this,_0x445592[_0x9973('0x133')]);if(_0x35b8f6){logger['info'](util[_0x9973('0x25')](_0x9973('0x136'),this['channel']['callerid'],_0x445592[_0x9973('0x133')]));this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9973('0x35')][_0x9973('0x3a')],_0x445592[_0x9973('0x133')]));return{'code':0xc8,'result':_0x9973('0x137')};}else{logger[_0x9973('0x2c')](util[_0x9973('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9973('0x35')][_0x9973('0x3a')],_0x445592[_0x9973('0x133')]));this[_0x9973('0x35')]['noop'](util[_0x9973('0x25')](_0x9973('0x138'),this['channel']['callerid'],_0x445592[_0x9973('0x133')]));return{'code':0xc8,'result':_0x9973('0x139')};}};AGIVertices[_0x9973('0xd')]['logout']=function(_0x18f411){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x13a'),_0x18f411[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x18f411[_0x9973('0x133')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x18f411,_0x9973('0x134'));}logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x135'),this[_0x9973('0x35')]['callerid'],_0x18f411[_0x9973('0x133')]));var _0x56cdad=this['agentLogout'][_0x9973('0x80')](this,_0x18f411[_0x9973('0x133')]);if(_0x56cdad){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x136'),this[_0x9973('0x35')][_0x9973('0x3a')],_0x18f411[_0x9973('0x133')]));this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x136'),this['channel'][_0x9973('0x3a')],_0x18f411['findBy']));return{'code':0xc8,'result':_0x9973('0x137')};}else{logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x138'),this[_0x9973('0x35')][_0x9973('0x3a')],_0x18f411[_0x9973('0x133')]));this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x138'),this['channel'][_0x9973('0x3a')],_0x18f411[_0x9973('0x133')]));return{'code':0xc8,'result':_0x9973('0x139')};}};AGIVertices['prototype'][_0x9973('0x13b')]=function(_0x3cd9bf){logger[_0x9973('0x2c')](util['format'](_0x9973('0x13c'),_0x3cd9bf[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x3cd9bf[_0x9973('0x13d')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x3cd9bf,_0x9973('0x13e'));}this[_0x9973('0x35')][_0x9973('0x8b')](util['format']('math\x20%s',_0x3cd9bf[_0x9973('0x13d')]));var _0x4817af=eval(_0x3cd9bf[_0x9973('0x13d')]);if(!this[_0x9973('0x65')](_0x3cd9bf[_0x9973('0xad')])){return this[_0x9973('0x35')][_0x9973('0x8b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1cad02=this['getVariable']['sync'](this,_0x3cd9bf['variable_id']);if(!_0x1cad02){return this[_0x9973('0x35')][_0x9973('0x28')](_0x3cd9bf,_0x9973('0xaf'));}if(_[_0x9973('0x13f')](_0x4817af)){var _0x1c825e=this;_0x4817af[_0x9973('0x140')](function(_0x1adde8,_0x31de59){_0x1c825e[_0x9973('0x35')][_0x9973('0xb2')](util[_0x9973('0x25')]('%s[%s]',_0x1cad02,_0x31de59),_0x1adde8);});return this['channel'][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x141'),_0x1cad02));}else{return this[_0x9973('0x35')][_0x9973('0xb2')](_0x1cad02,_0x4817af);}};AGIVertices['prototype']['menu']=function(_0x507f52){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x507f52['label']));if(_0x507f52[_0x9973('0xe5')]===0x0){return this[_0x9973('0x7f')](_0x507f52);}_0x507f52[_0x9973('0xe5')]-=0x1;if(!this[_0x9973('0x65')](_0x507f52['file_id'])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x507f52,_0x9973('0xe6'));}var _0x2538c7=this['getSound'][_0x9973('0x80')](this,_0x507f52[_0x9973('0x142')]);if(!_0x2538c7){return this['channel'][_0x9973('0x28')](_0x507f52,_0x9973('0xe7'));}var _0x31f8f9=this['channel']['getData'](_0x2538c7,_0x507f52[_0x9973('0xe9')],_0x507f52[_0x9973('0x143')]);var _0x1f4965=_0x31f8f9[_0x9973('0x7e')];if(_0x31f8f9[_0x9973('0x7e')]===-0x1){this[_0x9973('0x34')][_0x9973('0x80')](this,_0x507f52,'-1');return _0x31f8f9;}else if(_0x31f8f9[_0x9973('0x7c')]===_0x9973('0x82')){_0x31f8f9[_0x9973('0x7e')]=_0x31f8f9[_0x9973('0x7e')][_0x9973('0x7b')]>0x0?_0x31f8f9[_0x9973('0x7e')]:'t';}else if(_[_0x9973('0x43')](_0x31f8f9[_0x9973('0x7e')])){_0x31f8f9['result']='#';_0x1f4965='#';}if(!this['isConfigured'](_0x507f52[_0x9973('0xad')])){this[_0x9973('0x35')][_0x9973('0x8b')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x6321d=this[_0x9973('0xe')][_0x9973('0x80')](this,_0x507f52[_0x9973('0xad')]);if(!_0x6321d){return this[_0x9973('0x35')]['error'](_0x507f52,'no\x20variable\x20found');}this[_0x9973('0x35')][_0x9973('0xb2')](_0x6321d,_0x1f4965);}this[_0x9973('0x34')][_0x9973('0x80')](this,_0x507f52,_0x1f4965);return _0x31f8f9;};AGIVertices['prototype'][_0x9973('0x8b')]=function(_0x3fce59){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x144'),_0x3fce59[_0x9973('0x37')]));return this[_0x9973('0x35')][_0x9973('0x8b')](_0x3fce59[_0x9973('0x145')]||_0x3fce59[_0x9973('0x37')]);};AGIVertices[_0x9973('0xd')][_0x9973('0x146')]=function(_0x524562){logger['info'](util[_0x9973('0x25')](_0x9973('0x147'),_0x524562[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x524562[_0x9973('0x133')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x524562,_0x9973('0x134'));}logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x135'),this[_0x9973('0x35')][_0x9973('0x3a')],_0x524562['findBy']));var _0x2398a1=this[_0x9973('0x4c')]['sync'](this,_0x524562[_0x9973('0x148')]);var _0x1c9720=this[_0x9973('0x4e')][_0x9973('0x80')](this,_0x524562[_0x9973('0x133')],_0x2398a1);if(_0x1c9720){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9973('0x35')][_0x9973('0x3a')],_0x524562[_0x9973('0x133')]));this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x136'),this[_0x9973('0x35')][_0x9973('0x3a')],_0x524562['findBy']));return{'code':0xc8,'result':_0x9973('0x137')};}else{logger['info'](util[_0x9973('0x25')](_0x9973('0x138'),this[_0x9973('0x35')]['callerid'],_0x524562[_0x9973('0x133')]));this['channel']['noop'](util['format'](_0x9973('0x136'),this[_0x9973('0x35')][_0x9973('0x3a')],_0x524562[_0x9973('0x133')]));return{'code':0xc8,'result':_0x9973('0x139')};}};AGIVertices[_0x9973('0xd')][_0x9973('0x149')]=function(_0x5d98a6){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x14a'),_0x5d98a6[_0x9973('0x37')]));if(!this['isConfigured'](_0x5d98a6['file_id'])){return this[_0x9973('0x35')]['error'](_0x5d98a6,'no\x20file\x20audio\x20selected');}var _0x31c53c=this[_0x9973('0x1c')][_0x9973('0x80')](this,_0x5d98a6[_0x9973('0x142')]);if(!_0x31c53c){return this[_0x9973('0x35')][_0x9973('0x28')](_0x5d98a6,_0x9973('0xe7'));}var _0x1d8bfb=this[_0x9973('0x35')][_0x9973('0x8f')](_0x9973('0x14b'),[_0x31c53c,_0x5d98a6[_0x9973('0xb9')]]);if(_0x1d8bfb[_0x9973('0x7e')]===-0x1){return _0x1d8bfb;}return this[_0x9973('0x35')]['noop'](util[_0x9973('0x25')](_0x9973('0x92'),_0x9973('0x14b'),_0x31c53c));};AGIVertices[_0x9973('0xd')][_0x9973('0x14c')]=function(_0x422439){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x422439['label']));if(!this[_0x9973('0x65')](_0x422439[_0x9973('0x14d')])){return this['channel'][_0x9973('0x28')](_0x422439,'no\x20queue\x20selected');}var _0x36d671='';var _0x47f3ed=parseInt(_0x422439[_0x9973('0x14d')],0xa);if(isNaN(_0x47f3ed)){_0x36d671=_0x422439['queue_id'];}else{_0x36d671=this['getVoiceQueue']['sync'](this,_0x422439[_0x9973('0x14d')]);if(!_0x36d671){return this[_0x9973('0x35')][_0x9973('0x28')](_0x422439,_0x9973('0x14e'));}}var _0x5b3ffe='';if(this[_0x9973('0x65')](_0x422439['file_id'])){var _0x2ff880=this[_0x9973('0x1c')]['sync'](this,_0x422439[_0x9973('0x142')]);if(_0x2ff880){_0x5b3ffe=_0x2ff880;}}this[_0x9973('0x34')][_0x9973('0x80')](this,_0x422439,_0x36d671);if(_0x422439[_0x9973('0xb9')][_0x9973('0x14f')]('x')<0x0){_0x422439[_0x9973('0xb9')]+='x';}if(_0x422439[_0x9973('0xb9')]['indexOf']('X')<0x0){_0x422439['opts']+='X';}this[_0x9973('0x35')][_0x9973('0xb2')](_0x9973('0x150'),_0x36d671?_0x36d671[_0x9973('0x151')]():'');var _0x55f6e4=this['channel'][_0x9973('0x8f')]('QUEUE',[_0x36d671,_0x422439[_0x9973('0xb9')],_0x422439['url'],_0x5b3ffe,_0x422439[_0x9973('0x82')],_0x422439[_0x9973('0x152')],_0x422439['macro'],_0x422439[_0x9973('0x153')],'',_0x422439[_0x9973('0x154')]]);if(_0x55f6e4[_0x9973('0x7e')]===-0x1){return _0x55f6e4;}return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x92'),_0x9973('0x155'),_0x36d671));};AGIVertices[_0x9973('0xd')][_0x9973('0x156')]=function(_0x1a454a){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x1a454a[_0x9973('0x37')]));var _0x10f98e=_0x1a454a[_0x9973('0x157')]||'wav';var _0x26ff23=util[_0x9973('0x25')](_0x9973('0x158'),this[_0x9973('0x35')][_0x9973('0x36')],rs['generate'](0x5));var _0x231361=util[_0x9973('0x25')](_0x9973('0x159'),FILES_PATH,_0x26ff23,_0x10f98e);var _0x324e69=util['format']('%s/recordings/%s',FILES_PATH,_0x26ff23);this[_0x9973('0x39')][_0x9973('0x80')](this,_0x1a454a,_0x26ff23,_0x231361);this[_0x9973('0x35')][_0x9973('0xb2')](_0x9973('0x15a'),_0x26ff23);logger[_0x9973('0x2c')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x324e69,_0x10f98e,_0x1a454a[_0x9973('0x15b')],_0x1a454a[_0x9973('0x82')]);return this[_0x9973('0x35')][_0x9973('0x10b')](_0x324e69,_0x10f98e,_0x1a454a[_0x9973('0x15b')],_0x1a454a[_0x9973('0x82')],undefined,!![]);};AGIVertices[_0x9973('0xd')][_0x9973('0x15c')]=function(_0x750744){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x750744['label']));return this[_0x9973('0x35')][_0x9973('0x15d')](_0x750744[_0x9973('0x15e')][_0x9973('0x57')](/\s+/g,''),_0x750744[_0x9973('0x15b')]);};AGIVertices[_0x9973('0xd')]['saynumber']=function(_0x5a9fdf){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x15f'),_0x5a9fdf['label']));return this[_0x9973('0x35')]['sayNumber'](_0x5a9fdf[_0x9973('0x160')][_0x9973('0x57')](/\s+/g,''),_0x5a9fdf['escape_digits']);};AGIVertices[_0x9973('0xd')][_0x9973('0x161')]=function(_0x1d519a){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x1d519a[_0x9973('0x37')]));return this['channel'][_0x9973('0x162')](_0x1d519a[_0x9973('0x59')],_0x1d519a[_0x9973('0x15b')]);};AGIVertices[_0x9973('0xd')][_0x9973('0x163')]=function(_0x4ab2ae){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x4ab2ae[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x4ab2ae[_0x9973('0x164')])){return this[_0x9973('0x35')][_0x9973('0x8b')]('no\x20mail\x20account\x20configured');}var _0x2c744f=this[_0x9973('0x1e')]['sync'](this,_0x4ab2ae[_0x9973('0x164')]);if(!_0x2c744f||!_0x2c744f[_0x9973('0x165')]){return this['channel'][_0x9973('0x28')](_0x4ab2ae,_0x9973('0x166'));}var _0x4aa245={'from':util[_0x9973('0x25')](_0x9973('0x167'),_0x2c744f[_0x9973('0x11')],_0x2c744f[_0x9973('0x168')]||_0x2c744f[_0x9973('0x165')][_0x9973('0x169')]),'to':_0x4ab2ae['to']||'','cc':_0x4ab2ae['cc']||'','bcc':_0x4ab2ae[_0x9973('0x16a')]||'','subject':_0x4ab2ae[_0x9973('0x16b')],'html':_0x4ab2ae['text'],'text':_0x4ab2ae['text']};var _0x322d91={'tls':{'rejectUnauthorized':![]}};if(_0x2c744f['Smtp'][_0x9973('0x16c')]){_0x322d91[_0x9973('0x16c')]=_0x2c744f[_0x9973('0x165')]['service'];}else{_0x322d91[_0x9973('0x16d')]=_0x2c744f[_0x9973('0x165')]['host'];_0x322d91[_0x9973('0x16e')]=_0x2c744f[_0x9973('0x165')][_0x9973('0x16e')];_0x322d91[_0x9973('0x16f')]=_0x2c744f[_0x9973('0x165')][_0x9973('0x16f')];}if(_0x2c744f[_0x9973('0x165')][_0x9973('0x170')]){_0x322d91[_0x9973('0x171')]={'user':_0x2c744f[_0x9973('0x165')]['user'],'pass':_0x2c744f[_0x9973('0x165')][_0x9973('0x172')]};}if(this[_0x9973('0x65')](_0x4ab2ae[_0x9973('0x173')])){}logger[_0x9973('0xb5')](_0x9973('0x174'),JSON[_0x9973('0x110')](_0x4aa245));this[_0x9973('0x34')][_0x9973('0x80')](this,_0x4ab2ae,_0x4ab2ae[_0x9973('0x164')]);this['channel'][_0x9973('0x8b')](util['format'](_0x9973('0x175'),_0x2c744f[_0x9973('0x11')]));this['sendMailMessage']['sync'](this,_0x322d91,_0x4aa245);return this['channel'][_0x9973('0x8b')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x9973('0xd')]['sendFax']=function(_0x4b8173){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x176'),_0x4b8173[_0x9973('0x37')]));return this[_0x9973('0x35')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x9973('0xd')][_0x9973('0x177')]=function(_0xc7d2c6){logger[_0x9973('0x2c')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0xc7d2c6['label']));if(!this['isConfigured'](_0xc7d2c6[_0x9973('0x178')])){return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x179'));}var _0x13002b=this[_0x9973('0x31')]['sync'](this,_0xc7d2c6[_0x9973('0x178')]);if(!_0x13002b){return this[_0x9973('0x35')][_0x9973('0x28')](_0xc7d2c6,'no\x20sms\x20account\x20found');}var _0x1e297e={'body':_0xc7d2c6[_0x9973('0x17a')],'phone':_0xc7d2c6['to']||'','SmsAccountId':_0x13002b['id']};logger[_0x9973('0xb5')](_0x9973('0x17b'),JSON['stringify'](_0x1e297e));this[_0x9973('0x34')][_0x9973('0x80')](this,_0xc7d2c6,_0xc7d2c6[_0x9973('0x178')]);this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x17c'),_0x13002b['name']));this[_0x9973('0x33')][_0x9973('0x80')](this,_0x1e297e);return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x17d'));};AGIVertices[_0x9973('0xd')][_0x9973('0x17e')]=function(_0x103f77){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x17f'),_0x103f77[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x103f77[_0x9973('0xad')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x103f77,_0x9973('0x180'));}var _0x2c9dfb=this['getVariable'][_0x9973('0x80')](this,_0x103f77['variable_id']);if(!_0x2c9dfb){return this[_0x9973('0x35')][_0x9973('0x28')](_0x103f77,'no\x20variable\x20found');}return this[_0x9973('0x35')]['setVariable'](_0x2c9dfb,_0x103f77[_0x9973('0x181')]);};AGIVertices['prototype'][_0x9973('0x182')]=function(_0x10cbc3){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x183'),_0x10cbc3['label']));this[_0x9973('0x35')]['noop']('START\x20CALLY\x20SQUARE');if(_0x10cbc3[_0x9973('0x85')]===_0x9973('0x184')){this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x185'));return this['channel'][_0x9973('0x85')]();}return this[_0x9973('0x35')][_0x9973('0x8b')](_0x9973('0x186'));};AGIVertices[_0x9973('0xd')][_0x9973('0x187')]=function(_0x3c61d3){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x188'),_0x3c61d3[_0x9973('0x37')]));if(!this['isConfigured'](_0x3c61d3[_0x9973('0x189')])){return this[_0x9973('0x35')]['error'](_0x3c61d3,_0x9973('0x18a'));}var _0x283de5=this[_0x9973('0x15')][_0x9973('0x80')](this,_0x3c61d3['project_id']);if(!this[_0x9973('0x65')](_0x283de5)){return this['channel'][_0x9973('0x28')](_0x3c61d3,util['format'](_0x9973('0x18b'),_0x3c61d3[_0x9973('0x189')]));}if(_0x283de5===this['channel'][_0x9973('0x18c')]){return this[_0x9973('0x35')][_0x9973('0x28')](_0x3c61d3,_0x9973('0x18d'));}this['createSquareDetailsReport'][_0x9973('0x80')](this,_0x3c61d3,_0x283de5);var _0x3ea578=this['channel'][_0x9973('0x8f')](_0x9973('0x18e'),util['format'](_0x9973('0x18f'),config['agi']['host']||'127.0.0.1',_0x283de5,this[_0x9973('0x35')][_0x9973('0x18c')]));if(_0x3ea578[_0x9973('0x7e')]===-0x1){return _0x3ea578;}return this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x92'),_0x9973('0x18e'),_0x283de5));};AGIVertices['prototype']['system']=function(_0x17d8c3){logger[_0x9973('0x2c')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x17d8c3['label']));var _0x5c7653=this['shellCommand'][_0x9973('0x80')](this,_0x17d8c3['command']);this[_0x9973('0x34')]['sync'](this,_0x17d8c3,_0x17d8c3[_0x9973('0x81')]);if(this[_0x9973('0x65')](_0x17d8c3[_0x9973('0xad')])){var _0x125d20=this[_0x9973('0xe')][_0x9973('0x80')](this,_0x17d8c3[_0x9973('0xad')]);if(_0x125d20){this['channel'][_0x9973('0xb2')](_0x125d20,_0x5c7653);return this['channel'][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x190'),_0x17d8c3[_0x9973('0x81')],_0x125d20));}}return this['channel']['noop'](util[_0x9973('0x25')](_0x9973('0x191'),_0x17d8c3[_0x9973('0x81')]));};AGIVertices['prototype']['tts']=function(_0x32a668){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x192'),_0x32a668[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x32a668[_0x9973('0x59')])){return this['channel'][_0x9973('0x8b')]('no\x20text\x20configured');}this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x193'),_0x32a668[_0x9973('0x59')]));var _0x43a805=this[_0x9973('0x58')]['sync'](this,_0x32a668);if(_0x43a805){this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')]('Google\x20TTS\x20%s\x20file\x20created',_0x43a805));var _0xc4e64e=this[_0x9973('0x35')][_0x9973('0xd3')](_0x43a805);try{fs[_0x9973('0xd4')](_0x43a805+_0x9973('0xfc'));}catch(_0x151f90){logger[_0x9973('0x28')](_0x151f90);}return _0xc4e64e;}return this['channel'][_0x9973('0x28')](_0x32a668,_0x9973('0x194'));};AGIVertices[_0x9973('0xd')][_0x9973('0x195')]=function(_0x150e41){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x196'),_0x150e41['label']));if(!this[_0x9973('0x65')](_0x150e41[_0x9973('0x133')])){return this[_0x9973('0x35')][_0x9973('0x28')](_0x150e41,_0x9973('0x134'));}logger['info'](util[_0x9973('0x25')](_0x9973('0x135'),this[_0x9973('0x35')]['callerid'],_0x150e41['findBy']));var _0x55765a=this[_0x9973('0x50')]['sync'](this,_0x150e41[_0x9973('0x133')]);if(_0x55765a){logger[_0x9973('0x2c')](util[_0x9973('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x150e41['findBy']));this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x150e41[_0x9973('0x133')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x138'),this[_0x9973('0x35')][_0x9973('0x3a')],_0x150e41[_0x9973('0x133')]));this[_0x9973('0x35')][_0x9973('0x8b')](util[_0x9973('0x25')](_0x9973('0x138'),this[_0x9973('0x35')][_0x9973('0x3a')],_0x150e41['findBy']));return{'code':0xc8,'result':_0x9973('0x139')};}};AGIVertices[_0x9973('0xd')][_0x9973('0x197')]=function(_0x530b21){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x198'),_0x530b21[_0x9973('0x37')]));var _0x2f1c20=this[_0x9973('0x35')][_0x9973('0x8f')](_0x9973('0x199'),[_0x530b21[_0x9973('0x19a')],_0x530b21[_0x9973('0x91')]]);if(_0x2f1c20[_0x9973('0x7e')]===-0x1){return _0x2f1c20;}return this[_0x9973('0x35')]['noop'](util[_0x9973('0x25')](_0x9973('0x92'),_0x9973('0x199'),_0x530b21[_0x9973('0x19a')]));};AGIVertices['prototype'][_0x9973('0x19b')]=function(_0x352c0c){logger[_0x9973('0x2c')](util[_0x9973('0x25')](_0x9973('0x19c'),_0x352c0c[_0x9973('0x37')]));if(!this[_0x9973('0x65')](_0x352c0c[_0x9973('0xad')])){return this['channel'][_0x9973('0x28')](_0x352c0c,_0x9973('0x180'));}var _0xa66bcb=this['getVariable']['sync'](this,_0x352c0c[_0x9973('0xad')]);if(!_0xa66bcb){return this[_0x9973('0x35')][_0x9973('0x28')](_0x352c0c,_0x9973('0xaf'));}var _0x57893d=this['channel'][_0x9973('0xe')](_0xa66bcb);return{'code':0xc8,'result':_0x57893d['extra']?_0x57893d[_0x9973('0x7c')]:'-'};};String[_0x9973('0xd')][_0x9973('0x19d')]=function(_0x232dbf,_0x31b298){return this[_0x9973('0x7a')](_0x232dbf)[_0x9973('0x19e')](_0x31b298);};module['exports']=AGIVertices;
\ No newline at end of file
index 9e2cb9d..38a41fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','Action','QueuePause','ACW','then','info','[%s][START][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]'];(function(_0x689daf,_0x3ed464){var _0xb8fafd=function(_0x3dfa73){while(--_0x3dfa73){_0x689daf['push'](_0x689daf['shift']());}};_0xb8fafd(++_0x3ed464);}(_0x425d,0x1e0));var _0xd425=function(_0x5f0c76,_0x44b266){_0x5f0c76=_0x5f0c76-0x0;var _0x308606=_0x425d[_0x5f0c76];return _0x308606;};'use strict';var util=require(_0xd425('0x0'));var _=require('lodash');var moment=require(_0xd425('0x1'));var ami=require(_0xd425('0x2'));var logger=require(_0xd425('0x3'))(_0xd425('0x4'));var RpcUser=require(_0xd425('0x5'));var RpcVoiceAgentReport=require(_0xd425('0x6'));function Acw(_0x47043f){this['voiceQueues']=_0x47043f[_0xd425('0x7')];this[_0xd425('0x8')]=_0x47043f[_0xd425('0x8')];this[_0xd425('0x9')]=_0x47043f[_0xd425('0x9')];this[_0xd425('0xa')]={};ami['on']('agentconnect',this[_0xd425('0xb')][_0xd425('0xc')](this));ami['on'](_0xd425('0xd'),this[_0xd425('0xe')][_0xd425('0xc')](this));ami['on'](_0xd425('0xf'),this[_0xd425('0x10')][_0xd425('0xc')](this));ami['on'](_0xd425('0x11'),this[_0xd425('0x12')][_0xd425('0xc')](this));ami['on'](_0xd425('0x13'),this[_0xd425('0x14')][_0xd425('0xc')](this));ami['on'](_0xd425('0x15'),this[_0xd425('0x16')][_0xd425('0xc')](this));ami['on'](_0xd425('0x17'),this[_0xd425('0x18')][_0xd425('0xc')](this));}function getDiff(_0x51263f){var _0x27318c=moment()[_0xd425('0x19')](0x0);var _0x336dc3=moment(_0x51263f)['milliseconds'](0x0);return _0x27318c[_0xd425('0x1a')](_0x336dc3,_0xd425('0x1b'));}Acw[_0xd425('0x1c')][_0xd425('0x1d')]=function(_0x1fc822){try{var _0x538a0a=this;var _0x278626=this[_0xd425('0xa')][_0x1fc822][_0xd425('0x1e')];var _0x5dda0c=this['channels'][_0x1fc822][_0xd425('0x1f')];ami[_0xd425('0x20')]({'action':_0xd425('0x21'),'interface':_0x278626,'paused':!![],'reason':_0xd425('0x22')})['then'](function(_0x58a0c1){if(_0x538a0a['agents'][_0x278626]){return RpcUser['getAgent'](_0x538a0a[_0xd425('0x8')][_0x278626]['id'])[_0xd425('0x23')](function(_0x3c98db){if(_0x3c98db&&!_0x3c98db['voicePause']){logger[_0xd425('0x24')](_0xd425('0x25'),_0x1fc822,_0x278626,_0x5dda0c);return RpcUser['savePause'](_0x538a0a[_0xd425('0x8')][_0x278626],_0xd425('0x22'),_0x1fc822)[_0xd425('0x23')](function(_0x1d3fc0){_0x538a0a[_0xd425('0x9')][_0x278626]={};logger[_0xd425('0x24')](_0xd425('0x26'),_0x1fc822,_0x538a0a[_0xd425('0x7')][_0x5dda0c][_0xd425('0x27')],_0x278626,_0x5dda0c);_0x538a0a[_0xd425('0x9')][_0x278626][_0xd425('0x28')]=setTimeout(_0x538a0a[_0xd425('0x29')]['bind'](_0x538a0a,_0x278626),_0x538a0a[_0xd425('0x7')][_0x5dda0c][_0xd425('0x27')]*0x3e8);_0x538a0a[_0xd425('0x9')][_0x278626][_0xd425('0x2a')]=_0x1d3fc0[_0xd425('0x2a')];_0x538a0a[_0xd425('0x9')][_0x278626][_0xd425('0x2b')]=_0x1fc822;_0x538a0a['timers'][_0x278626][_0xd425('0x1f')]=_0x5dda0c;_0x538a0a[_0xd425('0x9')][_0x278626][_0xd425('0x2c')]=function(){var _0x57c950=getDiff(_0x538a0a[_0xd425('0x9')][_0x278626][_0xd425('0x2a')]);clearTimeout(_0x538a0a[_0xd425('0x9')][_0x278626][_0xd425('0x28')]);RpcVoiceAgentReport[_0xd425('0x2d')]({'acwtime':_0x57c950},_0x538a0a[_0xd425('0x9')][_0x278626][_0xd425('0x2b')],_0x278626)[_0xd425('0x23')](function(_0x24da23){logger[_0xd425('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0x1fc822,_0x57c950,_0x24da23);})[_0xd425('0x2e')](function(_0x219ada){logger[_0xd425('0x2f')](_0xd425('0x30'),_0x1fc822,_0x219ada);});delete _0x538a0a[_0xd425('0x9')][_0x278626];};});}else{logger[_0xd425('0x24')](_0xd425('0x31'),_0x1fc822,_0x278626,_0x5dda0c);}});}})[_0xd425('0x2e')](function(_0x3ec51b){logger[_0xd425('0x2f')](_0xd425('0x26'),_0x1fc822,_0x538a0a['voiceQueues'][_0x5dda0c][_0xd425('0x27')],_0x278626,_0x5dda0c);})[_0xd425('0x32')](function(){delete _0x538a0a[_0xd425('0xa')][_0x1fc822];});}catch(_0x21e0bd){logger[_0xd425('0x2f')]('[ACW][START]\x20%s',_0x21e0bd[_0xd425('0x33')]);}};Acw[_0xd425('0x1c')]['stopAcw']=function(_0x574962){try{var _0x51669d=this;if(_0x51669d[_0xd425('0x9')][_0x574962]){var _0xfb0c8=_0x51669d[_0xd425('0x9')][_0x574962][_0xd425('0x2b')];var _0x4aa5b2=_0x51669d[_0xd425('0x9')][_0x574962][_0xd425('0x1f')];var _0x30a9dc=_0x51669d[_0xd425('0x7')][_0x4aa5b2][_0xd425('0x27')];logger[_0xd425('0x24')](_0xd425('0x34'),_0x574962);RpcUser['saveUnpause'](this[_0xd425('0x8')][_0x574962]);RpcVoiceAgentReport['update']({'acwtime':_0x30a9dc,'agentacw':!![]},_0xfb0c8,_0x574962)[_0xd425('0x23')](function(_0x29cca9){logger[_0xd425('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0xfb0c8,_0x30a9dc,_0x29cca9);})[_0xd425('0x2e')](function(_0x26806c){logger[_0xd425('0x2f')](_0xd425('0x30'),_0xfb0c8,_0x26806c);});}else{logger['error'](_0xd425('0x35'),_0x574962);if(_0x51669d[_0xd425('0x9')]){logger['info']('[ACW][TIMERS]',JSON['stringify'](_0x51669d[_0xd425('0x9')]));}}}catch(_0x400d57){logger[_0xd425('0x2f')]('[ACW][STOP]\x20%s',_0x400d57['message']);}};Acw['prototype'][_0xd425('0xb')]=function(_0x3f9090){try{if(this[_0xd425('0x7')][_0x3f9090[_0xd425('0x1f')]]&&this[_0xd425('0x7')][_0x3f9090[_0xd425('0x1f')]][_0xd425('0x4')]){if(this['agents'][_0x3f9090[_0xd425('0x1e')]]){this[_0xd425('0xa')][_0x3f9090[_0xd425('0x2b')]]={'queue':_0x3f9090['queue'],'interface':_0x3f9090[_0xd425('0x1e')]};}}}catch(_0x2dffc7){logger[_0xd425('0x2f')]('[ACW][syncAgentConnect]\x20%s',_0x2dffc7[_0xd425('0x33')]);}};Acw[_0xd425('0x1c')][_0xd425('0x18')]=function(_0x2d7a2f){try{if(this['voiceQueues'][_0x2d7a2f[_0xd425('0x1f')]]&&this[_0xd425('0x7')][_0x2d7a2f[_0xd425('0x1f')]][_0xd425('0x4')]){if(this[_0xd425('0x8')][_0x2d7a2f[_0xd425('0x1e')]]){this[_0xd425('0xa')][_0x2d7a2f['uniqueid']]={'queue':_0x2d7a2f[_0xd425('0x1f')],'interface':_0x2d7a2f[_0xd425('0x1e')]};}}}catch(_0x5b65fe){logger[_0xd425('0x2f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x5b65fe['message']);}};Acw[_0xd425('0x1c')]['syncHangupRequest']=function(_0x1be60a){try{if(this['channels'][_0x1be60a[_0xd425('0x2b')]]&&_[_0xd425('0x36')](this[_0xd425('0xa')][_0x1be60a[_0xd425('0x2b')]][_0xd425('0x37')])){logger['info'](_0xd425('0x38'),_0x1be60a['uniqueid']);this[_0xd425('0x1d')](_0x1be60a['uniqueid']);}else if(this[_0xd425('0xa')][_0x1be60a[_0xd425('0x39')]]&&_[_0xd425('0x36')](this[_0xd425('0xa')][_0x1be60a[_0xd425('0x39')]]['attended'])){logger[_0xd425('0x24')](_0xd425('0x3a'),_0x1be60a[_0xd425('0x39')]);this[_0xd425('0x1d')](_0x1be60a[_0xd425('0x39')]);}}catch(_0x499796){logger[_0xd425('0x2f')](_0xd425('0x3b'),_0x499796[_0xd425('0x33')]);}};Acw[_0xd425('0x1c')][_0xd425('0x10')]=function(_0xf7a74c){try{if(this['channels'][_0xf7a74c[_0xd425('0x2b')]]&&this[_0xd425('0xa')][_0xf7a74c['uniqueid']][_0xd425('0x37')]){logger[_0xd425('0x24')](_0xd425('0x3c'),_0xf7a74c[_0xd425('0x2b')]);this['startAcw'](_0xf7a74c[_0xd425('0x2b')]);}else if(this[_0xd425('0xa')][_0xf7a74c[_0xd425('0x39')]]&&this[_0xd425('0xa')][_0xf7a74c[_0xd425('0x39')]]['attended']){logger['info'](_0xd425('0x3d'),_0xf7a74c['linkedid']);this[_0xd425('0x1d')](_0xf7a74c[_0xd425('0x39')]);}}catch(_0x5594f9){logger[_0xd425('0x2f')]('[ACW][syncHangup]\x20%s',_0x5594f9['message']);}};Acw[_0xd425('0x1c')][_0xd425('0x14')]=function(_0xe6451f){try{if(!_[_0xd425('0x3e')](this[_0xd425('0xa')][_0xe6451f[_0xd425('0x3f')]])){this[_0xd425('0x1d')](_0xe6451f[_0xd425('0x3f')]);if(this['channels'][_0xe6451f[_0xd425('0x40')]]){this[_0xd425('0xa')][_0xe6451f[_0xd425('0x40')]][_0xd425('0x37')]=!![];this[_0xd425('0xa')][_0xe6451f[_0xd425('0x41')]]=this[_0xd425('0xa')][_0xe6451f[_0xd425('0x40')]];delete this['channels'][_0xe6451f['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0xd425('0xa')][_0xe6451f[_0xd425('0x41')]])){this[_0xd425('0x1d')](_0xe6451f[_0xd425('0x41')]);if(this['channels'][_0xe6451f['origtransfereruniqueid']]){this['channels'][_0xe6451f['origtransfereruniqueid']][_0xd425('0x37')]=!![];this[_0xd425('0xa')][_0xe6451f['transfereeuniqueid']]=this[_0xd425('0xa')][_0xe6451f[_0xd425('0x42')]];delete this[_0xd425('0xa')][_0xe6451f['origtransfereruniqueid']];}}}catch(_0x517e2e){logger[_0xd425('0x2f')]('[ACW][syncAttendedTransfer]\x20%s',_0x517e2e['message']);}};Acw['prototype'][_0xd425('0x16')]=function(_0x259482){try{if(this[_0xd425('0xa')][_0x259482['transfereruniqueid']]){logger[_0xd425('0x24')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xd425('0x43')](_0x259482[_0xd425('0x44')]));this[_0xd425('0x1d')](_0x259482[_0xd425('0x44')]);}else if(this[_0xd425('0xa')][_0x259482[_0xd425('0x45')]]){logger[_0xd425('0x24')](_0xd425('0x46'),JSON[_0xd425('0x43')](_0x259482['transfererlinkedid']));this[_0xd425('0x1d')](_0x259482[_0xd425('0x45')]);}}catch(_0x18dc33){logger[_0xd425('0x2f')]('[ACW][syncBlindTransfer]\x20%s',_0x18dc33['message']);}};Acw[_0xd425('0x1c')][_0xd425('0x12')]=function(_0x142660){try{if(this[_0xd425('0x7')][_0x142660[_0xd425('0x1f')]]&&this[_0xd425('0x7')][_0x142660[_0xd425('0x1f')]][_0xd425('0x47')]===_0xd425('0x48')){if(this[_0xd425('0x8')][_0x142660[_0xd425('0x1e')]]){logger[_0xd425('0x24')](_0xd425('0x49'),_0x142660[_0xd425('0x2b')],_0x142660['interface'],_0x142660[_0xd425('0x1f')]);return RpcUser[_0xd425('0x4a')](this[_0xd425('0x8')][_0x142660['interface']],'Auto-Pause',_0x142660['uniqueid']);}}}catch(_0x403cb3){logger[_0xd425('0x2f')](_0xd425('0x4b'),_0x403cb3['message']);}};module[_0xd425('0x4c')]=Acw;
\ No newline at end of file
+var _0xf494=['lastPauseAt','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','attended','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','channels','interface','queue','Action','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw'];(function(_0x2052e5,_0xed46df){var _0x5330b8=function(_0x1d6d28){while(--_0x1d6d28){_0x2052e5['push'](_0x2052e5['shift']());}};_0x5330b8(++_0xed46df);}(_0xf494,0x1c6));var _0x4f49=function(_0x520258,_0x369afd){_0x520258=_0x520258-0x0;var _0x27545c=_0xf494[_0x520258];return _0x27545c;};'use strict';var util=require(_0x4f49('0x0'));var _=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var ami=require('../ami');var logger=require(_0x4f49('0x3'))(_0x4f49('0x4'));var RpcUser=require(_0x4f49('0x5'));var RpcVoiceAgentReport=require(_0x4f49('0x6'));function Acw(_0x20c0d7){this[_0x4f49('0x7')]=_0x20c0d7[_0x4f49('0x7')];this[_0x4f49('0x8')]=_0x20c0d7[_0x4f49('0x8')];this[_0x4f49('0x9')]=_0x20c0d7[_0x4f49('0x9')];this['channels']={};ami['on']('agentconnect',this[_0x4f49('0xa')][_0x4f49('0xb')](this));ami['on'](_0x4f49('0xc'),this[_0x4f49('0xd')][_0x4f49('0xb')](this));ami['on'](_0x4f49('0xe'),this[_0x4f49('0xf')][_0x4f49('0xb')](this));ami['on']('agentringnoanswer',this[_0x4f49('0x10')][_0x4f49('0xb')](this));ami['on']('attendedtransfer',this[_0x4f49('0x11')]['bind'](this));ami['on']('blindtransfer',this[_0x4f49('0x12')][_0x4f49('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x4f49('0x13')][_0x4f49('0xb')](this));}function getDiff(_0x1b9145){var _0x2efe49=moment()[_0x4f49('0x14')](0x0);var _0x2f0131=moment(_0x1b9145)[_0x4f49('0x14')](0x0);return _0x2efe49['diff'](_0x2f0131,_0x4f49('0x15'));}Acw[_0x4f49('0x16')][_0x4f49('0x17')]=function(_0x5878f4){try{var _0x5bdfaf=this;var _0x2f0a0d=this[_0x4f49('0x18')][_0x5878f4][_0x4f49('0x19')];var _0x5cb79c=this[_0x4f49('0x18')][_0x5878f4][_0x4f49('0x1a')];ami[_0x4f49('0x1b')]({'action':'QueuePause','interface':_0x2f0a0d,'paused':!![],'reason':'ACW'})['then'](function(_0x47f1e8){if(_0x5bdfaf[_0x4f49('0x8')][_0x2f0a0d]){return RpcUser[_0x4f49('0x1c')](_0x5bdfaf[_0x4f49('0x8')][_0x2f0a0d]['id'])[_0x4f49('0x1d')](function(_0x5793ac){if(_0x5793ac&&!_0x5793ac[_0x4f49('0x1e')]){logger[_0x4f49('0x1f')](_0x4f49('0x20'),_0x5878f4,_0x2f0a0d,_0x5cb79c);return RpcUser[_0x4f49('0x21')](_0x5bdfaf[_0x4f49('0x8')][_0x2f0a0d],'ACW',_0x5878f4)[_0x4f49('0x1d')](function(_0x357446){_0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d]={};logger['info'](_0x4f49('0x22'),_0x5878f4,_0x5bdfaf[_0x4f49('0x7')][_0x5cb79c][_0x4f49('0x23')],_0x2f0a0d,_0x5cb79c);_0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d][_0x4f49('0x24')]=setTimeout(_0x5bdfaf[_0x4f49('0x25')]['bind'](_0x5bdfaf,_0x2f0a0d),_0x5bdfaf['voiceQueues'][_0x5cb79c][_0x4f49('0x23')]*0x3e8);_0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d]['lastPauseAt']=_0x357446[_0x4f49('0x26')];_0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d][_0x4f49('0x27')]=_0x5878f4;_0x5bdfaf['timers'][_0x2f0a0d][_0x4f49('0x1a')]=_0x5cb79c;_0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d][_0x4f49('0x28')]=function(){var _0x148153=getDiff(_0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d][_0x4f49('0x26')]);clearTimeout(_0x5bdfaf['timers'][_0x2f0a0d]['timer']);RpcVoiceAgentReport[_0x4f49('0x29')]({'acwtime':_0x148153},_0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d][_0x4f49('0x27')],_0x2f0a0d)['then'](function(_0x3cbfbd){logger[_0x4f49('0x1f')](_0x4f49('0x2a'),_0x5878f4,_0x148153,_0x3cbfbd);})['catch'](function(_0x4dd55a){logger[_0x4f49('0x2b')](_0x4f49('0x2c'),_0x5878f4,_0x4dd55a);});delete _0x5bdfaf[_0x4f49('0x9')][_0x2f0a0d];};});}else{logger['info'](_0x4f49('0x2d'),_0x5878f4,_0x2f0a0d,_0x5cb79c);}});}})[_0x4f49('0x2e')](function(_0x173657){logger[_0x4f49('0x2b')](_0x4f49('0x22'),_0x5878f4,_0x5bdfaf[_0x4f49('0x7')][_0x5cb79c][_0x4f49('0x23')],_0x2f0a0d,_0x5cb79c);})[_0x4f49('0x2f')](function(){delete _0x5bdfaf[_0x4f49('0x18')][_0x5878f4];});}catch(_0x310ee2){logger[_0x4f49('0x2b')](_0x4f49('0x30'),_0x310ee2[_0x4f49('0x31')]);}};Acw[_0x4f49('0x16')][_0x4f49('0x25')]=function(_0x97ef98){try{var _0x376a7d=this;if(_0x376a7d[_0x4f49('0x9')][_0x97ef98]){var _0x3e7a08=_0x376a7d['timers'][_0x97ef98][_0x4f49('0x27')];var _0x46b7ba=_0x376a7d[_0x4f49('0x9')][_0x97ef98][_0x4f49('0x1a')];var _0x1c3af8=_0x376a7d[_0x4f49('0x7')][_0x46b7ba][_0x4f49('0x23')];logger[_0x4f49('0x1f')](_0x4f49('0x32'),_0x97ef98);RpcUser[_0x4f49('0x33')](this[_0x4f49('0x8')][_0x97ef98]);RpcVoiceAgentReport[_0x4f49('0x29')]({'acwtime':_0x1c3af8,'agentacw':!![]},_0x3e7a08,_0x97ef98)[_0x4f49('0x1d')](function(_0x4d2d57){logger[_0x4f49('0x1f')](_0x4f49('0x2a'),_0x3e7a08,_0x1c3af8,_0x4d2d57);})[_0x4f49('0x2e')](function(_0x26014f){logger[_0x4f49('0x2b')](_0x4f49('0x2c'),_0x3e7a08,_0x26014f);});}else{logger[_0x4f49('0x2b')](_0x4f49('0x34'),_0x97ef98);if(_0x376a7d[_0x4f49('0x9')]){logger[_0x4f49('0x1f')](_0x4f49('0x35'),JSON[_0x4f49('0x36')](_0x376a7d[_0x4f49('0x9')]));}}}catch(_0x889445){logger['error'](_0x4f49('0x37'),_0x889445[_0x4f49('0x31')]);}};Acw['prototype'][_0x4f49('0xa')]=function(_0xbf05f3){try{if(this['voiceQueues'][_0xbf05f3[_0x4f49('0x1a')]]&&this[_0x4f49('0x7')][_0xbf05f3[_0x4f49('0x1a')]][_0x4f49('0x4')]){if(this[_0x4f49('0x8')][_0xbf05f3[_0x4f49('0x19')]]){this[_0x4f49('0x18')][_0xbf05f3['uniqueid']]={'queue':_0xbf05f3['queue'],'interface':_0xbf05f3['interface']};}}}catch(_0x15e4b3){logger[_0x4f49('0x2b')](_0x4f49('0x38'),_0x15e4b3[_0x4f49('0x31')]);}};Acw[_0x4f49('0x16')][_0x4f49('0x13')]=function(_0x38aff8){try{if(this[_0x4f49('0x7')][_0x38aff8[_0x4f49('0x1a')]]&&this['voiceQueues'][_0x38aff8['queue']][_0x4f49('0x4')]){if(this[_0x4f49('0x8')][_0x38aff8[_0x4f49('0x19')]]){this['channels'][_0x38aff8[_0x4f49('0x27')]]={'queue':_0x38aff8['queue'],'interface':_0x38aff8['interface']};}}}catch(_0x146d55){logger[_0x4f49('0x2b')](_0x4f49('0x39'),_0x146d55['message']);}};Acw[_0x4f49('0x16')][_0x4f49('0xd')]=function(_0x5e9f60){try{if(this[_0x4f49('0x18')][_0x5e9f60['uniqueid']]&&_[_0x4f49('0x3a')](this[_0x4f49('0x18')][_0x5e9f60[_0x4f49('0x27')]]['attended'])){logger[_0x4f49('0x1f')](_0x4f49('0x3b'),_0x5e9f60[_0x4f49('0x27')]);this[_0x4f49('0x17')](_0x5e9f60[_0x4f49('0x27')]);}else if(this[_0x4f49('0x18')][_0x5e9f60[_0x4f49('0x3c')]]&&_[_0x4f49('0x3a')](this[_0x4f49('0x18')][_0x5e9f60[_0x4f49('0x3c')]]['attended'])){logger[_0x4f49('0x1f')](_0x4f49('0x3d'),_0x5e9f60['linkedid']);this[_0x4f49('0x17')](_0x5e9f60['linkedid']);}}catch(_0x132c46){logger[_0x4f49('0x2b')](_0x4f49('0x3e'),_0x132c46[_0x4f49('0x31')]);}};Acw['prototype'][_0x4f49('0xf')]=function(_0x2c426b){try{if(this[_0x4f49('0x18')][_0x2c426b[_0x4f49('0x27')]]&&this[_0x4f49('0x18')][_0x2c426b[_0x4f49('0x27')]][_0x4f49('0x3f')]){logger[_0x4f49('0x1f')](_0x4f49('0x40'),_0x2c426b[_0x4f49('0x27')]);this[_0x4f49('0x17')](_0x2c426b[_0x4f49('0x27')]);}else if(this[_0x4f49('0x18')][_0x2c426b[_0x4f49('0x3c')]]&&this[_0x4f49('0x18')][_0x2c426b[_0x4f49('0x3c')]]['attended']){logger['info'](_0x4f49('0x41'),_0x2c426b[_0x4f49('0x3c')]);this[_0x4f49('0x17')](_0x2c426b[_0x4f49('0x3c')]);}}catch(_0x344f8e){logger[_0x4f49('0x2b')](_0x4f49('0x42'),_0x344f8e['message']);}};Acw[_0x4f49('0x16')]['syncAttendedTransfer']=function(_0x468978){try{if(!_[_0x4f49('0x43')](this[_0x4f49('0x18')][_0x468978[_0x4f49('0x44')]])){this['startAcw'](_0x468978[_0x4f49('0x44')]);if(this['channels'][_0x468978['secondtransfereruniqueid']]){this[_0x4f49('0x18')][_0x468978[_0x4f49('0x45')]][_0x4f49('0x3f')]=!![];this[_0x4f49('0x18')][_0x468978['transfertargetuniqueid']]=this['channels'][_0x468978[_0x4f49('0x45')]];delete this[_0x4f49('0x18')][_0x468978['secondtransfereruniqueid']];}}else if(!_[_0x4f49('0x43')](this['channels'][_0x468978['transfertargetuniqueid']])){this[_0x4f49('0x17')](_0x468978['transfertargetuniqueid']);if(this[_0x4f49('0x18')][_0x468978['origtransfereruniqueid']]){this[_0x4f49('0x18')][_0x468978[_0x4f49('0x46')]][_0x4f49('0x3f')]=!![];this[_0x4f49('0x18')][_0x468978[_0x4f49('0x44')]]=this[_0x4f49('0x18')][_0x468978[_0x4f49('0x46')]];delete this[_0x4f49('0x18')][_0x468978['origtransfereruniqueid']];}}}catch(_0x16faaf){logger['error'](_0x4f49('0x47'),_0x16faaf[_0x4f49('0x31')]);}};Acw[_0x4f49('0x16')][_0x4f49('0x12')]=function(_0x1981e0){try{if(this[_0x4f49('0x18')][_0x1981e0['transfereruniqueid']]){logger[_0x4f49('0x1f')](_0x4f49('0x48'),JSON['stringify'](_0x1981e0['transfereruniqueid']));this[_0x4f49('0x17')](_0x1981e0[_0x4f49('0x49')]);}else if(this[_0x4f49('0x18')][_0x1981e0[_0x4f49('0x4a')]]){logger[_0x4f49('0x1f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x4f49('0x36')](_0x1981e0['transfererlinkedid']));this[_0x4f49('0x17')](_0x1981e0[_0x4f49('0x4a')]);}}catch(_0x2a2b0d){logger['error'](_0x4f49('0x4b'),_0x2a2b0d[_0x4f49('0x31')]);}};Acw[_0x4f49('0x16')][_0x4f49('0x10')]=function(_0x51c0b8){try{if(this[_0x4f49('0x7')][_0x51c0b8[_0x4f49('0x1a')]]&&this['voiceQueues'][_0x51c0b8[_0x4f49('0x1a')]][_0x4f49('0x4c')]===_0x4f49('0x4d')){if(this[_0x4f49('0x8')][_0x51c0b8[_0x4f49('0x19')]]){logger[_0x4f49('0x1f')](_0x4f49('0x4e'),_0x51c0b8[_0x4f49('0x27')],_0x51c0b8['interface'],_0x51c0b8[_0x4f49('0x1a')]);return RpcUser[_0x4f49('0x21')](this[_0x4f49('0x8')][_0x51c0b8[_0x4f49('0x19')]],_0x4f49('0x4f'),_0x51c0b8[_0x4f49('0x27')]);}}}catch(_0x335875){logger['error'](_0x4f49('0x50'),_0x335875['message']);}};module[_0x4f49('0x51')]=Acw;
\ No newline at end of file
index a60eeb5..e761b20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5ef=['ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','asterisk-manager','bluebird','moment','util','lodash','../../config/logger'];(function(_0x448394,_0x5cfc01){var _0x203632=function(_0x46ca8d){while(--_0x46ca8d){_0x448394['push'](_0x448394['shift']());}};_0x203632(++_0x5cfc01);}(_0xf5ef,0x127));var _0xff5e=function(_0x525209,_0x256e19){_0x525209=_0x525209-0x0;var _0x4f438f=_0xf5ef[_0x525209];return _0x4f438f;};'use strict';var Manager=require(_0xff5e('0x0'));var BPromise=require(_0xff5e('0x1'));var moment=require(_0xff5e('0x2'));var util=require(_0xff5e('0x3'));var _=require(_0xff5e('0x4'));var logger=require(_0xff5e('0x5'))(_0xff5e('0x6'));var config=require(_0xff5e('0x7'));var ami=new Manager(config[_0xff5e('0x8')][_0xff5e('0x9')],config['asterisk']['ip'],config[_0xff5e('0x8')][_0xff5e('0xa')],config['asterisk'][_0xff5e('0xb')],!![]);ami[_0xff5e('0xc')]();ami[_0xff5e('0xd')]=BPromise[_0xff5e('0xe')](ami[_0xff5e('0xf')]);function error(_0x5ec95b){logger[_0xff5e('0x10')](util[_0xff5e('0x11')](_0xff5e('0x12'),config[_0xff5e('0x8')][_0xff5e('0xa')],config[_0xff5e('0x8')]['ip'],config[_0xff5e('0x8')]['port'],util[_0xff5e('0x13')](_0x5ec95b,![],null)));}function close(){logger['error'](util[_0xff5e('0x11')](_0xff5e('0x14'),config['asterisk'][_0xff5e('0xa')],config['asterisk']['ip'],config['asterisk'][_0xff5e('0x9')]));}ami[_0xff5e('0x15')]=function(){return function(){return ami['Action']({'action':_0xff5e('0x16')});};};ami[_0xff5e('0x17')]=function(){return function(){return ami['Action']({'action':_0xff5e('0x18')});};};ami[_0xff5e('0x19')]=function(){return function(){return ami[_0xff5e('0xd')]({'action':_0xff5e('0x1a')});};};ami[_0xff5e('0x1b')]=function(){return function(){return ami['Action']({'action':_0xff5e('0x1c')});};};ami[_0xff5e('0x1d')]=function(){return function(){return ami[_0xff5e('0xd')]({'action':_0xff5e('0x1e')});};};function connect(_0x44b412){logger[_0xff5e('0x1f')](util['format'](_0xff5e('0x20'),config[_0xff5e('0x8')]['username'],config['asterisk']['ip'],config['asterisk'][_0xff5e('0x9')]));ami[_0xff5e('0x21')]('error',error);ami[_0xff5e('0x21')](_0xff5e('0x22'),close);}ami['on'](_0xff5e('0x23'),connect);ami['on'](_0xff5e('0x24'),function(_0x5bf8e6){logger[_0xff5e('0x1f')](util['format'](_0xff5e('0x25'),config[_0xff5e('0x8')][_0xff5e('0xa')],config['asterisk']['ip'],config[_0xff5e('0x8')][_0xff5e('0x9')],util[_0xff5e('0x13')](_0x5bf8e6,![],null)));});ami['on'](_0xff5e('0x26'),function(_0x4b3830){logger[_0xff5e('0x1f')](util['format'](_0xff5e('0x27'),config[_0xff5e('0x8')]['username'],config[_0xff5e('0x8')]['ip'],config['asterisk'][_0xff5e('0x9')]));return BPromise[_0xff5e('0x28')]()[_0xff5e('0x29')](ami[_0xff5e('0x15')]())[_0xff5e('0x29')](ami[_0xff5e('0x17')]())['then'](ami['actionSipPeerStatus']())[_0xff5e('0x29')](ami[_0xff5e('0x1b')]())[_0xff5e('0x29')](ami[_0xff5e('0x1d')]())['catch'](function(_0x4ba9b0){console[_0xff5e('0x2a')](_0x4ba9b0);});});ami[_0xff5e('0x21')]('error',error);ami[_0xff5e('0x21')]('close',close);module['exports']=ami;
\ No newline at end of file
+var _0xb63c=['devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','format','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','asterisk-manager','moment','util','ami','../../config/environment','port','asterisk','username','keepConnected','Action','action','error','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xb63c,0xe4));var _0xcb63=function(_0x5d7585,_0x5c45bd){_0x5d7585=_0x5d7585-0x0;var _0x4a2bad=_0xb63c[_0x5d7585];return _0x4a2bad;};'use strict';var Manager=require(_0xcb63('0x0'));var BPromise=require('bluebird');var moment=require(_0xcb63('0x1'));var util=require(_0xcb63('0x2'));var _=require('lodash');var logger=require('../../config/logger')(_0xcb63('0x3'));var config=require(_0xcb63('0x4'));var ami=new Manager(config['asterisk'][_0xcb63('0x5')],config['asterisk']['ip'],config[_0xcb63('0x6')][_0xcb63('0x7')],config['asterisk']['password'],!![]);ami[_0xcb63('0x8')]();ami[_0xcb63('0x9')]=BPromise['promisify'](ami[_0xcb63('0xa')]);function error(_0x56fb13){logger[_0xcb63('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xcb63('0x6')]['username'],config['asterisk']['ip'],config[_0xcb63('0x6')][_0xcb63('0x5')],util[_0xcb63('0xc')](_0x56fb13,![],null)));}function close(){logger[_0xcb63('0xb')](util['format'](_0xcb63('0xd'),config[_0xcb63('0x6')][_0xcb63('0x7')],config[_0xcb63('0x6')]['ip'],config[_0xcb63('0x6')][_0xcb63('0x5')]));}ami[_0xcb63('0xe')]=function(){return function(){return ami[_0xcb63('0x9')]({'action':_0xcb63('0xf')});};};ami[_0xcb63('0x10')]=function(){return function(){return ami['Action']({'action':_0xcb63('0x11')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xcb63('0x9')]({'action':_0xcb63('0x12')});};};ami[_0xcb63('0x13')]=function(){return function(){return ami[_0xcb63('0x9')]({'action':_0xcb63('0x14')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xcb63('0x9')]({'action':_0xcb63('0x15')});};};function connect(_0x542254){logger[_0xcb63('0x16')](util['format'](_0xcb63('0x17'),config[_0xcb63('0x6')][_0xcb63('0x7')],config[_0xcb63('0x6')]['ip'],config[_0xcb63('0x6')][_0xcb63('0x5')]));ami[_0xcb63('0x18')](_0xcb63('0xb'),error);ami[_0xcb63('0x18')](_0xcb63('0x19'),close);}ami['on'](_0xcb63('0x1a'),connect);ami['on'](_0xcb63('0x1b'),function(_0x17a9a7){logger[_0xcb63('0x16')](util[_0xcb63('0x1c')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xcb63('0x6')][_0xcb63('0x7')],config[_0xcb63('0x6')]['ip'],config['asterisk'][_0xcb63('0x5')],util[_0xcb63('0xc')](_0x17a9a7,![],null)));});ami['on'](_0xcb63('0x1d'),function(_0x106960){logger[_0xcb63('0x16')](util['format'](_0xcb63('0x1e'),config[_0xcb63('0x6')][_0xcb63('0x7')],config[_0xcb63('0x6')]['ip'],config['asterisk']['port']));return BPromise[_0xcb63('0x1f')]()[_0xcb63('0x20')](ami[_0xcb63('0xe')]())[_0xcb63('0x20')](ami[_0xcb63('0x10')]())[_0xcb63('0x20')](ami[_0xcb63('0x21')]())[_0xcb63('0x20')](ami[_0xcb63('0x13')]())[_0xcb63('0x20')](ami['actionCoreShowChannels']())[_0xcb63('0x22')](function(_0xe9e30e){console['log'](_0xe9e30e);});});ami[_0xcb63('0x18')](_0xcb63('0xb'),error);ami[_0xcb63('0x18')]('close',close);module['exports']=ami;
\ No newline at end of file
index 0f4f412..ee3d234 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x204c=['error','rpc','message','result','catch','exports','../../config/logger','http','Request','request','memberReport'];(function(_0x2ee906,_0x4f1c61){var _0x1c5449=function(_0x2ef7a4){while(--_0x2ef7a4){_0x2ee906['push'](_0x2ee906['shift']());}};_0x1c5449(++_0x4f1c61);}(_0x204c,0x1df));var _0xc204=function(_0x1b9edd,_0x66b166){_0x1b9edd=_0x1b9edd-0x0;var _0x4907c4=_0x204c[_0x1b9edd];return _0x4907c4;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xc204('0x0'))('ami');var client=jayson['client'][_0xc204('0x1')]({'port':0x2329});client[_0xc204('0x2')]=function(_0x31e232,_0x1037a0){return new BPromise(function(_0x1531f2,_0x340c7b){return client[_0xc204('0x3')](_0x31e232,_0x1037a0)['then'](function(_0x5691c8){logger['debug']('rpc',_0xc204('0x4'),_0x31e232,_0x1037a0,_0x5691c8);if(_0x5691c8[_0xc204('0x5')]){logger[_0xc204('0x5')](_0xc204('0x6'),_0xc204('0x4'),_0x31e232,_0x5691c8['error'][_0xc204('0x7')],_0x1037a0);return _0x340c7b(_0x5691c8[_0xc204('0x5')][_0xc204('0x7')]);}else{return _0x1531f2(_0x5691c8[_0xc204('0x8')]);}})[_0xc204('0x9')](function(_0x5b27ca){logger['error']('rpc',_0xc204('0x4'),_0x31e232,_0x5b27ca,_0x1037a0);return _0x340c7b(_0x5b27ca);});});};module[_0xc204('0xa')]=client;
\ No newline at end of file
+var _0x4593=['rpc','memberReport','error','message','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','request'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4593,0x109));var _0x3459=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0x4593[_0x55daf2];return _0x1c8500;};'use strict';var jayson=require(_0x3459('0x0'));var BPromise=require(_0x3459('0x1'));var logger=require(_0x3459('0x2'))(_0x3459('0x3'));var client=jayson[_0x3459('0x4')][_0x3459('0x5')]({'port':0x2329});client[_0x3459('0x6')]=function(_0x20597d,_0x45e4a5){return new BPromise(function(_0x546708,_0xbcff44){return client[_0x3459('0x7')](_0x20597d,_0x45e4a5)['then'](function(_0x101d8){logger['debug'](_0x3459('0x8'),_0x3459('0x9'),_0x20597d,_0x45e4a5,_0x101d8);if(_0x101d8[_0x3459('0xa')]){logger['error'](_0x3459('0x8'),'memberReport',_0x20597d,_0x101d8[_0x3459('0xa')][_0x3459('0xb')],_0x45e4a5);return _0xbcff44(_0x101d8[_0x3459('0xa')][_0x3459('0xb')]);}else{return _0x546708(_0x101d8['result']);}})[_0x3459('0xc')](function(_0x503231){logger[_0x3459('0xa')](_0x3459('0x8'),_0x3459('0x9'),_0x20597d,_0x503231,_0x45e4a5);return _0xbcff44(_0x503231);});});};module['exports']=client;
\ No newline at end of file
index e2fdbe6..6f127ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96eb=['queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','prototype','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number'];(function(_0x3406d5,_0x16011d){var _0x324565=function(_0x2b1aa1){while(--_0x2b1aa1){_0x3406d5['push'](_0x3406d5['shift']());}};_0x324565(++_0x16011d);}(_0x96eb,0x113));var _0xb96e=function(_0x215326,_0x52c7fd){_0x215326=_0x215326-0x0;var _0x21c49f=_0x96eb[_0x215326];return _0x21c49f;};'use strict';var util=require(_0xb96e('0x0'));var _=require(_0xb96e('0x1'));var moment=require(_0xb96e('0x2'));function checkNameSurname(_0x210464,_0x24b13b,_0x1fdf6b){var _0x2c05a5='';if(!_[_0xb96e('0x3')](_0x24b13b)&&_0xb96e('0x4')===typeof _0x24b13b){_0x2c05a5+=_0x24b13b;}if(!_[_0xb96e('0x3')](_0x1fdf6b)&&_0xb96e('0x4')===typeof _0x1fdf6b){_0x2c05a5+='\x20'+_0x1fdf6b;}if(_0x2c05a5!==''){return _0x2c05a5;}return _0x210464;}function Action(_0xa8c53a,_0xbda7a7,_0x2f6997){this['voiceQueue']=_0xa8c53a;this[_0xb96e('0x5')]=_0x2f6997||undefined;this[_0xb96e('0x6')]=checkNameSurname(_0xbda7a7[_0xb96e('0x7')][_0xb96e('0x8')],_0xbda7a7['Contact'][_0xb96e('0x9')],_0xbda7a7[_0xb96e('0x7')][_0xb96e('0xa')]);this[_0xb96e('0xb')]=_0xbda7a7['Contact'][_0xb96e('0x8')];this[_0xb96e('0xc')]=_0xa8c53a[_0xb96e('0x6')];this[_0xb96e('0xd')]=_0xbda7a7[_0xb96e('0xd')]||![];this['type']=_0xa8c53a[_0xb96e('0xe')];this[_0xb96e('0xf')]=_0xa8c53a[_0xb96e('0xf')]||0x3;this[_0xb96e('0x10')]=_0xbda7a7[_0xb96e('0x10')];this[_0xb96e('0x11')]=_0xbda7a7[_0xb96e('0x11')];this['countcongestionretry']=_0xbda7a7['countcongestionretry'];this[_0xb96e('0x12')]=_0xbda7a7['countnoanswerretry'];this['ContactId']=_0xbda7a7[_0xb96e('0x13')];this[_0xb96e('0x14')]=_0xbda7a7[_0xb96e('0x14')];this[_0xb96e('0x15')]=_0xbda7a7[_0xb96e('0x15')];this[_0xb96e('0x16')]=_0xbda7a7[_0xb96e('0x16')];this[_0xb96e('0x17')]=_0xbda7a7[_0xb96e('0x17')];this['idHopper']=_0xbda7a7['id'];this[_0xb96e('0x18')]=_0xbda7a7[_0xb96e('0x7')][_0xb96e('0x9')]||'';this[_0xb96e('0x19')]=moment()[_0xb96e('0x1a')](_0xb96e('0x1b'));this[_0xb96e('0x1c')]=_0xbda7a7[_0xb96e('0x1c')];this[_0xb96e('0x1d')]=_0xbda7a7[_0xb96e('0x1d')];this[_0xb96e('0x1e')]=_0xbda7a7[_0xb96e('0x1e')];this[_0xb96e('0x1f')]=_0xbda7a7[_0xb96e('0x1f')];this['originatecalleridnum']='';this[_0xb96e('0x20')]='';}Action['prototype'][_0xb96e('0x21')]=function(){return util[_0xb96e('0x1a')](_0xb96e('0x22'),this[_0xb96e('0x6')],this[_0xb96e('0x23')]['dialCutDigit']>0x0?this[_0xb96e('0xb')][_0xb96e('0x24')](this[_0xb96e('0x23')][_0xb96e('0x25')]):this[_0xb96e('0xb')]);};Action[_0xb96e('0x26')][_0xb96e('0x27')]=function(){return this[_0xb96e('0xc')];};module[_0xb96e('0x28')]=Action;
\ No newline at end of file
+var _0xfee9=['Contact','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','prototype','getQueue','util','lodash','moment','isNil','string','voiceQueue','name','phone'];(function(_0x508a69,_0x4db2cb){var _0x26a3b7=function(_0x11c276){while(--_0x11c276){_0x508a69['push'](_0x508a69['shift']());}};_0x26a3b7(++_0x4db2cb);}(_0xfee9,0x110));var _0x9fee=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfee9[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x9fee('0x0'));var _=require(_0x9fee('0x1'));var moment=require(_0x9fee('0x2'));function checkNameSurname(_0x28534c,_0x55b522,_0x357814){var _0x599e77='';if(!_[_0x9fee('0x3')](_0x55b522)&&_0x9fee('0x4')===typeof _0x55b522){_0x599e77+=_0x55b522;}if(!_[_0x9fee('0x3')](_0x357814)&&_0x9fee('0x4')===typeof _0x357814){_0x599e77+='\x20'+_0x357814;}if(_0x599e77!==''){return _0x599e77;}return _0x28534c;}function Action(_0x1c2c0d,_0x28db0c,_0x41de74){this[_0x9fee('0x5')]=_0x1c2c0d;this['uniqueid']=_0x41de74||undefined;this[_0x9fee('0x6')]=checkNameSurname(_0x28db0c['Contact'][_0x9fee('0x7')],_0x28db0c['Contact']['firstName'],_0x28db0c[_0x9fee('0x8')][_0x9fee('0x9')]);this['number']=_0x28db0c[_0x9fee('0x8')][_0x9fee('0x7')];this[_0x9fee('0xa')]=_0x1c2c0d[_0x9fee('0x6')];this[_0x9fee('0xb')]=_0x28db0c['active']||![];this[_0x9fee('0xc')]=_0x1c2c0d['type'];this[_0x9fee('0xd')]=_0x1c2c0d[_0x9fee('0xd')]||0x3;this[_0x9fee('0xe')]=_0x28db0c[_0x9fee('0xe')];this['countbusyretry']=_0x28db0c[_0x9fee('0xf')];this[_0x9fee('0x10')]=_0x28db0c[_0x9fee('0x10')];this[_0x9fee('0x11')]=_0x28db0c[_0x9fee('0x11')];this[_0x9fee('0x12')]=_0x28db0c[_0x9fee('0x12')];this[_0x9fee('0x13')]=_0x28db0c[_0x9fee('0x13')];this[_0x9fee('0x14')]=_0x28db0c[_0x9fee('0x14')];this[_0x9fee('0x15')]=_0x28db0c['VoiceQueueId'];this['CampaignId']=_0x28db0c['CampaignId'];this[_0x9fee('0x16')]=_0x28db0c['id'];this[_0x9fee('0x17')]=_0x28db0c[_0x9fee('0x8')][_0x9fee('0x18')]||'';this[_0x9fee('0x19')]=moment()[_0x9fee('0x1a')](_0x9fee('0x1b'));this[_0x9fee('0x1c')]=_0x28db0c['callback'];this[_0x9fee('0x1d')]=_0x28db0c[_0x9fee('0x1d')];this[_0x9fee('0x1e')]=_0x28db0c[_0x9fee('0x1e')];this[_0x9fee('0x1f')]=_0x28db0c[_0x9fee('0x1f')];this[_0x9fee('0x20')]='';this[_0x9fee('0x21')]='';}Action['prototype']['getCaller']=function(){return util[_0x9fee('0x1a')](_0x9fee('0x22'),this[_0x9fee('0x6')],this['voiceQueue'][_0x9fee('0x23')]>0x0?this[_0x9fee('0x24')][_0x9fee('0x25')](this[_0x9fee('0x5')][_0x9fee('0x23')]):this[_0x9fee('0x24')]);};Action[_0x9fee('0x26')][_0x9fee('0x27')]=function(){return this[_0x9fee('0xa')];};module['exports']=Action;
\ No newline at end of file
index 688a7b2..ae070c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5909=['responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime'];(function(_0x49f29b,_0x264173){var _0x2a68ae=function(_0x4a872b){while(--_0x4a872b){_0x49f29b['push'](_0x49f29b['shift']());}};_0x2a68ae(++_0x264173);}(_0x5909,0x168));var _0x9590=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x5909[_0x334d1e];return _0x3b33ba;};'use strict';var util=require(_0x9590('0x0'));var _=require(_0x9590('0x1'));var moment=require('moment');function getSeconds(_0x21409b,_0x2647ad){var _0x3dc54d=moment(_0x21409b)[_0x9590('0x2')](0x0);var _0x45411a=moment(_0x2647ad)[_0x9590('0x2')](0x0);return _0x3dc54d['diff'](_0x45411a,'seconds');}function AgentComplete(_0x3fc2d0,_0xcc097c){this[_0x9590('0x3')]=0x4;this[_0x9590('0x4')]='Answer';this[_0x9590('0x5')]=_0x3fc2d0[_0x9590('0x5')];this[_0x9590('0x6')]=_0x3fc2d0[_0x9590('0x6')];this[_0x9590('0x7')]=_0x3fc2d0['type']===_0x9590('0x8')?_0x9590('0x9'):_0x3fc2d0[_0x9590('0x6')];this[_0x9590('0xa')]=_0x3fc2d0[_0x9590('0xa')];this['countcongestionretry']=_0x3fc2d0[_0x9590('0xb')];this['countnoanswerretry']=_0x3fc2d0[_0x9590('0xc')];this[_0x9590('0xd')]=_0x3fc2d0['countbusyretry']+_0x3fc2d0['countcongestionretry']+_0x3fc2d0[_0x9590('0xc')];this[_0x9590('0xe')]=_0xcc097c['uniqueid'];this[_0x9590('0xf')]=_0x3fc2d0[_0x9590('0x10')];this[_0x9590('0x11')]=_0x3fc2d0[_0x9590('0x12')];this['starttime']=_0x3fc2d0[_0x9590('0x13')];this[_0x9590('0x14')]=_0x3fc2d0[_0x9590('0x14')];this[_0x9590('0x15')]=_0x3fc2d0[_0x9590('0x15')];this[_0x9590('0x16')]=moment()[_0x9590('0x17')](_0x9590('0x18'));this[_0x9590('0x19')]=getSeconds(_0x3fc2d0['responsetime'],_0x3fc2d0[_0x9590('0x13')]);this[_0x9590('0x1a')]=getSeconds(_0x3fc2d0['answertime'],_0x3fc2d0[_0x9590('0x14')]);this[_0x9590('0x1b')]=getSeconds(this[_0x9590('0x16')],_0x3fc2d0[_0x9590('0x15')]);this[_0x9590('0x9')]=_0xcc097c[_0x9590('0x9')];this[_0x9590('0x1c')]=_0xcc097c[_0x9590('0x1c')];this[_0x9590('0x1d')]=_0xcc097c[_0x9590('0x1d')];this['callback']=_0x3fc2d0[_0x9590('0x1e')];this['callbackuniqueid']=_0x3fc2d0[_0x9590('0x1f')];this[_0x9590('0x20')]=_0x3fc2d0[_0x9590('0x20')];this[_0x9590('0x21')]=_0x3fc2d0[_0x9590('0x21')];this[_0x9590('0x22')]=_0x3fc2d0[_0x9590('0x22')];this[_0x9590('0x23')]=_0x3fc2d0[_0x9590('0x23')];this['UserId']=_0x3fc2d0['UserId'];this['VoiceQueueId']=_0x3fc2d0['VoiceQueueId'];this['CampaignId']=_0x3fc2d0['CampaignId'];this[_0x9590('0x24')]=_0x3fc2d0[_0x9590('0x24')]||'';this[_0x9590('0x25')]=_0x3fc2d0[_0x9590('0x25')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
+var _0x53f2=['countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','state','scheduledat','type','outbound','queue','countbusyretry'];(function(_0x1ee0f5,_0x1a9a4d){var _0x548fec=function(_0x5df250){while(--_0x5df250){_0x1ee0f5['push'](_0x1ee0f5['shift']());}};_0x548fec(++_0x1a9a4d);}(_0x53f2,0xeb));var _0x253f=function(_0x20e46e,_0x8d8c31){_0x20e46e=_0x20e46e-0x0;var _0x5ac72c=_0x53f2[_0x20e46e];return _0x5ac72c;};'use strict';var util=require(_0x253f('0x0'));var _=require(_0x253f('0x1'));var moment=require(_0x253f('0x2'));function getSeconds(_0x5716c7,_0x38aadb){var _0x222cb7=moment(_0x5716c7)['milliseconds'](0x0);var _0x198a0c=moment(_0x38aadb)[_0x253f('0x3')](0x0);return _0x222cb7[_0x253f('0x4')](_0x198a0c,'seconds');}function AgentComplete(_0x3c7673,_0x29aa4b){this[_0x253f('0x5')]=0x4;this['statedesc']='Answer';this[_0x253f('0x6')]=_0x3c7673['scheduledat'];this[_0x253f('0x7')]=_0x3c7673['type'];this['campaigntype']=_0x3c7673['type']===_0x253f('0x8')?_0x253f('0x9'):_0x3c7673[_0x253f('0x7')];this[_0x253f('0xa')]=_0x3c7673[_0x253f('0xa')];this['countcongestionretry']=_0x3c7673[_0x253f('0xb')];this[_0x253f('0xc')]=_0x3c7673[_0x253f('0xc')];this[_0x253f('0xd')]=_0x3c7673['countbusyretry']+_0x3c7673[_0x253f('0xb')]+_0x3c7673[_0x253f('0xc')];this[_0x253f('0xe')]=_0x29aa4b[_0x253f('0xe')];this[_0x253f('0xf')]=_0x3c7673[_0x253f('0x10')];this[_0x253f('0x11')]=_0x3c7673[_0x253f('0x12')];this[_0x253f('0x13')]=_0x3c7673[_0x253f('0x13')];this[_0x253f('0x14')]=_0x3c7673[_0x253f('0x14')];this[_0x253f('0x15')]=_0x3c7673[_0x253f('0x15')];this[_0x253f('0x16')]=moment()[_0x253f('0x17')](_0x253f('0x18'));this[_0x253f('0x19')]=getSeconds(_0x3c7673[_0x253f('0x14')],_0x3c7673[_0x253f('0x13')]);this[_0x253f('0x1a')]=getSeconds(_0x3c7673['answertime'],_0x3c7673[_0x253f('0x14')]);this['talktime']=getSeconds(this['endtime'],_0x3c7673[_0x253f('0x15')]);this[_0x253f('0x9')]=_0x29aa4b[_0x253f('0x9')];this[_0x253f('0x1b')]=_0x29aa4b['membername'];this[_0x253f('0x1c')]=_0x29aa4b[_0x253f('0x1c')];this[_0x253f('0x1d')]=_0x3c7673[_0x253f('0x1d')];this[_0x253f('0x1e')]=_0x3c7673['callbackuniqueid'];this[_0x253f('0x1f')]=_0x3c7673[_0x253f('0x1f')];this[_0x253f('0x20')]=_0x3c7673[_0x253f('0x20')];this[_0x253f('0x21')]=_0x3c7673[_0x253f('0x21')];this[_0x253f('0x22')]=_0x3c7673[_0x253f('0x22')];this['UserId']=_0x3c7673[_0x253f('0x23')];this[_0x253f('0x24')]=_0x3c7673[_0x253f('0x24')];this['CampaignId']=_0x3c7673[_0x253f('0x25')];this[_0x253f('0x26')]=_0x3c7673[_0x253f('0x26')]||'';this[_0x253f('0x27')]=_0x3c7673['originatecalleridname']||'';}module[_0x253f('0x28')]=AgentComplete;
\ No newline at end of file
index 463d0b5..0da2ebf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22b4=['ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x2fefa8,_0x355ecd){var _0x4692fe=function(_0x42c06d){while(--_0x42c06d){_0x2fefa8['push'](_0x2fefa8['shift']());}};_0x4692fe(++_0x355ecd);}(_0x22b4,0x8b));var _0x422b=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x22b4[_0x5834bc];return _0x3e183a;};'use strict';var util=require(_0x422b('0x0'));var _=require(_0x422b('0x1'));var moment=require(_0x422b('0x2'));function getSeconds(_0x1f180d,_0x16c3ed){var _0x15cbc7=moment(_0x1f180d)['milliseconds'](0x0);var _0x4b3f83=moment(_0x16c3ed)[_0x422b('0x3')](0x0);return _0x15cbc7['diff'](_0x4b3f83,_0x422b('0x4'));}function Final(_0x2df71e){this[_0x422b('0x5')]=_0x2df71e[_0x422b('0x5')];this[_0x422b('0x6')]=_0x2df71e[_0x422b('0x6')];this['type']=_0x2df71e[_0x422b('0x7')];this['campaigntype']=_0x2df71e[_0x422b('0x7')]===_0x422b('0x8')?_0x422b('0x9'):_0x2df71e[_0x422b('0x7')];this[_0x422b('0xa')]=_0x2df71e[_0x422b('0xa')];this['countcongestionretry']=_0x2df71e[_0x422b('0xb')];this[_0x422b('0xc')]=_0x2df71e[_0x422b('0xc')];this[_0x422b('0xd')]=_0x2df71e[_0x422b('0xa')]+_0x2df71e[_0x422b('0xb')]+_0x2df71e[_0x422b('0xc')];this[_0x422b('0x9')]=_0x2df71e['queue'];this['calleridname']=_0x2df71e[_0x422b('0xe')];this[_0x422b('0xf')]=_0x2df71e[_0x422b('0xf')];this[_0x422b('0x10')]=_0x2df71e[_0x422b('0x10')];this[_0x422b('0x11')]=_0x2df71e[_0x422b('0x11')];this[_0x422b('0x12')]=_0x2df71e['responsetime'];this[_0x422b('0x13')]=_0x2df71e['ringtime']||0x0;this[_0x422b('0x14')]=_0x2df71e[_0x422b('0x14')]||0x0;this[_0x422b('0x15')]=_0x2df71e[_0x422b('0x15')]||0x0;this[_0x422b('0x16')]=_0x2df71e[_0x422b('0x16')];this['callbackuniqueid']=_0x2df71e[_0x422b('0x17')];this[_0x422b('0x18')]=_0x2df71e[_0x422b('0x18')];this['recallme']=_0x2df71e[_0x422b('0x19')];this[_0x422b('0x1a')]=_0x2df71e[_0x422b('0x1a')];this[_0x422b('0x1b')]=_0x2df71e[_0x422b('0x1b')];this[_0x422b('0x1c')]=_0x2df71e[_0x422b('0x1c')];this['VoiceQueueId']=_0x2df71e[_0x422b('0x1d')];this['CampaignId']=_0x2df71e['CampaignId'];this[_0x422b('0x1e')]=_0x2df71e['originatecalleridnum']||'';this[_0x422b('0x1f')]=_0x2df71e['originatecalleridname']||'';}module[_0x422b('0x20')]=Final;
\ No newline at end of file
+var _0x1867=['originatecalleridnum','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x1867,0xb5));var _0x7186=function(_0x2ca4ce,_0x5f4a56){_0x2ca4ce=_0x2ca4ce-0x0;var _0x139d3d=_0x1867[_0x2ca4ce];return _0x139d3d;};'use strict';var util=require(_0x7186('0x0'));var _=require(_0x7186('0x1'));var moment=require('moment');function getSeconds(_0x44f581,_0x550676){var _0x343df3=moment(_0x44f581)[_0x7186('0x2')](0x0);var _0xeb165d=moment(_0x550676)[_0x7186('0x2')](0x0);return _0x343df3[_0x7186('0x3')](_0xeb165d,_0x7186('0x4'));}function Final(_0x2fbf92){this[_0x7186('0x5')]=_0x2fbf92[_0x7186('0x5')];this['scheduledat']=_0x2fbf92[_0x7186('0x6')];this[_0x7186('0x7')]=_0x2fbf92['type'];this[_0x7186('0x8')]=_0x2fbf92[_0x7186('0x7')]===_0x7186('0x9')?_0x7186('0xa'):_0x2fbf92['type'];this[_0x7186('0xb')]=_0x2fbf92[_0x7186('0xb')];this[_0x7186('0xc')]=_0x2fbf92[_0x7186('0xc')];this[_0x7186('0xd')]=_0x2fbf92['countnoanswerretry'];this[_0x7186('0xe')]=_0x2fbf92[_0x7186('0xb')]+_0x2fbf92[_0x7186('0xc')]+_0x2fbf92[_0x7186('0xd')];this['queue']=_0x2fbf92[_0x7186('0xa')];this[_0x7186('0xf')]=_0x2fbf92[_0x7186('0xf')];this[_0x7186('0x10')]=_0x2fbf92['calleridnum'];this['starttime']=_0x2fbf92['starttime'];this[_0x7186('0x11')]=_0x2fbf92[_0x7186('0x11')];this[_0x7186('0x12')]=_0x2fbf92[_0x7186('0x11')];this['ringtime']=_0x2fbf92[_0x7186('0x13')]||0x0;this[_0x7186('0x14')]=_0x2fbf92[_0x7186('0x14')]||0x0;this[_0x7186('0x15')]=_0x2fbf92[_0x7186('0x15')]||0x0;this[_0x7186('0x16')]=_0x2fbf92[_0x7186('0x16')];this[_0x7186('0x17')]=_0x2fbf92['callbackuniqueid'];this[_0x7186('0x18')]=_0x2fbf92[_0x7186('0x18')];this['recallme']=_0x2fbf92[_0x7186('0x19')];this[_0x7186('0x1a')]=_0x2fbf92[_0x7186('0x1a')];this['ListId']=_0x2fbf92['ListId'];this[_0x7186('0x1b')]=_0x2fbf92['UserId'];this[_0x7186('0x1c')]=_0x2fbf92['VoiceQueueId'];this['CampaignId']=_0x2fbf92['CampaignId'];this[_0x7186('0x1d')]=_0x2fbf92[_0x7186('0x1d')]||'';this['originatecalleridname']=_0x2fbf92['originatecalleridname']||'';}module['exports']=Final;
\ No newline at end of file
index 061c0e5..a1a8a58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0xdfdb0b,_0x110a57){var _0x1526b5=function(_0x1ff44b){while(--_0x1ff44b){_0xdfdb0b['push'](_0xdfdb0b['shift']());}};_0x1526b5(++_0x110a57);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup;
\ No newline at end of file
+var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x3f6565,_0x12a8bb){var _0x4abd23=function(_0x56dce7){while(--_0x56dce7){_0x3f6565['push'](_0x3f6565['shift']());}};_0x4abd23(++_0x12a8bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup;
\ No newline at end of file
index c58a96b..569498e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbd7=['ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbd7,0xb0));var _0x7bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd7[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x7bbd('0x0'));var _=require('lodash');var moment=require(_0x7bbd('0x1'));function getSeconds(_0x330cca,_0x52db1c){var _0x4ca92e=moment(_0x330cca)[_0x7bbd('0x2')](0x0);var _0x328955=moment(_0x52db1c)[_0x7bbd('0x2')](0x0);return _0x4ca92e[_0x7bbd('0x3')](_0x328955,_0x7bbd('0x4'));}function History(_0x13331f){this[_0x7bbd('0x5')]=_0x13331f['uniqueid'];this['scheduledat']=_0x13331f[_0x7bbd('0x6')]||undefined;this['type']=_0x13331f[_0x7bbd('0x7')];this[_0x7bbd('0x8')]=_0x13331f[_0x7bbd('0x7')]===_0x7bbd('0x9')?_0x7bbd('0xa'):_0x13331f[_0x7bbd('0x7')];this[_0x7bbd('0xb')]=_0x13331f['countbusyretry'];this['countcongestionretry']=_0x13331f[_0x7bbd('0xc')];this[_0x7bbd('0xd')]=_0x13331f['countnoanswerretry'];this['countglobal']=_0x13331f[_0x7bbd('0xb')]+_0x13331f[_0x7bbd('0xc')]+_0x13331f['countnoanswerretry'];this[_0x7bbd('0xa')]=_0x13331f[_0x7bbd('0xa')];this[_0x7bbd('0xe')]=_0x13331f[_0x7bbd('0xf')];this['calleridnum']=_0x13331f[_0x7bbd('0x10')];this[_0x7bbd('0x11')]=_0x13331f[_0x7bbd('0x11')];this[_0x7bbd('0x12')]=_0x13331f[_0x7bbd('0x12')];this[_0x7bbd('0x13')]=_0x13331f['responsetime'];this[_0x7bbd('0x14')]=getSeconds(_0x13331f['responsetime'],_0x13331f[_0x7bbd('0x11')]);this[_0x7bbd('0x15')]=0x0;this[_0x7bbd('0x16')]=0x0;this[_0x7bbd('0x17')]=_0x13331f[_0x7bbd('0x17')];this[_0x7bbd('0x18')]=_0x13331f[_0x7bbd('0x18')];this['callbackat']=_0x13331f[_0x7bbd('0x19')];this[_0x7bbd('0x1a')]=_0x13331f[_0x7bbd('0x1a')];this[_0x7bbd('0x1b')]=_0x13331f[_0x7bbd('0x1b')];this['ListId']=_0x13331f[_0x7bbd('0x1c')];this['UserId']=_0x13331f[_0x7bbd('0x1d')];this['VoiceQueueId']=_0x13331f['VoiceQueueId'];this[_0x7bbd('0x1e')]=_0x13331f[_0x7bbd('0x1e')];this[_0x7bbd('0x1f')]=_0x13331f[_0x7bbd('0x1f')]||'';this[_0x7bbd('0x20')]=_0x13331f[_0x7bbd('0x20')]||'';}module[_0x7bbd('0x21')]=History;
\ No newline at end of file
+var _0x31c5=['moment','milliseconds','diff','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','name','number','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x3edbfd,_0x83a7fd){var _0x4d29ae=function(_0x4404e2){while(--_0x4404e2){_0x3edbfd['push'](_0x3edbfd['shift']());}};_0x4d29ae(++_0x83a7fd);}(_0x31c5,0x1de));var _0x531c=function(_0x460726,_0xff08d7){_0x460726=_0x460726-0x0;var _0x35ab21=_0x31c5[_0x460726];return _0x35ab21;};'use strict';var util=require(_0x531c('0x0'));var _=require(_0x531c('0x1'));var moment=require(_0x531c('0x2'));function getSeconds(_0xb38f,_0x23efa5){var _0x229ed4=moment(_0xb38f)[_0x531c('0x3')](0x0);var _0x1c3487=moment(_0x23efa5)['milliseconds'](0x0);return _0x229ed4[_0x531c('0x4')](_0x1c3487,'seconds');}function History(_0x4978ee){this[_0x531c('0x5')]=_0x4978ee[_0x531c('0x5')];this['scheduledat']=_0x4978ee['scheduledat']||undefined;this[_0x531c('0x6')]=_0x4978ee[_0x531c('0x6')];this[_0x531c('0x7')]=_0x4978ee[_0x531c('0x6')]===_0x531c('0x8')?_0x531c('0x9'):_0x4978ee[_0x531c('0x6')];this['countbusyretry']=_0x4978ee[_0x531c('0xa')];this[_0x531c('0xb')]=_0x4978ee[_0x531c('0xb')];this[_0x531c('0xc')]=_0x4978ee['countnoanswerretry'];this[_0x531c('0xd')]=_0x4978ee[_0x531c('0xa')]+_0x4978ee[_0x531c('0xb')]+_0x4978ee[_0x531c('0xc')];this[_0x531c('0x9')]=_0x4978ee[_0x531c('0x9')];this['calleridname']=_0x4978ee[_0x531c('0xe')];this['calleridnum']=_0x4978ee[_0x531c('0xf')];this[_0x531c('0x10')]=_0x4978ee[_0x531c('0x10')];this[_0x531c('0x11')]=_0x4978ee['responsetime'];this['endtime']=_0x4978ee[_0x531c('0x11')];this['ringtime']=getSeconds(_0x4978ee[_0x531c('0x11')],_0x4978ee[_0x531c('0x10')]);this['holdtime']=0x0;this[_0x531c('0x12')]=0x0;this['callback']=_0x4978ee[_0x531c('0x13')];this[_0x531c('0x14')]=_0x4978ee[_0x531c('0x14')];this[_0x531c('0x15')]=_0x4978ee[_0x531c('0x15')];this[_0x531c('0x16')]=_0x4978ee[_0x531c('0x16')];this[_0x531c('0x17')]=_0x4978ee[_0x531c('0x17')];this[_0x531c('0x18')]=_0x4978ee['ListId'];this['UserId']=_0x4978ee[_0x531c('0x19')];this['VoiceQueueId']=_0x4978ee['VoiceQueueId'];this[_0x531c('0x1a')]=_0x4978ee[_0x531c('0x1a')];this[_0x531c('0x1b')]=_0x4978ee[_0x531c('0x1b')]||'';this[_0x531c('0x1c')]=_0x4978ee['originatecalleridname']||'';}module[_0x531c('0x1d')]=History;
\ No newline at end of file
index 7752419..62715b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1775=['bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','syncAgentComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','sumBillable','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated','Trunk','active','format','ivr','campaign:ivr:%s','predictiveIntervalAvgTalktime','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][objIsEmpty]','[checkGetDataPredictive][obj]','[ErlangB]','merge','[freeVariablesPredictive]','handlePredictive','string','isEmpty','\x22%s\x22\x20<%s>','inspect','error','length','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','statedesc','starttime','clearZombieChannels','[actions]','sequence','isNil','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','uniqueid','outboundAnswerCallsDay','state','membername','AMD','saveInDb','[syncHangupInAMD]','value','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','cause-txt','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','agiafterat','Abandoned','dropreason','CALLEREXIT','channel','locked','paused','stateinterface','actionid','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','Action','iftime\x20%s,%s','interval','content','indexOf','true','command','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','[syncQueueSummary]','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','callerid','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','entity\x20is\x20undefine','object','[callProgressDetecting]','evt\x20is\x20undefine','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','countglobal','createStateFinal','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','floor','erlangCalls','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Date]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free','agent\x20max\x20free\x20','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','[startMethodPredictive][StartPredictive][First]','averageHandleTime','getDataPredictive','startMethodPredictive','[startMethodPredictive][StartPredictive][Repeat]','outboundQueuePauses','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','busyFactor','[getDataPredictive]','[startMethodPredictive]','Failure\x20','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','ACTIVE','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','[abandonmentRate]','\x20m\x20=\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','[busyFactor]','\x20Umin\x20=\x20','exports','lodash'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var _=require(_0x5177('0x0'));var BPromise=require(_0x5177('0x1'));var uuid=require(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var rr=require('rr');var md5=require(_0x5177('0x4'));var Redis=require(_0x5177('0x5'));var config=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var loggerBooked=require(_0x5177('0x7'))(_0x5177('0x9'));var loggerPredictive=require(_0x5177('0x7'))(_0x5177('0xa'));var loggerPredictiveCalls=require(_0x5177('0x7'))(_0x5177('0xb'));var loggerSyncQueueSummary=require(_0x5177('0x7'))(_0x5177('0xc'));var ami=require(_0x5177('0xd'));config[_0x5177('0xe')]=_[_0x5177('0xf')](config[_0x5177('0xe')],{'host':_0x5177('0x10'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x5177('0x11'));var cmHopperFinal=require(_0x5177('0x12'));var cmHopperHistory=require(_0x5177('0x13'));var cmHopperBlack=require(_0x5177('0x14'));var voiceQueueRt=require(_0x5177('0x15'));var Action=require('./action');var History=require(_0x5177('0x16'));var Final=require(_0x5177('0x17'));var AgentComplete=require(_0x5177('0x18'));var QueueCallerAbandon=require(_0x5177('0x19'));var Hangup=require(_0x5177('0x1a'));var ipAgi=process[_0x5177('0x1b')][_0x5177('0x1c')]||_0x5177('0x1d');var strategy={'rrmemory':_0x5177('0x1e'),'roundrobin':_0x5177('0x1f')};var Sequence=function(){};Sequence[_0x5177('0x20')][_0x5177('0x21')]=function(_0x29cd2c){this[_0x5177('0x22')]=this[_0x5177('0x22')]?this[_0x5177('0x22')][_0x5177('0x23')](_0x29cd2c):_0x29cd2c();};function Dialer(_0x7dba6f,_0xe6dcf6){this['sequence']=new Sequence();this[_0x5177('0x24')]=_0xe6dcf6;this[_0x5177('0x25')]=_0x7dba6f[_0x5177('0x25')];this[_0x5177('0x26')]=_0x7dba6f['campaigns'];this[_0x5177('0x27')]=_0x7dba6f[_0x5177('0x27')];this[_0x5177('0x28')]=_0x7dba6f['trunks'];this[_0x5177('0x29')]=config['maxNumberOriginate']||0x2;this[_0x5177('0x2a')]={};this[_0x5177('0x2b')]={};this[_0x5177('0x2c')]={};this[_0x5177('0x2d')]={};this[_0x5177('0x2e')]={};this[_0x5177('0x2f')]={};this[_0x5177('0x30')]={};this[_0x5177('0x31')]={};this[_0x5177('0x32')]={};this[_0x5177('0x33')]={};ami['on'](_0x5177('0x34'),this[_0x5177('0x35')]['bind'](this));ami['on'](_0x5177('0x36'),this['syncQueueCallerAbandon'][_0x5177('0x37')](this));ami['on'](_0x5177('0x38'),this[_0x5177('0x39')][_0x5177('0x37')](this));ami['on']('agentcomplete',this[_0x5177('0x3a')]['bind'](this));ami['on']('custom:queuesummary',this[_0x5177('0xc')][_0x5177('0x37')](this));ami['on']('hangup',this[_0x5177('0x3b')]['bind'](this));ami['on'](_0x5177('0x3c'),this[_0x5177('0x3d')]['bind'](this));ami['on'](_0x5177('0x3e'),this[_0x5177('0x3f')][_0x5177('0x37')](this));ami['on'](_0x5177('0x40'),this[_0x5177('0x41')][_0x5177('0x37')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x5177('0x37')](this));this[_0x5177('0x42')]();this[_0x5177('0x43')]();}function isNotNull(_0x174f7a){return _0x174f7a!==null&&!_[_0x5177('0x44')](_0x174f7a);}function checkIsLoggedIn(_0x8134f9,_0x31eb9f){return function(){if(_0x31eb9f<=0x0){_0x8134f9[_0x5177('0x45')]='AGENTS_NOT_LOGGED';throw _0x8134f9[_0x5177('0x46')]+_0x5177('0x47');}};}function isActive(_0x4f3416){return _0x4f3416;}function checkIsActive(_0x32bea9,_0x5e4c48){return function(){if(!isActive(_0x5e4c48)){_0x32bea9[_0x5177('0x45')]=_0x5177('0x48');throw _0x32bea9[_0x5177('0x46')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4f70df){return function(){if(!isNotNull(_0x4f70df[_0x5177('0x49')])){_0x4f70df[_0x5177('0x45')]=_0x5177('0x4a');throw _0x4f70df[_0x5177('0x46')]+_0x5177('0x4b');}if(!isNotNull(_0x4f70df[_0x5177('0x49')][_0x5177('0x4c')])){_0x4f70df[_0x5177('0x45')]='INTERVAL_IS_NULL';throw _0x4f70df[_0x5177('0x46')]+_0x5177('0x4b');}if(!isNotNull(_['isEmpty'](_0x4f70df[_0x5177('0x49')][_0x5177('0x4c')]))){_0x4f70df[_0x5177('0x45')]=_0x5177('0x4a');throw _0x4f70df[_0x5177('0x46')]+_0x5177('0x4b');}};}function msgResponse(_0x4eaed4,_0x40c607,_0x1cb4a0){return{'action':_0x4eaed4,'response':_0x40c607,'message':_0x1cb4a0};}function myreject(_0x28b1d5){return function(_0x2e2cc2){return _0x28b1d5(msgResponse(_0x5177('0x4d'),_0x5177('0x4e'),JSON[_0x5177('0x4f')](_0x2e2cc2)));};}function getSeconds(_0x5a5a33,_0x257350){var _0x2ff13b=moment(_0x5a5a33)['milliseconds'](0x0);var _0x486dd5=moment(_0x257350)[_0x5177('0x50')](0x0);return _0x2ff13b[_0x5177('0x51')](_0x486dd5,_0x5177('0x52'));}function emit(_0x182c78,_0x3285c3,_0x1ea3be){io['to'](_0x182c78)[_0x5177('0x53')](_0x3285c3,_0x1ea3be);}function emitVoiceQueueSummary(_0x24fd92){if(_0x24fd92[_0x5177('0x54')]===_0x5177('0x55')){var _0x16fabc={'id':_0x24fd92['id'],'name':_0x24fd92[_0x5177('0x46')],'strategy':_0x24fd92[_0x5177('0x56')],'answered':_0x24fd92['answered'],'available':_0x24fd92[_0x5177('0x57')],'loggedIn':_0x24fd92[_0x5177('0x58')],'pTalking':_0x24fd92['pTalking'],'sumBillable':_0x24fd92[_0x5177('0x59')],'sumDuration':_0x24fd92['sumDuration'],'sumHoldTime':_0x24fd92[_0x5177('0x5a')]||0x0,'talking':_0x24fd92[_0x5177('0x5b')],'total':_0x24fd92[_0x5177('0x5c')],'type':_0x24fd92['type'],'unmanaged':_0x24fd92['unmanaged'],'abandoned':_0x24fd92[_0x5177('0x5d')],'waiting':_0x24fd92[_0x5177('0x5e')],'loggedInDb':_0x24fd92[_0x5177('0x5f')],'dialActive':_0x24fd92[_0x5177('0x60')],'dialMethod':_0x24fd92[_0x5177('0x61')],'dialOriginateCallerIdName':_0x24fd92[_0x5177('0x62')],'dialOriginateCallerIdNumber':_0x24fd92[_0x5177('0x63')],'dialOriginateTimeout':_0x24fd92[_0x5177('0x64')],'dialPrefix':_0x24fd92['dialPrefix'],'outboundAnswerAgiCallsDay':_0x24fd92[_0x5177('0x65')],'outboundAnswerCallsDay':_0x24fd92['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x24fd92['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x24fd92[_0x5177('0x66')],'outboundCongestionCallsDay':_0x24fd92[_0x5177('0x67')],'outboundDropCallsDayACS':_0x24fd92['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x24fd92[_0x5177('0x68')],'outboundDropCallsDayTimeout':_0x24fd92['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x24fd92['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x24fd92[_0x5177('0x69')],'outboundOriginateFailureCallsDay':_0x24fd92[_0x5177('0x6a')],'outboundReCallsDay':_0x24fd92[_0x5177('0x6b')],'outboundRejectCallsDay':_0x24fd92[_0x5177('0x6c')],'outboundUnknownCallsDay':_0x24fd92[_0x5177('0x6d')],'predictiveIntervalAnsweredCalls':_0x24fd92[_0x5177('0x6e')],'predictiveIntervalAvgHoldtime':_0x24fd92[_0x5177('0x6f')],'predictiveIntervalAvgTalktime':_0x24fd92['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x24fd92['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x24fd92[_0x5177('0x70')],'predictiveIntervalErlangCalls':_0x24fd92['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x24fd92[_0x5177('0x71')],'predictiveIntervalHitRate':_0x24fd92[_0x5177('0x72')],'predictiveIntervalLowerLimit':_0x24fd92[_0x5177('0x73')],'predictiveIntervalMultiplicativeFactor':_0x24fd92[_0x5177('0x74')],'predictiveIntervalPauses':_0x24fd92['predictiveIntervalPauses'],'predictiveIntervalTotalCalls':_0x24fd92[_0x5177('0x75')],'message':_0x24fd92[_0x5177('0x45')],'originated':_0x24fd92[_0x5177('0x76')]};if(_0x24fd92[_0x5177('0x77')]){_0x16fabc[_0x5177('0x77')]={'id':_0x24fd92[_0x5177('0x77')]['id'],'name':_0x24fd92[_0x5177('0x77')][_0x5177('0x46')],'active':_0x24fd92[_0x5177('0x77')][_0x5177('0x78')],'callerid':_0x24fd92[_0x5177('0x77')]['callerid']};}if(_0x24fd92[_0x5177('0x49')]){_0x16fabc['Interval']={'id':_0x24fd92['Interval']['id'],'name':_0x24fd92['Interval'][_0x5177('0x46')]};}var _0x2ce71a=md5(JSON['stringify'](_0x16fabc));if(_0x24fd92[_0x5177('0x4')]!==_0x2ce71a){_0x24fd92[_0x5177('0x4')]=_0x2ce71a;emit(util[_0x5177('0x79')]('voice:queue:%s',_0x16fabc[_0x5177('0x46')]),'voice_queue:save',_0x16fabc);}}}function emitCampaignSummary(_0x52b5e2){if(_0x52b5e2['type']===_0x5177('0x7a')){emit(util[_0x5177('0x79')](_0x5177('0x7b'),_0x52b5e2['name']),'campaign:save',_0x52b5e2);}}function checkGetDataPredictive(_0x42b827){if(isNotNull(_0x42b827)){if(!_['isEmpty'](_0x42b827)){if(_0x42b827[_0x5177('0x75')]>0x0){if(!_[_0x5177('0x44')](_0x42b827[_0x5177('0x7c')])&&_0x42b827[_0x5177('0x7c')]>0x0){return!![];}else{loggerPredictive[_0x5177('0x7d')](_0x5177('0x7e'),JSON[_0x5177('0x4f')](_0x42b827));}if(!_[_0x5177('0x44')](_0x42b827[_0x5177('0x6f')])&&_0x42b827[_0x5177('0x6f')]>0x0){return!![];}else{loggerPredictive[_0x5177('0x7d')](_0x5177('0x7f'),JSON[_0x5177('0x4f')](_0x42b827));}}else{loggerPredictive['info']('[checkGetDataPredictive][totalCalls]',JSON[_0x5177('0x4f')](_0x42b827));}}else{loggerPredictive['info'](_0x5177('0x80'),JSON['stringify'](_0x42b827));}}else{loggerPredictive[_0x5177('0x7d')](_0x5177('0x81'),JSON[_0x5177('0x4f')](_0x42b827));}return![];}function mergeDataErlangB(_0x55a0b6){return function(_0x5be224){loggerPredictive[_0x5177('0x7d')](_0x5177('0x82'),JSON[_0x5177('0x4f')](_0x5be224));_[_0x5177('0x83')](_0x55a0b6,_0x5be224);};}function getDiff(_0x4a4758){var _0x5718a1=moment()[_0x5177('0x50')](0x0);var _0x131da7=moment(_0x4a4758)[_0x5177('0x50')](0x0);return _0x5718a1[_0x5177('0x51')](_0x131da7,'seconds');}function ifInterval(_0xc3c118,_0x143aff){if(_[_0x5177('0x44')](_0x143aff)){return![];}if(getDiff(_0x143aff)<_0xc3c118*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x589da8){if(isNotNull(_0x589da8)){if(!_[_0x5177('0x44')](_0x589da8[_0x5177('0x30')])){_0x589da8[_0x5177('0x30')]=undefined;loggerPredictive['info'](_0x5177('0x84'),'startProgressive',_0x589da8[_0x5177('0x46')]);}if(!_[_0x5177('0x44')](_0x589da8[_0x5177('0x2f')])){_0x589da8['startPredictive']=undefined;loggerPredictive[_0x5177('0x7d')](_0x5177('0x84'),_0x5177('0x2f'),_0x589da8[_0x5177('0x46')]);}if(!_[_0x5177('0x44')](_0x589da8[_0x5177('0x85')])){clearInterval(_0x589da8[_0x5177('0x85')]);_0x589da8[_0x5177('0x85')]=undefined;loggerPredictive['info']('[freeVariablesPredictive]','handlePredictive',_0x589da8[_0x5177('0x46')]);}}}function erlangb(_0x18222f,_0x35aa22){if(_0x35aa22===0x0){return 0x0;}var _0x75cc0e=0x1;for(var _0x2472e9=0x1;_0x2472e9<=_0x35aa22;_0x2472e9+=0x1){_0x75cc0e=0x1+_0x75cc0e*_0x2472e9/_0x18222f;}return 0x1/_0x75cc0e;}function isVoiceQueueOutbound(_0x62a68a){return _0x62a68a==='outbound';}function isNotPreview(_0x523531){return _0x523531!==_0x5177('0x24');}function isCampaignIvr(_0x23eb6e){return _0x23eb6e===_0x5177('0x7a');}function getCallerId(_0x336017,_0x123d40,_0x1b1778){if(!_[_0x5177('0x44')](_0x1b1778)&&_0x5177('0x86')===typeof _0x1b1778&&!_[_0x5177('0x87')](_0x1b1778)){if(!_['isUndefined'](_0x123d40)&&_0x5177('0x86')===typeof _0x123d40&&!_[_0x5177('0x87')](_0x123d40)){return util['format'](_0x5177('0x88'),_0x123d40,_0x1b1778);}return util[_0x5177('0x79')]('\x22%s\x22\x20<%s>',_0x1b1778,_0x1b1778);}if(!_[_0x5177('0x44')](_0x336017)&&_0x5177('0x86')===typeof _0x336017&&!_[_0x5177('0x87')](_0x336017)){return _0x336017;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x23b246,_0x400e27){return function(_0x5f5bd5){freeVariablesPredictive(_0x400e27);emitVoiceQueueSummary(_0x400e27);emitCampaignSummary(_0x400e27);loggerSyncQueueSummary['error'](_0x23b246,util[_0x5177('0x89')](_0x5f5bd5,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4f76d7,_0x460bdb){return function(_0x53f599){loggerPredictive[_0x5177('0x8a')](_0x4f76d7,JSON[_0x5177('0x4f')](_0x53f599));freeVariablesPredictive(_0x460bdb);};}function loggerCatch(_0x5a8ada){return function(_0x2af938){logger[_0x5177('0x8a')](_0x5a8ada,util[_0x5177('0x89')](_0x2af938,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x46b63d){return _0x46b63d&&!_[_0x5177('0x44')](_0x46b63d)&&_0x46b63d[_0x5177('0x8b')]>0x0;}function decremetOriginate(_0x20d476){if(!_['isUndefined'](_0x20d476)&&_0x20d476!==null){if(_0x20d476[_0x5177('0x8c')]('originated')){if(_0x20d476['originated']>0x0){_0x20d476[_0x5177('0x76')]-=0x1;}else{logger[_0x5177('0x8a')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x5177('0x8a')](_0x5177('0x8d'));}}function checkContactLowerLimitOriginate(_0x43abdd,_0x9087e0,_0x19b587){if(_0x9087e0>_0x19b587){for(var _0x128cab=0x0;_0x128cab<_0x9087e0-_0x19b587;_0x128cab+=0x1){decremetOriginate(_0x43abdd);}}}function loggerGetContactDialer(_0xe22e2a,_0x3b26f4,_0x478d5e){return function(_0x54b28f){checkContactLowerLimitOriginate(_0x3b26f4,_0x478d5e,0x0);logger[_0x5177('0x8a')](_0xe22e2a,util[_0x5177('0x89')](_0x54b28f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x260475){return function(_0x2d24b3){if(isNotNull(_0x2d24b3)&&isNotNull(_0x2d24b3[0x0])){if(_0x2d24b3[0x0][_0x5177('0x8e')]>0x0){_0x260475[_0x5177('0x45')]='RESCHEDULED_CONTACTS';logger[_0x5177('0x7d')](_0x5177('0x8f')+_0x260475[_0x5177('0x46')],_0x2d24b3[0x0][_0x5177('0x8e')],'contacts');}else{_0x260475[_0x5177('0x45')]=_0x5177('0x90');logger[_0x5177('0x7d')](_0x5177('0x91')+_0x260475[_0x5177('0x46')]);}}};}function notSendMessagesQueue(_0x5130e6){if(_0x5130e6[_0x5177('0x92')]){freeVariablesPredictive(_0x5130e6);if(_0x5130e6['originated']===0x0&&_0x5130e6[_0x5177('0x5b')]===0x0&&_0x5130e6[_0x5177('0x5e')]===0x0&&(_0x5130e6['pTalking']||0x0)===0x0){_0x5130e6[_0x5177('0x92')]=![];_0x5130e6[_0x5177('0x57')]=0x0;_0x5130e6[_0x5177('0x45')]=_0x5177('0x48');loggerSyncQueueSummary['error'](_0x5177('0x93'),_0x5130e6[_0x5177('0x46')],_0x5177('0x94'));}else{_0x5130e6[_0x5177('0x45')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x5177('0x8a')](_0x5177('0x93'),_0x5130e6[_0x5177('0x46')],'is\x20disactive');}emitVoiceQueueSummary(_0x5130e6);}}function notSendMessagesCampaign(_0x54b87d){if(_0x54b87d[_0x5177('0x92')]){if(_0x54b87d[_0x5177('0x76')]===0x0){_0x54b87d[_0x5177('0x92')]=![];_0x54b87d[_0x5177('0x45')]=_0x5177('0x48');loggerSyncQueueSummary[_0x5177('0x8a')](_0x5177('0x95'),_0x54b87d[_0x5177('0x46')],_0x5177('0x94'));}else{_0x54b87d['message']='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0x5177('0x95'),_0x54b87d['name'],_0x5177('0x96'));}emitCampaignSummary(_0x54b87d);}}function createObjHistory(_0x3255a2,_0x56c1aa,_0x7474,_0x183393,_0x5269b0){_0x3255a2[_0x5177('0x45')]=_0x7474;var _0x10247=new Action(_0x3255a2,_0x56c1aa);var _0x41a7fa=new History(_0x10247);_0x41a7fa['state']=_0x183393;_0x41a7fa[_0x5177('0x97')]=_0x5269b0;_0x41a7fa['endtime']=_0x10247[_0x5177('0x98')];return _0x41a7fa;}Dialer[_0x5177('0x20')]['loopClearZombieChannels']=function(){var _0xe5a705=this;setInterval(function(){_0xe5a705[_0x5177('0x99')](_0xe5a705['uniqueId'],'[uniqueid]');_0xe5a705[_0x5177('0x99')](_0xe5a705['actions'],_0x5177('0x9a'));},0x32c8);};Dialer[_0x5177('0x20')]['clearZombieChannels']=function(_0x698518,_0x115be0){var _0xcbbb73=this;for(var _0x20ceb9 in _0x698518){if(_0x698518[_0x5177('0x8c')](_0x20ceb9)){this[_0x5177('0x9b')][_0x5177('0x21')](function(){if(!_[_0x5177('0x9c')](_0x698518[_0x20ceb9])){return ami['Action']({'action':_0x5177('0x9d'),'channel':_0x698518[_0x20ceb9]['channel']})[_0x5177('0x9e')](function(_0x339d5d){if(_0x339d5d[_0x5177('0x45')]===_0x5177('0x9f')){setTimeout(function(){if(_0x698518[_0x20ceb9]&&_0x698518[_0x20ceb9]['type']!==_0x5177('0x7a')){_0xcbbb73[_0x5177('0xa0')](_0xcbbb73['voiceQueues'][_0x698518[_0x20ceb9][_0x5177('0xa1')]]);logger[_0x5177('0x8a')]('[Dialer][checkChannel]',_0x115be0,_0x20ceb9,_0x698518[_0x20ceb9][_0x5177('0xa1')]);delete _0x698518[_0x20ceb9];}if(_0x698518[_0x20ceb9]&&_0x698518[_0x20ceb9]['type']===_0x5177('0x7a')){_0xcbbb73['updateOriginated'](_0xcbbb73['campaigns'][_0x698518[_0x20ceb9]['queue']]);logger[_0x5177('0x8a')](_0x5177('0xa2'),_0x115be0,_0x20ceb9,_0x698518[_0x20ceb9][_0x5177('0xa1')]);delete _0x698518[_0x20ceb9];}},0x2328);}});}});}}};Dialer['prototype'][_0x5177('0xa3')]=function(_0x3473ef){return BPromise[_0x5177('0xa4')]()[_0x5177('0xa5')](cmHopper[_0x5177('0xa3')](_0x3473ef))['catch'](loggerCatch(_0x5177('0xa6')));};Dialer[_0x5177('0x20')]['checkIsBlackList']=function(_0x29f5a6){return BPromise['resolve']()[_0x5177('0xa5')](cmHopperBlack['checkIsBlackList'](_0x29f5a6))[_0x5177('0x9e')](loggerCatch(_0x5177('0xa7')));};Dialer[_0x5177('0x20')][_0x5177('0xa8')]=function(_0x3447b9){return BPromise[_0x5177('0xa4')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x3447b9))[_0x5177('0x9e')](loggerCatch(_0x5177('0xa9')));};Dialer[_0x5177('0x20')]['averageHandleTime']=function(_0x405b03){return BPromise[_0x5177('0xa4')]()['then'](cmHopperHistory[_0x5177('0xaa')](_0x405b03))['catch'](loggerCatch(_0x5177('0xab')));};Dialer[_0x5177('0x20')][_0x5177('0xac')]=function(_0x593262){return BPromise[_0x5177('0xa4')]()['then'](cmHopper[_0x5177('0xac')](_0x593262))[_0x5177('0x9e')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['getContactDialer']=function(_0x249b0f,_0x5f4769,_0x34b17e,_0x3132f0){return BPromise[_0x5177('0xa4')]()['then'](cmHopper['getContactDialer'](_0x249b0f,_0x5f4769,_0x34b17e,_0x3132f0))['catch'](loggerCatch(_0x5177('0xad')));};Dialer[_0x5177('0x20')][_0x5177('0xae')]=function(_0x5a7df2,_0x4152f2,_0x358c97){return BPromise['resolve']()[_0x5177('0xa5')](cmHopper['getContactDialerIvr'](_0x5a7df2,_0x4152f2,_0x358c97))[_0x5177('0x9e')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x3940dd){return BPromise['resolve']()[_0x5177('0xa5')](voiceQueueRt[_0x5177('0xaf')](_0x3940dd))[_0x5177('0x9e')](loggerCatch(_0x5177('0xb0')));};Dialer[_0x5177('0x20')][_0x5177('0xb1')]=function(_0x580d34){return BPromise[_0x5177('0xa4')]()[_0x5177('0xa5')](cmHopper['moveContactManagedDialer'](_0x580d34))[_0x5177('0x9e')](loggerCatch(_0x5177('0xb2')));};Dialer[_0x5177('0x20')]['createHistory']=function(_0x555da1){return BPromise['resolve']()[_0x5177('0xa5')](cmHopperHistory[_0x5177('0xb3')](_0x555da1))[_0x5177('0x9e')](loggerCatch(_0x5177('0xb4')));};Dialer[_0x5177('0x20')][_0x5177('0xa0')]=function(_0x2053b1){if(!_[_0x5177('0x44')](_0x2053b1)&&_0x2053b1!==null){if(_0x2053b1[_0x5177('0x8c')](_0x5177('0x76'))){if(_0x2053b1[_0x5177('0x76')]>0x0){_0x2053b1[_0x5177('0x76')]-=0x1;}else{logger['error'](_0x5177('0xb5'));}}}else{logger['error'](_0x5177('0xb6'));}};Dialer[_0x5177('0x20')][_0x5177('0xb7')]=function(_0x5006de,_0x1868e8){var _0x15f6bd=this;return function(_0x3867c9){_0x15f6bd[_0x5177('0xa0')](_0x1868e8);logger[_0x5177('0x8a')](_0x5006de,util[_0x5177('0x89')](_0x3867c9,{'showHidden':![],'depth':null}));};};Dialer[_0x5177('0x20')][_0x5177('0xb8')]=function(_0x50b76e,_0x479948,_0x67fde4){var _0x4f5fe1={'state':0x19,'statedesc':_0x5177('0xb9')};this[_0x5177('0xa0')](_0x479948);this['saveInDb'](_[_0x5177('0x83')](_0x4f5fe1,_[_0x5177('0xba')](_0x67fde4,['ContactId',_0x5177('0xbb'),_0x5177('0xbc'),_0x5177('0xbd'),_0x5177('0xbe')])),_0x5177('0xbf'),_0x5177('0xc0'));logger[_0x5177('0x8a')](_0x50b76e);};Dialer[_0x5177('0x20')][_0x5177('0xc1')]=function(_0x8c0153){return _0x8c0153===_0x5177('0xc2');};Dialer[_0x5177('0x20')][_0x5177('0xc3')]=function(_0x4f27ec){return!_[_0x5177('0x44')](_0x4f27ec)&&_0x4f27ec&&!_[_0x5177('0x44')](_0x4f27ec[_0x5177('0x46')])&&!_['isUndefined'](_0x4f27ec[_0x5177('0x78')])&&_0x4f27ec[_0x5177('0x78')]&&(this['trunks'][util[_0x5177('0x79')]('SIP/%s',_0x4f27ec['name'])][_0x5177('0x9d')]===_0x5177('0xc4')||this[_0x5177('0x28')][util[_0x5177('0x79')](_0x5177('0xc5'),_0x4f27ec[_0x5177('0x46')])]['status']===_0x5177('0xc6'));};Dialer[_0x5177('0x20')]['saveInDb']=function(_0x1aa8ca,_0xa8114c,_0x27bfd9){this[_0x5177('0xb3')](_0x1aa8ca)[_0x5177('0x9e')](loggerCatch(_0xa8114c));this[_0x5177('0xb1')](_0x1aa8ca)[_0x5177('0x9e')](loggerCatch(_0x27bfd9));};Dialer[_0x5177('0x20')]['syncVarSet']=function(_0x193dbf){var _0x566d71=this[_0x5177('0x2d')][_0x193dbf['uniqueid']];var _0x2007d2;if(!_[_0x5177('0x9c')](_0x193dbf)&&!_[_0x5177('0x9c')](_0x193dbf[_0x5177('0xc7')])&&!_['isNil'](_0x193dbf[_0x5177('0xc7')][_0x5177('0xc8')])&&_0x193dbf[_0x5177('0xc9')]===_0x5177('0xca')&&_0x566d71){if(_0x566d71['type']!=='ivr'&&this['voiceQueues'][_0x566d71['queue']][_0x5177('0xcb')]&&_0x193dbf['value']===_0x5177('0xcc')){delete this['uniqueId'][_0x193dbf[_0x5177('0xcd')]];this['updateOriginated'](this[_0x5177('0x25')][_0x566d71[_0x5177('0xa1')]]);this[_0x5177('0x25')][_0x566d71[_0x5177('0xa1')]][_0x5177('0xce')]+=0x1;this[_0x5177('0x25')][_0x566d71[_0x5177('0xa1')]][_0x5177('0x65')]+=0x1;_0x2007d2=new Hangup(_0x566d71,_0x193dbf);_0x2007d2[_0x5177('0xcf')]=0x12;_0x2007d2[_0x5177('0x97')]='HangupInAMD';_0x2007d2[_0x5177('0xd0')]=_0x5177('0xd1');this[_0x5177('0xd2')](_0x2007d2,'[syncHangupInAMD][createHistory]',_0x5177('0xd3'));}if(_0x566d71[_0x5177('0x54')]!==_0x5177('0x7a')&&this[_0x5177('0x25')][_0x566d71[_0x5177('0xa1')]][_0x5177('0xcb')]&&_0x193dbf[_0x5177('0xd4')]===_0x5177('0xd5')){delete this[_0x5177('0x2d')][_0x193dbf[_0x5177('0xcd')]];this[_0x5177('0xa0')](this['voiceQueues'][_0x566d71[_0x5177('0xa1')]]);this[_0x5177('0x25')][_0x566d71[_0x5177('0xa1')]]['outboundAnswerCallsDay']+=0x1;this[_0x5177('0x25')][_0x566d71[_0x5177('0xa1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2007d2=new Hangup(_0x566d71,_0x193dbf);_0x2007d2[_0x5177('0xcf')]=0x13;_0x2007d2[_0x5177('0x97')]=_0x5177('0xd6');_0x2007d2['membername']=_0x5177('0xd1');_0x2007d2[_0x5177('0xd7')]=!![];this[_0x5177('0xd2')](_0x2007d2,_0x5177('0xd8'),_0x5177('0xd9'));}if(_0x566d71['type']==='ivr'&&this[_0x5177('0x26')][_0x566d71[_0x5177('0xa1')]]['dialAMDActive']&&_0x193dbf[_0x5177('0xd4')]===_0x5177('0xcc')){delete this['uniqueId'][_0x193dbf[_0x5177('0xcd')]];this[_0x5177('0xa0')](this['campaigns'][_0x566d71['queue']]);_0x2007d2=new Hangup(_0x566d71,_0x193dbf);_0x2007d2[_0x5177('0xcf')]=0x12;_0x2007d2['statedesc']='HangupInAMD';_0x2007d2[_0x5177('0xd0')]=_0x5177('0xd1');this['saveInDb'](_0x2007d2,_0x5177('0xda'),_0x5177('0xdb'));}if(_0x566d71[_0x5177('0x54')]===_0x5177('0x7a')&&this[_0x5177('0x26')][_0x566d71[_0x5177('0xa1')]]['dialAMDActive']&&_0x193dbf[_0x5177('0xd4')]==='MACHINE'){delete this['uniqueId'][_0x193dbf[_0x5177('0xcd')]];this[_0x5177('0xa0')](this[_0x5177('0x26')][_0x566d71['queue']]);_0x2007d2=new Hangup(_0x566d71,_0x193dbf);_0x2007d2[_0x5177('0xcf')]=0x13;_0x2007d2[_0x5177('0x97')]=_0x5177('0xd6');_0x2007d2[_0x5177('0xd0')]=_0x5177('0xd1');_0x2007d2[_0x5177('0xd7')]=!![];this[_0x5177('0xd2')](_0x2007d2,_0x5177('0xdc'),_0x5177('0xdd'));}}};Dialer[_0x5177('0x20')][_0x5177('0x3b')]=function(_0x2592ad){var _0x5e2957=this[_0x5177('0x2d')][_0x2592ad[_0x5177('0xcd')]];var _0x38f0f4=this;var _0x43891f;if(_0x5e2957&&_0x5e2957['type']==='ivr'){delete this['uniqueId'][_0x2592ad[_0x5177('0xcd')]];this[_0x5177('0xa0')](this[_0x5177('0x26')][_0x5e2957[_0x5177('0xa1')]]);this[_0x5177('0x26')][_0x5e2957['queue']][_0x5177('0xde')]+=0x1;_0x43891f=new Hangup(_0x5e2957,_0x2592ad);this['createHistory'](_0x43891f)[_0x5177('0x9e')](loggerCatch(_0x5177('0xdf')));this[_0x5177('0xb1')](_0x43891f)[_0x5177('0x9e')](loggerCatch(_0x5177('0xe0')));}if(_0x5e2957&&_0x5e2957[_0x5177('0x54')]!==_0x5177('0x7a')&&isNotNull(this[_0x5177('0x25')][_0x5e2957[_0x5177('0xa1')]][_0x5177('0xe1')])){delete this[_0x5177('0x2d')][_0x2592ad[_0x5177('0xcd')]];this[_0x5177('0xa0')](this['voiceQueues'][_0x5e2957[_0x5177('0xa1')]]);this[_0x5177('0x25')][_0x5e2957['queue']][_0x5177('0xce')]+=0x1;this[_0x5177('0x25')][_0x5e2957[_0x5177('0xa1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x43891f=new Hangup(_0x5e2957,_0x2592ad);_0x43891f[_0x5177('0xcf')]=0x10;_0x43891f['statedesc']='AnswerAGI';_0x43891f[_0x5177('0xd0')]='AGI';this[_0x5177('0xb3')](_0x43891f)[_0x5177('0x9e')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x5177('0xb1')](_0x43891f)[_0x5177('0x9e')](loggerCatch(_0x5177('0xe0')));}if(_0x5e2957&&_0x5e2957[_0x5177('0x54')]!==_0x5177('0x7a')&&!isNotNull(this['voiceQueues'][_0x5e2957['queue']][_0x5177('0xe1')])){delete this[_0x5177('0x2d')][_0x2592ad[_0x5177('0xcd')]];this[_0x5177('0xa0')](this[_0x5177('0x25')][_0x5e2957[_0x5177('0xa1')]]);this['voiceQueues'][_0x5e2957[_0x5177('0xa1')]]['outboundUnknownCallsDay']+=0x1;_0x43891f=new Hangup(_0x5e2957,_0x2592ad);_0x43891f[_0x5177('0xcf')]=0xc;_0x43891f[_0x5177('0x97')]=_0x2592ad[_0x5177('0xe2')];_0x43891f[_0x5177('0xd0')]=_0x5177('0xe3');this[_0x5177('0xb3')](_0x43891f)[_0x5177('0x9e')](loggerCatch(_0x5177('0xdf')));this[_0x5177('0xb1')](_0x43891f)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x5177('0x20')][_0x5177('0x3a')]=function(_0x197806){var _0x4cc2b1=this[_0x5177('0x2d')][_0x197806[_0x5177('0xcd')]];var _0x83efb8=this;if(this[_0x5177('0x25')][_0x197806[_0x5177('0xa1')]]){if(_0x4cc2b1&&_0x4cc2b1[_0x5177('0x54')]!==_0x5177('0x7a')){delete this['uniqueId'][_0x197806[_0x5177('0xcd')]];this[_0x5177('0x25')][_0x197806['queue']][_0x5177('0xce')]+=0x1;var _0x689916=new AgentComplete(_0x4cc2b1,_0x197806);if(_0x197806[_0x5177('0xe4')]===_0x5177('0xe5')){_0x689916['agiafterat']=this[_0x5177('0x25')][_0x197806[_0x5177('0xa1')]][_0x5177('0xe6')]&&this[_0x5177('0x25')][_0x197806['queue']][_0x5177('0xe7')]?moment()[_0x5177('0x79')](_0x5177('0xe8')):undefined;}this[_0x5177('0xb3')](_0x689916)[_0x5177('0x9e')](loggerCatch(_0x5177('0xe9')));this[_0x5177('0xb1')](_0x689916)[_0x5177('0x9e')](loggerCatch(_0x5177('0xea')));}}};Dialer[_0x5177('0x20')][_0x5177('0x35')]=function(_0x4bef3d){if(this['voiceQueues'][_0x4bef3d[_0x5177('0xa1')]]){if(this[_0x5177('0x2d')][_0x4bef3d[_0x5177('0xcd')]]&&this['uniqueId'][_0x4bef3d[_0x5177('0xcd')]][_0x5177('0x54')]!==_0x5177('0x7a')){this[_0x5177('0xa0')](this[_0x5177('0x25')][_0x4bef3d[_0x5177('0xa1')]]);this['uniqueId'][_0x4bef3d[_0x5177('0xcd')]][_0x5177('0xeb')]=moment()[_0x5177('0x79')](_0x5177('0xe8'));}}};Dialer[_0x5177('0x20')][_0x5177('0xec')]=function(_0x4a5766){this[_0x5177('0xb3')](_0x4a5766)[_0x5177('0x9e')](loggerCatch(_0x5177('0xe9')));this[_0x5177('0xb1')](_0x4a5766)[_0x5177('0x9e')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x5177('0x20')][_0x5177('0xed')]=function(_0x3128b8){var _0x439a36=this[_0x5177('0x2d')][_0x3128b8['uniqueid']];var _0xbe6f55=this;if(this[_0x5177('0x25')][_0x3128b8['queue']]){if(_0x439a36&&_0x439a36[_0x5177('0x54')]!==_0x5177('0x7a')){delete this['uniqueId'][_0x3128b8['uniqueid']];this[_0x5177('0xa0')](this[_0x5177('0x25')][_0x3128b8['queue']]);_0x439a36[_0x5177('0xee')]=moment()[_0x5177('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x81fca0=new QueueCallerAbandon(_0x439a36,_0x3128b8);if(getSeconds(_0x439a36[_0x5177('0xee')],_0x439a36[_0x5177('0xef')])>=_0x439a36[_0x5177('0xf0')]){this[_0x5177('0x25')][_0x3128b8[_0x5177('0xa1')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x5177('0x25')][_0x3128b8['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0x5177('0x25')][_0x3128b8[_0x5177('0xa1')]][_0x5177('0x71')]+=0x1;_0x81fca0[_0x5177('0xcf')]=0xa;_0x81fca0[_0x5177('0x97')]=_0x5177('0xf1');_0x81fca0['dropreason']='TIMEOUT';_0x81fca0[_0x5177('0xf2')]=this[_0x5177('0x25')][_0x3128b8[_0x5177('0xa1')]][_0x5177('0xe6')]?moment()['format'](_0x5177('0xe8')):undefined;this['queueCallerAbandonCreateState'](_0x81fca0);}else{this[_0x5177('0x25')][_0x3128b8[_0x5177('0xa1')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x3128b8[_0x5177('0xa1')]][_0x5177('0x68')]+=0x1;_0x81fca0['state']=0xb;_0x81fca0['statedesc']=_0x5177('0xf3');_0x81fca0[_0x5177('0xf4')]=_0x5177('0xf5');this[_0x5177('0xec')](_0x81fca0);}}}};Dialer[_0x5177('0x20')]['syncNewExten']=function(_0xdaae71){if(this[_0x5177('0x2b')][_0xdaae71[_0x5177('0xcd')]]){this[_0x5177('0x2b')][_0xdaae71[_0x5177('0xcd')]][_0x5177('0xf6')]=_0xdaae71[_0x5177('0xf6')];}if(this[_0x5177('0x2d')][_0xdaae71[_0x5177('0xcd')]]){this['uniqueId'][_0xdaae71[_0x5177('0xcd')]][_0x5177('0xf6')]=_0xdaae71[_0x5177('0xf6')];}};Dialer[_0x5177('0x20')][_0x5177('0x41')]=function(_0x514fb7){if(strategy[this[_0x5177('0x25')][this['actions'][_0x514fb7['actionid']][_0x5177('0xa1')]][_0x5177('0x56')]]===_0x5177('0x1f')){if(this[_0x5177('0x2b')][_0x514fb7['actionid']]&&_[_0x5177('0x9c')](this[_0x5177('0x2b')][_0x514fb7['actionid']][_0x5177('0xf7')])&&_0x514fb7[_0x5177('0x9d')]==='1'&&_0x514fb7[_0x5177('0xf8')]==='0'){if(this[_0x5177('0x27')][_0x514fb7[_0x5177('0xf9')]]){if(!this[_0x5177('0x27')][_0x514fb7[_0x5177('0xf9')]][_0x5177('0xf7')]){this[_0x5177('0x27')][_0x514fb7[_0x5177('0xf9')]][_0x5177('0xf7')]=!![];this[_0x5177('0x2b')][_0x514fb7[_0x5177('0xfa')]][_0x5177('0xf7')]=!![];this[_0x5177('0x2b')][_0x514fb7[_0x5177('0xfa')]][_0x5177('0xf9')]=_0x514fb7['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x5177('0x2b')][_0x514fb7[_0x5177('0xfa')]][_0x5177('0xa1')]][_0x5177('0x56')]]||_0x5177('0x1e'))==='rrmemory'){if(this[_0x5177('0x2b')][_0x514fb7['actionid']]){if(this[_0x5177('0x27')][_0x514fb7[_0x5177('0xf9')]]){this['actions'][_0x514fb7['actionid']]['stateinterface']=_0x514fb7[_0x5177('0xf9')];if(_[_0x5177('0x9c')](this['queueBooked'][this[_0x5177('0x2b')][_0x514fb7[_0x5177('0xfa')]][_0x5177('0xa1')]])){this[_0x5177('0x32')][this[_0x5177('0x2b')][_0x514fb7[_0x5177('0xfa')]][_0x5177('0xa1')]]=[];}this[_0x5177('0x32')][this[_0x5177('0x2b')][_0x514fb7['actionid']]['queue']]['push'](_[_0x5177('0x83')](_[_0x5177('0xba')](this['actions'][_0x514fb7['actionid']],[_0x5177('0xfb'),'stateinterface']),{'status':_0x514fb7[_0x5177('0x9d')],'paused':_0x514fb7[_0x5177('0xf8')]}));}}}};function unlockQueueStatus(_0x53bec7,_0x423339){setTimeout(function(){if(_[_0x5177('0x44')](_0x53bec7['queueStatusComplete'])){loggerBooked[_0x5177('0x8a')](_0x5177('0xfc'),_0x423339);}_0x53bec7['queueStatusComplete']=!![];loggerBooked['info'](_0x5177('0xfd'),_0x423339,JSON[_0x5177('0x4f')](_[_0x5177('0xba')](_0x53bec7,[_0x5177('0x46'),_0x5177('0xfe')])));},0x1f3);}Dialer[_0x5177('0x20')]['syncQueueStatusComplete']=function(_0x320170){var _0x1f7fbd=this;var _0x3bb644=_0x1f7fbd['voiceQueues'][_0x1f7fbd[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]];if(strategy[this[_0x5177('0x25')][this['actions'][_0x320170[_0x5177('0xfa')]]['queue']][_0x5177('0x56')]]===_0x5177('0x1f')){if(this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]]&&this[_0x5177('0x2b')][_0x320170['actionid']][_0x5177('0xf9')]){this[_0x5177('0x24')][_0x5177('0xff')](this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xfb')],this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xf9')])['catch'](function(_0x11dfcf){logger[_0x5177('0x8a')](_0x5177('0x100'),util[_0x5177('0x89')](_0x11dfcf,{'showHidden':![],'depth':null}));})[_0x5177('0x23')](function(){_0x1f7fbd[_0x5177('0xa0')](_0x1f7fbd['voiceQueues'][_0x1f7fbd['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]);_0x1f7fbd['agents'][_0x1f7fbd[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]]['stateinterface']][_0x5177('0xf7')]=![];delete _0x1f7fbd[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]];unlockQueueStatus(_0x3bb644);});}else{this[_0x5177('0xa0')](this[_0x5177('0x25')][this['actions'][_0x320170['actionid']][_0x5177('0xa1')]]);this[_0x5177('0xac')]({'active':![],'ContactId':this[_0x5177('0x2b')][_0x320170['actionid']][_0x5177('0x101')],'ListId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbb')],'VoiceQueueId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbd')]||undefined,'CampaignId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbe')]||undefined})[_0x5177('0x9e')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]];unlockQueueStatus(_0x3bb644);}}else if((strategy[this[_0x5177('0x25')][this['actions'][_0x320170['actionid']][_0x5177('0xa1')]][_0x5177('0x56')]]||_0x5177('0x1e'))===_0x5177('0x1e')){var _0x19b55b;if(this[_0x5177('0x2b')][_0x320170['actionid']]&&!_[_0x5177('0x87')](this[_0x5177('0x32')][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]])){if(this[_0x5177('0x33')][_0x1f7fbd['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]){this[_0x5177('0x33')][_0x1f7fbd['actions'][_0x320170[_0x5177('0xfa')]]['queue']]=this[_0x5177('0x33')][this['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]?this[_0x5177('0x33')][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]:this['queueBooked'][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]?this['queueBooked'][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]['_rr']||0x0:0x0;}this[_0x5177('0x32')][this['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]['_rr']=this[_0x5177('0x33')][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]];for(var _0x37feb0=0x0;_0x37feb0<this[_0x5177('0x32')][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]][_0x5177('0x8b')];_0x37feb0+=0x1){_0x19b55b=rr(this[_0x5177('0x32')][this['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]);this[_0x5177('0x33')][_0x1f7fbd['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]=this['queueBooked'][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]['_rr'];if(_0x19b55b[_0x5177('0x9d')]==='1'&&_0x19b55b[_0x5177('0xf8')]==='0'){break;}}if(!_[_0x5177('0x9c')](_0x19b55b)){this[_0x5177('0x27')][_0x19b55b[_0x5177('0xf9')]][_0x5177('0x102')]=_[_0x5177('0x44')](this[_0x5177('0x27')][_0x19b55b[_0x5177('0xf9')]][_0x5177('0x102')])?!![]:this['agents'][_0x19b55b[_0x5177('0xf9')]]['unlockRR'];}loggerBooked[_0x5177('0x7d')](_0x5177('0x103'),_0x320170['actionid'],'Agent:\x20',JSON[_0x5177('0x4f')](_[_0x5177('0xba')](this[_0x5177('0x27')][_0x19b55b[_0x5177('0xf9')]],[_0x5177('0x46'),_0x5177('0x102')])),_0x5177('0x104'),JSON[_0x5177('0x4f')](_0x19b55b[_0x5177('0xfb')]));if(!_[_0x5177('0x9c')](_0x19b55b)&&_0x19b55b['status']==='1'&&_0x19b55b[_0x5177('0xf8')]==='0'&&this[_0x5177('0x27')][_0x19b55b[_0x5177('0xf9')]][_0x5177('0x102')]){this[_0x5177('0x27')][_0x19b55b['stateinterface']][_0x5177('0x102')]=![];this[_0x5177('0x32')][_0x1f7fbd['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]=[];this['preview'][_0x5177('0xff')](_0x19b55b[_0x5177('0xfb')],_0x19b55b[_0x5177('0xf9')])[_0x5177('0x9e')](function(_0x554df3){logger[_0x5177('0x8a')](_0x5177('0x100'),util[_0x5177('0x89')](_0x554df3,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1f7fbd[_0x5177('0xa0')](_0x1f7fbd['voiceQueues'][_0x1f7fbd['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]);setTimeout(function(){_0x1f7fbd[_0x5177('0x27')][_0x19b55b['stateinterface']]['unlockRR']=!![];loggerBooked[_0x5177('0x7d')]('[booked][RR][finaly]',_0x320170[_0x5177('0xfa')],_0x5177('0x105'),JSON[_0x5177('0x4f')](_[_0x5177('0xba')](_0x1f7fbd['agents'][_0x19b55b[_0x5177('0xf9')]],['name','unlockRR'])),'contactAgent-idHopper:\x20',JSON[_0x5177('0x4f')](_0x19b55b[_0x5177('0xfb')]));},0xc7);delete _0x1f7fbd[_0x5177('0x2b')][_0x320170['actionid']];unlockQueueStatus(_0x3bb644,_0x320170['actionid']);});}else{loggerBooked[_0x5177('0x7d')](_0x5177('0x106'));this['updateOriginated'](this[_0x5177('0x25')][this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x5177('0x2b')][_0x320170['actionid']][_0x5177('0x101')],'ListId':this[_0x5177('0x2b')][_0x320170['actionid']][_0x5177('0xbb')],'VoiceQueueId':this[_0x5177('0x2b')][_0x320170['actionid']][_0x5177('0xbd')]||undefined,'CampaignId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbe')]||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x107')));delete this[_0x5177('0x2b')][_0x320170['actionid']];unlockQueueStatus(_0x3bb644);}}else{loggerBooked[_0x5177('0x7d')]('[booked][unlock2]');this[_0x5177('0xa0')](this[_0x5177('0x25')][this[_0x5177('0x2b')][_0x320170['actionid']][_0x5177('0xa1')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0x101')],'ListId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbb')],'VoiceQueueId':this['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xbd')]||undefined,'CampaignId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbe')]||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this['actions'][_0x320170[_0x5177('0xfa')]];unlockQueueStatus(_0x3bb644);}}else{loggerBooked[_0x5177('0x7d')]('[booked][unlock3]');this[_0x5177('0xa0')](this[_0x5177('0x25')][this['actions'][_0x320170[_0x5177('0xfa')]][_0x5177('0xa1')]]);this[_0x5177('0xac')]({'active':![],'ContactId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0x101')],'ListId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbb')],'VoiceQueueId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbd')]||undefined,'CampaignId':this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]][_0x5177('0xbe')]||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x108')));delete this[_0x5177('0x2b')][_0x320170[_0x5177('0xfa')]];unlockQueueStatus(_0x3bb644);}};Dialer[_0x5177('0x20')][_0x5177('0x42')]=function(){var _0x5bef3d=this;setInterval(function(){_0x5bef3d[_0x5177('0x109')]();},0x3e8);};Dialer['prototype'][_0x5177('0x10a')]=function(_0xc149bc){var _0x41b9ca=this;return function(){if(!_0x41b9ca[_0x5177('0xc3')](_0xc149bc[_0x5177('0x77')])){if(!_0x41b9ca['isTrunkReachable'](_0xc149bc[_0x5177('0x10b')])){_0xc149bc[_0x5177('0x45')]=_0x5177('0x10c');throw _0xc149bc[_0x5177('0x46')]+_0x5177('0x10d');}}};};Dialer[_0x5177('0x20')][_0x5177('0x10e')]=function(_0x511cbb,_0x2a71ee,_0x5819f6,_0x21f261){var _0x51d244=this;return function(){var _0x433922=!![];return _0x51d244[_0x5177('0x10f')](_0x511cbb,_0x2a71ee,_0x5819f6,_0x21f261,_0x433922);};};Dialer[_0x5177('0x20')][_0x5177('0x110')]=function(_0x269f81,_0x22d84a,_0x3adf12,_0x45b69){var _0xe4005e=this;return function(){var _0x22d659=![];return _0xe4005e[_0x5177('0x10f')](_0x269f81[_0x5177('0x4c')],_0x22d84a,_0x3adf12,_0x45b69,_0x22d659);};};Dialer['prototype']['ifTime']=function(_0x46c199,_0x419d25,_0x241392,_0x147b19,_0x22cc65){var _0x21cdcd=[];return new BPromise(function(_0x228782,_0x414134){if(!isNotNull(_0x46c199)){_0x147b19['message']=_0x5177('0x4a');return _0x414134(msgResponse(_0x5177('0x10f'),'Failure',_0x241392+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x46c199)){_0x147b19[_0x5177('0x45')]='INTERVAL_IS_EMPTY';return _0x414134(msgResponse(_0x5177('0x10f'),_0x5177('0x111'),_0x241392+'\x20Intervals\x20is\x20empty\x20'));}if(_0x419d25&&_[_0x5177('0x44')](config[_0x5177('0x112')][_0x419d25])){_0x147b19[_0x5177('0x45')]=_0x5177('0x113');return _0x414134(msgResponse(_0x5177('0x10f'),_0x5177('0x111'),_0x241392+_0x5177('0x114')+_0x419d25));}if(_['isArray'](_0x46c199)){for(var _0x446f09=0x0;_0x446f09<_0x46c199[_0x5177('0x8b')];_0x446f09+=0x1){_0x21cdcd[_0x5177('0x115')](ami[_0x5177('0x116')]({'action':'command','command':util[_0x5177('0x79')](_0x5177('0x117'),_0x46c199[_0x446f09][_0x5177('0x118')],!_[_0x5177('0x44')](config[_0x5177('0x112')][_0x419d25])?_0x419d25:'')})[_0x5177('0xa5')](function(_0x339c38){return _0x339c38[_0x5177('0x119')][_0x5177('0x11a')](_0x5177('0x11b'))>=0x0?!![]:![];})[_0x5177('0x9e')](myreject(_0x414134)));}}else{_0x21cdcd[_0x5177('0x115')](ami[_0x5177('0x116')]({'action':_0x5177('0x11c'),'command':util['format'](_0x5177('0x117'),_0x46c199,!_[_0x5177('0x44')](config[_0x5177('0x112')][_0x419d25])?_0x419d25:'')})['then'](function(_0x555d18){return _0x555d18[_0x5177('0x119')]['indexOf']('true')>=0x0?!![]:![];})[_0x5177('0x9e')](myreject(_0x414134)));}BPromise['all'](_0x21cdcd)['then'](function(_0x46fa0f){var _0x25e1f3=_[_0x5177('0x11d')](_0x46fa0f);if(_0x25e1f3){return _0x228782(_0x25e1f3);}else{_0x147b19['message']=_0x22cc65?_0x5177('0x11e'):_0x5177('0x11f');return _0x414134(msgResponse(_0x5177('0x120'),_0x5177('0x111'),_0x5177('0x121')+_0x22cc65+'\x20'+_0x241392+_0x5177('0x122')+util[_0x5177('0x89')](_0x46c199,{'showHidden':![],'depth':null})+_0x5177('0x123')+_0x419d25));}})[_0x5177('0x9e')](function(_0x284df1){return _0x414134(msgResponse(_0x5177('0x10f'),_0x5177('0x111'),JSON[_0x5177('0x4f')](_0x284df1)));});});};Dialer['prototype'][_0x5177('0x124')]=function(_0x1a0fa1){var _0x227c18=this;return function(){switch(_0x1a0fa1[_0x5177('0x61')]){case'progressive':freeVariablesPredictive(_0x1a0fa1);_0x227c18[_0x5177('0x125')](_0x1a0fa1,0x1);break;case'power':freeVariablesPredictive(_0x1a0fa1);_0x227c18[_0x5177('0x125')](_0x1a0fa1,_0x1a0fa1[_0x5177('0x126')]);break;case _0x5177('0xa'):_0x227c18['predictive'](_0x1a0fa1);break;case'booked':freeVariablesPredictive(_0x1a0fa1);_0x227c18[_0x5177('0x125')](_0x1a0fa1,0x1);break;default:freeVariablesPredictive(_0x1a0fa1);logger[_0x5177('0x8a')](_0x5177('0x127'),_0x1a0fa1['name'],_0x5177('0x128'));}};};Dialer[_0x5177('0x20')][_0x5177('0x129')]=function(_0x4762a5){var _0x3356ac=this;return function(){_0x3356ac['handleIvr'](_0x4762a5);};};Dialer['prototype'][_0x5177('0xc')]=function(_0x31730d){var _0x21d360=this;if(isNotPreview(_0x31730d['dialMethod'])){if(isVoiceQueueOutbound(_0x31730d['type'])&&isActive(_0x31730d['dialActive'])){_0x31730d[_0x5177('0x92')]=!![];BPromise['resolve']()[_0x5177('0xa5')](checkIsLoggedIn(_0x31730d,_0x31730d[_0x5177('0x58')]))[_0x5177('0xa5')](checkIsActive(_0x31730d,_0x31730d[_0x5177('0x60')]))[_0x5177('0xa5')](checkInterval(_0x31730d))[_0x5177('0xa5')](_0x21d360[_0x5177('0x10a')](_0x31730d))[_0x5177('0xa5')](_0x21d360[_0x5177('0x10e')](_0x31730d['dialGlobalInterval'],_0x31730d['dialTimezone'],_0x31730d[_0x5177('0x46')],_0x31730d))[_0x5177('0xa5')](_0x21d360['checkIfTimeIntervals'](_0x31730d[_0x5177('0x49')],_0x31730d['dialTimezone'],_0x31730d[_0x5177('0x46')],_0x31730d))[_0x5177('0xa5')](_0x21d360['checkDialMethod'](_0x31730d))[_0x5177('0x9e')](loggerCatchQueueSummary(_0x5177('0x12a'),_0x31730d));}else{notSendMessagesQueue(_0x31730d);}}else{freeVariablesPredictive(_0x31730d);}};Dialer[_0x5177('0x20')][_0x5177('0x109')]=function(){var _0x374444=this;var _0x2c4a62;for(var _0xd219fa in this[_0x5177('0x26')]){if(this[_0x5177('0x26')][_0x5177('0x8c')](_0xd219fa)){_0x2c4a62=this[_0x5177('0x26')][_0xd219fa];if(isCampaignIvr(_0x2c4a62['type'])&&isActive(_0x2c4a62[_0x5177('0x78')])){_0x2c4a62[_0x5177('0x92')]=!![];BPromise['resolve']()[_0x5177('0xa5')](checkIsActive(_0x2c4a62,_0x2c4a62[_0x5177('0x78')]))['then'](checkInterval(_0x2c4a62))['then'](_0x374444[_0x5177('0x10a')](_0x2c4a62))[_0x5177('0xa5')](_0x374444[_0x5177('0x10e')](_0x2c4a62[_0x5177('0x12b')],_0x2c4a62[_0x5177('0x12c')],_0x2c4a62[_0x5177('0x46')],_0x2c4a62))[_0x5177('0xa5')](_0x374444[_0x5177('0x110')](_0x2c4a62[_0x5177('0x49')],_0x2c4a62[_0x5177('0x12c')],_0x2c4a62[_0x5177('0x46')],_0x2c4a62))[_0x5177('0xa5')](_0x374444['launchHandleIvr'](_0x2c4a62))['catch'](loggerCatchQueueSummary(_0x5177('0x12d'),_0x2c4a62));}else{notSendMessagesCampaign(_0x2c4a62);}}}};function getCallerIdRandom(_0x547ed2,_0x66420f){var _0x5c5cb0,_0x4a43cb,_0x56f07e;if(_0x66420f<=0x0){_0x66420f=0x1;}_0x5c5cb0=new RegExp(_0x5177('0x12e')+_0x66420f+'}$');_0x4a43cb=Math[_0x5177('0x12f')](0xa,_0x66420f-0x1);_0x56f07e=Math[_0x5177('0x12f')](0xa,_0x66420f)-0x1;return util[_0x5177('0x79')]('%s',_[_0x5177('0x130')](_0x547ed2,_0x5c5cb0,_[_0x5177('0x131')](_0x4a43cb,_0x56f07e)));}function extractCalleridName(_0x564f02){var _0x3c900f=_0x564f02['match'](/"(.*?)"/);return _0x3c900f?_0x3c900f[0x1]:_0x564f02;}function extractCalleridNumber(_0x1c76d6){var _0x25a3ff=_0x1c76d6[_0x5177('0x132')](/<(.*?)>/);return _0x25a3ff?_0x25a3ff[0x1]:_0x1c76d6;}Dialer[_0x5177('0x20')][_0x5177('0x133')]=function(_0x5e6160,_0x2ca1ea){var _0x443253=this;var _0x1fdf3c=uuid['v4']();this[_0x5177('0x2b')][_0x1fdf3c]=new Action(_0x5e6160,_0x2ca1ea,_0x1fdf3c);return new BPromise(function(_0x5e6547,_0x527b92){if(_['isUndefined'](_0x5e6160)&&'object'!==typeof _0x5e6160){return _0x527b92(msgResponse(_0x5177('0x134'),_0x5177('0x111'),'voiceQueue\x20is\x20undefine'));}if(_[_0x5177('0x44')](_0x2ca1ea[_0x5177('0x135')][_0x5177('0x136')])||_0x2ca1ea['Contact'][_0x5177('0x136')]===null){return _0x527b92(msgResponse(_0x5177('0x134'),_0x5177('0x111'),_0x5177('0x137')));}var _0x341063={'XMD-CALLERID':_0x443253['actions'][_0x1fdf3c][_0x5177('0x138')](),'XMD-AGI':_0x5e6160[_0x5177('0xe1')]?util[_0x5177('0x79')](_0x5177('0x139'),ipAgi,_0x5e6160[_0x5177('0xe1')]):'NONE','XMD-AGIAFTER':_0x5e6160[_0x5177('0xe6')]?util['format'](_0x5177('0x139'),ipAgi,_0x5e6160[_0x5177('0xe6')]):_0x5177('0x13a'),'XMD-QUEUE':_0x5e6160[_0x5177('0x54')]===_0x5177('0x55')?util[_0x5177('0x79')](_0x5177('0x13b'),_0x5e6160[_0x5177('0x46')],_0x5e6160[_0x5177('0x13c')]||'',_0x5e6160[_0x5177('0xe7')]?'c':'',_0x5e6160['dialQueueTimeout']||0x3):_0x5177('0x13a'),'XMD-CONTACTID':_0x2ca1ea[_0x5177('0x101')],'XMD-CDRTYPE':_0x5177('0x8'),'CALLERID(all)':_0x443253['actions'][_0x1fdf3c][_0x5177('0x138')](),'XMD-AMD':_0x5e6160[_0x5177('0xcb')]?'ACTIVE':_0x5177('0x13a'),'XMD-DESTINATION':_0x5177('0xca')};if(_0x5e6160[_0x5177('0xcb')]){_0x341063[_0x5177('0x13d')]=_0x5e6160[_0x5177('0x13e')]||0x9c4;_0x341063['XMD-AMDGREETING']=_0x5e6160['dialAMDGreeting']||0x5dc;_0x341063[_0x5177('0x13f')]=_0x5e6160[_0x5177('0x140')]||0x320;_0x341063[_0x5177('0x141')]=_0x5e6160[_0x5177('0x142')]||0x1388;_0x341063[_0x5177('0x143')]=_0x5e6160[_0x5177('0x144')]||0x64;_0x341063[_0x5177('0x145')]=_0x5e6160[_0x5177('0x146')]||0x32;_0x341063[_0x5177('0x147')]=_0x5e6160[_0x5177('0x148')]||0x3;_0x341063['XMD-AMDSILENCETHRESHOLD']=_0x5e6160[_0x5177('0x149')]||0x100;_0x341063[_0x5177('0x14a')]=_0x5e6160[_0x5177('0x14b')]||0x1388;}if(_0x5e6160[_0x5177('0x54')]===_0x5177('0x55')){_0x341063[_0x5177('0x14c')]=_0x2ca1ea[_0x5177('0xbd')];}else{_0x341063[_0x5177('0x14d')]=_0x2ca1ea['CampaignId'];}for(var _0x1f3402 in _0x2ca1ea[_0x5177('0x135')]){if(_0x2ca1ea[_0x5177('0x135')][_0x5177('0x8c')](_0x1f3402)){if(isNotNull(_0x2ca1ea['Contact'][_0x1f3402])&&_0x1f3402!=='id'&&_0x1f3402!==_0x5177('0x14e')&&_0x1f3402!==_0x5177('0x14f')&&_0x1f3402!==_0x5177('0x150')){_0x341063[util[_0x5177('0x79')](_0x5177('0x151'),_0x5177('0x152'),_['toUpper'](_0x1f3402))]=_0x2ca1ea['Contact'][_0x1f3402];}}}var _0x1ae7c8=_0x443253[_0x5177('0xc3')](_0x5e6160[_0x5177('0x77')])?getCallerId(_0x5e6160[_0x5177('0x77')]['callerid'],_0x5e6160[_0x5177('0x62')],_0x5e6160[_0x5177('0x153')]>0x0?getCallerIdRandom(_0x5e6160[_0x5177('0x63')],_0x5e6160[_0x5177('0x153')]):_0x5e6160[_0x5177('0x63')]):getCallerId(_[_0x5177('0x9c')](_0x5e6160['TrunkBackup'])?_0x5e6160[_0x5177('0x77')][_0x5177('0x154')]:_0x5e6160[_0x5177('0x10b')][_0x5177('0x154')],_0x5e6160[_0x5177('0x62')],_0x5e6160[_0x5177('0x153')]>0x0?getCallerIdRandom(_0x5e6160[_0x5177('0x63')],_0x5e6160[_0x5177('0x153')]):_0x5e6160['dialOriginateCallerIdNumber']);if(_0x1ae7c8){_0x341063['XMD-ORIGINATECALLERIDNAME']=_0x443253['actions'][_0x1fdf3c][_0x5177('0x155')]=extractCalleridName(_0x1ae7c8);_0x341063[_0x5177('0x156')]=_0x443253[_0x5177('0x2b')][_0x1fdf3c][_0x5177('0x157')]=extractCalleridNumber(_0x1ae7c8);}return ami[_0x5177('0x116')]({'actionid':_0x1fdf3c,'action':_0x5177('0x134'),'channel':_0x443253[_0x5177('0xc3')](_0x5e6160[_0x5177('0x77')])?util[_0x5177('0x79')](_0x5177('0x158'),_0x5e6160['Trunk']['name'],isNotNull(_0x5e6160['dialPrefix'])?_0x5e6160[_0x5177('0x159')][_0x5177('0x15a')]()||'':'',_0x5e6160[_0x5177('0x15b')]>0x0?_0x2ca1ea[_0x5177('0x135')][_0x5177('0x136')]['substring'](_0x5e6160['dialCutDigit']):_0x2ca1ea['Contact'][_0x5177('0x136')]):util[_0x5177('0x79')](_0x5177('0x158'),_['isNil'](_0x5e6160[_0x5177('0x10b')])?_0x5e6160[_0x5177('0x77')]['name']:_0x5e6160[_0x5177('0x10b')][_0x5177('0x46')],isNotNull(_0x5e6160[_0x5177('0x159')])?_0x5e6160['dialPrefix'][_0x5177('0x15a')]()||'':'',_0x5e6160['dialCutDigit']>0x0?_0x2ca1ea[_0x5177('0x135')][_0x5177('0x136')][_0x5177('0x15c')](_0x5e6160['dialCutDigit']):_0x2ca1ea[_0x5177('0x135')][_0x5177('0x136')]),'callerid':_0x1ae7c8,'Exten':_0x5177('0xca'),'Context':_0x5177('0x15d'),'Priority':'1','variable':_0x341063,'timeout':(_0x5e6160['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1fdf3c})[_0x5177('0xa5')](function(_0x2f83b0){return _0x5e6547(_0x2f83b0);})[_0x5177('0x9e')](function(_0x353414){_0x5e6160[_0x5177('0x6a')]+=0x1;var _0x3b9a57=new History(_0x443253[_0x5177('0x2b')][_0x1fdf3c]);logger[_0x5177('0x8a')](util[_0x5177('0x79')](_0x5177('0x15e'),JSON['stringify'](_0x353414)));_0x3b9a57[_0x5177('0xcf')]=0xe;_0x3b9a57[_0x5177('0x97')]=_0x5177('0x15f');_0x3b9a57[_0x5177('0x98')]=moment()[_0x5177('0x79')](_0x5177('0xe8'));_0x3b9a57['endtime']=_0x3b9a57[_0x5177('0x98')];_0x443253[_0x5177('0xb3')](_0x3b9a57)['catch'](loggerCatch('[originate][error]'));_0x443253[_0x5177('0xb1')](_0x3b9a57)[_0x5177('0x9e')](loggerCatch(_0x5177('0x160')))['finally'](function(){delete _0x443253[_0x5177('0x2b')][_0x1fdf3c];return _0x527b92(msgResponse(_0x5177('0x134'),_0x5177('0x4e'),_0x5177('0x161')));});});});};Dialer[_0x5177('0x20')][_0x5177('0x39')]=function(_0x394617){var _0x3ab10f=this[_0x5177('0x2b')][_0x394617[_0x5177('0xfa')]];var _0x2625c9=this;if(_0x3ab10f){delete this['actions'][_0x394617[_0x5177('0xfa')]];_0x3ab10f['responsetime']=moment()['format'](_0x5177('0xe8'));var _0x7485f1=_0x3ab10f['type']===_0x5177('0x7a')?this['campaigns'][_0x3ab10f[_0x5177('0xa1')]]:this['voiceQueues'][_0x3ab10f['getQueue']()];if(!this[_0x5177('0xc1')](_0x394617[_0x5177('0x162')])){this[_0x5177('0xa0')](_0x7485f1);return this[_0x5177('0x163')](_0x3ab10f,_0x7485f1,_0x394617)[_0x5177('0xa5')](function(_0x2d2767){})[_0x5177('0x9e')](loggerCatch(_0x5177('0x164')));}else{this[_0x5177('0x2d')][_0x394617[_0x5177('0xcd')]]=_0x3ab10f;}}};Dialer['prototype'][_0x5177('0x165')]=function(_0x49200a,_0x1461f2,_0x14f8af){var _0x1ed488=new History(_0x1461f2);if(_0x1ed488['countbusyretry']+_0x1ed488[_0x5177('0x166')]+_0x1ed488[_0x5177('0x167')]>=_0x14f8af['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x49200a){case 0x3:if(_0x1ed488['countnoanswerretry']>=_0x14f8af[_0x5177('0x168')]-0x1){return!![];}else{this[_0x5177('0xac')]({'active':![],'countnoanswerretry':_0x1ed488[_0x5177('0x167')]+=0x1,'scheduledat':moment()[_0x5177('0x169')](_0x14f8af[_0x5177('0x16a')],_0x5177('0x16b'))['format'](_0x5177('0xe8')),'ContactId':_0x1ed488[_0x5177('0x101')],'ListId':_0x1ed488['ListId'],'VoiceQueueId':_0x1ed488['VoiceQueueId']||undefined,'CampaignId':_0x1ed488[_0x5177('0xbe')]||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x16c')));}break;case 0x5:if(_0x1ed488[_0x5177('0x16d')]>=_0x14f8af['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x5177('0xac')]({'active':![],'countbusyretry':_0x1ed488[_0x5177('0x16d')]+=0x1,'scheduledat':moment()[_0x5177('0x169')](_0x14f8af[_0x5177('0x16e')],_0x5177('0x16b'))[_0x5177('0x79')](_0x5177('0xe8')),'ContactId':_0x1ed488[_0x5177('0x101')],'ListId':_0x1ed488[_0x5177('0xbb')],'VoiceQueueId':_0x1ed488[_0x5177('0xbd')]||undefined,'CampaignId':_0x1ed488[_0x5177('0xbe')]||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x16f')));}break;case 0x8:if(_0x1ed488[_0x5177('0x166')]>=_0x14f8af[_0x5177('0x170')]-0x1){return!![];}else{this[_0x5177('0xac')]({'active':![],'countcongestionretry':_0x1ed488[_0x5177('0x166')]+=0x1,'scheduledat':moment()[_0x5177('0x169')](_0x14f8af['dialCongestionRetryFrequency'],_0x5177('0x16b'))[_0x5177('0x79')](_0x5177('0xe8')),'ContactId':_0x1ed488[_0x5177('0x101')],'ListId':_0x1ed488[_0x5177('0xbb')],'VoiceQueueId':_0x1ed488['VoiceQueueId']||undefined,'CampaignId':_0x1ed488['CampaignId']||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x171')));}break;default:return!![];}};Dialer[_0x5177('0x20')]['callProgressDetecting']=function(_0x4ad945,_0x1cd917,_0x47f096){var _0x45a65f=this;var _0x2bdde2=new History(_0x4ad945);return new BPromise(function(_0x1b5d2f,_0x14e9ea){if(_[_0x5177('0x44')](_0x1cd917)&&'object'!==typeof _0x1cd917){return _0x14e9ea(msgResponse('[callProgressDetecting]',_0x5177('0x111'),_0x5177('0x172')));}if(_[_0x5177('0x44')](_0x47f096)&&_0x5177('0x173')!==typeof _0x47f096){return _0x14e9ea(msgResponse(_0x5177('0x174'),'Failure',_0x5177('0x175')));}switch(_0x47f096[_0x5177('0xe4')]){case'0':_0x1cd917[_0x5177('0x69')]+=0x1;_0x2bdde2[_0x5177('0xcf')]=0x0;_0x2bdde2[_0x5177('0x97')]='NoSuchNumber';_0x45a65f[_0x5177('0xb3')](_0x2bdde2)[_0x5177('0x9e')](loggerCatch(_0x5177('0x176')));if(_0x45a65f[_0x5177('0x165')](0x0,_0x4ad945,_0x1cd917)){if(_0x2bdde2[_0x5177('0x16d')]+_0x2bdde2['countcongestionretry']+_0x2bdde2[_0x5177('0x167')]>=_0x1cd917[_0x5177('0x177')]){_0x45a65f[_0x5177('0x178')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,_0x5177('0x179'));}else{_0x45a65f['createStateFinal'](_0x2bdde2,_0x1b5d2f,_0x14e9ea,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x1cd917[_0x5177('0x17a')]+=0x1;_0x2bdde2['state']=0x3;_0x2bdde2['statedesc']=_0x5177('0x17b');_0x2bdde2['countnoanswerretry']+=0x1;_0x2bdde2[_0x5177('0x17c')]+=0x1;_0x45a65f['createHistory'](_0x2bdde2)[_0x5177('0x9e')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x45a65f['checkRetriveMax'](0x3,_0x4ad945,_0x1cd917)){if(_0x2bdde2[_0x5177('0x167')]>=_0x1cd917[_0x5177('0x168')]){_0x45a65f[_0x5177('0x17d')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,_0x5177('0x17e'));}else{_0x45a65f[_0x5177('0x178')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,_0x5177('0x17e'));}}break;case'5':_0x1cd917[_0x5177('0x66')]+=0x1;_0x2bdde2[_0x5177('0xcf')]=0x5;_0x2bdde2[_0x5177('0x97')]='Busy';_0x2bdde2[_0x5177('0x16d')]+=0x1;_0x2bdde2['countglobal']+=0x1;_0x45a65f[_0x5177('0xb3')](_0x2bdde2)[_0x5177('0x9e')](loggerCatch(_0x5177('0x17f')));if(_0x45a65f[_0x5177('0x165')](0x5,_0x4ad945,_0x1cd917)){if(_0x2bdde2[_0x5177('0x16d')]>=_0x1cd917[_0x5177('0x180')]){_0x45a65f[_0x5177('0x17d')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,_0x5177('0x181'));}else{_0x45a65f[_0x5177('0x178')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,'reason\x205\x20busy');}}break;case'8':_0x1cd917[_0x5177('0x67')]+=0x1;_0x2bdde2['state']=0x8;_0x2bdde2[_0x5177('0x97')]=_0x5177('0x182');_0x2bdde2[_0x5177('0x166')]+=0x1;_0x2bdde2[_0x5177('0x17c')]+=0x1;_0x45a65f['createHistory'](_0x2bdde2)[_0x5177('0x9e')](loggerCatch(_0x5177('0x183')));if(_0x45a65f[_0x5177('0x165')](0x8,_0x4ad945,_0x1cd917)){if(_0x2bdde2['countcongestionretry']>=_0x1cd917['dialCongestionMaxRetry']){_0x45a65f[_0x5177('0x17d')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,'reason\x208\x20congestion');}else{_0x45a65f[_0x5177('0x178')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,_0x5177('0x184'));}}break;default:_0x1cd917['outboundUnknownCallsDay']+=0x1;_0x2bdde2[_0x5177('0xcf')]=0xc;_0x2bdde2['statedesc']=_0x47f096['reason'];_0x45a65f[_0x5177('0xb3')](_0x2bdde2)[_0x5177('0x9e')](loggerCatch(_0x5177('0x185')));if(_0x45a65f[_0x5177('0x165')](_0x47f096[_0x5177('0xe4')],_0x4ad945,_0x1cd917)){if(_0x2bdde2['countbusyretry']+_0x2bdde2[_0x5177('0x166')]+_0x2bdde2[_0x5177('0x167')]>=_0x1cd917[_0x5177('0x177')]){_0x45a65f[_0x5177('0x178')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,_0x47f096['reason']);}else{_0x45a65f[_0x5177('0x17d')](_0x2bdde2,_0x1b5d2f,_0x14e9ea,_0x47f096[_0x5177('0xe4')]);}}}});};Dialer[_0x5177('0x20')][_0x5177('0x178')]=function(_0x233c41,_0xd54d60,_0x3de35a,_0x166a09){var _0x4ee260=new Final(_0x233c41);_0x4ee260[_0x5177('0xcf')]=0xf;_0x4ee260[_0x5177('0x97')]=_0x5177('0x186');this['createStateFinal'](_0x4ee260,_0xd54d60,_0x3de35a,_0x166a09);};Dialer[_0x5177('0x20')][_0x5177('0x17d')]=function(_0x9b39a6,_0x33d381,_0x43eb5f,_0x45a969){this[_0x5177('0xb1')](_0x9b39a6)['then'](function(_0x55175c){return _0x33d381(msgResponse('[callProgressDetecting]',_0x5177('0xc2'),_0x45a969));})[_0x5177('0x9e')](function(_0x4a79f2){return _0x43eb5f(msgResponse(_0x5177('0x187'),'Failure',_0x5177('0x188')));});};Dialer['prototype'][_0x5177('0xa')]=function(_0x3fba0b){var _0x443245=this;var _0x3e8ea6=_0x3fba0b[_0x5177('0x189')]/0x64;var _0x30c749=_0x3fba0b[_0x5177('0x18a')]/(_0x3fba0b[_0x5177('0x18a')]+_0x3fba0b[_0x5177('0xce')]);var _0x14d0ab=_0x3fba0b[_0x5177('0x58')]-_0x3fba0b['predictiveIntervalPauses']-_0x3fba0b[_0x5177('0x5e')]-_0x3fba0b[_0x5177('0x76')]-_0x3fba0b[_0x5177('0x5b')];var _0x4d3bd6=(_0x3fba0b[_0x5177('0x58')]-_0x3fba0b['predictiveIntervalPauses'])*_0x3fba0b['predictiveIntervalLowerLimit'];var _0x3f9c6e=Math[_0x5177('0x18b')](_0x3fba0b[_0x5177('0x18c')]*_0x3fba0b['erlangAbandonmentRate']*_0x3fba0b[_0x5177('0x72')]*_0x3fba0b[_0x5177('0x74')]);if(_['isUndefined'](_0x3fba0b[_0x5177('0x30')])){loggerPredictive['info']('[startMethodPredictive][StartProgressive][First]');if(!_[_0x5177('0x44')](_0x3fba0b[_0x5177('0x2f')])){_0x3fba0b[_0x5177('0x2f')]=undefined;loggerPredictive[_0x5177('0x8a')](_0x5177('0x18d'),_0x5177('0x18e'));}if(!_[_0x5177('0x44')](_0x3fba0b['handlePredictive'])){loggerPredictive[_0x5177('0x8a')](_0x5177('0x18d'),_0x5177('0x18f'));clearInterval(_0x3fba0b['handlePredictive']);_0x3fba0b[_0x5177('0x85')]=undefined;}_0x3fba0b[_0x5177('0x30')]=moment()['format'](_0x5177('0xe8'));loggerPredictive[_0x5177('0x7d')](_0x5177('0x190'),_0x3fba0b[_0x5177('0x30')],_0x3fba0b[_0x5177('0x46')]);this[_0x5177('0x125')](_0x3fba0b,0x1);}else if(ifInterval(_0x3fba0b[_0x5177('0x191')],_0x3fba0b[_0x5177('0x30')])){this[_0x5177('0x125')](_0x3fba0b,0x1);loggerPredictiveCalls[_0x5177('0x7d')](_0x5177('0x192'),_0x3fba0b[_0x5177('0x30')],_0x3fba0b[_0x5177('0x46')]);_0x3fba0b[_0x5177('0x18c')]=0x0;_0x3fba0b[_0x5177('0x71')]=0x0;}else if(_0x3e8ea6<_0x30c749&&_0x3fba0b[_0x5177('0x193')]===_0x5177('0x194')){freeVariablesPredictive(_0x3fba0b);loggerPredictive[_0x5177('0x7d')](_0x5177('0x195'),_0x5177('0x196'),_0x30c749,_0x5177('0x30'),_0x3fba0b[_0x5177('0x46')]);}else if(_0x14d0ab>_0x4d3bd6){freeVariablesPredictive(_0x3fba0b);loggerPredictive['info'](_0x5177('0x197'),_0x5177('0x198'),_0x14d0ab,_0x5177('0x199'),_0x4d3bd6);}else if(_0x3f9c6e<_0x3fba0b['predictiveIntervalErlangCallsDroppedCalls']&&_0x3fba0b[_0x5177('0x193')]===_0x5177('0x194')){freeVariablesPredictive(_0x3fba0b);loggerPredictive[_0x5177('0x7d')](_0x5177('0x19a'),_0x5177('0x19b'),_0x3f9c6e,_0x5177('0x19c'),_0x3fba0b[_0x5177('0x71')],'startProgressive',_0x3fba0b[_0x5177('0x46')]);}else if(!ifInterval(_0x3fba0b['dialPredictiveInterval'],_0x3fba0b['startProgressive'])&&_[_0x5177('0x44')](_0x3fba0b[_0x5177('0x2f')])&&!_[_0x5177('0x44')](_0x3fba0b[_0x5177('0x30')])){_0x3fba0b['startPredictive']=moment()[_0x5177('0x79')](_0x5177('0xe8'));loggerPredictive[_0x5177('0x7d')](_0x5177('0x19d'),_0x3fba0b[_0x5177('0x2f')],_0x3fba0b[_0x5177('0x46')]);this[_0x5177('0x19e')](_0x3fba0b['dialPredictiveInterval'])[_0x5177('0xa5')](this[_0x5177('0x19f')](_0x3fba0b))['then'](mergeDataErlangB(_0x3fba0b))['then'](this[_0x5177('0x1a0')](_0x3fba0b))[_0x5177('0x9e')](loggerCatchPredictive('[averageHandleTime][ErlangB]\x20',_0x3fba0b));}else if(!ifInterval(_0x3fba0b[_0x5177('0x191')],_0x3fba0b[_0x5177('0x2f')])){_0x3fba0b[_0x5177('0x71')]=0x0;_0x3fba0b['startPredictive']=moment()['format'](_0x5177('0xe8'));loggerPredictive[_0x5177('0x7d')](_0x5177('0x1a1'),_0x3fba0b[_0x5177('0x2f')],_0x3fba0b[_0x5177('0x46')]);clearInterval(_0x3fba0b[_0x5177('0x85')]);_0x3fba0b[_0x5177('0x85')]=undefined;this[_0x5177('0x19e')](_0x3fba0b[_0x5177('0x191')])[_0x5177('0xa5')](this[_0x5177('0x19f')](_0x3fba0b))[_0x5177('0xa5')](mergeDataErlangB(_0x3fba0b))[_0x5177('0xa5')](this['startMethodPredictive'](_0x3fba0b))[_0x5177('0x9e')](loggerCatchPredictive('[averageHandleTime][ErlangB]\x20',_0x3fba0b));}};Dialer[_0x5177('0x20')][_0x5177('0x19f')]=function(_0x2d7fd7){var _0x25a3a6=this;return function(_0x5c2d2f){return new BPromise(function(_0x2e89cf,_0x1a6813){_[_0x5177('0x83')](_0x2d7fd7,_0x5c2d2f[0x0]);if(checkGetDataPredictive(_0x5c2d2f[0x0])){loggerPredictive[_0x5177('0x7d')](JSON['stringify'](_0x5c2d2f[0x0]));if(_0x2d7fd7[_0x5177('0x193')]===_0x5177('0x194')){return _0x25a3a6['getVoiceQueueRtPauses'](_0x2d7fd7['id'])[_0x5177('0xa5')](function(_0x22c120){var _0x53bcba=_0x2d7fd7[_0x5177('0x58')]-_0x22c120[0x0][_0x5177('0x1a2')];var _0x241ba9=_0x2d7fd7['dialPredictiveInterval']*0x3c;var _0x2fe8e8=_0x5c2d2f[0x0][_0x5177('0x7c')]+_0x5c2d2f[0x0][_0x5177('0x6f')];var _0x1778eb=(_0x5c2d2f[0x0][_0x5177('0x6e')]+_0x5c2d2f[0x0][_0x5177('0x70')]+_0x5c2d2f[0x0][_0x5177('0x1a3')])/_0x5c2d2f[0x0][_0x5177('0x75')];var _0x22fa3a=_0x2d7fd7[_0x5177('0x189')]/0x64;_0x2d7fd7[_0x5177('0x1a4')]=_0x22c120[0x0]['outboundQueuePauses']||0x0;_0x2d7fd7[_0x5177('0x72')]=_0x1778eb>0x0?_0x1778eb:0x1;return _0x25a3a6[_0x5177('0x1a5')](_0x53bcba,_0x241ba9,_0x2fe8e8,_0x1778eb,_0x22fa3a);})[_0x5177('0xa5')](function(_0x59af30){return _0x2e89cf(_0x59af30);})[_0x5177('0x9e')](function(_0x2611af){return _0x1a6813(msgResponse(_0x5177('0x1a6'),_0x5177('0x111'),JSON[_0x5177('0x4f')](_0x2611af)));});}if(_0x2d7fd7[_0x5177('0x193')]==='agentBusyFactor'){return _0x25a3a6['getVoiceQueueRtPauses'](_0x2d7fd7['id'])[_0x5177('0xa5')](function(_0x215e5a){var _0x3dfbda=_0x2d7fd7[_0x5177('0x58')]-_0x215e5a[0x0][_0x5177('0x1a2')];var _0x28e430=_0x2d7fd7[_0x5177('0x191')]*0x3c;var _0x1c8131=_0x5c2d2f[0x0]['predictiveIntervalAvgTalktime']+_0x5c2d2f[0x0][_0x5177('0x6f')];var _0x3a65f6=(_0x5c2d2f[0x0][_0x5177('0x6e')]+_0x5c2d2f[0x0][_0x5177('0x70')]+_0x5c2d2f[0x0][_0x5177('0x1a3')])/_0x5c2d2f[0x0][_0x5177('0x75')];var _0x33b9b1=_0x2d7fd7[_0x5177('0x189')]/0x64;_0x2d7fd7['predictiveIntervalPauses']=_0x215e5a[0x0][_0x5177('0x1a2')]||0x0;_0x2d7fd7[_0x5177('0x72')]=_0x3a65f6>0x0?_0x3a65f6:0x1;return _0x25a3a6[_0x5177('0x1a7')](_0x3dfbda,_0x28e430,_0x1c8131,_0x3a65f6,_0x33b9b1);})[_0x5177('0xa5')](function(_0x1a37b1){return _0x2e89cf(_0x1a37b1);})[_0x5177('0x9e')](function(_0x47ee0e){return _0x1a6813(msgResponse(_0x5177('0x1a6'),_0x5177('0x111'),JSON[_0x5177('0x4f')](_0x47ee0e)));});}}else{return _0x1a6813(msgResponse(_0x5177('0x1a8'),_0x5177('0x111'),'check\x20failure'));}});};};Dialer[_0x5177('0x20')][_0x5177('0x1a0')]=function(_0x3d4e2b){var _0x58d89c=this;return function(){var _0x4c3865=0x0;var _0x69b226=Math['floor'](_0x3d4e2b['erlangCallToSecond']*0x3e8);if(_0x69b226>0x0){_0x69b226=_0x69b226<0x64?0x64:_0x69b226;loggerPredictive['info'](_0x5177('0x1a9'),_0x69b226);_0x3d4e2b[_0x5177('0x85')]=setInterval(function(){_0x58d89c[_0x5177('0x85')](_0x3d4e2b);loggerPredictiveCalls[_0x5177('0x7d')]('[handlePredictive]',_0x4c3865+=0x1);},_0x69b226);}else{loggerPredictive[_0x5177('0x7d')]('[startMethodPredictive][milliseconds]\x20',_0x5177('0x1aa'),_0x69b226);}};};Dialer['prototype'][_0x5177('0x1ab')]=function(_0x4204d0,_0x34a4d2){var _0x380eba=this;return function(_0x2a4cb5){if(_[_0x5177('0x87')](_0x2a4cb5)){if(_['isNil'](_0x34a4d2['UserId'])||!_0x34a4d2['recallme']){if(_0x4204d0[_0x5177('0x61')]===_0x5177('0x9')){_0x4204d0[_0x5177('0xfe')]=_[_0x5177('0x44')](_0x4204d0[_0x5177('0xfe')])?!![]:_0x4204d0['queueStatusComplete'];var _0x44bf05=uuid['v4']();_0x380eba['actions'][_0x44bf05]=new Action(_0x4204d0,_0x34a4d2,_0x44bf05);loggerBooked['info'](_0x5177('0x1ac'),_0x44bf05,_0x5177('0x1ad'),JSON['stringify'](_0x4204d0[_0x5177('0xfe')]),_0x5177('0x1ae'),_0x4204d0[_0x5177('0x46')]);if(_0x4204d0[_0x5177('0xfe')]){_0x4204d0[_0x5177('0xfe')]=![];_0x380eba['queueBooked'][_0x380eba['actions'][_0x44bf05][_0x5177('0xa1')]]=[];ami[_0x5177('0x116')]({'actionid':_0x44bf05,'action':_0x5177('0x1af'),'queue':_0x4204d0['name']})[_0x5177('0x9e')](function(_0x5a47e7){_0x380eba[_0x5177('0xa0')](_0x4204d0);_0x380eba[_0x5177('0xac')]({'active':![],'ContactId':_0x380eba[_0x5177('0x2b')][_0x44bf05]['ContactId'],'ListId':_0x380eba[_0x5177('0x2b')][_0x44bf05][_0x5177('0xbb')],'VoiceQueueId':_0x380eba['actions'][_0x44bf05]['VoiceQueueId']||undefined,'CampaignId':_0x380eba['actions'][_0x44bf05]['CampaignId']||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x1b0')));delete _0x380eba[_0x5177('0x2b')][_0x44bf05];});}else{loggerBooked[_0x5177('0x7d')](_0x5177('0x1b1'),JSON[_0x5177('0x4f')](_0x4204d0['queueStatusComplete']),_0x5177('0x1ae'),_0x4204d0[_0x5177('0x46')]);_0x380eba['updateOriginated'](_0x4204d0);_0x380eba[_0x5177('0xac')]({'active':![],'ContactId':_0x380eba[_0x5177('0x2b')][_0x44bf05][_0x5177('0x101')],'ListId':_0x380eba[_0x5177('0x2b')][_0x44bf05][_0x5177('0xbb')],'VoiceQueueId':_0x380eba['actions'][_0x44bf05][_0x5177('0xbd')]||undefined,'CampaignId':_0x380eba[_0x5177('0x2b')][_0x44bf05][_0x5177('0xbe')]||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x1b0')));delete _0x380eba['actions'][_0x44bf05];}}else{return _0x380eba[_0x5177('0x133')](_0x4204d0,_0x34a4d2);}}else{if(getDiff(_0x34a4d2['scheduledat'])<_0x4204d0[_0x5177('0x1b2')]*0x3c){_0x380eba['preview']['run'](_0x34a4d2['id'])['finally'](function(){_0x380eba[_0x5177('0xa0')](_0x4204d0);});}else{_0x4204d0[_0x5177('0x6b')]+=0x1;_0x380eba[_0x5177('0xa0')](_0x4204d0);if(_0x4204d0[_0x5177('0x1b3')]){_0x380eba[_0x5177('0xac')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x34a4d2['ContactId'],'ListId':_0x34a4d2['ListId'],'VoiceQueueId':_0x34a4d2['VoiceQueueId']||undefined,'CampaignId':_0x34a4d2['CampaignId']||undefined})[_0x5177('0x9e')](loggerCatch(_0x5177('0x1b4')));_0x380eba['createHistory'](createObjHistory(_0x4204d0,_0x34a4d2,'RECALLINQUEUE',0x17,_0x5177('0x1b5')))[_0x5177('0x9e')](loggerCatch(_0x5177('0x1b6')));}else{_0x380eba[_0x5177('0xd2')](createObjHistory(_0x4204d0,_0x34a4d2,'RECALLFAILEDTIMEOUT',0x16,_0x5177('0x1b7')),_0x5177('0x1b8'),_0x5177('0x1b9'));}}}}else{_0x4204d0[_0x5177('0x1ba')]+=0x1;_0x380eba[_0x5177('0xd2')](createObjHistory(_0x4204d0,_0x34a4d2,'BLACKLIST',0xd,_0x5177('0x1bb')),'[Originate][historyBlacklist]',_0x5177('0x1bc'));throw _0x5177('0x1bd');}};};Dialer[_0x5177('0x20')][_0x5177('0x1be')]=function(_0x14484c){var _0x53427e=this;var _0x2bae5a=[];var _0x4ffd40=_0x14484c['limitCalls']-_0x14484c[_0x5177('0x76')]-_0x14484c[_0x5177('0x1bf')];emitCampaignSummary(_0x14484c);if(_0x4ffd40>0x0){if(_0x4ffd40>this[_0x5177('0x29')]){_0x4ffd40=this['maxNumberOriginate'];}_0x14484c[_0x5177('0x1bf')]+=_0x4ffd40;this[_0x5177('0xae')](_0x14484c['id'],_0x4ffd40,_0x14484c[_0x5177('0x1c0')])[_0x5177('0xa5')](function(_0x501ce6){_0x14484c[_0x5177('0x1bf')]-=_0x4ffd40;_0x14484c[_0x5177('0x1bf')]=_0x14484c[_0x5177('0x1bf')]>0x0?_0x14484c[_0x5177('0x1bf')]:0x0;if(!checkContactEmpty(_0x501ce6)){_0x14484c[_0x5177('0x45')]=_0x5177('0x90');logger[_0x5177('0x7d')]('[getContactCampaign2][Empty]'+_0x14484c[_0x5177('0x46')]);}else{_0x14484c[_0x5177('0x76')]+=_0x501ce6[_0x5177('0x8b')];_0x14484c['message']=_0x5177('0x1c1');for(var _0x2790e5=0x0;_0x2790e5<_0x501ce6[_0x5177('0x8b')];_0x2790e5+=0x1){_0x14484c[_0x5177('0x1c2')]+=0x1;if(_[_0x5177('0x9c')](_0x501ce6[_0x2790e5])||_[_0x5177('0x9c')](_0x501ce6[_0x2790e5]['Contact'])||_[_0x5177('0x9c')](_0x501ce6[_0x2790e5][_0x5177('0x135')]['phone'])){_0x53427e[_0x5177('0xb8')](_0x5177('0x1c3'),_0x14484c,_0x501ce6[_0x2790e5]);}else{_0x53427e[_0x5177('0xa8')](_[_0x5177('0xba')](_0x501ce6[_0x2790e5],['CampaignId',_0x5177('0x1c4')]))['then'](_0x53427e[_0x5177('0x1ab')](_0x14484c,_0x501ce6[_0x2790e5]))[_0x5177('0x9e')](_0x53427e[_0x5177('0xb7')](_0x5177('0x1c5'),_0x14484c));}}}})['catch'](loggerGetContactDialer(_0x5177('0x1c6'),_0x14484c,_0x4ffd40));}};Dialer['prototype'][_0x5177('0x125')]=function(_0xddf342,_0x3f22c7){var _0x42ee36=this;var _0x5bfe71=[];var _0x32df88=_0x3f22c7>=0x1?_0x3f22c7:0x1;var _0x563587=[];if(_0xddf342[_0x5177('0x61')]==='booked'){_0x32df88=0x1;}var _0x1d3ef5=Math[_0x5177('0x18b')](_0xddf342[_0x5177('0x57')]*_0x32df88)-_0xddf342[_0x5177('0x76')]-_0xddf342['temp'];emitVoiceQueueSummary(_0xddf342);if(_0xddf342[_0x5177('0x1c7')]>0x0){var _0x438ace=_0xddf342[_0x5177('0x1c7')]-_0xddf342[_0x5177('0x76')]-_0xddf342[_0x5177('0x5b')]-_0xddf342[_0x5177('0x1bf')]-_0xddf342['pTalking'];if(_0x1d3ef5>_0x438ace){_0x1d3ef5=_0x438ace;}}if(_0x1d3ef5>0x0){if(_0xddf342[_0x5177('0x61')]===_0x5177('0x9')){_0x1d3ef5=0x1;}if(_0x1d3ef5>this[_0x5177('0x29')]){_0x1d3ef5=this[_0x5177('0x29')];}_0xddf342[_0x5177('0x1bf')]+=_0x1d3ef5;for(var _0x32cbad in this['agents']){if(this[_0x5177('0x27')][_0x5177('0x8c')](_0x32cbad)){if(this['agents'][_0x32cbad][_0x5177('0xcf')]===_0x5177('0x1c8')&&this[_0x5177('0x27')][_0x32cbad][_0x5177('0x9d')]===_0x5177('0xc4')){_0x5bfe71[_0x5177('0x115')](this[_0x5177('0x27')][_0x32cbad]['id']);}}}this[_0x5177('0x1c9')](_0xddf342['id'],_0x5bfe71,_0x1d3ef5,_0xddf342['dialOrderByScheduledAt'])[_0x5177('0xa5')](function(_0x2a8e62){_0xddf342['temp']-=_0x1d3ef5;_0xddf342[_0x5177('0x1bf')]=_0xddf342['temp']>0x0?_0xddf342[_0x5177('0x1bf')]:0x0;if(!checkContactEmpty(_0x2a8e62)){_0x42ee36['countReScheduled'](_0xddf342)[_0x5177('0xa5')](sendMessageReschedule(_0xddf342))[_0x5177('0x9e')](loggerCatch(_0x5177('0xa6')));}else{_0xddf342[_0x5177('0x76')]+=_0x2a8e62['length'];_0xddf342[_0x5177('0x45')]=_0xddf342['dialMethod']===_0x5177('0x9')?_0x5177('0x1ca'):_0x5177('0x1c1');for(var _0x215715=0x0;_0x215715<_0x2a8e62[_0x5177('0x8b')];_0x215715+=0x1){if(_[_0x5177('0x9c')](_0x2a8e62[_0x215715])||_[_0x5177('0x9c')](_0x2a8e62[_0x215715][_0x5177('0x135')])||_['isNil'](_0x2a8e62[_0x215715][_0x5177('0x135')]['phone'])){_0x42ee36[_0x5177('0xb8')](_0x5177('0x1c3'),_0xddf342,_0x2a8e62[_0x215715]);}else{_0x42ee36[_0x5177('0x1cb')](_[_0x5177('0xba')](_0x2a8e62[_0x215715],['VoiceQueueId',_0x5177('0x1c4')]))[_0x5177('0xa5')](_0x42ee36['checkContactBlack'](_0xddf342,_0x2a8e62[_0x215715]))[_0x5177('0x9e')](_0x42ee36[_0x5177('0xb7')]('[actionOriginate]\x20',_0xddf342));}}}})['catch'](loggerGetContactDialer(_0x5177('0x1cc'),_0xddf342,_0x1d3ef5));}};Dialer[_0x5177('0x20')][_0x5177('0x85')]=function(_0x5d095c){var _0x1c5c7b=this;if(_0x5d095c[_0x5177('0x1c7')]>0x0){var _0xdd0bf3=_0x5d095c[_0x5177('0x1c7')]-_0x5d095c[_0x5177('0x76')]-_0x5d095c[_0x5177('0x5b')];if(_0xdd0bf3>0x0){this[_0x5177('0x1cd')](_0x5d095c);}else{loggerPredictiveCalls[_0x5177('0x7d')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x5d095c);}};Dialer['prototype'][_0x5177('0x1cd')]=function(_0x28e093){var _0x3a3009=this;var _0x34011d=[];_0x28e093['originated']+=0x1;for(var _0x5a996d in this[_0x5177('0x27')]){if(this[_0x5177('0x27')][_0x5177('0x8c')](_0x5a996d)){if(this[_0x5177('0x27')][_0x5a996d][_0x5177('0xcf')]===_0x5177('0x1c8')&&this[_0x5177('0x27')][_0x5a996d]['status']===_0x5177('0xc4')){_0x34011d['push'](this['agents'][_0x5a996d]['id']);}}}this[_0x5177('0x1c9')](_0x28e093['id'],_0x34011d,0x1,_0x28e093[_0x5177('0x1c0')])[_0x5177('0xa5')](function(_0x64e073){if(!checkContactEmpty(_0x64e073)){checkContactLowerLimitOriginate(_0x28e093,0x1,0x0);_0x3a3009['countReScheduled'](_0x28e093)[_0x5177('0xa5')](sendMessageReschedule(_0x28e093))[_0x5177('0x9e')](loggerCatch(_0x5177('0xa6')));}else{_0x28e093[_0x5177('0x45')]=_0x5177('0x1c1');if(_[_0x5177('0x9c')](_0x64e073[0x0])||_[_0x5177('0x9c')](_0x64e073[0x0]['Contact'])||_[_0x5177('0x9c')](_0x64e073[0x0]['Contact'][_0x5177('0x136')])){_0x3a3009[_0x5177('0xb8')](_0x5177('0x1c3'),_0x28e093,_0x64e073[0x0]);}else{_0x3a3009['checkIsBlackList'](_[_0x5177('0xba')](_0x64e073[0x0],['VoiceQueueId',_0x5177('0x1c4')]))[_0x5177('0xa5')](_0x3a3009[_0x5177('0x1ab')](_0x28e093,_0x64e073[0x0]))[_0x5177('0x9e')](_0x3a3009['loggerHandler'](_0x5177('0x1ce'),_0x28e093));}}})[_0x5177('0x9e')](loggerGetContactDialer(_0x5177('0x1cf'),_0x28e093,0x1));emitVoiceQueueSummary(_0x28e093);};Dialer[_0x5177('0x20')][_0x5177('0x1a5')]=function(_0x8a767c,_0x1bf095,_0x4ec3ba,_0x3cdbd4,_0x5ec009,_0x40a59a){loggerPredictive[_0x5177('0x7d')](_0x5177('0x1d0'),_0x5177('0x1d1'),_0x8a767c,_0x5177('0x1d2'),_0x1bf095,_0x5177('0x1d3'),_0x4ec3ba,_0x5177('0x1d4'),_0x3cdbd4,'\x20Amax\x20=\x20',_0x5ec009);return new BPromise(function(_0x365deb,_0x289343){if(_0x8a767c<=0x0||isNaN(_0x8a767c)){return _0x289343(msgResponse(_0x5177('0x1d0'),_0x5177('0x4e'),_0x5177('0x1d5')+_0x8a767c));}if(_0x4ec3ba<=0x0||isNaN(_0x4ec3ba)){return _0x289343(msgResponse(_0x5177('0x1d0'),_0x5177('0x4e'),_0x5177('0x1d6')+_0x4ec3ba));}if(_0x3cdbd4<=0x0||isNaN(_0x3cdbd4)){return _0x289343(msgResponse(_0x5177('0x1d0'),_0x5177('0x4e'),_0x5177('0x1d7')+_0x3cdbd4));}if(_0x1bf095<=0x0||isNaN(_0x1bf095)){return _0x289343(msgResponse(_0x5177('0x1d0'),'Error',_0x5177('0x1d8')+_0x1bf095));}if(_0x5ec009<=0x0||isNaN(_0x5ec009)){return _0x289343(msgResponse(_0x5177('0x1d0'),_0x5177('0x4e'),'Amax\x20=\x20'+_0x5ec009));}_0x40a59a=_0x40a59a||0x0;var _0x3bffd2=0x1/_0x4ec3ba;var _0x479f9a=0x0;var _0x269d3f=0x0;var _0x3cb380=0x0;var _0x123679=0x0;for(var _0x492a2b=0x0;_0x3cb380<_0x5ec009;_0x492a2b+=0x1){_0x269d3f=_0x492a2b/_0x1bf095;_0x479f9a=(_0x3cdbd4*_0x269d3f+_0x40a59a)/_0x3bffd2;_0x3cb380=erlangb(_0x479f9a,_0x8a767c);_0x123679=_0x479f9a/_0x8a767c*(0x1-erlangb(_0x479f9a,_0x8a767c));}return _0x365deb({'erlangCalls':_0x492a2b,'erlangCallToSecond':_0x1bf095/_0x492a2b,'erlangAbandonmentRate':_0x3cb380,'erlangBusyFactor':_0x123679});});};Dialer['prototype'][_0x5177('0x1a7')]=function(_0x5daf7f,_0x45887a,_0x1d3647,_0x51165f,_0x2b9772,_0x403066){loggerPredictive[_0x5177('0x7d')](_0x5177('0x1d9'),_0x5177('0x1d1'),_0x5daf7f,'\x20interval\x20=\x20',_0x45887a,'\x20Ts\x20=\x20',_0x1d3647,_0x5177('0x1d4'),_0x51165f,_0x5177('0x1da'),_0x2b9772);return new BPromise(function(_0x444472,_0x3074ff){if(_0x5daf7f<=0x0||isNaN(_0x5daf7f)){return _0x3074ff(msgResponse('[abandonmentRate]',_0x5177('0x4e'),_0x5177('0x1d5')+_0x5daf7f));}if(_0x1d3647<=0x0||isNaN(_0x1d3647)){return _0x3074ff(msgResponse(_0x5177('0x1d0'),_0x5177('0x4e'),_0x5177('0x1d6')+_0x1d3647));}if(_0x51165f<=0x0||isNaN(_0x51165f)){return _0x3074ff(msgResponse('[abandonmentRate]',_0x5177('0x4e'),_0x5177('0x1d7')+_0x51165f));}if(_0x45887a<=0x0||isNaN(_0x45887a)){return _0x3074ff(msgResponse('[abandonmentRate]',_0x5177('0x4e'),_0x5177('0x1d8')+_0x45887a));}if(_0x2b9772<=0x0||isNaN(_0x2b9772)){return _0x3074ff(msgResponse('[abandonmentRate]',_0x5177('0x4e'),'Amax\x20=\x20'+_0x2b9772));}_0x403066=_0x403066||0x0;var _0x2a2074=0x1/_0x1d3647;var _0x4edb4c=0x0;var _0x39f1ad=0x0;var _0x1bf4bb=0x0;var _0x296b91=0x0;for(var _0x5eef2c=0x0;_0x296b91<_0x2b9772;_0x5eef2c+=0x1){_0x39f1ad=_0x5eef2c/_0x45887a;_0x4edb4c=(_0x51165f*_0x39f1ad+_0x403066)/_0x2a2074;_0x1bf4bb=erlangb(_0x4edb4c,_0x5daf7f);_0x296b91=_0x4edb4c/_0x5daf7f*(0x1-erlangb(_0x4edb4c,_0x5daf7f));}return _0x444472({'erlangCalls':_0x5eef2c,'erlangCallToSecond':_0x45887a/_0x5eef2c,'erlangAbandonmentRate':_0x1bf4bb,'erlangBusyFactor':_0x296b91});});};module[_0x5177('0x1db')]=Dialer;
\ No newline at end of file
+var _0xef0f=['[freeVariablesPredictive]','startProgressive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','[uniqueid]','clearZombieChannels','[actions]','prototype','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','saveInDb','uniqueid','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','amd','[syncMachine][createHistory]','dialAMDActive','[syncHangupInAMDIvr][createHistory]','MACHINE','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','syncAgentConnect','answertime','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialQueueProject2','queueCallerAbandonCreateState','Abandoned','dropreason','CALLEREXIT','channel','actionid','strategy','locked','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','paused','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','isArray','iftime\x20%s,%s','interval','timezones','content','indexOf','true','command','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','checkRetriveMax','countbusyretry','dialGlobalMaxRetry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','countcongestionretry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','floor','erlangCalls','[startMethodPredictive][StartProgressive][First]','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Date]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','[startMethodPredictive][StartPredictive][First]','getDataPredictive','startMethodPredictive','[averageHandleTime][ErlangB]\x20','[startMethodPredictive][StartPredictive][Repeat]','outboundQueuePauses','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalPauses','abandonmentRate','busyFactor','[CatchErlangB]','[getDataPredictive]','check\x20failure','[startMethodPredictive]','[handlePredictive]','[startMethodPredictive][milliseconds]\x20','Failure\x20','recallme','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','reachable','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','[abandonmentRate]','\x20m\x20=\x20','\x20interval\x20=\x20','\x20Ts\x20=\x20','\x20p\x20=\x20','\x20Amax\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','\x20Umin\x20=\x20','m\x20=\x20','exports','util','bluebird','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','ivrOriginated','queueBooked','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','Intervals','message','isEmpty','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','outbound','answered','available','loggedIn','sumBillable','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','Trunk','active','callerid','md5','voice_queue:save','type','ivr','format','campaign:ivr:%s','campaign:save','info','[checkGetDataPredictive][avgTalktime]','[checkGetDataPredictive][avgHoldtime]','[checkGetDataPredictive][totalCalls]','[checkGetDataPredictive][obj]','[ErlangB]','merge','seconds'];(function(_0x1d58d7,_0xb363fe){var _0x1aa20f=function(_0x37beb7){while(--_0x37beb7){_0x1d58d7['push'](_0x1d58d7['shift']());}};_0x1aa20f(++_0xb363fe);}(_0xef0f,0x168));var _0xfef0=function(_0x13d038,_0x37a269){_0x13d038=_0x13d038-0x0;var _0x4c9910=_0xef0f[_0x13d038];return _0x4c9910;};'use strict';var util=require(_0xfef0('0x0'));var _=require('lodash');var BPromise=require(_0xfef0('0x1'));var uuid=require(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xfef0('0x4'));var config=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('dialer');var loggerBooked=require(_0xfef0('0x6'))(_0xfef0('0x7'));var loggerPredictive=require(_0xfef0('0x6'))(_0xfef0('0x8'));var loggerPredictiveCalls=require(_0xfef0('0x6'))(_0xfef0('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xfef0('0xa'));var ami=require('../ami');config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config[_0xfef0('0xb')],{'host':_0xfef0('0xd'),'port':0x18eb});var io=require(_0xfef0('0xe'))(new Redis(config[_0xfef0('0xb')]));var cmHopper=require(_0xfef0('0xf'));var cmHopperFinal=require(_0xfef0('0x10'));var cmHopperHistory=require(_0xfef0('0x11'));var cmHopperBlack=require(_0xfef0('0x12'));var voiceQueueRt=require(_0xfef0('0x13'));var Action=require(_0xfef0('0x14'));var History=require(_0xfef0('0x15'));var Final=require(_0xfef0('0x16'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xfef0('0x17'));var Hangup=require(_0xfef0('0x18'));var ipAgi=process[_0xfef0('0x19')][_0xfef0('0x1a')]||_0xfef0('0x1b');var strategy={'rrmemory':_0xfef0('0x1c'),'roundrobin':_0xfef0('0x1d')};var Sequence=function(){};Sequence['prototype'][_0xfef0('0x1e')]=function(_0x554aaa){this['tail']=this['tail']?this[_0xfef0('0x1f')][_0xfef0('0x20')](_0x554aaa):_0x554aaa();};function Dialer(_0x3510a7,_0x1bce2f){this[_0xfef0('0x21')]=new Sequence();this[_0xfef0('0x22')]=_0x1bce2f;this[_0xfef0('0x23')]=_0x3510a7[_0xfef0('0x23')];this['campaigns']=_0x3510a7[_0xfef0('0x24')];this[_0xfef0('0x25')]=_0x3510a7[_0xfef0('0x25')];this[_0xfef0('0x26')]=_0x3510a7[_0xfef0('0x26')];this['maxNumberOriginate']=config[_0xfef0('0x27')]||0x2;this['channels']={};this[_0xfef0('0x28')]={};this[_0xfef0('0x29')]={};this[_0xfef0('0x2a')]={};this['optionPredictive']={};this[_0xfef0('0x2b')]={};this['startProgressive']={};this[_0xfef0('0x2c')]={};this[_0xfef0('0x2d')]={};this['queueBookedRR']={};ami['on']('agentconnect',this['syncAgentConnect'][_0xfef0('0x2e')](this));ami['on']('queuecallerabandon',this[_0xfef0('0x2f')][_0xfef0('0x2e')](this));ami['on'](_0xfef0('0x30'),this[_0xfef0('0x31')][_0xfef0('0x2e')](this));ami['on'](_0xfef0('0x32'),this['syncAgentComplete']['bind'](this));ami['on'](_0xfef0('0x33'),this[_0xfef0('0xa')][_0xfef0('0x2e')](this));ami['on'](_0xfef0('0x34'),this[_0xfef0('0x35')][_0xfef0('0x2e')](this));ami['on'](_0xfef0('0x36'),this[_0xfef0('0x37')][_0xfef0('0x2e')](this));ami['on']('varset',this[_0xfef0('0x38')][_0xfef0('0x2e')](this));ami['on'](_0xfef0('0x39'),this[_0xfef0('0x3a')][_0xfef0('0x2e')](this));ami['on'](_0xfef0('0x3b'),this[_0xfef0('0x3c')][_0xfef0('0x2e')](this));this[_0xfef0('0x3d')]();this[_0xfef0('0x3e')]();}function isNotNull(_0x3ee42f){return _0x3ee42f!==null&&!_[_0xfef0('0x3f')](_0x3ee42f);}function checkIsLoggedIn(_0x51af0f,_0x445625){return function(){if(_0x445625<=0x0){_0x51af0f['message']='AGENTS_NOT_LOGGED';throw _0x51af0f[_0xfef0('0x40')]+_0xfef0('0x41');}};}function isActive(_0x4a481d){return _0x4a481d;}function checkIsActive(_0x4bbdba,_0x5cf518){return function(){if(!isActive(_0x5cf518)){_0x4bbdba['message']='NOT_ACTIVE';throw _0x4bbdba[_0xfef0('0x40')]+_0xfef0('0x42');}};}function checkInterval(_0x2fffae){return function(){if(!isNotNull(_0x2fffae['Interval'])){_0x2fffae['message']='INTERVAL_IS_NULL';throw _0x2fffae[_0xfef0('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x2fffae[_0xfef0('0x43')][_0xfef0('0x44')])){_0x2fffae[_0xfef0('0x45')]='INTERVAL_IS_NULL';throw _0x2fffae[_0xfef0('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xfef0('0x46')](_0x2fffae[_0xfef0('0x43')][_0xfef0('0x44')]))){_0x2fffae[_0xfef0('0x45')]=_0xfef0('0x47');throw _0x2fffae[_0xfef0('0x40')]+_0xfef0('0x48');}};}function msgResponse(_0x2d97f8,_0x590e37,_0x24ea7c){return{'action':_0x2d97f8,'response':_0x590e37,'message':_0x24ea7c};}function myreject(_0xea09ec){return function(_0x388518){return _0xea09ec(msgResponse(_0xfef0('0x49'),_0xfef0('0x4a'),JSON[_0xfef0('0x4b')](_0x388518)));};}function getSeconds(_0x43b54d,_0xeb75e2){var _0x459d4a=moment(_0x43b54d)[_0xfef0('0x4c')](0x0);var _0x3b668b=moment(_0xeb75e2)[_0xfef0('0x4c')](0x0);return _0x459d4a[_0xfef0('0x4d')](_0x3b668b,'seconds');}function emit(_0x1f4a1e,_0x4a42a3,_0x28e5c1){io['to'](_0x1f4a1e)[_0xfef0('0x4e')](_0x4a42a3,_0x28e5c1);}function emitVoiceQueueSummary(_0x1ddce6){if(_0x1ddce6['type']===_0xfef0('0x4f')){var _0x29469e={'id':_0x1ddce6['id'],'name':_0x1ddce6[_0xfef0('0x40')],'strategy':_0x1ddce6['strategy'],'answered':_0x1ddce6[_0xfef0('0x50')],'available':_0x1ddce6[_0xfef0('0x51')],'loggedIn':_0x1ddce6[_0xfef0('0x52')],'pTalking':_0x1ddce6['pTalking'],'sumBillable':_0x1ddce6[_0xfef0('0x53')],'sumDuration':_0x1ddce6['sumDuration'],'sumHoldTime':_0x1ddce6['sumHoldTime']||0x0,'talking':_0x1ddce6[_0xfef0('0x54')],'total':_0x1ddce6['total'],'type':_0x1ddce6['type'],'unmanaged':_0x1ddce6[_0xfef0('0x55')],'abandoned':_0x1ddce6[_0xfef0('0x56')],'waiting':_0x1ddce6[_0xfef0('0x57')],'loggedInDb':_0x1ddce6[_0xfef0('0x58')],'dialActive':_0x1ddce6[_0xfef0('0x59')],'dialMethod':_0x1ddce6[_0xfef0('0x5a')],'dialOriginateCallerIdName':_0x1ddce6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1ddce6[_0xfef0('0x5b')],'dialOriginateTimeout':_0x1ddce6[_0xfef0('0x5c')],'dialPrefix':_0x1ddce6['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1ddce6['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1ddce6[_0xfef0('0x5d')],'outboundBlacklistCallsDay':_0x1ddce6['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1ddce6[_0xfef0('0x5e')],'outboundCongestionCallsDay':_0x1ddce6[_0xfef0('0x5f')],'outboundDropCallsDayACS':_0x1ddce6[_0xfef0('0x60')],'outboundDropCallsDayCallersExit':_0x1ddce6[_0xfef0('0x61')],'outboundDropCallsDayTimeout':_0x1ddce6[_0xfef0('0x62')],'outboundNoAnswerCallsDay':_0x1ddce6[_0xfef0('0x63')],'outboundNoSuchCallsDay':_0x1ddce6[_0xfef0('0x64')],'outboundOriginateFailureCallsDay':_0x1ddce6[_0xfef0('0x65')],'outboundReCallsDay':_0x1ddce6['outboundReCallsDay'],'outboundRejectCallsDay':_0x1ddce6[_0xfef0('0x66')],'outboundUnknownCallsDay':_0x1ddce6['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1ddce6['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1ddce6[_0xfef0('0x67')],'predictiveIntervalAvgTalktime':_0x1ddce6[_0xfef0('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x1ddce6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1ddce6[_0xfef0('0x69')],'predictiveIntervalErlangCalls':_0x1ddce6['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1ddce6[_0xfef0('0x6a')],'predictiveIntervalHitRate':_0x1ddce6[_0xfef0('0x6b')],'predictiveIntervalLowerLimit':_0x1ddce6[_0xfef0('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x1ddce6[_0xfef0('0x6d')],'predictiveIntervalPauses':_0x1ddce6['predictiveIntervalPauses'],'predictiveIntervalTotalCalls':_0x1ddce6[_0xfef0('0x6e')],'message':_0x1ddce6[_0xfef0('0x45')],'originated':_0x1ddce6['originated']};if(_0x1ddce6['Trunk']){_0x29469e[_0xfef0('0x6f')]={'id':_0x1ddce6['Trunk']['id'],'name':_0x1ddce6[_0xfef0('0x6f')][_0xfef0('0x40')],'active':_0x1ddce6[_0xfef0('0x6f')][_0xfef0('0x70')],'callerid':_0x1ddce6[_0xfef0('0x6f')][_0xfef0('0x71')]};}if(_0x1ddce6['Interval']){_0x29469e[_0xfef0('0x43')]={'id':_0x1ddce6['Interval']['id'],'name':_0x1ddce6['Interval'][_0xfef0('0x40')]};}var _0x25da1b=md5(JSON[_0xfef0('0x4b')](_0x29469e));if(_0x1ddce6['md5']!==_0x25da1b){_0x1ddce6[_0xfef0('0x72')]=_0x25da1b;emit(util['format']('voice:queue:%s',_0x29469e['name']),_0xfef0('0x73'),_0x29469e);}}}function emitCampaignSummary(_0x3d471c){if(_0x3d471c[_0xfef0('0x74')]===_0xfef0('0x75')){emit(util[_0xfef0('0x76')](_0xfef0('0x77'),_0x3d471c[_0xfef0('0x40')]),_0xfef0('0x78'),_0x3d471c);}}function checkGetDataPredictive(_0x24c05d){if(isNotNull(_0x24c05d)){if(!_['isEmpty'](_0x24c05d)){if(_0x24c05d['predictiveIntervalTotalCalls']>0x0){if(!_[_0xfef0('0x3f')](_0x24c05d[_0xfef0('0x68')])&&_0x24c05d[_0xfef0('0x68')]>0x0){return!![];}else{loggerPredictive[_0xfef0('0x79')](_0xfef0('0x7a'),JSON[_0xfef0('0x4b')](_0x24c05d));}if(!_[_0xfef0('0x3f')](_0x24c05d[_0xfef0('0x67')])&&_0x24c05d['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0xfef0('0x79')](_0xfef0('0x7b'),JSON[_0xfef0('0x4b')](_0x24c05d));}}else{loggerPredictive[_0xfef0('0x79')](_0xfef0('0x7c'),JSON['stringify'](_0x24c05d));}}else{loggerPredictive['info']('[checkGetDataPredictive][objIsEmpty]',JSON[_0xfef0('0x4b')](_0x24c05d));}}else{loggerPredictive[_0xfef0('0x79')](_0xfef0('0x7d'),JSON[_0xfef0('0x4b')](_0x24c05d));}return![];}function mergeDataErlangB(_0x4e959e){return function(_0x18a6ee){loggerPredictive[_0xfef0('0x79')](_0xfef0('0x7e'),JSON[_0xfef0('0x4b')](_0x18a6ee));_[_0xfef0('0x7f')](_0x4e959e,_0x18a6ee);};}function getDiff(_0x2f94c4){var _0x282a18=moment()['milliseconds'](0x0);var _0x3458b0=moment(_0x2f94c4)[_0xfef0('0x4c')](0x0);return _0x282a18['diff'](_0x3458b0,_0xfef0('0x80'));}function ifInterval(_0x59e7c4,_0x175e97){if(_[_0xfef0('0x3f')](_0x175e97)){return![];}if(getDiff(_0x175e97)<_0x59e7c4*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x5cf1fa){if(isNotNull(_0x5cf1fa)){if(!_[_0xfef0('0x3f')](_0x5cf1fa['startProgressive'])){_0x5cf1fa['startProgressive']=undefined;loggerPredictive['info'](_0xfef0('0x81'),_0xfef0('0x82'),_0x5cf1fa[_0xfef0('0x40')]);}if(!_[_0xfef0('0x3f')](_0x5cf1fa[_0xfef0('0x2b')])){_0x5cf1fa[_0xfef0('0x2b')]=undefined;loggerPredictive['info'](_0xfef0('0x81'),_0xfef0('0x2b'),_0x5cf1fa[_0xfef0('0x40')]);}if(!_[_0xfef0('0x3f')](_0x5cf1fa[_0xfef0('0x83')])){clearInterval(_0x5cf1fa['handlePredictive']);_0x5cf1fa[_0xfef0('0x83')]=undefined;loggerPredictive['info'](_0xfef0('0x81'),'handlePredictive',_0x5cf1fa[_0xfef0('0x40')]);}}}function erlangb(_0x851e97,_0xdd1121){if(_0xdd1121===0x0){return 0x0;}var _0x281259=0x1;for(var _0xd0255c=0x1;_0xd0255c<=_0xdd1121;_0xd0255c+=0x1){_0x281259=0x1+_0x281259*_0xd0255c/_0x851e97;}return 0x1/_0x281259;}function isVoiceQueueOutbound(_0x4852c0){return _0x4852c0===_0xfef0('0x4f');}function isNotPreview(_0x5f05ab){return _0x5f05ab!==_0xfef0('0x22');}function isCampaignIvr(_0x4a1316){return _0x4a1316==='ivr';}function getCallerId(_0x3a12c5,_0x3c5640,_0xd6de4d){if(!_[_0xfef0('0x3f')](_0xd6de4d)&&_0xfef0('0x84')===typeof _0xd6de4d&&!_[_0xfef0('0x46')](_0xd6de4d)){if(!_[_0xfef0('0x3f')](_0x3c5640)&&_0xfef0('0x84')===typeof _0x3c5640&&!_[_0xfef0('0x46')](_0x3c5640)){return util[_0xfef0('0x76')](_0xfef0('0x85'),_0x3c5640,_0xd6de4d);}return util[_0xfef0('0x76')]('\x22%s\x22\x20<%s>',_0xd6de4d,_0xd6de4d);}if(!_[_0xfef0('0x3f')](_0x3a12c5)&&_0xfef0('0x84')===typeof _0x3a12c5&&!_[_0xfef0('0x46')](_0x3a12c5)){return _0x3a12c5;}return _0xfef0('0x86');}function loggerCatchQueueSummary(_0x16f0a2,_0x49ed54){return function(_0x12e383){freeVariablesPredictive(_0x49ed54);emitVoiceQueueSummary(_0x49ed54);emitCampaignSummary(_0x49ed54);loggerSyncQueueSummary[_0xfef0('0x87')](_0x16f0a2,util[_0xfef0('0x88')](_0x12e383,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3c6bb8,_0x176fc7){return function(_0x1765e2){loggerPredictive[_0xfef0('0x87')](_0x3c6bb8,JSON[_0xfef0('0x4b')](_0x1765e2));freeVariablesPredictive(_0x176fc7);};}function loggerCatch(_0x14d53d){return function(_0x3f26d9){logger['error'](_0x14d53d,util[_0xfef0('0x88')](_0x3f26d9,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x548989){return _0x548989&&!_[_0xfef0('0x3f')](_0x548989)&&_0x548989[_0xfef0('0x89')]>0x0;}function decremetOriginate(_0x5e3204){if(!_[_0xfef0('0x3f')](_0x5e3204)&&_0x5e3204!==null){if(_0x5e3204[_0xfef0('0x8a')](_0xfef0('0x8b'))){if(_0x5e3204[_0xfef0('0x8b')]>0x0){_0x5e3204[_0xfef0('0x8b')]-=0x1;}else{logger['error'](_0xfef0('0x8c'));}}}else{logger[_0xfef0('0x87')](_0xfef0('0x8d'));}}function checkContactLowerLimitOriginate(_0x4f0737,_0x117b74,_0x2ab666){if(_0x117b74>_0x2ab666){for(var _0x3e1d4a=0x0;_0x3e1d4a<_0x117b74-_0x2ab666;_0x3e1d4a+=0x1){decremetOriginate(_0x4f0737);}}}function loggerGetContactDialer(_0x6f759a,_0x7186c8,_0x3cfe32){return function(_0x45ba65){checkContactLowerLimitOriginate(_0x7186c8,_0x3cfe32,0x0);logger['error'](_0x6f759a,util[_0xfef0('0x88')](_0x45ba65,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x31e191){return function(_0x3cd0c5){if(isNotNull(_0x3cd0c5)&&isNotNull(_0x3cd0c5[0x0])){if(_0x3cd0c5[0x0][_0xfef0('0x8e')]>0x0){_0x31e191[_0xfef0('0x45')]=_0xfef0('0x8f');logger['info'](_0xfef0('0x90')+_0x31e191[_0xfef0('0x40')],_0x3cd0c5[0x0][_0xfef0('0x8e')],_0xfef0('0x91'));}else{_0x31e191['message']=_0xfef0('0x92');logger[_0xfef0('0x79')]('[getContactDialer2][Empty]'+_0x31e191[_0xfef0('0x40')]);}}};}function notSendMessagesQueue(_0x18bcbe){if(_0x18bcbe[_0xfef0('0x93')]){freeVariablesPredictive(_0x18bcbe);if(_0x18bcbe[_0xfef0('0x8b')]===0x0&&_0x18bcbe[_0xfef0('0x54')]===0x0&&_0x18bcbe['waiting']===0x0&&(_0x18bcbe['pTalking']||0x0)===0x0){_0x18bcbe['sendMessageOneNotActive']=![];_0x18bcbe[_0xfef0('0x51')]=0x0;_0x18bcbe[_0xfef0('0x45')]=_0xfef0('0x94');loggerSyncQueueSummary['error'](_0xfef0('0x95'),_0x18bcbe['name'],'is\x20not\x20active');}else{_0x18bcbe['message']=_0xfef0('0x96');loggerSyncQueueSummary[_0xfef0('0x87')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x18bcbe[_0xfef0('0x40')],_0xfef0('0x97'));}emitVoiceQueueSummary(_0x18bcbe);}}function notSendMessagesCampaign(_0x1f4c6f){if(_0x1f4c6f['sendMessageOneNotActive']){if(_0x1f4c6f[_0xfef0('0x8b')]===0x0){_0x1f4c6f['sendMessageOneNotActive']=![];_0x1f4c6f['message']=_0xfef0('0x94');loggerSyncQueueSummary[_0xfef0('0x87')](_0xfef0('0x98'),_0x1f4c6f[_0xfef0('0x40')],'is\x20not\x20active');}else{_0x1f4c6f['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0xfef0('0x87')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1f4c6f[_0xfef0('0x40')],_0xfef0('0x97'));}emitCampaignSummary(_0x1f4c6f);}}function createObjHistory(_0x46c54b,_0x2de68b,_0x3a4c92,_0x4be622,_0x2c4654){_0x46c54b['message']=_0x3a4c92;var _0x5b9138=new Action(_0x46c54b,_0x2de68b);var _0x2260e3=new History(_0x5b9138);_0x2260e3[_0xfef0('0x99')]=_0x4be622;_0x2260e3[_0xfef0('0x9a')]=_0x2c4654;_0x2260e3[_0xfef0('0x9b')]=_0x5b9138['starttime'];return _0x2260e3;}Dialer['prototype'][_0xfef0('0x3e')]=function(){var _0x3039a0=this;setInterval(function(){_0x3039a0['clearZombieChannels'](_0x3039a0[_0xfef0('0x2a')],_0xfef0('0x9c'));_0x3039a0[_0xfef0('0x9d')](_0x3039a0[_0xfef0('0x28')],_0xfef0('0x9e'));},0x32c8);};Dialer[_0xfef0('0x9f')][_0xfef0('0x9d')]=function(_0x474148,_0x3e140f){var _0x52fe45=this;for(var _0x4373a0 in _0x474148){if(_0x474148[_0xfef0('0x8a')](_0x4373a0)){this[_0xfef0('0x21')][_0xfef0('0x1e')](function(){if(!_[_0xfef0('0xa0')](_0x474148[_0x4373a0])){return ami[_0xfef0('0xa1')]({'action':_0xfef0('0xa2'),'channel':_0x474148[_0x4373a0]['channel']})[_0xfef0('0xa3')](function(_0x2fe46f){if(_0x2fe46f[_0xfef0('0x45')]===_0xfef0('0xa4')){setTimeout(function(){if(_0x474148[_0x4373a0]&&_0x474148[_0x4373a0][_0xfef0('0x74')]!==_0xfef0('0x75')){_0x52fe45[_0xfef0('0xa5')](_0x52fe45[_0xfef0('0x23')][_0x474148[_0x4373a0][_0xfef0('0xa6')]]);logger[_0xfef0('0x87')](_0xfef0('0xa7'),_0x3e140f,_0x4373a0,_0x474148[_0x4373a0][_0xfef0('0xa6')]);delete _0x474148[_0x4373a0];}if(_0x474148[_0x4373a0]&&_0x474148[_0x4373a0][_0xfef0('0x74')]==='ivr'){_0x52fe45[_0xfef0('0xa5')](_0x52fe45['campaigns'][_0x474148[_0x4373a0]['queue']]);logger[_0xfef0('0x87')](_0xfef0('0xa8'),_0x3e140f,_0x4373a0,_0x474148[_0x4373a0]['queue']);delete _0x474148[_0x4373a0];}},0x2328);}});}});}}};Dialer[_0xfef0('0x9f')]['countReScheduled']=function(_0x5d68aa){return BPromise[_0xfef0('0xa9')]()[_0xfef0('0xaa')](cmHopper[_0xfef0('0xab')](_0x5d68aa))[_0xfef0('0xa3')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xfef0('0x9f')][_0xfef0('0xac')]=function(_0x583e46){return BPromise[_0xfef0('0xa9')]()[_0xfef0('0xaa')](cmHopperBlack[_0xfef0('0xac')](_0x583e46))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xfef0('0x9f')]['checkIsBlackListIvr']=function(_0x48f207){return BPromise[_0xfef0('0xa9')]()['then'](cmHopperBlack[_0xfef0('0xad')](_0x48f207))[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xae')));};Dialer[_0xfef0('0x9f')][_0xfef0('0xaf')]=function(_0x2cba75){return BPromise[_0xfef0('0xa9')]()[_0xfef0('0xaa')](cmHopperHistory[_0xfef0('0xb0')](_0x2cba75))[_0xfef0('0xa3')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xfef0('0x9f')]['rescheduleContact']=function(_0x4ce93b){return BPromise[_0xfef0('0xa9')]()['then'](cmHopper[_0xfef0('0xb1')](_0x4ce93b))[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xb2')));};Dialer[_0xfef0('0x9f')][_0xfef0('0xb3')]=function(_0x32675c,_0x51f656,_0x333190,_0x211577){return BPromise[_0xfef0('0xa9')]()[_0xfef0('0xaa')](cmHopper[_0xfef0('0xb3')](_0x32675c,_0x51f656,_0x333190,_0x211577))[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xb4')));};Dialer[_0xfef0('0x9f')]['getContactDialerIvr']=function(_0x439909,_0x2cde37,_0x52bdb1){return BPromise[_0xfef0('0xa9')]()[_0xfef0('0xaa')](cmHopper[_0xfef0('0xb5')](_0x439909,_0x2cde37,_0x52bdb1))['catch'](loggerCatch(_0xfef0('0xb4')));};Dialer['prototype'][_0xfef0('0xb6')]=function(_0x5ec7d2){return BPromise['resolve']()[_0xfef0('0xaa')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5ec7d2))[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xb7')));};Dialer[_0xfef0('0x9f')][_0xfef0('0xb8')]=function(_0x14d871){return BPromise[_0xfef0('0xa9')]()[_0xfef0('0xaa')](cmHopper[_0xfef0('0xb8')](_0x14d871))[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xb9')));};Dialer[_0xfef0('0x9f')]['createHistory']=function(_0x35aab4){return BPromise['resolve']()['then'](cmHopperHistory[_0xfef0('0xba')](_0x35aab4))['catch'](loggerCatch(_0xfef0('0xbb')));};Dialer['prototype']['updateOriginated']=function(_0x3f3689){if(!_['isUndefined'](_0x3f3689)&&_0x3f3689!==null){if(_0x3f3689['hasOwnProperty']('originated')){if(_0x3f3689[_0xfef0('0x8b')]>0x0){_0x3f3689[_0xfef0('0x8b')]-=0x1;}else{logger[_0xfef0('0x87')](_0xfef0('0xbc'));}}}else{logger['error'](_0xfef0('0xbd'));}};Dialer[_0xfef0('0x9f')][_0xfef0('0xbe')]=function(_0x2b55f5,_0x1c16ad){var _0x599dab=this;return function(_0x553d1b){_0x599dab[_0xfef0('0xa5')](_0x1c16ad);logger[_0xfef0('0x87')](_0x2b55f5,util['inspect'](_0x553d1b,{'showHidden':![],'depth':null}));};};Dialer[_0xfef0('0x9f')][_0xfef0('0xbf')]=function(_0x3be21b,_0x10ff58,_0x69217d){var _0x35e50f={'state':0x19,'statedesc':_0xfef0('0xc0')};this[_0xfef0('0xa5')](_0x10ff58);this['saveInDb'](_['merge'](_0x35e50f,_[_0xfef0('0xc1')](_0x69217d,[_0xfef0('0xc2'),_0xfef0('0xc3'),_0xfef0('0xc4'),_0xfef0('0xc5'),_0xfef0('0xc6')])),_0xfef0('0xc7'),_0xfef0('0xc8'));logger['error'](_0x3be21b);};Dialer['prototype'][_0xfef0('0xc9')]=function(_0x28a5dc){return _0x28a5dc===_0xfef0('0xca');};Dialer[_0xfef0('0x9f')][_0xfef0('0xcb')]=function(_0x458beb){return!_['isUndefined'](_0x458beb)&&_0x458beb&&!_[_0xfef0('0x3f')](_0x458beb[_0xfef0('0x40')])&&!_['isUndefined'](_0x458beb[_0xfef0('0x70')])&&_0x458beb[_0xfef0('0x70')]&&(this[_0xfef0('0x26')][util[_0xfef0('0x76')](_0xfef0('0xcc'),_0x458beb[_0xfef0('0x40')])]['status']==='reachable'||this[_0xfef0('0x26')][util[_0xfef0('0x76')](_0xfef0('0xcc'),_0x458beb[_0xfef0('0x40')])][_0xfef0('0xa2')]===_0xfef0('0xcd'));};Dialer['prototype'][_0xfef0('0xce')]=function(_0x5c3f46,_0x3a2a03,_0x55b14d){this[_0xfef0('0xba')](_0x5c3f46)[_0xfef0('0xa3')](loggerCatch(_0x3a2a03));this['moveContactManagedDialer'](_0x5c3f46)[_0xfef0('0xa3')](loggerCatch(_0x55b14d));};Dialer[_0xfef0('0x9f')][_0xfef0('0x38')]=function(_0x4d56e5){var _0x4c4305=this['uniqueId'][_0x4d56e5[_0xfef0('0xcf')]];var _0x51dc44;if(!_[_0xfef0('0xa0')](_0x4d56e5)&&!_[_0xfef0('0xa0')](_0x4d56e5['variable'])&&!_[_0xfef0('0xa0')](_0x4d56e5['variable'][_0xfef0('0xd0')])&&_0x4d56e5[_0xfef0('0xd1')]===_0xfef0('0xd2')&&_0x4c4305){if(_0x4c4305[_0xfef0('0x74')]!==_0xfef0('0x75')&&this[_0xfef0('0x23')][_0x4c4305[_0xfef0('0xa6')]]['dialAMDActive']&&_0x4d56e5[_0xfef0('0xd3')]===_0xfef0('0xd4')){delete this[_0xfef0('0x2a')][_0x4d56e5[_0xfef0('0xcf')]];this[_0xfef0('0xa5')](this[_0xfef0('0x23')][_0x4c4305[_0xfef0('0xa6')]]);this[_0xfef0('0x23')][_0x4c4305[_0xfef0('0xa6')]][_0xfef0('0x5d')]+=0x1;this[_0xfef0('0x23')][_0x4c4305[_0xfef0('0xa6')]][_0xfef0('0xd5')]+=0x1;_0x51dc44=new Hangup(_0x4c4305,_0x4d56e5);_0x51dc44[_0xfef0('0x99')]=0x12;_0x51dc44['statedesc']=_0xfef0('0xd6');_0x51dc44[_0xfef0('0xd7')]=_0xfef0('0xd8');this[_0xfef0('0xce')](_0x51dc44,_0xfef0('0xd9'),_0xfef0('0xda'));}if(_0x4c4305[_0xfef0('0x74')]!==_0xfef0('0x75')&&this[_0xfef0('0x23')][_0x4c4305['queue']]['dialAMDActive']&&_0x4d56e5[_0xfef0('0xd3')]==='MACHINE'){delete this[_0xfef0('0x2a')][_0x4d56e5[_0xfef0('0xcf')]];this[_0xfef0('0xa5')](this[_0xfef0('0x23')][_0x4c4305[_0xfef0('0xa6')]]);this[_0xfef0('0x23')][_0x4c4305[_0xfef0('0xa6')]][_0xfef0('0x5d')]+=0x1;this[_0xfef0('0x23')][_0x4c4305[_0xfef0('0xa6')]][_0xfef0('0xd5')]+=0x1;_0x51dc44=new Hangup(_0x4c4305,_0x4d56e5);_0x51dc44['state']=0x13;_0x51dc44[_0xfef0('0x9a')]=_0xfef0('0xdb');_0x51dc44['membername']=_0xfef0('0xd8');_0x51dc44[_0xfef0('0xdc')]=!![];this['saveInDb'](_0x51dc44,_0xfef0('0xdd'),'[syncMachine]');}if(_0x4c4305[_0xfef0('0x74')]===_0xfef0('0x75')&&this[_0xfef0('0x24')][_0x4c4305[_0xfef0('0xa6')]][_0xfef0('0xde')]&&_0x4d56e5['value']===_0xfef0('0xd4')){delete this[_0xfef0('0x2a')][_0x4d56e5['uniqueid']];this[_0xfef0('0xa5')](this['campaigns'][_0x4c4305[_0xfef0('0xa6')]]);_0x51dc44=new Hangup(_0x4c4305,_0x4d56e5);_0x51dc44[_0xfef0('0x99')]=0x12;_0x51dc44[_0xfef0('0x9a')]='HangupInAMD';_0x51dc44[_0xfef0('0xd7')]='AMD';this['saveInDb'](_0x51dc44,_0xfef0('0xdf'),'[syncHangupInAMDIvr]');}if(_0x4c4305[_0xfef0('0x74')]===_0xfef0('0x75')&&this[_0xfef0('0x24')][_0x4c4305[_0xfef0('0xa6')]][_0xfef0('0xde')]&&_0x4d56e5[_0xfef0('0xd3')]===_0xfef0('0xe0')){delete this['uniqueId'][_0x4d56e5['uniqueid']];this[_0xfef0('0xa5')](this['campaigns'][_0x4c4305[_0xfef0('0xa6')]]);_0x51dc44=new Hangup(_0x4c4305,_0x4d56e5);_0x51dc44[_0xfef0('0x99')]=0x13;_0x51dc44[_0xfef0('0x9a')]=_0xfef0('0xdb');_0x51dc44[_0xfef0('0xd7')]=_0xfef0('0xd8');_0x51dc44[_0xfef0('0xdc')]=!![];this[_0xfef0('0xce')](_0x51dc44,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer[_0xfef0('0x9f')][_0xfef0('0x35')]=function(_0x1f07e9){var _0x23c42a=this[_0xfef0('0x2a')][_0x1f07e9['uniqueid']];var _0x54d98e=this;var _0x54f30f;if(_0x23c42a&&_0x23c42a[_0xfef0('0x74')]===_0xfef0('0x75')){delete this['uniqueId'][_0x1f07e9[_0xfef0('0xcf')]];this['updateOriginated'](this[_0xfef0('0x24')][_0x23c42a[_0xfef0('0xa6')]]);this[_0xfef0('0x24')][_0x23c42a[_0xfef0('0xa6')]][_0xfef0('0xe1')]+=0x1;_0x54f30f=new Hangup(_0x23c42a,_0x1f07e9);this[_0xfef0('0xba')](_0x54f30f)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xe2')));this[_0xfef0('0xb8')](_0x54f30f)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xe3')));}if(_0x23c42a&&_0x23c42a['type']!==_0xfef0('0x75')&&isNotNull(this['voiceQueues'][_0x23c42a[_0xfef0('0xa6')]][_0xfef0('0xe4')])){delete this[_0xfef0('0x2a')][_0x1f07e9[_0xfef0('0xcf')]];this[_0xfef0('0xa5')](this[_0xfef0('0x23')][_0x23c42a[_0xfef0('0xa6')]]);this[_0xfef0('0x23')][_0x23c42a[_0xfef0('0xa6')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x23c42a[_0xfef0('0xa6')]]['outboundAnswerAgiCallsDay']+=0x1;_0x54f30f=new Hangup(_0x23c42a,_0x1f07e9);_0x54f30f[_0xfef0('0x99')]=0x10;_0x54f30f[_0xfef0('0x9a')]=_0xfef0('0xe5');_0x54f30f[_0xfef0('0xd7')]=_0xfef0('0xe6');this['createHistory'](_0x54f30f)[_0xfef0('0xa3')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xfef0('0xb8')](_0x54f30f)[_0xfef0('0xa3')](loggerCatch('[syncHangupIvr]'));}if(_0x23c42a&&_0x23c42a[_0xfef0('0x74')]!=='ivr'&&!isNotNull(this[_0xfef0('0x23')][_0x23c42a['queue']]['dialQueueProject'])){delete this[_0xfef0('0x2a')][_0x1f07e9['uniqueid']];this[_0xfef0('0xa5')](this[_0xfef0('0x23')][_0x23c42a[_0xfef0('0xa6')]]);this['voiceQueues'][_0x23c42a['queue']][_0xfef0('0xe7')]+=0x1;_0x54f30f=new Hangup(_0x23c42a,_0x1f07e9);_0x54f30f[_0xfef0('0x99')]=0xc;_0x54f30f[_0xfef0('0x9a')]=_0x1f07e9[_0xfef0('0xe8')];_0x54f30f[_0xfef0('0xd7')]=_0xfef0('0xe9');this[_0xfef0('0xba')](_0x54f30f)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xe2')));this['moveContactManagedDialer'](_0x54f30f)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xe3')));}};Dialer[_0xfef0('0x9f')][_0xfef0('0xea')]=function(_0x420604){var _0xb1df6f=this[_0xfef0('0x2a')][_0x420604['uniqueid']];var _0x299004=this;if(this[_0xfef0('0x23')][_0x420604['queue']]){if(_0xb1df6f&&_0xb1df6f[_0xfef0('0x74')]!==_0xfef0('0x75')){delete this[_0xfef0('0x2a')][_0x420604[_0xfef0('0xcf')]];this[_0xfef0('0x23')][_0x420604['queue']][_0xfef0('0x5d')]+=0x1;var _0x5e46bc=new AgentComplete(_0xb1df6f,_0x420604);if(_0x420604[_0xfef0('0xeb')]==='agent'){_0x5e46bc['agiafterat']=this['voiceQueues'][_0x420604[_0xfef0('0xa6')]]['dialQueueProject2']&&this['voiceQueues'][_0x420604[_0xfef0('0xa6')]][_0xfef0('0xec')]?moment()['format'](_0xfef0('0xed')):undefined;}this[_0xfef0('0xba')](_0x5e46bc)[_0xfef0('0xa3')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x5e46bc)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0xee')));}}};Dialer[_0xfef0('0x9f')][_0xfef0('0xef')]=function(_0x33f519){if(this[_0xfef0('0x23')][_0x33f519[_0xfef0('0xa6')]]){if(this['uniqueId'][_0x33f519[_0xfef0('0xcf')]]&&this[_0xfef0('0x2a')][_0x33f519[_0xfef0('0xcf')]][_0xfef0('0x74')]!=='ivr'){this['updateOriginated'](this[_0xfef0('0x23')][_0x33f519[_0xfef0('0xa6')]]);this[_0xfef0('0x2a')][_0x33f519[_0xfef0('0xcf')]][_0xfef0('0xf0')]=moment()[_0xfef0('0x76')](_0xfef0('0xed'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4f1c8c){this[_0xfef0('0xba')](_0x4f1c8c)['catch'](loggerCatch(_0xfef0('0xf1')));this['moveContactManagedDialer'](_0x4f1c8c)[_0xfef0('0xa3')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xfef0('0x9f')][_0xfef0('0x2f')]=function(_0x36e7b3){var _0x31ef0a=this[_0xfef0('0x2a')][_0x36e7b3['uniqueid']];var _0x314dd1=this;if(this[_0xfef0('0x23')][_0x36e7b3[_0xfef0('0xa6')]]){if(_0x31ef0a&&_0x31ef0a[_0xfef0('0x74')]!=='ivr'){delete this[_0xfef0('0x2a')][_0x36e7b3['uniqueid']];this['updateOriginated'](this[_0xfef0('0x23')][_0x36e7b3['queue']]);_0x31ef0a['droptime']=moment()[_0xfef0('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3c886c=new QueueCallerAbandon(_0x31ef0a,_0x36e7b3);if(getSeconds(_0x31ef0a[_0xfef0('0xf2')],_0x31ef0a[_0xfef0('0xf3')])>=_0x31ef0a[_0xfef0('0xf4')]){this[_0xfef0('0x23')][_0x36e7b3[_0xfef0('0xa6')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xfef0('0x23')][_0x36e7b3[_0xfef0('0xa6')]][_0xfef0('0x62')]+=0x1;this['voiceQueues'][_0x36e7b3[_0xfef0('0xa6')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x3c886c[_0xfef0('0x99')]=0xa;_0x3c886c[_0xfef0('0x9a')]=_0xfef0('0xf5');_0x3c886c['dropreason']=_0xfef0('0xf6');_0x3c886c['agiafterat']=this['voiceQueues'][_0x36e7b3[_0xfef0('0xa6')]][_0xfef0('0xf7')]?moment()['format'](_0xfef0('0xed')):undefined;this[_0xfef0('0xf8')](_0x3c886c);}else{this[_0xfef0('0x23')][_0x36e7b3[_0xfef0('0xa6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xfef0('0x23')][_0x36e7b3['queue']][_0xfef0('0x61')]+=0x1;_0x3c886c[_0xfef0('0x99')]=0xb;_0x3c886c[_0xfef0('0x9a')]=_0xfef0('0xf9');_0x3c886c[_0xfef0('0xfa')]=_0xfef0('0xfb');this[_0xfef0('0xf8')](_0x3c886c);}}}};Dialer[_0xfef0('0x9f')][_0xfef0('0x37')]=function(_0x4aa83b){if(this[_0xfef0('0x28')][_0x4aa83b[_0xfef0('0xcf')]]){this['actions'][_0x4aa83b[_0xfef0('0xcf')]]['channel']=_0x4aa83b[_0xfef0('0xfc')];}if(this[_0xfef0('0x2a')][_0x4aa83b[_0xfef0('0xcf')]]){this[_0xfef0('0x2a')][_0x4aa83b[_0xfef0('0xcf')]]['channel']=_0x4aa83b[_0xfef0('0xfc')];}};Dialer[_0xfef0('0x9f')][_0xfef0('0x3a')]=function(_0x5b8745){if(strategy[this['voiceQueues'][this[_0xfef0('0x28')][_0x5b8745[_0xfef0('0xfd')]][_0xfef0('0xa6')]][_0xfef0('0xfe')]]==='roundrobin'){if(this[_0xfef0('0x28')][_0x5b8745['actionid']]&&_[_0xfef0('0xa0')](this[_0xfef0('0x28')][_0x5b8745[_0xfef0('0xfd')]][_0xfef0('0xff')])&&_0x5b8745[_0xfef0('0xa2')]==='1'&&_0x5b8745['paused']==='0'){if(this[_0xfef0('0x25')][_0x5b8745[_0xfef0('0x100')]]){if(!this[_0xfef0('0x25')][_0x5b8745[_0xfef0('0x100')]]['locked']){this[_0xfef0('0x25')][_0x5b8745['stateinterface']][_0xfef0('0xff')]=!![];this[_0xfef0('0x28')][_0x5b8745[_0xfef0('0xfd')]][_0xfef0('0xff')]=!![];this['actions'][_0x5b8745['actionid']][_0xfef0('0x100')]=_0x5b8745[_0xfef0('0x100')];}}}}else if((strategy[this[_0xfef0('0x23')][this[_0xfef0('0x28')][_0x5b8745[_0xfef0('0xfd')]][_0xfef0('0xa6')]][_0xfef0('0xfe')]]||'rrmemory')==='rrmemory'){if(this[_0xfef0('0x28')][_0x5b8745[_0xfef0('0xfd')]]){if(this['agents'][_0x5b8745[_0xfef0('0x100')]]){this['actions'][_0x5b8745['actionid']][_0xfef0('0x100')]=_0x5b8745[_0xfef0('0x100')];if(_[_0xfef0('0xa0')](this[_0xfef0('0x2d')][this[_0xfef0('0x28')][_0x5b8745['actionid']][_0xfef0('0xa6')]])){this[_0xfef0('0x2d')][this[_0xfef0('0x28')][_0x5b8745[_0xfef0('0xfd')]]['queue']]=[];}this['queueBooked'][this['actions'][_0x5b8745[_0xfef0('0xfd')]]['queue']][_0xfef0('0x101')](_['merge'](_['pick'](this['actions'][_0x5b8745[_0xfef0('0xfd')]],[_0xfef0('0x102'),'stateinterface']),{'status':_0x5b8745[_0xfef0('0xa2')],'paused':_0x5b8745['paused']}));}}}};function unlockQueueStatus(_0x2b8545,_0x3a20bd){setTimeout(function(){if(_[_0xfef0('0x3f')](_0x2b8545[_0xfef0('0x103')])){loggerBooked[_0xfef0('0x87')](_0xfef0('0x104'),_0x3a20bd);}_0x2b8545[_0xfef0('0x103')]=!![];loggerBooked[_0xfef0('0x79')](_0xfef0('0x105'),_0x3a20bd,JSON[_0xfef0('0x4b')](_['pick'](_0x2b8545,[_0xfef0('0x40'),_0xfef0('0x103')])));},0x1f3);}Dialer['prototype'][_0xfef0('0x3c')]=function(_0x4dff3e){var _0x3f23a9=this;var _0x327889=_0x3f23a9[_0xfef0('0x23')][_0x3f23a9[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]];if(strategy[this[_0xfef0('0x23')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]][_0xfef0('0xfe')]]===_0xfef0('0x1d')){if(this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]]&&this['actions'][_0x4dff3e[_0xfef0('0xfd')]]['stateinterface']){this['preview'][_0xfef0('0x106')](this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0x102')],this[_0xfef0('0x28')][_0x4dff3e['actionid']][_0xfef0('0x100')])[_0xfef0('0xa3')](function(_0x16bd06){logger[_0xfef0('0x87')](_0xfef0('0x107'),util[_0xfef0('0x88')](_0x16bd06,{'showHidden':![],'depth':null}));})[_0xfef0('0x20')](function(){_0x3f23a9[_0xfef0('0xa5')](_0x3f23a9[_0xfef0('0x23')][_0x3f23a9[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]);_0x3f23a9[_0xfef0('0x25')][_0x3f23a9[_0xfef0('0x28')][_0x4dff3e['actionid']][_0xfef0('0x100')]]['locked']=![];delete _0x3f23a9[_0xfef0('0x28')][_0x4dff3e['actionid']];unlockQueueStatus(_0x327889);});}else{this[_0xfef0('0xa5')](this[_0xfef0('0x23')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc2')],'ListId':this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc3')],'VoiceQueueId':this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc5')]||undefined,'CampaignId':this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc6')]||undefined})['catch'](loggerCatch(_0xfef0('0x108')));delete this[_0xfef0('0x28')][_0x4dff3e['actionid']];unlockQueueStatus(_0x327889);}}else if((strategy[this[_0xfef0('0x23')][this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]][_0xfef0('0xfe')]]||_0xfef0('0x1c'))===_0xfef0('0x1c')){var _0x17f949;if(this[_0xfef0('0x28')][_0x4dff3e['actionid']]&&!_[_0xfef0('0x46')](this[_0xfef0('0x2d')][this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]])){if(this[_0xfef0('0x109')][_0x3f23a9['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]){this[_0xfef0('0x109')][_0x3f23a9[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]=this[_0xfef0('0x109')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]?this['queueBookedRR'][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]:this[_0xfef0('0x2d')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]]['queue']]?this['queueBooked'][this[_0xfef0('0x28')][_0x4dff3e['actionid']][_0xfef0('0xa6')]][_0xfef0('0x10a')]||0x0:0x0;}this[_0xfef0('0x2d')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]['_rr']=this[_0xfef0('0x109')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]];for(var _0x273e8b=0x0;_0x273e8b<this[_0xfef0('0x2d')][this[_0xfef0('0x28')][_0x4dff3e['actionid']][_0xfef0('0xa6')]][_0xfef0('0x89')];_0x273e8b+=0x1){_0x17f949=rr(this[_0xfef0('0x2d')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]);this['queueBookedRR'][_0x3f23a9['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]=this[_0xfef0('0x2d')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]][_0xfef0('0x10a')];if(_0x17f949[_0xfef0('0xa2')]==='1'&&_0x17f949[_0xfef0('0x10b')]==='0'){break;}}if(!_[_0xfef0('0xa0')](_0x17f949)){this[_0xfef0('0x25')][_0x17f949['stateinterface']][_0xfef0('0x10c')]=_[_0xfef0('0x3f')](this[_0xfef0('0x25')][_0x17f949[_0xfef0('0x100')]][_0xfef0('0x10c')])?!![]:this[_0xfef0('0x25')][_0x17f949['stateinterface']][_0xfef0('0x10c')];}loggerBooked[_0xfef0('0x79')](_0xfef0('0x10d'),_0x4dff3e[_0xfef0('0xfd')],'Agent:\x20',JSON[_0xfef0('0x4b')](_[_0xfef0('0xc1')](this['agents'][_0x17f949[_0xfef0('0x100')]],[_0xfef0('0x40'),_0xfef0('0x10c')])),_0xfef0('0x10e'),JSON[_0xfef0('0x4b')](_0x17f949[_0xfef0('0x102')]));if(!_[_0xfef0('0xa0')](_0x17f949)&&_0x17f949[_0xfef0('0xa2')]==='1'&&_0x17f949['paused']==='0'&&this[_0xfef0('0x25')][_0x17f949[_0xfef0('0x100')]]['unlockRR']){this['agents'][_0x17f949[_0xfef0('0x100')]][_0xfef0('0x10c')]=![];this[_0xfef0('0x2d')][_0x3f23a9['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xa6')]]=[];this['preview'][_0xfef0('0x106')](_0x17f949[_0xfef0('0x102')],_0x17f949[_0xfef0('0x100')])[_0xfef0('0xa3')](function(_0x1d4e48){logger['error'](_0xfef0('0x107'),util['inspect'](_0x1d4e48,{'showHidden':![],'depth':null}));})[_0xfef0('0x20')](function(){_0x3f23a9['updateOriginated'](_0x3f23a9[_0xfef0('0x23')][_0x3f23a9[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]]['queue']]);setTimeout(function(){_0x3f23a9[_0xfef0('0x25')][_0x17f949[_0xfef0('0x100')]]['unlockRR']=!![];loggerBooked['info'](_0xfef0('0x10f'),_0x4dff3e[_0xfef0('0xfd')],_0xfef0('0x110'),JSON['stringify'](_[_0xfef0('0xc1')](_0x3f23a9[_0xfef0('0x25')][_0x17f949['stateinterface']],['name',_0xfef0('0x10c')])),_0xfef0('0x10e'),JSON['stringify'](_0x17f949[_0xfef0('0x102')]));},0xc7);delete _0x3f23a9[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]];unlockQueueStatus(_0x327889,_0x4dff3e[_0xfef0('0xfd')]);});}else{loggerBooked[_0xfef0('0x79')](_0xfef0('0x111'));this[_0xfef0('0xa5')](this[_0xfef0('0x23')][this[_0xfef0('0x28')][_0x4dff3e['actionid']][_0xfef0('0xa6')]]);this[_0xfef0('0xb1')]({'active':![],'ContactId':this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc2')],'ListId':this[_0xfef0('0x28')][_0x4dff3e['actionid']][_0xfef0('0xc3')],'VoiceQueueId':this[_0xfef0('0x28')][_0x4dff3e['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc6')]||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x108')));delete this['actions'][_0x4dff3e[_0xfef0('0xfd')]];unlockQueueStatus(_0x327889);}}else{loggerBooked[_0xfef0('0x79')](_0xfef0('0x112'));this['updateOriginated'](this[_0xfef0('0x23')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc2')],'ListId':this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc3')],'VoiceQueueId':this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc5')]||undefined,'CampaignId':this['actions'][_0x4dff3e[_0xfef0('0xfd')]]['CampaignId']||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x113')));delete this[_0xfef0('0x28')][_0x4dff3e['actionid']];unlockQueueStatus(_0x327889);}}else{loggerBooked[_0xfef0('0x79')](_0xfef0('0x114'));this['updateOriginated'](this[_0xfef0('0x23')][this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]]['queue']]);this[_0xfef0('0xb1')]({'active':![],'ContactId':this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc2')],'ListId':this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc3')],'VoiceQueueId':this['actions'][_0x4dff3e[_0xfef0('0xfd')]][_0xfef0('0xc5')]||undefined,'CampaignId':this[_0xfef0('0x28')][_0x4dff3e['actionid']][_0xfef0('0xc6')]||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x115')));delete this[_0xfef0('0x28')][_0x4dff3e[_0xfef0('0xfd')]];unlockQueueStatus(_0x327889);}};Dialer[_0xfef0('0x9f')]['loopCampaigns']=function(){var _0x390100=this;setInterval(function(){_0x390100['syncCampaigns']();},0x3e8);};Dialer[_0xfef0('0x9f')][_0xfef0('0x116')]=function(_0x3ebfec){var _0x5098=this;return function(){if(!_0x5098[_0xfef0('0xcb')](_0x3ebfec[_0xfef0('0x6f')])){if(!_0x5098['isTrunkReachable'](_0x3ebfec[_0xfef0('0x117')])){_0x3ebfec[_0xfef0('0x45')]=_0xfef0('0x118');throw _0x3ebfec[_0xfef0('0x40')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xfef0('0x9f')][_0xfef0('0x119')]=function(_0x53c82d,_0x4af19b,_0x32e07e,_0xaad627){var _0x1a67b9=this;return function(){var _0xcc98cd=!![];return _0x1a67b9['ifTime'](_0x53c82d,_0x4af19b,_0x32e07e,_0xaad627,_0xcc98cd);};};Dialer['prototype'][_0xfef0('0x11a')]=function(_0xa6f398,_0xde264,_0x724b4e,_0x26f244){var _0x51e72e=this;return function(){var _0x2978cc=![];return _0x51e72e[_0xfef0('0x11b')](_0xa6f398['Intervals'],_0xde264,_0x724b4e,_0x26f244,_0x2978cc);};};Dialer[_0xfef0('0x9f')][_0xfef0('0x11b')]=function(_0x2484d2,_0xb33a90,_0x41b7db,_0x594dc2,_0x516ab5){var _0x50224b=[];return new BPromise(function(_0x358c45,_0x1619e2){if(!isNotNull(_0x2484d2)){_0x594dc2[_0xfef0('0x45')]=_0xfef0('0x47');return _0x1619e2(msgResponse('ifTime','Failure',_0x41b7db+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xfef0('0x46')](_0x2484d2)){_0x594dc2[_0xfef0('0x45')]=_0xfef0('0x11c');return _0x1619e2(msgResponse(_0xfef0('0x11b'),_0xfef0('0x11d'),_0x41b7db+_0xfef0('0x11e')));}if(_0xb33a90&&_['isUndefined'](config['timezones'][_0xb33a90])){_0x594dc2['message']='TIMEZONE_UNKNOW';return _0x1619e2(msgResponse('ifTime',_0xfef0('0x11d'),_0x41b7db+'\x20Timezone\x20unknow\x20'+_0xb33a90));}if(_[_0xfef0('0x11f')](_0x2484d2)){for(var _0x1aa8f4=0x0;_0x1aa8f4<_0x2484d2[_0xfef0('0x89')];_0x1aa8f4+=0x1){_0x50224b[_0xfef0('0x101')](ami[_0xfef0('0xa1')]({'action':'command','command':util[_0xfef0('0x76')](_0xfef0('0x120'),_0x2484d2[_0x1aa8f4][_0xfef0('0x121')],!_['isUndefined'](config[_0xfef0('0x122')][_0xb33a90])?_0xb33a90:'')})[_0xfef0('0xaa')](function(_0x1cdc32){return _0x1cdc32[_0xfef0('0x123')][_0xfef0('0x124')](_0xfef0('0x125'))>=0x0?!![]:![];})[_0xfef0('0xa3')](myreject(_0x1619e2)));}}else{_0x50224b[_0xfef0('0x101')](ami[_0xfef0('0xa1')]({'action':_0xfef0('0x126'),'command':util[_0xfef0('0x76')](_0xfef0('0x120'),_0x2484d2,!_[_0xfef0('0x3f')](config[_0xfef0('0x122')][_0xb33a90])?_0xb33a90:'')})[_0xfef0('0xaa')](function(_0x3ebb5b){return _0x3ebb5b[_0xfef0('0x123')][_0xfef0('0x124')](_0xfef0('0x125'))>=0x0?!![]:![];})[_0xfef0('0xa3')](myreject(_0x1619e2)));}BPromise['all'](_0x50224b)['then'](function(_0x5b520a){var _0x4dc792=_[_0xfef0('0x127')](_0x5b520a);if(_0x4dc792){return _0x358c45(_0x4dc792);}else{_0x594dc2[_0xfef0('0x45')]=_0x516ab5?_0xfef0('0x128'):'INTERVAL_IS_OVERTIME';return _0x1619e2(msgResponse(_0xfef0('0x129'),_0xfef0('0x11d'),_0xfef0('0x12a')+_0x516ab5+'\x20'+_0x41b7db+_0xfef0('0x12b')+util['inspect'](_0x2484d2,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0xb33a90));}})['catch'](function(_0x1a6721){return _0x1619e2(msgResponse(_0xfef0('0x11b'),_0xfef0('0x11d'),JSON[_0xfef0('0x4b')](_0x1a6721)));});});};Dialer['prototype'][_0xfef0('0x12c')]=function(_0x31233b){var _0x54aafe=this;return function(){switch(_0x31233b[_0xfef0('0x5a')]){case _0xfef0('0x12d'):freeVariablesPredictive(_0x31233b);_0x54aafe[_0xfef0('0x12e')](_0x31233b,0x1);break;case _0xfef0('0x12f'):freeVariablesPredictive(_0x31233b);_0x54aafe[_0xfef0('0x12e')](_0x31233b,_0x31233b[_0xfef0('0x130')]);break;case _0xfef0('0x8'):_0x54aafe[_0xfef0('0x8')](_0x31233b);break;case _0xfef0('0x7'):freeVariablesPredictive(_0x31233b);_0x54aafe[_0xfef0('0x12e')](_0x31233b,0x1);break;default:freeVariablesPredictive(_0x31233b);logger[_0xfef0('0x87')](_0xfef0('0x131'),_0x31233b[_0xfef0('0x40')],_0xfef0('0x132'));}};};Dialer[_0xfef0('0x9f')]['launchHandleIvr']=function(_0x4c3a49){var _0x490d48=this;return function(){_0x490d48[_0xfef0('0x133')](_0x4c3a49);};};Dialer['prototype']['syncQueueSummary']=function(_0x188cbe){var _0x427f7a=this;if(isNotPreview(_0x188cbe['dialMethod'])){if(isVoiceQueueOutbound(_0x188cbe[_0xfef0('0x74')])&&isActive(_0x188cbe['dialActive'])){_0x188cbe['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xfef0('0xaa')](checkIsLoggedIn(_0x188cbe,_0x188cbe[_0xfef0('0x52')]))[_0xfef0('0xaa')](checkIsActive(_0x188cbe,_0x188cbe['dialActive']))['then'](checkInterval(_0x188cbe))[_0xfef0('0xaa')](_0x427f7a[_0xfef0('0x116')](_0x188cbe))[_0xfef0('0xaa')](_0x427f7a['checkIfTime'](_0x188cbe[_0xfef0('0x134')],_0x188cbe[_0xfef0('0x135')],_0x188cbe[_0xfef0('0x40')],_0x188cbe))[_0xfef0('0xaa')](_0x427f7a[_0xfef0('0x11a')](_0x188cbe[_0xfef0('0x43')],_0x188cbe[_0xfef0('0x135')],_0x188cbe[_0xfef0('0x40')],_0x188cbe))[_0xfef0('0xaa')](_0x427f7a['checkDialMethod'](_0x188cbe))[_0xfef0('0xa3')](loggerCatchQueueSummary(_0xfef0('0x136'),_0x188cbe));}else{notSendMessagesQueue(_0x188cbe);}}else{freeVariablesPredictive(_0x188cbe);}};Dialer[_0xfef0('0x9f')][_0xfef0('0x137')]=function(){var _0x3f0555=this;var _0x43fc52;for(var _0x62df15 in this[_0xfef0('0x24')]){if(this[_0xfef0('0x24')]['hasOwnProperty'](_0x62df15)){_0x43fc52=this['campaigns'][_0x62df15];if(isCampaignIvr(_0x43fc52[_0xfef0('0x74')])&&isActive(_0x43fc52['active'])){_0x43fc52[_0xfef0('0x93')]=!![];BPromise['resolve']()[_0xfef0('0xaa')](checkIsActive(_0x43fc52,_0x43fc52[_0xfef0('0x70')]))[_0xfef0('0xaa')](checkInterval(_0x43fc52))[_0xfef0('0xaa')](_0x3f0555[_0xfef0('0x116')](_0x43fc52))[_0xfef0('0xaa')](_0x3f0555[_0xfef0('0x119')](_0x43fc52[_0xfef0('0x134')],_0x43fc52[_0xfef0('0x135')],_0x43fc52['name'],_0x43fc52))[_0xfef0('0xaa')](_0x3f0555[_0xfef0('0x11a')](_0x43fc52[_0xfef0('0x43')],_0x43fc52[_0xfef0('0x135')],_0x43fc52[_0xfef0('0x40')],_0x43fc52))[_0xfef0('0xaa')](_0x3f0555[_0xfef0('0x138')](_0x43fc52))[_0xfef0('0xa3')](loggerCatchQueueSummary(_0xfef0('0x139'),_0x43fc52));}else{notSendMessagesCampaign(_0x43fc52);}}}};function getCallerIdRandom(_0x2d2590,_0x45e0d2){var _0x1b4849,_0x339fef,_0x3b5ae1;if(_0x45e0d2<=0x0){_0x45e0d2=0x1;}_0x1b4849=new RegExp(_0xfef0('0x13a')+_0x45e0d2+'}$');_0x339fef=Math[_0xfef0('0x13b')](0xa,_0x45e0d2-0x1);_0x3b5ae1=Math['pow'](0xa,_0x45e0d2)-0x1;return util[_0xfef0('0x76')]('%s',_[_0xfef0('0x13c')](_0x2d2590,_0x1b4849,_['random'](_0x339fef,_0x3b5ae1)));}function extractCalleridName(_0x4adde4){var _0xe09434=_0x4adde4['match'](/"(.*?)"/);return _0xe09434?_0xe09434[0x1]:_0x4adde4;}function extractCalleridNumber(_0x448e0f){var _0x2b5c01=_0x448e0f[_0xfef0('0x13d')](/<(.*?)>/);return _0x2b5c01?_0x2b5c01[0x1]:_0x448e0f;}Dialer[_0xfef0('0x9f')][_0xfef0('0x13e')]=function(_0x1c6dbc,_0x30110f){var _0x1c0c90=this;var _0x461fe7=uuid['v4']();this[_0xfef0('0x28')][_0x461fe7]=new Action(_0x1c6dbc,_0x30110f,_0x461fe7);return new BPromise(function(_0x479a8b,_0x57f586){if(_[_0xfef0('0x3f')](_0x1c6dbc)&&_0xfef0('0x13f')!==typeof _0x1c6dbc){return _0x57f586(msgResponse(_0xfef0('0x140'),_0xfef0('0x11d'),_0xfef0('0x141')));}if(_[_0xfef0('0x3f')](_0x30110f[_0xfef0('0x142')][_0xfef0('0x143')])||_0x30110f['Contact'][_0xfef0('0x143')]===null){return _0x57f586(msgResponse('originate','Failure',_0xfef0('0x144')));}var _0x241598={'XMD-CALLERID':_0x1c0c90[_0xfef0('0x28')][_0x461fe7]['getCaller'](),'XMD-AGI':_0x1c6dbc[_0xfef0('0xe4')]?util['format'](_0xfef0('0x145'),ipAgi,_0x1c6dbc[_0xfef0('0xe4')]):_0xfef0('0x146'),'XMD-AGIAFTER':_0x1c6dbc[_0xfef0('0xf7')]?util[_0xfef0('0x76')](_0xfef0('0x145'),ipAgi,_0x1c6dbc[_0xfef0('0xf7')]):_0xfef0('0x146'),'XMD-QUEUE':_0x1c6dbc[_0xfef0('0x74')]===_0xfef0('0x4f')?util[_0xfef0('0x76')](_0xfef0('0x147'),_0x1c6dbc[_0xfef0('0x40')],_0x1c6dbc[_0xfef0('0x148')]||'',_0x1c6dbc[_0xfef0('0xec')]?'c':'',_0x1c6dbc['dialQueueTimeout']||0x3):_0xfef0('0x146'),'XMD-CONTACTID':_0x30110f[_0xfef0('0xc2')],'XMD-CDRTYPE':_0xfef0('0x149'),'CALLERID(all)':_0x1c0c90[_0xfef0('0x28')][_0x461fe7]['getCaller'](),'XMD-AMD':_0x1c6dbc[_0xfef0('0xde')]?_0xfef0('0x14a'):'NONE','XMD-DESTINATION':_0xfef0('0xd2')};if(_0x1c6dbc[_0xfef0('0xde')]){_0x241598[_0xfef0('0x14b')]=_0x1c6dbc['dialAMDInitialSilence']||0x9c4;_0x241598[_0xfef0('0x14c')]=_0x1c6dbc[_0xfef0('0x14d')]||0x5dc;_0x241598[_0xfef0('0x14e')]=_0x1c6dbc['dialAMDAfterGreetingSilence']||0x320;_0x241598[_0xfef0('0x14f')]=_0x1c6dbc[_0xfef0('0x150')]||0x1388;_0x241598[_0xfef0('0x151')]=_0x1c6dbc[_0xfef0('0x152')]||0x64;_0x241598[_0xfef0('0x153')]=_0x1c6dbc[_0xfef0('0x154')]||0x32;_0x241598['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x1c6dbc[_0xfef0('0x155')]||0x3;_0x241598['XMD-AMDSILENCETHRESHOLD']=_0x1c6dbc['dialAMDSilenceThreshold']||0x100;_0x241598[_0xfef0('0x156')]=_0x1c6dbc[_0xfef0('0x157')]||0x1388;}if(_0x1c6dbc[_0xfef0('0x74')]===_0xfef0('0x4f')){_0x241598[_0xfef0('0x158')]=_0x30110f[_0xfef0('0xc5')];}else{_0x241598[_0xfef0('0x159')]=_0x30110f['CampaignId'];}for(var _0xd1d522 in _0x30110f['Contact']){if(_0x30110f[_0xfef0('0x142')]['hasOwnProperty'](_0xd1d522)){if(isNotNull(_0x30110f[_0xfef0('0x142')][_0xd1d522])&&_0xd1d522!=='id'&&_0xd1d522!==_0xfef0('0x15a')&&_0xd1d522!==_0xfef0('0x15b')&&_0xd1d522!==_0xfef0('0x15c')){_0x241598[util['format'](_0xfef0('0x15d'),_0xfef0('0x15e'),_['toUpper'](_0xd1d522))]=_0x30110f[_0xfef0('0x142')][_0xd1d522];}}}var _0x159691=_0x1c0c90[_0xfef0('0xcb')](_0x1c6dbc[_0xfef0('0x6f')])?getCallerId(_0x1c6dbc['Trunk']['callerid'],_0x1c6dbc[_0xfef0('0x15f')],_0x1c6dbc[_0xfef0('0x160')]>0x0?getCallerIdRandom(_0x1c6dbc['dialOriginateCallerIdNumber'],_0x1c6dbc[_0xfef0('0x160')]):_0x1c6dbc[_0xfef0('0x5b')]):getCallerId(_[_0xfef0('0xa0')](_0x1c6dbc[_0xfef0('0x117')])?_0x1c6dbc['Trunk'][_0xfef0('0x71')]:_0x1c6dbc[_0xfef0('0x117')][_0xfef0('0x71')],_0x1c6dbc[_0xfef0('0x15f')],_0x1c6dbc[_0xfef0('0x160')]>0x0?getCallerIdRandom(_0x1c6dbc[_0xfef0('0x5b')],_0x1c6dbc[_0xfef0('0x160')]):_0x1c6dbc['dialOriginateCallerIdNumber']);if(_0x159691){_0x241598[_0xfef0('0x161')]=_0x1c0c90[_0xfef0('0x28')][_0x461fe7][_0xfef0('0x162')]=extractCalleridName(_0x159691);_0x241598[_0xfef0('0x163')]=_0x1c0c90[_0xfef0('0x28')][_0x461fe7][_0xfef0('0x164')]=extractCalleridNumber(_0x159691);}return ami[_0xfef0('0xa1')]({'actionid':_0x461fe7,'action':'originate','channel':_0x1c0c90[_0xfef0('0xcb')](_0x1c6dbc[_0xfef0('0x6f')])?util[_0xfef0('0x76')]('SIP/%s/%s%s',_0x1c6dbc[_0xfef0('0x6f')]['name'],isNotNull(_0x1c6dbc[_0xfef0('0x165')])?_0x1c6dbc[_0xfef0('0x165')][_0xfef0('0x166')]()||'':'',_0x1c6dbc['dialCutDigit']>0x0?_0x30110f[_0xfef0('0x142')][_0xfef0('0x143')][_0xfef0('0x167')](_0x1c6dbc['dialCutDigit']):_0x30110f[_0xfef0('0x142')][_0xfef0('0x143')]):util['format']('SIP/%s/%s%s',_[_0xfef0('0xa0')](_0x1c6dbc[_0xfef0('0x117')])?_0x1c6dbc['Trunk'][_0xfef0('0x40')]:_0x1c6dbc[_0xfef0('0x117')][_0xfef0('0x40')],isNotNull(_0x1c6dbc[_0xfef0('0x165')])?_0x1c6dbc['dialPrefix'][_0xfef0('0x166')]()||'':'',_0x1c6dbc[_0xfef0('0x168')]>0x0?_0x30110f[_0xfef0('0x142')]['phone'][_0xfef0('0x167')](_0x1c6dbc[_0xfef0('0x168')]):_0x30110f[_0xfef0('0x142')][_0xfef0('0x143')]),'callerid':_0x159691,'Exten':_0xfef0('0xd2'),'Context':_0xfef0('0x169'),'Priority':'1','variable':_0x241598,'timeout':(_0x1c6dbc[_0xfef0('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x461fe7})[_0xfef0('0xaa')](function(_0x423eca){return _0x479a8b(_0x423eca);})['catch'](function(_0x405462){_0x1c6dbc[_0xfef0('0x65')]+=0x1;var _0x3232a6=new History(_0x1c0c90[_0xfef0('0x28')][_0x461fe7]);logger[_0xfef0('0x87')](util[_0xfef0('0x76')](_0xfef0('0x16a'),JSON[_0xfef0('0x4b')](_0x405462)));_0x3232a6['state']=0xe;_0x3232a6[_0xfef0('0x9a')]=_0xfef0('0x16b');_0x3232a6['starttime']=moment()[_0xfef0('0x76')](_0xfef0('0xed'));_0x3232a6[_0xfef0('0x9b')]=_0x3232a6['starttime'];_0x1c0c90[_0xfef0('0xba')](_0x3232a6)['catch'](loggerCatch(_0xfef0('0x16c')));_0x1c0c90[_0xfef0('0xb8')](_0x3232a6)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0x1c0c90['actions'][_0x461fe7];return _0x57f586(msgResponse(_0xfef0('0x140'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xfef0('0x9f')][_0xfef0('0x31')]=function(_0xbab3af){var _0x1b687a=this[_0xfef0('0x28')][_0xbab3af[_0xfef0('0xfd')]];var _0x1d044b=this;if(_0x1b687a){delete this[_0xfef0('0x28')][_0xbab3af['actionid']];_0x1b687a[_0xfef0('0xf3')]=moment()[_0xfef0('0x76')](_0xfef0('0xed'));var _0x291109=_0x1b687a[_0xfef0('0x74')]===_0xfef0('0x75')?this[_0xfef0('0x24')][_0x1b687a[_0xfef0('0xa6')]]:this['voiceQueues'][_0x1b687a[_0xfef0('0x16d')]()];if(!this[_0xfef0('0xc9')](_0xbab3af[_0xfef0('0x16e')])){this[_0xfef0('0xa5')](_0x291109);return this[_0xfef0('0x16f')](_0x1b687a,_0x291109,_0xbab3af)['then'](function(_0x49d0a5){})[_0xfef0('0xa3')](loggerCatch('[callProgressDetecting]\x20'));}else{this['uniqueId'][_0xbab3af[_0xfef0('0xcf')]]=_0x1b687a;}}};Dialer[_0xfef0('0x9f')][_0xfef0('0x170')]=function(_0x474362,_0x5084da,_0x1e6e48){var _0x5b6072=new History(_0x5084da);if(_0x5b6072[_0xfef0('0x171')]+_0x5b6072['countcongestionretry']+_0x5b6072['countnoanswerretry']>=_0x1e6e48[_0xfef0('0x172')]-0x1){return!![];}switch(_0x474362){case 0x3:if(_0x5b6072[_0xfef0('0x173')]>=_0x1e6e48[_0xfef0('0x174')]-0x1){return!![];}else{this[_0xfef0('0xb1')]({'active':![],'countnoanswerretry':_0x5b6072[_0xfef0('0x173')]+=0x1,'scheduledat':moment()[_0xfef0('0x175')](_0x1e6e48[_0xfef0('0x176')],_0xfef0('0x177'))[_0xfef0('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b6072['ContactId'],'ListId':_0x5b6072[_0xfef0('0xc3')],'VoiceQueueId':_0x5b6072[_0xfef0('0xc5')]||undefined,'CampaignId':_0x5b6072['CampaignId']||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x178')));}break;case 0x5:if(_0x5b6072[_0xfef0('0x171')]>=_0x1e6e48['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xfef0('0xb1')]({'active':![],'countbusyretry':_0x5b6072['countbusyretry']+=0x1,'scheduledat':moment()[_0xfef0('0x175')](_0x1e6e48[_0xfef0('0x179')],_0xfef0('0x177'))[_0xfef0('0x76')](_0xfef0('0xed')),'ContactId':_0x5b6072['ContactId'],'ListId':_0x5b6072['ListId'],'VoiceQueueId':_0x5b6072['VoiceQueueId']||undefined,'CampaignId':_0x5b6072[_0xfef0('0xc6')]||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x17a')));}break;case 0x8:if(_0x5b6072[_0xfef0('0x17b')]>=_0x1e6e48['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0xfef0('0xb1')]({'active':![],'countcongestionretry':_0x5b6072[_0xfef0('0x17b')]+=0x1,'scheduledat':moment()[_0xfef0('0x175')](_0x1e6e48[_0xfef0('0x17c')],'minutes')[_0xfef0('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b6072[_0xfef0('0xc2')],'ListId':_0x5b6072['ListId'],'VoiceQueueId':_0x5b6072[_0xfef0('0xc5')]||undefined,'CampaignId':_0x5b6072['CampaignId']||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x17d')));}break;default:return!![];}};Dialer[_0xfef0('0x9f')][_0xfef0('0x16f')]=function(_0x3c0550,_0x368465,_0x43faeb){var _0x37e06f=this;var _0x54ba13=new History(_0x3c0550);return new BPromise(function(_0x13a8fd,_0x5e66c8){if(_[_0xfef0('0x3f')](_0x368465)&&_0xfef0('0x13f')!==typeof _0x368465){return _0x5e66c8(msgResponse(_0xfef0('0x17e'),_0xfef0('0x11d'),_0xfef0('0x17f')));}if(_[_0xfef0('0x3f')](_0x43faeb)&&_0xfef0('0x13f')!==typeof _0x43faeb){return _0x5e66c8(msgResponse('[callProgressDetecting]','Failure',_0xfef0('0x180')));}switch(_0x43faeb[_0xfef0('0xeb')]){case'0':_0x368465[_0xfef0('0x64')]+=0x1;_0x54ba13[_0xfef0('0x99')]=0x0;_0x54ba13['statedesc']=_0xfef0('0x181');_0x37e06f['createHistory'](_0x54ba13)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x182')));if(_0x37e06f[_0xfef0('0x170')](0x0,_0x3c0550,_0x368465)){if(_0x54ba13[_0xfef0('0x171')]+_0x54ba13[_0xfef0('0x17b')]+_0x54ba13[_0xfef0('0x173')]>=_0x368465[_0xfef0('0x172')]){_0x37e06f[_0xfef0('0x183')](_0x54ba13,_0x13a8fd,_0x5e66c8,_0xfef0('0x184'));}else{_0x37e06f[_0xfef0('0x185')](_0x54ba13,_0x13a8fd,_0x5e66c8,_0xfef0('0x184'));}}break;case'3':_0x368465[_0xfef0('0x63')]+=0x1;_0x54ba13[_0xfef0('0x99')]=0x3;_0x54ba13['statedesc']='NoAnswer';_0x54ba13[_0xfef0('0x173')]+=0x1;_0x54ba13[_0xfef0('0x186')]+=0x1;_0x37e06f[_0xfef0('0xba')](_0x54ba13)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x187')));if(_0x37e06f[_0xfef0('0x170')](0x3,_0x3c0550,_0x368465)){if(_0x54ba13[_0xfef0('0x173')]>=_0x368465[_0xfef0('0x174')]){_0x37e06f[_0xfef0('0x185')](_0x54ba13,_0x13a8fd,_0x5e66c8,_0xfef0('0x188'));}else{_0x37e06f['stateGlobal'](_0x54ba13,_0x13a8fd,_0x5e66c8,_0xfef0('0x188'));}}break;case'5':_0x368465[_0xfef0('0x5e')]+=0x1;_0x54ba13[_0xfef0('0x99')]=0x5;_0x54ba13['statedesc']=_0xfef0('0x189');_0x54ba13[_0xfef0('0x171')]+=0x1;_0x54ba13[_0xfef0('0x186')]+=0x1;_0x37e06f['createHistory'](_0x54ba13)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x18a')));if(_0x37e06f[_0xfef0('0x170')](0x5,_0x3c0550,_0x368465)){if(_0x54ba13[_0xfef0('0x171')]>=_0x368465[_0xfef0('0x18b')]){_0x37e06f[_0xfef0('0x185')](_0x54ba13,_0x13a8fd,_0x5e66c8,'reason\x205\x20busy');}else{_0x37e06f[_0xfef0('0x183')](_0x54ba13,_0x13a8fd,_0x5e66c8,_0xfef0('0x18c'));}}break;case'8':_0x368465[_0xfef0('0x5f')]+=0x1;_0x54ba13[_0xfef0('0x99')]=0x8;_0x54ba13[_0xfef0('0x9a')]=_0xfef0('0x18d');_0x54ba13[_0xfef0('0x17b')]+=0x1;_0x54ba13[_0xfef0('0x186')]+=0x1;_0x37e06f['createHistory'](_0x54ba13)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x18e')));if(_0x37e06f['checkRetriveMax'](0x8,_0x3c0550,_0x368465)){if(_0x54ba13[_0xfef0('0x17b')]>=_0x368465[_0xfef0('0x18f')]){_0x37e06f['createStateFinal'](_0x54ba13,_0x13a8fd,_0x5e66c8,_0xfef0('0x190'));}else{_0x37e06f[_0xfef0('0x183')](_0x54ba13,_0x13a8fd,_0x5e66c8,'reason\x208\x20congestion');}}break;default:_0x368465[_0xfef0('0xe7')]+=0x1;_0x54ba13['state']=0xc;_0x54ba13[_0xfef0('0x9a')]=_0x43faeb['reason'];_0x37e06f[_0xfef0('0xba')](_0x54ba13)[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x191')));if(_0x37e06f[_0xfef0('0x170')](_0x43faeb[_0xfef0('0xeb')],_0x3c0550,_0x368465)){if(_0x54ba13['countbusyretry']+_0x54ba13[_0xfef0('0x17b')]+_0x54ba13['countnoanswerretry']>=_0x368465[_0xfef0('0x172')]){_0x37e06f['stateGlobal'](_0x54ba13,_0x13a8fd,_0x5e66c8,_0x43faeb['reason']);}else{_0x37e06f['createStateFinal'](_0x54ba13,_0x13a8fd,_0x5e66c8,_0x43faeb[_0xfef0('0xeb')]);}}}});};Dialer[_0xfef0('0x9f')][_0xfef0('0x183')]=function(_0x31755c,_0x563455,_0x210712,_0x41a26f){var _0x39a0fa=new Final(_0x31755c);_0x39a0fa['state']=0xf;_0x39a0fa[_0xfef0('0x9a')]=_0xfef0('0x192');this[_0xfef0('0x185')](_0x39a0fa,_0x563455,_0x210712,_0x41a26f);};Dialer[_0xfef0('0x9f')][_0xfef0('0x185')]=function(_0x508357,_0x2e38a2,_0x4ec9cd,_0x32cee0){this['moveContactManagedDialer'](_0x508357)[_0xfef0('0xaa')](function(_0x5b3544){return _0x2e38a2(msgResponse(_0xfef0('0x17e'),_0xfef0('0xca'),_0x32cee0));})[_0xfef0('0xa3')](function(_0x2835f3){return _0x4ec9cd(msgResponse(_0xfef0('0x193'),_0xfef0('0x11d'),_0xfef0('0x194')));});};Dialer[_0xfef0('0x9f')][_0xfef0('0x8')]=function(_0x54af3f){var _0x3add9c=this;var _0x553ead=_0x54af3f[_0xfef0('0x195')]/0x64;var _0x3425fe=_0x54af3f[_0xfef0('0x62')]/(_0x54af3f[_0xfef0('0x62')]+_0x54af3f[_0xfef0('0x5d')]);var _0xd9871f=_0x54af3f[_0xfef0('0x52')]-_0x54af3f['predictiveIntervalPauses']-_0x54af3f['waiting']-_0x54af3f['originated']-_0x54af3f[_0xfef0('0x54')];var _0x31920c=(_0x54af3f[_0xfef0('0x52')]-_0x54af3f['predictiveIntervalPauses'])*_0x54af3f['predictiveIntervalLowerLimit'];var _0x33e1b7=Math[_0xfef0('0x196')](_0x54af3f[_0xfef0('0x197')]*_0x54af3f['erlangAbandonmentRate']*_0x54af3f[_0xfef0('0x6b')]*_0x54af3f[_0xfef0('0x6d')]);if(_[_0xfef0('0x3f')](_0x54af3f[_0xfef0('0x82')])){loggerPredictive[_0xfef0('0x79')](_0xfef0('0x198'));if(!_[_0xfef0('0x3f')](_0x54af3f[_0xfef0('0x2b')])){_0x54af3f[_0xfef0('0x2b')]=undefined;loggerPredictive[_0xfef0('0x87')](_0xfef0('0x199'),_0xfef0('0x19a'));}if(!_['isUndefined'](_0x54af3f[_0xfef0('0x83')])){loggerPredictive['error'](_0xfef0('0x199'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x54af3f['handlePredictive']);_0x54af3f[_0xfef0('0x83')]=undefined;}_0x54af3f['startProgressive']=moment()[_0xfef0('0x76')](_0xfef0('0xed'));loggerPredictive[_0xfef0('0x79')](_0xfef0('0x19b'),_0x54af3f[_0xfef0('0x82')],_0x54af3f[_0xfef0('0x40')]);this[_0xfef0('0x12e')](_0x54af3f,0x1);}else if(ifInterval(_0x54af3f[_0xfef0('0x19c')],_0x54af3f[_0xfef0('0x82')])){this['handlePower'](_0x54af3f,0x1);loggerPredictiveCalls['info'](_0xfef0('0x19d'),_0x54af3f[_0xfef0('0x82')],_0x54af3f[_0xfef0('0x40')]);_0x54af3f[_0xfef0('0x197')]=0x0;_0x54af3f[_0xfef0('0x6a')]=0x0;}else if(_0x553ead<_0x3425fe&&_0x54af3f[_0xfef0('0x19e')]===_0xfef0('0x19f')){freeVariablesPredictive(_0x54af3f);loggerPredictive[_0xfef0('0x79')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xfef0('0x1a0'),_0x3425fe,_0xfef0('0x82'),_0x54af3f[_0xfef0('0x40')]);}else if(_0xd9871f>_0x31920c){freeVariablesPredictive(_0x54af3f);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][LowerLimitInterval]','Agent\x20free',_0xd9871f,'agent\x20max\x20free\x20',_0x31920c);}else if(_0x33e1b7<_0x54af3f[_0xfef0('0x6a')]&&_0x54af3f['dialPredictiveOptimization']===_0xfef0('0x19f')){freeVariablesPredictive(_0x54af3f);loggerPredictive[_0xfef0('0x79')](_0xfef0('0x1a1'),_0xfef0('0x1a2'),_0x33e1b7,_0xfef0('0x1a3'),_0x54af3f['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x54af3f['name']);}else if(!ifInterval(_0x54af3f[_0xfef0('0x19c')],_0x54af3f[_0xfef0('0x82')])&&_[_0xfef0('0x3f')](_0x54af3f[_0xfef0('0x2b')])&&!_[_0xfef0('0x3f')](_0x54af3f[_0xfef0('0x82')])){_0x54af3f[_0xfef0('0x2b')]=moment()[_0xfef0('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xfef0('0x79')](_0xfef0('0x1a4'),_0x54af3f[_0xfef0('0x2b')],_0x54af3f[_0xfef0('0x40')]);this[_0xfef0('0xaf')](_0x54af3f[_0xfef0('0x19c')])[_0xfef0('0xaa')](this[_0xfef0('0x1a5')](_0x54af3f))['then'](mergeDataErlangB(_0x54af3f))[_0xfef0('0xaa')](this[_0xfef0('0x1a6')](_0x54af3f))[_0xfef0('0xa3')](loggerCatchPredictive(_0xfef0('0x1a7'),_0x54af3f));}else if(!ifInterval(_0x54af3f['dialPredictiveInterval'],_0x54af3f[_0xfef0('0x2b')])){_0x54af3f[_0xfef0('0x6a')]=0x0;_0x54af3f[_0xfef0('0x2b')]=moment()[_0xfef0('0x76')](_0xfef0('0xed'));loggerPredictive[_0xfef0('0x79')](_0xfef0('0x1a8'),_0x54af3f[_0xfef0('0x2b')],_0x54af3f[_0xfef0('0x40')]);clearInterval(_0x54af3f[_0xfef0('0x83')]);_0x54af3f['handlePredictive']=undefined;this[_0xfef0('0xaf')](_0x54af3f[_0xfef0('0x19c')])['then'](this[_0xfef0('0x1a5')](_0x54af3f))['then'](mergeDataErlangB(_0x54af3f))[_0xfef0('0xaa')](this[_0xfef0('0x1a6')](_0x54af3f))['catch'](loggerCatchPredictive('[averageHandleTime][ErlangB]\x20',_0x54af3f));}};Dialer[_0xfef0('0x9f')][_0xfef0('0x1a5')]=function(_0xf45397){var _0x50bdbd=this;return function(_0x4beb2b){return new BPromise(function(_0x168a7c,_0x43c767){_[_0xfef0('0x7f')](_0xf45397,_0x4beb2b[0x0]);if(checkGetDataPredictive(_0x4beb2b[0x0])){loggerPredictive[_0xfef0('0x79')](JSON[_0xfef0('0x4b')](_0x4beb2b[0x0]));if(_0xf45397[_0xfef0('0x19e')]===_0xfef0('0x19f')){return _0x50bdbd['getVoiceQueueRtPauses'](_0xf45397['id'])[_0xfef0('0xaa')](function(_0xbe3fec){var _0xa0fa6d=_0xf45397['loggedIn']-_0xbe3fec[0x0][_0xfef0('0x1a9')];var _0x232b2b=_0xf45397['dialPredictiveInterval']*0x3c;var _0x20185d=_0x4beb2b[0x0][_0xfef0('0x68')]+_0x4beb2b[0x0][_0xfef0('0x67')];var _0x4cdb12=(_0x4beb2b[0x0][_0xfef0('0x1aa')]+_0x4beb2b[0x0][_0xfef0('0x69')]+_0x4beb2b[0x0][_0xfef0('0x1ab')])/_0x4beb2b[0x0][_0xfef0('0x6e')];var _0x465628=_0xf45397[_0xfef0('0x195')]/0x64;_0xf45397[_0xfef0('0x1ac')]=_0xbe3fec[0x0]['outboundQueuePauses']||0x0;_0xf45397[_0xfef0('0x6b')]=_0x4cdb12>0x0?_0x4cdb12:0x1;return _0x50bdbd[_0xfef0('0x1ad')](_0xa0fa6d,_0x232b2b,_0x20185d,_0x4cdb12,_0x465628);})[_0xfef0('0xaa')](function(_0x65aa74){return _0x168a7c(_0x65aa74);})['catch'](function(_0x115e43){return _0x43c767(msgResponse('[CatchErlangB]','Failure',JSON[_0xfef0('0x4b')](_0x115e43)));});}if(_0xf45397[_0xfef0('0x19e')]==='agentBusyFactor'){return _0x50bdbd[_0xfef0('0xb6')](_0xf45397['id'])[_0xfef0('0xaa')](function(_0x12edbe){var _0x51f688=_0xf45397[_0xfef0('0x52')]-_0x12edbe[0x0][_0xfef0('0x1a9')];var _0xc40057=_0xf45397['dialPredictiveInterval']*0x3c;var _0x29f395=_0x4beb2b[0x0][_0xfef0('0x68')]+_0x4beb2b[0x0][_0xfef0('0x67')];var _0x4aed01=(_0x4beb2b[0x0]['predictiveIntervalAnsweredCalls']+_0x4beb2b[0x0][_0xfef0('0x69')]+_0x4beb2b[0x0][_0xfef0('0x1ab')])/_0x4beb2b[0x0][_0xfef0('0x6e')];var _0x564887=_0xf45397[_0xfef0('0x195')]/0x64;_0xf45397[_0xfef0('0x1ac')]=_0x12edbe[0x0][_0xfef0('0x1a9')]||0x0;_0xf45397[_0xfef0('0x6b')]=_0x4aed01>0x0?_0x4aed01:0x1;return _0x50bdbd[_0xfef0('0x1ae')](_0x51f688,_0xc40057,_0x29f395,_0x4aed01,_0x564887);})[_0xfef0('0xaa')](function(_0x287aec){return _0x168a7c(_0x287aec);})['catch'](function(_0x223282){return _0x43c767(msgResponse(_0xfef0('0x1af'),_0xfef0('0x11d'),JSON['stringify'](_0x223282)));});}}else{return _0x43c767(msgResponse(_0xfef0('0x1b0'),'Failure',_0xfef0('0x1b1')));}});};};Dialer[_0xfef0('0x9f')][_0xfef0('0x1a6')]=function(_0x2cab6e){var _0x53b208=this;return function(){var _0x3def54=0x0;var _0x42127d=Math[_0xfef0('0x196')](_0x2cab6e['erlangCallToSecond']*0x3e8);if(_0x42127d>0x0){_0x42127d=_0x42127d<0x64?0x64:_0x42127d;loggerPredictive[_0xfef0('0x79')](_0xfef0('0x1b2'),_0x42127d);_0x2cab6e[_0xfef0('0x83')]=setInterval(function(){_0x53b208[_0xfef0('0x83')](_0x2cab6e);loggerPredictiveCalls['info'](_0xfef0('0x1b3'),_0x3def54+=0x1);},_0x42127d);}else{loggerPredictive[_0xfef0('0x79')](_0xfef0('0x1b4'),_0xfef0('0x1b5'),_0x42127d);}};};Dialer[_0xfef0('0x9f')]['checkContactBlack']=function(_0x173966,_0x59b067){var _0x2b669c=this;return function(_0x52b436){if(_['isEmpty'](_0x52b436)){if(_[_0xfef0('0xa0')](_0x59b067[_0xfef0('0xc4')])||!_0x59b067[_0xfef0('0x1b6')]){if(_0x173966['dialMethod']===_0xfef0('0x7')){_0x173966[_0xfef0('0x103')]=_[_0xfef0('0x3f')](_0x173966['queueStatusComplete'])?!![]:_0x173966[_0xfef0('0x103')];var _0x2e29bb=uuid['v4']();_0x2b669c[_0xfef0('0x28')][_0x2e29bb]=new Action(_0x173966,_0x59b067,_0x2e29bb);loggerBooked[_0xfef0('0x79')](_0xfef0('0x1b7'),_0x2e29bb,'queueStatusComplete:\x20',JSON[_0xfef0('0x4b')](_0x173966[_0xfef0('0x103')]),'Queue:\x20',_0x173966[_0xfef0('0x40')]);if(_0x173966['queueStatusComplete']){_0x173966[_0xfef0('0x103')]=![];_0x2b669c[_0xfef0('0x2d')][_0x2b669c[_0xfef0('0x28')][_0x2e29bb][_0xfef0('0xa6')]]=[];ami[_0xfef0('0xa1')]({'actionid':_0x2e29bb,'action':_0xfef0('0x1b8'),'queue':_0x173966[_0xfef0('0x40')]})['catch'](function(_0x5aaf10){_0x2b669c[_0xfef0('0xa5')](_0x173966);_0x2b669c[_0xfef0('0xb1')]({'active':![],'ContactId':_0x2b669c[_0xfef0('0x28')][_0x2e29bb][_0xfef0('0xc2')],'ListId':_0x2b669c[_0xfef0('0x28')][_0x2e29bb][_0xfef0('0xc3')],'VoiceQueueId':_0x2b669c['actions'][_0x2e29bb][_0xfef0('0xc5')]||undefined,'CampaignId':_0x2b669c['actions'][_0x2e29bb]['CampaignId']||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x1b9')));delete _0x2b669c[_0xfef0('0x28')][_0x2e29bb];});}else{loggerBooked[_0xfef0('0x79')](_0xfef0('0x1ba'),JSON[_0xfef0('0x4b')](_0x173966[_0xfef0('0x103')]),_0xfef0('0x1bb'),_0x173966[_0xfef0('0x40')]);_0x2b669c[_0xfef0('0xa5')](_0x173966);_0x2b669c[_0xfef0('0xb1')]({'active':![],'ContactId':_0x2b669c[_0xfef0('0x28')][_0x2e29bb][_0xfef0('0xc2')],'ListId':_0x2b669c[_0xfef0('0x28')][_0x2e29bb][_0xfef0('0xc3')],'VoiceQueueId':_0x2b669c[_0xfef0('0x28')][_0x2e29bb]['VoiceQueueId']||undefined,'CampaignId':_0x2b669c[_0xfef0('0x28')][_0x2e29bb][_0xfef0('0xc6')]||undefined})['catch'](loggerCatch(_0xfef0('0x1b9')));delete _0x2b669c[_0xfef0('0x28')][_0x2e29bb];}}else{return _0x2b669c[_0xfef0('0x13e')](_0x173966,_0x59b067);}}else{if(getDiff(_0x59b067[_0xfef0('0x1bc')])<_0x173966[_0xfef0('0x1bd')]*0x3c){_0x2b669c[_0xfef0('0x22')][_0xfef0('0x106')](_0x59b067['id'])[_0xfef0('0x20')](function(){_0x2b669c[_0xfef0('0xa5')](_0x173966);});}else{_0x173966['outboundReCallsDay']+=0x1;_0x2b669c[_0xfef0('0xa5')](_0x173966);if(_0x173966[_0xfef0('0x1be')]){_0x2b669c['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x59b067[_0xfef0('0xc2')],'ListId':_0x59b067[_0xfef0('0xc3')],'VoiceQueueId':_0x59b067[_0xfef0('0xc5')]||undefined,'CampaignId':_0x59b067[_0xfef0('0xc6')]||undefined})[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x1bf')));_0x2b669c['createHistory'](createObjHistory(_0x173966,_0x59b067,_0xfef0('0x1c0'),0x17,'RecallInQueue'))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x2b669c[_0xfef0('0xce')](createObjHistory(_0x173966,_0x59b067,_0xfef0('0x1c1'),0x16,_0xfef0('0x1c2')),'[Originate][HistoryRecallClose][historyCatch]',_0xfef0('0x1c3'));}}}}else{_0x173966[_0xfef0('0x1c4')]+=0x1;_0x2b669c['saveInDb'](createObjHistory(_0x173966,_0x59b067,_0xfef0('0x1c5'),0xd,_0xfef0('0x1c6')),_0xfef0('0x1c7'),'[Originate][MoveBlacklist]');throw _0xfef0('0x1c8');}};};Dialer[_0xfef0('0x9f')][_0xfef0('0x133')]=function(_0x58a984){var _0x3576d8=this;var _0x7169b5=[];var _0x549969=_0x58a984[_0xfef0('0x1c9')]-_0x58a984[_0xfef0('0x8b')]-_0x58a984['temp'];emitCampaignSummary(_0x58a984);if(_0x549969>0x0){if(_0x549969>this[_0xfef0('0x27')]){_0x549969=this[_0xfef0('0x27')];}_0x58a984[_0xfef0('0x1ca')]+=_0x549969;this['getContactDialerIvr'](_0x58a984['id'],_0x549969,_0x58a984[_0xfef0('0x1cb')])[_0xfef0('0xaa')](function(_0xf66ccc){_0x58a984[_0xfef0('0x1ca')]-=_0x549969;_0x58a984[_0xfef0('0x1ca')]=_0x58a984[_0xfef0('0x1ca')]>0x0?_0x58a984['temp']:0x0;if(!checkContactEmpty(_0xf66ccc)){_0x58a984[_0xfef0('0x45')]=_0xfef0('0x92');logger['info']('[getContactCampaign2][Empty]'+_0x58a984[_0xfef0('0x40')]);}else{_0x58a984[_0xfef0('0x8b')]+=_0xf66ccc[_0xfef0('0x89')];_0x58a984[_0xfef0('0x45')]=_0xfef0('0x1cc');for(var _0x3e6d08=0x0;_0x3e6d08<_0xf66ccc[_0xfef0('0x89')];_0x3e6d08+=0x1){_0x58a984[_0xfef0('0x1cd')]+=0x1;if(_['isNil'](_0xf66ccc[_0x3e6d08])||_['isNil'](_0xf66ccc[_0x3e6d08][_0xfef0('0x142')])||_[_0xfef0('0xa0')](_0xf66ccc[_0x3e6d08][_0xfef0('0x142')]['phone'])){_0x3576d8[_0xfef0('0xbf')](_0xfef0('0x1ce'),_0x58a984,_0xf66ccc[_0x3e6d08]);}else{_0x3576d8['checkIsBlackListIvr'](_[_0xfef0('0xc1')](_0xf66ccc[_0x3e6d08],['CampaignId',_0xfef0('0x1cf')]))[_0xfef0('0xaa')](_0x3576d8[_0xfef0('0x1d0')](_0x58a984,_0xf66ccc[_0x3e6d08]))[_0xfef0('0xa3')](_0x3576d8['loggerHandler'](_0xfef0('0x1d1'),_0x58a984));}}}})[_0xfef0('0xa3')](loggerGetContactDialer(_0xfef0('0x1d2'),_0x58a984,_0x549969));}};Dialer[_0xfef0('0x9f')][_0xfef0('0x12e')]=function(_0x1aa985,_0x5a6310){var _0x5eab76=this;var _0x598625=[];var _0x45c86a=_0x5a6310>=0x1?_0x5a6310:0x1;var _0x29b9af=[];if(_0x1aa985[_0xfef0('0x5a')]===_0xfef0('0x7')){_0x45c86a=0x1;}var _0x4479f4=Math[_0xfef0('0x196')](_0x1aa985[_0xfef0('0x51')]*_0x45c86a)-_0x1aa985[_0xfef0('0x8b')]-_0x1aa985[_0xfef0('0x1ca')];emitVoiceQueueSummary(_0x1aa985);if(_0x1aa985[_0xfef0('0x1d3')]>0x0){var _0x2052eb=_0x1aa985[_0xfef0('0x1d3')]-_0x1aa985[_0xfef0('0x8b')]-_0x1aa985[_0xfef0('0x54')]-_0x1aa985[_0xfef0('0x1ca')]-_0x1aa985['pTalking'];if(_0x4479f4>_0x2052eb){_0x4479f4=_0x2052eb;}}if(_0x4479f4>0x0){if(_0x1aa985[_0xfef0('0x5a')]===_0xfef0('0x7')){_0x4479f4=0x1;}if(_0x4479f4>this[_0xfef0('0x27')]){_0x4479f4=this[_0xfef0('0x27')];}_0x1aa985['temp']+=_0x4479f4;for(var _0x2ace2a in this[_0xfef0('0x25')]){if(this[_0xfef0('0x25')][_0xfef0('0x8a')](_0x2ace2a)){if(this['agents'][_0x2ace2a]['state']===_0xfef0('0x1d4')&&this['agents'][_0x2ace2a][_0xfef0('0xa2')]==='reachable'){_0x598625[_0xfef0('0x101')](this[_0xfef0('0x25')][_0x2ace2a]['id']);}}}this[_0xfef0('0xb3')](_0x1aa985['id'],_0x598625,_0x4479f4,_0x1aa985[_0xfef0('0x1cb')])[_0xfef0('0xaa')](function(_0x326c48){_0x1aa985[_0xfef0('0x1ca')]-=_0x4479f4;_0x1aa985[_0xfef0('0x1ca')]=_0x1aa985[_0xfef0('0x1ca')]>0x0?_0x1aa985['temp']:0x0;if(!checkContactEmpty(_0x326c48)){_0x5eab76[_0xfef0('0xab')](_0x1aa985)[_0xfef0('0xaa')](sendMessageReschedule(_0x1aa985))['catch'](loggerCatch(_0xfef0('0x1d5')));}else{_0x1aa985[_0xfef0('0x8b')]+=_0x326c48['length'];_0x1aa985[_0xfef0('0x45')]=_0x1aa985['dialMethod']==='booked'?'ACTIVE':_0xfef0('0x1cc');for(var _0x4fb60c=0x0;_0x4fb60c<_0x326c48[_0xfef0('0x89')];_0x4fb60c+=0x1){if(_['isNil'](_0x326c48[_0x4fb60c])||_[_0xfef0('0xa0')](_0x326c48[_0x4fb60c][_0xfef0('0x142')])||_[_0xfef0('0xa0')](_0x326c48[_0x4fb60c]['Contact'][_0xfef0('0x143')])){_0x5eab76[_0xfef0('0xbf')](_0xfef0('0x1ce'),_0x1aa985,_0x326c48[_0x4fb60c]);}else{_0x5eab76['checkIsBlackList'](_[_0xfef0('0xc1')](_0x326c48[_0x4fb60c],[_0xfef0('0xc5'),_0xfef0('0x1cf')]))['then'](_0x5eab76[_0xfef0('0x1d0')](_0x1aa985,_0x326c48[_0x4fb60c]))[_0xfef0('0xa3')](_0x5eab76[_0xfef0('0xbe')](_0xfef0('0x1ce'),_0x1aa985));}}}})['catch'](loggerGetContactDialer(_0xfef0('0x1d6'),_0x1aa985,_0x4479f4));}};Dialer[_0xfef0('0x9f')][_0xfef0('0x83')]=function(_0x5ef6ee){var _0x171315=this;if(_0x5ef6ee['dialLimitQueue']>0x0){var _0x327eb7=_0x5ef6ee[_0xfef0('0x1d3')]-_0x5ef6ee[_0xfef0('0x8b')]-_0x5ef6ee[_0xfef0('0x54')];if(_0x327eb7>0x0){this[_0xfef0('0x1d7')](_0x5ef6ee);}else{loggerPredictiveCalls['info'](_0xfef0('0x1d8'));}}else{this[_0xfef0('0x1d7')](_0x5ef6ee);}};Dialer['prototype'][_0xfef0('0x1d7')]=function(_0x305343){var _0x33ac5f=this;var _0x1fd268=[];_0x305343[_0xfef0('0x8b')]+=0x1;for(var _0x152cd1 in this[_0xfef0('0x25')]){if(this[_0xfef0('0x25')][_0xfef0('0x8a')](_0x152cd1)){if(this[_0xfef0('0x25')][_0x152cd1]['state']===_0xfef0('0x1d4')&&this['agents'][_0x152cd1][_0xfef0('0xa2')]===_0xfef0('0x1d9')){_0x1fd268[_0xfef0('0x101')](this[_0xfef0('0x25')][_0x152cd1]['id']);}}}this['getContactDialer'](_0x305343['id'],_0x1fd268,0x1,_0x305343['dialOrderByScheduledAt'])['then'](function(_0x32612d){if(!checkContactEmpty(_0x32612d)){checkContactLowerLimitOriginate(_0x305343,0x1,0x0);_0x33ac5f[_0xfef0('0xab')](_0x305343)[_0xfef0('0xaa')](sendMessageReschedule(_0x305343))[_0xfef0('0xa3')](loggerCatch(_0xfef0('0x1d5')));}else{_0x305343['message']=_0xfef0('0x1cc');if(_[_0xfef0('0xa0')](_0x32612d[0x0])||_[_0xfef0('0xa0')](_0x32612d[0x0][_0xfef0('0x142')])||_[_0xfef0('0xa0')](_0x32612d[0x0][_0xfef0('0x142')][_0xfef0('0x143')])){_0x33ac5f['emptyContact'](_0xfef0('0x1ce'),_0x305343,_0x32612d[0x0]);}else{_0x33ac5f['checkIsBlackList'](_['pick'](_0x32612d[0x0],[_0xfef0('0xc5'),_0xfef0('0x1cf')]))[_0xfef0('0xaa')](_0x33ac5f[_0xfef0('0x1d0')](_0x305343,_0x32612d[0x0]))['catch'](_0x33ac5f['loggerHandler'](_0xfef0('0x1da'),_0x305343));}}})[_0xfef0('0xa3')](loggerGetContactDialer(_0xfef0('0x1db'),_0x305343,0x1));emitVoiceQueueSummary(_0x305343);};Dialer[_0xfef0('0x9f')][_0xfef0('0x1ad')]=function(_0x28dcc4,_0x19d644,_0x56c44b,_0x82d78b,_0x3f0e15,_0x51ebbf){loggerPredictive['info'](_0xfef0('0x1dc'),_0xfef0('0x1dd'),_0x28dcc4,_0xfef0('0x1de'),_0x19d644,_0xfef0('0x1df'),_0x56c44b,_0xfef0('0x1e0'),_0x82d78b,_0xfef0('0x1e1'),_0x3f0e15);return new BPromise(function(_0x29822f,_0x4def09){if(_0x28dcc4<=0x0||isNaN(_0x28dcc4)){return _0x4def09(msgResponse(_0xfef0('0x1dc'),'Error','m\x20=\x20'+_0x28dcc4));}if(_0x56c44b<=0x0||isNaN(_0x56c44b)){return _0x4def09(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e2')+_0x56c44b));}if(_0x82d78b<=0x0||isNaN(_0x82d78b)){return _0x4def09(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e3')+_0x82d78b));}if(_0x19d644<=0x0||isNaN(_0x19d644)){return _0x4def09(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e4')+_0x19d644));}if(_0x3f0e15<=0x0||isNaN(_0x3f0e15)){return _0x4def09(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e5')+_0x3f0e15));}_0x51ebbf=_0x51ebbf||0x0;var _0x4ec06b=0x1/_0x56c44b;var _0x3e41b2=0x0;var _0x57ee48=0x0;var _0x2c62fb=0x0;var _0x3db533=0x0;for(var _0x5529bf=0x0;_0x2c62fb<_0x3f0e15;_0x5529bf+=0x1){_0x57ee48=_0x5529bf/_0x19d644;_0x3e41b2=(_0x82d78b*_0x57ee48+_0x51ebbf)/_0x4ec06b;_0x2c62fb=erlangb(_0x3e41b2,_0x28dcc4);_0x3db533=_0x3e41b2/_0x28dcc4*(0x1-erlangb(_0x3e41b2,_0x28dcc4));}return _0x29822f({'erlangCalls':_0x5529bf,'erlangCallToSecond':_0x19d644/_0x5529bf,'erlangAbandonmentRate':_0x2c62fb,'erlangBusyFactor':_0x3db533});});};Dialer['prototype'][_0xfef0('0x1ae')]=function(_0x5a1a44,_0x272bb2,_0x5cadfd,_0x4c8d5d,_0x5f5704,_0x34da67){loggerPredictive[_0xfef0('0x79')]('[busyFactor]',_0xfef0('0x1dd'),_0x5a1a44,_0xfef0('0x1de'),_0x272bb2,_0xfef0('0x1df'),_0x5cadfd,_0xfef0('0x1e0'),_0x4c8d5d,_0xfef0('0x1e6'),_0x5f5704);return new BPromise(function(_0x2ce1b2,_0xb8b3b7){if(_0x5a1a44<=0x0||isNaN(_0x5a1a44)){return _0xb8b3b7(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e7')+_0x5a1a44));}if(_0x5cadfd<=0x0||isNaN(_0x5cadfd)){return _0xb8b3b7(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e2')+_0x5cadfd));}if(_0x4c8d5d<=0x0||isNaN(_0x4c8d5d)){return _0xb8b3b7(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),'p\x20=\x20'+_0x4c8d5d));}if(_0x272bb2<=0x0||isNaN(_0x272bb2)){return _0xb8b3b7(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e4')+_0x272bb2));}if(_0x5f5704<=0x0||isNaN(_0x5f5704)){return _0xb8b3b7(msgResponse(_0xfef0('0x1dc'),_0xfef0('0x4a'),_0xfef0('0x1e5')+_0x5f5704));}_0x34da67=_0x34da67||0x0;var _0x18c8c3=0x1/_0x5cadfd;var _0x28469d=0x0;var _0x473253=0x0;var _0x2eba25=0x0;var _0x4fb81c=0x0;for(var _0x974dfa=0x0;_0x4fb81c<_0x5f5704;_0x974dfa+=0x1){_0x473253=_0x974dfa/_0x272bb2;_0x28469d=(_0x4c8d5d*_0x473253+_0x34da67)/_0x18c8c3;_0x2eba25=erlangb(_0x28469d,_0x5a1a44);_0x4fb81c=_0x28469d/_0x5a1a44*(0x1-erlangb(_0x28469d,_0x5a1a44));}return _0x2ce1b2({'erlangCalls':_0x974dfa,'erlangCallToSecond':_0x272bb2/_0x974dfa,'erlangAbandonmentRate':_0x2eba25,'erlangBusyFactor':_0x4fb81c});});};module[_0xfef0('0x1e8')]=Dialer;
\ No newline at end of file
index 0aa5a16..9032492 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19ea=['endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x19ea,0x19d));var _0xa19e=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x19ea[_0x487b0c];return _0x1adbdc;};'use strict';var util=require('util');var _=require(_0xa19e('0x0'));var moment=require(_0xa19e('0x1'));function getSeconds(_0x596006,_0x4d2736){var _0x578826=moment(_0x596006)[_0xa19e('0x2')](0x0);var _0x19714c=moment(_0x4d2736)[_0xa19e('0x2')](0x0);return _0x578826[_0xa19e('0x3')](_0x19714c,_0xa19e('0x4'));}function QueueCallerAbandon(_0x2bd9f7,_0x40c9bd){this[_0xa19e('0x5')]=_0x2bd9f7[_0xa19e('0x5')];this[_0xa19e('0x6')]=_0x2bd9f7[_0xa19e('0x6')];this[_0xa19e('0x7')]=_0x2bd9f7[_0xa19e('0x6')]===_0xa19e('0x8')?'queue':_0x2bd9f7[_0xa19e('0x6')];this[_0xa19e('0x9')]=_0x2bd9f7[_0xa19e('0x9')];this[_0xa19e('0xa')]=_0x2bd9f7['countcongestionretry'];this[_0xa19e('0xb')]=_0x2bd9f7['countnoanswerretry'];this['countglobal']=_0x2bd9f7[_0xa19e('0x9')]+_0x2bd9f7['countcongestionretry']+_0x2bd9f7[_0xa19e('0xb')];this[_0xa19e('0xc')]=_0x40c9bd['uniqueid'];this[_0xa19e('0xd')]=_0x2bd9f7['name'];this[_0xa19e('0xe')]=_0x2bd9f7[_0xa19e('0xf')];this[_0xa19e('0x10')]=_0x2bd9f7[_0xa19e('0x10')];this[_0xa19e('0x11')]=_0x2bd9f7[_0xa19e('0x11')];this[_0xa19e('0x12')]=_0x2bd9f7[_0xa19e('0x12')];this[_0xa19e('0x13')]=this[_0xa19e('0x12')];this[_0xa19e('0x14')]=getSeconds(_0x2bd9f7[_0xa19e('0x11')],_0x2bd9f7[_0xa19e('0x10')]);this[_0xa19e('0x15')]=getSeconds(this[_0xa19e('0x12')],_0x2bd9f7[_0xa19e('0x11')]);this['talktime']=0x0;this['queue']=_0x40c9bd['queue'];this[_0xa19e('0x16')]=_0x40c9bd[_0xa19e('0x17')];this[_0xa19e('0x18')]=_0x40c9bd[_0xa19e('0x18')];this[_0xa19e('0x19')]=_0x2bd9f7[_0xa19e('0x19')];this[_0xa19e('0x1a')]=_0x2bd9f7['callbackuniqueid'];this[_0xa19e('0x1b')]=_0x2bd9f7['callbackat'];this[_0xa19e('0x1c')]=_0x2bd9f7['recallme'];this[_0xa19e('0x1d')]=_0x2bd9f7[_0xa19e('0x1d')];this['ListId']=_0x2bd9f7[_0xa19e('0x1e')];this[_0xa19e('0x1f')]=_0x2bd9f7[_0xa19e('0x1f')];this[_0xa19e('0x20')]=_0x2bd9f7[_0xa19e('0x20')];this[_0xa19e('0x21')]=_0x2bd9f7[_0xa19e('0x21')];this['originatecalleridnum']=_0x2bd9f7['originatecalleridnum']||'';this[_0xa19e('0x22')]=_0x2bd9f7[_0xa19e('0x22')]||'';}module[_0xa19e('0x23')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x0584=['callbackuniqueid','callbackat','recallme','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback'];(function(_0x59af6c,_0x53347a){var _0xdd7b53=function(_0x253f5f){while(--_0x253f5f){_0x59af6c['push'](_0x59af6c['shift']());}};_0xdd7b53(++_0x53347a);}(_0x0584,0xe7));var _0x4058=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0584[_0x484e36];return _0xafc85d;};'use strict';var util=require(_0x4058('0x0'));var _=require(_0x4058('0x1'));var moment=require(_0x4058('0x2'));function getSeconds(_0x31523d,_0x4ef752){var _0x1057af=moment(_0x31523d)[_0x4058('0x3')](0x0);var _0x5d99be=moment(_0x4ef752)[_0x4058('0x3')](0x0);return _0x1057af[_0x4058('0x4')](_0x5d99be,_0x4058('0x5'));}function QueueCallerAbandon(_0x3e4a5b,_0x410487){this[_0x4058('0x6')]=_0x3e4a5b['scheduledat'];this[_0x4058('0x7')]=_0x3e4a5b['type'];this[_0x4058('0x8')]=_0x3e4a5b[_0x4058('0x7')]===_0x4058('0x9')?_0x4058('0xa'):_0x3e4a5b['type'];this[_0x4058('0xb')]=_0x3e4a5b['countbusyretry'];this[_0x4058('0xc')]=_0x3e4a5b[_0x4058('0xc')];this[_0x4058('0xd')]=_0x3e4a5b[_0x4058('0xd')];this[_0x4058('0xe')]=_0x3e4a5b['countbusyretry']+_0x3e4a5b[_0x4058('0xc')]+_0x3e4a5b['countnoanswerretry'];this[_0x4058('0xf')]=_0x410487[_0x4058('0xf')];this[_0x4058('0x10')]=_0x3e4a5b['name'];this['calleridnum']=_0x3e4a5b[_0x4058('0x11')];this[_0x4058('0x12')]=_0x3e4a5b[_0x4058('0x12')];this[_0x4058('0x13')]=_0x3e4a5b[_0x4058('0x13')];this[_0x4058('0x14')]=_0x3e4a5b[_0x4058('0x14')];this[_0x4058('0x15')]=this['droptime'];this[_0x4058('0x16')]=getSeconds(_0x3e4a5b[_0x4058('0x13')],_0x3e4a5b[_0x4058('0x12')]);this[_0x4058('0x17')]=getSeconds(this[_0x4058('0x14')],_0x3e4a5b[_0x4058('0x13')]);this['talktime']=0x0;this[_0x4058('0xa')]=_0x410487['queue'];this[_0x4058('0x18')]=_0x410487[_0x4058('0x19')];this[_0x4058('0x1a')]=_0x410487[_0x4058('0x1a')];this[_0x4058('0x1b')]=_0x3e4a5b['callback'];this['callbackuniqueid']=_0x3e4a5b[_0x4058('0x1c')];this[_0x4058('0x1d')]=_0x3e4a5b[_0x4058('0x1d')];this[_0x4058('0x1e')]=_0x3e4a5b[_0x4058('0x1e')];this['ContactId']=_0x3e4a5b['ContactId'];this[_0x4058('0x1f')]=_0x3e4a5b[_0x4058('0x1f')];this['UserId']=_0x3e4a5b['UserId'];this['VoiceQueueId']=_0x3e4a5b[_0x4058('0x20')];this[_0x4058('0x21')]=_0x3e4a5b['CampaignId'];this[_0x4058('0x22')]=_0x3e4a5b['originatecalleridnum']||'';this['originatecalleridname']=_0x3e4a5b[_0x4058('0x23')]||'';}module[_0x4058('0x24')]=QueueCallerAbandon;
\ No newline at end of file
index f6c00fe..ef74d88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52a6=['AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path'];(function(_0x13a0d6,_0x9a1972){var _0x241df1=function(_0x44fd40){while(--_0x44fd40){_0x13a0d6['push'](_0x13a0d6['shift']());}};_0x241df1(++_0x9a1972);}(_0x52a6,0xe3));var _0x652a=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0x52a6[_0x576266];return _0x18234f;};'use strict';var util=require(_0x652a('0x0'));var _=require(_0x652a('0x1'));var moment=require(_0x652a('0x2'));function Action(_0x173ca9,_0x4a5f55,_0x23ada8){this['uniqueid']=_0x173ca9||undefined;this[_0x652a('0x3')]=util[_0x652a('0x4')](_0x652a('0x5'),_0x4a5f55[_0x652a('0x6')],_0x4a5f55[_0x652a('0x7')][_0x652a('0x8')],_0x23ada8[_0x652a('0x9')]);this['localstationid']=_0x4a5f55[_0x652a('0xa')];this[_0x652a('0xb')]=_0x4a5f55['headerinfo'];this[_0x652a('0xc')]=_0x23ada8[_0x652a('0xc')];this[_0x652a('0xd')]=_0x23ada8[_0x652a('0xd')];}module[_0x652a('0xe')]=Action;
\ No newline at end of file
+var _0x62b1=['format','%s/%s/%s','tech','fax','localstationid','headerinfo','path','AttachmentId','util','lodash','moment','uniqueid'];(function(_0x4c08e9,_0x262f85){var _0x1245cf=function(_0x5346f4){while(--_0x5346f4){_0x4c08e9['push'](_0x4c08e9['shift']());}};_0x1245cf(++_0x262f85);}(_0x62b1,0xc8));var _0x162b=function(_0x3e7741,_0x89b127){_0x3e7741=_0x3e7741-0x0;var _0x209565=_0x62b1[_0x3e7741];return _0x209565;};'use strict';var util=require(_0x162b('0x0'));var _=require(_0x162b('0x1'));var moment=require(_0x162b('0x2'));function Action(_0x551527,_0x10dcc8,_0x572992){this[_0x162b('0x3')]=_0x551527||undefined;this['channel']=util[_0x162b('0x4')](_0x162b('0x5'),_0x10dcc8[_0x162b('0x6')],_0x10dcc8['Trunk']['name'],_0x572992[_0x162b('0x7')]);this[_0x162b('0x8')]=_0x10dcc8[_0x162b('0x8')];this['headerinfo']=_0x10dcc8[_0x162b('0x9')];this[_0x162b('0xa')]=_0x572992[_0x162b('0xa')];this[_0x162b('0xb')]=_0x572992[_0x162b('0xb')];}module['exports']=Action;
\ No newline at end of file
index eb0380e..f8d0f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cff=['uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','value','syncNewState','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','then','notify','.pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid'];(function(_0x2c05d1,_0x23f105){var _0xc49d97=function(_0x2b8125){while(--_0x2b8125){_0x2c05d1['push'](_0x2c05d1['shift']());}};_0xc49d97(++_0x23f105);}(_0x8cff,0xd2));var _0xf8cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cff[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf8cf('0x0'));var _=require(_0xf8cf('0x1'));var BPromise=require(_0xf8cf('0x2'));var uuid=require('uuid');var moment=require(_0xf8cf('0x3'));var path=require(_0xf8cf('0x4'));var tiff2pdf=require(_0xf8cf('0x5'));var gs=require(_0xf8cf('0x6'));var logger=require(_0xf8cf('0x7'))(_0xf8cf('0x8'));var ami=require(_0xf8cf('0x9'));var rpcDb=require(_0xf8cf('0xa'));var Channel=require(_0xf8cf('0xb'));var ut=require(_0xf8cf('0xc'));var Action=require(_0xf8cf('0xd'));var faxAccount=require(_0xf8cf('0xe'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xf8cf('0xf'));function Fax(_0x4322b2){this[_0xf8cf('0x10')]={};this[_0xf8cf('0x11')]=_0x4322b2[_0xf8cf('0x11')];this[_0xf8cf('0x12')]=_0x4322b2[_0xf8cf('0x12')];this[_0xf8cf('0x13')]={};ami['on']('newchannel',this[_0xf8cf('0x14')][_0xf8cf('0x15')](this));ami['on'](_0xf8cf('0x16'),this[_0xf8cf('0x17')]['bind'](this));ami['on'](_0xf8cf('0x18'),this['syncNewState'][_0xf8cf('0x15')](this));ami['on'](_0xf8cf('0x19'),this['syncNewExten'][_0xf8cf('0x15')](this));ami['on'](_0xf8cf('0x1a'),this['syncFaxStatus'][_0xf8cf('0x15')](this));ami['on'](_0xf8cf('0x1b'),this[_0xf8cf('0x1c')]['bind'](this));ami['on'](_0xf8cf('0x1d'),this['syncHangup']['bind'](this));ami['on'](_0xf8cf('0x1e'),this[_0xf8cf('0x1f')][_0xf8cf('0x15')](this));}Fax['prototype']['syncNewchannel']=function(_0x1e15e3){if(_0x1e15e3['context']===_0xf8cf('0x20')){for(var _0x28263d in this[_0xf8cf('0x11')]){if(this[_0xf8cf('0x11')][_0xf8cf('0x21')](_0x28263d)){if(_0x1e15e3[_0xf8cf('0x22')]===this[_0xf8cf('0x11')][_0x28263d][_0xf8cf('0x23')]){this[_0xf8cf('0x10')][_0x1e15e3[_0xf8cf('0x24')]]={};this['channels'][_0x1e15e3[_0xf8cf('0x24')]][_0xf8cf('0x25')]=_0x1e15e3['channel'];this['channels'][_0x1e15e3[_0xf8cf('0x24')]]['id']=this['faxAccounts'][_0x28263d]['id'];this[_0xf8cf('0x10')][_0x1e15e3[_0xf8cf('0x24')]]['name']=this['faxAccounts'][_0x28263d][_0xf8cf('0x26')];logger['info'](_0x1e15e3[_0xf8cf('0x24')],_0xf8cf('0x27'));}}}}if(this[_0xf8cf('0x13')][_0x1e15e3[_0xf8cf('0x24')]]){this[_0xf8cf('0x10')][_0x1e15e3[_0xf8cf('0x24')]]={};this[_0xf8cf('0x10')][_0x1e15e3[_0xf8cf('0x24')]][_0xf8cf('0x25')]=_0x1e15e3[_0xf8cf('0x25')];logger[_0xf8cf('0x28')](_0x1e15e3[_0xf8cf('0x24')],_0xf8cf('0x27'));}};Fax[_0xf8cf('0x29')][_0xf8cf('0x17')]=function(_0x27a5f3){if(this['channels'][_0x27a5f3['uniqueid']]){for(var _0x4b0277 in _0x27a5f3['variable']){if(_0x27a5f3[_0xf8cf('0x2a')]['hasOwnProperty'](_0x4b0277)){this['channels'][_0x27a5f3[_0xf8cf('0x24')]][_0x4b0277]=_0x27a5f3[_0xf8cf('0x2b')];}}}};Fax[_0xf8cf('0x29')][_0xf8cf('0x2c')]=function(_0x48da06){if(this['channels'][_0x48da06[_0xf8cf('0x24')]]){this['channels'][_0x48da06[_0xf8cf('0x24')]][_0xf8cf('0x2d')]=_0x48da06['channelstate'];this[_0xf8cf('0x10')][_0x48da06[_0xf8cf('0x24')]]['channelstatedesc']=_0x48da06[_0xf8cf('0x2e')];}};Fax[_0xf8cf('0x29')]['syncNewExten']=function(_0x4f218c){if(this['channels'][_0x4f218c[_0xf8cf('0x24')]]){for(var _0xd8a434 in _0x4f218c['variable']){if(_0x4f218c[_0xf8cf('0x2a')][_0xf8cf('0x21')](_0xd8a434)){this[_0xf8cf('0x10')][_0x4f218c[_0xf8cf('0x24')]][_0xd8a434]=_0x4f218c['value'];}}}};Fax[_0xf8cf('0x29')][_0xf8cf('0x2f')]=function(_0xa11fcb){if(this[_0xf8cf('0x10')][_0xa11fcb[_0xf8cf('0x24')]]){this[_0xf8cf('0x10')][_0xa11fcb['uniqueid']][_0xf8cf('0x30')]=_0xa11fcb[_0xf8cf('0x30')];this[_0xf8cf('0x10')][_0xa11fcb[_0xf8cf('0x24')]]['status']=_0xa11fcb[_0xf8cf('0x31')];this[_0xf8cf('0x10')][_0xa11fcb[_0xf8cf('0x24')]][_0xf8cf('0x23')]=_0xa11fcb[_0xf8cf('0x23')];this[_0xf8cf('0x10')][_0xa11fcb[_0xf8cf('0x24')]]['filename']=_0xa11fcb[_0xf8cf('0x32')];logger[_0xf8cf('0x28')](_0xa11fcb[_0xf8cf('0x24')],_0xf8cf('0x33'));}};Fax[_0xf8cf('0x29')][_0xf8cf('0x1c')]=function(_0x7b549d){var _0x412ea8=this;if(this['channels'][_0x7b549d[_0xf8cf('0x24')]]){var _0x4eae1a=this[_0xf8cf('0x10')][_0x7b549d[_0xf8cf('0x24')]]['id'];this[_0xf8cf('0x10')][_0x7b549d['uniqueid']][_0xf8cf('0x34')]=_0x7b549d['remotestationid'];this['channels'][_0x7b549d[_0xf8cf('0x24')]][_0xf8cf('0x35')]=_0x7b549d[_0xf8cf('0x35')];this[_0xf8cf('0x10')][_0x7b549d['uniqueid']][_0xf8cf('0x23')]=_0x7b549d[_0xf8cf('0x23')];this[_0xf8cf('0x10')][_0x7b549d[_0xf8cf('0x24')]]['resolution']=_0x7b549d[_0xf8cf('0x36')];this[_0xf8cf('0x10')][_0x7b549d[_0xf8cf('0x24')]][_0xf8cf('0x37')]=_0x7b549d[_0xf8cf('0x37')];this[_0xf8cf('0x10')][_0x7b549d['uniqueid']][_0xf8cf('0x32')]=_0x7b549d[_0xf8cf('0x32')];this[_0xf8cf('0x10')][_0x7b549d[_0xf8cf('0x24')]][_0xf8cf('0x38')]=_0x7b549d['calleridnum'];if(this['channels'][_0x7b549d[_0xf8cf('0x24')]][_0xf8cf('0x35')]>0x0){tiff2pdf(_0x7b549d['filename'],_0xf8cf('0x39'),function(_0x4c3d5a){logger[_0xf8cf('0x28')](_0x7b549d[_0xf8cf('0x24')],_0xf8cf('0x3a'),_0x4c3d5a[_0xf8cf('0x3b')]);attachment[_0xf8cf('0x3c')]({'name':path[_0xf8cf('0x3d')](_0x7b549d[_0xf8cf('0x32')])[_0xf8cf('0x26')],'basename':path[_0xf8cf('0x3d')](_0x7b549d[_0xf8cf('0x32')])['name']+'.pdf','type':'application/pdf'})[_0xf8cf('0x3e')](function(_0x3613c4){faxAccount[_0xf8cf('0x3f')](_0x4eae1a,{'from':_0x7b549d[_0xf8cf('0x38')],'mapKey':_0xf8cf('0x8'),'body':path[_0xf8cf('0x3d')](_0x7b549d[_0xf8cf('0x32')])['name']+_0xf8cf('0x40'),'AttachmentId':_0x3613c4['id']})[_0xf8cf('0x41')](function(_0x1385a6){logger['error'](_0x7b549d[_0xf8cf('0x24')],_0xf8cf('0x42'),JSON[_0xf8cf('0x43')](_0x1385a6));});})[_0xf8cf('0x41')](function(_0xdc0dcd){logger[_0xf8cf('0x44')](_0x7b549d[_0xf8cf('0x24')],_0xf8cf('0x45'),JSON[_0xf8cf('0x43')](_0xdc0dcd));});});}logger[_0xf8cf('0x28')](_0x7b549d['uniqueid'],_0xf8cf('0x45'));}};Fax['prototype']['syncOriginateResponse']=function(_0x5237aa){if(this[_0xf8cf('0x13')][_0x5237aa[_0xf8cf('0x24')]]){_['merge'](this[_0xf8cf('0x10')][_0x5237aa[_0xf8cf('0x24')]],_[_0xf8cf('0x46')](_0x5237aa,[_0xf8cf('0x47'),'reason']));}};function updateStatus(_0x3c680e){if(_0x3c680e[_0xf8cf('0x48')]){faxMessage[_0xf8cf('0x49')](_0x3c680e[_0xf8cf('0x48')],{'failMessage':_0xf8cf('0x4a')})[_0xf8cf('0x3e')](function(_0x3c393b){ut[_0xf8cf('0x4b')](_0xf8cf('0x4c'),_0x3c393b);})[_0xf8cf('0x41')](function(_0x567244){ut['logger'](_0xf8cf('0x4d'),_0x567244);});}else{ut[_0xf8cf('0x4b')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xf8cf('0x29')][_0xf8cf('0x4e')]=function(_0x594510,_0x2af17d,_0x1d51d7){var _0x327db4=this;var _0x2a468e={};if(_0x2af17d){_0x2a468e={'read':_0x2af17d};}else{_0x2a468e={'failMessage':_0x1d51d7};}if(this['actions'][_0x594510][_0xf8cf('0x48')]){faxMessage[_0xf8cf('0x49')](this[_0xf8cf('0x13')][_0x594510][_0xf8cf('0x48')],_0x2a468e)[_0xf8cf('0x3e')](function(_0x4db7fc){ut[_0xf8cf('0x4b')]('[Fax][Message][Updated]',_0x4db7fc);})[_0xf8cf('0x41')](function(_0x25e616){ut[_0xf8cf('0x4b')](_0xf8cf('0x4f'),_0x25e616);})[_0xf8cf('0x50')](function(){delete _0x327db4[_0xf8cf('0x10')][_0x594510];delete _0x327db4[_0xf8cf('0x13')][_0x594510];});}else{ut['logger'](_0xf8cf('0x51'));delete this[_0xf8cf('0x10')][_0x594510];delete this['actions'][_0x594510];}};Fax[_0xf8cf('0x29')][_0xf8cf('0x52')]=function(_0xd9a2ef){var _0xcf55bf=this;if(this[_0xf8cf('0x10')][_0xd9a2ef[_0xf8cf('0x24')]]){if(this[_0xf8cf('0x13')][_0xd9a2ef[_0xf8cf('0x24')]]){this[_0xf8cf('0x10')][_0xd9a2ef[_0xf8cf('0x24')]]['id']=this[_0xf8cf('0x13')][_0xd9a2ef[_0xf8cf('0x24')]]['id'];this['channels'][_0xd9a2ef[_0xf8cf('0x24')]][_0xf8cf('0x26')]=this[_0xf8cf('0x13')][_0xd9a2ef['uniqueid']]['name'];}logger[_0xf8cf('0x28')](_0xd9a2ef['uniqueid'],this[_0xf8cf('0x13')][_0xd9a2ef[_0xf8cf('0x24')]]?_0xf8cf('0x53'):_0xf8cf('0x54'),JSON[_0xf8cf('0x43')](this[_0xf8cf('0x10')][_0xd9a2ef[_0xf8cf('0x24')]]));if(this[_0xf8cf('0x13')][_0xd9a2ef[_0xf8cf('0x24')]]){if(this['channels'][_0xd9a2ef[_0xf8cf('0x24')]][_0xf8cf('0x55')]>0x0&&this[_0xf8cf('0x10')][_0xd9a2ef[_0xf8cf('0x24')]][_0xf8cf('0x1a')]===_0xf8cf('0x56')){this['updateStatus'](_0xd9a2ef[_0xf8cf('0x24')],!![]);}else{this[_0xf8cf('0x4e')](_0xd9a2ef['uniqueid'],![],this[_0xf8cf('0x10')][_0xd9a2ef[_0xf8cf('0x24')]][_0xf8cf('0x57')]?'SENDING\x20FAILED:\x20'+this[_0xf8cf('0x10')][_0xd9a2ef[_0xf8cf('0x24')]][_0xf8cf('0x57')]:'SENDING\x20FAILED');}}}};Fax[_0xf8cf('0x29')][_0xf8cf('0x58')]=function(_0x2ce6c4){var _0x3c28c2=this;return new BPromise(function(_0x142f81,_0x361f75){_0x3c28c2[_0xf8cf('0x59')](_0x2ce6c4,_0x3c28c2[_0xf8cf('0x11')][_0x2ce6c4[_0xf8cf('0x5a')]])[_0xf8cf('0x3e')](function(_0x2f5287){ut[_0xf8cf('0x4b')]('[Fax][execOriginate][success]',_0x2f5287);_0x142f81(ut[_0xf8cf('0x3b')](_0xf8cf('0x5b')));})[_0xf8cf('0x41')](function(_0x42ea1c){ut['logger'](_0xf8cf('0x5c'),_0x42ea1c);updateStatus(_0x2ce6c4);_0x361f75(ut[_0xf8cf('0x3b')](_0xf8cf('0x5d')));});});};Fax[_0xf8cf('0x29')][_0xf8cf('0x5e')]=function(_0x126f5c){var _0x100e9e=this;return new BPromise(function(_0x518624,_0x3a229e){var _0x18730e=_0x100e9e[_0xf8cf('0x5f')](_0x100e9e[_0xf8cf('0x11')][_0x126f5c[_0xf8cf('0x5a')]][_0xf8cf('0x60')],_0x126f5c);if(_0x18730e['isValid']){_0x518624(ut[_0xf8cf('0x3b')](_0xf8cf('0x61')));}else{_0x3a229e(ut[_0xf8cf('0x3b')](_0x18730e[_0xf8cf('0x3b')]));}});};function originate(_0x2ec88f,_0x394f47,_0x2f535a){return new BPromise(function(_0x59ff09,_0x5c36d6){if(_0x2f535a){var _0x4f7335=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xf8cf('0x3d')](_0x2ec88f[_0xf8cf('0x4')])[_0xf8cf('0x26')],_0x2ec88f[_0xf8cf('0x4')]);gs[_0xf8cf('0x62')](_0x4f7335)[_0xf8cf('0x3e')](function(){_0x2ec88f[_0xf8cf('0x4')]=util[_0xf8cf('0x63')](_0xf8cf('0x64'),path[_0xf8cf('0x3d')](_0x2ec88f[_0xf8cf('0x4')])[_0xf8cf('0x65')],path[_0xf8cf('0x3d')](_0x2ec88f[_0xf8cf('0x4')])[_0xf8cf('0x26')]);_0x394f47[_0xf8cf('0x66')]=_0x2ec88f[_0xf8cf('0x4')];ut[_0xf8cf('0x4b')](_0xf8cf('0x67'),'');ami['Action'](ut[_0xf8cf('0x68')](_0x2ec88f,_0x394f47))[_0xf8cf('0x3e')](function(_0x4b83d0){_0x59ff09(_0x4b83d0);})[_0xf8cf('0x41')](function(_0x54ee90){_0x5c36d6(_0x54ee90);});})['catch'](function(_0x4c9afd){_0x5c36d6(_0x4c9afd);});}else{ami[_0xf8cf('0x69')](ut[_0xf8cf('0x68')](_0x2ec88f,_0x394f47))[_0xf8cf('0x3e')](function(_0x3f58ea){_0x59ff09(_0x3f58ea);})['catch'](function(_0xbb804e){_0x5c36d6(_0xbb804e);});}});}Fax['prototype'][_0xf8cf('0x59')]=function(_0x4b36ca,_0x1086e2){var _0xec3fa0=this;return new BPromise(function(_0x44be87,_0x550b52){var _0x50089d=uuid['v4']();var _0x502597=ut[_0xf8cf('0x6a')](_0x4b36ca,_0x1086e2);_0xec3fa0[_0xf8cf('0x13')][_0x50089d]=new Action(_0x50089d,_0x1086e2,_0x4b36ca);var _0x303ffc=_0xec3fa0['actions'][_0x50089d];if(path[_0xf8cf('0x3d')](_0x4b36ca[_0xf8cf('0x4')])[_0xf8cf('0x6b')]===_0xf8cf('0x40')){originate(_0x303ffc,_0x502597,!![])[_0xf8cf('0x3e')](function(_0x3d1dc6){_0x44be87(_0x3d1dc6);})['catch'](function(_0x21b7d3){_0x550b52(_0x21b7d3);});}else{originate(_0x303ffc,_0x502597,![])[_0xf8cf('0x3e')](function(_0x481e40){_0x44be87(_0x481e40);})['catch'](function(_0x3c617d){_0x550b52(_0x3c617d);});}});};Fax['prototype'][_0xf8cf('0x6c')]=function(_0x507b38){return!_['isNil'](_0x507b38)&&!_['isNil'](_0x507b38[_0xf8cf('0x26')])&&!_[_0xf8cf('0x6d')](_0x507b38[_0xf8cf('0x6e')])&&_0x507b38[_0xf8cf('0x6e')]&&!_[_0xf8cf('0x6d')](this[_0xf8cf('0x12')][util[_0xf8cf('0x63')](_0xf8cf('0x6f'),_0x507b38[_0xf8cf('0x26')])])&&!_[_0xf8cf('0x6d')](this[_0xf8cf('0x12')][util[_0xf8cf('0x63')](_0xf8cf('0x6f'),_0x507b38[_0xf8cf('0x26')])][_0xf8cf('0x31')])&&(this[_0xf8cf('0x12')][util[_0xf8cf('0x63')](_0xf8cf('0x6f'),_0x507b38[_0xf8cf('0x26')])]['status']===_0xf8cf('0x70')||this['trunks'][util[_0xf8cf('0x63')](_0xf8cf('0x6f'),_0x507b38[_0xf8cf('0x26')])][_0xf8cf('0x31')]===_0xf8cf('0x71'));};Fax['prototype'][_0xf8cf('0x5f')]=function(_0x2b6011,_0xcff38){if(!this[_0xf8cf('0x6c')](_0x2b6011)){ut[_0xf8cf('0x4b')](_0xf8cf('0x72'),_[_0xf8cf('0x6d')](_0x2b6011)?'':_0x2b6011[_0xf8cf('0x26')]+_0xf8cf('0x73'));return{'isValid':![],'message':_0xf8cf('0x74')};}if(_[_0xf8cf('0x6d')](_0xcff38[_0xf8cf('0x8')])){ut[_0xf8cf('0x4b')](_0xf8cf('0x75'),JSON[_0xf8cf('0x43')](_0xcff38));return{'isValid':![],'message':_0xf8cf('0x76')};}if(_[_0xf8cf('0x6d')](_0xcff38[_0xf8cf('0x4')])){ut[_0xf8cf('0x4b')](_0xf8cf('0x77'),JSON['stringify'](_0xcff38));return{'isValid':![],'message':_0xf8cf('0x78')};}return{'isValid':!![],'message':_0xf8cf('0x79')};};module[_0xf8cf('0x7a')]=Fax;
\ No newline at end of file
+var _0x15c5=['./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','trunks','newchannel','syncNewchannel','bind','varset','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','prototype','syncVarSet','variable','value','channelstatedesc','operation','status','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../ami','./rpcDb'];(function(_0x265f8d,_0x114602){var _0x207b24=function(_0x2f05af){while(--_0x2f05af){_0x265f8d['push'](_0x265f8d['shift']());}};_0x207b24(++_0x114602);}(_0x15c5,0x15e));var _0x515c=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x15c5[_0x4fbb15];return _0x436338;};'use strict';var util=require(_0x515c('0x0'));var _=require(_0x515c('0x1'));var BPromise=require(_0x515c('0x2'));var uuid=require(_0x515c('0x3'));var moment=require(_0x515c('0x4'));var path=require(_0x515c('0x5'));var tiff2pdf=require(_0x515c('0x6'));var gs=require(_0x515c('0x7'));var logger=require('../../../config/logger')('fax');var ami=require(_0x515c('0x8'));var rpcDb=require(_0x515c('0x9'));var Channel=require('./channel');var ut=require(_0x515c('0xa'));var Action=require(_0x515c('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x515c('0xc'));var faxMessage=require(_0x515c('0xd'));function Fax(_0x3eb183){this[_0x515c('0xe')]={};this['faxAccounts']=_0x3eb183['faxAccounts'];this[_0x515c('0xf')]=_0x3eb183[_0x515c('0xf')];this['actions']={};ami['on'](_0x515c('0x10'),this[_0x515c('0x11')][_0x515c('0x12')](this));ami['on'](_0x515c('0x13'),this['syncVarSet'][_0x515c('0x12')](this));ami['on']('newstate',this[_0x515c('0x14')]['bind'](this));ami['on'](_0x515c('0x15'),this[_0x515c('0x16')]['bind'](this));ami['on'](_0x515c('0x17'),this[_0x515c('0x18')][_0x515c('0x12')](this));ami['on'](_0x515c('0x19'),this[_0x515c('0x1a')][_0x515c('0x12')](this));ami['on']('hangup',this[_0x515c('0x1b')][_0x515c('0x12')](this));ami['on']('originateresponse',this[_0x515c('0x1c')][_0x515c('0x12')](this));}Fax['prototype'][_0x515c('0x11')]=function(_0x3403ad){if(_0x3403ad['context']===_0x515c('0x1d')){for(var _0x5f2957 in this[_0x515c('0x1e')]){if(this[_0x515c('0x1e')][_0x515c('0x1f')](_0x5f2957)){if(_0x3403ad[_0x515c('0x20')]===this[_0x515c('0x1e')][_0x5f2957][_0x515c('0x21')]){this['channels'][_0x3403ad[_0x515c('0x22')]]={};this[_0x515c('0xe')][_0x3403ad['uniqueid']][_0x515c('0x23')]=_0x3403ad['channel'];this[_0x515c('0xe')][_0x3403ad[_0x515c('0x22')]]['id']=this['faxAccounts'][_0x5f2957]['id'];this[_0x515c('0xe')][_0x3403ad[_0x515c('0x22')]][_0x515c('0x24')]=this[_0x515c('0x1e')][_0x5f2957][_0x515c('0x24')];logger[_0x515c('0x25')](_0x3403ad[_0x515c('0x22')],_0x515c('0x26'));}}}}if(this[_0x515c('0x27')][_0x3403ad[_0x515c('0x22')]]){this[_0x515c('0xe')][_0x3403ad[_0x515c('0x22')]]={};this[_0x515c('0xe')][_0x3403ad['uniqueid']][_0x515c('0x23')]=_0x3403ad[_0x515c('0x23')];logger['info'](_0x3403ad[_0x515c('0x22')],_0x515c('0x26'));}};Fax[_0x515c('0x28')][_0x515c('0x29')]=function(_0x53bb8b){if(this[_0x515c('0xe')][_0x53bb8b[_0x515c('0x22')]]){for(var _0x25aee2 in _0x53bb8b[_0x515c('0x2a')]){if(_0x53bb8b[_0x515c('0x2a')][_0x515c('0x1f')](_0x25aee2)){this[_0x515c('0xe')][_0x53bb8b['uniqueid']][_0x25aee2]=_0x53bb8b[_0x515c('0x2b')];}}}};Fax[_0x515c('0x28')]['syncNewState']=function(_0xf9010){if(this[_0x515c('0xe')][_0xf9010['uniqueid']]){this['channels'][_0xf9010[_0x515c('0x22')]]['channelstate']=_0xf9010['channelstate'];this[_0x515c('0xe')][_0xf9010[_0x515c('0x22')]][_0x515c('0x2c')]=_0xf9010['channelstatedesc'];}};Fax[_0x515c('0x28')]['syncNewExten']=function(_0x35b9aa){if(this[_0x515c('0xe')][_0x35b9aa[_0x515c('0x22')]]){for(var _0x57f56f in _0x35b9aa[_0x515c('0x2a')]){if(_0x35b9aa['variable'][_0x515c('0x1f')](_0x57f56f)){this['channels'][_0x35b9aa[_0x515c('0x22')]][_0x57f56f]=_0x35b9aa[_0x515c('0x2b')];}}}};Fax[_0x515c('0x28')][_0x515c('0x18')]=function(_0x9821b9){if(this[_0x515c('0xe')][_0x9821b9['uniqueid']]){this[_0x515c('0xe')][_0x9821b9[_0x515c('0x22')]][_0x515c('0x2d')]=_0x9821b9['operation'];this['channels'][_0x9821b9['uniqueid']]['status']=_0x9821b9[_0x515c('0x2e')];this[_0x515c('0xe')][_0x9821b9[_0x515c('0x22')]]['localstationid']=_0x9821b9[_0x515c('0x21')];this[_0x515c('0xe')][_0x9821b9['uniqueid']]['filename']=_0x9821b9['filename'];logger['info'](_0x9821b9[_0x515c('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0x515c('0x28')][_0x515c('0x1a')]=function(_0xef8880){var _0x316cb4=this;if(this[_0x515c('0xe')][_0xef8880[_0x515c('0x22')]]){var _0x359c4d=this[_0x515c('0xe')][_0xef8880[_0x515c('0x22')]]['id'];this[_0x515c('0xe')][_0xef8880[_0x515c('0x22')]][_0x515c('0x2f')]=_0xef8880[_0x515c('0x2f')];this['channels'][_0xef8880[_0x515c('0x22')]][_0x515c('0x30')]=_0xef8880['pagestransferred'];this[_0x515c('0xe')][_0xef8880[_0x515c('0x22')]][_0x515c('0x21')]=_0xef8880[_0x515c('0x21')];this['channels'][_0xef8880[_0x515c('0x22')]][_0x515c('0x31')]=_0xef8880[_0x515c('0x31')];this[_0x515c('0xe')][_0xef8880[_0x515c('0x22')]]['transferrate']=_0xef8880[_0x515c('0x32')];this[_0x515c('0xe')][_0xef8880[_0x515c('0x22')]]['filename']=_0xef8880[_0x515c('0x33')];this[_0x515c('0xe')][_0xef8880[_0x515c('0x22')]][_0x515c('0x34')]=_0xef8880['calleridnum'];if(this['channels'][_0xef8880[_0x515c('0x22')]][_0x515c('0x30')]>0x0){tiff2pdf(_0xef8880[_0x515c('0x33')],_0x515c('0x35'),function(_0x23611b){logger[_0x515c('0x25')](_0xef8880['uniqueid'],_0x515c('0x36'),_0x23611b[_0x515c('0x37')]);attachment[_0x515c('0x38')]({'name':path[_0x515c('0x39')](_0xef8880['filename'])[_0x515c('0x24')],'basename':path['parse'](_0xef8880[_0x515c('0x33')])['name']+_0x515c('0x3a'),'type':_0x515c('0x3b')})[_0x515c('0x3c')](function(_0x149e1e){faxAccount[_0x515c('0x3d')](_0x359c4d,{'from':_0xef8880[_0x515c('0x34')],'mapKey':'fax','body':path['parse'](_0xef8880['filename'])[_0x515c('0x24')]+'.pdf','AttachmentId':_0x149e1e['id']})[_0x515c('0x3e')](function(_0x29b2bb){logger[_0x515c('0x3f')](_0xef8880[_0x515c('0x22')],_0x515c('0x40'),JSON[_0x515c('0x41')](_0x29b2bb));});})[_0x515c('0x3e')](function(_0x4075c5){logger[_0x515c('0x3f')](_0xef8880[_0x515c('0x22')],_0x515c('0x42'),JSON[_0x515c('0x41')](_0x4075c5));});});}logger[_0x515c('0x25')](_0xef8880[_0x515c('0x22')],_0x515c('0x42'));}};Fax[_0x515c('0x28')]['syncOriginateResponse']=function(_0x1ab852){if(this[_0x515c('0x27')][_0x1ab852[_0x515c('0x22')]]){_[_0x515c('0x43')](this[_0x515c('0xe')][_0x1ab852[_0x515c('0x22')]],_[_0x515c('0x44')](_0x1ab852,[_0x515c('0x45'),_0x515c('0x46')]));}};function updateStatus(_0x124b6f){if(_0x124b6f[_0x515c('0x47')]){faxMessage[_0x515c('0x48')](_0x124b6f[_0x515c('0x47')],{'failMessage':_0x515c('0x49')})['then'](function(_0x3c97ab){ut[_0x515c('0x4a')](_0x515c('0x4b'),_0x3c97ab);})[_0x515c('0x3e')](function(_0x584a2b){ut['logger'](_0x515c('0x4c'),_0x584a2b);});}else{ut[_0x515c('0x4a')](_0x515c('0x4d'));}}Fax[_0x515c('0x28')]['updateStatus']=function(_0xbc8049,_0x5602db,_0x589a85){var _0x489e08=this;var _0x29a291={};if(_0x5602db){_0x29a291={'read':_0x5602db};}else{_0x29a291={'failMessage':_0x589a85};}if(this['actions'][_0xbc8049][_0x515c('0x47')]){faxMessage[_0x515c('0x48')](this['actions'][_0xbc8049][_0x515c('0x47')],_0x29a291)[_0x515c('0x3c')](function(_0x53f7bb){ut[_0x515c('0x4a')](_0x515c('0x4e'),_0x53f7bb);})['catch'](function(_0x5493ac){ut['logger'](_0x515c('0x4f'),_0x5493ac);})[_0x515c('0x50')](function(){delete _0x489e08['channels'][_0xbc8049];delete _0x489e08[_0x515c('0x27')][_0xbc8049];});}else{ut[_0x515c('0x4a')](_0x515c('0x51'));delete this['channels'][_0xbc8049];delete this[_0x515c('0x27')][_0xbc8049];}};Fax[_0x515c('0x28')][_0x515c('0x1b')]=function(_0x3e05e7){var _0x4f765d=this;if(this[_0x515c('0xe')][_0x3e05e7['uniqueid']]){if(this[_0x515c('0x27')][_0x3e05e7['uniqueid']]){this[_0x515c('0xe')][_0x3e05e7['uniqueid']]['id']=this[_0x515c('0x27')][_0x3e05e7[_0x515c('0x22')]]['id'];this[_0x515c('0xe')][_0x3e05e7[_0x515c('0x22')]]['name']=this[_0x515c('0x27')][_0x3e05e7[_0x515c('0x22')]]['name'];}logger['info'](_0x3e05e7[_0x515c('0x22')],this[_0x515c('0x27')][_0x3e05e7[_0x515c('0x22')]]?_0x515c('0x52'):_0x515c('0x53'),JSON[_0x515c('0x41')](this[_0x515c('0xe')][_0x3e05e7[_0x515c('0x22')]]));if(this[_0x515c('0x27')][_0x3e05e7['uniqueid']]){if(this['channels'][_0x3e05e7[_0x515c('0x22')]][_0x515c('0x54')]>0x0&&this[_0x515c('0xe')][_0x3e05e7['uniqueid']][_0x515c('0x17')]===_0x515c('0x55')){this['updateStatus'](_0x3e05e7[_0x515c('0x22')],!![]);}else{this['updateStatus'](_0x3e05e7[_0x515c('0x22')],![],this[_0x515c('0xe')][_0x3e05e7[_0x515c('0x22')]]['faxstatusstring']?_0x515c('0x56')+this[_0x515c('0xe')][_0x3e05e7[_0x515c('0x22')]][_0x515c('0x57')]:_0x515c('0x58'));}}}};Fax['prototype'][_0x515c('0x59')]=function(_0x5c2c38){var _0x5523b5=this;return new BPromise(function(_0x2a8b42,_0x1df79e){_0x5523b5[_0x515c('0x5a')](_0x5c2c38,_0x5523b5[_0x515c('0x1e')][_0x5c2c38['FaxAccountId']])[_0x515c('0x3c')](function(_0x2c6b30){ut[_0x515c('0x4a')](_0x515c('0x5b'),_0x2c6b30);_0x2a8b42(ut[_0x515c('0x37')](_0x515c('0x5c')));})[_0x515c('0x3e')](function(_0xa1f0ed){ut[_0x515c('0x4a')](_0x515c('0x5d'),_0xa1f0ed);updateStatus(_0x5c2c38);_0x1df79e(ut[_0x515c('0x37')](_0x515c('0x5e')));});});};Fax['prototype'][_0x515c('0x5f')]=function(_0x51cbec){var _0x81748d=this;return new BPromise(function(_0x363781,_0x20271b){var _0x52546a=_0x81748d[_0x515c('0x60')](_0x81748d['faxAccounts'][_0x51cbec[_0x515c('0x61')]][_0x515c('0x62')],_0x51cbec);if(_0x52546a[_0x515c('0x63')]){_0x363781(ut[_0x515c('0x37')](_0x515c('0x64')));}else{_0x20271b(ut['message'](_0x52546a['message']));}});};function originate(_0x598bab,_0x491375,_0x27930c){return new BPromise(function(_0x3365b9,_0x19bc1e){if(_0x27930c){var _0x320784=util['format'](_0x515c('0x65'),path[_0x515c('0x39')](_0x598bab[_0x515c('0x5')])[_0x515c('0x24')],_0x598bab['path']);gs[_0x515c('0x66')](_0x320784)['then'](function(){_0x598bab[_0x515c('0x5')]=util[_0x515c('0x67')](_0x515c('0x68'),path[_0x515c('0x39')](_0x598bab[_0x515c('0x5')])['dir'],path[_0x515c('0x39')](_0x598bab['path'])[_0x515c('0x24')]);_0x491375[_0x515c('0x69')]=_0x598bab[_0x515c('0x5')];ut[_0x515c('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami[_0x515c('0x6a')](ut['variablesAction'](_0x598bab,_0x491375))[_0x515c('0x3c')](function(_0x53e1a0){_0x3365b9(_0x53e1a0);})[_0x515c('0x3e')](function(_0x399115){_0x19bc1e(_0x399115);});})['catch'](function(_0x35ea74){_0x19bc1e(_0x35ea74);});}else{ami[_0x515c('0x6a')](ut[_0x515c('0x6b')](_0x598bab,_0x491375))['then'](function(_0x19e324){_0x3365b9(_0x19e324);})[_0x515c('0x3e')](function(_0x176fc6){_0x19bc1e(_0x176fc6);});}});}Fax[_0x515c('0x28')][_0x515c('0x5a')]=function(_0x49d240,_0x19a37a){var _0x7820fb=this;return new BPromise(function(_0x229558,_0x19df53){var _0x29ff9f=uuid['v4']();var _0x4abdeb=ut[_0x515c('0x6c')](_0x49d240,_0x19a37a);_0x7820fb[_0x515c('0x27')][_0x29ff9f]=new Action(_0x29ff9f,_0x19a37a,_0x49d240);var _0x156ef2=_0x7820fb[_0x515c('0x27')][_0x29ff9f];if(path[_0x515c('0x39')](_0x49d240[_0x515c('0x5')])[_0x515c('0x6d')]==='.pdf'){originate(_0x156ef2,_0x4abdeb,!![])[_0x515c('0x3c')](function(_0x59a8a1){_0x229558(_0x59a8a1);})['catch'](function(_0x24ba32){_0x19df53(_0x24ba32);});}else{originate(_0x156ef2,_0x4abdeb,![])['then'](function(_0x3d4d4d){_0x229558(_0x3d4d4d);})[_0x515c('0x3e')](function(_0x4710cf){_0x19df53(_0x4710cf);});}});};Fax[_0x515c('0x28')][_0x515c('0x6e')]=function(_0x221624){return!_['isNil'](_0x221624)&&!_[_0x515c('0x6f')](_0x221624['name'])&&!_['isNil'](_0x221624['active'])&&_0x221624[_0x515c('0x70')]&&!_[_0x515c('0x6f')](this[_0x515c('0xf')][util['format'](_0x515c('0x71'),_0x221624[_0x515c('0x24')])])&&!_[_0x515c('0x6f')](this['trunks'][util[_0x515c('0x67')](_0x515c('0x71'),_0x221624['name'])][_0x515c('0x2e')])&&(this[_0x515c('0xf')][util[_0x515c('0x67')](_0x515c('0x71'),_0x221624[_0x515c('0x24')])][_0x515c('0x2e')]===_0x515c('0x72')||this[_0x515c('0xf')][util['format']('SIP/%s',_0x221624[_0x515c('0x24')])][_0x515c('0x2e')]===_0x515c('0x73'));};Fax[_0x515c('0x28')][_0x515c('0x60')]=function(_0x2051b3,_0x4e2913){if(!this[_0x515c('0x6e')](_0x2051b3)){ut[_0x515c('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x515c('0x6f')](_0x2051b3)?'':_0x2051b3[_0x515c('0x24')]+_0x515c('0x74'));return{'isValid':![],'message':_0x515c('0x75')};}if(_[_0x515c('0x6f')](_0x4e2913['fax'])){ut[_0x515c('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x515c('0x41')](_0x4e2913));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x515c('0x6f')](_0x4e2913[_0x515c('0x5')])){ut[_0x515c('0x4a')](_0x515c('0x76'),JSON[_0x515c('0x41')](_0x4e2913));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x515c('0x77')]=Fax;
\ No newline at end of file
index 2764f75..d3866de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb54=['util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','catch'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xeb54,0x13f));var _0x4eb5=function(_0x2fefe8,_0x3364c9){_0x2fefe8=_0x2fefe8-0x0;var _0x294add=_0xeb54[_0x2fefe8];return _0x294add;};'use strict';var util=require(_0x4eb5('0x0'));var BPromise=require(_0x4eb5('0x1'));var logger=require(_0x4eb5('0x2'))(_0x4eb5('0x3'));var _=require(_0x4eb5('0x4'));var faxAccount=require(_0x4eb5('0x5'));function loggerCatch(_0x5e6c71){return function(_0xbfc329){logger[_0x4eb5('0x6')](_0x5e6c71,util[_0x4eb5('0x7')](_0xbfc329,{'showHidden':![],'depth':null}));};}exports[_0x4eb5('0x8')]=function(_0x127a99,_0x281e7e){return BPromise['resolve']()[_0x4eb5('0x9')](faxAccount[_0x4eb5('0x8')](_0x127a99,_0x281e7e))[_0x4eb5('0xa')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x32dd=['bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','util'];(function(_0x136f46,_0x1a5e11){var _0x471e75=function(_0x1d68e0){while(--_0x1d68e0){_0x136f46['push'](_0x136f46['shift']());}};_0x471e75(++_0x1a5e11);}(_0x32dd,0x99));var _0xd32d=function(_0x92ad86,_0x3c09c3){_0x92ad86=_0x92ad86-0x0;var _0x188fbb=_0x32dd[_0x92ad86];return _0x188fbb;};'use strict';var util=require(_0xd32d('0x0'));var BPromise=require(_0xd32d('0x1'));var logger=require('../../../config/logger')(_0xd32d('0x2'));var _=require(_0xd32d('0x3'));var faxAccount=require(_0xd32d('0x4'));function loggerCatch(_0x339a12){return function(_0x3e251b){logger[_0xd32d('0x5')](_0x339a12,util[_0xd32d('0x6')](_0x3e251b,{'showHidden':![],'depth':null}));};}exports[_0xd32d('0x7')]=function(_0x51c45e,_0x40aa84){return BPromise[_0xd32d('0x8')]()[_0xd32d('0x9')](faxAccount[_0xd32d('0x7')](_0x51c45e,_0x40aa84))[_0xd32d('0xa')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index b8680b0..3b7f78c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc9=['util','../../../../config/logger','fax','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x67ddd9,_0x5563db){var _0x3d8cbd=function(_0xb77ab9){while(--_0xb77ab9){_0x67ddd9['push'](_0x67ddd9['shift']());}};_0x3d8cbd(++_0x5563db);}(_0x1cc9,0x90));var _0x91cc=function(_0x84d9dd,_0x13db4b){_0x84d9dd=_0x84d9dd-0x0;var _0x58587b=_0x1cc9[_0x84d9dd];return _0x58587b;};'use strict';var util=require(_0x91cc('0x0'));var logger=require(_0x91cc('0x1'))(_0x91cc('0x2'));var BPromise=require('bluebird');var exec=require('child_process')['exec'];exports[_0x91cc('0x3')]=function(_0x57b36f){return new BPromise(function(_0x23f874,_0x2ae0c8){exec(_0x57b36f,function(_0x1c6b39,_0x487cf1,_0x51b5bd){logger[_0x91cc('0x4')](_0x91cc('0x5'),_0x487cf1);if(_0x1c6b39){logger['info'](_0x91cc('0x5'),_0x91cc('0x6'),util[_0x91cc('0x7')](_0x1c6b39,{'showHidden':![],'depth':null}),_0x487cf1,_0x51b5bd);_0x2ae0c8(_0x1c6b39);}_0x23f874(_0x487cf1);});});};
\ No newline at end of file
+var _0xc5b1=['inspect','child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:'];(function(_0x2f7029,_0x44deb0){var _0x18c24c=function(_0x495afd){while(--_0x495afd){_0x2f7029['push'](_0x2f7029['shift']());}};_0x18c24c(++_0x44deb0);}(_0xc5b1,0x9b));var _0x1c5b=function(_0x57c478,_0x798a8){_0x57c478=_0x57c478-0x0;var _0x13cb90=_0xc5b1[_0x57c478];return _0x13cb90;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require(_0x1c5b('0x0'))[_0x1c5b('0x1')];exports[_0x1c5b('0x2')]=function(_0x570ed8){return new BPromise(function(_0x4a094a,_0x545afd){exec(_0x570ed8,function(_0x368b61,_0x4cc9ea,_0x11d99e){logger['info'](_0x1c5b('0x3'),_0x4cc9ea);if(_0x368b61){logger[_0x1c5b('0x4')](_0x1c5b('0x3'),_0x1c5b('0x5'),util[_0x1c5b('0x6')](_0x368b61,{'showHidden':![],'depth':null}),_0x4cc9ea,_0x11d99e);_0x545afd(_0x368b61);}_0x4a094a(_0x4cc9ea);});});};
\ No newline at end of file
index 29c6f99..b2c68f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6138=['faxdetect','t38timeout','localstationid','variablesAction','originate','xcally-motion-fax','format','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','fax','message','info','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x6138,0x1ed));var _0x8613=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x6138[_0x31e29a];return _0x32d892;};'use strict';var util=require(_0x8613('0x0'));var _=require(_0x8613('0x1'));var moment=require(_0x8613('0x2'));var logger=require('../../../../config/logger')(_0x8613('0x3'));exports[_0x8613('0x4')]=function(_0xb17da1){return{'message':_0xb17da1};};exports['logger']=function(_0x3c74ec,_0x423295){logger[_0x8613('0x5')](_0x3c74ec,util['inspect'](_0x423295,{'showHidden':![],'depth':null}));};exports[_0x8613('0x6')]=function(_0x50ac82,_0x2ac706){var _0x28280b={'XMF-ECM':_0x2ac706[_0x8613('0x7')],'XMF-HEADERINFO':_0x2ac706[_0x8613('0x8')],'XMF-MINRATE':_0x2ac706[_0x8613('0x9')],'XMF-MAXRATE':_0x2ac706[_0x8613('0xa')],'XMF-MODEM':util['format'](_0x8613('0xb'),_0x2ac706[_0x8613('0xc')]),'XMF-GATEWAY':_0x2ac706['gateway'],'XMF-FAXDETECT':_0x2ac706[_0x8613('0xd')],'XMF-T38TIMEOUT':_0x2ac706[_0x8613('0xe')],'XMF-LOCALSTATIONID':_0x2ac706[_0x8613('0xf')],'XMF-PATH':_0x50ac82['path']};return _0x28280b;};exports[_0x8613('0x10')]=function(_0x31756b,_0x3047ae){return{'actionid':_0x31756b['uniqueid'],'action':_0x8613('0x11'),'channel':_0x31756b['channel'],'Exten':_0x8613('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0x8613('0x13')](_0x8613('0x14'),_0x31756b['headerinfo']?_0x31756b[_0x8613('0x8')]:'',_0x31756b['localstationid']),'variable':_0x3047ae,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x31756b[_0x8613('0x15')]};};
\ No newline at end of file
+var _0xfc07=['../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','localstationid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','moment'];(function(_0x4629f8,_0xfaef31){var _0x1298ad=function(_0x507555){while(--_0x507555){_0x4629f8['push'](_0x4629f8['shift']());}};_0x1298ad(++_0xfaef31);}(_0xfc07,0x1cd));var _0x7fc0=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xfc07[_0x20589d];return _0x422de9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x7fc0('0x0'));var logger=require(_0x7fc0('0x1'))(_0x7fc0('0x2'));exports[_0x7fc0('0x3')]=function(_0x127f56){return{'message':_0x127f56};};exports[_0x7fc0('0x4')]=function(_0x1c2650,_0x375a90){logger[_0x7fc0('0x5')](_0x1c2650,util[_0x7fc0('0x6')](_0x375a90,{'showHidden':![],'depth':null}));};exports[_0x7fc0('0x7')]=function(_0x537841,_0x437a85){var _0x38657c={'XMF-ECM':_0x437a85[_0x7fc0('0x8')],'XMF-HEADERINFO':_0x437a85[_0x7fc0('0x9')],'XMF-MINRATE':_0x437a85[_0x7fc0('0xa')],'XMF-MAXRATE':_0x437a85[_0x7fc0('0xb')],'XMF-MODEM':util[_0x7fc0('0xc')](_0x7fc0('0xd'),_0x437a85[_0x7fc0('0xe')]),'XMF-GATEWAY':_0x437a85['gateway'],'XMF-FAXDETECT':_0x437a85[_0x7fc0('0xf')],'XMF-T38TIMEOUT':_0x437a85['t38timeout'],'XMF-LOCALSTATIONID':_0x437a85[_0x7fc0('0x10')],'XMF-PATH':_0x537841['path']};return _0x38657c;};exports['variablesAction']=function(_0x20b4c0,_0x3e5eb7){return{'actionid':_0x20b4c0['uniqueid'],'action':_0x7fc0('0x11'),'channel':_0x20b4c0[_0x7fc0('0x12')],'Exten':_0x7fc0('0x13'),'Context':_0x7fc0('0x14'),'Priority':'1','callerid':util['format'](_0x7fc0('0x15'),_0x20b4c0[_0x7fc0('0x9')]?_0x20b4c0[_0x7fc0('0x9')]:'',_0x20b4c0['localstationid']),'variable':_0x3e5eb7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x20b4c0['uniqueid']};};
\ No newline at end of file
index 4a57484..957b3c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39fd=['./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initTemplates','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','catch','log','listen','sync','bluebird','util','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport'];(function(_0xf82e3f,_0x180583){var _0x502e94=function(_0x21bcab){while(--_0x21bcab){_0xf82e3f['push'](_0xf82e3f['shift']());}};_0x502e94(++_0x180583);}(_0x39fd,0x19f));var _0xd39f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x39fd[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require(_0xd39f('0x0'));var util=require(_0xd39f('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0xd39f('0x2'));var Trigger=require(_0xd39f('0x3'));var Dialer=require(_0xd39f('0x4'));var Preview=require(_0xd39f('0x5'));var Fax=require('./fax');var user=require(_0xd39f('0x6'));var voiceQueue=require(_0xd39f('0x7'));var voiceQueueReport=require(_0xd39f('0x8'));var voiceCallReport=require(_0xd39f('0x9'));var trunk=require(_0xd39f('0xa'));var trigger=require('./rpc/trigger');var template=require(_0xd39f('0xb'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xd39f('0xc'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xd39f('0xd'));var zendesk=require(_0xd39f('0xe'));var salesforce=require(_0xd39f('0xf'));var sugarcrm=require(_0xd39f('0x10'));var freshdesk=require(_0xd39f('0x11'));var desk=require(_0xd39f('0x12'));var zoho=require(_0xd39f('0x13'));var vtiger=require(_0xd39f('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xd39f('0x15')](_0xd39f('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd39f('0x15')](_0xd39f('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xd39f('0x17')]()[_0xd39f('0x18')](user[_0xd39f('0x19')]())[_0xd39f('0x18')](realtime[_0xd39f('0x1a')]())[_0xd39f('0x18')](user[_0xd39f('0x1b')]())[_0xd39f('0x18')](realtime[_0xd39f('0x1c')]())[_0xd39f('0x18')](trunk[_0xd39f('0x1d')]())[_0xd39f('0x18')](realtime[_0xd39f('0x1e')]())[_0xd39f('0x18')](voiceQueue[_0xd39f('0x1f')]())[_0xd39f('0x18')](realtime['initVoiceQueues']())[_0xd39f('0x18')](trigger['getTriggers']())[_0xd39f('0x18')](realtime['initTriggers']())['then'](template['getTemplates']())[_0xd39f('0x18')](realtime[_0xd39f('0x20')]())[_0xd39f('0x18')](zendesk['getZendeskAccounts']())[_0xd39f('0x18')](realtime[_0xd39f('0x21')]())[_0xd39f('0x18')](salesforce['getSalesforceAccounts']())['then'](realtime['initSalesforceAccounts']())[_0xd39f('0x18')](sugarcrm[_0xd39f('0x22')]())[_0xd39f('0x18')](realtime[_0xd39f('0x23')]())['then'](freshdesk[_0xd39f('0x24')]())[_0xd39f('0x18')](realtime['initFreshdeskAccounts']())[_0xd39f('0x18')](desk[_0xd39f('0x25')]())[_0xd39f('0x18')](realtime[_0xd39f('0x26')]())[_0xd39f('0x18')](zoho[_0xd39f('0x27')]())[_0xd39f('0x18')](realtime['initZohoAccounts']())[_0xd39f('0x18')](vtiger[_0xd39f('0x28')]())[_0xd39f('0x18')](realtime[_0xd39f('0x29')]())['then'](campaign['getCampaigns']())[_0xd39f('0x18')](realtime[_0xd39f('0x2a')]())[_0xd39f('0x18')](voiceExtension['getVoiceExtensions']())[_0xd39f('0x18')](realtime[_0xd39f('0x2b')]())[_0xd39f('0x18')](faxAccount[_0xd39f('0x2c')]())[_0xd39f('0x18')](realtime[_0xd39f('0x2d')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xd39f('0x17')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0xd39f('0x2e')]())['then'](cmHopperHistory[_0xd39f('0x2f')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xd39f('0x18')](cmHopperHistory[_0xd39f('0x30')]())[_0xd39f('0x18')](realtime['initCampaignHopperHistory']())[_0xd39f('0x18')](voiceCallReport['getVoiceCallReports']())['then'](realtime['initVoiceCallReports']())[_0xd39f('0x18')](function(_0x5b8851){})[_0xd39f('0x31')](function(_0xf650c2){console[_0xd39f('0x32')](_0xf650c2);});}function main(){return server[_0xd39f('0x33')](realtime,preview,fax)[_0xd39f('0x18')](function(_0x1790f5){return initRealtime();})['then'](function(){return initParams();})[_0xd39f('0x18')](function(){report[_0xd39f('0x34')]();setInterval(initRealtime,0x1388);})[_0xd39f('0x31')](function(_0x45c2d0){console['log'](_0x45c2d0);});}main();
\ No newline at end of file
+var _0xa9e7=['initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','log','listen','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getCampaigns','initCampaigns','getVoiceExtensions','getVoiceQueueReports','getVoiceQueueHopperHistory'];(function(_0x44a614,_0xff522){var _0x5d6747=function(_0x1756b5){while(--_0x1756b5){_0x44a614['push'](_0x44a614['shift']());}};_0x5d6747(++_0xff522);}(_0xa9e7,0x79));var _0x7a9e=function(_0x46bcb7,_0x51cd6b){_0x46bcb7=_0x46bcb7-0x0;var _0x90c488=_0xa9e7[_0x46bcb7];return _0x90c488;};'use strict';var BPromise=require('bluebird');var util=require(_0x7a9e('0x0'));var moment=require(_0x7a9e('0x1'));var server=require(_0x7a9e('0x2'));var Realtime=require(_0x7a9e('0x3'));var Report=require(_0x7a9e('0x4'));var Acw=require('./acw');var Trigger=require(_0x7a9e('0x5'));var Dialer=require(_0x7a9e('0x6'));var Preview=require(_0x7a9e('0x7'));var Fax=require(_0x7a9e('0x8'));var user=require(_0x7a9e('0x9'));var voiceQueue=require(_0x7a9e('0xa'));var voiceQueueReport=require(_0x7a9e('0xb'));var voiceCallReport=require(_0x7a9e('0xc'));var trunk=require(_0x7a9e('0xd'));var trigger=require(_0x7a9e('0xe'));var template=require(_0x7a9e('0xf'));var cmHopperHistory=require(_0x7a9e('0x10'));var campaign=require(_0x7a9e('0x11'));var voiceExtension=require(_0x7a9e('0x12'));var faxAccount=require(_0x7a9e('0x13'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x7a9e('0x14'));var sugarcrm=require(_0x7a9e('0x15'));var freshdesk=require(_0x7a9e('0x16'));var desk=require(_0x7a9e('0x17'));var zoho=require(_0x7a9e('0x18'));var vtiger=require('./rpc/integrations/vtiger');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7a9e('0x19')](_0x7a9e('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x7a9e('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7a9e('0x1b')]()['then'](user[_0x7a9e('0x1c')]())[_0x7a9e('0x1d')](realtime[_0x7a9e('0x1e')]())['then'](user[_0x7a9e('0x1f')]())['then'](realtime[_0x7a9e('0x20')]())[_0x7a9e('0x1d')](trunk['getTrunks']())['then'](realtime['initTrunks']())[_0x7a9e('0x1d')](voiceQueue['getVoiceQueues']())[_0x7a9e('0x1d')](realtime['initVoiceQueues']())[_0x7a9e('0x1d')](trigger[_0x7a9e('0x21')]())['then'](realtime[_0x7a9e('0x22')]())[_0x7a9e('0x1d')](template['getTemplates']())[_0x7a9e('0x1d')](realtime[_0x7a9e('0x23')]())[_0x7a9e('0x1d')](zendesk[_0x7a9e('0x24')]())['then'](realtime['initZendeskAccounts']())[_0x7a9e('0x1d')](salesforce[_0x7a9e('0x25')]())[_0x7a9e('0x1d')](realtime[_0x7a9e('0x26')]())[_0x7a9e('0x1d')](sugarcrm[_0x7a9e('0x27')]())['then'](realtime[_0x7a9e('0x28')]())['then'](freshdesk[_0x7a9e('0x29')]())[_0x7a9e('0x1d')](realtime['initFreshdeskAccounts']())[_0x7a9e('0x1d')](desk[_0x7a9e('0x2a')]())['then'](realtime[_0x7a9e('0x2b')]())['then'](zoho[_0x7a9e('0x2c')]())[_0x7a9e('0x1d')](realtime[_0x7a9e('0x2d')]())[_0x7a9e('0x1d')](vtiger[_0x7a9e('0x2e')]())[_0x7a9e('0x1d')](realtime[_0x7a9e('0x2f')]())['then'](campaign[_0x7a9e('0x30')]())[_0x7a9e('0x1d')](realtime[_0x7a9e('0x31')]())[_0x7a9e('0x1d')](voiceExtension[_0x7a9e('0x32')]())[_0x7a9e('0x1d')](realtime['initVoiceExtensions']())[_0x7a9e('0x1d')](faxAccount['getFaxAccounts']())[_0x7a9e('0x1d')](realtime['initFaxAccounts']())[_0x7a9e('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x7a9e('0x1b')]()['then'](voiceQueueReport[_0x7a9e('0x33')]())[_0x7a9e('0x1d')](realtime['initVoiceQueueReports']())[_0x7a9e('0x1d')](cmHopperHistory[_0x7a9e('0x34')]())[_0x7a9e('0x1d')](realtime[_0x7a9e('0x35')]())['then'](cmHopperHistory[_0x7a9e('0x36')]())['then'](realtime[_0x7a9e('0x37')]())[_0x7a9e('0x1d')](voiceCallReport['getVoiceCallReports']())[_0x7a9e('0x1d')](realtime['initVoiceCallReports']())[_0x7a9e('0x1d')](function(_0x12ba80){})['catch'](function(_0x182c74){console[_0x7a9e('0x38')](_0x182c74);});}function main(){return server[_0x7a9e('0x39')](realtime,preview,fax)[_0x7a9e('0x1d')](function(_0x3a3490){return initRealtime();})['then'](function(){return initParams();})[_0x7a9e('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x2f3133){console[_0x7a9e('0x38')](_0x2f3133);});}main();
\ No newline at end of file
index b844cc8..97a5f24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1529=['fullname','state','unknown','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','prototype','toLowerCase','not_inuse','idle','inuse','toNumber','format','stateTime','status','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode'];(function(_0x2ae870,_0xcf8709){var _0x28136e=function(_0x541014){while(--_0x541014){_0x2ae870['push'](_0x2ae870['shift']());}};_0x28136e(++_0xcf8709);}(_0x1529,0xfe));var _0x9152=function(_0x1b126a,_0x354ce0){_0x1b126a=_0x1b126a-0x0;var _0x1da353=_0x1529[_0x1b126a];return _0x1da353;};'use strict';var _=require(_0x9152('0x0'));var util=require(_0x9152('0x1'));var moment=require(_0x9152('0x2'));var md5=require(_0x9152('0x3'));var Redis=require(_0x9152('0x4'));var config=require(_0x9152('0x5'));config[_0x9152('0x6')]=_[_0x9152('0x7')](config[_0x9152('0x6')],{'host':_0x9152('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x26f2c3){this['id']=_0x26f2c3['id']||0x0;this[_0x9152('0x9')]=_0x26f2c3['name']||'';this['email']=_0x26f2c3[_0x9152('0xa')]||'';this['accountcode']=_0x26f2c3[_0x9152('0xb')]||'';this[_0x9152('0xc')]=_0x26f2c3['fullname']||'';this[_0x9152('0xd')]=_0x9152('0xe');this['stateTime']=0x0;this['status']=_0x9152('0xe');this[_0x9152('0xf')]='';this['phone']='';this[_0x9152('0x10')]='';this[_0x9152('0x11')]='';this[_0x9152('0x12')]=_0x26f2c3[_0x9152('0x12')]||![];this[_0x9152('0x13')]=_0x9152('0xe');this[_0x9152('0x14')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x9152('0x15')]='';this[_0x9152('0x16')]=![];this['local']=![];this['md5']='';}Agent[_0x9152('0x17')]['updateStatusRealtime']=function(_0x1247cd){var _0x1643ad;if(_0x1247cd&&_0x1247cd[_0x9152('0xd')]){_0x1643ad=_0x1247cd['state'][_0x9152('0x18')]();switch(_0x1643ad){case _0x9152('0x19'):_0x1643ad=_0x9152('0x1a');break;case _0x9152('0x1b'):_0x1643ad='talking';break;}}if(_0x1643ad&&this[_0x9152('0x13')]!==_0x1643ad||_0x1247cd['statePause']){this[_0x9152('0x14')]=_[_0x9152('0x1c')](moment()[_0x9152('0x1d')]('x'));}if(_0x1643ad){this[_0x9152('0x13')]=_0x1643ad;}var _0x5ad253={'id':this['id'],'name':this[_0x9152('0x9')],'email':this[_0x9152('0xa')],'accountcode':this[_0x9152('0xb')],'fullname':this['fullname'],'state':this[_0x9152('0xd')],'stateTime':this[_0x9152('0x1e')],'status':this[_0x9152('0x1f')],'address':this[_0x9152('0xf')],'online':this[_0x9152('0x12')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x9152('0x14')],'voiceStatusCallerIdNumber':this[_0x9152('0x20')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9152('0x11')],'onhold':this['onhold']};var _0x440547=md5(JSON[_0x9152('0x21')](_0x5ad253));if(this[_0x9152('0x3')]!==_0x440547){this[_0x9152('0x3')]=_0x440547;io['to'](util[_0x9152('0x1d')](_0x9152('0x22'),_0x5ad253[_0x9152('0x9')]))[_0x9152('0x23')](_0x9152('0x24'),_0x5ad253);}};module[_0x9152('0x25')]=Agent;
\ No newline at end of file
+var _0x85bf=['prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','voiceStatus','statePause','format','voiceStatusQueue','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x85bf,0xdc));var _0xf85b=function(_0x288267,_0x12e1e3){_0x288267=_0x288267-0x0;var _0x5b245c=_0x85bf[_0x288267];return _0x5b245c;};'use strict';var _=require(_0xf85b('0x0'));var util=require(_0xf85b('0x1'));var moment=require(_0xf85b('0x2'));var md5=require(_0xf85b('0x3'));var Redis=require(_0xf85b('0x4'));var config=require(_0xf85b('0x5'));config[_0xf85b('0x6')]=_[_0xf85b('0x7')](config[_0xf85b('0x6')],{'host':_0xf85b('0x8'),'port':0x18eb});var io=require(_0xf85b('0x9'))(new Redis(config[_0xf85b('0x6')]));function Agent(_0x5a5abc){this['id']=_0x5a5abc['id']||0x0;this[_0xf85b('0xa')]=_0x5a5abc[_0xf85b('0xa')]||'';this['email']=_0x5a5abc[_0xf85b('0xb')]||'';this[_0xf85b('0xc')]=_0x5a5abc[_0xf85b('0xc')]||'';this[_0xf85b('0xd')]=_0x5a5abc['fullname']||'';this[_0xf85b('0xe')]=_0xf85b('0xf');this[_0xf85b('0x10')]=0x0;this[_0xf85b('0x11')]='unknown';this['address']='';this[_0xf85b('0x12')]='';this[_0xf85b('0x13')]='';this[_0xf85b('0x14')]='';this[_0xf85b('0x15')]=_0x5a5abc['online']||![];this['voiceStatus']=_0xf85b('0xf');this[_0xf85b('0x16')]=0x0;this[_0xf85b('0x17')]='';this['voiceStatusQueue']='';this[_0xf85b('0x18')]=![];this[_0xf85b('0x19')]=![];this[_0xf85b('0x3')]='';}Agent[_0xf85b('0x1a')][_0xf85b('0x1b')]=function(_0x482d06){var _0x2734f7;if(_0x482d06&&_0x482d06[_0xf85b('0xe')]){_0x2734f7=_0x482d06[_0xf85b('0xe')][_0xf85b('0x1c')]();switch(_0x2734f7){case _0xf85b('0x1d'):_0x2734f7=_0xf85b('0x1e');break;case _0xf85b('0x1f'):_0x2734f7='talking';break;}}if(_0x2734f7&&this[_0xf85b('0x20')]!==_0x2734f7||_0x482d06[_0xf85b('0x21')]){this[_0xf85b('0x16')]=_['toNumber'](moment()[_0xf85b('0x22')]('x'));}if(_0x2734f7){this[_0xf85b('0x20')]=_0x2734f7;}var _0x3a4d24={'id':this['id'],'name':this[_0xf85b('0xa')],'email':this[_0xf85b('0xb')],'accountcode':this['accountcode'],'fullname':this[_0xf85b('0xd')],'state':this[_0xf85b('0xe')],'stateTime':this[_0xf85b('0x10')],'status':this[_0xf85b('0x11')],'address':this['address'],'online':this[_0xf85b('0x15')],'voiceStatus':this[_0xf85b('0x20')],'voiceStatusTime':this[_0xf85b('0x16')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xf85b('0x23')],'interface':this[_0xf85b('0x14')],'onhold':this['onhold']};var _0x21f7fe=md5(JSON[_0xf85b('0x24')](_0x3a4d24));if(this[_0xf85b('0x3')]!==_0x21f7fe){this[_0xf85b('0x3')]=_0x21f7fe;io['to'](util['format'](_0xf85b('0x25'),_0x3a4d24['name']))[_0xf85b('0x26')](_0xf85b('0x27'),_0x3a4d24);}};module[_0xf85b('0x28')]=Agent;
\ No newline at end of file
index 77df078..8ec0099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5db8=['dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x18c4a8,_0x96c52e){var _0x189ff1=function(_0x4a3ea8){while(--_0x4a3ea8){_0x18c4a8['push'](_0x18c4a8['shift']());}};_0x189ff1(++_0x96c52e);}(_0x5db8,0xbb));var _0x85db=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x5db8[_0x47a7d0];return _0xb9bd08;};'use strict';function Campaign(_0x1435b2){this['id']=_0x1435b2['id']||0x0;this[_0x85db('0x0')]=_0x1435b2[_0x85db('0x0')]||'';this['type']=_0x1435b2[_0x85db('0x1')]||_0x85db('0x2');this[_0x85db('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x85db('0x4')]=0x0;this[_0x85db('0x5')]='';this[_0x85db('0x6')]=!![];this[_0x85db('0x7')]=_0x1435b2['active'];this['limitCalls']=_0x1435b2[_0x85db('0x8')];this[_0x85db('0x9')]=_0x1435b2[_0x85db('0x9')]||null;this[_0x85db('0xa')]=_0x1435b2['dialGlobalInterval']?_0x1435b2[_0x85db('0xa')]:null;this['dialOriginateCallerIdName']=_0x1435b2[_0x85db('0xb')];this[_0x85db('0xc')]=_0x1435b2[_0x85db('0xc')];this[_0x85db('0xd')]=_0x1435b2['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x1435b2['dialCongestionMaxRetry'];this[_0x85db('0xe')]=_0x1435b2[_0x85db('0xe')];this['dialBusyMaxRetry']=_0x1435b2[_0x85db('0xf')];this['dialBusyRetryFrequency']=_0x1435b2[_0x85db('0x10')];this[_0x85db('0x11')]=_0x1435b2[_0x85db('0x11')];this[_0x85db('0x12')]=_0x1435b2[_0x85db('0x12')];this[_0x85db('0x13')]=_0x1435b2[_0x85db('0x13')];this[_0x85db('0x14')]=_0x1435b2[_0x85db('0x14')]||_0x85db('0x15');this[_0x85db('0x16')]=_0x1435b2[_0x85db('0x16')]||undefined;this[_0x85db('0x17')]=_0x1435b2['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x85db('0x18')]=_0x1435b2[_0x85db('0x18')]||undefined;this[_0x85db('0x19')]=_0x1435b2[_0x85db('0x19')]?_0x1435b2[_0x85db('0x19')]:undefined;this[_0x85db('0x1a')]=_0x1435b2[_0x85db('0x1a')]?_0x1435b2['Trunk']:undefined;this[_0x85db('0x1b')]=_0x1435b2[_0x85db('0x1b')]?_0x1435b2[_0x85db('0x1b')]:undefined;this[_0x85db('0x1c')]=_0x1435b2[_0x85db('0x1c')]?_0x1435b2[_0x85db('0x1c')]:undefined;this[_0x85db('0x1d')]=_0x1435b2[_0x85db('0x1c')]?_0x1435b2[_0x85db('0x1c')][_0x85db('0x0')]:undefined;this['dialAMDActive']=_0x1435b2[_0x85db('0x1e')]||![];this[_0x85db('0x1f')]=_0x1435b2[_0x85db('0x1f')];this[_0x85db('0x20')]=_0x1435b2[_0x85db('0x20')];this[_0x85db('0x21')]=_0x1435b2[_0x85db('0x21')];this[_0x85db('0x22')]=_0x1435b2['dialAMDTotalAnalysisTime'];this[_0x85db('0x23')]=_0x1435b2[_0x85db('0x23')];this[_0x85db('0x24')]=_0x1435b2[_0x85db('0x24')];this[_0x85db('0x25')]=_0x1435b2[_0x85db('0x25')];this['dialAMDSilenceThreshold']=_0x1435b2[_0x85db('0x26')];this[_0x85db('0x27')]=_0x1435b2[_0x85db('0x27')];}module['exports']=Campaign;
\ No newline at end of file
+var _0xc577=['dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name'];(function(_0x4890f7,_0x115cb3){var _0x4c5d91=function(_0x5fa04){while(--_0x5fa04){_0x4890f7['push'](_0x4890f7['shift']());}};_0x4c5d91(++_0x115cb3);}(_0xc577,0x172));var _0x7c57=function(_0x559499,_0x2ecc11){_0x559499=_0x559499-0x0;var _0x476cb7=_0xc577[_0x559499];return _0x476cb7;};'use strict';function Campaign(_0x5ab927){this['id']=_0x5ab927['id']||0x0;this['name']=_0x5ab927['name']||'';this[_0x7c57('0x0')]=_0x5ab927[_0x7c57('0x0')]||_0x7c57('0x1');this[_0x7c57('0x2')]=0x0;this[_0x7c57('0x3')]=0x0;this[_0x7c57('0x4')]=0x0;this[_0x7c57('0x5')]=0x0;this['message']='';this[_0x7c57('0x6')]=!![];this[_0x7c57('0x7')]=_0x5ab927[_0x7c57('0x7')];this[_0x7c57('0x8')]=_0x5ab927[_0x7c57('0x8')];this['dialTimezone']=_0x5ab927['dialTimezone']||null;this['dialGlobalInterval']=_0x5ab927[_0x7c57('0x9')]?_0x5ab927['dialGlobalInterval']:null;this[_0x7c57('0xa')]=_0x5ab927[_0x7c57('0xa')];this[_0x7c57('0xb')]=_0x5ab927[_0x7c57('0xb')];this['dialOriginateTimeout']=_0x5ab927[_0x7c57('0xc')]||0x1e;this[_0x7c57('0xd')]=_0x5ab927['dialCongestionMaxRetry'];this[_0x7c57('0xe')]=_0x5ab927[_0x7c57('0xe')];this[_0x7c57('0xf')]=_0x5ab927[_0x7c57('0xf')];this[_0x7c57('0x10')]=_0x5ab927[_0x7c57('0x10')];this[_0x7c57('0x11')]=_0x5ab927['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x5ab927['dialNoAnswerRetryFrequency'];this[_0x7c57('0x12')]=_0x5ab927[_0x7c57('0x12')];this[_0x7c57('0x13')]=_0x5ab927[_0x7c57('0x13')]||_0x7c57('0x14');this[_0x7c57('0x15')]=_0x5ab927[_0x7c57('0x15')]||undefined;this[_0x7c57('0x16')]=_0x5ab927['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x5ab927[_0x7c57('0x17')]||undefined;this[_0x7c57('0x18')]=_0x5ab927[_0x7c57('0x18')]?_0x5ab927[_0x7c57('0x18')]:undefined;this[_0x7c57('0x19')]=_0x5ab927['Trunk']?_0x5ab927[_0x7c57('0x19')]:undefined;this[_0x7c57('0x1a')]=_0x5ab927[_0x7c57('0x1a')]?_0x5ab927[_0x7c57('0x1a')]:undefined;this[_0x7c57('0x1b')]=_0x5ab927[_0x7c57('0x1b')]?_0x5ab927[_0x7c57('0x1b')]:undefined;this[_0x7c57('0x1c')]=_0x5ab927[_0x7c57('0x1b')]?_0x5ab927['SquareProject'][_0x7c57('0x1d')]:undefined;this[_0x7c57('0x1e')]=_0x5ab927[_0x7c57('0x1e')]||![];this[_0x7c57('0x1f')]=_0x5ab927['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x5ab927['dialAMDGreeting'];this[_0x7c57('0x20')]=_0x5ab927[_0x7c57('0x20')];this['dialAMDTotalAnalysisTime']=_0x5ab927[_0x7c57('0x21')];this[_0x7c57('0x22')]=_0x5ab927[_0x7c57('0x22')];this[_0x7c57('0x23')]=_0x5ab927[_0x7c57('0x23')];this[_0x7c57('0x24')]=_0x5ab927[_0x7c57('0x24')];this['dialAMDSilenceThreshold']=_0x5ab927[_0x7c57('0x25')];this[_0x7c57('0x26')]=_0x5ab927[_0x7c57('0x26')];}module[_0x7c57('0x27')]=Campaign;
\ No newline at end of file
index bef81ae..07936e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x078f=['lastapplication','lastdata','billableseconds','type','tag','disposition','monitor','queue','transfercalleridnum','transferconnectedlinenum','mohtime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned'];(function(_0x11f0a6,_0x1ce59d){var _0xa5ab4b=function(_0x42fd28){while(--_0x42fd28){_0x11f0a6['push'](_0x11f0a6['shift']());}};_0xa5ab4b(++_0x1ce59d);}(_0x078f,0x1b4));var _0xf078=function(_0x5941bb,_0x9846f7){_0x5941bb=_0x5941bb-0x0;var _0x593717=_0x078f[_0x5941bb];return _0x593717;};'use strict';function Channel(){this['starttime']=null;this[_0xf078('0x0')]='';this[_0xf078('0x1')]='';this['calleridnum']=0x0;this[_0xf078('0x2')]='';this[_0xf078('0x3')]=undefined;this[_0xf078('0x4')]=undefined;this[_0xf078('0x5')]=0x0;this['context']='';this[_0xf078('0x6')]=0x0;this[_0xf078('0x7')]=0x0;this[_0xf078('0x8')]=0x0;this[_0xf078('0x9')]=![];this[_0xf078('0xa')]=null;this[_0xf078('0xb')]=null;this[_0xf078('0xc')]=![];this[_0xf078('0xd')]=![];this[_0xf078('0xe')]='';this[_0xf078('0xf')]='';this['duration']=0x0;this[_0xf078('0x10')]=0x0;this['holdtime']=0x0;this[_0xf078('0x11')]=null;this[_0xf078('0x12')]=null;this[_0xf078('0x13')]=null;this[_0xf078('0x14')]=![];this['monitorFilename']=null;this[_0xf078('0x15')]=null;this['monitors']=[];this[_0xf078('0x16')]=undefined;this[_0xf078('0x17')]=undefined;this[_0xf078('0x18')]=0x0;}module['exports']=Channel;
\ No newline at end of file
+var _0x9e69=['channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','uniqueid','linkedid','exten','answertime','endtime','unmanaged','lastapplication','lastdata','billableseconds','holdtime','tag','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9e69,0x150));var _0x99e6=function(_0x7c5bda,_0x4f5b5f){_0x7c5bda=_0x7c5bda-0x0;var _0x649788=_0x9e69[_0x7c5bda];return _0x649788;};'use strict';function Channel(){this['starttime']=null;this[_0x99e6('0x0')]='';this[_0x99e6('0x1')]='';this[_0x99e6('0x2')]=0x0;this[_0x99e6('0x3')]='';this['connectedlinenum']=undefined;this[_0x99e6('0x4')]=undefined;this[_0x99e6('0x5')]=0x0;this['context']='';this[_0x99e6('0x6')]=0x0;this[_0x99e6('0x7')]=0x0;this[_0x99e6('0x8')]=0x0;this['answered']=![];this[_0x99e6('0x9')]=null;this[_0x99e6('0xa')]=null;this[_0x99e6('0xb')]=![];this['abandoned']=![];this[_0x99e6('0xc')]='';this[_0x99e6('0xd')]='';this['duration']=0x0;this[_0x99e6('0xe')]=0x0;this[_0x99e6('0xf')]=0x0;this['type']=null;this[_0x99e6('0x10')]=null;this[_0x99e6('0x11')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x99e6('0x12')]=null;this[_0x99e6('0x13')]=[];this[_0x99e6('0x14')]=undefined;this[_0x99e6('0x15')]=undefined;this[_0x99e6('0x16')]=0x0;}module[_0x99e6('0x17')]=Channel;
\ No newline at end of file
index 5e5bfe6..aad9ff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2355=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x4edc7e,_0x45f0ee){var _0x4be20f=function(_0x272dda){while(--_0x272dda){_0x4edc7e['push'](_0x4edc7e['shift']());}};_0x4be20f(++_0x45f0ee);}(_0x2355,0x12e));var _0x5235=function(_0x3ef65a,_0x2f16d6){_0x3ef65a=_0x3ef65a-0x0;var _0x5a00a4=_0x2355[_0x3ef65a];return _0x5a00a4;};'use strict';function DeskAccount(_0x3e0e60){this['id']=_0x3e0e60['id']||0x0;this[_0x5235('0x0')]=_0x3e0e60[_0x5235('0x0')]||'';this[_0x5235('0x1')]=_0x3e0e60[_0x5235('0x1')]||'';this[_0x5235('0x2')]=_0x3e0e60['remoteUri']||'';this[_0x5235('0x3')]=_0x3e0e60[_0x5235('0x3')]||'';this[_0x5235('0x4')]=_0x3e0e60[_0x5235('0x4')]||'';this[_0x5235('0x5')]=_0x3e0e60[_0x5235('0x5')]||'';this[_0x5235('0x6')]=_0x3e0e60[_0x5235('0x6')]||'';this[_0x5235('0x7')]=_0x3e0e60[_0x5235('0x7')]||'';this[_0x5235('0x8')]=_0x3e0e60[_0x5235('0x8')]||'';this[_0x5235('0x9')]=_0x3e0e60[_0x5235('0x9')]||'';this[_0x5235('0xa')]=_0x3e0e60[_0x5235('0xa')]||'';this[_0x5235('0xb')]=_0x3e0e60[_0x5235('0xb')]||{};}module[_0x5235('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xc14d=['remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username'];(function(_0x20ead0,_0x27a30a){var _0x1c99f5=function(_0x145d8e){while(--_0x145d8e){_0x20ead0['push'](_0x20ead0['shift']());}};_0x1c99f5(++_0x27a30a);}(_0xc14d,0xfb));var _0xdc14=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc14d[_0xa464c9];return _0x3d73c4;};'use strict';function DeskAccount(_0x4ea87c){this['id']=_0x4ea87c['id']||0x0;this[_0xdc14('0x0')]=_0x4ea87c[_0xdc14('0x0')]||'';this[_0xdc14('0x1')]=_0x4ea87c['username']||'';this['remoteUri']=_0x4ea87c[_0xdc14('0x2')]||'';this[_0xdc14('0x3')]=_0x4ea87c['authType']||'';this['password']=_0x4ea87c['password']||'';this[_0xdc14('0x4')]=_0x4ea87c[_0xdc14('0x4')]||'';this[_0xdc14('0x5')]=_0x4ea87c[_0xdc14('0x5')]||'';this['token']=_0x4ea87c[_0xdc14('0x6')]||'';this[_0xdc14('0x7')]=_0x4ea87c['tokenSecret']||'';this['type']=_0x4ea87c['type']||'';this[_0xdc14('0x8')]=_0x4ea87c[_0xdc14('0x8')]||'';this[_0xdc14('0x9')]=_0x4ea87c['Configurations']||{};}module[_0xdc14('0xa')]=DeskAccount;
\ No newline at end of file
index a6a94b5..d3eee4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','faxdetect','t38timeout','tech','SIP'];(function(_0x20f32d,_0x3a4d5a){var _0x5b6e4a=function(_0x5b8f4f){while(--_0x5b8f4f){_0x20f32d['push'](_0x20f32d['shift']());}};_0x5b6e4a(++_0x3a4d5a);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0xb4e6[_0x2338fa];return _0x42df9b;};'use strict';function FaxAccount(_0x54acd0){this['id']=_0x54acd0['id']||0x0;this['name']=_0x54acd0[_0x6b4e('0x0')]||'';this[_0x6b4e('0x1')]=_0x54acd0[_0x6b4e('0x1')];this[_0x6b4e('0x2')]=_0x54acd0[_0x6b4e('0x2')];this[_0x6b4e('0x3')]=_0x54acd0[_0x6b4e('0x3')];this['localstationid']=_0x54acd0[_0x6b4e('0x4')];this[_0x6b4e('0x5')]=_0x54acd0[_0x6b4e('0x5')]||0x960;this['maxrate']=_0x54acd0[_0x6b4e('0x6')]||0x3840;this['modem']=_0x54acd0['modem']||_0x6b4e('0x7');this['gateway']=_0x54acd0['gateway']||'no';this[_0x6b4e('0x8')]=_0x54acd0[_0x6b4e('0x8')]||'no';this[_0x6b4e('0x9')]=_0x54acd0[_0x6b4e('0x9')]||0x1388;this[_0x6b4e('0xa')]=_0x54acd0[_0x6b4e('0xa')]||_0x6b4e('0xb');this['Trunk']=_0x54acd0[_0x6b4e('0xc')]?_0x54acd0[_0x6b4e('0xc')]:undefined;this['ListId']=_0x54acd0[_0x6b4e('0xd')];this[_0x6b4e('0xe')]=_0x54acd0[_0x6b4e('0xe')];}module[_0x6b4e('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x3140=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','t38timeout','tech','SIP','Trunk','ListId','key','exports','name'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3140,0xaf));var _0x0314=function(_0x465c3b,_0x384cf1){_0x465c3b=_0x465c3b-0x0;var _0x67f5d8=_0x3140[_0x465c3b];return _0x67f5d8;};'use strict';function FaxAccount(_0xe9f04d){this['id']=_0xe9f04d['id']||0x0;this[_0x0314('0x0')]=_0xe9f04d[_0x0314('0x0')]||'';this[_0x0314('0x1')]=_0xe9f04d['description'];this['ecm']=_0xe9f04d[_0x0314('0x2')];this[_0x0314('0x3')]=_0xe9f04d[_0x0314('0x3')];this[_0x0314('0x4')]=_0xe9f04d[_0x0314('0x4')];this[_0x0314('0x5')]=_0xe9f04d[_0x0314('0x5')]||0x960;this[_0x0314('0x6')]=_0xe9f04d[_0x0314('0x6')]||0x3840;this[_0x0314('0x7')]=_0xe9f04d[_0x0314('0x7')]||'v17,v27,v29';this[_0x0314('0x8')]=_0xe9f04d[_0x0314('0x8')]||'no';this['faxdetect']=_0xe9f04d['faxdetect']||'no';this[_0x0314('0x9')]=_0xe9f04d['t38timeout']||0x1388;this[_0x0314('0xa')]=_0xe9f04d[_0x0314('0xa')]||_0x0314('0xb');this[_0x0314('0xc')]=_0xe9f04d[_0x0314('0xc')]?_0xe9f04d[_0x0314('0xc')]:undefined;this['ListId']=_0xe9f04d[_0x0314('0xd')];this[_0x0314('0xe')]=_0xe9f04d[_0x0314('0xe')];}module[_0x0314('0xf')]=FaxAccount;
\ No newline at end of file
index d30a708..01b8beb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd69d=['remoteUri','serverUrl','exports','name','username','apiKey','token'];(function(_0x3da047,_0x167b2c){var _0x5040c8=function(_0x5c995a){while(--_0x5c995a){_0x3da047['push'](_0x3da047['shift']());}};_0x5040c8(++_0x167b2c);}(_0xd69d,0x11b));var _0xdd69=function(_0x27a743,_0x13a7ae){_0x27a743=_0x27a743-0x0;var _0x51fd00=_0xd69d[_0x27a743];return _0x51fd00;};'use strict';function FreshdeskAccount(_0x761d87){this['id']=_0x761d87['id']||0x0;this[_0xdd69('0x0')]=_0x761d87[_0xdd69('0x0')]||'';this[_0xdd69('0x1')]=_0x761d87['username']||'';this[_0xdd69('0x2')]=_0x761d87[_0xdd69('0x3')]||'';this[_0xdd69('0x4')]=_0x761d87['remoteUri']||'';this[_0xdd69('0x5')]=_0x761d87['serverUrl']||'';this['Configurations']=_0x761d87['Configurations']||{};}module[_0xdd69('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x7fde=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x2f154a,_0x264afc){var _0x4404f6=function(_0x3a0b2b){while(--_0x3a0b2b){_0x2f154a['push'](_0x2f154a['shift']());}};_0x4404f6(++_0x264afc);}(_0x7fde,0xc3));var _0xe7fd=function(_0x55d60c,_0x33bf52){_0x55d60c=_0x55d60c-0x0;var _0x35b654=_0x7fde[_0x55d60c];return _0x35b654;};'use strict';function FreshdeskAccount(_0x241990){this['id']=_0x241990['id']||0x0;this[_0xe7fd('0x0')]=_0x241990['name']||'';this['username']=_0x241990[_0xe7fd('0x1')]||'';this[_0xe7fd('0x2')]=_0x241990[_0xe7fd('0x3')]||'';this[_0xe7fd('0x4')]=_0x241990[_0xe7fd('0x4')]||'';this[_0xe7fd('0x5')]=_0x241990[_0xe7fd('0x5')]||'';this[_0xe7fd('0x6')]=_0x241990[_0xe7fd('0x6')]||{};}module[_0xe7fd('0x7')]=FreshdeskAccount;
\ No newline at end of file
index 9438f76..55378a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ad3=['queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','variables','exports','type','inbound','uniqueid','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt'];(function(_0x25cf3c,_0x5d0270){var _0xfa8f6=function(_0x372eab){while(--_0x372eab){_0x25cf3c['push'](_0x25cf3c['shift']());}};_0xfa8f6(++_0x5d0270);}(_0x0ad3,0x188));var _0x30ad=function(_0x2cd0fd,_0x137ab0){_0x2cd0fd=_0x2cd0fd-0x0;var _0x36f5fe=_0x0ad3[_0x2cd0fd];return _0x36f5fe;};'use strict';function QueueReport(){this[_0x30ad('0x0')]=_0x30ad('0x1');this[_0x30ad('0x2')]='';this['calleridnum']='';this['calleridname']='';this['queue']='';this[_0x30ad('0x3')]=null;this[_0x30ad('0x4')]=null;this['position']=0x1;this[_0x30ad('0x5')]=0x1;this['queuecallerabandon']=![];this[_0x30ad('0x6')]=null;this[_0x30ad('0x7')]=![];this[_0x30ad('0x8')]=null;this[_0x30ad('0x9')]=![];this['queuecallerexitAt']=null;this[_0x30ad('0xa')]=0x1;this['channel']='';this['connectedlinenum']='';this[_0x30ad('0xb')]='';this[_0x30ad('0xc')]='';this[_0x30ad('0xd')]='';this[_0x30ad('0xe')]='';this[_0x30ad('0xf')]='';this[_0x30ad('0x10')]=0x0;this[_0x30ad('0x11')]=![];this[_0x30ad('0x12')]='';this['mohtime']=0x0;this[_0x30ad('0x13')]={};}module[_0x30ad('0x14')]=QueueReport;
\ No newline at end of file
+var _0xee29=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','exten','priority','holdtime','assigned','exports','type','inbound','calleridname','queue','queuecallerleaveAt','count'];(function(_0x550106,_0x32d5cf){var _0x3919ff=function(_0x1aec82){while(--_0x1aec82){_0x550106['push'](_0x550106['shift']());}};_0x3919ff(++_0x32d5cf);}(_0xee29,0x150));var _0x9ee2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee29[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this[_0x9ee2('0x0')]=_0x9ee2('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x9ee2('0x2')]='';this[_0x9ee2('0x3')]='';this['queuecallerjoinAt']=null;this[_0x9ee2('0x4')]=null;this['position']=0x1;this[_0x9ee2('0x5')]=0x1;this['queuecallerabandon']=![];this[_0x9ee2('0x6')]=null;this[_0x9ee2('0x7')]=![];this[_0x9ee2('0x8')]=null;this[_0x9ee2('0x9')]=![];this[_0x9ee2('0xa')]=null;this[_0x9ee2('0xb')]=0x1;this[_0x9ee2('0xc')]='';this['connectedlinenum']='';this[_0x9ee2('0xd')]='';this['accountcode']='';this['context']='';this[_0x9ee2('0xe')]='';this[_0x9ee2('0xf')]='';this[_0x9ee2('0x10')]=0x0;this[_0x9ee2('0x11')]=![];this['lastAssignedTo']='';this['mohtime']=0x0;this['variables']={};}module[_0x9ee2('0x12')]=QueueReport;
\ No newline at end of file
index 054e02a..a50c66a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb389=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0xb389,0x1e8));var _0x9b38=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xb389[_0xbb9dbf];return _0x30223c;};'use strict';function SalesforceAccount(_0x18061a){this['id']=_0x18061a['id']||0x0;this[_0x9b38('0x0')]=_0x18061a[_0x9b38('0x0')]||'';this[_0x9b38('0x1')]=_0x18061a[_0x9b38('0x1')]||'';this[_0x9b38('0x2')]=_0x18061a[_0x9b38('0x2')]||'';this[_0x9b38('0x3')]=_0x18061a[_0x9b38('0x3')]||'';this[_0x9b38('0x4')]=_0x18061a[_0x9b38('0x4')]||'';this[_0x9b38('0x5')]=_0x18061a[_0x9b38('0x5')]||'';this[_0x9b38('0x6')]=_0x18061a[_0x9b38('0x6')]||'';this['type']=_0x18061a[_0x9b38('0x7')]||_0x9b38('0x8');this[_0x9b38('0x9')]=_0x18061a[_0x9b38('0x9')]||'';this[_0x9b38('0xa')]=_0x18061a[_0x9b38('0xa')]||{};}module[_0x9b38('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0x4494=['serverUrl','Configurations','exports','name','username','remoteUri','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x3ce63e,_0x3757b0){var _0x280a13=function(_0x2db361){while(--_0x2db361){_0x3ce63e['push'](_0x3ce63e['shift']());}};_0x280a13(++_0x3757b0);}(_0x4494,0x18f));var _0x4449=function(_0x5d3a26,_0x2df07d){_0x5d3a26=_0x5d3a26-0x0;var _0x4c7bdf=_0x4494[_0x5d3a26];return _0x4c7bdf;};'use strict';function SalesforceAccount(_0x3d8671){this['id']=_0x3d8671['id']||0x0;this[_0x4449('0x0')]=_0x3d8671[_0x4449('0x0')]||'';this[_0x4449('0x1')]=_0x3d8671['username']||'';this[_0x4449('0x2')]=_0x3d8671['remoteUri']||'';this['password']=_0x3d8671['password']||'';this['clientId']=_0x3d8671[_0x4449('0x3')]||'';this[_0x4449('0x4')]=_0x3d8671[_0x4449('0x4')]||'';this[_0x4449('0x5')]=_0x3d8671[_0x4449('0x5')]||'';this[_0x4449('0x6')]=_0x3d8671[_0x4449('0x6')]||_0x4449('0x7');this[_0x4449('0x8')]=_0x3d8671['serverUrl']||'';this['Configurations']=_0x3d8671[_0x4449('0x9')]||{};}module[_0x4449('0xa')]=SalesforceAccount;
\ No newline at end of file
index 0022951..1a1299e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2707=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x5a80ce,_0x9a5ba3){var _0x50f4df=function(_0x4a9faa){while(--_0x4a9faa){_0x5a80ce['push'](_0x5a80ce['shift']());}};_0x50f4df(++_0x9a5ba3);}(_0x2707,0xeb));var _0x7270=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x2707[_0x22b68a];return _0x1ac67a;};'use strict';function SugarcrmAccount(_0x431b4b){this['id']=_0x431b4b['id']||0x0;this[_0x7270('0x0')]=_0x431b4b[_0x7270('0x0')]||'';this['username']=_0x431b4b[_0x7270('0x1')]||'';this[_0x7270('0x2')]=_0x431b4b[_0x7270('0x2')]||'';this[_0x7270('0x3')]=_0x431b4b[_0x7270('0x3')]||'';this[_0x7270('0x4')]=_0x431b4b[_0x7270('0x4')]||'';this[_0x7270('0x5')]=_0x431b4b[_0x7270('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0x65ce=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x45b3cb,_0x248fbf){var _0x6c034=function(_0x1c36f2){while(--_0x1c36f2){_0x45b3cb['push'](_0x45b3cb['shift']());}};_0x6c034(++_0x248fbf);}(_0x65ce,0xb1));var _0xe65c=function(_0x2cae51,_0x4687c0){_0x2cae51=_0x2cae51-0x0;var _0x1cc24e=_0x65ce[_0x2cae51];return _0x1cc24e;};'use strict';function SugarcrmAccount(_0x13ca63){this['id']=_0x13ca63['id']||0x0;this[_0xe65c('0x0')]=_0x13ca63['name']||'';this[_0xe65c('0x1')]=_0x13ca63[_0xe65c('0x1')]||'';this[_0xe65c('0x2')]=_0x13ca63[_0xe65c('0x2')]||'';this[_0xe65c('0x3')]=_0x13ca63[_0xe65c('0x3')]||'';this['serverUrl']=_0x13ca63[_0xe65c('0x4')]||'';this[_0xe65c('0x5')]=_0x13ca63[_0xe65c('0x5')]||{};}module[_0xe65c('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 42c1325..2bf39ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8689=['state','status','address','exports','name','accountcode'];(function(_0x232ec0,_0x45fdd0){var _0x356705=function(_0x4099ea){while(--_0x4099ea){_0x232ec0['push'](_0x232ec0['shift']());}};_0x356705(++_0x45fdd0);}(_0x8689,0x1de));var _0x9868=function(_0x8a77ba,_0x140bcc){_0x8a77ba=_0x8a77ba-0x0;var _0x5a68b7=_0x8689[_0x8a77ba];return _0x5a68b7;};'use strict';function Telephone(_0x13cf3b){this['id']=_0x13cf3b['id']||0x0;this[_0x9868('0x0')]=_0x13cf3b['name']||'';this[_0x9868('0x1')]=_0x13cf3b[_0x9868('0x1')]||'';this[_0x9868('0x2')]='unknown';this['stateTime']=0x0;this[_0x9868('0x3')]='unknown';this[_0x9868('0x4')]='';}module[_0x9868('0x5')]=Telephone;
\ No newline at end of file
+var _0x0a47=['state','stateTime','status','unknown','address','exports','name','accountcode'];(function(_0x388b46,_0x2314f6){var _0x359190=function(_0x439c09){while(--_0x439c09){_0x388b46['push'](_0x388b46['shift']());}};_0x359190(++_0x2314f6);}(_0x0a47,0x66));var _0x70a4=function(_0x578956,_0x561e5f){_0x578956=_0x578956-0x0;var _0x49767a=_0x0a47[_0x578956];return _0x49767a;};'use strict';function Telephone(_0x4ff58f){this['id']=_0x4ff58f['id']||0x0;this[_0x70a4('0x0')]=_0x4ff58f[_0x70a4('0x0')]||'';this[_0x70a4('0x1')]=_0x4ff58f[_0x70a4('0x1')]||'';this[_0x70a4('0x2')]='unknown';this[_0x70a4('0x3')]=0x0;this[_0x70a4('0x4')]=_0x70a4('0x5');this[_0x70a4('0x6')]='';}module[_0x70a4('0x7')]=Telephone;
\ No newline at end of file
index 8e8c540..c182773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['exports','name','html'];(function(_0x10b7b4,_0x1baea5){var _0x1a5fc5=function(_0x2b18f9){while(--_0x2b18f9){_0x10b7b4['push'](_0x10b7b4['shift']());}};_0x1a5fc5(++_0x1baea5);}(_0x9f62,0x154));var _0x29f6=function(_0x34e6eb,_0x561f8e){_0x34e6eb=_0x34e6eb-0x0;var _0x4c8f81=_0x9f62[_0x34e6eb];return _0x4c8f81;};'use strict';function template(_0x5c9988){this['id']=_0x5c9988['id']||0x0;this[_0x29f6('0x0')]=_0x5c9988['name']||'';this[_0x29f6('0x1')]=_0x5c9988[_0x29f6('0x1')]||'';}module[_0x29f6('0x2')]=template;
\ No newline at end of file
+var _0xe14d=['html','exports','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14d,0x1ee));var _0xde14=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe14d[_0x167cc1];return _0x10bc4b;};'use strict';function template(_0x49b7c3){this['id']=_0x49b7c3['id']||0x0;this[_0xde14('0x0')]=_0x49b7c3[_0xde14('0x0')]||'';this[_0xde14('0x1')]=_0x49b7c3['html']||'';}module[_0xde14('0x2')]=template;
\ No newline at end of file
index 4237e8b..10e804c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc18a=['name','channel','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc18a,0x98));var _0xac18=function(_0x3caa65,_0x4aa770){_0x3caa65=_0x3caa65-0x0;var _0x4aeba7=_0xc18a[_0x3caa65];return _0x4aeba7;};'use strict';function Trigger(_0x5182fb){this['id']=_0x5182fb['id']||0x0;this[_0xac18('0x0')]=_0x5182fb[_0xac18('0x0')]||'';this[_0xac18('0x1')]=_0x5182fb[_0xac18('0x1')]||_0xac18('0x2');this[_0xac18('0x3')]=_0x5182fb[_0xac18('0x3')]||![];this[_0xac18('0x4')]=_0x5182fb[_0xac18('0x4')]||[];this[_0xac18('0x5')]=_0x5182fb[_0xac18('0x5')]||[];this[_0xac18('0x6')]=_0x5182fb[_0xac18('0x6')]||[];}module[_0xac18('0x7')]=Trigger;
\ No newline at end of file
+var _0xa196=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x251afb,_0x4f4d77){var _0x57e095=function(_0x298956){while(--_0x298956){_0x251afb['push'](_0x251afb['shift']());}};_0x57e095(++_0x4f4d77);}(_0xa196,0x1de));var _0x6a19=function(_0x215dec,_0x41a6b6){_0x215dec=_0x215dec-0x0;var _0x43d2b9=_0xa196[_0x215dec];return _0x43d2b9;};'use strict';function Trigger(_0x38ce7a){this['id']=_0x38ce7a['id']||0x0;this[_0x6a19('0x0')]=_0x38ce7a[_0x6a19('0x0')]||'';this['channel']=_0x38ce7a[_0x6a19('0x1')]||_0x6a19('0x2');this[_0x6a19('0x3')]=_0x38ce7a[_0x6a19('0x3')]||![];this[_0x6a19('0x4')]=_0x38ce7a[_0x6a19('0x4')]||[];this[_0x6a19('0x5')]=_0x38ce7a[_0x6a19('0x5')]||[];this[_0x6a19('0x6')]=_0x38ce7a[_0x6a19('0x6')]||[];}module[_0x6a19('0x7')]=Trigger;
\ No newline at end of file
index 7bf0c55..08e143c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf315=['state','unknown','status','registry','indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime','active','name'];(function(_0x22f057,_0x4fab8d){var _0x103fa1=function(_0x54fdc4){while(--_0x54fdc4){_0x22f057['push'](_0x22f057['shift']());}};_0x103fa1(++_0x4fab8d);}(_0xf315,0x98));var _0x5f31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf315[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x3ff372){this['id']=_0x3ff372['id']||0x0;this[_0x5f31('0x0')]=_0x3ff372[_0x5f31('0x0')]||![];this[_0x5f31('0x1')]=_0x3ff372[_0x5f31('0x1')]||'';this[_0x5f31('0x2')]=_0x5f31('0x3');this['stateTime']=0x0;this[_0x5f31('0x4')]=_0x5f31('0x3');this[_0x5f31('0x5')]=_0x3ff372['registry']&&_0x3ff372[_0x5f31('0x5')][_0x5f31('0x6')](':')?_0x3ff372['registry'][_0x5f31('0x7')](':')[0x0]:'';this[_0x5f31('0x8')]='';this[_0x5f31('0x9')]='';this[_0x5f31('0xa')]='';this['domainport']='';this[_0x5f31('0xb')]='';this[_0x5f31('0xc')]=_0x5f31('0x3');this[_0x5f31('0xd')]='';this['address']='';}module['exports']=Trunk;
\ No newline at end of file
+var _0x2759=['address','active','name','state','unknown','status','registry','indexOf','split','domainport','refresh','registrationtime'];(function(_0x545882,_0x9414ba){var _0x4c7dcb=function(_0xb331c6){while(--_0xb331c6){_0x545882['push'](_0x545882['shift']());}};_0x4c7dcb(++_0x9414ba);}(_0x2759,0xc1));var _0x9275=function(_0x4e1c3c,_0x2a8084){_0x4e1c3c=_0x4e1c3c-0x0;var _0x1c7150=_0x2759[_0x4e1c3c];return _0x1c7150;};'use strict';function Trunk(_0x908894){this['id']=_0x908894['id']||0x0;this[_0x9275('0x0')]=_0x908894[_0x9275('0x0')]||![];this[_0x9275('0x1')]=_0x908894[_0x9275('0x1')]||'';this[_0x9275('0x2')]=_0x9275('0x3');this['stateTime']=0x0;this[_0x9275('0x4')]=_0x9275('0x3');this['registry']=_0x908894[_0x9275('0x5')]&&_0x908894[_0x9275('0x5')][_0x9275('0x6')](':')?_0x908894['registry'][_0x9275('0x7')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this[_0x9275('0x8')]='';this[_0x9275('0x9')]='';this['stateRegistry']=_0x9275('0x3');this[_0x9275('0xa')]='';this[_0x9275('0xb')]='';}module['exports']=Trunk;
\ No newline at end of file
index 40afe72..4167b58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['none','exten','recordingFormat'];(function(_0x368621,_0x4a687a){var _0x5c012f=function(_0x416345){while(--_0x416345){_0x368621['push'](_0x368621['shift']());}};_0x5c012f(++_0x4a687a);}(_0xac4a,0x13f));var _0xaac4=function(_0x107ce2,_0x5a9b89){_0x107ce2=_0x107ce2-0x0;var _0x95f9ed=_0xac4a[_0x107ce2];return _0x95f9ed;};'use strict';function voiceExtension(_0x5d2081){this['id']=_0x5d2081['id']||0x0;this[_0xaac4('0x0')]=_0x5d2081[_0xaac4('0x0')]||'';this[_0xaac4('0x1')]=_0x5d2081[_0xaac4('0x1')]||_0xaac4('0x2');}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x41bb=['exports','exten','recordingFormat','none'];(function(_0x79d5dc,_0x4a6260){var _0x8b9c09=function(_0x4474dd){while(--_0x4474dd){_0x79d5dc['push'](_0x79d5dc['shift']());}};_0x8b9c09(++_0x4a6260);}(_0x41bb,0xc5));var _0xb41b=function(_0x2e398d,_0x361b6e){_0x2e398d=_0x2e398d-0x0;var _0x53c305=_0x41bb[_0x2e398d];return _0x53c305;};'use strict';function voiceExtension(_0x4337f5){this['id']=_0x4337f5['id']||0x0;this[_0xb41b('0x0')]=_0x4337f5['exten']||'';this[_0xb41b('0x1')]=_0x4337f5['recordingFormat']||_0xb41b('0x2');}module[_0xb41b('0x3')]=voiceExtension;
\ No newline at end of file
index f8ae46f..8c5745c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf0=['predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','type','waiting','talking','total','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalLowerLimit'];(function(_0x27630c,_0x4b5a02){var _0x404ec6=function(_0x5100e6){while(--_0x5100e6){_0x27630c['push'](_0x27630c['shift']());}};_0x404ec6(++_0x4b5a02);}(_0xacf0,0x7c));var _0x0acf=function(_0x1776f3,_0x1ccbbc){_0x1776f3=_0x1776f3-0x0;var _0x14ea38=_0xacf0[_0x1776f3];return _0x14ea38;};'use strict';var statusDesc=[_0x0acf('0x0'),_0x0acf('0x1'),_0x0acf('0x2'),_0x0acf('0x3'),_0x0acf('0x4'),_0x0acf('0x5'),_0x0acf('0x6'),_0x0acf('0x7'),_0x0acf('0x8')];var monitorFormat={'wav':_0x0acf('0x9'),'wav49':_0x0acf('0xa'),'gsm':_0x0acf('0xb')};var strategy={'rrmemory':_0x0acf('0xc'),'roundrobin':'roundrobin'};function VoiceQueue(_0x1cfd3b){this['id']=_0x1cfd3b['id']||0x0;this[_0x0acf('0xd')]=_0x1cfd3b[_0x0acf('0xd')]||'';this['monitor_format']=_0x1cfd3b['monitor_format']||'';this[_0x0acf('0xe')]=_0x1cfd3b['type']||'inbound';this[_0x0acf('0xf')]=0x0;this[_0x0acf('0x10')]=0x0;this[_0x0acf('0x11')]=0x0;this['answered']=0x0;this[_0x0acf('0x12')]=0x0;this[_0x0acf('0x13')]=0x0;this['sumBillable']=0x0;this[_0x0acf('0x14')]=0x0;this[_0x0acf('0x15')]=0x0;this[_0x0acf('0x16')]=0x0;this[_0x0acf('0x17')]=0x0;this['acw']=_0x1cfd3b[_0x0acf('0x18')]||![];this[_0x0acf('0x19')]=_0x1cfd3b[_0x0acf('0x19')]||0xa;this[_0x0acf('0x1a')]=_0x1cfd3b[_0x0acf('0x1a')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this['originated']=0x0;this[_0x0acf('0x1b')]=0x0;this[_0x0acf('0x1c')]=_0x1cfd3b[_0x0acf('0x1c')]||null;this[_0x0acf('0x1d')]=_0x1cfd3b[_0x0acf('0x1d')]?_0x1cfd3b[_0x0acf('0x1d')]:null;this[_0x0acf('0x1e')]=_0x1cfd3b[_0x0acf('0x1e')];this[_0x0acf('0x1f')]=_0x1cfd3b[_0x0acf('0x1f')]||'progressive';this[_0x0acf('0x20')]=_0x1cfd3b[_0x0acf('0x20')]||0x0;this[_0x0acf('0x21')]=_0x1cfd3b[_0x0acf('0x21')]||0x0;this[_0x0acf('0x22')]=_0x1cfd3b[_0x0acf('0x22')]||0x1;this[_0x0acf('0x23')]=_0x1cfd3b[_0x0acf('0x23')]||_0x0acf('0x24');this[_0x0acf('0x25')]=_0x1cfd3b['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x1cfd3b[_0x0acf('0x26')]||0x258;this[_0x0acf('0x27')]=_0x1cfd3b[_0x0acf('0x27')]||_0x0acf('0x28');this[_0x0acf('0x29')]=_0x1cfd3b['dialOriginateCallerIdNumber']||_0x0acf('0x28');this[_0x0acf('0x2a')]=_0x1cfd3b[_0x0acf('0x2a')]||0x1e;this['dialQueueOptions']=_0x1cfd3b['dialQueueOptions']||_0x0acf('0x2b');this['dialQueueTimeout']=_0x1cfd3b[_0x0acf('0x2c')]||0x3;this[_0x0acf('0x2d')]=_0x1cfd3b[_0x0acf('0x2d')]||undefined;this[_0x0acf('0x2e')]=_0x1cfd3b[_0x0acf('0x2e')]||0x3;this[_0x0acf('0x2f')]=_0x1cfd3b[_0x0acf('0x2f')]||0x96;this[_0x0acf('0x30')]=_0x1cfd3b[_0x0acf('0x30')]||0x3;this[_0x0acf('0x31')]=_0x1cfd3b[_0x0acf('0x31')]||0x96;this[_0x0acf('0x32')]=_0x1cfd3b[_0x0acf('0x32')]||0x3;this[_0x0acf('0x33')]=_0x1cfd3b['dialNoAnswerRetryFrequency']||0x96;this[_0x0acf('0x34')]=_0x1cfd3b[_0x0acf('0x34')]||0x4;this[_0x0acf('0x35')]=_0x1cfd3b[_0x0acf('0x35')]?_0x1cfd3b['Trunk']:undefined;this[_0x0acf('0x36')]=_0x1cfd3b['TrunkBackup']?_0x1cfd3b[_0x0acf('0x36')]:undefined;this[_0x0acf('0x37')]=_0x1cfd3b[_0x0acf('0x37')]||undefined;this[_0x0acf('0x38')]=_0x1cfd3b[_0x0acf('0x38')]?_0x1cfd3b[_0x0acf('0x38')]:undefined;this['dialOrderByScheduledAt']=_0x1cfd3b[_0x0acf('0x39')]||_0x0acf('0x3a');this[_0x0acf('0x3b')]=_0x1cfd3b[_0x0acf('0x3b')]||undefined;this['dialCutDigit']=_0x1cfd3b['dialCutDigit']||undefined;this[_0x0acf('0x3c')]=strategy[_0x1cfd3b[_0x0acf('0x3c')]]||_0x0acf('0xc');this[_0x0acf('0x3d')]=!![];this['dialAMDActive']=_0x1cfd3b['dialAMDActive']||![];this[_0x0acf('0x3e')]=_0x1cfd3b[_0x0acf('0x3e')];this[_0x0acf('0x3f')]=_0x1cfd3b[_0x0acf('0x3f')];this[_0x0acf('0x40')]=_0x1cfd3b[_0x0acf('0x40')];this[_0x0acf('0x41')]=_0x1cfd3b[_0x0acf('0x41')];this[_0x0acf('0x42')]=_0x1cfd3b['dialAMDMinWordLength'];this[_0x0acf('0x43')]=_0x1cfd3b[_0x0acf('0x43')];this['dialAMDMaximumNumberOfWords']=_0x1cfd3b['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1cfd3b[_0x0acf('0x44')];this['dialAMDMaximumWordLength']=_0x1cfd3b[_0x0acf('0x45')];this[_0x0acf('0x46')]=0x0;this[_0x0acf('0x47')]=0x0;this[_0x0acf('0x48')]=_0x1cfd3b[_0x0acf('0x48')];this[_0x0acf('0x49')]=0x0;this[_0x0acf('0x4a')]=0x0;this[_0x0acf('0x4b')]=0x0;this[_0x0acf('0x4c')]=0x0;this[_0x0acf('0x4d')]=0x0;this[_0x0acf('0x4e')]=0x0;this[_0x0acf('0x4f')]=0x0;this[_0x0acf('0x50')]=0x0;this[_0x0acf('0x51')]=0x0;this[_0x0acf('0x52')]=0x0;this[_0x0acf('0x53')]=0x0;this[_0x0acf('0x54')]=0x0;this[_0x0acf('0x55')]=0x0;this[_0x0acf('0x56')]=undefined;this['startPredictive']=undefined;this[_0x0acf('0x57')]=undefined;this[_0x0acf('0x58')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x0acf('0x59')]=0x0;this[_0x0acf('0x5a')]=0x0;this[_0x0acf('0x5b')]=0x0;this[_0x0acf('0x5c')]=0x0;this[_0x0acf('0x5d')]=0x0;this[_0x0acf('0x5e')]=0x0;this[_0x0acf('0x5f')]=0.4;this[_0x0acf('0x60')]=0x0;this[_0x0acf('0x61')]=0x0;this[_0x0acf('0x62')]=0x1;this[_0x0acf('0x63')]=0x0;this[_0x0acf('0x64')]=0x0;this[_0x0acf('0x65')]=0x0;this[_0x0acf('0x66')]=0x0;this['dialRecallMeTimeout']=_0x1cfd3b[_0x0acf('0x67')]||0x1e;this[_0x0acf('0x68')]=_0x1cfd3b[_0x0acf('0x68')]||![];this['dialQueueProject2']=_0x1cfd3b[_0x0acf('0x69')]||undefined;this[_0x0acf('0x6a')]=_0x1cfd3b[_0x0acf('0x6a')]||![];this[_0x0acf('0x6b')]=_0x1cfd3b[_0x0acf('0x6b')]||![];this[_0x0acf('0x6c')]=monitorFormat[_0x1cfd3b[_0x0acf('0x6c')]]?monitorFormat[_0x1cfd3b['monitor_format']]:undefined;}module[_0x0acf('0x6d')]=VoiceQueue;
\ No newline at end of file
+var _0x9fb0=['monitor_format','type','inbound','waiting','talking','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalLowerLimit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','exports','unknown','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','name'];(function(_0x191d84,_0x421320){var _0x24f274=function(_0x48ae85){while(--_0x48ae85){_0x191d84['push'](_0x191d84['shift']());}};_0x24f274(++_0x421320);}(_0x9fb0,0x19e));var _0x09fb=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x9fb0[_0x4b7895];return _0x264180;};'use strict';var statusDesc=[_0x09fb('0x0'),'not_inuse','inuse','busy','invalid',_0x09fb('0x1'),_0x09fb('0x2'),_0x09fb('0x3'),_0x09fb('0x4')];var monitorFormat={'wav':_0x09fb('0x5'),'wav49':_0x09fb('0x6'),'gsm':_0x09fb('0x7')};var strategy={'rrmemory':_0x09fb('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x37bbe8){this['id']=_0x37bbe8['id']||0x0;this[_0x09fb('0x9')]=_0x37bbe8[_0x09fb('0x9')]||'';this[_0x09fb('0xa')]=_0x37bbe8[_0x09fb('0xa')]||'';this[_0x09fb('0xb')]=_0x37bbe8[_0x09fb('0xb')]||_0x09fb('0xc');this[_0x09fb('0xd')]=0x0;this[_0x09fb('0xe')]=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x09fb('0xf')]=0x0;this[_0x09fb('0x10')]=0x0;this[_0x09fb('0x11')]=0x0;this[_0x09fb('0x12')]=0x0;this[_0x09fb('0x13')]=0x0;this[_0x09fb('0x14')]=0x0;this[_0x09fb('0x15')]=_0x37bbe8['acw']||![];this[_0x09fb('0x16')]=_0x37bbe8[_0x09fb('0x16')]||0xa;this['autopause']=_0x37bbe8[_0x09fb('0x17')]||'no';this[_0x09fb('0x18')]=!![];this[_0x09fb('0x19')]='';this[_0x09fb('0x1a')]=0x0;this[_0x09fb('0x1b')]=0x0;this['dialTimezone']=_0x37bbe8[_0x09fb('0x1c')]||null;this[_0x09fb('0x1d')]=_0x37bbe8[_0x09fb('0x1d')]?_0x37bbe8[_0x09fb('0x1d')]:null;this[_0x09fb('0x1e')]=_0x37bbe8[_0x09fb('0x1e')];this[_0x09fb('0x1f')]=_0x37bbe8[_0x09fb('0x1f')]||_0x09fb('0x20');this['dialLimitChannel']=_0x37bbe8[_0x09fb('0x21')]||0x0;this[_0x09fb('0x22')]=_0x37bbe8[_0x09fb('0x22')]||0x0;this['dialPowerLevel']=_0x37bbe8['dialPowerLevel']||0x1;this[_0x09fb('0x23')]=_0x37bbe8[_0x09fb('0x23')]||_0x09fb('0x24');this['dialPredictiveOptimizationPercentage']=_0x37bbe8[_0x09fb('0x25')]||0.03;this[_0x09fb('0x26')]=_0x37bbe8[_0x09fb('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x37bbe8[_0x09fb('0x27')]||'anonymous';this[_0x09fb('0x28')]=_0x37bbe8['dialOriginateCallerIdNumber']||'anonymous';this[_0x09fb('0x29')]=_0x37bbe8['dialOriginateTimeout']||0x1e;this[_0x09fb('0x2a')]=_0x37bbe8[_0x09fb('0x2a')]||_0x09fb('0x2b');this[_0x09fb('0x2c')]=_0x37bbe8[_0x09fb('0x2c')]||0x3;this[_0x09fb('0x2d')]=_0x37bbe8[_0x09fb('0x2d')]||undefined;this[_0x09fb('0x2e')]=_0x37bbe8['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x37bbe8[_0x09fb('0x2f')]||0x96;this[_0x09fb('0x30')]=_0x37bbe8[_0x09fb('0x30')]||0x3;this[_0x09fb('0x31')]=_0x37bbe8[_0x09fb('0x31')]||0x96;this[_0x09fb('0x32')]=_0x37bbe8['dialNoAnswerMaxRetry']||0x3;this[_0x09fb('0x33')]=_0x37bbe8[_0x09fb('0x33')]||0x96;this[_0x09fb('0x34')]=_0x37bbe8[_0x09fb('0x34')]||0x4;this['Trunk']=_0x37bbe8[_0x09fb('0x35')]?_0x37bbe8[_0x09fb('0x35')]:undefined;this[_0x09fb('0x36')]=_0x37bbe8[_0x09fb('0x36')]?_0x37bbe8[_0x09fb('0x36')]:undefined;this[_0x09fb('0x37')]=_0x37bbe8['dialPrefix']||undefined;this[_0x09fb('0x38')]=_0x37bbe8[_0x09fb('0x38')]?_0x37bbe8['Interval']:undefined;this[_0x09fb('0x39')]=_0x37bbe8[_0x09fb('0x39')]||_0x09fb('0x3a');this[_0x09fb('0x3b')]=_0x37bbe8[_0x09fb('0x3b')]||undefined;this[_0x09fb('0x3c')]=_0x37bbe8['dialCutDigit']||undefined;this[_0x09fb('0x3d')]=strategy[_0x37bbe8[_0x09fb('0x3d')]]||_0x09fb('0x8');this[_0x09fb('0x3e')]=!![];this[_0x09fb('0x3f')]=_0x37bbe8[_0x09fb('0x3f')]||![];this[_0x09fb('0x40')]=_0x37bbe8['dialAMDInitialSilence'];this[_0x09fb('0x41')]=_0x37bbe8[_0x09fb('0x41')];this[_0x09fb('0x42')]=_0x37bbe8[_0x09fb('0x42')];this[_0x09fb('0x43')]=_0x37bbe8[_0x09fb('0x43')];this[_0x09fb('0x44')]=_0x37bbe8[_0x09fb('0x44')];this[_0x09fb('0x45')]=_0x37bbe8[_0x09fb('0x45')];this['dialAMDMaximumNumberOfWords']=_0x37bbe8['dialAMDMaximumNumberOfWords'];this[_0x09fb('0x46')]=_0x37bbe8['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x37bbe8[_0x09fb('0x47')];this[_0x09fb('0x48')]=0x0;this[_0x09fb('0x49')]=0x0;this[_0x09fb('0x4a')]=_0x37bbe8[_0x09fb('0x4a')];this[_0x09fb('0x4b')]=0x0;this[_0x09fb('0x4c')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x09fb('0x4d')]=0x0;this[_0x09fb('0x4e')]=0x0;this[_0x09fb('0x4f')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x09fb('0x50')]=0x0;this[_0x09fb('0x51')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x09fb('0x52')]=0x0;this[_0x09fb('0x53')]=0x0;this[_0x09fb('0x54')]=0x0;this[_0x09fb('0x55')]=undefined;this[_0x09fb('0x56')]=undefined;this[_0x09fb('0x57')]=undefined;this[_0x09fb('0x58')]=1.05;this[_0x09fb('0x59')]=0x0;this[_0x09fb('0x5a')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x09fb('0x5b')]=0x0;this[_0x09fb('0x5c')]=0x0;this[_0x09fb('0x5d')]=0x0;this[_0x09fb('0x5e')]=0x0;this[_0x09fb('0x5f')]=0.4;this['predictiveIntervalErlangCalls']=0x0;this[_0x09fb('0x60')]=0x0;this[_0x09fb('0x61')]=0x1;this['erlangCalls']=0x0;this[_0x09fb('0x62')]=0x0;this[_0x09fb('0x63')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x37bbe8[_0x09fb('0x64')]||0x1e;this[_0x09fb('0x65')]=_0x37bbe8['dialRecallInQueue']||![];this[_0x09fb('0x66')]=_0x37bbe8[_0x09fb('0x66')]||undefined;this['dialAgiAfterHangupClient']=_0x37bbe8[_0x09fb('0x67')]||![];this[_0x09fb('0x68')]=_0x37bbe8[_0x09fb('0x68')]||![];this[_0x09fb('0xa')]=monitorFormat[_0x37bbe8[_0x09fb('0xa')]]?monitorFormat[_0x37bbe8[_0x09fb('0xa')]]:undefined;}module[_0x09fb('0x69')]=VoiceQueue;
\ No newline at end of file
index 450dd37..291b18c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c8e=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x2ceb33,_0x39930d){var _0x30db5b=function(_0xe04391){while(--_0xe04391){_0x2ceb33['push'](_0x2ceb33['shift']());}};_0x30db5b(++_0x39930d);}(_0x3c8e,0xc4));var _0xe3c8=function(_0x3a743c,_0x5a953d){_0x3a743c=_0x3a743c-0x0;var _0x5f415b=_0x3c8e[_0x3a743c];return _0x5f415b;};'use strict';function VtigerAccount(_0x31aef9){this['id']=_0x31aef9['id']||0x0;this[_0xe3c8('0x0')]=_0x31aef9[_0xe3c8('0x0')]||'';this['username']=_0x31aef9[_0xe3c8('0x1')]||'';this[_0xe3c8('0x2')]=_0x31aef9[_0xe3c8('0x2')]||'';this[_0xe3c8('0x3')]=_0x31aef9[_0xe3c8('0x3')]||'';this[_0xe3c8('0x4')]=_0x31aef9[_0xe3c8('0x4')]||'';this['Configurations']=_0x31aef9[_0xe3c8('0x5')]||{};}module[_0xe3c8('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x4d00=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x51be05,_0x10bed6){var _0x1a2528=function(_0x33f8d0){while(--_0x33f8d0){_0x51be05['push'](_0x51be05['shift']());}};_0x1a2528(++_0x10bed6);}(_0x4d00,0x11c));var _0x04d0=function(_0x4f210d,_0x525c73){_0x4f210d=_0x4f210d-0x0;var _0x4b4702=_0x4d00[_0x4f210d];return _0x4b4702;};'use strict';function VtigerAccount(_0x5690b3){this['id']=_0x5690b3['id']||0x0;this[_0x04d0('0x0')]=_0x5690b3[_0x04d0('0x0')]||'';this['username']=_0x5690b3[_0x04d0('0x1')]||'';this[_0x04d0('0x2')]=_0x5690b3[_0x04d0('0x2')]||'';this['remoteUri']=_0x5690b3[_0x04d0('0x3')]||'';this[_0x04d0('0x4')]=_0x5690b3[_0x04d0('0x4')]||'';this['Configurations']=_0x5690b3[_0x04d0('0x5')]||{};}module[_0x04d0('0x6')]=VtigerAccount;
\ No newline at end of file
index fb145f8..ea71584 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b57=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0x6b57,0x135));var _0x76b5=function(_0xacb53d,_0x1c2500){_0xacb53d=_0xacb53d-0x0;var _0x20562d=_0x6b57[_0xacb53d];return _0x20562d;};'use strict';function ZendeskAccount(_0x2012c7){this['id']=_0x2012c7['id']||0x0;this[_0x76b5('0x0')]=_0x2012c7['name']||'';this[_0x76b5('0x1')]=_0x2012c7[_0x76b5('0x1')]||'';this[_0x76b5('0x2')]=_0x2012c7[_0x76b5('0x2')]||'';this[_0x76b5('0x3')]=_0x2012c7['token']||'';this[_0x76b5('0x4')]=_0x2012c7[_0x76b5('0x4')]||'';this[_0x76b5('0x5')]=_0x2012c7['authType']||'';this[_0x76b5('0x6')]=_0x2012c7[_0x76b5('0x6')]||_0x76b5('0x7');this[_0x76b5('0x8')]=_0x2012c7[_0x76b5('0x8')]||'';this[_0x76b5('0x9')]=_0x2012c7[_0x76b5('0x9')]||{};}module[_0x76b5('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x81d1=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x49fc20,_0x48229f){var _0x574013=function(_0x51f81f){while(--_0x51f81f){_0x49fc20['push'](_0x49fc20['shift']());}};_0x574013(++_0x48229f);}(_0x81d1,0x18c));var _0x181d=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x81d1[_0x46698a];return _0x356db0;};'use strict';function ZendeskAccount(_0x549c59){this['id']=_0x549c59['id']||0x0;this[_0x181d('0x0')]=_0x549c59[_0x181d('0x0')]||'';this[_0x181d('0x1')]=_0x549c59['username']||'';this[_0x181d('0x2')]=_0x549c59[_0x181d('0x2')]||'';this[_0x181d('0x3')]=_0x549c59[_0x181d('0x3')]||'';this['remoteUri']=_0x549c59[_0x181d('0x4')]||'';this['authType']=_0x549c59[_0x181d('0x5')]||'';this['type']=_0x549c59['type']||_0x181d('0x6');this[_0x181d('0x7')]=_0x549c59[_0x181d('0x7')]||'';this[_0x181d('0x8')]=_0x549c59[_0x181d('0x8')]||{};}module[_0x181d('0x9')]=ZendeskAccount;
\ No newline at end of file
index df5c205..7f5aca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['name','authToken','host','Configurations','serverUrl','exports'];(function(_0x17d48d,_0x4074fb){var _0x26aee9=function(_0x13cb1e){while(--_0x13cb1e){_0x17d48d['push'](_0x17d48d['shift']());}};_0x26aee9(++_0x4074fb);}(_0x2ef3,0xba));var _0x32ef=function(_0x5dc1f5,_0x2de455){_0x5dc1f5=_0x5dc1f5-0x0;var _0x5657dd=_0x2ef3[_0x5dc1f5];return _0x5657dd;};'use strict';function ZohoAccount(_0x4d5ac8){this['id']=_0x4d5ac8['id']||0x0;this[_0x32ef('0x0')]=_0x4d5ac8[_0x32ef('0x0')]||'';this[_0x32ef('0x1')]=_0x4d5ac8[_0x32ef('0x1')]||'';this[_0x32ef('0x2')]=_0x4d5ac8['host']||'';this[_0x32ef('0x3')]=_0x4d5ac8[_0x32ef('0x3')]||{};this['serverUrl']=_0x4d5ac8[_0x32ef('0x4')]||'';}module[_0x32ef('0x5')]=ZohoAccount;
\ No newline at end of file
+var _0xc6ac=['authToken','host','Configurations','serverUrl','exports','name'];(function(_0x34da33,_0x55a0ff){var _0x277c33=function(_0x370ecf){while(--_0x370ecf){_0x34da33['push'](_0x34da33['shift']());}};_0x277c33(++_0x55a0ff);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x40d3b8,_0x3ed696){_0x40d3b8=_0x40d3b8-0x0;var _0x27166f=_0xc6ac[_0x40d3b8];return _0x27166f;};'use strict';function ZohoAccount(_0x227e2c){this['id']=_0x227e2c['id']||0x0;this[_0xcc6a('0x0')]=_0x227e2c[_0xcc6a('0x0')]||'';this[_0xcc6a('0x1')]=_0x227e2c[_0xcc6a('0x1')]||'';this[_0xcc6a('0x2')]=_0x227e2c[_0xcc6a('0x2')]||'';this[_0xcc6a('0x3')]=_0x227e2c[_0xcc6a('0x3')]||{};this[_0xcc6a('0x4')]=_0x227e2c[_0xcc6a('0x4')]||'';}module[_0xcc6a('0x5')]=ZohoAccount;
\ No newline at end of file
index ca1e8c8..8cf0411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd35=['format','\x22%s\x22\x20<%s>','calleridname','number','exports','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','channelAgent','SIP/%s','phone','firstName','Contact','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','prototype'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0xcd35,0xc8));var _0x5cd3=function(_0x5518f2,_0x214129){_0x5518f2=_0x5518f2-0x0;var _0x51c90e=_0xcd35[_0x5518f2];return _0x51c90e;};'use strict';var util=require('util');var _=require(_0x5cd3('0x0'));var moment=require(_0x5cd3('0x1'));function checkNameSurname(_0x194bc,_0x53681b,_0x25a483){var _0x1974dc='';if(!_[_0x5cd3('0x2')](_0x53681b)&&'string'===typeof _0x53681b){_0x1974dc+=_0x53681b;}if(!_[_0x5cd3('0x2')](_0x25a483)&&_0x5cd3('0x3')===typeof _0x25a483){_0x1974dc+='\x20'+_0x25a483;}if(_0x1974dc!==''){return _0x1974dc;}return _0x194bc;}function Action(_0x39389d,_0x1abd63,_0x240583,_0x557fbd,_0x2ccdd8){this[_0x5cd3('0x4')]=_0x240583||undefined;this[_0x5cd3('0x5')]=_0x39389d['id'];this[_0x5cd3('0x6')]=_0x1abd63['name'];this['type']=_0x1abd63[_0x5cd3('0x7')];this[_0x5cd3('0x8')]=_0x5cd3('0x6');this[_0x5cd3('0x9')]=![];this[_0x5cd3('0xa')]=_[_0x5cd3('0x2')](_0x39389d[_0x5cd3('0xb')])?undefined:_0x39389d[_0x5cd3('0xb')][_0x5cd3('0xc')];this[_0x5cd3('0xd')]=this[_0x5cd3('0xa')]?util['format'](_0x5cd3('0xe'),this['membername']):_0x557fbd||undefined;this['calleridname']=checkNameSurname(_0x39389d['Contact'][_0x5cd3('0xf')],_0x39389d['Contact'][_0x5cd3('0x10')],_0x39389d[_0x5cd3('0x11')][_0x5cd3('0x12')]);this['active']=_0x39389d['active']||![];this[_0x5cd3('0x13')]=_0x39389d[_0x5cd3('0x11')][_0x5cd3('0xf')];this[_0x5cd3('0x14')]=_0x39389d['scheduledat'];this[_0x5cd3('0x15')]=_0x39389d[_0x5cd3('0x15')]||0x0;this[_0x5cd3('0x16')]=_0x39389d[_0x5cd3('0x16')]||0x0;this['countnoanswerretry']=_0x39389d[_0x5cd3('0x17')]||0x0;this[_0x5cd3('0x18')]=(_0x39389d[_0x5cd3('0x15')]||0x0)+(_0x39389d['countcongestionretry']||0x0)+(_0x39389d[_0x5cd3('0x17')]||0x0);this[_0x5cd3('0x19')]=_0x39389d['callback'];this[_0x5cd3('0x1a')]=_0x39389d[_0x5cd3('0x1a')];this[_0x5cd3('0x1b')]=_0x39389d[_0x5cd3('0x1b')];this['recallme']=_0x39389d[_0x5cd3('0x1c')];this[_0x5cd3('0x1d')]=_0x39389d[_0x5cd3('0x1d')];this[_0x5cd3('0x1e')]=_0x39389d[_0x5cd3('0x1e')];this['UserId']=_[_0x5cd3('0x2')](_0x39389d[_0x5cd3('0xb')])?_0x39389d[_0x5cd3('0x1f')]:_0x39389d['Agent']['id'];this['VoiceQueueId']=_0x39389d['VoiceQueueId'];this[_0x5cd3('0x20')]='';this['originatecalleridname']='';}Action[_0x5cd3('0x21')]['getCaller']=function(){return util[_0x5cd3('0x22')](_0x5cd3('0x23'),this[_0x5cd3('0x24')],this[_0x5cd3('0x25')]);};module[_0x5cd3('0x26')]=Action;
\ No newline at end of file
+var _0xb94e=['membername','isNil','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','number','exports','lodash','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer'];(function(_0xcbc6d7,_0x2772c0){var _0x28843a=function(_0x53b2a6){while(--_0x53b2a6){_0xcbc6d7['push'](_0xcbc6d7['shift']());}};_0x28843a(++_0x2772c0);}(_0xb94e,0x187));var _0xeb94=function(_0x3aa2da,_0x350ccd){_0x3aa2da=_0x3aa2da-0x0;var _0x43a4e4=_0xb94e[_0x3aa2da];return _0x43a4e4;};'use strict';var util=require('util');var _=require(_0xeb94('0x0'));var moment=require('moment');function checkNameSurname(_0x4ec810,_0x419782,_0x4525a1){var _0x1c8c2e='';if(!_['isNil'](_0x419782)&&_0xeb94('0x1')===typeof _0x419782){_0x1c8c2e+=_0x419782;}if(!_['isNil'](_0x4525a1)&&_0xeb94('0x1')===typeof _0x4525a1){_0x1c8c2e+='\x20'+_0x4525a1;}if(_0x1c8c2e!==''){return _0x1c8c2e;}return _0x4ec810;}function Action(_0xd38799,_0x35365d,_0x519efa,_0x189e68,_0x407555){this[_0xeb94('0x2')]=_0x519efa||undefined;this[_0xeb94('0x3')]=_0xd38799['id'];this[_0xeb94('0x4')]=_0x35365d[_0xeb94('0x5')];this['type']=_0x35365d[_0xeb94('0x6')];this[_0xeb94('0x7')]=_0xeb94('0x4');this[_0xeb94('0x8')]=![];this[_0xeb94('0x9')]=_[_0xeb94('0xa')](_0xd38799[_0xeb94('0xb')])?undefined:_0xd38799[_0xeb94('0xb')][_0xeb94('0x5')];this[_0xeb94('0xc')]=this[_0xeb94('0x9')]?util[_0xeb94('0xd')](_0xeb94('0xe'),this[_0xeb94('0x9')]):_0x189e68||undefined;this[_0xeb94('0xf')]=checkNameSurname(_0xd38799[_0xeb94('0x10')][_0xeb94('0x11')],_0xd38799[_0xeb94('0x10')][_0xeb94('0x12')],_0xd38799[_0xeb94('0x10')][_0xeb94('0x13')]);this[_0xeb94('0x14')]=_0xd38799['active']||![];this[_0xeb94('0x15')]=_0xd38799[_0xeb94('0x10')][_0xeb94('0x11')];this[_0xeb94('0x16')]=_0xd38799[_0xeb94('0x16')];this[_0xeb94('0x17')]=_0xd38799[_0xeb94('0x17')]||0x0;this[_0xeb94('0x18')]=_0xd38799[_0xeb94('0x18')]||0x0;this[_0xeb94('0x19')]=_0xd38799['countnoanswerretry']||0x0;this[_0xeb94('0x1a')]=(_0xd38799[_0xeb94('0x17')]||0x0)+(_0xd38799[_0xeb94('0x18')]||0x0)+(_0xd38799[_0xeb94('0x19')]||0x0);this['callback']=_0xd38799[_0xeb94('0x1b')];this[_0xeb94('0x1c')]=_0xd38799[_0xeb94('0x1c')];this['callbackat']=_0xd38799[_0xeb94('0x1d')];this['recallme']=_0xd38799[_0xeb94('0x1e')];this['ContactId']=_0xd38799[_0xeb94('0x1f')];this[_0xeb94('0x20')]=_0xd38799[_0xeb94('0x20')];this[_0xeb94('0x21')]=_[_0xeb94('0xa')](_0xd38799[_0xeb94('0xb')])?_0xd38799['UserId']:_0xd38799['Agent']['id'];this[_0xeb94('0x22')]=_0xd38799[_0xeb94('0x22')];this[_0xeb94('0x23')]='';this[_0xeb94('0x24')]='';}Action['prototype']['getCaller']=function(){return util[_0xeb94('0xd')](_0xeb94('0x25'),this[_0xeb94('0xf')],this[_0xeb94('0x26')]);};module[_0xeb94('0x27')]=Action;
\ No newline at end of file
index b9a13c5..617a1e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51e7=['responsetime','isFailure','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','callProgressDetectingCustomer','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','moment','md5','../../../config/environment','../../../config/logger','actionPreview','../ami','./action','redis','defaults','localhost','socket.io-emitter','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','outbound','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','Trunk','active','callerid','Interval','stringify','voice:queue:%s','format','originated','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','prototype','syncCampaigns','hasOwnProperty','preview','booked','clearZombieChannels','type','recallMe','enqueue','isNil','info','Queue','originated:\x20','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agents','then','getDiff','scheduledat','dialRecallMeTimeout','run','[RecallMe]','starttime','logCustomer','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','logger2','setMessage','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','YYYY-MM-DD\x20HH:mm:ss','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumBillable','talktime','linkedid','countbusyretry','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','Global','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','scheduledAt','CONGESTION','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','disableContact','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','[originated][increment]','OriginateError','actionid','logLookAgent','clone'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x51e7,0x14e));var _0x751e=function(_0x8b8060,_0x3dd837){_0x8b8060=_0x8b8060-0x0;var _0x50e6dc=_0x51e7[_0x8b8060];return _0x50e6dc;};'use strict';var util=require('util');var _=require(_0x751e('0x0'));var BPromise=require(_0x751e('0x1'));var uuid=require('uuid');var moment=require(_0x751e('0x2'));var md5=require(_0x751e('0x3'));var Redis=require('ioredis');var config=require(_0x751e('0x4'));var logger=require(_0x751e('0x5'))('preview');var loggerAction=require(_0x751e('0x5'))(_0x751e('0x6'));var ami=require(_0x751e('0x7'));var rpcDb=require('./rpcDb');var Action=require(_0x751e('0x8'));var ut=require('./util/util');config[_0x751e('0x9')]=_[_0x751e('0xa')](config[_0x751e('0x9')],{'host':_0x751e('0xb'),'port':0x18eb});var io=require(_0x751e('0xc'))(new Redis(config[_0x751e('0x9')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x52beeb){this[_0x751e('0xd')]=this['tail']?this[_0x751e('0xd')][_0x751e('0xe')](_0x52beeb):_0x52beeb();};function Preview(_0x133962){this[_0x751e('0xf')]=new Sequence();this[_0x751e('0x10')]=_0x133962[_0x751e('0x11')];this[_0x751e('0x12')]=_0x133962[_0x751e('0x12')];this[_0x751e('0x13')]={};this['agents']=_0x133962['agents'];this[_0x751e('0x14')]=0x0;ami['on'](_0x751e('0x15'),this[_0x751e('0x16')][_0x751e('0x17')](this));ami['on'](_0x751e('0x18'),this[_0x751e('0x19')][_0x751e('0x17')](this));ami['on'](_0x751e('0x1a'),this[_0x751e('0x1b')][_0x751e('0x17')](this));ami['on']('dialend',this[_0x751e('0x1c')][_0x751e('0x17')](this));ami['on'](_0x751e('0x1d'),this['syncNewExten'][_0x751e('0x17')](this));ami['on'](_0x751e('0x1e'),this[_0x751e('0x1f')][_0x751e('0x17')](this));ami['on']('attendedtransfer',this[_0x751e('0x20')][_0x751e('0x17')](this));ami['on'](_0x751e('0x21'),this[_0x751e('0x22')][_0x751e('0x17')](this));this['loopCampaigns'](this[_0x751e('0x10')]);}function emit(_0x3baefa,_0x46871f,_0x37084f){io['to'](_0x3baefa)[_0x751e('0x23')](_0x46871f,_0x37084f);}function emitCampaignPreview(_0x412f0a){if(_0x412f0a['type']===_0x751e('0x24')){var _0xe2e8cd={'id':_0x412f0a['id'],'name':_0x412f0a[_0x751e('0x25')],'strategy':_0x412f0a[_0x751e('0x26')],'answered':_0x412f0a[_0x751e('0x27')],'available':_0x412f0a[_0x751e('0x28')],'loggedIn':_0x412f0a[_0x751e('0x29')],'pTalking':_0x412f0a[_0x751e('0x2a')],'sumBillable':_0x412f0a['sumBillable'],'sumDuration':_0x412f0a[_0x751e('0x2b')],'sumHoldTime':_0x412f0a[_0x751e('0x2c')]||0x0,'talking':_0x412f0a['talking'],'total':_0x412f0a[_0x751e('0x2d')],'type':_0x412f0a['type'],'unmanaged':_0x412f0a['unmanaged'],'abandoned':_0x412f0a['abandoned'],'waiting':_0x412f0a[_0x751e('0x2e')],'loggedInDb':_0x412f0a[_0x751e('0x2f')],'dialActive':_0x412f0a[_0x751e('0x30')],'dialMethod':_0x412f0a[_0x751e('0x31')],'dialOriginateCallerIdName':_0x412f0a[_0x751e('0x32')],'dialOriginateCallerIdNumber':_0x412f0a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x412f0a[_0x751e('0x33')],'dialPrefix':_0x412f0a[_0x751e('0x34')],'outboundAnswerAgiCallsDay':_0x412f0a[_0x751e('0x35')],'outboundAnswerCallsDay':_0x412f0a[_0x751e('0x36')],'outboundBlacklistCallsDay':_0x412f0a[_0x751e('0x37')],'outboundBusyCallsDay':_0x412f0a[_0x751e('0x38')],'outboundCongestionCallsDay':_0x412f0a[_0x751e('0x39')],'outboundDropCallsDayACS':_0x412f0a[_0x751e('0x3a')],'outboundDropCallsDayCallersExit':_0x412f0a[_0x751e('0x3b')],'outboundDropCallsDayTimeout':_0x412f0a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x412f0a[_0x751e('0x3c')],'outboundNoSuchCallsDay':_0x412f0a[_0x751e('0x3d')],'outboundOriginateFailureCallsDay':_0x412f0a[_0x751e('0x3e')],'outboundReCallsDay':_0x412f0a[_0x751e('0x3f')],'outboundRejectCallsDay':_0x412f0a[_0x751e('0x40')],'outboundUnknownCallsDay':_0x412f0a[_0x751e('0x41')],'predictiveIntervalAnsweredCalls':_0x412f0a[_0x751e('0x42')],'predictiveIntervalAvgHoldtime':_0x412f0a[_0x751e('0x43')],'predictiveIntervalAvgTalktime':_0x412f0a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x412f0a[_0x751e('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x412f0a[_0x751e('0x45')],'predictiveIntervalErlangCalls':_0x412f0a[_0x751e('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x412f0a[_0x751e('0x47')],'predictiveIntervalHitRate':_0x412f0a[_0x751e('0x48')],'predictiveIntervalLowerLimit':_0x412f0a[_0x751e('0x49')],'predictiveIntervalMultiplicativeFactor':_0x412f0a[_0x751e('0x4a')],'predictiveIntervalPauses':_0x412f0a[_0x751e('0x4b')],'predictiveIntervalTotalCalls':_0x412f0a[_0x751e('0x4c')],'message':_0x412f0a[_0x751e('0x4d')],'originated':_0x412f0a['originated']};if(_0x412f0a[_0x751e('0x4e')]){_0xe2e8cd['Trunk']={'id':_0x412f0a[_0x751e('0x4e')]['id'],'name':_0x412f0a[_0x751e('0x4e')][_0x751e('0x25')],'active':_0x412f0a[_0x751e('0x4e')][_0x751e('0x4f')],'callerid':_0x412f0a[_0x751e('0x4e')][_0x751e('0x50')]};}if(_0x412f0a['Interval']){_0xe2e8cd[_0x751e('0x51')]={'id':_0x412f0a[_0x751e('0x51')]['id'],'name':_0x412f0a[_0x751e('0x51')]['name']};}var _0x32d896=md5(JSON[_0x751e('0x52')](_0xe2e8cd));if(_0x412f0a[_0x751e('0x3')]!==_0x32d896){_0x412f0a[_0x751e('0x3')]=_0x32d896;emit(util['format'](_0x751e('0x53'),_0xe2e8cd[_0x751e('0x25')]),'voice_queue:save',_0xe2e8cd);}}}function emitVoiceQueueChannelRemove(_0x190222){emit(util[_0x751e('0x54')](_0x751e('0x53'),_0x190222[_0x751e('0x25')]),'voice_queue_channel:remove',_0x190222);}function notSendMessagesQueue(_0x3c900b){if(_0x3c900b['sendMessageOneNotActive']){if(_0x3c900b[_0x751e('0x55')]===0x0&&_0x3c900b[_0x751e('0x2a')]===0x0){_0x3c900b[_0x751e('0x56')]=![];_0x3c900b[_0x751e('0x28')]=0x0;_0x3c900b[_0x751e('0x57')]=0x0;_0x3c900b[_0x751e('0x4d')]=_0x751e('0x58');ut[_0x751e('0x59')](_0x751e('0x5a'),_0x3c900b[_0x751e('0x25')]+_0x751e('0x5b'));}else{_0x3c900b[_0x751e('0x4d')]=_0x751e('0x5c');ut[_0x751e('0x59')](_0x751e('0x5a'),_0x3c900b[_0x751e('0x25')]+'\x20is\x20disactive');}emitCampaignPreview(_0x3c900b);}}Preview[_0x751e('0x5d')]['loopCampaigns']=function(){var _0x555ed0=this;setInterval(function(){_0x555ed0['syncCampaigns']();},0x7cf);};Preview[_0x751e('0x5d')][_0x751e('0x5e')]=function(){var _0x421a45=this[_0x751e('0x10')];this[_0x751e('0x14')]+=0x1;for(var _0x2ce601 in _0x421a45){if(_0x421a45[_0x751e('0x5f')](_0x2ce601)&&(_0x421a45[_0x2ce601][_0x751e('0x31')]===_0x751e('0x60')||_0x421a45[_0x2ce601][_0x751e('0x31')]===_0x751e('0x61'))&&_0x421a45[_0x2ce601]['type']===_0x751e('0x24')){if(this[_0x751e('0x14')]>0x7){this[_0x751e('0x14')]=0x0;this[_0x751e('0x62')]();}}if(_0x421a45[_0x751e('0x5f')](_0x2ce601)&&_0x421a45[_0x2ce601][_0x751e('0x31')]==='preview'&&_0x421a45[_0x2ce601][_0x751e('0x63')]===_0x751e('0x24')){if(_0x421a45[_0x2ce601][_0x751e('0x30')]){this['setMessage'](_0x421a45[_0x2ce601]);this[_0x751e('0x64')](_0x421a45[_0x2ce601]);}else{notSendMessagesQueue(_0x421a45[_0x2ce601]);}}}};Preview[_0x751e('0x5d')]['clearZombieChannel']=function(_0x1516d2){var _0x2b299b=this;this[_0x751e('0xf')][_0x751e('0x65')](function(){if(!_[_0x751e('0x66')](_0x2b299b[_0x751e('0x13')][_0x1516d2])){loggerAction[_0x751e('0x67')]('[clearZombieChannels][talking]',_0x1516d2,_0x751e('0x68'),_0x2b299b[_0x751e('0x13')][_0x1516d2]['queue'],_0x751e('0x69'),JSON[_0x751e('0x52')](_0x2b299b[_0x751e('0x10')][_0x2b299b[_0x751e('0x13')][_0x1516d2]['queue']][_0x751e('0x55')]),_0x751e('0x6a'),JSON[_0x751e('0x52')](_0x2b299b[_0x751e('0x10')][_0x2b299b[_0x751e('0x13')][_0x1516d2][_0x751e('0x6b')]][_0x751e('0x2a')]),JSON['stringify'](_0x2b299b[_0x751e('0x13')][_0x1516d2][_0x751e('0x6c')]),JSON[_0x751e('0x52')](_[_0x751e('0x6d')](_0x2b299b[_0x751e('0x13')][_0x1516d2],[_0x751e('0x6e'),_0x751e('0x6f'),_0x751e('0x70'),_0x751e('0x71')])));return ami[_0x751e('0x72')]({'action':_0x751e('0x73'),'channel':_0x2b299b[_0x751e('0x13')][_0x1516d2][_0x751e('0x74')]})[_0x751e('0x75')](function(_0x29b166){if(_0x29b166['message']===_0x751e('0x76')){setTimeout(function(){if(_0x2b299b['actions'][_0x1516d2]){ut[_0x751e('0x77')](_0x2b299b[_0x751e('0x10')][_0x2b299b[_0x751e('0x13')][_0x1516d2][_0x751e('0x6b')]],'[clearZombieChannel]');if(_0x2b299b['actions'][_0x1516d2]['dialAnswer']===!![]){ut[_0x751e('0x78')](_0x2b299b[_0x751e('0x10')][_0x2b299b[_0x751e('0x13')][_0x1516d2]['queue']],_0x751e('0x79'));ut['loggerError'](_0x751e('0x7a')+_0x1516d2,_0x2b299b[_0x751e('0x13')][_0x1516d2][_0x751e('0x6b')]);}ut[_0x751e('0x7b')](_0x751e('0x7c')+_0x1516d2,_0x2b299b[_0x751e('0x13')][_0x1516d2]['queue']);delete _0x2b299b[_0x751e('0x13')][_0x1516d2];}},0x2328);}});}});};Preview[_0x751e('0x5d')][_0x751e('0x62')]=function(){var _0x5593de=this;loggerAction['info'](_0x751e('0x7d'),_[_0x751e('0x7e')](this[_0x751e('0x13')]));for(var _0x4f7670 in this['actions']){if(_0x5593de[_0x751e('0x13')][_0x751e('0x5f')](_0x4f7670)){_0x5593de[_0x751e('0x7f')](_0x4f7670);}}};Preview[_0x751e('0x5d')][_0x751e('0x64')]=function(_0x2b46d4){var _0x4010b7=this;rpcDb[_0x751e('0x80')](_0x2b46d4['id'],ut['agentReadyId'](this[_0x751e('0x81')]))[_0x751e('0x82')](function(_0x142cfc){if(!_[_0x751e('0x66')](_0x142cfc)){for(var _0x4fccf3=0x0;_0x4fccf3<_0x142cfc['length'];_0x4fccf3+=0x1){if(ut[_0x751e('0x83')](_0x142cfc[_0x4fccf3][_0x751e('0x84')])<_0x2b46d4[_0x751e('0x85')]*0x3c){_0x4010b7[_0x751e('0x86')](_0x142cfc[_0x4fccf3]['id'])['then'](ut['logger2'](_0x751e('0x87')))[_0x751e('0x75')](ut['logger2'](_0x751e('0x87')));}else{var _0x470dad=new Action(_0x142cfc[_0x4fccf3],_0x2b46d4);_0x470dad[_0x751e('0x88')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2b46d4['outboundReCallsDay']+=0x1;ut[_0x751e('0x89')](_0x470dad,0x17,'RecallInQueue');if(_0x2b46d4[_0x751e('0x8a')]){rpcDb['rescheduleContactInQueue'](ut[_0x751e('0x8b')](_0x142cfc[_0x4fccf3]));rpcDb[_0x751e('0x8c')](_0x470dad,_0x751e('0x8d'));}else{ut[_0x751e('0x89')](_0x470dad,0x16,'RecallFailedTimeout');rpcDb[_0x751e('0x8c')](_0x470dad,_0x751e('0x8e'));rpcDb[_0x751e('0x8f')](_0x470dad,'[HistoryRecallClose]');}}}}})['catch'](ut[_0x751e('0x90')]('[getContactRecallMe]'));};Preview['prototype'][_0x751e('0x91')]=function(_0x31abca){_0x31abca['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x31abca[_0x751e('0x29')])){_0x31abca[_0x751e('0x4d')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x31abca[_0x751e('0x30')])){_0x31abca[_0x751e('0x4d')]='NOT_ACTIVE';}else if(!this[_0x751e('0x92')](_0x31abca[_0x751e('0x4e')])){if(!this[_0x751e('0x92')](_0x31abca['TrunkBackup'])){_0x31abca[_0x751e('0x4d')]=_0x751e('0x93');}else{_0x31abca[_0x751e('0x4d')]=_0x751e('0x94');}}else{_0x31abca[_0x751e('0x4d')]='ACTIVE';}emitCampaignPreview(_0x31abca);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x45348b,_0x4ed73e,_0x37119e){var _0x44a79c=this;var _0xe4cec0=this[_0x751e('0x13')][_0x4ed73e];var _0x3904f9=this[_0x751e('0x10')][_0xe4cec0[_0x751e('0x6b')]];var _0x3acd48;if(_0x3904f9){switch(_0x37119e){case'1':_0x3904f9[_0x751e('0x3d')]+=0x1;_0xe4cec0[_0x751e('0x95')]=ut[_0x751e('0x96')](_0xe4cec0);ut[_0x751e('0x89')](_0xe4cec0,0x0,_0x751e('0x97'));rpcDb[_0x751e('0x8c')](_0xe4cec0,_0x751e('0x98'));if(ut[_0x751e('0x96')](_0xe4cec0)>=_0x3904f9[_0x751e('0x99')]){_0x3acd48=ut[_0x751e('0x9a')](_0xe4cec0,0xf,'Global');rpcDb[_0x751e('0x8f')](_0x3acd48,_0x751e('0x9b'));}else{rpcDb[_0x751e('0x8f')](_0xe4cec0,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x751e('0x13')][_0x45348b['linkedid']];break;case _0x751e('0x9c'):var _0x243292=moment()[_0x751e('0x54')](_0x751e('0x9d'));_0xe4cec0['responsetime']=_0x243292;_0xe4cec0[_0x751e('0x9e')]=_0x243292;_0xe4cec0['dialAnswer']=!![];_0x3904f9[_0x751e('0x2a')]+=0x1;logger[_0x751e('0x67')](_0x751e('0x9f'),_0xe4cec0[_0x751e('0xa0')],_0x751e('0xa1'),_0x3904f9['name'],_0x751e('0x6a'),_0x3904f9['pTalking']);ami['emit'](_0x751e('0xa2'),ut['buildObj'](_0xe4cec0,'connect'));if(_0x3904f9['acw']){ami[_0x751e('0x23')](_0x751e('0xa3'),ut[_0x751e('0xa4')](_0xe4cec0));}break;case'16':ami['emit'](_0x751e('0xa5'),ut[_0x751e('0xa6')](_0xe4cec0,_0x751e('0xa7')));emitVoiceQueueChannelRemove(ut[_0x751e('0xa6')](_0xe4cec0,_0x751e('0xa7')));_0x3904f9[_0x751e('0x36')]+=0x1;_0x3904f9[_0x751e('0x2d')]+=0x1;_0x3904f9[_0x751e('0x27')]+=0x1;ut[_0x751e('0x78')](_0x3904f9,_0x751e('0xa8'));_0xe4cec0[_0x751e('0x95')]=ut['totalGlobal'](_0xe4cec0);ut[_0x751e('0x89')](_0xe4cec0,0x4,_0x751e('0xa9'));rpcDb[_0x751e('0x8c')](_0xe4cec0,_0x751e('0xaa'));rpcDb[_0x751e('0x8f')](_0xe4cec0,_0x751e('0xab'));rpcDb[_0x751e('0xac')](_0xe4cec0);_0x3904f9[_0x751e('0x2b')]+=_0xe4cec0['talktime'];_0x3904f9[_0x751e('0xad')]+=_0xe4cec0[_0x751e('0xae')];logger[_0x751e('0x67')]('[syncHangup][talking][decrement]',_0xe4cec0[_0x751e('0xa0')],_0x751e('0xa1'),_0x3904f9[_0x751e('0x25')],_0x751e('0x6a'),_0x3904f9[_0x751e('0x2a')]);delete this[_0x751e('0x13')][_0x45348b[_0x751e('0xaf')]];break;case'BUSY':_0x3904f9['outboundBusyCallsDay']+=0x1;_0xe4cec0[_0x751e('0xb0')]+=0x1;_0xe4cec0[_0x751e('0x95')]=ut[_0x751e('0x96')](_0xe4cec0);ut[_0x751e('0x89')](_0xe4cec0,0x5,'Busy');rpcDb['createCustomerHistory'](_0xe4cec0,_0x751e('0xb1'));if(ut[_0x751e('0x96')](_0xe4cec0)>=_0x3904f9[_0x751e('0x99')]){_0x3acd48=ut[_0x751e('0x9a')](_0xe4cec0,0xf,'Global');rpcDb[_0x751e('0x8f')](_0x3acd48,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0xe4cec0[_0x751e('0xb0')]>=_0x3904f9[_0x751e('0xb2')]){rpcDb['createCustomerFinal'](_0xe4cec0,_0x751e('0xb1'));}else{rpcDb[_0x751e('0xb3')](ut['scheduledAt'](_0xe4cec0,'countbusyretry',_0x3904f9[_0x751e('0xb4')]),_0xe4cec0[_0x751e('0xb5')],_0xe4cec0[_0x751e('0xb6')]);}}break;case _0x751e('0xb7'):_0x3904f9[_0x751e('0x3c')]+=0x1;_0xe4cec0[_0x751e('0xb8')]+=0x1;_0xe4cec0['countglobal']=ut[_0x751e('0x96')](_0xe4cec0);ut[_0x751e('0x89')](_0xe4cec0,0x3,_0x751e('0xb9'));rpcDb[_0x751e('0x8c')](_0xe4cec0,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x751e('0x96')](_0xe4cec0)>=_0x3904f9[_0x751e('0x99')]){_0x3acd48=ut[_0x751e('0x9a')](_0xe4cec0,0xf,_0x751e('0xba'));rpcDb[_0x751e('0x8f')](_0x3acd48,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xe4cec0[_0x751e('0xb8')]>=_0x3904f9[_0x751e('0xbb')]){rpcDb['createCustomerFinal'](_0xe4cec0,_0x751e('0xbc'));}else{rpcDb[_0x751e('0xb3')](ut[_0x751e('0xbd')](_0xe4cec0,_0x751e('0xb8'),_0x3904f9['dialNoAnswerRetryFrequency']),_0xe4cec0[_0x751e('0xb5')],_0xe4cec0[_0x751e('0xb6')]);}}break;case _0x751e('0xbe'):_0x3904f9[_0x751e('0x39')]+=0x1;_0xe4cec0['countcongestionretry']+=0x1;_0xe4cec0[_0x751e('0x95')]=ut[_0x751e('0x96')](_0xe4cec0);ut[_0x751e('0x89')](_0xe4cec0,0x8,_0x751e('0xbf'));rpcDb['createCustomerHistory'](_0xe4cec0,_0x751e('0xc0'));if(ut[_0x751e('0x96')](_0xe4cec0)>=_0x3904f9['dialGlobalMaxRetry']){_0x3acd48=ut[_0x751e('0x9a')](_0xe4cec0,0xf,_0x751e('0xba'));rpcDb[_0x751e('0x8f')](_0x3acd48,_0x751e('0xc1'));}else{if(_0xe4cec0[_0x751e('0xc2')]>=_0x3904f9[_0x751e('0xc3')]){rpcDb[_0x751e('0x8f')](_0xe4cec0,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x751e('0xb3')](ut[_0x751e('0xbd')](_0xe4cec0,_0x751e('0xc2'),_0x3904f9[_0x751e('0xb4')]),_0xe4cec0[_0x751e('0xb5')],_0xe4cec0['activeContact']);}}break;case _0x751e('0xc4'):_0x3904f9[_0x751e('0x40')]+=0x1;_0xe4cec0[_0x751e('0x95')]=ut[_0x751e('0x96')](_0xe4cec0);ut[_0x751e('0x89')](_0xe4cec0,0x14,_0x751e('0xc5'));rpcDb['createCustomerHistory'](_0xe4cec0,_0x751e('0xc6'));if(_0xe4cec0[_0x751e('0xb5')]){rpcDb['unlockContact'](_0xe4cec0['idContact']);}if(_0xe4cec0[_0x751e('0xb6')]){rpcDb[_0x751e('0xc7')](_0xe4cec0[_0x751e('0xc8')]);}break;default:if(_0xe4cec0[_0x751e('0x6c')]){ut[_0x751e('0x78')](_0x3904f9,_0x751e('0xc9'));ut[_0x751e('0x7b')](_0x751e('0xca')+_0x3904f9[_0x751e('0x25')],_0x45348b);}_0x3904f9[_0x751e('0x41')]+=0x1;_0xe4cec0[_0x751e('0x95')]=ut[_0x751e('0x96')](_0xe4cec0);ut[_0x751e('0x89')](_0xe4cec0,0xc,_0x45348b[_0x751e('0xcb')]||_0x45348b[_0x751e('0xcc')]);rpcDb['createCustomerHistory'](_0xe4cec0,_0x751e('0xcd'));if(ut[_0x751e('0x96')](_0xe4cec0)>=_0x3904f9['dialGlobalMaxRetry']){_0x3acd48=ut[_0x751e('0x9a')](_0xe4cec0,0xf,_0x751e('0xba'));rpcDb[_0x751e('0x8f')](_0x3acd48,_0x751e('0xce'));}else{rpcDb[_0x751e('0x8f')](_0xe4cec0,_0x751e('0xce'));}delete this[_0x751e('0x13')][_0x45348b[_0x751e('0xaf')]];}if(!(_0xe4cec0[_0x751e('0x6c')]&&_0x37119e==='16')){ut[_0x751e('0x77')](_0x3904f9,_0x751e('0xcf'));logger[_0x751e('0x67')]('[originated][decrement][callProgressDetectingCustomer]',_0xe4cec0['uniqueid'],_0x751e('0xa1'),_0x3904f9[_0x751e('0x25')],'originated:\x20',_0x3904f9['originated']);}if(_0x37119e!=='ANSWER'){delete this['actions'][_0x45348b[_0x751e('0xaf')]];delete this['actions'][_0x45348b[_0x751e('0xd0')]];}}};Preview[_0x751e('0x5d')][_0x751e('0xd1')]=function(_0x2c98dd,_0x1e02b9,_0x3bd2d8){if(_[_0x751e('0xd2')](_0x1e02b9)&&_0x751e('0xd3')!==typeof _0x1e02b9){return;}if(_[_0x751e('0xd2')](_0x3bd2d8)&&_0x751e('0xd3')!==typeof _0x3bd2d8){return;}switch(_0x3bd2d8['reason']){case'0':ut[_0x751e('0xd4')](_0x2c98dd,0x0,_0x751e('0x97'));rpcDb[_0x751e('0xd5')](_0x2c98dd,_0x751e('0xd6'));break;case'3':ut[_0x751e('0xd4')](_0x2c98dd,0x3,_0x751e('0xb9'));rpcDb[_0x751e('0xd5')](_0x2c98dd,_0x751e('0xd7'));break;case'5':ut[_0x751e('0xd4')](_0x2c98dd,0x5,'Busy');rpcDb[_0x751e('0xd5')](_0x2c98dd,_0x751e('0xd8'));break;case'8':ut['logAgent'](_0x2c98dd,0x8,'Congestion');rpcDb['createAgentHistory'](_0x2c98dd,_0x751e('0xd9'));break;case'22':ut[_0x751e('0xd4')](_0x2c98dd,0x16,_0x751e('0xda'));rpcDb['createAgentHistory'](_0x2c98dd,_0x751e('0xdb'));break;default:ut['logAgent'](_0x2c98dd,0xc,_0x3bd2d8[_0x751e('0xdc')]);rpcDb['createAgentHistory'](_0x2c98dd,_0x751e('0xd9'));}ut[_0x751e('0x77')](_0x1e02b9,_0x751e('0xdd'));logger[_0x751e('0x67')](_0x751e('0xde'),_0x2c98dd[_0x751e('0xa0')],_0x751e('0xa1'),_0x1e02b9[_0x751e('0x25')],'originated:\x20',_0x1e02b9[_0x751e('0x55')]);delete this['actions'][_0x2c98dd[_0x751e('0xa0')]];};Preview[_0x751e('0x5d')][_0x751e('0xdf')]=function(_0x39e6a2,_0x1bc443,_0x5efc78,_0x14fa53,_0x45f0d5){var _0x1af64d=this;return new BPromise(function(_0x357d4f,_0x1f6be1){if(_['isNil'](_0x1bc443)||_[_0x751e('0x66')](_0x1bc443[_0x751e('0xe0')])||_[_0x751e('0x66')](_0x1bc443[_0x751e('0xe0')][_0x751e('0xe1')])||_[_0x751e('0x66')](_0x1bc443['VoiceQueueId'])){_0x1f6be1(ut[_0x751e('0x4d')](_0x751e('0xe2'),_0x14fa53,_0x45f0d5));return;}var _0x439436=uuid['v4']();var _0x32d4c4=_0x1af64d[_0x751e('0x10')][_0x1bc443[_0x751e('0x68')][_0x751e('0x25')]];var _0x3bdbb7=_0x5efc78?_0x1af64d[_0x751e('0x81')][_0x5efc78]['id']:undefined;_0x1af64d['actions'][_0x439436]=new Action(_0x1bc443,_0x32d4c4,_0x439436,_0x5efc78,_0x3bdbb7);var _0x54dc11=_0x1af64d[_0x751e('0x13')][_0x439436];_0x54dc11['unlockAgent']=_0x14fa53;_0x54dc11[_0x751e('0xb6')]=_0x45f0d5;_0x54dc11[_0x751e('0xe3')]=_0x5efc78;if(_['isEmpty'](_0x39e6a2)){_0x1af64d['execCall'](_0x54dc11,_0x32d4c4,_0x1bc443,_0x5efc78)[_0x751e('0x82')](function(_0x558cfa){logger[_0x751e('0x67')](_0x751e('0xe4'),_0x751e('0xe5')+_0x54dc11[_0x751e('0x6b')]+_0x751e('0xe6')+_0x54dc11[_0x751e('0xc8')],JSON[_0x751e('0x52')](_0x558cfa));ami[_0x751e('0x23')](_0x751e('0xe7'),ut[_0x751e('0xa6')](_0x54dc11,_0x751e('0xe8')));_0x357d4f(ut[_0x751e('0x4d')](_0x751e('0xe9')));})[_0x751e('0x75')](function(_0x476b03){ut['logger'](_0x751e('0xea'),_0x476b03);_0x1f6be1(ut[_0x751e('0x4d')](_0x751e('0xeb'),_0x14fa53,_0x45f0d5));});}else{_0x32d4c4[_0x751e('0x37')]+=0x1;ut['logBlacklist'](_0x54dc11);rpcDb[_0x751e('0xec')](_0x54dc11,_0x751e('0xed'));delete _0x1af64d[_0x751e('0x13')][_0x439436];_0x1f6be1(ut[_0x751e('0x4d')]('Contact\x20in\x20black\x20List',_0x14fa53,_0x45f0d5));}});};Preview[_0x751e('0x5d')][_0x751e('0x92')]=function(_0x108699){return!_[_0x751e('0x66')](_0x108699)&&!_[_0x751e('0x66')](_0x108699[_0x751e('0x25')])&&!_[_0x751e('0x66')](_0x108699[_0x751e('0x4f')])&&_0x108699['active']&&!_['isNil'](this[_0x751e('0x12')][util[_0x751e('0x54')](_0x751e('0xee'),_0x108699[_0x751e('0x25')])])&&!_[_0x751e('0x66')](this[_0x751e('0x12')][util[_0x751e('0x54')]('SIP/%s',_0x108699[_0x751e('0x25')])][_0x751e('0x73')])&&(this[_0x751e('0x12')][util[_0x751e('0x54')](_0x751e('0xee'),_0x108699[_0x751e('0x25')])][_0x751e('0x73')]===_0x751e('0xef')||this[_0x751e('0x12')][util[_0x751e('0x54')]('SIP/%s',_0x108699[_0x751e('0x25')])][_0x751e('0x73')]===_0x751e('0xf0'));};Preview['prototype']['run']=function(_0xf197ef,_0x33b224){var _0x3da30d=this;return new BPromise(function(_0x309818,_0x401355){_0x3da30d[_0x751e('0xf1')](_0xf197ef,_0x33b224)[_0x751e('0x82')](function(_0x3bb3b3){_0x309818(_[_0x751e('0x6d')](_0x3bb3b3,[_0x751e('0x4d')]));})[_0x751e('0x75')](function(_0x42160b){if(_0x42160b[_0x751e('0xf2')]){rpcDb[_0x751e('0xf3')](_0xf197ef);}if(_0x42160b[_0x751e('0x4f')]){rpcDb['disableContact'](_0xf197ef);}_0x401355(_[_0x751e('0x6d')](_0x42160b,[_0x751e('0x4d')]));});});};Preview['prototype'][_0x751e('0xf1')]=function(_0x2d0489,_0xecc3f6){var _0x10aec1=this;return new BPromise(function(_0xec0b15,_0x4b3bfa){var _0xe7ef3c,_0x12dc3b;rpcDb[_0x751e('0xf4')](_0x2d0489)[_0x751e('0x82')](function(_0xe68b50){if(!_[_0x751e('0x66')](_0xe68b50[0x0])){_0x12dc3b=_0xe68b50[0x0][_0x751e('0xf5')]?![]:!![];_0xe7ef3c=_0xe68b50[0x0]['recallme']?!![]:![];_0xe7ef3c=_0xecc3f6?!![]:_0xe7ef3c;}var _0x3ce185=_0x10aec1[_0x751e('0xf6')](_0xe68b50);if(_0x3ce185[_0x751e('0xf7')]){rpcDb['checkIsBlackList'](_['pick'](_0xe68b50[0x0],['VoiceQueueId',_0x751e('0xf8')]))['then'](function(_0x1d131a){_0x10aec1[_0x751e('0xdf')](_0x1d131a,_0xe68b50[0x0],_0xecc3f6,_0x12dc3b,_0xe7ef3c)[_0x751e('0x82')](function(_0x551e2d){_0xec0b15(_0x551e2d);})[_0x751e('0x75')](function(_0x4bb59a){_0x4b3bfa(_0x4bb59a);});})[_0x751e('0x75')](function(_0x440af2){ut[_0x751e('0x59')](_0x751e('0xf9'),_0x440af2);_0x4b3bfa(ut[_0x751e('0x4d')]('Call\x20unsuccessful',_0x12dc3b,_0xe7ef3c));});}else{_0x4b3bfa(ut[_0x751e('0x4d')](_0x3ce185['message'],_0x12dc3b,_0xe7ef3c));}})[_0x751e('0x75')](function(_0x5e0133){ut[_0x751e('0x59')](_0x751e('0xfa'),_0x5e0133);_0x4b3bfa(ut[_0x751e('0x4d')](_0x751e('0xfb'),![],!![]));});});};Preview['prototype'][_0x751e('0xf6')]=function(_0x3fd845){if(_[_0x751e('0x66')](_0x3fd845)||_[_0x751e('0xfc')](_0x3fd845)||!_['isNil'](_0x3fd845[0x0]['Agent'])&&_[_0x751e('0x66')](_0x3fd845[0x0][_0x751e('0xfd')][_0x751e('0x25')])){ut['logger'](_0x751e('0xfe'),_0x3fd845);return{'isValid':![],'message':_0x751e('0xff')};}var _0x48b6ad=this[_0x751e('0x10')][_0x3fd845[0x0]['Queue'][_0x751e('0x25')]];_0x48b6ad[_0x751e('0x4d')]=_0x751e('0x94');if(_[_0x751e('0x66')](_0x48b6ad)){ut[_0x751e('0x59')](_0x751e('0x100'),_0x48b6ad);return{'isValid':![],'message':_0x751e('0x101')};}if(!this[_0x751e('0x92')](_0x48b6ad[_0x751e('0x4e')])){ut[_0x751e('0x59')](_0x751e('0x102'),_0x751e('0x103')+_0x48b6ad[_0x751e('0x25')]+_0x751e('0x104'));if(!this['isTrunkReachable'](_0x48b6ad[_0x751e('0x105')])){ut[_0x751e('0x59')](_0x751e('0x102'),_0x48b6ad[_0x751e('0x25')]+_0x751e('0x106'));return{'isValid':![],'message':_0x751e('0x107')};}}if(!ut[_0x751e('0x108')](_0x48b6ad['dialActive'])){ut[_0x751e('0x59')]('[Preview][validateContact][Campaign\x20Active]',_0x48b6ad[_0x751e('0x25')]+_0x751e('0x109'));return{'isValid':![],'message':_0x751e('0x103')+_0x48b6ad['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x751e('0x10a')]=function(_0x71380b,_0x4719b8,_0x52f171,_0x3b98fe){var _0x12cbb7=this;return new BPromise(function(_0x25bdf8,_0x4df964){var _0x148130=_0x71380b['uniqueid'];var _0x30ea30=_0x12cbb7[_0x751e('0x92')](_0x4719b8[_0x751e('0x4e')])?util['format'](_0x751e('0x10b'),_0x4719b8[_0x751e('0x4e')][_0x751e('0x25')],_['isNil'](_0x4719b8['dialPrefix'])?'':_0x4719b8[_0x751e('0x34')][_0x751e('0x10c')]()||'',_0x4719b8[_0x751e('0x10d')]>0x0?_0x52f171['Contact'][_0x751e('0xe1')][_0x751e('0x10e')](_0x4719b8['dialCutDigit']):_0x52f171['Contact'][_0x751e('0xe1')]):util['format'](_0x751e('0x10b'),_[_0x751e('0x66')](_0x4719b8[_0x751e('0x105')])?_0x4719b8['Trunk']['name']:_0x4719b8['TrunkBackup'][_0x751e('0x25')],_[_0x751e('0x66')](_0x4719b8[_0x751e('0x34')])?'':_0x4719b8[_0x751e('0x34')]['trim']()||'',_0x4719b8[_0x751e('0x10d')]>0x0?_0x52f171[_0x751e('0xe0')][_0x751e('0xe1')]['substring'](_0x4719b8['dialCutDigit']):_0x52f171[_0x751e('0xe0')][_0x751e('0xe1')]);var _0x5561bf=_0x12cbb7['isTrunkReachable'](_0x4719b8['Trunk'])?ut[_0x751e('0x10f')](_0x4719b8['Trunk'][_0x751e('0x50')],_0x4719b8[_0x751e('0x32')],_0x4719b8[_0x751e('0x110')]>0x0?ut[_0x751e('0x111')](_0x4719b8[_0x751e('0x112')],_0x4719b8[_0x751e('0x110')]):_0x4719b8['dialOriginateCallerIdNumber']):ut[_0x751e('0x10f')](_['isNil'](_0x4719b8[_0x751e('0x105')])?_0x4719b8['Trunk']['callerid']:_0x4719b8[_0x751e('0x105')][_0x751e('0x50')],_0x4719b8['dialOriginateCallerIdName'],_0x4719b8[_0x751e('0x110')]>0x0?ut[_0x751e('0x111')](_0x4719b8[_0x751e('0x112')],_0x4719b8[_0x751e('0x110')]):_0x4719b8['dialOriginateCallerIdNumber']);if(_0x5561bf){_0x71380b[_0x751e('0x113')]=ut['extractCalleridName'](_0x5561bf);_0x71380b[_0x751e('0x114')]=ut[_0x751e('0x115')](_0x5561bf);}var _0x1b334d=ut[_0x751e('0x116')](_0x4719b8,_0x52f171,_0x30ea30,_0x5561bf,_0x148130,_0x71380b);_['merge'](_0x71380b,ut[_0x751e('0x117')](_0x1b334d));_0x71380b[_0x751e('0x88')]=moment()[_0x751e('0x54')](_0x751e('0x9d'));ami[_0x751e('0x72')](ut[_0x751e('0x118')](_0x71380b,_0x4719b8,_0x1b334d,_0x71380b['activeContact'],_0x3b98fe))[_0x751e('0x82')](function(_0x23c6dd){_0x4719b8[_0x751e('0x55')]+=0x1;logger[_0x751e('0x67')](_0x751e('0x119'),_0x148130,_0x751e('0xa1'),_0x4719b8[_0x751e('0x25')],'originated:\x20',_0x4719b8[_0x751e('0x55')]);_0x25bdf8(_0x23c6dd);})[_0x751e('0x75')](function(_0x472f25){ut[_0x751e('0xd4')](_0x71380b,0xe,_0x751e('0x11a'));rpcDb[_0x751e('0xd5')](_0x71380b,'[originateFailure][logOriginateFailure]');_0x4df964(_0x472f25);});});};Preview['prototype']['syncNewExten']=function(_0x3fea1f){if(this[_0x751e('0x13')][_0x3fea1f[_0x751e('0xaf')]]){this['actions'][_0x3fea1f[_0x751e('0xaf')]][_0x751e('0x74')]=_0x3fea1f[_0x751e('0x74')];}};Preview[_0x751e('0x5d')][_0x751e('0x16')]=function(_0x1441a2){var _0x21ae5e=this;var _0x56d8e6=this[_0x751e('0x13')][_0x1441a2[_0x751e('0x11b')]];if(_0x56d8e6){if(_0x56d8e6[_0x751e('0xe3')]&&this[_0x751e('0x81')][_0x56d8e6['lookAgent']]){ut[_0x751e('0x11c')](_0x56d8e6,this[_0x751e('0x81')][_0x56d8e6[_0x751e('0xe3')]][_0x751e('0x25')],this[_0x751e('0x81')][_0x56d8e6['lookAgent']]['id']);}var _0x1624ca=_[_0x751e('0x11d')](_0x56d8e6);_0x1624ca[_0x751e('0x11e')]=moment()[_0x751e('0x54')](_0x751e('0x9d'));var _0x3df83f=_0x21ae5e[_0x751e('0x10')][_0x56d8e6['queue']];if(ut[_0x751e('0x11f')](_0x1441a2['response'])){if(_0x56d8e6['unlockAgent']){rpcDb[_0x751e('0xf3')](_0x56d8e6[_0x751e('0xc8')]);}if(_0x56d8e6[_0x751e('0xb6')]){rpcDb[_0x751e('0xc7')](_0x56d8e6[_0x751e('0xc8')]);}ami[_0x751e('0x23')](_0x751e('0x120'),ut[_0x751e('0xa6')](_0x56d8e6,'rejected'));this['callProgressDetectingAgent'](_0x1624ca,_0x3df83f,_0x1441a2);}else{_0x56d8e6[_0x751e('0x88')]=moment()[_0x751e('0x54')](_0x751e('0x9d'));ut[_0x751e('0xd4')](_0x1624ca,0x4,_0x751e('0xa9'));rpcDb[_0x751e('0xd5')](_0x1624ca,_0x751e('0x121'));}}};Preview[_0x751e('0x5d')][_0x751e('0x19')]=function(_0x404673){var _0x1c2ed9=this;var _0x34ca91=this[_0x751e('0x13')][_0x404673[_0x751e('0xaf')]];var _0x4ce6b6;if(_0x34ca91){_0x4ce6b6=this['campaignsPreview'][_0x34ca91['queue']];logger[_0x751e('0x67')](_0x751e('0x122'),_0x404673[_0x751e('0xaf')],_0x751e('0xa1'),_0x4ce6b6['name'],_0x751e('0x6a'),_0x4ce6b6[_0x751e('0x2a')]);}if(this[_0x751e('0x13')][_0x404673[_0x751e('0xaf')]]&&_0x404673[_0x751e('0xaf')]!==_0x404673[_0x751e('0xa0')]){if(_0x404673[_0x751e('0x123')]==='16'&&this[_0x751e('0x13')][_0x404673['linkedid']]['dialAnswer']){this['callProgressDetectingCustomer'](_0x404673,_0x404673['linkedid'],_0x404673[_0x751e('0x123')]);}else if(this['actions'][_0x404673[_0x751e('0xaf')]][_0x751e('0x6c')]){logger[_0x751e('0x67')](_0x751e('0x124'),_0x404673[_0x751e('0xaf')],_0x404673['cause'],_0x751e('0xa1'),_0x4ce6b6[_0x751e('0x25')],_0x751e('0x6a'),_0x4ce6b6[_0x751e('0x2a')]);this[_0x751e('0x125')](_0x404673,_0x404673[_0x751e('0xaf')],_0x404673[_0x751e('0x123')]);}}else if(_0x34ca91&&_[_0x751e('0x66')](_0x34ca91['statedesc'])&&_0x4ce6b6[_0x751e('0x126')]&&_0x404673[_0x751e('0xaf')]===_0x404673[_0x751e('0xa0')]&&_[_0x751e('0x66')](_0x404673[_0x751e('0xdc')])&&_0x404673['cause']==='16'&&_0x404673[_0x751e('0x127')]==='6'&&_['isUndefined'](_0x34ca91[_0x751e('0x128')])){if(_0x34ca91['unlockAgent']){rpcDb['unlockContact'](_0x34ca91['idContact']);}if(_0x34ca91[_0x751e('0xb6')]){rpcDb[_0x751e('0xc7')](_0x34ca91['idContact']);}_0x404673[_0x751e('0xdc')]='22';this[_0x751e('0xd1')](_0x34ca91,_0x4ce6b6,_0x404673);}else if(_0x34ca91&&_0x34ca91[_0x751e('0x128')]){if(_0x404673[_0x751e('0x123')]==='16'&&this[_0x751e('0x13')][_0x404673[_0x751e('0xaf')]]['dialAnswer']){logger[_0x751e('0x67')](_0x751e('0x129'),_0x404673['linkedid'],_0x404673[_0x751e('0x123')],_0x751e('0xa1'),_0x4ce6b6[_0x751e('0x25')],_0x751e('0x6a'),_0x4ce6b6[_0x751e('0x2a')]);this[_0x751e('0x125')](_0x404673,_0x404673['linkedid'],_0x404673[_0x751e('0x123')]);}else if(this[_0x751e('0x13')][_0x404673['linkedid']][_0x751e('0x6c')]){logger[_0x751e('0x67')](_0x751e('0x124'),_0x404673[_0x751e('0xaf')],_0x404673['cause'],_0x751e('0xa1'),_0x4ce6b6[_0x751e('0x25')],_0x751e('0x6a'),_0x4ce6b6[_0x751e('0x2a')]);this[_0x751e('0x125')](_0x404673,_0x404673[_0x751e('0xaf')],_0x404673[_0x751e('0x123')]);}}};Preview[_0x751e('0x5d')][_0x751e('0x1c')]=function(_0x1d8b7c){if(this[_0x751e('0x13')][_0x1d8b7c[_0x751e('0xd0')]]&&_0x1d8b7c[_0x751e('0xd0')]!==_0x1d8b7c[_0x751e('0x12a')]){this[_0x751e('0x125')](_0x1d8b7c,_0x1d8b7c[_0x751e('0xd0')],_0x1d8b7c['dialstatus']);}};Preview[_0x751e('0x5d')][_0x751e('0x1b')]=function(_0xcc25cd){if(this[_0x751e('0x13')][_0xcc25cd[_0x751e('0xaf')]]&&_0xcc25cd['linkedid']!==_0xcc25cd['uniqueid']&&!this[_0x751e('0x13')][_0xcc25cd[_0x751e('0xaf')]]['dialAnswer']){if(_0xcc25cd[_0x751e('0x123')]==='1'){this[_0x751e('0x125')](_0xcc25cd,_0xcc25cd[_0x751e('0xaf')],_0xcc25cd[_0x751e('0x123')]);}}};Preview[_0x751e('0x5d')][_0x751e('0x12b')]=function(_0x15ef37,_0x60a529,_0x31c686){if(this[_0x751e('0x13')][_0x15ef37]){if(_[_0x751e('0x66')](this[_0x751e('0x13')][_0x15ef37][_0x751e('0x12c')])){this[_0x751e('0x13')][_0x15ef37][_0x751e('0x12c')]={};}this[_0x751e('0x13')][_0x15ef37]['variables'][_0x60a529]=_0x31c686;}};Preview['prototype'][_0x751e('0x1f')]=function(_0x3fc7f4){try{if(!_['isNil'](_0x3fc7f4)){if(ut[_0x751e('0x12d')](_[_0x751e('0x12e')](_0x3fc7f4[_0x751e('0x12f')])[0x0])){this[_0x751e('0x12b')](_0x3fc7f4[_0x751e('0xa0')],_[_0x751e('0x12e')](_0x3fc7f4['variable'])[0x0],_0x3fc7f4[_0x751e('0x130')]);}}}catch(_0x3854e6){logger['error'](_0x751e('0x131'),util[_0x751e('0x132')](_0x3854e6,{'showHidden':![],'depth':null}));}};Preview[_0x751e('0x5d')][_0x751e('0x20')]=function(_0x43b2b7){if(_0x43b2b7){if(this[_0x751e('0x13')][_0x43b2b7['transfertargetlinkedid']]){this[_0x751e('0x13')][_0x43b2b7[_0x751e('0x133')]]['transfer']=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x328ec9){if(_0x328ec9){if(this[_0x751e('0x13')][_0x328ec9[_0x751e('0x134')]]){this[_0x751e('0x13')][_0x328ec9[_0x751e('0x134')]]['transfer']=!![];}}};module[_0x751e('0x135')]=Preview;
\ No newline at end of file
+var _0xeb25=['idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','logAgent','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','disableContact','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking][cause]','cause','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalLowerLimit','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','stringify','voice:queue:%s','format','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','clockClearZombieChannels','dialMethod','booked','clearZombieChannels','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','Action','status','catch','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','[action]','size','hasOwnProperty','getContactRecallMe','then','isNil','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','[syncHangup][talking][increment]','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','buildObj','complete','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[syncHangupRequest][logAgentReject]','unlockContact'];(function(_0x423a85,_0x59e206){var _0x5bb0dc=function(_0x2979bf){while(--_0x2979bf){_0x423a85['push'](_0x423a85['shift']());}};_0x5bb0dc(++_0x59e206);}(_0xeb25,0x1b3));var _0x5eb2=function(_0x2e3ad4,_0x1f7f19){_0x2e3ad4=_0x2e3ad4-0x0;var _0x55a9dd=_0xeb25[_0x2e3ad4];return _0x55a9dd;};'use strict';var util=require(_0x5eb2('0x0'));var _=require(_0x5eb2('0x1'));var BPromise=require(_0x5eb2('0x2'));var uuid=require('uuid');var moment=require(_0x5eb2('0x3'));var md5=require(_0x5eb2('0x4'));var Redis=require(_0x5eb2('0x5'));var config=require(_0x5eb2('0x6'));var logger=require('../../../config/logger')(_0x5eb2('0x7'));var loggerAction=require(_0x5eb2('0x8'))(_0x5eb2('0x9'));var ami=require('../ami');var rpcDb=require(_0x5eb2('0xa'));var Action=require('./action');var ut=require('./util/util');config[_0x5eb2('0xb')]=_['defaults'](config[_0x5eb2('0xb')],{'host':_0x5eb2('0xc'),'port':0x18eb});var io=require(_0x5eb2('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x5eb2('0xe')]=function(_0x52d99e){this[_0x5eb2('0xf')]=this[_0x5eb2('0xf')]?this['tail'][_0x5eb2('0x10')](_0x52d99e):_0x52d99e();};function Preview(_0x3b285a){this[_0x5eb2('0x11')]=new Sequence();this[_0x5eb2('0x12')]=_0x3b285a['voiceQueues'];this[_0x5eb2('0x13')]=_0x3b285a[_0x5eb2('0x13')];this[_0x5eb2('0x14')]={};this[_0x5eb2('0x15')]=_0x3b285a[_0x5eb2('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x5eb2('0x16'),this[_0x5eb2('0x17')][_0x5eb2('0x18')](this));ami['on'](_0x5eb2('0x19'),this[_0x5eb2('0x1a')]['bind'](this));ami['on'](_0x5eb2('0x1b'),this[_0x5eb2('0x1c')][_0x5eb2('0x18')](this));ami['on'](_0x5eb2('0x1d'),this['syncDialEnd'][_0x5eb2('0x18')](this));ami['on'](_0x5eb2('0x1e'),this['syncNewExten'][_0x5eb2('0x18')](this));ami['on'](_0x5eb2('0x1f'),this['syncVarSet'][_0x5eb2('0x18')](this));ami['on']('attendedtransfer',this[_0x5eb2('0x20')]['bind'](this));ami['on'](_0x5eb2('0x21'),this[_0x5eb2('0x22')][_0x5eb2('0x18')](this));this[_0x5eb2('0x23')](this[_0x5eb2('0x12')]);}function emit(_0x5d5c5a,_0x47385c,_0x79d698){io['to'](_0x5d5c5a)[_0x5eb2('0x24')](_0x47385c,_0x79d698);}function emitCampaignPreview(_0x2c1e26){if(_0x2c1e26[_0x5eb2('0x25')]===_0x5eb2('0x26')){var _0xb5afd6={'id':_0x2c1e26['id'],'name':_0x2c1e26[_0x5eb2('0x27')],'strategy':_0x2c1e26['strategy'],'answered':_0x2c1e26['answered'],'available':_0x2c1e26[_0x5eb2('0x28')],'loggedIn':_0x2c1e26[_0x5eb2('0x29')],'pTalking':_0x2c1e26[_0x5eb2('0x2a')],'sumBillable':_0x2c1e26[_0x5eb2('0x2b')],'sumDuration':_0x2c1e26['sumDuration'],'sumHoldTime':_0x2c1e26[_0x5eb2('0x2c')]||0x0,'talking':_0x2c1e26[_0x5eb2('0x2d')],'total':_0x2c1e26[_0x5eb2('0x2e')],'type':_0x2c1e26[_0x5eb2('0x25')],'unmanaged':_0x2c1e26[_0x5eb2('0x2f')],'abandoned':_0x2c1e26[_0x5eb2('0x30')],'waiting':_0x2c1e26[_0x5eb2('0x31')],'loggedInDb':_0x2c1e26['loggedInDb'],'dialActive':_0x2c1e26[_0x5eb2('0x32')],'dialMethod':_0x2c1e26['dialMethod'],'dialOriginateCallerIdName':_0x2c1e26['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2c1e26['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2c1e26[_0x5eb2('0x33')],'dialPrefix':_0x2c1e26[_0x5eb2('0x34')],'outboundAnswerAgiCallsDay':_0x2c1e26[_0x5eb2('0x35')],'outboundAnswerCallsDay':_0x2c1e26[_0x5eb2('0x36')],'outboundBlacklistCallsDay':_0x2c1e26['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x2c1e26[_0x5eb2('0x37')],'outboundCongestionCallsDay':_0x2c1e26['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2c1e26[_0x5eb2('0x38')],'outboundDropCallsDayCallersExit':_0x2c1e26[_0x5eb2('0x39')],'outboundDropCallsDayTimeout':_0x2c1e26[_0x5eb2('0x3a')],'outboundNoAnswerCallsDay':_0x2c1e26[_0x5eb2('0x3b')],'outboundNoSuchCallsDay':_0x2c1e26[_0x5eb2('0x3c')],'outboundOriginateFailureCallsDay':_0x2c1e26[_0x5eb2('0x3d')],'outboundReCallsDay':_0x2c1e26['outboundReCallsDay'],'outboundRejectCallsDay':_0x2c1e26[_0x5eb2('0x3e')],'outboundUnknownCallsDay':_0x2c1e26['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2c1e26[_0x5eb2('0x3f')],'predictiveIntervalAvgHoldtime':_0x2c1e26[_0x5eb2('0x40')],'predictiveIntervalAvgTalktime':_0x2c1e26[_0x5eb2('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x2c1e26[_0x5eb2('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x2c1e26['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x2c1e26[_0x5eb2('0x43')],'predictiveIntervalErlangCallsDroppedCalls':_0x2c1e26[_0x5eb2('0x44')],'predictiveIntervalHitRate':_0x2c1e26['predictiveIntervalHitRate'],'predictiveIntervalLowerLimit':_0x2c1e26[_0x5eb2('0x45')],'predictiveIntervalMultiplicativeFactor':_0x2c1e26['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2c1e26[_0x5eb2('0x46')],'predictiveIntervalTotalCalls':_0x2c1e26[_0x5eb2('0x47')],'message':_0x2c1e26['message'],'originated':_0x2c1e26[_0x5eb2('0x48')]};if(_0x2c1e26[_0x5eb2('0x49')]){_0xb5afd6[_0x5eb2('0x49')]={'id':_0x2c1e26[_0x5eb2('0x49')]['id'],'name':_0x2c1e26[_0x5eb2('0x49')]['name'],'active':_0x2c1e26['Trunk'][_0x5eb2('0x4a')],'callerid':_0x2c1e26[_0x5eb2('0x49')][_0x5eb2('0x4b')]};}if(_0x2c1e26[_0x5eb2('0x4c')]){_0xb5afd6[_0x5eb2('0x4c')]={'id':_0x2c1e26[_0x5eb2('0x4c')]['id'],'name':_0x2c1e26[_0x5eb2('0x4c')]['name']};}var _0x47637e=md5(JSON[_0x5eb2('0x4d')](_0xb5afd6));if(_0x2c1e26[_0x5eb2('0x4')]!==_0x47637e){_0x2c1e26['md5']=_0x47637e;emit(util['format'](_0x5eb2('0x4e'),_0xb5afd6[_0x5eb2('0x27')]),'voice_queue:save',_0xb5afd6);}}}function emitVoiceQueueChannelRemove(_0x36fa81){emit(util[_0x5eb2('0x4f')](_0x5eb2('0x4e'),_0x36fa81[_0x5eb2('0x27')]),_0x5eb2('0x50'),_0x36fa81);}function notSendMessagesQueue(_0x1e7576){if(_0x1e7576[_0x5eb2('0x51')]){if(_0x1e7576['originated']===0x0&&_0x1e7576[_0x5eb2('0x2a')]===0x0){_0x1e7576[_0x5eb2('0x51')]=![];_0x1e7576[_0x5eb2('0x28')]=0x0;_0x1e7576[_0x5eb2('0x52')]=0x0;_0x1e7576[_0x5eb2('0x53')]=_0x5eb2('0x54');ut[_0x5eb2('0x55')](_0x5eb2('0x56'),_0x1e7576[_0x5eb2('0x27')]+_0x5eb2('0x57'));}else{_0x1e7576[_0x5eb2('0x53')]=_0x5eb2('0x58');ut[_0x5eb2('0x55')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1e7576['name']+_0x5eb2('0x59'));}emitCampaignPreview(_0x1e7576);}}Preview[_0x5eb2('0x5a')][_0x5eb2('0x23')]=function(){var _0x30918d=this;setInterval(function(){_0x30918d[_0x5eb2('0x5b')]();},0x7cf);};Preview[_0x5eb2('0x5a')][_0x5eb2('0x5b')]=function(){var _0x596e26=this[_0x5eb2('0x12')];this[_0x5eb2('0x5c')]+=0x1;for(var _0x4be3d3 in _0x596e26){if(_0x596e26['hasOwnProperty'](_0x4be3d3)&&(_0x596e26[_0x4be3d3][_0x5eb2('0x5d')]===_0x5eb2('0x7')||_0x596e26[_0x4be3d3][_0x5eb2('0x5d')]===_0x5eb2('0x5e'))&&_0x596e26[_0x4be3d3][_0x5eb2('0x25')]===_0x5eb2('0x26')){if(this[_0x5eb2('0x5c')]>0x7){this[_0x5eb2('0x5c')]=0x0;this[_0x5eb2('0x5f')]();}}if(_0x596e26['hasOwnProperty'](_0x4be3d3)&&_0x596e26[_0x4be3d3][_0x5eb2('0x5d')]===_0x5eb2('0x7')&&_0x596e26[_0x4be3d3][_0x5eb2('0x25')]===_0x5eb2('0x26')){if(_0x596e26[_0x4be3d3][_0x5eb2('0x32')]){this['setMessage'](_0x596e26[_0x4be3d3]);this[_0x5eb2('0x60')](_0x596e26[_0x4be3d3]);}else{notSendMessagesQueue(_0x596e26[_0x4be3d3]);}}}};Preview[_0x5eb2('0x5a')][_0x5eb2('0x61')]=function(_0x5cd5b9){var _0x54538e=this;this[_0x5eb2('0x11')][_0x5eb2('0xe')](function(){if(!_['isNil'](_0x54538e[_0x5eb2('0x14')][_0x5cd5b9])){loggerAction['info'](_0x5eb2('0x62'),_0x5cd5b9,_0x5eb2('0x63'),_0x54538e[_0x5eb2('0x14')][_0x5cd5b9][_0x5eb2('0x64')],_0x5eb2('0x65'),JSON[_0x5eb2('0x4d')](_0x54538e['campaignsPreview'][_0x54538e[_0x5eb2('0x14')][_0x5cd5b9][_0x5eb2('0x64')]][_0x5eb2('0x48')]),_0x5eb2('0x66'),JSON[_0x5eb2('0x4d')](_0x54538e['campaignsPreview'][_0x54538e['actions'][_0x5cd5b9][_0x5eb2('0x64')]][_0x5eb2('0x2a')]),JSON[_0x5eb2('0x4d')](_0x54538e['actions'][_0x5cd5b9][_0x5eb2('0x67')]),JSON['stringify'](_[_0x5eb2('0x68')](_0x54538e[_0x5eb2('0x14')][_0x5cd5b9],[_0x5eb2('0x69'),'UserId',_0x5eb2('0x6a'),'ListId'])));return ami[_0x5eb2('0x6b')]({'action':_0x5eb2('0x6c'),'channel':_0x54538e[_0x5eb2('0x14')][_0x5cd5b9]['channel']})[_0x5eb2('0x6d')](function(_0x2861eb){if(_0x2861eb['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x54538e[_0x5eb2('0x14')][_0x5cd5b9]){ut[_0x5eb2('0x6e')](_0x54538e[_0x5eb2('0x12')][_0x54538e['actions'][_0x5cd5b9][_0x5eb2('0x64')]],'[clearZombieChannel]');if(_0x54538e[_0x5eb2('0x14')][_0x5cd5b9][_0x5eb2('0x67')]===!![]){ut[_0x5eb2('0x6f')](_0x54538e[_0x5eb2('0x12')][_0x54538e[_0x5eb2('0x14')][_0x5cd5b9]['queue']],'[clearZombieChannel]');ut[_0x5eb2('0x70')](_0x5eb2('0x71')+_0x5cd5b9,_0x54538e[_0x5eb2('0x14')][_0x5cd5b9][_0x5eb2('0x64')]);}ut['loggerError'](_0x5eb2('0x72')+_0x5cd5b9,_0x54538e[_0x5eb2('0x14')][_0x5cd5b9][_0x5eb2('0x64')]);delete _0x54538e[_0x5eb2('0x14')][_0x5cd5b9];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x3f30b2=this;loggerAction[_0x5eb2('0x73')](_0x5eb2('0x74'),_[_0x5eb2('0x75')](this[_0x5eb2('0x14')]));for(var _0x41ee07 in this[_0x5eb2('0x14')]){if(_0x3f30b2[_0x5eb2('0x14')][_0x5eb2('0x76')](_0x41ee07)){_0x3f30b2['clearZombieChannel'](_0x41ee07);}}};Preview[_0x5eb2('0x5a')]['recallMe']=function(_0x4c8899){var _0x359ece=this;rpcDb[_0x5eb2('0x77')](_0x4c8899['id'],ut['agentReadyId'](this[_0x5eb2('0x15')]))[_0x5eb2('0x78')](function(_0x102c49){if(!_[_0x5eb2('0x79')](_0x102c49)){for(var _0x3f40e7=0x0;_0x3f40e7<_0x102c49['length'];_0x3f40e7+=0x1){if(ut[_0x5eb2('0x7a')](_0x102c49[_0x3f40e7][_0x5eb2('0x7b')])<_0x4c8899[_0x5eb2('0x7c')]*0x3c){_0x359ece[_0x5eb2('0x7d')](_0x102c49[_0x3f40e7]['id'])[_0x5eb2('0x78')](ut[_0x5eb2('0x7e')](_0x5eb2('0x7f')))[_0x5eb2('0x6d')](ut[_0x5eb2('0x7e')]('[RecallMe]'));}else{var _0x8f2c8b=new Action(_0x102c49[_0x3f40e7],_0x4c8899);_0x8f2c8b[_0x5eb2('0x80')]=moment()[_0x5eb2('0x4f')](_0x5eb2('0x81'));_0x4c8899[_0x5eb2('0x82')]+=0x1;ut[_0x5eb2('0x83')](_0x8f2c8b,0x17,'RecallInQueue');if(_0x4c8899[_0x5eb2('0x84')]){rpcDb[_0x5eb2('0x85')](ut[_0x5eb2('0x86')](_0x102c49[_0x3f40e7]));rpcDb[_0x5eb2('0x87')](_0x8f2c8b,_0x5eb2('0x88'));}else{ut['logCustomer'](_0x8f2c8b,0x16,_0x5eb2('0x89'));rpcDb[_0x5eb2('0x87')](_0x8f2c8b,_0x5eb2('0x8a'));rpcDb['createCustomerFinal'](_0x8f2c8b,_0x5eb2('0x8a'));}}}}})[_0x5eb2('0x6d')](ut[_0x5eb2('0x7e')](_0x5eb2('0x8b')));};Preview[_0x5eb2('0x5a')]['setMessage']=function(_0xbac85c){_0xbac85c[_0x5eb2('0x51')]=!![];if(ut[_0x5eb2('0x8c')](_0xbac85c[_0x5eb2('0x29')])){_0xbac85c[_0x5eb2('0x53')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x5eb2('0x8d')](_0xbac85c[_0x5eb2('0x32')])){_0xbac85c['message']='NOT_ACTIVE';}else if(!this[_0x5eb2('0x8e')](_0xbac85c[_0x5eb2('0x49')])){if(!this[_0x5eb2('0x8e')](_0xbac85c['TrunkBackup'])){_0xbac85c[_0x5eb2('0x53')]=_0x5eb2('0x8f');}else{_0xbac85c['message']=_0x5eb2('0x90');}}else{_0xbac85c[_0x5eb2('0x53')]=_0x5eb2('0x90');}emitCampaignPreview(_0xbac85c);};Preview[_0x5eb2('0x5a')][_0x5eb2('0x91')]=function(_0x5adc04,_0x24829f,_0x24677b){var _0xcf2fae=this;var _0x5971ef=this[_0x5eb2('0x14')][_0x24829f];var _0x1b49fc=this[_0x5eb2('0x12')][_0x5971ef[_0x5eb2('0x64')]];var _0x11b9ef;if(_0x1b49fc){switch(_0x24677b){case'1':_0x1b49fc[_0x5eb2('0x3c')]+=0x1;_0x5971ef[_0x5eb2('0x92')]=ut['totalGlobal'](_0x5971ef);ut['logCustomer'](_0x5971ef,0x0,_0x5eb2('0x93'));rpcDb[_0x5eb2('0x87')](_0x5971ef,_0x5eb2('0x94'));if(ut[_0x5eb2('0x95')](_0x5971ef)>=_0x1b49fc[_0x5eb2('0x96')]){_0x11b9ef=ut[_0x5eb2('0x97')](_0x5971ef,0xf,_0x5eb2('0x98'));rpcDb[_0x5eb2('0x99')](_0x11b9ef,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x5eb2('0x99')](_0x5971ef,_0x5eb2('0x9a'));}delete this[_0x5eb2('0x14')][_0x5adc04['linkedid']];break;case _0x5eb2('0x9b'):var _0x51959d=moment()[_0x5eb2('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5971ef[_0x5eb2('0x9c')]=_0x51959d;_0x5971ef['answertime']=_0x51959d;_0x5971ef[_0x5eb2('0x67')]=!![];_0x1b49fc[_0x5eb2('0x2a')]+=0x1;logger['info'](_0x5eb2('0x9d'),_0x5971ef['uniqueid'],_0x5eb2('0x9e'),_0x1b49fc[_0x5eb2('0x27')],_0x5eb2('0x66'),_0x1b49fc[_0x5eb2('0x2a')]);ami[_0x5eb2('0x24')]('custom:agentconnect',ut['buildObj'](_0x5971ef,_0x5eb2('0x9f')));if(_0x1b49fc[_0x5eb2('0xa0')]){ami[_0x5eb2('0x24')](_0x5eb2('0xa1'),ut[_0x5eb2('0xa2')](_0x5971ef));}break;case'16':ami[_0x5eb2('0x24')](_0x5eb2('0xa3'),ut[_0x5eb2('0xa4')](_0x5971ef,_0x5eb2('0xa5')));emitVoiceQueueChannelRemove(ut[_0x5eb2('0xa4')](_0x5971ef,_0x5eb2('0xa5')));_0x1b49fc[_0x5eb2('0x36')]+=0x1;_0x1b49fc[_0x5eb2('0x2e')]+=0x1;_0x1b49fc[_0x5eb2('0xa6')]+=0x1;ut[_0x5eb2('0x6f')](_0x1b49fc,_0x5eb2('0xa7'));_0x5971ef[_0x5eb2('0x92')]=ut[_0x5eb2('0x95')](_0x5971ef);ut[_0x5eb2('0x83')](_0x5971ef,0x4,'Answer');rpcDb[_0x5eb2('0x87')](_0x5971ef,_0x5eb2('0xa8'));rpcDb[_0x5eb2('0x99')](_0x5971ef,_0x5eb2('0xa9'));rpcDb[_0x5eb2('0xaa')](_0x5971ef);_0x1b49fc[_0x5eb2('0xab')]+=_0x5971ef[_0x5eb2('0xac')];_0x1b49fc[_0x5eb2('0x2b')]+=_0x5971ef['talktime'];logger[_0x5eb2('0x73')](_0x5eb2('0xad'),_0x5971ef['uniqueid'],_0x5eb2('0x9e'),_0x1b49fc['name'],_0x5eb2('0x66'),_0x1b49fc[_0x5eb2('0x2a')]);delete this['actions'][_0x5adc04[_0x5eb2('0xae')]];break;case _0x5eb2('0xaf'):_0x1b49fc[_0x5eb2('0x37')]+=0x1;_0x5971ef[_0x5eb2('0xb0')]+=0x1;_0x5971ef['countglobal']=ut[_0x5eb2('0x95')](_0x5971ef);ut['logCustomer'](_0x5971ef,0x5,_0x5eb2('0xb1'));rpcDb[_0x5eb2('0x87')](_0x5971ef,_0x5eb2('0xb2'));if(ut['totalGlobal'](_0x5971ef)>=_0x1b49fc[_0x5eb2('0x96')]){_0x11b9ef=ut['cloneAction'](_0x5971ef,0xf,_0x5eb2('0x98'));rpcDb[_0x5eb2('0x99')](_0x11b9ef,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5971ef[_0x5eb2('0xb0')]>=_0x1b49fc['dialBusyMaxRetry']){rpcDb[_0x5eb2('0x99')](_0x5971ef,_0x5eb2('0xb2'));}else{rpcDb[_0x5eb2('0xb3')](ut[_0x5eb2('0xb4')](_0x5971ef,_0x5eb2('0xb0'),_0x1b49fc[_0x5eb2('0xb5')]),_0x5971ef[_0x5eb2('0xb6')],_0x5971ef[_0x5eb2('0xb7')]);}}break;case'NOANSWER':_0x1b49fc[_0x5eb2('0x3b')]+=0x1;_0x5971ef[_0x5eb2('0xb8')]+=0x1;_0x5971ef[_0x5eb2('0x92')]=ut['totalGlobal'](_0x5971ef);ut[_0x5eb2('0x83')](_0x5971ef,0x3,_0x5eb2('0xb9'));rpcDb[_0x5eb2('0x87')](_0x5971ef,_0x5eb2('0xba'));if(ut[_0x5eb2('0x95')](_0x5971ef)>=_0x1b49fc[_0x5eb2('0x96')]){_0x11b9ef=ut[_0x5eb2('0x97')](_0x5971ef,0xf,_0x5eb2('0x98'));rpcDb['createCustomerFinal'](_0x11b9ef,_0x5eb2('0xbb'));}else{if(_0x5971ef[_0x5eb2('0xb8')]>=_0x1b49fc[_0x5eb2('0xbc')]){rpcDb[_0x5eb2('0x99')](_0x5971ef,_0x5eb2('0xba'));}else{rpcDb[_0x5eb2('0xb3')](ut[_0x5eb2('0xb4')](_0x5971ef,_0x5eb2('0xb8'),_0x1b49fc[_0x5eb2('0xbd')]),_0x5971ef[_0x5eb2('0xb6')],_0x5971ef[_0x5eb2('0xb7')]);}}break;case _0x5eb2('0xbe'):_0x1b49fc[_0x5eb2('0xbf')]+=0x1;_0x5971ef[_0x5eb2('0xc0')]+=0x1;_0x5971ef[_0x5eb2('0x92')]=ut[_0x5eb2('0x95')](_0x5971ef);ut[_0x5eb2('0x83')](_0x5971ef,0x8,_0x5eb2('0xc1'));rpcDb[_0x5eb2('0x87')](_0x5971ef,_0x5eb2('0xc2'));if(ut[_0x5eb2('0x95')](_0x5971ef)>=_0x1b49fc[_0x5eb2('0x96')]){_0x11b9ef=ut['cloneAction'](_0x5971ef,0xf,'Global');rpcDb[_0x5eb2('0x99')](_0x11b9ef,_0x5eb2('0xc3'));}else{if(_0x5971ef[_0x5eb2('0xc0')]>=_0x1b49fc[_0x5eb2('0xc4')]){rpcDb[_0x5eb2('0x99')](_0x5971ef,_0x5eb2('0xc2'));}else{rpcDb[_0x5eb2('0xb3')](ut[_0x5eb2('0xb4')](_0x5971ef,'countcongestionretry',_0x1b49fc['dialBusyRetryFrequency']),_0x5971ef[_0x5eb2('0xb6')],_0x5971ef[_0x5eb2('0xb7')]);}}break;case'CANCEL':_0x1b49fc[_0x5eb2('0x3e')]+=0x1;_0x5971ef[_0x5eb2('0x92')]=ut['totalGlobal'](_0x5971ef);ut['logCustomer'](_0x5971ef,0x14,'AgentReject');rpcDb[_0x5eb2('0x87')](_0x5971ef,_0x5eb2('0xc5'));if(_0x5971ef[_0x5eb2('0xb6')]){rpcDb[_0x5eb2('0xc6')](_0x5971ef[_0x5eb2('0xc7')]);}if(_0x5971ef[_0x5eb2('0xb7')]){rpcDb['disableContact'](_0x5971ef[_0x5eb2('0xc7')]);}break;default:if(_0x5971ef[_0x5eb2('0x67')]){ut[_0x5eb2('0x6f')](_0x1b49fc,_0x5eb2('0xc8'));ut[_0x5eb2('0x70')](_0x5eb2('0xc9')+_0x1b49fc[_0x5eb2('0x27')],_0x5adc04);}_0x1b49fc[_0x5eb2('0xca')]+=0x1;_0x5971ef[_0x5eb2('0x92')]=ut[_0x5eb2('0x95')](_0x5971ef);ut[_0x5eb2('0x83')](_0x5971ef,0xc,_0x5adc04[_0x5eb2('0xcb')]||_0x5adc04[_0x5eb2('0xcc')]);rpcDb[_0x5eb2('0x87')](_0x5971ef,_0x5eb2('0xcd'));if(ut[_0x5eb2('0x95')](_0x5971ef)>=_0x1b49fc['dialGlobalMaxRetry']){_0x11b9ef=ut[_0x5eb2('0x97')](_0x5971ef,0xf,_0x5eb2('0x98'));rpcDb[_0x5eb2('0x99')](_0x11b9ef,_0x5eb2('0xce'));}else{rpcDb['createCustomerFinal'](_0x5971ef,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x5eb2('0x14')][_0x5adc04['linkedid']];}if(!(_0x5971ef[_0x5eb2('0x67')]&&_0x24677b==='16')){ut[_0x5eb2('0x6e')](_0x1b49fc,_0x5eb2('0xcf'));logger['info'](_0x5eb2('0xd0'),_0x5971ef[_0x5eb2('0xd1')],_0x5eb2('0x9e'),_0x1b49fc[_0x5eb2('0x27')],_0x5eb2('0x65'),_0x1b49fc['originated']);}if(_0x24677b!==_0x5eb2('0x9b')){delete this[_0x5eb2('0x14')][_0x5adc04[_0x5eb2('0xae')]];delete this['actions'][_0x5adc04[_0x5eb2('0xd2')]];}}};Preview['prototype'][_0x5eb2('0xd3')]=function(_0x4a174e,_0x53f166,_0x79cb83){if(_[_0x5eb2('0xd4')](_0x53f166)&&_0x5eb2('0xd5')!==typeof _0x53f166){return;}if(_['isUndefined'](_0x79cb83)&&'object'!==typeof _0x79cb83){return;}switch(_0x79cb83[_0x5eb2('0xd6')]){case'0':ut['logAgent'](_0x4a174e,0x0,'NoSuchNumber');rpcDb[_0x5eb2('0xd7')](_0x4a174e,_0x5eb2('0xd8'));break;case'3':ut['logAgent'](_0x4a174e,0x3,'NoAnswer');rpcDb[_0x5eb2('0xd7')](_0x4a174e,_0x5eb2('0xd9'));break;case'5':ut['logAgent'](_0x4a174e,0x5,_0x5eb2('0xb1'));rpcDb[_0x5eb2('0xd7')](_0x4a174e,_0x5eb2('0xda'));break;case'8':ut['logAgent'](_0x4a174e,0x8,_0x5eb2('0xc1'));rpcDb[_0x5eb2('0xd7')](_0x4a174e,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x5eb2('0xdb')](_0x4a174e,0x16,_0x5eb2('0xdc'));rpcDb[_0x5eb2('0xd7')](_0x4a174e,_0x5eb2('0xdd'));break;default:ut[_0x5eb2('0xdb')](_0x4a174e,0xc,_0x79cb83[_0x5eb2('0xd6')]);rpcDb['createAgentHistory'](_0x4a174e,_0x5eb2('0xde'));}ut[_0x5eb2('0x6e')](_0x53f166,_0x5eb2('0xdf'));logger[_0x5eb2('0x73')](_0x5eb2('0xe0'),_0x4a174e[_0x5eb2('0xd1')],_0x5eb2('0x9e'),_0x53f166[_0x5eb2('0x27')],_0x5eb2('0x65'),_0x53f166['originated']);delete this[_0x5eb2('0x14')][_0x4a174e[_0x5eb2('0xd1')]];};Preview[_0x5eb2('0x5a')][_0x5eb2('0xe1')]=function(_0x2665a9,_0x6fbd70,_0x747e67,_0xb35ddc,_0x391d8d){var _0x288ab0=this;return new BPromise(function(_0x3f9e3c,_0x3fa356){if(_[_0x5eb2('0x79')](_0x6fbd70)||_[_0x5eb2('0x79')](_0x6fbd70['Contact'])||_['isNil'](_0x6fbd70[_0x5eb2('0xe2')][_0x5eb2('0xe3')])||_[_0x5eb2('0x79')](_0x6fbd70['VoiceQueueId'])){_0x3fa356(ut[_0x5eb2('0x53')](_0x5eb2('0xe4'),_0xb35ddc,_0x391d8d));return;}var _0x22229e=uuid['v4']();var _0xdcae08=_0x288ab0[_0x5eb2('0x12')][_0x6fbd70[_0x5eb2('0x63')][_0x5eb2('0x27')]];var _0x3dcb8a=_0x747e67?_0x288ab0[_0x5eb2('0x15')][_0x747e67]['id']:undefined;_0x288ab0[_0x5eb2('0x14')][_0x22229e]=new Action(_0x6fbd70,_0xdcae08,_0x22229e,_0x747e67,_0x3dcb8a);var _0x5295c3=_0x288ab0[_0x5eb2('0x14')][_0x22229e];_0x5295c3['unlockAgent']=_0xb35ddc;_0x5295c3['activeContact']=_0x391d8d;_0x5295c3[_0x5eb2('0xe5')]=_0x747e67;if(_['isEmpty'](_0x2665a9)){_0x288ab0[_0x5eb2('0xe6')](_0x5295c3,_0xdcae08,_0x6fbd70,_0x747e67)[_0x5eb2('0x78')](function(_0x18b4c4){logger['info'](_0x5eb2('0xe7'),_0x5eb2('0xe8')+_0x5295c3['queue']+_0x5eb2('0xe9')+_0x5295c3[_0x5eb2('0xc7')],JSON[_0x5eb2('0x4d')](_0x18b4c4));ami[_0x5eb2('0x24')](_0x5eb2('0xea'),ut['buildObj'](_0x5295c3,_0x5eb2('0xeb')));_0x3f9e3c(ut[_0x5eb2('0x53')](_0x5eb2('0xec')));})[_0x5eb2('0x6d')](function(_0x44959e){ut[_0x5eb2('0x55')](_0x5eb2('0xed'),_0x44959e);_0x3fa356(ut['message'](_0x5eb2('0xee'),_0xb35ddc,_0x391d8d));});}else{_0xdcae08['outboundBlacklistCallsDay']+=0x1;ut[_0x5eb2('0xef')](_0x5295c3);rpcDb[_0x5eb2('0xf0')](_0x5295c3,_0x5eb2('0xf1'));delete _0x288ab0[_0x5eb2('0x14')][_0x22229e];_0x3fa356(ut['message'](_0x5eb2('0xf2'),_0xb35ddc,_0x391d8d));}});};Preview[_0x5eb2('0x5a')][_0x5eb2('0x8e')]=function(_0x41be41){return!_['isNil'](_0x41be41)&&!_[_0x5eb2('0x79')](_0x41be41[_0x5eb2('0x27')])&&!_['isNil'](_0x41be41[_0x5eb2('0x4a')])&&_0x41be41[_0x5eb2('0x4a')]&&!_['isNil'](this[_0x5eb2('0x13')][util[_0x5eb2('0x4f')](_0x5eb2('0xf3'),_0x41be41[_0x5eb2('0x27')])])&&!_[_0x5eb2('0x79')](this[_0x5eb2('0x13')][util[_0x5eb2('0x4f')]('SIP/%s',_0x41be41[_0x5eb2('0x27')])][_0x5eb2('0x6c')])&&(this['trunks'][util[_0x5eb2('0x4f')](_0x5eb2('0xf3'),_0x41be41[_0x5eb2('0x27')])][_0x5eb2('0x6c')]===_0x5eb2('0xf4')||this[_0x5eb2('0x13')][util['format'](_0x5eb2('0xf3'),_0x41be41[_0x5eb2('0x27')])]['status']===_0x5eb2('0xf5'));};Preview[_0x5eb2('0x5a')][_0x5eb2('0x7d')]=function(_0x37472e,_0x3766b4){var _0x25b1ac=this;return new BPromise(function(_0x33f212,_0x3a0167){_0x25b1ac[_0x5eb2('0xf6')](_0x37472e,_0x3766b4)[_0x5eb2('0x78')](function(_0x33bef0){_0x33f212(_[_0x5eb2('0x68')](_0x33bef0,[_0x5eb2('0x53')]));})[_0x5eb2('0x6d')](function(_0x1fea10){if(_0x1fea10[_0x5eb2('0xf7')]){rpcDb[_0x5eb2('0xc6')](_0x37472e);}if(_0x1fea10[_0x5eb2('0x4a')]){rpcDb[_0x5eb2('0xf8')](_0x37472e);}_0x3a0167(_[_0x5eb2('0x68')](_0x1fea10,[_0x5eb2('0x53')]));});});};Preview[_0x5eb2('0x5a')][_0x5eb2('0xf6')]=function(_0x2638bd,_0x3d5619){var _0x4c5866=this;return new BPromise(function(_0x297c1c,_0x3359f7){var _0x1782ac,_0x45b44b;rpcDb[_0x5eb2('0xf9')](_0x2638bd)[_0x5eb2('0x78')](function(_0x341e7a){if(!_[_0x5eb2('0x79')](_0x341e7a[0x0])){_0x45b44b=_0x341e7a[0x0][_0x5eb2('0xfa')]?![]:!![];_0x1782ac=_0x341e7a[0x0]['recallme']?!![]:![];_0x1782ac=_0x3d5619?!![]:_0x1782ac;}var _0x53dc80=_0x4c5866['validateContact'](_0x341e7a);if(_0x53dc80[_0x5eb2('0xfb')]){rpcDb[_0x5eb2('0xfc')](_[_0x5eb2('0x68')](_0x341e7a[0x0],[_0x5eb2('0x6a'),_0x5eb2('0xfd')]))['then'](function(_0x35253c){_0x4c5866[_0x5eb2('0xe1')](_0x35253c,_0x341e7a[0x0],_0x3d5619,_0x45b44b,_0x1782ac)['then'](function(_0x6a79f3){_0x297c1c(_0x6a79f3);})[_0x5eb2('0x6d')](function(_0xb92a32){_0x3359f7(_0xb92a32);});})[_0x5eb2('0x6d')](function(_0x5c0cc7){ut[_0x5eb2('0x55')]('[Preview][checkIsBlackList]',_0x5c0cc7);_0x3359f7(ut[_0x5eb2('0x53')](_0x5eb2('0xfe'),_0x45b44b,_0x1782ac));});}else{_0x3359f7(ut[_0x5eb2('0x53')](_0x53dc80[_0x5eb2('0x53')],_0x45b44b,_0x1782ac));}})[_0x5eb2('0x6d')](function(_0x2a4510){ut[_0x5eb2('0x55')](_0x5eb2('0xff'),_0x2a4510);_0x3359f7(ut['message'](_0x5eb2('0xfe'),![],!![]));});});};Preview[_0x5eb2('0x5a')][_0x5eb2('0x100')]=function(_0x596281){if(_[_0x5eb2('0x79')](_0x596281)||_[_0x5eb2('0x101')](_0x596281)||!_[_0x5eb2('0x79')](_0x596281[0x0]['Agent'])&&_[_0x5eb2('0x79')](_0x596281[0x0]['Agent'][_0x5eb2('0x27')])){ut[_0x5eb2('0x55')](_0x5eb2('0x102'),_0x596281);return{'isValid':![],'message':_0x5eb2('0x103')};}var _0x9045e0=this['campaignsPreview'][_0x596281[0x0]['Queue'][_0x5eb2('0x27')]];_0x9045e0[_0x5eb2('0x53')]=_0x5eb2('0x90');if(_[_0x5eb2('0x79')](_0x9045e0)){ut[_0x5eb2('0x55')](_0x5eb2('0x104'),_0x9045e0);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x5eb2('0x8e')](_0x9045e0[_0x5eb2('0x49')])){ut[_0x5eb2('0x55')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x5eb2('0x105')+_0x9045e0[_0x5eb2('0x27')]+_0x5eb2('0x106'));if(!this[_0x5eb2('0x8e')](_0x9045e0[_0x5eb2('0x107')])){ut['logger'](_0x5eb2('0x108'),_0x9045e0['name']+_0x5eb2('0x109'));return{'isValid':![],'message':_0x5eb2('0x10a')};}}if(!ut[_0x5eb2('0x8d')](_0x9045e0[_0x5eb2('0x32')])){ut['logger'](_0x5eb2('0x10b'),_0x9045e0[_0x5eb2('0x27')]+_0x5eb2('0x10c'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x9045e0['name']+_0x5eb2('0x10c')};}return{'isValid':!![],'message':_0x5eb2('0x10d')};};Preview[_0x5eb2('0x5a')][_0x5eb2('0xe6')]=function(_0x32b411,_0x231fcb,_0x1d48a3,_0x90dea){var _0x372cc9=this;return new BPromise(function(_0x3a1a4f,_0x1c71e3){var _0x341e03=_0x32b411[_0x5eb2('0xd1')];var _0x5a705c=_0x372cc9[_0x5eb2('0x8e')](_0x231fcb[_0x5eb2('0x49')])?util[_0x5eb2('0x4f')](_0x5eb2('0x10e'),_0x231fcb[_0x5eb2('0x49')][_0x5eb2('0x27')],_['isNil'](_0x231fcb[_0x5eb2('0x34')])?'':_0x231fcb[_0x5eb2('0x34')][_0x5eb2('0x10f')]()||'',_0x231fcb[_0x5eb2('0x110')]>0x0?_0x1d48a3['Contact'][_0x5eb2('0xe3')][_0x5eb2('0x111')](_0x231fcb[_0x5eb2('0x110')]):_0x1d48a3[_0x5eb2('0xe2')][_0x5eb2('0xe3')]):util[_0x5eb2('0x4f')](_0x5eb2('0x10e'),_['isNil'](_0x231fcb[_0x5eb2('0x107')])?_0x231fcb[_0x5eb2('0x49')]['name']:_0x231fcb[_0x5eb2('0x107')][_0x5eb2('0x27')],_[_0x5eb2('0x79')](_0x231fcb[_0x5eb2('0x34')])?'':_0x231fcb[_0x5eb2('0x34')][_0x5eb2('0x10f')]()||'',_0x231fcb[_0x5eb2('0x110')]>0x0?_0x1d48a3[_0x5eb2('0xe2')][_0x5eb2('0xe3')][_0x5eb2('0x111')](_0x231fcb[_0x5eb2('0x110')]):_0x1d48a3[_0x5eb2('0xe2')][_0x5eb2('0xe3')]);var _0x19aba1=_0x372cc9[_0x5eb2('0x8e')](_0x231fcb['Trunk'])?ut[_0x5eb2('0x112')](_0x231fcb[_0x5eb2('0x49')][_0x5eb2('0x4b')],_0x231fcb['dialOriginateCallerIdName'],_0x231fcb[_0x5eb2('0x113')]>0x0?ut[_0x5eb2('0x114')](_0x231fcb[_0x5eb2('0x115')],_0x231fcb[_0x5eb2('0x113')]):_0x231fcb[_0x5eb2('0x115')]):ut[_0x5eb2('0x112')](_[_0x5eb2('0x79')](_0x231fcb[_0x5eb2('0x107')])?_0x231fcb[_0x5eb2('0x49')]['callerid']:_0x231fcb[_0x5eb2('0x107')]['callerid'],_0x231fcb[_0x5eb2('0x116')],_0x231fcb[_0x5eb2('0x113')]>0x0?ut[_0x5eb2('0x114')](_0x231fcb[_0x5eb2('0x115')],_0x231fcb[_0x5eb2('0x113')]):_0x231fcb[_0x5eb2('0x115')]);if(_0x19aba1){_0x32b411[_0x5eb2('0x117')]=ut[_0x5eb2('0x118')](_0x19aba1);_0x32b411['originatecalleridnum']=ut[_0x5eb2('0x119')](_0x19aba1);}var _0x14dfad=ut['addVariables'](_0x231fcb,_0x1d48a3,_0x5a705c,_0x19aba1,_0x341e03,_0x32b411);_[_0x5eb2('0x11a')](_0x32b411,ut[_0x5eb2('0x11b')](_0x14dfad));_0x32b411[_0x5eb2('0x80')]=moment()[_0x5eb2('0x4f')](_0x5eb2('0x81'));ami[_0x5eb2('0x6b')](ut[_0x5eb2('0x11c')](_0x32b411,_0x231fcb,_0x14dfad,_0x32b411[_0x5eb2('0xb7')],_0x90dea))['then'](function(_0x241b04){_0x231fcb[_0x5eb2('0x48')]+=0x1;logger[_0x5eb2('0x73')](_0x5eb2('0x11d'),_0x341e03,'\x20Queue',_0x231fcb[_0x5eb2('0x27')],'originated:\x20',_0x231fcb['originated']);_0x3a1a4f(_0x241b04);})[_0x5eb2('0x6d')](function(_0x1f3280){ut[_0x5eb2('0xdb')](_0x32b411,0xe,_0x5eb2('0x11e'));rpcDb['createAgentHistory'](_0x32b411,_0x5eb2('0x11f'));_0x1c71e3(_0x1f3280);});});};Preview[_0x5eb2('0x5a')][_0x5eb2('0x120')]=function(_0x4ead57){if(this[_0x5eb2('0x14')][_0x4ead57[_0x5eb2('0xae')]]){this['actions'][_0x4ead57['linkedid']][_0x5eb2('0x121')]=_0x4ead57[_0x5eb2('0x121')];}};Preview[_0x5eb2('0x5a')][_0x5eb2('0x17')]=function(_0x4235cd){var _0x43e740=this;var _0x26ae57=this[_0x5eb2('0x14')][_0x4235cd[_0x5eb2('0x122')]];if(_0x26ae57){if(_0x26ae57[_0x5eb2('0xe5')]&&this['agents'][_0x26ae57[_0x5eb2('0xe5')]]){ut[_0x5eb2('0x123')](_0x26ae57,this[_0x5eb2('0x15')][_0x26ae57['lookAgent']]['name'],this[_0x5eb2('0x15')][_0x26ae57[_0x5eb2('0xe5')]]['id']);}var _0x26a495=_[_0x5eb2('0x124')](_0x26ae57);_0x26a495[_0x5eb2('0x9c')]=moment()[_0x5eb2('0x4f')](_0x5eb2('0x81'));var _0x2416a5=_0x43e740[_0x5eb2('0x12')][_0x26ae57['queue']];if(ut[_0x5eb2('0x125')](_0x4235cd[_0x5eb2('0x126')])){if(_0x26ae57[_0x5eb2('0xb6')]){rpcDb[_0x5eb2('0xc6')](_0x26ae57[_0x5eb2('0xc7')]);}if(_0x26ae57[_0x5eb2('0xb7')]){rpcDb['disableContact'](_0x26ae57['idContact']);}ami['emit'](_0x5eb2('0x127'),ut['buildObj'](_0x26ae57,_0x5eb2('0x128')));this[_0x5eb2('0xd3')](_0x26a495,_0x2416a5,_0x4235cd);}else{_0x26ae57[_0x5eb2('0x80')]=moment()['format'](_0x5eb2('0x81'));ut[_0x5eb2('0xdb')](_0x26a495,0x4,_0x5eb2('0x129'));rpcDb['createAgentHistory'](_0x26a495,_0x5eb2('0x12a'));}}};Preview[_0x5eb2('0x5a')][_0x5eb2('0x1a')]=function(_0x198a08){var _0x2ac4be=this;var _0x3612ab=this['actions'][_0x198a08[_0x5eb2('0xae')]];var _0x2a247d;if(_0x3612ab){_0x2a247d=this[_0x5eb2('0x12')][_0x3612ab[_0x5eb2('0x64')]];logger[_0x5eb2('0x73')]('[syncHangup][talking]',_0x198a08[_0x5eb2('0xae')],'\x20Queue',_0x2a247d[_0x5eb2('0x27')],_0x5eb2('0x66'),_0x2a247d[_0x5eb2('0x2a')]);}if(this[_0x5eb2('0x14')][_0x198a08['linkedid']]&&_0x198a08[_0x5eb2('0xae')]!==_0x198a08['uniqueid']){if(_0x198a08['cause']==='16'&&this[_0x5eb2('0x14')][_0x198a08[_0x5eb2('0xae')]][_0x5eb2('0x67')]){this['callProgressDetectingCustomer'](_0x198a08,_0x198a08[_0x5eb2('0xae')],_0x198a08['cause']);}else if(this[_0x5eb2('0x14')][_0x198a08['linkedid']][_0x5eb2('0x67')]){logger[_0x5eb2('0x73')](_0x5eb2('0x12b'),_0x198a08[_0x5eb2('0xae')],_0x198a08[_0x5eb2('0x12c')],_0x5eb2('0x9e'),_0x2a247d[_0x5eb2('0x27')],'pTalking:\x20',_0x2a247d['pTalking']);this['callProgressDetectingCustomer'](_0x198a08,_0x198a08[_0x5eb2('0xae')],_0x198a08[_0x5eb2('0x12c')]);}}else if(_0x3612ab&&_[_0x5eb2('0x79')](_0x3612ab[_0x5eb2('0x12d')])&&_0x2a247d['dialQueueProject']&&_0x198a08[_0x5eb2('0xae')]===_0x198a08[_0x5eb2('0xd1')]&&_[_0x5eb2('0x79')](_0x198a08[_0x5eb2('0xd6')])&&_0x198a08['cause']==='16'&&_0x198a08[_0x5eb2('0x12e')]==='6'&&_[_0x5eb2('0xd4')](_0x3612ab[_0x5eb2('0x12f')])){if(_0x3612ab[_0x5eb2('0xb6')]){rpcDb[_0x5eb2('0xc6')](_0x3612ab[_0x5eb2('0xc7')]);}if(_0x3612ab[_0x5eb2('0xb7')]){rpcDb[_0x5eb2('0xf8')](_0x3612ab[_0x5eb2('0xc7')]);}_0x198a08[_0x5eb2('0xd6')]='22';this[_0x5eb2('0xd3')](_0x3612ab,_0x2a247d,_0x198a08);}else if(_0x3612ab&&_0x3612ab['transfer']){if(_0x198a08[_0x5eb2('0x12c')]==='16'&&this['actions'][_0x198a08[_0x5eb2('0xae')]][_0x5eb2('0x67')]){logger[_0x5eb2('0x73')](_0x5eb2('0x130'),_0x198a08['linkedid'],_0x198a08['cause'],_0x5eb2('0x9e'),_0x2a247d['name'],_0x5eb2('0x66'),_0x2a247d[_0x5eb2('0x2a')]);this[_0x5eb2('0x91')](_0x198a08,_0x198a08[_0x5eb2('0xae')],_0x198a08[_0x5eb2('0x12c')]);}else if(this[_0x5eb2('0x14')][_0x198a08['linkedid']][_0x5eb2('0x67')]){logger['info'](_0x5eb2('0x12b'),_0x198a08[_0x5eb2('0xae')],_0x198a08[_0x5eb2('0x12c')],_0x5eb2('0x9e'),_0x2a247d['name'],_0x5eb2('0x66'),_0x2a247d[_0x5eb2('0x2a')]);this['callProgressDetectingCustomer'](_0x198a08,_0x198a08[_0x5eb2('0xae')],_0x198a08[_0x5eb2('0x12c')]);}}};Preview[_0x5eb2('0x5a')][_0x5eb2('0x131')]=function(_0x546f8e){if(this['actions'][_0x546f8e['destlinkedid']]&&_0x546f8e['destlinkedid']!==_0x546f8e['destuniqueid']){this['callProgressDetectingCustomer'](_0x546f8e,_0x546f8e[_0x5eb2('0xd2')],_0x546f8e[_0x5eb2('0xcc')]);}};Preview[_0x5eb2('0x5a')][_0x5eb2('0x1c')]=function(_0x5d3d4d){if(this['actions'][_0x5d3d4d['linkedid']]&&_0x5d3d4d['linkedid']!==_0x5d3d4d[_0x5eb2('0xd1')]&&!this[_0x5eb2('0x14')][_0x5d3d4d[_0x5eb2('0xae')]][_0x5eb2('0x67')]){if(_0x5d3d4d[_0x5eb2('0x12c')]==='1'){this['callProgressDetectingCustomer'](_0x5d3d4d,_0x5d3d4d[_0x5eb2('0xae')],_0x5d3d4d[_0x5eb2('0x12c')]);}}};Preview['prototype'][_0x5eb2('0x132')]=function(_0x46af9c,_0x510b8f,_0x2dc17a){if(this['actions'][_0x46af9c]){if(_[_0x5eb2('0x79')](this[_0x5eb2('0x14')][_0x46af9c][_0x5eb2('0x133')])){this[_0x5eb2('0x14')][_0x46af9c][_0x5eb2('0x133')]={};}this[_0x5eb2('0x14')][_0x46af9c][_0x5eb2('0x133')][_0x510b8f]=_0x2dc17a;}};Preview[_0x5eb2('0x5a')][_0x5eb2('0x134')]=function(_0x196e2e){try{if(!_['isNil'](_0x196e2e)){if(ut[_0x5eb2('0x135')](_[_0x5eb2('0x136')](_0x196e2e[_0x5eb2('0x137')])[0x0])){this['addVariable'](_0x196e2e['uniqueid'],_['keys'](_0x196e2e['variable'])[0x0],_0x196e2e['value']);}}}catch(_0x4403ff){logger[_0x5eb2('0x138')](_0x5eb2('0x139'),util[_0x5eb2('0x13a')](_0x4403ff,{'showHidden':![],'depth':null}));}};Preview[_0x5eb2('0x5a')][_0x5eb2('0x20')]=function(_0x3224ff){if(_0x3224ff){if(this[_0x5eb2('0x14')][_0x3224ff[_0x5eb2('0x13b')]]){this['actions'][_0x3224ff['transfertargetlinkedid']][_0x5eb2('0x12f')]=!![];}}};Preview[_0x5eb2('0x5a')]['syncBlindTransfer']=function(_0x7177a3){if(_0x7177a3){if(this[_0x5eb2('0x14')][_0x7177a3['transfererlinkedid']]){this['actions'][_0x7177a3[_0x5eb2('0x13c')]][_0x5eb2('0x12f')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 8579731..69bb8d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5af1=['calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','create','[voiceQueueReport]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum'];(function(_0x482fcc,_0x448923){var _0x16ab21=function(_0x468a99){while(--_0x468a99){_0x482fcc['push'](_0x482fcc['shift']());}};_0x16ab21(++_0x448923);}(_0x5af1,0x14b));var _0x15af=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x5af1[_0x59162a];return _0x35e50d;};'use strict';var util=require(_0x15af('0x0'));var BPromise=require(_0x15af('0x1'));var logger=require(_0x15af('0x2'))('preview');var _=require(_0x15af('0x3'));var cmHopper=require(_0x15af('0x4'));var cmHopperFinal=require(_0x15af('0x5'));var cmHopperHistory=require(_0x15af('0x6'));var cmHopperBlack=require(_0x15af('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x15af('0x8'));function loggerCatch(_0x1cda97){return function(_0x56a439){logger[_0x15af('0x9')](_0x1cda97,util['inspect'](_0x56a439,{'showHidden':![],'depth':null}));};}function create(_0x32cd29){return BPromise[_0x15af('0xa')]()[_0x15af('0xb')](cmHopperHistory[_0x15af('0xc')](_0x32cd29))[_0x15af('0xd')](loggerCatch(_0x15af('0xe')));}function createAgent(_0x386c3a){return BPromise[_0x15af('0xa')]()[_0x15af('0xb')](agentReportPreview['createHistory'](_0x386c3a))[_0x15af('0xd')](loggerCatch(_0x15af('0xe')));}function moveContact(_0x89b05a){return BPromise[_0x15af('0xa')]()['then'](cmHopper['moveContactManagedDialer'](_0x89b05a,!![]))['catch'](loggerCatch(_0x15af('0xf')));}exports[_0x15af('0x10')]=function(_0x3ece2b){return BPromise['resolve']()['then'](cmHopperBlack[_0x15af('0x10')](_0x3ece2b))[_0x15af('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x15af('0x11')]=function(_0x54d492){return BPromise['resolve']()[_0x15af('0xb')](cmHopper[_0x15af('0x11')](_0x54d492))[_0x15af('0xd')](loggerCatch(_0x15af('0x12')));};exports['createHistory']=function(_0x3169e0,_0x725408){create(_0x3169e0)[_0x15af('0xd')](loggerCatch(_0x725408));moveContact(_0x3169e0)[_0x15af('0xd')](loggerCatch(_0x725408));};exports[_0x15af('0x13')]=function(_0x41cb25,_0x49889c){createAgent(_0x41cb25)[_0x15af('0xd')](loggerCatch(_0x49889c));};exports[_0x15af('0x14')]=function(_0x2c4f27,_0xcf5f79){create(_0x2c4f27)['catch'](loggerCatch(_0xcf5f79));};exports[_0x15af('0x15')]=function(_0x181e52,_0x1daff4){moveContact(_0x181e52)[_0x15af('0xd')](loggerCatch(_0x1daff4));};exports[_0x15af('0x16')]=function(_0x1ca437,_0xd41620,_0x5704ad){if(_0xd41620){_0x1ca437[_0x15af('0x17')]=null;}if(_0x5704ad){_0x1ca437[_0x15af('0x18')]=![];}return BPromise[_0x15af('0xa')]()[_0x15af('0xb')](cmHopper[_0x15af('0x16')](_0x1ca437))[_0x15af('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x15af('0x19')]=function(_0xe93b6e){return BPromise[_0x15af('0xa')]()[_0x15af('0xb')](cmHopper['countReScheduled'](_0xe93b6e))[_0x15af('0xd')](loggerCatch(_0x15af('0x1a')));};exports['unlockContact']=function(_0x94080a){return BPromise[_0x15af('0xa')]()['then'](cmHopper[_0x15af('0x1b')]({'UserId':null},_0x94080a,0x1))[_0x15af('0xd')](loggerCatch(_0x15af('0x1c')));};exports['disableContact']=function(_0x2cced1){return BPromise['resolve']()[_0x15af('0xb')](cmHopper[_0x15af('0x1b')]({'active':![]},_0x2cced1,0x1))[_0x15af('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0x15af('0x1d')]=function(_0x65250){var _0x8177df={};_0x8177df[_0x15af('0x1e')]=_0x65250[_0x15af('0x1e')];_0x8177df[_0x15af('0x1f')]=_0x65250[_0x15af('0x1f')];_0x8177df['calleridnum']=_0x65250[_0x15af('0x20')];_0x8177df['calleridname']=_0x65250[_0x15af('0x21')];_0x8177df[_0x15af('0x22')]=_0x65250[_0x15af('0x22')];_0x8177df[_0x15af('0x23')]=_0x65250['answertime'];_0x8177df[_0x15af('0x24')]=_0x65250[_0x15af('0x25')];_0x8177df[_0x15af('0x26')]=0x1;_0x8177df[_0x15af('0x27')]=_0x65250[_0x15af('0x28')];_0x8177df['connectedlinename']=_0x65250[_0x15af('0x29')];_0x8177df[_0x15af('0x2a')]=_0x15af('0x2b');_0x8177df['exten']=_0x15af('0x2c');_0x8177df[_0x15af('0x2d')]=0x0;_0x8177df[_0x15af('0x2e')]=0x1;_0x8177df['lastAssignedTo']=_0x65250[_0x15af('0x29')];_0x8177df[_0x15af('0x2f')]='COMPLETED';return BPromise['resolve']()[_0x15af('0xb')](voiceQueueReport[_0x15af('0x30')](_0x8177df))[_0x15af('0xd')](loggerCatch(_0x15af('0x31')));};exports['getContactRecallMe']=function(_0x1e195e,_0x232b45){return BPromise[_0x15af('0xa')]()[_0x15af('0xb')](cmHopper['getContactRecallMe'](_0x1e195e,_0x232b45))[_0x15af('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x15af('0x32')]=function(_0x40287f){return BPromise[_0x15af('0xa')]()[_0x15af('0xb')](cmHopper[_0x15af('0x16')](_0x40287f,!![],!![]))[_0x15af('0xd')](loggerCatch(_0x15af('0x33')));};
\ No newline at end of file
+var _0x8304=['[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','then','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercomplete','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue'];(function(_0x5d3dff,_0x191cbc){var _0x55f60f=function(_0x4d9898){while(--_0x4d9898){_0x5d3dff['push'](_0x5d3dff['shift']());}};_0x55f60f(++_0x191cbc);}(_0x8304,0x71));var _0x4830=function(_0x5255fd,_0x22d092){_0x5255fd=_0x5255fd-0x0;var _0x4ab725=_0x8304[_0x5255fd];return _0x4ab725;};'use strict';var util=require(_0x4830('0x0'));var BPromise=require(_0x4830('0x1'));var logger=require(_0x4830('0x2'))(_0x4830('0x3'));var _=require(_0x4830('0x4'));var cmHopper=require(_0x4830('0x5'));var cmHopperFinal=require(_0x4830('0x6'));var cmHopperHistory=require(_0x4830('0x7'));var cmHopperBlack=require(_0x4830('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x4830('0x9'));var voiceQueueReport=require(_0x4830('0xa'));function loggerCatch(_0x510006){return function(_0x217859){logger[_0x4830('0xb')](_0x510006,util[_0x4830('0xc')](_0x217859,{'showHidden':![],'depth':null}));};}function create(_0x170346){return BPromise['resolve']()['then'](cmHopperHistory[_0x4830('0xd')](_0x170346))[_0x4830('0xe')](loggerCatch(_0x4830('0xf')));}function createAgent(_0x1fe155){return BPromise[_0x4830('0x10')]()[_0x4830('0x11')](agentReportPreview[_0x4830('0xd')](_0x1fe155))['catch'](loggerCatch(_0x4830('0xf')));}function moveContact(_0x5e9bd7){return BPromise[_0x4830('0x10')]()['then'](cmHopper['moveContactManagedDialer'](_0x5e9bd7,!![]))[_0x4830('0xe')](loggerCatch(_0x4830('0x12')));}exports['checkIsBlackList']=function(_0x5d3ebd){return BPromise['resolve']()[_0x4830('0x11')](cmHopperBlack[_0x4830('0x13')](_0x5d3ebd))[_0x4830('0xe')](loggerCatch(_0x4830('0x14')));};exports[_0x4830('0x15')]=function(_0x19ef30){return BPromise[_0x4830('0x10')]()[_0x4830('0x11')](cmHopper['getContactPreview'](_0x19ef30))[_0x4830('0xe')](loggerCatch('[getContactPreview]\x20'));};exports[_0x4830('0xd')]=function(_0xd25111,_0x587d14){create(_0xd25111)[_0x4830('0xe')](loggerCatch(_0x587d14));moveContact(_0xd25111)[_0x4830('0xe')](loggerCatch(_0x587d14));};exports[_0x4830('0x16')]=function(_0x25661c,_0x2bb36f){createAgent(_0x25661c)[_0x4830('0xe')](loggerCatch(_0x2bb36f));};exports[_0x4830('0x17')]=function(_0x1bfd93,_0x1c50a9){create(_0x1bfd93)['catch'](loggerCatch(_0x1c50a9));};exports['createCustomerFinal']=function(_0x218a40,_0x2635dc){moveContact(_0x218a40)[_0x4830('0xe')](loggerCatch(_0x2635dc));};exports[_0x4830('0x18')]=function(_0x139368,_0x2cbc38,_0x539d9b){if(_0x2cbc38){_0x139368[_0x4830('0x19')]=null;}if(_0x539d9b){_0x139368[_0x4830('0x1a')]=![];}return BPromise[_0x4830('0x10')]()['then'](cmHopper[_0x4830('0x18')](_0x139368))['catch'](loggerCatch(_0x4830('0x1b')));};exports[_0x4830('0x1c')]=function(_0x561dc1){return BPromise[_0x4830('0x10')]()[_0x4830('0x11')](cmHopper[_0x4830('0x1c')](_0x561dc1))['catch'](loggerCatch(_0x4830('0x1d')));};exports['unlockContact']=function(_0xaab8bf){return BPromise[_0x4830('0x10')]()[_0x4830('0x11')](cmHopper['unlockContact']({'UserId':null},_0xaab8bf,0x1))[_0x4830('0xe')](loggerCatch(_0x4830('0x1e')));};exports[_0x4830('0x1f')]=function(_0x1c63a2){return BPromise[_0x4830('0x10')]()[_0x4830('0x11')](cmHopper[_0x4830('0x20')]({'active':![]},_0x1c63a2,0x1))[_0x4830('0xe')](loggerCatch(_0x4830('0x21')));};exports[_0x4830('0x22')]=function(_0x20ed00){var _0x2f7ad2={};_0x2f7ad2['type']=_0x20ed00[_0x4830('0x23')];_0x2f7ad2[_0x4830('0x24')]=_0x20ed00[_0x4830('0x24')];_0x2f7ad2[_0x4830('0x25')]=_0x20ed00[_0x4830('0x25')];_0x2f7ad2[_0x4830('0x26')]=_0x20ed00['calleridname'];_0x2f7ad2['queue']=_0x20ed00[_0x4830('0x27')];_0x2f7ad2['queuecallerjoinAt']=_0x20ed00['answertime'];_0x2f7ad2['queuecallerleaveAt']=_0x20ed00[_0x4830('0x28')];_0x2f7ad2[_0x4830('0x29')]=0x1;_0x2f7ad2['queuecallercompleteAt']=_0x20ed00['endtime'];_0x2f7ad2['connectedlinename']=_0x20ed00[_0x4830('0x2a')];_0x2f7ad2[_0x4830('0x2b')]='from-sip';_0x2f7ad2[_0x4830('0x2c')]=_0x4830('0x2d');_0x2f7ad2[_0x4830('0x2e')]=0x0;_0x2f7ad2[_0x4830('0x2f')]=0x1;_0x2f7ad2[_0x4830('0x30')]=_0x20ed00[_0x4830('0x2a')];_0x2f7ad2[_0x4830('0x31')]=_0x4830('0x32');return BPromise['resolve']()['then'](voiceQueueReport[_0x4830('0x33')](_0x2f7ad2))[_0x4830('0xe')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x37d0e6,_0x3135a7){return BPromise['resolve']()[_0x4830('0x11')](cmHopper[_0x4830('0x34')](_0x37d0e6,_0x3135a7))[_0x4830('0xe')](loggerCatch(_0x4830('0x35')));};exports[_0x4830('0x36')]=function(_0x42c829){return BPromise[_0x4830('0x10')]()[_0x4830('0x11')](cmHopper[_0x4830('0x18')](_0x42c829,!![],!![]))[_0x4830('0xe')](loggerCatch(_0x4830('0x37')));};
\ No newline at end of file
index 63b33d9..b99ef7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36d0=['BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','countglobal','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','pow','replace','random','extractCalleridName','match','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','loggerCatch','inspect','loggerError','error','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','responsetime','ringtime','starttime','logLookAgent','membername','answertime','isFailure','Failure','variablesAction','RECALL','calleridname'];(function(_0x552804,_0x3c3d1e){var _0x32be66=function(_0x14c213){while(--_0x14c213){_0x552804['push'](_0x552804['shift']());}};_0x32be66(++_0x3c3d1e);}(_0x36d0,0x1e5));var _0x036d=function(_0x209bb8,_0x20a857){_0x209bb8=_0x209bb8-0x0;var _0x16d006=_0x36d0[_0x209bb8];return _0x16d006;};'use strict';var util=require('util');var _=require(_0x036d('0x0'));var moment=require(_0x036d('0x1'));var logger=require(_0x036d('0x2'))(_0x036d('0x3'));var ipAgi=process['env'][_0x036d('0x4')]||'127.0.0.1';function getSeconds(_0x38c86a,_0x5c8185){var _0x501841=moment(_0x38c86a)['milliseconds'](0x0);var _0x3af17e=moment(_0x5c8185)[_0x036d('0x5')](0x0);return _0x501841[_0x036d('0x6')](_0x3af17e,'seconds');}exports[_0x036d('0x7')]=function(_0xdff3db){return function(_0x3ecbcb){logger['error'](_0xdff3db,util['inspect'](_0x3ecbcb,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0xca5e16,_0x230a2b){logger['info'](_0xca5e16,util[_0x036d('0x8')](_0x230a2b,{'showHidden':![],'depth':null}));};exports[_0x036d('0x9')]=function(_0x5c3791,_0x49690c){logger[_0x036d('0xa')](_0x5c3791,util[_0x036d('0x8')](_0x49690c,{'showHidden':![],'depth':null}));};exports[_0x036d('0xb')]=function(_0x2fe8b8){return function(_0x5c4ae4){logger[_0x036d('0xc')](_0x2fe8b8,util['inspect'](_0x5c4ae4,{'showHidden':![],'depth':null}));};};exports[_0x036d('0xd')]=function(_0x3d763a,_0x115bc4,_0x674070){return{'message':_0x3d763a,'unlock':_0x115bc4,'active':_0x674070};};exports[_0x036d('0xe')]=function(_0x5b9f26,_0x350226,_0x30b32b){if(!_[_0x036d('0xf')](_0x30b32b)&&_0x036d('0x10')===typeof _0x30b32b&&!_[_0x036d('0x11')](_0x30b32b)){if(!_['isUndefined'](_0x350226)&&_0x036d('0x10')===typeof _0x350226&&!_['isEmpty'](_0x350226)){return util[_0x036d('0x12')](_0x036d('0x13'),_0x350226,_0x30b32b);}return util[_0x036d('0x12')]('\x22%s\x22\x20<%s>',_0x30b32b,_0x30b32b);}if(!_[_0x036d('0xf')](_0x5b9f26)&&_0x036d('0x10')===typeof _0x5b9f26&&!_['isEmpty'](_0x5b9f26)){return _0x5b9f26;}return _0x036d('0x14');};exports[_0x036d('0x15')]=function(_0x23df4e){if(_['isNil'](_0x23df4e)){return![];}return _0x23df4e;};exports[_0x036d('0x16')]=function(_0xdaf578,_0x1c9dba,_0x5d822a,_0x46229d,_0x50722e,_0x4e4000){var _0x51e9bf={'XMD-QUEUE':_0x1c9dba[_0x036d('0x17')]?_0x1c9dba[_0x036d('0x17')][_0x036d('0x18')]:'','XMD-CALLERID':_0x46229d,'XMD-CALLERID-PREVIEW':_0x4e4000?util[_0x036d('0x12')](_0x036d('0x13'),_0x4e4000['calleridname'],_0x4e4000['calleridnum']):_0x46229d,'XMD-DIALID':_0x50722e,'XMD-CONTACTID':_0x1c9dba[_0x036d('0x19')],'XMD-CDRTYPE':_0x036d('0x1a'),'CALLERID(all)':_0x46229d,'XMD-VOICEQUEUEID':_0x1c9dba[_0x036d('0x1b')],'XMD-DIALCHANNEL':_0x5d822a,'XMD-DIALTIMEOUT':_0xdaf578[_0x036d('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x036d('0x12')]('\x22rtTxX%s%s\x22',_0xdaf578['dialQueueProject2']?'g':'',_['isEmpty'](_0xdaf578[_0x036d('0x1d')])?'':_0x036d('0x1e')),'XMD-DIALURL':_0xdaf578[_0x036d('0x1f')]||'','XMD-AGI':_0xdaf578[_0x036d('0x20')]?util[_0x036d('0x12')](_0x036d('0x21'),ipAgi,_0xdaf578[_0x036d('0x20')]):_0x036d('0x22'),'XMD-AGIAFTER':_0xdaf578[_0x036d('0x23')]?util[_0x036d('0x12')](_0x036d('0x21'),ipAgi,_0xdaf578[_0x036d('0x23')]):_0x036d('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x4e4000?_0x4e4000[_0x036d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x4e4000?_0x4e4000[_0x036d('0x25')]:'','XMD-DESTINATION':_0x036d('0x26')};if(!_[_0x036d('0x11')](_0xdaf578[_0x036d('0x1d')])){_0x51e9bf[util[_0x036d('0x12')]('%s',_0x036d('0x27'))]=_0xdaf578[_0x036d('0x1d')];_0x51e9bf[util[_0x036d('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x50722e;}if(_0x1c9dba&&_0x1c9dba[_0x036d('0x28')]){for(var _0x15d823 in _0x1c9dba[_0x036d('0x28')]){if(_0x1c9dba[_0x036d('0x28')][_0x036d('0x29')](_0x15d823)){if(!_['isNil'](_0x1c9dba[_0x036d('0x28')][_0x15d823])&&_0x15d823!=='id'&&_0x15d823!==_0x036d('0x2a')&&_0x15d823!==_0x036d('0x2b')&&_0x15d823!==_0x036d('0x2c')){_0x51e9bf[util[_0x036d('0x12')](_0x036d('0x2d'),_0x036d('0x2e'),_['toUpper'](_0x15d823))]=_0x1c9dba[_0x036d('0x28')][_0x15d823];}}}}return _0x51e9bf;};exports['toLowerVariables']=function(_0x176135){var _0x34a85c={};for(var _0x5da34b in _0x176135){if(_0x176135[_0x036d('0x29')](_0x5da34b)){_0x34a85c[util[_0x036d('0x12')]('%s',_[_0x036d('0x2f')](_0x5da34b))]=_0x176135[_0x5da34b];}}return{'variables':_0x34a85c};};exports[_0x036d('0x30')]=function(_0x586785,_0x52f63f){if(!_[_0x036d('0x31')](_0x586785)){if(_0x586785[_0x036d('0x29')](_0x036d('0x32'))){if(_0x586785[_0x036d('0x32')]>0x0){_0x586785[_0x036d('0x32')]-=0x1;}else{logger['error'](_0x036d('0x33'),_0x52f63f);}}}else{logger['error'](_0x036d('0x34'),_0x52f63f);}};exports[_0x036d('0x35')]=function(_0x2830f8){var _0x1bb4bf=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2830f8['state']=0xd;_0x2830f8[_0x036d('0x36')]=_0x036d('0x37');_0x2830f8['starttime']=_0x1bb4bf;_0x2830f8['responsetime']=_0x1bb4bf;_0x2830f8[_0x036d('0x38')]=_0x1bb4bf;};exports[_0x036d('0x39')]=function(_0x53cbbf,_0x199411,_0x2f1db0){var _0x202a64=moment()['format'](_0x036d('0x3a'));_0x53cbbf[_0x036d('0x3b')]=_0x199411;_0x53cbbf[_0x036d('0x36')]=_0x2f1db0;_0x53cbbf[_0x036d('0x3c')]=_0x202a64;_0x53cbbf[_0x036d('0x3d')]=getSeconds(_0x53cbbf[_0x036d('0x3c')],_0x53cbbf[_0x036d('0x3e')]);};exports[_0x036d('0x3f')]=function(_0x4ac178,_0x347d06,_0x2bd5e7){_0x4ac178[_0x036d('0x40')]=_0x347d06;_0x4ac178['UserId']=_0x2bd5e7;};exports['logCustomer']=function(_0x2ceb49,_0xd189a6,_0x1d5eaf){var _0x384783=moment()[_0x036d('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ceb49[_0x036d('0x3b')]=_0xd189a6;_0x2ceb49[_0x036d('0x36')]=_0x1d5eaf;_0x2ceb49['responsetime']=_0x2ceb49[_0x036d('0x3c')]?_0x2ceb49['responsetime']:_0x384783;_0x2ceb49['endtime']=_0x2ceb49[_0x036d('0x38')]?_0x2ceb49[_0x036d('0x38')]:_0x384783;_0x2ceb49[_0x036d('0x3d')]=getSeconds(_0x2ceb49[_0x036d('0x3c')]||0x0,_0x2ceb49[_0x036d('0x3e')]||0x0);_0x2ceb49['talktime']=_0x2ceb49[_0x036d('0x41')]?getSeconds(_0x2ceb49[_0x036d('0x38')],_0x2ceb49['answertime']):0x0;};exports[_0x036d('0x42')]=function(_0x53dd2a){return _0x53dd2a===_0x036d('0x43');};exports[_0x036d('0x44')]=function(_0x47e6d6,_0x210b3e,_0x4ebe3c,_0x581ab4,_0x5dd4f8){var _0x52be55=_0x581ab4?_0x036d('0x45'):_0x47e6d6[_0x036d('0x46')];_0x52be55=_0x5dd4f8?_0x036d('0x47'):_0x52be55;return{'actionid':_0x47e6d6[_0x036d('0x48')],'action':_0x036d('0x49'),'channel':_0x47e6d6[_0x036d('0x4a')],'callerid':util[_0x036d('0x12')](_0x036d('0x13'),_0x52be55,_0x47e6d6[_0x036d('0x4b')]),'Exten':_0x036d('0x26'),'Context':_0x036d('0x4c'),'Priority':'1','variable':_0x4ebe3c,'timeout':(_0x210b3e[_0x036d('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x47e6d6[_0x036d('0x48')]};};exports[_0x036d('0x4e')]=function(_0x41db85){return _0x41db85[_0x036d('0x4f')]+_0x41db85[_0x036d('0x50')]+_0x41db85[_0x036d('0x51')];};exports[_0x036d('0x52')]=function(_0x3c6dae){var _0x2fd483=_[_0x036d('0x53')](_0x3c6dae);_0x2fd483[_0x036d('0x3b')]=0xf;_0x2fd483[_0x036d('0x36')]=_0x036d('0x54');return _0x2fd483;};exports[_0x036d('0x55')]=function(_0x5da008,_0x284cd8,_0x362aac){var _0x37f86a={};_0x37f86a[_0x284cd8]=_0x5da008[_0x284cd8];_0x37f86a[_0x036d('0x56')]=![];_0x37f86a[_0x036d('0x57')]=moment()[_0x036d('0x58')](_0x362aac,_0x036d('0x59'))[_0x036d('0x12')](_0x036d('0x3a'));_0x37f86a['ContactId']=_0x5da008[_0x036d('0x19')];_0x37f86a[_0x036d('0x5a')]=_0x5da008[_0x036d('0x5a')];_0x37f86a[_0x036d('0x1b')]=_0x5da008[_0x036d('0x1b')]||undefined;return _0x37f86a;};exports[_0x036d('0x5b')]=function(_0x1f019a,_0x3448b5){if(!_[_0x036d('0x31')](_0x1f019a)){if(_0x1f019a[_0x036d('0x5c')]>0x0){_0x1f019a[_0x036d('0x5c')]-=0x1;}else{logger['error'](_0x3448b5,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x036d('0xa')](_0x3448b5,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x036d('0x5d')]=function(_0x13da80){if(_0x13da80<=0x0){return!![];}return![];};exports[_0x036d('0x5e')]=function(_0x90c9bf,_0x251e00){_0x90c9bf[_0x036d('0x5f')]=_0x251e00;_0x90c9bf['name']=_0x90c9bf[_0x036d('0x60')];_0x90c9bf[_0x036d('0x61')]=_0x90c9bf[_0x036d('0x4a')];return _0x90c9bf;};exports[_0x036d('0x62')]=function(_0x5bf683){var _0x261556={};_0x261556[_0x036d('0x60')]=_0x5bf683[_0x036d('0x60')];_0x261556[_0x036d('0x61')]=_0x5bf683[_0x036d('0x4a')];_0x261556[_0x036d('0x48')]=_0x5bf683['uniqueid'];return _0x261556;};exports[_0x036d('0x63')]=function(_0x131721){var _0xeeae8e=[];for(var _0x250d23 in _0x131721){if(_0x131721[_0x036d('0x29')](_0x250d23)){if(!_[_0x036d('0x31')](_0x131721[_0x250d23])&&_0x131721[_0x250d23]['state']==='not_inuse'&&_0x131721[_0x250d23][_0x036d('0x64')]===_0x036d('0x65')){_0xeeae8e[_0x036d('0x66')](_0x131721[_0x250d23]['id']);}}}return _0xeeae8e;};exports[_0x036d('0x67')]=function(_0x55a874){var _0xcc4410=moment()[_0x036d('0x5')](0x0);var _0x12adb6=moment(_0x55a874)[_0x036d('0x5')](0x0);return _0xcc4410['diff'](_0x12adb6,_0x036d('0x68'));};exports[_0x036d('0x69')]=function(_0x13fda4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x13fda4['ContactId'],'ListId':_0x13fda4[_0x036d('0x5a')],'VoiceQueueId':_0x13fda4[_0x036d('0x1b')]||undefined,'CampaignId':_0x13fda4[_0x036d('0x6a')]||undefined};};exports[_0x036d('0x6b')]=function(_0x29400c){if(_0x29400c===_0x036d('0x48')||_0x29400c===_0x036d('0x6c')||_0x29400c===_0x036d('0x60')||_0x29400c===_0x036d('0x6d')||_0x29400c===_0x036d('0x6e')||_0x29400c==='dialAnswer'||_0x29400c==='membername'||_0x29400c===_0x036d('0x4a')||_0x29400c===_0x036d('0x46')||_0x29400c===_0x036d('0x56')||_0x29400c==='calleridnum'||_0x29400c===_0x036d('0x57')||_0x29400c==='countbusyretry'||_0x29400c===_0x036d('0x50')||_0x29400c===_0x036d('0x51')||_0x29400c===_0x036d('0x6f')||_0x29400c===_0x036d('0x70')||_0x29400c===_0x036d('0x71')||_0x29400c==='callbackat'||_0x29400c===_0x036d('0x72')||_0x29400c==='ContactId'||_0x29400c===_0x036d('0x5a')||_0x29400c===_0x036d('0x73')||_0x29400c==='VoiceQueueId'||_0x29400c===_0x036d('0x74')||_0x29400c===_0x036d('0x75')||_0x29400c==='xmd-queue'||_0x29400c==='xmd-phone'||_0x29400c==='xmd-listid'||_0x29400c===_0x036d('0x76')||_0x29400c==='xmd-dialtimeout'||_0x29400c==='xmd-dialoptions'||_0x29400c===_0x036d('0x77')||_0x29400c===_0x036d('0x78')||_0x29400c===_0x036d('0x79')||_0x29400c===_0x036d('0x7a')||_0x29400c==='xmd-callerid'||_0x29400c==='xmd-agiafter'||_0x29400c===_0x036d('0x7b')||_0x29400c===_0x036d('0x7c')||_0x29400c==='rtpaudioqosbridged'||_0x29400c===_0x036d('0x7d')||_0x29400c===_0x036d('0x7e')||_0x29400c===_0x036d('0x7f')||_0x29400c===_0x036d('0x80')||_0x29400c===_0x036d('0x81')||_0x29400c==='rtpaudioqosrttbridged'||_0x29400c===_0x036d('0x7c')||_0x29400c===_0x036d('0x82')||_0x29400c==='rtpaudioqosjitter'||_0x29400c===_0x036d('0x7e')||_0x29400c===_0x036d('0x7f')||_0x29400c===_0x036d('0x80')||_0x29400c===_0x036d('0x81')||_0x29400c===_0x036d('0x83')||_0x29400c===_0x036d('0x84')||_0x29400c===_0x036d('0x85')||_0x29400c==='state'||_0x29400c==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0xdb96f8,_0x3958fb){var _0x428ea9,_0xf34e0,_0x45a6b9;if(_0x3958fb<=0x0){_0x3958fb=0x1;}_0x428ea9=new RegExp('\x5cw{0,'+_0x3958fb+'}$');_0xf34e0=Math[_0x036d('0x86')](0xa,_0x3958fb-0x1);_0x45a6b9=Math[_0x036d('0x86')](0xa,_0x3958fb)-0x1;return util['format']('%s',_[_0x036d('0x87')](_0xdb96f8,_0x428ea9,_[_0x036d('0x88')](_0xf34e0,_0x45a6b9)));};exports[_0x036d('0x89')]=function(_0x2fe4f8){var _0x31890d=_0x2fe4f8[_0x036d('0x8a')](/"(.*?)"/);return _0x31890d?_0x31890d[0x1]:_0x2fe4f8;};exports['extractCalleridNumber']=function(_0x24f945){var _0xa08e33=_0x24f945[_0x036d('0x8a')](/<(.*?)>/);return _0xa08e33?_0xa08e33[0x1]:_0x24f945;};
\ No newline at end of file
+var _0xe504=['milliseconds','seconds','loggerCatch','info','loggerError','error','inspect','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','Blacklist','starttime','responsetime','logAgent','statedesc','logLookAgent','membername','UserId','YYYY-MM-DD\x20HH:mm:ss','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','channelAgent','calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countcongestionretry','cloneAction','clone','scheduledAt','active','scheduledat','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','buildAcw','queue','agentReadyId','not_inuse','status','reachable','push','diff','idContact','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','127.0.0.1'];(function(_0x433774,_0x399331){var _0x34900a=function(_0x4188a5){while(--_0x4188a5){_0x433774['push'](_0x433774['shift']());}};_0x34900a(++_0x399331);}(_0xe504,0x189));var _0x4e50=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe504[_0x4565bf];return _0x5610ba;};'use strict';var util=require(_0x4e50('0x0'));var _=require(_0x4e50('0x1'));var moment=require(_0x4e50('0x2'));var logger=require(_0x4e50('0x3'))(_0x4e50('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x4e50('0x5');function getSeconds(_0x3ceb52,_0x4dc101){var _0x136878=moment(_0x3ceb52)[_0x4e50('0x6')](0x0);var _0x4bd442=moment(_0x4dc101)[_0x4e50('0x6')](0x0);return _0x136878['diff'](_0x4bd442,_0x4e50('0x7'));}exports[_0x4e50('0x8')]=function(_0x54bafc){return function(_0x514039){logger['error'](_0x54bafc,util['inspect'](_0x514039,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x159bc3,_0x556d2b){logger[_0x4e50('0x9')](_0x159bc3,util['inspect'](_0x556d2b,{'showHidden':![],'depth':null}));};exports[_0x4e50('0xa')]=function(_0x329b2c,_0x361200){logger[_0x4e50('0xb')](_0x329b2c,util[_0x4e50('0xc')](_0x361200,{'showHidden':![],'depth':null}));};exports[_0x4e50('0xd')]=function(_0x17dcb7){return function(_0x2893c1){logger['info'](_0x17dcb7,util['inspect'](_0x2893c1,{'showHidden':![],'depth':null}));};};exports[_0x4e50('0xe')]=function(_0x58d876,_0x10642e,_0x5c654b){return{'message':_0x58d876,'unlock':_0x10642e,'active':_0x5c654b};};exports[_0x4e50('0xf')]=function(_0x29f2ba,_0x446559,_0x2cdca3){if(!_['isUndefined'](_0x2cdca3)&&_0x4e50('0x10')===typeof _0x2cdca3&&!_[_0x4e50('0x11')](_0x2cdca3)){if(!_[_0x4e50('0x12')](_0x446559)&&_0x4e50('0x10')===typeof _0x446559&&!_['isEmpty'](_0x446559)){return util[_0x4e50('0x13')](_0x4e50('0x14'),_0x446559,_0x2cdca3);}return util[_0x4e50('0x13')](_0x4e50('0x14'),_0x2cdca3,_0x2cdca3);}if(!_[_0x4e50('0x12')](_0x29f2ba)&&_0x4e50('0x10')===typeof _0x29f2ba&&!_[_0x4e50('0x11')](_0x29f2ba)){return _0x29f2ba;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x5325f3){if(_[_0x4e50('0x15')](_0x5325f3)){return![];}return _0x5325f3;};exports[_0x4e50('0x16')]=function(_0x5bee1e,_0x53ed34,_0x34def8,_0x1ef785,_0x2bbc3f,_0x1bd6d9){var _0x548555={'XMD-QUEUE':_0x53ed34[_0x4e50('0x17')]?_0x53ed34[_0x4e50('0x17')][_0x4e50('0x18')]:'','XMD-CALLERID':_0x1ef785,'XMD-CALLERID-PREVIEW':_0x1bd6d9?util[_0x4e50('0x13')](_0x4e50('0x14'),_0x1bd6d9[_0x4e50('0x19')],_0x1bd6d9['calleridnum']):_0x1ef785,'XMD-DIALID':_0x2bbc3f,'XMD-CONTACTID':_0x53ed34[_0x4e50('0x1a')],'XMD-CDRTYPE':_0x4e50('0x1b'),'CALLERID(all)':_0x1ef785,'XMD-VOICEQUEUEID':_0x53ed34[_0x4e50('0x1c')],'XMD-DIALCHANNEL':_0x34def8,'XMD-DIALTIMEOUT':_0x5bee1e[_0x4e50('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x4e50('0x1e'),_0x5bee1e[_0x4e50('0x1f')]?'g':'',_['isEmpty'](_0x5bee1e[_0x4e50('0x20')])?'':_0x4e50('0x21')),'XMD-DIALURL':_0x5bee1e[_0x4e50('0x22')]||'','XMD-AGI':_0x5bee1e[_0x4e50('0x23')]?util[_0x4e50('0x13')](_0x4e50('0x24'),ipAgi,_0x5bee1e[_0x4e50('0x23')]):_0x4e50('0x25'),'XMD-AGIAFTER':_0x5bee1e[_0x4e50('0x1f')]?util[_0x4e50('0x13')](_0x4e50('0x24'),ipAgi,_0x5bee1e['dialQueueProject2']):_0x4e50('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x1bd6d9?_0x1bd6d9['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1bd6d9?_0x1bd6d9[_0x4e50('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x5bee1e[_0x4e50('0x20')])){_0x548555[util['format']('%s',_0x4e50('0x27'))]=_0x5bee1e[_0x4e50('0x20')];_0x548555[util[_0x4e50('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2bbc3f;}if(_0x53ed34&&_0x53ed34[_0x4e50('0x28')]){for(var _0x543336 in _0x53ed34[_0x4e50('0x28')]){if(_0x53ed34[_0x4e50('0x28')][_0x4e50('0x29')](_0x543336)){if(!_[_0x4e50('0x15')](_0x53ed34['Contact'][_0x543336])&&_0x543336!=='id'&&_0x543336!=='tags'&&_0x543336!=='createdAt'&&_0x543336!==_0x4e50('0x2a')){_0x548555[util[_0x4e50('0x13')](_0x4e50('0x2b'),_0x4e50('0x2c'),_['toUpper'](_0x543336))]=_0x53ed34[_0x4e50('0x28')][_0x543336];}}}}return _0x548555;};exports[_0x4e50('0x2d')]=function(_0x5b0f34){var _0x11427b={};for(var _0x52ee7c in _0x5b0f34){if(_0x5b0f34[_0x4e50('0x29')](_0x52ee7c)){_0x11427b[util[_0x4e50('0x13')]('%s',_[_0x4e50('0x2e')](_0x52ee7c))]=_0x5b0f34[_0x52ee7c];}}return{'variables':_0x11427b};};exports[_0x4e50('0x2f')]=function(_0x9962ff,_0x5e6de9){if(!_[_0x4e50('0x15')](_0x9962ff)){if(_0x9962ff[_0x4e50('0x29')](_0x4e50('0x30'))){if(_0x9962ff['originated']>0x0){_0x9962ff[_0x4e50('0x30')]-=0x1;}else{logger[_0x4e50('0xb')](_0x4e50('0x31'),_0x5e6de9);}}}else{logger[_0x4e50('0xb')](_0x4e50('0x32'),_0x5e6de9);}};exports[_0x4e50('0x33')]=function(_0x51f3af){var _0x2ae328=moment()[_0x4e50('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x51f3af[_0x4e50('0x34')]=0xd;_0x51f3af['statedesc']=_0x4e50('0x35');_0x51f3af[_0x4e50('0x36')]=_0x2ae328;_0x51f3af[_0x4e50('0x37')]=_0x2ae328;_0x51f3af['endtime']=_0x2ae328;};exports[_0x4e50('0x38')]=function(_0x45a5a1,_0x38f9a0,_0x250aa5){var _0x1d3a85=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x45a5a1[_0x4e50('0x34')]=_0x38f9a0;_0x45a5a1[_0x4e50('0x39')]=_0x250aa5;_0x45a5a1[_0x4e50('0x37')]=_0x1d3a85;_0x45a5a1['ringtime']=getSeconds(_0x45a5a1[_0x4e50('0x37')],_0x45a5a1[_0x4e50('0x36')]);};exports[_0x4e50('0x3a')]=function(_0x9f48cb,_0x96081a,_0x305fa9){_0x9f48cb[_0x4e50('0x3b')]=_0x96081a;_0x9f48cb[_0x4e50('0x3c')]=_0x305fa9;};exports['logCustomer']=function(_0x190e76,_0x5acd20,_0x4e5b34){var _0x618821=moment()[_0x4e50('0x13')](_0x4e50('0x3d'));_0x190e76[_0x4e50('0x34')]=_0x5acd20;_0x190e76[_0x4e50('0x39')]=_0x4e5b34;_0x190e76['responsetime']=_0x190e76[_0x4e50('0x37')]?_0x190e76[_0x4e50('0x37')]:_0x618821;_0x190e76[_0x4e50('0x3e')]=_0x190e76['endtime']?_0x190e76['endtime']:_0x618821;_0x190e76['ringtime']=getSeconds(_0x190e76['responsetime']||0x0,_0x190e76['starttime']||0x0);_0x190e76[_0x4e50('0x3f')]=_0x190e76['answertime']?getSeconds(_0x190e76[_0x4e50('0x3e')],_0x190e76[_0x4e50('0x40')]):0x0;};exports[_0x4e50('0x41')]=function(_0x125fd6){return _0x125fd6===_0x4e50('0x42');};exports[_0x4e50('0x43')]=function(_0x2d3098,_0x3565d2,_0xd617f3,_0x41ff08,_0xc033b8){var _0x3f8119=_0x41ff08?_0x4e50('0x44'):_0x2d3098[_0x4e50('0x19')];_0x3f8119=_0xc033b8?'BOOKED':_0x3f8119;return{'actionid':_0x2d3098[_0x4e50('0x45')],'action':'originate','channel':_0x2d3098[_0x4e50('0x46')],'callerid':util[_0x4e50('0x13')](_0x4e50('0x14'),_0x3f8119,_0x2d3098[_0x4e50('0x47')]),'Exten':_0x4e50('0x48'),'Context':_0x4e50('0x49'),'Priority':'1','variable':_0xd617f3,'timeout':(_0x3565d2[_0x4e50('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2d3098[_0x4e50('0x45')]};};exports[_0x4e50('0x4b')]=function(_0x2ab118){return _0x2ab118['countbusyretry']+_0x2ab118[_0x4e50('0x4c')]+_0x2ab118['countnoanswerretry'];};exports[_0x4e50('0x4d')]=function(_0x18e8f9){var _0x420f1e=_[_0x4e50('0x4e')](_0x18e8f9);_0x420f1e[_0x4e50('0x34')]=0xf;_0x420f1e[_0x4e50('0x39')]='Global';return _0x420f1e;};exports[_0x4e50('0x4f')]=function(_0x23334c,_0x5c535d,_0x21efd0){var _0x324932={};_0x324932[_0x5c535d]=_0x23334c[_0x5c535d];_0x324932[_0x4e50('0x50')]=![];_0x324932[_0x4e50('0x51')]=moment()[_0x4e50('0x52')](_0x21efd0,'minutes')[_0x4e50('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x324932[_0x4e50('0x1a')]=_0x23334c['ContactId'];_0x324932['ListId']=_0x23334c[_0x4e50('0x53')];_0x324932[_0x4e50('0x1c')]=_0x23334c['VoiceQueueId']||undefined;return _0x324932;};exports['decrementTalkink']=function(_0x4b93a0,_0x30bd1c){if(!_[_0x4e50('0x15')](_0x4b93a0)){if(_0x4b93a0[_0x4e50('0x54')]>0x0){_0x4b93a0['pTalking']-=0x1;}else{logger['error'](_0x30bd1c,_0x4e50('0x55'));}}else{logger[_0x4e50('0xb')](_0x30bd1c,_0x4e50('0x56'));}};exports[_0x4e50('0x57')]=function(_0x1ede08){if(_0x1ede08<=0x0){return!![];}return![];};exports[_0x4e50('0x58')]=function(_0x479526,_0x45b796){_0x479526['lastevent']=_0x45b796;_0x479526[_0x4e50('0x18')]=_0x479526['queue'];_0x479526['interface']=_0x479526[_0x4e50('0x46')];return _0x479526;};exports[_0x4e50('0x59')]=function(_0x253634){var _0x5c0ce1={};_0x5c0ce1[_0x4e50('0x5a')]=_0x253634[_0x4e50('0x5a')];_0x5c0ce1['interface']=_0x253634['channelAgent'];_0x5c0ce1[_0x4e50('0x45')]=_0x253634[_0x4e50('0x45')];return _0x5c0ce1;};exports[_0x4e50('0x5b')]=function(_0x5356af){var _0x1aa052=[];for(var _0x4b38c9 in _0x5356af){if(_0x5356af[_0x4e50('0x29')](_0x4b38c9)){if(!_['isNil'](_0x5356af[_0x4b38c9])&&_0x5356af[_0x4b38c9]['state']===_0x4e50('0x5c')&&_0x5356af[_0x4b38c9][_0x4e50('0x5d')]===_0x4e50('0x5e')){_0x1aa052[_0x4e50('0x5f')](_0x5356af[_0x4b38c9]['id']);}}}return _0x1aa052;};exports['getDiff']=function(_0x4ff49a){var _0xcf1a61=moment()['milliseconds'](0x0);var _0x323d06=moment(_0x4ff49a)[_0x4e50('0x6')](0x0);return _0xcf1a61[_0x4e50('0x60')](_0x323d06,'seconds');};exports['createBody']=function(_0x5145f0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5145f0[_0x4e50('0x1a')],'ListId':_0x5145f0[_0x4e50('0x53')],'VoiceQueueId':_0x5145f0[_0x4e50('0x1c')]||undefined,'CampaignId':_0x5145f0['CampaignId']||undefined};};exports['filterKey']=function(_0x19469e){if(_0x19469e===_0x4e50('0x45')||_0x19469e===_0x4e50('0x61')||_0x19469e===_0x4e50('0x5a')||_0x19469e==='type'||_0x19469e===_0x4e50('0x62')||_0x19469e===_0x4e50('0x63')||_0x19469e==='membername'||_0x19469e===_0x4e50('0x46')||_0x19469e===_0x4e50('0x19')||_0x19469e===_0x4e50('0x50')||_0x19469e===_0x4e50('0x47')||_0x19469e===_0x4e50('0x51')||_0x19469e==='countbusyretry'||_0x19469e===_0x4e50('0x4c')||_0x19469e===_0x4e50('0x64')||_0x19469e===_0x4e50('0x65')||_0x19469e===_0x4e50('0x66')||_0x19469e==='callbackuniqueid'||_0x19469e===_0x4e50('0x67')||_0x19469e===_0x4e50('0x68')||_0x19469e===_0x4e50('0x1a')||_0x19469e==='ListId'||_0x19469e===_0x4e50('0x3c')||_0x19469e===_0x4e50('0x1c')||_0x19469e==='sipcallid'||_0x19469e===_0x4e50('0x69')||_0x19469e===_0x4e50('0x6a')||_0x19469e===_0x4e50('0x6b')||_0x19469e===_0x4e50('0x6c')||_0x19469e===_0x4e50('0x6d')||_0x19469e===_0x4e50('0x6e')||_0x19469e===_0x4e50('0x6f')||_0x19469e==='xmd-dialid'||_0x19469e===_0x4e50('0x70')||_0x19469e===_0x4e50('0x71')||_0x19469e===_0x4e50('0x72')||_0x19469e===_0x4e50('0x73')||_0x19469e===_0x4e50('0x74')||_0x19469e===_0x4e50('0x75')||_0x19469e==='rtpaudioqos'||_0x19469e===_0x4e50('0x76')||_0x19469e==='rtpaudioqosjitter'||_0x19469e===_0x4e50('0x77')||_0x19469e===_0x4e50('0x78')||_0x19469e===_0x4e50('0x79')||_0x19469e===_0x4e50('0x7a')||_0x19469e===_0x4e50('0x7b')||_0x19469e===_0x4e50('0x7c')||_0x19469e===_0x4e50('0x76')||_0x19469e==='rtpaudioqosjitter'||_0x19469e===_0x4e50('0x77')||_0x19469e===_0x4e50('0x78')||_0x19469e===_0x4e50('0x79')||_0x19469e===_0x4e50('0x7a')||_0x19469e===_0x4e50('0x7b')||_0x19469e===_0x4e50('0x7d')||_0x19469e===_0x4e50('0x7e')||_0x19469e==='state'||_0x19469e===_0x4e50('0x39')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5a25cc,_0x3ffcd6){var _0x49ce81,_0x13cfe0,_0x38214e;if(_0x3ffcd6<=0x0){_0x3ffcd6=0x1;}_0x49ce81=new RegExp(_0x4e50('0x7f')+_0x3ffcd6+'}$');_0x13cfe0=Math['pow'](0xa,_0x3ffcd6-0x1);_0x38214e=Math[_0x4e50('0x80')](0xa,_0x3ffcd6)-0x1;return util[_0x4e50('0x13')]('%s',_[_0x4e50('0x81')](_0x5a25cc,_0x49ce81,_[_0x4e50('0x82')](_0x13cfe0,_0x38214e)));};exports[_0x4e50('0x83')]=function(_0x1cb734){var _0x4859c0=_0x1cb734[_0x4e50('0x84')](/"(.*?)"/);return _0x4859c0?_0x4859c0[0x1]:_0x1cb734;};exports['extractCalleridNumber']=function(_0x1727a7){var _0x924a10=_0x1727a7[_0x4e50('0x84')](/<(.*?)>/);return _0x924a10?_0x924a10[0x1]:_0x1727a7;};
\ No newline at end of file
index 1ab5a4f..59a2f6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd50=['number','boolean','queueremove','reload','voicequeuechannel','voicequeuechannelredirect','queueadd','string'];(function(_0x3b4437,_0x133f45){var _0x4dc61a=function(_0x33b217){while(--_0x33b217){_0x3b4437['push'](_0x3b4437['shift']());}};_0x4dc61a(++_0x133f45);}(_0xbd50,0x196));var _0x0bd5=function(_0x39b8d,_0x56d0b9){_0x39b8d=_0x39b8d-0x0;var _0x1e56bc=_0xbd50[_0x39b8d];return _0x1e56bc;};'use strict';exports[_0x0bd5('0x0')]={'queue':{'type':_0x0bd5('0x1'),'required':!![]},'interface':{'type':_0x0bd5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x0bd5('0x2'),'required':![]},'paused':{'type':_0x0bd5('0x3'),'required':![]}};exports[_0x0bd5('0x4')]={'queue':{'type':_0x0bd5('0x1'),'required':!![]},'interface':{'type':_0x0bd5('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x0bd5('0x1'),'required':![]}};exports[_0x0bd5('0x5')]={'module':{'type':_0x0bd5('0x1'),'required':![]}};exports[_0x0bd5('0x6')]={'uniqueid':{'type':_0x0bd5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x0bd5('0x1')},'format':{'type':_0x0bd5('0x1')},'mixmonitorid':{'type':_0x0bd5('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x0bd5('0x1'),'required':!![]}};exports[_0x0bd5('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x0bd5('0x1'),'required':!![]},'context':{'type':_0x0bd5('0x1')}};
\ No newline at end of file
+var _0x885a=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','queueremove','queuepause','boolean','reload'];(function(_0x50bf71,_0x125b7c){var _0x77c6bf=function(_0x22d659){while(--_0x22d659){_0x50bf71['push'](_0x50bf71['shift']());}};_0x77c6bf(++_0x125b7c);}(_0x885a,0x180));var _0xa885=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x885a[_0x2c91e9];return _0x13f0ff;};'use strict';exports['queueadd']={'queue':{'type':_0xa885('0x0'),'required':!![]},'interface':{'type':_0xa885('0x0'),'required':!![]},'membername':{'type':_0xa885('0x0'),'required':!![]},'penalty':{'type':_0xa885('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xa885('0x2')]={'queue':{'type':_0xa885('0x0'),'required':!![]},'interface':{'type':_0xa885('0x0'),'required':!![]}};exports[_0xa885('0x3')]={'interface':{'type':_0xa885('0x0'),'required':!![]},'paused':{'type':_0xa885('0x4')},'reason':{'type':'string','required':![]}};exports[_0xa885('0x5')]={'module':{'type':_0xa885('0x0'),'required':![]}};exports[_0xa885('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xa885('0x7')]={'uniqueid':{'type':_0xa885('0x0'),'required':!![]},'filename':{'type':_0xa885('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0xa885('0x0')}};exports[_0xa885('0x8')]={'uniqueid':{'type':_0xa885('0x0'),'required':!![]}};exports[_0xa885('0x9')]={'uniqueid':{'type':_0xa885('0x0'),'required':!![]},'exten':{'type':_0xa885('0x0'),'required':!![]},'context':{'type':_0xa885('0x0')}};
\ No newline at end of file
index 72e9f93..9f803ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd14f=['outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','initTrunks','length','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initVoiceQueueHopperHistory','merge','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallerleaveAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay'];(function(_0x6810d0,_0x4565c3){var _0x568796=function(_0x20bb42){while(--_0x20bb42){_0x6810d0['push'](_0x6810d0['shift']());}};_0x568796(++_0x4565c3);}(_0xd14f,0x104));var _0xfd14=function(_0x3f15d1,_0x1e8587){_0x3f15d1=_0x3f15d1-0x0;var _0x596831=_0xd14f[_0x3f15d1];return _0x596831;};'use strict';var BPromise=require(_0xfd14('0x0'));var util=require(_0xfd14('0x1'));var _=require(_0xfd14('0x2'));var moment=require('moment');var Agent=require(_0xfd14('0x3'));var Telephone=require(_0xfd14('0x4'));var Trunk=require(_0xfd14('0x5'));var VoiceQueue=require(_0xfd14('0x6'));var Trigger=require(_0xfd14('0x7'));var Template=require(_0xfd14('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xfd14('0x9'));var ZendeskAccount=require(_0xfd14('0xa'));var SalesforceAccount=require(_0xfd14('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xfd14('0xc'));var ZohoAccount=require(_0xfd14('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xfd14('0xe'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xfd14('0xf')]={};this[_0xfd14('0x10')]={};this[_0xfd14('0x11')]={};this[_0xfd14('0x12')]={};this[_0xfd14('0x13')]={};this['campaigns']={};this[_0xfd14('0x14')]={};this[_0xfd14('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xfd14('0x16')]={};this[_0xfd14('0x17')]={};this[_0xfd14('0x18')]={};this[_0xfd14('0x19')]={};this[_0xfd14('0x1a')]={};this[_0xfd14('0x1b')]={};this[_0xfd14('0x1c')]={};this[_0xfd14('0x1d')]={};this['zohoAccounts']={};this[_0xfd14('0x1e')]={};this['vtigerAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x45bbe8,_0x577b3e,_0x43762a){var _0x4cc0ae=_[_0xfd14('0x1f')](_0x45bbe8,function(_0x16de7a,_0x113c7e){return _0x16de7a[_0x43762a];});for(var _0xeee1e2 in _0x577b3e){if(_0x577b3e['hasOwnProperty'](_0xeee1e2)){if(!_0x4cc0ae[_0xeee1e2]){delete _0x577b3e[_0xeee1e2];}}}}function freeIsNotKeySip(_0x25b344,_0x2acd83){var _0xe87097=_['mapKeys'](_0x25b344,function(_0x383e86,_0x82d87c){return util[_0xfd14('0x20')](_0xfd14('0x21'),_0x383e86['name']);});for(var _0x1af027 in _0x2acd83){if(_0x2acd83[_0xfd14('0x22')](_0x1af027)){if(!_0xe87097[_0x1af027]){delete _0x2acd83[_0x1af027];}}}}function freeIsNotKeyAgent(_0x3c1f9d,_0x2018bf){var _0xa7e99=_['mapKeys'](_0x3c1f9d,function(_0x30b9bf,_0x472573){var _0x41fcfd=_[_0xfd14('0x23')](_0x30b9bf[_0xfd14('0x24')])?util[_0xfd14('0x20')](_0xfd14('0x21'),_0x30b9bf[_0xfd14('0x25')]):_0x30b9bf[_0xfd14('0x24')];return _0x41fcfd;});for(var _0x379164 in _0x2018bf){if(_0x2018bf[_0xfd14('0x22')](_0x379164)){if(!_0xa7e99[_0x379164]){delete _0x2018bf[_0x379164];}}}}function clearVoiceCallReports(_0x61c91e){_0x61c91e[_0xfd14('0x26')]=0x0;_0x61c91e[_0xfd14('0x27')]=0x0;_0x61c91e[_0xfd14('0x28')]=0x0;_0x61c91e[_0xfd14('0x29')]=0x0;_0x61c91e[_0xfd14('0x2a')]=0x0;}function clearCampaigns(_0x3ce8c7){if(!_[_0xfd14('0x2b')](_0x3ce8c7)){for(var _0xbc7f9b in _0x3ce8c7){if(_0x3ce8c7[_0xfd14('0x22')](_0xbc7f9b)){_0x3ce8c7[_0xbc7f9b][_0xfd14('0x2c')]=0x0;_0x3ce8c7[_0xbc7f9b]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2f61b3){if(!_[_0xfd14('0x2b')](_0x2f61b3)){for(var _0x8bd041 in _0x2f61b3){if(_0x2f61b3[_0xfd14('0x22')](_0x8bd041)){_0x2f61b3[_0x8bd041]['total']=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x27')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x2d')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x2e')]=0x0;_0x2f61b3[_0x8bd041]['sumHoldTime']=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x29')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x2a')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x2f')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x30')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x31')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x32')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x33')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x34')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x35')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x36')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x37')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x38')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x39')]=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x3a')]=0x0;_0x2f61b3[_0x8bd041]['outboundAnswerAgiCallsDay']=0x0;_0x2f61b3[_0x8bd041]['outboundAnswerCallsDay']=0x0;_0x2f61b3[_0x8bd041][_0xfd14('0x3b')]=!![];}}}}Realtime[_0xfd14('0x3c')][_0xfd14('0x3d')]=function(_0x52c299,_0x21602c){for(var _0x79437 in _0x21602c){if(_0x52c299['hasOwnProperty'](_0x79437)){_0x52c299[_0x79437]=_0x21602c[_0x79437];}}};Realtime[_0xfd14('0x3c')][_0xfd14('0x3e')]=function(){var _0x4f5ca1=this;return function(_0xa6a77d){if(_0xa6a77d){freeIsNotKeyAgent(_0xa6a77d,_0x4f5ca1['agents']);for(var _0x531856=0x0,_0x3896f6={},_0x2b0a99={};_0x531856<_0xa6a77d['length'];_0x531856+=0x1){_0x3896f6=_0xa6a77d[_0x531856];var _0x3438a2=_[_0xfd14('0x23')](_0x3896f6['interface'])?util[_0xfd14('0x20')](_0xfd14('0x21'),_0x3896f6[_0xfd14('0x25')]):_0x3896f6[_0xfd14('0x24')];if(_[_0xfd14('0x3f')](_0x4f5ca1[_0xfd14('0xf')][_0x3438a2])){_0x4f5ca1[_0xfd14('0xf')][_0x3438a2]=new Agent(_0x3896f6);}else{_0x4f5ca1[_0xfd14('0x3d')](_0x4f5ca1[_0xfd14('0xf')][_0x3438a2],_0x3896f6);}}}return _0x4f5ca1[_0xfd14('0xf')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x40')]=function(){var _0x12d4e9=this;return function(_0x578be9){if(_0x578be9){freeIsNotKeySip(_0x578be9,_0x12d4e9[_0xfd14('0x10')]);for(var _0x2e6665=0x0,_0x1ecccf={},_0x36f031={};_0x2e6665<_0x578be9['length'];_0x2e6665+=0x1){_0x1ecccf=_0x578be9[_0x2e6665];if(_['isUndefined'](_0x12d4e9[_0xfd14('0x10')][util[_0xfd14('0x20')]('SIP/%s',_0x1ecccf['name'])])){_0x12d4e9['telephones'][util[_0xfd14('0x20')]('SIP/%s',_0x1ecccf[_0xfd14('0x25')])]=new Telephone(_0x1ecccf);}else{_0x12d4e9[_0xfd14('0x3d')](_0x12d4e9[_0xfd14('0x10')][util['format'](_0xfd14('0x21'),_0x1ecccf['name'])],_0x1ecccf);}}}return _0x12d4e9[_0xfd14('0x10')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x41')]=function(){var _0x22fde1=this;return function(_0x47fd10){if(_0x47fd10){freeIsNotKeySip(_0x47fd10,_0x22fde1[_0xfd14('0x11')]);for(var _0x51c1d4=0x0,_0x43254f={},_0x3511a6={};_0x51c1d4<_0x47fd10[_0xfd14('0x42')];_0x51c1d4+=0x1){_0x43254f=_0x47fd10[_0x51c1d4];if(_['isUndefined'](_0x22fde1[_0xfd14('0x11')][util['format'](_0xfd14('0x21'),_0x43254f['name'])])){_0x22fde1[_0xfd14('0x11')][util[_0xfd14('0x20')](_0xfd14('0x21'),_0x43254f[_0xfd14('0x25')])]=new Trunk(_0x43254f);}else{_0x22fde1[_0xfd14('0x3d')](_0x22fde1[_0xfd14('0x11')][util[_0xfd14('0x20')]('SIP/%s',_0x43254f[_0xfd14('0x25')])],_0x43254f);}}}return _0x22fde1[_0xfd14('0x11')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x43')]=function(){var _0x1e9bb1=this;return function(_0x16a826){if(_0x16a826){freeIsNotKey(_0x16a826,_0x1e9bb1[_0xfd14('0x12')],_0xfd14('0x25'));for(var _0x416823=0x0,_0x460104={},_0x29d2d1={};_0x416823<_0x16a826[_0xfd14('0x42')];_0x416823+=0x1){_0x460104=_0x16a826[_0x416823];if(_[_0xfd14('0x3f')](_0x1e9bb1[_0xfd14('0x12')][_0x460104[_0xfd14('0x25')]])){_0x1e9bb1['voiceQueues'][_0x460104[_0xfd14('0x25')]]=new VoiceQueue(_0x460104);}else{_0x1e9bb1[_0xfd14('0x3d')](_0x1e9bb1[_0xfd14('0x12')][_0x460104[_0xfd14('0x25')]],_0x460104);}}}return _0x1e9bb1[_0xfd14('0x12')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x44')]=function(){var _0x4c37a0=this;return function(_0x22e62e){if(_0x22e62e){freeIsNotKey(_0x22e62e,_0x4c37a0[_0xfd14('0x13')],'id');for(var _0x5d43e4=0x0,_0x65f501={},_0x3c46ce={};_0x5d43e4<_0x22e62e[_0xfd14('0x42')];_0x5d43e4+=0x1){_0x65f501=_0x22e62e[_0x5d43e4];if(_[_0xfd14('0x3f')](_0x4c37a0[_0xfd14('0x13')][_0x65f501['id']])){_0x4c37a0[_0xfd14('0x13')][_0x65f501['id']]=new Trigger(_0x65f501);}else{_0x4c37a0[_0xfd14('0x3d')](_0x4c37a0[_0xfd14('0x13')][_0x65f501['id']],_0x65f501);}}}return _0x4c37a0[_0xfd14('0x13')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x45')]=function(){var _0x5a5960=this;return function(_0x5d2f4e){if(_0x5d2f4e){freeIsNotKey(_0x5d2f4e,_0x5a5960[_0xfd14('0x14')],'id');for(var _0x577426=0x0,_0xc0abd={},_0x257d8b={};_0x577426<_0x5d2f4e[_0xfd14('0x42')];_0x577426+=0x1){_0xc0abd=_0x5d2f4e[_0x577426];if(_[_0xfd14('0x3f')](_0x5a5960['templates'][_0xc0abd['id']])){_0x5a5960[_0xfd14('0x14')][_0xc0abd['id']]=new Template(_0xc0abd);}else{_0x5a5960[_0xfd14('0x3d')](_0x5a5960[_0xfd14('0x14')][_0xc0abd['id']],_0xc0abd);}}}return _0x5a5960[_0xfd14('0x14')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x46')]=function(){var _0xaf162e=this;return function(_0x35fda3){if(_0x35fda3){freeIsNotKey(_0x35fda3,_0xaf162e[_0xfd14('0x1a')],'id');for(var _0x1df445=0x0,_0x5e3d66={},_0x48a8cd={};_0x1df445<_0x35fda3[_0xfd14('0x42')];_0x1df445+=0x1){_0x5e3d66=_0x35fda3[_0x1df445];if(_[_0xfd14('0x3f')](_0xaf162e['zendeskAccounts'][_0x5e3d66['id']])){_0xaf162e[_0xfd14('0x1a')][_0x5e3d66['id']]=new ZendeskAccount(_0x5e3d66);}else{_0xaf162e['mergeFromDatabase'](_0xaf162e[_0xfd14('0x1a')][_0x5e3d66['id']],_0x5e3d66);}}}return _0xaf162e[_0xfd14('0x1a')];};};Realtime['prototype'][_0xfd14('0x47')]=function(){var _0x495eed=this;return function(_0x16c10a){if(_0x16c10a){freeIsNotKey(_0x16c10a,_0x495eed[_0xfd14('0x1b')],'id');for(var _0x53898f=0x0,_0x1e8793={},_0x2d8d01={};_0x53898f<_0x16c10a['length'];_0x53898f+=0x1){_0x1e8793=_0x16c10a[_0x53898f];if(_[_0xfd14('0x3f')](_0x495eed[_0xfd14('0x1b')][_0x1e8793['id']])){_0x495eed['salesforceAccounts'][_0x1e8793['id']]=new SalesforceAccount(_0x1e8793);}else{_0x495eed['mergeFromDatabase'](_0x495eed['salesforceAccounts'][_0x1e8793['id']],_0x1e8793);}}}return _0x495eed[_0xfd14('0x1b')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x48')]=function(){var _0x272328=this;return function(_0x3c88b9){if(_0x3c88b9){freeIsNotKey(_0x3c88b9,_0x272328[_0xfd14('0x1d')],'id');for(var _0x4dee65=0x0,_0x435cb5={},_0x563cf0={};_0x4dee65<_0x3c88b9['length'];_0x4dee65+=0x1){_0x435cb5=_0x3c88b9[_0x4dee65];if(_['isUndefined'](_0x272328[_0xfd14('0x1d')][_0x435cb5['id']])){_0x272328[_0xfd14('0x1d')][_0x435cb5['id']]=new FreshdeskAccount(_0x435cb5);}else{_0x272328[_0xfd14('0x3d')](_0x272328['freshdeskAccounts'][_0x435cb5['id']],_0x435cb5);}}}return _0x272328['freshdeskAccounts'];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x49')]=function(){var _0xef023e=this;return function(_0x161378){if(_0x161378){freeIsNotKey(_0x161378,_0xef023e['zohoAccounts'],'id');for(var _0x27f1a0=0x0,_0x6e6419={},_0x21f216={};_0x27f1a0<_0x161378['length'];_0x27f1a0+=0x1){_0x6e6419=_0x161378[_0x27f1a0];if(_[_0xfd14('0x3f')](_0xef023e[_0xfd14('0x4a')][_0x6e6419['id']])){_0xef023e[_0xfd14('0x4a')][_0x6e6419['id']]=new ZohoAccount(_0x6e6419);}else{_0xef023e[_0xfd14('0x3d')](_0xef023e[_0xfd14('0x4a')][_0x6e6419['id']],_0x6e6419);}}}return _0xef023e[_0xfd14('0x4a')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x4b')]=function(){var _0x4283db=this;return function(_0x1e5010){if(_0x1e5010){freeIsNotKey(_0x1e5010,_0x4283db[_0xfd14('0x1e')],'id');for(var _0x4ef713=0x0,_0x42ee3e={},_0xf99f77={};_0x4ef713<_0x1e5010[_0xfd14('0x42')];_0x4ef713+=0x1){_0x42ee3e=_0x1e5010[_0x4ef713];if(_[_0xfd14('0x3f')](_0x4283db[_0xfd14('0x1e')][_0x42ee3e['id']])){_0x4283db[_0xfd14('0x1e')][_0x42ee3e['id']]=new DeskAccount(_0x42ee3e);}else{_0x4283db[_0xfd14('0x3d')](_0x4283db[_0xfd14('0x1e')][_0x42ee3e['id']],_0x42ee3e);}}}return _0x4283db['deskAccounts'];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x4c')]=function(){var _0x3454c3=this;return function(_0x84e03){if(_0x84e03){freeIsNotKey(_0x84e03,_0x3454c3['sugarcrmAccounts'],'id');for(var _0x1fa61f=0x0,_0x11288a={},_0x41461b={};_0x1fa61f<_0x84e03['length'];_0x1fa61f+=0x1){_0x11288a=_0x84e03[_0x1fa61f];if(_['isUndefined'](_0x3454c3['sugarcrmAccounts'][_0x11288a['id']])){_0x3454c3[_0xfd14('0x1c')][_0x11288a['id']]=new SugarcrmAccount(_0x11288a);}else{_0x3454c3[_0xfd14('0x3d')](_0x3454c3['sugarcrmAccounts'][_0x11288a['id']],_0x11288a);}}}return _0x3454c3['sugarcrmAccounts'];};};Realtime['prototype'][_0xfd14('0x4d')]=function(){var _0x257f9c=this;return function(_0x248719){if(_0x248719){freeIsNotKey(_0x248719,_0x257f9c['vtigerAccounts'],'id');for(var _0x129434=0x0,_0x2e1dce={},_0x472451={};_0x129434<_0x248719[_0xfd14('0x42')];_0x129434+=0x1){_0x2e1dce=_0x248719[_0x129434];if(_['isUndefined'](_0x257f9c[_0xfd14('0x4e')][_0x2e1dce['id']])){_0x257f9c['vtigerAccounts'][_0x2e1dce['id']]=new VtigerAccount(_0x2e1dce);}else{_0x257f9c[_0xfd14('0x3d')](_0x257f9c[_0xfd14('0x4e')][_0x2e1dce['id']],_0x2e1dce);}}}return _0x257f9c['vtigerAccounts'];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x4f')]=function(){var _0x47bfc6=this;return function(_0x3601f3){for(var _0x4786d9=0x0;_0x4786d9<_0x3601f3['length'];_0x4786d9+=0x1){_[_0xfd14('0x50')](_0x47bfc6[_0xfd14('0x12')][_0x3601f3[_0x4786d9][_0xfd14('0x25')]],_0x3601f3[_0x4786d9]);}return _0x47bfc6['voiceQueues'];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0xce9cea=this;return function(_0x4fc1e2){clearVoiceQueues(_0xce9cea['voiceQueues']);if(_0x4fc1e2){_0x4fc1e2=_['groupBy'](_0x4fc1e2,_0xfd14('0x51'));for(var _0x3e15ca in _0x4fc1e2){if(_0x4fc1e2[_0xfd14('0x22')](_0x3e15ca)){var _0x320fa7={};for(var _0x54f8e6=0x0;_0x54f8e6<_0x4fc1e2[_0x3e15ca][_0xfd14('0x42')];_0x54f8e6+=0x1){var _0x3679af=_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x52')];if(_0xce9cea[_0xfd14('0x12')][_0x3679af]){if(_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x53')]){_0xce9cea['voiceQueues'][_0x3679af][_0xfd14('0x2d')]+=0x1;}if(_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x54')]){_0xce9cea['voiceQueues'][_0x3679af][_0xfd14('0x2e')]+=0x1;}_0xce9cea[_0xfd14('0x12')][_0x3679af]['sumHoldTime']+=moment(_0x4fc1e2[_0x3e15ca][_0x54f8e6]['queuecallerleaveAt'])[_0xfd14('0x55')](moment(_0x4fc1e2[_0x3e15ca][_0x54f8e6]['queuecallerjoinAt']),_0xfd14('0x56'))||0x0;if(_0x54f8e6===_0x4fc1e2[_0x3e15ca][_0xfd14('0x42')]-0x1){_0xce9cea[_0xfd14('0x12')][_0x3679af][_0xfd14('0x29')]+=moment(_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x57')]||_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x58')]||_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x59')])[_0xfd14('0x55')](moment(_0x4fc1e2[_0x3e15ca][_0x54f8e6]['queuecallerjoinAt']),_0xfd14('0x56'))||0x0;_0xce9cea[_0xfd14('0x12')][_0x3679af]['total']+=0x1;if(_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x5a')]){_0xce9cea[_0xfd14('0x12')][_0x3679af]['answered']+=0x1;_0xce9cea[_0xfd14('0x12')][_0x3679af][_0xfd14('0x2a')]+=moment(_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x57')])['diff'](moment(_0x4fc1e2[_0x3e15ca][_0x54f8e6][_0xfd14('0x5b')]),_0xfd14('0x56'))||0x0;}}else{_0xce9cea[_0xfd14('0x12')][_0x3679af][_0xfd14('0x29')]+=_0xce9cea[_0xfd14('0x12')][_0x3679af][_0xfd14('0x28')]||0x0;}}}}}}return _0xce9cea[_0xfd14('0x12')];};};Realtime[_0xfd14('0x3c')]['initVoiceCallReports']=function(){var _0x418d67=this;return function(_0x471e20){clearVoiceCallReports(_0x418d67[_0xfd14('0x15')]);if(_0x471e20){for(var _0x7e511b=0x0;_0x7e511b<_0x471e20[_0xfd14('0x42')];_0x7e511b+=0x1){_0x418d67[_0xfd14('0x15')][_0xfd14('0x26')]+=0x1;_0x418d67[_0xfd14('0x15')][_0xfd14('0x29')]+=_0x471e20[_0x7e511b][_0xfd14('0x5c')];if(_0x471e20[_0x7e511b][_0xfd14('0x5d')]===_0xfd14('0x5e')){_0x418d67['outbound'][_0xfd14('0x27')]+=0x1;_0x418d67[_0xfd14('0x15')][_0xfd14('0x28')]+=_0x471e20[_0x7e511b][_0xfd14('0x5c')]-_0x471e20[_0x7e511b][_0xfd14('0x5f')]||0x0;_0x418d67[_0xfd14('0x15')][_0xfd14('0x2a')]+=_0x471e20[_0x7e511b][_0xfd14('0x5f')];}}}return _0x418d67['outbound'];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x60')]=function(){var _0x44946f=this;return function(_0x28e52c){if(_0x28e52c){freeIsNotKey(_0x28e52c,_0x44946f[_0xfd14('0x61')],'name');for(var _0x36ca2c=0x0,_0x3bcc6a={};_0x36ca2c<_0x28e52c[_0xfd14('0x42')];_0x36ca2c+=0x1){_0x3bcc6a=_0x28e52c[_0x36ca2c];if(_[_0xfd14('0x3f')](_0x44946f['campaigns'][_0x3bcc6a[_0xfd14('0x25')]])){_0x44946f[_0xfd14('0x61')][_0x3bcc6a['name']]=new Campaign(_0x3bcc6a);}else{_0x44946f[_0xfd14('0x3d')](_0x44946f[_0xfd14('0x61')][_0x3bcc6a['name']],_0x3bcc6a);}}}return _0x44946f['campaigns'];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x62')]=function(){var _0x1f58a7=this;return function(_0x44514b){if(_0x44514b){freeIsNotKey(_0x44514b,_0x1f58a7[_0xfd14('0x63')],'id');for(var _0x1cf352=0x0,_0x2278af={};_0x1cf352<_0x44514b['length'];_0x1cf352+=0x1){_0x2278af=_0x44514b[_0x1cf352];if(_[_0xfd14('0x3f')](_0x1f58a7[_0xfd14('0x63')][_0x2278af['id']])){_0x1f58a7['voiceExtensions'][_0x2278af['id']]=new VoiceExtension(_0x2278af);}else{_0x1f58a7['mergeFromDatabase'](_0x1f58a7[_0xfd14('0x63')][_0x2278af['id']],_0x2278af);}}}return _0x1f58a7[_0xfd14('0x63')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x64')]=function(){var _0x13e9a4=this;return function(_0x5d7ac1){clearCampaigns(_0x13e9a4['campaigns']);for(var _0x1cebfb=0x0;_0x1cebfb<_0x5d7ac1[_0xfd14('0x42')];_0x1cebfb+=0x1){_[_0xfd14('0x50')](_0x13e9a4[_0xfd14('0x61')][_0x5d7ac1[_0x1cebfb][_0xfd14('0x25')]],_0x5d7ac1[_0x1cebfb]);}return _0x13e9a4[_0xfd14('0x61')];};};Realtime[_0xfd14('0x3c')][_0xfd14('0x65')]=function(){var _0x31b1b4=this;return function(_0x242485){if(_0x242485){freeIsNotKey(_0x242485,_0x31b1b4['faxAccounts'],'id');for(var _0x5de47d=0x0,_0x2ed598={},_0x206fab={};_0x5de47d<_0x242485[_0xfd14('0x42')];_0x5de47d+=0x1){_0x2ed598=_0x242485[_0x5de47d];if(_[_0xfd14('0x3f')](_0x31b1b4[_0xfd14('0x66')][_0x2ed598['id']])){_0x31b1b4[_0xfd14('0x66')][_0x2ed598['id']]=new FaxAccount(_0x2ed598);}else{_0x31b1b4[_0xfd14('0x3d')](_0x31b1b4[_0xfd14('0x66')][_0x2ed598['id']],_0x2ed598);}}}return _0x31b1b4['faxAccounts'];};};module[_0xfd14('0x67')]=Realtime;
\ No newline at end of file
+var _0xa059=['faxAccounts','bluebird','util','lodash','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','freshdeskAccounts','zohoAccounts','deskAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','agents','length','initTrunks','isUndefined','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','salesforceAccounts','initFreshdeskAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','outbound','duration','disposition','ANSWERED','billableseconds','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa059,0xbf));var _0x9a05=function(_0x4a71af,_0x1f18b3){_0x4a71af=_0x4a71af-0x0;var _0x5d5d08=_0xa059[_0x4a71af];return _0x5d5d08;};'use strict';var BPromise=require(_0x9a05('0x0'));var util=require(_0x9a05('0x1'));var _=require(_0x9a05('0x2'));var moment=require('moment');var Agent=require(_0x9a05('0x3'));var Telephone=require(_0x9a05('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x9a05('0x5'));var Trigger=require(_0x9a05('0x6'));var Template=require('../model/template');var Campaign=require(_0x9a05('0x7'));var VoiceExtension=require(_0x9a05('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x9a05('0x9'));var FreshdeskAccount=require(_0x9a05('0xa'));var SugarcrmAccount=require(_0x9a05('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x9a05('0xc'));var FaxAccount=require(_0x9a05('0xd'));var Realtime=function(){this['agents']={};this[_0x9a05('0xe')]={};this[_0x9a05('0xf')]={};this[_0x9a05('0x10')]={};this[_0x9a05('0x11')]={};this[_0x9a05('0x12')]={};this[_0x9a05('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9a05('0x14')]={};this['channels']={};this[_0x9a05('0x15')]={};this[_0x9a05('0x16')]={};this[_0x9a05('0x17')]={};this['zendeskAccounts']={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x9a05('0x18')]={};this[_0x9a05('0x19')]={};this[_0x9a05('0x1a')]={};this['vtigerAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x440c85,_0x34b8ae,_0x424e1a){var _0x46c7fb=_[_0x9a05('0x1b')](_0x440c85,function(_0x250e41,_0x4c412e){return _0x250e41[_0x424e1a];});for(var _0x4d41dc in _0x34b8ae){if(_0x34b8ae[_0x9a05('0x1c')](_0x4d41dc)){if(!_0x46c7fb[_0x4d41dc]){delete _0x34b8ae[_0x4d41dc];}}}}function freeIsNotKeySip(_0x1e9953,_0x296d2e){var _0x417ce0=_[_0x9a05('0x1b')](_0x1e9953,function(_0x548f4b,_0x4d224d){return util[_0x9a05('0x1d')](_0x9a05('0x1e'),_0x548f4b[_0x9a05('0x1f')]);});for(var _0x4a3e1f in _0x296d2e){if(_0x296d2e['hasOwnProperty'](_0x4a3e1f)){if(!_0x417ce0[_0x4a3e1f]){delete _0x296d2e[_0x4a3e1f];}}}}function freeIsNotKeyAgent(_0x53d766,_0x2c9c05){var _0x42197b=_[_0x9a05('0x1b')](_0x53d766,function(_0x3832df,_0x10abcb){var _0x52ac24=_[_0x9a05('0x20')](_0x3832df[_0x9a05('0x21')])?util['format'](_0x9a05('0x1e'),_0x3832df['name']):_0x3832df['interface'];return _0x52ac24;});for(var _0x4bc966 in _0x2c9c05){if(_0x2c9c05[_0x9a05('0x1c')](_0x4bc966)){if(!_0x42197b[_0x4bc966]){delete _0x2c9c05[_0x4bc966];}}}}function clearVoiceCallReports(_0xaf49d){_0xaf49d[_0x9a05('0x22')]=0x0;_0xaf49d[_0x9a05('0x23')]=0x0;_0xaf49d[_0x9a05('0x24')]=0x0;_0xaf49d[_0x9a05('0x25')]=0x0;_0xaf49d[_0x9a05('0x26')]=0x0;}function clearCampaigns(_0x14048d){if(!_[_0x9a05('0x27')](_0x14048d)){for(var _0x561812 in _0x14048d){if(_0x14048d['hasOwnProperty'](_0x561812)){_0x14048d[_0x561812][_0x9a05('0x28')]=0x0;_0x14048d[_0x561812][_0x9a05('0x29')]=0x0;}}}}function clearVoiceQueues(_0x109a58){if(!_[_0x9a05('0x27')](_0x109a58)){for(var _0x23a45c in _0x109a58){if(_0x109a58[_0x9a05('0x1c')](_0x23a45c)){_0x109a58[_0x23a45c]['total']=0x0;_0x109a58[_0x23a45c][_0x9a05('0x23')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x2a')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x2b')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x24')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x25')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x26')]=0x0;_0x109a58[_0x23a45c]['outboundAnswerAgiCallsDay']=0x0;_0x109a58[_0x23a45c][_0x9a05('0x2c')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x2d')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x2e')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x2f')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x30')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x31')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x32')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x33')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x34')]=0x0;_0x109a58[_0x23a45c]['outboundRejectCallsDay']=0x0;_0x109a58[_0x23a45c][_0x9a05('0x35')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x36')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x37')]=0x0;_0x109a58[_0x23a45c][_0x9a05('0x38')]=!![];}}}}Realtime[_0x9a05('0x39')][_0x9a05('0x3a')]=function(_0x20c5ef,_0x4e473d){for(var _0x33dd61 in _0x4e473d){if(_0x20c5ef[_0x9a05('0x1c')](_0x33dd61)){_0x20c5ef[_0x33dd61]=_0x4e473d[_0x33dd61];}}};Realtime[_0x9a05('0x39')]['initAgents']=function(){var _0x5ea081=this;return function(_0x3e5137){if(_0x3e5137){freeIsNotKeyAgent(_0x3e5137,_0x5ea081[_0x9a05('0x3b')]);for(var _0x215639=0x0,_0x2f57f3={},_0x47a67f={};_0x215639<_0x3e5137[_0x9a05('0x3c')];_0x215639+=0x1){_0x2f57f3=_0x3e5137[_0x215639];var _0x200639=_[_0x9a05('0x20')](_0x2f57f3[_0x9a05('0x21')])?util['format'](_0x9a05('0x1e'),_0x2f57f3['name']):_0x2f57f3[_0x9a05('0x21')];if(_['isUndefined'](_0x5ea081['agents'][_0x200639])){_0x5ea081[_0x9a05('0x3b')][_0x200639]=new Agent(_0x2f57f3);}else{_0x5ea081[_0x9a05('0x3a')](_0x5ea081[_0x9a05('0x3b')][_0x200639],_0x2f57f3);}}}return _0x5ea081['agents'];};};Realtime[_0x9a05('0x39')]['initTelephones']=function(){var _0x21301a=this;return function(_0x591edf){if(_0x591edf){freeIsNotKeySip(_0x591edf,_0x21301a[_0x9a05('0xe')]);for(var _0x387916=0x0,_0x930d29={},_0xa2d8ea={};_0x387916<_0x591edf[_0x9a05('0x3c')];_0x387916+=0x1){_0x930d29=_0x591edf[_0x387916];if(_['isUndefined'](_0x21301a[_0x9a05('0xe')][util[_0x9a05('0x1d')](_0x9a05('0x1e'),_0x930d29[_0x9a05('0x1f')])])){_0x21301a[_0x9a05('0xe')][util[_0x9a05('0x1d')](_0x9a05('0x1e'),_0x930d29[_0x9a05('0x1f')])]=new Telephone(_0x930d29);}else{_0x21301a['mergeFromDatabase'](_0x21301a[_0x9a05('0xe')][util['format']('SIP/%s',_0x930d29['name'])],_0x930d29);}}}return _0x21301a[_0x9a05('0xe')];};};Realtime['prototype'][_0x9a05('0x3d')]=function(){var _0x442c2a=this;return function(_0x38be2c){if(_0x38be2c){freeIsNotKeySip(_0x38be2c,_0x442c2a[_0x9a05('0xf')]);for(var _0x1ba1fb=0x0,_0x303fbc={},_0x542e14={};_0x1ba1fb<_0x38be2c[_0x9a05('0x3c')];_0x1ba1fb+=0x1){_0x303fbc=_0x38be2c[_0x1ba1fb];if(_[_0x9a05('0x3e')](_0x442c2a['trunks'][util[_0x9a05('0x1d')](_0x9a05('0x1e'),_0x303fbc[_0x9a05('0x1f')])])){_0x442c2a[_0x9a05('0xf')][util[_0x9a05('0x1d')](_0x9a05('0x1e'),_0x303fbc['name'])]=new Trunk(_0x303fbc);}else{_0x442c2a[_0x9a05('0x3a')](_0x442c2a[_0x9a05('0xf')][util[_0x9a05('0x1d')](_0x9a05('0x1e'),_0x303fbc['name'])],_0x303fbc);}}}return _0x442c2a[_0x9a05('0xf')];};};Realtime[_0x9a05('0x39')]['initVoiceQueues']=function(){var _0x1046e3=this;return function(_0x1ac589){if(_0x1ac589){freeIsNotKey(_0x1ac589,_0x1046e3[_0x9a05('0x10')],_0x9a05('0x1f'));for(var _0xb53759=0x0,_0x65a9a7={},_0x5b934a={};_0xb53759<_0x1ac589['length'];_0xb53759+=0x1){_0x65a9a7=_0x1ac589[_0xb53759];if(_['isUndefined'](_0x1046e3[_0x9a05('0x10')][_0x65a9a7[_0x9a05('0x1f')]])){_0x1046e3[_0x9a05('0x10')][_0x65a9a7[_0x9a05('0x1f')]]=new VoiceQueue(_0x65a9a7);}else{_0x1046e3[_0x9a05('0x3a')](_0x1046e3[_0x9a05('0x10')][_0x65a9a7[_0x9a05('0x1f')]],_0x65a9a7);}}}return _0x1046e3[_0x9a05('0x10')];};};Realtime['prototype'][_0x9a05('0x3f')]=function(){var _0x99ca1d=this;return function(_0x596e62){if(_0x596e62){freeIsNotKey(_0x596e62,_0x99ca1d[_0x9a05('0x11')],'id');for(var _0x2c0c6e=0x0,_0x382c75={},_0x19ced0={};_0x2c0c6e<_0x596e62['length'];_0x2c0c6e+=0x1){_0x382c75=_0x596e62[_0x2c0c6e];if(_[_0x9a05('0x3e')](_0x99ca1d[_0x9a05('0x11')][_0x382c75['id']])){_0x99ca1d[_0x9a05('0x11')][_0x382c75['id']]=new Trigger(_0x382c75);}else{_0x99ca1d['mergeFromDatabase'](_0x99ca1d[_0x9a05('0x11')][_0x382c75['id']],_0x382c75);}}}return _0x99ca1d[_0x9a05('0x11')];};};Realtime[_0x9a05('0x39')][_0x9a05('0x40')]=function(){var _0x32ad68=this;return function(_0x674f43){if(_0x674f43){freeIsNotKey(_0x674f43,_0x32ad68[_0x9a05('0x13')],'id');for(var _0xc0e0d9=0x0,_0x3cff49={},_0x475f95={};_0xc0e0d9<_0x674f43[_0x9a05('0x3c')];_0xc0e0d9+=0x1){_0x3cff49=_0x674f43[_0xc0e0d9];if(_[_0x9a05('0x3e')](_0x32ad68[_0x9a05('0x13')][_0x3cff49['id']])){_0x32ad68[_0x9a05('0x13')][_0x3cff49['id']]=new Template(_0x3cff49);}else{_0x32ad68[_0x9a05('0x3a')](_0x32ad68['templates'][_0x3cff49['id']],_0x3cff49);}}}return _0x32ad68[_0x9a05('0x13')];};};Realtime[_0x9a05('0x39')][_0x9a05('0x41')]=function(){var _0x5b4970=this;return function(_0x3ce4b3){if(_0x3ce4b3){freeIsNotKey(_0x3ce4b3,_0x5b4970['zendeskAccounts'],'id');for(var _0x5cdf99=0x0,_0x47aad4={},_0x3d386e={};_0x5cdf99<_0x3ce4b3[_0x9a05('0x3c')];_0x5cdf99+=0x1){_0x47aad4=_0x3ce4b3[_0x5cdf99];if(_['isUndefined'](_0x5b4970[_0x9a05('0x42')][_0x47aad4['id']])){_0x5b4970['zendeskAccounts'][_0x47aad4['id']]=new ZendeskAccount(_0x47aad4);}else{_0x5b4970['mergeFromDatabase'](_0x5b4970[_0x9a05('0x42')][_0x47aad4['id']],_0x47aad4);}}}return _0x5b4970[_0x9a05('0x42')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x1eedc3=this;return function(_0x1765a4){if(_0x1765a4){freeIsNotKey(_0x1765a4,_0x1eedc3[_0x9a05('0x43')],'id');for(var _0x56a1e8=0x0,_0x4fdb2f={},_0x369372={};_0x56a1e8<_0x1765a4['length'];_0x56a1e8+=0x1){_0x4fdb2f=_0x1765a4[_0x56a1e8];if(_[_0x9a05('0x3e')](_0x1eedc3[_0x9a05('0x43')][_0x4fdb2f['id']])){_0x1eedc3[_0x9a05('0x43')][_0x4fdb2f['id']]=new SalesforceAccount(_0x4fdb2f);}else{_0x1eedc3[_0x9a05('0x3a')](_0x1eedc3[_0x9a05('0x43')][_0x4fdb2f['id']],_0x4fdb2f);}}}return _0x1eedc3[_0x9a05('0x43')];};};Realtime[_0x9a05('0x39')][_0x9a05('0x44')]=function(){var _0x100b4a=this;return function(_0x418a47){if(_0x418a47){freeIsNotKey(_0x418a47,_0x100b4a[_0x9a05('0x18')],'id');for(var _0x498658=0x0,_0x2aa538={},_0x572a85={};_0x498658<_0x418a47[_0x9a05('0x3c')];_0x498658+=0x1){_0x2aa538=_0x418a47[_0x498658];if(_[_0x9a05('0x3e')](_0x100b4a[_0x9a05('0x18')][_0x2aa538['id']])){_0x100b4a[_0x9a05('0x18')][_0x2aa538['id']]=new FreshdeskAccount(_0x2aa538);}else{_0x100b4a[_0x9a05('0x3a')](_0x100b4a[_0x9a05('0x18')][_0x2aa538['id']],_0x2aa538);}}}return _0x100b4a['freshdeskAccounts'];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x5dbc5b=this;return function(_0x34231c){if(_0x34231c){freeIsNotKey(_0x34231c,_0x5dbc5b[_0x9a05('0x19')],'id');for(var _0x4c38a9=0x0,_0x56b4f7={},_0x5717f1={};_0x4c38a9<_0x34231c['length'];_0x4c38a9+=0x1){_0x56b4f7=_0x34231c[_0x4c38a9];if(_[_0x9a05('0x3e')](_0x5dbc5b['zohoAccounts'][_0x56b4f7['id']])){_0x5dbc5b[_0x9a05('0x19')][_0x56b4f7['id']]=new ZohoAccount(_0x56b4f7);}else{_0x5dbc5b[_0x9a05('0x3a')](_0x5dbc5b['zohoAccounts'][_0x56b4f7['id']],_0x56b4f7);}}}return _0x5dbc5b[_0x9a05('0x19')];};};Realtime[_0x9a05('0x39')]['initDeskAccounts']=function(){var _0x32266e=this;return function(_0x3af06f){if(_0x3af06f){freeIsNotKey(_0x3af06f,_0x32266e[_0x9a05('0x1a')],'id');for(var _0x1fc38a=0x0,_0x52e05a={},_0x123b36={};_0x1fc38a<_0x3af06f[_0x9a05('0x3c')];_0x1fc38a+=0x1){_0x52e05a=_0x3af06f[_0x1fc38a];if(_[_0x9a05('0x3e')](_0x32266e[_0x9a05('0x1a')][_0x52e05a['id']])){_0x32266e[_0x9a05('0x1a')][_0x52e05a['id']]=new DeskAccount(_0x52e05a);}else{_0x32266e['mergeFromDatabase'](_0x32266e['deskAccounts'][_0x52e05a['id']],_0x52e05a);}}}return _0x32266e['deskAccounts'];};};Realtime[_0x9a05('0x39')]['initSugarcrmAccounts']=function(){var _0x20f4c7=this;return function(_0x1249bc){if(_0x1249bc){freeIsNotKey(_0x1249bc,_0x20f4c7[_0x9a05('0x45')],'id');for(var _0x257389=0x0,_0x4de319={},_0xb98105={};_0x257389<_0x1249bc[_0x9a05('0x3c')];_0x257389+=0x1){_0x4de319=_0x1249bc[_0x257389];if(_[_0x9a05('0x3e')](_0x20f4c7[_0x9a05('0x45')][_0x4de319['id']])){_0x20f4c7[_0x9a05('0x45')][_0x4de319['id']]=new SugarcrmAccount(_0x4de319);}else{_0x20f4c7[_0x9a05('0x3a')](_0x20f4c7[_0x9a05('0x45')][_0x4de319['id']],_0x4de319);}}}return _0x20f4c7[_0x9a05('0x45')];};};Realtime[_0x9a05('0x39')][_0x9a05('0x46')]=function(){var _0x4a9feb=this;return function(_0x5f0767){if(_0x5f0767){freeIsNotKey(_0x5f0767,_0x4a9feb[_0x9a05('0x47')],'id');for(var _0xd0faf6=0x0,_0x1dc4a3={},_0x44b49e={};_0xd0faf6<_0x5f0767[_0x9a05('0x3c')];_0xd0faf6+=0x1){_0x1dc4a3=_0x5f0767[_0xd0faf6];if(_[_0x9a05('0x3e')](_0x4a9feb[_0x9a05('0x47')][_0x1dc4a3['id']])){_0x4a9feb[_0x9a05('0x47')][_0x1dc4a3['id']]=new VtigerAccount(_0x1dc4a3);}else{_0x4a9feb[_0x9a05('0x3a')](_0x4a9feb[_0x9a05('0x47')][_0x1dc4a3['id']],_0x1dc4a3);}}}return _0x4a9feb[_0x9a05('0x47')];};};Realtime[_0x9a05('0x39')][_0x9a05('0x48')]=function(){var _0x16d5f1=this;return function(_0x41f75a){for(var _0x1f6b26=0x0;_0x1f6b26<_0x41f75a[_0x9a05('0x3c')];_0x1f6b26+=0x1){_[_0x9a05('0x49')](_0x16d5f1[_0x9a05('0x10')][_0x41f75a[_0x1f6b26][_0x9a05('0x1f')]],_0x41f75a[_0x1f6b26]);}return _0x16d5f1[_0x9a05('0x10')];};};Realtime[_0x9a05('0x39')]['initVoiceQueueReports']=function(){var _0x2701eb=this;return function(_0x23ac5c){clearVoiceQueues(_0x2701eb[_0x9a05('0x10')]);if(_0x23ac5c){_0x23ac5c=_[_0x9a05('0x4a')](_0x23ac5c,_0x9a05('0x4b'));for(var _0x5e2954 in _0x23ac5c){if(_0x23ac5c[_0x9a05('0x1c')](_0x5e2954)){var _0x46851c={};for(var _0x3e6907=0x0;_0x3e6907<_0x23ac5c[_0x5e2954][_0x9a05('0x3c')];_0x3e6907+=0x1){var _0x38f4d9=_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x4c')];if(_0x2701eb[_0x9a05('0x10')][_0x38f4d9]){if(_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x4d')]){_0x2701eb[_0x9a05('0x10')][_0x38f4d9][_0x9a05('0x2a')]+=0x1;}if(_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x4e')]){_0x2701eb[_0x9a05('0x10')][_0x38f4d9]['abandoned']+=0x1;}_0x2701eb[_0x9a05('0x10')][_0x38f4d9][_0x9a05('0x24')]+=moment(_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x4f')])[_0x9a05('0x50')](moment(_0x23ac5c[_0x5e2954][_0x3e6907]['queuecallerjoinAt']),_0x9a05('0x51'))||0x0;if(_0x3e6907===_0x23ac5c[_0x5e2954][_0x9a05('0x3c')]-0x1){_0x2701eb[_0x9a05('0x10')][_0x38f4d9][_0x9a05('0x25')]+=moment(_0x23ac5c[_0x5e2954][_0x3e6907]['queuecallercompleteAt']||_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x52')]||_0x23ac5c[_0x5e2954][_0x3e6907]['queuecallerexitAt'])[_0x9a05('0x50')](moment(_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x53')]),_0x9a05('0x51'))||0x0;_0x2701eb[_0x9a05('0x10')][_0x38f4d9][_0x9a05('0x22')]+=0x1;if(_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x54')]){_0x2701eb['voiceQueues'][_0x38f4d9][_0x9a05('0x23')]+=0x1;_0x2701eb[_0x9a05('0x10')][_0x38f4d9][_0x9a05('0x26')]+=moment(_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x55')])[_0x9a05('0x50')](moment(_0x23ac5c[_0x5e2954][_0x3e6907][_0x9a05('0x4f')]),_0x9a05('0x51'))||0x0;}}else{_0x2701eb[_0x9a05('0x10')][_0x38f4d9][_0x9a05('0x25')]+=_0x2701eb['voiceQueues'][_0x38f4d9][_0x9a05('0x24')]||0x0;}}}}}}return _0x2701eb['voiceQueues'];};};Realtime[_0x9a05('0x39')]['initVoiceCallReports']=function(){var _0x5157d2=this;return function(_0x1b8283){clearVoiceCallReports(_0x5157d2[_0x9a05('0x56')]);if(_0x1b8283){for(var _0x1e7c70=0x0;_0x1e7c70<_0x1b8283[_0x9a05('0x3c')];_0x1e7c70+=0x1){_0x5157d2['outbound'][_0x9a05('0x22')]+=0x1;_0x5157d2[_0x9a05('0x56')][_0x9a05('0x25')]+=_0x1b8283[_0x1e7c70][_0x9a05('0x57')];if(_0x1b8283[_0x1e7c70][_0x9a05('0x58')]===_0x9a05('0x59')){_0x5157d2[_0x9a05('0x56')][_0x9a05('0x23')]+=0x1;_0x5157d2[_0x9a05('0x56')][_0x9a05('0x24')]+=_0x1b8283[_0x1e7c70][_0x9a05('0x57')]-_0x1b8283[_0x1e7c70]['billableseconds']||0x0;_0x5157d2[_0x9a05('0x56')][_0x9a05('0x26')]+=_0x1b8283[_0x1e7c70][_0x9a05('0x5a')];}}}return _0x5157d2[_0x9a05('0x56')];};};Realtime['prototype']['initCampaigns']=function(){var _0xbff95=this;return function(_0x47165d){if(_0x47165d){freeIsNotKey(_0x47165d,_0xbff95[_0x9a05('0x12')],_0x9a05('0x1f'));for(var _0x5cd5fe=0x0,_0x93127a={};_0x5cd5fe<_0x47165d['length'];_0x5cd5fe+=0x1){_0x93127a=_0x47165d[_0x5cd5fe];if(_['isUndefined'](_0xbff95[_0x9a05('0x12')][_0x93127a['name']])){_0xbff95[_0x9a05('0x12')][_0x93127a['name']]=new Campaign(_0x93127a);}else{_0xbff95[_0x9a05('0x3a')](_0xbff95[_0x9a05('0x12')][_0x93127a[_0x9a05('0x1f')]],_0x93127a);}}}return _0xbff95['campaigns'];};};Realtime['prototype'][_0x9a05('0x5b')]=function(){var _0xdbb862=this;return function(_0x51db8f){if(_0x51db8f){freeIsNotKey(_0x51db8f,_0xdbb862[_0x9a05('0x14')],'id');for(var _0x52e8b3=0x0,_0x27f1be={};_0x52e8b3<_0x51db8f[_0x9a05('0x3c')];_0x52e8b3+=0x1){_0x27f1be=_0x51db8f[_0x52e8b3];if(_[_0x9a05('0x3e')](_0xdbb862[_0x9a05('0x14')][_0x27f1be['id']])){_0xdbb862[_0x9a05('0x14')][_0x27f1be['id']]=new VoiceExtension(_0x27f1be);}else{_0xdbb862['mergeFromDatabase'](_0xdbb862[_0x9a05('0x14')][_0x27f1be['id']],_0x27f1be);}}}return _0xdbb862[_0x9a05('0x14')];};};Realtime[_0x9a05('0x39')][_0x9a05('0x5c')]=function(){var _0x26fe64=this;return function(_0x3fb4db){clearCampaigns(_0x26fe64[_0x9a05('0x12')]);for(var _0x3c1825=0x0;_0x3c1825<_0x3fb4db['length'];_0x3c1825+=0x1){_[_0x9a05('0x49')](_0x26fe64[_0x9a05('0x12')][_0x3fb4db[_0x3c1825][_0x9a05('0x1f')]],_0x3fb4db[_0x3c1825]);}return _0x26fe64['campaigns'];};};Realtime[_0x9a05('0x39')][_0x9a05('0x5d')]=function(){var _0x3e76a2=this;return function(_0x1f3f92){if(_0x1f3f92){freeIsNotKey(_0x1f3f92,_0x3e76a2[_0x9a05('0x5e')],'id');for(var _0x598fb2=0x0,_0x524785={},_0x301ec6={};_0x598fb2<_0x1f3f92['length'];_0x598fb2+=0x1){_0x524785=_0x1f3f92[_0x598fb2];if(_[_0x9a05('0x3e')](_0x3e76a2['faxAccounts'][_0x524785['id']])){_0x3e76a2['faxAccounts'][_0x524785['id']]=new FaxAccount(_0x524785);}else{_0x3e76a2[_0x9a05('0x3a')](_0x3e76a2[_0x9a05('0x5e')][_0x524785['id']],_0x524785);}}}return _0x3e76a2[_0x9a05('0x5e')];};};module['exports']=Realtime;
\ No newline at end of file
index 52d7af1..0fd50c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a32=['interface','SIP/%s','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','monitor','monitorFilename','monitors','filename','createdAt','membername','voiceAgentReport','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','blindTransfer','attendedTransfer','exports','bluebird','moment','util','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','findAgent','find','accountcode','isNil','name','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0x6a32,0x79));var _0x26a3=function(_0xaad974,_0x396049){_0xaad974=_0xaad974-0x0;var _0x3801e9=_0x6a32[_0xaad974];return _0x3801e9;};'use strict';var BPromise=require(_0x26a3('0x0'));var _=require('lodash');var moment=require(_0x26a3('0x1'));var util=require(_0x26a3('0x2'));var logger=require('../../../config/logger')(_0x26a3('0x3'));var ami=require(_0x26a3('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x26a3('0x5'));var RpcVoiceDialReport=require(_0x26a3('0x6'));var RpcMemberReport=require(_0x26a3('0x7'));var RpcVoiceQueueReport=require(_0x26a3('0x8'));var RpcVoiceRecording=require(_0x26a3('0x9'));var RpcVoiceTransferReport=require(_0x26a3('0xa'));var VoiceQueueReport=require(_0x26a3('0xb'));var VoiceCallReport=require(_0x26a3('0xc'));var VoiceAgentReport=require(_0x26a3('0xd'));var VoiceDialReport=require(_0x26a3('0xe'));var UserReport=require('./userReport');function Report(_0x43e085){this[_0x26a3('0xf')]=_0x43e085;this[_0x26a3('0x10')]=_0x43e085[_0x26a3('0x10')];this[_0x26a3('0x11')]=_0x43e085[_0x26a3('0x11')];}Report['prototype']['sync']=function(_0x5c9b13){var _0x5e56d8=new VoiceQueueReport(this[_0x26a3('0xf')]);var _0x1cf2ad=new VoiceAgentReport(this[_0x26a3('0xf')]);var _0x46d632=new VoiceDialReport(this[_0x26a3('0xf')]);var _0x2edb7d=new VoiceCallReport(this[_0x26a3('0xf')]);var _0x2e405c=new UserReport(this['realtime']);};Report[_0x26a3('0x12')][_0x26a3('0x13')]=function(_0x240f9d){var _0x3d43dc=undefined;_0x3d43dc=_[_0x26a3('0x14')](this['agents'],function(_0x3ce43d){return _0x3ce43d[_0x26a3('0x15')]==_0x240f9d||_0x3ce43d['name']==_0x240f9d;});if(_[_0x26a3('0x16')](_0x3d43dc)){var _0x132e57=_[_0x26a3('0x14')](this[_0x26a3('0x11')],function(_0x59366a){return _0x59366a[_0x26a3('0x15')]==_0x240f9d||_0x59366a[_0x26a3('0x17')]==_0x240f9d;});if(_0x132e57){_0x3d43dc=_[_0x26a3('0x14')](this[_0x26a3('0x10')],function(_0x3bbc37){return _0x3bbc37['interface']==util['format']('SIP/%s',_0x132e57[_0x26a3('0x17')]);});}}return _0x3d43dc;};Report[_0x26a3('0x12')][_0x26a3('0x18')]=function(_0x1e35b1){for(var _0x26903a=0x0;_0x26903a<_0x1e35b1[_0x26a3('0x19')];_0x26903a+=0x1){var _0x5bf41a=this['findAgent'](_0x1e35b1[_0x26903a][_0x26a3('0x1a')]);if(_0x5bf41a){_0x1e35b1[_0x26903a][_0x26a3('0x15')]=_0x5bf41a['accountcode'];_0x1e35b1[_0x26903a][_0x26a3('0x1b')]=!![];_0x1e35b1[_0x26903a][_0x26a3('0x1c')]=_0x5bf41a[_0x26a3('0x17')];_0x1e35b1[_0x26903a][_0x26a3('0x1d')]=_[_0x26a3('0x16')](_0x5bf41a[_0x26a3('0x1d')])?util['format'](_0x26a3('0x1e'),_0x5bf41a[_0x26a3('0x17')]):_0x5bf41a[_0x26a3('0x1d')];if(_0x1e35b1[_0x26903a][_0x26a3('0x1f')]){_0x1e35b1[_0x26903a][_0x26a3('0x20')]=moment()[_0x26a3('0x21')](_0x26a3('0x22'));}if(_0x1e35b1[_0x26903a][_0x26a3('0x23')]){_0x1e35b1[_0x26903a]['queuecallerexitAt']=moment()[_0x26a3('0x21')](_0x26a3('0x22'));}RpcMemberReport[_0x26a3('0x18')](_0x1e35b1[_0x26903a]);}RpcVoiceQueueReport[_0x26a3('0x24')](_0x1e35b1[_0x26903a]);}};function extractCalleridNumber(_0x1f90eb){var _0x22d24e=_0x1f90eb[_0x26a3('0x25')](/<(.*?)>/);return _0x22d24e?_0x22d24e[0x1]:_0x1f90eb;}Report[_0x26a3('0x12')][_0x26a3('0x26')]=function(_0x2b02a0){_0x2b02a0[_0x26a3('0x27')]=_0x2b02a0['destination']||_0x2b02a0[_0x26a3('0x28')];if(_0x2b02a0[_0x26a3('0x29')]==_0x26a3('0x2a')){_0x2b02a0[_0x26a3('0x2b')]=_0x26a3('0x2c');_0x2b02a0['lastdata']=_0x2b02a0['queue'];if(_0x2b02a0[_0x26a3('0x2d')]==_0x26a3('0x2e')){_0x2b02a0[_0x26a3('0x15')]='';_0x2b02a0[_0x26a3('0x27')]=extractCalleridNumber(_0x2b02a0[_0x26a3('0x2f')]);}else if(_0x2b02a0[_0x26a3('0x2d')]==_0x26a3('0x30')){if(_0x2b02a0[_0x26a3('0x27')]==_0x26a3('0x31')){_0x2b02a0[_0x26a3('0x27')]=extractCalleridNumber(_0x2b02a0[_0x26a3('0x32')]);_0x2b02a0[_0x26a3('0x33')]=_0x2b02a0[_0x26a3('0x34')];_0x2b02a0[_0x26a3('0x35')]=[_0x2b02a0[_0x26a3('0x36')],_0x2b02a0[_0x26a3('0x36')]=_0x2b02a0[_0x26a3('0x35')]][0x0];_0x2b02a0[_0x26a3('0x2f')]=_0x2b02a0['calleridpreview'];}else{_0x2b02a0['destination']=_0x2b02a0[_0x26a3('0x33')];_0x2b02a0[_0x26a3('0x33')]=_0x2b02a0['originatecalleridnum'];if(_0x2b02a0[_0x26a3('0x37')]==_0x26a3('0x38')){_0x2b02a0[_0x26a3('0x15')]=_0x2b02a0[_0x26a3('0x1a')];}else{_0x2b02a0['accountcode']='';}}}}else{_0x2b02a0[_0x26a3('0x2f')]=util['format'](_0x26a3('0x39'),_0x2b02a0['calleridname'],_0x2b02a0['calleridnum']);}RpcVoiceCallReport[_0x26a3('0x24')](_0x2b02a0);if(_0x2b02a0[_0x26a3('0x3a')]){for(var _0x227c79=0x0;_0x227c79<_0x2b02a0['monitors'][_0x26a3('0x19')];_0x227c79+=0x1){_0x2b02a0[_0x26a3('0x3b')]=_0x2b02a0[_0x26a3('0x3c')][_0x227c79][_0x26a3('0x3d')];_0x2b02a0[_0x26a3('0x3e')]=_0x2b02a0[_0x26a3('0x3c')][_0x227c79]['createdAt'];if(_0x2b02a0['exten']==_0x26a3('0x31')){_0x2b02a0[_0x26a3('0x33')]=_0x2b02a0[_0x26a3('0x1a')];_0x2b02a0['calleridname']=_0x2b02a0['connectedlinename'];_0x2b02a0[_0x26a3('0x1a')]=_0x2b02a0['accountcode'];_0x2b02a0['connectedlinename']=_0x2b02a0[_0x26a3('0x3f')];_0x2b02a0[_0x26a3('0x28')]=_0x2b02a0[_0x26a3('0x34')];}else if(_0x2b02a0['exten']=='xcally-motion-dialer'){_0x2b02a0[_0x26a3('0x33')]=_0x2b02a0[_0x26a3('0x27')];_0x2b02a0['exten']=_0x2b02a0['originatecalleridnum'];}RpcVoiceRecording[_0x26a3('0x24')](_0x2b02a0);}}};Report[_0x26a3('0x12')][_0x26a3('0x40')]=function(_0x5f2c18){RpcVoiceAgentReport['create'](_0x5f2c18);};Report['prototype'][_0x26a3('0x41')]=function(_0x20a392){RpcVoiceDialReport[_0x26a3('0x24')](_0x20a392);var _0x4706de=undefined;var _0x3d4dc9=_0x20a392[_0x26a3('0x36')];if(_[_0x26a3('0x42')](_0x3d4dc9,_0x26a3('0x43'))){var _0x58f945=_0x3d4dc9[_0x26a3('0x44')](_0x3d4dc9['indexOf']('/')+0x1,_0x3d4dc9[_0x26a3('0x45')]('@'));_0x4706de=_[_0x26a3('0x14')](this[_0x26a3('0x10')],function(_0x38ec8e){return _0x38ec8e[_0x26a3('0x46')]==_0x58f945||_0x38ec8e[_0x26a3('0x47')]==_0x58f945||_0x38ec8e[_0x26a3('0x15')]==_0x58f945;});}else{var _0x58f945=_0x3d4dc9['substring'](_0x3d4dc9[_0x26a3('0x45')]('/')+0x1,_0x3d4dc9['lastIndexOf']('-'));_0x4706de=this[_0x26a3('0x13')](_0x58f945);}if(_0x4706de){_0x20a392['interface']=_[_0x26a3('0x16')](_0x4706de[_0x26a3('0x1d')])?util[_0x26a3('0x21')](_0x26a3('0x1e'),_0x4706de[_0x26a3('0x17')]):_0x4706de[_0x26a3('0x1d')];_0x20a392['membername']=_0x4706de[_0x26a3('0x17')];_0x20a392['accountcode']=_0x4706de['accountcode'];RpcMemberReport['voiceDialReport'](_0x20a392);}};Report[_0x26a3('0x12')]['blindTransfer']=function(_0x290a0d){RpcVoiceTransferReport[_0x26a3('0x48')](_0x290a0d);};Report[_0x26a3('0x12')]['attendedTransfer']=function(_0x30cadf){RpcVoiceTransferReport[_0x26a3('0x49')](_0x30cadf);};module[_0x26a3('0x4a')]=Report;
\ No newline at end of file
+var _0xcf42=['format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','voiceCallReport','destination','dialer','lastapplication','lastdata','queue','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','voiceDialReport','startsWith','Local','substring','indexOf','find','mobile','phone','lastIndexOf','blindTransfer','attendedTransfer','exports','bluebird','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','findAgent','accountcode','isNil','name','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','lastAssignedTo'];(function(_0xc53230,_0xed3df6){var _0x534236=function(_0x2d9196){while(--_0x2d9196){_0xc53230['push'](_0xc53230['shift']());}};_0x534236(++_0xed3df6);}(_0xcf42,0x1a6));var _0x2cf4=function(_0x15f95a,_0x239e8f){_0x15f95a=_0x15f95a-0x0;var _0x55eef1=_0xcf42[_0x15f95a];return _0x55eef1;};'use strict';var BPromise=require(_0x2cf4('0x0'));var _=require('lodash');var moment=require(_0x2cf4('0x1'));var util=require(_0x2cf4('0x2'));var logger=require(_0x2cf4('0x3'))(_0x2cf4('0x4'));var ami=require(_0x2cf4('0x5'));var RpcVoiceAgentReport=require(_0x2cf4('0x6'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x2cf4('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x2cf4('0x8'));var RpcVoiceTransferReport=require(_0x2cf4('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x2cf4('0xa'));var VoiceAgentReport=require(_0x2cf4('0xb'));var VoiceDialReport=require(_0x2cf4('0xc'));var UserReport=require(_0x2cf4('0xd'));function Report(_0x216ee3){this[_0x2cf4('0xe')]=_0x216ee3;this[_0x2cf4('0xf')]=_0x216ee3[_0x2cf4('0xf')];this[_0x2cf4('0x10')]=_0x216ee3[_0x2cf4('0x10')];}Report[_0x2cf4('0x11')]['sync']=function(_0x58df56){var _0x54cb1b=new VoiceQueueReport(this[_0x2cf4('0xe')]);var _0x1f827e=new VoiceAgentReport(this[_0x2cf4('0xe')]);var _0x4de555=new VoiceDialReport(this['realtime']);var _0x27bcbe=new VoiceCallReport(this[_0x2cf4('0xe')]);var _0x549708=new UserReport(this[_0x2cf4('0xe')]);};Report[_0x2cf4('0x11')][_0x2cf4('0x12')]=function(_0x3bb7e4){var _0x13c7c4=undefined;_0x13c7c4=_['find'](this[_0x2cf4('0xf')],function(_0x2fa198){return _0x2fa198[_0x2cf4('0x13')]==_0x3bb7e4||_0x2fa198['name']==_0x3bb7e4;});if(_[_0x2cf4('0x14')](_0x13c7c4)){var _0x326aea=_['find'](this[_0x2cf4('0x10')],function(_0x47238c){return _0x47238c['accountcode']==_0x3bb7e4||_0x47238c[_0x2cf4('0x15')]==_0x3bb7e4;});if(_0x326aea){_0x13c7c4=_['find'](this[_0x2cf4('0xf')],function(_0x6e1e53){return _0x6e1e53[_0x2cf4('0x16')]==util['format'](_0x2cf4('0x17'),_0x326aea[_0x2cf4('0x15')]);});}}return _0x13c7c4;};Report[_0x2cf4('0x11')][_0x2cf4('0x18')]=function(_0x45e301){for(var _0x5a3ed5=0x0;_0x5a3ed5<_0x45e301[_0x2cf4('0x19')];_0x5a3ed5+=0x1){var _0x360ea5=this['findAgent'](_0x45e301[_0x5a3ed5][_0x2cf4('0x1a')]);if(_0x360ea5){_0x45e301[_0x5a3ed5][_0x2cf4('0x13')]=_0x360ea5['accountcode'];_0x45e301[_0x5a3ed5]['assigned']=!![];_0x45e301[_0x5a3ed5][_0x2cf4('0x1b')]=_0x360ea5[_0x2cf4('0x15')];_0x45e301[_0x5a3ed5][_0x2cf4('0x16')]=_[_0x2cf4('0x14')](_0x360ea5['interface'])?util[_0x2cf4('0x1c')](_0x2cf4('0x17'),_0x360ea5[_0x2cf4('0x15')]):_0x360ea5[_0x2cf4('0x16')];if(_0x45e301[_0x5a3ed5][_0x2cf4('0x1d')]){_0x45e301[_0x5a3ed5][_0x2cf4('0x1e')]=moment()[_0x2cf4('0x1c')](_0x2cf4('0x1f'));}if(_0x45e301[_0x5a3ed5][_0x2cf4('0x20')]){_0x45e301[_0x5a3ed5]['queuecallerexitAt']=moment()['format'](_0x2cf4('0x1f'));}RpcMemberReport['voiceQueueReport'](_0x45e301[_0x5a3ed5]);}RpcVoiceQueueReport[_0x2cf4('0x21')](_0x45e301[_0x5a3ed5]);}};function extractCalleridNumber(_0x45c28a){var _0x24dd7e=_0x45c28a[_0x2cf4('0x22')](/<(.*?)>/);return _0x24dd7e?_0x24dd7e[0x1]:_0x45c28a;}Report[_0x2cf4('0x11')][_0x2cf4('0x23')]=function(_0x1e88b2){_0x1e88b2[_0x2cf4('0x24')]=_0x1e88b2[_0x2cf4('0x24')]||_0x1e88b2['exten'];if(_0x1e88b2['type']==_0x2cf4('0x25')){_0x1e88b2[_0x2cf4('0x26')]='queue';_0x1e88b2[_0x2cf4('0x27')]=_0x1e88b2[_0x2cf4('0x28')];if(_0x1e88b2['context']==_0x2cf4('0x29')){_0x1e88b2[_0x2cf4('0x13')]='';_0x1e88b2[_0x2cf4('0x24')]=extractCalleridNumber(_0x1e88b2[_0x2cf4('0x2a')]);}else if(_0x1e88b2[_0x2cf4('0x2b')]==_0x2cf4('0x2c')){if(_0x1e88b2[_0x2cf4('0x24')]==_0x2cf4('0x2d')){_0x1e88b2['destination']=extractCalleridNumber(_0x1e88b2[_0x2cf4('0x2e')]);_0x1e88b2[_0x2cf4('0x2f')]=_0x1e88b2[_0x2cf4('0x30')];_0x1e88b2['destinationchannel']=[_0x1e88b2[_0x2cf4('0x31')],_0x1e88b2[_0x2cf4('0x31')]=_0x1e88b2['destinationchannel']][0x0];_0x1e88b2[_0x2cf4('0x2a')]=_0x1e88b2[_0x2cf4('0x2e')];}else{_0x1e88b2['destination']=_0x1e88b2[_0x2cf4('0x2f')];_0x1e88b2[_0x2cf4('0x2f')]=_0x1e88b2[_0x2cf4('0x30')];if(_0x1e88b2[_0x2cf4('0x32')]==_0x2cf4('0x33')){_0x1e88b2[_0x2cf4('0x13')]=_0x1e88b2[_0x2cf4('0x1a')];}else{_0x1e88b2[_0x2cf4('0x13')]='';}}}}else{_0x1e88b2['callerid']=util[_0x2cf4('0x1c')](_0x2cf4('0x34'),_0x1e88b2[_0x2cf4('0x35')],_0x1e88b2[_0x2cf4('0x2f')]);}RpcVoiceCallReport[_0x2cf4('0x21')](_0x1e88b2);if(_0x1e88b2[_0x2cf4('0x36')]){for(var _0x26f671=0x0;_0x26f671<_0x1e88b2[_0x2cf4('0x37')][_0x2cf4('0x19')];_0x26f671+=0x1){_0x1e88b2[_0x2cf4('0x38')]=_0x1e88b2['monitors'][_0x26f671][_0x2cf4('0x39')];_0x1e88b2[_0x2cf4('0x3a')]=_0x1e88b2[_0x2cf4('0x37')][_0x26f671][_0x2cf4('0x3a')];if(_0x1e88b2[_0x2cf4('0x3b')]==_0x2cf4('0x2d')){_0x1e88b2['calleridnum']=_0x1e88b2[_0x2cf4('0x1a')];_0x1e88b2[_0x2cf4('0x35')]=_0x1e88b2[_0x2cf4('0x3c')];_0x1e88b2[_0x2cf4('0x1a')]=_0x1e88b2[_0x2cf4('0x13')];_0x1e88b2[_0x2cf4('0x3c')]=_0x1e88b2[_0x2cf4('0x3d')];_0x1e88b2[_0x2cf4('0x3b')]=_0x1e88b2[_0x2cf4('0x30')];}else if(_0x1e88b2[_0x2cf4('0x3b')]==_0x2cf4('0x3e')){_0x1e88b2[_0x2cf4('0x2f')]=_0x1e88b2[_0x2cf4('0x24')];_0x1e88b2['exten']=_0x1e88b2['originatecalleridnum'];}RpcVoiceRecording[_0x2cf4('0x21')](_0x1e88b2);}}};Report[_0x2cf4('0x11')]['voiceAgentReport']=function(_0x3bf44e){RpcVoiceAgentReport[_0x2cf4('0x21')](_0x3bf44e);};Report['prototype'][_0x2cf4('0x3f')]=function(_0x2aba02){RpcVoiceDialReport[_0x2cf4('0x21')](_0x2aba02);var _0x4961e5=undefined;var _0x16c042=_0x2aba02['channel'];if(_[_0x2cf4('0x40')](_0x16c042,_0x2cf4('0x41'))){var _0x4a763a=_0x16c042[_0x2cf4('0x42')](_0x16c042[_0x2cf4('0x43')]('/')+0x1,_0x16c042[_0x2cf4('0x43')]('@'));_0x4961e5=_[_0x2cf4('0x44')](this[_0x2cf4('0xf')],function(_0x4fa54e){return _0x4fa54e[_0x2cf4('0x45')]==_0x4a763a||_0x4fa54e[_0x2cf4('0x46')]==_0x4a763a||_0x4fa54e[_0x2cf4('0x13')]==_0x4a763a;});}else{var _0x4a763a=_0x16c042[_0x2cf4('0x42')](_0x16c042[_0x2cf4('0x43')]('/')+0x1,_0x16c042[_0x2cf4('0x47')]('-'));_0x4961e5=this[_0x2cf4('0x12')](_0x4a763a);}if(_0x4961e5){_0x2aba02[_0x2cf4('0x16')]=_['isNil'](_0x4961e5['interface'])?util[_0x2cf4('0x1c')](_0x2cf4('0x17'),_0x4961e5[_0x2cf4('0x15')]):_0x4961e5[_0x2cf4('0x16')];_0x2aba02['membername']=_0x4961e5[_0x2cf4('0x15')];_0x2aba02[_0x2cf4('0x13')]=_0x4961e5[_0x2cf4('0x13')];RpcMemberReport[_0x2cf4('0x3f')](_0x2aba02);}};Report[_0x2cf4('0x11')][_0x2cf4('0x48')]=function(_0x3d51f9){RpcVoiceTransferReport[_0x2cf4('0x48')](_0x3d51f9);};Report[_0x2cf4('0x11')][_0x2cf4('0x49')]=function(_0x4afe9b){RpcVoiceTransferReport[_0x2cf4('0x49')](_0x4afe9b);};module[_0x2cf4('0x4a')]=Report;
\ No newline at end of file
index 7dd4530..a812ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6de2=['../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','actionSipShowRegistry','prototype','isNotNull','emit','find','stateRegistry','omit','event','actionid','username','state','format','trunk:%s','name','error','[syncRegistry][UserReport]','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','Local','substring','indexOf','mobile','phone','[syncDeviceState][UserReport]','peer','registered','address','status','trunk:save','exports','lodash','moment','bluebird','ioredis'];(function(_0x48ede2,_0x563842){var _0xeea134=function(_0x5990d5){while(--_0x5990d5){_0x48ede2['push'](_0x48ede2['shift']());}};_0xeea134(++_0x563842);}(_0x6de2,0x1ca));var _0x26de=function(_0x28c7c5,_0x1576b9){_0x28c7c5=_0x28c7c5-0x0;var _0x5930c0=_0x6de2[_0x28c7c5];return _0x5930c0;};'use strict';var _=require(_0x26de('0x0'));var moment=require(_0x26de('0x1'));var BPromise=require(_0x26de('0x2'));var util=require('util');var Redis=require(_0x26de('0x3'));var config=require(_0x26de('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x26de('0x5'));config[_0x26de('0x6')]=_[_0x26de('0x7')](config[_0x26de('0x6')],{'host':_0x26de('0x8'),'port':0x18eb});var io=require(_0x26de('0x9'))(new Redis(config[_0x26de('0x6')]));function UserReport(_0x57405f){this[_0x26de('0xa')]=_0x57405f[_0x26de('0xa')];this[_0x26de('0xb')]=_0x57405f[_0x26de('0xb')];this['telephones']=_0x57405f[_0x26de('0xc')];ami['on'](_0x26de('0xd'),this[_0x26de('0xe')][_0x26de('0xf')](this));ami['on'](_0x26de('0x10'),this[_0x26de('0xe')][_0x26de('0xf')](this));ami['on'](_0x26de('0x11'),this[_0x26de('0x12')]['bind'](this));ami['on'](_0x26de('0x13'),this[_0x26de('0x14')][_0x26de('0xf')](this));this[_0x26de('0x15')]();return BPromise[_0x26de('0x16')]()['then'](ami['actionSipShowRegistry']())[_0x26de('0x17')](ami[_0x26de('0x18')]())[_0x26de('0x17')](ami[_0x26de('0x19')]())[_0x26de('0x1a')](loggerCatch(_0x26de('0x1b')));}function loggerCatch(_0x401d7f){return function(_0x1b3d64){logger['error'](_0x401d7f,util[_0x26de('0x1c')](_0x1b3d64,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0x26de('0x15')]=function(){setInterval(function(){BPromise[_0x26de('0x16')]()['then'](ami[_0x26de('0x1d')]())[_0x26de('0x17')](ami['actionDeviceStateList']())[_0x26de('0x17')](ami[_0x26de('0x19')]())['catch'](loggerCatch(_0x26de('0x1b')));},0x32c8);};UserReport[_0x26de('0x1e')][_0x26de('0x1f')]=function(_0x1230ef){return _0x1230ef!==null&&!_['isUndefined'](_0x1230ef);};UserReport['prototype'][_0x26de('0x20')]=function(_0x1ffdcd,_0x5bda00,_0x4ed244){io['to'](_0x1ffdcd)['emit'](_0x5bda00,_0x4ed244);};UserReport[_0x26de('0x1e')][_0x26de('0xe')]=function(_0x307f74){try{if(this[_0x26de('0x1f')](_0x307f74)){var _0x3c7469=_[_0x26de('0x21')](this[_0x26de('0xa')],{'registry':_0x307f74['username']});if(_0x3c7469){_0x307f74[_0x26de('0x22')]=_0x307f74['state'];_['merge'](_0x3c7469,_[_0x26de('0x23')](_0x307f74,[_0x26de('0x24'),_0x26de('0x25'),_0x26de('0x26'),_0x26de('0x27')]));this[_0x26de('0x20')](util[_0x26de('0x28')](_0x26de('0x29'),_0x3c7469[_0x26de('0x2a')]),'trunk:save',_0x3c7469);}}}catch(_0x17a095){logger[_0x26de('0x2b')](_0x26de('0x2c'),util[_0x26de('0x1c')](_0x17a095,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x26de('0x12')]=function(_0x2af5d4){try{if(this[_0x26de('0x1f')](_0x2af5d4)){if(this[_0x26de('0xb')][_0x2af5d4[_0x26de('0x2d')]]){if(!this[_0x26de('0xb')][_0x2af5d4['device']][_0x26de('0x2e')]||_0x2af5d4['state']['toLowerCase']()==_0x26de('0x2f')){this[_0x26de('0xb')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x2e')]=![];if(this['agents'][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x27')]!==_0x2af5d4[_0x26de('0x27')][_0x26de('0x30')]()){this[_0x26de('0xb')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x31')]=_[_0x26de('0x32')](moment()['format']('x'));}this[_0x26de('0xb')][_0x2af5d4['device']][_0x26de('0x27')]=_0x2af5d4['state'][_0x26de('0x30')]();this[_0x26de('0xb')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x33')](_0x2af5d4);}}else if(this[_0x26de('0xc')][_0x2af5d4['device']]){if(this[_0x26de('0xc')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x27')]!==_0x2af5d4['state'][_0x26de('0x30')]()){this[_0x26de('0xc')][_0x2af5d4['device']]['stateTime']=_[_0x26de('0x32')](moment()[_0x26de('0x28')]('x'));}this[_0x26de('0xc')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x27')]=_0x2af5d4[_0x26de('0x27')]['toLowerCase']();this['emit'](util[_0x26de('0x28')](_0x26de('0x34'),this['telephones'][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x2a')]),_0x26de('0x35'),this['telephones'][_0x2af5d4[_0x26de('0x2d')]]);}else if(this['trunks'][_0x2af5d4['device']]){if(this[_0x26de('0xa')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x27')]!==_0x2af5d4[_0x26de('0x27')][_0x26de('0x30')]()){this[_0x26de('0xa')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x31')]=_[_0x26de('0x32')](moment()[_0x26de('0x28')]('x'));}this[_0x26de('0xa')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x27')]=_0x2af5d4[_0x26de('0x27')]['toLowerCase']();this[_0x26de('0x20')](util['format'](_0x26de('0x29'),this[_0x26de('0xa')][_0x2af5d4[_0x26de('0x2d')]][_0x26de('0x2a')]),'trunk:save',this[_0x26de('0xa')][_0x2af5d4[_0x26de('0x2d')]]);}else if(_['startsWith'](_0x2af5d4[_0x26de('0x2d')],'Queue')){}else if(_['startsWith'](_0x2af5d4[_0x26de('0x2d')],_0x26de('0x36'))){var _0x1d6be0=_0x2af5d4[_0x26de('0x2d')];var _0x59d620=_0x1d6be0[_0x26de('0x37')](_0x1d6be0[_0x26de('0x38')]('/')+0x1,_0x1d6be0[_0x26de('0x38')]('@'));var _0x410313=_['find'](this[_0x26de('0xb')],function(_0x3d92e4){return _0x3d92e4[_0x26de('0x39')]==_0x59d620||_0x3d92e4[_0x26de('0x3a')]==_0x59d620||_0x3d92e4['accountcode']==_0x59d620;});if(_0x410313){if(_0x410313[_0x26de('0x27')]!==_0x2af5d4[_0x26de('0x27')]['toLowerCase']()){_0x410313['stateTime']=_[_0x26de('0x32')](moment()[_0x26de('0x28')]('x'));}_0x410313['state']=_0x2af5d4['state'][_0x26de('0x30')]();_0x410313['local']=!![];_0x410313[_0x26de('0x33')](_0x2af5d4);}}else{}}}catch(_0x4cb6e5){logger[_0x26de('0x2b')](_0x26de('0x3b'),util[_0x26de('0x1c')](_0x4cb6e5,{'showHidden':![],'depth':null}));}};UserReport[_0x26de('0x1e')][_0x26de('0x14')]=function(_0x4462c7){try{if(this[_0x26de('0x1f')](_0x4462c7)&&this[_0x26de('0x1f')](_0x4462c7[_0x26de('0x13')])){if(this['agents'][_0x4462c7[_0x26de('0x3c')]]){if(!this[_0x26de('0xb')][_0x4462c7[_0x26de('0x3c')]][_0x26de('0x2e')]||_0x4462c7['peerstatus'][_0x26de('0x30')]()==_0x26de('0x3d')){this[_0x26de('0xb')][_0x4462c7[_0x26de('0x3c')]][_0x26de('0x2e')]=![];this[_0x26de('0xb')][_0x4462c7[_0x26de('0x3c')]]['status']=_0x4462c7[_0x26de('0x13')][_0x26de('0x30')]();this['agents'][_0x4462c7[_0x26de('0x3c')]]['address']=_0x4462c7['address'];this[_0x26de('0xb')][_0x4462c7[_0x26de('0x3c')]][_0x26de('0x33')](_0x4462c7);}}else if(this['telephones'][_0x4462c7[_0x26de('0x3c')]]){this[_0x26de('0xc')][_0x4462c7[_0x26de('0x3c')]]['status']=_0x4462c7[_0x26de('0x13')][_0x26de('0x30')]();this[_0x26de('0xc')][_0x4462c7[_0x26de('0x3c')]][_0x26de('0x3e')]=_0x4462c7[_0x26de('0x3e')];this[_0x26de('0x20')](util[_0x26de('0x28')]('telephone:%s',this[_0x26de('0xc')][_0x4462c7[_0x26de('0x3c')]][_0x26de('0x2a')]),_0x26de('0x35'),this[_0x26de('0xc')][_0x4462c7[_0x26de('0x3c')]]);}else if(this[_0x26de('0xa')][_0x4462c7[_0x26de('0x3c')]]){this[_0x26de('0xa')][_0x4462c7[_0x26de('0x3c')]][_0x26de('0x3f')]=_0x4462c7[_0x26de('0x13')][_0x26de('0x30')]();this[_0x26de('0xa')][_0x4462c7['peer']][_0x26de('0x3e')]=_0x4462c7[_0x26de('0x3e')];this['emit'](util[_0x26de('0x28')](_0x26de('0x29'),this[_0x26de('0xa')][_0x4462c7[_0x26de('0x3c')]][_0x26de('0x2a')]),_0x26de('0x40'),this[_0x26de('0xa')][_0x4462c7['peer']]);}else{}}}catch(_0x481c39){logger[_0x26de('0x2b')]('[syncPeerStatus][UserReport]',util[_0x26de('0x1c')](_0x481c39,{'showHidden':![],'depth':null}));}};module[_0x26de('0x41')]=UserReport;
\ No newline at end of file
+var _0xf1f9=['bind','devicestatechange','syncDeviceState','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','actionDeviceStateList','isNotNull','isUndefined','emit','find','stateRegistry','state','merge','omit','actionid','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','toLowerCase','local','stateTime','updateStatusRealtime','telephone:%s','telephone:save','toNumber','Queue','Local','substring','indexOf','mobile','phone','accountcode','peerstatus','peer','registered','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','registry'];(function(_0x513f71,_0x1a345a){var _0x8b26a7=function(_0xfe9d63){while(--_0xfe9d63){_0x513f71['push'](_0x513f71['shift']());}};_0x8b26a7(++_0x1a345a);}(_0xf1f9,0xfb));var _0x9f1f=function(_0x2f3fe9,_0x4cfbd8){_0x2f3fe9=_0x2f3fe9-0x0;var _0xdf6fa0=_0xf1f9[_0x2f3fe9];return _0xdf6fa0;};'use strict';var _=require(_0x9f1f('0x0'));var moment=require(_0x9f1f('0x1'));var BPromise=require(_0x9f1f('0x2'));var util=require('util');var Redis=require(_0x9f1f('0x3'));var config=require(_0x9f1f('0x4'));var logger=require(_0x9f1f('0x5'))(_0x9f1f('0x6'));var ami=require(_0x9f1f('0x7'));config[_0x9f1f('0x8')]=_[_0x9f1f('0x9')](config[_0x9f1f('0x8')],{'host':_0x9f1f('0xa'),'port':0x18eb});var io=require(_0x9f1f('0xb'))(new Redis(config[_0x9f1f('0x8')]));function UserReport(_0x42af4b){this[_0x9f1f('0xc')]=_0x42af4b['trunks'];this['agents']=_0x42af4b[_0x9f1f('0xd')];this[_0x9f1f('0xe')]=_0x42af4b[_0x9f1f('0xe')];ami['on']('registryentry',this[_0x9f1f('0xf')]['bind'](this));ami['on'](_0x9f1f('0x10'),this[_0x9f1f('0xf')][_0x9f1f('0x11')](this));ami['on'](_0x9f1f('0x12'),this[_0x9f1f('0x13')][_0x9f1f('0x11')](this));ami['on']('peerstatus',this[_0x9f1f('0x14')][_0x9f1f('0x11')](this));this[_0x9f1f('0x15')]();return BPromise[_0x9f1f('0x16')]()[_0x9f1f('0x17')](ami[_0x9f1f('0x18')]())['then'](ami['actionDeviceStateList']())['then'](ami[_0x9f1f('0x19')]())[_0x9f1f('0x1a')](loggerCatch(_0x9f1f('0x1b')));}function loggerCatch(_0x2125e1){return function(_0x53532b){logger[_0x9f1f('0x1c')](_0x2125e1,util[_0x9f1f('0x1d')](_0x53532b,{'showHidden':![],'depth':null}));};}UserReport[_0x9f1f('0x1e')][_0x9f1f('0x15')]=function(){setInterval(function(){BPromise[_0x9f1f('0x16')]()[_0x9f1f('0x17')](ami[_0x9f1f('0x18')]())[_0x9f1f('0x17')](ami[_0x9f1f('0x1f')]())[_0x9f1f('0x17')](ami[_0x9f1f('0x19')]())[_0x9f1f('0x1a')](loggerCatch(_0x9f1f('0x1b')));},0x32c8);};UserReport['prototype'][_0x9f1f('0x20')]=function(_0x5f3d87){return _0x5f3d87!==null&&!_[_0x9f1f('0x21')](_0x5f3d87);};UserReport['prototype'][_0x9f1f('0x22')]=function(_0x5262e3,_0x509e86,_0x59adc1){io['to'](_0x5262e3)[_0x9f1f('0x22')](_0x509e86,_0x59adc1);};UserReport['prototype'][_0x9f1f('0xf')]=function(_0x23e33e){try{if(this[_0x9f1f('0x20')](_0x23e33e)){var _0x43e7e=_[_0x9f1f('0x23')](this['trunks'],{'registry':_0x23e33e['username']});if(_0x43e7e){_0x23e33e[_0x9f1f('0x24')]=_0x23e33e[_0x9f1f('0x25')];_[_0x9f1f('0x26')](_0x43e7e,_[_0x9f1f('0x27')](_0x23e33e,['event',_0x9f1f('0x28'),'username','state']));this[_0x9f1f('0x22')](util[_0x9f1f('0x29')](_0x9f1f('0x2a'),_0x43e7e[_0x9f1f('0x2b')]),_0x9f1f('0x2c'),_0x43e7e);}}}catch(_0x98dda3){logger[_0x9f1f('0x1c')](_0x9f1f('0x2d'),util[_0x9f1f('0x1d')](_0x98dda3,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x9f1f('0x13')]=function(_0x22e0ca){try{if(this[_0x9f1f('0x20')](_0x22e0ca)){if(this[_0x9f1f('0xd')][_0x22e0ca[_0x9f1f('0x2e')]]){if(!this[_0x9f1f('0xd')][_0x22e0ca[_0x9f1f('0x2e')]]['local']||_0x22e0ca['state'][_0x9f1f('0x2f')]()=='inuse'){this['agents'][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x30')]=![];if(this[_0x9f1f('0xd')][_0x22e0ca['device']][_0x9f1f('0x25')]!==_0x22e0ca[_0x9f1f('0x25')][_0x9f1f('0x2f')]()){this['agents'][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x31')]=_['toNumber'](moment()[_0x9f1f('0x29')]('x'));}this[_0x9f1f('0xd')][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x25')]=_0x22e0ca[_0x9f1f('0x25')][_0x9f1f('0x2f')]();this[_0x9f1f('0xd')][_0x22e0ca['device']][_0x9f1f('0x32')](_0x22e0ca);}}else if(this[_0x9f1f('0xe')][_0x22e0ca[_0x9f1f('0x2e')]]){if(this['telephones'][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x25')]!==_0x22e0ca['state'][_0x9f1f('0x2f')]()){this[_0x9f1f('0xe')][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x31')]=_['toNumber'](moment()[_0x9f1f('0x29')]('x'));}this[_0x9f1f('0xe')][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x25')]=_0x22e0ca[_0x9f1f('0x25')]['toLowerCase']();this[_0x9f1f('0x22')](util[_0x9f1f('0x29')](_0x9f1f('0x33'),this[_0x9f1f('0xe')][_0x22e0ca['device']][_0x9f1f('0x2b')]),_0x9f1f('0x34'),this[_0x9f1f('0xe')][_0x22e0ca[_0x9f1f('0x2e')]]);}else if(this[_0x9f1f('0xc')][_0x22e0ca['device']]){if(this[_0x9f1f('0xc')][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x25')]!==_0x22e0ca['state'][_0x9f1f('0x2f')]()){this['trunks'][_0x22e0ca['device']]['stateTime']=_[_0x9f1f('0x35')](moment()[_0x9f1f('0x29')]('x'));}this[_0x9f1f('0xc')][_0x22e0ca[_0x9f1f('0x2e')]][_0x9f1f('0x25')]=_0x22e0ca['state'][_0x9f1f('0x2f')]();this[_0x9f1f('0x22')](util['format']('trunk:%s',this['trunks'][_0x22e0ca[_0x9f1f('0x2e')]]['name']),_0x9f1f('0x2c'),this[_0x9f1f('0xc')][_0x22e0ca['device']]);}else if(_['startsWith'](_0x22e0ca[_0x9f1f('0x2e')],_0x9f1f('0x36'))){}else if(_['startsWith'](_0x22e0ca[_0x9f1f('0x2e')],_0x9f1f('0x37'))){var _0x40b79e=_0x22e0ca['device'];var _0x207992=_0x40b79e[_0x9f1f('0x38')](_0x40b79e[_0x9f1f('0x39')]('/')+0x1,_0x40b79e[_0x9f1f('0x39')]('@'));var _0xa4e121=_[_0x9f1f('0x23')](this['agents'],function(_0x432fcd){return _0x432fcd[_0x9f1f('0x3a')]==_0x207992||_0x432fcd[_0x9f1f('0x3b')]==_0x207992||_0x432fcd[_0x9f1f('0x3c')]==_0x207992;});if(_0xa4e121){if(_0xa4e121[_0x9f1f('0x25')]!==_0x22e0ca[_0x9f1f('0x25')][_0x9f1f('0x2f')]()){_0xa4e121[_0x9f1f('0x31')]=_[_0x9f1f('0x35')](moment()['format']('x'));}_0xa4e121[_0x9f1f('0x25')]=_0x22e0ca['state'][_0x9f1f('0x2f')]();_0xa4e121[_0x9f1f('0x30')]=!![];_0xa4e121[_0x9f1f('0x32')](_0x22e0ca);}}else{}}}catch(_0x44c387){logger[_0x9f1f('0x1c')]('[syncDeviceState][UserReport]',util[_0x9f1f('0x1d')](_0x44c387,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x9f1f('0x14')]=function(_0x3e5341){try{if(this[_0x9f1f('0x20')](_0x3e5341)&&this['isNotNull'](_0x3e5341[_0x9f1f('0x3d')])){if(this[_0x9f1f('0xd')][_0x3e5341['peer']]){if(!this[_0x9f1f('0xd')][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x30')]||_0x3e5341[_0x9f1f('0x3d')][_0x9f1f('0x2f')]()==_0x9f1f('0x3f')){this[_0x9f1f('0xd')][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x30')]=![];this[_0x9f1f('0xd')][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x40')]=_0x3e5341[_0x9f1f('0x3d')]['toLowerCase']();this['agents'][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x41')]=_0x3e5341[_0x9f1f('0x41')];this[_0x9f1f('0xd')][_0x3e5341['peer']][_0x9f1f('0x32')](_0x3e5341);}}else if(this[_0x9f1f('0xe')][_0x3e5341[_0x9f1f('0x3e')]]){this['telephones'][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x40')]=_0x3e5341[_0x9f1f('0x3d')]['toLowerCase']();this[_0x9f1f('0xe')][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x41')]=_0x3e5341[_0x9f1f('0x41')];this[_0x9f1f('0x22')](util[_0x9f1f('0x29')](_0x9f1f('0x33'),this[_0x9f1f('0xe')][_0x3e5341['peer']][_0x9f1f('0x2b')]),_0x9f1f('0x34'),this[_0x9f1f('0xe')][_0x3e5341[_0x9f1f('0x3e')]]);}else if(this[_0x9f1f('0xc')][_0x3e5341[_0x9f1f('0x3e')]]){this['trunks'][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x40')]=_0x3e5341[_0x9f1f('0x3d')][_0x9f1f('0x2f')]();this[_0x9f1f('0xc')][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x41')]=_0x3e5341[_0x9f1f('0x41')];this[_0x9f1f('0x22')](util[_0x9f1f('0x29')](_0x9f1f('0x2a'),this[_0x9f1f('0xc')][_0x3e5341[_0x9f1f('0x3e')]][_0x9f1f('0x2b')]),_0x9f1f('0x2c'),this[_0x9f1f('0xc')][_0x3e5341['peer']]);}else{}}}catch(_0x4031a7){logger[_0x9f1f('0x1c')](_0x9f1f('0x42'),util[_0x9f1f('0x1d')](_0x4031a7,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
index 6dcb857..12895e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bf0=['diffTime','diff','interface','isNil','assign','emit','user:save','YYYY-MM-DD\x20HH:mm:ss','destcalleridnum','destcalleridname','accountcode','channel','destchannel','uniqueid','destuniqueid','context','priority','queue','type','inbound','agent','called','user:%s','user:called','log','CALLED','stack','syncAgentConnect','ringtime','agentconnectAt','agentcalledAt','custom:agentconnect','user:agentconnect','CONNECT','error','find','onhold','updateStatusRealtime','rejected','agentringnoanswerAt','custom:agentringnoanswer','originalposition','abandoned','custom:agentqueuecallerabandon','CALLERABANDON','talktime','reason','transfer','complete','acw','acwTimeout','agentcompleteAt','COMPLETE','cause','answered_elsewhere','custom:agentansweredelsewhere','custom:agentcomplete','user:agentcomplete','HANGUP','custom:voiceAgentReport','cause-txt','recalculate','syncAttendedTransfer','origtransfererchannel','ATTENDED','secondtransfererexten','secondtransferercontext','transfertargetchannel','transfererchannel','BLIND','extension','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','memberrealtime','keys','variable','includes','exports','moment','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','socket.io-emitter','voiceQueues','agents','channels','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','attendedtransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','prototype','info','format','%s|%s','membername','exten','calleridnum','addTime','add','seconds'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bf0,0x1e4));var _0x01bf=function(_0x34dcef,_0x3fbfd4){_0x34dcef=_0x34dcef-0x0;var _0xfad1bc=_0x1bf0[_0x34dcef];return _0xfad1bc;};'use strict';var _=require('lodash');var moment=require(_0x01bf('0x0'));var util=require(_0x01bf('0x1'));var Redis=require(_0x01bf('0x2'));var config=require(_0x01bf('0x3'));var logger=require('../../../config/logger')(_0x01bf('0x4'));var ami=require(_0x01bf('0x5'));config['redis']=_[_0x01bf('0x6')](config[_0x01bf('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x01bf('0x8'))(new Redis(config[_0x01bf('0x7')]));function VoiceAgentReport(_0x3c59fa){this[_0x01bf('0x9')]=_0x3c59fa[_0x01bf('0x9')];this[_0x01bf('0xa')]=_0x3c59fa[_0x01bf('0xa')];this[_0x01bf('0xb')]={};this[_0x01bf('0xc')]={};ami['on'](_0x01bf('0xd'),this[_0x01bf('0xe')][_0x01bf('0xf')](this));ami['on'](_0x01bf('0x10'),this['syncAgentConnect'][_0x01bf('0xf')](this));ami['on'](_0x01bf('0x11'),this[_0x01bf('0x12')][_0x01bf('0xf')](this));ami['on']('queuecallerabandon',this[_0x01bf('0x13')][_0x01bf('0xf')](this));ami['on'](_0x01bf('0x14'),this[_0x01bf('0x15')][_0x01bf('0xf')](this));ami['on']('varset',this[_0x01bf('0x16')][_0x01bf('0xf')](this));ami['on'](_0x01bf('0x17'),this[_0x01bf('0x18')]['bind'](this));ami['on'](_0x01bf('0x19'),this['syncAttendedTransfer'][_0x01bf('0xf')](this));ami['on'](_0x01bf('0x1a'),this[_0x01bf('0x1b')][_0x01bf('0xf')](this));ami['on'](_0x01bf('0x1c'),this['syncMusicOnHoldStart'][_0x01bf('0xf')](this));ami['on'](_0x01bf('0x1d'),this['syncMusicOnHoldStop'][_0x01bf('0xf')](this));}VoiceAgentReport[_0x01bf('0x1e')]['log']=function(_0x50df6c,_0x18e7b7){logger[_0x01bf('0x1f')](util[_0x01bf('0x20')](_0x01bf('0x21'),_0x50df6c,[_0x18e7b7['uniqueid'],_0x18e7b7[_0x01bf('0x22')],_0x18e7b7['queue'],_0x18e7b7[_0x01bf('0x23')],_0x18e7b7[_0x01bf('0x24')]]['join']('|')));};VoiceAgentReport[_0x01bf('0x1e')][_0x01bf('0x25')]=function(_0x3f249a,_0x4ec3e3){return moment(_0x3f249a)[_0x01bf('0x26')](_0x4ec3e3,_0x01bf('0x27'))[_0x01bf('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};VoiceAgentReport[_0x01bf('0x1e')][_0x01bf('0x28')]=function(_0x1bbf1d,_0x192c33){return moment(_0x1bbf1d)[_0x01bf('0x29')](moment(_0x192c33),'seconds');};VoiceAgentReport[_0x01bf('0x1e')][_0x01bf('0xe')]=function(_0x210f57){try{var _0x4b6a77=this['agents'][_0x210f57[_0x01bf('0x2a')]];if(!_[_0x01bf('0x2b')](_0x4b6a77)){_0x4b6a77=_[_0x01bf('0x2c')](_0x4b6a77,{'queue':_0x210f57['queue'],'destconnectedlinenum':_0x210f57['calleridnum']});io[_0x01bf('0x2d')](_0x01bf('0x2e'),_0x4b6a77);}var _0x22c16d=this[_0x01bf('0xb')][_0x210f57['destchannel']]={'agentcalledAt':moment()[_0x01bf('0x20')](_0x01bf('0x2f')),'calleridnum':_0x210f57[_0x01bf('0x24')],'calleridname':_0x210f57['calleridname'],'connectedlinenum':_0x210f57[_0x01bf('0x30')],'connectedlinename':_0x210f57[_0x01bf('0x31')],'accountcode':_0x210f57[_0x01bf('0x32')],'destaccountcode':_0x210f57['destaccountcode'],'channel':_0x210f57[_0x01bf('0x33')],'destchannel':_0x210f57[_0x01bf('0x34')],'uniqueid':_0x210f57[_0x01bf('0x35')],'destuniqueid':_0x210f57[_0x01bf('0x36')],'context':_0x210f57[_0x01bf('0x37')],'exten':_0x210f57['exten'],'priority':_0x210f57[_0x01bf('0x38')],'queue':_0x210f57['queue'],'type':this['voiceQueues'][_0x210f57[_0x01bf('0x39')]]?this[_0x01bf('0x9')][_0x210f57['queue']][_0x01bf('0x3a')]||'inbound':_0x01bf('0x3b'),'interface':_0x210f57['interface'],'membername':_0x210f57[_0x01bf('0x22')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':_0x01bf('0x3c'),'transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this[_0x01bf('0xa')][_0x210f57[_0x01bf('0x2a')]]?this[_0x01bf('0xa')][_0x210f57['interface']]['id']:null,'lastevent':_0x01bf('0x3d'),'agentacw':![],'acwtime':0x0,'variables':this[_0x01bf('0xc')][_0x210f57['channel']]?this[_0x01bf('0xc')][_0x210f57['channel']]:{}};ami[_0x01bf('0x2d')]('custom:agentcalled',_0x22c16d);io['to'](util[_0x01bf('0x20')](_0x01bf('0x3e'),_0x22c16d[_0x01bf('0x22')]))[_0x01bf('0x2d')](_0x01bf('0x3f'),_0x22c16d);this[_0x01bf('0x40')](_0x01bf('0x41'),this[_0x01bf('0xb')][_0x210f57[_0x01bf('0x34')]]);}catch(_0x49501b){logger['error'](_0x49501b[_0x01bf('0x42')]);}};VoiceAgentReport['prototype'][_0x01bf('0x43')]=function(_0x1165c1){try{var _0x5731d4=this[_0x01bf('0xb')][_0x1165c1[_0x01bf('0x34')]];if(!_[_0x01bf('0x2b')](_0x5731d4)){_0x5731d4=_[_0x01bf('0x2c')](_0x5731d4,{'holdtime':parseInt(_0x1165c1['holdtime'],0xa),'ringtime':parseInt(_0x1165c1[_0x01bf('0x44')],0xa),'agentconnect':!![],'lastevent':'connect'});_0x5731d4[_0x01bf('0x45')]=this['addTime'](_0x5731d4[_0x01bf('0x46')],_0x5731d4[_0x01bf('0x44')]);ami[_0x01bf('0x2d')](_0x01bf('0x47'),_0x5731d4);io['to'](util[_0x01bf('0x20')](_0x01bf('0x3e'),_0x5731d4[_0x01bf('0x22')]))[_0x01bf('0x2d')](_0x01bf('0x48'),_0x5731d4);this[_0x01bf('0x40')](_0x01bf('0x49'),_0x5731d4);}}catch(_0x3082d6){logger[_0x01bf('0x4a')](_0x3082d6[_0x01bf('0x42')]);}};VoiceAgentReport[_0x01bf('0x1e')]['syncMusicOnHoldStart']=function(_0x528de4){try{var _0xb86eb7=_[_0x01bf('0x4b')](this[_0x01bf('0xb')],{'channel':_0x528de4[_0x01bf('0x33')],'agentconnect':!![]});if(!_[_0x01bf('0x2b')](_0xb86eb7)){if(!_[_0x01bf('0x2b')](this['agents'][_0xb86eb7[_0x01bf('0x2a')]])){this[_0x01bf('0xa')][_0xb86eb7['interface']][_0x01bf('0x4c')]=!![];this[_0x01bf('0xa')][_0xb86eb7[_0x01bf('0x2a')]]['updateStatusRealtime']();}}}catch(_0x3e3126){logger[_0x01bf('0x4a')](_0x3e3126[_0x01bf('0x42')]);}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x3be4ac){try{var _0x3ab74=_[_0x01bf('0x4b')](this[_0x01bf('0xb')],{'channel':_0x3be4ac[_0x01bf('0x33')],'agentconnect':!![]});if(!_[_0x01bf('0x2b')](_0x3ab74)){if(!_[_0x01bf('0x2b')](this[_0x01bf('0xa')][_0x3ab74[_0x01bf('0x2a')]])){this['agents'][_0x3ab74['interface']][_0x01bf('0x4c')]=![];this[_0x01bf('0xa')][_0x3ab74[_0x01bf('0x2a')]][_0x01bf('0x4d')]();}}}catch(_0x2709c0){logger['error'](_0x2709c0[_0x01bf('0x42')]);}};VoiceAgentReport[_0x01bf('0x1e')][_0x01bf('0x12')]=function(_0x66b65b){try{var _0x2cc054=this[_0x01bf('0xb')][_0x66b65b['destchannel']];if(!_[_0x01bf('0x2b')](_0x2cc054)){_0x2cc054=_[_0x01bf('0x2c')](_0x2cc054,{'ringtime':parseInt(_0x66b65b[_0x01bf('0x44')],0xa)/0x3e8,'agentringnoanswer':!![],'reason':_0x01bf('0x4e'),'lastevent':_0x01bf('0x4e')});_0x2cc054[_0x01bf('0x4f')]=this[_0x01bf('0x25')](_0x2cc054[_0x01bf('0x46')],_0x2cc054[_0x01bf('0x44')]);ami[_0x01bf('0x2d')](_0x01bf('0x50'),_0x2cc054);this[_0x01bf('0x40')]('RINGNOANSWER',_0x2cc054);}}catch(_0x363ccd){logger[_0x01bf('0x4a')](_0x363ccd[_0x01bf('0x42')]);}};VoiceAgentReport['prototype'][_0x01bf('0x13')]=function(_0x37d990){try{for(var _0x30c726 in this[_0x01bf('0xb')]){var _0x39a74d=this[_0x01bf('0xb')][_0x30c726];if(!_[_0x01bf('0x2b')](_0x39a74d)&&_0x39a74d[_0x01bf('0x33')]==_0x37d990[_0x01bf('0x33')]){_0x39a74d=_['assign'](_0x39a74d,{'holdtime':parseInt(_0x37d990['holdtime'],0xa),'position':parseInt(_0x37d990['position'],0xa),'originalposition':parseInt(_0x37d990[_0x01bf('0x51')],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()[_0x01bf('0x20')](_0x01bf('0x2f')),'reason':_0x01bf('0x52'),'lastevent':_0x01bf('0x52')});ami['emit'](_0x01bf('0x53'),_0x39a74d);this[_0x01bf('0x40')](_0x01bf('0x54'),_0x39a74d);}}}catch(_0xacdb2a){logger[_0x01bf('0x4a')](_0xacdb2a['stack']);}};VoiceAgentReport[_0x01bf('0x1e')][_0x01bf('0x15')]=function(_0x43ec89){try{var _0x3ac7ff=this[_0x01bf('0xb')][_0x43ec89['destchannel']];if(!_[_0x01bf('0x2b')](_0x3ac7ff)){_0x3ac7ff=_[_0x01bf('0x2c')](_0x3ac7ff,{'talktime':parseInt(_0x43ec89[_0x01bf('0x55')],0xa),'reason':_0x43ec89[_0x01bf('0x56')]==_0x01bf('0x57')?_0x01bf('0x3c'):_0x43ec89[_0x01bf('0x56')],'agentcomplete':!![],'lastevent':_0x01bf('0x58'),'agentacw':this[_0x01bf('0x9')][_0x3ac7ff[_0x01bf('0x39')]]&&this[_0x01bf('0x9')][_0x3ac7ff[_0x01bf('0x39')]][_0x01bf('0x59')]?!![]:![],'acwtime':this[_0x01bf('0x9')][_0x3ac7ff[_0x01bf('0x39')]]&&this['voiceQueues'][_0x3ac7ff['queue']][_0x01bf('0x59')]?this[_0x01bf('0x9')][_0x3ac7ff[_0x01bf('0x39')]][_0x01bf('0x5a')]:0x0});_0x3ac7ff[_0x01bf('0x5b')]=this['addTime'](_0x3ac7ff[_0x01bf('0x45')],_0x3ac7ff[_0x01bf('0x55')]);this['log'](_0x01bf('0x5c'),_0x3ac7ff);}}catch(_0x3c1633){logger[_0x01bf('0x4a')](_0x3c1633[_0x01bf('0x42')]);}};VoiceAgentReport[_0x01bf('0x1e')]['clear']=function(_0x45ed4a){try{switch(_0x45ed4a[_0x01bf('0x5d')]){case 0x1a:_0x45ed4a=_[_0x01bf('0x2c')](_0x45ed4a,{'agentringnoanswer':!![],'reason':_0x01bf('0x5e'),'lastevent':'answered_elsewhere'});var _0x1477c9=_[_0x01bf('0x4b')](this[_0x01bf('0xb')],{'channel':_0x45ed4a['channel'],'agentconnect':!![]});if(!_[_0x01bf('0x2b')](_0x1477c9)){_0x45ed4a=_[_0x01bf('0x2c')](_0x45ed4a,{'agentringnoanswerAt':_0x1477c9['agentconnectAt'],'answeredelsewheremembername':_0x1477c9['membername'],'answeredelsewheredestinationuniqueid':_0x1477c9[_0x01bf('0x36')]});}ami[_0x01bf('0x2d')](_0x01bf('0x5f'),_0x45ed4a);break;}if(_0x45ed4a[_0x01bf('0x14')]){ami[_0x01bf('0x2d')](_0x01bf('0x60'),_0x45ed4a);io['to'](util[_0x01bf('0x20')](_0x01bf('0x3e'),_0x45ed4a['membername']))[_0x01bf('0x2d')](_0x01bf('0x61'),_0x45ed4a);}this[_0x01bf('0x40')](_0x01bf('0x62'),_0x45ed4a);ami[_0x01bf('0x2d')](_0x01bf('0x63'),_0x45ed4a);if(this['channels'][_0x45ed4a[_0x01bf('0x34')]]){delete this[_0x01bf('0xb')][_0x45ed4a[_0x01bf('0x34')]];}}catch(_0x90631a){logger[_0x01bf('0x4a')](_0x90631a);}};VoiceAgentReport[_0x01bf('0x1e')][_0x01bf('0x18')]=function(_0x408058){try{var _0x55bcf7=this[_0x01bf('0xb')][_0x408058['channel']];if(!_['isNil'](_0x55bcf7)){_0x55bcf7=_['assign'](_0x55bcf7,{'cause':parseInt(_0x408058[_0x01bf('0x5d')],0xa),'cause-txt':_0x408058[_0x01bf('0x64')]});if(_0x55bcf7[_0x01bf('0x65')]){_0x55bcf7=_[_0x01bf('0x2c')](_0x55bcf7,{'agentcomplete':!![],'agentcompleteAt':moment()[_0x01bf('0x20')](_0x01bf('0x2f')),'lastevent':_0x01bf('0x58'),'agentacw':this[_0x01bf('0x9')][_0x55bcf7[_0x01bf('0x39')]]&&this[_0x01bf('0x9')][_0x55bcf7[_0x01bf('0x39')]][_0x01bf('0x59')]?!![]:![],'acwtime':this[_0x01bf('0x9')][_0x55bcf7[_0x01bf('0x39')]]&&this[_0x01bf('0x9')][_0x55bcf7[_0x01bf('0x39')]][_0x01bf('0x59')]?this[_0x01bf('0x9')][_0x55bcf7['queue']][_0x01bf('0x5a')]:0x0});_0x55bcf7[_0x01bf('0x55')]=this[_0x01bf('0x28')](_0x55bcf7[_0x01bf('0x5b')],_0x55bcf7[_0x01bf('0x45')]);}var _0x237c4d=this['agents'][_0x55bcf7[_0x01bf('0x2a')]];if(!_['isNil'](_0x237c4d)){_0x237c4d=_[_0x01bf('0x2c')](_0x237c4d,{'queue':null,'destconnectedlinenum':null});io[_0x01bf('0x2d')](_0x01bf('0x2e'),_0x237c4d);}setTimeout(this['clear']['bind'](this,_0x55bcf7),0x3e8);}if(this[_0x01bf('0xc')][_0x408058[_0x01bf('0x33')]]){delete this[_0x01bf('0xc')][_0x408058[_0x01bf('0x33')]];}}catch(_0x4ca430){logger[_0x01bf('0x4a')](_0x4ca430['stack']);}};VoiceAgentReport['prototype'][_0x01bf('0x66')]=function(_0x2c6eed){try{var _0x1bfec6=this[_0x01bf('0xb')][_0x2c6eed[_0x01bf('0x67')]];if(!_['isNil'](_0x1bfec6)){_0x1bfec6=_[_0x01bf('0x2c')](_0x1bfec6,{'transfer':!![],'transferAt':moment()['format'](_0x01bf('0x2f')),'transfertype':_0x01bf('0x68'),'agentcomplete':!![],'agentcompleteAt':moment()[_0x01bf('0x20')](_0x01bf('0x2f')),'transferuniqueid':_0x2c6eed['secondtransfereruniqueid'],'transfercontext':_0x2c6eed[_0x01bf('0x69')],'transferextension':_0x2c6eed[_0x01bf('0x6a')],'reason':'transfer','lastevent':'complete','agentacw':this['voiceQueues'][_0x1bfec6[_0x01bf('0x39')]]&&this[_0x01bf('0x9')][_0x1bfec6[_0x01bf('0x39')]][_0x01bf('0x59')]?!![]:![],'acwtime':this[_0x01bf('0x9')][_0x1bfec6['queue']]&&this[_0x01bf('0x9')][_0x1bfec6[_0x01bf('0x39')]][_0x01bf('0x59')]?this[_0x01bf('0x9')][_0x1bfec6[_0x01bf('0x39')]]['acwTimeout']:0x0});_0x1bfec6[_0x01bf('0x55')]=this[_0x01bf('0x28')](_0x1bfec6['agentcompleteAt'],_0x1bfec6[_0x01bf('0x45')]);this[_0x01bf('0x40')](_0x01bf('0x68'),_0x1bfec6);}if(!_[_0x01bf('0x2b')](this[_0x01bf('0xb')][_0x2c6eed[_0x01bf('0x6b')]])){this[_0x01bf('0xb')][_0x2c6eed[_0x01bf('0x6b')]][_0x01bf('0x65')]=!![];}}catch(_0x488ab2){logger[_0x01bf('0x4a')](_0x488ab2['stack']);}};VoiceAgentReport[_0x01bf('0x1e')][_0x01bf('0x1b')]=function(_0x29cf2f){try{var _0x17dddf=this[_0x01bf('0xb')][_0x29cf2f[_0x01bf('0x6c')]];if(!_[_0x01bf('0x2b')](_0x17dddf)){_0x17dddf=_[_0x01bf('0x2c')](_0x17dddf,{'transfer':!![],'transferAt':moment()[_0x01bf('0x20')](_0x01bf('0x2f')),'transfertype':_0x01bf('0x6d'),'transferuniqueid':_0x29cf2f['transfereeuniqueid'],'transfercontext':_0x29cf2f[_0x01bf('0x37')],'transferextension':_0x29cf2f[_0x01bf('0x6e')],'agentcomplete':!![],'agentcompleteAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'transfer','lastevent':_0x01bf('0x58'),'agentacw':this[_0x01bf('0x9')][_0x17dddf[_0x01bf('0x39')]]&&this[_0x01bf('0x9')][_0x17dddf['queue']][_0x01bf('0x59')]?!![]:![],'acwtime':this['voiceQueues'][_0x17dddf[_0x01bf('0x39')]]&&this['voiceQueues'][_0x17dddf[_0x01bf('0x39')]][_0x01bf('0x59')]?this[_0x01bf('0x9')][_0x17dddf['queue']][_0x01bf('0x5a')]:0x0});_0x17dddf['recalculate']=!![];this[_0x01bf('0x40')]('BLIND',_0x17dddf);}}catch(_0x2ebaae){logger['error'](_0x2ebaae[_0x01bf('0x42')]);}};VoiceAgentReport[_0x01bf('0x1e')]['syncVarSet']=function(_0x52b6a5){var _0x112e38=[_0x01bf('0x6f'),_0x01bf('0x70'),_0x01bf('0x71'),_0x01bf('0x72'),_0x01bf('0x73'),_0x01bf('0x74'),_0x01bf('0x75'),_0x01bf('0x76'),_0x01bf('0x77'),_0x01bf('0x78'),_0x01bf('0x79'),_0x01bf('0x7a'),'membercalls',_0x01bf('0x7b'),'memberinterface',_0x01bf('0x7c'),'membername',_0x01bf('0x7d'),_0x01bf('0x7e')];try{var _0x763a5e=_[_0x01bf('0x7f')](_0x52b6a5[_0x01bf('0x80')])[0x0];if(!_[_0x01bf('0x2b')](_0x763a5e)&&!_[_0x01bf('0x81')](_0x112e38,_0x763a5e)){if(!this[_0x01bf('0xc')][_0x52b6a5[_0x01bf('0x33')]]){this[_0x01bf('0xc')][_0x52b6a5[_0x01bf('0x33')]]={};}this[_0x01bf('0xc')][_0x52b6a5[_0x01bf('0x33')]][_0x763a5e]=_0x52b6a5['value'];}}catch(_0x6beef7){logger[_0x01bf('0x4a')](_0x6beef7['stack']);}};module[_0x01bf('0x82')]=VoiceAgentReport;
\ No newline at end of file
+var _0x8a0b=['cause-txt','recalculate','user:save','ATTENDED','secondtransfereruniqueid','secondtransfererexten','secondtransferercontext','transfertargetchannel','BLIND','transfereeuniqueid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberinterface','memberpenalty','memberrealtime','variable','includes','value','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','channels','variables','agentcalled','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','log','info','format','%s|%s','uniqueid','membername','queue','exten','calleridnum','join','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','prototype','diffTime','diff','isNil','assign','destchannel','destcalleridnum','accountcode','destaccountcode','channel','destuniqueid','context','type','inbound','interface','called','emit','custom:agentcalled','user:%s','user:called','error','stack','ringtime','connect','agentconnectAt','agentcalledAt','custom:agentconnect','user:agentconnect','CONNECT','find','onhold','syncMusicOnHoldStop','rejected','agentringnoanswerAt','custom:agentringnoanswer','RINGNOANSWER','position','abandoned','custom:agentqueuecallerabandon','CALLERABANDON','talktime','reason','transfer','agent','complete','acw','acwTimeout','agentcompleteAt','clear','cause','custom:agentansweredelsewhere','custom:agentcomplete','user:agentcomplete','HANGUP'];(function(_0x4837bb,_0x5376f9){var _0x29fe56=function(_0x5095d3){while(--_0x5095d3){_0x4837bb['push'](_0x4837bb['shift']());}};_0x29fe56(++_0x5376f9);}(_0x8a0b,0x18d));var _0xb8a0=function(_0x2655d0,_0x24eef9){_0x2655d0=_0x2655d0-0x0;var _0x24553e=_0x8a0b[_0x2655d0];return _0x24553e;};'use strict';var _=require(_0xb8a0('0x0'));var moment=require(_0xb8a0('0x1'));var util=require(_0xb8a0('0x2'));var Redis=require(_0xb8a0('0x3'));var config=require(_0xb8a0('0x4'));var logger=require(_0xb8a0('0x5'))('ami');var ami=require(_0xb8a0('0x6'));config[_0xb8a0('0x7')]=_['defaults'](config['redis'],{'host':_0xb8a0('0x8'),'port':0x18eb});var io=require(_0xb8a0('0x9'))(new Redis(config[_0xb8a0('0x7')]));function VoiceAgentReport(_0x17d3de){this[_0xb8a0('0xa')]=_0x17d3de[_0xb8a0('0xa')];this[_0xb8a0('0xb')]=_0x17d3de[_0xb8a0('0xb')];this[_0xb8a0('0xc')]={};this[_0xb8a0('0xd')]={};ami['on'](_0xb8a0('0xe'),this[_0xb8a0('0xf')][_0xb8a0('0x10')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xb8a0('0x10')](this));ami['on'](_0xb8a0('0x11'),this[_0xb8a0('0x12')]['bind'](this));ami['on']('queuecallerabandon',this[_0xb8a0('0x13')]['bind'](this));ami['on'](_0xb8a0('0x14'),this[_0xb8a0('0x15')][_0xb8a0('0x10')](this));ami['on']('varset',this[_0xb8a0('0x16')][_0xb8a0('0x10')](this));ami['on'](_0xb8a0('0x17'),this[_0xb8a0('0x18')][_0xb8a0('0x10')](this));ami['on'](_0xb8a0('0x19'),this[_0xb8a0('0x1a')][_0xb8a0('0x10')](this));ami['on'](_0xb8a0('0x1b'),this[_0xb8a0('0x1c')][_0xb8a0('0x10')](this));ami['on'](_0xb8a0('0x1d'),this[_0xb8a0('0x1e')][_0xb8a0('0x10')](this));ami['on'](_0xb8a0('0x1f'),this['syncMusicOnHoldStop'][_0xb8a0('0x10')](this));}VoiceAgentReport['prototype'][_0xb8a0('0x20')]=function(_0x53a58e,_0x5537df){logger[_0xb8a0('0x21')](util[_0xb8a0('0x22')](_0xb8a0('0x23'),_0x53a58e,[_0x5537df[_0xb8a0('0x24')],_0x5537df[_0xb8a0('0x25')],_0x5537df[_0xb8a0('0x26')],_0x5537df[_0xb8a0('0x27')],_0x5537df[_0xb8a0('0x28')]][_0xb8a0('0x29')]('|')));};VoiceAgentReport['prototype'][_0xb8a0('0x2a')]=function(_0x931555,_0x3cb1f3){return moment(_0x931555)['add'](_0x3cb1f3,_0xb8a0('0x2b'))[_0xb8a0('0x22')](_0xb8a0('0x2c'));};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x2e')]=function(_0x54dfa5,_0x3a26da){return moment(_0x54dfa5)[_0xb8a0('0x2f')](moment(_0x3a26da),_0xb8a0('0x2b'));};VoiceAgentReport[_0xb8a0('0x2d')]['syncAgentCalled']=function(_0x4ddf00){try{var _0x4ab8c0=this[_0xb8a0('0xb')][_0x4ddf00['interface']];if(!_[_0xb8a0('0x30')](_0x4ab8c0)){_0x4ab8c0=_[_0xb8a0('0x31')](_0x4ab8c0,{'queue':_0x4ddf00[_0xb8a0('0x26')],'destconnectedlinenum':_0x4ddf00[_0xb8a0('0x28')]});io['emit']('user:save',_0x4ab8c0);}var _0x56e24a=this[_0xb8a0('0xc')][_0x4ddf00[_0xb8a0('0x32')]]={'agentcalledAt':moment()[_0xb8a0('0x22')](_0xb8a0('0x2c')),'calleridnum':_0x4ddf00[_0xb8a0('0x28')],'calleridname':_0x4ddf00['calleridname'],'connectedlinenum':_0x4ddf00[_0xb8a0('0x33')],'connectedlinename':_0x4ddf00['destcalleridname'],'accountcode':_0x4ddf00[_0xb8a0('0x34')],'destaccountcode':_0x4ddf00[_0xb8a0('0x35')],'channel':_0x4ddf00[_0xb8a0('0x36')],'destchannel':_0x4ddf00[_0xb8a0('0x32')],'uniqueid':_0x4ddf00[_0xb8a0('0x24')],'destuniqueid':_0x4ddf00[_0xb8a0('0x37')],'context':_0x4ddf00[_0xb8a0('0x38')],'exten':_0x4ddf00[_0xb8a0('0x27')],'priority':_0x4ddf00['priority'],'queue':_0x4ddf00[_0xb8a0('0x26')],'type':this['voiceQueues'][_0x4ddf00[_0xb8a0('0x26')]]?this['voiceQueues'][_0x4ddf00[_0xb8a0('0x26')]][_0xb8a0('0x39')]||'inbound':_0xb8a0('0x3a'),'interface':_0x4ddf00['interface'],'membername':_0x4ddf00[_0xb8a0('0x25')],'agentconnect':![],'agentconnectAt':null,'holdtime':0x0,'ringtime':0x0,'agentcomplete':![],'agentcompleteAt':null,'talktime':0x0,'agentringnoanswer':![],'agentringnoanswerAt':null,'reason':'agent','transfer':![],'transferAt':null,'transfertype':null,'transferuniqueid':null,'transfercontext':null,'transferextension':null,'position':null,'originalposition':null,'cause':'','cause-txt':'','UserId':this[_0xb8a0('0xb')][_0x4ddf00['interface']]?this['agents'][_0x4ddf00[_0xb8a0('0x3b')]]['id']:null,'lastevent':_0xb8a0('0x3c'),'agentacw':![],'acwtime':0x0,'variables':this[_0xb8a0('0xd')][_0x4ddf00[_0xb8a0('0x36')]]?this['variables'][_0x4ddf00[_0xb8a0('0x36')]]:{}};ami[_0xb8a0('0x3d')](_0xb8a0('0x3e'),_0x56e24a);io['to'](util['format'](_0xb8a0('0x3f'),_0x56e24a[_0xb8a0('0x25')]))[_0xb8a0('0x3d')](_0xb8a0('0x40'),_0x56e24a);this[_0xb8a0('0x20')]('CALLED',this[_0xb8a0('0xc')][_0x4ddf00[_0xb8a0('0x32')]]);}catch(_0x5ebc65){logger[_0xb8a0('0x41')](_0x5ebc65[_0xb8a0('0x42')]);}};VoiceAgentReport[_0xb8a0('0x2d')]['syncAgentConnect']=function(_0x43fa7b){try{var _0x5fd301=this[_0xb8a0('0xc')][_0x43fa7b[_0xb8a0('0x32')]];if(!_[_0xb8a0('0x30')](_0x5fd301)){_0x5fd301=_['assign'](_0x5fd301,{'holdtime':parseInt(_0x43fa7b['holdtime'],0xa),'ringtime':parseInt(_0x43fa7b[_0xb8a0('0x43')],0xa),'agentconnect':!![],'lastevent':_0xb8a0('0x44')});_0x5fd301[_0xb8a0('0x45')]=this[_0xb8a0('0x2a')](_0x5fd301[_0xb8a0('0x46')],_0x5fd301[_0xb8a0('0x43')]);ami[_0xb8a0('0x3d')](_0xb8a0('0x47'),_0x5fd301);io['to'](util['format']('user:%s',_0x5fd301[_0xb8a0('0x25')]))[_0xb8a0('0x3d')](_0xb8a0('0x48'),_0x5fd301);this[_0xb8a0('0x20')](_0xb8a0('0x49'),_0x5fd301);}}catch(_0x44c160){logger[_0xb8a0('0x41')](_0x44c160[_0xb8a0('0x42')]);}};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x1e')]=function(_0x398224){try{var _0x5caab4=_[_0xb8a0('0x4a')](this[_0xb8a0('0xc')],{'channel':_0x398224[_0xb8a0('0x36')],'agentconnect':!![]});if(!_[_0xb8a0('0x30')](_0x5caab4)){if(!_[_0xb8a0('0x30')](this[_0xb8a0('0xb')][_0x5caab4['interface']])){this[_0xb8a0('0xb')][_0x5caab4[_0xb8a0('0x3b')]][_0xb8a0('0x4b')]=!![];this[_0xb8a0('0xb')][_0x5caab4['interface']]['updateStatusRealtime']();}}}catch(_0x36a986){logger[_0xb8a0('0x41')](_0x36a986[_0xb8a0('0x42')]);}};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x4c')]=function(_0x49f2e5){try{var _0x5f0496=_['find'](this[_0xb8a0('0xc')],{'channel':_0x49f2e5[_0xb8a0('0x36')],'agentconnect':!![]});if(!_[_0xb8a0('0x30')](_0x5f0496)){if(!_[_0xb8a0('0x30')](this[_0xb8a0('0xb')][_0x5f0496[_0xb8a0('0x3b')]])){this[_0xb8a0('0xb')][_0x5f0496[_0xb8a0('0x3b')]][_0xb8a0('0x4b')]=![];this[_0xb8a0('0xb')][_0x5f0496[_0xb8a0('0x3b')]]['updateStatusRealtime']();}}}catch(_0x26c299){logger['error'](_0x26c299[_0xb8a0('0x42')]);}};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x12')]=function(_0x356c39){try{var _0x4e758a=this[_0xb8a0('0xc')][_0x356c39[_0xb8a0('0x32')]];if(!_[_0xb8a0('0x30')](_0x4e758a)){_0x4e758a=_[_0xb8a0('0x31')](_0x4e758a,{'ringtime':parseInt(_0x356c39['ringtime'],0xa)/0x3e8,'agentringnoanswer':!![],'reason':'rejected','lastevent':_0xb8a0('0x4d')});_0x4e758a[_0xb8a0('0x4e')]=this[_0xb8a0('0x2a')](_0x4e758a[_0xb8a0('0x46')],_0x4e758a[_0xb8a0('0x43')]);ami[_0xb8a0('0x3d')](_0xb8a0('0x4f'),_0x4e758a);this[_0xb8a0('0x20')](_0xb8a0('0x50'),_0x4e758a);}}catch(_0x21dfcf){logger[_0xb8a0('0x41')](_0x21dfcf[_0xb8a0('0x42')]);}};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x13')]=function(_0x505c49){try{for(var _0x150073 in this[_0xb8a0('0xc')]){var _0x502685=this[_0xb8a0('0xc')][_0x150073];if(!_['isNil'](_0x502685)&&_0x502685[_0xb8a0('0x36')]==_0x505c49[_0xb8a0('0x36')]){_0x502685=_['assign'](_0x502685,{'holdtime':parseInt(_0x505c49['holdtime'],0xa),'position':parseInt(_0x505c49[_0xb8a0('0x51')],0xa),'originalposition':parseInt(_0x505c49['originalposition'],0xa),'agentringnoanswer':!![],'agentringnoanswerAt':moment()['format'](_0xb8a0('0x2c')),'reason':_0xb8a0('0x52'),'lastevent':_0xb8a0('0x52')});ami['emit'](_0xb8a0('0x53'),_0x502685);this['log'](_0xb8a0('0x54'),_0x502685);}}}catch(_0x5d125e){logger['error'](_0x5d125e['stack']);}};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x15')]=function(_0x4b47ee){try{var _0x1f1cd3=this['channels'][_0x4b47ee[_0xb8a0('0x32')]];if(!_['isNil'](_0x1f1cd3)){_0x1f1cd3=_['assign'](_0x1f1cd3,{'talktime':parseInt(_0x4b47ee[_0xb8a0('0x55')],0xa),'reason':_0x4b47ee[_0xb8a0('0x56')]==_0xb8a0('0x57')?_0xb8a0('0x58'):_0x4b47ee[_0xb8a0('0x56')],'agentcomplete':!![],'lastevent':_0xb8a0('0x59'),'agentacw':this[_0xb8a0('0xa')][_0x1f1cd3['queue']]&&this[_0xb8a0('0xa')][_0x1f1cd3[_0xb8a0('0x26')]][_0xb8a0('0x5a')]?!![]:![],'acwtime':this['voiceQueues'][_0x1f1cd3[_0xb8a0('0x26')]]&&this[_0xb8a0('0xa')][_0x1f1cd3[_0xb8a0('0x26')]][_0xb8a0('0x5a')]?this[_0xb8a0('0xa')][_0x1f1cd3[_0xb8a0('0x26')]][_0xb8a0('0x5b')]:0x0});_0x1f1cd3[_0xb8a0('0x5c')]=this[_0xb8a0('0x2a')](_0x1f1cd3[_0xb8a0('0x45')],_0x1f1cd3['talktime']);this['log']('COMPLETE',_0x1f1cd3);}}catch(_0x47e285){logger['error'](_0x47e285[_0xb8a0('0x42')]);}};VoiceAgentReport['prototype'][_0xb8a0('0x5d')]=function(_0x1a7fc4){try{switch(_0x1a7fc4[_0xb8a0('0x5e')]){case 0x1a:_0x1a7fc4=_['assign'](_0x1a7fc4,{'agentringnoanswer':!![],'reason':'answered_elsewhere','lastevent':'answered_elsewhere'});var _0x209e70=_[_0xb8a0('0x4a')](this[_0xb8a0('0xc')],{'channel':_0x1a7fc4['channel'],'agentconnect':!![]});if(!_[_0xb8a0('0x30')](_0x209e70)){_0x1a7fc4=_[_0xb8a0('0x31')](_0x1a7fc4,{'agentringnoanswerAt':_0x209e70['agentconnectAt'],'answeredelsewheremembername':_0x209e70[_0xb8a0('0x25')],'answeredelsewheredestinationuniqueid':_0x209e70[_0xb8a0('0x37')]});}ami[_0xb8a0('0x3d')](_0xb8a0('0x5f'),_0x1a7fc4);break;}if(_0x1a7fc4['agentcomplete']){ami[_0xb8a0('0x3d')](_0xb8a0('0x60'),_0x1a7fc4);io['to'](util['format'](_0xb8a0('0x3f'),_0x1a7fc4[_0xb8a0('0x25')]))[_0xb8a0('0x3d')](_0xb8a0('0x61'),_0x1a7fc4);}this['log'](_0xb8a0('0x62'),_0x1a7fc4);ami[_0xb8a0('0x3d')]('custom:voiceAgentReport',_0x1a7fc4);if(this[_0xb8a0('0xc')][_0x1a7fc4[_0xb8a0('0x32')]]){delete this[_0xb8a0('0xc')][_0x1a7fc4[_0xb8a0('0x32')]];}}catch(_0x112bf3){logger[_0xb8a0('0x41')](_0x112bf3);}};VoiceAgentReport[_0xb8a0('0x2d')]['syncHangup']=function(_0x4e81e1){try{var _0xd3cd3b=this['channels'][_0x4e81e1[_0xb8a0('0x36')]];if(!_[_0xb8a0('0x30')](_0xd3cd3b)){_0xd3cd3b=_[_0xb8a0('0x31')](_0xd3cd3b,{'cause':parseInt(_0x4e81e1[_0xb8a0('0x5e')],0xa),'cause-txt':_0x4e81e1[_0xb8a0('0x63')]});if(_0xd3cd3b[_0xb8a0('0x64')]){_0xd3cd3b=_[_0xb8a0('0x31')](_0xd3cd3b,{'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0xb8a0('0x2c')),'lastevent':'complete','agentacw':this[_0xb8a0('0xa')][_0xd3cd3b[_0xb8a0('0x26')]]&&this[_0xb8a0('0xa')][_0xd3cd3b[_0xb8a0('0x26')]][_0xb8a0('0x5a')]?!![]:![],'acwtime':this[_0xb8a0('0xa')][_0xd3cd3b[_0xb8a0('0x26')]]&&this['voiceQueues'][_0xd3cd3b[_0xb8a0('0x26')]][_0xb8a0('0x5a')]?this[_0xb8a0('0xa')][_0xd3cd3b[_0xb8a0('0x26')]][_0xb8a0('0x5b')]:0x0});_0xd3cd3b[_0xb8a0('0x55')]=this[_0xb8a0('0x2e')](_0xd3cd3b[_0xb8a0('0x5c')],_0xd3cd3b[_0xb8a0('0x45')]);}var _0x292256=this[_0xb8a0('0xb')][_0xd3cd3b['interface']];if(!_[_0xb8a0('0x30')](_0x292256)){_0x292256=_[_0xb8a0('0x31')](_0x292256,{'queue':null,'destconnectedlinenum':null});io[_0xb8a0('0x3d')](_0xb8a0('0x65'),_0x292256);}setTimeout(this[_0xb8a0('0x5d')][_0xb8a0('0x10')](this,_0xd3cd3b),0x3e8);}if(this['variables'][_0x4e81e1['channel']]){delete this[_0xb8a0('0xd')][_0x4e81e1[_0xb8a0('0x36')]];}}catch(_0x38f0b0){logger[_0xb8a0('0x41')](_0x38f0b0[_0xb8a0('0x42')]);}};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x1a')]=function(_0x56a283){try{var _0x4a1113=this[_0xb8a0('0xc')][_0x56a283['origtransfererchannel']];if(!_['isNil'](_0x4a1113)){_0x4a1113=_[_0xb8a0('0x31')](_0x4a1113,{'transfer':!![],'transferAt':moment()[_0xb8a0('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'transfertype':_0xb8a0('0x66'),'agentcomplete':!![],'agentcompleteAt':moment()['format'](_0xb8a0('0x2c')),'transferuniqueid':_0x56a283[_0xb8a0('0x67')],'transfercontext':_0x56a283[_0xb8a0('0x68')],'transferextension':_0x56a283[_0xb8a0('0x69')],'reason':_0xb8a0('0x57'),'lastevent':'complete','agentacw':this[_0xb8a0('0xa')][_0x4a1113[_0xb8a0('0x26')]]&&this[_0xb8a0('0xa')][_0x4a1113['queue']][_0xb8a0('0x5a')]?!![]:![],'acwtime':this[_0xb8a0('0xa')][_0x4a1113[_0xb8a0('0x26')]]&&this[_0xb8a0('0xa')][_0x4a1113[_0xb8a0('0x26')]][_0xb8a0('0x5a')]?this['voiceQueues'][_0x4a1113['queue']]['acwTimeout']:0x0});_0x4a1113[_0xb8a0('0x55')]=this[_0xb8a0('0x2e')](_0x4a1113[_0xb8a0('0x5c')],_0x4a1113[_0xb8a0('0x45')]);this[_0xb8a0('0x20')](_0xb8a0('0x66'),_0x4a1113);}if(!_[_0xb8a0('0x30')](this[_0xb8a0('0xc')][_0x56a283[_0xb8a0('0x6a')]])){this[_0xb8a0('0xc')][_0x56a283[_0xb8a0('0x6a')]][_0xb8a0('0x64')]=!![];}}catch(_0x4e5c5d){logger[_0xb8a0('0x41')](_0x4e5c5d[_0xb8a0('0x42')]);}};VoiceAgentReport[_0xb8a0('0x2d')][_0xb8a0('0x1c')]=function(_0x393db1){try{var _0x433cfb=this[_0xb8a0('0xc')][_0x393db1['transfererchannel']];if(!_['isNil'](_0x433cfb)){_0x433cfb=_[_0xb8a0('0x31')](_0x433cfb,{'transfer':!![],'transferAt':moment()[_0xb8a0('0x22')](_0xb8a0('0x2c')),'transfertype':_0xb8a0('0x6b'),'transferuniqueid':_0x393db1[_0xb8a0('0x6c')],'transfercontext':_0x393db1[_0xb8a0('0x38')],'transferextension':_0x393db1['extension'],'agentcomplete':!![],'agentcompleteAt':moment()[_0xb8a0('0x22')](_0xb8a0('0x2c')),'reason':_0xb8a0('0x57'),'lastevent':'complete','agentacw':this['voiceQueues'][_0x433cfb['queue']]&&this[_0xb8a0('0xa')][_0x433cfb[_0xb8a0('0x26')]][_0xb8a0('0x5a')]?!![]:![],'acwtime':this['voiceQueues'][_0x433cfb[_0xb8a0('0x26')]]&&this[_0xb8a0('0xa')][_0x433cfb[_0xb8a0('0x26')]][_0xb8a0('0x5a')]?this['voiceQueues'][_0x433cfb[_0xb8a0('0x26')]][_0xb8a0('0x5b')]:0x0});_0x433cfb[_0xb8a0('0x64')]=!![];this['log']('BLIND',_0x433cfb);}}catch(_0x14a4c4){logger[_0xb8a0('0x41')](_0x14a4c4['stack']);}};VoiceAgentReport[_0xb8a0('0x2d')]['syncVarSet']=function(_0x381679){var _0x55b9af=[_0xb8a0('0x6d'),_0xb8a0('0x6e'),_0xb8a0('0x6f'),'rtpaudioqosjitterbridged',_0xb8a0('0x70'),_0xb8a0('0x71'),'rtpaudioqosrtt',_0xb8a0('0x72'),_0xb8a0('0x73'),_0xb8a0('0x74'),'bridgepeer',_0xb8a0('0x75'),'membercalls','memberdynamic',_0xb8a0('0x76'),'memberlastcall',_0xb8a0('0x25'),_0xb8a0('0x77'),_0xb8a0('0x78')];try{var _0x49f617=_['keys'](_0x381679[_0xb8a0('0x79')])[0x0];if(!_[_0xb8a0('0x30')](_0x49f617)&&!_[_0xb8a0('0x7a')](_0x55b9af,_0x49f617)){if(!this[_0xb8a0('0xd')][_0x381679['channel']]){this['variables'][_0x381679[_0xb8a0('0x36')]]={};}this['variables'][_0x381679[_0xb8a0('0x36')]][_0x49f617]=_0x381679[_0xb8a0('0x7b')];}}catch(_0x1cc410){logger[_0xb8a0('0x41')](_0x1cc410[_0xb8a0('0x42')]);}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index 82cf9b0..d905e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82c0=['toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','includes','lastapplication','lastdata','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','membername','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','variable','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-destination','destination','xmd-callerid-preview','calleridpreview','sipcalluniqueid','mixmonitor_filename','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','holdtime','omit','destconnectedlinenum','user:%s','user:agentcomplete','transfercalleridnum','origtransferercalleridnum','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','transfertargetcalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','util','path','ioredis','../../../config/environment','../ami','../model/channel','not_inuse','invalid','unavailable','ringing','onhold','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','defaults','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','linkedid','uniqueid','pick','keys','error','[syncNewCallerId][VoiceCallReport]','channel','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','context','from-sip','exten','split','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application'];(function(_0x540f6f,_0x4693ff){var _0x5765a1=function(_0x265183){while(--_0x265183){_0x540f6f['push'](_0x540f6f['shift']());}};_0x5765a1(++_0x4693ff);}(_0x82c0,0xe8));var _0x082c=function(_0x4dc428,_0x3b3dbd){_0x4dc428=_0x4dc428-0x0;var _0x5b45f7=_0x82c0[_0x4dc428];return _0x5b45f7;};'use strict';var BPromise=require(_0x082c('0x0'));var _=require(_0x082c('0x1'));var moment=require('moment');var util=require(_0x082c('0x2'));var path=require(_0x082c('0x3'));var Redis=require(_0x082c('0x4'));var config=require(_0x082c('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0x082c('0x6'));var Channel=require(_0x082c('0x7'));var statusDesc=['unknown',_0x082c('0x8'),'inuse','busy',_0x082c('0x9'),_0x082c('0xa'),_0x082c('0xb'),'ringinuse',_0x082c('0xc')];var applications=[_0x082c('0xd'),_0x082c('0xe'),_0x082c('0xf'),_0x082c('0x10'),'playback',_0x082c('0x11')];var dispositions=[_0x082c('0x12'),_0x082c('0x13'),'FAILED',_0x082c('0x12'),'NO\x20ANSWER',_0x082c('0x12'),_0x082c('0x14'),'BUSY','FAILED',_0x082c('0x13'),_0x082c('0x13')];var actions={};config['redis']=_[_0x082c('0x15')](config[_0x082c('0x16')],{'host':_0x082c('0x17'),'port':0x18eb});var io=require(_0x082c('0x18'))(new Redis(config[_0x082c('0x16')]));function VoiceCallReport(_0x5f1f95){this[_0x082c('0x19')]=_0x5f1f95[_0x082c('0x19')];this[_0x082c('0x1a')]=_0x5f1f95['agents'];ami['on'](_0x082c('0x1b'),this[_0x082c('0x1c')][_0x082c('0x1d')](this));ami['on'](_0x082c('0x1e'),this[_0x082c('0x1c')][_0x082c('0x1d')](this));ami['on'](_0x082c('0x1f'),this[_0x082c('0x20')][_0x082c('0x1d')](this));ami['on'](_0x082c('0x21'),this['syncNewState'][_0x082c('0x1d')](this));ami['on'](_0x082c('0x22'),this[_0x082c('0x23')][_0x082c('0x1d')](this));ami['on'](_0x082c('0x24'),this[_0x082c('0x25')][_0x082c('0x1d')](this));ami['on']('newcallerid',this[_0x082c('0x26')][_0x082c('0x1d')](this));ami['on'](_0x082c('0x27'),this[_0x082c('0x28')][_0x082c('0x1d')](this));ami['on']('blindtransfer',this[_0x082c('0x29')][_0x082c('0x1d')](this));ami['on']('musiconholdstart',this[_0x082c('0x2a')][_0x082c('0x1d')](this));ami['on'](_0x082c('0x2b'),this[_0x082c('0x2c')]['bind'](this));return BPromise[_0x082c('0x2d')]()[_0x082c('0x2e')](ami[_0x082c('0x2f')]())[_0x082c('0x30')](function(_0x1ffbae){console[_0x082c('0x31')](_0x1ffbae);});}VoiceCallReport[_0x082c('0x32')][_0x082c('0x33')]=function(_0x22995e){return _0x22995e!==null&&!_[_0x082c('0x34')](_0x22995e);};VoiceCallReport[_0x082c('0x32')]['emit']=function(_0xe2410f,_0x3b9833,_0x3f88cb){io['to'](_0xe2410f)[_0x082c('0x35')](_0x3b9833,_0x3f88cb);};VoiceCallReport[_0x082c('0x32')][_0x082c('0x26')]=function(_0x4f39a7){try{if(this[_0x082c('0x33')](_0x4f39a7)){if(_0x4f39a7['uniqueid']===_0x4f39a7[_0x082c('0x36')]){if(!_['isUndefined'](this[_0x082c('0x19')][_0x4f39a7[_0x082c('0x37')]])){_['merge'](this[_0x082c('0x19')][_0x4f39a7['uniqueid']],_[_0x082c('0x38')](_0x4f39a7,_[_0x082c('0x39')](this[_0x082c('0x19')][_0x4f39a7[_0x082c('0x37')]])));}}}}catch(_0x3d8243){logger[_0x082c('0x3a')](_0x082c('0x3b'),util['inspect'](_0x3d8243,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')]['syncNewChannel']=function(_0x288bff){try{if(this['isNotNull'](_0x288bff)){if(_0x288bff[_0x082c('0x37')]===_0x288bff[_0x082c('0x36')]&&_0x288bff[_0x082c('0x3c')]!='OutgoingSpoolFailed'){if(_[_0x082c('0x34')](this[_0x082c('0x19')][_0x288bff[_0x082c('0x37')]])){this[_0x082c('0x19')][_0x288bff[_0x082c('0x37')]]=new Channel();this['channels'][_0x288bff[_0x082c('0x37')]]['starttime']=moment()[_0x082c('0x3d')](_0x082c('0x3e'));this[_0x082c('0x19')][_0x288bff[_0x082c('0x37')]][_0x082c('0x3f')]=dispositions[_[_0x082c('0x40')](_0x288bff[_0x082c('0x41')])];_[_0x082c('0x42')](this[_0x082c('0x19')][_0x288bff[_0x082c('0x37')]],_[_0x082c('0x38')](_0x288bff,_[_0x082c('0x39')](this['channels'][_0x288bff[_0x082c('0x37')]])));if(_0x288bff[_0x082c('0x43')]===_0x082c('0x44')){if(this[_0x082c('0x1a')][_0x288bff[_0x082c('0x3c')]['split']('-')[0x0]]){this['agents'][_0x288bff[_0x082c('0x3c')]['split']('-')[0x0]]['destconnectedlinenum']=_0x288bff[_0x082c('0x45')];this[_0x082c('0x35')](util[_0x082c('0x3d')]('user:%s',this[_0x082c('0x1a')][_0x288bff['channel'][_0x082c('0x46')]('-')[0x0]][_0x082c('0x47')]),_0x082c('0x48'),{'destaccountcode':this[_0x082c('0x1a')][_0x288bff[_0x082c('0x3c')][_0x082c('0x46')]('-')[0x0]][_0x082c('0x49')],'destconnectedlinenum':_0x288bff['exten']});}}}}}}catch(_0x54c4af){logger[_0x082c('0x3a')](_0x082c('0x4a'),util[_0x082c('0x4b')](_0x54c4af,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')]['syncNewExten']=function(_0x4c0bac){try{if(this['isNotNull'](_0x4c0bac)){if(_0x4c0bac[_0x082c('0x37')]===_0x4c0bac['linkedid']&&_0x4c0bac[_0x082c('0x45')]!='h'&&_0x4c0bac['channel']!=_0x082c('0x4c')){_0x4c0bac[_0x082c('0x4d')]=_0x4c0bac[_0x082c('0x4d')][_0x082c('0x4e')]();_0x4c0bac[_0x082c('0x4f')]=(_0x4c0bac[_0x082c('0x50')]||_0x4c0bac['applicationdata'])[_0x082c('0x4e')]();if(_[_0x082c('0x34')](this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]])){this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]]=new Channel();this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]][_0x082c('0x51')]=_0x4c0bac[_0x082c('0x52')]?moment()[_0x082c('0x53')](moment[_0x082c('0x52')](_0x4c0bac[_0x082c('0x52')])[_0x082c('0x54')](),'seconds')[_0x082c('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x082c('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]][_0x082c('0x3f')]='NO\x20ANSWER';}_['merge'](this['channels'][_0x4c0bac[_0x082c('0x37')]],_[_0x082c('0x38')](_0x4c0bac,_[_0x082c('0x39')](this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]])));if(_[_0x082c('0x55')](applications,_0x4c0bac[_0x082c('0x4d')])){this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]][_0x082c('0x56')]=_0x4c0bac['application'];this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]][_0x082c('0x57')]=_0x4c0bac[_0x082c('0x4f')];if(_0x4c0bac[_0x082c('0x4d')]===_0x082c('0xd')&&_[_0x082c('0x58')](_0x4c0bac[_0x082c('0x4f')],_0x082c('0x59'))){var _0x4c8ce8=_0x4c0bac[_0x082c('0x4f')][_0x082c('0x46')]('=');var _0x2384a5=_0x4c8ce8[0x0][_0x082c('0x5a')](/cdr\((.*)\)/);if(_0x2384a5){this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]][_0x2384a5[0x1]]=_0x4c8ce8[0x1];}}else if(_0x4c0bac[_0x082c('0x4d')]==='queue'){this[_0x082c('0x19')][_0x4c0bac[_0x082c('0x37')]][_0x082c('0xe')]=_0x4c0bac[_0x082c('0x4f')][_0x082c('0x46')](',')[0x0];}}}}}catch(_0x3c8952){logger[_0x082c('0x3a')](_0x082c('0x5b'),util[_0x082c('0x4b')](_0x3c8952,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')][_0x082c('0x5c')]=function(_0x29a9fc){try{if(this[_0x082c('0x33')](_0x29a9fc)){if(_0x29a9fc[_0x082c('0x37')]!==_0x29a9fc['linkedid']){if(this[_0x082c('0x19')][_0x29a9fc['linkedid']]){if(_0x29a9fc['channelstate']==='6'){if(!this['channels'][_0x29a9fc[_0x082c('0x36')]]['answered']){var _0x4e4409=moment();this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]][_0x082c('0x5d')]=!![];this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]][_0x082c('0x5e')]=_0x4e4409[_0x082c('0x3d')](_0x082c('0x3e'));if(this[_0x082c('0x19')][_0x29a9fc['linkedid']][_0x082c('0x51')]){this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]]['holdtime']=_0x4e4409[_0x082c('0x5f')](this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]][_0x082c('0x51')],_0x082c('0x54'));}}this['channels'][_0x29a9fc['linkedid']]['linkedid']=_0x29a9fc[_0x082c('0x37')];if(_0x29a9fc[_0x082c('0x60')]!==_0x082c('0x61')){this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]][_0x082c('0x62')]=_0x29a9fc[_0x082c('0x60')];}this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]][_0x082c('0x63')]=_0x29a9fc['calleridname'];this['channels'][_0x29a9fc[_0x082c('0x36')]]['destinationchannel']=_0x29a9fc[_0x082c('0x3c')];this['channels'][_0x29a9fc[_0x082c('0x36')]][_0x082c('0x3f')]=dispositions[_[_0x082c('0x40')](_0x29a9fc[_0x082c('0x41')])];if(this[_0x082c('0x1a')][_0x29a9fc[_0x082c('0x3c')][_0x082c('0x46')]('-')[0x0]]){this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]]['UserId']=this[_0x082c('0x1a')][_0x29a9fc[_0x082c('0x3c')][_0x082c('0x46')]('-')[0x0]]['id'];this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x36')]][_0x082c('0x64')]=this[_0x082c('0x1a')][_0x29a9fc['channel']['split']('-')[0x0]][_0x082c('0x47')];}}}}else{if(this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x37')]]){if(_0x29a9fc['channelstate']==='6'){if(this['agents'][_0x29a9fc[_0x082c('0x3c')]['split']('-')[0x0]]){this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x37')]][_0x082c('0x65')]=this[_0x082c('0x1a')][_0x29a9fc[_0x082c('0x3c')][_0x082c('0x46')]('-')[0x0]]['id'];this[_0x082c('0x19')][_0x29a9fc[_0x082c('0x37')]][_0x082c('0x64')]=this[_0x082c('0x1a')][_0x29a9fc[_0x082c('0x3c')][_0x082c('0x46')]('-')[0x0]][_0x082c('0x47')];}}}}}}catch(_0x437913){logger['error'](_0x082c('0x66'),util[_0x082c('0x4b')](_0x437913,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')][_0x082c('0x67')]=function(_0x10fb0f,_0x1cfcd5){if(this['channels'][_0x10fb0f]){this[_0x082c('0x19')][_0x10fb0f][_0x082c('0x68')]=!![];if(_[_0x082c('0x69')](_0x1cfcd5,_0x082c('0x6a'))){_0x1cfcd5=_0x1cfcd5['replace']('.wav49',_0x082c('0x6b'));}this[_0x082c('0x19')][_0x10fb0f][_0x082c('0x6c')]=_0x1cfcd5;var _0x3caaeb=_[_0x082c('0x6d')](this['channels'][_0x10fb0f][_0x082c('0x6e')],{'filename':_0x1cfcd5});if(_[_0x082c('0x6f')](_0x3caaeb)){this[_0x082c('0x19')][_0x10fb0f]['monitors'][_0x082c('0x70')]({'filename':_0x1cfcd5,'createdAt':moment()[_0x082c('0x3d')](_0x082c('0x3e')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x082c('0x32')][_0x082c('0x23')]=function(_0x37efc8){try{if(this['isNotNull'](_0x37efc8)){if(this[_0x082c('0x19')][_0x37efc8[_0x082c('0x37')]]&&_0x37efc8[_0x082c('0x3c')]!=_0x082c('0x4c')){if(this[_0x082c('0x33')](_0x37efc8[_0x082c('0x71')])){if(this['isNotNull'](_0x37efc8[_0x082c('0x71')]['mixmonitor_filename'])){this[_0x082c('0x67')](_0x37efc8[_0x082c('0x37')],_0x37efc8[_0x082c('0x72')]);}else if(this[_0x082c('0x33')](_0x37efc8[_0x082c('0x71')][_0x082c('0x73')])){this['channels'][_0x37efc8[_0x082c('0x37')]]['calleridnum']=_0x37efc8[_0x082c('0x72')];}else if(this[_0x082c('0x33')](_0x37efc8['variable'][_0x082c('0x74')])){this[_0x082c('0x19')][_0x37efc8[_0x082c('0x37')]][_0x082c('0x75')]=_0x37efc8[_0x082c('0x72')];}else if(this[_0x082c('0x33')](_0x37efc8[_0x082c('0x71')][_0x082c('0x76')])){this[_0x082c('0x19')][_0x37efc8[_0x082c('0x37')]][_0x082c('0x77')]=_0x37efc8[_0x082c('0x72')];}else if(this[_0x082c('0x33')](_0x37efc8[_0x082c('0x71')][_0x082c('0x78')])){this[_0x082c('0x19')][_0x37efc8['uniqueid']][_0x082c('0xe')]=_0x37efc8['value'][_0x082c('0x46')](',')[0x0];}else if(this['isNotNull'](_0x37efc8[_0x082c('0x71')]['xmd-originatecalleridnum'])){this[_0x082c('0x19')][_0x37efc8['uniqueid']]['originatecalleridnum']=_0x37efc8['value'];}else if(this['isNotNull'](_0x37efc8['variable'][_0x082c('0x79')])){this[_0x082c('0x19')][_0x37efc8[_0x082c('0x37')]][_0x082c('0x7a')]=_0x37efc8['value'];}else if(this[_0x082c('0x33')](_0x37efc8[_0x082c('0x71')][_0x082c('0x7b')])){this[_0x082c('0x19')][_0x37efc8['uniqueid']][_0x082c('0x7c')]=_0x37efc8[_0x082c('0x72')];}else if(this[_0x082c('0x33')](_0x37efc8['variable']['xmcs-queue'])){this[_0x082c('0x19')][_0x37efc8[_0x082c('0x37')]]['queue']=_0x37efc8[_0x082c('0x72')];}else if(this[_0x082c('0x33')](_0x37efc8[_0x082c('0x71')]['sipcallid'])){this[_0x082c('0x19')][_0x37efc8[_0x082c('0x37')]][_0x082c('0x7d')]=_0x37efc8[_0x082c('0x72')];}}}else if(this[_0x082c('0x33')](_0x37efc8[_0x082c('0x71')][_0x082c('0x7e')])){if(_0x37efc8[_0x082c('0x72')]){var _0x456743=path[_0x082c('0x7f')](_0x37efc8[_0x082c('0x72')])['name'];this[_0x082c('0x67')](_0x456743,_0x37efc8[_0x082c('0x72')]);}}else if(this[_0x082c('0x19')][_0x37efc8[_0x082c('0x36')]]){if(this['isNotNull'](_0x37efc8['variable'])){if(this['isNotNull'](_0x37efc8[_0x082c('0x71')][_0x082c('0x80')])){this[_0x082c('0x19')][_0x37efc8[_0x082c('0x36')]][_0x082c('0x81')]=_0x37efc8[_0x082c('0x72')];}}}}}catch(_0x4932d2){logger[_0x082c('0x3a')](_0x082c('0x82'),util[_0x082c('0x4b')](_0x4932d2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')][_0x082c('0x25')]=function(_0x272ed6){try{if(this[_0x082c('0x33')](_0x272ed6)){if(this[_0x082c('0x19')][_0x272ed6[_0x082c('0x37')]]){var _0x4bd8ad=moment();this['channels'][_0x272ed6[_0x082c('0x37')]][_0x082c('0x83')]=_0x4bd8ad[_0x082c('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x082c('0x19')][_0x272ed6[_0x082c('0x37')]][_0x082c('0x52')]=_0x4bd8ad[_0x082c('0x5f')](this['channels'][_0x272ed6[_0x082c('0x37')]]['starttime'],_0x082c('0x54'));if(this[_0x082c('0x19')][_0x272ed6[_0x082c('0x37')]]['answered']){this[_0x082c('0x19')][_0x272ed6['uniqueid']][_0x082c('0x84')]=_0x4bd8ad['diff'](this[_0x082c('0x19')][_0x272ed6[_0x082c('0x37')]][_0x082c('0x5e')],_0x082c('0x54'));this[_0x082c('0x19')][_0x272ed6['uniqueid']][_0x082c('0x85')]=this[_0x082c('0x19')][_0x272ed6[_0x082c('0x37')]][_0x082c('0x52')]-this['channels'][_0x272ed6[_0x082c('0x37')]][_0x082c('0x84')];}if(_0x272ed6[_0x082c('0x43')]===_0x082c('0x44')){if(this[_0x082c('0x1a')][_0x272ed6[_0x082c('0x3c')]['split']('-')[0x0]]){this[_0x082c('0x1a')][_0x272ed6[_0x082c('0x3c')]['split']('-')[0x0]]=_[_0x082c('0x86')](this['agents'][_0x272ed6['channel'][_0x082c('0x46')]('-')[0x0]],[_0x082c('0x87')]);this['emit'](util[_0x082c('0x3d')](_0x082c('0x88'),this[_0x082c('0x1a')][_0x272ed6['channel'][_0x082c('0x46')]('-')[0x0]]['name']),_0x082c('0x89'),{'destaccountcode':this[_0x082c('0x1a')][_0x272ed6[_0x082c('0x3c')][_0x082c('0x46')]('-')[0x0]][_0x082c('0x49')]});}}ami[_0x082c('0x35')]('custom:voiceCallReport',this['channels'][_0x272ed6[_0x082c('0x37')]]);delete this[_0x082c('0x19')][_0x272ed6['uniqueid']];}}}catch(_0x5d551a){logger['error']('[syncHangup][VoiceCallReport]',util[_0x082c('0x4b')](_0x5d551a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')][_0x082c('0x28')]=function(_0x571116){try{if(this[_0x082c('0x33')](_0x571116)){if(this[_0x082c('0x19')][_0x571116['transfereeuniqueid']]){this[_0x082c('0x19')][_0x571116['transfereeuniqueid']][_0x082c('0x8a')]=_0x571116[_0x082c('0x8b')];this[_0x082c('0x19')][_0x571116[_0x082c('0x8c')]]['transferconnectedlinenum']=_0x571116['transfertargetcalleridnum'];if(this['channels'][_0x571116['secondtransfereruniqueid']]){var _0x5773ef=this[_0x082c('0x19')][_0x571116[_0x082c('0x8d')]];this['channels'][_0x571116[_0x082c('0x8d')]]=this[_0x082c('0x19')][_0x571116[_0x082c('0x8c')]];this['channels'][_0x571116['transfereeuniqueid']]=_0x5773ef;}}else if(this[_0x082c('0x19')][_0x571116[_0x082c('0x8e')]]){this[_0x082c('0x19')][_0x571116[_0x082c('0x8e')]][_0x082c('0x8a')]=_0x571116[_0x082c('0x8b')];this[_0x082c('0x19')][_0x571116[_0x082c('0x8e')]][_0x082c('0x8f')]=_0x571116[_0x082c('0x90')];if(this[_0x082c('0x19')][_0x571116[_0x082c('0x91')]]){var _0x5773ef=this[_0x082c('0x19')][_0x571116[_0x082c('0x91')]];this[_0x082c('0x19')][_0x571116[_0x082c('0x91')]]=this[_0x082c('0x19')][_0x571116['transfertargetuniqueid']];this[_0x082c('0x19')][_0x571116[_0x082c('0x8e')]]=_0x5773ef;}}}}catch(_0x40bd1d){logger[_0x082c('0x3a')](_0x082c('0x92'),util['inspect'](_0x40bd1d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')][_0x082c('0x29')]=function(_0x597828){try{if(this[_0x082c('0x33')](_0x597828)){if(this[_0x082c('0x19')][_0x597828[_0x082c('0x8c')]]){this['channels'][_0x597828[_0x082c('0x8c')]]['transfercalleridnum']=_0x597828[_0x082c('0x93')];this[_0x082c('0x19')][_0x597828[_0x082c('0x8c')]][_0x082c('0x8f')]=_0x597828[_0x082c('0x94')];this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x597828[_0x082c('0x8c')],'context':_0x597828[_0x082c('0x43')],'channel':_0x597828[_0x082c('0x95')]});}}}catch(_0x4579b8){logger['error'](_0x082c('0x96'),util[_0x082c('0x4b')](_0x4579b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')]['syncMusicOnHoldStart']=function(_0x4282dc){try{if(this['isNotNull'](_0x4282dc)){if(this[_0x082c('0x19')][_0x4282dc['uniqueid']]){if(!_[_0x082c('0x6f')](this['channels'][_0x4282dc['uniqueid']][_0x082c('0x5e')])){this[_0x082c('0x19')][_0x4282dc[_0x082c('0x37')]][_0x082c('0x97')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x261123){logger[_0x082c('0x3a')](_0x082c('0x98'),util[_0x082c('0x4b')](_0x261123,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x082c('0x32')][_0x082c('0x2c')]=function(_0x284c04){try{if(this[_0x082c('0x33')](_0x284c04)){if(this['channels'][_0x284c04['uniqueid']]){if(!_[_0x082c('0x6f')](this[_0x082c('0x19')][_0x284c04[_0x082c('0x37')]][_0x082c('0x97')])){this[_0x082c('0x19')][_0x284c04[_0x082c('0x37')]][_0x082c('0x99')]+=moment()['milliseconds'](0x0)['diff'](this['channels'][_0x284c04[_0x082c('0x37')]][_0x082c('0x97')],_0x082c('0x54'));delete this['channels'][_0x284c04[_0x082c('0x37')]][_0x082c('0x97')];}}}}catch(_0x4f3279){logger[_0x082c('0x3a')](_0x082c('0x9a'),util[_0x082c('0x4b')](_0x4f3279,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
+var _0x06e2=['transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','musiconholdstart','musiconholdstop','then','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','pick','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','linkedid','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','context','from-sip','channel','split','destconnectedlinenum','format','user:%s','user:agentconnect','exten','[syncNewChannel][VoiceCallReport]','OutgoingSpoolFailed','application','applicationdata','appdata','toLowerCase','duration','subtract','seconds','set','match','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','connectedlinename','destinationchannel','membername','name','UserId','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','destination','calleridpreview','xmcs-queue','sipcallid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','billableseconds','accountcode','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x06e2,0x13a));var _0x206e=function(_0x456635,_0x467ba6){_0x456635=_0x456635-0x0;var _0x21e3e6=_0x06e2[_0x456635];return _0x21e3e6;};'use strict';var BPromise=require(_0x206e('0x0'));var _=require(_0x206e('0x1'));var moment=require(_0x206e('0x2'));var util=require(_0x206e('0x3'));var path=require('path');var Redis=require(_0x206e('0x4'));var config=require(_0x206e('0x5'));var logger=require(_0x206e('0x6'))('ami');var ami=require(_0x206e('0x7'));var Channel=require(_0x206e('0x8'));var statusDesc=[_0x206e('0x9'),'not_inuse',_0x206e('0xa'),_0x206e('0xb'),_0x206e('0xc'),_0x206e('0xd'),_0x206e('0xe'),_0x206e('0xf'),'onhold'];var applications=['set',_0x206e('0x10'),_0x206e('0x11'),_0x206e('0x12'),'playback',_0x206e('0x13')];var dispositions=[_0x206e('0x14'),'FAILED',_0x206e('0x15'),_0x206e('0x14'),'NO\x20ANSWER','NO\x20ANSWER',_0x206e('0x16'),_0x206e('0x17'),_0x206e('0x15'),_0x206e('0x15'),_0x206e('0x15')];var actions={};config[_0x206e('0x18')]=_['defaults'](config[_0x206e('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0x206e('0x19'))(new Redis(config[_0x206e('0x18')]));function VoiceCallReport(_0x5918a3){this[_0x206e('0x1a')]=_0x5918a3['channels'];this[_0x206e('0x1b')]=_0x5918a3[_0x206e('0x1b')];ami['on'](_0x206e('0x1c'),this[_0x206e('0x1d')][_0x206e('0x1e')](this));ami['on'](_0x206e('0x1f'),this[_0x206e('0x1d')][_0x206e('0x1e')](this));ami['on'](_0x206e('0x20'),this[_0x206e('0x21')][_0x206e('0x1e')](this));ami['on']('newstate',this[_0x206e('0x22')][_0x206e('0x1e')](this));ami['on'](_0x206e('0x23'),this[_0x206e('0x24')][_0x206e('0x1e')](this));ami['on'](_0x206e('0x25'),this[_0x206e('0x26')][_0x206e('0x1e')](this));ami['on'](_0x206e('0x27'),this['syncNewCallerId'][_0x206e('0x1e')](this));ami['on'](_0x206e('0x28'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x206e('0x1e')](this));ami['on'](_0x206e('0x29'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x206e('0x2a'),this['syncMusicOnHoldStop'][_0x206e('0x1e')](this));return BPromise['resolve']()[_0x206e('0x2b')](ami[_0x206e('0x2c')]())['catch'](function(_0x554afb){console[_0x206e('0x2d')](_0x554afb);});}VoiceCallReport[_0x206e('0x2e')][_0x206e('0x2f')]=function(_0x310d42){return _0x310d42!==null&&!_[_0x206e('0x30')](_0x310d42);};VoiceCallReport['prototype'][_0x206e('0x31')]=function(_0x4b9829,_0x14daa9,_0x1049b6){io['to'](_0x4b9829)['emit'](_0x14daa9,_0x1049b6);};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x32')]=function(_0x30e1e6){try{if(this[_0x206e('0x2f')](_0x30e1e6)){if(_0x30e1e6[_0x206e('0x33')]===_0x30e1e6['linkedid']){if(!_[_0x206e('0x30')](this['channels'][_0x30e1e6[_0x206e('0x33')]])){_['merge'](this[_0x206e('0x1a')][_0x30e1e6[_0x206e('0x33')]],_[_0x206e('0x34')](_0x30e1e6,_[_0x206e('0x35')](this[_0x206e('0x1a')][_0x30e1e6[_0x206e('0x33')]])));}}}}catch(_0x30fd33){logger[_0x206e('0x36')](_0x206e('0x37'),util[_0x206e('0x38')](_0x30fd33,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')]['syncNewChannel']=function(_0x56c368){try{if(this[_0x206e('0x2f')](_0x56c368)){if(_0x56c368['uniqueid']===_0x56c368[_0x206e('0x39')]&&_0x56c368['channel']!='OutgoingSpoolFailed'){if(_[_0x206e('0x30')](this[_0x206e('0x1a')][_0x56c368[_0x206e('0x33')]])){this[_0x206e('0x1a')][_0x56c368[_0x206e('0x33')]]=new Channel();this[_0x206e('0x1a')][_0x56c368[_0x206e('0x33')]][_0x206e('0x3a')]=moment()['format'](_0x206e('0x3b'));this[_0x206e('0x1a')][_0x56c368[_0x206e('0x33')]][_0x206e('0x3c')]=dispositions[_[_0x206e('0x3d')](_0x56c368[_0x206e('0x3e')])];_[_0x206e('0x3f')](this[_0x206e('0x1a')][_0x56c368['uniqueid']],_[_0x206e('0x34')](_0x56c368,_['keys'](this[_0x206e('0x1a')][_0x56c368[_0x206e('0x33')]])));if(_0x56c368[_0x206e('0x40')]===_0x206e('0x41')){if(this[_0x206e('0x1b')][_0x56c368[_0x206e('0x42')][_0x206e('0x43')]('-')[0x0]]){this[_0x206e('0x1b')][_0x56c368[_0x206e('0x42')][_0x206e('0x43')]('-')[0x0]][_0x206e('0x44')]=_0x56c368['exten'];this[_0x206e('0x31')](util[_0x206e('0x45')](_0x206e('0x46'),this[_0x206e('0x1b')][_0x56c368['channel'][_0x206e('0x43')]('-')[0x0]]['name']),_0x206e('0x47'),{'destaccountcode':this[_0x206e('0x1b')][_0x56c368[_0x206e('0x42')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x56c368[_0x206e('0x48')]});}}}}}}catch(_0x1e03f3){logger[_0x206e('0x36')](_0x206e('0x49'),util[_0x206e('0x38')](_0x1e03f3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x1d')]=function(_0x1a0425){try{if(this[_0x206e('0x2f')](_0x1a0425)){if(_0x1a0425['uniqueid']===_0x1a0425[_0x206e('0x39')]&&_0x1a0425[_0x206e('0x48')]!='h'&&_0x1a0425[_0x206e('0x42')]!=_0x206e('0x4a')){_0x1a0425[_0x206e('0x4b')]=_0x1a0425[_0x206e('0x4b')]['toLowerCase']();_0x1a0425[_0x206e('0x4c')]=(_0x1a0425[_0x206e('0x4d')]||_0x1a0425[_0x206e('0x4c')])[_0x206e('0x4e')]();if(_[_0x206e('0x30')](this['channels'][_0x1a0425[_0x206e('0x33')]])){this[_0x206e('0x1a')][_0x1a0425['uniqueid']]=new Channel();this['channels'][_0x1a0425['uniqueid']][_0x206e('0x3a')]=_0x1a0425[_0x206e('0x4f')]?moment()[_0x206e('0x50')](moment['duration'](_0x1a0425[_0x206e('0x4f')])[_0x206e('0x51')](),'seconds')[_0x206e('0x45')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x206e('0x45')](_0x206e('0x3b'));this[_0x206e('0x1a')][_0x1a0425[_0x206e('0x33')]][_0x206e('0x3c')]=_0x206e('0x14');}_['merge'](this[_0x206e('0x1a')][_0x1a0425[_0x206e('0x33')]],_[_0x206e('0x34')](_0x1a0425,_['keys'](this['channels'][_0x1a0425[_0x206e('0x33')]])));if(_['includes'](applications,_0x1a0425['application'])){this[_0x206e('0x1a')][_0x1a0425['uniqueid']]['lastapplication']=_0x1a0425['application'];this[_0x206e('0x1a')][_0x1a0425['uniqueid']]['lastdata']=_0x1a0425['applicationdata'];if(_0x1a0425['application']===_0x206e('0x52')&&_['startsWith'](_0x1a0425[_0x206e('0x4c')],'cdr(')){var _0x43cdca=_0x1a0425[_0x206e('0x4c')][_0x206e('0x43')]('=');var _0x476e7c=_0x43cdca[0x0][_0x206e('0x53')](/cdr\((.*)\)/);if(_0x476e7c){this['channels'][_0x1a0425[_0x206e('0x33')]][_0x476e7c[0x1]]=_0x43cdca[0x1];}}else if(_0x1a0425[_0x206e('0x4b')]===_0x206e('0x10')){this[_0x206e('0x1a')][_0x1a0425[_0x206e('0x33')]][_0x206e('0x10')]=_0x1a0425['applicationdata'][_0x206e('0x43')](',')[0x0];}}}}}catch(_0x4e68d1){logger['error'](_0x206e('0x54'),util[_0x206e('0x38')](_0x4e68d1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x206e('0x22')]=function(_0x5c9d96){try{if(this['isNotNull'](_0x5c9d96)){if(_0x5c9d96[_0x206e('0x33')]!==_0x5c9d96[_0x206e('0x39')]){if(this[_0x206e('0x1a')][_0x5c9d96['linkedid']]){if(_0x5c9d96['channelstate']==='6'){if(!this[_0x206e('0x1a')][_0x5c9d96['linkedid']][_0x206e('0x55')]){var _0x2f0b7f=moment();this['channels'][_0x5c9d96[_0x206e('0x39')]][_0x206e('0x55')]=!![];this[_0x206e('0x1a')][_0x5c9d96[_0x206e('0x39')]][_0x206e('0x56')]=_0x2f0b7f[_0x206e('0x45')](_0x206e('0x3b'));if(this[_0x206e('0x1a')][_0x5c9d96['linkedid']][_0x206e('0x3a')]){this[_0x206e('0x1a')][_0x5c9d96[_0x206e('0x39')]][_0x206e('0x57')]=_0x2f0b7f[_0x206e('0x58')](this[_0x206e('0x1a')][_0x5c9d96[_0x206e('0x39')]][_0x206e('0x3a')],'seconds');}}this['channels'][_0x5c9d96['linkedid']]['linkedid']=_0x5c9d96[_0x206e('0x33')];if(_0x5c9d96[_0x206e('0x59')]!=='xcally-motion-preview'){this[_0x206e('0x1a')][_0x5c9d96[_0x206e('0x39')]]['connectedlinenum']=_0x5c9d96[_0x206e('0x59')];}this[_0x206e('0x1a')][_0x5c9d96[_0x206e('0x39')]][_0x206e('0x5a')]=_0x5c9d96['calleridname'];this[_0x206e('0x1a')][_0x5c9d96[_0x206e('0x39')]][_0x206e('0x5b')]=_0x5c9d96[_0x206e('0x42')];this[_0x206e('0x1a')][_0x5c9d96['linkedid']]['disposition']=dispositions[_[_0x206e('0x3d')](_0x5c9d96['channelstate'])];if(this[_0x206e('0x1b')][_0x5c9d96[_0x206e('0x42')]['split']('-')[0x0]]){this[_0x206e('0x1a')][_0x5c9d96[_0x206e('0x39')]]['UserId']=this[_0x206e('0x1b')][_0x5c9d96['channel'][_0x206e('0x43')]('-')[0x0]]['id'];this['channels'][_0x5c9d96[_0x206e('0x39')]][_0x206e('0x5c')]=this[_0x206e('0x1b')][_0x5c9d96[_0x206e('0x42')]['split']('-')[0x0]][_0x206e('0x5d')];}}}}else{if(this[_0x206e('0x1a')][_0x5c9d96['uniqueid']]){if(_0x5c9d96[_0x206e('0x3e')]==='6'){if(this['agents'][_0x5c9d96[_0x206e('0x42')][_0x206e('0x43')]('-')[0x0]]){this['channels'][_0x5c9d96[_0x206e('0x33')]][_0x206e('0x5e')]=this[_0x206e('0x1b')][_0x5c9d96[_0x206e('0x42')][_0x206e('0x43')]('-')[0x0]]['id'];this['channels'][_0x5c9d96['uniqueid']][_0x206e('0x5c')]=this['agents'][_0x5c9d96[_0x206e('0x42')]['split']('-')[0x0]][_0x206e('0x5d')];}}}}}}catch(_0x7925d9){logger[_0x206e('0x36')]('[syncNewState][VoiceCallReport]',util[_0x206e('0x38')](_0x7925d9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x5f')]=function(_0x11f2e2,_0x15578b){if(this[_0x206e('0x1a')][_0x11f2e2]){this[_0x206e('0x1a')][_0x11f2e2][_0x206e('0x60')]=!![];if(_[_0x206e('0x61')](_0x15578b,_0x206e('0x62'))){_0x15578b=_0x15578b[_0x206e('0x63')](_0x206e('0x62'),_0x206e('0x64'));}this['channels'][_0x11f2e2][_0x206e('0x65')]=_0x15578b;var _0x530c21=_[_0x206e('0x66')](this[_0x206e('0x1a')][_0x11f2e2][_0x206e('0x67')],{'filename':_0x15578b});if(_['isNil'](_0x530c21)){this[_0x206e('0x1a')][_0x11f2e2][_0x206e('0x67')][_0x206e('0x68')]({'filename':_0x15578b,'createdAt':moment()[_0x206e('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x206e('0x69')});}}};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x24')]=function(_0x2b0fc4){try{if(this[_0x206e('0x2f')](_0x2b0fc4)){if(this['channels'][_0x2b0fc4[_0x206e('0x33')]]&&_0x2b0fc4[_0x206e('0x42')]!=_0x206e('0x4a')){if(this['isNotNull'](_0x2b0fc4[_0x206e('0x6a')])){if(this['isNotNull'](_0x2b0fc4['variable'][_0x206e('0x6b')])){this[_0x206e('0x5f')](_0x2b0fc4[_0x206e('0x33')],_0x2b0fc4[_0x206e('0x6c')]);}else if(this[_0x206e('0x2f')](_0x2b0fc4[_0x206e('0x6a')][_0x206e('0x6d')])){this[_0x206e('0x1a')][_0x2b0fc4[_0x206e('0x33')]][_0x206e('0x59')]=_0x2b0fc4[_0x206e('0x6c')];}else if(this['isNotNull'](_0x2b0fc4[_0x206e('0x6a')]['xmd-callerid'])){this[_0x206e('0x1a')][_0x2b0fc4['uniqueid']]['callerid']=_0x2b0fc4['value'];}else if(this[_0x206e('0x2f')](_0x2b0fc4[_0x206e('0x6a')][_0x206e('0x6e')])){this[_0x206e('0x1a')][_0x2b0fc4[_0x206e('0x33')]][_0x206e('0x6f')]=_0x2b0fc4[_0x206e('0x6c')];}else if(this[_0x206e('0x2f')](_0x2b0fc4[_0x206e('0x6a')][_0x206e('0x70')])){this[_0x206e('0x1a')][_0x2b0fc4[_0x206e('0x33')]][_0x206e('0x10')]=_0x2b0fc4[_0x206e('0x6c')]['split'](',')[0x0];}else if(this[_0x206e('0x2f')](_0x2b0fc4[_0x206e('0x6a')][_0x206e('0x71')])){this[_0x206e('0x1a')][_0x2b0fc4[_0x206e('0x33')]]['originatecalleridnum']=_0x2b0fc4[_0x206e('0x6c')];}else if(this[_0x206e('0x2f')](_0x2b0fc4['variable']['xmd-destination'])){this['channels'][_0x2b0fc4[_0x206e('0x33')]][_0x206e('0x72')]=_0x2b0fc4[_0x206e('0x6c')];}else if(this['isNotNull'](_0x2b0fc4[_0x206e('0x6a')]['xmd-callerid-preview'])){this[_0x206e('0x1a')][_0x2b0fc4[_0x206e('0x33')]][_0x206e('0x73')]=_0x2b0fc4['value'];}else if(this[_0x206e('0x2f')](_0x2b0fc4[_0x206e('0x6a')][_0x206e('0x74')])){this[_0x206e('0x1a')][_0x2b0fc4['uniqueid']]['queue']=_0x2b0fc4['value'];}else if(this['isNotNull'](_0x2b0fc4[_0x206e('0x6a')][_0x206e('0x75')])){this['channels'][_0x2b0fc4[_0x206e('0x33')]]['sipcalluniqueid']=_0x2b0fc4[_0x206e('0x6c')];}}}else if(this[_0x206e('0x2f')](_0x2b0fc4['variable'][_0x206e('0x6b')])){if(_0x2b0fc4['value']){var _0x3164fe=path[_0x206e('0x76')](_0x2b0fc4[_0x206e('0x6c')])[_0x206e('0x5d')];this[_0x206e('0x5f')](_0x3164fe,_0x2b0fc4[_0x206e('0x6c')]);}}else if(this[_0x206e('0x1a')][_0x2b0fc4['linkedid']]){if(this[_0x206e('0x2f')](_0x2b0fc4['variable'])){if(this['isNotNull'](_0x2b0fc4[_0x206e('0x6a')][_0x206e('0x75')])){this[_0x206e('0x1a')][_0x2b0fc4[_0x206e('0x39')]][_0x206e('0x77')]=_0x2b0fc4[_0x206e('0x6c')];}}}}}catch(_0x154042){logger[_0x206e('0x36')](_0x206e('0x78'),util['inspect'](_0x154042,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')]['syncHangup']=function(_0x1ce98f){try{if(this[_0x206e('0x2f')](_0x1ce98f)){if(this['channels'][_0x1ce98f['uniqueid']]){var _0x2dae6c=moment();this['channels'][_0x1ce98f[_0x206e('0x33')]]['endtime']=_0x2dae6c[_0x206e('0x45')](_0x206e('0x3b'));this['channels'][_0x1ce98f['uniqueid']][_0x206e('0x4f')]=_0x2dae6c['diff'](this[_0x206e('0x1a')][_0x1ce98f[_0x206e('0x33')]][_0x206e('0x3a')],_0x206e('0x51'));if(this[_0x206e('0x1a')][_0x1ce98f[_0x206e('0x33')]][_0x206e('0x55')]){this['channels'][_0x1ce98f[_0x206e('0x33')]][_0x206e('0x79')]=_0x2dae6c[_0x206e('0x58')](this[_0x206e('0x1a')][_0x1ce98f[_0x206e('0x33')]][_0x206e('0x56')],_0x206e('0x51'));this[_0x206e('0x1a')][_0x1ce98f[_0x206e('0x33')]]['holdtime']=this[_0x206e('0x1a')][_0x1ce98f[_0x206e('0x33')]]['duration']-this[_0x206e('0x1a')][_0x1ce98f[_0x206e('0x33')]][_0x206e('0x79')];}if(_0x1ce98f['context']===_0x206e('0x41')){if(this[_0x206e('0x1b')][_0x1ce98f['channel'][_0x206e('0x43')]('-')[0x0]]){this[_0x206e('0x1b')][_0x1ce98f[_0x206e('0x42')][_0x206e('0x43')]('-')[0x0]]=_['omit'](this['agents'][_0x1ce98f[_0x206e('0x42')][_0x206e('0x43')]('-')[0x0]],[_0x206e('0x44')]);this[_0x206e('0x31')](util[_0x206e('0x45')](_0x206e('0x46'),this[_0x206e('0x1b')][_0x1ce98f['channel']['split']('-')[0x0]][_0x206e('0x5d')]),'user:agentcomplete',{'destaccountcode':this[_0x206e('0x1b')][_0x1ce98f[_0x206e('0x42')][_0x206e('0x43')]('-')[0x0]][_0x206e('0x7a')]});}}ami[_0x206e('0x31')]('custom:voiceCallReport',this[_0x206e('0x1a')][_0x1ce98f['uniqueid']]);delete this['channels'][_0x1ce98f[_0x206e('0x33')]];}}}catch(_0x400985){logger[_0x206e('0x36')]('[syncHangup][VoiceCallReport]',util[_0x206e('0x38')](_0x400985,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x7b')]=function(_0xb670ac){try{if(this[_0x206e('0x2f')](_0xb670ac)){if(this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x7c')]]){this[_0x206e('0x1a')][_0xb670ac['transfereeuniqueid']][_0x206e('0x7d')]=_0xb670ac[_0x206e('0x7e')];this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x7c')]][_0x206e('0x7f')]=_0xb670ac[_0x206e('0x80')];if(this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x81')]]){var _0x335e7d=this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x81')]];this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x81')]]=this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x7c')]];this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x7c')]]=_0x335e7d;}}else if(this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x82')]]){this['channels'][_0xb670ac['transfertargetuniqueid']][_0x206e('0x7d')]=_0xb670ac[_0x206e('0x7e')];this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x82')]][_0x206e('0x7f')]=_0xb670ac['transfertargetcalleridnum'];if(this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x83')]]){var _0x335e7d=this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x83')]];this['channels'][_0xb670ac[_0x206e('0x83')]]=this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x82')]];this[_0x206e('0x1a')][_0xb670ac[_0x206e('0x82')]]=_0x335e7d;}}}}catch(_0x4aa215){logger[_0x206e('0x36')](_0x206e('0x84'),util[_0x206e('0x38')](_0x4aa215,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x85')]=function(_0x5bb105){try{if(this[_0x206e('0x2f')](_0x5bb105)){if(this[_0x206e('0x1a')][_0x5bb105[_0x206e('0x7c')]]){this[_0x206e('0x1a')][_0x5bb105['transfereeuniqueid']]['transfercalleridnum']=_0x5bb105[_0x206e('0x86')];this[_0x206e('0x1a')][_0x5bb105[_0x206e('0x7c')]][_0x206e('0x7f')]=_0x5bb105['extension'];this[_0x206e('0x26')]({'event':_0x206e('0x87'),'uniqueid':_0x5bb105[_0x206e('0x7c')],'context':_0x5bb105['context'],'channel':_0x5bb105[_0x206e('0x88')]});}}}catch(_0x5adb89){logger[_0x206e('0x36')](_0x206e('0x89'),util[_0x206e('0x38')](_0x5adb89,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x8a')]=function(_0x173bb3){try{if(this[_0x206e('0x2f')](_0x173bb3)){if(this[_0x206e('0x1a')][_0x173bb3[_0x206e('0x33')]]){if(!_[_0x206e('0x8b')](this[_0x206e('0x1a')][_0x173bb3['uniqueid']][_0x206e('0x56')])){this[_0x206e('0x1a')][_0x173bb3[_0x206e('0x33')]][_0x206e('0x8c')]=moment()[_0x206e('0x45')](_0x206e('0x3b'));}}}}catch(_0x9f1e5a){logger[_0x206e('0x36')](_0x206e('0x8d'),util[_0x206e('0x38')](_0x9f1e5a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x206e('0x2e')][_0x206e('0x8e')]=function(_0x20c989){try{if(this[_0x206e('0x2f')](_0x20c989)){if(this[_0x206e('0x1a')][_0x20c989[_0x206e('0x33')]]){if(!_[_0x206e('0x8b')](this[_0x206e('0x1a')][_0x20c989[_0x206e('0x33')]][_0x206e('0x8c')])){this[_0x206e('0x1a')][_0x20c989[_0x206e('0x33')]][_0x206e('0x8f')]+=moment()[_0x206e('0x90')](0x0)[_0x206e('0x58')](this[_0x206e('0x1a')][_0x20c989['uniqueid']]['mohstarttime'],_0x206e('0x51'));delete this[_0x206e('0x1a')][_0x20c989[_0x206e('0x33')]][_0x206e('0x8c')];}}}}catch(_0x11a982){logger[_0x206e('0x36')](_0x206e('0x91'),util[_0x206e('0x38')](_0x11a982,{'showHidden':![],'depth':null}));}};module[_0x206e('0x92')]=VoiceCallReport;
\ No newline at end of file
index b669927..2848a4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7f9=['emit','syncDialBegin','isNotNull','merge','uniqueid','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','answertime','format','lastevent','connect','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','keys','variable','value','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','syncHangup','duration','endtime','diff','seconds','complete','total','answered','starttime','sumHoldTime','holdtime','sumBillable','billableseconds','sumDuration','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','variables','dialbegin','bind','syncDialEnd','varset','syncVarSet','hangup','prototype','isUndefined'];(function(_0x111f05,_0x3801da){var _0xbcdf6a=function(_0x46a85c){while(--_0x46a85c){_0x111f05['push'](_0x111f05['shift']());}};_0xbcdf6a(++_0x3801da);}(_0xd7f9,0xec));var _0x9d7f=function(_0x5c619e,_0x1bccdf){_0x5c619e=_0x5c619e-0x0;var _0x445cf8=_0xd7f9[_0x5c619e];return _0x445cf8;};'use strict';var _=require(_0x9d7f('0x0'));var moment=require(_0x9d7f('0x1'));var util=require(_0x9d7f('0x2'));var Redis=require(_0x9d7f('0x3'));var config=require('../../../config/environment');var logger=require(_0x9d7f('0x4'))(_0x9d7f('0x5'));var ami=require(_0x9d7f('0x6'));config[_0x9d7f('0x7')]=_[_0x9d7f('0x8')](config[_0x9d7f('0x7')],{'host':_0x9d7f('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9d7f('0x7')]));function VoiceDialReport(_0x5443c2){this[_0x9d7f('0xa')]=_0x5443c2[_0x9d7f('0xb')];this[_0x9d7f('0xc')]=_0x5443c2['outbound'];this[_0x9d7f('0xd')]={};ami['on'](_0x9d7f('0xe'),this['syncDialBegin'][_0x9d7f('0xf')](this));ami['on']('dialend',this[_0x9d7f('0x10')][_0x9d7f('0xf')](this));ami['on'](_0x9d7f('0x11'),this[_0x9d7f('0x12')][_0x9d7f('0xf')](this));ami['on'](_0x9d7f('0x13'),this['syncHangup']['bind'](this));}VoiceDialReport[_0x9d7f('0x14')]['isNotNull']=function(_0x20f042){return _0x20f042!==null&&!_[_0x9d7f('0x15')](_0x20f042);};VoiceDialReport[_0x9d7f('0x14')][_0x9d7f('0x16')]=function(_0x1bc2e8,_0x362ee7,_0x27d8cd){io['to'](_0x1bc2e8)[_0x9d7f('0x16')](_0x362ee7,_0x27d8cd);};VoiceDialReport[_0x9d7f('0x14')][_0x9d7f('0x17')]=function(_0xca9c12){try{if(this[_0x9d7f('0x18')](_0xca9c12)){if(this[_0x9d7f('0xa')][_0xca9c12['uniqueid']]){_[_0x9d7f('0x19')](this[_0x9d7f('0xa')][_0xca9c12[_0x9d7f('0x1a')]],{'starttime':moment()['format'](_0x9d7f('0x1b')),'lastevent':'called','interface':_0xca9c12[_0x9d7f('0x1c')][_0x9d7f('0x1d')](0x0,_0xca9c12[_0x9d7f('0x1c')][_0x9d7f('0x1e')]('-')),'membername':_0xca9c12['channel'][_0x9d7f('0x1d')](_0xca9c12[_0x9d7f('0x1c')][_0x9d7f('0x1e')]('/')+0x1,_0xca9c12['channel'][_0x9d7f('0x1e')]('-'))},_[_0x9d7f('0x1f')](_0xca9c12,['event','privilege']));this[_0x9d7f('0x16')](_0x9d7f('0x20'),_0x9d7f('0x21'),this[_0x9d7f('0xa')][_0xca9c12[_0x9d7f('0x1a')]]);ami[_0x9d7f('0x16')](_0x9d7f('0x22'),this['channels'][_0xca9c12[_0x9d7f('0x1a')]]);}}}catch(_0x227587){logger['error'](_0x9d7f('0x23'),util[_0x9d7f('0x24')](_0x227587,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9d7f('0x14')]['syncDialEnd']=function(_0x2ba978){try{if(this[_0x9d7f('0x18')](_0x2ba978)){if(this[_0x9d7f('0xa')][_0x2ba978[_0x9d7f('0x1a')]]){this[_0x9d7f('0xa')][_0x2ba978[_0x9d7f('0x1a')]]['dialstatus']=_0x2ba978[_0x9d7f('0x25')];if(_0x2ba978[_0x9d7f('0x25')]===_0x9d7f('0x26')){this[_0x9d7f('0xa')][_0x2ba978[_0x9d7f('0x1a')]][_0x9d7f('0x27')]=_0x2ba978[_0x9d7f('0x27')];this['channels'][_0x2ba978[_0x9d7f('0x1a')]]['connectedlinename']=_0x2ba978['connectedlinename'];this[_0x9d7f('0xa')][_0x2ba978[_0x9d7f('0x1a')]][_0x9d7f('0x28')]=moment()[_0x9d7f('0x29')](_0x9d7f('0x1b'));this['channels'][_0x2ba978['uniqueid']][_0x9d7f('0x2a')]=_0x9d7f('0x2b');ami[_0x9d7f('0x16')](_0x9d7f('0x2c'),this[_0x9d7f('0xa')][_0x2ba978[_0x9d7f('0x1a')]]);}this[_0x9d7f('0x16')](_0x9d7f('0x20'),_0x9d7f('0x21'),this[_0x9d7f('0xa')][_0x2ba978[_0x9d7f('0x1a')]]);}}}catch(_0x3c6b57){logger[_0x9d7f('0x2d')](_0x9d7f('0x2e'),util[_0x9d7f('0x24')](_0x3c6b57,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x3907d8){try{if(this[_0x9d7f('0x18')](_0x3907d8)){this['addVariable'](_0x3907d8[_0x9d7f('0x1a')],_[_0x9d7f('0x2f')](_0x3907d8[_0x9d7f('0x30')])[0x0],_0x3907d8[_0x9d7f('0x31')]);if(this['isNotNull'](_0x3907d8[_0x9d7f('0x30')])&&this[_0x9d7f('0x18')](_0x3907d8['variable']['outboundrouteid'])){if(_[_0x9d7f('0x15')](this[_0x9d7f('0xa')][_0x3907d8[_0x9d7f('0x1a')]])){this['channels'][_0x3907d8['uniqueid']]={'routeId':_0x3907d8[_0x9d7f('0x31')],'variables':this[_0x9d7f('0xd')][_0x3907d8[_0x9d7f('0x1a')]]};this[_0x9d7f('0x16')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x3907d8[_0x9d7f('0x1a')]]);}}}}catch(_0x2e051c){logger[_0x9d7f('0x2d')](_0x9d7f('0x32'),util[_0x9d7f('0x24')](_0x2e051c,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x9d7f('0x33')]=function(_0x1ad968,_0x2a5535,_0x228f61){var _0x3c9bee=['rtpaudioqos',_0x9d7f('0x34'),_0x9d7f('0x35'),'rtpaudioqosjitterbridged',_0x9d7f('0x36'),'rtpaudioqoslossbridged',_0x9d7f('0x37'),'rtpaudioqosrttbridged',_0x9d7f('0x38'),_0x9d7f('0x39'),'bridgepeer',_0x9d7f('0x3a'),_0x9d7f('0x3b'),_0x9d7f('0x3c'),_0x9d7f('0x3d'),_0x9d7f('0x3e'),_0x9d7f('0x3f'),_0x9d7f('0x40'),_0x9d7f('0x41')];if(!_[_0x9d7f('0x42')](_0x2a5535)&&!_[_0x9d7f('0x43')](_0x3c9bee,_0x2a5535)){if(_[_0x9d7f('0x15')](this[_0x9d7f('0xd')][_0x1ad968])){this[_0x9d7f('0xd')][_0x1ad968]={};}this[_0x9d7f('0xd')][_0x1ad968][_0x2a5535]=_0x228f61;}};VoiceDialReport[_0x9d7f('0x14')][_0x9d7f('0x44')]=function(_0x458a25){try{if(this[_0x9d7f('0x18')](_0x458a25)){if(this['channels'][_0x458a25[_0x9d7f('0x1a')]]){this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]['endtime']=moment()[_0x9d7f('0x29')](_0x9d7f('0x1b'));this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]][_0x9d7f('0x45')]=moment(this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]][_0x9d7f('0x46')])[_0x9d7f('0x47')](this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]['starttime'],_0x9d7f('0x48'));this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]['lastevent']=_0x9d7f('0x49');this[_0x9d7f('0xc')][_0x9d7f('0x4a')]+=0x1;if(this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]['answertime']){this[_0x9d7f('0xc')][_0x9d7f('0x4b')]+=0x1;this[_0x9d7f('0xa')][_0x458a25['uniqueid']]['holdtime']=moment(this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]][_0x9d7f('0x28')])[_0x9d7f('0x47')](this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]][_0x9d7f('0x4c')],_0x9d7f('0x48'));this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]['billableseconds']=moment(this['channels'][_0x458a25['uniqueid']][_0x9d7f('0x46')])[_0x9d7f('0x47')](this['channels'][_0x458a25[_0x9d7f('0x1a')]][_0x9d7f('0x28')],_0x9d7f('0x48'));this[_0x9d7f('0xc')][_0x9d7f('0x4d')]+=this['channels'][_0x458a25[_0x9d7f('0x1a')]][_0x9d7f('0x4e')]||0x0;this['outbound'][_0x9d7f('0x4f')]+=this['channels'][_0x458a25[_0x9d7f('0x1a')]][_0x9d7f('0x50')];}this[_0x9d7f('0xc')][_0x9d7f('0x51')]+=this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]['duration'];ami[_0x9d7f('0x16')]('custom:voiceDialReport',this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]);ami[_0x9d7f('0x16')](_0x9d7f('0x52'),this[_0x9d7f('0xa')][_0x458a25['uniqueid']]);this[_0x9d7f('0x16')]('voice:outbound',_0x9d7f('0x53'),this[_0x9d7f('0xc')]);this['emit'](_0x9d7f('0x20'),_0x9d7f('0x54'),this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]]);delete this[_0x9d7f('0xa')][_0x458a25[_0x9d7f('0x1a')]];}if(this['variables'][_0x458a25[_0x9d7f('0x1a')]]){delete this[_0x9d7f('0xd')][_0x458a25[_0x9d7f('0x1a')]];}}}catch(_0x5e0a74){logger[_0x9d7f('0x2d')]('[syncHangup][VoiceDialReport]',util['inspect'](_0x5e0a74,{'showHidden':![],'depth':null}));}};module[_0x9d7f('0x55')]=VoiceDialReport;
\ No newline at end of file
+var _0xd853=['bridgepvtcallid','memberdynamic','memberpenalty','memberrealtime','isNil','endtime','diff','starttime','seconds','answered','holdtime','billableseconds','sumHoldTime','sumBillable','duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','syncVarSet','syncHangup','prototype','isNotNull','isUndefined','uniqueid','format','called','channel','substring','lastIndexOf','omit','event','privilege','emit','voice:outbound','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[syncDialEnd][VoiceDialReport]','addVariable','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','sipcallid'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xd853,0xb1));var _0x3d85=function(_0x17bfa4,_0x3eb5f7){_0x17bfa4=_0x17bfa4-0x0;var _0x3d9ca8=_0xd853[_0x17bfa4];return _0x3d9ca8;};'use strict';var _=require(_0x3d85('0x0'));var moment=require(_0x3d85('0x1'));var util=require(_0x3d85('0x2'));var Redis=require(_0x3d85('0x3'));var config=require(_0x3d85('0x4'));var logger=require(_0x3d85('0x5'))(_0x3d85('0x6'));var ami=require('../ami');config[_0x3d85('0x7')]=_[_0x3d85('0x8')](config[_0x3d85('0x7')],{'host':_0x3d85('0x9'),'port':0x18eb});var io=require(_0x3d85('0xa'))(new Redis(config[_0x3d85('0x7')]));function VoiceDialReport(_0x4f66cc){this[_0x3d85('0xb')]=_0x4f66cc[_0x3d85('0xc')];this[_0x3d85('0xd')]=_0x4f66cc[_0x3d85('0xd')];this[_0x3d85('0xe')]={};ami['on'](_0x3d85('0xf'),this[_0x3d85('0x10')]['bind'](this));ami['on'](_0x3d85('0x11'),this[_0x3d85('0x12')][_0x3d85('0x13')](this));ami['on']('varset',this[_0x3d85('0x14')]['bind'](this));ami['on']('hangup',this[_0x3d85('0x15')][_0x3d85('0x13')](this));}VoiceDialReport[_0x3d85('0x16')][_0x3d85('0x17')]=function(_0x11d598){return _0x11d598!==null&&!_[_0x3d85('0x18')](_0x11d598);};VoiceDialReport[_0x3d85('0x16')]['emit']=function(_0x5e5156,_0x23ac44,_0x4ed029){io['to'](_0x5e5156)['emit'](_0x23ac44,_0x4ed029);};VoiceDialReport[_0x3d85('0x16')]['syncDialBegin']=function(_0xa197){try{if(this[_0x3d85('0x17')](_0xa197)){if(this[_0x3d85('0xb')][_0xa197[_0x3d85('0x19')]]){_['merge'](this[_0x3d85('0xb')][_0xa197[_0x3d85('0x19')]],{'starttime':moment()[_0x3d85('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x3d85('0x1b'),'interface':_0xa197[_0x3d85('0x1c')][_0x3d85('0x1d')](0x0,_0xa197[_0x3d85('0x1c')]['lastIndexOf']('-')),'membername':_0xa197[_0x3d85('0x1c')][_0x3d85('0x1d')](_0xa197[_0x3d85('0x1c')][_0x3d85('0x1e')]('/')+0x1,_0xa197[_0x3d85('0x1c')][_0x3d85('0x1e')]('-'))},_[_0x3d85('0x1f')](_0xa197,[_0x3d85('0x20'),_0x3d85('0x21')]));this[_0x3d85('0x22')](_0x3d85('0x23'),_0x3d85('0x24'),this[_0x3d85('0xb')][_0xa197[_0x3d85('0x19')]]);ami[_0x3d85('0x22')]('custom:dialbegin',this['channels'][_0xa197[_0x3d85('0x19')]]);}}}catch(_0x3f845a){logger[_0x3d85('0x25')](_0x3d85('0x26'),util[_0x3d85('0x27')](_0x3f845a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3d85('0x16')][_0x3d85('0x12')]=function(_0x6a224a){try{if(this[_0x3d85('0x17')](_0x6a224a)){if(this[_0x3d85('0xb')][_0x6a224a[_0x3d85('0x19')]]){this[_0x3d85('0xb')][_0x6a224a[_0x3d85('0x19')]][_0x3d85('0x28')]=_0x6a224a[_0x3d85('0x28')];if(_0x6a224a[_0x3d85('0x28')]===_0x3d85('0x29')){this[_0x3d85('0xb')][_0x6a224a[_0x3d85('0x19')]][_0x3d85('0x2a')]=_0x6a224a['connectedlinenum'];this[_0x3d85('0xb')][_0x6a224a[_0x3d85('0x19')]][_0x3d85('0x2b')]=_0x6a224a['connectedlinename'];this[_0x3d85('0xb')][_0x6a224a[_0x3d85('0x19')]][_0x3d85('0x2c')]=moment()[_0x3d85('0x1a')](_0x3d85('0x2d'));this[_0x3d85('0xb')][_0x6a224a['uniqueid']][_0x3d85('0x2e')]=_0x3d85('0x2f');ami[_0x3d85('0x22')]('custom:dialconnect',this[_0x3d85('0xb')][_0x6a224a[_0x3d85('0x19')]]);}this[_0x3d85('0x22')](_0x3d85('0x23'),'voice_outbound_channel:save',this['channels'][_0x6a224a[_0x3d85('0x19')]]);}}}catch(_0x507a2b){logger['error'](_0x3d85('0x30'),util[_0x3d85('0x27')](_0x507a2b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3d85('0x16')][_0x3d85('0x14')]=function(_0x55f276){try{if(this['isNotNull'](_0x55f276)){this[_0x3d85('0x31')](_0x55f276[_0x3d85('0x19')],_['keys'](_0x55f276[_0x3d85('0x32')])[0x0],_0x55f276[_0x3d85('0x33')]);if(this[_0x3d85('0x17')](_0x55f276[_0x3d85('0x32')])&&this[_0x3d85('0x17')](_0x55f276[_0x3d85('0x32')][_0x3d85('0x34')])){if(_[_0x3d85('0x18')](this['channels'][_0x55f276['uniqueid']])){this['channels'][_0x55f276[_0x3d85('0x19')]]={'routeId':_0x55f276['value'],'variables':this['variables'][_0x55f276['uniqueid']]};this[_0x3d85('0x22')]('voice:outbound',_0x3d85('0x24'),this[_0x3d85('0xb')][_0x55f276[_0x3d85('0x19')]]);}}}}catch(_0x531710){logger[_0x3d85('0x25')](_0x3d85('0x35'),util[_0x3d85('0x27')](_0x531710,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x3d85('0x16')][_0x3d85('0x31')]=function(_0x1ad13d,_0x4c99cd,_0x524012){var _0x27d479=[_0x3d85('0x36'),_0x3d85('0x37'),_0x3d85('0x38'),_0x3d85('0x39'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x3d85('0x3a'),'rtpaudioqosrttbridged',_0x3d85('0x3b'),'sipuri','bridgepeer',_0x3d85('0x3c'),'membercalls',_0x3d85('0x3d'),'memberinterface','memberlastcall','membername',_0x3d85('0x3e'),_0x3d85('0x3f')];if(!_[_0x3d85('0x40')](_0x4c99cd)&&!_['includes'](_0x27d479,_0x4c99cd)){if(_[_0x3d85('0x18')](this[_0x3d85('0xe')][_0x1ad13d])){this[_0x3d85('0xe')][_0x1ad13d]={};}this['variables'][_0x1ad13d][_0x4c99cd]=_0x524012;}};VoiceDialReport['prototype'][_0x3d85('0x15')]=function(_0x206810){try{if(this[_0x3d85('0x17')](_0x206810)){if(this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]]){this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x41')]=moment()[_0x3d85('0x1a')](_0x3d85('0x2d'));this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]]['duration']=moment(this['channels'][_0x206810['uniqueid']][_0x3d85('0x41')])[_0x3d85('0x42')](this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x43')],_0x3d85('0x44'));this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x2e')]='complete';this['outbound']['total']+=0x1;if(this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x2c')]){this['outbound'][_0x3d85('0x45')]+=0x1;this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x46')]=moment(this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x2c')])[_0x3d85('0x42')](this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]]['starttime'],_0x3d85('0x44'));this[_0x3d85('0xb')][_0x206810['uniqueid']][_0x3d85('0x47')]=moment(this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x41')])[_0x3d85('0x42')](this['channels'][_0x206810[_0x3d85('0x19')]]['answertime'],'seconds');this[_0x3d85('0xd')][_0x3d85('0x48')]+=this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x46')]||0x0;this['outbound'][_0x3d85('0x49')]+=this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x47')];}this[_0x3d85('0xd')]['sumDuration']+=this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]][_0x3d85('0x4a')];ami[_0x3d85('0x22')](_0x3d85('0x4b'),this[_0x3d85('0xb')][_0x206810['uniqueid']]);ami['emit'](_0x3d85('0x4c'),this[_0x3d85('0xb')][_0x206810[_0x3d85('0x19')]]);this['emit'](_0x3d85('0x23'),_0x3d85('0x4d'),this['outbound']);this[_0x3d85('0x22')](_0x3d85('0x23'),_0x3d85('0x4e'),this['channels'][_0x206810[_0x3d85('0x19')]]);delete this[_0x3d85('0xb')][_0x206810['uniqueid']];}if(this[_0x3d85('0xe')][_0x206810[_0x3d85('0x19')]]){delete this[_0x3d85('0xe')][_0x206810['uniqueid']];}}}catch(_0x22b178){logger[_0x3d85('0x25')]('[syncHangup][VoiceDialReport]',util[_0x3d85('0x27')](_0x22b178,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
index e9aebbf..de64153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfc7=['ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','bind','queuecallerabandon','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','clearZombieChannels','isNil','Action','status','catch','message','No\x20such\x20channel','error','variables','[voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','type','inbound','strategy','answered','available','loggedIn','sumHoldTime','total','unmanaged','abandoned','Trunk','active','Interval','stringify','voice_queue:save','[queues]','queuesummary','then','[queuesummary]','isNotNull','queue','countBy','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','isUndefined','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','syncQueueCallerAbandon','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','membername','queuecallerexitAt','transfer','startsWith','toLowerCase','local/','linkedid','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','reason','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','queuestatus','value','queuecallerexit','queueposition','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberrealtime','length','diff','seconds','sumDuration','sumBillable','milliseconds','queuecallercompleteAt','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','[syncHangup][VoiceQueueReport]','syncAttendedTransfer','transfereeuniqueid','transferexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','context','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','bluebird','util','md5'];(function(_0x772a1f,_0x1c217b){var _0x434da9=function(_0x2b68ec){while(--_0x2b68ec){_0x772a1f['push'](_0x772a1f['shift']());}};_0x434da9(++_0x1c217b);}(_0xdfc7,0xc1));var _0x7dfc=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xdfc7[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x7dfc('0x0'));var util=require(_0x7dfc('0x1'));var md5=require(_0x7dfc('0x2'));var Redis=require(_0x7dfc('0x3'));var config=require(_0x7dfc('0x4'));var logger=require(_0x7dfc('0x5'))(_0x7dfc('0x6'));var ami=require(_0x7dfc('0x7'));var QueueReport=require(_0x7dfc('0x8'));config['redis']=_[_0x7dfc('0x9')](config[_0x7dfc('0xa')],{'host':_0x7dfc('0xb'),'port':0x18eb});var io=require(_0x7dfc('0xc'))(new Redis(config[_0x7dfc('0xa')]));var Sequence=function(){};Sequence[_0x7dfc('0xd')][_0x7dfc('0xe')]=function(_0x5e0de2){this[_0x7dfc('0xf')]=this[_0x7dfc('0xf')]?this[_0x7dfc('0xf')][_0x7dfc('0x10')](_0x5e0de2):_0x5e0de2();};function VoiceQueueReport(_0x5895bd){this[_0x7dfc('0x11')]=new Sequence();this[_0x7dfc('0x12')]={};this[_0x7dfc('0x13')]=_0x5895bd['agents'];this[_0x7dfc('0x14')]=_0x5895bd[_0x7dfc('0x15')];this[_0x7dfc('0x16')]=_0x5895bd[_0x7dfc('0x16')];this[_0x7dfc('0x17')]=!![];this['campaigns']=_0x5895bd['campaigns'];this['variables']={};ami['on']('queuesummary',this[_0x7dfc('0x18')]['bind'](this));ami['on'](_0x7dfc('0x19'),this[_0x7dfc('0x1a')]['bind'](this));ami['on'](_0x7dfc('0x1b'),this[_0x7dfc('0x1c')][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x1e'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('queuecallerleave',this[_0x7dfc('0x1f')]['bind'](this));ami['on'](_0x7dfc('0x20'),this['syncAgentComplete'][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x21'),this[_0x7dfc('0x22')][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x23'),this[_0x7dfc('0x24')][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x25'),this[_0x7dfc('0x26')][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x27'),this['syncFullyBooted'][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x28'),this[_0x7dfc('0x29')][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x2a'),this[_0x7dfc('0x2b')][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x2c'),this['syncAttendedTransfer'][_0x7dfc('0x1d')](this));ami['on'](_0x7dfc('0x2d'),this[_0x7dfc('0x2e')]['bind'](this));this[_0x7dfc('0x2f')]();this['loopQueueShow']();}function isNotNull(_0xdea82e){return _0xdea82e!==null&&!_['isUndefined'](_0xdea82e);}function clearChannels(_0xbc2175){if(!_[_0x7dfc('0x30')](_0xbc2175)){for(var _0x3e8952 in _0xbc2175){if(_0xbc2175['hasOwnProperty'](_0x3e8952)){delete _0xbc2175[_0x3e8952];}}}}function clearCampaigns(_0x1bea0f){if(!_[_0x7dfc('0x30')](_0x1bea0f)){for(var _0x1138c8 in _0x1bea0f){if(_0x1bea0f[_0x7dfc('0x31')](_0x1138c8)){_0x1bea0f[_0x1138c8]['originated']=0x0;}}}}function clearVoiceQueues(_0x3ac18c){if(!_[_0x7dfc('0x30')](_0x3ac18c)){for(var _0x546439 in _0x3ac18c){if(_0x3ac18c['hasOwnProperty'](_0x546439)){_0x3ac18c[_0x546439][_0x7dfc('0x32')]=0x0;_0x3ac18c[_0x546439][_0x7dfc('0x33')]=0x0;_0x3ac18c[_0x546439][_0x7dfc('0x34')]=0x0;_0x3ac18c[_0x546439][_0x7dfc('0x35')]=0x0;_0x3ac18c[_0x546439]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x5e532c){if(!_[_0x7dfc('0x30')](_0x5e532c)){for(var _0x1bb18c in _0x5e532c){if(_0x5e532c['hasOwnProperty'](_0x1bb18c)){_0x5e532c[_0x1bb18c][_0x7dfc('0x36')]=!![];}}}}VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x37')]=function(){var _0x5efd3b=this;for(var _0x4d15f4 in this[_0x7dfc('0x14')]){if(this[_0x7dfc('0x14')][_0x7dfc('0x31')](_0x4d15f4)&&!this[_0x7dfc('0x14')][_0x4d15f4]['switch']){this[_0x7dfc('0x11')][_0x7dfc('0xe')](function(){if(!_[_0x7dfc('0x38')](_0x5efd3b[_0x7dfc('0x14')][_0x4d15f4])){return ami[_0x7dfc('0x39')]({'action':_0x7dfc('0x3a'),'channel':_0x5efd3b[_0x7dfc('0x14')][_0x4d15f4]['channel']})[_0x7dfc('0x3b')](function(_0x549d4e){if(_0x549d4e[_0x7dfc('0x3c')]===_0x7dfc('0x3d')){setTimeout(function(){if(_0x5efd3b['channels'][_0x4d15f4]){delete _0x5efd3b[_0x7dfc('0x14')][_0x4d15f4];logger[_0x7dfc('0x3e')]('[voiceQueueReport][checkChannel]',_0x4d15f4);}if(_0x5efd3b['queueReports'][_0x4d15f4]){delete _0x5efd3b[_0x7dfc('0x12')][_0x4d15f4];logger['error']('[voiceQueueReport][checkQueueReport]',_0x4d15f4);}if(_0x5efd3b[_0x7dfc('0x3f')][_0x4d15f4]){delete _0x5efd3b[_0x7dfc('0x3f')][_0x4d15f4];logger[_0x7dfc('0x3e')](_0x7dfc('0x40'),_0x4d15f4);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x7dfc('0x41')]=function(){logger[_0x7dfc('0x3e')](_0x7dfc('0x42'));clearChannels(this[_0x7dfc('0x14')]);this[_0x7dfc('0x43')](this[_0x7dfc('0x12')]);clearAgentBooked(this[_0x7dfc('0x13')]);clearVoiceQueues(this[_0x7dfc('0x16')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x43')]=function(_0x34a30b){var _0x259a46=this;if(!_[_0x7dfc('0x30')](_0x34a30b)){for(var _0x2047ab in _0x34a30b){if(_0x34a30b[_0x7dfc('0x31')](_0x2047ab)){_0x259a46[_0x7dfc('0x44')](_0x34a30b[_0x2047ab]);delete _0x34a30b[_0x2047ab];}}}};function loggerCatch(_0x64c300){return function(_0x1ae970){logger[_0x7dfc('0x3e')](_0x64c300,util[_0x7dfc('0x45')](_0x1ae970,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x46')]=function(_0x44fbef,_0xf5fe8a,_0x4b21e6){io['to'](_0x44fbef)[_0x7dfc('0x46')](_0xf5fe8a,_0x4b21e6);};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x47')]=function(_0x2b9bed){this[_0x7dfc('0x46')](util[_0x7dfc('0x48')](_0x7dfc('0x49'),_0x2b9bed[_0x7dfc('0x4a')]),_0x7dfc('0x4b'),_0x2b9bed);};VoiceQueueReport[_0x7dfc('0xd')]['emitVoiceQueueChannelRemove']=function(_0x1399d8){this[_0x7dfc('0x46')](util[_0x7dfc('0x48')](_0x7dfc('0x49'),_0x1399d8[_0x7dfc('0x4a')]),_0x7dfc('0x4c'),_0x1399d8);};VoiceQueueReport[_0x7dfc('0xd')]['emitVoiceQueueSummary']=function(_0x3339ce){if(_0x3339ce[_0x7dfc('0x4d')]===_0x7dfc('0x4e')){var _0x2274e4={'id':_0x3339ce['id'],'name':_0x3339ce[_0x7dfc('0x4a')],'strategy':_0x3339ce[_0x7dfc('0x4f')],'answered':_0x3339ce[_0x7dfc('0x50')],'available':_0x3339ce[_0x7dfc('0x51')],'loggedIn':_0x3339ce[_0x7dfc('0x52')],'pTalking':_0x3339ce[_0x7dfc('0x34')],'sumBillable':_0x3339ce['sumBillable'],'sumDuration':_0x3339ce['sumDuration'],'sumHoldTime':_0x3339ce[_0x7dfc('0x53')]||0x0,'talking':_0x3339ce['talking'],'total':_0x3339ce[_0x7dfc('0x54')],'type':_0x3339ce[_0x7dfc('0x4d')],'unmanaged':_0x3339ce[_0x7dfc('0x55')],'abandoned':_0x3339ce[_0x7dfc('0x56')],'waiting':_0x3339ce['waiting']};if(_0x3339ce['Trunk']){_0x2274e4[_0x7dfc('0x57')]={'id':_0x3339ce[_0x7dfc('0x57')]['id'],'name':_0x3339ce[_0x7dfc('0x57')][_0x7dfc('0x4a')],'active':_0x3339ce['Trunk'][_0x7dfc('0x58')],'callerid':_0x3339ce[_0x7dfc('0x57')]['callerid']};}if(_0x3339ce[_0x7dfc('0x59')]){_0x2274e4[_0x7dfc('0x59')]={'id':_0x3339ce[_0x7dfc('0x59')]['id'],'name':_0x3339ce[_0x7dfc('0x59')][_0x7dfc('0x4a')]};}var _0x12df07=md5(JSON[_0x7dfc('0x5a')](_0x2274e4));if(_0x3339ce[_0x7dfc('0x2')]!==_0x12df07){_0x3339ce[_0x7dfc('0x2')]=_0x12df07;this[_0x7dfc('0x46')](util[_0x7dfc('0x48')](_0x7dfc('0x49'),_0x2274e4[_0x7dfc('0x4a')]),_0x7dfc('0x5b'),_0x2274e4);}}};VoiceQueueReport['prototype']['isNotNull']=function(_0xf5d23f){return _0xf5d23f!==null&&!_['isUndefined'](_0xf5d23f);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x5a443d=this;setInterval(function(){_0x5a443d[_0x7dfc('0x37')]();ami[_0x7dfc('0x39')]({'action':'queues'})[_0x7dfc('0x3b')](loggerCatch(_0x7dfc('0x5c')));},0x2710);};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x2f')]=function(){var _0x27b917=this;setInterval(function(){if(_0x27b917['flagQueueSummary']){return ami[_0x7dfc('0x39')]({'action':_0x7dfc('0x5d')})[_0x7dfc('0x5e')](function(_0x48ca21){_0x27b917[_0x7dfc('0x17')]=![];})['catch'](loggerCatch(_0x7dfc('0x5f')));}},0x3e8);};VoiceQueueReport['prototype'][_0x7dfc('0x18')]=function(_0x5bad8a){try{if(this[_0x7dfc('0x60')](_0x5bad8a)&&this['isNotNull'](_0x5bad8a[_0x7dfc('0x61')])){if(this[_0x7dfc('0x16')][_0x5bad8a['queue']]){var _0x26e3d6=_[_0x7dfc('0x62')](this[_0x7dfc('0x14')],_0x7dfc('0x61'))[_0x5bad8a[_0x7dfc('0x61')]]||0x0;var _0x2090f8=_0x26e3d6-_0x5bad8a[_0x7dfc('0x63')];if(this[_0x7dfc('0x16')][_0x5bad8a['queue']][_0x7dfc('0x35')]!==_[_0x7dfc('0x64')](_0x5bad8a[_0x7dfc('0x63')])||this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x52')]!==_[_0x7dfc('0x64')](_0x5bad8a['loggedin'])||this['voiceQueues'][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x51')]!==_['toNumber'](_0x5bad8a['available'])||this['voiceQueues'][_0x5bad8a['queue']][_0x7dfc('0x33')]!==_0x2090f8){this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x35')]=_[_0x7dfc('0x64')](_0x5bad8a[_0x7dfc('0x63')]);this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x52')]=_[_0x7dfc('0x64')](_0x5bad8a[_0x7dfc('0x65')]);this['voiceQueues'][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x51')]=_['toNumber'](_0x5bad8a[_0x7dfc('0x51')]);this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x33')]=_0x2090f8>0x0?_0x2090f8:0x0;this['voiceQueues'][_0x5bad8a['queue']][_0x7dfc('0x33')]=this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x33')]>_[_0x7dfc('0x64')](_0x5bad8a[_0x7dfc('0x65')])?_[_0x7dfc('0x64')](_0x5bad8a['loggedin']):this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]][_0x7dfc('0x33')];this[_0x7dfc('0x66')](this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]]);}ami[_0x7dfc('0x46')](_0x7dfc('0x67'),this[_0x7dfc('0x16')][_0x5bad8a[_0x7dfc('0x61')]]);}}}catch(_0x4568ca){logger['error'](_0x7dfc('0x68'),util[_0x7dfc('0x45')](_0x4568ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x44ae17){this[_0x7dfc('0x17')]=!![];};VoiceQueueReport['prototype']['syncNewExten']=function(_0x5b130c){};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x1c')]=function(_0x99e3){try{if(this[_0x7dfc('0x60')](_0x99e3)){if(_[_0x7dfc('0x69')](this[_0x7dfc('0x12')][_0x99e3[_0x7dfc('0x6a')]])){this[_0x7dfc('0x12')][_0x99e3['uniqueid']]=[];this[_0x7dfc('0x14')][_0x99e3['uniqueid']]={};}var _0x56eefa=new QueueReport();_0x56eefa['name']=_0x99e3[_0x7dfc('0x61')];_0x56eefa[_0x7dfc('0x4d')]=this[_0x7dfc('0x16')][_0x56eefa[_0x7dfc('0x4a')]]&&this[_0x7dfc('0x16')][_0x56eefa['name']]['type']?this[_0x7dfc('0x16')][_0x56eefa[_0x7dfc('0x4a')]][_0x7dfc('0x4d')]||_0x7dfc('0x4e'):_0x7dfc('0x4e');_0x56eefa[_0x7dfc('0x61')]=_0x99e3[_0x7dfc('0x61')];_0x56eefa[_0x7dfc('0x6b')]=moment()[_0x7dfc('0x48')](_0x7dfc('0x6c'));_0x56eefa[_0x7dfc('0x6d')]=_0x99e3[_0x7dfc('0x6d')];_0x56eefa[_0x7dfc('0x6e')]=_0x99e3[_0x7dfc('0x6e')];_[_0x7dfc('0x6f')](_0x56eefa,_[_0x7dfc('0x70')](_0x99e3,_[_0x7dfc('0x71')](_0x56eefa)));this[_0x7dfc('0x12')][_0x99e3[_0x7dfc('0x6a')]][_0x7dfc('0x72')](_0x56eefa);this['channels'][_0x99e3[_0x7dfc('0x6a')]]=_0x56eefa;this[_0x7dfc('0x47')](_0x56eefa);}}catch(_0x145a4){logger[_0x7dfc('0x3e')](_0x7dfc('0x73'),util[_0x7dfc('0x45')](_0x145a4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x74')]=function(_0x324de3){try{if(this['isNotNull'](_0x324de3)){if(this[_0x7dfc('0x12')][_0x324de3[_0x7dfc('0x6a')]]){var _0xab2f61=_[_0x7dfc('0x75')](this[_0x7dfc('0x12')][_0x324de3['uniqueid']]);_0xab2f61[_0x7dfc('0x76')]=![];_0xab2f61['queuecallercompleteAt']=null;_0xab2f61[_0x7dfc('0x77')]=_0x324de3['holdtime'];_0xab2f61[_0x7dfc('0x78')]=_0x324de3[_0x7dfc('0x78')];_0xab2f61[_0x7dfc('0x1e')]=!![];_0xab2f61[_0x7dfc('0x79')]=moment()['format'](_0x7dfc('0x6c'));_0xab2f61[_0x7dfc('0x7a')]=_0x7dfc('0x7b');_0xab2f61[_0x7dfc('0x7c')]=null;this[_0x7dfc('0x14')][_0x324de3[_0x7dfc('0x6a')]]=_0xab2f61;this[_0x7dfc('0x44')](_0xab2f61);}}}catch(_0x58485c){logger[_0x7dfc('0x3e')](_0x7dfc('0x7d'),util[_0x7dfc('0x45')](_0x58485c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x1f')]=function(_0x7d0231){try{if(this[_0x7dfc('0x60')](_0x7d0231)){if(this[_0x7dfc('0x12')][_0x7d0231[_0x7dfc('0x6a')]]){var _0x52cf6e=_[_0x7dfc('0x75')](this['queueReports'][_0x7d0231[_0x7dfc('0x6a')]]);_0x52cf6e[_0x7dfc('0x7e')]=moment()[_0x7dfc('0x48')](_0x7dfc('0x6c'));_0x52cf6e['connectedlinenum']=_0x7d0231['connectedlinenum'];_0x52cf6e[_0x7dfc('0x7f')]=_0x7d0231[_0x7dfc('0x7f')];this[_0x7dfc('0x14')][_0x7d0231[_0x7dfc('0x6a')]]=_0x52cf6e;this[_0x7dfc('0x47')](_0x52cf6e);}}}catch(_0xcf221f){logger[_0x7dfc('0x3e')](_0x7dfc('0x80'),util[_0x7dfc('0x45')](_0xcf221f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')]['syncAgentConnect']=function(_0x2d7898){try{if(this[_0x7dfc('0x60')](_0x2d7898)){if(this[_0x7dfc('0x12')][_0x2d7898['uniqueid']]){var _0x5fc4eb=_['last'](this[_0x7dfc('0x12')][_0x2d7898[_0x7dfc('0x6a')]]);_0x5fc4eb['queuecallercomplete']=!![];_0x5fc4eb[_0x7dfc('0x7a')]=_0x7dfc('0x81');}}}catch(_0x7f73d6){logger['error'](_0x7dfc('0x82'),util['inspect'](_0x7f73d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')]['syncAgentComplete']=function(_0x4ffe2d){try{if(this[_0x7dfc('0x60')](_0x4ffe2d)){if(this['queueReports'][_0x4ffe2d[_0x7dfc('0x6a')]]){var _0xd93d95=_[_0x7dfc('0x75')](this['queueReports'][_0x4ffe2d['uniqueid']]);_0xd93d95[_0x7dfc('0x1e')]=![];_0xd93d95[_0x7dfc('0x79')]=null;_0xd93d95[_0x7dfc('0x83')]=!![];_0xd93d95[_0x7dfc('0x7c')]=_0x4ffe2d[_0x7dfc('0x84')];_0xd93d95[_0x7dfc('0x77')]=_0x4ffe2d[_0x7dfc('0x77')];_0xd93d95['queuecallercomplete']=!![];_0xd93d95['queuecallerexit']=![];_0xd93d95[_0x7dfc('0x85')]=null;if(!_0xd93d95['transfer']){if(_0x4ffe2d['reason']==_0x7dfc('0x86')){_0xd93d95[_0x7dfc('0x7a')]='COMPLETED';}else{if(_[_0x7dfc('0x87')](_0x4ffe2d['channel'][_0x7dfc('0x88')](),_0x7dfc('0x89'))){if(this['queueReports'][_0x4ffe2d[_0x7dfc('0x8a')]]){var _0x21a6d0=_[_0x7dfc('0x75')](this[_0x7dfc('0x12')][_0x4ffe2d[_0x7dfc('0x8a')]]);_0x21a6d0[_0x7dfc('0x76')]=![];_0x21a6d0['queuecallerexit']=!![];_0x21a6d0[_0x7dfc('0x85')]=moment(_0xd93d95['queuecallerjoinAt'])['add'](_0x4ffe2d[_0x7dfc('0x77')],'seconds')['format'](_0x7dfc('0x6c'));_0x21a6d0[_0x7dfc('0x7a')]=_0x7dfc('0x8b');_0x21a6d0[_0x7dfc('0x86')]=!![];_0x21a6d0[_0x7dfc('0x8c')]=_0x7dfc('0x8d');_0x21a6d0['transferexten']=_0x4ffe2d[_0x7dfc('0x8e')];_0x21a6d0[_0x7dfc('0x8f')]=_0x4ffe2d['uniqueid'];var _0x3cf688=this[_0x7dfc('0x12')][_0x4ffe2d[_0x7dfc('0x8a')]];this[_0x7dfc('0x12')][_0x4ffe2d[_0x7dfc('0x8a')]]=this['queueReports'][_0x4ffe2d[_0x7dfc('0x6a')]];this[_0x7dfc('0x12')][_0x4ffe2d['uniqueid']]=_0x3cf688;}}else{_0xd93d95[_0x7dfc('0x7a')]='COMPLETEDBY'+_0x4ffe2d[_0x7dfc('0x90')]['toUpperCase']();}}}this[_0x7dfc('0x14')][_0x4ffe2d[_0x7dfc('0x6a')]]=_0xd93d95;this[_0x7dfc('0x44')](_0xd93d95);}}}catch(_0x16c59f){logger[_0x7dfc('0x3e')](_0x7dfc('0x91'),util['inspect'](_0x16c59f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7dfc('0x24')]=function(_0x21be72){try{if(this[_0x7dfc('0x60')](_0x21be72)){this[_0x7dfc('0x92')](_0x21be72[_0x7dfc('0x6a')],_['keys'](_0x21be72[_0x7dfc('0x93')])[0x0],_0x21be72['value']);if(this[_0x7dfc('0x12')][_0x21be72['uniqueid']]){var _0x2e80ab=_['last'](this[_0x7dfc('0x12')][_0x21be72['uniqueid']]);if(_0x2e80ab){if(this[_0x7dfc('0x60')](_0x21be72[_0x7dfc('0x93')])&&this[_0x7dfc('0x60')](_0x21be72['variable'][_0x7dfc('0x94')])){switch(_0x21be72[_0x7dfc('0x95')]){case'CONTINUE':_0x2e80ab[_0x7dfc('0x96')]=![];_0x2e80ab[_0x7dfc('0x85')]=null;break;default:_0x2e80ab['queuecallerexit']=!![];_0x2e80ab[_0x7dfc('0x85')]=moment()['format'](_0x7dfc('0x6c'));_0x2e80ab['queuecallerleaveAt']=moment()[_0x7dfc('0x48')](_0x7dfc('0x6c'));}_0x2e80ab[_0x7dfc('0x1e')]=![];_0x2e80ab[_0x7dfc('0x79')]=null;_0x2e80ab[_0x7dfc('0x7a')]=_0x21be72[_0x7dfc('0x95')];this[_0x7dfc('0x14')][_0x21be72[_0x7dfc('0x6a')]]=_0x2e80ab;this['emitVoiceQueueChannelRemove'](_0x2e80ab);}else if(this[_0x7dfc('0x60')](_0x21be72[_0x7dfc('0x93')])&&this['isNotNull'](_0x21be72['variable'][_0x7dfc('0x97')])){if(!_0x2e80ab[_0x7dfc('0x1e')]){_0x2e80ab[_0x7dfc('0x96')]=!![];_0x2e80ab['queuecallerexitAt']=moment()[_0x7dfc('0x48')](_0x7dfc('0x6c'));_0x2e80ab[_0x7dfc('0x7a')]='EXITWITHKEY';_0x2e80ab['queuecallerleaveAt']=moment()[_0x7dfc('0x48')](_0x7dfc('0x6c'));this[_0x7dfc('0x14')][_0x21be72[_0x7dfc('0x6a')]]=_0x2e80ab;}}_0x2e80ab[_0x7dfc('0x3f')]=this[_0x7dfc('0x3f')][_0x21be72[_0x7dfc('0x6a')]];}}}}catch(_0x1b450d){logger[_0x7dfc('0x3e')]('[syncVarSet][VoiceQueueReport]',util[_0x7dfc('0x45')](_0x1b450d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7dfc('0x92')]=function(_0x248532,_0x5863b5,_0x17b0f6){var _0x18bbf2=['rtpaudioqos',_0x7dfc('0x98'),_0x7dfc('0x99'),_0x7dfc('0x9a'),_0x7dfc('0x9b'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x7dfc('0x9c'),_0x7dfc('0x9d'),_0x7dfc('0x9e'),_0x7dfc('0x9f'),_0x7dfc('0xa0'),_0x7dfc('0xa1'),_0x7dfc('0xa2'),'memberinterface','memberlastcall','membername','memberpenalty',_0x7dfc('0xa3')];if(!_[_0x7dfc('0x38')](_0x5863b5)&&!_['includes'](_0x18bbf2,_0x5863b5)){if(_['isUndefined'](this[_0x7dfc('0x3f')][_0x248532])){this[_0x7dfc('0x3f')][_0x248532]={};}this[_0x7dfc('0x3f')][_0x248532][_0x5863b5]=_0x17b0f6;}};VoiceQueueReport[_0x7dfc('0xd')]['syncHangup']=function(_0x38f487){try{if(this[_0x7dfc('0x60')](_0x38f487)){if(this[_0x7dfc('0x12')][_0x38f487[_0x7dfc('0x6a')]]){for(var _0xf2738a=0x0,_0x208e80={};_0xf2738a<this[_0x7dfc('0x12')][_0x38f487[_0x7dfc('0x6a')]][_0x7dfc('0xa4')];_0xf2738a+=0x1){_0x208e80=this['queueReports'][_0x38f487['uniqueid']][_0xf2738a];if(this[_0x7dfc('0x16')][_0x208e80[_0x7dfc('0x61')]]){if(_0x208e80[_0x7dfc('0x96')]){this['voiceQueues'][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0x55')]+=0x1;}if(_0x208e80[_0x7dfc('0x1e')]){this[_0x7dfc('0x16')][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0x56')]+=0x1;}this[_0x7dfc('0x16')][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0x53')]+=moment(_0x208e80[_0x7dfc('0x7e')])[_0x7dfc('0xa5')](_0x208e80[_0x7dfc('0x6b')],_0x7dfc('0xa6'))||0x0;if(_0xf2738a===this[_0x7dfc('0x12')][_0x38f487[_0x7dfc('0x6a')]][_0x7dfc('0xa4')]-0x1){this['voiceQueues'][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0xa7')]+=moment()['milliseconds'](0x0)['diff'](_0x208e80[_0x7dfc('0x6b')],_0x7dfc('0xa6'));this['voiceQueues'][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0x54')]+=0x1;if(_0x208e80[_0x7dfc('0x76')]){this[_0x7dfc('0x16')][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0x50')]+=0x1;this['voiceQueues'][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0xa8')]+=moment()[_0x7dfc('0xa9')](0x0)[_0x7dfc('0xa5')](_0x208e80[_0x7dfc('0x7e')],'seconds');_0x208e80[_0x7dfc('0xaa')]=moment()['format'](_0x7dfc('0x6c'));_0x208e80[_0x7dfc('0x96')]=![];_0x208e80[_0x7dfc('0x85')]=null;}if(_0x208e80[_0x7dfc('0x96')]){_0x208e80[_0x7dfc('0xab')]='unmanaged';ami[_0x7dfc('0x46')](_0x7dfc('0xac'),_0x208e80);}if(_0x208e80['queuecallerabandon']){_0x208e80[_0x7dfc('0xab')]='abandoned';ami[_0x7dfc('0x46')](_0x7dfc('0xad'),_0x208e80);}}else{this[_0x7dfc('0x16')][_0x208e80[_0x7dfc('0x61')]][_0x7dfc('0xa7')]+=this[_0x7dfc('0x16')][_0x208e80['queue']]['sumHoldTime'];}this[_0x7dfc('0x14')][_0x38f487['uniqueid']]=_0x208e80;this['emitVoiceQueueChannelRemove'](_0x208e80);this[_0x7dfc('0x66')](this['voiceQueues'][_0x208e80['queue']]);}}ami[_0x7dfc('0x46')]('custom:voiceQueueReport',this[_0x7dfc('0x12')][_0x38f487[_0x7dfc('0x6a')]]);delete this[_0x7dfc('0x12')][_0x38f487[_0x7dfc('0x6a')]];delete this['channels'][_0x38f487[_0x7dfc('0x6a')]];}if(this[_0x7dfc('0x3f')][_0x38f487[_0x7dfc('0x6a')]]){delete this[_0x7dfc('0x3f')][_0x38f487[_0x7dfc('0x6a')]];}}}catch(_0x26d9c1){logger['error'](_0x7dfc('0xae'),util[_0x7dfc('0x45')](_0x26d9c1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0xaf')]=function(_0x111ed1){try{if(this[_0x7dfc('0x60')](_0x111ed1)){var _0x24fe0e;if(this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb0')]]){_0x24fe0e=_[_0x7dfc('0x75')](this['queueReports'][_0x111ed1['transfereeuniqueid']]);_0x24fe0e[_0x7dfc('0xb1')]=_0x111ed1['secondtransfererexten'];_0x24fe0e[_0x7dfc('0x8f')]=_0x111ed1[_0x7dfc('0xb2')];_0x24fe0e[_0x7dfc('0x7a')]=_0x7dfc('0xb3');_0x24fe0e['transfer']=!![];_0x24fe0e[_0x7dfc('0x8c')]=_0x7dfc('0xb4');if(this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb2')]]){var _0x18e45a=this['queueReports'][_0x111ed1['secondtransfereruniqueid']];this['queueReports'][_0x111ed1['secondtransfereruniqueid']]=this['queueReports'][_0x111ed1['transfereeuniqueid']];this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb0')]]=_0x18e45a;var _0x31c036=_['last'](this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb0')]]);_0x31c036[_0x7dfc('0xb5')]=!![];}}else if(this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb6')]]){_0x24fe0e=_[_0x7dfc('0x75')](this['queueReports'][_0x111ed1['transfertargetuniqueid']]);_0x24fe0e[_0x7dfc('0xb1')]=_0x111ed1[_0x7dfc('0xb7')];_0x24fe0e[_0x7dfc('0x8f')]=_0x111ed1[_0x7dfc('0xb8')];_0x24fe0e[_0x7dfc('0x7a')]=_0x7dfc('0xb3');_0x24fe0e[_0x7dfc('0x86')]=!![];_0x24fe0e[_0x7dfc('0x8c')]='ATTENDED';if(this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb8')]]){var _0x18e45a=this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb8')]];this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb8')]]=this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb6')]];this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb6')]]=_0x18e45a;var _0x31c036=_['last'](this[_0x7dfc('0x12')][_0x111ed1[_0x7dfc('0xb6')]]);_0x31c036['switch']=!![];}}}}catch(_0x35230a){logger[_0x7dfc('0x3e')](_0x7dfc('0xb9'),util[_0x7dfc('0x45')](_0x35230a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x2e')]=function(_0x18474d){try{if(this[_0x7dfc('0x60')](_0x18474d)){if(this[_0x7dfc('0x12')][_0x18474d['transfereeuniqueid']]){var _0x5a3939=_[_0x7dfc('0x75')](this[_0x7dfc('0x12')][_0x18474d['transfereeuniqueid']]);_0x5a3939['queuecallerexitreason']=_0x7dfc('0xba');_0x5a3939['transfer']=!![];_0x5a3939[_0x7dfc('0x8c')]=_0x7dfc('0xbb');_0x5a3939[_0x7dfc('0xb1')]=_0x18474d[_0x7dfc('0xbc')];_0x5a3939[_0x7dfc('0x8f')]=_0x18474d['transfereeuniqueid'];this[_0x7dfc('0x26')]({'event':'BlindTransfer','uniqueid':_0x18474d[_0x7dfc('0xb0')],'context':_0x18474d[_0x7dfc('0xbd')],'channel':_0x18474d[_0x7dfc('0xbe')]});}}}catch(_0x5a6ae3){logger['error']('[syncBlindTransfer][VoiceQueueReport]',util[_0x7dfc('0x45')](_0x5a6ae3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x29')]=function(_0x5108d6){try{if(this[_0x7dfc('0x60')](_0x5108d6)){if(this['queueReports'][_0x5108d6[_0x7dfc('0x6a')]]){var _0x4934c2=_['last'](this['queueReports'][_0x5108d6[_0x7dfc('0x6a')]]);if(!_[_0x7dfc('0x38')](_0x4934c2[_0x7dfc('0x7e')])){_0x4934c2[_0x7dfc('0xbf')]=moment()[_0x7dfc('0x48')](_0x7dfc('0x6c'));}}}}catch(_0x38198f){logger[_0x7dfc('0x3e')](_0x7dfc('0xc0'),util[_0x7dfc('0x45')](_0x38198f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7dfc('0xd')][_0x7dfc('0x2b')]=function(_0x6d982){try{if(this[_0x7dfc('0x60')](_0x6d982)){if(this[_0x7dfc('0x12')][_0x6d982[_0x7dfc('0x6a')]]){var _0x47d60d=_['last'](this[_0x7dfc('0x12')][_0x6d982[_0x7dfc('0x6a')]]);if(!_[_0x7dfc('0x38')](_0x47d60d['mohstarttime'])){_0x47d60d[_0x7dfc('0xc1')]+=moment()[_0x7dfc('0xa9')](0x0)[_0x7dfc('0xa5')](_0x47d60d[_0x7dfc('0xbf')],_0x7dfc('0xa6'));delete _0x47d60d[_0x7dfc('0xbf')];}}}}catch(_0x2051c5){logger['error'](_0x7dfc('0xc2'),util['inspect'](_0x2051c5,{'showHidden':![],'depth':null}));}};module[_0x7dfc('0xc3')]=VoiceQueueReport;
\ No newline at end of file
+var _0xd0a3=['queues','catch','queuesummary','then','queue','countBy','callers','waiting','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncQueueSummaryComplete','isUndefined','uniqueid','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','push','[syncQueueCallerJoin][VoiceQueueReport]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','last','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallerexitreason','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','assigned','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','local/','linkedid','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','keys','variable','value','CONTINUE','queueposition','EXITWITHKEY','queuecallerleaveAt','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberrealtime','includes','unmanaged','diff','milliseconds','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','ATTENDEDTRANSFER','transfertype','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLIND','BlindTransfer','context','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','prototype','clearZombieChannels','switch','isNil','channel','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','emitVoiceQueueChannelRemove','voice_queue_channel:remove','emitVoiceQueueSummary','type','answered','available','loggedIn','sumDuration','sumHoldTime','total','abandoned','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','loopQueueShow','Action'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd0a3,0x6b));var _0x3d0a=function(_0xb38420,_0x485f16){_0xb38420=_0xb38420-0x0;var _0x2c78f8=_0xd0a3[_0xb38420];return _0x2c78f8;};'use strict';var _=require(_0x3d0a('0x0'));var moment=require('moment');var BPromise=require(_0x3d0a('0x1'));var util=require('util');var md5=require(_0x3d0a('0x2'));var Redis=require(_0x3d0a('0x3'));var config=require(_0x3d0a('0x4'));var logger=require(_0x3d0a('0x5'))(_0x3d0a('0x6'));var ami=require(_0x3d0a('0x7'));var QueueReport=require(_0x3d0a('0x8'));config[_0x3d0a('0x9')]=_[_0x3d0a('0xa')](config[_0x3d0a('0x9')],{'host':_0x3d0a('0xb'),'port':0x18eb});var io=require(_0x3d0a('0xc'))(new Redis(config[_0x3d0a('0x9')]));var Sequence=function(){};Sequence['prototype'][_0x3d0a('0xd')]=function(_0x3b5b05){this['tail']=this['tail']?this[_0x3d0a('0xe')][_0x3d0a('0xf')](_0x3b5b05):_0x3b5b05();};function VoiceQueueReport(_0x442d3c){this[_0x3d0a('0x10')]=new Sequence();this[_0x3d0a('0x11')]={};this[_0x3d0a('0x12')]=_0x442d3c[_0x3d0a('0x12')];this[_0x3d0a('0x13')]=_0x442d3c[_0x3d0a('0x14')];this[_0x3d0a('0x15')]=_0x442d3c[_0x3d0a('0x15')];this[_0x3d0a('0x16')]=!![];this[_0x3d0a('0x17')]=_0x442d3c[_0x3d0a('0x17')];this[_0x3d0a('0x18')]={};ami['on']('queuesummary',this[_0x3d0a('0x19')][_0x3d0a('0x1a')](this));ami['on'](_0x3d0a('0x1b'),this['syncQueueSummaryComplete'][_0x3d0a('0x1a')](this));ami['on']('queuecallerjoin',this[_0x3d0a('0x1c')][_0x3d0a('0x1a')](this));ami['on'](_0x3d0a('0x1d'),this[_0x3d0a('0x1e')][_0x3d0a('0x1a')](this));ami['on'](_0x3d0a('0x1f'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0x3d0a('0x20'),this[_0x3d0a('0x21')][_0x3d0a('0x1a')](this));ami['on'](_0x3d0a('0x22'),this[_0x3d0a('0x23')][_0x3d0a('0x1a')](this));ami['on'](_0x3d0a('0x24'),this[_0x3d0a('0x25')][_0x3d0a('0x1a')](this));ami['on']('hangup',this[_0x3d0a('0x26')][_0x3d0a('0x1a')](this));ami['on'](_0x3d0a('0x27'),this[_0x3d0a('0x28')][_0x3d0a('0x1a')](this));ami['on']('musiconholdstart',this[_0x3d0a('0x29')][_0x3d0a('0x1a')](this));ami['on'](_0x3d0a('0x2a'),this[_0x3d0a('0x2b')]['bind'](this));ami['on'](_0x3d0a('0x2c'),this[_0x3d0a('0x2d')][_0x3d0a('0x1a')](this));ami['on']('blindtransfer',this[_0x3d0a('0x2e')][_0x3d0a('0x1a')](this));this[_0x3d0a('0x2f')]();this['loopQueueShow']();}function isNotNull(_0x4dadba){return _0x4dadba!==null&&!_['isUndefined'](_0x4dadba);}function clearChannels(_0x2edede){if(!_[_0x3d0a('0x30')](_0x2edede)){for(var _0x45596e in _0x2edede){if(_0x2edede[_0x3d0a('0x31')](_0x45596e)){delete _0x2edede[_0x45596e];}}}}function clearCampaigns(_0x4eed33){if(!_[_0x3d0a('0x30')](_0x4eed33)){for(var _0x173422 in _0x4eed33){if(_0x4eed33[_0x3d0a('0x31')](_0x173422)){_0x4eed33[_0x173422][_0x3d0a('0x32')]=0x0;}}}}function clearVoiceQueues(_0x547237){if(!_[_0x3d0a('0x30')](_0x547237)){for(var _0x555975 in _0x547237){if(_0x547237[_0x3d0a('0x31')](_0x555975)){_0x547237[_0x555975][_0x3d0a('0x32')]=0x0;_0x547237[_0x555975][_0x3d0a('0x33')]=0x0;_0x547237[_0x555975][_0x3d0a('0x34')]=0x0;_0x547237[_0x555975]['waiting']=0x0;_0x547237[_0x555975][_0x3d0a('0x35')]=!![];}}}}function clearAgentBooked(_0x4f66f6){if(!_[_0x3d0a('0x30')](_0x4f66f6)){for(var _0x21ec15 in _0x4f66f6){if(_0x4f66f6[_0x3d0a('0x31')](_0x21ec15)){_0x4f66f6[_0x21ec15][_0x3d0a('0x36')]=!![];}}}}VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x38')]=function(){var _0x294b91=this;for(var _0x5d0381 in this['channels']){if(this[_0x3d0a('0x13')][_0x3d0a('0x31')](_0x5d0381)&&!this[_0x3d0a('0x13')][_0x5d0381][_0x3d0a('0x39')]){this[_0x3d0a('0x10')][_0x3d0a('0xd')](function(){if(!_[_0x3d0a('0x3a')](_0x294b91[_0x3d0a('0x13')][_0x5d0381])){return ami['Action']({'action':'status','channel':_0x294b91[_0x3d0a('0x13')][_0x5d0381][_0x3d0a('0x3b')]})['catch'](function(_0x28c378){if(_0x28c378['message']===_0x3d0a('0x3c')){setTimeout(function(){if(_0x294b91[_0x3d0a('0x13')][_0x5d0381]){delete _0x294b91[_0x3d0a('0x13')][_0x5d0381];logger[_0x3d0a('0x3d')](_0x3d0a('0x3e'),_0x5d0381);}if(_0x294b91['queueReports'][_0x5d0381]){delete _0x294b91['queueReports'][_0x5d0381];logger['error'](_0x3d0a('0x3f'),_0x5d0381);}if(_0x294b91[_0x3d0a('0x18')][_0x5d0381]){delete _0x294b91[_0x3d0a('0x18')][_0x5d0381];logger[_0x3d0a('0x3d')](_0x3d0a('0x40'),_0x5d0381);}},0x1f40);}});}});}}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x28')]=function(){logger['error'](_0x3d0a('0x41'));clearChannels(this[_0x3d0a('0x13')]);this['clearQueueReport'](this[_0x3d0a('0x11')]);clearAgentBooked(this[_0x3d0a('0x12')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x3d0a('0x17')]);};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x42')]=function(_0x36abd0){var _0x2d57fc=this;if(!_[_0x3d0a('0x30')](_0x36abd0)){for(var _0x5430bc in _0x36abd0){if(_0x36abd0[_0x3d0a('0x31')](_0x5430bc)){_0x2d57fc['emitVoiceQueueChannelRemove'](_0x36abd0[_0x5430bc]);delete _0x36abd0[_0x5430bc];}}}};function loggerCatch(_0x4d6100){return function(_0x1990da){logger[_0x3d0a('0x3d')](_0x4d6100,util[_0x3d0a('0x43')](_0x1990da,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype']['emit']=function(_0x3637b5,_0x480804,_0x4a495e){io['to'](_0x3637b5)[_0x3d0a('0x44')](_0x480804,_0x4a495e);};VoiceQueueReport['prototype'][_0x3d0a('0x45')]=function(_0x3984bc){this[_0x3d0a('0x44')](util[_0x3d0a('0x46')](_0x3d0a('0x47'),_0x3984bc[_0x3d0a('0x48')]),_0x3d0a('0x49'),_0x3984bc);};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x4a')]=function(_0x2dd095){this['emit'](util[_0x3d0a('0x46')](_0x3d0a('0x47'),_0x2dd095['name']),_0x3d0a('0x4b'),_0x2dd095);};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x4c')]=function(_0x6e949d){if(_0x6e949d[_0x3d0a('0x4d')]==='inbound'){var _0x5f49ea={'id':_0x6e949d['id'],'name':_0x6e949d['name'],'strategy':_0x6e949d['strategy'],'answered':_0x6e949d[_0x3d0a('0x4e')],'available':_0x6e949d[_0x3d0a('0x4f')],'loggedIn':_0x6e949d[_0x3d0a('0x50')],'pTalking':_0x6e949d[_0x3d0a('0x34')],'sumBillable':_0x6e949d['sumBillable'],'sumDuration':_0x6e949d[_0x3d0a('0x51')],'sumHoldTime':_0x6e949d[_0x3d0a('0x52')]||0x0,'talking':_0x6e949d[_0x3d0a('0x33')],'total':_0x6e949d[_0x3d0a('0x53')],'type':_0x6e949d[_0x3d0a('0x4d')],'unmanaged':_0x6e949d['unmanaged'],'abandoned':_0x6e949d[_0x3d0a('0x54')],'waiting':_0x6e949d['waiting']};if(_0x6e949d['Trunk']){_0x5f49ea['Trunk']={'id':_0x6e949d[_0x3d0a('0x55')]['id'],'name':_0x6e949d[_0x3d0a('0x55')][_0x3d0a('0x48')],'active':_0x6e949d['Trunk'][_0x3d0a('0x56')],'callerid':_0x6e949d[_0x3d0a('0x55')][_0x3d0a('0x57')]};}if(_0x6e949d['Interval']){_0x5f49ea[_0x3d0a('0x58')]={'id':_0x6e949d[_0x3d0a('0x58')]['id'],'name':_0x6e949d[_0x3d0a('0x58')][_0x3d0a('0x48')]};}var _0xb8e9be=md5(JSON[_0x3d0a('0x59')](_0x5f49ea));if(_0x6e949d[_0x3d0a('0x2')]!==_0xb8e9be){_0x6e949d[_0x3d0a('0x2')]=_0xb8e9be;this['emit'](util[_0x3d0a('0x46')](_0x3d0a('0x47'),_0x5f49ea[_0x3d0a('0x48')]),_0x3d0a('0x5a'),_0x5f49ea);}}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x5b')]=function(_0x15b82c){return _0x15b82c!==null&&!_['isUndefined'](_0x15b82c);};VoiceQueueReport['prototype'][_0x3d0a('0x5c')]=function(){var _0x4ec0d1=this;setInterval(function(){_0x4ec0d1[_0x3d0a('0x38')]();ami[_0x3d0a('0x5d')]({'action':_0x3d0a('0x5e')})[_0x3d0a('0x5f')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x3d0a('0x37')]['loopQueueSummary']=function(){var _0x40bd7b=this;setInterval(function(){if(_0x40bd7b['flagQueueSummary']){return ami['Action']({'action':_0x3d0a('0x60')})[_0x3d0a('0x61')](function(_0x3450f8){_0x40bd7b[_0x3d0a('0x16')]=![];})['catch'](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0x3d0a('0x37')]['syncQueueSummary']=function(_0x5e9c25){try{if(this[_0x3d0a('0x5b')](_0x5e9c25)&&this[_0x3d0a('0x5b')](_0x5e9c25[_0x3d0a('0x62')])){if(this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]]){var _0x2b2a30=_[_0x3d0a('0x63')](this['channels'],_0x3d0a('0x62'))[_0x5e9c25[_0x3d0a('0x62')]]||0x0;var _0x44c433=_0x2b2a30-_0x5e9c25[_0x3d0a('0x64')];if(this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]][_0x3d0a('0x65')]!==_['toNumber'](_0x5e9c25[_0x3d0a('0x64')])||this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]][_0x3d0a('0x50')]!==_[_0x3d0a('0x66')](_0x5e9c25[_0x3d0a('0x67')])||this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]][_0x3d0a('0x4f')]!==_[_0x3d0a('0x66')](_0x5e9c25['available'])||this[_0x3d0a('0x15')][_0x5e9c25['queue']][_0x3d0a('0x33')]!==_0x44c433){this[_0x3d0a('0x15')][_0x5e9c25['queue']][_0x3d0a('0x65')]=_['toNumber'](_0x5e9c25[_0x3d0a('0x64')]);this[_0x3d0a('0x15')][_0x5e9c25['queue']][_0x3d0a('0x50')]=_['toNumber'](_0x5e9c25[_0x3d0a('0x67')]);this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]][_0x3d0a('0x4f')]=_[_0x3d0a('0x66')](_0x5e9c25['available']);this[_0x3d0a('0x15')][_0x5e9c25['queue']][_0x3d0a('0x33')]=_0x44c433>0x0?_0x44c433:0x0;this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]]['talking']=this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]][_0x3d0a('0x33')]>_['toNumber'](_0x5e9c25[_0x3d0a('0x67')])?_[_0x3d0a('0x66')](_0x5e9c25[_0x3d0a('0x67')]):this[_0x3d0a('0x15')][_0x5e9c25['queue']][_0x3d0a('0x33')];this['emitVoiceQueueSummary'](this[_0x3d0a('0x15')][_0x5e9c25[_0x3d0a('0x62')]]);}ami[_0x3d0a('0x44')](_0x3d0a('0x68'),this[_0x3d0a('0x15')][_0x5e9c25['queue']]);}}}catch(_0x6968e6){logger[_0x3d0a('0x3d')](_0x3d0a('0x69'),util[_0x3d0a('0x43')](_0x6968e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3d0a('0x6a')]=function(_0x5408db){this['flagQueueSummary']=!![];};VoiceQueueReport[_0x3d0a('0x37')]['syncNewExten']=function(_0x3ecd8f){};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x1c')]=function(_0x1300d7){try{if(this[_0x3d0a('0x5b')](_0x1300d7)){if(_[_0x3d0a('0x6b')](this[_0x3d0a('0x11')][_0x1300d7[_0x3d0a('0x6c')]])){this[_0x3d0a('0x11')][_0x1300d7[_0x3d0a('0x6c')]]=[];this[_0x3d0a('0x13')][_0x1300d7[_0x3d0a('0x6c')]]={};}var _0x45d465=new QueueReport();_0x45d465['name']=_0x1300d7['queue'];_0x45d465[_0x3d0a('0x4d')]=this['voiceQueues'][_0x45d465[_0x3d0a('0x48')]]&&this[_0x3d0a('0x15')][_0x45d465[_0x3d0a('0x48')]][_0x3d0a('0x4d')]?this[_0x3d0a('0x15')][_0x45d465[_0x3d0a('0x48')]][_0x3d0a('0x4d')]||_0x3d0a('0x6d'):_0x3d0a('0x6d');_0x45d465[_0x3d0a('0x62')]=_0x1300d7[_0x3d0a('0x62')];_0x45d465[_0x3d0a('0x6e')]=moment()['format'](_0x3d0a('0x6f'));_0x45d465[_0x3d0a('0x70')]=_0x1300d7['position'];_0x45d465[_0x3d0a('0x71')]=_0x1300d7['count'];_[_0x3d0a('0x72')](_0x45d465,_[_0x3d0a('0x73')](_0x1300d7,_['keys'](_0x45d465)));this['queueReports'][_0x1300d7[_0x3d0a('0x6c')]][_0x3d0a('0x74')](_0x45d465);this['channels'][_0x1300d7[_0x3d0a('0x6c')]]=_0x45d465;this[_0x3d0a('0x45')](_0x45d465);}}catch(_0x55716e){logger['error'](_0x3d0a('0x75'),util[_0x3d0a('0x43')](_0x55716e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d0a('0x37')]['syncQueueCallerAbandon']=function(_0x33f618){try{if(this[_0x3d0a('0x5b')](_0x33f618)){if(this[_0x3d0a('0x11')][_0x33f618[_0x3d0a('0x6c')]]){var _0x11c3b7=_['last'](this[_0x3d0a('0x11')][_0x33f618['uniqueid']]);_0x11c3b7[_0x3d0a('0x76')]=![];_0x11c3b7[_0x3d0a('0x77')]=null;_0x11c3b7[_0x3d0a('0x78')]=_0x33f618[_0x3d0a('0x78')];_0x11c3b7[_0x3d0a('0x79')]=_0x33f618[_0x3d0a('0x79')];_0x11c3b7[_0x3d0a('0x1d')]=!![];_0x11c3b7[_0x3d0a('0x7a')]=moment()[_0x3d0a('0x46')](_0x3d0a('0x6f'));_0x11c3b7['queuecallerexitreason']=_0x3d0a('0x7b');_0x11c3b7['lastAssignedTo']=null;this[_0x3d0a('0x13')][_0x33f618['uniqueid']]=_0x11c3b7;this[_0x3d0a('0x4a')](_0x11c3b7);}}}catch(_0x44a662){logger[_0x3d0a('0x3d')](_0x3d0a('0x7c'),util[_0x3d0a('0x43')](_0x44a662,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x7d')]=function(_0x2c6a48){try{if(this[_0x3d0a('0x5b')](_0x2c6a48)){if(this[_0x3d0a('0x11')][_0x2c6a48[_0x3d0a('0x6c')]]){var _0x51b854=_[_0x3d0a('0x7e')](this[_0x3d0a('0x11')][_0x2c6a48[_0x3d0a('0x6c')]]);_0x51b854['queuecallerleaveAt']=moment()[_0x3d0a('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x51b854[_0x3d0a('0x7f')]=_0x2c6a48[_0x3d0a('0x7f')];_0x51b854[_0x3d0a('0x80')]=_0x2c6a48[_0x3d0a('0x80')];this['channels'][_0x2c6a48[_0x3d0a('0x6c')]]=_0x51b854;this[_0x3d0a('0x45')](_0x51b854);}}}catch(_0x3db185){logger['error'](_0x3d0a('0x81'),util[_0x3d0a('0x43')](_0x3db185,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d0a('0x37')]['syncAgentConnect']=function(_0x42fb55){try{if(this[_0x3d0a('0x5b')](_0x42fb55)){if(this[_0x3d0a('0x11')][_0x42fb55[_0x3d0a('0x6c')]]){var _0x2dd257=_[_0x3d0a('0x7e')](this[_0x3d0a('0x11')][_0x42fb55[_0x3d0a('0x6c')]]);_0x2dd257[_0x3d0a('0x76')]=!![];_0x2dd257[_0x3d0a('0x82')]=_0x3d0a('0x83');}}}catch(_0x20e029){logger[_0x3d0a('0x3d')](_0x3d0a('0x84'),util[_0x3d0a('0x43')](_0x20e029,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x1968cd){try{if(this['isNotNull'](_0x1968cd)){if(this[_0x3d0a('0x11')][_0x1968cd[_0x3d0a('0x6c')]]){var _0x198056=_[_0x3d0a('0x7e')](this[_0x3d0a('0x11')][_0x1968cd[_0x3d0a('0x6c')]]);_0x198056[_0x3d0a('0x1d')]=![];_0x198056['queuecallerabandonAt']=null;_0x198056[_0x3d0a('0x85')]=!![];_0x198056['lastAssignedTo']=_0x1968cd['membername'];_0x198056['holdtime']=_0x1968cd['holdtime'];_0x198056[_0x3d0a('0x76')]=!![];_0x198056[_0x3d0a('0x86')]=![];_0x198056[_0x3d0a('0x87')]=null;if(!_0x198056[_0x3d0a('0x88')]){if(_0x1968cd[_0x3d0a('0x89')]==_0x3d0a('0x88')){_0x198056[_0x3d0a('0x82')]=_0x3d0a('0x8a');}else{if(_[_0x3d0a('0x8b')](_0x1968cd[_0x3d0a('0x3b')]['toLowerCase'](),_0x3d0a('0x8c'))){if(this[_0x3d0a('0x11')][_0x1968cd[_0x3d0a('0x8d')]]){var _0x1b8441=_['last'](this[_0x3d0a('0x11')][_0x1968cd[_0x3d0a('0x8d')]]);_0x1b8441['queuecallercomplete']=![];_0x1b8441[_0x3d0a('0x86')]=!![];_0x1b8441[_0x3d0a('0x87')]=moment(_0x198056[_0x3d0a('0x6e')])['add'](_0x1968cd[_0x3d0a('0x78')],_0x3d0a('0x8e'))[_0x3d0a('0x46')](_0x3d0a('0x6f'));_0x1b8441[_0x3d0a('0x82')]=_0x3d0a('0x8f');_0x1b8441[_0x3d0a('0x88')]=!![];_0x1b8441['transfertype']=_0x3d0a('0x90');_0x1b8441[_0x3d0a('0x91')]=_0x1968cd[_0x3d0a('0x92')];_0x1b8441[_0x3d0a('0x93')]=_0x1968cd[_0x3d0a('0x6c')];var _0x33bbb5=this[_0x3d0a('0x11')][_0x1968cd['linkedid']];this['queueReports'][_0x1968cd[_0x3d0a('0x8d')]]=this[_0x3d0a('0x11')][_0x1968cd['uniqueid']];this[_0x3d0a('0x11')][_0x1968cd['uniqueid']]=_0x33bbb5;}}else{_0x198056[_0x3d0a('0x82')]=_0x3d0a('0x94')+_0x1968cd['reason'][_0x3d0a('0x95')]();}}}this[_0x3d0a('0x13')][_0x1968cd[_0x3d0a('0x6c')]]=_0x198056;this[_0x3d0a('0x4a')](_0x198056);}}}catch(_0x3e1e94){logger[_0x3d0a('0x3d')]('[syncAgentComplete][VoiceQueueReport]',util[_0x3d0a('0x43')](_0x3e1e94,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x25')]=function(_0x49f7c5){try{if(this[_0x3d0a('0x5b')](_0x49f7c5)){this['addVariable'](_0x49f7c5['uniqueid'],_[_0x3d0a('0x96')](_0x49f7c5[_0x3d0a('0x97')])[0x0],_0x49f7c5[_0x3d0a('0x98')]);if(this[_0x3d0a('0x11')][_0x49f7c5[_0x3d0a('0x6c')]]){var _0x4fee5f=_['last'](this[_0x3d0a('0x11')][_0x49f7c5[_0x3d0a('0x6c')]]);if(_0x4fee5f){if(this[_0x3d0a('0x5b')](_0x49f7c5[_0x3d0a('0x97')])&&this[_0x3d0a('0x5b')](_0x49f7c5['variable']['queuestatus'])){switch(_0x49f7c5[_0x3d0a('0x98')]){case _0x3d0a('0x99'):_0x4fee5f[_0x3d0a('0x86')]=![];_0x4fee5f[_0x3d0a('0x87')]=null;break;default:_0x4fee5f[_0x3d0a('0x86')]=!![];_0x4fee5f['queuecallerexitAt']=moment()[_0x3d0a('0x46')](_0x3d0a('0x6f'));_0x4fee5f['queuecallerleaveAt']=moment()[_0x3d0a('0x46')](_0x3d0a('0x6f'));}_0x4fee5f[_0x3d0a('0x1d')]=![];_0x4fee5f[_0x3d0a('0x7a')]=null;_0x4fee5f[_0x3d0a('0x82')]=_0x49f7c5[_0x3d0a('0x98')];this['channels'][_0x49f7c5['uniqueid']]=_0x4fee5f;this[_0x3d0a('0x4a')](_0x4fee5f);}else if(this[_0x3d0a('0x5b')](_0x49f7c5[_0x3d0a('0x97')])&&this[_0x3d0a('0x5b')](_0x49f7c5['variable'][_0x3d0a('0x9a')])){if(!_0x4fee5f[_0x3d0a('0x1d')]){_0x4fee5f[_0x3d0a('0x86')]=!![];_0x4fee5f['queuecallerexitAt']=moment()['format'](_0x3d0a('0x6f'));_0x4fee5f[_0x3d0a('0x82')]=_0x3d0a('0x9b');_0x4fee5f[_0x3d0a('0x9c')]=moment()[_0x3d0a('0x46')](_0x3d0a('0x6f'));this[_0x3d0a('0x13')][_0x49f7c5[_0x3d0a('0x6c')]]=_0x4fee5f;}}_0x4fee5f['variables']=this[_0x3d0a('0x18')][_0x49f7c5['uniqueid']];}}}}catch(_0x33768c){logger[_0x3d0a('0x3d')]('[syncVarSet][VoiceQueueReport]',util[_0x3d0a('0x43')](_0x33768c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3d0a('0x9d')]=function(_0x40519e,_0x8b8d72,_0x40d6d1){var _0x3703bc=[_0x3d0a('0x9e'),_0x3d0a('0x9f'),'rtpaudioqosjitter',_0x3d0a('0xa0'),_0x3d0a('0xa1'),_0x3d0a('0xa2'),_0x3d0a('0xa3'),_0x3d0a('0xa4'),_0x3d0a('0xa5'),_0x3d0a('0xa6'),_0x3d0a('0xa7'),_0x3d0a('0xa8'),_0x3d0a('0xa9'),_0x3d0a('0xaa'),_0x3d0a('0xab'),_0x3d0a('0xac'),_0x3d0a('0xad'),'memberpenalty',_0x3d0a('0xae')];if(!_[_0x3d0a('0x3a')](_0x8b8d72)&&!_[_0x3d0a('0xaf')](_0x3703bc,_0x8b8d72)){if(_[_0x3d0a('0x6b')](this[_0x3d0a('0x18')][_0x40519e])){this[_0x3d0a('0x18')][_0x40519e]={};}this[_0x3d0a('0x18')][_0x40519e][_0x8b8d72]=_0x40d6d1;}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x26')]=function(_0x3b3dd4){try{if(this[_0x3d0a('0x5b')](_0x3b3dd4)){if(this[_0x3d0a('0x11')][_0x3b3dd4['uniqueid']]){for(var _0x57f073=0x0,_0x347471={};_0x57f073<this['queueReports'][_0x3b3dd4[_0x3d0a('0x6c')]]['length'];_0x57f073+=0x1){_0x347471=this[_0x3d0a('0x11')][_0x3b3dd4[_0x3d0a('0x6c')]][_0x57f073];if(this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]]){if(_0x347471[_0x3d0a('0x86')]){this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]][_0x3d0a('0xb0')]+=0x1;}if(_0x347471['queuecallerabandon']){this[_0x3d0a('0x15')][_0x347471['queue']][_0x3d0a('0x54')]+=0x1;}this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]][_0x3d0a('0x52')]+=moment(_0x347471[_0x3d0a('0x9c')])[_0x3d0a('0xb1')](_0x347471['queuecallerjoinAt'],_0x3d0a('0x8e'))||0x0;if(_0x57f073===this[_0x3d0a('0x11')][_0x3b3dd4[_0x3d0a('0x6c')]]['length']-0x1){this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]][_0x3d0a('0x51')]+=moment()[_0x3d0a('0xb2')](0x0)[_0x3d0a('0xb1')](_0x347471[_0x3d0a('0x6e')],_0x3d0a('0x8e'));this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]][_0x3d0a('0x53')]+=0x1;if(_0x347471['queuecallercomplete']){this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]][_0x3d0a('0x4e')]+=0x1;this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]]['sumBillable']+=moment()[_0x3d0a('0xb2')](0x0)[_0x3d0a('0xb1')](_0x347471[_0x3d0a('0x9c')],_0x3d0a('0x8e'));_0x347471[_0x3d0a('0x77')]=moment()[_0x3d0a('0x46')](_0x3d0a('0x6f'));_0x347471[_0x3d0a('0x86')]=![];_0x347471[_0x3d0a('0x87')]=null;}if(_0x347471[_0x3d0a('0x86')]){_0x347471[_0x3d0a('0xb3')]='unmanaged';ami['emit'](_0x3d0a('0xb4'),_0x347471);}if(_0x347471[_0x3d0a('0x1d')]){_0x347471[_0x3d0a('0xb3')]=_0x3d0a('0x54');ami['emit'](_0x3d0a('0xb5'),_0x347471);}}else{this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]][_0x3d0a('0x51')]+=this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]][_0x3d0a('0x52')];}this[_0x3d0a('0x13')][_0x3b3dd4['uniqueid']]=_0x347471;this['emitVoiceQueueChannelRemove'](_0x347471);this[_0x3d0a('0x4c')](this[_0x3d0a('0x15')][_0x347471[_0x3d0a('0x62')]]);}}ami['emit'](_0x3d0a('0xb6'),this[_0x3d0a('0x11')][_0x3b3dd4['uniqueid']]);delete this[_0x3d0a('0x11')][_0x3b3dd4[_0x3d0a('0x6c')]];delete this[_0x3d0a('0x13')][_0x3b3dd4['uniqueid']];}if(this[_0x3d0a('0x18')][_0x3b3dd4['uniqueid']]){delete this['variables'][_0x3b3dd4[_0x3d0a('0x6c')]];}}}catch(_0x221b86){logger[_0x3d0a('0x3d')](_0x3d0a('0xb7'),util[_0x3d0a('0x43')](_0x221b86,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x2d')]=function(_0x470930){try{if(this['isNotNull'](_0x470930)){var _0x30712b;if(this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xb8')]]){_0x30712b=_['last'](this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xb8')]]);_0x30712b[_0x3d0a('0x91')]=_0x470930[_0x3d0a('0xb9')];_0x30712b[_0x3d0a('0x93')]=_0x470930[_0x3d0a('0xba')];_0x30712b['queuecallerexitreason']='ATTENDEDTRANSFER';_0x30712b[_0x3d0a('0x88')]=!![];_0x30712b['transfertype']=_0x3d0a('0xbb');if(this[_0x3d0a('0x11')][_0x470930['secondtransfereruniqueid']]){var _0x59a8f9=this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xba')]];this[_0x3d0a('0x11')][_0x470930['secondtransfereruniqueid']]=this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xb8')]];this['queueReports'][_0x470930[_0x3d0a('0xb8')]]=_0x59a8f9;var _0x4d7fdd=_['last'](this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xb8')]]);_0x4d7fdd[_0x3d0a('0x39')]=!![];}}else if(this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xbc')]]){_0x30712b=_[_0x3d0a('0x7e')](this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xbc')]]);_0x30712b[_0x3d0a('0x91')]=_0x470930['origtransfererexten'];_0x30712b['transferuniqueid']=_0x470930['origtransfereruniqueid'];_0x30712b[_0x3d0a('0x82')]=_0x3d0a('0xbd');_0x30712b['transfer']=!![];_0x30712b[_0x3d0a('0xbe')]=_0x3d0a('0xbb');if(this[_0x3d0a('0x11')][_0x470930['origtransfereruniqueid']]){var _0x59a8f9=this['queueReports'][_0x470930[_0x3d0a('0xbf')]];this['queueReports'][_0x470930[_0x3d0a('0xbf')]]=this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xbc')]];this[_0x3d0a('0x11')][_0x470930[_0x3d0a('0xbc')]]=_0x59a8f9;var _0x4d7fdd=_['last'](this['queueReports'][_0x470930[_0x3d0a('0xbc')]]);_0x4d7fdd[_0x3d0a('0x39')]=!![];}}}}catch(_0x72397d){logger[_0x3d0a('0x3d')](_0x3d0a('0xc0'),util[_0x3d0a('0x43')](_0x72397d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x2e')]=function(_0x50e979){try{if(this['isNotNull'](_0x50e979)){if(this[_0x3d0a('0x11')][_0x50e979[_0x3d0a('0xb8')]]){var _0x2c02ad=_['last'](this[_0x3d0a('0x11')][_0x50e979[_0x3d0a('0xb8')]]);_0x2c02ad[_0x3d0a('0x82')]='BLINDTRANSFER';_0x2c02ad[_0x3d0a('0x88')]=!![];_0x2c02ad[_0x3d0a('0xbe')]=_0x3d0a('0xc1');_0x2c02ad['transferexten']=_0x50e979['extension'];_0x2c02ad[_0x3d0a('0x93')]=_0x50e979[_0x3d0a('0xb8')];this[_0x3d0a('0x26')]({'event':_0x3d0a('0xc2'),'uniqueid':_0x50e979[_0x3d0a('0xb8')],'context':_0x50e979[_0x3d0a('0xc3')],'channel':_0x50e979[_0x3d0a('0xc4')]});}}}catch(_0x2d1a91){logger[_0x3d0a('0x3d')]('[syncBlindTransfer][VoiceQueueReport]',util[_0x3d0a('0x43')](_0x2d1a91,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3d0a('0x37')][_0x3d0a('0x29')]=function(_0x55a3c6){try{if(this[_0x3d0a('0x5b')](_0x55a3c6)){if(this[_0x3d0a('0x11')][_0x55a3c6[_0x3d0a('0x6c')]]){var _0x276978=_['last'](this['queueReports'][_0x55a3c6[_0x3d0a('0x6c')]]);if(!_['isNil'](_0x276978[_0x3d0a('0x9c')])){_0x276978[_0x3d0a('0xc5')]=moment()[_0x3d0a('0x46')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x243718){logger[_0x3d0a('0x3d')](_0x3d0a('0xc6'),util[_0x3d0a('0x43')](_0x243718,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3d0a('0x2b')]=function(_0x328539){try{if(this['isNotNull'](_0x328539)){if(this['queueReports'][_0x328539[_0x3d0a('0x6c')]]){var _0x30e97e=_[_0x3d0a('0x7e')](this[_0x3d0a('0x11')][_0x328539[_0x3d0a('0x6c')]]);if(!_[_0x3d0a('0x3a')](_0x30e97e[_0x3d0a('0xc5')])){_0x30e97e[_0x3d0a('0xc7')]+=moment()[_0x3d0a('0xb2')](0x0)[_0x3d0a('0xb1')](_0x30e97e[_0x3d0a('0xc5')],'seconds');delete _0x30e97e[_0x3d0a('0xc5')];}}}}catch(_0x4c57d5){logger['error']('[syncMusicOnHoldStop][VoiceQueueReport]',util[_0x3d0a('0x43')](_0x4c57d5,{'showHidden':![],'depth':null}));}};module[_0x3d0a('0xc8')]=VoiceQueueReport;
\ No newline at end of file
index d6a89bc..8f769a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac31=['campaign','queue','Request','CreateReportAgentPreview','../client','createHistory'];(function(_0x322eb8,_0x5afe67){var _0x558b2f=function(_0x5cb42e){while(--_0x5cb42e){_0x322eb8['push'](_0x322eb8['shift']());}};_0x558b2f(++_0x5afe67);}(_0xac31,0xca));var _0x1ac3=function(_0x4a1450,_0x217137){_0x4a1450=_0x4a1450-0x0;var _0x37a183=_0xac31[_0x4a1450];return _0x37a183;};'use strict';var client=require(_0x1ac3('0x0'));exports[_0x1ac3('0x1')]=function(_0x1cd966){return function(){_0x1cd966[_0x1ac3('0x2')]=_0x1cd966[_0x1ac3('0x3')];return client[_0x1ac3('0x4')](_0x1ac3('0x5'),{'body':_0x1cd966,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
+var _0xedd9=['Request','CreateReportAgentPreview','createHistory','campaign','queue'];(function(_0x1cd567,_0x3dfd47){var _0x9c56b3=function(_0x48df13){while(--_0x48df13){_0x1cd567['push'](_0x1cd567['shift']());}};_0x9c56b3(++_0x3dfd47);}(_0xedd9,0xfc));var _0x9edd=function(_0x49110d,_0x165d11){_0x49110d=_0x49110d-0x0;var _0xf4e18a=_0xedd9[_0x49110d];return _0xf4e18a;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return function(){_0x2d7989[_0x9edd('0x1')]=_0x2d7989[_0x9edd('0x2')];return client[_0x9edd('0x3')](_0x9edd('0x4'),{'body':_0x2d7989,'log':_0x9edd('0x4')});};};
\ No newline at end of file
index 6050d15..b870761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46eb=['../client','Request','CreateAttachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46eb,0x144));var _0xb46e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x46eb[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0xb46e('0x0'));exports['create']=function(_0x577f9d){return client[_0xb46e('0x1')](_0xb46e('0x2'),{'body':_0x577f9d,'log':_0xb46e('0x2')});};
\ No newline at end of file
+var _0xfcdc=['CreateAttachment','../client','Request'];(function(_0x2c254a,_0x57fdaf){var _0x55bb1f=function(_0x1daede){while(--_0x1daede){_0x2c254a['push'](_0x2c254a['shift']());}};_0x55bb1f(++_0x57fdaf);}(_0xfcdc,0x1cf));var _0xcfcd=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xfcdc[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xcfcd('0x0'));exports['create']=function(_0x1b2114){return client[_0xcfcd('0x1')](_0xcfcd('0x2'),{'body':_0x1b2114,'log':_0xcfcd('0x2')});};
\ No newline at end of file
index e88f8d7..582732b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ce5=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','callerid','TrunkBackup','Interval','interval','SquareProject','getCampaign','../client','Request','GetCampaign','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency'];(function(_0xc03dab,_0x492840){var _0x304e85=function(_0x35379b){while(--_0x35379b){_0xc03dab['push'](_0xc03dab['shift']());}};_0x304e85(++_0x492840);}(_0x6ce5,0x196));var _0x56ce=function(_0x174b7d,_0x1eee79){_0x174b7d=_0x174b7d-0x0;var _0x5c9da2=_0x6ce5[_0x174b7d];return _0x5c9da2;};'use strict';var client=require(_0x56ce('0x0'));exports['getCampaigns']=function(){return function(){return client[_0x56ce('0x1')](_0x56ce('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x56ce('0x3'),_0x56ce('0x4'),_0x56ce('0x5'),_0x56ce('0x6'),'dialOriginateCallerIdNumber',_0x56ce('0x7'),_0x56ce('0x8'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x56ce('0x9'),_0x56ce('0xa'),_0x56ce('0xb'),_0x56ce('0xc'),_0x56ce('0xd'),_0x56ce('0xe'),_0x56ce('0xf'),_0x56ce('0x10'),_0x56ce('0x11'),'dialAMDAfterGreetingSilence',_0x56ce('0x12'),'dialAMDMinWordLength',_0x56ce('0x13'),_0x56ce('0x14'),'dialAMDSilenceThreshold',_0x56ce('0x15'),'dialOrderByScheduledAt','dialPrefix',_0x56ce('0x16'),_0x56ce('0x17')],'include':[{'model':_0x56ce('0x18'),'as':_0x56ce('0x18'),'attributes':['id',_0x56ce('0x19'),_0x56ce('0x1a'),_0x56ce('0x4')]},{'model':_0x56ce('0x18'),'as':_0x56ce('0x1b'),'attributes':['id',_0x56ce('0x19'),_0x56ce('0x1a'),_0x56ce('0x4')]},{'model':'Interval','as':_0x56ce('0x1c'),'attributes':['id','name'],'include':[{'model':_0x56ce('0x1c'),'as':'Intervals','attributes':['id',_0x56ce('0x19'),_0x56ce('0x1d')]}]},{'model':_0x56ce('0x1e'),'as':_0x56ce('0x1e'),'attributes':['id',_0x56ce('0x19')]}]},'log':_0x56ce('0x1f')});};};
\ No newline at end of file
+var _0x6f63=['../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign'];(function(_0x3e30a5,_0x3491db){var _0x34b361=function(_0x3754fc){while(--_0x3754fc){_0x3e30a5['push'](_0x3e30a5['shift']());}};_0x34b361(++_0x3491db);}(_0x6f63,0x180));var _0x36f6=function(_0x316f47,_0x2d6192){_0x316f47=_0x316f47-0x0;var _0x37ef05=_0x6f63[_0x316f47];return _0x37ef05;};'use strict';var client=require(_0x36f6('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0x36f6('0x1'),{'options':{'raw':![],'attributes':['id',_0x36f6('0x2'),_0x36f6('0x3'),_0x36f6('0x4'),_0x36f6('0x5'),_0x36f6('0x6'),'dialOriginateCallerIdNumber',_0x36f6('0x7'),_0x36f6('0x8'),_0x36f6('0x9'),_0x36f6('0xa'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x36f6('0xb'),_0x36f6('0xc'),'dialTimezone',_0x36f6('0xd'),'dialAMDActive','dialAMDInitialSilence',_0x36f6('0xe'),_0x36f6('0xf'),_0x36f6('0x10'),_0x36f6('0x11'),_0x36f6('0x12'),'dialAMDMaximumNumberOfWords',_0x36f6('0x13'),'dialAMDMaximumWordLength',_0x36f6('0x14'),_0x36f6('0x15'),_0x36f6('0x16'),_0x36f6('0x17')],'include':[{'model':'Trunk','as':_0x36f6('0x18'),'attributes':['id',_0x36f6('0x2'),_0x36f6('0x19'),_0x36f6('0x4')]},{'model':'Trunk','as':_0x36f6('0x1a'),'attributes':['id','name',_0x36f6('0x19'),'active']},{'model':_0x36f6('0x1b'),'as':_0x36f6('0x1b'),'attributes':['id','name'],'include':[{'model':_0x36f6('0x1b'),'as':_0x36f6('0x1c'),'attributes':['id',_0x36f6('0x2'),_0x36f6('0x1d')]}]},{'model':_0x36f6('0x1e'),'as':'SquareProject','attributes':['id','name']}]},'log':_0x36f6('0x1f')});};};
\ No newline at end of file
index c91f3c5..bcf6c26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x005b=['Request','CreateCmContact','showContact','ShowCmContact','../client','createContact'];(function(_0x69752e,_0x2579f6){var _0x506a36=function(_0x1793bc){while(--_0x1793bc){_0x69752e['push'](_0x69752e['shift']());}};_0x506a36(++_0x2579f6);}(_0x005b,0x9a));var _0xb005=function(_0x375492,_0x1d62dd){_0x375492=_0x375492-0x0;var _0x58e24c=_0x005b[_0x375492];return _0x58e24c;};'use strict';var client=require(_0xb005('0x0'));exports[_0xb005('0x1')]=function(_0x4bb6c8){return function(){return client[_0xb005('0x2')](_0xb005('0x3'),{'body':_0x4bb6c8,'log':_0xb005('0x3')});};};exports[_0xb005('0x4')]=function(_0x56d4ce){return function(){return client['Request'](_0xb005('0x5'),{'options':_0x56d4ce,'log':_0xb005('0x5')});};};
\ No newline at end of file
+var _0xe795=['Request','CreateCmContact','ShowCmContact'];(function(_0x5d8a1a,_0x252bf1){var _0x45c0dd=function(_0x3c23c9){while(--_0x3c23c9){_0x5d8a1a['push'](_0x5d8a1a['shift']());}};_0x45c0dd(++_0x252bf1);}(_0xe795,0x1bc));var _0x5e79=function(_0x2c0ab9,_0x105c3d){_0x2c0ab9=_0x2c0ab9-0x0;var _0x20ab13=_0xe795[_0x2c0ab9];return _0x20ab13;};'use strict';var client=require('../client');exports['createContact']=function(_0x432baf){return function(){return client[_0x5e79('0x0')](_0x5e79('0x1'),{'body':_0x432baf,'log':_0x5e79('0x1')});};};exports['showContact']=function(_0x350d32){return function(){return client[_0x5e79('0x0')](_0x5e79('0x2'),{'options':_0x350d32,'log':'ShowCmContact'});};};
\ No newline at end of file
index 25a5f39..f66c64a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','User','Agent','name','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','YYYY-MM-DD\x20HH:mm:ss','db.CmHopper.UserId','../client','lodash','getContacts','GetCmHopper','CmContact','getCmHopper','updateContacts','Request','format','UpdateCmHopper','ContactId','ListId','VoiceQueueId','CampaignId','rescheduleContact','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','Contact','priority','scheduledat','ASC','getContactDialerIvr','DESC','campaign'];(function(_0x58ad63,_0x43960c){var _0x298552=function(_0x5b6254){while(--_0x5b6254){_0x58ad63['push'](_0x58ad63['shift']());}};_0x298552(++_0x43960c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2970ee,_0x578081){_0x2970ee=_0x2970ee-0x0;var _0xb8363e=_0x1cb9[_0x2970ee];return _0xb8363e;};'use strict';var client=require(_0x91cb('0x0'));var moment=require('moment');var _=require(_0x91cb('0x1'));exports[_0x91cb('0x2')]=function(_0x2b1894,_0x351bdb){return function(){return client['Request'](_0x91cb('0x3'),{'options':{'where':{'VoiceQueueId':_0x2b1894},'include':[{'model':_0x91cb('0x4'),'as':'Contact'}],'limit':_0x351bdb,'raw':![]},'log':_0x91cb('0x5')});};};exports[_0x91cb('0x6')]=function(_0x186dc3,_0x28543e,_0x3b9d98){return function(){return client[_0x91cb('0x7')]('UpdateCmHopper',{'body':_0x186dc3,'options':{'where':{'VoiceQueueId':_0x28543e,'scheduledat':{'$lte':moment()[_0x91cb('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x3b9d98},'log':_0x91cb('0x9')});};};exports['rescheduleContact']=function(_0xa43e7a){return function(){return client[_0x91cb('0x7')](_0x91cb('0x9'),{'body':_0xa43e7a,'options':{'where':{'ContactId':_0xa43e7a[_0x91cb('0xa')],'ListId':_0xa43e7a[_0x91cb('0xb')],'VoiceQueueId':_0xa43e7a[_0x91cb('0xc')],'CampaignId':_0xa43e7a[_0x91cb('0xd')]}},'log':_0x91cb('0xe')});};};exports[_0x91cb('0xf')]=function(_0x8c0097,_0x530d92,_0x3c1f56){return function(){return client[_0x91cb('0x7')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x8c0097,'ListId':_0x530d92,'ContactId':_0x3c1f56}},'log':_0x91cb('0x10')});};};exports[_0x91cb('0x11')]=function(_0x44f2e9,_0x2c7d40,_0x4a7d45,_0x4cc6ef){return function(){return client[_0x91cb('0x7')](_0x91cb('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x44f2e9,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x2c7d40}}]},'include':[{'model':_0x91cb('0x4'),'as':_0x91cb('0x13')}],'order':[[_0x91cb('0x14'),'DESC'],[_0x91cb('0x15'),_0x4cc6ef],['id',_0x91cb('0x16')]],'raw':!![],'limit':_0x4a7d45},'log':'GetContactDialer'});};};exports[_0x91cb('0x17')]=function(_0x139f4b,_0x1cd34b,_0xcd1a78){return function(){return client['Request'](_0x91cb('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x139f4b,'active':![],'scheduledat':{'$lte':moment()[_0x91cb('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x91cb('0x4'),'as':'Contact'}],'order':[['priority',_0x91cb('0x18')],[_0x91cb('0x15'),_0xcd1a78],['id','ASC']],'raw':!![],'limit':_0x1cd34b},'log':'GetContactDialerIvr'});};};exports['moveContactManagedDialer']=function(_0x438162,_0x18827b){return function(){_0x438162[_0x91cb('0x19')]=_0x438162[_0x91cb('0x1a')];return client['Request'](_0x91cb('0x1b'),{'body':_0x438162,'options':{'where':{'ContactId':_0x438162[_0x91cb('0xa')],'ListId':_0x438162[_0x91cb('0xb')],'VoiceQueueId':_0x438162['VoiceQueueId'],'CampaignId':_0x438162[_0x91cb('0xd')],'active':_0x18827b?undefined:!![]}},'log':_0x91cb('0x1b')});};};exports[_0x91cb('0x1c')]=function(_0x422d14){return function(){return client[_0x91cb('0x7')](_0x91cb('0x1d'),{'options':{'where':{'VoiceQueueId':_0x422d14['id']?_0x422d14['id']||null:null}},'log':_0x91cb('0x1c')});};};exports[_0x91cb('0x1e')]=function(_0x264e9b){return function(){return client['Request']('GetCmHopper',{'options':{'where':{'id':_0x264e9b},'include':[{'model':_0x91cb('0x4'),'as':'Contact'},{'model':_0x91cb('0x1f'),'as':_0x91cb('0x20'),'attributes':['id',_0x91cb('0x21')]},{'model':'VoiceQueue','as':_0x91cb('0x22'),'attributes':['id','name']}],'raw':!![]},'log':_0x91cb('0x5')});};};exports[_0x91cb('0x23')]=function(_0x3b3ee6,_0x2fb473,_0x468908){return function(){return client['Request'](_0x91cb('0x9'),{'body':_0x3b3ee6,'options':{'where':{'id':_0x2fb473},'limit':_0x468908},'log':'UpdateCmHopper'});};};exports[_0x91cb('0x24')]=function(_0x30204e,_0x445fe1){return function(){return client['Request'](_0x91cb('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x30204e,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x91cb('0x8')](_0x91cb('0x26'))},'UserId':{'$in':_0x445fe1}},'order':[[_0x91cb('0x14'),_0x91cb('0x18')],[_0x91cb('0x15'),_0x91cb('0x18')],['id',_0x91cb('0x16')]],'include':[{'model':_0x91cb('0x4'),'as':'Contact'}],'group':_0x91cb('0x27'),'raw':!![]},'log':_0x91cb('0x12')});};};
\ No newline at end of file
+var _0x1cb9=['queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','User','Agent','name','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','YYYY-MM-DD\x20HH:mm:ss','db.CmHopper.UserId','../client','lodash','getContacts','GetCmHopper','CmContact','getCmHopper','updateContacts','Request','format','UpdateCmHopper','ContactId','ListId','VoiceQueueId','CampaignId','rescheduleContact','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','Contact','priority','scheduledat','ASC','getContactDialerIvr','DESC','campaign'];(function(_0x9e687a,_0x2b2d20){var _0x34f685=function(_0x282026){while(--_0x282026){_0x9e687a['push'](_0x9e687a['shift']());}};_0x34f685(++_0x2b2d20);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1029a9,_0x226ef4){_0x1029a9=_0x1029a9-0x0;var _0x597b55=_0x1cb9[_0x1029a9];return _0x597b55;};'use strict';var client=require(_0x91cb('0x0'));var moment=require('moment');var _=require(_0x91cb('0x1'));exports[_0x91cb('0x2')]=function(_0x2b1894,_0x351bdb){return function(){return client['Request'](_0x91cb('0x3'),{'options':{'where':{'VoiceQueueId':_0x2b1894},'include':[{'model':_0x91cb('0x4'),'as':'Contact'}],'limit':_0x351bdb,'raw':![]},'log':_0x91cb('0x5')});};};exports[_0x91cb('0x6')]=function(_0x186dc3,_0x28543e,_0x3b9d98){return function(){return client[_0x91cb('0x7')]('UpdateCmHopper',{'body':_0x186dc3,'options':{'where':{'VoiceQueueId':_0x28543e,'scheduledat':{'$lte':moment()[_0x91cb('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x3b9d98},'log':_0x91cb('0x9')});};};exports['rescheduleContact']=function(_0xa43e7a){return function(){return client[_0x91cb('0x7')](_0x91cb('0x9'),{'body':_0xa43e7a,'options':{'where':{'ContactId':_0xa43e7a[_0x91cb('0xa')],'ListId':_0xa43e7a[_0x91cb('0xb')],'VoiceQueueId':_0xa43e7a[_0x91cb('0xc')],'CampaignId':_0xa43e7a[_0x91cb('0xd')]}},'log':_0x91cb('0xe')});};};exports[_0x91cb('0xf')]=function(_0x8c0097,_0x530d92,_0x3c1f56){return function(){return client[_0x91cb('0x7')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x8c0097,'ListId':_0x530d92,'ContactId':_0x3c1f56}},'log':_0x91cb('0x10')});};};exports[_0x91cb('0x11')]=function(_0x44f2e9,_0x2c7d40,_0x4a7d45,_0x4cc6ef){return function(){return client[_0x91cb('0x7')](_0x91cb('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x44f2e9,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x2c7d40}}]},'include':[{'model':_0x91cb('0x4'),'as':_0x91cb('0x13')}],'order':[[_0x91cb('0x14'),'DESC'],[_0x91cb('0x15'),_0x4cc6ef],['id',_0x91cb('0x16')]],'raw':!![],'limit':_0x4a7d45},'log':'GetContactDialer'});};};exports[_0x91cb('0x17')]=function(_0x139f4b,_0x1cd34b,_0xcd1a78){return function(){return client['Request'](_0x91cb('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x139f4b,'active':![],'scheduledat':{'$lte':moment()[_0x91cb('0x8')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x91cb('0x4'),'as':'Contact'}],'order':[['priority',_0x91cb('0x18')],[_0x91cb('0x15'),_0xcd1a78],['id','ASC']],'raw':!![],'limit':_0x1cd34b},'log':'GetContactDialerIvr'});};};exports['moveContactManagedDialer']=function(_0x438162,_0x18827b){return function(){_0x438162[_0x91cb('0x19')]=_0x438162[_0x91cb('0x1a')];return client['Request'](_0x91cb('0x1b'),{'body':_0x438162,'options':{'where':{'ContactId':_0x438162[_0x91cb('0xa')],'ListId':_0x438162[_0x91cb('0xb')],'VoiceQueueId':_0x438162['VoiceQueueId'],'CampaignId':_0x438162[_0x91cb('0xd')],'active':_0x18827b?undefined:!![]}},'log':_0x91cb('0x1b')});};};exports[_0x91cb('0x1c')]=function(_0x422d14){return function(){return client[_0x91cb('0x7')](_0x91cb('0x1d'),{'options':{'where':{'VoiceQueueId':_0x422d14['id']?_0x422d14['id']||null:null}},'log':_0x91cb('0x1c')});};};exports[_0x91cb('0x1e')]=function(_0x264e9b){return function(){return client['Request']('GetCmHopper',{'options':{'where':{'id':_0x264e9b},'include':[{'model':_0x91cb('0x4'),'as':'Contact'},{'model':_0x91cb('0x1f'),'as':_0x91cb('0x20'),'attributes':['id',_0x91cb('0x21')]},{'model':'VoiceQueue','as':_0x91cb('0x22'),'attributes':['id','name']}],'raw':!![]},'log':_0x91cb('0x5')});};};exports[_0x91cb('0x23')]=function(_0x3b3ee6,_0x2fb473,_0x468908){return function(){return client['Request'](_0x91cb('0x9'),{'body':_0x3b3ee6,'options':{'where':{'id':_0x2fb473},'limit':_0x468908},'log':'UpdateCmHopper'});};};exports[_0x91cb('0x24')]=function(_0x30204e,_0x445fe1){return function(){return client['Request'](_0x91cb('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x30204e,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x91cb('0x8')](_0x91cb('0x26'))},'UserId':{'$in':_0x445fe1}},'order':[[_0x91cb('0x14'),_0x91cb('0x18')],[_0x91cb('0x15'),_0x91cb('0x18')],['id',_0x91cb('0x16')]],'include':[{'model':_0x91cb('0x4'),'as':'Contact'}],'group':_0x91cb('0x27'),'raw':!![]},'log':_0x91cb('0x12')});};};
\ No newline at end of file
index 2a7afd3..fb53782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cdc=['GetCmHopperBlack','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','VoiceQueueId','Contact','phone'];(function(_0x110fe5,_0x42c668){var _0x5406f7=function(_0xe12e9e){while(--_0xe12e9e){_0x110fe5['push'](_0x110fe5['shift']());}};_0x5406f7(++_0x42c668);}(_0x3cdc,0x72));var _0xc3cd=function(_0x120fdb,_0x586aa3){_0x120fdb=_0x120fdb-0x0;var _0xc2f5ba=_0x3cdc[_0x120fdb];return _0xc2f5ba;};'use strict';var client=require(_0xc3cd('0x0'));exports[_0xc3cd('0x1')]=function(_0x128b9c){return function(){return client[_0xc3cd('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x128b9c[_0xc3cd('0x3')],'phone':_0x128b9c[_0xc3cd('0x4')][_0xc3cd('0x5')]},'raw':![]},'log':_0xc3cd('0x6')});};};exports[_0xc3cd('0x7')]=function(_0x50abbf){return function(){return client[_0xc3cd('0x2')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x50abbf[_0xc3cd('0x8')],'phone':_0x50abbf[_0xc3cd('0x4')][_0xc3cd('0x5')]},'raw':![]},'log':_0xc3cd('0x9')});};};
\ No newline at end of file
+var _0xf94c=['phone','GetCmHopperBlack','checkIsBlackListIvr','Request','CampaignId','GetCmHopperBlackIvr','VoiceQueueId','Contact'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xf94c,0x166));var _0xcf94=function(_0x5e0a28,_0x3a5b26){_0x5e0a28=_0x5e0a28-0x0;var _0x5cc52c=_0xf94c[_0x5e0a28];return _0x5cc52c;};'use strict';var client=require('../client');exports['checkIsBlackList']=function(_0x2c6300){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x2c6300[_0xcf94('0x0')],'phone':_0x2c6300[_0xcf94('0x1')][_0xcf94('0x2')]},'raw':![]},'log':_0xcf94('0x3')});};};exports[_0xcf94('0x4')]=function(_0x506302){return function(){return client[_0xcf94('0x5')](_0xcf94('0x3'),{'options':{'where':{'CampaignId':_0x506302[_0xcf94('0x6')],'phone':_0x506302[_0xcf94('0x1')][_0xcf94('0x2')]},'raw':![]},'log':_0xcf94('0x7')});};};
\ No newline at end of file
index 1e938e6..a690a05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1774=['createContact','campaign','queue','Request','CreateCmHopperFinal','../client'];(function(_0x557d6e,_0x42242a){var _0x16c287=function(_0xddc07e){while(--_0xddc07e){_0x557d6e['push'](_0x557d6e['shift']());}};_0x16c287(++_0x42242a);}(_0x1774,0x1bb));var _0x4177=function(_0xdcb8d0,_0x252dda){_0xdcb8d0=_0xdcb8d0-0x0;var _0x2fe9b3=_0x1774[_0xdcb8d0];return _0x2fe9b3;};'use strict';var client=require(_0x4177('0x0'));exports[_0x4177('0x1')]=function(_0x2cdd10){return function(){_0x2cdd10[_0x4177('0x2')]=_0x2cdd10[_0x4177('0x3')];return client[_0x4177('0x4')](_0x4177('0x5'),{'body':_0x2cdd10,'log':_0x4177('0x5')});};};
\ No newline at end of file
+var _0x398b=['queue','CreateCmHopperFinal','createContact','campaign'];(function(_0x3a607e,_0x54d530){var _0x37b106=function(_0x1becae){while(--_0x1becae){_0x3a607e['push'](_0x3a607e['shift']());}};_0x37b106(++_0x54d530);}(_0x398b,0xaa));var _0xb398=function(_0x4bc706,_0x2fbaba){_0x4bc706=_0x4bc706-0x0;var _0x23bce4=_0x398b[_0x4bc706];return _0x23bce4;};'use strict';var client=require('../client');exports[_0xb398('0x0')]=function(_0x9c0a82){return function(){_0x9c0a82[_0xb398('0x1')]=_0x9c0a82[_0xb398('0x2')];return client['Request'](_0xb398('0x3'),{'body':_0x9c0a82,'log':_0xb398('0x3')});};};
\ No newline at end of file
index 9065b7c..b2d32ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x117c=['getVoiceQueueHopperHistory','startOf','format','endOf','day','GetVoiceQueueHopperHistory','getCampaignHopperHistory','ivr','Request','CreateCmHopperHistory','avgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory'];(function(_0xd307d2,_0x203421){var _0x363cdd=function(_0x404406){while(--_0x404406){_0xd307d2['push'](_0xd307d2['shift']());}};_0x363cdd(++_0x203421);}(_0x117c,0x71));var _0xc117=function(_0x449158,_0x44e1b0){_0x449158=_0x449158-0x0;var _0x1f3c3a=_0x117c[_0x449158];return _0x1f3c3a;};'use strict';var client=require('../client');var moment=require('moment');exports['createHistory']=function(_0x42c760){return function(){_0x42c760['campaign']=_0x42c760['queue'];return client[_0xc117('0x0')](_0xc117('0x1'),{'body':_0x42c760,'log':_0xc117('0x1')});};};exports[_0xc117('0x2')]=function(_0x1768dc){return function(){return client[_0xc117('0x0')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0xc117('0x3')](_0x1768dc,_0xc117('0x4'))['format'](_0xc117('0x5')),moment()['format'](_0xc117('0x5'))]}},'raw':![]},'log':_0xc117('0x6')});};};exports[_0xc117('0x7')]=function(_0x39e33f){return function(){return client[_0xc117('0x0')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xc117('0x8')]('day')[_0xc117('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc117('0xa')](_0xc117('0xb'))['format'](_0xc117('0x5'))]},'campaigntype':'queue'},'raw':![]},'log':_0xc117('0xc')});};};exports[_0xc117('0xd')]=function(_0xd597a1){return function(){return client[_0xc117('0x0')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xc117('0x8')](_0xc117('0xb'))[_0xc117('0x9')](_0xc117('0x5')),moment()[_0xc117('0xa')](_0xc117('0xb'))[_0xc117('0x9')](_0xc117('0x5'))]},'campaigntype':_0xc117('0xe')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
+var _0xac35=['createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','endOf','day','getCampaignHopperHistory','GetCampaignHopperHistory','../client','moment'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0xac35,0x141));var _0x5ac3=function(_0x184f5f,_0x2034dd){_0x184f5f=_0x184f5f-0x0;var _0x467cd7=_0xac35[_0x184f5f];return _0x467cd7;};'use strict';var client=require(_0x5ac3('0x0'));var moment=require(_0x5ac3('0x1'));exports[_0x5ac3('0x2')]=function(_0x196241){return function(){_0x196241[_0x5ac3('0x3')]=_0x196241[_0x5ac3('0x4')];return client[_0x5ac3('0x5')](_0x5ac3('0x6'),{'body':_0x196241,'log':_0x5ac3('0x6')});};};exports[_0x5ac3('0x7')]=function(_0x3d6646){return function(){return client[_0x5ac3('0x5')](_0x5ac3('0x8'),{'options':{'where':{'endtime':{'$between':[moment()[_0x5ac3('0x9')](_0x3d6646,'minutes')[_0x5ac3('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x5ac3('0xa')](_0x5ac3('0xb'))]}},'raw':![]},'log':_0x5ac3('0xc')});};};exports[_0x5ac3('0xd')]=function(_0x378900){return function(){return client[_0x5ac3('0x5')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x5ac3('0xe')]('day')[_0x5ac3('0xa')](_0x5ac3('0xb')),moment()[_0x5ac3('0xf')](_0x5ac3('0x10'))[_0x5ac3('0xa')](_0x5ac3('0xb'))]},'campaigntype':_0x5ac3('0x4')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0x5ac3('0x11')]=function(_0x2f1c67){return function(){return client[_0x5ac3('0x5')](_0x5ac3('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x5ac3('0xe')](_0x5ac3('0x10'))[_0x5ac3('0xa')](_0x5ac3('0xb')),moment()['endOf']('day')[_0x5ac3('0xa')](_0x5ac3('0xb'))]},'campaigntype':'ivr'},'raw':![]},'log':_0x5ac3('0x12')});};};
\ No newline at end of file
index a9c3cd3..e8ff3f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['ListId','key','Trunk','callerid','getFaxAccount','notify','Request','NotifyFaxAccount','../client','getFaxAccounts','GetFaxAccount','name','description','ecm','headerinfo','minrate','maxrate','modem','t38timeout','TrunkId'];(function(_0x3ebead,_0xdc3737){var _0x46b717=function(_0x3d4783){while(--_0x3d4783){_0x3ebead['push'](_0x3ebead['shift']());}};_0x46b717(++_0xdc3737);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x5fc3[_0x1db831];return _0x39ba56;};'use strict';var client=require(_0x35fc('0x0'));exports[_0x35fc('0x1')]=function(){return function(){return client['Request'](_0x35fc('0x2'),{'options':{'raw':![],'attributes':['id',_0x35fc('0x3'),_0x35fc('0x4'),_0x35fc('0x5'),_0x35fc('0x6'),'localstationid',_0x35fc('0x7'),_0x35fc('0x8'),_0x35fc('0x9'),'gateway','faxdetect',_0x35fc('0xa'),'tech',_0x35fc('0xb'),_0x35fc('0xc'),_0x35fc('0xd')],'include':[{'model':_0x35fc('0xe'),'as':_0x35fc('0xe'),'attributes':['id',_0x35fc('0x3'),_0x35fc('0xf'),'active']}]},'log':_0x35fc('0x10')});};};exports[_0x35fc('0x11')]=function(_0x4fdca1,_0x471549){return client[_0x35fc('0x12')]('NotifyFaxAccount',{'account':{'id':_0x4fdca1},'body':_0x471549,'log':_0x35fc('0x13')});};
\ No newline at end of file
+var _0xc4aa=['notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','description','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','Trunk','active','getFaxAccount'];(function(_0x51ef22,_0x5aa396){var _0x4b7a12=function(_0x2e4aba){while(--_0x2e4aba){_0x51ef22['push'](_0x51ef22['shift']());}};_0x4b7a12(++_0x5aa396);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'ecm','headerinfo','localstationid',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'ListId','key'],'include':[{'model':_0xac4a('0xe'),'as':_0xac4a('0xe'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0xf')]}]},'log':_0xac4a('0x10')});};};exports[_0xac4a('0x11')]=function(_0x4d4acc,_0x30135d){return client['Request'](_0xac4a('0x12'),{'account':{'id':_0x4d4acc},'body':_0x30135d,'log':'NotifyFaxAccount'});};
\ No newline at end of file
index c14679b..a0ed23d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd046=['UpdateFaxMessage','update'];(function(_0x2899da,_0x478e06){var _0x49b0a1=function(_0x508e43){while(--_0x508e43){_0x2899da['push'](_0x2899da['shift']());}};_0x49b0a1(++_0x478e06);}(_0xd046,0x129));var _0x6d04=function(_0x5db218,_0x364a10){_0x5db218=_0x5db218-0x0;var _0x193696=_0xd046[_0x5db218];return _0x193696;};'use strict';var client=require('../client');exports[_0x6d04('0x0')]=function(_0x1a46d8,_0x32aaa4){return client['Request'](_0x6d04('0x1'),{'body':_0x32aaa4,'options':{'where':{'AttachmentId':_0x1a46d8}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x0af5=['Request','UpdateFaxMessage','update'];(function(_0x197409,_0x17d1b1){var _0x2ca234=function(_0x4dda2c){while(--_0x4dda2c){_0x197409['push'](_0x197409['shift']());}};_0x2ca234(++_0x17d1b1);}(_0x0af5,0x158));var _0x50af=function(_0x51cd5d,_0x34e0bf){_0x51cd5d=_0x51cd5d-0x0;var _0x54716f=_0x0af5[_0x51cd5d];return _0x54716f;};'use strict';var client=require('../client');exports[_0x50af('0x0')]=function(_0x2dae50,_0x13e284){return client[_0x50af('0x1')](_0x50af('0x2'),{'body':_0x13e284,'options':{'where':{'AttachmentId':_0x2dae50}},'log':_0x50af('0x2')});};
\ No newline at end of file
index 7e139bf..a319f07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74a1=['content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','nameField','Tag','Tags','GetDeskAccount','../../client','getDeskAccounts','Request','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects'];(function(_0x3dc96b,_0x5a1ded){var _0x427eee=function(_0x3c99e6){while(--_0x3c99e6){_0x3dc96b['push'](_0x3dc96b['shift']());}};_0x427eee(++_0x5a1ded);}(_0x74a1,0xff));var _0x174a=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x74a1[_0x147497];return _0x35f45;};'use strict';var client=require(_0x174a('0x0'));exports[_0x174a('0x1')]=function(){return function(_0x51a3d5){return client[_0x174a('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x174a('0x3'),_0x174a('0x4'),_0x174a('0x5'),_0x174a('0x6'),_0x174a('0x7'),_0x174a('0x8'),_0x174a('0x9'),_0x174a('0xa')],'include':[{'model':_0x174a('0xb'),'as':_0x174a('0xc'),'attributes':['id',_0x174a('0x3')],'include':[{'model':_0x174a('0xd'),'as':_0x174a('0xe'),'attributes':['id',_0x174a('0x9'),_0x174a('0xf'),_0x174a('0x10')],'include':[{'model':_0x174a('0x11'),'as':_0x174a('0x11'),'attributes':['id',_0x174a('0x3')]}]},{'model':_0x174a('0xd'),'as':_0x174a('0x12'),'attributes':['id',_0x174a('0x9'),_0x174a('0xf'),_0x174a('0x13'),_0x174a('0x14'),_0x174a('0x15'),_0x174a('0x10')],'include':[{'model':'Variable','as':_0x174a('0x11'),'attributes':['id',_0x174a('0x3')]}]},{'model':_0x174a('0xd'),'as':_0x174a('0x16'),'attributes':['id',_0x174a('0x9'),_0x174a('0xf'),'idField',_0x174a('0x17'),'customField','variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x174a('0x3')]}]},{'model':_0x174a('0x18'),'as':_0x174a('0x19'),'attributes':['id',_0x174a('0x3')]}]}]},'log':_0x174a('0x1a')});};};
\ No newline at end of file
+var _0xe439=['Descriptions','content','key','keyType','keyContent','Fields','idField','nameField','customField','name','../../client','getDeskAccounts','Request','GetDeskAccount','description','username','password','remoteUri','authType','serverUrl','DeskConfiguration','Configurations','DeskField','type','variableName','Variable'];(function(_0x1db1e7,_0x65bcb8){var _0x53ddea=function(_0x11a011){while(--_0x11a011){_0x1db1e7['push'](_0x1db1e7['shift']());}};_0x53ddea(++_0x65bcb8);}(_0xe439,0xc0));var _0x9e43=function(_0x361aab,_0x1daa8a){_0x361aab=_0x361aab-0x0;var _0x4cd84f=_0xe439[_0x361aab];return _0x4cd84f;};'use strict';var client=require(_0x9e43('0x0'));exports[_0x9e43('0x1')]=function(){return function(_0x13d0e5){return client[_0x9e43('0x2')](_0x9e43('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9e43('0x4'),_0x9e43('0x5'),_0x9e43('0x6'),_0x9e43('0x7'),_0x9e43('0x8'),'type',_0x9e43('0x9')],'include':[{'model':_0x9e43('0xa'),'as':_0x9e43('0xb'),'attributes':['id','name'],'include':[{'model':_0x9e43('0xc'),'as':'Subjects','attributes':['id',_0x9e43('0xd'),'content',_0x9e43('0xe')],'include':[{'model':_0x9e43('0xf'),'as':_0x9e43('0xf'),'attributes':['id','name']}]},{'model':_0x9e43('0xc'),'as':_0x9e43('0x10'),'attributes':['id','type',_0x9e43('0x11'),_0x9e43('0x12'),_0x9e43('0x13'),_0x9e43('0x14'),_0x9e43('0xe')],'include':[{'model':'Variable','as':_0x9e43('0xf'),'attributes':['id','name']}]},{'model':_0x9e43('0xc'),'as':_0x9e43('0x15'),'attributes':['id','type','content',_0x9e43('0x16'),_0x9e43('0x17'),_0x9e43('0x18'),_0x9e43('0xe')],'include':[{'model':'Variable','as':_0x9e43('0xf'),'attributes':['id','name']}]},{'model':'Tag','as':'Tags','attributes':['id',_0x9e43('0x19')]}]}]},'log':_0x9e43('0x3')});};};
\ No newline at end of file
index 87735e5..b5f1c36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c12=['FreshdeskConfiguration','Tag','type','content','variableName','Variable','FreshdeskField','Descriptions','key','keyContent','Fields','customField','getFreshdeskAccounts','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl'];(function(_0x41ebb3,_0x1ceb67){var _0x42d6c3=function(_0x3499c3){while(--_0x3499c3){_0x41ebb3['push'](_0x41ebb3['shift']());}};_0x42d6c3(++_0x1ceb67);}(_0x5c12,0x188));var _0x25c1=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x5c12[_0x3a2e49];return _0x257140;};'use strict';var client=require('../../client');exports[_0x25c1('0x0')]=function(){return function(_0x1e452d){return client['Request'](_0x25c1('0x1'),{'options':{'raw':![],'attributes':['id',_0x25c1('0x2'),_0x25c1('0x3'),_0x25c1('0x4'),_0x25c1('0x5'),_0x25c1('0x6')],'include':[{'model':_0x25c1('0x7'),'as':'Configurations','attributes':['id',_0x25c1('0x2')],'include':[{'model':_0x25c1('0x8'),'attributes':['id',_0x25c1('0x2')]},{'model':'FreshdeskField','as':'Subjects','attributes':['id',_0x25c1('0x9'),_0x25c1('0xa'),_0x25c1('0xb')],'include':[{'model':_0x25c1('0xc'),'as':_0x25c1('0xc'),'attributes':['id','name']}]},{'model':_0x25c1('0xd'),'as':_0x25c1('0xe'),'attributes':['id',_0x25c1('0x9'),_0x25c1('0xa'),_0x25c1('0xf'),'keyType',_0x25c1('0x10'),_0x25c1('0xb')],'include':[{'model':'Variable','as':_0x25c1('0xc'),'attributes':['id',_0x25c1('0x2')]}]},{'model':_0x25c1('0xd'),'as':_0x25c1('0x11'),'attributes':['id','type','content','idField','nameField',_0x25c1('0x12'),_0x25c1('0xb')],'include':[{'model':_0x25c1('0xc'),'as':_0x25c1('0xc'),'attributes':['id',_0x25c1('0x2')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
+var _0x7fbe=['Variable','Descriptions','key','keyType','keyContent','Fields','nameField','customField','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','type','content','variableName'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xd4ec0c,_0x2afcd2){_0xd4ec0c=_0xd4ec0c-0x0;var _0x580218=_0x7fbe[_0xd4ec0c];return _0x580218;};'use strict';var client=require('../../client');exports['getFreshdeskAccounts']=function(){return function(_0x301231){return client[_0xe7fb('0x0')](_0xe7fb('0x1'),{'options':{'raw':![],'attributes':['id',_0xe7fb('0x2'),_0xe7fb('0x3'),_0xe7fb('0x4'),_0xe7fb('0x5'),_0xe7fb('0x6')],'include':[{'model':_0xe7fb('0x7'),'as':_0xe7fb('0x8'),'attributes':['id',_0xe7fb('0x2')],'include':[{'model':_0xe7fb('0x9'),'attributes':['id',_0xe7fb('0x2')]},{'model':_0xe7fb('0xa'),'as':'Subjects','attributes':['id',_0xe7fb('0xb'),_0xe7fb('0xc'),_0xe7fb('0xd')],'include':[{'model':_0xe7fb('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':_0xe7fb('0xa'),'as':_0xe7fb('0xf'),'attributes':['id',_0xe7fb('0xb'),_0xe7fb('0xc'),_0xe7fb('0x10'),_0xe7fb('0x11'),_0xe7fb('0x12'),_0xe7fb('0xd')],'include':[{'model':_0xe7fb('0xe'),'as':_0xe7fb('0xe'),'attributes':['id',_0xe7fb('0x2')]}]},{'model':_0xe7fb('0xa'),'as':_0xe7fb('0x13'),'attributes':['id',_0xe7fb('0xb'),_0xe7fb('0xc'),'idField',_0xe7fb('0x14'),_0xe7fb('0x15'),'variableName'],'include':[{'model':_0xe7fb('0xe'),'as':_0xe7fb('0xe'),'attributes':['id','name']}]}]}]},'log':_0xe7fb('0x1')});};};
\ No newline at end of file
index c1ba368..6ac6e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae7=['username','remoteUri','clientSecret','securityToken','serverUrl','type','Configurations','moduleSearch','moduleCreate','SalesforceField','Subjects','Variable','name','Fields','../../client','Request','GetSalesforceAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1ae7,0xda));var _0x71ae=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x1ae7[_0x387777];return _0x3f84c0;};'use strict';var client=require(_0x71ae('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x1249f2){return client[_0x71ae('0x1')](_0x71ae('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x71ae('0x3'),'password',_0x71ae('0x4'),'clientId',_0x71ae('0x5'),_0x71ae('0x6'),_0x71ae('0x7'),_0x71ae('0x8')],'include':[{'model':'SalesforceConfiguration','as':_0x71ae('0x9'),'attributes':['id','name',_0x71ae('0xa'),_0x71ae('0xb')],'include':[{'model':_0x71ae('0xc'),'as':_0x71ae('0xd'),'include':[{'model':_0x71ae('0xe'),'as':_0x71ae('0xe'),'attributes':['id',_0x71ae('0xf')]}]},{'model':_0x71ae('0xc'),'as':'Descriptions','include':[{'model':_0x71ae('0xe'),'as':'Variable','attributes':['id',_0x71ae('0xf')]}]},{'model':_0x71ae('0xc'),'as':_0x71ae('0x10'),'include':[{'model':_0x71ae('0xe'),'as':_0x71ae('0xe'),'attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0xcb20=['moduleCreate','SalesforceField','Variable','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','password','remoteUri','clientId','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','Configurations'];(function(_0x1c37fe,_0x10a098){var _0x45e904=function(_0x2b69f4){while(--_0x2b69f4){_0x1c37fe['push'](_0x1c37fe['shift']());}};_0x45e904(++_0x10a098);}(_0xcb20,0xcf));var _0x0cb2=function(_0x2aa281,_0x54ac02){_0x2aa281=_0x2aa281-0x0;var _0x31abc9=_0xcb20[_0x2aa281];return _0x31abc9;};'use strict';var client=require(_0x0cb2('0x0'));exports[_0x0cb2('0x1')]=function(){return function(_0x1446bc){return client[_0x0cb2('0x2')](_0x0cb2('0x3'),{'options':{'raw':![],'attributes':['id',_0x0cb2('0x4'),'username',_0x0cb2('0x5'),_0x0cb2('0x6'),_0x0cb2('0x7'),_0x0cb2('0x8'),_0x0cb2('0x9'),_0x0cb2('0xa'),_0x0cb2('0xb')],'include':[{'model':_0x0cb2('0xc'),'as':_0x0cb2('0xd'),'attributes':['id',_0x0cb2('0x4'),'moduleSearch',_0x0cb2('0xe')],'include':[{'model':_0x0cb2('0xf'),'as':'Subjects','include':[{'model':'Variable','as':'Variable','attributes':['id',_0x0cb2('0x4')]}]},{'model':_0x0cb2('0xf'),'as':'Descriptions','include':[{'model':_0x0cb2('0x10'),'as':_0x0cb2('0x10'),'attributes':['id','name']}]},{'model':_0x0cb2('0xf'),'as':'Fields','include':[{'model':_0x0cb2('0x10'),'as':_0x0cb2('0x10'),'attributes':['id',_0x0cb2('0x4')]}]}]}]},'log':_0x0cb2('0x3')});};};
\ No newline at end of file
index 67c5d7b..1f33db9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57cc=['SugarcrmConfiguration','Configurations','SugarcrmField','Subjects','type','content','variableName','Variable','keyType','keyContent','Fields','idField','nameField','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','password','remoteUri','serverUrl'];(function(_0x972100,_0x1c4e35){var _0x112304=function(_0xb0eb4e){while(--_0xb0eb4e){_0x972100['push'](_0x972100['shift']());}};_0x112304(++_0x1c4e35);}(_0x57cc,0x1b0));var _0xc57c=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x57cc[_0x3e7e96];return _0x13f6f0;};'use strict';var client=require(_0xc57c('0x0'));exports[_0xc57c('0x1')]=function(){return function(_0x3086bd){return client[_0xc57c('0x2')](_0xc57c('0x3'),{'options':{'raw':![],'attributes':['id',_0xc57c('0x4'),'username',_0xc57c('0x5'),_0xc57c('0x6'),_0xc57c('0x7')],'include':[{'model':_0xc57c('0x8'),'as':_0xc57c('0x9'),'attributes':['id',_0xc57c('0x4')],'include':[{'model':_0xc57c('0xa'),'as':_0xc57c('0xb'),'attributes':['id',_0xc57c('0xc'),_0xc57c('0xd'),_0xc57c('0xe')],'include':[{'model':_0xc57c('0xf'),'as':_0xc57c('0xf'),'attributes':['id',_0xc57c('0x4')]}]},{'model':_0xc57c('0xa'),'as':'Descriptions','attributes':['id','type',_0xc57c('0xd'),'key',_0xc57c('0x10'),_0xc57c('0x11'),'variableName'],'include':[{'model':'Variable','as':_0xc57c('0xf'),'attributes':['id','name']}]},{'model':_0xc57c('0xa'),'as':_0xc57c('0x12'),'attributes':['id',_0xc57c('0xc'),_0xc57c('0xd'),_0xc57c('0x13'),_0xc57c('0x14'),_0xc57c('0x15'),_0xc57c('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xc57c('0x4')]}]}]}]},'log':_0xc57c('0x3')});};};
\ No newline at end of file
+var _0xe386=['idField','nameField','Variable','getSugarcrmAccounts','name','username','password','remoteUri','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField','Subjects','type','content','Descriptions','keyType','keyContent','variableName','Fields'];(function(_0x79f897,_0x1ca543){var _0x14e9ba=function(_0xaa76fe){while(--_0xaa76fe){_0x79f897['push'](_0x79f897['shift']());}};_0x14e9ba(++_0x1ca543);}(_0xe386,0xb7));var _0x6e38=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe386[_0x4a9fb1];return _0x348672;};'use strict';var client=require('../../client');exports[_0x6e38('0x0')]=function(){return function(_0x100e7a){return client['Request']('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x6e38('0x1'),_0x6e38('0x2'),_0x6e38('0x3'),_0x6e38('0x4'),_0x6e38('0x5')],'include':[{'model':_0x6e38('0x6'),'as':_0x6e38('0x7'),'attributes':['id','name'],'include':[{'model':_0x6e38('0x8'),'as':_0x6e38('0x9'),'attributes':['id',_0x6e38('0xa'),_0x6e38('0xb'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x6e38('0x8'),'as':_0x6e38('0xc'),'attributes':['id',_0x6e38('0xa'),_0x6e38('0xb'),'key',_0x6e38('0xd'),_0x6e38('0xe'),_0x6e38('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x6e38('0x8'),'as':_0x6e38('0x10'),'attributes':['id',_0x6e38('0xa'),_0x6e38('0xb'),_0x6e38('0x11'),_0x6e38('0x12'),'customField',_0x6e38('0xf')],'include':[{'model':_0x6e38('0x13'),'as':_0x6e38('0x13'),'attributes':['id',_0x6e38('0x1')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
index 9c5359c..ff79964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f84=['Variable','VtigerField','Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','GetVtigerAccount','../../client','getVtigerAccounts','name','description','username','remoteUri','serverUrl','Configurations','Subjects','type','content','variableName'];(function(_0x491ee7,_0x34c385){var _0x4374d3=function(_0x42a96e){while(--_0x42a96e){_0x491ee7['push'](_0x491ee7['shift']());}};_0x4374d3(++_0x34c385);}(_0x8f84,0x1c0));var _0x48f8=function(_0x28c4fe,_0xc408af){_0x28c4fe=_0x28c4fe-0x0;var _0x1a527d=_0x8f84[_0x28c4fe];return _0x1a527d;};'use strict';var client=require(_0x48f8('0x0'));exports[_0x48f8('0x1')]=function(){return function(_0x16fd19){return client['Request']('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x48f8('0x2'),_0x48f8('0x3'),_0x48f8('0x4'),'accessKey',_0x48f8('0x5'),_0x48f8('0x6')],'include':[{'model':'VtigerConfiguration','as':_0x48f8('0x7'),'attributes':['id',_0x48f8('0x2')],'include':[{'model':'VtigerField','as':_0x48f8('0x8'),'attributes':['id',_0x48f8('0x9'),_0x48f8('0xa'),_0x48f8('0xb')],'include':[{'model':_0x48f8('0xc'),'as':'Variable','attributes':['id',_0x48f8('0x2')]}]},{'model':_0x48f8('0xd'),'as':_0x48f8('0xe'),'attributes':['id',_0x48f8('0x9'),'content',_0x48f8('0xf'),_0x48f8('0x10'),_0x48f8('0x11'),_0x48f8('0xb')],'include':[{'model':_0x48f8('0xc'),'as':'Variable','attributes':['id',_0x48f8('0x2')]}]},{'model':'VtigerField','as':_0x48f8('0x12'),'attributes':['id',_0x48f8('0x9'),_0x48f8('0xa'),_0x48f8('0x13'),_0x48f8('0x14'),_0x48f8('0x15'),'variableName'],'include':[{'model':_0x48f8('0xc'),'as':_0x48f8('0xc'),'attributes':['id',_0x48f8('0x2')]}]}]}]},'log':_0x48f8('0x16')});};};
\ No newline at end of file
+var _0xa8fd=['nameField','customField','GetVtigerAccount','../../client','Request','name','description','username','accessKey','remoteUri','VtigerConfiguration','VtigerField','Subjects','type','content','Variable','key','keyType','variableName','Fields','idField'];(function(_0x1696c2,_0x3300d7){var _0xaad58e=function(_0x57917d){while(--_0x57917d){_0x1696c2['push'](_0x1696c2['shift']());}};_0xaad58e(++_0x3300d7);}(_0xa8fd,0x6c));var _0xda8f=function(_0xe2f7a3,_0x1b9cb9){_0xe2f7a3=_0xe2f7a3-0x0;var _0x40e99=_0xa8fd[_0xe2f7a3];return _0x40e99;};'use strict';var client=require(_0xda8f('0x0'));exports['getVtigerAccounts']=function(){return function(_0x47d94c){return client[_0xda8f('0x1')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0xda8f('0x2'),_0xda8f('0x3'),_0xda8f('0x4'),_0xda8f('0x5'),_0xda8f('0x6'),'serverUrl'],'include':[{'model':_0xda8f('0x7'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0xda8f('0x8'),'as':_0xda8f('0x9'),'attributes':['id',_0xda8f('0xa'),_0xda8f('0xb'),'variableName'],'include':[{'model':'Variable','as':_0xda8f('0xc'),'attributes':['id',_0xda8f('0x2')]}]},{'model':_0xda8f('0x8'),'as':'Descriptions','attributes':['id',_0xda8f('0xa'),'content',_0xda8f('0xd'),_0xda8f('0xe'),'keyContent',_0xda8f('0xf')],'include':[{'model':_0xda8f('0xc'),'as':_0xda8f('0xc'),'attributes':['id',_0xda8f('0x2')]}]},{'model':_0xda8f('0x8'),'as':_0xda8f('0x10'),'attributes':['id','type',_0xda8f('0xb'),_0xda8f('0x11'),_0xda8f('0x12'),_0xda8f('0x13'),'variableName'],'include':[{'model':_0xda8f('0xc'),'as':_0xda8f('0xc'),'attributes':['id',_0xda8f('0x2')]}]}]}]},'log':_0xda8f('0x14')});};};
\ No newline at end of file
index 9fca581..85167b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83f5=['content','Variable','Descriptions','keyContent','variableName','Fields','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','username','password','authType','serverUrl','type','ZendeskConfiguration','Configurations','name','Tag','ZendeskField','Subjects'];(function(_0x929588,_0x60eab9){var _0x46b53a=function(_0xe028a4){while(--_0xe028a4){_0x929588['push'](_0x929588['shift']());}};_0x46b53a(++_0x60eab9);}(_0x83f5,0x1d4));var _0x583f=function(_0x5bb8c3,_0x4e244c){_0x5bb8c3=_0x5bb8c3-0x0;var _0x27f270=_0x83f5[_0x5bb8c3];return _0x27f270;};'use strict';var client=require(_0x583f('0x0'));exports[_0x583f('0x1')]=function(){return function(_0x3baf53){return client[_0x583f('0x2')](_0x583f('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x583f('0x4'),_0x583f('0x5'),'token','remoteUri',_0x583f('0x6'),_0x583f('0x7'),_0x583f('0x8')],'include':[{'model':_0x583f('0x9'),'as':_0x583f('0xa'),'attributes':['id',_0x583f('0xb')],'include':[{'model':_0x583f('0xc'),'attributes':['id',_0x583f('0xb')]},{'model':_0x583f('0xd'),'as':_0x583f('0xe'),'attributes':['id','type',_0x583f('0xf'),'variableName'],'include':[{'model':_0x583f('0x10'),'as':_0x583f('0x10'),'attributes':['id',_0x583f('0xb')]}]},{'model':_0x583f('0xd'),'as':_0x583f('0x11'),'attributes':['id',_0x583f('0x8'),'content','key','keyType',_0x583f('0x12'),_0x583f('0x13')],'include':[{'model':_0x583f('0x10'),'as':_0x583f('0x10'),'attributes':['id',_0x583f('0xb')]}]},{'model':_0x583f('0xd'),'as':_0x583f('0x14'),'attributes':['id',_0x583f('0x8'),'content','idField',_0x583f('0x15'),_0x583f('0x16'),_0x583f('0x13')],'include':[{'model':_0x583f('0x10'),'as':_0x583f('0x10'),'attributes':['id',_0x583f('0xb')]}]}]}]},'log':_0x583f('0x3')});};};
\ No newline at end of file
+var _0x4234=['Configurations','Tag','ZendeskField','Subjects','type','content','variableName','Variable','keyType','Fields','nameField','GetZendeskAccount','../../client','getZendeskAccounts','Request','name','password','token','remoteUri','serverUrl','ZendeskConfiguration'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x4234,0x15c));var _0x4423=function(_0x45b98e,_0x430ca8){_0x45b98e=_0x45b98e-0x0;var _0xd75627=_0x4234[_0x45b98e];return _0xd75627;};'use strict';var client=require(_0x4423('0x0'));exports[_0x4423('0x1')]=function(){return function(_0x573850){return client[_0x4423('0x2')]('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0x4423('0x3'),'username',_0x4423('0x4'),_0x4423('0x5'),_0x4423('0x6'),'authType',_0x4423('0x7'),'type'],'include':[{'model':_0x4423('0x8'),'as':_0x4423('0x9'),'attributes':['id','name'],'include':[{'model':_0x4423('0xa'),'attributes':['id',_0x4423('0x3')]},{'model':_0x4423('0xb'),'as':_0x4423('0xc'),'attributes':['id',_0x4423('0xd'),_0x4423('0xe'),_0x4423('0xf')],'include':[{'model':_0x4423('0x10'),'as':'Variable','attributes':['id',_0x4423('0x3')]}]},{'model':_0x4423('0xb'),'as':'Descriptions','attributes':['id','type',_0x4423('0xe'),'key',_0x4423('0x11'),'keyContent',_0x4423('0xf')],'include':[{'model':_0x4423('0x10'),'as':_0x4423('0x10'),'attributes':['id','name']}]},{'model':_0x4423('0xb'),'as':_0x4423('0x12'),'attributes':['id',_0x4423('0xd'),_0x4423('0xe'),'idField',_0x4423('0x13'),'customField',_0x4423('0xf')],'include':[{'model':_0x4423('0x10'),'as':_0x4423('0x10'),'attributes':['id','name']}]}]}]},'log':_0x4423('0x14')});};};
\ No newline at end of file
index 9454b35..7fb802d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x947b=['key','keyType','keyContent','variableName','Fields','nameField','customField','Request','GetZohoAccount','name','description','authToken','serverUrl','Configurations','ZohoField','Subjects','type','content','Variable','Descriptions'];(function(_0x3124dd,_0x563516){var _0x912c3b=function(_0x1f153b){while(--_0x1f153b){_0x3124dd['push'](_0x3124dd['shift']());}};_0x912c3b(++_0x563516);}(_0x947b,0xf7));var _0xb947=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x947b[_0x397e5f];return _0x5302b8;};'use strict';var client=require('../../client');exports['getZohoAccounts']=function(){return function(_0x521e31){return client[_0xb947('0x0')](_0xb947('0x1'),{'options':{'raw':![],'attributes':['id',_0xb947('0x2'),_0xb947('0x3'),_0xb947('0x4'),'host',_0xb947('0x5')],'include':[{'model':'ZohoConfiguration','as':_0xb947('0x6'),'attributes':['id',_0xb947('0x2')],'include':[{'model':_0xb947('0x7'),'as':_0xb947('0x8'),'attributes':['id',_0xb947('0x9'),_0xb947('0xa'),'variableName'],'include':[{'model':_0xb947('0xb'),'as':_0xb947('0xb'),'attributes':['id','name']}]},{'model':'ZohoField','as':_0xb947('0xc'),'attributes':['id',_0xb947('0x9'),_0xb947('0xa'),_0xb947('0xd'),_0xb947('0xe'),_0xb947('0xf'),_0xb947('0x10')],'include':[{'model':'Variable','as':_0xb947('0xb'),'attributes':['id','name']}]},{'model':_0xb947('0x7'),'as':_0xb947('0x11'),'attributes':['id',_0xb947('0x9'),'content','idField',_0xb947('0x12'),_0xb947('0x13'),_0xb947('0x10')],'include':[{'model':_0xb947('0xb'),'as':_0xb947('0xb'),'attributes':['id',_0xb947('0x2')]}]}]}]},'log':_0xb947('0x1')});};};
\ No newline at end of file
+var _0x361f=['name','authToken','host','serverUrl','ZohoConfiguration','Configurations','content','variableName','Variable','ZohoField','type','key','keyType','keyContent','idField','nameField','customField','../../client','getZohoAccounts','GetZohoAccount'];(function(_0xfeb727,_0x562dca){var _0x1f8066=function(_0x1b7a43){while(--_0x1b7a43){_0xfeb727['push'](_0xfeb727['shift']());}};_0x1f8066(++_0x562dca);}(_0x361f,0xed));var _0xf361=function(_0x332f21,_0x55e7da){_0x332f21=_0x332f21-0x0;var _0x25f9b0=_0x361f[_0x332f21];return _0x25f9b0;};'use strict';var client=require(_0xf361('0x0'));exports[_0xf361('0x1')]=function(){return function(_0xd584ba){return client['Request'](_0xf361('0x2'),{'options':{'raw':![],'attributes':['id',_0xf361('0x3'),'description',_0xf361('0x4'),_0xf361('0x5'),_0xf361('0x6')],'include':[{'model':_0xf361('0x7'),'as':_0xf361('0x8'),'attributes':['id',_0xf361('0x3')],'include':[{'model':'ZohoField','as':'Subjects','attributes':['id','type',_0xf361('0x9'),_0xf361('0xa')],'include':[{'model':_0xf361('0xb'),'as':_0xf361('0xb'),'attributes':['id','name']}]},{'model':_0xf361('0xc'),'as':'Descriptions','attributes':['id',_0xf361('0xd'),_0xf361('0x9'),_0xf361('0xe'),_0xf361('0xf'),_0xf361('0x10'),_0xf361('0xa')],'include':[{'model':_0xf361('0xb'),'as':_0xf361('0xb'),'attributes':['id',_0xf361('0x3')]}]},{'model':_0xf361('0xc'),'as':'Fields','attributes':['id',_0xf361('0xd'),_0xf361('0x9'),_0xf361('0x11'),_0xf361('0x12'),_0xf361('0x13'),_0xf361('0xa')],'include':[{'model':_0xf361('0xb'),'as':'Variable','attributes':['id',_0xf361('0x3')]}]}]}]},'log':_0xf361('0x2')});};};
\ No newline at end of file
index 70429e9..0818758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ae2=['voiceDialReport','starttime','endtime','diff','outbound','dialstring','lodash','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','calleridnum','exten','agent','accountcode','toNumber','uniqueid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ae2,0x1b6));var _0x25ae=function(_0x4bea66,_0x1b18e5){_0x4bea66=_0x4bea66-0x0;var _0x54abf7=_0x5ae2[_0x4bea66];return _0x54abf7;};'use strict';var moment=require('moment');var _=require(_0x25ae('0x0'));var util=require('util');var client=require(_0x25ae('0x1'));exports[_0x25ae('0x2')]=function(_0x5bd748){var _0x1ac532=_0x5bd748['queuecallercompleteAt']||_0x5bd748[_0x25ae('0x3')];return client[_0x25ae('0x4')](_0x25ae('0x5'),{'body':{'channel':_0x25ae('0x6'),'membername':_0x5bd748[_0x25ae('0x7')],'interface':_[_0x25ae('0x8')](_0x5bd748[_0x25ae('0x9')])?util[_0x25ae('0xa')](_0x25ae('0xb'),_0x5bd748[_0x25ae('0x7')]):_0x5bd748[_0x25ae('0x9')],'type':_0x25ae('0xc'),'enterAt':_0x5bd748[_0x25ae('0xd')],'exitAt':_0x1ac532,'duration':moment(_0x1ac532)['diff'](_0x5bd748['queuecallerleaveAt'],_0x25ae('0xe')),'data1':'inbound','data2':_0x5bd748[_0x25ae('0xf')],'data3':_0x5bd748[_0x25ae('0x10')],'data4':null,'data5':_0x5bd748['queue'],'role':_0x25ae('0x11'),'internal':_0x5bd748[_0x25ae('0x12')]?_[_0x25ae('0x13')](_0x5bd748[_0x25ae('0x12')]):undefined,'uniqueid':_0x5bd748[_0x25ae('0x14')]},'log':_0x25ae('0x5')});};exports[_0x25ae('0x15')]=function(_0x25370f){return client[_0x25ae('0x4')](_0x25ae('0x5'),{'body':{'channel':_0x25ae('0x6'),'membername':_0x25370f['membername'],'interface':_0x25370f[_0x25ae('0x9')],'type':_0x25ae('0xc'),'enterAt':_0x25370f[_0x25ae('0x16')],'exitAt':_0x25370f[_0x25ae('0x17')],'duration':moment(_0x25370f[_0x25ae('0x17')])[_0x25ae('0x18')](_0x25370f[_0x25ae('0x16')],'seconds')>=0x0?moment(_0x25370f[_0x25ae('0x17')])['diff'](_0x25370f[_0x25ae('0x16')],'seconds'):null,'data1':_0x25ae('0x19'),'data2':_0x25370f[_0x25ae('0x12')],'data3':_0x25370f[_0x25ae('0x10')],'data4':_0x25370f[_0x25ae('0x1a')]||null,'role':_0x25ae('0x11'),'internal':_0x25370f['accountcode']?_[_0x25ae('0x13')](_0x25370f[_0x25ae('0x12')]):undefined,'uniqueid':_0x25370f['uniqueid']},'log':_0x25ae('0x5')});};
\ No newline at end of file
+var _0xabd3=['moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','lastAssignedTo','isNil','format','SIP/%s','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voice','membername','endtime','starttime','outbound','CreateMemberReport'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xabd3,0xb4));var _0x3abd=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0xabd3[_0x695b76];return _0x1dc21f;};'use strict';var moment=require(_0x3abd('0x0'));var _=require('lodash');var util=require(_0x3abd('0x1'));var client=require(_0x3abd('0x2'));exports[_0x3abd('0x3')]=function(_0x2b33c9){var _0x288ed0=_0x2b33c9[_0x3abd('0x4')]||_0x2b33c9[_0x3abd('0x5')];return client[_0x3abd('0x6')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x2b33c9[_0x3abd('0x7')],'interface':_[_0x3abd('0x8')](_0x2b33c9['interface'])?util[_0x3abd('0x9')](_0x3abd('0xa'),_0x2b33c9[_0x3abd('0x7')]):_0x2b33c9[_0x3abd('0xb')],'type':_0x3abd('0xc'),'enterAt':_0x2b33c9[_0x3abd('0xd')],'exitAt':_0x288ed0,'duration':moment(_0x288ed0)[_0x3abd('0xe')](_0x2b33c9['queuecallerleaveAt'],_0x3abd('0xf')),'data1':_0x3abd('0x10'),'data2':_0x2b33c9[_0x3abd('0x11')],'data3':_0x2b33c9[_0x3abd('0x12')],'data4':null,'data5':_0x2b33c9[_0x3abd('0x13')],'role':_0x3abd('0x14'),'internal':_0x2b33c9[_0x3abd('0x15')]?_[_0x3abd('0x16')](_0x2b33c9[_0x3abd('0x15')]):undefined,'uniqueid':_0x2b33c9[_0x3abd('0x17')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x270919){return client[_0x3abd('0x6')]('CreateMemberReport',{'body':{'channel':_0x3abd('0x18'),'membername':_0x270919[_0x3abd('0x19')],'interface':_0x270919[_0x3abd('0xb')],'type':'TALKING','enterAt':_0x270919['starttime'],'exitAt':_0x270919[_0x3abd('0x1a')],'duration':moment(_0x270919[_0x3abd('0x1a')])['diff'](_0x270919[_0x3abd('0x1b')],_0x3abd('0xf'))>=0x0?moment(_0x270919['endtime'])[_0x3abd('0xe')](_0x270919[_0x3abd('0x1b')],_0x3abd('0xf')):null,'data1':_0x3abd('0x1c'),'data2':_0x270919[_0x3abd('0x15')],'data3':_0x270919['exten'],'data4':_0x270919['dialstring']||null,'role':_0x3abd('0x14'),'internal':_0x270919[_0x3abd('0x15')]?_['toNumber'](_0x270919[_0x3abd('0x15')]):undefined,'uniqueid':_0x270919[_0x3abd('0x17')]},'log':_0x3abd('0x1d')});};
\ No newline at end of file
index 5565798..a78a731 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x872d=['GetTemplate','../client','Request'];(function(_0x4684e6,_0x353bfd){var _0x4a5336=function(_0x2e851e){while(--_0x2e851e){_0x4684e6['push'](_0x4684e6['shift']());}};_0x4a5336(++_0x353bfd);}(_0x872d,0x1ed));var _0xd872=function(_0x19933b,_0x2011de){_0x19933b=_0x19933b-0x0;var _0xcc764a=_0x872d[_0x19933b];return _0xcc764a;};'use strict';var client=require(_0xd872('0x0'));exports['getTemplates']=function(_0x369a0b){return function(_0x3e242d){return client[_0xd872('0x1')](_0xd872('0x2'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0xd872('0x2')});};};
\ No newline at end of file
+var _0xe85d=['html','GetTemplate','../client','getTemplates','Request','name'];(function(_0x40894a,_0x1862a6){var _0x9870b3=function(_0xd6617c){while(--_0xd6617c){_0x40894a['push'](_0x40894a['shift']());}};_0x9870b3(++_0x1862a6);}(_0xe85d,0x164));var _0xde85=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0xe85d[_0xd511d];return _0x3f148e;};'use strict';var client=require(_0xde85('0x0'));exports[_0xde85('0x1')]=function(_0x5751c2){return function(_0x71e144){return client[_0xde85('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xde85('0x3'),_0xde85('0x4')]},'log':_0xde85('0x5')});};};
\ No newline at end of file
index ef28ab3..fc09bcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x2b97eb,_0x415ba5){var _0x2f5783=function(_0x13aaa4){while(--_0x13aaa4){_0x2b97eb['push'](_0x2b97eb['shift']());}};_0x2f5783(++_0x415ba5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x485926,_0x21ca25){var _0x4cd5c3=function(_0x1d4d59){while(--_0x1d4d59){_0x485926['push'](_0x485926['shift']());}};_0x4cd5c3(++_0x21ca25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
index bb993ca..0eeccf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde44=['name','registry','../client','getTrunks','Request','GetTrunk'];(function(_0x31d8ae,_0x41eb1f){var _0x4ec705=function(_0x12ee87){while(--_0x12ee87){_0x31d8ae['push'](_0x31d8ae['shift']());}};_0x4ec705(++_0x41eb1f);}(_0xde44,0x18e));var _0x4de4=function(_0x203a27,_0x2cc7f6){_0x203a27=_0x203a27-0x0;var _0x1bc9ac=_0xde44[_0x203a27];return _0x1bc9ac;};'use strict';var client=require(_0x4de4('0x0'));exports[_0x4de4('0x1')]=function(_0x22b066){return function(_0x13986d){return client[_0x4de4('0x2')](_0x4de4('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x4de4('0x4'),_0x4de4('0x5')]},'log':_0x4de4('0x3')});};};
\ No newline at end of file
+var _0x2dab=['getTrunks','Request','GetTrunk','name','registry'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x2dab,0x12c));var _0xb2da=function(_0x115950,_0x1e2d0f){_0x115950=_0x115950-0x0;var _0x22adb0=_0x2dab[_0x115950];return _0x22adb0;};'use strict';var client=require('../client');exports[_0xb2da('0x0')]=function(_0x2b5820){return function(_0x31c20b){return client[_0xb2da('0x1')](_0xb2da('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb2da('0x3'),_0xb2da('0x4')]},'log':_0xb2da('0x2')});};};
\ No newline at end of file
index f2ffb23..304fc9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec19=['savePause','saveUnpause','ShowUser','email','online','getAgent','../client','getAgents','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','internal','PauseUser'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xec19,0x66));var _0x9ec1=function(_0x57e679,_0x477f70){_0x57e679=_0x57e679-0x0;var _0x4ba184=_0xec19[_0x57e679];return _0x4ba184;};'use strict';var client=require(_0x9ec1('0x0'));exports[_0x9ec1('0x1')]=function(){return function(){return client[_0x9ec1('0x2')](_0x9ec1('0x3'),{'options':{'raw':![],'where':{'role':_0x9ec1('0x4')},'attributes':['id',_0x9ec1('0x5'),'email',_0x9ec1('0x6'),_0x9ec1('0x7'),'online',_0x9ec1('0x8'),_0x9ec1('0x9'),_0x9ec1('0xa'),_0x9ec1('0xb'),_0x9ec1('0xc'),_0x9ec1('0xd'),_0x9ec1('0xe')]},'log':'getAgents'});};};exports[_0x9ec1('0xf')]=function(){return function(){return client['Request'](_0x9ec1('0x3'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9ec1('0x5'),_0x9ec1('0x6'),_0x9ec1('0x10')]},'log':_0x9ec1('0xf')});};};exports['savePause']=function(_0x568964,_0x26437e,_0x3b6e27){return client[_0x9ec1('0x2')](_0x9ec1('0x11'),{'body':{'type':_0x26437e,'uniqueid':_0x3b6e27},'options':{'where':{'id':_0x568964['id']}},'log':_0x9ec1('0x12')});};exports[_0x9ec1('0x13')]=function(_0x1e61c7){return client[_0x9ec1('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x1e61c7['id']}},'log':_0x9ec1('0x12')});};exports['getAgent']=function(_0x136eb6){return client[_0x9ec1('0x2')](_0x9ec1('0x14'),{'options':{'raw':![],'where':{'role':_0x9ec1('0x4'),'id':_0x136eb6},'attributes':['id',_0x9ec1('0x5'),_0x9ec1('0x15'),_0x9ec1('0x6'),_0x9ec1('0x7'),_0x9ec1('0x16'),_0x9ec1('0x8'),_0x9ec1('0x9'),_0x9ec1('0xa'),_0x9ec1('0xb'),_0x9ec1('0xe')]},'log':_0x9ec1('0x17')});};
\ No newline at end of file
+var _0xc59c=['lastLoginAt','getAgent','Request','GetUser','agent','accountcode','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','internal','savePause','saveUnpause','name','email','fullname','online'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc59c,0x1a6));var _0xcc59=function(_0x143565,_0x54d887){_0x143565=_0x143565-0x0;var _0x4dc1d9=_0xc59c[_0x143565];return _0x4dc1d9;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0xcc59('0x0')](_0xcc59('0x1'),{'options':{'raw':![],'where':{'role':_0xcc59('0x2')},'attributes':['id','name','email',_0xcc59('0x3'),'fullname','online','lastLoginAt',_0xcc59('0x4'),_0xcc59('0x5'),_0xcc59('0x6'),_0xcc59('0x7'),_0xcc59('0x8'),_0xcc59('0x9')]},'log':_0xcc59('0xa')});};};exports[_0xcc59('0xb')]=function(){return function(){return client[_0xcc59('0x0')](_0xcc59('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name',_0xcc59('0x3'),_0xcc59('0xc')]},'log':_0xcc59('0xb')});};};exports[_0xcc59('0xd')]=function(_0x25bd2b,_0x429c93,_0x28cdb9){return client[_0xcc59('0x0')]('PauseUser',{'body':{'type':_0x429c93,'uniqueid':_0x28cdb9},'options':{'where':{'id':_0x25bd2b['id']}},'log':_0xcc59('0xd')});};exports[_0xcc59('0xe')]=function(_0xb24e3){return client[_0xcc59('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0xb24e3['id']}},'log':_0xcc59('0xd')});};exports['getAgent']=function(_0x4451f7){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0xcc59('0x2'),'id':_0x4451f7},'attributes':['id',_0xcc59('0xf'),_0xcc59('0x10'),_0xcc59('0x3'),_0xcc59('0x11'),_0xcc59('0x12'),_0xcc59('0x13'),'pauseType',_0xcc59('0x5'),'voicePause',_0xcc59('0x9')]},'log':_0xcc59('0x14')});};
\ No newline at end of file
index 2b7bff8..07d4a73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bbc=['UpdateVoiceAgentReport','Request'];(function(_0x4bae33,_0x27bab8){var _0x52ca03=function(_0x28fcd7){while(--_0x28fcd7){_0x4bae33['push'](_0x4bae33['shift']());}};_0x52ca03(++_0x27bab8);}(_0x7bbc,0x71));var _0xc7bb=function(_0x497670,_0x36c9a7){_0x497670=_0x497670-0x0;var _0x420a82=_0x7bbc[_0x497670];return _0x420a82;};'use strict';var client=require('../client');exports['create']=function(_0x1921ea){return client[_0xc7bb('0x0')]('CreateVoiceAgentReport',{'body':_0x1921ea,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x1fe338,_0xf90f3a,_0x127203){return client[_0xc7bb('0x0')](_0xc7bb('0x1'),{'body':_0x1fe338,'options':{'where':{'uniqueid':_0xf90f3a,'interface':_0x127203}},'log':_0xc7bb('0x1')});};
\ No newline at end of file
+var _0x3abc=['update','UpdateVoiceAgentReport','create','Request'];(function(_0x38efec,_0x33763b){var _0x526389=function(_0x1ab172){while(--_0x1ab172){_0x38efec['push'](_0x38efec['shift']());}};_0x526389(++_0x33763b);}(_0x3abc,0x132));var _0xc3ab=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x3abc[_0x580576];return _0x3f55a0;};'use strict';var client=require('../client');exports[_0xc3ab('0x0')]=function(_0x3d6bc2){return client[_0xc3ab('0x1')]('CreateVoiceAgentReport',{'body':_0x3d6bc2,'log':'CreateVoiceAgentReport'});};exports[_0xc3ab('0x2')]=function(_0x46df64,_0x5e0db7,_0x2f9f2b){return client[_0xc3ab('0x1')](_0xc3ab('0x3'),{'body':_0x46df64,'options':{'where':{'uniqueid':_0x5e0db7,'interface':_0x2f9f2b}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index 377ee24..01407d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8946=['disposition','duration','billableseconds','GetVoiceCallReports','moment','util','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day'];(function(_0x1d7acf,_0x3e1ec9){var _0x29ad0b=function(_0x368755){while(--_0x368755){_0x1d7acf['push'](_0x1d7acf['shift']());}};_0x29ad0b(++_0x3e1ec9);}(_0x8946,0x17a));var _0x6894=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x8946[_0x3e44fa];return _0x2a0aba;};'use strict';var moment=require(_0x6894('0x0'));var util=require(_0x6894('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x3a6ca8){return client['Request'](_0x6894('0x2'),{'body':_['merge'](_0x3a6ca8,{'source':_0x3a6ca8['calleridnum'],'destinationcontext':_0x3a6ca8[_0x6894('0x3')],'callerid':_0x3a6ca8[_0x6894('0x4')],'amaflags':_0x6894('0x5')}),'log':_0x6894('0x2')});};exports[_0x6894('0x6')]=function(){return function(){return client[_0x6894('0x7')](_0x6894('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x6894('0x9')]('day')[_0x6894('0xa')](_0x6894('0xb')),moment()['endOf'](_0x6894('0xc'))['format'](_0x6894('0xb'))]}},'attributes':['type',_0x6894('0xd'),_0x6894('0xe'),_0x6894('0xf')]},'log':_0x6894('0x10')});};};
\ No newline at end of file
+var _0xa362=['outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport'];(function(_0x3a5d81,_0x594307){var _0x48de09=function(_0x355e36){while(--_0x355e36){_0x3a5d81['push'](_0x3a5d81['shift']());}};_0x48de09(++_0x594307);}(_0xa362,0xe6));var _0x2a36=function(_0x4c5e26,_0x59e1ae){_0x4c5e26=_0x4c5e26-0x0;var _0x53c9cc=_0xa362[_0x4c5e26];return _0x53c9cc;};'use strict';var moment=require('moment');var util=require(_0x2a36('0x0'));var _=require(_0x2a36('0x1'));var client=require(_0x2a36('0x2'));exports[_0x2a36('0x3')]=function(_0x5918e6){return client[_0x2a36('0x4')](_0x2a36('0x5'),{'body':_[_0x2a36('0x6')](_0x5918e6,{'source':_0x5918e6[_0x2a36('0x7')],'destinationcontext':_0x5918e6[_0x2a36('0x8')],'callerid':_0x5918e6[_0x2a36('0x9')],'amaflags':_0x2a36('0xa')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x2a36('0xb'),{'options':{'where':{'type':[_0x2a36('0xc')],'createdAt':{'$between':[moment()[_0x2a36('0xd')]('day')[_0x2a36('0xe')](_0x2a36('0xf')),moment()[_0x2a36('0x10')](_0x2a36('0x11'))['format'](_0x2a36('0xf'))]}},'attributes':[_0x2a36('0x12'),_0x2a36('0x13'),_0x2a36('0x14'),'billableseconds']},'log':_0x2a36('0x15')});};};
\ No newline at end of file
index 7ece72b..3b05105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa373=['CreateVoiceDialReport','Request'];(function(_0x2ed04f,_0x1c48e9){var _0x46535a=function(_0x15135b){while(--_0x15135b){_0x2ed04f['push'](_0x2ed04f['shift']());}};_0x46535a(++_0x1c48e9);}(_0xa373,0x1d7));var _0x3a37=function(_0x4f29ca,_0x2ee357){_0x4f29ca=_0x4f29ca-0x0;var _0x5e53b8=_0xa373[_0x4f29ca];return _0x5e53b8;};'use strict';var client=require('../client');exports['create']=function(_0x289dbc){return client[_0x3a37('0x0')](_0x3a37('0x1'),{'body':_0x289dbc,'log':_0x3a37('0x1')});};
\ No newline at end of file
+var _0xc742=['Request','CreateVoiceDialReport','../client'];(function(_0x32ee61,_0x3f1b2d){var _0x226c2f=function(_0x46ac3a){while(--_0x46ac3a){_0x32ee61['push'](_0x32ee61['shift']());}};_0x226c2f(++_0x3f1b2d);}(_0xc742,0x74));var _0x2c74=function(_0x55e0a8,_0x38e4c7){_0x55e0a8=_0x55e0a8-0x0;var _0x42c967=_0xc742[_0x55e0a8];return _0x42c967;};'use strict';var client=require(_0x2c74('0x0'));exports['create']=function(_0x1038e0){return client[_0x2c74('0x1')](_0x2c74('0x2'),{'body':_0x1038e0,'log':_0x2c74('0x2')});};
\ No newline at end of file
index e2e51aa..efb58a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc053=['recordingFormat','getVoiceExtensions','../client','Request','GetVoiceExtension','exten'];(function(_0x5d004d,_0x295f87){var _0x173a51=function(_0x4677b9){while(--_0x4677b9){_0x5d004d['push'](_0x5d004d['shift']());}};_0x173a51(++_0x295f87);}(_0xc053,0x1e2));var _0x3c05=function(_0x296e52,_0x428515){_0x296e52=_0x296e52-0x0;var _0x286070=_0xc053[_0x296e52];return _0x286070;};'use strict';var client=require(_0x3c05('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x3c05('0x1')](_0x3c05('0x2'),{'options':{'raw':!![],'attributes':['id',_0x3c05('0x3'),_0x3c05('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x3c05('0x5')});};};
\ No newline at end of file
+var _0x3024=['recordingFormat','getVoiceExtensions','Request'];(function(_0x4a5cd1,_0x575366){var _0x2f42dc=function(_0x3f9f7d){while(--_0x3f9f7d){_0x4a5cd1['push'](_0x4a5cd1['shift']());}};_0x2f42dc(++_0x575366);}(_0x3024,0x17b));var _0x4302=function(_0x3eb1e8,_0x5c32d6){_0x3eb1e8=_0x3eb1e8-0x0;var _0x2e9fae=_0x3024[_0x3eb1e8];return _0x2e9fae;};'use strict';var client=require('../client');exports[_0x4302('0x0')]=function(){return function(){return client[_0x4302('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x4302('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x4302('0x0')});};};
\ No newline at end of file
index 7d6e721..5e7cdcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd232=['dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','TrunkBackup','active','Interval','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2d23('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x2d23('0x1')](_0x2d23('0x2'),{'options':{'raw':![],'attributes':['id',_0x2d23('0x3'),_0x2d23('0x4'),_0x2d23('0x5'),'autopause','monitor_format',_0x2d23('0x6'),'dialActive','dialMethod',_0x2d23('0x7'),_0x2d23('0x8'),_0x2d23('0x9'),'dialPredictiveOptimization',_0x2d23('0xa'),'dialPredictiveInterval',_0x2d23('0xb'),_0x2d23('0xc'),_0x2d23('0xd'),_0x2d23('0xe'),_0x2d23('0xf'),_0x2d23('0x10'),_0x2d23('0x11'),'dialCongestionRetryFrequency',_0x2d23('0x12'),_0x2d23('0x13'),_0x2d23('0x14'),_0x2d23('0x15'),_0x2d23('0x16'),_0x2d23('0x17'),_0x2d23('0x18'),_0x2d23('0x19'),_0x2d23('0x1a'),_0x2d23('0x1b'),_0x2d23('0x1c'),_0x2d23('0x1d'),'dialAMDAfterGreetingSilence',_0x2d23('0x1e'),_0x2d23('0x1f'),_0x2d23('0x20'),_0x2d23('0x21'),_0x2d23('0x22'),'dialAMDMaximumWordLength',_0x2d23('0x23'),'dialRecallMeTimeout',_0x2d23('0x24'),'dialOrderByScheduledAt',_0x2d23('0x25'),_0x2d23('0x26'),'dialQueueProject2','monitor_format',_0x2d23('0x27'),_0x2d23('0x28'),_0x2d23('0x29')],'include':[{'model':_0x2d23('0x2a'),'as':_0x2d23('0x2a'),'attributes':['id',_0x2d23('0x3'),'callerid','active']},{'model':_0x2d23('0x2a'),'as':_0x2d23('0x2b'),'attributes':['id',_0x2d23('0x3'),'callerid',_0x2d23('0x2c')]},{'model':_0x2d23('0x2d'),'as':_0x2d23('0x2d'),'attributes':['id',_0x2d23('0x3')],'include':[{'model':_0x2d23('0x2d'),'as':'Intervals','attributes':['id',_0x2d23('0x3'),_0x2d23('0x2e')]}]}]},'log':_0x2d23('0x2f')});};};
\ No newline at end of file
+var _0x6629=['dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','TrunkBackup','active','Interval','Intervals','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue'];(function(_0x262bf2,_0x4aa628){var _0x2b4cde=function(_0x1efbbc){while(--_0x1efbbc){_0x262bf2['push'](_0x262bf2['shift']());}};_0x2b4cde(++_0x4aa628);}(_0x6629,0x1c2));var _0x9662=function(_0x1746ad,_0x59d87e){_0x1746ad=_0x1746ad-0x0;var _0x486ef5=_0x6629[_0x1746ad];return _0x486ef5;};'use strict';var client=require(_0x9662('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x9662('0x1'),{'options':{'raw':![],'attributes':['id',_0x9662('0x2'),_0x9662('0x3'),_0x9662('0x4'),'autopause',_0x9662('0x5'),_0x9662('0x6'),_0x9662('0x7'),'dialMethod',_0x9662('0x8'),_0x9662('0x9'),_0x9662('0xa'),'dialPredictiveOptimization',_0x9662('0xb'),'dialPredictiveInterval',_0x9662('0xc'),_0x9662('0xd'),_0x9662('0xe'),_0x9662('0xf'),_0x9662('0x10'),_0x9662('0x11'),_0x9662('0x12'),_0x9662('0x13'),_0x9662('0x14'),_0x9662('0x15'),_0x9662('0x16'),'dialNoAnswerRetryFrequency',_0x9662('0x17'),'dialTimezone',_0x9662('0x18'),_0x9662('0x19'),'dialCheckDuplicateType',_0x9662('0x1a'),_0x9662('0x1b'),_0x9662('0x1c'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x9662('0x1d'),'dialAMDBetweenWordsSilence',_0x9662('0x1e'),_0x9662('0x1f'),_0x9662('0x20'),'timeout','dialRecallMeTimeout','dialRecallInQueue',_0x9662('0x21'),_0x9662('0x22'),'dialAgiAfterHangupClient',_0x9662('0x23'),_0x9662('0x5'),_0x9662('0x24'),_0x9662('0x25'),_0x9662('0x26')],'include':[{'model':_0x9662('0x27'),'as':'Trunk','attributes':['id',_0x9662('0x2'),_0x9662('0x28'),'active']},{'model':_0x9662('0x27'),'as':_0x9662('0x29'),'attributes':['id',_0x9662('0x2'),_0x9662('0x28'),_0x9662('0x2a')]},{'model':_0x9662('0x2b'),'as':_0x9662('0x2b'),'attributes':['id',_0x9662('0x2')],'include':[{'model':_0x9662('0x2b'),'as':_0x9662('0x2c'),'attributes':['id','name','interval']}]}]},'log':_0x9662('0x2d')});};};
\ No newline at end of file
index f09ec3f..3d2e672 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ae=['getVoiceQueueReports','startOf','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','Request','CreateVoiceQueueReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb0ae,0x80));var _0xeb0a=function(_0x5bf830,_0x5a0578){_0x5bf830=_0x5bf830-0x0;var _0x1942a5=_0xb0ae[_0x5bf830];return _0x1942a5;};'use strict';var moment=require(_0xeb0a('0x0'));var _=require(_0xeb0a('0x1'));var client=require(_0xeb0a('0x2'));exports['create']=function(_0x2de81e){return client[_0xeb0a('0x3')](_0xeb0a('0x4'),{'body':_0x2de81e,'log':_0xeb0a('0x4')});};exports[_0xeb0a('0x5')]=function(){return function(){return client['Request']('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0xeb0a('0x6')](_0xeb0a('0x7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xeb0a('0x8')](_0xeb0a('0x7'))[_0xeb0a('0x9')](_0xeb0a('0xa'))]}},'attributes':[_0xeb0a('0xb'),'queue','queuecallerjoinAt',_0xeb0a('0xc'),'queuecallercomplete',_0xeb0a('0xd'),_0xeb0a('0xe'),_0xeb0a('0xf'),_0xeb0a('0x10'),_0xeb0a('0x11')]},'log':_0xeb0a('0x12')});};};
\ No newline at end of file
+var _0x1110=['queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallercompleteAt'];(function(_0x1717a0,_0x3df0e9){var _0x4065f3=function(_0x54fce6){while(--_0x54fce6){_0x1717a0['push'](_0x1717a0['shift']());}};_0x4065f3(++_0x3df0e9);}(_0x1110,0x100));var _0x0111=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x1110[_0x46e363];return _0x3fb059;};'use strict';var moment=require(_0x0111('0x0'));var _=require('lodash');var client=require('../client');exports[_0x0111('0x1')]=function(_0x29bcce){return client[_0x0111('0x2')](_0x0111('0x3'),{'body':_0x29bcce,'log':_0x0111('0x3')});};exports[_0x0111('0x4')]=function(){return function(){return client[_0x0111('0x2')](_0x0111('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x0111('0x6'))[_0x0111('0x7')](_0x0111('0x8')),moment()[_0x0111('0x9')](_0x0111('0x6'))[_0x0111('0x7')](_0x0111('0x8'))]}},'attributes':[_0x0111('0xa'),_0x0111('0xb'),_0x0111('0xc'),'queuecallerleaveAt','queuecallercomplete',_0x0111('0xd'),_0x0111('0xe'),_0x0111('0xf'),_0x0111('0x10'),'queuecallerabandonAt']},'log':_0x0111('0x11')});};};
\ No newline at end of file
index 681cabe..3dd613a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c06=['../client','Request','GetVoiceQueueRtPauses'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x5c06,0x147));var _0x65c0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5c06[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x65c0('0x0'));exports['getVoiceQueueRtPauses']=function(_0x12589a){return function(){return client[_0x65c0('0x1')](_0x65c0('0x2'),{'options':{'where':{'VoiceQueueId':_0x12589a,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
+var _0x9f48=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x2174b9,_0xda8177){var _0x39e55d=function(_0x4ba52f){while(--_0x4ba52f){_0x2174b9['push'](_0x2174b9['shift']());}};_0x39e55d(++_0xda8177);}(_0x9f48,0x199));var _0x89f4=function(_0x549938,_0x4eed0a){_0x549938=_0x549938-0x0;var _0x1da138=_0x9f48[_0x549938];return _0x1da138;};'use strict';var client=require(_0x89f4('0x0'));exports[_0x89f4('0x1')]=function(_0x1b08bf){return function(){return client[_0x89f4('0x2')](_0x89f4('0x3'),{'options':{'where':{'VoiceQueueId':_0x1b08bf,'paused':!![]},'raw':!![]},'log':_0x89f4('0x1')});};};
\ No newline at end of file
index 027145f..e291bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x176b=['create','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2dbd3d,_0x2961a0){var _0xe81a64=function(_0x107452){while(--_0x107452){_0x2dbd3d['push'](_0x2dbd3d['shift']());}};_0xe81a64(++_0x2961a0);}(_0x176b,0xd0));var _0xb176=function(_0x111777,_0x43e893){_0x111777=_0x111777-0x0;var _0x18b652=_0x176b[_0x111777];return _0x18b652;};'use strict';var _=require(_0xb176('0x0'));var client=require(_0xb176('0x1'));exports[_0xb176('0x2')]=function(_0x596b36){return client['Request'](_0xb176('0x3'),{'body':_['merge'](_0x596b36,{'value':_0x596b36[_0xb176('0x4')]}),'log':_0xb176('0x3')});};
\ No newline at end of file
+var _0x5250=['create','Request','CreateVoiceRecording','merge','monitorFilename','../client'];(function(_0x9731fe,_0x3116cf){var _0x45adea=function(_0x264448){while(--_0x264448){_0x9731fe['push'](_0x9731fe['shift']());}};_0x45adea(++_0x3116cf);}(_0x5250,0xcb));var _0x0525=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x5250[_0x220afa];return _0x1b79d1;};'use strict';var _=require('lodash');var client=require(_0x0525('0x0'));exports[_0x0525('0x1')]=function(_0x2ac4a3){return client[_0x0525('0x2')](_0x0525('0x3'),{'body':_[_0x0525('0x4')](_0x2ac4a3,{'value':_0x2ac4a3[_0x0525('0x5')]}),'log':_0x0525('0x3')});};
\ No newline at end of file
index e0134b7..dfb7b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x736a=['transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','../client','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transferercontext'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0x736a,0x1d6));var _0xa736=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x736a[_0x474bc0];return _0x4b24cf;};'use strict';var client=require(_0xa736('0x0'));exports['blindTransfer']=function(_0x948207){return client[_0xa736('0x1')](_0xa736('0x2'),{'body':{'result':_0x948207['result'],'transfererchannel':_0x948207['transfererchannel'],'transferercalleridnum':_0x948207[_0xa736('0x3')],'transferercalleridname':_0x948207[_0xa736('0x4')],'transfererconnectedlinenum':_0x948207['transfererconnectedlinenum'],'transfererconnectedlinename':_0x948207['transfererconnectedlinename'],'transfereraccountcode':_0x948207['transfereraccountcode'],'transferercontext':_0x948207[_0xa736('0x5')],'transfererexten':_0x948207[_0xa736('0x6')],'transfererlinkedid':_0x948207[_0xa736('0x7')],'transfereechannel':_0x948207[_0xa736('0x8')],'transfereecalleridnum':_0x948207[_0xa736('0x9')],'transfereecalleridname':_0x948207[_0xa736('0xa')],'transfereeconnectedlinenum':_0x948207[_0xa736('0xb')],'transfereeconnectedlinename':_0x948207['transfereeconnectedlinename'],'transfereeaccountcode':_0x948207[_0xa736('0xc')],'transfereecontext':_0x948207[_0xa736('0xd')],'transfereeexten':_0x948207[_0xa736('0xe')],'transfereelinkedid':_0x948207[_0xa736('0xf')],'isexternal':_0x948207['isexternal'],'context':_0x948207[_0xa736('0x10')],'extension':_0x948207[_0xa736('0x11')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xa736('0x12')]=function(_0x3c69ae){return client[_0xa736('0x1')](_0xa736('0x2'),{'body':{'result':_0x3c69ae[_0xa736('0x13')],'transfererchannel':_0x3c69ae[_0xa736('0x14')],'transferercalleridnum':_0x3c69ae[_0xa736('0x15')],'transferercalleridname':_0x3c69ae['origtransferercalleridname'],'transfererconnectedlinenum':_0x3c69ae[_0xa736('0x16')],'transfererconnectedlinename':_0x3c69ae['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3c69ae[_0xa736('0x17')],'transferercontext':_0x3c69ae['secondtransferercontext'],'transfererexten':_0x3c69ae[_0xa736('0x18')],'transfererlinkedid':_0x3c69ae[_0xa736('0x19')],'transfereechannel':_0x3c69ae[_0xa736('0x1a')],'transfereecalleridnum':_0x3c69ae['transfertargetcalleridnum'],'transfereecalleridname':_0x3c69ae['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3c69ae[_0xa736('0x1b')],'transfereeconnectedlinename':_0x3c69ae[_0xa736('0x1c')],'transfereeaccountcode':_0x3c69ae[_0xa736('0x1d')],'transfereecontext':_0x3c69ae[_0xa736('0x1e')],'transfereeexten':_0x3c69ae[_0xa736('0x1f')],'transfereelinkedid':_0x3c69ae[_0xa736('0x20')],'isexternal':_0x3c69ae[_0xa736('0x21')],'context':_0x3c69ae['origtransferercontext'],'extension':_0x3c69ae['origtransfererexten'],'type':'attended'},'log':_0xa736('0x2')});};
\ No newline at end of file
+var _0x753d=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum'];(function(_0x5f239f,_0x2dcf56){var _0x5b88c2=function(_0x1e7614){while(--_0x1e7614){_0x5f239f['push'](_0x5f239f['shift']());}};_0x5b88c2(++_0x2dcf56);}(_0x753d,0x148));var _0xd753=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x753d[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xd753('0x0'));exports[_0xd753('0x1')]=function(_0x1a206b){return client[_0xd753('0x2')](_0xd753('0x3'),{'body':{'result':_0x1a206b[_0xd753('0x4')],'transfererchannel':_0x1a206b[_0xd753('0x5')],'transferercalleridnum':_0x1a206b['transferercalleridnum'],'transferercalleridname':_0x1a206b[_0xd753('0x6')],'transfererconnectedlinenum':_0x1a206b[_0xd753('0x7')],'transfererconnectedlinename':_0x1a206b[_0xd753('0x8')],'transfereraccountcode':_0x1a206b[_0xd753('0x9')],'transferercontext':_0x1a206b['transferercontext'],'transfererexten':_0x1a206b['transfererexten'],'transfererlinkedid':_0x1a206b[_0xd753('0xa')],'transfereechannel':_0x1a206b['transfereechannel'],'transfereecalleridnum':_0x1a206b['transfereecalleridnum'],'transfereecalleridname':_0x1a206b[_0xd753('0xb')],'transfereeconnectedlinenum':_0x1a206b['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1a206b[_0xd753('0xc')],'transfereeaccountcode':_0x1a206b[_0xd753('0xd')],'transfereecontext':_0x1a206b[_0xd753('0xe')],'transfereeexten':_0x1a206b['transfereeexten'],'transfereelinkedid':_0x1a206b[_0xd753('0xf')],'isexternal':_0x1a206b['isexternal'],'context':_0x1a206b[_0xd753('0x10')],'extension':_0x1a206b[_0xd753('0x11')],'type':_0xd753('0x12')},'log':'CreateVoiceTransferReport'});};exports[_0xd753('0x13')]=function(_0x104ffd){return client[_0xd753('0x2')](_0xd753('0x3'),{'body':{'result':_0x104ffd[_0xd753('0x4')],'transfererchannel':_0x104ffd[_0xd753('0x14')],'transferercalleridnum':_0x104ffd[_0xd753('0x15')],'transferercalleridname':_0x104ffd[_0xd753('0x16')],'transfererconnectedlinenum':_0x104ffd[_0xd753('0x17')],'transfererconnectedlinename':_0x104ffd[_0xd753('0x18')],'transfereraccountcode':_0x104ffd[_0xd753('0x19')],'transferercontext':_0x104ffd[_0xd753('0x1a')],'transfererexten':_0x104ffd[_0xd753('0x1b')],'transfererlinkedid':_0x104ffd[_0xd753('0x1c')],'transfereechannel':_0x104ffd[_0xd753('0x1d')],'transfereecalleridnum':_0x104ffd[_0xd753('0x1e')],'transfereecalleridname':_0x104ffd['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x104ffd[_0xd753('0x1f')],'transfereeconnectedlinename':_0x104ffd[_0xd753('0x20')],'transfereeaccountcode':_0x104ffd[_0xd753('0x21')],'transfereecontext':_0x104ffd[_0xd753('0x22')],'transfereeexten':_0x104ffd[_0xd753('0x23')],'transfereelinkedid':_0x104ffd[_0xd753('0x24')],'isexternal':_0x104ffd[_0xd753('0x25')],'context':_0x104ffd[_0xd753('0x26')],'extension':_0x104ffd['origtransfererexten'],'type':_0xd753('0x27')},'log':_0xd753('0x3')});};
\ No newline at end of file
index bc3523d..04e4d37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x276d=['action','Reload','Action','message','pick','command','Command','then','content','catch','voiceQueues','hasOwnProperty','answered','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','push','values','length','voicechannel','validate','map','channels','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','channel','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Redirect','context','telephones','outboundChannels','campaigns','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','format','SIP','name','timers','timer','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','module'];(function(_0x411850,_0xbdadef){var _0x1860f7=function(_0x21e759){while(--_0x21e759){_0x411850['push'](_0x411850['shift']());}};_0x1860f7(++_0xbdadef);}(_0x276d,0x16f));var _0xd276=function(_0x1aec51,_0x3810ad){_0x1aec51=_0x1aec51-0x0;var _0x178a93=_0x276d[_0x1aec51];return _0x178a93;};'use strict';var _=require('lodash');var util=require(_0xd276('0x0'));var jayson=require(_0xd276('0x1'));var schema=require('validate');var BPromise=require(_0xd276('0x2'));var moment=require(_0xd276('0x3'));var config=require(_0xd276('0x4'));var properties=require(_0xd276('0x5'));var ami=require(_0xd276('0x6'));exports['listen']=function(_0xc15d67,_0xb33636,_0x3d0bd4){return new BPromise(function(_0x24065a,_0x22084f){var _0x2e1dad={'QueuePause':function(_0x289240){return new Promise(function(_0x322ff1,_0x2650ab){var _0x4cf157=util[_0xd276('0x7')]('%s/%s',_0xd276('0x8'),_0x289240[_0xd276('0x9')]);if(_0xc15d67[_0xd276('0xa')]&&_0xc15d67[_0xd276('0xa')][_0x4cf157]&&_0xc15d67[_0xd276('0xa')][_0x4cf157][_0xd276('0xb')]){_0xc15d67['timers'][_0x4cf157]['updateAcw']();}if(_0xc15d67[_0xd276('0xc')][_0x4cf157]){_0xc15d67[_0xd276('0xc')][_0x4cf157][_0xd276('0xd')]({'statePause':_0x289240['pause']?!![]:![]});}_0x322ff1({'code':0xc8,'message':_0xd276('0xe')});});},'Reload':function(_0x6a28c6){var _0x14722b=this;return new Promise(function(_0x496f19,_0x4aa038){if(ami[_0xd276('0xf')]()==![]){return _0x4aa038(_0x14722b[_0xd276('0x10')](0x1f4,[config[_0xd276('0x11')]['ip'],config[_0xd276('0x11')][_0xd276('0x12')],_0xd276('0x13')][_0xd276('0x14')]('\x20')));}_0x6a28c6=_['pick'](_0x6a28c6,_[_0xd276('0x15')](properties[_0xd276('0x16')]));_0x6a28c6[_0xd276('0x17')]=_0xd276('0x18');return ami[_0xd276('0x19')](_0x6a28c6)['then'](function(_0x1eb683){_0x496f19({'code':0xc8,'message':_0x1eb683['message']});})['catch'](function(_0x21f4c7){_0x4aa038(_0x14722b['error'](0x1f5,_0x21f4c7[_0xd276('0x1a')]));});});},'Command':function(_0x569a11){var _0x118694=this;return new Promise(function(_0xc57b5f,_0x5954ef){if(ami['isConnected']()==![]){return _0x5954ef(_0x118694['error'](0x1f4,[config[_0xd276('0x11')]['ip'],config[_0xd276('0x11')][_0xd276('0x12')],_0xd276('0x13')]['join']('\x20')));}_0x569a11=_[_0xd276('0x1b')](_0x569a11,_0xd276('0x1c'));_0x569a11[_0xd276('0x17')]=_0xd276('0x1d');return ami[_0xd276('0x19')](_0x569a11)[_0xd276('0x1e')](function(_0x290b60){_0xc57b5f({'code':0xc8,'message':_0x290b60[_0xd276('0x1f')]});})[_0xd276('0x20')](function(_0x361d56){_0x5954ef(_0x118694[_0xd276('0x10')](0x1f5,_0x361d56[_0xd276('0x1a')]));});});},'VoiceQueues':function(_0x243f17){return new Promise(function(_0x37e048,_0x44f588){var _0x4357aa=[];for(var _0x15a538 in _0xc15d67[_0xd276('0x21')]){if(_0xc15d67[_0xd276('0x21')][_0xd276('0x22')](_0x15a538)){var _0x10701d=_0xc15d67['voiceQueues'][_0x15a538];var _0x1f6b66={'id':_0x10701d['id'],'name':_0x10701d[_0xd276('0x9')],'strategy':_0x10701d['strategy'],'answered':_0x10701d[_0xd276('0x23')],'available':_0x10701d['available'],'loggedIn':_0x10701d[_0xd276('0x24')],'pTalking':_0x10701d['pTalking'],'sumBillable':_0x10701d[_0xd276('0x25')],'sumDuration':_0x10701d['sumDuration'],'sumHoldTime':_0x10701d[_0xd276('0x26')]||0x0,'talking':_0x10701d[_0xd276('0x27')],'total':_0x10701d[_0xd276('0x28')],'type':_0x10701d[_0xd276('0x29')],'unmanaged':_0x10701d[_0xd276('0x2a')],'abandoned':_0x10701d[_0xd276('0x2b')],'waiting':_0x10701d['waiting'],'loggedInDb':_0x10701d[_0xd276('0x2c')]};if(_0x10701d[_0xd276('0x29')]===_0xd276('0x2d')){_0x1f6b66[_0xd276('0x2e')]=_0x10701d[_0xd276('0x2e')];_0x1f6b66[_0xd276('0x2f')]=_0x10701d[_0xd276('0x2f')];_0x1f6b66[_0xd276('0x30')]=_0x10701d['dialOriginateCallerIdName'];_0x1f6b66['dialOriginateCallerIdNumber']=_0x10701d[_0xd276('0x31')];_0x1f6b66[_0xd276('0x32')]=_0x10701d['dialOriginateTimeout'];_0x1f6b66[_0xd276('0x33')]=_0x10701d[_0xd276('0x33')];_0x1f6b66[_0xd276('0x34')]=_0x10701d['outboundAnswerAgiCallsDay'];_0x1f6b66[_0xd276('0x35')]=_0x10701d[_0xd276('0x35')];_0x1f6b66[_0xd276('0x36')]=_0x10701d[_0xd276('0x36')];_0x1f6b66[_0xd276('0x37')]=_0x10701d[_0xd276('0x37')];_0x1f6b66['outboundCongestionCallsDay']=_0x10701d[_0xd276('0x38')];_0x1f6b66[_0xd276('0x39')]=_0x10701d[_0xd276('0x39')];_0x1f6b66[_0xd276('0x3a')]=_0x10701d[_0xd276('0x3a')];_0x1f6b66[_0xd276('0x3b')]=_0x10701d['outboundDropCallsDayTimeout'];_0x1f6b66['outboundNoAnswerCallsDay']=_0x10701d[_0xd276('0x3c')];_0x1f6b66['outboundNoSuchCallsDay']=_0x10701d[_0xd276('0x3d')];_0x1f6b66[_0xd276('0x3e')]=_0x10701d[_0xd276('0x3e')];_0x1f6b66[_0xd276('0x3f')]=_0x10701d[_0xd276('0x3f')];_0x1f6b66[_0xd276('0x40')]=_0x10701d[_0xd276('0x40')];_0x1f6b66['outboundUnknownCallsDay']=_0x10701d[_0xd276('0x41')];_0x1f6b66['predictiveIntervalAnsweredCalls']=_0x10701d[_0xd276('0x42')];_0x1f6b66['predictiveIntervalAvgHoldtime']=_0x10701d[_0xd276('0x43')];_0x1f6b66[_0xd276('0x44')]=_0x10701d[_0xd276('0x44')];_0x1f6b66[_0xd276('0x45')]=_0x10701d['predictiveIntervalDroppedCallsCallersExit'];_0x1f6b66[_0xd276('0x46')]=_0x10701d[_0xd276('0x46')];_0x1f6b66['predictiveIntervalErlangCalls']=_0x10701d[_0xd276('0x47')];_0x1f6b66[_0xd276('0x48')]=_0x10701d['predictiveIntervalErlangCallsDroppedCalls'];_0x1f6b66[_0xd276('0x49')]=_0x10701d['predictiveIntervalHitRate'];_0x1f6b66[_0xd276('0x4a')]=_0x10701d[_0xd276('0x4a')];_0x1f6b66[_0xd276('0x4b')]=_0x10701d['predictiveIntervalMultiplicativeFactor'];_0x1f6b66[_0xd276('0x4c')]=_0x10701d[_0xd276('0x4c')];_0x1f6b66[_0xd276('0x4d')]=_0x10701d['predictiveIntervalTotalCalls'];_0x1f6b66[_0xd276('0x1a')]=_0x10701d[_0xd276('0x1a')];_0x1f6b66[_0xd276('0x4e')]=_0x10701d[_0xd276('0x4e')];}if(_0x10701d[_0xd276('0x4f')]){_0x1f6b66[_0xd276('0x4f')]={'id':_0x10701d[_0xd276('0x4f')]['id'],'name':_0x10701d['Trunk'][_0xd276('0x9')],'active':_0x10701d['Trunk'][_0xd276('0x50')],'callerid':_0x10701d[_0xd276('0x4f')][_0xd276('0x51')]};}if(_0x10701d[_0xd276('0x52')]){_0x1f6b66[_0xd276('0x52')]={'id':_0x10701d[_0xd276('0x52')]['id'],'name':_0x10701d[_0xd276('0x52')][_0xd276('0x9')]};}_0x4357aa[_0xd276('0x53')](_0x1f6b66);}}_0x37e048({'count':_0x4357aa['length'],'rows':_0x4357aa});});},'VoiceChannels':function(_0x16b2aa){return new Promise(function(_0x119896,_0x40bdf4){var _0x3f4123=_[_0xd276('0x54')](_0xc15d67['channels']);_0x119896({'count':_0x3f4123[_0xd276('0x55')],'rows':_0x3f4123});});},'VoiceChannelMixMonitor':function(_0x3b067a){var _0x56931a=this;return new Promise(function(_0x144577,_0x227425){if(ami[_0xd276('0xf')]()==![]){return _0x227425(_0x56931a[_0xd276('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xd276('0x11')][_0xd276('0x12')],_0xd276('0x13')][_0xd276('0x14')]('\x20')));}var _0x1fc389=schema(properties[_0xd276('0x56')])[_0xd276('0x57')](_0x3b067a);if(_0x1fc389[_0xd276('0x55')]>0x0){return _0x227425(_0x56931a[_0xd276('0x10')](0x1f4,_[_0xd276('0x58')](_0x1fc389,_0xd276('0x1a'))['join'](',\x20')));}var _0x280285=_['find'](_0xc15d67[_0xd276('0x59')],{'uniqueid':_0x3b067a['uniqueid']});if(_0x280285&&_0x280285['channel']){var _0x2103eb=util['format'](_0xd276('0x5a'),_0x3b067a[_0xd276('0x5b')]||_0x3b067a[_0xd276('0x5c')],_0x3b067a['format']||_0xd276('0x5d'));return ami[_0xd276('0x19')]({'action':_0xd276('0x5e'),'channel':_0x280285['channel'],'file':_0x2103eb,'options':_0xd276('0x5f')})[_0xd276('0x1e')](function(_0x8736b5){var _0x27dbee=_[_0xd276('0x60')](_0x280285[_0xd276('0x61')],{'filename':_0xd276('0x62')+_0x2103eb[_0xd276('0x63')]()});if(_[_0xd276('0x64')](_0x27dbee)){_0x280285[_0xd276('0x61')][_0xd276('0x53')]({'filename':_0xd276('0x62')+_0x2103eb[_0xd276('0x63')](),'createdAt':moment()[_0xd276('0x7')](_0xd276('0x65')),'mixmonitorid':_0x8736b5[_0xd276('0x66')],'status':'rec'});}else{_0x27dbee[_0xd276('0x66')]=_0x8736b5[_0xd276('0x66')];_0x27dbee[_0xd276('0x67')]=_0xd276('0x68');}_0x144577({'code':0xc8,'message':[_0x3b067a[_0xd276('0x5c')],_0xd276('0x69'),_0x8736b5[_0xd276('0x66')]]['join']('\x20'),'mixmonitorid':_0x8736b5[_0xd276('0x66')]});})[_0xd276('0x20')](function(_0x49b37b){_0x227425(_0x56931a[_0xd276('0x10')](0x1f5,[_0x3b067a[_0xd276('0x5c')],_0x49b37b[_0xd276('0x1a')][_0xd276('0x63')]()][_0xd276('0x14')]('\x20')));});}else{return _0x227425(_0x56931a[_0xd276('0x10')](0x1f5,_0xd276('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x2274f0){var _0x25cf13=this;return new Promise(function(_0x2680d5,_0x2a0d58){if(ami[_0xd276('0xf')]()==![]){return _0x2a0d58(_0x25cf13[_0xd276('0x10')](0x1f4,[config[_0xd276('0x11')]['ip'],config[_0xd276('0x11')][_0xd276('0x12')],_0xd276('0x13')][_0xd276('0x14')]('\x20')));}var _0x5d20a0=schema(properties[_0xd276('0x56')])[_0xd276('0x57')](_0x2274f0);if(_0x5d20a0[_0xd276('0x55')]>0x0){return _0x2a0d58(_0x25cf13['error'](0x1f4,_[_0xd276('0x58')](_0x5d20a0,_0xd276('0x1a'))[_0xd276('0x14')](',\x20')));}var _0x51f614=_['find'](_0xc15d67['channels'],{'uniqueid':_0x2274f0[_0xd276('0x5c')]});if(_0x51f614){return BPromise[_0xd276('0x6b')]()[_0xd276('0x1e')](function(){if(_0x51f614[_0xd276('0x6c')]){return ami[_0xd276('0x19')]({'action':_0xd276('0x6d'),'channel':_0x51f614[_0xd276('0x6c')],'mixmonitorid':_0x2274f0[_0xd276('0x66')]})['catch'](function(_0x4d970d){});}})[_0xd276('0x1e')](function(){if(_0x51f614[_0xd276('0x6e')]){return ami['Action']({'action':_0xd276('0x6d'),'channel':_0x51f614['destinationchannel'],'mixmonitorid':_0x2274f0[_0xd276('0x66')]})[_0xd276('0x20')](function(_0x52ac70){});}})[_0xd276('0x1e')](function(_0xdb0b02){var _0x549e4f=_[_0xd276('0x60')](_0x51f614[_0xd276('0x61')],{'mixmonitorid':_0x2274f0[_0xd276('0x66')]});if(_0x549e4f){_0x549e4f[_0xd276('0x67')]=_0xd276('0x6f');}})[_0xd276('0x1e')](function(){var _0x2bb344=util[_0xd276('0x7')](_0xd276('0x5a'),_0x2274f0[_0xd276('0x5b')]||_0x2274f0[_0xd276('0x5c')],_0x2274f0[_0xd276('0x7')]||_0xd276('0x5d'));var _0x3637f8=_[_0xd276('0x60')](_0x51f614[_0xd276('0x61')],{'filename':_0xd276('0x62')+_0x2bb344[_0xd276('0x63')]()});if(_0x3637f8){_0x3637f8['status']=_0xd276('0x6f');}})[_0xd276('0x1e')](function(){_0x2680d5({'code':0xc8,'message':[_0x2274f0['uniqueid'],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xd276('0x20')](function(_0x59926){_0x2a0d58(_0x25cf13[_0xd276('0x10')](0x1f5,[_0x2274f0[_0xd276('0x5c')],_0x59926[_0xd276('0x1a')]['toLowerCase']()][_0xd276('0x14')]('\x20')));});}else{return _0x2a0d58(_0x25cf13[_0xd276('0x10')](0x1f5,_0xd276('0x6a')));}});},'VoiceQueuesChannels':function(_0x57c1c0){return new Promise(function(_0x26b81f,_0x46854c){var _0x44f444=_['values'](_0xc15d67[_0xd276('0x70')]);_0x26b81f({'count':_0x44f444[_0xd276('0x55')],'rows':_0x44f444});});},'VoiceQueuesChannel':function(_0x15f397){var _0x5c59f2=this;return new Promise(function(_0x4a30c3,_0x59c675){var _0x129e94=schema(properties[_0xd276('0x71')])[_0xd276('0x57')](_0x15f397);if(_0x129e94[_0xd276('0x55')]>0x0){return _0x59c675(_0x5c59f2[_0xd276('0x10')](0x1f4,_[_0xd276('0x58')](_0x129e94,_0xd276('0x1a'))[_0xd276('0x14')](',\x20')));}var _0x35e78b=_['find'](_0xc15d67[_0xd276('0x70')],{'uniqueid':_0x15f397[_0xd276('0x5c')]});if(_0x35e78b){_0x4a30c3(_0x35e78b);}else{return _0x59c675(_0x5c59f2[_0xd276('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x1e813a){var _0xb9dc46=this;return new Promise(function(_0x5f3185,_0xdb9296){if(ami['isConnected']()==![]){return _0xdb9296(_0xb9dc46[_0xd276('0x10')](0x1f4,[config[_0xd276('0x11')]['ip'],config[_0xd276('0x11')][_0xd276('0x12')],'ami\x20disconnected'][_0xd276('0x14')]('\x20')));}var _0x2ca847=schema(properties[_0xd276('0x72')])[_0xd276('0x57')](_0x1e813a);if(_0x2ca847[_0xd276('0x55')]>0x0){return _0xdb9296(_0xb9dc46['error'](0x1f4,_[_0xd276('0x58')](_0x2ca847,_0xd276('0x1a'))['join'](',\x20')));}var _0x21edbe=_[_0xd276('0x60')](_0xc15d67[_0xd276('0x70')],{'uniqueid':_0x1e813a[_0xd276('0x5c')]});if(_0x21edbe&&_0x21edbe[_0xd276('0x6c')]){return ami[_0xd276('0x19')]({'action':'Hangup','channel':_0x21edbe['channel']})[_0xd276('0x1e')](function(_0x1a2504){_0x5f3185({'code':0xc8,'message':[_0x1e813a[_0xd276('0x5c')],_0x1a2504[_0xd276('0x1a')]['toLowerCase']()][_0xd276('0x14')]('\x20')});})[_0xd276('0x20')](function(_0x216a2f){_0xdb9296(_0xb9dc46[_0xd276('0x10')](0x1f5,[_0x1e813a[_0xd276('0x5c')],_0x216a2f[_0xd276('0x1a')][_0xd276('0x63')]()][_0xd276('0x14')]('\x20')));});}else{return _0xdb9296(_0xb9dc46[_0xd276('0x10')](0x1f5,_0xd276('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x3a53ec){var _0x5550ca=this;return new Promise(function(_0x450adc,_0x3b7f1b){if(ami[_0xd276('0xf')]()==![]){return _0x3b7f1b(_0x5550ca[_0xd276('0x10')](0x1f4,[config[_0xd276('0x11')]['ip'],config[_0xd276('0x11')][_0xd276('0x12')],_0xd276('0x13')][_0xd276('0x14')]('\x20')));}var _0x41bd86=schema(properties['voicequeuechannelredirect'])[_0xd276('0x57')](_0x3a53ec);if(_0x41bd86['length']>0x0){return _0x3b7f1b(_0x5550ca['error'](0x1f4,_[_0xd276('0x58')](_0x41bd86,_0xd276('0x1a'))['join'](',\x20')));}var _0x2f2358=_['find'](_0xc15d67['queueChannels'],{'uniqueid':_0x3a53ec[_0xd276('0x5c')]});if(_0x2f2358&&_0x2f2358[_0xd276('0x6c')]){return ami[_0xd276('0x19')]({'action':_0xd276('0x73'),'channel':_0x2f2358[_0xd276('0x6c')],'exten':_0x3a53ec['exten'],'context':_0x3a53ec[_0xd276('0x74')]||_0x2f2358[_0xd276('0x74')],'priority':0x1})['then'](function(_0x2dc945){_0x450adc({'code':0xc8,'message':[_0x3a53ec[_0xd276('0x5c')],_0x2dc945[_0xd276('0x1a')][_0xd276('0x63')]()][_0xd276('0x14')]('\x20')});})[_0xd276('0x20')](function(_0x23c3c3){_0x3b7f1b(_0x5550ca['error'](0x1f5,[_0x3a53ec[_0xd276('0x5c')],_0x23c3c3[_0xd276('0x1a')]['toLowerCase']()]['join']('\x20')));});}else{return _0x3b7f1b(_0x5550ca['error'](0x1f5,_0xd276('0x6a')));}});},'Agents':function(_0x189bf6){return new Promise(function(_0x518514,_0x3815ad){var _0x2cebd5=_[_0xd276('0x54')](_0xc15d67[_0xd276('0xc')]);_0x518514({'count':_0x2cebd5[_0xd276('0x55')],'rows':_0x2cebd5});});},'Telephones':function(_0x2abe2f){return new Promise(function(_0x4c0eef,_0x310a8b){var _0x41bc1f=_['values'](_0xc15d67[_0xd276('0x75')]);_0x4c0eef({'count':_0x41bc1f[_0xd276('0x55')],'rows':_0x41bc1f});});},'Trunks':function(_0x587001){return new Promise(function(_0xf4a1af,_0x43cdc){var _0x11f4ad=_[_0xd276('0x54')](_0xc15d67['trunks']);_0xf4a1af({'count':_0x11f4ad[_0xd276('0x55')],'rows':_0x11f4ad});});},'OutboundChannels':function(_0x2ca50e){return new Promise(function(_0x2ffed7,_0x2b6c87){var _0x2b66a4=_[_0xd276('0x54')](_0xc15d67[_0xd276('0x76')]);_0x2ffed7({'count':_0x2b66a4[_0xd276('0x55')],'rows':_0x2b66a4});});},'Outbound':function(_0x405411){return new Promise(function(_0x1fa19b,_0x5d657d){_0x1fa19b(_0xc15d67['outbound']);});},'Campaigns':function(_0x266b9d){return new Promise(function(_0x58356d,_0x543998){var _0x259aac=_[_0xd276('0x54')](_0xc15d67[_0xd276('0x77')]);_0x58356d({'count':_0x259aac[_0xd276('0x55')],'rows':_0x259aac});});},'VoiceQueuesPreview':function(_0x2efb40){var _0x366a4d=this;return new Promise(function(_0x1bd775,_0x9e913c){_0xb33636['run'](_0x2efb40['id'])[_0xd276('0x1e')](function(_0x5c016e){_0x1bd775({'code':0xc8,'message':_0x5c016e[_0xd276('0x1a')]});})[_0xd276('0x20')](function(_0x282121){_0x9e913c(_0x366a4d['error'](0x1f4,_0x282121[_0xd276('0x1a')]));});});},'EventManager':function(_0x3f2abb){var _0x4c0734=this;return new Promise(function(_0x1e046b,_0x1aed64){if(!_0x3f2abb['event']){return _0x1aed64(_0x4c0734[_0xd276('0x10')](0x1f4,_0xd276('0x78')));}ami[_0xd276('0x79')](_0xd276('0x7a')+_0x3f2abb[_0xd276('0x7b')],_0x3f2abb['message']);_0x1e046b({'code':0xc8,'message':_0x3f2abb});});},'FaxAccounts':function(_0x10ef43){return new Promise(function(_0x2832de,_0x4ea33a){var _0x4cb967=_[_0xd276('0x54')](_0xc15d67[_0xd276('0x7c')]);_0x2832de({'count':_0x4cb967[_0xd276('0x55')],'rows':_0x4cb967});});},'SendFax':function(_0xb38e02){var _0x30ddf7=this;return new Promise(function(_0x50ae3b,_0x33c8f4){_0x3d0bd4['send'](_0xb38e02)[_0xd276('0x1e')](function(_0x1d1dcf){_0x50ae3b({'code':0xc8,'message':_0x1d1dcf[_0xd276('0x1a')]});})['catch'](function(_0x3b6a24){_0x33c8f4(_0x30ddf7['error'](0x1f4,_0x3b6a24[_0xd276('0x1a')]));});});},'CheckAfterSend':function(_0x21cae1){var _0x461bd8=this;return new Promise(function(_0x5a7487,_0x51e881){_0x3d0bd4[_0xd276('0x7d')](_0x21cae1)[_0xd276('0x1e')](function(_0x4dac16){_0x5a7487({'code':0xc8,'message':_0x4dac16[_0xd276('0x1a')]});})[_0xd276('0x20')](function(_0x53f92e){_0x51e881(_0x461bd8[_0xd276('0x10')](0x1f4,_0x53f92e[_0xd276('0x1a')]));});});}};var _0x25dabd=jayson['server'](_0x2e1dad)[_0xd276('0x7e')]();_0x25dabd['on'](_0xd276('0x10'),function(_0x5de0f4){return _0x22084f(_0x5de0f4);});_0x25dabd['listen'](0x232a,'127.0.0.1',function(){console[_0xd276('0x7f')](_0xd276('0x80'),0x232a);return _0x24065a(_0xd276('0x81')+0x232a);});});};
\ No newline at end of file
+var _0x0031=['YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','emit','custom:','event','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','format','name','timers','updateAcw','agents','QueuePause','isConnected','error','asterisk','join','pick','keys','module','action','Reload','then','message','catch','username','ami\x20disconnected','command','Command','Action','content','voiceQueues','hasOwnProperty','loggedIn','talking','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalLowerLimit','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','Trunk','active','callerid','Interval','length','values','map','channels','uniqueid','%s.%s','filename','wav','channel','ai(mixmonitorid)','find','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push'];(function(_0x411437,_0x5c1446){var _0x32ea2a=function(_0x26c8bd){while(--_0x26c8bd){_0x411437['push'](_0x411437['shift']());}};_0x32ea2a(++_0x5c1446);}(_0x0031,0x11c));var _0x1003=function(_0x22c77d,_0x410a83){_0x22c77d=_0x22c77d-0x0;var _0x372a02=_0x0031[_0x22c77d];return _0x372a02;};'use strict';var _=require(_0x1003('0x0'));var util=require('util');var jayson=require(_0x1003('0x1'));var schema=require(_0x1003('0x2'));var BPromise=require(_0x1003('0x3'));var moment=require('moment');var config=require(_0x1003('0x4'));var properties=require(_0x1003('0x5'));var ami=require(_0x1003('0x6'));exports[_0x1003('0x7')]=function(_0x1590c9,_0x39d182,_0x206b81){return new BPromise(function(_0x24e2d0,_0x20fcc3){var _0x27de7d={'QueuePause':function(_0x14d951){return new Promise(function(_0x31e782,_0x5c1c60){var _0xbad675=util[_0x1003('0x8')]('%s/%s','SIP',_0x14d951[_0x1003('0x9')]);if(_0x1590c9[_0x1003('0xa')]&&_0x1590c9[_0x1003('0xa')][_0xbad675]&&_0x1590c9[_0x1003('0xa')][_0xbad675]['timer']){_0x1590c9[_0x1003('0xa')][_0xbad675][_0x1003('0xb')]();}if(_0x1590c9[_0x1003('0xc')][_0xbad675]){_0x1590c9[_0x1003('0xc')][_0xbad675]['updateStatusRealtime']({'statePause':_0x14d951['pause']?!![]:![]});}_0x31e782({'code':0xc8,'message':_0x1003('0xd')});});},'Reload':function(_0x26b957){var _0xdf1e2f=this;return new Promise(function(_0x2a5f6b,_0x41c8a6){if(ami[_0x1003('0xe')]()==![]){return _0x41c8a6(_0xdf1e2f[_0x1003('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x1003('0x10')]['username'],'ami\x20disconnected'][_0x1003('0x11')]('\x20')));}_0x26b957=_[_0x1003('0x12')](_0x26b957,_[_0x1003('0x13')](properties[_0x1003('0x14')]));_0x26b957[_0x1003('0x15')]=_0x1003('0x16');return ami['Action'](_0x26b957)[_0x1003('0x17')](function(_0x4bd1a0){_0x2a5f6b({'code':0xc8,'message':_0x4bd1a0[_0x1003('0x18')]});})[_0x1003('0x19')](function(_0x211284){_0x41c8a6(_0xdf1e2f[_0x1003('0xf')](0x1f5,_0x211284['message']));});});},'Command':function(_0x2f522b){var _0x549976=this;return new Promise(function(_0x33329e,_0x2b202a){if(ami[_0x1003('0xe')]()==![]){return _0x2b202a(_0x549976['error'](0x1f4,[config[_0x1003('0x10')]['ip'],config[_0x1003('0x10')][_0x1003('0x1a')],_0x1003('0x1b')][_0x1003('0x11')]('\x20')));}_0x2f522b=_['pick'](_0x2f522b,_0x1003('0x1c'));_0x2f522b['action']=_0x1003('0x1d');return ami[_0x1003('0x1e')](_0x2f522b)[_0x1003('0x17')](function(_0x135dfe){_0x33329e({'code':0xc8,'message':_0x135dfe[_0x1003('0x1f')]});})['catch'](function(_0x163a81){_0x2b202a(_0x549976[_0x1003('0xf')](0x1f5,_0x163a81[_0x1003('0x18')]));});});},'VoiceQueues':function(_0x4890eb){return new Promise(function(_0x4df35a,_0x120e47){var _0x43194=[];for(var _0x5722a5 in _0x1590c9[_0x1003('0x20')]){if(_0x1590c9[_0x1003('0x20')][_0x1003('0x21')](_0x5722a5)){var _0x421615=_0x1590c9[_0x1003('0x20')][_0x5722a5];var _0x20a804={'id':_0x421615['id'],'name':_0x421615[_0x1003('0x9')],'strategy':_0x421615['strategy'],'answered':_0x421615['answered'],'available':_0x421615['available'],'loggedIn':_0x421615[_0x1003('0x22')],'pTalking':_0x421615['pTalking'],'sumBillable':_0x421615['sumBillable'],'sumDuration':_0x421615['sumDuration'],'sumHoldTime':_0x421615['sumHoldTime']||0x0,'talking':_0x421615[_0x1003('0x23')],'total':_0x421615['total'],'type':_0x421615[_0x1003('0x24')],'unmanaged':_0x421615['unmanaged'],'abandoned':_0x421615[_0x1003('0x25')],'waiting':_0x421615[_0x1003('0x26')],'loggedInDb':_0x421615[_0x1003('0x27')]};if(_0x421615[_0x1003('0x24')]===_0x1003('0x28')){_0x20a804[_0x1003('0x29')]=_0x421615[_0x1003('0x29')];_0x20a804[_0x1003('0x2a')]=_0x421615[_0x1003('0x2a')];_0x20a804[_0x1003('0x2b')]=_0x421615[_0x1003('0x2b')];_0x20a804[_0x1003('0x2c')]=_0x421615['dialOriginateCallerIdNumber'];_0x20a804[_0x1003('0x2d')]=_0x421615[_0x1003('0x2d')];_0x20a804[_0x1003('0x2e')]=_0x421615[_0x1003('0x2e')];_0x20a804[_0x1003('0x2f')]=_0x421615[_0x1003('0x2f')];_0x20a804['outboundAnswerCallsDay']=_0x421615[_0x1003('0x30')];_0x20a804[_0x1003('0x31')]=_0x421615[_0x1003('0x31')];_0x20a804[_0x1003('0x32')]=_0x421615[_0x1003('0x32')];_0x20a804['outboundCongestionCallsDay']=_0x421615[_0x1003('0x33')];_0x20a804[_0x1003('0x34')]=_0x421615[_0x1003('0x34')];_0x20a804['outboundDropCallsDayCallersExit']=_0x421615[_0x1003('0x35')];_0x20a804[_0x1003('0x36')]=_0x421615[_0x1003('0x36')];_0x20a804[_0x1003('0x37')]=_0x421615['outboundNoAnswerCallsDay'];_0x20a804['outboundNoSuchCallsDay']=_0x421615[_0x1003('0x38')];_0x20a804[_0x1003('0x39')]=_0x421615[_0x1003('0x39')];_0x20a804[_0x1003('0x3a')]=_0x421615['outboundReCallsDay'];_0x20a804[_0x1003('0x3b')]=_0x421615[_0x1003('0x3b')];_0x20a804[_0x1003('0x3c')]=_0x421615['outboundUnknownCallsDay'];_0x20a804[_0x1003('0x3d')]=_0x421615[_0x1003('0x3d')];_0x20a804[_0x1003('0x3e')]=_0x421615['predictiveIntervalAvgHoldtime'];_0x20a804[_0x1003('0x3f')]=_0x421615[_0x1003('0x3f')];_0x20a804[_0x1003('0x40')]=_0x421615['predictiveIntervalDroppedCallsCallersExit'];_0x20a804[_0x1003('0x41')]=_0x421615[_0x1003('0x41')];_0x20a804['predictiveIntervalErlangCalls']=_0x421615[_0x1003('0x42')];_0x20a804['predictiveIntervalErlangCallsDroppedCalls']=_0x421615[_0x1003('0x43')];_0x20a804[_0x1003('0x44')]=_0x421615['predictiveIntervalHitRate'];_0x20a804[_0x1003('0x45')]=_0x421615['predictiveIntervalLowerLimit'];_0x20a804['predictiveIntervalMultiplicativeFactor']=_0x421615[_0x1003('0x46')];_0x20a804[_0x1003('0x47')]=_0x421615[_0x1003('0x47')];_0x20a804[_0x1003('0x48')]=_0x421615[_0x1003('0x48')];_0x20a804['message']=_0x421615[_0x1003('0x18')];_0x20a804[_0x1003('0x49')]=_0x421615[_0x1003('0x49')];}if(_0x421615[_0x1003('0x4a')]){_0x20a804[_0x1003('0x4a')]={'id':_0x421615[_0x1003('0x4a')]['id'],'name':_0x421615[_0x1003('0x4a')]['name'],'active':_0x421615[_0x1003('0x4a')][_0x1003('0x4b')],'callerid':_0x421615[_0x1003('0x4a')][_0x1003('0x4c')]};}if(_0x421615[_0x1003('0x4d')]){_0x20a804[_0x1003('0x4d')]={'id':_0x421615[_0x1003('0x4d')]['id'],'name':_0x421615['Interval'][_0x1003('0x9')]};}_0x43194['push'](_0x20a804);}}_0x4df35a({'count':_0x43194[_0x1003('0x4e')],'rows':_0x43194});});},'VoiceChannels':function(_0x17a852){return new Promise(function(_0x484dfc,_0x2a3985){var _0x9df4ee=_[_0x1003('0x4f')](_0x1590c9['channels']);_0x484dfc({'count':_0x9df4ee[_0x1003('0x4e')],'rows':_0x9df4ee});});},'VoiceChannelMixMonitor':function(_0x257139){var _0x46795c=this;return new Promise(function(_0x117f0f,_0x1a20b7){if(ami[_0x1003('0xe')]()==![]){return _0x1a20b7(_0x46795c[_0x1003('0xf')](0x1f4,[config[_0x1003('0x10')]['ip'],config[_0x1003('0x10')][_0x1003('0x1a')],_0x1003('0x1b')][_0x1003('0x11')]('\x20')));}var _0x54705d=schema(properties['voicechannel'])['validate'](_0x257139);if(_0x54705d[_0x1003('0x4e')]>0x0){return _0x1a20b7(_0x46795c[_0x1003('0xf')](0x1f4,_[_0x1003('0x50')](_0x54705d,'message')[_0x1003('0x11')](',\x20')));}var _0x26b129=_['find'](_0x1590c9[_0x1003('0x51')],{'uniqueid':_0x257139[_0x1003('0x52')]});if(_0x26b129&&_0x26b129['channel']){var _0x341a6a=util[_0x1003('0x8')](_0x1003('0x53'),_0x257139[_0x1003('0x54')]||_0x257139[_0x1003('0x52')],_0x257139[_0x1003('0x8')]||_0x1003('0x55'));return ami['Action']({'action':'MixMonitor','channel':_0x26b129[_0x1003('0x56')],'file':_0x341a6a,'options':_0x1003('0x57')})['then'](function(_0x4472f5){var _0x25b9b0=_[_0x1003('0x58')](_0x26b129[_0x1003('0x59')],{'filename':_0x1003('0x5a')+_0x341a6a[_0x1003('0x5b')]()});if(_[_0x1003('0x5c')](_0x25b9b0)){_0x26b129['monitors'][_0x1003('0x5d')]({'filename':_0x1003('0x5a')+_0x341a6a[_0x1003('0x5b')](),'createdAt':moment()[_0x1003('0x8')](_0x1003('0x5e')),'mixmonitorid':_0x4472f5[_0x1003('0x5f')],'status':_0x1003('0x60')});}else{_0x25b9b0[_0x1003('0x5f')]=_0x4472f5['mixmonitorid'];_0x25b9b0[_0x1003('0x61')]=_0x1003('0x60');}_0x117f0f({'code':0xc8,'message':[_0x257139[_0x1003('0x52')],_0x1003('0x62'),_0x4472f5[_0x1003('0x5f')]][_0x1003('0x11')]('\x20'),'mixmonitorid':_0x4472f5[_0x1003('0x5f')]});})[_0x1003('0x19')](function(_0x4bdd95){_0x1a20b7(_0x46795c[_0x1003('0xf')](0x1f5,[_0x257139[_0x1003('0x52')],_0x4bdd95[_0x1003('0x18')][_0x1003('0x5b')]()][_0x1003('0x11')]('\x20')));});}else{return _0x1a20b7(_0x46795c[_0x1003('0xf')](0x1f5,_0x1003('0x63')));}});},'VoiceChannelStopMixMonitor':function(_0xa42be1){var _0x3f0921=this;return new Promise(function(_0x2cef49,_0x40e10c){if(ami[_0x1003('0xe')]()==![]){return _0x40e10c(_0x3f0921[_0x1003('0xf')](0x1f4,[config[_0x1003('0x10')]['ip'],config[_0x1003('0x10')][_0x1003('0x1a')],'ami\x20disconnected'][_0x1003('0x11')]('\x20')));}var _0x4c228f=schema(properties[_0x1003('0x64')])['validate'](_0xa42be1);if(_0x4c228f[_0x1003('0x4e')]>0x0){return _0x40e10c(_0x3f0921[_0x1003('0xf')](0x1f4,_['map'](_0x4c228f,_0x1003('0x18'))[_0x1003('0x11')](',\x20')));}var _0xed669=_[_0x1003('0x58')](_0x1590c9[_0x1003('0x51')],{'uniqueid':_0xa42be1[_0x1003('0x52')]});if(_0xed669){return BPromise[_0x1003('0x65')]()[_0x1003('0x17')](function(){if(_0xed669['channel']){return ami[_0x1003('0x1e')]({'action':_0x1003('0x66'),'channel':_0xed669[_0x1003('0x56')],'mixmonitorid':_0xa42be1[_0x1003('0x5f')]})[_0x1003('0x19')](function(_0x4bea73){});}})[_0x1003('0x17')](function(){if(_0xed669['destinationchannel']){return ami[_0x1003('0x1e')]({'action':'StopMixMonitor','channel':_0xed669['destinationchannel'],'mixmonitorid':_0xa42be1[_0x1003('0x5f')]})[_0x1003('0x19')](function(_0x45207c){});}})[_0x1003('0x17')](function(_0x2be166){var _0x5bb86d=_[_0x1003('0x58')](_0xed669[_0x1003('0x59')],{'mixmonitorid':_0xa42be1[_0x1003('0x5f')]});if(_0x5bb86d){_0x5bb86d[_0x1003('0x61')]=_0x1003('0x67');}})[_0x1003('0x17')](function(){var _0x37561b=util[_0x1003('0x8')](_0x1003('0x53'),_0xa42be1[_0x1003('0x54')]||_0xa42be1[_0x1003('0x52')],_0xa42be1[_0x1003('0x8')]||'wav');var _0x182ecf=_['find'](_0xed669[_0x1003('0x59')],{'filename':_0x1003('0x5a')+_0x37561b['toLowerCase']()});if(_0x182ecf){_0x182ecf['status']=_0x1003('0x67');}})[_0x1003('0x17')](function(){_0x2cef49({'code':0xc8,'message':[_0xa42be1[_0x1003('0x52')],_0x1003('0x68')][_0x1003('0x11')]('\x20')});})['catch'](function(_0x5721d8){_0x40e10c(_0x3f0921[_0x1003('0xf')](0x1f5,[_0xa42be1[_0x1003('0x52')],_0x5721d8[_0x1003('0x18')][_0x1003('0x5b')]()][_0x1003('0x11')]('\x20')));});}else{return _0x40e10c(_0x3f0921['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x53f822){return new Promise(function(_0x5c1bb6,_0x1313d9){var _0x3e880e=_[_0x1003('0x4f')](_0x1590c9[_0x1003('0x69')]);_0x5c1bb6({'count':_0x3e880e[_0x1003('0x4e')],'rows':_0x3e880e});});},'VoiceQueuesChannel':function(_0x4ea352){var _0x59b123=this;return new Promise(function(_0x2ce516,_0x28aa7d){var _0x3fa2db=schema(properties[_0x1003('0x6a')])[_0x1003('0x2')](_0x4ea352);if(_0x3fa2db[_0x1003('0x4e')]>0x0){return _0x28aa7d(_0x59b123[_0x1003('0xf')](0x1f4,_[_0x1003('0x50')](_0x3fa2db,_0x1003('0x18'))[_0x1003('0x11')](',\x20')));}var _0x43bf22=_[_0x1003('0x58')](_0x1590c9[_0x1003('0x69')],{'uniqueid':_0x4ea352[_0x1003('0x52')]});if(_0x43bf22){_0x2ce516(_0x43bf22);}else{return _0x28aa7d(_0x59b123[_0x1003('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x1c1007){var _0x5d457c=this;return new Promise(function(_0x128323,_0x5e6f0){if(ami['isConnected']()==![]){return _0x5e6f0(_0x5d457c[_0x1003('0xf')](0x1f4,[config[_0x1003('0x10')]['ip'],config[_0x1003('0x10')]['username'],_0x1003('0x1b')]['join']('\x20')));}var _0x1b19dd=schema(properties[_0x1003('0x6b')])[_0x1003('0x2')](_0x1c1007);if(_0x1b19dd[_0x1003('0x4e')]>0x0){return _0x5e6f0(_0x5d457c['error'](0x1f4,_[_0x1003('0x50')](_0x1b19dd,'message')[_0x1003('0x11')](',\x20')));}var _0x4b1453=_[_0x1003('0x58')](_0x1590c9[_0x1003('0x69')],{'uniqueid':_0x1c1007[_0x1003('0x52')]});if(_0x4b1453&&_0x4b1453[_0x1003('0x56')]){return ami['Action']({'action':'Hangup','channel':_0x4b1453[_0x1003('0x56')]})[_0x1003('0x17')](function(_0x21243f){_0x128323({'code':0xc8,'message':[_0x1c1007[_0x1003('0x52')],_0x21243f['message'][_0x1003('0x5b')]()]['join']('\x20')});})[_0x1003('0x19')](function(_0x397cf4){_0x5e6f0(_0x5d457c['error'](0x1f5,[_0x1c1007[_0x1003('0x52')],_0x397cf4[_0x1003('0x18')]['toLowerCase']()][_0x1003('0x11')]('\x20')));});}else{return _0x5e6f0(_0x5d457c[_0x1003('0xf')](0x1f5,_0x1003('0x63')));}});},'VoiceQueuesChannelRedirect':function(_0x2fed1c){var _0x490bf0=this;return new Promise(function(_0x3458ee,_0x52bc96){if(ami['isConnected']()==![]){return _0x52bc96(_0x490bf0['error'](0x1f4,[config[_0x1003('0x10')]['ip'],config[_0x1003('0x10')][_0x1003('0x1a')],_0x1003('0x1b')][_0x1003('0x11')]('\x20')));}var _0x513564=schema(properties[_0x1003('0x6c')])['validate'](_0x2fed1c);if(_0x513564[_0x1003('0x4e')]>0x0){return _0x52bc96(_0x490bf0['error'](0x1f4,_[_0x1003('0x50')](_0x513564,_0x1003('0x18'))[_0x1003('0x11')](',\x20')));}var _0xc32698=_['find'](_0x1590c9['queueChannels'],{'uniqueid':_0x2fed1c[_0x1003('0x52')]});if(_0xc32698&&_0xc32698[_0x1003('0x56')]){return ami[_0x1003('0x1e')]({'action':_0x1003('0x6d'),'channel':_0xc32698[_0x1003('0x56')],'exten':_0x2fed1c[_0x1003('0x6e')],'context':_0x2fed1c[_0x1003('0x6f')]||_0xc32698[_0x1003('0x6f')],'priority':0x1})[_0x1003('0x17')](function(_0x1c31af){_0x3458ee({'code':0xc8,'message':[_0x2fed1c[_0x1003('0x52')],_0x1c31af[_0x1003('0x18')][_0x1003('0x5b')]()][_0x1003('0x11')]('\x20')});})['catch'](function(_0x32b75f){_0x52bc96(_0x490bf0[_0x1003('0xf')](0x1f5,[_0x2fed1c[_0x1003('0x52')],_0x32b75f[_0x1003('0x18')][_0x1003('0x5b')]()][_0x1003('0x11')]('\x20')));});}else{return _0x52bc96(_0x490bf0['error'](0x1f5,_0x1003('0x63')));}});},'Agents':function(_0x5e8e63){return new Promise(function(_0x106e1d,_0x361933){var _0x3ea9fe=_[_0x1003('0x4f')](_0x1590c9[_0x1003('0xc')]);_0x106e1d({'count':_0x3ea9fe[_0x1003('0x4e')],'rows':_0x3ea9fe});});},'Telephones':function(_0x54f9e9){return new Promise(function(_0x238246,_0x4091f9){var _0x37ccfd=_[_0x1003('0x4f')](_0x1590c9[_0x1003('0x70')]);_0x238246({'count':_0x37ccfd[_0x1003('0x4e')],'rows':_0x37ccfd});});},'Trunks':function(_0x7fef60){return new Promise(function(_0x31a0e3,_0x224133){var _0x3ad837=_[_0x1003('0x4f')](_0x1590c9['trunks']);_0x31a0e3({'count':_0x3ad837[_0x1003('0x4e')],'rows':_0x3ad837});});},'OutboundChannels':function(_0x4f67c0){return new Promise(function(_0xc6f946,_0x1f89ca){var _0x102fcc=_[_0x1003('0x4f')](_0x1590c9[_0x1003('0x71')]);_0xc6f946({'count':_0x102fcc[_0x1003('0x4e')],'rows':_0x102fcc});});},'Outbound':function(_0x20caa7){return new Promise(function(_0x5cb381,_0x1b3f89){_0x5cb381(_0x1590c9[_0x1003('0x28')]);});},'Campaigns':function(_0x23c711){return new Promise(function(_0x58263d,_0x4bb3c6){var _0x4bf698=_[_0x1003('0x4f')](_0x1590c9[_0x1003('0x72')]);_0x58263d({'count':_0x4bf698['length'],'rows':_0x4bf698});});},'VoiceQueuesPreview':function(_0x3d01f3){var _0x34b223=this;return new Promise(function(_0x583a98,_0x1685c1){_0x39d182[_0x1003('0x73')](_0x3d01f3['id'])[_0x1003('0x17')](function(_0x1dc716){_0x583a98({'code':0xc8,'message':_0x1dc716[_0x1003('0x18')]});})[_0x1003('0x19')](function(_0x4cfd27){_0x1685c1(_0x34b223[_0x1003('0xf')](0x1f4,_0x4cfd27[_0x1003('0x18')]));});});},'EventManager':function(_0x269083){var _0x24872c=this;return new Promise(function(_0x254eda,_0x5c8015){if(!_0x269083['event']){return _0x5c8015(_0x24872c[_0x1003('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x1003('0x74')](_0x1003('0x75')+_0x269083[_0x1003('0x76')],_0x269083[_0x1003('0x18')]);_0x254eda({'code':0xc8,'message':_0x269083});});},'FaxAccounts':function(_0x52604a){return new Promise(function(_0x444c1b,_0x4ef49a){var _0x2eeb90=_['values'](_0x1590c9['faxAccounts']);_0x444c1b({'count':_0x2eeb90[_0x1003('0x4e')],'rows':_0x2eeb90});});},'SendFax':function(_0x31048a){var _0xdd7d7a=this;return new Promise(function(_0x3448ab,_0x2c0429){_0x206b81[_0x1003('0x77')](_0x31048a)[_0x1003('0x17')](function(_0x10e9b5){_0x3448ab({'code':0xc8,'message':_0x10e9b5[_0x1003('0x18')]});})[_0x1003('0x19')](function(_0x441810){_0x2c0429(_0xdd7d7a['error'](0x1f4,_0x441810[_0x1003('0x18')]));});});},'CheckAfterSend':function(_0x273c27){var _0x314294=this;return new Promise(function(_0x2a3e4f,_0x3bf486){_0x206b81[_0x1003('0x78')](_0x273c27)[_0x1003('0x17')](function(_0x4aa878){_0x2a3e4f({'code':0xc8,'message':_0x4aa878['message']});})[_0x1003('0x19')](function(_0x5c85a6){_0x3bf486(_0x314294[_0x1003('0xf')](0x1f4,_0x5c85a6[_0x1003('0x18')]));});});}};var _0x452334=jayson[_0x1003('0x79')](_0x27de7d)[_0x1003('0x7a')]();_0x452334['on'](_0x1003('0xf'),function(_0x499450){return _0x20fcc3(_0x499450);});_0x452334[_0x1003('0x7')](0x232a,_0x1003('0x7b'),function(){console['log'](_0x1003('0x7c'),0x232a);return _0x24e2d0(_0x1003('0x7d')+0x232a);});});};
\ No newline at end of file
index 7092658..fed9ed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde21=['isNil','firstName','calleridname','<unknown>','calleridnum','uniqueid','destcalleridname','destcalleridnum','phone','resolve','omit','then','xmd-contactid2','format','user:%s','name','trigger:%s','action','merge','createContact','toLowerCase','data1','error','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','autoCreate','data2'];(function(_0x3b2c91,_0x353ef4){var _0x615c40=function(_0x2b15b5){while(--_0x2b15b5){_0x3b2c91['push'](_0x3b2c91['shift']());}};_0x615c40(++_0x353ef4);}(_0xde21,0x86));var _0x1de2=function(_0xa15d7f,_0x4e5f3b){_0xa15d7f=_0xa15d7f-0x0;var _0x230fde=_0xde21[_0xa15d7f];return _0x230fde;};'use strict';var BPromise=require(_0x1de2('0x0'));var util=require(_0x1de2('0x1'));var _=require('lodash');var Redis=require(_0x1de2('0x2'));var config=require(_0x1de2('0x3'));var logger=require(_0x1de2('0x4'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x1de2('0x5')]=_[_0x1de2('0x6')](config[_0x1de2('0x5')],{'host':_0x1de2('0x7'),'port':0x18eb});var io=require(_0x1de2('0x8'))(new Redis(config[_0x1de2('0x5')]));function emit(_0x13c7ea,_0x347af1,_0x5162a8){logger['info'](_0x13c7ea,_0x347af1,JSON[_0x1de2('0x9')](_0x5162a8));io['to'](_0x13c7ea)[_0x1de2('0xa')](_0x347af1,_0x5162a8);}exports[_0x1de2('0xb')]=function(_0x456bac,_0x46651f,_0x808ddc){_0x808ddc[_0x1de2('0xc')]=0x0;if(_0x46651f[_0x1de2('0xd')]&&parseInt(_0x46651f[_0x1de2('0xd')],0xa)){var _0x38fdfd={'ListId':parseInt(_0x46651f['data1'],0xa),'phone':_0x808ddc['calleridnum']};if(_[_0x1de2('0xe')](_0x808ddc['routeId'])){_0x38fdfd[_0x1de2('0xf')]=_0x808ddc[_0x1de2('0x10')]&&_0x808ddc[_0x1de2('0x10')]!==_0x1de2('0x11')?_0x808ddc[_0x1de2('0x10')]:_0x808ddc[_0x1de2('0x12')]||_0x808ddc[_0x1de2('0x13')];}else{_0x38fdfd['firstName']=_0x808ddc['destcalleridname']&&_0x808ddc[_0x1de2('0x14')]!==_0x1de2('0x11')?_0x808ddc['destcalleridname']:_0x808ddc[_0x1de2('0x15')]||_0x808ddc[_0x1de2('0x13')];_0x38fdfd[_0x1de2('0x16')]=_0x808ddc[_0x1de2('0x14')]&&_0x808ddc['destcalleridname']!==_0x1de2('0x11')?_0x808ddc['destcalleridname']:_0x808ddc[_0x1de2('0x15')]||_0x808ddc[_0x1de2('0x13')];}BPromise[_0x1de2('0x17')]()['then'](cmContactRpc['showContact']({'where':_[_0x1de2('0x18')](_0x38fdfd,[_0x1de2('0xf')])}))[_0x1de2('0x19')](function(_0x415fe9){if(_0x415fe9){_0x808ddc[_0x1de2('0x1a')]=_0x415fe9['id'];emit(util[_0x1de2('0x1b')](_0x1de2('0x1c'),_0x456bac[_0x1de2('0x1d')]),util['format'](_0x1de2('0x1e'),_0x46651f[_0x1de2('0x1f')]['toLowerCase']()),_[_0x1de2('0x20')](_0x808ddc,{'ListId':parseInt(_0x46651f['data1'],0xa)}));return;}else{return BPromise[_0x1de2('0x17')]()[_0x1de2('0x19')](cmContactRpc[_0x1de2('0x21')](_0x38fdfd));}})['then'](function(_0x1c4ee3){if(_0x1c4ee3){_0x808ddc[_0x1de2('0x1a')]=_0x1c4ee3['id'];emit(util[_0x1de2('0x1b')](_0x1de2('0x1c'),_0x456bac[_0x1de2('0x1d')]),util[_0x1de2('0x1b')](_0x1de2('0x1e'),_0x46651f[_0x1de2('0x1f')][_0x1de2('0x22')]()),_[_0x1de2('0x20')](_0x808ddc,{'ListId':parseInt(_0x46651f[_0x1de2('0x23')],0xa)}));}})['catch'](function(_0x25cc3b){logger[_0x1de2('0x24')]('Error\x20creating\x20contact',JSON[_0x1de2('0x9')](_0x25cc3b));});}else{if(_0x456bac){emit(util[_0x1de2('0x1b')]('user:%s',_0x456bac[_0x1de2('0x1d')]),util[_0x1de2('0x1b')](_0x1de2('0x1e'),_0x46651f['action'][_0x1de2('0x22')]()),_[_0x1de2('0x20')]({'ListId':parseInt(_0x46651f[_0x1de2('0x23')],0xa)},_0x808ddc));}}};
\ No newline at end of file
+var _0x2185=['destcalleridnum','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s','action','merge','createContact','toLowerCase','catch','error','Error\x20creating\x20contact','util','lodash','ioredis','redis','localhost','socket.io-emitter','stringify','emit','autoCreate','data2','data1','routeId','firstName','calleridname','<unknown>','calleridnum','uniqueid','destcalleridname','phone'];(function(_0xf65da5,_0x8e3312){var _0x446149=function(_0x3e550d){while(--_0x3e550d){_0xf65da5['push'](_0xf65da5['shift']());}};_0x446149(++_0x8e3312);}(_0x2185,0x1c1));var _0x5218=function(_0x457433,_0x753651){_0x457433=_0x457433-0x0;var _0x16bfe2=_0x2185[_0x457433];return _0x16bfe2;};'use strict';var BPromise=require('bluebird');var util=require(_0x5218('0x0'));var _=require(_0x5218('0x1'));var Redis=require(_0x5218('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config['redis']=_['defaults'](config[_0x5218('0x3')],{'host':_0x5218('0x4'),'port':0x18eb});var io=require(_0x5218('0x5'))(new Redis(config[_0x5218('0x3')]));function emit(_0x56195f,_0x4565a6,_0x68033){logger['info'](_0x56195f,_0x4565a6,JSON[_0x5218('0x6')](_0x68033));io['to'](_0x56195f)[_0x5218('0x7')](_0x4565a6,_0x68033);}exports['exec']=function(_0x3552dd,_0x4a407f,_0x31c8c8){_0x31c8c8[_0x5218('0x8')]=0x0;if(_0x4a407f['data2']&&parseInt(_0x4a407f[_0x5218('0x9')],0xa)){var _0x4f2f95={'ListId':parseInt(_0x4a407f[_0x5218('0xa')],0xa),'phone':_0x31c8c8['calleridnum']};if(_['isNil'](_0x31c8c8[_0x5218('0xb')])){_0x4f2f95[_0x5218('0xc')]=_0x31c8c8[_0x5218('0xd')]&&_0x31c8c8[_0x5218('0xd')]!==_0x5218('0xe')?_0x31c8c8[_0x5218('0xd')]:_0x31c8c8[_0x5218('0xf')]||_0x31c8c8[_0x5218('0x10')];}else{_0x4f2f95['firstName']=_0x31c8c8['destcalleridname']&&_0x31c8c8[_0x5218('0x11')]!==_0x5218('0xe')?_0x31c8c8[_0x5218('0x11')]:_0x31c8c8['destcalleridnum']||_0x31c8c8[_0x5218('0x10')];_0x4f2f95[_0x5218('0x12')]=_0x31c8c8['destcalleridname']&&_0x31c8c8[_0x5218('0x11')]!==_0x5218('0xe')?_0x31c8c8[_0x5218('0x11')]:_0x31c8c8[_0x5218('0x13')]||_0x31c8c8[_0x5218('0x10')];}BPromise[_0x5218('0x14')]()[_0x5218('0x15')](cmContactRpc[_0x5218('0x16')]({'where':_[_0x5218('0x17')](_0x4f2f95,[_0x5218('0xc')])}))['then'](function(_0x2a2774){if(_0x2a2774){_0x31c8c8[_0x5218('0x18')]=_0x2a2774['id'];emit(util[_0x5218('0x19')](_0x5218('0x1a'),_0x3552dd[_0x5218('0x1b')]),util[_0x5218('0x19')](_0x5218('0x1c'),_0x4a407f[_0x5218('0x1d')]['toLowerCase']()),_[_0x5218('0x1e')](_0x31c8c8,{'ListId':parseInt(_0x4a407f[_0x5218('0xa')],0xa)}));return;}else{return BPromise[_0x5218('0x14')]()[_0x5218('0x15')](cmContactRpc[_0x5218('0x1f')](_0x4f2f95));}})[_0x5218('0x15')](function(_0x29c388){if(_0x29c388){_0x31c8c8['xmd-contactid2']=_0x29c388['id'];emit(util[_0x5218('0x19')](_0x5218('0x1a'),_0x3552dd[_0x5218('0x1b')]),util[_0x5218('0x19')](_0x5218('0x1c'),_0x4a407f[_0x5218('0x1d')][_0x5218('0x20')]()),_[_0x5218('0x1e')](_0x31c8c8,{'ListId':parseInt(_0x4a407f[_0x5218('0xa')],0xa)}));}})[_0x5218('0x21')](function(_0x512651){logger[_0x5218('0x22')](_0x5218('0x23'),JSON[_0x5218('0x6')](_0x512651));});}else{if(_0x3552dd){emit(util['format'](_0x5218('0x1a'),_0x3552dd[_0x5218('0x1b')]),util[_0x5218('0x19')](_0x5218('0x1c'),_0x4a407f[_0x5218('0x1d')][_0x5218('0x20')]()),_['merge']({'ListId':parseInt(_0x4a407f[_0x5218('0xa')],0xa)},_0x31c8c8));}}};
\ No newline at end of file
index 0dc8125..9193ed3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb1f=['../rpc/cmContact','../../../config/environment','trigger','../ami','defaults','localhost','socket.io-emitter','redis','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','sugarcrmAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','clone','checkTriggers','hasOwnProperty','status','checkTrigger','merge','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','interface','name','trigger:%s:%s','jscripty','trigger:%s','integration','exec','accounts','queue','urlforward','buildUri','parse','query','search','AllConditions','length','every','checkConditions','channel','AnyConditions','some','account','operator','value','upperFirst','AccountId','interaction','message','event','lastevent','routeId','util','lodash','url','mustache','ioredis','./urlforward'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0xbb1f,0x68));var _0xfbb1=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0xbb1f[_0x1ab0e6];return _0x248815;};'use strict';var util=require(_0xfbb1('0x0'));var _=require(_0xfbb1('0x1'));var url=require(_0xfbb1('0x2'));var Mustache=require(_0xfbb1('0x3'));var Redis=require(_0xfbb1('0x4'));var urlforward=require(_0xfbb1('0x5'));var integration=require('./integration');var cmContact=require('./cmContact');var cmContactRpc=require(_0xfbb1('0x6'));var config=require(_0xfbb1('0x7'));var logger=require('../../../config/logger')(_0xfbb1('0x8'));var ami=require(_0xfbb1('0x9'));config['redis']=_[_0xfbb1('0xa')](config['redis'],{'host':_0xfbb1('0xb'),'port':0x18eb});var io=require(_0xfbb1('0xc'))(new Redis(config[_0xfbb1('0xd')]));var operators={'equals':function(_0x40b6a2,_0x3e6d3e){return _0x40b6a2==_0x3e6d3e;},'not_equals':function(_0x2dc9b2,_0x401f5c){return _0x2dc9b2!=_0x401f5c;}};var barAndWebActions=[_0xfbb1('0xe'),'url',_0xfbb1('0xf')];function Trigger(_0x5dc834){this[_0xfbb1('0x10')]=_0x5dc834[_0xfbb1('0x10')];this[_0xfbb1('0x11')]=_0x5dc834[_0xfbb1('0x11')];this[_0xfbb1('0x12')]=_0x5dc834[_0xfbb1('0x12')];this[_0xfbb1('0x13')]=_0x5dc834[_0xfbb1('0x13')];this[_0xfbb1('0x14')]=_0x5dc834['voiceExtensions'];this[_0xfbb1('0x15')]=_0x5dc834[_0xfbb1('0x15')];this['freshdeskAccounts']=_0x5dc834[_0xfbb1('0x16')];this[_0xfbb1('0x17')]=_0x5dc834[_0xfbb1('0x17')];this['sugarcrmAccounts']=_0x5dc834['sugarcrmAccounts'];this['zohoAccounts']=_0x5dc834[_0xfbb1('0x18')];this[_0xfbb1('0x19')]=_0x5dc834['deskAccounts'];this[_0xfbb1('0x1a')]=_0x5dc834[_0xfbb1('0x1a')];this['accounts']={'zendesk':this[_0xfbb1('0x15')],'salesforce':this[_0xfbb1('0x17')],'freshdesk':this[_0xfbb1('0x16')],'sugarcrm':this[_0xfbb1('0x1b')],'zoho':this[_0xfbb1('0x18')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts']};ami['on'](_0xfbb1('0x1c'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on']('custom:agentconnect',this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x1f'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x20'),this[_0xfbb1('0x1d')]['bind'](this));ami['on'](_0xfbb1('0x21'),this['syncCustomEvent'][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x22'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x23'),this[_0xfbb1('0x1d')]['bind'](this));ami['on'](_0xfbb1('0x24'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x25'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x26'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x27'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x28'),this[_0xfbb1('0x1d')]['bind'](this));ami['on'](_0xfbb1('0x29'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));ami['on'](_0xfbb1('0x2a'),this[_0xfbb1('0x1d')][_0xfbb1('0x1e')](this));}Trigger[_0xfbb1('0x2b')][_0xfbb1('0x2c')]=function(_0x2c2d6b,_0x2a03a,_0x3df1dd){logger['info'](_0x2c2d6b,_0x2a03a,JSON['stringify'](_0x3df1dd));io['to'](_0x2c2d6b)['emit'](_0x2a03a,_0x3df1dd);};Trigger[_0xfbb1('0x2b')]['syncCustomEvent']=function(_0x4f55b4){var _0x3dbd19=_[_0xfbb1('0x2d')](_0x4f55b4);this['checkTriggers'](_0x3dbd19);};Trigger[_0xfbb1('0x2b')][_0xfbb1('0x2e')]=function(_0x19326d){var _0x2cd398;for(var _0x512847 in this[_0xfbb1('0x10')]){if(this['triggers'][_0xfbb1('0x2f')](_0x512847)){if(this['triggers'][_0x512847][_0xfbb1('0x30')]){_0x2cd398=this[_0xfbb1('0x31')](this[_0xfbb1('0x10')][_0x512847],_0x19326d);if(_0x2cd398){_[_0xfbb1('0x32')](_0x19326d,_0x19326d['variables']);for(var _0x51cc46=0x0,_0x1255a4,_0x37bbaf,_0x3505d0;_0x51cc46<this[_0xfbb1('0x10')][_0x512847][_0xfbb1('0x33')]['length'];_0x51cc46+=0x1){_0x1255a4=this[_0xfbb1('0x10')][_0x512847][_0xfbb1('0x33')][_0x51cc46];if(this['agents'][_0x19326d['interface']]){switch(_0x1255a4[_0xfbb1('0x34')][_0xfbb1('0x35')]()){case _0xfbb1('0x36'):break;case _0xfbb1('0x37'):case _0xfbb1('0x38'):var _0x5aa4ab={};switch(barAndWebActions[_0x1255a4[_0xfbb1('0x39')]]){case'popup':_0x5aa4ab[_0xfbb1('0x3a')]=_0x1255a4['data2'];_0x5aa4ab['html']=this[_0xfbb1('0x13')][_0x1255a4[_0xfbb1('0x3b')]]?Mustache[_0xfbb1('0x3c')](this[_0xfbb1('0x13')][_0x1255a4[_0xfbb1('0x3b')]][_0xfbb1('0x3d')],_0x19326d):_0xfbb1('0x3e');break;case _0xfbb1('0x2'):_0x5aa4ab[_0xfbb1('0x3f')]=this['buildUri'](_0x1255a4[_0xfbb1('0x3b')],_0x19326d,_[_0xfbb1('0x40')](_0x1255a4['data3'])?!![]:parseInt(_0x1255a4[_0xfbb1('0x41')],0xa));if(_[_0xfbb1('0x40')](_0x1255a4[_0xfbb1('0x42')])){_0x5aa4ab[_0xfbb1('0x43')]='0';}else{_0x5aa4ab[_0xfbb1('0x44')]=_0x1255a4[_0xfbb1('0x42')];_0x5aa4ab[_0xfbb1('0x45')]=_[_0xfbb1('0x40')](_0x1255a4[_0xfbb1('0x46')])?_0xfbb1('0x47'):_0x1255a4['data5'];_0x5aa4ab[_0xfbb1('0x48')]=_[_0xfbb1('0x40')](_0x1255a4[_0xfbb1('0x49')])?_0xfbb1('0x4a'):_0x1255a4[_0xfbb1('0x49')];}break;case _0xfbb1('0xf'):_0x5aa4ab[_0xfbb1('0x4b')]=_0x1255a4[_0xfbb1('0x3b')]?Mustache[_0xfbb1('0x3c')](_0x1255a4[_0xfbb1('0x3b')],_0x19326d):'';_0x5aa4ab[_0xfbb1('0x4c')]=_0x1255a4[_0xfbb1('0x41')]?Mustache[_0xfbb1('0x3c')](_0x1255a4[_0xfbb1('0x41')],_0x19326d):'';break;}this[_0xfbb1('0x2c')](util[_0xfbb1('0x4d')](_0xfbb1('0x4e'),this[_0xfbb1('0x11')][_0x19326d[_0xfbb1('0x4f')]][_0xfbb1('0x50')]),util[_0xfbb1('0x4d')](_0xfbb1('0x51'),_0x1255a4[_0xfbb1('0x34')][_0xfbb1('0x35')](),barAndWebActions[_0x1255a4[_0xfbb1('0x39')]]),_['merge'](_0x5aa4ab,_0x19326d));break;case _0xfbb1('0x52'):this[_0xfbb1('0x2c')](util[_0xfbb1('0x4d')](_0xfbb1('0x4e'),this[_0xfbb1('0x11')][_0x19326d[_0xfbb1('0x4f')]][_0xfbb1('0x50')]),util['format'](_0xfbb1('0x53'),_0x1255a4[_0xfbb1('0x34')]['toLowerCase']()),_[_0xfbb1('0x32')]({'ProjectId':parseInt(_0x1255a4[_0xfbb1('0x39')],0xa)},_0x19326d));break;default:this[_0xfbb1('0x2c')](util[_0xfbb1('0x4d')](_0xfbb1('0x4e'),this['agents'][_0x19326d['interface']][_0xfbb1('0x50')]),util[_0xfbb1('0x4d')]('trigger:%s',_0x1255a4[_0xfbb1('0x34')][_0xfbb1('0x35')]()),_[_0xfbb1('0x32')]({},_0x1255a4,_0x19326d));}}switch(_0x1255a4['action'][_0xfbb1('0x35')]()){case'contactmanager':cmContact['exec'](this[_0xfbb1('0x11')][_0x19326d[_0xfbb1('0x4f')]],_0x1255a4,_0x19326d,cmContactRpc);break;case _0xfbb1('0x54'):integration[_0xfbb1('0x55')](_0x1255a4,_0x19326d,this[_0xfbb1('0x56')],this[_0xfbb1('0x11')][_0x19326d[_0xfbb1('0x4f')]],this[_0xfbb1('0x12')][_0x19326d[_0xfbb1('0x57')]],this[_0xfbb1('0x14')][_0x19326d['routeId']]);break;case _0xfbb1('0x58'):urlforward[_0xfbb1('0x55')](_0x1255a4,_0x19326d);break;}}}}}}};Trigger[_0xfbb1('0x2b')][_0xfbb1('0x59')]=function(_0x194cae,_0x5f2a44,_0x1c1843){var _0x1ee472=url[_0xfbb1('0x5a')](Mustache[_0xfbb1('0x3c')](_0x194cae,_0x5f2a44),!![]);if(_0x1c1843){_[_0xfbb1('0x32')](_0x1ee472[_0xfbb1('0x5b')],_0x5f2a44);}delete _0x1ee472[_0xfbb1('0x5c')];return url[_0xfbb1('0x4d')](_0x1ee472);};Trigger[_0xfbb1('0x2b')][_0xfbb1('0x31')]=function(_0x4c2e35,_0x4c9d6f){var _0x114982=!![],_0x124a1c=!![];if(_0x4c2e35[_0xfbb1('0x5d')][_0xfbb1('0x5e')]){_0x114982=_[_0xfbb1('0x5f')](_0x4c2e35[_0xfbb1('0x5d')],this[_0xfbb1('0x60')](_0x4c9d6f,_0x4c2e35[_0xfbb1('0x61')]));}if(_0x4c2e35[_0xfbb1('0x62')][_0xfbb1('0x5e')]){_0x124a1c=_[_0xfbb1('0x63')](_0x4c2e35[_0xfbb1('0x62')],this['checkConditions'](_0x4c9d6f,_0x4c2e35[_0xfbb1('0x61')]));}return _0x114982&&_0x124a1c;};Trigger['prototype'][_0xfbb1('0x60')]=function(_0x24c3e1,_0x50750f){return function(_0x4a6190){switch(_0x4a6190['field']){case _0xfbb1('0x64'):if(_0x24c3e1[_0xfbb1('0x61')]===_0x50750f){if(_0x50750f==='chat'){return _0x24c3e1['ChatWebsiteId']?operators[_0x4a6190[_0xfbb1('0x65')]](Number(_0x4a6190[_0xfbb1('0x66')]),_0x24c3e1['ChatWebsiteId']):![];}else{return _0x24c3e1[_[_0xfbb1('0x67')](_0x50750f)+_0xfbb1('0x68')]?operators[_0x4a6190['operator']](Number(_0x4a6190['value']),_0x24c3e1[_[_0xfbb1('0x67')](_0x50750f)+'AccountId']):![];}}break;case _0xfbb1('0x69'):case _0xfbb1('0x6a'):if(_0x24c3e1[_0xfbb1('0x61')]===_0x50750f){return _0x24c3e1['event']?operators[_0x4a6190['operator']](_0x4a6190[_0xfbb1('0x66')],_0x24c3e1[_0xfbb1('0x6b')]):![];}break;case _0xfbb1('0x57'):return _0x24c3e1[_0xfbb1('0x57')]?operators[_0x4a6190[_0xfbb1('0x65')]](_0x4a6190[_0xfbb1('0x66')],_0x24c3e1[_0xfbb1('0x57')]):![];case _0xfbb1('0x6c'):return _0x24c3e1[_0xfbb1('0x6c')]?operators[_0x4a6190['operator']](_0x4a6190['value'],_0x24c3e1[_0xfbb1('0x6c')]):![];case _0xfbb1('0x6d'):return _0x24c3e1[_0xfbb1('0x6d')]?operators[_0x4a6190['operator']](_0x4a6190[_0xfbb1('0x66')],_0x24c3e1['routeId']):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x3213=['data3','format','user:%s','jscripty','trigger:%s','name','contactmanager','exec','queue','urlforward','parse','query','search','AllConditions','every','checkConditions','channel','AnyConditions','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','interaction','message','event','operator','lastevent','routeId','exports','url','mustache','ioredis','./urlforward','./integration','./cmContact','../rpc/cmContact','../../../config/environment','redis','defaults','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','accounts','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','checkTriggers','hasOwnProperty','status','checkTrigger','merge','Actions','length','interface','action','toLowerCase','browser','data1','popup','TemplateId','data2','render','html','template\x20not\x20found','buildUri','isNil','data4','location','uriLocation','data5','800','windowHeight','data6','winArguments'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x3213,0x88));var _0x3321=function(_0x4f6c9d,_0x5932f5){_0x4f6c9d=_0x4f6c9d-0x0;var _0x275bd0=_0x3213[_0x4f6c9d];return _0x275bd0;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x3321('0x0'));var Mustache=require(_0x3321('0x1'));var Redis=require(_0x3321('0x2'));var urlforward=require(_0x3321('0x3'));var integration=require(_0x3321('0x4'));var cmContact=require(_0x3321('0x5'));var cmContactRpc=require(_0x3321('0x6'));var config=require(_0x3321('0x7'));var logger=require('../../../config/logger')('trigger');var ami=require('../ami');config[_0x3321('0x8')]=_[_0x3321('0x9')](config[_0x3321('0x8')],{'host':_0x3321('0xa'),'port':0x18eb});var io=require(_0x3321('0xb'))(new Redis(config[_0x3321('0x8')]));var operators={'equals':function(_0x56f1b5,_0x2897cb){return _0x56f1b5==_0x2897cb;},'not_equals':function(_0x29cb8c,_0x44d262){return _0x29cb8c!=_0x44d262;}};var barAndWebActions=['popup',_0x3321('0x0'),_0x3321('0xc')];function Trigger(_0x3fb386){this['triggers']=_0x3fb386[_0x3321('0xd')];this[_0x3321('0xe')]=_0x3fb386[_0x3321('0xe')];this[_0x3321('0xf')]=_0x3fb386[_0x3321('0xf')];this[_0x3321('0x10')]=_0x3fb386[_0x3321('0x10')];this[_0x3321('0x11')]=_0x3fb386[_0x3321('0x11')];this[_0x3321('0x12')]=_0x3fb386[_0x3321('0x12')];this[_0x3321('0x13')]=_0x3fb386[_0x3321('0x13')];this[_0x3321('0x14')]=_0x3fb386[_0x3321('0x14')];this[_0x3321('0x15')]=_0x3fb386[_0x3321('0x15')];this[_0x3321('0x16')]=_0x3fb386[_0x3321('0x16')];this[_0x3321('0x17')]=_0x3fb386[_0x3321('0x17')];this['vtigerAccounts']=_0x3fb386[_0x3321('0x18')];this[_0x3321('0x19')]={'zendesk':this[_0x3321('0x12')],'salesforce':this[_0x3321('0x14')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x3321('0x15')],'zoho':this['zohoAccounts'],'desk':this[_0x3321('0x17')],'vtiger':this[_0x3321('0x18')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0x3321('0x1a')](this));ami['on'](_0x3321('0x1b'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));ami['on'](_0x3321('0x1d'),this['syncCustomEvent'][_0x3321('0x1a')](this));ami['on'](_0x3321('0x1e'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));ami['on'](_0x3321('0x1f'),this[_0x3321('0x1c')]['bind'](this));ami['on'](_0x3321('0x20'),this['syncCustomEvent'][_0x3321('0x1a')](this));ami['on'](_0x3321('0x21'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));ami['on'](_0x3321('0x22'),this['syncCustomEvent'][_0x3321('0x1a')](this));ami['on'](_0x3321('0x23'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));ami['on'](_0x3321('0x24'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));ami['on'](_0x3321('0x25'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));ami['on']('custom:outgoingmessage',this[_0x3321('0x1c')]['bind'](this));ami['on'](_0x3321('0x26'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));ami['on'](_0x3321('0x27'),this[_0x3321('0x1c')][_0x3321('0x1a')](this));}Trigger[_0x3321('0x28')][_0x3321('0x29')]=function(_0x7c520e,_0x4d7448,_0x5b4881){logger[_0x3321('0x2a')](_0x7c520e,_0x4d7448,JSON[_0x3321('0x2b')](_0x5b4881));io['to'](_0x7c520e)[_0x3321('0x29')](_0x4d7448,_0x5b4881);};Trigger[_0x3321('0x28')][_0x3321('0x1c')]=function(_0x32f5d7){var _0x5a437c=_['clone'](_0x32f5d7);this[_0x3321('0x2c')](_0x5a437c);};Trigger[_0x3321('0x28')][_0x3321('0x2c')]=function(_0x47c812){var _0x1841f2;for(var _0x40b64b in this[_0x3321('0xd')]){if(this[_0x3321('0xd')][_0x3321('0x2d')](_0x40b64b)){if(this['triggers'][_0x40b64b][_0x3321('0x2e')]){_0x1841f2=this[_0x3321('0x2f')](this[_0x3321('0xd')][_0x40b64b],_0x47c812);if(_0x1841f2){_[_0x3321('0x30')](_0x47c812,_0x47c812['variables']);for(var _0x2037cb=0x0,_0x420116,_0x560ffc,_0x5a1f76;_0x2037cb<this['triggers'][_0x40b64b][_0x3321('0x31')][_0x3321('0x32')];_0x2037cb+=0x1){_0x420116=this['triggers'][_0x40b64b][_0x3321('0x31')][_0x2037cb];if(this['agents'][_0x47c812[_0x3321('0x33')]]){switch(_0x420116[_0x3321('0x34')][_0x3321('0x35')]()){case'contactmanager':break;case'motionbar':case _0x3321('0x36'):var _0x27ca9b={};switch(barAndWebActions[_0x420116[_0x3321('0x37')]]){case _0x3321('0x38'):_0x27ca9b[_0x3321('0x39')]=_0x420116[_0x3321('0x3a')];_0x27ca9b['html']=this[_0x3321('0x10')][_0x420116[_0x3321('0x3a')]]?Mustache[_0x3321('0x3b')](this[_0x3321('0x10')][_0x420116[_0x3321('0x3a')]][_0x3321('0x3c')],_0x47c812):_0x3321('0x3d');break;case _0x3321('0x0'):_0x27ca9b['uri']=this[_0x3321('0x3e')](_0x420116[_0x3321('0x3a')],_0x47c812,_[_0x3321('0x3f')](_0x420116['data3'])?!![]:parseInt(_0x420116['data3'],0xa));if(_[_0x3321('0x3f')](_0x420116[_0x3321('0x40')])){_0x27ca9b[_0x3321('0x41')]='0';}else{_0x27ca9b[_0x3321('0x42')]=_0x420116[_0x3321('0x40')];_0x27ca9b['windowWidth']=_[_0x3321('0x3f')](_0x420116[_0x3321('0x43')])?_0x3321('0x44'):_0x420116[_0x3321('0x43')];_0x27ca9b[_0x3321('0x45')]=_[_0x3321('0x3f')](_0x420116[_0x3321('0x46')])?'600':_0x420116[_0x3321('0x46')];}break;case _0x3321('0xc'):_0x27ca9b['winApplication']=_0x420116[_0x3321('0x3a')]?Mustache[_0x3321('0x3b')](_0x420116[_0x3321('0x3a')],_0x47c812):'';_0x27ca9b[_0x3321('0x47')]=_0x420116[_0x3321('0x48')]?Mustache['render'](_0x420116[_0x3321('0x48')],_0x47c812):'';break;}this['emit'](util[_0x3321('0x49')](_0x3321('0x4a'),this['agents'][_0x47c812[_0x3321('0x33')]]['name']),util[_0x3321('0x49')]('trigger:%s:%s',_0x420116[_0x3321('0x34')][_0x3321('0x35')](),barAndWebActions[_0x420116[_0x3321('0x37')]]),_[_0x3321('0x30')](_0x27ca9b,_0x47c812));break;case _0x3321('0x4b'):this[_0x3321('0x29')](util[_0x3321('0x49')]('user:%s',this['agents'][_0x47c812[_0x3321('0x33')]]['name']),util['format'](_0x3321('0x4c'),_0x420116[_0x3321('0x34')][_0x3321('0x35')]()),_[_0x3321('0x30')]({'ProjectId':parseInt(_0x420116[_0x3321('0x37')],0xa)},_0x47c812));break;default:this[_0x3321('0x29')](util[_0x3321('0x49')](_0x3321('0x4a'),this[_0x3321('0xe')][_0x47c812[_0x3321('0x33')]][_0x3321('0x4d')]),util[_0x3321('0x49')]('trigger:%s',_0x420116[_0x3321('0x34')][_0x3321('0x35')]()),_[_0x3321('0x30')]({},_0x420116,_0x47c812));}}switch(_0x420116[_0x3321('0x34')][_0x3321('0x35')]()){case _0x3321('0x4e'):cmContact[_0x3321('0x4f')](this[_0x3321('0xe')][_0x47c812['interface']],_0x420116,_0x47c812,cmContactRpc);break;case'integration':integration[_0x3321('0x4f')](_0x420116,_0x47c812,this[_0x3321('0x19')],this[_0x3321('0xe')][_0x47c812['interface']],this[_0x3321('0xf')][_0x47c812[_0x3321('0x50')]],this['voiceExtensions'][_0x47c812['routeId']]);break;case _0x3321('0x51'):urlforward[_0x3321('0x4f')](_0x420116,_0x47c812);break;}}}}}}};Trigger[_0x3321('0x28')][_0x3321('0x3e')]=function(_0x3154ed,_0x3734a7,_0x5c6038){var _0x12f7f5=url[_0x3321('0x52')](Mustache[_0x3321('0x3b')](_0x3154ed,_0x3734a7),!![]);if(_0x5c6038){_[_0x3321('0x30')](_0x12f7f5[_0x3321('0x53')],_0x3734a7);}delete _0x12f7f5[_0x3321('0x54')];return url[_0x3321('0x49')](_0x12f7f5);};Trigger[_0x3321('0x28')][_0x3321('0x2f')]=function(_0x177423,_0x10645d){var _0x4ca3e7=!![],_0x5b8040=!![];if(_0x177423[_0x3321('0x55')][_0x3321('0x32')]){_0x4ca3e7=_[_0x3321('0x56')](_0x177423[_0x3321('0x55')],this[_0x3321('0x57')](_0x10645d,_0x177423[_0x3321('0x58')]));}if(_0x177423[_0x3321('0x59')][_0x3321('0x32')]){_0x5b8040=_['some'](_0x177423[_0x3321('0x59')],this[_0x3321('0x57')](_0x10645d,_0x177423[_0x3321('0x58')]));}return _0x4ca3e7&&_0x5b8040;};Trigger[_0x3321('0x28')][_0x3321('0x57')]=function(_0x12d3e2,_0x1907c6){return function(_0x4d98da){switch(_0x4d98da[_0x3321('0x5a')]){case _0x3321('0x5b'):if(_0x12d3e2[_0x3321('0x58')]===_0x1907c6){if(_0x1907c6===_0x3321('0x5c')){return _0x12d3e2[_0x3321('0x5d')]?operators[_0x4d98da['operator']](Number(_0x4d98da[_0x3321('0x5e')]),_0x12d3e2[_0x3321('0x5d')]):![];}else{return _0x12d3e2[_[_0x3321('0x5f')](_0x1907c6)+_0x3321('0x60')]?operators[_0x4d98da['operator']](Number(_0x4d98da[_0x3321('0x5e')]),_0x12d3e2[_[_0x3321('0x5f')](_0x1907c6)+_0x3321('0x60')]):![];}}break;case _0x3321('0x61'):case _0x3321('0x62'):if(_0x12d3e2[_0x3321('0x58')]===_0x1907c6){return _0x12d3e2['event']?operators[_0x4d98da['operator']](_0x4d98da[_0x3321('0x5e')],_0x12d3e2[_0x3321('0x63')]):![];}break;case _0x3321('0x50'):return _0x12d3e2['queue']?operators[_0x4d98da[_0x3321('0x64')]](_0x4d98da[_0x3321('0x5e')],_0x12d3e2[_0x3321('0x50')]):![];case'lastevent':return _0x12d3e2['lastevent']?operators[_0x4d98da[_0x3321('0x64')]](_0x4d98da['value'],_0x12d3e2[_0x3321('0x65')]):![];case _0x3321('0x66'):return _0x12d3e2[_0x3321('0x66')]?operators[_0x4d98da[_0x3321('0x64')]](_0x4d98da[_0x3321('0x5e')],_0x12d3e2['routeId']):![];}return![];};};module[_0x3321('0x67')]=Trigger;
\ No newline at end of file
index c3c28f0..157bb04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2f5=['[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','abandoned','monitor_format','[ABANDONED]','lodash','md5','ioredis','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','format','%s/users','remoteUri','total_entries','find','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','[HTTP]','stringify','GET','authType','basic','%s:%s','password','token','%s/token:%s','username','base64','%s/customers/search','Enduser\x20found!','_embedded','entries','%s/customers','POST','work','map','forEach','type','string','customField','nameField','content','toString','idField','custom_fields','variable','variableName','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','new','Motion','CTI','concat','Tags','Descriptions','/api/v2/users/%d','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none'];(function(_0x2643e3,_0x1c6fde){var _0x499e5f=function(_0x2bf30f){while(--_0x2bf30f){_0x2643e3['push'](_0x2643e3['shift']());}};_0x499e5f(++_0x1c6fde);}(_0xd2f5,0x144));var _0x5d2f=function(_0x34d60d,_0x16d609){_0x34d60d=_0x34d60d-0x0;var _0x17dcd2=_0xd2f5[_0x34d60d];return _0x17dcd2;};'use strict';var _=require(_0x5d2f('0x0'));var rp=require('request-promise');var md5=require(_0x5d2f('0x1'));var util=require('util');var Redis=require(_0x5d2f('0x2'));var intUtil=require('./util');var config=require(_0x5d2f('0x3'));var logger=require(_0x5d2f('0x4'))(_0x5d2f('0x5'));config[_0x5d2f('0x6')]=_[_0x5d2f('0x7')](config[_0x5d2f('0x6')],{'host':_0x5d2f('0x8'),'port':0x18eb});var io=require(_0x5d2f('0x9'))(new Redis(config['redis']));function emit(_0x443779,_0x908c6,_0x1c8c59){io['to'](_0x443779)[_0x5d2f('0xa')](_0x908c6,_0x1c8c59);}var headers={'Content-Type':_0x5d2f('0xb'),'Accept':_0x5d2f('0xb')};function getUser(_0x58e637,_0x305434){logger[_0x5d2f('0xc')]('Getting\x20agent\x20with\x20email',_0x305434);return request({'uri':util[_0x5d2f('0xd')](_0x5d2f('0xe'),_0x58e637[_0x5d2f('0xf')])})['then'](function(_0x39b43b){if(_0x39b43b[_0x5d2f('0x10')]){return _[_0x5d2f('0x11')](_0x39b43b['_embedded']['entries'],{'email':_0x305434});}})[_0x5d2f('0x12')](function(_0x4bc97f){if(_0x4bc97f){logger[_0x5d2f('0xc')](_0x5d2f('0x13'));return _0x4bc97f;}else{logger['info'](_0x5d2f('0x14'));return request({'uri':util['format'](_0x5d2f('0x15'),_0x58e637[_0x5d2f('0xf')])});}});}function request(_0x309985){logger['debug'](_0x5d2f('0x16'),JSON[_0x5d2f('0x17')](_0x309985));return rp(_[_0x5d2f('0x7')](_0x309985,{'method':_0x5d2f('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x1536ee){var _0x5796f6;if(_0x1536ee[_0x5d2f('0x19')]===_0x5d2f('0x1a')){_0x5796f6=util[_0x5d2f('0xd')](_0x5d2f('0x1b'),_0x1536ee['username'],_0x1536ee[_0x5d2f('0x1c')]);}else if(_0x1536ee[_0x5d2f('0x19')]===_0x5d2f('0x1d')){_0x5796f6=util[_0x5d2f('0xd')](_0x5d2f('0x1e'),_0x1536ee[_0x5d2f('0x1f')],_0x1536ee[_0x5d2f('0x1d')]);}return util['format']('Basic\x20%s',new Buffer(_0x5796f6)['toString'](_0x5d2f('0x20')));}function getEndUser(_0xd860af,_0xffb46f,_0x41967d){logger[_0x5d2f('0xc')]('Searching\x20enduser\x20with\x20phone',_0x41967d);return request({'uri':util['format'](_0x5d2f('0x21'),_0xd860af['remoteUri']),'qs':{'phone':_0x41967d}})[_0x5d2f('0x12')](function(_0xea19f2){if(_0xea19f2[_0x5d2f('0x10')]){logger[_0x5d2f('0xc')](_0x5d2f('0x22'));return _0xea19f2[_0x5d2f('0x23')][_0x5d2f('0x24')][0x0];}else{logger[_0x5d2f('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x5d2f('0xd')](_0x5d2f('0x25'),_0xd860af[_0x5d2f('0xf')]),'method':_0x5d2f('0x26'),'body':{'first_name':_0xffb46f,'title':_0xffb46f,'phone_numbers':[{'type':_0x5d2f('0x27'),'value':_0x41967d}]}});}});}function getTags(_0x25cc72,_0x2ff7cc){var _0x273223=[];if(_0x25cc72&&_0x25cc72['length']>0x0){_0x273223=_[_0x5d2f('0x28')](_0x25cc72,_0x2ff7cc);}return _0x273223;}function getCustomFields(_0xa95a71,_0x3d1b95){var _0x3446a0=[];var _0x185a2b={'custom_fields':{}};if(_0xa95a71['length']>0x0){_[_0x5d2f('0x29')](_0xa95a71,function(_0x35e94f){if(_0x35e94f[_0x5d2f('0x2a')]===_0x5d2f('0x2b')&&_0x35e94f['nameField']&&!_0x35e94f[_0x5d2f('0x2c')]){_0x185a2b[_0x35e94f[_0x5d2f('0x2d')]['toLowerCase']()]=_0x35e94f[_0x5d2f('0x2e')][_0x5d2f('0x2f')]();}else if(_0x35e94f[_0x5d2f('0x2a')]==='string'&&_0x35e94f[_0x5d2f('0x30')]&&_0x35e94f[_0x5d2f('0x2c')]){_0x185a2b[_0x5d2f('0x31')][_0x35e94f[_0x5d2f('0x30')]]=_0x35e94f[_0x5d2f('0x2e')][_0x5d2f('0x2f')]();}else if(_0x35e94f['type']===_0x5d2f('0x32')&&_0x35e94f[_0x5d2f('0x33')]&&_0x35e94f[_0x5d2f('0x30')]&&_0x35e94f['customField']){_0x3d1b95[_0x35e94f['variableName']]&&(_0x185a2b[_0x5d2f('0x31')][_0x35e94f[_0x5d2f('0x30')]]=_0x3d1b95[_0x35e94f[_0x5d2f('0x33')]][_0x5d2f('0x2f')]());}else if(_0x35e94f[_0x5d2f('0x2a')]===_0x5d2f('0x34')&&_0x35e94f[_0x5d2f('0x35')]&&_0x35e94f[_0x5d2f('0x35')][_0x5d2f('0x36')]&&_0x35e94f[_0x5d2f('0x30')]&&_0x35e94f[_0x5d2f('0x2c')]){_0x3d1b95[_0x35e94f[_0x5d2f('0x35')][_0x5d2f('0x36')][_0x5d2f('0x37')]()]&&(_0x185a2b[_0x5d2f('0x31')][_0x35e94f['idField']]=_0x3d1b95[_0x35e94f[_0x5d2f('0x35')][_0x5d2f('0x36')][_0x5d2f('0x37')]()][_0x5d2f('0x2f')]());}});}if(_0x185a2b[_0x5d2f('0x38')]){_0x185a2b[_0x5d2f('0x38')]=Number(_0x185a2b[_0x5d2f('0x38')]);}return _0x185a2b;}function getTicket(_0x28865f,_0x2afa2c,_0x557d42,_0x253f53,_0x49eb55){logger[_0x5d2f('0xc')](_0x5d2f('0x39'));var _0x14c319=_[_0x5d2f('0x3a')]({'subject':intUtil[_0x5d2f('0x3b')](_0x253f53[_0x5d2f('0x3c')],_0x49eb55,'\x20'),'type':'phone','status':_0x5d2f('0x3d'),'labels':['xCALLY',_0x5d2f('0x3e'),_0x5d2f('0x3f')][_0x5d2f('0x40')](getTags(_0x253f53[_0x5d2f('0x41')],_0x5d2f('0x36'))),'description':intUtil[_0x5d2f('0x3b')](_0x253f53[_0x5d2f('0x42')],_0x49eb55,'\x0a'),'_links':{'assigned_user':{'href':util[_0x5d2f('0xd')](_0x5d2f('0x43'),_0x2afa2c['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0x5d2f('0x3b')](_0x253f53['Descriptions'],_0x49eb55,'\x0a')}},getCustomFields(_0x253f53['Fields'],_0x49eb55));return request({'uri':util[_0x5d2f('0xd')](_0x5d2f('0x44'),_0x28865f[_0x5d2f('0xf')],_0x557d42['id']),'method':_0x5d2f('0x26'),'body':_0x14c319});}exports[_0x5d2f('0x45')]=function(_0x2553dd,_0x195721,_0x49c3fe,_0x508fba,_0x5b5bae,_0xf7edb3){var _0x28418a,_0x23ce9d;_0xf7edb3[_0x5d2f('0xf')]=intUtil[_0x5d2f('0x46')](_0xf7edb3['remoteUri']);_0xf7edb3[_0x5d2f('0x47')]=intUtil[_0x5d2f('0x46')](_0xf7edb3[_0x5d2f('0x47')]);if(_0x5b5bae&&_0x5b5bae['monitor_format']){logger[_0x5d2f('0xc')](_0x5d2f('0x48'),_0x5d2f('0x49'));_0x195721[_0x5d2f('0x4a')]=util[_0x5d2f('0xd')](_0x5d2f('0x4b'),_0xf7edb3['serverUrl'],_0x195721[_0x5d2f('0x4c')],md5(_0x195721['uniqueid']));}else{_0x195721['recordingURL']='';}headers[_0x5d2f('0x4d')]=getAuth(_0xf7edb3);return getUser(_0xf7edb3,_0x508fba[_0x5d2f('0x4e')])[_0x5d2f('0x12')](function(_0x4d44b8){_0x28418a=_0x4d44b8;logger[_0x5d2f('0xc')](_0x5d2f('0x4f'),_0x28418a['id']);return getEndUser(_0xf7edb3,_0x195721[_0x5d2f('0x50')],_0x195721[_0x5d2f('0x51')]);})['then'](function(_0x3216e5){_0x23ce9d=_0x3216e5;logger[_0x5d2f('0xc')](_0x5d2f('0x52'),_0x23ce9d['id']);return getTicket(_0xf7edb3,_0x28418a,_0x23ce9d,_0x49c3fe,_0x195721);})[_0x5d2f('0x12')](function(_0x2db009){if(_0x2db009){logger[_0x5d2f('0xc')](_0x5d2f('0x53'));logger[_0x5d2f('0xc')](_0x5d2f('0x54'),_0x2db009['id']);switch(_0xf7edb3[_0x5d2f('0x2a')]){case'integrationTab':logger['info']('[QUEUE]',_0x5d2f('0x55'));emit(util['format'](_0x5d2f('0x56'),_0x508fba[_0x5d2f('0x36')]),_0x5d2f('0x57'),{'recordId':_0x2db009['id']});break;case _0x5d2f('0x58'):logger[_0x5d2f('0xc')](_0x5d2f('0x48'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5d2f('0x56'),_0x508fba[_0x5d2f('0x36')]),_0x5d2f('0x59'),{'uri':util[_0x5d2f('0xd')](_0x5d2f('0x5a'),_0x2db009['id'])});break;default:logger[_0x5d2f('0x5b')](_0x5d2f('0x48'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x5d2f('0x5c')](function(_0x42d79d){console['error'](_0x42d79d);logger[_0x5d2f('0x5b')](_0x5d2f('0x48'),JSON[_0x5d2f('0x17')](_0x42d79d));});};exports[_0x5d2f('0x5d')]=function(_0x5a0a0d,_0x2a6769,_0x279192,_0x430545,_0x194725,_0x29ef71,_0xebbb29){var _0x177946,_0x4e471f;_0x29ef71[_0x5d2f('0xf')]=intUtil[_0x5d2f('0x46')](_0x29ef71[_0x5d2f('0xf')]);_0x29ef71['serverUrl']=intUtil['stripTrailingSlash'](_0x29ef71[_0x5d2f('0x47')]);if(_0xebbb29&&_0xebbb29[_0x5d2f('0x5e')]&&_0xebbb29[_0x5d2f('0x5e')]!==_0x5d2f('0x5f')){logger[_0x5d2f('0xc')](_0x5d2f('0x60'),_0x5d2f('0x49'));_0x2a6769[_0x5d2f('0x4a')]=util[_0x5d2f('0xd')](_0x5d2f('0x4b'),_0x29ef71[_0x5d2f('0x47')],_0x2a6769[_0x5d2f('0x4c')],md5(_0x2a6769[_0x5d2f('0x4c')]));}headers['Authorization']=getAuth(_0x29ef71);return getUser(_0x29ef71,_0x430545['email'])['then'](function(_0x395fae){_0x177946=_0x395fae;logger[_0x5d2f('0xc')](_0x5d2f('0x4f'),_0x177946['id']);return getEndUser(_0x29ef71,_0x2a6769[_0x5d2f('0x61')],_0x2a6769[_0x5d2f('0x62')]);})['then'](function(_0x274b75){_0x4e471f=_0x274b75;logger[_0x5d2f('0xc')](_0x5d2f('0x52'),_0x4e471f['id']);return getTicket(_0x29ef71,_0x177946,_0x4e471f,_0x279192,_0x2a6769);})[_0x5d2f('0x12')](function(_0x5e99a1){if(_0x5e99a1){logger[_0x5d2f('0xc')](_0x5d2f('0x53'));logger['info'](_0x5d2f('0x54'),_0x5e99a1['id']);switch(_0x29ef71['type']){case _0x5d2f('0x63'):logger[_0x5d2f('0xc')](_0x5d2f('0x48'),_0x5d2f('0x55'));emit(util['format'](_0x5d2f('0x56'),_0x430545[_0x5d2f('0x36')]),'trigger:desk:display',{'recordId':_0x5e99a1['id']});break;case _0x5d2f('0x58'):logger[_0x5d2f('0xc')]('[QUEUE]',_0x5d2f('0x64'));emit(util[_0x5d2f('0xd')]('user:%s',_0x430545[_0x5d2f('0x36')]),_0x5d2f('0x59'),{'uri':util['format'](_0x5d2f('0x65'),_0x29ef71[_0x5d2f('0xf')],_0x5e99a1['id'])});break;default:logger[_0x5d2f('0x5b')](_0x5d2f('0x60'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x5d2f('0x5c')](function(_0x198477){logger['error']('[OUTBOUND]',JSON[_0x5d2f('0x17')](_0x198477));});};exports[_0x5d2f('0x66')]=function(_0x3c91f6,_0x23f17b,_0x3a7a1c,_0x545507,_0x5226ff,_0x12ebc1){var _0x267da7,_0x4dbdda;_0x12ebc1['remoteUri']=intUtil[_0x5d2f('0x46')](_0x12ebc1[_0x5d2f('0xf')]);_0x12ebc1[_0x5d2f('0x47')]=intUtil['stripTrailingSlash'](_0x12ebc1['serverUrl']);if(_0x5226ff&&_0x5226ff[_0x5d2f('0x67')]){logger[_0x5d2f('0xc')]('[ABANDONED]',_0x5d2f('0x49'));_0x23f17b['recordingURL']=util[_0x5d2f('0xd')](_0x5d2f('0x4b'),_0x12ebc1[_0x5d2f('0x47')],_0x23f17b['uniqueid'],md5(_0x23f17b[_0x5d2f('0x4c')]));}else{_0x23f17b[_0x5d2f('0x4a')]='';}headers[_0x5d2f('0x4d')]=getAuth(_0x12ebc1);return getUser(_0x12ebc1)[_0x5d2f('0x12')](function(_0x4b3498){_0x267da7=_0x4b3498;logger[_0x5d2f('0xc')]('The\x20User\x20ID\x20is:',_0x267da7['id']);return getEndUser(_0x12ebc1,_0x23f17b[_0x5d2f('0x50')],_0x23f17b[_0x5d2f('0x51')]);})['then'](function(_0x417554){_0x4dbdda=_0x417554;logger[_0x5d2f('0xc')]('The\x20Enduser\x20ID\x20is:',_0x4dbdda['id']);return getTicket(_0x12ebc1,_0x267da7,_0x4dbdda,_0x3a7a1c,_0x23f17b);})['then'](function(_0x24e2bf){if(_0x24e2bf){logger[_0x5d2f('0xc')]('Ticket\x20created!');logger['info'](_0x5d2f('0x54'),_0x24e2bf['id']);}})[_0x5d2f('0x5c')](function(_0x52e258){logger[_0x5d2f('0x5b')](_0x5d2f('0x68'),JSON[_0x5d2f('0x17')](_0x52e258));});};
\ No newline at end of file
+var _0x1485=['Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','integrationTab','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','abandoned','[ABANDONED]','request-promise','md5','util','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','application/json','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','total_entries','find','_embedded','entries','then','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','[HTTP]','stringify','GET','authType','basic','password','username','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','type','nameField','customField','toLowerCase','toString','idField','custom_fields','content','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','Fields','%s/customers/%d/cases','stripTrailingSlash','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','trigger:browser:url','error'];(function(_0x230b38,_0x2532d0){var _0x4c5288=function(_0x4228dc){while(--_0x4228dc){_0x230b38['push'](_0x230b38['shift']());}};_0x4c5288(++_0x2532d0);}(_0x1485,0x77));var _0x5148=function(_0x4ee9c9,_0x4573f8){_0x4ee9c9=_0x4ee9c9-0x0;var _0x24e5b0=_0x1485[_0x4ee9c9];return _0x24e5b0;};'use strict';var _=require('lodash');var rp=require(_0x5148('0x0'));var md5=require(_0x5148('0x1'));var util=require(_0x5148('0x2'));var Redis=require('ioredis');var intUtil=require(_0x5148('0x3'));var config=require('../../../../config/environment');var logger=require(_0x5148('0x4'))(_0x5148('0x5'));config[_0x5148('0x6')]=_[_0x5148('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5148('0x8'))(new Redis(config[_0x5148('0x6')]));function emit(_0x1dbff4,_0x409311,_0x2d8ff0){io['to'](_0x1dbff4)['emit'](_0x409311,_0x2d8ff0);}var headers={'Content-Type':_0x5148('0x9'),'Accept':_0x5148('0x9')};function getUser(_0x46a6a4,_0x418bd1){logger['info'](_0x5148('0xa'),_0x418bd1);return request({'uri':util[_0x5148('0xb')](_0x5148('0xc'),_0x46a6a4[_0x5148('0xd')])})['then'](function(_0x25616d){if(_0x25616d[_0x5148('0xe')]){return _[_0x5148('0xf')](_0x25616d[_0x5148('0x10')][_0x5148('0x11')],{'email':_0x418bd1});}})[_0x5148('0x12')](function(_0x2292e4){if(_0x2292e4){logger[_0x5148('0x13')]('Agent\x20found!');return _0x2292e4;}else{logger['info'](_0x5148('0x14'));return request({'uri':util[_0x5148('0xb')](_0x5148('0x15'),_0x46a6a4[_0x5148('0xd')])});}});}function request(_0x5f2582){logger['debug'](_0x5148('0x16'),JSON[_0x5148('0x17')](_0x5f2582));return rp(_[_0x5148('0x7')](_0x5f2582,{'method':_0x5148('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x3c6d51){var _0x5e45c1;if(_0x3c6d51[_0x5148('0x19')]===_0x5148('0x1a')){_0x5e45c1=util[_0x5148('0xb')]('%s:%s',_0x3c6d51['username'],_0x3c6d51[_0x5148('0x1b')]);}else if(_0x3c6d51['authType']==='token'){_0x5e45c1=util[_0x5148('0xb')]('%s/token:%s',_0x3c6d51[_0x5148('0x1c')],_0x3c6d51['token']);}return util[_0x5148('0xb')](_0x5148('0x1d'),new Buffer(_0x5e45c1)['toString'](_0x5148('0x1e')));}function getEndUser(_0x1ffdc6,_0x40af5c,_0x394637){logger[_0x5148('0x13')](_0x5148('0x1f'),_0x394637);return request({'uri':util[_0x5148('0xb')](_0x5148('0x20'),_0x1ffdc6[_0x5148('0xd')]),'qs':{'phone':_0x394637}})['then'](function(_0x3dc4c0){if(_0x3dc4c0[_0x5148('0xe')]){logger[_0x5148('0x13')](_0x5148('0x21'));return _0x3dc4c0[_0x5148('0x10')][_0x5148('0x11')][0x0];}else{logger[_0x5148('0x13')](_0x5148('0x22'));return request({'uri':util[_0x5148('0xb')](_0x5148('0x23'),_0x1ffdc6[_0x5148('0xd')]),'method':_0x5148('0x24'),'body':{'first_name':_0x40af5c,'title':_0x40af5c,'phone_numbers':[{'type':_0x5148('0x25'),'value':_0x394637}]}});}});}function getTags(_0x45ef9f,_0xd2eb8e){var _0x1f500b=[];if(_0x45ef9f&&_0x45ef9f[_0x5148('0x26')]>0x0){_0x1f500b=_[_0x5148('0x27')](_0x45ef9f,_0xd2eb8e);}return _0x1f500b;}function getCustomFields(_0x2da4a9,_0x5236de){var _0x12aa16=[];var _0x25ef5e={'custom_fields':{}};if(_0x2da4a9[_0x5148('0x26')]>0x0){_['forEach'](_0x2da4a9,function(_0x1e9123){if(_0x1e9123[_0x5148('0x28')]==='string'&&_0x1e9123[_0x5148('0x29')]&&!_0x1e9123[_0x5148('0x2a')]){_0x25ef5e[_0x1e9123[_0x5148('0x29')][_0x5148('0x2b')]()]=_0x1e9123['content'][_0x5148('0x2c')]();}else if(_0x1e9123[_0x5148('0x28')]==='string'&&_0x1e9123[_0x5148('0x2d')]&&_0x1e9123[_0x5148('0x2a')]){_0x25ef5e[_0x5148('0x2e')][_0x1e9123['idField']]=_0x1e9123[_0x5148('0x2f')][_0x5148('0x2c')]();}else if(_0x1e9123[_0x5148('0x28')]==='variable'&&_0x1e9123[_0x5148('0x30')]&&_0x1e9123[_0x5148('0x2d')]&&_0x1e9123[_0x5148('0x2a')]){_0x5236de[_0x1e9123[_0x5148('0x30')]]&&(_0x25ef5e[_0x5148('0x2e')][_0x1e9123[_0x5148('0x2d')]]=_0x5236de[_0x1e9123[_0x5148('0x30')]][_0x5148('0x2c')]());}else if(_0x1e9123[_0x5148('0x28')]===_0x5148('0x31')&&_0x1e9123[_0x5148('0x32')]&&_0x1e9123[_0x5148('0x32')][_0x5148('0x33')]&&_0x1e9123[_0x5148('0x2d')]&&_0x1e9123['customField']){_0x5236de[_0x1e9123[_0x5148('0x32')][_0x5148('0x33')]['toLowerCase']()]&&(_0x25ef5e['custom_fields'][_0x1e9123[_0x5148('0x2d')]]=_0x5236de[_0x1e9123[_0x5148('0x32')][_0x5148('0x33')]['toLowerCase']()]['toString']());}});}if(_0x25ef5e[_0x5148('0x34')]){_0x25ef5e['priority']=Number(_0x25ef5e['priority']);}return _0x25ef5e;}function getTicket(_0x4490b3,_0x1ee6d0,_0x3ef3d7,_0x43ccb0,_0x67cb22){logger[_0x5148('0x13')](_0x5148('0x35'));var _0x2cf7e4=_[_0x5148('0x36')]({'subject':intUtil[_0x5148('0x37')](_0x43ccb0[_0x5148('0x38')],_0x67cb22,'\x20'),'type':_0x5148('0x39'),'status':_0x5148('0x3a'),'labels':[_0x5148('0x3b'),_0x5148('0x3c'),_0x5148('0x3d')][_0x5148('0x3e')](getTags(_0x43ccb0[_0x5148('0x3f')],'name')),'description':intUtil[_0x5148('0x37')](_0x43ccb0['Descriptions'],_0x67cb22,'\x0a'),'_links':{'assigned_user':{'href':util[_0x5148('0xb')](_0x5148('0x40'),_0x1ee6d0['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x43ccb0[_0x5148('0x41')],_0x67cb22,'\x0a')}},getCustomFields(_0x43ccb0[_0x5148('0x42')],_0x67cb22));return request({'uri':util[_0x5148('0xb')](_0x5148('0x43'),_0x4490b3['remoteUri'],_0x3ef3d7['id']),'method':_0x5148('0x24'),'body':_0x2cf7e4});}exports['queue']=function(_0x336d85,_0x23b60b,_0x39df91,_0x235783,_0x1557ea,_0x5e4d13){var _0x2eadd8,_0x4a0a5c;_0x5e4d13[_0x5148('0xd')]=intUtil[_0x5148('0x44')](_0x5e4d13[_0x5148('0xd')]);_0x5e4d13['serverUrl']=intUtil[_0x5148('0x44')](_0x5e4d13['serverUrl']);if(_0x1557ea&&_0x1557ea[_0x5148('0x45')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x23b60b['recordingURL']=util['format'](_0x5148('0x46'),_0x5e4d13[_0x5148('0x47')],_0x23b60b[_0x5148('0x48')],md5(_0x23b60b['uniqueid']));}else{_0x23b60b[_0x5148('0x49')]='';}headers[_0x5148('0x4a')]=getAuth(_0x5e4d13);return getUser(_0x5e4d13,_0x235783[_0x5148('0x4b')])[_0x5148('0x12')](function(_0x447283){_0x2eadd8=_0x447283;logger[_0x5148('0x13')](_0x5148('0x4c'),_0x2eadd8['id']);return getEndUser(_0x5e4d13,_0x23b60b[_0x5148('0x4d')],_0x23b60b[_0x5148('0x4e')]);})[_0x5148('0x12')](function(_0x553aff){_0x4a0a5c=_0x553aff;logger[_0x5148('0x13')](_0x5148('0x4f'),_0x4a0a5c['id']);return getTicket(_0x5e4d13,_0x2eadd8,_0x4a0a5c,_0x39df91,_0x23b60b);})[_0x5148('0x12')](function(_0x4dde46){if(_0x4dde46){logger['info'](_0x5148('0x50'));logger['info'](_0x5148('0x51'),_0x4dde46['id']);switch(_0x5e4d13[_0x5148('0x28')]){case'integrationTab':logger[_0x5148('0x13')](_0x5148('0x52'),_0x5148('0x53'));emit(util[_0x5148('0xb')]('user:%s',_0x235783['name']),'trigger:desk:display',{'recordId':_0x4dde46['id']});break;case _0x5148('0x54'):logger[_0x5148('0x13')](_0x5148('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x235783[_0x5148('0x33')]),_0x5148('0x55'),{'uri':util[_0x5148('0xb')]('https://xcally.desk.com/web/agent/case/%d',_0x4dde46['id'])});break;default:logger[_0x5148('0x56')](_0x5148('0x52'),_0x5148('0x57'));}}})[_0x5148('0x58')](function(_0x4cf0c2){console[_0x5148('0x56')](_0x4cf0c2);logger['error'](_0x5148('0x52'),JSON[_0x5148('0x17')](_0x4cf0c2));});};exports[_0x5148('0x59')]=function(_0xcd1108,_0x1ff250,_0x499f47,_0x118e3a,_0x43953a,_0x3f4ae6,_0xb1758c){var _0x6b953a,_0x27d360;_0x3f4ae6[_0x5148('0xd')]=intUtil[_0x5148('0x44')](_0x3f4ae6[_0x5148('0xd')]);_0x3f4ae6[_0x5148('0x47')]=intUtil[_0x5148('0x44')](_0x3f4ae6['serverUrl']);if(_0xb1758c&&_0xb1758c['recordingFormat']&&_0xb1758c[_0x5148('0x5a')]!==_0x5148('0x5b')){logger[_0x5148('0x13')](_0x5148('0x5c'),_0x5148('0x5d'));_0x1ff250[_0x5148('0x49')]=util['format'](_0x5148('0x46'),_0x3f4ae6[_0x5148('0x47')],_0x1ff250[_0x5148('0x48')],md5(_0x1ff250[_0x5148('0x48')]));}headers['Authorization']=getAuth(_0x3f4ae6);return getUser(_0x3f4ae6,_0x118e3a[_0x5148('0x4b')])[_0x5148('0x12')](function(_0x2e341c){_0x6b953a=_0x2e341c;logger[_0x5148('0x13')](_0x5148('0x4c'),_0x6b953a['id']);return getEndUser(_0x3f4ae6,_0x1ff250[_0x5148('0x5e')],_0x1ff250[_0x5148('0x5f')]);})['then'](function(_0x37fdca){_0x27d360=_0x37fdca;logger['info']('The\x20Enduser\x20ID\x20is:',_0x27d360['id']);return getTicket(_0x3f4ae6,_0x6b953a,_0x27d360,_0x499f47,_0x1ff250);})[_0x5148('0x12')](function(_0x3b8a9f){if(_0x3b8a9f){logger[_0x5148('0x13')](_0x5148('0x50'));logger[_0x5148('0x13')](_0x5148('0x51'),_0x3b8a9f['id']);switch(_0x3f4ae6[_0x5148('0x28')]){case _0x5148('0x60'):logger[_0x5148('0x13')](_0x5148('0x52'),_0x5148('0x53'));emit(util[_0x5148('0xb')](_0x5148('0x61'),_0x118e3a[_0x5148('0x33')]),_0x5148('0x62'),{'recordId':_0x3b8a9f['id']});break;case _0x5148('0x54'):logger[_0x5148('0x13')](_0x5148('0x52'),_0x5148('0x63'));emit(util[_0x5148('0xb')](_0x5148('0x61'),_0x118e3a[_0x5148('0x33')]),_0x5148('0x55'),{'uri':util['format'](_0x5148('0x64'),_0x3f4ae6[_0x5148('0xd')],_0x3b8a9f['id'])});break;default:logger[_0x5148('0x56')](_0x5148('0x5c'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x20180c){logger[_0x5148('0x56')](_0x5148('0x5c'),JSON[_0x5148('0x17')](_0x20180c));});};exports[_0x5148('0x65')]=function(_0x213659,_0x366e53,_0x15e2c5,_0x231c40,_0x34e0f1,_0x484f5e){var _0x10ecbe,_0x237d5d;_0x484f5e['remoteUri']=intUtil[_0x5148('0x44')](_0x484f5e[_0x5148('0xd')]);_0x484f5e[_0x5148('0x47')]=intUtil['stripTrailingSlash'](_0x484f5e['serverUrl']);if(_0x34e0f1&&_0x34e0f1['monitor_format']){logger[_0x5148('0x13')](_0x5148('0x66'),_0x5148('0x5d'));_0x366e53[_0x5148('0x49')]=util[_0x5148('0xb')](_0x5148('0x46'),_0x484f5e['serverUrl'],_0x366e53[_0x5148('0x48')],md5(_0x366e53[_0x5148('0x48')]));}else{_0x366e53[_0x5148('0x49')]='';}headers[_0x5148('0x4a')]=getAuth(_0x484f5e);return getUser(_0x484f5e)['then'](function(_0x3350c4){_0x10ecbe=_0x3350c4;logger[_0x5148('0x13')](_0x5148('0x4c'),_0x10ecbe['id']);return getEndUser(_0x484f5e,_0x366e53['calleridname'],_0x366e53[_0x5148('0x4e')]);})['then'](function(_0x2a9b18){_0x237d5d=_0x2a9b18;logger[_0x5148('0x13')](_0x5148('0x4f'),_0x237d5d['id']);return getTicket(_0x484f5e,_0x10ecbe,_0x237d5d,_0x15e2c5,_0x366e53);})[_0x5148('0x12')](function(_0x264d7e){if(_0x264d7e){logger['info'](_0x5148('0x50'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x264d7e['id']);}})[_0x5148('0x58')](function(_0x1ca7a1){logger[_0x5148('0x56')]('[ABANDONED]',JSON['stringify'](_0x1ca7a1));});};
\ No newline at end of file
index 6b16dfa..78f1625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3f3=['debug','[HTTP]','stringify','GET','map','forEach','type','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','abandoned','catch','lodash','request-promise','md5','util','./util','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','<br>','name','Fields','custom_fields','mapValues','value','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xe3f3,0xdb));var _0x3e3f=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xe3f3[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x3e3f('0x0'));var rp=require(_0x3e3f('0x1'));var md5=require(_0x3e3f('0x2'));var util=require(_0x3e3f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3e3f('0x4'));var config=require(_0x3e3f('0x5'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_[_0x3e3f('0x6')](config['redis'],{'host':_0x3e3f('0x7'),'port':0x18eb});var io=require(_0x3e3f('0x8'))(new Redis(config[_0x3e3f('0x9')]));var headers={'Content-Type':_0x3e3f('0xa'),'Accept':_0x3e3f('0xa')};function emit(_0x1b971f,_0x5bda83,_0x1663d6){io['to'](_0x1b971f)['emit'](_0x5bda83,_0x1663d6);}function getTicket(_0x2bd2c8,_0x34cfd0,_0x347a34,_0x494e63,_0x3fc577){logger[_0x3e3f('0xb')](_0x3e3f('0xc'));var _0x53706c=_[_0x3e3f('0xd')]({'responder_id':_0x34cfd0['id'],'requester_id':_0x347a34['id'],'name':util[_0x3e3f('0xe')](_0x3e3f('0xf'),_0x3fc577['calleridname']),'phone':_0x3fc577[_0x3e3f('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3e3f('0x11')](_0x494e63[_0x3e3f('0x12')],_0x3fc577,'\x20'),'description':intUtil['getString'](_0x494e63[_0x3e3f('0x13')],_0x3fc577,_0x3e3f('0x14')),'tags':getTags(_0x494e63['Tags'],_0x3e3f('0x15'))},getCustomFields(_0x494e63[_0x3e3f('0x16')],_0x3fc577));_0x53706c[_0x3e3f('0x17')]=_[_0x3e3f('0x18')](_['keyBy'](_0x53706c[_0x3e3f('0x17')],'id'),_0x3e3f('0x19'));return request({'uri':util[_0x3e3f('0xe')]('%s/api/v2/tickets',_0x2bd2c8[_0x3e3f('0x1a')]),'method':_0x3e3f('0x1b'),'body':_0x53706c})[_0x3e3f('0x1c')](function(_0xc327b5){logger['info'](_0x3e3f('0x1d'));return _0xc327b5;});}function getUser(_0x43ea9e,_0x3ec097){logger['info']('Getting\x20agent\x20with\x20email',_0x3ec097);return request({'uri':util[_0x3e3f('0xe')](_0x3e3f('0x1e'),_0x43ea9e[_0x3e3f('0x1a')]),'qs':{'email':_0x3ec097}})[_0x3e3f('0x1c')](function(_0x436882){if(_0x436882[_0x3e3f('0x1f')]){logger[_0x3e3f('0xb')]('Agent\x20found!');return _[_0x3e3f('0x20')](_0x436882,function(_0x2d9c76){return _0x2d9c76[_0x3e3f('0x21')]['email']===_0x3ec097;});}else{logger[_0x3e3f('0xb')](_0x3e3f('0x22'));return request({'uri':util[_0x3e3f('0xe')]('%s/api/v2/agents/me',_0x43ea9e[_0x3e3f('0x1a')])})[_0x3e3f('0x1c')](function(_0x517862){logger[_0x3e3f('0xb')](_0x3e3f('0x23'));return _0x517862;});}});}function getEndUser(_0x482dd0,_0x4fdedd,_0x1e36fd){logger[_0x3e3f('0xb')](_0x3e3f('0x24'),_0x1e36fd);return request({'uri':util[_0x3e3f('0xe')](_0x3e3f('0x25'),_0x482dd0['remoteUri']),'qs':{'phone':_0x1e36fd}})['then'](function(_0x43df52){if(_0x43df52[_0x3e3f('0x1f')]){logger[_0x3e3f('0xb')](_0x3e3f('0x26'));return _[_0x3e3f('0x20')](_0x43df52,{'phone':_0x1e36fd});}else{logger['info'](_0x3e3f('0x27'));return request({'uri':util[_0x3e3f('0xe')](_0x3e3f('0x25'),_0x482dd0[_0x3e3f('0x1a')]),'method':_0x3e3f('0x1b'),'body':{'name':_0x4fdedd,'phone':_0x1e36fd}})[_0x3e3f('0x1c')](function(_0x2d1640){logger['info'](_0x3e3f('0x28'));return _0x2d1640;});}});}function getAuth(_0x3b55f9){return util['format'](_0x3e3f('0x29'),new Buffer(_0x3b55f9[_0x3e3f('0x2a')]+':X')[_0x3e3f('0x2b')](_0x3e3f('0x2c')));}function request(_0x4577a8){logger[_0x3e3f('0x2d')](_0x3e3f('0x2e'),JSON[_0x3e3f('0x2f')](_0x4577a8));return rp(_[_0x3e3f('0x6')](_0x4577a8,{'method':_0x3e3f('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x4a983b,_0x1c8db8){var _0x29a93b=[];if(_0x4a983b&&_0x4a983b['length']>0x0){_0x29a93b=_[_0x3e3f('0x31')](_0x4a983b,_0x1c8db8);}return _0x29a93b;}function getCustomFields(_0x518eff,_0x24c89f){var _0x4bda15=[];var _0x72c6f1={'custom_fields':[]};if(_0x518eff[_0x3e3f('0x1f')]>0x0){_[_0x3e3f('0x32')](_0x518eff,function(_0x24d9b3){if(_0x24d9b3[_0x3e3f('0x33')]==='string'&&_0x24d9b3[_0x3e3f('0x34')]&&!_0x24d9b3[_0x3e3f('0x35')]){_0x72c6f1[_0x24d9b3['nameField'][_0x3e3f('0x36')]()]=_0x24d9b3[_0x3e3f('0x37')][_0x3e3f('0x2b')]();}else if(_0x24d9b3[_0x3e3f('0x33')]==='string'&&_0x24d9b3['idField']&&_0x24d9b3[_0x3e3f('0x35')]){_0x72c6f1[_0x3e3f('0x17')]['push']({'id':_0x24d9b3[_0x3e3f('0x38')],'value':_0x24d9b3[_0x3e3f('0x37')][_0x3e3f('0x2b')]()});}else if(_0x24d9b3[_0x3e3f('0x33')]===_0x3e3f('0x39')&&_0x24d9b3['variableName']&&_0x24d9b3[_0x3e3f('0x38')]&&_0x24d9b3[_0x3e3f('0x35')]){_0x24c89f[_0x24d9b3[_0x3e3f('0x3a')]]&&_0x72c6f1[_0x3e3f('0x17')][_0x3e3f('0x3b')]({'id':_0x24d9b3['idField'],'value':_0x24c89f[_0x24d9b3[_0x3e3f('0x3a')]][_0x3e3f('0x2b')]()});}else if(_0x24d9b3[_0x3e3f('0x33')]===_0x3e3f('0x3c')&&_0x24d9b3['Variable']&&_0x24d9b3['Variable'][_0x3e3f('0x15')]&&_0x24d9b3[_0x3e3f('0x38')]&&_0x24d9b3['customField']){_0x24c89f[_0x24d9b3[_0x3e3f('0x3d')][_0x3e3f('0x15')][_0x3e3f('0x36')]()]&&_0x72c6f1['custom_fields'][_0x3e3f('0x3b')]({'id':_0x24d9b3[_0x3e3f('0x38')],'value':_0x24c89f[_0x24d9b3[_0x3e3f('0x3d')]['name'][_0x3e3f('0x36')]()][_0x3e3f('0x2b')]()});}});}return _0x72c6f1;}exports[_0x3e3f('0x3e')]=function(_0xca2a3d,_0x56c96d,_0x4db12f,_0x57423f,_0x5d06e6,_0x16156b){var _0x405c82,_0x4d0098;_0x16156b['remoteUri']=intUtil[_0x3e3f('0x3f')](_0x16156b[_0x3e3f('0x1a')]);_0x16156b[_0x3e3f('0x40')]=intUtil[_0x3e3f('0x3f')](_0x16156b[_0x3e3f('0x40')]);if(_0x5d06e6&&_0x5d06e6['monitor_format']){logger[_0x3e3f('0xb')](_0x3e3f('0x41'),_0x3e3f('0x42'));_0x56c96d[_0x3e3f('0x43')]=util[_0x3e3f('0xe')](_0x3e3f('0x44'),_0x16156b[_0x3e3f('0x40')],_0x56c96d['uniqueid'],md5(_0x56c96d[_0x3e3f('0x45')]));}else{_0x56c96d['recordingURL']='';}headers[_0x3e3f('0x46')]=getAuth(_0x16156b);return getUser(_0x16156b,_0x57423f[_0x3e3f('0x47')])['then'](function(_0x28d70e){_0x405c82=_0x28d70e;logger[_0x3e3f('0xb')]('The\x20User\x20ID\x20is:',_0x405c82['id']);return getEndUser(_0x16156b,_0x56c96d['calleridname'],_0x56c96d[_0x3e3f('0x10')]);})['then'](function(_0x2d94d6){_0x4d0098=_0x2d94d6;logger[_0x3e3f('0xb')](_0x3e3f('0x48'),_0x4d0098['id']);return getTicket(_0x16156b,_0x405c82,_0x4d0098,_0x4db12f,_0x56c96d);})['then'](function(_0x87eab){if(_0x87eab&&_0x87eab['id']){logger['info'](_0x3e3f('0x1d'));logger[_0x3e3f('0xb')](_0x3e3f('0x49'),_0x87eab['id']);logger[_0x3e3f('0xb')]('[QUEUE]',_0x3e3f('0x4a'));emit(util[_0x3e3f('0xe')](_0x3e3f('0x4b'),_0x57423f[_0x3e3f('0x15')]),_0x3e3f('0x4c'),{'uri':util[_0x3e3f('0xe')]('%s/helpdesk/tickets/%d',_0x16156b[_0x3e3f('0x1a')],_0x87eab['id'])});}})['catch'](function(_0x136e1c){logger[_0x3e3f('0x4d')]('[QUEUE]',JSON[_0x3e3f('0x2f')](_0x136e1c));});};exports[_0x3e3f('0x4e')]=function(_0x467ae9,_0x542446,_0x2461d5,_0x44a1d4,_0x55e7da,_0x1019b8,_0x28d0f2){var _0x484e2d,_0x551b8e;_0x1019b8[_0x3e3f('0x1a')]=intUtil[_0x3e3f('0x3f')](_0x1019b8[_0x3e3f('0x1a')]);_0x1019b8['serverUrl']=intUtil['stripTrailingSlash'](_0x1019b8['serverUrl']);if(_0x28d0f2&&_0x28d0f2[_0x3e3f('0x4f')]&&_0x28d0f2[_0x3e3f('0x4f')]!==_0x3e3f('0x50')){logger[_0x3e3f('0xb')](_0x3e3f('0x51'),_0x3e3f('0x42'));_0x542446[_0x3e3f('0x43')]=util[_0x3e3f('0xe')](_0x3e3f('0x44'),_0x1019b8[_0x3e3f('0x40')],_0x542446[_0x3e3f('0x45')],md5(_0x542446[_0x3e3f('0x45')]));}headers[_0x3e3f('0x46')]=getAuth(_0x1019b8);return getUser(_0x1019b8,_0x44a1d4[_0x3e3f('0x47')])[_0x3e3f('0x1c')](function(_0xee2e82){_0x484e2d=_0xee2e82;logger['info'](_0x3e3f('0x52'),_0x484e2d['id']);return getEndUser(_0x1019b8,_0x542446[_0x3e3f('0x53')],_0x542446[_0x3e3f('0x54')]);})[_0x3e3f('0x1c')](function(_0x3dfa2a){_0x551b8e=_0x3dfa2a;logger[_0x3e3f('0xb')](_0x3e3f('0x48'),_0x551b8e['id']);return getTicket(_0x1019b8,_0x484e2d,_0x551b8e,_0x2461d5,_0x542446);})[_0x3e3f('0x1c')](function(_0x3886a4){if(_0x3886a4&&_0x3886a4['id']){logger[_0x3e3f('0xb')]('Ticket\x20created!');logger['info'](_0x3e3f('0x49'),_0x3886a4['id']);logger[_0x3e3f('0xb')](_0x3e3f('0x51'),_0x3e3f('0x4a'));emit(util[_0x3e3f('0xe')]('user:%s',_0x44a1d4[_0x3e3f('0x15')]),_0x3e3f('0x4c'),{'uri':util['format'](_0x3e3f('0x55'),_0x1019b8['remoteUri'],_0x3886a4['id'])});}})['catch'](function(_0x3f63bc){logger[_0x3e3f('0x4d')](_0x3e3f('0x51'),JSON[_0x3e3f('0x2f')](_0x3f63bc));});};exports[_0x3e3f('0x56')]=function(_0x1f5ad3,_0x22276e,_0x3d631b,_0x147cea,_0x3051f5,_0x328e73){var _0x55fae0,_0xa4c83b;_0x328e73[_0x3e3f('0x1a')]=intUtil[_0x3e3f('0x3f')](_0x328e73['remoteUri']);_0x328e73['serverUrl']=intUtil[_0x3e3f('0x3f')](_0x328e73['serverUrl']);if(_0x3051f5&&_0x3051f5['monitor_format']){logger[_0x3e3f('0xb')]('[ABANDONED]',_0x3e3f('0x42'));_0x22276e['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x328e73[_0x3e3f('0x40')],_0x22276e[_0x3e3f('0x45')],md5(_0x22276e[_0x3e3f('0x45')]));}else{_0x22276e[_0x3e3f('0x43')]='';}headers[_0x3e3f('0x46')]=getAuth(_0x328e73);return getUser(_0x328e73,_0x147cea[_0x3e3f('0x47')])[_0x3e3f('0x1c')](function(_0x5b1854){_0x55fae0=_0x5b1854;logger[_0x3e3f('0xb')]('The\x20User\x20ID\x20is:',_0x55fae0['id']);return getEndUser(_0x328e73,_0x22276e['calleridname'],_0x22276e[_0x3e3f('0x10')]);})['then'](function(_0x168340){_0xa4c83b=_0x168340;logger[_0x3e3f('0xb')]('The\x20Enduser\x20ID\x20is:',_0xa4c83b['id']);return getTicket(_0x328e73,_0x55fae0,_0xa4c83b,_0x3d631b,_0x22276e);})['then'](function(_0x13e962){if(_0x13e962){logger['info']('Ticket\x20created!');logger[_0x3e3f('0xb')]('The\x20Ticket\x20ID\x20is:',_0x13e962['id']);}})[_0x3e3f('0x57')](function(_0x37722c){logger[_0x3e3f('0x4d')]('[ABANDONED]',JSON['stringify'](_0x37722c));});};
\ No newline at end of file
+var _0xf0dc=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','catch','abandoned','[ABANDONED]','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','<br>','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','Getting\x20agent\x20with\x20email','%s/api/v2/agents','then','Agent\x20found!','find','contact','email','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','base64','debug','length','forEach','type','string','nameField','customField','toLowerCase','content','toString','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x1f6236,_0x3837f2){var _0x45507d=function(_0x4516d6){while(--_0x4516d6){_0x1f6236['push'](_0x1f6236['shift']());}};_0x45507d(++_0x3837f2);}(_0xf0dc,0xd0));var _0xcf0d=function(_0x3d9a94,_0x457487){_0x3d9a94=_0x3d9a94-0x0;var _0x42d7ea=_0xf0dc[_0x3d9a94];return _0x42d7ea;};'use strict';var _=require(_0xcf0d('0x0'));var rp=require('request-promise');var md5=require(_0xcf0d('0x1'));var util=require(_0xcf0d('0x2'));var Redis=require(_0xcf0d('0x3'));var intUtil=require(_0xcf0d('0x4'));var config=require(_0xcf0d('0x5'));var logger=require(_0xcf0d('0x6'))(_0xcf0d('0x7'));config['redis']=_[_0xcf0d('0x8')](config[_0xcf0d('0x9')],{'host':_0xcf0d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcf0d('0x9')]));var headers={'Content-Type':_0xcf0d('0xb'),'Accept':'application/json'};function emit(_0x4b02b4,_0x26afc8,_0x3c4dd9){io['to'](_0x4b02b4)[_0xcf0d('0xc')](_0x26afc8,_0x3c4dd9);}function getTicket(_0x2edaf5,_0x5b1680,_0x1edd90,_0x10dac2,_0x20cb36){logger[_0xcf0d('0xd')](_0xcf0d('0xe'));var _0x5e3abe=_[_0xcf0d('0xf')]({'responder_id':_0x5b1680['id'],'requester_id':_0x1edd90['id'],'name':util[_0xcf0d('0x10')](_0xcf0d('0x11'),_0x20cb36['calleridname']),'phone':_0x20cb36[_0xcf0d('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcf0d('0x13')](_0x10dac2[_0xcf0d('0x14')],_0x20cb36,'\x20'),'description':intUtil[_0xcf0d('0x13')](_0x10dac2['Descriptions'],_0x20cb36,_0xcf0d('0x15')),'tags':getTags(_0x10dac2['Tags'],_0xcf0d('0x16'))},getCustomFields(_0x10dac2[_0xcf0d('0x17')],_0x20cb36));_0x5e3abe['custom_fields']=_[_0xcf0d('0x18')](_[_0xcf0d('0x19')](_0x5e3abe[_0xcf0d('0x1a')],'id'),_0xcf0d('0x1b'));return request({'uri':util[_0xcf0d('0x10')](_0xcf0d('0x1c'),_0x2edaf5[_0xcf0d('0x1d')]),'method':_0xcf0d('0x1e'),'body':_0x5e3abe})['then'](function(_0x168e7a){logger[_0xcf0d('0xd')]('Ticket\x20created!');return _0x168e7a;});}function getUser(_0x1d84f8,_0x59afe9){logger[_0xcf0d('0xd')](_0xcf0d('0x1f'),_0x59afe9);return request({'uri':util[_0xcf0d('0x10')](_0xcf0d('0x20'),_0x1d84f8[_0xcf0d('0x1d')]),'qs':{'email':_0x59afe9}})[_0xcf0d('0x21')](function(_0x46d179){if(_0x46d179['length']){logger[_0xcf0d('0xd')](_0xcf0d('0x22'));return _[_0xcf0d('0x23')](_0x46d179,function(_0x1e7f3a){return _0x1e7f3a[_0xcf0d('0x24')][_0xcf0d('0x25')]===_0x59afe9;});}else{logger[_0xcf0d('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xcf0d('0x10')]('%s/api/v2/agents/me',_0x1d84f8[_0xcf0d('0x1d')])})[_0xcf0d('0x21')](function(_0x1cb114){logger[_0xcf0d('0xd')](_0xcf0d('0x26'));return _0x1cb114;});}});}function getEndUser(_0x4ad4b8,_0x282ade,_0x903c02){logger['info']('Searching\x20enduser\x20with\x20phone',_0x903c02);return request({'uri':util['format'](_0xcf0d('0x27'),_0x4ad4b8['remoteUri']),'qs':{'phone':_0x903c02}})[_0xcf0d('0x21')](function(_0x7f7295){if(_0x7f7295['length']){logger[_0xcf0d('0xd')](_0xcf0d('0x28'));return _['find'](_0x7f7295,{'phone':_0x903c02});}else{logger[_0xcf0d('0xd')](_0xcf0d('0x29'));return request({'uri':util[_0xcf0d('0x10')](_0xcf0d('0x27'),_0x4ad4b8[_0xcf0d('0x1d')]),'method':_0xcf0d('0x1e'),'body':{'name':_0x282ade,'phone':_0x903c02}})['then'](function(_0x33cb24){logger[_0xcf0d('0xd')](_0xcf0d('0x2a'));return _0x33cb24;});}});}function getAuth(_0x2386e1){return util[_0xcf0d('0x10')]('Basic\x20%s',new Buffer(_0x2386e1[_0xcf0d('0x2b')]+':X')['toString'](_0xcf0d('0x2c')));}function request(_0x16d1eb){logger[_0xcf0d('0x2d')]('[HTTP]',JSON['stringify'](_0x16d1eb));return rp(_[_0xcf0d('0x8')](_0x16d1eb,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x386559,_0x86e6c){var _0x4910b1=[];if(_0x386559&&_0x386559[_0xcf0d('0x2e')]>0x0){_0x4910b1=_['map'](_0x386559,_0x86e6c);}return _0x4910b1;}function getCustomFields(_0x517df4,_0x80e8e9){var _0x2d8d49=[];var _0x4214a0={'custom_fields':[]};if(_0x517df4['length']>0x0){_[_0xcf0d('0x2f')](_0x517df4,function(_0x135d4b){if(_0x135d4b[_0xcf0d('0x30')]===_0xcf0d('0x31')&&_0x135d4b[_0xcf0d('0x32')]&&!_0x135d4b[_0xcf0d('0x33')]){_0x4214a0[_0x135d4b[_0xcf0d('0x32')][_0xcf0d('0x34')]()]=_0x135d4b[_0xcf0d('0x35')][_0xcf0d('0x36')]();}else if(_0x135d4b['type']===_0xcf0d('0x31')&&_0x135d4b[_0xcf0d('0x37')]&&_0x135d4b['customField']){_0x4214a0[_0xcf0d('0x1a')][_0xcf0d('0x38')]({'id':_0x135d4b[_0xcf0d('0x37')],'value':_0x135d4b[_0xcf0d('0x35')][_0xcf0d('0x36')]()});}else if(_0x135d4b[_0xcf0d('0x30')]===_0xcf0d('0x39')&&_0x135d4b['variableName']&&_0x135d4b[_0xcf0d('0x37')]&&_0x135d4b['customField']){_0x80e8e9[_0x135d4b['variableName']]&&_0x4214a0[_0xcf0d('0x1a')][_0xcf0d('0x38')]({'id':_0x135d4b['idField'],'value':_0x80e8e9[_0x135d4b[_0xcf0d('0x3a')]][_0xcf0d('0x36')]()});}else if(_0x135d4b[_0xcf0d('0x30')]===_0xcf0d('0x3b')&&_0x135d4b[_0xcf0d('0x3c')]&&_0x135d4b[_0xcf0d('0x3c')][_0xcf0d('0x16')]&&_0x135d4b[_0xcf0d('0x37')]&&_0x135d4b[_0xcf0d('0x33')]){_0x80e8e9[_0x135d4b['Variable'][_0xcf0d('0x16')]['toLowerCase']()]&&_0x4214a0[_0xcf0d('0x1a')][_0xcf0d('0x38')]({'id':_0x135d4b['idField'],'value':_0x80e8e9[_0x135d4b['Variable']['name'][_0xcf0d('0x34')]()]['toString']()});}});}return _0x4214a0;}exports[_0xcf0d('0x3d')]=function(_0x34a6bb,_0x56cbf0,_0x545d5a,_0x208778,_0x4f10a5,_0xff0fbc){var _0x476ea8,_0x3d075b;_0xff0fbc[_0xcf0d('0x1d')]=intUtil[_0xcf0d('0x3e')](_0xff0fbc[_0xcf0d('0x1d')]);_0xff0fbc[_0xcf0d('0x3f')]=intUtil['stripTrailingSlash'](_0xff0fbc[_0xcf0d('0x3f')]);if(_0x4f10a5&&_0x4f10a5[_0xcf0d('0x40')]){logger['info'](_0xcf0d('0x41'),_0xcf0d('0x42'));_0x56cbf0[_0xcf0d('0x43')]=util[_0xcf0d('0x10')](_0xcf0d('0x44'),_0xff0fbc[_0xcf0d('0x3f')],_0x56cbf0[_0xcf0d('0x45')],md5(_0x56cbf0['uniqueid']));}else{_0x56cbf0['recordingURL']='';}headers[_0xcf0d('0x46')]=getAuth(_0xff0fbc);return getUser(_0xff0fbc,_0x208778[_0xcf0d('0x25')])['then'](function(_0x3c9b3a){_0x476ea8=_0x3c9b3a;logger[_0xcf0d('0xd')](_0xcf0d('0x47'),_0x476ea8['id']);return getEndUser(_0xff0fbc,_0x56cbf0['calleridname'],_0x56cbf0[_0xcf0d('0x12')]);})[_0xcf0d('0x21')](function(_0x4f363f){_0x3d075b=_0x4f363f;logger[_0xcf0d('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3d075b['id']);return getTicket(_0xff0fbc,_0x476ea8,_0x3d075b,_0x545d5a,_0x56cbf0);})[_0xcf0d('0x21')](function(_0x10c443){if(_0x10c443&&_0x10c443['id']){logger['info'](_0xcf0d('0x48'));logger['info'](_0xcf0d('0x49'),_0x10c443['id']);logger[_0xcf0d('0xd')]('[QUEUE]',_0xcf0d('0x4a'));emit(util['format'](_0xcf0d('0x4b'),_0x208778[_0xcf0d('0x16')]),_0xcf0d('0x4c'),{'uri':util[_0xcf0d('0x10')](_0xcf0d('0x4d'),_0xff0fbc[_0xcf0d('0x1d')],_0x10c443['id'])});}})['catch'](function(_0x3fa153){logger[_0xcf0d('0x4e')](_0xcf0d('0x41'),JSON[_0xcf0d('0x4f')](_0x3fa153));});};exports[_0xcf0d('0x50')]=function(_0xbdd268,_0x4ac248,_0x136f23,_0x19cfa8,_0xa7512,_0x1a6411,_0x45a31a){var _0x227534,_0x1a2de3;_0x1a6411[_0xcf0d('0x1d')]=intUtil[_0xcf0d('0x3e')](_0x1a6411[_0xcf0d('0x1d')]);_0x1a6411[_0xcf0d('0x3f')]=intUtil[_0xcf0d('0x3e')](_0x1a6411[_0xcf0d('0x3f')]);if(_0x45a31a&&_0x45a31a[_0xcf0d('0x51')]&&_0x45a31a['recordingFormat']!==_0xcf0d('0x52')){logger[_0xcf0d('0xd')](_0xcf0d('0x53'),'Recording\x20is\x20enabled!');_0x4ac248['recordingURL']=util['format'](_0xcf0d('0x44'),_0x1a6411[_0xcf0d('0x3f')],_0x4ac248[_0xcf0d('0x45')],md5(_0x4ac248[_0xcf0d('0x45')]));}headers[_0xcf0d('0x46')]=getAuth(_0x1a6411);return getUser(_0x1a6411,_0x19cfa8['email'])[_0xcf0d('0x21')](function(_0x9cda65){_0x227534=_0x9cda65;logger[_0xcf0d('0xd')](_0xcf0d('0x47'),_0x227534['id']);return getEndUser(_0x1a6411,_0x4ac248[_0xcf0d('0x54')],_0x4ac248[_0xcf0d('0x55')]);})['then'](function(_0x398ca2){_0x1a2de3=_0x398ca2;logger['info'](_0xcf0d('0x56'),_0x1a2de3['id']);return getTicket(_0x1a6411,_0x227534,_0x1a2de3,_0x136f23,_0x4ac248);})[_0xcf0d('0x21')](function(_0xd0f55c){if(_0xd0f55c&&_0xd0f55c['id']){logger[_0xcf0d('0xd')](_0xcf0d('0x48'));logger[_0xcf0d('0xd')](_0xcf0d('0x49'),_0xd0f55c['id']);logger[_0xcf0d('0xd')](_0xcf0d('0x53'),_0xcf0d('0x4a'));emit(util[_0xcf0d('0x10')](_0xcf0d('0x4b'),_0x19cfa8[_0xcf0d('0x16')]),_0xcf0d('0x4c'),{'uri':util[_0xcf0d('0x10')](_0xcf0d('0x4d'),_0x1a6411[_0xcf0d('0x1d')],_0xd0f55c['id'])});}})[_0xcf0d('0x57')](function(_0x22a2cb){logger[_0xcf0d('0x4e')](_0xcf0d('0x53'),JSON[_0xcf0d('0x4f')](_0x22a2cb));});};exports[_0xcf0d('0x58')]=function(_0x454759,_0x30055a,_0x38b6d8,_0x36f448,_0x57e07b,_0x1600a5){var _0x26f6dd,_0x583fb3;_0x1600a5['remoteUri']=intUtil[_0xcf0d('0x3e')](_0x1600a5[_0xcf0d('0x1d')]);_0x1600a5[_0xcf0d('0x3f')]=intUtil[_0xcf0d('0x3e')](_0x1600a5['serverUrl']);if(_0x57e07b&&_0x57e07b['monitor_format']){logger[_0xcf0d('0xd')](_0xcf0d('0x59'),_0xcf0d('0x42'));_0x30055a['recordingURL']=util[_0xcf0d('0x10')](_0xcf0d('0x44'),_0x1600a5[_0xcf0d('0x3f')],_0x30055a[_0xcf0d('0x45')],md5(_0x30055a[_0xcf0d('0x45')]));}else{_0x30055a[_0xcf0d('0x43')]='';}headers['Authorization']=getAuth(_0x1600a5);return getUser(_0x1600a5,_0x36f448['email'])[_0xcf0d('0x21')](function(_0x1e1652){_0x26f6dd=_0x1e1652;logger[_0xcf0d('0xd')](_0xcf0d('0x47'),_0x26f6dd['id']);return getEndUser(_0x1600a5,_0x30055a[_0xcf0d('0x5a')],_0x30055a[_0xcf0d('0x12')]);})[_0xcf0d('0x21')](function(_0xe840c0){_0x583fb3=_0xe840c0;logger['info'](_0xcf0d('0x56'),_0x583fb3['id']);return getTicket(_0x1600a5,_0x26f6dd,_0x583fb3,_0x38b6d8,_0x30055a);})['then'](function(_0x3222dd){if(_0x3222dd){logger[_0xcf0d('0xd')](_0xcf0d('0x48'));logger[_0xcf0d('0xd')](_0xcf0d('0x49'),_0x3222dd['id']);}})[_0xcf0d('0x57')](function(_0x45a015){logger['error']('[ABANDONED]',JSON[_0xcf0d('0x4f')](_0x45a015));});};
\ No newline at end of file
index ece17cf..54ea37d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa54e=['error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','salesforce','zoho','vtiger','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','zendesk','sugarcrm','freshdesk','desk','unknown\x20integration','../../../../config/logger'];(function(_0x3a85ab,_0x1f3525){var _0x32d91a=function(_0x216ab1){while(--_0x216ab1){_0x3a85ab['push'](_0x3a85ab['shift']());}};_0x32d91a(++_0x1f3525);}(_0xa54e,0x1d3));var _0xea54=function(_0xac56ce,_0xb73e4){_0xac56ce=_0xac56ce-0x0;var _0x5105e1=_0xa54e[_0xac56ce];return _0x5105e1;};'use strict';var _=require(_0xea54('0x0'));var util=require(_0xea54('0x1'));var zendesk=require(_0xea54('0x2'));var salesforce=require(_0xea54('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xea54('0x4'));var zoho=require(_0xea54('0x5'));var desk=require(_0xea54('0x6'));var vtiger=require(_0xea54('0x7'));var integrations=['zendesk',_0xea54('0x8'),'sugarcrm','freshdesk',_0xea54('0x9'),'desk',_0xea54('0xa')];exports[_0xea54('0xb')]=function(_0x368436,_0x44ed80,_0x1971c9,_0x38b7d7,_0x7db7f8,_0x500c87){if(_0x1971c9){if(_[_0xea54('0xc')](integrations,_0x368436['data1']['toLowerCase']())){try{var _0x4aa031=null;var _0x1bc1c3='';var _0x2f1ed6=_0x1971c9[_0x368436[_0xea54('0xd')][_0xea54('0xe')]()];if(_0x2f1ed6){var _0x355055=_0x2f1ed6[_0x368436[_0xea54('0xf')]];if(_0x355055){var _0x3b8dd5=_['find'](_0x355055[_0xea54('0x10')],{'id':parseInt(_0x368436[_0xea54('0x11')],0xa)});if(_0x3b8dd5){if(_0x38b7d7){if(_0x7db7f8&&_0x44ed80[_0xea54('0x12')]){_0x1bc1c3=_0xea54('0x12');}else if(_0x44ed80['routeId']){_0x1bc1c3=_0xea54('0x13');}else{console[_0xea54('0x14')](_0xea54('0x15'),_0x44ed80);}}else{_0x1bc1c3='abandoned';}switch(_0x368436[_0xea54('0xd')][_0xea54('0xe')]()){case _0xea54('0x16'):zendesk[_0x1bc1c3](_0x368436,_0x44ed80,_0x3b8dd5,_0x38b7d7,_0x7db7f8,_0x355055,_0x500c87);break;case _0xea54('0x8'):salesforce[_0x1bc1c3](_0x368436,_0x44ed80,_0x3b8dd5,_0x38b7d7,_0x7db7f8,_0x355055,_0x500c87);break;case _0xea54('0x17'):sugarcrm[_0x1bc1c3](_0x368436,_0x44ed80,_0x3b8dd5,_0x38b7d7,_0x7db7f8,_0x355055,_0x500c87);break;case _0xea54('0x18'):freshdesk[_0x1bc1c3](_0x368436,_0x44ed80,_0x3b8dd5,_0x38b7d7,_0x7db7f8,_0x355055,_0x500c87);break;case _0xea54('0x9'):zoho[_0x1bc1c3](_0x368436,_0x44ed80,_0x3b8dd5,_0x38b7d7,_0x7db7f8,_0x355055,_0x500c87);break;case _0xea54('0x19'):desk[_0x1bc1c3](_0x368436,_0x44ed80,_0x3b8dd5,_0x38b7d7,_0x7db7f8,_0x355055,_0x500c87);break;case _0xea54('0xa'):vtiger[_0x1bc1c3](_0x368436,_0x44ed80,_0x3b8dd5,_0x38b7d7,_0x7db7f8,_0x355055,_0x500c87);break;default:console['log'](_0xea54('0x1a'));}}else{_0x4aa031=require(_0xea54('0x1b'))(_0x368436[_0xea54('0xd')][_0xea54('0xe')]());_0x4aa031[_0xea54('0x1c')](_0xea54('0x1d'),util[_0xea54('0x1e')](_0xea54('0x1f'),_0x368436[_0xea54('0xd')][_0xea54('0xe')](),_0x368436[_0xea54('0x11')]));}}else{_0x4aa031=require('../../../../config/logger')(_0x368436[_0xea54('0xd')][_0xea54('0xe')]());_0x4aa031[_0xea54('0x1c')](_0xea54('0x1d'),util[_0xea54('0x1e')](_0xea54('0x20'),_0x368436[_0xea54('0xd')]['toLowerCase'](),_0x368436[_0xea54('0xf')]));}}else{}}catch(_0x335170){console[_0xea54('0x1c')](_0x335170);}}}};
\ No newline at end of file
+var _0x1565=['zendesk','salesforce','freshdesk','zoho','desk','vtiger','exec','data1','toLowerCase','data2','data3','queue','routeId','outbound','log','abandoned','sugarcrm','../../../../config/logger','format','[EXEC]','%s\x20account\x20#%s\x20not\x20found','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger'];(function(_0x87e48b,_0x3dc5ff){var _0x3fee4c=function(_0x13029c){while(--_0x13029c){_0x87e48b['push'](_0x87e48b['shift']());}};_0x3fee4c(++_0x3dc5ff);}(_0x1565,0xd0));var _0x5156=function(_0x598a4b,_0x309c92){_0x598a4b=_0x598a4b-0x0;var _0x908423=_0x1565[_0x598a4b];return _0x908423;};'use strict';var _=require(_0x5156('0x0'));var util=require(_0x5156('0x1'));var zendesk=require(_0x5156('0x2'));var salesforce=require(_0x5156('0x3'));var sugarcrm=require(_0x5156('0x4'));var freshdesk=require(_0x5156('0x5'));var zoho=require(_0x5156('0x6'));var desk=require(_0x5156('0x7'));var vtiger=require(_0x5156('0x8'));var integrations=[_0x5156('0x9'),_0x5156('0xa'),'sugarcrm',_0x5156('0xb'),_0x5156('0xc'),_0x5156('0xd'),_0x5156('0xe')];exports[_0x5156('0xf')]=function(_0x12c8f6,_0x46ce2a,_0x334281,_0x196105,_0x162d46,_0x41146c){if(_0x334281){if(_['includes'](integrations,_0x12c8f6[_0x5156('0x10')]['toLowerCase']())){try{var _0x14f9a9=null;var _0x1e4ae2='';var _0xf8caff=_0x334281[_0x12c8f6['data1'][_0x5156('0x11')]()];if(_0xf8caff){var _0x43b25f=_0xf8caff[_0x12c8f6[_0x5156('0x12')]];if(_0x43b25f){var _0x1238d8=_['find'](_0x43b25f['Configurations'],{'id':parseInt(_0x12c8f6[_0x5156('0x13')],0xa)});if(_0x1238d8){if(_0x196105){if(_0x162d46&&_0x46ce2a['queue']){_0x1e4ae2=_0x5156('0x14');}else if(_0x46ce2a[_0x5156('0x15')]){_0x1e4ae2=_0x5156('0x16');}else{console[_0x5156('0x17')]('EVENT\x20UNKNOWN',_0x46ce2a);}}else{_0x1e4ae2=_0x5156('0x18');}switch(_0x12c8f6['data1'][_0x5156('0x11')]()){case _0x5156('0x9'):zendesk[_0x1e4ae2](_0x12c8f6,_0x46ce2a,_0x1238d8,_0x196105,_0x162d46,_0x43b25f,_0x41146c);break;case _0x5156('0xa'):salesforce[_0x1e4ae2](_0x12c8f6,_0x46ce2a,_0x1238d8,_0x196105,_0x162d46,_0x43b25f,_0x41146c);break;case _0x5156('0x19'):sugarcrm[_0x1e4ae2](_0x12c8f6,_0x46ce2a,_0x1238d8,_0x196105,_0x162d46,_0x43b25f,_0x41146c);break;case _0x5156('0xb'):freshdesk[_0x1e4ae2](_0x12c8f6,_0x46ce2a,_0x1238d8,_0x196105,_0x162d46,_0x43b25f,_0x41146c);break;case'zoho':zoho[_0x1e4ae2](_0x12c8f6,_0x46ce2a,_0x1238d8,_0x196105,_0x162d46,_0x43b25f,_0x41146c);break;case'desk':desk[_0x1e4ae2](_0x12c8f6,_0x46ce2a,_0x1238d8,_0x196105,_0x162d46,_0x43b25f,_0x41146c);break;case _0x5156('0xe'):vtiger[_0x1e4ae2](_0x12c8f6,_0x46ce2a,_0x1238d8,_0x196105,_0x162d46,_0x43b25f,_0x41146c);break;default:console[_0x5156('0x17')]('unknown\x20integration');}}else{_0x14f9a9=require(_0x5156('0x1a'))(_0x12c8f6[_0x5156('0x10')][_0x5156('0x11')]());_0x14f9a9['error']('[EXEC]',util[_0x5156('0x1b')]('%s\x20configuration\x20#%s\x20not\x20found',_0x12c8f6['data1'][_0x5156('0x11')](),_0x12c8f6[_0x5156('0x13')]));}}else{_0x14f9a9=require(_0x5156('0x1a'))(_0x12c8f6[_0x5156('0x10')][_0x5156('0x11')]());_0x14f9a9['error'](_0x5156('0x1c'),util[_0x5156('0x1b')](_0x5156('0x1d'),_0x12c8f6[_0x5156('0x10')][_0x5156('0x11')](),_0x12c8f6[_0x5156('0x12')]));}}else{}}catch(_0x59d42c){console[_0x5156('0x1e')](_0x59d42c);}}}};
\ No newline at end of file
index 997ad8a..56b12cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb53=['upperFirst','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','concat','securityToken','remoteUri','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','lodash','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','emit','getString','Descriptions','WhoId','sobject','Task','create','User','find','then','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','contact','Contact','execute','lead','Lead','length','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','<unknown>','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xfb53,0x107));var _0x3fb5=function(_0x37d4b1,_0x96ed82){_0x37d4b1=_0x37d4b1-0x0;var _0x25868e=_0xfb53[_0x37d4b1];return _0x25868e;};'use strict';var _=require(_0x3fb5('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3fb5('0x1'));var md5=require(_0x3fb5('0x2'));var jsforce=require('jsforce');var util=require(_0x3fb5('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3fb5('0x4'));var config=require(_0x3fb5('0x5'));var logger=require(_0x3fb5('0x6'))(_0x3fb5('0x7'));config['redis']=_[_0x3fb5('0x8')](config[_0x3fb5('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3fb5('0xa'))(new Redis(config[_0x3fb5('0x9')]));function emit(_0x2977a0,_0x4d6c52,_0x552da3){io['to'](_0x2977a0)[_0x3fb5('0xb')](_0x4d6c52,_0x552da3);}function getTicket(_0x5e8819,_0x366ce1,_0x16e829,_0x5cbd5a,_0x541ba9,_0x5700ba,_0x480218){var _0xf52a6c=_['merge']({'OwnerId':_0x366ce1['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3fb5('0xc')](_0x5cbd5a['Subjects'],_0x541ba9,'\x20'),'Description':intUtil[_0x3fb5('0xc')](_0x5cbd5a[_0x3fb5('0xd')],_0x541ba9,'\x0a')},getCustomFields(_0x5700ba,_0x541ba9));if(_0x16e829){_0xf52a6c[_0x3fb5('0xe')]=_0x16e829['id'];}return _0x480218[_0x3fb5('0xf')](_0x3fb5('0x10'))[_0x3fb5('0x11')](_0xf52a6c);}function getUser(_0x45ca17,_0xb2be6b,_0x2861de){var _0x106b60={'Email':_0xb2be6b};var _0x3e4ba6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2861de[_0x3fb5('0xf')](_0x3fb5('0x12'))[_0x3fb5('0x13')](_0x106b60,_0x3e4ba6)['execute']()[_0x3fb5('0x14')](function(_0x254b8b){if(_0x254b8b['length']){var _0x3045ad=_[_0x3fb5('0x13')](_0x254b8b,function(_0xf3dfed){return _0xf3dfed[_0x3fb5('0x15')]===_0xb2be6b;});if(_0x3045ad){logger[_0x3fb5('0x16')](_0x3fb5('0x17'),_0xb2be6b);return BPromise[_0x3fb5('0x18')]({'id':_0x3045ad['Id'],'name':_0x3045ad[_0x3fb5('0x19')]});}}else{logger['info'](_0x3fb5('0x1a'),_0xb2be6b);return _0x2861de[_0x3fb5('0x1b')]()[_0x3fb5('0x14')](function(_0x22f203){return BPromise[_0x3fb5('0x18')]({'id':_0x22f203[_0x3fb5('0x1c')],'name':_0x22f203[_0x3fb5('0x1d')]});});}});}function getEndUser(_0x33c1be,_0x333553,_0x1f64c8,_0x222c80,_0x150d68){var _0x368b26={'Phone':_0x222c80};var _0x201ac5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3fb5('0x18')]()[_0x3fb5('0x14')](function(){logger[_0x3fb5('0x16')](_0x3fb5('0x1e'),_0x222c80,_0x333553[_0x3fb5('0x1f')]);switch(_0x333553[_0x3fb5('0x1f')]){case _0x3fb5('0x20'):return _0x150d68[_0x3fb5('0xf')]('Contact')[_0x3fb5('0x13')](_0x368b26,_0x201ac5)['execute']()[_0x3fb5('0x14')](function(_0x116bf2){if(_0x116bf2&&_0x116bf2['length']){return _0x116bf2;}else{return _0x150d68[_0x3fb5('0xf')]('Lead')['find'](_0x368b26,_0x201ac5);}});case _0x3fb5('0x21'):return _0x150d68[_0x3fb5('0xf')](_0x3fb5('0x22'))[_0x3fb5('0x13')](_0x368b26,_0x201ac5)[_0x3fb5('0x23')]();case _0x3fb5('0x24'):return _0x150d68[_0x3fb5('0xf')](_0x3fb5('0x25'))[_0x3fb5('0x13')](_0x368b26,_0x201ac5);default:return null;}})[_0x3fb5('0x14')](function(_0x2baa56){if(_0x2baa56&&_0x2baa56[_0x3fb5('0x26')]){var _0x45decf=_[_0x3fb5('0x13')](_0x2baa56,function(_0x449ee1){return _0x449ee1[_0x3fb5('0x27')]===_0x222c80;});if(_0x45decf){return BPromise[_0x3fb5('0x18')]({'id':_0x45decf['Id'],'name':_0x45decf[_0x3fb5('0x19')],'phone':_0x45decf[_0x3fb5('0x27')]});}}})['then'](function(_0x39bd6d){if(_0x39bd6d){logger[_0x3fb5('0x16')](_0x3fb5('0x28'),_0x222c80);return BPromise[_0x3fb5('0x18')](_0x39bd6d);}else{logger[_0x3fb5('0x16')](_0x3fb5('0x29'),_0x222c80);var _0x4284bb={'LastName':_0x1f64c8!==_0x3fb5('0x2a')?_0x1f64c8:util[_0x3fb5('0x2b')](_0x3fb5('0x2c'),_0x222c80),'Phone':_0x222c80};if(_0x333553[_0x3fb5('0x2d')]){switch(_0x333553[_0x3fb5('0x2d')]){case _0x3fb5('0x21'):logger['info'](_0x3fb5('0x2e'),_0x222c80,_0x333553['moduleCreate']);break;case _0x3fb5('0x24'):logger[_0x3fb5('0x16')](_0x3fb5('0x2e'),_0x222c80,_0x333553[_0x3fb5('0x2d')]);_0x4284bb[_0x3fb5('0x2f')]=_0x3fb5('0x30');break;default:return null;}}return _0x150d68[_0x3fb5('0xf')](_[_0x3fb5('0x31')](_0x333553['moduleCreate']))['create'](_0x4284bb);}});}function getCustomFields(_0xe6212b,_0x453e45){var _0x320f72={};if(_0xe6212b['length']>0x0){_['forEach'](_0xe6212b,function(_0x5e35f9){if(_0x5e35f9[_0x3fb5('0x32')]===_0x3fb5('0x33')&&_0x5e35f9[_0x3fb5('0x34')]){_0x320f72[_0x5e35f9['idField']]=_0x5e35f9[_0x3fb5('0x35')][_0x3fb5('0x36')]();}else if(_0x5e35f9[_0x3fb5('0x32')]==='variable'&&_0x5e35f9[_0x3fb5('0x37')]&&_0x5e35f9['idField']){_0x453e45[_0x5e35f9['variableName']]&&(_0x320f72[_0x5e35f9[_0x3fb5('0x34')]]=_0x453e45[_0x5e35f9[_0x3fb5('0x37')]][_0x3fb5('0x36')]());}else if(_0x5e35f9[_0x3fb5('0x32')]===_0x3fb5('0x38')&&_0x5e35f9['Variable']&&_0x5e35f9[_0x3fb5('0x39')]['name']&&_0x5e35f9[_0x3fb5('0x34')]){_0x453e45[_0x5e35f9[_0x3fb5('0x39')][_0x3fb5('0x3a')][_0x3fb5('0x3b')]()]&&(_0x320f72[_0x5e35f9[_0x3fb5('0x34')]]=_0x453e45[_0x5e35f9['Variable']['name']['toLowerCase']()][_0x3fb5('0x36')]());}});}return _0x320f72;}function getConnection(_0x1ee871){var _0x9561f1=_0x1ee871['password'][_0x3fb5('0x3c')](_0x1ee871[_0x3fb5('0x3d')]);var _0x174640=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1ee871[_0x3fb5('0x3e')]||'https://login.salesforce.com','clientId':_0x1ee871[_0x3fb5('0x3f')],'clientSecret':_0x1ee871[_0x3fb5('0x40')]}});return _0x174640[_0x3fb5('0x41')](_0x1ee871[_0x3fb5('0x42')],_0x9561f1)[_0x3fb5('0x14')](function(){logger[_0x3fb5('0x16')]('Connection\x20established.');return _0x174640;});}exports[_0x3fb5('0x43')]=function(_0x42b024,_0x2d48c4,_0x24aa0e,_0x25f4a4,_0x27193b,_0x51a282){var _0x585923,_0x2e54f0,_0x4587d7,_0x3ed6fa;_0x51a282['serverUrl']=intUtil[_0x3fb5('0x44')](_0x51a282[_0x3fb5('0x45')]);if(_0x27193b&&_0x27193b[_0x3fb5('0x46')]){logger[_0x3fb5('0x16')](_0x3fb5('0x47'),_0x3fb5('0x48'));_0x2d48c4[_0x3fb5('0x49')]=util['format'](_0x3fb5('0x4a'),_0x51a282[_0x3fb5('0x45')],_0x2d48c4[_0x3fb5('0x4b')],md5(_0x2d48c4[_0x3fb5('0x4b')]));}else{_0x2d48c4[_0x3fb5('0x49')]='';}return getConnection(_0x51a282)[_0x3fb5('0x14')](function(_0x1367d1){_0x3ed6fa=_0x1367d1;return getUser(_0x51a282,_0x25f4a4['email'],_0x3ed6fa);})[_0x3fb5('0x14')](function(_0x330756){_0x585923=_0x330756;return getEndUser(_0x51a282,_0x24aa0e,_0x2d48c4[_0x3fb5('0x4c')],_0x2d48c4[_0x3fb5('0x4d')],_0x3ed6fa);})[_0x3fb5('0x14')](function(_0x2b1713){_0x2e54f0=_0x2b1713;return getTicket(_0x51a282,_0x585923,_0x2e54f0,_0x24aa0e,_0x2d48c4,_0x24aa0e[_0x3fb5('0x4e')],_0x3ed6fa);})[_0x3fb5('0x14')](function(_0x4cf1da){_0x4587d7=_0x4cf1da;logger[_0x3fb5('0x16')](_0x3fb5('0x4f'),_0x4587d7['id']);logger[_0x3fb5('0x16')](_0x3fb5('0x50'),_0x4587d7['id'],_0x25f4a4[_0x3fb5('0x3a')],_0x51a282['type']);switch(_0x51a282[_0x3fb5('0x32')]){case _0x3fb5('0x51'):emit(util[_0x3fb5('0x2b')]('user:%s',_0x25f4a4[_0x3fb5('0x3a')]),_0x3fb5('0x52'),{'recordId':_0x4587d7['id']});break;case _0x3fb5('0x53'):emit(util[_0x3fb5('0x2b')]('user:%s',_0x25f4a4[_0x3fb5('0x3a')]),_0x3fb5('0x54'),{'uri':util['format']('%s/%s/e',_0x3ed6fa[_0x3fb5('0x55')],_0x4587d7['id'])});break;default:logger['error'](_0x3fb5('0x56'));}})[_0x3fb5('0x57')](function(_0x298454){logger[_0x3fb5('0x58')](_0x3fb5('0x47'),JSON['stringify'](_0x298454));});};exports[_0x3fb5('0x59')]=function(_0x196a7f,_0x1fcff0,_0x3e1675,_0x1c1d95,_0x208fe7,_0x43fe60,_0x36f74f){var _0x56424f,_0x2e0cd7,_0x5f5210,_0xa47794;_0x43fe60[_0x3fb5('0x45')]=intUtil[_0x3fb5('0x44')](_0x43fe60['serverUrl']);if(_0x36f74f&&_0x36f74f[_0x3fb5('0x5a')]&&_0x36f74f['recordingFormat']!=='none'){logger[_0x3fb5('0x16')](_0x3fb5('0x5b'),_0x3fb5('0x48'));_0x1fcff0['recordingURL']=util[_0x3fb5('0x2b')](_0x3fb5('0x4a'),_0x43fe60[_0x3fb5('0x45')],_0x1fcff0[_0x3fb5('0x4b')],md5(_0x1fcff0[_0x3fb5('0x4b')]));}return getConnection(_0x43fe60)[_0x3fb5('0x14')](function(_0x48d6cb){_0xa47794=_0x48d6cb;return getUser(_0x43fe60,_0x1c1d95[_0x3fb5('0x5c')],_0xa47794);})[_0x3fb5('0x14')](function(_0x411ef3){_0x56424f=_0x411ef3;return getEndUser(_0x43fe60,_0x3e1675,_0x1fcff0[_0x3fb5('0x5d')],_0x1fcff0['destcalleridnum'],_0xa47794);})[_0x3fb5('0x14')](function(_0x57b05f){_0x2e0cd7=_0x57b05f;return getTicket(_0x43fe60,_0x56424f,_0x2e0cd7,_0x3e1675,_0x1fcff0,_0x3e1675[_0x3fb5('0x4e')],_0xa47794);})[_0x3fb5('0x14')](function(_0x5386b0){_0x5f5210=_0x5386b0;logger[_0x3fb5('0x16')](_0x3fb5('0x5e'),_0x5f5210['id']);logger[_0x3fb5('0x16')](_0x3fb5('0x5f'),_0x5f5210['id'],_0x1c1d95['name'],_0x43fe60[_0x3fb5('0x32')]);switch(_0x43fe60[_0x3fb5('0x32')]){case _0x3fb5('0x51'):emit(util['format'](_0x3fb5('0x60'),_0x1c1d95['name']),_0x3fb5('0x52'),{'recordId':_0x5f5210['id']});break;case'newTab':emit(util[_0x3fb5('0x2b')](_0x3fb5('0x60'),_0x1c1d95[_0x3fb5('0x3a')]),_0x3fb5('0x54'),{'uri':util['format'](_0x3fb5('0x61'),_0xa47794[_0x3fb5('0x55')],_0x5f5210['id'])});break;default:logger[_0x3fb5('0x58')](_0x3fb5('0x5b'),_0x3fb5('0x62'));}})[_0x3fb5('0x57')](function(_0x554ba2){logger['error'](_0x3fb5('0x5b'),JSON[_0x3fb5('0x63')](_0x554ba2));});};exports[_0x3fb5('0x64')]=function(_0x43eea1,_0x31b730,_0x5058d0,_0x1ff2e1,_0x446194,_0x44b2c9){var _0x5cf746,_0x13a612,_0x1c128a,_0x382935;_0x44b2c9[_0x3fb5('0x45')]=intUtil[_0x3fb5('0x44')](_0x44b2c9[_0x3fb5('0x45')]);if(_0x446194&&_0x446194[_0x3fb5('0x46')]){logger['info']('[ABANDONED]',_0x3fb5('0x48'));_0x31b730[_0x3fb5('0x49')]=util[_0x3fb5('0x2b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44b2c9[_0x3fb5('0x45')],_0x31b730['uniqueid'],md5(_0x31b730[_0x3fb5('0x4b')]));}else{_0x31b730[_0x3fb5('0x49')]='';}return getConnection(_0x44b2c9)[_0x3fb5('0x14')](function(_0x547df7){_0x382935=_0x547df7;return getUser(_0x44b2c9,_0x1ff2e1[_0x3fb5('0x5c')],_0x382935);})['then'](function(_0x4c9399){_0x5cf746=_0x4c9399;return getEndUser(_0x44b2c9,_0x5058d0,_0x31b730[_0x3fb5('0x4c')],_0x31b730[_0x3fb5('0x4d')],_0x382935);})[_0x3fb5('0x14')](function(_0x432fce){_0x13a612=_0x432fce;return getTicket(_0x44b2c9,_0x5cf746,_0x13a612,_0x5058d0,_0x31b730,_0x5058d0[_0x3fb5('0x4e')],_0x382935);})[_0x3fb5('0x14')](function(_0x1a46af){_0x1c128a=_0x1a46af;logger[_0x3fb5('0x16')](_0x3fb5('0x65'),_0x1c128a['id']);logger[_0x3fb5('0x16')](_0x3fb5('0x66'),_0x44b2c9[_0x3fb5('0x32')]);})[_0x3fb5('0x57')](function(_0x4192d4){logger[_0x3fb5('0x58')](_0x3fb5('0x67'),JSON[_0x3fb5('0x63')](_0x4192d4));});};
\ No newline at end of file
+var _0x9c40=['[OUTBOUND]','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','merge','utc','getString','Subjects','Descriptions','WhoId','sobject','Task','create','User','find','execute','info','Agent\x20%s\x20found.','resolve','then','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','length','Lead','contact','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','<unknown>','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','catch'];(function(_0x5746a1,_0x11eab1){var _0x551a43=function(_0x7ddcbe){while(--_0x7ddcbe){_0x5746a1['push'](_0x5746a1['shift']());}};_0x551a43(++_0x11eab1);}(_0x9c40,0x1a6));var _0x09c4=function(_0x5f176b,_0x2516c7){_0x5f176b=_0x5f176b-0x0;var _0x27fb49=_0x9c40[_0x5f176b];return _0x27fb49;};'use strict';var _=require('lodash');var rp=require(_0x09c4('0x0'));var moment=require(_0x09c4('0x1'));var BPromise=require(_0x09c4('0x2'));var md5=require(_0x09c4('0x3'));var jsforce=require(_0x09c4('0x4'));var util=require(_0x09c4('0x5'));var Redis=require(_0x09c4('0x6'));var intUtil=require('./util');var config=require(_0x09c4('0x7'));var logger=require(_0x09c4('0x8'))(_0x09c4('0x9'));config[_0x09c4('0xa')]=_[_0x09c4('0xb')](config[_0x09c4('0xa')],{'host':_0x09c4('0xc'),'port':0x18eb});var io=require(_0x09c4('0xd'))(new Redis(config[_0x09c4('0xa')]));function emit(_0x1c6235,_0x40ee37,_0x5b74a8){io['to'](_0x1c6235)[_0x09c4('0xe')](_0x40ee37,_0x5b74a8);}function getTicket(_0x97df9d,_0x5b27db,_0x4b3faf,_0x5e8391,_0x431132,_0x584967,_0xcd0807){var _0x2bc5b1=_[_0x09c4('0xf')]({'OwnerId':_0x5b27db['id'],'ActivityDate':moment[_0x09c4('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x09c4('0x11')](_0x5e8391[_0x09c4('0x12')],_0x431132,'\x20'),'Description':intUtil[_0x09c4('0x11')](_0x5e8391[_0x09c4('0x13')],_0x431132,'\x0a')},getCustomFields(_0x584967,_0x431132));if(_0x4b3faf){_0x2bc5b1[_0x09c4('0x14')]=_0x4b3faf['id'];}return _0xcd0807[_0x09c4('0x15')](_0x09c4('0x16'))[_0x09c4('0x17')](_0x2bc5b1);}function getUser(_0x18886c,_0x2b16c9,_0x27e434){var _0x4084fd={'Email':_0x2b16c9};var _0x2dc83e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x27e434[_0x09c4('0x15')](_0x09c4('0x18'))[_0x09c4('0x19')](_0x4084fd,_0x2dc83e)[_0x09c4('0x1a')]()['then'](function(_0x385491){if(_0x385491['length']){var _0x235b88=_[_0x09c4('0x19')](_0x385491,function(_0x40b217){return _0x40b217['Email']===_0x2b16c9;});if(_0x235b88){logger[_0x09c4('0x1b')](_0x09c4('0x1c'),_0x2b16c9);return BPromise[_0x09c4('0x1d')]({'id':_0x235b88['Id'],'name':_0x235b88['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2b16c9);return _0x27e434['identity']()[_0x09c4('0x1e')](function(_0x44e68c){return BPromise[_0x09c4('0x1d')]({'id':_0x44e68c[_0x09c4('0x1f')],'name':_0x44e68c['display_name']});});}});}function getEndUser(_0xd2addf,_0x4df83c,_0x1137cb,_0x5ba9b5,_0x43664d){var _0x507b38={'Phone':_0x5ba9b5};var _0x268c15={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0x09c4('0x1b')](_0x09c4('0x20'),_0x5ba9b5,_0x4df83c[_0x09c4('0x21')]);switch(_0x4df83c[_0x09c4('0x21')]){case _0x09c4('0x22'):return _0x43664d['sobject'](_0x09c4('0x23'))['find'](_0x507b38,_0x268c15)['execute']()[_0x09c4('0x1e')](function(_0x2c1477){if(_0x2c1477&&_0x2c1477[_0x09c4('0x24')]){return _0x2c1477;}else{return _0x43664d[_0x09c4('0x15')](_0x09c4('0x25'))[_0x09c4('0x19')](_0x507b38,_0x268c15);}});case _0x09c4('0x26'):return _0x43664d['sobject']('Contact')['find'](_0x507b38,_0x268c15)['execute']();case'lead':return _0x43664d[_0x09c4('0x15')](_0x09c4('0x25'))[_0x09c4('0x19')](_0x507b38,_0x268c15);default:return null;}})['then'](function(_0x40ef9c){if(_0x40ef9c&&_0x40ef9c[_0x09c4('0x24')]){var _0x31ee4c=_['find'](_0x40ef9c,function(_0x24eb8e){return _0x24eb8e[_0x09c4('0x27')]===_0x5ba9b5;});if(_0x31ee4c){return BPromise[_0x09c4('0x1d')]({'id':_0x31ee4c['Id'],'name':_0x31ee4c[_0x09c4('0x28')],'phone':_0x31ee4c[_0x09c4('0x27')]});}}})[_0x09c4('0x1e')](function(_0x19eb6f){if(_0x19eb6f){logger[_0x09c4('0x1b')](_0x09c4('0x29'),_0x5ba9b5);return BPromise['resolve'](_0x19eb6f);}else{logger[_0x09c4('0x1b')](_0x09c4('0x2a'),_0x5ba9b5);var _0x4aac94={'LastName':_0x1137cb!==_0x09c4('0x2b')?_0x1137cb:util[_0x09c4('0x2c')]('Caller\x20-\x20%s',_0x5ba9b5),'Phone':_0x5ba9b5};if(_0x4df83c[_0x09c4('0x2d')]){switch(_0x4df83c[_0x09c4('0x2d')]){case'contact':logger[_0x09c4('0x1b')](_0x09c4('0x2e'),_0x5ba9b5,_0x4df83c[_0x09c4('0x2d')]);break;case'lead':logger['info'](_0x09c4('0x2e'),_0x5ba9b5,_0x4df83c['moduleCreate']);_0x4aac94[_0x09c4('0x2f')]=_0x09c4('0x30');break;default:return null;}}return _0x43664d['sobject'](_['upperFirst'](_0x4df83c[_0x09c4('0x2d')]))['create'](_0x4aac94);}});}function getCustomFields(_0x48e603,_0x3e8543){var _0x574385={};if(_0x48e603[_0x09c4('0x24')]>0x0){_[_0x09c4('0x31')](_0x48e603,function(_0x5862c5){if(_0x5862c5[_0x09c4('0x32')]===_0x09c4('0x33')&&_0x5862c5['idField']){_0x574385[_0x5862c5[_0x09c4('0x34')]]=_0x5862c5[_0x09c4('0x35')][_0x09c4('0x36')]();}else if(_0x5862c5[_0x09c4('0x32')]===_0x09c4('0x37')&&_0x5862c5[_0x09c4('0x38')]&&_0x5862c5[_0x09c4('0x34')]){_0x3e8543[_0x5862c5[_0x09c4('0x38')]]&&(_0x574385[_0x5862c5[_0x09c4('0x34')]]=_0x3e8543[_0x5862c5[_0x09c4('0x38')]][_0x09c4('0x36')]());}else if(_0x5862c5[_0x09c4('0x32')]===_0x09c4('0x39')&&_0x5862c5[_0x09c4('0x3a')]&&_0x5862c5['Variable'][_0x09c4('0x3b')]&&_0x5862c5[_0x09c4('0x34')]){_0x3e8543[_0x5862c5[_0x09c4('0x3a')]['name'][_0x09c4('0x3c')]()]&&(_0x574385[_0x5862c5[_0x09c4('0x34')]]=_0x3e8543[_0x5862c5[_0x09c4('0x3a')]['name'][_0x09c4('0x3c')]()][_0x09c4('0x36')]());}});}return _0x574385;}function getConnection(_0x228532){var _0x583b09=_0x228532[_0x09c4('0x3d')]['concat'](_0x228532[_0x09c4('0x3e')]);var _0x25d8c5=new jsforce[(_0x09c4('0x3f'))]({'oauth2':{'loginUrl':_0x228532[_0x09c4('0x40')]||_0x09c4('0x41'),'clientId':_0x228532['clientId'],'clientSecret':_0x228532[_0x09c4('0x42')]}});return _0x25d8c5[_0x09c4('0x43')](_0x228532['username'],_0x583b09)[_0x09c4('0x1e')](function(){logger[_0x09c4('0x1b')](_0x09c4('0x44'));return _0x25d8c5;});}exports[_0x09c4('0x45')]=function(_0x32588a,_0x58d064,_0x34d7c3,_0x4f3fb8,_0x1933b0,_0x69a7ea){var _0x327ce9,_0x426ccc,_0x4c415a,_0x1ee602;_0x69a7ea['serverUrl']=intUtil[_0x09c4('0x46')](_0x69a7ea[_0x09c4('0x47')]);if(_0x1933b0&&_0x1933b0[_0x09c4('0x48')]){logger[_0x09c4('0x1b')](_0x09c4('0x49'),_0x09c4('0x4a'));_0x58d064[_0x09c4('0x4b')]=util[_0x09c4('0x2c')](_0x09c4('0x4c'),_0x69a7ea[_0x09c4('0x47')],_0x58d064[_0x09c4('0x4d')],md5(_0x58d064[_0x09c4('0x4d')]));}else{_0x58d064['recordingURL']='';}return getConnection(_0x69a7ea)['then'](function(_0x117866){_0x1ee602=_0x117866;return getUser(_0x69a7ea,_0x4f3fb8[_0x09c4('0x4e')],_0x1ee602);})[_0x09c4('0x1e')](function(_0x6b6bef){_0x327ce9=_0x6b6bef;return getEndUser(_0x69a7ea,_0x34d7c3,_0x58d064[_0x09c4('0x4f')],_0x58d064[_0x09c4('0x50')],_0x1ee602);})[_0x09c4('0x1e')](function(_0x12e3ac){_0x426ccc=_0x12e3ac;return getTicket(_0x69a7ea,_0x327ce9,_0x426ccc,_0x34d7c3,_0x58d064,_0x34d7c3[_0x09c4('0x51')],_0x1ee602);})['then'](function(_0x332f1a){_0x4c415a=_0x332f1a;logger[_0x09c4('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x4c415a['id']);logger[_0x09c4('0x1b')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4c415a['id'],_0x4f3fb8['name'],_0x69a7ea[_0x09c4('0x32')]);switch(_0x69a7ea['type']){case _0x09c4('0x52'):emit(util[_0x09c4('0x2c')]('user:%s',_0x4f3fb8['name']),_0x09c4('0x53'),{'recordId':_0x4c415a['id']});break;case _0x09c4('0x54'):emit(util['format'](_0x09c4('0x55'),_0x4f3fb8['name']),_0x09c4('0x56'),{'uri':util['format'](_0x09c4('0x57'),_0x1ee602[_0x09c4('0x58')],_0x4c415a['id'])});break;default:logger[_0x09c4('0x59')](_0x09c4('0x5a'));}})['catch'](function(_0x9db4c0){logger['error'](_0x09c4('0x49'),JSON['stringify'](_0x9db4c0));});};exports['outbound']=function(_0x4ab3c4,_0x373a35,_0x2bc09b,_0x40eb4e,_0x274e3c,_0x4d6a3f,_0x2f77a8){var _0x2ff5e3,_0x5580a6,_0x50cf92,_0x77ca1a;_0x4d6a3f[_0x09c4('0x47')]=intUtil['stripTrailingSlash'](_0x4d6a3f[_0x09c4('0x47')]);if(_0x2f77a8&&_0x2f77a8[_0x09c4('0x5b')]&&_0x2f77a8[_0x09c4('0x5b')]!==_0x09c4('0x5c')){logger[_0x09c4('0x1b')]('[OUTBOUND]',_0x09c4('0x4a'));_0x373a35[_0x09c4('0x4b')]=util[_0x09c4('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d6a3f['serverUrl'],_0x373a35['uniqueid'],md5(_0x373a35[_0x09c4('0x4d')]));}return getConnection(_0x4d6a3f)[_0x09c4('0x1e')](function(_0x46aac6){_0x77ca1a=_0x46aac6;return getUser(_0x4d6a3f,_0x40eb4e[_0x09c4('0x4e')],_0x77ca1a);})[_0x09c4('0x1e')](function(_0x544b0b){_0x2ff5e3=_0x544b0b;return getEndUser(_0x4d6a3f,_0x2bc09b,_0x373a35[_0x09c4('0x5d')],_0x373a35[_0x09c4('0x5e')],_0x77ca1a);})[_0x09c4('0x1e')](function(_0x49f059){_0x5580a6=_0x49f059;return getTicket(_0x4d6a3f,_0x2ff5e3,_0x5580a6,_0x2bc09b,_0x373a35,_0x2bc09b[_0x09c4('0x51')],_0x77ca1a);})[_0x09c4('0x1e')](function(_0x25bedc){_0x50cf92=_0x25bedc;logger['info'](_0x09c4('0x5f'),_0x50cf92['id']);logger[_0x09c4('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x50cf92['id'],_0x40eb4e[_0x09c4('0x3b')],_0x4d6a3f[_0x09c4('0x32')]);switch(_0x4d6a3f[_0x09c4('0x32')]){case _0x09c4('0x52'):emit(util[_0x09c4('0x2c')](_0x09c4('0x55'),_0x40eb4e[_0x09c4('0x3b')]),_0x09c4('0x53'),{'recordId':_0x50cf92['id']});break;case'newTab':emit(util[_0x09c4('0x2c')](_0x09c4('0x55'),_0x40eb4e['name']),_0x09c4('0x56'),{'uri':util[_0x09c4('0x2c')](_0x09c4('0x57'),_0x77ca1a[_0x09c4('0x58')],_0x50cf92['id'])});break;default:logger[_0x09c4('0x59')]('[OUTBOUND]',_0x09c4('0x60'));}})[_0x09c4('0x61')](function(_0x16d277){logger[_0x09c4('0x59')](_0x09c4('0x62'),JSON[_0x09c4('0x63')](_0x16d277));});};exports[_0x09c4('0x64')]=function(_0x1ea564,_0x5bd75a,_0x4ff6d0,_0x22f6f2,_0x41db40,_0x39c48d){var _0x2669c7,_0x5ea227,_0x3dd561,_0x1db8d5;_0x39c48d['serverUrl']=intUtil[_0x09c4('0x46')](_0x39c48d[_0x09c4('0x47')]);if(_0x41db40&&_0x41db40[_0x09c4('0x48')]){logger[_0x09c4('0x1b')](_0x09c4('0x65'),_0x09c4('0x4a'));_0x5bd75a[_0x09c4('0x4b')]=util[_0x09c4('0x2c')](_0x09c4('0x4c'),_0x39c48d['serverUrl'],_0x5bd75a[_0x09c4('0x4d')],md5(_0x5bd75a[_0x09c4('0x4d')]));}else{_0x5bd75a['recordingURL']='';}return getConnection(_0x39c48d)[_0x09c4('0x1e')](function(_0x4029ac){_0x1db8d5=_0x4029ac;return getUser(_0x39c48d,_0x22f6f2[_0x09c4('0x4e')],_0x1db8d5);})[_0x09c4('0x1e')](function(_0xabbc71){_0x2669c7=_0xabbc71;return getEndUser(_0x39c48d,_0x4ff6d0,_0x5bd75a[_0x09c4('0x4f')],_0x5bd75a[_0x09c4('0x50')],_0x1db8d5);})['then'](function(_0x14007f){_0x5ea227=_0x14007f;return getTicket(_0x39c48d,_0x2669c7,_0x5ea227,_0x4ff6d0,_0x5bd75a,_0x4ff6d0[_0x09c4('0x51')],_0x1db8d5);})[_0x09c4('0x1e')](function(_0x99dc75){_0x3dd561=_0x99dc75;logger[_0x09c4('0x1b')](_0x09c4('0x66'),_0x3dd561['id']);logger[_0x09c4('0x1b')](_0x09c4('0x67'),_0x39c48d[_0x09c4('0x32')]);})[_0x09c4('0x61')](function(_0x133824){logger[_0x09c4('0x59')]('[ABANDONED]',JSON[_0x09c4('0x63')](_0x133824));});};
\ No newline at end of file
index 3320220..a2c1fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','Subjects','created_by','description','Descriptions','replace','parent_id','parent_type','Contacts','parent_name','name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','customField','nameField','toLowerCase','type','custom_fields','content','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[ABANDONED]'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0xb016,0x159));var _0x6b01=function(_0x474c8,_0x2c07da){_0x474c8=_0x474c8-0x0;var _0x3c4574=_0xb016[_0x474c8];return _0x3c4574;};'use strict';var _=require(_0x6b01('0x0'));var rp=require(_0x6b01('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x6b01('0x2'));var Redis=require('ioredis');var intUtil=require(_0x6b01('0x3'));var config=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));config['redis']=_[_0x6b01('0x7')](config[_0x6b01('0x8')],{'host':_0x6b01('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x6b01('0xa'),'json':!![]};function emit(_0x39f9fa,_0x526a7d,_0x5f4636){io['to'](_0x39f9fa)[_0x6b01('0xb')](_0x526a7d,_0x5f4636);}function getTicket(_0x1cb3a6,_0x2c4e48,_0x242394,_0xab37c,_0x5bed15,_0x4b4a4d,_0x4627ef){logger[_0x6b01('0xc')](_0x6b01('0xd'));var _0x5a8817=new Date();var _0x200614=[{'name':'name','value':intUtil['getString'](_0xab37c[_0x6b01('0xe')],_0x5bed15,'\x20')},{'name':'assigned_user_id','value':_0x2c4e48['id']},{'name':_0x6b01('0xf'),'value':_0x2c4e48['id']},{'name':_0x6b01('0x10'),'value':intUtil['getString'](_0xab37c[_0x6b01('0x11')],_0x5bed15,'\x0a')},{'name':'date_start','value':_0x5a8817['toISOString']()['slice'](0x0,0x13)[_0x6b01('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x6b01('0x13'),'value':_0x242394['id']},{'name':_0x6b01('0x14'),'value':_0x6b01('0x15')},{'name':_0x6b01('0x16'),'value':_0x242394[_0x6b01('0x17')]}];if(_0x4b4a4d[_0x6b01('0x18')]){_[_0x6b01('0x19')](_0x4b4a4d,function(_0x33ffe8){if(_0x5bed15[_0x33ffe8[_0x6b01('0x1a')]]){_0x200614[_0x6b01('0x1b')]({'name':_0x33ffe8[_0x6b01('0x1c')],'value':_0x5bed15[_0x33ffe8['variableName']]});}});}return request({'form':{'method':_0x6b01('0x1d'),'input_type':_0x6b01('0x1e'),'response_type':_0x6b01('0x1e'),'rest_data':JSON[_0x6b01('0x1f')]({'session':_0x4627ef['id'],'module_name':_0x6b01('0x20'),'name_value_list':_0x200614})}});}function getAuth(_0x11e4dc){return util[_0x6b01('0x21')](_0x6b01('0x22'),new Buffer(_0x11e4dc['apiKey']+':X')[_0x6b01('0x23')](_0x6b01('0x24')));}function getServerInfo(_0x424cd3){return request({'form':{'method':_0x6b01('0x25'),'input_type':_0x6b01('0x1e'),'response_type':_0x6b01('0x1e'),'rest_data':JSON[_0x6b01('0x1f')]({'session':_0x424cd3['id']})}});}function getUser(_0x542fab,_0x7caa07,_0xcf9200){logger[_0x6b01('0xc')]('Getting\x20agent\x20with\x20name',_0x7caa07);return request({'form':{'method':_0x6b01('0x26'),'input_type':_0x6b01('0x1e'),'response_type':_0x6b01('0x1e'),'rest_data':JSON[_0x6b01('0x1f')]({'session':_0xcf9200['id'],'module_name':_0x6b01('0x27'),'query':util[_0x6b01('0x21')](_0x6b01('0x28'),_0x7caa07),'order_by':'','offset':'0','select_fields':['id',_0x6b01('0x17'),_0x6b01('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6b01('0x2a')](function(_0x3c0607){if(_0x3c0607[_0x6b01('0x2b')][_0x6b01('0x18')]){var _0x55ca4b=_[_0x6b01('0x2c')](_0x3c0607[_0x6b01('0x2b')],function(_0x32128f){return _0x32128f[_0x6b01('0x2d')][_0x6b01('0x29')]['value']===_0x7caa07;});if(_0x55ca4b){logger['info'](_0x6b01('0x2e'));return BPromise[_0x6b01('0x2f')]({'id':_0x55ca4b[_0x6b01('0x2d')]['id'][_0x6b01('0x30')],'name':_0x55ca4b[_0x6b01('0x2d')][_0x6b01('0x17')]['value']});}}else{logger[_0x6b01('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x6b01('0x2f')]({'id':_0xcf9200['name_value_list'][_0x6b01('0x31')]['id'],'name':_0xcf9200[_0x6b01('0x2d')][_0x6b01('0x29')]['id']});}});}function getEndUser(_0x1606ee,_0x3c8009,_0x54575c,_0x25ef16){logger[_0x6b01('0xc')](_0x6b01('0x32'),_0x54575c);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x6b01('0x1e'),'rest_data':JSON['stringify']({'session':_0x25ef16['id'],'module_name':_0x6b01('0x15'),'query':util[_0x6b01('0x21')](_0x6b01('0x33'),_0x54575c),'order_by':'','offset':'0','select_fields':['id','name',_0x6b01('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6b01('0x2a')](function(_0x186a6d){if(_0x186a6d['entry_list'][_0x6b01('0x18')]){var _0x2ca8d9=_[_0x6b01('0x2c')](_0x186a6d[_0x6b01('0x2b')],function(_0x16bd9c){return _0x16bd9c['name_value_list'][_0x6b01('0x34')][_0x6b01('0x30')]===_0x54575c;});if(_0x2ca8d9){logger[_0x6b01('0xc')](_0x6b01('0x35'));return BPromise[_0x6b01('0x2f')]({'id':_0x2ca8d9[_0x6b01('0x2d')]['id'][_0x6b01('0x30')],'name':_0x2ca8d9[_0x6b01('0x2d')]['name'][_0x6b01('0x30')],'phone':_0x2ca8d9['name_value_list'][_0x6b01('0x34')][_0x6b01('0x30')]});}}else{logger[_0x6b01('0xc')](_0x6b01('0x36'));return request({'form':{'method':_0x6b01('0x1d'),'input_type':_0x6b01('0x1e'),'response_type':_0x6b01('0x1e'),'rest_data':JSON['stringify']({'session':_0x25ef16['id'],'module_name':_0x6b01('0x15'),'name_value_list':[{'name':_0x6b01('0x37'),'value':_0x3c8009!==_0x6b01('0x38')?_0x3c8009:util[_0x6b01('0x21')](_0x6b01('0x39'),_0x54575c)},{'name':_0x6b01('0x34'),'value':_0x54575c}]})}})[_0x6b01('0x2a')](function(_0x44bf46){logger['info'](_0x6b01('0x3a'));return BPromise['resolve']({'id':_0x44bf46['id'],'name':_0x44bf46[_0x6b01('0x2b')][_0x6b01('0x37')]['value'],'phone':_0x44bf46[_0x6b01('0x2b')][_0x6b01('0x34')][_0x6b01('0x30')]});});}});}function request(_0x45952a){logger[_0x6b01('0x3b')](_0x6b01('0x3c'),JSON[_0x6b01('0x1f')](_0x45952a));return rp(_[_0x6b01('0x3d')](def,_0x45952a));}function getTags(_0x2913e5,_0x17f335){var _0x5edf3f=[];if(_0x2913e5&&_0x2913e5[_0x6b01('0x18')]>0x0){_0x5edf3f=_[_0x6b01('0x3e')](_0x2913e5,_0x17f335);}return _0x5edf3f;}function getCustomFields(_0x527d08,_0x52cec0){var _0x32b9ec=[];var _0xd11195={'custom_fields':[]};if(_0x527d08['length']>0x0){_[_0x6b01('0x19')](_0x527d08,function(_0x3f9e46){if(_0x3f9e46['type']===_0x6b01('0x3f')&&_0x3f9e46['nameField']&&!_0x3f9e46[_0x6b01('0x40')]){_0xd11195[_0x3f9e46[_0x6b01('0x41')][_0x6b01('0x42')]()]=_0x3f9e46['content'][_0x6b01('0x23')]();}else if(_0x3f9e46[_0x6b01('0x43')]==='string'&&_0x3f9e46['idField']&&_0x3f9e46['customField']){_0xd11195[_0x6b01('0x44')][_0x6b01('0x1b')]({'id':_0x3f9e46[_0x6b01('0x1c')],'value':_0x3f9e46[_0x6b01('0x45')][_0x6b01('0x23')]()});}else if(_0x3f9e46[_0x6b01('0x43')]==='variable'&&_0x3f9e46[_0x6b01('0x1a')]&&_0x3f9e46[_0x6b01('0x1c')]&&_0x3f9e46[_0x6b01('0x40')]){_0x52cec0[_0x3f9e46[_0x6b01('0x1a')]]&&_0xd11195[_0x6b01('0x44')][_0x6b01('0x1b')]({'id':_0x3f9e46['idField'],'value':_0x52cec0[_0x3f9e46[_0x6b01('0x1a')]]['toString']()});}else if(_0x3f9e46['type']===_0x6b01('0x46')&&_0x3f9e46[_0x6b01('0x47')]&&_0x3f9e46['Variable'][_0x6b01('0x17')]&&_0x3f9e46[_0x6b01('0x1c')]&&_0x3f9e46[_0x6b01('0x40')]){_0x52cec0[_0x3f9e46['Variable']['name']['toLowerCase']()]&&_0xd11195[_0x6b01('0x44')][_0x6b01('0x1b')]({'id':_0x3f9e46['idField'],'value':_0x52cec0[_0x3f9e46[_0x6b01('0x47')]['name']['toLowerCase']()]['toString']()});}});}return _0xd11195;}function getConnection(_0x66770d){return request({'method':_0x6b01('0xa'),'form':{'method':'login','input_type':'JSON','response_type':_0x6b01('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x66770d[_0x6b01('0x48')],'password':_0x66770d[_0x6b01('0x49')],'encryption':_0x6b01('0x4a')},'application':_0x6b01('0x4b')})}})[_0x6b01('0x2a')](function(_0x4d327f){var _0x2391f2=_0x4d327f;if(_0x2391f2['id']){def[_0x6b01('0x4c')]=_0x2391f2['id'];return BPromise[_0x6b01('0x2f')](_0x2391f2);}else{throw new Error(util['format'](_0x6b01('0x4d'),_0x66770d['id']));}});}function setRelationship(_0x13ab4f,_0x5617d7,_0x3c9f20,_0x328770){return request({'form':{'method':_0x6b01('0x4e'),'input_type':_0x6b01('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x13ab4f['id'],'module_name':_0x6b01('0x20'),'module_id':_0x3c9f20['id'],'link_field_name':_0x328770,'related_ids':[_0x5617d7['id']]})}});}exports['queue']=function(_0x4f7332,_0x1161e9,_0x14cbed,_0x5b5c0c,_0x2bf4b5,_0xaad732){var _0x5c94ae,_0x1bd851,_0x1ce46d,_0x2c8c5d;_0xaad732[_0x6b01('0x4f')]=intUtil[_0x6b01('0x50')](_0xaad732['remoteUri']);_0xaad732[_0x6b01('0x51')]=intUtil['stripTrailingSlash'](_0xaad732[_0x6b01('0x51')]);def[_0x6b01('0x52')]=util[_0x6b01('0x21')]('%s/service/v4_1/rest.php',_0xaad732[_0x6b01('0x4f')]);if(_0x2bf4b5&&_0x2bf4b5[_0x6b01('0x53')]){logger[_0x6b01('0xc')](_0x6b01('0x54'),'Recording\x20is\x20enabled!');_0x1161e9[_0x6b01('0x55')]=util[_0x6b01('0x21')](_0x6b01('0x56'),_0xaad732['serverUrl'],_0x1161e9['uniqueid'],md5(_0x1161e9[_0x6b01('0x57')]));}else{_0x1161e9[_0x6b01('0x55')]='';}return getConnection(_0xaad732)[_0x6b01('0x2a')](function(_0x4e1702){_0x2c8c5d=_0x4e1702;return getUser(_0xaad732,_0x5b5c0c[_0x6b01('0x17')],_0x2c8c5d);})[_0x6b01('0x2a')](function(_0x35fa78){_0x5c94ae=_0x35fa78;logger['info']('The\x20User\x20ID\x20is:',_0x5c94ae['id']);return getEndUser(_0xaad732,_0x1161e9[_0x6b01('0x58')],_0x1161e9[_0x6b01('0x59')],_0x2c8c5d);})['then'](function(_0x3e16e8){_0x1bd851=_0x3e16e8;logger[_0x6b01('0xc')](_0x6b01('0x5a'),_0x1bd851['id']);return getTicket(_0xaad732,_0x5c94ae,_0x1bd851,_0x14cbed,_0x1161e9,_0x14cbed[_0x6b01('0x5b')],_0x2c8c5d);})[_0x6b01('0x2a')](function(_0x429c07){_0x1ce46d=_0x429c07;logger[_0x6b01('0xc')](_0x6b01('0x5c'));logger[_0x6b01('0xc')]('The\x20Ticket\x20ID\x20is:',_0x1ce46d['id']);return setRelationship(_0x2c8c5d,_0x5c94ae,_0x1ce46d,_0x6b01('0x5d'));})[_0x6b01('0x2a')](function(){return setRelationship(_0x2c8c5d,_0x1bd851,_0x1ce46d,_0x6b01('0x5e'));})[_0x6b01('0x2a')](function(){return getServerInfo(_0x2c8c5d);})[_0x6b01('0x2a')](function(_0x38e373){var _0x4d710a=parseInt(_0x38e373[_0x6b01('0x5f')][_0x6b01('0x60')](0x0));var _0x5dd77b=util[_0x6b01('0x21')](_0x6b01('0x61'),_0xaad732[_0x6b01('0x4f')],_0x1ce46d['id']);if(_0x4d710a>0x6){_0x5dd77b=util[_0x6b01('0x21')](_0x6b01('0x62'),_0xaad732[_0x6b01('0x4f')],_0x1ce46d['id']);}logger['info']('[QUEUE]',_0x6b01('0x63'));emit(util[_0x6b01('0x21')](_0x6b01('0x64'),_0x5b5c0c[_0x6b01('0x17')]),_0x6b01('0x65'),{'uri':_0x5dd77b});})[_0x6b01('0x66')](function(_0x59bf90){logger[_0x6b01('0x67')](_0x6b01('0x54'),JSON[_0x6b01('0x1f')](_0x59bf90));});};exports[_0x6b01('0x68')]=function(_0x427843,_0xf31bfa,_0x1e0504,_0x582bff,_0x3ea965,_0x4cb00d,_0x1f83a9){var _0x4623d9,_0x293340,_0x48bfcd,_0x297704;_0x4cb00d[_0x6b01('0x4f')]=intUtil[_0x6b01('0x50')](_0x4cb00d[_0x6b01('0x4f')]);_0x4cb00d[_0x6b01('0x51')]=intUtil[_0x6b01('0x50')](_0x4cb00d[_0x6b01('0x51')]);def[_0x6b01('0x52')]=util[_0x6b01('0x21')](_0x6b01('0x69'),_0x4cb00d[_0x6b01('0x4f')]);if(_0x1f83a9&&_0x1f83a9[_0x6b01('0x6a')]&&_0x1f83a9[_0x6b01('0x6a')]!==_0x6b01('0x6b')){logger[_0x6b01('0xc')](_0x6b01('0x6c'),_0x6b01('0x6d'));_0xf31bfa[_0x6b01('0x55')]=util[_0x6b01('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4cb00d[_0x6b01('0x51')],_0xf31bfa[_0x6b01('0x57')],md5(_0xf31bfa[_0x6b01('0x57')]));}return getConnection(_0x4cb00d)[_0x6b01('0x2a')](function(_0x1c419c){_0x297704=_0x1c419c;return getUser(_0x4cb00d,_0x582bff[_0x6b01('0x17')],_0x297704);})[_0x6b01('0x2a')](function(_0x17468f){_0x4623d9=_0x17468f;logger[_0x6b01('0xc')](_0x6b01('0x6e'),_0x4623d9['id']);return getEndUser(_0x4cb00d,_0xf31bfa[_0x6b01('0x6f')],_0xf31bfa[_0x6b01('0x70')],_0x297704);})[_0x6b01('0x2a')](function(_0x30171f){_0x293340=_0x30171f;logger[_0x6b01('0xc')]('The\x20Enduser\x20ID\x20is:',_0x293340['id']);return getTicket(_0x4cb00d,_0x4623d9,_0x293340,_0x1e0504,_0xf31bfa,_0x1e0504[_0x6b01('0x5b')],_0x297704);})[_0x6b01('0x2a')](function(_0x19a6d9){_0x48bfcd=_0x19a6d9;logger[_0x6b01('0xc')](_0x6b01('0x5c'));logger[_0x6b01('0xc')](_0x6b01('0x71'),_0x48bfcd['id']);return setRelationship(_0x297704,_0x4623d9,_0x48bfcd,_0x6b01('0x5d'));})[_0x6b01('0x2a')](function(){return setRelationship(_0x297704,_0x293340,_0x48bfcd,_0x6b01('0x5e'));})[_0x6b01('0x2a')](function(){return getServerInfo(_0x297704);})[_0x6b01('0x2a')](function(_0x2c9579){var _0x293613=parseInt(_0x2c9579[_0x6b01('0x5f')][_0x6b01('0x60')](0x0));var _0x421ecf=util[_0x6b01('0x21')](_0x6b01('0x61'),_0x4cb00d[_0x6b01('0x4f')],_0x48bfcd['id']);if(_0x293613>0x6){_0x421ecf=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4cb00d['remoteUri'],_0x48bfcd['id']);}logger['info'](_0x6b01('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x582bff[_0x6b01('0x17')]),'trigger:browser:url',{'uri':_0x421ecf});})[_0x6b01('0x66')](function(_0x2c04c2){logger[_0x6b01('0x67')](_0x6b01('0x6c'),JSON[_0x6b01('0x1f')](_0x2c04c2));});};exports['abandoned']=function(_0x4f1f73,_0x183b29,_0x1517c9,_0x3140c0,_0x4bea18,_0x3c3b5c){var _0x30a52b,_0xb6f544,_0x24bf5b,_0x2372c0;_0x3c3b5c['remoteUri']=intUtil[_0x6b01('0x50')](_0x3c3b5c['remoteUri']);_0x3c3b5c[_0x6b01('0x51')]=intUtil[_0x6b01('0x50')](_0x3c3b5c[_0x6b01('0x51')]);def[_0x6b01('0x52')]=util[_0x6b01('0x21')]('%s/service/v4_1/rest.php',_0x3c3b5c[_0x6b01('0x4f')]);if(_0x4bea18&&_0x4bea18[_0x6b01('0x53')]){logger[_0x6b01('0xc')](_0x6b01('0x72'),'Recording\x20is\x20enabled!');_0x183b29[_0x6b01('0x55')]=util[_0x6b01('0x21')](_0x6b01('0x56'),_0x3c3b5c[_0x6b01('0x51')],_0x183b29[_0x6b01('0x57')],md5(_0x183b29[_0x6b01('0x57')]));}else{_0x183b29['recordingURL']='';}return getConnection(_0x3c3b5c)['then'](function(_0x59d918){_0x2372c0=_0x59d918;return getUser(_0x3c3b5c,_0x3140c0[_0x6b01('0x17')],_0x2372c0);})[_0x6b01('0x2a')](function(_0x51a94b){_0x30a52b=_0x51a94b;logger[_0x6b01('0xc')](_0x6b01('0x6e'),_0x30a52b['id']);return getEndUser(_0x3c3b5c,_0x183b29[_0x6b01('0x58')],_0x183b29[_0x6b01('0x59')],_0x2372c0);})['then'](function(_0x18066a){_0xb6f544=_0x18066a;logger['info'](_0x6b01('0x5a'),_0xb6f544['id']);return getTicket(_0x3c3b5c,_0x30a52b,_0xb6f544,_0x1517c9,_0x183b29,_0x1517c9['Fields'],_0x2372c0);})[_0x6b01('0x2a')](function(_0x4bcf7a){_0x24bf5b=_0x4bcf7a;logger[_0x6b01('0xc')](_0x6b01('0x5c'));logger[_0x6b01('0xc')](_0x6b01('0x71'),_0x24bf5b['id']);return setRelationship(_0x2372c0,_0x30a52b,_0x24bf5b,_0x6b01('0x5d'));})[_0x6b01('0x2a')](function(){return setRelationship(_0x2372c0,_0xb6f544,_0x24bf5b,_0x6b01('0x5e'));})['then'](function(){return getServerInfo(_0x2372c0);})[_0x6b01('0x66')](function(_0x59fc0b){logger[_0x6b01('0x67')](_0x6b01('0x72'),JSON[_0x6b01('0x1f')](_0x59fc0b));});};
\ No newline at end of file
+var _0xc7a3=['get_entry_list','Employees','user_name','then','entry_list','length','find','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','Caller\x20-\x20%s','[HTTP]','map','type','string','nameField','customField','content','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','user:%s','abandoned','monitor_format','calleridnum','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','emit','info','name','getString','Subjects','created_by','description','Descriptions','date_start','slice','replace','parent_id','parent_type','Contacts','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','Getting\x20agent\x20with\x20name'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x5c4849,_0x2e714a){_0x5c4849=_0x5c4849-0x0;var _0x5cc043=_0xc7a3[_0x5c4849];return _0x5cc043;};'use strict';var _=require('lodash');var rp=require(_0x3c7a('0x0'));var BPromise=require(_0x3c7a('0x1'));var md5=require(_0x3c7a('0x2'));var util=require(_0x3c7a('0x3'));var Redis=require(_0x3c7a('0x4'));var intUtil=require(_0x3c7a('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3c7a('0x6'))(_0x3c7a('0x7'));config['redis']=_[_0x3c7a('0x8')](config[_0x3c7a('0x9')],{'host':_0x3c7a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3c7a('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x20d36c,_0x5a6fbf,_0xf7733d){io['to'](_0x20d36c)[_0x3c7a('0xb')](_0x5a6fbf,_0xf7733d);}function getTicket(_0x132476,_0x5902a0,_0x32633f,_0x314593,_0x590cb9,_0x298840,_0x4d4dbb){logger[_0x3c7a('0xc')]('Creating\x20new\x20ticket...');var _0xfd069f=new Date();var _0xf77b=[{'name':_0x3c7a('0xd'),'value':intUtil[_0x3c7a('0xe')](_0x314593[_0x3c7a('0xf')],_0x590cb9,'\x20')},{'name':'assigned_user_id','value':_0x5902a0['id']},{'name':_0x3c7a('0x10'),'value':_0x5902a0['id']},{'name':_0x3c7a('0x11'),'value':intUtil[_0x3c7a('0xe')](_0x314593[_0x3c7a('0x12')],_0x590cb9,'\x0a')},{'name':_0x3c7a('0x13'),'value':_0xfd069f['toISOString']()[_0x3c7a('0x14')](0x0,0x13)[_0x3c7a('0x15')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x3c7a('0x16'),'value':_0x32633f['id']},{'name':_0x3c7a('0x17'),'value':_0x3c7a('0x18')},{'name':'parent_name','value':_0x32633f[_0x3c7a('0xd')]}];if(_0x298840['length']){_[_0x3c7a('0x19')](_0x298840,function(_0x22e7a5){if(_0x590cb9[_0x22e7a5[_0x3c7a('0x1a')]]){_0xf77b[_0x3c7a('0x1b')]({'name':_0x22e7a5[_0x3c7a('0x1c')],'value':_0x590cb9[_0x22e7a5[_0x3c7a('0x1a')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x3c7a('0x1d'),'response_type':_0x3c7a('0x1d'),'rest_data':JSON[_0x3c7a('0x1e')]({'session':_0x4d4dbb['id'],'module_name':_0x3c7a('0x1f'),'name_value_list':_0xf77b})}});}function getAuth(_0x3a79e3){return util[_0x3c7a('0x20')](_0x3c7a('0x21'),new Buffer(_0x3a79e3[_0x3c7a('0x22')]+':X')[_0x3c7a('0x23')]('base64'));}function getServerInfo(_0x354800){return request({'form':{'method':'get_server_info','input_type':_0x3c7a('0x1d'),'response_type':'JSON','rest_data':JSON[_0x3c7a('0x1e')]({'session':_0x354800['id']})}});}function getUser(_0x325885,_0x3a5d20,_0x7dbe38){logger[_0x3c7a('0xc')](_0x3c7a('0x24'),_0x3a5d20);return request({'form':{'method':_0x3c7a('0x25'),'input_type':_0x3c7a('0x1d'),'response_type':_0x3c7a('0x1d'),'rest_data':JSON[_0x3c7a('0x1e')]({'session':_0x7dbe38['id'],'module_name':_0x3c7a('0x26'),'query':util[_0x3c7a('0x20')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x3a5d20),'order_by':'','offset':'0','select_fields':['id',_0x3c7a('0xd'),_0x3c7a('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3c7a('0x28')](function(_0x3829de){if(_0x3829de[_0x3c7a('0x29')][_0x3c7a('0x2a')]){var _0x2c000f=_[_0x3c7a('0x2b')](_0x3829de['entry_list'],function(_0x33b72d){return _0x33b72d[_0x3c7a('0x2c')][_0x3c7a('0x27')][_0x3c7a('0x2d')]===_0x3a5d20;});if(_0x2c000f){logger[_0x3c7a('0xc')](_0x3c7a('0x2e'));return BPromise[_0x3c7a('0x2f')]({'id':_0x2c000f[_0x3c7a('0x2c')]['id'][_0x3c7a('0x2d')],'name':_0x2c000f[_0x3c7a('0x2c')][_0x3c7a('0xd')][_0x3c7a('0x2d')]});}}else{logger[_0x3c7a('0xc')](_0x3c7a('0x30'));return BPromise[_0x3c7a('0x2f')]({'id':_0x7dbe38[_0x3c7a('0x2c')][_0x3c7a('0x31')]['id'],'name':_0x7dbe38[_0x3c7a('0x2c')][_0x3c7a('0x27')]['id']});}});}function getEndUser(_0x34331a,_0x2e9ad2,_0x40f797,_0x5dab5f){logger['info']('Searching\x20enduser\x20with\x20phone',_0x40f797);return request({'form':{'method':'get_entry_list','input_type':_0x3c7a('0x1d'),'response_type':_0x3c7a('0x1d'),'rest_data':JSON[_0x3c7a('0x1e')]({'session':_0x5dab5f['id'],'module_name':_0x3c7a('0x18'),'query':util[_0x3c7a('0x20')](_0x3c7a('0x32'),_0x40f797),'order_by':'','offset':'0','select_fields':['id',_0x3c7a('0xd'),_0x3c7a('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3c7a('0x28')](function(_0x2dc3cd){if(_0x2dc3cd[_0x3c7a('0x29')][_0x3c7a('0x2a')]){var _0x37adbf=_[_0x3c7a('0x2b')](_0x2dc3cd['entry_list'],function(_0x2d1668){return _0x2d1668[_0x3c7a('0x2c')]['phone_home'][_0x3c7a('0x2d')]===_0x40f797;});if(_0x37adbf){logger['info'](_0x3c7a('0x34'));return BPromise[_0x3c7a('0x2f')]({'id':_0x37adbf['name_value_list']['id'][_0x3c7a('0x2d')],'name':_0x37adbf[_0x3c7a('0x2c')][_0x3c7a('0xd')][_0x3c7a('0x2d')],'phone':_0x37adbf[_0x3c7a('0x2c')][_0x3c7a('0x33')][_0x3c7a('0x2d')]});}}else{logger[_0x3c7a('0xc')](_0x3c7a('0x35'));return request({'form':{'method':_0x3c7a('0x36'),'input_type':'JSON','response_type':_0x3c7a('0x1d'),'rest_data':JSON[_0x3c7a('0x1e')]({'session':_0x5dab5f['id'],'module_name':_0x3c7a('0x18'),'name_value_list':[{'name':_0x3c7a('0x37'),'value':_0x2e9ad2!==_0x3c7a('0x38')?_0x2e9ad2:util[_0x3c7a('0x20')](_0x3c7a('0x39'),_0x40f797)},{'name':_0x3c7a('0x33'),'value':_0x40f797}]})}})['then'](function(_0x67ac98){logger[_0x3c7a('0xc')]('Enduser\x20created.');return BPromise[_0x3c7a('0x2f')]({'id':_0x67ac98['id'],'name':_0x67ac98['entry_list']['first_name']['value'],'phone':_0x67ac98['entry_list'][_0x3c7a('0x33')][_0x3c7a('0x2d')]});});}});}function request(_0xbf4088){logger['debug'](_0x3c7a('0x3a'),JSON[_0x3c7a('0x1e')](_0xbf4088));return rp(_['merge'](def,_0xbf4088));}function getTags(_0x5e3238,_0x491335){var _0x2a68d5=[];if(_0x5e3238&&_0x5e3238[_0x3c7a('0x2a')]>0x0){_0x2a68d5=_[_0x3c7a('0x3b')](_0x5e3238,_0x491335);}return _0x2a68d5;}function getCustomFields(_0x3e657a,_0x8d805a){var _0x3e6a70=[];var _0x3f6060={'custom_fields':[]};if(_0x3e657a[_0x3c7a('0x2a')]>0x0){_[_0x3c7a('0x19')](_0x3e657a,function(_0x3a6a00){if(_0x3a6a00[_0x3c7a('0x3c')]===_0x3c7a('0x3d')&&_0x3a6a00[_0x3c7a('0x3e')]&&!_0x3a6a00[_0x3c7a('0x3f')]){_0x3f6060[_0x3a6a00[_0x3c7a('0x3e')]['toLowerCase']()]=_0x3a6a00[_0x3c7a('0x40')][_0x3c7a('0x23')]();}else if(_0x3a6a00['type']==='string'&&_0x3a6a00['idField']&&_0x3a6a00[_0x3c7a('0x3f')]){_0x3f6060[_0x3c7a('0x41')][_0x3c7a('0x1b')]({'id':_0x3a6a00[_0x3c7a('0x1c')],'value':_0x3a6a00[_0x3c7a('0x40')][_0x3c7a('0x23')]()});}else if(_0x3a6a00[_0x3c7a('0x3c')]===_0x3c7a('0x42')&&_0x3a6a00[_0x3c7a('0x1a')]&&_0x3a6a00[_0x3c7a('0x1c')]&&_0x3a6a00[_0x3c7a('0x3f')]){_0x8d805a[_0x3a6a00['variableName']]&&_0x3f6060['custom_fields']['push']({'id':_0x3a6a00[_0x3c7a('0x1c')],'value':_0x8d805a[_0x3a6a00[_0x3c7a('0x1a')]][_0x3c7a('0x23')]()});}else if(_0x3a6a00[_0x3c7a('0x3c')]===_0x3c7a('0x43')&&_0x3a6a00['Variable']&&_0x3a6a00[_0x3c7a('0x44')][_0x3c7a('0xd')]&&_0x3a6a00[_0x3c7a('0x1c')]&&_0x3a6a00[_0x3c7a('0x3f')]){_0x8d805a[_0x3a6a00[_0x3c7a('0x44')][_0x3c7a('0xd')][_0x3c7a('0x45')]()]&&_0x3f6060['custom_fields']['push']({'id':_0x3a6a00[_0x3c7a('0x1c')],'value':_0x8d805a[_0x3a6a00[_0x3c7a('0x44')][_0x3c7a('0xd')][_0x3c7a('0x45')]()][_0x3c7a('0x23')]()});}});}return _0x3f6060;}function getConnection(_0x4533f8){return request({'method':'POST','form':{'method':_0x3c7a('0x46'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3c7a('0x1e')]({'user_auth':{'user_name':_0x4533f8[_0x3c7a('0x47')],'password':_0x4533f8[_0x3c7a('0x48')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x5b940d){var _0xb73351=_0x5b940d;if(_0xb73351['id']){def[_0x3c7a('0x49')]=_0xb73351['id'];return BPromise[_0x3c7a('0x2f')](_0xb73351);}else{throw new Error(util[_0x3c7a('0x20')](_0x3c7a('0x4a'),_0x4533f8['id']));}});}function setRelationship(_0x11f7ee,_0x124411,_0xd8fb9f,_0x3f5656){return request({'form':{'method':_0x3c7a('0x4b'),'input_type':_0x3c7a('0x1d'),'response_type':_0x3c7a('0x1d'),'rest_data':JSON[_0x3c7a('0x1e')]({'session':_0x11f7ee['id'],'module_name':_0x3c7a('0x1f'),'module_id':_0xd8fb9f['id'],'link_field_name':_0x3f5656,'related_ids':[_0x124411['id']]})}});}exports[_0x3c7a('0x4c')]=function(_0x5eb534,_0x565335,_0x51e790,_0x544394,_0x4a772a,_0x3ad68e){var _0x4e4995,_0xf33c29,_0x368ce3,_0x49c505;_0x3ad68e[_0x3c7a('0x4d')]=intUtil['stripTrailingSlash'](_0x3ad68e['remoteUri']);_0x3ad68e[_0x3c7a('0x4e')]=intUtil[_0x3c7a('0x4f')](_0x3ad68e[_0x3c7a('0x4e')]);def['uri']=util[_0x3c7a('0x20')]('%s/service/v4_1/rest.php',_0x3ad68e[_0x3c7a('0x4d')]);if(_0x4a772a&&_0x4a772a['monitor_format']){logger[_0x3c7a('0xc')](_0x3c7a('0x50'),'Recording\x20is\x20enabled!');_0x565335[_0x3c7a('0x51')]=util[_0x3c7a('0x20')](_0x3c7a('0x52'),_0x3ad68e[_0x3c7a('0x4e')],_0x565335[_0x3c7a('0x53')],md5(_0x565335[_0x3c7a('0x53')]));}else{_0x565335[_0x3c7a('0x51')]='';}return getConnection(_0x3ad68e)['then'](function(_0x204474){_0x49c505=_0x204474;return getUser(_0x3ad68e,_0x544394[_0x3c7a('0xd')],_0x49c505);})['then'](function(_0x2eeea4){_0x4e4995=_0x2eeea4;logger['info'](_0x3c7a('0x54'),_0x4e4995['id']);return getEndUser(_0x3ad68e,_0x565335[_0x3c7a('0x55')],_0x565335['calleridnum'],_0x49c505);})['then'](function(_0x180b00){_0xf33c29=_0x180b00;logger[_0x3c7a('0xc')]('The\x20Enduser\x20ID\x20is:',_0xf33c29['id']);return getTicket(_0x3ad68e,_0x4e4995,_0xf33c29,_0x51e790,_0x565335,_0x51e790[_0x3c7a('0x56')],_0x49c505);})[_0x3c7a('0x28')](function(_0x1bbd6e){_0x368ce3=_0x1bbd6e;logger[_0x3c7a('0xc')]('Ticket\x20created!');logger[_0x3c7a('0xc')]('The\x20Ticket\x20ID\x20is:',_0x368ce3['id']);return setRelationship(_0x49c505,_0x4e4995,_0x368ce3,_0x3c7a('0x57'));})[_0x3c7a('0x28')](function(){return setRelationship(_0x49c505,_0xf33c29,_0x368ce3,'contacts');})['then'](function(){return getServerInfo(_0x49c505);})['then'](function(_0x2994c3){var _0x2a6351=parseInt(_0x2994c3[_0x3c7a('0x58')][_0x3c7a('0x59')](0x0));var _0x166e23=util[_0x3c7a('0x20')](_0x3c7a('0x5a'),_0x3ad68e['remoteUri'],_0x368ce3['id']);if(_0x2a6351>0x6){_0x166e23=util[_0x3c7a('0x20')](_0x3c7a('0x5b'),_0x3ad68e['remoteUri'],_0x368ce3['id']);}logger['info'](_0x3c7a('0x50'),_0x3c7a('0x5c'));emit(util[_0x3c7a('0x20')]('user:%s',_0x544394[_0x3c7a('0xd')]),_0x3c7a('0x5d'),{'uri':_0x166e23});})[_0x3c7a('0x5e')](function(_0xd2170a){logger[_0x3c7a('0x5f')](_0x3c7a('0x50'),JSON[_0x3c7a('0x1e')](_0xd2170a));});};exports[_0x3c7a('0x60')]=function(_0x32bf79,_0x5d5e49,_0x5c36df,_0x12559d,_0x1aa343,_0x458541,_0x5875ee){var _0x167d31,_0x52e98a,_0x44829d,_0x5d194a;_0x458541['remoteUri']=intUtil[_0x3c7a('0x4f')](_0x458541[_0x3c7a('0x4d')]);_0x458541[_0x3c7a('0x4e')]=intUtil['stripTrailingSlash'](_0x458541[_0x3c7a('0x4e')]);def[_0x3c7a('0x61')]=util['format'](_0x3c7a('0x62'),_0x458541[_0x3c7a('0x4d')]);if(_0x5875ee&&_0x5875ee[_0x3c7a('0x63')]&&_0x5875ee['recordingFormat']!==_0x3c7a('0x64')){logger[_0x3c7a('0xc')](_0x3c7a('0x65'),_0x3c7a('0x66'));_0x5d5e49[_0x3c7a('0x51')]=util[_0x3c7a('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x458541[_0x3c7a('0x4e')],_0x5d5e49[_0x3c7a('0x53')],md5(_0x5d5e49[_0x3c7a('0x53')]));}return getConnection(_0x458541)['then'](function(_0x3c48f1){_0x5d194a=_0x3c48f1;return getUser(_0x458541,_0x12559d[_0x3c7a('0xd')],_0x5d194a);})['then'](function(_0x56bc3f){_0x167d31=_0x56bc3f;logger[_0x3c7a('0xc')]('The\x20User\x20ID\x20is:',_0x167d31['id']);return getEndUser(_0x458541,_0x5d5e49[_0x3c7a('0x67')],_0x5d5e49[_0x3c7a('0x68')],_0x5d194a);})[_0x3c7a('0x28')](function(_0x51f20f){_0x52e98a=_0x51f20f;logger[_0x3c7a('0xc')](_0x3c7a('0x69'),_0x52e98a['id']);return getTicket(_0x458541,_0x167d31,_0x52e98a,_0x5c36df,_0x5d5e49,_0x5c36df[_0x3c7a('0x56')],_0x5d194a);})[_0x3c7a('0x28')](function(_0x3e976b){_0x44829d=_0x3e976b;logger[_0x3c7a('0xc')](_0x3c7a('0x6a'));logger[_0x3c7a('0xc')](_0x3c7a('0x6b'),_0x44829d['id']);return setRelationship(_0x5d194a,_0x167d31,_0x44829d,'users');})[_0x3c7a('0x28')](function(){return setRelationship(_0x5d194a,_0x52e98a,_0x44829d,_0x3c7a('0x6c'));})['then'](function(){return getServerInfo(_0x5d194a);})[_0x3c7a('0x28')](function(_0x43e369){var _0x2fd935=parseInt(_0x43e369[_0x3c7a('0x58')]['charAt'](0x0));var _0x347c01=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x458541['remoteUri'],_0x44829d['id']);if(_0x2fd935>0x6){_0x347c01=util[_0x3c7a('0x20')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x458541[_0x3c7a('0x4d')],_0x44829d['id']);}logger[_0x3c7a('0xc')](_0x3c7a('0x65'),_0x3c7a('0x5c'));emit(util[_0x3c7a('0x20')](_0x3c7a('0x6d'),_0x12559d[_0x3c7a('0xd')]),'trigger:browser:url',{'uri':_0x347c01});})[_0x3c7a('0x5e')](function(_0x22cc6e){logger[_0x3c7a('0x5f')](_0x3c7a('0x65'),JSON['stringify'](_0x22cc6e));});};exports[_0x3c7a('0x6e')]=function(_0x177ca7,_0x4dd710,_0x405e33,_0x50b54f,_0x158cdb,_0x2720e6){var _0x335694,_0x168b33,_0x2a7317,_0x3af3f6;_0x2720e6[_0x3c7a('0x4d')]=intUtil[_0x3c7a('0x4f')](_0x2720e6['remoteUri']);_0x2720e6['serverUrl']=intUtil[_0x3c7a('0x4f')](_0x2720e6['serverUrl']);def[_0x3c7a('0x61')]=util[_0x3c7a('0x20')](_0x3c7a('0x62'),_0x2720e6[_0x3c7a('0x4d')]);if(_0x158cdb&&_0x158cdb[_0x3c7a('0x6f')]){logger[_0x3c7a('0xc')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x4dd710[_0x3c7a('0x51')]=util[_0x3c7a('0x20')](_0x3c7a('0x52'),_0x2720e6[_0x3c7a('0x4e')],_0x4dd710['uniqueid'],md5(_0x4dd710[_0x3c7a('0x53')]));}else{_0x4dd710['recordingURL']='';}return getConnection(_0x2720e6)['then'](function(_0x9023c4){_0x3af3f6=_0x9023c4;return getUser(_0x2720e6,_0x50b54f[_0x3c7a('0xd')],_0x3af3f6);})[_0x3c7a('0x28')](function(_0x3289f0){_0x335694=_0x3289f0;logger[_0x3c7a('0xc')]('The\x20User\x20ID\x20is:',_0x335694['id']);return getEndUser(_0x2720e6,_0x4dd710[_0x3c7a('0x55')],_0x4dd710[_0x3c7a('0x70')],_0x3af3f6);})[_0x3c7a('0x28')](function(_0x580e3f){_0x168b33=_0x580e3f;logger[_0x3c7a('0xc')](_0x3c7a('0x69'),_0x168b33['id']);return getTicket(_0x2720e6,_0x335694,_0x168b33,_0x405e33,_0x4dd710,_0x405e33['Fields'],_0x3af3f6);})[_0x3c7a('0x28')](function(_0x32627b){_0x2a7317=_0x32627b;logger[_0x3c7a('0xc')]('Ticket\x20created!');logger[_0x3c7a('0xc')](_0x3c7a('0x6b'),_0x2a7317['id']);return setRelationship(_0x3af3f6,_0x335694,_0x2a7317,'users');})[_0x3c7a('0x28')](function(){return setRelationship(_0x3af3f6,_0x168b33,_0x2a7317,'contacts');})[_0x3c7a('0x28')](function(){return getServerInfo(_0x3af3f6);})[_0x3c7a('0x5e')](function(_0x4374b6){logger[_0x3c7a('0x5f')]('[ABANDONED]',JSON[_0x3c7a('0x1e')](_0x4374b6));});};
\ No newline at end of file
index f56fc15..d747d78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f7=['getString','sortBy','length','type','push','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','variable','stripTrailingSlash','lodash','util'];(function(_0x33f37b,_0x1eef72){var _0x4ade47=function(_0xe22b0b){while(--_0xe22b0b){_0x33f37b['push'](_0x33f37b['shift']());}};_0x4ade47(++_0x1eef72);}(_0x17f7,0x139));var _0x717f=function(_0x10bc8a,_0x454ac6){_0x10bc8a=_0x10bc8a-0x0;var _0x3ec2a5=_0x17f7[_0x10bc8a];return _0x3ec2a5;};'use strict';var _=require(_0x717f('0x0'));var util=require(_0x717f('0x1'));exports[_0x717f('0x2')]=function(_0x44522c,_0x52e272,_0x2a7e1b){var _0x9229f0=[];if(_0x44522c['length']>0x0){var _0x3e9584=_[_0x717f('0x3')](_0x44522c,['id']);for(var _0x59717d=0x0;_0x59717d<_0x3e9584[_0x717f('0x4')];_0x59717d++){var _0x237168=_0x3e9584[_0x59717d];if(_0x237168[_0x717f('0x5')]==='string'){_0x9229f0[_0x717f('0x6')](_0x237168['content']);}else if(_0x237168[_0x717f('0x5')]==='variable'&&_0x237168[_0x717f('0x7')]){_0x52e272[_0x237168['variableName']]&&_0x9229f0[_0x717f('0x6')](_0x52e272[_0x237168[_0x717f('0x7')]][_0x717f('0x8')]());}else if(_0x237168[_0x717f('0x5')]===_0x717f('0x9')&&_0x237168[_0x717f('0xa')]&&_0x237168[_0x717f('0xa')][_0x717f('0xb')]){_0x52e272[_0x237168[_0x717f('0xa')][_0x717f('0xb')]['toLowerCase']()]&&_0x9229f0['push'](_0x52e272[_0x237168[_0x717f('0xa')][_0x717f('0xb')][_0x717f('0xc')]()][_0x717f('0x8')]());}else if(_0x237168[_0x717f('0x5')]===_0x717f('0xd')){if(_0x237168[_0x717f('0xe')]===_0x717f('0xf')&&_0x237168[_0x717f('0x10')]){_0x9229f0[_0x717f('0x6')](util[_0x717f('0x11')](_0x717f('0x12'),_0x237168['key'],_0x237168['keyContent']));}else if(_0x237168[_0x717f('0xe')]===_0x717f('0x13')&&_0x237168['variableName']&&_0x237168[_0x717f('0x10')]){_0x52e272[_0x237168['variableName']]&&_0x9229f0[_0x717f('0x6')](util[_0x717f('0x11')]('%s:\x20%s',_0x237168[_0x717f('0x10')],_0x52e272[_0x237168['variableName']]));}else if(_0x237168[_0x717f('0xe')]===_0x717f('0x9')&&_0x237168[_0x717f('0xa')]&&_0x237168[_0x717f('0xa')][_0x717f('0xb')]&&_0x237168[_0x717f('0x10')]){_0x52e272[_0x237168[_0x717f('0xa')][_0x717f('0xb')]['toLowerCase']()]&&_0x9229f0['push'](util[_0x717f('0x11')](_0x717f('0x12'),_0x237168[_0x717f('0x10')],_0x52e272[_0x237168[_0x717f('0xa')][_0x717f('0xb')][_0x717f('0xc')]()]));}}}}return _0x9229f0['join'](_0x2a7e1b);};exports[_0x717f('0x14')]=function(_0x1bc2e1){if(_0x1bc2e1&&_0x1bc2e1['substr'](-0x1)==='/'){return _0x1bc2e1['substr'](0x0,_0x1bc2e1['length']-0x1);}return _0x1bc2e1;};
\ No newline at end of file
+var _0x00fc=['stripTrailingSlash','substr','lodash','util','getString','sortBy','length','push','content','type','variableName','toString','customVariable','Variable','name','toLowerCase','key','format','%s:\x20%s','keyContent','keyType','variable'];(function(_0x47c429,_0x2daeec){var _0x499a94=function(_0x292a57){while(--_0x292a57){_0x47c429['push'](_0x47c429['shift']());}};_0x499a94(++_0x2daeec);}(_0x00fc,0x1a4));var _0xc00f=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x00fc[_0x2dd390];return _0x3afe47;};'use strict';var _=require(_0xc00f('0x0'));var util=require(_0xc00f('0x1'));exports[_0xc00f('0x2')]=function(_0x3dbaf3,_0x129df1,_0x3755d0){var _0x5e8640=[];if(_0x3dbaf3['length']>0x0){var _0x536c27=_[_0xc00f('0x3')](_0x3dbaf3,['id']);for(var _0x3e5650=0x0;_0x3e5650<_0x536c27[_0xc00f('0x4')];_0x3e5650++){var _0x1ac1e6=_0x536c27[_0x3e5650];if(_0x1ac1e6['type']==='string'){_0x5e8640[_0xc00f('0x5')](_0x1ac1e6[_0xc00f('0x6')]);}else if(_0x1ac1e6[_0xc00f('0x7')]==='variable'&&_0x1ac1e6[_0xc00f('0x8')]){_0x129df1[_0x1ac1e6['variableName']]&&_0x5e8640[_0xc00f('0x5')](_0x129df1[_0x1ac1e6['variableName']][_0xc00f('0x9')]());}else if(_0x1ac1e6[_0xc00f('0x7')]===_0xc00f('0xa')&&_0x1ac1e6[_0xc00f('0xb')]&&_0x1ac1e6['Variable'][_0xc00f('0xc')]){_0x129df1[_0x1ac1e6[_0xc00f('0xb')]['name']['toLowerCase']()]&&_0x5e8640[_0xc00f('0x5')](_0x129df1[_0x1ac1e6[_0xc00f('0xb')]['name'][_0xc00f('0xd')]()][_0xc00f('0x9')]());}else if(_0x1ac1e6['type']==='keyValue'){if(_0x1ac1e6['keyType']==='string'&&_0x1ac1e6[_0xc00f('0xe')]){_0x5e8640[_0xc00f('0x5')](util[_0xc00f('0xf')](_0xc00f('0x10'),_0x1ac1e6['key'],_0x1ac1e6[_0xc00f('0x11')]));}else if(_0x1ac1e6[_0xc00f('0x12')]===_0xc00f('0x13')&&_0x1ac1e6[_0xc00f('0x8')]&&_0x1ac1e6['key']){_0x129df1[_0x1ac1e6[_0xc00f('0x8')]]&&_0x5e8640[_0xc00f('0x5')](util[_0xc00f('0xf')](_0xc00f('0x10'),_0x1ac1e6['key'],_0x129df1[_0x1ac1e6['variableName']]));}else if(_0x1ac1e6['keyType']===_0xc00f('0xa')&&_0x1ac1e6[_0xc00f('0xb')]&&_0x1ac1e6['Variable']['name']&&_0x1ac1e6[_0xc00f('0xe')]){_0x129df1[_0x1ac1e6['Variable'][_0xc00f('0xc')][_0xc00f('0xd')]()]&&_0x5e8640['push'](util[_0xc00f('0xf')](_0xc00f('0x10'),_0x1ac1e6[_0xc00f('0xe')],_0x129df1[_0x1ac1e6['Variable']['name'][_0xc00f('0xd')]()]));}}}}return _0x5e8640['join'](_0x3755d0);};exports[_0xc00f('0x14')]=function(_0x536be1){if(_0x536be1&&_0x536be1[_0xc00f('0x15')](-0x1)==='/'){return _0x536be1[_0xc00f('0x15')](0x0,_0x536be1[_0xc00f('0x4')]-0x1);}return _0x536be1;};
\ No newline at end of file
index f0b1b45..b56e9f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['variable','variableName','idField','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','format','%s/webservice.php','remoteUri','create','sessionName','HelpDesk','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','test','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','GET','admin','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','statusCode','Searching\x20end\x20user\x20with\x20phone','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','POST','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','uniqueid','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','abandoned','monitor_format','[ABANDONED]','Ticket\x20created!','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','type','toString'];(function(_0x22d094,_0x35ca09){var _0x3e0b3c=function(_0x1b35d0){while(--_0x1b35d0){_0x22d094['push'](_0x22d094['shift']());}};_0x3e0b3c(++_0x35ca09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_0xfeb75b[_0x0a9e('0xd')]==='string'&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b['idField']]=_0xfeb75b['content'][_0x0a9e('0xe')]();}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xf')&&_0xfeb75b[_0x0a9e('0x10')]&&_0xfeb75b[_0x0a9e('0x11')]&&_0x39753a[_0xfeb75b[_0x0a9e('0x10')]]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x10')]][_0x0a9e('0xe')]();}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b[_0x0a9e('0x13')]['name']&&_0xfeb75b[_0x0a9e('0x11')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x14')]['toLowerCase']()]){_0xf81284[_0xfeb75b[_0x0a9e('0x11')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]['name'][_0x0a9e('0x15')]()]['toString']();}});}return _0xf81284;}function createTicket(_0x459eb1,_0x478723,_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));var _0x112016=_[_0x0a9e('0x18')]({'parent_id':'','assigned_user_id':_0x478723['id'],'ticketpriorities':_0x0a9e('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x0a9e('0x1a')](_0x205fd6[_0x0a9e('0x1b')],_0x31b1ca,'\x20'),'description':intUtil['getString'](_0x205fd6[_0x0a9e('0x1c')],_0x31b1ca,'\x0a'),'contact_id':_0x106033['id']},getCustomFields(_0x2eb11f,_0x31b1ca));var _0x5a09ef={'method':'POST','uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x20'),'username':'admin','sessionName':_0x530eb7[_0x0a9e('0x21')],'elementType':_0x0a9e('0x22'),'element':JSON[_0x0a9e('0x23')](_0x112016)},'json':!![]};return request(_0x5a09ef)[_0x0a9e('0x24')](function(_0x370d86){if(_0x370d86[_0x0a9e('0x25')]){return BPromise[_0x0a9e('0x26')]({'id':_0x370d86['result']['id']});}else{throw new Error(util['format'](_0x0a9e('0x27'),JSON[_0x0a9e('0x23')](_0x370d86[_0x0a9e('0x28')])));}})[_0x0a9e('0x29')](function(_0x526cf3){var _0x384319=req['query'][_0x0a9e('0x2a')]?0x1f4:_0x526cf3['statusCode']||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x384319,JSON[_0x0a9e('0x23')](_0x526cf3));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){logger[_0x0a9e('0x16')]('Getting\x20agent\x20with\x20email',_0x1538a4);return request({'method':_0x0a9e('0x2d'),'uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x140511[_0x0a9e('0x1f')]),'qs':{'operation':'query','username':_0x0a9e('0x2e'),'sessionName':_0x11c3b6[_0x0a9e('0x21')],'query':util[_0x0a9e('0x1d')](_0x0a9e('0x2f'),_0x1538a4)},'json':!![]})[_0x0a9e('0x24')](function(_0x563b45){if(_0x563b45[_0x0a9e('0x25')]&&_0x563b45[_0x0a9e('0x30')][_0x0a9e('0xb')]){logger['info'](_0x0a9e('0x31'));return BPromise['resolve']({'id':_0x563b45[_0x0a9e('0x30')][0x0]['id'],'email':_0x563b45[_0x0a9e('0x30')][0x0][_0x0a9e('0x32')],'name':_0x563b45[_0x0a9e('0x30')][0x0][_0x0a9e('0x33')]+'\x20'+_0x563b45['result'][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x16')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x26')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x37')],'name':_0x0a9e('0x2e')});}})[_0x0a9e('0x29')](function(_0x5583a4){var _0x44295a=req['query'][_0x0a9e('0x2a')]?0x1f4:_0x5583a4[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x2b'),'getUser',_0x44295a,JSON[_0x0a9e('0x23')](_0x5583a4));});}function getEndUser(_0xd1836d,_0x1fa90d,_0x15de0e,_0x4853b1){logger['info'](_0x0a9e('0x39'),_0x15de0e);return request({'method':'GET','uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0xd1836d[_0x0a9e('0x1f')]),'qs':{'operation':_0x0a9e('0x3a'),'username':'admin','sessionName':_0x4853b1[_0x0a9e('0x21')],'query':util[_0x0a9e('0x1d')](_0x0a9e('0x3b'),_0x15de0e,_0x15de0e,_0x15de0e,_0x15de0e,_0x15de0e)},'json':!![]})['then'](function(_0x1dbf74){if(_0x1dbf74[_0x0a9e('0x25')]&&_0x1dbf74[_0x0a9e('0x30')]['length']){logger['info'](_0x0a9e('0x3c'));return BPromise[_0x0a9e('0x26')]({'id':_0x1dbf74['result'][0x0]['id'],'name':_0x1dbf74[_0x0a9e('0x30')][0x0][_0x0a9e('0x3d')]+'\x20'+_0x1dbf74[_0x0a9e('0x30')][0x0][_0x0a9e('0x3e')],'phone':_0x15de0e});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x0a9e('0x3f'),'uri':util[_0x0a9e('0x1d')]('%s/webservice.php',_0xd1836d[_0x0a9e('0x1f')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x4853b1[_0x0a9e('0x21')],'elementType':'Contacts','element':JSON[_0x0a9e('0x23')]({'lastname':_0x1fa90d,'phone':_0x15de0e,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x24')](function(_0x274e8e){logger[_0x0a9e('0x16')](_0x0a9e('0x40'));return BPromise[_0x0a9e('0x26')]({'id':_0x274e8e[_0x0a9e('0x30')]['id'],'name':_0x274e8e[_0x0a9e('0x30')][_0x0a9e('0x3e')],'phone':_0x274e8e[_0x0a9e('0x30')][_0x0a9e('0x41')]});})[_0x0a9e('0x29')](function(_0x1a7bce){var _0x11ca30=req[_0x0a9e('0x3a')]['test']?0x1f4:_0x1a7bce['statusCode']||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x2b'),_0x0a9e('0x42'),_0x11ca30,JSON[_0x0a9e('0x23')](_0x1a7bce));});}});}function getConnection(_0x1a69dd){var _0xc9a702=_0x1a69dd[_0x0a9e('0x37')];var _0x445e25=_0x1a69dd[_0x0a9e('0x43')];return request({'method':_0x0a9e('0x2d'),'uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x1a69dd['remoteUri']),'qs':{'operation':_0x0a9e('0x44'),'username':_0xc9a702},'json':!![]})[_0x0a9e('0x24')](function(_0xdd268f){if(_0xdd268f[_0x0a9e('0x25')]){return request({'method':_0x0a9e('0x3f'),'uri':util[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x1a69dd[_0x0a9e('0x1f')]),'form':{'operation':'login','username':_0x0a9e('0x2e'),'accessKey':md5(_0xdd268f['result'][_0x0a9e('0x45')]+_0x445e25)},'json':!![]});}})[_0x0a9e('0x24')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return BPromise[_0x0a9e('0x26')](_0x8d6dd1[_0x0a9e('0x30')]);}else{throw new Error(util[_0x0a9e('0x1d')](_0x0a9e('0x46'),_0x1a69dd['id']));}})[_0x0a9e('0x29')](function(_0x37be73){var _0x45bf7f=req['query'][_0x0a9e('0x2a')]?0x1f4:_0x37be73[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x28')](_0x0a9e('0x2b'),_0x0a9e('0x47'),_0x45bf7f,JSON[_0x0a9e('0x23')](_0x37be73));});}function request(_0x6054ee){logger[_0x0a9e('0x16')](_0x0a9e('0x48'),JSON['stringify'](_0x6054ee));return rp(_0x6054ee);}exports[_0x0a9e('0x49')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa,_0x11545a,_0x61bb17,_0x30decb;_0x4317e3[_0x0a9e('0x1f')]=intUtil[_0x0a9e('0x4a')](_0x4317e3['remoteUri']);if(_0x1adfee&&_0x1adfee['monitor_format']){logger['info'](_0x0a9e('0x4b'),_0x0a9e('0x4c'));_0x4f7240[_0x0a9e('0x4d')]=util['format'](_0x0a9e('0x4e'),_0x4317e3[_0x0a9e('0x4f')],_0x4f7240['uniqueid'],md5(_0x4f7240['uniqueid']));}else{_0x4f7240[_0x0a9e('0x4d')]='';}return getConnection(_0x4317e3)['then'](function(_0x443e72){_0x30decb=_0x443e72;return getUser(_0x4317e3,_0x5ddf84?_0x5ddf84['email']:'',_0x30decb);})[_0x0a9e('0x24')](function(_0x3c20b2){_0x37edaa=_0x3c20b2;logger[_0x0a9e('0x16')]('The\x20User\x20ID\x20is:',_0x37edaa['id']);return getEndUser(_0x4317e3,_0x4f7240[_0x0a9e('0x50')],_0x4f7240[_0x0a9e('0x51')],_0x30decb);})['then'](function(_0x50f687){_0x11545a=_0x50f687;logger[_0x0a9e('0x16')](_0x0a9e('0x52'),_0x11545a['id']);return createTicket(_0x4317e3,_0x37edaa,_0x11545a,_0x4ae14b,_0x4f7240,_0x4ae14b['Fields'],_0x30decb);})[_0x0a9e('0x24')](function(_0x5ce9ac){_0x61bb17=_0x5ce9ac;logger[_0x0a9e('0x16')]('Ticket\x20created!');logger[_0x0a9e('0x16')]('The\x20Ticket\x20ID\x20is:',_0x61bb17['id']);var _0x5da27d=util['format'](_0x0a9e('0x53'),_0x4317e3['remoteUri'],_[_0x0a9e('0x54')](_0x61bb17['id'],'x')[0x1]);logger[_0x0a9e('0x16')](_0x0a9e('0x4b'),_0x0a9e('0x55'));emit(util[_0x0a9e('0x1d')](_0x0a9e('0x56'),_0x5ddf84[_0x0a9e('0x14')]),_0x0a9e('0x57'),{'uri':_0x5da27d});})['catch'](function(_0x1c693e){logger[_0x0a9e('0x28')](_0x0a9e('0x4b'),JSON[_0x0a9e('0x23')](_0x1c693e));});};exports[_0x0a9e('0x58')]=function(_0x156662,_0x5d86e9,_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc,_0x5cc8fb){var _0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee;_0x3649cc[_0x0a9e('0x1f')]=intUtil['stripTrailingSlash'](_0x3649cc[_0x0a9e('0x1f')]);_0x3649cc[_0x0a9e('0x4f')]=intUtil[_0x0a9e('0x4a')](_0x3649cc[_0x0a9e('0x4f')]);if(_0x5cc8fb&&_0x5cc8fb[_0x0a9e('0x59')]&&_0x5cc8fb[_0x0a9e('0x59')]!=='none'){logger[_0x0a9e('0x16')]('[OUTBOUND]',_0x0a9e('0x4c'));_0x5d86e9[_0x0a9e('0x4d')]=util[_0x0a9e('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3649cc[_0x0a9e('0x4f')],_0x5d86e9[_0x0a9e('0x5a')],md5(_0x5d86e9[_0x0a9e('0x5a')]));}return getConnection(_0x3649cc)[_0x0a9e('0x24')](function(_0x497d91){_0x5674ee=_0x497d91;return getUser(_0x3649cc,_0x26bc80?_0x26bc80[_0x0a9e('0x5b')]:'',_0x5674ee);})[_0x0a9e('0x24')](function(_0x54327c){_0x20c668=_0x54327c;logger[_0x0a9e('0x16')](_0x0a9e('0x5c'),_0x20c668['id']);return getEndUser(_0x3649cc,_0x5d86e9[_0x0a9e('0x5d')],_0x5d86e9[_0x0a9e('0x5e')],_0x5674ee);})[_0x0a9e('0x24')](function(_0x4d4a35){_0x5ba1f9=_0x4d4a35;logger[_0x0a9e('0x16')](_0x0a9e('0x52'),_0x5ba1f9['id']);return createTicket(_0x3649cc,_0x20c668,_0x5ba1f9,_0x956fbe,_0x5d86e9,_0x956fbe[_0x0a9e('0x5f')],_0x5674ee);})['then'](function(_0x3528b7){_0x4b3c1a=_0x3528b7;logger['info']('Ticket\x20created!');logger[_0x0a9e('0x16')](_0x0a9e('0x60'),_0x4b3c1a['id']);var _0x9375fb=util[_0x0a9e('0x1d')](_0x0a9e('0x53'),_0x3649cc[_0x0a9e('0x1f')],_[_0x0a9e('0x54')](_0x4b3c1a['id'],'x')[0x1]);logger[_0x0a9e('0x16')](_0x0a9e('0x61'),_0x0a9e('0x55'));emit(util[_0x0a9e('0x1d')](_0x0a9e('0x56'),_0x26bc80[_0x0a9e('0x14')]),_0x0a9e('0x57'),{'uri':_0x9375fb});})[_0x0a9e('0x29')](function(_0x412a72){logger[_0x0a9e('0x28')](_0x0a9e('0x61'),JSON['stringify'](_0x412a72));});};exports[_0x0a9e('0x62')]=function(_0x295763,_0x243d12,_0x4edbb0,_0x1148a1,_0x30944e,_0x4b341d){var _0x83f0b2,_0x56e31e,_0x3ef315,_0x427946;_0x4b341d[_0x0a9e('0x1f')]=intUtil['stripTrailingSlash'](_0x4b341d['remoteUri']);_0x4b341d['serverUrl']=intUtil[_0x0a9e('0x4a')](_0x4b341d[_0x0a9e('0x4f')]);if(_0x30944e&&_0x30944e[_0x0a9e('0x63')]){logger[_0x0a9e('0x16')](_0x0a9e('0x64'),_0x0a9e('0x4c'));_0x243d12[_0x0a9e('0x4d')]=util[_0x0a9e('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b341d[_0x0a9e('0x4f')],_0x243d12[_0x0a9e('0x5a')],md5(_0x243d12[_0x0a9e('0x5a')]));}else{_0x243d12['recordingURL']='';}return getConnection(_0x4b341d)[_0x0a9e('0x24')](function(_0x583b2e){_0x427946=_0x583b2e;return getUser(_0x4b341d,_0x1148a1?_0x1148a1[_0x0a9e('0x5b')]:'',_0x427946);})[_0x0a9e('0x24')](function(_0x4c46c1){_0x83f0b2=_0x4c46c1;logger[_0x0a9e('0x16')](_0x0a9e('0x5c'),_0x83f0b2['id']);return getEndUser(_0x4b341d,_0x243d12[_0x0a9e('0x50')],_0x243d12[_0x0a9e('0x51')],_0x427946);})['then'](function(_0x1d442c){_0x56e31e=_0x1d442c;logger[_0x0a9e('0x16')](_0x0a9e('0x52'),_0x56e31e['id']);return createTicket(_0x4b341d,_0x83f0b2,_0x56e31e,_0x4edbb0,_0x243d12,_0x4edbb0[_0x0a9e('0x5f')],_0x427946);})['then'](function(_0x109ccb){_0x3ef315=_0x109ccb;logger[_0x0a9e('0x16')](_0x0a9e('0x65'));logger[_0x0a9e('0x16')]('The\x20Ticket\x20ID\x20is:',_0x3ef315['id']);})[_0x0a9e('0x29')](function(_0x3511c9){logger[_0x0a9e('0x28')](_0x0a9e('0x64'),JSON[_0x0a9e('0x23')](_0x3511c9));});};
\ No newline at end of file
+var _0x70e0=['type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Open','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','create','admin','sessionName','HelpDesk','then','success','result','stringify','error','catch','test','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','username','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','trigger:browser:url','abandoned','monitor_format','calleridname','[ABANDONED]','lodash','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x70e0,0x17b));var _0x070e=function(_0x3eefed,_0x1750ce){_0x3eefed=_0x3eefed-0x0;var _0x387788=_0x70e0[_0x3eefed];return _0x387788;};'use strict';var _=require(_0x070e('0x0'));var rp=require(_0x070e('0x1'));var BPromise=require(_0x070e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x070e('0x3'));var intUtil=require(_0x070e('0x4'));var config=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('vTiger');config[_0x070e('0x7')]=_['defaults'](config[_0x070e('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x35ab0c,_0x1e11f0,_0x604664){io['to'](_0x35ab0c)[_0x070e('0x8')](_0x1e11f0,_0x604664);}function getCustomFields(_0x111743,_0x68a09e){var _0x11ffa8={};if(_0x111743['length']>0x0){_['forEach'](_0x111743,function(_0x50f4eb){if(_0x50f4eb[_0x070e('0x9')]===_0x070e('0xa')&&_0x50f4eb[_0x070e('0xb')]){_0x11ffa8[_0x50f4eb[_0x070e('0xb')]]=_0x50f4eb[_0x070e('0xc')][_0x070e('0xd')]();}else if(_0x50f4eb[_0x070e('0x9')]===_0x070e('0xe')&&_0x50f4eb[_0x070e('0xf')]&&_0x50f4eb[_0x070e('0xb')]&&_0x68a09e[_0x50f4eb['variableName']]){_0x11ffa8[_0x50f4eb['idField']]=_0x68a09e[_0x50f4eb[_0x070e('0xf')]]['toString']();}else if(_0x50f4eb['type']==='customVariable'&&_0x50f4eb[_0x070e('0x10')]&&_0x50f4eb[_0x070e('0x10')]['name']&&_0x50f4eb['idField']&&_0x68a09e[_0x50f4eb[_0x070e('0x10')][_0x070e('0x11')][_0x070e('0x12')]()]){_0x11ffa8[_0x50f4eb[_0x070e('0xb')]]=_0x68a09e[_0x50f4eb['Variable']['name'][_0x070e('0x12')]()][_0x070e('0xd')]();}});}return _0x11ffa8;}function createTicket(_0x38f6e6,_0x2060cc,_0x364b3f,_0x5037eb,_0x3938b5,_0x168dc6,_0x1ad3de){logger[_0x070e('0x13')](_0x070e('0x14'));var _0x5c16fd=_['merge']({'parent_id':'','assigned_user_id':_0x2060cc['id'],'ticketpriorities':'Normal','ticketstatus':_0x070e('0x15'),'ticket_title':intUtil[_0x070e('0x16')](_0x5037eb[_0x070e('0x17')],_0x3938b5,'\x20'),'description':intUtil['getString'](_0x5037eb[_0x070e('0x18')],_0x3938b5,'\x0a'),'contact_id':_0x364b3f['id']},getCustomFields(_0x168dc6,_0x3938b5));var _0x5dc5d2={'method':_0x070e('0x19'),'uri':util[_0x070e('0x1a')](_0x070e('0x1b'),_0x38f6e6[_0x070e('0x1c')]),'form':{'operation':_0x070e('0x1d'),'username':_0x070e('0x1e'),'sessionName':_0x1ad3de[_0x070e('0x1f')],'elementType':_0x070e('0x20'),'element':JSON['stringify'](_0x5c16fd)},'json':!![]};return request(_0x5dc5d2)[_0x070e('0x21')](function(_0x270061){if(_0x270061[_0x070e('0x22')]){return BPromise['resolve']({'id':_0x270061[_0x070e('0x23')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x070e('0x24')](_0x270061[_0x070e('0x25')])));}})[_0x070e('0x26')](function(_0x1743cc){var _0x4763c6=req['query'][_0x070e('0x27')]?0x1f4:_0x1743cc[_0x070e('0x28')]||0x1f4;logger[_0x070e('0x25')](_0x070e('0x29'),_0x070e('0x2a'),_0x4763c6,JSON[_0x070e('0x24')](_0x1743cc));});}function getUser(_0x1a1892,_0x26373b,_0x5e8326){logger[_0x070e('0x13')](_0x070e('0x2b'),_0x26373b);return request({'method':_0x070e('0x2c'),'uri':util['format']('%s/webservice.php',_0x1a1892[_0x070e('0x1c')]),'qs':{'operation':_0x070e('0x2d'),'username':_0x070e('0x1e'),'sessionName':_0x5e8326['sessionName'],'query':util[_0x070e('0x1a')](_0x070e('0x2e'),_0x26373b)},'json':!![]})[_0x070e('0x21')](function(_0x5f2bee){if(_0x5f2bee['success']&&_0x5f2bee['result']['length']){logger['info'](_0x070e('0x2f'));return BPromise['resolve']({'id':_0x5f2bee[_0x070e('0x23')][0x0]['id'],'email':_0x5f2bee[_0x070e('0x23')][0x0]['email1'],'name':_0x5f2bee['result'][0x0][_0x070e('0x30')]+'\x20'+_0x5f2bee[_0x070e('0x23')]['last_name']});}else{logger['info'](_0x070e('0x31'));return BPromise[_0x070e('0x32')]({'id':_0x5e8326[_0x070e('0x33')],'email':_0x1a1892[_0x070e('0x34')],'name':_0x070e('0x1e')});}})['catch'](function(_0x482cc2){var _0x24d17d=req[_0x070e('0x2d')][_0x070e('0x27')]?0x1f4:_0x482cc2[_0x070e('0x28')]||0x1f4;logger[_0x070e('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x070e('0x35'),_0x24d17d,JSON[_0x070e('0x24')](_0x482cc2));});}function getEndUser(_0x534150,_0x2d6bb6,_0x34746e,_0x4ba6f0){logger['info']('Searching\x20end\x20user\x20with\x20phone',_0x34746e);return request({'method':_0x070e('0x2c'),'uri':util[_0x070e('0x1a')](_0x070e('0x1b'),_0x534150[_0x070e('0x1c')]),'qs':{'operation':_0x070e('0x2d'),'username':'admin','sessionName':_0x4ba6f0[_0x070e('0x1f')],'query':util[_0x070e('0x1a')](_0x070e('0x36'),_0x34746e,_0x34746e,_0x34746e,_0x34746e,_0x34746e)},'json':!![]})['then'](function(_0x268c5d){if(_0x268c5d[_0x070e('0x22')]&&_0x268c5d[_0x070e('0x23')]['length']){logger[_0x070e('0x13')](_0x070e('0x37'));return BPromise['resolve']({'id':_0x268c5d[_0x070e('0x23')][0x0]['id'],'name':_0x268c5d['result'][0x0][_0x070e('0x38')]+'\x20'+_0x268c5d[_0x070e('0x23')][0x0][_0x070e('0x39')],'phone':_0x34746e});}else{logger[_0x070e('0x13')](_0x070e('0x3a'));return request({'method':'POST','uri':util[_0x070e('0x1a')]('%s/webservice.php',_0x534150['remoteUri']),'form':{'operation':_0x070e('0x1d'),'sessionName':_0x4ba6f0[_0x070e('0x1f')],'elementType':_0x070e('0x3b'),'element':JSON['stringify']({'lastname':_0x2d6bb6,'phone':_0x34746e,'assigned_user_id':'\x20'})},'json':!![]})[_0x070e('0x21')](function(_0x1223be){logger[_0x070e('0x13')](_0x070e('0x3c'));return BPromise['resolve']({'id':_0x1223be[_0x070e('0x23')]['id'],'name':_0x1223be['result']['lastname'],'phone':_0x1223be['result'][_0x070e('0x3d')]});})[_0x070e('0x26')](function(_0x26b3e2){var _0x29dccd=req[_0x070e('0x2d')]['test']?0x1f4:_0x26b3e2[_0x070e('0x28')]||0x1f4;logger['error'](_0x070e('0x29'),_0x070e('0x3e'),_0x29dccd,JSON[_0x070e('0x24')](_0x26b3e2));});}});}function getConnection(_0x52fcea){var _0x54285a=_0x52fcea[_0x070e('0x34')];var _0x5ee4b8=_0x52fcea[_0x070e('0x3f')];return request({'method':_0x070e('0x2c'),'uri':util[_0x070e('0x1a')]('%s/webservice.php',_0x52fcea[_0x070e('0x1c')]),'qs':{'operation':_0x070e('0x40'),'username':_0x54285a},'json':!![]})['then'](function(_0x589b97){if(_0x589b97[_0x070e('0x22')]){return request({'method':_0x070e('0x19'),'uri':util[_0x070e('0x1a')](_0x070e('0x1b'),_0x52fcea[_0x070e('0x1c')]),'form':{'operation':'login','username':_0x070e('0x1e'),'accessKey':md5(_0x589b97[_0x070e('0x23')][_0x070e('0x41')]+_0x5ee4b8)},'json':!![]});}})[_0x070e('0x21')](function(_0x79eaa0){if(_0x79eaa0[_0x070e('0x22')]){return BPromise[_0x070e('0x32')](_0x79eaa0[_0x070e('0x23')]);}else{throw new Error(util[_0x070e('0x1a')](_0x070e('0x42'),_0x52fcea['id']));}})[_0x070e('0x26')](function(_0x3be553){var _0x5254f8=req[_0x070e('0x2d')][_0x070e('0x27')]?0x1f4:_0x3be553['statusCode']||0x1f4;logger[_0x070e('0x25')](_0x070e('0x29'),_0x070e('0x43'),_0x5254f8,JSON[_0x070e('0x24')](_0x3be553));});}function request(_0x2760fc){logger[_0x070e('0x13')](_0x070e('0x44'),JSON[_0x070e('0x24')](_0x2760fc));return rp(_0x2760fc);}exports[_0x070e('0x45')]=function(_0x5744c5,_0x251696,_0x4c22da,_0x1acddb,_0x2be643,_0x4abbe9){var _0x991d23,_0x130a50,_0x25466f,_0xa74805;_0x4abbe9[_0x070e('0x1c')]=intUtil[_0x070e('0x46')](_0x4abbe9[_0x070e('0x1c')]);if(_0x2be643&&_0x2be643['monitor_format']){logger[_0x070e('0x13')]('[QUEUE]','Recording\x20is\x20enabled!');_0x251696[_0x070e('0x47')]=util[_0x070e('0x1a')](_0x070e('0x48'),_0x4abbe9[_0x070e('0x49')],_0x251696[_0x070e('0x4a')],md5(_0x251696[_0x070e('0x4a')]));}else{_0x251696[_0x070e('0x47')]='';}return getConnection(_0x4abbe9)[_0x070e('0x21')](function(_0x53bea1){_0xa74805=_0x53bea1;return getUser(_0x4abbe9,_0x1acddb?_0x1acddb[_0x070e('0x4b')]:'',_0xa74805);})['then'](function(_0x564d82){_0x991d23=_0x564d82;logger[_0x070e('0x13')](_0x070e('0x4c'),_0x991d23['id']);return getEndUser(_0x4abbe9,_0x251696['calleridname'],_0x251696[_0x070e('0x4d')],_0xa74805);})[_0x070e('0x21')](function(_0x210f4a){_0x130a50=_0x210f4a;logger[_0x070e('0x13')](_0x070e('0x4e'),_0x130a50['id']);return createTicket(_0x4abbe9,_0x991d23,_0x130a50,_0x4c22da,_0x251696,_0x4c22da[_0x070e('0x4f')],_0xa74805);})[_0x070e('0x21')](function(_0x4ef647){_0x25466f=_0x4ef647;logger['info']('Ticket\x20created!');logger[_0x070e('0x13')](_0x070e('0x50'),_0x25466f['id']);var _0x29f497=util[_0x070e('0x1a')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4abbe9[_0x070e('0x1c')],_['split'](_0x25466f['id'],'x')[0x1]);logger[_0x070e('0x13')](_0x070e('0x51'),_0x070e('0x52'));emit(util[_0x070e('0x1a')](_0x070e('0x53'),_0x1acddb[_0x070e('0x11')]),'trigger:browser:url',{'uri':_0x29f497});})[_0x070e('0x26')](function(_0x18e8d0){logger[_0x070e('0x25')]('[QUEUE]',JSON[_0x070e('0x24')](_0x18e8d0));});};exports[_0x070e('0x54')]=function(_0x5cd534,_0x1f1df5,_0x4e8dfc,_0xc89f90,_0x569f92,_0x4cb86f,_0x4b354d){var _0xbaf43e,_0x1ae5cb,_0x1100d8,_0x122198;_0x4cb86f[_0x070e('0x1c')]=intUtil[_0x070e('0x46')](_0x4cb86f['remoteUri']);_0x4cb86f[_0x070e('0x49')]=intUtil['stripTrailingSlash'](_0x4cb86f[_0x070e('0x49')]);if(_0x4b354d&&_0x4b354d['recordingFormat']&&_0x4b354d[_0x070e('0x55')]!==_0x070e('0x56')){logger['info'](_0x070e('0x57'),'Recording\x20is\x20enabled!');_0x1f1df5[_0x070e('0x47')]=util[_0x070e('0x1a')](_0x070e('0x48'),_0x4cb86f[_0x070e('0x49')],_0x1f1df5[_0x070e('0x4a')],md5(_0x1f1df5[_0x070e('0x4a')]));}return getConnection(_0x4cb86f)[_0x070e('0x21')](function(_0x148f1d){_0x122198=_0x148f1d;return getUser(_0x4cb86f,_0xc89f90?_0xc89f90[_0x070e('0x4b')]:'',_0x122198);})[_0x070e('0x21')](function(_0x40c560){_0xbaf43e=_0x40c560;logger[_0x070e('0x13')](_0x070e('0x4c'),_0xbaf43e['id']);return getEndUser(_0x4cb86f,_0x1f1df5[_0x070e('0x58')],_0x1f1df5['destcalleridnum'],_0x122198);})[_0x070e('0x21')](function(_0x19d78c){_0x1ae5cb=_0x19d78c;logger[_0x070e('0x13')](_0x070e('0x4e'),_0x1ae5cb['id']);return createTicket(_0x4cb86f,_0xbaf43e,_0x1ae5cb,_0x4e8dfc,_0x1f1df5,_0x4e8dfc['Fields'],_0x122198);})[_0x070e('0x21')](function(_0x4e8e58){_0x1100d8=_0x4e8e58;logger[_0x070e('0x13')](_0x070e('0x59'));logger[_0x070e('0x13')](_0x070e('0x50'),_0x1100d8['id']);var _0x55524b=util[_0x070e('0x1a')](_0x070e('0x5a'),_0x4cb86f[_0x070e('0x1c')],_[_0x070e('0x5b')](_0x1100d8['id'],'x')[0x1]);logger['info'](_0x070e('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x070e('0x1a')](_0x070e('0x53'),_0xc89f90[_0x070e('0x11')]),_0x070e('0x5c'),{'uri':_0x55524b});})[_0x070e('0x26')](function(_0x50ef9f){logger[_0x070e('0x25')](_0x070e('0x57'),JSON[_0x070e('0x24')](_0x50ef9f));});};exports[_0x070e('0x5d')]=function(_0x5591dd,_0x26b2c0,_0x5cadcf,_0x399055,_0x44e465,_0x1214d2){var _0x57585e,_0x404c9b,_0x4d344c,_0x1e6e6a;_0x1214d2['remoteUri']=intUtil[_0x070e('0x46')](_0x1214d2[_0x070e('0x1c')]);_0x1214d2['serverUrl']=intUtil[_0x070e('0x46')](_0x1214d2['serverUrl']);if(_0x44e465&&_0x44e465[_0x070e('0x5e')]){logger[_0x070e('0x13')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x26b2c0[_0x070e('0x47')]=util[_0x070e('0x1a')](_0x070e('0x48'),_0x1214d2[_0x070e('0x49')],_0x26b2c0[_0x070e('0x4a')],md5(_0x26b2c0[_0x070e('0x4a')]));}else{_0x26b2c0[_0x070e('0x47')]='';}return getConnection(_0x1214d2)[_0x070e('0x21')](function(_0x25b599){_0x1e6e6a=_0x25b599;return getUser(_0x1214d2,_0x399055?_0x399055[_0x070e('0x4b')]:'',_0x1e6e6a);})[_0x070e('0x21')](function(_0x25670e){_0x57585e=_0x25670e;logger[_0x070e('0x13')]('The\x20User\x20ID\x20is:',_0x57585e['id']);return getEndUser(_0x1214d2,_0x26b2c0[_0x070e('0x5f')],_0x26b2c0[_0x070e('0x4d')],_0x1e6e6a);})['then'](function(_0x47edcd){_0x404c9b=_0x47edcd;logger[_0x070e('0x13')](_0x070e('0x4e'),_0x404c9b['id']);return createTicket(_0x1214d2,_0x57585e,_0x404c9b,_0x5cadcf,_0x26b2c0,_0x5cadcf[_0x070e('0x4f')],_0x1e6e6a);})[_0x070e('0x21')](function(_0x3b3e96){_0x4d344c=_0x3b3e96;logger[_0x070e('0x13')](_0x070e('0x59'));logger[_0x070e('0x13')](_0x070e('0x50'),_0x4d344c['id']);})[_0x070e('0x26')](function(_0x62800d){logger[_0x070e('0x25')](_0x070e('0x60'),JSON['stringify'](_0x62800d));});};
\ No newline at end of file
index 22c5eab..a23ca54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12a1=['custom_fields','customVariable','Variable','name','toLowerCase','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','The\x20Ticket\x20ID\x20is:','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','type','string','nameField','customField','idField','push','content','variable','variableName'];(function(_0x292c39,_0x46338b){var _0x56859d=function(_0x2a27f2){while(--_0x2a27f2){_0x292c39['push'](_0x292c39['shift']());}};_0x56859d(++_0x46338b);}(_0x12a1,0x16f));var _0x112a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12a1[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x112a('0x0'));var rp=require('request-promise');var md5=require(_0x112a('0x1'));var util=require('util');var Redis=require(_0x112a('0x2'));var intUtil=require(_0x112a('0x3'));var config=require(_0x112a('0x4'));var logger=require(_0x112a('0x5'))(_0x112a('0x6'));config[_0x112a('0x7')]=_[_0x112a('0x8')](config['redis'],{'host':_0x112a('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x112a('0x7')]));function emit(_0x7c1ee9,_0x3455b8,_0x49373a){io['to'](_0x7c1ee9)[_0x112a('0xa')](_0x3455b8,_0x49373a);}var headers={'Content-Type':'application/json','Accept':_0x112a('0xb')};function getTicket(_0x5207be,_0x22b84e,_0x42f8ce,_0x4d3c3f,_0x526aed){logger[_0x112a('0xc')](_0x112a('0xd'));return request({'uri':util['format'](_0x112a('0xe'),_0x5207be[_0x112a('0xf')]),'method':'POST','body':{'ticket':_[_0x112a('0x10')]({'requester_id':_0x42f8ce['id'],'submitter_id':_0x22b84e?_0x22b84e['id']:undefined,'assignee_id':_0x22b84e?_0x22b84e['id']:undefined,'tags':getTags(_0x4d3c3f[_0x112a('0x11')],'name'),'subject':intUtil[_0x112a('0x12')](_0x4d3c3f[_0x112a('0x13')],_0x526aed,'\x20'),'description':intUtil[_0x112a('0x12')](_0x4d3c3f[_0x112a('0x14')],_0x526aed,'\x0a'),'comment':{'public':![],'body':intUtil[_0x112a('0x12')](_0x4d3c3f[_0x112a('0x14')],_0x526aed,'\x0a')}},getCustomFields(_0x4d3c3f[_0x112a('0x15')],_0x526aed))}})[_0x112a('0x16')](function(_0x2432c0){logger['info'](_0x112a('0x17'));return _0x2432c0[_0x112a('0x18')];});}function getUser(_0x1853c2,_0x3451da){logger[_0x112a('0xc')]('Getting\x20agent\x20with\x20email',_0x3451da);return request({'uri':util[_0x112a('0x19')](_0x112a('0x1a'),_0x1853c2[_0x112a('0xf')]),'qs':{'query':util[_0x112a('0x19')](_0x112a('0x1b'),_0x3451da)}})[_0x112a('0x16')](function(_0x44afee){if(_0x44afee[_0x112a('0x1c')]){logger[_0x112a('0xc')](_0x112a('0x1d'));return _[_0x112a('0x1e')](_0x44afee[_0x112a('0x1f')],{'email':_0x3451da,'role':'agent'});}else{logger[_0x112a('0xc')](_0x112a('0x20'));return request({'uri':util['format'](_0x112a('0x21'),_0x1853c2[_0x112a('0xf')])})[_0x112a('0x16')](function(_0x2c8459){logger['info'](_0x112a('0x22'));return _0x2c8459[_0x112a('0x23')];});}});}function getEndUser(_0xf205f3,_0x531c1e,_0x245ce0){logger[_0x112a('0xc')](_0x112a('0x24'),_0x245ce0);return request({'uri':util[_0x112a('0x19')](_0x112a('0x1a'),_0xf205f3[_0x112a('0xf')]),'qs':{'query':util['format'](_0x112a('0x25'),_0x245ce0)}})[_0x112a('0x16')](function(_0x4f62a1){var _0x1a9de9;if(_0x4f62a1[_0x112a('0x1f')][_0x112a('0x26')]){_0x4f62a1[_0x112a('0x1f')]=_[_0x112a('0x27')](_0x4f62a1['results'],{'suspended':![],'role':_0x112a('0x28')});if(_0x4f62a1['results']['length']){_0x1a9de9=_[_0x112a('0x29')](_0x4f62a1[_0x112a('0x1f')]);}}if(_0x1a9de9){logger[_0x112a('0xc')](_0x112a('0x2a'));return _0x1a9de9;}else{logger[_0x112a('0xc')](_0x112a('0x2b'));return request({'uri':util[_0x112a('0x19')](_0x112a('0x2c'),_0xf205f3[_0x112a('0xf')]),'method':'POST','body':{'user':{'role':_0x112a('0x28'),'name':util[_0x112a('0x19')](_0x112a('0x2d'),_0x531c1e||_0x245ce0),'phone':_0x245ce0}}})[_0x112a('0x16')](function(_0x497157){logger[_0x112a('0xc')](_0x112a('0x2e'));return _0x497157[_0x112a('0x23')];});}});}function getAuth(_0x516cde){var _0x3ed2e1;if(_0x516cde[_0x112a('0x2f')]===_0x112a('0x30')){_0x3ed2e1=util['format']('%s:%s',_0x516cde['username'],_0x516cde['password']);}else if(_0x516cde[_0x112a('0x2f')]===_0x112a('0x31')){_0x3ed2e1=util[_0x112a('0x19')](_0x112a('0x32'),_0x516cde[_0x112a('0x33')],_0x516cde[_0x112a('0x31')]);}return util[_0x112a('0x19')](_0x112a('0x34'),new Buffer(_0x3ed2e1)[_0x112a('0x35')](_0x112a('0x36')));}function request(_0x400143){logger[_0x112a('0x37')](_0x112a('0x38'),JSON[_0x112a('0x39')](_0x400143));return rp(_[_0x112a('0x8')](_0x400143,{'method':_0x112a('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x39fb98,_0x3e3759){var _0x59fe77=[];if(_0x39fb98&&_0x39fb98[_0x112a('0x26')]>0x0){_0x59fe77=_['map'](_0x39fb98,_0x3e3759);}return _0x59fe77;}function getCustomFields(_0x52c8eb,_0x3fef7c){var _0xf3ef8c=[];var _0x503f93={'custom_fields':[]};if(_0x52c8eb['length']>0x0){_[_0x112a('0x3b')](_0x52c8eb,function(_0x48a0aa){if(_0x48a0aa[_0x112a('0x3c')]===_0x112a('0x3d')&&_0x48a0aa[_0x112a('0x3e')]&&!_0x48a0aa[_0x112a('0x3f')]){_0x503f93[_0x48a0aa[_0x112a('0x3e')]['toLowerCase']()]=_0x48a0aa['content']['toString']();}else if(_0x48a0aa[_0x112a('0x3c')]===_0x112a('0x3d')&&_0x48a0aa[_0x112a('0x40')]&&_0x48a0aa[_0x112a('0x3f')]){_0x503f93['custom_fields'][_0x112a('0x41')]({'id':_0x48a0aa['idField'],'value':_0x48a0aa[_0x112a('0x42')][_0x112a('0x35')]()});}else if(_0x48a0aa[_0x112a('0x3c')]===_0x112a('0x43')&&_0x48a0aa[_0x112a('0x44')]&&_0x48a0aa[_0x112a('0x40')]&&_0x48a0aa[_0x112a('0x3f')]){_0x3fef7c[_0x48a0aa[_0x112a('0x44')]]&&_0x503f93[_0x112a('0x45')][_0x112a('0x41')]({'id':_0x48a0aa[_0x112a('0x40')],'value':_0x3fef7c[_0x48a0aa[_0x112a('0x44')]][_0x112a('0x35')]()});}else if(_0x48a0aa['type']===_0x112a('0x46')&&_0x48a0aa[_0x112a('0x47')]&&_0x48a0aa[_0x112a('0x47')][_0x112a('0x48')]&&_0x48a0aa['idField']&&_0x48a0aa[_0x112a('0x3f')]){_0x3fef7c[_0x48a0aa['Variable'][_0x112a('0x48')][_0x112a('0x49')]()]&&_0x503f93[_0x112a('0x45')][_0x112a('0x41')]({'id':_0x48a0aa['idField'],'value':_0x3fef7c[_0x48a0aa[_0x112a('0x47')]['name'][_0x112a('0x49')]()]['toString']()});}});}return _0x503f93;}exports['queue']=function(_0x4c55a7,_0x259b3d,_0x124224,_0x1f5bda,_0x4023ac,_0x524101){var _0x364a33,_0x135aaa;_0x524101['remoteUri']=intUtil[_0x112a('0x4a')](_0x524101[_0x112a('0xf')]);_0x524101[_0x112a('0x4b')]=intUtil[_0x112a('0x4a')](_0x524101[_0x112a('0x4b')]);if(_0x4023ac&&_0x4023ac['monitor_format']){logger['info'](_0x112a('0x4c'),_0x112a('0x4d'));_0x259b3d['recordingURL']=util[_0x112a('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x524101[_0x112a('0x4b')],_0x259b3d[_0x112a('0x4e')],md5(_0x259b3d[_0x112a('0x4e')]));}else{_0x259b3d[_0x112a('0x4f')]='';}headers[_0x112a('0x50')]=getAuth(_0x524101);return getUser(_0x524101,_0x1f5bda[_0x112a('0x51')])[_0x112a('0x16')](function(_0x138c32){_0x364a33=_0x138c32;logger[_0x112a('0xc')](_0x112a('0x52'),_0x364a33['id']);return getEndUser(_0x524101,_0x259b3d[_0x112a('0x53')],_0x259b3d[_0x112a('0x54')]);})[_0x112a('0x16')](function(_0x35859e){_0x135aaa=_0x35859e;logger[_0x112a('0xc')](_0x112a('0x55'),_0x135aaa['id']);return getTicket(_0x524101,_0x364a33,_0x135aaa,_0x124224,_0x259b3d);})[_0x112a('0x16')](function(_0x5adb78){if(_0x5adb78){logger[_0x112a('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5adb78['id']);switch(_0x524101['type']){case _0x112a('0x56'):logger[_0x112a('0xc')](_0x112a('0x4c'),_0x112a('0x57'));return request({'uri':util[_0x112a('0x19')](_0x112a('0x58'),_0x524101[_0x112a('0xf')],_0x364a33['id'],_0x5adb78['id']),'method':_0x112a('0x59')});case _0x112a('0x5a'):logger[_0x112a('0xc')](_0x112a('0x4c'),_0x112a('0x5b'));emit(util['format'](_0x112a('0x5c'),_0x1f5bda[_0x112a('0x48')]),'trigger:browser:url',{'uri':util[_0x112a('0x19')]('%s/agent/tickets/%s',_0x524101['remoteUri'],_0x5adb78['id'])});break;default:logger[_0x112a('0x5d')](_0x112a('0x4c'),_0x112a('0x5e'));}}})['catch'](function(_0x113cc1){logger[_0x112a('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x112a('0x5f')](_0x113cc1,{'showHidden':!![],'depth':null}));});};exports[_0x112a('0x60')]=function(_0x508c3d,_0x161e62,_0x430a84,_0x57aa3f,_0x2d36bc,_0x48d337,_0xa94b7c){var _0x228f1c,_0x200986;_0x48d337[_0x112a('0xf')]=intUtil[_0x112a('0x4a')](_0x48d337[_0x112a('0xf')]);_0x48d337['serverUrl']=intUtil[_0x112a('0x4a')](_0x48d337[_0x112a('0x4b')]);if(_0xa94b7c&&_0xa94b7c['recordingFormat']&&_0xa94b7c['recordingFormat']!==_0x112a('0x61')){logger[_0x112a('0xc')](_0x112a('0x62'),'Recording\x20is\x20enabled!');_0x161e62[_0x112a('0x4f')]=util[_0x112a('0x19')](_0x112a('0x63'),_0x48d337[_0x112a('0x4b')],_0x161e62[_0x112a('0x4e')],md5(_0x161e62['uniqueid']));}headers[_0x112a('0x50')]=getAuth(_0x48d337);return getUser(_0x48d337,_0x57aa3f[_0x112a('0x51')])['then'](function(_0x2b9430){_0x228f1c=_0x2b9430;logger[_0x112a('0xc')]('The\x20User\x20ID\x20is:',_0x228f1c['id']);return getEndUser(_0x48d337,_0x161e62['destcalleridname'],_0x161e62[_0x112a('0x64')]);})[_0x112a('0x16')](function(_0x13c1ee){_0x200986=_0x13c1ee;logger[_0x112a('0xc')]('The\x20Enduser\x20ID\x20is:',_0x200986['id']);return getTicket(_0x48d337,_0x228f1c,_0x200986,_0x430a84,_0x161e62);})['then'](function(_0x4eed79){if(_0x4eed79){logger[_0x112a('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4eed79['id']);switch(_0x48d337[_0x112a('0x3c')]){case'integrationTab':logger[_0x112a('0xc')](_0x112a('0x62'),_0x112a('0x57'));return request({'uri':util[_0x112a('0x19')](_0x112a('0x58'),_0x48d337['remoteUri'],_0x228f1c['id'],_0x4eed79['id']),'method':_0x112a('0x59')});case _0x112a('0x5a'):logger[_0x112a('0xc')](_0x112a('0x62'),_0x112a('0x5b'));emit(util[_0x112a('0x19')]('user:%s',_0x57aa3f[_0x112a('0x48')]),_0x112a('0x65'),{'uri':util[_0x112a('0x19')](_0x112a('0x66'),_0x48d337[_0x112a('0xf')],_0x4eed79['id'])});break;default:logger[_0x112a('0x5d')](_0x112a('0x62'),_0x112a('0x5e'));}}})[_0x112a('0x67')](function(_0x31d3ab){logger[_0x112a('0x5d')](_0x112a('0x68'),util[_0x112a('0x5f')](_0x31d3ab,{'showHidden':!![],'depth':null}));});};exports[_0x112a('0x69')]=function(_0x5b8b48,_0x475326,_0x29d90a,_0x35c390,_0x1e5a08,_0x17132a){var _0x1f447a,_0x5834d3;_0x17132a[_0x112a('0xf')]=intUtil[_0x112a('0x4a')](_0x17132a['remoteUri']);_0x17132a['serverUrl']=intUtil[_0x112a('0x4a')](_0x17132a['serverUrl']);if(_0x1e5a08&&_0x1e5a08['monitor_format']){logger[_0x112a('0xc')](_0x112a('0x6a'),_0x112a('0x4d'));_0x475326[_0x112a('0x4f')]=util[_0x112a('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17132a[_0x112a('0x4b')],_0x475326['uniqueid'],md5(_0x475326[_0x112a('0x4e')]));}else{_0x475326[_0x112a('0x4f')]='';}headers['Authorization']=getAuth(_0x17132a);return getUser(_0x17132a)['then'](function(_0x515cea){_0x1f447a=_0x515cea;logger['info'](_0x112a('0x52'),_0x1f447a['id']);return getEndUser(_0x17132a,_0x475326[_0x112a('0x53')],_0x475326[_0x112a('0x54')]);})[_0x112a('0x16')](function(_0x57e710){_0x5834d3=_0x57e710;logger[_0x112a('0xc')](_0x112a('0x55'),_0x5834d3['id']);return getTicket(_0x17132a,_0x1f447a,_0x5834d3,_0x29d90a,_0x475326);})[_0x112a('0x16')](function(_0x184265){if(_0x184265){logger[_0x112a('0xc')](_0x112a('0x6b'),_0x184265['id']);}})['catch'](function(_0x3b43fa){logger['error'](_0x112a('0x6c'),util[_0x112a('0x5f')](_0x3b43fa,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4161=['type','string','nameField','customField','toLowerCase','content','idField','custom_fields','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','ticket','%s/search.json','then','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','toString','base64','debug','stringify','GET','map','forEach'];(function(_0x56fb7d,_0x539ea1){var _0x3be1c3=function(_0x521d3f){while(--_0x521d3f){_0x56fb7d['push'](_0x56fb7d['shift']());}};_0x3be1c3(++_0x539ea1);}(_0x4161,0x1d5));var _0x1416=function(_0x4fbe5e,_0x5e9c97){_0x4fbe5e=_0x4fbe5e-0x0;var _0x4fa53b=_0x4161[_0x4fbe5e];return _0x4fa53b;};'use strict';var _=require(_0x1416('0x0'));var rp=require(_0x1416('0x1'));var md5=require(_0x1416('0x2'));var util=require('util');var Redis=require(_0x1416('0x3'));var intUtil=require('./util');var config=require(_0x1416('0x4'));var logger=require(_0x1416('0x5'))('zendesk');config[_0x1416('0x6')]=_[_0x1416('0x7')](config[_0x1416('0x6')],{'host':_0x1416('0x8'),'port':0x18eb});var io=require(_0x1416('0x9'))(new Redis(config[_0x1416('0x6')]));function emit(_0x25b23c,_0x480084,_0x520716){io['to'](_0x25b23c)[_0x1416('0xa')](_0x480084,_0x520716);}var headers={'Content-Type':_0x1416('0xb'),'Accept':_0x1416('0xb')};function getTicket(_0x21a321,_0x3d6973,_0x59e8d8,_0x5463e9,_0x9d59d2){logger[_0x1416('0xc')](_0x1416('0xd'));return request({'uri':util[_0x1416('0xe')](_0x1416('0xf'),_0x21a321[_0x1416('0x10')]),'method':_0x1416('0x11'),'body':{'ticket':_[_0x1416('0x12')]({'requester_id':_0x59e8d8['id'],'submitter_id':_0x3d6973?_0x3d6973['id']:undefined,'assignee_id':_0x3d6973?_0x3d6973['id']:undefined,'tags':getTags(_0x5463e9[_0x1416('0x13')],_0x1416('0x14')),'subject':intUtil[_0x1416('0x15')](_0x5463e9['Subjects'],_0x9d59d2,'\x20'),'description':intUtil[_0x1416('0x15')](_0x5463e9['Descriptions'],_0x9d59d2,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5463e9[_0x1416('0x16')],_0x9d59d2,'\x0a')}},getCustomFields(_0x5463e9[_0x1416('0x17')],_0x9d59d2))}})['then'](function(_0x1032de){logger[_0x1416('0xc')](_0x1416('0x18'));return _0x1032de[_0x1416('0x19')];});}function getUser(_0x3d6f9d,_0x1036f9){logger[_0x1416('0xc')]('Getting\x20agent\x20with\x20email',_0x1036f9);return request({'uri':util['format'](_0x1416('0x1a'),_0x3d6f9d[_0x1416('0x10')]),'qs':{'query':util[_0x1416('0xe')]('type:user\x20role:agent\x20email:%s',_0x1036f9)}})[_0x1416('0x1b')](function(_0x48a5a3){if(_0x48a5a3[_0x1416('0x1c')]){logger[_0x1416('0xc')](_0x1416('0x1d'));return _['find'](_0x48a5a3[_0x1416('0x1e')],{'email':_0x1036f9,'role':'agent'});}else{logger['info'](_0x1416('0x1f'));return request({'uri':util[_0x1416('0xe')]('%s/users/me.json',_0x3d6f9d['remoteUri'])})[_0x1416('0x1b')](function(_0x18aa8a){logger[_0x1416('0xc')](_0x1416('0x20'));return _0x18aa8a[_0x1416('0x21')];});}});}function getEndUser(_0x5551fa,_0x2f6696,_0x2edae0){logger['info'](_0x1416('0x22'),_0x2edae0);return request({'uri':util['format'](_0x1416('0x1a'),_0x5551fa[_0x1416('0x10')]),'qs':{'query':util[_0x1416('0xe')](_0x1416('0x23'),_0x2edae0)}})[_0x1416('0x1b')](function(_0x2b6a80){var _0x5c2778;if(_0x2b6a80[_0x1416('0x1e')][_0x1416('0x24')]){_0x2b6a80[_0x1416('0x1e')]=_['filter'](_0x2b6a80[_0x1416('0x1e')],{'suspended':![],'role':_0x1416('0x25')});if(_0x2b6a80[_0x1416('0x1e')][_0x1416('0x24')]){_0x5c2778=_[_0x1416('0x26')](_0x2b6a80[_0x1416('0x1e')]);}}if(_0x5c2778){logger[_0x1416('0xc')](_0x1416('0x27'));return _0x5c2778;}else{logger[_0x1416('0xc')](_0x1416('0x28'));return request({'uri':util[_0x1416('0xe')](_0x1416('0x29'),_0x5551fa['remoteUri']),'method':_0x1416('0x11'),'body':{'user':{'role':_0x1416('0x25'),'name':util[_0x1416('0xe')]('Caller\x20-\x20%s',_0x2f6696||_0x2edae0),'phone':_0x2edae0}}})[_0x1416('0x1b')](function(_0x59d2e7){logger[_0x1416('0xc')](_0x1416('0x2a'));return _0x59d2e7['user'];});}});}function getAuth(_0x3770c8){var _0x49d34d;if(_0x3770c8[_0x1416('0x2b')]===_0x1416('0x2c')){_0x49d34d=util[_0x1416('0xe')](_0x1416('0x2d'),_0x3770c8['username'],_0x3770c8[_0x1416('0x2c')]);}else if(_0x3770c8['authType']===_0x1416('0x2e')){_0x49d34d=util[_0x1416('0xe')](_0x1416('0x2f'),_0x3770c8[_0x1416('0x30')],_0x3770c8[_0x1416('0x2e')]);}return util['format']('Basic\x20%s',new Buffer(_0x49d34d)[_0x1416('0x31')](_0x1416('0x32')));}function request(_0x342a8d){logger[_0x1416('0x33')]('[HTTP]',JSON[_0x1416('0x34')](_0x342a8d));return rp(_[_0x1416('0x7')](_0x342a8d,{'method':_0x1416('0x35'),'headers':headers,'json':!![]}));}function getTags(_0xd00094,_0x504689){var _0x5e51d3=[];if(_0xd00094&&_0xd00094['length']>0x0){_0x5e51d3=_[_0x1416('0x36')](_0xd00094,_0x504689);}return _0x5e51d3;}function getCustomFields(_0xd213a3,_0x35d210){var _0x48c7c0=[];var _0x499238={'custom_fields':[]};if(_0xd213a3['length']>0x0){_[_0x1416('0x37')](_0xd213a3,function(_0x19804d){if(_0x19804d[_0x1416('0x38')]===_0x1416('0x39')&&_0x19804d[_0x1416('0x3a')]&&!_0x19804d[_0x1416('0x3b')]){_0x499238[_0x19804d[_0x1416('0x3a')][_0x1416('0x3c')]()]=_0x19804d[_0x1416('0x3d')]['toString']();}else if(_0x19804d[_0x1416('0x38')]===_0x1416('0x39')&&_0x19804d[_0x1416('0x3e')]&&_0x19804d[_0x1416('0x3b')]){_0x499238[_0x1416('0x3f')]['push']({'id':_0x19804d[_0x1416('0x3e')],'value':_0x19804d['content'][_0x1416('0x31')]()});}else if(_0x19804d['type']===_0x1416('0x40')&&_0x19804d[_0x1416('0x41')]&&_0x19804d[_0x1416('0x3e')]&&_0x19804d[_0x1416('0x3b')]){_0x35d210[_0x19804d[_0x1416('0x41')]]&&_0x499238[_0x1416('0x3f')][_0x1416('0x42')]({'id':_0x19804d['idField'],'value':_0x35d210[_0x19804d[_0x1416('0x41')]][_0x1416('0x31')]()});}else if(_0x19804d[_0x1416('0x38')]===_0x1416('0x43')&&_0x19804d[_0x1416('0x44')]&&_0x19804d[_0x1416('0x44')]['name']&&_0x19804d[_0x1416('0x3e')]&&_0x19804d['customField']){_0x35d210[_0x19804d[_0x1416('0x44')][_0x1416('0x14')]['toLowerCase']()]&&_0x499238[_0x1416('0x3f')][_0x1416('0x42')]({'id':_0x19804d[_0x1416('0x3e')],'value':_0x35d210[_0x19804d[_0x1416('0x44')]['name'][_0x1416('0x3c')]()][_0x1416('0x31')]()});}});}return _0x499238;}exports[_0x1416('0x45')]=function(_0x108495,_0x1fc509,_0xf072bd,_0xa25d5d,_0x174b2c,_0x5b4dc7){var _0x42c57b,_0x1ff901;_0x5b4dc7[_0x1416('0x10')]=intUtil[_0x1416('0x46')](_0x5b4dc7['remoteUri']);_0x5b4dc7[_0x1416('0x47')]=intUtil[_0x1416('0x46')](_0x5b4dc7[_0x1416('0x47')]);if(_0x174b2c&&_0x174b2c['monitor_format']){logger[_0x1416('0xc')](_0x1416('0x48'),_0x1416('0x49'));_0x1fc509[_0x1416('0x4a')]=util[_0x1416('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b4dc7['serverUrl'],_0x1fc509[_0x1416('0x4b')],md5(_0x1fc509[_0x1416('0x4b')]));}else{_0x1fc509[_0x1416('0x4a')]='';}headers[_0x1416('0x4c')]=getAuth(_0x5b4dc7);return getUser(_0x5b4dc7,_0xa25d5d[_0x1416('0x4d')])[_0x1416('0x1b')](function(_0x11bb25){_0x42c57b=_0x11bb25;logger[_0x1416('0xc')]('The\x20User\x20ID\x20is:',_0x42c57b['id']);return getEndUser(_0x5b4dc7,_0x1fc509[_0x1416('0x4e')],_0x1fc509[_0x1416('0x4f')]);})['then'](function(_0x1e8b40){_0x1ff901=_0x1e8b40;logger[_0x1416('0xc')](_0x1416('0x50'),_0x1ff901['id']);return getTicket(_0x5b4dc7,_0x42c57b,_0x1ff901,_0xf072bd,_0x1fc509);})[_0x1416('0x1b')](function(_0x57930f){if(_0x57930f){logger['info'](_0x1416('0x51'),_0x57930f['id']);switch(_0x5b4dc7['type']){case _0x1416('0x52'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x1416('0xe')](_0x1416('0x53'),_0x5b4dc7['remoteUri'],_0x42c57b['id'],_0x57930f['id']),'method':'POST'});case'newTab':logger[_0x1416('0xc')](_0x1416('0x48'),_0x1416('0x54'));emit(util[_0x1416('0xe')](_0x1416('0x55'),_0xa25d5d[_0x1416('0x14')]),_0x1416('0x56'),{'uri':util[_0x1416('0xe')](_0x1416('0x57'),_0x5b4dc7[_0x1416('0x10')],_0x57930f['id'])});break;default:logger[_0x1416('0x58')](_0x1416('0x48'),_0x1416('0x59'));}}})[_0x1416('0x5a')](function(_0x149d8d){logger['error'](_0x1416('0x5b'),util[_0x1416('0x5c')](_0x149d8d,{'showHidden':!![],'depth':null}));});};exports[_0x1416('0x5d')]=function(_0x273825,_0x2828e9,_0x44ad2d,_0xa76a0b,_0x51db04,_0xfa998c,_0x2ccbec){var _0xffb04f,_0x1faf19;_0xfa998c['remoteUri']=intUtil['stripTrailingSlash'](_0xfa998c[_0x1416('0x10')]);_0xfa998c[_0x1416('0x47')]=intUtil['stripTrailingSlash'](_0xfa998c[_0x1416('0x47')]);if(_0x2ccbec&&_0x2ccbec[_0x1416('0x5e')]&&_0x2ccbec['recordingFormat']!=='none'){logger[_0x1416('0xc')](_0x1416('0x5f'),_0x1416('0x49'));_0x2828e9['recordingURL']=util[_0x1416('0xe')](_0x1416('0x60'),_0xfa998c[_0x1416('0x47')],_0x2828e9[_0x1416('0x4b')],md5(_0x2828e9[_0x1416('0x4b')]));}headers['Authorization']=getAuth(_0xfa998c);return getUser(_0xfa998c,_0xa76a0b[_0x1416('0x4d')])[_0x1416('0x1b')](function(_0x521f04){_0xffb04f=_0x521f04;logger[_0x1416('0xc')](_0x1416('0x61'),_0xffb04f['id']);return getEndUser(_0xfa998c,_0x2828e9[_0x1416('0x62')],_0x2828e9[_0x1416('0x63')]);})[_0x1416('0x1b')](function(_0x2b1873){_0x1faf19=_0x2b1873;logger[_0x1416('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1faf19['id']);return getTicket(_0xfa998c,_0xffb04f,_0x1faf19,_0x44ad2d,_0x2828e9);})['then'](function(_0x34dae1){if(_0x34dae1){logger[_0x1416('0xc')]('The\x20Ticket\x20ID\x20is:',_0x34dae1['id']);switch(_0xfa998c[_0x1416('0x38')]){case _0x1416('0x52'):logger[_0x1416('0xc')](_0x1416('0x5f'),_0x1416('0x64'));return request({'uri':util[_0x1416('0xe')](_0x1416('0x53'),_0xfa998c[_0x1416('0x10')],_0xffb04f['id'],_0x34dae1['id']),'method':'POST'});case'newTab':logger[_0x1416('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1416('0xe')](_0x1416('0x55'),_0xa76a0b['name']),'trigger:browser:url',{'uri':util[_0x1416('0xe')](_0x1416('0x57'),_0xfa998c[_0x1416('0x10')],_0x34dae1['id'])});break;default:logger[_0x1416('0x58')]('[OUTBOUND]',_0x1416('0x59'));}}})['catch'](function(_0x149198){logger[_0x1416('0x58')](_0x1416('0x65'),util[_0x1416('0x5c')](_0x149198,{'showHidden':!![],'depth':null}));});};exports[_0x1416('0x66')]=function(_0x967de9,_0x5cd00a,_0x232e94,_0x36a3f6,_0x5ac00a,_0x360bb7){var _0x31744f,_0x575543;_0x360bb7[_0x1416('0x10')]=intUtil[_0x1416('0x46')](_0x360bb7['remoteUri']);_0x360bb7[_0x1416('0x47')]=intUtil['stripTrailingSlash'](_0x360bb7[_0x1416('0x47')]);if(_0x5ac00a&&_0x5ac00a['monitor_format']){logger['info'](_0x1416('0x67'),'Recording\x20is\x20enabled!');_0x5cd00a[_0x1416('0x4a')]=util['format'](_0x1416('0x60'),_0x360bb7['serverUrl'],_0x5cd00a[_0x1416('0x4b')],md5(_0x5cd00a[_0x1416('0x4b')]));}else{_0x5cd00a[_0x1416('0x4a')]='';}headers[_0x1416('0x4c')]=getAuth(_0x360bb7);return getUser(_0x360bb7)[_0x1416('0x1b')](function(_0x2187dd){_0x31744f=_0x2187dd;logger[_0x1416('0xc')](_0x1416('0x61'),_0x31744f['id']);return getEndUser(_0x360bb7,_0x5cd00a[_0x1416('0x4e')],_0x5cd00a[_0x1416('0x4f')]);})[_0x1416('0x1b')](function(_0x3190d3){_0x575543=_0x3190d3;logger[_0x1416('0xc')](_0x1416('0x50'),_0x575543['id']);return getTicket(_0x360bb7,_0x31744f,_0x575543,_0x232e94,_0x5cd00a);})[_0x1416('0x1b')](function(_0x36c493){if(_0x36c493){logger[_0x1416('0xc')](_0x1416('0x51'),_0x36c493['id']);}})['catch'](function(_0x321bbe){logger[_0x1416('0x58')](_0x1416('0x68'),util[_0x1416('0x5c')](_0x321bbe,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 4e38fa9..022f2dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5a=['parse','toJson','response','result','recorddetail','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','Getting\x20agent\x20with\x20email','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','authToken','user','find','users','Standard','Using\x20the\x20admin\x20account!','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','GET','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Contacts','row','val','content','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','<Leads><row\x20no=\x221\x22><FL\x20val=\x22First\x20Name\x22>%s</FL><FL\x20val=\x22Last\x20Name\x22>%s</FL><FL\x20val=\x22Phone\x22>%s</FL></row></Leads>','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','debug','[HTTP]','forEach','type','string','idField','toString','variable','variableName','customVariable','name','Variable','toLowerCase','indexOf','split','queue','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','user:%s','Inbound','lodash','request-promise','util','./util','xml2json','entities','ioredis','../../../../config/environment','zoho','defaults','redis','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','starttime','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','Descriptions','Fields','lastevent','called','Call\x20Result','complete','connect','rejected','Rejected','abandoned','Abandoned','talktime','Call\x20Duration','utc','mm:ss','endtime','diff','CONTACTID','LEADID','Leads','SEID','<Calls><row\x20no=\x221\x22>','hasOwnProperty','encodeXML','</row></Calls>','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','host','crmapi','then'];(function(_0x182baf,_0x1375fb){var _0x4d10f1=function(_0x1e0dde){while(--_0x1e0dde){_0x182baf['push'](_0x182baf['shift']());}};_0x4d10f1(++_0x1375fb);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3a4842,_0xaf4036){_0x3a4842=_0x3a4842-0x0;var _0x1edde6=_0x9c5a[_0x3a4842];return _0x1edde6;};'use strict';var _=require(_0xa9c5('0x0'));var rp=require(_0xa9c5('0x1'));var md5=require('md5');var util=require(_0xa9c5('0x2'));var intUtil=require(_0xa9c5('0x3'));var parser=require(_0xa9c5('0x4'));var entities=require(_0xa9c5('0x5'));var moment=require('moment');var Redis=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var logger=require('../../../../config/logger')(_0xa9c5('0x8'));config['redis']=_[_0xa9c5('0x9')](config[_0xa9c5('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9c5('0xa')]));function emit(_0x16f331,_0x52afb2,_0x2e2b3e){io['to'](_0x16f331)[_0xa9c5('0xb')](_0x52afb2,_0x2e2b3e);}var headers={'Content-Type':'application/json','Accept':_0xa9c5('0xc')};function getCall(_0x40a79d,_0x4a19c0,_0x4c55e9,_0x38e106,_0x11421c,_0x45f8d8){logger[_0xa9c5('0xd')](_0xa9c5('0xe'));var _0x4492a4=_[_0xa9c5('0xf')]({'SMOWNERID':_0x4a19c0['id'],'Call Type':_0x45f8d8||_0xa9c5('0x10'),'Call Start Time':(_0x45f8d8===_0xa9c5('0x11')?_0x11421c[_0xa9c5('0x12')]:_0x11421c['agentcalledAt'])||moment()[_0xa9c5('0x13')](_0xa9c5('0x14')),'Subject':intUtil[_0xa9c5('0x15')](_0x38e106[_0xa9c5('0x16')],_0x11421c,'\x20'),'Description':intUtil[_0xa9c5('0x15')](_0x38e106[_0xa9c5('0x17')],_0x11421c,'\x0a')},getCustomFields(_0x38e106[_0xa9c5('0x18')],_0x11421c));switch(_0x11421c[_0xa9c5('0x19')]){case _0xa9c5('0x1a'):_0x4492a4[_0xa9c5('0x1b')]='Called';break;case _0xa9c5('0x1c'):case _0xa9c5('0x1d'):_0x4492a4[_0xa9c5('0x1b')]='Answered';break;case _0xa9c5('0x1e'):_0x4492a4[_0xa9c5('0x1b')]=_0xa9c5('0x1f');break;case _0xa9c5('0x20'):_0x4492a4[_0xa9c5('0x1b')]=_0xa9c5('0x21');break;default:}if(_0x11421c[_0xa9c5('0x22')]){_0x4492a4[_0xa9c5('0x23')]=moment[_0xa9c5('0x24')](parseInt(_0x11421c[_0xa9c5('0x22')])*0x3e8)[_0xa9c5('0x13')](_0xa9c5('0x25'));}else if(_0x11421c['answertime']&&_0x11421c[_0xa9c5('0x26')]){_0x4492a4[_0xa9c5('0x23')]=moment['utc'](moment(_0x11421c['endtime'],_0xa9c5('0x14'))[_0xa9c5('0x27')](moment(_0x11421c[_0xa9c5('0x12')],_0xa9c5('0x14'))))[_0xa9c5('0x13')](_0xa9c5('0x25'));}if(_0x4c55e9['CONTACTID']){_0x4492a4['CONTACTID']=_0x4c55e9[_0xa9c5('0x28')];}else if(_0x4c55e9[_0xa9c5('0x29')]){_0x4492a4['SEMODULE']=_0xa9c5('0x2a');_0x4492a4[_0xa9c5('0x2b')]=_0x4c55e9[_0xa9c5('0x29')];}var _0x32fc7d=_0xa9c5('0x2c');for(var _0x40f08b in _0x4492a4){if(_0x4492a4[_0xa9c5('0x2d')](_0x40f08b)){_0x32fc7d+=util['format']('<FL\x20val=\x22%s\x22>%s</FL>',entities[_0xa9c5('0x2e')](_0x40f08b),entities['encodeXML'](_0x4492a4[_0x40f08b]));}}_0x32fc7d+=_0xa9c5('0x2f');return request({'method':_0xa9c5('0x30'),'uri':util['format'](_0xa9c5('0x31'),_0x40a79d[_0xa9c5('0x32')]),'qs':{'authtoken':_0x40a79d['authToken'],'scope':_0xa9c5('0x33'),'xmlData':_0x32fc7d},'json':!![]})[_0xa9c5('0x34')](function(_0x198cdf){_0x198cdf=JSON[_0xa9c5('0x35')](parser[_0xa9c5('0x36')](_0x198cdf));if(_0x198cdf['response']){if(_0x198cdf[_0xa9c5('0x37')]['result']&&_0x198cdf[_0xa9c5('0x37')][_0xa9c5('0x38')][_0xa9c5('0x39')]){logger['info'](_0xa9c5('0x3a'));return{'id':_0x198cdf[_0xa9c5('0x37')]['result'][_0xa9c5('0x39')]['FL'][0x0]['$t']};}}throw new Error(_0xa9c5('0x3b')+JSON[_0xa9c5('0x3c')](_0x198cdf));});}function getUser(_0x378684,_0x22ee21){_0x22ee21&&logger[_0xa9c5('0xd')](_0xa9c5('0x3d'),_0x22ee21);return request({'method':'GET','uri':util[_0xa9c5('0x13')](_0xa9c5('0x3e'),_0x378684[_0xa9c5('0x32')]),'qs':{'type':_0xa9c5('0x3f'),'authtoken':_0x378684[_0xa9c5('0x40')],'scope':_0xa9c5('0x33')},'json':!![]})[_0xa9c5('0x34')](function(_0x36b599){if(_0x36b599['users']&&_0x36b599['users'][_0xa9c5('0x41')]){var _0x30a0e8;if(_0x22ee21){_0x30a0e8=_[_0xa9c5('0x42')](_0x36b599[_0xa9c5('0x43')][_0xa9c5('0x41')],{'email':_0x22ee21,'profile':_0xa9c5('0x44')});}if(_0x30a0e8){logger['info']('Agent\x20found!');}else{logger['info'](_0xa9c5('0x45'));_0x30a0e8=_[_0xa9c5('0x42')](_0x36b599['users'][_0xa9c5('0x41')],{'profile':'Administrator'});}return _0x30a0e8;}else{logger[_0xa9c5('0x46')](_0xa9c5('0x47'),JSON[_0xa9c5('0x3c')](_0x36b599));throw new Error(_0xa9c5('0x48')+JSON['stringify'](_0x36b599));}});}function getEndUser(_0x675588,_0x2cd721,_0x191153){logger[_0xa9c5('0xd')](_0xa9c5('0x49'),_0x191153);return request({'method':_0xa9c5('0x4a'),'uri':util[_0xa9c5('0x13')](_0xa9c5('0x4b'),_0x675588['host']),'qs':{'authtoken':_0x675588[_0xa9c5('0x40')],'scope':_0xa9c5('0x33'),'criteria':util[_0xa9c5('0x13')](_0xa9c5('0x4c'),_0x191153)},'json':!![]})[_0xa9c5('0x34')](function(_0x14f608){if(_0x14f608['response']&&_0x14f608[_0xa9c5('0x37')]['result']){logger[_0xa9c5('0xd')]('Enduser\x20found\x20in\x20Contacts!');var _0x426b17={};var _0xd4305d=_0x14f608[_0xa9c5('0x37')]['result'][_0xa9c5('0x4d')][_0xa9c5('0x4e')]['no']?_0x14f608[_0xa9c5('0x37')][_0xa9c5('0x38')]['Contacts'][_0xa9c5('0x4e')]['FL']:_0x14f608[_0xa9c5('0x37')][_0xa9c5('0x38')][_0xa9c5('0x4d')][_0xa9c5('0x4e')][0x0]['FL'];for(var _0x5dc092=0x0,_0x2a1138=_0xd4305d['length'];_0x5dc092<_0x2a1138;_0x5dc092++){_0x426b17[_0xd4305d[_0x5dc092][_0xa9c5('0x4f')]]=_0xd4305d[_0x5dc092][_0xa9c5('0x50')];}return _0x426b17;}else{return request({'method':_0xa9c5('0x4a'),'uri':util[_0xa9c5('0x13')](_0xa9c5('0x51'),_0x675588[_0xa9c5('0x32')]),'qs':{'authtoken':_0x675588[_0xa9c5('0x40')],'scope':_0xa9c5('0x33'),'criteria':util[_0xa9c5('0x13')](_0xa9c5('0x4c'),_0x191153)},'json':!![]})['then'](function(_0x2e92c5){if(_0x2e92c5[_0xa9c5('0x37')]&&_0x2e92c5[_0xa9c5('0x37')][_0xa9c5('0x38')]){logger[_0xa9c5('0xd')](_0xa9c5('0x52'));var _0x583ec9={};var _0x4194c8=_0x2e92c5[_0xa9c5('0x37')]['result']['Leads']['row']['no']?_0x2e92c5['response']['result'][_0xa9c5('0x2a')][_0xa9c5('0x4e')]['FL']:_0x2e92c5[_0xa9c5('0x37')][_0xa9c5('0x38')][_0xa9c5('0x2a')][_0xa9c5('0x4e')][0x0]['FL'];for(var _0xec9c4=0x0,_0x5b00a6=_0x4194c8[_0xa9c5('0x53')];_0xec9c4<_0x5b00a6;_0xec9c4++){_0x583ec9[_0x4194c8[_0xec9c4][_0xa9c5('0x4f')]]=_0x4194c8[_0xec9c4][_0xa9c5('0x50')];}return _0x583ec9;}else{logger[_0xa9c5('0xd')](_0xa9c5('0x54'));_0x2cd721=getName(_0x2cd721);return request({'method':'POST','uri':util[_0xa9c5('0x13')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0x675588[_0xa9c5('0x32')]),'qs':{'authtoken':_0x675588[_0xa9c5('0x40')],'scope':'crmapi','xmlData':util['format'](_0xa9c5('0x55'),entities[_0xa9c5('0x2e')](_0x2cd721[0x0]),entities[_0xa9c5('0x2e')](_0x2cd721[0x1]),_0x191153)},'json':!![]})['then'](function(_0x584504){_0x584504=JSON[_0xa9c5('0x35')](parser[_0xa9c5('0x36')](_0x584504));if(_0x584504['response']){if(_0x584504[_0xa9c5('0x37')][_0xa9c5('0x38')]&&_0x584504[_0xa9c5('0x37')][_0xa9c5('0x38')][_0xa9c5('0x39')]){logger[_0xa9c5('0xd')]('Enduser\x20created.');return request({'method':'GET','uri':util['format'](_0xa9c5('0x56'),_0x675588[_0xa9c5('0x32')]),'qs':{'authtoken':_0x675588[_0xa9c5('0x40')],'scope':_0xa9c5('0x33'),'id':_0x584504[_0xa9c5('0x37')][_0xa9c5('0x38')]['recorddetail']['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xa9c5('0x57')+JSON[_0xa9c5('0x3c')](_0x584504));})[_0xa9c5('0x34')](function(_0x2bdc77){if(_0x2bdc77[_0xa9c5('0x37')]){if(_0x2bdc77[_0xa9c5('0x37')]['result']){var _0x4fcc44={};for(var _0x10ff6b=0x0,_0x56b642=_0x2bdc77[_0xa9c5('0x37')]['result'][_0xa9c5('0x2a')][_0xa9c5('0x4e')]['FL'][_0xa9c5('0x53')];_0x10ff6b<_0x56b642;_0x10ff6b++){_0x4fcc44[_0x2bdc77['response'][_0xa9c5('0x38')][_0xa9c5('0x2a')][_0xa9c5('0x4e')]['FL'][_0x10ff6b][_0xa9c5('0x4f')]]=_0x2bdc77['response']['result'][_0xa9c5('0x2a')][_0xa9c5('0x4e')]['FL'][_0x10ff6b][_0xa9c5('0x50')];}return _0x4fcc44;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0xa9c5('0x3c')](_0x2bdc77));});}});}});}function request(_0x867922){logger[_0xa9c5('0x58')](_0xa9c5('0x59'),JSON[_0xa9c5('0x3c')](_0x867922));return rp(_0x867922);}function getCustomFields(_0x29b198,_0x24fc67){var _0x298b3d={};if(_0x29b198['length']>0x0){_[_0xa9c5('0x5a')](_0x29b198,function(_0x5a9d4f){if(_0x5a9d4f[_0xa9c5('0x5b')]===_0xa9c5('0x5c')&&_0x5a9d4f[_0xa9c5('0x5d')]){_0x298b3d[_0x5a9d4f['idField']]=_0x5a9d4f[_0xa9c5('0x50')][_0xa9c5('0x5e')]();}else if(_0x5a9d4f['type']===_0xa9c5('0x5f')&&_0x5a9d4f[_0xa9c5('0x60')]&&_0x5a9d4f[_0xa9c5('0x5d')]&&_0x24fc67[_0x5a9d4f[_0xa9c5('0x60')]]){_0x298b3d[_0x5a9d4f['idField']]=_0x24fc67[_0x5a9d4f[_0xa9c5('0x60')]][_0xa9c5('0x5e')]();}else if(_0x5a9d4f[_0xa9c5('0x5b')]===_0xa9c5('0x61')&&_0x5a9d4f['Variable']&&_0x5a9d4f['Variable'][_0xa9c5('0x62')]&&_0x5a9d4f[_0xa9c5('0x5d')]&&_0x24fc67[_0x5a9d4f[_0xa9c5('0x63')][_0xa9c5('0x62')][_0xa9c5('0x64')]()]){_0x298b3d[_0x5a9d4f[_0xa9c5('0x5d')]]=_0x24fc67[_0x5a9d4f['Variable'][_0xa9c5('0x62')][_0xa9c5('0x64')]()][_0xa9c5('0x5e')]();}});}return _0x298b3d;}function getName(_0x3990c7){if(_0x3990c7[_0xa9c5('0x65')]('\x20')>0x0){var _0x372ab9=_0x3990c7[_0xa9c5('0x66')](/ (.+)/);if(_0x372ab9[0x1]){return _0x372ab9;}}return[_0x3990c7,_0x3990c7];}exports[_0xa9c5('0x67')]=function(_0x456973,_0x389de8,_0x50d438,_0x5e17a2,_0x25c34f,_0x40ade1){var _0x3322cc,_0x47afaa;if(_0x25c34f&&_0x25c34f['monitor_format']){logger[_0xa9c5('0xd')]('[QUEUE]',_0xa9c5('0x68'));_0x389de8[_0xa9c5('0x69')]=util[_0xa9c5('0x13')](_0xa9c5('0x6a'),_0x40ade1[_0xa9c5('0x6b')],_0x389de8[_0xa9c5('0x6c')],md5(_0x389de8[_0xa9c5('0x6c')]));}else{_0x389de8[_0xa9c5('0x69')]='';}return getUser(_0x40ade1,_0x5e17a2[_0xa9c5('0x6d')])[_0xa9c5('0x34')](function(_0x446b8a){_0x3322cc=_0x446b8a;logger[_0xa9c5('0xd')]('The\x20User\x20ID\x20is:',_0x3322cc['id']);return getEndUser(_0x40ade1,_0x389de8[_0xa9c5('0x6e')],_0x389de8[_0xa9c5('0x6f')]);})[_0xa9c5('0x34')](function(_0xce9c8c){_0x47afaa=_0xce9c8c;logger[_0xa9c5('0xd')](_0xa9c5('0x70'),_0x47afaa[_0xa9c5('0x28')]||_0x47afaa['LEADID']);return getCall(_0x40ade1,_0x3322cc,_0x47afaa,_0x50d438,_0x389de8,'Inbound');})[_0xa9c5('0x34')](function(_0x502a00){if(_0x502a00){logger[_0xa9c5('0xd')](_0xa9c5('0x71'),_0x502a00['id']);logger['info'](_0xa9c5('0x72'),_0xa9c5('0x73'));emit(util['format']('user:%s',_0x5e17a2[_0xa9c5('0x62')]),_0xa9c5('0x74'),{'uri':util[_0xa9c5('0x13')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x40ade1['host'],_0x502a00['id'])});}})[_0xa9c5('0x75')](function(_0x3317c3){logger['error'](_0xa9c5('0x72'),JSON[_0xa9c5('0x3c')](_0x3317c3));});};exports[_0xa9c5('0x11')]=function(_0x3c0c7a,_0x135791,_0x45b0a3,_0x4e2fb1,_0x44d969,_0x3aeb3c,_0x4586ba){var _0xdc6836,_0x57841e;if(_0x4586ba&&_0x4586ba[_0xa9c5('0x76')]&&_0x4586ba[_0xa9c5('0x76')]!=='none'){logger[_0xa9c5('0xd')](_0xa9c5('0x77'),_0xa9c5('0x68'));_0x135791['recordingURL']=util[_0xa9c5('0x13')](_0xa9c5('0x6a'),_0x3aeb3c[_0xa9c5('0x6b')],_0x135791[_0xa9c5('0x6c')],md5(_0x135791[_0xa9c5('0x6c')]));}return getUser(_0x3aeb3c,_0x4e2fb1[_0xa9c5('0x6d')])[_0xa9c5('0x34')](function(_0x4acc1f){_0xdc6836=_0x4acc1f;logger[_0xa9c5('0xd')](_0xa9c5('0x78'),_0xdc6836['id']);return getEndUser(_0x3aeb3c,_0x135791[_0xa9c5('0x79')],_0x135791[_0xa9c5('0x7a')]);})[_0xa9c5('0x34')](function(_0x42b1d7){_0x57841e=_0x42b1d7;logger[_0xa9c5('0xd')](_0xa9c5('0x70'),_0x57841e[_0xa9c5('0x28')]||_0x57841e[_0xa9c5('0x29')]);return getCall(_0x3aeb3c,_0xdc6836,_0x57841e,_0x45b0a3,_0x135791,_0xa9c5('0x7b'));})['then'](function(_0x233e47){if(_0x233e47){logger[_0xa9c5('0xd')]('The\x20Call\x20ID\x20is:',_0x233e47['id']);logger[_0xa9c5('0xd')](_0xa9c5('0x77'),_0xa9c5('0x73'));emit(util['format'](_0xa9c5('0x7c'),_0x4e2fb1[_0xa9c5('0x62')]),_0xa9c5('0x74'),{'uri':util[_0xa9c5('0x13')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x3aeb3c[_0xa9c5('0x32')],_0x233e47['id'])});}})[_0xa9c5('0x75')](function(_0x4f4fa1){logger['error']('[OUTBOUND]',JSON['stringify'](_0x4f4fa1));});};exports['abandoned']=function(_0x4efbde,_0x5277ee,_0x54c8f5,_0x2fb53d,_0x21797e,_0x19cc35){var _0x247696,_0x3e0f0f;if(_0x21797e&&_0x21797e['monitor_format']){logger['info']('[ABANDONED]','Recording\x20is\x20enabled!');_0x5277ee[_0xa9c5('0x69')]=util[_0xa9c5('0x13')](_0xa9c5('0x6a'),_0x19cc35[_0xa9c5('0x6b')],_0x5277ee['uniqueid'],md5(_0x5277ee['uniqueid']));}else{_0x5277ee[_0xa9c5('0x69')]='';}return getUser(_0x19cc35)[_0xa9c5('0x34')](function(_0x144e97){_0x247696=_0x144e97;logger[_0xa9c5('0xd')](_0xa9c5('0x78'),_0x247696['id']);return getEndUser(_0x19cc35,_0x5277ee['calleridname'],_0x5277ee[_0xa9c5('0x6f')]);})[_0xa9c5('0x34')](function(_0xd063cf){_0x3e0f0f=_0xd063cf;logger['info'](_0xa9c5('0x70'),_0x3e0f0f[_0xa9c5('0x28')]||_0x3e0f0f[_0xa9c5('0x29')]);return getCall(_0x19cc35,_0x247696,_0x3e0f0f,_0x54c8f5,_0x5277ee,_0xa9c5('0x7d'));})['then'](function(_0x34fcea){if(_0x34fcea){logger[_0xa9c5('0xd')]('The\x20Call\x20ID\x20is:',_0x34fcea['id']);}})['catch'](function(_0x2f1e9f){logger['error']('[ABANDONED]',JSON[_0xa9c5('0x3c')](_0x2f1e9f));});};
\ No newline at end of file
+var _0x2675=['application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','starttime','agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Subjects','lastevent','called','Call\x20Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','talktime','utc','mm:ss','answertime','endtime','Call\x20Duration','diff','LEADID','SEMODULE','Leads','SEID','<Calls><row\x20no=\x221\x22>','hasOwnProperty','encodeXML','POST','host','authToken','crmapi','then','response','result','recorddetail','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','Getting\x20agent\x20with\x20email','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','user','find','Standard','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','row','Contacts','length','val','Enduser\x20found\x20in\x20Leads!','https://crm.%s/crm/private/xml/Leads/insertRecords','<Leads><row\x20no=\x221\x22><FL\x20val=\x22First\x20Name\x22>%s</FL><FL\x20val=\x22Last\x20Name\x22>%s</FL><FL\x20val=\x22Phone\x22>%s</FL></row></Leads>','parse','toJson','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','content','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','string','idField','toString','variable','variableName','Variable','name','indexOf','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','CONTACTID','Inbound','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','error','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Outbound','[ABANDONED]','lodash','./util','xml2json','moment','ioredis','../../../../config/logger','zoho','redis','defaults','localhost'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x2675,0x75));var _0x5267=function(_0x1e83ab,_0x442f1a){_0x1e83ab=_0x1e83ab-0x0;var _0x20d6b4=_0x2675[_0x1e83ab];return _0x20d6b4;};'use strict';var _=require(_0x5267('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var intUtil=require(_0x5267('0x1'));var parser=require(_0x5267('0x2'));var entities=require('entities');var moment=require(_0x5267('0x3'));var Redis=require(_0x5267('0x4'));var config=require('../../../../config/environment');var logger=require(_0x5267('0x5'))(_0x5267('0x6'));config[_0x5267('0x7')]=_[_0x5267('0x8')](config[_0x5267('0x7')],{'host':_0x5267('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5267('0x7')]));function emit(_0x46bfdf,_0x506fd7,_0x799fcc){io['to'](_0x46bfdf)['emit'](_0x506fd7,_0x799fcc);}var headers={'Content-Type':_0x5267('0xa'),'Accept':_0x5267('0xa')};function getCall(_0x26e22b,_0x534c2b,_0x3e6964,_0x5060b3,_0x445151,_0x5bbf00){logger[_0x5267('0xb')](_0x5267('0xc'));var _0x268a8a=_[_0x5267('0xd')]({'SMOWNERID':_0x534c2b['id'],'Call Type':_0x5bbf00||_0x5267('0xe'),'Call Start Time':(_0x5bbf00===_0x5267('0xf')?_0x445151[_0x5267('0x10')]:_0x445151[_0x5267('0x11')])||moment()[_0x5267('0x12')](_0x5267('0x13')),'Subject':intUtil[_0x5267('0x14')](_0x5060b3[_0x5267('0x15')],_0x445151,'\x20'),'Description':intUtil[_0x5267('0x14')](_0x5060b3['Descriptions'],_0x445151,'\x0a')},getCustomFields(_0x5060b3['Fields'],_0x445151));switch(_0x445151[_0x5267('0x16')]){case _0x5267('0x17'):_0x268a8a[_0x5267('0x18')]=_0x5267('0x19');break;case _0x5267('0x1a'):case _0x5267('0x1b'):_0x268a8a[_0x5267('0x18')]=_0x5267('0x1c');break;case _0x5267('0x1d'):_0x268a8a[_0x5267('0x18')]=_0x5267('0x1e');break;case _0x5267('0x1f'):_0x268a8a['Call\x20Result']=_0x5267('0x20');break;default:}if(_0x445151[_0x5267('0x21')]){_0x268a8a['Call\x20Duration']=moment[_0x5267('0x22')](parseInt(_0x445151['talktime'])*0x3e8)[_0x5267('0x12')](_0x5267('0x23'));}else if(_0x445151[_0x5267('0x24')]&&_0x445151[_0x5267('0x25')]){_0x268a8a[_0x5267('0x26')]=moment['utc'](moment(_0x445151[_0x5267('0x25')],'YYYY-MM-DD\x20HH:mm:ss')[_0x5267('0x27')](moment(_0x445151[_0x5267('0x10')],_0x5267('0x13'))))['format']('mm:ss');}if(_0x3e6964['CONTACTID']){_0x268a8a['CONTACTID']=_0x3e6964['CONTACTID'];}else if(_0x3e6964[_0x5267('0x28')]){_0x268a8a[_0x5267('0x29')]=_0x5267('0x2a');_0x268a8a[_0x5267('0x2b')]=_0x3e6964[_0x5267('0x28')];}var _0x40d1be=_0x5267('0x2c');for(var _0x220e03 in _0x268a8a){if(_0x268a8a[_0x5267('0x2d')](_0x220e03)){_0x40d1be+=util['format']('<FL\x20val=\x22%s\x22>%s</FL>',entities[_0x5267('0x2e')](_0x220e03),entities[_0x5267('0x2e')](_0x268a8a[_0x220e03]));}}_0x40d1be+='</row></Calls>';return request({'method':_0x5267('0x2f'),'uri':util['format']('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x26e22b[_0x5267('0x30')]),'qs':{'authtoken':_0x26e22b[_0x5267('0x31')],'scope':_0x5267('0x32'),'xmlData':_0x40d1be},'json':!![]})[_0x5267('0x33')](function(_0x33c431){_0x33c431=JSON['parse'](parser['toJson'](_0x33c431));if(_0x33c431[_0x5267('0x34')]){if(_0x33c431[_0x5267('0x34')][_0x5267('0x35')]&&_0x33c431['response']['result'][_0x5267('0x36')]){logger[_0x5267('0xb')](_0x5267('0x37'));return{'id':_0x33c431['response']['result'][_0x5267('0x36')]['FL'][0x0]['$t']};}}throw new Error(_0x5267('0x38')+JSON[_0x5267('0x39')](_0x33c431));});}function getUser(_0x189ed7,_0x5bbb83){_0x5bbb83&&logger[_0x5267('0xb')](_0x5267('0x3a'),_0x5bbb83);return request({'method':_0x5267('0x3b'),'uri':util[_0x5267('0x12')](_0x5267('0x3c'),_0x189ed7[_0x5267('0x30')]),'qs':{'type':_0x5267('0x3d'),'authtoken':_0x189ed7[_0x5267('0x31')],'scope':'crmapi'},'json':!![]})['then'](function(_0x39e309){if(_0x39e309['users']&&_0x39e309[_0x5267('0x3e')][_0x5267('0x3f')]){var _0x2b963e;if(_0x5bbb83){_0x2b963e=_[_0x5267('0x40')](_0x39e309['users'][_0x5267('0x3f')],{'email':_0x5bbb83,'profile':_0x5267('0x41')});}if(_0x2b963e){logger[_0x5267('0xb')](_0x5267('0x42'));}else{logger[_0x5267('0xb')](_0x5267('0x43'));_0x2b963e=_[_0x5267('0x40')](_0x39e309[_0x5267('0x3e')]['user'],{'profile':_0x5267('0x44')});}return _0x2b963e;}else{logger['error'](_0x5267('0x45'),JSON[_0x5267('0x39')](_0x39e309));throw new Error(_0x5267('0x46')+JSON[_0x5267('0x39')](_0x39e309));}});}function getEndUser(_0x41e58b,_0x33ecd7,_0x465ad9){logger['info'](_0x5267('0x47'),_0x465ad9);return request({'method':_0x5267('0x3b'),'uri':util[_0x5267('0x12')](_0x5267('0x48'),_0x41e58b[_0x5267('0x30')]),'qs':{'authtoken':_0x41e58b[_0x5267('0x31')],'scope':_0x5267('0x32'),'criteria':util['format'](_0x5267('0x49'),_0x465ad9)},'json':!![]})['then'](function(_0x3db34d){if(_0x3db34d['response']&&_0x3db34d['response']['result']){logger[_0x5267('0xb')]('Enduser\x20found\x20in\x20Contacts!');var _0xf33688={};var _0x146476=_0x3db34d[_0x5267('0x34')][_0x5267('0x35')]['Contacts'][_0x5267('0x4a')]['no']?_0x3db34d[_0x5267('0x34')]['result']['Contacts'][_0x5267('0x4a')]['FL']:_0x3db34d['response'][_0x5267('0x35')][_0x5267('0x4b')][_0x5267('0x4a')][0x0]['FL'];for(var _0x3e0add=0x0,_0x36d0f1=_0x146476[_0x5267('0x4c')];_0x3e0add<_0x36d0f1;_0x3e0add++){_0xf33688[_0x146476[_0x3e0add][_0x5267('0x4d')]]=_0x146476[_0x3e0add]['content'];}return _0xf33688;}else{return request({'method':'GET','uri':util[_0x5267('0x12')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0x41e58b[_0x5267('0x30')]),'qs':{'authtoken':_0x41e58b[_0x5267('0x31')],'scope':'crmapi','criteria':util[_0x5267('0x12')](_0x5267('0x49'),_0x465ad9)},'json':!![]})[_0x5267('0x33')](function(_0x161fed){if(_0x161fed[_0x5267('0x34')]&&_0x161fed[_0x5267('0x34')][_0x5267('0x35')]){logger[_0x5267('0xb')](_0x5267('0x4e'));var _0x52c5e2={};var _0x3918a2=_0x161fed[_0x5267('0x34')][_0x5267('0x35')][_0x5267('0x2a')][_0x5267('0x4a')]['no']?_0x161fed['response'][_0x5267('0x35')]['Leads'][_0x5267('0x4a')]['FL']:_0x161fed['response']['result'][_0x5267('0x2a')]['row'][0x0]['FL'];for(var _0x3f2609=0x0,_0x5da689=_0x3918a2[_0x5267('0x4c')];_0x3f2609<_0x5da689;_0x3f2609++){_0x52c5e2[_0x3918a2[_0x3f2609][_0x5267('0x4d')]]=_0x3918a2[_0x3f2609]['content'];}return _0x52c5e2;}else{logger[_0x5267('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x33ecd7=getName(_0x33ecd7);return request({'method':'POST','uri':util[_0x5267('0x12')](_0x5267('0x4f'),_0x41e58b['host']),'qs':{'authtoken':_0x41e58b['authToken'],'scope':_0x5267('0x32'),'xmlData':util[_0x5267('0x12')](_0x5267('0x50'),entities[_0x5267('0x2e')](_0x33ecd7[0x0]),entities[_0x5267('0x2e')](_0x33ecd7[0x1]),_0x465ad9)},'json':!![]})[_0x5267('0x33')](function(_0x3d0b23){_0x3d0b23=JSON[_0x5267('0x51')](parser[_0x5267('0x52')](_0x3d0b23));if(_0x3d0b23[_0x5267('0x34')]){if(_0x3d0b23[_0x5267('0x34')][_0x5267('0x35')]&&_0x3d0b23[_0x5267('0x34')][_0x5267('0x35')]['recorddetail']){logger[_0x5267('0xb')](_0x5267('0x53'));return request({'method':_0x5267('0x3b'),'uri':util['format'](_0x5267('0x54'),_0x41e58b[_0x5267('0x30')]),'qs':{'authtoken':_0x41e58b[_0x5267('0x31')],'scope':_0x5267('0x32'),'id':_0x3d0b23[_0x5267('0x34')][_0x5267('0x35')]['recorddetail']['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0x5267('0x55')+JSON['stringify'](_0x3d0b23));})[_0x5267('0x33')](function(_0x30fcd2){if(_0x30fcd2[_0x5267('0x34')]){if(_0x30fcd2[_0x5267('0x34')][_0x5267('0x35')]){var _0x3f9664={};for(var _0x19bfd6=0x0,_0x577c1a=_0x30fcd2['response'][_0x5267('0x35')][_0x5267('0x2a')]['row']['FL'][_0x5267('0x4c')];_0x19bfd6<_0x577c1a;_0x19bfd6++){_0x3f9664[_0x30fcd2['response']['result'][_0x5267('0x2a')][_0x5267('0x4a')]['FL'][_0x19bfd6][_0x5267('0x4d')]]=_0x30fcd2[_0x5267('0x34')][_0x5267('0x35')][_0x5267('0x2a')][_0x5267('0x4a')]['FL'][_0x19bfd6][_0x5267('0x56')];}return _0x3f9664;}}throw new Error(_0x5267('0x57')+JSON[_0x5267('0x39')](_0x30fcd2));});}});}});}function request(_0x512c61){logger[_0x5267('0x58')](_0x5267('0x59'),JSON[_0x5267('0x39')](_0x512c61));return rp(_0x512c61);}function getCustomFields(_0x24f86a,_0x2544f1){var _0x34c205={};if(_0x24f86a['length']>0x0){_[_0x5267('0x5a')](_0x24f86a,function(_0x5ad1ce){if(_0x5ad1ce[_0x5267('0x5b')]===_0x5267('0x5c')&&_0x5ad1ce[_0x5267('0x5d')]){_0x34c205[_0x5ad1ce['idField']]=_0x5ad1ce[_0x5267('0x56')][_0x5267('0x5e')]();}else if(_0x5ad1ce[_0x5267('0x5b')]===_0x5267('0x5f')&&_0x5ad1ce[_0x5267('0x60')]&&_0x5ad1ce[_0x5267('0x5d')]&&_0x2544f1[_0x5ad1ce['variableName']]){_0x34c205[_0x5ad1ce[_0x5267('0x5d')]]=_0x2544f1[_0x5ad1ce[_0x5267('0x60')]][_0x5267('0x5e')]();}else if(_0x5ad1ce[_0x5267('0x5b')]==='customVariable'&&_0x5ad1ce['Variable']&&_0x5ad1ce[_0x5267('0x61')]['name']&&_0x5ad1ce[_0x5267('0x5d')]&&_0x2544f1[_0x5ad1ce[_0x5267('0x61')]['name']['toLowerCase']()]){_0x34c205[_0x5ad1ce[_0x5267('0x5d')]]=_0x2544f1[_0x5ad1ce[_0x5267('0x61')][_0x5267('0x62')]['toLowerCase']()][_0x5267('0x5e')]();}});}return _0x34c205;}function getName(_0xc88193){if(_0xc88193[_0x5267('0x63')]('\x20')>0x0){var _0x2043e8=_0xc88193['split'](/ (.+)/);if(_0x2043e8[0x1]){return _0x2043e8;}}return[_0xc88193,_0xc88193];}exports['queue']=function(_0x540ab8,_0x3be34e,_0x2457a3,_0x45ee25,_0x378068,_0x456e94){var _0x446ba4,_0x2a032a;if(_0x378068&&_0x378068[_0x5267('0x64')]){logger['info'](_0x5267('0x65'),_0x5267('0x66'));_0x3be34e['recordingURL']=util[_0x5267('0x12')](_0x5267('0x67'),_0x456e94[_0x5267('0x68')],_0x3be34e[_0x5267('0x69')],md5(_0x3be34e[_0x5267('0x69')]));}else{_0x3be34e[_0x5267('0x6a')]='';}return getUser(_0x456e94,_0x45ee25['email'])[_0x5267('0x33')](function(_0x726410){_0x446ba4=_0x726410;logger[_0x5267('0xb')](_0x5267('0x6b'),_0x446ba4['id']);return getEndUser(_0x456e94,_0x3be34e[_0x5267('0x6c')],_0x3be34e[_0x5267('0x6d')]);})['then'](function(_0x4222e8){_0x2a032a=_0x4222e8;logger[_0x5267('0xb')](_0x5267('0x6e'),_0x2a032a[_0x5267('0x6f')]||_0x2a032a[_0x5267('0x28')]);return getCall(_0x456e94,_0x446ba4,_0x2a032a,_0x2457a3,_0x3be34e,_0x5267('0x70'));})['then'](function(_0x283423){if(_0x283423){logger[_0x5267('0xb')](_0x5267('0x71'),_0x283423['id']);logger[_0x5267('0xb')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5267('0x72'),_0x45ee25['name']),_0x5267('0x73'),{'uri':util['format'](_0x5267('0x74'),_0x456e94[_0x5267('0x30')],_0x283423['id'])});}})[_0x5267('0x75')](function(_0x439411){logger[_0x5267('0x76')](_0x5267('0x65'),JSON[_0x5267('0x39')](_0x439411));});};exports[_0x5267('0xf')]=function(_0x489b9a,_0x489f46,_0x5853e9,_0x30ce72,_0x28a101,_0x2ab2be,_0x457d84){var _0x4974d1,_0x3f2b5d;if(_0x457d84&&_0x457d84[_0x5267('0x77')]&&_0x457d84[_0x5267('0x77')]!==_0x5267('0x78')){logger['info'](_0x5267('0x79'),_0x5267('0x66'));_0x489f46['recordingURL']=util[_0x5267('0x12')](_0x5267('0x67'),_0x2ab2be['serverUrl'],_0x489f46['uniqueid'],md5(_0x489f46[_0x5267('0x69')]));}return getUser(_0x2ab2be,_0x30ce72[_0x5267('0x7a')])['then'](function(_0x57605d){_0x4974d1=_0x57605d;logger[_0x5267('0xb')](_0x5267('0x6b'),_0x4974d1['id']);return getEndUser(_0x2ab2be,_0x489f46[_0x5267('0x7b')],_0x489f46[_0x5267('0x7c')]);})[_0x5267('0x33')](function(_0x48a589){_0x3f2b5d=_0x48a589;logger[_0x5267('0xb')](_0x5267('0x6e'),_0x3f2b5d['CONTACTID']||_0x3f2b5d[_0x5267('0x28')]);return getCall(_0x2ab2be,_0x4974d1,_0x3f2b5d,_0x5853e9,_0x489f46,_0x5267('0x7d'));})[_0x5267('0x33')](function(_0xb6f237){if(_0xb6f237){logger[_0x5267('0xb')](_0x5267('0x71'),_0xb6f237['id']);logger[_0x5267('0xb')](_0x5267('0x79'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5267('0x72'),_0x30ce72[_0x5267('0x62')]),_0x5267('0x73'),{'uri':util[_0x5267('0x12')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x2ab2be[_0x5267('0x30')],_0xb6f237['id'])});}})['catch'](function(_0x2988a1){logger[_0x5267('0x76')](_0x5267('0x79'),JSON[_0x5267('0x39')](_0x2988a1));});};exports['abandoned']=function(_0x4fb8f3,_0x3a67a0,_0x3e2cf5,_0x8e4baa,_0x360a1b,_0x162506){var _0x371302,_0x5e1ba4;if(_0x360a1b&&_0x360a1b[_0x5267('0x64')]){logger['info'](_0x5267('0x7e'),'Recording\x20is\x20enabled!');_0x3a67a0[_0x5267('0x6a')]=util[_0x5267('0x12')](_0x5267('0x67'),_0x162506[_0x5267('0x68')],_0x3a67a0[_0x5267('0x69')],md5(_0x3a67a0[_0x5267('0x69')]));}else{_0x3a67a0[_0x5267('0x6a')]='';}return getUser(_0x162506)[_0x5267('0x33')](function(_0x1407a7){_0x371302=_0x1407a7;logger[_0x5267('0xb')](_0x5267('0x6b'),_0x371302['id']);return getEndUser(_0x162506,_0x3a67a0['calleridname'],_0x3a67a0[_0x5267('0x6d')]);})[_0x5267('0x33')](function(_0x4d9ec9){_0x5e1ba4=_0x4d9ec9;logger[_0x5267('0xb')](_0x5267('0x6e'),_0x5e1ba4[_0x5267('0x6f')]||_0x5e1ba4[_0x5267('0x28')]);return getCall(_0x162506,_0x371302,_0x5e1ba4,_0x3e2cf5,_0x3a67a0,_0x5267('0x70'));})[_0x5267('0x33')](function(_0x358543){if(_0x358543){logger['info'](_0x5267('0x71'),_0x358543['id']);}})[_0x5267('0x75')](function(_0x2543a4){logger[_0x5267('0x76')](_0x5267('0x7e'),JSON['stringify'](_0x2543a4));});};
\ No newline at end of file
index aa20b49..d921a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59db=['exec','data1','toUpperCase','render','data2','GET','POST','data7','then','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','statusCode','body','catch','error','%s\x20%s\x20%s\x20[%s]:%s','request-promise','../../../../config/logger','trigger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59db,0x151));var _0xb59d=function(_0x1acbec,_0x313095){_0x1acbec=_0x1acbec-0x0;var _0x557465=_0x59db[_0x1acbec];return _0x557465;};'use strict';var rp=require(_0xb59d('0x0'));var util=require('util');var Mustache=require('mustache');var logger=require(_0xb59d('0x1'))(_0xb59d('0x2'));exports[_0xb59d('0x3')]=function(_0x5dddf8,_0x16182){var _0x18090b={'method':_0x5dddf8[_0xb59d('0x4')][_0xb59d('0x5')](),'uri':encodeURI(Mustache[_0xb59d('0x6')](_0x5dddf8[_0xb59d('0x7')],_0x16182)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5dddf8[_0xb59d('0x4')][_0xb59d('0x5')]()){case _0xb59d('0x8'):_0x18090b['qs']=_0x16182;break;case _0xb59d('0x9'):_0x18090b['body']=_0x5dddf8['data7']?Mustache[_0xb59d('0x6')](_0x5dddf8[_0xb59d('0xa')],_0x16182):_0x16182;break;}rp(_0x18090b)[_0xb59d('0xb')](function(_0x59d740){logger[_0xb59d('0xc')](util[_0xb59d('0xd')](_0xb59d('0xe'),_0x5dddf8[_0xb59d('0x4')],_0x5dddf8['data2'],_0x59d740[_0xb59d('0xf')],_0x59d740[_0xb59d('0x10')]));})[_0xb59d('0x11')](function(_0x55042d){logger[_0xb59d('0x12')](util[_0xb59d('0xd')](_0xb59d('0x13'),_0x5dddf8[_0xb59d('0x4')],_0x5dddf8[_0xb59d('0x7')],_0x55042d['statusCode'],_0x55042d['name'],_0x55042d['message']));});};
\ No newline at end of file
+var _0x3ecf=['name','message','request-promise','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','GET','POST','body','data7','then','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20body:\x20%s','statusCode','catch','error','format','%s\x20%s\x20%s\x20[%s]:%s'];(function(_0x3ae802,_0x41ec94){var _0x4f58ed=function(_0x4a1d62){while(--_0x4a1d62){_0x3ae802['push'](_0x3ae802['shift']());}};_0x4f58ed(++_0x41ec94);}(_0x3ecf,0x75));var _0xf3ec=function(_0x2065cd,_0x2e0d8f){_0x2065cd=_0x2065cd-0x0;var _0x4400cb=_0x3ecf[_0x2065cd];return _0x4400cb;};'use strict';var rp=require(_0xf3ec('0x0'));var util=require(_0xf3ec('0x1'));var Mustache=require(_0xf3ec('0x2'));var logger=require(_0xf3ec('0x3'))(_0xf3ec('0x4'));exports[_0xf3ec('0x5')]=function(_0x3745c4,_0x4526f2){var _0x4f85b6={'method':_0x3745c4[_0xf3ec('0x6')][_0xf3ec('0x7')](),'uri':encodeURI(Mustache[_0xf3ec('0x8')](_0x3745c4[_0xf3ec('0x9')],_0x4526f2)),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3745c4[_0xf3ec('0x6')][_0xf3ec('0x7')]()){case _0xf3ec('0xa'):_0x4f85b6['qs']=_0x4526f2;break;case _0xf3ec('0xb'):_0x4f85b6[_0xf3ec('0xc')]=_0x3745c4[_0xf3ec('0xd')]?Mustache['render'](_0x3745c4[_0xf3ec('0xd')],_0x4526f2):_0x4526f2;break;}rp(_0x4f85b6)[_0xf3ec('0xe')](function(_0xd8ea83){logger['info'](util['format'](_0xf3ec('0xf'),_0x3745c4[_0xf3ec('0x6')],_0x3745c4[_0xf3ec('0x9')],_0xd8ea83[_0xf3ec('0x10')],_0xd8ea83['body']));})[_0xf3ec('0x11')](function(_0x506de5){logger[_0xf3ec('0x12')](util[_0xf3ec('0x13')](_0xf3ec('0x14'),_0x3745c4[_0xf3ec('0x6')],_0x3745c4[_0xf3ec('0x9')],_0x506de5[_0xf3ec('0x10')],_0x506de5[_0xf3ec('0x15')],_0x506de5[_0xf3ec('0x16')]));});};
\ No newline at end of file
index dda2b53..d850b77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc3=['client','http','then','debug','rpc','routing','error','message','result','catch','jayson/promise','../../config/logger'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x8bc3,0x82));var _0x38bc=function(_0x48783c,_0x1f986b){_0x48783c=_0x48783c-0x0;var _0x2ce586=_0x8bc3[_0x48783c];return _0x2ce586;};'use strict';var jayson=require(_0x38bc('0x0'));var BPromise=require('bluebird');var logger=require(_0x38bc('0x1'))('routing');var client=jayson[_0x38bc('0x2')][_0x38bc('0x3')]({'port':0x2329});client['Request']=function(_0x38862e,_0x24ad99){return new BPromise(function(_0x20d785,_0x265fd7){return client['request'](_0x38862e,_0x24ad99)[_0x38bc('0x4')](function(_0x2165ed){logger[_0x38bc('0x5')](_0x38bc('0x6'),_0x38bc('0x7'),_0x38862e,_0x24ad99,_0x2165ed);if(_0x2165ed['error']){logger['error'](_0x38bc('0x6'),_0x38bc('0x7'),_0x38862e,_0x2165ed[_0x38bc('0x8')][_0x38bc('0x9')],_0x24ad99);return _0x265fd7(_0x2165ed[_0x38bc('0x8')][_0x38bc('0x9')]);}else{return _0x20d785(_0x2165ed[_0x38bc('0xa')]);}})[_0x38bc('0xb')](function(_0x202638){logger[_0x38bc('0x8')]('rpc','routing',_0x38862e,_0x202638,_0x24ad99);return _0x265fd7(_0x202638);});});};module['exports']=client;
\ No newline at end of file
+var _0xf822=['routing','client','http','Request','request','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger'];(function(_0x1dd82f,_0x52acb7){var _0x353ca4=function(_0x5ee4c9){while(--_0x5ee4c9){_0x1dd82f['push'](_0x1dd82f['shift']());}};_0x353ca4(++_0x52acb7);}(_0xf822,0x19e));var _0x2f82=function(_0x11192f,_0x4e22a3){_0x11192f=_0x11192f-0x0;var _0x23659d=_0xf822[_0x11192f];return _0x23659d;};'use strict';var jayson=require(_0x2f82('0x0'));var BPromise=require('bluebird');var logger=require(_0x2f82('0x1'))(_0x2f82('0x2'));var client=jayson[_0x2f82('0x3')][_0x2f82('0x4')]({'port':0x2329});client[_0x2f82('0x5')]=function(_0x260206,_0x48a05c){return new BPromise(function(_0x12e2d7,_0xd4688e){return client[_0x2f82('0x6')](_0x260206,_0x48a05c)['then'](function(_0x360c8f){logger['debug'](_0x2f82('0x7'),_0x2f82('0x2'),_0x260206,_0x48a05c,_0x360c8f);if(_0x360c8f[_0x2f82('0x8')]){logger[_0x2f82('0x8')](_0x2f82('0x7'),_0x2f82('0x2'),_0x260206,_0x360c8f['error'][_0x2f82('0x9')],_0x48a05c);return _0xd4688e(_0x360c8f[_0x2f82('0x8')][_0x2f82('0x9')]);}else{return _0x12e2d7(_0x360c8f[_0x2f82('0xa')]);}})[_0x2f82('0xb')](function(_0x439143){logger['error']('rpc',_0x2f82('0x2'),_0x260206,_0x439143,_0x48a05c);return _0xd4688e(_0x439143);});});};module[_0x2f82('0xc')]=client;
\ No newline at end of file
index 094781d..76c3813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a2=['refresh','mailAccounts','listen','log','bluebird','./server','./realtime','./rpc/mailAccount','then','getMailAccounts'];(function(_0x9a4784,_0x55f5c5){var _0x4fd053=function(_0x2d3109){while(--_0x2d3109){_0x9a4784['push'](_0x9a4784['shift']());}};_0x4fd053(++_0x55f5c5);}(_0xb8a2,0x1bc));var _0x2b8a=function(_0x477a46,_0x4cdb19){_0x477a46=_0x477a46-0x0;var _0x50a335=_0xb8a2[_0x477a46];return _0x50a335;};'use strict';var BPromise=require(_0x2b8a('0x0'));var server=require(_0x2b8a('0x1'));var Realtime=require(_0x2b8a('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x2b8a('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x2b8a('0x4')](mailAccount[_0x2b8a('0x5')]())[_0x2b8a('0x4')](realtime['initMailAccounts']())[_0x2b8a('0x4')](function(){email[_0x2b8a('0x6')](realtime[_0x2b8a('0x7')]);return realtime;});}function main(){return server[_0x2b8a('0x8')](realtime,email)[_0x2b8a('0x4')](function(_0x53fcd7){return initRealtime();})[_0x2b8a('0x4')](function(_0x193645){return setInterval(initRealtime,0x2710);})['catch'](function(_0x24fa1a){console[_0x2b8a('0x9')](_0x24fa1a);});}main();
\ No newline at end of file
+var _0x2a48=['then','mailAccounts','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','resolve','getMailAccounts','initMailAccounts'];(function(_0x1fd7d0,_0x3c4b86){var _0x2dc15f=function(_0x3bb3c7){while(--_0x3bb3c7){_0x1fd7d0['push'](_0x1fd7d0['shift']());}};_0x2dc15f(++_0x3c4b86);}(_0x2a48,0xeb));var _0x82a4=function(_0xb93141,_0x11deb0){_0xb93141=_0xb93141-0x0;var _0x379d66=_0x2a48[_0xb93141];return _0x379d66;};'use strict';var BPromise=require(_0x82a4('0x0'));var server=require(_0x82a4('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x82a4('0x2'));var mailAccount=require(_0x82a4('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x82a4('0x4')]()['then'](mailAccount[_0x82a4('0x5')]())['then'](realtime[_0x82a4('0x6')]())[_0x82a4('0x7')](function(){email['refresh'](realtime[_0x82a4('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x1be6b3){return initRealtime();})[_0x82a4('0x7')](function(_0x2b4642){return setInterval(initRealtime,0x2710);})[_0x82a4('0x9')](function(_0x35a0c3){console[_0x82a4('0xa')](_0x35a0c3);});}main();
\ No newline at end of file
index 9db456c..a703018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae8=['defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','status','Imap','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','email','box','handleImapBox','bind','end','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','ioredis','../../../config/logger','redis'];(function(_0x162b31,_0x2ba854){var _0x3fcba7=function(_0x5dcb06){while(--_0x5dcb06){_0x162b31['push'](_0x162b31['shift']());}};_0x3fcba7(++_0x2ba854);}(_0xeae8,0x66));var _0x8eae=function(_0x24f45c,_0x398d0b){_0x24f45c=_0x24f45c-0x0;var _0x4dcc16=_0xeae8[_0x24f45c];return _0x4dcc16;};'use strict';var _=require(_0x8eae('0x0'));var moment=require(_0x8eae('0x1'));var BPromise=require(_0x8eae('0x2'));var md5=require('md5');var Redis=require(_0x8eae('0x3'));var config=require('../../../config/environment');var logger=require(_0x8eae('0x4'))('email');config[_0x8eae('0x5')]=_[_0x8eae('0x6')](config[_0x8eae('0x5')],{'host':_0x8eae('0x7'),'port':0x18eb});var io=require(_0x8eae('0x8'))(new Redis(config[_0x8eae('0x5')]));var EmailImap=require(_0x8eae('0x9'));var EmailSmtp=require(_0x8eae('0xa'));var mailAccount=require(_0x8eae('0xb'));var md5Accounts={};function EmailChannel(_0x2ae6e7){logger[_0x8eae('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x2ae6e7[_0x8eae('0xd')];this[_0x8eae('0xe')]={};this[_0x8eae('0xf')]=new EmailSmtp();}EmailChannel[_0x8eae('0x10')][_0x8eae('0x11')]=function(_0x4aba96){var _0x4d3f22=this['mailAccounts'][_0x4aba96];var _0x9bf1c1={'id':_0x4d3f22['id'],'name':_0x4d3f22[_0x8eae('0x12')],'key':_0x4d3f22['key'],'active':_0x4d3f22[_0x8eae('0x13')],'Imap':{'status':_0x4d3f22['Imap'][_0x8eae('0x14')],'messageStatus':_0x4d3f22[_0x8eae('0x15')][_0x8eae('0x16')],'total':_0x4d3f22[_0x8eae('0x15')][_0x8eae('0x17')]}};if(_['isNil'](md5Accounts[_0x4aba96])){md5Accounts[_0x4aba96]={};}var _0x16f24a=md5(JSON[_0x8eae('0x18')](_0x9bf1c1));if(md5Accounts[_0x4aba96][_0x8eae('0x19')]!==_0x16f24a){md5Accounts[_0x4aba96][_0x8eae('0x19')]=_0x16f24a;io[_0x8eae('0x11')](_0x8eae('0x1a'),_0x9bf1c1);}};EmailChannel[_0x8eae('0x10')][_0x8eae('0x1b')]=function(_0x2afcc1){for(var _0x5324e3 in _0x2afcc1){if(_0x2afcc1['hasOwnProperty'](_0x5324e3)){if(_0x2afcc1[_0x5324e3]['Imap']&&_0x2afcc1[_0x5324e3][_0x8eae('0x13')]){var _0x47c1db=_0x2afcc1[_0x5324e3][_0x8eae('0x15')];if(!this[_0x8eae('0xe')][_0x8eae('0x1c')](_0x47c1db['id'])){this[_0x8eae('0xe')][_0x47c1db['id']]=new EmailImap(_0x47c1db,_0x2afcc1[_0x5324e3][_0x8eae('0x1d')]);this[_0x8eae('0xe')][_0x47c1db['id']]['on'](_0x8eae('0x1e'),this[_0x8eae('0x1f')][_0x8eae('0x20')](this,_0x5324e3));this[_0x8eae('0xe')][_0x47c1db['id']]['on']('email',this['handleImapEmail'][_0x8eae('0x20')](this,_0x5324e3));this[_0x8eae('0xe')][_0x47c1db['id']]['on'](_0x8eae('0x21'),this['handleImapEnd'][_0x8eae('0x20')](this,_0x5324e3));this[_0x8eae('0xe')][_0x47c1db['id']]['on']('error',this[_0x8eae('0x22')][_0x8eae('0x20')](this,_0x5324e3));}}else{if(_['isNil'](this[_0x8eae('0xd')][_0x5324e3][_0x8eae('0x15')])){this[_0x8eae('0xd')][_0x5324e3][_0x8eae('0x15')]={};}this[_0x8eae('0xd')][_0x5324e3][_0x8eae('0x15')][_0x8eae('0x14')]=_0x8eae('0x23');this[_0x8eae('0xd')][_0x5324e3][_0x8eae('0x15')][_0x8eae('0x16')]='';this['emit'](_0x5324e3);}}}};EmailChannel[_0x8eae('0x10')][_0x8eae('0x1f')]=function(_0x141940,_0x34dff7){if(this[_0x8eae('0xd')][_0x141940]){this[_0x8eae('0xd')][_0x141940][_0x8eae('0x15')]['status']=_0x8eae('0x24');this['mailAccounts'][_0x141940][_0x8eae('0x15')][_0x8eae('0x16')]=_0x34dff7[_0x8eae('0x12')];if(_0x34dff7[_0x8eae('0x25')]){this[_0x8eae('0xd')][_0x141940]['Imap']['total']=_0x34dff7[_0x8eae('0x25')][_0x8eae('0x17')];}return this[_0x8eae('0x11')](_0x141940);}};EmailChannel[_0x8eae('0x10')]['handleImapEmail']=function(_0x113dc7,_0x22ffeb){logger[_0x8eae('0xc')](_0x8eae('0x26'),_0x22ffeb[_0x8eae('0x27')],_0x22ffeb[_0x8eae('0x28')],_0x22ffeb[_0x8eae('0x29')],_0x113dc7);if(this[_0x8eae('0xd')][_0x113dc7]){return mailAccount[_0x8eae('0x2a')](_0x113dc7,_0x22ffeb)[_0x8eae('0x2b')](function(_0x3403a2){if(_0x3403a2){logger[_0x8eae('0xc')](_0x8eae('0x2c'));}})[_0x8eae('0x2d')](function(_0x1f247e){logger[_0x8eae('0x2e')](_0x8eae('0x2f'),JSON[_0x8eae('0x18')](_0x1f247e));});}};EmailChannel[_0x8eae('0x10')][_0x8eae('0x30')]=function(_0x143075){if(this['mailAccounts'][_0x143075]&&this[_0x8eae('0xd')][_0x143075][_0x8eae('0x15')]){if(this[_0x8eae('0xe')][this['mailAccounts'][_0x143075][_0x8eae('0x15')]['id']]){delete this[_0x8eae('0xe')][this[_0x8eae('0xd')][_0x143075][_0x8eae('0x15')]['id']];}this['mailAccounts'][_0x143075][_0x8eae('0x15')]['lastSync']=moment();this['emit'](_0x143075);}};EmailChannel[_0x8eae('0x10')][_0x8eae('0x22')]=function(_0x468e6d,_0x3ae748){if(this[_0x8eae('0xd')][_0x468e6d]){this[_0x8eae('0xd')][_0x468e6d][_0x8eae('0x15')]['status']=_0x8eae('0x2e');this[_0x8eae('0xd')][_0x468e6d]['Imap']['messageStatus']=_0x3ae748;return this['emit'](_0x468e6d);}};EmailChannel[_0x8eae('0x10')][_0x8eae('0x31')]=function(_0x4baa55,_0xcaf893){return this[_0x8eae('0xf')]['send'](_0x4baa55,_0xcaf893);};EmailChannel[_0x8eae('0x10')][_0x8eae('0x32')]=function(_0x17305e){var _0x11c626=this;if(this[_0x8eae('0xd')][_0x17305e['id']]){if(_['isNil'](this[_0x8eae('0xd')][_0x17305e['id']][_0x8eae('0x33')])){this[_0x8eae('0xd')][_0x17305e['id']]['Smtp']={};}this[_0x8eae('0xd')][_0x17305e['id']][_0x8eae('0x33')]['lastSync']=moment();return new BPromise(function(_0x44dad2,_0x2f8c54){return _0x11c626[_0x8eae('0xf')][_0x8eae('0x34')](_0x17305e)['then'](function(_0x41ea58){_0x11c626[_0x8eae('0xd')][_0x17305e['id']][_0x8eae('0x33')][_0x8eae('0x14')]='verified';_0x11c626[_0x8eae('0xd')][_0x17305e['id']][_0x8eae('0x33')][_0x8eae('0x16')]='';_0x11c626[_0x8eae('0x11')](_0x17305e['id']);_0x44dad2(_0x41ea58);})['catch'](function(_0x1dd9ec){_0x11c626['mailAccounts'][_0x17305e['id']][_0x8eae('0x33')]['status']=_0x8eae('0x2e');_0x11c626[_0x8eae('0xd')][_0x17305e['id']]['Smtp'][_0x8eae('0x16')]=_0x1dd9ec;_0x11c626[_0x8eae('0x11')](_0x17305e['id']);_0x2f8c54(_0x1dd9ec);});});}return this[_0x8eae('0xf')][_0x8eae('0x34')](_0x17305e);};module[_0x8eae('0x35')]=EmailChannel;
\ No newline at end of file
+var _0x6d38=['hasOwnProperty','imapAccounts','email','box','bind','handleImapEmail','end','error','handleImapError','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','sendMail','send','verifySmtp','Smtp','verified','exports','moment','bluebird','md5','../../../config/logger','redis','defaults','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','smtp','prototype','name','active','Imap','status','messageStatus','total','isNil','stringify','emit','mailAccount:update','refresh'];(function(_0x1496c1,_0x23cf40){var _0x48abc0=function(_0x5337d6){while(--_0x5337d6){_0x1496c1['push'](_0x1496c1['shift']());}};_0x48abc0(++_0x23cf40);}(_0x6d38,0x1ef));var _0x86d3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6d38[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var moment=require(_0x86d3('0x0'));var BPromise=require(_0x86d3('0x1'));var md5=require(_0x86d3('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x86d3('0x3'))('email');config[_0x86d3('0x4')]=_[_0x86d3('0x5')](config[_0x86d3('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x86d3('0x6'))(new Redis(config[_0x86d3('0x4')]));var EmailImap=require(_0x86d3('0x7'));var EmailSmtp=require(_0x86d3('0x8'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x552b07){logger[_0x86d3('0x9')](_0x86d3('0xa'));this[_0x86d3('0xb')]=_0x552b07['mailAccounts'];this['imapAccounts']={};this[_0x86d3('0xc')]=new EmailSmtp();}EmailChannel[_0x86d3('0xd')]['emit']=function(_0x5606eb){var _0x4300e2=this[_0x86d3('0xb')][_0x5606eb];var _0x4f216c={'id':_0x4300e2['id'],'name':_0x4300e2[_0x86d3('0xe')],'key':_0x4300e2['key'],'active':_0x4300e2[_0x86d3('0xf')],'Imap':{'status':_0x4300e2[_0x86d3('0x10')][_0x86d3('0x11')],'messageStatus':_0x4300e2[_0x86d3('0x10')][_0x86d3('0x12')],'total':_0x4300e2[_0x86d3('0x10')][_0x86d3('0x13')]}};if(_[_0x86d3('0x14')](md5Accounts[_0x5606eb])){md5Accounts[_0x5606eb]={};}var _0x5ce2ff=md5(JSON[_0x86d3('0x15')](_0x4f216c));if(md5Accounts[_0x5606eb][_0x86d3('0x2')]!==_0x5ce2ff){md5Accounts[_0x5606eb][_0x86d3('0x2')]=_0x5ce2ff;io[_0x86d3('0x16')](_0x86d3('0x17'),_0x4f216c);}};EmailChannel[_0x86d3('0xd')][_0x86d3('0x18')]=function(_0x44436d){for(var _0x53b437 in _0x44436d){if(_0x44436d[_0x86d3('0x19')](_0x53b437)){if(_0x44436d[_0x53b437][_0x86d3('0x10')]&&_0x44436d[_0x53b437][_0x86d3('0xf')]){var _0xa26ea2=_0x44436d[_0x53b437][_0x86d3('0x10')];if(!this[_0x86d3('0x1a')][_0x86d3('0x19')](_0xa26ea2['id'])){this[_0x86d3('0x1a')][_0xa26ea2['id']]=new EmailImap(_0xa26ea2,_0x44436d[_0x53b437][_0x86d3('0x1b')]);this['imapAccounts'][_0xa26ea2['id']]['on'](_0x86d3('0x1c'),this['handleImapBox'][_0x86d3('0x1d')](this,_0x53b437));this['imapAccounts'][_0xa26ea2['id']]['on']('email',this[_0x86d3('0x1e')][_0x86d3('0x1d')](this,_0x53b437));this[_0x86d3('0x1a')][_0xa26ea2['id']]['on'](_0x86d3('0x1f'),this['handleImapEnd'][_0x86d3('0x1d')](this,_0x53b437));this['imapAccounts'][_0xa26ea2['id']]['on'](_0x86d3('0x20'),this[_0x86d3('0x21')][_0x86d3('0x1d')](this,_0x53b437));}}else{if(_['isNil'](this[_0x86d3('0xb')][_0x53b437][_0x86d3('0x10')])){this[_0x86d3('0xb')][_0x53b437]['Imap']={};}this['mailAccounts'][_0x53b437][_0x86d3('0x10')]['status']=_0x86d3('0x22');this[_0x86d3('0xb')][_0x53b437][_0x86d3('0x10')][_0x86d3('0x12')]='';this['emit'](_0x53b437);}}}};EmailChannel['prototype'][_0x86d3('0x23')]=function(_0x611764,_0x50291c){if(this[_0x86d3('0xb')][_0x611764]){this['mailAccounts'][_0x611764][_0x86d3('0x10')][_0x86d3('0x11')]=_0x86d3('0x24');this[_0x86d3('0xb')][_0x611764][_0x86d3('0x10')][_0x86d3('0x12')]=_0x50291c[_0x86d3('0xe')];if(_0x50291c[_0x86d3('0x25')]){this[_0x86d3('0xb')][_0x611764][_0x86d3('0x10')][_0x86d3('0x13')]=_0x50291c[_0x86d3('0x25')][_0x86d3('0x13')];}return this[_0x86d3('0x16')](_0x611764);}};EmailChannel['prototype'][_0x86d3('0x1e')]=function(_0x403be3,_0x2bda35){logger[_0x86d3('0x9')](_0x86d3('0x26'),_0x2bda35[_0x86d3('0x27')],_0x2bda35['lastName'],_0x2bda35[_0x86d3('0x28')],_0x403be3);if(this['mailAccounts'][_0x403be3]){return mailAccount['notify'](_0x403be3,_0x2bda35)[_0x86d3('0x29')](function(_0x451bc6){if(_0x451bc6){logger[_0x86d3('0x9')]('Mail\x20accepted\x20from\x20routing');}})[_0x86d3('0x2a')](function(_0x458802){logger['error'](_0x86d3('0x2b'),JSON[_0x86d3('0x15')](_0x458802));});}};EmailChannel[_0x86d3('0xd')][_0x86d3('0x2c')]=function(_0x1196b6){if(this[_0x86d3('0xb')][_0x1196b6]&&this[_0x86d3('0xb')][_0x1196b6][_0x86d3('0x10')]){if(this['imapAccounts'][this['mailAccounts'][_0x1196b6]['Imap']['id']]){delete this[_0x86d3('0x1a')][this['mailAccounts'][_0x1196b6][_0x86d3('0x10')]['id']];}this['mailAccounts'][_0x1196b6][_0x86d3('0x10')][_0x86d3('0x2d')]=moment();this[_0x86d3('0x16')](_0x1196b6);}};EmailChannel[_0x86d3('0xd')][_0x86d3('0x21')]=function(_0x40a4ec,_0x2d15b9){if(this['mailAccounts'][_0x40a4ec]){this[_0x86d3('0xb')][_0x40a4ec][_0x86d3('0x10')]['status']=_0x86d3('0x20');this[_0x86d3('0xb')][_0x40a4ec][_0x86d3('0x10')][_0x86d3('0x12')]=_0x2d15b9;return this['emit'](_0x40a4ec);}};EmailChannel[_0x86d3('0xd')][_0x86d3('0x2e')]=function(_0x2e01ff,_0x4984c5){return this[_0x86d3('0xc')][_0x86d3('0x2f')](_0x2e01ff,_0x4984c5);};EmailChannel[_0x86d3('0xd')][_0x86d3('0x30')]=function(_0x203006){var _0x3a159d=this;if(this[_0x86d3('0xb')][_0x203006['id']]){if(_[_0x86d3('0x14')](this['mailAccounts'][_0x203006['id']][_0x86d3('0x31')])){this[_0x86d3('0xb')][_0x203006['id']][_0x86d3('0x31')]={};}this[_0x86d3('0xb')][_0x203006['id']]['Smtp'][_0x86d3('0x2d')]=moment();return new BPromise(function(_0x8ff605,_0x6f72be){return _0x3a159d[_0x86d3('0xc')]['verify'](_0x203006)['then'](function(_0x10978b){_0x3a159d['mailAccounts'][_0x203006['id']]['Smtp'][_0x86d3('0x11')]=_0x86d3('0x32');_0x3a159d[_0x86d3('0xb')][_0x203006['id']][_0x86d3('0x31')][_0x86d3('0x12')]='';_0x3a159d['emit'](_0x203006['id']);_0x8ff605(_0x10978b);})[_0x86d3('0x2a')](function(_0x3f265d){_0x3a159d[_0x86d3('0xb')][_0x203006['id']]['Smtp'][_0x86d3('0x11')]=_0x86d3('0x20');_0x3a159d['mailAccounts'][_0x203006['id']][_0x86d3('0x31')][_0x86d3('0x12')]=_0x3f265d;_0x3a159d['emit'](_0x203006['id']);_0x6f72be(_0x3f265d);});});}return this['smtp']['verify'](_0x203006);};module[_0x86d3('0x33')]=EmailChannel;
\ No newline at end of file
index d54f768..a9decc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x654d=['simpleParser','./utils','../../../config/logger','email','INBOX','getAccount','account','once','ready','handleReady','bind','handleEnd','handleError','connect','prototype','connTimeout','authTimeout','isNil','user','host','port','tls','autotls','required','password','getHost','service','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','end','handleFetchEnd','error','closeBox','body','handleMessageBody','attributes','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','exports','imap','lodash','mailparser'];(function(_0x12b5fe,_0x42557e){var _0x285adf=function(_0x3a5ae0){while(--_0x3a5ae0){_0x12b5fe['push'](_0x12b5fe['shift']());}};_0x285adf(++_0x42557e);}(_0x654d,0x1bd));var _0xd654=function(_0x5af970,_0x1b15ba){_0x5af970=_0x5af970-0x0;var _0x35b320=_0x654d[_0x5af970];return _0x35b320;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require(_0xd654('0x0'));var _=require(_0xd654('0x1'));var rs=require('randomstring');var simpleParser=require(_0xd654('0x2'))[_0xd654('0x3')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0xd654('0x4'));var logger=require(_0xd654('0x5'))(_0xd654('0x6'));function EmailImap(_0x3dead8,_0x27f8c4){this['mailbox']=_0xd654('0x7');this['account']=this[_0xd654('0x8')](_0x3dead8,_0x27f8c4);this[_0xd654('0x0')]=new Imap(this[_0xd654('0x9')]);this[_0xd654('0x0')][_0xd654('0xa')](_0xd654('0xb'),this[_0xd654('0xc')][_0xd654('0xd')](this));this[_0xd654('0x0')][_0xd654('0xa')]('end',this[_0xd654('0xe')]['bind'](this));this[_0xd654('0x0')]['on']('error',this[_0xd654('0xf')][_0xd654('0xd')](this));this[_0xd654('0x0')][_0xd654('0x10')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xd654('0x11')][_0xd654('0x8')]=function(_0x5d2812,_0x1c7b31){var _0x2f2ae1={'connTimeout':_0x5d2812[_0xd654('0x12')]?_0x5d2812['connTimeout']*0x3e8:0x2710,'authTimeout':_0x5d2812['authTimeout']?_0x5d2812[_0xd654('0x13')]*0x3e8:0x1388};if(_[_0xd654('0x14')](_0x5d2812['service'])){if(_0x5d2812['authentication']){_0x2f2ae1[_0xd654('0x15')]=_0x5d2812[_0xd654('0x15')];_0x2f2ae1['password']=_0x5d2812['password'];}_0x2f2ae1[_0xd654('0x16')]=_0x5d2812[_0xd654('0x16')];_0x2f2ae1[_0xd654('0x17')]=_0x5d2812['port']||0x3e1;if(_0x5d2812['tls']){_0x2f2ae1[_0xd654('0x18')]=!![];}else{_0x2f2ae1['tls']=![];_0x2f2ae1[_0xd654('0x19')]=_0xd654('0x1a');}}else{_0x2f2ae1['user']=_0x5d2812['user'];_0x2f2ae1[_0xd654('0x1b')]=_0x5d2812['password'];_0x2f2ae1[_0xd654('0x16')]=utils[_0xd654('0x1c')](_0x5d2812[_0xd654('0x1d')]);_0x2f2ae1[_0xd654('0x17')]=0x3e1;_0x2f2ae1[_0xd654('0x18')]=!![];}_0x2f2ae1[_0xd654('0x6')]=_0x1c7b31||_0x5d2812[_0xd654('0x15')]||_0xd654('0x1e');return _0x2f2ae1;};EmailImap[_0xd654('0x11')]['handleReady']=function(){this[_0xd654('0x0')][_0xd654('0x1f')](this['mailbox'],![],this['handleOpenBox'][_0xd654('0xd')](this));};EmailImap[_0xd654('0x11')][_0xd654('0x20')]=function(_0x28be68,_0x2e3ff6){if(_0x28be68){this[_0xd654('0xf')](_0x28be68,!![]);}else{this[_0xd654('0x21')]('box',_0x2e3ff6);this[_0xd654('0x22')]();}};EmailImap['prototype'][_0xd654('0x23')]=function(_0x3b27){if(_0x3b27){this[_0xd654('0xf')](_0x3b27,!![]);}else{this[_0xd654('0x0')]['end']();}};EmailImap['prototype'][_0xd654('0x22')]=function(){this['imap'][_0xd654('0x24')](['UNSEEN'],this[_0xd654('0x25')][_0xd654('0xd')](this));};EmailImap[_0xd654('0x11')]['handleReadUnseen']=function(_0x432da6,_0x3131c9){if(_0x432da6){this[_0xd654('0xf')](_0x432da6,!![]);}else{if(_0x3131c9[_0xd654('0x26')]){try{var _0x4b6c9c=this['imap'][_0xd654('0x27')](_0x3131c9,{'bodies':'','markSeen':!![]});_0x4b6c9c['on'](_0xd654('0x28'),this[_0xd654('0x29')][_0xd654('0xd')](this));_0x4b6c9c[_0xd654('0xa')]('error',this[_0xd654('0x2a')][_0xd654('0xd')](this));_0x4b6c9c['once'](_0xd654('0x2b'),this[_0xd654('0x2c')]['bind'](this));}catch(_0x311f66){logger[_0xd654('0x2d')](_0x311f66);}}else{this[_0xd654('0x0')][_0xd654('0x2e')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0xd654('0x11')][_0xd654('0x29')]=function(_0x26203a,_0x22e415){_0x26203a['on'](_0xd654('0x2f'),this[_0xd654('0x30')][_0xd654('0xd')](this));_0x26203a[_0xd654('0xa')](_0xd654('0x31'),this['handleMessageAttributes'][_0xd654('0xd')](this));_0x26203a[_0xd654('0xa')]('end',this[_0xd654('0x32')][_0xd654('0xd')](this));};EmailImap[_0xd654('0x11')][_0xd654('0x30')]=function(_0x5c1b95,_0x54bd31){simpleParser(_0x5c1b95,this['handleSimpleParser'][_0xd654('0xd')](this));};EmailImap[_0xd654('0x11')]['handleMessageAttributes']=function(_0x3ad746){};EmailImap[_0xd654('0x11')]['handleMessageEnd']=function(){};EmailImap[_0xd654('0x11')]['handleSimpleParser']=function(_0x481035,_0x2c3397){if(_0x481035){logger['error'](_0x481035);}else{var _0x588c0a=this;utils[_0xd654('0x33')](this['account'],_0x2c3397,function(_0x4bc0c4){_0x588c0a[_0xd654('0x21')](_0xd654('0x6'),_0x4bc0c4);});}};EmailImap[_0xd654('0x11')]['handleFetchEnd']=function(){this['imap'][_0xd654('0x2e')](!![],this[_0xd654('0x23')][_0xd654('0xd')](this));};EmailImap['prototype'][_0xd654('0x2a')]=function(_0x23e4de){this[_0xd654('0xf')](_0x23e4de);this['imap']['closeBox'](!![],this[_0xd654('0x23')][_0xd654('0xd')](this));};EmailImap['prototype'][_0xd654('0xe')]=function(){this[_0xd654('0x21')](_0xd654('0x2b'));};EmailImap[_0xd654('0x11')][_0xd654('0xf')]=function(_0x746f03,_0x4c4773){logger['error']('handleError',this[_0xd654('0x9')][_0xd654('0x6')],JSON[_0xd654('0x34')](_0x746f03));var _0x56a618='';if(_0x746f03){if(_0x746f03[_0xd654('0x35')]){_0x56a618=_0x746f03[_0xd654('0x35')];}else{for(var _0x54ca91 in _0x746f03){if(_0x746f03[_0xd654('0x36')](_0x54ca91)){_0x56a618+=_['upperFirst'](_0x54ca91)+':\x20'+_0x746f03[_0x54ca91]+'\x0a';}}}}if(_0x4c4773){this['imap'][_0xd654('0x2b')]();}else{this[_0xd654('0x21')](_0xd654('0x2d'),_0x56a618);this[_0xd654('0x21')](_0xd654('0x2b'));}};module[_0xd654('0x37')]=EmailImap;
\ No newline at end of file
+var _0xc581=['randomstring','simpleParser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','ready','handleReady','bind','once','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleOpenBox','handleError','emit','box','handleCloseBox','readUnseen','search','UNSEEN','message','handleFetchMessage','handleFetchError','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','closeBox','stringify','textCode','upperFirst','exports','path','util','lodash'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0xc581,0xb7));var _0x1c58=function(_0x15feba,_0x1c4c83){_0x15feba=_0x15feba-0x0;var _0x3106f0=_0xc581[_0x15feba];return _0x3106f0;};'use strict';var fs=require('fs');var path=require(_0x1c58('0x0'));var util=require(_0x1c58('0x1'));var Imap=require('imap');var _=require(_0x1c58('0x2'));var rs=require(_0x1c58('0x3'));var simpleParser=require('mailparser')[_0x1c58('0x4')];var EventEmitter=require(_0x1c58('0x5'))[_0x1c58('0x6')];var utils=require(_0x1c58('0x7'));var logger=require(_0x1c58('0x8'))(_0x1c58('0x9'));function EmailImap(_0x356a8c,_0x296faa){this[_0x1c58('0xa')]=_0x1c58('0xb');this[_0x1c58('0xc')]=this[_0x1c58('0xd')](_0x356a8c,_0x296faa);this[_0x1c58('0xe')]=new Imap(this[_0x1c58('0xc')]);this['imap']['once'](_0x1c58('0xf'),this[_0x1c58('0x10')][_0x1c58('0x11')](this));this[_0x1c58('0xe')][_0x1c58('0x12')](_0x1c58('0x13'),this[_0x1c58('0x14')][_0x1c58('0x11')](this));this[_0x1c58('0xe')]['on'](_0x1c58('0x15'),this['handleError'][_0x1c58('0x11')](this));this['imap'][_0x1c58('0x16')]();}util[_0x1c58('0x17')](EmailImap,EventEmitter);EmailImap[_0x1c58('0x18')][_0x1c58('0xd')]=function(_0x4feb1f,_0xd28218){var _0x17228c={'connTimeout':_0x4feb1f[_0x1c58('0x19')]?_0x4feb1f[_0x1c58('0x19')]*0x3e8:0x2710,'authTimeout':_0x4feb1f[_0x1c58('0x1a')]?_0x4feb1f[_0x1c58('0x1a')]*0x3e8:0x1388};if(_['isNil'](_0x4feb1f[_0x1c58('0x1b')])){if(_0x4feb1f[_0x1c58('0x1c')]){_0x17228c[_0x1c58('0x1d')]=_0x4feb1f[_0x1c58('0x1d')];_0x17228c[_0x1c58('0x1e')]=_0x4feb1f[_0x1c58('0x1e')];}_0x17228c[_0x1c58('0x1f')]=_0x4feb1f[_0x1c58('0x1f')];_0x17228c['port']=_0x4feb1f[_0x1c58('0x20')]||0x3e1;if(_0x4feb1f[_0x1c58('0x21')]){_0x17228c['tls']=!![];}else{_0x17228c[_0x1c58('0x21')]=![];_0x17228c[_0x1c58('0x22')]=_0x1c58('0x23');}}else{_0x17228c[_0x1c58('0x1d')]=_0x4feb1f['user'];_0x17228c[_0x1c58('0x1e')]=_0x4feb1f[_0x1c58('0x1e')];_0x17228c['host']=utils[_0x1c58('0x24')](_0x4feb1f[_0x1c58('0x1b')]);_0x17228c[_0x1c58('0x20')]=0x3e1;_0x17228c[_0x1c58('0x21')]=!![];}_0x17228c[_0x1c58('0x9')]=_0xd28218||_0x4feb1f[_0x1c58('0x1d')]||_0x1c58('0x25');return _0x17228c;};EmailImap[_0x1c58('0x18')][_0x1c58('0x10')]=function(){this[_0x1c58('0xe')]['openBox'](this['mailbox'],![],this[_0x1c58('0x26')][_0x1c58('0x11')](this));};EmailImap[_0x1c58('0x18')][_0x1c58('0x26')]=function(_0x39a9ab,_0x926c10){if(_0x39a9ab){this[_0x1c58('0x27')](_0x39a9ab,!![]);}else{this[_0x1c58('0x28')](_0x1c58('0x29'),_0x926c10);this['readUnseen']();}};EmailImap[_0x1c58('0x18')][_0x1c58('0x2a')]=function(_0x3e1af9){if(_0x3e1af9){this[_0x1c58('0x27')](_0x3e1af9,!![]);}else{this[_0x1c58('0xe')]['end']();}};EmailImap[_0x1c58('0x18')][_0x1c58('0x2b')]=function(){this[_0x1c58('0xe')][_0x1c58('0x2c')]([_0x1c58('0x2d')],this['handleReadUnseen'][_0x1c58('0x11')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x39c8b2,_0x22ddb2){if(_0x39c8b2){this[_0x1c58('0x27')](_0x39c8b2,!![]);}else{if(_0x22ddb2['length']){try{var _0x12ece9=this['imap']['fetch'](_0x22ddb2,{'bodies':'','markSeen':!![]});_0x12ece9['on'](_0x1c58('0x2e'),this[_0x1c58('0x2f')][_0x1c58('0x11')](this));_0x12ece9['once']('error',this[_0x1c58('0x30')]['bind'](this));_0x12ece9[_0x1c58('0x12')](_0x1c58('0x13'),this['handleFetchEnd'][_0x1c58('0x11')](this));}catch(_0x8cef70){logger[_0x1c58('0x15')](_0x8cef70);}}else{this[_0x1c58('0xe')]['closeBox'](!![],this[_0x1c58('0x2a')][_0x1c58('0x11')](this));}}};EmailImap[_0x1c58('0x18')][_0x1c58('0x2f')]=function(_0x4a18a3,_0x1ef731){_0x4a18a3['on'](_0x1c58('0x31'),this[_0x1c58('0x32')]['bind'](this));_0x4a18a3['once'](_0x1c58('0x33'),this[_0x1c58('0x34')][_0x1c58('0x11')](this));_0x4a18a3[_0x1c58('0x12')](_0x1c58('0x13'),this[_0x1c58('0x35')][_0x1c58('0x11')](this));};EmailImap['prototype'][_0x1c58('0x32')]=function(_0x26da1b,_0x48ae85){simpleParser(_0x26da1b,this[_0x1c58('0x36')][_0x1c58('0x11')](this));};EmailImap['prototype'][_0x1c58('0x34')]=function(_0x2e9b74){};EmailImap[_0x1c58('0x18')][_0x1c58('0x35')]=function(){};EmailImap[_0x1c58('0x18')]['handleSimpleParser']=function(_0x27e656,_0x148f8f){if(_0x27e656){logger['error'](_0x27e656);}else{var _0x2281cc=this;utils[_0x1c58('0x37')](this[_0x1c58('0xc')],_0x148f8f,function(_0x34b875){_0x2281cc[_0x1c58('0x28')]('email',_0x34b875);});}};EmailImap[_0x1c58('0x18')][_0x1c58('0x38')]=function(){this[_0x1c58('0xe')]['closeBox'](!![],this[_0x1c58('0x2a')]['bind'](this));};EmailImap[_0x1c58('0x18')]['handleFetchError']=function(_0x3d5c97){this['handleError'](_0x3d5c97);this[_0x1c58('0xe')][_0x1c58('0x39')](!![],this[_0x1c58('0x2a')]['bind'](this));};EmailImap[_0x1c58('0x18')][_0x1c58('0x14')]=function(){this[_0x1c58('0x28')]('end');};EmailImap[_0x1c58('0x18')][_0x1c58('0x27')]=function(_0x193c54,_0x283e52){logger[_0x1c58('0x15')](_0x1c58('0x27'),this['account'][_0x1c58('0x9')],JSON[_0x1c58('0x3a')](_0x193c54));var _0x248aa5='';if(_0x193c54){if(_0x193c54[_0x1c58('0x3b')]){_0x248aa5=_0x193c54['textCode'];}else{for(var _0x273a71 in _0x193c54){if(_0x193c54['hasOwnProperty'](_0x273a71)){_0x248aa5+=_[_0x1c58('0x3c')](_0x273a71)+':\x20'+_0x193c54[_0x273a71]+'\x0a';}}}}if(_0x283e52){this[_0x1c58('0xe')][_0x1c58('0x13')]();}else{this[_0x1c58('0x28')]('error',_0x248aa5);this['emit'](_0x1c58('0x13'));}};module[_0x1c58('0x3d')]=EmailImap;
\ No newline at end of file
index bfd300a..2499247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c4=['sendMail','verify','toString','Not\x20verifired','exports','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x350615,_0x14fc3e){var _0x3a1985=function(_0x33d2c9){while(--_0x33d2c9){_0x350615['push'](_0x350615['shift']());}};_0x3a1985(++_0x14fc3e);}(_0xc2c4,0x11d));var _0x4c2c=function(_0x18b38d,_0x5d5c89){_0x18b38d=_0x18b38d-0x0;var _0x1324dd=_0xc2c4[_0x18b38d];return _0x1324dd;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x4c2c('0x0'));var inlineBase64=require(_0x4c2c('0x1'));function EmailSmtp(){}EmailSmtp[_0x4c2c('0x2')][_0x4c2c('0x3')]=function(_0x337502,_0x39c8a5){return new BPromise(function(_0x506d45,_0xed5e04){var _0x5ed6fb=nodemailer[_0x4c2c('0x4')](_0x337502);_0x5ed6fb['use']('compile',inlineBase64());_0x5ed6fb[_0x4c2c('0x5')](_0x39c8a5,function(_0x28b975,_0x34c617){if(_0x28b975){_0xed5e04(_0x28b975['toString']());}else{_0x506d45(_0x34c617);}});});};EmailSmtp[_0x4c2c('0x2')]['verify']=function(_0x2eee54){return new BPromise(function(_0x389e47,_0x547279){var _0x18e2e2=nodemailer[_0x4c2c('0x4')](_0x2eee54);_0x18e2e2[_0x4c2c('0x6')](function(_0xb53593,_0x6c6f21){if(_0xb53593){_0x547279(_0xb53593[_0x4c2c('0x7')]());}else{if(_0x6c6f21){_0x389e47(_0x6c6f21);}else{_0x547279(_0x4c2c('0x8'));}}});});};module[_0x4c2c('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0xe69d=['prototype','verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','createTransport','compile','toString'];(function(_0x30993d,_0x232e6c){var _0x590716=function(_0x42cc12){while(--_0x42cc12){_0x30993d['push'](_0x30993d['shift']());}};_0x590716(++_0x232e6c);}(_0xe69d,0x18f));var _0xde69=function(_0x51afe6,_0x36a6e6){_0x51afe6=_0x51afe6-0x0;var _0x47f4ba=_0xe69d[_0x51afe6];return _0x47f4ba;};'use strict';var nodemailer=require(_0xde69('0x0'));var BPromise=require(_0xde69('0x1'));var inlineBase64=require(_0xde69('0x2'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0xa23dd,_0x2e16df){return new BPromise(function(_0x463b79,_0x40fb10){var _0x5891e3=nodemailer[_0xde69('0x3')](_0xa23dd);_0x5891e3['use'](_0xde69('0x4'),inlineBase64());_0x5891e3['sendMail'](_0x2e16df,function(_0x392c66,_0x2c0c9d){if(_0x392c66){_0x40fb10(_0x392c66[_0xde69('0x5')]());}else{_0x463b79(_0x2c0c9d);}});});};EmailSmtp[_0xde69('0x6')][_0xde69('0x7')]=function(_0x35d170){return new BPromise(function(_0x4a62c3,_0x257b06){var _0x1f50de=nodemailer[_0xde69('0x3')](_0x35d170);_0x1f50de[_0xde69('0x7')](function(_0x2d5e6a,_0x370b7f){if(_0x2d5e6a){_0x257b06(_0x2d5e6a[_0xde69('0x5')]());}else{if(_0x370b7f){_0x4a62c3(_0x370b7f);}else{_0x257b06(_0xde69('0x8'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index ab7dbb4..ec50743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4f3=['Anonymous','value','pop','anonymous','@xcally.com','html','test','replace','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','isEmpty','includes','originCc','bcc','attachments','attach','type','attachment','filename','attachment-','format','join','server/files/attachments/','writeFileSync','push','contentType','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','messageId','parseBuffer','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','generate','name','split','length'];(function(_0x1213a5,_0x2873ac){var _0x17a930=function(_0xe0bc75){while(--_0xe0bc75){_0x1213a5['push'](_0x1213a5['shift']());}};_0x17a930(++_0x2873ac);}(_0xc4f3,0xbd));var _0x3c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c4f('0x0'));var moment=require(_0x3c4f('0x1'));var random=require(_0x3c4f('0x2'));var fs=require('fs');var path=require(_0x3c4f('0x3'));var util=require(_0x3c4f('0x4'));var tnef=require(_0x3c4f('0x5'));var logger=require(_0x3c4f('0x6'))(_0x3c4f('0x7'));var config=require(_0x3c4f('0x8'));function getAddress(_0x3cd3d4){var _0x4a74b6=_[_0x3c4f('0x9')](_0x3cd3d4['value']);return _0x4a74b6&&_0x4a74b6[_0x3c4f('0xa')]?_0x4a74b6[_0x3c4f('0xa')]:'anonymous'+random[_0x3c4f('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x33152a){var _0x4237cc=_['head'](_0x33152a['value']);if(_0x4237cc&&_0x4237cc[_0x3c4f('0xc')]){var _0x56da52=_0x4237cc[_0x3c4f('0xc')][_0x3c4f('0xd')](/\s+/);return _0x56da52[_0x3c4f('0xe')]?_0x56da52['slice'](0x0,-0x1)['join']('\x20'):_0x4237cc[_0x3c4f('0xc')];}return _0x3c4f('0xf');}function getLastName(_0x29e915){var _0x4ef62b=_[_0x3c4f('0x9')](_0x29e915[_0x3c4f('0x10')]);if(_0x4ef62b&&_0x4ef62b[_0x3c4f('0xc')]){var _0x2460c5=_0x4ef62b[_0x3c4f('0xc')][_0x3c4f('0xd')](/\s+/);return _0x2460c5[_0x3c4f('0xe')]>0x1?_0x2460c5[_0x3c4f('0x11')]():'';}return'';}function getMails(_0x12345f,_0x437d74){var _0x3adbf7='';for(var _0x2e3820=0x0;_0x2e3820<_0x437d74['value']['length'];_0x2e3820+=0x1){if(_0x437d74['value'][_0x2e3820][_0x3c4f('0xa')]!==_0x12345f){if(!_['isEmpty'](_0x3adbf7)){_0x3adbf7+=',';}_0x3adbf7+=_0x437d74['value'][_0x2e3820][_0x3c4f('0xc')]||_0x437d74[_0x3c4f('0x10')][_0x2e3820][_0x3c4f('0xa')]||'';_0x3adbf7+='\x20<';_0x3adbf7+=_0x437d74['value'][_0x2e3820]['address']?_0x437d74[_0x3c4f('0x10')][_0x2e3820]['address']:_0x3c4f('0x12')+random[_0x3c4f('0xb')](0x6)+_0x3c4f('0x13');_0x3adbf7+='>';}}return _0x3adbf7;}function parseEmail(_0x4cd756,_0x5d39d2,_0x31b53f){if(_0x5d39d2[_0x3c4f('0x14')]){var _0xc188d0=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0xc188d0[_0x3c4f('0x15')](_0x5d39d2[_0x3c4f('0x14')])){_0x5d39d2[_0x3c4f('0x14')]=_0x5d39d2['html'][_0x3c4f('0x16')](_0xc188d0,'');}_0x31b53f['body']=_0x5d39d2[_0x3c4f('0x14')];}else{_0x31b53f[_0x3c4f('0x17')]=_0x5d39d2[_0x3c4f('0x18')];}if(_0x31b53f[_0x3c4f('0x17')]){_0x31b53f[_0x3c4f('0x17')]=_0x31b53f[_0x3c4f('0x17')][_0x3c4f('0x16')](/<a\s+/gi,_0x3c4f('0x19'));}if(_0x5d39d2['to']){_0x31b53f[_0x3c4f('0x1a')][_0x3c4f('0x1b')]=getMails(null,_0x5d39d2['to']);var _0xe787ff=getMails(_0x4cd756[_0x3c4f('0x7')],_0x5d39d2['to']);if(!_[_0x3c4f('0x1c')](_0xe787ff)){_0x31b53f[_0x3c4f('0x1a')]['cc']+=_0xe787ff;}}if(_0x5d39d2['cc']){_0x31b53f[_0x3c4f('0x1a')]['originCc']=getMails(null,_0x5d39d2['cc']);var _0x1672f0=getMails(_0x4cd756[_0x3c4f('0x7')],_0x5d39d2['cc']);if(!_['isEmpty'](_0x1672f0)){if(!_[_0x3c4f('0x1c')](_0x31b53f[_0x3c4f('0x1a')]['cc'])){_0x31b53f[_0x3c4f('0x1a')]['cc']+=',';}_0x31b53f[_0x3c4f('0x1a')]['cc']+=_0x1672f0;}}if(!_['includes'](_0x31b53f[_0x3c4f('0x1a')][_0x3c4f('0x1b')],_0x4cd756['email'])&&!_[_0x3c4f('0x1d')](_0x31b53f['message'][_0x3c4f('0x1e')],_0x4cd756['email'])){_0x31b53f[_0x3c4f('0x1a')][_0x3c4f('0x1f')]=_0x4cd756['email'];}if(_0x5d39d2['attachments']&&_0x5d39d2[_0x3c4f('0x20')][_0x3c4f('0xe')]){_0x31b53f[_0x3c4f('0x1a')][_0x3c4f('0x21')]=_0x5d39d2['attachments']['length'];for(var _0x7a459a=0x0,_0x191c7f,_0x1b81ad,_0x72dbc4;_0x7a459a<_0x5d39d2['attachments'][_0x3c4f('0xe')];_0x7a459a+=0x1){if(_0x5d39d2[_0x3c4f('0x20')][_0x7a459a][_0x3c4f('0x22')]===_0x3c4f('0x23')){_0x72dbc4=_0x5d39d2[_0x3c4f('0x20')][_0x7a459a][_0x3c4f('0x24')]||_0x3c4f('0x25')+_0x7a459a;_0x191c7f=util[_0x3c4f('0x26')]('%s-%s',Date['now'](),_0x72dbc4);_0x1b81ad=path[_0x3c4f('0x27')](config['root'],_0x3c4f('0x28'),_0x191c7f);fs[_0x3c4f('0x29')](_0x1b81ad,_0x5d39d2[_0x3c4f('0x20')][_0x7a459a]['content']);_0x31b53f[_0x3c4f('0x1a')][_0x3c4f('0x20')][_0x3c4f('0x2a')]({'name':_0x72dbc4,'basename':_0x191c7f,'type':_0x5d39d2[_0x3c4f('0x20')][_0x7a459a][_0x3c4f('0x2b')],'filepath':_0x1b81ad});}}}return _0x31b53f;}exports[_0x3c4f('0x2c')]=function(_0x157391,_0x29957e,_0x659b2a){var _0x46d9b1={'from':getAddress(_0x29957e['from']),'firstName':getFirstName(_0x29957e['from']),'lastName':getLastName(_0x29957e[_0x3c4f('0x2d')]),'mapKey':_0x3c4f('0x7'),'message':{'from':getMails(_0x157391[_0x3c4f('0x7')],_0x29957e['from']),'to':_0x157391[_0x3c4f('0x7')],'cc':'','subject':_0x29957e[_0x3c4f('0x2e')]||'','messageId':_0x29957e['messageId'],'inReplyTo':_0x29957e[_0x3c4f('0x2f')],'sentAt':moment(_0x29957e[_0x3c4f('0x30')])['format'](_0x3c4f('0x31')),'attach':![],'attachments':[]}};if(!_0x29957e[_0x3c4f('0x14')]&&!_0x29957e['textAsHtml']){var _0x2f582f=_[_0x3c4f('0x32')](_0x29957e[_0x3c4f('0x20')],{'contentType':'application/ms-tnef'});if(_0x2f582f[_0x3c4f('0xe')]){logger[_0x3c4f('0x33')](util[_0x3c4f('0x26')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x29957e[_0x3c4f('0x34')]));tnef[_0x3c4f('0x35')](_[_0x3c4f('0x36')](_0x2f582f)[_0x3c4f('0x37')],function(_0x4e468c,_0x45c4cd){if(_0x45c4cd){_0x29957e['html']=_0x45c4cd[_0x3c4f('0x38')]||_0x3c4f('0x39');if(_0x45c4cd['Attachments']){for(var _0xf66771=0x0;_0xf66771<_0x45c4cd['Attachments'][_0x3c4f('0xe')];_0xf66771++){var _0x57b15e=_0x45c4cd[_0x3c4f('0x3a')][_0xf66771];_0x46d9b1[_0x3c4f('0x1a')][_0x3c4f('0x20')][_0x3c4f('0x2a')]({'filename':_0x57b15e[_0x3c4f('0x3b')],'content':new Buffer(_0x57b15e[_0x3c4f('0x3c')])});}}}_0x659b2a(parseEmail(_0x157391,_0x29957e,_0x46d9b1));});}else{_0x29957e['html']=_0x3c4f('0x39');_0x659b2a(parseEmail(_0x157391,_0x29957e,_0x46d9b1));}}else{_0x659b2a(parseEmail(_0x157391,_0x29957e,_0x46d9b1));}};exports[_0x3c4f('0x3d')]=function(_0x568ada){switch(_0x568ada){case _0x3c4f('0x3e'):return'imap.gmail.com';case _0x3c4f('0x3f'):return _0x3c4f('0x40');case'hotmail':return _0x3c4f('0x41');case _0x3c4f('0x42'):return'outlook.office365.com';}return _0x3c4f('0x43');};
\ No newline at end of file
+var _0xd202=['util','node-tnef','email','../../../config/environment','head','address','generate','name','split','length','slice','join','Anonymous','value','pop','isEmpty','@xcally.com','html','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','includes','originTo','bcc','attachments','attach','type','attachment','filename','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','getHost','imap.gmail.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring'];(function(_0x1fe25f,_0x6824f7){var _0xa8a413=function(_0x26f548){while(--_0x26f548){_0x1fe25f['push'](_0x1fe25f['shift']());}};_0xa8a413(++_0x6824f7);}(_0xd202,0x14c));var _0x2d20=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xd202[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x2d20('0x0'));var moment=require(_0x2d20('0x1'));var random=require(_0x2d20('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x2d20('0x3'));var tnef=require(_0x2d20('0x4'));var logger=require('../../../config/logger')(_0x2d20('0x5'));var config=require(_0x2d20('0x6'));function getAddress(_0x221657){var _0x731d47=_[_0x2d20('0x7')](_0x221657['value']);return _0x731d47&&_0x731d47[_0x2d20('0x8')]?_0x731d47[_0x2d20('0x8')]:'anonymous'+random[_0x2d20('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x40feca){var _0x2f4225=_['head'](_0x40feca['value']);if(_0x2f4225&&_0x2f4225['name']){var _0x12a095=_0x2f4225[_0x2d20('0xa')][_0x2d20('0xb')](/\s+/);return _0x12a095[_0x2d20('0xc')]?_0x12a095[_0x2d20('0xd')](0x0,-0x1)[_0x2d20('0xe')]('\x20'):_0x2f4225[_0x2d20('0xa')];}return _0x2d20('0xf');}function getLastName(_0x504e12){var _0x2298bf=_[_0x2d20('0x7')](_0x504e12[_0x2d20('0x10')]);if(_0x2298bf&&_0x2298bf[_0x2d20('0xa')]){var _0x218e71=_0x2298bf['name']['split'](/\s+/);return _0x218e71[_0x2d20('0xc')]>0x1?_0x218e71[_0x2d20('0x11')]():'';}return'';}function getMails(_0x352b83,_0x3c71c3){var _0x379127='';for(var _0xba1bfb=0x0;_0xba1bfb<_0x3c71c3[_0x2d20('0x10')]['length'];_0xba1bfb+=0x1){if(_0x3c71c3[_0x2d20('0x10')][_0xba1bfb][_0x2d20('0x8')]!==_0x352b83){if(!_[_0x2d20('0x12')](_0x379127)){_0x379127+=',';}_0x379127+=_0x3c71c3[_0x2d20('0x10')][_0xba1bfb][_0x2d20('0xa')]||_0x3c71c3[_0x2d20('0x10')][_0xba1bfb]['address']||'';_0x379127+='\x20<';_0x379127+=_0x3c71c3[_0x2d20('0x10')][_0xba1bfb]['address']?_0x3c71c3['value'][_0xba1bfb][_0x2d20('0x8')]:'anonymous'+random[_0x2d20('0x9')](0x6)+_0x2d20('0x13');_0x379127+='>';}}return _0x379127;}function parseEmail(_0x1e9244,_0x59f3d7,_0x7b0936){if(_0x59f3d7[_0x2d20('0x14')]){var _0x42fd89=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x42fd89['test'](_0x59f3d7['html'])){_0x59f3d7[_0x2d20('0x14')]=_0x59f3d7[_0x2d20('0x14')]['replace'](_0x42fd89,'');}_0x7b0936[_0x2d20('0x15')]=_0x59f3d7[_0x2d20('0x14')];}else{_0x7b0936[_0x2d20('0x15')]=_0x59f3d7[_0x2d20('0x16')];}if(_0x7b0936[_0x2d20('0x15')]){_0x7b0936[_0x2d20('0x15')]=_0x7b0936[_0x2d20('0x15')]['replace'](/<a\s+/gi,_0x2d20('0x17'));}if(_0x59f3d7['to']){_0x7b0936['message']['originTo']=getMails(null,_0x59f3d7['to']);var _0x502842=getMails(_0x1e9244[_0x2d20('0x5')],_0x59f3d7['to']);if(!_[_0x2d20('0x12')](_0x502842)){_0x7b0936[_0x2d20('0x18')]['cc']+=_0x502842;}}if(_0x59f3d7['cc']){_0x7b0936[_0x2d20('0x18')][_0x2d20('0x19')]=getMails(null,_0x59f3d7['cc']);var _0x13b26b=getMails(_0x1e9244[_0x2d20('0x5')],_0x59f3d7['cc']);if(!_[_0x2d20('0x12')](_0x13b26b)){if(!_['isEmpty'](_0x7b0936[_0x2d20('0x18')]['cc'])){_0x7b0936[_0x2d20('0x18')]['cc']+=',';}_0x7b0936[_0x2d20('0x18')]['cc']+=_0x13b26b;}}if(!_[_0x2d20('0x1a')](_0x7b0936['message'][_0x2d20('0x1b')],_0x1e9244['email'])&&!_[_0x2d20('0x1a')](_0x7b0936[_0x2d20('0x18')]['originCc'],_0x1e9244[_0x2d20('0x5')])){_0x7b0936[_0x2d20('0x18')][_0x2d20('0x1c')]=_0x1e9244[_0x2d20('0x5')];}if(_0x59f3d7[_0x2d20('0x1d')]&&_0x59f3d7[_0x2d20('0x1d')][_0x2d20('0xc')]){_0x7b0936[_0x2d20('0x18')][_0x2d20('0x1e')]=_0x59f3d7[_0x2d20('0x1d')][_0x2d20('0xc')];for(var _0x14e707=0x0,_0x1626cd,_0x473979,_0x1095db;_0x14e707<_0x59f3d7['attachments'][_0x2d20('0xc')];_0x14e707+=0x1){if(_0x59f3d7[_0x2d20('0x1d')][_0x14e707][_0x2d20('0x1f')]===_0x2d20('0x20')){_0x1095db=_0x59f3d7[_0x2d20('0x1d')][_0x14e707][_0x2d20('0x21')]||_0x2d20('0x22')+_0x14e707;_0x1626cd=util[_0x2d20('0x23')](_0x2d20('0x24'),Date[_0x2d20('0x25')](),_0x1095db);_0x473979=path['join'](config[_0x2d20('0x26')],_0x2d20('0x27'),_0x1626cd);fs[_0x2d20('0x28')](_0x473979,_0x59f3d7[_0x2d20('0x1d')][_0x14e707][_0x2d20('0x29')]);_0x7b0936[_0x2d20('0x18')][_0x2d20('0x1d')][_0x2d20('0x2a')]({'name':_0x1095db,'basename':_0x1626cd,'type':_0x59f3d7['attachments'][_0x14e707][_0x2d20('0x2b')],'filepath':_0x473979});}}}return _0x7b0936;}exports[_0x2d20('0x2c')]=function(_0x4141a3,_0x4237f1,_0x8f963){var _0x25af1e={'from':getAddress(_0x4237f1[_0x2d20('0x2d')]),'firstName':getFirstName(_0x4237f1[_0x2d20('0x2d')]),'lastName':getLastName(_0x4237f1[_0x2d20('0x2d')]),'mapKey':_0x2d20('0x5'),'message':{'from':getMails(_0x4141a3[_0x2d20('0x5')],_0x4237f1[_0x2d20('0x2d')]),'to':_0x4141a3['email'],'cc':'','subject':_0x4237f1[_0x2d20('0x2e')]||'','messageId':_0x4237f1[_0x2d20('0x2f')],'inReplyTo':_0x4237f1[_0x2d20('0x30')],'sentAt':moment(_0x4237f1[_0x2d20('0x31')])['format'](_0x2d20('0x32')),'attach':![],'attachments':[]}};if(!_0x4237f1[_0x2d20('0x14')]&&!_0x4237f1[_0x2d20('0x16')]){var _0xb094a0=_[_0x2d20('0x33')](_0x4237f1[_0x2d20('0x1d')],{'contentType':_0x2d20('0x34')});if(_0xb094a0[_0x2d20('0xc')]){logger['info'](util[_0x2d20('0x23')](_0x2d20('0x35'),_0x4237f1[_0x2d20('0x2f')]));tnef[_0x2d20('0x36')](_[_0x2d20('0x37')](_0xb094a0)[_0x2d20('0x29')],function(_0x280234,_0x3b64fa){if(_0x3b64fa){_0x4237f1['html']=_0x3b64fa[_0x2d20('0x38')]||'<p>Empty\x20message</p>';if(_0x3b64fa[_0x2d20('0x39')]){for(var _0x32b650=0x0;_0x32b650<_0x3b64fa['Attachments'][_0x2d20('0xc')];_0x32b650++){var _0x22cf04=_0x3b64fa[_0x2d20('0x39')][_0x32b650];_0x25af1e[_0x2d20('0x18')][_0x2d20('0x1d')]['push']({'filename':_0x22cf04[_0x2d20('0x3a')],'content':new Buffer(_0x22cf04[_0x2d20('0x3b')])});}}}_0x8f963(parseEmail(_0x4141a3,_0x4237f1,_0x25af1e));});}else{_0x4237f1[_0x2d20('0x14')]='<p>Empty\x20message</p>';_0x8f963(parseEmail(_0x4141a3,_0x4237f1,_0x25af1e));}}else{_0x8f963(parseEmail(_0x4141a3,_0x4237f1,_0x25af1e));}};exports[_0x2d20('0x3c')]=function(_0x3b7e6b){switch(_0x3b7e6b){case'gmail':return _0x2d20('0x3d');case'yahoo':return'imap.mail.yahoo.com';case _0x2d20('0x3e'):return _0x2d20('0x3f');case _0x2d20('0x40'):return _0x2d20('0x41');}return _0x2d20('0x42');};
\ No newline at end of file
index 325ec02..5b7381f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22f8=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x22f8,0x105));var _0x822f=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x22f8[_0x12d033];return _0x3b4e80;};'use strict';var _=require(_0x822f('0x0'));function MailAccount(_0x208e41){this['id']=_0x208e41['id']||0x0;this['name']=_0x208e41[_0x822f('0x1')]||_0x822f('0x2');this[_0x822f('0x3')]=_0x208e41[_0x822f('0x3')]||_0x822f('0x4');this[_0x822f('0x5')]=_0x208e41[_0x822f('0x5')]||![];this['Imap']=_0x208e41[_0x822f('0x6')]||[];this[_0x822f('0x7')]=_0x208e41[_0x822f('0x7')]||[];}module[_0x822f('0x8')]=MailAccount;
\ No newline at end of file
+var _0xd98b=['active','Imap','Smtp','exports','lodash','name','key','SERV'];(function(_0x82b73d,_0x17a49b){var _0x250450=function(_0x361a7b){while(--_0x361a7b){_0x82b73d['push'](_0x82b73d['shift']());}};_0x250450(++_0x17a49b);}(_0xd98b,0x11c));var _0xbd98=function(_0x1b3f52,_0x4f5b13){_0x1b3f52=_0x1b3f52-0x0;var _0x36bf2c=_0xd98b[_0x1b3f52];return _0x36bf2c;};'use strict';var _=require(_0xbd98('0x0'));function MailAccount(_0x42b003){this['id']=_0x42b003['id']||0x0;this[_0xbd98('0x1')]=_0x42b003[_0xbd98('0x1')]||'Service';this[_0xbd98('0x2')]=_0x42b003['key']||_0xbd98('0x3');this[_0xbd98('0x4')]=_0x42b003[_0xbd98('0x4')]||![];this[_0xbd98('0x5')]=_0x42b003[_0xbd98('0x5')]||[];this[_0xbd98('0x6')]=_0x42b003['Smtp']||[];}module[_0xbd98('0x7')]=MailAccount;
\ No newline at end of file
index 0d3ae93..35e324e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x4dd1b3,_0x357e15){var _0x5d30ba=function(_0x419c4e){while(--_0x419c4e){_0x4dd1b3['push'](_0x4dd1b3['shift']());}};_0x5d30ba(++_0x357e15);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x229f5e,_0x433f0f){_0x229f5e=_0x229f5e-0x0;var _0x2d62ff=_0xeb3b[_0x229f5e];return _0x2d62ff;};'use strict';var _=require(_0xbeb3('0x0'));var MailAccount=require(_0xbeb3('0x1'));var Realtime=function(){this[_0xbeb3('0x2')]={};};function freeIsNotKey(_0x33e049,_0xba125a,_0x565c41){var _0x5df0cb=_[_0xbeb3('0x3')](_0x33e049,function(_0x5b0e3b,_0x2e8ce3){return _0x5b0e3b[_0x565c41];});for(var _0x4852ca in _0xba125a){if(_0xba125a[_0xbeb3('0x4')](_0x4852ca)){if(!_0x5df0cb[_0x4852ca]){delete _0xba125a[_0x4852ca];}}}}Realtime[_0xbeb3('0x5')][_0xbeb3('0x6')]=function(_0x294cc9,_0x406927){for(var _0x143255 in _0x406927){if(_0x294cc9['hasOwnProperty'](_0x143255)){_0x294cc9[_0x143255]=_0x406927[_0x143255];}}};Realtime[_0xbeb3('0x5')][_0xbeb3('0x7')]=function(){var _0x2a029e=this;return function(_0x3b61ac){if(_0x3b61ac){freeIsNotKey(_0x3b61ac,_0x2a029e[_0xbeb3('0x2')],'id');for(var _0x550805=0x0,_0x10161e={},_0x567333={};_0x550805<_0x3b61ac[_0xbeb3('0x8')];_0x550805+=0x1){_0x10161e=_0x3b61ac[_0x550805];if(_[_0xbeb3('0x9')](_0x2a029e['mailAccounts'][_0x10161e['id']])){_0x2a029e[_0xbeb3('0x2')][_0x10161e['id']]=new MailAccount(_0x10161e);}else{_[_0xbeb3('0xa')](_0x2a029e[_0xbeb3('0x2')][_0x10161e['id']],_0x10161e);}}}return _0x2a029e[_0xbeb3('0x2')];};};module[_0xbeb3('0xb')]=Realtime;
\ No newline at end of file
+var _0x57ca=['initMailAccounts','length','isUndefined','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x577468,_0x116bf5){var _0x47db19=function(_0x3a446d){while(--_0x3a446d){_0x577468['push'](_0x577468['shift']());}};_0x47db19(++_0x116bf5);}(_0x57ca,0x108));var _0xa57c=function(_0x2f5a67,_0x278bd6){_0x2f5a67=_0x2f5a67-0x0;var _0x1307e0=_0x57ca[_0x2f5a67];return _0x1307e0;};'use strict';var _=require('lodash');var MailAccount=require(_0xa57c('0x0'));var Realtime=function(){this[_0xa57c('0x1')]={};};function freeIsNotKey(_0x4b1712,_0x3a7394,_0x396613){var _0x1d38e7=_[_0xa57c('0x2')](_0x4b1712,function(_0x1da469,_0x48be2d){return _0x1da469[_0x396613];});for(var _0x40ba22 in _0x3a7394){if(_0x3a7394[_0xa57c('0x3')](_0x40ba22)){if(!_0x1d38e7[_0x40ba22]){delete _0x3a7394[_0x40ba22];}}}}Realtime[_0xa57c('0x4')][_0xa57c('0x5')]=function(_0xbdfffb,_0x314574){for(var _0x19e28e in _0x314574){if(_0xbdfffb[_0xa57c('0x3')](_0x19e28e)){_0xbdfffb[_0x19e28e]=_0x314574[_0x19e28e];}}};Realtime['prototype'][_0xa57c('0x6')]=function(){var _0x4b51d8=this;return function(_0x46ba92){if(_0x46ba92){freeIsNotKey(_0x46ba92,_0x4b51d8[_0xa57c('0x1')],'id');for(var _0x4fa5ed=0x0,_0x156bca={},_0x51f287={};_0x4fa5ed<_0x46ba92[_0xa57c('0x7')];_0x4fa5ed+=0x1){_0x156bca=_0x46ba92[_0x4fa5ed];if(_[_0xa57c('0x8')](_0x4b51d8['mailAccounts'][_0x156bca['id']])){_0x4b51d8[_0xa57c('0x1')][_0x156bca['id']]=new MailAccount(_0x156bca);}else{_['merge'](_0x4b51d8[_0xa57c('0x1')][_0x156bca['id']],_0x156bca);}}}return _0x4b51d8[_0xa57c('0x1')];};};module[_0xa57c('0x9')]=Realtime;
\ No newline at end of file
index e081187..b4f36b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aff=['Smtp','notify','Request','NotifyMailAccount','../client','name','email','key','TemplateId','MailServerIn','Imap','MailServerOut'];(function(_0x945f19,_0x5c3313){var _0x4c0fad=function(_0x5f2435){while(--_0x5f2435){_0x945f19['push'](_0x945f19['shift']());}};_0x4c0fad(++_0x5c3313);}(_0x3aff,0x148));var _0xf3af=function(_0x31f2b7,_0x260339){_0x31f2b7=_0x31f2b7-0x0;var _0x24fda3=_0x3aff[_0x31f2b7];return _0x24fda3;};'use strict';var client=require(_0xf3af('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0xf3af('0x1'),'service',_0xf3af('0x2'),'active',_0xf3af('0x3'),'ListId',_0xf3af('0x4')],'raw':![],'include':[{'model':_0xf3af('0x5'),'as':_0xf3af('0x6')},{'model':_0xf3af('0x7'),'as':_0xf3af('0x8')}]},'log':'getMailAccount'});};};exports[_0xf3af('0x9')]=function(_0x4a3c8a,_0x315cc3){return client[_0xf3af('0xa')](_0xf3af('0xb'),{'account':{'id':_0x4a3c8a},'body':_0x315cc3,'log':_0xf3af('0xb')});};
\ No newline at end of file
+var _0xabf1=['MailServerOut','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','service','key','ListId','TemplateId','MailServerIn'];(function(_0x18f77c,_0x42b4ed){var _0x5bc329=function(_0x2b804f){while(--_0x2b804f){_0x18f77c['push'](_0x18f77c['shift']());}};_0x5bc329(++_0x42b4ed);}(_0xabf1,0xa0));var _0x1abf=function(_0xae1dc6,_0x568802){_0xae1dc6=_0xae1dc6-0x0;var _0x19f9be=_0xabf1[_0xae1dc6];return _0x19f9be;};'use strict';var client=require(_0x1abf('0x0'));exports[_0x1abf('0x1')]=function(){return function(){return client[_0x1abf('0x2')](_0x1abf('0x3'),{'options':{'attributes':['id','name',_0x1abf('0x4'),'email','active',_0x1abf('0x5'),_0x1abf('0x6'),_0x1abf('0x7')],'raw':![],'include':[{'model':_0x1abf('0x8'),'as':'Imap'},{'model':_0x1abf('0x9'),'as':_0x1abf('0xa')}]},'log':_0x1abf('0xb')});};};exports['notify']=function(_0x460a78,_0x1f2439){return client[_0x1abf('0x2')](_0x1abf('0xc'),{'account':{'id':_0x460a78},'body':_0x1f2439,'log':_0x1abf('0xc')});};
\ No newline at end of file
index 5b71dcb..9b6dce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf894=['account','message','catch','error','then','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','../../../config/logger','email','listen','sendMail'];(function(_0x14cfdf,_0x1348e0){var _0x15f578=function(_0x1cf468){while(--_0x1cf468){_0x14cfdf['push'](_0x14cfdf['shift']());}};_0x15f578(++_0x1348e0);}(_0xf894,0xfd));var _0x4f89=function(_0xdbff1d,_0x504984){_0xdbff1d=_0xdbff1d-0x0;var _0x1b5287=_0xf894[_0xdbff1d];return _0x1b5287;};'use strict';var jayson=require(_0x4f89('0x0'));var BPromise=require(_0x4f89('0x1'));var _=require(_0x4f89('0x2'));var logger=require(_0x4f89('0x3'))(_0x4f89('0x4'));exports[_0x4f89('0x5')]=function(_0x34ff01,_0x1bfd64){return new BPromise(function(_0x2c2f5a,_0x297f74){var _0x2f2d59={'SendMail':function(_0x413f13){var _0x8837a0=this;return new Promise(function(_0x343593,_0x324870){_0x1bfd64[_0x4f89('0x6')](_0x413f13[_0x4f89('0x7')],_0x413f13[_0x4f89('0x8')])['then'](function(_0x2f8cd8){_0x343593({'code':0xc8,'message':_0x2f8cd8});})[_0x4f89('0x9')](function(_0x2eb8fe){_0x324870(_0x8837a0[_0x4f89('0xa')](0x1f4,_0x2eb8fe));});});},'VerifySmtp':function(_0x27056c){var _0x24bf0e=this;return new Promise(function(_0x293e19,_0x593ec0){_0x1bfd64['verifySmtp'](_0x27056c['account'])[_0x4f89('0xb')](function(_0xb59c6f){_0x293e19({'code':0xc8,'message':'Verified'});})[_0x4f89('0x9')](function(_0x1106f9){_0x593ec0(_0x24bf0e[_0x4f89('0xa')](0x1f4,_0x1106f9));});});},'MailAccounts':function(_0x2e06ad){return new Promise(function(_0x350db9,_0x21ff06){var _0x29d6a4=_[_0x4f89('0xc')](_0x34ff01[_0x4f89('0xd')]);for(var _0x49c778=0x0;_0x49c778<_0x29d6a4[_0x4f89('0xe')];_0x49c778+=0x1){if(_0x29d6a4[_0x49c778][_0x4f89('0xf')]&&_0x29d6a4[_0x49c778][_0x4f89('0xf')][_0x4f89('0x10')]){delete _0x29d6a4[_0x49c778][_0x4f89('0xf')][_0x4f89('0x10')];}if(_0x29d6a4[_0x49c778][_0x4f89('0x11')]&&_0x29d6a4[_0x49c778]['Smtp'][_0x4f89('0x12')]){delete _0x29d6a4[_0x49c778]['Smtp']['pass'];}}_0x350db9({'count':_0x29d6a4[_0x4f89('0xe')],'rows':_0x29d6a4});});}};var _0x1b1937=jayson[_0x4f89('0x13')](_0x2f2d59)[_0x4f89('0x14')]();_0x1b1937['on']('error',function(_0x425d33){logger[_0x4f89('0xa')](JSON[_0x4f89('0x15')](_0x425d33));return _0x297f74(_0x425d33);});_0x1b1937[_0x4f89('0x5')](0x232b,_0x4f89('0x16'),function(){console[_0x4f89('0x17')](_0x4f89('0x18'),0x232b);return _0x2c2f5a(_0x4f89('0x19')+0x232b);});});};
\ No newline at end of file
+var _0x32b6=['127.0.0.1','log','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','../../../config/logger','email','sendMail','account','then','catch','verifySmtp','Verified','error','values','length','Imap','password','Smtp','server','stringify'];(function(_0x5d1da4,_0xc87905){var _0x419b24=function(_0x47fa91){while(--_0x47fa91){_0x5d1da4['push'](_0x5d1da4['shift']());}};_0x419b24(++_0xc87905);}(_0x32b6,0x1d1));var _0x632b=function(_0x4b4f1b,_0x281bf5){_0x4b4f1b=_0x4b4f1b-0x0;var _0x225592=_0x32b6[_0x4b4f1b];return _0x225592;};'use strict';var jayson=require(_0x632b('0x0'));var BPromise=require(_0x632b('0x1'));var _=require('lodash');var logger=require(_0x632b('0x2'))(_0x632b('0x3'));exports['listen']=function(_0x5ad871,_0x2e2173){return new BPromise(function(_0x3435e8,_0x3ba3a7){var _0x3a0e0e={'SendMail':function(_0x1adfe6){var _0x122768=this;return new Promise(function(_0x24ceab,_0x10458a){_0x2e2173[_0x632b('0x4')](_0x1adfe6[_0x632b('0x5')],_0x1adfe6['message'])[_0x632b('0x6')](function(_0x173270){_0x24ceab({'code':0xc8,'message':_0x173270});})[_0x632b('0x7')](function(_0x174201){_0x10458a(_0x122768['error'](0x1f4,_0x174201));});});},'VerifySmtp':function(_0x5904e8){var _0x56e7b6=this;return new Promise(function(_0x3ce569,_0x484b3a){_0x2e2173[_0x632b('0x8')](_0x5904e8[_0x632b('0x5')])[_0x632b('0x6')](function(_0x485440){_0x3ce569({'code':0xc8,'message':_0x632b('0x9')});})[_0x632b('0x7')](function(_0xe81378){_0x484b3a(_0x56e7b6[_0x632b('0xa')](0x1f4,_0xe81378));});});},'MailAccounts':function(_0x22c182){return new Promise(function(_0x536aa2,_0xb5416c){var _0x286f75=_[_0x632b('0xb')](_0x5ad871['mailAccounts']);for(var _0x721883=0x0;_0x721883<_0x286f75[_0x632b('0xc')];_0x721883+=0x1){if(_0x286f75[_0x721883][_0x632b('0xd')]&&_0x286f75[_0x721883][_0x632b('0xd')][_0x632b('0xe')]){delete _0x286f75[_0x721883][_0x632b('0xd')]['password'];}if(_0x286f75[_0x721883][_0x632b('0xf')]&&_0x286f75[_0x721883]['Smtp']['pass']){delete _0x286f75[_0x721883][_0x632b('0xf')]['pass'];}}_0x536aa2({'count':_0x286f75[_0x632b('0xc')],'rows':_0x286f75});});}};var _0x3bb27f=jayson[_0x632b('0x10')](_0x3a0e0e)['http']();_0x3bb27f['on'](_0x632b('0xa'),function(_0x32ca1){logger[_0x632b('0xa')](JSON[_0x632b('0x11')](_0x32ca1));return _0x3ba3a7(_0x32ca1);});_0x3bb27f['listen'](0x232b,_0x632b('0x12'),function(){console[_0x632b('0x13')]('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x3435e8(_0x632b('0x14')+0x232b);});});};
\ No newline at end of file
index 217fd93..f40750b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57d4=['redis','localhost','../../config/triggers','../../config/express','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57d4,0x78));var _0x457d=function(_0x3d2ea1,_0x1da465){_0x3d2ea1=_0x3d2ea1-0x0;var _0x45d788=_0x57d4[_0x3d2ea1];return _0x45d788;};'use strict';var _=require(_0x457d('0x0'));var http=require(_0x457d('0x1'));var express=require('express');var sticky=require(_0x457d('0x2'));var Redis=require(_0x457d('0x3'));var config=require(_0x457d('0x4'));var app=express();var server=http[_0x457d('0x5')](app);server[_0x457d('0x6')]=0xdbba0;if(sticky[_0x457d('0x7')](server,config[_0x457d('0x8')])){var socketio=require(_0x457d('0x9'))(server,{'transports':[_0x457d('0xa'),_0x457d('0xb')]});config[_0x457d('0xc')]=_['defaults'](config[_0x457d('0xc')],{'host':_0x457d('0xd'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x457d('0xc')]),'subClient':new Redis(config[_0x457d('0xc')])}));require(_0x457d('0xe'))['default']();require('../../config/socketio')['default'](socketio);require(_0x457d('0xf'))[_0x457d('0x10')](app);require(_0x457d('0x11'))[_0x457d('0x10')](app);}else{server[_0x457d('0x12')](_0x457d('0x13'),function(){console[_0x457d('0x14')](_0x457d('0x15'),config[_0x457d('0x8')]);});}exports=module['exports']=app;
\ No newline at end of file
+var _0x5c12=['exports','http','express','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','defaults','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x4ac6d5,_0x179c1e){var _0xed1213=function(_0x1d729a){while(--_0x1d729a){_0x4ac6d5['push'](_0x4ac6d5['shift']());}};_0xed1213(++_0x179c1e);}(_0x5c12,0x188));var _0x25c1=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x5c12[_0xce6f11];return _0x35b709;};'use strict';var _=require('lodash');var http=require(_0x25c1('0x0'));var express=require(_0x25c1('0x1'));var sticky=require('sticky-session');var Redis=require(_0x25c1('0x2'));var config=require(_0x25c1('0x3'));var app=express();var server=http[_0x25c1('0x4')](app);server[_0x25c1('0x5')]=0xdbba0;if(sticky[_0x25c1('0x6')](server,config[_0x25c1('0x7')])){var socketio=require(_0x25c1('0x8'))(server,{'transports':['websocket',_0x25c1('0x9')]});config[_0x25c1('0xa')]=_[_0x25c1('0xb')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x25c1('0xc')](require(_0x25c1('0xd'))({'pubClient':new Redis(config[_0x25c1('0xa')]),'subClient':new Redis(config[_0x25c1('0xa')])}));require(_0x25c1('0xe'))['default']();require(_0x25c1('0xf'))[_0x25c1('0x10')](socketio);require(_0x25c1('0x11'))[_0x25c1('0x10')](app);require(_0x25c1('0x12'))['default'](app);}else{server[_0x25c1('0x13')](_0x25c1('0x14'),function(){console['log'](_0x25c1('0x15'),config[_0x25c1('0x7')]);});}exports=module[_0x25c1('0x16')]=app;
\ No newline at end of file
index f1d23c1..8a3a778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f3c=['message','result','catch','jayson/promise','bluebird','http','Request','request','then','debug','rpc','error','routing'];(function(_0x5596ec,_0x4aa524){var _0x508a30=function(_0xdd9f3e){while(--_0xdd9f3e){_0x5596ec['push'](_0x5596ec['shift']());}};_0x508a30(++_0x4aa524);}(_0x0f3c,0x189));var _0xc0f3=function(_0x2b2ae4,_0x5ef1e2){_0x2b2ae4=_0x2b2ae4-0x0;var _0x2da549=_0x0f3c[_0x2b2ae4];return _0x2da549;};'use strict';var jayson=require(_0xc0f3('0x0'));var BPromise=require(_0xc0f3('0x1'));var logger=require('../../config/logger')('routing');var client=jayson['client'][_0xc0f3('0x2')]({'port':0x2329});client[_0xc0f3('0x3')]=function(_0xa6a874,_0x2d1f5d){return new BPromise(function(_0x1be43d,_0x279717){return client[_0xc0f3('0x4')](_0xa6a874,_0x2d1f5d)[_0xc0f3('0x5')](function(_0x4b76a0){logger[_0xc0f3('0x6')](_0xc0f3('0x7'),'routing',_0xa6a874,_0x2d1f5d,_0x4b76a0);if(_0x4b76a0[_0xc0f3('0x8')]){logger[_0xc0f3('0x8')]('rpc',_0xc0f3('0x9'),_0xa6a874,_0x4b76a0[_0xc0f3('0x8')][_0xc0f3('0xa')],_0x2d1f5d);return _0x279717(_0x4b76a0[_0xc0f3('0x8')][_0xc0f3('0xa')]);}else{return _0x1be43d(_0x4b76a0[_0xc0f3('0xb')]);}})[_0xc0f3('0xc')](function(_0x56ea36){logger[_0xc0f3('0x8')](_0xc0f3('0x7'),_0xc0f3('0x9'),_0xa6a874,_0x56ea36,_0x2d1f5d);return _0x279717(_0x56ea36);});});};module['exports']=client;
\ No newline at end of file
+var _0x872a=['message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','request','then','rpc','error'];(function(_0x591f9c,_0x4ed0ea){var _0x4f7153=function(_0x1b1f8e){while(--_0x1b1f8e){_0x591f9c['push'](_0x591f9c['shift']());}};_0x4f7153(++_0x4ed0ea);}(_0x872a,0x100));var _0xa872=function(_0x48ca43,_0x3c8a43){_0x48ca43=_0x48ca43-0x0;var _0x1e71f9=_0x872a[_0x48ca43];return _0x1e71f9;};'use strict';var jayson=require(_0xa872('0x0'));var BPromise=require(_0xa872('0x1'));var logger=require(_0xa872('0x2'))(_0xa872('0x3'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x15a8e0,_0x58715a){return new BPromise(function(_0x2854a7,_0x2b0489){return client[_0xa872('0x4')](_0x15a8e0,_0x58715a)[_0xa872('0x5')](function(_0x3e3cd4){logger['debug'](_0xa872('0x6'),_0xa872('0x3'),_0x15a8e0,_0x58715a,_0x3e3cd4);if(_0x3e3cd4[_0xa872('0x7')]){logger[_0xa872('0x7')](_0xa872('0x6'),_0xa872('0x3'),_0x15a8e0,_0x3e3cd4[_0xa872('0x7')][_0xa872('0x8')],_0x58715a);return _0x2b0489(_0x3e3cd4[_0xa872('0x7')][_0xa872('0x8')]);}else{return _0x2854a7(_0x3e3cd4[_0xa872('0x9')]);}})[_0xa872('0xa')](function(_0x986b05){logger[_0xa872('0x7')]('rpc',_0xa872('0x3'),_0x15a8e0,_0x986b05,_0x58715a);return _0x2b0489(_0x986b05);});});};module[_0xa872('0xb')]=client;
\ No newline at end of file
index 532ea29..75a3e5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2250=['getChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','listen','bluebird','./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues'];(function(_0x32a910,_0x453543){var _0x11139e=function(_0x173ed4){while(--_0x173ed4){_0x32a910['push'](_0x32a910['shift']());}};_0x11139e(++_0x453543);}(_0x2250,0x1a8));var _0x0225=function(_0x1a635e,_0x241651){_0x1a635e=_0x1a635e-0x0;var _0x5b3345=_0x2250[_0x1a635e];return _0x5b3345;};'use strict';var BPromise=require(_0x0225('0x0'));var server=require(_0x0225('0x1'));var Realtime=require(_0x0225('0x2'));var user=require(_0x0225('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x0225('0x4'));var chatQueue=require(_0x0225('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x0225('0x6'));var faxQueue=require(_0x0225('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x0225('0x8')](user[_0x0225('0x9')]())[_0x0225('0x8')](realtime['initAgents']())[_0x0225('0x8')](interval[_0x0225('0xa')]())['then'](realtime[_0x0225('0xb')]())['then'](openchannelQueue[_0x0225('0xc')]())[_0x0225('0x8')](realtime['initOpenchannelQueues']())[_0x0225('0x8')](chatQueue[_0x0225('0xd')]())[_0x0225('0x8')](realtime['initChatQueues']())[_0x0225('0x8')](smsQueue[_0x0225('0xe')]())['then'](realtime['initSmsQueues']())[_0x0225('0x8')](mailQueue[_0x0225('0xf')]())['then'](realtime[_0x0225('0x10')]())[_0x0225('0x8')](faxQueue['getFaxQueues']())[_0x0225('0x8')](realtime[_0x0225('0x11')]())[_0x0225('0x8')](function(){return realtime;});}function main(){return server[_0x0225('0x12')](realtime)['then'](function(_0x19d47a){return initRealtime();})['then'](function(_0x25a7da){return setInterval(initRealtime,0x1388);})['catch'](function(_0x507188){console['log'](_0x507188);});}main();
\ No newline at end of file
+var _0x0c79=['listen','catch','log','bluebird','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0c79,0x9f));var _0x90c7=function(_0x592076,_0x52ff23){_0x592076=_0x592076-0x0;var _0x5137df=_0x0c79[_0x592076];return _0x5137df;};'use strict';var BPromise=require(_0x90c7('0x0'));var server=require('./server');var Realtime=require('./realtime');var user=require(_0x90c7('0x1'));var interval=require(_0x90c7('0x2'));var openchannelQueue=require(_0x90c7('0x3'));var chatQueue=require(_0x90c7('0x4'));var smsQueue=require(_0x90c7('0x5'));var mailQueue=require(_0x90c7('0x6'));var faxQueue=require(_0x90c7('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x90c7('0x8')]()[_0x90c7('0x9')](user[_0x90c7('0xa')]())[_0x90c7('0x9')](realtime[_0x90c7('0xb')]())[_0x90c7('0x9')](interval[_0x90c7('0xc')]())[_0x90c7('0x9')](realtime[_0x90c7('0xd')]())[_0x90c7('0x9')](openchannelQueue[_0x90c7('0xe')]())[_0x90c7('0x9')](realtime[_0x90c7('0xf')]())['then'](chatQueue[_0x90c7('0x10')]())['then'](realtime[_0x90c7('0x11')]())[_0x90c7('0x9')](smsQueue[_0x90c7('0x12')]())['then'](realtime['initSmsQueues']())[_0x90c7('0x9')](mailQueue[_0x90c7('0x13')]())[_0x90c7('0x9')](realtime[_0x90c7('0x14')]())[_0x90c7('0x9')](faxQueue[_0x90c7('0x15')]())['then'](realtime[_0x90c7('0x16')]())['then'](function(){return realtime;});}function main(){return server[_0x90c7('0x17')](realtime)[_0x90c7('0x9')](function(_0x3cceac){return initRealtime();})[_0x90c7('0x9')](function(_0x18cf6e){return setInterval(initRealtime,0x1388);})[_0x90c7('0x18')](function(_0x3e86ec){console[_0x90c7('0x19')](_0x3e86ec);});}main();
\ No newline at end of file
index b23cd67..fb7071b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44e6=['activeRules','isArray','concat','isObject','push','sync','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call','next','isEqual','restart','condition','noop','findRules','filter','turn','length','prioritize','priority','map','toString','fromJSON','isString','parse','object','exports','lodash','events','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules'];(function(_0x43b8ce,_0x24a531){var _0xc69b1c=function(_0x19376c){while(--_0x19376c){_0x43b8ce['push'](_0x43b8ce['shift']());}};_0xc69b1c(++_0x24a531);}(_0x44e6,0x14e));var _0x644e=function(_0x4f49cd,_0x38a696){_0x4f49cd=_0x4f49cd-0x0;var _0x1cf72f=_0x44e6[_0x4f49cd];return _0x1cf72f;};'use strict';var _=require(_0x644e('0x0'));var util=require('util');var EventEmitter=require(_0x644e('0x1'))[_0x644e('0x2')];function RuleEngine(_0x4eac73,_0x774e8b){this[_0x644e('0x3')]();if(!_[_0x644e('0x4')](_0x4eac73)){this[_0x644e('0x5')](_0x4eac73);}if(_0x774e8b){this['ignoreFactChanges']=_0x774e8b[_0x644e('0x6')];}return this;}util[_0x644e('0x7')](RuleEngine,EventEmitter);RuleEngine[_0x644e('0x8')][_0x644e('0x3')]=function(_0x1b5a6b){this[_0x644e('0x9')]=[];this[_0x644e('0xa')]=[];};RuleEngine[_0x644e('0x8')][_0x644e('0x5')]=function(_0x5b5bd6){if(Array[_0x644e('0xb')](_0x5b5bd6)){this[_0x644e('0x9')]=this[_0x644e('0x9')][_0x644e('0xc')](_0x5b5bd6);}else if(_0x5b5bd6!==null&&_[_0x644e('0xd')](_0x5b5bd6)){this['rules'][_0x644e('0xe')](_0x5b5bd6);}this[_0x644e('0xf')]();};RuleEngine['prototype'][_0x644e('0xf')]=function(){this[_0x644e('0xa')]=this[_0x644e('0x9')]['filter'](function(_0x549dfb){if(_['isNil'](_0x549dfb['on'])){_0x549dfb['on']=!![];}if(_0x549dfb['on']===!![]){return _0x549dfb;}});this[_0x644e('0xa')]=_['orderBy'](this[_0x644e('0xa')],['p'],['asc']);};RuleEngine[_0x644e('0x8')][_0x644e('0x10')]=function(_0xd1ee43,_0x3b2881){var _0x141770=![];_0xd1ee43[_0x644e('0x11')]=!![];var _0xeec1e8=_[_0x644e('0x12')](_0xd1ee43);var _0x5e016a=_[_0x644e('0x12')](_0xd1ee43);var _0x20a7dd=this[_0x644e('0xa')];var _0x2b3702=[];var _0x3e1973=this[_0x644e('0x6')];(function FnRuleLoop(_0x25de7a){var _0x139552={'rules':function(){return _0x20a7dd;},'rule':function(){return _0x20a7dd[_0x25de7a];},'when':function(_0x8889a){if(_0x8889a){var _0x7837a0=_0x20a7dd[_0x25de7a][_0x644e('0x13')];_0x7837a0[_0x644e('0x14')]=_0x20a7dd[_0x25de7a]['id']||_0x20a7dd[_0x25de7a][_0x644e('0x15')]||_0x644e('0x16')+_0x25de7a;process[_0x644e('0x17')](function(){_0x2b3702[_0x644e('0xe')](_0x7837a0[_0x644e('0x14')]);_0x7837a0[_0x644e('0x18')](_0xeec1e8,_0x139552);});}else{process[_0x644e('0x17')](function(){_0x139552[_0x644e('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x141770=!![];return FnRuleLoop(0x0);},'next':function(_0x113725){if(!_0x3e1973&&!_[_0x644e('0x1a')](_0x5e016a,_0xeec1e8)){_0x5e016a=_[_0x644e('0x12')](_0xeec1e8);process[_0x644e('0x17')](function(){_0x139552[_0x644e('0x1b')]();});}else{process[_0x644e('0x17')](function(){if(_[_0x644e('0x4')](_0x113725)){return FnRuleLoop(_0x25de7a+0x1);}else{return FnRuleLoop(_0x113725);}});}}};if(_0x25de7a<_0x20a7dd['length']&&_0x141770===![]){var _0x54c8e5=_0x20a7dd[_0x25de7a][_0x644e('0x1c')];_0x54c8e5[_0x644e('0x18')](_0xeec1e8,_0x139552);}else{process['nextTick'](function(){_0xeec1e8['matchPath']=_0x2b3702;return _0x3b2881?_0x3b2881(_0xeec1e8):_[_0x644e('0x1d')]();});}}(0x0));};RuleEngine[_0x644e('0x8')][_0x644e('0x1e')]=function(_0x1922ad){if(_[_0x644e('0x4')](_0x1922ad)){return this[_0x644e('0x9')];}else{var _0x19ebd6=_['matches'](_0x1922ad);return _[_0x644e('0x1f')](this[_0x644e('0x9')],_0x19ebd6);}};RuleEngine['prototype'][_0x644e('0x20')]=function(_0xb4fc33,_0x2a0954){var _0xb4fc33=_0xb4fc33==='on'||_0xb4fc33==='ON'?!![]:![];var _0x6b117e=this['findRules'](_0x2a0954);for(var _0x157b09=0x0,_0x58c10f=_0x6b117e[_0x644e('0x21')];_0x157b09<_0x58c10f;_0x157b09+=0x1){_0x6b117e[_0x157b09]['on']=_0xb4fc33;}this['sync']();};RuleEngine[_0x644e('0x8')][_0x644e('0x22')]=function(_0x48dbe3,_0x362581){_0x48dbe3=parseInt(_0x48dbe3,0xa);var _0x451d51=this['findRules'](_0x362581);for(var _0x80218d=0x0,_0x4ad838=_0x451d51['length'];_0x80218d<_0x4ad838;_0x80218d+=0x1){_0x451d51[_0x80218d][_0x644e('0x23')]=_0x48dbe3;}this[_0x644e('0xf')]();};RuleEngine['prototype']['toJSON']=function(){var _0x2f5dba=this[_0x644e('0x9')];if(_0x2f5dba instanceof Array){_0x2f5dba=_0x2f5dba[_0x644e('0x24')](function(_0x2eadcc){_0x2eadcc[_0x644e('0x1c')]=_0x2eadcc['condition'][_0x644e('0x25')]();_0x2eadcc['consequence']=_0x2eadcc[_0x644e('0x13')][_0x644e('0x25')]();return _0x2eadcc;});}else if(!_[_0x644e('0x4')](_0x2f5dba)){_0x2f5dba[_0x644e('0x1c')]=_0x2f5dba[_0x644e('0x1c')]['toString']();_0x2f5dba['consequence']=_0x2f5dba[_0x644e('0x13')]['toString']();}return _0x2f5dba;};RuleEngine[_0x644e('0x8')][_0x644e('0x26')]=function(_0x5ce127){this['init']();if(_[_0x644e('0x27')](_0x5ce127)){_0x5ce127=JSON[_0x644e('0x28')](_0x5ce127);}if(_0x5ce127 instanceof Array){_0x5ce127=_0x5ce127['map'](function(_0x1b64fb){_0x1b64fb[_0x644e('0x1c')]=eval('('+_0x1b64fb['condition']+')');_0x1b64fb[_0x644e('0x13')]=eval('('+_0x1b64fb[_0x644e('0x13')]+')');return _0x1b64fb;});}else if(_0x5ce127!==null&&typeof _0x5ce127==_0x644e('0x29')){_0x5ce127[_0x644e('0x1c')]=eval('('+_0x5ce127[_0x644e('0x1c')]+')');_0x5ce127[_0x644e('0x13')]=eval('('+_0x5ce127[_0x644e('0x13')]+')');}this[_0x644e('0x5')](_0x5ce127);};module[_0x644e('0x2a')]=RuleEngine;
\ No newline at end of file
+var _0x4537=['noop','matches','filter','turn','findRules','length','prioritize','priority','toJSON','condition','toString','isString','object','lodash','util','events','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','isObject','push','sync','orderBy','asc','execute','clone','consequence','ruleRef','nextTick','call','next','isEqual'];(function(_0x216952,_0x4624eb){var _0x33c05a=function(_0xba68df){while(--_0xba68df){_0x216952['push'](_0x216952['shift']());}};_0x33c05a(++_0x4624eb);}(_0x4537,0xad));var _0x7453=function(_0x4abea3,_0x1e257f){_0x4abea3=_0x4abea3-0x0;var _0x277e02=_0x4537[_0x4abea3];return _0x277e02;};'use strict';var _=require(_0x7453('0x0'));var util=require(_0x7453('0x1'));var EventEmitter=require(_0x7453('0x2'))[_0x7453('0x3')];function RuleEngine(_0x1caf96,_0x3b335e){this[_0x7453('0x4')]();if(!_[_0x7453('0x5')](_0x1caf96)){this[_0x7453('0x6')](_0x1caf96);}if(_0x3b335e){this[_0x7453('0x7')]=_0x3b335e[_0x7453('0x7')];}return this;}util[_0x7453('0x8')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x7453('0x4')]=function(_0x841e53){this[_0x7453('0x9')]=[];this[_0x7453('0xa')]=[];};RuleEngine[_0x7453('0xb')][_0x7453('0x6')]=function(_0x4757df){if(Array[_0x7453('0xc')](_0x4757df)){this['rules']=this['rules'][_0x7453('0xd')](_0x4757df);}else if(_0x4757df!==null&&_[_0x7453('0xe')](_0x4757df)){this[_0x7453('0x9')][_0x7453('0xf')](_0x4757df);}this[_0x7453('0x10')]();};RuleEngine[_0x7453('0xb')][_0x7453('0x10')]=function(){this['activeRules']=this[_0x7453('0x9')]['filter'](function(_0x591787){if(_['isNil'](_0x591787['on'])){_0x591787['on']=!![];}if(_0x591787['on']===!![]){return _0x591787;}});this[_0x7453('0xa')]=_[_0x7453('0x11')](this['activeRules'],['p'],[_0x7453('0x12')]);};RuleEngine[_0x7453('0xb')][_0x7453('0x13')]=function(_0x490309,_0x45d0aa){var _0x5c13c2=![];_0x490309['result']=!![];var _0x2416a2=_[_0x7453('0x14')](_0x490309);var _0x1fa3b4=_[_0x7453('0x14')](_0x490309);var _0x36ac0e=this[_0x7453('0xa')];var _0x5c3f76=[];var _0x4d43d8=this[_0x7453('0x7')];(function FnRuleLoop(_0x3d679a){var _0x1e14ae={'rules':function(){return _0x36ac0e;},'rule':function(){return _0x36ac0e[_0x3d679a];},'when':function(_0x482c67){if(_0x482c67){var _0x4f30d1=_0x36ac0e[_0x3d679a][_0x7453('0x15')];_0x4f30d1[_0x7453('0x16')]=_0x36ac0e[_0x3d679a]['id']||_0x36ac0e[_0x3d679a]['name']||'index_'+_0x3d679a;process[_0x7453('0x17')](function(){_0x5c3f76[_0x7453('0xf')](_0x4f30d1[_0x7453('0x16')]);_0x4f30d1[_0x7453('0x18')](_0x2416a2,_0x1e14ae);});}else{process[_0x7453('0x17')](function(){_0x1e14ae[_0x7453('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5c13c2=!![];return FnRuleLoop(0x0);},'next':function(_0xed02c8){if(!_0x4d43d8&&!_[_0x7453('0x1a')](_0x1fa3b4,_0x2416a2)){_0x1fa3b4=_[_0x7453('0x14')](_0x2416a2);process['nextTick'](function(){_0x1e14ae['restart']();});}else{process[_0x7453('0x17')](function(){if(_[_0x7453('0x5')](_0xed02c8)){return FnRuleLoop(_0x3d679a+0x1);}else{return FnRuleLoop(_0xed02c8);}});}}};if(_0x3d679a<_0x36ac0e['length']&&_0x5c13c2===![]){var _0x3a65fa=_0x36ac0e[_0x3d679a]['condition'];_0x3a65fa[_0x7453('0x18')](_0x2416a2,_0x1e14ae);}else{process['nextTick'](function(){_0x2416a2['matchPath']=_0x5c3f76;return _0x45d0aa?_0x45d0aa(_0x2416a2):_[_0x7453('0x1b')]();});}}(0x0));};RuleEngine[_0x7453('0xb')]['findRules']=function(_0x48bd65){if(_['isNil'](_0x48bd65)){return this[_0x7453('0x9')];}else{var _0x1e3494=_[_0x7453('0x1c')](_0x48bd65);return _[_0x7453('0x1d')](this['rules'],_0x1e3494);}};RuleEngine[_0x7453('0xb')][_0x7453('0x1e')]=function(_0x48a43b,_0x289436){var _0x48a43b=_0x48a43b==='on'||_0x48a43b==='ON'?!![]:![];var _0x55bd5e=this[_0x7453('0x1f')](_0x289436);for(var _0x5a95fd=0x0,_0xdcc02a=_0x55bd5e[_0x7453('0x20')];_0x5a95fd<_0xdcc02a;_0x5a95fd+=0x1){_0x55bd5e[_0x5a95fd]['on']=_0x48a43b;}this[_0x7453('0x10')]();};RuleEngine[_0x7453('0xb')][_0x7453('0x21')]=function(_0x29cc54,_0x53f94f){_0x29cc54=parseInt(_0x29cc54,0xa);var _0x376863=this[_0x7453('0x1f')](_0x53f94f);for(var _0x2b9ce8=0x0,_0x3ab272=_0x376863[_0x7453('0x20')];_0x2b9ce8<_0x3ab272;_0x2b9ce8+=0x1){_0x376863[_0x2b9ce8][_0x7453('0x22')]=_0x29cc54;}this[_0x7453('0x10')]();};RuleEngine[_0x7453('0xb')][_0x7453('0x23')]=function(){var _0xca0f3b=this[_0x7453('0x9')];if(_0xca0f3b instanceof Array){_0xca0f3b=_0xca0f3b['map'](function(_0x16ff5b){_0x16ff5b[_0x7453('0x24')]=_0x16ff5b[_0x7453('0x24')]['toString']();_0x16ff5b[_0x7453('0x15')]=_0x16ff5b[_0x7453('0x15')]['toString']();return _0x16ff5b;});}else if(!_['isNil'](_0xca0f3b)){_0xca0f3b[_0x7453('0x24')]=_0xca0f3b['condition']['toString']();_0xca0f3b[_0x7453('0x15')]=_0xca0f3b[_0x7453('0x15')][_0x7453('0x25')]();}return _0xca0f3b;};RuleEngine[_0x7453('0xb')]['fromJSON']=function(_0x1ae4c5){this[_0x7453('0x4')]();if(_[_0x7453('0x26')](_0x1ae4c5)){_0x1ae4c5=JSON['parse'](_0x1ae4c5);}if(_0x1ae4c5 instanceof Array){_0x1ae4c5=_0x1ae4c5['map'](function(_0x3b16d2){_0x3b16d2[_0x7453('0x24')]=eval('('+_0x3b16d2[_0x7453('0x24')]+')');_0x3b16d2[_0x7453('0x15')]=eval('('+_0x3b16d2[_0x7453('0x15')]+')');return _0x3b16d2;});}else if(_0x1ae4c5!==null&&typeof _0x1ae4c5==_0x7453('0x27')){_0x1ae4c5[_0x7453('0x24')]=eval('('+_0x1ae4c5[_0x7453('0x24')]+')');_0x1ae4c5[_0x7453('0x15')]=eval('('+_0x1ae4c5['consequence']+')');}this[_0x7453('0x6')](_0x1ae4c5);};module['exports']=RuleEngine;
\ No newline at end of file
index 337bbd8..d178b51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x156136,_0x52575b){var _0x159e93=function(_0x1a3a78){while(--_0x1a3a78){_0x156136['push'](_0x156136['shift']());}};_0x159e93(++_0x52575b);}(_0x34e8,0x12c));var _0x834e=function(_0x19bf44,_0x1e1ca0){_0x19bf44=_0x19bf44-0x0;var _0x9e04df=_0x34e8[_0x19bf44];return _0x9e04df;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});};
\ No newline at end of file
+var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x2033b1,_0x336f54){var _0x370757=function(_0x3dc65b){while(--_0x3dc65b){_0x2033b1['push'](_0x2033b1['shift']());}};_0x370757(++_0x336f54);}(_0x34e8,0x12c));var _0x834e=function(_0x501e2e,_0x5b7234){_0x501e2e=_0x501e2e-0x0;var _0x1f8ccd=_0x34e8[_0x501e2e];return _0x1f8ccd;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});};
\ No newline at end of file
index 8c703ee..24ad097 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d7f=['mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','chat','fax','length','Status','StatusTime','toNumber','format','smsStatus','smsCapacity','smsCurrentCapacity','busyQueue','stringify','emit','exports','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity'];(function(_0x129fee,_0x683226){var _0x36af3f=function(_0x912b45){while(--_0x912b45){_0x129fee['push'](_0x129fee['shift']());}};_0x36af3f(++_0x683226);}(_0x7d7f,0x169));var _0xf7d7=function(_0x432dc3,_0x2c6d66){_0x432dc3=_0x432dc3-0x0;var _0x391401=_0x7d7f[_0x432dc3];return _0x391401;};'use strict';var _=require(_0xf7d7('0x0'));var moment=require(_0xf7d7('0x1'));var md5=require(_0xf7d7('0x2'));var Redis=require('ioredis');var config=require(_0xf7d7('0x3'));config[_0xf7d7('0x4')]=_[_0xf7d7('0x5')](config[_0xf7d7('0x4')],{'host':_0xf7d7('0x6'),'port':0x18eb});var io=require(_0xf7d7('0x7'))(new Redis(config[_0xf7d7('0x4')]));function Agent(_0x1dd782){this['id']=_0x1dd782['id']||0x0;this[_0xf7d7('0x8')]=_0x1dd782[_0xf7d7('0x8')]||'';this['online']=_0x1dd782[_0xf7d7('0x9')]||!![];this[_0xf7d7('0xa')]=_0x1dd782[_0xf7d7('0xa')]||![];this['chatPause']=_0x1dd782[_0xf7d7('0xb')]||![];this[_0xf7d7('0xc')]=_0x1dd782[_0xf7d7('0xc')]||![];this[_0xf7d7('0xd')]=_0x1dd782[_0xf7d7('0xd')]||![];this[_0xf7d7('0xe')]=_0x1dd782['smsPause']||![];this[_0xf7d7('0xf')]=_0x1dd782['openchannelPause']||![];this[_0xf7d7('0x10')]='unknown';this[_0xf7d7('0x11')]=0x0;this[_0xf7d7('0x12')]=_0x1dd782[_0xf7d7('0x12')]||0x0;this[_0xf7d7('0x13')]=0x0;this[_0xf7d7('0x14')]=_0xf7d7('0x15');this[_0xf7d7('0x16')]=0x0;this['mailCapacity']=_0x1dd782[_0xf7d7('0x17')]||0x0;this[_0xf7d7('0x18')]=0x0;this['faxStatus']='unknown';this[_0xf7d7('0x19')]=0x0;this[_0xf7d7('0x1a')]=_0x1dd782['faxCapacity']||0x0;this[_0xf7d7('0x1b')]=0x0;this['smsStatus']=_0xf7d7('0x15');this[_0xf7d7('0x1c')]=0x0;this['smsCapacity']=_0x1dd782['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xf7d7('0x1d')]=_0xf7d7('0x15');this[_0xf7d7('0x1e')]=0x0;this[_0xf7d7('0x1f')]=_0x1dd782[_0xf7d7('0x1f')]||0x0;this[_0xf7d7('0x20')]=0x0;this[_0xf7d7('0x21')]=![];this['busyQueue']=undefined;this[_0xf7d7('0x2')]='';this[_0xf7d7('0x22')]();}Agent[_0xf7d7('0x23')][_0xf7d7('0x24')]=function(_0x40c965){if(this[_0x40c965+'CurrentCapacity']>0x0){if(this[_0x40c965+_0xf7d7('0x25')]>0x0&&this[_0x40c965+_0xf7d7('0x26')]>=this[_0x40c965+_0xf7d7('0x25')]){return _0xf7d7('0x27');}else{return _0xf7d7('0x28');}}else{return'idle';}};Agent[_0xf7d7('0x23')][_0xf7d7('0x22')]=function(){var _0x46a545=['mail',_0xf7d7('0x29'),'openchannel',_0xf7d7('0x2a'),'sms'];for(var _0x4040d6=0x0;_0x4040d6<_0x46a545[_0xf7d7('0x2b')];_0x4040d6+=0x1){var _0x5bda5b=this[_0xf7d7('0x24')](_0x46a545[_0x4040d6]);if(this[_0x46a545[_0x4040d6]+_0xf7d7('0x2c')]!==_0x5bda5b){this[_0x46a545[_0x4040d6]+_0xf7d7('0x2d')]=_[_0xf7d7('0x2e')](moment()[_0xf7d7('0x2f')]('x'));}this[_0x46a545[_0x4040d6]+'Status']=_0x5bda5b;}var _0x252fee={'id':this['id'],'name':this[_0xf7d7('0x8')],'online':this['online'],'voicePause':this[_0xf7d7('0xa')],'chatPause':this[_0xf7d7('0xb')],'mailPause':this[_0xf7d7('0xc')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xf7d7('0xf')],'chatStatus':this[_0xf7d7('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xf7d7('0x12')],'chatCurrentCapacity':this[_0xf7d7('0x13')],'mailStatus':this[_0xf7d7('0x14')],'mailStatusTime':this[_0xf7d7('0x16')],'mailCapacity':this[_0xf7d7('0x17')],'mailCurrentCapacity':this[_0xf7d7('0x18')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf7d7('0x19')],'faxCapacity':this[_0xf7d7('0x1a')],'faxCurrentCapacity':this[_0xf7d7('0x1b')],'smsStatus':this[_0xf7d7('0x30')],'smsStatusTime':this[_0xf7d7('0x1c')],'smsCapacity':this[_0xf7d7('0x31')],'smsCurrentCapacity':this[_0xf7d7('0x32')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xf7d7('0x1e')],'openchannelCapacity':this[_0xf7d7('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xf7d7('0x21')],'busyQueue':this[_0xf7d7('0x33')]};var _0x2536a3=md5(JSON[_0xf7d7('0x34')](_0x252fee));if(this[_0xf7d7('0x2')]!==_0x2536a3){this[_0xf7d7('0x2')]=_0x2536a3;io[_0xf7d7('0x35')]('user:save',_0x252fee);}};module[_0xf7d7('0x36')]=Agent;
\ No newline at end of file
+var _0xb6a6=['openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','idle','updateRealtime','mail','chat','fax','length','Status','StatusTime','toNumber','format','faxPause','stringify','emit','user:save','exports','lodash','moment','md5','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity'];(function(_0x1a1d86,_0x2edf7e){var _0x4faaff=function(_0x418103){while(--_0x418103){_0x1a1d86['push'](_0x1a1d86['shift']());}};_0x4faaff(++_0x2edf7e);}(_0xb6a6,0x1be));var _0x6b6a=function(_0x7b10c0,_0x226a8b){_0x7b10c0=_0x7b10c0-0x0;var _0x102263=_0xb6a6[_0x7b10c0];return _0x102263;};'use strict';var _=require(_0x6b6a('0x0'));var moment=require(_0x6b6a('0x1'));var md5=require(_0x6b6a('0x2'));var Redis=require('ioredis');var config=require(_0x6b6a('0x3'));config['redis']=_['defaults'](config[_0x6b6a('0x4')],{'host':_0x6b6a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x284762){this['id']=_0x284762['id']||0x0;this[_0x6b6a('0x6')]=_0x284762['name']||'';this[_0x6b6a('0x7')]=_0x284762[_0x6b6a('0x7')]||!![];this[_0x6b6a('0x8')]=_0x284762['voicePause']||![];this[_0x6b6a('0x9')]=_0x284762[_0x6b6a('0x9')]||![];this['mailPause']=_0x284762[_0x6b6a('0xa')]||![];this['faxPause']=_0x284762['faxPause']||![];this[_0x6b6a('0xb')]=_0x284762[_0x6b6a('0xb')]||![];this['openchannelPause']=_0x284762[_0x6b6a('0xc')]||![];this[_0x6b6a('0xd')]=_0x6b6a('0xe');this[_0x6b6a('0xf')]=0x0;this[_0x6b6a('0x10')]=_0x284762[_0x6b6a('0x10')]||0x0;this[_0x6b6a('0x11')]=0x0;this[_0x6b6a('0x12')]=_0x6b6a('0xe');this[_0x6b6a('0x13')]=0x0;this[_0x6b6a('0x14')]=_0x284762[_0x6b6a('0x14')]||0x0;this[_0x6b6a('0x15')]=0x0;this[_0x6b6a('0x16')]=_0x6b6a('0xe');this[_0x6b6a('0x17')]=0x0;this['faxCapacity']=_0x284762[_0x6b6a('0x18')]||0x0;this[_0x6b6a('0x19')]=0x0;this['smsStatus']=_0x6b6a('0xe');this['smsStatusTime']=0x0;this[_0x6b6a('0x1a')]=_0x284762[_0x6b6a('0x1a')]||0x0;this[_0x6b6a('0x1b')]=0x0;this[_0x6b6a('0x1c')]=_0x6b6a('0xe');this[_0x6b6a('0x1d')]=0x0;this[_0x6b6a('0x1e')]=_0x284762[_0x6b6a('0x1e')]||0x0;this[_0x6b6a('0x1f')]=0x0;this[_0x6b6a('0x20')]=![];this[_0x6b6a('0x21')]=undefined;this['md5']='';this['updateRealtime']();}Agent[_0x6b6a('0x22')][_0x6b6a('0x23')]=function(_0x4375e1){if(this[_0x4375e1+_0x6b6a('0x24')]>0x0){if(this[_0x4375e1+'Capacity']>0x0&&this[_0x4375e1+_0x6b6a('0x24')]>=this[_0x4375e1+_0x6b6a('0x25')]){return'maxcapacity';}else{return'working';}}else{return _0x6b6a('0x26');}};Agent[_0x6b6a('0x22')][_0x6b6a('0x27')]=function(){var _0x59fa80=[_0x6b6a('0x28'),_0x6b6a('0x29'),'openchannel',_0x6b6a('0x2a'),'sms'];for(var _0x97267f=0x0;_0x97267f<_0x59fa80[_0x6b6a('0x2b')];_0x97267f+=0x1){var _0x5cd7d3=this[_0x6b6a('0x23')](_0x59fa80[_0x97267f]);if(this[_0x59fa80[_0x97267f]+_0x6b6a('0x2c')]!==_0x5cd7d3){this[_0x59fa80[_0x97267f]+_0x6b6a('0x2d')]=_[_0x6b6a('0x2e')](moment()[_0x6b6a('0x2f')]('x'));}this[_0x59fa80[_0x97267f]+_0x6b6a('0x2c')]=_0x5cd7d3;}var _0x4b7a55={'id':this['id'],'name':this[_0x6b6a('0x6')],'online':this['online'],'voicePause':this[_0x6b6a('0x8')],'chatPause':this[_0x6b6a('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x6b6a('0xb')],'faxPause':this[_0x6b6a('0x30')],'openchannelPause':this[_0x6b6a('0xc')],'chatStatus':this[_0x6b6a('0xd')],'chatStatusTime':this[_0x6b6a('0xf')],'chatCapacity':this[_0x6b6a('0x10')],'chatCurrentCapacity':this[_0x6b6a('0x11')],'mailStatus':this[_0x6b6a('0x12')],'mailStatusTime':this[_0x6b6a('0x13')],'mailCapacity':this[_0x6b6a('0x14')],'mailCurrentCapacity':this[_0x6b6a('0x15')],'faxStatus':this[_0x6b6a('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x6b6a('0x18')],'faxCurrentCapacity':this[_0x6b6a('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x6b6a('0x1a')],'smsCurrentCapacity':this[_0x6b6a('0x1b')],'openchannelStatus':this[_0x6b6a('0x1c')],'openchannelStatusTime':this[_0x6b6a('0x1d')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x6b6a('0x1f')],'busy':this[_0x6b6a('0x20')],'busyQueue':this[_0x6b6a('0x21')]};var _0x16a7b4=md5(JSON[_0x6b6a('0x31')](_0x4b7a55));if(this['md5']!==_0x16a7b4){this[_0x6b6a('0x2')]=_0x16a7b4;io[_0x6b6a('0x32')](_0x6b6a('0x33'),_0x4b7a55);}};module[_0x6b6a('0x34')]=Agent;
\ No newline at end of file
index 2335731..8900f4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf59e=['beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','format','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0xf59e,0x1d4));var _0xef59=function(_0x29ef89,_0x49d945){_0x29ef89=_0x29ef89-0x0;var _0x2e5633=_0xf59e[_0x29ef89];return _0x2e5633;};'use strict';var _=require(_0xef59('0x0'));var md5=require(_0xef59('0x1'));var util=require(_0xef59('0x2'));var Redis=require(_0xef59('0x3'));var config=require(_0xef59('0x4'));config[_0xef59('0x5')]=_[_0xef59('0x6')](config[_0xef59('0x5')],{'host':_0xef59('0x7'),'port':0x18eb});var io=require(_0xef59('0x8'))(new Redis(config[_0xef59('0x5')]));function ChatQueue(_0x41dd5f){this['id']=_0x41dd5f['id']||0x0;this[_0xef59('0x9')]=_0x41dd5f[_0xef59('0x9')]||'';this[_0xef59('0xa')]=_0x41dd5f[_0xef59('0xa')]||0xa;this[_0xef59('0xb')]=_0x41dd5f[_0xef59('0xb')]||_0xef59('0xc');this[_0xef59('0xd')]=_0x41dd5f[_0xef59('0xd')];this[_0xef59('0xe')]={};this['waiting']=0x0;this[_0xef59('0x1')]='';this[_0xef59('0xf')]();this[_0xef59('0x10')]();}ChatQueue[_0xef59('0x11')][_0xef59('0xf')]=function(){var _0x19a1a9=this[_0xef59('0xe')][_0xef59('0x12')];this[_0xef59('0xe')]=_[_0xef59('0x13')](this[_0xef59('0xd')],'id');this['mapAgentsId'][_0xef59('0x12')]=_0x19a1a9;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xef59('0x14')]=0x0;this[_0xef59('0x15')]=0x0;for(var _0x2b3bf8=0x0;_0x2b3bf8<this[_0xef59('0xd')][_0xef59('0x16')];_0x2b3bf8+=0x1){if(this[_0xef59('0xd')][_0x2b3bf8][_0xef59('0x17')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x2b3bf8][_0xef59('0x18')]){this[_0xef59('0x15')]+=0x1;}}this[_0xef59('0x19')]=this[_0xef59('0x14')]-this['paused'];this[_0xef59('0x19')]=this['available']>=0x0?this['available']:0x0;var _0x19a7fa={'id':this['id'],'available':this[_0xef59('0x19')],'loggedIn':this[_0xef59('0x14')],'name':this[_0xef59('0x9')],'paused':this[_0xef59('0x15')],'waiting':this['waiting']};var _0x3e7f25=md5(JSON[_0xef59('0x1a')](_0x19a7fa));if(this['md5']!==_0x3e7f25){this['md5']=_0x3e7f25;io['to'](util[_0xef59('0x1b')]('chat:queue:%s',_0x19a7fa[_0xef59('0x9')]))['emit'](_0xef59('0x1c'),_0x19a7fa);}};module[_0xef59('0x1d')]=ChatQueue;
\ No newline at end of file
+var _0x5533=['exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','paused','length','online','chatPause','available','loggedIn','waiting','stringify','format','chat:queue:%s','emit'];(function(_0x4a8808,_0x551c25){var _0x3a56c6=function(_0x4a58c7){while(--_0x4a58c7){_0x4a8808['push'](_0x4a8808['shift']());}};_0x3a56c6(++_0x551c25);}(_0x5533,0x1b4));var _0x3553=function(_0x336f5e,_0x193c5f){_0x336f5e=_0x336f5e-0x0;var _0x2f8155=_0x5533[_0x336f5e];return _0x2f8155;};'use strict';var _=require(_0x3553('0x0'));var md5=require(_0x3553('0x1'));var util=require(_0x3553('0x2'));var Redis=require(_0x3553('0x3'));var config=require(_0x3553('0x4'));config[_0x3553('0x5')]=_['defaults'](config['redis'],{'host':_0x3553('0x6'),'port':0x18eb});var io=require(_0x3553('0x7'))(new Redis(config[_0x3553('0x5')]));function ChatQueue(_0x29aee1){this['id']=_0x29aee1['id']||0x0;this[_0x3553('0x8')]=_0x29aee1[_0x3553('0x8')]||'';this[_0x3553('0x9')]=_0x29aee1['timeout']||0xa;this['strategy']=_0x29aee1[_0x3553('0xa')]||'beepall';this['Agents']=_0x29aee1[_0x3553('0xb')];this[_0x3553('0xc')]={};this['waiting']=0x0;this[_0x3553('0x1')]='';this[_0x3553('0xd')]();this[_0x3553('0xe')]();}ChatQueue[_0x3553('0xf')][_0x3553('0xd')]=function(){var _0x52ca8e=this[_0x3553('0xc')][_0x3553('0x10')];this[_0x3553('0xc')]=_['map'](this[_0x3553('0xb')],'id');this[_0x3553('0xc')]['_rr']=_0x52ca8e;};ChatQueue[_0x3553('0xf')][_0x3553('0xe')]=function(){this['loggedIn']=0x0;this[_0x3553('0x11')]=0x0;for(var _0x19bdf7=0x0;_0x19bdf7<this[_0x3553('0xb')][_0x3553('0x12')];_0x19bdf7+=0x1){if(this['Agents'][_0x19bdf7][_0x3553('0x13')]){this['loggedIn']+=0x1;}if(this[_0x3553('0xb')][_0x19bdf7][_0x3553('0x14')]){this['paused']+=0x1;}}this['available']=this['loggedIn']-this[_0x3553('0x11')];this[_0x3553('0x15')]=this[_0x3553('0x15')]>=0x0?this[_0x3553('0x15')]:0x0;var _0x4ce95f={'id':this['id'],'available':this[_0x3553('0x15')],'loggedIn':this[_0x3553('0x16')],'name':this[_0x3553('0x8')],'paused':this[_0x3553('0x11')],'waiting':this[_0x3553('0x17')]};var _0x3751bb=md5(JSON[_0x3553('0x18')](_0x4ce95f));if(this['md5']!==_0x3751bb){this[_0x3553('0x1')]=_0x3751bb;io['to'](util[_0x3553('0x19')](_0x3553('0x1a'),_0x4ce95f[_0x3553('0x8')]))[_0x3553('0x1b')]('chat_queue:save',_0x4ce95f);}};module[_0x3553('0x1c')]=ChatQueue;
\ No newline at end of file
index ed8577b..8c3fcdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcd8=['fax:queue:%s','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','faxPause','available','loggedIn','stringify'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xdcd8,0xab));var _0x8dcd=function(_0x540687,_0x1f5277){_0x540687=_0x540687-0x0;var _0x53e71a=_0xdcd8[_0x540687];return _0x53e71a;};'use strict';var _=require(_0x8dcd('0x0'));var md5=require(_0x8dcd('0x1'));var util=require(_0x8dcd('0x2'));var Redis=require('ioredis');var config=require(_0x8dcd('0x3'));config[_0x8dcd('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8dcd('0x5'))(new Redis(config['redis']));function FaxQueue(_0x15cb24){this['id']=_0x15cb24['id']||0x0;this[_0x8dcd('0x6')]=_0x15cb24[_0x8dcd('0x6')]||'';this[_0x8dcd('0x7')]=_0x15cb24[_0x8dcd('0x7')]||0xa;this[_0x8dcd('0x8')]=_0x15cb24[_0x8dcd('0x8')]||_0x8dcd('0x9');this[_0x8dcd('0xa')]=_0x15cb24[_0x8dcd('0xa')];this[_0x8dcd('0xb')]={};this[_0x8dcd('0xc')]=0x0;this[_0x8dcd('0x1')]='';this[_0x8dcd('0xd')]();this[_0x8dcd('0xe')]();}FaxQueue[_0x8dcd('0xf')][_0x8dcd('0xd')]=function(){var _0xb3b6b3=this[_0x8dcd('0xb')][_0x8dcd('0x10')];this[_0x8dcd('0xb')]=_[_0x8dcd('0x11')](this[_0x8dcd('0xa')],'id');this[_0x8dcd('0xb')][_0x8dcd('0x10')]=_0xb3b6b3;};FaxQueue['prototype'][_0x8dcd('0xe')]=function(){this['loggedIn']=0x0;this[_0x8dcd('0x12')]=0x0;for(var _0x51e16a=0x0;_0x51e16a<this['Agents'][_0x8dcd('0x13')];_0x51e16a+=0x1){if(this['Agents'][_0x51e16a][_0x8dcd('0x14')]){this['loggedIn']+=0x1;}if(this[_0x8dcd('0xa')][_0x51e16a][_0x8dcd('0x15')]){this['paused']+=0x1;}}this[_0x8dcd('0x16')]=this[_0x8dcd('0x17')]-this[_0x8dcd('0x12')];this[_0x8dcd('0x16')]=this[_0x8dcd('0x16')]>=0x0?this['available']:0x0;var _0x25782f={'id':this['id'],'available':this[_0x8dcd('0x16')],'loggedIn':this[_0x8dcd('0x17')],'name':this['name'],'paused':this[_0x8dcd('0x12')],'waiting':this[_0x8dcd('0xc')]};var _0x428cd1=md5(JSON[_0x8dcd('0x18')](_0x25782f));if(this['md5']!==_0x428cd1){this[_0x8dcd('0x1')]=_0x428cd1;io['to'](util['format'](_0x8dcd('0x19'),_0x25782f[_0x8dcd('0x6')]))['emit'](_0x8dcd('0x1a'),_0x25782f);}};module[_0x8dcd('0x1b')]=FaxQueue;
\ No newline at end of file
+var _0xd313=['defaults','localhost','socket.io-emitter','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','paused','length','online','loggedIn','faxPause','available','md5','format','name','emit','fax_queue:save','exports','../../../config/environment','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd313,0x186));var _0x3d31=function(_0x582ec9,_0x3aa517){_0x582ec9=_0x582ec9-0x0;var _0x3594c6=_0xd313[_0x582ec9];return _0x3594c6;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x3d31('0x0'));config[_0x3d31('0x1')]=_[_0x3d31('0x2')](config[_0x3d31('0x1')],{'host':_0x3d31('0x3'),'port':0x18eb});var io=require(_0x3d31('0x4'))(new Redis(config[_0x3d31('0x1')]));function FaxQueue(_0x3daa6f){this['id']=_0x3daa6f['id']||0x0;this['name']=_0x3daa6f['name']||'';this[_0x3d31('0x5')]=_0x3daa6f[_0x3d31('0x5')]||0xa;this['strategy']=_0x3daa6f[_0x3d31('0x6')]||_0x3d31('0x7');this['Agents']=_0x3daa6f['Agents'];this[_0x3d31('0x8')]={};this[_0x3d31('0x9')]=0x0;this['md5']='';this[_0x3d31('0xa')]();this[_0x3d31('0xb')]();}FaxQueue[_0x3d31('0xc')][_0x3d31('0xa')]=function(){var _0x3c216a=this[_0x3d31('0x8')][_0x3d31('0xd')];this[_0x3d31('0x8')]=_[_0x3d31('0xe')](this[_0x3d31('0xf')],'id');this[_0x3d31('0x8')][_0x3d31('0xd')]=_0x3c216a;};FaxQueue[_0x3d31('0xc')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x3d31('0x10')]=0x0;for(var _0x5a89fc=0x0;_0x5a89fc<this[_0x3d31('0xf')][_0x3d31('0x11')];_0x5a89fc+=0x1){if(this[_0x3d31('0xf')][_0x5a89fc][_0x3d31('0x12')]){this[_0x3d31('0x13')]+=0x1;}if(this['Agents'][_0x5a89fc][_0x3d31('0x14')]){this['paused']+=0x1;}}this['available']=this[_0x3d31('0x13')]-this['paused'];this[_0x3d31('0x15')]=this[_0x3d31('0x15')]>=0x0?this['available']:0x0;var _0x1231f2={'id':this['id'],'available':this[_0x3d31('0x15')],'loggedIn':this[_0x3d31('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x3d31('0x9')]};var _0x182b38=md5(JSON['stringify'](_0x1231f2));if(this[_0x3d31('0x16')]!==_0x182b38){this[_0x3d31('0x16')]=_0x182b38;io['to'](util[_0x3d31('0x17')]('fax:queue:%s',_0x1231f2[_0x3d31('0x18')]))[_0x3d31('0x19')](_0x3d31('0x1a'),_0x1231f2);}};module[_0x3d31('0x1b')]=FaxQueue;
\ No newline at end of file
index bb319e4..75607e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad81=['name','Intervals','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xad81,0x168));var _0x1ad8=function(_0xbced40,_0x2fa5f0){_0xbced40=_0xbced40-0x0;var _0x230f2e=_0xad81[_0xbced40];return _0x230f2e;};'use strict';function Interval(_0xc4ac4f){this['id']=_0xc4ac4f['id']||0x0;this['name']=_0xc4ac4f[_0x1ad8('0x0')]||'';this[_0x1ad8('0x1')]=_0xc4ac4f[_0x1ad8('0x1')]||{};}module[_0x1ad8('0x2')]=Interval;
\ No newline at end of file
+var _0xb1fa=['name','Intervals'];(function(_0x599041,_0x40fbea){var _0x1c4969=function(_0x138048){while(--_0x138048){_0x599041['push'](_0x599041['shift']());}};_0x1c4969(++_0x40fbea);}(_0xb1fa,0x9e));var _0xab1f=function(_0x12b6b1,_0x3e790a){_0x12b6b1=_0x12b6b1-0x0;var _0x5e9902=_0xb1fa[_0x12b6b1];return _0x5e9902;};'use strict';function Interval(_0x1305a4){this['id']=_0x1305a4['id']||0x0;this['name']=_0x1305a4[_0xab1f('0x0')]||'';this['Intervals']=_0x1305a4[_0xab1f('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
index af3c54d..7f5e4b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x160c=['loggedIn','length','mailPause','paused','available','stringify','format','mail:queue:%s','emit','exports','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x160c,0x181));var _0xc160=function(_0xf27539,_0x2a9904){_0xf27539=_0xf27539-0x0;var _0x30ff9b=_0x160c[_0xf27539];return _0x30ff9b;};'use strict';var _=require('lodash');var md5=require(_0xc160('0x0'));var util=require(_0xc160('0x1'));var Redis=require(_0xc160('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xc160('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xc160('0x4'))(new Redis(config[_0xc160('0x3')]));function MailQueue(_0x14dc50){this['id']=_0x14dc50['id']||0x0;this['name']=_0x14dc50[_0xc160('0x5')]||'';this['timeout']=_0x14dc50[_0xc160('0x6')]||0xa;this['strategy']=_0x14dc50[_0xc160('0x7')]||_0xc160('0x8');this['Agents']=_0x14dc50[_0xc160('0x9')];this[_0xc160('0xa')]={};this['waiting']=0x0;this[_0xc160('0x0')]='';this[_0xc160('0xb')]();this[_0xc160('0xc')]();}MailQueue[_0xc160('0xd')][_0xc160('0xb')]=function(){var _0xe6e9d2=this[_0xc160('0xa')][_0xc160('0xe')];this[_0xc160('0xa')]=_['map'](this[_0xc160('0x9')],'id');this[_0xc160('0xa')]['_rr']=_0xe6e9d2;};MailQueue[_0xc160('0xd')][_0xc160('0xc')]=function(){this[_0xc160('0xf')]=0x0;this['paused']=0x0;for(var _0x1c3110=0x0;_0x1c3110<this['Agents'][_0xc160('0x10')];_0x1c3110+=0x1){if(this[_0xc160('0x9')][_0x1c3110]['online']){this[_0xc160('0xf')]+=0x1;}if(this['Agents'][_0x1c3110][_0xc160('0x11')]){this[_0xc160('0x12')]+=0x1;}}this[_0xc160('0x13')]=this['loggedIn']-this['paused'];this[_0xc160('0x13')]=this[_0xc160('0x13')]>=0x0?this[_0xc160('0x13')]:0x0;var _0x54e6e0={'id':this['id'],'available':this[_0xc160('0x13')],'loggedIn':this[_0xc160('0xf')],'name':this[_0xc160('0x5')],'paused':this[_0xc160('0x12')],'waiting':this['waiting']};var _0x10da02=md5(JSON[_0xc160('0x14')](_0x54e6e0));if(this['md5']!==_0x10da02){this[_0xc160('0x0')]=_0x10da02;io['to'](util[_0xc160('0x15')](_0xc160('0x16'),_0x54e6e0[_0xc160('0x5')]))[_0xc160('0x17')]('mail_queue:save',_0x54e6e0);}};module[_0xc160('0x18')]=MailQueue;
\ No newline at end of file
+var _0xa7ee=['name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','length','paused','available','stringify','md5','format','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost'];(function(_0x438434,_0x36f21f){var _0x3b97c9=function(_0x1ecb7b){while(--_0x1ecb7b){_0x438434['push'](_0x438434['shift']());}};_0x3b97c9(++_0x36f21f);}(_0xa7ee,0x159));var _0xea7e=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0xa7ee[_0x311909];return _0x8d3163;};'use strict';var _=require(_0xea7e('0x0'));var md5=require('md5');var util=require(_0xea7e('0x1'));var Redis=require(_0xea7e('0x2'));var config=require(_0xea7e('0x3'));config[_0xea7e('0x4')]=_['defaults'](config['redis'],{'host':_0xea7e('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea7e('0x4')]));function MailQueue(_0x40ec63){this['id']=_0x40ec63['id']||0x0;this[_0xea7e('0x6')]=_0x40ec63[_0xea7e('0x6')]||'';this['timeout']=_0x40ec63[_0xea7e('0x7')]||0xa;this[_0xea7e('0x8')]=_0x40ec63[_0xea7e('0x8')]||_0xea7e('0x9');this[_0xea7e('0xa')]=_0x40ec63['Agents'];this['mapAgentsId']={};this[_0xea7e('0xb')]=0x0;this['md5']='';this[_0xea7e('0xc')]();this[_0xea7e('0xd')]();}MailQueue[_0xea7e('0xe')][_0xea7e('0xc')]=function(){var _0x4da86b=this[_0xea7e('0xf')]['_rr'];this[_0xea7e('0xf')]=_[_0xea7e('0x10')](this[_0xea7e('0xa')],'id');this[_0xea7e('0xf')][_0xea7e('0x11')]=_0x4da86b;};MailQueue[_0xea7e('0xe')][_0xea7e('0xd')]=function(){this[_0xea7e('0x12')]=0x0;this['paused']=0x0;for(var _0x25317c=0x0;_0x25317c<this[_0xea7e('0xa')][_0xea7e('0x13')];_0x25317c+=0x1){if(this[_0xea7e('0xa')][_0x25317c]['online']){this[_0xea7e('0x12')]+=0x1;}if(this['Agents'][_0x25317c]['mailPause']){this[_0xea7e('0x14')]+=0x1;}}this[_0xea7e('0x15')]=this[_0xea7e('0x12')]-this['paused'];this['available']=this[_0xea7e('0x15')]>=0x0?this['available']:0x0;var _0x195d5a={'id':this['id'],'available':this[_0xea7e('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xea7e('0x14')],'waiting':this['waiting']};var _0x482bfb=md5(JSON[_0xea7e('0x16')](_0x195d5a));if(this['md5']!==_0x482bfb){this[_0xea7e('0x17')]=_0x482bfb;io['to'](util[_0xea7e('0x18')]('mail:queue:%s',_0x195d5a[_0xea7e('0x6')]))['emit'](_0xea7e('0x19'),_0x195d5a);}};module[_0xea7e('0x1a')]=MailQueue;
\ No newline at end of file
index c280b49..c0b3728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x698c=['openchannel:queue:%s','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','Agents','length','online','openchannelPause','available','stringify','format'];(function(_0x4ab5f9,_0x42e029){var _0x43fc54=function(_0x4f6e77){while(--_0x4f6e77){_0x4ab5f9['push'](_0x4ab5f9['shift']());}};_0x43fc54(++_0x42e029);}(_0x698c,0x158));var _0xc698=function(_0x58ba7c,_0x28c81f){_0x58ba7c=_0x58ba7c-0x0;var _0x227e91=_0x698c[_0x58ba7c];return _0x227e91;};'use strict';var _=require(_0xc698('0x0'));var md5=require(_0xc698('0x1'));var util=require(_0xc698('0x2'));var Redis=require(_0xc698('0x3'));var config=require(_0xc698('0x4'));config[_0xc698('0x5')]=_[_0xc698('0x6')](config['redis'],{'host':_0xc698('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc698('0x5')]));function OpenchannelQueue(_0x282cfe){this['id']=_0x282cfe['id']||0x0;this[_0xc698('0x8')]=_0x282cfe['name']||'';this[_0xc698('0x9')]=_0x282cfe[_0xc698('0x9')]||0xa;this[_0xc698('0xa')]=_0x282cfe[_0xc698('0xa')]||_0xc698('0xb');this['Agents']=_0x282cfe['Agents'];this['mapAgentsId']={};this[_0xc698('0xc')]=0x0;this[_0xc698('0x1')]='';this[_0xc698('0xd')]();this[_0xc698('0xe')]();}OpenchannelQueue[_0xc698('0xf')][_0xc698('0xd')]=function(){var _0x35185a=this[_0xc698('0x10')]['_rr'];this['mapAgentsId']=_[_0xc698('0x11')](this['Agents'],'id');this[_0xc698('0x10')][_0xc698('0x12')]=_0x35185a;};OpenchannelQueue[_0xc698('0xf')][_0xc698('0xe')]=function(){this[_0xc698('0x13')]=0x0;this[_0xc698('0x14')]=0x0;for(var _0x3fde88=0x0;_0x3fde88<this[_0xc698('0x15')][_0xc698('0x16')];_0x3fde88+=0x1){if(this[_0xc698('0x15')][_0x3fde88][_0xc698('0x17')]){this[_0xc698('0x13')]+=0x1;}if(this[_0xc698('0x15')][_0x3fde88][_0xc698('0x18')]){this[_0xc698('0x14')]+=0x1;}}this[_0xc698('0x19')]=this[_0xc698('0x13')]-this[_0xc698('0x14')];this[_0xc698('0x19')]=this[_0xc698('0x19')]>=0x0?this[_0xc698('0x19')]:0x0;var _0x5cba33={'id':this['id'],'available':this[_0xc698('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xc698('0xc')]};var _0x2dd09c=md5(JSON[_0xc698('0x1a')](_0x5cba33));if(this['md5']!==_0x2dd09c){this[_0xc698('0x1')]=_0x2dd09c;io['to'](util[_0xc698('0x1b')](_0xc698('0x1c'),_0x5cba33[_0xc698('0x8')]))['emit'](_0xc698('0x1d'),_0x5cba33);}};module[_0xc698('0x1e')]=OpenchannelQueue;
\ No newline at end of file
+var _0x6198=['stringify','openchannel:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','openchannelPause','available'];(function(_0x51e5ae,_0xf6e238){var _0x3325d2=function(_0x2d1cab){while(--_0x2d1cab){_0x51e5ae['push'](_0x51e5ae['shift']());}};_0x3325d2(++_0xf6e238);}(_0x6198,0x100));var _0x8619=function(_0x39097c,_0x5201d9){_0x39097c=_0x39097c-0x0;var _0x430a1f=_0x6198[_0x39097c];return _0x430a1f;};'use strict';var _=require(_0x8619('0x0'));var md5=require(_0x8619('0x1'));var util=require(_0x8619('0x2'));var Redis=require('ioredis');var config=require(_0x8619('0x3'));config[_0x8619('0x4')]=_['defaults'](config['redis'],{'host':_0x8619('0x5'),'port':0x18eb});var io=require(_0x8619('0x6'))(new Redis(config['redis']));function OpenchannelQueue(_0x16bd34){this['id']=_0x16bd34['id']||0x0;this[_0x8619('0x7')]=_0x16bd34[_0x8619('0x7')]||'';this['timeout']=_0x16bd34[_0x8619('0x8')]||0xa;this[_0x8619('0x9')]=_0x16bd34['strategy']||_0x8619('0xa');this[_0x8619('0xb')]=_0x16bd34[_0x8619('0xb')];this[_0x8619('0xc')]={};this[_0x8619('0xd')]=0x0;this[_0x8619('0x1')]='';this[_0x8619('0xe')]();this[_0x8619('0xf')]();}OpenchannelQueue[_0x8619('0x10')][_0x8619('0xe')]=function(){var _0x2970f1=this[_0x8619('0xc')][_0x8619('0x11')];this[_0x8619('0xc')]=_['map'](this[_0x8619('0xb')],'id');this[_0x8619('0xc')][_0x8619('0x11')]=_0x2970f1;};OpenchannelQueue[_0x8619('0x10')][_0x8619('0xf')]=function(){this[_0x8619('0x12')]=0x0;this[_0x8619('0x13')]=0x0;for(var _0x32df15=0x0;_0x32df15<this[_0x8619('0xb')][_0x8619('0x14')];_0x32df15+=0x1){if(this[_0x8619('0xb')][_0x32df15][_0x8619('0x15')]){this[_0x8619('0x12')]+=0x1;}if(this['Agents'][_0x32df15][_0x8619('0x16')]){this['paused']+=0x1;}}this['available']=this['loggedIn']-this['paused'];this[_0x8619('0x17')]=this[_0x8619('0x17')]>=0x0?this[_0x8619('0x17')]:0x0;var _0x2a72c7={'id':this['id'],'available':this[_0x8619('0x17')],'loggedIn':this[_0x8619('0x12')],'name':this[_0x8619('0x7')],'paused':this[_0x8619('0x13')],'waiting':this[_0x8619('0xd')]};var _0x386d97=md5(JSON[_0x8619('0x18')](_0x2a72c7));if(this[_0x8619('0x1')]!==_0x386d97){this[_0x8619('0x1')]=_0x386d97;io['to'](util['format'](_0x8619('0x19'),_0x2a72c7[_0x8619('0x7')]))[_0x8619('0x1a')]('openchannel_queue:save',_0x2a72c7);}};module[_0x8619('0x1b')]=OpenchannelQueue;
\ No newline at end of file
index 4a654d9..4152f2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82eb=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x3d7fa5,_0x49ce57){var _0x30fceb=function(_0x569654){while(--_0x569654){_0x3d7fa5['push'](_0x3d7fa5['shift']());}};_0x30fceb(++_0x49ce57);}(_0x82eb,0xaa));var _0xb82e=function(_0x5e8200,_0x1aa3fa){_0x5e8200=_0x5e8200-0x0;var _0x5e44f5=_0x82eb[_0x5e8200];return _0x5e44f5;};'use strict';var _=require(_0xb82e('0x0'));var md5=require(_0xb82e('0x1'));var util=require(_0xb82e('0x2'));var Redis=require(_0xb82e('0x3'));var config=require(_0xb82e('0x4'));config[_0xb82e('0x5')]=_[_0xb82e('0x6')](config[_0xb82e('0x5')],{'host':_0xb82e('0x7'),'port':0x18eb});var io=require(_0xb82e('0x8'))(new Redis(config[_0xb82e('0x5')]));function SmsQueue(_0x59e81e){this['id']=_0x59e81e['id']||0x0;this[_0xb82e('0x9')]=_0x59e81e[_0xb82e('0x9')]||'';this[_0xb82e('0xa')]=_0x59e81e[_0xb82e('0xa')]||0xa;this[_0xb82e('0xb')]=_0x59e81e[_0xb82e('0xb')]||_0xb82e('0xc');this[_0xb82e('0xd')]=_0x59e81e[_0xb82e('0xd')];this[_0xb82e('0xe')]={};this[_0xb82e('0xf')]=0x0;this[_0xb82e('0x1')]='';this[_0xb82e('0x10')]();this[_0xb82e('0x11')]();}SmsQueue[_0xb82e('0x12')][_0xb82e('0x10')]=function(){var _0x1f4e99=this['mapAgentsId'][_0xb82e('0x13')];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0xb82e('0xe')]['_rr']=_0x1f4e99;};SmsQueue['prototype'][_0xb82e('0x11')]=function(){this[_0xb82e('0x14')]=0x0;this[_0xb82e('0x15')]=0x0;for(var _0x1d8bf3=0x0;_0x1d8bf3<this['Agents'][_0xb82e('0x16')];_0x1d8bf3+=0x1){if(this[_0xb82e('0xd')][_0x1d8bf3][_0xb82e('0x17')]){this[_0xb82e('0x14')]+=0x1;}if(this[_0xb82e('0xd')][_0x1d8bf3][_0xb82e('0x18')]){this[_0xb82e('0x15')]+=0x1;}}this[_0xb82e('0x19')]=this[_0xb82e('0x14')]-this[_0xb82e('0x15')];this[_0xb82e('0x19')]=this[_0xb82e('0x19')]>=0x0?this[_0xb82e('0x19')]:0x0;var _0x2b6581={'id':this['id'],'available':this[_0xb82e('0x19')],'loggedIn':this[_0xb82e('0x14')],'name':this['name'],'paused':this[_0xb82e('0x15')],'waiting':this[_0xb82e('0xf')]};var _0x238d41=md5(JSON[_0xb82e('0x1a')](_0x2b6581));if(this[_0xb82e('0x1')]!==_0x238d41){this[_0xb82e('0x1')]=_0x238d41;io['to'](util[_0xb82e('0x1b')](_0xb82e('0x1c'),_0x2b6581['name']))['emit'](_0xb82e('0x1d'),_0x2b6581);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0xe32d=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','smsPause','available','stringify','emit','sms_queue:save','lodash','md5','util'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xe32d,0xf9));var _0xde32=function(_0x1e89d4,_0x2cc37d){_0x1e89d4=_0x1e89d4-0x0;var _0x171c4c=_0xe32d[_0x1e89d4];return _0x171c4c;};'use strict';var _=require(_0xde32('0x0'));var md5=require(_0xde32('0x1'));var util=require(_0xde32('0x2'));var Redis=require(_0xde32('0x3'));var config=require(_0xde32('0x4'));config[_0xde32('0x5')]=_[_0xde32('0x6')](config[_0xde32('0x5')],{'host':_0xde32('0x7'),'port':0x18eb});var io=require(_0xde32('0x8'))(new Redis(config['redis']));function SmsQueue(_0x3c5ab8){this['id']=_0x3c5ab8['id']||0x0;this[_0xde32('0x9')]=_0x3c5ab8[_0xde32('0x9')]||'';this['timeout']=_0x3c5ab8[_0xde32('0xa')]||0xa;this[_0xde32('0xb')]=_0x3c5ab8[_0xde32('0xb')]||_0xde32('0xc');this[_0xde32('0xd')]=_0x3c5ab8['Agents'];this['mapAgentsId']={};this[_0xde32('0xe')]=0x0;this[_0xde32('0x1')]='';this[_0xde32('0xf')]();this[_0xde32('0x10')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x548ef6=this[_0xde32('0x11')][_0xde32('0x12')];this[_0xde32('0x11')]=_[_0xde32('0x13')](this['Agents'],'id');this[_0xde32('0x11')][_0xde32('0x12')]=_0x548ef6;};SmsQueue[_0xde32('0x14')][_0xde32('0x10')]=function(){this[_0xde32('0x15')]=0x0;this[_0xde32('0x16')]=0x0;for(var _0xda0e86=0x0;_0xda0e86<this[_0xde32('0xd')]['length'];_0xda0e86+=0x1){if(this[_0xde32('0xd')][_0xda0e86]['online']){this['loggedIn']+=0x1;}if(this[_0xde32('0xd')][_0xda0e86][_0xde32('0x17')]){this['paused']+=0x1;}}this[_0xde32('0x18')]=this[_0xde32('0x15')]-this[_0xde32('0x16')];this[_0xde32('0x18')]=this['available']>=0x0?this[_0xde32('0x18')]:0x0;var _0x3c5c6f={'id':this['id'],'available':this[_0xde32('0x18')],'loggedIn':this[_0xde32('0x15')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xde32('0xe')]};var _0x31bfd8=md5(JSON[_0xde32('0x19')](_0x3c5c6f));if(this['md5']!==_0x31bfd8){this[_0xde32('0x1')]=_0x31bfd8;io['to'](util['format']('sms:queue:%s',_0x3c5c6f[_0xde32('0x9')]))[_0xde32('0x1a')](_0xde32('0x1b'),_0x3c5c6f);}};module['exports']=SmsQueue;
\ No newline at end of file
index 4eb7e42..c48343c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47d9=['updateRealtime','initChatQueues','initSmsQueues','initMailQueues','initFaxQueues','util','lodash','../model/agent','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','chatQueues','smsQueues','mailQueues','faxQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','length','isUndefined','intervals','initOpenchannelQueues','openchannelQueues','updateRouting'];(function(_0x9c4a28,_0x16b4b3){var _0xae34e9=function(_0x54c73e){while(--_0x54c73e){_0x9c4a28['push'](_0x9c4a28['shift']());}};_0xae34e9(++_0x16b4b3);}(_0x47d9,0x144));var _0x947d=function(_0x530aff,_0x2cba4f){_0x530aff=_0x530aff-0x0;var _0xe532f9=_0x47d9[_0x530aff];return _0xe532f9;};'use strict';var BPromise=require('bluebird');var util=require(_0x947d('0x0'));var _=require(_0x947d('0x1'));var moment=require('moment');var Agent=require(_0x947d('0x2'));var Interval=require('../model/interval');var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x947d('0x3'));var SmsQueue=require(_0x947d('0x4'));var MailQueue=require(_0x947d('0x5'));var FaxQueue=require(_0x947d('0x6'));var Realtime=function(){this[_0x947d('0x7')]={};this['intervals']={};this['openchannelQueues']={};this[_0x947d('0x8')]={};this[_0x947d('0x9')]={};this[_0x947d('0xa')]={};this[_0x947d('0xb')]={};this['chatQueuesWaitingInteractions']={};this[_0x947d('0xc')]={};this['openchannelQueuesWaitingInteractions']={};this[_0x947d('0xd')]={};this[_0x947d('0xe')]={};};function freeIsNotKey(_0x40f4fc,_0xaaef33,_0xd14fdc){var _0x2b53e8=_[_0x947d('0xf')](_0x40f4fc,function(_0x2b3215,_0x43c300){return _0x2b3215[_0xd14fdc];});for(var _0x1d35da in _0xaaef33){if(_0xaaef33['hasOwnProperty'](_0x1d35da)){if(!_0x2b53e8[_0x1d35da]){delete _0xaaef33[_0x1d35da];}}}}Realtime[_0x947d('0x10')][_0x947d('0x11')]=function(_0x4b3543,_0x424d33){for(var _0x2d8ffd in _0x424d33){if(_0x4b3543['hasOwnProperty'](_0x2d8ffd)){_0x4b3543[_0x2d8ffd]=_0x424d33[_0x2d8ffd];}}};Realtime[_0x947d('0x10')]['initAgents']=function(){var _0x12867e=this;return function(_0x121e9c){if(_0x121e9c){freeIsNotKey(_0x121e9c,_0x12867e[_0x947d('0x7')],'id');for(var _0x102bd5=0x0,_0x273a8f={},_0x304075={};_0x102bd5<_0x121e9c[_0x947d('0x12')];_0x102bd5+=0x1){_0x273a8f=_0x121e9c[_0x102bd5];if(_[_0x947d('0x13')](_0x12867e[_0x947d('0x7')][_0x273a8f['id']])){_0x12867e[_0x947d('0x7')][_0x273a8f['id']]=new Agent(_0x273a8f);}else{_0x12867e[_0x947d('0x11')](_0x12867e[_0x947d('0x7')][_0x273a8f['id']],_0x273a8f);}}}return _0x12867e[_0x947d('0x7')];};};Realtime[_0x947d('0x10')]['initIntervals']=function(){var _0x283012=this;return function(_0x39190e){if(_0x39190e){freeIsNotKey(_0x39190e,_0x283012[_0x947d('0x14')],'id');for(var _0x17ad3b=0x0,_0x16ba43={},_0x31a57c={};_0x17ad3b<_0x39190e['length'];_0x17ad3b+=0x1){_0x16ba43=_0x39190e[_0x17ad3b];if(_[_0x947d('0x13')](_0x283012[_0x947d('0x14')][_0x16ba43['id']])){_0x283012[_0x947d('0x14')][_0x16ba43['id']]=new Interval(_0x16ba43);}else{_0x283012[_0x947d('0x11')](_0x283012[_0x947d('0x14')][_0x16ba43['id']],_0x16ba43);}}}return _0x283012[_0x947d('0x14')];};};Realtime[_0x947d('0x10')][_0x947d('0x15')]=function(){var _0x1655ea=this;return function(_0x3e42f8){if(_0x3e42f8){freeIsNotKey(_0x3e42f8,_0x1655ea['openchannelQueues'],'id');for(var _0x345433=0x0,_0x550b26={},_0x523596={};_0x345433<_0x3e42f8['length'];_0x345433+=0x1){_0x550b26=_0x3e42f8[_0x345433];if(_[_0x947d('0x13')](_0x1655ea[_0x947d('0x16')][_0x550b26['id']])){_0x1655ea[_0x947d('0x16')][_0x550b26['id']]=new OpenchannelQueue(_0x550b26);}else{_0x1655ea[_0x947d('0x11')](_0x1655ea['openchannelQueues'][_0x550b26['id']],_0x550b26);}_0x1655ea[_0x947d('0x16')][_0x550b26['id']][_0x947d('0x17')]();_0x1655ea['openchannelQueues'][_0x550b26['id']][_0x947d('0x18')]();}}return _0x1655ea[_0x947d('0x16')];};};Realtime['prototype'][_0x947d('0x19')]=function(){var _0x34fe56=this;return function(_0x201be0){if(_0x201be0){freeIsNotKey(_0x201be0,_0x34fe56[_0x947d('0x8')],'id');for(var _0x1bd943=0x0,_0x3e6f1b={},_0x2a291b={};_0x1bd943<_0x201be0[_0x947d('0x12')];_0x1bd943+=0x1){_0x3e6f1b=_0x201be0[_0x1bd943];if(_[_0x947d('0x13')](_0x34fe56[_0x947d('0x8')][_0x3e6f1b['id']])){_0x34fe56['chatQueues'][_0x3e6f1b['id']]=new ChatQueue(_0x3e6f1b);}else{_0x34fe56[_0x947d('0x11')](_0x34fe56[_0x947d('0x8')][_0x3e6f1b['id']],_0x3e6f1b);}_0x34fe56[_0x947d('0x8')][_0x3e6f1b['id']][_0x947d('0x17')]();_0x34fe56[_0x947d('0x8')][_0x3e6f1b['id']][_0x947d('0x18')]();}}return _0x34fe56[_0x947d('0x8')];};};Realtime[_0x947d('0x10')][_0x947d('0x1a')]=function(){var _0x17c183=this;return function(_0x290ca9){if(_0x290ca9){freeIsNotKey(_0x290ca9,_0x17c183[_0x947d('0x9')],'id');for(var _0x3538be=0x0,_0x260d55={},_0x854782={};_0x3538be<_0x290ca9[_0x947d('0x12')];_0x3538be+=0x1){_0x260d55=_0x290ca9[_0x3538be];if(_[_0x947d('0x13')](_0x17c183[_0x947d('0x9')][_0x260d55['id']])){_0x17c183['smsQueues'][_0x260d55['id']]=new SmsQueue(_0x260d55);}else{_0x17c183[_0x947d('0x11')](_0x17c183[_0x947d('0x9')][_0x260d55['id']],_0x260d55);}_0x17c183['smsQueues'][_0x260d55['id']][_0x947d('0x17')]();_0x17c183[_0x947d('0x9')][_0x260d55['id']][_0x947d('0x18')]();}}return _0x17c183['smsQueues'];};};Realtime['prototype'][_0x947d('0x1b')]=function(){var _0x55a4bd=this;return function(_0x5f18b7){if(_0x5f18b7){freeIsNotKey(_0x5f18b7,_0x55a4bd[_0x947d('0xa')],'id');for(var _0x4621b1=0x0,_0x26aee5={},_0x183c00={};_0x4621b1<_0x5f18b7['length'];_0x4621b1+=0x1){_0x26aee5=_0x5f18b7[_0x4621b1];if(_['isUndefined'](_0x55a4bd[_0x947d('0xa')][_0x26aee5['id']])){_0x55a4bd[_0x947d('0xa')][_0x26aee5['id']]=new MailQueue(_0x26aee5);}else{_0x55a4bd[_0x947d('0x11')](_0x55a4bd[_0x947d('0xa')][_0x26aee5['id']],_0x26aee5);}_0x55a4bd[_0x947d('0xa')][_0x26aee5['id']][_0x947d('0x17')]();_0x55a4bd[_0x947d('0xa')][_0x26aee5['id']][_0x947d('0x18')]();}}return _0x55a4bd[_0x947d('0xa')];};};Realtime[_0x947d('0x10')][_0x947d('0x1c')]=function(){var _0x581534=this;return function(_0x49f9be){if(_0x49f9be){freeIsNotKey(_0x49f9be,_0x581534[_0x947d('0xb')],'id');for(var _0x4597f7=0x0,_0x192d18={},_0x306457={};_0x4597f7<_0x49f9be[_0x947d('0x12')];_0x4597f7+=0x1){_0x192d18=_0x49f9be[_0x4597f7];if(_[_0x947d('0x13')](_0x581534[_0x947d('0xb')][_0x192d18['id']])){_0x581534[_0x947d('0xb')][_0x192d18['id']]=new FaxQueue(_0x192d18);}else{_0x581534[_0x947d('0x11')](_0x581534[_0x947d('0xb')][_0x192d18['id']],_0x192d18);}_0x581534['faxQueues'][_0x192d18['id']][_0x947d('0x17')]();_0x581534[_0x947d('0xb')][_0x192d18['id']][_0x947d('0x18')]();}}return _0x581534[_0x947d('0xb')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x22bb=['smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','agents','initIntervals','openchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','initFaxQueues','faxQueues','exports','bluebird','util','lodash','../model/agent','../model/openchannelQueue','../model/mailQueue','../model/faxQueue','intervals','chatQueues','smsQueues','mailQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions'];(function(_0x53e8c3,_0x426196){var _0x40f5b8=function(_0x522691){while(--_0x522691){_0x53e8c3['push'](_0x53e8c3['shift']());}};_0x40f5b8(++_0x426196);}(_0x22bb,0x76));var _0xb22b=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x22bb[_0x4f9b18];return _0x29f20c;};'use strict';var BPromise=require(_0xb22b('0x0'));var util=require(_0xb22b('0x1'));var _=require(_0xb22b('0x2'));var moment=require('moment');var Agent=require(_0xb22b('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xb22b('0x4'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0xb22b('0x5'));var FaxQueue=require(_0xb22b('0x6'));var Realtime=function(){this['agents']={};this[_0xb22b('0x7')]={};this['openchannelQueues']={};this[_0xb22b('0x8')]={};this[_0xb22b('0x9')]={};this[_0xb22b('0xa')]={};this['faxQueues']={};this[_0xb22b('0xb')]={};this[_0xb22b('0xc')]={};this[_0xb22b('0xd')]={};this[_0xb22b('0xe')]={};this[_0xb22b('0xf')]={};};function freeIsNotKey(_0x5ca421,_0x3a8dfa,_0x475d97){var _0x419d67=_[_0xb22b('0x10')](_0x5ca421,function(_0x24c77b,_0x130708){return _0x24c77b[_0x475d97];});for(var _0x5e1a84 in _0x3a8dfa){if(_0x3a8dfa[_0xb22b('0x11')](_0x5e1a84)){if(!_0x419d67[_0x5e1a84]){delete _0x3a8dfa[_0x5e1a84];}}}}Realtime[_0xb22b('0x12')][_0xb22b('0x13')]=function(_0x355db8,_0x108409){for(var _0x585fd6 in _0x108409){if(_0x355db8['hasOwnProperty'](_0x585fd6)){_0x355db8[_0x585fd6]=_0x108409[_0x585fd6];}}};Realtime[_0xb22b('0x12')][_0xb22b('0x14')]=function(){var _0x2ff66c=this;return function(_0x3936fc){if(_0x3936fc){freeIsNotKey(_0x3936fc,_0x2ff66c['agents'],'id');for(var _0x3628cf=0x0,_0x2e5762={},_0x268561={};_0x3628cf<_0x3936fc[_0xb22b('0x15')];_0x3628cf+=0x1){_0x2e5762=_0x3936fc[_0x3628cf];if(_[_0xb22b('0x16')](_0x2ff66c[_0xb22b('0x17')][_0x2e5762['id']])){_0x2ff66c[_0xb22b('0x17')][_0x2e5762['id']]=new Agent(_0x2e5762);}else{_0x2ff66c[_0xb22b('0x13')](_0x2ff66c[_0xb22b('0x17')][_0x2e5762['id']],_0x2e5762);}}}return _0x2ff66c[_0xb22b('0x17')];};};Realtime['prototype'][_0xb22b('0x18')]=function(){var _0x3b7686=this;return function(_0x508187){if(_0x508187){freeIsNotKey(_0x508187,_0x3b7686[_0xb22b('0x7')],'id');for(var _0x65d03f=0x0,_0x70c62={},_0x5db5a0={};_0x65d03f<_0x508187[_0xb22b('0x15')];_0x65d03f+=0x1){_0x70c62=_0x508187[_0x65d03f];if(_[_0xb22b('0x16')](_0x3b7686['intervals'][_0x70c62['id']])){_0x3b7686['intervals'][_0x70c62['id']]=new Interval(_0x70c62);}else{_0x3b7686['mergeFromDatabase'](_0x3b7686['intervals'][_0x70c62['id']],_0x70c62);}}}return _0x3b7686['intervals'];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x11643a=this;return function(_0x41d19c){if(_0x41d19c){freeIsNotKey(_0x41d19c,_0x11643a[_0xb22b('0x19')],'id');for(var _0x10cfad=0x0,_0x25e0c0={},_0x2a43c2={};_0x10cfad<_0x41d19c['length'];_0x10cfad+=0x1){_0x25e0c0=_0x41d19c[_0x10cfad];if(_['isUndefined'](_0x11643a[_0xb22b('0x19')][_0x25e0c0['id']])){_0x11643a[_0xb22b('0x19')][_0x25e0c0['id']]=new OpenchannelQueue(_0x25e0c0);}else{_0x11643a[_0xb22b('0x13')](_0x11643a[_0xb22b('0x19')][_0x25e0c0['id']],_0x25e0c0);}_0x11643a[_0xb22b('0x19')][_0x25e0c0['id']][_0xb22b('0x1a')]();_0x11643a['openchannelQueues'][_0x25e0c0['id']][_0xb22b('0x1b')]();}}return _0x11643a[_0xb22b('0x19')];};};Realtime[_0xb22b('0x12')][_0xb22b('0x1c')]=function(){var _0xfad8b0=this;return function(_0x5346ec){if(_0x5346ec){freeIsNotKey(_0x5346ec,_0xfad8b0[_0xb22b('0x8')],'id');for(var _0x51fd71=0x0,_0x45d808={},_0x29c2d6={};_0x51fd71<_0x5346ec[_0xb22b('0x15')];_0x51fd71+=0x1){_0x45d808=_0x5346ec[_0x51fd71];if(_['isUndefined'](_0xfad8b0[_0xb22b('0x8')][_0x45d808['id']])){_0xfad8b0[_0xb22b('0x8')][_0x45d808['id']]=new ChatQueue(_0x45d808);}else{_0xfad8b0[_0xb22b('0x13')](_0xfad8b0[_0xb22b('0x8')][_0x45d808['id']],_0x45d808);}_0xfad8b0[_0xb22b('0x8')][_0x45d808['id']][_0xb22b('0x1a')]();_0xfad8b0[_0xb22b('0x8')][_0x45d808['id']]['updateRealtime']();}}return _0xfad8b0[_0xb22b('0x8')];};};Realtime[_0xb22b('0x12')][_0xb22b('0x1d')]=function(){var _0x38badc=this;return function(_0x5177e1){if(_0x5177e1){freeIsNotKey(_0x5177e1,_0x38badc[_0xb22b('0x9')],'id');for(var _0x4a9e94=0x0,_0x591638={},_0x43dabe={};_0x4a9e94<_0x5177e1[_0xb22b('0x15')];_0x4a9e94+=0x1){_0x591638=_0x5177e1[_0x4a9e94];if(_[_0xb22b('0x16')](_0x38badc[_0xb22b('0x9')][_0x591638['id']])){_0x38badc['smsQueues'][_0x591638['id']]=new SmsQueue(_0x591638);}else{_0x38badc[_0xb22b('0x13')](_0x38badc['smsQueues'][_0x591638['id']],_0x591638);}_0x38badc[_0xb22b('0x9')][_0x591638['id']]['updateRouting']();_0x38badc['smsQueues'][_0x591638['id']]['updateRealtime']();}}return _0x38badc[_0xb22b('0x9')];};};Realtime[_0xb22b('0x12')]['initMailQueues']=function(){var _0x4cf8f7=this;return function(_0xc97d6a){if(_0xc97d6a){freeIsNotKey(_0xc97d6a,_0x4cf8f7[_0xb22b('0xa')],'id');for(var _0x35ded4=0x0,_0x4be989={},_0x5773da={};_0x35ded4<_0xc97d6a[_0xb22b('0x15')];_0x35ded4+=0x1){_0x4be989=_0xc97d6a[_0x35ded4];if(_['isUndefined'](_0x4cf8f7[_0xb22b('0xa')][_0x4be989['id']])){_0x4cf8f7[_0xb22b('0xa')][_0x4be989['id']]=new MailQueue(_0x4be989);}else{_0x4cf8f7['mergeFromDatabase'](_0x4cf8f7[_0xb22b('0xa')][_0x4be989['id']],_0x4be989);}_0x4cf8f7[_0xb22b('0xa')][_0x4be989['id']]['updateRouting']();_0x4cf8f7[_0xb22b('0xa')][_0x4be989['id']][_0xb22b('0x1b')]();}}return _0x4cf8f7[_0xb22b('0xa')];};};Realtime[_0xb22b('0x12')][_0xb22b('0x1e')]=function(){var _0x463bd6=this;return function(_0x507f20){if(_0x507f20){freeIsNotKey(_0x507f20,_0x463bd6[_0xb22b('0x1f')],'id');for(var _0x23570e=0x0,_0x4bc7b0={},_0x330da0={};_0x23570e<_0x507f20[_0xb22b('0x15')];_0x23570e+=0x1){_0x4bc7b0=_0x507f20[_0x23570e];if(_[_0xb22b('0x16')](_0x463bd6[_0xb22b('0x1f')][_0x4bc7b0['id']])){_0x463bd6[_0xb22b('0x1f')][_0x4bc7b0['id']]=new FaxQueue(_0x4bc7b0);}else{_0x463bd6[_0xb22b('0x13')](_0x463bd6[_0xb22b('0x1f')][_0x4bc7b0['id']],_0x4bc7b0);}_0x463bd6[_0xb22b('0x1f')][_0x4bc7b0['id']][_0xb22b('0x1a')]();_0x463bd6[_0xb22b('0x1f')][_0x4bc7b0['id']][_0xb22b('0x1b')]();}}return _0x463bd6[_0xb22b('0x1f')];};};module[_0xb22b('0x20')]=Realtime;
\ No newline at end of file
index 92d7740..8ec4f6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc2a=['Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction','addTags'];(function(_0x368922,_0xd74ca1){var _0x315487=function(_0x1fd411){while(--_0x1fd411){_0x368922['push'](_0x368922['shift']());}};_0x315487(++_0xd74ca1);}(_0xdc2a,0x73));var _0xadc2=function(_0x32d41b,_0x500ed8){_0x32d41b=_0x32d41b-0x0;var _0x2f1c0b=_0xdc2a[_0x32d41b];return _0x2f1c0b;};'use strict';var client=require(_0xadc2('0x0'));exports[_0xadc2('0x1')]=function(_0x176973,_0x3278f9){return client['Request'](_0xadc2('0x2'),{'body':_0x3278f9,'options':{'where':{'id':_0x176973}},'log':'updateChatInteraction'});};exports[_0xadc2('0x3')]=function(_0x2b6266,_0x3242e8){return client[_0xadc2('0x4')](_0xadc2('0x5'),{'body':_0x3242e8,'options':{'where':{'id':_0x2b6266}},'log':_0xadc2('0x6')});};
\ No newline at end of file
+var _0x8c58=['addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x43130c,_0x5eabd1){var _0x52b898=function(_0x1f458f){while(--_0x1f458f){_0x43130c['push'](_0x43130c['shift']());}};_0x52b898(++_0x5eabd1);}(_0x8c58,0x93));var _0x88c5=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x8c58[_0x13ea00];return _0x1f7347;};'use strict';var client=require(_0x88c5('0x0'));exports['update']=function(_0x2904f4,_0x5e8678){return client[_0x88c5('0x1')](_0x88c5('0x2'),{'body':_0x5e8678,'options':{'where':{'id':_0x2904f4}},'log':'updateChatInteraction'});};exports[_0x88c5('0x3')]=function(_0x9e460a,_0x1ea2b9){return client['Request'](_0x88c5('0x4'),{'body':_0x1ea2b9,'options':{'where':{'id':_0x9e460a}},'log':_0x88c5('0x5')});};
\ No newline at end of file
index 852e065..3667af3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x033c=['Request','CreateChatMessage','../client','create'];(function(_0x52a192,_0x3ffac0){var _0x4da4ae=function(_0x533315){while(--_0x533315){_0x52a192['push'](_0x52a192['shift']());}};_0x4da4ae(++_0x3ffac0);}(_0x033c,0xf6));var _0xc033=function(_0x175160,_0x3cd751){_0x175160=_0x175160-0x0;var _0xf049b2=_0x033c[_0x175160];return _0xf049b2;};'use strict';var client=require(_0xc033('0x0'));exports[_0xc033('0x1')]=function(_0x48e2dc){return client[_0xc033('0x2')](_0xc033('0x3'),{'body':_0x48e2dc,'log':'createChatMessage'});};
\ No newline at end of file
+var _0x8de8=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x26cff2,_0x464b78){var _0x323b23=function(_0x17bc2e){while(--_0x17bc2e){_0x26cff2['push'](_0x26cff2['shift']());}};_0x323b23(++_0x464b78);}(_0x8de8,0xc4));var _0x88de=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8de8[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x88de('0x0'));exports[_0x88de('0x1')]=function(_0x152b2b){return client[_0x88de('0x2')](_0x88de('0x3'),{'body':_0x152b2b,'log':_0x88de('0x4')});};
\ No newline at end of file
index f894398..decd630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa03b=['Agents','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','User'];(function(_0x4c15ba,_0x5ce80a){var _0x500c5f=function(_0x6cfb26){while(--_0x6cfb26){_0x4c15ba['push'](_0x4c15ba['shift']());}};_0x500c5f(++_0x5ce80a);}(_0xa03b,0x19d));var _0xba03=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0xa03b[_0x4fbb15];return _0x436338;};'use strict';var client=require(_0xba03('0x0'));exports[_0xba03('0x1')]=function(){return function(){return client[_0xba03('0x2')](_0xba03('0x3'),{'options':{'raw':![],'attributes':['id',_0xba03('0x4'),_0xba03('0x5'),'strategy'],'include':[{'model':_0xba03('0x6'),'as':_0xba03('0x7'),'attributes':['id',_0xba03('0x4'),_0xba03('0x8'),_0xba03('0x9')]}]},'log':_0xba03('0x1')});};};
\ No newline at end of file
+var _0x69b1=['User','Agents','online','../client','getChatQueues','Request','GetChatQueue','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x69b1,0xfb));var _0x169b=function(_0x1cea29,_0x546833){_0x1cea29=_0x1cea29-0x0;var _0x2e77ea=_0x69b1[_0x1cea29];return _0x2e77ea;};'use strict';var client=require(_0x169b('0x0'));exports[_0x169b('0x1')]=function(){return function(){return client[_0x169b('0x2')](_0x169b('0x3'),{'options':{'raw':![],'attributes':['id',_0x169b('0x4'),'timeout','strategy'],'include':[{'model':_0x169b('0x5'),'as':_0x169b('0x6'),'attributes':['id',_0x169b('0x4'),_0x169b('0x7'),'chatPause']}]},'log':_0x169b('0x1')});};};
\ No newline at end of file
index ac2aff9..210eb0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc831=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','create'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xc831,0x103));var _0x1c83=function(_0x20d3c0,_0x35a518){_0x20d3c0=_0x20d3c0-0x0;var _0x1ed023=_0xc831[_0x20d3c0];return _0x1ed023;};'use strict';var client=require('../client');exports[_0x1c83('0x0')]=function(_0xb982da){return client[_0x1c83('0x1')](_0x1c83('0x2'),{'body':_0xb982da,'log':_0x1c83('0x2')});};exports[_0x1c83('0x3')]=function(_0x282a11,_0x28441e){return client[_0x1c83('0x1')](_0x1c83('0x4'),{'body':_0x28441e,'options':{'where':{'uniqueid':_0x282a11},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
+var _0x7ae7=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x7ae7,0xd9));var _0x77ae=function(_0x48907c,_0x5bc764){_0x48907c=_0x48907c-0x0;var _0x169ce2=_0x7ae7[_0x48907c];return _0x169ce2;};'use strict';var client=require(_0x77ae('0x0'));exports[_0x77ae('0x1')]=function(_0x4a7a13){return client[_0x77ae('0x2')](_0x77ae('0x3'),{'body':_0x4a7a13,'log':_0x77ae('0x3')});};exports[_0x77ae('0x4')]=function(_0xa7b0de,_0x897790){return client[_0x77ae('0x2')](_0x77ae('0x5'),{'body':_0x897790,'options':{'where':{'uniqueid':_0xa7b0de},'order':[['id',_0x77ae('0x6')]],'limit':0x1},'log':_0x77ae('0x5')});};
\ No newline at end of file
index d3456fd..917f4be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ac=['UpdateFaxInteraction','updateFaxInteraction','addTags','Request','AddTagsToFaxInteraction','../client'];(function(_0x55631c,_0x5a9e6e){var _0x202304=function(_0x5bf0fb){while(--_0x5bf0fb){_0x55631c['push'](_0x55631c['shift']());}};_0x202304(++_0x5a9e6e);}(_0xa7ac,0x18b));var _0xca7a=function(_0x192930,_0x30b11d){_0x192930=_0x192930-0x0;var _0x1f8097=_0xa7ac[_0x192930];return _0x1f8097;};'use strict';var client=require(_0xca7a('0x0'));exports['update']=function(_0x368fb9,_0x4e10b9){return client['Request'](_0xca7a('0x1'),{'body':_0x4e10b9,'options':{'where':{'id':_0x368fb9}},'log':_0xca7a('0x2')});};exports[_0xca7a('0x3')]=function(_0x3902c3,_0x294353){return client[_0xca7a('0x4')](_0xca7a('0x5'),{'body':_0x294353,'options':{'where':{'id':_0x3902c3}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x9754=['updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x9754,0xbc));var _0x4975=function(_0x541c47,_0x1e877f){_0x541c47=_0x541c47-0x0;var _0x3aefcd=_0x9754[_0x541c47];return _0x3aefcd;};'use strict';var client=require(_0x4975('0x0'));exports[_0x4975('0x1')]=function(_0x545b59,_0x5923b9){return client[_0x4975('0x2')](_0x4975('0x3'),{'body':_0x5923b9,'options':{'where':{'id':_0x545b59}},'log':_0x4975('0x4')});};exports[_0x4975('0x5')]=function(_0x423453,_0x2ce970){return client[_0x4975('0x2')](_0x4975('0x6'),{'body':_0x2ce970,'options':{'where':{'id':_0x423453}},'log':_0x4975('0x7')});};
\ No newline at end of file
index b57f487..e6fd1dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x594e=['../client','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x594e,0xb8));var _0xe594=function(_0x58e7f9,_0x4b1ca3){_0x58e7f9=_0x58e7f9-0x0;var _0x3cb310=_0x594e[_0x58e7f9];return _0x3cb310;};'use strict';var client=require(_0xe594('0x0'));exports[_0xe594('0x1')]=function(_0x4d8a60){return client['Request']('CreateFaxMessage',{'body':_0x4d8a60,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0xe929=['createFaxMessage','create','CreateFaxMessage'];(function(_0x322a4b,_0x382751){var _0x6c05ec=function(_0x5e5cbf){while(--_0x5e5cbf){_0x322a4b['push'](_0x322a4b['shift']());}};_0x6c05ec(++_0x382751);}(_0xe929,0x127));var _0x9e92=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xe929[_0x61b3ab];return _0x57097f;};'use strict';var client=require('../client');exports[_0x9e92('0x0')]=function(_0x5621c9){return client['Request'](_0x9e92('0x1'),{'body':_0x5621c9,'log':_0x9e92('0x2')});};
\ No newline at end of file
index a0604a4..721e040 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc57e=['Agents','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name','timeout','User'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xc57e,0x150));var _0xec57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc57e[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xec57('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xec57('0x1')](_0xec57('0x2'),{'options':{'raw':![],'attributes':['id',_0xec57('0x3'),_0xec57('0x4'),'strategy'],'include':[{'model':_0xec57('0x5'),'as':_0xec57('0x6'),'attributes':['id','name','online',_0xec57('0x7')]}]},'log':_0xec57('0x8')});};};
\ No newline at end of file
+var _0xa731=['online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name','strategy','User'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa731,0xed));var _0x1a73=function(_0x2aa8d1,_0x15734d){_0x2aa8d1=_0x2aa8d1-0x0;var _0x5b6617=_0xa731[_0x2aa8d1];return _0x5b6617;};'use strict';var client=require(_0x1a73('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x1a73('0x1')](_0x1a73('0x2'),{'options':{'raw':![],'attributes':['id',_0x1a73('0x3'),'timeout',_0x1a73('0x4')],'include':[{'model':_0x1a73('0x5'),'as':'Agents','attributes':['id','name',_0x1a73('0x6'),_0x1a73('0x7')]}]},'log':_0x1a73('0x8')});};};
\ No newline at end of file
index 4df6561..dcae00b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ea=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x80ea,0x1cf));var _0xa80e=function(_0x3ae502,_0x358082){_0x3ae502=_0x3ae502-0x0;var _0x1b0478=_0x80ea[_0x3ae502];return _0x1b0478;};'use strict';var client=require(_0xa80e('0x0'));exports[_0xa80e('0x1')]=function(_0x42e8cf){return client[_0xa80e('0x2')](_0xa80e('0x3'),{'body':_0x42e8cf,'log':_0xa80e('0x3')});};exports[_0xa80e('0x4')]=function(_0x521626,_0x1d1c5b){return client[_0xa80e('0x2')](_0xa80e('0x5'),{'body':_0x1d1c5b,'options':{'where':{'uniqueid':_0x521626},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0x074b=['create','Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client'];(function(_0x1acdd9,_0x4be278){var _0x2058c4=function(_0x1bc472){while(--_0x1bc472){_0x1acdd9['push'](_0x1acdd9['shift']());}};_0x2058c4(++_0x4be278);}(_0x074b,0x195));var _0xb074=function(_0xc1f9dc,_0x40ad06){_0xc1f9dc=_0xc1f9dc-0x0;var _0x29c318=_0x074b[_0xc1f9dc];return _0x29c318;};'use strict';var client=require(_0xb074('0x0'));exports[_0xb074('0x1')]=function(_0x41640e){return client[_0xb074('0x2')](_0xb074('0x3'),{'body':_0x41640e,'log':_0xb074('0x3')});};exports[_0xb074('0x4')]=function(_0x2c2377,_0x26af6e){return client[_0xb074('0x2')]('UpdateFaxQueueReport',{'body':_0x26af6e,'options':{'where':{'uniqueid':_0x2c2377},'order':[['id',_0xb074('0x5')]],'limit':0x1},'log':_0xb074('0x6')});};
\ No newline at end of file
index e184288..407e357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['name','Intervals','interval','getIntervals','../client','Request','GetInterval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x351d,0x90));var _0xd351=function(_0x462fc9,_0xf26076){_0x462fc9=_0x462fc9-0x0;var _0x166c28=_0x351d[_0x462fc9];return _0x166c28;};'use strict';var client=require(_0xd351('0x0'));exports['getIntervals']=function(){return function(){return client[_0xd351('0x1')](_0xd351('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd351('0x3')],'include':[{'model':'Interval','as':_0xd351('0x4'),'attributes':['id','name',_0xd351('0x5')]}]},'log':_0xd351('0x6')});};};
\ No newline at end of file
+var _0x1b0e=['Request','GetInterval','name','Interval','interval','../client','getIntervals'];(function(_0x30f96b,_0x5a13d2){var _0x58b363=function(_0x6be59f){while(--_0x6be59f){_0x30f96b['push'](_0x30f96b['shift']());}};_0x58b363(++_0x5a13d2);}(_0x1b0e,0x132));var _0xe1b0=function(_0x2e97c0,_0x35fe22){_0x2e97c0=_0x2e97c0-0x0;var _0x2ac172=_0x1b0e[_0x2e97c0];return _0x2ac172;};'use strict';var client=require(_0xe1b0('0x0'));exports[_0xe1b0('0x1')]=function(){return function(){return client[_0xe1b0('0x2')](_0xe1b0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe1b0('0x4')],'include':[{'model':_0xe1b0('0x5'),'as':'Intervals','attributes':['id','name',_0xe1b0('0x6')]}]},'log':_0xe1b0('0x1')});};};
\ No newline at end of file
index 6bb5438..ecb8491 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa23e=['update','UpdateMailInteraction','updateMailInteraction','Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x213322,_0x3b6b24){var _0x1f66bb=function(_0x1907e8){while(--_0x1907e8){_0x213322['push'](_0x213322['shift']());}};_0x1f66bb(++_0x3b6b24);}(_0xa23e,0x172));var _0xea23=function(_0x1cdf8f,_0x46d10c){_0x1cdf8f=_0x1cdf8f-0x0;var _0x6ad9ab=_0xa23e[_0x1cdf8f];return _0x6ad9ab;};'use strict';var client=require(_0xea23('0x0'));exports[_0xea23('0x1')]=function(_0x1d31a3,_0x794a72){return client['Request'](_0xea23('0x2'),{'body':_0x794a72,'options':{'where':{'id':_0x1d31a3}},'log':_0xea23('0x3')});};exports['addTags']=function(_0x15aaf8,_0x470d5e){return client[_0xea23('0x4')](_0xea23('0x5'),{'body':_0x470d5e,'options':{'where':{'id':_0x15aaf8}},'log':_0xea23('0x6')});};
\ No newline at end of file
+var _0xd1c2=['updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x588749,_0xc93c8d){var _0x3ce5f6=function(_0x214656){while(--_0x214656){_0x588749['push'](_0x588749['shift']());}};_0x3ce5f6(++_0xc93c8d);}(_0xd1c2,0xc1));var _0x2d1c=function(_0x4f7fd5,_0x320e0b){_0x4f7fd5=_0x4f7fd5-0x0;var _0x3f6112=_0xd1c2[_0x4f7fd5];return _0x3f6112;};'use strict';var client=require(_0x2d1c('0x0'));exports[_0x2d1c('0x1')]=function(_0x51dc15,_0x39f3cd){return client['Request']('UpdateMailInteraction',{'body':_0x39f3cd,'options':{'where':{'id':_0x51dc15}},'log':_0x2d1c('0x2')});};exports['addTags']=function(_0x1af058,_0x1d3dd9){return client['Request'](_0x2d1c('0x3'),{'body':_0x1d3dd9,'options':{'where':{'id':_0x1af058}},'log':_0x2d1c('0x4')});};
\ No newline at end of file
index add78bf..d366ae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac6=['createMailMessage','Request'];(function(_0x5d0770,_0x71cd71){var _0x22a5e1=function(_0x6e7e11){while(--_0x6e7e11){_0x5d0770['push'](_0x5d0770['shift']());}};_0x22a5e1(++_0x71cd71);}(_0x9ac6,0x199));var _0x69ac=function(_0x2dc839,_0x5dd9c4){_0x2dc839=_0x2dc839-0x0;var _0x5d4861=_0x9ac6[_0x2dc839];return _0x5d4861;};'use strict';var client=require('../client');exports['create']=function(_0x38eb3b){return client[_0x69ac('0x0')]('CreateMailMessage',{'body':_0x38eb3b,'log':_0x69ac('0x1')});};
\ No newline at end of file
+var _0x280b=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x26afdc,_0x2b5ed0){var _0x166a18=function(_0x49c454){while(--_0x49c454){_0x26afdc['push'](_0x26afdc['shift']());}};_0x166a18(++_0x2b5ed0);}(_0x280b,0x18d));var _0xb280=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x280b[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0xb280('0x0'));exports[_0xb280('0x1')]=function(_0x799e3c){return client[_0xb280('0x2')](_0xb280('0x3'),{'body':_0x799e3c,'log':_0xb280('0x4')});};
\ No newline at end of file
index 9f16d08..8bd6cab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a8e=['getMailQueues','Request','name','User','online'];(function(_0x14ec23,_0x64f853){var _0x2387bd=function(_0x4a424f){while(--_0x4a424f){_0x14ec23['push'](_0x14ec23['shift']());}};_0x2387bd(++_0x64f853);}(_0x5a8e,0x11d));var _0xe5a8=function(_0x82dc2c,_0x183cca){_0x82dc2c=_0x82dc2c-0x0;var _0x13b857=_0x5a8e[_0x82dc2c];return _0x13b857;};'use strict';var client=require('../client');exports[_0xe5a8('0x0')]=function(){return function(){return client[_0xe5a8('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xe5a8('0x2'),'timeout','strategy'],'include':[{'model':_0xe5a8('0x3'),'as':'Agents','attributes':['id',_0xe5a8('0x2'),_0xe5a8('0x4'),'mailPause']}]},'log':_0xe5a8('0x0')});};};
\ No newline at end of file
+var _0xb7c9=['online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','Agents'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xb7c9,0x1cd));var _0x9b7c=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xb7c9[_0x55abd9];return _0x3e5669;};'use strict';var client=require(_0x9b7c('0x0'));exports[_0x9b7c('0x1')]=function(){return function(){return client['Request'](_0x9b7c('0x2'),{'options':{'raw':![],'attributes':['id',_0x9b7c('0x3'),_0x9b7c('0x4'),_0x9b7c('0x5')],'include':[{'model':'User','as':_0x9b7c('0x6'),'attributes':['id',_0x9b7c('0x3'),_0x9b7c('0x7'),_0x9b7c('0x8')]}]},'log':_0x9b7c('0x1')});};};
\ No newline at end of file
index ae2c402..518e24e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfe9=['update','Request','UpdateMailQueueReport','../client','create','CreateMailQueueReport'];(function(_0x480e9a,_0xd5afa0){var _0x22f890=function(_0x44fb02){while(--_0x44fb02){_0x480e9a['push'](_0x480e9a['shift']());}};_0x22f890(++_0xd5afa0);}(_0xcfe9,0x1b9));var _0x9cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe9[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x9cfe('0x0'));exports[_0x9cfe('0x1')]=function(_0x5d331b){return client['Request']('CreateMailQueueReport',{'body':_0x5d331b,'log':_0x9cfe('0x2')});};exports[_0x9cfe('0x3')]=function(_0x5ee083,_0x978cdf){return client[_0x9cfe('0x4')]('UpdateMailQueueReport',{'body':_0x978cdf,'options':{'where':{'uniqueid':_0x5ee083},'order':[['id','DESC']],'limit':0x1},'log':_0x9cfe('0x5')});};
\ No newline at end of file
+var _0x5040=['create','Request','CreateMailQueueReport','UpdateMailQueueReport','../client'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5040,0x1d5));var _0x0504=function(_0x47e3bb,_0x591378){_0x47e3bb=_0x47e3bb-0x0;var _0xf5752d=_0x5040[_0x47e3bb];return _0xf5752d;};'use strict';var client=require(_0x0504('0x0'));exports[_0x0504('0x1')]=function(_0x6119be){return client[_0x0504('0x2')](_0x0504('0x3'),{'body':_0x6119be,'log':'CreateMailQueueReport'});};exports['update']=function(_0x2afc85,_0x4a39e1){return client[_0x0504('0x2')]('UpdateMailQueueReport',{'body':_0x4a39e1,'options':{'where':{'uniqueid':_0x2afc85},'order':[['id','DESC']],'limit':0x1},'log':_0x0504('0x4')});};
\ No newline at end of file
index 47935cd..7a2e473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e3=['AddTagsToOpenchannelInteraction','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x3d0004,_0x71b5f4){var _0x17a93c=function(_0x3b0d7c){while(--_0x3b0d7c){_0x3d0004['push'](_0x3d0004['shift']());}};_0x17a93c(++_0x71b5f4);}(_0x28e3,0x145));var _0x328e=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x28e3[_0x409353];return _0x4f4b59;};'use strict';var client=require(_0x328e('0x0'));exports['update']=function(_0x3aee46,_0x8a71da){return client['Request'](_0x328e('0x1'),{'body':_0x8a71da,'options':{'where':{'id':_0x3aee46}},'log':_0x328e('0x2')});};exports[_0x328e('0x3')]=function(_0x5cec93,_0x1752fc){return client[_0x328e('0x4')](_0x328e('0x5'),{'body':_0x1752fc,'options':{'where':{'id':_0x5cec93}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0xdbdc=['Request','AddTagsToOpenchannelInteraction','../client','update','UpdateOpenchannelInteraction','addTags'];(function(_0x1e7f71,_0x5b2061){var _0x12bbaf=function(_0x56972a){while(--_0x56972a){_0x1e7f71['push'](_0x1e7f71['shift']());}};_0x12bbaf(++_0x5b2061);}(_0xdbdc,0x1e2));var _0xcdbd=function(_0x21f4a2,_0x40df15){_0x21f4a2=_0x21f4a2-0x0;var _0x14c216=_0xdbdc[_0x21f4a2];return _0x14c216;};'use strict';var client=require(_0xcdbd('0x0'));exports[_0xcdbd('0x1')]=function(_0x39b4c5,_0x4ee827){return client['Request'](_0xcdbd('0x2'),{'body':_0x4ee827,'options':{'where':{'id':_0x39b4c5}},'log':'updateOpenchannelInteraction'});};exports[_0xcdbd('0x3')]=function(_0x463e4f,_0x2b2dd4){return client[_0xcdbd('0x4')](_0xcdbd('0x5'),{'body':_0x2b2dd4,'options':{'where':{'id':_0x463e4f}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index b9ea0bd..35bf3e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../client','create','createOpenchannelMessage'];(function(_0x51c2bc,_0x23adc6){var _0x1cbd2b=function(_0x2cc826){while(--_0x2cc826){_0x51c2bc['push'](_0x51c2bc['shift']());}};_0x1cbd2b(++_0x23adc6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return client['Request']('CreateOpenchannelMessage',{'body':_0x29929c,'log':_0x0a9e('0x2')});};
\ No newline at end of file
+var _0xe706=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x3f132a,_0x359822){var _0x224a39=function(_0x5c44df){while(--_0x5c44df){_0x3f132a['push'](_0x3f132a['shift']());}};_0x224a39(++_0x359822);}(_0xe706,0xa3));var _0x6e70=function(_0x333798,_0x9f6561){_0x333798=_0x333798-0x0;var _0x389f4e=_0xe706[_0x333798];return _0x389f4e;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(_0x311951){return client['Request'](_0x6e70('0x2'),{'body':_0x311951,'log':_0x6e70('0x3')});};
\ No newline at end of file
index 6a0b26c..df939d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cbd=['online','openchannelPause','getOpenchannelQueues','name','strategy','Agents'];(function(_0x293e7a,_0x1792a2){var _0xb78342=function(_0x833afe){while(--_0x833afe){_0x293e7a['push'](_0x293e7a['shift']());}};_0xb78342(++_0x1792a2);}(_0x7cbd,0x68));var _0xd7cb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7cbd[_0x501510];return _0x1e6ee5;};'use strict';var client=require('../client');exports[_0xd7cb('0x0')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xd7cb('0x1'),'timeout',_0xd7cb('0x2')],'include':[{'model':'User','as':_0xd7cb('0x3'),'attributes':['id',_0xd7cb('0x1'),_0xd7cb('0x4'),_0xd7cb('0x5')]}]},'log':_0xd7cb('0x0')});};};
\ No newline at end of file
+var _0x49c1=['GetOpenchannelQueue','timeout','strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0x49c1,0x102));var _0x149c=function(_0x196fdf,_0x2bda91){_0x196fdf=_0x196fdf-0x0;var _0x3971b3=_0x49c1[_0x196fdf];return _0x3971b3;};'use strict';var client=require(_0x149c('0x0'));exports[_0x149c('0x1')]=function(){return function(){return client[_0x149c('0x2')](_0x149c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x149c('0x4'),_0x149c('0x5')],'include':[{'model':_0x149c('0x6'),'as':_0x149c('0x7'),'attributes':['id','name','online',_0x149c('0x8')]}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
index d0e98c7..d230871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8137=['Request','CreateOpenchannelQueueReport','update','../client','create'];(function(_0x387319,_0x2ec32e){var _0x44a9e4=function(_0x291f16){while(--_0x291f16){_0x387319['push'](_0x387319['shift']());}};_0x44a9e4(++_0x2ec32e);}(_0x8137,0x116));var _0x7813=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x8137[_0x1cc8fe];return _0x230054;};'use strict';var client=require(_0x7813('0x0'));exports[_0x7813('0x1')]=function(_0x2091ba){return client[_0x7813('0x2')](_0x7813('0x3'),{'body':_0x2091ba,'log':_0x7813('0x3')});};exports[_0x7813('0x4')]=function(_0x469bd2,_0xc6db5b){return client[_0x7813('0x2')]('UpdateOpenchannelQueueReport',{'body':_0xc6db5b,'options':{'where':{'uniqueid':_0x469bd2},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
+var _0x58a5=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x1bcf44,_0xd42f10){var _0x510ad=function(_0x1c7a2a){while(--_0x1c7a2a){_0x1bcf44['push'](_0x1bcf44['shift']());}};_0x510ad(++_0xd42f10);}(_0x58a5,0xb2));var _0x558a=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x58a5[_0x4709c8];return _0x478cdd;};'use strict';var client=require(_0x558a('0x0'));exports[_0x558a('0x1')]=function(_0x4c4675){return client[_0x558a('0x2')](_0x558a('0x3'),{'body':_0x4c4675,'log':'CreateOpenchannelQueueReport'});};exports[_0x558a('0x4')]=function(_0x225905,_0xfde2cf){return client[_0x558a('0x2')](_0x558a('0x5'),{'body':_0xfde2cf,'options':{'where':{'uniqueid':_0x225905},'order':[['id',_0x558a('0x6')]],'limit':0x1},'log':_0x558a('0x5')});};
\ No newline at end of file
index acaf62a..5ad7762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d80=['addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x26ab67,_0x2ebf81){var _0x8659fd=function(_0x5399fc){while(--_0x5399fc){_0x26ab67['push'](_0x26ab67['shift']());}};_0x8659fd(++_0x2ebf81);}(_0x1d80,0xaf));var _0x01d8=function(_0x33da17,_0x52adca){_0x33da17=_0x33da17-0x0;var _0x1a557a=_0x1d80[_0x33da17];return _0x1a557a;};'use strict';var client=require(_0x01d8('0x0'));exports[_0x01d8('0x1')]=function(_0x4eb66c,_0x58f769){return client['Request'](_0x01d8('0x2'),{'body':_0x58f769,'options':{'where':{'id':_0x4eb66c}},'log':'updateSmsInteraction'});};exports[_0x01d8('0x3')]=function(_0x1eadc8,_0x4026f7){return client['Request'](_0x01d8('0x4'),{'body':_0x4026f7,'options':{'where':{'id':_0x1eadc8}},'log':_0x01d8('0x5')});};
\ No newline at end of file
+var _0xfc33=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x1bcc3c,_0x42cb08){var _0x164ec6=function(_0x444750){while(--_0x444750){_0x1bcc3c['push'](_0x1bcc3c['shift']());}};_0x164ec6(++_0x42cb08);}(_0xfc33,0xf0));var _0x3fc3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfc33[_0x413feb];return _0x40ee88;};'use strict';var client=require(_0x3fc3('0x0'));exports[_0x3fc3('0x1')]=function(_0x339477,_0x36e50b){return client[_0x3fc3('0x2')](_0x3fc3('0x3'),{'body':_0x36e50b,'options':{'where':{'id':_0x339477}},'log':_0x3fc3('0x4')});};exports[_0x3fc3('0x5')]=function(_0x5d3a5d,_0x17e7dc){return client[_0x3fc3('0x2')](_0x3fc3('0x6'),{'body':_0x17e7dc,'options':{'where':{'id':_0x5d3a5d}},'log':_0x3fc3('0x7')});};
\ No newline at end of file
index 31f6a0f..685eba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d34=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x2713ee,_0x5d4fe2){var _0x2182f7=function(_0x275194){while(--_0x275194){_0x2713ee['push'](_0x2713ee['shift']());}};_0x2182f7(++_0x5d4fe2);}(_0x9d34,0x16c));var _0x49d3=function(_0x1c5feb,_0x3d9b3b){_0x1c5feb=_0x1c5feb-0x0;var _0x534222=_0x9d34[_0x1c5feb];return _0x534222;};'use strict';var client=require(_0x49d3('0x0'));exports[_0x49d3('0x1')]=function(_0x95c482){return client['Request'](_0x49d3('0x2'),{'body':_0x95c482,'log':_0x49d3('0x3')});};
\ No newline at end of file
+var _0x8fe0=['createSmsMessage'];(function(_0x532375,_0x7792d7){var _0x5c8544=function(_0x3c4d48){while(--_0x3c4d48){_0x532375['push'](_0x532375['shift']());}};_0x5c8544(++_0x7792d7);}(_0x8fe0,0xdd));var _0x08fe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fe0[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require('../client');exports['create']=function(_0x361b45){return client['Request']('CreateSmsMessage',{'body':_0x361b45,'log':_0x08fe('0x0')});};
\ No newline at end of file
index 97c8e53..fea3933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd69e=['Request','name','timeout','online','../client','getSmsQueues'];(function(_0x1417c6,_0x194309){var _0x44db97=function(_0xa2a293){while(--_0xa2a293){_0x1417c6['push'](_0x1417c6['shift']());}};_0x44db97(++_0x194309);}(_0xd69e,0xa0));var _0xed69=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd69e[_0x4c12ec];return _0x3ae42c;};'use strict';var client=require(_0xed69('0x0'));exports[_0xed69('0x1')]=function(){return function(){return client[_0xed69('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0xed69('0x3'),_0xed69('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0xed69('0x5'),'smsPause']}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0x54af=['getSmsQueues','../client','GetSmsQueue','name','timeout','strategy','User','Agents','online','smsPause'];(function(_0x170a9f,_0x5ecb4a){var _0x9be5af=function(_0x28c2d6){while(--_0x28c2d6){_0x170a9f['push'](_0x170a9f['shift']());}};_0x9be5af(++_0x5ecb4a);}(_0x54af,0xd3));var _0xf54a=function(_0x2c8bae,_0x211c65){_0x2c8bae=_0x2c8bae-0x0;var _0x28b59e=_0x54af[_0x2c8bae];return _0x28b59e;};'use strict';var client=require(_0xf54a('0x0'));exports['getSmsQueues']=function(){return function(){return client['Request'](_0xf54a('0x1'),{'options':{'raw':![],'attributes':['id',_0xf54a('0x2'),_0xf54a('0x3'),_0xf54a('0x4')],'include':[{'model':_0xf54a('0x5'),'as':_0xf54a('0x6'),'attributes':['id',_0xf54a('0x2'),_0xf54a('0x7'),_0xf54a('0x8')]}]},'log':_0xf54a('0x9')});};};
\ No newline at end of file
index ed179ae..be17205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a1b=['Request','UpdateSmsQueueReport','../client','CreateSmsQueueReport','update'];(function(_0xe9de28,_0x547dbc){var _0x2d4bfa=function(_0x5b8e85){while(--_0x5b8e85){_0xe9de28['push'](_0xe9de28['shift']());}};_0x2d4bfa(++_0x547dbc);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x5b8abc,_0x34c9e7){_0x5b8abc=_0x5b8abc-0x0;var _0x68eaa7=_0x9a1b[_0x5b8abc];return _0x68eaa7;};'use strict';var client=require(_0xb9a1('0x0'));exports['create']=function(_0x592bbe){return client['Request'](_0xb9a1('0x1'),{'body':_0x592bbe,'log':_0xb9a1('0x1')});};exports[_0xb9a1('0x2')]=function(_0x3d8773,_0x5b5b1f){return client[_0xb9a1('0x3')](_0xb9a1('0x4'),{'body':_0x5b5b1f,'options':{'where':{'uniqueid':_0x3d8773},'order':[['id','DESC']],'limit':0x1},'log':_0xb9a1('0x4')});};
\ No newline at end of file
+var _0xa3f8=['update','UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport'];(function(_0x2add84,_0x44006d){var _0xdef1a7=function(_0x234180){while(--_0x234180){_0x2add84['push'](_0x2add84['shift']());}};_0xdef1a7(++_0x44006d);}(_0xa3f8,0x1f4));var _0x8a3f=function(_0x361422,_0xa27d1e){_0x361422=_0x361422-0x0;var _0x2daa43=_0xa3f8[_0x361422];return _0x2daa43;};'use strict';var client=require(_0x8a3f('0x0'));exports[_0x8a3f('0x1')]=function(_0x54371d){return client[_0x8a3f('0x2')](_0x8a3f('0x3'),{'body':_0x54371d,'log':_0x8a3f('0x3')});};exports[_0x8a3f('0x4')]=function(_0x5d9346,_0x219980){return client[_0x8a3f('0x2')](_0x8a3f('0x5'),{'body':_0x219980,'options':{'where':{'uniqueid':_0x5d9346},'order':[['id',_0x8a3f('0x6')]],'limit':0x1},'log':_0x8a3f('0x5')});};
\ No newline at end of file
index 0f04e45..ea7c3fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb252=['faxPause','smsPause','openchannelPause','smsCapacity','getAgents','../client','Request','GetUser','online','pauseType','voicePause','chatPause','mailPause'];(function(_0x26bafe,_0x13e506){var _0x307879=function(_0x5a1548){while(--_0x5a1548){_0x26bafe['push'](_0x26bafe['shift']());}};_0x307879(++_0x13e506);}(_0xb252,0x198));var _0x2b25=function(_0x453194,_0x57fca4){_0x453194=_0x453194-0x0;var _0x4461b5=_0xb252[_0x453194];return _0x4461b5;};'use strict';var client=require(_0x2b25('0x0'));exports['getAgents']=function(){return function(){return client[_0x2b25('0x1')](_0x2b25('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id','name',_0x2b25('0x3'),_0x2b25('0x4'),'lastPauseAt',_0x2b25('0x5'),_0x2b25('0x6'),_0x2b25('0x7'),_0x2b25('0x8'),_0x2b25('0x9'),_0x2b25('0xa'),'chatCapacity','mailCapacity','faxCapacity',_0x2b25('0xb'),'openchannelCapacity']},'log':_0x2b25('0xc')});};};
\ No newline at end of file
+var _0x25b3=['mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','GetUser','agent','name','online','pauseType','lastPauseAt','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x25b3,0x1df));var _0x325b=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x25b3[_0x2a8c21];return _0x5f3061;};'use strict';var client=require('../client');exports[_0x325b('0x0')]=function(){return function(){return client[_0x325b('0x1')](_0x325b('0x2'),{'options':{'raw':!![],'where':{'role':_0x325b('0x3')},'attributes':['id',_0x325b('0x4'),_0x325b('0x5'),_0x325b('0x6'),_0x325b('0x7'),_0x325b('0x8'),_0x325b('0x9'),_0x325b('0xa'),_0x325b('0xb'),_0x325b('0xc'),_0x325b('0xd'),_0x325b('0xe'),_0x325b('0xf'),_0x325b('0x10'),_0x325b('0x11'),_0x325b('0x12')]},'log':'getAgents'});};};
\ No newline at end of file
index d4cbd28..5155072 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c2=['join','stop','find','agents','atimeout','channel','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map'];(function(_0x1e9521,_0x396374){var _0x2106f2=function(_0xa3758a){while(--_0xa3758a){_0x1e9521['push'](_0x1e9521['shift']());}};_0x2106f2(++_0x396374);}(_0xe0c2,0xd7));var _0x2e0c=function(_0x4cff96,_0x584782){_0x4cff96=_0x4cff96-0x0;var _0x39dd96=_0xe0c2[_0x4cff96];return _0x39dd96;};'use strict';var schema=require(_0x2e0c('0x0'));var _=require(_0x2e0c('0x1'));var util=require(_0x2e0c('0x2'));var seqqueue=require(_0x2e0c('0x3'));var logger=require('../../../../config/logger')(_0x2e0c('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x2e0c('0x5')},'timeout':{'type':_0x2e0c('0x6'),'message':_0x2e0c('0x7')}});function writeLog(_0x45d592,_0x40a5ff,_0x15c4d4){return logger[_0x2e0c('0x8')](util[_0x2e0c('0x9')](_0x2e0c('0xa'),_0x45d592,_0x40a5ff[_0x2e0c('0xb')],_0x15c4d4));}function handleFindAgent(_0x5d4fef){return function(_0x2381ca){return _0x2381ca[_0x2e0c('0xb')][_0x2e0c('0xc')]()===_0x5d4fef[_0x2e0c('0xc')]();};}exports[_0x2e0c('0xd')]=function(_0x3a84dd,_0x304d4f,_0x2b858c,_0x3c7378){return function(_0x1a0e95){try{var _0x328f03={'name':_0x304d4f[0x0],'timeout':_0x304d4f[0x1]};var _0x59a87e=queue[_0x2e0c('0x0')](_0x328f03,{'typecast':!![]});if(_0x59a87e['length']){logger['error'](_0x2e0c('0xe'),_0x3a84dd,_[_0x2e0c('0xf')](_0x59a87e,'message')[_0x2e0c('0x10')](',\x20'));_0x1a0e95[_0x2e0c('0x11')]();}else{var _0x524619=_[_0x2e0c('0x12')](_0x2b858c[_0x2e0c('0x13')],handleFindAgent(_0x328f03[_0x2e0c('0xb')]));if(_0x524619){var _0x5d23ec=(_0x328f03['timeout']||0xa)*0x3e8;var _0x91310d,_0x368c6d;var _0x9d2f17=seqqueue['createQueue'](_0x5d23ec);_0x9d2f17['id']=_0x3a84dd;_0x9d2f17[_0x2e0c('0x14')]=_0x5d23ec;_0x9d2f17[_0x2e0c('0x15')]=_0x3c7378[_0x2e0c('0x15')];writeLog(_0x3a84dd,_0x524619,util['format']('START:%s',_0x5d23ec));_0x2b858c[_0x2e0c('0x16')][_0x3a84dd]['on'](_0x2e0c('0x17'),function(){_0x9d2f17[_0x2e0c('0x18')]();clearTimeout(_0x368c6d);_0x368c6d=undefined;if(_0x2b858c[_0x2e0c('0x16')][_0x3a84dd]){delete _0x2b858c[_0x2e0c('0x16')][_0x3a84dd];}logger[_0x2e0c('0x8')](_0x2e0c('0x19'),_0x3a84dd);_0x1a0e95[_0x2e0c('0x11')]();});_0x368c6d=setTimeout(function(){clearTimeout(_0x368c6d);_0x9d2f17[_0x2e0c('0x18')]();logger[_0x2e0c('0x8')](_0x2e0c('0x1a'),_0x3a84dd);_0x1a0e95[_0x2e0c('0x1b')]();},_0x5d23ec);strategy[_0x2e0c('0x1c')](_0x9d2f17,_0x524619,_0x2b858c,_0x3c7378);}else{logger[_0x2e0c('0x1d')](_0x2e0c('0x1e'),_0x3a84dd,_0x328f03[_0x2e0c('0xb')]);_0x1a0e95[_0x2e0c('0x11')]();}}}catch(_0x1a779a){console[_0x2e0c('0x1f')](_0x1a779a);logger[_0x2e0c('0x1d')]('[%s][QUEUE]\x20%s',_0x3a84dd,_0x1a779a[_0x2e0c('0x20')]);_0x1a0e95[_0x2e0c('0x11')]();}};};
\ No newline at end of file
+var _0x04bb=['log','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','map','message','join','find','agents','timeout','channel','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','[%s][AGENT]\x20ROUTING\x20END','agent'];(function(_0x5e07a7,_0x1438b3){var _0x22ced5=function(_0x7c975b){while(--_0x7c975b){_0x5e07a7['push'](_0x5e07a7['shift']());}};_0x22ced5(++_0x1438b3);}(_0x04bb,0x12d));var _0xb04b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04bb[_0x20a584];return _0x4b41a8;};'use strict';var schema=require('validate');var _=require(_0xb04b('0x0'));var util=require('util');var seqqueue=require(_0xb04b('0x1'));var logger=require(_0xb04b('0x2'))(_0xb04b('0x3'));var strategy=require(_0xb04b('0x4'));var queue=schema({'name':{'type':_0xb04b('0x5'),'required':!![],'message':_0xb04b('0x6')},'timeout':{'type':_0xb04b('0x7'),'message':_0xb04b('0x8')}});function writeLog(_0x2b44a0,_0xe0773a,_0x7eb5ff){return logger[_0xb04b('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2b44a0,_0xe0773a[_0xb04b('0xa')],_0x7eb5ff));}function handleFindAgent(_0x2c203a){return function(_0x553931){return _0x553931['name'][_0xb04b('0xb')]()===_0x2c203a[_0xb04b('0xb')]();};}exports[_0xb04b('0xc')]=function(_0x203d29,_0x3c6b96,_0x13baab,_0x4ce754){return function(_0x2607f3){try{var _0x3190aa={'name':_0x3c6b96[0x0],'timeout':_0x3c6b96[0x1]};var _0x1a58e9=queue['validate'](_0x3190aa,{'typecast':!![]});if(_0x1a58e9[_0xb04b('0xd')]){logger[_0xb04b('0xe')]('[%s][AGENT]\x20%s',_0x203d29,_[_0xb04b('0xf')](_0x1a58e9,_0xb04b('0x10'))[_0xb04b('0x11')](',\x20'));_0x2607f3['stop']();}else{var _0x221a86=_[_0xb04b('0x12')](_0x13baab[_0xb04b('0x13')],handleFindAgent(_0x3190aa[_0xb04b('0xa')]));if(_0x221a86){var _0x4a7673=(_0x3190aa[_0xb04b('0x14')]||0xa)*0x3e8;var _0x2f4c32,_0x4556e0;var _0xdfbea2=seqqueue['createQueue'](_0x4a7673);_0xdfbea2['id']=_0x203d29;_0xdfbea2['atimeout']=_0x4a7673;_0xdfbea2[_0xb04b('0x15')]=_0x4ce754[_0xb04b('0x15')];writeLog(_0x203d29,_0x221a86,util['format']('START:%s',_0x4a7673));_0x13baab[_0xb04b('0x16')][_0x203d29]['on'](_0xb04b('0x17'),function(){_0xdfbea2[_0xb04b('0x18')]();clearTimeout(_0x4556e0);_0x4556e0=undefined;if(_0x13baab[_0xb04b('0x16')][_0x203d29]){delete _0x13baab[_0xb04b('0x16')][_0x203d29];}logger['info'](_0xb04b('0x19'),_0x203d29);_0x2607f3[_0xb04b('0x1a')]();});_0x4556e0=setTimeout(function(){clearTimeout(_0x4556e0);_0xdfbea2[_0xb04b('0x18')]();logger[_0xb04b('0x9')](_0xb04b('0x1b'),_0x203d29);_0x2607f3['next']();},_0x4a7673);strategy[_0xb04b('0x1c')](_0xdfbea2,_0x221a86,_0x13baab,_0x4ce754);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x203d29,_0x3190aa[_0xb04b('0xa')]);_0x2607f3[_0xb04b('0x1a')]();}}}catch(_0x342644){console[_0xb04b('0x1d')](_0x342644);logger[_0xb04b('0xe')]('[%s][QUEUE]\x20%s',_0x203d29,_0x342644['stack']);_0x2607f3['stop']();}};};
\ No newline at end of file
index c5e2d7a..676ff12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5e5=['interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','created','isEmpty','body','Message','create','then','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','$LATEST','message','postText','next','amazonlex','dialogState','Failed','stringify','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','isNil'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd5e5,0x69));var _0x5d5e=function(_0x1d8e9d,_0x36cd1d){_0x1d8e9d=_0x1d8e9d-0x0;var _0x49a99d=_0xd5e5[_0x1d8e9d];return _0x49a99d;};'use strict';var _=require(_0x5d5e('0x0'));var moment=require(_0x5d5e('0x1'));var AWS=require(_0x5d5e('0x2'));var utils=require('./utils');var logger=require(_0x5d5e('0x3'))(_0x5d5e('0x4'));var rpc={'chatMessage':require(_0x5d5e('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5d5e('0x6')),'smsMessage':require(_0x5d5e('0x7')),'faxMessage':require('../../rpc/faxMessage')};exports['consequence']=function(_0x9dc684,_0x3a674e){return function(_0x212272){try{if(!_[_0x5d5e('0x8')](this[_0x5d5e('0x9')][_0x5d5e('0xa')])){logger[_0x5d5e('0xb')](_0x5d5e('0xc'),_0x9dc684,_0x5d5e('0xd'));return _0x212272['next']();}var _0x538b55={'ContactId':this[_0x5d5e('0xe')]['id'],'sentAt':moment()['format'](_0x5d5e('0xf')),'direction':_0x5d5e('0x10')};var _0x16dda7=this[_0x5d5e('0x11')];if(_0x16dda7===_0x5d5e('0x12')){_0x538b55['ChatWebsiteId']=this[_0x5d5e('0x13')]['id'];}else{_0x538b55[_['upperFirst'](_0x16dda7)+'AccountId']=this[_0x5d5e('0x13')]['id'];}_0x538b55[_[_0x5d5e('0x14')](_0x16dda7)+'InteractionId']=this[_0x5d5e('0x9')]['id'];if(this['interaction'][_0x5d5e('0x15')]){var _0x4cecf7=_0x3a674e[0x4];if(!_[_0x5d5e('0x16')](_0x4cecf7)){_0x538b55[_0x5d5e('0x17')]=utils['getMustacheRender'](_0x4cecf7,this);return rpc[_0x16dda7+_0x5d5e('0x18')][_0x5d5e('0x19')](_0x538b55)[_0x5d5e('0x1a')](function(_0x2a2665){logger[_0x5d5e('0xb')]('[%s][AMAZONLEX]\x20%s',_0x9dc684,_0x538b55[_0x5d5e('0x17')]);})['catch'](function(_0x5b2da7){logger[_0x5d5e('0x1b')](_0x5d5e('0xc'),_0x9dc684,JSON['stringify'](_0x5b2da7));})['finally'](function(){logger['info'](_0x5d5e('0x1c'),_0x9dc684);_0x212272[_0x5d5e('0x1d')]();});}else{logger[_0x5d5e('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x9dc684);_0x212272[_0x5d5e('0x1d')]();}}else{var _0x26da36=this;var _0x5d3a40=new AWS['LexRuntime']({'accessKeyId':_0x3a674e[0x0],'secretAccessKey':_0x3a674e[0x1],'region':_0x3a674e[0x2]});var _0x360c82={'botAlias':_0x5d5e('0x1e'),'botName':_0x3a674e[0x3],'inputText':this[_0x5d5e('0x1f')][_0x5d5e('0x17')],'userId':this[_0x5d5e('0x9')]['id']['toString']()};_0x5d3a40[_0x5d5e('0x20')](_0x360c82,function(_0x6e5923,_0x4f1226){if(_0x6e5923){logger[_0x5d5e('0x1b')](_0x5d5e('0xc'),_0x9dc684,_0x6e5923['message']);_0x212272[_0x5d5e('0x21')]();}else if(_0x4f1226&&_0x4f1226['message']){_0x26da36[_0x5d5e('0x17')][_0x5d5e('0x22')]=_0x4f1226;_0x538b55[_0x5d5e('0x17')]=_0x4f1226[_0x5d5e('0x1f')];return rpc[_0x16dda7+'Message'][_0x5d5e('0x19')](_0x538b55)['then'](function(_0x369643){logger[_0x5d5e('0xb')](_0x5d5e('0xc'),_0x9dc684,_0x538b55[_0x5d5e('0x17')]);if(_0x4f1226[_0x5d5e('0x23')]==_0x5d5e('0x24')){_0x212272[_0x5d5e('0x21')]();}else{_0x212272[_0x5d5e('0x1d')]();}})['catch'](function(_0xf7e67f){logger[_0x5d5e('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x9dc684,JSON[_0x5d5e('0x25')](_0xf7e67f));_0x212272[_0x5d5e('0x21')]();});}else{_0x212272['next']();}});}}catch(_0x2fd27d){logger[_0x5d5e('0x1b')](_0x5d5e('0xc'),_0x9dc684,JSON[_0x5d5e('0x25')](_0x2fd27d));_0x212272[_0x5d5e('0x1d')]();}};};
\ No newline at end of file
+var _0xbfe9=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString','postText','amazonlex','dialogState','Failed','moment','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','ChatWebsiteId','upperFirst','AccountId','account','created','body','Message','create','then','catch','error','stringify'];(function(_0x3f59b1,_0x25cdbe){var _0x11d2e8=function(_0x37b3fc){while(--_0x37b3fc){_0x3f59b1['push'](_0x3f59b1['shift']());}};_0x11d2e8(++_0x25cdbe);}(_0xbfe9,0x1c2));var _0x9bfe=function(_0x4e6e50,_0x45fa89){_0x4e6e50=_0x4e6e50-0x0;var _0x424e41=_0xbfe9[_0x4e6e50];return _0x424e41;};'use strict';var _=require('lodash');var moment=require(_0x9bfe('0x0'));var AWS=require('aws-sdk');var utils=require(_0x9bfe('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9bfe('0x2')),'mailMessage':require(_0x9bfe('0x3')),'smsMessage':require(_0x9bfe('0x4')),'faxMessage':require(_0x9bfe('0x5'))};exports[_0x9bfe('0x6')]=function(_0x4d145f,_0x2e1f89){return function(_0xfb366){try{if(!_[_0x9bfe('0x7')](this[_0x9bfe('0x8')][_0x9bfe('0x9')])){logger[_0x9bfe('0xa')](_0x9bfe('0xb'),_0x4d145f,_0x9bfe('0xc'));return _0xfb366[_0x9bfe('0xd')]();}var _0x113dd6={'ContactId':this[_0x9bfe('0xe')]['id'],'sentAt':moment()[_0x9bfe('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x9bfe('0x10')};var _0x1b2cf2=this[_0x9bfe('0x11')];if(_0x1b2cf2==='chat'){_0x113dd6[_0x9bfe('0x12')]=this['account']['id'];}else{_0x113dd6[_[_0x9bfe('0x13')](_0x1b2cf2)+_0x9bfe('0x14')]=this[_0x9bfe('0x15')]['id'];}_0x113dd6[_[_0x9bfe('0x13')](_0x1b2cf2)+'InteractionId']=this['interaction']['id'];if(this[_0x9bfe('0x8')][_0x9bfe('0x16')]){var _0x12ba67=_0x2e1f89[0x4];if(!_['isEmpty'](_0x12ba67)){_0x113dd6[_0x9bfe('0x17')]=utils['getMustacheRender'](_0x12ba67,this);return rpc[_0x1b2cf2+_0x9bfe('0x18')][_0x9bfe('0x19')](_0x113dd6)[_0x9bfe('0x1a')](function(_0x38489f){logger['info'](_0x9bfe('0xb'),_0x4d145f,_0x113dd6[_0x9bfe('0x17')]);})[_0x9bfe('0x1b')](function(_0x4ea74a){logger[_0x9bfe('0x1c')](_0x9bfe('0xb'),_0x4d145f,JSON[_0x9bfe('0x1d')](_0x4ea74a));})['finally'](function(){logger[_0x9bfe('0xa')](_0x9bfe('0x1e'),_0x4d145f);_0xfb366[_0x9bfe('0x1f')]();});}else{logger[_0x9bfe('0xa')](_0x9bfe('0x20'),_0x4d145f);_0xfb366[_0x9bfe('0x1f')]();}}else{var _0x28ce5f=this;var _0x35e34c=new AWS[(_0x9bfe('0x21'))]({'accessKeyId':_0x2e1f89[0x0],'secretAccessKey':_0x2e1f89[0x1],'region':_0x2e1f89[0x2]});var _0x49624a={'botAlias':'$LATEST','botName':_0x2e1f89[0x3],'inputText':this[_0x9bfe('0x22')][_0x9bfe('0x17')],'userId':this['interaction']['id'][_0x9bfe('0x23')]()};_0x35e34c[_0x9bfe('0x24')](_0x49624a,function(_0x322b7b,_0x22d5b8){if(_0x322b7b){logger[_0x9bfe('0x1c')](_0x9bfe('0xb'),_0x4d145f,_0x322b7b[_0x9bfe('0x22')]);_0xfb366[_0x9bfe('0xd')]();}else if(_0x22d5b8&&_0x22d5b8[_0x9bfe('0x22')]){_0x28ce5f['body'][_0x9bfe('0x25')]=_0x22d5b8;_0x113dd6[_0x9bfe('0x17')]=_0x22d5b8[_0x9bfe('0x22')];return rpc[_0x1b2cf2+'Message']['create'](_0x113dd6)['then'](function(_0x5bff4d){logger[_0x9bfe('0xa')](_0x9bfe('0xb'),_0x4d145f,_0x113dd6[_0x9bfe('0x17')]);if(_0x22d5b8[_0x9bfe('0x26')]==_0x9bfe('0x27')){_0xfb366[_0x9bfe('0xd')]();}else{_0xfb366[_0x9bfe('0x1f')]();}})[_0x9bfe('0x1b')](function(_0xa13d90){logger['error'](_0x9bfe('0xb'),_0x4d145f,JSON['stringify'](_0xa13d90));_0xfb366[_0x9bfe('0xd')]();});}else{_0xfb366[_0x9bfe('0xd')]();}});}}catch(_0xd1f1e1){logger[_0x9bfe('0x1c')](_0x9bfe('0xb'),_0x4d145f,JSON['stringify'](_0xd1f1e1));_0xfb366[_0x9bfe('0x1f')]();}};};
\ No newline at end of file
index 9c04759..da83354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0x576b97,_0x3c61fe){var _0x1d7e5c=function(_0x567639){while(--_0x567639){_0x576b97['push'](_0x576b97['shift']());}};_0x1d7e5c(++_0x3c61fe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};};
\ No newline at end of file
+var _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div','</div>','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x45e28a,_0x2741f0){var _0x19fc9c=function(_0x1a5d9a){while(--_0x1a5d9a){_0x45e28a['push'](_0x45e28a['shift']());}};_0x19fc9c(++_0x2741f0);}(_0x70e0,0x17b));var _0x070e=function(_0x4fed3a,_0x2a7e9d){_0x4fed3a=_0x4fed3a-0x0;var _0x3e4d12=_0x70e0[_0x4fed3a];return _0x3e4d12;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],'<div\x20id=\x22xm-mail-content\x22',_0x070e('0x2b'))+_0x070e('0x2c');return mailRpc[_0x070e('0x2d')](_0x5b184,_0x2e3e5e)['then'](function(_0x3fa994){logger[_0x070e('0xa')](_0x070e('0x2e'),_0x46fe68);_0x2e3e5e[_0x070e('0x2f')]=_0x3fa994['message']['messageId'];return rpc[_0x49b2fb+'Message']['create'](_0x2e3e5e);})[_0x070e('0x30')](function(_0x4e0a7d){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,JSON['stringify'](_0x4e0a7d));})['catch'](function(_0x699739){logger[_0x070e('0x31')]('[RPC][%s][AUTOREPLY]\x20%s',_0x46fe68,JSON['stringify'](_0x699739));})[_0x070e('0x32')](function(){_0x56e420[_0x070e('0x33')]();});}else{return rpc[this[_0x070e('0xd')]+_0x070e('0x1e')][_0x070e('0x34')](_0x2e3e5e)['then'](function(_0x482cc2){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x2e3e5e[_0x070e('0x35')]);})[_0x070e('0x36')](function(_0xf11439){logger['error'](_0x070e('0xb'),_0x46fe68,JSON[_0x070e('0x37')](_0xf11439));})['finally'](function(){_0x56e420[_0x070e('0x33')]();});}}}catch(_0x34746e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x46fe68,JSON['stringify'](_0x34746e));_0x56e420[_0x070e('0x38')]();}};};
\ No newline at end of file
index a3446cc..6e1b25d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','update','interaction','then'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x34b7,0x196));var _0x734b=function(_0x402dfe,_0x143d24){_0x402dfe=_0x402dfe-0x0;var _0x521b9a=_0x34b7[_0x402dfe];return _0x521b9a;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x734b('0x0'));var rpc={'chatInteraction':require(_0x734b('0x1')),'openchannelInteraction':require(_0x734b('0x2')),'smsInteraction':require(_0x734b('0x3')),'mailInteraction':require(_0x734b('0x4')),'faxInteraction':require(_0x734b('0x5'))};exports['consequence']=function(_0x547652,_0x303067,_0x2fde69,_0x2f3128){return function(_0x34fd70){try{logger[_0x734b('0x6')](_0x734b('0x7'),_0x547652,_0x303067[0x0]);var _0x58e2f1={'closed':0x1,'closedAt':moment()[_0x734b('0x8')](_0x734b('0x9')),'closeReason':'system','disposition':_0x303067[0x0]};if(rpc[_0x2f3128['channel']+'Interaction']){rpc[_0x2f3128[_0x734b('0xa')]+'Interaction'][_0x734b('0xb')](_0x2f3128[_0x734b('0xc')]['id'],_0x58e2f1)[_0x734b('0xd')](function(_0x222dc7){logger[_0x734b('0x6')](_0x734b('0xe'),_0x547652,_0x2f3128[_0x734b('0xc')]['id']);})[_0x734b('0xf')](function(_0x257657){logger[_0x734b('0x10')](_0x734b('0x11'),_0x547652,JSON[_0x734b('0x12')](_0x257657));})[_0x734b('0x13')](function(){_0x34fd70[_0x734b('0x14')]();});}}catch(_0x5a5613){logger[_0x734b('0x10')](_0x734b('0x11'),_0x547652,JSON[_0x734b('0x12')](_0x5a5613));_0x34fd70[_0x734b('0x14')]();}};};
\ No newline at end of file
+var _0x2f3a=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','info','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment'];(function(_0x382697,_0x26775e){var _0x51c523=function(_0x5dc923){while(--_0x5dc923){_0x382697['push'](_0x382697['shift']());}};_0x51c523(++_0x26775e);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x559b7d,_0x56501e){_0x559b7d=_0x559b7d-0x0;var _0x44a1e9=_0x2f3a[_0x559b7d];return _0x44a1e9;};'use strict';var moment=require(_0xa2f3('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0xa2f3('0x1')),'openchannelInteraction':require(_0xa2f3('0x2')),'smsInteraction':require(_0xa2f3('0x3')),'mailInteraction':require(_0xa2f3('0x4')),'faxInteraction':require(_0xa2f3('0x5'))};exports[_0xa2f3('0x6')]=function(_0x50ef95,_0x78edcd,_0x589d0f,_0xfe0b09){return function(_0x1ddec0){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x50ef95,_0x78edcd[0x0]);var _0x2faf36={'closed':0x1,'closedAt':moment()[_0xa2f3('0x7')](_0xa2f3('0x8')),'closeReason':_0xa2f3('0x9'),'disposition':_0x78edcd[0x0]};if(rpc[_0xfe0b09['channel']+_0xa2f3('0xa')]){rpc[_0xfe0b09[_0xa2f3('0xb')]+_0xa2f3('0xa')][_0xa2f3('0xc')](_0xfe0b09[_0xa2f3('0xd')]['id'],_0x2faf36)['then'](function(_0x2ab59a){logger[_0xa2f3('0xe')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x50ef95,_0xfe0b09[_0xa2f3('0xd')]['id']);})[_0xa2f3('0xf')](function(_0x36cfa9){logger['error'](_0xa2f3('0x10'),_0x50ef95,JSON[_0xa2f3('0x11')](_0x36cfa9));})[_0xa2f3('0x12')](function(){_0x1ddec0[_0xa2f3('0x13')]();});}}catch(_0x2ca53d){logger[_0xa2f3('0x14')](_0xa2f3('0x10'),_0x50ef95,JSON[_0xa2f3('0x11')](_0x2ca53d));_0x1ddec0[_0xa2f3('0x13')]();}};};
\ No newline at end of file
index 030005d..afa0206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8827=['textRequest','message','dialogflow','result','fulfillment','speech','Message','endConversation','next','lodash','moment','apiai-promise','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','create','then','body','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x8827,0x1a7));var _0x7882=function(_0x1be04f,_0x57f528){_0x1be04f=_0x1be04f-0x0;var _0x516965=_0x8827[_0x1be04f];return _0x516965;};'use strict';var _=require(_0x7882('0x0'));var moment=require(_0x7882('0x1'));var apiai=require(_0x7882('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x7882('0x3'))(_0x7882('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7882('0x5')),'mailMessage':require(_0x7882('0x6')),'smsMessage':require(_0x7882('0x7')),'faxMessage':require(_0x7882('0x8'))};exports[_0x7882('0x9')]=function(_0x36caf3,_0x2d67e0){return function(_0x3245c3){try{if(!_[_0x7882('0xa')](this[_0x7882('0xb')][_0x7882('0xc')])){logger[_0x7882('0xd')](_0x7882('0xe'),_0x36caf3,_0x7882('0xf'));return _0x3245c3['next']();}var _0x746af8={'ContactId':this[_0x7882('0x10')]['id'],'sentAt':moment()[_0x7882('0x11')](_0x7882('0x12')),'direction':_0x7882('0x13')};var _0x10ff89=this[_0x7882('0x14')];if(_0x10ff89===_0x7882('0x15')){_0x746af8['ChatWebsiteId']=this[_0x7882('0x16')]['id'];}else{_0x746af8[_['upperFirst'](_0x10ff89)+_0x7882('0x17')]=this['account']['id'];}_0x746af8[_[_0x7882('0x18')](_0x10ff89)+_0x7882('0x19')]=this['interaction']['id'];if(this[_0x7882('0xb')][_0x7882('0x1a')]){var _0x3ede2a=_0x2d67e0[0x2];if(!_[_0x7882('0x1b')](_0x3ede2a)){_0x746af8['body']=utils[_0x7882('0x1c')](_0x3ede2a,this);return rpc[_0x10ff89+'Message'][_0x7882('0x1d')](_0x746af8)[_0x7882('0x1e')](function(_0x36bf83){logger[_0x7882('0xd')](_0x7882('0xe'),_0x36caf3,_0x746af8[_0x7882('0x1f')]);})['catch'](function(_0xef220c){logger[_0x7882('0x20')](_0x7882('0xe'),_0x36caf3,JSON[_0x7882('0x21')](_0xef220c));})['finally'](function(){logger[_0x7882('0xd')](_0x7882('0x22'),_0x36caf3);_0x3245c3[_0x7882('0x23')]();});}else{logger[_0x7882('0xd')](_0x7882('0x24'),_0x36caf3);_0x3245c3[_0x7882('0x23')]();}}else{var _0x1c9f5c=this;var _0x46cb7b=apiai(_0x2d67e0[0x0],{'language':_0x2d67e0[0x1]||'en'});return _0x46cb7b[_0x7882('0x25')](this[_0x7882('0x26')][_0x7882('0x1f')],{'sessionId':md5(this[_0x7882('0xb')]['id'])})[_0x7882('0x1e')](function(_0x550fcc){_0x1c9f5c[_0x7882('0x1f')][_0x7882('0x27')]=_0x550fcc;_0x746af8[_0x7882('0x1f')]=_0x550fcc[_0x7882('0x28')][_0x7882('0x29')][_0x7882('0x2a')];return rpc[_0x10ff89+_0x7882('0x2b')][_0x7882('0x1d')](_0x746af8)[_0x7882('0x1e')](function(_0x52ecbb){logger[_0x7882('0xd')](_0x7882('0xe'),_0x36caf3,_0x746af8['body']);if(_0x550fcc[_0x7882('0x28')]['metadata'][_0x7882('0x2c')]){_0x3245c3[_0x7882('0x2d')]();}else{_0x3245c3[_0x7882('0x23')]();}})['catch'](function(_0x4e6d63){logger['error'](_0x7882('0xe'),_0x36caf3,JSON[_0x7882('0x21')](_0x4e6d63));_0x3245c3['next']();});})['catch'](function(_0x23927f){logger[_0x7882('0x20')](_0x7882('0xe'),_0x36caf3,_0x23927f[_0x7882('0x26')]);_0x3245c3[_0x7882('0x2d')]();});}}catch(_0x2c4d71){logger['error'](_0x7882('0xe'),_0x36caf3,JSON[_0x7882('0x21')](_0x2c4d71));_0x3245c3[_0x7882('0x23')]();}};};
\ No newline at end of file
+var _0x891c=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','then','dialogflow','speech','metadata','endConversation','error','lodash','moment','apiai-promise','md5','./utils'];(function(_0x2e757e,_0x2ff0a9){var _0x5ce547=function(_0x5b0fd4){while(--_0x5b0fd4){_0x2e757e['push'](_0x2e757e['shift']());}};_0x5ce547(++_0x2ff0a9);}(_0x891c,0x1b3));var _0xc891=function(_0x46f28f,_0x1f53d8){_0x46f28f=_0x46f28f-0x0;var _0x3f986c=_0x891c[_0x46f28f];return _0x3f986c;};'use strict';var _=require(_0xc891('0x0'));var moment=require(_0xc891('0x1'));var apiai=require(_0xc891('0x2'));var md5=require(_0xc891('0x3'));var utils=require(_0xc891('0x4'));var logger=require(_0xc891('0x5'))(_0xc891('0x6'));var rpc={'chatMessage':require(_0xc891('0x7')),'openchannelMessage':require(_0xc891('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xc891('0x9')),'faxMessage':require('../../rpc/faxMessage')};exports[_0xc891('0xa')]=function(_0x4bd9c4,_0x39301e){return function(_0x4acdf1){try{if(!_[_0xc891('0xb')](this[_0xc891('0xc')]['UserId'])){logger[_0xc891('0xd')](_0xc891('0xe'),_0x4bd9c4,_0xc891('0xf'));return _0x4acdf1[_0xc891('0x10')]();}var _0x2f4b03={'ContactId':this[_0xc891('0x11')]['id'],'sentAt':moment()['format'](_0xc891('0x12')),'direction':_0xc891('0x13')};var _0x2beed5=this[_0xc891('0x14')];if(_0x2beed5===_0xc891('0x15')){_0x2f4b03['ChatWebsiteId']=this[_0xc891('0x16')]['id'];}else{_0x2f4b03[_['upperFirst'](_0x2beed5)+_0xc891('0x17')]=this[_0xc891('0x16')]['id'];}_0x2f4b03[_[_0xc891('0x18')](_0x2beed5)+_0xc891('0x19')]=this['interaction']['id'];if(this[_0xc891('0xc')][_0xc891('0x1a')]){var _0x49d4f3=_0x39301e[0x2];if(!_[_0xc891('0x1b')](_0x49d4f3)){_0x2f4b03[_0xc891('0x1c')]=utils[_0xc891('0x1d')](_0x49d4f3,this);return rpc[_0x2beed5+_0xc891('0x1e')][_0xc891('0x1f')](_0x2f4b03)['then'](function(_0x139d3d){logger[_0xc891('0xd')](_0xc891('0xe'),_0x4bd9c4,_0x2f4b03[_0xc891('0x1c')]);})[_0xc891('0x20')](function(_0x2c1d9f){logger['error'](_0xc891('0xe'),_0x4bd9c4,JSON[_0xc891('0x21')](_0x2c1d9f));})['finally'](function(){logger[_0xc891('0xd')](_0xc891('0x22'),_0x4bd9c4);_0x4acdf1[_0xc891('0x23')]();});}else{logger[_0xc891('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4bd9c4);_0x4acdf1[_0xc891('0x23')]();}}else{var _0x379204=this;var _0x5bbbb2=apiai(_0x39301e[0x0],{'language':_0x39301e[0x1]||'en'});return _0x5bbbb2[_0xc891('0x24')](this[_0xc891('0x25')][_0xc891('0x1c')],{'sessionId':md5(this['interaction']['id'])})[_0xc891('0x26')](function(_0x45bb30){_0x379204['body'][_0xc891('0x27')]=_0x45bb30;_0x2f4b03['body']=_0x45bb30['result']['fulfillment'][_0xc891('0x28')];return rpc[_0x2beed5+_0xc891('0x1e')][_0xc891('0x1f')](_0x2f4b03)['then'](function(_0x8ee265){logger['info'](_0xc891('0xe'),_0x4bd9c4,_0x2f4b03[_0xc891('0x1c')]);if(_0x45bb30['result'][_0xc891('0x29')][_0xc891('0x2a')]){_0x4acdf1[_0xc891('0x10')]();}else{_0x4acdf1[_0xc891('0x23')]();}})[_0xc891('0x20')](function(_0x1a0630){logger['error'](_0xc891('0xe'),_0x4bd9c4,JSON[_0xc891('0x21')](_0x1a0630));_0x4acdf1[_0xc891('0x10')]();});})[_0xc891('0x20')](function(_0x39efcc){logger[_0xc891('0x2b')]('[%s][DIALOGFLOW]\x20%s',_0x4bd9c4,_0x39efcc[_0xc891('0x25')]);_0x4acdf1['next']();});}}catch(_0x3ee399){logger['error'](_0xc891('0xe'),_0x4bd9c4,JSON[_0xc891('0x21')](_0x3ee399));_0x4acdf1[_0xc891('0x23')]();}};};
\ No newline at end of file
index 580ff7e..57122b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e50=['condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','join','stop'];(function(_0x9b3740,_0x33a3f0){var _0x930a0=function(_0x35023f){while(--_0x35023f){_0x9b3740['push'](_0x9b3740['shift']());}};_0x930a0(++_0x33a3f0);}(_0x9e50,0x11a));var _0x09e5=function(_0x115109,_0x156129){_0x115109=_0x115109-0x0;var _0x5e5000=_0x9e50[_0x115109];return _0x5e5000;};'use strict';var schema=require(_0x09e5('0x0'));var _=require(_0x09e5('0x1'));var htmlToText=require(_0x09e5('0x2'));var utils=require('./utils');var logger=require(_0x09e5('0x3'))(_0x09e5('0x4'));var gotoif=schema({'condition':{'type':_0x09e5('0x5'),'required':!![],'message':_0x09e5('0x6')},'priorityTrue':{'type':_0x09e5('0x7'),'message':_0x09e5('0x8')},'priorityFalse':{'type':_0x09e5('0x7'),'message':_0x09e5('0x9')}});exports['consequence']=function(_0x298a2a,_0x97a911){return function(_0x3cd9f8){try{var _0x1d71a5={'condition':htmlToText[_0x09e5('0xa')](utils[_0x09e5('0xb')](_0x97a911[0x0],this),{'wordwrap':![]})[_0x09e5('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x97a911[0x1],'priorityFalse':_0x97a911[0x2]};var _0x1679d1=gotoif[_0x09e5('0x0')](_0x1d71a5,{'typecast':!![]});if(_0x1679d1[_0x09e5('0xd')]){logger['error'](_0x09e5('0xe'),_0x298a2a,_[_0x09e5('0xf')](_0x1679d1,'message')[_0x09e5('0x10')](',\x20'));_0x3cd9f8[_0x09e5('0x11')]();}else{try{var _0x590e2a=eval('('+_0x1d71a5[_0x09e5('0x12')]+')');var _0x43de9d=_0x590e2a?_0x1d71a5[_0x09e5('0x13')]:_0x1d71a5[_0x09e5('0x14')];logger[_0x09e5('0x15')](_0x09e5('0x16'),_0x298a2a,_0x1d71a5[_0x09e5('0x12')],_0x590e2a,_0x43de9d||'next');if(_0x43de9d){var _0x29c533=_['findIndex'](_0x3cd9f8['rules'](),{'p':_0x43de9d});if(_0x29c533>=0x0){logger[_0x09e5('0x15')](_0x09e5('0x17'),_0x298a2a,_0x43de9d||_0x09e5('0x18'),_0x29c533);_0x3cd9f8[_0x09e5('0x18')](_0x29c533);}else{logger[_0x09e5('0x15')](_0x09e5('0x19'),_0x298a2a,_0x43de9d||_0x09e5('0x18'));_0x3cd9f8[_0x09e5('0x11')]();}}else{_0x3cd9f8['next']();}}catch(_0x5a9995){logger[_0x09e5('0x1a')](_0x09e5('0x1b'),_0x298a2a,_0x5a9995[_0x09e5('0x1c')]);_0x3cd9f8['stop']();}}}catch(_0xe5e9){logger[_0x09e5('0x1a')](_0x09e5('0xe'),_0x298a2a,JSON[_0x09e5('0x1d')](_0xe5e9));_0x3cd9f8['stop']();}};};
\ No newline at end of file
+var _0x6ac8=['string','number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','stop','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','html-to-text','./utils','routing'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x6ac8,0x194));var _0x86ac=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x6ac8[_0x40ac5e];return _0x2839d6;};'use strict';var schema=require(_0x86ac('0x0'));var _=require('lodash');var htmlToText=require(_0x86ac('0x1'));var utils=require(_0x86ac('0x2'));var logger=require('../../../../config/logger')(_0x86ac('0x3'));var gotoif=schema({'condition':{'type':_0x86ac('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x86ac('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x86ac('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x86ac('0x6')]=function(_0x22aa6c,_0x57270a){return function(_0x814bbd){try{var _0x475c89={'condition':htmlToText[_0x86ac('0x7')](utils['getMustacheRender'](_0x57270a[0x0],this),{'wordwrap':![]})[_0x86ac('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x57270a[0x1],'priorityFalse':_0x57270a[0x2]};var _0x35d889=gotoif[_0x86ac('0x0')](_0x475c89,{'typecast':!![]});if(_0x35d889[_0x86ac('0x9')]){logger[_0x86ac('0xa')](_0x86ac('0xb'),_0x22aa6c,_[_0x86ac('0xc')](_0x35d889,'message')['join'](',\x20'));_0x814bbd[_0x86ac('0xd')]();}else{try{var _0x1ceb5f=eval('('+_0x475c89['condition']+')');var _0x150fc0=_0x1ceb5f?_0x475c89['priorityTrue']:_0x475c89['priorityFalse'];logger['info'](_0x86ac('0xe'),_0x22aa6c,_0x475c89['condition'],_0x1ceb5f,_0x150fc0||_0x86ac('0xf'));if(_0x150fc0){var _0x31ae20=_[_0x86ac('0x10')](_0x814bbd[_0x86ac('0x11')](),{'p':_0x150fc0});if(_0x31ae20>=0x0){logger[_0x86ac('0x12')](_0x86ac('0x13'),_0x22aa6c,_0x150fc0||'next',_0x31ae20);_0x814bbd[_0x86ac('0xf')](_0x31ae20);}else{logger[_0x86ac('0x12')](_0x86ac('0x14'),_0x22aa6c,_0x150fc0||_0x86ac('0xf'));_0x814bbd[_0x86ac('0xd')]();}}else{_0x814bbd[_0x86ac('0xf')]();}}catch(_0x36b753){logger[_0x86ac('0xa')](_0x86ac('0x15'),_0x22aa6c,_0x36b753[_0x86ac('0x16')]);_0x814bbd[_0x86ac('0xd')]();}}}catch(_0x925840){logger[_0x86ac('0xa')](_0x86ac('0xb'),_0x22aa6c,JSON[_0x86ac('0x17')](_0x925840));_0x814bbd[_0x86ac('0xd')]();}};};
\ No newline at end of file
index 06da3bd..ac3c1a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedc8=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','info'];(function(_0x5a5975,_0x521bd0){var _0x1e414d=function(_0x5177ff){while(--_0x5177ff){_0x5a5975['push'](_0x5a5975['shift']());}};_0x1e414d(++_0x521bd0);}(_0xedc8,0xae));var _0x8edc=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xedc8[_0x5f309e];return _0x487b5e;};'use strict';var schema=require(_0x8edc('0x0'));var _=require(_0x8edc('0x1'));var logger=require(_0x8edc('0x2'))(_0x8edc('0x3'));var gotop=schema({'priority':{'type':_0x8edc('0x4'),'required':!![],'message':_0x8edc('0x5')}});exports['consequence']=function(_0x1da849,_0x1b07da){return function(_0x1a6fa2){try{var _0x47a034={'priority':_0x1b07da[0x0]};var _0x1a725e=gotop['validate'](_0x47a034,{'typecast':!![]});if(_0x1a725e['length']){logger[_0x8edc('0x6')](_0x8edc('0x7'),_0x1da849,_[_0x8edc('0x8')](_0x1a725e,_0x8edc('0x9'))[_0x8edc('0xa')](',\x20'));_0x1a6fa2[_0x8edc('0xb')]();}else{logger['info'](_0x8edc('0xc'),_0x1da849,_0x47a034[_0x8edc('0xd')]);if(_0x47a034[_0x8edc('0xd')]){var _0x25f3fd=_[_0x8edc('0xe')](_0x1a6fa2['rules'](),{'p':_0x47a034['priority']});if(_0x25f3fd>=0x0){logger[_0x8edc('0xf')](_0x8edc('0x10'),_0x1da849,_0x47a034[_0x8edc('0xd')]||_0x8edc('0x11'),_0x25f3fd);_0x1a6fa2[_0x8edc('0x11')](_0x25f3fd);}else{logger[_0x8edc('0xf')](_0x8edc('0x12'),_0x1da849,_0x47a034[_0x8edc('0xd')]||_0x8edc('0x11'));_0x1a6fa2[_0x8edc('0xb')]();}}else{_0x1a6fa2[_0x8edc('0x11')]();}}}catch(_0x2328dd){logger['error']('[%s][GOTOP]\x20%s',_0x1da849,JSON['stringify'](_0x2328dd));_0x1a6fa2[_0x8edc('0xb')]();}};};
\ No newline at end of file
+var _0x2901=['info','[%s][GOTOP]\x20priority\x20%s','findIndex','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','join','stop'];(function(_0x2e6fea,_0x11df0b){var _0x2ca8b8=function(_0x168ff5){while(--_0x168ff5){_0x2e6fea['push'](_0x2e6fea['shift']());}};_0x2ca8b8(++_0x11df0b);}(_0x2901,0xbf));var _0x1290=function(_0x59ea04,_0x1f0123){_0x59ea04=_0x59ea04-0x0;var _0x122dbf=_0x2901[_0x59ea04];return _0x122dbf;};'use strict';var schema=require(_0x1290('0x0'));var _=require(_0x1290('0x1'));var logger=require(_0x1290('0x2'))(_0x1290('0x3'));var gotop=schema({'priority':{'type':_0x1290('0x4'),'required':!![],'message':_0x1290('0x5')}});exports[_0x1290('0x6')]=function(_0x2b0ede,_0x3cc37b){return function(_0xb663c3){try{var _0x9744f={'priority':_0x3cc37b[0x0]};var _0x253253=gotop['validate'](_0x9744f,{'typecast':!![]});if(_0x253253['length']){logger['error']('[%s][GOTOP]\x20%s',_0x2b0ede,_['map'](_0x253253,'message')[_0x1290('0x7')](',\x20'));_0xb663c3[_0x1290('0x8')]();}else{logger[_0x1290('0x9')](_0x1290('0xa'),_0x2b0ede,_0x9744f['priority']);if(_0x9744f['priority']){var _0x175b1c=_[_0x1290('0xb')](_0xb663c3[_0x1290('0xc')](),{'p':_0x9744f[_0x1290('0xd')]});if(_0x175b1c>=0x0){logger[_0x1290('0x9')](_0x1290('0xe'),_0x2b0ede,_0x9744f[_0x1290('0xd')]||'next',_0x175b1c);_0xb663c3[_0x1290('0xf')](_0x175b1c);}else{logger[_0x1290('0x9')](_0x1290('0x10'),_0x2b0ede,_0x9744f[_0x1290('0xd')]||_0x1290('0xf'));_0xb663c3[_0x1290('0x8')]();}}else{_0xb663c3['next']();}}}catch(_0x2fcee7){logger[_0x1290('0x11')](_0x1290('0x12'),_0x2b0ede,JSON[_0x1290('0x13')](_0x2fcee7));_0xb663c3[_0x1290('0x8')]();}};};
\ No newline at end of file
index 1e587da..7b70f07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bfe=['[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','info'];(function(_0x4d911f,_0x36fe1f){var _0x3c24af=function(_0xbafccc){while(--_0xbafccc){_0x4d911f['push'](_0x4d911f['shift']());}};_0x3c24af(++_0x36fe1f);}(_0x9bfe,0x1a5));var _0xe9bf=function(_0x33b08a,_0x759704){_0x33b08a=_0x33b08a-0x0;var _0x31526b=_0x9bfe[_0x33b08a];return _0x31526b;};'use strict';var _=require(_0xe9bf('0x0'));var utils=require(_0xe9bf('0x1'));var logger=require(_0xe9bf('0x2'))(_0xe9bf('0x3'));var rpc={'chatMessage':require(_0xe9bf('0x4')),'openchannelMessage':require(_0xe9bf('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xe9bf('0x6')),'faxMessage':require(_0xe9bf('0x7'))};exports['consequence']=function(_0x37ffda,_0x528cb9){return function(_0x445818){try{var _0x241a2b={'body':utils['getMustacheRender'](_0x528cb9[0x0],this),'ContactId':this['contact']['id']};if(this[_0xe9bf('0x8')]===_0xe9bf('0x9')){_0x241a2b[_0xe9bf('0xa')]=this[_0xe9bf('0xb')]['id'];}else{_0x241a2b[_[_0xe9bf('0xc')](this[_0xe9bf('0x8')])+'AccountId']=this[_0xe9bf('0xb')]['id'];}_0x241a2b[_[_0xe9bf('0xc')](this[_0xe9bf('0x8')])+_0xe9bf('0xd')]=this['interaction']['id'];if(rpc[this[_0xe9bf('0x8')]+_0xe9bf('0xe')]){return rpc[this[_0xe9bf('0x8')]+'Message']['create'](_0x241a2b)['then'](function(_0x322966){logger[_0xe9bf('0xf')](_0xe9bf('0x10'),_0x37ffda,_0x241a2b[_0xe9bf('0x11')]);_0x445818[_0xe9bf('0x12')]();})[_0xe9bf('0x13')](function(_0x53597a){logger[_0xe9bf('0x14')](_0xe9bf('0x10'),_0x37ffda,JSON[_0xe9bf('0x15')](_0x53597a));_0x445818[_0xe9bf('0x16')]();});}}catch(_0x73c260){logger[_0xe9bf('0x14')](_0xe9bf('0x10'),_0x37ffda,JSON['stringify'](_0x73c260));_0x445818['stop']();}};};
\ No newline at end of file
+var _0x8229=['[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info'];(function(_0x1e8b99,_0x3b6518){var _0x28fe5d=function(_0xa35668){while(--_0xa35668){_0x1e8b99['push'](_0x1e8b99['shift']());}};_0x28fe5d(++_0x3b6518);}(_0x8229,0xef));var _0x9822=function(_0x327b1e,_0x5dad0f){_0x327b1e=_0x327b1e-0x0;var _0x583d2f=_0x8229[_0x327b1e];return _0x583d2f;};'use strict';var _=require('lodash');var utils=require(_0x9822('0x0'));var logger=require(_0x9822('0x1'))(_0x9822('0x2'));var rpc={'chatMessage':require(_0x9822('0x3')),'openchannelMessage':require(_0x9822('0x4')),'mailMessage':require(_0x9822('0x5')),'smsMessage':require(_0x9822('0x6')),'faxMessage':require(_0x9822('0x7'))};exports[_0x9822('0x8')]=function(_0x410342,_0x592ce7){return function(_0x12434d){try{var _0x59a619={'body':utils[_0x9822('0x9')](_0x592ce7[0x0],this),'ContactId':this[_0x9822('0xa')]['id']};if(this[_0x9822('0xb')]===_0x9822('0xc')){_0x59a619[_0x9822('0xd')]=this[_0x9822('0xe')]['id'];}else{_0x59a619[_[_0x9822('0xf')](this[_0x9822('0xb')])+_0x9822('0x10')]=this[_0x9822('0xe')]['id'];}_0x59a619[_['upperFirst'](this[_0x9822('0xb')])+_0x9822('0x11')]=this[_0x9822('0x12')]['id'];if(rpc[this[_0x9822('0xb')]+_0x9822('0x13')]){return rpc[this['channel']+_0x9822('0x13')][_0x9822('0x14')](_0x59a619)['then'](function(_0x25ca37){logger[_0x9822('0x15')](_0x9822('0x16'),_0x410342,_0x59a619[_0x9822('0x17')]);_0x12434d[_0x9822('0x18')]();})[_0x9822('0x19')](function(_0x4fa594){logger['error'](_0x9822('0x16'),_0x410342,JSON[_0x9822('0x1a')](_0x4fa594));_0x12434d[_0x9822('0x1b')]();});}}catch(_0x57638b){logger[_0x9822('0x1c')]('[%s][MESSAGE]\x20%s',_0x410342,JSON['stringify'](_0x57638b));_0x12434d[_0x9822('0x1b')]();}};};
\ No newline at end of file
index 95e53ce..b296f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36bb=['error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x36bf1b,_0x1b8bc9){var _0x49c980=function(_0xd2122f){while(--_0xd2122f){_0x36bf1b['push'](_0x36bf1b['shift']());}};_0x49c980(++_0x1b8bc9);}(_0x36bb,0x10b));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xb36b('0x0'));var logger=require(_0xb36b('0x1'))(_0xb36b('0x2'));exports[_0xb36b('0x3')]=function(_0x2cb8bf,_0x45957d){return function(_0x33023f){try{logger[_0xb36b('0x4')](_0xb36b('0x5'),_0x2cb8bf,utils[_0xb36b('0x6')](_0x45957d[0x0],this));_0x33023f[_0xb36b('0x7')]();}catch(_0x314027){logger[_0xb36b('0x8')]('[%s][NOOP]\x20%s',_0x2cb8bf,JSON[_0xb36b('0x9')](_0x314027));_0x33023f[_0xb36b('0xa')]();}};};
\ No newline at end of file
+var _0x0662=['consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','../../../../config/logger','routing'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0x0662,0x1a5));var _0x2066=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x0662[_0x29b609];return _0x54c952;};'use strict';var utils=require('./utils');var logger=require(_0x2066('0x0'))(_0x2066('0x1'));exports[_0x2066('0x2')]=function(_0x236075,_0x43dfd6){return function(_0x2f57e5){try{logger['info'](_0x2066('0x3'),_0x236075,utils[_0x2066('0x4')](_0x43dfd6[0x0],this));_0x2f57e5[_0x2066('0x5')]();}catch(_0x4bd38b){logger[_0x2066('0x6')](_0x2066('0x3'),_0x236075,JSON[_0x2066('0x7')](_0x4bd38b));_0x2f57e5[_0x2066('0x8')]();}};};
\ No newline at end of file
index adc0728..9dd2b4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0626=['log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','message','AccountId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','consequence','length','map','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','rrmemory','beepall'];(function(_0x18c3a1,_0x301c70){var _0xdee5c8=function(_0x27036c){while(--_0x27036c){_0x18c3a1['push'](_0x18c3a1['shift']());}};_0xdee5c8(++_0x301c70);}(_0x0626,0x1ed));var _0x6062=function(_0x2a2c68,_0x393878){_0x2a2c68=_0x2a2c68-0x0;var _0x1050d2=_0x0626[_0x2a2c68];return _0x1050d2;};'use strict';var schema=require(_0x6062('0x0'));var _=require(_0x6062('0x1'));var util=require(_0x6062('0x2'));var seqqueue=require(_0x6062('0x3'));var moment=require(_0x6062('0x4'));var Redis=require('ioredis');var config=require(_0x6062('0x5'));var logger=require('../../../../config/logger')(_0x6062('0x6'));var strategy=require(_0x6062('0x7'));config[_0x6062('0x8')]=_[_0x6062('0x9')](config[_0x6062('0x8')],{'host':_0x6062('0xa'),'port':0x18eb});var io=require(_0x6062('0xb'))(new Redis(config[_0x6062('0x8')]));var attributes=['id',_0x6062('0xc'),_0x6062('0xd'),_0x6062('0xe'),_0x6062('0xf'),_0x6062('0x10')];function emit(_0x4568be,_0x40f56d,_0x4197de){io['to'](_0x4568be)[_0x6062('0x11')](_0x40f56d,_0x4197de);}function emitChannelQueueInteraction(_0x7493d9,_0x19ca11,_0x29e58c,_0x2c4f85,_0x46cf03,_0x182e1d,_0x56e1b1,_0x543e0c){_0x29e58c[_0x6062('0xc')]=_0x543e0c;_0x29e58c['queue']=_0x19ca11;_0x29e58c[_0x6062('0xd')]=_0x2c4f85;_0x29e58c['id']=_0x46cf03;if(_0x182e1d){_0x56e1b1[util['format'](_0x6062('0x12'),_0x7493d9)][_0x46cf03]=_[_0x6062('0x13')](_0x29e58c,attributes);}else{delete _0x56e1b1[util[_0x6062('0x14')](_0x6062('0x12'),_0x7493d9)][_0x46cf03];}emit(util['format'](_0x6062('0x15'),_0x7493d9,_0x19ca11),util[_0x6062('0x14')](_0x6062('0x16'),_0x7493d9,_0x182e1d?'save':'remove'),_[_0x6062('0x13')](_0x29e58c,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x6062('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x6062('0x18')),'faxQueueReport':require(_0x6062('0x19'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x6062('0x1a')},'timeout':{'type':'number','message':_0x6062('0x1b')}});function startRouting(_0x16f633,_0x3ed7dc,_0x5dd37f,_0x5c16ec){if(_0x16f633&&_0x3ed7dc&&_0x5dd37f){_0x3ed7dc['waiting']+=0x1;var _0x373959={'uniqueid':_0x16f633,'from':_0x5dd37f['body']?_0x5dd37f['body'][_0x6062('0xf')]:'','joinAt':moment()['format'](_0x6062('0x1c')),'ContactId':_0x5dd37f[_0x6062('0x1d')]?_0x5dd37f[_0x6062('0x1d')]['id']:null,'ListId':_0x5dd37f[_0x6062('0x1e')]?_0x5dd37f[_0x6062('0x1e')]['id']:null};_0x373959[_['upperFirst'](_0x5dd37f[_0x6062('0x1f')])+_0x6062('0x20')]=_0x3ed7dc['id']||null;_0x373959[_[_0x6062('0x21')](_0x5dd37f[_0x6062('0x1f')])+'InteractionId']=_0x5dd37f[_0x6062('0x22')]?_0x5dd37f[_0x6062('0x22')]['id']:null;_0x373959[_[_0x6062('0x21')](_0x5dd37f[_0x6062('0x1f')])+'MessageId']=_0x5dd37f[_0x6062('0x23')]?_0x5dd37f[_0x6062('0x23')]['id']:null;_0x373959[_['upperFirst'](_0x5dd37f[_0x6062('0x1f')])+(_0x5dd37f[_0x6062('0x1f')]!=='chat'?_0x6062('0x24'):'WebsiteId')]=_0x5dd37f[_0x6062('0xd')]?_0x5dd37f['account']['id']:null;logger[_0x6062('0x25')](util[_0x6062('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x16f633,_0x3ed7dc[_0x6062('0x26')]));emitChannelQueueInteraction(_0x5dd37f[_0x6062('0x1f')],_0x3ed7dc[_0x6062('0x26')],_0x373959,_0x5dd37f[_0x6062('0xd')][_0x6062('0x26')],_0x5dd37f['message']['id'],!![],_0x5c16ec,_0x3ed7dc['id']);if(rpc[_0x5dd37f['channel']+_0x6062('0x27')]){return rpc[_0x5dd37f[_0x6062('0x1f')]+_0x6062('0x27')][_0x6062('0x28')](_0x373959)[_0x6062('0x29')](function(_0x2999ea){logger[_0x6062('0x2a')](_0x6062('0x2b'));});}}}function stopRouting(_0x1d5f8c,_0x13efc8,_0x2c6113,_0x898502){if(_0x1d5f8c&&_0x13efc8){_0x13efc8[_0x6062('0x2c')]-=0x1;var _0x4e7b25={'leaveAt':moment()[_0x6062('0x14')](_0x6062('0x1c')),'acceptAt':moment()[_0x6062('0x14')](_0x6062('0x1c')),'reason':_0x6062('0x2d')};logger[_0x6062('0x25')](util[_0x6062('0x14')](_0x6062('0x2e'),_0x1d5f8c,_0x13efc8[_0x6062('0x26')]));emitChannelQueueInteraction(_0x2c6113[_0x6062('0x1f')],_0x13efc8['name'],_0x2c6113[_0x6062('0x2f')],_0x2c6113[_0x6062('0xd')][_0x6062('0x26')],_0x2c6113[_0x6062('0x23')]['id'],![],_0x898502,_0x13efc8['id']);if(rpc[_0x2c6113['channel']+_0x6062('0x27')]){return rpc[_0x2c6113[_0x6062('0x1f')]+_0x6062('0x27')][_0x6062('0x30')](_0x1d5f8c,_0x4e7b25)[_0x6062('0x29')](function(_0x2ab069){logger[_0x6062('0x2a')](_0x6062('0x31'));});}}}function endRouting(_0x7493f6,_0x34525f,_0x239ab6,_0x48efc9){if(_0x7493f6&&_0x34525f){_0x34525f[_0x6062('0x2c')]-=0x1;var _0x2cd0f6={'leaveAt':moment()[_0x6062('0x14')](_0x6062('0x1c')),'exitAt':moment()[_0x6062('0x14')](_0x6062('0x1c')),'reason':_0x6062('0x32')};logger[_0x6062('0x25')](util[_0x6062('0x14')](_0x6062('0x33'),_0x7493f6,_0x34525f[_0x6062('0x26')]));emitChannelQueueInteraction(_0x239ab6['channel'],_0x34525f['name'],_0x239ab6[_0x6062('0x2f')],_0x239ab6[_0x6062('0xd')][_0x6062('0x26')],_0x239ab6['message']['id'],![],_0x48efc9);if(rpc[_0x239ab6[_0x6062('0x1f')]+_0x6062('0x27')]){return rpc[_0x239ab6[_0x6062('0x1f')]+_0x6062('0x27')]['update'](_0x7493f6,_0x2cd0f6)['catch'](function(_0x1180c9){logger[_0x6062('0x2a')](_0x6062('0x31'));});}}}function handleFindQueue(_0x38d089){return function(_0x28bf26){return _0x28bf26[_0x6062('0x26')]['toLowerCase']()===_0x38d089['toLowerCase']();};}exports[_0x6062('0x34')]=function(_0x331659,_0x4e0e17,_0x33999a,_0x7c3449){return function(_0x1773ac){try{var _0x17790b={'name':_0x4e0e17[0x0],'timeout':_0x4e0e17[0x1]};var _0x5b781c=queue['validate'](_0x17790b,{'typecast':!![]});if(_0x5b781c[_0x6062('0x35')]){logger['error']('[%s][QUEUE]\x20%s',_0x331659,_[_0x6062('0x36')](_0x5b781c,_0x6062('0x23'))[_0x6062('0x37')](',\x20'));_0x1773ac['stop']();}else{var _0x125baa=_[_0x6062('0x38')](_0x33999a[_0x7c3449[_0x6062('0x1f')]+_0x6062('0x39')],handleFindQueue(_0x17790b[_0x6062('0x26')]));if(_0x125baa){startRouting(_0x331659,_0x125baa,_0x7c3449,_0x33999a);var _0x43ad9c=(_0x125baa['timeout']||0xa)*0x3e8;var _0x31901d=(_0x17790b[_0x6062('0x32')]||0x14)*0x3e8;var _0xfae371,_0x2e3520;if(_0x43ad9c>_0x31901d){_0x31901d=_0x43ad9c;}var _0xb15ac4=seqqueue[_0x6062('0x3a')](_0x43ad9c);_0xb15ac4['id']=_0x331659;_0xb15ac4[_0x6062('0x3b')]=_0x43ad9c;_0xb15ac4[_0x6062('0x3c')]=_0x31901d;_0xb15ac4[_0x6062('0x1f')]=_0x7c3449[_0x6062('0x1f')];_0x33999a[_0x6062('0x3d')][_0x331659]['on'](_0x6062('0x3e'),function(){stopRouting(_0x331659,_0x125baa,_0x7c3449,_0x33999a);_0xb15ac4['close'](!![]);clearTimeout(_0xfae371);_0xfae371=undefined;if(_0x33999a[_0x6062('0x3d')][_0x331659]){delete _0x33999a['rules'][_0x331659];}logger[_0x6062('0x25')](_0x6062('0x3f'),_0x331659);_0x1773ac[_0x6062('0x40')]();});_0xfae371=setTimeout(function(){endRouting(_0x331659,_0x125baa,_0x7c3449,_0x33999a);clearTimeout(_0xfae371);_0xb15ac4['close'](!![]);logger['info']('[%s][QUEUE]\x20ROUTING\x20END',_0x331659);_0x1773ac['next']();},_0x31901d);switch(_0x125baa['strategy']){case _0x6062('0x41'):strategy[_0x6062('0x41')](_0xb15ac4,_0x125baa,_0x33999a,_0x7c3449);break;default:strategy[_0x6062('0x42')](_0xb15ac4,_0x125baa,_0x33999a,_0x7c3449);}}else{logger[_0x6062('0x2a')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x331659,_0x17790b[_0x6062('0x26')]);_0x1773ac['stop']();}}}catch(_0xe61f62){console[_0x6062('0x43')](_0xe61f62);logger[_0x6062('0x2a')](_0x6062('0x44'),_0x331659,_0xe61f62[_0x6062('0x45')]);_0x1773ac[_0x6062('0x40')]();}};};
\ No newline at end of file
+var _0xad13=['timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','length','map','stop','Queues','createQueue','atimeout','rules','end','close','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','account','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad13,0x79));var _0x3ad1=function(_0x8eb48a,_0x2f4383){_0x8eb48a=_0x8eb48a-0x0;var _0x41bc06=_0xad13[_0x8eb48a];return _0x41bc06;};'use strict';var schema=require(_0x3ad1('0x0'));var _=require('lodash');var util=require(_0x3ad1('0x1'));var seqqueue=require(_0x3ad1('0x2'));var moment=require(_0x3ad1('0x3'));var Redis=require(_0x3ad1('0x4'));var config=require('../../../../config/environment');var logger=require(_0x3ad1('0x5'))(_0x3ad1('0x6'));var strategy=require(_0x3ad1('0x7'));config[_0x3ad1('0x8')]=_[_0x3ad1('0x9')](config[_0x3ad1('0x8')],{'host':_0x3ad1('0xa'),'port':0x18eb});var io=require(_0x3ad1('0xb'))(new Redis(config[_0x3ad1('0x8')]));var attributes=['id',_0x3ad1('0xc'),'account',_0x3ad1('0xd'),_0x3ad1('0xe'),_0x3ad1('0xf')];function emit(_0x4e93df,_0x3bbc50,_0x3902c2){io['to'](_0x4e93df)['emit'](_0x3bbc50,_0x3902c2);}function emitChannelQueueInteraction(_0x397c5a,_0x17868e,_0x17d0a7,_0x2ae2a3,_0x3d4400,_0x3bcab7,_0x52581c,_0x5a431a){_0x17d0a7[_0x3ad1('0xc')]=_0x5a431a;_0x17d0a7[_0x3ad1('0xd')]=_0x17868e;_0x17d0a7[_0x3ad1('0x10')]=_0x2ae2a3;_0x17d0a7['id']=_0x3d4400;if(_0x3bcab7){_0x52581c[util[_0x3ad1('0x11')]('%sQueuesWaitingInteractions',_0x397c5a)][_0x3d4400]=_[_0x3ad1('0x12')](_0x17d0a7,attributes);}else{delete _0x52581c[util['format'](_0x3ad1('0x13'),_0x397c5a)][_0x3d4400];}emit(util[_0x3ad1('0x11')](_0x3ad1('0x14'),_0x397c5a,_0x17868e),util[_0x3ad1('0x11')](_0x3ad1('0x15'),_0x397c5a,_0x3bcab7?_0x3ad1('0x16'):_0x3ad1('0x17')),_[_0x3ad1('0x12')](_0x17d0a7,attributes));}var rpc={'openchannelQueueReport':require(_0x3ad1('0x18')),'mailQueueReport':require(_0x3ad1('0x19')),'chatQueueReport':require(_0x3ad1('0x1a')),'smsQueueReport':require(_0x3ad1('0x1b')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0x3ad1('0x1c'),'required':!![],'message':_0x3ad1('0x1d')},'timeout':{'type':_0x3ad1('0x1e'),'message':_0x3ad1('0x1f')}});function startRouting(_0x11e3ed,_0x4efa2f,_0x5e01fc,_0x3de9a2){if(_0x11e3ed&&_0x4efa2f&&_0x5e01fc){_0x4efa2f['waiting']+=0x1;var _0x214005={'uniqueid':_0x11e3ed,'from':_0x5e01fc[_0x3ad1('0x20')]?_0x5e01fc[_0x3ad1('0x20')][_0x3ad1('0xe')]:'','joinAt':moment()[_0x3ad1('0x11')](_0x3ad1('0x21')),'ContactId':_0x5e01fc['contact']?_0x5e01fc[_0x3ad1('0x22')]['id']:null,'ListId':_0x5e01fc['list']?_0x5e01fc[_0x3ad1('0x23')]['id']:null};_0x214005[_['upperFirst'](_0x5e01fc[_0x3ad1('0x24')])+_0x3ad1('0x25')]=_0x4efa2f['id']||null;_0x214005[_[_0x3ad1('0x26')](_0x5e01fc[_0x3ad1('0x24')])+_0x3ad1('0x27')]=_0x5e01fc[_0x3ad1('0x28')]?_0x5e01fc[_0x3ad1('0x28')]['id']:null;_0x214005[_['upperFirst'](_0x5e01fc[_0x3ad1('0x24')])+_0x3ad1('0x29')]=_0x5e01fc[_0x3ad1('0x2a')]?_0x5e01fc[_0x3ad1('0x2a')]['id']:null;_0x214005[_[_0x3ad1('0x26')](_0x5e01fc[_0x3ad1('0x24')])+(_0x5e01fc['channel']!=='chat'?_0x3ad1('0x2b'):'WebsiteId')]=_0x5e01fc['account']?_0x5e01fc[_0x3ad1('0x10')]['id']:null;logger[_0x3ad1('0x2c')](util[_0x3ad1('0x11')](_0x3ad1('0x2d'),_0x11e3ed,_0x4efa2f['name']));emitChannelQueueInteraction(_0x5e01fc[_0x3ad1('0x24')],_0x4efa2f[_0x3ad1('0x2e')],_0x214005,_0x5e01fc[_0x3ad1('0x10')][_0x3ad1('0x2e')],_0x5e01fc[_0x3ad1('0x2a')]['id'],!![],_0x3de9a2,_0x4efa2f['id']);if(rpc[_0x5e01fc['channel']+'QueueReport']){return rpc[_0x5e01fc[_0x3ad1('0x24')]+'QueueReport'][_0x3ad1('0x2f')](_0x214005)[_0x3ad1('0x30')](function(_0x266d0d){logger[_0x3ad1('0x31')](_0x3ad1('0x32'));});}}}function stopRouting(_0x7c001,_0x28985e,_0x1b2640,_0x4556b9){if(_0x7c001&&_0x28985e){_0x28985e['waiting']-=0x1;var _0x2b6a4d={'leaveAt':moment()['format'](_0x3ad1('0x21')),'acceptAt':moment()[_0x3ad1('0x11')](_0x3ad1('0x21')),'reason':_0x3ad1('0x33')};logger[_0x3ad1('0x2c')](util[_0x3ad1('0x11')](_0x3ad1('0x34'),_0x7c001,_0x28985e['name']));emitChannelQueueInteraction(_0x1b2640[_0x3ad1('0x24')],_0x28985e['name'],_0x1b2640['body'],_0x1b2640['account'][_0x3ad1('0x2e')],_0x1b2640[_0x3ad1('0x2a')]['id'],![],_0x4556b9,_0x28985e['id']);if(rpc[_0x1b2640[_0x3ad1('0x24')]+_0x3ad1('0x35')]){return rpc[_0x1b2640[_0x3ad1('0x24')]+_0x3ad1('0x35')]['update'](_0x7c001,_0x2b6a4d)['catch'](function(_0x18a9c0){logger[_0x3ad1('0x31')](_0x3ad1('0x36'));});}}}function endRouting(_0x204141,_0x1daae9,_0x548069,_0x489365){if(_0x204141&&_0x1daae9){_0x1daae9['waiting']-=0x1;var _0x5d9365={'leaveAt':moment()[_0x3ad1('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x3ad1('0x11')](_0x3ad1('0x21')),'reason':_0x3ad1('0x37')};logger['info'](util[_0x3ad1('0x11')](_0x3ad1('0x38'),_0x204141,_0x1daae9['name']));emitChannelQueueInteraction(_0x548069[_0x3ad1('0x24')],_0x1daae9['name'],_0x548069[_0x3ad1('0x20')],_0x548069[_0x3ad1('0x10')][_0x3ad1('0x2e')],_0x548069[_0x3ad1('0x2a')]['id'],![],_0x489365);if(rpc[_0x548069['channel']+'QueueReport']){return rpc[_0x548069[_0x3ad1('0x24')]+_0x3ad1('0x35')][_0x3ad1('0x39')](_0x204141,_0x5d9365)[_0x3ad1('0x30')](function(_0x5598c3){logger[_0x3ad1('0x31')](_0x3ad1('0x36'));});}}}function handleFindQueue(_0x3a476a){return function(_0x14cf66){return _0x14cf66['name'][_0x3ad1('0x3a')]()===_0x3a476a['toLowerCase']();};}exports['consequence']=function(_0x36ef65,_0x509b1c,_0x52298e,_0x534b5d){return function(_0x475c20){try{var _0x266ec7={'name':_0x509b1c[0x0],'timeout':_0x509b1c[0x1]};var _0x17faa0=queue[_0x3ad1('0x0')](_0x266ec7,{'typecast':!![]});if(_0x17faa0[_0x3ad1('0x3b')]){logger['error']('[%s][QUEUE]\x20%s',_0x36ef65,_[_0x3ad1('0x3c')](_0x17faa0,_0x3ad1('0x2a'))['join'](',\x20'));_0x475c20[_0x3ad1('0x3d')]();}else{var _0x3b22cd=_['find'](_0x52298e[_0x534b5d[_0x3ad1('0x24')]+_0x3ad1('0x3e')],handleFindQueue(_0x266ec7['name']));if(_0x3b22cd){startRouting(_0x36ef65,_0x3b22cd,_0x534b5d,_0x52298e);var _0xf30b69=(_0x3b22cd['timeout']||0xa)*0x3e8;var _0x1cf589=(_0x266ec7[_0x3ad1('0x37')]||0x14)*0x3e8;var _0x2fdbc4,_0x68deb9;if(_0xf30b69>_0x1cf589){_0x1cf589=_0xf30b69;}var _0x2ae60c=seqqueue[_0x3ad1('0x3f')](_0xf30b69);_0x2ae60c['id']=_0x36ef65;_0x2ae60c[_0x3ad1('0x40')]=_0xf30b69;_0x2ae60c['qtimeout']=_0x1cf589;_0x2ae60c['channel']=_0x534b5d[_0x3ad1('0x24')];_0x52298e[_0x3ad1('0x41')][_0x36ef65]['on'](_0x3ad1('0x42'),function(){stopRouting(_0x36ef65,_0x3b22cd,_0x534b5d,_0x52298e);_0x2ae60c[_0x3ad1('0x43')](!![]);clearTimeout(_0x2fdbc4);_0x2fdbc4=undefined;if(_0x52298e['rules'][_0x36ef65]){delete _0x52298e['rules'][_0x36ef65];}logger[_0x3ad1('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x36ef65);_0x475c20[_0x3ad1('0x3d')]();});_0x2fdbc4=setTimeout(function(){endRouting(_0x36ef65,_0x3b22cd,_0x534b5d,_0x52298e);clearTimeout(_0x2fdbc4);_0x2ae60c['close'](!![]);logger[_0x3ad1('0x2c')]('[%s][QUEUE]\x20ROUTING\x20END',_0x36ef65);_0x475c20[_0x3ad1('0x44')]();},_0x1cf589);switch(_0x3b22cd[_0x3ad1('0x45')]){case _0x3ad1('0x46'):strategy['rrmemory'](_0x2ae60c,_0x3b22cd,_0x52298e,_0x534b5d);break;default:strategy[_0x3ad1('0x47')](_0x2ae60c,_0x3b22cd,_0x52298e,_0x534b5d);}}else{logger[_0x3ad1('0x31')](_0x3ad1('0x48'),_0x36ef65,_0x266ec7[_0x3ad1('0x2e')]);_0x475c20['stop']();}}}catch(_0x2bc7cc){console[_0x3ad1('0x49')](_0x2bc7cc);logger[_0x3ad1('0x31')](_0x3ad1('0x4a'),_0x36ef65,_0x2bc7cc[_0x3ad1('0x4b')]);_0x475c20[_0x3ad1('0x3d')]();}};};
\ No newline at end of file
index fc53fe9..98808b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37bf=['./util','../../../../../config/logger','notificationId','squeue','routing','handleTimeout','timeout','bind','prototype','push','handleRun','handleDrained','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agent','forcedOwnership','busy','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','info','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid'];(function(_0x33f7e1,_0x48d209){var _0x23bab4=function(_0xd532b0){while(--_0xd532b0){_0x33f7e1['push'](_0x33f7e1['shift']());}};_0x23bab4(++_0x48d209);}(_0x37bf,0xd7));var _0xf37b=function(_0x252681,_0x5a8178){_0x252681=_0x252681-0x0;var _0x338bfe=_0x37bf[_0x252681];return _0x338bfe;};'use strict';var _=require(_0xf37b('0x0'));var uuid=require(_0xf37b('0x1'));var util=require(_0xf37b('0x2'));var logger=require(_0xf37b('0x3'))('routing');var Agent=function(_0x4fa29f,_0x226f68,_0x50b21c,_0x3f1d5f){this[_0xf37b('0x4')]=uuid['v4']();this[_0xf37b('0x5')]=_0x4fa29f;this['agent']=_0x226f68;this['realtime']=_0x50b21c;this[_0xf37b('0x6')]=_0x3f1d5f;this['squeue']['push'](this['handleRun']['bind'](this),this[_0xf37b('0x7')]['bind'](this));this[_0xf37b('0x5')]['on'](_0xf37b('0x8'),this[_0xf37b('0x7')][_0xf37b('0x9')](this));this[_0xf37b('0x5')]['on']('drained',this['handleDrained'][_0xf37b('0x9')](this));};Agent[_0xf37b('0xa')][_0xf37b('0xb')]=function(){this['squeue'][_0xf37b('0xb')](this[_0xf37b('0xc')]['bind'](this),this['handleTimeout'][_0xf37b('0x9')](this));};Agent[_0xf37b('0xa')][_0xf37b('0xd')]=function(){this[_0xf37b('0x7')](!![]);};Agent[_0xf37b('0xa')][_0xf37b('0xc')]=function(_0xbe84a7){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0xf37b('0x5')]['id'],this['agent']['id']);if(_[_0xf37b('0xe')](this[_0xf37b('0xf')][_0xf37b('0x10')][this['agent']['id']])){logger['info'](_0xf37b('0x11'),this[_0xf37b('0x5')]['id'],this[_0xf37b('0x12')]['id']);setTimeout(this['push'][_0xf37b('0x9')](this),0x3e8);}else{if(this[_0xf37b('0x6')][_0xf37b('0x13')]||util['isAgentAvailable'](this[_0xf37b('0x5')]['id'],this[_0xf37b('0xf')]['agents'][this['agent']['id']],this[_0xf37b('0x5')]['channel'],![])){this[_0xf37b('0xf')][_0xf37b('0x10')][this[_0xf37b('0x12')]['id']][_0xf37b('0x14')]=!![];this[_0xf37b('0xf')][_0xf37b('0x10')][this[_0xf37b('0x12')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0xf37b('0x4')],this[_0xf37b('0x5')]['id'],this[_0xf37b('0xf')]['agents'][this[_0xf37b('0x12')]['id']],null,this[_0xf37b('0x6')]);util[_0xf37b('0x15')](this['squeue']['id'],this[_0xf37b('0xf')][_0xf37b('0x10')][this[_0xf37b('0x12')]['id']],_0xf37b('0x16')+(this['routing'][_0xf37b('0x13')]?_0xf37b('0x17'):''));}else{logger['info'](_0xf37b('0x18'),this['squeue']['id'],this[_0xf37b('0x12')]['id']);setTimeout(this[_0xf37b('0xb')][_0xf37b('0x9')](this),0x3e8);}}};Agent[_0xf37b('0xa')][_0xf37b('0x7')]=function(_0x2323cb){if(_[_0xf37b('0xe')](this[_0xf37b('0xf')]['agents'][this['agent']['id']])){return logger[_0xf37b('0x19')](_0xf37b('0x11'),this[_0xf37b('0x5')]['id'],this[_0xf37b('0x12')]['id']);}else{logger[_0xf37b('0x19')](_0xf37b('0x1a'),this[_0xf37b('0x5')]['id'],this[_0xf37b('0x12')]['id']);util[_0xf37b('0x1b')](this[_0xf37b('0x4')],this[_0xf37b('0x5')]['id'],this[_0xf37b('0xf')][_0xf37b('0x10')][this[_0xf37b('0x12')]['id']],null,this[_0xf37b('0x6')]);this[_0xf37b('0xf')]['agents'][this[_0xf37b('0x12')]['id']]['busy']=![];this[_0xf37b('0xf')][_0xf37b('0x10')][this[_0xf37b('0x12')]['id']]['busyQueue']=undefined;util[_0xf37b('0x15')](this['squeue']['id'],this[_0xf37b('0xf')][_0xf37b('0x10')][this[_0xf37b('0x12')]['id']],_0x2323cb?_0xf37b('0x1c'):_0xf37b('0x1d'));}if(!_0x2323cb){setTimeout(this[_0xf37b('0xb')][_0xf37b('0x9')](this),0x3e8);}};function agent(_0x27b456,_0x4c5c4d,_0x2b1b25,_0x5b172e){return new Agent(_0x27b456,_0x4c5c4d,_0x2b1b25,_0x5b172e);}module[_0xf37b('0x1e')]=agent;
\ No newline at end of file
+var _0xc4d5=['handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','channel','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','handleRun','bind','handleTimeout','prototype','push'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0xc4d5,0xf3));var _0x5c4d=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0xc4d5[_0x2b737c];return _0x466ed5;};'use strict';var _=require(_0x5c4d('0x0'));var uuid=require(_0x5c4d('0x1'));var util=require(_0x5c4d('0x2'));var logger=require(_0x5c4d('0x3'))(_0x5c4d('0x4'));var Agent=function(_0x810cf5,_0x3d106e,_0x158ab9,_0x3cfb83){this[_0x5c4d('0x5')]=uuid['v4']();this[_0x5c4d('0x6')]=_0x810cf5;this[_0x5c4d('0x7')]=_0x3d106e;this['realtime']=_0x158ab9;this['routing']=_0x3cfb83;this['squeue']['push'](this[_0x5c4d('0x8')][_0x5c4d('0x9')](this),this[_0x5c4d('0xa')][_0x5c4d('0x9')](this));this[_0x5c4d('0x6')]['on']('timeout',this[_0x5c4d('0xa')][_0x5c4d('0x9')](this));this[_0x5c4d('0x6')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0x5c4d('0xb')][_0x5c4d('0xc')]=function(){this[_0x5c4d('0x6')][_0x5c4d('0xc')](this[_0x5c4d('0x8')][_0x5c4d('0x9')](this),this['handleTimeout']['bind'](this));};Agent['prototype'][_0x5c4d('0xd')]=function(){this[_0x5c4d('0xa')](!![]);};Agent['prototype']['handleRun']=function(_0x472bb9){logger[_0x5c4d('0xe')](_0x5c4d('0xf'),this['squeue']['id'],this['agent']['id']);if(_[_0x5c4d('0x10')](this['realtime'][_0x5c4d('0x11')][this[_0x5c4d('0x7')]['id']])){logger['info'](_0x5c4d('0x12'),this[_0x5c4d('0x6')]['id'],this[_0x5c4d('0x7')]['id']);setTimeout(this['push'][_0x5c4d('0x9')](this),0x3e8);}else{if(this['routing'][_0x5c4d('0x13')]||util[_0x5c4d('0x14')](this['squeue']['id'],this[_0x5c4d('0x15')][_0x5c4d('0x11')][this['agent']['id']],this[_0x5c4d('0x6')][_0x5c4d('0x16')],![])){this[_0x5c4d('0x15')][_0x5c4d('0x11')][this[_0x5c4d('0x7')]['id']]['busy']=!![];this[_0x5c4d('0x15')][_0x5c4d('0x11')][this['agent']['id']][_0x5c4d('0x17')]=undefined;util[_0x5c4d('0x18')](this[_0x5c4d('0x5')],this[_0x5c4d('0x6')]['id'],this[_0x5c4d('0x15')][_0x5c4d('0x11')][this[_0x5c4d('0x7')]['id']],null,this['routing']);util[_0x5c4d('0x19')](this['squeue']['id'],this[_0x5c4d('0x15')]['agents'][this['agent']['id']],'RINGING'+(this[_0x5c4d('0x4')]['forcedOwnership']?_0x5c4d('0x1a'):''));}else{logger[_0x5c4d('0xe')](_0x5c4d('0x1b'),this[_0x5c4d('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0x5c4d('0x9')](this),0x3e8);}}};Agent['prototype'][_0x5c4d('0xa')]=function(_0x60b932){if(_[_0x5c4d('0x10')](this[_0x5c4d('0x15')][_0x5c4d('0x11')][this[_0x5c4d('0x7')]['id']])){return logger[_0x5c4d('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5c4d('0x6')]['id'],this['agent']['id']);}else{logger[_0x5c4d('0xe')](_0x5c4d('0x1c'),this['squeue']['id'],this[_0x5c4d('0x7')]['id']);util[_0x5c4d('0x1d')](this[_0x5c4d('0x5')],this[_0x5c4d('0x6')]['id'],this[_0x5c4d('0x15')]['agents'][this['agent']['id']],null,this[_0x5c4d('0x4')]);this[_0x5c4d('0x15')]['agents'][this['agent']['id']]['busy']=![];this['realtime'][_0x5c4d('0x11')][this[_0x5c4d('0x7')]['id']][_0x5c4d('0x17')]=undefined;util[_0x5c4d('0x19')](this[_0x5c4d('0x6')]['id'],this[_0x5c4d('0x15')][_0x5c4d('0x11')][this[_0x5c4d('0x7')]['id']],_0x60b932?_0x5c4d('0x1e'):_0x5c4d('0x1f'));}if(!_0x60b932){setTimeout(this[_0x5c4d('0xc')][_0x5c4d('0x9')](this),0x3e8);}};function agent(_0x495d77,_0x24e361,_0x460af2,_0x31491c){return new Agent(_0x495d77,_0x24e361,_0x460af2,_0x31491c);}module['exports']=agent;
\ No newline at end of file
index 630a957..d22cd75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ff1=['bind','handleTimeout','timeout','drained','handleDrained','prototype','push','handleRun','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing'];(function(_0x3bc518,_0x58b210){var _0x43daf8=function(_0x2c540f){while(--_0x2c540f){_0x3bc518['push'](_0x3bc518['shift']());}};_0x43daf8(++_0x58b210);}(_0x1ff1,0x10f));var _0x11ff=function(_0x9c34f8,_0x93d929){_0x9c34f8=_0x9c34f8-0x0;var _0x3560df=_0x1ff1[_0x9c34f8];return _0x3560df;};'use strict';var _=require(_0x11ff('0x0'));var uuid=require(_0x11ff('0x1'));var util=require(_0x11ff('0x2'));var logger=require(_0x11ff('0x3'))('routing');var Beepall=function(_0x36c0ac,_0x580a19,_0x2dfaa8,_0x12ad71){this[_0x11ff('0x4')]=uuid['v4']();this[_0x11ff('0x5')]=_0x36c0ac;this[_0x11ff('0x6')]=_0x580a19;this[_0x11ff('0x7')]=_0x2dfaa8;this[_0x11ff('0x8')]=_0x12ad71;this[_0x11ff('0x5')]['push'](this['handleRun'][_0x11ff('0x9')](this),this[_0x11ff('0xa')][_0x11ff('0x9')](this));this['squeue']['on'](_0x11ff('0xb'),this[_0x11ff('0xa')][_0x11ff('0x9')](this));this[_0x11ff('0x5')]['on'](_0x11ff('0xc'),this[_0x11ff('0xd')]['bind'](this));};Beepall[_0x11ff('0xe')][_0x11ff('0xf')]=function(){this[_0x11ff('0x5')][_0x11ff('0xf')](this[_0x11ff('0x10')][_0x11ff('0x9')](this),this[_0x11ff('0xa')]['bind'](this));};Beepall[_0x11ff('0xe')]['handleDrained']=function(_0x21faaf){this[_0x11ff('0xa')](!![]);};Beepall[_0x11ff('0xe')][_0x11ff('0x10')]=function(_0x4e6cfa){var _0x102989=!![];if(!_[_0x11ff('0x11')](this[_0x11ff('0x6')])&&!_[_0x11ff('0x11')](this['queue'][_0x11ff('0x12')])&&this[_0x11ff('0x6')][_0x11ff('0x12')][_0x11ff('0x13')]>0x0){for(var _0x31bf9c=0x0,_0x29e9a1;_0x31bf9c<this[_0x11ff('0x6')][_0x11ff('0x12')][_0x11ff('0x13')];_0x31bf9c+=0x1){_0x29e9a1=this[_0x11ff('0x6')][_0x11ff('0x12')][_0x31bf9c]['id'];if(_[_0x11ff('0x11')](this[_0x11ff('0x7')][_0x11ff('0x14')][_0x29e9a1])){logger[_0x11ff('0x15')](_0x11ff('0x16'),this[_0x11ff('0x5')]['id'],_0x29e9a1);}else{if(util[_0x11ff('0x17')](this[_0x11ff('0x5')]['id'],this[_0x11ff('0x7')]['agents'][_0x29e9a1],this['squeue']['channel'],!![])){_0x102989=![];util['writeLog'](this[_0x11ff('0x5')]['id'],this[_0x11ff('0x7')]['agents'][_0x29e9a1],_0x11ff('0x18'));this[_0x11ff('0x7')]['agents'][_0x29e9a1][_0x11ff('0x19')]=!![];this['realtime'][_0x11ff('0x14')][_0x29e9a1][_0x11ff('0x1a')]=this[_0x11ff('0x6')][_0x11ff('0x1b')];util[_0x11ff('0x1c')](this[_0x11ff('0x4')],this[_0x11ff('0x5')]['id'],this['realtime']['agents'][_0x29e9a1],this[_0x11ff('0x6')],this[_0x11ff('0x8')]);}}}if(_0x102989){logger['info'](_0x11ff('0x1d'),this[_0x11ff('0x5')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}else{logger[_0x11ff('0x15')](_0x11ff('0x1e'),this[_0x11ff('0x5')]['id']);setTimeout(this[_0x11ff('0xf')][_0x11ff('0x9')](this),0x3e8);}};Beepall[_0x11ff('0xe')]['handleTimeout']=function(_0x4cf63e){if(!_[_0x11ff('0x11')](this[_0x11ff('0x6')])&&!_[_0x11ff('0x11')](this[_0x11ff('0x6')]['Agents'])){for(var _0x1cb5c4=0x0,_0x27de7e;_0x1cb5c4<this[_0x11ff('0x6')][_0x11ff('0x12')][_0x11ff('0x13')];_0x1cb5c4+=0x1){_0x27de7e=this[_0x11ff('0x6')][_0x11ff('0x12')][_0x1cb5c4]['id'];if(_[_0x11ff('0x11')](this[_0x11ff('0x7')][_0x11ff('0x14')][_0x27de7e])){logger[_0x11ff('0x15')](_0x11ff('0x16'),this[_0x11ff('0x5')]['id'],_0x27de7e);}else{util[_0x11ff('0x1f')](this[_0x11ff('0x4')],this[_0x11ff('0x5')]['id'],this[_0x11ff('0x7')]['agents'][_0x27de7e],this[_0x11ff('0x6')],this[_0x11ff('0x8')]);util[_0x11ff('0x20')](this[_0x11ff('0x5')]['id'],this['realtime'][_0x11ff('0x14')][_0x27de7e],_0x4cf63e?_0x11ff('0x21'):_0x11ff('0x22'));this[_0x11ff('0x7')][_0x11ff('0x14')][_0x27de7e][_0x11ff('0x19')]=![];this[_0x11ff('0x7')]['agents'][_0x27de7e][_0x11ff('0x1a')]=undefined;}}}if(!_0x4cf63e){setTimeout(this[_0x11ff('0xf')][_0x11ff('0x9')](this),0x3e8);}};function beepall(_0x55e412,_0x411000,_0x3f3d4b,_0x33e79c){return new Beepall(_0x55e412,_0x411000,_0x3f3d4b,_0x33e79c);}module['exports']=beepall;
\ No newline at end of file
+var _0x1d0d=['handleDrained','handleTimeout','prototype','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','isNil','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','drained'];(function(_0x1c854f,_0x5ea7ca){var _0x1d03f9=function(_0x4e5471){while(--_0x4e5471){_0x1c854f['push'](_0x1c854f['shift']());}};_0x1d03f9(++_0x5ea7ca);}(_0x1d0d,0x1ad));var _0xd1d0=function(_0x410505,_0x82e2f6){_0x410505=_0x410505-0x0;var _0x97a74b=_0x1d0d[_0x410505];return _0x97a74b;};'use strict';var _=require(_0xd1d0('0x0'));var uuid=require(_0xd1d0('0x1'));var util=require(_0xd1d0('0x2'));var logger=require(_0xd1d0('0x3'))(_0xd1d0('0x4'));var Beepall=function(_0xfd6032,_0x33f575,_0x1bfa4c,_0x53ee21){this[_0xd1d0('0x5')]=uuid['v4']();this[_0xd1d0('0x6')]=_0xfd6032;this[_0xd1d0('0x7')]=_0x33f575;this[_0xd1d0('0x8')]=_0x1bfa4c;this[_0xd1d0('0x4')]=_0x53ee21;this[_0xd1d0('0x6')][_0xd1d0('0x9')](this[_0xd1d0('0xa')]['bind'](this),this['handleTimeout'][_0xd1d0('0xb')](this));this[_0xd1d0('0x6')]['on']('timeout',this['handleTimeout']['bind'](this));this[_0xd1d0('0x6')]['on'](_0xd1d0('0xc'),this[_0xd1d0('0xd')][_0xd1d0('0xb')](this));};Beepall['prototype'][_0xd1d0('0x9')]=function(){this[_0xd1d0('0x6')][_0xd1d0('0x9')](this[_0xd1d0('0xa')][_0xd1d0('0xb')](this),this[_0xd1d0('0xe')][_0xd1d0('0xb')](this));};Beepall['prototype']['handleDrained']=function(_0x24d408){this[_0xd1d0('0xe')](!![]);};Beepall[_0xd1d0('0xf')]['handleRun']=function(_0x334365){var _0x534443=!![];if(!_['isNil'](this[_0xd1d0('0x7')])&&!_['isNil'](this[_0xd1d0('0x7')][_0xd1d0('0x10')])&&this[_0xd1d0('0x7')][_0xd1d0('0x10')][_0xd1d0('0x11')]>0x0){for(var _0x18f83e=0x0,_0x5cde44;_0x18f83e<this[_0xd1d0('0x7')][_0xd1d0('0x10')][_0xd1d0('0x11')];_0x18f83e+=0x1){_0x5cde44=this[_0xd1d0('0x7')]['Agents'][_0x18f83e]['id'];if(_['isNil'](this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x5cde44])){logger[_0xd1d0('0x13')](_0xd1d0('0x14'),this['squeue']['id'],_0x5cde44);}else{if(util[_0xd1d0('0x15')](this['squeue']['id'],this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x5cde44],this[_0xd1d0('0x6')][_0xd1d0('0x16')],!![])){_0x534443=![];util[_0xd1d0('0x17')](this[_0xd1d0('0x6')]['id'],this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x5cde44],_0xd1d0('0x18'));this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x5cde44][_0xd1d0('0x19')]=!![];this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x5cde44][_0xd1d0('0x1a')]=this[_0xd1d0('0x7')]['name'];util[_0xd1d0('0x1b')](this['notificationId'],this['squeue']['id'],this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x5cde44],this[_0xd1d0('0x7')],this[_0xd1d0('0x4')]);}}}if(_0x534443){logger[_0xd1d0('0x13')](_0xd1d0('0x1c'),this[_0xd1d0('0x6')]['id']);setTimeout(this[_0xd1d0('0x9')][_0xd1d0('0xb')](this),0x3e8);}}else{logger[_0xd1d0('0x13')](_0xd1d0('0x1d'),this[_0xd1d0('0x6')]['id']);setTimeout(this[_0xd1d0('0x9')][_0xd1d0('0xb')](this),0x3e8);}};Beepall[_0xd1d0('0xf')][_0xd1d0('0xe')]=function(_0x583bd3){if(!_['isNil'](this[_0xd1d0('0x7')])&&!_[_0xd1d0('0x1e')](this[_0xd1d0('0x7')]['Agents'])){for(var _0x4b2a56=0x0,_0x9f547b;_0x4b2a56<this[_0xd1d0('0x7')][_0xd1d0('0x10')][_0xd1d0('0x11')];_0x4b2a56+=0x1){_0x9f547b=this[_0xd1d0('0x7')][_0xd1d0('0x10')][_0x4b2a56]['id'];if(_[_0xd1d0('0x1e')](this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x9f547b])){logger[_0xd1d0('0x13')](_0xd1d0('0x14'),this[_0xd1d0('0x6')]['id'],_0x9f547b);}else{util[_0xd1d0('0x1f')](this['notificationId'],this['squeue']['id'],this['realtime'][_0xd1d0('0x12')][_0x9f547b],this['queue'],this[_0xd1d0('0x4')]);util[_0xd1d0('0x17')](this[_0xd1d0('0x6')]['id'],this[_0xd1d0('0x8')]['agents'][_0x9f547b],_0x583bd3?_0xd1d0('0x20'):_0xd1d0('0x21'));this['realtime'][_0xd1d0('0x12')][_0x9f547b][_0xd1d0('0x19')]=![];this[_0xd1d0('0x8')][_0xd1d0('0x12')][_0x9f547b][_0xd1d0('0x1a')]=undefined;}}}if(!_0x583bd3){setTimeout(this[_0xd1d0('0x9')][_0xd1d0('0xb')](this),0x3e8);}};function beepall(_0x211e71,_0x4abe9e,_0x4b1fe1,_0x62a42e){return new Beepall(_0x211e71,_0x4abe9e,_0x4b1fe1,_0x62a42e);}module['exports']=beepall;
\ No newline at end of file
index cbbd3a3..6d99c87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88d5=['./beepall','./agent','exports','./rrmemory'];(function(_0x31752d,_0x2efff8){var _0x29da67=function(_0x296d74){while(--_0x296d74){_0x31752d['push'](_0x31752d['shift']());}};_0x29da67(++_0x2efff8);}(_0x88d5,0x76));var _0x588d=function(_0x43d8be,_0x5d5e50){_0x43d8be=_0x43d8be-0x0;var _0x4adaac=_0x88d5[_0x43d8be];return _0x4adaac;};'use strict';module[_0x588d('0x0')]={'rrmemory':require(_0x588d('0x1')),'beepall':require(_0x588d('0x2')),'agent':require(_0x588d('0x3'))};
\ No newline at end of file
+var _0x7217=['exports','./beepall','./agent'];(function(_0x48179b,_0x43435){var _0x2dc458=function(_0x2b1c1e){while(--_0x2b1c1e){_0x48179b['push'](_0x48179b['shift']());}};_0x2dc458(++_0x43435);}(_0x7217,0x19e));var _0x7721=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7217[_0x1c546c];return _0x2cc384;};'use strict';module[_0x7721('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x7721('0x1')),'agent':require(_0x7721('0x2'))};
\ No newline at end of file
index 568a244..cc7a7c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4232=['agentId','intervals','queue','mapAgentsId','info','[%s][QUEUE]\x20try\x20with\x20%s','isNil','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','showNotification','notificationId','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','done','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','lodash','uuid','../../../../../config/logger','routing','squeue','realtime','push','handleRun','bind','handleTimeout','module','timeout','drained','prototype','handleDrained','handleCheckReject','isAgentAvailable'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x4232,0x161));var _0x2423=function(_0x5c8cc1,_0x559a2e){_0x5c8cc1=_0x5c8cc1-0x0;var _0x56236a=_0x4232[_0x5c8cc1];return _0x56236a;};'use strict';var rr=require('rr');var _=require(_0x2423('0x0'));var uuid=require(_0x2423('0x1'));var util=require('./util');var logger=require(_0x2423('0x2'))(_0x2423('0x3'));var RRMemory=function(_0x3482a8,_0x1a591f,_0x38159d,_0x2f2a1f){this['notificationId']=uuid['v4']();this[_0x2423('0x4')]=_0x3482a8;this['queue']=_0x1a591f;this[_0x2423('0x5')]=_0x38159d;this[_0x2423('0x3')]=_0x2f2a1f;this['intervals']={};this['squeue'][_0x2423('0x6')](this[_0x2423('0x7')][_0x2423('0x8')](this),this[_0x2423('0x9')]['bind'](this),this[_0x2423('0xa')]);this[_0x2423('0x4')]['on'](_0x2423('0xb'),this[_0x2423('0x9')][_0x2423('0x8')](this));this['squeue']['on'](_0x2423('0xc'),this['handleDrained'][_0x2423('0x8')](this));};RRMemory[_0x2423('0xd')][_0x2423('0x6')]=function(){this[_0x2423('0x4')]['push'](this[_0x2423('0x7')][_0x2423('0x8')](this),this[_0x2423('0x9')][_0x2423('0x8')](this));};RRMemory[_0x2423('0xd')][_0x2423('0xe')]=function(_0x4267c5){this['handleTimeout'](!![]);};RRMemory['prototype'][_0x2423('0xf')]=function(_0x32b260){if(util[_0x2423('0x10')](this[_0x2423('0x4')]['id'],this[_0x2423('0x5')]['agents'][this['agentId']],this['squeue']['channel'],!![])){logger['info']('[%s][QUEUE]\x20available\x20again\x20%s',this[_0x2423('0x4')]['id'],this[_0x2423('0x11')]);clearInterval(this[_0x2423('0x12')][this[_0x2423('0x11')]]);_0x32b260['done']();setTimeout(this[_0x2423('0x6')][_0x2423('0x8')](this),0x3e8);}};RRMemory[_0x2423('0xd')]['handleRun']=function(_0x516387){this[_0x2423('0x11')]=rr(this[_0x2423('0x13')][_0x2423('0x14')]);logger[_0x2423('0x15')](_0x2423('0x16'),this[_0x2423('0x4')]['id'],this[_0x2423('0x11')]);if(_[_0x2423('0x17')](this['realtime'][_0x2423('0x18')][this[_0x2423('0x11')]])){logger[_0x2423('0x15')](_0x2423('0x19'),this[_0x2423('0x4')]['id'],this[_0x2423('0x11')]);_0x516387['done']();setTimeout(this[_0x2423('0x6')][_0x2423('0x8')](this),0x3e8);}else{if(util[_0x2423('0x10')](this[_0x2423('0x4')]['id'],this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]],this['squeue']['channel'],!![])){this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]][_0x2423('0x1a')]=!![];this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]][_0x2423('0x1b')]=this[_0x2423('0x13')][_0x2423('0x1c')];util[_0x2423('0x1d')](this[_0x2423('0x1e')],this[_0x2423('0x4')]['id'],this['realtime']['agents'][this[_0x2423('0x11')]],this[_0x2423('0x13')],this[_0x2423('0x3')]);util[_0x2423('0x1f')](this[_0x2423('0x4')]['id'],this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]],_0x2423('0x20'));this[_0x2423('0x12')][this['agentId']]=setInterval(this[_0x2423('0xf')][_0x2423('0x8')](this,_0x516387),0x3e8);}else{logger[_0x2423('0x15')](_0x2423('0x21'),this[_0x2423('0x4')]['id'],this[_0x2423('0x11')]);_0x516387[_0x2423('0x22')]();setTimeout(this[_0x2423('0x6')][_0x2423('0x8')](this),0x3e8);}}};RRMemory['prototype'][_0x2423('0x9')]=function(_0x5974aa){logger[_0x2423('0x15')](_0x2423('0x23'),this['squeue']['id'],this[_0x2423('0x11')]);if(_[_0x2423('0x17')](this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]])){logger[_0x2423('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x2423('0x4')]['id'],this['agentId']);}else{clearInterval(this[_0x2423('0x12')][this[_0x2423('0x11')]]);util[_0x2423('0x24')](this[_0x2423('0x1e')],this[_0x2423('0x4')]['id'],this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]],this[_0x2423('0x13')],this[_0x2423('0x3')]);util[_0x2423('0x1f')](this[_0x2423('0x4')]['id'],this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]],'TIMEOUT');this[_0x2423('0x5')]['agents'][this[_0x2423('0x11')]][_0x2423('0x1a')]=![];this[_0x2423('0x5')][_0x2423('0x18')][this[_0x2423('0x11')]]['busyQueue']=undefined;}if(!_0x5974aa){setTimeout(this[_0x2423('0x6')][_0x2423('0x8')](this),0x3e8);}};function rrmemory(_0x416ff5,_0xd4d770,_0x23b219,_0x27503a){return new RRMemory(_0x416ff5,_0xd4d770,_0x23b219,_0x27503a);}module['exports']=rrmemory;
\ No newline at end of file
+var _0xffcd=['done','TIMEOUT','lodash','./util','routing','notificationId','queue','realtime','push','handleRun','bind','handleTimeout','module','squeue','timeout','handleDrained','prototype','handleCheckReject','isAgentAvailable','agents','info','[%s][QUEUE]\x20available\x20again\x20%s','intervals','agentId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','name','showNotification','writeLog','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s'];(function(_0xb74d09,_0x488e48){var _0x1d0344=function(_0x225569){while(--_0x225569){_0xb74d09['push'](_0xb74d09['shift']());}};_0x1d0344(++_0x488e48);}(_0xffcd,0x19a));var _0xdffc=function(_0x164f31,_0x107124){_0x164f31=_0x164f31-0x0;var _0x5215bf=_0xffcd[_0x164f31];return _0x5215bf;};'use strict';var rr=require('rr');var _=require(_0xdffc('0x0'));var uuid=require('uuid');var util=require(_0xdffc('0x1'));var logger=require('../../../../../config/logger')(_0xdffc('0x2'));var RRMemory=function(_0x1ca0b1,_0x37efe8,_0x4e3a23,_0x2b0977){this[_0xdffc('0x3')]=uuid['v4']();this['squeue']=_0x1ca0b1;this[_0xdffc('0x4')]=_0x37efe8;this[_0xdffc('0x5')]=_0x4e3a23;this[_0xdffc('0x2')]=_0x2b0977;this['intervals']={};this['squeue'][_0xdffc('0x6')](this[_0xdffc('0x7')][_0xdffc('0x8')](this),this[_0xdffc('0x9')][_0xdffc('0x8')](this),this[_0xdffc('0xa')]);this[_0xdffc('0xb')]['on'](_0xdffc('0xc'),this['handleTimeout'][_0xdffc('0x8')](this));this[_0xdffc('0xb')]['on']('drained',this[_0xdffc('0xd')][_0xdffc('0x8')](this));};RRMemory[_0xdffc('0xe')][_0xdffc('0x6')]=function(){this[_0xdffc('0xb')][_0xdffc('0x6')](this[_0xdffc('0x7')][_0xdffc('0x8')](this),this['handleTimeout'][_0xdffc('0x8')](this));};RRMemory['prototype'][_0xdffc('0xd')]=function(_0x9c0fb7){this[_0xdffc('0x9')](!![]);};RRMemory[_0xdffc('0xe')][_0xdffc('0xf')]=function(_0x174e32){if(util[_0xdffc('0x10')](this[_0xdffc('0xb')]['id'],this[_0xdffc('0x5')][_0xdffc('0x11')][this['agentId']],this['squeue']['channel'],!![])){logger[_0xdffc('0x12')](_0xdffc('0x13'),this[_0xdffc('0xb')]['id'],this['agentId']);clearInterval(this[_0xdffc('0x14')][this[_0xdffc('0x15')]]);_0x174e32['done']();setTimeout(this[_0xdffc('0x6')][_0xdffc('0x8')](this),0x3e8);}};RRMemory[_0xdffc('0xe')]['handleRun']=function(_0x2cbb5e){this[_0xdffc('0x15')]=rr(this[_0xdffc('0x4')]['mapAgentsId']);logger[_0xdffc('0x12')](_0xdffc('0x16'),this['squeue']['id'],this[_0xdffc('0x15')]);if(_[_0xdffc('0x17')](this['realtime']['agents'][this[_0xdffc('0x15')]])){logger[_0xdffc('0x12')](_0xdffc('0x18'),this[_0xdffc('0xb')]['id'],this[_0xdffc('0x15')]);_0x2cbb5e['done']();setTimeout(this['push'][_0xdffc('0x8')](this),0x3e8);}else{if(util[_0xdffc('0x10')](this[_0xdffc('0xb')]['id'],this['realtime'][_0xdffc('0x11')][this[_0xdffc('0x15')]],this['squeue'][_0xdffc('0x19')],!![])){this['realtime']['agents'][this[_0xdffc('0x15')]][_0xdffc('0x1a')]=!![];this[_0xdffc('0x5')][_0xdffc('0x11')][this[_0xdffc('0x15')]][_0xdffc('0x1b')]=this[_0xdffc('0x4')][_0xdffc('0x1c')];util[_0xdffc('0x1d')](this[_0xdffc('0x3')],this[_0xdffc('0xb')]['id'],this[_0xdffc('0x5')]['agents'][this[_0xdffc('0x15')]],this['queue'],this[_0xdffc('0x2')]);util[_0xdffc('0x1e')](this[_0xdffc('0xb')]['id'],this[_0xdffc('0x5')][_0xdffc('0x11')][this[_0xdffc('0x15')]],'RINGING');this['intervals'][this[_0xdffc('0x15')]]=setInterval(this[_0xdffc('0xf')][_0xdffc('0x8')](this,_0x2cbb5e),0x3e8);}else{logger[_0xdffc('0x12')](_0xdffc('0x1f'),this[_0xdffc('0xb')]['id'],this[_0xdffc('0x15')]);_0x2cbb5e[_0xdffc('0x20')]();setTimeout(this[_0xdffc('0x6')][_0xdffc('0x8')](this),0x3e8);}}};RRMemory[_0xdffc('0xe')][_0xdffc('0x9')]=function(_0x138c0f){logger['info']('[%s][QUEUE]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agentId']);if(_[_0xdffc('0x17')](this['realtime'][_0xdffc('0x11')][this[_0xdffc('0x15')]])){logger[_0xdffc('0x12')](_0xdffc('0x18'),this['squeue']['id'],this[_0xdffc('0x15')]);}else{clearInterval(this[_0xdffc('0x14')][this[_0xdffc('0x15')]]);util['hideNotification'](this[_0xdffc('0x3')],this[_0xdffc('0xb')]['id'],this[_0xdffc('0x5')]['agents'][this['agentId']],this[_0xdffc('0x4')],this[_0xdffc('0x2')]);util['writeLog'](this[_0xdffc('0xb')]['id'],this['realtime']['agents'][this[_0xdffc('0x15')]],_0xdffc('0x21'));this[_0xdffc('0x5')][_0xdffc('0x11')][this[_0xdffc('0x15')]]['busy']=![];this['realtime'][_0xdffc('0x11')][this[_0xdffc('0x15')]][_0xdffc('0x1b')]=undefined;}if(!_0x138c0f){setTimeout(this[_0xdffc('0x6')][_0xdffc('0x8')](this),0x3e8);}};function rrmemory(_0xc97544,_0x152bfd,_0x37326d,_0x34aed8){return new RRMemory(_0xc97544,_0x152bfd,_0x37326d,_0x34aed8);}module['exports']=rrmemory;
\ No newline at end of file
index 8f989d4..c80ad76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf40e=['split','\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','OFFLINE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','emit','format','user:%s','name','user:save'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0xf40e,0x11d));var _0xef40=function(_0x35f3f0,_0x251e97){_0x35f3f0=_0x35f3f0-0x0;var _0xa2a21=_0xf40e[_0x35f3f0];return _0xa2a21;};'use strict';var _=require(_0xef40('0x0'));var util=require(_0xef40('0x1'));var utils=require(_0xef40('0x2'));var Mustache=require(_0xef40('0x3'));var Redis=require(_0xef40('0x4'));var config=require(_0xef40('0x5'));var logger=require(_0xef40('0x6'))(_0xef40('0x7'));config[_0xef40('0x8')]=_['defaults'](config[_0xef40('0x8')],{'host':_0xef40('0x9'),'port':0x18eb});var io=require(_0xef40('0xa'))(new Redis(config[_0xef40('0x8')]));function emit(_0x4a0aaa,_0x242cbf,_0x3ba324){io['to'](_0x4a0aaa)[_0xef40('0xb')](_0x242cbf,_0x3ba324);}function sendNotification(_0x522ad8,_0x31a3c,_0x608f92,_0x53a44a,_0x1d6aba,_0x5a9eac){io['to'](util[_0xef40('0xc')](_0xef40('0xd'),_0x53a44a[_0xef40('0xe')]))[_0xef40('0xb')](_0xef40('0xf'),_0x53a44a);var _0x320cfb=_0x5a9eac||{};var _0x57965b=_0x608f92[_0xef40('0x10')]('.');var _0x67146d={'uniqueid':_0x31a3c,'channel':_0x57965b[0x0],'id':_0x57965b[0x1],'title':_0x57965b[0x0]+_0xef40('0x11'),'interactionId':_0x57965b[0x2],'queue':_0x1d6aba?_0x1d6aba[_0xef40('0xe')]:null,'sound':_0x320cfb[_0xef40('0x12')][_0xef40('0x13')],'shake':_0x320cfb[_0xef40('0x12')]['notificationShake']};try{if(!_0x320cfb[_0xef40('0x14')]){_0x320cfb[_0xef40('0x14')]={};}if(_0x1d6aba){_0x320cfb['body']['queue']=_0x1d6aba;}else if(_0x320cfb[_0xef40('0x14')][_0xef40('0x15')]){delete _0x320cfb[_0xef40('0x14')][_0xef40('0x15')];}_0x67146d[_0xef40('0x16')]=utils[_0xef40('0x17')](_0x320cfb[_0xef40('0x12')][_0xef40('0x18')],_0x320cfb);}catch(_0x57761a){_0x67146d['msg']=_0xef40('0x19');logger[_0xef40('0x1a')](util[_0xef40('0xc')](_0xef40('0x1b'),_0x31a3c,_0x57761a[_0xef40('0x1c')]));}io['to'](util[_0xef40('0xc')](_0xef40('0xd'),_0x53a44a[_0xef40('0xe')]))[_0xef40('0xb')](util[_0xef40('0xc')](_0xef40('0x1d'),_0x522ad8?_0xef40('0x1e'):_0xef40('0x1f')),_0x67146d);}function writeLog(_0x5a5547,_0x55a43c,_0x272f93){return logger['info'](util[_0xef40('0xc')](_0xef40('0x20'),_0x5a5547,_0x55a43c[_0xef40('0xe')],_0x272f93));}exports['isAgentAvailable']=function(_0x2a167c,_0x104f10,_0x3450a7,_0x14b4fc){if(_0x104f10['busy']){writeLog(_0x2a167c,_0x104f10,_0xef40('0x21'));return![];}if(!_0x104f10[_0xef40('0x22')]){writeLog(_0x2a167c,_0x104f10,_0xef40('0x23'));return![];}if(_0x104f10[_0x3450a7+'Pause']){writeLog(_0x2a167c,_0x104f10,'PAUSE');return![];}if(_0x14b4fc&&_0x104f10[_0xef40('0x24')](_0x3450a7+'Capacity')&&_0x104f10[_0xef40('0x24')](_0x3450a7+_0xef40('0x25'))){if(_0x104f10[_0x3450a7+_0xef40('0x26')]>0x0&&_0x104f10[_0x3450a7+'CurrentCapacity']>=_0x104f10[_0x3450a7+_0xef40('0x26')]){writeLog(_0x2a167c,_0x104f10,_0x3450a7[_0xef40('0x27')]()+_0xef40('0x28'));return![];}}return!![];};exports[_0xef40('0x29')]=function(_0x17aced,_0x5c1a20,_0x36af4a,_0x138179,_0x324591){return sendNotification(!![],_0x17aced,_0x5c1a20,_0x36af4a,_0x138179,_0x324591);};exports['hideNotification']=function(_0x583f12,_0x5883cf,_0x7218eb,_0x1b7940,_0x132314){return sendNotification(![],_0x583f12,_0x5883cf,_0x7218eb,_0x1b7940,_0x132314);};exports[_0xef40('0x2a')]=writeLog;
\ No newline at end of file
+var _0x655b=['account','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','message','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','hideNotification','lodash','ioredis','../../../../../config/environment','routing','redis','defaults','localhost','emit','format','user:%s','name','split','\x20interaction','notificationSound'];(function(_0xfb6a42,_0x31f9ce){var _0x2bfbce=function(_0x1b658a){while(--_0x1b658a){_0xfb6a42['push'](_0xfb6a42['shift']());}};_0x2bfbce(++_0x31f9ce);}(_0x655b,0xfc));var _0xb655=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x655b[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xb655('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0xb655('0x1'));var config=require(_0xb655('0x2'));var logger=require('../../../../../config/logger')(_0xb655('0x3'));config[_0xb655('0x4')]=_[_0xb655('0x5')](config[_0xb655('0x4')],{'host':_0xb655('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x361e8e,_0x13c490,_0x1a9a42){io['to'](_0x361e8e)[_0xb655('0x7')](_0x13c490,_0x1a9a42);}function sendNotification(_0x1a3fd9,_0x59524c,_0x792f29,_0x437499,_0x4d63b0,_0xba365e){io['to'](util[_0xb655('0x8')](_0xb655('0x9'),_0x437499[_0xb655('0xa')]))['emit']('user:save',_0x437499);var _0x2462dd=_0xba365e||{};var _0x298e9e=_0x792f29[_0xb655('0xb')]('.');var _0x4e7897={'uniqueid':_0x59524c,'channel':_0x298e9e[0x0],'id':_0x298e9e[0x1],'title':_0x298e9e[0x0]+_0xb655('0xc'),'interactionId':_0x298e9e[0x2],'queue':_0x4d63b0?_0x4d63b0['name']:null,'sound':_0x2462dd['account'][_0xb655('0xd')],'shake':_0x2462dd[_0xb655('0xe')][_0xb655('0xf')]};try{if(!_0x2462dd[_0xb655('0x10')]){_0x2462dd[_0xb655('0x10')]={};}if(_0x4d63b0){_0x2462dd[_0xb655('0x10')][_0xb655('0x11')]=_0x4d63b0;}else if(_0x2462dd['body']['queue']){delete _0x2462dd[_0xb655('0x10')][_0xb655('0x11')];}_0x4e7897[_0xb655('0x12')]=utils[_0xb655('0x13')](_0x2462dd[_0xb655('0xe')]['notificationTemplate'],_0x2462dd);}catch(_0x9ff0cc){_0x4e7897[_0xb655('0x12')]=_0xb655('0x14');logger[_0xb655('0x15')](util['format']('[%s][QUEUE]\x20%s',_0x59524c,_0x9ff0cc[_0xb655('0x16')]));}io['to'](util[_0xb655('0x8')](_0xb655('0x9'),_0x437499[_0xb655('0xa')]))[_0xb655('0x7')](util[_0xb655('0x8')](_0xb655('0x17'),_0x1a3fd9?_0xb655('0x18'):'remove'),_0x4e7897);}function writeLog(_0x1c842b,_0x281f51,_0xf56a30){return logger[_0xb655('0x19')](util[_0xb655('0x8')](_0xb655('0x1a'),_0x1c842b,_0x281f51[_0xb655('0xa')],_0xf56a30));}exports[_0xb655('0x1b')]=function(_0x2f60b5,_0x740088,_0x1c18dc,_0x55574a){if(_0x740088[_0xb655('0x1c')]){writeLog(_0x2f60b5,_0x740088,_0xb655('0x1d'));return![];}if(!_0x740088[_0xb655('0x1e')]){writeLog(_0x2f60b5,_0x740088,_0xb655('0x1f'));return![];}if(_0x740088[_0x1c18dc+_0xb655('0x20')]){writeLog(_0x2f60b5,_0x740088,'PAUSE');return![];}if(_0x55574a&&_0x740088[_0xb655('0x21')](_0x1c18dc+_0xb655('0x22'))&&_0x740088[_0xb655('0x21')](_0x1c18dc+'CurrentCapacity')){if(_0x740088[_0x1c18dc+_0xb655('0x22')]>0x0&&_0x740088[_0x1c18dc+_0xb655('0x23')]>=_0x740088[_0x1c18dc+'Capacity']){writeLog(_0x2f60b5,_0x740088,_0x1c18dc[_0xb655('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x375f0f,_0x5a5ea2,_0x135311,_0x511ae2,_0x57f177){return sendNotification(!![],_0x375f0f,_0x5a5ea2,_0x135311,_0x511ae2,_0x57f177);};exports[_0xb655('0x25')]=function(_0x248614,_0x4e9b30,_0x536e3c,_0x335c99,_0x463d86){return sendNotification(![],_0x248614,_0x4e9b30,_0x536e3c,_0x335c99,_0x463d86);};exports['writeLog']=writeLog;
\ No newline at end of file
index b1c6de4..c43366f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabf2=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xabf2,0x163));var _0x2abf=function(_0x4537a5,_0x537a8f){_0x4537a5=_0x4537a5-0x0;var _0x24c87c=_0xabf2[_0x4537a5];return _0x24c87c;};'use strict';var schema=require(_0x2abf('0x0'));var sh=require('shelljs');var _=require(_0x2abf('0x1'));var utils=require(_0x2abf('0x2'));var logger=require(_0x2abf('0x3'))(_0x2abf('0x4'));var system=schema({'command':{'type':_0x2abf('0x5'),'required':!![],'message':_0x2abf('0x6')}});exports[_0x2abf('0x7')]=function(_0xdb84c6,_0x22a2b6){return function(_0x46e706){try{var _0x4b13e3={'command':_0x22a2b6[0x0]};var _0x3355a7=system['validate'](_0x4b13e3,{'typecast':!![]});if(_0x3355a7['length']){logger['error'](_0x2abf('0x8'),_0xdb84c6,_[_0x2abf('0x9')](_0x3355a7,_0x2abf('0xa'))[_0x2abf('0xb')](',\x20'));logger[_0x2abf('0xc')](_0x2abf('0xd'),_0xdb84c6);_0x46e706['next']();}else{var _0x4a8883=this;var _0x4c9467=utils[_0x2abf('0xe')](_0x22a2b6[0x0],this);logger[_0x2abf('0xc')](_0x2abf('0xf'),_0xdb84c6,_0x4c9467);sh['exec'](_[_0x2abf('0x10')](_0x4c9467),function(_0x573af6,_0x415089){logger[_0x2abf('0xc')](_0x2abf('0x11'),_0xdb84c6,_0x573af6);if(_0x573af6==0x0){var _0x5971f9=_0x415089['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x22a2b6[0x1])||_[_0x2abf('0x12')](_0x22a2b6[0x1])){logger[_0x2abf('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0xdb84c6);_0x4a8883[_0x2abf('0x13')][_0x22a2b6[0x1]]=_0x5971f9;}else{logger['info'](_0x2abf('0x14'),_0xdb84c6,_0x22a2b6[0x1],_0x5971f9);_0x4a8883['body'][_0x22a2b6[0x1]]=_0x5971f9;}}_0x46e706[_0x2abf('0x15')]();});}}catch(_0x52aead){logger['error'](_0x2abf('0x8'),_0xdb84c6,_[_0x2abf('0x16')](_0x52aead)?JSON[_0x2abf('0x17')](_0x52aead):_0x52aead);logger[_0x2abf('0xc')](_0x2abf('0xd'),_0xdb84c6);_0x46e706[_0x2abf('0x15')]();}};};
\ No newline at end of file
+var _0xac95=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x36aafa,_0x3955c9){var _0x4b50b8=function(_0x1317d4){while(--_0x1317d4){_0x36aafa['push'](_0x36aafa['shift']());}};_0x4b50b8(++_0x3955c9);}(_0xac95,0x119));var _0x5ac9=function(_0x799374,_0x985d8a){_0x799374=_0x799374-0x0;var _0x384ce6=_0xac95[_0x799374];return _0x384ce6;};'use strict';var schema=require(_0x5ac9('0x0'));var sh=require(_0x5ac9('0x1'));var _=require(_0x5ac9('0x2'));var utils=require(_0x5ac9('0x3'));var logger=require(_0x5ac9('0x4'))(_0x5ac9('0x5'));var system=schema({'command':{'type':_0x5ac9('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x5ac9('0x7')]=function(_0x31a833,_0xb50cc8){return function(_0x254631){try{var _0xb58b31={'command':_0xb50cc8[0x0]};var _0x4d5c95=system[_0x5ac9('0x0')](_0xb58b31,{'typecast':!![]});if(_0x4d5c95[_0x5ac9('0x8')]){logger[_0x5ac9('0x9')](_0x5ac9('0xa'),_0x31a833,_[_0x5ac9('0xb')](_0x4d5c95,_0x5ac9('0xc'))[_0x5ac9('0xd')](',\x20'));logger[_0x5ac9('0xe')](_0x5ac9('0xf'),_0x31a833);_0x254631['next']();}else{var _0x1112d9=this;var _0x918f9d=utils['getMustacheRender'](_0xb50cc8[0x0],this);logger['info'](_0x5ac9('0x10'),_0x31a833,_0x918f9d);sh[_0x5ac9('0x11')](_[_0x5ac9('0x12')](_0x918f9d),function(_0x334d6d,_0x1f0262){logger[_0x5ac9('0xe')](_0x5ac9('0x13'),_0x31a833,_0x334d6d);if(_0x334d6d==0x0){var _0x7c25e8=_0x1f0262[_0x5ac9('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x5ac9('0x15')](_0xb50cc8[0x1])||_[_0x5ac9('0x16')](_0xb50cc8[0x1])){logger[_0x5ac9('0xe')](_0x5ac9('0x17'),_0x31a833);_0x1112d9['body'][_0xb50cc8[0x1]]=_0x7c25e8;}else{logger[_0x5ac9('0xe')](_0x5ac9('0x18'),_0x31a833,_0xb50cc8[0x1],_0x7c25e8);_0x1112d9['body'][_0xb50cc8[0x1]]=_0x7c25e8;}}_0x254631[_0x5ac9('0x19')]();});}}catch(_0x2bd56d){logger[_0x5ac9('0x9')](_0x5ac9('0xa'),_0x31a833,_[_0x5ac9('0x1a')](_0x2bd56d)?JSON['stringify'](_0x2bd56d):_0x2bd56d);logger[_0x5ac9('0xe')](_0x5ac9('0xf'),_0x31a833);_0x254631[_0x5ac9('0x19')]();}};};
\ No newline at end of file
index e64fd35..daea4f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x125378,_0x3a39bd){var _0x46d908=function(_0xd548d9){while(--_0xd548d9){_0x125378['push'](_0x125378['shift']());}};_0x46d908(++_0x3a39bd);}(_0x7a54,0x106));var _0x47a5=function(_0x457de2,_0x1357f7){_0x457de2=_0x457de2-0x0;var _0x58b9ab=_0x7a54[_0x457de2];return _0x58b9ab;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};};
\ No newline at end of file
+var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x801fb4,_0x32f0cd){var _0x314acf=function(_0x3d02f9){while(--_0x3d02f9){_0x801fb4['push'](_0x801fb4['shift']());}};_0x314acf(++_0x32f0cd);}(_0x7a54,0x106));var _0x47a5=function(_0x17d165,_0x15a0f1){_0x17d165=_0x17d165-0x0;var _0x5f4407=_0x7a54[_0x17d165];return _0x5f4407;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};};
\ No newline at end of file
index 05634cc..3e2312a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ce9=['list','mustache','lodash','exports','render','body','contact','message','account'];(function(_0x5bfa50,_0x13068){var _0x2dc4e7=function(_0x149256){while(--_0x149256){_0x5bfa50['push'](_0x5bfa50['shift']());}};_0x2dc4e7(++_0x13068);}(_0x6ce9,0x76));var _0x96ce=function(_0x5dc540,_0x1937e8){_0x5dc540=_0x5dc540-0x0;var _0x35526e=_0x6ce9[_0x5dc540];return _0x35526e;};'use strict';var Mustache=require(_0x96ce('0x0'));var _=require(_0x96ce('0x1'));module[_0x96ce('0x2')]={'getMustacheRender':function(_0x59dbfa,_0x48ccd5){return Mustache[_0x96ce('0x3')](_0x59dbfa,_['merge'](_0x48ccd5[_0x96ce('0x4')],{'contact':_0x48ccd5[_0x96ce('0x5')],'message':_0x48ccd5[_0x96ce('0x6')],'account':_0x48ccd5[_0x96ce('0x7')],'interaction':_0x48ccd5['interaction'],'list':_0x48ccd5[_0x96ce('0x8')]}))||'';}};
\ No newline at end of file
+var _0x0e85=['contact','account','interaction','list','mustache','lodash'];(function(_0x1c2c16,_0x48c169){var _0x3140f8=function(_0x3327ef){while(--_0x3327ef){_0x1c2c16['push'](_0x1c2c16['shift']());}};_0x3140f8(++_0x48c169);}(_0x0e85,0x7c));var _0x50e8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0e85[_0x59ee6f];return _0x4c0979;};'use strict';var Mustache=require(_0x50e8('0x0'));var _=require(_0x50e8('0x1'));module['exports']={'getMustacheRender':function(_0x11a13a,_0x682d10){return Mustache['render'](_0x11a13a,_['merge'](_0x682d10['body'],{'contact':_0x682d10[_0x50e8('0x2')],'message':_0x682d10['message'],'account':_0x682d10[_0x50e8('0x3')],'interaction':_0x682d10[_0x50e8('0x4')],'list':_0x682d10[_0x50e8('0x5')]}))||'';}};
\ No newline at end of file
index 039d8c6..523b754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e73=['interaction','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','emit','end','routing\x20is\x20empty'];(function(_0x5d3a2a,_0x2ea757){var _0x1d3fcd=function(_0x28825e){while(--_0x28825e){_0x5d3a2a['push'](_0x5d3a2a['shift']());}};_0x1d3fcd(++_0x2ea757);}(_0x4e73,0xe1));var _0x34e7=function(_0x349c69,_0x338f4e){_0x349c69=_0x349c69-0x0;var _0x37be81=_0x4e73[_0x349c69];return _0x37be81;};'use strict';var _=require(_0x34e7('0x0'));var util=require(_0x34e7('0x1'));var path=require(_0x34e7('0x2'));var fs=require('fs');var jayson=require(_0x34e7('0x3'));var BPromise=require(_0x34e7('0x4'));var uuid=require(_0x34e7('0x5'));var config=require(_0x34e7('0x6'));var logger=require(_0x34e7('0x7'))(_0x34e7('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0x34e7('0x9')),'mailQueueReport':require(_0x34e7('0xa')),'chatQueueReport':require(_0x34e7('0xb')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x34e7('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2fa1e3,_0x13f6f8,_0x78393f){return util[_0x34e7('0xd')](_0x34e7('0xe'),_0x2fa1e3,_0x13f6f8||0x0,_0x78393f||0x0);}function getIntervals(_0x25609a,_0x1c7d48){var _0x30ff96=[];if(!_[_0x34e7('0xf')](_0x1c7d48[_0x34e7('0x10')])&&!_[_0x34e7('0xf')](_0x25609a[_0x1c7d48[_0x34e7('0x10')]])&&!_[_0x34e7('0xf')](_0x25609a[_0x1c7d48['IntervalId']]['Intervals'])){_0x30ff96=_[_0x34e7('0x11')](_0x25609a[_0x1c7d48[_0x34e7('0x10')]][_0x34e7('0x12')],_0x34e7('0x13'));}else if(!_[_0x34e7('0xf')](_0x1c7d48[_0x34e7('0x13')])){_0x30ff96=[_0x1c7d48[_0x34e7('0x13')]];}return _0x30ff96;}exports[_0x34e7('0x14')]=function(_0x5b0b11){_0x5b0b11[_0x34e7('0x15')]={};return new BPromise(function(_0x224353,_0xd5add1){var _0xcdc42b={'Start':function(_0x237ee7){var _0x5ed1c0=this;return new Promise(function(_0x3a0790,_0x39eee1){if(_0x237ee7){try{var _0x3b653d=[];var _0x4586d5=getId(_0x237ee7[_0x34e7('0x16')],_0x237ee7[_0x34e7('0x17')]?_0x237ee7[_0x34e7('0x17')]['id']:0x0,_0x237ee7['interaction']?_0x237ee7['interaction']['id']:0x0);if(_0x237ee7[_0x34e7('0x18')]&&_[_0x34e7('0x19')](_0x237ee7[_0x34e7('0x18')])&&_0x237ee7['applications'][_0x34e7('0x1a')]){for(var _0x591d53=0x0;_0x591d53<_0x237ee7[_0x34e7('0x18')][_0x34e7('0x1a')];_0x591d53+=0x1){var _0x404746=_0x237ee7[_0x34e7('0x18')][_0x591d53];if(fs['existsSync'](path[_0x34e7('0x1b')](__dirname,_0x34e7('0x18'),_0x404746[_0x34e7('0x1c')]+_0x34e7('0x1d')))){var _0x391373=[];switch(_0x404746[_0x34e7('0x1c')][_0x34e7('0x1e')]()){case _0x34e7('0x1f'):var _0x5ec8b7=_0x404746[_0x34e7('0x20')][_0x34e7('0x21')](',');_0x391373[_0x34e7('0x22')](_0x5ec8b7[0x0]);_0x391373[_0x34e7('0x22')](_0x5ec8b7[_0x34e7('0x23')](0x1,_0x5ec8b7[_0x34e7('0x1a')])[_0x34e7('0x1b')](','));break;case _0x34e7('0x24'):var _0x5ec8b7=_0x404746['appdata'][_0x34e7('0x21')](',');_0x391373[_0x34e7('0x22')](_0x5ec8b7[0x0]);_0x391373[_0x34e7('0x22')](_0x5ec8b7[0x1]);_0x391373[_0x34e7('0x22')](_0x5ec8b7[_0x34e7('0x23')](0x2,_0x5ec8b7[_0x34e7('0x1a')])[_0x34e7('0x1b')](','));break;case _0x34e7('0x25'):var _0x5ec8b7=_0x404746['appdata']['split'](',');_0x391373[_0x34e7('0x22')](_0x5ec8b7[0x0]);_0x391373[_0x34e7('0x22')](_0x5ec8b7[0x1]);_0x391373['push'](_0x5ec8b7[0x2]);_0x391373['push'](_0x5ec8b7[0x3]);_0x391373['push'](_0x5ec8b7[_0x34e7('0x23')](0x4,_0x5ec8b7['length'])[_0x34e7('0x1b')](','));break;case'message':_0x391373[_0x34e7('0x22')](_0x404746['appdata']);break;case'tag':_0x391373[_0x34e7('0x22')](_0x404746[_0x34e7('0x26')]);_0x391373[_0x34e7('0x22')](_0x404746[_0x34e7('0x20')]);break;default:_0x391373=_[_0x34e7('0xf')](_0x404746[_0x34e7('0x20')])?[]:_0x404746[_0x34e7('0x20')][_0x34e7('0x21')](',');}var _0x400985={'id':util[_0x34e7('0xd')](_0x34e7('0x27'),_0x4586d5,_0x404746['id'],_0x404746['app']),'condition':require(_0x34e7('0x28'))[_0x34e7('0x29')](_0x4586d5,getIntervals(_0x5b0b11[_0x34e7('0x2a')],_0x404746),_0x5b0b11),'consequence':require(_0x34e7('0x2b')+_0x404746[_0x34e7('0x1c')])['consequence'](_0x4586d5,_0x391373,_0x5b0b11,_0x237ee7),'p':_0x404746[_0x34e7('0x2c')]||0x0};logger[_0x34e7('0x2d')](_0x34e7('0x2e'),_0x400985['id'],_0x34e7('0x2f'),getIntervals(_0x5b0b11[_0x34e7('0x2a')],_0x404746)['join'](_0x34e7('0x30')));_0x3b653d[_0x34e7('0x22')](_0x400985);}else{logger[_0x34e7('0x31')](_0x34e7('0x32'),path[_0x34e7('0x1b')](__dirname,'applications',_0x404746[_0x34e7('0x1c')]+_0x34e7('0x1d')));}}_0x5b0b11[_0x34e7('0x15')][_0x4586d5]=new RuleEngine(_0x3b653d);_0x5b0b11[_0x34e7('0x15')][_0x4586d5]['execute'](_0x237ee7,function(_0x105f68){logger[_0x34e7('0x2d')]('Applications\x20executed',JSON['stringify'](_0x105f68['matchPath']));if(_0x5b0b11[_0x34e7('0x15')][_0x4586d5]){_0x5b0b11['rules'][_0x4586d5][_0x34e7('0x33')](_0x34e7('0x34'));}});return _0x3a0790({'code':0xc8,'message':_0x237ee7});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x3a0790({'code':0xc8,'message':_0x237ee7});}}catch(_0x5acf35){logger[_0x34e7('0x31')](_0x5acf35['stack']);return _0x39eee1(_0x5ed1c0[_0x34e7('0x31')](0x1f4,_0x5acf35));}}return _0x39eee1(_0x34e7('0x35'));});},'AcceptMessage':function(_0x140c50){var _0x38eb5f=this;return new Promise(function(_0x114d75,_0x52bd6e){if(_0x140c50[_0x34e7('0x17')]&&_0x140c50[_0x34e7('0x17')]['id']){try{var _0x353ca9=getId(_0x140c50[_0x34e7('0x16')],_0x140c50[_0x34e7('0x17')]?_0x140c50[_0x34e7('0x17')]['id']:0x0,_0x140c50[_0x34e7('0x36')]?_0x140c50[_0x34e7('0x36')]['id']:0x0);if(_0x5b0b11[_0x34e7('0x15')][_0x353ca9]){_0x5b0b11[_0x34e7('0x15')][_0x353ca9][_0x34e7('0x33')]('end');if(rpc[_0x140c50['channel']+_0x34e7('0x37')]){rpc[_0x140c50[_0x34e7('0x16')]+_0x34e7('0x37')][_0x34e7('0x38')](_0x353ca9,{'UserId':_0x140c50[_0x34e7('0x17')][_0x34e7('0x39')]})[_0x34e7('0x3a')](function(_0xcca166){logger[_0x34e7('0x31')](_0x34e7('0x3b'));});}}return _0x114d75({'code':0xc8,'message':_0x140c50});}catch(_0x413357){logger[_0x34e7('0x31')](_0x413357['stack']);return _0x52bd6e(_0x38eb5f['error'](0x1f4,_0x413357));}}logger['error']('message\x20is\x20empty');return _0x52bd6e(_0x38eb5f['error'](0x1f4,_0x34e7('0x3c')));});},'RejectMessage':function(_0x5ac76b){var _0xff92e7=this;return new Promise(function(_0x485cb7,_0x33e7d1){if(_0x5ac76b[_0x34e7('0x3d')]&&_0x5ac76b[_0x34e7('0x3d')]['id']){try{if(_0x5b0b11[_0x34e7('0x3e')][_0x5ac76b['agent']['id']]){_0x5b0b11[_0x34e7('0x3e')][_0x5ac76b['agent']['id']][_0x34e7('0x3f')]=![];_0x5b0b11[_0x34e7('0x3e')][_0x5ac76b['agent']['id']][_0x34e7('0x40')]=undefined;}return _0x485cb7({'code':0xc8,'message':_0x5ac76b});}catch(_0x28cba8){logger['error'](_0x28cba8[_0x34e7('0x41')]);return _0x33e7d1(_0xff92e7['error'](0x1f4,_0x28cba8));}}logger[_0x34e7('0x31')](_0x34e7('0x3c'));return _0x33e7d1(_0xff92e7[_0x34e7('0x31')](0x1f4,_0x34e7('0x3c')));});},'AbandonInteraction':function(_0x2b724d){var _0x73bde8=this;return new Promise(function(_0x37f4fd,_0x194dc3){if(_0x2b724d[_0x34e7('0x16')]&&_0x2b724d[_0x34e7('0x36')]&&_0x2b724d[_0x34e7('0x36')]['id']){try{var _0xc9682b=getId(_0x2b724d[_0x34e7('0x16')],_0x2b724d[_0x34e7('0x17')]?_0x2b724d[_0x34e7('0x17')]['id']:0x0,_0x2b724d[_0x34e7('0x36')]?_0x2b724d[_0x34e7('0x36')]['id']:0x0);if(_0x5b0b11[_0x34e7('0x15')][_0xc9682b]){_0x5b0b11[_0x34e7('0x15')][_0xc9682b]['emit'](_0x34e7('0x34'));}return _0x37f4fd({'code':0xc8,'message':_0x2b724d});}catch(_0x478694){logger['error'](_0x478694[_0x34e7('0x41')]);return _0x194dc3(_0x73bde8[_0x34e7('0x31')](0x1f4,_0x478694));}}logger[_0x34e7('0x31')](_0x34e7('0x3c'));return _0x194dc3(_0x73bde8[_0x34e7('0x31')](0x1f4,_0x34e7('0x3c')));});},'AgentCapacity':function(_0x12982e){var _0x21573a=this;return new Promise(function(_0x4ece47,_0x5cc484){if(_0x5b0b11['agents'][_0x34e7('0x42')](_0x12982e['id'])){for(var _0x474a3b in _0x12982e[_0x34e7('0x43')]){if(_0x12982e[_0x34e7('0x43')][_0x34e7('0x42')](_0x474a3b)){if(_0x5b0b11['agents'][_0x12982e['id']][_0x34e7('0x42')](_0x474a3b+'CurrentCapacity')){_0x5b0b11[_0x34e7('0x3e')][_0x12982e['id']][_0x474a3b+_0x34e7('0x44')]=parseInt(_0x12982e[_0x34e7('0x43')][_0x474a3b],0xa);}}}_0x5b0b11['agents'][_0x12982e['id']][_0x34e7('0x45')]();return _0x4ece47({'code':0xc8,'message':_0x5b0b11['agents'][_0x12982e['id']]});}else{return _0x5cc484(_0x21573a[_0x34e7('0x31')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x53450d){return new Promise(function(_0x253137,_0x2c38a9){var _0x5d158e=_['values'](_0x5b0b11['agents']);_0x253137({'count':_0x5d158e[_0x34e7('0x1a')],'rows':_0x5d158e});});},'ChatQueues':function(_0x202597){return new Promise(function(_0x27b9e1,_0x1522f5){var _0x322458=[];for(var _0x26e061 in _0x5b0b11[_0x34e7('0x46')]){if(_0x5b0b11['chatQueues'][_0x34e7('0x42')](_0x26e061)){var _0x17fc29=_0x5b0b11[_0x34e7('0x46')][_0x26e061];var _0x51c7b3={'id':_0x17fc29['id'],'available':_0x17fc29[_0x34e7('0x47')],'loggedIn':_0x17fc29[_0x34e7('0x48')],'name':_0x17fc29[_0x34e7('0x49')],'paused':_0x17fc29[_0x34e7('0x4a')],'waiting':_0x17fc29[_0x34e7('0x4b')]};_0x322458['push'](_0x51c7b3);}}_0x27b9e1({'count':_0x322458[_0x34e7('0x1a')],'rows':_0x322458});});},'MailQueues':function(_0x1613c3){return new Promise(function(_0x50c7a3,_0x2d098f){var _0x2b6a99=[];for(var _0x3a8f47 in _0x5b0b11[_0x34e7('0x4c')]){if(_0x5b0b11[_0x34e7('0x4c')][_0x34e7('0x42')](_0x3a8f47)){var _0x5a9af8=_0x5b0b11[_0x34e7('0x4c')][_0x3a8f47];var _0x3af254={'id':_0x5a9af8['id'],'available':_0x5a9af8[_0x34e7('0x47')],'loggedIn':_0x5a9af8[_0x34e7('0x48')],'name':_0x5a9af8[_0x34e7('0x49')],'paused':_0x5a9af8[_0x34e7('0x4a')],'waiting':_0x5a9af8['waiting']};_0x2b6a99[_0x34e7('0x22')](_0x3af254);}}_0x50c7a3({'count':_0x2b6a99['length'],'rows':_0x2b6a99});});},'OpenchannelQueues':function(_0xac9785){return new Promise(function(_0x54bb7a,_0x39c48c){var _0x3e1c3d=[];for(var _0x5aad48 in _0x5b0b11['openchannelQueues']){if(_0x5b0b11[_0x34e7('0x4d')][_0x34e7('0x42')](_0x5aad48)){var _0x4960d9=_0x5b0b11[_0x34e7('0x4d')][_0x5aad48];var _0x311646={'id':_0x4960d9['id'],'available':_0x4960d9[_0x34e7('0x47')],'loggedIn':_0x4960d9[_0x34e7('0x48')],'name':_0x4960d9[_0x34e7('0x49')],'paused':_0x4960d9[_0x34e7('0x4a')],'waiting':_0x4960d9['waiting']};_0x3e1c3d[_0x34e7('0x22')](_0x311646);}}_0x54bb7a({'count':_0x3e1c3d[_0x34e7('0x1a')],'rows':_0x3e1c3d});});},'SmsQueues':function(_0x57b850){return new Promise(function(_0x238fb9,_0x1b95d0){var _0x465971=[];for(var _0x1c65ea in _0x5b0b11[_0x34e7('0x4e')]){if(_0x5b0b11[_0x34e7('0x4e')]['hasOwnProperty'](_0x1c65ea)){var _0x1b6b39=_0x5b0b11['smsQueues'][_0x1c65ea];var _0xe42724={'id':_0x1b6b39['id'],'available':_0x1b6b39[_0x34e7('0x47')],'loggedIn':_0x1b6b39[_0x34e7('0x48')],'name':_0x1b6b39[_0x34e7('0x49')],'paused':_0x1b6b39[_0x34e7('0x4a')],'waiting':_0x1b6b39[_0x34e7('0x4b')]};_0x465971[_0x34e7('0x22')](_0xe42724);}}_0x238fb9({'count':_0x465971[_0x34e7('0x1a')],'rows':_0x465971});});},'FaxQueues':function(_0x2cdc1f){return new Promise(function(_0x1e0cf4,_0x25400f){var _0x4687d6=[];for(var _0x61e62e in _0x5b0b11[_0x34e7('0x4f')]){if(_0x5b0b11[_0x34e7('0x4f')]['hasOwnProperty'](_0x61e62e)){var _0x229985=_0x5b0b11[_0x34e7('0x4f')][_0x61e62e];var _0x3be1f7={'id':_0x229985['id'],'available':_0x229985[_0x34e7('0x47')],'loggedIn':_0x229985[_0x34e7('0x48')],'name':_0x229985[_0x34e7('0x49')],'paused':_0x229985[_0x34e7('0x4a')],'waiting':_0x229985[_0x34e7('0x4b')]};_0x4687d6[_0x34e7('0x22')](_0x3be1f7);}}_0x1e0cf4({'count':_0x4687d6[_0x34e7('0x1a')],'rows':_0x4687d6});});},'ChatQueuesWaitingInteractions':function(_0x4f16c9){return new Promise(function(_0x38b30b,_0x3942ee){var _0x411ba6=_[_0x34e7('0x50')](_0x5b0b11[_0x34e7('0x51')]);_0x38b30b({'count':_0x411ba6['length'],'rows':_0x411ba6});});},'MailQueuesWaitingInteractions':function(_0x58f6eb){return new Promise(function(_0x224715,_0x14486b){var _0x1cd93b=_['values'](_0x5b0b11[_0x34e7('0x52')]);_0x224715({'count':_0x1cd93b[_0x34e7('0x1a')],'rows':_0x1cd93b});});},'OpenchannelQueuesWaitingInteractions':function(_0x27d545){return new Promise(function(_0x401e7e,_0x96e6fe){var _0x31ff7d=_['values'](_0x5b0b11[_0x34e7('0x53')]);_0x401e7e({'count':_0x31ff7d[_0x34e7('0x1a')],'rows':_0x31ff7d});});},'SmsQueuesWaitingInteractions':function(_0x48c6bb){return new Promise(function(_0x234234,_0xe0a290){var _0x525e8e=_[_0x34e7('0x50')](_0x5b0b11[_0x34e7('0x54')]);_0x234234({'count':_0x525e8e[_0x34e7('0x1a')],'rows':_0x525e8e});});},'FaxQueuesWaitingInteractions':function(_0x5dec4b){return new Promise(function(_0x5f50cb,_0x2c3048){var _0x1484e0=_['values'](_0x5b0b11[_0x34e7('0x55')]);_0x5f50cb({'count':_0x1484e0[_0x34e7('0x1a')],'rows':_0x1484e0});});}};var _0x4c8a25=jayson[_0x34e7('0x56')](_0xcdc42b)[_0x34e7('0x57')]();_0x4c8a25['on'](_0x34e7('0x31'),function(_0x6da539){logger[_0x34e7('0x31')](JSON[_0x34e7('0x58')](_0x6da539));return _0xd5add1(_0x6da539);});_0x4c8a25[_0x34e7('0x14')](0x232c,_0x34e7('0x59'),function(){console[_0x34e7('0x5a')](_0x34e7('0x5b'),0x232c);return _0x224353(_0x34e7('0x5c')+0x232c);});});};
\ No newline at end of file
+var _0xc088=['error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','channel','QueueReport','update','UserId','catch','message\x20is\x20empty','agent','agents','busy','busyQueue','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','../../../config/environment','../../../config/logger','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','split','push','slice','dialogflow','appdata','amazonlex','tag','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0xc088,0x13d));var _0x8c08=function(_0x53ef4c,_0xa11f7f){_0x53ef4c=_0x53ef4c-0x0;var _0x3acaf4=_0xc088[_0x53ef4c];return _0x3acaf4;};'use strict';var _=require(_0x8c08('0x0'));var util=require(_0x8c08('0x1'));var path=require(_0x8c08('0x2'));var fs=require('fs');var jayson=require(_0x8c08('0x3'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x8c08('0x4'));var logger=require(_0x8c08('0x5'))(_0x8c08('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x8c08('0x7')),'smsQueueReport':require(_0x8c08('0x8')),'faxQueueReport':require(_0x8c08('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x34b6a8,_0x589fd9,_0x4d1bd2){return util[_0x8c08('0xa')](_0x8c08('0xb'),_0x34b6a8,_0x589fd9||0x0,_0x4d1bd2||0x0);}function getIntervals(_0x4ccd8b,_0x1dc278){var _0x13dcd2=[];if(!_[_0x8c08('0xc')](_0x1dc278[_0x8c08('0xd')])&&!_['isNil'](_0x4ccd8b[_0x1dc278[_0x8c08('0xd')]])&&!_[_0x8c08('0xc')](_0x4ccd8b[_0x1dc278[_0x8c08('0xd')]]['Intervals'])){_0x13dcd2=_[_0x8c08('0xe')](_0x4ccd8b[_0x1dc278[_0x8c08('0xd')]][_0x8c08('0xf')],_0x8c08('0x10'));}else if(!_[_0x8c08('0xc')](_0x1dc278[_0x8c08('0x10')])){_0x13dcd2=[_0x1dc278[_0x8c08('0x10')]];}return _0x13dcd2;}exports[_0x8c08('0x11')]=function(_0x5ba141){_0x5ba141[_0x8c08('0x12')]={};return new BPromise(function(_0xf15b91,_0x6ef079){var _0x42c5af={'Start':function(_0xf743ba){var _0x5088fe=this;return new Promise(function(_0x55c94a,_0x53ed34){if(_0xf743ba){try{var _0x54653c=[];var _0x114432=getId(_0xf743ba['channel'],_0xf743ba[_0x8c08('0x13')]?_0xf743ba[_0x8c08('0x13')]['id']:0x0,_0xf743ba[_0x8c08('0x14')]?_0xf743ba[_0x8c08('0x14')]['id']:0x0);if(_0xf743ba[_0x8c08('0x15')]&&_[_0x8c08('0x16')](_0xf743ba['applications'])&&_0xf743ba[_0x8c08('0x15')]['length']){for(var _0x5be5a7=0x0;_0x5be5a7<_0xf743ba['applications'][_0x8c08('0x17')];_0x5be5a7+=0x1){var _0x4a61a4=_0xf743ba[_0x8c08('0x15')][_0x5be5a7];if(fs[_0x8c08('0x18')](path[_0x8c08('0x19')](__dirname,_0x8c08('0x15'),_0x4a61a4[_0x8c08('0x1a')]+_0x8c08('0x1b')))){var _0xb71ff9=[];switch(_0x4a61a4[_0x8c08('0x1a')]['toLowerCase']()){case'autoreply':var _0xe22629=_0x4a61a4['appdata'][_0x8c08('0x1c')](',');_0xb71ff9[_0x8c08('0x1d')](_0xe22629[0x0]);_0xb71ff9['push'](_0xe22629[_0x8c08('0x1e')](0x1,_0xe22629[_0x8c08('0x17')])[_0x8c08('0x19')](','));break;case _0x8c08('0x1f'):var _0xe22629=_0x4a61a4[_0x8c08('0x20')][_0x8c08('0x1c')](',');_0xb71ff9[_0x8c08('0x1d')](_0xe22629[0x0]);_0xb71ff9['push'](_0xe22629[0x1]);_0xb71ff9['push'](_0xe22629['slice'](0x2,_0xe22629[_0x8c08('0x17')])[_0x8c08('0x19')](','));break;case _0x8c08('0x21'):var _0xe22629=_0x4a61a4[_0x8c08('0x20')][_0x8c08('0x1c')](',');_0xb71ff9[_0x8c08('0x1d')](_0xe22629[0x0]);_0xb71ff9[_0x8c08('0x1d')](_0xe22629[0x1]);_0xb71ff9['push'](_0xe22629[0x2]);_0xb71ff9['push'](_0xe22629[0x3]);_0xb71ff9[_0x8c08('0x1d')](_0xe22629['slice'](0x4,_0xe22629['length'])['join'](','));break;case _0x8c08('0x13'):_0xb71ff9[_0x8c08('0x1d')](_0x4a61a4[_0x8c08('0x20')]);break;case _0x8c08('0x22'):_0xb71ff9[_0x8c08('0x1d')](_0x4a61a4['TagId']);_0xb71ff9['push'](_0x4a61a4[_0x8c08('0x20')]);break;default:_0xb71ff9=_[_0x8c08('0xc')](_0x4a61a4[_0x8c08('0x20')])?[]:_0x4a61a4[_0x8c08('0x20')][_0x8c08('0x1c')](',');}var _0x135a21={'id':util[_0x8c08('0xa')]('%s:%s:%s',_0x114432,_0x4a61a4['id'],_0x4a61a4[_0x8c08('0x1a')]),'condition':require(_0x8c08('0x23'))[_0x8c08('0x24')](_0x114432,getIntervals(_0x5ba141[_0x8c08('0x25')],_0x4a61a4),_0x5ba141),'consequence':require(_0x8c08('0x26')+_0x4a61a4[_0x8c08('0x1a')])['consequence'](_0x114432,_0xb71ff9,_0x5ba141,_0xf743ba),'p':_0x4a61a4[_0x8c08('0x27')]||0x0};logger[_0x8c08('0x28')](_0x8c08('0x29'),_0x135a21['id'],_0x8c08('0x2a'),getIntervals(_0x5ba141['intervals'],_0x4a61a4)['join']('\x20|\x20'));_0x54653c['push'](_0x135a21);}else{logger[_0x8c08('0x2b')](_0x8c08('0x2c'),path[_0x8c08('0x19')](__dirname,'applications',_0x4a61a4[_0x8c08('0x1a')]+'.js'));}}_0x5ba141[_0x8c08('0x12')][_0x114432]=new RuleEngine(_0x54653c);_0x5ba141['rules'][_0x114432][_0x8c08('0x2d')](_0xf743ba,function(_0x3d25fc){logger[_0x8c08('0x28')](_0x8c08('0x2e'),JSON[_0x8c08('0x2f')](_0x3d25fc[_0x8c08('0x30')]));if(_0x5ba141[_0x8c08('0x12')][_0x114432]){_0x5ba141[_0x8c08('0x12')][_0x114432][_0x8c08('0x31')]('end');}});return _0x55c94a({'code':0xc8,'message':_0xf743ba});}else{logger[_0x8c08('0x28')](_0x8c08('0x32'));return _0x55c94a({'code':0xc8,'message':_0xf743ba});}}catch(_0x3441d7){logger[_0x8c08('0x2b')](_0x3441d7[_0x8c08('0x33')]);return _0x53ed34(_0x5088fe[_0x8c08('0x2b')](0x1f4,_0x3441d7));}}return _0x53ed34(_0x8c08('0x34'));});},'AcceptMessage':function(_0x58d025){var _0x734499=this;return new Promise(function(_0x538ba0,_0x33f095){if(_0x58d025[_0x8c08('0x13')]&&_0x58d025[_0x8c08('0x13')]['id']){try{var _0x396a56=getId(_0x58d025[_0x8c08('0x35')],_0x58d025[_0x8c08('0x13')]?_0x58d025[_0x8c08('0x13')]['id']:0x0,_0x58d025[_0x8c08('0x14')]?_0x58d025['interaction']['id']:0x0);if(_0x5ba141[_0x8c08('0x12')][_0x396a56]){_0x5ba141[_0x8c08('0x12')][_0x396a56][_0x8c08('0x31')]('end');if(rpc[_0x58d025[_0x8c08('0x35')]+_0x8c08('0x36')]){rpc[_0x58d025[_0x8c08('0x35')]+_0x8c08('0x36')][_0x8c08('0x37')](_0x396a56,{'UserId':_0x58d025[_0x8c08('0x13')][_0x8c08('0x38')]})[_0x8c08('0x39')](function(_0x551a57){logger[_0x8c08('0x2b')]('error\x20update\x20queue\x20report');});}}return _0x538ba0({'code':0xc8,'message':_0x58d025});}catch(_0x131ee8){logger[_0x8c08('0x2b')](_0x131ee8['stack']);return _0x33f095(_0x734499[_0x8c08('0x2b')](0x1f4,_0x131ee8));}}logger['error']('message\x20is\x20empty');return _0x33f095(_0x734499[_0x8c08('0x2b')](0x1f4,_0x8c08('0x3a')));});},'RejectMessage':function(_0x57617b){var _0x292c35=this;return new Promise(function(_0x34355d,_0x28d33e){if(_0x57617b[_0x8c08('0x3b')]&&_0x57617b[_0x8c08('0x3b')]['id']){try{if(_0x5ba141['agents'][_0x57617b[_0x8c08('0x3b')]['id']]){_0x5ba141[_0x8c08('0x3c')][_0x57617b[_0x8c08('0x3b')]['id']][_0x8c08('0x3d')]=![];_0x5ba141[_0x8c08('0x3c')][_0x57617b[_0x8c08('0x3b')]['id']][_0x8c08('0x3e')]=undefined;}return _0x34355d({'code':0xc8,'message':_0x57617b});}catch(_0x335467){logger[_0x8c08('0x2b')](_0x335467[_0x8c08('0x33')]);return _0x28d33e(_0x292c35[_0x8c08('0x2b')](0x1f4,_0x335467));}}logger['error'](_0x8c08('0x3a'));return _0x28d33e(_0x292c35['error'](0x1f4,_0x8c08('0x3a')));});},'AbandonInteraction':function(_0x29ffa2){var _0x3c1bd3=this;return new Promise(function(_0x5102af,_0x289639){if(_0x29ffa2[_0x8c08('0x35')]&&_0x29ffa2[_0x8c08('0x14')]&&_0x29ffa2[_0x8c08('0x14')]['id']){try{var _0x31e820=getId(_0x29ffa2[_0x8c08('0x35')],_0x29ffa2[_0x8c08('0x13')]?_0x29ffa2['message']['id']:0x0,_0x29ffa2[_0x8c08('0x14')]?_0x29ffa2['interaction']['id']:0x0);if(_0x5ba141['rules'][_0x31e820]){_0x5ba141[_0x8c08('0x12')][_0x31e820][_0x8c08('0x31')](_0x8c08('0x3f'));}return _0x5102af({'code':0xc8,'message':_0x29ffa2});}catch(_0x12741d){logger['error'](_0x12741d['stack']);return _0x289639(_0x3c1bd3[_0x8c08('0x2b')](0x1f4,_0x12741d));}}logger[_0x8c08('0x2b')](_0x8c08('0x3a'));return _0x289639(_0x3c1bd3[_0x8c08('0x2b')](0x1f4,_0x8c08('0x3a')));});},'AgentCapacity':function(_0x2b25ca){var _0x2353c8=this;return new Promise(function(_0x4ef962,_0x4d025f){if(_0x5ba141[_0x8c08('0x3c')]['hasOwnProperty'](_0x2b25ca['id'])){for(var _0x58db64 in _0x2b25ca[_0x8c08('0x40')]){if(_0x2b25ca[_0x8c08('0x40')]['hasOwnProperty'](_0x58db64)){if(_0x5ba141[_0x8c08('0x3c')][_0x2b25ca['id']][_0x8c08('0x41')](_0x58db64+_0x8c08('0x42'))){_0x5ba141[_0x8c08('0x3c')][_0x2b25ca['id']][_0x58db64+_0x8c08('0x42')]=parseInt(_0x2b25ca[_0x8c08('0x40')][_0x58db64],0xa);}}}_0x5ba141['agents'][_0x2b25ca['id']][_0x8c08('0x43')]();return _0x4ef962({'code':0xc8,'message':_0x5ba141[_0x8c08('0x3c')][_0x2b25ca['id']]});}else{return _0x4d025f(_0x2353c8['error'](0x1f4,_0x8c08('0x44')));}});},'Agents':function(_0x1216fa){return new Promise(function(_0x5d9a5e,_0x1e44d9){var _0x2a92e5=_[_0x8c08('0x45')](_0x5ba141[_0x8c08('0x3c')]);_0x5d9a5e({'count':_0x2a92e5['length'],'rows':_0x2a92e5});});},'ChatQueues':function(_0x2a9ded){return new Promise(function(_0x5e03e0,_0x1e17f2){var _0x59cbb1=[];for(var _0x427238 in _0x5ba141[_0x8c08('0x46')]){if(_0x5ba141[_0x8c08('0x46')][_0x8c08('0x41')](_0x427238)){var _0x27d8cb=_0x5ba141[_0x8c08('0x46')][_0x427238];var _0x47bf24={'id':_0x27d8cb['id'],'available':_0x27d8cb[_0x8c08('0x47')],'loggedIn':_0x27d8cb['loggedIn'],'name':_0x27d8cb[_0x8c08('0x48')],'paused':_0x27d8cb[_0x8c08('0x49')],'waiting':_0x27d8cb[_0x8c08('0x4a')]};_0x59cbb1['push'](_0x47bf24);}}_0x5e03e0({'count':_0x59cbb1[_0x8c08('0x17')],'rows':_0x59cbb1});});},'MailQueues':function(_0x586e8b){return new Promise(function(_0x40833c,_0x287446){var _0x4ccce3=[];for(var _0x2e3792 in _0x5ba141[_0x8c08('0x4b')]){if(_0x5ba141['mailQueues'][_0x8c08('0x41')](_0x2e3792)){var _0x84191e=_0x5ba141[_0x8c08('0x4b')][_0x2e3792];var _0x338cb9={'id':_0x84191e['id'],'available':_0x84191e[_0x8c08('0x47')],'loggedIn':_0x84191e[_0x8c08('0x4c')],'name':_0x84191e[_0x8c08('0x48')],'paused':_0x84191e[_0x8c08('0x49')],'waiting':_0x84191e[_0x8c08('0x4a')]};_0x4ccce3[_0x8c08('0x1d')](_0x338cb9);}}_0x40833c({'count':_0x4ccce3[_0x8c08('0x17')],'rows':_0x4ccce3});});},'OpenchannelQueues':function(_0x3a1828){return new Promise(function(_0x19ba33,_0x54a4ad){var _0x4c8468=[];for(var _0x3b2e0c in _0x5ba141[_0x8c08('0x4d')]){if(_0x5ba141['openchannelQueues'][_0x8c08('0x41')](_0x3b2e0c)){var _0x591db0=_0x5ba141['openchannelQueues'][_0x3b2e0c];var _0xba8f35={'id':_0x591db0['id'],'available':_0x591db0[_0x8c08('0x47')],'loggedIn':_0x591db0['loggedIn'],'name':_0x591db0['name'],'paused':_0x591db0['paused'],'waiting':_0x591db0[_0x8c08('0x4a')]};_0x4c8468[_0x8c08('0x1d')](_0xba8f35);}}_0x19ba33({'count':_0x4c8468[_0x8c08('0x17')],'rows':_0x4c8468});});},'SmsQueues':function(_0x405462){return new Promise(function(_0x526770,_0x6d55e){var _0x18b1f1=[];for(var _0x32363e in _0x5ba141[_0x8c08('0x4e')]){if(_0x5ba141[_0x8c08('0x4e')][_0x8c08('0x41')](_0x32363e)){var _0x4818cd=_0x5ba141[_0x8c08('0x4e')][_0x32363e];var _0x19bfe6={'id':_0x4818cd['id'],'available':_0x4818cd[_0x8c08('0x47')],'loggedIn':_0x4818cd[_0x8c08('0x4c')],'name':_0x4818cd[_0x8c08('0x48')],'paused':_0x4818cd[_0x8c08('0x49')],'waiting':_0x4818cd[_0x8c08('0x4a')]};_0x18b1f1['push'](_0x19bfe6);}}_0x526770({'count':_0x18b1f1[_0x8c08('0x17')],'rows':_0x18b1f1});});},'FaxQueues':function(_0x2070d2){return new Promise(function(_0xfba085,_0x10a384){var _0x515dc8=[];for(var _0x1971e4 in _0x5ba141[_0x8c08('0x4f')]){if(_0x5ba141['faxQueues']['hasOwnProperty'](_0x1971e4)){var _0xf55d35=_0x5ba141[_0x8c08('0x4f')][_0x1971e4];var _0x4f4f81={'id':_0xf55d35['id'],'available':_0xf55d35['available'],'loggedIn':_0xf55d35['loggedIn'],'name':_0xf55d35['name'],'paused':_0xf55d35['paused'],'waiting':_0xf55d35['waiting']};_0x515dc8[_0x8c08('0x1d')](_0x4f4f81);}}_0xfba085({'count':_0x515dc8[_0x8c08('0x17')],'rows':_0x515dc8});});},'ChatQueuesWaitingInteractions':function(_0x468bbd){return new Promise(function(_0xc8564f,_0x1dc54a){var _0x46a8aa=_[_0x8c08('0x45')](_0x5ba141['chatQueuesWaitingInteractions']);_0xc8564f({'count':_0x46a8aa[_0x8c08('0x17')],'rows':_0x46a8aa});});},'MailQueuesWaitingInteractions':function(_0x31e930){return new Promise(function(_0x1bcf0a,_0x5c4983){var _0x26e037=_['values'](_0x5ba141[_0x8c08('0x50')]);_0x1bcf0a({'count':_0x26e037[_0x8c08('0x17')],'rows':_0x26e037});});},'OpenchannelQueuesWaitingInteractions':function(_0x2f4060){return new Promise(function(_0x4b710c,_0x4b0a43){var _0x4dfec9=_[_0x8c08('0x45')](_0x5ba141[_0x8c08('0x51')]);_0x4b710c({'count':_0x4dfec9[_0x8c08('0x17')],'rows':_0x4dfec9});});},'SmsQueuesWaitingInteractions':function(_0x5284fa){return new Promise(function(_0x5e4ffa,_0x482f11){var _0x376121=_['values'](_0x5ba141[_0x8c08('0x52')]);_0x5e4ffa({'count':_0x376121[_0x8c08('0x17')],'rows':_0x376121});});},'FaxQueuesWaitingInteractions':function(_0x5baa4f){return new Promise(function(_0x2b1616,_0x2db36a){var _0xccf41b=_[_0x8c08('0x45')](_0x5ba141[_0x8c08('0x53')]);_0x2b1616({'count':_0xccf41b[_0x8c08('0x17')],'rows':_0xccf41b});});}};var _0x2e8788=jayson[_0x8c08('0x54')](_0x42c5af)[_0x8c08('0x55')]();_0x2e8788['on'](_0x8c08('0x2b'),function(_0x4df624){logger[_0x8c08('0x2b')](JSON[_0x8c08('0x2f')](_0x4df624));return _0x6ef079(_0x4df624);});_0x2e8788[_0x8c08('0x11')](0x232c,_0x8c08('0x56'),function(){console[_0x8c08('0x57')](_0x8c08('0x58'),0x232c);return _0xf15b91(_0x8c08('0x59')+0x232c);});});};
\ No newline at end of file
index 669a2a8..13cd663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda63=['[%s][INTERVAL]\x20%s','all','some','when','join','\x20|\x20','util','bluebird','jayson/promise','lodash','client','http','then','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','true','error'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xda63,0x92));var _0x3da6=function(_0x3994af,_0xce88ab){_0x3994af=_0x3994af-0x0;var _0x17f151=_0xda63[_0x3994af];return _0x17f151;};'use strict';var util=require(_0x3da6('0x0'));var BPromise=require(_0x3da6('0x1'));var jayson=require(_0x3da6('0x2'));var _=require(_0x3da6('0x3'));var logger=require('../../../config/logger')('routing');var client=jayson[_0x3da6('0x4')][_0x3da6('0x5')]({'port':0x232a});function request(_0x4dfa01,_0x4daf50){return new BPromise(function(_0x39fdd6,_0x33218e){return client['request'](_0x4dfa01,_0x4daf50)[_0x3da6('0x6')](function(_0x6f9aea){if(_0x6f9aea['error']){return _0x33218e(_0x6f9aea['error'][_0x3da6('0x7')]);}else{return _0x39fdd6(_0x6f9aea[_0x3da6('0x8')]);}})[_0x3da6('0x9')](function(_0x5ddbe3){return _0x33218e(_0x5ddbe3);});});}exports[_0x3da6('0xa')]=function(_0x33eeaa,_0x378da8,_0x2d3fc8){return function(_0x147afc){if(_0x2d3fc8['rules']&&!_0x2d3fc8[_0x3da6('0xb')][_0x33eeaa]){logger[_0x3da6('0xc')](_0x3da6('0xd'),_0x33eeaa);return _0x147afc[_0x3da6('0xe')]();}var _0x1712ee=[];for(var _0x337860=0x0;_0x337860<_0x378da8[_0x3da6('0xf')];_0x337860+=0x1){_0x1712ee[_0x3da6('0x10')](request(_0x3da6('0x11'),{'command':util[_0x3da6('0x12')](_0x3da6('0x13'),_0x378da8[_0x337860])})[_0x3da6('0x6')](function(_0x46b240){return _0x46b240&&_0x46b240[_0x3da6('0x7')]&&_0x46b240[_0x3da6('0x7')]['indexOf'](_0x3da6('0x14'))>=0x0?!![]:![];})[_0x3da6('0x9')](function(_0x2ad8f){logger[_0x3da6('0x15')](_0x3da6('0x16'),_0x33eeaa,_0x378da8[_0x337860]);}));}BPromise[_0x3da6('0x17')](_0x1712ee)['then'](function(_0x487231){var _0x543870=_[_0x3da6('0x18')](_0x487231);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x33eeaa,_0x378da8['join']('\x20|\x20'),_0x543870);_0x147afc[_0x3da6('0x19')](_0x543870);})['catch'](function(_0x437361){console['log'](_0x437361);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x33eeaa,_0x378da8[_0x3da6('0x1a')](_0x3da6('0x1b')),_0x437361['stack']);_0x147afc[_0x3da6('0xe')]();});};};
\ No newline at end of file
+var _0x3565=['info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','then','some','\x20|\x20','when','catch','log','[%s][INTERVAL]\x20%s\x20%s','join','util','bluebird','lodash','../../../config/logger','routing','request','error','message','result','condition','rules'];(function(_0x49dcc3,_0x2935df){var _0x4b1e08=function(_0x4e46a5){while(--_0x4e46a5){_0x49dcc3['push'](_0x49dcc3['shift']());}};_0x4b1e08(++_0x2935df);}(_0x3565,0xce));var _0x5356=function(_0x3fff45,_0x2c8190){_0x3fff45=_0x3fff45-0x0;var _0x8b451e=_0x3565[_0x3fff45];return _0x8b451e;};'use strict';var util=require(_0x5356('0x0'));var BPromise=require(_0x5356('0x1'));var jayson=require('jayson/promise');var _=require(_0x5356('0x2'));var logger=require(_0x5356('0x3'))(_0x5356('0x4'));var client=jayson['client']['http']({'port':0x232a});function request(_0x135bf5,_0x3ba974){return new BPromise(function(_0x35dcc5,_0x2d7412){return client[_0x5356('0x5')](_0x135bf5,_0x3ba974)['then'](function(_0x3873d8){if(_0x3873d8[_0x5356('0x6')]){return _0x2d7412(_0x3873d8[_0x5356('0x6')][_0x5356('0x7')]);}else{return _0x35dcc5(_0x3873d8[_0x5356('0x8')]);}})['catch'](function(_0x28d3de){return _0x2d7412(_0x28d3de);});});}exports[_0x5356('0x9')]=function(_0x415eb1,_0x8df704,_0x294ecc){return function(_0x6a4b42){if(_0x294ecc[_0x5356('0xa')]&&!_0x294ecc['rules'][_0x415eb1]){logger[_0x5356('0xb')](_0x5356('0xc'),_0x415eb1);return _0x6a4b42[_0x5356('0xd')]();}var _0xb8ab88=[];for(var _0x5c77d4=0x0;_0x5c77d4<_0x8df704[_0x5356('0xe')];_0x5c77d4+=0x1){_0xb8ab88[_0x5356('0xf')](request(_0x5356('0x10'),{'command':util[_0x5356('0x11')](_0x5356('0x12'),_0x8df704[_0x5c77d4])})['then'](function(_0x4d6c1a){return _0x4d6c1a&&_0x4d6c1a[_0x5356('0x7')]&&_0x4d6c1a['message'][_0x5356('0x13')](_0x5356('0x14'))>=0x0?!![]:![];})['catch'](function(_0x565439){logger['error'](_0x5356('0x15'),_0x415eb1,_0x8df704[_0x5c77d4]);}));}BPromise[_0x5356('0x16')](_0xb8ab88)[_0x5356('0x17')](function(_0x159dd4){var _0x288c36=_[_0x5356('0x18')](_0x159dd4);logger[_0x5356('0xb')]('[%s][INTERVAL]\x20%s\x20%s',_0x415eb1,_0x8df704['join'](_0x5356('0x19')),_0x288c36);_0x6a4b42[_0x5356('0x1a')](_0x288c36);})[_0x5356('0x1b')](function(_0x2bc301){console[_0x5356('0x1c')](_0x2bc301);logger[_0x5356('0x6')](_0x5356('0x1d'),_0x415eb1,_0x8df704[_0x5356('0x1e')]('\x20|\x20'),_0x2bc301['stack']);_0x6a4b42[_0x5356('0xd')]();});};};
\ No newline at end of file
index e317412..870fe8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e34=['transfer','lodash','util','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','agentacw','acwTimeout','request','CreateVoiceAgentReport','destchannel','agentringnoanswer','agentconnect','agentcalled','assign','now','called','isNil','rejected','queuecallerabandon','forIn','abandon','connect','destuniqueid','blindtransfer','transfererchannel','cdr','attendedtransfer','origtransfererchannel','clone','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfereecalleridname','transfereeconnectedlinenum','destinationchannel','agentconnectAt','endtime','diffTime','complete','agentringnoanswerAt','answertime','starttime'];(function(_0x4259cd,_0x32ffd6){var _0x4f5230=function(_0x24ca95){while(--_0x24ca95){_0x4259cd['push'](_0x4259cd['shift']());}};_0x4f5230(++_0x32ffd6);}(_0x0e34,0x1f0));var _0x40e3=function(_0x48aa18,_0x1de98d){_0x48aa18=_0x48aa18-0x0;var _0x4cc88a=_0x0e34[_0x48aa18];return _0x4cc88a;};'use strict';var _=require(_0x40e3('0x0'));var util=require(_0x40e3('0x1'));var utils=require(_0x40e3('0x2'));var agents={};var transfers={};function writeDB(_0x3154e0){utils[_0x40e3('0x3')](util['format'](_0x40e3('0x4'),_0x3154e0[_0x40e3('0x5')],_0x3154e0[_0x40e3('0x6')],_0x3154e0[_0x40e3('0x7')],_0x3154e0[_0x40e3('0x8')],_0x3154e0['interface'],_0x3154e0[_0x40e3('0x9')],_0x3154e0[_0x40e3('0xa')],_0x3154e0[_0x40e3('0xb')]));if(_0x3154e0['queue']){utils[_0x40e3('0xc')](_0x3154e0[_0x40e3('0x7')])[_0x40e3('0xd')](function(_0x471c53){if(_0x471c53){_0x3154e0[_0x40e3('0xe')]=_0x471c53[_0x40e3('0xe')];_0x3154e0['agentacw']=_0x3154e0[_0x40e3('0xf')]?_0x471c53[_0x40e3('0x10')]:![];_0x3154e0['acwtime']=_0x3154e0[_0x40e3('0x11')]?_0x471c53[_0x40e3('0x12')]:null;}utils[_0x40e3('0x13')](_0x40e3('0x14'),_0x3154e0);});}else{utils[_0x40e3('0x13')]('CreateVoiceAgentReport',_0x3154e0);}delete agents[_0x3154e0[_0x40e3('0x15')]];}function isClosed(_0x4eccaa){return _0x4eccaa[_0x40e3('0x16')]||_0x4eccaa[_0x40e3('0x17')]||_0x4eccaa[_0x40e3('0xf')];}exports[_0x40e3('0x18')]=function(_0x268825){agents[_0x268825[_0x40e3('0x15')]]=_[_0x40e3('0x19')](_0x268825,{'agentcalled':!![],'agentcalledAt':utils[_0x40e3('0x1a')](),'lastevent':_0x40e3('0x1b')});};exports['agentringnoanswer']=function(_0x500119){if(!_[_0x40e3('0x1c')](agents[_0x500119[_0x40e3('0x15')]])){agents[_0x500119['destchannel']]=_[_0x40e3('0x19')](agents[_0x500119['destchannel']],_0x500119,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0x40e3('0x1a')](),'lastevent':_0x40e3('0x1d'),'reason':_0x40e3('0x1d')});}};exports[_0x40e3('0x1e')]=function(_0x26f505){_[_0x40e3('0x1f')](agents,function(_0x3f5cd8,_0x15c460){if(_0x3f5cd8[_0x40e3('0x6')]==_0x26f505[_0x40e3('0x6')]){if(!isClosed(_0x3f5cd8)){_0x3f5cd8=_[_0x40e3('0x19')](_0x3f5cd8,{'agentringnoanswer':!![],'agentringnoanswerAt':utils['now'](),'lastevent':_0x40e3('0x20'),'reason':_0x40e3('0x20')});}}});};exports['agentconnect']=function(_0x363262){if(!_[_0x40e3('0x1c')](agents[_0x363262[_0x40e3('0x15')]])){agents[_0x363262[_0x40e3('0x15')]]=_[_0x40e3('0x19')](agents[_0x363262['destchannel']],_0x363262,{'agentconnect':!![],'agentconnectAt':utils[_0x40e3('0x1a')](),'lastevent':_0x40e3('0x21')});_[_0x40e3('0x1f')](agents,function(_0x181da6,_0x16bc09){if(_0x181da6[_0x40e3('0x6')]==_0x363262[_0x40e3('0x6')]){if(!isClosed(_0x181da6)){_0x181da6=_[_0x40e3('0x19')](_0x181da6,{'agentringnoanswer':!![],'agentringnoanswerAt':utils['now'](),'lastevent':'answered_elsewhere','reason':'answered_elsewhere','answeredelsewheredestinationuniqueid':_0x363262[_0x40e3('0x22')],'answeredelsewheremembername':_0x363262[_0x40e3('0x8')]});}}});}};exports['agentcomplete']=function(_0x368016){if(!_[_0x40e3('0x1c')](agents[_0x368016['destchannel']])){agents[_0x368016[_0x40e3('0x15')]]=_[_0x40e3('0x19')](agents[_0x368016['destchannel']],_0x368016,{'agentcomplete':!![],'agentcompleteAt':utils['now'](),'lastevent':'complete'});}};exports[_0x40e3('0x23')]=function(_0x52ee21){if(!_[_0x40e3('0x1c')](agents[_0x52ee21[_0x40e3('0x24')]])){this[_0x40e3('0x25')]({'destinationchannel':_0x52ee21[_0x40e3('0x24')]});}};exports[_0x40e3('0x26')]=function(_0x189a25){_[_0x40e3('0x1f')](agents,function(_0x1f68c7){if(_0x1f68c7['channel']==_0x189a25[_0x40e3('0x27')]){transfers[_0x1f68c7[_0x40e3('0x15')]]=_[_0x40e3('0x28')](_0x1f68c7);transfers[_0x1f68c7[_0x40e3('0x15')]]=_[_0x40e3('0x19')](transfers[_0x1f68c7[_0x40e3('0x15')]],{'channel':_0x189a25[_0x40e3('0x29')],'calleridname':_0x189a25[_0x40e3('0x2a')],'calleridnum':_0x189a25[_0x40e3('0x2b')]});}else if(_0x1f68c7['channel']==_0x189a25['secondtransfererchannel']){transfers[_0x1f68c7[_0x40e3('0x15')]]=_['clone'](_0x1f68c7);transfers[_0x1f68c7[_0x40e3('0x15')]]=_[_0x40e3('0x19')](transfers[_0x1f68c7[_0x40e3('0x15')]],{'channel':_0x189a25['transfereechannel'],'calleridname':_0x189a25[_0x40e3('0x2c')],'calleridnum':_0x189a25[_0x40e3('0x2d')]});}});};exports['cdr']=function(_0x5258d1){if(!_[_0x40e3('0x1c')](agents[_0x5258d1[_0x40e3('0x2e')]])){if(!_[_0x40e3('0x1c')](agents[_0x5258d1[_0x40e3('0x2e')]][_0x40e3('0x2f')])){agents[_0x5258d1[_0x40e3('0x2e')]]=_[_0x40e3('0x19')](agents[_0x5258d1['destinationchannel']],{'agentcomplete':!![],'agentcompleteAt':_0x5258d1[_0x40e3('0x30')],'holdtime':utils[_0x40e3('0x31')](agents[_0x5258d1[_0x40e3('0x2e')]][_0x40e3('0x2f')],agents[_0x5258d1['destinationchannel']]['agentcalledAt']),'talktime':utils['diffTime'](_0x5258d1[_0x40e3('0x30')],agents[_0x5258d1[_0x40e3('0x2e')]][_0x40e3('0x2f')]),'lastevent':_0x40e3('0x32')});}else if(_[_0x40e3('0x1c')](agents[_0x5258d1['destinationchannel']][_0x40e3('0x33')])){agents[_0x5258d1[_0x40e3('0x2e')]]=_['assign'](agents[_0x5258d1[_0x40e3('0x2e')]],{'agentringnoanswer':!![],'agentringnoanswerAt':_0x5258d1[_0x40e3('0x34')]||_0x5258d1[_0x40e3('0x35')],'reason':'unknown'});}writeDB(agents[_0x5258d1[_0x40e3('0x2e')]]);if(!_[_0x40e3('0x1c')](transfers[_0x5258d1['destinationchannel']])){agents[_0x5258d1['destinationchannel']]=_[_0x40e3('0x19')](transfers[_0x5258d1[_0x40e3('0x2e')]],{'agentcalledAt':utils[_0x40e3('0x1a')](),'agentconnectAt':transfers[_0x5258d1[_0x40e3('0x2e')]][_0x40e3('0x17')]?utils[_0x40e3('0x1a')]():null,'lastevent':'connect','reason':_0x40e3('0x36')});delete transfers[_0x5258d1[_0x40e3('0x2e')]];}}};
\ No newline at end of file
+var _0xc74b=['then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destchannel','agentringnoanswer','agentconnect','assign','now','called','isNil','rejected','queuecallerabandon','forIn','answered_elsewhere','destuniqueid','complete','blindtransfer','transfererchannel','cdr','attendedtransfer','origtransfererchannel','clone','transfertargetconnectedlinenum','secondtransfererchannel','transfereechannel','destinationchannel','endtime','agentconnectAt','agentcalledAt','agentringnoanswerAt','answertime','transfer','lodash','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName'];(function(_0x19560e,_0x5f56a9){var _0x5ae41b=function(_0x38fe8e){while(--_0x38fe8e){_0x19560e['push'](_0x19560e['shift']());}};_0x5ae41b(++_0x5f56a9);}(_0xc74b,0x1be));var _0xbc74=function(_0x29d70a,_0x63ff66){_0x29d70a=_0x29d70a-0x0;var _0x290225=_0xc74b[_0x29d70a];return _0x290225;};'use strict';var _=require(_0xbc74('0x0'));var util=require('util');var utils=require(_0xbc74('0x1'));var agents={};var transfers={};function writeDB(_0x1e9001){utils[_0xbc74('0x2')](util[_0xbc74('0x3')](_0xbc74('0x4'),_0x1e9001[_0xbc74('0x5')],_0x1e9001[_0xbc74('0x6')],_0x1e9001[_0xbc74('0x7')],_0x1e9001[_0xbc74('0x8')],_0x1e9001[_0xbc74('0x9')],_0x1e9001[_0xbc74('0xa')],_0x1e9001[_0xbc74('0xb')],_0x1e9001['lastevent']));if(_0x1e9001['queue']){utils[_0xbc74('0xc')](_0x1e9001['queue'])[_0xbc74('0xd')](function(_0x117706){if(_0x117706){_0x1e9001[_0xbc74('0xe')]=_0x117706[_0xbc74('0xe')];_0x1e9001[_0xbc74('0xf')]=_0x1e9001[_0xbc74('0x10')]?_0x117706[_0xbc74('0x11')]:![];_0x1e9001[_0xbc74('0x12')]=_0x1e9001[_0xbc74('0xf')]?_0x117706[_0xbc74('0x13')]:null;}utils[_0xbc74('0x14')](_0xbc74('0x15'),_0x1e9001);});}else{utils[_0xbc74('0x14')](_0xbc74('0x15'),_0x1e9001);}delete agents[_0x1e9001[_0xbc74('0x16')]];}function isClosed(_0x4c95d6){return _0x4c95d6[_0xbc74('0x17')]||_0x4c95d6[_0xbc74('0x18')]||_0x4c95d6[_0xbc74('0x10')];}exports['agentcalled']=function(_0x4bc3cc){agents[_0x4bc3cc[_0xbc74('0x16')]]=_[_0xbc74('0x19')](_0x4bc3cc,{'agentcalled':!![],'agentcalledAt':utils[_0xbc74('0x1a')](),'lastevent':_0xbc74('0x1b')});};exports[_0xbc74('0x17')]=function(_0x709cc7){if(!_[_0xbc74('0x1c')](agents[_0x709cc7[_0xbc74('0x16')]])){agents[_0x709cc7[_0xbc74('0x16')]]=_[_0xbc74('0x19')](agents[_0x709cc7[_0xbc74('0x16')]],_0x709cc7,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0xbc74('0x1a')](),'lastevent':_0xbc74('0x1d'),'reason':_0xbc74('0x1d')});}};exports[_0xbc74('0x1e')]=function(_0x4a7993){_[_0xbc74('0x1f')](agents,function(_0x168061,_0x5e2245){if(_0x168061[_0xbc74('0x6')]==_0x4a7993[_0xbc74('0x6')]){if(!isClosed(_0x168061)){_0x168061=_[_0xbc74('0x19')](_0x168061,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0xbc74('0x1a')](),'lastevent':'abandon','reason':'abandon'});}}});};exports['agentconnect']=function(_0x15225f){if(!_[_0xbc74('0x1c')](agents[_0x15225f[_0xbc74('0x16')]])){agents[_0x15225f[_0xbc74('0x16')]]=_[_0xbc74('0x19')](agents[_0x15225f[_0xbc74('0x16')]],_0x15225f,{'agentconnect':!![],'agentconnectAt':utils[_0xbc74('0x1a')](),'lastevent':'connect'});_['forIn'](agents,function(_0x3fa26c,_0x4168fc){if(_0x3fa26c[_0xbc74('0x6')]==_0x15225f[_0xbc74('0x6')]){if(!isClosed(_0x3fa26c)){_0x3fa26c=_[_0xbc74('0x19')](_0x3fa26c,{'agentringnoanswer':!![],'agentringnoanswerAt':utils[_0xbc74('0x1a')](),'lastevent':_0xbc74('0x20'),'reason':_0xbc74('0x20'),'answeredelsewheredestinationuniqueid':_0x15225f[_0xbc74('0x21')],'answeredelsewheremembername':_0x15225f[_0xbc74('0x8')]});}}});}};exports[_0xbc74('0x10')]=function(_0x3b7e2e){if(!_[_0xbc74('0x1c')](agents[_0x3b7e2e[_0xbc74('0x16')]])){agents[_0x3b7e2e[_0xbc74('0x16')]]=_[_0xbc74('0x19')](agents[_0x3b7e2e[_0xbc74('0x16')]],_0x3b7e2e,{'agentcomplete':!![],'agentcompleteAt':utils[_0xbc74('0x1a')](),'lastevent':_0xbc74('0x22')});}};exports[_0xbc74('0x23')]=function(_0x11726b){if(!_[_0xbc74('0x1c')](agents[_0x11726b[_0xbc74('0x24')]])){this[_0xbc74('0x25')]({'destinationchannel':_0x11726b['transfererchannel']});}};exports[_0xbc74('0x26')]=function(_0x1335f2){_['forIn'](agents,function(_0x1ac1ed){if(_0x1ac1ed[_0xbc74('0x6')]==_0x1335f2[_0xbc74('0x27')]){transfers[_0x1ac1ed[_0xbc74('0x16')]]=_[_0xbc74('0x28')](_0x1ac1ed);transfers[_0x1ac1ed[_0xbc74('0x16')]]=_[_0xbc74('0x19')](transfers[_0x1ac1ed[_0xbc74('0x16')]],{'channel':_0x1335f2['transfertargetchannel'],'calleridname':_0x1335f2['transfertargetcalleridname'],'calleridnum':_0x1335f2[_0xbc74('0x29')]});}else if(_0x1ac1ed[_0xbc74('0x6')]==_0x1335f2[_0xbc74('0x2a')]){transfers[_0x1ac1ed[_0xbc74('0x16')]]=_['clone'](_0x1ac1ed);transfers[_0x1ac1ed[_0xbc74('0x16')]]=_['assign'](transfers[_0x1ac1ed[_0xbc74('0x16')]],{'channel':_0x1335f2[_0xbc74('0x2b')],'calleridname':_0x1335f2['transfereecalleridname'],'calleridnum':_0x1335f2['transfereeconnectedlinenum']});}});};exports[_0xbc74('0x25')]=function(_0x43f9da){if(!_[_0xbc74('0x1c')](agents[_0x43f9da[_0xbc74('0x2c')]])){if(!_[_0xbc74('0x1c')](agents[_0x43f9da[_0xbc74('0x2c')]]['agentconnectAt'])){agents[_0x43f9da[_0xbc74('0x2c')]]=_['assign'](agents[_0x43f9da[_0xbc74('0x2c')]],{'agentcomplete':!![],'agentcompleteAt':_0x43f9da[_0xbc74('0x2d')],'holdtime':utils['diffTime'](agents[_0x43f9da[_0xbc74('0x2c')]][_0xbc74('0x2e')],agents[_0x43f9da[_0xbc74('0x2c')]][_0xbc74('0x2f')]),'talktime':utils['diffTime'](_0x43f9da['endtime'],agents[_0x43f9da['destinationchannel']][_0xbc74('0x2e')]),'lastevent':_0xbc74('0x22')});}else if(_['isNil'](agents[_0x43f9da[_0xbc74('0x2c')]][_0xbc74('0x30')])){agents[_0x43f9da[_0xbc74('0x2c')]]=_[_0xbc74('0x19')](agents[_0x43f9da['destinationchannel']],{'agentringnoanswer':!![],'agentringnoanswerAt':_0x43f9da[_0xbc74('0x31')]||_0x43f9da['starttime'],'reason':'unknown'});}writeDB(agents[_0x43f9da[_0xbc74('0x2c')]]);if(!_[_0xbc74('0x1c')](transfers[_0x43f9da['destinationchannel']])){agents[_0x43f9da[_0xbc74('0x2c')]]=_[_0xbc74('0x19')](transfers[_0x43f9da['destinationchannel']],{'agentcalledAt':utils[_0xbc74('0x1a')](),'agentconnectAt':transfers[_0x43f9da['destinationchannel']][_0xbc74('0x18')]?utils['now']():null,'lastevent':'connect','reason':_0xbc74('0x32')});delete transfers[_0x43f9da['destinationchannel']];}}};
\ No newline at end of file
index 2c58af0..94969cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5643=['application','toLowerCase','set','startsWith','cdr','appdata','split','lastIndexOf','connectedlinenum','assign','isBefore','starttime','isAfter','endtime','destinationchannel','duration','billableseconds','hangup','answertime','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','source','disposition','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','isNil','musiconholdstart','musiconholdstartAt','now','mohtime','diffTime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','destination','xmd-callerid-preview','xmd-callerid','callerid','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','routeid','newexten'];(function(_0x487b25,_0x175dc0){var _0xd53878=function(_0x3b5b87){while(--_0x3b5b87){_0x487b25['push'](_0x487b25['shift']());}};_0xd53878(++_0x175dc0);}(_0x5643,0x162));var _0x3564=function(_0x2b92ec,_0x14598d){_0x2b92ec=_0x2b92ec-0x0;var _0xb73a48=_0x5643[_0x2b92ec];return _0xb73a48;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var channels={};var timeouts={};function writeDB(_0x53e2ec){return function(){_0x53e2ec['answertime']=_0x53e2ec[_0x3564('0x0')]||null;utils[_0x3564('0x1')](util[_0x3564('0x2')](_0x3564('0x3'),_0x53e2ec['uniqueid'],_0x53e2ec[_0x3564('0x4')],_0x53e2ec[_0x3564('0x5')],_0x53e2ec['accountcode'],_0x53e2ec[_0x3564('0x6')],_0x53e2ec['destination'],_0x53e2ec['callerid'],_0x53e2ec[_0x3564('0x7')]));if(_0x53e2ec[_0x3564('0x8')]){utils['getUserByInternal'](_0x53e2ec['accountcode'])[_0x3564('0x9')](function(_0x5c8ed6){if(_0x5c8ed6){_0x53e2ec[_0x3564('0xa')]=_0x5c8ed6['id'];}utils[_0x3564('0xb')](_0x3564('0xc'),_0x53e2ec);});}else{utils[_0x3564('0xb')](_0x3564('0xc'),_0x53e2ec);}if(channels[_0x53e2ec[_0x3564('0x4')]]){delete channels[_0x53e2ec['channel']];}if(timeouts[_0x53e2ec['channel']]){delete timeouts[_0x53e2ec[_0x3564('0x4')]];}};}exports[_0x3564('0xd')]=function(_0x1b42bd){if(_[_0x3564('0xe')](channels[_0x1b42bd[_0x3564('0x4')]])){channels[_0x1b42bd[_0x3564('0x4')]]={'mohtime':0x0};}};exports[_0x3564('0xf')]=function(_0x85516d){if(!_['isNil'](channels[_0x85516d[_0x3564('0x4')]])){channels[_0x85516d[_0x3564('0x4')]][_0x3564('0x10')]=utils[_0x3564('0x11')]();}};exports['musiconholdstop']=function(_0x336686){if(!_['isNil'](channels[_0x336686[_0x3564('0x4')]])){if(!_[_0x3564('0xe')](channels[_0x336686[_0x3564('0x4')]][_0x3564('0x10')])){channels[_0x336686['channel']][_0x3564('0x12')]+=utils[_0x3564('0x13')](utils['now'](),channels[_0x336686[_0x3564('0x4')]][_0x3564('0x10')]);delete channels[_0x336686[_0x3564('0x4')]]['musiconholdstartAt'];}}};exports[_0x3564('0x14')]=function(_0x11a625){if(!_[_0x3564('0xe')](channels[_0x11a625[_0x3564('0x4')]])){if(!_[_0x3564('0xe')](_0x11a625[_0x3564('0x15')][_0x3564('0x16')])){channels[_0x11a625['channel']][_0x3564('0x6')]=_0x11a625[_0x3564('0x17')];}if(!_[_0x3564('0xe')](_0x11a625[_0x3564('0x15')][_0x3564('0x18')])){channels[_0x11a625[_0x3564('0x4')]][_0x3564('0x19')]=_0x11a625[_0x3564('0x17')];}if(!_['isNil'](_0x11a625[_0x3564('0x15')][_0x3564('0x1a')])||!_[_0x3564('0xe')](_0x11a625[_0x3564('0x15')][_0x3564('0x1b')])){channels[_0x11a625[_0x3564('0x4')]][_0x3564('0x1c')]=_0x11a625[_0x3564('0x17')];}if(!_[_0x3564('0xe')](_0x11a625[_0x3564('0x15')][_0x3564('0x1d')])){channels[_0x11a625[_0x3564('0x4')]][_0x3564('0x1e')]=_0x3564('0x1f');channels[_0x11a625[_0x3564('0x4')]][_0x3564('0x20')]=_0x11a625[_0x3564('0x17')];channels[_0x11a625['channel']][_0x3564('0x21')]=!![];}if(!_[_0x3564('0xe')](_0x11a625[_0x3564('0x15')][_0x3564('0x22')])){channels[_0x11a625[_0x3564('0x4')]][_0x3564('0x23')]=_0x11a625[_0x3564('0x17')];}if(!_[_0x3564('0xe')](_0x11a625[_0x3564('0x15')]['outboundrouteid'])){channels[_0x11a625[_0x3564('0x4')]][_0x3564('0x24')]=_0x11a625[_0x3564('0x17')];}}};exports[_0x3564('0x25')]=function(_0x456e80){if(!_['isNil'](channels[_0x456e80[_0x3564('0x4')]])){if(_0x456e80[_0x3564('0x26')][_0x3564('0x27')]()==_0x3564('0x28')&&_[_0x3564('0x29')](_0x456e80['appdata'][_0x3564('0x27')](),_0x3564('0x2a'))){var _0x36a44c=_0x456e80[_0x3564('0x2b')][_0x3564('0x2c')]('=');var _0x428c15=_0x36a44c[0x0]['substring'](_0x36a44c[0x0][_0x3564('0x2d')]('(')+0x1,_0x36a44c[0x0][_0x3564('0x2d')](')'));var _0x2d144a=_0x36a44c[0x1];channels[_0x456e80[_0x3564('0x4')]][_0x428c15]=_0x2d144a;}}};exports['agentcomplete']=function(_0x124735){if(!_[_0x3564('0xe')](channels[_0x124735[_0x3564('0x4')]])&&!_[_0x3564('0xe')](channels[_0x124735[_0x3564('0x4')]][_0x3564('0x21')])){channels[_0x124735[_0x3564('0x4')]]['accountcode']=_0x124735[_0x3564('0x2e')];}};exports[_0x3564('0x2a')]=function(_0x1af87b){if(!_['isNil'](channels[_0x1af87b[_0x3564('0x4')]])){if(_[_0x3564('0xe')](timeouts[_0x1af87b['channel']])){channels[_0x1af87b[_0x3564('0x4')]]=_[_0x3564('0x2f')](_0x1af87b,channels[_0x1af87b['channel']]);}else{clearTimeout(timeouts[_0x1af87b[_0x3564('0x4')]]);channels[_0x1af87b['channel']]=_['assign'](channels[_0x1af87b['channel']],{'starttime':utils[_0x3564('0x30')](_0x1af87b[_0x3564('0x31')],channels[_0x1af87b[_0x3564('0x4')]]['starttime'])?_0x1af87b[_0x3564('0x31')]:channels[_0x1af87b[_0x3564('0x4')]]['starttime'],'answertime':utils[_0x3564('0x30')](_0x1af87b[_0x3564('0x0')],channels[_0x1af87b[_0x3564('0x4')]][_0x3564('0x0')])?_0x1af87b[_0x3564('0x0')]:channels[_0x1af87b[_0x3564('0x4')]][_0x3564('0x0')]});if(utils[_0x3564('0x32')](_0x1af87b[_0x3564('0x33')],channels[_0x1af87b[_0x3564('0x4')]]['endtime'])){channels[_0x1af87b[_0x3564('0x4')]]=_[_0x3564('0x2f')](channels[_0x1af87b[_0x3564('0x4')]],{'endtime':_0x1af87b[_0x3564('0x33')],'destinationchannel':_[_0x3564('0x29')](_0x1af87b[_0x3564('0x34')],'Local/_attended@transfer')?channels[_0x1af87b[_0x3564('0x4')]]['destinationchannel']:_0x1af87b[_0x3564('0x34')]});}channels[_0x1af87b[_0x3564('0x4')]][_0x3564('0x35')]=utils['diffTime'](channels[_0x1af87b['channel']][_0x3564('0x33')],channels[_0x1af87b[_0x3564('0x4')]][_0x3564('0x31')]);channels[_0x1af87b['channel']][_0x3564('0x36')]=utils['diffTime'](channels[_0x1af87b[_0x3564('0x4')]]['endtime'],channels[_0x1af87b['channel']]['answertime']);if(_0x1af87b[_0x3564('0x1e')][_0x3564('0x27')]()!=_0x3564('0x37')){channels[_0x1af87b[_0x3564('0x4')]][_0x3564('0x20')]=_0x1af87b[_0x3564('0x20')];channels[_0x1af87b[_0x3564('0x4')]][_0x3564('0x1e')]=_0x1af87b['lastapplication'];}}timeouts[_0x1af87b['channel']]=setTimeout(writeDB(channels[_0x1af87b[_0x3564('0x4')]]),0x3e8);}};
\ No newline at end of file
+var _0xbe18=['musiconholdstartAt','varset','xmd-originatecalleridnum','value','xmd-phone','variable','xmd-callerid-preview','xmd-callerid','lastapplication','Queue','lastdata','queue','xmd-contactid','outboundrouteid','newexten','toLowerCase','set','appdata','cdr','split','lastIndexOf','agentcomplete','assign','starttime','isBefore','isAfter','endtime','startsWith','destinationchannel','Local/_attended@transfer','billableseconds','diffTime','hangup','lodash','util','answertime','format','uniqueid','type','source','destination','disposition','accountcode','getUserByInternal','request','CreateVoiceCallReport','channel','newchannel','linkedid','musiconholdstart','musiconholdstop','isNil','mohtime','now'];(function(_0x933f89,_0x4e0ecf){var _0x401d66=function(_0x83cd0c){while(--_0x83cd0c){_0x933f89['push'](_0x933f89['shift']());}};_0x401d66(++_0x4e0ecf);}(_0xbe18,0x19b));var _0x8be1=function(_0x37dec1,_0x38173d){_0x37dec1=_0x37dec1-0x0;var _0x3f7469=_0xbe18[_0x37dec1];return _0x3f7469;};'use strict';var _=require(_0x8be1('0x0'));var util=require(_0x8be1('0x1'));var utils=require('./utils');var channels={};var timeouts={};function writeDB(_0x22b2d5){return function(){_0x22b2d5['answertime']=_0x22b2d5[_0x8be1('0x2')]||null;utils['info'](util[_0x8be1('0x3')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x22b2d5[_0x8be1('0x4')],_0x22b2d5['channel'],_0x22b2d5[_0x8be1('0x5')],_0x22b2d5['accountcode'],_0x22b2d5[_0x8be1('0x6')],_0x22b2d5[_0x8be1('0x7')],_0x22b2d5['callerid'],_0x22b2d5[_0x8be1('0x8')]));if(_0x22b2d5[_0x8be1('0x9')]){utils[_0x8be1('0xa')](_0x22b2d5['accountcode'])['then'](function(_0x2469ee){if(_0x2469ee){_0x22b2d5['UserId']=_0x2469ee['id'];}utils[_0x8be1('0xb')](_0x8be1('0xc'),_0x22b2d5);});}else{utils['request'](_0x8be1('0xc'),_0x22b2d5);}if(channels[_0x22b2d5['channel']]){delete channels[_0x22b2d5[_0x8be1('0xd')]];}if(timeouts[_0x22b2d5[_0x8be1('0xd')]]){delete timeouts[_0x22b2d5[_0x8be1('0xd')]];}};}exports[_0x8be1('0xe')]=function(_0x5a6720){if(_['isNil'](channels[_0x5a6720[_0x8be1('0xd')]])&&_0x5a6720[_0x8be1('0x4')]==_0x5a6720[_0x8be1('0xf')]){channels[_0x5a6720['channel']]={'mohtime':0x0};if(_0x5a6720[_0x8be1('0x9')]){channels[_0x5a6720['channel']][_0x8be1('0x9')]=_0x5a6720[_0x8be1('0x9')];}}};exports[_0x8be1('0x10')]=function(_0x44a56e){if(!_['isNil'](channels[_0x44a56e[_0x8be1('0xd')]])){channels[_0x44a56e[_0x8be1('0xd')]]['musiconholdstartAt']=utils['now']();}};exports[_0x8be1('0x11')]=function(_0x121c29){if(!_[_0x8be1('0x12')](channels[_0x121c29[_0x8be1('0xd')]])){if(!_[_0x8be1('0x12')](channels[_0x121c29['channel']]['musiconholdstartAt'])){channels[_0x121c29[_0x8be1('0xd')]][_0x8be1('0x13')]+=utils['diffTime'](utils[_0x8be1('0x14')](),channels[_0x121c29[_0x8be1('0xd')]][_0x8be1('0x15')]);delete channels[_0x121c29['channel']][_0x8be1('0x15')];}}};exports[_0x8be1('0x16')]=function(_0x9e82ec){if(!_[_0x8be1('0x12')](channels[_0x9e82ec[_0x8be1('0xd')]])){if(!_[_0x8be1('0x12')](_0x9e82ec['variable'][_0x8be1('0x17')])){channels[_0x9e82ec['channel']][_0x8be1('0x6')]=_0x9e82ec[_0x8be1('0x18')];}if(!_[_0x8be1('0x12')](_0x9e82ec['variable'][_0x8be1('0x19')])){channels[_0x9e82ec['channel']][_0x8be1('0x7')]=_0x9e82ec[_0x8be1('0x18')];}if(!_[_0x8be1('0x12')](_0x9e82ec[_0x8be1('0x1a')][_0x8be1('0x1b')])||!_[_0x8be1('0x12')](_0x9e82ec[_0x8be1('0x1a')][_0x8be1('0x1c')])){channels[_0x9e82ec['channel']]['callerid']=_0x9e82ec[_0x8be1('0x18')];}if(!_[_0x8be1('0x12')](_0x9e82ec[_0x8be1('0x1a')]['xmd-queue'])){channels[_0x9e82ec[_0x8be1('0xd')]][_0x8be1('0x1d')]=_0x8be1('0x1e');channels[_0x9e82ec['channel']][_0x8be1('0x1f')]=_0x9e82ec[_0x8be1('0x18')];channels[_0x9e82ec['channel']][_0x8be1('0x20')]=!![];}if(!_[_0x8be1('0x12')](_0x9e82ec['variable'][_0x8be1('0x21')])){channels[_0x9e82ec[_0x8be1('0xd')]]['ContactId']=_0x9e82ec[_0x8be1('0x18')];}if(!_['isNil'](_0x9e82ec[_0x8be1('0x1a')][_0x8be1('0x22')])){channels[_0x9e82ec['channel']]['routeid']=_0x9e82ec[_0x8be1('0x18')];}}};exports[_0x8be1('0x23')]=function(_0x1d404b){if(!_[_0x8be1('0x12')](channels[_0x1d404b['channel']])){if(_0x1d404b['application'][_0x8be1('0x24')]()==_0x8be1('0x25')&&_['startsWith'](_0x1d404b[_0x8be1('0x26')][_0x8be1('0x24')](),_0x8be1('0x27'))){var _0x4205e7=_0x1d404b[_0x8be1('0x26')][_0x8be1('0x28')]('=');var _0x16ef72=_0x4205e7[0x0]['substring'](_0x4205e7[0x0][_0x8be1('0x29')]('(')+0x1,_0x4205e7[0x0]['lastIndexOf'](')'));var _0x4c0808=_0x4205e7[0x1];channels[_0x1d404b[_0x8be1('0xd')]][_0x16ef72]=_0x4c0808;}}};exports[_0x8be1('0x2a')]=function(_0x27cc85){if(!_[_0x8be1('0x12')](channels[_0x27cc85[_0x8be1('0xd')]])){channels[_0x27cc85[_0x8be1('0xd')]][_0x8be1('0x9')]=_0x27cc85['connectedlinenum'];}};function handleCDR(_0x2df5ea){if(_[_0x8be1('0x12')](timeouts[_0x2df5ea[_0x8be1('0xd')]])){channels[_0x2df5ea[_0x8be1('0xd')]]=_[_0x8be1('0x2b')](_0x2df5ea,channels[_0x2df5ea['channel']]);}else{clearTimeout(timeouts[_0x2df5ea['channel']]);channels[_0x2df5ea[_0x8be1('0xd')]]=_[_0x8be1('0x2b')](channels[_0x2df5ea[_0x8be1('0xd')]],{'starttime':utils['isBefore'](_0x2df5ea[_0x8be1('0x2c')],channels[_0x2df5ea[_0x8be1('0xd')]]['starttime'])?_0x2df5ea[_0x8be1('0x2c')]:channels[_0x2df5ea['channel']][_0x8be1('0x2c')],'answertime':utils[_0x8be1('0x2d')](_0x2df5ea['answertime'],channels[_0x2df5ea[_0x8be1('0xd')]]['answertime'])?_0x2df5ea['answertime']:channels[_0x2df5ea[_0x8be1('0xd')]][_0x8be1('0x2')]});if(utils[_0x8be1('0x2e')](_0x2df5ea[_0x8be1('0x2f')],channels[_0x2df5ea[_0x8be1('0xd')]][_0x8be1('0x2f')])){channels[_0x2df5ea[_0x8be1('0xd')]]=_[_0x8be1('0x2b')](channels[_0x2df5ea['channel']],{'endtime':_0x2df5ea[_0x8be1('0x2f')],'destinationchannel':_[_0x8be1('0x30')](_0x2df5ea[_0x8be1('0x31')],_0x8be1('0x32'))?channels[_0x2df5ea[_0x8be1('0xd')]][_0x8be1('0x31')]:_0x2df5ea[_0x8be1('0x31')]});}channels[_0x2df5ea[_0x8be1('0xd')]]['duration']=utils['diffTime'](channels[_0x2df5ea[_0x8be1('0xd')]]['endtime'],channels[_0x2df5ea[_0x8be1('0xd')]]['starttime']);channels[_0x2df5ea[_0x8be1('0xd')]][_0x8be1('0x33')]=utils[_0x8be1('0x34')](channels[_0x2df5ea[_0x8be1('0xd')]][_0x8be1('0x2f')],channels[_0x2df5ea['channel']]['answertime']);if(_0x2df5ea[_0x8be1('0x1d')]['toLowerCase']()!=_0x8be1('0x35')){channels[_0x2df5ea[_0x8be1('0xd')]][_0x8be1('0x1f')]=_0x2df5ea['lastdata'];channels[_0x2df5ea[_0x8be1('0xd')]]['lastapplication']=_0x2df5ea[_0x8be1('0x1d')];}}timeouts[_0x2df5ea[_0x8be1('0xd')]]=setTimeout(writeDB(channels[_0x2df5ea[_0x8be1('0xd')]]),0x3e8);}exports[_0x8be1('0x27')]=function(_0x3fb986){if(!_['isNil'](channels[_0x3fb986[_0x8be1('0xd')]])){handleCDR(_0x3fb986);}else if(!_[_0x8be1('0x12')](channels[_0x3fb986['destinationchannel']])){_0x3fb986[_0x8be1('0xd')]=_0x3fb986[_0x8be1('0x31')];handleCDR(_0x3fb986);}};
\ No newline at end of file
index 1c96019..19378c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d78=['./utils','connect','info','shutdown','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent'];(function(_0xcdbbfd,_0xeaebe){var _0x1a3d7e=function(_0x29be41){while(--_0x29be41){_0xcdbbfd['push'](_0xcdbbfd['shift']());}};_0x1a3d7e(++_0xeaebe);}(_0x0d78,0x104));var _0x80d7=function(_0x2665a3,_0x3bac99){_0x2665a3=_0x2665a3-0x0;var _0x586de6=_0x0d78[_0x2665a3];return _0x586de6;};'use strict';var utils=require(_0x80d7('0x0'));exports[_0x80d7('0x1')]=function(){utils[_0x80d7('0x2')]('CONNECTED');};exports[_0x80d7('0x3')]=function(){utils['info']('SHUTDOWN');};exports[_0x80d7('0x4')]=function(){utils[_0x80d7('0x2')](_0x80d7('0x5'));};exports[_0x80d7('0x6')]=function(_0x45bdda){utils[_0x80d7('0x6')](_0x45bdda);};exports[_0x80d7('0x7')]=function(){utils[_0x80d7('0x2')](_0x80d7('0x8'));};exports[_0x80d7('0x9')]=function(_0x2bae9c){};
\ No newline at end of file
+var _0x29f9=['SHUTDOWN','FULLYBOOTED','error','close','managerevent','./utils','shutdown','info'];(function(_0x513fd1,_0x1bd67d){var _0x2aefb2=function(_0x15cd6b){while(--_0x15cd6b){_0x513fd1['push'](_0x513fd1['shift']());}};_0x2aefb2(++_0x1bd67d);}(_0x29f9,0x105));var _0x929f=function(_0xc3ba27,_0x5eacf1){_0xc3ba27=_0xc3ba27-0x0;var _0x933330=_0x29f9[_0xc3ba27];return _0x933330;};'use strict';var utils=require(_0x929f('0x0'));exports['connect']=function(){utils['info']('CONNECTED');};exports[_0x929f('0x1')]=function(){utils[_0x929f('0x2')](_0x929f('0x3'));};exports['fullybooted']=function(){utils[_0x929f('0x2')](_0x929f('0x4'));};exports[_0x929f('0x5')]=function(_0x2c1f10){utils[_0x929f('0x5')](_0x2c1f10);};exports[_0x929f('0x6')]=function(){utils[_0x929f('0x2')]('CLOSE');};exports[_0x929f('0x7')]=function(_0x4a478f){};
\ No newline at end of file
index da9f361..3fcfdfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['application','toLowerCase','cdr(routeid)','appdata','split','routeid','variable','outboundrouteid','dialbegin','destcontext','from-voip-provider','assign','called','dialend','dialstatus','ANSWER','now','connect','complete','duration','diffTime','starttime','holdtime','billableseconds','answertime','lodash','util','./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','isNil','newexten'];(function(_0x4a63fc,_0x167a02){var _0x30d4c3=function(_0x3eecb2){while(--_0x3eecb2){_0x4a63fc['push'](_0x4a63fc['shift']());}};_0x30d4c3(++_0x167a02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var dials={};var channels={};function writeDB(_0x5dd881){utils['info'](util[_0x0a9e('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x5dd881[_0x0a9e('0x4')],_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['dialstatus']));utils[_0x0a9e('0x9')](_0x0a9e('0xa'),_0x5dd881);delete dials[_0x5dd881[_0x0a9e('0x5')]];}exports['newchannel']=function(_0x503809){if(_[_0x0a9e('0xb')](channels[_0x503809['channel']])){channels[_0x503809['channel']]={'routeid':null};}};exports[_0x0a9e('0xc')]=function(_0xf81284){if(!_[_0x0a9e('0xb')](channels[_0xf81284[_0x0a9e('0x5')]])){if(_0xf81284[_0x0a9e('0xd')][_0x0a9e('0xe')]()=='set'&&_['startsWith'](_0xf81284['appdata']['toLowerCase'](),_0x0a9e('0xf'))){var _0x36471c=_0xf81284[_0x0a9e('0x10')][_0x0a9e('0x11')]('=');channels[_0xf81284[_0x0a9e('0x5')]][_0x0a9e('0x12')]=_0x36471c[0x1];}}};exports['varset']=function(_0x4283ce){if(!_[_0x0a9e('0xb')](channels[_0x4283ce[_0x0a9e('0x5')]])){if(!_[_0x0a9e('0xb')](_0x4283ce[_0x0a9e('0x13')][_0x0a9e('0x14')])){channels[_0x4283ce['channel']][_0x0a9e('0x12')]=_0x4283ce['value'];}}};exports[_0x0a9e('0x15')]=function(_0x519dfd){if(_0x519dfd[_0x0a9e('0x16')]==_0x0a9e('0x17')){dials[_0x519dfd['channel']]=_[_0x0a9e('0x18')](_0x519dfd,{'starttime':utils['now'](),'lastevent':_0x0a9e('0x19')});}};exports[_0x0a9e('0x1a')]=function(_0x106033){if(!_[_0x0a9e('0xb')](dials[_0x106033[_0x0a9e('0x5')]])){dials[_0x106033[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x106033[_0x0a9e('0x5')]],_0x106033,{'answertime':_0x106033[_0x0a9e('0x1b')]==_0x0a9e('0x1c')?utils[_0x0a9e('0x1d')]():null,'lastevent':_0x106033[_0x0a9e('0x1b')]=='ANSWER'?_0x0a9e('0x1e'):_0x0a9e('0x19')});}};exports['cdr']=function(_0x20f109){if(!_['isNil'](channels[_0x20f109['channel']])){if(!_[_0x0a9e('0xb')](dials[_0x20f109[_0x0a9e('0x5')]])){dials[_0x20f109[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x20f109['channel']],{'endtime':utils[_0x0a9e('0x1d')](),'routeId':channels[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x12')],'lastevent':_0x0a9e('0x1f')});dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x20')]=utils[_0x0a9e('0x21')](dials[_0x20f109['channel']]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x23')]=utils['diffTime'](dials[_0x20f109[_0x0a9e('0x5')]]['answertime']||dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x24')]=dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]?utils[_0x0a9e('0x21')](dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]):0x0;writeDB(dials[_0x20f109[_0x0a9e('0x5')]]);}delete channels[_0x20f109[_0x0a9e('0x5')]];}};
\ No newline at end of file
+var _0xa9e0=['application','toLowerCase','cdr(routeid)','appdata','split','routeid','variable','outboundrouteid','dialbegin','destcontext','from-voip-provider','assign','called','dialend','dialstatus','ANSWER','now','connect','complete','duration','diffTime','starttime','holdtime','billableseconds','answertime','lodash','util','./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','isNil','newexten'];(function(_0x493370,_0x4c7fac){var _0xac15d=function(_0x415cd6){while(--_0x415cd6){_0x493370['push'](_0x493370['shift']());}};_0xac15d(++_0x4c7fac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var dials={};var channels={};function writeDB(_0x5dd881){utils['info'](util[_0x0a9e('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x5dd881[_0x0a9e('0x4')],_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['dialstatus']));utils[_0x0a9e('0x9')](_0x0a9e('0xa'),_0x5dd881);delete dials[_0x5dd881[_0x0a9e('0x5')]];}exports['newchannel']=function(_0x503809){if(_[_0x0a9e('0xb')](channels[_0x503809['channel']])){channels[_0x503809['channel']]={'routeid':null};}};exports[_0x0a9e('0xc')]=function(_0xf81284){if(!_[_0x0a9e('0xb')](channels[_0xf81284[_0x0a9e('0x5')]])){if(_0xf81284[_0x0a9e('0xd')][_0x0a9e('0xe')]()=='set'&&_['startsWith'](_0xf81284['appdata']['toLowerCase'](),_0x0a9e('0xf'))){var _0x36471c=_0xf81284[_0x0a9e('0x10')][_0x0a9e('0x11')]('=');channels[_0xf81284[_0x0a9e('0x5')]][_0x0a9e('0x12')]=_0x36471c[0x1];}}};exports['varset']=function(_0x4283ce){if(!_[_0x0a9e('0xb')](channels[_0x4283ce[_0x0a9e('0x5')]])){if(!_[_0x0a9e('0xb')](_0x4283ce[_0x0a9e('0x13')][_0x0a9e('0x14')])){channels[_0x4283ce['channel']][_0x0a9e('0x12')]=_0x4283ce['value'];}}};exports[_0x0a9e('0x15')]=function(_0x519dfd){if(_0x519dfd[_0x0a9e('0x16')]==_0x0a9e('0x17')){dials[_0x519dfd['channel']]=_[_0x0a9e('0x18')](_0x519dfd,{'starttime':utils['now'](),'lastevent':_0x0a9e('0x19')});}};exports[_0x0a9e('0x1a')]=function(_0x106033){if(!_[_0x0a9e('0xb')](dials[_0x106033[_0x0a9e('0x5')]])){dials[_0x106033[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x106033[_0x0a9e('0x5')]],_0x106033,{'answertime':_0x106033[_0x0a9e('0x1b')]==_0x0a9e('0x1c')?utils[_0x0a9e('0x1d')]():null,'lastevent':_0x106033[_0x0a9e('0x1b')]=='ANSWER'?_0x0a9e('0x1e'):_0x0a9e('0x19')});}};exports['cdr']=function(_0x20f109){if(!_['isNil'](channels[_0x20f109['channel']])){if(!_[_0x0a9e('0xb')](dials[_0x20f109[_0x0a9e('0x5')]])){dials[_0x20f109[_0x0a9e('0x5')]]=_[_0x0a9e('0x18')](dials[_0x20f109['channel']],{'endtime':utils[_0x0a9e('0x1d')](),'routeId':channels[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x12')],'lastevent':_0x0a9e('0x1f')});dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x20')]=utils[_0x0a9e('0x21')](dials[_0x20f109['channel']]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x23')]=utils['diffTime'](dials[_0x20f109[_0x0a9e('0x5')]]['answertime']||dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x22')]);dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x24')]=dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]?utils[_0x0a9e('0x21')](dials[_0x20f109[_0x0a9e('0x5')]]['endtime'],dials[_0x20f109[_0x0a9e('0x5')]][_0x0a9e('0x25')]):0x0;writeDB(dials[_0x20f109[_0x0a9e('0x5')]]);}delete channels[_0x20f109[_0x0a9e('0x5')]];}};
\ No newline at end of file
index 790cd68..ddf43ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ce9=['queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./agents.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','./utils','port','asterisk','password','keepConnected','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6ce9,0x76));var _0x96ce=function(_0x27e70b,_0x943f84){_0x27e70b=_0x27e70b-0x0;var _0x3e34f4=_0x6ce9[_0x27e70b];return _0x3e34f4;};var AsteriskManager=require(_0x96ce('0x0'));var config=require(_0x96ce('0x1'));var agents=require(_0x96ce('0x2'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x96ce('0x3'));var members=require('./members.controller');var dials=require(_0x96ce('0x4'));var transfers=require(_0x96ce('0x5'));var core=require(_0x96ce('0x6'));var utils=require(_0x96ce('0x7'));var ami=new AsteriskManager(config['asterisk'][_0x96ce('0x8')],config[_0x96ce('0x9')]['ip'],config[_0x96ce('0x9')]['username'],config[_0x96ce('0x9')][_0x96ce('0xa')],!![]);ami[_0x96ce('0xb')]();ami['on']('connect',core['connect']);ami['on'](_0x96ce('0xc'),core[_0x96ce('0xc')]);ami['on'](_0x96ce('0xd'),core[_0x96ce('0xd')]);ami['on'](_0x96ce('0xe'),core[_0x96ce('0xe')]);ami['on'](_0x96ce('0xf'),core[_0x96ce('0xf')]);ami['on'](_0x96ce('0x10'),core[_0x96ce('0x10')]);ami['on'](_0x96ce('0x11'),function(_0x5d5545){try{members[_0x96ce('0x11')](_0x5d5545);}catch(_0xb2a714){utils[_0x96ce('0xe')](_0xb2a714);}});ami['on']('agentcalled',function(_0x1743b3){try{agents[_0x96ce('0x12')](_0x1743b3);}catch(_0x167bf4){utils[_0x96ce('0xe')](_0x167bf4);}});ami['on'](_0x96ce('0x13'),function(_0x79e56d){try{agents[_0x96ce('0x13')](_0x79e56d);}catch(_0x3d46d1){utils[_0x96ce('0xe')](_0x3d46d1);}});ami['on'](_0x96ce('0x14'),function(_0x1515ea){try{agents[_0x96ce('0x14')](_0x1515ea);recordings[_0x96ce('0x14')](_0x1515ea);queues[_0x96ce('0x14')](_0x1515ea);}catch(_0x1e2c4b){utils['error'](_0x1e2c4b);}});ami['on']('agentcomplete',function(_0x15b4a1){try{agents[_0x96ce('0x15')](_0x15b4a1);queues[_0x96ce('0x15')](_0x15b4a1);members[_0x96ce('0x15')](_0x15b4a1);calls[_0x96ce('0x15')](_0x15b4a1);}catch(_0xd857dc){utils[_0x96ce('0xe')](_0xd857dc);}});ami['on'](_0x96ce('0x16'),function(_0x1b2cbf){try{agents[_0x96ce('0x16')](_0x1b2cbf);queues['queuecallerabandon'](_0x1b2cbf);}catch(_0x8ad008){utils[_0x96ce('0xe')](_0x8ad008);}});ami['on'](_0x96ce('0x17'),function(_0x30dcdf){try{queues[_0x96ce('0x17')](_0x30dcdf);}catch(_0x166ee6){utils[_0x96ce('0xe')](_0x166ee6);}});ami['on']('queuecallerleave',function(_0x5c39a2){try{queues[_0x96ce('0x18')](_0x5c39a2);}catch(_0x86a985){utils['error'](_0x86a985);}});ami['on']('musiconholdstart',function(_0x58196f){try{queues['musiconholdstart'](_0x58196f);calls[_0x96ce('0x19')](_0x58196f);}catch(_0x9dc88b){utils[_0x96ce('0xe')](_0x9dc88b);}});ami['on'](_0x96ce('0x1a'),function(_0x56f0dd){try{queues[_0x96ce('0x1a')](_0x56f0dd);calls[_0x96ce('0x1a')](_0x56f0dd);}catch(_0x2426fa){utils['error'](_0x2426fa);}});ami['on'](_0x96ce('0x1b'),function(_0x4670f1){try{calls[_0x96ce('0x1b')](_0x4670f1);agents[_0x96ce('0x1b')](_0x4670f1);queues[_0x96ce('0x1b')](_0x4670f1);recordings['cdr'](_0x4670f1);dials[_0x96ce('0x1b')](_0x4670f1);members[_0x96ce('0x1b')](_0x4670f1);}catch(_0x174c2e){utils[_0x96ce('0xe')](_0x174c2e);}});ami['on']('blindtransfer',function(_0x4164b1){try{queues[_0x96ce('0x1c')](_0x4164b1);agents[_0x96ce('0x1c')](_0x4164b1);transfers['blindtransfer'](_0x4164b1);}catch(_0x408bf5){utils[_0x96ce('0xe')](_0x408bf5);}});ami['on'](_0x96ce('0x1d'),function(_0x402ce0){try{queues[_0x96ce('0x1d')](_0x402ce0);transfers[_0x96ce('0x1d')](_0x402ce0);agents[_0x96ce('0x1d')](_0x402ce0);}catch(_0x272f89){utils[_0x96ce('0xe')](_0x272f89);}});ami['on']('varset',function(_0x2c6ea8){try{queues[_0x96ce('0x1e')](_0x2c6ea8);recordings[_0x96ce('0x1e')](_0x2c6ea8);calls[_0x96ce('0x1e')](_0x2c6ea8);dials[_0x96ce('0x1e')](_0x2c6ea8);}catch(_0x440970){utils[_0x96ce('0xe')](_0x440970);}});ami['on']('newexten',function(_0x2b4a1d){try{calls[_0x96ce('0x1f')](_0x2b4a1d);dials[_0x96ce('0x1f')](_0x2b4a1d);}catch(_0x39b6c5){utils[_0x96ce('0xe')](_0x39b6c5);}});ami['on'](_0x96ce('0x20'),function(_0x25a81c){try{calls[_0x96ce('0x20')](_0x25a81c);dials[_0x96ce('0x20')](_0x25a81c);}catch(_0x6c0cdc){utils[_0x96ce('0xe')](_0x6c0cdc);}});ami['on'](_0x96ce('0x21'),function(_0x4b09bb){try{dials[_0x96ce('0x21')](_0x4b09bb);}catch(_0x1710f1){utils[_0x96ce('0xe')](_0x1710f1);}});ami['on']('dialend',function(_0x49b629){try{dials[_0x96ce('0x22')](_0x49b629);}catch(_0xa7169a){utils[_0x96ce('0xe')](_0xa7169a);}});
\ No newline at end of file
+var _0x1280=['dialend','asterisk-manager','../../config/environment','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./utils','asterisk','username','password','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1280,0xba));var _0x0128=function(_0x46d8b2,_0x3829c4){_0x46d8b2=_0x46d8b2-0x0;var _0x1a351f=_0x1280[_0x46d8b2];return _0x1a351f;};var AsteriskManager=require(_0x0128('0x0'));var config=require(_0x0128('0x1'));var agents=require(_0x0128('0x2'));var calls=require(_0x0128('0x3'));var queues=require(_0x0128('0x4'));var recordings=require(_0x0128('0x5'));var members=require(_0x0128('0x6'));var dials=require(_0x0128('0x7'));var transfers=require(_0x0128('0x8'));var core=require('./core.controller');var utils=require(_0x0128('0x9'));var ami=new AsteriskManager(config[_0x0128('0xa')]['port'],config['asterisk']['ip'],config[_0x0128('0xa')][_0x0128('0xb')],config[_0x0128('0xa')][_0x0128('0xc')],!![]);ami['keepConnected']();ami['on']('connect',core[_0x0128('0xd')]);ami['on'](_0x0128('0xe'),core['shutdown']);ami['on'](_0x0128('0xf'),core[_0x0128('0xf')]);ami['on'](_0x0128('0x10'),core['error']);ami['on'](_0x0128('0x11'),core[_0x0128('0x11')]);ami['on'](_0x0128('0x12'),core[_0x0128('0x12')]);ami['on'](_0x0128('0x13'),function(_0x3459bc){try{members[_0x0128('0x13')](_0x3459bc);}catch(_0x152702){utils['error'](_0x152702);}});ami['on'](_0x0128('0x14'),function(_0x53af5d){try{agents['agentcalled'](_0x53af5d);}catch(_0x3ee065){utils[_0x0128('0x10')](_0x3ee065);}});ami['on'](_0x0128('0x15'),function(_0x2a954f){try{agents[_0x0128('0x15')](_0x2a954f);}catch(_0x4fd99f){utils[_0x0128('0x10')](_0x4fd99f);}});ami['on'](_0x0128('0x16'),function(_0x35106a){try{agents['agentconnect'](_0x35106a);recordings['agentconnect'](_0x35106a);queues['agentconnect'](_0x35106a);}catch(_0x464f36){utils[_0x0128('0x10')](_0x464f36);}});ami['on'](_0x0128('0x17'),function(_0x179a99){try{agents['agentcomplete'](_0x179a99);queues['agentcomplete'](_0x179a99);members[_0x0128('0x17')](_0x179a99);calls[_0x0128('0x17')](_0x179a99);}catch(_0xcd45bf){utils[_0x0128('0x10')](_0xcd45bf);}});ami['on']('queuecallerabandon',function(_0x5b8688){try{agents[_0x0128('0x18')](_0x5b8688);queues[_0x0128('0x18')](_0x5b8688);}catch(_0x283ca2){utils[_0x0128('0x10')](_0x283ca2);}});ami['on'](_0x0128('0x19'),function(_0x5753b4){try{queues[_0x0128('0x19')](_0x5753b4);}catch(_0x1b47ee){utils[_0x0128('0x10')](_0x1b47ee);}});ami['on'](_0x0128('0x1a'),function(_0x1b8938){try{queues[_0x0128('0x1a')](_0x1b8938);}catch(_0x3ef695){utils[_0x0128('0x10')](_0x3ef695);}});ami['on'](_0x0128('0x1b'),function(_0x5205ad){try{queues[_0x0128('0x1b')](_0x5205ad);calls['musiconholdstart'](_0x5205ad);}catch(_0x1f6ee0){utils['error'](_0x1f6ee0);}});ami['on'](_0x0128('0x1c'),function(_0x175a21){try{queues[_0x0128('0x1c')](_0x175a21);calls[_0x0128('0x1c')](_0x175a21);}catch(_0x2411c2){utils[_0x0128('0x10')](_0x2411c2);}});ami['on'](_0x0128('0x1d'),function(_0x22fb36){try{calls[_0x0128('0x1d')](_0x22fb36);agents[_0x0128('0x1d')](_0x22fb36);queues[_0x0128('0x1d')](_0x22fb36);recordings[_0x0128('0x1d')](_0x22fb36);dials['cdr'](_0x22fb36);members[_0x0128('0x1d')](_0x22fb36);}catch(_0x2cbfe6){utils[_0x0128('0x10')](_0x2cbfe6);}});ami['on'](_0x0128('0x1e'),function(_0x4d21c7){try{queues[_0x0128('0x1e')](_0x4d21c7);agents['blindtransfer'](_0x4d21c7);transfers[_0x0128('0x1e')](_0x4d21c7);}catch(_0x36d0f4){utils[_0x0128('0x10')](_0x36d0f4);}});ami['on'](_0x0128('0x1f'),function(_0x35be49){try{queues[_0x0128('0x1f')](_0x35be49);transfers[_0x0128('0x1f')](_0x35be49);agents[_0x0128('0x1f')](_0x35be49);}catch(_0x510331){utils[_0x0128('0x10')](_0x510331);}});ami['on'](_0x0128('0x20'),function(_0x40c619){try{queues[_0x0128('0x20')](_0x40c619);recordings['varset'](_0x40c619);calls['varset'](_0x40c619);dials[_0x0128('0x20')](_0x40c619);}catch(_0x198bd9){utils[_0x0128('0x10')](_0x198bd9);}});ami['on'](_0x0128('0x21'),function(_0x38c4ca){try{calls[_0x0128('0x21')](_0x38c4ca);dials[_0x0128('0x21')](_0x38c4ca);}catch(_0x2bce81){utils[_0x0128('0x10')](_0x2bce81);}});ami['on'](_0x0128('0x22'),function(_0x3c7e7d){try{calls[_0x0128('0x22')](_0x3c7e7d);dials[_0x0128('0x22')](_0x3c7e7d);}catch(_0x39d00f){utils['error'](_0x39d00f);}});ami['on'](_0x0128('0x23'),function(_0x11af6c){try{dials[_0x0128('0x23')](_0x11af6c);}catch(_0x74cd52){utils[_0x0128('0x10')](_0x74cd52);}});ami['on'](_0x0128('0x24'),function(_0x152321){try{dials[_0x0128('0x24')](_0x152321);}catch(_0x319cd7){utils[_0x0128('0x10')](_0x319cd7);}});
\ No newline at end of file
index 0241eb9..ad22074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6323=['enterAt','agentcomplete','assign','cdr','split','data1','source','data3','destination','destinationchannel','util','./utils','Local/_attended@transfer','Queue:','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','channel','data2','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','membername','catch','error','some','state','INUSE','device','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration'];(function(_0xc5a3aa,_0x825a72){var _0x5272fb=function(_0x52436c){while(--_0x52436c){_0xc5a3aa['push'](_0xc5a3aa['shift']());}};_0x5272fb(++_0x825a72);}(_0x6323,0xfa));var _0x3632=function(_0x5cfdc4,_0x3e32b5){_0x5cfdc4=_0x5cfdc4-0x0;var _0x54cc2a=_0x6323[_0x5cfdc4];return _0x54cc2a;};'use strict';var _=require('lodash');var util=require(_0x3632('0x0'));var utils=require(_0x3632('0x1'));var members={};var exclude=[_0x3632('0x2'),_0x3632('0x3')];function writeDB(_0x3f41bb){utils['info'](util['format'](_0x3632('0x4'),_0x3f41bb[_0x3632('0x5')],_0x3f41bb['interface'],_0x3f41bb[_0x3632('0x6')],_0x3f41bb[_0x3632('0x7')],_0x3f41bb['membername'],_0x3f41bb[_0x3632('0x8')]));if(_0x3f41bb[_0x3632('0x9')]){utils[_0x3632('0xa')](_0x3f41bb[_0x3632('0x9')])[_0x3632('0xb')](function(_0xd3049e){if(_0xd3049e){_0x3f41bb['membername']=_0xd3049e[_0x3632('0xc')];_0x3f41bb['internal']=_0xd3049e[_0x3632('0xd')];utils[_0x3632('0xe')](_0x3632('0xf'),_0x3f41bb);}else{utils['getUserByName'](_0x3f41bb[_0x3632('0x9')]['split']('/')[0x1])[_0x3632('0xb')](function(_0x38ddd3){if(_0x38ddd3){_0x3f41bb[_0x3632('0x10')]=_0x38ddd3['name'];_0x3f41bb[_0x3632('0xd')]=_0x38ddd3[_0x3632('0xd')];utils['request']('CreateMemberReport',_0x3f41bb);}});}})[_0x3632('0x11')](function(_0x3eadd2){utils[_0x3632('0x12')](_0x3eadd2);});}delete members[_0x3f41bb[_0x3632('0x9')]];}function startsWith(_0x11156b,_0x1bee9f){return _[_0x3632('0x13')](_0x11156b,function(_0x935705){return _['startsWith'](_0x1bee9f,_0x935705);});}exports['devicestatechange']=function(_0x166532){switch(_0x166532[_0x3632('0x14')]){case _0x3632('0x15'):if(!startsWith(exclude,_0x166532[_0x3632('0x16')])){members[_0x166532[_0x3632('0x16')]]={'channel':_0x3632('0x17'),'interface':_0x166532[_0x3632('0x16')],'type':_0x3632('0x18'),'enterAt':utils[_0x3632('0x19')](),'role':'agent','data1':_0x3632('0xd')};}break;case _0x3632('0x1a'):if(!_[_0x3632('0x1b')](members[_0x166532[_0x3632('0x16')]])){members[_0x166532['device']][_0x3632('0x1c')]=utils[_0x3632('0x19')]();members[_0x166532[_0x3632('0x16')]][_0x3632('0x1d')]=utils['diffTime'](members[_0x166532['device']]['exitAt'],members[_0x166532[_0x3632('0x16')]][_0x3632('0x1e')]);}default:break;}};exports[_0x3632('0x1f')]=function(_0x40b3e3){if(!_['isNil'](members[_0x40b3e3['interface']])){members[_0x40b3e3['interface']]=_[_0x3632('0x20')](members[_0x40b3e3[_0x3632('0x9')]],{'data4':_0x40b3e3['queue']});}};exports[_0x3632('0x21')]=function(_0x34d55e){if(_0x34d55e[_0x3632('0x6')]){var _0x518b04=_0x34d55e[_0x3632('0x6')][_0x3632('0x22')]('-')[0x0];if(!_['isNil'](members[_0x518b04])){members[_0x518b04]=_[_0x3632('0x20')](members[_0x518b04],{'data1':members[_0x518b04][_0x3632('0x23')]||_0x34d55e[_0x3632('0x8')],'data2':members[_0x518b04][_0x3632('0x7')]||_0x34d55e[_0x3632('0x24')],'data3':members[_0x518b04][_0x3632('0x25')]||_0x34d55e[_0x3632('0x26')],'uniqueid':members[_0x518b04][_0x3632('0x5')]||_0x34d55e[_0x3632('0x5')]});if(members[_0x518b04][_0x3632('0x1c')]){writeDB(members[_0x518b04]);}}}if(_0x34d55e[_0x3632('0x27')]){var _0x3ce073=_0x34d55e[_0x3632('0x27')][_0x3632('0x22')]('-')[0x0];if(!_[_0x3632('0x1b')](members[_0x3ce073])){members[_0x3ce073]=_[_0x3632('0x20')](members[_0x3ce073],{'data1':members[_0x3ce073]['data1']||_0x34d55e['type'],'data2':members[_0x3ce073][_0x3632('0x7')]||_0x34d55e[_0x3632('0x24')],'data3':members[_0x3ce073][_0x3632('0x25')]||_0x34d55e[_0x3632('0x26')],'uniqueid':members[_0x3ce073][_0x3632('0x5')]||_0x34d55e['uniqueid']});if(members[_0x3ce073][_0x3632('0x1c')]){writeDB(members[_0x3ce073]);}}}};
\ No newline at end of file
+var _0x8b95=['enterAt','agentcomplete','queue','cdr','channel','assign','source','data3','destinationchannel','data1','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','startsWith','state','INUSE','voice','device','now','agent','NOT_INUSE','isNil','exitAt','duration'];(function(_0x54f5e9,_0x3bb461){var _0x58bbbe=function(_0x2bd695){while(--_0x2bd695){_0x54f5e9['push'](_0x54f5e9['shift']());}};_0x58bbbe(++_0x3bb461);}(_0x8b95,0x1c3));var _0x58b9=function(_0x4ec537,_0x58d551){_0x4ec537=_0x4ec537-0x0;var _0x3033ff=_0x8b95[_0x4ec537];return _0x3033ff;};'use strict';var _=require(_0x58b9('0x0'));var util=require(_0x58b9('0x1'));var utils=require(_0x58b9('0x2'));var members={};var exclude=[_0x58b9('0x3'),_0x58b9('0x4')];function writeDB(_0x225cb2){utils[_0x58b9('0x5')](util[_0x58b9('0x6')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x225cb2[_0x58b9('0x7')],_0x225cb2[_0x58b9('0x8')],_0x225cb2['channel'],_0x225cb2[_0x58b9('0x9')],_0x225cb2[_0x58b9('0xa')],_0x225cb2[_0x58b9('0xb')]));if(_0x225cb2[_0x58b9('0x8')]){utils[_0x58b9('0xc')](_0x225cb2[_0x58b9('0x8')])[_0x58b9('0xd')](function(_0x3ab9b8){if(_0x3ab9b8){_0x225cb2[_0x58b9('0xa')]=_0x3ab9b8[_0x58b9('0xe')];_0x225cb2[_0x58b9('0xf')]=_0x3ab9b8[_0x58b9('0xf')];utils[_0x58b9('0x10')](_0x58b9('0x11'),_0x225cb2);}else{utils[_0x58b9('0x12')](_0x225cb2[_0x58b9('0x8')][_0x58b9('0x13')]('/')[0x1])[_0x58b9('0xd')](function(_0x2b395d){if(_0x2b395d){_0x225cb2[_0x58b9('0xa')]=_0x2b395d[_0x58b9('0xe')];_0x225cb2['internal']=_0x2b395d[_0x58b9('0xf')];utils[_0x58b9('0x10')](_0x58b9('0x11'),_0x225cb2);}});}})[_0x58b9('0x14')](function(_0x2a14bd){utils[_0x58b9('0x15')](_0x2a14bd);});}delete members[_0x225cb2[_0x58b9('0x8')]];}function startsWith(_0x1a83fc,_0x534b1f){return _['some'](_0x1a83fc,function(_0x488de0){return _[_0x58b9('0x16')](_0x534b1f,_0x488de0);});}exports['devicestatechange']=function(_0x563133){switch(_0x563133[_0x58b9('0x17')]){case _0x58b9('0x18'):if(!startsWith(exclude,_0x563133['device'])){members[_0x563133['device']]={'channel':_0x58b9('0x19'),'interface':_0x563133[_0x58b9('0x1a')],'type':'TALKING','enterAt':utils[_0x58b9('0x1b')](),'role':_0x58b9('0x1c')};}break;case _0x58b9('0x1d'):if(!_[_0x58b9('0x1e')](members[_0x563133[_0x58b9('0x1a')]])){members[_0x563133['device']][_0x58b9('0x1f')]=utils['now']();members[_0x563133['device']][_0x58b9('0x20')]=utils['diffTime'](members[_0x563133[_0x58b9('0x1a')]]['exitAt'],members[_0x563133[_0x58b9('0x1a')]][_0x58b9('0x21')]);}default:break;}};exports[_0x58b9('0x22')]=function(_0x53a812){if(!_['isNil'](members[_0x53a812['interface']])){members[_0x53a812[_0x58b9('0x8')]]=_['assign'](members[_0x53a812['interface']],{'data4':_0x53a812[_0x58b9('0x23')]});}};exports[_0x58b9('0x24')]=function(_0x4c4620){if(_0x4c4620[_0x58b9('0x25')]){var _0x46c4f2=_0x4c4620[_0x58b9('0x25')][_0x58b9('0x13')]('-')[0x0];if(!_[_0x58b9('0x1e')](members[_0x46c4f2])){members[_0x46c4f2]=_[_0x58b9('0x26')](members[_0x46c4f2],{'data1':members[_0x46c4f2]['data1']||_0x4c4620[_0x58b9('0xb')],'data2':members[_0x46c4f2][_0x58b9('0x9')]||_0x4c4620[_0x58b9('0x27')],'data3':members[_0x46c4f2][_0x58b9('0x28')]||_0x4c4620['destination'],'uniqueid':members[_0x46c4f2][_0x58b9('0x7')]||_0x4c4620[_0x58b9('0x7')]});if(members[_0x46c4f2][_0x58b9('0x1f')]){writeDB(members[_0x46c4f2]);}}}if(_0x4c4620[_0x58b9('0x29')]){var _0xd24c1b=_0x4c4620[_0x58b9('0x29')][_0x58b9('0x13')]('-')[0x0];if(!_[_0x58b9('0x1e')](members[_0xd24c1b])){members[_0xd24c1b]=_[_0x58b9('0x26')](members[_0xd24c1b],{'data1':members[_0xd24c1b][_0x58b9('0x2a')]||_0x4c4620[_0x58b9('0xb')],'data2':members[_0xd24c1b]['data2']||_0x4c4620[_0x58b9('0x27')],'data3':members[_0xd24c1b]['data3']||_0x4c4620[_0x58b9('0x2b')],'uniqueid':members[_0xd24c1b][_0x58b9('0x7')]||_0x4c4620[_0x58b9('0x7')]});if(members[_0xd24c1b][_0x58b9('0x1f')]){writeDB(members[_0xd24c1b]);}}}};
\ No newline at end of file
index be4c411..104f626 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6759=['connectedlinenum','connectedlinename','membername','agentcomplete','reason','transfer','COMPLETEDBY','transfereechannel','BLIND','extension','transfereeuniqueid','BLINDTRANSFER','attendedtransfer','transfertargetchannel','clone','transfertargetcalleridname','transfertargetcalleridnum','ATTENDED','origtransfererchannel','secondtransfererchannel','transfereecalleridnum','secondtransfereruniqueid','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','cdr','assigned','COMPLETED','./utils','info','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','assign','position','now','varset','isNil','queuestatus','value','CONTINUE','diffTime','queuecallerjoinAt'];(function(_0x4c1edd,_0x30be6e){var _0x1bc2ec=function(_0x3c3ff7){while(--_0x3c3ff7){_0x4c1edd['push'](_0x4c1edd['shift']());}};_0x1bc2ec(++_0x30be6e);}(_0x6759,0x85));var _0x9675=function(_0x3763da,_0x58158b){_0x3763da=_0x3763da-0x0;var _0x5d192f=_0x6759[_0x3763da];return _0x5d192f;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9675('0x0'));var queues={};var transfers={};function writeDB(_0x323fc2,_0x44e418){utils[_0x9675('0x1')](util['format']('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x323fc2[_0x9675('0x2')],_0x323fc2[_0x9675('0x3')],_0x323fc2['queue'],_0x323fc2[_0x9675('0x4')],_0x323fc2[_0x9675('0x5')],_0x323fc2[_0x9675('0x6')],_0x323fc2[_0x9675('0x7')]));if(_0x323fc2[_0x9675('0x8')]){utils['getVoiceQueueByName'](_0x323fc2[_0x9675('0x8')])[_0x9675('0x9')](function(_0x22f034){if(_0x22f034){_0x323fc2[_0x9675('0xa')]=_0x22f034['type'];}utils[_0x9675('0xb')](_0x9675('0xc'),_0x323fc2);});}else{utils[_0x9675('0xb')](_0x9675('0xc'),_0x323fc2);}if(_0x44e418){delete queues[_0x323fc2['channel']];}}exports['queuecallerjoin']=function(_0x2d1dee){if(!_['isNil'](queues[_0x2d1dee[_0x9675('0x3')]])){writeDB(_['clone'](queues[_0x2d1dee[_0x9675('0x3')]]),![]);}queues[_0x2d1dee['channel']]=_[_0x9675('0xd')](_0x2d1dee,{'originalposition':_0x2d1dee[_0x9675('0xe')],'queuecallerjoinAt':utils[_0x9675('0xf')](),'mohtime':0x0});};exports[_0x9675('0x10')]=function(_0x416478){if(!_['isNil'](queues[_0x416478[_0x9675('0x3')]])){if(!_[_0x9675('0x11')](_0x416478['variable'][_0x9675('0x12')])){if(_0x416478[_0x9675('0x13')]!=_0x9675('0x14')){queues[_0x416478['channel']]=_[_0x9675('0xd')](queues[_0x416478[_0x9675('0x3')]],{'queuecallerabandon':![],'queuecallerabandonAt':null,'queuecallerexit':!![],'queuecallerexitAt':utils[_0x9675('0xf')](),'queuecallerexitreason':_0x416478[_0x9675('0x13')]['toUpperCase']()});}}}};exports['queuecallerabandon']=function(_0x2692c0){var _0x178b0c={'queuecallerabandon':!![],'queuecallerabandonAt':utils[_0x9675('0xf')](),'queuecallerexitreason':'ABANDONED'};if(!_[_0x9675('0x11')](queues[_0x2692c0[_0x9675('0x3')]])){queues[_0x2692c0[_0x9675('0x3')]]=_['assign'](queues[_0x2692c0['channel']],_0x178b0c);}if(!_[_0x9675('0x11')](transfers[_0x2692c0[_0x9675('0x3')]])){transfers[_0x2692c0[_0x9675('0x3')]]=_[_0x9675('0xd')](transfers[_0x2692c0[_0x9675('0x3')]],_0x178b0c);}};exports['queuecallerleave']=function(_0x572ce6){if(!_[_0x9675('0x11')](queues[_0x572ce6['channel']])){queues[_0x572ce6['channel']]=_['assign'](queues[_0x572ce6[_0x9675('0x3')]],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0x9675('0xf')](),'holdtime':utils[_0x9675('0x15')](utils['now'](),queues[_0x572ce6[_0x9675('0x3')]][_0x9675('0x16')])});}if(!_['isNil'](transfers[_0x572ce6[_0x9675('0x3')]])){transfers[_0x572ce6[_0x9675('0x3')]]=_['assign'](transfers[_0x572ce6[_0x9675('0x3')]],{'queuecallerleave':!![],'queuecallerleaveAt':utils['now'](),'holdtime':utils[_0x9675('0x15')](utils['now'](),transfers[_0x572ce6[_0x9675('0x3')]][_0x9675('0x16')])});}};exports['agentconnect']=function(_0x5c643f){var _0x451736={'connectedlinenum':_0x5c643f[_0x9675('0x17')],'connectedlinename':_0x5c643f[_0x9675('0x18')],'assigned':!![],'lastAssignedTo':_0x5c643f[_0x9675('0x19')]};if(!_[_0x9675('0x11')](queues[_0x5c643f['channel']])){queues[_0x5c643f[_0x9675('0x3')]]=_[_0x9675('0xd')](queues[_0x5c643f[_0x9675('0x3')]],_0x451736);}if(!_[_0x9675('0x11')](transfers[_0x5c643f[_0x9675('0x3')]])){transfers[_0x5c643f[_0x9675('0x3')]]=_['assign'](transfers[_0x5c643f[_0x9675('0x3')]],_0x451736);}};exports[_0x9675('0x1a')]=function(_0x1bbb68){var _0x1223e0={'queuecallercomplete':!![],'queuecallercompleteAt':utils['now']()};if(_0x1bbb68[_0x9675('0x1b')]!=_0x9675('0x1c')){_0x1223e0[_0x9675('0x7')]=_0x9675('0x1d')+_0x1bbb68['reason']['toUpperCase']();}if(!_['isNil'](queues[_0x1bbb68[_0x9675('0x3')]])){queues[_0x1bbb68[_0x9675('0x3')]]=_[_0x9675('0xd')](queues[_0x1bbb68[_0x9675('0x3')]],_0x1223e0);writeDB(queues[_0x1bbb68[_0x9675('0x3')]],!![]);}};exports['blindtransfer']=function(_0x256907){if(!_['isNil'](queues[_0x256907[_0x9675('0x1e')]])){queues[_0x256907['transfereechannel']]=_[_0x9675('0xd')](queues[_0x256907[_0x9675('0x1e')]],{'transfer':!![],'transfertype':_0x9675('0x1f'),'transferexten':_0x256907[_0x9675('0x20')],'transferuniqueid':_0x256907[_0x9675('0x21')],'queuecallerexitreason':_0x9675('0x22')});}};exports[_0x9675('0x23')]=function(_0x654dca){_['forIn'](queues,function(_0xc672d7){if(_0xc672d7[_0x9675('0x3')]==_0x654dca['origtransfererchannel']){transfers[_0x654dca[_0x9675('0x24')]]=_[_0x9675('0x25')](_0xc672d7);transfers[_0x654dca[_0x9675('0x24')]]=_['assign'](transfers[_0x654dca[_0x9675('0x24')]],{'queuecallerjoinAt':utils[_0x9675('0xf')](),'queuecallerleaveAt':utils[_0x9675('0xf')](),'channel':_0x654dca[_0x9675('0x24')],'calleridname':_0x654dca[_0x9675('0x26')],'calleridnum':_0x654dca[_0x9675('0x27')],'queuecallerenterreason':0x2});queues[_0x654dca[_0x9675('0x24')]]=_[_0x9675('0xd')](queues[_0x654dca['transfertargetchannel']],{'transfer':!![],'transfertype':_0x9675('0x28'),'queuecallerexitreason':'ATTENDEDTRANSFER','transferexten':_0x654dca['origtransfererexten'],'transferuniqueid':_0x654dca['origtransfereruniqueid']});queues[_0x654dca['origtransfererchannel']]=_[_0x9675('0xd')](queues[_0x654dca[_0x9675('0x29')]],{'queuecallerexitreason':_0x9675('0x28'),'queuecallerenterreason':0x1});}else if(_0xc672d7[_0x9675('0x3')]==_0x654dca[_0x9675('0x2a')]){transfers[_0x654dca[_0x9675('0x1e')]]=_[_0x9675('0x25')](_0xc672d7);transfers[_0x654dca[_0x9675('0x1e')]]=_[_0x9675('0xd')](transfers[_0x654dca[_0x9675('0x1e')]],{'queuecallerjoinAt':utils[_0x9675('0xf')](),'queuecallerleaveAt':utils[_0x9675('0xf')](),'channel':_0x654dca[_0x9675('0x1e')],'calleridname':_0x654dca['transfereecalleridname'],'calleridnum':_0x654dca[_0x9675('0x2b')],'queuecallerenterreason':0x2});queues[_0x654dca[_0x9675('0x1e')]]=_[_0x9675('0xd')](queues[_0x654dca[_0x9675('0x1e')]],{'transfer':!![],'transfertype':_0x9675('0x28'),'queuecallerexitreason':'ATTENDEDTRANSFER','transferexten':_0x654dca['secondtransfererexten'],'transferuniqueid':_0x654dca[_0x9675('0x2c')]});queues[_0x654dca[_0x9675('0x2a')]]=_[_0x9675('0xd')](queues[_0x654dca[_0x9675('0x2a')]],{'queuecallerexitreason':_0x9675('0x28'),'queuecallerenterreason':0x1});}});};exports[_0x9675('0x2d')]=function(_0x2251f0){if(!_[_0x9675('0x11')](queues[_0x2251f0[_0x9675('0x3')]])){queues[_0x2251f0['channel']][_0x9675('0x2e')]=utils[_0x9675('0xf')]();}};exports[_0x9675('0x2f')]=function(_0x4cdda2){if(!_[_0x9675('0x11')](queues[_0x4cdda2[_0x9675('0x3')]])){if(!_['isNil'](queues[_0x4cdda2['channel']][_0x9675('0x2e')])){queues[_0x4cdda2[_0x9675('0x3')]][_0x9675('0x30')]+=utils[_0x9675('0x15')](utils['now'](),queues[_0x4cdda2[_0x9675('0x3')]]['musiconholdstartAt']);delete queues[_0x4cdda2[_0x9675('0x3')]][_0x9675('0x2e')];}}};exports[_0x9675('0x31')]=function(_0xcc6472){if(!_[_0x9675('0x11')](queues[_0xcc6472['channel']])){writeDB(queues[_0xcc6472['channel']],!![]);}if(!_['isNil'](transfers[_0xcc6472['channel']])){if(transfers[_0xcc6472['channel']][_0x9675('0x32')]){transfers[_0xcc6472[_0x9675('0x3')]]=_[_0x9675('0xd')](transfers[_0xcc6472[_0x9675('0x3')]],{'queuecallercomplete':!![],'queuecallercompleteAt':utils[_0x9675('0xf')](),'queuecallerexitreason':_0x9675('0x33')});}writeDB(transfers[_0xcc6472['channel']],![]);delete transfers[_0xcc6472[_0x9675('0x3')]];}};
\ No newline at end of file
+var _0xeac6=['queuestatus','value','CONTINUE','ABANDONED','queuecallerleave','queuecallerjoinAt','connectedlinenum','connectedlinename','membername','agentcomplete','reason','transfer','COMPLETEDBY','blindtransfer','transfereechannel','BLIND','extension','transfereeuniqueid','forIn','origtransfererchannel','transfertargetchannel','clone','transfertargetcalleridnum','ATTENDED','ATTENDEDTRANSFER','origtransfererexten','origtransfereruniqueid','secondtransfererchannel','transfereecalleridnum','secondtransfererexten','secondtransfereruniqueid','musiconholdstart','musiconholdstartAt','mohtime','COMPLETED','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','isNil','assign','position','now','varset','variable'];(function(_0x5de61a,_0x9c6030){var _0x4b8a71=function(_0x53c8df){while(--_0x53c8df){_0x5de61a['push'](_0x5de61a['shift']());}};_0x4b8a71(++_0x9c6030);}(_0xeac6,0xce));var _0x6eac=function(_0x578482,_0x5f3424){_0x578482=_0x578482-0x0;var _0x5582ea=_0xeac6[_0x578482];return _0x5582ea;};'use strict';var _=require(_0x6eac('0x0'));var util=require(_0x6eac('0x1'));var utils=require(_0x6eac('0x2'));var queues={};var transfers={};function writeDB(_0x2837fa,_0x19c4a4){utils[_0x6eac('0x3')](util[_0x6eac('0x4')](_0x6eac('0x5'),_0x2837fa['uniqueid'],_0x2837fa[_0x6eac('0x6')],_0x2837fa[_0x6eac('0x7')],_0x2837fa[_0x6eac('0x8')],_0x2837fa[_0x6eac('0x9')],_0x2837fa[_0x6eac('0xa')],_0x2837fa['queuecallerexitreason']));if(_0x2837fa['queue']){utils[_0x6eac('0xb')](_0x2837fa[_0x6eac('0x7')])[_0x6eac('0xc')](function(_0xb8c7b6){if(_0xb8c7b6){_0x2837fa[_0x6eac('0xd')]=_0xb8c7b6[_0x6eac('0xd')];}utils[_0x6eac('0xe')](_0x6eac('0xf'),_0x2837fa);});}else{utils[_0x6eac('0xe')](_0x6eac('0xf'),_0x2837fa);}if(_0x19c4a4){delete queues[_0x2837fa[_0x6eac('0x6')]];}}exports['queuecallerjoin']=function(_0x4b0359){if(!_[_0x6eac('0x10')](queues[_0x4b0359[_0x6eac('0x6')]])){writeDB(_['clone'](queues[_0x4b0359[_0x6eac('0x6')]]),![]);}queues[_0x4b0359[_0x6eac('0x6')]]=_[_0x6eac('0x11')](_0x4b0359,{'originalposition':_0x4b0359[_0x6eac('0x12')],'queuecallerjoinAt':utils[_0x6eac('0x13')](),'mohtime':0x0});};exports[_0x6eac('0x14')]=function(_0x16bde7){if(!_['isNil'](queues[_0x16bde7[_0x6eac('0x6')]])){if(!_[_0x6eac('0x10')](_0x16bde7[_0x6eac('0x15')][_0x6eac('0x16')])){if(_0x16bde7[_0x6eac('0x17')]!=_0x6eac('0x18')){queues[_0x16bde7[_0x6eac('0x6')]]=_[_0x6eac('0x11')](queues[_0x16bde7[_0x6eac('0x6')]],{'queuecallerabandon':![],'queuecallerabandonAt':null,'queuecallerexit':!![],'queuecallerexitAt':utils[_0x6eac('0x13')](),'queuecallerexitreason':_0x16bde7[_0x6eac('0x17')]['toUpperCase']()});}}}};exports['queuecallerabandon']=function(_0x282d13){var _0x296aa4={'queuecallerabandon':!![],'queuecallerabandonAt':utils[_0x6eac('0x13')](),'queuecallerexitreason':_0x6eac('0x19')};if(!_['isNil'](queues[_0x282d13[_0x6eac('0x6')]])){queues[_0x282d13[_0x6eac('0x6')]]=_[_0x6eac('0x11')](queues[_0x282d13[_0x6eac('0x6')]],_0x296aa4);}if(!_[_0x6eac('0x10')](transfers[_0x282d13[_0x6eac('0x6')]])){transfers[_0x282d13['channel']]=_[_0x6eac('0x11')](transfers[_0x282d13['channel']],_0x296aa4);}};exports[_0x6eac('0x1a')]=function(_0x26ff40){if(!_[_0x6eac('0x10')](queues[_0x26ff40[_0x6eac('0x6')]])){queues[_0x26ff40[_0x6eac('0x6')]]=_[_0x6eac('0x11')](queues[_0x26ff40['channel']],{'queuecallerleave':!![],'queuecallerleaveAt':utils[_0x6eac('0x13')](),'holdtime':utils['diffTime'](utils[_0x6eac('0x13')](),queues[_0x26ff40[_0x6eac('0x6')]][_0x6eac('0x1b')])});}if(!_[_0x6eac('0x10')](transfers[_0x26ff40[_0x6eac('0x6')]])){transfers[_0x26ff40[_0x6eac('0x6')]]=_['assign'](transfers[_0x26ff40[_0x6eac('0x6')]],{'queuecallerleave':!![],'queuecallerleaveAt':utils['now'](),'holdtime':utils['diffTime'](utils[_0x6eac('0x13')](),transfers[_0x26ff40[_0x6eac('0x6')]][_0x6eac('0x1b')])});}};exports['agentconnect']=function(_0x209fcc){var _0x103a98={'connectedlinenum':_0x209fcc[_0x6eac('0x1c')],'connectedlinename':_0x209fcc[_0x6eac('0x1d')],'assigned':!![],'lastAssignedTo':_0x209fcc[_0x6eac('0x1e')]};if(!_[_0x6eac('0x10')](queues[_0x209fcc[_0x6eac('0x6')]])){queues[_0x209fcc['channel']]=_[_0x6eac('0x11')](queues[_0x209fcc[_0x6eac('0x6')]],_0x103a98);}if(!_[_0x6eac('0x10')](transfers[_0x209fcc['channel']])){transfers[_0x209fcc[_0x6eac('0x6')]]=_[_0x6eac('0x11')](transfers[_0x209fcc['channel']],_0x103a98);}};exports[_0x6eac('0x1f')]=function(_0x57fb29){var _0x58e793={'queuecallercomplete':!![],'queuecallercompleteAt':utils['now']()};if(_0x57fb29[_0x6eac('0x20')]!=_0x6eac('0x21')){_0x58e793['queuecallerexitreason']=_0x6eac('0x22')+_0x57fb29[_0x6eac('0x20')]['toUpperCase']();}if(!_[_0x6eac('0x10')](queues[_0x57fb29[_0x6eac('0x6')]])){queues[_0x57fb29[_0x6eac('0x6')]]=_[_0x6eac('0x11')](queues[_0x57fb29[_0x6eac('0x6')]],_0x58e793);writeDB(queues[_0x57fb29[_0x6eac('0x6')]],!![]);}};exports[_0x6eac('0x23')]=function(_0xb78346){if(!_[_0x6eac('0x10')](queues[_0xb78346[_0x6eac('0x24')]])){queues[_0xb78346[_0x6eac('0x24')]]=_[_0x6eac('0x11')](queues[_0xb78346[_0x6eac('0x24')]],{'transfer':!![],'transfertype':_0x6eac('0x25'),'transferexten':_0xb78346[_0x6eac('0x26')],'transferuniqueid':_0xb78346[_0x6eac('0x27')],'queuecallerexitreason':'BLINDTRANSFER'});}};exports['attendedtransfer']=function(_0x2da1f2){_[_0x6eac('0x28')](queues,function(_0x5b1c6a){if(_0x5b1c6a[_0x6eac('0x6')]==_0x2da1f2[_0x6eac('0x29')]){transfers[_0x2da1f2[_0x6eac('0x2a')]]=_[_0x6eac('0x2b')](_0x5b1c6a);transfers[_0x2da1f2[_0x6eac('0x2a')]]=_[_0x6eac('0x11')](transfers[_0x2da1f2[_0x6eac('0x2a')]],{'queuecallerjoinAt':utils[_0x6eac('0x13')](),'queuecallerleaveAt':utils[_0x6eac('0x13')](),'channel':_0x2da1f2['transfertargetchannel'],'calleridname':_0x2da1f2['transfertargetcalleridname'],'calleridnum':_0x2da1f2[_0x6eac('0x2c')],'queuecallerenterreason':0x2});queues[_0x2da1f2[_0x6eac('0x2a')]]=_['assign'](queues[_0x2da1f2[_0x6eac('0x2a')]],{'transfer':!![],'transfertype':_0x6eac('0x2d'),'queuecallerexitreason':_0x6eac('0x2e'),'transferexten':_0x2da1f2[_0x6eac('0x2f')],'transferuniqueid':_0x2da1f2[_0x6eac('0x30')]});queues[_0x2da1f2[_0x6eac('0x29')]]=_[_0x6eac('0x11')](queues[_0x2da1f2[_0x6eac('0x29')]],{'queuecallerexitreason':_0x6eac('0x2d'),'queuecallerenterreason':0x1});}else if(_0x5b1c6a[_0x6eac('0x6')]==_0x2da1f2[_0x6eac('0x31')]){transfers[_0x2da1f2['transfereechannel']]=_['clone'](_0x5b1c6a);transfers[_0x2da1f2[_0x6eac('0x24')]]=_[_0x6eac('0x11')](transfers[_0x2da1f2[_0x6eac('0x24')]],{'queuecallerjoinAt':utils[_0x6eac('0x13')](),'queuecallerleaveAt':utils[_0x6eac('0x13')](),'channel':_0x2da1f2[_0x6eac('0x24')],'calleridname':_0x2da1f2['transfereecalleridname'],'calleridnum':_0x2da1f2[_0x6eac('0x32')],'queuecallerenterreason':0x2});queues[_0x2da1f2[_0x6eac('0x24')]]=_[_0x6eac('0x11')](queues[_0x2da1f2['transfereechannel']],{'transfer':!![],'transfertype':_0x6eac('0x2d'),'queuecallerexitreason':_0x6eac('0x2e'),'transferexten':_0x2da1f2[_0x6eac('0x33')],'transferuniqueid':_0x2da1f2[_0x6eac('0x34')]});queues[_0x2da1f2[_0x6eac('0x31')]]=_[_0x6eac('0x11')](queues[_0x2da1f2[_0x6eac('0x31')]],{'queuecallerexitreason':_0x6eac('0x2d'),'queuecallerenterreason':0x1});}});};exports[_0x6eac('0x35')]=function(_0x400dce){if(!_[_0x6eac('0x10')](queues[_0x400dce[_0x6eac('0x6')]])){queues[_0x400dce['channel']][_0x6eac('0x36')]=utils[_0x6eac('0x13')]();}};exports['musiconholdstop']=function(_0x451e78){if(!_[_0x6eac('0x10')](queues[_0x451e78['channel']])){if(!_[_0x6eac('0x10')](queues[_0x451e78[_0x6eac('0x6')]][_0x6eac('0x36')])){queues[_0x451e78[_0x6eac('0x6')]][_0x6eac('0x37')]+=utils['diffTime'](utils[_0x6eac('0x13')](),queues[_0x451e78[_0x6eac('0x6')]][_0x6eac('0x36')]);delete queues[_0x451e78[_0x6eac('0x6')]]['musiconholdstartAt'];}}};exports['cdr']=function(_0x1e1398){if(!_[_0x6eac('0x10')](queues[_0x1e1398['channel']])){writeDB(queues[_0x1e1398[_0x6eac('0x6')]],!![]);}if(!_['isNil'](transfers[_0x1e1398[_0x6eac('0x6')]])){if(transfers[_0x1e1398['channel']]['assigned']){transfers[_0x1e1398[_0x6eac('0x6')]]=_['assign'](transfers[_0x1e1398[_0x6eac('0x6')]],{'queuecallercomplete':!![],'queuecallercompleteAt':utils['now'](),'queuecallerexitreason':_0x6eac('0x38')});}writeDB(transfers[_0x1e1398[_0x6eac('0x6')]],![]);delete transfers[_0x1e1398[_0x6eac('0x6')]];}};
\ No newline at end of file
index ca5c68f..f2569b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfec3=['calleridnum','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','channel','varset','isNil','variable','endsWith','value','.wav49','.WAV','agentconnect','assign','queue','connectedlinenum','cdr','type','destinationchannel','destinationcontext','uniqueid','connectedlinename'];(function(_0x1435bf,_0x3ac12f){var _0x51db59=function(_0xeac958){while(--_0xeac958){_0x1435bf['push'](_0x1435bf['shift']());}};_0x51db59(++_0x3ac12f);}(_0xfec3,0x75));var _0x3fec=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfec3[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3fec('0x0'));var utils=require(_0x3fec('0x1'));var recordings={};function writeDB(_0x2ae1cb){utils['debug'](_0x2ae1cb);if(_0x2ae1cb[_0x3fec('0x2')]){utils[_0x3fec('0x3')](_0x2ae1cb[_0x3fec('0x2')])[_0x3fec('0x4')](function(_0x421e84){if(_0x421e84){_0x2ae1cb[_0x3fec('0x5')]=_0x421e84[_0x3fec('0x6')];_0x2ae1cb[_0x3fec('0x7')]=_0x421e84['id'];}utils[_0x3fec('0x8')](_0x3fec('0x9'),_0x2ae1cb);});}else{utils[_0x3fec('0x8')](_0x3fec('0x9'),_0x2ae1cb);}if(recordings[_0x2ae1cb[_0x3fec('0xa')]]){delete recordings[_0x2ae1cb[_0x3fec('0xa')]];}}exports[_0x3fec('0xb')]=function(_0x5ca0b3){if(!_[_0x3fec('0xc')](_0x5ca0b3[_0x3fec('0xd')])&&!_[_0x3fec('0xc')](_0x5ca0b3[_0x3fec('0xd')]['mixmonitor_filename'])){if(!_[_0x3fec('0xc')](recordings[_0x5ca0b3[_0x3fec('0xa')]])){writeDB(recordings[_0x5ca0b3[_0x3fec('0xa')]]);}if(_[_0x3fec('0xe')](_0x5ca0b3[_0x3fec('0xf')],'.wav49')){_0x5ca0b3[_0x3fec('0xf')]=_0x5ca0b3[_0x3fec('0xf')]['replace'](_0x3fec('0x10'),_0x3fec('0x11'));}recordings[_0x5ca0b3[_0x3fec('0xa')]]=_['assign'](_0x5ca0b3,{});}};exports[_0x3fec('0x12')]=function(_0x9850a){if(!_[_0x3fec('0xc')](recordings[_0x9850a[_0x3fec('0xa')]])){recordings[_0x9850a['channel']]=_[_0x3fec('0x13')](recordings[_0x9850a[_0x3fec('0xa')]],{'membername':_0x9850a['membername'],'queue':_0x9850a[_0x3fec('0x14')],'accountcode':_0x9850a[_0x3fec('0x15')]});}};exports[_0x3fec('0x16')]=function(_0x461d8c){if(!_[_0x3fec('0xc')](recordings[_0x461d8c[_0x3fec('0xa')]])){recordings[_0x461d8c[_0x3fec('0xa')]]=_[_0x3fec('0x13')](recordings[_0x461d8c[_0x3fec('0xa')]],{'type':_0x461d8c[_0x3fec('0x17')]});writeDB(recordings[_0x461d8c[_0x3fec('0xa')]]);}else if(!_[_0x3fec('0xc')](recordings[_0x461d8c[_0x3fec('0x18')]])){recordings[_0x461d8c[_0x3fec('0xa')]]=recordings[_0x461d8c['destinationchannel']];delete recordings[_0x461d8c[_0x3fec('0x18')]];recordings[_0x461d8c[_0x3fec('0xa')]]=_[_0x3fec('0x13')](recordings[_0x461d8c[_0x3fec('0xa')]],{'type':_0x461d8c[_0x3fec('0x17')],'channel':_0x461d8c[_0x3fec('0xa')],'exten':_0x461d8c['destination'],'context':_0x461d8c[_0x3fec('0x19')],'uniqueid':_0x461d8c[_0x3fec('0x1a')],'calleridnum':recordings[_0x461d8c[_0x3fec('0xa')]][_0x3fec('0x15')],'calleridname':recordings[_0x461d8c[_0x3fec('0xa')]][_0x3fec('0x1b')],'connectedlinenum':recordings[_0x461d8c['channel']][_0x3fec('0x1c')],'connectedlinename':recordings[_0x461d8c[_0x3fec('0xa')]]['calleridname']});writeDB(recordings[_0x461d8c['channel']]);}};
\ No newline at end of file
+var _0x222f=['channel','isNil','variable','mixmonitor_filename','endsWith','value','replace','.wav49','.WAV','assign','agentconnect','queue','connectedlinenum','cdr','type','destinationchannel','dialer','uniqueid','destinationcontext','lastdata','calleridnum','destination','connectedlinename','calleridname','lodash','./utils','debug','accountcode','then','membername','UserId','CreateVoiceRecording','request'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0x222f,0x1a4));var _0xf222=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x222f[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require(_0xf222('0x0'));var utils=require(_0xf222('0x1'));var recordings={};function writeDB(_0x251440){utils[_0xf222('0x2')](_0x251440);if(_0x251440['accountcode']){utils['getUserByInternal'](_0x251440[_0xf222('0x3')])[_0xf222('0x4')](function(_0x307791){if(_0x307791){_0x251440[_0xf222('0x5')]=_0x307791['name'];_0x251440[_0xf222('0x6')]=_0x307791['id'];}utils['request'](_0xf222('0x7'),_0x251440);});}else{utils[_0xf222('0x8')]('CreateVoiceRecording',_0x251440);}if(recordings[_0x251440[_0xf222('0x9')]]){delete recordings[_0x251440[_0xf222('0x9')]];}}exports['varset']=function(_0x31c027){if(!_[_0xf222('0xa')](_0x31c027[_0xf222('0xb')])&&!_[_0xf222('0xa')](_0x31c027[_0xf222('0xb')][_0xf222('0xc')])){if(!_['isNil'](recordings[_0x31c027[_0xf222('0x9')]])){writeDB(recordings[_0x31c027[_0xf222('0x9')]]);}if(_[_0xf222('0xd')](_0x31c027[_0xf222('0xe')],'.wav49')){_0x31c027[_0xf222('0xe')]=_0x31c027[_0xf222('0xe')][_0xf222('0xf')](_0xf222('0x10'),_0xf222('0x11'));}recordings[_0x31c027[_0xf222('0x9')]]=_[_0xf222('0x12')](_0x31c027,{});}};exports[_0xf222('0x13')]=function(_0x52a003){if(!_['isNil'](recordings[_0x52a003[_0xf222('0x9')]])){recordings[_0x52a003[_0xf222('0x9')]]=_['assign'](recordings[_0x52a003[_0xf222('0x9')]],{'membername':_0x52a003[_0xf222('0x5')],'queue':_0x52a003[_0xf222('0x14')],'accountcode':_0x52a003[_0xf222('0x15')]});}};exports[_0xf222('0x16')]=function(_0x25e1c2){if(!_[_0xf222('0xa')](recordings[_0x25e1c2['channel']])){recordings[_0x25e1c2[_0xf222('0x9')]]=_[_0xf222('0x12')](recordings[_0x25e1c2[_0xf222('0x9')]],{'type':_0x25e1c2[_0xf222('0x17')]});writeDB(recordings[_0x25e1c2[_0xf222('0x9')]]);}else if(!_[_0xf222('0xa')](recordings[_0x25e1c2[_0xf222('0x18')]])){recordings[_0x25e1c2['channel']]=recordings[_0x25e1c2[_0xf222('0x18')]];delete recordings[_0x25e1c2[_0xf222('0x18')]];if(_0x25e1c2[_0xf222('0x17')]==_0xf222('0x19')){recordings[_0x25e1c2['channel']]=_['assign'](recordings[_0x25e1c2[_0xf222('0x9')]],{'type':_0x25e1c2[_0xf222('0x17')],'uniqueid':_0x25e1c2[_0xf222('0x1a')],'context':_0x25e1c2[_0xf222('0x1b')],'queue':_0x25e1c2[_0xf222('0x1c')],'connectedlinenum':_0x25e1c2[_0xf222('0x3')],'connectedlinename':'','calleridnum':_0x25e1c2['destination'],'exten':recordings[_0x25e1c2[_0xf222('0x9')]][_0xf222('0x1d')]});}else{recordings[_0x25e1c2[_0xf222('0x9')]]=_[_0xf222('0x12')](recordings[_0x25e1c2[_0xf222('0x9')]],{'type':_0x25e1c2[_0xf222('0x17')],'channel':_0x25e1c2[_0xf222('0x9')],'exten':_0x25e1c2[_0xf222('0x1e')],'context':_0x25e1c2['destinationcontext'],'uniqueid':_0x25e1c2[_0xf222('0x1a')],'calleridnum':recordings[_0x25e1c2[_0xf222('0x9')]][_0xf222('0x15')],'calleridname':recordings[_0x25e1c2[_0xf222('0x9')]][_0xf222('0x1f')],'connectedlinenum':recordings[_0x25e1c2[_0xf222('0x9')]][_0xf222('0x1d')],'connectedlinename':recordings[_0x25e1c2[_0xf222('0x9')]][_0xf222('0x20')]});}writeDB(recordings[_0x25e1c2[_0xf222('0x9')]]);}};
\ No newline at end of file
index ff6e55c..d4d76ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee1=['transfertargetlinkedid','util','./utils','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','attendedtransfer','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten'];(function(_0x7835a,_0x7ef740){var _0xd46e11=function(_0xe43fad){while(--_0xe43fad){_0x7835a['push'](_0x7835a['shift']());}};_0xd46e11(++_0x7ef740);}(_0xbee1,0x140));var _0x1bee=function(_0x43e414,_0xf54873){_0x43e414=_0x43e414-0x0;var _0x124363=_0xbee1[_0x43e414];return _0x124363;};'use strict';var _=require('lodash');var util=require(_0x1bee('0x0'));var utils=require(_0x1bee('0x1'));function writeDB(_0x233eaa){utils['info'](util[_0x1bee('0x2')](_0x1bee('0x3'),_0x233eaa[_0x1bee('0x4')]));utils[_0x1bee('0x5')](_0x1bee('0x6'),_0x233eaa);}exports[_0x1bee('0x7')]=function(_0x5adcca){_0x5adcca[_0x1bee('0x4')]=_0x1bee('0x8');writeDB(_0x5adcca);};exports[_0x1bee('0x9')]=function(_0x38eacd){_0x38eacd=_[_0x1bee('0xa')](_0x38eacd,{'transfererchannel':_0x38eacd['origtransfererchannel'],'transferercalleridnum':_0x38eacd[_0x1bee('0xb')],'transferercalleridname':_0x38eacd['origtransferercalleridname'],'transfererconnectedlinenum':_0x38eacd[_0x1bee('0xc')],'transfererconnectedlinename':_0x38eacd['secondtransfererconnectedlinename'],'transfereraccountcode':_0x38eacd[_0x1bee('0xd')],'transferercontext':_0x38eacd[_0x1bee('0xe')],'transfererexten':_0x38eacd[_0x1bee('0xf')],'transfererlinkedid':_0x38eacd['origtransfererlinkedid'],'context':_0x38eacd[_0x1bee('0x10')],'extension':_0x38eacd[_0x1bee('0x11')],'type':_0x1bee('0x12')});if(_[_0x1bee('0x13')](_0x38eacd[_0x1bee('0x14')])){_0x38eacd=_[_0x1bee('0xa')](_0x38eacd,{'transfereechannel':_0x38eacd[_0x1bee('0x15')],'transfereecalleridnum':_0x38eacd[_0x1bee('0x16')],'transfereecalleridname':_0x38eacd[_0x1bee('0x17')],'transfereeconnectedlinenum':_0x38eacd[_0x1bee('0x18')],'transfereeconnectedlinename':_0x38eacd[_0x1bee('0x19')],'transfereeaccountcode':_0x38eacd['transfertargetaccountcode'],'transfereecontext':_0x38eacd[_0x1bee('0x1a')],'transfereeexten':_0x38eacd[_0x1bee('0x1b')],'transfereelinkedid':_0x38eacd[_0x1bee('0x1c')]});}writeDB(_0x38eacd);};
\ No newline at end of file
+var _0xfd79=['origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','attendedtransfer','assign'];(function(_0x2c9056,_0x552f14){var _0x3e6959=function(_0x556247){while(--_0x556247){_0x2c9056['push'](_0x2c9056['shift']());}};_0x3e6959(++_0x552f14);}(_0xfd79,0x114));var _0x9fd7=function(_0x275860,_0x2db2db){_0x275860=_0x275860-0x0;var _0x4e94ef=_0xfd79[_0x275860];return _0x4e94ef;};'use strict';var _=require(_0x9fd7('0x0'));var util=require(_0x9fd7('0x1'));var utils=require(_0x9fd7('0x2'));function writeDB(_0x4def00){utils[_0x9fd7('0x3')](util[_0x9fd7('0x4')](_0x9fd7('0x5'),_0x4def00[_0x9fd7('0x6')]));utils[_0x9fd7('0x7')](_0x9fd7('0x8'),_0x4def00);}exports[_0x9fd7('0x9')]=function(_0x3a2aef){_0x3a2aef[_0x9fd7('0x6')]='blind';writeDB(_0x3a2aef);};exports[_0x9fd7('0xa')]=function(_0x27d78c){_0x27d78c=_[_0x9fd7('0xb')](_0x27d78c,{'transfererchannel':_0x27d78c[_0x9fd7('0xc')],'transferercalleridnum':_0x27d78c[_0x9fd7('0xd')],'transferercalleridname':_0x27d78c[_0x9fd7('0xe')],'transfererconnectedlinenum':_0x27d78c[_0x9fd7('0xf')],'transfererconnectedlinename':_0x27d78c[_0x9fd7('0x10')],'transfereraccountcode':_0x27d78c[_0x9fd7('0x11')],'transferercontext':_0x27d78c[_0x9fd7('0x12')],'transfererexten':_0x27d78c[_0x9fd7('0x13')],'transfererlinkedid':_0x27d78c['origtransfererlinkedid'],'context':_0x27d78c[_0x9fd7('0x14')],'extension':_0x27d78c[_0x9fd7('0x15')],'type':'attended'});if(_[_0x9fd7('0x16')](_0x27d78c[_0x9fd7('0x17')])){_0x27d78c=_['assign'](_0x27d78c,{'transfereechannel':_0x27d78c[_0x9fd7('0x18')],'transfereecalleridnum':_0x27d78c[_0x9fd7('0x19')],'transfereecalleridname':_0x27d78c[_0x9fd7('0x1a')],'transfereeconnectedlinenum':_0x27d78c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x27d78c[_0x9fd7('0x1b')],'transfereeaccountcode':_0x27d78c[_0x9fd7('0x1c')],'transfereecontext':_0x27d78c[_0x9fd7('0x1d')],'transfereeexten':_0x27d78c[_0x9fd7('0x1e')],'transfereelinkedid':_0x27d78c[_0x9fd7('0x1f')]});}writeDB(_0x27d78c);};
\ No newline at end of file
index 3857c6a..66dbaa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39f7=['../../config/logger','xdr','info','debug','error','stack','request','then','stringify','GetUser','internal','name','interface','GETUSER|','result','FOUND','NOTFOUND','length','getUserByInternal','catch','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','seconds','sumTime','now','isAfter','jayson/promise','bluebird','client','http'];(function(_0x3c4d58,_0x44875a){var _0x5b4b38=function(_0x9cc34c){while(--_0x9cc34c){_0x3c4d58['push'](_0x3c4d58['shift']());}};_0x5b4b38(++_0x44875a);}(_0x39f7,0xc4));var _0x739f=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x39f7[_0xdeefbd];return _0x4ff63f;};'use strict';var jayson=require(_0x739f('0x0'));var moment=require('moment');var BPromise=require(_0x739f('0x1'));var client=jayson[_0x739f('0x2')][_0x739f('0x3')]({'port':0x2329});var logger=require(_0x739f('0x4'))(_0x739f('0x5'));exports[_0x739f('0x6')]=function(_0x5f17f2){logger[_0x739f('0x6')](_0x5f17f2);};exports[_0x739f('0x7')]=function(_0x438132){logger[_0x739f('0x7')](JSON['stringify'](_0x438132));};exports[_0x739f('0x8')]=function(_0x25673c){logger[_0x739f('0x8')](_0x25673c[_0x739f('0x9')]);};exports[_0x739f('0xa')]=function(_0x577fae,_0x4df2db){return client[_0x739f('0xa')](_0x577fae,{'body':_0x4df2db})[_0x739f('0xb')](function(_0x4b8232){logger[_0x739f('0x7')](JSON[_0x739f('0xc')](_0x4b8232));})['catch'](function(_0x5a3a65){logger['error'](_0x5a3a65[_0x739f('0x9')]);});};function getUser(_0x1b243d){return client[_0x739f('0xa')](_0x739f('0xd'),{'options':{'raw':!![],'attributes':['id',_0x739f('0xe'),_0x739f('0xf'),_0x739f('0x10')],'where':_0x1b243d,'limit':0x1}})['then'](function(_0x4706d1){logger[_0x739f('0x6')](_0x739f('0x11')+JSON[_0x739f('0xc')](_0x1b243d)+'|'+(_0x4706d1[_0x739f('0x12')]['length']?_0x739f('0x13'):_0x739f('0x14')));return _0x4706d1[_0x739f('0x12')][_0x739f('0x15')]?_0x4706d1[_0x739f('0x12')][0x0]:null;});}exports[_0x739f('0x16')]=function(_0x48dd6d){return new BPromise(function(_0x4e579e,_0x64716a){if(_0x48dd6d){return getUser({'internal':_0x48dd6d})[_0x739f('0xb')](function(_0x2de71e){return _0x4e579e(_0x2de71e);})[_0x739f('0x17')](function(_0x3130ba){logger[_0x739f('0x8')](_0x3130ba['stack']);return _0x4e579e(null);});}else{return _0x4e579e(null);}});};exports[_0x739f('0x18')]=function(_0x18c1db){return new BPromise(function(_0x258f8e,_0x107d84){if(_0x18c1db){return getUser({'interface':_0x18c1db})['then'](function(_0x7c8141){return _0x258f8e(_0x7c8141);})[_0x739f('0x17')](function(_0x4edc6e){logger['error'](_0x4edc6e['stack']);return _0x258f8e(null);});}else{return _0x258f8e(null);}});};exports['getUserByName']=function(_0x3d22b9){return new BPromise(function(_0x237b01,_0x4fafa4){if(_0x3d22b9){return getUser({'name':_0x3d22b9})[_0x739f('0xb')](function(_0x55da16){return _0x237b01(_0x55da16);})[_0x739f('0x17')](function(_0x3a2384){logger['error'](_0x3a2384['stack']);return _0x237b01(null);});}else{return _0x237b01(null);}});};exports[_0x739f('0x19')]=function(_0x3529ee){return new BPromise(function(_0x1a158c,_0x46173f){if(_0x3529ee){return client[_0x739f('0xa')](_0x739f('0x1a'),{'options':{'raw':!![],'attributes':['id','name',_0x739f('0x1b'),_0x739f('0x1c'),'acwTimeout'],'where':{'name':_0x3529ee},'limit':0x1}})[_0x739f('0xb')](function(_0x4db524){logger[_0x739f('0x6')](_0x739f('0x1d')+_0x3529ee+'|'+(_0x4db524['result'][_0x739f('0x15')]?'FOUND':_0x739f('0x14')));return _0x1a158c(_0x4db524[_0x739f('0x12')]['length']?_0x4db524[_0x739f('0x12')][0x0]:null);})[_0x739f('0x17')](function(_0x5ef931){logger[_0x739f('0x8')](_0x5ef931[_0x739f('0x9')]);return _0x1a158c(null);});}else{return _0x1a158c(null);}});};exports['addTime']=function(_0x482bd0,_0x1ab980){return moment(_0x482bd0)[_0x739f('0x1e')](_0x1ab980,'seconds')['format'](_0x739f('0x1f'));};exports[_0x739f('0x20')]=function(_0x3ac576,_0x597a2b){return moment(_0x3ac576)[_0x739f('0x21')](_0x597a2b,'seconds')[_0x739f('0x22')](_0x739f('0x1f'));};exports[_0x739f('0x23')]=function(_0x348f05,_0x2eb717){return moment(_0x348f05)['diff'](moment(_0x2eb717),_0x739f('0x24'));};exports[_0x739f('0x25')]=function(_0x126d38,_0x4fc3ec){return parseInt(_0x126d38,0xa)+parseInt(_0x4fc3ec,0xa);};exports[_0x739f('0x26')]=function(){return moment()[_0x739f('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x739f('0x27')]=function(_0xa004d,_0x5a75c7){if(_0x5a75c7){return moment(_0xa004d)['isAfter'](_0x5a75c7);}else{return!![];}};exports['isBefore']=function(_0x24afde,_0x367c5d){if(_0x367c5d){return moment(_0x24afde)['isBefore'](_0x367c5d);}else if(_0x24afde){return!![];}else{return![];}};
\ No newline at end of file
+var _0x628e=['subtract','seconds','diffTime','sumTime','now','isBefore','jayson/promise','bluebird','client','../../config/logger','xdr','info','debug','stringify','error','request','then','catch','stack','GetUser','name','interface','GETUSER|','result','FOUND','NOTFOUND','length','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','format','subtractTime'];(function(_0x56b5b7,_0x1bdfb7){var _0x44529f=function(_0x566f8f){while(--_0x566f8f){_0x56b5b7['push'](_0x56b5b7['shift']());}};_0x44529f(++_0x1bdfb7);}(_0x628e,0x7e));var _0xe628=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x628e[_0x4b369d];return _0x571a98;};'use strict';var jayson=require(_0xe628('0x0'));var moment=require('moment');var BPromise=require(_0xe628('0x1'));var client=jayson[_0xe628('0x2')]['http']({'port':0x2329});var logger=require(_0xe628('0x3'))(_0xe628('0x4'));exports['info']=function(_0x2efa7c){logger[_0xe628('0x5')](_0x2efa7c);};exports[_0xe628('0x6')]=function(_0xa06f8e){logger['debug'](JSON[_0xe628('0x7')](_0xa06f8e));};exports[_0xe628('0x8')]=function(_0xcfad3){logger[_0xe628('0x8')](_0xcfad3['stack']);};exports[_0xe628('0x9')]=function(_0x481714,_0x41c077){return client[_0xe628('0x9')](_0x481714,{'body':_0x41c077})[_0xe628('0xa')](function(_0x3298e4){logger[_0xe628('0x6')](JSON['stringify'](_0x3298e4));})[_0xe628('0xb')](function(_0xbfe0b0){logger['error'](_0xbfe0b0[_0xe628('0xc')]);});};function getUser(_0x22efb7){return client[_0xe628('0x9')](_0xe628('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0xe628('0xe'),_0xe628('0xf')],'where':_0x22efb7,'limit':0x1}})[_0xe628('0xa')](function(_0x402335){logger['info'](_0xe628('0x10')+JSON[_0xe628('0x7')](_0x22efb7)+'|'+(_0x402335[_0xe628('0x11')]['length']?_0xe628('0x12'):_0xe628('0x13')));return _0x402335['result'][_0xe628('0x14')]?_0x402335[_0xe628('0x11')][0x0]:null;});}exports[_0xe628('0x15')]=function(_0x451286){return new BPromise(function(_0x49f846,_0x41681f){if(_0x451286){return getUser({'internal':_0x451286})[_0xe628('0xa')](function(_0x379cbc){return _0x49f846(_0x379cbc);})[_0xe628('0xb')](function(_0x66c28d){logger[_0xe628('0x8')](_0x66c28d[_0xe628('0xc')]);return _0x49f846(null);});}else{return _0x49f846(null);}});};exports[_0xe628('0x16')]=function(_0x515abd){return new BPromise(function(_0x12e326,_0x585300){if(_0x515abd){return getUser({'interface':_0x515abd})[_0xe628('0xa')](function(_0x307830){return _0x12e326(_0x307830);})[_0xe628('0xb')](function(_0x2f4f24){logger[_0xe628('0x8')](_0x2f4f24[_0xe628('0xc')]);return _0x12e326(null);});}else{return _0x12e326(null);}});};exports[_0xe628('0x17')]=function(_0x22a8ea){return new BPromise(function(_0x51f2ff,_0x25f3d4){if(_0x22a8ea){return getUser({'name':_0x22a8ea})['then'](function(_0x3d6184){return _0x51f2ff(_0x3d6184);})[_0xe628('0xb')](function(_0x31e096){logger['error'](_0x31e096[_0xe628('0xc')]);return _0x51f2ff(null);});}else{return _0x51f2ff(null);}});};exports[_0xe628('0x18')]=function(_0x445ffa){return new BPromise(function(_0x4382db,_0x28b206){if(_0x445ffa){return client[_0xe628('0x9')](_0xe628('0x19'),{'options':{'raw':!![],'attributes':['id',_0xe628('0xe'),_0xe628('0x1a'),_0xe628('0x1b'),_0xe628('0x1c')],'where':{'name':_0x445ffa},'limit':0x1}})[_0xe628('0xa')](function(_0x14b8c4){logger[_0xe628('0x5')](_0xe628('0x1d')+_0x445ffa+'|'+(_0x14b8c4['result']['length']?'FOUND':'NOTFOUND'));return _0x4382db(_0x14b8c4[_0xe628('0x11')]['length']?_0x14b8c4[_0xe628('0x11')][0x0]:null);})['catch'](function(_0xe61ea7){logger[_0xe628('0x8')](_0xe61ea7[_0xe628('0xc')]);return _0x4382db(null);});}else{return _0x4382db(null);}});};exports[_0xe628('0x1e')]=function(_0x3006bd,_0x510b66){return moment(_0x3006bd)[_0xe628('0x1f')](_0x510b66,'seconds')[_0xe628('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe628('0x21')]=function(_0x924e3b,_0x4dff89){return moment(_0x924e3b)[_0xe628('0x22')](_0x4dff89,_0xe628('0x23'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe628('0x24')]=function(_0x19a621,_0x53cb36){return moment(_0x19a621)['diff'](moment(_0x53cb36),_0xe628('0x23'));};exports[_0xe628('0x25')]=function(_0x5d0dc3,_0x189b9c){return parseInt(_0x5d0dc3,0xa)+parseInt(_0x189b9c,0xa);};exports[_0xe628('0x26')]=function(){return moment()[_0xe628('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x3662c,_0x43ee5d){if(_0x43ee5d){return moment(_0x3662c)['isAfter'](_0x43ee5d);}else{return!![];}};exports[_0xe628('0x27')]=function(_0x58bb7f,_0x50bd7e){if(_0x50bd7e){return moment(_0x58bb7f)[_0xe628('0x27')](_0x50bd7e);}else if(_0x58bb7f){return!![];}else{return![];}};
\ No newline at end of file
similarity index 96%
rename from snippet/1.0.10/assets/images/avatars/customer0.png
rename to snippet/1.0.11/assets/images/avatars/customer0.png
index e180846008a475f127100cedfa48c0acd77aa4f7..a591affdadd3aef127fc384e5f5f1582c9dcd1c5 100644 (file)
@@ -9,9 +9,9 @@
         document.write("<base href='" + window.location.pathname + "' />");
     </script>
 
-    <link rel="stylesheet" href="styles/vendor.css?version=1.0.10">
+    <link rel="stylesheet" href="styles/vendor.css?version=1.0.11">
 
-    <link rel="stylesheet" href="styles/app.css?version=1.0.10">
+    <link rel="stylesheet" href="styles/app.css?version=1.0.11">
 
 </head>
 
@@ -71,9 +71,9 @@
 
     <!-- / CHAT APP -->
 
-    <script src="scripts/vendor.js?version=1.0.10"></script>
+    <script src="scripts/vendor.js?version=1.0.11"></script>
 
-    <script src="scripts/app.js?version=1.0.10"></script>
+    <script src="scripts/app.js?version=1.0.11"></script>
 
 </body>
 
similarity index 92%
rename from snippet/1.0.10/assets/images/avatars/robot0.png
rename to snippet/1.0.11/assets/images/avatars/robot0.png
index 6e36d8bcb89a70e4a078233e45ce629ff95e6e35..ca4dae9e05057be06f3418a14c501d63dc0130d6 100644 (file)
@@ -13,8 +13,8 @@
             for (var n, i = document.createElement("div"), o = t.visitor, s = t.settings, a = 0; a < t.messages.length; a++) {
                 var r = t.messages[a],
                     l = "Sender: ",
-                    d = "Message: " + r.body,
-                    c = "Sent At: " + moment(r.createdAt).format("YYYY-MM-DD HH:mm:ss");
+                    c = "Message: " + r.body,
+                    d = "Sent At: " + moment(r.createdAt).format("YYYY-MM-DD HH:mm:ss");
                 if (0 !== a) {
                     switch (t.settings.agentIdentifier) {
                         case "website_alias":
@@ -29,7 +29,7 @@
                         default:
                             l += "out" === r.direction ? r.UserId ? (s.agentAlias || "Agent") + r.UserId : "System" : s.customerAlias || o.from || "Visitor" + r.ContactId
                     }
-                    i.appendChild(document.createTextNode(l)), i.appendChild(document.createElement("br")), i.appendChild(document.createTextNode(d)), i.appendChild(document.createElement("br")), i.appendChild(document.createTextNode(c)), i.appendChild(document.createElement("br")), i.appendChild(document.createElement("br"))
+                    i.appendChild(document.createTextNode(l)), i.appendChild(document.createElement("br")), i.appendChild(document.createTextNode(c)), i.appendChild(document.createElement("br")), i.appendChild(document.createTextNode(d)), i.appendChild(document.createElement("br")), i.appendChild(document.createElement("br"))
                 } else n = r.createdAt
             }
             var m = window.open();
 function() {
     "use strict";
 
-    function e(e, s, t, n, i, o, a, r, l, d) {
-        var c, m, g, u, p = this;
+    function e(e, s, t, n, i, o, a, r, l, c) {
+        var d, m, g, u, p = this;
 
         function f() {
-            s.settings.online ? o.go("app.online") : o.go("app.offline")
+            s.settings.online ? o.go("app.online", null, {
+                location: "replace"
+            }) : o.go("app.offline", null, {
+                location: "replace"
+            })
         }
 
         function v() {
             s.visitor && s.visitor.interaction && s.visitor.interaction.id && r.chatInteraction.get({
                 id: s.visitor.interaction.id
             }).$promise.then(function(e) {
-                delete p.errors.getInteraction, e.closed && (s.visitor.interaction.closed = !0, s.updateStorage(l, s.visitor), "unmanaged" === e.disposition ? o.go("app.unmanaged") : o.go("app.closing"))
+                delete p.errors.getInteraction, e.closed && (s.visitor.interaction.closed = !0, s.updateStorage(l, s.visitor), "unmanaged" === e.disposition ? o.go("app.unmanaged", null, {
+                    location: "replace"
+                }) : o.go("app.closing", null, {
+                    location: "replace"
+                }))
             }).catch(function(e) {
                 switch (e.status) {
                     case 403:
-                        o.go("app.closing");
+                        o.go("app.closing", null, {
+                            location: "replace"
+                        });
                         break;
                     case 404:
-                        s.updateStorage(l, null, !0), s.updateStorage(d, null, !0), f();
+                        s.updateStorage(l, null, !0), s.updateStorage(c, null, !0), f();
                         break;
                     case 405:
-                        o.go("app.unmanaged");
+                        o.go("app.unmanaged", null, {
+                            location: "replace"
+                        });
                         break;
                     default:
                         console.error(e)
@@ -85,7 +97,7 @@ function() {
         }
 
         function x(e) {
-            var t = c[0].emojioneArea.getText();
+            var t = d[0].emojioneArea.getText();
             e && 13 === e.keyCode && e.shiftKey || e && 13 !== e.keyCode || "" !== t && b(_.merge({
                 body: t
             }, s.visitor))
@@ -95,7 +107,7 @@ function() {
             r.chatWebsite.notify(e).$promise.then(function(e) {
                 delete p.errors.chatMessageError, _.isNil(s.visitor.interaction) && (s.visitor.interaction = {
                     id: e.interaction.id
-                }, s.updateStorage(l, s.visitor)), c[0].emojioneArea.setText(""), w()
+                }, s.updateStorage(l, s.visitor)), d[0].emojioneArea.setText(""), w()
             }).catch(h("chatMessageError"))
         }
 
@@ -123,10 +135,14 @@ function() {
             }).catch(function(e) {
                 switch (e.status) {
                     case 403:
-                        o.go("app.closing");
+                        o.go("app.closing", null, {
+                            location: "replace"
+                        });
                         break;
                     case 405:
-                        o.go("app.unmanaged");
+                        o.go("app.unmanaged", null, {
+                            location: "replace"
+                        });
                         break;
                     default:
                         console.error(e)
@@ -147,8 +163,8 @@ function() {
             link: !0,
             linkTarget: "_blank"
         }, p.$onInit = function() {
-            s.status = "chat", s.loading = !1, s.settings.showMenu = !0, p.replyMessage = "", s.visitor.interaction && s.visitor.interaction.closed ? (s.updateStorage(l, null, !0), s.updateStorage(d, null, !0), f()) : (v(), m = n(y, 2e3), g = n(v, 3e3));
-            c = $("#emojionearea").emojioneArea({
+            s.status = "chat", s.loading = !1, s.settings.showMenu = !0, p.replyMessage = "", s.visitor.interaction && s.visitor.interaction.closed ? (s.updateStorage(l, null, !0), s.updateStorage(c, null, !0), f()) : (v(), m = n(y, 2e3), g = n(v, 3e3));
+            d = $("#emojionearea").emojioneArea({
                 placeholder: s.settings.placeholderMessage || "Type a message",
                 events: {
                     keyup: function(e, t) {
@@ -184,14 +200,18 @@ function() {
         var a = this;
 
         function r() {
-            i.settings.online ? e.go("app.online") : e.go("app.offline")
+            i.settings.online ? e.go("app.online", null, {
+                location: "replace"
+            }) : e.go("app.offline", null, {
+                location: "replace"
+            })
         }
 
         function l() {
             a.form = {}, a.upColor = null, a.downColor = null, a.userForm.$setPristine(), a.userForm.$setUntouched(), delete i.visitor.interaction, i.enableDownload = !1
         }
 
-        function d(n) {
+        function c(n) {
             return function(e) {
                 a.errors[n] = e.data;
                 var t = o.simple().textContent(i.settings.formSubmitFailureMessage || "Form submission error").toastClass("md-failure-toast").position("top");
@@ -199,7 +219,7 @@ function() {
             }
         }
 
-        function c() {
+        function d() {
             i.loading = !1
         }
         a.$onInit = function() {
@@ -213,7 +233,7 @@ function() {
                 delete a.errors.submit;
                 var e = o.simple().textContent(i.settings.formSubmitSuccessMessage || "Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));
                 o.show(e)
-            }).then(l).then(r).catch(d("submit")).finally(c) : (c(), d("submit"))
+            }).then(l).then(r).catch(c("submit")).finally(d) : (d(), c("submit"))
         }, a.skip = function() {
             l(), r()
         }, a.form = {}, a.errors = {}
@@ -223,7 +243,7 @@ function() {
 function() {
     "use strict";
 
-    function e(a, n, r, i, o, l, s, d, c) {
+    function e(a, n, r, i, o, l, s, c, d) {
         var e = this;
 
         function m(e, t, n) {
@@ -233,17 +253,19 @@ function() {
 
         function g(e) {
             var t;
-            a.layout.up = e, m(d, a.layout), t = e ? "show" : "hide", n.parent.postMessage({
+            a.layout.up = e, m(c, a.layout), t = e ? "show" : "hide", n.parent.postMessage({
                 cmd: t
             }, "*")
         }
         a.location = a.settings.location, e.$onInit = function() {
             a.status = "init";
             var e = !1,
-                t = l.get(c) || {},
-                n = l.get(d) || {};
+                t = l.get(d) || {},
+                n = l.get(c) || {};
             a.visitor = t[a.location] ? t[a.location] : {}, a.layout = n[a.location] ? n[a.location] : {}, a.visitor.interaction && a.layout.up ? e = !0 : a.layout.up = !1;
-            g(e), r.go((i = a.settings.online, o = !!(a.visitor && a.visitor.interaction && a.visitor.interaction.id), s = Number(a.settings.maxInteractions) && Number(a.settings.openedInteractions) >= Number(a.settings.maxInteractions), o || !s && i ? "app.online" : "app.offline"));
+            g(e), r.go((i = a.settings.online, o = !!(a.visitor && a.visitor.interaction && a.visitor.interaction.id), s = Number(a.settings.maxInteractions) && Number(a.settings.openedInteractions) >= Number(a.settings.maxInteractions), o || !s && i ? "app.online" : "app.offline"), null, {
+                location: "replace"
+            });
             var i, o, s
         }, e.close = function() {
             var e = a.visitor.interaction;
@@ -257,7 +279,9 @@ function() {
                         closedAt: moment().format("YYYY-MM-DD HH:mm:ss")
                     }).$promise
                 }).then(function() {
-                    r.go("app.closing")
+                    r.go("app.closing", null, {
+                        location: "replace"
+                    })
                 }).catch(function(e) {
                     console.error("keep open", e)
                 })
@@ -464,9 +488,13 @@ function() {
 
     function e(o, s, a, r) {
         var l = this,
-            d = null;
+            c = null;
         l.$onInit = function() {
-            o.status = "online", o.visitor && o.visitor.interaction ? o.visitor.interaction.id ? s.go("app.chat") : s.go("app.waiting") : (o.visitor = {
+            o.status = "online", o.visitor && o.visitor.interaction ? o.visitor.interaction.id ? s.go("app.chat", null, {
+                location: "replace"
+            }) : s.go("app.waiting", null, {
+                location: "replace"
+            }) : (o.visitor = {
                 id: o.settings.id,
                 mapKey: "firstName",
                 from: "Anonymous" + _.random(1, 1e6)
@@ -474,14 +502,14 @@ function() {
                 id: o.settings.id,
                 online: !0
             }).$promise.then(function(e) {
-                e.count && (d = e.fromKey, l.fields = e.rows)
+                e.count && (c = e.fromKey, l.fields = e.rows)
             }).catch(function(e) {
                 console.error(e)
             }))
         }, l.submit = function() {
             for (var e = "", t = 0; t < l.fields.length; t++) {
                 var n = l.fields[t];
-                n.props && l.form.hasOwnProperty(n.props.title) && (_.isNil(n.variable) || (o.visitor[n.variable] = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title]), _.isNil(n.cmField) || (o.visitor[n.cmField] = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title]), t === d && (_.isNil(o.settings.mapKey) || (o.visitor.mapKey = o.settings.mapKey, o.visitor.from = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title])), e += n.props.title + ": " + l.form[n.props.title] + "\n")
+                n.props && l.form.hasOwnProperty(n.props.title) && (_.isNil(n.variable) || (o.visitor[n.variable] = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title]), _.isNil(n.cmField) || (o.visitor[n.cmField] = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title]), t === c && (_.isNil(o.settings.mapKey) || (o.visitor.mapKey = o.settings.mapKey, o.visitor.from = _.isArray(l.form[n.props.title]) ? l.form[n.props.title].join() : l.form[n.props.title])), e += n.props.title + ": " + l.form[n.props.title] + "\n")
             }
             i = _.merge({
                 body: e,
@@ -492,7 +520,11 @@ function() {
                     id: e.message.id
                 }, o.visitor.interaction = {
                     id: e.interaction.id
-                }, o.updateStorage(r, o.visitor), l.disableItem = !1, o.settings.enableCustomerWriting ? s.go("app.chat") : s.go("app.waiting")
+                }, o.updateStorage(r, o.visitor), l.disableItem = !1, o.settings.enableCustomerWriting ? s.go("app.chat", null, {
+                    location: "replace"
+                }) : s.go("app.waiting", null, {
+                    location: "replace"
+                })
             }).catch(function(e) {
                 l.disableItem = !1, console.error(e)
             });
@@ -514,14 +546,18 @@ function() {
         var a = this;
 
         function r() {
-            i.settings.online ? e.go("app.online") : e.go("app.offline")
+            i.settings.online ? e.go("app.online", null, {
+                location: "replace"
+            }) : e.go("app.offline", null, {
+                location: "replace"
+            })
         }
 
         function l() {
             a.form = {}, a.upColor = null, a.downColor = null, a.userForm.$setPristine(), a.userForm.$setUntouched(), i.visitor = {}, i.enableDownload = !1, i.$emit("hide")
         }
 
-        function d(n) {
+        function c(n) {
             return function(e) {
                 a.errors[n] = e.data;
                 var t = o.simple().textContent(i.settings.formSubmitFailureMessage || "Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));
@@ -529,7 +565,7 @@ function() {
             }
         }
 
-        function c() {
+        function d() {
             i.loading = !1
         }
         a.form = {}, a.errors = {}, a.$onInit = function() {
@@ -542,7 +578,7 @@ function() {
                 delete a.errors.submit;
                 var e = o.simple().textContent(i.settings.formSubmitSuccessMessage || "Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));
                 o.show(e)
-            }).then(l).then(r).catch(d("submit")).finally(c) : (c(), d("submit"))
+            }).then(l).then(r).catch(c("submit")).finally(d) : (d(), c("submit"))
         }, a.skip = function() {
             l(), r()
         }
@@ -553,9 +589,9 @@ function() {
     "use strict";
 
     function e(i, e, t, o, n, s, a, r) {
-        var l, d = !1;
+        var l, c = !1;
 
-        function c() {
+        function d() {
             var t = {},
                 n = !1;
             s.chatInteraction.get({
@@ -565,14 +601,24 @@ function() {
                     intid: i.visitor.interaction.id
                 }).$promise
             }).then(function(e) {
-                n = 1 < e.rows.length, t.closed ? (i.visitor.interaction.closed = !0, i.updateStorage(a, i.visitor), "unmanaged" === t.disposition && o.go("app.unmanaged")) : t.UserId ? (i.visitor.interaction.UserId = t.UserId, i.updateStorage(a, i.visitor), o.go("app.chat")) : n && o.go("app.chat")
+                n = 1 < e.rows.length, t.closed ? (i.visitor.interaction.closed = !0, i.updateStorage(a, i.visitor), "unmanaged" === t.disposition && o.go("app.unmanaged", null, {
+                    location: "replace"
+                })) : t.UserId ? (i.visitor.interaction.UserId = t.UserId, i.updateStorage(a, i.visitor), o.go("app.chat", null, {
+                    location: "replace"
+                })) : n && o.go("app.chat", null, {
+                    location: "replace"
+                })
             }).catch(function(e) {
                 switch (e.status) {
                     case 403:
-                        o.go("app.closing");
+                        o.go("app.closing", null, {
+                            location: "replace"
+                        });
                         break;
                     case 405:
-                        o.go("app.unmanaged");
+                        o.go("app.unmanaged", null, {
+                            location: "replace"
+                        });
                         break;
                     default:
                         console.error(e)
@@ -581,8 +627,8 @@ function() {
         }
 
         function m() {
-            if (i.visitor && i.visitor.interaction && i.visitor.interaction.id && !d) {
-                d = !0;
+            if (i.visitor && i.visitor.interaction && i.visitor.interaction.id && !c) {
+                c = !0;
                 var e = new XMLHttpRequest;
                 e.open("PUT", i.settings.remote + "/api/chat/interactions/" + i.visitor.interaction.id + "/abandon?token=" + i.settings.token, !1), e.setRequestHeader("Content-type", "application/json; charset=utf-8"), e.send(JSON.stringify({
                     channel: "chat",
@@ -600,7 +646,7 @@ function() {
             }
         }
         this.$onInit = function() {
-            i.status = "waiting", i.visitor && i.visitor.interaction && i.visitor.interaction.id && (l = t(c, 3e3))
+            i.status = "waiting", i.visitor && i.visitor.interaction && i.visitor.interaction.id && (l = t(d, 3e3))
         }, e.$on("$destroy", function() {
             n.removeEventListener("beforeunload", m), n.removeEventListener("unload", m), t.cancel(l)
         }), n.addEventListener("beforeunload", m), n.addEventListener("unload", m)
similarity index 85%
rename from snippet/1.0.10/assets/images/logos/whisker_32x32.png
rename to snippet/1.0.11/assets/images/logos/whisker_32x32.png
index 84b9a7c2a55d8d609782888c50c253655f362f54..6fe758259c6e6c4d4acc678164806d8e94bc5c4e 100644 (file)
@@ -7,7 +7,7 @@
 
     function e(e) {
         if (!Ee(e)) return u;
-        D(e.objectMaxDepth) && (u.objectMaxDepth = c(e.objectMaxDepth) ? e.objectMaxDepth : NaN), D(e.urlErrorParamsEnabled) && Ae(e.urlErrorParamsEnabled) && (u.urlErrorParamsEnabled = e.urlErrorParamsEnabled)
+        O(e.objectMaxDepth) && (u.objectMaxDepth = c(e.objectMaxDepth) ? e.objectMaxDepth : NaN), O(e.urlErrorParamsEnabled) && Ae(e.urlErrorParamsEnabled) && (u.urlErrorParamsEnabled = e.urlErrorParamsEnabled)
     }
 
     function c(e) {
@@ -16,7 +16,7 @@
 
     function M(a, s) {
         s = s || Error;
-        var l = "https://errors.angularjs.org/1.7.5/",
+        var l = "https://errors.angularjs.org/1.7.8/",
             e = l.replace(".", "\\.") + "[\\s\\S]*",
             c = new RegExp(e, "g");
         return function() {
@@ -52,7 +52,7 @@
         y = de.angular || (de.angular = {}),
         i = 0;
 
-    function I(e) {
+    function R(e) {
         if (null == e || x(e)) return !1;
         if (ke(e) || Ce(e) || he && e instanceof he) return !0;
         var t = "length" in Object(e) && e.length;
@@ -64,7 +64,7 @@
         if (e)
             if (Te(e))
                 for (r in e) "prototype" !== r && "length" !== r && "name" !== r && e.hasOwnProperty(r) && t.call(n, e[r], r, e);
-            else if (ke(e) || I(e)) {
+            else if (ke(e) || R(e)) {
             var o = "object" != typeof e;
             for (r = 0, i = e.length; r < i; r++)(o || r in e) && t.call(n, e[r], r, e)
         } else if (e.forEach && e.forEach !== ve) e.forEach(t, n, e);
         return e
     }
 
-    function O(e) {
+    function D(e) {
         return function() {
             return e
         }
         return void 0 === e
     }
 
-    function D(e) {
+    function O(e) {
         return void 0 !== e
     }
 
     var Se = function(e) {
             return Ce(e) ? e.trim() : e
         },
-        R = function(e) {
+        I = function(e) {
             return e.replace(/([-()[\]{}+?*.$^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08")
         };
 
         return !(!e || !(e.nodeName || e.prop && e.attr && e.find))
     }
 
-    function Oe(e) {
+    function De(e) {
         return me(e.nodeName || e[0] && e[0].nodeName)
     }
 
         return -1 !== Array.prototype.indexOf.call(e, t)
     }
 
-    function De(e, t) {
+    function Oe(e, t) {
         var n = e.indexOf(t);
         return 0 <= n && e.splice(n, 1), n
     }
                         if (!Ie(e[r], t[r])) return !1;
                         i[r] = !0
                     } for (r in t)
-                    if (!(r in i) && "$" !== r.charAt(0) && D(t[r]) && !Te(t[r])) return !1;
+                    if (!(r in i) && "$" !== r.charAt(0) && O(t[r]) && !Te(t[r])) return !1;
                 return !0
             }
             if (!ke(t)) return !1;
         return !1
     }
     var L = function() {
-            if (!D(L.rules)) {
+            if (!O(L.rules)) {
                 var e = de.document.querySelector("[ng-csp]") || de.document.querySelector("[data-ng-csp]");
                 if (e) {
                     var t = e.getAttribute("ng-csp") || e.getAttribute("data-ng-csp");
             return L.rules
         },
         F = function() {
-            if (D(F.name_)) return F.name_;
+            if (O(F.name_)) return F.name_;
             var e, t, n, r, i = J.length;
             for (t = 0; t < i; ++t)
                 if (n = J[t], e = de.document.querySelector("[" + n.replace(":", "\\:") + "jq]")) {
         if (!we(e)) return E(t) || (t = t ? 2 : null), JSON.stringify(e, U, t)
     }
 
-    function z(e) {
+    function B(e) {
         return Ce(e) ? JSON.parse(e) : e
     }
-    var B = /:/g;
+    var z = /:/g;
 
     function W(e, t) {
-        e = e.replace(B, "");
+        e = e.replace(z, "");
         var n = Date.parse("Jan 01, 1970 00:00:00 " + e) / 6e4;
         return S(n) ? t : n
     }
         var i = {};
         return ve((e || "").split("&"), function(e) {
             var t, n, r;
-            e && (n = e = e.replace(/\+/g, "%20"), -1 !== (t = e.indexOf("=")) && (n = e.substring(0, t), r = e.substring(t + 1)), D(n = K(n)) && (r = !D(r) || K(r), pe.call(i, n) ? ke(i[n]) ? i[n].push(r) : i[n] = [i[n], r] : i[n] = r))
+            e && (n = e = e.replace(/\+/g, "%20"), -1 !== (t = e.indexOf("=")) && (n = e.substring(0, t), r = e.substring(t + 1)), O(n = K(n)) && (r = !O(r) || K(r), pe.call(i, n) ? ke(i[n]) ? i[n].push(r) : i[n] = [i[n], r] : i[n] = r))
         }), i
     }
 
                 var t, n = e + "app";
                 !i && (t = r.querySelector("[" + n.replace(":", "\\:") + "]")) && (o = (i = t).getAttribute(n))
             }), i) {
-            if (!ee) {
-                try {
-                    de.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match.")
-                } catch (e) {}
-                return
-            }
+            if (!ee) return void de.console.error("AngularJS: disabling automatic bootstrap. <script> protocol indicates an extension, document.location.href does not match.");
             t.strictDi = null !== function(e, t) {
                 var n, r, i = J.length;
                 for (r = 0; r < i; ++r)
     var qe = 1,
         Ue = 3,
         Ve = 8,
-        ze = 9,
-        Be = 11;
+        Be = 9,
+        ze = 11;
 
     function We(e, t) {
         if (ke(e)) {
         var n, r, i
     }
     var Ge = {
-        full: "1.7.5",
+        full: "1.7.8",
         major: 1,
         minor: 7,
-        dot: 5,
-        codeName: "anti-prettification"
+        dot: 8,
+        codeName: "enthusiastic-oblation"
     };
     ft.expando = "ng339";
     var Ke = ft.cache = {},
 
     function ct(e) {
         var t = e.nodeType;
-        return t === qe || !t || t === ze
+        return t === qe || !t || t === Be
     }
 
     function ut(e, t) {
     }
 
     function vt(n, e, r, t) {
-        if (D(t)) throw et("offargs", "jqLite#off() does not support the `selector` argument");
+        if (O(t)) throw et("offargs", "jqLite#off() does not support the `selector` argument");
         var i = yt(n),
             o = i && i.events,
             a = i && i.handle;
             if (e) {
                 var s = function(e) {
                     var t = o[e];
-                    D(r) && De(t || [], r), D(r) && t && 0 < t.length || (n.removeEventListener(e, a), delete o[e])
+                    O(r) && Oe(t || [], r), O(r) && t && 0 < t.length || (n.removeEventListener(e, a), delete o[e])
                 };
                 ve(e.split(" "), function(e) {
                     s(e), Je[e] && s(Je[e])
 
     function _t(e, t, n) {
         if (ct(e)) {
-            var r, i = D(n),
+            var r, i = O(n),
                 o = !i && t && !Ee(t),
                 a = !t,
                 s = yt(e, !o),
     }
 
     function xt(e, t, n) {
-        e.nodeType === ze && (e = e.documentElement);
+        e.nodeType === Be && (e = e.documentElement);
         for (var r = ke(t) ? t : [t]; e;) {
             for (var i = 0, o = r.length; i < o; i++)
-                if (D(n = he.data(e, r[i]))) return n;
-            e = e.parentNode || e.nodeType === Be && e.host
+                if (O(n = he.data(e, r[i]))) return n;
+            e = e.parentNode || e.nodeType === ze && e.host
         }
     }
 
             sort: [].sort,
             splice: [].splice
         },
-        Ot = {};
+        Dt = {};
     ve("multiple,selected,checked,disabled,readOnly,required,open".split(","), function(e) {
-        Ot[me(e)] = e
+        Dt[me(e)] = e
     });
-    var Dt = {};
+    var Ot = {};
     ve("input,select,option,textarea,button,form,details".split(","), function(e) {
-        Dt[e] = !0
+        Ot[e] = !0
     });
     var Nt = {
         ngMinlength: "minlength",
     };
 
     function It(e, t) {
-        var n = Ot[t.toLowerCase()];
-        return n && Dt[Oe(e)] && n
+        var n = Dt[t.toLowerCase()];
+        return n && Ot[De(e)] && n
     }
 
     function Rt(e, t, n) {
         },
         hasClass: $t,
         css: function(e, t, n) {
-            if (t = nt(t.replace(Qe, "ms-")), !D(n)) return e.style[t];
+            if (t = nt(t.replace(Qe, "ms-")), !O(n)) return e.style[t];
             e.style[t] = n
         },
         attr: function(e, t, n) {
             var r, i = e.nodeType;
             if (i !== Ue && 2 !== i && i !== Ve && e.getAttribute) {
                 var o = me(t),
-                    a = Ot[o];
-                if (!D(n)) return r = e.getAttribute(t), a && null !== r && (r = o), null === r ? void 0 : r;
+                    a = Dt[o];
+                if (!O(n)) return r = e.getAttribute(t), a && null !== r && (r = o), null === r ? void 0 : r;
                 null === n || !1 === n && a ? e.removeAttribute(t) : e.setAttribute(t, a ? o : n)
             }
         },
         prop: function(e, t, n) {
-            if (!D(n)) return e[t];
+            if (!O(n)) return e[t];
             e[t] = n
         },
         text: function() {
         }(),
         val: function(e, t) {
             if (we(t)) {
-                if (e.multiple && "select" === Oe(e)) {
+                if (e.multiple && "select" === De(e)) {
                     var n = [];
                     return ve(e.options, function(e) {
                         e.selected && n.push(e.value || e.text)
     }), ve({
         removeData: bt,
         on: function(i, e, o, t) {
-            if (D(t)) throw et("onargs", "jqLite#on() does not support the `selector` or `eventData` parameters");
+            if (O(t)) throw et("onargs", "jqLite#on() does not support the `selector` or `eventData` parameters");
             if (ct(i)) {
                 var s, l, n, r = yt(i, !0),
                     a = r.events,
         },
         append: function(e, t) {
             var n = e.nodeType;
-            if (n === qe || n === Be)
+            if (n === qe || n === ze)
                 for (var r = 0, i = (t = new ft(t)).length; r < i; r++) {
                     var o = t[r];
                     e.appendChild(o)
         },
         parent: function(e) {
             var t = e.parentNode;
-            return t && t.nodeType !== Be ? t : null
+            return t && t.nodeType !== ze ? t : null
         },
         next: function(e) {
             return e.nextElementSibling
         }
     }, function(a, e) {
         ft.prototype[e] = function(e, t, n) {
-            for (var r, i = 0, o = this.length; i < o; i++) we(r) ? D(r = a(this[i], e, t, n)) && (r = he(r)) : Ct(r, a(this[i], e, t, n));
-            return D(r) ? r : this
+            for (var r, i = 0, o = this.length; i < o; i++) we(r) ? O(r = a(this[i], e, t, n)) && (r = he(r)) : Ct(r, a(this[i], e, t, n));
+            return O(r) ? r : this
         }
     }), ft.prototype.bind = ft.prototype.on, ft.prototype.unbind = ft.prototype.off;
     var Lt = Object.create(null);
             }]
         }],
         Vt = /^([^(]+?)=>/,
-        zt = /^[^(]*\(\s*([^)]*)\)/m,
-        Bt = /,/,
+        Bt = /^[^(]*\(\s*([^)]*)\)/m,
+        zt = /,/,
         Wt = /^\s*(_?)(\S+?)\1\s*$/,
         Yt = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,
         Gt = M("$injector");
 
     function Zt(e) {
         var t = Kt(e).replace(Yt, "");
-        return t.match(Vt) || t.match(zt)
+        return t.match(Vt) || t.match(Bt)
     }
 
     function Xt(e, c) {
                         }])
                     }),
                     value: f(function(e, t) {
-                        return p(e, O(t), !1)
+                        return p(e, D(t), !1)
                     }),
                     constant: f(function(e, t) {
                         le(e, "constant"), u[e] = t, n[e] = t
             }),
             d = t;
         u["$injector" + a] = {
-            $get: O(t)
+            $get: D(t)
         }, d.modules = l.modules = Fe();
         var r = m(e);
         return (d = t.get("$injector")).strictDi = c, ve(r, function(e) {
             function l(e) {
                 var t, n, r;
                 (e = Ce(e) ? e : E(e) ? e.toString() : i.hash()) ? (t = a.getElementById(e)) ? s(t): (n = a.getElementsByName(e), r = null, Array.prototype.some.call(n, function(e) {
-                    if ("a" === Oe(e)) return r = e, !0
+                    if ("a" === De(e)) return r = e, !0
                 }), (t = r) ? s(t) : "top" === e && s(null)): s(null)
             }
             return e && o.$watch(function() {
             if (!(r = e.$inject)) {
                 if (r = [], e.length) {
                     if (t) throw Ce(n) && n || (n = e.name || ((o = Zt(e)) ? "function(" + (o[1] || "").replace(/[\s\r\n]+/, " ") + ")" : "fn")), Gt("strictdi", "{0} is not using explicit annotation and cannot be invoked in strict mode", n);
-                    ve(Zt(e)[1].split(Bt), function(e) {
+                    ve(Zt(e)[1].split(zt), function(e) {
                         e.replace(Wt, function(e, t, n) {
                             r.push(n)
                         })
         w(), c.url = function(e, t, n) {
             if (we(n) && (n = null), u !== s.location && (u = s.location), d !== s.history && (d = s.history), e) {
                 var r = h === n;
-                if (p === e && (!l.history || r)) return c;
+                if (e = fi(e).href, p === e && (!l.history || r)) return c;
                 var i = p && cr(p) === cr(e);
                 return p = e, h = n, !l.history || i && r ? (i || (g = e), t ? u.replace(e) : i ? u.hash = -1 === (a = (o = e).indexOf("#")) ? "" : o.substr(a) : u.href = e, u.href !== e && (g = e)) : (d[t ? "replaceState" : "pushState"](n, "", e), w()), g && (g = e), c
             }
     function vn(n, t) {
         var p = {},
             m = "Directive",
-            z = /^\s*directive:\s*([\w-]+)\s+(.*)$/,
+            B = /^\s*directive:\s*([\w-]+)\s+(.*)$/,
             ue = /(([\w-]+)(?::([^;]+))?;?)/,
             g = function(e) {
                 var t, n = {},
                     try {
                         var n = o.invoke(e);
                         Te(n) ? n = {
-                            compile: O(n)
-                        } : !n.compile && n.link && (n.compile = O(n.link)), n.priority = n.priority || 0, n.index = t, n.name = n.name || l, n.require = (!ke(i = (r = n).require || r.controller && r.name) && Ee(i) && ve(i, function(e, t) {
+                            compile: D(n)
+                        } : !n.compile && n.link && (n.compile = D(n.link)), n.priority = n.priority || 0, n.index = t, n.name = n.name || l, n.require = (!ke(i = (r = n).require || r.controller && r.name) && Ee(i) && ve(i, function(e, t) {
                             var n = e.match(b);
                             e.substring(n[0].length) || (i[t] = n[0] + t)
                         }), i), n.restrict = function(e, t) {
                 "$" === t.charAt(0) && (n[t] = e, Te(o) && (o[t] = e))
             }), n.$inject = ["$injector"], this.directive(t, n)
         }, this.aHrefSanitizationWhitelist = function(e) {
-            return D(e) ? (t.aHrefSanitizationWhitelist(e), this) : t.aHrefSanitizationWhitelist()
+            return O(e) ? (t.aHrefSanitizationWhitelist(e), this) : t.aHrefSanitizationWhitelist()
         }, this.imgSrcSanitizationWhitelist = function(e) {
-            return D(e) ? (t.imgSrcSanitizationWhitelist(e), this) : t.imgSrcSanitizationWhitelist()
+            return O(e) ? (t.imgSrcSanitizationWhitelist(e), this) : t.imgSrcSanitizationWhitelist()
         };
         var w = !0,
             E = !(this.debugInfoEnabled = function(e) {
-                return D(e) ? (w = e, this) : w
+                return O(e) ? (w = e, this) : w
             });
         this.strictComponentBindingsEnabled = function(e) {
-            return D(e) ? (E = e, this) : E
+            return O(e) ? (E = e, this) : E
         };
         var C = 10;
         this.onChangesTtl = function(e) {
                     })
                 }
                 e(Gr.HTML, ["iframe|srcdoc", "*|innerHTML", "*|outerHTML"]), e(Gr.CSS, ["*|style"]), e(Gr.URL, ["area|href", "area|ping", "a|href", "a|ping", "blockquote|cite", "body|background", "del|cite", "input|src", "ins|cite", "q|cite"]), e(Gr.MEDIA_URL, ["audio|src", "img|src", "img|srcset", "source|src", "source|srcset", "track|src", "video|src", "video|poster"]), e(Gr.RESOURCE_URL, ["*|formAction", "applet|code", "applet|codebase", "base|href", "embed|src", "frame|src", "form|action", "head|profile", "html|manifest", "iframe|src", "link|href", "media|src", "object|codebase", "object|data", "script|src"])
-            }(), this.$get = ["$injector", "$interpolate", "$exceptionHandler", "$templateRequest", "$parse", "$controller", "$rootScope", "$sce", "$animate", function(h, A, B, e, S, W, O, f, i) {
+            }(), this.$get = ["$injector", "$interpolate", "$exceptionHandler", "$templateRequest", "$parse", "$controller", "$rootScope", "$sce", "$animate", function(h, A, z, e, S, W, D, f, i) {
                 var o, l = /^\w/,
                     c = de.document.createElement("div"),
-                    D = k,
+                    O = k,
                     N = x,
                     t = C;
 
                 function a() {
                     try {
                         if (!--t) throw o = void 0, mn("infchng", "{0} $onChanges() iterations reached. Aborting!\n", C);
-                        O.$apply(function() {
+                        D.$apply(function() {
                             for (var e = 0, t = o.length; e < t; ++e) try {
                                 o[e]()
                             } catch (e) {
-                                B(e)
+                                z(e)
                             }
                             o = void 0
                         })
                         var i = It(this.$$element[0], e),
                             o = Nt[e],
                             a = e;
-                        i ? (this.$$element.prop(e, t), r = i) : o && (this[o] = t, a = o), this[e] = t, r ? this.$attr[e] = r : (r = this.$attr[e]) || (this.$attr[e] = r = je(e, "-")), "img" === Oe(this.$$element) && "srcset" === e && (this[e] = t = u(t, "$set('srcset', value)")), !1 !== n && (null === t || we(t) ? this.$$element.removeAttr(r) : l.test(r) ? this.$$element.attr(r, t) : function(e, t, n) {
+                        i ? (this.$$element.prop(e, t), r = i) : o && (this[o] = t, a = o), this[e] = t, r ? this.$attr[e] = r : (r = this.$attr[e]) || (this.$attr[e] = r = je(e, "-")), "img" === De(this.$$element) && "srcset" === e && (this[e] = t = u(t, "$set('srcset', value)")), !1 !== n && (null === t || we(t) ? this.$$element.removeAttr(r) : l.test(r) ? i && !1 === t ? this.$$element.removeAttr(r) : this.$$element.attr(r, t) : function(e, t, n) {
                             c.innerHTML = "<span " + t + ">";
                             var r = c.firstChild.attributes,
                                 i = r[0];
                             try {
                                 e(t)
                             } catch (e) {
-                                B(e)
+                                z(e)
                             }
                         })
                     },
                         var n = this,
                             r = n.$$observers || (n.$$observers = Fe()),
                             i = r[e] || (r[e] = []);
-                        return i.push(t), O.$evalAsync(function() {
+                        return i.push(t), D.$evalAsync(function() {
                                 i.$$inter || !n.hasOwnProperty(e) || we(n[e]) || t(n[e])
                             }),
                             function() {
-                                De(i, t)
+                                Oe(i, t)
                             }
                     }
                 };
                         var r, i, o, a = (n = n || {}).parentBoundTranscludeFn,
                             s = n.transcludeControllers,
                             l = n.futureParentElement;
-                        if (a && a.$$boundTransclude && (a = a.$$boundTransclude), h || (i = (r = l) && r[0], h = i && "foreignobject" !== Oe(i) && ge.call(i).match(/SVG/) ? "svg" : "html"), o = "html" !== h ? he(oe(h, he("<div></div>").append(u).html())) : t ? St.clone.call(u) : u, s)
+                        if (a && a.$$boundTransclude && (a = a.$$boundTransclude), h || (i = (r = l) && r[0], h = i && "foreignobject" !== De(i) && ge.call(i).match(/SVG/) ? "svg" : "html"), o = "html" !== h ? he(oe(h, he("<div></div>").append(u).html())) : t ? St.clone.call(u) : u, s)
                             for (var c in s) o.data("$" + c + "Controller", s[c].instance);
                         return K.$$addScopeInfo(o, e), t && t(o, e), f && f(e, o, o, a), t || (u = f = null), o
                     }
                         p = n.$attr;
                     switch (h) {
                         case qe:
-                            L(t, $n(a = Oe(e)), "E", r, i);
+                            L(t, $n(a = De(e)), "E", r, i);
                             for (var m, g, v, b, y, _ = e.attributes, $ = 0, w = _ && _.length; $ < w; $++) {
                                 var E, C = !1,
                                     k = !1,
                                     M = !1;
                                 g = (m = _[$]).name, b = m.value, (y = (v = $n(g.toLowerCase())).match(I)) ? (x = "Attr" === y[1], T = "Prop" === y[1], M = "On" === y[1], g = g.replace(yn, "").toLowerCase().substr(4 + y[1].length).replace(/_(.)/g, function(e, t) {
                                     return t.toUpperCase()
-                                })) : (E = v.match(R)) && F(E[1]) && (k = (C = g).substr(0, g.length - 5) + "end", g = g.substr(0, g.length - 6)), T || M ? (n[v] = b, p[v] = m.name, T ? U(e, t, v, g) : (d = v, f = g, t.push(Fo(S, O, B, d, f, !1)))) : (p[v = $n(g.toLowerCase())] = g, !x && n.hasOwnProperty(v) || (n[v] = b, It(e, v) && (n[v] = !0)), V(e, t, b, v, x), L(t, v, "A", r, i, C, k))
+                                })) : (E = v.match(R)) && F(E[1]) && (k = (C = g).substr(0, g.length - 5) + "end", g = g.substr(0, g.length - 6)), T || M ? (n[v] = b, p[v] = m.name, T ? U(e, t, v, g) : (d = v, f = g, t.push(Uo(S, D, z, d, f, !1)))) : (p[v = $n(g.toLowerCase())] = g, !x && n.hasOwnProperty(v) || (n[v] = b, It(e, v) && (n[v] = !0)), V(e, t, b, v, x), L(t, v, "A", r, i, C, k))
                             }
                             if ("input" === a && "hidden" === e.getAttribute("type") && e.setAttribute("autocomplete", "off"), !N) break;
                             if (Ee(s = e.className) && (s = s.animVal), Ce(s) && "" !== s)
                             });
                             break;
                         case Ve:
-                            if (!D) break;
+                            if (!O) break;
                             ! function(e, t, n, r, i) {
                                 try {
-                                    var o = z.exec(e.nodeValue);
+                                    var o = B.exec(e.nodeValue);
                                     if (o) {
                                         var a = $n(o[1]);
                                         L(t, a, "M", r, i) && (n[a] = Se(o[2]))
                     i = i || {};
                     for (var o, a, s, l, c, u = -Number.MAX_VALUE, C = i.newScopeDirective, k = i.controllerDirectives, x = i.newIsolateScopeDirective, T = i.templateDirective, d = i.nonTlbTranscludeDirective, f = !1, h = !1, M = i.hasElementTranscludeDirective, p = $.$$element = he(_), m = r, g = t, v = !1, b = !1, y = 0, A = e.length; y < A; y++) {
                         var S = (o = e[y]).$$start,
-                            O = o.$$end;
-                        if (S && (p = X(_, S, O)), s = void 0, u > o.priority) break;
+                            D = o.$$end;
+                        if (S && (p = X(_, S, D)), s = void 0, u > o.priority) break;
                         if ((c = o.scope) && (o.templateUrl || (Ee(c) ? (ie("new/isolated scope", x || C, o, p), x = o) : ie("new/isolated scope", x, o, p)), C = C || o), a = o.name, !v && (o.replace && (o.templateUrl || o.template) || o.transclude && !o.$$tlb)) {
-                            for (var D, N = y + 1; D = e[N++];)
-                                if (D.transclude && !D.$$tlb || D.replace && (D.templateUrl || D.template)) {
+                            for (var O, N = y + 1; O = e[N++];)
+                                if (O.transclude && !O.$$tlb || O.replace && (O.templateUrl || O.template)) {
                                     b = !0;
                                     break
                                 } v = !0
                                             var n = "?" === e.charAt(0);
                                             e = n ? e.substring(1) : e, R[e] = t, I[t] = null, P[t] = n
                                         }), ve(p.contents(), function(e) {
-                                            var t = R[$n(Oe(e))];
+                                            var t = R[$n(De(e))];
                                             t ? (P[t] = !0, I[t] = I[t] || de.document.createDocumentFragment(), I[t].appendChild(e)) : s.appendChild(e)
                                         }), ve(P, function(e, t) {
                                             if (!e) throw mn("reqslot", "Required transclusion slot `{0}` was not filled.", t)
                                     q = e.splice(y + 1, e.length - (y + 1));
                                 (x || C) && te(F, x, C), e = e.concat(F).concat(q), ne($, L), A = e.length
                             } else p.html(c);
-                        if (o.templateUrl) h = !0, ie("template", T, o, p), (T = o).replace && (m = o), z = re(e.splice(y, e.length - y), p, $, n, f && g, w, E, {
+                        if (o.templateUrl) h = !0, ie("template", T, o, p), (T = o).replace && (m = o), B = re(e.splice(y, e.length - y), p, $, n, f && g, w, E, {
                             controllerDirectives: k,
                             newScopeDirective: C !== o && C,
                             newIsolateScopeDirective: x,
                         else if (o.compile) try {
                             l = o.compile(p, $, g);
                             var U = o.$$originalDirective || o;
-                            Te(l) ? V(null, Pe(U, l), S, O) : l && V(Pe(U, l.pre), Pe(U, l.post), S, O)
+                            Te(l) ? V(null, Pe(U, l), S, D) : l && V(Pe(U, l.pre), Pe(U, l.post), S, D)
                         } catch (e) {
-                            B(e, He(p))
+                            z(e, He(p))
                         }
-                        o.terminal && (z.terminal = !0, u = Math.max(u, o.priority))
+                        o.terminal && (B.terminal = !0, u = Math.max(u, o.priority))
                     }
-                    return z.scope = C && !0 === C.scope, z.transcludeOnThisElement = f, z.templateOnThisElement = h, z.transclude = g, i.hasElementTranscludeDirective = M, z;
+                    return B.scope = C && !0 === C.scope, B.transcludeOnThisElement = f, B.templateOnThisElement = h, B.transclude = g, i.hasElementTranscludeDirective = M, B;
 
                     function V(e, t, n, r) {
                         e && (n && (e = Q(e, n, r)), e.require = o.require, e.directiveName = a, (x === o || o.$$isolateScope) && (e = se(e, {
                         })), E.push(t))
                     }
 
-                    function z(e, t, n, r, a) {
+                    function B(e, t, n, r, a) {
                         var i, o, s, l, c, u, d, f, h, p;
                         for (var m in _ === n ? f = (h = $).$$element : h = new Y(f = he(n), $), c = t, x ? l = t.$new(!0) : C && (c = t.$parent), a && ((d = function(e, t, n, r) {
                                 var i;
                                 if (Te(t.$onChanges)) try {
                                     t.$onChanges(e.bindingInfo.initialChanges)
                                 } catch (e) {
-                                    B(e)
+                                    z(e)
                                 }
                                 if (Te(t.$onInit)) try {
                                     t.$onInit()
                                 } catch (e) {
-                                    B(e)
+                                    z(e)
                                 }
                                 Te(t.$doCheck) && (c.$watch(function() {
                                     t.$doCheck()
                             l = "?" === t[2];
                         if ("^^" === s ? r = r.parent() : o = (o = i && i[a]) && o.instance, !o) {
                             var c = "$" + a + "Controller";
-                            o = "^^" === s && r[0] && r[0].nodeType === ze ? null : s ? r.inheritedData(c) : r.data(c)
+                            o = "^^" === s && r[0] && r[0].nodeType === Be ? null : s ? r.inheritedData(c) : r.data(c)
                         }
                         if (!o && !l) throw mn("ctreq", "Controller '{0}', required by directive '{1}', can't be found!", a, n)
                     } else if (ke(e)) {
                             }
                             w = null
                         }).catch(function(e) {
-                            xe(e) && B(e)
+                            xe(e) && z(e)
                         }),
                         function(e, t, n, r, i) {
                             var o = i;
 
                 function U(e, t, n, o) {
                     if (_.test(o)) throw mn("nodomevents", "Property bindings for HTML DOM event properties are disallowed");
-                    var r, i, a = Oe(e),
+                    var r, i, a = De(e),
                         s = (r = a, i = o.toLowerCase(), T[r + "|" + i] || T["*|" + i]),
                         l = $e;
                     "srcset" !== o || "img" !== a && "source" !== a ? s && (l = f.getTrusted.bind(f, s)) : l = d, t.push({
                                 pre: function(t, n) {
                                     function e() {
                                         var e = r(t);
-                                        n.prop(o, l(e))
+                                        n[0][o] = l(e)
                                     }
                                     e(), t.$watch(i, e)
                                 }
                 }
 
                 function V(e, t, o, a, n) {
-                    var r, i, s = Oe(e),
+                    var r, i, s = De(e),
                         l = (r = s, "srcdoc" === (i = a) ? f.HTML : "src" === i || "ngSrc" === i ? -1 === ["img", "video", "audio", "source", "track"].indexOf(r) ? f.RESOURCE_URL : f.MEDIA_URL : "xlinkHref" === i ? "image" === r ? f.MEDIA_URL : "a" === r ? f.URL : f.RESOURCE_URL : "form" === r && "action" === i || "base" === r && "href" === i || "link" === r && "href" === i ? f.RESOURCE_URL : "a" !== r || "href" !== i && "ngHref" !== i ? void 0 : f.URL),
                         c = !n,
                         u = g[a] || n,
                     try {
                         e(t, n, r, i, o)
                     } catch (e) {
-                        B(e, He(n))
+                        z(e, He(n))
                     }
                 }
 
                 }
             }]
         },
-        On = "application/json",
-        Dn = {
-            "Content-Type": On + ";charset=utf-8"
+        Dn = "application/json",
+        On = {
+            "Content-Type": Dn + ";charset=utf-8"
         },
         Nn = /^\[|^\{(?!\{)/,
         In = {
             var n = t.replace(Rn, "").trim();
             if (n) {
                 var r = e("Content-Type"),
-                    i = r && 0 === r.indexOf(On);
+                    i = r && 0 === r.indexOf(Dn);
                 if (i || (a = (o = n).match(Nn)) && In[a[0]].test(o)) try {
-                    t = z(n)
+                    t = B(n)
                 } catch (e) {
                     if (!i) return t;
                     throw Pn("baddata", 'Data must be a valid JSON object. Received: "{0}". Parse error: "{1}"', t, e)
         }), t)
     }
 
-    function zn(e) {
+    function Bn(e) {
         return 200 <= e && e < 300
     }
 
-    function Bn() {
+    function zn() {
         var C = this.defaults = {
                 transformResponse: [Fn],
                 transformRequest: [function(e) {
                     common: {
                         Accept: "application/json, text/plain, */*"
                     },
-                    post: We(Dn),
-                    put: We(Dn),
-                    patch: We(Dn)
+                    post: We(On),
+                    put: We(On),
+                    patch: We(On)
                 },
                 xsrfCookieName: "XSRF-TOKEN",
                 xsrfHeaderName: "X-XSRF-TOKEN",
             },
             k = !1;
         this.useApplyAsync = function(e) {
-            return D(e) ? (k = !!e, this) : k
+            return O(e) ? (k = !!e, this) : k
         };
         var t = this.interceptors = [],
             r = this.xsrfWhitelistedOrigins = [];
             ve(t, function(e) {
                 c.unshift(Ce(e) ? l.get(e) : l.invoke(e))
             });
-            var n, w = (n = [ui].concat(r.map(di)), function(e) {
-                var t = di(e);
-                return n.some(fi.bind(null, t))
+            var n, w = (n = [ui].concat(r.map(fi)), function(e) {
+                var t = fi(e);
+                return n.some(hi.bind(null, t))
             });
 
             function E(e) {
                         }(l, o.jsonpCallbackParam));
                         var c, u;
                         E.pendingRequests.push(o), n.then(m, m), !o.cache && !C.cache || !1 === o.cache || "GET" !== o.method && "JSONP" !== o.method || (a = Ee(o.cache) ? o.cache : Ee(C.cache) ? C.cache : $);
-                        a && (D(t = a.get(l)) ? T(t) ? t.then(p, p) : ke(t) ? h(t[1], t[0], We(t[2]), t[3], t[4]) : h(t, 200, {}, "OK", "complete") : a.put(l, n));
+                        a && (O(t = a.get(l)) ? T(t) ? t.then(p, p) : ke(t) ? h(t[1], t[0], We(t[2]), t[3], t[4]) : h(t, 200, {}, "OK", "complete") : a.put(l, n));
                         if (we(t)) {
                             var d = w(o.url) ? v()[o.xsrfCookieName || C.xsrfCookieName] : void 0;
                             d && (r[o.xsrfHeaderName || C.xsrfHeaderName] = d), g(o.method, l, e, function(e, t, n, r, i) {
-                                a && (zn(e) ? a.put(l, [e, t, qn(n), r, i]) : a.remove(l));
+                                a && (Bn(e) ? a.put(l, [e, t, qn(n), r, i]) : a.remove(l));
 
                                 function o() {
                                     h(t, e, n, r, i)
                         }
 
                         function h(e, t, n, r, i) {
-                            (zn(t = -1 <= t ? t : 0) ? s.resolve : s.reject)({
+                            (Bn(t = -1 <= t ? t : 0) ? s.resolve : s.reject)({
                                 data: e,
                                 status: t,
                                 headers: Un(n),
 
                 function a(e) {
                     var t = be({}, e);
-                    return t.data = Vn(e.data, e.headers, e.status, n.transformResponse), zn(e.status) ? t : y.reject(t)
+                    return t.data = Vn(e.data, e.headers, e.status, n.transformResponse), Bn(e.status) ? t : y.reject(t)
                 }
             }
             return E.pendingRequests = [],
                         var f = b(e, r),
                             h = !1;
                         if (f.open(e, r, !0), ve(n, function(e, t) {
-                                D(e) && f.setRequestHeader(t, e)
+                                O(e) && f.setRequestHeader(t, e)
                             }), f.onload = function() {
                                 var e = f.statusText || "",
                                     t = "response" in f ? f.response : f.responseText,
                                     n = 1223 === f.status ? 204 : f.status;
-                                0 === n && (n = t ? 200 : "file" === di(r).protocol ? 404 : 0), g(i, n, t, f.getAllResponseHeaders(), e, "complete")
+                                0 === n && (n = t ? 200 : "file" === fi(r).protocol ? 404 : 0), g(i, n, t, f.getAllResponseHeaders(), e, "complete")
                             }, f.onerror = function() {
                                 g(i, -1, null, null, "", "error")
                             }, f.ontimeout = function() {
                         m("timeout")
                     }, o);
                     else T(o) && o.then(function() {
-                        m(D(o.$$timeoutId) ? "timeout" : "abort")
+                        m(O(o.$$timeoutId) ? "timeout" : "abort")
                     });
 
                     function m(e) {
                     }
 
                     function g(e, t, n, r, i, o) {
-                        D(p) && y.cancel(p), d = f = null, e(t, n, r, i, o)
+                        O(p) && y.cancel(p), d = f = null, e(t, n, r, i, o)
                     }
                 };
             var v, b, y, _, $
             function r(i, e, r, o) {
                 var a = r === $.URL || r === $.MEDIA_URL;
                 if (!i.length || -1 === i.indexOf(x)) {
-                    if (e && !a) return;
+                    if (e) return;
                     var t = C(i);
                     a && (t = $.getTrusted(r, t));
-                    var n = O(t);
+                    var n = D(t);
                     return n.exp = i, n.expressions = [], n.$$watchDelegate = k, n
                 }
                 o = !!o;
                 d = 1 === m.length && 1 === g.length;
                 var v = a && d ? void 0 : function(e) {
                     try {
-                        return e = r && !a ? $.getTrusted(r, e) : $.valueOf(e), o && !D(e) ? e : ue(e)
+                        return e = r && !a ? $.getTrusted(r, e) : $.valueOf(e), o && !O(e) ? e : ue(e)
                     } catch (e) {
                         _(Gn.interr(i, e))
                     }
                     var i = 4 < arguments.length,
                         o = i ? Re(arguments, 4) : [],
                         a = 0,
-                        s = D(r) && !r,
+                        s = O(r) && !r,
                         l = (s ? m : p).defer(),
                         c = l.promise;
 
                     function u() {
                         i ? e.apply(null, o) : e(a)
                     }
-                    return n = D(n) ? n : 0, c.$$intervalId = d(function() {
+                    return n = O(n) ? n : 0, c.$$intervalId = d(function() {
                         s ? h.defer(u) : g.$evalAsync(u), l.notify(a++), 0 < n && n <= a && (l.resolve(a), f(c.$$intervalId)), s || g.$apply()
                     }, t, l, s), c
                 }
     }
 
     function ir(e, t) {
-        var n = di(e);
+        var n = fi(e);
         t.$$protocol = n.protocol, t.$$host = n.hostname, t.$$port = _(n.port) || tr[n.protocol] || null
     }
     var or = /^\s*[\\/]{2,}/;
         if (or.test(e)) throw nr("badpath", 'Invalid url "{0}".', e);
         var r = "/" !== e.charAt(0);
         r && (e = "/" + e);
-        var i = di(e),
+        var i = fi(e),
             o = r && "/" === i.pathname.charAt(0) ? i.pathname.substring(1) : i.pathname;
         t.$$path = function(e, t) {
             for (var n = e.split("/"), r = n.length; r--;) n[r] = decodeURIComponent(n[r]), t && (n[r] = n[r].replace(/\//g, "%2F"));
         }, this.$$normalizeUrl = function(e) {
             return a + e.substr(1)
         }, this.$$parseLinkUrl = function(e, t) {
-            return t && "#" === t[0] ? (this.hash(t.slice(1)), !0) : (D(n = lr(o, e)) ? (r = n, i = s && D(n = lr(s, n)) ? a + (lr("/", n) || n) : o + r) : D(n = lr(a, e)) ? i = a + n : a === e + "/" && (i = a), i && this.$$parse(i), !!i);
+            return t && "#" === t[0] ? (this.hash(t.slice(1)), !0) : (O(n = lr(o, e)) ? (r = n, i = s && O(n = lr(s, n)) ? a + (lr("/", n) || n) : o + r) : O(n = lr(a, e)) ? i = a + n : a === e + "/" && (i = a), i && this.$$parse(i), !!i);
             var n, r, i
         }
     }
                 rewriteLinks: !0
             };
         this.hashPrefix = function(e) {
-            return D(e) ? (v = e, this) : v
+            return O(e) ? (v = e, this) : v
         }, this.html5Mode = function(e) {
             return Ae(e) ? (b.enabled = e, this) : Ee(e) ? (Ae(e.enabled) && (b.enabled = e.enabled), Ae(e.requireBase) && (b.requireBase = e.requireBase), (Ae(e.rewriteLinks) || Ce(e.rewriteLinks)) && (b.rewriteLinks = e.rewriteLinks), this) : b
         }, this.$get = ["$rootScope", "$browser", "$sniffer", "$rootElement", "$window", function(s, l, c, o, e) {
                 var t = b.rewriteLinks;
                 if (t && !e.ctrlKey && !e.metaKey && !e.shiftKey && 2 !== e.which && 2 !== e.button) {
                     for (var n = he(e.target);
-                        "a" !== Oe(n[0]);)
+                        "a" !== De(n[0]);)
                         if (n[0] === o[0] || !(n = n.parent())[0]) return;
                     if (!Ce(t) || !we(n.attr(t))) {
                         var r = n.prop("href"),
                             i = n.attr("href") || n.attr("xlink:href");
-                        Ee(r) && "[object SVGAnimatedString]" === r.toString() && (r = di(r.animVal).href), h.test(r) || !r || n.attr("target") || e.isDefaultPrevented() || u.$$parseLinkUrl(r, i) && (e.preventDefault(), u.absUrl() !== l.url() && s.$apply())
+                        Ee(r) && "[object SVGAnimatedString]" === r.toString() && (r = fi(r.animVal).href), h.test(r) || !r || n.attr("target") || e.isDefaultPrevented() || u.$$parseLinkUrl(r, i) && (e.preventDefault(), u.absUrl() !== l.url() && s.$apply())
                     }
                 }
             }), u.absUrl() !== a && l.url(u.absUrl(), !0);
                         e = u.absUrl(),
                         r = l.state(),
                         i = u.$$replace,
-                        o = !((t = n) === (a = e) || di(t).href === di(a).href) || u.$$html5 && c.history && r !== u.$$state;
+                        o = !((t = n) === (a = e) || fi(t).href === fi(a).href) || u.$$html5 && c.history && r !== u.$$state;
                     (m || o) && (m = !1, s.$evalAsync(function() {
                         var e = u.absUrl(),
                             t = s.$broadcast("$locationChangeStart", e, n, u.$$state, r).defaultPrevented;
         var r = !0,
             o = this;
         this.debugEnabled = function(e) {
-            return D(e) ? (r = e, this) : r
+            return O(e) ? (r = e, this) : r
         }, this.$get = ["$window", function(n) {
             var e, i = fe || /\bEdge\//.test(n.navigator && n.navigator.userAgent);
             return {
         },
         throwError: function(e, t, n) {
             n = n || this.index;
-            var r = D(t) ? "s " + t + "-" + this.index + " [" + this.text.substring(t, n) + "]" : " " + n;
+            var r = O(t) ? "s " + t + "-" + this.index + " [" + this.text.substring(t, n) + "]" : " " + n;
             throw br("lexerr", "Lexer Error: {0} at column{1} in expression [{2}].", e, r, this.text)
         },
         readNumber: function() {
         assignment: function() {
             var e = this.ternary();
             if (this.expect("=")) {
-                if (!Or(e)) throw br("lval", "Trying to assign a value to a non l-value");
+                if (!Dr(e)) throw br("lval", "Trying to assign a value to a non l-value");
                 e = {
                     type: Cr.AssignmentExpression,
                     left: e,
         }
     }
 
-    function Or(e) {
+    function Dr(e) {
         return e.type === Cr.Identifier || e.type === Cr.MemberExpression
     }
 
-    function Dr(e) {
-        if (1 === e.body.length && Or(e.body[0].expression)) return {
+    function Or(e) {
+        if (1 === e.body.length && Dr(e.body[0].expression)) return {
             type: Cr.AssignmentExpression,
             left: e.body[0].expression,
             right: {
             }
 
             function n(e, t, n, r, i) {
-                var o, a, s = r.literal ? h : D,
+                var o, a, s = r.literal ? h : O,
                     l = r.$$intercepted || r,
                     c = r.$$interceptor || $e,
                     u = r.inputs && !l.inputs;
             function h(e) {
                 var t = !0;
                 return ve(e, function(e) {
-                    D(e) || (t = !1)
+                    O(e) || (t = !1)
                 }), t
             }
 
                 t.$evalAsync(e)
             }, e, n)
         }], this.errorOnUnhandledRejections = function(e) {
-            return D(e) ? (n = e, this) : n
+            return O(e) ? (n = e, this) : n
         }
     }
 
                 t.defer(e)
             }, e, n)
         }], this.errorOnUnhandledRejections = function(e) {
-            return D(e) ? (n = e, this) : n
+            return O(e) ? (n = e, this) : n
         }
     }
 
     }
 
     function Vr(e) {
-        Ur(e.$$state)
+        e.$$state && Ur(e.$$state)
     }
 
-    function zr() {
+    function Br() {
         this.$get = ["$window", "$timeout", function(e, n) {
             var r = e.requestAnimationFrame || e.webkitRequestAnimationFrame,
                 i = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.webkitCancelRequestAnimationFrame,
         }]
     }
 
-    function Br() {
+    function zr() {
         var C = 10,
             k = M("$rootScope"),
             x = null,
                         };
                     return x = null, s || ((s = a.$$watchers = []).$$digestWatchIndex = -1), s.unshift(l), s.$$digestWatchIndex++, c(this, 1),
                         function() {
-                            var e = De(s, l);
+                            var e = Oe(s, l);
                             0 <= e && (c(a, -1), e < s.$$digestWatchIndex && s.$$digestWatchIndex--), x = null
                         }
                 },
                         var t, n, r, i;
                         if (!we(a = e)) {
                             if (Ee(a))
-                                if (I(a)) {
+                                if (R(a)) {
                                     s !== c && (f = (s = c).length = 0, l++), t = a.length, f !== t && (l++, s.length = f = t);
                                     for (var o = 0; o < t; o++) i = s[o], r = a[o], i != i && r != r || i === r || (l++, s[o] = r)
                                 } else {
                     return this.$watch(t, function() {
                         if (d ? (d = !1, n(a, a, i)) : n(a, r, i), o)
                             if (Ee(a))
-                                if (I(a)) {
+                                if (R(a)) {
                                     r = new Array(a.length);
                                     for (var e = 0; e < a.length; e++) r[e] = a[e]
                                 } else
         var i = /^\s*(https?|s?ftp|mailto|tel|file):/,
             o = /^\s*((https?|ftp|file|blob):|data:image\/)/;
         this.aHrefSanitizationWhitelist = function(e) {
-            return D(e) ? (i = e, this) : i
+            return O(e) ? (i = e, this) : i
         }, this.imgSrcSanitizationWhitelist = function(e) {
-            return D(e) ? (o = e, this) : o
+            return O(e) ? (o = e, this) : o
         }, this.$get = function() {
             return function(e, t) {
                 var n = t ? o : i,
-                    r = di(e && e.trim()).href;
+                    r = fi(e && e.trim()).href;
                 return "" === r || r.match(n) ? e : "unsafe:" + r
             }
         }
                 inputs: []
             }, Ar(e, i.$filter);
             var t, n = "";
-            if (this.stage = "assign", t = Dr(e)) {
+            if (this.stage = "assign", t = Or(e)) {
                 this.state.computing = "assign";
                 var r = this.nextId();
                 this.recurse(t, r), this.return_(r), n = "fn.assign=" + this.generateFunction("assign", "s,v,l")
         },
         recurse: function(n, t, e, r, i, o) {
             var a, s, l, c, u, d = this;
-            if (r = r || _e, !o && D(n.watchId)) return t = t || this.nextId(), void this.if_("i", this.lazyAssign(t, this.computedMember("i", n.watchId)), this.lazyRecurse(n, t, e, r, i, !0));
+            if (r = r || _e, !o && O(n.watchId)) return t = t || this.nextId(), void this.if_("i", this.lazyAssign(t, this.computedMember("i", n.watchId)), this.lazyRecurse(n, t, e, r, i, !0));
             switch (n.type) {
                 case Cr.Program:
                     ve(n.body, function(e, t) {
     }, Ir.prototype = {
         compile: function(e) {
             var t, r, i = this;
-            Ar(e, i.$filter), (t = Dr(e)) && (r = this.recurse(t));
+            Ar(e, i.$filter), (t = Or(e)) && (r = this.recurse(t));
             var o, n = Sr(e.body);
             n && (o = [], ve(n, function(e, t) {
                 var n = i.recurse(e);
         "unary+": function(o, a) {
             return function(e, t, n, r) {
                 var i = o(e, t, n, r);
-                return i = D(i) ? +i : 0, a ? {
+                return i = O(i) ? +i : 0, a ? {
                     value: i
                 } : i
             }
         "unary-": function(o, a) {
             return function(e, t, n, r) {
                 var i = o(e, t, n, r);
-                return i = D(i) ? -i : -0, a ? {
+                return i = O(i) ? -i : -0, a ? {
                     value: i
                 } : i
             }
             return function(e, t, n, r) {
                 var i = s(e, t, n, r),
                     o = l(e, t, n, r),
-                    a = (D(i) ? i : 0) - (D(o) ? o : 0);
+                    a = (O(i) ? i : 0) - (O(o) ? o : 0);
                 return c ? {
                     value: a
                 } : a
 
     function Xr(e) {
         var t = [];
-        return D(e) && ve(e, function(e) {
+        return O(e) && ve(e, function(e) {
             t.push(function(e) {
                 if ("self" === e) return e;
                 if (Ce(e)) {
                     if (-1 < e.indexOf("***")) throw Yr("iwcard", "Illegal sequence *** in string matcher.  String: {0}", e);
-                    return e = R(e).replace(/\\\*\\\*/g, ".*").replace(/\\\*/g, "[^:/.?&;]*"), new RegExp("^" + e + "$")
+                    return e = I(e).replace(/\\\*\\\*/g, ".*").replace(/\\\*/g, "[^:/.?&;]*"), new RegExp("^" + e + "$")
                 }
                 if (k(e)) return new RegExp("^" + e.source + "$");
                 throw Yr("imatcher", 'Matchers may only be "self", string patterns or RegExp objects')
             };
 
             function o(e, t) {
-                return "self" === e ? fi(t, ui) || fi(t, de.document.baseURI ? de.document.baseURI : (li || ((li = de.document.createElement("a")).href = ".", li = li.cloneNode(!1)), li.href)) : !!e.exec(t.href)
+                return "self" === e ? hi(t, ui) || hi(t, de.document.baseURI ? de.document.baseURI : (li || ((li = de.document.createElement("a")).href = ".", li = li.cloneNode(!1)), li.href)) : !!e.exec(t.href)
             }
 
             function t(e) {
                     if (Te(t.$$unwrapTrustedValue) && (t = t.$$unwrapTrustedValue()), e === Gr.MEDIA_URL || e === Gr.URL) return r(t.toString(), e === Gr.MEDIA_URL);
                     if (e === Gr.RESOURCE_URL) {
                         if (function(e) {
-                                var t, n, r = di(e.toString()),
+                                var t, n, r = fi(e.toString()),
                                     i = !1;
                                 for (t = 0, n = s.length; t < n; t++)
                                     if (o(s[t], r)) {
     }
 
     function ti() {
-        this.$get = O(function(e) {
+        this.$get = D(function(e) {
             return new ni(e)
         })
     }
                     return ve(t, function(t) {
                         var e = y.element(t).data("$binding");
                         e && ve(e, function(e) {
-                            r ? new RegExp("(^|\\s)" + R(n) + "(\\s|\\||$)").test(e) && i.push(t) : -1 !== e.indexOf(n) && i.push(t)
+                            r ? new RegExp("(^|\\s)" + I(n) + "(\\s|\\||$)").test(e) && i.push(t) : -1 !== e.indexOf(n) && i.push(t)
                         })
                     }), i
                 },
             function e(e, t, n) {
                 Te(e) || (n = t, t = e, e = _e);
                 var r, i = Re(arguments, 3),
-                    o = D(n) && !n,
+                    o = O(n) && !n,
                     a = (o ? d : u).defer(),
                     s = a.promise;
                 return r = c.defer(function() {
         }]
     }
     var li, ci = de.document.createElement("a"),
-        ui = di(de.location.href);
+        ui = fi(de.location.href);
+    ci.href = "http://[::1]";
+    var di = "[::1]" === ci.hostname;
 
-    function di(e) {
+    function fi(e) {
         if (!Ce(e)) return e;
         var t = e;
-        return fe && (ci.setAttribute("href", t), t = ci.href), ci.setAttribute("href", t), {
+        fe && (ci.setAttribute("href", t), t = ci.href), ci.setAttribute("href", t);
+        var n = ci.hostname;
+        return !di && -1 < n.indexOf(":") && (n = "[" + n + "]"), {
             href: ci.href,
             protocol: ci.protocol ? ci.protocol.replace(/:$/, "") : "",
             host: ci.host,
             search: ci.search ? ci.search.replace(/^\?/, "") : "",
             hash: ci.hash ? ci.hash.replace(/^#/, "") : "",
-            hostname: ci.hostname,
+            hostname: n,
             port: ci.port,
             pathname: "/" === ci.pathname.charAt(0) ? ci.pathname : "/" + ci.pathname
         }
     }
 
-    function fi(e, t) {
-        return e = di(e), t = di(t), e.protocol === t.protocol && e.host === t.host
+    function hi(e, t) {
+        return e = fi(e), t = fi(t), e.protocol === t.protocol && e.host === t.host
     }
 
-    function hi() {
-        this.$get = O(de)
+    function pi() {
+        this.$get = D(de)
     }
 
-    function pi(e) {
+    function mi(e) {
         var a = e[0] || {},
             s = {},
             l = "";
         }
     }
 
-    function mi() {
-        this.$get = pi
+    function gi() {
+        this.$get = mi
     }
 
-    function gi(r) {
+    function vi(r) {
         var i = "Filter";
 
         function o(e, t) {
             return function(e) {
                 return t.get(e + i)
             }
-        }], o("currency", Ei), o("date", Ri), o("filter", vi), o("json", Pi), o("limitTo", Li), o("lowercase", Hi), o("number", Ci), o("orderBy", qi), o("uppercase", ji)
+        }], o("currency", Ci), o("date", Pi), o("filter", bi), o("json", Hi), o("limitTo", Fi), o("lowercase", ji), o("number", ki), o("orderBy", Ui), o("uppercase", Li)
     }
 
-    function vi() {
+    function bi() {
         return function(e, t, n, r) {
-            if (!I(e)) {
+            if (!R(e)) {
                 if (null == e) return e;
                 throw M("filter")("notarray", "Expected array but received: {0}", e)
             }
             var i, o;
-            switch (r = r || "$", yi(t)) {
+            switch (r = r || "$", _i(t)) {
                 case "function":
                     i = t;
                     break;
                             return !we(e) && (null === e || null === t ? e === t : !(Ee(t) || Ee(e) && !$(e)) && (e = me("" + e), t = me("" + t), -1 !== e.indexOf(t)))
                         });
                         return function(e) {
-                            return o && !Ee(e) ? bi(e, t[r], n, r, !1) : bi(e, t, n, r, i)
+                            return o && !Ee(e) ? yi(e, t[r], n, r, !1) : yi(e, t, n, r, i)
                         }
                     }(t, n, r, o);
                     break;
         }
     }
 
-    function bi(e, t, n, r, i, o) {
-        var a = yi(e),
-            s = yi(t);
-        if ("string" === s && "!" === t.charAt(0)) return !bi(e, t.substring(1), n, r, i);
+    function yi(e, t, n, r, i, o) {
+        var a = _i(e),
+            s = _i(t);
+        if ("string" === s && "!" === t.charAt(0)) return !yi(e, t.substring(1), n, r, i);
         if (ke(e)) return e.some(function(e) {
-            return bi(e, t, n, r, i)
+            return yi(e, t, n, r, i)
         });
         switch (a) {
             case "object":
                 var l;
                 if (i) {
                     for (l in e)
-                        if (l.charAt && "$" !== l.charAt(0) && bi(e[l], t, n, r, !0)) return !0;
-                    return !o && bi(e, t, n, r, !1)
+                        if (l.charAt && "$" !== l.charAt(0) && yi(e[l], t, n, r, !0)) return !0;
+                    return !o && yi(e, t, n, r, !1)
                 }
                 if ("object" !== s) return n(e, t);
                 for (l in t) {
                     var c = t[l];
                     if (!Te(c) && !we(c)) {
                         var u = l === r;
-                        if (!bi(u ? e : e[l], c, n, r, u, u)) return !1
+                        if (!yi(u ? e : e[l], c, n, r, u, u)) return !1
                     }
                 }
                 return !0;
         }
     }
 
-    function yi(e) {
+    function _i(e) {
         return null === e ? "null" : typeof e
     }
-    pi.$inject = ["$document"], gi.$inject = ["$provide"];
-    var _i = 22,
-        $i = ".",
-        wi = "0";
+    mi.$inject = ["$document"], vi.$inject = ["$provide"];
+    var $i = 22,
+        wi = ".",
+        Ei = "0";
 
-    function Ei(e) {
+    function Ci(e) {
         var i = e.NUMBER_FORMATS;
         return function(e, t, n) {
             we(t) && (t = i.CURRENCY_SYM), we(n) && (n = i.PATTERNS[1].maxFrac);
             var r = t ? /\u00A4/g : /\s*\u00A4\s*/g;
-            return null == e ? e : ki(e, i.PATTERNS[1], i.GROUP_SEP, i.DECIMAL_SEP, n).replace(r, t)
+            return null == e ? e : xi(e, i.PATTERNS[1], i.GROUP_SEP, i.DECIMAL_SEP, n).replace(r, t)
         }
     }
 
-    function Ci(e) {
+    function ki(e) {
         var n = e.NUMBER_FORMATS;
         return function(e, t) {
-            return null == e ? e : ki(e, n.PATTERNS[0], n.GROUP_SEP, n.DECIMAL_SEP, t)
+            return null == e ? e : xi(e, n.PATTERNS[0], n.GROUP_SEP, n.DECIMAL_SEP, t)
         }
     }
 
-    function ki(e, t, n, r, i) {
+    function xi(e, t, n, r, i) {
         if (!Ce(e) && !E(e) || isNaN(e)) return "";
         var o, a = !isFinite(e),
             s = !1,
                 d && (i.unshift(d), e.i++)
             })(o = function(e) {
                 var t, n, r, i, o, a = 0;
-                for (-1 < (n = e.indexOf($i)) && (e = e.replace($i, "")), 0 < (r = e.search(/e/i)) ? (n < 0 && (n = r), n += +e.slice(r + 1), e = e.substring(0, r)) : n < 0 && (n = e.length), r = 0; e.charAt(r) === wi; r++);
+                for (-1 < (n = e.indexOf(wi)) && (e = e.replace(wi, "")), 0 < (r = e.search(/e/i)) ? (n < 0 && (n = r), n += +e.slice(r + 1), e = e.substring(0, r)) : n < 0 && (n = e.length), r = 0; e.charAt(r) === Ei; r++);
                 if (r === (o = e.length)) t = [0], n = 1;
                 else {
-                    for (o--; e.charAt(o) === wi;) o--;
+                    for (o--; e.charAt(o) === Ei;) o--;
                     for (n -= r, t = [], i = 0; r <= o; r++, i++) t[i] = +e.charAt(r)
                 }
-                return _i < n && (t = t.splice(0, _i - 1), a = n - 1, n = 1), {
+                return $i < n && (t = t.splice(0, $i - 1), a = n - 1, n = 1), {
                     d: t,
                     e: a,
                     i: n
         return e < 0 && !s ? t.negPre + c + t.negSuf : t.posPre + c + t.posSuf
     }
 
-    function xi(e, t, n, r) {
+    function Ti(e, t, n, r) {
         var i = "";
-        for ((e < 0 || r && e <= 0) && (r ? e = 1 - e : (e = -e, i = "-")), e = "" + e; e.length < t;) e = wi + e;
+        for ((e < 0 || r && e <= 0) && (r ? e = 1 - e : (e = -e, i = "-")), e = "" + e; e.length < t;) e = Ei + e;
         return n && (e = e.substr(e.length - t)), i + e
     }
 
-    function Ti(n, r, i, o, a) {
+    function Mi(n, r, i, o, a) {
         return i = i || 0,
             function(e) {
                 var t = e["get" + n]();
-                return (0 < i || -i < t) && (t += i), 0 === t && -12 === i && (t = 12), xi(t, r, o, a)
+                return (0 < i || -i < t) && (t += i), 0 === t && -12 === i && (t = 12), Ti(t, r, o, a)
             }
     }
 
-    function Mi(r, i, o) {
+    function Ai(r, i, o) {
         return function(e, t) {
             var n = e["get" + r]();
             return t[f((o ? "STANDALONE" : "") + (i ? "SHORT" : "") + r)][n]
         }
     }
 
-    function Ai(e) {
+    function Si(e) {
         var t = new Date(e, 0, 1).getDay();
         return new Date(e, 0, (t <= 4 ? 5 : 12) - t)
     }
 
-    function Si(i) {
+    function Di(i) {
         return function(e) {
-            var t, n = Ai(e.getFullYear()),
+            var t, n = Si(e.getFullYear()),
                 r = +(t = e, new Date(t.getFullYear(), t.getMonth(), t.getDate() + (4 - t.getDay()))) - +n;
-            return xi(1 + Math.round(r / 6048e5), i)
+            return Ti(1 + Math.round(r / 6048e5), i)
         }
     }
 
     function Oi(e, t) {
         return e.getFullYear() <= 0 ? t.ERAS[0] : t.ERAS[1]
     }
-    Ei.$inject = ["$locale"];
-    var Di = {
-            yyyy: Ti("FullYear", 4, 0, !(Ci.$inject = ["$locale"]), !0),
-            yy: Ti("FullYear", 2, 0, !0, !0),
-            y: Ti("FullYear", 1, 0, !1, !0),
-            MMMM: Mi("Month"),
-            MMM: Mi("Month", !0),
-            MM: Ti("Month", 2, 1),
-            M: Ti("Month", 1, 1),
-            LLLL: Mi("Month", !1, !0),
-            dd: Ti("Date", 2),
-            d: Ti("Date", 1),
-            HH: Ti("Hours", 2),
-            H: Ti("Hours", 1),
-            hh: Ti("Hours", 2, -12),
-            h: Ti("Hours", 1, -12),
-            mm: Ti("Minutes", 2),
-            m: Ti("Minutes", 1),
-            ss: Ti("Seconds", 2),
-            s: Ti("Seconds", 1),
-            sss: Ti("Milliseconds", 3),
-            EEEE: Mi("Day"),
-            EEE: Mi("Day", !0),
+    Ci.$inject = ["$locale"];
+    var Ni = {
+            yyyy: Mi("FullYear", 4, 0, !(ki.$inject = ["$locale"]), !0),
+            yy: Mi("FullYear", 2, 0, !0, !0),
+            y: Mi("FullYear", 1, 0, !1, !0),
+            MMMM: Ai("Month"),
+            MMM: Ai("Month", !0),
+            MM: Mi("Month", 2, 1),
+            M: Mi("Month", 1, 1),
+            LLLL: Ai("Month", !1, !0),
+            dd: Mi("Date", 2),
+            d: Mi("Date", 1),
+            HH: Mi("Hours", 2),
+            H: Mi("Hours", 1),
+            hh: Mi("Hours", 2, -12),
+            h: Mi("Hours", 1, -12),
+            mm: Mi("Minutes", 2),
+            m: Mi("Minutes", 1),
+            ss: Mi("Seconds", 2),
+            s: Mi("Seconds", 1),
+            sss: Mi("Milliseconds", 3),
+            EEEE: Ai("Day"),
+            EEE: Ai("Day", !0),
             a: function(e, t) {
                 return e.getHours() < 12 ? t.AMPMS[0] : t.AMPMS[1]
             },
             Z: function(e, t, n) {
                 var r = -1 * n,
                     i = 0 <= r ? "+" : "";
-                return i += xi(Math[0 < r ? "floor" : "ceil"](r / 60), 2) + xi(Math.abs(r % 60), 2)
+                return i += Ti(Math[0 < r ? "floor" : "ceil"](r / 60), 2) + Ti(Math.abs(r % 60), 2)
             },
-            ww: Si(2),
-            w: Si(1),
+            ww: Di(2),
+            w: Di(1),
             G: Oi,
             GG: Oi,
             GGG: Oi,
                 return e.getFullYear() <= 0 ? t.ERANAMES[0] : t.ERANAMES[1]
             }
         },
-        Ni = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,
-        Ii = /^-?\d+$/;
+        Ii = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\s\S]*)/,
+        Ri = /^-?\d+$/;
 
-    function Ri(l) {
+    function Pi(l) {
         var d = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
         return function(t, e, n) {
             var r, i, o = "",
                 a = [];
-            if (e = e || "mediumDate", e = l.DATETIME_FORMATS[e] || e, Ce(t) && (t = Ii.test(t) ? _(t) : function(e) {
+            if (e = e || "mediumDate", e = l.DATETIME_FORMATS[e] || e, Ce(t) && (t = Ri.test(t) ? _(t) : function(e) {
                     var t;
                     if (t = e.match(d)) {
                         var n = new Date(0),
                     }
                     return e
                 }(t)), E(t) && (t = new Date(t)), !C(t) || !isFinite(t.getTime())) return t;
-            for (; e;) e = (i = Ni.exec(e)) ? (a = q(a, i, 1)).pop() : (a.push(e), null);
+            for (; e;) e = (i = Ii.exec(e)) ? (a = q(a, i, 1)).pop() : (a.push(e), null);
             var s = t.getTimezoneOffset();
             return n && (s = W(n, s), t = G(t, n, !0)), ve(a, function(e) {
-                r = Di[e], o += r ? r(t, l.DATETIME_FORMATS, s) : "''" === e ? "'" : e.replace(/(^'|'$)/g, "").replace(/''/g, "'")
+                r = Ni[e], o += r ? r(t, l.DATETIME_FORMATS, s) : "''" === e ? "'" : e.replace(/(^'|'$)/g, "").replace(/''/g, "'")
             }), o
         }
     }
 
-    function Pi() {
+    function Hi() {
         return function(e, t) {
             return we(t) && (t = 2), V(e, t)
         }
     }
-    Ri.$inject = ["$locale"];
-    var Hi = O(me),
-        ji = O(f);
+    Pi.$inject = ["$locale"];
+    var ji = D(me),
+        Li = D(f);
 
-    function Li() {
+    function Fi() {
         return function(e, t, n) {
-            return t = Math.abs(Number(t)) === 1 / 0 ? Number(t) : _(t), S(t) ? e : (E(e) && (e = e.toString()), I(e) ? (n = (n = !n || isNaN(n) ? 0 : _(n)) < 0 ? Math.max(0, e.length + n) : n, 0 <= t ? Fi(e, n, n + t) : 0 === n ? Fi(e, t, e.length) : Fi(e, Math.max(0, n + t), n)) : e)
+            return t = Math.abs(Number(t)) === 1 / 0 ? Number(t) : _(t), S(t) ? e : (E(e) && (e = e.toString()), R(e) ? (n = (n = !n || isNaN(n) ? 0 : _(n)) < 0 ? Math.max(0, e.length + n) : n, 0 <= t ? qi(e, n, n + t) : 0 === n ? qi(e, t, e.length) : qi(e, Math.max(0, n + t), n)) : e)
         }
     }
 
-    function Fi(e, t, n) {
+    function qi(e, t, n) {
         return Ce(e) ? e.slice(t, n) : a.call(e, t, n)
     }
 
-    function qi(l) {
+    function Ui(l) {
         return function(e, t, n, r) {
             if (null == e) return e;
-            if (!I(e)) throw M("orderBy")("notarray", "Expected array but received: {0}", e);
+            if (!R(e)) throw M("orderBy")("notarray", "Expected array but received: {0}", e);
             ke(t) || (t = [t]), 0 === t.length && (t = ["+"]);
             var o = t.map(function(e) {
                     var t = 1,
         }
     }
 
-    function Ui(e) {
+    function Vi(e) {
         return Te(e) && (e = {
             link: e
-        }), e.restrict = e.restrict || "AC", O(e)
+        }), e.restrict = e.restrict || "AC", D(e)
     }
-    qi.$inject = ["$parse"];
-    var Vi = O({
+    Ui.$inject = ["$parse"];
+    var Bi = D({
             restrict: "E",
             compile: function(e, t) {
                 if (!t.href && !t.xlinkHref) return function(e, t) {
             }
         }),
         zi = {};
-    ve(Ot, function(e, r) {
+    ve(Dt, function(e, r) {
         if ("multiple" !== e) {
             var i = $n("ng-" + r),
                 t = o;
                 }
             }
         }
-    }), ve(["src", "srcset", "href"], function(o) {
-        var a = $n("ng-" + o);
-        zi[a] = function() {
+    }), ve(["src", "srcset", "href"], function(a) {
+        var s = $n("ng-" + a);
+        zi[s] = ["$sce", function(o) {
             return {
                 priority: 99,
                 link: function(e, t, n) {
-                    var r = o,
-                        i = o;
-                    "href" === o && "[object SVGAnimatedString]" === ge.call(t.prop("href")) && (i = "xlinkHref", n.$attr[i] = "xlink:href", r = null), n.$observe(a, function(e) {
-                        e ? (n.$set(i, e), fe && r && t.prop(r, n[i])) : "href" === o && n.$set(i, null)
+                    var r = a,
+                        i = a;
+                    "href" === a && "[object SVGAnimatedString]" === ge.call(t.prop("href")) && (i = "xlinkHref", n.$attr[i] = "xlink:href", r = null), n.$set(s, o.getTrustedMediaUrl(n[s])), n.$observe(s, function(e) {
+                        e ? (n.$set(i, e), fe && r && t.prop(r, n[i])) : "href" === a && n.$set(i, null)
                     })
                 }
             }
-        }
+        }]
     });
-    var Bi = {
+    var Wi = {
             $addControl: _e,
-            $getControls: O([]),
+            $getControls: D([]),
             $$renameControl: function(e, t) {
                 e.$name = t
             },
             $setSubmitted: _e,
             $$setSubmitted: _e
         },
-        Wi = "ng-pending",
-        Yi = "ng-submitted";
+        Yi = "ng-pending",
+        Gi = "ng-submitted";
 
-    function Gi(e, t, n, r, i) {
-        this.$$controls = [], this.$error = {}, this.$$success = {}, this.$pending = void 0, this.$name = i(t.name || t.ngForm || "")(n), this.$dirty = !1, this.$pristine = !0, this.$valid = !0, this.$invalid = !1, this.$submitted = !1, this.$$parentForm = Bi, this.$$element = e, this.$$animate = r, Qi(this)
+    function Ki(e, t, n, r, i) {
+        this.$$controls = [], this.$error = {}, this.$$success = {}, this.$pending = void 0, this.$name = i(t.name || t.ngForm || "")(n), this.$dirty = !1, this.$pristine = !0, this.$valid = !0, this.$invalid = !1, this.$submitted = !1, this.$$parentForm = Wi, this.$$element = e, this.$$animate = r, Ji(this)
     }
-    Gi.$inject = ["$element", "$attrs", "$scope", "$animate", "$interpolate"], Gi.prototype = {
+    Ki.$inject = ["$element", "$attrs", "$scope", "$animate", "$interpolate"], Ki.prototype = {
         $rollbackViewValue: function() {
             ve(this.$$controls, function(e) {
                 e.$rollbackViewValue()
                 this.$setValidity(t, null, n)
             }, this), ve(this.$$success, function(e, t) {
                 this.$setValidity(t, null, n)
-            }, this), De(this.$$controls, n), n.$$parentForm = Bi
+            }, this), Oe(this.$$controls, n), n.$$parentForm = Wi
         },
         $setDirty: function() {
-            this.$$animate.removeClass(this.$$element, Go), this.$$animate.addClass(this.$$element, Ko), this.$dirty = !0, this.$pristine = !1, this.$$parentForm.$setDirty()
+            this.$$animate.removeClass(this.$$element, Zo), this.$$animate.addClass(this.$$element, Xo), this.$dirty = !0, this.$pristine = !1, this.$$parentForm.$setDirty()
         },
         $setPristine: function() {
-            this.$$animate.setClass(this.$$element, Go, Ko + " " + Yi), this.$dirty = !1, this.$pristine = !0, this.$submitted = !1, ve(this.$$controls, function(e) {
+            this.$$animate.setClass(this.$$element, Zo, Xo + " " + Gi), this.$dirty = !1, this.$pristine = !0, this.$submitted = !1, ve(this.$$controls, function(e) {
                 e.$setPristine()
             })
         },
             })
         },
         $setSubmitted: function() {
-            for (var e = this; e.$$parentForm && e.$$parentForm !== Bi;) e = e.$$parentForm;
+            for (var e = this; e.$$parentForm && e.$$parentForm !== Wi;) e = e.$$parentForm;
             e.$$setSubmitted()
         },
         $$setSubmitted: function() {
-            this.$$animate.addClass(this.$$element, Yi), this.$submitted = !0, ve(this.$$controls, function(e) {
+            this.$$animate.addClass(this.$$element, Gi), this.$submitted = !0, ve(this.$$controls, function(e) {
                 e.$$setSubmitted && e.$$setSubmitted()
             })
         }
-    }, Ji({
-        clazz: Gi,
+    }, eo({
+        clazz: Ki,
         set: function(e, t, n) {
             var r = e[t];
             r ? -1 === r.indexOf(n) && r.push(n) : e[t] = [n]
         },
         unset: function(e, t, n) {
             var r = e[t];
-            r && (De(r, n), 0 === r.length && delete e[t])
+            r && (Oe(r, n), 0 === r.length && delete e[t])
         }
     });
-    var Ki = function(n) {
+    var Zi = function(n) {
             return ["$timeout", "$parse", function(l, t) {
                 return {
                     name: "form",
                     restrict: n ? "EAC" : "E",
                     require: ["form", "^^?form"],
-                    controller: Gi,
+                    controller: Ki,
                     compile: function(e, t) {
-                        e.addClass(Go).addClass(Wo);
+                        e.addClass(Zo).addClass(Go);
                         var s = t.name ? "name" : !(!n || !t.ngForm) && "ngForm";
                         return {
                             pre: function(t, e, n, r) {
                                 s && (a(t, i), n.$observe(s, function(e) {
                                     i.$name !== e && (a(t, void 0), i.$$parentForm.$$renameControl(i, e), (a = c(i.$name))(t, i))
                                 })), e.on("$destroy", function() {
-                                    i.$$parentForm.$removeControl(i), a(t, void 0), be(i, Bi)
+                                    i.$$parentForm.$removeControl(i), a(t, void 0), be(i, Wi)
                                 })
                             }
                         }
                 }
             }]
         },
-        Zi = Ki(),
-        Xi = Ki(!0);
+        Xi = Zi(),
+        Qi = Zi(!0);
 
-    function Qi(e) {
-        e.$$classCache = {}, e.$$classCache[Yo] = !(e.$$classCache[Wo] = e.$$element.hasClass(Wo))
+    function Ji(e) {
+        e.$$classCache = {}, e.$$classCache[Ko] = !(e.$$classCache[Go] = e.$$element.hasClass(Go))
     }
 
-    function Ji(e) {
+    function eo(e) {
         var t = e.clazz,
             i = e.set,
             o = e.unset;
         }
 
         function s(e, t, n) {
-            t = t ? "-" + je(t, "-") : "", a(e, Wo + t, !0 === n), a(e, Yo + t, !1 === n)
+            t = t ? "-" + je(t, "-") : "", a(e, Go + t, !0 === n), a(e, Ko + t, !1 === n)
         }
         t.prototype.$setValidity = function(e, t, n) {
             var r;
                 i(e[t], n, r)
             }(this, "$pending", e, n) : function(e, t, n, r) {
                 e[t] && o(e[t], n, r);
-                eo(e[t]) && (e[t] = void 0)
-            }(this, "$pending", e, n), Ae(t) ? t ? (o(this.$error, e, n), i(this.$$success, e, n)) : (i(this.$error, e, n), o(this.$$success, e, n)) : (o(this.$error, e, n), o(this.$$success, e, n)), this.$pending ? (a(this, Wi, !0), this.$valid = this.$invalid = void 0, s(this, "", null)) : (a(this, Wi, !1), this.$valid = eo(this.$error), this.$invalid = !this.$valid, s(this, "", this.$valid)), s(this, e, r = this.$pending && this.$pending[e] ? void 0 : !this.$error[e] && (!!this.$$success[e] || null)), this.$$parentForm.$setValidity(e, r, this)
+                to(e[t]) && (e[t] = void 0)
+            }(this, "$pending", e, n), Ae(t) ? t ? (o(this.$error, e, n), i(this.$$success, e, n)) : (i(this.$error, e, n), o(this.$$success, e, n)) : (o(this.$error, e, n), o(this.$$success, e, n)), this.$pending ? (a(this, Yi, !0), this.$valid = this.$invalid = void 0, s(this, "", null)) : (a(this, Yi, !1), this.$valid = to(this.$error), this.$invalid = !this.$valid, s(this, "", this.$valid)), s(this, e, r = this.$pending && this.$pending[e] ? void 0 : !this.$error[e] && (!!this.$$success[e] || null)), this.$$parentForm.$setValidity(e, r, this)
         }
     }
 
-    function eo(e) {
+    function to(e) {
         if (e)
             for (var t in e)
                 if (e.hasOwnProperty(t)) return !1;
         return !0
     }
-    var to = /^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,
-        no = /^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,
-        ro = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,
-        io = /^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,
-        oo = /^(\d{4,})-(\d{2})-(\d{2})$/,
-        ao = /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,
-        so = /^(\d{4,})-W(\d\d)$/,
-        lo = /^(\d{4,})-(\d\d)$/,
-        co = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,
-        uo = "keydown wheel mousedown",
-        fo = Fe();
+    var no = /^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,
+        ro = /^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,
+        io = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,
+        oo = /^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,
+        ao = /^(\d{4,})-(\d{2})-(\d{2})$/,
+        so = /^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,
+        lo = /^(\d{4,})-W(\d\d)$/,
+        co = /^(\d{4,})-(\d\d)$/,
+        uo = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,
+        fo = "keydown wheel mousedown",
+        ho = Fe();
     ve("date,datetime-local,month,time,week".split(","), function(e) {
-        fo[e] = !0
+        ho[e] = !0
     });
-    var ho = {
+    var po = {
         text: function(e, t, n, r, i, o) {
-            mo(e, t, n, r, i, o), po(r)
+            go(e, t, n, r, i, o), mo(r)
         },
-        date: vo("date", oo, go(oo, ["yyyy", "MM", "dd"]), "yyyy-MM-dd"),
-        "datetime-local": vo("datetimelocal", ao, go(ao, ["yyyy", "MM", "dd", "HH", "mm", "ss", "sss"]), "yyyy-MM-ddTHH:mm:ss.sss"),
-        time: vo("time", co, go(co, ["HH", "mm", "ss", "sss"]), "HH:mm:ss.sss"),
-        week: vo("week", so, function(e, t) {
+        date: bo("date", ao, vo(ao, ["yyyy", "MM", "dd"]), "yyyy-MM-dd"),
+        "datetime-local": bo("datetimelocal", so, vo(so, ["yyyy", "MM", "dd", "HH", "mm", "ss", "sss"]), "yyyy-MM-ddTHH:mm:ss.sss"),
+        time: bo("time", uo, vo(uo, ["HH", "mm", "ss", "sss"]), "HH:mm:ss.sss"),
+        week: bo("week", lo, function(e, t) {
             if (C(e)) return e;
             if (Ce(e)) {
-                so.lastIndex = 0;
-                var n = so.exec(e);
+                lo.lastIndex = 0;
+                var n = lo.exec(e);
                 if (n) {
                     var r = +n[1],
                         i = +n[2],
                         a = 0,
                         s = 0,
                         l = 0,
-                        c = Ai(r),
+                        c = Si(r),
                         u = 7 * (i - 1);
                     return t && (o = t.getHours(), a = t.getMinutes(), s = t.getSeconds(), l = t.getMilliseconds()), new Date(r, 0, c.getDate() + u, o, a, s, l)
                 }
             }
             return NaN
         }, "yyyy-Www"),
-        month: vo("month", lo, go(lo, ["yyyy", "MM"]), "yyyy-MM"),
-        number: function(e, t, n, r, i, o) {
-            var a, s;
-            bo(e, t, n, r, "number"), yo(r), mo(e, t, n, r, i, o), (D(n.min) || n.ngMin) && (r.$validators.min = function(e, t) {
-                return r.$isEmpty(t) || we(a) || a <= t
-            }, n.$observe("min", function(e) {
-                a = _o(e), r.$validate()
-            }));
-            (D(n.max) || n.ngMax) && (r.$validators.max = function(e, t) {
-                return r.$isEmpty(t) || we(s) || t <= s
-            }, n.$observe("max", function(e) {
-                s = _o(e), r.$validate()
-            }));
-            if (D(n.step) || n.ngStep) {
-                var l;
+        month: bo("month", co, vo(co, ["yyyy", "MM"]), "yyyy-MM"),
+        number: function(e, t, n, r, i, o, a, s) {
+            var l;
+            if (yo(e, t, n, r, "number"), _o(r), go(e, t, n, r, i, o), O(n.min) || n.ngMin) {
+                var c = n.min || s(n.ngMin)(e);
+                l = $o(c), r.$validators.min = function(e, t) {
+                    return r.$isEmpty(t) || we(l) || l <= t
+                }, n.$observe("min", function(e) {
+                    e !== c && (l = $o(e), c = e, r.$validate())
+                })
+            }
+            if (O(n.max) || n.ngMax) {
+                var u = n.max || s(n.ngMax)(e),
+                    d = $o(u);
+                r.$validators.max = function(e, t) {
+                    return r.$isEmpty(t) || we(d) || t <= d
+                }, n.$observe("max", function(e) {
+                    e !== u && (d = $o(e), u = e, r.$validate())
+                })
+            }
+            if (O(n.step) || n.ngStep) {
+                var f = n.step || s(n.ngStep)(e),
+                    h = $o(f);
                 r.$validators.step = function(e, t) {
-                    return r.$isEmpty(t) || we(l) || Eo(t, a || 0, l)
+                    return r.$isEmpty(t) || we(h) || Co(t, l || 0, h)
                 }, n.$observe("step", function(e) {
-                    l = _o(e), r.$validate()
+                    e !== f && (h = $o(e), f = e, r.$validate())
                 })
             }
         },
         url: function(e, t, n, r, i, o) {
-            mo(e, t, n, r, i, o), po(r), r.$validators.url = function(e, t) {
+            go(e, t, n, r, i, o), mo(r), r.$validators.url = function(e, t) {
                 var n = e || t;
-                return r.$isEmpty(n) || no.test(n)
+                return r.$isEmpty(n) || ro.test(n)
             }
         },
         email: function(e, t, n, r, i, o) {
-            mo(e, t, n, r, i, o), po(r), r.$validators.email = function(e, t) {
+            go(e, t, n, r, i, o), mo(r), r.$validators.email = function(e, t) {
                 var n = e || t;
-                return r.$isEmpty(n) || ro.test(n)
+                return r.$isEmpty(n) || io.test(n)
             }
         },
         radio: function(e, n, r, i) {
                 o && (e = Se(e)), n[0].checked = e === i.$viewValue
             }, r.$observe("value", i.$render)
         },
-        range: function(e, n, r, i, t, o) {
-            bo(e, n, r, i, "range"), yo(i), mo(e, n, r, i, t, o);
-            var a = i.$$hasNativeValidators && "range" === n[0].type,
+        range: function(e, r, i, n, t, o) {
+            yo(e, r, i, n, "range"), _o(n), go(e, r, i, n, t, o);
+            var a = n.$$hasNativeValidators && "range" === r[0].type,
                 s = a ? 0 : void 0,
                 l = a ? 100 : void 0,
                 c = a ? 1 : void 0,
-                u = n[0].validity,
-                d = D(r.min),
-                f = D(r.max),
-                h = D(r.step),
-                p = i.$render;
-            i.$render = a && D(u.rangeUnderflow) && D(u.rangeOverflow) ? function() {
-                p(), i.$setViewValue(n.val())
-            } : p, d && (i.$validators.min = a ? function() {
+                u = r[0].validity,
+                d = O(i.min),
+                f = O(i.max),
+                h = O(i.step),
+                p = n.$render;
+            n.$render = a && O(u.rangeUnderflow) && O(u.rangeOverflow) ? function() {
+                p(), n.$setViewValue(r.val())
+            } : p, d && (s = $o(i.min), n.$validators.min = a ? function() {
                 return !0
             } : function(e, t) {
-                return i.$isEmpty(t) || we(s) || s <= t
+                return n.$isEmpty(t) || we(s) || s <= t
             }, m("min", function(e) {
-                if (s = _o(e), S(i.$modelValue)) return;
+                if (s = $o(e), S(n.$modelValue)) return;
                 if (a) {
-                    var t = n.val();
-                    t < s && (t = s, n.val(t)), i.$setViewValue(t)
-                } else i.$validate()
+                    var t = r.val();
+                    t < s && (t = s, r.val(t)), n.$setViewValue(t)
+                } else n.$validate()
             }));
-            f && (i.$validators.max = a ? function() {
+            f && (l = $o(i.max), n.$validators.max = a ? function() {
                 return !0
             } : function(e, t) {
-                return i.$isEmpty(t) || we(l) || t <= l
+                return n.$isEmpty(t) || we(l) || t <= l
             }, m("max", function(e) {
-                if (l = _o(e), S(i.$modelValue)) return;
+                if (l = $o(e), S(n.$modelValue)) return;
                 if (a) {
-                    var t = n.val();
-                    l < t && (n.val(l), t = l < s ? s : l), i.$setViewValue(t)
-                } else i.$validate()
+                    var t = r.val();
+                    l < t && (r.val(l), t = l < s ? s : l), n.$setViewValue(t)
+                } else n.$validate()
             }));
-            h && (i.$validators.step = a ? function() {
+            h && (c = $o(i.step), n.$validators.step = a ? function() {
                 return !u.stepMismatch
             } : function(e, t) {
-                return i.$isEmpty(t) || we(c) || Eo(t, s || 0, c)
+                return n.$isEmpty(t) || we(c) || Co(t, s || 0, c)
             }, m("step", function(e) {
-                if (c = _o(e), S(i.$modelValue)) return;
-                a && i.$viewValue !== n.val() ? i.$setViewValue(n.val()) : i.$validate()
+                if (c = $o(e), S(n.$modelValue)) return;
+                a ? n.$viewValue !== r.val() && n.$setViewValue(r.val()) : n.$validate()
             }));
 
             function m(e, t) {
-                n.attr(e, r[e]), r.$observe(e, t)
+                r.attr(e, i[e]);
+                var n = i[e];
+                i.$observe(e, function(e) {
+                    e !== n && t(n = e)
+                })
             }
         },
         checkbox: function(e, t, n, r, i, o, a, s) {
-            var l = Co(s, e, "ngTrueValue", n.ngTrueValue, !0),
-                c = Co(s, e, "ngFalseValue", n.ngFalseValue, !1);
+            var l = ko(s, e, "ngTrueValue", n.ngTrueValue, !0),
+                c = ko(s, e, "ngFalseValue", n.ngFalseValue, !1);
             t.on("change", function(e) {
                 r.$setViewValue(t[0].checked, e && e.type)
             }), r.$render = function() {
         file: _e
     };
 
-    function po(t) {
+    function mo(t) {
         t.$formatters.push(function(e) {
             return t.$isEmpty(e) ? e : e.toString()
         })
     }
 
-    function mo(e, r, i, o, t, a) {
+    function go(e, r, i, o, t, a) {
         var s, l = me(r[0].type);
         if (!t.android) {
             var c = !1;
                 91 === t || 15 < t && t < 19 || 37 <= t && t <= 40 || n(e, this, this.value)
             }), t.hasEvent("paste") && r.on("paste cut drop", n)
         }
-        r.on("change", u), fo[l] && o.$$hasNativeValidators && l === i.type && r.on(uo, function(e) {
+        r.on("change", u), ho[l] && o.$$hasNativeValidators && l === i.type && r.on(fo, function(e) {
             if (!s) {
                 var t = this[d],
                     n = t.badInput,
         }
     }
 
-    function go(o, a) {
+    function vo(o, a) {
         return function(e, t) {
             var n, r;
             if (C(e)) return e;
             if (Ce(e)) {
-                if ('"' === e.charAt(0) && '"' === e.charAt(e.length - 1) && (e = e.substring(1, e.length - 1)), to.test(e)) return new Date(e);
+                if ('"' === e.charAt(0) && '"' === e.charAt(e.length - 1) && (e = e.substring(1, e.length - 1)), no.test(e)) return new Date(e);
                 if (o.lastIndex = 0, n = o.exec(e)) {
                     n.shift(), r = t ? {
                         yyyy: t.getFullYear(),
         }
     }
 
-    function vo(m, g, v, b) {
-        return function(e, t, n, i, r, o, a) {
-            bo(e, t, n, i, m), mo(0, t, n, i, r, o);
-            var s, l, c, u, d = "time" === m || "datetimelocal" === m;
-            (i.$parsers.push(function(e) {
-                return i.$isEmpty(e) ? null : g.test(e) ? p(e, s) : void(i.$$parserName = m)
-            }), i.$formatters.push(function(e) {
-                if (e && !C(e)) throw ea("datefmt", "Expected `{0}` to be a date", e);
-                if (f(e)) {
-                    s = e;
-                    var t = i.$options.getOption("timezone");
-                    return t && (s = G(s, l = t, !0)),
-                        function(e, t) {
-                            var n = b;
-                            d && Ce(i.$options.getOption("timeSecondsFormat")) && (n = b.replace("ss.sss", i.$options.getOption("timeSecondsFormat")).replace(/:$/, ""));
-                            var r = a("date")(e, n, t);
-                            d && i.$options.getOption("timeStripZeroSeconds") && (r = r.replace(/(?::00)?(?:\.000)?$/, ""));
-                            return r
-                        }(e, t)
-                }
-                return l = s = null, ""
-            }), D(n.min) || n.ngMin) && (i.$validators.min = function(e) {
-                return !f(e) || we(c) || v(e) >= c
-            }, n.$observe("min", function(e) {
-                c = h(e), i.$validate()
-            }));
-            (D(n.max) || n.ngMax) && (i.$validators.max = function(e) {
-                return !f(e) || we(u) || v(e) <= u
-            }, n.$observe("max", function(e) {
-                u = h(e), i.$validate()
-            }));
+    function bo(b, y, _, $) {
+        return function(e, t, n, i, r, o, a, s) {
+            yo(e, t, n, i, b), go(0, t, n, i, r, o);
+            var l, c, u = "time" === b || "datetimelocal" === b;
+            if (i.$parsers.push(function(e) {
+                    return i.$isEmpty(e) ? null : y.test(e) ? v(e, l) : void(i.$$parserName = b)
+                }), i.$formatters.push(function(e) {
+                    if (e && !C(e)) throw na("datefmt", "Expected `{0}` to be a date", e);
+                    if (m(e)) {
+                        l = e;
+                        var t = i.$options.getOption("timezone");
+                        return t && (l = G(l, c = t, !0)),
+                            function(e, t) {
+                                var n = $;
+                                u && Ce(i.$options.getOption("timeSecondsFormat")) && (n = $.replace("ss.sss", i.$options.getOption("timeSecondsFormat")).replace(/:$/, ""));
+                                var r = a("date")(e, n, t);
+                                u && i.$options.getOption("timeStripZeroSeconds") && (r = r.replace(/(?::00)?(?:\.000)?$/, ""));
+                                return r
+                            }(e, t)
+                    }
+                    return c = l = null, ""
+                }), O(n.min) || n.ngMin) {
+                var d = n.min || s(n.ngMin)(e),
+                    f = g(d);
+                i.$validators.min = function(e) {
+                    return !m(e) || we(f) || _(e) >= f
+                }, n.$observe("min", function(e) {
+                    e !== d && (f = g(e), d = e, i.$validate())
+                })
+            }
+            if (O(n.max) || n.ngMax) {
+                var h = n.max || s(n.ngMax)(e),
+                    p = g(h);
+                i.$validators.max = function(e) {
+                    return !m(e) || we(p) || _(e) <= p
+                }, n.$observe("max", function(e) {
+                    e !== h && (p = g(e), h = e, i.$validate())
+                })
+            }
 
-            function f(e) {
+            function m(e) {
                 return e && !(e.getTime && e.getTime() != e.getTime())
             }
 
-            function h(e) {
-                return D(e) && !C(e) ? p(e) || void 0 : e
+            function g(e) {
+                return O(e) && !C(e) ? v(e) || void 0 : e
             }
 
-            function p(e, t) {
+            function v(e, t) {
                 var n = i.$options.getOption("timezone");
-                l && l !== n && (t = Y(t, W(l)));
-                var r = v(e, t);
+                c && c !== n && (t = Y(t, W(c)));
+                var r = _(e, t);
                 return !isNaN(r) && n && (r = G(r, n)), r
             }
         }
     }
 
-    function bo(e, n, t, r, i) {
+    function yo(e, n, t, r, i) {
         var o = n[0];
         (r.$$hasNativeValidators = Ee(o.validity)) && r.$parsers.push(function(e) {
             var t = n.prop(d) || {};
         })
     }
 
-    function yo(t) {
+    function _o(t) {
         t.$parsers.push(function(e) {
-            return t.$isEmpty(e) ? null : io.test(e) ? parseFloat(e) : void(t.$$parserName = "number")
+            return t.$isEmpty(e) ? null : oo.test(e) ? parseFloat(e) : void(t.$$parserName = "number")
         }), t.$formatters.push(function(e) {
             if (!t.$isEmpty(e)) {
-                if (!E(e)) throw ea("numfmt", "Expected `{0}` to be a number", e);
+                if (!E(e)) throw na("numfmt", "Expected `{0}` to be a number", e);
                 e = e.toString()
             }
             return e
         })
     }
 
-    function _o(e) {
-        return D(e) && !E(e) && (e = parseFloat(e)), S(e) ? void 0 : e
+    function $o(e) {
+        return O(e) && !E(e) && (e = parseFloat(e)), S(e) ? void 0 : e
     }
 
-    function $o(e) {
+    function wo(e) {
         return (0 | e) === e
     }
 
-    function wo(e) {
+    function Eo(e) {
         var t = e.toString(),
             n = t.indexOf(".");
         if (-1 !== n) return t.length - n - 1;
         return 0
     }
 
-    function Eo(e, t, n) {
+    function Co(e, t, n) {
         var r = Number(e),
-            i = !$o(r),
-            o = !$o(t),
-            a = !$o(n);
+            i = !wo(r),
+            o = !wo(t),
+            a = !wo(n);
         if (i || o || a) {
-            var s = i ? wo(r) : 0,
-                l = o ? wo(t) : 0,
-                c = a ? wo(n) : 0,
+            var s = i ? Eo(r) : 0,
+                l = o ? Eo(t) : 0,
+                c = a ? Eo(n) : 0,
                 u = Math.max(s, l, c),
                 d = Math.pow(10, u);
             r *= d, t *= d, n *= d, i && (r = Math.round(r)), o && (t = Math.round(t)), a && (n = Math.round(n))
         return (r - t) % n == 0
     }
 
-    function Co(e, t, n, r, i) {
+    function ko(e, t, n, r, i) {
         var o;
-        if (D(r)) {
-            if (!(o = e(r)).constant) throw ea("constexpr", "Expected constant expression for `{0}`, but saw `{1}`.", n, r);
+        if (O(r)) {
+            if (!(o = e(r)).constant) throw na("constexpr", "Expected constant expression for `{0}`, but saw `{1}`.", n, r);
             return o(t)
         }
         return i
     }
-    var ko = ["$browser", "$sniffer", "$filter", "$parse", function(i, o, a, s) {
+    var xo = ["$browser", "$sniffer", "$filter", "$parse", function(i, o, a, s) {
             return {
                 restrict: "E",
                 require: ["?ngModel"],
                 link: {
                     pre: function(e, t, n, r) {
-                        r[0] && (ho[me(n.type)] || ho.text)(e, t, n, r[0], o, i, a, s)
+                        r[0] && (po[me(n.type)] || po.text)(e, t, n, r[0], o, i, a, s)
                     }
                 }
             }
         }],
-        xo = /^(true|false|\d+)$/,
         To = function() {
+            var o = {
+                configurable: !0,
+                enumerable: !1,
+                get: function() {
+                    return this.getAttribute("value") || ""
+                },
+                set: function(e) {
+                    this.setAttribute("value", e)
+                }
+            };
+            return {
+                restrict: "E",
+                priority: 200,
+                compile: function(e, t) {
+                    if ("hidden" === me(t.type)) return {
+                        pre: function(e, t, n, r) {
+                            var i = t[0];
+                            i.parentNode && i.parentNode.insertBefore(i, i.nextSibling), Object.defineProperty && Object.defineProperty(i, "value", o)
+                        }
+                    }
+                }
+            }
+        },
+        Mo = /^(true|false|\d+)$/,
+        Ao = function() {
             function r(e, t, n) {
-                var r = D(n) ? n : 9 === fe ? "" : null;
+                var r = O(n) ? n : 9 === fe ? "" : null;
                 e.prop("value", r), t.$set("value", n)
             }
             return {
                 restrict: "A",
                 priority: 100,
                 compile: function(e, t) {
-                    return xo.test(t.ngValue) ? function(e, t, n) {
+                    return Mo.test(t.ngValue) ? function(e, t, n) {
                         r(t, n, e.$eval(n.ngValue))
                     } : function(e, t, n) {
                         e.$watch(n.ngValue, function(e) {
                 }
             }
         },
-        Mo = ["$compile", function(r) {
+        So = ["$compile", function(r) {
             return {
                 restrict: "AC",
                 compile: function(e) {
                 }
             }
         }],
-        Ao = ["$interpolate", "$compile", function(i, o) {
+        Do = ["$interpolate", "$compile", function(i, o) {
             return {
                 compile: function(e) {
                     return o.$$addBindingClass(e),
                 }
             }
         }],
-        So = ["$sce", "$parse", "$compile", function(o, n, a) {
+        Oo = ["$sce", "$parse", "$compile", function(o, n, a) {
             return {
                 restrict: "A",
                 compile: function(e, t) {
                 }
             }
         }],
-        Oo = O({
+        No = D({
             restrict: "A",
             require: "ngModel",
             link: function(e, t, n, r) {
             }
         });
 
-    function Do(i, f) {
+    function Io(i, f) {
         var o;
         return i = "ngClass" + i, ["$parse", function(n) {
             return {
             }).join(" ") : Ce(t) || (e = t + ""), e
         }
     }
-    var No = Do("", !0),
-        Io = Do("Odd", 0),
-        Ro = Do("Even", 1),
-        Po = Ui({
+    var Ro = Io("", !0),
+        Po = Io("Odd", 0),
+        Ho = Io("Even", 1),
+        jo = Vi({
             compile: function(e, t) {
                 t.$set("ngCloak", void 0), e.removeClass("ng-cloak")
             }
         }),
-        Ho = [function() {
+        Lo = [function() {
             return {
                 restrict: "A",
                 scope: !0,
                 priority: 500
             }
         }],
-        jo = {},
-        Lo = {
+        Fo = {},
+        qo = {
             blur: !0,
             focus: !0
         };
 
-    function Fo(n, i, o, a, s, l) {
+    function Uo(n, i, o, a, s, l) {
         return {
             restrict: "A",
             compile: function(e, t) {
     }
     ve("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), function(r) {
         var i = $n("ng-" + r);
-        jo[i] = ["$parse", "$rootScope", "$exceptionHandler", function(e, t, n) {
-            return Fo(e, t, n, i, r, Lo[r])
+        Fo[i] = ["$parse", "$rootScope", "$exceptionHandler", function(e, t, n) {
+            return Uo(e, t, n, i, r, qo[r])
         }]
     });
-    var qo = ["$animate", "$compile", function(l, c) {
+    var Vo = ["$animate", "$compile", function(l, c) {
             return {
                 multiElement: !0,
                 transclude: "element",
                 }
             }
         }],
-        Uo = ["$templateRequest", "$anchorScroll", "$animate", function(g, v, b) {
+        Bo = ["$templateRequest", "$anchorScroll", "$animate", function(g, v, b) {
             return {
                 restrict: "ECA",
                 priority: 400,
                             };
                         a.$watch(n, function(r) {
                             var i = function(e) {
-                                    !1 === e || !D(m) || m && !a.$eval(m) || v()
+                                    !1 === e || !O(m) || m && !a.$eval(m) || v()
                                 },
                                 o = ++f;
                             r ? (g(r, !0).then(function(e) {
                 }
             }
         }],
-        Vo = ["$compile", function(i) {
+        zo = ["$compile", function(i) {
             return {
                 restrict: "ECA",
                 priority: -400,
                 }
             }
         }],
-        zo = Ui({
+        Wo = Vi({
             priority: 450,
             compile: function() {
                 return {
                 }
             }
         }),
-        Bo = function() {
+        Yo = function() {
             return {
                 restrict: "A",
                 priority: 100,
                 }
             }
         },
-        Wo = "ng-valid",
-        Yo = "ng-invalid",
-        Go = "ng-pristine",
-        Ko = "ng-dirty",
-        Zo = "ng-untouched",
-        Xo = "ng-touched",
-        Qo = "ng-empty",
-        Jo = "ng-not-empty",
-        ea = M("ngModel");
-
-    function ta(e, t, n, r, i, o, a, s, l) {
+        Go = "ng-valid",
+        Ko = "ng-invalid",
+        Zo = "ng-pristine",
+        Xo = "ng-dirty",
+        Qo = "ng-untouched",
+        Jo = "ng-touched",
+        ea = "ng-empty",
+        ta = "ng-not-empty",
+        na = M("ngModel");
+
+    function ra(e, t, n, r, i, o, a, s, l) {
         var c;
-        this.$viewValue = Number.NaN, this.$modelValue = Number.NaN, this.$$rawModelValue = void 0, this.$validators = {}, this.$asyncValidators = {}, this.$parsers = [], this.$formatters = [], this.$viewChangeListeners = [], this.$untouched = !0, this.$touched = !1, this.$pristine = !0, this.$dirty = !1, this.$valid = !0, this.$invalid = !1, this.$error = {}, this.$$success = {}, this.$pending = void 0, this.$name = l(n.name || "", !1)(e), this.$$parentForm = Bi, this.$options = na, this.$$updateEvents = "", this.$$updateEventHandler = this.$$updateEventHandler.bind(this), this.$$parsedNgModel = i(n.ngModel), this.$$parsedNgModelAssign = this.$$parsedNgModel.assign, this.$$ngModelGet = this.$$parsedNgModel, this.$$ngModelSet = this.$$parsedNgModelAssign, this.$$pendingDebounce = null, this.$$parserValid = void 0, this.$$parserName = "parse", this.$$currentValidationRunId = 0, this.$$scope = e, this.$$rootScope = e.$root, this.$$attr = n, this.$$element = r, this.$$animate = o, this.$$timeout = a, this.$$parse = i, this.$$q = s, this.$$exceptionHandler = t, Qi(this), (c = this).$$scope.$watch(function(e) {
+        this.$viewValue = Number.NaN, this.$modelValue = Number.NaN, this.$$rawModelValue = void 0, this.$validators = {}, this.$asyncValidators = {}, this.$parsers = [], this.$formatters = [], this.$viewChangeListeners = [], this.$untouched = !0, this.$touched = !1, this.$pristine = !0, this.$dirty = !1, this.$valid = !0, this.$invalid = !1, this.$error = {}, this.$$success = {}, this.$pending = void 0, this.$name = l(n.name || "", !1)(e), this.$$parentForm = Wi, this.$options = ia, this.$$updateEvents = "", this.$$updateEventHandler = this.$$updateEventHandler.bind(this), this.$$parsedNgModel = i(n.ngModel), this.$$parsedNgModelAssign = this.$$parsedNgModel.assign, this.$$ngModelGet = this.$$parsedNgModel, this.$$ngModelSet = this.$$parsedNgModelAssign, this.$$pendingDebounce = null, this.$$parserValid = void 0, this.$$parserName = "parse", this.$$currentValidationRunId = 0, this.$$scope = e, this.$$rootScope = e.$root, this.$$attr = n, this.$$element = r, this.$$animate = o, this.$$timeout = a, this.$$parse = i, this.$$q = s, this.$$exceptionHandler = t, Ji(this), (c = this).$$scope.$watch(function(e) {
             var t = c.$$ngModelGet(e);
             return t === c.$modelValue || c.$modelValue != c.$modelValue && t != t || c.$$setModelValue(t), t
         })
     }
-    ta.$inject = ["$scope", "$exceptionHandler", "$attrs", "$element", "$parse", "$animate", "$timeout", "$q", "$interpolate"], ta.prototype = {
+    ra.$inject = ["$scope", "$exceptionHandler", "$attrs", "$element", "$parse", "$animate", "$timeout", "$q", "$interpolate"], ra.prototype = {
         $$initGetterSetters: function() {
             if (this.$options.getOption("getterSetter")) {
                 var n = this.$$parse(this.$$attr.ngModel + "()"),
                         $$$p: t
                     }) : this.$$parsedNgModelAssign(e, t)
                 }
-            } else if (!this.$$parsedNgModel.assign) throw ea("nonassign", "Expression '{0}' is non-assignable. Element: {1}", this.$$attr.ngModel, He(this.$$element))
+            } else if (!this.$$parsedNgModel.assign) throw na("nonassign", "Expression '{0}' is non-assignable. Element: {1}", this.$$attr.ngModel, He(this.$$element))
         },
         $render: _e,
         $isEmpty: function(e) {
             return we(e) || "" === e || null === e || e != e
         },
         $$updateEmptyClasses: function(e) {
-            this.$isEmpty(e) ? (this.$$animate.removeClass(this.$$element, Jo), this.$$animate.addClass(this.$$element, Qo)) : (this.$$animate.removeClass(this.$$element, Qo), this.$$animate.addClass(this.$$element, Jo))
+            this.$isEmpty(e) ? (this.$$animate.removeClass(this.$$element, ta), this.$$animate.addClass(this.$$element, ea)) : (this.$$animate.removeClass(this.$$element, ea), this.$$animate.addClass(this.$$element, ta))
         },
         $setPristine: function() {
-            this.$dirty = !1, this.$pristine = !0, this.$$animate.removeClass(this.$$element, Ko), this.$$animate.addClass(this.$$element, Go)
+            this.$dirty = !1, this.$pristine = !0, this.$$animate.removeClass(this.$$element, Xo), this.$$animate.addClass(this.$$element, Zo)
         },
         $setDirty: function() {
-            this.$dirty = !0, this.$pristine = !1, this.$$animate.removeClass(this.$$element, Go), this.$$animate.addClass(this.$$element, Ko), this.$$parentForm.$setDirty()
+            this.$dirty = !0, this.$pristine = !1, this.$$animate.removeClass(this.$$element, Zo), this.$$animate.addClass(this.$$element, Xo), this.$$parentForm.$setDirty()
         },
         $setUntouched: function() {
-            this.$touched = !1, this.$untouched = !0, this.$$animate.setClass(this.$$element, Zo, Xo)
+            this.$touched = !1, this.$untouched = !0, this.$$animate.setClass(this.$$element, Qo, Jo)
         },
         $setTouched: function() {
-            this.$touched = !0, this.$untouched = !1, this.$$animate.setClass(this.$$element, Xo, Zo)
+            this.$touched = !0, this.$untouched = !1, this.$$animate.setClass(this.$$element, Jo, Qo)
         },
         $rollbackViewValue: function() {
             this.$$timeout.cancel(this.$$pendingDebounce), this.$viewValue = this.$$lastCommittedViewValue, this.$render()
                 c(t, null)
             }), 0) ? (a = [], s = !0, ve(l.$asyncValidators, function(e, t) {
                 var n = e(r, i);
-                if (!T(n)) throw ea("nopromise", "Expected asynchronous validator to return a promise but got '{0}' instead.", n);
+                if (!T(n)) throw na("nopromise", "Expected asynchronous validator to return a promise but got '{0}' instead.", n);
                 c(t, void 0), a.push(n.then(function() {
                     c(t, !0)
                 }, function() {
         $$updateEventHandler: function(e) {
             this.$$debounceViewValueCommit(e && e.type)
         }
-    }, Ji({
-        clazz: ta,
+    }, eo({
+        clazz: ra,
         set: function(e, t) {
             e[t] = !0
         },
             delete e[t]
         }
     });
-    var na, ra = ["$rootScope", function(a) {
+    var ia, oa = ["$rootScope", function(a) {
             return {
                 restrict: "A",
                 require: ["ngModel", "^?form", "^?ngModelOptions"],
-                controller: ta,
+                controller: ra,
                 priority: 1,
                 compile: function(e) {
-                    return e.addClass(Go).addClass(Zo).addClass(Wo), {
+                    return e.addClass(Zo).addClass(Qo).addClass(Go), {
                         pre: function(e, t, n, r) {
                             var i = r[0],
                                 o = r[1] || i.$$parentForm,
                 }
             }
         }],
-        ia = /(\s+|^)default(\s+|$)/;
+        aa = /(\s+|^)default(\s+|$)/;
 
-    function oa(e) {
+    function sa(e) {
         this.$$options = e
     }
-    oa.prototype = {
+    sa.prototype = {
         getOption: function(e) {
             return this.$$options[e]
         },
         createChild: function(n) {
             var r = !1;
             return ve(n = be({}, n), function(e, t) {
-                "$inherit" === e ? "*" === t ? r = !0 : (n[t] = this.$$options[t], "updateOn" === t && (n.updateOnDefault = this.$$options.updateOnDefault)) : "updateOn" === t && (n.updateOnDefault = !1, n[t] = Se(e.replace(ia, function() {
+                "$inherit" === e ? "*" === t ? r = !0 : (n[t] = this.$$options[t], "updateOn" === t && (n.updateOnDefault = this.$$options.updateOnDefault)) : "updateOn" === t && (n.updateOnDefault = !1, n[t] = Se(e.replace(aa, function() {
                     return n.updateOnDefault = !0, " "
                 })))
-            }, this), r && (delete n["*"], sa(n, this.$$options)), sa(n, na.$$options), new oa(n)
+            }, this), r && (delete n["*"], ca(n, this.$$options)), ca(n, ia.$$options), new sa(n)
         }
-    }, na = new oa({
+    }, ia = new sa({
         updateOn: "",
         updateOnDefault: !0,
         debounce: 0,
         allowInvalid: !1,
         timezone: null
     });
-    var aa = function() {
+    var la = function() {
         function e(e, t) {
             this.$$attrs = e, this.$$scope = t
         }
         return e.$inject = ["$attrs", "$scope"], e.prototype = {
             $onInit: function() {
-                var e = this.parentCtrl ? this.parentCtrl.$options : na,
+                var e = this.parentCtrl ? this.parentCtrl.$options : ia,
                     t = this.$$scope.$eval(this.$$attrs.ngModelOptions);
                 this.$options = e.createChild(t)
             }
         }
     };
 
-    function sa(n, e) {
+    function ca(n, e) {
         ve(e, function(e, t) {
-            D(n[t]) || (n[t] = e)
+            O(n[t]) || (n[t] = e)
         })
     }
-    var la = Ui({
+    var ua = Vi({
             terminal: !0,
             priority: 1e3
         }),
-        ca = M("ngOptions"),
-        ua = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
-        da = ["$compile", "$document", "$parse", function(g, v, C) {
+        da = M("ngOptions"),
+        fa = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([$\w][$\w]*)|(?:\(\s*([$\w][$\w]*)\s*,\s*([$\w][$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
+        ha = ["$compile", "$document", "$parse", function(g, v, C) {
             var b = de.document.createElement("option"),
                 y = de.document.createElement("optgroup");
             return {
                         var u, d = !!s.emptyOption;
                         he(b.cloneNode(!1)).val("?");
                         var f = function(e, t, f) {
-                                var d = e.match(ua);
-                                if (!d) throw ca("iexp", "Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}", e, He(t));
+                                var d = e.match(fa);
+                                if (!d) throw da("iexp", "Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}", e, He(t));
                                 var n = d[5] || d[7],
                                     r = d[6],
                                     i = / as /.test(d[0]) && d[1],
 
                                 function E(e) {
                                     var t;
-                                    if (!r && I(e)) t = e;
+                                    if (!r && R(e)) t = e;
                                     else
                                         for (var n in t = [], e) e.hasOwnProperty(n) && "$" !== n.charAt(0) && t.push(n);
                                     return t
                             if (u)
                                 for (var t = u.items.length - 1; 0 <= t; t--) {
                                     var n = u.items[t];
-                                    D(n.group) ? Mt(n.element.parentNode) : Mt(n.element)
+                                    O(n.group) ? Mt(n.element.parentNode) : Mt(n.element)
                                 }
                             u = f.getOptions();
                             var r = {};
                             if (u.items.forEach(function(e) {
                                     var t;
-                                    D(e.group) ? ((t = r[e.group]) || (t = y.cloneNode(!1), h.appendChild(t), t.label = null === e.group ? "null" : e.group, r[e.group] = t), p(e, t)) : p(e, h)
+                                    O(e.group) ? ((t = r[e.group]) || (t = y.cloneNode(!1), h.appendChild(t), t.label = null === e.group ? "null" : e.group, r[e.group] = t), p(e, t)) : p(e, h)
                                 }), a[0].appendChild(h), l.$render(), !l.$isEmpty(e)) {
                                 var i = s.readValue(),
                                     o = f.trackBy || c;
                 }
             }
         }],
-        fa = ["$locale", "$interpolate", "$log", function(p, m, g) {
+        pa = ["$locale", "$interpolate", "$log", function(p, m, g) {
             var v = /{}/g,
                 b = /^when(Minus)?(.+)$/;
             return {
                 }
             }
         }],
-        ha = M("ngRef"),
-        pa = ["$parse", function(t) {
+        ma = M("ngRef"),
+        ga = ["$parse", function(t) {
             return {
                 priority: -1,
                 restrict: "A",
                 compile: function(e, i) {
-                    var o = $n(Oe(e)),
+                    var o = $n(De(e)),
                         a = t(i.ngRef),
                         s = a.assign || function() {
-                            throw ha("nonassign", 'Expression in ngRef="{0}" is non-assignable!', i.ngRef)
+                            throw ma("nonassign", 'Expression in ngRef="{0}" is non-assignable!', i.ngRef)
                         };
                     return function(e, t, n) {
                         var r;
                         if (n.hasOwnProperty("ngRefRead")) {
                             if ("$element" === n.ngRefRead) r = t;
-                            else if (!(r = t.data("$" + n.ngRefRead + "Controller"))) throw ha("noctrl", 'The controller for ngRefRead="{0}" could not be found on ngRef="{1}"', n.ngRefRead, i.ngRef)
+                            else if (!(r = t.data("$" + n.ngRefRead + "Controller"))) throw ma("noctrl", 'The controller for ngRefRead="{0}" could not be found on ngRef="{1}"', n.ngRefRead, i.ngRef)
                         } else r = t.data("$" + o + "Controller");
                         s(e, r = r || t), t.on("$destroy", function() {
                             a(e) === r && s(e, null)
                 }
             }
         }],
-        ma = ["$parse", "$animate", "$compile", function(l, S, c) {
-            var O = "$$NG_REMOVED",
+        va = ["$parse", "$animate", "$compile", function(s, A, l) {
+            var S = "$$NG_REMOVED",
                 D = M("ngRepeat"),
-                N = function(e, t, n, r, i, o, a) {
+                O = function(e, t, n, r, i, o, a) {
                     e[n] = r, i && (e[i] = o), e.$index = t, e.$first = 0 === t, e.$last = t === a - 1, e.$middle = !(e.$first || e.$last), e.$odd = !(e.$even = 0 == (1 & t))
+                },
+                N = function(e, t, n) {
+                    return jt(n)
+                },
+                I = function(e, t) {
+                    return t
                 };
             return {
                 restrict: "A",
                 $$tlb: !0,
                 compile: function(e, t) {
                     var w = t.ngRepeat,
-                        E = c.$$createComment("end ngRepeat", w),
+                        E = l.$$createComment("end ngRepeat", w),
                         n = w.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
                     if (!n) throw D("iexp", "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.", w);
                     var r = n[1],
                         C = n[3],
                         o = n[4];
                     if (!(n = r.match(/^(?:(\s*[$\w]+)|\(\s*([$\w]+)\s*,\s*([$\w]+)\s*\))$/))) throw D("iidexp", "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.", r);
-                    var a, k, x, T, M = n[3] || n[1],
-                        A = n[2];
+                    var k, x = n[3] || n[1],
+                        T = n[2];
                     if (C && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(C) || /^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(C))) throw D("badident", "alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.", C);
-                    var s = {
-                        $id: jt
-                    };
-                    return o ? a = l(o) : (x = function(e, t) {
-                            return jt(t)
-                        }, T = function(e) {
-                            return e
-                        }),
-                        function(b, y, e, t, _) {
-                            a && (k = function(e, t, n) {
-                                return A && (s[A] = e), s[M] = t, s.$index = n, a(b, s)
-                            });
-                            var $ = Fe();
-                            b.$watchCollection(i, function(e) {
-                                var r, t, n, i, o, a, s, l, c, u, d, f, h, p = y[0],
-                                    m = Fe();
-                                if (C && (b[C] = e), I(e)) c = e, l = k || x;
-                                else
-                                    for (var g in l = k || T, c = [], e) pe.call(e, g) && "$" !== g.charAt(0) && c.push(g);
-                                for (i = c.length, d = new Array(i), r = 0; r < i; r++)
-                                    if (o = e === c ? r : c[r], a = e[o], s = l(o, a, r), $[s]) u = $[s], delete $[s], m[s] = u, d[r] = u;
-                                    else {
-                                        if (m[s]) throw ve(d, function(e) {
-                                            e && e.scope && ($[e.id] = e)
-                                        }), D("dupes", "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}", w, s, a);
-                                        d[r] = {
-                                            id: s,
-                                            scope: void 0,
-                                            clone: void 0
-                                        }, m[s] = !0
-                                    } for (var v in $) {
-                                    if (f = ce((u = $[v]).clone), S.leave(f), f[0].parentNode)
-                                        for (r = 0, t = f.length; r < t; r++) f[r][O] = !0;
-                                    u.scope.$destroy()
-                                }
-                                for (r = 0; r < i; r++)
-                                    if (o = e === c ? r : c[r], a = e[o], (u = d[r]).scope) {
-                                        for (n = p;
-                                            (n = n.nextSibling) && n[O];);
-                                        u.clone[0] !== n && S.move(ce(u.clone), null, p), p = (h = u).clone[h.clone.length - 1], N(u.scope, r, M, a, A, o, i)
-                                    } else _(function(e, t) {
-                                        u.scope = t;
-                                        var n = E.cloneNode(!1);
-                                        e[e.length++] = n, S.enter(e, null, p), p = n, u.clone = e, m[u.id] = u, N(u.scope, r, M, a, A, o, i)
-                                    });
-                                $ = m
-                            })
-                        }
+                    if (o) {
+                        var M = {
+                                $id: jt
+                            },
+                            a = s(o);
+                        k = function(e, t, n, r) {
+                            return T && (M[T] = t), M[x] = n, M.$index = r, a(e, M)
+                        }
+                    }
+                    return function(b, y, e, t, _) {
+                        var $ = Fe();
+                        b.$watchCollection(i, function(e) {
+                            var r, t, n, i, o, a, s, l, c, u, d, f, h, p = y[0],
+                                m = Fe();
+                            if (C && (b[C] = e), R(e)) c = e, l = k || N;
+                            else
+                                for (var g in l = k || I, c = [], e) pe.call(e, g) && "$" !== g.charAt(0) && c.push(g);
+                            for (i = c.length, d = new Array(i), r = 0; r < i; r++)
+                                if (o = e === c ? r : c[r], a = e[o], s = l(b, o, a, r), $[s]) u = $[s], delete $[s], m[s] = u, d[r] = u;
+                                else {
+                                    if (m[s]) throw ve(d, function(e) {
+                                        e && e.scope && ($[e.id] = e)
+                                    }), D("dupes", "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}", w, s, a);
+                                    d[r] = {
+                                        id: s,
+                                        scope: void 0,
+                                        clone: void 0
+                                    }, m[s] = !0
+                                } for (var v in M && (M[x] = void 0), $) {
+                                if (f = ce((u = $[v]).clone), A.leave(f), f[0].parentNode)
+                                    for (r = 0, t = f.length; r < t; r++) f[r][S] = !0;
+                                u.scope.$destroy()
+                            }
+                            for (r = 0; r < i; r++)
+                                if (o = e === c ? r : c[r], a = e[o], (u = d[r]).scope) {
+                                    for (n = p;
+                                        (n = n.nextSibling) && n[S];);
+                                    u.clone[0] !== n && A.move(ce(u.clone), null, p), p = (h = u).clone[h.clone.length - 1], O(u.scope, r, x, a, T, o, i)
+                                } else _(function(e, t) {
+                                    u.scope = t;
+                                    var n = E.cloneNode(!1);
+                                    e[e.length++] = n, A.enter(e, null, p), p = n, u.clone = e, m[u.id] = u, O(u.scope, r, x, a, T, o, i)
+                                });
+                            $ = m
+                        })
+                    }
                 }
             }
         }],
-        ga = "ng-hide",
-        va = "ng-hide-animate",
-        ba = ["$animate", function(r) {
+        ba = "ng-hide",
+        ya = "ng-hide-animate",
+        _a = ["$animate", function(r) {
             return {
                 restrict: "A",
                 multiElement: !0,
                 link: function(e, t, n) {
                     e.$watch(n.ngShow, function(e) {
-                        r[e ? "removeClass" : "addClass"](t, ga, {
-                            tempClasses: va
+                        r[e ? "removeClass" : "addClass"](t, ba, {
+                            tempClasses: ya
                         })
                     })
                 }
             }
         }],
-        ya = ["$animate", function(r) {
+        $a = ["$animate", function(r) {
             return {
                 restrict: "A",
                 multiElement: !0,
                 link: function(e, t, n) {
                     e.$watch(n.ngHide, function(e) {
-                        r[e ? "addClass" : "removeClass"](t, ga, {
-                            tempClasses: va
+                        r[e ? "addClass" : "removeClass"](t, ba, {
+                            tempClasses: ya
                         })
                     })
                 }
             }
         }],
-        _a = Ui(function(e, n, t) {
-            e.$watchCollection(t.ngStyle, function(e, t) {
-                t && e !== t && ve(t, function(e, t) {
-                    n.css(t, "")
-                }), e && n.css(e)
+        wa = Vi(function(e, t, n) {
+            e.$watchCollection(n.ngStyle, function(n, e) {
+                e && n !== e && (n || (n = {}), ve(e, function(e, t) {
+                    null == n[t] && (n[t] = "")
+                })), n && t.css(n)
             })
         }),
-        $a = ["$animate", "$compile", function(u, d) {
+        Ea = ["$animate", "$compile", function(u, d) {
             return {
                 require: "ngSwitch",
                 controller: ["$scope", function() {
                 }
             }
         }],
-        wa = Ui({
+        Ca = Vi({
             transclude: "element",
             priority: 1200,
             require: "^ngSwitch",
                 })
             }
         }),
-        Ea = Ui({
+        ka = Vi({
             transclude: "element",
             priority: 1200,
             require: "^ngSwitch",
                 })
             }
         }),
-        Ca = M("ngTransclude"),
-        ka = ["$compile", function(t) {
+        xa = M("ngTransclude"),
+        Ta = ["$compile", function(t) {
             return {
                 restrict: "EAC",
                 compile: function(e) {
                     var s = t(e.contents());
                     return e.empty(),
                         function(e, n, t, r, i) {
-                            if (!i) throw Ca("orphan", "Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}", He(n));
+                            if (!i) throw xa("orphan", "Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}", He(n));
                             t.ngTransclude === t.$attr.ngTransclude && (t.ngTransclude = "");
                             var o = t.ngTransclude || t.ngTranscludeSlot;
 
                 }
             }
         }],
-        xa = ["$templateCache", function(i) {
+        Ma = ["$templateCache", function(i) {
             return {
                 restrict: "E",
                 terminal: !0,
                 }
             }
         }],
-        Ta = {
+        Aa = {
             $setViewValue: _e,
             $render: _e
         };
 
-    function Ma(e, t) {
+    function Sa(e, t) {
         e.prop("selected", t), e.attr("selected", t)
     }
-    var Aa = ["$element", "$scope", function(i, t) {
+    var Da = ["$element", "$scope", function(i, t) {
             var s = this,
                 r = new qt;
-            s.selectValueMap = {}, s.ngModelCtrl = Ta, s.multiple = !1, s.unknownOption = he(de.document.createElement("option")), s.hasEmptyOption = !1, s.emptyOption = void 0, s.renderUnknownOption = function(e) {
+            s.selectValueMap = {}, s.ngModelCtrl = Aa, s.multiple = !1, s.unknownOption = he(de.document.createElement("option")), s.hasEmptyOption = !1, s.emptyOption = void 0, s.renderUnknownOption = function(e) {
                 var t = s.generateUnknownOptionValue(e);
-                s.unknownOption.val(t), i.prepend(s.unknownOption), Ma(s.unknownOption, !0), i.val(t)
+                s.unknownOption.val(t), i.prepend(s.unknownOption), Sa(s.unknownOption, !0), i.val(t)
             }, s.updateUnknownOption = function(e) {
                 var t = s.generateUnknownOptionValue(e);
-                s.unknownOption.val(t), Ma(s.unknownOption, !0), i.val(t)
+                s.unknownOption.val(t), Sa(s.unknownOption, !0), i.val(t)
             }, s.generateUnknownOptionValue = function(e) {
                 return "? " + jt(e) + " ?"
             }, s.removeUnknownOption = function() {
                 s.unknownOption.parent() && s.unknownOption.remove()
             }, s.selectEmptyOption = function() {
-                s.emptyOption && (i.val(""), Ma(s.emptyOption, !0))
+                s.emptyOption && (i.val(""), Sa(s.emptyOption, !0))
             }, s.unselectEmptyOption = function() {
-                s.hasEmptyOption && Ma(s.emptyOption, !1)
+                s.hasEmptyOption && Sa(s.emptyOption, !1)
             }, t.$on("$destroy", function() {
                 s.renderUnknownOption = _e
             }), s.readValue = function() {
                 return s.hasOption(t) ? t : null
             }, s.writeValue = function(e) {
                 var t = i[0].options[i[0].selectedIndex];
-                if (t && Ma(he(t), !1), s.hasOption(e)) {
+                if (t && Sa(he(t), !1), s.hasOption(e)) {
                     s.removeUnknownOption();
                     var n = jt(e);
                     i.val(n in s.selectValueMap ? n : e);
                     var r = i[0].options[i[0].selectedIndex];
-                    Ma(he(r), !0)
+                    Sa(he(r), !0)
                 } else s.selectUnknownOrEmptyOption(e)
             }, s.addOption = function(e, t) {
                 if (t[0].nodeType !== Ve) {
                 var o, a;
                 i.$attr.ngValue ? i.$observe("value", function(e) {
                     var t, n = r.prop("selected");
-                    D(a) && (s.removeOption(o), delete s.selectValueMap[a], t = !0), a = jt(e), o = e, s.selectValueMap[a] = e, s.addOption(e, r), r.attr("value", a), t && n && c()
+                    O(a) && (s.removeOption(o), delete s.selectValueMap[a], t = !0), a = jt(e), o = e, s.selectValueMap[a] = e, s.addOption(e, r), r.attr("value", a), t && n && c()
                 }) : t ? i.$observe("value", function(e) {
                     var t;
                     s.readValue();
                     var n = r.prop("selected");
-                    D(o) && (s.removeOption(o), t = !0), o = e, s.addOption(e, r), t && n && c()
+                    O(o) && (s.removeOption(o), t = !0), o = e, s.addOption(e, r), t && n && c()
                 }) : n ? e.$watch(n, function(e, t) {
                     i.$set("value", e);
                     var n = r.prop("selected");
                 })
             }
         }],
-        Sa = function() {
+        Oa = function() {
             return {
                 restrict: "E",
                 require: ["select", "?ngModel"],
-                controller: Aa,
+                controller: Da,
                 priority: 1,
                 link: {
                     pre: function(e, t, n, r) {
                                 ve(t.find("option"), function(e) {
                                     var t = !!r && (H(r, e.value) || H(r, i.selectValueMap[e.value])),
                                         n = e.selected;
-                                    t !== n && Ma(he(e), t)
+                                    t !== n && Sa(he(e), t)
                                 })
                             };
                             var a, s = NaN;
                 }
             }
         },
-        Oa = ["$interpolate", function(n) {
+        Na = ["$interpolate", function(n) {
             return {
                 restrict: "E",
                 priority: 100,
                 compile: function(e, t) {
                     var a, s;
-                    return D(t.ngValue) || (D(t.value) ? a = n(t.value, !0) : (s = n(e.text(), !0)) || t.$set("value", e.text())),
+                    return O(t.ngValue) || (O(t.value) ? a = n(t.value, !0) : (s = n(e.text(), !0)) || t.$set("value", e.text())),
                         function(e, t, n) {
                             var r = "$selectController",
                                 i = t.parent(),
                 }
             }
         }],
-        Da = function() {
+        Ia = ["$parse", function(o) {
             return {
                 restrict: "A",
                 require: "?ngModel",
                 link: function(e, t, n, r) {
-                    r && (n.required = !0, r.$validators.required = function(e, t) {
-                        return !n.required || !r.$isEmpty(t)
-                    }, n.$observe("required", function() {
-                        r.$validate()
-                    }))
+                    if (r) {
+                        var i = n.hasOwnProperty("required") || o(n.ngRequired)(e);
+                        n.ngRequired || (n.required = !0), r.$validators.required = function(e, t) {
+                            return !i || !r.$isEmpty(t)
+                        }, n.$observe("required", function(e) {
+                            i !== e && (i = e, r.$validate())
+                        })
+                    }
                 }
             }
-        },
-        Na = function() {
+        }],
+        Ra = ["$parse", function(n) {
             return {
                 restrict: "A",
                 require: "?ngModel",
-                link: function(e, t, n, r) {
-                    if (r) {
-                        var i, o = n.ngPattern || n.pattern;
-                        n.$observe("pattern", function(e) {
-                            if (Ce(e) && 0 < e.length && (e = new RegExp("^" + e + "$")), e && !e.test) throw M("ngPattern")("noregexp", "Expected {0} to be a RegExp but was {1}. Element: {2}", o, e, He(t));
-                            i = e || void 0, r.$validate()
-                        }), r.$validators.pattern = function(e, t) {
-                            return r.$isEmpty(t) || we(i) || i.test(t)
+                compile: function(e, t) {
+                    var a, s;
+                    return t.ngPattern && (a = t.ngPattern, s = "/" === t.ngPattern.charAt(0) && o.test(t.ngPattern) ? function() {
+                            return t.ngPattern
+                        } : n(t.ngPattern)),
+                        function(e, n, t, r) {
+                            if (r) {
+                                var i = t.pattern;
+                                t.ngPattern ? i = s(e) : a = t.pattern;
+                                var o = ja(i, a, n);
+                                t.$observe("pattern", function(e) {
+                                    var t = o;
+                                    o = ja(e, a, n), (t && t.toString()) !== (o && o.toString()) && r.$validate()
+                                }), r.$validators.pattern = function(e, t) {
+                                    return r.$isEmpty(t) || we(o) || o.test(t)
+                                }
+                            }
                         }
-                    }
                 }
             }
-        },
-        Ia = function() {
+        }],
+        Pa = ["$parse", function(a) {
             return {
                 restrict: "A",
                 require: "?ngModel",
                 link: function(e, t, n, r) {
                     if (r) {
-                        var i = -1;
+                        var i = n.maxlength || a(n.ngMaxlength)(e),
+                            o = La(i);
                         n.$observe("maxlength", function(e) {
-                            var t = _(e);
-                            i = S(t) ? -1 : t, r.$validate()
+                            i !== e && (o = La(e), i = e, r.$validate())
                         }), r.$validators.maxlength = function(e, t) {
-                            return i < 0 || r.$isEmpty(t) || t.length <= i
+                            return o < 0 || r.$isEmpty(t) || t.length <= o
                         }
                     }
                 }
             }
-        },
-        Ra = function() {
+        }],
+        Ha = ["$parse", function(a) {
             return {
                 restrict: "A",
                 require: "?ngModel",
                 link: function(e, t, n, r) {
                     if (r) {
-                        var i = 0;
+                        var i = n.minlength || a(n.ngMinlength)(e),
+                            o = La(i) || -1;
                         n.$observe("minlength", function(e) {
-                            i = _(e) || 0, r.$validate()
+                            i !== e && (o = La(e) || -1, i = e, r.$validate())
                         }), r.$validators.minlength = function(e, t) {
-                            return r.$isEmpty(t) || t.length >= i
+                            return r.$isEmpty(t) || t.length >= o
                         }
                     }
                 }
             }
-        };
+        }];
+
+    function ja(e, t, n) {
+        if (e) {
+            if (Ce(e) && (e = new RegExp("^" + e + "$")), !e.test) throw M("ngPattern")("noregexp", "Expected {0} to be a RegExp but was {1}. Element: {2}", t, e, He(n));
+            return e
+        }
+    }
+
+    function La(e) {
+        var t = _(e);
+        return S(t) ? -1 : t
+    }
     de.angular.bootstrap ? de.console && console.log("WARNING: Tried to load AngularJS more than once.") : (! function() {
         var i;
         if (!ae) {
         noop: _e,
         bind: Pe,
         toJson: V,
-        fromJson: z,
+        fromJson: B,
         identity: $e,
         isUndefined: we,
-        isDefined: D,
+        isDefined: O,
         isString: Ce,
         isFunction: Te,
         isObject: Ee,
                             _configBlocks: e,
                             _runBlocks: t,
                             info: function(e) {
-                                if (D(e)) {
+                                if (O(e)) {
                                     if (!Ee(e)) throw f("aobj", "Argument '{0}' must be an object", "value");
                                     return u = e, this
                                 }
         e.provider({
             $$sanitizeUri: Wr
         }), e.provider("$compile", vn).directive({
-            a: Vi,
-            input: ko,
-            textarea: ko,
-            form: Zi,
-            script: xa,
-            select: Sa,
-            option: Oa,
-            ngBind: Mo,
-            ngBindHtml: So,
-            ngBindTemplate: Ao,
-            ngClass: No,
-            ngClassEven: Ro,
-            ngClassOdd: Io,
-            ngCloak: Po,
-            ngController: Ho,
-            ngForm: Xi,
-            ngHide: ya,
-            ngIf: qo,
-            ngInclude: Uo,
-            ngInit: zo,
-            ngNonBindable: la,
-            ngPluralize: fa,
-            ngRef: pa,
-            ngRepeat: ma,
-            ngShow: ba,
-            ngStyle: _a,
-            ngSwitch: $a,
-            ngSwitchWhen: wa,
-            ngSwitchDefault: Ea,
-            ngOptions: da,
-            ngTransclude: ka,
-            ngModel: ra,
-            ngList: Bo,
-            ngChange: Oo,
-            pattern: Na,
-            ngPattern: Na,
-            required: Da,
-            ngRequired: Da,
-            minlength: Ra,
-            ngMinlength: Ra,
-            maxlength: Ia,
-            ngMaxlength: Ia,
-            ngValue: To,
-            ngModelOptions: aa
+            a: Bi,
+            input: xo,
+            textarea: xo,
+            form: Xi,
+            script: Ma,
+            select: Oa,
+            option: Na,
+            ngBind: So,
+            ngBindHtml: Oo,
+            ngBindTemplate: Do,
+            ngClass: Ro,
+            ngClassEven: Ho,
+            ngClassOdd: Po,
+            ngCloak: jo,
+            ngController: Lo,
+            ngForm: Qi,
+            ngHide: $a,
+            ngIf: Vo,
+            ngInclude: Bo,
+            ngInit: Wo,
+            ngNonBindable: ua,
+            ngPluralize: pa,
+            ngRef: ga,
+            ngRepeat: va,
+            ngShow: _a,
+            ngStyle: wa,
+            ngSwitch: Ea,
+            ngSwitchWhen: Ca,
+            ngSwitchDefault: ka,
+            ngOptions: ha,
+            ngTransclude: Ta,
+            ngModel: oa,
+            ngList: Yo,
+            ngChange: No,
+            pattern: Ra,
+            ngPattern: Ra,
+            required: Ia,
+            ngRequired: Ia,
+            minlength: Ha,
+            ngMinlength: Ha,
+            maxlength: Pa,
+            ngMaxlength: Pa,
+            ngValue: Ao,
+            ngModelOptions: la
         }).directive({
-            ngInclude: Vo
-        }).directive(zi).directive(jo), e.provider({
+            ngInclude: zo,
+            input: To
+        }).directive(zi).directive(Fo), e.provider({
             $anchorScroll: Qt,
             $animate: sn,
             $animateCss: un,
             $document: Tn,
             $$isDocumentHidden: Mn,
             $exceptionHandler: An,
-            $filter: gi,
+            $filter: vi,
             $$forceReflow: Sn,
             $interpolate: Kn,
             $interval: Xn,
             $$intervalFactory: Qn,
-            $http: Bn,
+            $http: zn,
             $httpParamSerializer: jn,
             $httpParamSerializerJQLike: Ln,
             $httpBackend: Yn,
             $location: gr,
             $log: vr,
             $parse: Hr,
-            $rootScope: Br,
+            $rootScope: zr,
             $q: jr,
             $$q: Lr,
             $sce: Jr,
             $templateRequest: ii,
             $$testability: oi,
             $timeout: si,
-            $window: hi,
-            $$rAF: zr,
+            $window: pi,
+            $$rAF: Br,
             $$jqLite: Ht,
             $$Map: Ut,
-            $$cookieReader: mi
+            $$cookieReader: gi
         })
     }]).info({
-        angularVersion: "1.7.5"
+        angularVersion: "1.7.8"
     }), y.module("ngLocale", [], ["$provide", function(e) {
         var i = "one",
             o = "other";
     }))
 }(window), !window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>'),
     function(e, t) {
-        "object" == typeof exports && "undefined" != typeof module ? t(exports, require("angular")) : "function" == typeof define && define.amd ? define(["exports", "angular"], t) : t(e["@uirouter/angularjs"] = {}, e.angular)
+        "object" == typeof exports && "undefined" != typeof module ? t(exports, require("angular")) : "function" == typeof define && define.amd ? define(["exports", "angular"], t) : t((e = e || self)["@uirouter/angularjs"] = {}, e.angular)
     }(this, function(m, e) {
         "use strict";
         $r.$inject = ["state"];
                 return null !== e && "object" == typeof e
             },
             S = Array.isArray,
-            O = function(e) {
+            D = function(e) {
                 return "[object Date]" === s.call(e)
             },
-            D = function(e) {
+            O = function(e) {
                 return "[object RegExp]" === s.call(e)
             };
 
             U = Object.assign || Me,
             V = j.equals || Ae;
 
-        function z(e) {
+        function B(e) {
             return e
         }
 
-        function B() {}
+        function z() {}
 
         function W(t, r, n, e, i) {
             void 0 === i && (i = !1);
             if (u(S)(o)) return i = t, (r = e).length === i.length && Ce(r, i).reduce(function(e, t) {
                 return e && Ae(t[0], t[1])
             }, !0);
-            if (u(O)(o)) return e.getTime() === t.getTime();
-            if (u(D)(o)) return e.toString() === t.toString();
+            if (u(D)(o)) return e.getTime() === t.getTime();
+            if (u(O)(o)) return e.toString() === t.toString();
             if (u(x)(o)) return !0;
-            if ([x, S, O, D].map(f).reduce(function(e, t) {
+            if ([x, S, D, O].map(f).reduce(function(e, t) {
                     return e || !!t(o)
                 }, !1)) return !1;
             var a = {};
                 if (!a[s]) return !1;
             return !0
         }
-        var Se, Oe = function(e) {
+        var Se, De = function(e) {
                 return e.catch(function(e) {
                     return 0
                 }) && e
             },
-            De = function(e) {
-                return Oe(P.$q.reject(e))
+            Oe = function(e) {
+                return De(P.$q.reject(e))
             },
             Ne = function() {
                 function t(e) {
                 }, r.normalize = function(e) {
                     return h(r)(e) ? e : r.errored(e)
                 }, r.prototype.toString = function() {
-                    var e, t = (e = this.detail) && e.toString !== Object.prototype.toString ? e.toString() : ze(e);
+                    var e, t = (e = this.detail) && e.toString !== Object.prototype.toString ? e.toString() : Be(e);
                     return "Transition Rejection($id: " + this.$id + " type: " + this.type + ", message: " + this.message + ", detail: " + t + ")"
                 }, r.prototype.toPromise = function() {
-                    return U(De(this), {
+                    return U(Oe(this), {
                         _transitionRejection: this
                     })
                 }, r
                     return e.toString()
                 }],
                 [N, Fe],
-                [p(!0), z]
+                [p(!0), B]
             ]);
 
-        function ze(e) {
+        function Be(e) {
             var t = [];
 
             function n(e) {
                 return n(t)
             }).replace(/\\"/g, '"')
         }
-        var Be = function(n) {
+        var ze = function(n) {
                 return function(e) {
                     if (!e) return ["", ""];
                     var t = e.indexOf(n);
             Ye = function(e) {
                 return e.replace(/\/[^/]*$/, "")
             },
-            Ge = Be("#"),
-            Ke = Be("?"),
-            Ze = Be("="),
+            Ge = ze("#"),
+            Ke = ze("?"),
+            Ze = ze("="),
             Xe = function(e) {
                 return e ? e.replace(/^#/, "") : ""
             };
         function Qe(e) {
             var t = new RegExp("(" + e + ")", "g");
             return function(e) {
-                return e.split(t).filter(z)
+                return e.split(t).filter(B)
             }
         }
 
                 }, e.prototype.enabled = function(e) {
                     return !!this._enabled[tt(e)]
                 }, e.prototype.traceTransitionStart = function(e) {
-                    this.enabled(m.Category.TRANSITION) && console.log(st(e) + ": Started  -> " + ze(e))
+                    this.enabled(m.Category.TRANSITION) && console.log(st(e) + ": Started  -> " + Be(e))
                 }, e.prototype.traceTransitionIgnored = function(e) {
-                    this.enabled(m.Category.TRANSITION) && console.log(st(e) + ": Ignored  <> " + ze(e))
+                    this.enabled(m.Category.TRANSITION) && console.log(st(e) + ": Ignored  <> " + Be(e))
                 }, e.prototype.traceHookInvocation = function(e, t, n) {
                     if (this.enabled(m.Category.HOOK)) {
                         var r = C("traceData.hookType")(n) || "internal",
                         console.log(st(t) + ":   Hook -> " + r + " context: " + i + ", " + He(200, o))
                     }
                 }, e.prototype.traceHookResult = function(e, t, n) {
-                    this.enabled(m.Category.HOOK) && console.log(st(t) + ":   <- Hook returned: " + He(200, ze(e)))
+                    this.enabled(m.Category.HOOK) && console.log(st(t) + ":   <- Hook returned: " + He(200, Be(e)))
                 }, e.prototype.traceResolvePath = function(e, t, n) {
                     this.enabled(m.Category.RESOLVE) && console.log(st(n) + ":         Resolving " + e + " (" + t + ")")
                 }, e.prototype.traceResolvableResolved = function(e, t) {
-                    this.enabled(m.Category.RESOLVE) && console.log(st(t) + ":               <- Resolved  " + e + " to: " + He(200, ze(e.data)))
+                    this.enabled(m.Category.RESOLVE) && console.log(st(t) + ":               <- Resolved  " + e + " to: " + He(200, Be(e.data)))
                 }, e.prototype.traceError = function(e, t) {
-                    this.enabled(m.Category.TRANSITION) && console.log(st(t) + ": <- Rejected " + ze(t) + ", reason: " + e)
+                    this.enabled(m.Category.TRANSITION) && console.log(st(t) + ": <- Rejected " + Be(t) + ", reason: " + e)
                 }, e.prototype.traceSuccess = function(e, t) {
-                    this.enabled(m.Category.TRANSITION) && console.log(st(t) + ": <- Success  " + ze(t) + ", final state: " + e.name)
+                    this.enabled(m.Category.TRANSITION) && console.log(st(t) + ": <- Success  " + Be(t) + ", final state: " + e.name)
                 }, e.prototype.traceUIViewEvent = function(e, t, n) {
                     void 0 === n && (n = ""), this.enabled(m.Category.UIVIEW) && console.log("ui-view: " + je(30, e) + " " + et(t) + n)
                 }, e.prototype.traceUIViewConfigUpdated = function(e, t) {
                 pattern: /[^/]*/
             }),
             any: gt({
-                encode: z,
-                decode: z,
+                encode: B,
+                decode: B,
                 is: function() {
                     return !0
                 },
                     var t = e.name ? e.name : e;
                     return "Could not resolve '" + this.name() + "' from state '" + t + "'"
                 }, r.prototype.toString = function() {
-                    return "'" + this.name() + "'" + ze(this.params())
+                    return "'" + this.name() + "'" + Be(this.params())
                 }, r.prototype.withState = function(e) {
                     return new r(this._stateRegistry, e, this._params, this._options)
                 }, r.prototype.withParams = function(e, t) {
                             return t.take(1).toPromise().then(function() {
                                 return t
                             })
-                        } : z;
+                        } : B;
                     return this.promise = e.when().then(function() {
                         return e.all(t.getDependencies(r).map(function(e) {
                             return e.get(t, n)
                 }, a.prototype.get = function(e, t) {
                     return this.promise || this.resolve(e, t)
                 }, a.prototype.toString = function() {
-                    return "Resolvable(token: " + ze(this.token) + ", requires: [" + this.deps.map(ze) + "])"
+                    return "Resolvable(token: " + Be(this.token) + ", requires: [" + this.deps.map(Be) + "])"
                 }, a.prototype.clone = function() {
                     return new a(this)
                 }, a.fromData = function(e, t) {
                         }, []);
                     return P.$q.all(t)
                 }, e.prototype.injector = function() {
-                    return this._injector || (this._injector = new Ot(this))
+                    return this._injector || (this._injector = new Dt(this))
                 }, e.prototype.findNode = function(t) {
                     return le(this._path, function(e) {
                         return G(e.resolvables, t)
                         });
                         if (e.length) return xe(e);
                         var n = r.injector().getNative(t);
-                        if (_(n)) throw new Error("Could not find Dependency Injection token: " + ze(t));
+                        if (_(n)) throw new Error("Could not find Dependency Injection token: " + Be(t));
                         return new kt(t, function() {
                             return n
                         }, [], n)
                     })
                 }, e
             }(),
-            Ot = function() {
+            Dt = function() {
                 function e(e) {
                     this.context = e, this.native = this.get(At) || P.$injector
                 }
                     var t = this.context.getResolvable(e);
                     if (t) {
                         if ("NOWAIT" === this.context.getPolicy(t).async) return t.get(this.context);
-                        if (!t.resolved) throw new Error("Resolvable async .get() not complete:" + ze(t.token));
+                        if (!t.resolved) throw new Error("Resolvable async .get() not complete:" + Be(t.token));
                         return t.data
                     }
                     return this.getNative(e)
                 }, e
             }();
 
-        function Dt(e) {
+        function Ot(e) {
             return e.name
         }
 
         function It(e) {
             return e.parent && e.parent.data && (e.data = e.self.data = Y(e.parent.data, e.data)), e.data
         }
-        var Rt = function(o, a) {
+        var Rt = function(a, s) {
             return function(e) {
                 var t = e.self;
-                t && t.url && t.name && t.name.match(/\.\*\*$/) && (t.url += "{remainder:any}");
-                var n = e.parent,
-                    r = function(e) {
+                if (t && t.url && t.name && t.name.match(/\.\*\*$/)) {
+                    var n = {};
+                    Te(t, n), n.url += "{remainder:any}", t = n
+                }
+                var r = e.parent,
+                    i = function(e) {
                         if (!M(e)) return !1;
                         var t = "^" === e.charAt(0);
                         return {
                             root: t
                         }
                     }(t.url),
-                    i = r ? o.compile(r.val, {
+                    o = i ? a.compile(i.val, {
                         state: t
                     }) : t.url;
-                if (!i) return null;
-                if (!o.isMatcher(i)) throw new Error("Invalid url '" + i + "' in state '" + e + "'");
-                return r && r.root ? i : (n && n.navigable || a()).url.append(i)
+                if (!o) return null;
+                if (!a.isMatcher(o)) throw new Error("Invalid url '" + o + "' in state '" + e + "'");
+                return i && i.root ? o : (r && r.navigable || s()).url.append(o)
             }
         };
 
                         }, [], e.policy, e.useValue)
                     }],
                     [y("useExisting"), function(e) {
-                        return new kt(r(e), z, [e.useExisting], e.policy)
+                        return new kt(r(e), B, [e.useExisting], e.policy)
                     }]
                 ]),
                 o = g([
                     [l(y("val"), M), function(e) {
-                        return new kt(e.token, z, [e.val], e.policy)
+                        return new kt(e.token, B, [e.val], e.policy)
                     }],
                     [l(y("val"), S), function(e) {
                         return new kt(e.token, xe(e.val), e.val.slice(0, -1), e.policy)
                         return !!(e && e.val && (M(e.val) || S(e.val) || x(e.val)))
                     }, o],
                     [p(!0), function(e) {
-                        throw new Error("Invalid resolve value: " + ze(e))
+                        throw new Error("Invalid resolve value: " + Be(e))
                     }]
                 ]),
                 s = e.resolve;
                             return "" === e.name
                         };
                     this.builders = {
-                        name: [Dt],
+                        name: [Ot],
                         self: [Nt],
                         parent: [function(e) {
                             return a(e) ? null : t.find(i.parentName(e)) || o()
                                 return function(e) {
                                     return n(e, t)
                                 }
-                            }, B);
+                            }, z);
                             e[i] = o(e)
                         } return e
                 }, e.prototype.parentName = function(e) {
                     return a.name + (a.name && s ? "." : "") + s
                 }, e
             }(),
-            zt = function() {
+            Bt = function() {
                 function e(e, t, n, r) {
                     this.router = e, this.states = t, this.builder = n, this.listeners = r, this.queue = []
                 }
                     }
                 }, e
             }(),
-            Bt = function() {
+            zt = function() {
                 function e(e) {
-                    this.router = e, this.states = {}, this.listeners = [], this.matcher = new Vt(this.states), this.builder = new qt(this.matcher, e.urlMatcherFactory), this.stateQueue = new zt(e, this.states, this.builder, this.listeners), this._registerRoot()
+                    this.router = e, this.states = {}, this.listeners = [], this.matcher = new Vt(this.states), this.builder = new qt(this.matcher, e.urlMatcherFactory), this.stateQueue = new Bt(e, this.states, this.builder, this.listeners), this._registerRoot()
                 }
                 return e.prototype._registerRoot = function() {
                     (this._root = this.stateQueue.register({
             }();
         (Lt = m.TransitionHookPhase || (m.TransitionHookPhase = {}))[Lt.CREATE = 0] = "CREATE", Lt[Lt.BEFORE = 1] = "BEFORE", Lt[Lt.RUN = 2] = "RUN", Lt[Lt.SUCCESS = 3] = "SUCCESS", Lt[Lt.ERROR = 4] = "ERROR", (Ft = m.TransitionHookScope || (m.TransitionHookScope = {}))[Ft.TRANSITION = 0] = "TRANSITION", Ft[Ft.STATE = 1] = "STATE";
         var Wt = {
-                current: B,
+                current: z,
                 transition: null,
                 traceData: {},
                 bind: null
                     }
                 }, o.REJECT_ERROR = function(e) {
                     return function(e) {
-                        return De(e)
+                        return Oe(e)
                     }
                 }, o.THROW_ERROR = function(e) {
                     return function(e) {
                 }, o
             }();
 
-        function Gt(e, t) {
+        function Gt(e, t, n) {
             var i = M(t) ? [t] : t;
             return !!(x(i) ? i : function(e) {
                 for (var t = i, n = 0; n < t.length; n++) {
                     if (r && r.matches(e.name) || !r && t[n] === e.name) return !0
                 }
                 return !1
-            })(e)
+            })(e, n)
         }
         var Kt = function() {
             function e(e, t, n, r, i, o) {
                 void 0 === o && (o = {}), this.tranSvc = e, this.eventType = t, this.callback = n, this.matchCriteria = r, this.removeHookFromRegistry = i, this.invokeCount = 0, this._deregistered = !1, this.priority = o.priority || 0, this.bind = o.bind || null, this.invokeLimit = o.invokeLimit
             }
-            return e.prototype._matchingNodes = function(e, t) {
+            return e.prototype._matchingNodes = function(e, t, n) {
                 if (!0 === t) return e;
-                var n = e.filter(function(e) {
-                    return Gt(e.state, t)
+                var r = e.filter(function(e) {
+                    return Gt(e.state, t, n)
                 });
-                return n.length ? n : null
+                return r.length ? r : null
             }, e.prototype._getDefaultMatchCriteria = function() {
                 return ce(this.tranSvc._pluginapi._getPathTypes(), function() {
                     return !0
                 })
-            }, e.prototype._getMatchingNodes = function(o) {
-                var a = this,
-                    s = U(this._getDefaultMatchCriteria(), this.matchCriteria);
+            }, e.prototype._getMatchingNodes = function(o, a) {
+                var s = this,
+                    l = U(this._getDefaultMatchCriteria(), this.matchCriteria);
                 return de(this.tranSvc._pluginapi._getPathTypes()).reduce(function(e, t) {
                     var n = t.scope === m.TransitionHookScope.STATE,
                         r = o[t.name] || [],
                         i = n ? r : [xe(r)];
-                    return e[t.name] = a._matchingNodes(i, s[t.name]), e
+                    return e[t.name] = s._matchingNodes(i, l[t.name], a), e
                 }, {})
-            }, e.prototype.matches = function(e) {
-                var t = this._getMatchingNodes(e);
-                return de(t).every(z) ? t : null
+            }, e.prototype.matches = function(e, t) {
+                var n = this._getMatchingNodes(e, t);
+                return de(n).every(B) ? n : null
             }, e.prototype.deregister = function() {
                 this.removeHookFromRegistry(this), this._deregistered = !0
             }, e
                 var t = this;
                 return this.transition.router.transitionService._pluginapi._getEvents(e).map(function(e) {
                     return t.buildHooks(e)
-                }).reduce(pe, []).filter(z)
+                }).reduce(pe, []).filter(B)
             }, e.prototype.buildHooks = function(o) {
                 var a = this.transition,
                     e = a.treeChanges(),
-                    t = this.getMatchingHooks(o, e);
+                    t = this.getMatchingHooks(o, e, a);
                 if (!t) return [];
                 var s = {
                     transition: a,
                     current: a.options().current
                 };
                 return t.map(function(i) {
-                    return i.matches(e)[o.criteriaMatchPath.name].map(function(e) {
+                    return i.matches(e, a)[o.criteriaMatchPath.name].map(function(e) {
                         var t = U({
                                 bind: i.bind,
                                 traceData: {
                 }(o.reverseSort)).map(function(e) {
                     return e.transitionHook
                 })
-            }, e.prototype.getMatchingHooks = function(t, n) {
+            }, e.prototype.getMatchingHooks = function(t, n, r) {
                 var e = t.hookPhase === m.TransitionHookPhase.CREATE,
-                    r = this.transition.router.transitionService;
-                return (e ? [r] : [this.transition, r]).map(function(e) {
+                    i = this.transition.router.transitionService;
+                return (e ? [i] : [this.transition, i]).map(function(e) {
                     return e.getHooks(t.name)
                 }).filter(_e(S, "broken event named: " + t.name)).reduce(pe, []).filter(function(e) {
-                    return e.matches(n)
+                    return e.matches(n, r)
                 })
             }, e
         }();
                     return e instanceof t ? this.is({
                         to: e.$to().name,
                         from: e.$from().name
-                    }) : !(e.to && !Gt(this.$to(), e.to) || e.from && !Gt(this.$from(), e.from))
+                    }) : !(e.to && !Gt(this.$to(), e.to, this) || e.from && !Gt(this.$from(), e.from, this))
                 }, t.prototype.params = function(e) {
                     return void 0 === e && (e = "to"), Object.freeze(this._treeChanges[e].map(y("paramValues")).reduce(ne, {}))
                 }, t.prototype.paramsChanged = function() {
                 }, t.prototype.views = function(e, t) {
                     void 0 === e && (e = "entering");
                     var n = this._treeChanges[e];
-                    return (n = t ? n.filter(v("state", t)) : n).map(y("views")).filter(z).reduce(pe, [])
+                    return (n = t ? n.filter(v("state", t)) : n).map(y("views")).filter(B).reduce(pe, [])
                 }, t.prototype.treeChanges = function(e) {
                     return e ? this._treeChanges[e] : this._treeChanges
                 }, t.prototype.redirect = function(e) {
                         });
                     if (r.length) {
                         var i = r.map(function(e) {
-                                return "[" + e.id + ":" + ze(n[e.id]) + "]"
+                                return "[" + e.id + ":" + Be(n[e.id]) + "]"
                             }).join(", "),
                             o = "The following parameter values are not valid for state '" + e.name + "': " + i;
                         return Pe.invalid(o)
                         n = function(e) {
                             return null !== e["#"] && void 0 !== e["#"] ? e : oe(e, ["#"])
                         };
-                    return "Transition#" + this.$id + "( '" + (A(e) ? e.name : e) + "'" + ze(n(this._treeChanges.from.map(y("paramValues")).reduce(ne, {}))) + " -> " + (this.valid() ? "" : "(X) ") + "'" + (A(t) ? t.name : t) + "'" + ze(n(this.params())) + " )"
+                    return "Transition#" + this.$id + "( '" + (A(e) ? e.name : e) + "'" + Be(n(this._treeChanges.from.map(y("paramValues")).reduce(ne, {}))) + " -> " + (this.valid() ? "" : "(X) ") + "'" + (A(t) ? t.name : t) + "'" + Be(n(this.params())) + " )"
                 }, t.diToken = t
             }();
 
                             if (!(null == r || i && !1 !== n) && (S(r) || (r = [r]), 0 !== r.length)) return t.raw || (r = ue(r, encodeURIComponent)), r.map(function(e) {
                                 return t.id + "=" + e
                             })
-                        }).filter(z).reduce(pe, []).join("&");
+                        }).filter(B).reduce(pe, []).join("&");
                     return i + (o ? "?" + o : "") + (a["#"] ? "#" + a["#"] : "")
                 }, g.nameValidator = /^\w+([-.]+\w+)*(?:\[\])?$/, g
             }(),
-            on = Object.assign || function(e) {
-                for (var t, n = 1, r = arguments.length; n < r; n++)
-                    for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
-                return e
+            on = function() {
+                return (on = Object.assign || function(e) {
+                    for (var t, n = 1, r = arguments.length; n < r; n++)
+                        for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
+                    return e
+                }).apply(this, arguments)
             },
             an = function() {
                 function e(e) {
                 var n = this;
                 this.match = e, this.type = "RAW", this.matchPriority = function(e) {
                     return 0 - n.$id
-                }, this.handler = t || z
+                }, this.handler = t || B
             };
         var un, dn = function() {
                 function e(e) {
             _n = R("LocationConfig", ["port", "protocol", "host", "baseHref", "html5Mode", "hashPrefix"]),
             $n = function() {
                 function e(e, t) {
-                    void 0 === e && (e = yn), void 0 === t && (t = _n), this.locationService = e, this.locationConfig = t, this.$id = bn++, this._disposed = !1, this._disposables = [], this.trace = ct, this.viewService = new fn(this), this.globals = new hn, this.transitionService = new Vn(this), this.urlMatcherFactory = new sn(this), this.urlRouter = new dn(this), this.urlService = new vn(this), this.stateRegistry = new Bt(this), this.stateService = new zn(this), this._plugins = {}, this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()), this.globals.$current = this.stateRegistry.root(), this.globals.current = this.globals.$current.self, this.disposable(this.globals), this.disposable(this.stateService), this.disposable(this.stateRegistry), this.disposable(this.transitionService), this.disposable(this.urlService), this.disposable(e), this.disposable(t)
+                    void 0 === e && (e = yn), void 0 === t && (t = _n), this.locationService = e, this.locationConfig = t, this.$id = bn++, this._disposed = !1, this._disposables = [], this.trace = ct, this.viewService = new fn(this), this.globals = new hn, this.transitionService = new Vn(this), this.urlMatcherFactory = new sn(this), this.urlRouter = new dn(this), this.urlService = new vn(this), this.stateRegistry = new zt(this), this.stateService = new Bn(this), this._plugins = {}, this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()), this.globals.$current = this.stateRegistry.root(), this.globals.current = this.globals.$current.self, this.disposable(this.globals), this.disposable(this.stateService), this.disposable(this.stateRegistry), this.disposable(this.transitionService), this.disposable(this.urlService), this.disposable(e), this.disposable(t)
                 }
                 return e.prototype.disposable = function(e) {
                     this._disposables.push(e)
             Mn = xn("onRetain"),
             An = xn("onEnter"),
             Sn = function(e) {
-                return new St(e.treeChanges().to).resolvePath("EAGER", e).then(B)
+                return new St(e.treeChanges().to).resolvePath("EAGER", e).then(z)
             },
-            On = function(e, t) {
-                return new St(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY", e).then(B)
+            Dn = function(e, t) {
+                return new St(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY", e).then(z)
             },
-            Dn = function(e) {
-                return new St(e.treeChanges().to).resolvePath("LAZY", e).then(B)
+            On = function(e) {
+                return new St(e.treeChanges().to).resolvePath("LAZY", e).then(z)
             },
             Nn = function(e) {
                 var t = P.$q,
                     n = e.views("entering");
                 if (n.length) return t.all(n.map(function(e) {
                     return t.when(e.load())
-                })).then(B)
+                })).then(z)
             },
             In = function(e) {
                 var t = e.views("entering"),
                         priority: 1e3
                     }), e.lazyResolve = this.onEnter({
                         entering: p(!0)
-                    }, On, {
+                    }, Dn, {
                         priority: 1e3
-                    }), e.resolveAll = this.onFinish({}, Dn, {
+                    }), e.resolveAll = this.onFinish({}, On, {
                         priority: 1e3
                     }), e.loadViews = this.onFinish({}, Nn), e.activateViews = this.onSuccess({}, In), e.updateGlobals = this.onCreate({}, Rn), e.updateUrl = this.onSuccess({}, Pn, {
                         priority: 9999
                     }, Hn)
                 }, e
             }(),
-            zn = function() {
+            Bn = function() {
                 function n(e) {
                     this.router = e, this.invalidCallbacks = [], this._defaultErrorHandler = function(e) {
                         e instanceof Error && e.stack ? (console.error(e), console.error(e.stack)) : e instanceof Pe ? (console.error(e.toString()), e.detail && e.detail.stack && console.error(e.detail.stack)) : console.error(e)
                     enumerable: !0,
                     configurable: !0
                 }), n.prototype.dispose = function() {
-                    this.defaultErrorHandler(B), this.invalidCallbacks = []
+                    this.defaultErrorHandler(z), this.invalidCallbacks = []
                 }, n.prototype._handleInvalidTargetState = function(e, n) {
                     var r = this,
                         i = wt.makeTargetState(this.router.stateRegistry, e),
                     var r = this.target(e, t, n),
                         i = this.getCurrentPath();
                     if (!r.exists()) return this._handleInvalidTargetState(i, r);
-                    if (!r.valid()) return De(r.error());
+                    if (!r.valid()) return Oe(r.error());
                     var l = function(i) {
                             return function(e) {
                                 if (e instanceof Pe) {
-                                    var t = a.globals.lastStartedTransitionId === i.$id;
+                                    var t = a.globals.lastStartedTransitionId <= i.$id;
                                     if (e.type === m.RejectType.IGNORED) return t && a.urlRouter.update(), P.$q.when(s.current);
                                     var n = e.detail;
                                     if (e.type === m.RejectType.SUPERSEDED && e.redirected && n instanceof $t) {
                         },
                         c = this.router.transitionService.create(i, r),
                         u = c.run().catch(l(c));
-                    return Oe(u), U(u, {
+                    return De(u), U(u, {
                         transition: c
                     })
                 }, n.prototype.is = function(e, t, n) {
                     return jn(t = t || this.router.transitionService.create(r, i), n)
                 }, n
             }(),
-            Bn = {
+            zn = {
                 when: function(n) {
                     return new Promise(function(e, t) {
                         return e(n)
                                 }
                             })
                         });
-                        return Bn.all(t).then(function(e) {
+                        return zn.all(t).then(function(e) {
                             return e.reduce(function(e, t) {
                                 return e[t.key] = t.val, e
                             }, {})
                 return e.hasOwnProperty(n) ? S(e[n]) ? e[n].push(r) : e[n] = [e[n], r] : e[n] = r, e
             },
             Xn = function(e) {
-                return e.split("&").filter(z).map(Ze).reduce(Zn, {})
+                return e.split("&").filter(B).map(Ze).reduce(Zn, {})
             };
 
         function Qn(e) {
                     ee(this._listeners)
                 }, e
             }(),
-            or = (tr = Object.setPrototypeOf || {
-                    __proto__: []
+            or = (tr = function(e, t) {
+                return (tr = Object.setPrototypeOf || {
+                        __proto__: []
+                    }
+                    instanceof Array && function(e, t) {
+                        e.__proto__ = t
+                    } || function(e, t) {
+                        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
+                    })(e, t)
+            }, function(e, t) {
+                function n() {
+                    this.constructor = e
                 }
-                instanceof Array && function(e, t) {
-                    e.__proto__ = t
-                } || function(e, t) {
-                    for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
-                },
-                function(e, t) {
-                    function n() {
-                        this.constructor = e
-                    }
-                    tr(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
-                }),
+                tr(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
+            }),
             ar = function(n) {
                 function e(e) {
                     var t = n.call(this, e, !1) || this;
                     n.prototype.dispose.call(this, e), H.removeEventListener("hashchange", this._listener)
                 }, e
             }(ir),
-            sr = (nr = Object.setPrototypeOf || {
-                    __proto__: []
+            sr = (nr = function(e, t) {
+                return (nr = Object.setPrototypeOf || {
+                        __proto__: []
+                    }
+                    instanceof Array && function(e, t) {
+                        e.__proto__ = t
+                    } || function(e, t) {
+                        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
+                    })(e, t)
+            }, function(e, t) {
+                function n() {
+                    this.constructor = e
                 }
-                instanceof Array && function(e, t) {
-                    e.__proto__ = t
-                } || function(e, t) {
-                    for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
-                },
-                function(e, t) {
-                    function n() {
-                        this.constructor = e
-                    }
-                    nr(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
-                }),
+                nr(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
+            }),
             lr = function(t) {
                 function e(e) {
                     return t.call(this, e, !0) || this
                     this._url = n
                 }, e
             }(ir),
-            cr = (rr = Object.setPrototypeOf || {
-                    __proto__: []
+            cr = (rr = function(e, t) {
+                return (rr = Object.setPrototypeOf || {
+                        __proto__: []
+                    }
+                    instanceof Array && function(e, t) {
+                        e.__proto__ = t
+                    } || function(e, t) {
+                        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
+                    })(e, t)
+            }, function(e, t) {
+                function n() {
+                    this.constructor = e
                 }
-                instanceof Array && function(e, t) {
-                    e.__proto__ = t
-                } || function(e, t) {
-                    for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n])
-                },
-                function(e, t) {
-                    function n() {
-                        this.constructor = e
-                    }
-                    rr(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
-                }),
+                rr(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, new n)
+            }),
             ur = function(n) {
                 function e(e) {
                     var t = n.call(this, e, !0) || this;
             }(ir),
             dr = function() {
                 var t = this;
-                this.dispose = B, this._baseHref = "", this._port = 80, this._protocol = "http", this._host = "localhost", this._hashPrefix = "", this.port = function() {
+                this.dispose = z, this._baseHref = "", this._port = 80, this._protocol = "http", this._host = "localhost", this._hashPrefix = "", this.port = function() {
                     return t._port
                 }, this.protocol = function() {
                     return t._protocol
                     return k(e) && (this._baseHref = e), _(this._baseHref) && (this._baseHref = this.getBaseHref()), this._baseHref
                 }, e.prototype.getBaseHref = function() {
                     var e = document.getElementsByTagName("base")[0];
-                    return e && e.href ? e.href.replace(/^(https?:)?\/\/[^/]*/, "") : this._isHtml5 ? "/" : location.pathname || "/"
+                    return e && e.href ? e.href.replace(/^([^/:]*:)?\/\/[^/]*/, "") : this._isHtml5 ? "/" : location.pathname || "/"
                 }, e.prototype.dispose = function() {}, e
             }();
 
         function hr(e) {
             return P.$injector = Kn, {
                 name: "vanilla.services",
-                $q: P.$q = Bn,
+                $q: P.$q = zn,
                 $injector: Kn,
                 dispose: function() {
                     return null
                 forEach: q,
                 extend: U,
                 equals: V,
-                identity: z,
-                noop: B,
+                identity: B,
+                noop: z,
                 createProxyFunctions: W,
                 inherit: Y,
                 inArray: G,
                 tail: xe,
                 copy: Te,
                 _extend: Me,
-                silenceUncaughtInPromise: Oe,
-                silentRejection: De,
+                silenceUncaughtInPromise: De,
+                silentRejection: Oe,
                 makeStub: R,
                 services: P,
                 Glob: Ne,
                 isString: M,
                 isObject: A,
                 isArray: S,
-                isDate: O,
-                isRegExp: D,
+                isDate: D,
+                isRegExp: O,
                 isInjectable: N,
                 isPromise: I,
                 Queue: Ie,
                 kebobString: Le,
                 functionToString: Fe,
                 fnToString: qe,
-                stringify: ze,
-                beforeAfterSubstr: Be,
+                stringify: Be,
+                beforeAfterSubstr: ze,
                 hostRegex: We,
                 stripLastPathElement: Ye,
                 splitHash: Ge,
                 StateBuilder: qt,
                 StateObject: Ut,
                 StateMatcher: Vt,
-                StateQueueManager: zt,
-                StateRegistry: Bt,
-                StateService: zn,
+                StateQueueManager: Bt,
+                StateRegistry: zt,
+                StateService: Bn,
                 TargetState: $t,
                 get TransitionHookPhase() {
                     return m.TransitionHookPhase
                 ViewService: fn,
                 UIRouterGlobals: hn,
                 UIRouter: $n,
-                $q: Bn,
+                $q: zn,
                 $injector: Kn,
                 BaseLocationServices: ir,
                 HashLocationService: ar,
                         o = "onExit" === n ? "from" : "to";
                     return i ? function(e, t) {
                         var n = new St(e.treeChanges(o)).subContext(t.$$state()),
-                            r = U(Br(n), {
+                            r = U(zr(n), {
                                 $state$: t,
                                 $transition$: e
                             });
                     if (!x(e)) throw new Error("'rule' must be a function");
                     var n = new cn(function() {
                         return e(P.$injector, t.router.locationService)
-                    }, z);
+                    }, B);
                     return this.router.urlService.rules.rule(n), this
                 }, n.prototype.otherwise = function(e) {
                     var t = this,
                 }, n
             }();
         E.module("ui.router.angular1", []);
-        var Or = E.module("ui.router.init", ["ng"]),
-            Dr = E.module("ui.router.util", ["ui.router.init"]),
+        var Dr = E.module("ui.router.init", ["ng"]),
+            Or = E.module("ui.router.util", ["ui.router.init"]),
             Nr = E.module("ui.router.router", ["ui.router.util"]),
             Ir = E.module("ui.router.state", ["ui.router.router", "ui.router.util", "ui.router.angular1"]),
             Rr = E.module("ui.router", ["ui.router.init", "ui.router.state", "ui.router.angular1"]),
                 ct.approximateDigests++
             })
         }
-        Fr.$inject = ["$rootScope"], Or.provider("$uiRouter", Hr), Nr.provider("$urlRouter", ["$uiRouterProvider", function(e) {
+        Fr.$inject = ["$rootScope"], Dr.provider("$uiRouter", Hr), Nr.provider("$urlRouter", ["$uiRouterProvider", function(e) {
             return e.urlRouterProvider = new Sr(e)
-        }]), Dr.provider("$urlService", jr("urlService")), Dr.provider("$urlMatcherFactory", ["$uiRouterProvider", function() {
+        }]), Or.provider("$urlService", jr("urlService")), Or.provider("$urlMatcherFactory", ["$uiRouterProvider", function() {
             return Pr.urlMatcherFactory
-        }]), Dr.provider("$templateFactory", function() {
+        }]), Or.provider("$templateFactory", function() {
             return new Cr
         }), Ir.provider("$stateRegistry", jr("stateRegistry")), Ir.provider("$uiRouterGlobals", jr("globals")), Ir.provider("$transitions", jr("transitionService")), Ir.provider("$state", ["$uiRouterProvider", function() {
             return U(Pr.stateProvider, {
             return Pr.viewService
         }), Rr.service("$trace", function() {
             return ct
-        }), Rr.run(Fr), Dr.run(["$urlMatcherFactory", function(e) {}]), Ir.run(["$state", function(e) {}]), Nr.run(["$urlRouter", function(e) {}]), Or.run(Lr);
-        var qr, Ur, Vr, zr, Br = function(n) {
+        }), Rr.run(Fr), Or.run(["$urlMatcherFactory", function(e) {}]), Ir.run(["$state", function(e) {}]), Nr.run(["$urlRouter", function(e) {}]), Dr.run(Lr);
+        var qr, Ur, Vr, Br, zr = function(n) {
             return n.getTokens().filter(M).map(function(e) {
                 var t = n.getResolvable(e);
                 return [e, "NOWAIT" === n.getPolicy(t).async ? t.promise : t.data]
                             if (!e) return n.html(p), void m(n.contents())(t);
                             var r = e.$cfg || {
                                     viewDecl: {},
-                                    getTemplate: B
+                                    getTemplate: z
                                 },
                                 i = r.path && new St(r.path);
                             n.html(r.getTemplate(n, i) || p), ct.traceUIViewFill(e.$uiView, n.html());
                                 a = r.controller,
                                 s = y(r),
                                 l = _(r),
-                                c = i && Br(i);
+                                c = i && zr(i);
                             if (t[l] = c, a) {
                                 var u = g(a, U({}, c, {
                                     $scope: t,
                         },
                         u = ["uiState", "uiStateParams", "uiStateOpts"],
                         d = u.reduce(function(e, t) {
-                            return e[t] = B, e
+                            return e[t] = z, e
                         }, {});
 
                     function f() {
                     } catch (e) {}
 
                     function o(e) {
-                        e.promise.then(h, B)
+                        e.promise.then(h, z)
                     }
 
                     function a() {
 
                     function h() {
                         var t = function(e) {
-                                return e.split(/\s/).filter(z)
+                                return e.split(/\s/).filter(B)
                             },
                             e = function(e) {
                                 return e.map(function(e) {
                     })), g.globals.transition && o(g.globals.transition), h()
                 }]
             }
-        }], E.module("ui.router.state").directive("uiSref", qr).directive("uiSrefActive", Vr).directive("uiSrefActiveEq", Vr).directive("uiState", Ur), Qr.$inject = ["$state"], Jr.$inject = ["$state"], E.module("ui.router.state").filter("isState", Qr).filter("includedByState", Jr), zr = ["$view", "$animate", "$uiViewScroll", "$interpolate", "$q", function(i, o, b, y, _) {
+        }], E.module("ui.router.state").directive("uiSref", qr).directive("uiSrefActive", Vr).directive("uiSrefActiveEq", Vr).directive("uiState", Ur), Qr.$inject = ["$state"], Jr.$inject = ["$state"], E.module("ui.router.state").filter("isState", Qr).filter("includedByState", Jr), Br = ["$view", "$animate", "$uiViewScroll", "$interpolate", "$q", function(i, o, b, y, _) {
             var $ = {
                     $cfg: {
                         viewDecl: {
                 }, i))
             }
         }
-        E.module("ui.router.state").directive("uiView", zr), E.module("ui.router.state").directive("uiView", ei), E.module("ui.router.state").provider("$uiViewScroll", function() {
+        E.module("ui.router.state").directive("uiView", Br), E.module("ui.router.state").directive("uiView", ei), E.module("ui.router.state").provider("$uiViewScroll", function() {
             var n = !1;
             this.useAnchorScroll = function() {
                 n = !0
                 }
             }]
         });
-        m.default = "ui.router", m.core = br, m.watchDigests = Fr, m.getLocals = Br, m.getNg1ViewConfigFactory = yr, m.ng1ViewsBuilder = $r, m.Ng1ViewConfig = Er, m.StateProvider = Tr, m.UrlRouterProvider = Sr, m.root = H, m.fromJson = L, m.toJson = F, m.forEach = q, m.extend = U, m.equals = V, m.identity = z, m.noop = B, m.createProxyFunctions = W, m.inherit = Y, m.inArray = G, m._inArray = K, m.removeFrom = Z, m._removeFrom = X, m.pushTo = Q, m._pushTo = J, m.deregAll = ee, m.defaults = te, m.mergeR = ne, m.ancestors = re, m.pick = ie, m.omit = oe, m.pluck = ae, m.filter = se, m.find = le, m.mapObj = ce, m.map = ue, m.values = de, m.allTrueR = fe, m.anyTrueR = he, m.unnestR = pe, m.flattenR = me, m.pushR = ge, m.uniqR = ve, m.unnest = be, m.flatten = ye, m.assertPredicate = _e, m.assertMap = $e, m.assertFn = we, m.pairs = Ee, m.arrayTuples = Ce, m.applyPairs = ke, m.tail = xe, m.copy = Te, m._extend = Me, m.silenceUncaughtInPromise = Oe, m.silentRejection = De, m.makeStub = R, m.services = P, m.Glob = Ne, m.curry = c, m.compose = n, m.pipe = l, m.prop = y, m.propEq = v, m.parse = C, m.not = d, m.and = r, m.or = i, m.all = u, m.any = f, m.is = h, m.eq = o, m.val = p, m.invoke = a, m.pattern = g, m.isUndefined = _, m.isDefined = k, m.isNull = $, m.isNullOrUndefined = w, m.isFunction = x, m.isNumber = T, m.isString = M, m.isObject = A, m.isArray = S, m.isDate = O, m.isRegExp = D, m.isInjectable = N, m.isPromise = I, m.Queue = Ie, m.maxLength = He, m.padString = je, m.kebobString = Le, m.functionToString = Fe, m.fnToString = qe, m.stringify = ze, m.beforeAfterSubstr = Be, m.hostRegex = We, m.stripLastPathElement = Ye, m.splitHash = Ge, m.splitQuery = Ke, m.splitEqual = Ze, m.trimHashVal = Xe, m.splitOnDelim = Qe, m.joinNeighborsR = Je, m.Trace = lt, m.trace = ct, m.Param = vt, m.ParamTypes = bt, m.StateParams = yt, m.ParamType = ut, m.PathNode = _t, m.PathUtils = wt, m.resolvePolicies = Et, m.defaultResolvePolicy = Ct, m.Resolvable = kt, m.NATIVE_INJECTOR_TOKEN = At, m.ResolveContext = St, m.resolvablesBuilder = jt, m.StateBuilder = qt, m.StateObject = Ut, m.StateMatcher = Vt, m.StateQueueManager = zt, m.StateRegistry = Bt, m.StateService = zn, m.TargetState = $t, m.HookBuilder = Xt, m.matchState = Gt, m.RegisteredHook = Kt, m.makeEvent = Zt, m.Rejection = Pe, m.Transition = Jt, m.TransitionHook = Yt, m.TransitionEventType = Ln, m.defaultTransOpts = Un, m.TransitionService = Vn, m.UrlRules = mn, m.UrlConfig = gn, m.UrlMatcher = rn, m.ParamFactory = an, m.UrlMatcherFactory = sn, m.UrlRouter = dn, m.UrlRuleFactory = ln, m.BaseUrlRule = cn, m.UrlService = vn, m.ViewService = fn, m.UIRouterGlobals = hn, m.UIRouter = $n, m.$q = Bn, m.$injector = Kn, m.BaseLocationServices = ir, m.HashLocationService = ar, m.MemoryLocationService = lr, m.PushStateLocationService = ur, m.MemoryLocationConfig = dr, m.BrowserLocationConfig = fr, m.keyValsToObjectR = Zn, m.getParams = Xn, m.parseUrl = Qn, m.buildUrl = Jn, m.locationPluginFactory = er, m.servicesPlugin = hr, m.hashLocationPlugin = pr, m.pushStateLocationPlugin = mr, m.memoryLocationPlugin = gr, m.UIRouterPluginBase = vr, Object.defineProperty(m, "__esModule", {
+        m.default = "ui.router", m.core = br, m.watchDigests = Fr, m.getLocals = zr, m.getNg1ViewConfigFactory = yr, m.ng1ViewsBuilder = $r, m.Ng1ViewConfig = Er, m.StateProvider = Tr, m.UrlRouterProvider = Sr, m.root = H, m.fromJson = L, m.toJson = F, m.forEach = q, m.extend = U, m.equals = V, m.identity = B, m.noop = z, m.createProxyFunctions = W, m.inherit = Y, m.inArray = G, m._inArray = K, m.removeFrom = Z, m._removeFrom = X, m.pushTo = Q, m._pushTo = J, m.deregAll = ee, m.defaults = te, m.mergeR = ne, m.ancestors = re, m.pick = ie, m.omit = oe, m.pluck = ae, m.filter = se, m.find = le, m.mapObj = ce, m.map = ue, m.values = de, m.allTrueR = fe, m.anyTrueR = he, m.unnestR = pe, m.flattenR = me, m.pushR = ge, m.uniqR = ve, m.unnest = be, m.flatten = ye, m.assertPredicate = _e, m.assertMap = $e, m.assertFn = we, m.pairs = Ee, m.arrayTuples = Ce, m.applyPairs = ke, m.tail = xe, m.copy = Te, m._extend = Me, m.silenceUncaughtInPromise = De, m.silentRejection = Oe, m.makeStub = R, m.services = P, m.Glob = Ne, m.curry = c, m.compose = n, m.pipe = l, m.prop = y, m.propEq = v, m.parse = C, m.not = d, m.and = r, m.or = i, m.all = u, m.any = f, m.is = h, m.eq = o, m.val = p, m.invoke = a, m.pattern = g, m.isUndefined = _, m.isDefined = k, m.isNull = $, m.isNullOrUndefined = w, m.isFunction = x, m.isNumber = T, m.isString = M, m.isObject = A, m.isArray = S, m.isDate = D, m.isRegExp = O, m.isInjectable = N, m.isPromise = I, m.Queue = Ie, m.maxLength = He, m.padString = je, m.kebobString = Le, m.functionToString = Fe, m.fnToString = qe, m.stringify = Be, m.beforeAfterSubstr = ze, m.hostRegex = We, m.stripLastPathElement = Ye, m.splitHash = Ge, m.splitQuery = Ke, m.splitEqual = Ze, m.trimHashVal = Xe, m.splitOnDelim = Qe, m.joinNeighborsR = Je, m.Trace = lt, m.trace = ct, m.Param = vt, m.ParamTypes = bt, m.StateParams = yt, m.ParamType = ut, m.PathNode = _t, m.PathUtils = wt, m.resolvePolicies = Et, m.defaultResolvePolicy = Ct, m.Resolvable = kt, m.NATIVE_INJECTOR_TOKEN = At, m.ResolveContext = St, m.resolvablesBuilder = jt, m.StateBuilder = qt, m.StateObject = Ut, m.StateMatcher = Vt, m.StateQueueManager = Bt, m.StateRegistry = zt, m.StateService = Bn, m.TargetState = $t, m.HookBuilder = Xt, m.matchState = Gt, m.RegisteredHook = Kt, m.makeEvent = Zt, m.Rejection = Pe, m.Transition = Jt, m.TransitionHook = Yt, m.TransitionEventType = Ln, m.defaultTransOpts = Un, m.TransitionService = Vn, m.UrlRules = mn, m.UrlConfig = gn, m.UrlMatcher = rn, m.ParamFactory = an, m.UrlMatcherFactory = sn, m.UrlRouter = dn, m.UrlRuleFactory = ln, m.BaseUrlRule = cn, m.UrlService = vn, m.ViewService = fn, m.UIRouterGlobals = hn, m.UIRouter = $n, m.$q = zn, m.$injector = Kn, m.BaseLocationServices = ir, m.HashLocationService = ar, m.MemoryLocationService = lr, m.PushStateLocationService = ur, m.MemoryLocationConfig = dr, m.BrowserLocationConfig = fr, m.keyValsToObjectR = Zn, m.getParams = Xn, m.parseUrl = Qn, m.buildUrl = Jn, m.locationPluginFactory = er, m.servicesPlugin = hr, m.hashLocationPlugin = pr, m.pushStateLocationPlugin = mr, m.memoryLocationPlugin = gr, m.UIRouterPluginBase = vr, Object.defineProperty(m, "__esModule", {
             value: !0
         })
     }),
             Ma = "[object Float32Array]",
             Aa = "[object Float64Array]",
             Sa = "[object Int8Array]",
-            Oa = "[object Int16Array]",
-            Da = "[object Int32Array]",
+            Da = "[object Int16Array]",
+            Oa = "[object Int32Array]",
             Na = "[object Uint8Array]",
             Ia = "[object Uint8ClampedArray]",
             Ra = "[object Uint16Array]",
             qa = /[&<>"']/g,
             Ua = RegExp(Fa.source),
             Va = RegExp(qa.source),
-            za = /<%-([\s\S]+?)%>/g,
-            Ba = /<%([\s\S]+?)%>/g,
+            Ba = /<%-([\s\S]+?)%>/g,
+            za = /<%([\s\S]+?)%>/g,
             Wa = /<%=([\s\S]+?)%>/g,
             Ya = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
             Ga = /^\w*$/,
             _s = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"],
             $s = -1,
             ws = {};
-        ws[Ma] = ws[Aa] = ws[Sa] = ws[Oa] = ws[Da] = ws[Na] = ws[Ia] = ws[Ra] = ws[Pa] = !0, ws[ua] = ws[da] = ws[xa] = ws[fa] = ws[Ta] = ws[ha] = ws[pa] = ws[ma] = ws[va] = ws[ba] = ws[ya] = ws[$a] = ws[wa] = ws[Ea] = ws[ka] = !1;
+        ws[Ma] = ws[Aa] = ws[Sa] = ws[Da] = ws[Oa] = ws[Na] = ws[Ia] = ws[Ra] = ws[Pa] = !0, ws[ua] = ws[da] = ws[xa] = ws[fa] = ws[Ta] = ws[ha] = ws[pa] = ws[ma] = ws[va] = ws[ba] = ws[ya] = ws[$a] = ws[wa] = ws[Ea] = ws[ka] = !1;
         var Es = {};
-        Es[ua] = Es[da] = Es[xa] = Es[Ta] = Es[fa] = Es[ha] = Es[Ma] = Es[Aa] = Es[Sa] = Es[Oa] = Es[Da] = Es[va] = Es[ba] = Es[ya] = Es[$a] = Es[wa] = Es[Ea] = Es[Ca] = Es[Na] = Es[Ia] = Es[Ra] = Es[Pa] = !0, Es[pa] = Es[ma] = Es[ka] = !1;
+        Es[ua] = Es[da] = Es[xa] = Es[Ta] = Es[fa] = Es[ha] = Es[Ma] = Es[Aa] = Es[Sa] = Es[Da] = Es[Oa] = Es[va] = Es[ba] = Es[ya] = Es[$a] = Es[wa] = Es[Ea] = Es[Ca] = Es[Na] = Es[Ia] = Es[Ra] = Es[Pa] = !0, Es[pa] = Es[ma] = Es[ka] = !1;
         var S = {
                 "\\": "\\",
                 "'": "'",
             },
             Cs = parseFloat,
             ks = parseInt,
-            O = "object" == typeof global && global && global.Object === Object && global,
-            D = "object" == typeof self && self && self.Object === Object && self,
-            xs = O || D || Function("return this")(),
+            D = "object" == typeof global && global && global.Object === Object && global,
+            O = "object" == typeof self && self && self.Object === Object && self,
+            xs = D || O || Function("return this")(),
             N = "object" == typeof exports && exports && !exports.nodeType && exports,
             I = N && "object" == typeof module && module && !module.nodeType && module,
             Ts = I && I.exports === N,
-            R = Ts && O.process,
+            R = Ts && D.process,
             P = function() {
                 try {
                     var e = I && I.require && I.require("util").types;
             Ms = P && P.isArrayBuffer,
             As = P && P.isDate,
             Ss = P && P.isMap,
-            Os = P && P.isRegExp,
-            Ds = P && P.isSet,
+            Ds = P && P.isRegExp,
+            Os = P && P.isSet,
             Ns = P && P.isTypedArray;
 
         function Is(e, t, n) {
             return e
         }
 
-        function zs(e, t, n, r) {
+        function Bs(e, t, n, r) {
             var i = -1,
                 o = null == e ? 0 : e.length;
             for (r && o && (n = e[++i]); ++i < o;) n = t(n, e[i], i, e);
             return n
         }
 
-        function Bs(e, t, n, r) {
+        function zs(e, t, n, r) {
             var i = null == e ? 0 : e.length;
             for (r && i && (n = e[--i]); i--;) n = t(n, e[i], i, e);
             return n
                 x = hl(C.getPrototypeOf, C),
                 T = C.create,
                 S = d.propertyIsEnumerable,
-                O = a.splice,
-                D = $ ? $.isConcatSpreadable : na,
+                D = a.splice,
+                O = $ ? $.isConcatSpreadable : na,
                 N = $ ? $.iterator : na,
                 I = $ ? $.toStringTag : na,
                 R = function() {
                 q = C.getOwnPropertySymbols,
                 U = _ ? _.isBuffer : na,
                 V = t.isFinite,
-                z = a.join,
-                B = hl(C.keys, C),
+                B = a.join,
+                z = hl(C.keys, C),
                 W = o.max,
                 Y = o.min,
                 G = r.now,
                 he = de ? de.toString : na;
 
             function pe(e) {
-                if (Oi(e) && !_i(e) && !(e instanceof be)) {
+                if (Di(e) && !_i(e) && !(e instanceof be)) {
                     if (e instanceof ve) return e;
                     if (k.call(e, "__wrapped__")) return mr(e)
                 }
                 return -1
             }
 
-            function Oe(e, r, i, o) {
+            function De(e, r, i, o) {
                 return Fe(e, function(e, t, n) {
                     r(o, e, i(e), n)
                 }), o
             }
 
-            function De(e, t) {
+            function Oe(e, t) {
                 return e && on(t, so(t), e)
             }
 
                         $ = _ == ma || _ == ga;
                     if (Ci(n)) return Xt(n, s);
                     if (_ == ya || _ == ua || $ && !t) {
-                        if (a = l || $ ? {} : Bn(n), !s) return l ? (m = f = n, h = (p = a) && on(m, lo(m), p), on(f, Un(f), h)) : (d = De(a, u = n), on(u, qn(u), d))
+                        if (a = l || $ ? {} : zn(n), !s) return l ? (m = f = n, h = (p = a) && on(m, lo(m), p), on(f, Un(f), h)) : (d = Oe(a, u = n), on(u, qn(u), d))
                     } else {
                         if (!Es[_]) return t ? n : {};
                         a = function(e, t, n) {
                                 case Ma:
                                 case Aa:
                                 case Sa:
-                                case Oa:
                                 case Da:
+                                case Oa:
                                 case Na:
                                 case Ia:
                                 case Ra:
                 o || (o = new Ee);
                 var w = o.get(n);
                 if (w) return w;
-                if (o.set(n, a), Pi(n)) return n.forEach(function(e) {
+                o.set(n, a), Pi(n) ? n.forEach(function(e) {
                     a.add(Pe(e, r, i, e, n, o))
-                }), a;
-                if (Di(n)) return n.forEach(function(e, t) {
+                }) : Oi(n) && n.forEach(function(e, t) {
                     a.set(t, Pe(e, r, i, t, n, o))
-                }), a;
-                var E = y ? na : (c ? l ? Nn : Dn : l ? lo : so)(n);
+                });
+                var E = y ? na : (c ? l ? Nn : On : l ? lo : so)(n);
                 return Ps(E || n, function(e, t) {
                     E && (e = n[t = e]), Ae(a, t, Pe(e, r, i, t, n, o))
                 }), a
                 return l
             }
             pe.templateSettings = {
-                escape: za,
-                evaluate: Ba,
+                escape: Ba,
+                evaluate: za,
                 interpolate: Wa,
                 variable: "",
                 imports: {
             }, _e.prototype.delete = function(e) {
                 var t = this.__data__,
                     n = Se(t, e);
-                return !(n < 0 || (n == t.length - 1 ? t.pop() : O.call(t, n, 1), --this.size, 0))
+                return !(n < 0 || (n == t.length - 1 ? t.pop() : D.call(t, n, 1), --this.size, 0))
             }, _e.prototype.get = function(e) {
                 var t = this.__data__,
                     n = Se(t, e);
                 return l
             }
 
-            function ze(e, r) {
+            function Be(e, r) {
                 var i = [];
                 return Fe(e, function(e, t, n) {
                     r(e, t, n) && i.push(e)
                 }), i
             }
 
-            function Be(e, t, n, r, i) {
+            function ze(e, t, n, r, i) {
                 var o = -1,
                     a = e.length;
                 for (n || (n = Wn), i || (i = []); ++o < a;) {
                     var s = e[o];
-                    0 < t && n(s) ? 1 < t ? Be(s, t - 1, n, r, i) : Vs(i, s) : r || (i[i.length] = s)
+                    0 < t && n(s) ? 1 < t ? ze(s, t - 1, n, r, i) : Vs(i, s) : r || (i[i.length] = s)
                 }
                 return i
             }
             }
 
             function ot(e) {
-                return Oi(e) && Je(e) == ua
+                return Di(e) && Je(e) == ua
             }
 
             function at(e, t, n, r, i) {
-                return e === t || (null == e || null == t || !Oi(e) && !Oi(t) ? e != e && t != t : function(e, t, n, r, i, o) {
+                return e === t || (null == e || null == t || !Di(e) && !Di(t) ? e != e && t != t : function(e, t, n, r, i, o) {
                     var a = _i(e),
                         s = _i(t),
                         l = a ? da : Vn(e),
                     }
                     return !!f && (o || (o = new Ee), function(e, t, n, r, i, o) {
                         var a = 1 & n,
-                            s = Dn(e),
+                            s = On(e),
                             l = s.length,
-                            c = Dn(t).length;
+                            c = On(t).length;
                         if (l != c && !a) return !1;
                         for (var u = l; u--;) {
                             var d = s[u];
             }
 
             function ut(e) {
-                if (!Qn(e)) return B(e);
+                if (!Qn(e)) return z(e);
                 var t = [];
                 for (var n in C(e)) k.call(e, n) && "constructor" != n && t.push(n);
                 return t
 
             function gt(r, i, o, a, s) {
                 r !== i && We(i, function(e, t) {
-                    if (Si(e)) s || (s = new Ee),
-                        function(e, t, n, r, i, o, a) {
-                            var s = rr(e, n),
-                                l = rr(t, n),
-                                c = a.get(l);
-                            if (c) return Me(e, n, c);
-                            var u = o ? o(s, l, n + "", e, t, a) : na,
-                                d = u === na;
-                            if (d) {
-                                var f = _i(l),
-                                    h = !f && Ci(l),
-                                    p = !f && !h && Li(l);
-                                u = l, f || h || p ? u = _i(s) ? s : Ei(s) ? rn(s) : h ? Xt(l, !(d = !1)) : p ? Jt(l, !(d = !1)) : [] : Ii(l) || yi(l) ? yi(u = s) ? u = Yi(s) : Si(s) && !Ti(s) || (u = Bn(l)) : d = !1
-                            }
-                            d && (a.set(l, u), i(u, l, r, o, a), a.delete(l)), Me(e, n, u)
-                        }(r, i, t, o, gt, a, s);
+                    if (s || (s = new Ee), Si(e)) ! function(e, t, n, r, i, o, a) {
+                        var s = rr(e, n),
+                            l = rr(t, n),
+                            c = a.get(l);
+                        if (c) return Me(e, n, c);
+                        var u = o ? o(s, l, n + "", e, t, a) : na,
+                            d = u === na;
+                        if (d) {
+                            var f = _i(l),
+                                h = !f && Ci(l),
+                                p = !f && !h && Li(l);
+                            u = l, f || h || p ? u = _i(s) ? s : Ei(s) ? rn(s) : h ? Xt(l, !(d = !1)) : p ? Jt(l, !(d = !1)) : [] : Ii(l) || yi(l) ? yi(u = s) ? u = Yi(s) : Si(s) && !Ti(s) || (u = zn(l)) : d = !1
+                        }
+                        d && (a.set(l, u), i(u, l, r, o, a), a.delete(l)), Me(e, n, u)
+                    }(r, i, t, o, gt, a, s);
                     else {
                         var n = a ? a(rr(r, t), e, t + "", r, i, s) : na;
                         n === na && (n = e), Me(r, t, n)
                     a = t.length,
                     s = e;
                 for (e === t && (t = rn(t)), n && (s = Us(e, rl(n))); ++o < a;)
-                    for (var l = 0, c = t[o], u = n ? n(c) : c; - 1 < (l = i(s, u, l, r));) s !== e && O.call(s, l, 1), O.call(e, l, 1);
+                    for (var l = 0, c = t[o], u = n ? n(c) : c; - 1 < (l = i(s, u, l, r));) s !== e && D.call(s, l, 1), D.call(e, l, 1);
                 return e
             }
 
                     var i = t[n];
                     if (n == r || i !== o) {
                         var o = i;
-                        Yn(i) ? O.call(e, i, 1) : Lt(e, i)
+                        Yn(i) ? D.call(e, i, 1) : Lt(e, i)
                     }
                 }
                 return e
                     return R(e, "toString", {
                         configurable: !0,
                         enumerable: !1,
-                        value: Oo(t),
+                        value: Do(t),
                         writable: !0
                     })
                 } : Io;
                 return cr(vo(e))
             }
 
-            function Ot(e, t, n) {
+            function Dt(e, t, n) {
                 var r = -1,
                     i = e.length;
                 t < 0 && (t = i < -t ? 0 : i + t), (n = i < n ? i : n) < 0 && (n += i), i = n < t ? 0 : n - t >>> 0, t >>>= 0;
                 return o
             }
 
-            function Dt(e, r) {
+            function Ot(e, r) {
                 var i;
                 return Fe(e, function(e, t, n) {
                     return !(i = r(e, t, n))
             function qt(e, t, n, r) {
                 for (var i = e.length, o = r ? i : -1;
                     (r ? o-- : ++o < i) && t(e[o], o, e););
-                return n ? Ot(e, r ? 0 : o, r ? o + 1 : i) : Ot(e, r ? o + 1 : 0, r ? i : o)
+                return n ? Dt(e, r ? 0 : o, r ? o + 1 : i) : Dt(e, r ? o + 1 : 0, r ? i : o)
             }
 
             function Ut(e, t) {
                 var n = e;
-                return n instanceof be && (n = n.value()), zs(t, function(e, t) {
+                return n instanceof be && (n = n.value()), Bs(t, function(e, t) {
                     return t.func.apply(t.thisArg, Vs([e], t.args))
                 }, n)
             }
                 if (r < 2) return r ? jt(e[0]) : [];
                 for (var i = -1, o = M(r); ++i < r;)
                     for (var a = e[i], s = -1; ++s < r;) s != i && (o[i] = Le(o[i] || a, e[s], t, n));
-                return jt(Be(o, 1), t, n)
+                return jt(ze(o, 1), t, n)
             }
 
-            function zt(e, t, n) {
+            function Bt(e, t, n) {
                 for (var r = -1, i = e.length, o = t.length, a = {}; ++r < i;) {
                     var s = r < o ? t[r] : na;
                     n(a, e[r], s)
                 return a
             }
 
-            function Bt(e) {
+            function zt(e) {
                 return Ei(e) ? e : []
             }
 
 
             function Kt(e, t, n) {
                 var r = e.length;
-                return n = n === na ? r : n, !t && r <= n ? e : Ot(e, t, n)
+                return n = n === na ? r : n, !t && r <= n ? e : Dt(e, t, n)
             }
             var Zt = P || function(e) {
                 return xs.clearTimeout(e)
 
             function an(i, o) {
                 return function(e, t) {
-                    var n = _i(e) ? Rs : Oe,
+                    var n = _i(e) ? Rs : De,
                         r = o ? o() : {};
                     return n(e, i, Hn(t, 2), r)
                 }
 
             function dn(t) {
                 return function(e) {
-                    return zs(Mo(_o(e).replace(gs, "")), t, "")
+                    return Bs(Mo(_o(e).replace(gs, "")), t, "")
                 }
             }
 
             }
 
             function pn(l) {
-                return On(function(i) {
+                return Dn(function(i) {
                     var o = i.length,
                         e = o,
                         t = ve.prototype.thru;
             }
 
             function bn(r) {
-                return On(function(e) {
+                return Dn(function(e) {
                     return e = Us(e, rl(Hn())), Ct(function(t) {
                         var n = this;
                         return r(e, function(e) {
             function En(e) {
                 var r = o[e];
                 return function(e, t) {
-                    if (e = Wi(e), t = null == t ? 0 : Y(zi(t), 292)) {
+                    if (e = Wi(e), (t = null == t ? 0 : Y(Bi(t), 292)) && V(e)) {
                         var n = (Gi(e) + "e").split("e");
                         return +((n = (Gi(r(n[0] + "e" + (+n[1] + t))) + "e").split("e"))[0] + "e" + (+n[1] - t))
                     }
                 var l = 2 & t;
                 if (!l && "function" != typeof e) throw new A(ra);
                 var c = r ? r.length : 0;
-                if (c || (t &= -97, r = i = na), a = a === na ? a : W(zi(a), 0), s = s === na ? s : zi(s), c -= i ? i.length : 0, 64 & t) {
+                if (c || (t &= -97, r = i = na), a = a === na ? a : W(Bi(a), 0), s = s === na ? s : Bi(s), c -= i ? i.length : 0, 64 & t) {
                     var u = r,
                         d = i;
                     r = i = na
                 return o.delete(e), o.delete(t), d
             }
 
-            function On(e) {
+            function Dn(e) {
                 return ar(tr(e, na, $r), e + "")
             }
 
-            function Dn(e) {
+            function On(e) {
                 return Qe(e, so, qn)
             }
 
                 } : Wo,
                 Vn = Je;
 
-            function zn(e, t, n) {
+            function Bn(e, t, n) {
                 for (var r = -1, i = (t = Yt(t, e)).length, o = !1; ++r < i;) {
                     var a = hr(t[r]);
                     if (!(o = null != e && n(e, a))) break;
                 return o || ++r != i ? o : !!(i = null == e ? 0 : e.length) && Ai(i) && Yn(a, i) && (_i(e) || yi(e))
             }
 
-            function Bn(e) {
+            function zn(e) {
                 return "function" != typeof e.constructor || Qn(e) ? {} : me(x(e))
             }
 
             function Wn(e) {
-                return _i(e) || yi(e) || !!(D && e && e[D])
+                return _i(e) || yi(e) || !!(O && e && e[O])
             }
 
             function Yn(e, t) {
             }
 
             function nr(e, t) {
-                return t.length < 2 ? e : Xe(e, Ot(t, 0, -1))
+                return t.length < 2 ? e : Xe(e, Dt(t, 0, -1))
             }
 
             function rr(e, t) {
-                if ("__proto__" != t) return e[t]
+                if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) return e[t]
             }
             var ir = lr(Mt),
                 or = j || function(e, t) {
                 return t.__actions__ = rn(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t
             }
             var gr = Ct(function(e, t) {
-                    return Ei(e) ? Le(e, Be(t, 1, Ei, !0)) : []
+                    return Ei(e) ? Le(e, ze(t, 1, Ei, !0)) : []
                 }),
                 vr = Ct(function(e, t) {
                     var n = xr(t);
-                    return Ei(n) && (n = na), Ei(e) ? Le(e, Be(t, 1, Ei, !0), Hn(n, 2)) : []
+                    return Ei(n) && (n = na), Ei(e) ? Le(e, ze(t, 1, Ei, !0), Hn(n, 2)) : []
                 }),
                 br = Ct(function(e, t) {
                     var n = xr(t);
-                    return Ei(n) && (n = na), Ei(e) ? Le(e, Be(t, 1, Ei, !0), na, n) : []
+                    return Ei(n) && (n = na), Ei(e) ? Le(e, ze(t, 1, Ei, !0), na, n) : []
                 });
 
             function yr(e, t, n) {
                 var r = null == e ? 0 : e.length;
                 if (!r) return -1;
-                var i = null == n ? 0 : zi(n);
+                var i = null == n ? 0 : Bi(n);
                 return i < 0 && (i = W(r + i, 0)), Gs(e, Hn(t, 3), i)
             }
 
                 var r = null == e ? 0 : e.length;
                 if (!r) return -1;
                 var i = r - 1;
-                return n !== na && (i = zi(n), i = n < 0 ? W(r + i, 0) : Y(i, r - 1)), Gs(e, Hn(t, 3), i, !0)
+                return n !== na && (i = Bi(n), i = n < 0 ? W(r + i, 0) : Y(i, r - 1)), Gs(e, Hn(t, 3), i, !0)
             }
 
             function $r(e) {
-                return null != e && e.length ? Be(e, 1) : []
+                return null != e && e.length ? ze(e, 1) : []
             }
 
             function wr(e) {
                 return e && e.length ? e[0] : na
             }
             var Er = Ct(function(e) {
-                    var t = Us(e, Bt);
+                    var t = Us(e, zt);
                     return t.length && t[0] === e[0] ? rt(t) : []
                 }),
                 Cr = Ct(function(e) {
                     var t = xr(e),
-                        n = Us(e, Bt);
+                        n = Us(e, zt);
                     return t === xr(n) ? t = na : n.pop(), n.length && n[0] === e[0] ? rt(n, Hn(t, 2)) : []
                 }),
                 kr = Ct(function(e) {
                     var t = xr(e),
-                        n = Us(e, Bt);
+                        n = Us(e, zt);
                     return (t = "function" == typeof t ? t : na) && n.pop(), n.length && n[0] === e[0] ? rt(n, na, t) : []
                 });
 
             function Mr(e, t) {
                 return e && e.length && t && t.length ? _t(e, t) : e
             }
-            var Ar = On(function(e, t) {
+            var Ar = Dn(function(e, t) {
                 var n = null == e ? 0 : e.length,
                     r = Ie(e, t);
                 return $t(e, Us(t, function(e) {
             function Sr(e) {
                 return null == e ? e : X.call(e)
             }
-            var Or = Ct(function(e) {
-                    return jt(Be(e, 1, Ei, !0))
+            var Dr = Ct(function(e) {
+                    return jt(ze(e, 1, Ei, !0))
                 }),
-                Dr = Ct(function(e) {
+                Or = Ct(function(e) {
                     var t = xr(e);
-                    return Ei(t) && (t = na), jt(Be(e, 1, Ei, !0), Hn(t, 2))
+                    return Ei(t) && (t = na), jt(ze(e, 1, Ei, !0), Hn(t, 2))
                 }),
                 Nr = Ct(function(e) {
                     var t = xr(e);
-                    return t = "function" == typeof t ? t : na, jt(Be(e, 1, Ei, !0), na, t)
+                    return t = "function" == typeof t ? t : na, jt(ze(e, 1, Ei, !0), na, t)
                 });
 
             function Ir(t) {
             var qr = Ct(function(e) {
                 var t = e.length,
                     n = 1 < t ? e[t - 1] : na;
-                return Rr(e, n = "function" == typeof n ? (e.pop(), n) : na)
+                return n = "function" == typeof n ? (e.pop(), n) : na, Rr(e, n)
             });
 
             function Ur(e) {
             function Vr(e, t) {
                 return t(e)
             }
-            var zr = On(function(t) {
+            var Br = Dn(function(t) {
                 var n = t.length,
                     e = n ? t[0] : 0,
                     r = this.__wrapped__,
                     return n && !e.length && e.push(na), e
                 })) : this.thru(i)
             });
-            var Br = an(function(e, t, n) {
+            var zr = an(function(e, t, n) {
                 k.call(e, n) ? ++e[n] : Ne(e, n, 1)
             });
             var Wr = hn(yr),
             var ti = Ct(function(e, t) {
                     if (null == e) return [];
                     var n = t.length;
-                    return 1 < n && Gn(e, t[0], t[1]) ? t = [] : 2 < n && Gn(t[0], t[1], t[2]) && (t = [t[0]]), bt(e, Be(t, 1), [])
+                    return 1 < n && Gn(e, t[0], t[1]) ? t = [] : 2 < n && Gn(t[0], t[1], t[2]) && (t = [t[0]]), bt(e, ze(t, 1), [])
                 }),
                 ni = H || function() {
                     return xs.Date.now()
             function ii(e, t) {
                 var n;
                 if ("function" != typeof t) throw new A(ra);
-                return e = zi(e),
+                return e = Bi(e),
                     function() {
                         return 0 < --e && (n = t.apply(this, arguments)), e <= 1 && (t = na), n
                     }
                         n = m(t);
                     if (o = arguments, a = this, u = t, n) {
                         if (c === na) return d = e = u, c = or(g, i), f ? p(e) : l;
-                        if (h) return c = or(g, i), p(u)
+                        if (h) return Zt(c), c = or(g, i), p(u)
                     }
                     return c === na && (c = or(g, i)), l
                 }
             }
             ui.Cache = $e;
             var fi = Gt(function(r, i) {
-                    var o = (i = 1 == i.length && _i(i[0]) ? Us(i[0], rl(Hn())) : Us(Be(i, 1), rl(Hn()))).length;
+                    var o = (i = 1 == i.length && _i(i[0]) ? Us(i[0], rl(Hn())) : Us(ze(i, 1), rl(Hn()))).length;
                     return Ct(function(e) {
                         for (var t = -1, n = Y(e.length, o); ++t < n;) e[t] = i[t].call(this, e[t]);
                         return Is(r, this, e)
                     var n = pl(t, Pn(pi));
                     return xn(e, 64, na, t, n)
                 }),
-                mi = On(function(e, t) {
+                mi = Dn(function(e, t) {
                     return xn(e, 256, na, na, na, t)
                 });
 
                 yi = ot(function() {
                     return arguments
                 }()) ? ot : function(e) {
-                    return Oi(e) && k.call(e, "callee") && !S.call(e, "callee")
+                    return Di(e) && k.call(e, "callee") && !S.call(e, "callee")
                 },
                 _i = M.isArray,
                 $i = Ms ? rl(Ms) : function(e) {
-                    return Oi(e) && Je(e) == xa
+                    return Di(e) && Je(e) == xa
                 };
 
             function wi(e) {
             }
 
             function Ei(e) {
-                return Oi(e) && wi(e)
+                return Di(e) && wi(e)
             }
             var Ci = U || Yo,
                 ki = As ? rl(As) : function(e) {
-                    return Oi(e) && Je(e) == ha
+                    return Di(e) && Je(e) == ha
                 };
 
             function xi(e) {
-                if (!Oi(e)) return !1;
+                if (!Di(e)) return !1;
                 var t = Je(e);
                 return t == pa || "[object DOMException]" == t || "string" == typeof e.message && "string" == typeof e.name && !Ii(e)
             }
             }
 
             function Mi(e) {
-                return "number" == typeof e && e == zi(e)
+                return "number" == typeof e && e == Bi(e)
             }
 
             function Ai(e) {
                 return null != e && ("object" == t || "function" == t)
             }
 
-            function Oi(e) {
+            function Di(e) {
                 return null != e && "object" == typeof e
             }
-            var Di = Ss ? rl(Ss) : function(e) {
-                return Oi(e) && Vn(e) == va
+            var Oi = Ss ? rl(Ss) : function(e) {
+                return Di(e) && Vn(e) == va
             };
 
             function Ni(e) {
-                return "number" == typeof e || Oi(e) && Je(e) == ba
+                return "number" == typeof e || Di(e) && Je(e) == ba
             }
 
             function Ii(e) {
-                if (!Oi(e) || Je(e) != ya) return !1;
+                if (!Di(e) || Je(e) != ya) return !1;
                 var t = x(e);
                 if (null === t) return !0;
                 var n = k.call(t, "constructor") && t.constructor;
                 return "function" == typeof n && n instanceof n && c.call(n) == m
             }
-            var Ri = Os ? rl(Os) : function(e) {
-                return Oi(e) && Je(e) == $a
+            var Ri = Ds ? rl(Ds) : function(e) {
+                return Di(e) && Je(e) == $a
             };
-            var Pi = Ds ? rl(Ds) : function(e) {
-                return Oi(e) && Vn(e) == wa
+            var Pi = Os ? rl(Os) : function(e) {
+                return Di(e) && Vn(e) == wa
             };
 
             function Hi(e) {
-                return "string" == typeof e || !_i(e) && Oi(e) && Je(e) == Ea
+                return "string" == typeof e || !_i(e) && Di(e) && Je(e) == Ea
             }
 
             function ji(e) {
-                return "symbol" == typeof e || Oi(e) && Je(e) == Ca
+                return "symbol" == typeof e || Di(e) && Je(e) == Ca
             }
             var Li = Ns ? rl(Ns) : function(e) {
-                return Oi(e) && Ai(e.length) && !!ws[Je(e)]
+                return Di(e) && Ai(e.length) && !!ws[Je(e)]
             };
             var Fi = $n(ft),
                 qi = $n(function(e, t) {
                 return e ? (e = Wi(e)) !== 1 / 0 && e !== -1 / 0 ? e == e ? e : 0 : 17976931348623157e292 * (e < 0 ? -1 : 1) : 0 === e ? e : 0
             }
 
-            function zi(e) {
+            function Bi(e) {
                 var t = Vi(e),
                     n = t % 1;
                 return t == t ? n ? t - n : t : 0
             }
 
-            function Bi(e) {
-                return e ? Re(zi(e), 0, la) : 0
+            function zi(e) {
+                return e ? Re(Bi(e), 0, la) : 0
             }
 
             function Wi(e) {
                 Qi = sn(function(e, t, n, r) {
                     on(t, so(t), e, r)
                 }),
-                Ji = On(Ie);
+                Ji = Dn(Ie);
             var eo = Ct(function(e, t) {
                     e = C(e);
                     var n = -1,
             }
 
             function ro(e, t) {
-                return null != e && zn(e, t, nt)
+                return null != e && Bn(e, t, nt)
             }
             var io = gn(function(e, t, n) {
                     null != t && "function" != typeof t.toString && (t = p.call(t)), e[t] = n
-                }, Oo(Io)),
+                }, Do(Io)),
                 oo = gn(function(e, t, n) {
                     null != t && "function" != typeof t.toString && (t = p.call(t)), k.call(e, t) ? e[t].push(n) : e[t] = [n]
                 }, Hn),
                 uo = sn(function(e, t, n, r) {
                     gt(e, t, n, r)
                 }),
-                fo = On(function(t, e) {
+                fo = Dn(function(t, e) {
                     var n = {};
                     if (null == t) return n;
                     var r = !1;
                     for (var i = e.length; i--;) Lt(n, e[i]);
                     return n
                 });
-            var ho = On(function(e, t) {
+            var ho = Dn(function(e, t) {
                 return null == e ? {} : yt(n = e, t, function(e, t) {
                     return ro(n, t)
                 });
                         return xi(e) ? e : new i(e)
                     }
                 }),
-                So = On(function(t, e) {
+                So = Dn(function(t, e) {
                     return Ps(e, function(e) {
                         e = hr(e), Ne(t, e, oi(t[e], t))
                     }), t
                 });
 
-            function Oo(e) {
+            function Do(e) {
                 return function() {
                     return e
                 }
             }
-            var Do = pn(),
+            var Oo = pn(),
                 No = pn(!0);
 
             function Io(e) {
                 });
                 var t
             }
-            var zo = _n(),
-                Bo = _n(!0);
+            var Bo = _n(),
+                zo = _n(!0);
 
             function Wo() {
                 return []
                 }, 0);
             return pe.after = function(e, t) {
                 if ("function" != typeof t) throw new A(ra);
-                return e = zi(e),
+                return e = Bi(e),
                     function() {
                         if (--e < 1) return t.apply(this, arguments)
                     }
                 var e = arguments[0];
                 return _i(e) ? e : [e]
             }, pe.chain = Ur, pe.chunk = function(e, t, n) {
-                t = (n ? Gn(e, t, n) : t === na) ? 1 : W(zi(t), 0);
+                t = (n ? Gn(e, t, n) : t === na) ? 1 : W(Bi(t), 0);
                 var r = null == e ? 0 : e.length;
                 if (!r || t < 1) return [];
-                for (var i = 0, o = 0, a = M(L(r / t)); i < r;) a[o++] = Ot(e, i, i += t);
+                for (var i = 0, o = 0, a = M(L(r / t)); i < r;) a[o++] = Dt(e, i, i += t);
                 return a
             }, pe.compact = function(e) {
                 for (var t = -1, n = null == e ? 0 : e.length, r = 0, i = []; ++t < n;) {
                 var e = arguments.length;
                 if (!e) return [];
                 for (var t = M(e - 1), n = arguments[0], r = e; r--;) t[r - 1] = arguments[r];
-                return Vs(_i(n) ? rn(n) : [n], Be(t, 1))
+                return Vs(_i(n) ? rn(n) : [n], ze(t, 1))
             }, pe.cond = function(r) {
                 var i = null == r ? 0 : r.length,
                     t = Hn();
                         return He(e, t, n)
                     };
                 var t, n
-            }, pe.constant = Oo, pe.countBy = Br, pe.create = function(e, t) {
+            }, pe.constant = Do, pe.countBy = zr, pe.create = function(e, t) {
                 var n = me(e);
-                return null == t ? n : De(n, t)
+                return null == t ? n : Oe(n, t)
             }, pe.curry = function e(t, n, r) {
                 var i = xn(t, 8, na, na, na, na, na, n = r ? na : n);
                 return i.placeholder = e.placeholder, i
                 return i.placeholder = e.placeholder, i
             }, pe.debounce = si, pe.defaults = eo, pe.defaultsDeep = to, pe.defer = li, pe.delay = ci, pe.difference = gr, pe.differenceBy = vr, pe.differenceWith = br, pe.drop = function(e, t, n) {
                 var r = null == e ? 0 : e.length;
-                return r ? Ot(e, (t = n || t === na ? 1 : zi(t)) < 0 ? 0 : t, r) : []
+                return r ? Dt(e, (t = n || t === na ? 1 : Bi(t)) < 0 ? 0 : t, r) : []
             }, pe.dropRight = function(e, t, n) {
                 var r = null == e ? 0 : e.length;
-                return r ? Ot(e, 0, (t = r - (t = n || t === na ? 1 : zi(t))) < 0 ? 0 : t) : []
+                return r ? Dt(e, 0, (t = r - (t = n || t === na ? 1 : Bi(t))) < 0 ? 0 : t) : []
             }, pe.dropRightWhile = function(e, t) {
                 return e && e.length ? qt(e, Hn(t, 3), !0, !0) : []
             }, pe.dropWhile = function(e, t) {
                 var i = null == e ? 0 : e.length;
                 return i ? (n && "number" != typeof n && Gn(e, t, n) && (n = 0, r = i), function(e, t, n, r) {
                     var i = e.length;
-                    for ((n = zi(n)) < 0 && (n = i < -n ? 0 : i + n), (r = r === na || i < r ? i : zi(r)) < 0 && (r += i), r = r < n ? 0 : Bi(r); n < r;) e[n++] = t;
+                    for ((n = Bi(n)) < 0 && (n = i < -n ? 0 : i + n), (r = r === na || i < r ? i : Bi(r)) < 0 && (r += i), r = r < n ? 0 : zi(r); n < r;) e[n++] = t;
                     return e
                 }(e, t, n, r)) : []
             }, pe.filter = function(e, t) {
-                return (_i(e) ? Ls : ze)(e, Hn(t, 3))
+                return (_i(e) ? Ls : Be)(e, Hn(t, 3))
             }, pe.flatMap = function(e, t) {
-                return Be(Jr(e, t), 1)
+                return ze(Jr(e, t), 1)
             }, pe.flatMapDeep = function(e, t) {
-                return Be(Jr(e, t), 1 / 0)
+                return ze(Jr(e, t), 1 / 0)
             }, pe.flatMapDepth = function(e, t, n) {
-                return n = n === na ? 1 : zi(n), Be(Jr(e, t), n)
+                return n = n === na ? 1 : Bi(n), ze(Jr(e, t), n)
             }, pe.flatten = $r, pe.flattenDeep = function(e) {
-                return null != e && e.length ? Be(e, 1 / 0) : []
+                return null != e && e.length ? ze(e, 1 / 0) : []
             }, pe.flattenDepth = function(e, t) {
-                return null != e && e.length ? Be(e, t = t === na ? 1 : zi(t)) : []
+                return null != e && e.length ? ze(e, t = t === na ? 1 : Bi(t)) : []
             }, pe.flip = function(e) {
                 return xn(e, 512)
-            }, pe.flow = Do, pe.flowRight = No, pe.fromPairs = function(e) {
+            }, pe.flow = Oo, pe.flowRight = No, pe.fromPairs = function(e) {
                 for (var t = -1, n = null == e ? 0 : e.length, r = {}; ++t < n;) {
                     var i = e[t];
                     r[i[0]] = i[1]
             }, pe.functionsIn = function(e) {
                 return null == e ? [] : Ze(e, lo(e))
             }, pe.groupBy = Zr, pe.initial = function(e) {
-                return null != e && e.length ? Ot(e, 0, -1) : []
+                return null != e && e.length ? Dt(e, 0, -1) : []
             }, pe.intersection = Er, pe.intersectionBy = Cr, pe.intersectionWith = kr, pe.invert = io, pe.invertBy = oo, pe.invokeMap = Xr, pe.iteratee = Ro, pe.keyBy = Qr, pe.keys = so, pe.keysIn = lo, pe.map = Jr, pe.mapKeys = function(e, r) {
                 var i = {};
                 return r = Hn(r, 3), Ge(e, function(e, t, n) {
             }, pe.matchesProperty = function(e, t) {
                 return mt(e, Pe(t, 1))
             }, pe.memoize = ui, pe.merge = co, pe.mergeWith = uo, pe.method = Po, pe.methodOf = Ho, pe.mixin = jo, pe.negate = di, pe.nthArg = function(t) {
-                return t = zi(t), Ct(function(e) {
+                return t = Bi(t), Ct(function(e) {
                     return vt(e, t)
                 })
             }, pe.omit = fo, pe.omitBy = function(e, t) {
                 return e && e.length && t && t.length ? _t(e, t, Hn(n, 2)) : e
             }, pe.pullAllWith = function(e, t, n) {
                 return e && e.length && t && t.length ? _t(e, t, na, n) : e
-            }, pe.pullAt = Ar, pe.range = zo, pe.rangeRight = Bo, pe.rearg = mi, pe.reject = function(e, t) {
-                return (_i(e) ? Ls : ze)(e, di(Hn(t, 3)))
+            }, pe.pullAt = Ar, pe.range = Bo, pe.rangeRight = zo, pe.rearg = mi, pe.reject = function(e, t) {
+                return (_i(e) ? Ls : Be)(e, di(Hn(t, 3)))
             }, pe.remove = function(e, t) {
                 var n = [];
                 if (!e || !e.length) return n;
                 return $t(e, i), n
             }, pe.rest = function(e, t) {
                 if ("function" != typeof e) throw new A(ra);
-                return Ct(e, t = t === na ? t : zi(t))
+                return Ct(e, t = t === na ? t : Bi(t))
             }, pe.reverse = Sr, pe.sampleSize = function(e, t, n) {
-                return t = (n ? Gn(e, t, n) : t === na) ? 1 : zi(t), (_i(e) ? xe : xt)(e, t)
+                return t = (n ? Gn(e, t, n) : t === na) ? 1 : Bi(t), (_i(e) ? xe : xt)(e, t)
             }, pe.set = function(e, t, n) {
                 return null == e ? e : Tt(e, t, n)
             }, pe.setWith = function(e, t, n, r) {
                 return (_i(e) ? Te : St)(e)
             }, pe.slice = function(e, t, n) {
                 var r = null == e ? 0 : e.length;
-                return r ? Ot(e, t, n = n && "number" != typeof n && Gn(e, t, n) ? (t = 0, r) : (t = null == t ? 0 : zi(t), n === na ? r : zi(n))) : []
+                return r ? (n = n && "number" != typeof n && Gn(e, t, n) ? (t = 0, r) : (t = null == t ? 0 : Bi(t), n === na ? r : Bi(n)), Dt(e, t, n)) : []
             }, pe.sortBy = ti, pe.sortedUniq = function(e) {
                 return e && e.length ? Rt(e) : []
             }, pe.sortedUniqBy = function(e, t) {
                 return n && "number" != typeof n && Gn(e, t, n) && (t = n = na), (n = n === na ? la : n >>> 0) ? (e = Gi(e)) && ("string" == typeof t || null != t && !Ri(t)) && !(t = Ht(t)) && dl(e) ? Kt(vl(e), 0, n) : e.split(t, n) : []
             }, pe.spread = function(r, i) {
                 if ("function" != typeof r) throw new A(ra);
-                return i = null == i ? 0 : W(zi(i), 0), Ct(function(e) {
+                return i = null == i ? 0 : W(Bi(i), 0), Ct(function(e) {
                     var t = e[i],
                         n = Kt(e, 0, i);
                     return t && Vs(n, t), Is(r, this, n)
                 })
             }, pe.tail = function(e) {
                 var t = null == e ? 0 : e.length;
-                return t ? Ot(e, 1, t) : []
+                return t ? Dt(e, 1, t) : []
             }, pe.take = function(e, t, n) {
-                return e && e.length ? Ot(e, 0, (t = n || t === na ? 1 : zi(t)) < 0 ? 0 : t) : []
+                return e && e.length ? Dt(e, 0, (t = n || t === na ? 1 : Bi(t)) < 0 ? 0 : t) : []
             }, pe.takeRight = function(e, t, n) {
                 var r = null == e ? 0 : e.length;
-                return r ? Ot(e, (t = r - (t = n || t === na ? 1 : zi(t))) < 0 ? 0 : t, r) : []
+                return r ? Dt(e, (t = r - (t = n || t === na ? 1 : Bi(t))) < 0 ? 0 : t, r) : []
             }, pe.takeRightWhile = function(e, t) {
                 return e && e.length ? qt(e, Hn(t, 3), !1, !0) : []
             }, pe.takeWhile = function(e, t) {
                 }), i
             }, pe.unary = function(e) {
                 return ri(e, 1)
-            }, pe.union = Or, pe.unionBy = Dr, pe.unionWith = Nr, pe.uniq = function(e) {
+            }, pe.union = Dr, pe.unionBy = Or, pe.unionWith = Nr, pe.uniq = function(e) {
                 return e && e.length ? jt(e) : []
             }, pe.uniqBy = function(e, t) {
                 return e && e.length ? jt(e, Hn(t, 2)) : []
             }, pe.without = Pr, pe.words = Mo, pe.wrap = function(e, t) {
                 return hi(Wt(t), e)
             }, pe.xor = Hr, pe.xorBy = jr, pe.xorWith = Lr, pe.zip = Fr, pe.zipObject = function(e, t) {
-                return zt(e || [], t || [], Ae)
+                return Bt(e || [], t || [], Ae)
             }, pe.zipObjectDeep = function(e, t) {
-                return zt(e || [], t || [], Tt)
+                return Bt(e || [], t || [], Tt)
             }, pe.zipWith = qr, pe.entries = mo, pe.entriesIn = go, pe.extend = Zi, pe.extendWith = Xi, jo(pe, pe), pe.add = Go, pe.attempt = Ao, pe.camelCase = bo, pe.capitalize = yo, pe.ceil = Ko, pe.clamp = function(e, t, n) {
                 return n === na && (n = t, t = na), n !== na && (n = (n = Wi(n)) == n ? n : 0), t !== na && (t = (t = Wi(t)) == t ? t : 0), Re(Wi(e), t, n)
             }, pe.clone = function(e) {
             }, pe.divide = Zo, pe.endsWith = function(e, t, n) {
                 e = Gi(e), t = Ht(t);
                 var r = e.length,
-                    i = n = n === na ? r : Re(zi(n), 0, r);
+                    i = n = n === na ? r : Re(Bi(n), 0, r);
                 return 0 <= (n -= t.length) && e.slice(n, i) == t
             }, pe.eq = gi, pe.escape = function(e) {
                 return (e = Gi(e)) && Va.test(e) ? e.replace(qa, cl) : e
             }, pe.forOwnRight = function(e, t) {
                 return e && Ke(e, Hn(t, 3))
             }, pe.get = no, pe.gt = vi, pe.gte = bi, pe.has = function(e, t) {
-                return null != e && zn(e, t, tt)
+                return null != e && Bn(e, t, tt)
             }, pe.hasIn = ro, pe.head = wr, pe.identity = Io, pe.includes = function(e, t, n, r) {
-                e = wi(e) ? e : vo(e), n = n && !r ? zi(n) : 0;
+                e = wi(e) ? e : vo(e), n = n && !r ? Bi(n) : 0;
                 var i = e.length;
                 return n < 0 && (n = W(i + n, 0)), Hi(e) ? n <= i && -1 < e.indexOf(t, n) : !!i && -1 < Ks(e, t, n)
             }, pe.indexOf = function(e, t, n) {
                 var r = null == e ? 0 : e.length;
                 if (!r) return -1;
-                var i = null == n ? 0 : zi(n);
+                var i = null == n ? 0 : Bi(n);
                 return i < 0 && (i = W(r + i, 0)), Ks(e, t, i)
             }, pe.inRange = function(e, t, n) {
                 return t = Vi(t), n === na ? (n = t, t = 0) : n = Vi(n), e = Wi(e), (r = e) >= Y(i = t, o = n) && r < W(i, o);
                 var r, i, o
             }, pe.invoke = ao, pe.isArguments = yi, pe.isArray = _i, pe.isArrayBuffer = $i, pe.isArrayLike = wi, pe.isArrayLikeObject = Ei, pe.isBoolean = function(e) {
-                return !0 === e || !1 === e || Oi(e) && Je(e) == fa
+                return !0 === e || !1 === e || Di(e) && Je(e) == fa
             }, pe.isBuffer = Ci, pe.isDate = ki, pe.isElement = function(e) {
-                return Oi(e) && 1 === e.nodeType && !Ii(e)
+                return Di(e) && 1 === e.nodeType && !Ii(e)
             }, pe.isEmpty = function(e) {
                 if (null == e) return !0;
                 if (wi(e) && (_i(e) || "string" == typeof e || "function" == typeof e.splice || Ci(e) || Li(e) || yi(e))) return !e.length;
                 return r === na ? at(e, t, na, n) : !!r
             }, pe.isError = xi, pe.isFinite = function(e) {
                 return "number" == typeof e && V(e)
-            }, pe.isFunction = Ti, pe.isInteger = Mi, pe.isLength = Ai, pe.isMap = Di, pe.isMatch = function(e, t) {
+            }, pe.isFunction = Ti, pe.isInteger = Mi, pe.isLength = Ai, pe.isMap = Oi, pe.isMatch = function(e, t) {
                 return e === t || st(e, t, Ln(t))
             }, pe.isMatchWith = function(e, t, n) {
                 return n = "function" == typeof n ? n : na, st(e, t, Ln(t), n)
                 return null == e
             }, pe.isNull = function(e) {
                 return null === e
-            }, pe.isNumber = Ni, pe.isObject = Si, pe.isObjectLike = Oi, pe.isPlainObject = Ii, pe.isRegExp = Ri, pe.isSafeInteger = function(e) {
+            }, pe.isNumber = Ni, pe.isObject = Si, pe.isObjectLike = Di, pe.isPlainObject = Ii, pe.isRegExp = Ri, pe.isSafeInteger = function(e) {
                 return Mi(e) && -aa <= e && e <= aa
             }, pe.isSet = Pi, pe.isString = Hi, pe.isSymbol = ji, pe.isTypedArray = Li, pe.isUndefined = function(e) {
                 return e === na
             }, pe.isWeakMap = function(e) {
-                return Oi(e) && Vn(e) == ka
+                return Di(e) && Vn(e) == ka
             }, pe.isWeakSet = function(e) {
-                return Oi(e) && "[object WeakSet]" == Je(e)
+                return Di(e) && "[object WeakSet]" == Je(e)
             }, pe.join = function(e, t) {
-                return null == e ? "" : z.call(e, t)
+                return null == e ? "" : B.call(e, t)
             }, pe.kebabCase = $o, pe.last = xr, pe.lastIndexOf = function(e, t, n) {
                 var r = null == e ? 0 : e.length;
                 if (!r) return -1;
                 var i = r;
-                return n !== na && (i = (i = zi(n)) < 0 ? W(r + i, 0) : Y(i, r - 1)), t == t ? function(e, t, n) {
+                return n !== na && (i = (i = Bi(n)) < 0 ? W(r + i, 0) : Y(i, r - 1)), t == t ? function(e, t, n) {
                     for (var r = n + 1; r--;)
                         if (e[r] === t) return r;
                     return r
             }, pe.stubTrue = function() {
                 return !0
             }, pe.multiply = Jo, pe.nth = function(e, t) {
-                return e && e.length ? vt(e, zi(t)) : na
+                return e && e.length ? vt(e, Bi(t)) : na
             }, pe.noConflict = function() {
                 return xs._ === this && (xs._ = b), this
             }, pe.noop = Lo, pe.now = ni, pe.pad = function(e, t, n) {
                 e = Gi(e);
-                var r = (t = zi(t)) ? gl(e) : 0;
+                var r = (t = Bi(t)) ? gl(e) : 0;
                 if (!t || t <= r) return e;
                 var i = (t - r) / 2;
                 return yn(F(i), n) + e + yn(L(i), n)
             }, pe.padEnd = function(e, t, n) {
                 e = Gi(e);
-                var r = (t = zi(t)) ? gl(e) : 0;
+                var r = (t = Bi(t)) ? gl(e) : 0;
                 return t && r < t ? e + yn(t - r, n) : e
             }, pe.padStart = function(e, t, n) {
                 e = Gi(e);
-                var r = (t = zi(t)) ? gl(e) : 0;
+                var r = (t = Bi(t)) ? gl(e) : 0;
                 return t && r < t ? yn(t - r, n) + e : e
             }, pe.parseInt = function(e, t, n) {
                 return n || null == t ? t = 0 : t && (t = +t), K(Gi(e).replace(Ja, ""), t || 0)
                 }
                 return wt(e, t)
             }, pe.reduce = function(e, t, n) {
-                var r = _i(e) ? zs : el,
+                var r = _i(e) ? Bs : el,
                     i = arguments.length < 3;
                 return r(e, Hn(t, 4), n, i, Fe)
             }, pe.reduceRight = function(e, t, n) {
-                var r = _i(e) ? Bs : el,
+                var r = _i(e) ? zs : el,
                     i = arguments.length < 3;
                 return r(e, Hn(t, 4), n, i, qe)
             }, pe.repeat = function(e, t, n) {
-                return t = (n ? Gn(e, t, n) : t === na) ? 1 : zi(t), Et(Gi(e), t)
+                return t = (n ? Gn(e, t, n) : t === na) ? 1 : Bi(t), Et(Gi(e), t)
             }, pe.replace = function() {
                 var e = arguments,
                     t = Gi(e[0]);
                 var t = Vn(e);
                 return t == va || t == wa ? e.size : ut(e).length
             }, pe.snakeCase = Co, pe.some = function(e, t, n) {
-                var r = _i(e) ? Ws : Dt;
+                var r = _i(e) ? Ws : Ot;
                 return n && Gn(e, t, n) && (t = na), r(e, Hn(t, 3))
             }, pe.sortedIndex = function(e, t) {
                 return Nt(e, t)
                 }
                 return -1
             }, pe.startCase = ko, pe.startsWith = function(e, t, n) {
-                return e = Gi(e), n = null == n ? 0 : Re(zi(n), 0, e.length), t = Ht(t), e.slice(n, n + t.length) == t
+                return e = Gi(e), n = null == n ? 0 : Re(Bi(n), 0, e.length), t = Ht(t), e.slice(n, n + t.length) == t
             }, pe.subtract = ta, pe.sum = function(e) {
                 return e && e.length ? tl(e, Io) : 0
             }, pe.sumBy = function(e, t) {
                     u = e.interpolate || ps,
                     d = "__p += '",
                     f = v((e.escape || ps).source + "|" + u.source + "|" + (u === Wa ? as : ps).source + "|" + (e.evaluate || ps).source + "|$", "g"),
-                    h = "//# sourceURL=" + ("sourceURL" in e ? e.sourceURL : "lodash.templateSources[" + ++$s + "]") + "\n";
+                    h = "//# sourceURL=" + (k.call(e, "sourceURL") ? (e.sourceURL + "").replace(/[\r\n]/g, " ") : "lodash.templateSources[" + ++$s + "]") + "\n";
                 a.replace(f, function(e, t, n, r, i, o) {
                     return n || (n = r), d += a.slice(c, o).replace(ms, ul), t && (s = !0, d += "' +\n__e(" + t + ") +\n'"), i && (l = !0, d += "';\n" + i + ";\n__p += '"), n && (d += "' +\n((__t = (" + n + ")) == null ? '' : __t) +\n'"), c = o + e.length, e
                 }), d += "';\n";
-                var p = e.variable;
+                var p = k.call(e, "variable") && e.variable;
                 p || (d = "with (obj) {\n" + d + "\n}\n"), d = (l ? d.replace(Ha, "") : d).replace(ja, "$1").replace(La, "$1;"), d = "function(" + (p || "obj") + ") {\n" + (p ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (s ? ", __e = _.escape" : "") + (l ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + d + "return __p\n}";
                 var m = Ao(function() {
                     return g(i, h + "return " + d).apply(na, o)
                 if (m.source = d, xi(m)) throw m;
                 return m
             }, pe.times = function(e, t) {
-                if ((e = zi(e)) < 1 || aa < e) return [];
+                if ((e = Bi(e)) < 1 || aa < e) return [];
                 var n = la,
                     r = Y(e, la);
                 t = Hn(t), e -= la;
                 for (var i = nl(r, t); ++n < e;) t(n);
                 return i
-            }, pe.toFinite = Vi, pe.toInteger = zi, pe.toLength = Bi, pe.toLower = function(e) {
+            }, pe.toFinite = Vi, pe.toInteger = Bi, pe.toLength = zi, pe.toLower = function(e) {
                 return Gi(e).toLowerCase()
             }, pe.toNumber = Wi, pe.toSafeInteger = function(e) {
-                return e ? Re(zi(e), -aa, aa) : 0 === e ? e : 0
+                return e ? Re(Bi(e), -aa, aa) : 0 === e ? e : 0
             }, pe.toString = Gi, pe.toUpper = function(e) {
                 return Gi(e).toUpperCase()
             }, pe.trim = function(e, t, n) {
                     r = "...";
                 if (Si(t)) {
                     var i = "separator" in t ? t.separator : i;
-                    n = "length" in t ? zi(t.length) : n, r = "omission" in t ? Ht(t.omission) : r
+                    n = "length" in t ? Bi(t.length) : n, r = "omission" in t ? Ht(t.omission) : r
                 }
                 var o = (e = Gi(e)).length;
                 if (dl(e)) {
                 k.call(pe.prototype, t) || (Qo[t] = e)
             }), Qo), {
                 chain: !1
-            }), pe.VERSION = "4.17.11", Ps(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e) {
+            }), pe.VERSION = "4.17.15", Ps(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(e) {
                 pe[e].placeholder = pe
             }), Ps(["drop", "take"], function(n, r) {
                 be.prototype[n] = function(e) {
-                    e = e === na ? 1 : W(zi(e), 0);
+                    e = e === na ? 1 : W(Bi(e), 0);
                     var t = this.__filtered__ && !r ? new be(this) : this.clone();
                     return t.__filtered__ ? t.__takeCount__ = Y(e, t.__takeCount__) : t.__views__.push({
                         size: Y(e, la),
             }), be.prototype.reject = function(e) {
                 return this.filter(di(Hn(e)))
             }, be.prototype.slice = function(e, t) {
-                e = zi(e);
+                e = Bi(e);
                 var n = this;
-                return n.__filtered__ && (0 < e || t < 0) ? new be(n) : (e < 0 ? n = n.takeRight(-e) : e && (n = n.drop(e)), t !== na && (n = (t = zi(t)) < 0 ? n.dropRight(-t) : n.take(t - e)), n)
+                return n.__filtered__ && (0 < e || t < 0) ? new be(n) : (e < 0 ? n = n.takeRight(-e) : e && (n = n.drop(e)), t !== na && (n = (t = Bi(t)) < 0 ? n.dropRight(-t) : n.take(t - e)), n)
             }, be.prototype.takeRightWhile = function(e) {
                 return this.reverse().takeWhile(e).reverse()
             }, be.prototype.toArray = function() {
                 var n = pe[t];
                 if (n) {
                     var r = n.name + "";
-                    (oe[r] || (oe[r] = [])).push({
+                    k.call(oe, r) || (oe[r] = []), oe[r].push({
                         name: t,
                         func: n
                     })
                     p[f++] = g
                 }
                 return p
-            }, pe.prototype.at = zr, pe.prototype.chain = function() {
+            }, pe.prototype.at = Br, pe.prototype.chain = function() {
                 return Ur(this)
             }, pe.prototype.commit = function() {
                 return new ve(this.value(), this.__chain__)
             M = t.isUndefined,
             A = t.isNumber,
             S = t.isObject,
-            O = t.isArray,
-            D = t.isString,
+            D = t.isArray,
+            O = t.isString,
             N = t.extend,
             I = t.toJson;
         t.module("LocalStorageModule", []).provider("localStorageService", function() {
                     }(),
                     $ = function(e, t, n, r) {
                         if (M(t)) return !1;
-                        if ((O(t) || S(t)) && (t = I(t)), !_) return l.$broadcast("LocalStorageModule.notification.error", "COOKIES_NOT_SUPPORTED"), !1;
+                        if ((D(t) || S(t)) && (t = I(t)), !_) return l.$broadcast("LocalStorageModule.notification.error", "COOKIES_NOT_SUPPORTED"), !1;
                         try {
                             var i = "",
                                 o = new Date,
                     };
 
                 function e(e) {
-                    if (e || (e = o.event), i.setItem && D(e.key) && m(e.key)) {
+                    if (e || (e = o.event), i.setItem && O(e.key) && m(e.key)) {
                         var t = r(e.key);
                         n(function() {
                             l.$broadcast("LocalStorageModule.notification.changed", {
             return e
         }
 
-        function z(e, n) {
+        function B(e, n) {
             for (var t in n = n || {}, s.forEach(n, function(e, t) {
                     delete n[t]
                 }), e) !e.hasOwnProperty(t) || "$" === t.charAt(0) && "$" === t.charAt(1) || (n[t] = e[t]);
             return n
         }
         s.module("ngResource", ["ng"]).info({
-            angularVersion: "1.7.5"
+            angularVersion: "1.7.8"
         }).provider("$resource", function() {
             var f = /^https?:\/\/\[[^\]]*][^/]*/,
                 a = this;
                     function(e, A, t, n) {
                         var S = new o(e, n);
 
-                        function O(e) {
+                        function D(e) {
                             return e.resource
                         }
 
-                        function D(e) {
-                            z(e || {}, this)
+                        function O(e) {
+                            B(e || {}, this)
                         }
-                        return t = j({}, a.defaults.actions, t), D.prototype.toJSON = function() {
+                        return t = j({}, a.defaults.actions, t), O.prototype.toJSON = function() {
                             var e = j({}, this);
                             return delete e.$promise, delete e.$resolved, delete e.$cancelRequest, e
                         }, H(t, function(C, k) {
                             var x = !0 === C.hasBody || !1 !== C.hasBody && /^(POST|PUT|PATCH)$/i.test(C.method),
                                 T = C.timeout,
                                 M = c(C.cancellable) ? C.cancellable : S.defaults.cancellable;
-                            T && !i(T) && (r.debug("ngResource:\n  Only numeric values are allowed as `timeout`.\n  Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."), delete C.timeout, T = null), D[k] = function(e, t, n, r) {
+                            T && !i(T) && (r.debug("ngResource:\n  Only numeric values are allowed as `timeout`.\n  Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."), delete C.timeout, T = null), O[k] = function(e, t, n, r) {
                                 var i, o, a, s = {};
                                 switch (arguments.length) {
                                     case 4:
                                     default:
                                         throw U("badargs", "Expected up to 4 arguments [params, data, success, error], got {0} arguments", arguments.length)
                                 }
-                                var l, c, u, d, f, h, p = this instanceof D,
-                                    m = p ? i : C.isArray ? [] : new D(i),
+                                var l, c, u, d, f, h, p = this instanceof O,
+                                    m = p ? i : C.isArray ? [] : new O(i),
                                     g = {},
                                     v = C.interceptor && C.interceptor.request || void 0,
                                     b = C.interceptor && C.interceptor.requestError || void 0,
-                                    y = C.interceptor && C.interceptor.response || O,
+                                    y = C.interceptor && C.interceptor.response || D,
                                     _ = C.interceptor && C.interceptor.responseError || I.reject,
                                     $ = o ? function(e) {
                                         o(e, u.headers, u.status, u.statusText)
                                     if (t) {
                                         if (F(t) !== !!C.isArray) throw U("badcfg", "Error in resource configuration for action `{0}`. Expected response to contain an {1} but got an {2} (Request: {3} {4})", k, C.isArray ? "array" : "object", F(t) ? "array" : "object", g.method, g.url);
                                         if (C.isArray) m.length = 0, H(t, function(e) {
-                                            "object" == typeof e ? m.push(new D(e)) : m.push(e)
+                                            "object" == typeof e ? m.push(new O(e)) : m.push(e)
                                         });
                                         else {
                                             var n = m.$promise;
-                                            z(t, m), m.$promise = n
+                                            B(t, m), m.$promise = n
                                         }
                                     }
                                     return e.resource = m, y(u = e)
                                 })).then($, w), p ? E : (m.$promise = E, m.$resolved = !1, M && (m.$cancelRequest = function(e) {
                                     E.catch(P), null !== l && l.resolve(e)
                                 }), m)
-                            }, D.prototype["$" + k] = function(e, t, n) {
+                            }, O.prototype["$" + k] = function(e, t, n) {
                                 q(e) && (n = t, t = e, e = {});
-                                var r = D[k].call(this, e, this, t, n);
+                                var r = O[k].call(this, e, this, t, n);
                                 return r.$promise || r
                             }
-                        }), D
+                        }), O
                     }
             }]
         })
         }
 
         function g(e, t, n, r) {
-            return xt(e, t, n, r, !0).utc()
+            return Tt(e, t, n, r, !0).utc()
         }
 
         function v(e) {
             for (t in e) p(e, t) && n.push(t);
             return n
         };
-        var O = {};
+        var D = {};
 
-        function D(e, t) {
+        function O(e, t) {
             var n = e.toLowerCase();
-            O[n] = O[n + "s"] = O[t] = e
+            D[n] = D[n + "s"] = D[t] = e
         }
 
         function N(e) {
-            return "string" == typeof e ? O[e] || O[e.toLowerCase()] : void 0
+            return "string" == typeof e ? D[e] || D[e.toLowerCase()] : void 0
         }
 
         function I(e) {
         }
 
         function V(e, t) {
-            return e.isValid() ? (t = z(t, e.localeData()), F[t] = F[t] || function(r) {
+            return e.isValid() ? (t = B(t, e.localeData()), F[t] = F[t] || function(r) {
                 var e, i, t, o = r.match(j);
                 for (e = 0, i = o.length; e < i; e++) q[o[e]] ? o[e] = q[o[e]] : o[e] = (t = o[e]).match(/\[[\s\S]/) ? t.replace(/^\[|\]$/g, "") : t.replace(/\\/g, "");
                 return function(e) {
             }(t), F[t](e)) : e.localeData().invalidDate()
         }
 
-        function z(e, t) {
+        function B(e, t) {
             var n = 5;
 
             function r(e) {
             for (L.lastIndex = 0; 0 <= n && L.test(e);) e = e.replace(L, r), L.lastIndex = 0, n -= 1;
             return e
         }
-        var B = /\d/,
+        var z = /\d/,
             W = /\d\d/,
             Y = /\d{3}/,
             G = /\d{4}/,
             return e <= 9999 ? "" + e : "+" + e
         }), U(0, ["YY", 2], 0, function() {
             return this.year() % 100
-        }), U(0, ["YYYY", 4], 0, "year"), U(0, ["YYYYY", 5], 0, "year"), U(0, ["YYYYYY", 6, !0], 0, "year"), D("year", "y"), P("year", 1), le("Y", re), le("YY", Z, W), le("YYYY", ee, G), le("YYYYY", te, K), le("YYYYYY", te, K), fe(["YYYYY", "YYYYYY"], pe), fe("YYYY", function(e, t) {
+        }), U(0, ["YYYY", 4], 0, "year"), U(0, ["YYYYY", 5], 0, "year"), U(0, ["YYYYYY", 6, !0], 0, "year"), O("year", "y"), P("year", 1), le("Y", re), le("YY", Z, W), le("YYYY", ee, G), le("YYYYY", te, K), le("YYYYYY", te, K), fe(["YYYYY", "YYYYYY"], pe), fe("YYYY", function(e, t) {
             t[pe] = 2 === e.length ? f.parseTwoDigitYear(e) : C(e)
         }), fe("YY", function(e, t) {
             t[pe] = f.parseTwoDigitYear(e)
             return this.localeData().monthsShort(this, e)
         }), U("MMMM", 0, 0, function(e) {
             return this.localeData().months(this, e)
-        }), D("month", "M"), P("month", 8), le("M", Z), le("MM", Z, W), le("MMM", function(e, t) {
+        }), O("month", "M"), P("month", 8), le("M", Z), le("MM", Z, W), le("MMM", function(e, t) {
             return t.monthsShortRegex(e)
         }), le("MMMM", function(e, t) {
             return t.monthsRegex(e)
             var i = n._locale.monthsParse(e, r, n._strict);
             null != i ? t[me] = i : v(n).invalidMonth = e
         });
-        var Oe = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
-            De = "January_February_March_April_May_June_July_August_September_October_November_December".split("_");
+        var De = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
+            Oe = "January_February_March_April_May_June_July_August_September_October_November_December".split("_");
         var Ne = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");
 
         function Ie(e, t) {
         }
 
         function Le(e) {
-            var t = new Date(Date.UTC.apply(null, arguments));
-            return e < 100 && 0 <= e && isFinite(t.getUTCFullYear()) && t.setUTCFullYear(e), t
+            var t;
+            if (e < 100 && 0 <= e) {
+                var n = Array.prototype.slice.call(arguments);
+                n[0] = e + 400, t = new Date(Date.UTC.apply(null, n)), isFinite(t.getUTCFullYear()) && t.setUTCFullYear(e)
+            } else t = new Date(Date.UTC.apply(null, arguments));
+            return t
         }
 
         function Fe(e, t, n) {
                 i = Fe(e + 1, t, n);
             return (Ee(e) - r + i) / 7
         }
-        U("w", ["ww", 2], "wo", "week"), U("W", ["WW", 2], "Wo", "isoWeek"), D("week", "w"), D("isoWeek", "W"), P("week", 5), P("isoWeek", 5), le("w", Z), le("ww", Z, W), le("W", Z), le("WW", Z, W), he(["w", "ww", "W", "WW"], function(e, t, n, r) {
+        U("w", ["ww", 2], "wo", "week"), U("W", ["WW", 2], "Wo", "isoWeek"), O("week", "w"), O("isoWeek", "W"), P("week", 5), P("isoWeek", 5), le("w", Z), le("ww", Z, W), le("W", Z), le("WW", Z, W), he(["w", "ww", "W", "WW"], function(e, t, n, r) {
             t[r.substr(0, 1)] = C(e)
         });
+
+        function Be(e, t) {
+            return e.slice(t, 7).concat(e.slice(0, t))
+        }
         U("d", 0, "do", "day"), U("dd", 0, 0, function(e) {
             return this.localeData().weekdaysMin(this, e)
         }), U("ddd", 0, 0, function(e) {
             return this.localeData().weekdaysShort(this, e)
         }), U("dddd", 0, 0, function(e) {
             return this.localeData().weekdays(this, e)
-        }), U("e", 0, 0, "weekday"), U("E", 0, 0, "isoWeekday"), D("day", "d"), D("weekday", "e"), D("isoWeekday", "E"), P("day", 11), P("weekday", 11), P("isoWeekday", 11), le("d", Z), le("e", Z), le("E", Z), le("dd", function(e, t) {
+        }), U("e", 0, 0, "weekday"), U("E", 0, 0, "isoWeekday"), O("day", "d"), O("weekday", "e"), O("isoWeekday", "E"), P("day", 11), P("weekday", 11), P("isoWeekday", 11), le("d", Z), le("e", Z), le("E", Z), le("dd", function(e, t) {
             return t.weekdaysMinRegex(e)
         }), le("ddd", function(e, t) {
             return t.weekdaysShortRegex(e)
             t[r] = C(e)
         });
         var ze = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");
-        var Be = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");
-        var We = "Su_Mo_Tu_We_Th_Fr_Sa".split("_");
-        var Ye = ae;
+        var We = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");
+        var Ye = "Su_Mo_Tu_We_Th_Fr_Sa".split("_");
         var Ge = ae;
         var Ke = ae;
+        var Ze = ae;
 
-        function Ze() {
+        function Xe() {
             function e(e, t) {
                 return t.length - e.length
             }
             this._weekdaysRegex = new RegExp("^(" + c.join("|") + ")", "i"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = new RegExp("^(" + l.join("|") + ")", "i"), this._weekdaysShortStrictRegex = new RegExp("^(" + s.join("|") + ")", "i"), this._weekdaysMinStrictRegex = new RegExp("^(" + a.join("|") + ")", "i")
         }
 
-        function Xe() {
+        function Qe() {
             return this.hours() % 12 || 12
         }
 
-        function Qe(e, t) {
+        function Je(e, t) {
             U(e, 0, 0, function() {
                 return this.localeData().meridiem(this.hours(), this.minutes(), t)
             })
         }
 
-        function Je(e, t) {
+        function et(e, t) {
             return t._meridiemParse
         }
-        U("H", ["HH", 2], 0, "hour"), U("h", ["hh", 2], 0, Xe), U("k", ["kk", 2], 0, function() {
+        U("H", ["HH", 2], 0, "hour"), U("h", ["hh", 2], 0, Qe), U("k", ["kk", 2], 0, function() {
             return this.hours() || 24
         }), U("hmm", 0, 0, function() {
-            return "" + Xe.apply(this) + H(this.minutes(), 2)
+            return "" + Qe.apply(this) + H(this.minutes(), 2)
         }), U("hmmss", 0, 0, function() {
-            return "" + Xe.apply(this) + H(this.minutes(), 2) + H(this.seconds(), 2)
+            return "" + Qe.apply(this) + H(this.minutes(), 2) + H(this.seconds(), 2)
         }), U("Hmm", 0, 0, function() {
             return "" + this.hours() + H(this.minutes(), 2)
         }), U("Hmmss", 0, 0, function() {
             return "" + this.hours() + H(this.minutes(), 2) + H(this.seconds(), 2)
-        }), Qe("a", !0), Qe("A", !1), D("hour", "h"), P("hour", 13), le("a", Je), le("A", Je), le("H", Z), le("h", Z), le("k", Z), le("HH", Z, W), le("hh", Z, W), le("kk", Z, W), le("hmm", X), le("hmmss", Q), le("Hmm", X), le("Hmmss", Q), fe(["H", "HH"], ve), fe(["k", "kk"], function(e, t, n) {
+        }), Je("a", !0), Je("A", !1), O("hour", "h"), P("hour", 13), le("a", et), le("A", et), le("H", Z), le("h", Z), le("k", Z), le("HH", Z, W), le("hh", Z, W), le("kk", Z, W), le("hmm", X), le("hmmss", Q), le("Hmm", X), le("Hmmss", Q), fe(["H", "HH"], ve), fe(["k", "kk"], function(e, t, n) {
             var r = C(e);
             t[ve] = 24 === r ? 0 : r
         }), fe(["a", "A"], function(e, t, n) {
                 i = e.length - 2;
             t[ve] = C(e.substr(0, r)), t[be] = C(e.substr(r, 2)), t[ye] = C(e.substr(i))
         });
-        var et, tt = Te("Hours", !0),
-            nt = {
+        var tt, nt = Te("Hours", !0),
+            rt = {
                 calendar: {
                     sameDay: "[Today at] LT",
                     nextDay: "[Tomorrow at] LT",
                     y: "a year",
                     yy: "%d years"
                 },
-                months: De,
+                months: Oe,
                 monthsShort: Ne,
                 week: {
                     dow: 0,
                     doy: 6
                 },
                 weekdays: ze,
-                weekdaysMin: We,
-                weekdaysShort: Be,
+                weekdaysMin: Ye,
+                weekdaysShort: We,
                 meridiemParse: /[ap]\.?m?\.?/i
             },
-            rt = {},
-            it = {};
+            it = {},
+            ot = {};
 
-        function ot(e) {
+        function at(e) {
             return e ? e.toLowerCase().replace("_", "-") : e
         }
 
-        function at(e) {
+        function st(e) {
             var t = null;
-            if (!rt[e] && "undefined" != typeof module && module && module.exports) try {
-                t = et._abbr, require("./locale/" + e), st(t)
+            if (!it[e] && "undefined" != typeof module && module && module.exports) try {
+                t = tt._abbr, require("./locale/" + e), lt(t)
             } catch (e) {}
-            return rt[e]
+            return it[e]
         }
 
-        function st(e, t) {
+        function lt(e, t) {
             var n;
-            return e && ((n = c(t) ? ct(e) : lt(e, t)) ? et = n : "undefined" != typeof console && console.warn && console.warn("Locale " + e + " not found. Did you forget to load it?")), et._abbr
+            return e && ((n = c(t) ? ut(e) : ct(e, t)) ? tt = n : "undefined" != typeof console && console.warn && console.warn("Locale " + e + " not found. Did you forget to load it?")), tt._abbr
         }
 
-        function lt(e, t) {
-            if (null === t) return delete rt[e], null;
-            var n, r = nt;
-            if (t.abbr = e, null != rt[e]) T("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."), r = rt[e]._config;
+        function ct(e, t) {
+            if (null === t) return delete it[e], null;
+            var n, r = rt;
+            if (t.abbr = e, null != it[e]) T("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."), r = it[e]._config;
             else if (null != t.parentLocale)
-                if (null != rt[t.parentLocale]) r = rt[t.parentLocale]._config;
+                if (null != it[t.parentLocale]) r = it[t.parentLocale]._config;
                 else {
-                    if (null == (n = at(t.parentLocale))) return it[t.parentLocale] || (it[t.parentLocale] = []), it[t.parentLocale].push({
+                    if (null == (n = st(t.parentLocale))) return ot[t.parentLocale] || (ot[t.parentLocale] = []), ot[t.parentLocale].push({
                         name: e,
                         config: t
                     }), null;
                     r = n._config
-                } return rt[e] = new S(A(r, t)), it[e] && it[e].forEach(function(e) {
-                lt(e.name, e.config)
-            }), st(e), rt[e]
+                } return it[e] = new S(A(r, t)), ot[e] && ot[e].forEach(function(e) {
+                ct(e.name, e.config)
+            }), lt(e), it[e]
         }
 
-        function ct(e) {
+        function ut(e) {
             var t;
-            if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return et;
+            if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return tt;
             if (!s(e)) {
-                if (t = at(e)) return t;
+                if (t = st(e)) return t;
                 e = [e]
             }
             return function(e) {
                 for (var t, n, r, i, o = 0; o < e.length;) {
-                    for (t = (i = ot(e[o]).split("-")).length, n = (n = ot(e[o + 1])) ? n.split("-") : null; 0 < t;) {
-                        if (r = at(i.slice(0, t).join("-"))) return r;
+                    for (t = (i = at(e[o]).split("-")).length, n = (n = at(e[o + 1])) ? n.split("-") : null; 0 < t;) {
+                        if (r = st(i.slice(0, t).join("-"))) return r;
                         if (n && n.length >= t && a(i, n, !0) >= t - 1) break;
                         t--
                     }
                     o++
                 }
-                return et
+                return tt
             }(e)
         }
 
-        function ut(e) {
+        function dt(e) {
             var t, n = e._a;
             return n && -2 === v(e).overflow && (t = n[me] < 0 || 11 < n[me] ? me : n[ge] < 1 || n[ge] > Se(n[pe], n[me]) ? ge : n[ve] < 0 || 24 < n[ve] || 24 === n[ve] && (0 !== n[be] || 0 !== n[ye] || 0 !== n[_e]) ? ve : n[be] < 0 || 59 < n[be] ? be : n[ye] < 0 || 59 < n[ye] ? ye : n[_e] < 0 || 999 < n[_e] ? _e : -1, v(e)._overflowDayOfYear && (t < pe || ge < t) && (t = ge), v(e)._overflowWeeks && -1 === t && (t = $e), v(e)._overflowWeekday && -1 === t && (t = we), v(e).overflow = t), e
         }
 
-        function dt(e, t, n) {
+        function ft(e, t, n) {
             return null != e ? e : null != t ? t : n
         }
 
-        function ft(e) {
+        function ht(e) {
             var t, n, r, i, o, a = [];
             if (!e._d) {
                 var s, l;
                 for (s = e, l = new Date(f.now()), r = s._useUTC ? [l.getUTCFullYear(), l.getUTCMonth(), l.getUTCDate()] : [l.getFullYear(), l.getMonth(), l.getDate()], e._w && null == e._a[ge] && null == e._a[me] && function(e) {
                         var t, n, r, i, o, a, s, l;
-                        if (null != (t = e._w).GG || null != t.W || null != t.E) o = 1, a = 4, n = dt(t.GG, e._a[pe], Ue(Tt(), 1, 4).year), r = dt(t.W, 1), ((i = dt(t.E, 1)) < 1 || 7 < i) && (l = !0);
+                        if (null != (t = e._w).GG || null != t.W || null != t.E) o = 1, a = 4, n = ft(t.GG, e._a[pe], Ue(Mt(), 1, 4).year), r = ft(t.W, 1), ((i = ft(t.E, 1)) < 1 || 7 < i) && (l = !0);
                         else {
                             o = e._locale._week.dow, a = e._locale._week.doy;
-                            var c = Ue(Tt(), o, a);
-                            n = dt(t.gg, e._a[pe], c.year), r = dt(t.w, c.week), null != t.d ? ((i = t.d) < 0 || 6 < i) && (l = !0) : null != t.e ? (i = t.e + o, (t.e < 0 || 6 < t.e) && (l = !0)) : i = o
+                            var c = Ue(Mt(), o, a);
+                            n = ft(t.gg, e._a[pe], c.year), r = ft(t.w, c.week), null != t.d ? ((i = t.d) < 0 || 6 < i) && (l = !0) : null != t.e ? (i = t.e + o, (t.e < 0 || 6 < t.e) && (l = !0)) : i = o
                         }
                         r < 1 || r > Ve(n, o, a) ? v(e)._overflowWeeks = !0 : null != l ? v(e)._overflowWeekday = !0 : (s = qe(n, r, i, o, a), e._a[pe] = s.year, e._dayOfYear = s.dayOfYear)
-                    }(e), null != e._dayOfYear && (o = dt(e._a[pe], r[pe]), (e._dayOfYear > Ee(o) || 0 === e._dayOfYear) && (v(e)._overflowDayOfYear = !0), n = Le(o, 0, e._dayOfYear), e._a[me] = n.getUTCMonth(), e._a[ge] = n.getUTCDate()), t = 0; t < 3 && null == e._a[t]; ++t) e._a[t] = a[t] = r[t];
+                    }(e), null != e._dayOfYear && (o = ft(e._a[pe], r[pe]), (e._dayOfYear > Ee(o) || 0 === e._dayOfYear) && (v(e)._overflowDayOfYear = !0), n = Le(o, 0, e._dayOfYear), e._a[me] = n.getUTCMonth(), e._a[ge] = n.getUTCDate()), t = 0; t < 3 && null == e._a[t]; ++t) e._a[t] = a[t] = r[t];
                 for (; t < 7; t++) e._a[t] = a[t] = null == e._a[t] ? 2 === t ? 1 : 0 : e._a[t];
                 24 === e._a[ve] && 0 === e._a[be] && 0 === e._a[ye] && 0 === e._a[_e] && (e._nextDay = !0, e._a[ve] = 0), e._d = (e._useUTC ? Le : function(e, t, n, r, i, o, a) {
-                    var s = new Date(e, t, n, r, i, o, a);
-                    return e < 100 && 0 <= e && isFinite(s.getFullYear()) && s.setFullYear(e), s
+                    var s;
+                    return e < 100 && 0 <= e ? (s = new Date(e + 400, t, n, r, i, o, a), isFinite(s.getFullYear()) && s.setFullYear(e)) : s = new Date(e, t, n, r, i, o, a), s
                 }).apply(null, a), i = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), null != e._tzm && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[ve] = 24), e._w && void 0 !== e._w.d && e._w.d !== i && (v(e).weekdayMismatch = !0)
             }
         }
-        var ht = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
-            pt = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
-            mt = /Z|[+-]\d\d(?::?\d\d)?/,
-            gt = [
+        var pt = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
+            mt = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
+            gt = /Z|[+-]\d\d(?::?\d\d)?/,
+            vt = [
                 ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
                 ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
                 ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
                 ["GGGG[W]WW", /\d{4}W\d{2}/, !1],
                 ["YYYYDDD", /\d{7}/]
             ],
-            vt = [
+            bt = [
                 ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
                 ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
                 ["HH:mm:ss", /\d\d:\d\d:\d\d/],
                 ["HHmm", /\d\d\d\d/],
                 ["HH", /\d\d/]
             ],
-            bt = /^\/?Date\((\-?\d+)/i;
+            yt = /^\/?Date\((\-?\d+)/i;
 
-        function yt(e) {
+        function _t(e) {
             var t, n, r, i, o, a, s = e._i,
-                l = ht.exec(s) || pt.exec(s);
+                l = pt.exec(s) || mt.exec(s);
             if (l) {
-                for (v(e).iso = !0, t = 0, n = gt.length; t < n; t++)
-                    if (gt[t][1].exec(l[1])) {
-                        i = gt[t][0], r = !1 !== gt[t][2];
+                for (v(e).iso = !0, t = 0, n = vt.length; t < n; t++)
+                    if (vt[t][1].exec(l[1])) {
+                        i = vt[t][0], r = !1 !== vt[t][2];
                         break
                     } if (null == i) return void(e._isValid = !1);
                 if (l[3]) {
-                    for (t = 0, n = vt.length; t < n; t++)
-                        if (vt[t][1].exec(l[3])) {
-                            o = (l[2] || " ") + vt[t][0];
+                    for (t = 0, n = bt.length; t < n; t++)
+                        if (bt[t][1].exec(l[3])) {
+                            o = (l[2] || " ") + bt[t][0];
                             break
                         } if (null == o) return void(e._isValid = !1)
                 }
                 if (!r && null != o) return void(e._isValid = !1);
                 if (l[4]) {
-                    if (!mt.exec(l[4])) return void(e._isValid = !1);
+                    if (!gt.exec(l[4])) return void(e._isValid = !1);
                     a = "Z"
                 }
-                e._f = i + (o || "") + (a || ""), Ct(e)
+                e._f = i + (o || "") + (a || ""), kt(e)
             } else e._isValid = !1
         }
-        var _t = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
+        var $t = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
 
-        function $t(e, t, n, r, i, o) {
+        function wt(e, t, n, r, i, o) {
             var a = [function(e) {
                 var t = parseInt(e, 10); {
                     if (t <= 49) return 2e3 + t;
             }(e), Ne.indexOf(t), parseInt(n, 10), parseInt(r, 10), parseInt(i, 10)];
             return o && a.push(parseInt(o, 10)), a
         }
-        var wt = {
+        var Et = {
             UT: 0,
             GMT: 0,
             EDT: -240,
             PST: -480
         };
 
-        function Et(e) {
-            var t, n, r, i = _t.exec(e._i.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, ""));
+        function Ct(e) {
+            var t, n, r, i = $t.exec(e._i.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, ""));
             if (i) {
-                var o = $t(i[4], i[3], i[2], i[5], i[6], i[7]);
-                if (t = i[1], n = o, r = e, t && Be.indexOf(t) !== new Date(n[0], n[1], n[2]).getDay() && (v(r).weekdayMismatch = !0, !(r._isValid = !1))) return;
+                var o = wt(i[4], i[3], i[2], i[5], i[6], i[7]);
+                if (t = i[1], n = o, r = e, t && We.indexOf(t) !== new Date(n[0], n[1], n[2]).getDay() && (v(r).weekdayMismatch = !0, !(r._isValid = !1))) return;
                 e._a = o, e._tzm = function(e, t, n) {
-                    if (e) return wt[e];
+                    if (e) return Et[e];
                     if (t) return 0;
                     var r = parseInt(n, 10),
                         i = r % 100;
             } else e._isValid = !1
         }
 
-        function Ct(e) {
+        function kt(e) {
             if (e._f !== f.ISO_8601)
                 if (e._f !== f.RFC_2822) {
                     e._a = [], v(e).empty = !0;
                     var t, n, r, i, o, a, s, l, c = "" + e._i,
                         u = c.length,
                         d = 0;
-                    for (r = z(e._f, e._locale).match(j) || [], t = 0; t < r.length; t++) i = r[t], (n = (c.match(ce(i, e)) || [])[0]) && (0 < (o = c.substr(0, c.indexOf(n))).length && v(e).unusedInput.push(o), c = c.slice(c.indexOf(n) + n.length), d += n.length), q[i] ? (n ? v(e).empty = !1 : v(e).unusedTokens.push(i), a = i, l = e, null != (s = n) && p(de, a) && de[a](s, l._a, l, a)) : e._strict && !n && v(e).unusedTokens.push(i);
+                    for (r = B(e._f, e._locale).match(j) || [], t = 0; t < r.length; t++) i = r[t], (n = (c.match(ce(i, e)) || [])[0]) && (0 < (o = c.substr(0, c.indexOf(n))).length && v(e).unusedInput.push(o), c = c.slice(c.indexOf(n) + n.length), d += n.length), q[i] ? (n ? v(e).empty = !1 : v(e).unusedTokens.push(i), a = i, l = e, null != (s = n) && p(de, a) && de[a](s, l._a, l, a)) : e._strict && !n && v(e).unusedTokens.push(i);
                     v(e).charsLeftOver = u - d, 0 < c.length && v(e).unusedInput.push(c), e._a[ve] <= 12 && !0 === v(e).bigHour && 0 < e._a[ve] && (v(e).bigHour = void 0), v(e).parsedDateParts = e._a.slice(0), v(e).meridiem = e._meridiem, e._a[ve] = function(e, t, n) {
                         var r;
                         if (null == n) return t;
                         return null != e.meridiemHour ? e.meridiemHour(t, n) : (null != e.isPM && ((r = e.isPM(n)) && t < 12 && (t += 12), r || 12 !== t || (t = 0)), t)
-                    }(e._locale, e._a[ve], e._meridiem), ft(e), ut(e)
-                } else Et(e);
-            else yt(e)
+                    }(e._locale, e._a[ve], e._meridiem), ht(e), dt(e)
+                } else Ct(e);
+            else _t(e)
         }
 
-        function kt(e) {
+        function xt(e) {
             var t, n, r, i, o = e._i,
                 a = e._f;
-            return e._locale = e._locale || ct(e._l), null === o || void 0 === a && "" === o ? y({
+            return e._locale = e._locale || ut(e._l), null === o || void 0 === a && "" === o ? y({
                 nullInput: !0
-            }) : ("string" == typeof o && (e._i = o = e._locale.preparse(o)), w(o) ? new $(ut(o)) : (d(o) ? e._d = o : s(a) ? function(e) {
+            }) : ("string" == typeof o && (e._i = o = e._locale.preparse(o)), w(o) ? new $(dt(o)) : (d(o) ? e._d = o : s(a) ? function(e) {
                 var t, n, r, i, o;
                 if (0 === e._f.length) return v(e).invalidFormat = !0, e._d = new Date(NaN);
-                for (i = 0; i < e._f.length; i++) o = 0, t = _({}, e), null != e._useUTC && (t._useUTC = e._useUTC), t._f = e._f[i], Ct(t), b(t) && (o += v(t).charsLeftOver, o += 10 * v(t).unusedTokens.length, v(t).score = o, (null == r || o < r) && (r = o, n = t));
+                for (i = 0; i < e._f.length; i++) o = 0, t = _({}, e), null != e._useUTC && (t._useUTC = e._useUTC), t._f = e._f[i], kt(t), b(t) && (o += v(t).charsLeftOver, o += 10 * v(t).unusedTokens.length, v(t).score = o, (null == r || o < r) && (r = o, n = t));
                 m(e, n || t)
-            }(e) : a ? Ct(e) : c(n = (t = e)._i) ? t._d = new Date(f.now()) : d(n) ? t._d = new Date(n.valueOf()) : "string" == typeof n ? (r = t, null === (i = bt.exec(r._i)) ? (yt(r), !1 === r._isValid && (delete r._isValid, Et(r), !1 === r._isValid && (delete r._isValid, f.createFromInputFallback(r)))) : r._d = new Date(+i[1])) : s(n) ? (t._a = h(n.slice(0), function(e) {
+            }(e) : a ? kt(e) : c(n = (t = e)._i) ? t._d = new Date(f.now()) : d(n) ? t._d = new Date(n.valueOf()) : "string" == typeof n ? (r = t, null === (i = yt.exec(r._i)) ? (_t(r), !1 === r._isValid && (delete r._isValid, Ct(r), !1 === r._isValid && (delete r._isValid, f.createFromInputFallback(r)))) : r._d = new Date(+i[1])) : s(n) ? (t._a = h(n.slice(0), function(e) {
                 return parseInt(e, 10)
-            }), ft(t)) : l(n) ? function(e) {
+            }), ht(t)) : l(n) ? function(e) {
                 if (!e._d) {
                     var t = I(e._i);
                     e._a = h([t.year, t.month, t.day || t.date, t.hour, t.minute, t.second, t.millisecond], function(e) {
                         return e && parseInt(e, 10)
-                    }), ft(e)
+                    }), ht(e)
                 }
             }(t) : u(n) ? t._d = new Date(n) : f.createFromInputFallback(t), b(e) || (e._d = null), e))
         }
 
-        function xt(e, t, n, r, i) {
+        function Tt(e, t, n, r, i) {
             var o, a = {};
             return !0 !== n && !1 !== n || (r = n, n = void 0), (l(e) && function(e) {
                 if (Object.getOwnPropertyNames) return 0 === Object.getOwnPropertyNames(e).length;
                 for (t in e)
                     if (e.hasOwnProperty(t)) return !1;
                 return !0
-            }(e) || s(e) && 0 === e.length) && (e = void 0), a._isAMomentObject = !0, a._useUTC = a._isUTC = i, a._l = n, a._i = e, a._f = t, a._strict = r, (o = new $(ut(kt(a))))._nextDay && (o.add(1, "d"), o._nextDay = void 0), o
+            }(e) || s(e) && 0 === e.length) && (e = void 0), a._isAMomentObject = !0, a._useUTC = a._isUTC = i, a._l = n, a._i = e, a._f = t, a._strict = r, (o = new $(dt(xt(a))))._nextDay && (o.add(1, "d"), o._nextDay = void 0), o
         }
 
-        function Tt(e, t, n, r) {
-            return xt(e, t, n, r, !1)
+        function Mt(e, t, n, r) {
+            return Tt(e, t, n, r, !1)
         }
         f.createFromInputFallback = n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function(e) {
             e._d = new Date(e._i + (e._useUTC ? " UTC" : ""))
         }), f.ISO_8601 = function() {}, f.RFC_2822 = function() {};
-        var Mt = n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function() {
-                var e = Tt.apply(null, arguments);
+        var At = n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function() {
+                var e = Mt.apply(null, arguments);
                 return this.isValid() && e.isValid() ? e < this ? this : e : y()
             }),
-            At = n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function() {
-                var e = Tt.apply(null, arguments);
+            St = n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function() {
+                var e = Mt.apply(null, arguments);
                 return this.isValid() && e.isValid() ? this < e ? this : e : y()
             });
 
-        function St(e, t) {
+        function Dt(e, t) {
             var n, r;
-            if (1 === t.length && s(t[0]) && (t = t[0]), !t.length) return Tt();
+            if (1 === t.length && s(t[0]) && (t = t[0]), !t.length) return Mt();
             for (n = t[0], r = 1; r < t.length; ++r) t[r].isValid() && !t[r][e](n) || (n = t[r]);
             return n
         }
         var Ot = ["year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond"];
 
-        function Dt(e) {
+        function Nt(e) {
             var t = I(e),
                 n = t.year || 0,
                 r = t.quarter || 0,
                         if (n) return !1;
                         parseFloat(e[Ot[r]]) !== C(e[Ot[r]]) && (n = !0)
                     } return !0
-            }(t), this._milliseconds = +u + 1e3 * c + 6e4 * l + 1e3 * s * 60 * 60, this._days = +a + 7 * o, this._months = +i + 3 * r + 12 * n, this._data = {}, this._locale = ct(), this._bubble()
+            }(t), this._milliseconds = +u + 1e3 * c + 6e4 * l + 1e3 * s * 60 * 60, this._days = +a + 7 * o, this._months = +i + 3 * r + 12 * n, this._data = {}, this._locale = ut(), this._bubble()
         }
 
-        function Nt(e) {
-            return e instanceof Dt
+        function It(e) {
+            return e instanceof Nt
         }
 
-        function It(e) {
+        function Rt(e) {
             return e < 0 ? -1 * Math.round(-1 * e) : Math.round(e)
         }
 
-        function Rt(e, n) {
+        function Pt(e, n) {
             U(e, 0, 0, function() {
                 var e = this.utcOffset(),
                     t = "+";
                 return e < 0 && (e = -e, t = "-"), t + H(~~(e / 60), 2) + n + H(~~e % 60, 2)
             })
         }
-        Rt("Z", ":"), Rt("ZZ", ""), le("Z", oe), le("ZZ", oe), fe(["Z", "ZZ"], function(e, t, n) {
-            n._useUTC = !0, n._tzm = Ht(oe, e)
+        Pt("Z", ":"), Pt("ZZ", ""), le("Z", oe), le("ZZ", oe), fe(["Z", "ZZ"], function(e, t, n) {
+            n._useUTC = !0, n._tzm = jt(oe, e)
         });
-        var Pt = /([\+\-]|\d\d)/gi;
+        var Ht = /([\+\-]|\d\d)/gi;
 
-        function Ht(e, t) {
+        function jt(e, t) {
             var n = (t || "").match(e);
             if (null === n) return null;
-            var r = ((n[n.length - 1] || []) + "").match(Pt) || ["-", 0, 0],
+            var r = ((n[n.length - 1] || []) + "").match(Ht) || ["-", 0, 0],
                 i = 60 * r[1] + C(r[2]);
             return 0 === i ? 0 : "+" === r[0] ? i : -i
         }
 
-        function jt(e, t) {
+        function Lt(e, t) {
             var n, r;
-            return t._isUTC ? (n = t.clone(), r = (w(e) || d(e) ? e.valueOf() : Tt(e).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + r), f.updateOffset(n, !1), n) : Tt(e).local()
+            return t._isUTC ? (n = t.clone(), r = (w(e) || d(e) ? e.valueOf() : Mt(e).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + r), f.updateOffset(n, !1), n) : Mt(e).local()
         }
 
-        function Lt(e) {
+        function Ft(e) {
             return 15 * -Math.round(e._d.getTimezoneOffset() / 15)
         }
 
-        function Ft() {
+        function qt() {
             return !!this.isValid() && (this._isUTC && 0 === this._offset)
         }
         f.updateOffset = function() {};
-        var qt = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,
-            Ut = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
+        var Ut = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,
+            Vt = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
 
-        function Vt(e, t) {
+        function Bt(e, t) {
             var n, r, i, o = e,
                 a = null;
-            return Nt(e) ? o = {
+            return It(e) ? o = {
                 ms: e._milliseconds,
                 d: e._days,
                 M: e._months
-            } : u(e) ? (o = {}, t ? o[t] = e : o.milliseconds = e) : (a = qt.exec(e)) ? (n = "-" === a[1] ? -1 : 1, o = {
+            } : u(e) ? (o = {}, t ? o[t] = e : o.milliseconds = e) : (a = Ut.exec(e)) ? (n = "-" === a[1] ? -1 : 1, o = {
                 y: 0,
                 d: C(a[ge]) * n,
                 h: C(a[ve]) * n,
                 m: C(a[be]) * n,
                 s: C(a[ye]) * n,
-                ms: C(It(1e3 * a[_e])) * n
-            }) : (a = Ut.exec(e)) ? (n = "-" === a[1] ? -1 : 1, o = {
+                ms: C(Rt(1e3 * a[_e])) * n
+            }) : (a = Vt.exec(e)) ? (n = "-" === a[1] ? -1 : 1, o = {
                 y: zt(a[2], n),
                 M: zt(a[3], n),
                 w: zt(a[4], n),
                     milliseconds: 0,
                     months: 0
                 };
-                t = jt(t, e), e.isBefore(t) ? n = Bt(e, t) : ((n = Bt(t, e)).milliseconds = -n.milliseconds, n.months = -n.months);
+                t = Lt(t, e), e.isBefore(t) ? n = Wt(e, t) : ((n = Wt(t, e)).milliseconds = -n.milliseconds, n.months = -n.months);
                 return n
-            }(Tt(o.from), Tt(o.to)), (o = {}).ms = i.milliseconds, o.M = i.months), r = new Dt(o), Nt(e) && p(e, "_locale") && (r._locale = e._locale), r
+            }(Mt(o.from), Mt(o.to)), (o = {}).ms = i.milliseconds, o.M = i.months), r = new Nt(o), It(e) && p(e, "_locale") && (r._locale = e._locale), r
         }
 
         function zt(e, t) {
             return (isNaN(n) ? 0 : n) * t
         }
 
-        function Bt(e, t) {
-            var n = {
-                milliseconds: 0,
-                months: 0
-            };
+        function Wt(e, t) {
+            var n = {};
             return n.months = t.month() - e.month() + 12 * (t.year() - e.year()), e.clone().add(n.months, "M").isAfter(t) && --n.months, n.milliseconds = +t - +e.clone().add(n.months, "M"), n
         }
 
-        function Wt(r, i) {
+        function Yt(r, i) {
             return function(e, t) {
                 var n;
-                return null === t || isNaN(+t) || (T(i, "moment()." + i + "(period, number) is deprecated. Please use moment()." + i + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."), n = e, e = t, t = n), Yt(this, Vt(e = "string" == typeof e ? +e : e, t), r), this
+                return null === t || isNaN(+t) || (T(i, "moment()." + i + "(period, number) is deprecated. Please use moment()." + i + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."), n = e, e = t, t = n), Gt(this, Bt(e = "string" == typeof e ? +e : e, t), r), this
             }
         }
 
-        function Yt(e, t, n, r) {
+        function Gt(e, t, n, r) {
             var i = t._milliseconds,
-                o = It(t._days),
-                a = It(t._months);
+                o = Rt(t._days),
+                a = Rt(t._months);
             e.isValid() && (r = null == r || r, a && Ie(e, Me(e, "Month") + a * n), o && Ae(e, "Date", Me(e, "Date") + o * n), i && e._d.setTime(e._d.valueOf() + i * n), r && f.updateOffset(e, o || a))
         }
-        Vt.fn = Dt.prototype, Vt.invalid = function() {
-            return Vt(NaN)
+        Bt.fn = Nt.prototype, Bt.invalid = function() {
+            return Bt(NaN)
         };
-        var Gt = Wt(1, "add"),
-            Kt = Wt(-1, "subtract");
+        var Kt = Yt(1, "add"),
+            Zt = Yt(-1, "subtract");
 
-        function Zt(e, t) {
+        function Xt(e, t) {
             var n = 12 * (t.year() - e.year()) + (t.month() - e.month()),
                 r = e.clone().add(n, "months");
             return -(n + (t - r < 0 ? (t - r) / (r - e.clone().add(n - 1, "months")) : (t - r) / (e.clone().add(n + 1, "months") - r))) || 0
         }
 
-        function Xt(e) {
+        function Qt(e) {
             var t;
-            return void 0 === e ? this._locale._abbr : (null != (t = ct(e)) && (this._locale = t), this)
+            return void 0 === e ? this._locale._abbr : (null != (t = ut(e)) && (this._locale = t), this)
         }
         f.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ", f.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
-        var Qt = n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function(e) {
+        var Jt = n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function(e) {
             return void 0 === e ? this.localeData() : this.locale(e)
         });
 
-        function Jt() {
+        function en() {
             return this._locale
         }
+        var tn = 126227808e5;
 
-        function en(e, t) {
+        function nn(e, t) {
+            return (e % t + t) % t
+        }
+
+        function rn(e, t, n) {
+            return e < 100 && 0 <= e ? new Date(e + 400, t, n) - tn : new Date(e, t, n).valueOf()
+        }
+
+        function on(e, t, n) {
+            return e < 100 && 0 <= e ? Date.UTC(e + 400, t, n) - tn : Date.UTC(e, t, n)
+        }
+
+        function an(e, t) {
             U(0, [e, e.length], 0, t)
         }
 
-        function tn(e, t, n, r, i) {
+        function sn(e, t, n, r, i) {
             var o;
             return null == e ? Ue(this, r, i).year : ((o = Ve(e, r, i)) < t && (t = o), function(e, t, n, r, i) {
                 var o = qe(e, t, n, r, i),
             return this.weekYear() % 100
         }), U(0, ["GG", 2], 0, function() {
             return this.isoWeekYear() % 100
-        }), en("gggg", "weekYear"), en("ggggg", "weekYear"), en("GGGG", "isoWeekYear"), en("GGGGG", "isoWeekYear"), D("weekYear", "gg"), D("isoWeekYear", "GG"), P("weekYear", 1), P("isoWeekYear", 1), le("G", re), le("g", re), le("GG", Z, W), le("gg", Z, W), le("GGGG", ee, G), le("gggg", ee, G), le("GGGGG", te, K), le("ggggg", te, K), he(["gggg", "ggggg", "GGGG", "GGGGG"], function(e, t, n, r) {
+        }), an("gggg", "weekYear"), an("ggggg", "weekYear"), an("GGGG", "isoWeekYear"), an("GGGGG", "isoWeekYear"), O("weekYear", "gg"), O("isoWeekYear", "GG"), P("weekYear", 1), P("isoWeekYear", 1), le("G", re), le("g", re), le("GG", Z, W), le("gg", Z, W), le("GGGG", ee, G), le("gggg", ee, G), le("GGGGG", te, K), le("ggggg", te, K), he(["gggg", "ggggg", "GGGG", "GGGGG"], function(e, t, n, r) {
             t[r.substr(0, 2)] = C(e)
         }), he(["gg", "GG"], function(e, t, n, r) {
             t[r] = f.parseTwoDigitYear(e)
-        }), U("Q", 0, "Qo", "quarter"), D("quarter", "Q"), P("quarter", 7), le("Q", B), fe("Q", function(e, t) {
+        }), U("Q", 0, "Qo", "quarter"), O("quarter", "Q"), P("quarter", 7), le("Q", z), fe("Q", function(e, t) {
             t[me] = 3 * (C(e) - 1)
-        }), U("D", ["DD", 2], "Do", "date"), D("date", "D"), P("date", 9), le("D", Z), le("DD", Z, W), le("Do", function(e, t) {
+        }), U("D", ["DD", 2], "Do", "date"), O("date", "D"), P("date", 9), le("D", Z), le("DD", Z, W), le("Do", function(e, t) {
             return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient
         }), fe(["D", "DD"], ge), fe("Do", function(e, t) {
             t[ge] = C(e.match(Z)[0])
         });
-        var nn = Te("Date", !0);
-        U("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), D("dayOfYear", "DDD"), P("dayOfYear", 4), le("DDD", J), le("DDDD", Y), fe(["DDD", "DDDD"], function(e, t, n) {
+        var ln = Te("Date", !0);
+        U("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), O("dayOfYear", "DDD"), P("dayOfYear", 4), le("DDD", J), le("DDDD", Y), fe(["DDD", "DDDD"], function(e, t, n) {
             n._dayOfYear = C(e)
-        }), U("m", ["mm", 2], 0, "minute"), D("minute", "m"), P("minute", 14), le("m", Z), le("mm", Z, W), fe(["m", "mm"], be);
-        var rn = Te("Minutes", !1);
-        U("s", ["ss", 2], 0, "second"), D("second", "s"), P("second", 15), le("s", Z), le("ss", Z, W), fe(["s", "ss"], ye);
-        var on, an = Te("Seconds", !1);
+        }), U("m", ["mm", 2], 0, "minute"), O("minute", "m"), P("minute", 14), le("m", Z), le("mm", Z, W), fe(["m", "mm"], be);
+        var cn = Te("Minutes", !1);
+        U("s", ["ss", 2], 0, "second"), O("second", "s"), P("second", 15), le("s", Z), le("ss", Z, W), fe(["s", "ss"], ye);
+        var un, dn = Te("Seconds", !1);
         for (U("S", 0, 0, function() {
                 return ~~(this.millisecond() / 100)
             }), U(0, ["SS", 2], 0, function() {
                 return 1e5 * this.millisecond()
             }), U(0, ["SSSSSSSSS", 9], 0, function() {
                 return 1e6 * this.millisecond()
-            }), D("millisecond", "ms"), P("millisecond", 16), le("S", J, B), le("SS", J, W), le("SSS", J, Y), on = "SSSS"; on.length <= 9; on += "S") le(on, ne);
+            }), O("millisecond", "ms"), P("millisecond", 16), le("S", J, z), le("SS", J, W), le("SSS", J, Y), un = "SSSS"; un.length <= 9; un += "S") le(un, ne);
 
-        function sn(e, t) {
+        function fn(e, t) {
             t[_e] = C(1e3 * ("0." + e))
         }
-        for (on = "S"; on.length <= 9; on += "S") fe(on, sn);
-        var ln = Te("Milliseconds", !1);
+        for (un = "S"; un.length <= 9; un += "S") fe(un, fn);
+        var hn = Te("Milliseconds", !1);
         U("z", 0, 0, "zoneAbbr"), U("zz", 0, 0, "zoneName");
-        var cn = $.prototype;
+        var pn = $.prototype;
 
-        function un(e) {
+        function mn(e) {
             return e
         }
-        cn.add = Gt, cn.calendar = function(e, t) {
-            var n = e || Tt(),
-                r = jt(n, this).startOf("day"),
+        pn.add = Kt, pn.calendar = function(e, t) {
+            var n = e || Mt(),
+                r = Lt(n, this).startOf("day"),
                 i = f.calendarFormat(this, r) || "sameElse",
                 o = t && (M(t[i]) ? t[i].call(this, n) : t[i]);
-            return this.format(o || this.localeData().calendar(i, this, Tt(n)))
-        }, cn.clone = function() {
+            return this.format(o || this.localeData().calendar(i, this, Mt(n)))
+        }, pn.clone = function() {
             return new $(this)
-        }, cn.diff = function(e, t, n) {
+        }, pn.diff = function(e, t, n) {
             var r, i, o;
             if (!this.isValid()) return NaN;
-            if (!(r = jt(e, this)).isValid()) return NaN;
+            if (!(r = Lt(e, this)).isValid()) return NaN;
             switch (i = 6e4 * (r.utcOffset() - this.utcOffset()), t = N(t)) {
                 case "year":
-                    o = Zt(this, r) / 12;
+                    o = Xt(this, r) / 12;
                     break;
                 case "month":
-                    o = Zt(this, r);
+                    o = Xt(this, r);
                     break;
                 case "quarter":
-                    o = Zt(this, r) / 3;
+                    o = Xt(this, r) / 3;
                     break;
                 case "second":
                     o = (this - r) / 1e3;
                     o = this - r
             }
             return n ? o : E(o)
-        }, cn.endOf = function(e) {
-            return void 0 === (e = N(e)) || "millisecond" === e ? this : ("date" === e && (e = "day"), this.startOf(e).add(1, "isoWeek" === e ? "week" : e).subtract(1, "ms"))
-        }, cn.format = function(e) {
+        }, pn.endOf = function(e) {
+            var t;
+            if (void 0 === (e = N(e)) || "millisecond" === e || !this.isValid()) return this;
+            var n = this._isUTC ? on : rn;
+            switch (e) {
+                case "year":
+                    t = n(this.year() + 1, 0, 1) - 1;
+                    break;
+                case "quarter":
+                    t = n(this.year(), this.month() - this.month() % 3 + 3, 1) - 1;
+                    break;
+                case "month":
+                    t = n(this.year(), this.month() + 1, 1) - 1;
+                    break;
+                case "week":
+                    t = n(this.year(), this.month(), this.date() - this.weekday() + 7) - 1;
+                    break;
+                case "isoWeek":
+                    t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1;
+                    break;
+                case "day":
+                case "date":
+                    t = n(this.year(), this.month(), this.date() + 1) - 1;
+                    break;
+                case "hour":
+                    t = this._d.valueOf(), t += 36e5 - nn(t + (this._isUTC ? 0 : 6e4 * this.utcOffset()), 36e5) - 1;
+                    break;
+                case "minute":
+                    t = this._d.valueOf(), t += 6e4 - nn(t, 6e4) - 1;
+                    break;
+                case "second":
+                    t = this._d.valueOf(), t += 1e3 - nn(t, 1e3) - 1
+            }
+            return this._d.setTime(t), f.updateOffset(this, !0), this
+        }, pn.format = function(e) {
             e || (e = this.isUtc() ? f.defaultFormatUtc : f.defaultFormat);
             var t = V(this, e);
             return this.localeData().postformat(t)
-        }, cn.from = function(e, t) {
-            return this.isValid() && (w(e) && e.isValid() || Tt(e).isValid()) ? Vt({
+        }, pn.from = function(e, t) {
+            return this.isValid() && (w(e) && e.isValid() || Mt(e).isValid()) ? Bt({
                 to: this,
                 from: e
             }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate()
-        }, cn.fromNow = function(e) {
-            return this.from(Tt(), e)
-        }, cn.to = function(e, t) {
-            return this.isValid() && (w(e) && e.isValid() || Tt(e).isValid()) ? Vt({
+        }, pn.fromNow = function(e) {
+            return this.from(Mt(), e)
+        }, pn.to = function(e, t) {
+            return this.isValid() && (w(e) && e.isValid() || Mt(e).isValid()) ? Bt({
                 from: this,
                 to: e
             }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate()
-        }, cn.toNow = function(e) {
-            return this.to(Tt(), e)
-        }, cn.get = function(e) {
+        }, pn.toNow = function(e) {
+            return this.to(Mt(), e)
+        }, pn.get = function(e) {
             return M(this[e = N(e)]) ? this[e]() : this
-        }, cn.invalidAt = function() {
+        }, pn.invalidAt = function() {
             return v(this).overflow
-        }, cn.isAfter = function(e, t) {
-            var n = w(e) ? e : Tt(e);
+        }, pn.isAfter = function(e, t) {
+            var n = w(e) ? e : Mt(e);
             return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = N(t) || "millisecond") ? this.valueOf() > n.valueOf() : n.valueOf() < this.clone().startOf(t).valueOf())
-        }, cn.isBefore = function(e, t) {
-            var n = w(e) ? e : Tt(e);
+        }, pn.isBefore = function(e, t) {
+            var n = w(e) ? e : Mt(e);
             return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = N(t) || "millisecond") ? this.valueOf() < n.valueOf() : this.clone().endOf(t).valueOf() < n.valueOf())
-        }, cn.isBetween = function(e, t, n, r) {
-            var i = w(e) ? e : Tt(e),
-                o = w(t) ? t : Tt(t);
+        }, pn.isBetween = function(e, t, n, r) {
+            var i = w(e) ? e : Mt(e),
+                o = w(t) ? t : Mt(t);
             return !!(this.isValid() && i.isValid() && o.isValid()) && ("(" === (r = r || "()")[0] ? this.isAfter(i, n) : !this.isBefore(i, n)) && (")" === r[1] ? this.isBefore(o, n) : !this.isAfter(o, n))
-        }, cn.isSame = function(e, t) {
-            var n, r = w(e) ? e : Tt(e);
+        }, pn.isSame = function(e, t) {
+            var n, r = w(e) ? e : Mt(e);
             return !(!this.isValid() || !r.isValid()) && ("millisecond" === (t = N(t) || "millisecond") ? this.valueOf() === r.valueOf() : (n = r.valueOf(), this.clone().startOf(t).valueOf() <= n && n <= this.clone().endOf(t).valueOf()))
-        }, cn.isSameOrAfter = function(e, t) {
+        }, pn.isSameOrAfter = function(e, t) {
             return this.isSame(e, t) || this.isAfter(e, t)
-        }, cn.isSameOrBefore = function(e, t) {
+        }, pn.isSameOrBefore = function(e, t) {
             return this.isSame(e, t) || this.isBefore(e, t)
-        }, cn.isValid = function() {
+        }, pn.isValid = function() {
             return b(this)
-        }, cn.lang = Qt, cn.locale = Xt, cn.localeData = Jt, cn.max = At, cn.min = Mt, cn.parsingFlags = function() {
+        }, pn.lang = Jt, pn.locale = Qt, pn.localeData = en, pn.max = St, pn.min = At, pn.parsingFlags = function() {
             return m({}, v(this))
-        }, cn.set = function(e, t) {
+        }, pn.set = function(e, t) {
             if ("object" == typeof e)
                 for (var n = function(e) {
                         var t = [];
                     }(e = I(e)), r = 0; r < n.length; r++) this[n[r].unit](e[n[r].unit]);
             else if (M(this[e = N(e)])) return this[e](t);
             return this
-        }, cn.startOf = function(e) {
-            switch (e = N(e)) {
+        }, pn.startOf = function(e) {
+            var t;
+            if (void 0 === (e = N(e)) || "millisecond" === e || !this.isValid()) return this;
+            var n = this._isUTC ? on : rn;
+            switch (e) {
                 case "year":
-                    this.month(0);
+                    t = n(this.year(), 0, 1);
+                    break;
                 case "quarter":
+                    t = n(this.year(), this.month() - this.month() % 3, 1);
+                    break;
                 case "month":
-                    this.date(1);
+                    t = n(this.year(), this.month(), 1);
+                    break;
                 case "week":
+                    t = n(this.year(), this.month(), this.date() - this.weekday());
+                    break;
                 case "isoWeek":
+                    t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1));
+                    break;
                 case "day":
                 case "date":
-                    this.hours(0);
+                    t = n(this.year(), this.month(), this.date());
+                    break;
                 case "hour":
-                    this.minutes(0);
+                    t = this._d.valueOf(), t -= nn(t + (this._isUTC ? 0 : 6e4 * this.utcOffset()), 36e5);
+                    break;
                 case "minute":
-                    this.seconds(0);
+                    t = this._d.valueOf(), t -= nn(t, 6e4);
+                    break;
                 case "second":
-                    this.milliseconds(0)
+                    t = this._d.valueOf(), t -= nn(t, 1e3)
             }
-            return "week" === e && this.weekday(0), "isoWeek" === e && this.isoWeekday(1), "quarter" === e && this.month(3 * Math.floor(this.month() / 3)), this
-        }, cn.subtract = Kt, cn.toArray = function() {
+            return this._d.setTime(t), f.updateOffset(this, !0), this
+        }, pn.subtract = Zt, pn.toArray = function() {
             return [this.year(), this.month(), this.date(), this.hour(), this.minute(), this.second(), this.millisecond()]
-        }, cn.toObject = function() {
+        }, pn.toObject = function() {
             return {
                 years: this.year(),
                 months: this.month(),
                 seconds: this.seconds(),
                 milliseconds: this.milliseconds()
             }
-        }, cn.toDate = function() {
+        }, pn.toDate = function() {
             return new Date(this.valueOf())
-        }, cn.toISOString = function(e) {
+        }, pn.toISOString = function(e) {
             if (!this.isValid()) return null;
             var t = !0 !== e,
                 n = t ? this.clone().utc() : this;
             return n.year() < 0 || 9999 < n.year() ? V(n, t ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ") : M(Date.prototype.toISOString) ? t ? this.toDate().toISOString() : new Date(this.valueOf() + 60 * this.utcOffset() * 1e3).toISOString().replace("Z", V(n, "Z")) : V(n, t ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ")
-        }, cn.inspect = function() {
+        }, pn.inspect = function() {
             if (!this.isValid()) return "moment.invalid(/* " + this._i + " */)";
             var e = "moment",
                 t = "";
                 r = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY",
                 i = t + '[")]';
             return this.format(n + r + "-MM-DD[T]HH:mm:ss.SSS" + i)
-        }, cn.toJSON = function() {
+        }, pn.toJSON = function() {
             return this.isValid() ? this.toISOString() : null
-        }, cn.toString = function() {
+        }, pn.toString = function() {
             return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
-        }, cn.unix = function() {
+        }, pn.unix = function() {
             return Math.floor(this.valueOf() / 1e3)
-        }, cn.valueOf = function() {
+        }, pn.valueOf = function() {
             return this._d.valueOf() - 6e4 * (this._offset || 0)
-        }, cn.creationData = function() {
+        }, pn.creationData = function() {
             return {
                 input: this._i,
                 format: this._f,
                 isUTC: this._isUTC,
                 strict: this._strict
             }
-        }, cn.year = xe, cn.isLeapYear = function() {
+        }, pn.year = xe, pn.isLeapYear = function() {
             return Ce(this.year())
-        }, cn.weekYear = function(e) {
-            return tn.call(this, e, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy)
-        }, cn.isoWeekYear = function(e) {
-            return tn.call(this, e, this.isoWeek(), this.isoWeekday(), 1, 4)
-        }, cn.quarter = cn.quarters = function(e) {
+        }, pn.weekYear = function(e) {
+            return sn.call(this, e, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy)
+        }, pn.isoWeekYear = function(e) {
+            return sn.call(this, e, this.isoWeek(), this.isoWeekday(), 1, 4)
+        }, pn.quarter = pn.quarters = function(e) {
             return null == e ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (e - 1) + this.month() % 3)
-        }, cn.month = Re, cn.daysInMonth = function() {
+        }, pn.month = Re, pn.daysInMonth = function() {
             return Se(this.year(), this.month())
-        }, cn.week = cn.weeks = function(e) {
+        }, pn.week = pn.weeks = function(e) {
             var t = this.localeData().week(this);
             return null == e ? t : this.add(7 * (e - t), "d")
-        }, cn.isoWeek = cn.isoWeeks = function(e) {
+        }, pn.isoWeek = pn.isoWeeks = function(e) {
             var t = Ue(this, 1, 4).week;
             return null == e ? t : this.add(7 * (e - t), "d")
-        }, cn.weeksInYear = function() {
+        }, pn.weeksInYear = function() {
             var e = this.localeData()._week;
             return Ve(this.year(), e.dow, e.doy)
-        }, cn.isoWeeksInYear = function() {
+        }, pn.isoWeeksInYear = function() {
             return Ve(this.year(), 1, 4)
-        }, cn.date = nn, cn.day = cn.days = function(e) {
+        }, pn.date = ln, pn.day = pn.days = function(e) {
             if (!this.isValid()) return null != e ? this : NaN;
             var t, n, r = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
             return null != e ? (t = e, n = this.localeData(), e = "string" != typeof t ? t : isNaN(t) ? "number" == typeof(t = n.weekdaysParse(t)) ? t : null : parseInt(t, 10), this.add(e - r, "d")) : r
-        }, cn.weekday = function(e) {
+        }, pn.weekday = function(e) {
             if (!this.isValid()) return null != e ? this : NaN;
             var t = (this.day() + 7 - this.localeData()._week.dow) % 7;
             return null == e ? t : this.add(e - t, "d")
-        }, cn.isoWeekday = function(e) {
+        }, pn.isoWeekday = function(e) {
             if (!this.isValid()) return null != e ? this : NaN;
             if (null == e) return this.day() || 7;
             var t, n, r = (t = e, n = this.localeData(), "string" == typeof t ? n.weekdaysParse(t) % 7 || 7 : isNaN(t) ? null : t);
             return this.day(this.day() % 7 ? r : r - 7)
-        }, cn.dayOfYear = function(e) {
+        }, pn.dayOfYear = function(e) {
             var t = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1;
             return null == e ? t : this.add(e - t, "d")
-        }, cn.hour = cn.hours = tt, cn.minute = cn.minutes = rn, cn.second = cn.seconds = an, cn.millisecond = cn.milliseconds = ln, cn.utcOffset = function(e, t, n) {
+        }, pn.hour = pn.hours = nt, pn.minute = pn.minutes = cn, pn.second = pn.seconds = dn, pn.millisecond = pn.milliseconds = hn, pn.utcOffset = function(e, t, n) {
             var r, i = this._offset || 0;
             if (!this.isValid()) return null != e ? this : NaN;
-            if (null == e) return this._isUTC ? i : Lt(this);
+            if (null == e) return this._isUTC ? i : Ft(this);
             if ("string" == typeof e) {
-                if (null === (e = Ht(oe, e))) return this
+                if (null === (e = jt(oe, e))) return this
             } else Math.abs(e) < 16 && !n && (e *= 60);
-            return !this._isUTC && t && (r = Lt(this)), this._offset = e, this._isUTC = !0, null != r && this.add(r, "m"), i !== e && (!t || this._changeInProgress ? Yt(this, Vt(e - i, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, f.updateOffset(this, !0), this._changeInProgress = null)), this
-        }, cn.utc = function(e) {
+            return !this._isUTC && t && (r = Ft(this)), this._offset = e, this._isUTC = !0, null != r && this.add(r, "m"), i !== e && (!t || this._changeInProgress ? Gt(this, Bt(e - i, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, f.updateOffset(this, !0), this._changeInProgress = null)), this
+        }, pn.utc = function(e) {
             return this.utcOffset(0, e)
-        }, cn.local = function(e) {
-            return this._isUTC && (this.utcOffset(0, e), this._isUTC = !1, e && this.subtract(Lt(this), "m")), this
-        }, cn.parseZone = function() {
+        }, pn.local = function(e) {
+            return this._isUTC && (this.utcOffset(0, e), this._isUTC = !1, e && this.subtract(Ft(this), "m")), this
+        }, pn.parseZone = function() {
             if (null != this._tzm) this.utcOffset(this._tzm, !1, !0);
             else if ("string" == typeof this._i) {
-                var e = Ht(ie, this._i);
+                var e = jt(ie, this._i);
                 null != e ? this.utcOffset(e) : this.utcOffset(0, !0)
             }
             return this
-        }, cn.hasAlignedHourOffset = function(e) {
-            return !!this.isValid() && (e = e ? Tt(e).utcOffset() : 0, (this.utcOffset() - e) % 60 == 0)
-        }, cn.isDST = function() {
+        }, pn.hasAlignedHourOffset = function(e) {
+            return !!this.isValid() && (e = e ? Mt(e).utcOffset() : 0, (this.utcOffset() - e) % 60 == 0)
+        }, pn.isDST = function() {
             return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset()
-        }, cn.isLocal = function() {
+        }, pn.isLocal = function() {
             return !!this.isValid() && !this._isUTC
-        }, cn.isUtcOffset = function() {
+        }, pn.isUtcOffset = function() {
             return !!this.isValid() && this._isUTC
-        }, cn.isUtc = Ft, cn.isUTC = Ft, cn.zoneAbbr = function() {
+        }, pn.isUtc = qt, pn.isUTC = qt, pn.zoneAbbr = function() {
             return this._isUTC ? "UTC" : ""
-        }, cn.zoneName = function() {
+        }, pn.zoneName = function() {
             return this._isUTC ? "Coordinated Universal Time" : ""
-        }, cn.dates = n("dates accessor is deprecated. Use date instead.", nn), cn.months = n("months accessor is deprecated. Use month instead", Re), cn.years = n("years accessor is deprecated. Use year instead", xe), cn.zone = n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", function(e, t) {
+        }, pn.dates = n("dates accessor is deprecated. Use date instead.", ln), pn.months = n("months accessor is deprecated. Use month instead", Re), pn.years = n("years accessor is deprecated. Use year instead", xe), pn.zone = n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", function(e, t) {
             return null != e ? ("string" != typeof e && (e = -e), this.utcOffset(e, t), this) : -this.utcOffset()
-        }), cn.isDSTShifted = n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", function() {
+        }), pn.isDSTShifted = n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", function() {
             if (!c(this._isDSTShifted)) return this._isDSTShifted;
             var e = {};
-            if (_(e, this), (e = kt(e))._a) {
-                var t = e._isUTC ? g(e._a) : Tt(e._a);
+            if (_(e, this), (e = xt(e))._a) {
+                var t = e._isUTC ? g(e._a) : Mt(e._a);
                 this._isDSTShifted = this.isValid() && 0 < a(e._a, t.toArray())
             } else this._isDSTShifted = !1;
             return this._isDSTShifted
         });
-        var dn = S.prototype;
+        var gn = S.prototype;
 
-        function fn(e, t, n, r) {
-            var i = ct(),
+        function vn(e, t, n, r) {
+            var i = ut(),
                 o = g().set(r, t);
             return i[n](o, e)
         }
 
-        function hn(e, t, n) {
-            if (u(e) && (t = e, e = void 0), e = e || "", null != t) return fn(e, t, n, "month");
+        function bn(e, t, n) {
+            if (u(e) && (t = e, e = void 0), e = e || "", null != t) return vn(e, t, n, "month");
             var r, i = [];
-            for (r = 0; r < 12; r++) i[r] = fn(e, r, n, "month");
+            for (r = 0; r < 12; r++) i[r] = vn(e, r, n, "month");
             return i
         }
 
-        function pn(e, t, n, r) {
+        function yn(e, t, n, r) {
             t = ("boolean" == typeof e ? u(t) && (n = t, t = void 0) : (t = e, e = !1, u(n = t) && (n = t, t = void 0)), t || "");
-            var i, o = ct(),
+            var i, o = ut(),
                 a = e ? o._week.dow : 0;
-            if (null != n) return fn(t, (n + a) % 7, r, "day");
+            if (null != n) return vn(t, (n + a) % 7, r, "day");
             var s = [];
-            for (i = 0; i < 7; i++) s[i] = fn(t, (i + a) % 7, r, "day");
+            for (i = 0; i < 7; i++) s[i] = vn(t, (i + a) % 7, r, "day");
             return s
         }
-        dn.calendar = function(e, t, n) {
+        gn.calendar = function(e, t, n) {
             var r = this._calendar[e] || this._calendar.sameElse;
             return M(r) ? r.call(t, n) : r
-        }, dn.longDateFormat = function(e) {
+        }, gn.longDateFormat = function(e) {
             var t = this._longDateFormat[e],
                 n = this._longDateFormat[e.toUpperCase()];
             return t || !n ? t : (this._longDateFormat[e] = n.replace(/MMMM|MM|DD|dddd/g, function(e) {
                 return e.slice(1)
             }), this._longDateFormat[e])
-        }, dn.invalidDate = function() {
+        }, gn.invalidDate = function() {
             return this._invalidDate
-        }, dn.ordinal = function(e) {
+        }, gn.ordinal = function(e) {
             return this._ordinal.replace("%d", e)
-        }, dn.preparse = un, dn.postformat = un, dn.relativeTime = function(e, t, n, r) {
+        }, gn.preparse = mn, gn.postformat = mn, gn.relativeTime = function(e, t, n, r) {
             var i = this._relativeTime[n];
             return M(i) ? i(e, t, n, r) : i.replace(/%d/i, e)
-        }, dn.pastFuture = function(e, t) {
+        }, gn.pastFuture = function(e, t) {
             var n = this._relativeTime[0 < e ? "future" : "past"];
             return M(n) ? n(t) : n.replace(/%s/i, t)
-        }, dn.set = function(e) {
+        }, gn.set = function(e) {
             var t, n;
             for (n in e) M(t = e[n]) ? this[n] = t : this["_" + n] = t;
             this._config = e, this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source)
-        }, dn.months = function(e, t) {
-            return e ? s(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || Oe).test(t) ? "format" : "standalone"][e.month()] : s(this._months) ? this._months : this._months.standalone
-        }, dn.monthsShort = function(e, t) {
-            return e ? s(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[Oe.test(t) ? "format" : "standalone"][e.month()] : s(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone
-        }, dn.monthsParse = function(e, t, n) {
+        }, gn.months = function(e, t) {
+            return e ? s(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || De).test(t) ? "format" : "standalone"][e.month()] : s(this._months) ? this._months : this._months.standalone
+        }, gn.monthsShort = function(e, t) {
+            return e ? s(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[De.test(t) ? "format" : "standalone"][e.month()] : s(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone
+        }, gn.monthsParse = function(e, t, n) {
             var r, i, o;
             if (this._monthsParseExact) return function(e, t, n) {
                 var r, i, o, a = e.toLocaleLowerCase();
                 if (n && "MMM" === t && this._shortMonthsParse[r].test(e)) return r;
                 if (!n && this._monthsParse[r].test(e)) return r
             }
-        }, dn.monthsRegex = function(e) {
+        }, gn.monthsRegex = function(e) {
             return this._monthsParseExact ? (p(this, "_monthsRegex") || je.call(this), e ? this._monthsStrictRegex : this._monthsRegex) : (p(this, "_monthsRegex") || (this._monthsRegex = He), this._monthsStrictRegex && e ? this._monthsStrictRegex : this._monthsRegex)
-        }, dn.monthsShortRegex = function(e) {
+        }, gn.monthsShortRegex = function(e) {
             return this._monthsParseExact ? (p(this, "_monthsRegex") || je.call(this), e ? this._monthsShortStrictRegex : this._monthsShortRegex) : (p(this, "_monthsShortRegex") || (this._monthsShortRegex = Pe), this._monthsShortStrictRegex && e ? this._monthsShortStrictRegex : this._monthsShortRegex)
-        }, dn.week = function(e) {
+        }, gn.week = function(e) {
             return Ue(e, this._week.dow, this._week.doy).week
-        }, dn.firstDayOfYear = function() {
+        }, gn.firstDayOfYear = function() {
             return this._week.doy
-        }, dn.firstDayOfWeek = function() {
+        }, gn.firstDayOfWeek = function() {
             return this._week.dow
-        }, dn.weekdays = function(e, t) {
-            return e ? s(this._weekdays) ? this._weekdays[e.day()] : this._weekdays[this._weekdays.isFormat.test(t) ? "format" : "standalone"][e.day()] : s(this._weekdays) ? this._weekdays : this._weekdays.standalone
-        }, dn.weekdaysMin = function(e) {
-            return e ? this._weekdaysMin[e.day()] : this._weekdaysMin
-        }, dn.weekdaysShort = function(e) {
-            return e ? this._weekdaysShort[e.day()] : this._weekdaysShort
-        }, dn.weekdaysParse = function(e, t, n) {
+        }, gn.weekdays = function(e, t) {
+            var n = s(this._weekdays) ? this._weekdays : this._weekdays[e && !0 !== e && this._weekdays.isFormat.test(t) ? "format" : "standalone"];
+            return !0 === e ? Be(n, this._week.dow) : e ? n[e.day()] : n
+        }, gn.weekdaysMin = function(e) {
+            return !0 === e ? Be(this._weekdaysMin, this._week.dow) : e ? this._weekdaysMin[e.day()] : this._weekdaysMin
+        }, gn.weekdaysShort = function(e) {
+            return !0 === e ? Be(this._weekdaysShort, this._week.dow) : e ? this._weekdaysShort[e.day()] : this._weekdaysShort
+        }, gn.weekdaysParse = function(e, t, n) {
             var r, i, o;
             if (this._weekdaysParseExact) return function(e, t, n) {
                 var r, i, o, a = e.toLocaleLowerCase();
                 if (n && "dd" === t && this._minWeekdaysParse[r].test(e)) return r;
                 if (!n && this._weekdaysParse[r].test(e)) return r
             }
-        }, dn.weekdaysRegex = function(e) {
-            return this._weekdaysParseExact ? (p(this, "_weekdaysRegex") || Ze.call(this), e ? this._weekdaysStrictRegex : this._weekdaysRegex) : (p(this, "_weekdaysRegex") || (this._weekdaysRegex = Ye), this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex)
-        }, dn.weekdaysShortRegex = function(e) {
-            return this._weekdaysParseExact ? (p(this, "_weekdaysRegex") || Ze.call(this), e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (p(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = Ge), this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex)
-        }, dn.weekdaysMinRegex = function(e) {
-            return this._weekdaysParseExact ? (p(this, "_weekdaysRegex") || Ze.call(this), e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (p(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = Ke), this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex)
-        }, dn.isPM = function(e) {
+        }, gn.weekdaysRegex = function(e) {
+            return this._weekdaysParseExact ? (p(this, "_weekdaysRegex") || Xe.call(this), e ? this._weekdaysStrictRegex : this._weekdaysRegex) : (p(this, "_weekdaysRegex") || (this._weekdaysRegex = Ge), this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex)
+        }, gn.weekdaysShortRegex = function(e) {
+            return this._weekdaysParseExact ? (p(this, "_weekdaysRegex") || Xe.call(this), e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (p(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = Ke), this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex)
+        }, gn.weekdaysMinRegex = function(e) {
+            return this._weekdaysParseExact ? (p(this, "_weekdaysRegex") || Xe.call(this), e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (p(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = Ze), this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex)
+        }, gn.isPM = function(e) {
             return "p" === (e + "").toLowerCase().charAt(0)
-        }, dn.meridiem = function(e, t, n) {
+        }, gn.meridiem = function(e, t, n) {
             return 11 < e ? n ? "pm" : "PM" : n ? "am" : "AM"
-        }, st("en", {
+        }, lt("en", {
             dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
             ordinal: function(e) {
                 var t = e % 10;
                 return e + (1 === C(e % 100 / 10) ? "th" : 1 === t ? "st" : 2 === t ? "nd" : 3 === t ? "rd" : "th")
             }
-        }), f.lang = n("moment.lang is deprecated. Use moment.locale instead.", st), f.langData = n("moment.langData is deprecated. Use moment.localeData instead.", ct);
-        var mn = Math.abs;
+        }), f.lang = n("moment.lang is deprecated. Use moment.locale instead.", lt), f.langData = n("moment.langData is deprecated. Use moment.localeData instead.", ut);
+        var _n = Math.abs;
 
-        function gn(e, t, n, r) {
-            var i = Vt(t, n);
+        function $n(e, t, n, r) {
+            var i = Bt(t, n);
             return e._milliseconds += r * i._milliseconds, e._days += r * i._days, e._months += r * i._months, e._bubble()
         }
 
-        function vn(e) {
+        function wn(e) {
             return e < 0 ? Math.floor(e) : Math.ceil(e)
         }
 
-        function bn(e) {
+        function En(e) {
             return 4800 * e / 146097
         }
 
-        function yn(e) {
+        function Cn(e) {
             return 146097 * e / 4800
         }
 
-        function _n(e) {
+        function kn(e) {
             return function() {
                 return this.as(e)
             }
         }
-        var $n = _n("ms"),
-            wn = _n("s"),
-            En = _n("m"),
-            Cn = _n("h"),
-            kn = _n("d"),
-            xn = _n("w"),
-            Tn = _n("M"),
-            Mn = _n("y");
+        var xn = kn("ms"),
+            Tn = kn("s"),
+            Mn = kn("m"),
+            An = kn("h"),
+            Sn = kn("d"),
+            Dn = kn("w"),
+            On = kn("M"),
+            Nn = kn("Q"),
+            In = kn("y");
 
-        function An(e) {
+        function Rn(e) {
             return function() {
                 return this.isValid() ? this._data[e] : NaN
             }
         }
-        var Sn = An("milliseconds"),
-            On = An("seconds"),
-            Dn = An("minutes"),
-            Nn = An("hours"),
-            In = An("days"),
-            Rn = An("months"),
-            Pn = An("years");
-        var Hn = Math.round,
-            jn = {
+        var Pn = Rn("milliseconds"),
+            Hn = Rn("seconds"),
+            jn = Rn("minutes"),
+            Ln = Rn("hours"),
+            Fn = Rn("days"),
+            qn = Rn("months"),
+            Un = Rn("years");
+        var Vn = Math.round,
+            Bn = {
                 ss: 44,
                 s: 45,
                 m: 45,
                 d: 26,
                 M: 11
             };
-        var Ln = Math.abs;
+        var zn = Math.abs;
 
-        function Fn(e) {
+        function Wn(e) {
             return (0 < e) - (e < 0) || +e
         }
 
-        function qn() {
+        function Yn() {
             if (!this.isValid()) return this.localeData().invalidDate();
-            var e, t, n = Ln(this._milliseconds) / 1e3,
-                r = Ln(this._days),
-                i = Ln(this._months);
+            var e, t, n = zn(this._milliseconds) / 1e3,
+                r = zn(this._days),
+                i = zn(this._months);
             t = E((e = E(n / 60)) / 60), n %= 60, e %= 60;
             var o = E(i / 12),
                 a = i %= 12,
                 d = this.asSeconds();
             if (!d) return "P0D";
             var f = d < 0 ? "-" : "",
-                h = Fn(this._months) !== Fn(d) ? "-" : "",
-                p = Fn(this._days) !== Fn(d) ? "-" : "",
-                m = Fn(this._milliseconds) !== Fn(d) ? "-" : "";
+                h = Wn(this._months) !== Wn(d) ? "-" : "",
+                p = Wn(this._days) !== Wn(d) ? "-" : "",
+                m = Wn(this._milliseconds) !== Wn(d) ? "-" : "";
             return f + "P" + (o ? h + o + "Y" : "") + (a ? h + a + "M" : "") + (s ? p + s + "D" : "") + (l || c || u ? "T" : "") + (l ? m + l + "H" : "") + (c ? m + c + "M" : "") + (u ? m + u + "S" : "")
         }
-        var Un = Dt.prototype;
-        return Un.isValid = function() {
+        var Gn = Nt.prototype;
+        return Gn.isValid = function() {
             return this._isValid
-        }, Un.abs = function() {
+        }, Gn.abs = function() {
             var e = this._data;
-            return this._milliseconds = mn(this._milliseconds), this._days = mn(this._days), this._months = mn(this._months), e.milliseconds = mn(e.milliseconds), e.seconds = mn(e.seconds), e.minutes = mn(e.minutes), e.hours = mn(e.hours), e.months = mn(e.months), e.years = mn(e.years), this
-        }, Un.add = function(e, t) {
-            return gn(this, e, t, 1)
-        }, Un.subtract = function(e, t) {
-            return gn(this, e, t, -1)
-        }, Un.as = function(e) {
+            return this._milliseconds = _n(this._milliseconds), this._days = _n(this._days), this._months = _n(this._months), e.milliseconds = _n(e.milliseconds), e.seconds = _n(e.seconds), e.minutes = _n(e.minutes), e.hours = _n(e.hours), e.months = _n(e.months), e.years = _n(e.years), this
+        }, Gn.add = function(e, t) {
+            return $n(this, e, t, 1)
+        }, Gn.subtract = function(e, t) {
+            return $n(this, e, t, -1)
+        }, Gn.as = function(e) {
             if (!this.isValid()) return NaN;
             var t, n, r = this._milliseconds;
-            if ("month" === (e = N(e)) || "year" === e) return t = this._days + r / 864e5, n = this._months + bn(t), "month" === e ? n : n / 12;
-            switch (t = this._days + Math.round(yn(this._months)), e) {
+            if ("month" === (e = N(e)) || "quarter" === e || "year" === e) switch (t = this._days + r / 864e5, n = this._months + En(t), e) {
+                case "month":
+                    return n;
+                case "quarter":
+                    return n / 3;
+                case "year":
+                    return n / 12
+            } else switch (t = this._days + Math.round(Cn(this._months)), e) {
                 case "week":
                     return t / 7 + r / 6048e5;
                 case "day":
                 default:
                     throw new Error("Unknown unit " + e)
             }
-        }, Un.asMilliseconds = $n, Un.asSeconds = wn, Un.asMinutes = En, Un.asHours = Cn, Un.asDays = kn, Un.asWeeks = xn, Un.asMonths = Tn, Un.asYears = Mn, Un.valueOf = function() {
+        }, Gn.asMilliseconds = xn, Gn.asSeconds = Tn, Gn.asMinutes = Mn, Gn.asHours = An, Gn.asDays = Sn, Gn.asWeeks = Dn, Gn.asMonths = On, Gn.asQuarters = Nn, Gn.asYears = In, Gn.valueOf = function() {
             return this.isValid() ? this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * C(this._months / 12) : NaN
-        }, Un._bubble = function() {
+        }, Gn._bubble = function() {
             var e, t, n, r, i, o = this._milliseconds,
                 a = this._days,
                 s = this._months,
                 l = this._data;
-            return 0 <= o && 0 <= a && 0 <= s || o <= 0 && a <= 0 && s <= 0 || (o += 864e5 * vn(yn(s) + a), s = a = 0), l.milliseconds = o % 1e3, e = E(o / 1e3), l.seconds = e % 60, t = E(e / 60), l.minutes = t % 60, n = E(t / 60), l.hours = n % 24, s += i = E(bn(a += E(n / 24))), a -= vn(yn(i)), r = E(s / 12), s %= 12, l.days = a, l.months = s, l.years = r, this
-        }, Un.clone = function() {
-            return Vt(this)
-        }, Un.get = function(e) {
+            return 0 <= o && 0 <= a && 0 <= s || o <= 0 && a <= 0 && s <= 0 || (o += 864e5 * wn(Cn(s) + a), s = a = 0), l.milliseconds = o % 1e3, e = E(o / 1e3), l.seconds = e % 60, t = E(e / 60), l.minutes = t % 60, n = E(t / 60), l.hours = n % 24, s += i = E(En(a += E(n / 24))), a -= wn(Cn(i)), r = E(s / 12), s %= 12, l.days = a, l.months = s, l.years = r, this
+        }, Gn.clone = function() {
+            return Bt(this)
+        }, Gn.get = function(e) {
             return e = N(e), this.isValid() ? this[e + "s"]() : NaN
-        }, Un.milliseconds = Sn, Un.seconds = On, Un.minutes = Dn, Un.hours = Nn, Un.days = In, Un.weeks = function() {
+        }, Gn.milliseconds = Pn, Gn.seconds = Hn, Gn.minutes = jn, Gn.hours = Ln, Gn.days = Fn, Gn.weeks = function() {
             return E(this.days() / 7)
-        }, Un.months = Rn, Un.years = Pn, Un.humanize = function(e) {
+        }, Gn.months = qn, Gn.years = Un, Gn.humanize = function(e) {
             if (!this.isValid()) return this.localeData().invalidDate();
             var t, n, r, i, o, a, s, l, c, u, d, f = this.localeData(),
-                h = (n = !e, r = f, i = Vt(t = this).abs(), o = Hn(i.as("s")), a = Hn(i.as("m")), s = Hn(i.as("h")), l = Hn(i.as("d")), c = Hn(i.as("M")), u = Hn(i.as("y")), (d = o <= jn.ss && ["s", o] || o < jn.s && ["ss", o] || a <= 1 && ["m"] || a < jn.m && ["mm", a] || s <= 1 && ["h"] || s < jn.h && ["hh", s] || l <= 1 && ["d"] || l < jn.d && ["dd", l] || c <= 1 && ["M"] || c < jn.M && ["MM", c] || u <= 1 && ["y"] || ["yy", u])[2] = n, d[3] = 0 < +t, d[4] = r, function(e, t, n, r, i) {
+                h = (n = !e, r = f, i = Bt(t = this).abs(), o = Vn(i.as("s")), a = Vn(i.as("m")), s = Vn(i.as("h")), l = Vn(i.as("d")), c = Vn(i.as("M")), u = Vn(i.as("y")), (d = o <= Bn.ss && ["s", o] || o < Bn.s && ["ss", o] || a <= 1 && ["m"] || a < Bn.m && ["mm", a] || s <= 1 && ["h"] || s < Bn.h && ["hh", s] || l <= 1 && ["d"] || l < Bn.d && ["dd", l] || c <= 1 && ["M"] || c < Bn.M && ["MM", c] || u <= 1 && ["y"] || ["yy", u])[2] = n, d[3] = 0 < +t, d[4] = r, function(e, t, n, r, i) {
                     return i.relativeTime(t || 1, !!n, e, r)
                 }.apply(null, d));
             return e && (h = f.pastFuture(+this, h)), f.postformat(h)
-        }, Un.toISOString = qn, Un.toString = qn, Un.toJSON = qn, Un.locale = Xt, Un.localeData = Jt, Un.toIsoString = n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", qn), Un.lang = Qt, U("X", 0, 0, "unix"), U("x", 0, 0, "valueOf"), le("x", re), le("X", /[+-]?\d+(\.\d{1,3})?/), fe("X", function(e, t, n) {
+        }, Gn.toISOString = Yn, Gn.toString = Yn, Gn.toJSON = Yn, Gn.locale = Qt, Gn.localeData = en, Gn.toIsoString = n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", Yn), Gn.lang = Jt, U("X", 0, 0, "unix"), U("x", 0, 0, "valueOf"), le("x", re), le("X", /[+-]?\d+(\.\d{1,3})?/), fe("X", function(e, t, n) {
             n._d = new Date(1e3 * parseFloat(e, 10))
         }), fe("x", function(e, t, n) {
             n._d = new Date(C(e))
-        }), f.version = "2.23.0", e = Tt, f.fn = cn, f.min = function() {
-            return St("isBefore", [].slice.call(arguments, 0))
+        }), f.version = "2.24.0", e = Mt, f.fn = pn, f.min = function() {
+            return Dt("isBefore", [].slice.call(arguments, 0))
         }, f.max = function() {
-            return St("isAfter", [].slice.call(arguments, 0))
+            return Dt("isAfter", [].slice.call(arguments, 0))
         }, f.now = function() {
             return Date.now ? Date.now() : +new Date
         }, f.utc = g, f.unix = function(e) {
-            return Tt(1e3 * e)
+            return Mt(1e3 * e)
         }, f.months = function(e, t) {
-            return hn(e, t, "months")
-        }, f.isDate = d, f.locale = st, f.invalid = y, f.duration = Vt, f.isMoment = w, f.weekdays = function(e, t, n) {
-            return pn(e, t, n, "weekdays")
+            return bn(e, t, "months")
+        }, f.isDate = d, f.locale = lt, f.invalid = y, f.duration = Bt, f.isMoment = w, f.weekdays = function(e, t, n) {
+            return yn(e, t, n, "weekdays")
         }, f.parseZone = function() {
-            return Tt.apply(null, arguments).parseZone()
-        }, f.localeData = ct, f.isDuration = Nt, f.monthsShort = function(e, t) {
-            return hn(e, t, "monthsShort")
+            return Mt.apply(null, arguments).parseZone()
+        }, f.localeData = ut, f.isDuration = It, f.monthsShort = function(e, t) {
+            return bn(e, t, "monthsShort")
         }, f.weekdaysMin = function(e, t, n) {
-            return pn(e, t, n, "weekdaysMin")
-        }, f.defineLocale = lt, f.updateLocale = function(e, t) {
+            return yn(e, t, n, "weekdaysMin")
+        }, f.defineLocale = ct, f.updateLocale = function(e, t) {
             if (null != t) {
-                var n, r, i = nt;
-                null != (r = at(e)) && (i = r._config), (n = new S(t = A(i, t))).parentLocale = rt[e], rt[e] = n, st(e)
-            } else null != rt[e] && (null != rt[e].parentLocale ? rt[e] = rt[e].parentLocale : null != rt[e] && delete rt[e]);
-            return rt[e]
+                var n, r, i = rt;
+                null != (r = st(e)) && (i = r._config), (n = new S(t = A(i, t))).parentLocale = it[e], it[e] = n, lt(e)
+            } else null != it[e] && (null != it[e].parentLocale ? it[e] = it[e].parentLocale : null != it[e] && delete it[e]);
+            return it[e]
         }, f.locales = function() {
-            return r(rt)
+            return r(it)
         }, f.weekdaysShort = function(e, t, n) {
-            return pn(e, t, n, "weekdaysShort")
+            return yn(e, t, n, "weekdaysShort")
         }, f.normalizeUnits = N, f.relativeTimeRounding = function(e) {
-            return void 0 === e ? Hn : "function" == typeof e && (Hn = e, !0)
+            return void 0 === e ? Vn : "function" == typeof e && (Vn = e, !0)
         }, f.relativeTimeThreshold = function(e, t) {
-            return void 0 !== jn[e] && (void 0 === t ? jn[e] : (jn[e] = t, "s" === e && (jn.ss = t - 1), !0))
+            return void 0 !== Bn[e] && (void 0 === t ? Bn[e] : (Bn[e] = t, "s" === e && (Bn.ss = t - 1), !0))
         }, f.calendarFormat = function(e, t) {
             var n = e.diff(t, "days", !0);
             return n < -6 ? "sameElse" : n < -1 ? "lastWeek" : n < 0 ? "lastDay" : n < 1 ? "sameDay" : n < 2 ? "nextDay" : n < 7 ? "nextWeek" : "sameElse"
-        }, f.prototype = cn, f.HTML5_FMT = {
+        }, f.prototype = pn, f.HTML5_FMT = {
             DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
             DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
             DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
             u = {
                 type: !0,
                 src: !0,
+                nonce: !0,
                 noModule: !0
             };
 
         function _(e, t, n) {
-            var r, i = (t = t || C).createElement("script");
-            if (i.text = e, n)
-                for (r in u) n[r] && (i[r] = n[r]);
-            t.head.appendChild(i).parentNode.removeChild(i)
+            var r, i, o = (n = n || C).createElement("script");
+            if (o.text = e, t)
+                for (r in u)(i = t[r] || t.getAttribute && t.getAttribute(r)) && o.setAttribute(r, i);
+            n.head.appendChild(o).parentNode.removeChild(o)
         }
 
         function $(e) {
             return !b(e) && !y(e) && ("array" === n || 0 === t || "number" == typeof t && 0 < t && t - 1 in e)
         }
         k.fn = k.prototype = {
-            jquery: "3.3.1",
+            jquery: "3.4.1",
             constructor: k,
             length: 0,
             toArray: function() {
                 c = !1;
             for ("boolean" == typeof a && (c = a, a = arguments[s] || {}, s++), "object" == typeof a || b(a) || (a = {}), s === l && (a = this, s--); s < l; s++)
                 if (null != (e = arguments[s]))
-                    for (t in e) n = a[t], a !== (r = e[t]) && (c && r && (k.isPlainObject(r) || (i = Array.isArray(r))) ? (o = i ? (i = !1, n && Array.isArray(n) ? n : []) : n && k.isPlainObject(n) ? n : {}, a[t] = k.extend(c, o, r)) : void 0 !== r && (a[t] = r));
+                    for (t in e) r = e[t], "__proto__" !== t && a !== r && (c && r && (k.isPlainObject(r) || (i = Array.isArray(r))) ? (n = a[t], o = i && !Array.isArray(n) ? [] : i || k.isPlainObject(n) ? n : {}, i = !1, a[t] = k.extend(c, o, r)) : void 0 !== r && (a[t] = r));
             return a
         }, k.extend({
-            expando: "jQuery" + ("3.3.1" + Math.random()).replace(/\D/g, ""),
+            expando: "jQuery" + ("3.4.1" + Math.random()).replace(/\D/g, ""),
             isReady: !0,
             error: function(e) {
                 throw new Error(e)
                 for (t in e) return !1;
                 return !0
             },
-            globalEval: function(e) {
-                _(e)
+            globalEval: function(e, t) {
+                _(e, {
+                    nonce: t && t.nonce
+                })
             },
             each: function(e, t) {
                 var n, r = 0;
                 b = n.document,
                 x = 0,
                 r = 0,
-                f = ae(),
-                y = ae(),
-                T = ae(),
-                M = function(e, t) {
+                f = le(),
+                y = le(),
+                T = le(),
+                M = le(),
+                A = function(e, t) {
                     return e === t && (c = !0), 0
                 },
-                A = {}.hasOwnProperty,
+                S = {}.hasOwnProperty,
                 t = [],
-                S = t.pop,
+                D = t.pop,
                 O = t.push,
-                D = t.push,
-                N = t.slice,
-                I = function(e, t) {
+                N = t.push,
+                I = t.slice,
+                R = function(e, t) {
                     for (var n = 0, r = e.length; n < r; n++)
                         if (e[n] === t) return n;
                     return -1
                 },
-                R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-                P = "[\\x20\\t\\r\\n\\f]",
-                H = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
-                j = "\\[" + P + "*(" + H + ")(?:" + P + "*([*^$|!~]?=)" + P + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + H + "))|)" + P + "*\\]",
-                L = ":(" + H + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + j + ")*)|.*)\\)|)",
-                F = new RegExp(P + "+", "g"),
-                q = new RegExp("^" + P + "+|((?:^|[^\\\\])(?:\\\\.)*)" + P + "+$", "g"),
-                U = new RegExp("^" + P + "*," + P + "*"),
-                V = new RegExp("^" + P + "*([>+~]|" + P + ")" + P + "*"),
-                z = new RegExp("=" + P + "*([^\\]'\"]*?)" + P + "*\\]", "g"),
-                B = new RegExp(L),
-                W = new RegExp("^" + H + "$"),
-                Y = {
-                    ID: new RegExp("^#(" + H + ")"),
-                    CLASS: new RegExp("^\\.(" + H + ")"),
-                    TAG: new RegExp("^(" + H + "|[*])"),
-                    ATTR: new RegExp("^" + j),
-                    PSEUDO: new RegExp("^" + L),
-                    CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + P + "*(even|odd|(([+-]|)(\\d*)n|)" + P + "*(?:([+-]|)" + P + "*(\\d+)|))" + P + "*\\)|)", "i"),
-                    bool: new RegExp("^(?:" + R + ")$", "i"),
-                    needsContext: new RegExp("^" + P + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + P + "*((?:-\\d)?\\d*)" + P + "*\\)|)(?=[^-]|$)", "i")
+                P = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+                H = "[\\x20\\t\\r\\n\\f]",
+                j = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
+                L = "\\[" + H + "*(" + j + ")(?:" + H + "*([*^$|!~]?=)" + H + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + j + "))|)" + H + "*\\]",
+                F = ":(" + j + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + L + ")*)|.*)\\)|)",
+                q = new RegExp(H + "+", "g"),
+                U = new RegExp("^" + H + "+|((?:^|[^\\\\])(?:\\\\.)*)" + H + "+$", "g"),
+                V = new RegExp("^" + H + "*," + H + "*"),
+                B = new RegExp("^" + H + "*([>+~]|" + H + ")" + H + "*"),
+                z = new RegExp(H + "|>"),
+                W = new RegExp(F),
+                Y = new RegExp("^" + j + "$"),
+                G = {
+                    ID: new RegExp("^#(" + j + ")"),
+                    CLASS: new RegExp("^\\.(" + j + ")"),
+                    TAG: new RegExp("^(" + j + "|[*])"),
+                    ATTR: new RegExp("^" + L),
+                    PSEUDO: new RegExp("^" + F),
+                    CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + H + "*(even|odd|(([+-]|)(\\d*)n|)" + H + "*(?:([+-]|)" + H + "*(\\d+)|))" + H + "*\\)|)", "i"),
+                    bool: new RegExp("^(?:" + P + ")$", "i"),
+                    needsContext: new RegExp("^" + H + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + H + "*((?:-\\d)?\\d*)" + H + "*\\)|)(?=[^-]|$)", "i")
                 },
-                G = /^(?:input|select|textarea|button)$/i,
-                K = /^h\d$/i,
-                Z = /^[^{]+\{\s*\[native \w/,
-                X = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-                Q = /[+~]/,
-                J = new RegExp("\\\\([\\da-f]{1,6}" + P + "?|(" + P + ")|.)", "ig"),
-                ee = function(e, t, n) {
+                K = /HTML$/i,
+                Z = /^(?:input|select|textarea|button)$/i,
+                X = /^h\d$/i,
+                Q = /^[^{]+\{\s*\[native \w/,
+                J = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+                ee = /[+~]/,
+                te = new RegExp("\\\\([\\da-f]{1,6}" + H + "?|(" + H + ")|.)", "ig"),
+                ne = function(e, t, n) {
                     var r = "0x" + t - 65536;
                     return r != r || n ? t : r < 0 ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, 1023 & r | 56320)
                 },
-                te = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
-                ne = function(e, t) {
+                re = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
+                ie = function(e, t) {
                     return t ? "\0" === e ? "�" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " " : "\\" + e
                 },
-                re = function() {
+                oe = function() {
                     w()
                 },
-                ie = be(function(e) {
-                    return !0 === e.disabled && ("form" in e || "label" in e)
+                ae = _e(function(e) {
+                    return !0 === e.disabled && "fieldset" === e.nodeName.toLowerCase()
                 }, {
                     dir: "parentNode",
                     next: "legend"
                 });
             try {
-                D.apply(t = N.call(b.childNodes), b.childNodes), t[b.childNodes.length].nodeType
+                N.apply(t = I.call(b.childNodes), b.childNodes), t[b.childNodes.length].nodeType
             } catch (e) {
-                D = {
+                N = {
                     apply: t.length ? function(e, t) {
-                        O.apply(e, N.call(t))
+                        O.apply(e, I.call(t))
                     } : function(e, t) {
                         for (var n = e.length, r = 0; e[n++] = t[r++];);
                         e.length = n - 1
                 }
             }
 
-            function oe(e, t, n, r) {
-                var i, o, a, s, l, c, u, d = t && t.ownerDocument,
-                    f = t ? t.nodeType : 9;
-                if (n = n || [], "string" != typeof e || !e || 1 !== f && 9 !== f && 11 !== f) return n;
-                if (!r && ((t ? t.ownerDocument || t : b) !== E && w(t), t = t || E, C)) {
-                    if (11 !== f && (l = X.exec(e)))
+            function se(t, e, n, r) {
+                var i, o, a, s, l, c, u, d = e && e.ownerDocument,
+                    f = e ? e.nodeType : 9;
+                if (n = n || [], "string" != typeof t || !t || 1 !== f && 9 !== f && 11 !== f) return n;
+                if (!r && ((e ? e.ownerDocument || e : b) !== E && w(e), e = e || E, C)) {
+                    if (11 !== f && (l = J.exec(t)))
                         if (i = l[1]) {
                             if (9 === f) {
-                                if (!(a = t.getElementById(i))) return n;
+                                if (!(a = e.getElementById(i))) return n;
                                 if (a.id === i) return n.push(a), n
-                            } else if (d && (a = d.getElementById(i)) && v(t, a) && a.id === i) return n.push(a), n
+                            } else if (d && (a = d.getElementById(i)) && v(e, a) && a.id === i) return n.push(a), n
                         } else {
-                            if (l[2]) return D.apply(n, t.getElementsByTagName(e)), n;
-                            if ((i = l[3]) && h.getElementsByClassName && t.getElementsByClassName) return D.apply(n, t.getElementsByClassName(i)), n
-                        } if (h.qsa && !T[e + " "] && (!g || !g.test(e))) {
-                        if (1 !== f) d = t, u = e;
-                        else if ("object" !== t.nodeName.toLowerCase()) {
-                            for ((s = t.getAttribute("id")) ? s = s.replace(te, ne) : t.setAttribute("id", s = k), o = (c = p(e)).length; o--;) c[o] = "#" + s + " " + ve(c[o]);
-                            u = c.join(","), d = Q.test(e) && me(t.parentNode) || t
+                            if (l[2]) return N.apply(n, e.getElementsByTagName(t)), n;
+                            if ((i = l[3]) && h.getElementsByClassName && e.getElementsByClassName) return N.apply(n, e.getElementsByClassName(i)), n
+                        } if (h.qsa && !M[t + " "] && (!g || !g.test(t)) && (1 !== f || "object" !== e.nodeName.toLowerCase())) {
+                        if (u = t, d = e, 1 === f && z.test(t)) {
+                            for ((s = e.getAttribute("id")) ? s = s.replace(re, ie) : e.setAttribute("id", s = k), o = (c = p(t)).length; o--;) c[o] = "#" + s + " " + ye(c[o]);
+                            u = c.join(","), d = ee.test(t) && ve(e.parentNode) || e
                         }
-                        if (u) try {
-                            return D.apply(n, d.querySelectorAll(u)), n
-                        } catch (e) {} finally {
-                            s === k && t.removeAttribute("id")
+                        try {
+                            return N.apply(n, d.querySelectorAll(u)), n
+                        } catch (e) {
+                            M(t, !0)
+                        } finally {
+                            s === k && e.removeAttribute("id")
                         }
                     }
                 }
-                return m(e.replace(q, "$1"), t, n, r)
+                return m(t.replace(U, "$1"), e, n, r)
             }
 
-            function ae() {
+            function le() {
                 var r = [];
                 return function e(t, n) {
                     return r.push(t + " ") > _.cacheLength && delete e[r.shift()], e[t + " "] = n
                 }
             }
 
-            function se(e) {
+            function ce(e) {
                 return e[k] = !0, e
             }
 
-            function le(e) {
+            function ue(e) {
                 var t = E.createElement("fieldset");
                 try {
                     return !!e(t)
                 }
             }
 
-            function ce(e, t) {
+            function de(e, t) {
                 for (var n = e.split("|"), r = n.length; r--;) _.attrHandle[n[r]] = t
             }
 
-            function ue(e, t) {
+            function fe(e, t) {
                 var n = t && e,
                     r = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex;
                 if (r) return r;
                 return e ? 1 : -1
             }
 
-            function de(t) {
+            function he(t) {
                 return function(e) {
                     return "input" === e.nodeName.toLowerCase() && e.type === t
                 }
             }
 
-            function fe(n) {
+            function pe(n) {
                 return function(e) {
                     var t = e.nodeName.toLowerCase();
                     return ("input" === t || "button" === t) && e.type === n
                 }
             }
 
-            function he(t) {
+            function me(t) {
                 return function(e) {
-                    return "form" in e ? e.parentNode && !1 === e.disabled ? "label" in e ? "label" in e.parentNode ? e.parentNode.disabled === t : e.disabled === t : e.isDisabled === t || e.isDisabled !== !t && ie(e) === t : e.disabled === t : "label" in e && e.disabled === t
+                    return "form" in e ? e.parentNode && !1 === e.disabled ? "label" in e ? "label" in e.parentNode ? e.parentNode.disabled === t : e.disabled === t : e.isDisabled === t || e.isDisabled !== !t && ae(e) === t : e.disabled === t : "label" in e && e.disabled === t
                 }
             }
 
-            function pe(a) {
-                return se(function(o) {
-                    return o = +o, se(function(e, t) {
+            function ge(a) {
+                return ce(function(o) {
+                    return o = +o, ce(function(e, t) {
                         for (var n, r = a([], e.length, o), i = r.length; i--;) e[n = r[i]] && (e[n] = !(t[n] = e[n]))
                     })
                 })
             }
 
-            function me(e) {
+            function ve(e) {
                 return e && void 0 !== e.getElementsByTagName && e
             }
-            for (e in h = oe.support = {}, i = oe.isXML = function(e) {
-                    var t = e && (e.ownerDocument || e).documentElement;
-                    return !!t && "HTML" !== t.nodeName
-                }, w = oe.setDocument = function(e) {
+            for (e in h = se.support = {}, i = se.isXML = function(e) {
+                    var t = e.namespaceURI,
+                        n = (e.ownerDocument || e).documentElement;
+                    return !K.test(t || n && n.nodeName || "HTML")
+                }, w = se.setDocument = function(e) {
                     var t, n, r = e ? e.ownerDocument || e : b;
-                    return r !== E && 9 === r.nodeType && r.documentElement && (a = (E = r).documentElement, C = !i(E), b !== E && (n = E.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", re, !1) : n.attachEvent && n.attachEvent("onunload", re)), h.attributes = le(function(e) {
+                    return r !== E && 9 === r.nodeType && r.documentElement && (a = (E = r).documentElement, C = !i(E), b !== E && (n = E.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", oe, !1) : n.attachEvent && n.attachEvent("onunload", oe)), h.attributes = ue(function(e) {
                         return e.className = "i", !e.getAttribute("className")
-                    }), h.getElementsByTagName = le(function(e) {
+                    }), h.getElementsByTagName = ue(function(e) {
                         return e.appendChild(E.createComment("")), !e.getElementsByTagName("*").length
-                    }), h.getElementsByClassName = Z.test(E.getElementsByClassName), h.getById = le(function(e) {
+                    }), h.getElementsByClassName = Q.test(E.getElementsByClassName), h.getById = ue(function(e) {
                         return a.appendChild(e).id = k, !E.getElementsByName || !E.getElementsByName(k).length
                     }), h.getById ? (_.filter.ID = function(e) {
-                        var t = e.replace(J, ee);
+                        var t = e.replace(te, ne);
                         return function(e) {
                             return e.getAttribute("id") === t
                         }
                             return n ? [n] : []
                         }
                     }) : (_.filter.ID = function(e) {
-                        var n = e.replace(J, ee);
+                        var n = e.replace(te, ne);
                         return function(e) {
                             var t = void 0 !== e.getAttributeNode && e.getAttributeNode("id");
                             return t && t.value === n
                         return r
                     }, _.find.CLASS = h.getElementsByClassName && function(e, t) {
                         if (void 0 !== t.getElementsByClassName && C) return t.getElementsByClassName(e)
-                    }, s = [], g = [], (h.qsa = Z.test(E.querySelectorAll)) && (le(function(e) {
-                        a.appendChild(e).innerHTML = "<a id='" + k + "'></a><select id='" + k + "-\r\\' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && g.push("[*^$]=" + P + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || g.push("\\[" + P + "*(?:value|" + R + ")"), e.querySelectorAll("[id~=" + k + "-]").length || g.push("~="), e.querySelectorAll(":checked").length || g.push(":checked"), e.querySelectorAll("a#" + k + "+*").length || g.push(".#.+[+~]")
-                    }), le(function(e) {
+                    }, s = [], g = [], (h.qsa = Q.test(E.querySelectorAll)) && (ue(function(e) {
+                        a.appendChild(e).innerHTML = "<a id='" + k + "'></a><select id='" + k + "-\r\\' msallowcapture=''><option selected=''></option></select>", e.querySelectorAll("[msallowcapture^='']").length && g.push("[*^$]=" + H + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || g.push("\\[" + H + "*(?:value|" + P + ")"), e.querySelectorAll("[id~=" + k + "-]").length || g.push("~="), e.querySelectorAll(":checked").length || g.push(":checked"), e.querySelectorAll("a#" + k + "+*").length || g.push(".#.+[+~]")
+                    }), ue(function(e) {
                         e.innerHTML = "<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";
                         var t = E.createElement("input");
-                        t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && g.push("name" + P + "*[*^$|!~]?="), 2 !== e.querySelectorAll(":enabled").length && g.push(":enabled", ":disabled"), a.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:")
-                    })), (h.matchesSelector = Z.test(u = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.msMatchesSelector)) && le(function(e) {
-                        h.disconnectedMatch = u.call(e, "*"), u.call(e, "[s!='']:x"), s.push("!=", L)
-                    }), g = g.length && new RegExp(g.join("|")), s = s.length && new RegExp(s.join("|")), t = Z.test(a.compareDocumentPosition), v = t || Z.test(a.contains) ? function(e, t) {
+                        t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && g.push("name" + H + "*[*^$|!~]?="), 2 !== e.querySelectorAll(":enabled").length && g.push(":enabled", ":disabled"), a.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && g.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), g.push(",.*:")
+                    })), (h.matchesSelector = Q.test(u = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.msMatchesSelector)) && ue(function(e) {
+                        h.disconnectedMatch = u.call(e, "*"), u.call(e, "[s!='']:x"), s.push("!=", F)
+                    }), g = g.length && new RegExp(g.join("|")), s = s.length && new RegExp(s.join("|")), t = Q.test(a.compareDocumentPosition), v = t || Q.test(a.contains) ? function(e, t) {
                         var n = 9 === e.nodeType ? e.documentElement : e,
                             r = t && t.parentNode;
                         return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r)))
                             for (; t = t.parentNode;)
                                 if (t === e) return !0;
                         return !1
-                    }, M = t ? function(e, t) {
+                    }, A = t ? function(e, t) {
                         if (e === t) return c = !0, 0;
                         var n = !e.compareDocumentPosition - !t.compareDocumentPosition;
-                        return n || (1 & (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !h.sortDetached && t.compareDocumentPosition(e) === n ? e === E || e.ownerDocument === b && v(b, e) ? -1 : t === E || t.ownerDocument === b && v(b, t) ? 1 : l ? I(l, e) - I(l, t) : 0 : 4 & n ? -1 : 1)
+                        return n || (1 & (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !h.sortDetached && t.compareDocumentPosition(e) === n ? e === E || e.ownerDocument === b && v(b, e) ? -1 : t === E || t.ownerDocument === b && v(b, t) ? 1 : l ? R(l, e) - R(l, t) : 0 : 4 & n ? -1 : 1)
                     } : function(e, t) {
                         if (e === t) return c = !0, 0;
                         var n, r = 0,
                             o = t.parentNode,
                             a = [e],
                             s = [t];
-                        if (!i || !o) return e === E ? -1 : t === E ? 1 : i ? -1 : o ? 1 : l ? I(l, e) - I(l, t) : 0;
-                        if (i === o) return ue(e, t);
+                        if (!i || !o) return e === E ? -1 : t === E ? 1 : i ? -1 : o ? 1 : l ? R(l, e) - R(l, t) : 0;
+                        if (i === o) return fe(e, t);
                         for (n = e; n = n.parentNode;) a.unshift(n);
                         for (n = t; n = n.parentNode;) s.unshift(n);
                         for (; a[r] === s[r];) r++;
-                        return r ? ue(a[r], s[r]) : a[r] === b ? -1 : s[r] === b ? 1 : 0
+                        return r ? fe(a[r], s[r]) : a[r] === b ? -1 : s[r] === b ? 1 : 0
                     }), E
-                }, oe.matches = function(e, t) {
-                    return oe(e, null, null, t)
-                }, oe.matchesSelector = function(e, t) {
-                    if ((e.ownerDocument || e) !== E && w(e), t = t.replace(z, "='$1']"), h.matchesSelector && C && !T[t + " "] && (!s || !s.test(t)) && (!g || !g.test(t))) try {
+                }, se.matches = function(e, t) {
+                    return se(e, null, null, t)
+                }, se.matchesSelector = function(e, t) {
+                    if ((e.ownerDocument || e) !== E && w(e), h.matchesSelector && C && !M[t + " "] && (!s || !s.test(t)) && (!g || !g.test(t))) try {
                         var n = u.call(e, t);
                         if (n || h.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n
-                    } catch (e) {}
-                    return 0 < oe(t, E, null, [e]).length
-                }, oe.contains = function(e, t) {
+                    } catch (e) {
+                        M(t, !0)
+                    }
+                    return 0 < se(t, E, null, [e]).length
+                }, se.contains = function(e, t) {
                     return (e.ownerDocument || e) !== E && w(e), v(e, t)
-                }, oe.attr = function(e, t) {
+                }, se.attr = function(e, t) {
                     (e.ownerDocument || e) !== E && w(e);
                     var n = _.attrHandle[t.toLowerCase()],
-                        r = n && A.call(_.attrHandle, t.toLowerCase()) ? n(e, t, !C) : void 0;
+                        r = n && S.call(_.attrHandle, t.toLowerCase()) ? n(e, t, !C) : void 0;
                     return void 0 !== r ? r : h.attributes || !C ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null
-                }, oe.escape = function(e) {
-                    return (e + "").replace(te, ne)
-                }, oe.error = function(e) {
+                }, se.escape = function(e) {
+                    return (e + "").replace(re, ie)
+                }, se.error = function(e) {
                     throw new Error("Syntax error, unrecognized expression: " + e)
-                }, oe.uniqueSort = function(e) {
+                }, se.uniqueSort = function(e) {
                     var t, n = [],
                         r = 0,
                         i = 0;
-                    if (c = !h.detectDuplicates, l = !h.sortStable && e.slice(0), e.sort(M), c) {
+                    if (c = !h.detectDuplicates, l = !h.sortStable && e.slice(0), e.sort(A), c) {
                         for (; t = e[i++];) t === e[i] && (r = n.push(i));
                         for (; r--;) e.splice(n[r], 1)
                     }
                     return l = null, e
-                }, o = oe.getText = function(e) {
+                }, o = se.getText = function(e) {
                     var t, n = "",
                         r = 0,
                         i = e.nodeType;
                     } else
                         for (; t = e[r++];) n += o(t);
                     return n
-                }, (_ = oe.selectors = {
+                }, (_ = se.selectors = {
                     cacheLength: 50,
-                    createPseudo: se,
-                    match: Y,
+                    createPseudo: ce,
+                    match: G,
                     attrHandle: {},
                     find: {},
                     relative: {
                     },
                     preFilter: {
                         ATTR: function(e) {
-                            return e[1] = e[1].replace(J, ee), e[3] = (e[3] || e[4] || e[5] || "").replace(J, ee), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4)
+                            return e[1] = e[1].replace(te, ne), e[3] = (e[3] || e[4] || e[5] || "").replace(te, ne), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4)
                         },
                         CHILD: function(e) {
-                            return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || oe.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && oe.error(e[0]), e
+                            return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || se.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && se.error(e[0]), e
                         },
                         PSEUDO: function(e) {
                             var t, n = !e[6] && e[2];
-                            return Y.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && B.test(n) && (t = p(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3))
+                            return G.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && W.test(n) && (t = p(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3))
                         }
                     },
                     filter: {
                         TAG: function(e) {
-                            var t = e.replace(J, ee).toLowerCase();
+                            var t = e.replace(te, ne).toLowerCase();
                             return "*" === e ? function() {
                                 return !0
                             } : function(e) {
                         },
                         CLASS: function(e) {
                             var t = f[e + " "];
-                            return t || (t = new RegExp("(^|" + P + ")" + e + "(" + P + "|$)")) && f(e, function(e) {
+                            return t || (t = new RegExp("(^|" + H + ")" + e + "(" + H + "|$)")) && f(e, function(e) {
                                 return t.test("string" == typeof e.className && e.className || void 0 !== e.getAttribute && e.getAttribute("class") || "")
                             })
                         },
                         ATTR: function(n, r, i) {
                             return function(e) {
-                                var t = oe.attr(e, n);
-                                return null == t ? "!=" === r : !r || (t += "", "=" === r ? t === i : "!=" === r ? t !== i : "^=" === r ? i && 0 === t.indexOf(i) : "*=" === r ? i && -1 < t.indexOf(i) : "$=" === r ? i && t.slice(-i.length) === i : "~=" === r ? -1 < (" " + t.replace(F, " ") + " ").indexOf(i) : "|=" === r && (t === i || t.slice(0, i.length + 1) === i + "-"))
+                                var t = se.attr(e, n);
+                                return null == t ? "!=" === r : !r || (t += "", "=" === r ? t === i : "!=" === r ? t !== i : "^=" === r ? i && 0 === t.indexOf(i) : "*=" === r ? i && -1 < t.indexOf(i) : "$=" === r ? i && t.slice(-i.length) === i : "~=" === r ? -1 < (" " + t.replace(q, " ") + " ").indexOf(i) : "|=" === r && (t === i || t.slice(0, i.length + 1) === i + "-"))
                             }
                         },
                         CHILD: function(p, e, t, m, g) {
                             }
                         },
                         PSEUDO: function(e, o) {
-                            var t, a = _.pseudos[e] || _.setFilters[e.toLowerCase()] || oe.error("unsupported pseudo: " + e);
-                            return a[k] ? a(o) : 1 < a.length ? (t = [e, e, "", o], _.setFilters.hasOwnProperty(e.toLowerCase()) ? se(function(e, t) {
-                                for (var n, r = a(e, o), i = r.length; i--;) e[n = I(e, r[i])] = !(t[n] = r[i])
+                            var t, a = _.pseudos[e] || _.setFilters[e.toLowerCase()] || se.error("unsupported pseudo: " + e);
+                            return a[k] ? a(o) : 1 < a.length ? (t = [e, e, "", o], _.setFilters.hasOwnProperty(e.toLowerCase()) ? ce(function(e, t) {
+                                for (var n, r = a(e, o), i = r.length; i--;) e[n = R(e, r[i])] = !(t[n] = r[i])
                             }) : function(e) {
                                 return a(e, 0, t)
                             }) : a
                         }
                     },
                     pseudos: {
-                        not: se(function(e) {
+                        not: ce(function(e) {
                             var r = [],
                                 i = [],
-                                s = d(e.replace(q, "$1"));
-                            return s[k] ? se(function(e, t, n, r) {
+                                s = d(e.replace(U, "$1"));
+                            return s[k] ? ce(function(e, t, n, r) {
                                 for (var i, o = s(e, null, r, []), a = e.length; a--;)(i = o[a]) && (e[a] = !(t[a] = i))
                             }) : function(e, t, n) {
                                 return r[0] = e, s(r, null, n, i), r[0] = null, !i.pop()
                             }
                         }),
-                        has: se(function(t) {
+                        has: ce(function(t) {
                             return function(e) {
-                                return 0 < oe(t, e).length
+                                return 0 < se(t, e).length
                             }
                         }),
-                        contains: se(function(t) {
-                            return t = t.replace(J, ee),
+                        contains: ce(function(t) {
+                            return t = t.replace(te, ne),
                                 function(e) {
-                                    return -1 < (e.textContent || e.innerText || o(e)).indexOf(t)
+                                    return -1 < (e.textContent || o(e)).indexOf(t)
                                 }
                         }),
-                        lang: se(function(n) {
-                            return W.test(n || "") || oe.error("unsupported lang: " + n), n = n.replace(J, ee).toLowerCase(),
+                        lang: ce(function(n) {
+                            return Y.test(n || "") || se.error("unsupported lang: " + n), n = n.replace(te, ne).toLowerCase(),
                                 function(e) {
                                     var t;
                                     do {
                         focus: function(e) {
                             return e === E.activeElement && (!E.hasFocus || E.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
                         },
-                        enabled: he(!1),
-                        disabled: he(!0),
+                        enabled: me(!1),
+                        disabled: me(!0),
                         checked: function(e) {
                             var t = e.nodeName.toLowerCase();
                             return "input" === t && !!e.checked || "option" === t && !!e.selected
                             return !_.pseudos.empty(e)
                         },
                         header: function(e) {
-                            return K.test(e.nodeName)
+                            return X.test(e.nodeName)
                         },
                         input: function(e) {
-                            return G.test(e.nodeName)
+                            return Z.test(e.nodeName)
                         },
                         button: function(e) {
                             var t = e.nodeName.toLowerCase();
                             var t;
                             return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase())
                         },
-                        first: pe(function() {
+                        first: ge(function() {
                             return [0]
                         }),
-                        last: pe(function(e, t) {
+                        last: ge(function(e, t) {
                             return [t - 1]
                         }),
-                        eq: pe(function(e, t, n) {
+                        eq: ge(function(e, t, n) {
                             return [n < 0 ? n + t : n]
                         }),
-                        even: pe(function(e, t) {
+                        even: ge(function(e, t) {
                             for (var n = 0; n < t; n += 2) e.push(n);
                             return e
                         }),
-                        odd: pe(function(e, t) {
+                        odd: ge(function(e, t) {
                             for (var n = 1; n < t; n += 2) e.push(n);
                             return e
                         }),
-                        lt: pe(function(e, t, n) {
-                            for (var r = n < 0 ? n + t : n; 0 <= --r;) e.push(r);
+                        lt: ge(function(e, t, n) {
+                            for (var r = n < 0 ? n + t : t < n ? t : n; 0 <= --r;) e.push(r);
                             return e
                         }),
-                        gt: pe(function(e, t, n) {
+                        gt: ge(function(e, t, n) {
                             for (var r = n < 0 ? n + t : n; ++r < t;) e.push(r);
                             return e
                         })
                     file: !0,
                     password: !0,
                     image: !0
-                }) _.pseudos[e] = de(e);
+                }) _.pseudos[e] = he(e);
             for (e in {
                     submit: !0,
                     reset: !0
-                }) _.pseudos[e] = fe(e);
+                }) _.pseudos[e] = pe(e);
 
-            function ge() {}
+            function be() {}
 
-            function ve(e) {
+            function ye(e) {
                 for (var t = 0, n = e.length, r = ""; t < n; t++) r += e[t].value;
                 return r
             }
 
-            function be(s, e, t) {
+            function _e(s, e, t) {
                 var l = e.dir,
                     c = e.next,
                     u = c || l,
                 }
             }
 
-            function ye(i) {
+            function $e(i) {
                 return 1 < i.length ? function(e, t, n) {
                     for (var r = i.length; r--;)
                         if (!i[r](e, t, n)) return !1;
                 } : i[0]
             }
 
-            function _e(e, t, n, r, i) {
+            function we(e, t, n, r, i) {
                 for (var o, a = [], s = 0, l = e.length, c = null != t; s < l; s++)(o = e[s]) && (n && !n(o, r, i) || (a.push(o), c && t.push(s)));
                 return a
             }
 
-            function $e(h, p, m, g, v, e) {
-                return g && !g[k] && (g = $e(g)), v && !v[k] && (v = $e(v, e)), se(function(e, t, n, r) {
+            function Ee(h, p, m, g, v, e) {
+                return g && !g[k] && (g = Ee(g)), v && !v[k] && (v = Ee(v, e)), ce(function(e, t, n, r) {
                     var i, o, a, s = [],
                         l = [],
                         c = t.length,
                         u = e || function(e, t, n) {
-                            for (var r = 0, i = t.length; r < i; r++) oe(e, t[r], n);
+                            for (var r = 0, i = t.length; r < i; r++) se(e, t[r], n);
                             return n
                         }(p || "*", n.nodeType ? [n] : n, []),
-                        d = !h || !e && p ? u : _e(u, s, h, n, r),
+                        d = !h || !e && p ? u : we(u, s, h, n, r),
                         f = m ? v || (e ? h : c || g) ? [] : t : d;
                     if (m && m(d, f, n, r), g)
-                        for (i = _e(f, l), g(i, [], n, r), o = i.length; o--;)(a = i[o]) && (f[l[o]] = !(d[l[o]] = a));
+                        for (i = we(f, l), g(i, [], n, r), o = i.length; o--;)(a = i[o]) && (f[l[o]] = !(d[l[o]] = a));
                     if (e) {
                         if (v || h) {
                             if (v) {
                                 for (i = [], o = f.length; o--;)(a = f[o]) && i.push(d[o] = a);
                                 v(null, f = [], i, r)
                             }
-                            for (o = f.length; o--;)(a = f[o]) && -1 < (i = v ? I(e, a) : s[o]) && (e[i] = !(t[i] = a))
+                            for (o = f.length; o--;)(a = f[o]) && -1 < (i = v ? R(e, a) : s[o]) && (e[i] = !(t[i] = a))
                         }
-                    } else f = _e(f === t ? f.splice(c, f.length) : f), v ? v(null, t, f, r) : D.apply(t, f)
+                    } else f = we(f === t ? f.splice(c, f.length) : f), v ? v(null, t, f, r) : N.apply(t, f)
                 })
             }
 
-            function we(e) {
-                for (var i, t, n, r = e.length, o = _.relative[e[0].type], a = o || _.relative[" "], s = o ? 1 : 0, l = be(function(e) {
+            function Ce(e) {
+                for (var i, t, n, r = e.length, o = _.relative[e[0].type], a = o || _.relative[" "], s = o ? 1 : 0, l = _e(function(e) {
                         return e === i
-                    }, a, !0), c = be(function(e) {
-                        return -1 < I(i, e)
+                    }, a, !0), c = _e(function(e) {
+                        return -1 < R(i, e)
                     }, a, !0), u = [function(e, t, n) {
                         var r = !o && (n || t !== $) || ((i = t).nodeType ? l(e, t, n) : c(e, t, n));
                         return i = null, r
                     }]; s < r; s++)
-                    if (t = _.relative[e[s].type]) u = [be(ye(u), t)];
+                    if (t = _.relative[e[s].type]) u = [_e($e(u), t)];
                     else {
                         if ((t = _.filter[e[s].type].apply(null, e[s].matches))[k]) {
                             for (n = ++s; n < r && !_.relative[e[n].type]; n++);
-                            return $e(1 < s && ye(u), 1 < s && ve(e.slice(0, s - 1).concat({
+                            return Ee(1 < s && $e(u), 1 < s && ye(e.slice(0, s - 1).concat({
                                 value: " " === e[s - 2].type ? "*" : ""
-                            })).replace(q, "$1"), t, s < n && we(e.slice(s, n)), n < r && we(e = e.slice(n)), n < r && ve(e))
+                            })).replace(U, "$1"), t, s < n && Ce(e.slice(s, n)), n < r && Ce(e = e.slice(n)), n < r && ye(e))
                         }
                         u.push(t)
-                    } return ye(u)
+                    } return $e(u)
             }
-            return ge.prototype = _.filters = _.pseudos, _.setFilters = new ge, p = oe.tokenize = function(e, t) {
+            return be.prototype = _.filters = _.pseudos, _.setFilters = new be, p = se.tokenize = function(e, t) {
                 var n, r, i, o, a, s, l, c = y[e + " "];
                 if (c) return t ? 0 : c.slice(0);
                 for (a = e, s = [], l = _.preFilter; a;) {
-                    for (o in n && !(r = U.exec(a)) || (r && (a = a.slice(r[0].length) || a), s.push(i = [])), n = !1, (r = V.exec(a)) && (n = r.shift(), i.push({
+                    for (o in n && !(r = V.exec(a)) || (r && (a = a.slice(r[0].length) || a), s.push(i = [])), n = !1, (r = B.exec(a)) && (n = r.shift(), i.push({
                             value: n,
-                            type: r[0].replace(q, " ")
-                        }), a = a.slice(n.length)), _.filter) !(r = Y[o].exec(a)) || l[o] && !(r = l[o](r)) || (n = r.shift(), i.push({
+                            type: r[0].replace(U, " ")
+                        }), a = a.slice(n.length)), _.filter) !(r = G[o].exec(a)) || l[o] && !(r = l[o](r)) || (n = r.shift(), i.push({
                         value: n,
                         type: o,
                         matches: r
                     }), a = a.slice(n.length));
                     if (!n) break
                 }
-                return t ? a.length : a ? oe.error(e) : y(e, s).slice(0)
-            }, d = oe.compile = function(e, t) {
+                return t ? a.length : a ? se.error(e) : y(e, s).slice(0)
+            }, d = se.compile = function(e, t) {
                 var n, g, v, b, y, r, i = [],
                     o = [],
                     a = T[e + " "];
                 if (!a) {
-                    for (t || (t = p(e)), n = t.length; n--;)(a = we(t[n]))[k] ? i.push(a) : o.push(a);
+                    for (t || (t = p(e)), n = t.length; n--;)(a = Ce(t[n]))[k] ? i.push(a) : o.push(a);
                     (a = T(e, (g = o, b = 0 < (v = i).length, y = 0 < g.length, r = function(e, t, n, r, i) {
                         var o, a, s, l = 0,
                             c = "0",
                             for (a = 0; s = v[a++];) s(u, d, t, n);
                             if (e) {
                                 if (0 < l)
-                                    for (; c--;) u[c] || d[c] || (d[c] = S.call(r));
-                                d = _e(d)
+                                    for (; c--;) u[c] || d[c] || (d[c] = D.call(r));
+                                d = we(d)
                             }
-                            D.apply(r, d), i && !e && 0 < d.length && 1 < l + v.length && oe.uniqueSort(r)
+                            N.apply(r, d), i && !e && 0 < d.length && 1 < l + v.length && se.uniqueSort(r)
                         }
                         return i && (x = p, $ = f), u
-                    }, b ? se(r) : r))).selector = e
+                    }, b ? ce(r) : r))).selector = e
                 }
                 return a
-            }, m = oe.select = function(e, t, n, r) {
+            }, m = se.select = function(e, t, n, r) {
                 var i, o, a, s, l, c = "function" == typeof e && e,
                     u = !r && p(e = c.selector || e);
                 if (n = n || [], 1 === u.length) {
                     if (2 < (o = u[0] = u[0].slice(0)).length && "ID" === (a = o[0]).type && 9 === t.nodeType && C && _.relative[o[1].type]) {
-                        if (!(t = (_.find.ID(a.matches[0].replace(J, ee), t) || [])[0])) return n;
+                        if (!(t = (_.find.ID(a.matches[0].replace(te, ne), t) || [])[0])) return n;
                         c && (t = t.parentNode), e = e.slice(o.shift().value.length)
                     }
-                    for (i = Y.needsContext.test(e) ? 0 : o.length; i-- && (a = o[i], !_.relative[s = a.type]);)
-                        if ((l = _.find[s]) && (r = l(a.matches[0].replace(J, ee), Q.test(o[0].type) && me(t.parentNode) || t))) {
-                            if (o.splice(i, 1), !(e = r.length && ve(o))) return D.apply(n, r), n;
+                    for (i = G.needsContext.test(e) ? 0 : o.length; i-- && (a = o[i], !_.relative[s = a.type]);)
+                        if ((l = _.find[s]) && (r = l(a.matches[0].replace(te, ne), ee.test(o[0].type) && ve(t.parentNode) || t))) {
+                            if (o.splice(i, 1), !(e = r.length && ye(o))) return N.apply(n, r), n;
                             break
                         }
                 }
-                return (c || d(e, u))(r, t, !C, n, !t || Q.test(e) && me(t.parentNode) || t), n
-            }, h.sortStable = k.split("").sort(M).join("") === k, h.detectDuplicates = !!c, w(), h.sortDetached = le(function(e) {
+                return (c || d(e, u))(r, t, !C, n, !t || ee.test(e) && ve(t.parentNode) || t), n
+            }, h.sortStable = k.split("").sort(A).join("") === k, h.detectDuplicates = !!c, w(), h.sortDetached = ue(function(e) {
                 return 1 & e.compareDocumentPosition(E.createElement("fieldset"))
-            }), le(function(e) {
+            }), ue(function(e) {
                 return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href")
-            }) || ce("type|href|height|width", function(e, t, n) {
+            }) || de("type|href|height|width", function(e, t, n) {
                 if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2)
-            }), h.attributes && le(function(e) {
+            }), h.attributes && ue(function(e) {
                 return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value")
-            }) || ce("value", function(e, t, n) {
+            }) || de("value", function(e, t, n) {
                 if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue
-            }), le(function(e) {
+            }), ue(function(e) {
                 return null == e.getAttribute("disabled")
-            }) || ce(R, function(e, t, n) {
+            }) || de(P, function(e, t, n) {
                 var r;
                 if (!n) return !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null
-            }), oe
+            }), se
         }(E);
         k.find = h, k.expr = h.selectors, k.expr[":"] = k.expr.pseudos, k.uniqueSort = k.unique = h.uniqueSort, k.text = h.getText, k.isXMLDoc = h.isXML, k.contains = h.contains, k.escapeSelector = h.escape;
         var p = function(e, t, n) {
                 return !!A(this, "string" == typeof e && x.test(e) ? k(e) : e || [], !1).length
             }
         });
-        var S, O = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;
+        var S, D = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;
         (k.fn.init = function(e, t, n) {
             var r, i;
             if (!e) return this;
             if (n = n || S, "string" != typeof e) return e.nodeType ? (this[0] = e, this.length = 1, this) : b(e) ? void 0 !== n.ready ? n.ready(e) : e(k) : k.makeArray(e, this);
-            if (!(r = "<" === e[0] && ">" === e[e.length - 1] && 3 <= e.length ? [null, e, null] : O.exec(e)) || !r[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e);
+            if (!(r = "<" === e[0] && ">" === e[e.length - 1] && 3 <= e.length ? [null, e, null] : D.exec(e)) || !r[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e);
             if (r[1]) {
                 if (t = t instanceof k ? t[0] : t, k.merge(this, k.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : C, !0)), M.test(r[1]) && k.isPlainObject(t))
                     for (r in t) b(this[r]) ? this[r](t[r]) : this.attr(r, t[r]);
             }
             return (i = C.getElementById(r[2])) && (this[0] = i, this.length = 1), this
         }).prototype = k.fn, S = k(C);
-        var D = /^(?:parents|prev(?:Until|All))/,
+        var O = /^(?:parents|prev(?:Until|All))/,
             N = {
                 children: !0,
                 contents: !0,
                 return w(e.firstChild)
             },
             contents: function(e) {
-                return T(e, "iframe") ? e.contentDocument : (T(e, "template") && (e = e.content || e), k.merge([], e.childNodes))
+                return void 0 !== e.contentDocument ? e.contentDocument : (T(e, "template") && (e = e.content || e), k.merge([], e.childNodes))
             }
         }, function(r, i) {
             k.fn[r] = function(e, t) {
                 var n = k.map(this, i, e);
-                return "Until" !== r.slice(-5) && (t = e), t && "string" == typeof t && (n = k.filter(t, n)), 1 < this.length && (N[r] || k.uniqueSort(n), D.test(r) && n.reverse()), this.pushStack(n)
+                return "Until" !== r.slice(-5) && (t = e), t && "string" == typeof t && (n = k.filter(t, n)), 1 < this.length && (N[r] || k.uniqueSort(n), O.test(r) && n.reverse()), this.pushStack(n)
             }
         });
         var R = /[^\x20\t\r\n\f]+/g;
                 return i ? e : c ? t.call(e) : l ? t(e[0], n) : o
             },
             V = /^-ms-/,
-            z = /-([a-z])/g;
+            B = /-([a-z])/g;
 
-        function B(e, t) {
+        function z(e, t) {
             return t.toUpperCase()
         }
 
         function W(e) {
-            return e.replace(V, "ms-").replace(z, B)
+            return e.replace(V, "ms-").replace(B, z)
         }
         var Y = function(e) {
             return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType
         var ee = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
             te = new RegExp("^(?:([+-])=|)(" + ee + ")([a-z%]*)$", "i"),
             ne = ["Top", "Right", "Bottom", "Left"],
-            re = function(e, t) {
-                return "none" === (e = t || e).style.display || "" === e.style.display && k.contains(e.ownerDocument, e) && "none" === k.css(e, "display")
+            re = C.documentElement,
+            ie = function(e) {
+                return k.contains(e.ownerDocument, e)
+            },
+            oe = {
+                composed: !0
+            };
+        re.getRootNode && (ie = function(e) {
+            return k.contains(e.ownerDocument, e) || e.getRootNode(oe) === e.ownerDocument
+        });
+        var ae = function(e, t) {
+                return "none" === (e = t || e).style.display || "" === e.style.display && ie(e) && "none" === k.css(e, "display")
             },
-            ie = function(e, t, n, r) {
+            se = function(e, t, n, r) {
                 var i, o, a = {};
                 for (o in t) a[o] = e.style[o], e.style[o] = t[o];
                 for (o in i = n.apply(e, r || []), t) e.style[o] = a[o];
                 return i
             };
 
-        function oe(e, t, n, r) {
+        function le(e, t, n, r) {
             var i, o, a = 20,
                 s = r ? function() {
                     return r.cur()
                 },
                 l = s(),
                 c = n && n[3] || (k.cssNumber[t] ? "" : "px"),
-                u = (k.cssNumber[t] || "px" !== c && +l) && te.exec(k.css(e, t));
+                u = e.nodeType && (k.cssNumber[t] || "px" !== c && +l) && te.exec(k.css(e, t));
             if (u && u[3] !== c) {
                 for (l /= 2, c = c || u[3], u = +l || 1; a--;) k.style(e, t, u + c), (1 - o) * (1 - (o = s() / l || .5)) <= 0 && (a = 0), u /= o;
                 u *= 2, k.style(e, t, u + c), n = n || []
             }
             return n && (u = +u || +l || 0, i = n[1] ? u + (n[1] + 1) * n[2] : +n[2], r && (r.unit = c, r.start = u, r.end = i)), i
         }
-        var ae = {};
+        var ce = {};
 
-        function se(e, t) {
-            for (var n, r, i, o, a, s, l, c = [], u = 0, d = e.length; u < d; u++)(r = e[u]).style && (n = r.style.display, t ? ("none" === n && (c[u] = K.get(r, "display") || null, c[u] || (r.style.display = "")), "" === r.style.display && re(r) && (c[u] = (l = a = o = void 0, a = (i = r).ownerDocument, s = i.nodeName, (l = ae[s]) || (o = a.body.appendChild(a.createElement(s)), l = k.css(o, "display"), o.parentNode.removeChild(o), "none" === l && (l = "block"), ae[s] = l)))) : "none" !== n && (c[u] = "none", K.set(r, "display", n)));
+        function ue(e, t) {
+            for (var n, r, i, o, a, s, l, c = [], u = 0, d = e.length; u < d; u++)(r = e[u]).style && (n = r.style.display, t ? ("none" === n && (c[u] = K.get(r, "display") || null, c[u] || (r.style.display = "")), "" === r.style.display && ae(r) && (c[u] = (l = a = o = void 0, a = (i = r).ownerDocument, s = i.nodeName, (l = ce[s]) || (o = a.body.appendChild(a.createElement(s)), l = k.css(o, "display"), o.parentNode.removeChild(o), "none" === l && (l = "block"), ce[s] = l)))) : "none" !== n && (c[u] = "none", K.set(r, "display", n)));
             for (u = 0; u < d; u++) null != c[u] && (e[u].style.display = c[u]);
             return e
         }
         k.fn.extend({
             show: function() {
-                return se(this, !0)
+                return ue(this, !0)
             },
             hide: function() {
-                return se(this)
+                return ue(this)
             },
             toggle: function(e) {
                 return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() {
-                    re(this) ? k(this).show() : k(this).hide()
+                    ae(this) ? k(this).show() : k(this).hide()
                 })
             }
         });
-        var le = /^(?:checkbox|radio)$/i,
-            ce = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i,
-            ue = /^$|^module$|\/(?:java|ecma)script/i,
-            de = {
+        var de = /^(?:checkbox|radio)$/i,
+            fe = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i,
+            he = /^$|^module$|\/(?:java|ecma)script/i,
+            pe = {
                 option: [1, "<select multiple='multiple'>", "</select>"],
                 thead: [1, "<table>", "</table>"],
                 col: [2, "<table><colgroup>", "</colgroup></table>"],
                 _default: [0, "", ""]
             };
 
-        function fe(e, t) {
+        function me(e, t) {
             var n;
             return n = void 0 !== e.getElementsByTagName ? e.getElementsByTagName(t || "*") : void 0 !== e.querySelectorAll ? e.querySelectorAll(t || "*") : [], void 0 === t || t && T(e, t) ? k.merge([e], n) : n
         }
 
-        function he(e, t) {
+        function ge(e, t) {
             for (var n = 0, r = e.length; n < r; n++) K.set(e[n], "globalEval", !t || K.get(t[n], "globalEval"))
         }
-        de.optgroup = de.option, de.tbody = de.tfoot = de.colgroup = de.caption = de.thead, de.th = de.td;
-        var pe, me, ge = /<|&#?\w+;/;
+        pe.optgroup = pe.option, pe.tbody = pe.tfoot = pe.colgroup = pe.caption = pe.thead, pe.th = pe.td;
+        var ve, be, ye = /<|&#?\w+;/;
 
-        function ve(e, t, n, r, i) {
+        function _e(e, t, n, r, i) {
             for (var o, a, s, l, c, u, d = t.createDocumentFragment(), f = [], h = 0, p = e.length; h < p; h++)
                 if ((o = e[h]) || 0 === o)
                     if ("object" === $(o)) k.merge(f, o.nodeType ? [o] : o);
-                    else if (ge.test(o)) {
-                for (a = a || d.appendChild(t.createElement("div")), s = (ce.exec(o) || ["", ""])[1].toLowerCase(), l = de[s] || de._default, a.innerHTML = l[1] + k.htmlPrefilter(o) + l[2], u = l[0]; u--;) a = a.lastChild;
+                    else if (ye.test(o)) {
+                for (a = a || d.appendChild(t.createElement("div")), s = (fe.exec(o) || ["", ""])[1].toLowerCase(), l = pe[s] || pe._default, a.innerHTML = l[1] + k.htmlPrefilter(o) + l[2], u = l[0]; u--;) a = a.lastChild;
                 k.merge(f, a.childNodes), (a = d.firstChild).textContent = ""
             } else f.push(t.createTextNode(o));
             for (d.textContent = "", h = 0; o = f[h++];)
                 if (r && -1 < k.inArray(o, r)) i && i.push(o);
-                else if (c = k.contains(o.ownerDocument, o), a = fe(d.appendChild(o), "script"), c && he(a), n)
-                for (u = 0; o = a[u++];) ue.test(o.type || "") && n.push(o);
+                else if (c = ie(o), a = me(d.appendChild(o), "script"), c && ge(a), n)
+                for (u = 0; o = a[u++];) he.test(o.type || "") && n.push(o);
             return d
         }
-        pe = C.createDocumentFragment().appendChild(C.createElement("div")), (me = C.createElement("input")).setAttribute("type", "radio"), me.setAttribute("checked", "checked"), me.setAttribute("name", "t"), pe.appendChild(me), v.checkClone = pe.cloneNode(!0).cloneNode(!0).lastChild.checked, pe.innerHTML = "<textarea>x</textarea>", v.noCloneChecked = !!pe.cloneNode(!0).lastChild.defaultValue;
-        var be = C.documentElement,
-            ye = /^key/,
-            _e = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
-            $e = /^([^.]*)(?:\.(.+)|)/;
+        ve = C.createDocumentFragment().appendChild(C.createElement("div")), (be = C.createElement("input")).setAttribute("type", "radio"), be.setAttribute("checked", "checked"), be.setAttribute("name", "t"), ve.appendChild(be), v.checkClone = ve.cloneNode(!0).cloneNode(!0).lastChild.checked, ve.innerHTML = "<textarea>x</textarea>", v.noCloneChecked = !!ve.cloneNode(!0).lastChild.defaultValue;
+        var $e = /^key/,
+            we = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
+            Ee = /^([^.]*)(?:\.(.+)|)/;
 
-        function we() {
+        function Ce() {
             return !0
         }
 
-        function Ee() {
+        function ke() {
             return !1
         }
 
-        function Ce() {
-            try {
-                return C.activeElement
-            } catch (e) {}
+        function xe(e, t) {
+            return e === function() {
+                try {
+                    return C.activeElement
+                } catch (e) {}
+            }() == ("focus" === t)
         }
 
-        function ke(e, t, n, r, i, o) {
+        function Te(e, t, n, r, i, o) {
             var a, s;
             if ("object" == typeof t) {
-                for (s in "string" != typeof n && (r = r || n, n = void 0), t) ke(e, s, n, r, t[s], o);
+                for (s in "string" != typeof n && (r = r || n, n = void 0), t) Te(e, s, n, r, t[s], o);
                 return e
             }
-            if (null == r && null == i ? (i = n, r = n = void 0) : null == i && ("string" == typeof n ? (i = r, r = void 0) : (i = r, r = n, n = void 0)), !1 === i) i = Ee;
+            if (null == r && null == i ? (i = n, r = n = void 0) : null == i && ("string" == typeof n ? (i = r, r = void 0) : (i = r, r = n, n = void 0)), !1 === i) i = ke;
             else if (!i) return e;
             return 1 === o && (a = i, (i = function(e) {
                 return k().off(e), a.apply(this, arguments)
                 k.event.add(this, t, i, r, n)
             })
         }
+
+        function Me(e, i, o) {
+            o ? (K.set(e, i, !1), k.event.add(e, i, {
+                namespace: !1,
+                handler: function(e) {
+                    var t, n, r = K.get(this, i);
+                    if (1 & e.isTrigger && this[i]) {
+                        if (r.length)(k.event.special[i] || {}).delegateType && e.stopPropagation();
+                        else if (r = s.call(arguments), K.set(this, i, r), t = o(this, i), this[i](), r !== (n = K.get(this, i)) || t ? K.set(this, i, !1) : n = {}, r !== n) return e.stopImmediatePropagation(), e.preventDefault(), n.value
+                    } else r.length && (K.set(this, i, {
+                        value: k.event.trigger(k.extend(r[0], k.Event.prototype), r.slice(1), this)
+                    }), e.stopImmediatePropagation())
+                }
+            })) : void 0 === K.get(e, i) && k.event.add(e, i, Ce)
+        }
         k.event = {
             global: {},
             add: function(t, e, n, r, i) {
                 var o, a, s, l, c, u, d, f, h, p, m, g = K.get(t);
                 if (g)
-                    for (n.handler && (n = (o = n).handler, i = o.selector), i && k.find.matchesSelector(be, i), n.guid || (n.guid = k.guid++), (l = g.events) || (l = g.events = {}), (a = g.handle) || (a = g.handle = function(e) {
+                    for (n.handler && (n = (o = n).handler, i = o.selector), i && k.find.matchesSelector(re, i), n.guid || (n.guid = k.guid++), (l = g.events) || (l = g.events = {}), (a = g.handle) || (a = g.handle = function(e) {
                             return void 0 !== k && k.event.triggered !== e.type ? k.event.dispatch.apply(t, arguments) : void 0
-                        }), c = (e = (e || "").match(R) || [""]).length; c--;) h = m = (s = $e.exec(e[c]) || [])[1], p = (s[2] || "").split(".").sort(), h && (d = k.event.special[h] || {}, h = (i ? d.delegateType : d.bindType) || h, d = k.event.special[h] || {}, u = k.extend({
+                        }), c = (e = (e || "").match(R) || [""]).length; c--;) h = m = (s = Ee.exec(e[c]) || [])[1], p = (s[2] || "").split(".").sort(), h && (d = k.event.special[h] || {}, h = (i ? d.delegateType : d.bindType) || h, d = k.event.special[h] || {}, u = k.extend({
                         type: h,
                         origType: m,
                         data: r,
                 var o, a, s, l, c, u, d, f, h, p, m, g = K.hasData(e) && K.get(e);
                 if (g && (l = g.events)) {
                     for (c = (t = (t || "").match(R) || [""]).length; c--;)
-                        if (h = m = (s = $e.exec(t[c]) || [])[1], p = (s[2] || "").split(".").sort(), h) {
+                        if (h = m = (s = Ee.exec(t[c]) || [])[1], p = (s[2] || "").split(".").sort(), h) {
                             for (d = k.event.special[h] || {}, f = l[h = (r ? d.delegateType : d.bindType) || h] || [], s = s[2] && new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = f.length; o--;) u = f[o], !i && m !== u.origType || n && n.guid !== u.guid || s && !s.test(u.namespace) || r && r !== u.selector && ("**" !== r || !u.selector) || (f.splice(o, 1), u.selector && f.delegateCount--, d.remove && d.remove.call(e, u));
                             a && !f.length && (d.teardown && !1 !== d.teardown.call(e, p, g.handle) || k.removeEvent(e, h, g.handle), delete l[h])
                         } else
                     for (a = k.event.handlers.call(this, s, c), t = 0;
                         (i = a[t++]) && !s.isPropagationStopped();)
                         for (s.currentTarget = i.elem, n = 0;
-                            (o = i.handlers[n++]) && !s.isImmediatePropagationStopped();) s.rnamespace && !s.rnamespace.test(o.namespace) || (s.handleObj = o, s.data = o.data, void 0 !== (r = ((k.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, l)) && !1 === (s.result = r) && (s.preventDefault(), s.stopPropagation()));
+                            (o = i.handlers[n++]) && !s.isImmediatePropagationStopped();) s.rnamespace && !1 !== o.namespace && !s.rnamespace.test(o.namespace) || (s.handleObj = o, s.data = o.data, void 0 !== (r = ((k.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, l)) && !1 === (s.result = r) && (s.preventDefault(), s.stopPropagation()));
                     return u.postDispatch && u.postDispatch.call(this, s), s.result
                 }
             },
                 load: {
                     noBubble: !0
                 },
-                focus: {
-                    trigger: function() {
-                        if (this !== Ce() && this.focus) return this.focus(), !1
-                    },
-                    delegateType: "focusin"
-                },
-                blur: {
-                    trigger: function() {
-                        if (this === Ce() && this.blur) return this.blur(), !1
-                    },
-                    delegateType: "focusout"
-                },
                 click: {
-                    trigger: function() {
-                        if ("checkbox" === this.type && this.click && T(this, "input")) return this.click(), !1
+                    setup: function(e) {
+                        var t = this || e;
+                        return de.test(t.type) && t.click && T(t, "input") && Me(t, "click", Ce), !1
+                    },
+                    trigger: function(e) {
+                        var t = this || e;
+                        return de.test(t.type) && t.click && T(t, "input") && Me(t, "click"), !0
                     },
                     _default: function(e) {
-                        return T(e.target, "a")
+                        var t = e.target;
+                        return de.test(t.type) && t.click && T(t, "input") && K.get(t, "click") || T(t, "a")
                     }
                 },
                 beforeunload: {
             e.removeEventListener && e.removeEventListener(t, n)
         }, k.Event = function(e, t) {
             if (!(this instanceof k.Event)) return new k.Event(e, t);
-            e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? we : Ee, this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, t && k.extend(this, t), this.timeStamp = e && e.timeStamp || Date.now(), this[k.expando] = !0
+            e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? Ce : ke, this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, t && k.extend(this, t), this.timeStamp = e && e.timeStamp || Date.now(), this[k.expando] = !0
         }, k.Event.prototype = {
             constructor: k.Event,
-            isDefaultPrevented: Ee,
-            isPropagationStopped: Ee,
-            isImmediatePropagationStopped: Ee,
+            isDefaultPrevented: ke,
+            isPropagationStopped: ke,
+            isImmediatePropagationStopped: ke,
             isSimulated: !1,
             preventDefault: function() {
                 var e = this.originalEvent;
-                this.isDefaultPrevented = we, e && !this.isSimulated && e.preventDefault()
+                this.isDefaultPrevented = Ce, e && !this.isSimulated && e.preventDefault()
             },
             stopPropagation: function() {
                 var e = this.originalEvent;
-                this.isPropagationStopped = we, e && !this.isSimulated && e.stopPropagation()
+                this.isPropagationStopped = Ce, e && !this.isSimulated && e.stopPropagation()
             },
             stopImmediatePropagation: function() {
                 var e = this.originalEvent;
-                this.isImmediatePropagationStopped = we, e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation()
+                this.isImmediatePropagationStopped = Ce, e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation()
             }
         }, k.each({
             altKey: !0,
             shiftKey: !0,
             view: !0,
             char: !0,
+            code: !0,
             charCode: !0,
             key: !0,
             keyCode: !0,
             touches: !0,
             which: function(e) {
                 var t = e.button;
-                return null == e.which && ye.test(e.type) ? null != e.charCode ? e.charCode : e.keyCode : !e.which && void 0 !== t && _e.test(e.type) ? 1 & t ? 1 : 2 & t ? 3 : 4 & t ? 2 : 0 : e.which
+                return null == e.which && $e.test(e.type) ? null != e.charCode ? e.charCode : e.keyCode : !e.which && void 0 !== t && we.test(e.type) ? 1 & t ? 1 : 2 & t ? 3 : 4 & t ? 2 : 0 : e.which
             }
         }, k.event.addProp), k.each({
+            focus: "focusin",
+            blur: "focusout"
+        }, function(e, t) {
+            k.event.special[e] = {
+                setup: function() {
+                    return Me(this, e, xe), !1
+                },
+                trigger: function() {
+                    return Me(this, e), !0
+                },
+                delegateType: t
+            }
+        }), k.each({
             mouseenter: "mouseover",
             mouseleave: "mouseout",
             pointerenter: "pointerover",
             }
         }), k.fn.extend({
             on: function(e, t, n, r) {
-                return ke(this, e, t, n, r)
+                return Te(this, e, t, n, r)
             },
             one: function(e, t, n, r) {
-                return ke(this, e, t, n, r, 1)
+                return Te(this, e, t, n, r, 1)
             },
             off: function(e, t, n) {
                 var r, i;
                 if (e && e.preventDefault && e.handleObj) return r = e.handleObj, k(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this;
-                if ("object" != typeof e) return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = Ee), this.each(function() {
+                if ("object" != typeof e) return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = ke), this.each(function() {
                     k.event.remove(this, e, n, t)
                 });
                 for (i in e) this.off(i, t, e[i]);
                 return this
             }
         });
-        var xe = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
-            Te = /<script|<style|<link/i,
-            Me = /checked\s*(?:[^=]|=\s*.checked.)/i,
-            Ae = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
+        var Ae = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
+            Se = /<script|<style|<link/i,
+            De = /checked\s*(?:[^=]|=\s*.checked.)/i,
+            Oe = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
 
-        function Se(e, t) {
+        function Ne(e, t) {
             return T(e, "table") && T(11 !== t.nodeType ? t : t.firstChild, "tr") && k(e).children("tbody")[0] || e
         }
 
-        function Oe(e) {
+        function Ie(e) {
             return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e
         }
 
-        function De(e) {
+        function Re(e) {
             return "true/" === (e.type || "").slice(0, 5) ? e.type = e.type.slice(5) : e.removeAttribute("type"), e
         }
 
-        function Ne(e, t) {
+        function Pe(e, t) {
             var n, r, i, o, a, s, l, c;
             if (1 === t.nodeType) {
                 if (K.hasData(e) && (o = K.access(e), a = K.set(t, o), c = o.events))
             }
         }
 
-        function Ie(n, r, i, o) {
+        function He(n, r, i, o) {
             r = m.apply([], r);
             var e, t, a, s, l, c, u = 0,
                 d = n.length,
                 f = d - 1,
                 h = r[0],
                 p = b(h);
-            if (p || 1 < d && "string" == typeof h && !v.checkClone && Me.test(h)) return n.each(function(e) {
+            if (p || 1 < d && "string" == typeof h && !v.checkClone && De.test(h)) return n.each(function(e) {
                 var t = n.eq(e);
-                p && (r[0] = h.call(this, e, t.html())), Ie(t, r, i, o)
+                p && (r[0] = h.call(this, e, t.html())), He(t, r, i, o)
             });
-            if (d && (t = (e = ve(r, n[0].ownerDocument, !1, n, o)).firstChild, 1 === e.childNodes.length && (e = t), t || o)) {
-                for (s = (a = k.map(fe(e, "script"), Oe)).length; u < d; u++) l = e, u !== f && (l = k.clone(l, !0, !0), s && k.merge(a, fe(l, "script"))), i.call(n[u], l, u);
+            if (d && (t = (e = _e(r, n[0].ownerDocument, !1, n, o)).firstChild, 1 === e.childNodes.length && (e = t), t || o)) {
+                for (s = (a = k.map(me(e, "script"), Ie)).length; u < d; u++) l = e, u !== f && (l = k.clone(l, !0, !0), s && k.merge(a, me(l, "script"))), i.call(n[u], l, u);
                 if (s)
-                    for (c = a[a.length - 1].ownerDocument, k.map(a, De), u = 0; u < s; u++) l = a[u], ue.test(l.type || "") && !K.access(l, "globalEval") && k.contains(c, l) && (l.src && "module" !== (l.type || "").toLowerCase() ? k._evalUrl && k._evalUrl(l.src) : _(l.textContent.replace(Ae, ""), c, l))
+                    for (c = a[a.length - 1].ownerDocument, k.map(a, Re), u = 0; u < s; u++) l = a[u], he.test(l.type || "") && !K.access(l, "globalEval") && k.contains(c, l) && (l.src && "module" !== (l.type || "").toLowerCase() ? k._evalUrl && !l.noModule && k._evalUrl(l.src, {
+                        nonce: l.nonce || l.getAttribute("nonce")
+                    }) : _(l.textContent.replace(Oe, ""), l, c))
             }
             return n
         }
 
-        function Re(e, t, n) {
-            for (var r, i = t ? k.filter(t, e) : e, o = 0; null != (r = i[o]); o++) n || 1 !== r.nodeType || k.cleanData(fe(r)), r.parentNode && (n && k.contains(r.ownerDocument, r) && he(fe(r, "script")), r.parentNode.removeChild(r));
+        function je(e, t, n) {
+            for (var r, i = t ? k.filter(t, e) : e, o = 0; null != (r = i[o]); o++) n || 1 !== r.nodeType || k.cleanData(me(r)), r.parentNode && (n && ie(r) && ge(me(r, "script")), r.parentNode.removeChild(r));
             return e
         }
         k.extend({
             htmlPrefilter: function(e) {
-                return e.replace(xe, "<$1></$2>")
+                return e.replace(Ae, "<$1></$2>")
             },
             clone: function(e, t, n) {
                 var r, i, o, a, s, l, c, u = e.cloneNode(!0),
-                    d = k.contains(e.ownerDocument, e);
+                    d = ie(e);
                 if (!(v.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || k.isXMLDoc(e)))
-                    for (a = fe(u), r = 0, i = (o = fe(e)).length; r < i; r++) s = o[r], l = a[r], void 0, "input" === (c = l.nodeName.toLowerCase()) && le.test(s.type) ? l.checked = s.checked : "input" !== c && "textarea" !== c || (l.defaultValue = s.defaultValue);
+                    for (a = me(u), r = 0, i = (o = me(e)).length; r < i; r++) s = o[r], l = a[r], void 0, "input" === (c = l.nodeName.toLowerCase()) && de.test(s.type) ? l.checked = s.checked : "input" !== c && "textarea" !== c || (l.defaultValue = s.defaultValue);
                 if (t)
                     if (n)
-                        for (o = o || fe(e), a = a || fe(u), r = 0, i = o.length; r < i; r++) Ne(o[r], a[r]);
-                    else Ne(e, u);
-                return 0 < (a = fe(u, "script")).length && he(a, !d && fe(e, "script")), u
+                        for (o = o || me(e), a = a || me(u), r = 0, i = o.length; r < i; r++) Pe(o[r], a[r]);
+                    else Pe(e, u);
+                return 0 < (a = me(u, "script")).length && ge(a, !d && me(e, "script")), u
             },
             cleanData: function(e) {
                 for (var t, n, r, i = k.event.special, o = 0; void 0 !== (n = e[o]); o++)
             }
         }), k.fn.extend({
             detach: function(e) {
-                return Re(this, e, !0)
+                return je(this, e, !0)
             },
             remove: function(e) {
-                return Re(this, e)
+                return je(this, e)
             },
             text: function(e) {
                 return U(this, function(e) {
                 }, null, e, arguments.length)
             },
             append: function() {
-                return Ie(this, arguments, function(e) {
-                    1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || Se(this, e).appendChild(e)
+                return He(this, arguments, function(e) {
+                    1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || Ne(this, e).appendChild(e)
                 })
             },
             prepend: function() {
-                return Ie(this, arguments, function(e) {
+                return He(this, arguments, function(e) {
                     if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
-                        var t = Se(this, e);
+                        var t = Ne(this, e);
                         t.insertBefore(e, t.firstChild)
                     }
                 })
             },
             before: function() {
-                return Ie(this, arguments, function(e) {
+                return He(this, arguments, function(e) {
                     this.parentNode && this.parentNode.insertBefore(e, this)
                 })
             },
             after: function() {
-                return Ie(this, arguments, function(e) {
+                return He(this, arguments, function(e) {
                     this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
                 })
             },
             empty: function() {
-                for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (k.cleanData(fe(e, !1)), e.textContent = "");
+                for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (k.cleanData(me(e, !1)), e.textContent = "");
                 return this
             },
             clone: function(e, t) {
                         n = 0,
                         r = this.length;
                     if (void 0 === e && 1 === t.nodeType) return t.innerHTML;
-                    if ("string" == typeof e && !Te.test(e) && !de[(ce.exec(e) || ["", ""])[1].toLowerCase()]) {
+                    if ("string" == typeof e && !Se.test(e) && !pe[(fe.exec(e) || ["", ""])[1].toLowerCase()]) {
                         e = k.htmlPrefilter(e);
                         try {
-                            for (; n < r; n++) 1 === (t = this[n] || {}).nodeType && (k.cleanData(fe(t, !1)), t.innerHTML = e);
+                            for (; n < r; n++) 1 === (t = this[n] || {}).nodeType && (k.cleanData(me(t, !1)), t.innerHTML = e);
                             t = 0
                         } catch (e) {}
                     }
             },
             replaceWith: function() {
                 var n = [];
-                return Ie(this, arguments, function(e) {
+                return He(this, arguments, function(e) {
                     var t = this.parentNode;
-                    k.inArray(this, n) < 0 && (k.cleanData(fe(this)), t && t.replaceChild(e, this))
+                    k.inArray(this, n) < 0 && (k.cleanData(me(this)), t && t.replaceChild(e, this))
                 }, n)
             }
         }), k.each({
                 return this.pushStack(n)
             }
         });
-        var Pe = new RegExp("^(" + ee + ")(?!px)[a-z%]+$", "i"),
-            He = function(e) {
+        var Le = new RegExp("^(" + ee + ")(?!px)[a-z%]+$", "i"),
+            Fe = function(e) {
                 var t = e.ownerDocument.defaultView;
                 return t && t.opener || (t = E), t.getComputedStyle(e)
             },
-            je = new RegExp(ne.join("|"), "i");
+            qe = new RegExp(ne.join("|"), "i");
 
-        function Le(e, t, n) {
+        function Ue(e, t, n) {
             var r, i, o, a, s = e.style;
-            return (n = n || He(e)) && ("" !== (a = n.getPropertyValue(t) || n[t]) || k.contains(e.ownerDocument, e) || (a = k.style(e, t)), !v.pixelBoxStyles() && Pe.test(a) && je.test(t) && (r = s.width, i = s.minWidth, o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = n.width, s.width = r, s.minWidth = i, s.maxWidth = o)), void 0 !== a ? a + "" : a
+            return (n = n || Fe(e)) && ("" !== (a = n.getPropertyValue(t) || n[t]) || ie(e) || (a = k.style(e, t)), !v.pixelBoxStyles() && Le.test(a) && qe.test(t) && (r = s.width, i = s.minWidth, o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = n.width, s.width = r, s.minWidth = i, s.maxWidth = o)), void 0 !== a ? a + "" : a
         }
 
-        function Fe(e, t) {
+        function Ve(e, t) {
             return {
                 get: function() {
                     if (!e()) return (this.get = t).apply(this, arguments);
         }! function() {
             function e() {
                 if (l) {
-                    s.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", l.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", be.appendChild(s).appendChild(l);
+                    s.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", l.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", re.appendChild(s).appendChild(l);
                     var e = E.getComputedStyle(l);
-                    n = "1%" !== e.top, a = 12 === t(e.marginLeft), l.style.right = "60%", o = 36 === t(e.right), r = 36 === t(e.width), l.style.position = "absolute", i = 36 === l.offsetWidth || "absolute", be.removeChild(s), l = null
+                    n = "1%" !== e.top, a = 12 === t(e.marginLeft), l.style.right = "60%", o = 36 === t(e.right), r = 36 === t(e.width), l.style.position = "absolute", i = 12 === t(l.offsetWidth / 3), re.removeChild(s), l = null
                 }
             }
 
                 }
             }))
         }();
-        var qe = /^(none|table(?!-c[ea]).+)/,
-            Ue = /^--/,
-            Ve = {
+        var Be = ["Webkit", "Moz", "ms"],
+            ze = C.createElement("div").style,
+            We = {};
+
+        function Ye(e) {
+            var t = k.cssProps[e] || We[e];
+            return t || (e in ze ? e : We[e] = function(e) {
+                for (var t = e[0].toUpperCase() + e.slice(1), n = Be.length; n--;)
+                    if ((e = Be[n] + t) in ze) return e
+            }(e) || e)
+        }
+        var Ge = /^(none|table(?!-c[ea]).+)/,
+            Ke = /^--/,
+            Ze = {
                 position: "absolute",
                 visibility: "hidden",
                 display: "block"
             },
-            ze = {
+            Xe = {
                 letterSpacing: "0",
                 fontWeight: "400"
-            },
-            Be = ["Webkit", "Moz", "ms"],
-            We = C.createElement("div").style;
-
-        function Ye(e) {
-            var t = k.cssProps[e];
-            return t || (t = k.cssProps[e] = function(e) {
-                if (e in We) return e;
-                for (var t = e[0].toUpperCase() + e.slice(1), n = Be.length; n--;)
-                    if ((e = Be[n] + t) in We) return e
-            }(e) || e), t
-        }
+            };
 
-        function Ge(e, t, n) {
+        function Qe(e, t, n) {
             var r = te.exec(t);
             return r ? Math.max(0, r[2] - (n || 0)) + (r[3] || "px") : t
         }
 
-        function Ke(e, t, n, r, i, o) {
+        function Je(e, t, n, r, i, o) {
             var a = "width" === t ? 1 : 0,
                 s = 0,
                 l = 0;
             if (n === (r ? "border" : "content")) return 0;
             for (; a < 4; a += 2) "margin" === n && (l += k.css(e, n + ne[a], !0, i)), r ? ("content" === n && (l -= k.css(e, "padding" + ne[a], !0, i)), "margin" !== n && (l -= k.css(e, "border" + ne[a] + "Width", !0, i))) : (l += k.css(e, "padding" + ne[a], !0, i), "padding" !== n ? l += k.css(e, "border" + ne[a] + "Width", !0, i) : s += k.css(e, "border" + ne[a] + "Width", !0, i));
-            return !r && 0 <= o && (l += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - o - l - s - .5))), l
+            return !r && 0 <= o && (l += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - o - l - s - .5)) || 0), l
         }
 
-        function Ze(e, t, n) {
-            var r = He(e),
-                i = Le(e, t, r),
-                o = "border-box" === k.css(e, "boxSizing", !1, r),
-                a = o;
-            if (Pe.test(i)) {
-                if (!n) return i;
-                i = "auto"
+        function et(e, t, n) {
+            var r = Fe(e),
+                i = (!v.boxSizingReliable() || n) && "border-box" === k.css(e, "boxSizing", !1, r),
+                o = i,
+                a = Ue(e, t, r),
+                s = "offset" + t[0].toUpperCase() + t.slice(1);
+            if (Le.test(a)) {
+                if (!n) return a;
+                a = "auto"
             }
-            return a = a && (v.boxSizingReliable() || i === e.style[t]), ("auto" === i || !parseFloat(i) && "inline" === k.css(e, "display", !1, r)) && (i = e["offset" + t[0].toUpperCase() + t.slice(1)], a = !0), (i = parseFloat(i) || 0) + Ke(e, t, n || (o ? "border" : "content"), a, r, i) + "px"
+            return (!v.boxSizingReliable() && i || "auto" === a || !parseFloat(a) && "inline" === k.css(e, "display", !1, r)) && e.getClientRects().length && (i = "border-box" === k.css(e, "boxSizing", !1, r), (o = s in e) && (a = e[s])), (a = parseFloat(a) || 0) + Je(e, t, n || (i ? "border" : "content"), o, r, a) + "px"
         }
 
-        function Xe(e, t, n, r, i) {
-            return new Xe.prototype.init(e, t, n, r, i)
+        function tt(e, t, n, r, i) {
+            return new tt.prototype.init(e, t, n, r, i)
         }
         k.extend({
             cssHooks: {
                 opacity: {
                     get: function(e, t) {
                         if (t) {
-                            var n = Le(e, "opacity");
+                            var n = Ue(e, "opacity");
                             return "" === n ? "1" : n
                         }
                     }
                 flexGrow: !0,
                 flexShrink: !0,
                 fontWeight: !0,
+                gridArea: !0,
+                gridColumn: !0,
+                gridColumnEnd: !0,
+                gridColumnStart: !0,
+                gridRow: !0,
+                gridRowEnd: !0,
+                gridRowStart: !0,
                 lineHeight: !0,
                 opacity: !0,
                 order: !0,
             style: function(e, t, n, r) {
                 if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
                     var i, o, a, s = W(t),
-                        l = Ue.test(t),
+                        l = Ke.test(t),
                         c = e.style;
                     if (l || (t = Ye(s)), a = k.cssHooks[t] || k.cssHooks[s], void 0 === n) return a && "get" in a && void 0 !== (i = a.get(e, !1, r)) ? i : c[t];
-                    "string" === (o = typeof n) && (i = te.exec(n)) && i[1] && (n = oe(e, t, i), o = "number"), null != n && n == n && ("number" === o && (n += i && i[3] || (k.cssNumber[s] ? "" : "px")), v.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (c[t] = "inherit"), a && "set" in a && void 0 === (n = a.set(e, n, r)) || (l ? c.setProperty(t, n) : c[t] = n))
+                    "string" === (o = typeof n) && (i = te.exec(n)) && i[1] && (n = le(e, t, i), o = "number"), null != n && n == n && ("number" !== o || l || (n += i && i[3] || (k.cssNumber[s] ? "" : "px")), v.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (c[t] = "inherit"), a && "set" in a && void 0 === (n = a.set(e, n, r)) || (l ? c.setProperty(t, n) : c[t] = n))
                 }
             },
             css: function(e, t, n, r) {
                 var i, o, a, s = W(t);
-                return Ue.test(t) || (t = Ye(s)), (a = k.cssHooks[t] || k.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)), void 0 === i && (i = Le(e, t, r)), "normal" === i && t in ze && (i = ze[t]), "" === n || n ? (o = parseFloat(i), !0 === n || isFinite(o) ? o || 0 : i) : i
+                return Ke.test(t) || (t = Ye(s)), (a = k.cssHooks[t] || k.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)), void 0 === i && (i = Ue(e, t, r)), "normal" === i && t in Xe && (i = Xe[t]), "" === n || n ? (o = parseFloat(i), !0 === n || isFinite(o) ? o || 0 : i) : i
             }
-        }), k.each(["height", "width"], function(e, s) {
-            k.cssHooks[s] = {
+        }), k.each(["height", "width"], function(e, l) {
+            k.cssHooks[l] = {
                 get: function(e, t, n) {
-                    if (t) return !qe.test(k.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? Ze(e, s, n) : ie(e, Ve, function() {
-                        return Ze(e, s, n)
+                    if (t) return !Ge.test(k.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? et(e, l, n) : se(e, Ze, function() {
+                        return et(e, l, n)
                     })
                 },
                 set: function(e, t, n) {
-                    var r, i = He(e),
-                        o = "border-box" === k.css(e, "boxSizing", !1, i),
-                        a = n && Ke(e, s, n, o, i);
-                    return o && v.scrollboxSize() === i.position && (a -= Math.ceil(e["offset" + s[0].toUpperCase() + s.slice(1)] - parseFloat(i[s]) - Ke(e, s, "border", !1, i) - .5)), a && (r = te.exec(t)) && "px" !== (r[3] || "px") && (e.style[s] = t, t = k.css(e, s)), Ge(0, t, a)
+                    var r, i = Fe(e),
+                        o = !v.scrollboxSize() && "absolute" === i.position,
+                        a = (o || n) && "border-box" === k.css(e, "boxSizing", !1, i),
+                        s = n ? Je(e, l, n, a, i) : 0;
+                    return a && o && (s -= Math.ceil(e["offset" + l[0].toUpperCase() + l.slice(1)] - parseFloat(i[l]) - Je(e, l, "border", !1, i) - .5)), s && (r = te.exec(t)) && "px" !== (r[3] || "px") && (e.style[l] = t, t = k.css(e, l)), Qe(0, t, s)
                 }
             }
-        }), k.cssHooks.marginLeft = Fe(v.reliableMarginLeft, function(e, t) {
-            if (t) return (parseFloat(Le(e, "marginLeft")) || e.getBoundingClientRect().left - ie(e, {
+        }), k.cssHooks.marginLeft = Ve(v.reliableMarginLeft, function(e, t) {
+            if (t) return (parseFloat(Ue(e, "marginLeft")) || e.getBoundingClientRect().left - se(e, {
                 marginLeft: 0
             }, function() {
                 return e.getBoundingClientRect().left
                     for (var t = 0, n = {}, r = "string" == typeof e ? e.split(" ") : [e]; t < 4; t++) n[i + ne[t] + o] = r[t] || r[t - 2] || r[0];
                     return n
                 }
-            }, "margin" !== i && (k.cssHooks[i + o].set = Ge)
+            }, "margin" !== i && (k.cssHooks[i + o].set = Qe)
         }), k.fn.extend({
             css: function(e, t) {
                 return U(this, function(e, t, n) {
                     var r, i, o = {},
                         a = 0;
                     if (Array.isArray(t)) {
-                        for (r = He(e), i = t.length; a < i; a++) o[t[a]] = k.css(e, t[a], !1, r);
+                        for (r = Fe(e), i = t.length; a < i; a++) o[t[a]] = k.css(e, t[a], !1, r);
                         return o
                     }
                     return void 0 !== n ? k.style(e, t, n) : k.css(e, t)
                 }, e, t, 1 < arguments.length)
             }
-        }), ((k.Tween = Xe).prototype = {
-            constructor: Xe,
+        }), ((k.Tween = tt).prototype = {
+            constructor: tt,
             init: function(e, t, n, r, i, o) {
                 this.elem = e, this.prop = n, this.easing = i || k.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (k.cssNumber[n] ? "" : "px")
             },
             cur: function() {
-                var e = Xe.propHooks[this.prop];
-                return e && e.get ? e.get(this) : Xe.propHooks._default.get(this)
+                var e = tt.propHooks[this.prop];
+                return e && e.get ? e.get(this) : tt.propHooks._default.get(this)
             },
             run: function(e) {
-                var t, n = Xe.propHooks[this.prop];
-                return this.options.duration ? this.pos = t = k.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : Xe.propHooks._default.set(this), this
+                var t, n = tt.propHooks[this.prop];
+                return this.options.duration ? this.pos = t = k.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : tt.propHooks._default.set(this), this
             }
-        }).init.prototype = Xe.prototype, (Xe.propHooks = {
+        }).init.prototype = tt.prototype, (tt.propHooks = {
             _default: {
                 get: function(e) {
                     var t;
                     return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = k.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0
                 },
                 set: function(e) {
-                    k.fx.step[e.prop] ? k.fx.step[e.prop](e) : 1 !== e.elem.nodeType || null == e.elem.style[k.cssProps[e.prop]] && !k.cssHooks[e.prop] ? e.elem[e.prop] = e.now : k.style(e.elem, e.prop, e.now + e.unit)
+                    k.fx.step[e.prop] ? k.fx.step[e.prop](e) : 1 !== e.elem.nodeType || !k.cssHooks[e.prop] && null == e.elem.style[Ye(e.prop)] ? e.elem[e.prop] = e.now : k.style(e.elem, e.prop, e.now + e.unit)
                 }
             }
-        }).scrollTop = Xe.propHooks.scrollLeft = {
+        }).scrollTop = tt.propHooks.scrollLeft = {
             set: function(e) {
                 e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
             }
                 return .5 - Math.cos(e * Math.PI) / 2
             },
             _default: "swing"
-        }, k.fx = Xe.prototype.init, k.fx.step = {};
-        var Qe, Je, et, tt, nt = /^(?:toggle|show|hide)$/,
-            rt = /queueHooks$/;
+        }, k.fx = tt.prototype.init, k.fx.step = {};
+        var nt, rt, it, ot, at = /^(?:toggle|show|hide)$/,
+            st = /queueHooks$/;
 
-        function it() {
-            Je && (!1 === C.hidden && E.requestAnimationFrame ? E.requestAnimationFrame(it) : E.setTimeout(it, k.fx.interval), k.fx.tick())
+        function lt() {
+            rt && (!1 === C.hidden && E.requestAnimationFrame ? E.requestAnimationFrame(lt) : E.setTimeout(lt, k.fx.interval), k.fx.tick())
         }
 
-        function ot() {
+        function ct() {
             return E.setTimeout(function() {
-                Qe = void 0
-            }), Qe = Date.now()
+                nt = void 0
+            }), nt = Date.now()
         }
 
-        function at(e, t) {
+        function ut(e, t) {
             var n, r = 0,
                 i = {
                     height: e
             return t && (i.opacity = i.width = e), i
         }
 
-        function st(e, t, n) {
-            for (var r, i = (lt.tweeners[t] || []).concat(lt.tweeners["*"]), o = 0, a = i.length; o < a; o++)
+        function dt(e, t, n) {
+            for (var r, i = (ft.tweeners[t] || []).concat(ft.tweeners["*"]), o = 0, a = i.length; o < a; o++)
                 if (r = i[o].call(n, t, e)) return r
         }
 
-        function lt(o, e, t) {
+        function ft(o, e, t) {
             var n, a, r = 0,
-                i = lt.prefilters.length,
+                i = ft.prefilters.length,
                 s = k.Deferred().always(function() {
                     delete l.elem
                 }),
                 l = function() {
                     if (a) return !1;
-                    for (var e = Qe || ot(), t = Math.max(0, c.startTime + c.duration - e), n = 1 - (t / c.duration || 0), r = 0, i = c.tweens.length; r < i; r++) c.tweens[r].run(n);
+                    for (var e = nt || ct(), t = Math.max(0, c.startTime + c.duration - e), n = 1 - (t / c.duration || 0), r = 0, i = c.tweens.length; r < i; r++) c.tweens[r].run(n);
                     return s.notifyWith(o, [c, n, t]), n < 1 && i ? t : (i || s.notifyWith(o, [c, 1, 0]), s.resolveWith(o, [c]), !1)
                 },
                 c = s.promise({
                     }, t),
                     originalProperties: e,
                     originalOptions: t,
-                    startTime: Qe || ot(),
+                    startTime: nt || ct(),
                     duration: t.duration,
                     tweens: [],
                     createTween: function(e, t) {
                             for (n in o = a.expand(o), delete e[r], o) n in e || (e[n] = o[n], t[n] = i);
                         else t[r] = i
                 }(u, c.opts.specialEasing); r < i; r++)
-                if (n = lt.prefilters[r].call(c, o, u, c.opts)) return b(n.stop) && (k._queueHooks(c.elem, c.opts.queue).stop = n.stop.bind(n)), n;
-            return k.map(u, st, c), b(c.opts.start) && c.opts.start.call(o, c), c.progress(c.opts.progress).done(c.opts.done, c.opts.complete).fail(c.opts.fail).always(c.opts.always), k.fx.timer(k.extend(l, {
+                if (n = ft.prefilters[r].call(c, o, u, c.opts)) return b(n.stop) && (k._queueHooks(c.elem, c.opts.queue).stop = n.stop.bind(n)), n;
+            return k.map(u, dt, c), b(c.opts.start) && c.opts.start.call(o, c), c.progress(c.opts.progress).done(c.opts.done, c.opts.complete).fail(c.opts.fail).always(c.opts.always), k.fx.timer(k.extend(l, {
                 elem: o,
                 anim: c,
                 queue: c.opts.queue
             })), c
         }
-        k.Animation = k.extend(lt, {
+        k.Animation = k.extend(ft, {
             tweeners: {
                 "*": [function(e, t) {
                     var n = this.createTween(e, t);
-                    return oe(n.elem, e, te.exec(t), n), n
+                    return le(n.elem, e, te.exec(t), n), n
                 }]
             },
             tweener: function(e, t) {
-                for (var n, r = 0, i = (e = b(e) ? (t = e, ["*"]) : e.match(R)).length; r < i; r++) n = e[r], lt.tweeners[n] = lt.tweeners[n] || [], lt.tweeners[n].unshift(t)
+                for (var n, r = 0, i = (e = b(e) ? (t = e, ["*"]) : e.match(R)).length; r < i; r++) n = e[r], ft.tweeners[n] = ft.tweeners[n] || [], ft.tweeners[n].unshift(t)
             },
             prefilters: [function(e, t, n) {
                 var r, i, o, a, s, l, c, u, d = "width" in t || "height" in t,
                     f = this,
                     h = {},
                     p = e.style,
-                    m = e.nodeType && re(e),
+                    m = e.nodeType && ae(e),
                     g = K.get(e, "fxshow");
                 for (r in n.queue || (null == (a = k._queueHooks(e, "fx")).unqueued && (a.unqueued = 0, s = a.empty.fire, a.empty.fire = function() {
                         a.unqueued || s()
                             a.unqueued--, k.queue(e, "fx").length || a.empty.fire()
                         })
                     })), t)
-                    if (i = t[r], nt.test(i)) {
+                    if (i = t[r], at.test(i)) {
                         if (delete t[r], o = o || "toggle" === i, i === (m ? "hide" : "show")) {
                             if ("show" !== i || !g || void 0 === g[r]) continue;
                             m = !0
                         }
                         h[r] = g && g[r] || k.style(e, r)
                     } if ((l = !k.isEmptyObject(t)) || !k.isEmptyObject(h))
-                    for (r in d && 1 === e.nodeType && (n.overflow = [p.overflow, p.overflowX, p.overflowY], null == (c = g && g.display) && (c = K.get(e, "display")), "none" === (u = k.css(e, "display")) && (c ? u = c : (se([e], !0), c = e.style.display || c, u = k.css(e, "display"), se([e]))), ("inline" === u || "inline-block" === u && null != c) && "none" === k.css(e, "float") && (l || (f.done(function() {
+                    for (r in d && 1 === e.nodeType && (n.overflow = [p.overflow, p.overflowX, p.overflowY], null == (c = g && g.display) && (c = K.get(e, "display")), "none" === (u = k.css(e, "display")) && (c ? u = c : (ue([e], !0), c = e.style.display || c, u = k.css(e, "display"), ue([e]))), ("inline" === u || "inline-block" === u && null != c) && "none" === k.css(e, "float") && (l || (f.done(function() {
                             p.display = c
                         }), null == c && (u = p.display, c = "none" === u ? "" : u)), p.display = "inline-block")), n.overflow && (p.overflow = "hidden", f.always(function() {
                             p.overflow = n.overflow[0], p.overflowX = n.overflow[1], p.overflowY = n.overflow[2]
                         })), l = !1, h) l || (g ? "hidden" in g && (m = g.hidden) : g = K.access(e, "fxshow", {
                         display: c
-                    }), o && (g.hidden = !m), m && se([e], !0), f.done(function() {
-                        for (r in m || se([e]), K.remove(e, "fxshow"), h) k.style(e, r, h[r])
-                    })), l = st(m ? g[r] : 0, r, f), r in g || (g[r] = l.start, m && (l.end = l.start, l.start = 0))
+                    }), o && (g.hidden = !m), m && ue([e], !0), f.done(function() {
+                        for (r in m || ue([e]), K.remove(e, "fxshow"), h) k.style(e, r, h[r])
+                    })), l = dt(m ? g[r] : 0, r, f), r in g || (g[r] = l.start, m && (l.end = l.start, l.start = 0))
             }],
             prefilter: function(e, t) {
-                t ? lt.prefilters.unshift(e) : lt.prefilters.push(e)
+                t ? ft.prefilters.unshift(e) : ft.prefilters.push(e)
             }
         }), k.speed = function(e, t, n) {
             var r = e && "object" == typeof e ? k.extend({}, e) : {
             }, r
         }, k.fn.extend({
             fadeTo: function(e, t, n, r) {
-                return this.filter(re).css("opacity", 0).show().end().animate({
+                return this.filter(ae).css("opacity", 0).show().end().animate({
                     opacity: t
                 }, e, n, r)
             },
                 var i = k.isEmptyObject(t),
                     o = k.speed(e, n, r),
                     a = function() {
-                        var e = lt(this, k.extend({}, t), o);
+                        var e = ft(this, k.extend({}, t), o);
                         (i || K.get(this, "finish")) && e.stop(!0)
                     };
                 return a.finish = a, i || !1 === o.queue ? this.each(a) : this.queue(o.queue, a)
                         r = K.get(this);
                     if (t) r[t] && r[t].stop && a(r[t]);
                     else
-                        for (t in r) r[t] && r[t].stop && rt.test(t) && a(r[t]);
+                        for (t in r) r[t] && r[t].stop && st.test(t) && a(r[t]);
                     for (t = n.length; t--;) n[t].elem !== this || null != i && n[t].queue !== i || (n[t].anim.stop(o), e = !1, n.splice(t, 1));
                     !e && o || k.dequeue(this, i)
                 })
         }), k.each(["toggle", "show", "hide"], function(e, r) {
             var i = k.fn[r];
             k.fn[r] = function(e, t, n) {
-                return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(at(r, !0), e, t, n)
+                return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(ut(r, !0), e, t, n)
             }
         }), k.each({
-            slideDown: at("show"),
-            slideUp: at("hide"),
-            slideToggle: at("toggle"),
+            slideDown: ut("show"),
+            slideUp: ut("hide"),
+            slideToggle: ut("toggle"),
             fadeIn: {
                 opacity: "show"
             },
         }), k.timers = [], k.fx.tick = function() {
             var e, t = 0,
                 n = k.timers;
-            for (Qe = Date.now(); t < n.length; t++)(e = n[t])() || n[t] !== e || n.splice(t--, 1);
-            n.length || k.fx.stop(), Qe = void 0
+            for (nt = Date.now(); t < n.length; t++)(e = n[t])() || n[t] !== e || n.splice(t--, 1);
+            n.length || k.fx.stop(), nt = void 0
         }, k.fx.timer = function(e) {
             k.timers.push(e), k.fx.start()
         }, k.fx.interval = 13, k.fx.start = function() {
-            Je || (Je = !0, it())
+            rt || (rt = !0, lt())
         }, k.fx.stop = function() {
-            Je = null
+            rt = null
         }, k.fx.speeds = {
             slow: 600,
             fast: 200,
                     E.clearTimeout(n)
                 }
             })
-        }, et = C.createElement("input"), tt = C.createElement("select").appendChild(C.createElement("option")), et.type = "checkbox", v.checkOn = "" !== et.value, v.optSelected = tt.selected, (et = C.createElement("input")).value = "t", et.type = "radio", v.radioValue = "t" === et.value;
-        var ct, ut = k.expr.attrHandle;
+        }, it = C.createElement("input"), ot = C.createElement("select").appendChild(C.createElement("option")), it.type = "checkbox", v.checkOn = "" !== it.value, v.optSelected = ot.selected, (it = C.createElement("input")).value = "t", it.type = "radio", v.radioValue = "t" === it.value;
+        var ht, pt = k.expr.attrHandle;
         k.fn.extend({
             attr: function(e, t) {
                 return U(this, k.attr, e, t, 1 < arguments.length)
         }), k.extend({
             attr: function(e, t, n) {
                 var r, i, o = e.nodeType;
-                if (3 !== o && 8 !== o && 2 !== o) return void 0 === e.getAttribute ? k.prop(e, t, n) : (1 === o && k.isXMLDoc(e) || (i = k.attrHooks[t.toLowerCase()] || (k.expr.match.bool.test(t) ? ct : void 0)), void 0 !== n ? null === n ? void k.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (r = i.get(e, t)) ? r : null == (r = k.find.attr(e, t)) ? void 0 : r)
+                if (3 !== o && 8 !== o && 2 !== o) return void 0 === e.getAttribute ? k.prop(e, t, n) : (1 === o && k.isXMLDoc(e) || (i = k.attrHooks[t.toLowerCase()] || (k.expr.match.bool.test(t) ? ht : void 0)), void 0 !== n ? null === n ? void k.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (r = i.get(e, t)) ? r : null == (r = k.find.attr(e, t)) ? void 0 : r)
             },
             attrHooks: {
                 type: {
                 if (i && 1 === e.nodeType)
                     for (; n = i[r++];) e.removeAttribute(n)
             }
-        }), ct = {
+        }), ht = {
             set: function(e, t, n) {
                 return !1 === t ? k.removeAttr(e, n) : e.setAttribute(n, n), n
             }
         }, k.each(k.expr.match.bool.source.match(/\w+/g), function(e, t) {
-            var a = ut[t] || k.find.attr;
-            ut[t] = function(e, t, n) {
+            var a = pt[t] || k.find.attr;
+            pt[t] = function(e, t, n) {
                 var r, i, o = t.toLowerCase();
-                return n || (i = ut[o], ut[o] = r, r = null != a(e, t, n) ? o : null, ut[o] = i), r
+                return n || (i = pt[o], pt[o] = r, r = null != a(e, t, n) ? o : null, pt[o] = i), r
             }
         });
-        var dt = /^(?:input|select|textarea|button)$/i,
-            ft = /^(?:a|area)$/i;
+        var mt = /^(?:input|select|textarea|button)$/i,
+            gt = /^(?:a|area)$/i;
 
-        function ht(e) {
+        function vt(e) {
             return (e.match(R) || []).join(" ")
         }
 
-        function pt(e) {
+        function bt(e) {
             return e.getAttribute && e.getAttribute("class") || ""
         }
 
-        function mt(e) {
+        function yt(e) {
             return Array.isArray(e) ? e : "string" == typeof e && e.match(R) || []
         }
         k.fn.extend({
                 tabIndex: {
                     get: function(e) {
                         var t = k.find.attr(e, "tabindex");
-                        return t ? parseInt(t, 10) : dt.test(e.nodeName) || ft.test(e.nodeName) && e.href ? 0 : -1
+                        return t ? parseInt(t, 10) : mt.test(e.nodeName) || gt.test(e.nodeName) && e.href ? 0 : -1
                     }
                 }
             },
             addClass: function(t) {
                 var e, n, r, i, o, a, s, l = 0;
                 if (b(t)) return this.each(function(e) {
-                    k(this).addClass(t.call(this, e, pt(this)))
+                    k(this).addClass(t.call(this, e, bt(this)))
                 });
-                if ((e = mt(t)).length)
+                if ((e = yt(t)).length)
                     for (; n = this[l++];)
-                        if (i = pt(n), r = 1 === n.nodeType && " " + ht(i) + " ") {
+                        if (i = bt(n), r = 1 === n.nodeType && " " + vt(i) + " ") {
                             for (a = 0; o = e[a++];) r.indexOf(" " + o + " ") < 0 && (r += o + " ");
-                            i !== (s = ht(r)) && n.setAttribute("class", s)
+                            i !== (s = vt(r)) && n.setAttribute("class", s)
                         } return this
             },
             removeClass: function(t) {
                 var e, n, r, i, o, a, s, l = 0;
                 if (b(t)) return this.each(function(e) {
-                    k(this).removeClass(t.call(this, e, pt(this)))
+                    k(this).removeClass(t.call(this, e, bt(this)))
                 });
                 if (!arguments.length) return this.attr("class", "");
-                if ((e = mt(t)).length)
+                if ((e = yt(t)).length)
                     for (; n = this[l++];)
-                        if (i = pt(n), r = 1 === n.nodeType && " " + ht(i) + " ") {
+                        if (i = bt(n), r = 1 === n.nodeType && " " + vt(i) + " ") {
                             for (a = 0; o = e[a++];)
                                 for (; - 1 < r.indexOf(" " + o + " ");) r = r.replace(" " + o + " ", " ");
-                            i !== (s = ht(r)) && n.setAttribute("class", s)
+                            i !== (s = vt(r)) && n.setAttribute("class", s)
                         } return this
             },
             toggleClass: function(i, t) {
                 var o = typeof i,
                     a = "string" === o || Array.isArray(i);
                 return "boolean" == typeof t && a ? t ? this.addClass(i) : this.removeClass(i) : b(i) ? this.each(function(e) {
-                    k(this).toggleClass(i.call(this, e, pt(this), t), t)
+                    k(this).toggleClass(i.call(this, e, bt(this), t), t)
                 }) : this.each(function() {
                     var e, t, n, r;
                     if (a)
-                        for (t = 0, n = k(this), r = mt(i); e = r[t++];) n.hasClass(e) ? n.removeClass(e) : n.addClass(e);
-                    else void 0 !== i && "boolean" !== o || ((e = pt(this)) && K.set(this, "__className__", e), this.setAttribute && this.setAttribute("class", e || !1 === i ? "" : K.get(this, "__className__") || ""))
+                        for (t = 0, n = k(this), r = yt(i); e = r[t++];) n.hasClass(e) ? n.removeClass(e) : n.addClass(e);
+                    else void 0 !== i && "boolean" !== o || ((e = bt(this)) && K.set(this, "__className__", e), this.setAttribute && this.setAttribute("class", e || !1 === i ? "" : K.get(this, "__className__") || ""))
                 })
             },
             hasClass: function(e) {
                 var t, n, r = 0;
                 for (t = " " + e + " "; n = this[r++];)
-                    if (1 === n.nodeType && -1 < (" " + ht(pt(n)) + " ").indexOf(t)) return !0;
+                    if (1 === n.nodeType && -1 < (" " + vt(bt(n)) + " ").indexOf(t)) return !0;
                 return !1
             }
         });
-        var gt = /\r/g;
+        var _t = /\r/g;
         k.fn.extend({
             val: function(n) {
                 var r, e, i, t = this[0];
                     1 === this.nodeType && (null == (t = i ? n.call(this, e, k(this).val()) : n) ? t = "" : "number" == typeof t ? t += "" : Array.isArray(t) && (t = k.map(t, function(e) {
                         return null == e ? "" : e + ""
                     })), (r = k.valHooks[this.type] || k.valHooks[this.nodeName.toLowerCase()]) && "set" in r && void 0 !== r.set(this, t, "value") || (this.value = t))
-                })) : t ? (r = k.valHooks[t.type] || k.valHooks[t.nodeName.toLowerCase()]) && "get" in r && void 0 !== (e = r.get(t, "value")) ? e : "string" == typeof(e = t.value) ? e.replace(gt, "") : null == e ? "" : e : void 0
+                })) : t ? (r = k.valHooks[t.type] || k.valHooks[t.nodeName.toLowerCase()]) && "get" in r && void 0 !== (e = r.get(t, "value")) ? e : "string" == typeof(e = t.value) ? e.replace(_t, "") : null == e ? "" : e : void 0
             }
         }), k.extend({
             valHooks: {
                 option: {
                     get: function(e) {
                         var t = k.find.attr(e, "value");
-                        return null != t ? t : ht(k.text(e))
+                        return null != t ? t : vt(k.text(e))
                     }
                 },
                 select: {
                 return null === e.getAttribute("value") ? "on" : e.value
             })
         }), v.focusin = "onfocusin" in E;
-        var vt = /^(?:focusinfocus|focusoutblur)$/,
-            bt = function(e) {
+        var $t = /^(?:focusinfocus|focusoutblur)$/,
+            wt = function(e) {
                 e.stopPropagation()
             };
         k.extend(k.event, {
                 var i, o, a, s, l, c, u, d, f = [n || C],
                     h = g.call(e, "type") ? e.type : e,
                     p = g.call(e, "namespace") ? e.namespace.split(".") : [];
-                if (o = d = a = n = n || C, 3 !== n.nodeType && 8 !== n.nodeType && !vt.test(h + k.event.triggered) && (-1 < h.indexOf(".") && (h = (p = h.split(".")).shift(), p.sort()), l = h.indexOf(":") < 0 && "on" + h, (e = e[k.expando] ? e : new k.Event(h, "object" == typeof e && e)).isTrigger = r ? 2 : 3, e.namespace = p.join("."), e.rnamespace = e.namespace ? new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, e.result = void 0, e.target || (e.target = n), t = null == t ? [e] : k.makeArray(t, [e]), u = k.event.special[h] || {}, r || !u.trigger || !1 !== u.trigger.apply(n, t))) {
+                if (o = d = a = n = n || C, 3 !== n.nodeType && 8 !== n.nodeType && !$t.test(h + k.event.triggered) && (-1 < h.indexOf(".") && (h = (p = h.split(".")).shift(), p.sort()), l = h.indexOf(":") < 0 && "on" + h, (e = e[k.expando] ? e : new k.Event(h, "object" == typeof e && e)).isTrigger = r ? 2 : 3, e.namespace = p.join("."), e.rnamespace = e.namespace ? new RegExp("(^|\\.)" + p.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, e.result = void 0, e.target || (e.target = n), t = null == t ? [e] : k.makeArray(t, [e]), u = k.event.special[h] || {}, r || !u.trigger || !1 !== u.trigger.apply(n, t))) {
                     if (!r && !u.noBubble && !y(n)) {
-                        for (s = u.delegateType || h, vt.test(s + h) || (o = o.parentNode); o; o = o.parentNode) f.push(o), a = o;
+                        for (s = u.delegateType || h, $t.test(s + h) || (o = o.parentNode); o; o = o.parentNode) f.push(o), a = o;
                         a === (n.ownerDocument || C) && f.push(a.defaultView || a.parentWindow || E)
                     }
                     for (i = 0;
                         (o = f[i++]) && !e.isPropagationStopped();) d = o, e.type = 1 < i ? s : u.bindType || h, (c = (K.get(o, "events") || {})[e.type] && K.get(o, "handle")) && c.apply(o, t), (c = l && o[l]) && c.apply && Y(o) && (e.result = c.apply(o, t), !1 === e.result && e.preventDefault());
-                    return e.type = h, r || e.isDefaultPrevented() || u._default && !1 !== u._default.apply(f.pop(), t) || !Y(n) || l && b(n[h]) && !y(n) && ((a = n[l]) && (n[l] = null), k.event.triggered = h, e.isPropagationStopped() && d.addEventListener(h, bt), n[h](), e.isPropagationStopped() && d.removeEventListener(h, bt), k.event.triggered = void 0, a && (n[l] = a)), e.result
+                    return e.type = h, r || e.isDefaultPrevented() || u._default && !1 !== u._default.apply(f.pop(), t) || !Y(n) || l && b(n[h]) && !y(n) && ((a = n[l]) && (n[l] = null), k.event.triggered = h, e.isPropagationStopped() && d.addEventListener(h, wt), n[h](), e.isPropagationStopped() && d.removeEventListener(h, wt), k.event.triggered = void 0, a && (n[l] = a)), e.result
                 }
             },
             simulate: function(e, t, n) {
                 }
             }
         });
-        var yt = E.location,
-            _t = Date.now(),
-            $t = /\?/;
+        var Et = E.location,
+            Ct = Date.now(),
+            kt = /\?/;
         k.parseXML = function(e) {
             var t;
             if (!e || "string" != typeof e) return null;
             }
             return t && !t.getElementsByTagName("parsererror").length || k.error("Invalid XML: " + e), t
         };
-        var wt = /\[\]$/,
-            Et = /\r?\n/g,
-            Ct = /^(?:submit|button|image|reset|file)$/i,
-            kt = /^(?:input|select|textarea|keygen)/i;
+        var xt = /\[\]$/,
+            Tt = /\r?\n/g,
+            Mt = /^(?:submit|button|image|reset|file)$/i,
+            At = /^(?:input|select|textarea|keygen)/i;
 
-        function xt(n, e, r, i) {
+        function St(n, e, r, i) {
             var t;
             if (Array.isArray(e)) k.each(e, function(e, t) {
-                r || wt.test(n) ? i(n, t) : xt(n + "[" + ("object" == typeof t && null != t ? e : "") + "]", t, r, i)
+                r || xt.test(n) ? i(n, t) : St(n + "[" + ("object" == typeof t && null != t ? e : "") + "]", t, r, i)
             });
             else if (r || "object" !== $(e)) i(n, e);
             else
-                for (t in e) xt(n + "[" + t + "]", e[t], r, i)
+                for (t in e) St(n + "[" + t + "]", e[t], r, i)
         }
         k.param = function(e, t) {
             var n, r = [],
                     var n = b(t) ? t() : t;
                     r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n)
                 };
+            if (null == e) return "";
             if (Array.isArray(e) || e.jquery && !k.isPlainObject(e)) k.each(e, function() {
                 i(this.name, this.value)
             });
             else
-                for (n in e) xt(n, e[n], t, i);
+                for (n in e) St(n, e[n], t, i);
             return r.join("&")
         }, k.fn.extend({
             serialize: function() {
                     return e ? k.makeArray(e) : this
                 }).filter(function() {
                     var e = this.type;
-                    return this.name && !k(this).is(":disabled") && kt.test(this.nodeName) && !Ct.test(e) && (this.checked || !le.test(e))
+                    return this.name && !k(this).is(":disabled") && At.test(this.nodeName) && !Mt.test(e) && (this.checked || !de.test(e))
                 }).map(function(e, t) {
                     var n = k(this).val();
                     return null == n ? null : Array.isArray(n) ? k.map(n, function(e) {
                         return {
                             name: t.name,
-                            value: e.replace(Et, "\r\n")
+                            value: e.replace(Tt, "\r\n")
                         }
                     }) : {
                         name: t.name,
-                        value: n.replace(Et, "\r\n")
+                        value: n.replace(Tt, "\r\n")
                     }
                 }).get()
             }
         });
-        var Tt = /%20/g,
-            Mt = /#.*$/,
-            At = /([?&])_=[^&]*/,
-            St = /^(.*?):[ \t]*([^\r\n]*)$/gm,
-            Ot = /^(?:GET|HEAD)$/,
-            Dt = /^\/\//,
-            Nt = {},
-            It = {},
-            Rt = "*/".concat("*"),
-            Pt = C.createElement("a");
-
-        function Ht(o) {
+        var Dt = /%20/g,
+            Ot = /#.*$/,
+            Nt = /([?&])_=[^&]*/,
+            It = /^(.*?):[ \t]*([^\r\n]*)$/gm,
+            Rt = /^(?:GET|HEAD)$/,
+            Pt = /^\/\//,
+            Ht = {},
+            jt = {},
+            Lt = "*/".concat("*"),
+            Ft = C.createElement("a");
+
+        function qt(o) {
             return function(e, t) {
                 "string" != typeof e && (t = e, e = "*");
                 var n, r = 0,
             }
         }
 
-        function jt(t, i, o, a) {
+        function Ut(t, i, o, a) {
             var s = {},
-                l = t === It;
+                l = t === jt;
 
             function c(e) {
                 var r;
             return c(i.dataTypes[0]) || !s["*"] && c("*")
         }
 
-        function Lt(e, t) {
+        function Vt(e, t) {
             var n, r, i = k.ajaxSettings.flatOptions || {};
             for (n in t) void 0 !== t[n] && ((i[n] ? e : r || (r = {}))[n] = t[n]);
             return r && k.extend(!0, e, r), e
         }
-        Pt.href = yt.href, k.extend({
+        Ft.href = Et.href, k.extend({
             active: 0,
             lastModified: {},
             etag: {},
             ajaxSettings: {
-                url: yt.href,
+                url: Et.href,
                 type: "GET",
-                isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),
+                isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),
                 global: !0,
                 processData: !0,
                 async: !0,
                 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                 accepts: {
-                    "*": Rt,
+                    "*": Lt,
                     text: "text/plain",
                     html: "text/html",
                     xml: "application/xml, text/xml",
                 }
             },
             ajaxSetup: function(e, t) {
-                return t ? Lt(Lt(e, k.ajaxSettings), t) : Lt(k.ajaxSettings, e)
+                return t ? Vt(Vt(e, k.ajaxSettings), t) : Vt(k.ajaxSettings, e)
             },
-            ajaxPrefilter: Ht(Nt),
-            ajaxTransport: Ht(It),
+            ajaxPrefilter: qt(Ht),
+            ajaxTransport: qt(jt),
             ajax: function(e, t) {
                 "object" == typeof e && (t = e, e = void 0), t = t || {};
                 var u, d, f, n, h, r, p, m, i, o, g = k.ajaxSetup({}, t),
                             var t;
                             if (p) {
                                 if (!n)
-                                    for (n = {}; t = St.exec(f);) n[t[1].toLowerCase()] = t[2];
-                                t = n[e.toLowerCase()]
+                                    for (n = {}; t = It.exec(f);) n[t[1].toLowerCase() + " "] = (n[t[1].toLowerCase() + " "] || []).concat(t[2]);
+                                t = n[e.toLowerCase() + " "]
                             }
-                            return null == t ? null : t
+                            return null == t ? null : t.join(", ")
                         },
                         getAllResponseHeaders: function() {
                             return p ? f : null
                             return u && u.abort(t), c(0, t), this
                         }
                     };
-                if (y.promise(w), g.url = ((e || g.url || yt.href) + "").replace(Dt, yt.protocol + "//"), g.type = t.method || t.type || g.method || g.type, g.dataTypes = (g.dataType || "*").toLowerCase().match(R) || [""], null == g.crossDomain) {
+                if (y.promise(w), g.url = ((e || g.url || Et.href) + "").replace(Pt, Et.protocol + "//"), g.type = t.method || t.type || g.method || g.type, g.dataTypes = (g.dataType || "*").toLowerCase().match(R) || [""], null == g.crossDomain) {
                     r = C.createElement("a");
                     try {
-                        r.href = g.url, r.href = r.href, g.crossDomain = Pt.protocol + "//" + Pt.host != r.protocol + "//" + r.host
+                        r.href = g.url, r.href = r.href, g.crossDomain = Ft.protocol + "//" + Ft.host != r.protocol + "//" + r.host
                     } catch (e) {
                         g.crossDomain = !0
                     }
                 }
-                if (g.data && g.processData && "string" != typeof g.data && (g.data = k.param(g.data, g.traditional)), jt(Nt, g, t, w), p) return w;
-                for (i in (m = k.event && g.global) && 0 == k.active++ && k.event.trigger("ajaxStart"), g.type = g.type.toUpperCase(), g.hasContent = !Ot.test(g.type), d = g.url.replace(Mt, ""), g.hasContent ? g.data && g.processData && 0 === (g.contentType || "").indexOf("application/x-www-form-urlencoded") && (g.data = g.data.replace(Tt, "+")) : (o = g.url.slice(d.length), g.data && (g.processData || "string" == typeof g.data) && (d += ($t.test(d) ? "&" : "?") + g.data, delete g.data), !1 === g.cache && (d = d.replace(At, "$1"), o = ($t.test(d) ? "&" : "?") + "_=" + _t++ + o), g.url = d + o), g.ifModified && (k.lastModified[d] && w.setRequestHeader("If-Modified-Since", k.lastModified[d]), k.etag[d] && w.setRequestHeader("If-None-Match", k.etag[d])), (g.data && g.hasContent && !1 !== g.contentType || t.contentType) && w.setRequestHeader("Content-Type", g.contentType), w.setRequestHeader("Accept", g.dataTypes[0] && g.accepts[g.dataTypes[0]] ? g.accepts[g.dataTypes[0]] + ("*" !== g.dataTypes[0] ? ", " + Rt + "; q=0.01" : "") : g.accepts["*"]), g.headers) w.setRequestHeader(i, g.headers[i]);
+                if (g.data && g.processData && "string" != typeof g.data && (g.data = k.param(g.data, g.traditional)), Ut(Ht, g, t, w), p) return w;
+                for (i in (m = k.event && g.global) && 0 == k.active++ && k.event.trigger("ajaxStart"), g.type = g.type.toUpperCase(), g.hasContent = !Rt.test(g.type), d = g.url.replace(Ot, ""), g.hasContent ? g.data && g.processData && 0 === (g.contentType || "").indexOf("application/x-www-form-urlencoded") && (g.data = g.data.replace(Dt, "+")) : (o = g.url.slice(d.length), g.data && (g.processData || "string" == typeof g.data) && (d += (kt.test(d) ? "&" : "?") + g.data, delete g.data), !1 === g.cache && (d = d.replace(Nt, "$1"), o = (kt.test(d) ? "&" : "?") + "_=" + Ct++ + o), g.url = d + o), g.ifModified && (k.lastModified[d] && w.setRequestHeader("If-Modified-Since", k.lastModified[d]), k.etag[d] && w.setRequestHeader("If-None-Match", k.etag[d])), (g.data && g.hasContent && !1 !== g.contentType || t.contentType) && w.setRequestHeader("Content-Type", g.contentType), w.setRequestHeader("Accept", g.dataTypes[0] && g.accepts[g.dataTypes[0]] ? g.accepts[g.dataTypes[0]] + ("*" !== g.dataTypes[0] ? ", " + Lt + "; q=0.01" : "") : g.accepts["*"]), g.headers) w.setRequestHeader(i, g.headers[i]);
                 if (g.beforeSend && (!1 === g.beforeSend.call(v, w, g) || p)) return w.abort();
-                if (l = "abort", _.add(g.complete), w.done(g.success), w.fail(g.error), u = jt(It, g, t, w)) {
+                if (l = "abort", _.add(g.complete), w.done(g.success), w.fail(g.error), u = Ut(jt, g, t, w)) {
                     if (w.readyState = 1, m && b.trigger("ajaxSend", [w, g]), p) return w;
                     g.async && 0 < g.timeout && (h = E.setTimeout(function() {
                         w.abort("timeout")
                     success: n
                 }, k.isPlainObject(e) && e))
             }
-        }), k._evalUrl = function(e) {
+        }), k._evalUrl = function(e, t) {
             return k.ajax({
                 url: e,
                 type: "GET",
                 cache: !0,
                 async: !1,
                 global: !1,
-                throws: !0
+                converters: {
+                    "text script": function() {}
+                },
+                dataFilter: function(e) {
+                    k.globalEval(e, t)
+                }
             })
         }, k.fn.extend({
             wrapAll: function(e) {
                 return new E.XMLHttpRequest
             } catch (e) {}
         };
-        var Ft = {
+        var Bt = {
                 0: 200,
                 1223: 204
             },
-            qt = k.ajaxSettings.xhr();
-        v.cors = !!qt && "withCredentials" in qt, v.ajax = qt = !!qt, k.ajaxTransport(function(i) {
+            zt = k.ajaxSettings.xhr();
+        v.cors = !!zt && "withCredentials" in zt, v.ajax = zt = !!zt, k.ajaxTransport(function(i) {
             var o, a;
-            if (v.cors || qt && !i.crossDomain) return {
+            if (v.cors || zt && !i.crossDomain) return {
                 send: function(e, t) {
                     var n, r = i.xhr();
                     if (r.open(i.type, i.url, i.async, i.username, i.password), i.xhrFields)
                     for (n in i.mimeType && r.overrideMimeType && r.overrideMimeType(i.mimeType), i.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"), e) r.setRequestHeader(n, e[n]);
                     o = function(e) {
                         return function() {
-                            o && (o = a = r.onload = r.onerror = r.onabort = r.ontimeout = r.onreadystatechange = null, "abort" === e ? r.abort() : "error" === e ? "number" != typeof r.status ? t(0, "error") : t(r.status, r.statusText) : t(Ft[r.status] || r.status, r.statusText, "text" !== (r.responseType || "text") || "string" != typeof r.responseText ? {
+                            o && (o = a = r.onload = r.onerror = r.onabort = r.ontimeout = r.onreadystatechange = null, "abort" === e ? r.abort() : "error" === e ? "number" != typeof r.status ? t(0, "error") : t(r.status, r.statusText) : t(Bt[r.status] || r.status, r.statusText, "text" !== (r.responseType || "text") || "string" != typeof r.responseText ? {
                                 binary: r.response
                             } : {
                                 text: r.responseText
             void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET")
         }), k.ajaxTransport("script", function(n) {
             var r, i;
-            if (n.crossDomain) return {
+            if (n.crossDomain || n.scriptAttrs) return {
                 send: function(e, t) {
-                    r = k("<script>").prop({
+                    r = k("<script>").attr(n.scriptAttrs || {}).prop({
                         charset: n.scriptCharset,
                         src: n.url
                     }).on("load error", i = function(e) {
                 }
             }
         });
-        var Ut, Vt = [],
-            zt = /(=)\?(?=&|$)|\?\?/;
+        var Wt, Yt = [],
+            Gt = /(=)\?(?=&|$)|\?\?/;
         k.ajaxSetup({
             jsonp: "callback",
             jsonpCallback: function() {
-                var e = Vt.pop() || k.expando + "_" + _t++;
+                var e = Yt.pop() || k.expando + "_" + Ct++;
                 return this[e] = !0, e
             }
         }), k.ajaxPrefilter("json jsonp", function(e, t, n) {
-            var r, i, o, a = !1 !== e.jsonp && (zt.test(e.url) ? "url" : "string" == typeof e.data && 0 === (e.contentType || "").indexOf("application/x-www-form-urlencoded") && zt.test(e.data) && "data");
-            if (a || "jsonp" === e.dataTypes[0]) return r = e.jsonpCallback = b(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback, a ? e[a] = e[a].replace(zt, "$1" + r) : !1 !== e.jsonp && (e.url += ($t.test(e.url) ? "&" : "?") + e.jsonp + "=" + r), e.converters["script json"] = function() {
+            var r, i, o, a = !1 !== e.jsonp && (Gt.test(e.url) ? "url" : "string" == typeof e.data && 0 === (e.contentType || "").indexOf("application/x-www-form-urlencoded") && Gt.test(e.data) && "data");
+            if (a || "jsonp" === e.dataTypes[0]) return r = e.jsonpCallback = b(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback, a ? e[a] = e[a].replace(Gt, "$1" + r) : !1 !== e.jsonp && (e.url += (kt.test(e.url) ? "&" : "?") + e.jsonp + "=" + r), e.converters["script json"] = function() {
                 return o || k.error(r + " was not called"), o[0]
             }, e.dataTypes[0] = "json", i = E[r], E[r] = function() {
                 o = arguments
             }, n.always(function() {
-                void 0 === i ? k(E).removeProp(r) : E[r] = i, e[r] && (e.jsonpCallback = t.jsonpCallback, Vt.push(r)), o && b(i) && i(o[0]), o = i = void 0
+                void 0 === i ? k(E).removeProp(r) : E[r] = i, e[r] && (e.jsonpCallback = t.jsonpCallback, Yt.push(r)), o && b(i) && i(o[0]), o = i = void 0
             }), "script"
-        }), v.createHTMLDocument = ((Ut = C.implementation.createHTMLDocument("").body).innerHTML = "<form></form><form></form>", 2 === Ut.childNodes.length), k.parseHTML = function(e, t, n) {
-            return "string" != typeof e ? [] : ("boolean" == typeof t && (n = t, t = !1), t || (v.createHTMLDocument ? ((r = (t = C.implementation.createHTMLDocument("")).createElement("base")).href = C.location.href, t.head.appendChild(r)) : t = C), o = !n && [], (i = M.exec(e)) ? [t.createElement(i[1])] : (i = ve([e], t, o), o && o.length && k(o).remove(), k.merge([], i.childNodes)));
+        }), v.createHTMLDocument = ((Wt = C.implementation.createHTMLDocument("").body).innerHTML = "<form></form><form></form>", 2 === Wt.childNodes.length), k.parseHTML = function(e, t, n) {
+            return "string" != typeof e ? [] : ("boolean" == typeof t && (n = t, t = !1), t || (v.createHTMLDocument ? ((r = (t = C.implementation.createHTMLDocument("")).createElement("base")).href = C.location.href, t.head.appendChild(r)) : t = C), o = !n && [], (i = M.exec(e)) ? [t.createElement(i[1])] : (i = _e([e], t, o), o && o.length && k(o).remove(), k.merge([], i.childNodes)));
             var r, i, o
         }, k.fn.load = function(e, t, n) {
             var r, i, o, a = this,
                 s = e.indexOf(" ");
-            return -1 < s && (r = ht(e.slice(s)), e = e.slice(0, s)), b(t) ? (n = t, t = void 0) : t && "object" == typeof t && (i = "POST"), 0 < a.length && k.ajax({
+            return -1 < s && (r = vt(e.slice(s)), e = e.slice(0, s)), b(t) ? (n = t, t = void 0) : t && "object" == typeof t && (i = "POST"), 0 < a.length && k.ajax({
                 url: e,
                 type: i || "GET",
                 dataType: "html",
             offsetParent: function() {
                 return this.map(function() {
                     for (var e = this.offsetParent; e && "static" === k.css(e, "position");) e = e.offsetParent;
-                    return e || be
+                    return e || re
                 })
             }
         }), k.each({
                 }, t, e, arguments.length)
             }
         }), k.each(["top", "left"], function(e, n) {
-            k.cssHooks[n] = Fe(v.pixelPosition, function(e, t) {
-                if (t) return t = Le(e, n), Pe.test(t) ? k(e).position()[n] + "px" : t
+            k.cssHooks[n] = Ve(v.pixelPosition, function(e, t) {
+                if (t) return t = Ue(e, n), Le.test(t) ? k(e).position()[n] + "px" : t
             })
         }), k.each({
             Height: "height",
         }, "function" == typeof define && define.amd && define("jquery", [], function() {
             return k
         });
-        var Bt = E.jQuery,
-            Wt = E.$;
+        var Kt = E.jQuery,
+            Zt = E.$;
         return k.noConflict = function(e) {
-            return E.$ === k && (E.$ = Wt), e && E.jQuery === k && (E.jQuery = Bt), k
+            return E.$ === k && (E.$ = Zt), e && E.jQuery === k && (E.jQuery = Kt), k
         }, e || (E.jQuery = E.$ = k), k
     }),
     function(t, a, e) {
                     }
                 },
                 getTarget: function(e, t) {
-                    return e.indexOf("?") < 0 ? e += "?" : e += "&", e + t.join("&")
+                    return 0 == t.length ? e : (e.indexOf("?") < 0 ? e += "?" : e += "&", e + t.join("&"))
                 },
                 test: function() {
                     this.xhr = new XMLHttpRequest, this.xhr.addEventListener("load", this.testHandler, !1), this.xhr.addEventListener("error", this.testHandler, !1);
                         this.xhr.setRequestHeader(t, e)
                     }, this), a
                 }
-            }, r.evalOpts = c, r.extend = d, r.each = f, r.FlowFile = s, r.FlowChunk = l, r.version = "2.13.1", "object" == typeof module && module && "object" == typeof module.exports ? module.exports = r : (t.Flow = r, "function" == typeof define && define.amd && define("flow", [], function() {
+            }, r.evalOpts = c, r.extend = d, r.each = f, r.FlowFile = s, r.FlowChunk = l, r.version = "2.13.2", "object" == typeof module && module && "object" == typeof module.exports ? module.exports = r : (t.Flow = r, "function" == typeof define && define.amd && define("flow", [], function() {
                 return r
             }))
         } else console.warn("Flowjs needs window and document objects to work");
     }]), angular.module("flow", ["flow.provider", "flow.init", "flow.events", "flow.btn", "flow.drop", "flow.transfers", "flow.img", "flow.dragEvents"]),
     function(C, k) {
         "use strict";
-        var x, T, M, A, S, O, D, N, I, R, P = k.$$minErr("$sanitize");
+        var x, T, M, A, S, D, O, N, I, R, P = k.$$minErr("$sanitize");
         k.module("ngSanitize", []).provider("$sanitize", function() {
             var t = !1,
                 r = !1;
                 }), y(u, e.svgElements), y(s, e.htmlVoidElements), y(f, e.htmlVoidElements), y(f, e.htmlElements)), this
             }, this.addValidAttrs = function(e) {
                 return t || T(g, b(e, !0)), this
-            }, x = k.bind, T = k.extend, M = k.forEach, A = k.isArray, S = k.isDefined, O = k.$$lowercase, D = k.noop, I = function(e, t) {
+            }, x = k.bind, T = k.extend, M = k.forEach, A = k.isArray, S = k.isDefined, D = k.$$lowercase, O = k.noop, I = function(e, t) {
                 null == e ? e = "" : "string" != typeof e && (e = "" + e);
                 var n = _(e);
                 if (!n) return "";
                     a = x(e, e.push);
                 return {
                     start: function(i, e) {
-                        i = O(i), !t && d[i] && (t = i), t || !0 !== f[i] || (a("<"), a(i), M(e, function(e, t) {
-                            var n = O(t),
+                        i = D(i), !t && d[i] && (t = i), t || !0 !== f[i] || (a("<"), a(i), M(e, function(e, t) {
+                            var n = D(t),
                                 r = "img" === i && "src" === n || "background" === n;
                             !0 !== g[n] || !0 === h[n] && !o(e, r) || (a(" "), a(t), a('="'), a(w(e)), a('"'))
                         }), a(">"))
                     },
                     end: function(e) {
-                        e = O(e), t || !0 !== f[e] || !0 === s[e] || (a("</"), a(e), a(">")), e == t && (t = !1)
+                        e = D(e), t || !0 !== f[e] || !0 === s[e] || (a("</"), a(e), a(">")), e == t && (t = !1)
                     },
                     chars: function(e) {
                         t || a(w(e))
 
             function b(e, t) {
                 var n, r = {};
-                for (n = 0; n < e.length; n++) r[t ? O(e[n]) : e[n]] = !0;
+                for (n = 0; n < e.length; n++) r[t ? D(e[n]) : e[n]] = !0;
                 return r
             }
 
                 return n
             }
         }).info({
-            angularVersion: "1.7.5"
+            angularVersion: "1.7.8"
         }), k.module("ngSanitize").filter("linky", ["$sanitize", function(d) {
             var f = /((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,
                 h = /^mailto:/i,
 
                 function c(e) {
                     var t, n;
-                    e && l.push((t = e, R(n = [], D).chars(t), n.join("")))
+                    e && l.push((t = e, R(n = [], O).chars(t), n.join("")))
                 }
 
                 function u(e, t) {
 
         function fe(e, n, r) {
             var i = "";
-            return e = Se(e) ? e : e && Oe(e) && e.length ? e.split(/\s+/) : [], Ae(e, function(e, t) {
+            return e = Se(e) ? e : e && De(e) && e.length ? e.split(/\s+/) : [], Ae(e, function(e, t) {
                 e && 0 < e.length && (i += 0 < t ? " " : "", i += r ? n + e : e + n)
             }), i
         }
                     };
 
                     function r(e) {
-                        Oe(e) && (e = e.split(" "));
+                        De(e) && (e = e.split(" "));
                         var t = {};
                         return Ae(e, function(e) {
                             e.length && (t[e] = !0)
         }
 
         function be(e, t) {
-            var n = t ? "-" + t + "s" : "";
-            return _e(e, [r, n]), [r, n]
-        }
-
-        function ye(e, t) {
             var n = t ? "paused" : "",
                 r = oe + o;
-            return _e(e, [r, n]), [r, n]
+            return ye(e, [r, n]), [r, n]
         }
 
-        function _e(e, t) {
+        function ye(e, t) {
             var n = t[0],
                 r = t[1];
             e.style[n] = r
         function ee(e, t) {
             return e ? t ? e + " " + t : e : t
         }
-        var s = ["$interpolate", function(o) {
+        var _e = function(e, t) {
+                var n = t ? "-" + t + "s" : "";
+                return ye(e, [r, n]), [r, n]
+            },
+            s = ["$interpolate", function(o) {
                 return {
                     link: function(e, t, n) {
                         var r = n.ngAnimateChildren;
                         function i(e) {
                             e = "on" === e || "true" === e, t.data(X, e)
                         }
-                        Oe(r) && 0 === r.length ? t.data(X, !0) : (i(o(r)(e)), n.$observe("ngAnimateChildren", i))
+                        De(r) && 0 === r.length ? t.data(X, !0) : (i(o(r)(e)), n.$observe("ngAnimateChildren", i))
                     }
                 }
             }],
                 t[e] = te(t[e]) ? t[e] : n.style.getPropertyValue(e)
             })
         }
-        var Me, m, Ae, Se, te, g, $, ne, Oe, De, Ne, Ie, c = ["$animateProvider", function(e) {
+        var Me, m, Ae, Se, te, g, $, ne, De, Oe, Ne, Ie, c = ["$animateProvider", function(e) {
                 this.$get = ["$window", "$$jqLite", "$$AnimateRunner", "$timeout", "$$animateCache", "$$forceReflow", "$sniffer", "$$rAFScheduler", "$$animateQueue", function(Y, G, K, Z, X, n, Q, t, J) {
                     var ee = x(G);
                     var r = [];
                         u.$$prepared || (u = he(Me(u)));
                         var d = {},
                             f = ve(c);
-                        if (!f || !f.parentNode || !J.enabled()) return z();
+                        if (!f || !f.parentNode || !J.enabled()) return B();
                         var t, n, h, o, a, r, i, p, m, g, v, b, y = [],
                             s = (c.attr("class"), n = {}, (t = u) && (t.to || t.from) && (n.to = t.to, n.from = t.from), n),
                             _ = [];
-                        if (0 === u.duration || !Q.animations && !Q.transitions) return z();
+                        if (0 === u.duration || !Q.animations && !Q.transitions) return B();
                         var $ = u.event && Se(u.event) ? u.event.join(" ") : u.event,
                             l = $ && u.structural,
                             w = "",
                         l ? w = fe($, ce, !0) : $ && (w = $), u.addClass && (E += fe(u.addClass, se)), u.removeClass && (E.length && (E += " "), E += fe(u.removeClass, le)), u.applyClassesEarly && E.length && ee(c, u);
                         var C = [w, E].join(" ").trim(),
                             k = s.to && 0 < Object.keys(s.to).length;
-                        if (!(0 < (u.keyframeStyle || "").length) && !k && !C) return z();
+                        if (!(0 < (u.keyframeStyle || "").length) && !k && !C) return B();
                         var x, T, M = X.cacheKey(f, $, u.addClass, u.removeClass);
-                        if (X.containsCachedAnimationWithoutDuration(M)) return C = null, z();
+                        if (X.containsCachedAnimationWithoutDuration(M)) return C = null, B();
                         if (0 < u.stagger) {
                             var A = parseFloat(u.stagger);
                             x = {
                         }(f, C, M, we);
                         if (u.$$skipPreparationClasses || G.addClass(c, C), u.transitionStyle) {
                             var S = [re, u.transitionStyle];
-                            _e(f, S), y.push(S)
+                            ye(f, S), y.push(S)
                         }
                         if (0 <= u.duration) {
                             T = 0 < f.style[re].length;
-                            var O = xe(u.duration, T);
-                            _e(f, O), y.push(O)
+                            var D = xe(u.duration, T);
+                            ye(f, D), y.push(D)
                         }
                         if (u.keyframeStyle) {
-                            var D = [oe, u.keyframeStyle];
-                            _e(f, D), y.push(D)
+                            var O = [oe, u.keyframeStyle];
+                            ye(f, O), y.push(O)
                         }
                         var N = x ? 0 <= u.staggerIndex ? u.staggerIndex : X.count(M) : 0,
                             I = 0 === N;
-                        I && !u.skipBlocking && be(f, 9999);
+                        I && !u.skipBlocking && _e(f, 9999);
                         var R = ne(f, 0, M, !l),
                             P = R.maxDelay;
                         p = Math.max(P, 0), g = R.maxDuration;
                         var H = {};
-                        if (H.hasTransitions = 0 < R.transitionDuration, H.hasAnimations = 0 < R.animationDuration, H.hasTransitionAll = H.hasTransitions && "all" === R.transitionProperty, H.applyTransitionDuration = k && (H.hasTransitions && !H.hasTransitionAll || H.hasAnimations && !H.hasTransitions), H.applyAnimationDuration = u.duration && H.hasAnimations, H.applyTransitionDelay = ke(u.delay) && (H.applyTransitionDuration || H.hasTransitions), H.applyAnimationDelay = ke(u.delay) && H.hasAnimations, H.recalculateTimingStyles = 0 < E.length, (H.applyTransitionDuration || H.applyAnimationDuration) && (g = u.duration ? parseFloat(u.duration) : g, H.applyTransitionDuration && (H.hasTransitions = !0, R.transitionDuration = g, T = 0 < f.style[re + "Property"].length, y.push(xe(g, T))), H.applyAnimationDuration && (H.hasAnimations = !0, R.animationDuration = g, y.push([de, g + "s"]))), 0 === g && !H.recalculateTimingStyles) return z();
+                        if (H.hasTransitions = 0 < R.transitionDuration, H.hasAnimations = 0 < R.animationDuration, H.hasTransitionAll = H.hasTransitions && "all" === R.transitionProperty, H.applyTransitionDuration = k && (H.hasTransitions && !H.hasTransitionAll || H.hasAnimations && !H.hasTransitions), H.applyAnimationDuration = u.duration && H.hasAnimations, H.applyTransitionDelay = ke(u.delay) && (H.applyTransitionDuration || H.hasTransitions), H.applyAnimationDelay = ke(u.delay) && H.hasAnimations, H.recalculateTimingStyles = 0 < E.length, (H.applyTransitionDuration || H.applyAnimationDuration) && (g = u.duration ? parseFloat(u.duration) : g, H.applyTransitionDuration && (H.hasTransitions = !0, R.transitionDuration = g, T = 0 < f.style[re + "Property"].length, y.push(xe(g, T))), H.applyAnimationDuration && (H.hasAnimations = !0, R.animationDuration = g, y.push([de, g + "s"]))), 0 === g && !H.recalculateTimingStyles) return B();
                         var j, L = fe(C, "-active");
                         null != u.delay && ("boolean" != typeof u.delay && (j = parseFloat(u.delay), p = Math.max(j, 0)), H.applyTransitionDelay && y.push(Ee(j)), H.applyAnimationDelay && y.push(Ee(j, !0)));
-                        return null == u.duration && 0 < R.transitionDuration && (H.recalculateTimingStyles = H.recalculateTimingStyles || I), m = 1e3 * p, v = 1e3 * g, u.skipBlocking || (H.blockTransition = 0 < R.transitionDuration, H.blockKeyframeAnimation = 0 < R.animationDuration && 0 < x.animationDelay && 0 === x.animationDuration), u.from && (u.cleanupStyles && Te(d, f, Object.keys(u.from)), me(c, u)), H.blockTransition || H.blockKeyframeAnimation ? V(g) : u.skipBlocking || be(f, !1), {
+                        return null == u.duration && 0 < R.transitionDuration && (H.recalculateTimingStyles = H.recalculateTimingStyles || I), m = 1e3 * p, v = 1e3 * g, u.skipBlocking || (H.blockTransition = 0 < R.transitionDuration, H.blockKeyframeAnimation = 0 < R.animationDuration && 0 < x.animationDelay && 0 === x.animationDuration), u.from && (u.cleanupStyles && Te(d, f, Object.keys(u.from)), me(c, u)), H.blockTransition || H.blockKeyframeAnimation ? V(g) : u.skipBlocking || _e(f, !1), {
                             $$willAnimate: !0,
                             end: F,
                             start: function() {
 
                         function U(e) {
                             if (!(h || a && o)) {
-                                o = !(h = !0), C && !u.$$skipPreparationClasses && G.removeClass(c, C), L && G.removeClass(c, L), ye(f, !1), be(f, !1), Ae(y, function(e) {
+                                o = !(h = !0), C && !u.$$skipPreparationClasses && G.removeClass(c, C), L && G.removeClass(c, L), be(f, !1), _e(f, !1), Ae(y, function(e) {
                                     f.style[e[0]] = ""
                                 }), ee(c, u), pe(c, u), Object.keys(d).length && Ae(d, function(e, t) {
                                     e ? f.style.setProperty(t, e) : f.style.removeProperty(t)
-                                }), u.onDone && u.onDone(), _ && _.length && c.off(_.join(" "), B);
+                                }), u.onDone && u.onDone(), _ && _.length && c.off(_.join(" "), z);
                                 var t = c.data($e);
                                 t && (Z.cancel(t[0].timer), c.removeData($e)), r && r.complete(!e)
                             }
                         }
 
                         function V(e) {
-                            H.blockTransition && be(f, e), H.blockKeyframeAnimation && ye(f, !!e)
+                            H.blockTransition && _e(f, e), H.blockKeyframeAnimation && be(f, !!e)
                         }
 
-                        function z() {
+                        function B() {
                             return r = new K({
                                 end: F,
                                 cancel: q
                             }
                         }
 
-                        function B(e) {
+                        function z(e) {
                             e.stopPropagation();
                             var t = e.originalEvent || e;
                             if (t.target === f) {
                                     var e = function(e) {
                                             if (a) o && e && (o = !1, U());
                                             else if (o = !e, R.animationDuration) {
-                                                var t = ye(f, o);
+                                                var t = be(f, o);
                                                 o ? y.push(t) : (r = t, i = (n = y).indexOf(r), 0 <= r && n.splice(i, 1))
                                             }
                                             var n, r, i
                                             expectedEndTime: r
                                         }, i.push(U), c.data($e, i)
                                     }
-                                    _.length && c.on(_.join(" "), B), u.to && (u.cleanupStyles && Te(d, f, Object.keys(u.to)), ge(c, u))
+                                    _.length && c.on(_.join(" "), z), u.to && (u.cleanupStyles && Te(d, f, Object.keys(u.to)), ge(c, u))
                                 }
                             }
 
                     }
 
                     function b(e, t) {
-                        return Oe(e) && (e = e.split(" ")), Oe(t) && (t = t.split(" ")), e.filter(function(e) {
+                        return De(e) && (e = e.split(" ")), De(t) && (t = t.split(" ")), e.filter(function(e) {
                             return -1 === t.indexOf(e)
                         }).join(" ")
                     }
                         r = e.removeClass,
                         i = t.addClass,
                         o = t.removeClass;
-                    return !(De(n) && De(r) || De(i) && De(o)) && (a(n, o) || a(r, i))
-                }), this.$get = ["$$rAF", "$rootScope", "$rootElement", "$document", "$$Map", "$$animation", "$$AnimateRunner", "$templateRequest", "$$jqLite", "$$forceReflow", "$$isDocumentHidden", function(M, A, S, O, e, D, N, t, n, r, I) {
+                    return !(Oe(n) && Oe(r) || Oe(i) && Oe(o)) && (a(n, o) || a(r, i))
+                }), this.$get = ["$$rAF", "$rootScope", "$rootElement", "$document", "$$Map", "$$animation", "$$AnimateRunner", "$templateRequest", "$$jqLite", "$$forceReflow", "$$isDocumentHidden", function(M, A, S, D, e, O, N, t, n, r, I) {
                     var R = new e,
                         P = new e,
                         H = null;
                         })
                     }
 
-                    function z(e, t) {
+                    function B(e, t) {
                         "close" !== e || t.parentNode || u.off(t)
                     }
                     var u = {
                             })
                         },
                         off: function(e, t, n) {
-                            if (1 !== arguments.length || Oe(e)) {
+                            if (1 !== arguments.length || De(e)) {
                                 var r = j[e];
                                 r && (j[e] = 1 === arguments.length ? null : c(r, t, n))
                             } else
                                         });
                                     var n;
                                     Se(a.addClass) && (a.addClass = a.addClass.join(" "));
-                                    a.addClass && !Oe(a.addClass) && (a.addClass = null);
+                                    a.addClass && !De(a.addClass) && (a.addClass = null);
                                     Se(a.removeClass) && (a.removeClass = a.removeClass.join(" "));
-                                    a.removeClass && !Oe(a.removeClass) && (a.removeClass = null);
+                                    a.removeClass && !De(a.removeClass) && (a.removeClass = null);
                                     a.from && !ne(a.from) && (a.from = null);
                                     a.to && !ne(a.to) && (a.to = null);
                                     if (!(H && u && L(u, o, e) && F(u, a))) return T(), s;
                                         h = !f && R.get(u) || {},
                                         p = !!h.state;
                                     f || p && 1 === h.state || (f = ! function(e, t, n) {
-                                        var r, i = O[0].body,
+                                        var r, i = D[0].body,
                                             o = ve(S),
                                             a = e === i || "HTML" === e.nodeName,
                                             s = e === o,
                                                     break
                                                 }!1 === f && (c = !1), l = d.structural
                                             }
-                                            if (De(r) || !0 === r) {
+                                            if (Oe(r) || !0 === r) {
                                                 var h = Ne.data(t, X);
                                                 te(h) && (r = h)
                                             }
                                     var _, $, w, E;
                                     var C = g.structural;
                                     C || (C = "animate" === g.event && 0 < Object.keys(g.options.to || {}).length || K(g));
-                                    if (!C) return T(), B(u), s;
+                                    if (!C) return T(), z(u), s;
                                     var k = (h.counter || 0) + 1;
                                     return g.counter = k, W(u, 1, g), A.$$postDigest(function() {
                                         c = Q(i);
                                             t = !e;
                                         e = e || {};
                                         var n = 0 < (c.parent() || []).length && ("animate" === e.event || e.structural || K(e));
-                                        if (t || e.counter !== k || !n) return t && (q(c, a), pe(c, a)), (t || l && e.event !== o) && (a.domOperation(), s.end()), void(n || B(u));
+                                        if (t || e.counter !== k || !n) return t && (q(c, a), pe(c, a)), (t || l && e.event !== o) && (a.domOperation(), s.end()), void(n || z(u));
                                         o = !e.structural && K(e, !0) ? "setClass" : e.event, W(u, 2);
-                                        var r = D(c, o, e.options);
+                                        var r = O(c, o, e.options);
                                         s.setHost(r), x(s, o, "start", Y(a)), r.done(function(e) {
                                             T(!e);
                                             var t = R.get(u);
-                                            t && t.counter === k && B(u), x(s, o, "close", Y(a))
+                                            t && t.counter === k && z(u), x(s, o, "close", Y(a))
                                         })
                                     }), s;
 
                                             o.length ? M(function() {
                                                 Ae(o, function(e) {
                                                     e(c, s, l)
-                                                }), z(s, u)
-                                            }) : z(s, u)
+                                                }), B(s, u)
+                                            }) : B(s, u)
                                         }), e.progress(a, s, l)
                                     }
 
                     };
                     return u;
 
-                    function B(e) {
+                    function z(e) {
                         e.removeAttribute(Re), R.delete(e)
                     }
 
                 }]
             }];
         e.module("ngAnimate", [], function() {
-            Ie = e.noop, Me = e.copy, m = e.extend, Ne = e.element, Ae = e.forEach, Se = e.isArray, Oe = e.isString, ne = e.isObject, De = e.isUndefined, te = e.isDefined, $ = e.isFunction, g = e.isElement
+            Ie = e.noop, Me = e.copy, m = e.extend, Ne = e.element, Ae = e.forEach, Se = e.isArray, De = e.isString, ne = e.isObject, Oe = e.isUndefined, te = e.isDefined, $ = e.isFunction, g = e.isElement
         }).info({
-            angularVersion: "1.7.5"
+            angularVersion: "1.7.8"
         }).directive("ngAnimateSwap", ["$animate", function(s) {
             return {
                 restrict: "A",
                 transclude: "element",
                 terminal: !0,
-                priority: 600,
+                priority: 550,
                 link: function(e, n, t, r, i) {
                     var o, a;
                     e.$watchCollection(t.ngAnimateSwap || t.for, function(e) {
         "use strict";
         var h = "ngAriaDisable",
             n = t.module("ngAria", ["ng"]).info({
-                angularVersion: "1.7.5"
+                angularVersion: "1.7.8"
             }).provider("$aria", function() {
                 var l = {
                     ariaHidden: !0,
                         return function(n, e, t) {
                             c(e, o) || (i.config("bindRoleForClick") && !e.attr("role") && e.attr("role", "button"), i.config("tabindex") && !e.attr("tabindex") && e.attr("tabindex", 0), !i.config("bindKeydown") || t.ngKeydown || t.ngKeypress || t.ngKeyup || e.on("keydown", function(e) {
                                 var t = e.which || e.keyCode;
-                                13 !== t && 32 !== t || (-1 === o.indexOf(e.target.nodeName) && e.preventDefault(), n.$apply(function() {
+                                13 !== t && 32 !== t || (-1 !== o.indexOf(e.target.nodeName) || e.target.isContentEditable || e.preventDefault(), n.$apply(function() {
                                     r(n, {
                                         $event: e
                                     })
         t.module("ngMessages", [], function() {
             w = t.forEach, p = t.isArray, l = t.isString, c = t.element
         }).info({
-            angularVersion: "1.7.5"
+            angularVersion: "1.7.8"
         }).directive("ngMessages", ["$animate", function(b) {
             var y = "ng-inactive";
             return {
             }
         }]).directive("ngMessage", n()).directive("ngMessageExp", n()).directive("ngMessageDefault", n(!0))
     }(window, window.angular),
-    function(F, se, le) {
+    function(F, ue, de) {
         "use strict";
-        se.module("ngMaterial", ["ng", "ngAnimate", "ngAria", "material.core", "material.core.gestures", "material.core.interaction", "material.core.layout", "material.core.meta", "material.core.theming.palette", "material.core.theming", "material.core.animate", "material.components.autocomplete", "material.components.backdrop", "material.components.bottomSheet", "material.components.button", "material.components.card", "material.components.checkbox", "material.components.chips", "material.components.colors", "material.components.content", "material.components.datepicker", "material.components.dialog", "material.components.divider", "material.components.fabActions", "material.components.fabShared", "material.components.fabSpeedDial", "material.components.fabToolbar", "material.components.gridList", "material.components.icon", "material.components.input", "material.components.list", "material.components.menu", "material.components.menuBar", "material.components.navBar", "material.components.panel", "material.components.progressCircular", "material.components.progressLinear", "material.components.radioButton", "material.components.select", "material.components.showHide", "material.components.sidenav", "material.components.slider", "material.components.sticky", "material.components.subheader", "material.components.swipe", "material.components.switch", "material.components.tabs", "material.components.toast", "material.components.toolbar", "material.components.tooltip", "material.components.truncate", "material.components.virtualRepeat", "material.components.whiteframe"]),
+        ue.module("ngMaterial", ["ng", "ngAnimate", "ngAria", "material.core", "material.core.animate", "material.core.gestures", "material.core.interaction", "material.core.layout", "material.core.meta", "material.core.theming.palette", "material.core.theming", "material.components.autocomplete", "material.components.backdrop", "material.components.bottomSheet", "material.components.button", "material.components.card", "material.components.checkbox", "material.components.chips", "material.components.colors", "material.components.content", "material.components.datepicker", "material.components.dialog", "material.components.divider", "material.components.fabActions", "material.components.fabShared", "material.components.fabSpeedDial", "material.components.fabToolbar", "material.components.gridList", "material.components.icon", "material.components.input", "material.components.list", "material.components.menu", "material.components.menuBar", "material.components.navBar", "material.components.panel", "material.components.progressCircular", "material.components.progressLinear", "material.components.radioButton", "material.components.select", "material.components.showHide", "material.components.sidenav", "material.components.slider", "material.components.sticky", "material.components.subheader", "material.components.swipe", "material.components.switch", "material.components.tabs", "material.components.toast", "material.components.toolbar", "material.components.tooltip", "material.components.truncate", "material.components.virtualRepeat", "material.components.whiteframe"]),
             function() {
                 function e(e, t) {
                     if (t.has("$swipe")) {
                 function r(e) {
                     return e.resolve || (e.resolve = e.when), e
                 }
-                e.$inject = ["$log", "$injector"], t.$inject = ["$provide", "$mdThemingProvider"], n.$inject = ["$delegate"], r.$inject = ["$delegate"], se.module("material.core", ["ngAnimate", "material.core.animate", "material.core.layout", "material.core.interaction", "material.core.gestures", "material.core.theming"]).config(t).run(e)
+                e.$inject = ["$log", "$injector"], t.$inject = ["$provide", "$mdThemingProvider"], n.$inject = ["$delegate"], r.$inject = ["$delegate"], ue.module("material.core", ["ngAnimate", "material.core.animate", "material.core.layout", "material.core.interaction", "material.core.gestures", "material.core.theming"]).config(t).run(e)
             }(),
             function() {
                 function e(o) {
                                 i(o(r)(e)), r && e.$watch(r, i);
 
                                 function i(e) {
-                                    se.isUndefined(e) && (e = !0), t.toggleClass("md-autofocus", !!e)
+                                    ue.isUndefined(e) && (e = !0), t.toggleClass("md-autofocus", !!e)
                                 }
                             }
                         }
                     }
                 }
-                e.$inject = ["$parse"], se.module("material.core").directive("mdAutofocus", e).directive("mdAutoFocus", e).directive("mdSidenavFocus", e)
-            }(), se.module("material.core").factory("$mdColorUtil", function() {
+                e.$inject = ["$parse"], ue.module("material.core").directive("mdAutofocus", e).directive("mdAutoFocus", e).directive("mdSidenavFocus", e)
+            }(), ue.module("material.core").factory("$mdColorUtil", function() {
                 return {
                     rgbaToHex: function(e) {
                         return ((e = e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)) && 4 === e.length ? "#" + ("0" + parseInt(e[1], 10).toString(16)).slice(-2) + ("0" + parseInt(e[2], 10).toString(16)).slice(-2) + ("0" + parseInt(e[3], 10).toString(16)).slice(-2) : "").toUpperCase()
                         return e ? e.replace("rgba", "rgb").replace(/,[^),]+\)/, ")") : "rgb(0,0,0)"
                     }
                 }
-            }), se.module("material.core").factory("$mdConstant", function() {
+            }), ue.module("material.core").factory("$mdConstant", function() {
                 var i = document.createElement("div"),
                     o = function(e) {
                         var t, n, r = /^(Moz|webkit|ms)(?=[A-Z])/;
                 }
 
                 function s(e, t) {
-                    return se.isDefined(e.style[t])
+                    return ue.isDefined(e.style[t])
                 }
                 var r = {
                     isInputKey: function(e) {
                     var l = function() {
                         return !0
                     };
-                    e && !se.isArray(e) && (e = Array.prototype.slice.call(e)), s = !!s;
+                    e && !ue.isArray(e) && (e = Array.prototype.slice.call(e)), s = !!s;
                     var c = e || [];
                     return {
                         items: function() {
                         },
                         add: function(e, t) {
                             if (!e) return -1;
-                            se.isNumber(t) || (t = c.length);
+                            ue.isNumber(t) || (t = c.length);
                             return c.splice(t, 0, e), d(e)
                         },
                         remove: function(e) {
                         },
                         first: f,
                         last: h,
-                        next: se.bind(null, n, !1),
-                        previous: se.bind(null, n, !0),
+                        next: ue.bind(null, n, !1),
+                        previous: ue.bind(null, n, !0),
                         hasPrevious: function(e) {
                             return !!e && u(d(e) - 1)
                         },
                                 a = null;
                             if (u(o) ? a = c[o] : s && (o = d(a = e ? h() : f())), null === a || o === r) return null;
                             if (n(a)) return a;
-                            se.isUndefined(r) && (r = o), i = o
+                            ue.isUndefined(r) && (r = o), i = o
                         }
                     }
                 }
-                se.module("material.core").config(["$provide", function(e) {
+                ue.module("material.core").config(["$provide", function(e) {
                     e.decorator("$mdUtil", ["$delegate", function(e) {
                         return e.iterator = t, e
                     }])
                         var o = [];
                         return e.forEach(function(e) {
                                 var t = u(r, e);
-                                for (var n in se.isDefined(r[t]) && o.push(r.$observe(t, se.bind(void 0, i, null))), a.MEDIA) t = u(r, e + "-" + n), se.isDefined(r[t]) && o.push(r.$observe(t, se.bind(void 0, i, n)))
+                                for (var n in ue.isDefined(r[t]) && o.push(r.$observe(t, ue.bind(void 0, i, null))), a.MEDIA) t = u(r, e + "-" + n), ue.isDefined(r[t]) && o.push(r.$observe(t, ue.bind(void 0, i, n)))
                             }),
                             function() {
                                 o.forEach(function(e) {
 
                     function e(e) {
                         var t, n = o[e];
-                        se.isUndefined(n) && (n = o[e] = (t = e, a.MEDIA[t] || ("(" !== t.charAt(0) ? "(" + t + ")" : t)));
+                        ue.isUndefined(n) && (n = o[e] = (t = e, a.MEDIA[t] || ("(" !== t.charAt(0) ? "(" + t + ")" : t)));
                         var r = l[n];
-                        return se.isUndefined(r) && (r = function(e) {
+                        return ue.isUndefined(r) && (r = function(e) {
                             var t = s[e];
                             t || (t = s[e] = i.matchMedia(e));
                             return t.addListener(c), l[t.media] = !!t.matches
                         return n[t] || (n[t] = e.$normalize(t))
                     }
                 }
-                e.$inject = ["$mdConstant", "$rootScope", "$window"], se.module("material.core").factory("$mdMedia", e)
+                e.$inject = ["$mdConstant", "$rootScope", "$window"], ue.module("material.core").factory("$mdMedia", e)
             }(),
             function() {
                 function t(e, t) {
                     };
 
                     function i(n) {
-                        return (n = se.isArray(n) ? n : [n]).forEach(function(t) {
+                        return (n = ue.isArray(n) ? n : [n]).forEach(function(t) {
                             r.forEach(function(e) {
                                 n.push(e + "-" + t)
                             })
                     }
 
                     function n(e) {
-                        return i(e = se.isArray(e) ? e : [e]).map(function(e) {
+                        return i(e = ue.isArray(e) ? e : [e]).map(function(e) {
                             return "[" + e + "]"
                         }).join(",")
                     }
                         if ((e = e[0] || e).nodeType) return e
                     }
                 }
-                se.module("material.core").config(["$provide", function(e) {
+                ue.module("material.core").config(["$provide", function(e) {
                     e.decorator("$mdUtil", ["$delegate", function(e) {
                         return e.prefixer = t, e
                     }])
                             var r = !1;
                             if (e && e.length) {
                                 var i = c.getComputedStyle(e[0]);
-                                r = se.isDefined(i[t]) && (!n || i[t] == n)
+                                r = ue.isDefined(i[t]) && (!n || i[t] == n)
                             }
                             return r
                         };
                     }
                     var m = {
                         dom: {},
-                        now: F.performance && F.performance.now ? se.bind(F.performance, F.performance.now) : Date.now || function() {
+                        now: F.performance && F.performance.now ? ue.bind(F.performance, F.performance.now) : Date.now || function() {
                             return (new Date).getTime()
                         },
                         getModelOption: function(e, t) {
                         bidi: function(e, t, n, r) {
                             var i = !("rtl" == l[0].dir || "rtl" == l[0].body.dir);
                             if (0 == arguments.length) return i ? "ltr" : "rtl";
-                            var o = se.element(e);
-                            i && se.isDefined(n) ? o.css(t, p(n)) : !i && se.isDefined(r) && o.css(t, p(r))
+                            var o = ue.element(e);
+                            i && ue.isDefined(n) ? o.css(t, p(n)) : !i && ue.isDefined(r) && o.css(t, p(r))
                         },
                         bidiProperty: function(e, t, n, r) {
                             var i = !("rtl" == l[0].dir || "rtl" == l[0].body.dir),
-                                o = se.element(e);
-                            i && se.isDefined(t) ? (o.css(t, p(r)), o.css(n, "")) : !i && se.isDefined(n) && (o.css(n, p(r)), o.css(t, ""))
+                                o = ue.element(e);
+                            i && ue.isDefined(t) ? (o.css(t, p(r)), o.css(n, "")) : !i && ue.isDefined(n) && (o.css(n, p(r)), o.css(t, ""))
                         },
                         clientRect: function(e, t, n) {
                             var r = g(e);
                             return t
                         },
                         getViewportTop: function() {
-                            return F.scrollY || F.pageYOffset || 0
+                            return m.disableScrollAround._count && m.disableScrollAround._viewPortTop ? m.disableScrollAround._viewPortTop : c.scrollY || c.pageYOffset || 0
                         },
                         findFocusTarget: function(e, t) {
                             var n, r = this.prefixer("md-autofocus", !0);
 
                             function i(e, t) {
                                 var n, r = e[0].querySelectorAll(t);
-                                return r && r.length && r.length && se.forEach(r, function(e) {
-                                    (e = se.element(e)).hasClass("md-autofocus") && (n = e)
+                                return r && r.length && r.length && ue.forEach(r, function(e) {
+                                    (e = ue.element(e)).hasClass("md-autofocus") && (n = e)
                                 }), n
                             }
                         },
                                     var e = l[0].documentElement,
                                         t = e.style.cssText || "",
                                         n = s.style.cssText || "",
-                                        r = m.getViewportTop(),
-                                        i = s.clientWidth,
+                                        r = m.getViewportTop();
+                                    m.disableScrollAround._viewPortTop = r;
+                                    var i = s.clientWidth,
                                         o = s.scrollHeight > s.clientHeight + 1,
                                         a = 0 < e.scrollTop ? e : s;
-                                    o && se.element(s).css({
+                                    o && ue.element(s).css({
                                         position: "fixed",
                                         width: "100%",
                                         top: -r + "px"
                                     });
                                     s.clientWidth < i && (s.style.overflow = "hidden");
-                                    o && (e.style.overflowY = "scroll");
                                     return function() {
                                         s.style.cssText = n, e.style.cssText = t, a.scrollTop = r
                                     }
                                 }(),
                                 i = function(e) {
                                     var t;
-                                    e = se.element(e || s), r.disableScrollMask ? t = e : (t = se.element('<div class="md-scroll-mask">  <div class="md-scroll-mask-bar"></div></div>'), e.append(t));
+                                    e = ue.element(e || s), r.disableScrollMask ? t = e : (t = ue.element('<div class="md-scroll-mask">  <div class="md-scroll-mask-bar"></div></div>'), e.append(t));
                                     return t.on("wheel", n), t.on("touchmove", n),
                                         function() {
                                             t.off("wheel"), t.off("touchmove"), !r.disableScrollMask && t[0].parentNode && t[0].parentNode.removeChild(t[0])
                                     }
                                 }(t);
                             return m.disableScrollAround._restoreScroll = function() {
-                                --m.disableScrollAround._count <= 0 && (n(), i(), delete m.disableScrollAround._restoreScroll)
+                                --m.disableScrollAround._count <= 0 && (delete m.disableScrollAround._viewPortTop, n(), i(), delete m.disableScrollAround._restoreScroll)
                             }
                         },
                         enableScrolling: function() {
                             e && e()
                         },
                         floatingScrollbars: function() {
-                            if (this.floatingScrollbars.cached === le) {
-                                var e = se.element("<div><div></div></div>").css({
+                            if (this.floatingScrollbars.cached === de) {
+                                var e = ue.element("<div><div></div></div>").css({
                                     width: "100%",
                                     "z-index": -1,
                                     position: "absolute",
                         fakeNgModel: function() {
                             return {
                                 $fake: !0,
-                                $setTouched: se.noop,
+                                $setTouched: ue.noop,
                                 $setViewValue: function(e) {
                                     this.$viewValue = e, this.$render(e), this.$viewChangeListeners.forEach(function(e) {
                                         e()
                                 $parsers: [],
                                 $formatters: [],
                                 $viewChangeListeners: [],
-                                $render: se.noop
+                                $render: ue.noop
                             }
                         },
                         debounce: function(n, r, i, o) {
                                 var e = i,
                                     t = Array.prototype.slice.call(arguments);
                                 s.cancel(a), a = s(function() {
-                                    a = le, n.apply(e, t)
+                                    a = de, n.apply(e, t)
                                 }, r || 10, o)
                             }
                         },
                             }
                         },
                         getClosest: function(e, t, n) {
-                            if (se.isString(t)) {
+                            if (ue.isString(t)) {
                                 var r = t.toUpperCase();
                                 t = function(e) {
                                     return e.nodeName.toUpperCase() === r
                                 }
                             }
-                            if (e instanceof se.element && (e = e[0]), n && (e = e.parentNode), !e) return null;
+                            if (e instanceof ue.element && (e = e[0]), n && (e = e.parentNode), !e) return null;
                             do {
                                 if (t(e)) return e
                             } while (e = e.parentNode);
                             return null
                         },
                         elementContains: function(t, n) {
-                            return (F.Node && F.Node.prototype && Node.prototype.contains ? se.bind(t, t.contains) : se.bind(t, function(e) {
+                            return (F.Node && F.Node.prototype && Node.prototype.contains ? ue.bind(t, t.contains) : ue.bind(t, function(e) {
                                 return t === n || !!(16 & this.compareDocumentPosition(e))
                             }))(n)
                         },
                         extractElementByName: function(e, r, t, n) {
                             var i = s(e);
-                            return !i && n && o.warn(m.supplant("Unable to find node '{0}' in element '{1}'.", [r, e[0].outerHTML])), se.element(i || e);
+                            return !i && n && o.warn(m.supplant("Unable to find node '{0}' in element '{1}'.", [r, e[0].outerHTML])), ue.element(i || e);
 
                             function s(e) {
                                 return function(e) {
                             }
                         },
                         initOptionalProperties: function(r, i, o) {
-                            o = o || {}, se.forEach(r.$$isolateBindings, function(e, t) {
-                                if (e.optional && se.isUndefined(r[t])) {
-                                    var n = se.isDefined(i[e.attrName]);
-                                    r[t] = se.isDefined(o[t]) ? o[t] : n
+                            o = o || {}, ue.forEach(r.$$isolateBindings, function(e, t) {
+                                if (e.optional && ue.isUndefined(r[t])) {
+                                    var n = ue.isDefined(i[e.attrName]);
+                                    r[t] = ue.isDefined(o[t]) ? o[t] : n
                                 }
                             })
                         },
                             }, 0, !1))
                         },
                         processTemplate: function(e) {
-                            return f ? e : e && se.isString(e) ? e.replace(/\{\{/g, i).replace(/}}/g, u) : e
+                            return f ? e : e && ue.isString(e) ? e.replace(/\{\{/g, i).replace(/}}/g, u) : e
                         },
                         getParentWithPointerEvents: function(e) {
                             for (var t = e.parent(); h(t, "pointer-events", "none");) t = t.parent();
                             return t
                         },
                         checkStickySupport: function() {
-                            var e, t = se.element("<div>");
+                            var e, t = ue.element("<div>");
                             l[0].body.appendChild(t[0]);
                             for (var n = ["sticky", "-webkit-sticky"], r = 0; r < n.length; ++r)
                                 if (t.css({
                         hasComputedStyle: h,
                         isParentFormSubmitted: function(e) {
                             var t = m.getClosest(e, "form"),
-                                n = t ? se.element(t).controller("form") : null;
+                                n = t ? ue.element(t).controller("form") : null;
                             return !!n && n.$submitted
                         },
                         animateScrollTo: function(i, o, a) {
                             if (e) return e.filter(function(e, t, n) {
                                 return n.indexOf(e) === t
                             })
-                        }
+                        },
+                        getInnerHTML: function(e) {
+                            var t = new XMLSerializer;
+                            return Array.prototype.map.call(e.childNodes, function(e) {
+                                return t.serializeToString(e)
+                            }).join("")
+                        },
+                        getOuterHTML: function(e) {
+                            return (new XMLSerializer).serializeToString(e)
+                        },
+                        msie: F.document.documentMode
                     };
                     return m.dom.animator = e(m), m;
 
                         return e[0] || e
                     }
                 }
-                se.module("material.core").factory("$mdUtil", e), se.element.prototype.focus = se.element.prototype.focus || function() {
+                ue.module("material.core").factory("$mdUtil", e), ue.element.prototype.focus = ue.element.prototype.focus || function() {
                     return this.length && this[0].focus(), this
-                }, se.element.prototype.blur = se.element.prototype.blur || function() {
+                }, ue.element.prototype.blur = ue.element.prototype.blur || function() {
                     return this.length && this[0].blur(), this
                 }
+            }(), ue.module("material.core").factory("$$mdAnimate", ["$q", "$timeout", "$mdConstant", "$animateCss", function(n, i, a, s) {
+                return function(e) {
+                    return r = e, t = n, l = i, c = a, o = s, u = {
+                        translate3d: function(t, n, e, r) {
+                            return o(t, {
+                                from: n,
+                                to: e,
+                                addClass: r.transitionInClass,
+                                removeClass: r.transitionOutClass,
+                                duration: r.duration
+                            }).start().then(function() {
+                                return i
+                            });
+
+                            function i(e) {
+                                return o(t, {
+                                    to: e || n,
+                                    addClass: r.transitionOutClass,
+                                    removeClass: r.transitionInClass,
+                                    duration: r.duration
+                                }).start()
+                            }
+                        },
+                        waitTransitionEnd: function(o, a) {
+                            var s = 3e3;
+                            return t(function(t, e) {
+                                var n;
+                                ("0s" == (n = (n = (a = a || {}).cachedTransitionStyles) || F.getComputedStyle(o[0])).transitionDuration || !n.transition && !n.transitionProperty) && (s = 0);
+                                var r = l(i, a.timeout || s);
+
+                                function i(e) {
+                                    e && e.target !== o[0] || (e && l.cancel(r), o.off(c.CSS.TRANSITIONEND, i), t())
+                                }
+                                o.on(c.CSS.TRANSITIONEND, i)
+                            })
+                        },
+                        calculateTransformValues: function(e, t) {
+                            var n, r, i = t.element,
+                                o = t.bounds;
+                            if (i || o) {
+                                var a = i ? u.clientRect(i) || (n = e ? e.parent() : null, (r = n ? n.parent() : null) ? u.clientRect(r) : null) : u.copyRect(o),
+                                    s = u.copyRect(e[0].getBoundingClientRect()),
+                                    l = u.centerPointFor(s),
+                                    c = u.centerPointFor(a);
+                                return {
+                                    centerX: c.x - l.x,
+                                    centerY: c.y - l.y,
+                                    scaleX: Math.round(100 * Math.min(.5, a.width / s.width)) / 100,
+                                    scaleY: Math.round(100 * Math.min(.5, a.height / s.height)) / 100
+                                }
+                            }
+                            return {
+                                centerX: 0,
+                                centerY: 0,
+                                scaleX: .5,
+                                scaleY: .5
+                            }
+                        },
+                        calculateZoomToOrigin: function(e, t) {
+                            var n = ue.bind(null, r.supplant, "translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )");
+                            return n(u.calculateTransformValues(e, t))
+                        },
+                        calculateSlideToOrigin: function(e, t) {
+                            var n = ue.bind(null, r.supplant, "translate3d( {centerX}px, {centerY}px, 0 )");
+                            return n(u.calculateTransformValues(e, t))
+                        },
+                        toCss: function(e) {
+                            var r = {};
+                            return ue.forEach(e, function(e, t) {
+                                if (!ue.isUndefined(e))
+                                    if (0 <= "left top right bottom width height x y min-width min-height max-width max-height".indexOf(t)) r[t] = e + "px";
+                                    else switch (t) {
+                                        case "transition":
+                                            n(t, c.CSS.TRANSITION, e);
+                                            break;
+                                        case "transform":
+                                            n(t, c.CSS.TRANSFORM, e);
+                                            break;
+                                        case "transformOrigin":
+                                            n(t, c.CSS.TRANSFORM_ORIGIN, e);
+                                            break;
+                                        case "font-size":
+                                            r["font-size"] = e
+                                    }
+                            }), r;
+
+                            function n(e, t, n) {
+                                ue.forEach(t.split(" "), function(e) {
+                                    r[e] = n
+                                })
+                            }
+                        },
+                        toTransformCss: function(t, e, n) {
+                            var r = {};
+                            return ue.forEach(c.CSS.TRANSFORM.split(" "), function(e) {
+                                r[e] = t
+                            }), e && (n = n || "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important", r.transition = n), r
+                        },
+                        copyRect: function(t, n) {
+                            return t ? (n = n || {}, ue.forEach("left top right bottom width height".split(" "), function(e) {
+                                n[e] = Math.round(t[e])
+                            }), n.width = n.width || n.right - n.left, n.height = n.height || n.bottom - n.top, n) : null
+                        },
+                        clientRect: function(e) {
+                            var t, n = ue.element(e)[0].getBoundingClientRect();
+                            return (t = n) && 0 < t.width && 0 < t.height ? u.copyRect(n) : null
+                        },
+                        centerPointFor: function(e) {
+                            return e ? {
+                                x: Math.round(e.left + e.width / 2),
+                                y: Math.round(e.top + e.height / 2)
+                            } : {
+                                x: 0,
+                                y: 0
+                            }
+                        }
+                    };
+                    var r, t, l, c, o, u
+                }
+            }]), 4 <= ue.version.minor ? ue.module("material.core.animate", []) : function() {
+                var k = ue.forEach,
+                    x = ue.isDefined(document.documentElement.style.WebkitAppearance),
+                    T = x ? "-webkit-" : "",
+                    M = (x ? "webkitTransitionEnd " : "") + "transitionend",
+                    A = (x ? "webkitAnimationEnd " : "") + "animationend",
+                    e = ["$q", "$$rAFMutex", function(t, n) {
+                        function e(e) {
+                            this.setHost(e), this._doneCallbacks = [], this._runInAnimationFrame = n(), this._state = 0
+                        }
+                        return e.prototype = {
+                            setHost: function(e) {
+                                this.host = e || {}
+                            },
+                            done: function(e) {
+                                2 === this._state ? e() : this._doneCallbacks.push(e)
+                            },
+                            progress: ue.noop,
+                            getPromise: function() {
+                                if (!this.promise) {
+                                    var e = this;
+                                    this.promise = t(function(t, n) {
+                                        e.done(function(e) {
+                                            !1 === e ? n() : t()
+                                        })
+                                    })
+                                }
+                                return this.promise
+                            },
+                            then: function(e, t) {
+                                return this.getPromise().then(e, t)
+                            },
+                            catch: function(e) {
+                                return this.getPromise().catch(e)
+                            },
+                            finally: function(e) {
+                                return this.getPromise().finally(e)
+                            },
+                            pause: function() {
+                                this.host.pause && this.host.pause()
+                            },
+                            resume: function() {
+                                this.host.resume && this.host.resume()
+                            },
+                            end: function() {
+                                this.host.end && this.host.end(), this._resolve(!0)
+                            },
+                            cancel: function() {
+                                this.host.cancel && this.host.cancel(), this._resolve(!1)
+                            },
+                            complete: function(e) {
+                                var t = this;
+                                0 === t._state && (t._state = 1, t._runInAnimationFrame(function() {
+                                    t._resolve(e)
+                                }))
+                            },
+                            _resolve: function(t) {
+                                2 !== this._state && (k(this._doneCallbacks, function(e) {
+                                    e(t)
+                                }), this._doneCallbacks.length = 0, this._state = 2)
+                            }
+                        }, e.all = function(t, n) {
+                            var r = 0,
+                                i = !0;
+
+                            function o(e) {
+                                i = i && e, ++r === t.length && n(i)
+                            }
+                            k(t, function(e) {
+                                e.done(o)
+                            })
+                        }, e
+                    }];
+
+                function S(e) {
+                    return e.replace(/-[a-z]/g, function(e) {
+                        return e.charAt(1).toUpperCase()
+                    })
+                }
+                ue.module("material.core.animate", []).factory("$$forceReflow", ["$document", function(e) {
+                    return function() {
+                        return e[0].body.clientWidth + 1
+                    }
+                }]).factory("$$AnimateRunner", e).factory("$$rAFMutex", ["$$rAF", function(n) {
+                    return function() {
+                        var t = !1;
+                        return n(function() {
+                                t = !0
+                            }),
+                            function(e) {
+                                t ? e() : n(e)
+                            }
+                    }
+                }]).factory("$animateCss", ["$window", "$$rAF", "$$AnimateRunner", "$$forceReflow", "$$jqLite", "$timeout", "$animate", function(p, o, a, m, n, g, s) {
+                    function v(e, t) {
+                        t.addClass && (n.addClass(e, t.addClass), t.addClass = null), t.removeClass && (n.removeClass(e, t.removeClass), t.removeClass = null)
+                    }
+
+                    function b(e) {
+                        var t = 0,
+                            n = (e || "").split(/\s*,\s*/);
+                        return k(n, function(e) {
+                            "s" == e.charAt(e.length - 1) && (e = e.substring(0, e.length - 1)), e = parseFloat(e) || 0, t = t ? Math.max(e, t) : e
+                        }), t
+                    }
+                    var y, _ = [];
+
+                    function $(e, t) {
+                        t.from && (e.css(t.from), t.from = null)
+                    }
+
+                    function w(e, t) {
+                        t.to && (e.css(t.to), t.to = null)
+                    }
+
+                    function E(e) {
+                        for (var t = 0; t < e.length; t++)
+                            if (1 === e[t].nodeType) return e[t]
+                    }
+
+                    function C(e, t) {
+                        var n = E(e),
+                            r = S(T + "transition-delay");
+                        n.style[r] = t ? "-9999s" : ""
+                    }
+                    return function(r, l) {
+                        var c = [],
+                            u = E(r),
+                            e = u && s.enabled(),
+                            t = !1,
+                            n = !1;
+                        e && (l.transitionStyle && c.push([T + "transition", l.transitionStyle]), l.keyframeStyle && c.push([T + "animation", l.keyframeStyle]), l.delay && c.push([T + "transition-delay", l.delay + "s"]), l.duration && c.push([T + "transition-duration", l.duration + "s"]), t = l.keyframeStyle || l.to && (0 < l.duration || l.transitionStyle), n = !!l.addClass || !!l.removeClass, C(r, !0));
+                        var d = e && (t || n);
+                        $(r, l);
+                        var f, h, i = !1;
+                        return {
+                            close: p.close,
+                            start: function() {
+                                var e, n = new a;
+                                return e = function() {
+                                    if (C(r, !1), !d) return s();
+                                    k(c, function(e) {
+                                        var t = e[0],
+                                            n = e[1];
+                                        u.style[S(t)] = n
+                                    }), v(r, l);
+                                    var e = function(e) {
+                                        var t = E(e),
+                                            n = p.getComputedStyle(t),
+                                            r = b(n[c("transitionDuration")]),
+                                            i = b(n[c("animationDuration")]),
+                                            o = b(n[c("transitionDelay")]),
+                                            a = b(n[c("animationDelay")]);
+                                        i *= parseInt(n[c("animationIterationCount")], 10) || 1;
+                                        var s = Math.max(i, r),
+                                            l = Math.max(a, o);
+                                        return {
+                                            duration: s,
+                                            delay: l,
+                                            animationDuration: i,
+                                            transitionDuration: r,
+                                            animationDelay: a,
+                                            transitionDelay: o
+                                        };
+
+                                        function c(e) {
+                                            return x ? "Webkit" + e.charAt(0).toUpperCase() + e.substr(1) : e
+                                        }
+                                    }(r);
+                                    if (0 === e.duration) return s();
+                                    var t = [];
+                                    l.easing && (e.transitionDuration && t.push([T + "transition-timing-function", l.easing]), e.animationDuration && t.push([T + "animation-timing-function", l.easing])), l.delay && e.animationDelay && t.push([T + "animation-delay", l.delay + "s"]), l.duration && e.animationDuration && t.push([T + "animation-duration", l.duration + "s"]), k(t, function(e) {
+                                        var t = e[0],
+                                            n = e[1];
+                                        u.style[S(t)] = n, c.push(e)
+                                    });
+                                    var i = 1e3 * e.delay,
+                                        o = e.duration,
+                                        n = 1e3 * o,
+                                        a = Date.now();
+                                    f = [], e.transitionDuration && f.push(M), e.animationDuration && f.push(A), f = f.join(" "), h = function(e) {
+                                        e.stopPropagation();
+                                        var t = e.originalEvent || e,
+                                            n = t.timeStamp || Date.now(),
+                                            r = parseFloat(t.elapsedTime.toFixed(3));
+                                        Math.max(n - a, 0) >= i && o <= r && s()
+                                    }, r.on(f, h), w(r, l), g(s, i + 1.5 * n, !1)
+                                }, y && y(), _.push(e), y = o(function() {
+                                    y = null;
+                                    for (var e = m(), t = 0; t < _.length; t++) _[t](e);
+                                    _.length = 0
+                                }), n;
+
+                                function s() {
+                                    var e, t;
+                                    if (!i) return i = !0, f && h && r.off(f, h), v(r, l), $(e = r, t = l), w(e, t), k(c, function(e) {
+                                        u.style[S(e[0])] = ""
+                                    }), n.complete(!0), n
+                                }
+                            }
+                        }
+                    }
+                }])
             }(),
             function() {
                 function o(r, i, l, o) {
                         hasAriaLabel: d,
                         parentHasAriaLabel: function e(t, n) {
                             n = n || 1;
-                            var r = se.element(t)[0] || t;
+                            var r = ue.element(t)[0] || t;
                             if (!r.parentNode) return !1;
                             if (i(r.parentNode)) return !0;
                             n--;
                     };
 
                     function s(e, t, n) {
-                        var r = se.element(e)[0] || e;
+                        var r = ue.element(e)[0] || e;
                         !r || r.hasAttribute(t) && 0 !== r.getAttribute(t).length || function(e, t) {
                             var n = e.hasChildNodes(),
                                 r = !1;
                                 }
                             var s;
                             return r
-                        }(r, t) || ((n = se.isString(n) ? n.trim() : "").length ? e.attr(t, n) : a && i.warn('ARIA: Attribute "', t, '", required for accessibility, is missing on node:', r))
+                        }(r, t) || ((n = ue.isString(n) ? n.trim() : "").length ? e.attr(t, n) : a && i.warn('ARIA: Attribute "', t, '", required for accessibility, is missing on node:', r))
                     }
 
                     function c(e, t, n) {
                     }
 
                     function d(e) {
-                        var t = se.element(e)[0] || e;
+                        var t = ue.element(e)[0] || e;
                         return !!t.hasAttribute && (t.hasAttribute("aria-label") || t.hasAttribute("aria-labelledby") || t.hasAttribute("aria-describedby"))
                     }
                 }
-                o.$inject = ["$$rAF", "$log", "$window", "$interpolate"], se.module("material.core").provider("$mdAria", function() {
+                o.$inject = ["$$rAF", "$log", "$window", "$interpolate"], ue.module("material.core").provider("$mdAria", function() {
                     var i = {
                         showWarnings: !0
                     };
                         this.$q = e, this.$templateRequest = t, this.$injector = n, this.$compile = r, this.$controller = i
                     }
                     this.respectPreAssignBindingsEnabled = function(e) {
-                        return se.isDefined(e) ? (a = e, this) : a
+                        return ue.isDefined(e) ? (a = e, this) : a
                     }, this.$get = ["$q", "$templateRequest", "$injector", "$compile", "$controller", function(e, t, n, r, i) {
                         return new s(e, t, n, r, i)
                     }], s.prototype.compile = function(e) {
                         var i = this,
                             e = r.templateUrl,
                             t = r.template || "",
-                            n = se.extend({}, r.resolve),
-                            o = se.extend({}, r.locals),
-                            a = r.transformTemplate || se.identity;
-                        return se.forEach(n, function(e, t) {
-                            se.isString(e) ? n[t] = i.$injector.get(e) : n[t] = i.$injector.invoke(e)
-                        }), se.extend(n, o), n.$$ngTemplate = e ? this.$templateRequest(e) : this.$q.when(t), this.$q.all(n).then(function(e) {
+                            n = ue.extend({}, r.resolve),
+                            o = ue.extend({}, r.locals),
+                            a = r.transformTemplate || ue.identity;
+                        return ue.forEach(n, function(e, t) {
+                            ue.isString(e) ? n[t] = i.$injector.get(e) : n[t] = i.$injector.invoke(e)
+                        }), ue.extend(n, o), n.$$ngTemplate = e ? this.$templateRequest(e) : this.$q.when(t), this.$q.all(n).then(function(e) {
                             var t = a(e.$$ngTemplate, r),
-                                n = r.element || se.element("<div>").html(t.trim()).contents();
+                                n = r.element || ue.element("<div>").html(t.trim()).contents();
                             return i._compileElement(e, n, r)
                         })
                     }, s.prototype._compileElement = function(r, i, o) {
                                 locals: r,
                                 link: function(e) {
                                     if (r.$scope = e, o.controller) {
-                                        var t = se.extend({}, r, {
+                                        var t = ue.extend({}, r, {
                                                 $element: i
                                             }),
                                             n = a._createController(o, t, r);
                         return l
                     }, s.prototype._createController = function(e, t, n) {
                         var r;
-                        if (!a || ("function" == typeof o.preAssignBindingsEnabled ? o.preAssignBindingsEnabled() : 1 === se.version.major && se.version.minor < 6)) {
+                        if (!a || ("function" == typeof o.preAssignBindingsEnabled ? o.preAssignBindingsEnabled() : 1 === ue.version.major && ue.version.minor < 6)) {
                             var i = this.$controller(e.controller, t, !0);
-                            e.bindToController && se.extend(i.instance, n), r = i()
-                        } else r = this.$controller(e.controller, t), e.bindToController && se.extend(r, n);
-                        return e.controllerAs && (t.$scope[e.controllerAs] = r), se.isFunction(r.$onInit) && r.$onInit(), r
+                            e.bindToController && ue.extend(i.instance, n), r = i()
+                        } else r = this.$controller(e.controller, t), e.bindToController && ue.extend(r, n);
+                        return e.controllerAs && (t.$scope[e.controllerAs] = r), ue.isFunction(r.$onInit) && r.$onInit(), r
                     }, s.prototype._fetchContentElement = function(e) {
                         var t = e.contentElement,
                             n = null;
-                        return n = se.isString(t) ? r(t = document.querySelector(t)) : (t = t[0] || t, document.contains(t) ? r(t) : function() {
+                        return n = ue.isString(t) ? r(t = document.querySelector(t)) : (t = t[0] || t, document.contains(t) ? r(t) : function() {
                             t.parentNode && t.parentNode.removeChild(t)
                         }), {
-                            element: se.element(t),
+                            element: ue.element(t),
                             restore: n
                         };
 
                         }
                     }
                 }
-                se.module("material.core").provider("$mdCompiler", e), e.$inject = ["$compileProvider"]
+                ue.module("material.core").provider("$mdCompiler", e), e.$inject = ["$compileProvider"]
             }(),
             function() {
                 i.$inject = ["$$MdGestureHandler", "$$rAF", "$timeout"];
-                var o, r, u = {},
-                    d = 6,
-                    f = !(n.$inject = ["$mdGesture", "$$MdGestureHandler"]),
+                var o, r, s = {},
+                    l = 6,
+                    c = !(p.$inject = ["$mdGesture", "$$MdGestureHandler"]),
                     a = !1,
-                    s = null,
-                    l = !1;
+                    u = null,
+                    d = !1,
+                    e = navigator.userAgent || navigator.vendor || F.opera,
+                    f = e.match(/ipad|iphone|ipod/i),
+                    h = e.match(/android/i);
 
-                function e() {}
+                function t() {}
 
                 function i(r, e, n) {
-                    var t = navigator.userAgent || navigator.vendor || F.opera,
-                        i = t.match(/ipad|iphone|ipod/i),
-                        o = t.match(/android/i),
-                        a = function() {
+                    var i = function() {
                             for (var e = document.createElement("div"), t = ["", "webkit", "Moz", "MS", "ms", "o"], n = 0; n < t.length; n++) {
                                 var r = t[n],
                                     i = r ? r + "TouchAction" : "touchAction";
-                                if (se.isDefined(e.style[i])) return i
+                                if (ue.isDefined(e.style[i])) return i
                             }
                         }(),
-                        s = void 0 !== F.jQuery && se.element === F.jQuery,
-                        l = {
+                        t = void 0 !== F.jQuery && ue.element === F.jQuery,
+                        o = {
                             handler: function(e, t) {
                                 var n = new r(e);
-                                return se.extend(n, t), u[e] = n, l
+                                return ue.extend(n, t), s[e] = n, o
                             },
                             register: function(e, t, n) {
-                                var r = u[t.replace(/^\$md./, "")];
+                                var r = s[t.replace(/^\$md./, "")];
                                 if (r) return r.registerElement(e, n);
-                                throw new Error("Failed to register element with handler " + t + ". Available handlers: " + Object.keys(u).join(", "))
+                                throw new Error("Failed to register element with handler " + t + ". Available handlers: " + Object.keys(s).join(", "))
                             },
-                            isAndroid: o,
-                            isIos: i,
-                            isHijackingClicks: (i || o) && !s && !f
+                            isAndroid: h,
+                            isIos: f,
+                            isHijackingClicks: (f || h) && !t && !c
                         };
 
-                    function c(n) {
+                    function a(n) {
                         return function(e, t) {
                             t.distance < this.state.options.maxDistance && this.dispatchEvent(e, n, t)
                         }
                     }
-                    return l.isHijackingClicks && (l.handler("click", {
+                    return o.isHijackingClicks && (o.handler("click", {
                         options: {
-                            maxDistance: d
+                            maxDistance: l
                         },
-                        onEnd: c("click")
-                    }), l.handler("focus", {
+                        onEnd: a("click")
+                    }), o.handler("focus", {
                         options: {
-                            maxDistance: d
+                            maxDistance: l
                         },
                         onEnd: function(e, t) {
-                            t.distance < this.state.options.maxDistance && v(e.target) && (this.dispatchEvent(e, "focus", t), e.target.focus())
+                            t.distance < this.state.options.maxDistance && _(e.target) && (this.dispatchEvent(e, "focus", t), e.target.focus())
                         }
-                    }), l.handler("mouseup", {
+                    }), o.handler("mouseup", {
                         options: {
-                            maxDistance: d
+                            maxDistance: l
                         },
-                        onEnd: c("mouseup")
-                    }), l.handler("mousedown", {
+                        onEnd: a("mouseup")
+                    }), o.handler("mousedown", {
                         onStart: function(e) {
                             this.dispatchEvent(e, "mousedown")
                         }
-                    })), l.handler("press", {
+                    })), o.handler("press", {
                         onStart: function(e, t) {
                             this.dispatchEvent(e, "$md.pressdown")
                         },
                             this.state.pos = {
                                 x: t.x,
                                 y: t.y
-                            }, this.state.timeout = n(se.bind(this, function() {
+                            }, this.state.timeout = n(ue.bind(this, function() {
                                 this.dispatchEvent(e, "$md.hold"), this.cancel()
                             }), this.state.options.delay, !1)
                         },
                         onMove: function(e, t) {
-                            a || "touchmove" !== e.type || e.preventDefault();
+                            i || "touchmove" !== e.type || e.preventDefault();
                             var n = this.state.pos.x - t.x,
                                 r = this.state.pos.y - t.y;
                             Math.sqrt(n * n + r * r) > this.options.maxDistance && this.cancel()
                             cancelMultiplier: 1.5
                         },
                         onSetup: function(e, t) {
-                            a && (this.oldTouchAction = e[0].style[a], e[0].style[a] = t.horizontal ? "pan-y" : "pan-x")
+                            i && (this.oldTouchAction = e[0].style[i], e[0].style[i] = t.horizontal ? "pan-y" : "pan-x")
                         },
                         onCleanup: function(e) {
-                            this.oldTouchAction && (e[0].style[a] = this.oldTouchAction)
+                            this.oldTouchAction && (e[0].style[i] = this.oldTouchAction)
                         },
                         onStart: function(e) {
                             this.state.registeredParent || this.cancel()
                         },
                         onMove: function(e, t) {
                             var n, r;
-                            a || "touchmove" !== e.type || e.preventDefault(), this.state.dragPointer ? this.dispatchDragMove(e) : (r = this.state.options.horizontal ? (n = Math.abs(t.distanceX) > this.state.options.minDistance, Math.abs(t.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier) : (n = Math.abs(t.distanceY) > this.state.options.minDistance, Math.abs(t.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier), n ? (this.state.dragPointer = h(e), m(e, this.state.dragPointer), this.dispatchEvent(e, "$md.dragstart", this.state.dragPointer)) : r && this.cancel())
+                            i || "touchmove" !== e.type || e.preventDefault(), this.state.dragPointer ? this.dispatchDragMove(e) : (r = this.state.options.horizontal ? (n = Math.abs(t.distanceX) > this.state.options.minDistance, Math.abs(t.distanceY) > this.state.options.minDistance * this.state.options.cancelMultiplier) : (n = Math.abs(t.distanceY) > this.state.options.minDistance, Math.abs(t.distanceX) > this.state.options.minDistance * this.state.options.cancelMultiplier), n ? (this.state.dragPointer = m(e), b(e, this.state.dragPointer), this.dispatchEvent(e, "$md.dragstart", this.state.dragPointer)) : r && this.cancel())
                         },
                         dispatchDragMove: e.throttle(function(e) {
-                            this.state.isRunning && (m(e, this.state.dragPointer), this.dispatchEvent(e, "$md.drag", this.state.dragPointer))
+                            this.state.isRunning && (b(e, this.state.dragPointer), this.dispatchEvent(e, "$md.drag", this.state.dragPointer))
                         }),
                         onEnd: function(e, t) {
-                            this.state.dragPointer && (m(e, this.state.dragPointer), this.dispatchEvent(e, "$md.dragend", this.state.dragPointer))
+                            this.state.dragPointer && (b(e, this.state.dragPointer), this.dispatchEvent(e, "$md.dragend", this.state.dragPointer))
                         }
                     }).handler("swipe", {
                         options: {
                     })
                 }
 
-                function t(e) {
+                function n(e) {
                     this.name = e, this.state = {}
                 }
 
-                function n(e, i) {
+                function p(e, i) {
                     if (!a) {
                         document.contains || (document.contains = function(e) {
                             return document.body.contains(e)
-                        }), !l && e.isHijackingClicks && (document.addEventListener("click", function(e) {
-                            var t = 0 === e.clientX && 0 === e.clientY,
-                                n = e.target && "submit" === e.target.type;
-                            t || e.$material || e.isIonicTap || p(e) || n ? (s = null, "label" == e.target.tagName.toLowerCase() && (s = {
+                        }), !d && e.isHijackingClicks && (document.addEventListener("click", function(e) {
+                            var t;
+                            t = f ? ue.isDefined(e.webkitForce) && 0 === e.webkitForce : 0 === e.clientX && 0 === e.clientY;
+                            t || e.$material || e.isIonicTap || v(e) ? (u = null, "label" === e.target.tagName.toLowerCase() && (u = {
                                 x: e.x,
                                 y: e.y
-                            })) : (e.preventDefault(), e.stopPropagation(), s = null)
-                        }, !0), document.addEventListener("mouseup", t, !0), document.addEventListener("mousedown", t, !0), document.addEventListener("focus", t, !0), l = !0);
-                        se.element(document).on("mousedown touchstart pointerdown", function(e) {
+                            })) : (e.preventDefault(), e.stopPropagation(), u = null)
+                        }, !0), document.addEventListener("mouseup", t, !0), document.addEventListener("mousedown", t, !0), document.addEventListener("focus", t, !0), d = !0);
+                        ue.element(document).on("mousedown touchstart pointerdown", function(e) {
                             if (o) return;
                             var t = +Date.now();
-                            if (r && !c(e, r) && t - r.endTime < 1500) return;
-                            o = h(e), n("start", e)
+                            if (r && !g(e, r) && t - r.endTime < 1500) return;
+                            o = m(e), n("start", e)
                         }).on("mousemove touchmove pointermove", function(e) {
-                            if (!o || !c(e, o)) return;
-                            m(e, o), n("move", e)
+                            if (!o || !g(e, o)) return;
+                            b(e, o), n("move", e)
                         }).on("mouseup mouseleave touchend touchcancel pointerup pointercancel", function(e) {
-                            if (!o || !c(e, o)) return;
-                            m(e, o), o.endTime = +Date.now(), "pointercancel" !== e.type && n("end", e);
+                            if (!o || !g(e, o)) return;
+                            b(e, o), o.endTime = +Date.now(), "pointercancel" !== e.type && n("end", e);
                             r = o, o = null
                         }).on("$$mdGestureReset", function() {
                             r = o = null
                     }
 
                     function t(e) {
-                        !e.clientX && !e.clientY || e.$material || e.isIonicTap || p(e) || "mousedown" === e.type && (v(e.target) || v(document.activeElement)) || (e.preventDefault(), e.stopPropagation())
+                        !e.clientX && !e.clientY || e.$material || e.isIonicTap || v(e) || "mousedown" === e.type && (_(e.target) || _(document.activeElement)) || (e.preventDefault(), e.stopPropagation())
                     }
 
                     function n(e, t) {
                         var n;
-                        for (var r in u)(n = u[r]) instanceof i && ("start" === e && n.cancel(), n[e](t, o))
+                        for (var r in s)(n = s[r]) instanceof i && ("start" === e && n.cancel(), n[e](t, o))
                     }
                 }
 
-                function h(e) {
-                    var t = g(e),
+                function m(e) {
+                    var t = y(e),
                         n = {
                             startTime: +Date.now(),
                             target: e.target,
                     return n.startX = n.x = t.pageX, n.startY = n.y = t.pageY, n
                 }
 
-                function c(e, t) {
+                function g(e, t) {
                     return e && t && e.type.charAt(0) === t.type
                 }
 
-                function p(e) {
-                    return s && s.x == e.x && s.y == e.y
+                function v(e) {
+                    return u && u.x === e.x && u.y === e.y
                 }
 
-                function m(e, t) {
-                    var n = g(e),
+                function b(e, t) {
+                    var n = y(e),
                         r = t.x = n.pageX,
                         i = t.y = n.pageY;
                     t.distanceX = r - t.startX, t.distanceY = i - t.startY, t.distance = Math.sqrt(t.distanceX * t.distanceX + t.distanceY * t.distanceY), t.directionX = 0 < t.distanceX ? "right" : t.distanceX < 0 ? "left" : "", t.directionY = 0 < t.distanceY ? "down" : t.distanceY < 0 ? "up" : "", t.duration = +Date.now() - t.startTime, t.velocityX = t.distanceX / t.duration, t.velocityY = t.distanceY / t.duration
                 }
 
-                function g(e) {
+                function y(e) {
                     return (e = e.originalEvent || e).touches && e.touches[0] || e.changedTouches && e.changedTouches[0] || e
                 }
 
-                function v(e) {
+                function _(e) {
                     return !!e && "-1" !== e.getAttribute("tabindex") && !e.hasAttribute("disabled") && (e.hasAttribute("tabindex") || e.hasAttribute("href") || e.isContentEditable || -1 !== ["INPUT", "SELECT", "BUTTON", "TEXTAREA", "VIDEO", "AUDIO"].indexOf(e.nodeName))
                 }
-                se.module("material.core.gestures", []).provider("$mdGesture", e).factory("$$MdGestureHandler", function() {
-                    var e = void 0 !== F.jQuery && se.element === F.jQuery;
-                    return t.prototype = {
+                ue.module("material.core.gestures", []).provider("$mdGesture", t).factory("$$MdGestureHandler", function() {
+                    var e = void 0 !== F.jQuery && ue.element === F.jQuery;
+                    return n.prototype = {
                         options: {},
                         dispatchEvent: e ? function(e, t, n) {
                             n = n || o;
-                            var r = new se.element.Event(t);
-                            r.$material = !0, r.pointer = n, r.srcEvent = e, se.extend(r, {
+                            var r = new ue.element.Event(t);
+                            r.$material = !0, r.pointer = n, r.srcEvent = e, ue.extend(r, {
                                 clientX: n.x,
                                 clientY: n.y,
                                 screenX: n.x,
                                 altKey: e.altKey,
                                 shiftKey: e.shiftKey,
                                 metaKey: e.metaKey
-                            }), se.element(n.target).trigger(r)
+                            }), ue.element(n.target).trigger(r)
                         } : function(e, t, n) {
                             var r;
-                            n = n || o, "click" === t || "mouseup" === t || "mousedown" === t ? (r = document.createEvent("MouseEvents")).initMouseEvent(t, !0, !0, F, e.detail, n.x, n.y, n.x, n.y, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget || null) : (r = document.createEvent("CustomEvent")).initCustomEvent(t, !0, !0, {}), r.$material = !0, r.pointer = n, r.srcEvent = e, n.target.dispatchEvent(r)
+                            n = n || o, "click" === t || "mouseup" === t || "mousedown" === t ? "function" == typeof F.MouseEvent ? r = new MouseEvent(t, {
+                                bubbles: !0,
+                                cancelable: !0,
+                                screenX: Number(e.screenX),
+                                screenY: Number(e.screenY),
+                                clientX: Number(n.x),
+                                clientY: Number(n.y),
+                                ctrlKey: e.ctrlKey,
+                                altKey: e.altKey,
+                                shiftKey: e.shiftKey,
+                                metaKey: e.metaKey,
+                                button: e.button,
+                                buttons: e.buttons,
+                                relatedTarget: e.relatedTarget || null
+                            }) : (r = document.createEvent("MouseEvents")).initMouseEvent(t, !0, !0, F, e.detail, n.x, n.y, n.x, n.y, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget || null) : "function" == typeof F.CustomEvent ? r = new CustomEvent(t, {
+                                bubbles: !0,
+                                cancelable: !0,
+                                detail: {}
+                            }) : (r = document.createEvent("CustomEvent")).initCustomEvent(t, !0, !0, {}), r.$material = !0, r.pointer = n, r.srcEvent = e, n.target.dispatchEvent(r)
                         },
-                        onSetup: se.noop,
-                        onCleanup: se.noop,
-                        onStart: se.noop,
-                        onMove: se.noop,
-                        onEnd: se.noop,
-                        onCancel: se.noop,
+                        onSetup: ue.noop,
+                        onCleanup: ue.noop,
+                        onStart: ue.noop,
+                        onMove: ue.noop,
+                        onEnd: ue.noop,
+                        onCancel: ue.noop,
                         start: function(e, t) {
                             if (!this.state.isRunning) {
                                 var n = this.getNearestParent(e.target),
                                     r = n && n.$mdGesture[this.name] || {};
                                 this.state = {
                                     isRunning: !0,
-                                    options: se.extend({}, this.options, r),
+                                    options: ue.extend({}, this.options, r),
                                     registeredParent: n
                                 }, this.onStart(e, t)
                             }
                                 delete e[0].$mdGesture[n.name], e.off("$destroy", r), n.onCleanup(e, t || {})
                             }
                         }
-                    }, t
-                }).run(n), e.prototype = {
+                    }, n
+                }).run(p), t.prototype = {
                     disableAll: function() {
                         a = !0
                     },
                     skipClickHijack: function() {
-                        return f = !0
+                        return c = !0
                     },
                     setMaxClickDistance: function(e) {
-                        d = parseInt(e)
+                        l = parseInt(e)
                     },
                     $get: ["$$MdGestureHandler", "$$rAF", "$timeout", function(e, t, n) {
                         return new i(e, t, n)
                 }
             }(),
             function() {
-                function e(e, t) {
-                    this.$timeout = e, this.$mdUtil = t, this.bodyElement = se.element(document.body), this.isBuffering = !1, this.bufferTimeout = null, this.lastInteractionType = null, this.lastInteractionTime = null, this.inputEventMap = {
+                function e(e, t, n) {
+                    this.$timeout = e, this.$mdUtil = t, this.$rootScope = n, this.pointerEvent = "MSPointerEvent" in F ? "MSPointerDown" : "PointerEvent" in F ? "pointerdown" : null, this.bodyElement = ue.element(document.body), this.isBuffering = !1, this.bufferTimeout = null, this.lastInteractionType = null, this.lastInteractionTime = null, this.inputHandler = this.onInputEvent.bind(this), this.bufferedInputHandler = this.onBufferInputEvent.bind(this), this.inputEventMap = {
                         keydown: "keyboard",
                         mousedown: "mouse",
                         mouseenter: "mouse",
                         2: "touch",
                         3: "touch",
                         4: "mouse"
-                    }, this.initializeEvents()
+                    }, this.initializeEvents(), this.$rootScope.$on("$destroy", this.deregister.bind(this))
                 }
-                e.$inject = ["$timeout", "$mdUtil"], se.module("material.core.interaction", []).service("$mdInteraction", e), e.prototype.initializeEvents = function() {
-                    var e = "MSPointerEvent" in F ? "MSPointerDown" : "PointerEvent" in F ? "pointerdown" : null;
-                    this.bodyElement.on("keydown mousedown", this.onInputEvent.bind(this)), "ontouchstart" in document.documentElement && this.bodyElement.on("touchstart", this.onBufferInputEvent.bind(this)), e && this.bodyElement.on(e, this.onInputEvent.bind(this))
+                e.$inject = ["$timeout", "$mdUtil", "$rootScope"], ue.module("material.core.interaction", []).service("$mdInteraction", e), e.prototype.deregister = function() {
+                    this.bodyElement.off("keydown mousedown", this.inputHandler), "ontouchstart" in document.documentElement && this.bodyElement.off("touchstart", this.bufferedInputHandler), this.pointerEvent && this.bodyElement.off(this.pointerEvent, this.inputHandler)
+                }, e.prototype.initializeEvents = function() {
+                    this.bodyElement.on("keydown mousedown", this.inputHandler), "ontouchstart" in document.documentElement && this.bodyElement.on("touchstart", this.bufferedInputHandler), this.pointerEvent && this.bodyElement.on(this.pointerEvent, this.inputHandler)
                 }, e.prototype.onInputEvent = function(e) {
                     if (!this.isBuffering) {
                         var t = this.inputEventMap[e.type];
                 }, e.prototype.getLastInteractionType = function() {
                     return this.lastInteractionType
                 }, e.prototype.isUserInvoked = function(e) {
-                    var t = se.isNumber(e) ? e : 15;
+                    var t = ue.isNumber(e) ? e : 15;
                     return this.lastInteractionTime >= this.$mdUtil.now() - t
                 }
-            }(), se.module("material.core").provider("$$interimElement", function() {
+            }(), ue.module("material.core").provider("$$interimElement", function() {
                 return t.$inject = ["$document", "$q", "$rootScope", "$timeout", "$rootElement", "$animate", "$mdUtil", "$mdCompiler", "$mdTheming", "$injector", "$exceptionHandler"], e.$get = t, e;
 
                 function e(i) {
                                 hide: n.hide,
                                 cancel: n.cancel,
                                 show: function(e) {
-                                    return (e = e || {})._options && (e = e._options), n.show(se.extend({}, t, e))
+                                    return (e = e || {})._options && (e = e._options), n.show(ue.extend({}, t, e))
                                 },
                                 destroy: function(e) {
                                     return n.destroy(e)
                                 }
                             };
-                        return a = c.methods || [], t = l(c.optionsFactory, {}), se.forEach(o, function(e, t) {
+                        return a = c.methods || [], t = l(c.optionsFactory, {}), ue.forEach(o, function(e, t) {
                             s[t] = e
-                        }), se.forEach(c.presets, function(t, n) {
+                        }), ue.forEach(c.presets, function(t, n) {
                             var r = l(t.optionsFactory, {}),
                                 e = (t.methods || []).concat(a);
 
                             function i(e) {
-                                this._options = se.extend({}, r, e)
+                                this._options = ue.extend({}, r, e)
                             }
-                            if (se.extend(r, {
+                            if (ue.extend(r, {
                                     $type: n
-                                }), se.forEach(e, function(t) {
+                                }), ue.forEach(e, function(t) {
                                     i.prototype[t] = function(e) {
                                         return this._options[t] = e, this
                                     }
                                 }
                             }
                             s[n] = function(e) {
-                                return arguments.length && t.argOption && !se.isObject(e) && !se.isArray(e) ? (new i)[t.argOption](e) : new i(e)
+                                return arguments.length && t.argOption && !ue.isObject(e) && !ue.isArray(e) ? (new i)[t.argOption](e) : new i(e)
                             }
                         }), s;
 
                                     return f.all(e)
                                 }));
                                 var r = n.then(function() {
-                                    return t.show().catch(function(e) {
+                                    return t.show().then(function() {
+                                        a.push(t)
+                                    }).catch(function(e) {
                                         return e
                                     }).finally(function() {
-                                        i.splice(i.indexOf(r), 1), a.push(t)
+                                        i.splice(i.indexOf(r), 1)
                                     })
                                 });
                                 return i.push(r), t.deferred.promise.catch(function(e) {
                                 }), t.deferred.promise
                             },
                             hide: e(function(n, r) {
-                                return (r = r || {}).closeAll ? f.all(a.slice().reverse().map(e)) : r.closeTo !== le ? f.all(a.slice(r.closeTo).map(e)) : e(a[a.length - 1]);
+                                return (r = r || {}).closeAll ? f.all(a.slice().reverse().map(e)) : r.closeTo !== de ? f.all(a.slice(r.closeTo).map(e)) : e(a[a.length - 1]);
 
                                 function e(e) {
+                                    if (!e) return f.when(n);
                                     var t = e.remove(n, !1, r || {}).catch(function(e) {
                                         return e
                                     }).finally(function() {
                                 }).finally(function() {
                                     o.splice(o.indexOf(r), 1)
                                 });
-                                return o.push(r), n.deferred.promise.catch(se.noop)
+                                return o.push(r), n.deferred.promise.catch(ue.noop)
                             }),
                             destroy: function(e) {
                                 var t = e ? null : a.shift(),
-                                    n = se.element(e).length && se.element(e)[0].parentNode;
+                                    n = ue.element(e).length && ue.element(e)[0].parentNode;
                                 if (n) {
                                     var r = a.filter(function(e) {
                                         return e.options.element[0] === n
 
                         function s(a) {
                             var o, s, e, l = f.when(!0);
-                            return (e = (e = a) || {}).template && (e.template = n.processTemplate(e.template)), a = se.extend({
+                            return (e = (e = a) || {}).template && (e.template = n.processTemplate(e.template)), a = ue.extend({
                                 preserveScope: !1,
-                                cancelAutoHide: se.noop,
+                                cancelAutoHide: ue.noop,
                                 scope: e.scope || t.$new(e.isolateScope),
                                 onShow: function(e, t, n) {
                                     return r.enter(t, n.parent)
                                             })
                                         })).then(function(e) {
                                             s = function(e, t) {
-                                                se.extend(e.locals, t);
+                                                ue.extend(e.locals, t);
                                                 var n, r, i, o, a = e.link(t.scope);
-                                                return t.element = a, t.parent = (n = a, o = (r = t).parent, ((o = se.isFunction(o) ? o(r.scope, n, r) : se.isString(o) ? se.element(d[0].querySelector(o)) : se.element(o)) || {}).length ? o : (p[0] && p[0].querySelector && (i = p[0].querySelector(":not(svg) > body")), i || (i = p[0]), "#comment" == i.nodeName && (i = d[0].body), se.element(i))), t.themable && g(a), a
+                                                return t.element = a, t.parent = (n = a, o = (r = t).parent, ((o = ue.isFunction(o) ? o(r.scope, n, r) : ue.isString(o) ? ue.element(d[0].querySelector(o)) : ue.element(o)) || {}).length ? o : (p[0] && p[0].querySelector && (i = p[0].querySelector(":not(svg) > body")), i || (i = p[0]), "#comment" == i.nodeName && (i = d[0].body), ue.element(i))), t.themable && g(a), a
                                             }(e, a), a.cleanupElement = e.cleanup, l = function(r, i, e) {
-                                                var t = i.onShowing || se.noop,
-                                                    o = i.onComplete || se.noop;
+                                                var t = i.onShowing || ue.noop,
+                                                    o = i.onComplete || ue.noop;
                                                 try {
                                                     t(i.scope, r, i, e)
                                                 } catch (e) {
                                                     try {
                                                         f.when(i.onShow(i.scope, r, i, e)).then(function() {
                                                             var e, t;
-                                                            o(i.scope, r, i), t = se.noop, a.hideDelay && (e = h(u.hide, a.hideDelay), t = function() {
+                                                            o(i.scope, r, i), t = ue.noop, a.hideDelay && (e = h(u.hide, a.hideDelay), t = function() {
                                                                 h.cancel(e)
                                                             }), a.cancelAutoHide = function() {
-                                                                t(), a.cancelAutoHide = le
+                                                                t(), a.cancelAutoHide = de
                                                             }, n(r)
                                                         }, t)
                                                     } catch (e) {
                                     })
                                 },
                                 remove: function(e, t, n) {
-                                    return s ? ((a = se.extend(a || {}, n || {})).cancelAutoHide && a.cancelAutoHide(), a.element.triggerHandler("$mdInterimElementRemove"), !0 === a.$destroy ? c(a.element, a).then(function() {
+                                    return s ? ((a = ue.extend(a || {}, n || {})).cancelAutoHide && a.cancelAutoHide(), a.element.triggerHandler("$mdInterimElementRemove"), !0 === a.$destroy ? c(a.element, a).then(function() {
                                         t && i(e) || r(e)
                                     }) : (f.when(l).finally(function() {
                                         c(a.element, a).then(function() {
                             };
 
                             function c(r, i) {
-                                var o = i.onRemoving || se.noop;
+                                var o = i.onRemoving || ue.noop;
                                 return f(function(e, t) {
                                     try {
                                         var n = f.when(i.onRemove(i.scope, r, i) || !0);
                             restrict: "A",
                             compile: function(e, t) {
                                 var n;
-                                return g.enabled && (w(r, k(r, t, ""), E(0, r, t)), i(0, e), n = i), n || se.noop
+                                return g.enabled && (w(r, k(r, t, ""), E(0, r, t)), i(0, e), n = i), n || ue.noop
                             }
                         }
                     }];
                 function _(t) {
                     var n = t.split("-");
                     return ["$log", function(e) {
-                        return e.warn(t + "has been deprecated. Please use a `" + n[0] + "-gt-<xxx>` variant."), se.noop
+                        return e.warn(t + "has been deprecated. Please use a `" + n[0] + "-gt-<xxx>` variant."), ue.noop
                     }]
                 }
 
                             case "layout-nowrap":
                                 t = ""
                         }
-                        null != t && (n || se.noop)(t)
+                        null != t && (n || ue.noop)(t)
                     }
                     var i, o, a;
                     return t ? t.trim() : ""
                             return r ? n.toUpperCase() : n
                         })
                     }
-                    se.forEach(["", "xs", "gt-xs", "sm", "gt-sm", "md", "gt-md", "lg", "gt-lg", "xl", "print"], function(n) {
-                        se.forEach(e, function(e) {
+                    ue.forEach(["", "xs", "gt-xs", "sm", "gt-sm", "md", "gt-md", "lg", "gt-lg", "xl", "print"], function(n) {
+                        ue.forEach(e, function(e) {
                             var t = n ? e + "-" + n : e;
                             r.directive(a(t), function(l) {
                                 return ["$mdUtil", "$interpolate", "$log", function(e, t, n) {
                                         restrict: "A",
                                         compile: function(e, t) {
                                             var n;
-                                            return g.enabled && ($(l, 0, e, u), w(l, k(l, t, ""), E(0, l, t)), n = r), n || se.noop
+                                            return g.enabled && ($(l, 0, e, u), w(l, k(l, t, ""), E(0, l, t)), n = r), n || ue.noop
                                         }
                                     }
                                 }];
                                 function r(e, t, n) {
                                     var r, i, o, a = (r = t, i = l, function(e) {
                                             var t = w(i, e || "");
-                                            se.isDefined(t) && (o && r.removeClass(o), o = t ? i + "-" + t.trim().replace(d, "-") : i, r.addClass(o))
+                                            ue.isDefined(t) && (o && r.removeClass(o), o = t ? i + "-" + t.trim().replace(d, "-") : i, r.addClass(o))
                                         }),
                                         s = n.$observe(n.$normalize(l), a);
                                     a(k(l, n, "")), e.$on("$destroy", function() {
                                     })
                                 }
                             }(t))
-                        }), se.forEach(o, function(e) {
+                        }), ue.forEach(o, function(e) {
                             var t = n ? e + "-" + n : e;
                             r.directive(a(t), y(t))
                         })
                     }), r.provider("$$mdLayout", function() {
                         return {
-                            $get: se.noop,
+                            $get: ue.noop,
                             validateAttributeValue: w,
                             validateAttributeUsage: $,
                             disableLayouts: function(e) {
                                     n(function() {
                                         t.removeClass(i)
                                     }, 10, !1)
-                                }) : se.noop
+                                }) : ue.noop
                             }
                         }
                     }])).directive("layoutWrap", y("layout-wrap")).directive("layoutNowrap", y("layout-nowrap")).directive("layoutNoWrap", y("layout-no-wrap")).directive("layoutFill", y("layout-fill")).directive("layoutLtMd", _("layout-lt-md")).directive("layoutLtLg", _("layout-lt-lg")).directive("flexLtMd", _("flex-lt-md")).directive("flexLtLg", _("flex-lt-lg")).directive("layoutAlignLtMd", _("layout-align-lt-md")).directive("layoutAlignLtLg", _("layout-align-lt-lg")).directive("flexOrderLtMd", _("flex-order-lt-md")).directive("flexOrderLtLg", _("flex-order-lt-lg")).directive("offsetLtMd", _("flex-offset-lt-md")).directive("offsetLtLg", _("flex-offset-lt-lg")).directive("hideLtMd", _("hide-lt-md")).directive("hideLtLg", _("hide-lt-lg")).directive("showLtMd", _("show-lt-md")).directive("showLtLg", _("show-lt-lg")).config(v)
-                }(se.module("material.core.layout", ["ng"]))
+                }(ue.module("material.core.layout", ["ng"]))
             }(),
             function() {
                 function e(e) {
                     this._$timeout = e, this._liveElement = this._createLiveElement(), this._announceTimeout = 100
                 }
-                e.$inject = ["$timeout"], se.module("material.core").service("$mdLiveAnnouncer", e), e.prototype.announce = function(e, t) {
+                e.$inject = ["$timeout"], ue.module("material.core").service("$mdLiveAnnouncer", e), e.prototype.announce = function(e, t) {
                     t || (t = "polite");
                     var n = this;
                     n._liveElement.textContent = "", n._liveElement.setAttribute("aria-live", t), n._$timeout(function() {
                     var e = document.createElement("div");
                     return e.classList.add("md-visually-hidden"), e.setAttribute("role", "status"), e.setAttribute("aria-atomic", "true"), e.setAttribute("aria-live", "polite"), document.body.appendChild(e), e
                 }
-            }(), se.module("material.core.meta", []).provider("$$mdMeta", function() {
-                var r = se.element(document.head),
+            }(), ue.module("material.core.meta", []).provider("$$mdMeta", function() {
+                var r = ue.element(document.head),
                     i = {};
 
                 function o(e) {
                     if (i[e]) return !0;
                     var t = document.getElementsByName(e)[0];
-                    return !!t && (i[e] = se.element(t), !0)
+                    return !!t && (i[e] = ue.element(t), !0)
                 }
                 var e = {
                     setMeta: function(e, t) {
                         if (o(e), i[e]) i[e].attr("content", t);
                         else {
-                            var n = se.element('<meta name="' + e + '" content="' + t + '"/>');
+                            var n = ue.element('<meta name="' + e + '" content="' + t + '"/>');
                             r.append(n), i[e] = n
                         }
                         return function() {
                         return i[e].attr("content")
                     }
                 };
-                return se.extend({}, e, {
+                return ue.extend({}, e, {
                     $get: function() {
                         return e
                     }
                                 e.resolve(t)
                             }), delete a[e]), function() {
                                 var e = o.indexOf(t); - 1 !== e && o.splice(e, 1)
-                            }) : se.noop;
+                            }) : ue.noop;
                             var n
                         },
                         when: function(e) {
                             if (s(e)) {
                                 var t = r.defer(),
                                     n = i.get(e);
-                                return n ? t.resolve(n) : (a[e] === le && (a[e] = []), a[e].push(t)), t.promise
+                                return n ? t.resolve(n) : (a[e] === de && (a[e] = []), a[e].push(t)), t.promise
                             }
                             return r.reject("Invalid `md-component-id` value.")
                         }
                         return e && "" !== e
                     }
                 }
-                e.$inject = ["$log", "$q"], se.module("material.core").factory("$mdComponentRegistry", e)
+                e.$inject = ["$log", "$q"], ue.module("material.core").factory("$mdComponentRegistry", e)
             }(),
             function() {
                 function e(i) {
                     return {
                         attach: function(e, t, n) {
                             var r;
-                            return n = se.extend((r = t).hasClass("md-icon-button") ? {
+                            return n = ue.extend((r = t).hasClass("md-icon-button") ? {
                                 isMenuItem: r.hasClass("md-menu-item"),
                                 fitRipple: !0,
                                 center: !0
                         }
                     }
                 }
-                e.$inject = ["$mdInkRipple"], se.module("material.core").factory("$mdButtonInkRipple", e)
+                e.$inject = ["$mdInkRipple"], ue.module("material.core").factory("$mdButtonInkRipple", e)
             }(),
             function() {
                 function e(r) {
                     return {
                         attach: function(e, t, n) {
-                            return r.attach(e, t, se.extend({
+                            return r.attach(e, t, ue.extend({
                                 center: !0,
                                 dimBackground: !1,
                                 fitRipple: !0
                         }
                     }
                 }
-                e.$inject = ["$mdInkRipple"], se.module("material.core").factory("$mdCheckboxInkRipple", e)
+                e.$inject = ["$mdInkRipple"], ue.module("material.core").factory("$mdCheckboxInkRipple", e)
             }(),
             function() {
                 function e(r) {
                     return {
                         attach: function(e, t, n) {
-                            return r.attach(e, t, se.extend({
+                            return r.attach(e, t, ue.extend({
                                 center: !1,
                                 dimBackground: !0,
                                 outline: !1,
                         }
                     }
                 }
-                e.$inject = ["$mdInkRipple"], se.module("material.core").factory("$mdListInkRipple", e)
+                e.$inject = ["$mdInkRipple"], ue.module("material.core").factory("$mdListInkRipple", e)
             }(),
             function() {
-                o.$inject = ["$scope", "$element", "rippleOptions", "$window", "$timeout", "$mdUtil", "$mdColorUtil"], e.$inject = ["$mdButtonInkRipple", "$mdCheckboxInkRipple"], se.module("material.core").provider("$mdInkRipple", function() {
+                o.$inject = ["$scope", "$element", "rippleOptions", "$window", "$timeout", "$mdUtil", "$mdColorUtil"], e.$inject = ["$mdButtonInkRipple", "$mdCheckboxInkRipple"], ue.module("material.core").provider("$mdInkRipple", function() {
                     var i = !1;
                     return {
                         disableInkRipple: function() {
                         $get: ["$injector", function(r) {
                             return {
                                 attach: function(e, t, n) {
-                                    return i || t.controller("mdNoInk") ? se.noop : r.instantiate(o, {
+                                    return i || t.controller("mdNoInk") ? ue.noop : r.instantiate(o, {
                                         $scope: e,
                                         $element: t,
                                         rippleOptions: n
 
                 function e(r, i) {
                     return {
-                        controller: se.noop,
+                        controller: ue.noop,
                         link: function(e, t, n) {
                             n.hasOwnProperty("mdInkRippleCheckbox") ? i.attach(e, t) : r.attach(e, t)
                         }
                 }
 
                 function o(e, t, n, r, i, o, a) {
-                    this.$window = r, this.$timeout = i, this.$mdUtil = o, this.$mdColorUtil = a, this.$scope = e, this.$element = t, this.options = n, this.mousedown = !1, this.ripples = [], this.timeout = null, this.lastRipple = null, o.valueOnUse(this, "container", this.createContainer), this.$element.addClass("md-ink-ripple"), (t.controller("mdInkRipple") || {}).createRipple = se.bind(this, this.createRipple), (t.controller("mdInkRipple") || {}).setColor = se.bind(this, this.color), this.bindEvents()
+                    this.$window = r, this.$timeout = i, this.$mdUtil = o, this.$mdColorUtil = a, this.$scope = e, this.$element = t, this.options = n, this.mousedown = !1, this.ripples = [], this.timeout = null, this.lastRipple = null, o.valueOnUse(this, "container", this.createContainer), this.$element.addClass("md-ink-ripple"), (t.controller("mdInkRipple") || {}).createRipple = ue.bind(this, this.createRipple), (t.controller("mdInkRipple") || {}).setColor = ue.bind(this, this.color), this.bindEvents()
                 }
 
                 function t(e, t) {
-                    (e.mousedown || e.lastRipple) && (e.mousedown = !1, e.$mdUtil.nextTick(se.bind(e, t), !1))
+                    (e.mousedown || e.lastRipple) && (e.mousedown = !1, e.$mdUtil.nextTick(ue.bind(e, t), !1))
                 }
 
                 function n() {
                     return {
-                        controller: se.noop
+                        controller: ue.noop
                     }
                 }
                 o.prototype.color = function(e) {
                     var t, n, r = this;
-                    return se.isDefined(e) && (r._color = r._parseColor(e)), r._color || r._parseColor(r.inkRipple()) || r._parseColor((t = r.options && r.options.colorElement ? r.options.colorElement : [], (n = t.length ? t[0] : r.$element[0]) ? r.$window.getComputedStyle(n).color : "rgb(0,0,0)"))
+                    return ue.isDefined(e) && (r._color = r._parseColor(e)), r._color || r._parseColor(r.inkRipple()) || r._parseColor((t = r.options && r.options.colorElement ? r.options.colorElement : [], (n = t.length ? t[0] : r.$element[0]) ? r.$window.getComputedStyle(n).color : "rgb(0,0,0)"))
                 }, o.prototype.calculateColor = function() {
                     return this.color()
                 }, o.prototype._parseColor = function(e, t) {
                     var n = this.$mdColorUtil;
                     if (e) return 0 === e.indexOf("rgba") ? e.replace(/\d?\.?\d*\s*\)\s*$/, (.1 * t).toString() + ")") : 0 === e.indexOf("rgb") ? n.rgbToRgba(e) : 0 === e.indexOf("#") ? n.hexToRgba(e) : void 0
                 }, o.prototype.bindEvents = function() {
-                    this.$element.on("mousedown", se.bind(this, this.handleMousedown)), this.$element.on("mouseup touchend", se.bind(this, this.handleMouseup)), this.$element.on("mouseleave", se.bind(this, this.handleMouseup)), this.$element.on("touchmove", se.bind(this, this.handleTouchmove))
+                    this.$element.on("mousedown", ue.bind(this, this.handleMousedown)), this.$element.on("mouseup touchend", ue.bind(this, this.handleMouseup)), this.$element.on("mouseleave", ue.bind(this, this.handleMouseup)), this.$element.on("touchmove", ue.bind(this, this.handleTouchmove))
                 }, o.prototype.handleMousedown = function(e) {
                     if (!this.mousedown)
                         if (e.hasOwnProperty("originalEvent") && (e = e.originalEvent), this.mousedown = !0, this.options.center) this.createRipple(this.container.prop("clientWidth") / 2, this.container.prop("clientWidth") / 2);
                 }, o.prototype.clearRipples = function() {
                     for (var e = 0; e < this.ripples.length; e++) this.fadeInComplete(this.ripples[e])
                 }, o.prototype.createContainer = function() {
-                    var e = se.element('<div class="md-ripple-container"></div>');
+                    var e = ue.element('<div class="md-ripple-container"></div>');
                     return this.$element.append(e), e
                 }, o.prototype.clearTimeout = function() {
                     this.timeout && (this.$timeout.cancel(this.timeout), this.timeout = null)
                     var e = this.$element[0];
                     do {
                         if (!e.tagName || "BODY" === e.tagName) break;
-                        if (e && se.isFunction(e.hasAttribute)) {
+                        if (e && ue.isFunction(e.hasAttribute)) {
                             if (e.hasAttribute("disabled")) return !1;
                             if ("false" === this.inkRipple() || "0" === this.inkRipple()) return !1
                         }
                     if (this.isRippleAllowed()) {
                         var n, r, i, o = this,
                             a = o.$mdColorUtil,
-                            s = se.element('<div class="md-ripple"></div>'),
+                            s = ue.element('<div class="md-ripple"></div>'),
                             l = this.$element.prop("clientWidth"),
                             c = this.$element.prop("clientHeight"),
                             u = 2 * Math.max(Math.abs(l - e), e),
                 function e(r) {
                     return {
                         attach: function(e, t, n) {
-                            return r.attach(e, t, se.extend({
+                            return r.attach(e, t, ue.extend({
                                 center: !1,
                                 dimBackground: !0,
                                 outline: !1,
                         }
                     }
                 }
-                e.$inject = ["$mdInkRipple"], se.module("material.core").factory("$mdTabInkRipple", e)
-            }(), se.module("material.core.theming.palette", []).constant("$mdColorPalette", {
+                e.$inject = ["$mdInkRipple"], ue.module("material.core").factory("$mdTabInkRipple", e)
+            }(), ue.module("material.core.theming.palette", []).constant("$mdColorPalette", {
                 red: {
                     50: "#ffebee",
                     100: "#ffcdd2",
                             o = e.hue || "800",
                             a = p[e.palette] || p[d[i].colors[e.palette || "primary"].name],
                             s = y.isObject(a[o]) ? a[o].hex : a[o];
-                        return t = s, n = l.setMeta("theme-color", t), r = l.setMeta("msapplication-navbutton-color", t),
+                        return "#" !== s.substr(0, 1) && (s = "#" + s), t = s, n = l.setMeta("theme-color", t), r = l.setMeta("msapplication-navbutton-color", t),
                             function() {
                                 n(), r()
                             }
 
                     function a(n, l, r, c) {
                         var i = function(e, t) {
-                            t === le && (t = e, e = le), e === le && (e = n), i.inherit(t, t)
+                            t === de && (t = e, e = de), e === de && (e = n), i.inherit(t, t)
                         };
                         return Object.defineProperty(i, "THEMES", {
                             get: function() {
                                 var i = f || r.$shouldWatch || l.parseAttributeBoolean(n.attr("md-theme-watch"));
                                 if (i || r.isAsyncTheme) {
                                     var o = function() {
-                                            a && (a(), a = le)
+                                            a && (a(), a = de)
                                         },
                                         a = r.registerChanges(function(e) {
                                             s(e), i || o()
                         }, i.defineTheme = function(e, t) {
                             t = t || {};
                             var n = o(e);
-                            return t.primary && n.primaryPalette(t.primary), t.accent && n.accentPalette(t.accent), t.warn && n.warnPalette(t.warn), t.background && n.backgroundPalette(t.background), t.dark && n.dark(), this.generateTheme(e), r.resolve(e)
+                            return t.primary && n.primaryPalette(t.primary, t.primaryHues), t.accent && n.accentPalette(t.accent, t.accentHues), t.warn && n.warnPalette(t.warn, t.warnHues), t.background && n.backgroundPalette(t.background, t.backgroundHues), t.dark && n.dark(), this.generateTheme(e), r.resolve(e)
                         }, i.setBrowserColor = t, i;
 
                         function u(e) {
-                            return e === le || "" === e || i.THEMES[e] !== le
+                            return e === de || "" === e || i.THEMES[e] !== de
                         }
                     }
                 }
                 function x(e, t) {
                     return e ? (4 == e.length && (e = y.copy(e), t ? e.pop() : t = e.pop()), t && ("number" == typeof t || "string" == typeof t && t.length) ? "rgba(" + e.join(",") + "," + t + ")" : "rgb(" + e.join(",") + ")") : "rgb('0,0,0')"
                 }
-            }(F.angular), se.module("material.core").factory("$$mdAnimate", ["$q", "$timeout", "$mdConstant", "$animateCss", function(n, i, a, s) {
-                return function(e) {
-                    return r = e, t = n, l = i, c = a, o = s, u = {
-                        translate3d: function(t, n, e, r) {
-                            return o(t, {
-                                from: n,
-                                to: e,
-                                addClass: r.transitionInClass,
-                                removeClass: r.transitionOutClass,
-                                duration: r.duration
-                            }).start().then(function() {
-                                return i
-                            });
-
-                            function i(e) {
-                                return o(t, {
-                                    to: e || n,
-                                    addClass: r.transitionOutClass,
-                                    removeClass: r.transitionInClass,
-                                    duration: r.duration
-                                }).start()
+            }(F.angular), ue.module("material.components.autocomplete", ["material.core", "material.components.icon", "material.components.virtualRepeat"]),
+            function() {
+                e.$inject = ["$scope", "$element", "$mdUtil", "$mdConstant", "$mdTheming", "$window", "$animate", "$rootElement", "$attrs", "$q", "$log", "$mdLiveAnnouncer"], ue.module("material.components.autocomplete").controller("MdAutocompleteCtrl", e);
+                var ie = 48,
+                    oe = 5,
+                    ae = 8,
+                    se = 2,
+                    le = "standard",
+                    ce = "virtual";
+
+                function e(h, p, m, t, n, e, r, i, g, s, o, a) {
+                    var l, c, u, d = this,
+                        f = h.itemsExpr.split(/ in /i),
+                        v = f[1],
+                        b = null,
+                        y = {},
+                        _ = !1,
+                        $ = [],
+                        w = !1,
+                        E = 0,
+                        C = null,
+                        k = null,
+                        x = m.debounce(function() {
+                            d.hidden || D()
+                        }),
+                        T = ce;
+                    l = "hidden", c = function(e, t) {
+                        !e && t ? (D(), X(!0, A.Count | A.Selected), b && (m.disableScrollAround(b.ul), C = function(e) {
+                            function t(e) {
+                                e.preventDefault()
                             }
-                        },
-                        waitTransitionEnd: function(o, a) {
-                            var s = 3e3;
-                            return t(function(t, e) {
-                                var n;
-                                ("0s" == (n = (n = (a = a || {}).cachedTransitionStyles) || F.getComputedStyle(o[0])).transitionDuration || !n.transition && !n.transitionProperty) && (s = 0);
-                                var r = l(i, a.timeout || s);
-
-                                function i(e) {
-                                    e && e.target !== o[0] || (e && l.cancel(r), o.off(c.CSS.TRANSITIONEND, i), t())
+                            return e.on("wheel", t), e.on("touchmove", t),
+                                function() {
+                                    e.off("wheel", t), e.off("touchmove", t)
                                 }
-                                o.on(c.CSS.TRANSITIONEND, i)
-                            })
+                        }(ue.element(b.wrap)))) : e && !t && (m.enableScrolling(), C && (C(), C = null))
+                    }, u = !0, Object.defineProperty(d, l, {
+                        get: function() {
+                            return u
                         },
-                        calculateTransformValues: function(e, t) {
-                            var n, r, i = t.element,
-                                o = t.bounds;
-                            if (i || o) {
-                                var a = i ? u.clientRect(i) || (n = e ? e.parent() : null, (r = n ? n.parent() : null) ? u.clientRect(r) : null) : u.copyRect(o),
-                                    s = u.copyRect(e[0].getBoundingClientRect()),
-                                    l = u.centerPointFor(s),
-                                    c = u.centerPointFor(a);
-                                return {
-                                    centerX: c.x - l.x,
-                                    centerY: c.y - l.y,
-                                    scaleX: Math.round(100 * Math.min(.5, a.width / s.width)) / 100,
-                                    scaleY: Math.round(100 * Math.min(.5, a.height / s.height)) / 100
-                                }
-                            }
+                        set: function(e) {
+                            var t = u;
+                            c(u = e, t)
+                        }
+                    }), d.scope = h, d.parent = h.$parent, d.itemName = f[0], d.matches = [], d.loading = !1, d.hidden = !0, d.index = null, d.id = m.nextUid(), d.isDisabled = null, d.isRequired = null, d.isReadonly = null, d.hasNotFound = !1, d.selectedMessage = h.selectedMessage || "selected", d.keydown = function(e) {
+                        switch (e.keyCode) {
+                            case t.KEY_CODE.DOWN_ARROW:
+                                if (d.loading || z()) return;
+                                e.stopPropagation(), e.preventDefault(), d.index = Math.min(d.index + 1, d.matches.length - 1), Q(), X(!1, A.Selected);
+                                break;
+                            case t.KEY_CODE.UP_ARROW:
+                                if (d.loading || z()) return;
+                                e.stopPropagation(), e.preventDefault(), d.index = d.index < 0 ? d.matches.length - 1 : Math.max(0, d.index - 1), Q(), X(!1, A.Selected);
+                                break;
+                            case t.KEY_CODE.TAB:
+                                if (I(), d.hidden || d.loading || d.index < 0 || d.matches.length < 1) return;
+                                G(d.index);
+                                break;
+                            case t.KEY_CODE.ENTER:
+                                if (d.hidden || d.loading || d.index < 0 || d.matches.length < 1) return;
+                                if (z()) return;
+                                e.stopImmediatePropagation(), e.preventDefault(), G(d.index);
+                                break;
+                            case t.KEY_CODE.ESCAPE:
+                                if (e.preventDefault(), !(V("blur") || !d.hidden || d.loading || V("clear") && h.searchText)) return;
+                                e.stopPropagation(), K(), h.searchText && V("clear") && Z(), d.hidden = !0, V("blur") && function(e) {
+                                    e && (w = _ = !1);
+                                    b.input.blur()
+                                }(!0)
+                        }
+                    }, d.blur = function(e) {
+                        w = !1, _ || (d.hidden = q(), re("ngBlur", {
+                            $event: e
+                        }))
+                    }, d.focus = function(e) {
+                        w = !0, U() && Y() && te();
+                        d.hidden = q(), re("ngFocus", {
+                            $event: e
+                        })
+                    }, d.clear = function() {
+                        K(), Z()
+                    }, d.select = G, d.listEnter = function() {
+                        _ = !0
+                    }, d.listLeave = I, d.mouseUp = function() {
+                        b.input.focus()
+                    }, d.getCurrentDisplayValue = W, d.registerSelectedItemWatcher = function(e) {
+                        -1 === $.indexOf(e) && $.push(e)
+                    }, d.unregisterSelectedItemWatcher = function(e) {
+                        var t = $.indexOf(e); - 1 !== t && $.splice(t, 1)
+                    }, d.notFoundVisible = ee, d.loadingIsVisible = function() {
+                        return d.loading && !z()
+                    }, d.positionDropdown = D;
+                    var M, A = {
+                        Count: 1,
+                        Selected: 2
+                    };
+                    return m.initOptionalProperties(h, g, {
+                        searchText: "",
+                        selectedItem: null,
+                        clearButton: !1,
+                        disableVirtualRepeat: !1
+                    }), n(p), M = parseInt(h.delay, 10) || 0, g.$observe("disabled", function(e) {
+                        d.isDisabled = m.parseAttributeBoolean(e, !1)
+                    }), g.$observe("required", function(e) {
+                        d.isRequired = m.parseAttributeBoolean(e, !1)
+                    }), g.$observe("readonly", function(e) {
+                        d.isReadonly = m.parseAttributeBoolean(e, !1)
+                    }), h.$watch("searchText", M ? m.debounce(P, M) : P), h.$watch("selectedItem", R), ue.element(e).on("resize", x), h.$on("$destroy", N), void m.nextTick(function() {
+                        var e;
+                        e = function() {
+                            var e, t;
+                            for (e = p; e.length && (t = e.attr("md-autocomplete-snap"), !ue.isDefined(t)); e = e.parent());
+                            if (e.length) return {
+                                snap: e[0],
+                                wrap: "width" === t.toLowerCase() ? e[0] : p.find("md-autocomplete-wrap")[0]
+                            };
+                            var n = p.find("md-autocomplete-wrap")[0];
                             return {
-                                centerX: 0,
-                                centerY: 0,
-                                scaleX: .5,
-                                scaleY: .5
+                                snap: n,
+                                wrap: n
                             }
-                        },
-                        calculateZoomToOrigin: function(e, t) {
-                            var n = se.bind(null, r.supplant, "translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )");
-                            return n(u.calculateTransformValues(e, t))
-                        },
-                        calculateSlideToOrigin: function(e, t) {
-                            var n = se.bind(null, r.supplant, "translate3d( {centerX}px, {centerY}px, 0 )");
-                            return n(u.calculateTransformValues(e, t))
-                        },
-                        toCss: function(e) {
-                            var r = {};
-                            return se.forEach(e, function(e, t) {
-                                if (!se.isUndefined(e))
-                                    if (0 <= "left top right bottom width height x y min-width min-height max-width max-height".indexOf(t)) r[t] = e + "px";
-                                    else switch (t) {
-                                        case "transition":
-                                            n(t, c.CSS.TRANSITION, e);
-                                            break;
-                                        case "transform":
-                                            n(t, c.CSS.TRANSFORM, e);
-                                            break;
-                                        case "transformOrigin":
-                                            n(t, c.CSS.TRANSFORM_ORIGIN, e);
-                                            break;
-                                        case "font-size":
-                                            r["font-size"] = e
-                                    }
-                            }), r;
+                        }(), (b = {
+                            main: p[0],
+                            scrollContainer: p[0].querySelector(".md-virtual-repeat-container, .md-standard-list-container"),
+                            scroller: p[0].querySelector(".md-virtual-repeat-scroller, .md-standard-list-scroller"),
+                            ul: p.find("ul")[0],
+                            input: p.find("input")[0],
+                            wrap: e.wrap,
+                            snap: e.snap,
+                            root: document.body
+                        }).li = b.ul.getElementsByTagName("li"), b.$ = function(e) {
+                            var t = {};
+                            for (var n in e) e.hasOwnProperty(n) && (t[n] = ue.element(e[n]));
+                            return t
+                        }(b), T = b.scrollContainer.classList.contains("md-standard-list-container") ? le : ce, k = b.$.input.controller("ngModel"), b.$.root.length && (n(b.$.scrollContainer), b.$.scrollContainer.detach(), b.$.root.append(b.$.scrollContainer), r.pin && r.pin(b.$.scrollContainer, i)), h.autofocus && p.on("focus", O), h.inputAriaDescribedBy && b.input.setAttribute("aria-describedby", h.inputAriaDescribedBy), h.floatingLabel || (h.inputAriaLabel ? b.input.setAttribute("aria-label", h.inputAriaLabel) : h.inputAriaLabelledBy ? b.input.setAttribute("aria-labelledby", h.inputAriaLabelledBy) : h.placeholder && b.input.setAttribute("aria-label", h.placeholder))
+                    });
 
-                            function n(e, t, n) {
-                                se.forEach(t.split(" "), function(e) {
-                                    r[e] = n
-                                })
-                            }
-                        },
-                        toTransformCss: function(t, e, n) {
-                            var r = {};
-                            return se.forEach(c.CSS.TRANSFORM.split(" "), function(e) {
-                                r[e] = t
-                            }), e && (n = n || "all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important", r.transition = n), r
-                        },
-                        copyRect: function(t, n) {
-                            return t ? (n = n || {}, se.forEach("left top right bottom width height".split(" "), function(e) {
-                                n[e] = Math.round(t[e])
-                            }), n.width = n.width || n.right - n.left, n.height = n.height || n.bottom - n.top, n) : null
-                        },
-                        clientRect: function(e) {
-                            var t, n = se.element(e)[0].getBoundingClientRect();
-                            return (t = n) && 0 < t.width && 0 < t.height ? u.copyRect(n) : null
-                        },
-                        centerPointFor: function(e) {
-                            return e ? {
-                                x: Math.round(e.left + e.width / 2),
-                                y: Math.round(e.top + e.height / 2)
-                            } : {
-                                x: 0,
-                                y: 0
-                            }
-                        }
-                    };
-                    var r, t, l, c, o, u
-                }
-            }]), 4 <= se.version.minor ? se.module("material.core.animate", []) : function() {
-                var k = se.forEach,
-                    x = se.isDefined(document.documentElement.style.WebkitAppearance),
-                    T = x ? "-webkit-" : "",
-                    M = (x ? "webkitTransitionEnd " : "") + "transitionend",
-                    A = (x ? "webkitAnimationEnd " : "") + "animationend",
-                    e = ["$q", "$$rAFMutex", function(t, n) {
-                        function e(e) {
-                            this.setHost(e), this._doneCallbacks = [], this._runInAnimationFrame = n(), this._state = 0
-                        }
-                        return e.prototype = {
-                            setHost: function(e) {
-                                this.host = e || {}
-                            },
-                            done: function(e) {
-                                2 === this._state ? e() : this._doneCallbacks.push(e)
-                            },
-                            progress: se.noop,
-                            getPromise: function() {
-                                if (!this.promise) {
-                                    var e = this;
-                                    this.promise = t(function(t, n) {
-                                        e.done(function(e) {
-                                            !1 === e ? n() : t()
-                                        })
-                                    })
+                    function S() {
+                        h.requireMatch && k && k.$setValidity("md-require-match", !!h.selectedItem || !h.searchText)
+                    }
+
+                    function D() {
+                        if (!b) return m.nextTick(D, !1, h);
+                        var e, t = (h.dropdownItems || oe) * ie,
+                            n = b.wrap.getBoundingClientRect(),
+                            r = b.snap.getBoundingClientRect(),
+                            i = b.root.getBoundingClientRect(),
+                            o = r.bottom - i.top,
+                            a = i.bottom - r.top,
+                            s = n.left - i.left,
+                            l = n.width,
+                            c = function() {
+                                var e = 0,
+                                    t = p.find("md-input-container");
+                                if (t.length) {
+                                    var n = t.find("input");
+                                    e = t.prop("offsetHeight"), e -= n.prop("offsetTop"), e -= n.prop("offsetHeight"), e += t.prop("offsetTop")
                                 }
-                                return this.promise
-                            },
-                            then: function(e, t) {
-                                return this.getPromise().then(e, t)
-                            },
-                            catch: function(e) {
-                                return this.getPromise().catch(e)
-                            },
-                            finally: function(e) {
-                                return this.getPromise().finally(e)
-                            },
-                            pause: function() {
-                                this.host.pause && this.host.pause()
-                            },
-                            resume: function() {
-                                this.host.resume && this.host.resume()
-                            },
-                            end: function() {
-                                this.host.end && this.host.end(), this._resolve(!0)
-                            },
-                            cancel: function() {
-                                this.host.cancel && this.host.cancel(), this._resolve(!1)
-                            },
-                            complete: function(e) {
-                                var t = this;
-                                0 === t._state && (t._state = 1, t._runInAnimationFrame(function() {
-                                    t._resolve(e)
-                                }))
-                            },
-                            _resolve: function(t) {
-                                2 !== this._state && (k(this._doneCallbacks, function(e) {
-                                    e(t)
-                                }), this._doneCallbacks.length = 0, this._state = 2)
-                            }
-                        }, e.all = function(t, n) {
-                            var r = 0,
-                                i = !0;
+                                return e
+                            }(),
+                            u = h.dropdownPosition,
+                            d = i.bottom - r.bottom - ae + m.getViewportTop(),
+                            f = r.top - ae;
+                        u || (u = t < d ? "bottom" : t < f ? "top" : d < f ? "top" : "bottom"), g.mdFloatingLabel && (s += se, l -= 2 * se), e = {
+                            left: s + "px",
+                            minWidth: l + "px",
+                            maxWidth: Math.max(n.right - i.left, i.right - n.left) - ae + "px"
+                        }, "top" === u ? (e.top = "auto", e.bottom = a + "px", e.maxHeight = Math.min(t, f) + "px") : (d = i.bottom - n.bottom - ae + m.getViewportTop(), e.top = o - c + "px", e.bottom = "auto", e.maxHeight = Math.min(t, d) + "px"), b.$.scrollContainer.css(e), m.nextTick(function() {
+                            var e = b.scrollContainer.getBoundingClientRect(),
+                                t = {};
+                            e.right > i.right && (t.left = n.right - e.width + "px");
+                            b.$.scrollContainer.css(t)
+                        }, !1, h)
+                    }
 
-                            function o(e) {
-                                i = i && e, ++r === t.length && n(i)
+                    function O() {
+                        b.input.focus()
+                    }
+
+                    function N() {
+                        if (d.hidden || m.enableScrolling(), ue.element(e).off("resize", x), b) {
+                            ue.forEach(["ul", "scroller", "scrollContainer", "input"], function(e) {
+                                b.$[e].remove()
+                            })
+                        }
+                    }
+
+                    function I() {
+                        w || d.hidden || b.input.focus(), _ = !1, d.hidden = q()
+                    }
+
+                    function R(r, i) {
+                        S(), r ? j(r).then(function(e) {
+                            var t, n;
+                            h.searchText = e, t = r, n = i, $.forEach(function(e) {
+                                e(t, n)
+                            })
+                        }) : i && h.searchText && j(i).then(function(e) {
+                            ue.isString(h.searchText) && e.toString().toLowerCase() === h.searchText.toLowerCase() && (h.searchText = "")
+                        }), r !== i && ue.isFunction(h.itemChange) && h.itemChange(L(h.selectedItem))
+                    }
+
+                    function P(t, n) {
+                        d.index = h.autoselect ? 0 : -1, t !== n && (S(), j(h.selectedItem).then(function(e) {
+                            t !== e && (h.selectedItem = null, t !== n && ue.isFunction(h.textChange) && h.textChange(), Y() ? te() : (F(!(d.matches = [])), X(!0, A.Count)))
+                        }))
+                    }
+
+                    function H() {
+                        return ue.isNumber(h.minLength) ? h.minLength : 1
+                    }
+
+                    function j(e) {
+                        return s.when((t = e, (t && h.itemText ? h.itemText(L(t)) : null) || e)).then(function(e) {
+                            return e && !ue.isString(e) && o.warn("md-autocomplete: Could not resolve display value to a string. Please check the `md-item-text` attribute."), e
+                        });
+                        var t
+                    }
+
+                    function L(e) {
+                        if (!e) return de;
+                        var t = {};
+                        return d.itemName && (t[d.itemName] = e), t
+                    }
+
+                    function F(e) {
+                        d.loading !== e && (d.loading = e), d.hidden = q()
+                    }
+
+                    function q() {
+                        return ! function() {
+                            {
+                                if (d.isReadonly) return !1;
+                                if (!U()) return !1
                             }
-                            k(t, function(e) {
-                                e.done(o)
+                            return Y() && B() || ee()
+                        }()
+                    }
+
+                    function U() {
+                        return !(d.loading && !B()) && (!z() && !!w)
+                    }
+
+                    function V(e) {
+                        return !h.escapeOptions || -1 !== h.escapeOptions.toLowerCase().indexOf(e)
+                    }
+
+                    function B() {
+                        return !!d.matches.length
+                    }
+
+                    function z() {
+                        return !!d.scope.selectedItem
+                    }
+
+                    function W() {
+                        return j(d.matches[d.index])
+                    }
+
+                    function Y() {
+                        return (h.searchText || "").length >= H()
+                    }
+
+                    function G(e) {
+                        m.nextTick(function() {
+                            j(d.matches[e]).then(function(e) {
+                                var t = b.$.input.controller("ngModel");
+                                a.announce(e + " " + d.selectedMessage, "assertive"), t.$setViewValue(e), t.$render()
+                            }).finally(function() {
+                                h.selectedItem = d.matches[e], F(!1)
                             })
-                        }, e
-                    }];
+                        }, !1)
+                    }
 
-                function S(e) {
-                    return e.replace(/-[a-z]/g, function(e) {
-                        return e.charAt(1).toUpperCase()
-                    })
-                }
-                se.module("material.core.animate", []).factory("$$forceReflow", ["$document", function(e) {
-                    return function() {
-                        return e[0].body.clientWidth + 1
+                    function K() {
+                        d.index = 0, d.matches = []
                     }
-                }]).factory("$$AnimateRunner", e).factory("$$rAFMutex", ["$$rAF", function(n) {
-                    return function() {
-                        var t = !1;
-                        return n(function() {
-                                t = !0
-                            }),
-                            function(e) {
-                                t ? e() : n(e)
+
+                    function Z() {
+                        F(!0), h.searchText = "";
+                        var e = document.createEvent("CustomEvent");
+                        e.initCustomEvent("change", !0, !0, {
+                            value: ""
+                        }), b.input.dispatchEvent(e), b.input.blur(), h.searchText = "", b.input.focus()
+                    }
+
+                    function X(e, t) {
+                        var n = e ? "polite" : "assertive",
+                            r = [];
+                        t & A.Selected && -1 !== d.index && r.push(W()), t & A.Count && r.push(s.resolve(function() {
+                            switch (d.matches.length) {
+                                case 0:
+                                    return "There are no matches available.";
+                                case 1:
+                                    return "There is 1 match available.";
+                                default:
+                                    return "There are " + d.matches.length + " matches available."
                             }
+                        }())), s.all(r).then(function(e) {
+                            a.announce(e.join(" "), n)
+                        })
                     }
-                }]).factory("$animateCss", ["$window", "$$rAF", "$$AnimateRunner", "$$forceReflow", "$$jqLite", "$timeout", "$animate", function(p, o, a, m, n, g, s) {
-                    function v(e, t) {
-                        t.addClass && (n.addClass(e, t.addClass), t.addClass = null), t.removeClass && (n.removeClass(e, t.removeClass), t.removeClass = null)
+
+                    function Q() {
+                        var e, t, n, r, i, o, a, s, l, c;
+                        b.li[0] && (T === le ? (o = b.li[d.index] || b.li[0], a = b.scrollContainer.offsetHeight, s = o && o.offsetTop || 0, l = s + o.clientHeight, c = b.scrollContainer.scrollTop, s < c ? J(s) : c + a < l && J(l - a)) : (e = b.li[0].offsetHeight, t = e * d.index, n = t + e, r = b.scroller.clientHeight, i = b.scroller.scrollTop, t < i ? J(t) : i + r < n && J(n - r)))
                     }
 
-                    function b(e) {
-                        var t = 0,
-                            n = (e || "").split(/\s*,\s*/);
-                        return k(n, function(e) {
-                            "s" == e.charAt(e.length - 1) && (e = e.substring(0, e.length - 1)), e = parseFloat(e) || 0, t = t ? Math.max(e, t) : e
-                        }), t
+                    function J(e) {
+                        T === le ? b.scrollContainer.scrollTop = e : b.$.scrollContainer.controller("mdVirtualRepeatContainer").scrollTo(e)
                     }
-                    var y, _ = [];
 
-                    function $(e, t) {
-                        t.from && (e.css(t.from), t.from = null)
+                    function ee() {
+                        var e = (d.scope.searchText || "").length;
+                        return d.hasNotFound && !B() && (!d.loading || 0 !== E) && e >= H() && (w || _) && !z()
                     }
 
-                    function w(e, t) {
-                        t.to && (e.css(t.to), t.to = null)
+                    function te() {
+                        var e = h.searchText || "",
+                            t = e.toLowerCase();
+                        !h.noCache && y[t] ? ne(y[t]) : function(t) {
+                            var e = h.$parent.$eval(v),
+                                n = t.toLowerCase(),
+                                r = ue.isArray(e),
+                                i = !!e.then;
+
+                            function o(e) {
+                                y[n] = e, (t || "") === (h.searchText || "") && ne(e)
+                            }
+                            r ? o(e) : i && (a = e, a && (a = s.when(a), E++, F(!0), m.nextTick(function() {
+                                a.then(o).finally(function() {
+                                    0 == --E && F(!1)
+                                })
+                            }, !0, h)));
+                            var a
+                        }(e), d.hidden = q()
                     }
 
-                    function E(e) {
-                        for (var t = 0; t < e.length; t++)
-                            if (1 === e[t].nodeType) return e[t]
+                    function ne(e) {
+                        var n, t, r;
+                        d.matches = e, d.hidden = q(), d.loading && F(!1), h.selectOnMatch && (n = h.searchText, t = d.matches, r = t[0], 1 === t.length && j(r).then(function(e) {
+                            var t = n === e;
+                            h.matchInsensitive && !t && (t = n.toLowerCase() === e.toLowerCase()), t && G(0)
+                        })), D(), X(!0, A.Count)
                     }
 
-                    function C(e, t) {
-                        var n = E(e),
-                            r = S(T + "transition-delay");
-                        n.style[r] = t ? "-9999s" : ""
+                    function re(e, t) {
+                        g[e] && h.$parent.$eval(g[e], t || {})
                     }
-                    return function(r, l) {
-                        var c = [],
-                            u = E(r),
-                            e = u && s.enabled(),
-                            t = !1,
-                            n = !1;
-                        e && (l.transitionStyle && c.push([T + "transition", l.transitionStyle]), l.keyframeStyle && c.push([T + "animation", l.keyframeStyle]), l.delay && c.push([T + "transition-delay", l.delay + "s"]), l.duration && c.push([T + "transition-duration", l.duration + "s"]), t = l.keyframeStyle || l.to && (0 < l.duration || l.transitionStyle), n = !!l.addClass || !!l.removeClass, C(r, !0));
-                        var d = e && (t || n);
-                        $(r, l);
-                        var f, h, i = !1;
-                        return {
-                            close: p.close,
-                            start: function() {
-                                var e, n = new a;
-                                return e = function() {
-                                    if (C(r, !1), !d) return s();
-                                    k(c, function(e) {
-                                        var t = e[0],
-                                            n = e[1];
-                                        u.style[S(t)] = n
-                                    }), v(r, l);
-                                    var e = function(e) {
-                                        var t = E(e),
-                                            n = p.getComputedStyle(t),
-                                            r = b(n[c("transitionDuration")]),
-                                            i = b(n[c("animationDuration")]),
-                                            o = b(n[c("transitionDelay")]),
-                                            a = b(n[c("animationDelay")]);
-                                        i *= parseInt(n[c("animationIterationCount")], 10) || 1;
-                                        var s = Math.max(i, r),
-                                            l = Math.max(a, o);
-                                        return {
-                                            duration: s,
-                                            delay: l,
-                                            animationDuration: i,
-                                            transitionDuration: r,
-                                            animationDelay: a,
-                                            transitionDelay: o
-                                        };
+                }
+            }(),
+            function() {
+                function e(c) {
+                    var u = "virtual",
+                        t = ["standard", u];
 
-                                        function c(e) {
-                                            return x ? "Webkit" + e.charAt(0).toUpperCase() + e.substr(1) : e
-                                        }
-                                    }(r);
-                                    if (0 === e.duration) return s();
-                                    var t = [];
-                                    l.easing && (e.transitionDuration && t.push([T + "transition-timing-function", l.easing]), e.animationDuration && t.push([T + "animation-timing-function", l.easing])), l.delay && e.animationDelay && t.push([T + "animation-delay", l.delay + "s"]), l.duration && e.animationDuration && t.push([T + "animation-duration", l.duration + "s"]), k(t, function(e) {
-                                        var t = e[0],
-                                            n = e[1];
-                                        u.style[S(t)] = n, c.push(e)
-                                    });
-                                    var i = 1e3 * e.delay,
-                                        o = e.duration,
-                                        n = 1e3 * o,
-                                        a = Date.now();
-                                    f = [], e.transitionDuration && f.push(M), e.animationDuration && f.push(A), f = f.join(" "), h = function(e) {
-                                        e.stopPropagation();
-                                        var t = e.originalEvent || e,
-                                            n = t.timeStamp || Date.now(),
-                                            r = parseFloat(t.elapsedTime.toFixed(3));
-                                        Math.max(n - a, 0) >= i && o <= r && s()
-                                    }, r.on(f, h), w(r, l), g(s, i + 1.5 * n, !1)
-                                }, y && y(), _.push(e), y = o(function() {
-                                    y = null;
-                                    for (var e = m(), t = 0; t < _.length; t++) _[t](e);
-                                    _.length = 0
-                                }), n;
+                    function d(e) {
+                        return e ? (e = e.toLowerCase(), -1 < t.indexOf(e) ? e : u) : u
+                    }
+                    return {
+                        controller: "MdAutocompleteCtrl",
+                        controllerAs: "$mdAutocompleteCtrl",
+                        scope: {
+                            inputName: "@mdInputName",
+                            inputMinlength: "@mdInputMinlength",
+                            inputMaxlength: "@mdInputMaxlength",
+                            searchText: "=?mdSearchText",
+                            selectedItem: "=?mdSelectedItem",
+                            itemsExpr: "@mdItems",
+                            itemText: "&mdItemText",
+                            placeholder: "@placeholder",
+                            inputAriaDescribedBy: "@?inputAriaDescribedby",
+                            inputAriaLabelledBy: "@?inputAriaLabelledby",
+                            inputAriaLabel: "@?inputAriaLabel",
+                            noCache: "=?mdNoCache",
+                            requireMatch: "=?mdRequireMatch",
+                            selectOnMatch: "=?mdSelectOnMatch",
+                            matchInsensitive: "=?mdMatchCaseInsensitive",
+                            itemChange: "&?mdSelectedItemChange",
+                            textChange: "&?mdSearchTextChange",
+                            minLength: "=?mdMinLength",
+                            delay: "=?mdDelay",
+                            autofocus: "=?mdAutofocus",
+                            floatingLabel: "@?mdFloatingLabel",
+                            autoselect: "=?mdAutoselect",
+                            menuClass: "@?mdMenuClass",
+                            menuContainerClass: "@?mdMenuContainerClass",
+                            inputClass: "@?mdInputClass",
+                            inputId: "@?mdInputId",
+                            escapeOptions: "@?mdEscapeOptions",
+                            dropdownItems: "=?mdDropdownItems",
+                            dropdownPosition: "@?mdDropdownPosition",
+                            clearButton: "=?mdClearButton",
+                            selectedMessage: "@?mdSelectedMessage",
+                            mdMode: "=?mdMode"
+                        },
+                        compile: function(e, n) {
+                            var r = e.find("input");
+                            return ["md-select-on-focus", "md-no-asterisk", "ng-trim", "ng-pattern"].forEach(function(e) {
+                                    var t = n[n.$normalize(e)];
+                                    null !== t && r.attr(e, t)
+                                }),
+                                function(e, t, n, r) {
+                                    r.hasNotFound = !!t.attr("md-has-not-found"), ue.isDefined(n.mdClearButton) || e.floatingLabel || (e.clearButton = !0), e.mdMode = d(n.mdMode)
+                                }
+                        },
+                        template: function(n, e) {
+                            var t, r, i = (t = n.find("md-not-found").detach(), (r = t.length ? t.html() : "") ? '<li ng-if="$mdAutocompleteCtrl.notFoundVisible()"                         md-autocomplete-parent-scope>' + r + "</li>" : ""),
+                                o = function() {
+                                    var e = n.find("md-item-template").detach(),
+                                        t = e.length ? e.html() : n.html();
+                                    e.length || n.empty();
+                                    return "<md-autocomplete-parent-scope md-autocomplete-replace>" + t + "</md-autocomplete-parent-scope>"
+                                }(),
+                                a = n.html(),
+                                s = e.tabindex;
+                            return i && n.attr("md-has-not-found", !0), n.attr("tabindex", "-1"), "        <md-autocomplete-wrap            ng-class=\"{ 'md-whiteframe-z1': !floatingLabel,                         'md-menu-showing': !$mdAutocompleteCtrl.hidden,                         'md-show-clear-button': !!clearButton }\">          " + (e.mdFloatingLabel ? '            <md-input-container ng-if="floatingLabel">              <label>{{floatingLabel}}</label>              <input type="search"                ' + (null != s ? 'tabindex="' + s + '"' : "") + '                id="{{ inputId || \'fl-input-\' + $mdAutocompleteCtrl.id }}"                name="{{inputName}}"                ng-class="::inputClass"                autocomplete="off"                ng-required="$mdAutocompleteCtrl.isRequired"                ng-readonly="$mdAutocompleteCtrl.isReadonly"                ng-minlength="inputMinlength"                ng-maxlength="inputMaxlength"                ng-disabled="$mdAutocompleteCtrl.isDisabled"                ng-model="$mdAutocompleteCtrl.scope.searchText"                ng-model-options="{ allowInvalid: true }"                ng-keydown="$mdAutocompleteCtrl.keydown($event)"                ng-blur="$mdAutocompleteCtrl.blur($event)"                ng-focus="$mdAutocompleteCtrl.focus($event)"                aria-label="{{floatingLabel}}"                aria-autocomplete="list"                role="combobox"                aria-haspopup="true"                aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"                aria-owns="ul-{{$mdAutocompleteCtrl.id}}"                ng-attr-aria-activedescendant="{{$mdAutocompleteCtrl.index >= 0 ? \'selected_option\' : undefined}}">              <div md-autocomplete-parent-scope md-autocomplete-replace>' + a + "</div>            </md-input-container>" : '            <input type="search"              ' + (null != s ? 'tabindex="' + s + '"' : "") + '              id="{{ inputId || \'input-\' + $mdAutocompleteCtrl.id }}"              name="{{inputName}}"              ng-class="::inputClass"              ng-if="!floatingLabel"              autocomplete="off"              ng-required="$mdAutocompleteCtrl.isRequired"              ng-disabled="$mdAutocompleteCtrl.isDisabled"              ng-readonly="$mdAutocompleteCtrl.isReadonly"              ng-minlength="inputMinlength"              ng-maxlength="inputMaxlength"              ng-model="$mdAutocompleteCtrl.scope.searchText"              ng-keydown="$mdAutocompleteCtrl.keydown($event)"              ng-blur="$mdAutocompleteCtrl.blur($event)"              ng-focus="$mdAutocompleteCtrl.focus($event)"              placeholder="{{placeholder}}"              aria-label="{{placeholder}}"              aria-autocomplete="list"              role="combobox"              aria-haspopup="true"              aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"              aria-owns="ul-{{$mdAutocompleteCtrl.id}}"              ng-attr-aria-activedescendant="{{$mdAutocompleteCtrl.index >= 0 ? \'selected_option\' : undefined}}">') + '          <button type="button" aria-label="Clear Input" tabindex="-1" ng-if="clearButton && $mdAutocompleteCtrl.scope.searchText" ng-click="$mdAutocompleteCtrl.clear($event)"><md-icon md-svg-src="' + c.mdClose + '"></md-icon></button>          <md-progress-linear              class="' + (e.mdFloatingLabel ? "md-inline" : "") + '"              ng-if="$mdAutocompleteCtrl.loadingIsVisible()"              md-mode="indeterminate"></md-progress-linear>          ' + function(e, t) {
+                                if (e = e ? " " + e : "", l(t)) return '            <div                 ng-hide="$mdAutocompleteCtrl.hidden"                class="md-standard-list-container md-autocomplete-suggestions-container md-whiteframe-z1' + e + '"                ng-class="{ \'md-not-found\': $mdAutocompleteCtrl.notFoundVisible() }"                role="presentation">              <div class="md-standard-list-scroller" role="presentation">';
+                                return '          <md-virtual-repeat-container              md-auto-shrink              md-auto-shrink-min="1"              ng-hide="$mdAutocompleteCtrl.hidden"              class="md-virtual-repeat-container md-autocomplete-suggestions-container md-whiteframe-z1' + e + '"              ng-class="{ \'md-not-found\': $mdAutocompleteCtrl.notFoundVisible() }"              role="presentation">'
+                            }(e.mdMenuContainerClass, e.mdMode) + '            <ul class="md-autocomplete-suggestions"                ng-class="::menuClass"                id="ul-{{$mdAutocompleteCtrl.id}}"                ng-mouseenter="$mdAutocompleteCtrl.listEnter()"                ng-mouseleave="$mdAutocompleteCtrl.listLeave()"                ng-mouseup="$mdAutocompleteCtrl.mouseUp()"                role="listbox">              <li ' + (l(e.mdMode) ? "ng-repeat" : "md-virtual-repeat") + ' ="item in $mdAutocompleteCtrl.matches"                  ng-class="{ selected: $index === $mdAutocompleteCtrl.index }"                  ng-attr-id="{{$index === $mdAutocompleteCtrl.index ? \'selected_option\' : undefined}}"                  ng-click="$mdAutocompleteCtrl.select($index)"                  role="option"                  aria-setsize="{{$mdAutocompleteCtrl.matches.length}}"                  aria-posinset="{{$index+1}}"                  aria-selected="{{$index === $mdAutocompleteCtrl.index ? true : false}}"                   md-extra-name="$mdAutocompleteCtrl.itemName">                  ' + o + "                  </li>" + i + "            </ul>          " + (l(e.mdMode) ? "   </div>              </div>            </div>" : "</md-virtual-repeat-container>") + "        </md-autocomplete-wrap>";
 
-                                function s() {
-                                    var e, t;
-                                    if (!i) return i = !0, f && h && r.off(f, h), v(r, l), $(e = r, t = l), w(e, t), k(c, function(e) {
-                                        u.style[S(e[0])] = ""
-                                    }), n.complete(!0), n
+                            function l(e) {
+                                return d(e) !== u
+                            }
+                        }
+                    }
+                }
+                e.$inject = ["$$mdSvgRegistry"], ue.module("material.components.autocomplete").directive("mdAutocomplete", e)
+            }(),
+            function() {
+                function e(e, u) {
+                    return {
+                        restrict: "AE",
+                        compile: function(e, t, c) {
+                            return function(n, t, e) {
+                                var r, i, o = n.$mdAutocompleteCtrl,
+                                    a = o.parent.$new(),
+                                    s = o.itemName;
+
+                                function l(e, t) {
+                                    a[t] = n[e], n.$watch(e, function(e) {
+                                        u.nextTick(function() {
+                                            a[t] = e
+                                        })
+                                    })
                                 }
+                                l("$index", "$index"), l("item", s), i = r = !1, n.$watch(function() {
+                                    i || r || (r = !0, n.$$postDigest(function() {
+                                        i || a.$digest(), r = i = !1
+                                    }))
+                                }), a.$watch(function() {
+                                    i = !0
+                                }), c(a, function(e) {
+                                    t.after(e)
+                                })
                             }
+                        },
+                        terminal: !0,
+                        transclude: "element"
+                    }
+                }
+                e.$inject = ["$compile", "$mdUtil"], ue.module("material.components.autocomplete").directive("mdAutocompleteParentScope", e)
+            }(),
+            function() {
+                function e(e, t, n) {
+                    this.$scope = e, this.$element = t, this.$attrs = n, this.regex = null
+                }
+                e.$inject = ["$scope", "$element", "$attrs"], ue.module("material.components.autocomplete").controller("MdHighlightCtrl", e), e.prototype.init = function(t, n) {
+                    this.flags = this.$attrs.mdHighlightFlags || "", this.unregisterFn = this.$scope.$watch(function(e) {
+                        return {
+                            term: t(e),
+                            contentText: n(e)
                         }
+                    }.bind(this), this.onRender.bind(this), !0), this.$element.on("$destroy", this.unregisterFn)
+                }, e.prototype.onRender = function(e, t) {
+                    var n = e.contentText;
+                    null !== this.regex && e.term === t.term || (this.regex = this.createRegex(e.term, this.flags)), e.term ? this.applyRegex(n) : this.$element.text(n)
+                }, e.prototype.applyRegex = function(e) {
+                    var t = this.resolveTokens(e);
+                    this.$element.empty(), t.forEach(function(e) {
+                        if (e.isMatch) {
+                            var t = ue.element('<span class="highlight">').text(e.text);
+                            this.$element.append(t)
+                        } else this.$element.append(document.createTextNode(e))
+                    }.bind(this))
+                }, e.prototype.resolveTokens = function(r) {
+                    var i = [],
+                        n = 0;
+                    return r.replace(this.regex, function(e, t) {
+                        o(n, t), i.push({
+                            text: e,
+                            isMatch: !0
+                        }), n = t + e.length
+                    }), o(n), i;
+
+                    function o(e, t) {
+                        var n = r.slice(e, t);
+                        n && i.push(n)
                     }
-                }])
-            }(), se.module("material.components.autocomplete", ["material.core", "material.components.icon", "material.components.virtualRepeat"]), se.module("material.components.backdrop", ["material.core"]).directive("mdBackdrop", ["$mdTheming", "$mdUtil", "$animate", "$rootElement", "$window", "$log", "$$rAF", "$document", function(s, l, t, n, c, u, d, f) {
+                }, e.prototype.createRegex = function(e, t) {
+                    var n = "",
+                        r = "",
+                        i = this.sanitizeRegex(e);
+                    return 0 <= t.indexOf("^") && (n = "^"), 0 <= t.indexOf("$") && (r = "$"), new RegExp(n + i + r, t.replace(/[$^]/g, ""))
+                }, e.prototype.sanitizeRegex = function(e) {
+                    return e && e.toString().replace(/[\\^$*+?.()|{}[\]]/g, "\\$&")
+                }
+            }(),
+            function() {
+                function e(n, r) {
+                    return {
+                        terminal: !0,
+                        controller: "MdHighlightCtrl",
+                        compile: function(e, t) {
+                            var i = r(t.mdHighlightText),
+                                o = n(e.html());
+                            return function(e, t, n, r) {
+                                r.init(i, o)
+                            }
+                        }
+                    }
+                }
+                e.$inject = ["$interpolate", "$parse"], ue.module("material.components.autocomplete").directive("mdHighlightText", e)
+            }(), ue.module("material.components.backdrop", ["material.core"]).directive("mdBackdrop", ["$mdTheming", "$mdUtil", "$animate", "$rootElement", "$window", "$log", "$$rAF", "$document", function(s, l, t, n, c, u, d, f) {
                 return {
                     restrict: "E",
                     link: function(r, i, e) {
                                 var e = l.debounce(function() {
                                     o = c.getComputedStyle(f[0].body), a()
                                 }, 60, null, !1);
-                                a(), se.element(c).on("resize", e), r.$on("$destroy", function() {
-                                    se.element(c).off("resize", e)
+                                a(), ue.element(c).on("resize", e), r.$on("$destroy", function() {
+                                    ue.element(c).off("resize", e)
                                 })
                             }
                             var t = i.parent();
                                 }), o.inherit(f, n.parent), i.enter(f, n.parent, null));
                                 o.inherit(t, n.parent), n.disableParentScroll && (n.restoreScroll = s.disableScrollAround(t, n.parent));
                                 return i.enter(t, n.parent, f).then(function() {
-                                    var e = s.findFocusTarget(t) || se.element(t[0].querySelector("button") || t[0].querySelector("a") || t[0].querySelector(s.prefixer("ng-click", !0))) || f;
+                                    var e = s.findFocusTarget(t) || ue.element(t[0].querySelector("button") || t[0].querySelector("a") || t[0].querySelector(s.prefixer("ng-click", !0))) || f;
                                     n.escapeToClose && (n.rootElementKeyupCallback = function(e) {
                                         e.keyCode === a.KEY_CODE.ESCAPE && s.nextTick(l.cancel, !0)
                                     }, c.on("keyup", n.rootElementKeyupCallback), e && e.focus())
                         }
                     }
                 }
-                e.$inject = ["$mdBottomSheet"], t.$inject = ["$$interimElementProvider"], se.module("material.components.bottomSheet", ["material.core", "material.components.backdrop"]).directive("mdBottomSheet", e).provider("$mdBottomSheet", t)
+                e.$inject = ["$mdBottomSheet"], t.$inject = ["$$interimElementProvider"], ue.module("material.components.bottomSheet", ["material.core", "material.components.backdrop"]).directive("mdBottomSheet", e).provider("$mdBottomSheet", t)
             }(),
             function() {
                 function e(n) {
                             }
                         },
                         link: function(e, t, n) {
-                            i(t), r.attach(e, t), o.expectWithoutText(t, "aria-label"), s(n) && se.isDefined(n.ngDisabled) && e.$watch(n.ngDisabled, function(e) {
+                            i(t), r.attach(e, t), o.expectWithoutText(t, "aria-label"), s(n) && ue.isDefined(n.ngDisabled) && !t.hasClass("_md-nav-button") && e.$watch(n.ngDisabled, function(e) {
                                 t.attr("tabindex", e ? -1 : 0)
                             });
                             t.on("click", function(e) {
                     };
 
                     function s(e) {
-                        return se.isDefined(e.href) || se.isDefined(e.ngHref) || se.isDefined(e.ngLink) || se.isDefined(e.uiSref)
+                        return ue.isDefined(e.href) || ue.isDefined(e.ngHref) || ue.isDefined(e.ngLink) || ue.isDefined(e.uiSref)
                     }
                 }
-                t.$inject = ["$mdButtonInkRipple", "$mdTheming", "$mdAria", "$mdInteraction"], e.$inject = ["$mdTheming"], se.module("material.components.button", ["material.core"]).directive("mdButton", t).directive("a", e)
+                t.$inject = ["$mdButtonInkRipple", "$mdTheming", "$mdAria", "$mdInteraction"], e.$inject = ["$mdTheming"], ue.module("material.components.button", ["material.core"]).directive("mdButton", t).directive("a", e)
             }(),
             function() {
                 function e(r) {
                         }
                     }
                 }
-                e.$inject = ["$mdTheming"], se.module("material.components.card", ["material.core"]).directive("mdCard", e)
+                e.$inject = ["$mdTheming"], ue.module("material.components.card", ["material.core"]).directive("mdCard", e)
             }(),
             function() {
                 function e(p, m, g, v, b, y) {
                                         this.hasAttribute("disabled") && e.stopImmediatePropagation()
                                     })
                                 },
-                                post: function(e, n, r, t) {
-                                    var i, o, a, s, l = t[0],
+                                post: function(e, i, n, t) {
+                                    var r, o, a, s, l = t[0],
                                         c = t[1] || b.fakeNgModel(),
                                         u = t[2];
                                     if (l) {
                                         var d = l.isErrorGetter || function() {
                                             return c.$invalid && (c.$touched || u && u.$submitted)
                                         };
-                                        l.input = n, e.$watch(d, l.setInvalid)
+                                        l.input = i, e.$watch(d, l.setInvalid)
                                     }
 
                                     function f(t) {
-                                        n[0].hasAttribute("disabled") || e.skipToggle || e.$apply(function() {
-                                            var e = r.ngChecked && r.ngClick ? r.checked : !c.$viewValue;
+                                        i[0].hasAttribute("disabled") || e.skipToggle || e.$apply(function() {
+                                            var e = n.ngChecked && n.ngClick ? n.checked : !c.$viewValue;
                                             c.$setViewValue(e, t && t.type), c.$render()
                                         })
                                     }
 
                                     function h(e) {
-                                        (i = !1 !== e) && n.attr("aria-checked", "mixed"), n.toggleClass("md-indeterminate", i)
+                                        (r = !1 !== e) && i.attr("aria-checked", "mixed"), i.toggleClass("md-indeterminate", r)
                                     }
-                                    v(n), n.children().on("focus", function() {
-                                        n.focus()
-                                    }), b.parseAttributeBoolean(r.mdIndeterminate) && (h(), e.$watch(r.mdIndeterminate, h)), r.ngChecked && e.$watch(e.$eval.bind(e, r.ngChecked), function(e) {
+                                    v(i), i.children().on("focus", function() {
+                                        i.focus()
+                                    }), b.parseAttributeBoolean(n.mdIndeterminate) && (h(), e.$watch(n.mdIndeterminate, h)), n.ngChecked && e.$watch(e.$eval.bind(e, n.ngChecked), function(e) {
                                         c.$setViewValue(e), c.$render()
                                     }), o = "ngDisabled", a = "tabindex", s = {
                                         true: "-1",
-                                        false: r.tabindex
-                                    }, r[o] && e.$watch(r[o], function(e) {
-                                        s[e] && n.attr(a, s[e])
-                                    }), m.expectWithText(n, "aria-label"), p.link.pre(e, {
-                                        on: se.noop,
+                                        false: n.tabindex
+                                    }, n[o] && e.$watch(n[o], function(e) {
+                                        s[e] && i.attr(a, s[e])
+                                    }), m.expectWithText(i, "aria-label"), p.link.pre(e, {
+                                        on: ue.noop,
                                         0: {}
-                                    }, r, [c]), n.on("click", f).on("keypress", function(e) {
-                                        var t = e.which || e.keyCode;
-                                        t !== g.KEY_CODE.SPACE && t !== g.KEY_CODE.ENTER || (e.preventDefault(), n.addClass("md-focused"), f(e))
+                                    }, n, [c]), i.on("click", f).on("keypress", function(e) {
+                                        var t, n, r = e.which || e.keyCode;
+                                        switch (e.preventDefault(), r) {
+                                            case g.KEY_CODE.SPACE:
+                                                i.addClass("md-focused"), f(e);
+                                                break;
+                                            case g.KEY_CODE.ENTER:
+                                                (n = b.getClosest(e.target, "form")) && (t = n.querySelector('button[type="submit"]:enabled, input[type="submit"]:enabled')) && t.click()
+                                        }
                                     }).on("focus", function() {
-                                        "keyboard" === y.getLastInteractionType() && n.addClass("md-focused")
+                                        "keyboard" === y.getLastInteractionType() && i.addClass("md-focused")
                                     }).on("blur", function() {
-                                        n.removeClass("md-focused")
+                                        i.removeClass("md-focused")
                                     }), c.$render = function() {
-                                        n.toggleClass("md-checked", !!c.$viewValue && !i)
+                                        i.toggleClass("md-checked", !!c.$viewValue && !r)
                                     }
                                 }
                             }
                         }
                     }
                 }
-                e.$inject = ["inputDirective", "$mdAria", "$mdConstant", "$mdTheming", "$mdUtil", "$mdInteraction"], se.module("material.components.checkbox", ["material.core"]).directive("mdCheckbox", e)
-            }(), se.module("material.components.chips", ["material.core", "material.components.autocomplete"]),
+                e.$inject = ["inputDirective", "$mdAria", "$mdConstant", "$mdTheming", "$mdUtil", "$mdInteraction"], ue.module("material.components.checkbox", ["material.core"]).directive("mdCheckbox", e)
+            }(), ue.module("material.components.chips", ["material.core", "material.components.autocomplete"]),
+            function() {
+                function e(e, t, n, r, i) {
+                    this.$scope = e, this.$element = t, this.$mdConstant = n, this.$timeout = r, this.$mdUtil = i, this.isEditing = !1, this.parentController = de, this.enableChipEdit = !1
+                }
+                e.$inject = ["$scope", "$element", "$mdConstant", "$timeout", "$mdUtil"], ue.module("material.components.chips").controller("MdChipCtrl", e), e.prototype.init = function(e) {
+                    this.parentController = e, this.enableChipEdit = this.parentController.enableChipEdit, this.enableChipEdit && (this.$element.on("keydown", this.chipKeyDown.bind(this)), this.$element.on("dblclick", this.chipMouseDoubleClick.bind(this)), this.getChipContent().addClass("_md-chip-content-edit-is-enabled"))
+                }, e.prototype.getChipContent = function() {
+                    var e = this.$element[0].getElementsByClassName("md-chip-content");
+                    return ue.element(e[0])
+                }, e.prototype.getContentElement = function() {
+                    var e = ue.element(this.getChipContent().children()[0]);
+                    return e && 0 !== e.length || (e = ue.element(this.getChipContent().contents()[0])), e
+                }, e.prototype.getChipIndex = function() {
+                    return parseInt(this.$element.attr("index"))
+                }, e.prototype.goOutOfEditMode = function() {
+                    if (this.isEditing) {
+                        this.isEditing = !1, this.$element.removeClass("_md-chip-editing"), this.getChipContent()[0].contentEditable = "false";
+                        var e = this.getChipIndex(),
+                            t = this.getContentElement().text();
+                        t ? (this.parentController.updateChipContents(e, t), this.$mdUtil.nextTick(function() {
+                            this.parentController.selectedChip === e && this.parentController.focusChip(e)
+                        }.bind(this))) : this.parentController.removeChipAndFocusInput(e)
+                    }
+                }, e.prototype.selectNodeContents = function(e) {
+                    var t, n;
+                    document.body.createTextRange ? ((t = document.body.createTextRange()).moveToElementText(e), t.select()) : F.getSelection && (n = F.getSelection(), (t = document.createRange()).selectNodeContents(e), n.removeAllRanges(), n.addRange(t))
+                }, e.prototype.goInEditMode = function() {
+                    this.isEditing = !0, this.$element.addClass("_md-chip-editing"), this.getChipContent()[0].contentEditable = "true", this.getChipContent().on("blur", function() {
+                        this.goOutOfEditMode()
+                    }.bind(this)), this.selectNodeContents(this.getChipContent()[0])
+                }, e.prototype.chipKeyDown = function(e) {
+                    this.isEditing || e.keyCode !== this.$mdConstant.KEY_CODE.ENTER && e.keyCode !== this.$mdConstant.KEY_CODE.SPACE ? this.isEditing && e.keyCode === this.$mdConstant.KEY_CODE.ENTER && (e.preventDefault(), this.goOutOfEditMode()) : (e.preventDefault(), this.goInEditMode())
+                }, e.prototype.chipMouseDoubleClick = function() {
+                    this.enableChipEdit && !this.isEditing && this.goInEditMode()
+                }
+            }(),
+            function() {
+                function e(s, e, t, l) {
+                    return {
+                        restrict: "E",
+                        require: ["^?mdChips", "mdChip"],
+                        link: function(e, t, n, r) {
+                            var i = r.shift(),
+                                o = r.shift(),
+                                a = ue.element(t[0].querySelector(".md-chip-content"));
+                            s(t), i && (o.init(i), a.on("blur", function() {
+                                i.resetSelectedChip(), i.$scope.$applyAsync()
+                            }));
+                            l(function() {
+                                i && i.shouldFocusLastChip && i.focusLastChipThenInput()
+                            })
+                        },
+                        controller: "MdChipCtrl"
+                    }
+                }
+                e.$inject = ["$mdTheming", "$mdUtil", "$compile", "$timeout"], ue.module("material.components.chips").directive("mdChip", e)
+            }(),
+            function() {
+                function e(i) {
+                    return {
+                        restrict: "A",
+                        require: "^mdChips",
+                        scope: !1,
+                        link: function(t, e, n, r) {
+                            e.on("click", function(e) {
+                                t.$apply(function() {
+                                    r.removeChip(t.$$replacedScope.$index)
+                                })
+                            }), i(function() {
+                                e.attr({
+                                    tabindex: "-1",
+                                    "aria-hidden": "true"
+                                }), e.find("button").attr("tabindex", "-1")
+                            })
+                        }
+                    }
+                }
+                e.$inject = ["$timeout"], ue.module("material.components.chips").directive("mdChipRemove", e)
+            }(),
+            function() {
+                function e(a) {
+                    return {
+                        restrict: "EA",
+                        terminal: !0,
+                        link: function(e, t, n) {
+                            var r = e.$parent.$mdChipsCtrl,
+                                i = r.parent.$new(!1, r.parent);
+                            i.$$replacedScope = e, i.$chip = e.$chip, i.$index = e.$index;
+                            var o = (i.$mdChipsCtrl = r).$scope.$eval(n.mdChipTransclude);
+                            t.html(o), a(t.contents())(i)
+                        },
+                        scope: !1
+                    }
+                }
+                e.$inject = ["$compile"], ue.module("material.components.chips").directive("mdChipTransclude", e)
+            }(),
+            function() {
+                e.$inject = ["$scope", "$attrs", "$mdConstant", "$log", "$element", "$timeout", "$mdUtil", "$mdLiveAnnouncer", "$exceptionHandler"];
+                var c = 300;
+
+                function e(e, t, n, r, i, o, a, s, l) {
+                    this.$timeout = o, this.$mdConstant = n, this.$scope = e, this.parent = e.$parent, this.$mdUtil = a, this.$log = r, this.$mdLiveAnnouncer = s, this.$exceptionHandler = l, this.$element = i, this.$attrs = t, this.ngModelCtrl = null, this.userInputNgModelCtrl = null, this.autocompleteCtrl = null, this.userInputElement = null, this.items = [], this.selectedChip = -1, this.enableChipEdit = a.parseAttributeBoolean(t.mdEnableChipEdit), this.addOnBlur = a.parseAttributeBoolean(t.mdAddOnBlur), this.inputAriaLabel = "Chips input.", this.containerHint = "Chips container. Use arrow keys to select chips.", this.containerEmptyHint = "Chips container. Enter the text area, then type text, and press enter to add a chip.", this.deleteHint = "Press delete to remove this chip.", this.deleteButtonLabel = "Remove", this.chipBuffer = "", this.useTransformChip = !1, this.useOnAdd = !1, this.useOnRemove = !1, this.wrapperId = "", this.contentIds = [], this.ariaTabIndex = null, this.chipAppendDelay = c, this.deRegister = [], this.addedMessage = "added", this.removedMessage = "removed", this.init()
+                }
+                ue.module("material.components.chips").controller("MdChipsCtrl", e), e.prototype.init = function() {
+                    var t = this;
+                    this.wrapperId = "_md-chips-wrapper-" + this.$mdUtil.nextUid(), this.$element.attr("ng-model") || this.setupStaticChips(), this.deRegister.push(this.$scope.$watchCollection("$mdChipsCtrl.items", function() {
+                        t.setupInputAria(), t.setupWrapperAria()
+                    })), this.deRegister.push(this.$attrs.$observe("mdChipAppendDelay", function(e) {
+                        t.chipAppendDelay = parseInt(e) || c
+                    }))
+                }, e.prototype.$onDestroy = function() {
+                    for (var e; e = this.deRegister.pop();) e.call(this)
+                }, e.prototype.setupInputAria = function() {
+                    var e = this.$element.find("input");
+                    e && (e.attr("role", "textbox"), e.attr("aria-multiline", !0), this.inputAriaDescribedBy && e.attr("aria-describedby", this.inputAriaDescribedBy), this.inputAriaLabelledBy ? (e.attr("aria-labelledby", this.inputAriaLabelledBy), e.removeAttr("aria-label")) : e.attr("aria-label", this.inputAriaLabel))
+                }, e.prototype.setupWrapperAria = function() {
+                    var e = this,
+                        t = this.$element.find("md-chips-wrap");
+                    this.items && this.items.length ? (t.attr("role", "listbox"), this.contentIds = this.items.map(function() {
+                        return e.wrapperId + "-chip-" + e.$mdUtil.nextUid()
+                    }), t.attr("aria-owns", this.contentIds.join(" ")), t.attr("aria-label", this.containerHint)) : (t.removeAttr("role"), t.removeAttr("aria-owns"), t.attr("aria-label", this.containerEmptyHint))
+                }, e.prototype.setupStaticChips = function() {
+                    var e, t, n = this,
+                        r = this.$element.find("md-chips-wrap");
+                    this.$timeout(function() {
+                        for (r.attr("role", "list"), t = r[0].children, e = 0; e < t.length; e++) t[e].setAttribute("role", "listitem"), t[e].setAttribute("aria-setsize", t.length);
+                        n.inputAriaDescribedBy && r.attr("aria-describedby", n.inputAriaDescribedBy), n.inputAriaLabelledBy ? (r.attr("aria-labelledby", n.inputAriaLabelledBy), r.removeAttr("aria-label")) : r.attr("aria-label", n.inputAriaLabel)
+                    }, 10)
+                }, e.prototype.inputKeydown = function(e) {
+                    var t = this.getChipBuffer();
+                    if (!(this.autocompleteCtrl && e.isDefaultPrevented && e.isDefaultPrevented())) {
+                        if (e.keyCode === this.$mdConstant.KEY_CODE.BACKSPACE) {
+                            if (0 !== this.getCursorPosition(e.target)) return;
+                            return e.preventDefault(), e.stopPropagation(), void(this.items.length && this.selectAndFocusChipSafe(this.items.length - 1))
+                        }
+                        if ((!this.separatorKeys || this.separatorKeys.length < 1) && (this.separatorKeys = [this.$mdConstant.KEY_CODE.ENTER]), -1 !== this.separatorKeys.indexOf(e.keyCode)) {
+                            if (this.autocompleteCtrl && this.requireMatch || !t) return;
+                            if (e.preventDefault(), this.hasMaxChipsReached()) return;
+                            return this.appendChip(t.trim()), this.resetChipBuffer(), !1
+                        }
+                    }
+                }, e.prototype.getCursorPosition = function(t) {
+                    try {
+                        if (t.selectionStart === t.selectionEnd) return t.selectionStart
+                    } catch (e) {
+                        if (!t.value) return 0
+                    }
+                }, e.prototype.updateChipContents = function(e, t) {
+                    0 <= e && e < this.items.length && (this.items[e] = t, this.updateNgModel(!0))
+                }, e.prototype.isEditingChip = function() {
+                    return !!this.$element[0].querySelector("._md-chip-editing")
+                }, e.prototype._isChipObject = function(e) {
+                    return ue.isObject(e)
+                }, e.prototype.isRemovable = function() {
+                    return !!this.ngModelCtrl && (this.readonly ? this.removable : !ue.isDefined(this.removable) || this.removable)
+                }, e.prototype.chipKeydown = function(e) {
+                    if (!this.getChipBuffer() && !this.isEditingChip()) switch (e.keyCode) {
+                        case this.$mdConstant.KEY_CODE.BACKSPACE:
+                        case this.$mdConstant.KEY_CODE.DELETE:
+                            if (this.selectedChip < 0) return;
+                            if (e.preventDefault(), !this.isRemovable()) return;
+                            this.removeAndSelectAdjacentChip(this.selectedChip, e);
+                            break;
+                        case this.$mdConstant.KEY_CODE.LEFT_ARROW:
+                            e.preventDefault(), (this.selectedChip < 0 || this.readonly && 0 === this.selectedChip) && (this.selectedChip = this.items.length), this.items.length && this.selectAndFocusChipSafe(this.selectedChip - 1);
+                            break;
+                        case this.$mdConstant.KEY_CODE.RIGHT_ARROW:
+                            e.preventDefault(), this.selectAndFocusChipSafe(this.selectedChip + 1);
+                            break;
+                        case this.$mdConstant.KEY_CODE.ESCAPE:
+                        case this.$mdConstant.KEY_CODE.TAB:
+                            if (this.selectedChip < 0) return;
+                            e.preventDefault(), this.onFocus()
+                    }
+                }, e.prototype.getPlaceholder = function() {
+                    return this.items && this.items.length && ("" === this.secondaryPlaceholder || this.secondaryPlaceholder) ? this.secondaryPlaceholder : this.placeholder
+                }, e.prototype.removeAndSelectAdjacentChip = function(e, t) {
+                    var n = this,
+                        r = n.getAdjacentChipIndex(e);
+                    this.$element[0].querySelector("md-chips-wrap"), this.$element[0].querySelector('md-chip[index="' + e + '"]');
+                    n.removeChip(e, t), n.$timeout(function() {
+                        n.$timeout(function() {
+                            n.selectAndFocusChipSafe(r)
+                        })
+                    })
+                }, e.prototype.resetSelectedChip = function() {
+                    this.selectedChip = -1, this.ariaTabIndex = null
+                }, e.prototype.getAdjacentChipIndex = function(e) {
+                    var t = this.items.length - 1;
+                    return 0 === t ? -1 : e === t ? e - 1 : e
+                }, e.prototype.appendChip = function(t) {
+                    if (this.shouldFocusLastChip = !this.addOnBlur, this.useTransformChip && this.transformChip) {
+                        var e = this.transformChip({
+                            $chip: t
+                        });
+                        ue.isDefined(e) && (t = e)
+                    }
+                    if (ue.isObject(t) && this.items.some(function(e) {
+                            return ue.equals(t, e)
+                        })) return;
+                    if (!(null == t || this.items.indexOf(t) + 1)) {
+                        var n = this.items.push(t) - 1;
+                        this.updateNgModel();
+                        var r = ue.isObject(t) ? "" : t;
+                        this.$mdLiveAnnouncer.announce(r + " " + this.addedMessage, "assertive"), this.useOnAdd && this.onAdd && this.onAdd({
+                            $chip: t,
+                            $index: n
+                        })
+                    }
+                }, e.prototype.useTransformChipExpression = function() {
+                    this.useTransformChip = !0
+                }, e.prototype.useOnAddExpression = function() {
+                    this.useOnAdd = !0
+                }, e.prototype.useOnRemoveExpression = function() {
+                    this.useOnRemove = !0
+                }, e.prototype.useOnSelectExpression = function() {
+                    this.useOnSelect = !0
+                }, e.prototype.getChipBuffer = function() {
+                    var e = this.userInputElement ? this.userInputNgModelCtrl ? this.userInputNgModelCtrl.$viewValue : this.userInputElement[0].value : this.chipBuffer;
+                    return ue.isString(e) ? e : ""
+                }, e.prototype.resetChipBuffer = function() {
+                    this.userInputElement ? this.userInputNgModelCtrl ? (this.userInputNgModelCtrl.$setViewValue(""), this.userInputNgModelCtrl.$render()) : this.userInputElement[0].value = "" : this.chipBuffer = ""
+                }, e.prototype.hasMaxChipsReached = function() {
+                    return ue.isString(this.maxChips) && (this.maxChips = parseInt(this.maxChips, 10) || 0), 0 < this.maxChips && this.items.length >= this.maxChips
+                }, e.prototype.validateModel = function() {
+                    this.ngModelCtrl.$setValidity("md-max-chips", !this.hasMaxChipsReached()), this.ngModelCtrl.$validate()
+                }, e.prototype.updateNgModel = function(e) {
+                    e || this.validateModel(), ue.forEach(this.ngModelCtrl.$viewChangeListeners, function(e) {
+                        try {
+                            e()
+                        } catch (e) {
+                            this.$exceptionHandler(e)
+                        }
+                    })
+                }, e.prototype.removeChip = function(e, t) {
+                    var n = this.items.splice(e, 1);
+                    this.updateNgModel(), this.ngModelCtrl.$setDirty();
+                    var r = ue.isObject(n[0]) ? "" : n[0];
+                    this.$mdLiveAnnouncer.announce(r + " " + this.removedMessage, "assertive"), n && n.length && this.useOnRemove && this.onRemove && this.onRemove({
+                        $chip: n[0],
+                        $index: e,
+                        $event: t
+                    })
+                }, e.prototype.removeChipAndFocusInput = function(e, t) {
+                    this.removeChip(e, t), this.autocompleteCtrl ? (this.autocompleteCtrl.hidden = !0, this.$mdUtil.nextTick(this.onFocus.bind(this))) : this.onFocus()
+                }, e.prototype.selectAndFocusChipSafe = function(e) {
+                    if (!this.items.length || -1 === e) return this.focusInput();
+                    if (e >= this.items.length) {
+                        if (!this.readonly) return this.onFocus();
+                        e = 0
+                    }
+                    e = Math.max(e, 0), e = Math.min(e, this.items.length - 1), this.selectChip(e), this.focusChip(e)
+                }, e.prototype.focusLastChipThenInput = function() {
+                    var e = this;
+                    e.shouldFocusLastChip = !1, e.focusChip(this.items.length - 1), e.$timeout(function() {
+                        e.focusInput()
+                    }, e.chipAppendDelay)
+                }, e.prototype.focusInput = function() {
+                    this.selectChip(-1), this.onFocus()
+                }, e.prototype.selectChip = function(e) {
+                    -1 <= e && e <= this.items.length ? (this.selectedChip = e, this.useOnSelect && this.onSelect && this.onSelect({
+                        $chip: this.items[e]
+                    })) : this.$log.warn("Selected Chip index out of bounds; ignoring.")
+                }, e.prototype.selectAndFocusChip = function(e) {
+                    this.selectChip(e), -1 !== e && this.focusChip(e)
+                }, e.prototype.focusChip = function(e) {
+                    var t = this.$element[0].querySelector('md-chip[index="' + e + '"] .md-chip-content');
+                    this.ariaTabIndex = e, t.focus()
+                }, e.prototype.configureNgModel = function(e) {
+                    this.ngModelCtrl = e;
+                    var t = this;
+                    e.$isEmpty = function(e) {
+                        return !e || 0 === e.length
+                    }, e.$render = function() {
+                        t.items = t.ngModelCtrl.$viewValue
+                    }
+                }, e.prototype.onFocus = function() {
+                    var e = this.$element[0].querySelector("input");
+                    e && e.focus(), this.resetSelectedChip()
+                }, e.prototype.onInputFocus = function() {
+                    this.inputHasFocus = !0, this.setupInputAria(), this.resetSelectedChip()
+                }, e.prototype.onInputBlur = function() {
+                    this.inputHasFocus = !1, this.shouldAddOnBlur() && (this.appendChip(this.getChipBuffer().trim()), this.resetChipBuffer())
+                }, e.prototype.configureInput = function(e) {
+                    var t = e.controller("ngModel"),
+                        n = this;
+                    t && (this.deRegister.push(this.$scope.$watch(function() {
+                        return t.$touched
+                    }, function(e) {
+                        e && n.ngModelCtrl.$setTouched()
+                    })), this.deRegister.push(this.$scope.$watch(function() {
+                        return t.$dirty
+                    }, function(e) {
+                        e && n.ngModelCtrl.$setDirty()
+                    })))
+                }, e.prototype.configureUserInput = function(e) {
+                    var t = (this.userInputElement = e).controller("ngModel");
+                    t !== this.ngModelCtrl && (this.userInputNgModelCtrl = t);
+                    var n = this.$scope,
+                        r = this,
+                        i = function(e, t) {
+                            n.$evalAsync(ue.bind(r, t, e))
+                        };
+                    e.attr({
+                        tabindex: 0
+                    }).on("keydown", function(e) {
+                        i(e, r.inputKeydown)
+                    }).on("focus", function(e) {
+                        i(e, r.onInputFocus)
+                    }).on("blur", function(e) {
+                        i(e, r.onInputBlur)
+                    })
+                }, e.prototype.configureAutocomplete = function(e) {
+                    e && (this.autocompleteCtrl = e, this.$element.attr("container-empty-hint") || (this.containerEmptyHint = "Chips container with autocompletion. Enter the text area, type text to search, and then use the up and down arrow keys to select an option. Press enter to add the selected option as a chip.", this.setupWrapperAria()), e.registerSelectedItemWatcher(ue.bind(this, function(e) {
+                        if (e) {
+                            if (this.hasMaxChipsReached()) return;
+                            this.appendChip(e), this.resetChipBuffer()
+                        }
+                    })), this.$element.find("input").on("focus", ue.bind(this, this.onInputFocus)).on("blur", ue.bind(this, this.onInputBlur)))
+                }, e.prototype.shouldAddOnBlur = function() {
+                    this.validateModel();
+                    var e = this.getChipBuffer().trim(),
+                        t = this.ngModelCtrl.$isEmpty(this.ngModelCtrl.$modelValue) || this.ngModelCtrl.$valid,
+                        n = this.autocompleteCtrl && !this.autocompleteCtrl.hidden;
+                    return this.userInputNgModelCtrl && (t = t && this.userInputNgModelCtrl.$valid), this.addOnBlur && !this.requireMatch && e && t && !n
+                }, e.prototype.hasFocus = function() {
+                    return this.inputHasFocus || 0 <= this.selectedChip
+                }, e.prototype.contentIdFor = function(e) {
+                    return this.contentIds[e]
+                }
+            }(),
+            function() {
+                r.$inject = ["$mdTheming", "$mdUtil", "$compile", "$log", "$timeout", "$$mdSvgRegistry"], ue.module("material.components.chips").directive("mdChips", r);
+                var e = '      <md-chips-wrap          id="{{$mdChipsCtrl.wrapperId}}"          tabindex="{{$mdChipsCtrl.readonly ? 0 : -1}}"          ng-keydown="$mdChipsCtrl.chipKeydown($event)"          ng-class="{ \'md-focused\': $mdChipsCtrl.hasFocus(),                       \'md-readonly\': !$mdChipsCtrl.ngModelCtrl || $mdChipsCtrl.readonly,                      \'md-removable\': $mdChipsCtrl.isRemovable() }"          class="md-chips">        <md-chip ng-repeat="$chip in $mdChipsCtrl.items"            index="{{$index}}"             ng-class="{\'md-focused\': $mdChipsCtrl.selectedChip == $index, \'md-readonly\': !$mdChipsCtrl.ngModelCtrl || $mdChipsCtrl.readonly}">          <div class="md-chip-content"              tabindex="{{$mdChipsCtrl.ariaTabIndex === $index ? 0 : -1}}"              id="{{$mdChipsCtrl.contentIdFor($index)}}"              role="option"              aria-selected="{{$mdChipsCtrl.selectedChip === $index}}"              aria-setsize="{{$mdChipsCtrl.items.length}}"              aria-posinset="{{$index+1}}"              ng-click="!$mdChipsCtrl.readonly && $mdChipsCtrl.focusChip($index)"              aria-label="{{$mdChipsCtrl._isChipObject($chip) ? \'\' : $chip + \'. \'}}{{$mdChipsCtrl.isRemovable() ? \'\' + $mdChipsCtrl.deleteHint : \'\'}}"               ng-focus="!$mdChipsCtrl.readonly && $mdChipsCtrl.selectChip($index)"              md-chip-transclude="$mdChipsCtrl.chipContentsTemplate"></div>          <div ng-if="$mdChipsCtrl.isRemovable()"               class="md-chip-remove-container"               tabindex="-1"               md-chip-transclude="$mdChipsCtrl.chipRemoveTemplate"></div>        </md-chip>        <div class="md-chip-input-container" ng-if="!$mdChipsCtrl.readonly && $mdChipsCtrl.ngModelCtrl">          <div md-chip-transclude="$mdChipsCtrl.chipInputTemplate"></div>        </div>      </md-chips-wrap>',
+                    t = '        <input            class="md-input"            tabindex="0"            aria-label="{{$mdChipsCtrl.inputAriaLabel}}"            placeholder="{{$mdChipsCtrl.getPlaceholder()}}"            ng-model="$mdChipsCtrl.chipBuffer"            ng-focus="$mdChipsCtrl.onInputFocus()"            ng-blur="$mdChipsCtrl.onInputBlur()"            ng-keydown="$mdChipsCtrl.inputKeydown($event)">',
+                    n = "      <span>{{$chip}}</span>",
+                    i = '      <button          class="md-chip-remove"          ng-if="$mdChipsCtrl.isRemovable()"          ng-click="$mdChipsCtrl.removeChipAndFocusInput($$replacedScope.$index, $event)"          type="button"          tabindex="-1"          aria-label="{{$mdChipsCtrl.deleteButtonLabel}}{{$mdChipsCtrl._isChipObject($chip) ? \'\' : \' \' + $chip}}">        <md-icon md-svg-src="{{$mdChipsCtrl.mdCloseIcon}}" aria-hidden="true"></md-icon>      </button>';
+
+                function r(f, h, p, r, m, g) {
+                    var v = {
+                        chips: h.processTemplate(e),
+                        input: h.processTemplate(t),
+                        default: h.processTemplate(n),
+                        remove: h.processTemplate(i)
+                    };
+                    return {
+                        template: function(e, t) {
+                            return t.$mdUserTemplate = e.clone(), v.chips
+                        },
+                        require: ["mdChips"],
+                        restrict: "E",
+                        controller: "MdChipsCtrl",
+                        controllerAs: "$mdChipsCtrl",
+                        bindToController: !0,
+                        compile: function(e, a) {
+                            var n = a.$mdUserTemplate;
+                            a.$mdUserTemplate = null;
+                            var s = t("md-chips>md-chip-template"),
+                                l = t(h.prefixer().buildList("md-chip-remove").map(function(e) {
+                                    return "md-chips>*[" + e + "]"
+                                }).join(",")) || v.remove,
+                                c = s || v.default,
+                                u = t("md-chips>md-autocomplete") || t("md-chips>input") || v.input,
+                                d = n.find("md-chip");
+                            n[0].querySelector("md-chip-template>*[md-chip-remove]") && r.warn("invalid placement of md-chip-remove within md-chip-template.");
+
+                            function t(e) {
+                                if (a.ngModel) {
+                                    var t = n[0].querySelector(e);
+                                    return t && t.outerHTML
+                                }
+                            }
+                            return function(e, t, n, r) {
+                                h.initOptionalProperties(e, a), f(t);
+                                var i = r[0];
+                                if (s && (i.enableChipEdit = !1), i.chipContentsTemplate = c, i.chipRemoveTemplate = l, i.chipInputTemplate = u, i.mdCloseIcon = g.mdClose, t.attr({
+                                        tabindex: -1
+                                    }).on("focus", function() {
+                                        i.onFocus()
+                                    }).on("click", function() {
+                                        i.readonly || -1 !== i.selectedChip || i.onFocus()
+                                    }), a.ngModel && (i.configureNgModel(t.controller("ngModel")), n.mdTransformChip && i.useTransformChipExpression(), n.mdOnAppend && i.useOnAppendExpression(), n.mdOnAdd && i.useOnAddExpression(), n.mdOnRemove && i.useOnRemoveExpression(), n.mdOnSelect && i.useOnSelectExpression(), u !== v.input && e.$watch("$mdChipsCtrl.readonly", function(e) {
+                                        e || h.nextTick(function() {
+                                            if (0 === u.indexOf("<md-autocomplete")) {
+                                                var e = t.find("md-autocomplete");
+                                                i.configureAutocomplete(e.controller("mdAutocomplete"))
+                                            }
+                                            i.configureUserInput(t.find("input"))
+                                        })
+                                    }), h.nextTick(function() {
+                                        var e = t.find("input");
+                                        e && (i.configureInput(e), e.toggleClass("md-input", !0))
+                                    })), 0 < d.length) {
+                                    var o = p(d.clone())(e.$parent);
+                                    m(function() {
+                                        t.find("md-chips-wrap").prepend(o)
+                                    })
+                                }
+                            }
+                        },
+                        scope: {
+                            readonly: "=?readonly",
+                            removable: "=?mdRemovable",
+                            placeholder: "@?",
+                            secondaryPlaceholder: "@?",
+                            maxChips: "@?mdMaxChips",
+                            transformChip: "&mdTransformChip",
+                            onAppend: "&?mdOnAppend",
+                            onAdd: "&?mdOnAdd",
+                            onRemove: "&?mdOnRemove",
+                            addedMessage: "@?mdAddedMessage",
+                            removedMessage: "@?mdRemovedMessage",
+                            onSelect: "&?mdOnSelect",
+                            inputAriaDescribedBy: "@?inputAriaDescribedby",
+                            inputAriaLabelledBy: "@?inputAriaLabelledby",
+                            inputAriaLabel: "@?",
+                            containerHint: "@?",
+                            containerEmptyHint: "@?",
+                            deleteHint: "@?",
+                            deleteButtonLabel: "@?",
+                            separatorKeys: "=?mdSeparatorKeys",
+                            requireMatch: "=?mdRequireMatch",
+                            chipAppendDelayString: "@?mdChipAppendDelay",
+                            ngChange: "&?"
+                        }
+                    }
+                }
+            }(),
+            function() {
+                function e(e, t, n) {
+                    this.$element = t, this.$attrs = e, this.$timeout = n, this.selectedItem = null, this.searchText = "", this.deRegister = [], this.init()
+                }
+                e.$inject = ["$attrs", "$element", "$timeout"], ue.module("material.components.chips").controller("MdContactChipsCtrl", e), e.prototype.init = function() {
+                    var e = this,
+                        t = this.deRegister,
+                        n = this.$element;
+                    this.$timeout(function() {
+                        t.push(n.find("md-chips").scope().$watchCollection("$mdChipsCtrl.items", function() {
+                            e.setupChipsAria(), e.setupAutocompleteAria()
+                        }))
+                    })
+                }, e.prototype.setupChipsAria = function() {
+                    var e = this.$element.find("md-chips"),
+                        t = e.controller("mdChips");
+                    this.removedMessage && (t.removedMessage = this.removedMessage), this.containerHint && (t.containerHint = this.containerHint), this.containerEmptyHint && (e.attr("container-empty-hint", this.containerEmptyHint), t.containerEmptyHint = this.containerEmptyHint), this.deleteHint && (t.deleteHint = this.deleteHint), this.inputAriaLabel && (t.inputAriaLabel = this.inputAriaLabel)
+                }, e.prototype.setupAutocompleteAria = function() {
+                    var e = this.$element.find("md-chips-wrap").find("md-autocomplete").find("input");
+                    this.inputAriaDescribedBy && e.attr("aria-describedby", this.inputAriaDescribedBy), this.inputAriaLabelledBy && (e.removeAttr("aria-label"), e.attr("aria-labelledby", this.inputAriaLabelledBy))
+                }, e.prototype.queryContact = function(e) {
+                    return this.contactQuery({
+                        $query: e
+                    })
+                }, e.prototype.inputKeydown = function(e) {
+                    if (this.separatorKeys && !(this.separatorKeys.indexOf(e.keyCode) < 0)) {
+                        e.stopPropagation(), e.preventDefault();
+                        var t = ue.element(e.target).controller("mdAutocomplete");
+                        t.select(t.index)
+                    }
+                }, e.prototype.itemName = function(e) {
+                    return e[this.contactName]
+                }, e.prototype.$onDestroy = function() {
+                    for (var e; e = this.deRegister.pop();) e.call(this)
+                }
+            }(),
+            function() {
+                e.$inject = ["$mdTheming", "$mdUtil"], ue.module("material.components.chips").directive("mdContactChips", e);
+                var n = '      <md-chips class="md-contact-chips"          ng-model="$mdContactChipsCtrl.contacts"          ng-change="$mdContactChipsCtrl.ngChange($mdContactChipsCtrl.contacts)"          md-require-match="$mdContactChipsCtrl.requireMatch"          md-chip-append-delay="{{$mdContactChipsCtrl.chipAppendDelay}}"          md-separator-keys="$mdContactChipsCtrl.separatorKeys"          md-autocomplete-snap>          <md-autocomplete              md-menu-class="md-contact-chips-suggestions"              md-selected-item="$mdContactChipsCtrl.selectedItem"              md-search-text="$mdContactChipsCtrl.searchText"              md-items="item in $mdContactChipsCtrl.queryContact($mdContactChipsCtrl.searchText)"              md-item-text="$mdContactChipsCtrl.itemName(item)"              md-no-cache="true"              md-min-length="$mdContactChipsCtrl.minLength"              md-autoselect              ng-keydown="$mdContactChipsCtrl.inputKeydown($event)"              placeholder="{{$mdContactChipsCtrl.contacts.length === 0 ?                  $mdContactChipsCtrl.placeholder : $mdContactChipsCtrl.secondaryPlaceholder}}">            <div class="md-contact-suggestion">              <img                   ng-src="{{item[$mdContactChipsCtrl.contactImage]}}"                  alt="{{item[$mdContactChipsCtrl.contactName]}}"                  ng-if="item[$mdContactChipsCtrl.contactImage]" />              <span class="md-contact-name" md-highlight-text="$mdContactChipsCtrl.searchText"                    md-highlight-flags="{{$mdContactChipsCtrl.highlightFlags}}">                {{item[$mdContactChipsCtrl.contactName]}}              </span>              <span class="md-contact-email" >{{item[$mdContactChipsCtrl.contactEmail]}}</span>            </div>          </md-autocomplete>          <md-chip-template>            <div class="md-contact-avatar">              <img                   ng-src="{{$chip[$mdContactChipsCtrl.contactImage]}}"                  alt="{{$chip[$mdContactChipsCtrl.contactName]}}"                  ng-if="$chip[$mdContactChipsCtrl.contactImage]" />            </div>            <div class="md-contact-name">              {{$chip[$mdContactChipsCtrl.contactName]}}            </div>          </md-chip-template>      </md-chips>';
+
+                function e(a, s) {
+                    return {
+                        template: function(e, t) {
+                            return n
+                        },
+                        restrict: "E",
+                        controller: "MdContactChipsCtrl",
+                        controllerAs: "$mdContactChipsCtrl",
+                        bindToController: !0,
+                        compile: function(e, o) {
+                            return function(e, t, n, r) {
+                                var i = r;
+                                s.initOptionalProperties(e, o), a(t), t.attr("tabindex", "-1"), n.$observe("mdChipAppendDelay", function(e) {
+                                    i.chipAppendDelay = e
+                                })
+                            }
+                        },
+                        scope: {
+                            contactQuery: "&mdContacts",
+                            placeholder: "@?",
+                            secondaryPlaceholder: "@?",
+                            contactName: "@mdContactName",
+                            contactImage: "@mdContactImage",
+                            contactEmail: "@mdContactEmail",
+                            contacts: "=ngModel",
+                            ngChange: "&?",
+                            requireMatch: "=?mdRequireMatch",
+                            minLength: "=?mdMinLength",
+                            highlightFlags: "@?mdHighlightFlags",
+                            chipAppendDelay: "@?mdChipAppendDelay",
+                            separatorKeys: "=?mdSeparatorKeys",
+                            removedMessage: "@?mdRemovedMessage",
+                            inputAriaDescribedBy: "@?inputAriaDescribedby",
+                            inputAriaLabelledBy: "@?inputAriaLabelledby",
+                            inputAriaLabel: "@?",
+                            containerHint: "@?",
+                            containerEmptyHint: "@?",
+                            deleteHint: "@?"
+                        }
+                    }
+                }
+            }(),
             function() {
                 t.$inject = ["$mdColors", "$mdUtil", "$log", "$parse"], e.$inject = ["$mdTheming", "$mdUtil", "$log"];
                 var a = /^{((\s|,)*?["'a-zA-Z-]+?\s*?:\s*?('|")[a-zA-Z0-9-.]*('|"))+\s*}$/,
                     return c = c || Object.keys(o.PALETTES), {
                         applyThemeColors: function(e, t) {
                             try {
-                                t && e.css((i = {}, o = (n = t).hasOwnProperty("color"), se.forEach(n, function(e, t) {
+                                t && e.css((i = {}, o = (n = t).hasOwnProperty("color"), ue.forEach(n, function(e, t) {
                                     var n = l(e),
                                         r = -1 < t.indexOf("background");
                                     i[t] = s(n), r && !o && (i.color = s(n, !0))
                             return s(l(e))
                         },
                         hasTheme: function(e) {
-                            return se.isDefined(o.THEMES[e.split("-")[0]])
+                            return ue.isDefined(o.THEMES[e.split("-")[0]])
                         }
                     };
 
 
                     function l(e) {
                         var t = e.split("-"),
-                            n = se.isDefined(o.THEMES[t[0]]) ? t.splice(0, 1)[0] : o.defaultTheme();
+                            n = ue.isDefined(o.THEMES[t[0]]) ? t.splice(0, 1)[0] : o.defaultTheme();
                         return {
                             theme: n,
                             palette: function(e, t) {
                                     t = -1 < e.indexOf("::"),
                                     n = !!t || a.test(i.mdColors);
                                 i.mdColors = e.replace("::", "");
-                                var r = se.isDefined(i.mdColorsWatch);
+                                var r = ue.isDefined(i.mdColorsWatch);
                                 return !t && !n && (!r || o.parseAttributeBoolean(i.mdColorsWatch))
                             }();
                             return function(e, n, t, r) {
                                         }), s(r), r
                                     },
                                     s = function(e) {
-                                        if (!se.equals(e, o)) {
+                                        if (!ue.equals(e, o)) {
                                             var t = Object.keys(o);
                                             o.background && !t.color && t.push("color"), t.forEach(function(e) {
                                                 n.css(e, "")
                                         }
                                         o = e
                                     },
-                                    l = se.noop;
+                                    l = ue.noop;
                                 i && (l = i.registerChanges(function(e) {
                                     u.applyThemeColors(n, a(e))
                                 })), e.$on("$destroy", function() {
                                     l()
                                 });
                                 try {
-                                    c ? e.$watch(a, se.bind(this, u.applyThemeColors, n), !0) : u.applyThemeColors(n, a())
+                                    c ? e.$watch(a, ue.bind(this, u.applyThemeColors, n), !0) : u.applyThemeColors(n, a())
                                 } catch (e) {
                                     d.error(e.message)
                                 }
                         }
                     }
                 }
-                se.module("material.components.colors", ["material.core"]).directive("mdColors", t).service("$mdColors", e)
+                ue.module("material.components.colors", ["material.core"]).directive("mdColors", t).service("$mdColors", e)
             }(),
             function() {
                 function e(r) {
                         }],
                         link: function(e, t) {
                             var n;
-                            t.addClass("_md"), r(t), e.$broadcast("$mdContentLoaded", t), n = t[0], se.element(n).on("$md.pressdown", function(e) {
+                            t.addClass("_md"), r(t), e.$broadcast("$mdContentLoaded", t), n = t[0], ue.element(n).on("$md.pressdown", function(e) {
                                 "t" === e.pointer.type && (e.$materialScrollFixed || (e.$materialScrollFixed = !0, 0 === n.scrollTop ? n.scrollTop = 1 : n.scrollHeight === n.scrollTop + n.offsetHeight && (n.scrollTop -= 1)))
                             })
                         }
                     }
                 }
-                e.$inject = ["$mdTheming"], se.module("material.components.content", ["material.core"]).directive("mdContent", e)
-            }(), se.module("material.components.datepicker", ["material.core", "material.components.icon", "material.components.virtualRepeat"]),
+                e.$inject = ["$mdTheming"], ue.module("material.components.content", ["material.core"]).directive("mdContent", e)
+            }(), ue.module("material.components.datepicker", ["material.core", "material.components.icon", "material.components.virtualRepeat"]),
+            function() {
+                e.$inject = ["$element", "$scope", "$$mdDateUtil", "$mdUtil", "$mdConstant", "$mdTheming", "$$rAF", "$attrs", "$mdDateLocale"], ue.module("material.components.datepicker").directive("mdCalendar", function() {
+                    return {
+                        template: function(e, t) {
+                            var n = t.hasOwnProperty("ngIf") ? "" : 'ng-if="calendarCtrl.isInitialized"',
+                                r = '<div ng-switch="calendarCtrl.currentView" ' + n + '><md-calendar-year ng-switch-when="year"></md-calendar-year><md-calendar-month ng-switch-default></md-calendar-month></div>';
+                            return r
+                        },
+                        scope: {
+                            minDate: "=mdMinDate",
+                            maxDate: "=mdMaxDate",
+                            dateFilter: "=mdDateFilter",
+                            _mode: "@mdMode",
+                            _currentView: "@mdCurrentView"
+                        },
+                        require: ["ngModel", "mdCalendar"],
+                        controller: e,
+                        controllerAs: "calendarCtrl",
+                        bindToController: !0,
+                        link: function(e, t, n, r) {
+                            var i = r[0],
+                                o = r[1];
+                            o.configureNgModel(i)
+                        }
+                    }
+                });
+                var d = 0,
+                    t = {
+                        day: "month",
+                        month: "year"
+                    };
+
+                function e(e, t, n, r, i, o, a, s, l) {
+                    o(e), this.$element = e, this.$scope = t, this.dateUtil = n, this.$mdUtil = r, this.keyCode = i.KEY_CODE, this.$$rAF = a, this.$mdDateLocale = l, this.today = this.dateUtil.createDateAtMidnight(), this.ngModelCtrl = null, this.SELECTED_DATE_CLASS = "md-calendar-selected-date", this.TODAY_CLASS = "md-calendar-date-today", this.FOCUSED_DATE_CLASS = "md-focus", this.id = d++, this.displayDate = null, this.selectedDate = null, this.firstRenderableDate = null, this.lastRenderableDate = null, this.isInitialized = !1, this.width = 0, this.scrollbarWidth = 0, s.tabindex || e.attr("tabindex", "-1");
+                    var c, u = ue.bind(this, this.handleKeyEvent);
+                    (c = e.parent().hasClass("md-datepicker-calendar") ? ue.element(document.body) : e).on("keydown", u), t.$on("$destroy", function() {
+                        c.off("keydown", u)
+                    }), 1 === ue.version.major && ue.version.minor <= 4 && this.$onInit()
+                }
+                e.prototype.$onInit = function() {
+                    this._mode && t.hasOwnProperty(this._mode) ? (this.currentView = t[this._mode], this.mode = this._mode) : (this.currentView = this._currentView || "month", this.mode = null);
+                    var e = this.$mdDateLocale;
+                    this.minDate && this.minDate > e.firstRenderableDate ? this.firstRenderableDate = this.minDate : this.firstRenderableDate = e.firstRenderableDate, this.maxDate && this.maxDate < e.lastRenderableDate ? this.lastRenderableDate = this.maxDate : this.lastRenderableDate = e.lastRenderableDate
+                }, e.prototype.configureNgModel = function(e) {
+                    var t = this;
+                    t.ngModelCtrl = e, t.$mdUtil.nextTick(function() {
+                        t.isInitialized = !0
+                    }), e.$render = function() {
+                        var e = this.$viewValue;
+                        t.$scope.$broadcast("md-calendar-parent-changed", e), t.selectedDate || (t.selectedDate = e), t.displayDate || (t.displayDate = t.selectedDate || t.today)
+                    }
+                }, e.prototype.setNgModelValue = function(e) {
+                    var t = this.dateUtil.createDateAtMidnight(e);
+                    return this.focus(t), this.$scope.$emit("md-calendar-change", t), this.ngModelCtrl.$setViewValue(t), this.ngModelCtrl.$render(), t
+                }, e.prototype.setCurrentView = function(e, t) {
+                    var n = this;
+                    n.$mdUtil.nextTick(function() {
+                        n.currentView = e, t && (n.displayDate = ue.isDate(t) ? t : new Date(t))
+                    })
+                }, e.prototype.focus = function(e) {
+                    if (this.dateUtil.isValidDate(e)) {
+                        var t = this.$element[0].querySelector("." + this.FOCUSED_DATE_CLASS);
+                        t && t.classList.remove(this.FOCUSED_DATE_CLASS);
+                        var n = this.getDateId(e, this.currentView),
+                            r = document.getElementById(n);
+                        r && (r.classList.add(this.FOCUSED_DATE_CLASS), r.focus(), this.displayDate = e)
+                    } else {
+                        var i = this.$element[0].querySelector("[ng-switch]");
+                        i && i.focus()
+                    }
+                }, e.prototype.changeSelectedDate = function(e) {
+                    var t = this.SELECTED_DATE_CLASS,
+                        n = this.$element[0].querySelector("." + t);
+                    if (n && (n.classList.remove(t), n.setAttribute("aria-selected", "false")), e) {
+                        var r = document.getElementById(this.getDateId(e, this.currentView));
+                        r && (r.classList.add(t), r.setAttribute("aria-selected", "true"))
+                    }
+                    this.selectedDate = e
+                }, e.prototype.getActionFromKeyEvent = function(e) {
+                    var t = this.keyCode;
+                    switch (e.which) {
+                        case t.ENTER:
+                            return "select";
+                        case t.RIGHT_ARROW:
+                            return "move-right";
+                        case t.LEFT_ARROW:
+                            return "move-left";
+                        case t.DOWN_ARROW:
+                            return e.metaKey ? "move-page-down" : "move-row-down";
+                        case t.UP_ARROW:
+                            return e.metaKey ? "move-page-up" : "move-row-up";
+                        case t.PAGE_DOWN:
+                            return "move-page-down";
+                        case t.PAGE_UP:
+                            return "move-page-up";
+                        case t.HOME:
+                            return "start";
+                        case t.END:
+                            return "end";
+                        default:
+                            return null
+                    }
+                }, e.prototype.handleKeyEvent = function(t) {
+                    var n = this;
+                    this.$scope.$apply(function() {
+                        if (t.which == n.keyCode.ESCAPE || t.which == n.keyCode.TAB) return n.$scope.$emit("md-calendar-close"), void(t.which == n.keyCode.TAB && t.preventDefault());
+                        var e = n.getActionFromKeyEvent(t);
+                        e && (t.preventDefault(), t.stopPropagation(), n.$scope.$broadcast("md-calendar-parent-action", e))
+                    })
+                }, e.prototype.hideVerticalScrollbar = function(r) {
+                    var i = this,
+                        t = r.$element[0],
+                        o = t.querySelector(".md-calendar-scroll-mask");
+
+                    function n() {
+                        var e = i.width || 340,
+                            t = i.scrollbarWidth,
+                            n = r.calendarScroller;
+                        o.style.width = e + "px", n.style.width = e + t + "px", n.style.paddingRight = t + "px"
+                    }
+                    0 < i.width ? n() : i.$$rAF(function() {
+                        var e = r.calendarScroller;
+                        i.scrollbarWidth = e.offsetWidth - e.clientWidth, i.width = t.querySelector("table").offsetWidth, n()
+                    })
+                }, e.prototype.getDateId = function(e, t) {
+                    if (!t) throw new Error("A namespace for the date id has to be specified.");
+                    return ["md", this.id, t, e.getFullYear(), e.getMonth(), e.getDate()].join("-")
+                }, e.prototype.updateVirtualRepeat = function() {
+                    var e = this.$scope,
+                        t = e.$on("$md-resize-enable", function() {
+                            e.$$phase || e.$apply(), t()
+                        })
+                }
+            }(),
+            function() {
+                t.$inject = ["$element", "$scope", "$animate", "$q", "$$mdDateUtil", "$mdDateLocale"], ue.module("material.components.datepicker").directive("mdCalendarMonth", function() {
+                    return {
+                        template: '<table aria-hidden="true" class="md-calendar-day-header"><thead></thead></table><div class="md-calendar-scroll-mask"><md-virtual-repeat-container class="md-calendar-scroll-container" md-offset-size="' + (e - n) + '"><table role="grid" tabindex="0" class="md-calendar" aria-readonly="true"><tbody md-calendar-month-body role="rowgroup" md-virtual-repeat="i in monthCtrl.items" md-month-offset="$index" class="md-calendar-month" md-start-index="monthCtrl.getSelectedMonthIndex()" md-item-size="' + n + '"><tr aria-hidden="true" md-force-height="\'' + n + "px'\"></tr></tbody></table></md-virtual-repeat-container></div>",
+                        require: ["^^mdCalendar", "mdCalendarMonth"],
+                        controller: t,
+                        controllerAs: "monthCtrl",
+                        bindToController: !0,
+                        link: function(e, t, n, r) {
+                            var i = r[0],
+                                o = r[1];
+                            o.initialize(i)
+                        }
+                    }
+                });
+                var n = 265,
+                    e = 45;
+
+                function t(e, t, n, r, i, o) {
+                    this.$element = e, this.$scope = t, this.$animate = n, this.$q = r, this.dateUtil = i, this.dateLocale = o, this.calendarScroller = e[0].querySelector(".md-virtual-repeat-scroller"), this.isInitialized = !1, this.isMonthTransitionInProgress = !1;
+                    var a = this;
+                    this.cellClickHandler = function() {
+                        var e = i.getTimestampFromNode(this);
+                        a.$scope.$apply(function() {
+                            a.calendarCtrl.setNgModelValue(e)
+                        })
+                    }, this.headerClickHandler = function() {
+                        a.calendarCtrl.setCurrentView("year", i.getTimestampFromNode(this))
+                    }
+                }
+                t.prototype.initialize = function(e) {
+                    this.items = {
+                        length: this.dateUtil.getMonthDistance(e.firstRenderableDate, e.lastRenderableDate) + 2
+                    }, this.calendarCtrl = e, this.attachScopeListeners(), e.updateVirtualRepeat(), e.ngModelCtrl && e.ngModelCtrl.$render()
+                }, t.prototype.getSelectedMonthIndex = function() {
+                    var e = this.calendarCtrl;
+                    return this.dateUtil.getMonthDistance(e.firstRenderableDate, e.displayDate || e.selectedDate || e.today)
+                }, t.prototype.changeDisplayDate = function(e) {
+                    if (!this.isInitialized) return this.buildWeekHeader(), this.calendarCtrl.hideVerticalScrollbar(this), this.isInitialized = !0, this.$q.when();
+                    if (!this.dateUtil.isValidDate(e) || this.isMonthTransitionInProgress) return this.$q.when();
+                    this.isMonthTransitionInProgress = !0;
+                    var t = this.animateDateChange(e);
+                    this.calendarCtrl.displayDate = e;
+                    var n = this;
+                    return t.then(function() {
+                        n.isMonthTransitionInProgress = !1
+                    }), t
+                }, t.prototype.animateDateChange = function(e) {
+                    if (this.dateUtil.isValidDate(e)) {
+                        var t = this.dateUtil.getMonthDistance(this.calendarCtrl.firstRenderableDate, e);
+                        this.calendarScroller.scrollTop = t * n
+                    }
+                    return this.$q.when()
+                }, t.prototype.buildWeekHeader = function() {
+                    for (var e = this.dateLocale.firstDayOfWeek, t = this.dateLocale.shortDays, n = document.createElement("tr"), r = 0; r < 7; r++) {
+                        var i = document.createElement("th");
+                        i.textContent = t[(r + e) % 7], n.appendChild(i)
+                    }
+                    this.$element.find("thead").append(n)
+                }, t.prototype.attachScopeListeners = function() {
+                    var n = this;
+                    n.$scope.$on("md-calendar-parent-changed", function(e, t) {
+                        n.calendarCtrl.changeSelectedDate(t), n.changeDisplayDate(t)
+                    }), n.$scope.$on("md-calendar-parent-action", ue.bind(this, this.handleKeyEvent))
+                }, t.prototype.handleKeyEvent = function(e, t) {
+                    var n = this.calendarCtrl,
+                        r = n.displayDate;
+                    if ("select" === t) n.setNgModelValue(r);
+                    else {
+                        var i = null,
+                            o = this.dateUtil;
+                        switch (t) {
+                            case "move-right":
+                                i = o.incrementDays(r, 1);
+                                break;
+                            case "move-left":
+                                i = o.incrementDays(r, -1);
+                                break;
+                            case "move-page-down":
+                                i = o.incrementMonths(r, 1);
+                                break;
+                            case "move-page-up":
+                                i = o.incrementMonths(r, -1);
+                                break;
+                            case "move-row-down":
+                                i = o.incrementDays(r, 7);
+                                break;
+                            case "move-row-up":
+                                i = o.incrementDays(r, -7);
+                                break;
+                            case "start":
+                                i = o.getFirstDateOfMonth(r);
+                                break;
+                            case "end":
+                                i = o.getLastDateOfMonth(r)
+                        }
+                        i && (i = this.dateUtil.clampDate(i, n.minDate, n.maxDate), this.changeDisplayDate(i).then(function() {
+                            n.focus(i)
+                        }))
+                    }
+                }
+            }(),
+            function() {
+                function e(e, t) {
+                    var s = e('<md-icon md-svg-src="' + t.mdTabsArrow + '"></md-icon>')({})[0];
+                    return {
+                        require: ["^^mdCalendar", "^^mdCalendarMonth", "mdCalendarMonthBody"],
+                        scope: {
+                            offset: "=mdMonthOffset"
+                        },
+                        controller: n,
+                        controllerAs: "mdMonthBodyCtrl",
+                        bindToController: !0,
+                        link: function(e, t, n, r) {
+                            var i = r[0],
+                                o = r[1],
+                                a = r[2];
+                            a.calendarCtrl = i, a.monthCtrl = o, a.arrowIcon = s.cloneNode(!0), e.$watch(function() {
+                                return a.offset
+                            }, function(e) {
+                                ue.isNumber(e) && a.generateContent()
+                            })
+                        }
+                    }
+                }
+
+                function n(e, t, n) {
+                    this.$element = e, this.dateUtil = t, this.dateLocale = n, this.monthCtrl = null, this.calendarCtrl = null, this.offset = null, this.focusAfterAppend = null
+                }
+                e.$inject = ["$compile", "$$mdSvgRegistry"], n.$inject = ["$element", "$$mdDateUtil", "$mdDateLocale"], ue.module("material.components.datepicker").directive("mdCalendarMonthBody", e), n.prototype.generateContent = function() {
+                    var e = this.dateUtil.incrementMonths(this.calendarCtrl.firstRenderableDate, this.offset);
+                    this.$element.empty().append(this.buildCalendarForMonth(e)), this.focusAfterAppend && (this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS), this.focusAfterAppend.focus(), this.focusAfterAppend = null)
+                }, n.prototype.buildDateCell = function(e) {
+                    var t = this.monthCtrl,
+                        n = this.calendarCtrl,
+                        r = document.createElement("td");
+                    if (r.tabIndex = -1, r.classList.add("md-calendar-date"), r.setAttribute("role", "gridcell"), e) {
+                        r.setAttribute("tabindex", "-1"), r.setAttribute("aria-label", this.dateLocale.longDateFormatter(e)), r.id = n.getDateId(e, "month"), r.setAttribute("data-timestamp", e.getTime()), this.dateUtil.isSameDay(e, n.today) && r.classList.add(n.TODAY_CLASS), this.dateUtil.isValidDate(n.selectedDate) && this.dateUtil.isSameDay(e, n.selectedDate) && (r.classList.add(n.SELECTED_DATE_CLASS), r.setAttribute("aria-selected", "true"));
+                        var i = this.dateLocale.dates[e.getDate()];
+                        if (this.isDateEnabled(e)) {
+                            var o = document.createElement("span");
+                            o.classList.add("md-calendar-date-selection-indicator"), o.textContent = i, r.appendChild(o), r.addEventListener("click", t.cellClickHandler), n.displayDate && this.dateUtil.isSameDay(e, n.displayDate) && (this.focusAfterAppend = r)
+                        } else r.classList.add("md-calendar-date-disabled"), r.textContent = i
+                    }
+                    return r
+                }, n.prototype.isDateEnabled = function(e) {
+                    return this.dateUtil.isDateWithinRange(e, this.calendarCtrl.minDate, this.calendarCtrl.maxDate) && (!ue.isFunction(this.calendarCtrl.dateFilter) || this.calendarCtrl.dateFilter(e))
+                }, n.prototype.buildDateRow = function(e) {
+                    var t = document.createElement("tr");
+                    return t.setAttribute("role", "row"), t.setAttribute("aria-label", this.dateLocale.weekNumberFormatter(e)), t
+                }, n.prototype.buildCalendarForMonth = function(e) {
+                    var t = this.dateUtil.isValidDate(e) ? e : new Date,
+                        n = this.dateUtil.getFirstDateOfMonth(t),
+                        r = this.getLocaleDay_(n),
+                        i = this.dateUtil.getNumberOfDaysInMonth(t),
+                        o = document.createDocumentFragment(),
+                        a = 1,
+                        s = this.buildDateRow(a);
+                    o.appendChild(s);
+                    var l = this.offset === this.monthCtrl.items.length - 1,
+                        c = 0,
+                        u = document.createElement("td"),
+                        d = document.createElement("span"),
+                        f = this.calendarCtrl;
+                    if (d.textContent = this.dateLocale.monthHeaderFormatter(t), u.appendChild(d), u.classList.add("md-calendar-month-label"), f.maxDate && n > f.maxDate ? u.classList.add("md-calendar-month-label-disabled") : f.mode || (u.addEventListener("click", this.monthCtrl.headerClickHandler), u.setAttribute("data-timestamp", n.getTime()), u.setAttribute("aria-label", this.dateLocale.monthFormatter(t)), u.classList.add("md-calendar-label-clickable"), u.appendChild(this.arrowIcon.cloneNode(!0))), r <= 2) {
+                        u.setAttribute("colspan", "7");
+                        var h = this.buildDateRow();
+                        if (h.appendChild(u), o.insertBefore(h, s), l) return o
+                    } else c = 3, u.setAttribute("colspan", "3"), s.appendChild(u);
+                    for (var p = c; p < r; p++) s.appendChild(this.buildDateCell());
+                    for (var m = r, g = n, v = 1; v <= i; v++) {
+                        if (7 === m) {
+                            if (l) return o;
+                            m = 0, a++, s = this.buildDateRow(a), o.appendChild(s)
+                        }
+                        g.setDate(v);
+                        var b = this.buildDateCell(g);
+                        s.appendChild(b), m++
+                    }
+                    for (; s.childNodes.length < 7;) s.appendChild(this.buildDateCell());
+                    for (; o.childNodes.length < 6;) {
+                        for (var y = this.buildDateRow(), _ = 0; _ < 7; _++) y.appendChild(this.buildDateCell());
+                        o.appendChild(y)
+                    }
+                    return o
+                }, n.prototype.getLocaleDay_ = function(e) {
+                    return (e.getDay() + (7 - this.dateLocale.firstDayOfWeek)) % 7
+                }
+            }(),
+            function() {
+                e.$inject = ["$element", "$scope", "$animate", "$q", "$$mdDateUtil", "$mdUtil"], ue.module("material.components.datepicker").directive("mdCalendarYear", function() {
+                    return {
+                        template: '<div class="md-calendar-scroll-mask"><md-virtual-repeat-container class="md-calendar-scroll-container"><table role="grid" tabindex="0" class="md-calendar" aria-readonly="true"><tbody md-calendar-year-body role="rowgroup" md-virtual-repeat="i in yearCtrl.items" md-year-offset="$index" class="md-calendar-year" md-start-index="yearCtrl.getFocusedYearIndex()" md-item-size="' + n + '"><tr aria-hidden="true" md-force-height="\'' + n + "px'\"></tr></tbody></table></md-virtual-repeat-container></div>",
+                        require: ["^^mdCalendar", "mdCalendarYear"],
+                        controller: e,
+                        controllerAs: "yearCtrl",
+                        bindToController: !0,
+                        link: function(e, t, n, r) {
+                            var i = r[0],
+                                o = r[1];
+                            o.initialize(i)
+                        }
+                    }
+                });
+                var n = 88;
+
+                function e(e, t, n, r, i, o) {
+                    this.$element = e, this.$scope = t, this.$animate = n, this.$q = r, this.dateUtil = i, this.calendarScroller = e[0].querySelector(".md-virtual-repeat-scroller"), this.isInitialized = !1, this.isMonthTransitionInProgress = !1, this.$mdUtil = o;
+                    var a = this;
+                    this.cellClickHandler = function() {
+                        a.onTimestampSelected(i.getTimestampFromNode(this))
+                    }
+                }
+                e.prototype.initialize = function(e) {
+                    this.items = {
+                        length: this.dateUtil.getYearDistance(e.firstRenderableDate, e.lastRenderableDate) + 1
+                    }, this.calendarCtrl = e, this.attachScopeListeners(), e.updateVirtualRepeat(), e.ngModelCtrl && e.ngModelCtrl.$render()
+                }, e.prototype.getFocusedYearIndex = function() {
+                    var e = this.calendarCtrl;
+                    return this.dateUtil.getYearDistance(e.firstRenderableDate, e.displayDate || e.selectedDate || e.today)
+                }, e.prototype.changeDate = function(e) {
+                    if (!this.isInitialized) return this.calendarCtrl.hideVerticalScrollbar(this), this.isInitialized = !0, this.$q.when();
+                    if (this.dateUtil.isValidDate(e) && !this.isMonthTransitionInProgress) {
+                        var t = this,
+                            n = this.animateDateChange(e);
+                        return t.isMonthTransitionInProgress = !0, t.calendarCtrl.displayDate = e, n.then(function() {
+                            t.isMonthTransitionInProgress = !1
+                        })
+                    }
+                }, e.prototype.animateDateChange = function(e) {
+                    if (this.dateUtil.isValidDate(e)) {
+                        var t = this.dateUtil.getYearDistance(this.calendarCtrl.firstRenderableDate, e);
+                        this.calendarScroller.scrollTop = t * n
+                    }
+                    return this.$q.when()
+                }, e.prototype.handleKeyEvent = function(e, t) {
+                    var n = this,
+                        r = n.calendarCtrl,
+                        i = r.displayDate;
+                    if ("select" === t) n.changeDate(i).then(function() {
+                        n.onTimestampSelected(i)
+                    });
+                    else {
+                        var o = null,
+                            a = n.dateUtil;
+                        switch (t) {
+                            case "move-right":
+                                o = a.incrementMonths(i, 1);
+                                break;
+                            case "move-left":
+                                o = a.incrementMonths(i, -1);
+                                break;
+                            case "move-row-down":
+                                o = a.incrementMonths(i, 6);
+                                break;
+                            case "move-row-up":
+                                o = a.incrementMonths(i, -6)
+                        }
+                        if (o) {
+                            var s = r.minDate ? a.getFirstDateOfMonth(r.minDate) : null,
+                                l = r.maxDate ? a.getFirstDateOfMonth(r.maxDate) : null;
+                            o = a.getFirstDateOfMonth(n.dateUtil.clampDate(o, s, l)), n.changeDate(o).then(function() {
+                                r.focus(o)
+                            })
+                        }
+                    }
+                }, e.prototype.attachScopeListeners = function() {
+                    var n = this;
+                    n.$scope.$on("md-calendar-parent-changed", function(e, t) {
+                        n.calendarCtrl.changeSelectedDate(t ? n.dateUtil.getFirstDateOfMonth(t) : t), n.changeDate(t)
+                    }), n.$scope.$on("md-calendar-parent-action", ue.bind(n, n.handleKeyEvent))
+                }, e.prototype.onTimestampSelected = function(e) {
+                    var t = this.calendarCtrl;
+                    t.mode ? this.$mdUtil.nextTick(function() {
+                        t.setNgModelValue(e)
+                    }) : t.setCurrentView("month", e)
+                }
+            }(),
+            function() {
+                function e(e, t, n) {
+                    this.$element = e, this.dateUtil = t, this.dateLocale = n, this.calendarCtrl = null, this.yearCtrl = null, this.offset = null, this.focusAfterAppend = null
+                }
+                e.$inject = ["$element", "$$mdDateUtil", "$mdDateLocale"], ue.module("material.components.datepicker").directive("mdCalendarYearBody", function() {
+                    return {
+                        require: ["^^mdCalendar", "^^mdCalendarYear", "mdCalendarYearBody"],
+                        scope: {
+                            offset: "=mdYearOffset"
+                        },
+                        controller: e,
+                        controllerAs: "mdYearBodyCtrl",
+                        bindToController: !0,
+                        link: function(e, t, n, r) {
+                            var i = r[0],
+                                o = r[1],
+                                a = r[2];
+                            a.calendarCtrl = i, a.yearCtrl = o, e.$watch(function() {
+                                return a.offset
+                            }, function(e) {
+                                ue.isNumber(e) && a.generateContent()
+                            })
+                        }
+                    }
+                }), e.prototype.generateContent = function() {
+                    var e = this.dateUtil.incrementYears(this.calendarCtrl.firstRenderableDate, this.offset);
+                    this.$element.empty().append(this.buildCalendarForYear(e)), this.focusAfterAppend && (this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS), this.focusAfterAppend.focus(), this.focusAfterAppend = null)
+                }, e.prototype.buildMonthCell = function(e, t) {
+                    var n = this.calendarCtrl,
+                        r = this.yearCtrl,
+                        i = this.buildBlankCell(),
+                        o = new Date(e, t, 1);
+                    i.setAttribute("aria-label", this.dateLocale.monthFormatter(o)), i.id = n.getDateId(o, "year"), i.setAttribute("data-timestamp", String(o.getTime())), this.dateUtil.isSameMonthAndYear(o, n.today) && i.classList.add(n.TODAY_CLASS), this.dateUtil.isValidDate(n.selectedDate) && this.dateUtil.isSameMonthAndYear(o, n.selectedDate) && (i.classList.add(n.SELECTED_DATE_CLASS), i.setAttribute("aria-selected", "true"));
+                    var a = this.dateLocale.shortMonths[t];
+                    if (!this.dateUtil.isMonthWithinRange(o, n.minDate, n.maxDate) || ue.isFunction(this.calendarCtrl.dateFilter) && !this.calendarCtrl.dateFilter(o)) i.classList.add("md-calendar-date-disabled"), i.textContent = a;
+                    else {
+                        var s = document.createElement("span");
+                        s.classList.add("md-calendar-date-selection-indicator"), s.textContent = a, i.appendChild(s), i.addEventListener("click", r.cellClickHandler), n.displayDate && this.dateUtil.isSameMonthAndYear(o, n.displayDate) && (this.focusAfterAppend = i)
+                    }
+                    return i
+                }, e.prototype.buildBlankCell = function() {
+                    var e = document.createElement("td");
+                    return e.tabIndex = -1, e.classList.add("md-calendar-date"), e.setAttribute("role", "gridcell"), e.setAttribute("tabindex", "-1"), e
+                }, e.prototype.buildCalendarForYear = function(e) {
+                    var t, n = e.getFullYear(),
+                        r = document.createDocumentFragment(),
+                        i = document.createElement("tr"),
+                        o = document.createElement("td");
+                    for (o.className = "md-calendar-month-label", o.textContent = n, i.appendChild(o), t = 0; t < 6; t++) i.appendChild(this.buildMonthCell(n, t));
+                    r.appendChild(i);
+                    var a = document.createElement("tr");
+                    for (a.appendChild(this.buildBlankCell()), t = 6; t < 12; t++) a.appendChild(this.buildMonthCell(n, t));
+                    return r.appendChild(a), r
+                }
+            }(), ue.module("material.components.datepicker").config(["$provide", function(e) {
+                function t() {
+                    this.months = null, this.shortMonths = null, this.days = null, this.shortDays = null, this.dates = null, this.firstDayOfWeek = 0, this.formatDate = null, this.parseDate = null, this.monthHeaderFormatter = null, this.weekNumberFormatter = null, this.longDateFormatter = null, this.isDateComplete = null, this.msgCalendar = "", this.msgOpenCalendar = ""
+                }(t.prototype.$get = function(e, i) {
+                    for (var t = e.DATETIME_FORMATS.SHORTDAY.map(function(e) {
+                            return e.substring(0, 1)
+                        }), n = Array(32), r = 1; r <= 31; r++) n[r] = r;
+                    var o = new Date(1880, 0, 1),
+                        a = new Date(o.getFullYear() + 250, 0, 1),
+                        s = {
+                            months: this.months || e.DATETIME_FORMATS.MONTH,
+                            shortMonths: this.shortMonths || e.DATETIME_FORMATS.SHORTMONTH,
+                            days: this.days || e.DATETIME_FORMATS.DAY,
+                            shortDays: this.shortDays || t,
+                            dates: this.dates || n,
+                            firstDayOfWeek: this.firstDayOfWeek || 0,
+                            formatDate: this.formatDate || function(e, t) {
+                                if (!e) return "";
+                                var n = e.toLocaleTimeString(),
+                                    r = e;
+                                return 0 !== e.getHours() || -1 === n.indexOf("11:") && -1 === n.indexOf("23:") || (r = new Date(e.getFullYear(), e.getMonth(), e.getDate(), 1, 0, 0)), i("date")(r, "M/d/yyyy", t)
+                            },
+                            parseDate: this.parseDate || function(e) {
+                                return new Date(e)
+                            },
+                            isDateComplete: this.isDateComplete || function(e) {
+                                return e = e.trim(), /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-])){2}([a-zA-Z]{3,}|[0-9]{1,4})$/.test(e)
+                            },
+                            monthHeaderFormatter: this.monthHeaderFormatter || function(e) {
+                                return s.shortMonths[e.getMonth()] + " " + e.getFullYear()
+                            },
+                            monthFormatter: this.monthFormatter || function(e) {
+                                return s.months[e.getMonth()] + " " + e.getFullYear()
+                            },
+                            weekNumberFormatter: this.weekNumberFormatter || function(e) {
+                                return "Week " + e
+                            },
+                            longDateFormatter: this.longDateFormatter || function(e) {
+                                return [s.days[e.getDay()], s.months[e.getMonth()], s.dates[e.getDate()], e.getFullYear()].join(" ")
+                            },
+                            msgCalendar: this.msgCalendar || "Calendar",
+                            msgOpenCalendar: this.msgOpenCalendar || "Open calendar",
+                            firstRenderableDate: this.firstRenderableDate || o,
+                            lastRenderableDate: this.lastRenderableDate || a
+                        };
+                    return s
+                }).$inject = ["$locale", "$filter"], e.provider("$mdDateLocale", new t)
+            }]), ue.module("material.components.datepicker").factory("$$mdDateUtil", function() {
+                return {
+                    getFirstDateOfMonth: n,
+                    getNumberOfDaysInMonth: i,
+                    getDateInNextMonth: r,
+                    getDateInPreviousMonth: o,
+                    isInNextMonth: function(e, t) {
+                        return a(r(e), t)
+                    },
+                    isInPreviousMonth: function(e, t) {
+                        var n = o(e);
+                        return a(t, n)
+                    },
+                    getDateMidpoint: function(e, t) {
+                        return u((e.getTime() + t.getTime()) / 2)
+                    },
+                    isSameMonthAndYear: a,
+                    getWeekOfMonth: function(e) {
+                        var t = n(e);
+                        return Math.floor((t.getDay() + e.getDate() - 1) / 7)
+                    },
+                    incrementDays: function(e, t) {
+                        return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t)
+                    },
+                    incrementMonths: s,
+                    getLastDateOfMonth: function(e) {
+                        return new Date(e.getFullYear(), e.getMonth(), i(e))
+                    },
+                    isSameDay: function(e, t) {
+                        return e.getDate() == t.getDate() && a(e, t)
+                    },
+                    getMonthDistance: function(e, t) {
+                        return 12 * (t.getFullYear() - e.getFullYear()) + (t.getMonth() - e.getMonth())
+                    },
+                    isValidDate: l,
+                    setDateTimeToMidnight: c,
+                    createDateAtMidnight: u,
+                    isDateWithinRange: function(e, t, n) {
+                        var r = u(e),
+                            i = l(t) ? u(t) : null,
+                            o = l(n) ? u(n) : null;
+                        return (!i || i <= r) && (!o || r <= o)
+                    },
+                    incrementYears: function(e, t) {
+                        return s(e, 12 * t)
+                    },
+                    getYearDistance: function(e, t) {
+                        return t.getFullYear() - e.getFullYear()
+                    },
+                    clampDate: function(e, t, n) {
+                        var r = e;
+                        return t && e < t && (r = new Date(t.getTime())), n && n < e && (r = new Date(n.getTime())), r
+                    },
+                    getTimestampFromNode: function(e) {
+                        if (e && e.hasAttribute("data-timestamp")) return Number(e.getAttribute("data-timestamp"))
+                    },
+                    isMonthWithinRange: function(e, t, n) {
+                        var r = e.getMonth(),
+                            i = e.getFullYear();
+                        return (!t || t.getFullYear() < i || t.getMonth() <= r) && (!n || n.getFullYear() > i || n.getMonth() >= r)
+                    }
+                };
+
+                function n(e) {
+                    return new Date(e.getFullYear(), e.getMonth(), 1)
+                }
+
+                function i(e) {
+                    return new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate()
+                }
+
+                function r(e) {
+                    return new Date(e.getFullYear(), e.getMonth() + 1, 1)
+                }
+
+                function o(e) {
+                    return new Date(e.getFullYear(), e.getMonth() - 1, 1)
+                }
+
+                function a(e, t) {
+                    return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth()
+                }
+
+                function s(e, t) {
+                    var n = new Date(e.getFullYear(), e.getMonth() + t, 1),
+                        r = i(n);
+                    return r < e.getDate() ? n.setDate(r) : n.setDate(e.getDate()), n
+                }
+
+                function l(e) {
+                    return e && e.getTime && !isNaN(e.getTime())
+                }
+
+                function c(e) {
+                    l(e) && e.setHours(0, 0, 0, 0)
+                }
+
+                function u(e) {
+                    var t;
+                    return c(t = ue.isUndefined(e) ? new Date : new Date(e)), t
+                }
+            }),
+            function() {
+                function e(a, d, f, h) {
+                    return {
+                        template: function(e, t) {
+                            var n = t.mdHideIcons,
+                                r = t.ariaLabel || t.mdPlaceholder,
+                                i = "all" === n || "calendar" === n ? "" : '<md-button class="md-datepicker-button md-icon-button" type="button" tabindex="-1" aria-hidden="true" ng-click="ctrl.openCalendarPane($event)"><md-icon class="md-datepicker-calendar-icon" aria-label="md-calendar" md-svg-src="' + a.mdCalendar + '"></md-icon></md-button>',
+                                o = "";
+                            return "all" !== n && "triangle" !== n && (o = '<md-button type="button" md-no-ink class="md-datepicker-triangle-button md-icon-button" ng-click="ctrl.openCalendarPane($event)" aria-label="{{::ctrl.locale.msgOpenCalendar}}"><div class="md-datepicker-expand-triangle"></div></md-button>', e.addClass(s)), i + '<div class="md-datepicker-input-container" ng-class="{\'md-datepicker-focused\': ctrl.isFocused}"><input ' + (r ? 'aria-label="' + r + '" ' : "") + 'class="md-datepicker-input" aria-haspopup="true" aria-expanded="{{ctrl.isCalendarOpen}}" ng-focus="ctrl.setFocused(true)" ng-blur="ctrl.setFocused(false)"> ' + o + '</div><div class="md-datepicker-calendar-pane md-whiteframe-z1" id="{{::ctrl.calendarPaneId}}"><div class="md-datepicker-input-mask"><div class="md-datepicker-input-mask-opaque"></div></div><div class="md-datepicker-calendar"><md-calendar role="dialog" aria-label="{{::ctrl.locale.msgCalendar}}" md-current-view="{{::ctrl.currentView}}" md-mode="{{::ctrl.mode}}" md-min-date="ctrl.minDate" md-max-date="ctrl.maxDate" md-date-filter="ctrl.dateFilter" ng-model="ctrl.date" ng-if="ctrl.isCalendarOpen"></md-calendar></div></div>'
+                        },
+                        require: ["ngModel", "mdDatepicker", "?^mdInputContainer", "?^form"],
+                        scope: {
+                            minDate: "=mdMinDate",
+                            maxDate: "=mdMaxDate",
+                            placeholder: "@mdPlaceholder",
+                            currentView: "@mdCurrentView",
+                            mode: "@mdMode",
+                            dateFilter: "=mdDateFilter",
+                            isOpen: "=?mdIsOpen",
+                            debounceInterval: "=mdDebounceInterval",
+                            dateLocale: "=mdDateLocale"
+                        },
+                        controller: t,
+                        controllerAs: "ctrl",
+                        bindToController: !0,
+                        link: function(e, t, n, r) {
+                            var i = r[0],
+                                o = r[1],
+                                a = r[2],
+                                s = r[3],
+                                l = d.parseAttributeBoolean(n.mdNoAsterisk);
+                            if (o.configureNgModel(i, a, h), a) {
+                                var c = t[0].querySelector(".md-errors-spacer");
+                                c && t.after(ue.element("<div>").append(c)), a.setHasPlaceholder(n.mdPlaceholder), a.input = t, a.element.addClass(p).toggleClass(m, "calendar" !== n.mdHideIcons && "all" !== n.mdHideIcons), a.label ? l || n.$observe("required", function(e) {
+                                    a.label.toggleClass("md-required", !!e)
+                                }) : f.expect(t, "aria-label", n.mdPlaceholder), e.$watch(a.isErrorGetter || function() {
+                                    return i.$invalid && (i.$touched || s && s.$submitted)
+                                }, a.setInvalid)
+                            } else if (s) var u = e.$watch(function() {
+                                return s.$submitted
+                            }, function(e) {
+                                e && (o.updateErrorState(), u())
+                            })
+                        }
+                    }
+                }
+                t.$inject = ["$scope", "$element", "$attrs", "$window", "$mdConstant", "$mdTheming", "$mdUtil", "$mdDateLocale", "$$mdDateUtil", "$$rAF", "$filter", "$timeout"], e.$inject = ["$$mdSvgRegistry", "$mdUtil", "$mdAria", "inputDirective"], ue.module("material.components.datepicker").directive("mdDatepicker", e);
+                var a = "md-datepicker-invalid",
+                    d = "md-datepicker-open",
+                    p = "_md-datepicker-floating-label",
+                    m = "_md-datepicker-has-calendar-icon",
+                    s = "_md-datepicker-has-triangle-icon",
+                    h = /ipad|iphone|ipod|android/i;
+
+                function t(e, t, n, r, i, o, a, s, l, c, u, d) {
+                    this.$window = r, this.dateUtil = l, this.$mdConstant = i, this.$mdUtil = a, this.$$rAF = c, this.$mdDateLocale = s, this.$timeout = d, this.documentElement = ue.element(document.documentElement), this.ngModelCtrl = null, this.inputElement = t[0].querySelector("input"), this.ngInputElement = ue.element(this.inputElement), this.inputContainer = t[0].querySelector(".md-datepicker-input-container"), this.calendarPane = t[0].querySelector(".md-datepicker-calendar-pane"), this.calendarButton = t[0].querySelector(".md-datepicker-button"), this.inputMask = ue.element(t[0].querySelector(".md-datepicker-input-mask-opaque")), this.$element = t, this.$attrs = n, this.$scope = e, this.date = null, this.isFocused = !1, this.isDisabled, this.setDisabled(t[0].disabled || ue.isString(n.disabled)), this.isCalendarOpen = !1, this.openOnFocus = n.hasOwnProperty("mdOpenOnFocus"), this.mdInputContainer = null, this.calendarPaneOpenedFrom = null, this.calendarPaneId = "md-date-pane-" + a.nextUid(), this.bodyClickHandler = ue.bind(this, this.handleBodyClick), this.windowEventName = h.test(navigator.userAgent || navigator.vendor || F.opera) ? "orientationchange" : "resize", this.windowEventHandler = a.debounce(ue.bind(this, this.closeCalendarPane), 100), this.windowBlurHandler = ue.bind(this, this.handleWindowBlur), this.ngDateFilter = u("date"), this.leftMargin = 20, this.topMargin = null, n.tabindex ? (this.ngInputElement.attr("tabindex", n.tabindex), n.$set("tabindex", null)) : n.$set("tabindex", "-1"), n.$set("aria-owns", this.calendarPaneId), o(t), o(ue.element(this.calendarPane));
+                    var f = this;
+                    e.$on("$destroy", function() {
+                        f.detachCalendarPane()
+                    }), n.mdIsOpen && e.$watch("ctrl.isOpen", function(e) {
+                        e ? f.openCalendarPane({
+                            target: f.inputElement
+                        }) : f.closeCalendarPane()
+                    }), 1 === ue.version.major && ue.version.minor <= 4 && this.$onInit()
+                }
+                t.prototype.$onInit = function() {
+                    this.locale = this.dateLocale ? ue.extend({}, this.$mdDateLocale, this.dateLocale) : this.$mdDateLocale, this.installPropertyInterceptors(), this.attachChangeListeners(), this.attachInteractionListeners()
+                }, t.prototype.configureNgModel = function(e, t, n) {
+                    this.ngModelCtrl = e, this.mdInputContainer = t, this.$attrs.$set("type", "date"), n[0].link.pre(this.$scope, {
+                        on: ue.noop,
+                        val: ue.noop,
+                        0: {}
+                    }, this.$attrs, [e]);
+                    var r = this;
+                    r.ngModelCtrl.$formatters.push(function(e) {
+                        var t = ue.isDefined(e) ? e : null;
+                        if (!(e instanceof Date) && (t = Date.parse(e), !isNaN(t) && ue.isNumber(t) && (e = new Date(t)), e && !(e instanceof Date))) throw Error("The ng-model for md-datepicker must be a Date instance or a value that can be parsed into a date. Currently the model is of type: " + typeof e);
+                        return r.onExternalChange(e), e
+                    }), e.$viewChangeListeners.unshift(ue.bind(this, this.updateErrorState));
+                    var i = r.$mdUtil.getModelOption(e, "updateOn");
+                    i && this.ngInputElement.on(i, ue.bind(this.$element, this.$element.triggerHandler, i))
+                }, t.prototype.attachChangeListeners = function() {
+                    var n = this;
+                    n.$scope.$on("md-calendar-change", function(e, t) {
+                        n.setModelValue(t), n.onExternalChange(t), n.closeCalendarPane()
+                    }), n.ngInputElement.on("input", ue.bind(n, n.resizeInputElement));
+                    var e = ue.isDefined(this.debounceInterval) ? this.debounceInterval : 500;
+                    n.ngInputElement.on("input", n.$mdUtil.debounce(n.handleInputEvent, e, n))
+                }, t.prototype.attachInteractionListeners = function() {
+                    var t = this,
+                        n = this.$scope,
+                        r = this.$mdConstant.KEY_CODE;
+                    t.ngInputElement.on("keydown", function(e) {
+                        e.altKey && e.keyCode === r.DOWN_ARROW && (t.openCalendarPane(e), n.$digest())
+                    }), t.openOnFocus && (t.ngInputElement.on("focus", ue.bind(t, t.openCalendarPane)), t.ngInputElement.on("click", function(e) {
+                        e.stopPropagation()
+                    }), t.ngInputElement.on("pointerdown", function(e) {
+                        e.target && e.target.setPointerCapture && e.target.setPointerCapture(e.pointerId)
+                    }), ue.element(t.$window).on("blur", t.windowBlurHandler), n.$on("$destroy", function() {
+                        ue.element(t.$window).off("blur", t.windowBlurHandler)
+                    })), n.$on("md-calendar-close", function() {
+                        t.closeCalendarPane()
+                    })
+                }, t.prototype.installPropertyInterceptors = function() {
+                    var t = this;
+                    if (this.$attrs.ngDisabled) {
+                        var e = this.$scope.$parent;
+                        e && e.$watch(this.$attrs.ngDisabled, function(e) {
+                            t.setDisabled(e)
+                        })
+                    }
+                    Object.defineProperty(this, "placeholder", {
+                        get: function() {
+                            return t.inputElement.placeholder
+                        },
+                        set: function(e) {
+                            t.inputElement.placeholder = e || ""
+                        }
+                    })
+                }, t.prototype.setDisabled = function(e) {
+                    this.isDisabled = e, this.inputElement.disabled = e, this.calendarButton && (this.calendarButton.disabled = e)
+                }, t.prototype.updateErrorState = function(e) {
+                    var t = e || this.date;
+                    if (this.clearErrorState(), this.dateUtil.isValidDate(t)) {
+                        if (t = this.dateUtil.createDateAtMidnight(t), this.dateUtil.isValidDate(this.minDate)) {
+                            var n = this.dateUtil.createDateAtMidnight(this.minDate);
+                            this.ngModelCtrl.$setValidity("mindate", n <= t)
+                        }
+                        if (this.dateUtil.isValidDate(this.maxDate)) {
+                            var r = this.dateUtil.createDateAtMidnight(this.maxDate);
+                            this.ngModelCtrl.$setValidity("maxdate", t <= r)
+                        }
+                        ue.isFunction(this.dateFilter) && this.ngModelCtrl.$setValidity("filtered", this.dateFilter(t))
+                    } else this.ngModelCtrl.$setValidity("valid", null == t);
+                    var i = this.inputElement.value,
+                        o = this.locale.parseDate(i);
+                    !this.isInputValid(i, o) && this.ngModelCtrl.$valid && this.ngModelCtrl.$setValidity("valid", null == t), ue.element(this.inputContainer).toggleClass(a, !this.ngModelCtrl.$valid)
+                }, t.prototype.isInputValid = function(e, t) {
+                    return "" === e || this.dateUtil.isValidDate(t) && this.locale.isDateComplete(e) && this.isDateEnabled(t)
+                }, t.prototype.clearErrorState = function() {
+                    this.inputContainer.classList.remove(a), ["mindate", "maxdate", "filtered", "valid"].forEach(function(e) {
+                        this.ngModelCtrl.$setValidity(e, !0)
+                    }, this)
+                }, t.prototype.resizeInputElement = function() {
+                    this.inputElement.size = this.inputElement.value.length + 3
+                }, t.prototype.handleInputEvent = function() {
+                    var e = this.inputElement.value,
+                        t = e ? this.locale.parseDate(e) : null;
+                    this.dateUtil.setDateTimeToMidnight(t), this.isInputValid(e, t) && (this.setModelValue(t), this.date = t), this.updateErrorState(t)
+                }, t.prototype.isDateEnabled = function(e) {
+                    return this.dateUtil.isDateWithinRange(e, this.minDate, this.maxDate) && (!ue.isFunction(this.dateFilter) || this.dateFilter(e))
+                }, t.prototype.attachCalendarPane = function() {
+                    var e = this.calendarPane,
+                        t = document.body;
+                    e.style.transform = "", this.$element.addClass(d), this.mdInputContainer && this.mdInputContainer.element.addClass(d), ue.element(t).addClass("md-datepicker-is-showing");
+                    var n = this.inputContainer.getBoundingClientRect(),
+                        r = t.getBoundingClientRect();
+                    (!this.topMargin || this.topMargin < 0) && (this.topMargin = (this.inputMask.parent().prop("clientHeight") - this.ngInputElement.prop("clientHeight")) / 2);
+                    var i = n.top - r.top - this.topMargin,
+                        o = n.left - r.left - this.leftMargin,
+                        a = r.top < 0 && 0 == document.body.scrollTop ? -r.top : document.body.scrollTop,
+                        s = r.left < 0 && 0 == document.body.scrollLeft ? -r.left : document.body.scrollLeft,
+                        l = a + this.$window.innerHeight,
+                        c = s + this.$window.innerWidth;
+                    if (this.inputMask.css({
+                            position: "absolute",
+                            left: this.leftMargin + "px",
+                            top: this.topMargin + "px",
+                            width: n.width - 1 + "px",
+                            height: n.height - 2 + "px"
+                        }), c < o + 360) {
+                        if (0 < c - 360) o = c - 360;
+                        else {
+                            o = s;
+                            var u = this.$window.innerWidth / 360;
+                            e.style.transform = "scale(" + u + ")"
+                        }
+                        e.classList.add("md-datepicker-pos-adjusted")
+                    }
+                    l < i + 368 && a < l - 368 && (i = l - 368, e.classList.add("md-datepicker-pos-adjusted")), e.style.left = o + "px", e.style.top = i + "px", document.body.appendChild(e), this.$$rAF(function() {
+                        e.classList.add("md-pane-open")
+                    })
+                }, t.prototype.detachCalendarPane = function() {
+                    this.$element.removeClass(d), this.mdInputContainer && this.mdInputContainer.element.removeClass(d), ue.element(document.body).removeClass("md-datepicker-is-showing"), this.calendarPane.classList.remove("md-pane-open"), this.calendarPane.classList.remove("md-datepicker-pos-adjusted"), this.isCalendarOpen && this.$mdUtil.enableScrolling(), this.calendarPane.parentNode && this.calendarPane.parentNode.removeChild(this.calendarPane)
+                }, t.prototype.openCalendarPane = function(e) {
+                    if (!this.isCalendarOpen && !this.isDisabled && !this.inputFocusedOnWindowBlur) {
+                        this.isCalendarOpen = this.isOpen = !0, this.calendarPaneOpenedFrom = e.target, this.$mdUtil.disableScrollAround(this.calendarPane), this.attachCalendarPane(), this.focusCalendar(), this.evalAttr("ngFocus");
+                        var t = this;
+                        this.$mdUtil.nextTick(function() {
+                            t.documentElement.on("click touchstart", t.bodyClickHandler)
+                        }, !1), F.addEventListener(this.windowEventName, this.windowEventHandler)
+                    }
+                }, t.prototype.closeCalendarPane = function() {
+                    if (this.isCalendarOpen) {
+                        var e = this;
+                        e.detachCalendarPane(), e.ngModelCtrl.$setTouched(), e.evalAttr("ngBlur"), e.documentElement.off("click touchstart", e.bodyClickHandler), F.removeEventListener(e.windowEventName, e.windowEventHandler), e.calendarPaneOpenedFrom.focus(), e.calendarPaneOpenedFrom = null, e.openOnFocus ? e.$timeout(t) : t()
+                    }
+
+                    function t() {
+                        e.isCalendarOpen = e.isOpen = !1
+                    }
+                }, t.prototype.getCalendarCtrl = function() {
+                    return ue.element(this.calendarPane.querySelector("md-calendar")).controller("mdCalendar")
+                }, t.prototype.focusCalendar = function() {
+                    var e = this;
+                    this.$mdUtil.nextTick(function() {
+                        e.getCalendarCtrl().focus()
+                    }, !1)
+                }, t.prototype.setFocused = function(e) {
+                    e || this.ngModelCtrl.$setTouched(), this.openOnFocus || this.evalAttr(e ? "ngFocus" : "ngBlur"), this.isFocused = e
+                }, t.prototype.handleBodyClick = function(e) {
+                    this.isCalendarOpen && (this.$mdUtil.getClosest(e.target, "md-calendar") || this.closeCalendarPane(), this.$scope.$digest())
+                }, t.prototype.handleWindowBlur = function() {
+                    this.inputFocusedOnWindowBlur = document.activeElement === this.inputElement
+                }, t.prototype.evalAttr = function(e) {
+                    this.$attrs[e] && this.$scope.$parent.$eval(this.$attrs[e])
+                }, t.prototype.setModelValue = function(e) {
+                    var t = this.$mdUtil.getModelOption(this.ngModelCtrl, "timezone");
+                    this.ngModelCtrl.$setViewValue(this.ngDateFilter(e, "yyyy-MM-dd", t))
+                }, t.prototype.onExternalChange = function(e) {
+                    var t = this.$mdUtil.getModelOption(this.ngModelCtrl, "timezone");
+                    this.date = e, this.inputElement.value = this.locale.formatDate(e, t), this.mdInputContainer && this.mdInputContainer.setHasValue(!!e), this.resizeInputElement(), this.updateErrorState()
+                }
+            }(),
             function() {
                 function e(e, t, o) {
                     return {
                                 function n() {
                                     i.toggleClass("md-content-overflow", t.scrollHeight > t.clientHeight)
                                 }
-                                t && (e = t.getElementsByTagName("img"), n(), se.element(e).on("load", n)), r.$on("$destroy", function() {
+                                t && (e = t.getElementsByTagName("img"), n(), ue.element(e).on("load", n)), r.$on("$destroy", function() {
                                     o.destroy(i)
                                 })
                             })
                             }, this.abort = function() {
                                 r.cancel()
                             }, this.keypress = function(e) {
-                                var t = n && this.required && !se.isDefined(this.result);
+                                var t = n && this.required && !ue.isDefined(this.result);
                                 e.keyCode !== i.KEY_CODE.ENTER || t || r.hide(this.result)
                             }
                         }
                                 e.defaultTheme = t.defaultTheme(),
                                     function(t) {
                                         var e;
-                                        t.targetEvent && t.targetEvent.target && (e = se.element(t.targetEvent.target));
+                                        t.targetEvent && t.targetEvent.target && (e = ue.element(t.targetEvent.target));
                                         var n = e && e.controller("mdTheme");
                                         if (t.hasTheme = !!n, !t.hasTheme) return;
                                         t.themeWatch = n.$shouldWatch;
                                     }(e)
                             },
                             onShow: function(e, t, n, r) {
-                                se.element(u[0].body).addClass("md-dialog-is-showing");
+                                ue.element(u[0].body).addClass("md-dialog-is-showing");
                                 var i = t.find("md-dialog");
                                 if (i.hasClass("ng-cloak")) {
                                     g.warn("$mdDialog: using `<md-dialog ng-cloak>` will affect the dialog opening animations.", t[0])
                                 }
                                 return function(e) {
                                         function t(e, t) {
-                                            var n = se.element(e || {});
+                                            var n = ue.element(e || {});
                                             if (n && n.length) {
-                                                var r = se.isFunction(n[0].getBoundingClientRect);
-                                                return se.extend(t || {}, {
-                                                    element: r ? n : le,
-                                                    bounds: r ? n[0].getBoundingClientRect() : se.extend({}, {
+                                                var r = ue.isFunction(n[0].getBoundingClientRect);
+                                                return ue.extend(t || {}, {
+                                                    element: r ? n : de,
+                                                    bounds: r ? n[0].getBoundingClientRect() : ue.extend({}, {
                                                         top: 0,
                                                         left: 0,
                                                         height: 0,
                                                         width: 0
                                                     }, n[0]),
-                                                    focus: se.bind(n, n.focus)
+                                                    focus: ue.bind(n, n.focus)
                                                 })
                                             }
                                         }
 
                                         function n(e, t) {
-                                            return se.isString(e) && (e = u[0].querySelector(e)), se.element(e || t)
+                                            return ue.isString(e) && (e = u[0].querySelector(e)), ue.element(e || t)
                                         }
-                                        e.origin = se.extend({
+                                        e.origin = ue.extend({
                                             element: null,
                                             bounds: null,
-                                            focus: se.noop
+                                            focus: ue.noop
                                         }, e.origin || {}), e.parent = n(e.parent, d), e.closeTo = t(n(e.closeTo)), e.openFrom = t(n(e.openFrom)), e.targetEvent && (e.origin = t(e.targetEvent.target, e.origin), e.originInteraction = v.getLastInteractionType())
                                     }(n),
                                     function(e, t) {
                                         s.backdrop && (e ? s.backdrop.remove() : c.leave(s.backdrop)), s.disableParentScroll && (s.restoreScroll && s.restoreScroll(), delete s.restoreScroll), s.hideBackdrop = null
                                     },
                                     function(e, t) {
-                                        var n = se.element(m),
+                                        var n = ue.element(m),
                                             r = h.debounce(function() {
                                                 b(e, t)
                                             }, 60),
                                         if (t.escapeToClose) {
                                             var a = t.parent,
                                                 s = function(e) {
-                                                    e.keyCode === p.KEY_CODE.ESCAPE && (e.stopPropagation(), e.preventDefault(), o())
+                                                    e.keyCode === p.KEY_CODE.ESCAPE && (e.stopImmediatePropagation(), e.preventDefault(), o())
                                                 };
                                             e.on("keydown", s), a.on("keydown", s), i.push(function() {
                                                 e.off("keydown", s), a.off("keydown", s)
                                 var r;
 
                                 function i() {
-                                    se.element(u[0].body).removeClass("md-dialog-is-showing"), n.contentElement && n.reverseContainerStretch(), n.cleanupElement(), n.$destroy || "keyboard" !== n.originInteraction || n.origin.focus()
+                                    ue.element(u[0].body).removeClass("md-dialog-is-showing"), n.contentElement && n.reverseContainerStretch(), n.cleanupElement(), n.$destroy || "keyboard" !== n.originInteraction || n.origin.focus()
                                 }
                             },
                             clickOutsideToClose: !1,
                         }
                     }
                 }
-                e.$inject = ["$$rAF", "$mdTheming", "$mdDialog"], t.$inject = ["$$interimElementProvider"], se.module("material.components.dialog", ["material.core", "material.components.backdrop"]).directive("mdDialog", e).provider("$mdDialog", t)
+                e.$inject = ["$$rAF", "$mdTheming", "$mdDialog"], t.$inject = ["$$interimElementProvider"], ue.module("material.components.dialog", ["material.core", "material.components.backdrop"]).directive("mdDialog", e).provider("$mdDialog", t)
             }(),
             function() {
                 function e(e) {
                         link: e
                     }
                 }
-                e.$inject = ["$mdTheming"], se.module("material.components.divider", ["material.core"]).directive("mdDivider", e)
+                e.$inject = ["$mdTheming"], ue.module("material.components.divider", ["material.core"]).directive("mdDivider", e)
             }(),
             function() {
                 function e(r) {
                         }
                     }
                 }
-                e.$inject = ["$mdUtil"], se.module("material.components.fabActions", ["material.core"]).directive("mdFabActions", e)
+                e.$inject = ["$mdUtil"], ue.module("material.components.fabActions", ["material.core"]).directive("mdFabActions", e)
             }(),
             function() {
                 function e(t, o, a, s, l, i) {
                     }
 
                     function h() {
-                        o.off("keydown", m), se.element(document).off("click touchend", p)
+                        o.off("keydown", m), ue.element(document).off("click touchend", p)
                     }
 
                     function p(e) {
                     }
 
                     function r(e, t) {
-                        var n, r = (n = b()[0].querySelectorAll(".md-fab-action-item"), se.forEach(n, function(e) {
-                            se.element(se.element(e).children()[0]).attr("tabindex", -1)
+                        var n, r = (n = b()[0].querySelectorAll(".md-fab-action-item"), ue.forEach(n, function(e) {
+                            ue.element(ue.element(e).children()[0]).attr("tabindex", -1)
                         }), n);
                         u.currentActionIndex = u.currentActionIndex + t, u.currentActionIndex = Math.min(r.length - 1, u.currentActionIndex), u.currentActionIndex = Math.max(0, u.currentActionIndex);
-                        var i = se.element(r[u.currentActionIndex]).children()[0];
-                        se.element(i).attr("tabindex", 0), i.focus(), e.preventDefault(), e.stopImmediatePropagation()
+                        var i = ue.element(r[u.currentActionIndex]).children()[0];
+                        ue.element(i).attr("tabindex", 0), i.focus(), e.preventDefault(), e.stopImmediatePropagation()
                     }
 
                     function b() {
                         t.$evalAsync("vm.isOpen = !vm.isOpen")
                     }, u.$onInit = function() {
                         var e, r, i;
-                        u.direction = u.direction || "down", u.isOpen = u.isOpen || !1, d(), o.addClass("md-animations-waiting"), e = ["click", "focusin", "focusout"], se.forEach(e, function(e) {
+                        u.direction = u.direction || "down", u.isOpen = u.isOpen || !1, d(), o.addClass("md-animations-waiting"), e = ["click", "focusin", "focusout"], ue.forEach(e, function(e) {
                             o.on(e, n)
                         }), t.$on("$destroy", function() {
-                            se.forEach(e, function(e) {
+                            ue.forEach(e, function(e) {
                                 o.off(e, n)
                             }), h()
                         }), t.$watch("vm.direction", function(e, t) {
                             a.removeClass(o, "md-" + t), a.addClass(o, "md-" + e), d()
                         }), t.$watch("vm.isOpen", function(e) {
                             d(), r && i || (r = o.find("md-fab-trigger"), i = b()), e ? (o.on("keydown", m), s.nextTick(function() {
-                                se.element(document).on("click touchend", p)
+                                ue.element(document).on("click touchend", p)
                             })) : h();
                             var t = e ? "md-is-open" : "",
                                 n = e ? "" : "md-is-open";
                             r.attr("aria-haspopup", !0), r.attr("aria-expanded", e), i.attr("aria-hidden", !e), a.setClass(o, t, n)
                         }), f()
-                    }, 1 === se.version.major && se.version.minor <= 4 && this.$onInit()
+                    }, 1 === ue.version.major && ue.version.minor <= 4 && this.$onInit()
                 }
-                e.$inject = ["$scope", "$element", "$animate", "$mdUtil", "$mdConstant", "$timeout"], se.module("material.components.fabShared", ["material.core"]).controller("MdFabController", e)
+                e.$inject = ["$scope", "$element", "$animate", "$mdUtil", "$mdConstant", "$timeout"], ue.module("material.components.fabShared", ["material.core"]).controller("MdFabController", e)
             }(),
             function() {
                 e.$inject = ["$timeout"], t.$inject = ["$timeout"];
                                 c = t.querySelector("md-fab-trigger"),
                                 n = t.querySelector("._md-css-variables"),
                                 i = parseInt(F.getComputedStyle(n).zIndex);
-                            se.forEach(r, function(e, t) {
+                            ue.forEach(r, function(e, t) {
                                 var n = e.style;
                                 n.transform = n.webkitTransform = "", n.transitionDelay = "", n.opacity = 1, n.zIndex = r.length - t + i
-                            }), c.style.zIndex = i + r.length + 1, l.isOpen || se.forEach(r, function(e, t) {
+                            }), c.style.zIndex = i + r.length + 1, l.isOpen || ue.forEach(r, function(e, t) {
                                 var n, r, i = e.style,
                                     o = (c.clientHeight - e.clientHeight) / 2,
                                     a = (c.clientWidth - e.clientWidth) / 2;
                             o = t.querySelectorAll(".md-fab-action-item"),
                             n = t.querySelector("._md-css-variables"),
                             a = parseInt(F.getComputedStyle(n).zIndex);
-                        se.forEach(o, function(e, t) {
+                        ue.forEach(o, function(e, t) {
                             var n = e.style,
                                 r = 65 * t;
                             n.opacity = i.isOpen ? 1 : 0, n.transform = n.webkitTransform = i.isOpen ? "scale(1)" : "scale(0)", n.transitionDelay = (i.isOpen ? r : o.length - r) + "ms", n.zIndex = o.length - t + a
                         }
                     }
                 }
-                se.module("material.components.fabSpeedDial", ["material.core", "material.components.fabShared", "material.components.fabActions"]).directive("mdFabSpeedDial", function() {
+                ue.module("material.components.fabSpeedDial", ["material.core", "material.components.fabShared", "material.components.fabActions"]).directive("mdFabSpeedDial", function() {
                     return {
                         restrict: "E",
                         scope: {
                                 var u = F.getComputedStyle(a).getPropertyValue("background-color"),
                                     d = r.offsetWidth,
                                     f = (r.offsetHeight, d / a.offsetWidth * 2);
-                                o.style.backgroundColor = u, o.style.borderRadius = d + "px", i.isOpen ? (s.style.pointerEvents = "inherit", o.style.width = a.offsetWidth + "px", o.style.height = a.offsetHeight + "px", o.style.transform = "scale(" + f + ")", o.style.transitionDelay = "0ms", l && (l.style.transitionDelay = ".3s"), se.forEach(c, function(e, t) {
+                                o.style.backgroundColor = u, o.style.borderRadius = d + "px", i.isOpen ? (s.style.pointerEvents = "inherit", o.style.width = a.offsetWidth + "px", o.style.height = a.offsetHeight + "px", o.style.transform = "scale(" + f + ")", o.style.transitionDelay = "0ms", l && (l.style.transitionDelay = ".3s"), ue.forEach(c, function(e, t) {
                                     e.style.transitionDelay = 25 * (c.length - t) + "ms"
-                                })) : (s.style.pointerEvents = "none", o.style.transform = "scale(1)", o.style.top = "0", e.hasClass("md-right") && (o.style.left = "0", o.style.right = null), e.hasClass("md-left") && (o.style.right = "0", o.style.left = null), o.style.transitionDelay = "200ms", l && (l.style.transitionDelay = "0ms"), se.forEach(c, function(e, t) {
+                                })) : (s.style.pointerEvents = "none", o.style.transform = "scale(1)", o.style.top = "0", e.hasClass("md-right") && (o.style.left = "0", o.style.right = null), e.hasClass("md-left") && (o.style.right = "0", o.style.left = null), o.style.transitionDelay = "200ms", l && (l.style.transitionDelay = "0ms"), ue.forEach(c, function(e, t) {
                                     e.style.transitionDelay = 200 + 25 * t + "ms"
                                 }))
                             }
                         }
                     }
                 }
-                se.module("material.components.fabToolbar", ["material.core", "material.components.fabShared", "material.components.fabActions"]).directive("mdFabToolbar", function() {
+                ue.module("material.components.fabToolbar", ["material.core", "material.components.fabShared", "material.components.fabActions"]).directive("mdFabToolbar", function() {
                     return {
                         restrict: "E",
                         transclude: !0,
                                     }),
                                     i = {
                                         tileSpans: (t = r, [].map.call(t, function(e) {
-                                            var t = se.element(e).controller("mdGridTile");
+                                            var t = ue.element(e).controller("mdGridTile");
                                             return {
                                                 row: parseInt(y.getResponsiveAttribute(t.$attrs, "md-rowspan"), 10) || 1,
                                                 col: parseInt(y.getResponsiveAttribute(t.$attrs, "md-colspan"), 10) || 1
                                         gutter: f(y.getResponsiveAttribute(s, "md-gutter") || 1)
                                     };
                                 var t;
-                                if (!e && se.equals(i, l)) return;
+                                if (!e && ue.equals(i, l)) return;
                                 var n = b(i.colCount, i.tileSpans, r).map(function(e, n) {
                                     return {
                                         grid: {
                                         },
                                         tiles: e.map(function(e, t) {
                                             return {
-                                                element: se.element(r[t]),
+                                                element: ue.element(r[t]),
                                                 style: function(e, t, n, r, i, o, a) {
                                                     var s = 1 / n * 100,
                                                         l = (n - 1) / n,
                                     }
                                 }), l = i
                             };
-                            var l, n = se.bind(t, t.invalidateLayout),
+                            var l, n = ue.bind(t, t.invalidateLayout),
                                 r = function() {
                                     for (var e in v.MEDIA) y(e), y.getQuery(v.MEDIA[e]).addListener(n);
                                     return y.watchResponsiveAttributes(["md-cols", "md-row-height", "md-gutter"], s, i)
                                 null == e ? t.invalidateLayout() : y(e) && t.invalidateLayout()
                             }
                             o.$on("$destroy", function() {
-                                for (var e in t.layoutDelegate = se.noop, r(), v.MEDIA) y.getQuery(v.MEDIA[e]).removeListener(n)
+                                for (var e in t.layoutDelegate = ue.noop, r(), v.MEDIA) y.getQuery(v.MEDIA[e]).removeListener(n)
                             });
                             var c = h.startSymbol(),
                                 u = h.endSymbol();
                 }
 
                 function t(e) {
-                    this.layoutInvalidated = !1, this.tilesInvalidated = !1, this.$timeout_ = e.nextTick, this.layoutDelegate = se.noop
+                    this.layoutInvalidated = !1, this.tilesInvalidated = !1, this.$timeout_ = e.nextTick, this.layoutDelegate = ue.noop
                 }
 
                 function n(l) {
                     var c = t;
                     return e.animateWith = function(e) {
-                        c = se.isFunction(e) ? e : t
+                        c = ue.isFunction(e) ? e : t
                     }, e;
 
                     function e(e, t) {
                         }],
                         link: function(e, t, n, r) {
                             t.attr("role", "listitem");
-                            var i = o.watchResponsiveAttributes(["md-colspan", "md-rowspan"], n, se.bind(r, r.invalidateLayout));
+                            var i = o.watchResponsiveAttributes(["md-colspan", "md-rowspan"], n, ue.bind(r, r.invalidateLayout));
                             r.invalidateTiles(), e.$on("$destroy", function() {
                                 t[0].$$mdDestroyed = !0, i(), r.invalidateLayout()
-                            }), se.isDefined(e.$parent.$index) && e.$watch(function() {
+                            }), ue.isDefined(e.$parent.$index) && e.$watch(function() {
                                 return e.$parent.$index
                             }, function(e, t) {
                                 e !== t && r.invalidateTiles()
                         transclude: !0
                     }
                 }
-                t.$inject = ["$mdUtil"], n.$inject = ["$mdUtil"], e.$inject = ["$interpolate", "$mdConstant", "$mdGridLayout", "$mdMedia"], r.$inject = ["$mdMedia"], se.module("material.components.gridList", ["material.core"]).directive("mdGridList", e).directive("mdGridTile", r).directive("mdGridTileFooter", i).directive("mdGridTileHeader", i).factory("$mdGridLayout", n), t.prototype = {
+                t.$inject = ["$mdUtil"], n.$inject = ["$mdUtil"], e.$inject = ["$interpolate", "$mdConstant", "$mdGridLayout", "$mdMedia"], r.$inject = ["$mdMedia"], ue.module("material.components.gridList", ["material.core"]).directive("mdGridList", e).directive("mdGridTile", r).directive("mdGridTileFooter", i).directive("mdGridTileHeader", i).factory("$mdGridLayout", n), t.prototype = {
                     invalidateTiles: function() {
                         this.tilesInvalidated = !0, this.invalidateLayout()
                     },
                     invalidateLayout: function() {
-                        this.layoutInvalidated || (this.layoutInvalidated = !0, this.$timeout_(se.bind(this, this.layout)))
+                        this.layoutInvalidated || (this.layoutInvalidated = !0, this.$timeout_(ue.bind(this, this.layout)))
                     },
                     layout: function() {
                         try {
                         }
                     }
                 }
-            }(), se.module("material.components.icon", ["material.core"]),
+            }(), ue.module("material.components.icon", ["material.core"]), ue.module("material.components.icon").directive("mdIcon", ["$mdIcon", "$mdTheming", "$mdAria", "$sce", function(l, c, u, e) {
+                return {
+                    restrict: "E",
+                    link: function(e, t, n) {
+                        c(t);
+                        var r = n.mdFontIcon,
+                            i = l.fontSet(n.mdFontSet);
+                        n.mdSvgIcon || n.mdSvgSrc || (n.mdFontIcon && t.addClass("md-font " + n.mdFontIcon), t.addClass(i)), n.$observe("mdFontIcon", s), n.$observe("mdFontSet", s), t[0].getAttribute(n.$attr.mdSvgSrc);
+                        var o, a = n.$normalize(n.$attr.mdSvgIcon || n.$attr.mdSvgSrc || "");
+
+                        function s() {
+                            if (!n.mdSvgIcon && !n.mdSvgSrc) {
+                                n.mdFontIcon && (t.removeClass(r), t.addClass(n.mdFontIcon), r = n.mdFontIcon);
+                                var e = l.fontSet(n.mdFontSet);
+                                i !== e && (t.removeClass(i), t.addClass(e), i = e)
+                            }
+                        }
+                        n.role || (u.expect(t, "role", "img"), n.role = "img"), "img" !== n.role || n.ariaHidden || u.hasAriaLabel(t) || (n.alt ? u.expect(t, "aria-label", n.alt) : u.parentHasAriaLabel(t, 2) ? u.expect(t, "aria-hidden", "true") : (o = n.mdFontIcon || n.mdSvgIcon || t.text()) ? u.expect(t, "aria-label", o) : u.expect(t, "aria-hidden", "true")), a && n.$observe(a, function(e) {
+                            t.empty(), e && l(e).then(function(e) {
+                                t.empty(), t.append(e)
+                            })
+                        })
+                    }
+                }
+            }]),
             function() {
-                t.$inject = ["$mdTheming", "$parse"], n.$inject = ["$mdUtil", "$window", "$mdAria", "$timeout", "$mdGesture"], r.$inject = ["$animate", "$mdUtil"], i.$inject = ["$compile"], d.$inject = ["$mdUtil"], o.$inject = ["$document", "$timeout"], f.$inject = ["$$AnimateRunner", "$animateCss", "$mdUtil", "$log"], h.$inject = ["$$AnimateRunner", "$animateCss", "$mdUtil", "$log"], p.$inject = ["$$AnimateRunner", "$animateCss", "$mdUtil", "$log"];
-                var e = se.module("material.components.input", ["material.core"]).directive("mdInputContainer", t).directive("label", function() {
+                a.$inject = ["config", "$templateRequest", "$q", "$log", "$mdUtil", "$sce"], ue.module("material.components.icon").constant("$$mdSvgRegistry", {
+                    mdTabsArrow: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyICIvPjwvZz48L3N2Zz4=",
+                    mdClose: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik0xOSA2LjQxbC0xLjQxLTEuNDEtNS41OSA1LjU5LTUuNTktNS41OS0xLjQxIDEuNDEgNS41OSA1LjU5LTUuNTkgNS41OSAxLjQxIDEuNDEgNS41OS01LjU5IDUuNTkgNS41OSAxLjQxLTEuNDEtNS41OS01LjU5eiIvPjwvZz48L3N2Zz4=",
+                    mdCancel: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik0xMiAyYy01LjUzIDAtMTAgNC40Ny0xMCAxMHM0LjQ3IDEwIDEwIDEwIDEwLTQuNDcgMTAtMTAtNC40Ny0xMC0xMC0xMHptNSAxMy41OWwtMS40MSAxLjQxLTMuNTktMy41OS0zLjU5IDMuNTktMS40MS0xLjQxIDMuNTktMy41OS0zLjU5LTMuNTkgMS40MS0xLjQxIDMuNTkgMy41OSAzLjU5LTMuNTkgMS40MSAxLjQxLTMuNTkgMy41OSAzLjU5IDMuNTl6Ii8+PC9nPjwvc3ZnPg==",
+                    mdMenu: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0zLDZIMjFWOEgzVjZNMywxMUgyMVYxM0gzVjExTTMsMTZIMjFWMThIM1YxNloiIC8+PC9zdmc+",
+                    mdToggleArrow: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNDggNDgiPjxwYXRoIGQ9Ik0yNCAxNmwtMTIgMTIgMi44MyAyLjgzIDkuMTctOS4xNyA5LjE3IDkuMTcgMi44My0yLjgzeiIvPjxwYXRoIGQ9Ik0wIDBoNDh2NDhoLTQ4eiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==",
+                    mdCalendar: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgM2gtMVYxaC0ydjJIOFYxSDZ2Mkg1Yy0xLjExIDAtMS45OS45LTEuOTkgMkwzIDE5YzAgMS4xLjg5IDIgMiAyaDE0YzEuMSAwIDItLjkgMi0yVjVjMC0xLjEtLjktMi0yLTJ6bTAgMTZINVY4aDE0djExek03IDEwaDV2NUg3eiIvPjwvc3ZnPg==",
+                    mdChecked: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik05IDE2LjE3TDQuODMgMTJsLTEuNDIgMS40MUw5IDE5IDIxIDdsLTEuNDEtMS40MXoiLz48L2c+PC9zdmc+"
+                }).provider("$mdIcon", e);
+                var o = {
+                    defaultViewBoxSize: 24,
+                    defaultFontSet: "material-icons",
+                    fontSets: []
+                };
+
+                function e() {}
+
+                function r(e, t) {
+                    this.url = e, this.viewBoxSize = t || o.defaultViewBoxSize
+                }
+
+                function a(a, o, s, l, u, t) {
+                    var r = {},
+                        c = {},
+                        n = /[-\w@:%+.~#?&//=]{2,}\.[a-z]{2,4}\b(\/[-\w@:%+.~#?&//=]*)?/i,
+                        d = /^data:image\/svg\+xml[\s*;\w\-=]*?(base64)?,(.*)$/i;
+                    return v.prototype = {
+                        clone: function() {
+                            return this.element.cloneNode(!0)
+                        },
+                        prepare: function() {
+                            var e = this.config ? this.config.viewBoxSize : a.defaultViewBoxSize;
+                            ue.forEach({
+                                fit: "",
+                                height: "100%",
+                                width: "100%",
+                                preserveAspectRatio: "xMidYMid meet",
+                                viewBox: this.element.getAttribute("viewBox") || "0 0 " + e + " " + e,
+                                focusable: !1
+                            }, function(e, t) {
+                                this.element.setAttribute(t, e)
+                            }, this)
+                        }
+                    }, e.fontSet = function(t) {
+                        if (ue.isUndefined(t) || !t || !t.length) return a.defaultFontSet;
+                        var n = t;
+                        return ue.forEach(a.fontSets, function(e) {
+                            e.alias === t && (n = e.fontSet || n)
+                        }), n
+                    }, e;
+
+                    function e(e) {
+                        return e = e || "", ue.isString(e) || (e = t.getTrustedUrl(e)), r[e] ? s.when(i(r[e])) : n.test(e) || d.test(e) ? g(e).then(h(e)) : (-1 === e.indexOf(":") && (e = "$default:" + e), (a[e] ? p : m)(e).then(h(e)))
+                    }
+
+                    function i(e) {
+                        var n, r, i, o, a = e.clone(),
+                            s = u.nextUid(),
+                            l = ["clip-path", "color-profile", "cursor", "fill", "filter", "href", "marker-start", "marker-mid", "marker-end", "mask", "stroke", "style", "vector-effect"],
+                            c = a.innerHTML === de;
+                        if (!isFinite(Number(s))) throw new Error("Unsafe and unexpected non-number result from $mdUtil.nextUid().");
+                        return n = "_cache" + s, a.id && (a.id += n), ue.forEach(a.querySelectorAll("[id]"), function(t) {
+                            for (r = "", i = 0; i < l.length; i++) r += "[" + l[i] + '="url(#' + t.id + ')"]', i + 1 < l.length && (r += ", ");
+                            ue.forEach(a.querySelectorAll(r), function(e) {
+                                f(t, e, c, s)
+                            }), ue.forEach(a.querySelectorAll("style"), function(e) {
+                                f(t, e, c, s)
+                            }), ue.forEach(a.querySelectorAll("[*|href]:not([href])"), function(e) {
+                                (o = e.getAttribute("xlink:href")) && (o = o.replace("#" + t.id, "#" + t.id + n), e.setAttribute("xlink:href", o))
+                            }), t.id += n
+                        }), a
+                    }
+
+                    function f(e, t, n, r) {
+                        var i, o;
+                        if (!isFinite(Number(r))) throw new Error("Unsafe and unexpected non-number result for newUid.");
+                        o = "_cache" + r, n ? (i = (i = u.getOuterHTML(t)).replace("url(#" + e.id + ")", "url(#" + e.id + o + ")"), t.textContent = ue.element(i)[0].innerHTML) : t.outerHTML = t.outerHTML.replace("url(#" + e.id + ")", "url(#" + e.id + o + ")")
+                    }
+
+                    function h(n) {
+                        return function(e) {
+                            var t;
+                            return r[n] = (t = e, ue.isDefined(t.element) && ue.isDefined(t.config) ? e : new v(e, a[n])), i(r[n])
+                        }
+                    }
+
+                    function p(e) {
+                        var t = a[e];
+                        return g(t.url).then(function(e) {
+                            return new v(e, t)
+                        })
+                    }
+
+                    function m(r) {
+                        var e = r.substring(0, r.lastIndexOf(":")) || "$default",
+                            i = a[e];
+                        return i ? g(i.url).then(function(e) {
+                            var t = r.slice(r.lastIndexOf(":") + 1),
+                                n = e.querySelector("#" + t);
+                            return n ? new v(n, i) : o(r)
+                        }) : o(r);
+
+                        function o(e) {
+                            var t = "icon " + e + " not found";
+                            return l.warn(t), s.reject(t || e)
+                        }
+                    }
+
+                    function g(e) {
+                        return d.test(e) ? (t = e, n = d.exec(t), i = /base64/i.test(t) ? F.atob(n[2]) : n[2], s.when(ue.element(i)[0])) : (r = e, s(function(t, n) {
+                            o(r, !0).then(function(e) {
+                                c[r] || (c[r] = ue.element("<div>").append(e)[0].querySelector("svg")), t(c[r])
+                            }, function(e) {
+                                var t = ue.isString(e) ? e : e.message || e.data || e.statusText;
+                                l.warn(t), n(e)
+                            })
+                        }));
+                        var r, t, n, i
+                    }
+
+                    function v(e, t) {
+                        if (e && "symbol" === e.tagName.toLowerCase()) {
+                            var n = e.getAttribute("viewBox");
+                            e = e.innerHTML ? ue.element('<svg xmlns="http://www.w3.org/2000/svg">').html(e.innerHTML)[0] : ue.element('<svg xmlns="http://www.w3.org/2000/svg">').append(u.getInnerHTML(e))[0], n && e.setAttribute("viewBox", n)
+                        }
+                        e && "svg" !== e.tagName.toLowerCase() && (e = ue.element('<svg xmlns="http://www.w3.org/2000/svg">').append(e.cloneNode(!0))[0]), e.getAttribute("xmlns") || e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), this.element = e, this.config = t, this.prepare()
+                    }
+                }
+                e.prototype = {
+                    icon: function(e, t, n) {
+                        return -1 == e.indexOf(":") && (e = "$default:" + e), o[e] = new r(t, n), this
+                    },
+                    iconSet: function(e, t, n) {
+                        return o[e] = new r(t, n), this
+                    },
+                    defaultIconSet: function(e, t) {
+                        var n = "$default";
+                        return o[n] || (o[n] = new r(e, t)), o[n].viewBoxSize = t || o.defaultViewBoxSize, this
+                    },
+                    defaultViewBoxSize: function(e) {
+                        return o.defaultViewBoxSize = e, this
+                    },
+                    fontSet: function(e, t) {
+                        return o.fontSets.push({
+                            alias: e,
+                            fontSet: t || e
+                        }), this
+                    },
+                    defaultFontSet: function(e) {
+                        return o.defaultFontSet = e || "", this
+                    },
+                    defaultIconSize: function(e) {
+                        return o.defaultIconSize = e, this
+                    },
+                    $get: ["$templateRequest", "$q", "$log", "$mdUtil", "$sce", function(e, t, n, r, i) {
+                        return a(o, e, t, n, r, i)
+                    }]
+                }
+            }(),
+            function() {
+                t.$inject = ["$mdTheming", "$parse", "$$rAF"], n.$inject = ["$mdUtil", "$window", "$mdAria", "$timeout", "$mdGesture"], r.$inject = ["$animate", "$mdUtil"], i.$inject = ["$compile"], u.$inject = ["$mdUtil"], o.$inject = ["$document", "$timeout"], d.$inject = ["$$AnimateRunner", "$animateCss", "$mdUtil"], f.$inject = ["$$AnimateRunner", "$animateCss", "$mdUtil"], h.$inject = ["$$AnimateRunner", "$animateCss", "$mdUtil", "$log"];
+                var e = ue.module("material.components.input", ["material.core"]).directive("mdInputContainer", t).directive("label", function() {
                     return {
                         restrict: "E",
                         require: "^?mdInputContainer",
                         restrict: "EA",
                         link: function(e, t, n, r) {
                             if (!r) return;
-                            t.toggleClass("md-input-messages-animation", !0), t.toggleClass("md-auto-hide", !0), ("false" == n.mdAutoHide || (i = n, u.some(function(e) {
+                            t.toggleClass("md-input-messages-animation", !0), t.toggleClass("md-auto-hide", !0), ("false" == n.mdAutoHide || (i = n, c.some(function(e) {
                                 return i[e]
                             }))) && t.toggleClass("md-auto-hide", !1);
                             var i
                         },
                         require: "^^?mdInputContainer"
                     }
-                }).directive("ngMessage", d).directive("ngMessageExp", d).directive("mdSelectOnFocus", o).animation(".md-input-invalid", f).animation(".md-input-messages-animation", h).animation(".md-input-message-animation", p);
+                }).directive("ngMessage", u).directive("ngMessageExp", u).directive("mdSelectOnFocus", o).animation(".md-input-invalid", d).animation(".md-input-messages-animation", f).animation(".md-input-message-animation", h);
 
-                function t(r, o) {
-                    t.$inject = ["$scope", "$element", "$attrs", "$animate"];
+                function t(i, o, a) {
+                    n.$inject = ["$scope", "$element", "$attrs", "$animate"];
                     var e = ["INPUT", "TEXTAREA", "SELECT", "MD-SELECT"],
-                        i = e.reduce(function(e, t) {
+                        t = e.reduce(function(e, t) {
                             return e.concat(["md-icon ~ " + t, ".md-icon ~ " + t])
                         }, []).join(","),
-                        a = e.reduce(function(e, t) {
+                        s = e.reduce(function(e, t) {
                             return e.concat([t + " ~ md-icon", t + " ~ .md-icon"])
                         }, []).join(",");
                     return {
                         restrict: "E",
                         compile: function(e) {
-                            var t = e[0].querySelector(i),
-                                n = e[0].querySelector(a);
-                            t && e.addClass("md-icon-left");
-                            n && e.addClass("md-icon-right");
+                            var n = e[0].querySelector(t),
+                                r = e[0].querySelector(s);
                             return function(e, t) {
-                                r(t)
+                                i(t), (n || r) && a(function() {
+                                    var e = t[0].querySelector("md-icon") || t[0].querySelector(".md-icon");
+                                    n && e && t.addClass("md-icon-left"), r && e && t.addClass("md-icon-right")
+                                })
                             }
                         },
-                        controller: t
+                        controller: n
                     };
 
-                    function t(e, t, n, r) {
+                    function n(e, t, n, r) {
                         var i = this;
                         i.isErrorGetter = n.mdIsError && o(n.mdIsError), i.delegateClick = function() {
                             i.input.focus()
                                 m = !!e[1],
                                 g = e[1] || v.fakeNgModel(),
                                 t = e[2],
-                                n = se.isDefined(h.readonly),
+                                n = ue.isDefined(h.readonly),
                                 r = v.parseAttributeBoolean(h.mdNoAsterisk),
                                 i = f[0].tagName.toLowerCase();
                             if (!p) return; {
                             p.input = f, p.label && h.$observe("required", function(e) {
                                 p.label.toggleClass("md-required", e && !r)
                             });
-                            var o = se.element('<div class="md-errors-spacer">');
+                            var o = ue.element('<div class="md-errors-spacer">');
                             f.after(o);
-                            var a = se.isString(h.placeholder) ? h.placeholder.trim() : "";
+                            var a = ue.isString(h.placeholder) ? h.placeholder.trim() : "";
                             p.label || a.length || u.expect(f, "aria-label");
                             f.addClass("md-input"), f.attr("id") || f.attr("id", "input_" + v.nextUid());
                             "input" === i && "number" === h.type && h.min && h.max && !h.step ? f.attr("step", "any") : "textarea" === i && function() {
                                 var t = !h.hasOwnProperty("mdNoAutogrow");
                                 if (function() {
                                         if (!h.hasOwnProperty("mdNoResize")) {
-                                            var e = se.element('<div class="md-resize-handle"></div>'),
+                                            var e = ue.element('<div class="md-resize-handle"></div>'),
                                                 t = !1,
                                                 n = 0,
                                                 r = p.element,
                                 }
 
                                 function c() {
-                                    if (t && (t = !1, se.element(b).off("resize", r), n && n(), f.attr("md-no-autogrow", "").off("input", r), m)) {
+                                    if (t && (t = !1, ue.element(b).off("resize", r), n && n(), f.attr("md-no-autogrow", "").off("input", r), m)) {
                                         var e = g.$formatters.indexOf(i); - 1 < e && g.$formatters.splice(e, 1)
                                     }
                                 }
-                                if (se.element(b).on("resize", r), d.$on("$destroy", c), h.hasOwnProperty("mdDetectHidden")) {
+                                if (ue.element(b).on("resize", r), d.$on("$destroy", c), h.hasOwnProperty("mdDetectHidden")) {
                                     var e = (u = !1, function() {
                                         var e = 0 === l.offsetHeight;
                                         !1 === e && !0 === u && r(), u = e
                             isNaN(i) && (i = -1);
                             var o, a, s = n[0],
                                 l = n[1],
-                                c = !se.isDefined(t.ngTrim) || p.parseAttributeBoolean(t.ngTrim),
+                                c = !ue.isDefined(t.ngTrim) || p.parseAttributeBoolean(t.ngTrim),
                                 u = "password" === t.type;
 
                             function d(e) {
-                                return (e = c && !u && se.isString(e) ? e.trim() : e) !== le && null !== e || (e = ""), String(e).length
+                                return (e = c && !u && ue.isString(e) ? e.trim() : e) !== de && null !== e || (e = ""), String(e).length
                             }
 
                             function f() {
                                 o && o.parent() && o.text(d(r.val()) + " / " + i)
                             }
-                            s.$validators["md-maxlength"] = function(e, t) {
-                                if (!se.isNumber(i) || i < 0) return !0;
+                            e.$watch(t.mdMaxlength, function(e) {
+                                i = e
+                            }), s.$validators["md-maxlength"] = function(e, t) {
+                                if (!ue.isNumber(i) || i < 0) return !0;
                                 f();
                                 var n = r.val() || t;
-                                return n !== le && null !== n || (n = ""), n = c && !u && se.isString(n) ? n.trim() : n, String(n).length <= i
+                                return n !== de && null !== n || (n = ""), n = c && !u && ue.isString(n) ? n.trim() : n, String(n).length <= i
                             }, s.$isEmpty = function(e) {
                                 return 0 === d(e)
                             }, p.nextTick(function() {
-                                a = se.element(l.element[0].querySelector(".md-errors-spacer")), o = se.element('<div class="md-char-counter">'), a.append(o), t.$observe("ngTrim", function(e) {
-                                    c = !se.isDefined(e) || p.parseAttributeBoolean(e)
+                                a = ue.element(l.element[0].querySelector(".md-errors-spacer")), o = ue.element('<div class="md-char-counter">'), a.append(o), t.$observe("ngTrim", function(e) {
+                                    c = !ue.isDefined(e) || p.parseAttributeBoolean(e)
                                 }), e.$watch(t.mdMaxlength, function(e) {
-                                    i = e, se.isNumber(e) && 0 < e ? (o.parent().length || h.enter(o, a), f()) : h.leave(o)
+                                    ue.isNumber(e) && 0 < e ? (o.parent().length || h.enter(o, a), f()) : h.leave(o)
                                 })
                             })
                         }
                                 var i = r.element.find("label"),
                                     o = r.element.attr("md-no-float");
                                 if (i && i.length || "" === o || e.$eval(o)) return void r.setHasPlaceholder(!0);
-                                if ("MD-SELECT" != t[0].nodeName) {
-                                    var a = se.element('<label ng-click="delegateClick()" tabindex="-1">' + n.placeholder + "</label>");
+                                if ("MD-SELECT" !== t[0].nodeName) {
+                                    var a = ue.element('<label ng-click="delegateClick()" tabindex="-1" aria-hidden="true">' + n.placeholder + "</label>");
                                     n.$set("placeholder", null), r.element.addClass("md-icon-float").prepend(a), s(a)(e)
                                 }
                             }
                 F._mdMocksIncluded && e.service("$$mdInput", function() {
                     return {
                         messages: {
-                            show: m,
-                            hide: g,
-                            getElement: y
+                            getElement: b
                         }
                     }
-                }).service("mdInputInvalidAnimation", f).service("mdInputMessagesAnimation", h).service("mdInputMessageAnimation", p);
-                var a, s, l, c, u = ["ngIf", "ngShow", "ngHide", "ngSwitchWhen", "ngSwitchDefault"];
+                }).service("mdInputInvalidAnimation", d).service("mdInputMessagesAnimation", f).service("mdInputMessageAnimation", h);
+                var a, s, l, c = ["ngIf", "ngShow", "ngHide", "ngSwitchWhen", "ngSwitchDefault"];
 
-                function d(t) {
+                function u(t) {
                     return {
                         restrict: "EA",
                         compile: function(n) {
                     }
                 }
 
-                function f(e, t, n, r) {
-                    return _(e, t, n, r), {
+                function d(e, t, n) {
+                    return y(e, t, n), {
                         addClass: function(e, t, n) {
-                            m(e, n)
+                            p(e, n)
                         }
                     }
                 }
 
-                function h(e, t, n, r) {
-                    return _(e, t, n, r), {
+                function f(e, t, n) {
+                    return y(e, t, n), {
                         enter: function(e, t) {
-                            m(e, t)
+                            p(e, t)
                         },
                         leave: function(e, t) {
-                            g(e, t)
+                            m(e, t)
                         },
                         addClass: function(e, t, n) {
-                            "ng-hide" == t ? g(e, n) : n()
+                            "ng-hide" == t ? m(e, n) : n()
                         },
                         removeClass: function(e, t, n) {
-                            "ng-hide" == t ? m(e, n) : n()
+                            "ng-hide" == t ? p(e, n) : n()
                         }
                     }
                 }
 
-                function p(e, t, n, r) {
-                    return _(e, t, n, r), {
+                function h(e, t, n, r) {
+                    return y(e, t, n), {
                         enter: function(e, t) {
-                            v(e).start().done(t)
+                            g(e).start().done(t)
                         },
                         leave: function(e, t) {
-                            b(e).start().done(t)
+                            v(e).start().done(t)
                         }
                     }
                 }
 
-                function m(e, t) {
+                function p(e, t) {
                     var n, r = [],
-                        i = y(e),
+                        i = b(e),
                         o = i.children();
-                    if (0 == i.length || 0 == o.length) return c.warn("mdInput messages show animation called on invalid messages element: ", e), void t();
-                    se.forEach(o, function(e) {
-                        n = v(se.element(e)), r.push(n.start())
-                    }), a.all(r, t)
+                    0 != i.length && 0 != o.length ? (ue.forEach(o, function(e) {
+                        n = g(ue.element(e)), r.push(n.start())
+                    }), a.all(r, t)) : t()
                 }
 
-                function g(e, t) {
+                function m(e, t) {
                     var n, r = [],
-                        i = y(e),
+                        i = b(e),
                         o = i.children();
-                    if (0 == i.length || 0 == o.length) return c.warn("mdInput messages hide animation called on invalid messages element: ", e), void t();
-                    se.forEach(o, function(e) {
-                        n = b(se.element(e)), r.push(n.start())
-                    }), a.all(r, t)
+                    0 != i.length && 0 != o.length ? (ue.forEach(o, function(e) {
+                        n = v(ue.element(e)), r.push(n.start())
+                    }), a.all(r, t)) : t()
                 }
 
-                function v(e) {
+                function g(e) {
                     var t = parseInt(F.getComputedStyle(e[0]).height),
                         n = parseInt(F.getComputedStyle(e[0]).marginTop),
-                        r = y(e),
+                        r = b(e),
                         i = e.controller("mdInputContainer").element;
                     return -t < n || r.hasClass("md-auto-hide") && !i.hasClass("md-input-invalid") ? s(e, {}) : s(e, {
                         event: "enter",
                     })
                 }
 
-                function b(e) {
+                function v(e) {
                     var t = e[0].offsetHeight,
                         n = F.getComputedStyle(e[0]);
                     return 0 === parseInt(n.opacity) ? s(e, {}) : s(e, {
                     })
                 }
 
-                function y(e) {
-                    return e.hasClass("md-input-messages-animation") ? e : e.hasClass("md-input-message-animation") ? se.element(l.getClosest(e, function(e) {
+                function b(e) {
+                    return e.hasClass("md-input-messages-animation") ? e : e.hasClass("md-input-message-animation") ? ue.element(l.getClosest(e, function(e) {
                         return e.classList.contains("md-input-messages-animation")
-                    })) : se.element(e[0].querySelector(".md-input-messages-animation"))
+                    })) : ue.element(e[0].querySelector(".md-input-messages-animation"))
                 }
 
-                function _(e, t, n, r) {
-                    a = e, s = t, l = n, c = r
+                function y(e, t, n) {
+                    a = e, s = t, l = n
                 }
             }(),
             function() {
                             }
 
                             function c(e) {
-                                if ("div" == e)(r = se.element('<div class="md-no-style md-list-item-inner">')).append(o.contents()), o.addClass("md-proxy-focus");
+                                if ("div" == e)(r = ue.element('<div class="md-no-style md-list-item-inner">')).append(o.contents()), o.addClass("md-proxy-focus");
                                 else {
-                                    r = se.element('<div class="md-button md-no-style">   <div class="md-list-item-inner"></div></div>');
-                                    var t = se.element('<md-button class="md-no-style"></md-button>');
+                                    r = ue.element('<div class="md-button md-no-style">   <div class="md-list-item-inner"></div></div>');
+                                    var t = ue.element('<md-button class="md-no-style"></md-button>');
                                     u(o[0], t[0]), t.attr("aria-label") || t.attr("aria-label", f.getText(o)), o.hasClass("md-no-focus") && t.addClass("md-no-focus"), r.prepend(t), r.children().eq(1).append(o.contents()), o.addClass("_md-button-wrap")
                                 }
                                 o[0].setAttribute("tabindex", "-1"), o.append(r)
 
                             function u(t, n, e) {
                                 var r = p.prefixer(["ng-if", "ng-click", "ng-dblclick", "aria-label", "ng-disabled", "ui-sref", "href", "ng-href", "rel", "target", "ng-attr-ui-sref", "ui-sref-opts", "download"]);
-                                e && (r = r.concat(p.prefixer(e))), se.forEach(r, function(e) {
+                                e && (r = r.concat(p.prefixer(e))), ue.forEach(r, function(e) {
                                     t.hasAttribute(e) && (n.setAttribute(e, t.getAttribute(e)), t.removeAttribute(e))
                                 })
                             }
                                     if ("ngClick" === a.$normalize(t[n].name)) return !0;
                                 return !1
                             }
-                            return t = se.element('<div class="md-secondary-container">'), se.forEach(n, function(e) {
+                            return t = ue.element('<div class="md-secondary-container">'), ue.forEach(n, function(e) {
                                     ! function(e, t) {
                                         if (e && ("MD-BUTTON" != (r = e.nodeName.toUpperCase()) && "BUTTON" != r) && e.hasAttribute("ng-click")) {
                                             f.expect(e, "aria-label");
-                                            var n = se.element('<md-button class="md-secondary md-icon-button">');
+                                            var n = ue.element('<md-button class="md-secondary md-icon-button">');
                                             u(e, n[0], ["ng-if", "ng-hide", "ng-show"]), e.setAttribute("tabindex", "-1"), n.append(e), e = n[0]
                                         }
                                         var r, i;
-                                        !e || d(e) && (a.ngClick || (i = e, -1 == g.indexOf(i.nodeName.toLowerCase()))) || se.element(e).removeClass("md-secondary"), o.addClass("md-with-secondary"), t.append(e)
+                                        !e || d(e) && (a.ngClick || (i = e, -1 == g.indexOf(i.nodeName.toLowerCase()))) || ue.element(e).removeClass("md-secondary"), o.addClass("md-with-secondary"), t.append(e)
                                     }(e, t)
                                 }), r.append(t),
                                 function() {
                                             e.setAttribute("aria-label", "Toggle " + i.textContent)
                                         }
                                 }(), e && "MD-MENU" === i.nodeName && function() {
-                                    var e = se.element(i),
+                                    var e = ue.element(i),
                                         t = e.parent().hasClass("md-secondary-container") || i.parentNode.firstElementChild !== i,
                                         n = "left";
                                     t && (n = "right");
                                         a = i.hasClass("_md-button-wrap") ? o.firstElementChild : o,
                                         s = a && d(a),
                                         l = i.hasClass("md-no-proxy");
-                                    o && o.children && !s && !l && se.forEach(g, function(e) {
-                                        se.forEach(o.querySelectorAll(e + ":not(.md-secondary)"), function(e) {
+                                    o && o.children && !s && !l && ue.forEach(g, function(e) {
+                                        ue.forEach(o.querySelectorAll(e + ":not(.md-secondary)"), function(e) {
                                             r.push(e)
                                         })
-                                    }), (1 == r.length || s) && (i.addClass("md-clickable"), s || n.attachRipple(e, se.element(i[0].querySelector(".md-no-style")))), r.length && se.forEach(r, function(t) {
-                                        t = se.element(t), e.mouseActive = !1, t.on("mousedown", function() {
+                                    }), (1 == r.length || s) && (i.addClass("md-clickable"), s || n.attachRipple(e, ue.element(i[0].querySelector(".md-no-style")))), r.length && ue.forEach(r, function(t) {
+                                        t = ue.element(t), e.mouseActive = !1, t.on("mousedown", function() {
                                             e.mouseActive = !0, m(function() {
                                                 e.mouseActive = !1
                                             }, 100)
                                                     if (-1 !== t.indexOf(e.path[r].tagName.toLowerCase())) return !0
                                             }(t)) {
                                             var e = p.getClosest(t.target, "BUTTON");
-                                            !e && a.contains(t.target) && se.forEach(r, function(e) {
-                                                t.target === e || e.contains(t.target) || ("MD-MENU" === e.nodeName && (e = e.children[0]), se.element(e).triggerHandler("click"))
+                                            !e && a.contains(t.target) && ue.forEach(r, function(e) {
+                                                t.target === e || e.contains(t.target) || ("MD-MENU" === e.nodeName && (e = e.children[0]), ue.element(e).triggerHandler("click"))
                                             })
                                         }
                                     });
                         n.attach(e, t, {})
                     }
                 }
-                n.$inject = ["$scope", "$element", "$mdListInkRipple"], e.$inject = ["$mdTheming"], t.$inject = ["$mdAria", "$mdConstant", "$mdUtil", "$timeout"], se.module("material.components.list", ["material.core"]).controller("MdListController", n).directive("mdList", e).directive("mdListItem", t)
-            }(), se.module("material.components.menu", ["material.core", "material.components.backdrop"]), se.module("material.components.menuBar", ["material.core", "material.components.icon", "material.components.menu"]),
+                n.$inject = ["$scope", "$element", "$mdListInkRipple"], e.$inject = ["$mdTheming"], t.$inject = ["$mdAria", "$mdConstant", "$mdUtil", "$timeout"], ue.module("material.components.list", ["material.core"]).controller("MdListController", n).directive("mdList", e).directive("mdListItem", t)
+            }(), ue.module("material.components.menu", ["material.core", "material.components.backdrop"]),
+            function() {
+                function e(i, t, o, a, s, r, e, n, l) {
+                    var c, u, d = s.prefixer(),
+                        f = this;
+                    this.nestLevel = parseInt(t.mdNestLevel, 10) || 0, this.init = function(e, t) {
+                        t = t || {}, c = e, (u = o[0].querySelector(d.buildSelector(["ng-click", "ng-mouseenter"]))).setAttribute("aria-expanded", "false"), this.isInMenuBar = t.isInMenuBar, this.nestedMenus = s.nodesToArray(c[0].querySelectorAll(".md-nested-menu")), c.on("$mdInterimElementRemove", function() {
+                            f.isOpen = !1, s.nextTick(function() {
+                                f.onIsOpenChanged(f.isOpen)
+                            })
+                        }), s.nextTick(function() {
+                            f.onIsOpenChanged(f.isOpen)
+                        });
+                        var n = "menu_container_" + s.nextUid();
+                        c.attr("id", n), ue.element(u).attr({
+                            "aria-owns": n,
+                            "aria-haspopup": "true"
+                        }), a.$on("$destroy", ue.bind(this, function() {
+                            this.disableHoverListener(), i.destroy()
+                        })), c.on("$destroy", function() {
+                            i.destroy()
+                        })
+                    };
+                    var h, p, m = [];
+                    this.enableHoverListener = function() {
+                        m.push(e.$on("$mdMenuOpen", function(e, t) {
+                            c[0].contains(t[0]) && (f.currentlyOpenMenu = t.controller("mdMenu"), f.isAlreadyOpening = !1, f.currentlyOpenMenu.registerContainerProxy(f.triggerContainerProxy.bind(f)))
+                        })), m.push(e.$on("$mdMenuClose", function(e, t) {
+                            c[0].contains(t[0]) && (f.currentlyOpenMenu = de)
+                        })), (p = ue.element(s.nodesToArray(c[0].children[0].children))).on("mouseenter", f.handleMenuItemHover), p.on("mouseleave", f.handleMenuItemMouseLeave)
+                    }, this.disableHoverListener = function() {
+                        for (; m.length;) m.shift()();
+                        p && p.off("mouseenter", f.handleMenuItemHover), p && p.off("mouseleave", f.handleMenuItemMouseLeave)
+                    }, this.handleMenuItemHover = function(e) {
+                        if (!f.isAlreadyOpening) {
+                            var t = e.target.querySelector("md-menu") || s.getClosest(e.target, "MD-MENU");
+                            h = r(function() {
+                                if (t && (t = ue.element(t).controller("mdMenu")), f.currentlyOpenMenu && f.currentlyOpenMenu != t) {
+                                    var e = f.nestLevel + 1;
+                                    f.currentlyOpenMenu.close(!0, {
+                                        closeTo: e
+                                    }), f.isAlreadyOpening = !!t, t && t.open()
+                                } else t && !t.isOpen && t.open && (f.isAlreadyOpening = !!t, t && t.open())
+                            }, t ? 100 : 250);
+                            var n = e.currentTarget.querySelector(".md-button:not([disabled])");
+                            n && n.focus()
+                        }
+                    }, this.handleMenuItemMouseLeave = function() {
+                        h && (r.cancel(h), h = de)
+                    }, this.open = function(e) {
+                        e && e.stopPropagation(), e && e.preventDefault(), f.isOpen || (f.enableHoverListener(), f.isOpen = !0, s.nextTick(function() {
+                            f.onIsOpenChanged(f.isOpen)
+                        }), (u = u || (e ? e.target : o[0])).setAttribute("aria-expanded", "true"), a.$emit("$mdMenuOpen", o), i.show({
+                            scope: a,
+                            mdMenuCtrl: f,
+                            nestLevel: f.nestLevel,
+                            element: c,
+                            target: u,
+                            preserveElement: !0,
+                            parent: "body"
+                        }).finally(function() {
+                            u.setAttribute("aria-expanded", "false"), f.disableHoverListener()
+                        }))
+                    }, this.onIsOpenChanged = function(e) {
+                        e ? (c.attr("aria-hidden", "false"), o[0].classList.add("md-open"), ue.forEach(f.nestedMenus, function(e) {
+                            e.classList.remove("md-open")
+                        })) : (c.attr("aria-hidden", "true"), o[0].classList.remove("md-open")), a.$mdMenuIsOpen = f.isOpen
+                    }, this.focusMenuContainer = function() {
+                        var e = c[0].querySelector(d.buildSelector(["md-menu-focus-target", "md-autofocus"]));
+                        e || (e = c[0].querySelector(".md-button:not([disabled])")), e.focus()
+                    }, this.registerContainerProxy = function(e) {
+                        this.containerProxy = e
+                    }, this.triggerContainerProxy = function(e) {
+                        this.containerProxy && this.containerProxy(e)
+                    }, this.destroy = function() {
+                        return f.isOpen ? i.destroy() : n.when(!1)
+                    }, this.close = function(e, t) {
+                        if (f.isOpen) {
+                            f.isOpen = !1, s.nextTick(function() {
+                                f.onIsOpenChanged(f.isOpen)
+                            });
+                            var n = ue.extend({}, t, {
+                                skipFocus: e
+                            });
+                            if (a.$emit("$mdMenuClose", o, n), i.hide(null, t), !e) {
+                                var r = f.restoreFocusTo || o.find("button")[0];
+                                r instanceof ue.element && (r = r[0]), r && r.focus()
+                            }
+                        }
+                    }, this.positionMode = function() {
+                        var e = (t.mdPositionMode || "target").split(" ");
+                        return 1 === e.length && e.push(e[0]), {
+                            left: e[0],
+                            top: e[1]
+                        }
+                    }, this.offsets = function() {
+                        var e = (t.mdOffset || "0 0").split(" ").map(parseFloat);
+                        if (2 === e.length) return {
+                            left: e[0],
+                            top: e[1]
+                        };
+                        if (1 === e.length) return {
+                            top: e[0],
+                            left: e[0]
+                        };
+                        throw Error("Invalid offsets specified. Please follow format <x, y> or <n>")
+                    }, a.$mdMenu = {
+                        open: this.open,
+                        close: this.close
+                    }, a.$mdOpenMenu = ue.bind(this, function() {
+                        return l.warn("mdMenu: The $mdOpenMenu method is deprecated. Please use `$mdMenu.open`."), this.open.apply(this, arguments)
+                    })
+                }
+                e.$inject = ["$mdMenu", "$attrs", "$element", "$scope", "$mdUtil", "$timeout", "$rootScope", "$q", "$log"], ue.module("material.components.menu").controller("mdMenuCtrl", e)
+            }(),
+            function() {
+                function e(a) {
+                    var s = "Invalid HTML for md-menu: ";
+                    return {
+                        restrict: "E",
+                        require: ["mdMenu", "?^mdMenuBar"],
+                        controller: "mdMenuCtrl",
+                        scope: !0,
+                        compile: function(e) {
+                            e.addClass("md-menu");
+                            var t = e.children()[0],
+                                n = a.prefixer();
+                            n.hasAttribute(t, "ng-click") || (t = t.querySelector(n.buildSelector(["ng-click", "ng-mouseenter"])) || t);
+                            var r = "MD-BUTTON" === t.nodeName || "BUTTON" === t.nodeName;
+                            t && r && !t.hasAttribute("type") && t.setAttribute("type", "button");
+                            if (!t) throw Error(s + "Expected the menu to have a trigger element.");
+                            if (2 !== e.children().length) throw Error(s + "Expected two children elements. The second element must have a `md-menu-content` element.");
+                            t && t.setAttribute("aria-haspopup", "true");
+                            var i = e[0].querySelectorAll("md-menu"),
+                                o = parseInt(e[0].getAttribute("md-nest-level"), 10) || 0;
+                            i && ue.forEach(a.nodesToArray(i), function(e) {
+                                e.hasAttribute("md-position-mode") || e.setAttribute("md-position-mode", "cascade"), e.classList.add("_md-nested-menu"), e.setAttribute("md-nest-level", o + 1)
+                            });
+                            return l
+                        }
+                    };
+
+                    function l(e, t, n, r) {
+                        var i = r[0],
+                            o = !!r[1],
+                            a = ue.element('<div class="_md md-open-menu-container md-whiteframe-z2"></div>'),
+                            s = t.children()[1];
+                        t.addClass("_md"), s.hasAttribute("role") || s.setAttribute("role", "menu"), a.append(s), t.on("$destroy", function() {
+                            a.remove()
+                        }), t.append(a), a[0].style.display = "none", i.init(a, {
+                            isInMenuBar: o
+                        })
+                    }
+                }
+                e.$inject = ["$mdUtil"], ue.module("material.components.menu").directive("mdMenu", e)
+            }(),
+            function() {
+                function e(e) {
+                    t.$inject = ["$mdUtil", "$mdTheming", "$mdConstant", "$document", "$window", "$q", "$$rAF", "$animateCss", "$animate", "$log"];
+                    var x = 8;
+                    return e("$mdMenu").setDefaults({
+                        methods: ["target"],
+                        options: t
+                    });
+
+                    function t(w, c, u, E, C, d, f, h, p, m) {
+                        var k = w.prefixer(),
+                            g = w.dom.animator;
+                        return {
+                            parent: "body",
+                            onShow: function(a, n, s) {
+                                (function() {
+                                    if (!s.target) throw Error("$mdMenu.show() expected a target to animate from in options.target");
+                                    ue.extend(s, {
+                                        alreadyOpen: !1,
+                                        isRemoved: !1,
+                                        target: ue.element(s.target),
+                                        parent: ue.element(s.parent),
+                                        menuContentEl: ue.element(n[0].querySelector("md-menu-content"))
+                                    })
+                                })(), s.menuContentEl[0] ? c.inherit(s.menuContentEl, s.target) : m.warn("$mdMenu: Menu elements should always contain a `md-menu-content` element,otherwise interactivity features will not work properly.", n);
+                                return s.cleanupResizing = (r = n, i = s, o = f.throttle(function() {
+                                    if (!s.isRemoved) {
+                                        var e = b(r, i);
+                                        r.css(g.toCss(e))
+                                    }
+                                }), C.addEventListener("resize", o), C.addEventListener("orientationchange", o), function() {
+                                    C.removeEventListener("resize", o), C.removeEventListener("orientationchange", o)
+                                }), s.hideBackdrop = (e = a, t = s, t.nestLevel ? ue.noop : (t.disableParentScroll && !w.getClosest(t.target, "MD-DIALOG") ? t.restoreScroll = w.disableScrollAround(t.element, t.parent) : t.disableParentScroll = !1, t.hasBackdrop && (t.backdrop = w.createBackdrop(e, "md-menu-backdrop md-click-catcher"), p.enter(t.backdrop, E[0].body)), function() {
+                                    t.backdrop && t.backdrop.remove(), t.disableParentScroll && t.restoreScroll()
+                                })), (s.parent.append(n), n[0].style.display = "", d(function(e) {
+                                    var t = b(n, s);
+                                    n.removeClass("md-leave"), h(n, {
+                                        addClass: "md-active",
+                                        from: g.toCss(t),
+                                        to: g.toCss({
+                                            transform: ""
+                                        })
+                                    }).start().then(e)
+                                })).then(function(e) {
+                                    return s.alreadyOpen = !0, s.cleanupInteraction = function() {
+                                        if (!s.menuContentEl[0]) return ue.noop;
+                                        s.menuContentEl.on("keydown", i), s.menuContentEl[0].addEventListener("click", o, !0);
+                                        var e = s.menuContentEl[0].querySelector(k.buildSelector(["md-menu-focus-target", "md-autofocus"]));
+                                        if (!e)
+                                            for (var t = s.menuContentEl[0].children.length, n = 0; n < t; n++) {
+                                                var r = s.menuContentEl[0].children[n];
+                                                if (e = r.querySelector(".md-button:not([disabled])")) break;
+                                                if (r.firstElementChild && !r.firstElementChild.disabled) {
+                                                    e = r.firstElementChild;
+                                                    break
+                                                }
+                                            }
+                                        return e && e.focus(),
+                                            function() {
+                                                s.menuContentEl.off("keydown", i), s.menuContentEl[0].removeEventListener("click", o, !0)
+                                            };
+
+                                        function i(e) {
+                                            var t;
+                                            switch (e.keyCode) {
+                                                case u.KEY_CODE.ESCAPE:
+                                                    s.mdMenuCtrl.close(!1, {
+                                                        closeAll: !0
+                                                    }), t = !0;
+                                                    break;
+                                                case u.KEY_CODE.TAB:
+                                                    s.mdMenuCtrl.close(!1, {
+                                                        closeAll: !0
+                                                    }), t = !1;
+                                                    break;
+                                                case u.KEY_CODE.UP_ARROW:
+                                                    v(e, s.menuContentEl, s, -1) || s.nestLevel || s.mdMenuCtrl.triggerContainerProxy(e), t = !0;
+                                                    break;
+                                                case u.KEY_CODE.DOWN_ARROW:
+                                                    v(e, s.menuContentEl, s, 1) || s.nestLevel || s.mdMenuCtrl.triggerContainerProxy(e), t = !0;
+                                                    break;
+                                                case u.KEY_CODE.LEFT_ARROW:
+                                                    s.nestLevel ? s.mdMenuCtrl.close() : s.mdMenuCtrl.triggerContainerProxy(e), t = !0;
+                                                    break;
+                                                case u.KEY_CODE.RIGHT_ARROW:
+                                                    var n = w.getClosest(e.target, "MD-MENU");
+                                                    n && n != s.parent[0] ? e.target.click() : s.mdMenuCtrl.triggerContainerProxy(e), t = !0
+                                            }
+                                            t && (e.preventDefault(), e.stopImmediatePropagation())
+                                        }
+
+                                        function o(e) {
+                                            var t = e.target;
+                                            do {
+                                                if (t == s.menuContentEl[0]) return;
+                                                if ((r(t, ["ng-click", "ng-href", "ui-sref"]) || "BUTTON" == t.nodeName || "MD-BUTTON" == t.nodeName) && !r(t, ["md-prevent-menu-close"])) {
+                                                    var n = w.getClosest(t, "MD-MENU");
+                                                    t.hasAttribute("disabled") || n && n != s.parent[0] || a.$apply(function() {
+                                                        s.mdMenuCtrl.close(!0, {
+                                                            closeAll: !0
+                                                        })
+                                                    });
+                                                    break
+                                                }
+                                            } while (t = t.parentNode);
+
+                                            function r(e, t) {
+                                                if (!e) return !1;
+                                                for (var n, r = 0; n = t[r]; ++r)
+                                                    if (k.hasAttribute(e, n)) return !0;
+                                                return !1
+                                            }
+                                        }
+                                    }(), s.cleanupBackdrop = s.backdrop ? (s.backdrop.on("click", l), function() {
+                                        s.backdrop.off("click", l)
+                                    }) : ue.noop, n.addClass("md-clickable"), e
+                                });
+                                var e, t;
+                                var r, i, o;
+
+                                function l(e) {
+                                    e.preventDefault(), e.stopPropagation(), a.$apply(function() {
+                                        s.mdMenuCtrl.close(!0, {
+                                            closeAll: !0
+                                        })
+                                    })
+                                }
+                            },
+                            onRemove: function(e, n, r) {
+                                return r.cleanupInteraction(), r.cleanupBackdrop(), r.cleanupResizing(), r.hideBackdrop(), n.removeClass("md-clickable"), !0 === r.$destroy ? t() : h(n, {
+                                    addClass: "md-leave"
+                                }).start().then(t);
+
+                                function t() {
+                                    var e, t;
+                                    n.removeClass("md-active"), e = n, (t = r).preserveElement ? i(e).style.display = "none" : i(e).parentNode === i(t.parent) && i(t.parent).removeChild(i(e)), r.alreadyOpen = !1
+                                }
+                            },
+                            hasBackdrop: !0,
+                            disableParentScroll: !0,
+                            skipCompile: !0,
+                            preserveScope: !0,
+                            multiple: !0,
+                            themable: !0
+                        };
+
+                        function v(e, t, n, r) {
+                            for (var i, o = w.getClosest(e.target, "MD-MENU-ITEM"), a = w.nodesToArray(t[0].children), s = a.indexOf(o) + r; 0 <= s && s < a.length; s += r) {
+                                if (i = l(a[s].querySelector(".md-button"))) break
+                            }
+                            return i
+                        }
+
+                        function l(e) {
+                            if (e && -1 != e.getAttribute("tabindex")) return e.focus(), E[0].activeElement == e
+                        }
+
+                        function b(e, t) {
+                            var n, r = e[0],
+                                i = e[0].firstElementChild,
+                                o = i.getBoundingClientRect(),
+                                a = E[0].body.getBoundingClientRect(),
+                                s = C.getComputedStyle(i),
+                                l = t.target[0].querySelector(k.buildSelector("md-menu-origin")) || t.target[0],
+                                c = l.getBoundingClientRect(),
+                                u = {
+                                    left: a.left + x,
+                                    top: Math.max(a.top, 0) + x,
+                                    bottom: Math.max(a.bottom, Math.max(a.top, 0) + a.height) - x,
+                                    right: a.right - x
+                                },
+                                d = {
+                                    top: 0,
+                                    left: 0,
+                                    right: 0,
+                                    bottom: 0
+                                },
+                                f = {
+                                    top: 0,
+                                    left: 0,
+                                    right: 0,
+                                    bottom: 0
+                                },
+                                h = t.mdMenuCtrl.positionMode();
+                            "target" !== h.top && "target" !== h.left && "target-right" !== h.left || (n = function() {
+                                for (var e = 0; e < i.children.length; ++e)
+                                    if ("none" != C.getComputedStyle(i.children[e]).display) return i.children[e]
+                            }()) && (d = (n = (n = n.firstElementChild || n).querySelector(k.buildSelector("md-menu-align-target")) || n).getBoundingClientRect(), f = {
+                                top: parseFloat(r.style.top || 0),
+                                left: parseFloat(r.style.left || 0)
+                            });
+                            var p = {},
+                                m = "top ";
+                            switch (h.top) {
+                                case "target":
+                                    p.top = f.top + c.top - d.top;
+                                    break;
+                                case "cascade":
+                                    p.top = c.top - parseFloat(s.paddingTop) - l.style.top;
+                                    break;
+                                case "bottom":
+                                    p.top = c.top + c.height;
+                                    break;
+                                default:
+                                    throw new Error('Invalid target mode "' + h.top + '" specified for md-menu on Y axis.')
+                            }
+                            var g = "rtl" === w.bidi();
+                            switch (h.left) {
+                                case "target":
+                                    p.left = f.left + c.left - d.left, m += g ? "right" : "left";
+                                    break;
+                                case "target-left":
+                                    p.left = c.left, m += "left";
+                                    break;
+                                case "target-right":
+                                    p.left = c.right - o.width + (o.right - d.right), m += "right";
+                                    break;
+                                case "cascade":
+                                    var v = g ? c.left - o.width < u.left : c.right + o.width < u.right;
+                                    p.left = v ? c.right - l.style.left : c.left - l.style.left - o.width, m += v ? "left" : "right";
+                                    break;
+                                case "right":
+                                    g ? (p.left = c.right - c.width, m += "left") : (p.left = c.right - o.width, m += "right");
+                                    break;
+                                case "left":
+                                    g ? (p.left = c.right - o.width, m += "right") : (p.left = c.left, m += "left");
+                                    break;
+                                default:
+                                    throw new Error('Invalid target mode "' + h.left + '" specified for md-menu on X axis.')
+                            }
+                            var b, y = t.mdMenuCtrl.offsets();
+                            p.top += y.top, p.left += y.left, (b = p).top = Math.max(Math.min(b.top, u.bottom - r.offsetHeight), u.top), b.left = Math.max(Math.min(b.left, u.right - r.offsetWidth), u.left);
+                            var _ = Math.round(100 * Math.min(c.width / r.offsetWidth, 1)) / 100,
+                                $ = Math.round(100 * Math.min(c.height / r.offsetHeight, 1)) / 100;
+                            return {
+                                top: Math.round(p.top),
+                                left: Math.round(p.left),
+                                transform: t.alreadyOpen ? de : w.supplant("scale({0},{1})", [_, $]),
+                                transformOrigin: m
+                            }
+                        }
+                    }
+
+                    function i(e) {
+                        return e instanceof ue.element && (e = e[0]), e
+                    }
+                }
+                e.$inject = ["$$interimElementProvider"], ue.module("material.components.menu").provider("$mdMenu", e)
+            }(), ue.module("material.components.menuBar", ["material.core", "material.components.icon", "material.components.menu"]),
+            function() {
+                e.$inject = ["$scope", "$rootScope", "$element", "$attrs", "$mdConstant", "$document", "$mdUtil", "$timeout"], ue.module("material.components.menuBar").controller("MenuBarController", e);
+                var c = ["handleKeyDown", "handleMenuHover", "scheduleOpenHoveredMenu", "cancelScheduledOpen"];
+
+                function e(e, t, n, r, i, o, a, s) {
+                    this.$element = n, this.$attrs = r, this.$mdConstant = i, this.$mdUtil = a, this.$document = o, this.$scope = e, this.$rootScope = t, this.$timeout = s;
+                    var l = this;
+                    ue.forEach(c, function(e) {
+                        l[e] = ue.bind(l, l[e])
+                    })
+                }
+                e.prototype.init = function() {
+                    var o = this.$element,
+                        a = this.$mdUtil,
+                        e = this.$scope,
+                        s = this,
+                        t = [];
+                    o.on("keydown", this.handleKeyDown), this.parentToolbar = a.getClosest(o, "MD-TOOLBAR"), t.push(this.$rootScope.$on("$mdMenuOpen", function(e, t) {
+                        -1 != s.getMenus().indexOf(t[0]) && (o[0].classList.add("md-open"), t[0].classList.add("md-open"), s.currentlyOpenMenu = t.controller("mdMenu"), s.currentlyOpenMenu.registerContainerProxy(s.handleKeyDown), s.enableOpenOnHover())
+                    })), t.push(this.$rootScope.$on("$mdMenuClose", function(e, t, n) {
+                        var r = s.getMenus();
+                        if (-1 != r.indexOf(t[0]) && (o[0].classList.remove("md-open"), t[0].classList.remove("md-open")), o[0].contains(t[0])) {
+                            for (var i = t[0]; i && -1 == r.indexOf(i);) i = a.getClosest(i, "MD-MENU", !0);
+                            i && (n.skipFocus || i.querySelector("button:not([disabled])").focus(), s.currentlyOpenMenu = de, s.disableOpenOnHover(), s.setKeyboardMode(!0))
+                        }
+                    })), e.$on("$destroy", function() {
+                        for (s.disableOpenOnHover(); t.length;) t.shift()()
+                    }), this.setKeyboardMode(!0)
+                }, e.prototype.setKeyboardMode = function(e) {
+                    e ? this.$element[0].classList.add("md-keyboard-mode") : this.$element[0].classList.remove("md-keyboard-mode")
+                }, e.prototype.enableOpenOnHover = function() {
+                    if (!this.openOnHoverEnabled) {
+                        var e = this;
+                        e.openOnHoverEnabled = !0, e.parentToolbar && (e.parentToolbar.classList.add("md-has-open-menu"), e.$mdUtil.nextTick(function() {
+                            ue.element(e.parentToolbar).on("click", e.handleParentClick)
+                        }, !1)), ue.element(e.getMenus()).on("mouseenter", e.handleMenuHover)
+                    }
+                }, e.prototype.handleMenuHover = function(e) {
+                    this.setKeyboardMode(!1), this.openOnHoverEnabled && this.scheduleOpenHoveredMenu(e)
+                }, e.prototype.disableOpenOnHover = function() {
+                    this.openOnHoverEnabled && (this.openOnHoverEnabled = !1, this.parentToolbar && (this.parentToolbar.classList.remove("md-has-open-menu"), ue.element(this.parentToolbar).off("click", this.handleParentClick)), ue.element(this.getMenus()).off("mouseenter", this.handleMenuHover))
+                }, e.prototype.scheduleOpenHoveredMenu = function(e) {
+                    var t = ue.element(e.currentTarget).controller("mdMenu");
+                    this.setKeyboardMode(!1), this.scheduleOpenMenu(t)
+                }, e.prototype.scheduleOpenMenu = function(e) {
+                    var t = this,
+                        n = this.$timeout;
+                    e != t.currentlyOpenMenu && (n.cancel(t.pendingMenuOpen), t.pendingMenuOpen = n(function() {
+                        t.pendingMenuOpen = de, t.currentlyOpenMenu && t.currentlyOpenMenu.close(!0, {
+                            closeAll: !0
+                        }), e.open()
+                    }, 200, !1))
+                }, e.prototype.handleKeyDown = function(e) {
+                    var t, n, r, i = this.$mdConstant.KEY_CODE,
+                        o = this.currentlyOpenMenu,
+                        a = o && o.isOpen;
+                    switch (this.setKeyboardMode(!0), e.keyCode) {
+                        case i.DOWN_ARROW:
+                            o ? o.focusMenuContainer() : this.openFocusedMenu(), t = !0;
+                            break;
+                        case i.UP_ARROW:
+                            o && o.close(), t = !0;
+                            break;
+                        case i.LEFT_ARROW:
+                            n = this.focusMenu(-1), a && (r = ue.element(n).controller("mdMenu"), this.scheduleOpenMenu(r)), t = !0;
+                            break;
+                        case i.RIGHT_ARROW:
+                            n = this.focusMenu(1), a && (r = ue.element(n).controller("mdMenu"), this.scheduleOpenMenu(r)), t = !0
+                    }
+                    t && (e && e.preventDefault && e.preventDefault(), e && e.stopImmediatePropagation && e.stopImmediatePropagation())
+                }, e.prototype.focusMenu = function(e) {
+                    var t = this.getMenus(),
+                        n = this.getFocusedMenuIndex(); - 1 == n && (n = this.getOpenMenuIndex());
+                    var r = !1;
+                    if (-1 == n ? r = !(n = 0) : (e < 0 && 0 < n || 0 < e && n < t.length - e) && (n += e, r = !0), r) return t[n].querySelector("button").focus(), t[n]
+                }, e.prototype.openFocusedMenu = function() {
+                    var e = this.getFocusedMenu();
+                    e && ue.element(e).controller("mdMenu").open()
+                }, e.prototype.getMenus = function() {
+                    var e = this.$element;
+                    return this.$mdUtil.nodesToArray(e[0].children).filter(function(e) {
+                        return "MD-MENU" == e.nodeName
+                    })
+                }, e.prototype.getFocusedMenu = function() {
+                    return this.getMenus()[this.getFocusedMenuIndex()]
+                }, e.prototype.getFocusedMenuIndex = function() {
+                    var e = this.$mdUtil.getClosest(this.$document[0].activeElement, "MD-MENU");
+                    return e ? this.getMenus().indexOf(e) : -1
+                }, e.prototype.getOpenMenuIndex = function() {
+                    for (var e = this.getMenus(), t = 0; t < e.length; ++t)
+                        if (e[t].classList.contains("md-open")) return t;
+                    return -1
+                }, e.prototype.handleParentClick = function(e) {
+                    var t = this.querySelector("md-menu.md-open");
+                    t && !t.contains(e.target) && ue.element(t).controller("mdMenu").close(!0, {
+                        closeAll: !0
+                    })
+                }
+            }(),
+            function() {
+                function e(n, i) {
+                    return {
+                        restrict: "E",
+                        require: "mdMenuBar",
+                        controller: "MenuBarController",
+                        compile: function(e, t) {
+                            return t.ariaRole || e[0].setAttribute("role", "menubar"), ue.forEach(e[0].children, function(e) {
+                                    if ("MD-MENU" == e.nodeName) {
+                                        e.hasAttribute("md-position-mode") || (e.setAttribute("md-position-mode", "left bottom"), e.querySelector("button, a, md-button").setAttribute("role", "menuitem"));
+                                        var t = n.nodesToArray(e.querySelectorAll("md-menu-content"));
+                                        ue.forEach(t, function(e) {
+                                            e.classList.add("md-menu-bar-menu"), e.classList.add("md-dense"), e.hasAttribute("width") || e.setAttribute("width", 5)
+                                        })
+                                    }
+                                }), e.find("md-menu-item").addClass("md-in-menu-bar"),
+                                function(e, t, n, r) {
+                                    t.addClass("_md"), i(e, t), r.init()
+                                }
+                        }
+                    }
+                }
+                e.$inject = ["$mdUtil", "$mdTheming"], ue.module("material.components.menuBar").directive("mdMenuBar", e)
+            }(), ue.module("material.components.menuBar").directive("mdMenuDivider", function() {
+                return {
+                    restrict: "E",
+                    compile: function(e, t) {
+                        t.role || e[0].setAttribute("role", "separator")
+                    }
+                }
+            }),
+            function() {
+                function e(e, t, n) {
+                    this.$element = t, this.$attrs = n, this.$scope = e
+                }
+                e.$inject = ["$scope", "$element", "$attrs"], ue.module("material.components.menuBar").controller("MenuItemController", e), e.prototype.init = function(e) {
+                    var t = this.$element,
+                        n = this.$attrs;
+                    this.ngModel = e, "checkbox" != n.type && "radio" != n.type || (this.mode = n.type, this.iconEl = t[0].children[0], this.buttonEl = t[0].children[1], e && this.initClickListeners())
+                }, e.prototype.clearNgAria = function() {
+                    var t = this.$element[0];
+                    ue.forEach(["role", "tabindex", "aria-invalid", "aria-checked"], function(e) {
+                        t.removeAttribute(e)
+                    })
+                }, e.prototype.initClickListeners = function() {
+                    var e = this,
+                        t = this.ngModel,
+                        n = this.$scope,
+                        r = this.$attrs,
+                        i = (this.$element, this.mode);
+                    this.handleClick = ue.bind(this, this.handleClick);
+                    var o = this.iconEl,
+                        a = ue.element(this.buttonEl),
+                        s = this.handleClick;
+
+                    function l(e) {
+                        e ? a.off("click", s) : a.on("click", s)
+                    }
+                    r.$observe("disabled", l), l(r.disabled), t.$render = function() {
+                        e.clearNgAria(), ! function() {
+                            {
+                                if ("radio" != i) return t.$modelValue;
+                                var e = r.ngValue ? n.$eval(r.ngValue) : r.value;
+                                return t.$modelValue == e
+                            }
+                        }() ? (o.style.display = "none", a.attr("aria-checked", "false")) : (o.style.display = "", a.attr("aria-checked", "true"))
+                    }, n.$$postDigest(t.$render)
+                }, e.prototype.handleClick = function(e) {
+                    var t, n = this.mode,
+                        r = this.ngModel,
+                        i = this.$attrs;
+                    "checkbox" == n ? t = !r.$modelValue : "radio" == n && (t = i.ngValue ? this.$scope.$eval(i.ngValue) : i.value), r.$setViewValue(t), r.$render()
+                }
+            }(),
+            function() {
+                function e(u, e, d) {
+                    return {
+                        controller: "MenuItemController",
+                        require: ["mdMenuItem", "?ngModel"],
+                        priority: e.BEFORE_NG_ARIA,
+                        compile: function(r, e) {
+                            var t, n, i = e.type,
+                                o = "md-in-menu-bar";
+                            if ("checkbox" !== i && "radio" !== i || !r.hasClass(o)) c("role", "menuitem", r[0].querySelector("md-button, button, a"));
+                            else {
+                                var a = r[0].textContent,
+                                    s = ue.element('<md-button type="button"></md-button>'),
+                                    l = '<md-icon md-svg-src="' + d.mdChecked + '"></md-icon>';
+                                s.html(a), s.attr("tabindex", "0"), ue.isDefined(e.mdPreventMenuClose) && s.attr("md-prevent-menu-close", e.mdPreventMenuClose), r.html(""), r.append(ue.element(l)), r.append(s), r.addClass("md-indent").removeClass(o), c("role", "checkbox" === i ? "menuitemcheckbox" : "menuitemradio", s), t = "ng-disabled", n = u.prefixer(t), ue.forEach(n, function(e) {
+                                    if (r[0].hasAttribute(e)) {
+                                        var t = r[0].getAttribute(e);
+                                        s[0].setAttribute(e, t), r[0].removeAttribute(e)
+                                    }
+                                })
+                            }
+                            return function(e, t, n, r) {
+                                var i = r[0],
+                                    o = r[1];
+                                i.init(o)
+                            };
+
+                            function c(e, t, n) {
+                                (n = n || r) instanceof ue.element && (n = n[0]), n.hasAttribute(e) || n.setAttribute(e, t)
+                            }
+                        }
+                    }
+                }
+                e.$inject = ["$mdUtil", "$mdConstant", "$$mdSvgRegistry"], ue.module("material.components.menuBar").directive("mdMenuItem", e)
+            }(),
             function() {
                 function e(i, o) {
                     return {
                             mdNoInkBar: "=?",
                             navBarAriaLabel: "@?"
                         },
-                        template: '<div class="md-nav-bar"><nav role="navigation"><ul class="_md-nav-bar-list" ng-transclude role="listbox" tabindex="0" ng-focus="ctrl.onFocus()" ng-keydown="ctrl.onKeydown($event)" aria-label="{{ctrl.navBarAriaLabel}}"></ul></nav><md-nav-ink-bar ng-hide="ctrl.mdNoInkBar"></md-nav-ink-bar></div>',
+                        template: '<div class="md-nav-bar"><nav role="navigation"><ul class="_md-nav-bar-list" ng-transclude role="tablist" ng-focus="ctrl.onFocus()" aria-label="{{ctrl.navBarAriaLabel}}"></ul></nav><md-nav-ink-bar ng-hide="ctrl.mdNoInkBar"></md-nav-ink-bar></div>',
                         link: function(e, t, n, r) {
-                            o(t), r.navBarAriaLabel || i.expectAsync(t, "aria-label", se.noop)
+                            o(t), r.navBarAriaLabel || i.expectAsync(t, "aria-label", ue.noop)
                         }
                     }
                 }
                                 o = t.mdNavHref,
                                 a = t.mdNavSref,
                                 s = t.srefOpts;
-                            if (1 < (i ? 1 : 0) + (o ? 1 : 0) + (a ? 1 : 0)) throw Error("Must not specify more than one of the md-nav-click, md-nav-href, or md-nav-sref attributes per nav-item directive.");
-                            return i ? n = 'ng-click="ctrl.mdNavClick()"' : o ? n = 'ng-href="{{ctrl.mdNavHref}}"' : a && (n = 'ui-sref="{{ctrl.mdNavSref}}"'), n && (r = '<md-button class="_md-nav-button md-accent" ng-class="ctrl.getNgClassMap()" ng-blur="ctrl.setFocused(false)" ng-disabled="ctrl.disabled" tabindex="-1" ' + (s ? 'ui-sref-opts="{{ctrl.srefOpts}}" ' : "") + n + '><span ng-transclude class="_md-nav-button-text"></span></md-button>'), '<li class="md-nav-item" role="option" aria-selected="{{ctrl.isSelected()}}">' + (r || "") + "</li>"
+                            if (1 < (i ? 1 : 0) + (o ? 1 : 0) + (a ? 1 : 0)) throw Error("Please do not specify more than one of the md-nav-click, md-nav-href, or md-nav-sref attributes per nav-item directive.");
+                            if (i !== de && null !== i) n = 'ng-click="ctrl.mdNavClick()"';
+                            else if (o !== de && null !== o) n = 'ng-href="{{ctrl.mdNavHref}}"';
+                            else {
+                                if (a === de || null === a) throw Error("Please specify at least one of the md-nav-click, md-nav-href, or md-nav-sref attributes per nav-item directive.");
+                                n = 'ui-sref="{{ctrl.mdNavSref}}"'
+                            }
+                            return n && (r = '<md-button class="_md-nav-button md-accent" ng-class="ctrl.getNgClassMap()" ng-blur="ctrl.setFocused(false)" ng-disabled="ctrl.disabled" tabindex="-1" role="tab" ng-attr-aria-label="{{ctrl.navItemAriaLabel ? ctrl.navItemAriaLabel : undefined}}" aria-selected="{{ctrl.isSelected()}}" ' + (s ? 'ui-sref-opts="{{ctrl.srefOpts}}" ' : "") + n + '><span ng-transclude class="_md-nav-button-text"></span></md-button>'), '<li class="md-nav-item" role="presentation">' + (r || "") + "</li>"
                         },
                         scope: {
                             mdNavClick: "&?",
                             mdNavHref: "@?",
                             mdNavSref: "@?",
                             srefOpts: "=?",
-                            name: "@"
+                            name: "@",
+                            navItemAriaLabel: "@?"
                         },
-                        link: function(o, a, s, l) {
-                            var c;
+                        link: function(n, r, i, o) {
+                            var a, s, l, c;
                             e(function() {
-                                var t = l[0],
-                                    e = l[1],
-                                    n = se.element(a[0].querySelector("._md-nav-button"));
-                                if (t.name || (t.name = se.element(a[0].querySelector("._md-nav-button-text")).text().trim()), n.on("click", function() {
-                                        e.mdSelectedNavItem = t.name, o.$apply()
-                                    }), t.disabled = d.parseAttributeBoolean(s.disabled, !1), "MutationObserver" in f) {
-                                    var r = a[0],
-                                        i = new MutationObserver(function(e) {
+                                if (s = o[0], l = o[1], c = ue.element(r[0].querySelector("._md-nav-button")), s.name || (s.name = ue.element(r[0].querySelector("._md-nav-button-text")).text().trim()), c.on("keydown", function(e) {
+                                        l.onKeydown(e)
+                                    }), c.on("focus", function() {
+                                        l.getFocusedTab() || l.onFocus()
+                                    }), c.on("click", function() {
+                                        l.mdSelectedNavItem = s.name, n.$apply()
+                                    }), s.disabled = d.parseAttributeBoolean(i.disabled, !1), "MutationObserver" in f) {
+                                    var e = r[0],
+                                        t = new MutationObserver(function(e) {
                                             d.nextTick(function() {
-                                                t.disabled = d.parseAttributeBoolean(s[e[0].attributeName], !1)
+                                                s.disabled = d.parseAttributeBoolean(i[e[0].attributeName], !1)
                                             })
                                         });
-                                    i.observe(r, {
+                                    t.observe(e, {
                                         attributes: !0,
                                         attributeFilter: ["disabled"]
-                                    }), c = i.disconnect.bind(i)
-                                } else s.$observe("disabled", function(e) {
-                                    t.disabled = d.parseAttributeBoolean(e, !1)
+                                    }), a = t.disconnect.bind(t)
+                                } else i.$observe("disabled", function(e) {
+                                    s.disabled = d.parseAttributeBoolean(e, !1)
                                 });
-                                u.expectWithText(a, "aria-label")
-                            }), o.$on("destroy", function() {
-                                c()
+                                s.navItemAriaLabel || u.expectWithText(c, "aria-label")
+                            }), n.$on("destroy", function() {
+                                c.off("keydown"), c.off("focus"), c.off("click"), a()
                             })
                         }
                     }
                 }
 
                 function r(e) {
-                    this._$element = e, this.mdNavClick, this.mdNavHref, this.mdNavSref, this.srefOpts, this.name, this._selected = !1, this._focused = !1
+                    this._$element = e, this.mdNavClick, this.mdNavHref, this.mdNavSref, this.srefOpts, this.name, this.navItemAriaLabel, this._selected = !1, this._focused = !1
                 }
-                t.$inject = ["$element", "$scope", "$timeout", "$mdConstant"], n.$inject = ["$mdAria", "$$rAF", "$mdUtil", "$window"], r.$inject = ["$element"], e.$inject = ["$mdAria", "$mdTheming"], se.module("material.components.navBar", ["material.core"]).controller("MdNavBarController", t).directive("mdNavBar", e).controller("MdNavItemController", r).directive("mdNavItem", n), t.prototype._initTabs = function() {
-                    this._inkbar = se.element(this._navBarEl.querySelector("md-nav-ink-bar"));
+                e.$inject = ["$mdAria", "$mdTheming"], t.$inject = ["$element", "$scope", "$timeout", "$mdConstant"], n.$inject = ["$mdAria", "$$rAF", "$mdUtil", "$window"], r.$inject = ["$element"], ue.module("material.components.navBar", ["material.core"]).controller("MdNavBarController", t).directive("mdNavBar", e).controller("MdNavItemController", r).directive("mdNavItem", n), t.prototype._initTabs = function() {
+                    this._inkbar = ue.element(this._navBarEl.querySelector("md-nav-ink-bar"));
                     var n = this;
                     this._$timeout(function() {
-                        n._updateTabs(n.mdSelectedNavItem, le)
+                        n._updateTabs(n.mdSelectedNavItem, de)
                     }), this._$scope.$watch("ctrl.mdSelectedNavItem", function(e, t) {
                         n._$timeout(function() {
                             n._updateTabs(e, t)
                     })
                 }, t.prototype._updateTabs = function(e, t) {
                     var n = this,
-                        r = this._getTabs();
+                        r = this._getTabs(),
+                        i = e === t;
                     if (r) {
-                        var i = -1,
-                            o = -1,
-                            a = this._getTabByName(e),
-                            s = this._getTabByName(t);
-                        s && (s.setSelected(!1), i = r.indexOf(s)), a && (a.setSelected(!0), o = r.indexOf(a)), this._$timeout(function() {
-                            n._updateInkBarStyles(a, o, i)
+                        var o = -1,
+                            a = -1,
+                            s = this._getTabByName(e),
+                            l = this._getTabByName(t);
+                        l && (l.setSelected(!1), o = r.indexOf(l)), s && (s.setSelected(!0), a = r.indexOf(s)), this._$timeout(function() {
+                            n._updateInkBarStyles(s, a, o), s && l && !i && n._moveFocus(l, s)
                         })
                     }
                 }, t.prototype._updateInkBarStyles = function(e, t, n) {
                     }
                 }, t.prototype._getTabs = function() {
                     var e = Array.prototype.slice.call(this._navBarEl.querySelectorAll(".md-nav-item")).map(function(e) {
-                        return se.element(e).controller("mdNavItem")
+                        return ue.element(e).controller("mdNavItem")
                     });
-                    return e.indexOf(le) ? e : null
+                    return e.indexOf(de) ? e : null
                 }, t.prototype._getTabByName = function(t) {
                     return this._findTab(function(e) {
-                        return e.getName() == t
+                        return e.getName() === t
                     })
                 }, t.prototype._getSelectedTab = function() {
                     return this._findTab(function(e) {
                     return this._findTab(function(e) {
                         return e.hasFocus()
                     })
-                }, t.prototype._findTab = function(e) {
-                    for (var t = this._getTabs(), n = 0; n < t.length; n++)
-                        if (e(t[n])) return t[n];
+                }, t.prototype._findTab = function(e, t) {
+                    var n = this._getTabs();
+                    t !== de && null !== t || (t = 0);
+                    for (var r = t; r < n.length; r++)
+                        if (e(n[r])) return n[r];
+                    return null
+                }, t.prototype._findTabReverse = function(e, t) {
+                    var n = this._getTabs();
+                    t !== de && null !== t || (t = n.length - 1);
+                    for (var r = t; 0 <= r; r--)
+                        if (e(n[r])) return n[r];
                     return null
                 }, t.prototype.onFocus = function() {
                     var e = this._getSelectedTab();
                     e && e.setFocused(!0)
                 }, t.prototype._moveFocus = function(e, t) {
                     e.setFocused(!1), t.setFocused(!0)
+                }, t.prototype._focusFirstTab = function() {
+                    if (this._getTabs()) {
+                        var e = this._findTab(function(e) {
+                            return e._isEnabled()
+                        });
+                        e && this._moveFocus(this.getFocusedTab(), e)
+                    }
+                }, t.prototype._focusLastTab = function() {
+                    if (this._getTabs()) {
+                        var e = this._findTabReverse(function(e) {
+                            return e._isEnabled()
+                        });
+                        e && this._moveFocus(this.getFocusedTab(), e)
+                    }
+                }, t.prototype._focusNextTab = function(e) {
+                    if (this._getTabs()) {
+                        var t = this._findTab(function(e) {
+                            return e._isEnabled()
+                        }, e + 1);
+                        t ? this._moveFocus(this.getFocusedTab(), t) : this._focusFirstTab()
+                    }
+                }, t.prototype._focusPreviousTab = function(e) {
+                    if (this._getTabs()) {
+                        var t = this._findTabReverse(function(e) {
+                            return e._isEnabled()
+                        }, e - 1);
+                        t ? this._moveFocus(this.getFocusedTab(), t) : this._focusLastTab()
+                    }
                 }, t.prototype.onKeydown = function(e) {
                     var t = this._$mdConstant.KEY_CODE,
                         n = this._getTabs(),
                         r = this.getFocusedTab();
-                    if (r) {
+                    if (r && n) {
                         var i = n.indexOf(r);
                         switch (e.keyCode) {
                             case t.UP_ARROW:
                             case t.LEFT_ARROW:
-                                0 < i && this._moveFocus(r, n[i - 1]);
+                                e.preventDefault(), this._focusPreviousTab(i);
                                 break;
                             case t.DOWN_ARROW:
                             case t.RIGHT_ARROW:
-                                i < n.length - 1 && this._moveFocus(r, n[i + 1]);
+                                e.preventDefault(), this._focusNextTab(i);
                                 break;
                             case t.SPACE:
                             case t.ENTER:
                                 this._$timeout(function() {
                                     r.getButtonEl().click()
-                                })
+                                });
+                                break;
+                            case t.HOME:
+                                e.preventDefault(), this._focusFirstTab();
+                                break;
+                            case t.END:
+                                e.preventDefault(), this._focusLastTab()
                         }
                     }
                 }, r.prototype.getNgClassMap = function() {
                 }, r.prototype.getButtonEl = function() {
                     return this._$element[0].querySelector("._md-nav-button")
                 }, r.prototype.setSelected = function(e) {
-                    this._selected = e
+                    (this._selected = e) ? this.getButtonEl().setAttribute("tabindex", "0"): this.getButtonEl().setAttribute("tabindex", "-1")
                 }, r.prototype.isSelected = function() {
                     return this._selected
                 }, r.prototype.setFocused = function(e) {
                     (this._focused = e) && this.getButtonEl().focus()
                 }, r.prototype.hasFocus = function() {
                     return this._focused
+                }, r.prototype._isEnabled = function() {
+                    return !this._$element.attr("disabled")
                 }
             }(),
             function() {
-                s.$inject = ["presets", "$rootElement", "$rootScope", "$injector", "$window"], se.module("material.components.panel", ["material.core", "material.components.backdrop"]).provider("$mdPanel", function() {
+                s.$inject = ["presets", "$rootElement", "$rootScope", "$injector", "$window"], ue.module("material.components.panel", ["material.core", "material.components.backdrop"]).provider("$mdPanel", function() {
                     return {
                         definePreset: e,
                         getAllPresets: t,
                 });
                 var o = 80,
                     a = "_md-panel-hidden",
-                    n = se.element('<div class="_md-panel-focus-trap" tabindex="0"></div>'),
+                    n = ue.element('<div class="_md-panel-focus-trap" tabindex="0"></div>'),
                     i = {};
 
                 function e(e, t) {
                 }
 
                 function t() {
-                    return se.copy(i)
+                    return ue.copy(i)
                 }
 
                 function r() {
                         fullscreen: !1,
                         hasBackdrop: !1,
                         propagateContainerEvents: !1,
-                        transformTemplate: se.bind(this, this._wrapTemplate),
+                        transformTemplate: ue.bind(this, this._wrapTemplate),
                         trapFocus: !1,
                         zIndex: o
                     }, this._config = {}, this._presets = e, this._$rootElement = t, this._$rootScope = n, this._$injector = r, this._$window = i, this._$mdUtil = this._$injector.get("$mdUtil"), this._trackedPanels = {}, this._groups = Object.create(null), this.animation = c.animation, this.xPosition = p.xPosition, this.yPosition = p.yPosition, this.interceptorTypes = l.interceptorTypes, this.closeReasons = l.closeReasons, this.absPosition = p.absPosition
                 }
 
                 function u(e) {
-                    var t = se.isString(e) ? document.querySelector(e) : e;
-                    return se.element(t)
+                    var t = ue.isString(e) ? document.querySelector(e) : e;
+                    return ue.element(t)
                 }
 
                 function d(e) {
-                    return se.isNumber(e) ? e + "px" : e
+                    return ue.isNumber(e) ? e + "px" : e
                 }
                 s.prototype.create = function(e, t) {
-                    if ("string" == typeof e ? e = this._getPresetByName(e) : "object" != typeof e || !se.isUndefined(t) && t || (t = e, e = {}), e = e || {}, t = t || {}, se.isDefined(t.id) && this._trackedPanels[t.id]) {
+                    if ("string" == typeof e ? e = this._getPresetByName(e) : "object" != typeof e || !ue.isUndefined(t) && t || (t = e, e = {}), e = e || {}, t = t || {}, ue.isDefined(t.id) && this._trackedPanels[t.id]) {
                         var n = this._trackedPanels[t.id];
-                        return se.extend(n.config, t), n
+                        return ue.extend(n.config, t), n
                     }
-                    this._config = se.extend({
+                    this._config = ue.extend({
                         id: t.id || "panel_" + this._$mdUtil.nextUid(),
                         scope: this._$rootScope.$new(!0),
                         attachTo: this._$rootElement
                     }, this._defaultConfigOptions, t, e);
                     var r = new l(this._config, this._$injector);
-                    return this._trackedPanels[t.id] = r, this._config.groupName && (se.isString(this._config.groupName) && (this._config.groupName = [this._config.groupName]), se.forEach(this._config.groupName, function(e) {
+                    return this._trackedPanels[this._config.id] = r, this._config.groupName && (ue.isString(this._config.groupName) && (this._config.groupName = [this._config.groupName]), ue.forEach(this._config.groupName, function(e) {
                         r.addToGroup(e)
-                    })), this._config.scope.$on("$destroy", se.bind(r, r.detach)), r
+                    })), this._config.scope.$on("$destroy", ue.bind(r, r.detach)), r
                 }, s.prototype.open = function(e, t) {
                     var n = this.create(e, t);
                     return n.open().then(function() {
                 }, s.prototype._wrapTemplate = function(e) {
                     return '<div class="md-panel-outer-wrapper">  <div class="md-panel _md-panel-offscreen">' + (e || "") + "</div></div>"
                 }, s.prototype._wrapContentElement = function(e) {
-                    var t = se.element('<div class="md-panel-outer-wrapper">');
+                    var t = ue.element('<div class="md-panel-outer-wrapper">');
                     return e.addClass("md-panel _md-panel-offscreen"), t.append(e), t
                 }, l.interceptorTypes = {
                     CLOSE: "onClose"
                         var n = i._done(e, i),
                             r = i._simpleBind(i.show, i);
                         i.attach().then(r).then(function() {
-                            i.config.groupName && se.forEach(i.config.groupName, function(e) {
+                            i.config.groupName && ue.forEach(i.config.groupName, function(e) {
                                 i._$mdPanel._openCountExceedsMaxOpen(e) && i._$mdPanel._closeFirstOpenedPanel(e)
                             })
                         }).then(n).catch(t)
                         a._callInterceptors(l.interceptorTypes.CLOSE).then(function() {
                             var e = a._done(r, a),
                                 t = a._simpleBind(a.detach, a),
-                                n = a.config.onCloseSuccess || se.noop;
-                            n = se.bind(a, n, a, o), a.hide().then(t).then(e).then(n).catch(i)
+                                n = a.config.onCloseSuccess || ue.noop;
+                            n = ue.bind(a, n, a, o), a.hide().then(t).then(e).then(n).catch(i)
                         }, i)
                     })
                 }, l.prototype.attach = function() {
                     var i = this;
                     return this._$q(function(e, t) {
                         var n = i._done(e, i),
-                            r = i.config.onDomAdded || se.noop;
+                            r = i.config.onDomAdded || ue.noop;
                         i._$q.all([i._createBackdrop(), i._createPanel().then(function(e) {
                             return i.isAttached = !0, i._addEventListeners(), e
                         }).catch(t)]).then(r).then(n).catch(t)
                 }, l.prototype.detach = function() {
                     if (!this.isAttached) return this._$q.when(this);
                     var r = this,
-                        i = r.config.onDomRemoved || se.noop;
+                        i = r.config.onDomRemoved || ue.noop;
                     return this._restoreScroll && (this._restoreScroll(), this._restoreScroll = null), this._$q(function(e, t) {
                         var n = r._done(e, r);
                         r._$q.all([(r._removeEventListeners(), r._topFocusTrap && r._topFocusTrap.parentNode && r._topFocusTrap.parentNode.removeChild(r._topFocusTrap), r._bottomFocusTrap && r._bottomFocusTrap.parentNode && r._bottomFocusTrap.parentNode.removeChild(r._bottomFocusTrap), r._restoreCache.classes && (r.panelEl[0].className = r._restoreCache.classes), r.panelEl[0].style.cssText = r._restoreCache.styles || "", r._compilerCleanup(), r.panelContainer.remove(), r.isAttached = !1, r._$q.when(r)), !r._backdropRef || r._backdropRef.detach()]).then(i).then(n).catch(t)
                     })
                 }, l.prototype.destroy = function() {
                     var t = this;
-                    this.config.groupName && se.forEach(this.config.groupName, function(e) {
+                    this.config.groupName && ue.forEach(this.config.groupName, function(e) {
                         t.removeFromGroup(e)
                     }), this.config.scope.$destroy(), this.config.locals = null, this.config.onDomAdded = null, this.config.onDomRemoved = null, this.config.onRemoving = null, this.config.onOpenComplete = null, this._interceptors = null
                 }, l.prototype.show = function() {
                     var i = this;
                     return this._$q(function(e, t) {
                         var n = i._done(e, i),
-                            r = i.config.onOpenComplete || se.noop;
+                            r = i.config.onOpenComplete || ue.noop;
                         i._$q.all([i._backdropRef ? i._backdropRef.show() : i, (i.panelContainer.removeClass(a), i._animateOpen()).then(function() {
                             i._focusOnOpen()
                         }, t)]).then(r).then(function() {
-                            i.config.groupName && se.forEach(i.config.groupName, function(e) {
+                            i.config.groupName && ue.forEach(i.config.groupName, function(e) {
                                 i._$mdPanel._groups[e].openPanels.push(i)
                             })
                         }).then(n).catch(t)
                     var i = this;
                     return this._$q(function(e, t) {
                         var n = i._done(e, i),
-                            r = i.config.onRemoving || se.noop;
+                            r = i.config.onRemoving || ue.noop;
                         i._$q.all([i._backdropRef ? i._backdropRef.hide() : i, i._animateClose().then(r).then(function() {
                             i.panelContainer.addClass(a)
                         }).then(function() {
                             var t;
-                            i.config.groupName && se.forEach(i.config.groupName, function(e) {
+                            i.config.groupName && ue.forEach(i.config.groupName, function(e) {
                                 e = i._$mdPanel._groups[e], -1 < (t = e.openPanels.indexOf(i)) && e.openPanels.splice(t, 1)
                             })
                         }).then(function() {
                         if (t.contentElement) {
                             var n = e.element;
                             r._restoreCache.styles = n[0].style.cssText, r._restoreCache.classes = n[0].className, r.panelContainer = r._$mdPanel._wrapContentElement(n), r.panelEl = n
-                        } else r.panelContainer = e.link(t.scope), r.panelEl = se.element(r.panelContainer[0].querySelector(".md-panel"));
+                        } else r.panelContainer = e.link(t.scope), r.panelEl = ue.element(r.panelContainer[0].querySelector(".md-panel"));
                         return r._compilerCleanup = e.cleanup, u(r.config.attachTo).append(r.panelContainer), r
                     })
                 }, l.prototype._createPanel = function() {
                     }
                 }, l.prototype._configureClickOutsideToClose = function() {
                     if (this.config.clickOutsideToClose) {
-                        var t, n = this.config.propagateContainerEvents ? se.element(document.body) : this.panelContainer,
+                        var t, n = this.config.propagateContainerEvents ? ue.element(document.body) : this.panelContainer,
                             e = function(e) {
                                 t = e.target
                             },
                     }
                 }, l.prototype._configureScrollListener = function() {
                     if (!this.config.disableParentScroll) {
-                        var e = se.bind(this, this._updatePosition),
+                        var e = ue.bind(this, this._updatePosition),
                             t = this._$$rAF.throttle(e),
                             n = this,
                             r = function() {
                     })
                 }, l.prototype.registerInterceptor = function(e, t) {
                     var n = null;
-                    if (se.isString(e) ? se.isFunction(t) || (n = "Interceptor callback must be a function, instead got " + typeof t) : n = "Interceptor type must be a string, instead got " + typeof e, n) throw new Error("MdPanel: " + n);
+                    if (ue.isString(e) ? ue.isFunction(t) || (n = "Interceptor callback must be a function, instead got " + typeof t) : n = "Interceptor type must be a string, instead got " + typeof e, n) throw new Error("MdPanel: " + n);
                     var r = this._interceptors[e] = this._interceptors[e] || [];
                     return -1 === r.indexOf(t) && r.push(t), this
                 }, l.prototype.removeInterceptor = function(e, t) {
                     var r = this,
                         i = r._$q;
                     return (r._interceptors && r._interceptors[e] || []).reduceRight(function(e, t) {
-                        var n = t && se.isFunction(t.then) ? t : null;
+                        var n = t && ue.isFunction(t.then) ? t : null;
                         return e.then(function() {
                             if (!n) try {
                                 n = t(r)
                         }
                         this._top = this._bottom = ""
                     }
-                    return this["_" + e] = se.isString(t) ? t : "0", this
+                    return this["_" + e] = ue.isString(t) ? t : "0", this
                 }, p.prototype.top = function(e) {
                     return this._setPosition(p.absPosition.TOP, e)
                 }, p.prototype.bottom = function(e) {
                     return this._actualPosition
                 }, p.prototype._reduceTranslateValues = function(n, e) {
                     return e.map(function(e) {
-                        var t = se.isFunction(e) ? d(e(this)) : e;
+                        var t = ue.isFunction(e) ? d(e(this)) : e;
                         return n + "(" + t + ")"
                     }, this).join(" ")
                 }, p.prototype._setPanelPosition = function(e) {
                 }, c.prototype.closeTo = function(e) {
                     return this._closeTo = this._getPanelAnimationTarget(e), this
                 }, c.prototype.duration = function(e) {
-                    return e && (se.isNumber(e) ? this._openDuration = this._closeDuration = t(e) : se.isObject(e) && (this._openDuration = t(e.open), this._closeDuration = t(e.close))), this._rawDuration = e, this;
+                    return e && (ue.isNumber(e) ? this._openDuration = this._closeDuration = t(e) : ue.isObject(e) && (this._openDuration = t(e.open), this._closeDuration = t(e.close))), this._rawDuration = e, this;
 
                     function t(e) {
-                        if (se.isNumber(e)) return e / 1e3
+                        if (ue.isNumber(e)) return e / 1e3
                     }
                 }, c.prototype._getPanelAnimationTarget = function(e) {
-                    return se.isDefined(e.top) || se.isDefined(e.left) ? {
-                        element: le,
+                    return ue.isDefined(e.top) || ue.isDefined(e.left) ? {
+                        element: de,
                         bounds: {
                             top: e.top || 0,
                             left: e.left || 0
                             };
                             break;
                         default:
-                            n = se.isString(this._animationClass) ? {
+                            n = ue.isString(this._animationClass) ? {
                                 transitionInClass: this._animationClass
                             } : {
                                 transitionInClass: this._animationClass.open,
                             };
                             break;
                         default:
-                            n = se.isString(this._animationClass) ? {
+                            n = ue.isString(this._animationClass) ? {
                                 transitionOutClass: this._animationClass
                             } : {
                                 transitionInClass: this._animationClass.close,
                         n = e[0].offsetHeight;
                     this._openFrom && null == this._openFrom.bounds.height && (this._openFrom.bounds.height = n), this._openFrom && null == this._openFrom.bounds.width && (this._openFrom.bounds.width = t), this._closeTo && null == this._closeTo.bounds.height && (this._closeTo.bounds.height = n), this._closeTo && null == this._closeTo.bounds.width && (this._closeTo.bounds.width = t)
                 }, c.prototype._getBoundingClientRect = function(e) {
-                    if (e instanceof se.element) return {
+                    if (e instanceof ue.element) return {
                         element: e,
                         bounds: e[0].getBoundingClientRect()
                     }
                 }
-            }(), se.module("material.components.progressCircular", ["material.core"]),
+            }(), ue.module("material.components.progressCircular", ["material.core"]),
+            function() {
+                function e(_, $, s, w, h, e) {
+                    var E = _.requestAnimationFrame || _.webkitRequestAnimationFrame || ue.noop,
+                        p = _.cancelAnimationFrame || _.webkitCancelAnimationFrame || _.webkitCancelRequestAnimationFrame || ue.noop,
+                        m = "determinate",
+                        C = "indeterminate",
+                        k = "_md-progress-circular-disabled",
+                        x = "md-mode-indeterminate";
+                    return {
+                        restrict: "E",
+                        scope: {
+                            value: "@",
+                            mdDiameter: "@",
+                            mdMode: "@"
+                        },
+                        template: '<svg xmlns="http://www.w3.org/2000/svg"><path fill="none"/></svg>',
+                        compile: function(e, t) {
+                            if (e.attr({
+                                    "aria-valuemin": 0,
+                                    "aria-valuemax": 100,
+                                    role: "progressbar"
+                                }), ue.isUndefined(t.mdMode)) {
+                                var n = t.hasOwnProperty("value") ? m : C;
+                                t.$set("mdMode", n)
+                            } else t.$set("mdMode", t.mdMode.trim());
+                            return r
+                        }
+                    };
+
+                    function r(g, l, c) {
+                        var v, e, t = l[0],
+                            a = ue.element(t.querySelector("svg")),
+                            b = ue.element(t.querySelector("path")),
+                            n = $.startIndeterminate,
+                            r = $.endIndeterminate,
+                            i = 0,
+                            y = 0;
+
+                        function u(n, e, t, r, i, o) {
+                            var a = ++y,
+                                s = w.now(),
+                                l = e - n,
+                                c = S(g.mdDiameter),
+                                u = D(c),
+                                d = t || $.easeFn,
+                                f = r || $.duration,
+                                h = -90 * (i || 0),
+                                p = o || 100;
+
+                            function m(e) {
+                                b.attr("stroke-dashoffset", M(c, u, e, p)), b.attr("transform", "rotate(" + h + " " + c / 2 + " " + c / 2 + ")")
+                            }
+                            e === n ? m(e) : v = E(function e() {
+                                var t = _.Math.max(0, _.Math.min(w.now() - s, f));
+                                m(d(t, n, l, f)), a === y && t < f && (v = E(e))
+                            })
+                        }
+
+                        function o() {
+                            u(n, r, $.easeFnIndeterminate, $.durationIndeterminate, i, 75), i = ++i % 4
+                        }
+
+                        function d() {
+                            e || (e = h(o, $.durationIndeterminate, 0, !1), o(), l.addClass(x).removeAttr("aria-valuenow"))
+                        }
+
+                        function f() {
+                            e && (h.cancel(e), e = null, l.removeClass(x))
+                        }
+                        s(l), l.toggleClass(k, c.hasOwnProperty("disabled")), g.mdMode === C && d(), g.$on("$destroy", function() {
+                            f(), v && p(v)
+                        }), g.$watchGroup(["value", "mdMode", function() {
+                            var e = t.disabled;
+                            return !0 === e || !1 === e ? e : ue.isDefined(l.attr("disabled"))
+                        }], function(e, t) {
+                            var n = e[1],
+                                r = e[2],
+                                i = 0,
+                                o = 0;
+                            if (r !== t[2] && l.toggleClass(k, !!r), r) f();
+                            else if (n !== m && n !== C && (n = C, c.$set("mdMode", n)), n === C) t[1] === m && (o = D(i = S(g.mdDiameter)), b.attr("d", T(i, o, !0)), b.attr("stroke-dasharray", (i - o) * _.Math.PI * .75)), d();
+                            else {
+                                var a = A(e[0]),
+                                    s = A(t[0]);
+                                f(), t[1] === C && (o = D(i = S(g.mdDiameter)), b.attr("d", T(i, o, !1)), b.attr("stroke-dasharray", (i - o) * _.Math.PI)), l.attr("aria-valuenow", a), u(s, a)
+                            }
+                        }), g.$watch("mdDiameter", function(e) {
+                            var t = S(e),
+                                n = D(t),
+                                r = A(g.value),
+                                i = t / 2 + "px",
+                                o = {
+                                    width: t + "px",
+                                    height: t + "px"
+                                };
+                            a[0].setAttribute("viewBox", "0 0 " + t + " " + t), a.css(o).css("transform-origin", i + " " + i + " " + i), l.css(o), b.attr("stroke-width", n), b.attr("stroke-linecap", "square"), g.mdMode == C ? (b.attr("d", T(t, n, !0)), b.attr("stroke-dasharray", (t - n) * _.Math.PI * .75), b.attr("stroke-dashoffset", M(t, n, 1, 75))) : (b.attr("d", T(t, n, !1)), b.attr("stroke-dasharray", (t - n) * _.Math.PI), b.attr("stroke-dashoffset", M(t, n, 0, 100)), u(r, r))
+                        })
+                    }
+
+                    function T(e, t, n) {
+                        var r = e / 2,
+                            i = t / 2,
+                            o = r + "," + i,
+                            a = r - i;
+                        return "M" + o + "A" + a + "," + a + " 0 1 1 " + (i + "," + r) + (n ? "" : "A" + a + "," + a + " 0 0 1 " + o)
+                    }
+
+                    function M(e, t, n, r) {
+                        return (e - t) * _.Math.PI * (3 * (r || 100) / 100 - n / 100)
+                    }
+
+                    function A(e) {
+                        return _.Math.max(0, _.Math.min(e || 0, 100))
+                    }
+
+                    function S(e) {
+                        var t = $.progressSize;
+                        if (e) {
+                            var n = parseFloat(e);
+                            return e.lastIndexOf("%") === e.length - 1 && (n = n / 100 * t), n
+                        }
+                        return t
+                    }
+
+                    function D(e) {
+                        return $.strokeWidth / 100 * e
+                    }
+                }
+                e.$inject = ["$window", "$mdProgressCircular", "$mdTheming", "$mdUtil", "$interval", "$log"], ue.module("material.components.progressCircular").directive("mdProgressCircular", e)
+            }(), ue.module("material.components.progressCircular").provider("$mdProgressCircular", function() {
+                var t = {
+                    progressSize: 50,
+                    strokeWidth: 10,
+                    duration: 100,
+                    easeFn: e,
+                    durationIndeterminate: 1333,
+                    startIndeterminate: 1,
+                    endIndeterminate: 149,
+                    easeFnIndeterminate: n,
+                    easingPresets: {
+                        linearEase: e,
+                        materialEase: n
+                    }
+                };
+                return {
+                    configure: function(e) {
+                        return t = ue.extend(t, e || {})
+                    },
+                    $get: function() {
+                        return t
+                    }
+                };
+
+                function e(e, t, n, r) {
+                    return n * e / r + t
+                }
+
+                function n(e, t, n, r) {
+                    var i = (e /= r) * e,
+                        o = i * e;
+                    return t + n * (6 * o * i + -15 * i * i + 10 * o)
+                }
+            }),
             function() {
                 function e(d, f, e) {
                     var h = "determinate",
                         d(n);
                         var i = r.hasOwnProperty("disabled"),
                             o = f.dom.animator.toCss,
-                            a = se.element(n[0].querySelector(".md-bar1")),
-                            s = se.element(n[0].querySelector(".md-bar2")),
-                            l = se.element(n[0].querySelector(".md-container"));
+                            a = ue.element(n[0].querySelector(".md-bar1")),
+                            s = ue.element(n[0].querySelector(".md-bar2")),
+                            l = ue.element(n[0].querySelector(".md-container"));
 
                         function c() {
                             var e = (r.mdMode || "").trim();
                                     r = o({
                                         transform: n
                                     });
-                                se.element(e).css(r)
+                                ue.element(e).css(r)
                             }
                         }
                         n.attr("md-mode", c()).toggleClass(v, i),
                             function() {
-                                if (se.isUndefined(r.mdMode)) {
-                                    var e = se.isDefined(r.value),
+                                if (ue.isUndefined(r.mdMode)) {
+                                    var e = ue.isDefined(r.value),
                                         t = e ? h : p;
                                     n.attr("md-mode", t), r.mdMode = t
                                 }
                             }), r.$observe("mdBufferValue", function(e) {
                                 u(a, b(e))
                             }), r.$observe("disabled", function(e) {
-                                i = !0 === e || !1 === e ? !!e : se.isDefined(e), n.toggleClass(v, i), l.toggleClass(t, !i)
+                                i = !0 === e || !1 === e ? !!e : ue.isDefined(e), n.toggleClass(v, i), l.toggleClass(t, !i)
                             }), r.$observe("mdMode", function(e) {
                                 switch (t && l.removeClass(t), e) {
                                     case g:
                         return Math.max(0, Math.min(e || 0, 100))
                     }
                 }
-                e.$inject = ["$mdTheming", "$mdUtil", "$log"], se.module("material.components.progressLinear", ["material.core"]).directive("mdProgressLinear", e)
+                e.$inject = ["$mdTheming", "$mdUtil", "$log"], ue.module("material.components.progressLinear", ["material.core"]).directive("mdProgressLinear", e)
             }(),
             function() {
                 function e(s, l, c, u) {
                     return e.prototype = {
                         init: function(e) {
-                            this._ngModelCtrl = e, this._ngModelCtrl.$render = se.bind(this, this.render)
+                            this._ngModelCtrl = e, this._ngModelCtrl.$render = ue.bind(this, this.render)
                         },
                         add: function(e) {
                             this._radioButtonRenderFns.push(e)
                                             e.preventDefault(), i.selectNext(), a();
                                             break;
                                         case l.KEY_CODE.ENTER:
-                                            var n = se.element(s.getClosest(r[0], "form"));
+                                            var n = ue.element(s.getClosest(r[0], "form"));
                                             0 < n.length && n.triggerHandler("submit")
                                     }
                                 }).on("mousedown", function(e) {
                         if (n.count()) {
                             var r = e[0].querySelector("md-radio-button.md-checked"),
                                 i = n[t < 0 ? "previous" : "next"](r, function(e) {
-                                    return !se.element(e).attr("disabled")
+                                    return !ue.element(e).attr("disabled")
                                 }) || n.first();
-                            se.element(i).triggerHandler("click")
+                            ue.element(i).triggerHandler("click")
                         }
                     }
                 }
                         }
                     }
                 }
-                e.$inject = ["$mdUtil", "$mdConstant", "$mdTheming", "$timeout"], t.$inject = ["$mdAria", "$mdUtil", "$mdTheming"], se.module("material.components.radioButton", ["material.core"]).directive("mdRadioGroup", e).directive("mdRadioButton", t)
+                e.$inject = ["$mdUtil", "$mdConstant", "$mdTheming", "$timeout"], t.$inject = ["$mdAria", "$mdUtil", "$mdTheming"], ue.module("material.components.radioButton", ["material.core"]).directive("mdRadioGroup", e).directive("mdRadioButton", t)
             }(),
             function() {
                 e.$inject = ["$mdSelect", "$mdUtil", "$mdConstant", "$mdTheming", "$mdAria", "$parse", "$sce", "$injector"], t.$inject = ["$parse", "$mdUtil", "$mdConstant", "$mdTheming"], n.$inject = ["$mdButtonInkRipple", "$mdUtil", "$mdTheming"], r.$inject = ["$$interimElementProvider"];
                 var j = 8,
                     m = 0,
-                    u = se.element('<div class="md-container"><div class="md-icon"></div></div>');
+                    u = ue.element('<div class="md-container"><div class="md-icon"></div></div>');
 
-                function e(M, A, S, O, D, N, I, e) {
+                function e(M, A, S, D, O, N, I, e) {
                     var t = S.KEY_CODE;
                     t.SPACE, t.ENTER, t.UP_ARROW, t.DOWN_ARROW;
                     return {
                         restrict: "E",
                         require: ["^?mdInputContainer", "mdSelect", "ngModel", "?^form"],
                         compile: function(e, t) {
-                            var n = se.element("<md-select-value><span></span></md-select-value>");
+                            var n = ue.element("<md-select-value><span></span></md-select-value>");
                             n.append('<span class="md-select-icon" aria-hidden="true"></span>'), n.addClass("md-select-value"), n[0].hasAttribute("id") || n.attr("id", "select_value_label_" + A.nextUid());
                             var r = e.find("md-content");
-                            r.length || e.append(se.element("<md-content>").append(e.contents()));
-                            r.attr("role", "presentation"), t.mdOnOpen && (e.find("md-content").prepend(se.element('<div> <md-progress-circular md-mode="indeterminate" ng-if="$$loadingAsyncDone === false" md-diameter="25px"></md-progress-circular></div>')), e.find("md-option").attr("ng-show", "$$loadingAsyncDone"));
+                            r.length || e.append(ue.element("<md-content>").append(e.contents()));
+                            r.attr("role", "presentation"), t.mdOnOpen && (e.find("md-content").prepend(ue.element('<div> <md-progress-circular md-mode="indeterminate" ng-if="$$loadingAsyncDone === false" md-diameter="25px"></md-progress-circular></div>')), e.find("md-option").attr("ng-show", "$$loadingAsyncDone"));
                             if (t.name) {
-                                var i = se.element('<select class="md-visually-hidden"></select>');
+                                var i = ue.element('<select class="md-visually-hidden"></select>');
                                 i.attr({
                                     name: t.name,
                                     "aria-hidden": "true",
                                     tabindex: "-1"
                                 });
                                 var o = e.find("md-option");
-                                se.forEach(o, function(e) {
-                                    var t = se.element("<option>" + e.innerHTML + "</option>");
+                                ue.forEach(o, function(e) {
+                                    var t = ue.element("<option>" + e.innerHTML + "</option>");
                                     e.hasAttribute("ng-value") ? t.attr("ng-value", e.getAttribute("ng-value")) : e.hasAttribute("value") && t.attr("value", e.getAttribute("value")), i.append(t)
                                 }), i.append('<option ng-value="' + t.ngModel + '" selected></option>'), e.parent().append(i)
                             }
                                     f = e[2],
                                     h = e[3],
                                     p = n.find("md-select-value"),
-                                    m = se.isDefined(o.readonly),
+                                    m = ue.isDefined(o.readonly),
                                     g = A.parseAttributeBoolean(o.mdNoAsterisk);
                                 if (g && n.addClass("md-no-asterisk"), u) {
                                     var v = u.isErrorGetter || function() {
                                         return f.$invalid && (f.$touched || h && h.$submitted)
                                     };
                                     if (u.input && n.find("md-select-header").find("input")[0] !== u.input[0]) throw new Error("<md-input-container> can only have *one* child <input>, <textarea> or <select> element!");
-                                    u.input = n, u.label || D.expect(n, "aria-label", n.attr("placeholder")), i.$watch(v, u.setInvalid)
+                                    u.input = n, u.label || O.expect(n, "aria-label", n.attr("placeholder")), i.$watch(v, u.setInvalid)
                                 }! function() {
-                                    if (a = se.element(n[0].querySelector(".md-select-menu-container")), s = i, o.mdContainerClass) {
+                                    if (a = ue.element(n[0].querySelector(".md-select-menu-container")), s = i, o.mdContainerClass) {
                                         var e = a[0].getAttribute("class") + " " + o.mdContainerClass;
                                         a[0].setAttribute("class", e)
                                     }(l = a.find("md-select-menu").controller("mdSelectMenu")).init(f, o.ngModel), n.on("$destroy", function() {
                                         a.remove()
                                     })
-                                }(), O(n), h && se.isDefined(o.multiple) && A.nextTick(function() {
-                                    var e = f.$modelValue || f.$viewValue;
-                                    e && h.$setPristine()
-                                });
+                                }(), D(n);
                                 var b, y = f.$render;
 
                                 function _() {
                                     ! function() {
                                         var e = n.attr("aria-label") || n.attr("placeholder");
                                         !e && u && u.label && (e = u.label.text());
-                                        r = e, D.expect(n, "aria-label", e)
+                                        r = e, O.expect(n, "aria-label", e)
                                     }(), _(), $()
                                 }), i.$watch(function() {
                                     return l.selectedLabels()
                                     b = i.$watch(function() {
                                         return t(i)
                                     }, function(e, t) {
-                                        e === le && t === le || (e ? n.attr("multiple", "multiple") : n.removeAttr("multiple"), n.attr("aria-multiselectable", e ? "true" : "false"), a && (l.setMultiple(e), y = f.$render, f.$render = function() {
+                                        e === de && t === de || (e ? n.attr("multiple", "multiple") : n.removeAttr("multiple"), n.attr("aria-multiselectable", e ? "true" : "false"), a && (l.setMultiple(e), y = f.$render, f.$render = function() {
                                             y(), _(), $(), C()
                                         }, f.$render()))
                                     })
                                 }), o.$observe("disabled", function(e) {
-                                    se.isString(e) && (e = !0), t !== le && t === e || ((t = e) ? n.attr({
+                                    ue.isString(e) && (e = !0), t !== de && t === e || ((t = e) ? n.attr({
                                         "aria-disabled": "true"
                                     }).removeAttr("tabindex").off("click", x).off("keydown", k) : n.attr({
                                         tabindex: o.tabindex,
                                 var E = "select_container_" + A.nextUid();
 
                                 function C() {
-                                    u && u.setHasValue(0 < l.selectedLabels().length || (n[0].validity || {}).badInput)
+                                    A.nextTick(function() {
+                                        u && u.setHasValue(0 < l.selectedLabels().length || (n[0].validity || {}).badInput)
+                                    })
                                 }
 
                                 function k(e) {
                                         e.preventDefault();
                                         var t = l.optNodeForKeyboardSearch(e);
                                         if (!t || t.hasAttribute("disabled")) return;
-                                        var n = se.element(t).controller("mdOption");
+                                        var n = ue.element(t).controller("mdOption");
                                         l.isMultiple || l.deselect(Object.keys(l.selected)[0]), l.select(n.hashKey, n.value), l.refreshViewValue()
                                     }
                                 }
 
                                 function r(e) {
                                     var t = p.getClosest(e.target, "md-option"),
-                                        n = t && se.element(t).data("$mdOptionController");
+                                        n = t && ue.element(t).data("$mdOptionController");
                                     if (t && n) {
                                         if (t.hasAttribute("disabled")) return e.stopImmediatePropagation(), !1;
                                         var r = a.hashGetter(n.value),
-                                            i = se.isDefined(a.selected[r]);
+                                            i = ue.isDefined(a.selected[r]);
                                         o.$apply(function() {
                                             a.isMultiple ? i ? a.deselect(r) : a.select(r, n.value) : i || (a.deselect(Object.keys(a.selected)[0]), a.select(r, n.value)), a.refreshViewValue()
                                         })
                     };
 
                     function t(o, e, i) {
-                        var r, a = this;
-                        a.isMultiple = se.isDefined(e.multiple), a.selected = {}, a.options = {}, o.$watchCollection(function() {
-                            return a.options
+                        var a, s = this;
+                        s.isMultiple = ue.isDefined(e.multiple), s.selected = {}, s.options = {}, o.$watchCollection(function() {
+                            return s.options
                         }, function() {
-                            a.ngModel.$render()
-                        }), a.setMultiple = function(e) {
-                            var t = a.ngModel;
+                            s.ngModel.$render()
+                        }), s.setMultiple = function(e) {
+                            var t = s.ngModel;
+                            if (a = a || t.$isEmpty, s.isMultiple = e, s.isMultiple) {
+                                var n = !1,
+                                    r = function(e) {
+                                        n ? d() : p.nextTick(function() {
+                                            d(), n = !0
+                                        })
+                                    };
+                                t.$validators["md-multiple"] = i, t.$render = r, o.$watchCollection(s.modelBinding, function(e) {
+                                    i(e) && r()
+                                }), t.$isEmpty = function(e) {
+                                    return !e || 0 === e.length
+                                }
+                            } else delete t.$validators["md-multiple"], t.$render = f;
 
-                            function n(e, t) {
-                                return se.isArray(e || t || [])
+                            function i(e, t) {
+                                return ue.isArray(e || t || [])
                             }
-                            r = r || t.$isEmpty, a.isMultiple = e, a.isMultiple ? (t.$validators["md-multiple"] = n, t.$render = d, o.$watchCollection(a.modelBinding, function(e) {
-                                n(e) && d()
-                            }), t.$isEmpty = function(e) {
-                                return !e || 0 === e.length
-                            }) : (delete t.$validators["md-multiple"], t.$render = f)
                         };
-                        var s, l, c, u = "";
+                        var r, l, c, u = "";
 
                         function d() {
-                            var n = a.ngModel.$modelValue || a.ngModel.$viewValue || [];
-                            if (se.isArray(n)) {
-                                var e = Object.keys(a.selected),
-                                    t = n.map(a.hashGetter);
+                            var n = s.ngModel.$modelValue || s.ngModel.$viewValue || [];
+                            if (ue.isArray(n)) {
+                                var e = Object.keys(s.selected),
+                                    t = n.map(s.hashGetter);
                                 e.filter(function(e) {
                                     return -1 === t.indexOf(e)
-                                }).forEach(a.deselect), t.forEach(function(e, t) {
-                                    a.select(e, n[t])
+                                }).forEach(s.deselect), t.forEach(function(e, t) {
+                                    s.select(e, n[t])
                                 })
                             }
                         }
 
                         function f() {
-                            var e = a.ngModel.$viewValue || a.ngModel.$modelValue;
-                            Object.keys(a.selected).forEach(a.deselect), a.select(a.hashGetter(e), e)
+                            var e = s.ngModel.$viewValue || s.ngModel.$modelValue;
+                            Object.keys(s.selected).forEach(s.deselect), s.select(s.hashGetter(e), e)
                         }
-                        a.optNodeForKeyboardSearch = function(e) {
-                            s && clearTimeout(s), s = setTimeout(function() {
-                                u = "", l = c = s = le
+                        s.optNodeForKeyboardSearch = function(e) {
+                            r && clearTimeout(r), r = setTimeout(function() {
+                                u = "", l = c = r = de
                             }, 300), u += e.key;
                             var t = new RegExp("^" + u, "i");
-                            l || (l = i.find("md-option"), c = new Array(l.length), se.forEach(l, function(e, t) {
+                            l || (l = i.find("md-option"), c = new Array(l.length), ue.forEach(l, function(e, t) {
                                 c[t] = e.textContent.trim()
                             }));
                             for (var n = 0; n < c.length; ++n)
                                 if (t.test(c[n])) return l[n]
-                        }, a.init = function(e, t) {
-                            a.ngModel = e, a.modelBinding = t, a.ngModel.$isEmpty = function(e) {
-                                return !a.options[a.hashGetter(e)]
+                        }, s.init = function(e, t) {
+                            s.ngModel = e, s.modelBinding = t, s.ngModel.$isEmpty = function(e) {
+                                return !s.options[s.hashGetter(e)]
                             };
                             var n = p.getModelOption(e, "trackBy");
                             if (n) {
                                 var r = {},
                                     i = h(n);
-                                a.hashGetter = function(e, t) {
+                                s.hashGetter = function(e, t) {
                                     return r.$value = e, i(t || o, r)
                                 }
-                            } else a.hashGetter = function(e) {
-                                return se.isObject(e) ? "object_" + (e.$$mdSelectId || (e.$$mdSelectId = ++m)) : e
+                            } else s.hashGetter = function(e) {
+                                return ue.isObject(e) ? "object_" + (e.$$mdSelectId || (e.$$mdSelectId = ++m)) : e
                             };
-                            a.setMultiple(a.isMultiple)
-                        }, a.selectedLabels = function(e) {
+                            s.setMultiple(s.isMultiple)
+                        }, s.selectedLabels = function(e) {
                             var t, n = (e = e || {}).mode || "html",
                                 r = p.nodesToArray(i[0].querySelectorAll("md-option[selected]"));
                             return r.length ? ("html" == n ? t = function(e) {
                             } : "aria" == n && (t = function(e) {
                                 return e.hasAttribute("aria-label") ? e.getAttribute("aria-label") : e.textContent
                             }), p.uniq(r.map(t)).join(", ")) : ""
-                        }, a.select = function(e, t) {
-                            var n = a.options[e];
-                            n && n.setSelected(!0), a.selected[e] = t
-                        }, a.deselect = function(e) {
-                            var t = a.options[e];
-                            t && t.setSelected(!1), delete a.selected[e]
-                        }, a.addOption = function(e, t) {
-                            if (se.isDefined(a.options[e])) throw new Error('Duplicate md-option values are not allowed in a select. Duplicate value "' + t.value + '" found.');
-                            a.options[e] = t, se.isDefined(a.selected[e]) && (a.select(e, t.value), se.isDefined(a.ngModel.$modelValue) && a.hashGetter(a.ngModel.$modelValue) === e && a.ngModel.$validate(), a.refreshViewValue())
-                        }, a.removeOption = function(e) {
-                            delete a.options[e]
-                        }, a.refreshViewValue = function() {
+                        }, s.select = function(e, t) {
+                            var n = s.options[e];
+                            n && n.setSelected(!0), s.selected[e] = t
+                        }, s.deselect = function(e) {
+                            var t = s.options[e];
+                            t && t.setSelected(!1), delete s.selected[e]
+                        }, s.addOption = function(e, t) {
+                            if (ue.isDefined(s.options[e])) throw new Error('Duplicate md-option values are not allowed in a select. Duplicate value "' + t.value + '" found.');
+                            s.options[e] = t, ue.isDefined(s.selected[e]) && (s.select(e, t.value), ue.isDefined(s.ngModel.$$rawModelValue) && s.hashGetter(s.ngModel.$$rawModelValue) === e && s.ngModel.$validate(), s.refreshViewValue())
+                        }, s.removeOption = function(e) {
+                            delete s.options[e]
+                        }, s.refreshViewValue = function() {
                             var e, t = [];
-                            for (var n in a.selected)(e = a.options[n]) ? t.push(e.value) : t.push(a.selected[n]);
-                            var r = p.getModelOption(a.ngModel, "trackBy"),
-                                i = a.isMultiple ? t : t[0],
-                                o = a.ngModel.$modelValue;
-                            (r ? se.equals(o, i) : o + "" === i) || (a.ngModel.$setViewValue(i), a.ngModel.$render())
+                            for (var n in s.selected)(e = s.options[n]) ? t.push(e.value) : t.push(s.selected[n]);
+                            var r = p.getModelOption(s.ngModel, "trackBy"),
+                                i = s.isMultiple ? t : t[0],
+                                o = s.ngModel.$modelValue;
+                            (r ? ue.equals(o, i) : o + "" === i) || (s.ngModel.$setViewValue(i), s.ngModel.$render())
                         }
                     }
                 }
                         require: ["mdOption", "^^mdSelectMenu"],
                         controller: e,
                         compile: function(e, t) {
-                            e.append(se.element('<div class="md-text">').append(e.contents())), e.attr("tabindex", t.tabindex || "0"), n = t, r = n.value, i = n.ngValue, r || i || e.attr("md-option-empty", "");
+                            e.append(ue.element('<div class="md-text">').append(e.contents())), e.attr("tabindex", t.tabindex || "0"), n = t, r = n.value, i = n.ngValue, r || i || e.attr("md-option-empty", "");
                             var n, r, i;
                             return o
                         }
                                 l(e, t, !0)
                             })
                         }
-                        c(t), s.isMultiple && (t.addClass("md-checkbox-enabled"), t.prepend(u.clone())), se.isDefined(e.ngValue) ? o.$watch(e.ngValue, l) : se.isDefined(e.value) ? l(e.value) : o.$watch(function() {
+                        c(t), s.isMultiple && (t.addClass("md-checkbox-enabled"), t.prepend(u.clone())), ue.isDefined(e.ngValue) ? o.$watch(e.ngValue, l) : ue.isDefined(e.value) ? l(e.value) : o.$watch(function() {
                                 return t.text().trim()
                             }, l), e.$observe("disabled", function(e) {
                                 e ? t.attr("tabindex", "-1") : t.attr("tabindex", "0")
                             }), o.$$postDigest(function() {
                                 e.$observe("selected", function(e) {
-                                    se.isDefined(e) && ("string" == typeof e && (e = !0), e ? (s.isMultiple || s.deselect(Object.keys(s.selected)[0]), s.select(a.hashKey, a.value)) : s.deselect(a.hashKey), s.refreshViewValue())
+                                    ue.isDefined(e) && ("string" == typeof e && (e = !0), e ? (s.isMultiple || s.deselect(Object.keys(s.selected)[0]), s.select(a.hashKey, a.value)) : s.deselect(a.hashKey), s.refreshViewValue())
                                 })
                             }), r.attach(o, t),
                             function() {
                         options: t
                     });
 
-                    function t(u, d, I, R, o, a, f, h, P) {
-                        var p = I.dom.animator,
-                            m = d.KEY_CODE;
+                    function t(u, d, I, R, o, f, h, p, P) {
+                        var m = I.dom.animator,
+                            g = d.KEY_CODE;
                         return {
                             parent: "body",
                             themable: !0,
-                            onShow: function(s, l, c) {
-                                return c.loadingAsync && !c.isRemoved && (s.$$loadingAsyncDone = !1, o.when(c.loadingAsync).then(function() {
-                                        s.$$loadingAsyncDone = !0, delete c.loadingAsync
+                            onShow: function(a, s, l) {
+                                return l.loadingAsync && !l.isRemoved && (a.$$loadingAsyncDone = !1, o.when(l.loadingAsync).then(function() {
+                                        a.$$loadingAsyncDone = !0, delete l.loadingAsync
                                     }).then(function() {
-                                        a(i)
+                                        f(i)
                                     })),
                                     function(e, t) {
-                                        var n = l.find("md-select-menu");
+                                        var n = s.find("md-select-menu");
                                         if (!t.target) throw new Error(I.supplant("$mdSelect.show() expected a target element in options.target but got '{0}'!", [t.target]));
-                                        se.extend(t, {
+                                        ue.extend(t, {
                                             isRemoved: !1,
-                                            target: se.element(t.target),
-                                            parent: se.element(t.parent),
+                                            target: ue.element(t.target),
+                                            parent: ue.element(t.parent),
                                             selectEl: n,
-                                            contentEl: l.find("md-content"),
+                                            contentEl: s.find("md-content"),
                                             optionNodes: n[0].getElementsByTagName("md-option")
                                         })
-                                    }(0, c), c.hideBackdrop = (t = s, r = c, r.disableParentScroll && !I.getClosest(r.target, "MD-DIALOG") ? r.restoreScroll = I.disableScrollAround(r.element, r.parent) : r.disableParentScroll = !1, r.hasBackdrop && (r.backdrop = I.createBackdrop(t, "md-select-backdrop md-click-catcher"), h.enter(r.backdrop, P[0].body, null, {
+                                    }(0, l), l.hideBackdrop = (t = a, r = l, r.disableParentScroll && !I.getClosest(r.target, "MD-DIALOG") ? r.restoreScroll = I.disableScrollAround(r.element, r.parent) : r.disableParentScroll = !1, r.hasBackdrop && (r.backdrop = I.createBackdrop(t, "md-select-backdrop md-click-catcher"), p.enter(r.backdrop, P[0].body, null, {
                                         duration: 0
                                     })), function() {
                                         r.backdrop && r.backdrop.remove(), r.disableParentScroll && r.restoreScroll(), delete r.restoreScroll
-                                    }), (n = l, e = c, e.parent !== n.parent() && n.parent().attr("aria-owns", n.attr("id")), n.parent().find("md-select-value").attr("aria-hidden", "true"), e.parent.append(n), o(function(e, t) {
+                                    }), (n = s, e = l, e.parent !== n.parent() && n.parent().attr("aria-owns", n.attr("id")), n.parent().find("md-select-value").attr("aria-hidden", "true"), e.parent.append(n), o(function(e, t) {
                                         try {
-                                            f(n, {
+                                            h(n, {
                                                 removeClass: "md-leave",
                                                 duration: 0
                                             }).start().then(i).then(e)
                                             t(e)
                                         }
                                     })).then(function(e) {
-                                        var t, n, r, i, o, a;
-                                        return l.attr("aria-hidden", "false"), c.alreadyOpen = !0, c.cleanupInteraction = function() {
-                                            if (!c.isRemoved) {
-                                                var r = c.selectEl,
+                                        var t, n, r, i, o;
+                                        return s.attr("aria-hidden", "false"), l.alreadyOpen = !0, l.cleanupInteraction = function() {
+                                            if (!l.isRemoved) {
+                                                var r = l.selectEl,
                                                     t = r.controller("mdSelectMenu") || {};
-                                                return l.addClass("md-clickable"), c.backdrop && c.backdrop.on("click", e), r.on("keydown", n), r.on("click", o),
+                                                return s.addClass("md-clickable"), l.backdrop && l.backdrop.on("click", e), r.on("keydown", n), r.on("click", o),
                                                     function() {
-                                                        c.backdrop && c.backdrop.off("click", e), r.off("keydown", n), r.off("click", o), l.removeClass("md-clickable"), c.isRemoved = !0
+                                                        l.backdrop && l.backdrop.off("click", e), r.off("keydown", n), r.off("click", o), s.removeClass("md-clickable"), l.isRemoved = !0
                                                     }
                                             }
 
                                             function e(e) {
-                                                e.preventDefault(), e.stopPropagation(), c.restoreFocus = !1, I.nextTick(u.hide, !0)
+                                                e.preventDefault(), e.stopPropagation(), l.restoreFocus = !1, I.nextTick(u.hide, !0)
                                             }
 
                                             function n(e) {
                                                 switch (e.preventDefault(), e.stopPropagation(), e.keyCode) {
-                                                    case m.UP_ARROW:
+                                                    case g.UP_ARROW:
                                                         return void i("prev");
-                                                    case m.DOWN_ARROW:
+                                                    case g.DOWN_ARROW:
                                                         return void i("next");
-                                                    case m.SPACE:
-                                                    case m.ENTER:
+                                                    case g.SPACE:
+                                                    case g.ENTER:
                                                         var t = I.getClosest(e.target, "md-option");
                                                         t && (r.triggerHandler({
                                                             type: "click",
                                                             target: t
                                                         }), e.preventDefault()), o(e);
                                                         break;
-                                                    case m.TAB:
-                                                    case m.ESCAPE:
-                                                        e.stopPropagation(), e.preventDefault(), c.restoreFocus = !0, I.nextTick(u.hide, !0);
+                                                    case g.TAB:
+                                                    case g.ESCAPE:
+                                                        e.stopPropagation(), e.preventDefault(), l.restoreFocus = !0, I.nextTick(u.hide, !0);
                                                         break;
                                                     default:
                                                         if (L(e, d)) {
                                                             var n = r.controller("mdSelectMenu").optNodeForKeyboardSearch(e);
-                                                            c.focusedNode = n || c.focusedNode, n && n.focus()
+                                                            l.focusedNode = n || l.focusedNode, n && n.focus()
                                                         }
                                                 }
                                             }
 
                                             function i(e) {
-                                                for (var t, n = I.nodesToArray(c.optionNodes), r = n.indexOf(c.focusedNode); - 1 === r ? r = 0 : "next" === e && r < n.length - 1 ? r++ : "prev" === e && 0 < r && r--, (t = n[r]).hasAttribute("disabled") && (t = le), !t && r < n.length - 1 && 0 < r;);
-                                                t && t.focus(), c.focusedNode = t
+                                                for (var t, n = I.nodesToArray(l.optionNodes), r = n.indexOf(l.focusedNode); - 1 === r ? r = 0 : "next" === e && r < n.length - 1 ? r++ : "prev" === e && 0 < r && r--, (t = n[r]).hasAttribute("disabled") && (t = de), !t && r < n.length - 1 && 0 < r;);
+                                                t && t.focus(), l.focusedNode = t
                                             }
 
                                             function o(i) {
                                                         return e
                                                     }())) {
                                                     var e = I.getClosest(i.target, "md-option");
-                                                    e && e.hasAttribute && !e.hasAttribute("disabled") && (i.preventDefault(), i.stopPropagation(), t.isMultiple || (c.restoreFocus = !0, I.nextTick(function() {
+                                                    e && e.hasAttribute && !e.hasAttribute("disabled") && (i.preventDefault(), i.stopPropagation(), t.isMultiple || (l.restoreFocus = !0, I.nextTick(function() {
                                                         u.hide(t.ngModel.$viewValue)
                                                     }, !0)))
                                                 }
                                             }
-                                        }(), c.cleanupResizing = (r = s, i = l, o = c, t = function() {
+                                        }(), l.cleanupResizing = (r = a, i = s, o = l, t = function() {
                                             if (!o.isRemoved) {
-                                                var e = g(r, i, o),
+                                                var e = v(r, i, o),
                                                     t = e.container,
                                                     n = e.dropDown;
-                                                t.element.css(p.toCss(t.styles)), n.element.css(p.toCss(n.styles))
+                                                t.element.css(m.toCss(t.styles)), n.element.css(m.toCss(n.styles))
                                             }
-                                        }, (n = se.element(R)).on("resize", t), n.on("orientationchange", t), function() {
+                                        }, (n = ue.element(R)).on("resize", t), n.on("orientationchange", t), function() {
                                             n.off("resize", t), n.off("orientationchange", t)
-                                        }), (a = c.focusedNode) && !a.hasAttribute("disabled") && a.focus(), e
-                                    }, c.hideBackdrop);
+                                        }), c(l.focusedNode), e
+                                    }, l.hideBackdrop);
                                 var n, e;
                                 var t, r;
 
                                 function i() {
                                     return o(function(e) {
-                                        if (c.isRemoved) return o.reject(!1);
-                                        var t = g(s, l, c);
-                                        t.container.element.css(p.toCss(t.container.styles)), t.dropDown.element.css(p.toCss(t.dropDown.styles)), a(function() {
-                                            l.addClass("md-active"), t.dropDown.element.css(p.toCss({
+                                        if (l.isRemoved) return o.reject(!1);
+                                        var t = v(a, s, l);
+                                        t.container.element.css(m.toCss(t.container.styles)), t.dropDown.element.css(m.toCss(t.dropDown.styles)), f(function() {
+                                            s.addClass("md-active"), t.dropDown.element.css(m.toCss({
                                                 transform: ""
-                                            })), e()
+                                            })), c(l.focusedNode), e()
                                         })
                                     })
                                 }
+
+                                function c(e) {
+                                    e && !e.hasAttribute("disabled") && e.focus()
+                                }
                             },
                             onRemove: function(e, t, n) {
                                 var r = null,
                                     i = e.$on("$destroy", function() {
                                         r.end()
                                     });
-                                return (n = n || {}).cleanupInteraction(), n.cleanupResizing(), n.hideBackdrop(), !0 === n.$destroy ? o() : (r = f(t, {
+                                return (n = n || {}).cleanupInteraction(), n.cleanupResizing(), n.hideBackdrop(), !0 === n.$destroy ? o() : (r = h(t, {
                                     addClass: "md-leave"
                                 })).start().then(o);
 
                                 function o() {
-                                    i(), t.removeClass("md-active").attr("aria-hidden", "true").css("display", "none"), t.parent().find("md-select-value").removeAttr("aria-hidden"),
+                                    i(), t.removeClass("md-active").attr("aria-hidden", "true").css({
+                                            display: "none",
+                                            top: "",
+                                            right: "",
+                                            bottom: "",
+                                            left: "",
+                                            "font-size": "",
+                                            "min-width": ""
+                                        }), t.parent().find("md-select-value").removeAttr("aria-hidden"),
                                         function(e) {
                                             var t = e.selectCtrl;
                                             if (t) {
                             disableParentScroll: !0
                         };
 
-                        function g(e, t, n) {
+                        function v(e, t, n) {
                             var r, i, o = t[0],
                                 a = n.target[0].children[0],
                                 s = P[0].body,
                                     } finally {}
                                     return n
                                 }(t, c);
-                            r = (i = n.loadingAsync) && se.isFunction(i.then) ? c.firstElementChild || c : g || (b.length ? b[0] : v.length ? v[0] : c.firstElementChild || c), c.offsetWidth > m ? c.style["max-width"] = m + "px" : c.style.maxWidth = null, y && l.classList.add("md-overflow");
+                            r = (i = n.loadingAsync) && ue.isFunction(i.then) ? c.firstElementChild || c : g || (b.length ? b[0] : v.length ? v[0] : c.firstElementChild || c), c.offsetWidth > m ? c.style["max-width"] = m + "px" : c.style.maxWidth = null, y && l.classList.add("md-overflow");
                             var _ = r;
                             "MD-OPTGROUP" === (_.tagName || "").toUpperCase() && (r = _ = v[0] || c.firstElementChild || c), n.focusedNode = _, o.style.display = "block";
                             var $, w, E, C, k, x, T = l.getBoundingClientRect(),
                                 c.scrollTop = M.top + M.height / 2 - S, h < S ? c.scrollTop = Math.min(M.top, c.scrollTop + S - h) : p < S && (c.scrollTop = Math.max(M.top + M.height - T.height, c.scrollTop - S + p))
                             }
                             w = d.left + M.left - M.paddingLeft + 2, E = Math.floor(d.top + d.height / 2 - M.height / 2 - M.top + c.scrollTop) + 2, C = M.left + d.width / 2 + "px " + (M.top + M.height / 2 - c.scrollTop) + "px 0px", k = Math.min(d.width + M.paddingLeft + M.paddingRight, m), x = F.getComputedStyle(a)["font-size"];
-                            var O = o.getBoundingClientRect(),
-                                D = Math.round(100 * Math.min(d.width / T.width, 1)) / 100,
+                            var D = o.getBoundingClientRect(),
+                                O = Math.round(100 * Math.min(d.width / T.width, 1)) / 100,
                                 N = Math.round(100 * Math.min(d.height / T.height, 1)) / 100;
                             return {
                                 container: {
-                                    element: se.element(o),
+                                    element: ue.element(o),
                                     styles: {
-                                        left: Math.floor(H(f.left, w, f.right - O.width)),
-                                        top: Math.floor(H(f.top, E, f.bottom - O.height)),
+                                        left: Math.floor(H(f.left, w, f.right - D.width)),
+                                        top: Math.floor(H(f.top, E, f.bottom - D.height)),
                                         "min-width": k,
                                         "font-size": x
                                     }
                                 },
                                 dropDown: {
-                                    element: se.element(l),
+                                    element: ue.element(l),
                                     styles: {
                                         transformOrigin: C,
-                                        transform: n.alreadyOpen ? "" : I.supplant("scale({0},{1})", [D, N])
+                                        transform: n.alreadyOpen ? "" : I.supplant("scale({0},{1})", [O, N])
                                     }
                                 }
                             }
                         r = e.keyCode <= 31;
                     return n && n.length && !r && !t.isMetaKey(e) && !t.isFnLockKey(e) && !t.hasModifierKey(e)
                 }
-                se.module("material.components.select", ["material.core", "material.components.backdrop"]).directive("mdSelect", e).directive("mdSelectMenu", t).directive("mdOption", n).directive("mdOptgroup", function() {
+                ue.module("material.components.select", ["material.core", "material.components.backdrop"]).directive("mdSelect", e).directive("mdSelectMenu", t).directive("mdOption", n).directive("mdOptgroup", function() {
                     return {
                         restrict: "E",
                         compile: function(t, n) {
                             t.parent().find("md-select-header").length || function() {
                                 var e = t.find("label");
-                                e.length || (e = se.element("<label>"), t.prepend(e));
+                                e.length || (e = ue.element("<label>"), t.prepend(e));
                                 e.addClass("md-container-ignore"), e.attr("aria-hidden", "true"), n.label && e.text(n.label)
                             }()
                         }
                         }
                     }]
                 }
-                se.module("material.components.showHide", ["material.core"]).directive("ngShow", e("ngShow", !0)).directive("ngHide", e("ngHide", !1))
+                ue.module("material.components.showHide", ["material.core"]).directive("ngShow", e("ngShow", !0)).directive("ngHide", e("ngHide", !1))
             }(),
             function() {
                 function e(r, l, c, i) {
                         d = {
                             find: function(e, t) {
                                 var n = r.get(e);
-                                return n || t ? n : (i.error(l.supplant(u, [e || ""])), le)
+                                return n || t ? n : (i.error(l.supplant(u, [e || ""])), de)
                             },
                             waitFor: f
                         };
                     return function(e, t) {
-                        if (se.isUndefined(e)) return d;
+                        if (ue.isUndefined(e)) return d;
                         var n, r, i, o, a = !0 === t,
                             s = d.find(e, a);
-                        return !s && a ? d.waitFor(e) : !s && se.isUndefined(t) ? (n = d, r = e, i = function() {
+                        return !s && a ? d.waitFor(e) : !s && ue.isUndefined(t) ? (n = d, r = e, i = function() {
                             return !1
                         }, o = function() {
                             return c.when(l.supplant(u, [r || ""]))
-                        }, se.extend({
+                        }, ue.extend({
                             isLockedOpen: i,
                             isOpen: i,
                             toggle: o,
                             open: o,
                             close: o,
-                            onClose: se.noop,
+                            onClose: ue.noop,
                             then: function(e) {
-                                return f(r).then(e || se.noop)
+                                return f(r).then(e || ue.noop)
                             }
                         }, n)) : s
                     };
                     };
 
                     function t(o, a, e, t) {
-                        var s, l, c, u, d = null,
-                            f = null,
-                            h = C.when(!0),
+                        var s, l, c, u, d, f = null,
+                            h = null,
+                            p = C.when(!0),
                             n = w(e.mdIsLockedOpen),
-                            p = se.element(x);
-                        if (e.mdDisableScrollTarget && ((d = k[0].querySelector(e.mdDisableScrollTarget)) ? d = se.element(d) : E.warn(b.supplant('mdSidenav: couldn\'t find element matching selector "{selector}". Falling back to parent.', {
-                                selector: e.mdDisableScrollTarget
-                            }))), d || (d = a.parent()), e.hasOwnProperty("mdDisableBackdrop") || (l = b.createBackdrop(o, "md-sidenav-backdrop md-opaque ng-enter")), e.hasOwnProperty("mdDisableCloseEvents")) var m = !0;
+                            m = ue.element(x);
 
                         function g(e) {
                             return e.keyCode === i.KEY_CODE.ESCAPE ? v(e) : C.when(!0)
                         function v(e) {
                             return e.preventDefault(), t.close()
                         }
-                        a.addClass("_md"), y(a), l && y.inherit(l, a), a.on("$destroy", function() {
+                        e.mdDisableScrollTarget && ((f = k[0].querySelector(e.mdDisableScrollTarget)) ? f = ue.element(f) : E.warn(b.supplant('mdSidenav: couldn\'t find element matching selector "{selector}". Falling back to parent.', {
+                            selector: e.mdDisableScrollTarget
+                        }))), f || (f = a.parent()), e.hasOwnProperty("mdDisableBackdrop") || (l = b.createBackdrop(o, "md-sidenav-backdrop md-opaque ng-enter")), e.hasOwnProperty("mdDisableCloseEvents") && (c = !0), a.addClass("_md"), y(a), l && y.inherit(l, a), a.on("$destroy", function() {
                             l && l.remove(), t.destroy()
                         }), o.$on("$destroy", function() {
                             l && l.remove()
                             (o.isLockedOpen = e) === t ? a.toggleClass("md-locked-open", !!e) : $[e ? "addClass" : "removeClass"](a, "md-locked-open");
                             l && l.toggleClass("md-locked-open", !!e)
                         }), o.$watch("isOpen", function(e) {
-                            var t = b.findFocusTarget(a) || b.findFocusTarget(a, "[md-sidenav-focus]") || a,
-                                n = a.parent();
-                            m || (n[e ? "on" : "off"]("keydown", g), l && l[e ? "on" : "off"]("click", v));
-                            var r = function(e, t) {
+                            var t, n = b.findFocusTarget(a) || b.findFocusTarget(a, "[md-sidenav-focus]") || a,
+                                r = a.parent();
+                            c || (r[e ? "on" : "off"]("keydown", g), l && l[e ? "on" : "off"]("click", v));
+                            t = function(e, t) {
                                 var n = a[0],
                                     r = e[0].scrollTop;
                                 if (t && r) {
-                                    u = {
+                                    d = {
                                         top: n.style.top,
                                         bottom: n.style.bottom,
                                         height: n.style.height
                                     };
                                     a.css(i), l.css(i)
                                 }
-                                if (!t && u) return function() {
-                                    n.style.top = u.top, n.style.bottom = u.bottom, n.style.height = u.height, l[0].style.top = null, l[0].style.bottom = null, l[0].style.height = null, u = null
+                                if (!t && d) return function() {
+                                    n.style.top = d.top, n.style.bottom = d.bottom, n.style.height = d.height, l[0].style.top = null, l[0].style.bottom = null, l[0].style.height = null, d = null
                                 }
-                            }(n, e);
-                            e && (f = k[0].activeElement, c = _.getLastInteractionType());
-                            return i = e, i && !s ? (s = d.css("overflow"), d.css("overflow", "hidden")) : se.isDefined(s) && (d.css("overflow", s), s = le), h = C.all([e && l ? $.enter(l, n) : l ? $.leave(l) : C.when(!0), $[e ? "removeClass" : "addClass"](a, "md-closed")]).then(function() {
+                            }(r, e), e && (h = k[0].activeElement, u = _.getLastInteractionType());
+                            return i = e, i && !s ? (s = f.css("overflow"), f.css("overflow", "hidden")) : ue.isDefined(s) && (f.css("overflow", s), s = de), p = C.all([e && l ? $.enter(l, r) : l ? $.leave(l) : C.when(!0), $[e ? "removeClass" : "addClass"](a, "md-closed")]).then(function() {
                                 o.isOpen && (T(function() {
-                                    p.triggerHandler("resize")
-                                }), t && t.focus()), r && r()
+                                    m.triggerHandler("resize")
+                                }), n && n.focus()), t && t()
                             });
                             var i
                         }), t.$toggleOpen = function(e) {
-                            return o.isOpen == e ? C.when(!0) : (o.isOpen && t.onCloseCb && t.onCloseCb(), C(function(t) {
+                            return o.isOpen === e ? C.when(!0) : (o.isOpen && t.onCloseCb && t.onCloseCb(), C(function(t) {
                                 o.isOpen = e, b.nextTick(function() {
-                                    h.then(function(e) {
-                                        !o.isOpen && f && "keyboard" === c && (f.focus(), f = null), t(e)
+                                    p.then(function(e) {
+                                        !o.isOpen && h && "keyboard" === u && (h.focus(), h = null), t(e)
                                     })
                                 })
                             }))
                         e && e !== o.$$mdHandle && (o.destroy(), o.destroy = n.register(o, e))
                     })
                 }
-                e.$inject = ["$mdComponentRegistry", "$mdUtil", "$q", "$log"], t.$inject = ["$mdMedia", "$mdUtil", "$mdConstant", "$mdTheming", "$mdInteraction", "$animate", "$compile", "$parse", "$log", "$q", "$document", "$window", "$$rAF"], n.$inject = ["$scope", "$attrs", "$mdComponentRegistry", "$q", "$interpolate"], se.module("material.components.sidenav", ["material.core", "material.components.backdrop"]).factory("$mdSidenav", e).directive("mdSidenav", t).directive("mdSidenavFocus", function() {
+                e.$inject = ["$mdComponentRegistry", "$mdUtil", "$q", "$log"], t.$inject = ["$mdMedia", "$mdUtil", "$mdConstant", "$mdTheming", "$mdInteraction", "$animate", "$compile", "$parse", "$log", "$q", "$document", "$window", "$$rAF"], n.$inject = ["$scope", "$attrs", "$mdComponentRegistry", "$q", "$interpolate"], ue.module("material.components.sidenav", ["material.core", "material.components.backdrop"]).factory("$mdSidenav", e).directive("mdSidenav", t).directive("mdSidenavFocus", function() {
                     return {
                         restrict: "A",
                         require: "^mdSidenav",
                 }).controller("$mdSidenavController", n)
             }(),
             function() {
-                function e(V, z, i, B, W, Y, G, K, Z, X) {
+                e.$inject = ["$$rAF", "$window", "$mdAria", "$mdUtil", "$mdConstant", "$mdTheming", "$mdGesture", "$parse", "$log", "$timeout"], ue.module("material.components.slider", ["material.core"]).directive("mdSlider", e).directive("mdSliderContainer", function() {
+                    return {
+                        controller: function() {},
+                        compile: function(e) {
+                            var t = e.find("md-slider");
+                            if (t) {
+                                var n = t.attr("md-vertical");
+                                return n !== de && e.attr("md-vertical", ""), t.attr("flex") || t.attr("flex", ""),
+                                    function(e, a, t, n) {
+                                        function r(e) {
+                                            a.children().attr("disabled", e), a.find("input").attr("disabled", e)
+                                        }
+                                        a.addClass("_md");
+                                        var s, i = ue.noop;
+                                        t.disabled ? r(!0) : t.ngDisabled && (i = e.$watch(t.ngDisabled, function(e) {
+                                            r(e)
+                                        })), e.$on("$destroy", function() {
+                                            i()
+                                        }), n.fitInputWidthToTextLength = function(e) {
+                                            var t = a[0].querySelector("md-input-container");
+                                            if (t) {
+                                                var n = getComputedStyle(t),
+                                                    r = parseInt(n.minWidth),
+                                                    i = parseInt(n.paddingLeft) + parseInt(n.paddingRight);
+                                                s = s || parseInt(n.maxWidth);
+                                                var o = Math.max(s, r + i + r / 2 * e);
+                                                t.style.maxWidth = o + "px"
+                                            }
+                                        }
+                                    }
+                            }
+                        }
+                    }
+                });
+                var J = 10,
+                    ee = 4;
+
+                function e(B, z, i, W, Y, G, K, Z, X, Q) {
                     return {
                         scope: {},
                         require: ["?ngModel", "?^mdSliderContainer"],
                         template: '<div class="md-slider-wrapper"><div class="md-slider-content"><div class="md-track-container"><div class="md-track"></div><div class="md-track md-track-fill"></div><div class="md-track-ticks"></div></div><div class="md-thumb-container"><div class="md-thumb"></div><div class="md-focus-thumb"></div><div class="md-focus-ring"></div><div class="md-sign"><span class="md-thumb-text"></span></div><div class="md-disabled-thumb"></div></div></div></div>',
                         compile: function(e, t) {
-                            var n = se.element(e[0].getElementsByClassName("md-slider-wrapper")),
+                            var n = ue.element(e[0].getElementsByClassName("md-slider-wrapper")),
                                 r = t.tabindex || 0;
                             n.attr("tabindex", r), (t.disabled || t.ngDisabled) && n.attr("tabindex", -1);
-                            return e.attr("role", "slider"), i.expect(e, "aria-label"), o
+                            return n.attr("role", "slider"), i.expect(e, "aria-label"), o
                         }
                     };
 
                     function o(i, o, e, t) {
-                        Y(o);
-                        var n = t[0] || {
+                        G(o);
+                        var r = t[0] || {
                                 $setViewValue: function(e) {
                                     this.$viewValue = e, this.$viewChangeListeners.forEach(function(e) {
                                         e()
                                 $formatters: [],
                                 $viewChangeListeners: []
                             },
-                            r = t[1],
-                            a = (se.element(B.getClosest(o, "_md-slider-container", !0)), e.ngDisabled ? se.bind(null, K(e.ngDisabled), i.$parent) : function() {
+                            n = t[1],
+                            a = (ue.element(W.getClosest(o, "_md-slider-container", !0)), e.ngDisabled ? ue.bind(null, Z(e.ngDisabled), i.$parent) : function() {
                                 return o[0].hasAttribute("disabled")
                             }),
-                            s = se.element(o[0].querySelector(".md-thumb")),
-                            l = se.element(o[0].querySelector(".md-thumb-text")),
+                            s = ue.element(o[0].querySelector(".md-thumb")),
+                            l = ue.element(o[0].querySelector(".md-thumb-text")),
                             c = s.parent(),
-                            u = se.element(o[0].querySelector(".md-track-container")),
-                            d = se.element(o[0].querySelector(".md-track-fill")),
-                            f = se.element(o[0].querySelector(".md-track-ticks")),
-                            h = se.element(o[0].getElementsByClassName("md-slider-wrapper")),
-                            p = (se.element(o[0].getElementsByClassName("md-slider-content")), B.throttle(O, 5e3)),
-                            m = se.isDefined(e.mdVertical),
-                            g = se.isDefined(e.mdDiscrete),
-                            v = se.isDefined(e.mdInvert);
-                        se.isDefined(e.min) ? e.$observe("min", x) : x(0), se.isDefined(e.max) ? e.$observe("max", T) : T(100), se.isDefined(e.step) ? e.$observe("step", M) : M(1), se.isDefined(e.round) ? e.$observe("round", A) : A(3);
-                        se.noop;
+                            u = ue.element(o[0].querySelector(".md-track-container")),
+                            d = ue.element(o[0].querySelector(".md-track-fill")),
+                            f = ue.element(o[0].querySelector(".md-track-ticks")),
+                            h = ue.element(o[0].getElementsByClassName("md-slider-wrapper")),
+                            p = (ue.element(o[0].getElementsByClassName("md-slider-content")), W.throttle(D, 5e3)),
+                            m = ue.isDefined(e.mdVertical),
+                            g = ue.isDefined(e.mdDiscrete),
+                            v = ue.isDefined(e.mdInvert);
+                        ue.isDefined(e.min) ? e.$observe("min", x) : x(0), ue.isDefined(e.max) ? e.$observe("max", T) : T(100), ue.isDefined(e.step) ? e.$observe("step", M) : M(1), ue.isDefined(e.round) ? e.$observe("round", A) : A(3);
+                        ue.noop;
 
                         function b() {
-                            O(), I()
+                            D(), R()
                         }
                         e.ngDisabled && i.$parent.$watch(e.ngDisabled, function() {
                             o.attr("aria-disabled", !!a())
-                        }), G.register(h, "drag", {
+                        }), K.register(h, "drag", {
                             horizontal: !m
                         }), i.mouseActive = !1, h.on("keydown", function(e) {
                             if (a()) return;
-                            var t;
-                            (m ? e.keyCode === W.KEY_CODE.DOWN_ARROW : e.keyCode === W.KEY_CODE.LEFT_ARROW) ? t = -$: (m ? e.keyCode === W.KEY_CODE.UP_ARROW : e.keyCode === W.KEY_CODE.RIGHT_ARROW) && (t = $);
-                            (t = v ? -t : t) && ((e.metaKey || e.ctrlKey || e.altKey) && (t *= 4), e.preventDefault(), e.stopPropagation(), i.$evalAsync(function() {
-                                N(n.$viewValue + t)
-                            }))
+                            var t, n = Y.KEY_CODE;
+                            switch (e.keyCode) {
+                                case n.DOWN_ARROW:
+                                case n.LEFT_ARROW:
+                                    e.preventDefault(), t = -$;
+                                    break;
+                                case n.UP_ARROW:
+                                case n.RIGHT_ARROW:
+                                    e.preventDefault(), t = $;
+                                    break;
+                                case n.PAGE_DOWN:
+                                    e.preventDefault(), t = -$ * J;
+                                    break;
+                                case n.PAGE_UP:
+                                    e.preventDefault(), t = $ * J;
+                                    break;
+                                case n.HOME:
+                                    e.preventDefault(), e.stopPropagation(), N(y);
+                                    break;
+                                case n.END:
+                                    e.preventDefault(), e.stopPropagation(), N(_)
+                            }
+                            t && (t = v ? -t : t, (e.metaKey || e.ctrlKey || e.altKey) && (t *= ee), e.preventDefault(), e.stopPropagation(), N(r.$viewValue + t))
                         }).on("mousedown", function() {
                             (function() {
                                 if (!g || a()) return;
-                                if (se.isUndefined($)) return;
+                                if (ue.isUndefined($)) return;
                                 if ($ <= 0) {
                                     var e = "Slider step value must be greater than zero when in discrete mode";
-                                    throw Z.error(e), new Error(e)
+                                    throw X.error(e), new Error(e)
                                 }
                                 var t = Math.floor((_ - y) / $);
-                                E || (E = se.element("<canvas>").css("position", "absolute"), f.append(E), C = E[0].getContext("2d"));
-                                var n, r = D();
-                                !r || r.height || r.width || (O(), r = S);
+                                E || (E = ue.element("<canvas>").css("position", "absolute"), f.append(E), C = E[0].getContext("2d"));
+                                var n, r = O();
+                                !r || r.height || r.width || (D(), r = S);
                                 E[0].width = r.width, E[0].height = r.height;
                                 for (var i = 0; i <= t; i++) {
                                     var o = z.getComputedStyle(f[0]);
                                     C.fillStyle = o.color || "black", n = Math.floor((m ? r.height : r.width) * (i / t)), C.fillRect(m ? 0 : n - 1, m ? n - 1 : 0, m ? r.width : 2, m ? 2 : r.height)
                                 }
-                            })(), i.mouseActive = !0, h.removeClass("md-focused"), X(function() {
+                            })(), i.mouseActive = !0, h.removeClass("md-focused"), Q(function() {
                                 i.mouseActive = !1
                             }, 100)
                         }).on("focus", function() {
                             h.removeClass("md-focused"), o.removeClass("md-active"),
                                 function() {
                                     if (E && C) {
-                                        var e = D();
+                                        var e = O();
                                         C.clearRect(0, 0, e.width, e.height)
                                     }
                                 }()
                         }).on("$md.pressdown", function(e) {
                             if (a()) return;
-                            o.addClass("md-active"), o[0].focus(), O();
-                            var t = R(P(q(F(m ? e.pointer.y : e.pointer.x))));
+                            o.addClass("md-active"), o[0].focus(), D();
+                            var t = P(H(U(q(m ? e.pointer.y : e.pointer.x))));
                             i.$apply(function() {
-                                N(t), H(U(t))
+                                I(t), j(V(t))
                             })
                         }).on("$md.pressup", function(e) {
                             if (a()) return;
                             o.removeClass("md-dragging");
-                            var t = R(P(q(F(m ? e.pointer.y : e.pointer.x))));
+                            var t = P(H(U(q(m ? e.pointer.y : e.pointer.x))));
                             i.$apply(function() {
-                                N(t), I()
+                                I(t), R()
                             })
                         }).on("$md.dragstart", function(e) {
                             if (a()) return;
-                            j = !0, e.stopPropagation(), o.addClass("md-dragging"), L(e)
+                            L = !0, e.stopPropagation(), o.addClass("md-dragging"), F(e)
                         }).on("$md.drag", function(e) {
-                            if (!j) return;
-                            e.stopPropagation(), L(e)
+                            if (!L) return;
+                            e.stopPropagation(), F(e)
                         }).on("$md.dragend", function(e) {
-                            if (!j) return;
-                            e.stopPropagation(), j = !1
+                            if (!L) return;
+                            e.stopPropagation(), L = !1
                         }), setTimeout(b, 0);
-                        var y, _, $, w, E, C, k = V.throttle(b);
+                        var y, _, $, w, E, C, k = B.throttle(b);
 
                         function x(e) {
-                            y = parseFloat(e), n.$viewValue = R(n.$modelValue, y, _), o.attr("aria-valuemin", e), b()
+                            y = parseFloat(e), r.$viewValue = P(r.$modelValue, y, _), h.attr("aria-valuemin", e), b()
                         }
 
                         function T(e) {
-                            _ = parseFloat(e), n.$viewValue = R(n.$modelValue, y, _), o.attr("aria-valuemax", e), b()
+                            _ = parseFloat(e), r.$viewValue = P(r.$modelValue, y, _), h.attr("aria-valuemax", e), b()
                         }
 
                         function M(e) {
                         }
 
                         function A(e) {
-                            w = R(parseInt(e), 0, 6)
+                            w = P(parseInt(e), 0, 6)
                         }
-                        se.element(z).on("resize", k), i.$on("$destroy", function() {
-                            se.element(z).off("resize", k)
-                        }), n.$render = I, n.$viewChangeListeners.push(I), n.$formatters.push(R), n.$formatters.push(P);
+                        ue.element(z).on("resize", k), i.$on("$destroy", function() {
+                            ue.element(z).off("resize", k)
+                        }), r.$render = R, r.$viewChangeListeners.push(R), r.$formatters.push(P), r.$formatters.push(H);
                         var S = {};
 
-                        function O() {
+                        function D() {
                             S = u[0].getBoundingClientRect()
                         }
 
-                        function D() {
+                        function O() {
                             return p(), S
                         }
 
                         function N(e) {
-                            n.$setViewValue(R(P(e)))
+                            i.$evalAsync(function() {
+                                I(e)
+                            })
+                        }
+
+                        function I(e) {
+                            r.$setViewValue(P(H(e)))
                         }
 
-                        function I() {
-                            isNaN(n.$viewValue) && (n.$viewValue = n.$modelValue), n.$viewValue = R(n.$viewValue);
-                            var e = U(n.$viewValue);
-                            i.modelValue = n.$viewValue, o.attr("aria-valuenow", n.$viewValue), H(e), l.text(n.$viewValue)
+                        function R() {
+                            isNaN(r.$viewValue) && (r.$viewValue = r.$modelValue), r.$viewValue = P(r.$viewValue);
+                            var e = V(r.$viewValue);
+                            i.modelValue = r.$viewValue, h.attr("aria-valuenow", r.$viewValue), j(e), l.text(r.$viewValue)
                         }
 
-                        function R(e, t, n) {
-                            if (se.isNumber(e)) return t = se.isNumber(t) ? t : y, n = se.isNumber(n) ? n : _, Math.max(t, Math.min(n, e))
+                        function P(e, t, n) {
+                            if (ue.isNumber(e)) return t = ue.isNumber(t) ? t : y, n = ue.isNumber(n) ? n : _, Math.max(t, Math.min(n, e))
                         }
 
-                        function P(e) {
-                            if (se.isNumber(e)) {
+                        function H(e) {
+                            if (ue.isNumber(e)) {
                                 var t = Math.round((e - y) / $) * $ + y;
-                                return t = Math.round(t * Math.pow(10, w)) / Math.pow(10, w), r && r.fitInputWidthToTextLength && B.debounce(function() {
-                                    r.fitInputWidthToTextLength(t.toString().length)
+                                return t = Math.round(t * Math.pow(10, w)) / Math.pow(10, w), n && n.fitInputWidthToTextLength && W.debounce(function() {
+                                    n.fitInputWidthToTextLength(t.toString().length)
                                 }, 100)(), t
                             }
                         }
 
-                        function H(e) {
+                        function j(e) {
                             var t;
                             t = e;
                             var n = 100 * (e = Math.max(0, Math.min(t || 0, 1))) + "%",
                                 r = v ? 100 * (1 - e) + "%" : n;
-                            m ? c.css("bottom", n) : B.bidiProperty(c, "left", "right", n), d.css(m ? "height" : "width", r), o.toggleClass(v ? "md-max" : "md-min", 0 === e), o.toggleClass(v ? "md-min" : "md-max", 1 === e)
+                            m ? c.css("bottom", n) : W.bidiProperty(c, "left", "right", n), d.css(m ? "height" : "width", r), o.toggleClass(v ? "md-max" : "md-min", 0 === e), o.toggleClass(v ? "md-min" : "md-max", 1 === e)
                         }
-                        O();
-                        var j = !1;
+                        D();
+                        var L = !1;
 
-                        function L(e) {
+                        function F(e) {
                             var t, n, r;
-                            g ? (n = m ? e.pointer.y : e.pointer.x, r = R(P(q(F(n)))), H(F(n)), l.text(r)) : (t = m ? e.pointer.y : e.pointer.x, i.$evalAsync(function() {
-                                N(q(F(t)))
+                            g ? (n = m ? e.pointer.y : e.pointer.x, r = P(H(U(q(n)))), j(q(n)), l.text(r)) : (t = m ? e.pointer.y : e.pointer.x, i.$evalAsync(function() {
+                                I(U(q(t)))
                             }))
                         }
 
-                        function F(e) {
+                        function q(e) {
                             var t = (e - (m ? S.top : S.left)) / (m ? S.height : S.width);
-                            return m || "rtl" !== B.bidi() || (t = 1 - t), Math.max(0, Math.min(1, m ? 1 - t : t))
+                            return m || "rtl" !== W.bidi() || (t = 1 - t), Math.max(0, Math.min(1, m ? 1 - t : t))
                         }
 
-                        function q(e) {
+                        function U(e) {
                             return y + (v ? 1 - e : e) * (_ - y)
                         }
 
-                        function U(e) {
+                        function V(e) {
                             var t = (e - y) / (_ - y);
                             return v ? 1 - t : t
                         }
                     }
                 }
-                e.$inject = ["$$rAF", "$window", "$mdAria", "$mdUtil", "$mdConstant", "$mdTheming", "$mdGesture", "$parse", "$log", "$timeout"], se.module("material.components.slider", ["material.core"]).directive("mdSlider", e).directive("mdSliderContainer", function() {
-                    return {
-                        controller: function() {},
-                        compile: function(e) {
-                            var t = e.find("md-slider");
-                            if (t) {
-                                var n = t.attr("md-vertical");
-                                return n !== le && e.attr("md-vertical", ""), t.attr("flex") || t.attr("flex", ""),
-                                    function(e, a, t, n) {
-                                        function r(e) {
-                                            a.children().attr("disabled", e), a.find("input").attr("disabled", e)
-                                        }
-                                        a.addClass("_md");
-                                        var s, i = se.noop;
-                                        t.disabled ? r(!0) : t.ngDisabled && (i = e.$watch(t.ngDisabled, function(e) {
-                                            r(e)
-                                        })), e.$on("$destroy", function() {
-                                            i()
-                                        }), n.fitInputWidthToTextLength = function(e) {
-                                            var t = a[0].querySelector("md-input-container");
-                                            if (t) {
-                                                var n = getComputedStyle(t),
-                                                    r = parseInt(n.minWidth),
-                                                    i = parseInt(n.paddingLeft) + parseInt(n.paddingRight);
-                                                s = s || parseInt(n.maxWidth);
-                                                var o = Math.max(s, r + i + r / 2 * e);
-                                                t.style.maxWidth = o + "px"
-                                            }
-                                        }
-                                    }
-                            }
-                        }
-                    }
-                })
             }(),
             function() {
                 function e(c, u, d, s) {
                                         var t = e.element[0];
                                         for (e.top = 0, e.left = 0, e.right = 0; t && t !== i[0];) e.top += t.offsetTop, e.left += t.offsetLeft, t.offsetParent && (e.right += t.offsetParent.offsetWidth - t.offsetWidth - t.offsetLeft), t = t.offsetParent;
                                         e.height = e.element.prop("offsetHeight");
-                                        var n = d.floatingScrollbars() ? "0" : le;
+                                        var n = d.floatingScrollbars() ? "0" : de;
                                         d.bidi(e.clone, "margin-left", e.left, n), d.bidi(e.clone, "margin-right", n, e.right)
                                     }
 
                                     }
 
                                     function l(e, t) {
-                                        e && (null === t || t === le ? e.translateY && (e.translateY = null, e.clone.css(c.CSS.TRANSFORM, "")) : (e.translateY = t, d.bidi(e.clone, c.CSS.TRANSFORM, "translate3d(" + e.left + "px," + t + "px,0)", "translateY(" + t + "px)")))
+                                        e && (null === t || t === de ? e.translateY && (e.translateY = null, e.clone.css(c.CSS.TRANSFORM, "")) : (e.translateY = t, d.bidi(e.clone, c.CSS.TRANSFORM, "translate3d(" + e.left + "px," + t + "px,0)", "translateY(" + t + "px)")))
                                     }
                                 }(r), r.$element.data("$$sticky", i));
                                 var o = n || s(t.clone())(e),
                             }
                     }
                 }
-                e.$inject = ["$mdConstant", "$$rAF", "$mdUtil", "$compile"], se.module("material.components.sticky", ["material.core", "material.components.content"]).factory("$mdSticky", e)
+                e.$inject = ["$mdConstant", "$$rAF", "$mdUtil", "$compile"], ue.module("material.components.sticky", ["material.core", "material.components.content"]).factory("$mdSticky", e)
             }(),
             function() {
                 function e(s, l, c, u, d) {
                             var o = r[0].outerHTML;
 
                             function a(e) {
-                                return se.element(e[0].querySelector(".md-subheader-content"))
+                                return ue.element(e[0].querySelector(".md-subheader-content"))
                             }
                             e.$set("role", "heading"), d.expect(r, "aria-level", "2"), i(n, function(e) {
                                 a(r).append(e)
                         }
                     }
                 }
-                e.$inject = ["$mdSticky", "$compile", "$mdTheming", "$mdUtil", "$mdAria"], se.module("material.components.subheader", ["material.core", "material.components.sticky"]).directive("mdSubheader", e)
+                e.$inject = ["$mdSticky", "$compile", "$mdTheming", "$mdUtil", "$mdAria"], ue.module("material.components.subheader", ["material.core", "material.components.sticky"]).directive("mdSubheader", e)
             }(),
             function() {
                 function e(e) {
                         }
                     }
                 }
-                se.module("material.components.swipe", ["material.core"]).directive("mdSwipeLeft", e("SwipeLeft")).directive("mdSwipeRight", e("SwipeRight")).directive("mdSwipeUp", e("SwipeUp")).directive("mdSwipeDown", e("SwipeDown"))
+                ue.module("material.components.swipe", ["material.core"]).directive("mdSwipeLeft", e("SwipeLeft")).directive("mdSwipeRight", e("SwipeRight")).directive("mdSwipeUp", e("SwipeUp")).directive("mdSwipeDown", e("SwipeDown"))
             }(),
             function() {
                 function e(e, d, f, h, p, m, g) {
                                     null != e.disabled ? o = function() {
                                         return !0
                                     } : e.ngDisabled && (o = h(e.ngDisabled));
-                                    var a, s = se.element(r[0].querySelector(".md-thumb-container")),
-                                        l = se.element(r[0].querySelector(".md-container")),
-                                        c = se.element(r[0].querySelector(".md-label"));
+                                    var a, s = ue.element(r[0].querySelector(".md-thumb-container")),
+                                        l = ue.element(r[0].querySelector(".md-container")),
+                                        c = ue.element(r[0].querySelector(".md-label"));
                                     p(function() {
                                         r.removeClass("md-dragging")
                                     }), u(n, r, e, t), o && n.$watch(o, function(e) {
                         }
                     }
                 }
-                e.$inject = ["mdCheckboxDirective", "$mdUtil", "$mdConstant", "$parse", "$$rAF", "$mdGesture", "$timeout"], se.module("material.components.switch", ["material.core", "material.components.checkbox"]).directive("mdSwitch", e)
-            }(), se.module("material.components.tabs", ["material.core", "material.components.icon"]), se.module("material.components.tabs").service("MdTabsPaginationService", function() {
+                e.$inject = ["mdCheckboxDirective", "$mdUtil", "$mdConstant", "$parse", "$$rAF", "$mdGesture", "$timeout"], ue.module("material.components.switch", ["material.core", "material.components.checkbox"]).directive("mdSwitch", e)
+            }(), ue.module("material.components.tabs", ["material.core", "material.components.icon"]), ue.module("material.components.tabs").service("MdTabsPaginationService", function() {
                 return {
                     decreasePageOffset: function(e, t) {
                         var n, r, i = e.canvas,
                     for (t = 0; t < e.tabs.length; t++) n = e.tabs[t], r += n.offsetWidth;
                     return r
                 }
+            }), ue.module("material.components.tabs").directive("mdTab", function() {
+                return {
+                    require: "^?mdTabs",
+                    terminal: !0,
+                    compile: function(e, t) {
+                        var n = l(e, "md-tab-label"),
+                            r = l(e, "md-tab-body");
+                        if (0 === n.length && (n = ue.element("<md-tab-label></md-tab-label>"), t.label ? n.text(t.label) : n.append(e.contents()), 0 === r.length)) {
+                            var i = e.contents().detach();
+                            (r = ue.element("<md-tab-body></md-tab-body>")).append(i)
+                        }
+                        return e.append(n), r.html() && e.append(r), o
+                    },
+                    scope: {
+                        active: "=?mdActive",
+                        disabled: "=?ngDisabled",
+                        select: "&?mdOnSelect",
+                        deselect: "&?mdOnDeselect",
+                        tabClass: "@mdTabClass"
+                    }
+                };
+
+                function o(e, t, n, r) {
+                    if (r) {
+                        var i = r.getTabElementIndex(t),
+                            o = l(t, "md-tab-body").remove(),
+                            a = l(t, "md-tab-label").remove(),
+                            s = r.insertTab({
+                                scope: e,
+                                parent: e.$parent,
+                                index: i,
+                                element: t,
+                                template: o.html(),
+                                label: a.html()
+                            }, i);
+                        e.select = e.select || ue.noop, e.deselect = e.deselect || ue.noop, e.$watch("active", function(e) {
+                            e && r.select(s.getIndex(), !0)
+                        }), e.$watch("disabled", function() {
+                            r.refreshIndex()
+                        }), e.$watch(function() {
+                            return r.getTabElementIndex(t)
+                        }, function(e) {
+                            s.index = e, r.updateTabOrder()
+                        }), e.$on("$destroy", function() {
+                            r.removeTab(s)
+                        })
+                    }
+                }
+
+                function l(e, t) {
+                    for (var n = e[0].children, r = 0, i = n.length; r < i; r++) {
+                        var o = n[r];
+                        if (o.tagName === t.toUpperCase()) return ue.element(o)
+                    }
+                    return ue.element()
+                }
+            }), ue.module("material.components.tabs").directive("mdTabItem", function() {
+                return {
+                    require: "^?mdTabs",
+                    link: function(e, t, n, r) {
+                        r && r.attachRipple(e, t)
+                    }
+                }
+            }), ue.module("material.components.tabs").directive("mdTabLabel", function() {
+                return {
+                    terminal: !0
+                }
             }),
             function() {
+                function e(r) {
+                    return {
+                        restrict: "A",
+                        compile: function(e, t) {
+                            var n = r(t.mdTabScroll, null, !0);
+                            return function(t, e) {
+                                e.on("wheel", function(e) {
+                                    t.$apply(function() {
+                                        n(t, {
+                                            $event: e
+                                        })
+                                    })
+                                })
+                            }
+                        }
+                    }
+                }
+                e.$inject = ["$parse"], ue.module("material.components.tabs").directive("mdTabScroll", e)
+            }(),
+            function() {
+                function e(c, u, n, r, i, d, l, o, a, s, t, f, h) {
+                    var p = this,
+                        m = !1,
+                        g = [],
+                        v = !1,
+                        b = !1;
+
+                    function y(t, e) {
+                        var n = o.$normalize("md-" + t);
+
+                        function r(e) {
+                            p[t] = "false" !== e
+                        }
+                        e && P(t, e), o.hasOwnProperty(n) && r(o[n]), o.$observe(n, r)
+                    }
+
+                    function _() {
+                        v = !0, ue.element(n).off("resize", S)
+                    }
+
+                    function $() {
+                        var e = N();
+                        ue.element(e.wrapper).toggleClass("md-stretch-tabs", function() {
+                            switch (p.stretchTabs) {
+                                case "always":
+                                    return !0;
+                                case "never":
+                                    return !1;
+                                default:
+                                    return !p.shouldPaginate && n.matchMedia("(max-width: 600px)").matches
+                            }
+                        }()), z()
+                    }
+
+                    function w() {
+                        p.shouldCenterTabs = I()
+                    }
+
+                    function E(t, e) {
+                        if (t !== e) {
+                            var n = N();
+                            ue.forEach(n.tabs, function(e) {
+                                e.style.maxWidth = t + "px"
+                            }), ue.forEach(n.dummies, function(e) {
+                                e.style.maxWidth = t + "px"
+                            }), d.nextTick(p.updateInkBarStyles)
+                        }
+                    }
+
+                    function C(e, t) {
+                        e !== t && (p.maxTabWidth = L(), p.shouldCenterTabs = I(), d.nextTick(function() {
+                            p.maxTabWidth = L(), U(p.selectedIndex)
+                        }))
+                    }
+
+                    function k(e) {
+                        u[e ? "removeClass" : "addClass"]("md-no-tab-content")
+                    }
+
+                    function x(e) {
+                        var t = (p.shouldCenterTabs || Y() ? "" : "-") + e + "px";
+                        t = t.replace("--", ""), ue.element(N().paging).css(r.CSS.TRANSFORM, "translate(" + t + ", 0)"), c.$broadcast("$mdTabsPaginationChanged")
+                    }
+
+                    function T(e, t) {
+                        e !== t && N().tabs[e] && (U(), q())
+                    }
+
+                    function M(e, t) {
+                        e !== t && (p.selectedIndex = R(e), p.lastSelectedIndex = t, p.updateInkBarStyles(), B(), U(e), c.$broadcast("$mdTabsChanged"), p.tabs[t] && p.tabs[t].scope.deselect(), p.tabs[e] && p.tabs[e].scope.select())
+                    }
+
+                    function A(e, t) {
+                        m || (p.focusIndex = p.selectedIndex = e), t && p.noSelectClick || d.nextTick(function() {
+                            p.tabs[e].element.triggerHandler("click")
+                        }, !1)
+                    }
+
+                    function S() {
+                        p.lastSelectedIndex = p.selectedIndex, p.offsetLeft = W(p.offsetLeft), d.nextTick(function() {
+                            p.updateInkBarStyles(), H()
+                        })
+                    }
+
+                    function D(e) {
+                        ue.element(N().inkBar).toggleClass("ng-hide", e)
+                    }
+
+                    function O(e) {
+                        u.toggleClass("md-dynamic-height", e)
+                    }
+
+                    function N() {
+                        var e = {},
+                            t = u[0];
+                        return e.wrapper = t.querySelector("md-tabs-wrapper"), e.canvas = e.wrapper.querySelector("md-tabs-canvas"), e.paging = e.canvas.querySelector("md-pagination-wrapper"), e.inkBar = e.paging.querySelector("md-ink-bar"), e.nextButton = t.querySelector("md-next-button"), e.prevButton = t.querySelector("md-prev-button"), e.contents = t.querySelectorAll("md-tabs-content-wrapper > md-tab-content"), e.tabs = e.paging.querySelectorAll("md-tab-item"), e.dummies = e.canvas.querySelectorAll("md-dummy-tab"), e
+                    }
+
+                    function I() {
+                        return p.centerTabs && !p.shouldPaginate
+                    }
+
+                    function R(e) {
+                        if (-1 === e) return -1;
+                        var t, n, r = Math.max(p.tabs.length - e, e);
+                        for (t = 0; t <= r; t++) {
+                            if ((n = p.tabs[e + t]) && !0 !== n.scope.disabled) return n.getIndex();
+                            if ((n = p.tabs[e - t]) && !0 !== n.scope.disabled) return n.getIndex()
+                        }
+                        return e
+                    }
+
+                    function P(e, n, r) {
+                        Object.defineProperty(p, e, {
+                            get: function() {
+                                return r
+                            },
+                            set: function(e) {
+                                var t = r;
+                                r = e, n && n(e, t)
+                            }
+                        })
+                    }
+
+                    function H() {
+                        p.maxTabWidth = L(), p.shouldPaginate = function() {
+                            var e;
+                            if (p.noPagination || !b) return !1;
+                            var t = u.prop("clientWidth");
+                            return ue.forEach(N().tabs, function(e) {
+                                t -= e.offsetWidth
+                            }), e = t < 0, d.msie && (N().paging.style.width = e ? "999999px" : de), e
+                        }()
+                    }
+
+                    function j(e) {
+                        var t = 0;
+                        return ue.forEach(e, function(e) {
+                            t += Math.max(e.offsetWidth, e.getBoundingClientRect().width)
+                        }), Math.ceil(t)
+                    }
+
+                    function L() {
+                        var e = N().canvas.clientWidth;
+                        return Math.max(0, Math.min(e - 1, 264))
+                    }
+
+                    function F(e, t) {
+                        var n, r = t ? "focusIndex" : "selectedIndex",
+                            i = p[r];
+                        for (n = i + e; p.tabs[n] && p.tabs[n].scope.disabled; n += e);
+                        n = (i + e + p.tabs.length) % p.tabs.length, p.tabs[n] && (p[r] = n)
+                    }
+
+                    function q() {
+                        p.styleTabItemFocus = "keyboard" === t.getLastInteractionType();
+                        var e = N().tabs[p.focusIndex];
+                        e && e.focus()
+                    }
+
+                    function U(e) {
+                        var t = N();
+                        if (ue.isNumber(e) || (e = p.focusIndex), t.tabs[e] && !p.shouldCenterTabs) {
+                            var n = t.tabs[e],
+                                r = n.offsetLeft,
+                                i = n.offsetWidth + r;
+                            if (0 !== e)
+                                if (Y()) {
+                                    var o = j(Array.prototype.slice.call(t.tabs, 0, e)),
+                                        a = j(Array.prototype.slice.call(t.tabs, 0, e + 1));
+                                    p.offsetLeft = Math.min(p.offsetLeft, W(o)), p.offsetLeft = Math.max(p.offsetLeft, W(a - t.canvas.clientWidth))
+                                } else p.offsetLeft = Math.max(p.offsetLeft, W(i - t.canvas.clientWidth + 32)), p.offsetLeft = Math.min(p.offsetLeft, W(r));
+                            else p.offsetLeft = 0
+                        }
+                    }
+
+                    function V() {
+                        p.selectedIndex = R(p.selectedIndex), p.focusIndex = R(p.focusIndex)
+                    }
+
+                    function B() {
+                        if (!p.dynamicHeight) return u.css("height", "");
+                        if (!p.tabs.length) return g.push(B);
+                        var e = N(),
+                            t = e.contents[p.selectedIndex],
+                            n = t ? t.offsetHeight : 0,
+                            r = e.wrapper.offsetHeight,
+                            i = n + r,
+                            o = u.prop("clientHeight");
+                        if (o !== i) {
+                            "bottom" === u.attr("md-align-tabs") && (o -= r, i -= r, u.attr("md-border-bottom") !== de && ++o), m = !0;
+                            var a = {
+                                    height: o + "px"
+                                },
+                                s = {
+                                    height: i + "px"
+                                };
+                            u.css(a), l(u, {
+                                from: a,
+                                to: s,
+                                easing: "cubic-bezier(0.35, 0, 0.25, 1)",
+                                duration: .5
+                            }).start().done(function() {
+                                u.css({
+                                    transition: "none",
+                                    height: ""
+                                }), d.nextTick(function() {
+                                    u.css("transition", "")
+                                }), m = !1
+                            })
+                        }
+                    }
+
+                    function z(e, t) {
+                        if (!p.noInkBar) {
+                            var n = N();
+                            if (n.tabs[p.selectedIndex])
+                                if (p.tabs.length)
+                                    if (u.prop("offsetParent")) {
+                                        var r = p.selectedIndex,
+                                            i = n.paging.offsetWidth,
+                                            o = n.tabs[r],
+                                            a = o.offsetLeft,
+                                            s = i - a - o.offsetWidth;
+                                        if (p.shouldCenterTabs) {
+                                            var l = j(n.tabs);
+                                            l < i && e !== i && t !== l && f(z, 0, !0, i, l)
+                                        }! function() {
+                                            var e = N(),
+                                                t = p.selectedIndex,
+                                                n = p.lastSelectedIndex,
+                                                r = ue.element(e.inkBar);
+                                            if (!ue.isNumber(n)) return;
+                                            r.toggleClass("md-left", t < n).toggleClass("md-right", n < t)
+                                        }(), ue.element(n.inkBar).css({
+                                            left: a + "px",
+                                            right: s + "px"
+                                        })
+                                    } else(function e() {
+                                        e.watcher || (e.watcher = c.$watch(function() {
+                                            d.nextTick(function() {
+                                                e.watcher && u.prop("offsetParent") && (e.watcher(), e.watcher = null, S())
+                                            }, !1)
+                                        }))
+                                    })();
+                            else g.push(p.updateInkBarStyles);
+                            else ue.element(n.inkBar).css({
+                                left: "auto",
+                                right: "auto"
+                            })
+                        }
+                    }
+
+                    function W(e) {
+                        var t = N();
+                        if (!t.tabs.length || !p.shouldPaginate) return 0;
+                        var n = t.tabs[t.tabs.length - 1],
+                            r = n.offsetLeft + n.offsetWidth;
+                        return e = Y() ? (e = Math.min(t.paging.offsetWidth - t.canvas.clientWidth, e), Math.max(0, e)) : (e = Math.max(0, e), Math.min(r - t.canvas.clientWidth, e))
+                    }
+
+                    function Y() {
+                        return "rtl" === d.bidi()
+                    }
+                    p.$onInit = function() {
+                        (function(t, e) {
+                            var n = o.$normalize("md-" + t);
+                            e && P(t, e);
+                            o.$observe(n, function(e) {
+                                p[t] = e
+                            })
+                        })("stretchTabs", $), P("focusIndex", T, p.selectedIndex || 0), P("offsetLeft", x, 0), P("hasContent", k, !1), P("maxTabWidth", E, L()), P("shouldPaginate", C, !1), y("noInkBar", D), y("dynamicHeight", O), y("noPagination"), y("swipeContent"), y("noDisconnect"), y("autoselect"), y("noSelectClick"), y("centerTabs", w), y("enableDisconnect"), p.scope = c, p.parent = c.$parent, p.tabs = [], p.lastSelectedIndex = null, p.hasFocus = !1, p.styleTabItemFocus = !1, p.shouldCenterTabs = I(), p.tabContentPrefix = "tab-content-", p.navigationHint = "Use the left and right arrow keys to navigate between tabs", p.selectedIndex = p.selectedIndex || 0, e = o.$mdTabsTemplate, t = ue.element(u[0].querySelector("md-tab-data")), t.html(e), a(t.contents())(p.parent), delete o.$mdTabsTemplate, c.$watch("$mdTabsCtrl.selectedIndex", M), ue.element(n).on("resize", S), c.$on("$destroy", _), s(u), d.nextTick(function() {
+                            B(), U(), z(), p.tabs[p.selectedIndex] && p.tabs[p.selectedIndex].scope.select(), b = !0, H()
+                        });
+                        var e, t
+                    }, p.updatePagination = d.debounce(H, 100), p.redirectFocus = q, p.attachRipple = function(e, t) {
+                        var n = N(),
+                            r = {
+                                colorElement: ue.element(n.inkBar)
+                            };
+                        i.attach(e, t, r)
+                    }, p.insertTab = function(e, t) {
+                        var n = b,
+                            r = {
+                                getIndex: function() {
+                                    return p.tabs.indexOf(i)
+                                },
+                                isActive: function() {
+                                    return this.getIndex() === p.selectedIndex
+                                },
+                                isLeft: function() {
+                                    return this.getIndex() < p.selectedIndex
+                                },
+                                isRight: function() {
+                                    return this.getIndex() > p.selectedIndex
+                                },
+                                shouldRender: function() {
+                                    return !p.noDisconnect || this.isActive()
+                                },
+                                hasFocus: function() {
+                                    return p.styleTabItemFocus && p.hasFocus && this.getIndex() === p.focusIndex
+                                },
+                                id: d.nextUid(),
+                                hasContent: !(!e.template || !e.template.trim())
+                            },
+                            i = ue.extend(r, e);
+                        ue.isDefined(t) ? p.tabs.splice(t, 0, i) : p.tabs.push(i);
+                        return g.forEach(function(e) {
+                                d.nextTick(e)
+                            }), g = [],
+                            function() {
+                                var e, t = !1;
+                                for (e = 0; e < p.tabs.length; e++)
+                                    if (p.tabs[e].hasContent) {
+                                        t = !0;
+                                        break
+                                    } p.hasContent = t
+                            }(), d.nextTick(function() {
+                                H(),
+                                    function(e) {
+                                        if (e.hasContent) {
+                                            var t = u[0].querySelectorAll('[md-tab-id="' + e.id + '"]');
+                                            ue.element(t).attr("aria-controls", p.tabContentPrefix + e.id)
+                                        }
+                                    }(i), n && p.autoselect && d.nextTick(function() {
+                                        d.nextTick(function() {
+                                            A(p.tabs.indexOf(i))
+                                        })
+                                    })
+                            }), i
+                    }, p.removeTab = function(e) {
+                        if (v) return;
+                        var t = p.selectedIndex,
+                            n = p.tabs.splice(e.getIndex(), 1)[0];
+                        V(), p.selectedIndex === t && (n.scope.deselect(), p.tabs[p.selectedIndex] && p.tabs[p.selectedIndex].scope.select());
+                        d.nextTick(function() {
+                            H(), p.offsetLeft = W(p.offsetLeft)
+                        })
+                    }, p.select = A, p.scroll = function(e) {
+                        if (!p.shouldPaginate) return;
+                        e.preventDefault(), e.deltaY ? p.offsetLeft = W(p.offsetLeft + e.deltaY) : e.deltaX && (p.offsetLeft = W(p.offsetLeft + e.deltaX))
+                    }, p.nextPage = function() {
+                        if (!p.canPageForward()) return;
+                        var e = h.increasePageOffset(N(), p.offsetLeft);
+                        p.offsetLeft = W(e)
+                    }, p.previousPage = function() {
+                        if (!p.canPageBack()) return;
+                        var e = h.decreasePageOffset(N(), p.offsetLeft);
+                        p.offsetLeft = W(e)
+                    }, p.keydown = function(e) {
+                        switch (e.keyCode) {
+                            case r.KEY_CODE.LEFT_ARROW:
+                                e.preventDefault(), F(-1, !0);
+                                break;
+                            case r.KEY_CODE.RIGHT_ARROW:
+                                e.preventDefault(), F(1, !0);
+                                break;
+                            case r.KEY_CODE.SPACE:
+                            case r.KEY_CODE.ENTER:
+                                e.preventDefault(), m || A(p.focusIndex);
+                                break;
+                            case r.KEY_CODE.TAB:
+                                p.focusIndex !== p.selectedIndex && (p.focusIndex = p.selectedIndex)
+                        }
+                    }, p.canPageForward = function() {
+                        var e = N(),
+                            t = e.tabs[e.tabs.length - 1];
+                        if (Y()) return p.offsetLeft < e.paging.offsetWidth - e.canvas.offsetWidth;
+                        return t && t.offsetLeft + t.offsetWidth > e.canvas.clientWidth + p.offsetLeft
+                    }, p.canPageBack = function() {
+                        return 0 < p.offsetLeft
+                    }, p.refreshIndex = V, p.incrementIndex = F, p.getTabElementIndex = function(e) {
+                        var t = u[0].getElementsByTagName("md-tab");
+                        return Array.prototype.indexOf.call(t, e[0])
+                    }, p.updateInkBarStyles = d.debounce(z, 100), p.updateTabOrder = d.debounce(function() {
+                        var e = p.tabs[p.selectedIndex],
+                            t = p.tabs[p.focusIndex];
+                        p.tabs = p.tabs.sort(function(e, t) {
+                            return e.index - t.index
+                        }), p.selectedIndex = p.tabs.indexOf(e), p.focusIndex = p.tabs.indexOf(t)
+                    }, 100), p.getFocusedTabId = function() {
+                        var e = p.tabs[p.focusIndex];
+                        return e && e.id ? "tab-item-" + e.id : null
+                    }, 1 === ue.version.major && ue.version.minor <= 4 && this.$onInit()
+                }
+                e.$inject = ["$scope", "$element", "$window", "$mdConstant", "$mdTabInkRipple", "$mdUtil", "$animateCss", "$attrs", "$compile", "$mdTheming", "$mdInteraction", "$timeout", "MdTabsPaginationService"], ue.module("material.components.tabs").controller("MdTabsController", e)
+            }(),
+            function() {
+                function e(n) {
+                    return {
+                        scope: {
+                            navigationHint: "@?mdNavigationHint",
+                            selectedIndex: "=?mdSelected"
+                        },
+                        template: function(e, t) {
+                            return t.$mdTabsTemplate = e.html(), '<md-tabs-wrapper> <md-tab-data></md-tab-data> <md-prev-button tabindex="-1" role="button" aria-label="Previous Page" aria-disabled="{{!$mdTabsCtrl.canPageBack()}}" ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageBack() }" ng-if="$mdTabsCtrl.shouldPaginate" ng-click="$mdTabsCtrl.previousPage()"> <md-icon md-svg-src="' + n.mdTabsArrow + '"></md-icon> </md-prev-button> <md-next-button tabindex="-1" role="button" aria-label="Next Page" aria-disabled="{{!$mdTabsCtrl.canPageForward()}}" ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageForward() }" ng-if="$mdTabsCtrl.shouldPaginate" ng-click="$mdTabsCtrl.nextPage()"> <md-icon md-svg-src="' + n.mdTabsArrow + '"></md-icon> </md-next-button> <md-tabs-canvas tabindex="{{ $mdTabsCtrl.hasFocus ? -1 : 0 }}" ng-focus="$mdTabsCtrl.redirectFocus()" ng-class="{ \'md-paginated\': $mdTabsCtrl.shouldPaginate, \'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs }" ng-keydown="$mdTabsCtrl.keydown($event)"> <md-pagination-wrapper ng-class="{ \'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs }" md-tab-scroll="$mdTabsCtrl.scroll($event)" role="tablist" aria-label="{{::$mdTabsCtrl.navigationHint}}"><md-tab-item tabindex="{{ tab.isActive() ? 0 : -1 }}" class="md-tab {{::tab.scope.tabClass}}" ng-repeat="tab in $mdTabsCtrl.tabs" role="tab" id="tab-item-{{::tab.id}}" md-tab-id="{{::tab.id}}" aria-selected="{{tab.isActive()}}" aria-disabled="{{tab.scope.disabled || \'false\'}}" ng-click="$mdTabsCtrl.select(tab.getIndex())" ng-focus="$mdTabsCtrl.hasFocus = true" ng-blur="$mdTabsCtrl.hasFocus = false" ng-class="{ \'md-active\':    tab.isActive(), \'md-focused\':   tab.hasFocus(), \'md-disabled\':  tab.scope.disabled }" ng-disabled="tab.scope.disabled" md-swipe-left="$mdTabsCtrl.nextPage()" md-swipe-right="$mdTabsCtrl.previousPage()" md-tabs-template="::tab.label" md-scope="::tab.parent"></md-tab-item> <md-ink-bar></md-ink-bar> </md-pagination-wrapper> <md-tabs-dummy-wrapper aria-hidden="true" class="md-visually-hidden md-dummy-wrapper"> <md-dummy-tab class="md-tab" tabindex="-1" ng-focus="$mdTabsCtrl.hasFocus = true" ng-blur="$mdTabsCtrl.hasFocus = false" ng-repeat="tab in $mdTabsCtrl.tabs" md-tabs-template="::tab.label" md-scope="::tab.parent"></md-dummy-tab> </md-tabs-dummy-wrapper> </md-tabs-canvas> </md-tabs-wrapper> <md-tabs-content-wrapper ng-show="$mdTabsCtrl.hasContent && $mdTabsCtrl.selectedIndex >= 0" class="_md"> <md-tab-content id="{{:: $mdTabsCtrl.tabContentPrefix + tab.id}}" class="_md" role="tabpanel" aria-labelledby="tab-item-{{::tab.id}}" md-swipe-left="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(1)" md-swipe-right="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(-1)" ng-if="tab.hasContent" ng-repeat="(index, tab) in $mdTabsCtrl.tabs" ng-class="{ \'md-no-transition\': $mdTabsCtrl.lastSelectedIndex == null, \'md-active\':        tab.isActive(), \'md-left\':          tab.isLeft(), \'md-right\':         tab.isRight(), \'md-no-scroll\':     $mdTabsCtrl.dynamicHeight }"> <div md-tabs-template="::tab.template" md-connected-if="tab.isActive()" md-scope="::tab.parent" ng-if="$mdTabsCtrl.enableDisconnect || tab.shouldRender()"></div> </md-tab-content> </md-tabs-content-wrapper>'
+                        },
+                        controller: "MdTabsController",
+                        controllerAs: "$mdTabsCtrl",
+                        bindToController: !0
+                    }
+                }
+                e.$inject = ["$$mdSvgRegistry"], ue.module("material.components.tabs").directive("mdTabs", e)
+            }(),
+            function() {
+                function e(l, c) {
+                    return {
+                        require: "^?mdTabs",
+                        link: function(e, t, n, r) {
+                            if (r) {
+                                var i, o, a = function() {
+                                    r.updatePagination(), r.updateInkBarStyles()
+                                };
+                                if ("MutationObserver" in c) {
+                                    (i = new MutationObserver(a)).observe(t[0], {
+                                        childList: !0,
+                                        subtree: !0,
+                                        characterData: !0
+                                    }), o = i.disconnect.bind(i)
+                                } else {
+                                    var s = l.debounce(a, 15, null, !1);
+                                    t.on("DOMSubtreeModified", s), o = t.off.bind(t, "DOMSubtreeModified", s)
+                                }
+                                e.$on("$destroy", function() {
+                                    o()
+                                })
+                            }
+                        }
+                    }
+                }
+                e.$inject = ["$mdUtil", "$window"], ue.module("material.components.tabs").directive("mdTabsDummyWrapper", e)
+            }(),
+            function() {
+                function e(a, s) {
+                    return {
+                        restrict: "A",
+                        link: function(e, t, n, r) {
+                            if (!r) return;
+                            var i = r.enableDisconnect ? e.compileScope.$new() : e.compileScope;
+                            return t.html(e.template), a(t.contents())(i), s.nextTick(function() {
+                                e.$watch("connected", function(e) {
+                                    !1 === e ? r.enableDisconnect && s.disconnectScope(i) : o()
+                                }), e.$on("$destroy", o)
+                            });
+
+                            function o() {
+                                r.enableDisconnect && s.reconnectScope(i)
+                            }
+                        },
+                        scope: {
+                            template: "=mdTabsTemplate",
+                            connected: "=?mdConnectedIf",
+                            compileScope: "=mdScope"
+                        },
+                        require: "^?mdTabs"
+                    }
+                }
+                e.$inject = ["$compile", "$mdUtil"], ue.module("material.components.tabs").directive("mdTabsTemplate", e)
+            }(),
+            function() {
                 function e(n) {
                     return {
                         restrict: "E",
                 }
 
                 function t(e) {
-                    n.$inject = ["$mdToast", "$scope"], i.$inject = ["$animate", "$mdToast", "$mdUtil", "$mdMedia"];
-                    var u, r = "ok";
+                    n.$inject = ["$mdToast", "$scope", "$log"], r.$inject = ["$animate", "$mdToast", "$mdUtil", "$mdMedia", "$document"];
+                    var f, h = "ok";
 
                     function t(e) {
-                        u = e
+                        f = e
                     }
                     return e("$mdToast").setDefaults({
                         methods: ["position", "hideDelay", "capsule", "parent", "position", "toastClass"],
-                        options: i
+                        options: r
                     }).addPreset("simple", {
                         argOption: "textContent",
-                        methods: ["textContent", "content", "action", "highlightAction", "highlightClass", "theme", "parent"],
+                        methods: ["textContent", "content", "action", "actionKey", "actionHint", "highlightAction", "highlightClass", "theme", "parent", "dismissHint"],
                         options: ["$mdToast", "$mdTheming", function(e, t) {
                             return {
-                                template: '<md-toast md-theme="{{ toast.theme }}" ng-class="{\'md-capsule\': toast.capsule}">  <div class="md-toast-content">    <span class="md-toast-text" role="alert" aria-relevant="all" aria-atomic="true">      {{ toast.content }}    </span>    <md-button class="md-action" ng-if="toast.action" ng-click="toast.resolve()"         ng-class="highlightClasses">      {{ toast.action }}    </md-button>  </div></md-toast>',
+                                template: '<md-toast md-theme="{{ toast.theme }}" ng-class="{\'md-capsule\': toast.capsule}">  <div class="md-toast-content" aria-live="polite" aria-relevant="all">    <span class="md-toast-text">      {{ toast.content }}    </span>    <span class="md-visually-hidden">{{ toast.dismissHint }}</span>    <span class="md-visually-hidden" ng-if="toast.action && toast.actionKey">      {{ toast.actionHint }}    </span>    <md-button class="md-action" ng-if="toast.action" ng-click="toast.resolve()"                ng-class="highlightClasses">      {{ toast.action }}    </md-button>  </div></md-toast>',
                                 controller: n,
                                 theme: t.defaultTheme(),
                                 controllerAs: "toast",
                         }]
                     }).addMethod("updateTextContent", t).addMethod("updateContent", t);
 
-                    function n(t, n) {
+                    function n(t, n, r) {
                         this.$onInit = function() {
                             var e = this;
-                            e.highlightAction && (n.highlightClasses = ["md-highlight", e.highlightClass]), n.$watch(function() {
-                                return u
+                            e.highlightAction && (n.highlightClasses = ["md-highlight", e.highlightClass]), e.action && !e.actionKey && r.warn("Toasts with actions should define an actionKey for accessibility.", "Details: https://material.angularjs.org/latest/api/service/$mdToast#mdtoast-simple"), e.actionKey && !e.actionHint && (e.actionHint = 'Press Control-"' + e.actionKey + '" to '), e.dismissHint || (e.dismissHint = "Press Escape to dismiss."), n.$watch(function() {
+                                return f
                             }, function() {
-                                e.content = u
+                                e.content = f
                             }), this.resolve = function() {
-                                t.hide(r)
+                                t.hide(h)
                             }
                         }
                     }
 
-                    function i(r, s, l, n) {
-                        var c = "$md.swipeleft $md.swiperight $md.swipeup $md.swipedown";
+                    function r(r, s, l, c, u) {
+                        var d = "$md.swipeleft $md.swiperight $md.swipeup $md.swipedown";
                         return {
                             onShow: function(e, i, o) {
-                                u = o.textContent || o.content;
-                                var a = !n("gt-sm");
+                                f = o.textContent || o.content;
+                                var a = !c("gt-sm");
                                 i = l.extractElementByName(i, "md-toast", !0), o.element = i, o.onSwipe = function(e, t) {
                                     var n = e.type.replace("$md.", ""),
                                         r = n.replace("swipe", "");
-                                    "down" === r && -1 != o.position.indexOf("top") && !a || "up" === r && (-1 != o.position.indexOf("bottom") || a) || ("left" !== r && "right" !== r || !a) && (i.addClass("md-" + n), l.nextTick(s.cancel))
-                                }, o.openClass = (t = o.position, n("gt-xs") ? "md-toast-open-" + (-1 < t.indexOf("top") ? "top" : "bottom") : "md-toast-open-bottom"), i.addClass(o.toastClass), o.parent.addClass(o.openClass), l.hasComputedStyle(o.parent, "position", "static") && o.parent.css("position", "relative");
+                                    "down" === r && -1 !== o.position.indexOf("top") && !a || "up" === r && (-1 !== o.position.indexOf("bottom") || a) || ("left" !== r && "right" !== r || !a) && (i.addClass("md-" + n), l.nextTick(s.cancel))
+                                }, o.openClass = (t = o.position, c("gt-xs") ? "md-toast-open-" + (-1 < t.indexOf("top") ? "top" : "bottom") : "md-toast-open-bottom"), i.addClass(o.toastClass), o.parent.addClass(o.openClass), l.hasComputedStyle(o.parent, "position", "static") && o.parent.css("position", "relative");
                                 var t;
-                                i.on(c, o.onSwipe), i.addClass(a ? "md-bottom" : o.position.split(" ").map(function(e) {
+                                n = e.toast && e.toast.actionKey ? e.toast.actionKey : de, u.on("keydown", function(e) {
+                                    "Escape" === e.key && s.hide(!1), n && e.key === n && e.ctrlKey && s.hide(h)
+                                }), i.on(d, o.onSwipe), i.addClass(a ? "md-bottom" : o.position.split(" ").map(function(e) {
                                     return "md-" + e
                                 }).join(" ")), o.parent && o.parent.addClass("md-toast-animating");
+                                var n;
                                 return r.enter(i, o.parent).then(function() {
                                     o.parent && o.parent.removeClass("md-toast-animating")
                                 })
                             },
                             onRemove: function(e, t, n) {
-                                t.off(c, n.onSwipe), n.parent && n.parent.addClass("md-toast-animating");
+                                e.toast && e.toast.actionKey && u.off("keydown");
+                                t.off(d, n.onSwipe), n.parent && n.parent.addClass("md-toast-animating");
                                 n.openClass && n.parent.removeClass(n.openClass);
-                                return (1 == n.$destroy ? t.remove() : r.leave(t)).then(function() {
+                                return (!0 === n.$destroy ? t.remove() : r.leave(t)).then(function() {
                                     n.parent && n.parent.removeClass("md-toast-animating"), l.hasComputedStyle(n.parent, "position", "static") && n.parent.css("position", "")
                                 })
                             },
                                     n.innerHTML = e;
                                     for (var r = 0; r < n.children.length; r++)
                                         if ("MD-TOAST" === n.children[r].nodeName) {
-                                            var i = se.element('<div class="md-toast-content">');
-                                            i.append(se.element(n.children[r].childNodes)), n.children[r].appendChild(i[0])
+                                            var i = ue.element('<div class="md-toast-content">');
+                                            i.append(ue.element(n.children[r].childNodes)), n.children[r].appendChild(i[0])
                                         } return n.innerHTML
                                 }
                                 return e || ""
                         }
                     }
                 }
-                e.$inject = ["$mdToast"], t.$inject = ["$$interimElementProvider"], se.module("material.components.toast", ["material.core", "material.components.button"]).directive("mdToast", e).provider("$mdToast", t)
+                e.$inject = ["$mdToast"], t.$inject = ["$$interimElementProvider"], ue.module("material.components.toast", ["material.core", "material.components.button"]).directive("mdToast", e).provider("$mdToast", t)
             }(),
             function() {
                 function e(m, g, v, e, b) {
-                    var y = se.bind(null, v.supplant, "translate3d(0,{0}px,0)");
+                    var y = ue.bind(null, v.supplant, "translate3d(0,{0}px,0)");
                     return {
                         template: "",
                         restrict: "E",
                         link: function(f, h, p) {
                             h.addClass("_md"), e(h), v.nextTick(function() {
                                 h.addClass("_md-toolbar-transitions")
-                            }, !1), se.isDefined(p.mdScrollShrink) && function() {
-                                var n, r, i = se.noop,
+                            }, !1), ue.isDefined(p.mdScrollShrink) && function() {
+                                var n, r, i = ue.noop,
                                     o = 0,
                                     a = 0,
                                     s = p.mdShrinkSpeedFactor || .5,
                                 function d() {
                                     return r ? (r.on("scroll", l), r.attr("scroll-shrink", "true"), v.nextTick(e, !1), function() {
                                         r.off("scroll", l), r.attr("scroll-shrink", "false"), e()
-                                    }) : se.noop
+                                    }) : ue.noop
                                 }
 
                                 function e() {
                         }
                     }
                 }
-                e.$inject = ["$$rAF", "$mdConstant", "$mdUtil", "$mdTheming", "$animate"], se.module("material.components.toolbar", ["material.core", "material.components.content"]).directive("mdToolbar", e)
+                e.$inject = ["$$rAF", "$mdConstant", "$mdUtil", "$mdTheming", "$animate"], ue.module("material.components.toolbar", ["material.core", "material.components.content"]).directive("mdToolbar", e)
             }(),
             function() {
                 function e(b, y, _, $, w, E, C, k) {
                                 e ? function() {
                                     if (!r[0].textContent.trim()) throw new Error("Text for the tooltip has not been provided. Please include text within the mdTooltip element.");
                                     if (!a) {
-                                        var e = se.element(document.body),
+                                        var e = ue.element(document.body),
                                             t = C.newPanelAnimation().openFrom(d).closeTo(d).withAnimation({
                                                 open: "md-show",
                                                 close: "md-hide"
                         }
                     }
                 }
-                e.$inject = ["$timeout", "$window", "$$rAF", "$document", "$interpolate", "$mdUtil", "$mdPanel", "$$mdTooltipRegistry"], se.module("material.components.tooltip", ["material.core", "material.components.panel"]).directive("mdTooltip", e).service("$$mdTooltipRegistry", function() {
+                e.$inject = ["$timeout", "$window", "$$rAF", "$document", "$interpolate", "$mdUtil", "$mdPanel", "$$mdTooltipRegistry"], ue.module("material.components.tooltip", ["material.core", "material.components.panel"]).directive("mdTooltip", e).service("$$mdTooltipRegistry", function() {
                     var o = {},
-                        a = se.element(F);
+                        a = ue.element(F);
                     return {
                         register: function(e, t, n) {
                             var r = o[e] = o[e] || [];
                 function e(e) {
                     e.addClass("md-truncate")
                 }
-                e.$inject = ["$element"], se.module("material.components.truncate", ["material.core"]).directive("mdTruncate", function() {
+                e.$inject = ["$element"], ue.module("material.components.truncate", ["material.core"]).directive("mdTruncate", function() {
                     return {
                         restrict: "AE",
                         controller: e
                 function e(e) {
                     return '<div class="md-virtual-repeat-scroller" role="presentation"><div class="md-virtual-repeat-sizer" role="presentation"></div><div class="md-virtual-repeat-offsetter" role="presentation">' + e[0].innerHTML + "</div></div>"
                 }
-                t.$inject = ["$$rAF", "$mdUtil", "$mdConstant", "$parse", "$rootScope", "$window", "$scope", "$element", "$attrs"], i.$inject = ["$scope", "$element", "$attrs", "$browser", "$document", "$rootScope", "$$rAF", "$mdUtil"], n.$inject = ["$parse"], se.module("material.components.virtualRepeat", ["material.core", "material.components.showHide"]).directive("mdVirtualRepeatContainer", function() {
+                t.$inject = ["$$rAF", "$mdUtil", "$mdConstant", "$parse", "$rootScope", "$window", "$scope", "$element", "$attrs"], i.$inject = ["$scope", "$element", "$attrs", "$browser", "$document", "$rootScope", "$$rAF", "$mdUtil"], n.$inject = ["$parse"], ue.module("material.components.virtualRepeat", ["material.core", "material.components.showHide"]).directive("mdVirtualRepeatContainer", function() {
                     return {
                         controller: t,
                         template: e,
                 }).directive("mdVirtualRepeat", n).directive("mdForceHeight", o);
 
                 function t(e, n, t, r, i, o, a, s, l) {
-                    this.$rootScope = i, this.$scope = a, this.$element = s, this.$attrs = l, this.size = 0, this.scrollSize = 0, this.scrollOffset = 0, this.horizontal = this.$attrs.hasOwnProperty("mdOrientHorizontal"), this.repeater = null, this.autoShrink = this.$attrs.hasOwnProperty("mdAutoShrink"), this.autoShrinkMin = parseInt(this.$attrs.mdAutoShrinkMin, 10) || 0, this.originalSize = null, this.offsetSize = parseInt(this.$attrs.mdOffsetSize, 10) || 0, this.oldElementSize = null, this.maxElementPixels = t.ELEMENT_MAX_PIXELS, this.$attrs.mdTopIndex ? (this.bindTopIndex = r(this.$attrs.mdTopIndex), this.topIndex = this.bindTopIndex(this.$scope), se.isDefined(this.topIndex) || (this.topIndex = 0, this.bindTopIndex.assign(this.$scope, 0)), this.$scope.$watch(this.bindTopIndex, se.bind(this, function(e) {
+                    this.$rootScope = i, this.$scope = a, this.$element = s, this.$attrs = l, this.size = 0, this.scrollSize = 0, this.scrollOffset = 0, this.horizontal = this.$attrs.hasOwnProperty("mdOrientHorizontal"), this.repeater = null, this.autoShrink = this.$attrs.hasOwnProperty("mdAutoShrink"), this.autoShrinkMin = parseInt(this.$attrs.mdAutoShrinkMin, 10) || 0, this.originalSize = null, this.offsetSize = parseInt(this.$attrs.mdOffsetSize, 10) || 0, this.oldElementSize = null, this.maxElementPixels = t.ELEMENT_MAX_PIXELS, this.$attrs.mdTopIndex ? (this.bindTopIndex = r(this.$attrs.mdTopIndex), this.topIndex = this.bindTopIndex(this.$scope), ue.isDefined(this.topIndex) || (this.topIndex = 0, this.bindTopIndex.assign(this.$scope, 0)), this.$scope.$watch(this.bindTopIndex, ue.bind(this, function(e) {
                         e !== this.topIndex && this.scrollToIndex(e)
                     }))) : this.topIndex = 0, this.scroller = s[0].querySelector(".md-virtual-repeat-scroller"), this.sizer = this.scroller.querySelector(".md-virtual-repeat-sizer"), this.offsetter = this.scroller.querySelector(".md-virtual-repeat-offsetter");
-                    var c = se.bind(this, this.updateSize);
-                    e(se.bind(this, function() {
+                    var c = ue.bind(this, this.updateSize);
+                    e(ue.bind(this, function() {
                         c();
                         var e = n.debounce(c, 10, null, !1),
-                            t = se.element(o);
+                            t = ue.element(o);
                         this.size || e(), t.on("resize", e), a.$on("$destroy", function() {
                             t.off("resize", e)
                         }), a.$emit("$md-resize-enable"), a.$on("$md-resize", c)
                 }
 
                 function i(e, t, n, r, i, o, a, s) {
-                    this.$scope = e, this.$element = t, this.$attrs = n, this.$browser = r, this.$document = i, this.$mdUtil = s, this.$rootScope = o, this.$$rAF = a, this.onDemand = s.parseAttributeBoolean(n.mdOnDemand), this.browserCheckUrlChange = r.$$checkUrlChange, this.newStartIndex = 0, this.newEndIndex = 0, this.newVisibleEnd = 0, this.startIndex = 0, this.endIndex = 0, this.itemSize = e.$eval(n.mdItemSize) || null, this.isFirstRender = !0, this.isVirtualRepeatUpdating_ = !1, this.itemsLength = 0, this.unwatchItemSize_ = se.noop, this.blocks = {}, this.pooledBlocks = [], e.$on("$destroy", se.bind(this, this.cleanupBlocks_))
+                    this.$scope = e, this.$element = t, this.$attrs = n, this.$browser = r, this.$document = i, this.$mdUtil = s, this.$rootScope = o, this.$$rAF = a, this.onDemand = s.parseAttributeBoolean(n.mdOnDemand), this.browserCheckUrlChange = r.$$checkUrlChange, this.newStartIndex = 0, this.newEndIndex = 0, this.newVisibleEnd = 0, this.startIndex = 0, this.endIndex = 0, this.itemSize = e.$eval(n.mdItemSize) || null, this.isFirstRender = !0, this.isVirtualRepeatUpdating_ = !1, this.itemsLength = 0, this.unwatchItemSize_ = ue.noop, this.blocks = {}, this.pooledBlocks = [], e.$on("$destroy", ue.bind(this, this.cleanupBlocks_))
                 }
 
                 function r(e) {
-                    if (!se.isFunction(e.getItemAtIndex) || !se.isFunction(e.getLength)) throw Error("When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement functions getItemAtIndex() and getLength() ");
+                    if (!ue.isFunction(e.getItemAtIndex) || !ue.isFunction(e.getLength)) throw Error("When md-on-demand is enabled, the Object passed to md-virtual-repeat must implement functions getItemAtIndex() and getLength().");
                     this.model = e
                 }
 
                     }
                 }
                 t.prototype.register = function(e) {
-                    this.repeater = e, se.element(this.scroller).on("scroll wheel touchmove touchend", se.bind(this, this.handleScroll_))
+                    this.repeater = e, ue.element(this.scroller).on("scroll wheel touchmove touchend", ue.bind(this, this.handleScroll_))
                 }, t.prototype.isHorizontal = function() {
                     return this.horizontal
                 }, t.prototype.getSize = function() {
                 }, t.prototype.unsetSize_ = function() {
                     this.$element[0].style[this.getDimensionName_()] = this.oldElementSize, this.oldElementSize = null
                 }, t.prototype.updateSize = function() {
-                    this.originalSize || (this.size = this.isHorizontal() ? this.$element[0].clientWidth : this.$element[0].clientHeight, this.handleScroll_(), this.repeater && this.repeater.containerUpdated())
+                    if (!this.originalSize) {
+                        var e = this.isHorizontal() ? this.$element[0].clientWidth : this.$element[0].clientHeight;
+                        e && (this.size = e), this.handleScroll_(), this.repeater && this.repeater.containerUpdated()
+                    }
                 }, t.prototype.getScrollSize = function() {
                     return this.scrollSize
                 }, t.prototype.getDimensionName_ = function() {
                 }, t.prototype.resetScroll = function() {
                     this.scrollTo(0)
                 }, t.prototype.handleScroll_ = function() {
-                    var e = "rtl" != document.dir && "rtl" != document.body.dir;
+                    var e = "rtl" !== document.dir && "rtl" !== document.body.dir;
                     e || this.maxSize || (this.scroller.scrollLeft = this.scrollSize, this.maxSize = this.scroller.scrollLeft);
                     var t = this.isHorizontal() ? e ? this.scroller.scrollLeft : this.maxSize - this.scroller.scrollLeft : this.scroller.scrollTop;
-                    if (!(t === this.scrollOffset || t > this.scrollSize - this.size)) {
+                    if (!(this.scrollSize < this.size) && (t > this.scrollSize - this.size && (t = this.scrollSize - this.size), t !== this.scrollOffset)) {
                         var n = this.repeater.getItemSize();
                         if (n) {
                             var r = Math.max(0, Math.floor(t / n) - 3),
                         }
                     }
                 }, i.prototype.link_ = function(e, t, n, r, i) {
-                    this.container = e, this.transclude = t, this.repeatName = n, this.rawRepeatListExpression = r, this.extraName = i, this.sized = !1, this.repeatListExpression = se.bind(this, this.repeatListExpression_), this.container.register(this)
+                    this.container = e, this.transclude = t, this.repeatName = n, this.rawRepeatListExpression = r, this.extraName = i, this.sized = !1, this.repeatListExpression = ue.bind(this, this.repeatListExpression_), this.container.register(this)
                 }, i.prototype.cleanupBlocks_ = function() {
-                    se.forEach(this.pooledBlocks, function(e) {
+                    ue.forEach(this.pooledBlocks, function(e) {
                         e.element.remove()
                     })
                 }, i.prototype.readItemSize_ = function() {
                     }
                     return t
                 }, i.prototype.containerUpdated = function() {
-                    if (!this.itemSize) return this.unwatchItemSize_ && this.unwatchItemSize_ !== se.noop && this.unwatchItemSize_(), this.unwatchItemSize_ = this.$scope.$watchCollection(this.repeatListExpression, se.bind(this, function(e) {
+                    if (!this.itemSize) return this.unwatchItemSize_ && this.unwatchItemSize_ !== ue.noop && this.unwatchItemSize_(), this.unwatchItemSize_ = this.$scope.$watchCollection(this.repeatListExpression, ue.bind(this, function(e) {
                         e && e.length && this.readItemSize_()
                     })), void(this.$rootScope.$$phase || this.$scope.$digest());
-                    this.sized || (this.items = this.repeatListExpression(this.$scope)), this.sized || (this.unwatchItemSize_(), this.sized = !0, this.$scope.$watchCollection(this.repeatListExpression, se.bind(this, function(e, t) {
+                    this.sized || (this.items = this.repeatListExpression(this.$scope)), this.sized || (this.unwatchItemSize_(), this.sized = !0, this.$scope.$watchCollection(this.repeatListExpression, ue.bind(this, function(e, t) {
                         this.isVirtualRepeatUpdating_ || this.virtualRepeatUpdate_(e, t)
                     }))), this.updateIndexes_(), (this.newStartIndex !== this.startIndex || this.newEndIndex !== this.endIndex || this.container.getScrollOffset() > this.container.getScrollSize()) && (this.items instanceof r && this.items.$$includeIndexes(this.newStartIndex, this.newEndIndex), this.virtualRepeatUpdate_(this.items, this.items))
                 }, i.prototype.getItemSize = function() {
                     n !== this.itemsLength && (r = !0, this.itemsLength = n), ((this.items = e) !== t || r) && this.updateIndexes_(), this.parentNode = this.$element[0].parentNode, r && this.container.setScrollSize(n * this.itemSize), Object.keys(this.blocks).forEach(function(e) {
                         var t = parseInt(e, 10);
                         (t < this.newStartIndex || t >= this.newEndIndex) && this.poolBlock_(t)
-                    }, this), this.$browser.$$checkUrlChange = se.noop;
+                    }, this), this.$browser.$$checkUrlChange = ue.noop;
                     var o, a, s = [],
                         l = [];
                     for (o = this.newStartIndex; o < this.newEndIndex && null == this.blocks[o]; o++) a = this.getBlock_(o), this.updateBlock_(a, o), s.push(a);
                     }
                     this.isVirtualRepeatUpdating_ = !1
                 }, i.prototype.getBlock_ = function(n) {
-                    return this.pooledBlocks.length ? this.pooledBlocks.pop() : (this.transclude(se.bind(this, function(e, t) {
+                    return this.pooledBlocks.length ? this.pooledBlocks.pop() : (this.transclude(ue.bind(this, function(e, t) {
                         r = {
                             element: e,
                             new: !0,
                         }
                     }
                 }
-                e.$inject = ["$log"], se.module("material.components.whiteframe", ["material.core"]).directive("mdWhiteframe", e)
-            }(),
-            function() {
-                e.$inject = ["$scope", "$element", "$mdUtil", "$mdConstant", "$mdTheming", "$window", "$animate", "$rootElement", "$attrs", "$q", "$log", "$mdLiveAnnouncer"], se.module("material.components.autocomplete").controller("MdAutocompleteCtrl", e);
-                var re = 48,
-                    ie = 5,
-                    oe = 8,
-                    ae = 2;
-
-                function e(f, h, p, t, n, e, r, i, m, s, o, a) {
-                    var l, c, u, d = this,
-                        g = f.itemsExpr.split(/ in /i),
-                        v = g[1],
-                        b = null,
-                        y = {},
-                        _ = !1,
-                        $ = [],
-                        w = !1,
-                        E = 0,
-                        C = null,
-                        k = null,
-                        x = p.debounce(function() {
-                            d.hidden || S()
-                        });
-                    l = "hidden", c = function(e, t) {
-                        !e && t ? (S(), Z(!0, M.Count | M.Selected), b && (p.disableScrollAround(b.ul), C = function(e) {
-                            function t(e) {
-                                e.preventDefault()
-                            }
-                            return e.on("wheel", t), e.on("touchmove", t),
-                                function() {
-                                    e.off("wheel", t), e.off("touchmove", t)
-                                }
-                        }(se.element(b.wrap)))) : e && !t && (p.enableScrolling(), C && (C(), C = null))
-                    }, u = !0, Object.defineProperty(d, l, {
-                        get: function() {
-                            return u
-                        },
-                        set: function(e) {
-                            var t = u;
-                            c(u = e, t)
-                        }
-                    }), d.scope = f, d.parent = f.$parent, d.itemName = g[0], d.matches = [], d.loading = !1, d.hidden = !0, d.index = null, d.id = p.nextUid(), d.isDisabled = null, d.isRequired = null, d.isReadonly = null, d.hasNotFound = !1, d.keydown = function(e) {
-                        switch (e.keyCode) {
-                            case t.KEY_CODE.DOWN_ARROW:
-                                if (d.loading) return;
-                                e.stopPropagation(), e.preventDefault(), d.index = Math.min(d.index + 1, d.matches.length - 1), X(), Z(!1, M.Selected);
-                                break;
-                            case t.KEY_CODE.UP_ARROW:
-                                if (d.loading) return;
-                                e.stopPropagation(), e.preventDefault(), d.index = d.index < 0 ? d.matches.length - 1 : Math.max(0, d.index - 1), X(), Z(!1, M.Selected);
-                                break;
-                            case t.KEY_CODE.TAB:
-                                if (N(), d.hidden || d.loading || d.index < 0 || d.matches.length < 1) return;
-                                Y(d.index);
-                                break;
-                            case t.KEY_CODE.ENTER:
-                                if (d.hidden || d.loading || d.index < 0 || d.matches.length < 1) return;
-                                if (z()) return;
-                                e.stopPropagation(), e.preventDefault(), Y(d.index);
-                                break;
-                            case t.KEY_CODE.ESCAPE:
-                                if (e.preventDefault(), !(U("blur") || !d.hidden || d.loading || U("clear") && f.searchText)) return;
-                                e.stopPropagation(), G(), f.searchText && U("clear") && K(), d.hidden = !0, U("blur") && function(e) {
-                                    e && (w = _ = !1);
-                                    b.input.blur()
-                                }(!0)
-                        }
-                    }, d.blur = function(e) {
-                        w = !1, _ || (d.hidden = F(), ne("ngBlur", {
-                            $event: e
-                        }))
-                    }, d.focus = function(e) {
-                        w = !0, q() && W() && ee();
-                        d.hidden = F(), ne("ngFocus", {
-                            $event: e
-                        })
-                    }, d.clear = function() {
-                        G(), K()
-                    }, d.select = Y, d.listEnter = function() {
-                        _ = !0
-                    }, d.listLeave = N, d.mouseUp = function() {
-                        b.input.focus()
-                    }, d.getCurrentDisplayValue = B, d.registerSelectedItemWatcher = function(e) {
-                        -1 == $.indexOf(e) && $.push(e)
-                    }, d.unregisterSelectedItemWatcher = function(e) {
-                        var t = $.indexOf(e); - 1 != t && $.splice(t, 1)
-                    }, d.notFoundVisible = J, d.loadingIsVisible = function() {
-                        return d.loading && !z()
-                    }, d.positionDropdown = S;
-                    var T, M = {
-                        Count: 1,
-                        Selected: 2
-                    };
-                    return p.initOptionalProperties(f, m, {
-                        searchText: "",
-                        selectedItem: null,
-                        clearButton: !1
-                    }), n(h), T = parseInt(f.delay, 10) || 0, m.$observe("disabled", function(e) {
-                        d.isDisabled = p.parseAttributeBoolean(e, !1)
-                    }), m.$observe("required", function(e) {
-                        d.isRequired = p.parseAttributeBoolean(e, !1)
-                    }), m.$observe("readonly", function(e) {
-                        d.isReadonly = p.parseAttributeBoolean(e, !1)
-                    }), f.$watch("searchText", T ? p.debounce(R, T) : R), f.$watch("selectedItem", I), se.element(e).on("resize", x), f.$on("$destroy", D), void p.nextTick(function() {
-                        var e;
-                        e = function() {
-                            var e, t;
-                            for (e = h; e.length && (t = e.attr("md-autocomplete-snap"), !se.isDefined(t)); e = e.parent());
-                            if (e.length) return {
-                                snap: e[0],
-                                wrap: "width" === t.toLowerCase() ? e[0] : h.find("md-autocomplete-wrap")[0]
-                            };
-                            var n = h.find("md-autocomplete-wrap")[0];
-                            return {
-                                snap: n,
-                                wrap: n
-                            }
-                        }(), (b = {
-                            main: h[0],
-                            scrollContainer: h[0].querySelector(".md-virtual-repeat-container"),
-                            scroller: h[0].querySelector(".md-virtual-repeat-scroller"),
-                            ul: h.find("ul")[0],
-                            input: h.find("input")[0],
-                            wrap: e.wrap,
-                            snap: e.snap,
-                            root: document.body
-                        }).li = b.ul.getElementsByTagName("li"), b.$ = function(e) {
-                            var t = {};
-                            for (var n in e) e.hasOwnProperty(n) && (t[n] = se.element(e[n]));
-                            return t
-                        }(b), k = b.$.input.controller("ngModel"), b.$.root.length && (n(b.$.scrollContainer), b.$.scrollContainer.detach(), b.$.root.append(b.$.scrollContainer), r.pin && r.pin(b.$.scrollContainer, i)), f.autofocus && h.on("focus", O)
-                    });
-
-                    function A() {
-                        f.requireMatch && k && k.$setValidity("md-require-match", !!f.selectedItem || !f.searchText)
-                    }
-
-                    function S() {
-                        if (!b) return p.nextTick(S, !1, f);
-                        var e, t = (f.dropdownItems || ie) * re,
-                            n = b.wrap.getBoundingClientRect(),
-                            r = b.snap.getBoundingClientRect(),
-                            i = b.root.getBoundingClientRect(),
-                            o = r.bottom - i.top,
-                            a = i.bottom - r.top,
-                            s = n.left - i.left,
-                            l = n.width,
-                            c = function() {
-                                var e = 0,
-                                    t = h.find("md-input-container");
-                                if (t.length) {
-                                    var n = t.find("input");
-                                    e = t.prop("offsetHeight"), e -= n.prop("offsetTop"), e -= n.prop("offsetHeight"), e += t.prop("offsetTop")
-                                }
-                                return e
-                            }(),
-                            u = f.dropdownPosition;
-                        if (u || (u = a < o && i.height - o - oe < t ? "top" : "bottom"), m.mdFloatingLabel && (s += ae, l -= 2 * ae), e = {
-                                left: s + "px",
-                                minWidth: l + "px",
-                                maxWidth: Math.max(n.right - i.left, i.right - n.left) - oe + "px"
-                            }, "top" === u) e.top = "auto", e.bottom = a + "px", e.maxHeight = Math.min(t, n.top - i.top - oe) + "px";
-                        else {
-                            var d = i.bottom - n.bottom - oe + p.getViewportTop();
-                            e.top = o - c + "px", e.bottom = "auto", e.maxHeight = Math.min(t, d) + "px"
-                        }
-                        b.$.scrollContainer.css(e), p.nextTick(function() {
-                            var e = b.scrollContainer.getBoundingClientRect(),
-                                t = {};
-                            e.right > i.right - oe && (t.left = n.right - e.width + "px");
-                            b.$.scrollContainer.css(t)
-                        }, !1)
-                    }
-
-                    function O() {
-                        b.input.focus()
-                    }
-
-                    function D() {
-                        if (d.hidden || p.enableScrolling(), se.element(e).off("resize", x), b) {
-                            se.forEach(["ul", "scroller", "scrollContainer", "input"], function(e) {
-                                b.$[e].remove()
-                            })
-                        }
-                    }
-
-                    function N() {
-                        w || d.hidden || b.input.focus(), _ = !1, d.hidden = F()
-                    }
-
-                    function I(r, i) {
-                        A(), r ? H(r).then(function(e) {
-                            var t, n;
-                            f.searchText = e, t = r, n = i, $.forEach(function(e) {
-                                e(t, n)
-                            })
-                        }) : i && f.searchText && H(i).then(function(e) {
-                            se.isString(f.searchText) && e.toString().toLowerCase() === f.searchText.toLowerCase() && (f.searchText = "")
-                        }), r !== i && se.isFunction(f.itemChange) && f.itemChange(j(f.selectedItem))
-                    }
-
-                    function R(t, n) {
-                        d.index = f.autoselect ? 0 : -1, t !== n && (A(), H(f.selectedItem).then(function(e) {
-                            t !== e && (f.selectedItem = null, t !== n && se.isFunction(f.textChange) && f.textChange(), W() ? ee() : (L(!(d.matches = [])), Z(!1, M.Count)))
-                        }))
-                    }
-
-                    function P() {
-                        return se.isNumber(f.minLength) ? f.minLength : 1
-                    }
-
-                    function H(e) {
-                        return s.when((t = e, (t && f.itemText ? f.itemText(j(t)) : null) || e)).then(function(e) {
-                            return e && !se.isString(e) && o.warn("md-autocomplete: Could not resolve display value to a string. Please check the `md-item-text` attribute."), e
-                        });
-                        var t
-                    }
-
-                    function j(e) {
-                        if (!e) return le;
-                        var t = {};
-                        return d.itemName && (t[d.itemName] = e), t
-                    }
-
-                    function L(e) {
-                        d.loading != e && (d.loading = e), d.hidden = F()
-                    }
-
-                    function F() {
-                        return ! function() {
-                            {
-                                if (d.isReadonly) return !1;
-                                if (!q()) return !1
-                            }
-                            return W() && V() || J()
-                        }()
-                    }
-
-                    function q() {
-                        return !(d.loading && !V()) && (!z() && !!w)
-                    }
-
-                    function U(e) {
-                        return !f.escapeOptions || -1 !== f.escapeOptions.toLowerCase().indexOf(e)
-                    }
-
-                    function V() {
-                        return !!d.matches.length
-                    }
-
-                    function z() {
-                        return !!d.scope.selectedItem
-                    }
-
-                    function B() {
-                        return H(d.matches[d.index])
-                    }
-
-                    function W() {
-                        return (f.searchText || "").length >= P()
-                    }
-
-                    function Y(e) {
-                        p.nextTick(function() {
-                            H(d.matches[e]).then(function(e) {
-                                var t = b.$.input.controller("ngModel");
-                                t.$setViewValue(e), t.$render()
-                            }).finally(function() {
-                                f.selectedItem = d.matches[e], L(!1)
-                            })
-                        }, !1)
-                    }
-
-                    function G() {
-                        d.index = 0, d.matches = []
-                    }
-
-                    function K() {
-                        L(!0), f.searchText = "";
-                        var e = document.createEvent("CustomEvent");
-                        e.initCustomEvent("change", !0, !0, {
-                            value: ""
-                        }), b.input.dispatchEvent(e), b.input.blur(), f.searchText = "", b.input.focus()
-                    }
-
-                    function Z(e, t) {
-                        var n = e ? "polite" : "assertive",
-                            r = [];
-                        t & M.Selected && -1 !== d.index && r.push(B()), t & M.Count && r.push(s.resolve(function() {
-                            switch (d.matches.length) {
-                                case 0:
-                                    return "There are no matches available.";
-                                case 1:
-                                    return "There is 1 match available.";
-                                default:
-                                    return "There are " + d.matches.length + " matches available."
-                            }
-                        }())), s.all(r).then(function(e) {
-                            a.announce(e.join(" "), n)
-                        })
-                    }
-
-                    function X() {
-                        if (b.li[0]) {
-                            var e = b.li[0].offsetHeight,
-                                t = e * d.index,
-                                n = t + e,
-                                r = b.scroller.clientHeight,
-                                i = b.scroller.scrollTop;
-                            t < i ? Q(t) : i + r < n && Q(n - r)
-                        }
-                    }
-
-                    function Q(e) {
-                        b.$.scrollContainer.controller("mdVirtualRepeatContainer").scrollTo(e)
-                    }
-
-                    function J() {
-                        var e = (d.scope.searchText || "").length;
-                        return d.hasNotFound && !V() && (!d.loading || 0 !== E) && e >= P() && (w || _) && !z()
-                    }
-
-                    function ee() {
-                        var e = f.searchText || "",
-                            t = e.toLowerCase();
-                        !f.noCache && y[t] ? te(y[t]) : function(t) {
-                            var e = f.$parent.$eval(v),
-                                n = t.toLowerCase(),
-                                r = se.isArray(e),
-                                i = !!e.then;
-
-                            function o(e) {
-                                y[n] = e, (t || "") === (f.searchText || "") && te(e)
-                            }
-                            r ? o(e) : i && (a = e, a && (a = s.when(a), E++, L(!0), p.nextTick(function() {
-                                a.then(o).finally(function() {
-                                    0 == --E && L(!1)
-                                })
-                            }, !0, f)));
-                            var a
-                        }(e), d.hidden = F()
-                    }
-
-                    function te(e) {
-                        var n, t, r;
-                        d.matches = e, d.hidden = F(), d.loading && L(!1), f.selectOnMatch && (n = f.searchText, t = d.matches, r = t[0], 1 === t.length && H(r).then(function(e) {
-                            var t = n == e;
-                            f.matchInsensitive && !t && (t = n.toLowerCase() == e.toLowerCase()), t && Y(0)
-                        })), S(), Z(!0, M.Count)
-                    }
-
-                    function ne(e, t) {
-                        m[e] && f.$parent.$eval(m[e], t || {})
-                    }
-                }
-            }(),
-            function() {
-                function e(c) {
-                    return {
-                        controller: "MdAutocompleteCtrl",
-                        controllerAs: "$mdAutocompleteCtrl",
-                        scope: {
-                            inputName: "@mdInputName",
-                            inputMinlength: "@mdInputMinlength",
-                            inputMaxlength: "@mdInputMaxlength",
-                            searchText: "=?mdSearchText",
-                            selectedItem: "=?mdSelectedItem",
-                            itemsExpr: "@mdItems",
-                            itemText: "&mdItemText",
-                            placeholder: "@placeholder",
-                            noCache: "=?mdNoCache",
-                            requireMatch: "=?mdRequireMatch",
-                            selectOnMatch: "=?mdSelectOnMatch",
-                            matchInsensitive: "=?mdMatchCaseInsensitive",
-                            itemChange: "&?mdSelectedItemChange",
-                            textChange: "&?mdSearchTextChange",
-                            minLength: "=?mdMinLength",
-                            delay: "=?mdDelay",
-                            autofocus: "=?mdAutofocus",
-                            floatingLabel: "@?mdFloatingLabel",
-                            autoselect: "=?mdAutoselect",
-                            menuClass: "@?mdMenuClass",
-                            menuContainerClass: "@?mdMenuContainerClass",
-                            inputClass: "@?mdInputClass",
-                            inputId: "@?mdInputId",
-                            escapeOptions: "@?mdEscapeOptions",
-                            dropdownItems: "=?mdDropdownItems",
-                            dropdownPosition: "@?mdDropdownPosition",
-                            clearButton: "=?mdClearButton"
-                        },
-                        compile: function(e, n) {
-                            var r = e.find("input");
-                            return ["md-select-on-focus", "md-no-asterisk", "ng-trim", "ng-pattern"].forEach(function(e) {
-                                    var t = n[n.$normalize(e)];
-                                    null !== t && r.attr(e, t)
-                                }),
-                                function(e, t, n, r) {
-                                    r.hasNotFound = !!t.attr("md-has-not-found"), se.isDefined(n.mdClearButton) || e.floatingLabel || (e.clearButton = !0)
-                                }
-                        },
-                        template: function(n, e) {
-                            var t, r, i = (t = n.find("md-not-found").detach(), (r = t.length ? t.html() : "") ? '<li ng-if="$mdAutocompleteCtrl.notFoundVisible()"                         md-autocomplete-parent-scope>' + r + "</li>" : ""),
-                                o = function() {
-                                    var e = n.find("md-item-template").detach(),
-                                        t = e.length ? e.html() : n.html();
-                                    e.length || n.empty();
-                                    return "<md-autocomplete-parent-scope md-autocomplete-replace>" + t + "</md-autocomplete-parent-scope>"
-                                }(),
-                                a = n.html(),
-                                s = e.tabindex,
-                                l = e.mdMenuContainerClass ? " " + e.mdMenuContainerClass : "";
-                            return i && n.attr("md-has-not-found", !0), n.attr("tabindex", "-1"), "        <md-autocomplete-wrap            ng-class=\"{ 'md-whiteframe-z1': !floatingLabel,                         'md-menu-showing': !$mdAutocompleteCtrl.hidden,                         'md-show-clear-button': !!clearButton }\">          " + (e.mdFloatingLabel ? '            <md-input-container ng-if="floatingLabel">              <label>{{floatingLabel}}</label>              <input type="search"                  ' + (null != s ? 'tabindex="' + s + '"' : "") + '                  id="{{ inputId || \'fl-input-\' + $mdAutocompleteCtrl.id }}"                  name="{{inputName}}"                  ng-class="::inputClass"                  autocomplete="off"                  ng-required="$mdAutocompleteCtrl.isRequired"                  ng-readonly="$mdAutocompleteCtrl.isReadonly"                  ng-minlength="inputMinlength"                  ng-maxlength="inputMaxlength"                  ng-disabled="$mdAutocompleteCtrl.isDisabled"                  ng-model="$mdAutocompleteCtrl.scope.searchText"                  ng-model-options="{ allowInvalid: true }"                  ng-keydown="$mdAutocompleteCtrl.keydown($event)"                  ng-blur="$mdAutocompleteCtrl.blur($event)"                  ng-focus="$mdAutocompleteCtrl.focus($event)"                  aria-owns="ul-{{$mdAutocompleteCtrl.id}}"                  aria-label="{{floatingLabel}}"                  aria-autocomplete="list"                  role="combobox"                  aria-haspopup="true"                  aria-activedescendant=""                  aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>              <div md-autocomplete-parent-scope md-autocomplete-replace>' + a + "</div>            </md-input-container>" : '            <input type="search"                ' + (null != s ? 'tabindex="' + s + '"' : "") + '                id="{{ inputId || \'input-\' + $mdAutocompleteCtrl.id }}"                name="{{inputName}}"                ng-class="::inputClass"                ng-if="!floatingLabel"                autocomplete="off"                ng-required="$mdAutocompleteCtrl.isRequired"                ng-disabled="$mdAutocompleteCtrl.isDisabled"                ng-readonly="$mdAutocompleteCtrl.isReadonly"                ng-minlength="inputMinlength"                ng-maxlength="inputMaxlength"                ng-model="$mdAutocompleteCtrl.scope.searchText"                ng-keydown="$mdAutocompleteCtrl.keydown($event)"                ng-blur="$mdAutocompleteCtrl.blur($event)"                ng-focus="$mdAutocompleteCtrl.focus($event)"                placeholder="{{placeholder}}"                aria-owns="ul-{{$mdAutocompleteCtrl.id}}"                aria-label="{{placeholder}}"                aria-autocomplete="list"                role="combobox"                aria-haspopup="true"                aria-activedescendant=""                aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>') + '          <button type="button" aria-label="Clear Input" tabindex="-1" ng-if="clearButton && $mdAutocompleteCtrl.scope.searchText" ng-click="$mdAutocompleteCtrl.clear($event)"><md-icon md-svg-src="' + c.mdClose + '"></md-icon></button>          <md-progress-linear              class="' + (e.mdFloatingLabel ? "md-inline" : "") + '"              ng-if="$mdAutocompleteCtrl.loadingIsVisible()"              md-mode="indeterminate"></md-progress-linear>          <md-virtual-repeat-container              md-auto-shrink              md-auto-shrink-min="1"              ng-mouseenter="$mdAutocompleteCtrl.listEnter()"              ng-mouseleave="$mdAutocompleteCtrl.listLeave()"              ng-mouseup="$mdAutocompleteCtrl.mouseUp()"              ng-hide="$mdAutocompleteCtrl.hidden"              class="md-autocomplete-suggestions-container md-whiteframe-z1' + l + '"              ng-class="{ \'md-not-found\': $mdAutocompleteCtrl.notFoundVisible() }"              role="presentation">            <ul class="md-autocomplete-suggestions"                ng-class="::menuClass"                id="ul-{{$mdAutocompleteCtrl.id}}">              <li md-virtual-repeat="item in $mdAutocompleteCtrl.matches"                  ng-class="{ selected: $index === $mdAutocompleteCtrl.index }"                  ng-click="$mdAutocompleteCtrl.select($index)"                  md-extra-name="$mdAutocompleteCtrl.itemName">                  ' + o + "                  </li>" + i + "            </ul>          </md-virtual-repeat-container>        </md-autocomplete-wrap>"
-                        }
-                    }
-                }
-                e.$inject = ["$$mdSvgRegistry"], se.module("material.components.autocomplete").directive("mdAutocomplete", e)
-            }(),
-            function() {
-                function e(e, u) {
-                    return {
-                        restrict: "AE",
-                        compile: function(e, t, c) {
-                            return function(n, t, e) {
-                                var r, i, o = n.$mdAutocompleteCtrl,
-                                    a = o.parent.$new(),
-                                    s = o.itemName;
-
-                                function l(e, t) {
-                                    a[t] = n[e], n.$watch(e, function(e) {
-                                        u.nextTick(function() {
-                                            a[t] = e
-                                        })
-                                    })
-                                }
-                                l("$index", "$index"), l("item", s), i = r = !1, n.$watch(function() {
-                                    i || r || (r = !0, n.$$postDigest(function() {
-                                        i || a.$digest(), r = i = !1
-                                    }))
-                                }), a.$watch(function() {
-                                    i = !0
-                                }), c(a, function(e) {
-                                    t.after(e)
-                                })
-                            }
-                        },
-                        terminal: !0,
-                        transclude: "element"
-                    }
-                }
-                e.$inject = ["$compile", "$mdUtil"], se.module("material.components.autocomplete").directive("mdAutocompleteParentScope", e)
-            }(),
-            function() {
-                function e(e, t, n) {
-                    this.$scope = e, this.$element = t, this.$attrs = n, this.regex = null
-                }
-                e.$inject = ["$scope", "$element", "$attrs"], se.module("material.components.autocomplete").controller("MdHighlightCtrl", e), e.prototype.init = function(t, n) {
-                    this.flags = this.$attrs.mdHighlightFlags || "", this.unregisterFn = this.$scope.$watch(function(e) {
-                        return {
-                            term: t(e),
-                            contentText: n(e)
-                        }
-                    }.bind(this), this.onRender.bind(this), !0), this.$element.on("$destroy", this.unregisterFn)
-                }, e.prototype.onRender = function(e, t) {
-                    var n = e.contentText;
-                    null !== this.regex && e.term === t.term || (this.regex = this.createRegex(e.term, this.flags)), e.term ? this.applyRegex(n) : this.$element.text(n)
-                }, e.prototype.applyRegex = function(e) {
-                    var t = this.resolveTokens(e);
-                    this.$element.empty(), t.forEach(function(e) {
-                        if (e.isMatch) {
-                            var t = se.element('<span class="highlight">').text(e.text);
-                            this.$element.append(t)
-                        } else this.$element.append(document.createTextNode(e))
-                    }.bind(this))
-                }, e.prototype.resolveTokens = function(r) {
-                    var i = [],
-                        n = 0;
-                    return r.replace(this.regex, function(e, t) {
-                        o(n, t), i.push({
-                            text: e,
-                            isMatch: !0
-                        }), n = t + e.length
-                    }), o(n), i;
-
-                    function o(e, t) {
-                        var n = r.slice(e, t);
-                        n && i.push(n)
-                    }
-                }, e.prototype.createRegex = function(e, t) {
-                    var n = "",
-                        r = "",
-                        i = this.sanitizeRegex(e);
-                    return 0 <= t.indexOf("^") && (n = "^"), 0 <= t.indexOf("$") && (r = "$"), new RegExp(n + i + r, t.replace(/[$^]/g, ""))
-                }, e.prototype.sanitizeRegex = function(e) {
-                    return e && e.toString().replace(/[\\^$*+?.()|{}[\]]/g, "\\$&")
-                }
-            }(),
-            function() {
-                function e(n, r) {
-                    return {
-                        terminal: !0,
-                        controller: "MdHighlightCtrl",
-                        compile: function(e, t) {
-                            var i = r(t.mdHighlightText),
-                                o = n(e.html());
-                            return function(e, t, n, r) {
-                                r.init(i, o)
-                            }
-                        }
-                    }
-                }
-                e.$inject = ["$interpolate", "$parse"], se.module("material.components.autocomplete").directive("mdHighlightText", e)
-            }(),
-            function() {
-                function e(e, t, n, r, i) {
-                    this.$scope = e, this.$element = t, this.$mdConstant = n, this.$timeout = r, this.$mdUtil = i, this.isEditing = !1, this.parentController = le, this.enableChipEdit = !1
-                }
-                e.$inject = ["$scope", "$element", "$mdConstant", "$timeout", "$mdUtil"], se.module("material.components.chips").controller("MdChipCtrl", e), e.prototype.init = function(e) {
-                    this.parentController = e, this.enableChipEdit = this.parentController.enableChipEdit, this.enableChipEdit && (this.$element.on("keydown", this.chipKeyDown.bind(this)), this.$element.on("dblclick", this.chipMouseDoubleClick.bind(this)), this.getChipContent().addClass("_md-chip-content-edit-is-enabled"))
-                }, e.prototype.getChipContent = function() {
-                    var e = this.$element[0].getElementsByClassName("md-chip-content");
-                    return se.element(e[0])
-                }, e.prototype.getContentElement = function() {
-                    return se.element(this.getChipContent().contents()[0])
-                }, e.prototype.getChipIndex = function() {
-                    return parseInt(this.$element.attr("index"))
-                }, e.prototype.goOutOfEditMode = function() {
-                    if (this.isEditing) {
-                        this.isEditing = !1, this.$element.removeClass("_md-chip-editing"), this.getChipContent()[0].contentEditable = "false";
-                        var e = this.getChipIndex();
-                        this.getContentElement().text() ? (this.parentController.updateChipContents(e, this.getContentElement().text()), this.$mdUtil.nextTick(function() {
-                            this.parentController.selectedChip === e && this.parentController.focusChip(e)
-                        }.bind(this))) : this.parentController.removeChipAndFocusInput(e)
-                    }
-                }, e.prototype.selectNodeContents = function(e) {
-                    var t, n;
-                    document.body.createTextRange ? ((t = document.body.createTextRange()).moveToElementText(e), t.select()) : F.getSelection && (n = F.getSelection(), (t = document.createRange()).selectNodeContents(e), n.removeAllRanges(), n.addRange(t))
-                }, e.prototype.goInEditMode = function() {
-                    this.isEditing = !0, this.$element.addClass("_md-chip-editing"), this.getChipContent()[0].contentEditable = "true", this.getChipContent().on("blur", function() {
-                        this.goOutOfEditMode()
-                    }.bind(this)), this.selectNodeContents(this.getChipContent()[0])
-                }, e.prototype.chipKeyDown = function(e) {
-                    this.isEditing || e.keyCode !== this.$mdConstant.KEY_CODE.ENTER && e.keyCode !== this.$mdConstant.KEY_CODE.SPACE ? this.isEditing && e.keyCode === this.$mdConstant.KEY_CODE.ENTER && (e.preventDefault(), this.goOutOfEditMode()) : (e.preventDefault(), this.goInEditMode())
-                }, e.prototype.chipMouseDoubleClick = function() {
-                    this.enableChipEdit && !this.isEditing && this.goInEditMode()
-                }
-            }(),
-            function() {
-                e.$inject = ["$mdTheming", "$mdUtil", "$compile", "$timeout"], se.module("material.components.chips").directive("mdChip", e);
-                var t = '    <span ng-if="!$mdChipsCtrl.readonly" class="md-visually-hidden">      {{$mdChipsCtrl.deleteHint}}    </span>';
-
-                function e(s, e, l, c) {
-                    var u = e.processTemplate(t);
-                    return {
-                        restrict: "E",
-                        require: ["^?mdChips", "mdChip"],
-                        link: function(e, t, n, r) {
-                            var i = r.shift(),
-                                o = r.shift(),
-                                a = se.element(t[0].querySelector(".md-chip-content"));
-                            s(t), i && (o.init(i), a.append(l(u)(e)), a.on("blur", function() {
-                                i.resetSelectedChip(), i.$scope.$applyAsync()
-                            }));
-                            c(function() {
-                                i && i.shouldFocusLastChip && i.focusLastChipThenInput()
-                            })
-                        },
-                        controller: "MdChipCtrl"
-                    }
-                }
-            }(),
-            function() {
-                function e(i) {
-                    return {
-                        restrict: "A",
-                        require: "^mdChips",
-                        scope: !1,
-                        link: function(t, e, n, r) {
-                            e.on("click", function(e) {
-                                t.$apply(function() {
-                                    r.removeChip(t.$$replacedScope.$index)
-                                })
-                            }), i(function() {
-                                e.attr({
-                                    tabindex: -1,
-                                    "aria-hidden": !0
-                                }), e.find("button").attr("tabindex", "-1")
-                            })
-                        }
-                    }
-                }
-                e.$inject = ["$timeout"], se.module("material.components.chips").directive("mdChipRemove", e)
-            }(),
-            function() {
-                function e(a) {
-                    return {
-                        restrict: "EA",
-                        terminal: !0,
-                        link: function(e, t, n) {
-                            var r = e.$parent.$mdChipsCtrl,
-                                i = r.parent.$new(!1, r.parent);
-                            i.$$replacedScope = e, i.$chip = e.$chip, i.$index = e.$index;
-                            var o = (i.$mdChipsCtrl = r).$scope.$eval(n.mdChipTransclude);
-                            t.html(o), a(t.contents())(i)
-                        },
-                        scope: !1
-                    }
-                }
-                e.$inject = ["$compile"], se.module("material.components.chips").directive("mdChipTransclude", e)
-            }(),
-            function() {
-                e.$inject = ["$scope", "$attrs", "$mdConstant", "$log", "$element", "$timeout", "$mdUtil", "$exceptionHandler"];
-                var l = 300;
-
-                function e(e, t, n, r, i, o, a, s) {
-                    this.$timeout = o, this.$mdConstant = n, this.$scope = e, this.parent = e.$parent, this.$mdUtil = a, this.$log = r, this.$exceptionHandler = s, this.$element = i, this.$attrs = t, this.ngModelCtrl = null, this.userInputNgModelCtrl = null, this.autocompleteCtrl = null, this.userInputElement = null, this.items = [], this.selectedChip = -1, this.enableChipEdit = a.parseAttributeBoolean(t.mdEnableChipEdit), this.addOnBlur = a.parseAttributeBoolean(t.mdAddOnBlur), this.inputAriaLabel = "Chips input.", this.containerHint = "Chips container. Use arrow keys to select chips.", this.deleteHint = "Press delete to remove this chip.", this.deleteButtonLabel = "Remove", this.chipBuffer = "", this.useTransformChip = !1, this.useOnAdd = !1, this.useOnRemove = !1, this.wrapperId = "", this.contentIds = [], this.ariaTabIndex = null, this.chipAppendDelay = l, this.deRegister = [], this.init()
-                }
-                se.module("material.components.chips").controller("MdChipsCtrl", e), e.prototype.init = function() {
-                    var t = this;
-                    this.wrapperId = "_md-chips-wrapper-" + this.$mdUtil.nextUid(), this.deRegister.push(this.$scope.$watchCollection("$mdChipsCtrl.items", function() {
-                        t.setupInputAria(), t.setupWrapperAria()
-                    })), this.deRegister.push(this.$attrs.$observe("mdChipAppendDelay", function(e) {
-                        t.chipAppendDelay = parseInt(e) || l
-                    }))
-                }, e.prototype.$onDestroy = function() {
-                    for (var e; e = this.deRegister.pop();) e.call(this)
-                }, e.prototype.setupInputAria = function() {
-                    var e = this.$element.find("input");
-                    e && (e.attr("role", "textbox"), e.attr("aria-multiline", !0))
-                }, e.prototype.setupWrapperAria = function() {
-                    var e = this,
-                        t = this.$element.find("md-chips-wrap");
-                    this.items && this.items.length ? (t.attr("role", "listbox"), this.contentIds = this.items.map(function() {
-                        return e.wrapperId + "-chip-" + e.$mdUtil.nextUid()
-                    }), t.attr("aria-owns", this.contentIds.join(" "))) : (t.removeAttr("role"), t.removeAttr("aria-owns"))
-                }, e.prototype.inputKeydown = function(e) {
-                    var t = this.getChipBuffer();
-                    if (!(this.autocompleteCtrl && e.isDefaultPrevented && e.isDefaultPrevented())) {
-                        if (e.keyCode === this.$mdConstant.KEY_CODE.BACKSPACE) {
-                            if (0 !== this.getCursorPosition(e.target)) return;
-                            return e.preventDefault(), e.stopPropagation(), void(this.items.length && this.selectAndFocusChipSafe(this.items.length - 1))
-                        }
-                        if ((!this.separatorKeys || this.separatorKeys.length < 1) && (this.separatorKeys = [this.$mdConstant.KEY_CODE.ENTER]), -1 !== this.separatorKeys.indexOf(e.keyCode)) {
-                            if (this.autocompleteCtrl && this.requireMatch || !t) return;
-                            if (e.preventDefault(), this.hasMaxChipsReached()) return;
-                            return this.appendChip(t.trim()), this.resetChipBuffer(), !1
-                        }
-                    }
-                }, e.prototype.getCursorPosition = function(t) {
-                    try {
-                        if (t.selectionStart === t.selectionEnd) return t.selectionStart
-                    } catch (e) {
-                        if (!t.value) return 0
-                    }
-                }, e.prototype.updateChipContents = function(e, t) {
-                    0 <= e && e < this.items.length && (this.items[e] = t, this.updateNgModel(!0))
-                }, e.prototype.isEditingChip = function() {
-                    return !!this.$element[0].querySelector("._md-chip-editing")
-                }, e.prototype.isRemovable = function() {
-                    return !!this.ngModelCtrl && (this.readonly ? this.removable : !se.isDefined(this.removable) || this.removable)
-                }, e.prototype.chipKeydown = function(e) {
-                    if (!this.getChipBuffer() && !this.isEditingChip()) switch (e.keyCode) {
-                        case this.$mdConstant.KEY_CODE.BACKSPACE:
-                        case this.$mdConstant.KEY_CODE.DELETE:
-                            if (this.selectedChip < 0) return;
-                            if (e.preventDefault(), !this.isRemovable()) return;
-                            this.removeAndSelectAdjacentChip(this.selectedChip, e);
-                            break;
-                        case this.$mdConstant.KEY_CODE.LEFT_ARROW:
-                            e.preventDefault(), (this.selectedChip < 0 || this.readonly && 0 === this.selectedChip) && (this.selectedChip = this.items.length), this.items.length && this.selectAndFocusChipSafe(this.selectedChip - 1);
-                            break;
-                        case this.$mdConstant.KEY_CODE.RIGHT_ARROW:
-                            e.preventDefault(), this.selectAndFocusChipSafe(this.selectedChip + 1);
-                            break;
-                        case this.$mdConstant.KEY_CODE.ESCAPE:
-                        case this.$mdConstant.KEY_CODE.TAB:
-                            if (this.selectedChip < 0) return;
-                            e.preventDefault(), this.onFocus()
-                    }
-                }, e.prototype.getPlaceholder = function() {
-                    return this.items && this.items.length && ("" === this.secondaryPlaceholder || this.secondaryPlaceholder) ? this.secondaryPlaceholder : this.placeholder
-                }, e.prototype.removeAndSelectAdjacentChip = function(e, t) {
-                    var n = this,
-                        r = n.getAdjacentChipIndex(e);
-                    this.$element[0].querySelector("md-chips-wrap"), this.$element[0].querySelector('md-chip[index="' + e + '"]');
-                    n.removeChip(e, t), n.$timeout(function() {
-                        n.$timeout(function() {
-                            n.selectAndFocusChipSafe(r)
-                        })
-                    })
-                }, e.prototype.resetSelectedChip = function() {
-                    this.selectedChip = -1, this.ariaTabIndex = null
-                }, e.prototype.getAdjacentChipIndex = function(e) {
-                    var t = this.items.length - 1;
-                    return 0 === t ? -1 : e === t ? e - 1 : e
-                }, e.prototype.appendChip = function(t) {
-                    if (this.shouldFocusLastChip = !this.addOnBlur, this.useTransformChip && this.transformChip) {
-                        var e = this.transformChip({
-                            $chip: t
-                        });
-                        se.isDefined(e) && (t = e)
-                    }
-                    if (se.isObject(t) && this.items.some(function(e) {
-                            return se.equals(t, e)
-                        })) return;
-                    if (!(null == t || this.items.indexOf(t) + 1)) {
-                        var n = this.items.push(t) - 1;
-                        this.updateNgModel(), this.useOnAdd && this.onAdd && this.onAdd({
-                            $chip: t,
-                            $index: n
-                        })
-                    }
-                }, e.prototype.useTransformChipExpression = function() {
-                    this.useTransformChip = !0
-                }, e.prototype.useOnAddExpression = function() {
-                    this.useOnAdd = !0
-                }, e.prototype.useOnRemoveExpression = function() {
-                    this.useOnRemove = !0
-                }, e.prototype.useOnSelectExpression = function() {
-                    this.useOnSelect = !0
-                }, e.prototype.getChipBuffer = function() {
-                    var e = this.userInputElement ? this.userInputNgModelCtrl ? this.userInputNgModelCtrl.$viewValue : this.userInputElement[0].value : this.chipBuffer;
-                    return se.isString(e) ? e : ""
-                }, e.prototype.resetChipBuffer = function() {
-                    this.userInputElement ? this.userInputNgModelCtrl ? (this.userInputNgModelCtrl.$setViewValue(""), this.userInputNgModelCtrl.$render()) : this.userInputElement[0].value = "" : this.chipBuffer = ""
-                }, e.prototype.hasMaxChipsReached = function() {
-                    return se.isString(this.maxChips) && (this.maxChips = parseInt(this.maxChips, 10) || 0), 0 < this.maxChips && this.items.length >= this.maxChips
-                }, e.prototype.validateModel = function() {
-                    this.ngModelCtrl.$setValidity("md-max-chips", !this.hasMaxChipsReached()), this.ngModelCtrl.$validate()
-                }, e.prototype.updateNgModel = function(e) {
-                    e || this.validateModel(), se.forEach(this.ngModelCtrl.$viewChangeListeners, function(e) {
-                        try {
-                            e()
-                        } catch (e) {
-                            this.$exceptionHandler(e)
-                        }
-                    })
-                }, e.prototype.removeChip = function(e, t) {
-                    var n = this.items.splice(e, 1);
-                    this.updateNgModel(), n && n.length && this.useOnRemove && this.onRemove && this.onRemove({
-                        $chip: n[0],
-                        $index: e,
-                        $event: t
-                    })
-                }, e.prototype.removeChipAndFocusInput = function(e, t) {
-                    this.removeChip(e, t), this.autocompleteCtrl ? (this.autocompleteCtrl.hidden = !0, this.$mdUtil.nextTick(this.onFocus.bind(this))) : this.onFocus()
-                }, e.prototype.selectAndFocusChipSafe = function(e) {
-                    if (!this.items.length || -1 === e) return this.focusInput();
-                    if (e >= this.items.length) {
-                        if (!this.readonly) return this.onFocus();
-                        e = 0
-                    }
-                    e = Math.max(e, 0), e = Math.min(e, this.items.length - 1), this.selectChip(e), this.focusChip(e)
-                }, e.prototype.focusLastChipThenInput = function() {
-                    var e = this;
-                    e.shouldFocusLastChip = !1, e.focusChip(this.items.length - 1), e.$timeout(function() {
-                        e.focusInput()
-                    }, e.chipAppendDelay)
-                }, e.prototype.focusInput = function() {
-                    this.selectChip(-1), this.onFocus()
-                }, e.prototype.selectChip = function(e) {
-                    -1 <= e && e <= this.items.length ? (this.selectedChip = e, this.useOnSelect && this.onSelect && this.onSelect({
-                        $chip: this.items[e]
-                    })) : this.$log.warn("Selected Chip index out of bounds; ignoring.")
-                }, e.prototype.selectAndFocusChip = function(e) {
-                    this.selectChip(e), -1 !== e && this.focusChip(e)
-                }, e.prototype.focusChip = function(e) {
-                    var t = this.$element[0].querySelector('md-chip[index="' + e + '"] .md-chip-content');
-                    this.ariaTabIndex = e, t.focus()
-                }, e.prototype.configureNgModel = function(e) {
-                    this.ngModelCtrl = e;
-                    var t = this;
-                    e.$isEmpty = function(e) {
-                        return !e || 0 === e.length
-                    }, e.$render = function() {
-                        t.items = t.ngModelCtrl.$viewValue
-                    }
-                }, e.prototype.onFocus = function() {
-                    var e = this.$element[0].querySelector("input");
-                    e && e.focus(), this.resetSelectedChip()
-                }, e.prototype.onInputFocus = function() {
-                    this.inputHasFocus = !0, this.setupInputAria(), this.resetSelectedChip()
-                }, e.prototype.onInputBlur = function() {
-                    this.inputHasFocus = !1, this.shouldAddOnBlur() && (this.appendChip(this.getChipBuffer().trim()), this.resetChipBuffer())
-                }, e.prototype.configureInput = function(e) {
-                    var t = e.controller("ngModel"),
-                        n = this;
-                    t && (this.deRegister.push(this.$scope.$watch(function() {
-                        return t.$touched
-                    }, function(e) {
-                        e && n.ngModelCtrl.$setTouched()
-                    })), this.deRegister.push(this.$scope.$watch(function() {
-                        return t.$dirty
-                    }, function(e) {
-                        e && n.ngModelCtrl.$setDirty()
-                    })))
-                }, e.prototype.configureUserInput = function(e) {
-                    var t = (this.userInputElement = e).controller("ngModel");
-                    t !== this.ngModelCtrl && (this.userInputNgModelCtrl = t);
-                    var n = this.$scope,
-                        r = this,
-                        i = function(e, t) {
-                            n.$evalAsync(se.bind(r, t, e))
-                        };
-                    e.attr({
-                        tabindex: 0
-                    }).on("keydown", function(e) {
-                        i(e, r.inputKeydown)
-                    }).on("focus", function(e) {
-                        i(e, r.onInputFocus)
-                    }).on("blur", function(e) {
-                        i(e, r.onInputBlur)
-                    })
-                }, e.prototype.configureAutocomplete = function(e) {
-                    e && ((this.autocompleteCtrl = e).registerSelectedItemWatcher(se.bind(this, function(e) {
-                        if (e) {
-                            if (this.hasMaxChipsReached()) return;
-                            this.appendChip(e), this.resetChipBuffer()
-                        }
-                    })), this.$element.find("input").on("focus", se.bind(this, this.onInputFocus)).on("blur", se.bind(this, this.onInputBlur)))
-                }, e.prototype.shouldAddOnBlur = function() {
-                    this.validateModel();
-                    var e = this.getChipBuffer().trim(),
-                        t = this.ngModelCtrl.$isEmpty(this.ngModelCtrl.$modelValue) || this.ngModelCtrl.$valid,
-                        n = this.autocompleteCtrl && !this.autocompleteCtrl.hidden;
-                    return this.userInputNgModelCtrl && (t = t && this.userInputNgModelCtrl.$valid), this.addOnBlur && !this.requireMatch && e && t && !n
-                }, e.prototype.hasFocus = function() {
-                    return this.inputHasFocus || 0 <= this.selectedChip
-                }, e.prototype.contentIdFor = function(e) {
-                    return this.contentIds[e]
-                }
-            }(),
-            function() {
-                r.$inject = ["$mdTheming", "$mdUtil", "$compile", "$log", "$timeout", "$$mdSvgRegistry"], se.module("material.components.chips").directive("mdChips", r);
-                var e = '      <md-chips-wrap          id="{{$mdChipsCtrl.wrapperId}}"          tabindex="{{$mdChipsCtrl.readonly ? 0 : -1}}"          ng-keydown="$mdChipsCtrl.chipKeydown($event)"          ng-class="{ \'md-focused\': $mdChipsCtrl.hasFocus(),                       \'md-readonly\': !$mdChipsCtrl.ngModelCtrl || $mdChipsCtrl.readonly,                      \'md-removable\': $mdChipsCtrl.isRemovable() }"          aria-setsize="{{$mdChipsCtrl.items.length}}"          class="md-chips">        <span ng-if="$mdChipsCtrl.readonly" class="md-visually-hidden">          {{$mdChipsCtrl.containerHint}}        </span>        <md-chip ng-repeat="$chip in $mdChipsCtrl.items"            index="{{$index}}"            ng-class="{\'md-focused\': $mdChipsCtrl.selectedChip == $index, \'md-readonly\': !$mdChipsCtrl.ngModelCtrl || $mdChipsCtrl.readonly}">          <div class="md-chip-content"              tabindex="{{$mdChipsCtrl.ariaTabIndex == $index ? 0 : -1}}"              id="{{$mdChipsCtrl.contentIdFor($index)}}"              role="option"              aria-selected="{{$mdChipsCtrl.selectedChip === $index}}"              aria-posinset="{{$index}}"              ng-click="!$mdChipsCtrl.readonly && $mdChipsCtrl.focusChip($index)"              ng-focus="!$mdChipsCtrl.readonly && $mdChipsCtrl.selectChip($index)"              md-chip-transclude="$mdChipsCtrl.chipContentsTemplate"></div>          <div ng-if="$mdChipsCtrl.isRemovable()"               class="md-chip-remove-container"               tabindex="-1"               md-chip-transclude="$mdChipsCtrl.chipRemoveTemplate"></div>        </md-chip>        <div class="md-chip-input-container" ng-if="!$mdChipsCtrl.readonly && $mdChipsCtrl.ngModelCtrl">          <div md-chip-transclude="$mdChipsCtrl.chipInputTemplate"></div>        </div>      </md-chips-wrap>',
-                    t = '        <input            class="md-input"            tabindex="0"            aria-label="{{$mdChipsCtrl.inputAriaLabel}}"             placeholder="{{$mdChipsCtrl.getPlaceholder()}}"            ng-model="$mdChipsCtrl.chipBuffer"            ng-focus="$mdChipsCtrl.onInputFocus()"            ng-blur="$mdChipsCtrl.onInputBlur()"            ng-keydown="$mdChipsCtrl.inputKeydown($event)">',
-                    n = "      <span>{{$chip}}</span>",
-                    i = '      <button          class="md-chip-remove"          ng-if="$mdChipsCtrl.isRemovable()"          ng-click="$mdChipsCtrl.removeChipAndFocusInput($$replacedScope.$index, $event)"          type="button"          tabindex="-1">        <md-icon md-svg-src="{{ $mdChipsCtrl.mdCloseIcon }}"></md-icon>        <span class="md-visually-hidden">          {{$mdChipsCtrl.deleteButtonLabel}}        </span>      </button>';
-
-                function r(f, h, p, r, m, g) {
-                    var v = {
-                        chips: h.processTemplate(e),
-                        input: h.processTemplate(t),
-                        default: h.processTemplate(n),
-                        remove: h.processTemplate(i)
-                    };
-                    return {
-                        template: function(e, t) {
-                            return t.$mdUserTemplate = e.clone(), v.chips
-                        },
-                        require: ["mdChips"],
-                        restrict: "E",
-                        controller: "MdChipsCtrl",
-                        controllerAs: "$mdChipsCtrl",
-                        bindToController: !0,
-                        compile: function(e, a) {
-                            var n = a.$mdUserTemplate;
-                            a.$mdUserTemplate = null;
-                            var s = t("md-chips>md-chip-template"),
-                                l = t(h.prefixer().buildList("md-chip-remove").map(function(e) {
-                                    return "md-chips>*[" + e + "]"
-                                }).join(",")) || v.remove,
-                                c = s || v.default,
-                                u = t("md-chips>md-autocomplete") || t("md-chips>input") || v.input,
-                                d = n.find("md-chip");
-                            n[0].querySelector("md-chip-template>*[md-chip-remove]") && r.warn("invalid placement of md-chip-remove within md-chip-template.");
-
-                            function t(e) {
-                                if (a.ngModel) {
-                                    var t = n[0].querySelector(e);
-                                    return t && t.outerHTML
-                                }
-                            }
-                            return function(e, t, n, r) {
-                                h.initOptionalProperties(e, a), f(t);
-                                var i = r[0];
-                                if (s && (i.enableChipEdit = !1), i.chipContentsTemplate = c, i.chipRemoveTemplate = l, i.chipInputTemplate = u, i.mdCloseIcon = g.mdClose, t.attr({
-                                        tabindex: -1
-                                    }).on("focus", function() {
-                                        i.onFocus()
-                                    }).on("click", function() {
-                                        i.readonly || -1 !== i.selectedChip || i.onFocus()
-                                    }), a.ngModel && (i.configureNgModel(t.controller("ngModel")), n.mdTransformChip && i.useTransformChipExpression(), n.mdOnAppend && i.useOnAppendExpression(), n.mdOnAdd && i.useOnAddExpression(), n.mdOnRemove && i.useOnRemoveExpression(), n.mdOnSelect && i.useOnSelectExpression(), u != v.input && e.$watch("$mdChipsCtrl.readonly", function(e) {
-                                        e || h.nextTick(function() {
-                                            if (0 === u.indexOf("<md-autocomplete")) {
-                                                var e = t.find("md-autocomplete");
-                                                i.configureAutocomplete(e.controller("mdAutocomplete"))
-                                            }
-                                            i.configureUserInput(t.find("input"))
-                                        })
-                                    }), h.nextTick(function() {
-                                        var e = t.find("input");
-                                        e && (i.configureInput(e), e.toggleClass("md-input", !0))
-                                    })), 0 < d.length) {
-                                    var o = p(d.clone())(e.$parent);
-                                    m(function() {
-                                        t.find("md-chips-wrap").prepend(o)
-                                    })
-                                }
-                            }
-                        },
-                        scope: {
-                            readonly: "=readonly",
-                            removable: "=mdRemovable",
-                            placeholder: "@",
-                            secondaryPlaceholder: "@",
-                            maxChips: "@mdMaxChips",
-                            transformChip: "&mdTransformChip",
-                            onAppend: "&mdOnAppend",
-                            onAdd: "&mdOnAdd",
-                            onRemove: "&mdOnRemove",
-                            onSelect: "&mdOnSelect",
-                            inputAriaLabel: "@",
-                            containerHint: "@",
-                            deleteHint: "@",
-                            deleteButtonLabel: "@",
-                            separatorKeys: "=?mdSeparatorKeys",
-                            requireMatch: "=?mdRequireMatch",
-                            chipAppendDelayString: "@?mdChipAppendDelay",
-                            ngChange: "&"
-                        }
-                    }
-                }
-            }(),
-            function() {
-                function e() {
-                    this.selectedItem = null, this.searchText = ""
-                }
-                se.module("material.components.chips").controller("MdContactChipsCtrl", e), e.prototype.queryContact = function(e) {
-                    return this.contactQuery({
-                        $query: e
-                    })
-                }, e.prototype.itemName = function(e) {
-                    return e[this.contactName]
-                }
-            }(),
-            function() {
-                e.$inject = ["$mdTheming", "$mdUtil"], se.module("material.components.chips").directive("mdContactChips", e);
-                var n = '      <md-chips class="md-contact-chips"          ng-model="$mdContactChipsCtrl.contacts"          ng-change="$mdContactChipsCtrl.ngChange($mdContactChipsCtrl.contacts)"          md-require-match="$mdContactChipsCtrl.requireMatch"          md-chip-append-delay="{{$mdContactChipsCtrl.chipAppendDelay}}"           md-autocomplete-snap>          <md-autocomplete              md-menu-class="md-contact-chips-suggestions"              md-selected-item="$mdContactChipsCtrl.selectedItem"              md-search-text="$mdContactChipsCtrl.searchText"              md-items="item in $mdContactChipsCtrl.queryContact($mdContactChipsCtrl.searchText)"              md-item-text="$mdContactChipsCtrl.itemName(item)"              md-no-cache="true"              md-min-length="$mdContactChipsCtrl.minLength"              md-autoselect              placeholder="{{$mdContactChipsCtrl.contacts.length == 0 ?                  $mdContactChipsCtrl.placeholder : $mdContactChipsCtrl.secondaryPlaceholder}}">            <div class="md-contact-suggestion">              <img                   ng-src="{{item[$mdContactChipsCtrl.contactImage]}}"                  alt="{{item[$mdContactChipsCtrl.contactName]}}"                  ng-if="item[$mdContactChipsCtrl.contactImage]" />              <span class="md-contact-name" md-highlight-text="$mdContactChipsCtrl.searchText"                    md-highlight-flags="{{$mdContactChipsCtrl.highlightFlags}}">                {{item[$mdContactChipsCtrl.contactName]}}              </span>              <span class="md-contact-email" >{{item[$mdContactChipsCtrl.contactEmail]}}</span>            </div>          </md-autocomplete>          <md-chip-template>            <div class="md-contact-avatar">              <img                   ng-src="{{$chip[$mdContactChipsCtrl.contactImage]}}"                  alt="{{$chip[$mdContactChipsCtrl.contactName]}}"                  ng-if="$chip[$mdContactChipsCtrl.contactImage]" />            </div>            <div class="md-contact-name">              {{$chip[$mdContactChipsCtrl.contactName]}}            </div>          </md-chip-template>      </md-chips>';
-
-                function e(a, s) {
-                    return {
-                        template: function(e, t) {
-                            return n
-                        },
-                        restrict: "E",
-                        controller: "MdContactChipsCtrl",
-                        controllerAs: "$mdContactChipsCtrl",
-                        bindToController: !0,
-                        compile: function(e, o) {
-                            return function(e, t, n, r) {
-                                var i = r;
-                                s.initOptionalProperties(e, o), a(t), t.attr("tabindex", "-1"), n.$observe("mdChipAppendDelay", function(e) {
-                                    i.chipAppendDelay = e
-                                })
-                            }
-                        },
-                        scope: {
-                            contactQuery: "&mdContacts",
-                            placeholder: "@",
-                            secondaryPlaceholder: "@",
-                            contactName: "@mdContactName",
-                            contactImage: "@mdContactImage",
-                            contactEmail: "@mdContactEmail",
-                            contacts: "=ngModel",
-                            ngChange: "&",
-                            requireMatch: "=?mdRequireMatch",
-                            minLength: "=?mdMinLength",
-                            highlightFlags: "@?mdHighlightFlags",
-                            chipAppendDelay: "@?mdChipAppendDelay"
-                        }
-                    }
-                }
-            }(),
-            function() {
-                e.$inject = ["$element", "$scope", "$$mdDateUtil", "$mdUtil", "$mdConstant", "$mdTheming", "$$rAF", "$attrs", "$mdDateLocale"], se.module("material.components.datepicker").directive("mdCalendar", function() {
-                    return {
-                        template: function(e, t) {
-                            var n = t.hasOwnProperty("ngIf") ? "" : 'ng-if="calendarCtrl.isInitialized"',
-                                r = '<div ng-switch="calendarCtrl.currentView" ' + n + '><md-calendar-year ng-switch-when="year"></md-calendar-year><md-calendar-month ng-switch-default></md-calendar-month></div>';
-                            return r
-                        },
-                        scope: {
-                            minDate: "=mdMinDate",
-                            maxDate: "=mdMaxDate",
-                            dateFilter: "=mdDateFilter",
-                            _mode: "@mdMode",
-                            _currentView: "@mdCurrentView"
-                        },
-                        require: ["ngModel", "mdCalendar"],
-                        controller: e,
-                        controllerAs: "calendarCtrl",
-                        bindToController: !0,
-                        link: function(e, t, n, r) {
-                            var i = r[0],
-                                o = r[1];
-                            o.configureNgModel(i)
-                        }
-                    }
-                });
-                var d = 0,
-                    t = {
-                        day: "month",
-                        month: "year"
-                    };
-
-                function e(e, t, n, r, i, o, a, s, l) {
-                    o(e), this.$element = e, this.$scope = t, this.dateUtil = n, this.$mdUtil = r, this.keyCode = i.KEY_CODE, this.$$rAF = a, this.$mdDateLocale = l, this.today = this.dateUtil.createDateAtMidnight(), this.ngModelCtrl = null, this.SELECTED_DATE_CLASS = "md-calendar-selected-date", this.TODAY_CLASS = "md-calendar-date-today", this.FOCUSED_DATE_CLASS = "md-focus", this.id = d++, this.displayDate = null, this.selectedDate = null, this.firstRenderableDate = null, this.lastRenderableDate = null, this.isInitialized = !1, this.width = 0, this.scrollbarWidth = 0, s.tabindex || e.attr("tabindex", "-1");
-                    var c, u = se.bind(this, this.handleKeyEvent);
-                    (c = e.parent().hasClass("md-datepicker-calendar") ? se.element(document.body) : e).on("keydown", u), t.$on("$destroy", function() {
-                        c.off("keydown", u)
-                    }), 1 === se.version.major && se.version.minor <= 4 && this.$onInit()
-                }
-                e.prototype.$onInit = function() {
-                    this._mode && t.hasOwnProperty(this._mode) ? (this.currentView = t[this._mode], this.mode = this._mode) : (this.currentView = this._currentView || "month", this.mode = null);
-                    var e = this.$mdDateLocale;
-                    this.minDate && this.minDate > e.firstRenderableDate ? this.firstRenderableDate = this.minDate : this.firstRenderableDate = e.firstRenderableDate, this.maxDate && this.maxDate < e.lastRenderableDate ? this.lastRenderableDate = this.maxDate : this.lastRenderableDate = e.lastRenderableDate
-                }, e.prototype.configureNgModel = function(e) {
-                    var t = this;
-                    t.ngModelCtrl = e, t.$mdUtil.nextTick(function() {
-                        t.isInitialized = !0
-                    }), e.$render = function() {
-                        var e = this.$viewValue;
-                        t.$scope.$broadcast("md-calendar-parent-changed", e), t.selectedDate || (t.selectedDate = e), t.displayDate || (t.displayDate = t.selectedDate || t.today)
-                    }
-                }, e.prototype.setNgModelValue = function(e) {
-                    var t = this.dateUtil.createDateAtMidnight(e);
-                    return this.focus(t), this.$scope.$emit("md-calendar-change", t), this.ngModelCtrl.$setViewValue(t), this.ngModelCtrl.$render(), t
-                }, e.prototype.setCurrentView = function(e, t) {
-                    var n = this;
-                    n.$mdUtil.nextTick(function() {
-                        n.currentView = e, t && (n.displayDate = se.isDate(t) ? t : new Date(t))
-                    })
-                }, e.prototype.focus = function(e) {
-                    if (this.dateUtil.isValidDate(e)) {
-                        var t = this.$element[0].querySelector("." + this.FOCUSED_DATE_CLASS);
-                        t && t.classList.remove(this.FOCUSED_DATE_CLASS);
-                        var n = this.getDateId(e, this.currentView),
-                            r = document.getElementById(n);
-                        r && (r.classList.add(this.FOCUSED_DATE_CLASS), r.focus(), this.displayDate = e)
-                    } else {
-                        var i = this.$element[0].querySelector("[ng-switch]");
-                        i && i.focus()
-                    }
-                }, e.prototype.changeSelectedDate = function(e) {
-                    var t = this.SELECTED_DATE_CLASS,
-                        n = this.$element[0].querySelector("." + t);
-                    if (n && (n.classList.remove(t), n.setAttribute("aria-selected", "false")), e) {
-                        var r = document.getElementById(this.getDateId(e, this.currentView));
-                        r && (r.classList.add(t), r.setAttribute("aria-selected", "true"))
-                    }
-                    this.selectedDate = e
-                }, e.prototype.getActionFromKeyEvent = function(e) {
-                    var t = this.keyCode;
-                    switch (e.which) {
-                        case t.ENTER:
-                            return "select";
-                        case t.RIGHT_ARROW:
-                            return "move-right";
-                        case t.LEFT_ARROW:
-                            return "move-left";
-                        case t.DOWN_ARROW:
-                            return e.metaKey ? "move-page-down" : "move-row-down";
-                        case t.UP_ARROW:
-                            return e.metaKey ? "move-page-up" : "move-row-up";
-                        case t.PAGE_DOWN:
-                            return "move-page-down";
-                        case t.PAGE_UP:
-                            return "move-page-up";
-                        case t.HOME:
-                            return "start";
-                        case t.END:
-                            return "end";
-                        default:
-                            return null
-                    }
-                }, e.prototype.handleKeyEvent = function(t) {
-                    var n = this;
-                    this.$scope.$apply(function() {
-                        if (t.which == n.keyCode.ESCAPE || t.which == n.keyCode.TAB) return n.$scope.$emit("md-calendar-close"), void(t.which == n.keyCode.TAB && t.preventDefault());
-                        var e = n.getActionFromKeyEvent(t);
-                        e && (t.preventDefault(), t.stopPropagation(), n.$scope.$broadcast("md-calendar-parent-action", e))
-                    })
-                }, e.prototype.hideVerticalScrollbar = function(r) {
-                    var i = this,
-                        t = r.$element[0],
-                        o = t.querySelector(".md-calendar-scroll-mask");
-
-                    function n() {
-                        var e = i.width || 340,
-                            t = i.scrollbarWidth,
-                            n = r.calendarScroller;
-                        o.style.width = e + "px", n.style.width = e + t + "px", n.style.paddingRight = t + "px"
-                    }
-                    0 < i.width ? n() : i.$$rAF(function() {
-                        var e = r.calendarScroller;
-                        i.scrollbarWidth = e.offsetWidth - e.clientWidth, i.width = t.querySelector("table").offsetWidth, n()
-                    })
-                }, e.prototype.getDateId = function(e, t) {
-                    if (!t) throw new Error("A namespace for the date id has to be specified.");
-                    return ["md", this.id, t, e.getFullYear(), e.getMonth(), e.getDate()].join("-")
-                }, e.prototype.updateVirtualRepeat = function() {
-                    var e = this.$scope,
-                        t = e.$on("$md-resize-enable", function() {
-                            e.$$phase || e.$apply(), t()
-                        })
-                }
-            }(),
-            function() {
-                t.$inject = ["$element", "$scope", "$animate", "$q", "$$mdDateUtil", "$mdDateLocale"], se.module("material.components.datepicker").directive("mdCalendarMonth", function() {
-                    return {
-                        template: '<table aria-hidden="true" class="md-calendar-day-header"><thead></thead></table><div class="md-calendar-scroll-mask"><md-virtual-repeat-container class="md-calendar-scroll-container" md-offset-size="' + (e - n) + '"><table role="grid" tabindex="0" class="md-calendar" aria-readonly="true"><tbody md-calendar-month-body role="rowgroup" md-virtual-repeat="i in monthCtrl.items" md-month-offset="$index" class="md-calendar-month" md-start-index="monthCtrl.getSelectedMonthIndex()" md-item-size="' + n + '"><tr aria-hidden="true" md-force-height="\'' + n + "px'\"></tr></tbody></table></md-virtual-repeat-container></div>",
-                        require: ["^^mdCalendar", "mdCalendarMonth"],
-                        controller: t,
-                        controllerAs: "monthCtrl",
-                        bindToController: !0,
-                        link: function(e, t, n, r) {
-                            var i = r[0],
-                                o = r[1];
-                            o.initialize(i)
-                        }
-                    }
-                });
-                var n = 265,
-                    e = 45;
-
-                function t(e, t, n, r, i, o) {
-                    this.$element = e, this.$scope = t, this.$animate = n, this.$q = r, this.dateUtil = i, this.dateLocale = o, this.calendarScroller = e[0].querySelector(".md-virtual-repeat-scroller"), this.isInitialized = !1, this.isMonthTransitionInProgress = !1;
-                    var a = this;
-                    this.cellClickHandler = function() {
-                        var e = i.getTimestampFromNode(this);
-                        a.$scope.$apply(function() {
-                            a.calendarCtrl.setNgModelValue(e)
-                        })
-                    }, this.headerClickHandler = function() {
-                        a.calendarCtrl.setCurrentView("year", i.getTimestampFromNode(this))
-                    }
-                }
-                t.prototype.initialize = function(e) {
-                    this.items = {
-                        length: this.dateUtil.getMonthDistance(e.firstRenderableDate, e.lastRenderableDate) + 2
-                    }, this.calendarCtrl = e, this.attachScopeListeners(), e.updateVirtualRepeat(), e.ngModelCtrl && e.ngModelCtrl.$render()
-                }, t.prototype.getSelectedMonthIndex = function() {
-                    var e = this.calendarCtrl;
-                    return this.dateUtil.getMonthDistance(e.firstRenderableDate, e.displayDate || e.selectedDate || e.today)
-                }, t.prototype.changeDisplayDate = function(e) {
-                    if (!this.isInitialized) return this.buildWeekHeader(), this.calendarCtrl.hideVerticalScrollbar(this), this.isInitialized = !0, this.$q.when();
-                    if (!this.dateUtil.isValidDate(e) || this.isMonthTransitionInProgress) return this.$q.when();
-                    this.isMonthTransitionInProgress = !0;
-                    var t = this.animateDateChange(e);
-                    this.calendarCtrl.displayDate = e;
-                    var n = this;
-                    return t.then(function() {
-                        n.isMonthTransitionInProgress = !1
-                    }), t
-                }, t.prototype.animateDateChange = function(e) {
-                    if (this.dateUtil.isValidDate(e)) {
-                        var t = this.dateUtil.getMonthDistance(this.calendarCtrl.firstRenderableDate, e);
-                        this.calendarScroller.scrollTop = t * n
-                    }
-                    return this.$q.when()
-                }, t.prototype.buildWeekHeader = function() {
-                    for (var e = this.dateLocale.firstDayOfWeek, t = this.dateLocale.shortDays, n = document.createElement("tr"), r = 0; r < 7; r++) {
-                        var i = document.createElement("th");
-                        i.textContent = t[(r + e) % 7], n.appendChild(i)
-                    }
-                    this.$element.find("thead").append(n)
-                }, t.prototype.attachScopeListeners = function() {
-                    var n = this;
-                    n.$scope.$on("md-calendar-parent-changed", function(e, t) {
-                        n.calendarCtrl.changeSelectedDate(t), n.changeDisplayDate(t)
-                    }), n.$scope.$on("md-calendar-parent-action", se.bind(this, this.handleKeyEvent))
-                }, t.prototype.handleKeyEvent = function(e, t) {
-                    var n = this.calendarCtrl,
-                        r = n.displayDate;
-                    if ("select" === t) n.setNgModelValue(r);
-                    else {
-                        var i = null,
-                            o = this.dateUtil;
-                        switch (t) {
-                            case "move-right":
-                                i = o.incrementDays(r, 1);
-                                break;
-                            case "move-left":
-                                i = o.incrementDays(r, -1);
-                                break;
-                            case "move-page-down":
-                                i = o.incrementMonths(r, 1);
-                                break;
-                            case "move-page-up":
-                                i = o.incrementMonths(r, -1);
-                                break;
-                            case "move-row-down":
-                                i = o.incrementDays(r, 7);
-                                break;
-                            case "move-row-up":
-                                i = o.incrementDays(r, -7);
-                                break;
-                            case "start":
-                                i = o.getFirstDateOfMonth(r);
-                                break;
-                            case "end":
-                                i = o.getLastDateOfMonth(r)
-                        }
-                        i && (i = this.dateUtil.clampDate(i, n.minDate, n.maxDate), this.changeDisplayDate(i).then(function() {
-                            n.focus(i)
-                        }))
-                    }
-                }
-            }(),
-            function() {
-                function e(e, t) {
-                    var s = e('<md-icon md-svg-src="' + t.mdTabsArrow + '"></md-icon>')({})[0];
-                    return {
-                        require: ["^^mdCalendar", "^^mdCalendarMonth", "mdCalendarMonthBody"],
-                        scope: {
-                            offset: "=mdMonthOffset"
-                        },
-                        controller: n,
-                        controllerAs: "mdMonthBodyCtrl",
-                        bindToController: !0,
-                        link: function(e, t, n, r) {
-                            var i = r[0],
-                                o = r[1],
-                                a = r[2];
-                            a.calendarCtrl = i, a.monthCtrl = o, a.arrowIcon = s.cloneNode(!0), e.$watch(function() {
-                                return a.offset
-                            }, function(e) {
-                                se.isNumber(e) && a.generateContent()
-                            })
-                        }
-                    }
-                }
-
-                function n(e, t, n) {
-                    this.$element = e, this.dateUtil = t, this.dateLocale = n, this.monthCtrl = null, this.calendarCtrl = null, this.offset = null, this.focusAfterAppend = null
-                }
-                e.$inject = ["$compile", "$$mdSvgRegistry"], n.$inject = ["$element", "$$mdDateUtil", "$mdDateLocale"], se.module("material.components.datepicker").directive("mdCalendarMonthBody", e), n.prototype.generateContent = function() {
-                    var e = this.dateUtil.incrementMonths(this.calendarCtrl.firstRenderableDate, this.offset);
-                    this.$element.empty().append(this.buildCalendarForMonth(e)), this.focusAfterAppend && (this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS), this.focusAfterAppend.focus(), this.focusAfterAppend = null)
-                }, n.prototype.buildDateCell = function(e) {
-                    var t = this.monthCtrl,
-                        n = this.calendarCtrl,
-                        r = document.createElement("td");
-                    if (r.tabIndex = -1, r.classList.add("md-calendar-date"), r.setAttribute("role", "gridcell"), e) {
-                        r.setAttribute("tabindex", "-1"), r.setAttribute("aria-label", this.dateLocale.longDateFormatter(e)), r.id = n.getDateId(e, "month"), r.setAttribute("data-timestamp", e.getTime()), this.dateUtil.isSameDay(e, n.today) && r.classList.add(n.TODAY_CLASS), this.dateUtil.isValidDate(n.selectedDate) && this.dateUtil.isSameDay(e, n.selectedDate) && (r.classList.add(n.SELECTED_DATE_CLASS), r.setAttribute("aria-selected", "true"));
-                        var i = this.dateLocale.dates[e.getDate()];
-                        if (this.isDateEnabled(e)) {
-                            var o = document.createElement("span");
-                            o.classList.add("md-calendar-date-selection-indicator"), o.textContent = i, r.appendChild(o), r.addEventListener("click", t.cellClickHandler), n.displayDate && this.dateUtil.isSameDay(e, n.displayDate) && (this.focusAfterAppend = r)
-                        } else r.classList.add("md-calendar-date-disabled"), r.textContent = i
-                    }
-                    return r
-                }, n.prototype.isDateEnabled = function(e) {
-                    return this.dateUtil.isDateWithinRange(e, this.calendarCtrl.minDate, this.calendarCtrl.maxDate) && (!se.isFunction(this.calendarCtrl.dateFilter) || this.calendarCtrl.dateFilter(e))
-                }, n.prototype.buildDateRow = function(e) {
-                    var t = document.createElement("tr");
-                    return t.setAttribute("role", "row"), t.setAttribute("aria-label", this.dateLocale.weekNumberFormatter(e)), t
-                }, n.prototype.buildCalendarForMonth = function(e) {
-                    var t = this.dateUtil.isValidDate(e) ? e : new Date,
-                        n = this.dateUtil.getFirstDateOfMonth(t),
-                        r = this.getLocaleDay_(n),
-                        i = this.dateUtil.getNumberOfDaysInMonth(t),
-                        o = document.createDocumentFragment(),
-                        a = 1,
-                        s = this.buildDateRow(a);
-                    o.appendChild(s);
-                    var l = this.offset === this.monthCtrl.items.length - 1,
-                        c = 0,
-                        u = document.createElement("td"),
-                        d = document.createElement("span"),
-                        f = this.calendarCtrl;
-                    if (d.textContent = this.dateLocale.monthHeaderFormatter(t), u.appendChild(d), u.classList.add("md-calendar-month-label"), f.maxDate && n > f.maxDate ? u.classList.add("md-calendar-month-label-disabled") : f.mode || (u.addEventListener("click", this.monthCtrl.headerClickHandler), u.setAttribute("data-timestamp", n.getTime()), u.setAttribute("aria-label", this.dateLocale.monthFormatter(t)), u.classList.add("md-calendar-label-clickable"), u.appendChild(this.arrowIcon.cloneNode(!0))), r <= 2) {
-                        u.setAttribute("colspan", "7");
-                        var h = this.buildDateRow();
-                        if (h.appendChild(u), o.insertBefore(h, s), l) return o
-                    } else c = 3, u.setAttribute("colspan", "3"), s.appendChild(u);
-                    for (var p = c; p < r; p++) s.appendChild(this.buildDateCell());
-                    for (var m = r, g = n, v = 1; v <= i; v++) {
-                        if (7 === m) {
-                            if (l) return o;
-                            m = 0, a++, s = this.buildDateRow(a), o.appendChild(s)
-                        }
-                        g.setDate(v);
-                        var b = this.buildDateCell(g);
-                        s.appendChild(b), m++
-                    }
-                    for (; s.childNodes.length < 7;) s.appendChild(this.buildDateCell());
-                    for (; o.childNodes.length < 6;) {
-                        for (var y = this.buildDateRow(), _ = 0; _ < 7; _++) y.appendChild(this.buildDateCell());
-                        o.appendChild(y)
-                    }
-                    return o
-                }, n.prototype.getLocaleDay_ = function(e) {
-                    return (e.getDay() + (7 - this.dateLocale.firstDayOfWeek)) % 7
-                }
-            }(),
-            function() {
-                e.$inject = ["$element", "$scope", "$animate", "$q", "$$mdDateUtil", "$mdUtil"], se.module("material.components.datepicker").directive("mdCalendarYear", function() {
-                    return {
-                        template: '<div class="md-calendar-scroll-mask"><md-virtual-repeat-container class="md-calendar-scroll-container"><table role="grid" tabindex="0" class="md-calendar" aria-readonly="true"><tbody md-calendar-year-body role="rowgroup" md-virtual-repeat="i in yearCtrl.items" md-year-offset="$index" class="md-calendar-year" md-start-index="yearCtrl.getFocusedYearIndex()" md-item-size="' + n + '"><tr aria-hidden="true" md-force-height="\'' + n + "px'\"></tr></tbody></table></md-virtual-repeat-container></div>",
-                        require: ["^^mdCalendar", "mdCalendarYear"],
-                        controller: e,
-                        controllerAs: "yearCtrl",
-                        bindToController: !0,
-                        link: function(e, t, n, r) {
-                            var i = r[0],
-                                o = r[1];
-                            o.initialize(i)
-                        }
-                    }
-                });
-                var n = 88;
-
-                function e(e, t, n, r, i, o) {
-                    this.$element = e, this.$scope = t, this.$animate = n, this.$q = r, this.dateUtil = i, this.calendarScroller = e[0].querySelector(".md-virtual-repeat-scroller"), this.isInitialized = !1, this.isMonthTransitionInProgress = !1, this.$mdUtil = o;
-                    var a = this;
-                    this.cellClickHandler = function() {
-                        a.onTimestampSelected(i.getTimestampFromNode(this))
-                    }
-                }
-                e.prototype.initialize = function(e) {
-                    this.items = {
-                        length: this.dateUtil.getYearDistance(e.firstRenderableDate, e.lastRenderableDate) + 1
-                    }, this.calendarCtrl = e, this.attachScopeListeners(), e.updateVirtualRepeat(), e.ngModelCtrl && e.ngModelCtrl.$render()
-                }, e.prototype.getFocusedYearIndex = function() {
-                    var e = this.calendarCtrl;
-                    return this.dateUtil.getYearDistance(e.firstRenderableDate, e.displayDate || e.selectedDate || e.today)
-                }, e.prototype.changeDate = function(e) {
-                    if (!this.isInitialized) return this.calendarCtrl.hideVerticalScrollbar(this), this.isInitialized = !0, this.$q.when();
-                    if (this.dateUtil.isValidDate(e) && !this.isMonthTransitionInProgress) {
-                        var t = this,
-                            n = this.animateDateChange(e);
-                        return t.isMonthTransitionInProgress = !0, t.calendarCtrl.displayDate = e, n.then(function() {
-                            t.isMonthTransitionInProgress = !1
-                        })
-                    }
-                }, e.prototype.animateDateChange = function(e) {
-                    if (this.dateUtil.isValidDate(e)) {
-                        var t = this.dateUtil.getYearDistance(this.calendarCtrl.firstRenderableDate, e);
-                        this.calendarScroller.scrollTop = t * n
-                    }
-                    return this.$q.when()
-                }, e.prototype.handleKeyEvent = function(e, t) {
-                    var n = this,
-                        r = n.calendarCtrl,
-                        i = r.displayDate;
-                    if ("select" === t) n.changeDate(i).then(function() {
-                        n.onTimestampSelected(i)
-                    });
-                    else {
-                        var o = null,
-                            a = n.dateUtil;
-                        switch (t) {
-                            case "move-right":
-                                o = a.incrementMonths(i, 1);
-                                break;
-                            case "move-left":
-                                o = a.incrementMonths(i, -1);
-                                break;
-                            case "move-row-down":
-                                o = a.incrementMonths(i, 6);
-                                break;
-                            case "move-row-up":
-                                o = a.incrementMonths(i, -6)
-                        }
-                        if (o) {
-                            var s = r.minDate ? a.getFirstDateOfMonth(r.minDate) : null,
-                                l = r.maxDate ? a.getFirstDateOfMonth(r.maxDate) : null;
-                            o = a.getFirstDateOfMonth(n.dateUtil.clampDate(o, s, l)), n.changeDate(o).then(function() {
-                                r.focus(o)
-                            })
-                        }
-                    }
-                }, e.prototype.attachScopeListeners = function() {
-                    var n = this;
-                    n.$scope.$on("md-calendar-parent-changed", function(e, t) {
-                        n.calendarCtrl.changeSelectedDate(t ? n.dateUtil.getFirstDateOfMonth(t) : t), n.changeDate(t)
-                    }), n.$scope.$on("md-calendar-parent-action", se.bind(n, n.handleKeyEvent))
-                }, e.prototype.onTimestampSelected = function(e) {
-                    var t = this.calendarCtrl;
-                    t.mode ? this.$mdUtil.nextTick(function() {
-                        t.setNgModelValue(e)
-                    }) : t.setCurrentView("month", e)
-                }
-            }(),
-            function() {
-                function e(e, t, n) {
-                    this.$element = e, this.dateUtil = t, this.dateLocale = n, this.calendarCtrl = null, this.yearCtrl = null, this.offset = null, this.focusAfterAppend = null
-                }
-                e.$inject = ["$element", "$$mdDateUtil", "$mdDateLocale"], se.module("material.components.datepicker").directive("mdCalendarYearBody", function() {
-                    return {
-                        require: ["^^mdCalendar", "^^mdCalendarYear", "mdCalendarYearBody"],
-                        scope: {
-                            offset: "=mdYearOffset"
-                        },
-                        controller: e,
-                        controllerAs: "mdYearBodyCtrl",
-                        bindToController: !0,
-                        link: function(e, t, n, r) {
-                            var i = r[0],
-                                o = r[1],
-                                a = r[2];
-                            a.calendarCtrl = i, a.yearCtrl = o, e.$watch(function() {
-                                return a.offset
-                            }, function(e) {
-                                se.isNumber(e) && a.generateContent()
-                            })
-                        }
-                    }
-                }), e.prototype.generateContent = function() {
-                    var e = this.dateUtil.incrementYears(this.calendarCtrl.firstRenderableDate, this.offset);
-                    this.$element.empty().append(this.buildCalendarForYear(e)), this.focusAfterAppend && (this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS), this.focusAfterAppend.focus(), this.focusAfterAppend = null)
-                }, e.prototype.buildMonthCell = function(e, t) {
-                    var n = this.calendarCtrl,
-                        r = this.yearCtrl,
-                        i = this.buildBlankCell(),
-                        o = new Date(e, t, 1);
-                    i.setAttribute("aria-label", this.dateLocale.monthFormatter(o)), i.id = n.getDateId(o, "year"), i.setAttribute("data-timestamp", o.getTime()), this.dateUtil.isSameMonthAndYear(o, n.today) && i.classList.add(n.TODAY_CLASS), this.dateUtil.isValidDate(n.selectedDate) && this.dateUtil.isSameMonthAndYear(o, n.selectedDate) && (i.classList.add(n.SELECTED_DATE_CLASS), i.setAttribute("aria-selected", "true"));
-                    var a = this.dateLocale.shortMonths[t];
-                    if (this.dateUtil.isMonthWithinRange(o, n.minDate, n.maxDate)) {
-                        var s = document.createElement("span");
-                        s.classList.add("md-calendar-date-selection-indicator"), s.textContent = a, i.appendChild(s), i.addEventListener("click", r.cellClickHandler), n.displayDate && this.dateUtil.isSameMonthAndYear(o, n.displayDate) && (this.focusAfterAppend = i)
-                    } else i.classList.add("md-calendar-date-disabled"), i.textContent = a;
-                    return i
-                }, e.prototype.buildBlankCell = function() {
-                    var e = document.createElement("td");
-                    return e.tabIndex = -1, e.classList.add("md-calendar-date"), e.setAttribute("role", "gridcell"), e.setAttribute("tabindex", "-1"), e
-                }, e.prototype.buildCalendarForYear = function(e) {
-                    var t, n = e.getFullYear(),
-                        r = document.createDocumentFragment(),
-                        i = document.createElement("tr"),
-                        o = document.createElement("td");
-                    for (o.className = "md-calendar-month-label", o.textContent = n, i.appendChild(o), t = 0; t < 6; t++) i.appendChild(this.buildMonthCell(n, t));
-                    r.appendChild(i);
-                    var a = document.createElement("tr");
-                    for (a.appendChild(this.buildBlankCell()), t = 6; t < 12; t++) a.appendChild(this.buildMonthCell(n, t));
-                    return r.appendChild(a), r
-                }
-            }(), se.module("material.components.datepicker").config(["$provide", function(e) {
-                function t() {
-                    this.months = null, this.shortMonths = null, this.days = null, this.shortDays = null, this.dates = null, this.firstDayOfWeek = 0, this.formatDate = null, this.parseDate = null, this.monthHeaderFormatter = null, this.weekNumberFormatter = null, this.longDateFormatter = null, this.isDateComplete = null, this.msgCalendar = "", this.msgOpenCalendar = ""
-                }(t.prototype.$get = function(e, i) {
-                    for (var t = e.DATETIME_FORMATS.SHORTDAY.map(function(e) {
-                            return e.substring(0, 1)
-                        }), n = Array(32), r = 1; r <= 31; r++) n[r] = r;
-                    var o = new Date(1880, 0, 1),
-                        a = new Date(o.getFullYear() + 250, 0, 1),
-                        s = {
-                            months: this.months || e.DATETIME_FORMATS.MONTH,
-                            shortMonths: this.shortMonths || e.DATETIME_FORMATS.SHORTMONTH,
-                            days: this.days || e.DATETIME_FORMATS.DAY,
-                            shortDays: this.shortDays || t,
-                            dates: this.dates || n,
-                            firstDayOfWeek: this.firstDayOfWeek || 0,
-                            formatDate: this.formatDate || function(e, t) {
-                                if (!e) return "";
-                                var n = e.toLocaleTimeString(),
-                                    r = e;
-                                return 0 !== e.getHours() || -1 === n.indexOf("11:") && -1 === n.indexOf("23:") || (r = new Date(e.getFullYear(), e.getMonth(), e.getDate(), 1, 0, 0)), i("date")(r, "M/d/yyyy", t)
-                            },
-                            parseDate: this.parseDate || function(e) {
-                                return new Date(e)
-                            },
-                            isDateComplete: this.isDateComplete || function(e) {
-                                return e = e.trim(), /^(([a-zA-Z]{3,}|[0-9]{1,4})([ .,]+|[/-])){2}([a-zA-Z]{3,}|[0-9]{1,4})$/.test(e)
-                            },
-                            monthHeaderFormatter: this.monthHeaderFormatter || function(e) {
-                                return s.shortMonths[e.getMonth()] + " " + e.getFullYear()
-                            },
-                            monthFormatter: this.monthFormatter || function(e) {
-                                return s.months[e.getMonth()] + " " + e.getFullYear()
-                            },
-                            weekNumberFormatter: this.weekNumberFormatter || function(e) {
-                                return "Week " + e
-                            },
-                            longDateFormatter: this.longDateFormatter || function(e) {
-                                return [s.days[e.getDay()], s.months[e.getMonth()], s.dates[e.getDate()], e.getFullYear()].join(" ")
-                            },
-                            msgCalendar: this.msgCalendar || "Calendar",
-                            msgOpenCalendar: this.msgOpenCalendar || "Open calendar",
-                            firstRenderableDate: this.firstRenderableDate || o,
-                            lastRenderableDate: this.lastRenderableDate || a
-                        };
-                    return s
-                }).$inject = ["$locale", "$filter"], e.provider("$mdDateLocale", new t)
-            }]), se.module("material.components.datepicker").factory("$$mdDateUtil", function() {
-                return {
-                    getFirstDateOfMonth: n,
-                    getNumberOfDaysInMonth: i,
-                    getDateInNextMonth: r,
-                    getDateInPreviousMonth: o,
-                    isInNextMonth: function(e, t) {
-                        return a(r(e), t)
-                    },
-                    isInPreviousMonth: function(e, t) {
-                        var n = o(e);
-                        return a(t, n)
-                    },
-                    getDateMidpoint: function(e, t) {
-                        return u((e.getTime() + t.getTime()) / 2)
-                    },
-                    isSameMonthAndYear: a,
-                    getWeekOfMonth: function(e) {
-                        var t = n(e);
-                        return Math.floor((t.getDay() + e.getDate() - 1) / 7)
-                    },
-                    incrementDays: function(e, t) {
-                        return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t)
-                    },
-                    incrementMonths: s,
-                    getLastDateOfMonth: function(e) {
-                        return new Date(e.getFullYear(), e.getMonth(), i(e))
-                    },
-                    isSameDay: function(e, t) {
-                        return e.getDate() == t.getDate() && a(e, t)
-                    },
-                    getMonthDistance: function(e, t) {
-                        return 12 * (t.getFullYear() - e.getFullYear()) + (t.getMonth() - e.getMonth())
-                    },
-                    isValidDate: l,
-                    setDateTimeToMidnight: c,
-                    createDateAtMidnight: u,
-                    isDateWithinRange: function(e, t, n) {
-                        var r = u(e),
-                            i = l(t) ? u(t) : null,
-                            o = l(n) ? u(n) : null;
-                        return (!i || i <= r) && (!o || r <= o)
-                    },
-                    incrementYears: function(e, t) {
-                        return s(e, 12 * t)
-                    },
-                    getYearDistance: function(e, t) {
-                        return t.getFullYear() - e.getFullYear()
-                    },
-                    clampDate: function(e, t, n) {
-                        var r = e;
-                        return t && e < t && (r = new Date(t.getTime())), n && n < e && (r = new Date(n.getTime())), r
-                    },
-                    getTimestampFromNode: function(e) {
-                        if (e && e.hasAttribute("data-timestamp")) return Number(e.getAttribute("data-timestamp"))
-                    },
-                    isMonthWithinRange: function(e, t, n) {
-                        var r = e.getMonth(),
-                            i = e.getFullYear();
-                        return (!t || t.getFullYear() < i || t.getMonth() <= r) && (!n || n.getFullYear() > i || n.getMonth() >= r)
-                    }
-                };
-
-                function n(e) {
-                    return new Date(e.getFullYear(), e.getMonth(), 1)
-                }
-
-                function i(e) {
-                    return new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate()
-                }
-
-                function r(e) {
-                    return new Date(e.getFullYear(), e.getMonth() + 1, 1)
-                }
-
-                function o(e) {
-                    return new Date(e.getFullYear(), e.getMonth() - 1, 1)
-                }
-
-                function a(e, t) {
-                    return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth()
-                }
-
-                function s(e, t) {
-                    var n = new Date(e.getFullYear(), e.getMonth() + t, 1),
-                        r = i(n);
-                    return r < e.getDate() ? n.setDate(r) : n.setDate(e.getDate()), n
-                }
-
-                function l(e) {
-                    return e && e.getTime && !isNaN(e.getTime())
-                }
-
-                function c(e) {
-                    l(e) && e.setHours(0, 0, 0, 0)
-                }
-
-                function u(e) {
-                    var t;
-                    return c(t = se.isUndefined(e) ? new Date : new Date(e)), t
-                }
-            }),
-            function() {
-                function e(a, d, f, h) {
-                    return {
-                        template: function(e, t) {
-                            var n = t.mdHideIcons,
-                                r = t.ariaLabel || t.mdPlaceholder,
-                                i = "all" === n || "calendar" === n ? "" : '<md-button class="md-datepicker-button md-icon-button" type="button" tabindex="-1" aria-hidden="true" ng-click="ctrl.openCalendarPane($event)"><md-icon class="md-datepicker-calendar-icon" aria-label="md-calendar" md-svg-src="' + a.mdCalendar + '"></md-icon></md-button>',
-                                o = "";
-                            return "all" !== n && "triangle" !== n && (o = '<md-button type="button" md-no-ink class="md-datepicker-triangle-button md-icon-button" ng-click="ctrl.openCalendarPane($event)" aria-label="{{::ctrl.locale.msgOpenCalendar}}"><div class="md-datepicker-expand-triangle"></div></md-button>', e.addClass(s)), i + '<div class="md-datepicker-input-container" ng-class="{\'md-datepicker-focused\': ctrl.isFocused}"><input ' + (r ? 'aria-label="' + r + '" ' : "") + 'class="md-datepicker-input" aria-haspopup="true" aria-expanded="{{ctrl.isCalendarOpen}}" ng-focus="ctrl.setFocused(true)" ng-blur="ctrl.setFocused(false)"> ' + o + '</div><div class="md-datepicker-calendar-pane md-whiteframe-z1" id="{{::ctrl.calendarPaneId}}"><div class="md-datepicker-input-mask"><div class="md-datepicker-input-mask-opaque"></div></div><div class="md-datepicker-calendar"><md-calendar role="dialog" aria-label="{{::ctrl.locale.msgCalendar}}" md-current-view="{{::ctrl.currentView}}" md-mode="{{::ctrl.mode}}" md-min-date="ctrl.minDate" md-max-date="ctrl.maxDate" md-date-filter="ctrl.dateFilter" ng-model="ctrl.date" ng-if="ctrl.isCalendarOpen"></md-calendar></div></div>'
-                        },
-                        require: ["ngModel", "mdDatepicker", "?^mdInputContainer", "?^form"],
-                        scope: {
-                            minDate: "=mdMinDate",
-                            maxDate: "=mdMaxDate",
-                            placeholder: "@mdPlaceholder",
-                            currentView: "@mdCurrentView",
-                            mode: "@mdMode",
-                            dateFilter: "=mdDateFilter",
-                            isOpen: "=?mdIsOpen",
-                            debounceInterval: "=mdDebounceInterval",
-                            dateLocale: "=mdDateLocale"
-                        },
-                        controller: t,
-                        controllerAs: "ctrl",
-                        bindToController: !0,
-                        link: function(e, t, n, r) {
-                            var i = r[0],
-                                o = r[1],
-                                a = r[2],
-                                s = r[3],
-                                l = d.parseAttributeBoolean(n.mdNoAsterisk);
-                            if (o.configureNgModel(i, a, h), a) {
-                                var c = t[0].querySelector(".md-errors-spacer");
-                                c && t.after(se.element("<div>").append(c)), a.setHasPlaceholder(n.mdPlaceholder), a.input = t, a.element.addClass(p).toggleClass(m, "calendar" !== n.mdHideIcons && "all" !== n.mdHideIcons), a.label ? l || n.$observe("required", function(e) {
-                                    a.label.toggleClass("md-required", !!e)
-                                }) : f.expect(t, "aria-label", n.mdPlaceholder), e.$watch(a.isErrorGetter || function() {
-                                    return i.$invalid && (i.$touched || s && s.$submitted)
-                                }, a.setInvalid)
-                            } else if (s) var u = e.$watch(function() {
-                                return s.$submitted
-                            }, function(e) {
-                                e && (o.updateErrorState(), u())
-                            })
-                        }
-                    }
-                }
-                t.$inject = ["$scope", "$element", "$attrs", "$window", "$mdConstant", "$mdTheming", "$mdUtil", "$mdDateLocale", "$$mdDateUtil", "$$rAF", "$filter"], e.$inject = ["$$mdSvgRegistry", "$mdUtil", "$mdAria", "inputDirective"], se.module("material.components.datepicker").directive("mdDatepicker", e);
-                var i = "md-datepicker-invalid",
-                    d = "md-datepicker-open",
-                    p = "_md-datepicker-floating-label",
-                    m = "_md-datepicker-has-calendar-icon",
-                    s = "_md-datepicker-has-triangle-icon",
-                    f = /ipad|iphone|ipod|android/i;
-
-                function t(e, t, n, r, i, o, a, s, l, c, u) {
-                    this.$window = r, this.dateUtil = l, this.$mdConstant = i, this.$mdUtil = a, this.$$rAF = c, this.$mdDateLocale = s, this.documentElement = se.element(document.documentElement), this.ngModelCtrl = null, this.inputElement = t[0].querySelector("input"), this.ngInputElement = se.element(this.inputElement), this.inputContainer = t[0].querySelector(".md-datepicker-input-container"), this.calendarPane = t[0].querySelector(".md-datepicker-calendar-pane"), this.calendarButton = t[0].querySelector(".md-datepicker-button"), this.inputMask = se.element(t[0].querySelector(".md-datepicker-input-mask-opaque")), this.$element = t, this.$attrs = n, this.$scope = e, this.date = null, this.isFocused = !1, this.isDisabled, this.setDisabled(t[0].disabled || se.isString(n.disabled)), this.isCalendarOpen = !1, this.openOnFocus = n.hasOwnProperty("mdOpenOnFocus"), this.mdInputContainer = null, this.calendarPaneOpenedFrom = null, this.calendarPaneId = "md-date-pane-" + a.nextUid(), this.bodyClickHandler = se.bind(this, this.handleBodyClick), this.windowEventName = f.test(navigator.userAgent || navigator.vendor || F.opera) ? "orientationchange" : "resize", this.windowEventHandler = a.debounce(se.bind(this, this.closeCalendarPane), 100), this.windowBlurHandler = se.bind(this, this.handleWindowBlur), this.ngDateFilter = u("date"), this.leftMargin = 20, this.topMargin = null, n.tabindex ? (this.ngInputElement.attr("tabindex", n.tabindex), n.$set("tabindex", null)) : n.$set("tabindex", "-1"), n.$set("aria-owns", this.calendarPaneId), o(t), o(se.element(this.calendarPane));
-                    var d = this;
-                    e.$on("$destroy", function() {
-                        d.detachCalendarPane()
-                    }), n.mdIsOpen && e.$watch("ctrl.isOpen", function(e) {
-                        e ? d.openCalendarPane({
-                            target: d.inputElement
-                        }) : d.closeCalendarPane()
-                    }), 1 === se.version.major && se.version.minor <= 4 && this.$onInit()
-                }
-                t.prototype.$onInit = function() {
-                    this.locale = this.dateLocale ? se.extend({}, this.$mdDateLocale, this.dateLocale) : this.$mdDateLocale, this.installPropertyInterceptors(), this.attachChangeListeners(), this.attachInteractionListeners()
-                }, t.prototype.configureNgModel = function(e, t, n) {
-                    this.ngModelCtrl = e, this.mdInputContainer = t, this.$attrs.$set("type", "date"), n[0].link.pre(this.$scope, {
-                        on: se.noop,
-                        val: se.noop,
-                        0: {}
-                    }, this.$attrs, [e]);
-                    var r = this;
-                    r.ngModelCtrl.$formatters.push(function(e) {
-                        var t = se.isDefined(e) ? e : null;
-                        if (!(e instanceof Date) && (t = Date.parse(e), !isNaN(t) && se.isNumber(t) && (e = new Date(t)), e && !(e instanceof Date))) throw Error("The ng-model for md-datepicker must be a Date instance or a value that can be parsed into a date. Currently the model is of type: " + typeof e);
-                        return r.onExternalChange(e), e
-                    }), e.$viewChangeListeners.unshift(se.bind(this, this.updateErrorState));
-                    var i = r.$mdUtil.getModelOption(e, "updateOn");
-                    i && this.ngInputElement.on(i, se.bind(this.$element, this.$element.triggerHandler, i))
-                }, t.prototype.attachChangeListeners = function() {
-                    var n = this;
-                    n.$scope.$on("md-calendar-change", function(e, t) {
-                        n.setModelValue(t), n.onExternalChange(t), n.closeCalendarPane()
-                    }), n.ngInputElement.on("input", se.bind(n, n.resizeInputElement));
-                    var e = se.isDefined(this.debounceInterval) ? this.debounceInterval : 500;
-                    n.ngInputElement.on("input", n.$mdUtil.debounce(n.handleInputEvent, e, n))
-                }, t.prototype.attachInteractionListeners = function() {
-                    var t = this,
-                        n = this.$scope,
-                        r = this.$mdConstant.KEY_CODE;
-                    t.ngInputElement.on("keydown", function(e) {
-                        e.altKey && e.keyCode == r.DOWN_ARROW && (t.openCalendarPane(e), n.$digest())
-                    }), t.openOnFocus && (t.ngInputElement.on("focus", se.bind(t, t.openCalendarPane)), se.element(t.$window).on("blur", t.windowBlurHandler), n.$on("$destroy", function() {
-                        se.element(t.$window).off("blur", t.windowBlurHandler)
-                    })), n.$on("md-calendar-close", function() {
-                        t.closeCalendarPane()
-                    })
-                }, t.prototype.installPropertyInterceptors = function() {
-                    var t = this;
-                    if (this.$attrs.ngDisabled) {
-                        var e = this.$scope.$parent;
-                        e && e.$watch(this.$attrs.ngDisabled, function(e) {
-                            t.setDisabled(e)
-                        })
-                    }
-                    Object.defineProperty(this, "placeholder", {
-                        get: function() {
-                            return t.inputElement.placeholder
-                        },
-                        set: function(e) {
-                            t.inputElement.placeholder = e || ""
-                        }
-                    })
-                }, t.prototype.setDisabled = function(e) {
-                    this.isDisabled = e, this.inputElement.disabled = e, this.calendarButton && (this.calendarButton.disabled = e)
-                }, t.prototype.updateErrorState = function(e) {
-                    var t = e || this.date;
-                    if (this.clearErrorState(), this.dateUtil.isValidDate(t)) {
-                        if (t = this.dateUtil.createDateAtMidnight(t), this.dateUtil.isValidDate(this.minDate)) {
-                            var n = this.dateUtil.createDateAtMidnight(this.minDate);
-                            this.ngModelCtrl.$setValidity("mindate", n <= t)
-                        }
-                        if (this.dateUtil.isValidDate(this.maxDate)) {
-                            var r = this.dateUtil.createDateAtMidnight(this.maxDate);
-                            this.ngModelCtrl.$setValidity("maxdate", t <= r)
-                        }
-                        se.isFunction(this.dateFilter) && this.ngModelCtrl.$setValidity("filtered", this.dateFilter(t))
-                    } else this.ngModelCtrl.$setValidity("valid", null == t);
-                    se.element(this.inputContainer).toggleClass(i, !this.ngModelCtrl.$valid)
-                }, t.prototype.clearErrorState = function() {
-                    this.inputContainer.classList.remove(i), ["mindate", "maxdate", "filtered", "valid"].forEach(function(e) {
-                        this.ngModelCtrl.$setValidity(e, !0)
-                    }, this)
-                }, t.prototype.resizeInputElement = function() {
-                    this.inputElement.size = this.inputElement.value.length + 3
-                }, t.prototype.handleInputEvent = function() {
-                    var e = this.inputElement.value,
-                        t = e ? this.locale.parseDate(e) : null;
-                    this.dateUtil.setDateTimeToMidnight(t), ("" == e || this.dateUtil.isValidDate(t) && this.locale.isDateComplete(e) && this.isDateEnabled(t)) && (this.setModelValue(t), this.date = t), this.updateErrorState(t)
-                }, t.prototype.isDateEnabled = function(e) {
-                    return this.dateUtil.isDateWithinRange(e, this.minDate, this.maxDate) && (!se.isFunction(this.dateFilter) || this.dateFilter(e))
-                }, t.prototype.attachCalendarPane = function() {
-                    var e = this.calendarPane,
-                        t = document.body;
-                    e.style.transform = "", this.$element.addClass(d), this.mdInputContainer && this.mdInputContainer.element.addClass(d), se.element(t).addClass("md-datepicker-is-showing");
-                    var n = this.inputContainer.getBoundingClientRect(),
-                        r = t.getBoundingClientRect();
-                    (!this.topMargin || this.topMargin < 0) && (this.topMargin = (this.inputMask.parent().prop("clientHeight") - this.ngInputElement.prop("clientHeight")) / 2);
-                    var i = n.top - r.top - this.topMargin,
-                        o = n.left - r.left - this.leftMargin,
-                        a = r.top < 0 && 0 == document.body.scrollTop ? -r.top : document.body.scrollTop,
-                        s = r.left < 0 && 0 == document.body.scrollLeft ? -r.left : document.body.scrollLeft,
-                        l = a + this.$window.innerHeight,
-                        c = s + this.$window.innerWidth;
-                    if (this.inputMask.css({
-                            position: "absolute",
-                            left: this.leftMargin + "px",
-                            top: this.topMargin + "px",
-                            width: n.width - 1 + "px",
-                            height: n.height - 2 + "px"
-                        }), c < o + 360) {
-                        if (0 < c - 360) o = c - 360;
-                        else {
-                            o = s;
-                            var u = this.$window.innerWidth / 360;
-                            e.style.transform = "scale(" + u + ")"
-                        }
-                        e.classList.add("md-datepicker-pos-adjusted")
-                    }
-                    l < i + 368 && a < l - 368 && (i = l - 368, e.classList.add("md-datepicker-pos-adjusted")), e.style.left = o + "px", e.style.top = i + "px", document.body.appendChild(e), this.$$rAF(function() {
-                        e.classList.add("md-pane-open")
-                    })
-                }, t.prototype.detachCalendarPane = function() {
-                    this.$element.removeClass(d), this.mdInputContainer && this.mdInputContainer.element.removeClass(d), se.element(document.body).removeClass("md-datepicker-is-showing"), this.calendarPane.classList.remove("md-pane-open"), this.calendarPane.classList.remove("md-datepicker-pos-adjusted"), this.isCalendarOpen && this.$mdUtil.enableScrolling(), this.calendarPane.parentNode && this.calendarPane.parentNode.removeChild(this.calendarPane)
-                }, t.prototype.openCalendarPane = function(e) {
-                    if (!this.isCalendarOpen && !this.isDisabled && !this.inputFocusedOnWindowBlur) {
-                        this.isCalendarOpen = this.isOpen = !0, this.calendarPaneOpenedFrom = e.target, this.$mdUtil.disableScrollAround(this.calendarPane), this.attachCalendarPane(), this.focusCalendar(), this.evalAttr("ngFocus");
-                        var t = this;
-                        this.$mdUtil.nextTick(function() {
-                            t.documentElement.on("click touchstart", t.bodyClickHandler)
-                        }, !1), F.addEventListener(this.windowEventName, this.windowEventHandler)
-                    }
-                }, t.prototype.closeCalendarPane = function() {
-                    if (this.isCalendarOpen) {
-                        var e = this;
-                        e.detachCalendarPane(), e.ngModelCtrl.$setTouched(), e.evalAttr("ngBlur"), e.documentElement.off("click touchstart", e.bodyClickHandler), F.removeEventListener(e.windowEventName, e.windowEventHandler), e.calendarPaneOpenedFrom.focus(), e.calendarPaneOpenedFrom = null, e.openOnFocus ? e.$mdUtil.nextTick(t) : t()
-                    }
-
-                    function t() {
-                        e.isCalendarOpen = e.isOpen = !1
-                    }
-                }, t.prototype.getCalendarCtrl = function() {
-                    return se.element(this.calendarPane.querySelector("md-calendar")).controller("mdCalendar")
-                }, t.prototype.focusCalendar = function() {
-                    var e = this;
-                    this.$mdUtil.nextTick(function() {
-                        e.getCalendarCtrl().focus()
-                    }, !1)
-                }, t.prototype.setFocused = function(e) {
-                    e || this.ngModelCtrl.$setTouched(), this.openOnFocus || this.evalAttr(e ? "ngFocus" : "ngBlur"), this.isFocused = e
-                }, t.prototype.handleBodyClick = function(e) {
-                    this.isCalendarOpen && (this.$mdUtil.getClosest(e.target, "md-calendar") || this.closeCalendarPane(), this.$scope.$digest())
-                }, t.prototype.handleWindowBlur = function() {
-                    this.inputFocusedOnWindowBlur = document.activeElement === this.inputElement
-                }, t.prototype.evalAttr = function(e) {
-                    this.$attrs[e] && this.$scope.$parent.$eval(this.$attrs[e])
-                }, t.prototype.setModelValue = function(e) {
-                    var t = this.$mdUtil.getModelOption(this.ngModelCtrl, "timezone");
-                    this.ngModelCtrl.$setViewValue(this.ngDateFilter(e, "yyyy-MM-dd", t))
-                }, t.prototype.onExternalChange = function(e) {
-                    var t = this.$mdUtil.getModelOption(this.ngModelCtrl, "timezone");
-                    this.date = e, this.inputElement.value = this.locale.formatDate(e, t), this.mdInputContainer && this.mdInputContainer.setHasValue(!!e), this.resizeInputElement(), this.updateErrorState()
-                }
-            }(), se.module("material.components.icon").directive("mdIcon", ["$mdIcon", "$mdTheming", "$mdAria", "$sce", function(l, c, u, e) {
-                return {
-                    restrict: "E",
-                    link: function(e, t, n) {
-                        c(t);
-                        var r = n.mdFontIcon,
-                            i = l.fontSet(n.mdFontSet);
-                        n.mdSvgIcon || n.mdSvgSrc || (n.mdFontIcon && t.addClass("md-font " + n.mdFontIcon), t.addClass(i)), n.$observe("mdFontIcon", s), n.$observe("mdFontSet", s), t[0].getAttribute(n.$attr.mdSvgSrc);
-                        var o, a = n.$normalize(n.$attr.mdSvgIcon || n.$attr.mdSvgSrc || "");
-
-                        function s() {
-                            if (!n.mdSvgIcon && !n.mdSvgSrc) {
-                                n.mdFontIcon && (t.removeClass(r), t.addClass(n.mdFontIcon), r = n.mdFontIcon);
-                                var e = l.fontSet(n.mdFontSet);
-                                i !== e && (t.removeClass(i), t.addClass(e), i = e)
-                            }
-                        }
-                        n.role || (u.expect(t, "role", "img"), n.role = "img"), "img" !== n.role || n.ariaHidden || u.hasAriaLabel(t) || (n.alt ? u.expect(t, "aria-label", n.alt) : u.parentHasAriaLabel(t, 2) ? u.expect(t, "aria-hidden", "true") : (o = n.mdFontIcon || n.mdSvgIcon || t.text()) ? u.expect(t, "aria-label", o) : u.expect(t, "aria-hidden", "true")), a && n.$observe(a, function(e) {
-                            t.empty(), e && l(e).then(function(e) {
-                                t.empty(), t.append(e)
-                            })
-                        })
-                    }
-                }
-            }]),
-            function() {
-                a.$inject = ["config", "$templateRequest", "$q", "$log", "$mdUtil", "$sce"], se.module("material.components.icon").constant("$$mdSvgRegistry", {
-                    mdTabsArrow: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTUuNCw3LjQgMTQsNiA4LDEyIDE0LDE4IDE1LjQsMTYuNiAxMC44LDEyICIvPjwvZz48L3N2Zz4=",
-                    mdClose: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik0xOSA2LjQxbC0xLjQxLTEuNDEtNS41OSA1LjU5LTUuNTktNS41OS0xLjQxIDEuNDEgNS41OSA1LjU5LTUuNTkgNS41OSAxLjQxIDEuNDEgNS41OS01LjU5IDUuNTkgNS41OSAxLjQxLTEuNDEtNS41OS01LjU5eiIvPjwvZz48L3N2Zz4=",
-                    mdCancel: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik0xMiAyYy01LjUzIDAtMTAgNC40Ny0xMCAxMHM0LjQ3IDEwIDEwIDEwIDEwLTQuNDcgMTAtMTAtNC40Ny0xMC0xMC0xMHptNSAxMy41OWwtMS40MSAxLjQxLTMuNTktMy41OS0zLjU5IDMuNTktMS40MS0xLjQxIDMuNTktMy41OS0zLjU5LTMuNTkgMS40MS0xLjQxIDMuNTkgMy41OSAzLjU5LTMuNTkgMS40MSAxLjQxLTMuNTkgMy41OSAzLjU5IDMuNTl6Ii8+PC9nPjwvc3ZnPg==",
-                    mdMenu: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0zLDZIMjFWOEgzVjZNMywxMUgyMVYxM0gzVjExTTMsMTZIMjFWMThIM1YxNloiIC8+PC9zdmc+",
-                    mdToggleArrow: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNDggNDgiPjxwYXRoIGQ9Ik0yNCAxNmwtMTIgMTIgMi44MyAyLjgzIDkuMTctOS4xNyA5LjE3IDkuMTcgMi44My0yLjgzeiIvPjxwYXRoIGQ9Ik0wIDBoNDh2NDhoLTQ4eiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==",
-                    mdCalendar: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgM2gtMVYxaC0ydjJIOFYxSDZ2Mkg1Yy0xLjExIDAtMS45OS45LTEuOTkgMkwzIDE5YzAgMS4xLjg5IDIgMiAyaDE0YzEuMSAwIDItLjkgMi0yVjVjMC0xLjEtLjktMi0yLTJ6bTAgMTZINVY4aDE0djExek03IDEwaDV2NUg3eiIvPjwvc3ZnPg==",
-                    mdChecked: "data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxnPjxwYXRoIGQ9Ik05IDE2LjE3TDQuODMgMTJsLTEuNDIgMS40MUw5IDE5IDIxIDdsLTEuNDEtMS40MXoiLz48L2c+PC9zdmc+"
-                }).provider("$mdIcon", e);
-                var o = {
-                    defaultViewBoxSize: 24,
-                    defaultFontSet: "material-icons",
-                    fontSets: []
-                };
-
-                function e() {}
-
-                function r(e, t) {
-                    this.url = e, this.viewBoxSize = t || o.defaultViewBoxSize
-                }
-
-                function a(a, o, s, l, r, t) {
-                    var i = {},
-                        c = {},
-                        n = /[-\w@:%+.~#?&//=]{2,}\.[a-z]{2,4}\b(\/[-\w@:%+.~#?&//=]*)?/i,
-                        u = /^data:image\/svg\+xml[\s*;\w\-=]*?(base64)?,(.*)$/i;
-                    return m.prototype = {
-                        clone: function() {
-                            return this.element.cloneNode(!0)
-                        },
-                        prepare: function() {
-                            var e = this.config ? this.config.viewBoxSize : a.defaultViewBoxSize;
-                            se.forEach({
-                                fit: "",
-                                height: "100%",
-                                width: "100%",
-                                preserveAspectRatio: "xMidYMid meet",
-                                viewBox: this.element.getAttribute("viewBox") || "0 0 " + e + " " + e,
-                                focusable: !1
-                            }, function(e, t) {
-                                this.element.setAttribute(t, e)
-                            }, this)
-                        }
-                    }, e.fontSet = function(t) {
-                        if (se.isUndefined(t) || !t || !t.length) return a.defaultFontSet;
-                        var n = t;
-                        return se.forEach(a.fontSets, function(e) {
-                            e.alias == t && (n = e.fontSet || n)
-                        }), n
-                    }, e;
-
-                    function e(e) {
-                        return e = e || "", se.isString(e) || (e = t.getTrustedUrl(e)), i[e] ? s.when(function(e) {
-                            var t = e.clone(),
-                                n = "_cache" + r.nextUid();
-                            t.id && (t.id += n);
-                            return se.forEach(t.querySelectorAll("[id]"), function(e) {
-                                e.id += n
-                            }), t
-                        }(i[e])) : n.test(e) || u.test(e) ? p(e).then(d(e)) : (-1 == e.indexOf(":") && (e = "$default:" + e), (a[e] ? f : h)(e).then(d(e)))
-                    }
-
-                    function d(n) {
-                        return function(e) {
-                            var t;
-                            return i[n] = (t = e, se.isDefined(t.element) && se.isDefined(t.config) ? e : new m(e, a[n])), i[n].clone()
-                        }
-                    }
-
-                    function f(e) {
-                        var t = a[e];
-                        return p(t.url).then(function(e) {
-                            return new m(e, t)
-                        })
-                    }
-
-                    function h(r) {
-                        var e = r.substring(0, r.lastIndexOf(":")) || "$default",
-                            i = a[e];
-                        return i ? p(i.url).then(function(e) {
-                            var t = r.slice(r.lastIndexOf(":") + 1),
-                                n = e.querySelector("#" + t);
-                            return n ? new m(n, i) : o(r)
-                        }) : o(r);
-
-                        function o(e) {
-                            var t = "icon " + e + " not found";
-                            return l.warn(t), s.reject(t || e)
-                        }
-                    }
-
-                    function p(e) {
-                        return u.test(e) ? (t = e, n = u.exec(t), i = /base64/i.test(t) ? F.atob(n[2]) : n[2], s.when(se.element(i)[0])) : (r = e, s(function(t, n) {
-                            o(r, !0).then(function(e) {
-                                c[r] || (c[r] = se.element("<div>").append(e)[0].querySelector("svg")), t(c[r])
-                            }, function(e) {
-                                var t = se.isString(e) ? e : e.message || e.data || e.statusText;
-                                l.warn(t), n(e)
-                            })
-                        }));
-                        var r, t, n, i
-                    }
-
-                    function m(e, t) {
-                        if (e && "symbol" === e.tagName.toLowerCase()) {
-                            var n = e.getAttribute("viewBox");
-                            e = se.element('<svg xmlns="http://www.w3.org/2000/svg">').html(e.innerHTML)[0], n && e.setAttribute("viewBox", n)
-                        }
-                        e && "svg" !== e.tagName.toLowerCase() && (e = se.element('<svg xmlns="http://www.w3.org/2000/svg">').append(e.cloneNode(!0))[0]), e.getAttribute("xmlns") || e.setAttribute("xmlns", "http://www.w3.org/2000/svg"), this.element = e, this.config = t, this.prepare()
-                    }
-                }
-                e.prototype = {
-                    icon: function(e, t, n) {
-                        return -1 == e.indexOf(":") && (e = "$default:" + e), o[e] = new r(t, n), this
-                    },
-                    iconSet: function(e, t, n) {
-                        return o[e] = new r(t, n), this
-                    },
-                    defaultIconSet: function(e, t) {
-                        var n = "$default";
-                        return o[n] || (o[n] = new r(e, t)), o[n].viewBoxSize = t || o.defaultViewBoxSize, this
-                    },
-                    defaultViewBoxSize: function(e) {
-                        return o.defaultViewBoxSize = e, this
-                    },
-                    fontSet: function(e, t) {
-                        return o.fontSets.push({
-                            alias: e,
-                            fontSet: t || e
-                        }), this
-                    },
-                    defaultFontSet: function(e) {
-                        return o.defaultFontSet = e || "", this
-                    },
-                    defaultIconSize: function(e) {
-                        return o.defaultIconSize = e, this
-                    },
-                    $get: ["$templateRequest", "$q", "$log", "$mdUtil", "$sce", function(e, t, n, r, i) {
-                        return a(o, e, t, n, r, i)
-                    }]
-                }
-            }(),
-            function() {
-                function e(i, t, o, a, s, r, e, n, l) {
-                    var c, u, d = s.prefixer(),
-                        f = this;
-                    this.nestLevel = parseInt(t.mdNestLevel, 10) || 0, this.init = function(e, t) {
-                        t = t || {}, c = e, (u = o[0].querySelector(d.buildSelector(["ng-click", "ng-mouseenter"]))).setAttribute("aria-expanded", "false"), this.isInMenuBar = t.isInMenuBar, this.nestedMenus = s.nodesToArray(c[0].querySelectorAll(".md-nested-menu")), c.on("$mdInterimElementRemove", function() {
-                            f.isOpen = !1, s.nextTick(function() {
-                                f.onIsOpenChanged(f.isOpen)
-                            })
-                        }), s.nextTick(function() {
-                            f.onIsOpenChanged(f.isOpen)
-                        });
-                        var n = "menu_container_" + s.nextUid();
-                        c.attr("id", n), se.element(u).attr({
-                            "aria-owns": n,
-                            "aria-haspopup": "true"
-                        }), a.$on("$destroy", se.bind(this, function() {
-                            this.disableHoverListener(), i.destroy()
-                        })), c.on("$destroy", function() {
-                            i.destroy()
-                        })
-                    };
-                    var h, p, m = [];
-                    this.enableHoverListener = function() {
-                        m.push(e.$on("$mdMenuOpen", function(e, t) {
-                            c[0].contains(t[0]) && (f.currentlyOpenMenu = t.controller("mdMenu"), f.isAlreadyOpening = !1, f.currentlyOpenMenu.registerContainerProxy(f.triggerContainerProxy.bind(f)))
-                        })), m.push(e.$on("$mdMenuClose", function(e, t) {
-                            c[0].contains(t[0]) && (f.currentlyOpenMenu = le)
-                        })), (p = se.element(s.nodesToArray(c[0].children[0].children))).on("mouseenter", f.handleMenuItemHover), p.on("mouseleave", f.handleMenuItemMouseLeave)
-                    }, this.disableHoverListener = function() {
-                        for (; m.length;) m.shift()();
-                        p && p.off("mouseenter", f.handleMenuItemHover), p && p.off("mouseleave", f.handleMenuItemMouseLeave)
-                    }, this.handleMenuItemHover = function(e) {
-                        if (!f.isAlreadyOpening) {
-                            var t = e.target.querySelector("md-menu") || s.getClosest(e.target, "MD-MENU");
-                            h = r(function() {
-                                if (t && (t = se.element(t).controller("mdMenu")), f.currentlyOpenMenu && f.currentlyOpenMenu != t) {
-                                    var e = f.nestLevel + 1;
-                                    f.currentlyOpenMenu.close(!0, {
-                                        closeTo: e
-                                    }), f.isAlreadyOpening = !!t, t && t.open()
-                                } else t && !t.isOpen && t.open && (f.isAlreadyOpening = !!t, t && t.open())
-                            }, t ? 100 : 250);
-                            var n = e.currentTarget.querySelector(".md-button:not([disabled])");
-                            n && n.focus()
-                        }
-                    }, this.handleMenuItemMouseLeave = function() {
-                        h && (r.cancel(h), h = le)
-                    }, this.open = function(e) {
-                        e && e.stopPropagation(), e && e.preventDefault(), f.isOpen || (f.enableHoverListener(), f.isOpen = !0, s.nextTick(function() {
-                            f.onIsOpenChanged(f.isOpen)
-                        }), (u = u || (e ? e.target : o[0])).setAttribute("aria-expanded", "true"), a.$emit("$mdMenuOpen", o), i.show({
-                            scope: a,
-                            mdMenuCtrl: f,
-                            nestLevel: f.nestLevel,
-                            element: c,
-                            target: u,
-                            preserveElement: !0,
-                            parent: "body"
-                        }).finally(function() {
-                            u.setAttribute("aria-expanded", "false"), f.disableHoverListener()
-                        }))
-                    }, this.onIsOpenChanged = function(e) {
-                        e ? (c.attr("aria-hidden", "false"), o[0].classList.add("md-open"), se.forEach(f.nestedMenus, function(e) {
-                            e.classList.remove("md-open")
-                        })) : (c.attr("aria-hidden", "true"), o[0].classList.remove("md-open")), a.$mdMenuIsOpen = f.isOpen
-                    }, this.focusMenuContainer = function() {
-                        var e = c[0].querySelector(d.buildSelector(["md-menu-focus-target", "md-autofocus"]));
-                        e || (e = c[0].querySelector(".md-button:not([disabled])")), e.focus()
-                    }, this.registerContainerProxy = function(e) {
-                        this.containerProxy = e
-                    }, this.triggerContainerProxy = function(e) {
-                        this.containerProxy && this.containerProxy(e)
-                    }, this.destroy = function() {
-                        return f.isOpen ? i.destroy() : n.when(!1)
-                    }, this.close = function(e, t) {
-                        if (f.isOpen) {
-                            f.isOpen = !1, s.nextTick(function() {
-                                f.onIsOpenChanged(f.isOpen)
-                            });
-                            var n = se.extend({}, t, {
-                                skipFocus: e
-                            });
-                            if (a.$emit("$mdMenuClose", o, n), i.hide(null, t), !e) {
-                                var r = f.restoreFocusTo || o.find("button")[0];
-                                r instanceof se.element && (r = r[0]), r && r.focus()
-                            }
-                        }
-                    }, this.positionMode = function() {
-                        var e = (t.mdPositionMode || "target").split(" ");
-                        return 1 === e.length && e.push(e[0]), {
-                            left: e[0],
-                            top: e[1]
-                        }
-                    }, this.offsets = function() {
-                        var e = (t.mdOffset || "0 0").split(" ").map(parseFloat);
-                        if (2 === e.length) return {
-                            left: e[0],
-                            top: e[1]
-                        };
-                        if (1 === e.length) return {
-                            top: e[0],
-                            left: e[0]
-                        };
-                        throw Error("Invalid offsets specified. Please follow format <x, y> or <n>")
-                    }, a.$mdMenu = {
-                        open: this.open,
-                        close: this.close
-                    }, a.$mdOpenMenu = se.bind(this, function() {
-                        return l.warn("mdMenu: The $mdOpenMenu method is deprecated. Please use `$mdMenu.open`."), this.open.apply(this, arguments)
-                    })
-                }
-                e.$inject = ["$mdMenu", "$attrs", "$element", "$scope", "$mdUtil", "$timeout", "$rootScope", "$q", "$log"], se.module("material.components.menu").controller("mdMenuCtrl", e)
-            }(),
-            function() {
-                function e(a) {
-                    var s = "Invalid HTML for md-menu: ";
-                    return {
-                        restrict: "E",
-                        require: ["mdMenu", "?^mdMenuBar"],
-                        controller: "mdMenuCtrl",
-                        scope: !0,
-                        compile: function(e) {
-                            e.addClass("md-menu");
-                            var t = e.children()[0],
-                                n = a.prefixer();
-                            n.hasAttribute(t, "ng-click") || (t = t.querySelector(n.buildSelector(["ng-click", "ng-mouseenter"])) || t);
-                            var r = "MD-BUTTON" === t.nodeName || "BUTTON" === t.nodeName;
-                            t && r && !t.hasAttribute("type") && t.setAttribute("type", "button");
-                            if (!t) throw Error(s + "Expected the menu to have a trigger element.");
-                            if (2 !== e.children().length) throw Error(s + "Expected two children elements. The second element must have a `md-menu-content` element.");
-                            t && t.setAttribute("aria-haspopup", "true");
-                            var i = e[0].querySelectorAll("md-menu"),
-                                o = parseInt(e[0].getAttribute("md-nest-level"), 10) || 0;
-                            i && se.forEach(a.nodesToArray(i), function(e) {
-                                e.hasAttribute("md-position-mode") || e.setAttribute("md-position-mode", "cascade"), e.classList.add("_md-nested-menu"), e.setAttribute("md-nest-level", o + 1)
-                            });
-                            return l
-                        }
-                    };
-
-                    function l(e, t, n, r) {
-                        var i = r[0],
-                            o = !!r[1],
-                            a = se.element('<div class="_md md-open-menu-container md-whiteframe-z2"></div>'),
-                            s = t.children()[1];
-                        t.addClass("_md"), s.hasAttribute("role") || s.setAttribute("role", "menu"), a.append(s), t.on("$destroy", function() {
-                            a.remove()
-                        }), t.append(a), a[0].style.display = "none", i.init(a, {
-                            isInMenuBar: o
-                        })
-                    }
-                }
-                e.$inject = ["$mdUtil"], se.module("material.components.menu").directive("mdMenu", e)
-            }(),
-            function() {
-                function e(e) {
-                    t.$inject = ["$mdUtil", "$mdTheming", "$mdConstant", "$document", "$window", "$q", "$$rAF", "$animateCss", "$animate", "$log"];
-                    var x = 8;
-                    return e("$mdMenu").setDefaults({
-                        methods: ["target"],
-                        options: t
-                    });
-
-                    function t(w, c, u, E, C, d, f, h, p, m) {
-                        var k = w.prefixer(),
-                            g = w.dom.animator;
-                        return {
-                            parent: "body",
-                            onShow: function(a, n, s) {
-                                (function() {
-                                    if (!s.target) throw Error("$mdMenu.show() expected a target to animate from in options.target");
-                                    se.extend(s, {
-                                        alreadyOpen: !1,
-                                        isRemoved: !1,
-                                        target: se.element(s.target),
-                                        parent: se.element(s.parent),
-                                        menuContentEl: se.element(n[0].querySelector("md-menu-content"))
-                                    })
-                                })(), s.menuContentEl[0] ? c.inherit(s.menuContentEl, s.target) : m.warn("$mdMenu: Menu elements should always contain a `md-menu-content` element,otherwise interactivity features will not work properly.", n);
-                                return s.cleanupResizing = (r = n, i = s, o = f.throttle(function() {
-                                    if (!s.isRemoved) {
-                                        var e = b(r, i);
-                                        r.css(g.toCss(e))
-                                    }
-                                }), C.addEventListener("resize", o), C.addEventListener("orientationchange", o), function() {
-                                    C.removeEventListener("resize", o), C.removeEventListener("orientationchange", o)
-                                }), s.hideBackdrop = (e = a, t = s, t.nestLevel ? se.noop : (t.disableParentScroll && !w.getClosest(t.target, "MD-DIALOG") ? t.restoreScroll = w.disableScrollAround(t.element, t.parent) : t.disableParentScroll = !1, t.hasBackdrop && (t.backdrop = w.createBackdrop(e, "md-menu-backdrop md-click-catcher"), p.enter(t.backdrop, E[0].body)), function() {
-                                    t.backdrop && t.backdrop.remove(), t.disableParentScroll && t.restoreScroll()
-                                })), (s.parent.append(n), n[0].style.display = "", d(function(e) {
-                                    var t = b(n, s);
-                                    n.removeClass("md-leave"), h(n, {
-                                        addClass: "md-active",
-                                        from: g.toCss(t),
-                                        to: g.toCss({
-                                            transform: ""
-                                        })
-                                    }).start().then(e)
-                                })).then(function(e) {
-                                    return s.alreadyOpen = !0, s.cleanupInteraction = function() {
-                                        if (!s.menuContentEl[0]) return se.noop;
-                                        s.menuContentEl.on("keydown", i), s.menuContentEl[0].addEventListener("click", o, !0);
-                                        var e = s.menuContentEl[0].querySelector(k.buildSelector(["md-menu-focus-target", "md-autofocus"]));
-                                        if (!e)
-                                            for (var t = s.menuContentEl[0].children.length, n = 0; n < t; n++) {
-                                                var r = s.menuContentEl[0].children[n];
-                                                if (e = r.querySelector(".md-button:not([disabled])")) break;
-                                                if (r.firstElementChild && !r.firstElementChild.disabled) {
-                                                    e = r.firstElementChild;
-                                                    break
-                                                }
-                                            }
-                                        return e && e.focus(),
-                                            function() {
-                                                s.menuContentEl.off("keydown", i), s.menuContentEl[0].removeEventListener("click", o, !0)
-                                            };
-
-                                        function i(e) {
-                                            var t;
-                                            switch (e.keyCode) {
-                                                case u.KEY_CODE.ESCAPE:
-                                                    s.mdMenuCtrl.close(!1, {
-                                                        closeAll: !0
-                                                    }), t = !0;
-                                                    break;
-                                                case u.KEY_CODE.TAB:
-                                                    s.mdMenuCtrl.close(!1, {
-                                                        closeAll: !0
-                                                    }), t = !1;
-                                                    break;
-                                                case u.KEY_CODE.UP_ARROW:
-                                                    v(e, s.menuContentEl, s, -1) || s.nestLevel || s.mdMenuCtrl.triggerContainerProxy(e), t = !0;
-                                                    break;
-                                                case u.KEY_CODE.DOWN_ARROW:
-                                                    v(e, s.menuContentEl, s, 1) || s.nestLevel || s.mdMenuCtrl.triggerContainerProxy(e), t = !0;
-                                                    break;
-                                                case u.KEY_CODE.LEFT_ARROW:
-                                                    s.nestLevel ? s.mdMenuCtrl.close() : s.mdMenuCtrl.triggerContainerProxy(e), t = !0;
-                                                    break;
-                                                case u.KEY_CODE.RIGHT_ARROW:
-                                                    var n = w.getClosest(e.target, "MD-MENU");
-                                                    n && n != s.parent[0] ? e.target.click() : s.mdMenuCtrl.triggerContainerProxy(e), t = !0
-                                            }
-                                            t && (e.preventDefault(), e.stopImmediatePropagation())
-                                        }
-
-                                        function o(e) {
-                                            var t = e.target;
-                                            do {
-                                                if (t == s.menuContentEl[0]) return;
-                                                if ((r(t, ["ng-click", "ng-href", "ui-sref"]) || "BUTTON" == t.nodeName || "MD-BUTTON" == t.nodeName) && !r(t, ["md-prevent-menu-close"])) {
-                                                    var n = w.getClosest(t, "MD-MENU");
-                                                    t.hasAttribute("disabled") || n && n != s.parent[0] || a.$apply(function() {
-                                                        s.mdMenuCtrl.close(!0, {
-                                                            closeAll: !0
-                                                        })
-                                                    });
-                                                    break
-                                                }
-                                            } while (t = t.parentNode);
-
-                                            function r(e, t) {
-                                                if (!e) return !1;
-                                                for (var n, r = 0; n = t[r]; ++r)
-                                                    if (k.hasAttribute(e, n)) return !0;
-                                                return !1
-                                            }
-                                        }
-                                    }(), s.cleanupBackdrop = s.backdrop ? (s.backdrop.on("click", l), function() {
-                                        s.backdrop.off("click", l)
-                                    }) : se.noop, n.addClass("md-clickable"), e
-                                });
-                                var e, t;
-                                var r, i, o;
-
-                                function l(e) {
-                                    e.preventDefault(), e.stopPropagation(), a.$apply(function() {
-                                        s.mdMenuCtrl.close(!0, {
-                                            closeAll: !0
-                                        })
-                                    })
-                                }
-                            },
-                            onRemove: function(e, n, r) {
-                                return r.cleanupInteraction(), r.cleanupBackdrop(), r.cleanupResizing(), r.hideBackdrop(), n.removeClass("md-clickable"), !0 === r.$destroy ? t() : h(n, {
-                                    addClass: "md-leave"
-                                }).start().then(t);
-
-                                function t() {
-                                    var e, t;
-                                    n.removeClass("md-active"), e = n, (t = r).preserveElement ? i(e).style.display = "none" : i(e).parentNode === i(t.parent) && i(t.parent).removeChild(i(e)), r.alreadyOpen = !1
-                                }
-                            },
-                            hasBackdrop: !0,
-                            disableParentScroll: !0,
-                            skipCompile: !0,
-                            preserveScope: !0,
-                            multiple: !0,
-                            themable: !0
-                        };
-
-                        function v(e, t, n, r) {
-                            for (var i, o = w.getClosest(e.target, "MD-MENU-ITEM"), a = w.nodesToArray(t[0].children), s = a.indexOf(o) + r; 0 <= s && s < a.length; s += r) {
-                                if (i = l(a[s].querySelector(".md-button"))) break
-                            }
-                            return i
-                        }
-
-                        function l(e) {
-                            if (e && -1 != e.getAttribute("tabindex")) return e.focus(), E[0].activeElement == e
-                        }
-
-                        function b(e, t) {
-                            var n, r = e[0],
-                                i = e[0].firstElementChild,
-                                o = i.getBoundingClientRect(),
-                                a = E[0].body.getBoundingClientRect(),
-                                s = C.getComputedStyle(i),
-                                l = t.target[0].querySelector(k.buildSelector("md-menu-origin")) || t.target[0],
-                                c = l.getBoundingClientRect(),
-                                u = {
-                                    left: a.left + x,
-                                    top: Math.max(a.top, 0) + x,
-                                    bottom: Math.max(a.bottom, Math.max(a.top, 0) + a.height) - x,
-                                    right: a.right - x
-                                },
-                                d = {
-                                    top: 0,
-                                    left: 0,
-                                    right: 0,
-                                    bottom: 0
-                                },
-                                f = {
-                                    top: 0,
-                                    left: 0,
-                                    right: 0,
-                                    bottom: 0
-                                },
-                                h = t.mdMenuCtrl.positionMode();
-                            "target" !== h.top && "target" !== h.left && "target-right" !== h.left || (n = function() {
-                                for (var e = 0; e < i.children.length; ++e)
-                                    if ("none" != C.getComputedStyle(i.children[e]).display) return i.children[e]
-                            }()) && (d = (n = (n = n.firstElementChild || n).querySelector(k.buildSelector("md-menu-align-target")) || n).getBoundingClientRect(), f = {
-                                top: parseFloat(r.style.top || 0),
-                                left: parseFloat(r.style.left || 0)
-                            });
-                            var p = {},
-                                m = "top ";
-                            switch (h.top) {
-                                case "target":
-                                    p.top = f.top + c.top - d.top;
-                                    break;
-                                case "cascade":
-                                    p.top = c.top - parseFloat(s.paddingTop) - l.style.top;
-                                    break;
-                                case "bottom":
-                                    p.top = c.top + c.height;
-                                    break;
-                                default:
-                                    throw new Error('Invalid target mode "' + h.top + '" specified for md-menu on Y axis.')
-                            }
-                            var g = "rtl" === w.bidi();
-                            switch (h.left) {
-                                case "target":
-                                    p.left = f.left + c.left - d.left, m += g ? "right" : "left";
-                                    break;
-                                case "target-left":
-                                    p.left = c.left, m += "left";
-                                    break;
-                                case "target-right":
-                                    p.left = c.right - o.width + (o.right - d.right), m += "right";
-                                    break;
-                                case "cascade":
-                                    var v = g ? c.left - o.width < u.left : c.right + o.width < u.right;
-                                    p.left = v ? c.right - l.style.left : c.left - l.style.left - o.width, m += v ? "left" : "right";
-                                    break;
-                                case "right":
-                                    g ? (p.left = c.right - c.width, m += "left") : (p.left = c.right - o.width, m += "right");
-                                    break;
-                                case "left":
-                                    g ? (p.left = c.right - o.width, m += "right") : (p.left = c.left, m += "left");
-                                    break;
-                                default:
-                                    throw new Error('Invalid target mode "' + h.left + '" specified for md-menu on X axis.')
-                            }
-                            var b, y = t.mdMenuCtrl.offsets();
-                            p.top += y.top, p.left += y.left, (b = p).top = Math.max(Math.min(b.top, u.bottom - r.offsetHeight), u.top), b.left = Math.max(Math.min(b.left, u.right - r.offsetWidth), u.left);
-                            var _ = Math.round(100 * Math.min(c.width / r.offsetWidth, 1)) / 100,
-                                $ = Math.round(100 * Math.min(c.height / r.offsetHeight, 1)) / 100;
-                            return {
-                                top: Math.round(p.top),
-                                left: Math.round(p.left),
-                                transform: t.alreadyOpen ? le : w.supplant("scale({0},{1})", [_, $]),
-                                transformOrigin: m
-                            }
-                        }
-                    }
-
-                    function i(e) {
-                        return e instanceof se.element && (e = e[0]), e
-                    }
-                }
-                e.$inject = ["$$interimElementProvider"], se.module("material.components.menu").provider("$mdMenu", e)
-            }(),
-            function() {
-                e.$inject = ["$scope", "$rootScope", "$element", "$attrs", "$mdConstant", "$document", "$mdUtil", "$timeout"], se.module("material.components.menuBar").controller("MenuBarController", e);
-                var c = ["handleKeyDown", "handleMenuHover", "scheduleOpenHoveredMenu", "cancelScheduledOpen"];
-
-                function e(e, t, n, r, i, o, a, s) {
-                    this.$element = n, this.$attrs = r, this.$mdConstant = i, this.$mdUtil = a, this.$document = o, this.$scope = e, this.$rootScope = t, this.$timeout = s;
-                    var l = this;
-                    se.forEach(c, function(e) {
-                        l[e] = se.bind(l, l[e])
-                    })
-                }
-                e.prototype.init = function() {
-                    var o = this.$element,
-                        a = this.$mdUtil,
-                        e = this.$scope,
-                        s = this,
-                        t = [];
-                    o.on("keydown", this.handleKeyDown), this.parentToolbar = a.getClosest(o, "MD-TOOLBAR"), t.push(this.$rootScope.$on("$mdMenuOpen", function(e, t) {
-                        -1 != s.getMenus().indexOf(t[0]) && (o[0].classList.add("md-open"), t[0].classList.add("md-open"), s.currentlyOpenMenu = t.controller("mdMenu"), s.currentlyOpenMenu.registerContainerProxy(s.handleKeyDown), s.enableOpenOnHover())
-                    })), t.push(this.$rootScope.$on("$mdMenuClose", function(e, t, n) {
-                        var r = s.getMenus();
-                        if (-1 != r.indexOf(t[0]) && (o[0].classList.remove("md-open"), t[0].classList.remove("md-open")), o[0].contains(t[0])) {
-                            for (var i = t[0]; i && -1 == r.indexOf(i);) i = a.getClosest(i, "MD-MENU", !0);
-                            i && (n.skipFocus || i.querySelector("button:not([disabled])").focus(), s.currentlyOpenMenu = le, s.disableOpenOnHover(), s.setKeyboardMode(!0))
-                        }
-                    })), e.$on("$destroy", function() {
-                        for (s.disableOpenOnHover(); t.length;) t.shift()()
-                    }), this.setKeyboardMode(!0)
-                }, e.prototype.setKeyboardMode = function(e) {
-                    e ? this.$element[0].classList.add("md-keyboard-mode") : this.$element[0].classList.remove("md-keyboard-mode")
-                }, e.prototype.enableOpenOnHover = function() {
-                    if (!this.openOnHoverEnabled) {
-                        var e = this;
-                        e.openOnHoverEnabled = !0, e.parentToolbar && (e.parentToolbar.classList.add("md-has-open-menu"), e.$mdUtil.nextTick(function() {
-                            se.element(e.parentToolbar).on("click", e.handleParentClick)
-                        }, !1)), se.element(e.getMenus()).on("mouseenter", e.handleMenuHover)
-                    }
-                }, e.prototype.handleMenuHover = function(e) {
-                    this.setKeyboardMode(!1), this.openOnHoverEnabled && this.scheduleOpenHoveredMenu(e)
-                }, e.prototype.disableOpenOnHover = function() {
-                    this.openOnHoverEnabled && (this.openOnHoverEnabled = !1, this.parentToolbar && (this.parentToolbar.classList.remove("md-has-open-menu"), se.element(this.parentToolbar).off("click", this.handleParentClick)), se.element(this.getMenus()).off("mouseenter", this.handleMenuHover))
-                }, e.prototype.scheduleOpenHoveredMenu = function(e) {
-                    var t = se.element(e.currentTarget).controller("mdMenu");
-                    this.setKeyboardMode(!1), this.scheduleOpenMenu(t)
-                }, e.prototype.scheduleOpenMenu = function(e) {
-                    var t = this,
-                        n = this.$timeout;
-                    e != t.currentlyOpenMenu && (n.cancel(t.pendingMenuOpen), t.pendingMenuOpen = n(function() {
-                        t.pendingMenuOpen = le, t.currentlyOpenMenu && t.currentlyOpenMenu.close(!0, {
-                            closeAll: !0
-                        }), e.open()
-                    }, 200, !1))
-                }, e.prototype.handleKeyDown = function(e) {
-                    var t, n, r, i = this.$mdConstant.KEY_CODE,
-                        o = this.currentlyOpenMenu,
-                        a = o && o.isOpen;
-                    switch (this.setKeyboardMode(!0), e.keyCode) {
-                        case i.DOWN_ARROW:
-                            o ? o.focusMenuContainer() : this.openFocusedMenu(), t = !0;
-                            break;
-                        case i.UP_ARROW:
-                            o && o.close(), t = !0;
-                            break;
-                        case i.LEFT_ARROW:
-                            n = this.focusMenu(-1), a && (r = se.element(n).controller("mdMenu"), this.scheduleOpenMenu(r)), t = !0;
-                            break;
-                        case i.RIGHT_ARROW:
-                            n = this.focusMenu(1), a && (r = se.element(n).controller("mdMenu"), this.scheduleOpenMenu(r)), t = !0
-                    }
-                    t && (e && e.preventDefault && e.preventDefault(), e && e.stopImmediatePropagation && e.stopImmediatePropagation())
-                }, e.prototype.focusMenu = function(e) {
-                    var t = this.getMenus(),
-                        n = this.getFocusedMenuIndex(); - 1 == n && (n = this.getOpenMenuIndex());
-                    var r = !1;
-                    if (-1 == n ? r = !(n = 0) : (e < 0 && 0 < n || 0 < e && n < t.length - e) && (n += e, r = !0), r) return t[n].querySelector("button").focus(), t[n]
-                }, e.prototype.openFocusedMenu = function() {
-                    var e = this.getFocusedMenu();
-                    e && se.element(e).controller("mdMenu").open()
-                }, e.prototype.getMenus = function() {
-                    var e = this.$element;
-                    return this.$mdUtil.nodesToArray(e[0].children).filter(function(e) {
-                        return "MD-MENU" == e.nodeName
-                    })
-                }, e.prototype.getFocusedMenu = function() {
-                    return this.getMenus()[this.getFocusedMenuIndex()]
-                }, e.prototype.getFocusedMenuIndex = function() {
-                    var e = this.$mdUtil.getClosest(this.$document[0].activeElement, "MD-MENU");
-                    return e ? this.getMenus().indexOf(e) : -1
-                }, e.prototype.getOpenMenuIndex = function() {
-                    for (var e = this.getMenus(), t = 0; t < e.length; ++t)
-                        if (e[t].classList.contains("md-open")) return t;
-                    return -1
-                }, e.prototype.handleParentClick = function(e) {
-                    var t = this.querySelector("md-menu.md-open");
-                    t && !t.contains(e.target) && se.element(t).controller("mdMenu").close(!0, {
-                        closeAll: !0
-                    })
-                }
-            }(),
-            function() {
-                function e(n, i) {
-                    return {
-                        restrict: "E",
-                        require: "mdMenuBar",
-                        controller: "MenuBarController",
-                        compile: function(e, t) {
-                            return t.ariaRole || e[0].setAttribute("role", "menubar"), se.forEach(e[0].children, function(e) {
-                                    if ("MD-MENU" == e.nodeName) {
-                                        e.hasAttribute("md-position-mode") || (e.setAttribute("md-position-mode", "left bottom"), e.querySelector("button, a, md-button").setAttribute("role", "menuitem"));
-                                        var t = n.nodesToArray(e.querySelectorAll("md-menu-content"));
-                                        se.forEach(t, function(e) {
-                                            e.classList.add("md-menu-bar-menu"), e.classList.add("md-dense"), e.hasAttribute("width") || e.setAttribute("width", 5)
-                                        })
-                                    }
-                                }), e.find("md-menu-item").addClass("md-in-menu-bar"),
-                                function(e, t, n, r) {
-                                    t.addClass("_md"), i(e, t), r.init()
-                                }
-                        }
-                    }
-                }
-                e.$inject = ["$mdUtil", "$mdTheming"], se.module("material.components.menuBar").directive("mdMenuBar", e)
-            }(), se.module("material.components.menuBar").directive("mdMenuDivider", function() {
-                return {
-                    restrict: "E",
-                    compile: function(e, t) {
-                        t.role || e[0].setAttribute("role", "separator")
-                    }
-                }
-            }),
-            function() {
-                function e(e, t, n) {
-                    this.$element = t, this.$attrs = n, this.$scope = e
-                }
-                e.$inject = ["$scope", "$element", "$attrs"], se.module("material.components.menuBar").controller("MenuItemController", e), e.prototype.init = function(e) {
-                    var t = this.$element,
-                        n = this.$attrs;
-                    this.ngModel = e, "checkbox" != n.type && "radio" != n.type || (this.mode = n.type, this.iconEl = t[0].children[0], this.buttonEl = t[0].children[1], e && this.initClickListeners())
-                }, e.prototype.clearNgAria = function() {
-                    var t = this.$element[0];
-                    se.forEach(["role", "tabindex", "aria-invalid", "aria-checked"], function(e) {
-                        t.removeAttribute(e)
-                    })
-                }, e.prototype.initClickListeners = function() {
-                    var e = this,
-                        t = this.ngModel,
-                        n = this.$scope,
-                        r = this.$attrs,
-                        i = (this.$element, this.mode);
-                    this.handleClick = se.bind(this, this.handleClick);
-                    var o = this.iconEl,
-                        a = se.element(this.buttonEl),
-                        s = this.handleClick;
-
-                    function l(e) {
-                        e ? a.off("click", s) : a.on("click", s)
-                    }
-                    r.$observe("disabled", l), l(r.disabled), t.$render = function() {
-                        e.clearNgAria(), ! function() {
-                            {
-                                if ("radio" != i) return t.$modelValue;
-                                var e = r.ngValue ? n.$eval(r.ngValue) : r.value;
-                                return t.$modelValue == e
-                            }
-                        }() ? (o.style.display = "none", a.attr("aria-checked", "false")) : (o.style.display = "", a.attr("aria-checked", "true"))
-                    }, n.$$postDigest(t.$render)
-                }, e.prototype.handleClick = function(e) {
-                    var t, n = this.mode,
-                        r = this.ngModel,
-                        i = this.$attrs;
-                    "checkbox" == n ? t = !r.$modelValue : "radio" == n && (t = i.ngValue ? this.$scope.$eval(i.ngValue) : i.value), r.$setViewValue(t), r.$render()
-                }
-            }(),
-            function() {
-                function e(u, e, d) {
-                    return {
-                        controller: "MenuItemController",
-                        require: ["mdMenuItem", "?ngModel"],
-                        priority: e.BEFORE_NG_ARIA,
-                        compile: function(r, e) {
-                            var t, n, i = e.type,
-                                o = "md-in-menu-bar";
-                            if ("checkbox" != i && "radio" != i || !r.hasClass(o)) c("role", "menuitem", r[0].querySelector("md-button, button, a"));
-                            else {
-                                var a = r[0].textContent,
-                                    s = se.element('<md-button type="button"></md-button>'),
-                                    l = '<md-icon md-svg-src="' + d.mdChecked + '"></md-icon>';
-                                s.html(a), s.attr("tabindex", "0"), r.html(""), r.append(se.element(l)), r.append(s), r.addClass("md-indent").removeClass(o), c("role", "checkbox" == i ? "menuitemcheckbox" : "menuitemradio", s), t = "ng-disabled", n = u.prefixer(t), se.forEach(n, function(e) {
-                                    if (r[0].hasAttribute(e)) {
-                                        var t = r[0].getAttribute(e);
-                                        s[0].setAttribute(e, t), r[0].removeAttribute(e)
-                                    }
-                                })
-                            }
-                            return function(e, t, n, r) {
-                                var i = r[0],
-                                    o = r[1];
-                                i.init(o)
-                            };
-
-                            function c(e, t, n) {
-                                (n = n || r) instanceof se.element && (n = n[0]), n.hasAttribute(e) || n.setAttribute(e, t)
-                            }
-                        }
-                    }
-                }
-                e.$inject = ["$mdUtil", "$mdConstant", "$$mdSvgRegistry"], se.module("material.components.menuBar").directive("mdMenuItem", e)
-            }(),
-            function() {
-                function e(_, $, f, w, h, e) {
-                    var E = _.requestAnimationFrame || _.webkitRequestAnimationFrame || se.noop,
-                        p = _.cancelAnimationFrame || _.webkitCancelAnimationFrame || _.webkitCancelRequestAnimationFrame || se.noop,
-                        m = "determinate",
-                        C = "indeterminate",
-                        k = "_md-progress-circular-disabled",
-                        x = "md-mode-indeterminate";
-                    return {
-                        restrict: "E",
-                        scope: {
-                            value: "@",
-                            mdDiameter: "@",
-                            mdMode: "@"
-                        },
-                        template: '<svg xmlns="http://www.w3.org/2000/svg"><path fill="none"/></svg>',
-                        compile: function(e, t) {
-                            if (e.attr({
-                                    "aria-valuemin": 0,
-                                    "aria-valuemax": 100,
-                                    role: "progressbar"
-                                }), se.isUndefined(t.mdMode)) {
-                                var n = t.hasOwnProperty("value") ? m : C;
-                                t.$set("mdMode", n)
-                            } else t.$set("mdMode", t.mdMode.trim());
-                            return r
-                        }
-                    };
-
-                    function r(g, a, o) {
-                        var v, e, t = a[0],
-                            s = se.element(t.querySelector("svg")),
-                            b = se.element(t.querySelector("path")),
-                            n = $.startIndeterminate,
-                            r = $.endIndeterminate,
-                            i = 0,
-                            y = 0;
-
-                        function l(n, e, t, r, i, o) {
-                            var a = ++y,
-                                s = w.now(),
-                                l = e - n,
-                                c = S(g.mdDiameter),
-                                u = O(c),
-                                d = t || $.easeFn,
-                                f = r || $.duration,
-                                h = -90 * (i || 0),
-                                p = o || 100;
-
-                            function m(e) {
-                                b.attr("stroke-dashoffset", M(c, u, e, p)), b.attr("transform", "rotate(" + h + " " + c / 2 + " " + c / 2 + ")")
-                            }
-                            e === n ? m(e) : v = E(function e() {
-                                var t = _.Math.max(0, _.Math.min(w.now() - s, f));
-                                m(d(t, n, l, f)), a === y && t < f && (v = E(e))
-                            })
-                        }
-
-                        function c() {
-                            l(n, r, $.easeFnIndeterminate, $.durationIndeterminate, i, 75), i = ++i % 4
-                        }
-
-                        function u() {
-                            e || (e = h(c, $.durationIndeterminate, 0, !1), c(), a.addClass(x).removeAttr("aria-valuenow"))
-                        }
-
-                        function d() {
-                            e && (h.cancel(e), e = null, a.removeClass(x))
-                        }
-                        f(a), a.toggleClass(k, o.hasOwnProperty("disabled")), g.mdMode === C && u(), g.$on("$destroy", function() {
-                            d(), v && p(v)
-                        }), g.$watchGroup(["value", "mdMode", function() {
-                            var e = t.disabled;
-                            return !0 === e || !1 === e ? e : se.isDefined(a.attr("disabled"))
-                        }], function(e, t) {
-                            var n = e[1],
-                                r = e[2];
-                            if (r !== t[2] && a.toggleClass(k, !!r), r) d();
-                            else if (n !== m && n !== C && (n = C, o.$set("mdMode", n)), n === C) u();
-                            else {
-                                var i = A(e[0]);
-                                d(), a.attr("aria-valuenow", i), l(A(t[0]), i)
-                            }
-                        }), g.$watch("mdDiameter", function(e) {
-                            var t = S(e),
-                                n = O(t),
-                                r = A(g.value),
-                                i = t / 2 + "px",
-                                o = {
-                                    width: t + "px",
-                                    height: t + "px"
-                                };
-                            s[0].setAttribute("viewBox", "0 0 " + t + " " + t), s.css(o).css("transform-origin", i + " " + i + " " + i), a.css(o), b.attr("stroke-width", n), b.attr("stroke-linecap", "square"), g.mdMode == C ? (b.attr("d", T(t, n, !0)), b.attr("stroke-dasharray", (t - n) * _.Math.PI * .75), b.attr("stroke-dashoffset", M(t, n, 1, 75))) : (b.attr("d", T(t, n, !1)), b.attr("stroke-dasharray", (t - n) * _.Math.PI), b.attr("stroke-dashoffset", M(t, n, 0, 100)), l(r, r))
-                        })
-                    }
-
-                    function T(e, t, n) {
-                        var r = e / 2,
-                            i = t / 2,
-                            o = r + "," + i,
-                            a = r - i;
-                        return "M" + o + "A" + a + "," + a + " 0 1 1 " + (i + "," + r) + (n ? "" : "A" + a + "," + a + " 0 0 1 " + o)
-                    }
-
-                    function M(e, t, n, r) {
-                        return (e - t) * _.Math.PI * (3 * (r || 100) / 100 - n / 100)
-                    }
-
-                    function A(e) {
-                        return _.Math.max(0, _.Math.min(e || 0, 100))
-                    }
-
-                    function S(e) {
-                        var t = $.progressSize;
-                        if (e) {
-                            var n = parseFloat(e);
-                            return e.lastIndexOf("%") === e.length - 1 && (n = n / 100 * t), n
-                        }
-                        return t
-                    }
-
-                    function O(e) {
-                        return $.strokeWidth / 100 * e
-                    }
-                }
-                e.$inject = ["$window", "$mdProgressCircular", "$mdTheming", "$mdUtil", "$interval", "$log"], se.module("material.components.progressCircular").directive("mdProgressCircular", e)
-            }(), se.module("material.components.progressCircular").provider("$mdProgressCircular", function() {
-                var t = {
-                    progressSize: 50,
-                    strokeWidth: 10,
-                    duration: 100,
-                    easeFn: e,
-                    durationIndeterminate: 1333,
-                    startIndeterminate: 1,
-                    endIndeterminate: 149,
-                    easeFnIndeterminate: n,
-                    easingPresets: {
-                        linearEase: e,
-                        materialEase: n
-                    }
-                };
-                return {
-                    configure: function(e) {
-                        return t = se.extend(t, e || {})
-                    },
-                    $get: function() {
-                        return t
-                    }
-                };
-
-                function e(e, t, n, r) {
-                    return n * e / r + t
-                }
-
-                function n(e, t, n, r) {
-                    var i = (e /= r) * e,
-                        o = i * e;
-                    return t + n * (6 * o * i + -15 * i * i + 10 * o)
-                }
-            }), se.module("material.components.tabs").directive("mdTab", function() {
-                return {
-                    require: "^?mdTabs",
-                    terminal: !0,
-                    compile: function(e, t) {
-                        var n = l(e, "md-tab-label"),
-                            r = l(e, "md-tab-body");
-                        if (0 === n.length && (n = se.element("<md-tab-label></md-tab-label>"), t.label ? n.text(t.label) : n.append(e.contents()), 0 === r.length)) {
-                            var i = e.contents().detach();
-                            (r = se.element("<md-tab-body></md-tab-body>")).append(i)
-                        }
-                        return e.append(n), r.html() && e.append(r), o
-                    },
-                    scope: {
-                        active: "=?mdActive",
-                        disabled: "=?ngDisabled",
-                        select: "&?mdOnSelect",
-                        deselect: "&?mdOnDeselect"
-                    }
-                };
-
-                function o(e, t, n, r) {
-                    if (r) {
-                        var i = r.getTabElementIndex(t),
-                            o = l(t, "md-tab-body").remove(),
-                            a = l(t, "md-tab-label").remove(),
-                            s = r.insertTab({
-                                scope: e,
-                                parent: e.$parent,
-                                index: i,
-                                element: t,
-                                template: o.html(),
-                                label: a.html()
-                            }, i);
-                        e.select = e.select || se.noop, e.deselect = e.deselect || se.noop, e.$watch("active", function(e) {
-                            e && r.select(s.getIndex(), !0)
-                        }), e.$watch("disabled", function() {
-                            r.refreshIndex()
-                        }), e.$watch(function() {
-                            return r.getTabElementIndex(t)
-                        }, function(e) {
-                            s.index = e, r.updateTabOrder()
-                        }), e.$on("$destroy", function() {
-                            r.removeTab(s)
-                        })
-                    }
-                }
-
-                function l(e, t) {
-                    for (var n = e[0].children, r = 0, i = n.length; r < i; r++) {
-                        var o = n[r];
-                        if (o.tagName === t.toUpperCase()) return se.element(o)
-                    }
-                    return se.element()
-                }
-            }), se.module("material.components.tabs").directive("mdTabItem", function() {
-                return {
-                    require: "^?mdTabs",
-                    link: function(e, t, n, r) {
-                        r && r.attachRipple(e, t)
-                    }
-                }
-            }), se.module("material.components.tabs").directive("mdTabLabel", function() {
-                return {
-                    terminal: !0
-                }
-            }),
-            function() {
-                function e(r) {
-                    return {
-                        restrict: "A",
-                        compile: function(e, t) {
-                            var n = r(t.mdTabScroll, null, !0);
-                            return function(t, e) {
-                                e.on("mousewheel", function(e) {
-                                    t.$apply(function() {
-                                        n(t, {
-                                            $event: e
-                                        })
-                                    })
-                                })
-                            }
-                        }
-                    }
-                }
-                e.$inject = ["$parse"], se.module("material.components.tabs").directive("mdTabScroll", e)
-            }(),
-            function() {
-                function e(a, l, n, r, i, c, u, o, s, d, e, t) {
-                    var f = this,
-                        h = !1,
-                        p = (O(), []),
-                        m = !1,
-                        g = !1;
-
-                    function v(t, e) {
-                        var n = o.$normalize("md-" + t);
-
-                        function r(e) {
-                            f[t] = "false" !== e
-                        }
-                        e && I(t, e), o.hasOwnProperty(n) && r(o[n]), o.$observe(n, r)
-                    }
-
-                    function b() {
-                        m = !0, se.element(n).off("resize", M)
-                    }
-
-                    function y(e) {
-                        var t = O();
-                        se.element(t.wrapper).toggleClass("md-stretch-tabs", function() {
-                            switch (f.stretchTabs) {
-                                case "always":
-                                    return !0;
-                                case "never":
-                                    return !1;
-                                default:
-                                    return !f.shouldPaginate && n.matchMedia("(max-width: 600px)").matches
-                            }
-                        }()), V()
-                    }
-
-                    function _(e) {
-                        f.shouldCenterTabs = D()
-                    }
-
-                    function $(t, e) {
-                        if (t !== e) {
-                            var n = O();
-                            se.forEach(n.tabs, function(e) {
-                                e.style.maxWidth = t + "px"
-                            }), se.forEach(n.dummies, function(e) {
-                                e.style.maxWidth = t + "px"
-                            }), c.nextTick(f.updateInkBarStyles)
-                        }
-                    }
-
-                    function w(e, t) {
-                        e !== t && (f.maxTabWidth = H(), f.shouldCenterTabs = D(), c.nextTick(function() {
-                            f.maxTabWidth = H(), F(f.selectedIndex)
-                        }))
-                    }
-
-                    function E(e) {
-                        l[e ? "removeClass" : "addClass"]("md-no-tab-content")
-                    }
-
-                    function C(e) {
-                        var t = O(),
-                            n = (f.shouldCenterTabs || B() ? "" : "-") + e + "px";
-                        n = n.replace("--", ""), se.element(t.paging).css(r.CSS.TRANSFORM, "translate3d(" + n + ", 0, 0)"), a.$broadcast("$mdTabsPaginationChanged")
-                    }
-
-                    function k(e, t) {
-                        e !== t && O().tabs[e] && (F(), L())
-                    }
-
-                    function x(e, t) {
-                        e !== t && (f.selectedIndex = N(e), f.lastSelectedIndex = t, f.updateInkBarStyles(), U(), F(e), a.$broadcast("$mdTabsChanged"), f.tabs[t] && f.tabs[t].scope.deselect(), f.tabs[e] && f.tabs[e].scope.select())
-                    }
-
-                    function T(e, t) {
-                        h || (f.focusIndex = f.selectedIndex = e), t && f.noSelectClick || c.nextTick(function() {
-                            f.tabs[e].element.triggerHandler("click")
-                        }, !1)
-                    }
-
-                    function M() {
-                        f.lastSelectedIndex = f.selectedIndex, f.offsetLeft = z(f.offsetLeft), c.nextTick(function() {
-                            f.updateInkBarStyles(), R()
-                        })
-                    }
-
-                    function A(e) {
-                        se.element(O().inkBar).toggleClass("ng-hide", e)
-                    }
-
-                    function S(e) {
-                        l.toggleClass("md-dynamic-height", e)
-                    }
-
-                    function O() {
-                        var e = {},
-                            t = l[0];
-                        return e.wrapper = t.querySelector("md-tabs-wrapper"), e.canvas = e.wrapper.querySelector("md-tabs-canvas"), e.paging = e.canvas.querySelector("md-pagination-wrapper"), e.inkBar = e.paging.querySelector("md-ink-bar"), e.nextButton = t.querySelector("md-next-button"), e.prevButton = t.querySelector("md-prev-button"), e.contents = t.querySelectorAll("md-tabs-content-wrapper > md-tab-content"), e.tabs = e.paging.querySelectorAll("md-tab-item"), e.dummies = e.canvas.querySelectorAll("md-dummy-tab"), e
-                    }
-
-                    function D() {
-                        return f.centerTabs && !f.shouldPaginate
-                    }
-
-                    function N(e) {
-                        if (-1 === e) return -1;
-                        var t, n, r = Math.max(f.tabs.length - e, e);
-                        for (t = 0; t <= r; t++) {
-                            if ((n = f.tabs[e + t]) && !0 !== n.scope.disabled) return n.getIndex();
-                            if ((n = f.tabs[e - t]) && !0 !== n.scope.disabled) return n.getIndex()
-                        }
-                        return e
-                    }
-
-                    function I(e, n, r) {
-                        Object.defineProperty(f, e, {
-                            get: function() {
-                                return r
-                            },
-                            set: function(e) {
-                                var t = r;
-                                r = e, n && n(e, t)
-                            }
-                        })
-                    }
-
-                    function R() {
-                        f.maxTabWidth = H(), f.shouldPaginate = function() {
-                            if (f.noPagination || !g) return !1;
-                            var t = l.prop("clientWidth");
-                            return se.forEach(O().tabs, function(e) {
-                                t -= e.offsetWidth
-                            }), t < 0
-                        }()
-                    }
-
-                    function P(e) {
-                        var t = 0;
-                        return se.forEach(e, function(e) {
-                            t += Math.max(e.offsetWidth, e.getBoundingClientRect().width)
-                        }), Math.ceil(t)
-                    }
-
-                    function H() {
-                        var e = O().canvas.clientWidth;
-                        return Math.max(0, Math.min(e - 1, 264))
-                    }
-
-                    function j(e, t) {
-                        var n, r = t ? "focusIndex" : "selectedIndex",
-                            i = f[r];
-                        for (n = i + e; f.tabs[n] && f.tabs[n].scope.disabled; n += e);
-                        n = (i + e + f.tabs.length) % f.tabs.length, f.tabs[n] && (f[r] = n)
-                    }
-
-                    function L() {
-                        f.styleTabItemFocus = "keyboard" === e.getLastInteractionType(), O().tabs[f.focusIndex].focus()
-                    }
-
-                    function F(e) {
-                        var t = O();
-                        if (se.isNumber(e) || (e = f.focusIndex), t.tabs[e] && !f.shouldCenterTabs) {
-                            var n = t.tabs[e],
-                                r = n.offsetLeft,
-                                i = n.offsetWidth + r;
-                            if (0 != e)
-                                if (B()) {
-                                    var o = P(Array.prototype.slice.call(t.tabs, 0, e)),
-                                        a = P(Array.prototype.slice.call(t.tabs, 0, e + 1));
-                                    f.offsetLeft = Math.min(f.offsetLeft, z(o)), f.offsetLeft = Math.max(f.offsetLeft, z(a - t.canvas.clientWidth))
-                                } else f.offsetLeft = Math.max(f.offsetLeft, z(i - t.canvas.clientWidth + 32)), f.offsetLeft = Math.min(f.offsetLeft, z(r));
-                            else f.offsetLeft = 0
-                        }
-                    }
-
-                    function q() {
-                        f.selectedIndex = N(f.selectedIndex), f.focusIndex = N(f.focusIndex)
-                    }
-
-                    function U() {
-                        if (!f.dynamicHeight) return l.css("height", "");
-                        if (!f.tabs.length) return p.push(U);
-                        var e = O(),
-                            t = e.contents[f.selectedIndex],
-                            n = t ? t.offsetHeight : 0,
-                            r = e.wrapper.offsetHeight,
-                            i = n + r,
-                            o = l.prop("clientHeight");
-                        if (o !== i) {
-                            "bottom" === l.attr("md-align-tabs") && (o -= r, i -= r, l.attr("md-border-bottom") !== le && ++o), h = !0;
-                            var a = {
-                                    height: o + "px"
-                                },
-                                s = {
-                                    height: i + "px"
-                                };
-                            l.css(a), u(l, {
-                                from: a,
-                                to: s,
-                                easing: "cubic-bezier(0.35, 0, 0.25, 1)",
-                                duration: .5
-                            }).start().done(function() {
-                                l.css({
-                                    transition: "none",
-                                    height: ""
-                                }), c.nextTick(function() {
-                                    l.css("transition", "")
-                                }), h = !1
-                            })
-                        }
-                    }
-
-                    function V() {
-                        var e = O();
-                        if (e.tabs[f.selectedIndex]) {
-                            if (!f.tabs.length) return p.push(f.updateInkBarStyles);
-                            if (!l.prop("offsetParent")) return function e() {
-                                e.watcher || (e.watcher = a.$watch(function() {
-                                    c.nextTick(function() {
-                                        e.watcher && l.prop("offsetParent") && (e.watcher(), e.watcher = null, M())
-                                    }, !1)
-                                }))
-                            }();
-                            var t = f.selectedIndex,
-                                n = e.paging.offsetWidth,
-                                r = e.tabs[t],
-                                i = r.offsetLeft,
-                                o = n - i - r.offsetWidth;
-                            if (f.shouldCenterTabs) P(e.tabs) < n && c.nextTick(V, !1);
-                            ! function() {
-                                var e = O(),
-                                    t = f.selectedIndex,
-                                    n = f.lastSelectedIndex,
-                                    r = se.element(e.inkBar);
-                                if (!se.isNumber(n)) return;
-                                r.toggleClass("md-left", t < n).toggleClass("md-right", n < t)
-                            }(), se.element(e.inkBar).css({
-                                left: i + "px",
-                                right: o + "px"
-                            })
-                        } else se.element(e.inkBar).css({
-                            left: "auto",
-                            right: "auto"
-                        })
-                    }
-
-                    function z(e) {
-                        var t = O();
-                        if (!t.tabs.length || !f.shouldPaginate) return 0;
-                        var n = t.tabs[t.tabs.length - 1],
-                            r = n.offsetLeft + n.offsetWidth;
-                        return e = B() ? (e = Math.min(t.paging.offsetWidth - t.canvas.clientWidth, e), Math.max(0, e)) : (e = Math.max(0, e), Math.min(r - t.canvas.clientWidth, e))
-                    }
-
-                    function B() {
-                        return "rtl" == c.bidi()
-                    }
-                    f.$onInit = function() {
-                        (function(t, e) {
-                            var n = o.$normalize("md-" + t);
-                            e && I(t, e);
-                            o.$observe(n, function(e) {
-                                f[t] = e
-                            })
-                        })("stretchTabs", y), I("focusIndex", k, f.selectedIndex || 0), I("offsetLeft", C, 0), I("hasContent", E, !1), I("maxTabWidth", $, H()), I("shouldPaginate", w, !1), v("noInkBar", A), v("dynamicHeight", S), v("noPagination"), v("swipeContent"), v("noDisconnect"), v("autoselect"), v("noSelectClick"), v("centerTabs", _), v("enableDisconnect"), f.scope = a, f.parent = a.$parent, f.tabs = [], f.lastSelectedIndex = null, f.hasFocus = !1, f.styleTabItemFocus = !1, f.shouldCenterTabs = D(), f.tabContentPrefix = "tab-content-", f.selectedIndex = f.selectedIndex || 0, e = o.$mdTabsTemplate, t = se.element(l[0].querySelector("md-tab-data")), t.html(e), s(t.contents())(f.parent), delete o.$mdTabsTemplate, a.$watch("$mdTabsCtrl.selectedIndex", x), se.element(n).on("resize", M), a.$on("$destroy", b), d(l), c.nextTick(function() {
-                            O(), U(), F(), V(), f.tabs[f.selectedIndex] && f.tabs[f.selectedIndex].scope.select(), g = !0, R()
-                        });
-                        var e, t
-                    }, f.updatePagination = c.debounce(R, 100), f.redirectFocus = L, f.attachRipple = function(e, t) {
-                        var n = O(),
-                            r = {
-                                colorElement: se.element(n.inkBar)
-                            };
-                        i.attach(e, t, r)
-                    }, f.insertTab = function(e, t) {
-                        var n = g,
-                            r = {
-                                getIndex: function() {
-                                    return f.tabs.indexOf(i)
-                                },
-                                isActive: function() {
-                                    return this.getIndex() === f.selectedIndex
-                                },
-                                isLeft: function() {
-                                    return this.getIndex() < f.selectedIndex
-                                },
-                                isRight: function() {
-                                    return this.getIndex() > f.selectedIndex
-                                },
-                                shouldRender: function() {
-                                    return !f.noDisconnect || this.isActive()
-                                },
-                                hasFocus: function() {
-                                    return f.styleTabItemFocus && f.hasFocus && this.getIndex() === f.focusIndex
-                                },
-                                id: c.nextUid(),
-                                hasContent: !(!e.template || !e.template.trim())
-                            },
-                            i = se.extend(r, e);
-                        se.isDefined(t) ? f.tabs.splice(t, 0, i) : f.tabs.push(i);
-                        return p.forEach(function(e) {
-                                c.nextTick(e)
-                            }), p = [],
-                            function() {
-                                for (var e = !1, t = 0; t < f.tabs.length; t++)
-                                    if (f.tabs[t].hasContent) {
-                                        e = !0;
-                                        break
-                                    } f.hasContent = e
-                            }(), c.nextTick(function() {
-                                R(),
-                                    function(e) {
-                                        if (e.hasContent) {
-                                            var t = l[0].querySelectorAll('[md-tab-id="' + e.id + '"]');
-                                            se.element(t).attr("aria-controls", f.tabContentPrefix + e.id)
-                                        }
-                                    }(i), n && f.autoselect && c.nextTick(function() {
-                                        c.nextTick(function() {
-                                            T(f.tabs.indexOf(i))
-                                        })
-                                    })
-                            }), i
-                    }, f.removeTab = function(e) {
-                        if (m) return;
-                        var t = f.selectedIndex,
-                            n = f.tabs.splice(e.getIndex(), 1)[0];
-                        q(), f.selectedIndex === t && (n.scope.deselect(), f.tabs[f.selectedIndex] && f.tabs[f.selectedIndex].scope.select());
-                        c.nextTick(function() {
-                            R(), f.offsetLeft = z(f.offsetLeft)
-                        })
-                    }, f.select = T, f.scroll = function(e) {
-                        if (!f.shouldPaginate) return;
-                        e.preventDefault(), f.offsetLeft = z(f.offsetLeft - e.wheelDelta)
-                    }, f.nextPage = function() {
-                        if (!f.canPageForward()) return;
-                        var e = t.increasePageOffset(O(), f.offsetLeft);
-                        f.offsetLeft = z(e)
-                    }, f.previousPage = function() {
-                        if (!f.canPageBack()) return;
-                        var e = t.decreasePageOffset(O(), f.offsetLeft);
-                        f.offsetLeft = z(e)
-                    }, f.keydown = function(e) {
-                        switch (e.keyCode) {
-                            case r.KEY_CODE.LEFT_ARROW:
-                                e.preventDefault(), j(-1, !0);
-                                break;
-                            case r.KEY_CODE.RIGHT_ARROW:
-                                e.preventDefault(), j(1, !0);
-                                break;
-                            case r.KEY_CODE.SPACE:
-                            case r.KEY_CODE.ENTER:
-                                e.preventDefault(), h || T(f.focusIndex);
-                                break;
-                            case r.KEY_CODE.TAB:
-                                f.focusIndex !== f.selectedIndex && (f.focusIndex = f.selectedIndex)
-                        }
-                    }, f.canPageForward = function() {
-                        var e = O(),
-                            t = e.tabs[e.tabs.length - 1];
-                        if (B()) return f.offsetLeft < e.paging.offsetWidth - e.canvas.offsetWidth;
-                        return t && t.offsetLeft + t.offsetWidth > e.canvas.clientWidth + f.offsetLeft
-                    }, f.canPageBack = function() {
-                        return 0 < f.offsetLeft
-                    }, f.refreshIndex = q, f.incrementIndex = j, f.getTabElementIndex = function(e) {
-                        var t = l[0].getElementsByTagName("md-tab");
-                        return Array.prototype.indexOf.call(t, e[0])
-                    }, f.updateInkBarStyles = c.debounce(V, 100), f.updateTabOrder = c.debounce(function() {
-                        var e = f.tabs[f.selectedIndex],
-                            t = f.tabs[f.focusIndex];
-                        f.tabs = f.tabs.sort(function(e, t) {
-                            return e.index - t.index
-                        }), f.selectedIndex = f.tabs.indexOf(e), f.focusIndex = f.tabs.indexOf(t)
-                    }, 100), f.getFocusedTabId = function() {
-                        var e = f.tabs[f.focusIndex];
-                        return e && e.id ? "tab-item-" + e.id : null
-                    }, 1 === se.version.major && se.version.minor <= 4 && this.$onInit()
-                }
-                e.$inject = ["$scope", "$element", "$window", "$mdConstant", "$mdTabInkRipple", "$mdUtil", "$animateCss", "$attrs", "$compile", "$mdTheming", "$mdInteraction", "MdTabsPaginationService"], se.module("material.components.tabs").controller("MdTabsController", e)
-            }(),
-            function() {
-                function e(n) {
-                    return {
-                        scope: {
-                            selectedIndex: "=?mdSelected"
-                        },
-                        template: function(e, t) {
-                            return t.$mdTabsTemplate = e.html(), '<md-tabs-wrapper> <md-tab-data></md-tab-data> <md-prev-button tabindex="-1" role="button" aria-label="Previous Page" aria-disabled="{{!$mdTabsCtrl.canPageBack()}}" ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageBack() }" ng-if="$mdTabsCtrl.shouldPaginate" ng-click="$mdTabsCtrl.previousPage()"> <md-icon md-svg-src="' + n.mdTabsArrow + '"></md-icon> </md-prev-button> <md-next-button tabindex="-1" role="button" aria-label="Next Page" aria-disabled="{{!$mdTabsCtrl.canPageForward()}}" ng-class="{ \'md-disabled\': !$mdTabsCtrl.canPageForward() }" ng-if="$mdTabsCtrl.shouldPaginate" ng-click="$mdTabsCtrl.nextPage()"> <md-icon md-svg-src="' + n.mdTabsArrow + '"></md-icon> </md-next-button> <md-tabs-canvas ng-focus="$mdTabsCtrl.redirectFocus()" ng-class="{ \'md-paginated\': $mdTabsCtrl.shouldPaginate, \'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs }" ng-keydown="$mdTabsCtrl.keydown($event)"> <md-pagination-wrapper ng-class="{ \'md-center-tabs\': $mdTabsCtrl.shouldCenterTabs }" md-tab-scroll="$mdTabsCtrl.scroll($event)" role="tablist"> <md-tab-item tabindex="{{ tab.isActive() ? 0 : -1 }}" class="md-tab" ng-repeat="tab in $mdTabsCtrl.tabs" role="tab" id="tab-item-{{::tab.id}}" md-tab-id="{{::tab.id}}" aria-selected="{{tab.isActive()}}" aria-disabled="{{tab.scope.disabled || \'false\'}}" ng-click="$mdTabsCtrl.select(tab.getIndex())" ng-focus="$mdTabsCtrl.hasFocus = true" ng-blur="$mdTabsCtrl.hasFocus = false" ng-class="{ \'md-active\':    tab.isActive(), \'md-focused\':   tab.hasFocus(), \'md-disabled\':  tab.scope.disabled }" ng-disabled="tab.scope.disabled" md-swipe-left="$mdTabsCtrl.nextPage()" md-swipe-right="$mdTabsCtrl.previousPage()" md-tabs-template="::tab.label" md-scope="::tab.parent"></md-tab-item> <md-ink-bar></md-ink-bar> </md-pagination-wrapper> <md-tabs-dummy-wrapper aria-hidden="true" class="md-visually-hidden md-dummy-wrapper"> <md-dummy-tab class="md-tab" tabindex="-1" ng-repeat="tab in $mdTabsCtrl.tabs" md-tabs-template="::tab.label" md-scope="::tab.parent"></md-dummy-tab> </md-tabs-dummy-wrapper> </md-tabs-canvas> </md-tabs-wrapper> <md-tabs-content-wrapper ng-show="$mdTabsCtrl.hasContent && $mdTabsCtrl.selectedIndex >= 0" class="_md"> <md-tab-content id="{{:: $mdTabsCtrl.tabContentPrefix + tab.id}}" class="_md" role="tabpanel" aria-labelledby="tab-item-{{::tab.id}}" md-swipe-left="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(1)" md-swipe-right="$mdTabsCtrl.swipeContent && $mdTabsCtrl.incrementIndex(-1)" ng-if="tab.hasContent" ng-repeat="(index, tab) in $mdTabsCtrl.tabs" ng-class="{ \'md-no-transition\': $mdTabsCtrl.lastSelectedIndex == null, \'md-active\':        tab.isActive(), \'md-left\':          tab.isLeft(), \'md-right\':         tab.isRight(), \'md-no-scroll\':     $mdTabsCtrl.dynamicHeight }"> <div md-tabs-template="::tab.template" md-connected-if="tab.isActive()" md-scope="::tab.parent" ng-if="$mdTabsCtrl.enableDisconnect || tab.shouldRender()"></div> </md-tab-content> </md-tabs-content-wrapper>'
-                        },
-                        controller: "MdTabsController",
-                        controllerAs: "$mdTabsCtrl",
-                        bindToController: !0
-                    }
-                }
-                e.$inject = ["$$mdSvgRegistry"], se.module("material.components.tabs").directive("mdTabs", e)
-            }(),
-            function() {
-                function e(l, c) {
-                    return {
-                        require: "^?mdTabs",
-                        link: function(e, t, n, r) {
-                            if (r) {
-                                var i, o, a = function() {
-                                    r.updatePagination(), r.updateInkBarStyles()
-                                };
-                                if ("MutationObserver" in c) {
-                                    (i = new MutationObserver(a)).observe(t[0], {
-                                        childList: !0,
-                                        subtree: !0,
-                                        characterData: !0
-                                    }), o = i.disconnect.bind(i)
-                                } else {
-                                    var s = l.debounce(a, 15, null, !1);
-                                    t.on("DOMSubtreeModified", s), o = t.off.bind(t, "DOMSubtreeModified", s)
-                                }
-                                e.$on("$destroy", function() {
-                                    o()
-                                })
-                            }
-                        }
-                    }
-                }
-                e.$inject = ["$mdUtil", "$window"], se.module("material.components.tabs").directive("mdTabsDummyWrapper", e)
-            }(),
-            function() {
-                function e(a, s) {
-                    return {
-                        restrict: "A",
-                        link: function(e, t, n, r) {
-                            if (!r) return;
-                            var i = r.enableDisconnect ? e.compileScope.$new() : e.compileScope;
-                            return t.html(e.template), a(t.contents())(i), s.nextTick(function() {
-                                e.$watch("connected", function(e) {
-                                    !1 === e ? r.enableDisconnect && s.disconnectScope(i) : o()
-                                }), e.$on("$destroy", o)
-                            });
-
-                            function o() {
-                                r.enableDisconnect && s.reconnectScope(i)
-                            }
-                        },
-                        scope: {
-                            template: "=mdTabsTemplate",
-                            connected: "=?mdConnectedIf",
-                            compileScope: "=mdScope"
-                        },
-                        require: "^?mdTabs"
-                    }
-                }
-                e.$inject = ["$compile", "$mdUtil"], se.module("material.components.tabs").directive("mdTabsTemplate", e)
-            }(), se.module("material.core").constant("$MD_THEME_CSS", 'md-autocomplete.md-THEME_NAME-theme{background:"{{background-hue-1}}"}md-autocomplete.md-THEME_NAME-theme[disabled]:not([md-floating-label]){background:"{{background-hue-2}}"}md-autocomplete.md-THEME_NAME-theme button md-icon path{fill:"{{background-600}}"}md-autocomplete.md-THEME_NAME-theme button:after{background:"{{background-600-0.3}}"}md-autocomplete.md-THEME_NAME-theme input{color:"{{foreground-1}}"}.md-autocomplete-suggestions-container.md-THEME_NAME-theme{background:"{{background-hue-1}}"}.md-autocomplete-suggestions-container.md-THEME_NAME-theme li{color:"{{foreground-1}}"}.md-autocomplete-suggestions-container.md-THEME_NAME-theme li.selected,.md-autocomplete-suggestions-container.md-THEME_NAME-theme li:hover{background:"{{background-500-0.18}}"}md-backdrop{background-color:"{{background-900-0.0}}"}md-backdrop.md-opaque.md-THEME_NAME-theme{background-color:"{{background-900-1.0}}"}md-bottom-sheet.md-THEME_NAME-theme{background-color:"{{background-50}}";border-top-color:"{{background-300}}"}md-bottom-sheet.md-THEME_NAME-theme.md-list md-list-item{color:"{{foreground-1}}"}md-bottom-sheet.md-THEME_NAME-theme .md-subheader{background-color:"{{background-50}}";color:"{{foreground-1}}"}.md-button.md-THEME_NAME-theme:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme:not([disabled]):hover{background-color:"{{background-500-0.2}}"}.md-button.md-THEME_NAME-theme:not([disabled]).md-icon-button:hover{background-color:transparent}.md-button.md-THEME_NAME-theme.md-fab md-icon{color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-primary{color:"{{primary-color}}"}.md-button.md-THEME_NAME-theme.md-primary.md-fab,.md-button.md-THEME_NAME-theme.md-primary.md-raised{color:"{{primary-contrast}}";background-color:"{{primary-color}}"}.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]) md-icon,.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]) md-icon{color:"{{primary-contrast}}"}.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]):hover,.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]):hover{background-color:"{{primary-600}}"}.md-button.md-THEME_NAME-theme.md-primary:not([disabled]) md-icon{color:"{{primary-color}}"}.md-button.md-THEME_NAME-theme.md-fab{background-color:"{{accent-color}}";color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-fab:not([disabled]) .md-icon{color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-fab:not([disabled]):hover{background-color:"{{accent-A700}}"}.md-button.md-THEME_NAME-theme.md-raised{color:"{{background-900}}";background-color:"{{background-50}}"}.md-button.md-THEME_NAME-theme.md-raised:not([disabled]) md-icon{color:"{{background-900}}"}.md-button.md-THEME_NAME-theme.md-raised:not([disabled]):hover{background-color:"{{background-50}}"}.md-button.md-THEME_NAME-theme.md-raised:not([disabled]).md-focused{background-color:"{{background-200}}"}.md-button.md-THEME_NAME-theme.md-warn{color:"{{warn-color}}"}.md-button.md-THEME_NAME-theme.md-warn.md-fab,.md-button.md-THEME_NAME-theme.md-warn.md-raised{color:"{{warn-contrast}}";background-color:"{{warn-color}}"}.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]) md-icon,.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]) md-icon{color:"{{warn-contrast}}"}.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]):hover,.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]):hover{background-color:"{{warn-600}}"}.md-button.md-THEME_NAME-theme.md-warn:not([disabled]) md-icon{color:"{{warn-color}}"}.md-button.md-THEME_NAME-theme.md-accent{color:"{{accent-color}}"}.md-button.md-THEME_NAME-theme.md-accent.md-fab,.md-button.md-THEME_NAME-theme.md-accent.md-raised{color:"{{accent-contrast}}";background-color:"{{accent-color}}"}.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]) md-icon,.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]) md-icon{color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]):hover,.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]):hover{background-color:"{{accent-A700}}"}.md-button.md-THEME_NAME-theme.md-accent:not([disabled]) md-icon{color:"{{accent-color}}"}.md-button.md-THEME_NAME-theme.md-accent[disabled],.md-button.md-THEME_NAME-theme.md-fab[disabled],.md-button.md-THEME_NAME-theme.md-raised[disabled],.md-button.md-THEME_NAME-theme.md-warn[disabled],.md-button.md-THEME_NAME-theme[disabled]{color:"{{foreground-3}}";cursor:default}.md-button.md-THEME_NAME-theme.md-accent[disabled] md-icon,.md-button.md-THEME_NAME-theme.md-fab[disabled] md-icon,.md-button.md-THEME_NAME-theme.md-raised[disabled] md-icon,.md-button.md-THEME_NAME-theme.md-warn[disabled] md-icon,.md-button.md-THEME_NAME-theme[disabled] md-icon{color:"{{foreground-3}}"}.md-button.md-THEME_NAME-theme.md-fab[disabled],.md-button.md-THEME_NAME-theme.md-raised[disabled]{background-color:"{{foreground-4}}"}.md-button.md-THEME_NAME-theme[disabled]{background-color:transparent}._md a.md-THEME_NAME-theme:not(.md-button).md-primary{color:"{{primary-color}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-primary:hover{color:"{{primary-700}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-accent{color:"{{accent-color}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-accent:hover{color:"{{accent-A700}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-warn{color:"{{warn-color}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-warn:hover{color:"{{warn-700}}"}md-card.md-THEME_NAME-theme{color:"{{foreground-1}}";background-color:"{{background-hue-1}}";border-radius:2px}md-card.md-THEME_NAME-theme .md-card-image{border-radius:2px 2px 0 0}md-card.md-THEME_NAME-theme md-card-header md-card-avatar md-icon{color:"{{background-color}}";background-color:"{{foreground-3}}"}md-card.md-THEME_NAME-theme md-card-header md-card-header-text .md-subhead,md-card.md-THEME_NAME-theme md-card-title md-card-title-text:not(:only-child) .md-subhead{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme .md-ripple{color:"{{accent-A700}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-ripple{color:"{{background-600}}"}md-checkbox.md-THEME_NAME-theme.md-checked.md-focused .md-container:before{background-color:"{{accent-color-0.26}}"}md-checkbox.md-THEME_NAME-theme .md-ink-ripple{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-ink-ripple{color:"{{accent-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-icon{background-color:"{{accent-color-0.87}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-icon:after{border-color:"{{accent-contrast-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-ripple{color:"{{primary-600}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ripple{color:"{{background-600}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-ink-ripple{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple{color:"{{primary-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon{background-color:"{{primary-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked.md-focused .md-container:before{background-color:"{{primary-color-0.26}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon:after{border-color:"{{primary-contrast-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-indeterminate[disabled] .md-container{color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-ripple{color:"{{warn-600}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-ink-ripple{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple{color:"{{warn-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon{background-color:"{{warn-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked.md-focused:not([disabled]) .md-container:before{background-color:"{{warn-color-0.26}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon:after{border-color:"{{background-200}}"}md-checkbox.md-THEME_NAME-theme[disabled]:not(.md-checked) .md-icon{border-color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme[disabled].md-checked .md-icon{background-color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme[disabled].md-checked .md-icon:after{border-color:"{{background-200}}"}md-checkbox.md-THEME_NAME-theme[disabled] .md-icon:after{border-color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme[disabled] .md-label{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme .md-chips{box-shadow:0 1px "{{foreground-4}}"}md-chips.md-THEME_NAME-theme .md-chips.md-focused{box-shadow:0 2px "{{primary-color}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input{color:"{{foreground-1}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input:-moz-placeholder,md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input::-moz-placeholder{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input:-ms-input-placeholder{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input::-webkit-input-placeholder{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme md-chip{background:"{{background-300}}";color:"{{background-800}}"}md-chips.md-THEME_NAME-theme md-chip md-icon{color:"{{background-700}}"}md-chips.md-THEME_NAME-theme md-chip.md-focused{background:"{{primary-color}}";color:"{{primary-contrast}}"}md-chips.md-THEME_NAME-theme md-chip.md-focused md-icon{color:"{{primary-contrast}}"}md-chips.md-THEME_NAME-theme md-chip._md-chip-editing{background:transparent;color:"{{background-800}}"}md-chips.md-THEME_NAME-theme md-chip-remove .md-button md-icon path{fill:"{{background-500}}"}.md-contact-suggestion span.md-contact-email{color:"{{background-400}}"}md-content.md-THEME_NAME-theme{color:"{{foreground-1}}";background-color:"{{background-default}}"}.md-THEME_NAME-theme .md-calendar{background:"{{background-hue-1}}";color:"{{foreground-1-0.87}}"}.md-THEME_NAME-theme .md-calendar tr:last-child td{border-bottom-color:"{{background-hue-2}}"}.md-THEME_NAME-theme .md-calendar-day-header{background:"{{background-500-0.32}}";color:"{{foreground-1-0.87}}"}.md-THEME_NAME-theme .md-calendar-date.md-calendar-date-today .md-calendar-date-selection-indicator{border:1px solid "{{primary-500}}"}.md-THEME_NAME-theme .md-calendar-date.md-calendar-date-today.md-calendar-date-disabled{color:"{{primary-500-0.6}}"}.md-calendar-date.md-focus .md-THEME_NAME-theme .md-calendar-date-selection-indicator,.md-THEME_NAME-theme .md-calendar-date-selection-indicator:hover{background:"{{background-500-0.32}}"}.md-THEME_NAME-theme .md-calendar-date.md-calendar-selected-date .md-calendar-date-selection-indicator,.md-THEME_NAME-theme .md-calendar-date.md-focus.md-calendar-selected-date .md-calendar-date-selection-indicator{background:"{{primary-500}}";color:"{{primary-500-contrast}}";border-color:transparent}.md-THEME_NAME-theme .md-calendar-date-disabled,.md-THEME_NAME-theme .md-calendar-month-label-disabled{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-calendar-month-label md-icon,.md-THEME_NAME-theme .md-datepicker-input{color:"{{foreground-1}}"}.md-THEME_NAME-theme .md-datepicker-input:-moz-placeholder,.md-THEME_NAME-theme .md-datepicker-input::-moz-placeholder{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-datepicker-input:-ms-input-placeholder{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-datepicker-input::-webkit-input-placeholder{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-datepicker-input-container{border-bottom-color:"{{foreground-4}}"}.md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-focused{border-bottom-color:"{{primary-color}}"}.md-accent .md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-focused{border-bottom-color:"{{accent-color}}"}.md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-invalid,.md-warn .md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-focused{border-bottom-color:"{{warn-A700}}"}.md-THEME_NAME-theme .md-datepicker-calendar-pane{border-color:"{{background-hue-1}}"}.md-THEME_NAME-theme .md-datepicker-triangle-button .md-datepicker-expand-triangle{border-top-color:"{{foreground-2}}"}.md-THEME_NAME-theme .md-datepicker-open .md-datepicker-calendar-icon{color:"{{primary-color}}"}.md-accent .md-THEME_NAME-theme .md-datepicker-open .md-datepicker-calendar-icon,.md-THEME_NAME-theme .md-datepicker-open.md-accent .md-datepicker-calendar-icon{color:"{{accent-color}}"}.md-THEME_NAME-theme .md-datepicker-open.md-warn .md-datepicker-calendar-icon,.md-warn .md-THEME_NAME-theme .md-datepicker-open .md-datepicker-calendar-icon{color:"{{warn-A700}}"}.md-THEME_NAME-theme .md-datepicker-calendar{background:"{{background-hue-1}}"}.md-THEME_NAME-theme .md-datepicker-input-mask-opaque{box-shadow:0 0 0 9999px "{{background-hue-1}}"}.md-THEME_NAME-theme .md-datepicker-open .md-datepicker-input-container{background:"{{background-hue-1}}"}md-dialog.md-THEME_NAME-theme{border-radius:4px;background-color:"{{background-hue-1}}";color:"{{foreground-1}}"}md-dialog.md-THEME_NAME-theme.md-content-overflow .md-actions,md-dialog.md-THEME_NAME-theme.md-content-overflow md-dialog-actions,md-divider.md-THEME_NAME-theme{border-top-color:"{{foreground-4}}"}.layout-gt-lg-row>md-divider.md-THEME_NAME-theme,.layout-gt-md-row>md-divider.md-THEME_NAME-theme,.layout-gt-sm-row>md-divider.md-THEME_NAME-theme,.layout-gt-xs-row>md-divider.md-THEME_NAME-theme,.layout-lg-row>md-divider.md-THEME_NAME-theme,.layout-md-row>md-divider.md-THEME_NAME-theme,.layout-row>md-divider.md-THEME_NAME-theme,.layout-sm-row>md-divider.md-THEME_NAME-theme,.layout-xl-row>md-divider.md-THEME_NAME-theme,.layout-xs-row>md-divider.md-THEME_NAME-theme{border-right-color:"{{foreground-4}}"}md-icon.md-THEME_NAME-theme{color:"{{foreground-2}}"}md-icon.md-THEME_NAME-theme.md-primary{color:"{{primary-color}}"}md-icon.md-THEME_NAME-theme.md-accent{color:"{{accent-color}}"}md-icon.md-THEME_NAME-theme.md-warn{color:"{{warn-color}}"}md-input-container.md-THEME_NAME-theme .md-input{color:"{{foreground-1}}";border-color:"{{foreground-4}}"}md-input-container.md-THEME_NAME-theme .md-input:-moz-placeholder,md-input-container.md-THEME_NAME-theme .md-input::-moz-placeholder{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme .md-input:-ms-input-placeholder{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme .md-input::-webkit-input-placeholder{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme>md-icon{color:"{{foreground-1}}"}md-input-container.md-THEME_NAME-theme .md-placeholder,md-input-container.md-THEME_NAME-theme label{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme label.md-required:after{color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-focused):not(.md-input-invalid) label.md-required:after{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme .md-input-message-animation,md-input-container.md-THEME_NAME-theme .md-input-messages-animation{color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme .md-input-message-animation .md-char-counter,md-input-container.md-THEME_NAME-theme .md-input-messages-animation .md-char-counter{color:"{{foreground-1}}"}md-input-container.md-THEME_NAME-theme.md-input-focused .md-input:-moz-placeholder,md-input-container.md-THEME_NAME-theme.md-input-focused .md-input::-moz-placeholder{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme.md-input-focused .md-input:-ms-input-placeholder{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme.md-input-focused .md-input::-webkit-input-placeholder{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-has-value label{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused .md-input,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-resized .md-input{border-color:"{{primary-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused label,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused md-icon{color:"{{primary-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent .md-input{border-color:"{{accent-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent label,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent md-icon{color:"{{accent-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn .md-input{border-color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn label,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn md-icon{color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme.md-input-invalid .md-input{border-color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme.md-input-invalid .md-char-counter,md-input-container.md-THEME_NAME-theme.md-input-invalid .md-input-message-animation,md-input-container.md-THEME_NAME-theme.md-input-invalid label{color:"{{warn-A700}}"}[disabled] md-input-container.md-THEME_NAME-theme .md-input,md-input-container.md-THEME_NAME-theme .md-input[disabled]{border-bottom-color:transparent;color:"{{foreground-3}}";background-image:linear-gradient(90deg,"{{foreground-3}}" 0,"{{foreground-3}}" 33%,transparent 0);background-image:-ms-linear-gradient(left,transparent 0,"{{foreground-3}}" 100%)}md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text h3,md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text h4,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text h3,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text h4{color:"{{foreground-1}}"}md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text p,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text p{color:"{{foreground-2}}"}md-list.md-THEME_NAME-theme .md-proxy-focus.md-focused div.md-no-style{background-color:"{{background-100}}"}md-list.md-THEME_NAME-theme md-list-item .md-avatar-icon{background-color:"{{foreground-3}}";color:"{{background-color}}"}md-list.md-THEME_NAME-theme md-list-item>md-icon{color:"{{foreground-2}}"}md-list.md-THEME_NAME-theme md-list-item>md-icon.md-highlight{color:"{{primary-color}}"}md-list.md-THEME_NAME-theme md-list-item>md-icon.md-highlight.md-accent{color:"{{accent-color}}"}md-menu-content.md-THEME_NAME-theme{background-color:"{{background-hue-1}}"}md-menu-content.md-THEME_NAME-theme md-menu-item{color:"{{foreground-1}}"}md-menu-content.md-THEME_NAME-theme md-menu-item md-icon{color:"{{foreground-2}}"}md-menu-content.md-THEME_NAME-theme md-menu-item .md-button[disabled],md-menu-content.md-THEME_NAME-theme md-menu-item .md-button[disabled] md-icon{color:"{{foreground-3}}"}md-menu-content.md-THEME_NAME-theme md-menu-divider{background-color:"{{foreground-4}}"}md-menu-bar.md-THEME_NAME-theme>button.md-button{color:"{{foreground-1}}";border-radius:2px}md-menu-bar.md-THEME_NAME-theme md-menu>button{color:"{{foreground-1}}"}md-menu-bar.md-THEME_NAME-theme md-menu.md-open>button,md-menu-bar.md-THEME_NAME-theme md-menu>button:focus{outline:none;background-color:"{{ background-500-0.18}}"}md-menu-bar.md-THEME_NAME-theme.md-open:not(.md-keyboard-mode) md-menu:hover>button{background-color:"{{ background-500-0.18}}"}md-menu-bar.md-THEME_NAME-theme:not(.md-keyboard-mode):not(.md-open) md-menu button:focus,md-menu-bar.md-THEME_NAME-theme:not(.md-keyboard-mode):not(.md-open) md-menu button:hover{background:transparent}md-menu-content.md-THEME_NAME-theme .md-menu>.md-button:after{color:"{{foreground-2}}"}md-menu-content.md-THEME_NAME-theme .md-menu.md-open>.md-button{background-color:"{{ background-500-0.18}}"}md-toolbar.md-THEME_NAME-theme.md-menu-toolbar{background-color:"{{background-hue-1}}";color:"{{foreground-1}}"}md-toolbar.md-THEME_NAME-theme.md-menu-toolbar md-toolbar-filler{background-color:"{{primary-color}}";color:"{{primary-contrast}}"}md-toolbar.md-THEME_NAME-theme.md-menu-toolbar md-toolbar-filler md-icon{color:"{{primary-contrast}}"}md-nav-bar.md-THEME_NAME-theme .md-nav-bar{background-color:transparent;border-color:"{{foreground-4}}"}md-nav-bar.md-THEME_NAME-theme .md-button._md-nav-button.md-unselected{color:"{{foreground-2}}"}md-nav-bar.md-THEME_NAME-theme .md-button._md-nav-button[disabled]{color:"{{foreground-3}}"}md-nav-bar.md-THEME_NAME-theme md-nav-ink-bar{color:"{{accent-color}}";background:"{{accent-color}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar{background-color:"{{accent-color}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button{color:"{{accent-A100}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button.md-active,md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{accent-contrast}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{accent-contrast-0.1}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar md-nav-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar{background-color:"{{warn-color}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button{color:"{{warn-100}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button.md-active,md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{warn-contrast}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{warn-contrast-0.1}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar{background-color:"{{primary-color}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button{color:"{{primary-100}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button.md-active,md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{primary-contrast}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{primary-contrast-0.1}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar{background-color:"{{primary-color}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button{color:"{{primary-100}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-active,md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{primary-contrast}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{primary-contrast-0.1}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar{background-color:"{{accent-color}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button{color:"{{accent-A100}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-active,md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{accent-contrast}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{accent-contrast-0.1}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar md-nav-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar{background-color:"{{warn-color}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button{color:"{{warn-100}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-active,md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{warn-contrast}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{warn-contrast-0.1}}"}._md-panel-backdrop.md-THEME_NAME-theme{background-color:"{{background-900-1.0}}"}md-progress-circular.md-THEME_NAME-theme path{stroke:"{{primary-color}}"}md-progress-circular.md-THEME_NAME-theme.md-warn path{stroke:"{{warn-color}}"}md-progress-circular.md-THEME_NAME-theme.md-accent path{stroke:"{{accent-color}}"}md-progress-linear.md-THEME_NAME-theme .md-container{background-color:"{{primary-100}}"}md-progress-linear.md-THEME_NAME-theme .md-bar{background-color:"{{primary-color}}"}md-progress-linear.md-THEME_NAME-theme.md-warn .md-container{background-color:"{{warn-100}}"}md-progress-linear.md-THEME_NAME-theme.md-warn .md-bar{background-color:"{{warn-color}}"}md-progress-linear.md-THEME_NAME-theme.md-accent .md-container{background-color:"{{accent-100}}"}md-progress-linear.md-THEME_NAME-theme.md-accent .md-bar{background-color:"{{accent-color}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-primary .md-bar1{background-color:"{{primary-100}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-primary .md-dashed:before{background:radial-gradient("{{primary-100}}" 0,"{{primary-100}}" 16%,transparent 42%)}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-bar1{background-color:"{{warn-100}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-dashed:before{background:radial-gradient("{{warn-100}}" 0,"{{warn-100}}" 16%,transparent 42%)}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-bar1{background-color:"{{accent-100}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-dashed:before{background:radial-gradient("{{accent-100}}" 0,"{{accent-100}}" 16%,transparent 42%)}md-radio-button.md-THEME_NAME-theme .md-off{border-color:"{{foreground-2}}"}md-radio-button.md-THEME_NAME-theme .md-on{background-color:"{{accent-color-0.87}}"}md-radio-button.md-THEME_NAME-theme.md-checked .md-off{border-color:"{{accent-color-0.87}}"}md-radio-button.md-THEME_NAME-theme.md-checked .md-ink-ripple{color:"{{accent-color-0.87}}"}md-radio-button.md-THEME_NAME-theme .md-container .md-ripple{color:"{{accent-A700}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on{background-color:"{{primary-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off{border-color:"{{primary-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple{color:"{{primary-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple{color:"{{primary-600}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on{background-color:"{{warn-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off{border-color:"{{warn-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple{color:"{{warn-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple{color:"{{warn-600}}"}md-radio-button.md-THEME_NAME-theme[disabled],md-radio-group.md-THEME_NAME-theme[disabled]{color:"{{foreground-3}}"}md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-off,md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-on,md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-off,md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-on{border-color:"{{foreground-3}}"}md-radio-group.md-THEME_NAME-theme .md-checked .md-ink-ripple{color:"{{accent-color-0.26}}"}md-radio-group.md-THEME_NAME-theme .md-checked:not([disabled]).md-primary .md-ink-ripple,md-radio-group.md-THEME_NAME-theme.md-primary .md-checked:not([disabled]) .md-ink-ripple{color:"{{primary-color-0.26}}"}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked .md-container:before{background-color:"{{accent-color-0.26}}"}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-primary .md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-primary .md-checked .md-container:before{background-color:"{{primary-color-0.26}}"}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-warn .md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-warn .md-checked .md-container:before{background-color:"{{warn-color-0.26}}"}md-input-container md-select.md-THEME_NAME-theme .md-select-value span:first-child:after{color:"{{warn-A700}}"}md-input-container:not(.md-input-focused):not(.md-input-invalid) md-select.md-THEME_NAME-theme .md-select-value span:first-child:after{color:"{{foreground-3}}"}md-input-container.md-input-focused:not(.md-input-has-value) md-select.md-THEME_NAME-theme .md-select-value,md-input-container.md-input-focused:not(.md-input-has-value) md-select.md-THEME_NAME-theme .md-select-value.md-select-placeholder{color:"{{primary-color}}"}md-input-container.md-input-invalid md-select.md-THEME_NAME-theme .md-select-value{color:"{{warn-A700}}"!important;border-bottom-color:"{{warn-A700}}"!important}md-input-container.md-input-invalid md-select.md-THEME_NAME-theme.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-select.md-THEME_NAME-theme[disabled] .md-select-value{border-bottom-color:transparent;background-image:linear-gradient(90deg,"{{foreground-3}}" 0,"{{foreground-3}}" 33%,transparent 0);background-image:-ms-linear-gradient(left,transparent 0,"{{foreground-3}}" 100%)}md-select.md-THEME_NAME-theme .md-select-value{border-bottom-color:"{{foreground-4}}"}md-select.md-THEME_NAME-theme .md-select-value.md-select-placeholder{color:"{{foreground-3}}"}md-select.md-THEME_NAME-theme .md-select-value span:first-child:after{color:"{{warn-A700}}"}md-select.md-THEME_NAME-theme.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-select.md-THEME_NAME-theme.ng-invalid.ng-touched .md-select-value{color:"{{warn-A700}}"!important;border-bottom-color:"{{warn-A700}}"!important}md-select.md-THEME_NAME-theme.ng-invalid.ng-touched.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value{border-bottom-color:"{{primary-color}}";color:"{{ foreground-1 }}"}md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value.md-select-placeholder{color:"{{ foreground-1 }}"}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-accent .md-select-value{border-bottom-color:"{{accent-color}}"}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-warn .md-select-value{border-bottom-color:"{{warn-color}}"}md-select.md-THEME_NAME-theme[disabled] .md-select-icon,md-select.md-THEME_NAME-theme[disabled] .md-select-value,md-select.md-THEME_NAME-theme[disabled] .md-select-value.md-select-placeholder{color:"{{foreground-3}}"}md-select.md-THEME_NAME-theme .md-select-icon{color:"{{foreground-2}}"}md-select-menu.md-THEME_NAME-theme md-content{background-color:"{{background-hue-1}}"}md-select-menu.md-THEME_NAME-theme md-content md-optgroup{color:"{{foreground-2}}"}md-select-menu.md-THEME_NAME-theme md-content md-option{color:"{{foreground-1}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[disabled] .md-text{color:"{{foreground-3}}"}md-select-menu.md-THEME_NAME-theme md-content md-option:not([disabled]):focus,md-select-menu.md-THEME_NAME-theme md-content md-option:not([disabled]):hover{background-color:"{{background-500-0.18}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected]{color:"{{primary-500}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected]:focus{color:"{{primary-600}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected].md-accent{color:"{{accent-color}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected].md-accent:focus{color:"{{accent-A700}}"}.md-checkbox-enabled.md-THEME_NAME-theme .md-ripple{color:"{{primary-600}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-ripple{color:"{{background-600}}"}.md-checkbox-enabled.md-THEME_NAME-theme .md-ink-ripple{color:"{{foreground-2}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-ink-ripple{color:"{{primary-color-0.87}}"}.md-checkbox-enabled.md-THEME_NAME-theme:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-icon{background-color:"{{primary-color-0.87}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected].md-focused .md-container:before{background-color:"{{primary-color-0.26}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-icon:after{border-color:"{{primary-contrast-0.87}}"}.md-checkbox-enabled.md-THEME_NAME-theme .md-indeterminate[disabled] .md-container{color:"{{foreground-3}}"}.md-checkbox-enabled.md-THEME_NAME-theme md-option .md-text{color:"{{foreground-1}}"}md-sidenav.md-THEME_NAME-theme,md-sidenav.md-THEME_NAME-theme md-content{background-color:"{{background-hue-1}}"}md-slider.md-THEME_NAME-theme .md-track{background-color:"{{foreground-3}}"}md-slider.md-THEME_NAME-theme .md-track-ticks{color:"{{background-contrast}}"}md-slider.md-THEME_NAME-theme .md-focus-ring{background-color:"{{accent-A200-0.2}}"}md-slider.md-THEME_NAME-theme .md-disabled-thumb{border-color:"{{background-color}}";background-color:"{{background-color}}"}md-slider.md-THEME_NAME-theme.md-min .md-thumb:after{background-color:"{{background-color}}";border-color:"{{foreground-3}}"}md-slider.md-THEME_NAME-theme.md-min .md-focus-ring{background-color:"{{foreground-3-0.38}}"}md-slider.md-THEME_NAME-theme.md-min[md-discrete] .md-thumb:after{background-color:"{{background-contrast}}";border-color:transparent}md-slider.md-THEME_NAME-theme.md-min[md-discrete] .md-sign{background-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme.md-min[md-discrete] .md-sign:after{border-top-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme.md-min[md-discrete][md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme .md-track.md-track-fill{background-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-thumb:after{border-color:"{{accent-color}}";background-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-sign{background-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-sign:after{border-top-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme[md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-thumb-text{color:"{{accent-contrast}}"}md-slider.md-THEME_NAME-theme.md-warn .md-focus-ring{background-color:"{{warn-200-0.38}}"}md-slider.md-THEME_NAME-theme.md-warn .md-track.md-track-fill{background-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-thumb:after{border-color:"{{warn-color}}";background-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-sign{background-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-sign:after{border-top-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn[md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-thumb-text{color:"{{warn-contrast}}"}md-slider.md-THEME_NAME-theme.md-primary .md-focus-ring{background-color:"{{primary-200-0.38}}"}md-slider.md-THEME_NAME-theme.md-primary .md-track.md-track-fill{background-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-thumb:after{border-color:"{{primary-color}}";background-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-sign{background-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-sign:after{border-top-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary[md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-thumb-text{color:"{{primary-contrast}}"}md-slider.md-THEME_NAME-theme[disabled] .md-thumb:after{border-color:transparent}md-slider.md-THEME_NAME-theme[disabled]:not(.md-min) .md-thumb:after,md-slider.md-THEME_NAME-theme[disabled][md-discrete] .md-thumb:after{background-color:"{{foreground-3}}";border-color:transparent}md-slider.md-THEME_NAME-theme[disabled][readonly] .md-sign{background-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme[disabled][readonly] .md-sign:after{border-top-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme[disabled][readonly][md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme[disabled][readonly] .md-disabled-thumb{border-color:transparent;background-color:transparent}md-slider-container[disabled]>:first-child:not(md-slider),md-slider-container[disabled]>:last-child:not(md-slider){color:"{{foreground-3}}"}.md-subheader.md-THEME_NAME-theme{color:"{{ foreground-2-0.23 }}";background-color:"{{background-default}}"}.md-subheader.md-THEME_NAME-theme.md-primary{color:"{{primary-color}}"}.md-subheader.md-THEME_NAME-theme.md-accent{color:"{{accent-color}}"}.md-subheader.md-THEME_NAME-theme.md-warn{color:"{{warn-color}}"}md-switch.md-THEME_NAME-theme .md-ink-ripple{color:"{{background-500}}"}md-switch.md-THEME_NAME-theme .md-thumb{background-color:"{{background-50}}"}md-switch.md-THEME_NAME-theme .md-bar{background-color:"{{background-500}}"}md-switch.md-THEME_NAME-theme.md-checked .md-ink-ripple{color:"{{accent-color}}"}md-switch.md-THEME_NAME-theme.md-checked .md-thumb{background-color:"{{accent-color}}"}md-switch.md-THEME_NAME-theme.md-checked .md-bar{background-color:"{{accent-color-0.5}}"}md-switch.md-THEME_NAME-theme.md-checked.md-focused .md-thumb:before{background-color:"{{accent-color-0.26}}"}md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-ink-ripple{color:"{{primary-color}}"}md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-thumb{background-color:"{{primary-color}}"}md-switch.md-THEME_NAME-theme.md-checked.md-primary .md-bar{background-color:"{{primary-color-0.5}}"}md-switch.md-THEME_NAME-theme.md-checked.md-primary.md-focused .md-thumb:before{background-color:"{{primary-color-0.26}}"}md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-ink-ripple{color:"{{warn-color}}"}md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-thumb{background-color:"{{warn-color}}"}md-switch.md-THEME_NAME-theme.md-checked.md-warn .md-bar{background-color:"{{warn-color-0.5}}"}md-switch.md-THEME_NAME-theme.md-checked.md-warn.md-focused .md-thumb:before{background-color:"{{warn-color-0.26}}"}md-switch.md-THEME_NAME-theme[disabled] .md-thumb{background-color:"{{background-400}}"}md-switch.md-THEME_NAME-theme[disabled] .md-bar{background-color:"{{foreground-4}}"}md-tabs.md-THEME_NAME-theme md-tabs-wrapper{background-color:transparent;border-color:"{{foreground-4}}"}md-tabs.md-THEME_NAME-theme .md-paginator md-icon{color:"{{primary-color}}"}md-tabs.md-THEME_NAME-theme md-ink-bar{color:"{{accent-color}}";background:"{{accent-color}}"}md-tabs.md-THEME_NAME-theme .md-tab{color:"{{foreground-2}}"}md-tabs.md-THEME_NAME-theme .md-tab[disabled],md-tabs.md-THEME_NAME-theme .md-tab[disabled] md-icon{color:"{{foreground-3}}"}md-tabs.md-THEME_NAME-theme .md-tab.md-active,md-tabs.md-THEME_NAME-theme .md-tab.md-active md-icon,md-tabs.md-THEME_NAME-theme .md-tab.md-focused,md-tabs.md-THEME_NAME-theme .md-tab.md-focused md-icon{color:"{{primary-color}}"}md-tabs.md-THEME_NAME-theme .md-tab.md-focused{background:"{{primary-color-0.1}}"}md-tabs.md-THEME_NAME-theme .md-tab .md-ripple-container{color:"{{accent-A100}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper{background-color:"{{accent-color}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{accent-A100}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{accent-contrast}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{accent-contrast-0.1}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper{background-color:"{{primary-color}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{primary-100}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{primary-contrast}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{primary-contrast-0.1}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper{background-color:"{{warn-color}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{warn-100}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{warn-contrast}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{warn-contrast-0.1}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:"{{primary-color}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{primary-100}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{primary-contrast}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{primary-contrast-0.1}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:"{{accent-color}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{accent-A100}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{accent-contrast}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{accent-contrast-0.1}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:"{{warn-color}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{warn-100}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{warn-contrast}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{warn-contrast-0.1}}"}md-toast.md-THEME_NAME-theme .md-toast-content{background-color:#323232;color:"{{background-50}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button{color:"{{background-50}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight{color:"{{accent-color}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-primary{color:"{{primary-color}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-warn{color:"{{warn-color}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar){background-color:"{{primary-color}}";color:"{{primary-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) md-icon{color:"{{primary-contrast}}";fill:"{{primary-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) .md-button[disabled] md-icon{color:"{{primary-contrast-0.26}}";fill:"{{primary-contrast-0.26}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent{background-color:"{{accent-color}}";color:"{{accent-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent .md-ink-ripple{color:"{{accent-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent md-icon{color:"{{accent-contrast}}";fill:"{{accent-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent .md-button[disabled] md-icon{color:"{{accent-contrast-0.26}}";fill:"{{accent-contrast-0.26}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-warn{background-color:"{{warn-color}}";color:"{{warn-contrast}}"}.md-panel.md-tooltip.md-THEME_NAME-theme{color:"{{background-700-contrast}}";background-color:"{{background-700}}"}body.md-THEME_NAME-theme,html.md-THEME_NAME-theme{color:"{{foreground-1}}";background-color:"{{background-color}}"}')
+                e.$inject = ["$log"], ue.module("material.components.whiteframe", ["material.core"]).directive("mdWhiteframe", e)
+            }(), ue.module("material.core").constant("$MD_THEME_CSS", 'md-autocomplete.md-THEME_NAME-theme{background:"{{background-hue-1}}"}md-autocomplete.md-THEME_NAME-theme[disabled]:not([md-floating-label]){background:"{{background-hue-2}}"}md-autocomplete.md-THEME_NAME-theme button md-icon path{fill:"{{background-600}}"}md-autocomplete.md-THEME_NAME-theme button:after{background:"{{background-600-0.3}}"}md-autocomplete.md-THEME_NAME-theme input{color:"{{foreground-1}}"}md-autocomplete.md-THEME_NAME-theme.md-accent md-input-container.md-input-focused .md-input{border-color:"{{accent-color}}"}md-autocomplete.md-THEME_NAME-theme.md-accent md-input-container.md-input-focused label,md-autocomplete.md-THEME_NAME-theme.md-accent md-input-container.md-input-focused md-icon{color:"{{accent-color}}"}md-autocomplete.md-THEME_NAME-theme.md-accent md-progress-linear .md-container{background-color:"{{accent-100}}"}md-autocomplete.md-THEME_NAME-theme.md-accent md-progress-linear .md-bar{background-color:"{{accent-color}}"}md-autocomplete.md-THEME_NAME-theme.md-warn md-input-container.md-input-focused .md-input{border-color:"{{warn-A700}}"}md-autocomplete.md-THEME_NAME-theme.md-warn md-input-container.md-input-focused label,md-autocomplete.md-THEME_NAME-theme.md-warn md-input-container.md-input-focused md-icon{color:"{{warn-A700}}"}md-autocomplete.md-THEME_NAME-theme.md-warn md-progress-linear .md-container{background-color:"{{warn-100}}"}md-autocomplete.md-THEME_NAME-theme.md-warn md-progress-linear .md-bar{background-color:"{{warn-color}}"}.md-autocomplete-standard-list-container.md-THEME_NAME-theme,.md-autocomplete-suggestions-container.md-THEME_NAME-theme{background:"{{background-hue-1}}"}.md-autocomplete-standard-list-container.md-THEME_NAME-theme li,.md-autocomplete-suggestions-container.md-THEME_NAME-theme li{color:"{{foreground-1}}"}.md-autocomplete-standard-list-container.md-THEME_NAME-theme li#selected_option,.md-autocomplete-standard-list-container.md-THEME_NAME-theme li:hover,.md-autocomplete-suggestions-container.md-THEME_NAME-theme li#selected_option,.md-autocomplete-suggestions-container.md-THEME_NAME-theme li:hover{background:"{{background-500-0.18}}"}md-backdrop{background-color:"{{background-900-0.0}}"}md-backdrop.md-opaque.md-THEME_NAME-theme{background-color:"{{background-900-1.0}}"}md-bottom-sheet.md-THEME_NAME-theme{background-color:"{{background-color}}";border-top-color:"{{background-hue-3}}"}md-bottom-sheet.md-THEME_NAME-theme.md-list md-list-item{color:"{{foreground-1}}"}md-bottom-sheet.md-THEME_NAME-theme .md-subheader{background-color:"{{background-color}}";color:"{{foreground-1}}"}.md-button.md-THEME_NAME-theme:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme:not([disabled]):hover{background-color:"{{background-500-0.2}}"}.md-button.md-THEME_NAME-theme:not([disabled]).md-icon-button:hover{background-color:transparent}.md-button.md-THEME_NAME-theme.md-fab md-icon{color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-primary{color:"{{primary-color}}"}.md-button.md-THEME_NAME-theme.md-primary.md-fab,.md-button.md-THEME_NAME-theme.md-primary.md-raised{color:"{{primary-contrast}}";background-color:"{{primary-color}}"}.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]) md-icon,.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]) md-icon{color:"{{primary-contrast}}"}.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-primary.md-fab:not([disabled]):hover,.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-primary.md-raised:not([disabled]):hover{background-color:"{{primary-600}}"}.md-button.md-THEME_NAME-theme.md-primary:not([disabled]) md-icon{color:"{{primary-color}}"}.md-button.md-THEME_NAME-theme.md-fab{background-color:"{{accent-color}}";color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-fab:not([disabled]) .md-icon{color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-fab:not([disabled]):hover{background-color:"{{accent-A700}}"}.md-button.md-THEME_NAME-theme.md-raised{color:"{{background-900}}";background-color:"{{background-50}}"}.md-button.md-THEME_NAME-theme.md-raised:not([disabled]) md-icon{color:"{{background-900}}"}.md-button.md-THEME_NAME-theme.md-raised:not([disabled]):hover{background-color:"{{background-50}}"}.md-button.md-THEME_NAME-theme.md-raised:not([disabled]).md-focused{background-color:"{{background-200}}"}.md-button.md-THEME_NAME-theme.md-warn{color:"{{warn-color}}"}.md-button.md-THEME_NAME-theme.md-warn.md-fab,.md-button.md-THEME_NAME-theme.md-warn.md-raised{color:"{{warn-contrast}}";background-color:"{{warn-color}}"}.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]) md-icon,.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]) md-icon{color:"{{warn-contrast}}"}.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-warn.md-fab:not([disabled]):hover,.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-warn.md-raised:not([disabled]):hover{background-color:"{{warn-600}}"}.md-button.md-THEME_NAME-theme.md-warn:not([disabled]) md-icon{color:"{{warn-color}}"}.md-button.md-THEME_NAME-theme.md-accent{color:"{{accent-color}}"}.md-button.md-THEME_NAME-theme.md-accent.md-fab,.md-button.md-THEME_NAME-theme.md-accent.md-raised{color:"{{accent-contrast}}";background-color:"{{accent-color}}"}.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]) md-icon,.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]) md-icon{color:"{{accent-contrast}}"}.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-accent.md-fab:not([disabled]):hover,.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]).md-focused,.md-button.md-THEME_NAME-theme.md-accent.md-raised:not([disabled]):hover{background-color:"{{accent-A700}}"}.md-button.md-THEME_NAME-theme.md-accent:not([disabled]) md-icon{color:"{{accent-color}}"}.md-button.md-THEME_NAME-theme.md-accent[disabled],.md-button.md-THEME_NAME-theme.md-fab[disabled],.md-button.md-THEME_NAME-theme.md-raised[disabled],.md-button.md-THEME_NAME-theme.md-warn[disabled],.md-button.md-THEME_NAME-theme[disabled]{color:"{{foreground-3}}";cursor:default}.md-button.md-THEME_NAME-theme.md-accent[disabled] md-icon,.md-button.md-THEME_NAME-theme.md-fab[disabled] md-icon,.md-button.md-THEME_NAME-theme.md-raised[disabled] md-icon,.md-button.md-THEME_NAME-theme.md-warn[disabled] md-icon,.md-button.md-THEME_NAME-theme[disabled] md-icon{color:"{{foreground-3}}"}.md-button.md-THEME_NAME-theme.md-fab[disabled],.md-button.md-THEME_NAME-theme.md-raised[disabled]{background-color:"{{foreground-4}}"}.md-button.md-THEME_NAME-theme[disabled]{background-color:transparent}._md a.md-THEME_NAME-theme:not(.md-button).md-primary{color:"{{primary-color}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-primary:hover{color:"{{primary-700}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-accent{color:"{{accent-color}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-accent:hover{color:"{{accent-A700}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-warn{color:"{{warn-color}}"}._md a.md-THEME_NAME-theme:not(.md-button).md-warn:hover{color:"{{warn-700}}"}md-card.md-THEME_NAME-theme{color:"{{foreground-1}}";background-color:"{{background-hue-1}}";border-radius:2px}md-card.md-THEME_NAME-theme .md-card-image{border-radius:2px 2px 0 0}md-card.md-THEME_NAME-theme md-card-header md-card-avatar md-icon{color:"{{background-color}}";background-color:"{{foreground-3}}"}md-card.md-THEME_NAME-theme md-card-header md-card-header-text .md-subhead,md-card.md-THEME_NAME-theme md-card-title md-card-title-text:not(:only-child) .md-subhead{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme .md-ripple{color:"{{accent-A700}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-ripple{color:"{{background-600}}"}md-checkbox.md-THEME_NAME-theme.md-checked.md-focused .md-container:before{background-color:"{{accent-color-0.26}}"}md-checkbox.md-THEME_NAME-theme .md-ink-ripple{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-ink-ripple{color:"{{accent-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-icon{background-color:"{{accent-color-0.87}}"}md-checkbox.md-THEME_NAME-theme.md-checked .md-icon:after{border-color:"{{accent-contrast-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-ripple{color:"{{primary-600}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ripple{color:"{{background-600}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-ink-ripple{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple{color:"{{primary-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon{background-color:"{{primary-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked.md-focused .md-container:before{background-color:"{{primary-color-0.26}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-icon:after{border-color:"{{primary-contrast-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-primary .md-indeterminate[disabled] .md-container{color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-ripple{color:"{{warn-600}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn .md-ink-ripple{color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple{color:"{{warn-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon{background-color:"{{warn-color-0.87}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked.md-focused:not([disabled]) .md-container:before{background-color:"{{warn-color-0.26}}"}md-checkbox.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-icon:after{border-color:"{{background-200}}"}md-checkbox.md-THEME_NAME-theme[disabled]:not(.md-checked) .md-icon{border-color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme[disabled].md-checked .md-icon{background-color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme[disabled].md-checked .md-icon:after{border-color:"{{background-200}}"}md-checkbox.md-THEME_NAME-theme[disabled] .md-icon:after{border-color:"{{foreground-3}}"}md-checkbox.md-THEME_NAME-theme[disabled] .md-label{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme .md-chips{box-shadow:0 1px "{{foreground-4}}"}md-chips.md-THEME_NAME-theme .md-chips.md-focused{box-shadow:0 2px "{{primary-color}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input{color:"{{foreground-1}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input:-moz-placeholder,md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input::-moz-placeholder{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input:-ms-input-placeholder{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme .md-chips .md-chip-input-container input::-webkit-input-placeholder{color:"{{foreground-3}}"}md-chips.md-THEME_NAME-theme md-chip{background:"{{background-300}}";color:"{{background-800}}"}md-chips.md-THEME_NAME-theme md-chip md-icon{color:"{{background-700}}"}md-chips.md-THEME_NAME-theme md-chip.md-focused{background:"{{primary-color}}";color:"{{primary-contrast}}"}md-chips.md-THEME_NAME-theme md-chip.md-focused md-icon{color:"{{primary-contrast}}"}md-chips.md-THEME_NAME-theme md-chip._md-chip-editing{background:transparent;color:"{{background-800}}"}md-chips.md-THEME_NAME-theme md-chip-remove .md-button md-icon path{fill:"{{background-500}}"}.md-contact-suggestion span.md-contact-email{color:"{{background-400}}"}md-content.md-THEME_NAME-theme{color:"{{foreground-1}}";background-color:"{{background-default}}"}.md-THEME_NAME-theme .md-calendar{background:"{{background-hue-1}}";color:"{{foreground-1-0.87}}"}.md-THEME_NAME-theme .md-calendar tr:last-child td{border-bottom-color:"{{background-hue-2}}"}.md-THEME_NAME-theme .md-calendar-day-header{background:"{{background-500-0.32}}";color:"{{foreground-1-0.87}}"}.md-THEME_NAME-theme .md-calendar-date.md-calendar-date-today .md-calendar-date-selection-indicator{border:1px solid "{{primary-500}}"}.md-THEME_NAME-theme .md-calendar-date.md-calendar-date-today.md-calendar-date-disabled{color:"{{primary-500-0.6}}"}.md-calendar-date.md-focus .md-THEME_NAME-theme .md-calendar-date-selection-indicator,.md-THEME_NAME-theme .md-calendar-date-selection-indicator:hover{background:"{{background-500-0.32}}"}.md-THEME_NAME-theme .md-calendar-date.md-calendar-selected-date .md-calendar-date-selection-indicator,.md-THEME_NAME-theme .md-calendar-date.md-focus.md-calendar-selected-date .md-calendar-date-selection-indicator{background:"{{primary-500}}";color:"{{primary-500-contrast}}";border-color:transparent}.md-THEME_NAME-theme .md-calendar-date-disabled,.md-THEME_NAME-theme .md-calendar-month-label-disabled{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-calendar-month-label md-icon,.md-THEME_NAME-theme .md-datepicker-input{color:"{{foreground-1}}"}.md-THEME_NAME-theme .md-datepicker-input:-moz-placeholder,.md-THEME_NAME-theme .md-datepicker-input::-moz-placeholder{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-datepicker-input:-ms-input-placeholder{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-datepicker-input::-webkit-input-placeholder{color:"{{foreground-3}}"}.md-THEME_NAME-theme .md-datepicker-input-container{border-bottom-color:"{{foreground-4}}"}.md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-focused{border-bottom-color:"{{primary-color}}"}.md-accent .md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-focused{border-bottom-color:"{{accent-color}}"}.md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-invalid,.md-warn .md-THEME_NAME-theme .md-datepicker-input-container.md-datepicker-focused{border-bottom-color:"{{warn-A700}}"}.md-THEME_NAME-theme .md-datepicker-calendar-pane{border-color:"{{background-hue-1}}"}.md-THEME_NAME-theme .md-datepicker-triangle-button .md-datepicker-expand-triangle{border-top-color:"{{foreground-2}}"}.md-THEME_NAME-theme .md-datepicker-open .md-datepicker-calendar-icon{color:"{{primary-color}}"}.md-accent .md-THEME_NAME-theme .md-datepicker-open .md-datepicker-calendar-icon,.md-THEME_NAME-theme .md-datepicker-open.md-accent .md-datepicker-calendar-icon{color:"{{accent-color}}"}.md-THEME_NAME-theme .md-datepicker-open.md-warn .md-datepicker-calendar-icon,.md-warn .md-THEME_NAME-theme .md-datepicker-open .md-datepicker-calendar-icon{color:"{{warn-A700}}"}.md-THEME_NAME-theme .md-datepicker-calendar{background:"{{background-hue-1}}"}.md-THEME_NAME-theme .md-datepicker-input-mask-opaque{box-shadow:0 0 0 9999px "{{background-hue-1}}"}.md-THEME_NAME-theme .md-datepicker-open .md-datepicker-input-container{background:"{{background-hue-1}}"}md-dialog.md-THEME_NAME-theme{border-radius:4px;background-color:"{{background-hue-1}}";color:"{{foreground-1}}"}md-dialog.md-THEME_NAME-theme.md-content-overflow .md-actions,md-dialog.md-THEME_NAME-theme.md-content-overflow md-dialog-actions,md-divider.md-THEME_NAME-theme{border-top-color:"{{foreground-4}}"}.layout-gt-lg-row>md-divider.md-THEME_NAME-theme,.layout-gt-md-row>md-divider.md-THEME_NAME-theme,.layout-gt-sm-row>md-divider.md-THEME_NAME-theme,.layout-gt-xs-row>md-divider.md-THEME_NAME-theme,.layout-lg-row>md-divider.md-THEME_NAME-theme,.layout-md-row>md-divider.md-THEME_NAME-theme,.layout-row>md-divider.md-THEME_NAME-theme,.layout-sm-row>md-divider.md-THEME_NAME-theme,.layout-xl-row>md-divider.md-THEME_NAME-theme,.layout-xs-row>md-divider.md-THEME_NAME-theme{border-right-color:"{{foreground-4}}"}md-icon.md-THEME_NAME-theme{color:"{{foreground-2}}"}md-icon.md-THEME_NAME-theme.md-primary{color:"{{primary-color}}"}md-icon.md-THEME_NAME-theme.md-accent{color:"{{accent-color}}"}md-icon.md-THEME_NAME-theme.md-warn{color:"{{warn-color}}"}md-input-container.md-THEME_NAME-theme .md-input{color:"{{foreground-1}}";border-color:"{{foreground-4}}"}md-input-container.md-THEME_NAME-theme .md-input:-moz-placeholder,md-input-container.md-THEME_NAME-theme .md-input::-moz-placeholder{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme .md-input:-ms-input-placeholder{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme .md-input::-webkit-input-placeholder{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme>md-icon{color:"{{foreground-1}}"}md-input-container.md-THEME_NAME-theme .md-placeholder,md-input-container.md-THEME_NAME-theme label{color:"{{foreground-3}}"}md-input-container.md-THEME_NAME-theme label.md-required:after{color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-focused):not(.md-input-invalid) label.md-required:after{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme .md-input-message-animation,md-input-container.md-THEME_NAME-theme .md-input-messages-animation{color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme .md-input-message-animation .md-char-counter,md-input-container.md-THEME_NAME-theme .md-input-messages-animation .md-char-counter{color:"{{foreground-1}}"}md-input-container.md-THEME_NAME-theme.md-input-focused .md-input:-moz-placeholder,md-input-container.md-THEME_NAME-theme.md-input-focused .md-input::-moz-placeholder{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme.md-input-focused .md-input:-ms-input-placeholder{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme.md-input-focused .md-input::-webkit-input-placeholder{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-has-value label{color:"{{foreground-2}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused .md-input,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-resized .md-input{border-color:"{{primary-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused label,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused md-icon{color:"{{primary-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent .md-input{border-color:"{{accent-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent label,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-accent md-icon{color:"{{accent-color}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn .md-input{border-color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn label,md-input-container.md-THEME_NAME-theme:not(.md-input-invalid).md-input-focused.md-warn md-icon{color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme.md-input-invalid .md-input{border-color:"{{warn-A700}}"}md-input-container.md-THEME_NAME-theme.md-input-invalid .md-char-counter,md-input-container.md-THEME_NAME-theme.md-input-invalid .md-input-message-animation,md-input-container.md-THEME_NAME-theme.md-input-invalid label{color:"{{warn-A700}}"}[disabled] md-input-container.md-THEME_NAME-theme .md-input,md-input-container.md-THEME_NAME-theme .md-input[disabled]{border-bottom-color:transparent;color:"{{foreground-3}}";background-image:linear-gradient(90deg,"{{foreground-3}}" 0,"{{foreground-3}}" 33%,transparent 0);background-image:-ms-linear-gradient(left,transparent 0,"{{foreground-3}}" 100%)}md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text h3,md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text h4,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text h3,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text h4{color:"{{foreground-1}}"}md-list.md-THEME_NAME-theme md-list-item.md-2-line .md-list-item-text p,md-list.md-THEME_NAME-theme md-list-item.md-3-line .md-list-item-text p{color:"{{foreground-2}}"}md-list.md-THEME_NAME-theme .md-proxy-focus.md-focused div.md-no-style{background-color:"{{background-100}}"}md-list.md-THEME_NAME-theme md-list-item .md-avatar-icon{background-color:"{{foreground-3}}";color:"{{background-color}}"}md-list.md-THEME_NAME-theme md-list-item>md-icon{color:"{{foreground-2}}"}md-list.md-THEME_NAME-theme md-list-item>md-icon.md-highlight{color:"{{primary-color}}"}md-list.md-THEME_NAME-theme md-list-item>md-icon.md-highlight.md-accent{color:"{{accent-color}}"}md-menu-content.md-THEME_NAME-theme{background-color:"{{background-hue-1}}"}md-menu-content.md-THEME_NAME-theme md-menu-item{color:"{{foreground-1}}"}md-menu-content.md-THEME_NAME-theme md-menu-item md-icon{color:"{{foreground-2}}"}md-menu-content.md-THEME_NAME-theme md-menu-item .md-button[disabled],md-menu-content.md-THEME_NAME-theme md-menu-item .md-button[disabled] md-icon{color:"{{foreground-3}}"}md-menu-content.md-THEME_NAME-theme md-menu-divider{background-color:"{{foreground-4}}"}md-menu-bar.md-THEME_NAME-theme>button.md-button{color:"{{foreground-1}}";border-radius:2px}md-menu-bar.md-THEME_NAME-theme md-menu>button{color:"{{foreground-1}}"}md-menu-bar.md-THEME_NAME-theme md-menu.md-open>button,md-menu-bar.md-THEME_NAME-theme md-menu>button:focus{outline:none;background-color:"{{ background-500-0.18}}"}md-menu-bar.md-THEME_NAME-theme.md-open:not(.md-keyboard-mode) md-menu:hover>button{background-color:"{{ background-500-0.18}}"}md-menu-bar.md-THEME_NAME-theme:not(.md-keyboard-mode):not(.md-open) md-menu button:focus,md-menu-bar.md-THEME_NAME-theme:not(.md-keyboard-mode):not(.md-open) md-menu button:hover{background:transparent}md-menu-content.md-THEME_NAME-theme .md-menu>.md-button:after{color:"{{foreground-2}}"}md-menu-content.md-THEME_NAME-theme .md-menu.md-open>.md-button{background-color:"{{ background-500-0.18}}"}md-toolbar.md-THEME_NAME-theme.md-menu-toolbar{background-color:"{{background-hue-1}}";color:"{{foreground-1}}"}md-toolbar.md-THEME_NAME-theme.md-menu-toolbar md-toolbar-filler{background-color:"{{primary-color}}";color:"{{primary-contrast}}"}md-toolbar.md-THEME_NAME-theme.md-menu-toolbar md-toolbar-filler md-icon{color:"{{primary-contrast}}"}md-nav-bar.md-THEME_NAME-theme .md-nav-bar{background-color:transparent;border-color:"{{foreground-4}}"}md-nav-bar.md-THEME_NAME-theme .md-button._md-nav-button.md-unselected{color:"{{foreground-2}}"}md-nav-bar.md-THEME_NAME-theme .md-button._md-nav-button[disabled]{color:"{{foreground-3}}"}md-nav-bar.md-THEME_NAME-theme md-nav-ink-bar{color:"{{accent-color}}";background:"{{accent-color}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar{background-color:"{{accent-color}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button{color:"{{accent-A100}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button.md-active,md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{accent-contrast}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{accent-contrast-0.1}}"}md-nav-bar.md-THEME_NAME-theme.md-accent>.md-nav-bar md-nav-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar{background-color:"{{warn-color}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button{color:"{{warn-100}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button.md-active,md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{warn-contrast}}"}md-nav-bar.md-THEME_NAME-theme.md-warn>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{warn-contrast-0.1}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar{background-color:"{{primary-color}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button{color:"{{primary-100}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button.md-active,md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{primary-contrast}}"}md-nav-bar.md-THEME_NAME-theme.md-primary>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{primary-contrast-0.1}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar{background-color:"{{primary-color}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button{color:"{{primary-100}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-active,md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{primary-contrast}}"}md-toolbar>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{primary-contrast-0.1}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar{background-color:"{{accent-color}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button{color:"{{accent-A100}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-active,md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{accent-contrast}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{accent-contrast-0.1}}"}md-toolbar.md-accent>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar md-nav-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar{background-color:"{{warn-color}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button{color:"{{warn-100}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-active,md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{color:"{{warn-contrast}}"}md-toolbar.md-warn>md-nav-bar.md-THEME_NAME-theme>.md-nav-bar .md-button._md-nav-button.md-focused{background:"{{warn-contrast-0.1}}"}._md-panel-backdrop.md-THEME_NAME-theme{background-color:"{{background-900-1.0}}"}md-progress-circular.md-THEME_NAME-theme path{stroke:"{{primary-color}}"}md-progress-circular.md-THEME_NAME-theme.md-warn path{stroke:"{{warn-color}}"}md-progress-circular.md-THEME_NAME-theme.md-accent path{stroke:"{{accent-color}}"}md-progress-linear.md-THEME_NAME-theme .md-container{background-color:"{{primary-100}}"}md-progress-linear.md-THEME_NAME-theme .md-bar{background-color:"{{primary-color}}"}md-progress-linear.md-THEME_NAME-theme.md-warn .md-container{background-color:"{{warn-100}}"}md-progress-linear.md-THEME_NAME-theme.md-warn .md-bar{background-color:"{{warn-color}}"}md-progress-linear.md-THEME_NAME-theme.md-accent .md-container{background-color:"{{accent-100}}"}md-progress-linear.md-THEME_NAME-theme.md-accent .md-bar{background-color:"{{accent-color}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-primary .md-bar1{background-color:"{{primary-100}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-primary .md-dashed:before{background:radial-gradient("{{primary-100}}" 0,"{{primary-100}}" 16%,transparent 42%)}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-bar1{background-color:"{{warn-100}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-warn .md-dashed:before{background:radial-gradient("{{warn-100}}" 0,"{{warn-100}}" 16%,transparent 42%)}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-bar1{background-color:"{{accent-100}}"}md-progress-linear.md-THEME_NAME-theme[md-mode=buffer].md-accent .md-dashed:before{background:radial-gradient("{{accent-100}}" 0,"{{accent-100}}" 16%,transparent 42%)}md-radio-button.md-THEME_NAME-theme .md-off{border-color:"{{foreground-2}}"}md-radio-button.md-THEME_NAME-theme .md-on{background-color:"{{accent-color-0.87}}"}md-radio-button.md-THEME_NAME-theme.md-checked .md-off{border-color:"{{accent-color-0.87}}"}md-radio-button.md-THEME_NAME-theme.md-checked .md-ink-ripple{color:"{{accent-color-0.87}}"}md-radio-button.md-THEME_NAME-theme .md-container .md-ripple{color:"{{accent-A700}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-on{background-color:"{{primary-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-off{border-color:"{{primary-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-checked .md-ink-ripple{color:"{{primary-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-primary .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-primary .md-container .md-ripple{color:"{{primary-600}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-on,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-on,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-on{background-color:"{{warn-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-off,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-off{border-color:"{{warn-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn.md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-checked .md-ink-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-checked .md-ink-ripple{color:"{{warn-color-0.87}}"}md-radio-button.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple,md-radio-button.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]).md-warn .md-container .md-ripple,md-radio-group.md-THEME_NAME-theme:not([disabled]) .md-warn .md-container .md-ripple{color:"{{warn-600}}"}md-radio-button.md-THEME_NAME-theme[disabled],md-radio-group.md-THEME_NAME-theme[disabled]{color:"{{foreground-3}}"}md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-off,md-radio-button.md-THEME_NAME-theme[disabled] .md-container .md-on,md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-off,md-radio-group.md-THEME_NAME-theme[disabled] .md-container .md-on{border-color:"{{foreground-3}}"}md-radio-group.md-THEME_NAME-theme .md-checked .md-ink-ripple{color:"{{accent-color-0.26}}"}md-radio-group.md-THEME_NAME-theme .md-checked:not([disabled]).md-primary .md-ink-ripple,md-radio-group.md-THEME_NAME-theme.md-primary .md-checked:not([disabled]) .md-ink-ripple{color:"{{primary-color-0.26}}"}md-radio-group.md-THEME_NAME-theme.md-focused.ng-empty>md-radio-button:first-child .md-container:before{background-color:"{{foreground-3-0.26}}"}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked .md-container:before{background-color:"{{accent-color-0.26}}"}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-primary .md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-primary .md-checked .md-container:before{background-color:"{{primary-color-0.26}}"}md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty) .md-checked.md-warn .md-container:before,md-radio-group.md-THEME_NAME-theme.md-focused:not(:empty).md-warn .md-checked .md-container:before{background-color:"{{warn-color-0.26}}"}md-input-container md-select.md-THEME_NAME-theme .md-select-value span:first-child:after{color:"{{warn-A700}}"}md-input-container:not(.md-input-focused):not(.md-input-invalid) md-select.md-THEME_NAME-theme .md-select-value span:first-child:after{color:"{{foreground-3}}"}md-input-container.md-input-focused:not(.md-input-has-value) md-select.md-THEME_NAME-theme .md-select-value,md-input-container.md-input-focused:not(.md-input-has-value) md-select.md-THEME_NAME-theme .md-select-value.md-select-placeholder{color:"{{primary-color}}"}md-input-container.md-input-invalid md-select.md-THEME_NAME-theme .md-select-value{color:"{{warn-A700}}"!important;border-bottom-color:"{{warn-A700}}"!important}md-input-container.md-input-invalid md-select.md-THEME_NAME-theme.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-input-container:not(.md-input-invalid).md-input-focused.md-accent .md-select-value{border-color:"{{accent-color}}"}md-input-container:not(.md-input-invalid).md-input-focused.md-accent .md-select-value span{color:"{{accent-color}}"}md-input-container:not(.md-input-invalid).md-input-focused.md-warn .md-select-value{border-color:"{{warn-A700}}"}md-input-container:not(.md-input-invalid).md-input-focused.md-warn .md-select-value span{color:"{{warn-A700}}"}md-select.md-THEME_NAME-theme[disabled] .md-select-value{border-bottom-color:transparent;background-image:linear-gradient(90deg,"{{foreground-3}}" 0,"{{foreground-3}}" 33%,transparent 0);background-image:-ms-linear-gradient(left,transparent 0,"{{foreground-3}}" 100%)}md-select.md-THEME_NAME-theme .md-select-value{border-bottom-color:"{{foreground-4}}"}md-select.md-THEME_NAME-theme .md-select-value.md-select-placeholder{color:"{{foreground-3}}"}md-select.md-THEME_NAME-theme .md-select-value span:first-child:after{color:"{{warn-A700}}"}md-select.md-THEME_NAME-theme.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-select.md-THEME_NAME-theme.ng-invalid.ng-touched .md-select-value{color:"{{warn-A700}}"!important;border-bottom-color:"{{warn-A700}}"!important}md-select.md-THEME_NAME-theme.ng-invalid.ng-touched.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value{border-bottom-color:"{{primary-color}}";color:"{{ foreground-1 }}"}md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-value.md-select-placeholder{color:"{{ foreground-1 }}"}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-no-underline .md-select-value{border-bottom-color:transparent!important}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-accent .md-select-value{border-bottom-color:"{{accent-color}}"}md-select.md-THEME_NAME-theme:not([disabled]):focus.md-warn .md-select-value{border-bottom-color:"{{warn-color}}"}md-select.md-THEME_NAME-theme[disabled] .md-select-icon,md-select.md-THEME_NAME-theme[disabled] .md-select-value,md-select.md-THEME_NAME-theme[disabled] .md-select-value.md-select-placeholder{color:"{{foreground-3}}"}md-select.md-THEME_NAME-theme .md-select-icon{color:"{{foreground-2}}"}md-select-menu.md-THEME_NAME-theme md-content{background-color:"{{background-hue-1}}"}md-select-menu.md-THEME_NAME-theme md-content md-optgroup{color:"{{foreground-2}}"}md-select-menu.md-THEME_NAME-theme md-content md-option{color:"{{foreground-1}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[disabled] .md-text{color:"{{foreground-3}}"}md-select-menu.md-THEME_NAME-theme md-content md-option:not([disabled]):focus,md-select-menu.md-THEME_NAME-theme md-content md-option:not([disabled]):hover{background-color:"{{background-500-0.18}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected]{color:"{{primary-500}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected]:focus{color:"{{primary-600}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected].md-accent{color:"{{accent-color}}"}md-select-menu.md-THEME_NAME-theme md-content md-option[selected].md-accent:focus{color:"{{accent-A700}}"}.md-checkbox-enabled.md-THEME_NAME-theme .md-ripple{color:"{{primary-600}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-ripple{color:"{{background-600}}"}.md-checkbox-enabled.md-THEME_NAME-theme .md-ink-ripple{color:"{{foreground-2}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-ink-ripple{color:"{{primary-color-0.87}}"}.md-checkbox-enabled.md-THEME_NAME-theme:not(.md-checked) .md-icon{border-color:"{{foreground-2}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-icon{background-color:"{{primary-color-0.87}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected].md-focused .md-container:before{background-color:"{{primary-color-0.26}}"}.md-checkbox-enabled.md-THEME_NAME-theme[selected] .md-icon:after{border-color:"{{primary-contrast-0.87}}"}.md-checkbox-enabled.md-THEME_NAME-theme .md-indeterminate[disabled] .md-container{color:"{{foreground-3}}"}.md-checkbox-enabled.md-THEME_NAME-theme md-option .md-text{color:"{{foreground-1}}"}md-sidenav.md-THEME_NAME-theme,md-sidenav.md-THEME_NAME-theme md-content{background-color:"{{background-hue-1}}"}md-slider.md-THEME_NAME-theme .md-track{background-color:"{{foreground-3}}"}md-slider.md-THEME_NAME-theme .md-track-ticks{color:"{{background-contrast}}"}md-slider.md-THEME_NAME-theme .md-focus-ring{background-color:"{{accent-A200-0.2}}"}md-slider.md-THEME_NAME-theme .md-disabled-thumb{border-color:"{{background-color}}";background-color:"{{background-color}}"}md-slider.md-THEME_NAME-theme.md-min .md-thumb:after{background-color:"{{background-color}}";border-color:"{{foreground-3}}"}md-slider.md-THEME_NAME-theme.md-min .md-focus-ring{background-color:"{{foreground-3-0.38}}"}md-slider.md-THEME_NAME-theme.md-min[md-discrete] .md-thumb:after{background-color:"{{background-contrast}}";border-color:transparent}md-slider.md-THEME_NAME-theme.md-min[md-discrete] .md-sign{background-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme.md-min[md-discrete] .md-sign:after{border-top-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme.md-min[md-discrete][md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme .md-track.md-track-fill{background-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-thumb:after{border-color:"{{accent-color}}";background-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-sign{background-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-sign:after{border-top-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme[md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{accent-color}}"}md-slider.md-THEME_NAME-theme .md-thumb-text{color:"{{accent-contrast}}"}md-slider.md-THEME_NAME-theme.md-warn .md-focus-ring{background-color:"{{warn-200-0.38}}"}md-slider.md-THEME_NAME-theme.md-warn .md-track.md-track-fill{background-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-thumb:after{border-color:"{{warn-color}}";background-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-sign{background-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-sign:after{border-top-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn[md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{warn-color}}"}md-slider.md-THEME_NAME-theme.md-warn .md-thumb-text{color:"{{warn-contrast}}"}md-slider.md-THEME_NAME-theme.md-primary .md-focus-ring{background-color:"{{primary-200-0.38}}"}md-slider.md-THEME_NAME-theme.md-primary .md-track.md-track-fill{background-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-thumb:after{border-color:"{{primary-color}}";background-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-sign{background-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-sign:after{border-top-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary[md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{primary-color}}"}md-slider.md-THEME_NAME-theme.md-primary .md-thumb-text{color:"{{primary-contrast}}"}md-slider.md-THEME_NAME-theme[disabled] .md-thumb:after{border-color:transparent}md-slider.md-THEME_NAME-theme[disabled]:not(.md-min) .md-thumb:after,md-slider.md-THEME_NAME-theme[disabled][md-discrete] .md-thumb:after{background-color:"{{foreground-3}}";border-color:transparent}md-slider.md-THEME_NAME-theme[disabled][readonly] .md-sign{background-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme[disabled][readonly] .md-sign:after{border-top-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme[disabled][readonly][md-vertical] .md-sign:after{border-top-color:transparent;border-left-color:"{{background-400}}"}md-slider.md-THEME_NAME-theme[disabled][readonly] .md-disabled-thumb{border-color:transparent;background-color:transparent}md-slider-container[disabled]>:first-child:not(md-slider),md-slider-container[disabled]>:last-child:not(md-slider){color:"{{foreground-3}}"}.md-subheader.md-THEME_NAME-theme{color:"{{ foreground-2-0.23 }}";background-color:"{{background-default}}"}.md-subheader.md-THEME_NAME-theme.md-primary{color:"{{primary-color}}"}.md-subheader.md-THEME_NAME-theme.md-accent{color:"{{accent-color}}"}.md-subheader.md-THEME_NAME-theme.md-warn{color:"{{warn-color}}"}md-switch.md-THEME_NAME-theme .md-ink-ripple{color:"{{background-500}}"}md-switch.md-THEME_NAME-theme .md-thumb{background-color:"{{background-50}}"}md-switch.md-THEME_NAME-theme .md-bar{background-color:"{{background-500}}"}md-switch.md-THEME_NAME-theme.md-focused:not(.md-checked) .md-thumb:before,md-switch.md-THEME_NAME-theme.md-focused[disabled] .md-thumb:before{background-color:"{{foreground-4}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]) .md-ink-ripple{color:"{{accent-color}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]) .md-thumb{background-color:"{{accent-color}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]) .md-bar{background-color:"{{accent-color-0.5}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-focused .md-thumb:before{background-color:"{{accent-color-0.26}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-primary .md-ink-ripple{color:"{{primary-color}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-primary .md-thumb{background-color:"{{primary-color}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-primary .md-bar{background-color:"{{primary-color-0.5}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-primary.md-focused .md-thumb:before{background-color:"{{primary-color-0.26}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-warn .md-ink-ripple{color:"{{warn-color}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-warn .md-thumb{background-color:"{{warn-color}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-warn .md-bar{background-color:"{{warn-color-0.5}}"}md-switch.md-THEME_NAME-theme.md-checked:not([disabled]).md-warn.md-focused .md-thumb:before{background-color:"{{warn-color-0.26}}"}md-switch.md-THEME_NAME-theme[disabled] .md-thumb{background-color:"{{background-400}}"}md-switch.md-THEME_NAME-theme[disabled] .md-bar{background-color:"{{foreground-4}}"}md-tabs.md-THEME_NAME-theme md-tabs-wrapper{background-color:transparent;border-color:"{{foreground-4}}"}md-tabs.md-THEME_NAME-theme .md-paginator md-icon{color:"{{primary-color}}"}md-tabs.md-THEME_NAME-theme md-ink-bar{color:"{{accent-color}}";background:"{{accent-color}}"}md-tabs.md-THEME_NAME-theme .md-tab{color:"{{foreground-2}}"}md-tabs.md-THEME_NAME-theme .md-tab[disabled],md-tabs.md-THEME_NAME-theme .md-tab[disabled] md-icon{color:"{{foreground-3}}"}md-tabs.md-THEME_NAME-theme .md-tab.md-active,md-tabs.md-THEME_NAME-theme .md-tab.md-active md-icon,md-tabs.md-THEME_NAME-theme .md-tab.md-focused,md-tabs.md-THEME_NAME-theme .md-tab.md-focused md-icon{color:"{{primary-color}}"}md-tabs.md-THEME_NAME-theme .md-tab.md-focused{background:"{{primary-color-0.1}}"}md-tabs.md-THEME_NAME-theme .md-tab .md-ripple-container{color:"{{accent-A100}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper{background-color:"{{accent-color}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{accent-A100}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{accent-contrast}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{accent-contrast-0.1}}"}md-tabs.md-THEME_NAME-theme.md-accent>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper{background-color:"{{primary-color}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{primary-100}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{primary-contrast}}"}md-tabs.md-THEME_NAME-theme.md-primary>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{primary-contrast-0.1}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper{background-color:"{{warn-color}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{warn-100}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{warn-contrast}}"}md-tabs.md-THEME_NAME-theme.md-warn>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{warn-contrast-0.1}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:"{{primary-color}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{primary-100}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{primary-contrast}}"}md-toolbar>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{primary-contrast-0.1}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:"{{accent-color}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{accent-A100}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{accent-contrast}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{accent-contrast-0.1}}"}md-toolbar.md-accent>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-ink-bar{color:"{{primary-600-1}}";background:"{{primary-600-1}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper{background-color:"{{warn-color}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]),md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]) md-icon{color:"{{warn-100}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-active md-icon,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused,md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused md-icon{color:"{{warn-contrast}}"}md-toolbar.md-warn>md-tabs.md-THEME_NAME-theme>md-tabs-wrapper>md-tabs-canvas>md-pagination-wrapper>md-tab-item:not([disabled]).md-focused{background:"{{warn-contrast-0.1}}"}md-toast.md-THEME_NAME-theme .md-toast-content{background-color:#323232;color:"{{background-50}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button{color:"{{background-50}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight{color:"{{accent-color}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-primary{color:"{{primary-color}}"}md-toast.md-THEME_NAME-theme .md-toast-content .md-button.md-highlight.md-warn{color:"{{warn-color}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar){background-color:"{{primary-color}}";color:"{{primary-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) md-icon{color:"{{primary-contrast}}";fill:"{{primary-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar) .md-button[disabled] md-icon{color:"{{primary-contrast-0.26}}";fill:"{{primary-contrast-0.26}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent{background-color:"{{accent-color}}";color:"{{accent-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent .md-ink-ripple{color:"{{accent-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent md-icon{color:"{{accent-contrast}}";fill:"{{accent-contrast}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-accent .md-button[disabled] md-icon{color:"{{accent-contrast-0.26}}";fill:"{{accent-contrast-0.26}}"}md-toolbar.md-THEME_NAME-theme:not(.md-menu-toolbar).md-warn{background-color:"{{warn-color}}";color:"{{warn-contrast}}"}.md-panel.md-tooltip.md-THEME_NAME-theme{color:"{{background-700-contrast}}";background-color:"{{background-700}}"}body.md-THEME_NAME-theme,html.md-THEME_NAME-theme{color:"{{foreground-1}}";background-color:"{{background-color}}"}')
     }(window, window.angular), window.ngMaterial = {
         version: {
-            full: "1.1.10"
+            full: "1.1.19"
         }
     },
     function(c, e) {
             return i
         }
 
-        function O(n, r, i, o) {
+        function D(n, r, i, o) {
             o = o || function(e, t) {
                 return w(t.currentTarget)
             }, w.each(i, function(e, t) {
             return t.uc_base && 4 < M ? (a = t.uc_base, t = t.uc_output.toUpperCase()) : a = t, e.replace("{name}", n || "").replace("{friendlyName}", o).replace("{img}", r + (M < 2 ? a.toUpperCase() : a) + "." + i).replace("{uni}", t).replace("{alt}", E.convert(t))
         }
 
-        function D(e, n, r) {
+        function O(e, n, r) {
             return e.replace(/:?\+?[\w_\-]+:?/g, function(e) {
                 e = ":" + e.replace(/:$/, "").replace(/^:/, "") + ":";
                 var t = E.emojioneList[e];
                 if (n.length) {
                     var r, i, o = e.scrollArea.is(".skinnable");
                     o || (r = e.scrollArea.scrollTop(), t && e.recentCategory.show(), i = e.recentCategory.is(":visible") ? e.recentCategory.height() : 0);
-                    var a = D(n, e.emojiBtnTemplate, !0).split("|").join("");
+                    var a = O(n, e.emojiBtnTemplate, !0).split("|").join("");
                     if (e.recentCategory.children(".emojibtn").remove(), w(a).insertAfter(e.recentCategory.children(".emojionearea-category-title")), e.recentCategory.children(".emojibtn").on("click", function() {
                             e.trigger("emojibtn.click", w(this))
                         }), e.recentFilter.show(), !o) {
                             class: F("filter", !0) + " " + F("filter-" + e, !0),
                             "data-filter": e,
                             title: t.title
-                        }).wrapInner(D(t.icon, l.emojiTemplateAlt)).appendTo(c);
+                        }).wrapInner(O(t.icon, l.emojiTemplateAlt)).appendTo(c);
                         else {
                             if (!o.tones) return;
                             n = 5
                             }).appendTo(v) : q("category-block").attr({
                                 name: e,
                                 "data-tone": n
-                            }).appendTo(d), 0 < n && (r.hide(), i = i.split("|").join("_tone" + n + "|") + "_tone" + n), "recent" === e && (i = U()), i = D(i, l.sprite ? '<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><i class="emojione-{uni}"></i></i>' : '<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><img class="emojioneemoji lazy-emoji" data-src="{img}"/></i>', !0).split("|").join(""), r.html(i), w('<div class="emojionearea-category-title"/>').text(t.title).prependTo(r)
+                            }).appendTo(d), 0 < n && (r.hide(), i = i.split("|").join("_tone" + n + "|") + "_tone" + n), "recent" === e && (i = U()), i = O(i, l.sprite ? '<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><i class="emojione-{uni}"></i></i>' : '<i class="emojibtn" role="button" data-name="{name}" title="{friendlyName}"><img class="emojioneemoji lazy-emoji" data-src="{img}"/></i>', !0).split("|").join(""), r.html(i), w('<div class="emojionearea-category-title"/>').text(t.title).prependTo(r)
                         } while (0 < --n)
                     }
                 }), o.filters = null, l.sprite || (l.lasyEmoji = d.find(".lazy-emoji")), (u = c.find(F("filter"))).eq(0).addClass("active"), h = d.find(F("category-block")), f = d.find(F("category")), l.recentFilter = u.filter('[data-filter="recent"]'), l.recentCategory = f.filter("[name=recent]"), l.scrollArea = p, o.container ? w(o.container).wrapInner(g) : g.insertAfter(t), o.hideSource && t.hide(), l.setText(t[i]()), t[i](l.getText()), j.apply(l), l.standalone && !l.getText().length) {
                 var b = w(t).data("emoji-placeholder") || o.emojiPlaceholder;
                 l.setText(b), a.addClass("has-placeholder")
             }
-            O(l, d.find(".emojibtn"), {
+            D(l, d.find(".emojibtn"), {
                 click: "emojibtn.click"
-            }), O(l, window, {
+            }), D(l, window, {
                 resize: "!resize"
-            }), O(l, m.children(), {
+            }), D(l, m.children(), {
                 click: "tone.click"
-            }), O(l, [s, n], {
+            }), D(l, [s, n], {
                 mousedown: "!mousedown"
-            }, a), O(l, n, {
+            }, a), D(l, n, {
                 click: "button.click"
-            }), O(l, a, {
+            }), D(l, a, {
                 paste: "!paste"
-            }, a), O(l, a, ["focus", "blur"], function() {
+            }, a), D(l, a, ["focus", "blur"], function() {
                 return !l.stayFocused && a
-            }), O(l, s, {
+            }), D(l, s, {
                 mousedown: "picker.mousedown",
                 mouseup: "picker.mouseup",
                 click: "picker.click",
                 keyup: "picker.keyup",
                 keydown: "picker.keydown",
                 keypress: "picker.keypress"
-            }), O(l, a, ["mousedown", "mouseup", "click", "keyup", "keydown", "keypress"]), O(l, s.find(".emojionearea-filter"), {
+            }), D(l, a, ["mousedown", "mouseup", "click", "keyup", "keydown", "keypress"]), D(l, s.find(".emojionearea-filter"), {
                 click: "filter.click"
-            }), O(l, t, {
+            }), D(l, t, {
                 change: "source.change"
-            }), o.search && O(l, l.search, {
+            }), o.search && D(l, l.search, {
                 keyup: "search.keypress",
                 focus: "search.focus",
                 blur: "search.blur"
                     }, 200)
                 }).on("@emojibtn.click", function(e) {
                     var t, n, r, i;
-                    a.removeClass("has-placeholder"), null !== l.searchSel && (a.focus(), k(a[0], l.searchSel), l.searchSel = null), l.standalone ? (a.html(D(e.data("name"), l.emojiTemplate)), l.trigger("blur")) : (C(a[0]), N(D(e.data("name"), l.emojiTemplate))), l.recentEmojis && (t = l, n = e.data("name"), r = U().split("|"), -1 !== (i = r.indexOf(n)) && r.splice(i, 1), r.unshift(n), 9 < r.length && r.pop(), localStorage.setItem("recent_emojis", r.join("|")), V(t)), l.trigger("search.keypress")
+                    a.removeClass("has-placeholder"), null !== l.searchSel && (a.focus(), k(a[0], l.searchSel), l.searchSel = null), l.standalone ? (a.html(O(e.data("name"), l.emojiTemplate)), l.trigger("blur")) : (C(a[0]), N(O(e.data("name"), l.emojiTemplate))), l.recentEmojis && (t = l, n = e.data("name"), r = U().split("|"), -1 !== (i = r.indexOf(n)) && r.splice(i, 1), r.unshift(n), 9 < r.length && r.pop(), localStorage.setItem("recent_emojis", r.join("|")), V(t)), l.trigger("search.keypress")
                 }).on("@!resize @keyup @emojibtn.click", j).on("@!mousedown", function(e, t) {
                     return w(t.target).hasClass("search") ? (l.stayFocused = !0, null === l.searchSel && (l.searchSel = C(e[0]))) : (g.is(".focused") || e.focus(), t.preventDefault()), !1
                 }).on("@change", function() {
                                 }))
                             },
                             template: function(e) {
-                                return D(e, l.emojiTemplate) + " " + e.replace(/:/g, "")
+                                return O(e, l.emojiTemplate) + " " + e.replace(/:/g, "")
                             },
                             replace: function(e) {
-                                return D(e, l.emojiTemplate)
+                                return O(e, l.emojiTemplate)
                             },
                             cache: !0,
                             index: 1
similarity index 83%
rename from snippet/1.0.10/fonts/materialdesignicons-webfont.svg
rename to snippet/1.0.11/fonts/materialdesignicons-webfont.svg
index 4b7721a900397a687815230df63d9d59ef22cd1b..72e478062e6522ed617dcabce19323e3991d95c4 100644 (file)
@@ -15616,7 +15616,7 @@ all and (min-resolution :144dpi) {
  * AngularJS Material Design
  * https://github.com/angular/material
  * @license MIT
- * v1.1.10
+ * v1.1.19
  */
 body,
 html {
@@ -15720,7 +15720,6 @@ input:-webkit-autofill {
 }
 
 .md-shadow-animated.md-shadow {
-    -webkit-transition: box-shadow .28s cubic-bezier(.4, 0, .2, 1);
     transition: box-shadow .28s cubic-bezier(.4, 0, .2, 1)
 }
 
@@ -15732,7 +15731,6 @@ input:-webkit-autofill {
     top: 0;
     width: 100%;
     height: 100%;
-    -webkit-transition: all .55s cubic-bezier(.25, .8, .25, 1);
     transition: all .55s cubic-bezier(.25, .8, .25, 1)
 }
 
@@ -15747,7 +15745,6 @@ input:-webkit-autofill {
 }
 
 .md-ripple.md-ripple-placed {
-    -webkit-transition: margin .9s cubic-bezier(.25, .8, .25, 1), border .9s cubic-bezier(.25, .8, .25, 1), width .9s cubic-bezier(.25, .8, .25, 1), height .9s cubic-bezier(.25, .8, .25, 1), opacity .9s cubic-bezier(.25, .8, .25, 1), -webkit-transform .9s cubic-bezier(.25, .8, .25, 1);
     transition: margin .9s cubic-bezier(.25, .8, .25, 1), border .9s cubic-bezier(.25, .8, .25, 1), width .9s cubic-bezier(.25, .8, .25, 1), height .9s cubic-bezier(.25, .8, .25, 1), opacity .9s cubic-bezier(.25, .8, .25, 1), -webkit-transform .9s cubic-bezier(.25, .8, .25, 1);
     transition: margin .9s cubic-bezier(.25, .8, .25, 1), border .9s cubic-bezier(.25, .8, .25, 1), width .9s cubic-bezier(.25, .8, .25, 1), height .9s cubic-bezier(.25, .8, .25, 1), opacity .9s cubic-bezier(.25, .8, .25, 1), transform .9s cubic-bezier(.25, .8, .25, 1);
     transition: margin .9s cubic-bezier(.25, .8, .25, 1), border .9s cubic-bezier(.25, .8, .25, 1), width .9s cubic-bezier(.25, .8, .25, 1), height .9s cubic-bezier(.25, .8, .25, 1), opacity .9s cubic-bezier(.25, .8, .25, 1), transform .9s cubic-bezier(.25, .8, .25, 1), -webkit-transform .9s cubic-bezier(.25, .8, .25, 1)
@@ -15970,7 +15967,6 @@ textarea {
 
 ._md-panel-shown .md-panel {
     opacity: 1;
-    -webkit-transition: none;
     transition: none
 }
 
@@ -15981,19 +15977,16 @@ textarea {
 
 .md-panel._md-panel-shown {
     opacity: 1;
-    -webkit-transition: none;
     transition: none
 }
 
 .md-panel._md-panel-animate-enter {
     opacity: 1;
-    -webkit-transition: all .3s cubic-bezier(0, 0, .2, 1);
     transition: all .3s cubic-bezier(0, 0, .2, 1)
 }
 
 .md-panel._md-panel-animate-leave {
     opacity: 1;
-    -webkit-transition: all .3s cubic-bezier(.4, 0, 1, 1);
     transition: all .3s cubic-bezier(.4, 0, 1, 1)
 }
 
@@ -16010,12 +16003,10 @@ textarea {
 
 .md-panel._md-opaque-enter {
     opacity: .48;
-    -webkit-transition: opacity .3s cubic-bezier(0, 0, .2, 1);
     transition: opacity .3s cubic-bezier(0, 0, .2, 1)
 }
 
 .md-panel._md-opaque-leave {
-    -webkit-transition: opacity .3s cubic-bezier(.4, 0, 1, 1);
     transition: opacity .3s cubic-bezier(.4, 0, 1, 1)
 }
 
@@ -16065,12 +16056,7 @@ md-autocomplete[md-floating-label] .md-show-clear-button input {
 }
 
 md-autocomplete md-autocomplete-wrap {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row;
     box-sizing: border-box;
     position: relative;
@@ -16084,8 +16070,6 @@ md-autocomplete md-autocomplete-wrap.md-menu-showing {
 
 md-autocomplete md-autocomplete-wrap input,
 md-autocomplete md-autocomplete-wrap md-input-container {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 0%;
     flex: 1 1 0%;
     box-sizing: border-box;
     min-width: 0
@@ -16110,18 +16094,15 @@ md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate {
     left: 0;
     width: 100%;
     height: 3px;
-    -webkit-transition: none;
     transition: none
 }
 
 md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate .md-container {
-    -webkit-transition: none;
     transition: none;
     height: 3px
 }
 
 md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-enter {
-    -webkit-transition: opacity .15s linear;
     transition: opacity .15s linear
 }
 
@@ -16130,7 +16111,6 @@ md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.n
 }
 
 md-autocomplete md-autocomplete-wrap md-progress-linear .md-mode-indeterminate.ng-leave {
-    -webkit-transition: opacity .15s linear;
     transition: opacity .15s linear
 }
 
@@ -16181,7 +16161,6 @@ md-autocomplete .md-show-clear-button button:after {
     -webkit-transform: scale(0);
     transform: scale(0);
     opacity: 0;
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1)
 }
 
@@ -16210,7 +16189,6 @@ md-autocomplete .md-show-clear-button button md-icon path {
 md-autocomplete .md-show-clear-button button.ng-enter {
     -webkit-transform: scale(0);
     transform: scale(0);
-    -webkit-transition: -webkit-transform .15s ease-out;
     transition: -webkit-transform .15s ease-out;
     transition: transform .15s ease-out;
     transition: transform .15s ease-out, -webkit-transform .15s ease-out
@@ -16222,7 +16200,6 @@ md-autocomplete .md-show-clear-button button.ng-enter.ng-enter-active {
 }
 
 md-autocomplete .md-show-clear-button button.ng-leave {
-    -webkit-transition: -webkit-transform .15s ease-out;
     transition: -webkit-transform .15s ease-out;
     transition: transform .15s ease-out;
     transition: transform .15s ease-out, -webkit-transform .15s ease-out
@@ -16243,6 +16220,7 @@ md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active {
     }
 }
 
+.md-standard-list-container.md-autocomplete-suggestions-container,
 .md-virtual-repeat-container.md-autocomplete-suggestions-container {
     position: absolute;
     box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
@@ -16250,10 +16228,21 @@ md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active {
     height: 100%
 }
 
+.md-standard-list-container.md-autocomplete-suggestions-container .highlight,
 .md-virtual-repeat-container.md-autocomplete-suggestions-container .highlight {
     font-weight: 700
 }
 
+.md-standard-list-container {
+    box-sizing: border-box;
+    display: block;
+    margin: 0;
+    overflow: hidden;
+    overflow-y: auto;
+    padding: 0
+}
+
+.md-standard-list-container.md-not-found,
 .md-virtual-repeat-container.md-not-found {
     height: 48px
 }
@@ -16270,7 +16259,6 @@ md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active {
     padding: 0 15px;
     line-height: 48px;
     height: 48px;
-    -webkit-transition: background .15s linear;
     transition: background .15s linear;
     margin: 0;
     white-space: nowrap;
@@ -16294,7 +16282,6 @@ md-autocomplete .md-show-clear-button button.ng-leave.ng-leave-active {
 }
 
 md-backdrop {
-    -webkit-transition: opacity 450ms;
     transition: opacity 450ms;
     position: absolute;
     top: 0;
@@ -16311,7 +16298,6 @@ md-backdrop.md-menu-backdrop {
 
 md-backdrop.md-select-backdrop {
     z-index: 81;
-    -webkit-transition-duration: 0;
     transition-duration: 0
 }
 
@@ -16345,7 +16331,6 @@ md-backdrop.md-opaque.ng-enter.md-opaque.ng-enter-active {
 
 md-backdrop.md-opaque.ng-leave {
     opacity: .48;
-    -webkit-transition: opacity .4s;
     transition: opacity .4s
 }
 
@@ -16364,9 +16349,7 @@ md-bottom-sheet {
     border-top-style: solid;
     -webkit-transform: translate3d(0, 80px, 0);
     transform: translate3d(0, 80px, 0);
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-property: -webkit-transform;
     transition-property: -webkit-transform;
     transition-property: transform;
     transition-property: transform, -webkit-transform
@@ -16392,7 +16375,6 @@ md-bottom-sheet.ng-enter-active {
 md-bottom-sheet.ng-leave-active {
     -webkit-transform: translate3d(0, 100%, 0) !important;
     transform: translate3d(0, 100%, 0) !important;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2)
 }
 
@@ -16412,8 +16394,6 @@ md-bottom-sheet md-inline-icon {
 }
 
 md-bottom-sheet md-list-item {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     outline: 0
 }
@@ -16424,8 +16404,6 @@ md-bottom-sheet md-list-item:hover {
 
 md-bottom-sheet.md-list md-list-item {
     padding: 0;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     height: 48px
 }
@@ -16437,31 +16415,16 @@ md-bottom-sheet.md-grid {
 }
 
 md-bottom-sheet.md-grid md-list {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row;
-    -webkit-flex-wrap: wrap;
     flex-wrap: wrap;
-    -webkit-transition: all .5s;
     transition: all .5s;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center
 }
 
 md-bottom-sheet.md-grid md-list-item {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-transition: all .5s;
     transition: all .5s;
     height: 96px;
     margin-top: 8px;
@@ -16470,29 +16433,21 @@ md-bottom-sheet.md-grid md-list-item {
 
 @media (max-width:960px) {
     md-bottom-sheet.md-grid md-list-item {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33333%;
         flex: 1 1 33.33333%;
         max-width: 33.33333%
     }
 
     md-bottom-sheet.md-grid md-list-item:nth-of-type(3n+1) {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start
     }
 
     md-bottom-sheet.md-grid md-list-item:nth-of-type(3n) {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end
     }
 }
 
 @media (min-width:960px) and (max-width:1279px) {
     md-bottom-sheet.md-grid md-list-item {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 25%;
         flex: 1 1 25%;
         max-width: 25%
     }
@@ -16500,8 +16455,6 @@ md-bottom-sheet.md-grid md-list-item {
 
 @media (min-width:1280px) and (max-width:1919px) {
     md-bottom-sheet.md-grid md-list-item {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 16.66667%;
         flex: 1 1 16.66667%;
         max-width: 16.66667%
     }
@@ -16509,8 +16462,6 @@ md-bottom-sheet.md-grid md-list-item {
 
 @media (min-width:1920px) {
     md-bottom-sheet.md-grid md-list-item {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 14.28571%;
         flex: 1 1 14.28571%;
         max-width: 14.28571%
     }
@@ -16521,15 +16472,8 @@ md-bottom-sheet.md-grid md-list-item::before {
 }
 
 md-bottom-sheet.md-grid md-list-item .md-list-item-content {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     width: 48px;
     padding-bottom: 16px
@@ -16537,15 +16481,8 @@ md-bottom-sheet.md-grid md-list-item .md-list-item-content {
 
 md-bottom-sheet.md-grid md-list-item .md-grid-item-content {
     border: 1px solid transparent;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     width: 80px
 }
@@ -16580,8 +16517,6 @@ button.md-button::-moz-focus-inner {
     min-width: 88px;
     line-height: 36px;
     vertical-align: middle;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     text-align: center;
     border-radius: 2px;
@@ -16605,7 +16540,6 @@ button.md-button::-moz-focus-inner {
     font-family: inherit;
     text-decoration: none;
     overflow: hidden;
-    -webkit-transition: box-shadow .4s cubic-bezier(.25, .8, .25, 1), background-color .4s cubic-bezier(.25, .8, .25, 1);
     transition: box-shadow .4s cubic-bezier(.25, .8, .25, 1), background-color .4s cubic-bezier(.25, .8, .25, 1)
 }
 
@@ -16635,7 +16569,6 @@ button.md-button::-moz-focus-inner {
 
 .md-button.ng-hide,
 .md-button.ng-leave {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -16673,9 +16606,7 @@ button.md-button::-moz-focus-inner {
     border-radius: 50%;
     background-clip: padding-box;
     overflow: hidden;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-property: background-color, box-shadow, -webkit-transform;
     transition-property: background-color, box-shadow, -webkit-transform;
     transition-property: background-color, box-shadow, transform;
     transition-property: background-color, box-shadow, transform, -webkit-transform
@@ -16721,7 +16652,6 @@ button.md-button::-moz-focus-inner {
 
 .md-button.md-fab.ng-hide,
 .md-button.md-fab.ng-leave {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -16749,7 +16679,6 @@ button.md-button.md-fab md-icon {
 
 .md-toast-open-top .md-button.md-fab-top-left,
 .md-toast-open-top .md-button.md-fab-top-right {
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
     -webkit-transform: translate3d(0, 42px, 0);
     transform: translate3d(0, 42px, 0)
@@ -16765,7 +16694,6 @@ button.md-button.md-fab md-icon {
 
 .md-toast-open-bottom .md-button.md-fab-bottom-left,
 .md-toast-open-bottom .md-button.md-fab-bottom-right {
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
     -webkit-transform: translate3d(0, -42px, 0);
     transform: translate3d(0, -42px, 0)
@@ -16780,18 +16708,12 @@ button.md-button.md-fab md-icon {
 }
 
 .md-button-group {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
     width: 100%
 }
 
 .md-button-group>.md-button {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
     display: block;
     overflow: hidden;
@@ -16822,12 +16744,7 @@ button.md-button.md-fab md-icon {
 
 md-card {
     box-sizing: border-box;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     margin: 8px;
     box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 2px 1px -1px rgba(0, 0, 0, .12)
@@ -16835,12 +16752,7 @@ md-card {
 
 md-card md-card-header {
     padding: 16px;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -16890,15 +16802,8 @@ md-card md-card-header md-card-avatar+md-card-header-text .md-title {
 }
 
 md-card md-card-header md-card-header-text {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column
 }
 
@@ -16910,11 +16815,7 @@ md-card md-card-title-media img,
 md-card>img,
 md-card>md-card-header img {
     box-sizing: border-box;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-flex: 0;
-    -webkit-flex: 0 0 auto;
     flex: 0 0 auto;
     width: 100%;
     height: auto
@@ -16922,15 +16823,8 @@ md-card>md-card-header img {
 
 md-card md-card-title {
     padding: 24px 16px 16px;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 auto;
     flex: 1 1 auto;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -16939,15 +16833,8 @@ md-card md-card-title+md-card-content {
 }
 
 md-card md-card-title md-card-title-text {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex
 }
 
@@ -17025,18 +16912,9 @@ md-card md-card-actions.layout-column .md-button.md-icon-button {
 
 md-card .md-actions md-card-icon-actions,
 md-card md-card-actions md-card-icon-actions {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
-    -webkit-box-pack: start;
-    -webkit-justify-content: flex-start;
     justify-content: flex-start;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -17097,18 +16975,9 @@ md-card md-card-actions:not(.layout-column) .md-button.md-icon-button:last-of-ty
 
 md-card .md-actions:not(.layout-column) .md-button+md-card-icon-actions,
 md-card md-card-actions:not(.layout-column) .md-button+md-card-icon-actions {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
-    -webkit-box-pack: end;
-    -webkit-justify-content: flex-end;
     justify-content: flex-end;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -17211,7 +17080,6 @@ md-checkbox .md-container:before {
     top: 0;
     right: 0;
     bottom: 0;
-    -webkit-transition: all .5s;
     transition: all .5s;
     width: auto
 }
@@ -17239,7 +17107,6 @@ md-checkbox .md-container .md-ripple-container {
 
 md-checkbox .md-icon {
     box-sizing: border-box;
-    -webkit-transition: 240ms;
     transition: 240ms;
     position: absolute;
     top: 0;
@@ -17695,7 +17562,6 @@ md-calendar {
 }
 
 .md-calendar-date-selection-indicator {
-    -webkit-transition: background-color, color .4s cubic-bezier(.25, .8, .25, 1);
     transition: background-color, color .4s cubic-bezier(.25, .8, .25, 1);
     border-radius: 50%;
     display: inline-block;
@@ -17934,7 +17800,6 @@ md-datepicker {
     transform: scale(0);
     -webkit-transform-origin: 0 0;
     transform-origin: 0 0;
-    -webkit-transition: -webkit-transform .2s cubic-bezier(.25, .8, .25, 1);
     transition: -webkit-transform .2s cubic-bezier(.25, .8, .25, 1);
     transition: transform .2s cubic-bezier(.25, .8, .25, 1);
     transition: transform .2s cubic-bezier(.25, .8, .25, 1), -webkit-transform .2s cubic-bezier(.25, .8, .25, 1)
@@ -17957,7 +17822,6 @@ md-datepicker {
 
 .md-datepicker-calendar {
     opacity: 0;
-    -webkit-transition: opacity .2s cubic-bezier(.5, 0, .25, 1);
     transition: opacity .2s cubic-bezier(.5, 0, .25, 1)
 }
 
@@ -18037,11 +17901,9 @@ md-datepicker[disabled] .md-datepicker-triangle-button {
 .md-datepicker-calendar-pane .md-calendar {
     -webkit-transform: translateY(-85px);
     transform: translateY(-85px);
-    -webkit-transition: -webkit-transform .65s cubic-bezier(.25, .8, .25, 1);
     transition: -webkit-transform .65s cubic-bezier(.25, .8, .25, 1);
     transition: transform .65s cubic-bezier(.25, .8, .25, 1);
     transition: transform .65s cubic-bezier(.25, .8, .25, 1), -webkit-transform .65s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-delay: 125ms;
     transition-delay: 125ms
 }
 
@@ -18055,14 +17917,8 @@ md-datepicker[disabled] .md-datepicker-triangle-button {
 }
 
 .md-dialog-container {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
     justify-content: center;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     position: absolute;
     top: 0;
@@ -18081,18 +17937,12 @@ md-dialog {
     position: relative;
     overflow: auto;
     box-shadow: 0 7px 8px -4px rgba(0, 0, 0, .2), 0 13px 19px 2px rgba(0, 0, 0, .14), 0 5px 24px 4px rgba(0, 0, 0, .12);
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column
 }
 
 md-dialog.md-transition-in {
     opacity: 1;
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
     -webkit-transform: translate(0, 0) scale(1);
     transform: translate(0, 0) scale(1)
@@ -18100,19 +17950,13 @@ md-dialog.md-transition-in {
 
 md-dialog.md-transition-out {
     opacity: 0;
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
     -webkit-transform: translate(0, 100%) scale(.2);
     transform: translate(0, 100%) scale(.2)
 }
 
 md-dialog>form {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     overflow: auto
 }
@@ -18122,12 +17966,7 @@ md-dialog .md-dialog-content {
 }
 
 md-dialog md-dialog-content {
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     overflow: auto;
     -webkit-overflow-scrolling: touch
@@ -18156,18 +17995,10 @@ md-dialog md-dialog-content .md-prompt-input-container {
 
 md-dialog .md-actions,
 md-dialog md-dialog-actions {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2;
     box-sizing: border-box;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-box-pack: end;
-    -webkit-justify-content: flex-end;
     justify-content: flex-end;
     margin-bottom: 0;
     padding-right: 8px;
@@ -18257,11 +18088,7 @@ md-divider[md-inset] {
 
 md-fab-speed-dial {
     position: relative;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     z-index: 20
 }
@@ -18316,122 +18143,75 @@ md-fab-speed-dial ._md-css-variables {
 }
 
 md-fab-speed-dial.md-is-open .md-fab-action-item {
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center
 }
 
 md-fab-speed-dial md-fab-actions {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     height: auto
 }
 
 md-fab-speed-dial md-fab-actions .md-fab-action-item {
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2)
 }
 
 md-fab-speed-dial.md-down {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column
 }
 
 md-fab-speed-dial.md-down md-fab-trigger {
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1
 }
 
 md-fab-speed-dial.md-down md-fab-actions {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2
 }
 
 md-fab-speed-dial.md-up {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column
 }
 
 md-fab-speed-dial.md-up md-fab-trigger {
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2
 }
 
 md-fab-speed-dial.md-up md-fab-actions {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: reverse;
-    -webkit-flex-direction: column-reverse;
     flex-direction: column-reverse;
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1
 }
 
 md-fab-speed-dial.md-left {
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
 md-fab-speed-dial.md-left md-fab-trigger {
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2
 }
 
 md-fab-speed-dial.md-left md-fab-actions {
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: reverse;
-    -webkit-flex-direction: row-reverse;
     flex-direction: row-reverse;
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1
 }
 
 md-fab-speed-dial.md-left md-fab-actions .md-fab-action-item {
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2)
 }
 
 md-fab-speed-dial.md-right {
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
 md-fab-speed-dial.md-right md-fab-trigger {
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1
 }
 
 md-fab-speed-dial.md-right md-fab-actions {
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row;
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2
 }
 
 md-fab-speed-dial.md-right md-fab-actions .md-fab-action-item {
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2)
 }
 
@@ -18446,16 +18226,13 @@ md-fab-speed-dial.md-fling .md-fab-action-item {
 
 md-fab-speed-dial.md-fling.md-animations-waiting .md-fab-action-item {
     opacity: 0;
-    -webkit-transition-duration: 0s;
     transition-duration: 0s
 }
 
 md-fab-speed-dial.md-scale .md-fab-action-item {
     -webkit-transform: scale(0);
     transform: scale(0);
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-duration: .14286s;
     transition-duration: .14286s
 }
 
@@ -18516,7 +18293,6 @@ md-fab-toolbar md-fab-trigger .md-fab-toolbar-background {
     position: absolute;
     z-index: 21;
     opacity: 1;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2)
 }
 
@@ -18524,7 +18300,6 @@ md-fab-toolbar md-fab-trigger md-icon {
     position: relative;
     z-index: 22;
     opacity: 1;
-    -webkit-transition: all .2s ease-in;
     transition: all .2s ease-in
 }
 
@@ -18538,9 +18313,6 @@ md-fab-toolbar.md-left md-fab-trigger {
 }
 
 md-fab-toolbar.md-left .md-toolbar-tools {
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: reverse;
-    -webkit-flex-direction: row-reverse;
     flex-direction: row-reverse
 }
 
@@ -18581,9 +18353,6 @@ md-fab-toolbar.md-right md-fab-trigger {
 }
 
 md-fab-toolbar.md-right .md-toolbar-tools {
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -18602,9 +18371,7 @@ md-fab-toolbar md-toolbar .md-fab-action-item {
     opacity: 0;
     -webkit-transform: scale(0);
     transform: scale(0);
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-duration: .15s;
     transition-duration: .15s
 }
 
@@ -18641,14 +18408,8 @@ md-grid-list md-grid-tile {
 }
 
 md-grid-list md-grid-tile figure {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
     justify-content: center;
     height: 100%;
     position: absolute;
@@ -18662,15 +18423,8 @@ md-grid-list md-grid-tile figure {
 
 md-grid-list md-grid-tile md-grid-tile-footer,
 md-grid-list md-grid-tile md-grid-tile-header {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     height: 48px;
     color: #fff;
@@ -18851,8 +18605,6 @@ md-input-container label:not(.md-no-float):not(.md-container-ignore) {
     text-overflow: ellipsis;
     white-space: nowrap;
     width: 100%;
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1;
     pointer-events: none;
     -webkit-font-smoothing: antialiased;
@@ -18861,7 +18613,6 @@ md-input-container label:not(.md-no-float):not(.md-container-ignore) {
     z-index: 1;
     -webkit-transform: translate3d(0, 28px, 0) scale(1);
     transform: translate3d(0, 28px, 0) scale(1);
-    -webkit-transition: -webkit-transform .4s cubic-bezier(.25, .8, .25, 1);
     transition: -webkit-transform .4s cubic-bezier(.25, .8, .25, 1);
     transition: transform .4s cubic-bezier(.25, .8, .25, 1);
     transition: transform .4s cubic-bezier(.25, .8, .25, 1), -webkit-transform .4s cubic-bezier(.25, .8, .25, 1);
@@ -18890,7 +18641,6 @@ md-input-container .md-placeholder {
     position: absolute;
     top: 0;
     opacity: 0;
-    -webkit-transition-property: opacity, -webkit-transform;
     transition-property: opacity, -webkit-transform;
     transition-property: opacity, transform;
     transition-property: opacity, transform, -webkit-transform;
@@ -18905,12 +18655,14 @@ md-input-container.md-input-focused .md-placeholder {
 }
 
 md-input-container.md-input-has-value .md-placeholder {
-    -webkit-transition: none;
     transition: none;
     opacity: 0
 }
 
-md-input-container:not(.md-input-has-value) input:not(:focus),
+md-input-container:not(.md-input-has-value):not(.md-input-has-placeholder) input:not(:focus) {
+    color: transparent
+}
+
 md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-ampm-field,
 md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-day-field,
 md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-edit-hour-field,
@@ -18925,8 +18677,6 @@ md-input-container:not(.md-input-has-value) input:not(:focus)::-webkit-datetime-
 }
 
 md-input-container .md-input {
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2;
     display: block;
     margin-top: 0;
@@ -18960,8 +18710,6 @@ md-input-container .md-input:invalid {
 }
 
 md-input-container .md-input.md-no-flex {
-    -webkit-box-flex: 0 !important;
-    -webkit-flex: none !important;
     flex: none !important
 }
 
@@ -18985,8 +18733,6 @@ md-input-container .md-char-counter {
 
 md-input-container .md-input-messages-animation {
     position: relative;
-    -webkit-box-ordinal-group: 5;
-    -webkit-order: 4;
     order: 4;
     overflow: hidden;
     clear: left
@@ -19001,7 +18747,6 @@ md-input-container .md-input-message-animation {
     font-size: 12px;
     line-height: 14px;
     overflow: hidden;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
     opacity: 1;
     margin-top: 0;
@@ -19044,14 +18789,12 @@ md-input-container.md-input-has-placeholder label:not(.md-no-float),
 md-input-container.md-input-has-value label:not(.md-no-float) {
     -webkit-transform: translate3d(0, 6px, 0) scale(.75);
     transform: translate3d(0, 6px, 0) scale(.75);
-    -webkit-transition: width cubic-bezier(.25, .8, .25, 1) .4s, -webkit-transform cubic-bezier(.25, .8, .25, 1) .4s;
     transition: width cubic-bezier(.25, .8, .25, 1) .4s, -webkit-transform cubic-bezier(.25, .8, .25, 1) .4s;
     transition: transform cubic-bezier(.25, .8, .25, 1) .4s, width cubic-bezier(.25, .8, .25, 1) .4s;
     transition: transform cubic-bezier(.25, .8, .25, 1) .4s, width cubic-bezier(.25, .8, .25, 1) .4s, -webkit-transform cubic-bezier(.25, .8, .25, 1) .4s
 }
 
 md-input-container.md-input-has-value label {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -19070,7 +18813,6 @@ md-input-container .md-input[disabled] {
 }
 
 md-input-container.md-icon-float {
-    -webkit-transition: margin-top .4s cubic-bezier(.25, .8, .25, 1);
     transition: margin-top .4s cubic-bezier(.25, .8, .25, 1)
 }
 
@@ -19248,8 +18990,6 @@ md-list.md-dense md-list-item .md-list-item-inner .md-avatar-icon {
 
 md-list.md-dense md-list-item .md-avatar,
 md-list.md-dense md-list-item .md-list-item-inner .md-avatar {
-    -webkit-box-flex: 0;
-    -webkit-flex: none;
     flex: none;
     width: 36px;
     height: 36px
@@ -19338,7 +19078,6 @@ md-list-item {
 }
 
 md-list-item.md-proxy-focus.md-focused .md-no-style {
-    -webkit-transition: background-color .15s linear;
     transition: background-color .15s linear
 }
 
@@ -19347,14 +19086,8 @@ md-list-item._md-button-wrap {
 }
 
 md-list-item._md-button-wrap>div.md-button:first-child {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-box-pack: start;
-    -webkit-justify-content: flex-start;
     justify-content: flex-start;
     padding: 0 16px;
     margin: 0;
@@ -19377,16 +19110,20 @@ md-list-item._md-button-wrap>div.md-button:first-child>.md-button:first-child {
 }
 
 md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner {
-    width: 100%;
-    min-height: inherit
+    width: 100%
+}
+
+md-list-item._md-button-wrap>div.md-button:first-child .md-list-item-inner::before {
+    content: '';
+    min-height: inherit;
+    visibility: hidden;
+    display: inline-block
 }
 
 md-list-item .md-no-style,
 md-list-item.md-no-proxy {
     position: relative;
     padding: 0 16px;
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 auto;
     flex: 1 1 auto
 }
 
@@ -19398,12 +19135,7 @@ md-list-item.md-no-proxy.md-button {
     text-transform: none;
     width: 100%;
     white-space: normal;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: inherit;
     flex-direction: inherit;
-    -webkit-box-align: inherit;
-    -webkit-align-items: inherit;
     align-items: inherit;
     border-radius: 0;
     margin: 0
@@ -19453,14 +19185,8 @@ md-list-item md-divider[md-inset] {
 
 md-list-item,
 md-list-item .md-list-item-inner {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-pack: start;
-    -webkit-justify-content: flex-start;
     justify-content: flex-start;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     min-height: 48px;
     height: auto
@@ -19496,8 +19222,6 @@ md-list-item md-checkbox.md-secondary,
 md-list-item>div.md-primary>md-checkbox,
 md-list-item>div.md-secondary>md-checkbox,
 md-list-item>md-checkbox {
-    -webkit-align-self: center;
-    -ms-grid-row-align: center;
     align-self: center
 }
 
@@ -19544,8 +19268,6 @@ md-list-item .md-list-item-inner .md-avatar-icon {
 
 md-list-item .md-avatar,
 md-list-item .md-list-item-inner .md-avatar {
-    -webkit-box-flex: 0;
-    -webkit-flex: none;
     flex: none;
     width: 40px;
     height: 40px
@@ -19582,13 +19304,9 @@ md-list-item>md-checkbox {
 
 md-list-item .md-list-item-inner .md-secondary-container,
 md-list-item .md-secondary-container {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-flex-shrink: 0;
+    position: relative;
     flex-shrink: 0;
     margin: auto;
     margin-right: 0;
@@ -19655,8 +19373,6 @@ md-list-item .md-list-item-inner>.md-list-item-inner>p,
 md-list-item .md-list-item-inner>p,
 md-list-item>.md-list-item-inner>p,
 md-list-item>p {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 auto;
     flex: 1 1 auto;
     margin: 0
 }
@@ -19665,11 +19381,7 @@ md-list-item.md-2-line,
 md-list-item.md-2-line>.md-no-style,
 md-list-item.md-3-line,
 md-list-item.md-3-line>.md-no-style {
-    -webkit-box-align: start;
-    -webkit-align-items: flex-start;
     align-items: flex-start;
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
     justify-content: center
 }
 
@@ -19685,8 +19397,6 @@ md-list-item.md-2-line .md-list-item-text,
 md-list-item.md-2-line>.md-no-style .md-list-item-text,
 md-list-item.md-3-line .md-list-item-text,
 md-list-item.md-3-line>.md-no-style .md-list-item-text {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 auto;
     flex: 1 1 auto;
     margin: auto;
     text-overflow: ellipsis;
@@ -19770,14 +19480,11 @@ md-list-item.md-2-line>.md-no-style>.md-avatar {
 
 md-list-item.md-2-line>.md-no-style>md-icon:first-child,
 md-list-item.md-2-line>md-icon:first-child {
-    -webkit-align-self: flex-start;
     align-self: flex-start
 }
 
 md-list-item.md-2-line .md-list-item-text,
 md-list-item.md-2-line>.md-no-style .md-list-item-text {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 auto;
     flex: 1 1 auto
 }
 
@@ -19832,37 +19539,25 @@ md-list-item.md-3-line>md-icon:first-child {
 
 .md-open-menu-container.md-active {
     opacity: 1;
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-duration: .2s;
     transition-duration: .2s
 }
 
 .md-open-menu-container.md-active>md-menu-content>* {
     opacity: 1;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-duration: .2s;
     transition-duration: .2s;
-    -webkit-transition-delay: .1s;
     transition-delay: .1s
 }
 
 .md-open-menu-container.md-leave {
     opacity: 0;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-duration: 250ms;
     transition-duration: 250ms
 }
 
 md-menu-content {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     padding: 8px 0;
     max-height: 304px;
@@ -19875,23 +19570,15 @@ md-menu-content.md-dense {
 
 md-menu-content.md-dense md-menu-item {
     height: 32px;
-    min-height: 0
+    min-height: 32px
 }
 
 md-menu-item {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row;
     min-height: 48px;
     height: 48px;
-    -webkit-align-content: center;
     align-content: center;
-    -webkit-box-pack: start;
-    -webkit-justify-content: flex-start;
     justify-content: flex-start
 }
 
@@ -20168,12 +19855,7 @@ md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -20185,7 +19867,6 @@ md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after {
     line-height: 24px;
     margin: 0 4px;
     padding: 12px 16px;
-    -webkit-transition: background-color .35s cubic-bezier(.35, 0, .25, 1);
     transition: background-color .35s cubic-bezier(.35, 0, .25, 1)
 }
 
@@ -20193,10 +19874,6 @@ md-menu-content.md-menu-bar-menu.md-dense .md-menu>.md-button:after {
     outline: 0
 }
 
-.md-button._md-nav-button:hover {
-    background-color: inherit
-}
-
 md-nav-ink-bar {
     bottom: 0;
     height: 2px;
@@ -20207,17 +19884,14 @@ md-nav-ink-bar {
 }
 
 md-nav-ink-bar._md-left {
-    -webkit-transition: left 125ms cubic-bezier(.35, 0, .25, 1), right .25s cubic-bezier(.35, 0, .25, 1);
     transition: left 125ms cubic-bezier(.35, 0, .25, 1), right .25s cubic-bezier(.35, 0, .25, 1)
 }
 
 md-nav-ink-bar._md-right {
-    -webkit-transition: left .25s cubic-bezier(.35, 0, .25, 1), right 125ms cubic-bezier(.35, 0, .25, 1);
     transition: left .25s cubic-bezier(.35, 0, .25, 1), right 125ms cubic-bezier(.35, 0, .25, 1)
 }
 
 md-nav-ink-bar.ng-animate {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -20317,7 +19991,6 @@ md-progress-linear .md-container .md-dashed:before {
 
 md-progress-linear .md-container .md-bar1,
 md-progress-linear .md-container .md-bar2 {
-    -webkit-transition: -webkit-transform .2s linear;
     transition: -webkit-transform .2s linear;
     transition: transform .2s linear;
     transition: transform .2s linear, -webkit-transform .2s linear
@@ -20328,7 +20001,6 @@ md-progress-linear .md-container.md-mode-query .md-bar1 {
 }
 
 md-progress-linear .md-container.md-mode-query .md-bar2 {
-    -webkit-transition: all .2s linear;
     transition: all .2s linear;
     -webkit-animation: query .8s infinite cubic-bezier(.39, .575, .565, 1);
     animation: query .8s infinite cubic-bezier(.39, .575, .565, 1)
@@ -20365,7 +20037,6 @@ md-progress-linear .md-container.ng-hide ._md-progress-linear-disabled md-progre
 
 md-progress-linear .md-container.md-mode-buffer {
     background-color: transparent !important;
-    -webkit-transition: all .2s linear;
     transition: all .2s linear
 }
 
@@ -20705,7 +20376,6 @@ md-radio-button .md-container:before {
     top: 0;
     right: 0;
     bottom: 0;
-    -webkit-transition: all .5s;
     transition: all .5s;
     width: auto
 }
@@ -20724,7 +20394,6 @@ md-radio-button .md-off {
     border-style: solid;
     border-width: 2px;
     border-radius: 50%;
-    -webkit-transition: border-color ease .28s;
     transition: border-color ease .28s
 }
 
@@ -20736,7 +20405,6 @@ md-radio-button .md-on {
     width: 20px;
     height: 20px;
     border-radius: 50%;
-    -webkit-transition: -webkit-transform ease .28s;
     transition: -webkit-transform ease .28s;
     transition: transform ease .28s;
     transition: transform ease .28s, -webkit-transform ease .28s;
@@ -20842,7 +20510,14 @@ md-radio-group:focus {
     outline: 0
 }
 
-md-radio-group.md-focused .md-checked .md-container:before {
+md-radio-group.md-focused.ng-not-empty .md-checked .md-container:before {
+    left: -8px;
+    top: -8px;
+    right: -8px;
+    bottom: -8px
+}
+
+md-radio-group.md-focused.ng-empty>md-radio-button:first-child .md-container:before {
     left: -8px;
     top: -8px;
     right: -8px;
@@ -20877,7 +20552,6 @@ md-radio-group[disabled] md-radio-button .md-container {
 }
 
 md-input-container:not([md-no-float]) .md-select-placeholder span:first-child {
-    -webkit-transition: -webkit-transform .4s cubic-bezier(.25, .8, .25, 1);
     transition: -webkit-transform .4s cubic-bezier(.25, .8, .25, 1);
     transition: transform .4s cubic-bezier(.25, .8, .25, 1);
     transition: transform .4s cubic-bezier(.25, .8, .25, 1), -webkit-transform .4s cubic-bezier(.25, .8, .25, 1);
@@ -20921,34 +20595,25 @@ md-input-container.md-input-focused:not([md-no-float]) .md-select-placeholder sp
 }
 
 .md-select-menu-container.md-active md-select-menu {
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-duration: 150ms;
     transition-duration: 150ms
 }
 
 .md-select-menu-container.md-active md-select-menu>* {
     opacity: 1;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-duration: 150ms;
     transition-duration: 150ms;
-    -webkit-transition-delay: .1s;
     transition-delay: .1s
 }
 
 .md-select-menu-container.md-leave {
     opacity: 0;
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-duration: 250ms;
     transition-duration: 250ms
 }
 
 md-input-container>md-select {
     margin: 0;
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2
 }
 
@@ -20965,14 +20630,12 @@ md-input-container.md-input-invalid md-select .md-select-value {
 }
 
 md-select {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     margin: 20px 0 26px 0
 }
 
-md-select.ng-required.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,
-md-select[required].ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after {
+md-select.ng-required.ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after,
+md-select[required].ng-empty.ng-invalid:not(.md-no-asterisk) .md-select-value span:first-child:after {
     content: ' *';
     font-size: 13px;
     vertical-align: top
@@ -21018,11 +20681,7 @@ md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon)
 }
 
 .md-select-value {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     padding: 2px 2px 1px;
     border-bottom-width: 1px;
@@ -21032,15 +20691,11 @@ md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon)
     box-sizing: content-box;
     min-width: 64px;
     min-height: 26px;
-    -webkit-box-flex: 1;
-    -webkit-flex-grow: 1;
     flex-grow: 1
 }
 
 .md-select-value>span:not(.md-select-icon) {
     max-width: 100%;
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 auto;
     flex: 1 1 auto;
     text-overflow: ellipsis;
     white-space: nowrap;
@@ -21053,10 +20708,8 @@ md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon)
 
 .md-select-value .md-select-icon {
     display: block;
-    -webkit-box-align: end;
-    -webkit-align-items: flex-end;
     align-items: flex-end;
-    text-align: end;
+    text-align: right;
     width: 24px;
     margin: 0 4px;
     -webkit-transform: translate3d(0, -2px, 0);
@@ -21064,6 +20717,14 @@ md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon)
     font-size: 1.2rem
 }
 
+[dir=rtl] .md-select-value .md-select-icon {
+    align-items: flex-start
+}
+
+[dir=rtl] .md-select-value .md-select-icon {
+    text-align: left
+}
+
 .md-select-value .md-select-icon:after {
     display: block;
     content: '\25BC';
@@ -21076,11 +20737,7 @@ md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon)
 }
 
 .md-select-value.md-select-placeholder {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1;
     pointer-events: none;
     -webkit-font-smoothing: antialiased;
@@ -21089,12 +20746,7 @@ md-input-container.md-input-has-value .md-select-value>span:not(.md-select-icon)
 }
 
 md-select-menu {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 2px 1px -1px rgba(0, 0, 0, .12);
     max-height: 256px;
@@ -21107,9 +20759,6 @@ md-select-menu {
 }
 
 md-select-menu.md-reverse {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: reverse;
-    -webkit-flex-direction: column-reverse;
     flex-direction: column-reverse
 }
 
@@ -21137,14 +20786,9 @@ md-select-menu>* {
 md-option {
     cursor: pointer;
     position: relative;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     width: auto;
-    -webkit-transition: background .15s linear;
     transition: background .15s linear;
     padding: 0 16px 0 16px;
     height: 48px
@@ -21243,7 +20887,6 @@ md-select-menu[multiple] md-option.md-checkbox-enabled .md-container:before {
     top: 0;
     right: 0;
     bottom: 0;
-    -webkit-transition: all .5s;
     transition: all .5s;
     width: auto
 }
@@ -21271,7 +20914,6 @@ md-select-menu[multiple] md-option.md-checkbox-enabled .md-container .md-ripple-
 
 md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon {
     box-sizing: border-box;
-    -webkit-transition: 240ms;
     transition: 240ms;
     position: absolute;
     top: 0;
@@ -21341,9 +20983,6 @@ md-select-menu[multiple] md-option.md-checkbox-enabled .md-container {
 md-sidenav {
     box-sizing: border-box;
     position: absolute;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     z-index: 60;
     width: 320px;
@@ -21363,24 +21002,18 @@ md-sidenav.md-closed {
 
 md-sidenav.md-closed-add,
 md-sidenav.md-closed-remove {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-transition: .2s ease-in all;
     transition: .2s ease-in all
 }
 
 md-sidenav.md-closed-add.md-closed-add-active,
 md-sidenav.md-closed-remove.md-closed-remove-active {
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1)
 }
 
 md-sidenav.md-locked-open-add,
 md-sidenav.md-locked-open-remove {
     position: static;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     -webkit-transform: translate3d(0, 0, 0);
     transform: translate3d(0, 0, 0)
@@ -21391,8 +21024,6 @@ md-sidenav.md-locked-open.md-closed,
 md-sidenav.md-locked-open.md-closed.md-sidenav-left,
 md-sidenav.md-locked-open.md-closed.md-sidenav-right {
     position: static;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     -webkit-transform: translate3d(0, 0, 0);
     transform: translate3d(0, 0, 0)
@@ -21400,8 +21031,6 @@ md-sidenav.md-locked-open.md-closed.md-sidenav-right {
 
 md-sidenav.md-locked-open-remove.md-closed {
     position: static;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     -webkit-transform: translate3d(0, 0, 0);
     transform: translate3d(0, 0, 0)
@@ -21409,27 +21038,22 @@ md-sidenav.md-locked-open-remove.md-closed {
 
 md-sidenav.md-closed.md-locked-open-add {
     position: static;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     -webkit-transform: translate3d(0, 0, 0);
     transform: translate3d(0, 0, 0)
 }
 
 md-sidenav.md-closed.md-locked-open-add:not(.md-locked-open-add-active) {
-    -webkit-transition: width .3s cubic-bezier(.55, 0, .55, .2), min-width .3s cubic-bezier(.55, 0, .55, .2);
     transition: width .3s cubic-bezier(.55, 0, .55, .2), min-width .3s cubic-bezier(.55, 0, .55, .2);
     width: 0 !important;
     min-width: 0 !important
 }
 
 md-sidenav.md-closed.md-locked-open-add-active {
-    -webkit-transition: width .3s cubic-bezier(.55, 0, .55, .2), min-width .3s cubic-bezier(.55, 0, .55, .2);
     transition: width .3s cubic-bezier(.55, 0, .55, .2), min-width .3s cubic-bezier(.55, 0, .55, .2)
 }
 
 md-sidenav.md-locked-open-remove-active {
-    -webkit-transition: width .3s cubic-bezier(.55, 0, .55, .2), min-width .3s cubic-bezier(.55, 0, .55, .2);
     transition: width .3s cubic-bezier(.55, 0, .55, .2), min-width .3s cubic-bezier(.55, 0, .55, .2);
     width: 0 !important;
     min-width: 0 !important
@@ -21605,9 +21229,6 @@ md-slider {
     margin-right: 4px;
     padding: 0;
     display: block;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -21641,9 +21262,7 @@ md-slider .md-track {
 }
 
 md-slider .md-track-fill {
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-property: width, height;
     transition-property: width, height
 }
 
@@ -21665,9 +21284,7 @@ md-slider .md-thumb-container {
     top: 50%;
     -webkit-transform: translate3d(-50%, -50%, 0);
     transform: translate3d(-50%, -50%, 0);
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-property: left, right, bottom;
     transition-property: left, right, bottom
 }
 
@@ -21686,7 +21303,6 @@ md-slider .md-thumb {
     border-radius: 20px;
     -webkit-transform: scale(.7);
     transform: scale(.7);
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1)
 }
 
@@ -21703,19 +21319,12 @@ md-slider .md-thumb:after {
     border-radius: 20px;
     border-width: 3px;
     border-style: solid;
-    -webkit-transition: inherit;
     transition: inherit
 }
 
 md-slider .md-sign {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
     justify-content: center;
     position: absolute;
     left: -14px;
@@ -21725,7 +21334,6 @@ md-slider .md-sign {
     border-radius: 28px;
     -webkit-transform: scale(.4) translate3d(0, 67.5px, 0);
     transform: scale(.4) translate3d(0, 67.5px, 0);
-    -webkit-transition: all .3s cubic-bezier(.35, 0, .25, 1);
     transition: all .3s cubic-bezier(.35, 0, .25, 1)
 }
 
@@ -21742,7 +21350,6 @@ md-slider .md-sign:after {
     opacity: 0;
     -webkit-transform: translate3d(0, -8px, 0);
     transform: translate3d(0, -8px, 0);
-    -webkit-transition: all .2s cubic-bezier(.35, 0, .25, 1);
     transition: all .2s cubic-bezier(.35, 0, .25, 1)
 }
 
@@ -21767,7 +21374,6 @@ md-slider .md-focus-ring {
     -webkit-transform: scale(.7);
     transform: scale(.7);
     opacity: 0;
-    -webkit-transition: all .35s cubic-bezier(.35, 0, .25, 1);
     transition: all .35s cubic-bezier(.35, 0, .25, 1)
 }
 
@@ -21805,7 +21411,6 @@ md-slider:focus {
 
 md-slider.md-dragging .md-thumb-container,
 md-slider.md-dragging .md-track-fill {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -21896,28 +21501,18 @@ md-slider[disabled] .md-disabled-thumb {
 }
 
 md-slider[md-vertical] {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     min-height: 128px;
     min-width: 0
 }
 
 md-slider[md-vertical] .md-slider-wrapper {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
     padding-top: 12px;
     padding-bottom: 12px;
     width: 48px;
-    -webkit-align-self: center;
     align-self: center;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
     justify-content: center
 }
 
@@ -21965,7 +21560,6 @@ md-slider[md-vertical][md-discrete] .md-sign:after {
     opacity: 0;
     -webkit-transform: translate3d(0, -8px, 0);
     transform: translate3d(0, -8px, 0);
-    -webkit-transition: all .2s ease-in-out;
     transition: all .2s ease-in-out
 }
 
@@ -22012,15 +21606,8 @@ md-slider[md-invert][md-vertical] .md-track-fill {
 }
 
 md-slider-container {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -22029,9 +21616,7 @@ md-slider-container>:last-child:not(md-slider) {
     min-width: 25px;
     max-width: 42px;
     height: 25px;
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-property: color, max-width;
     transition-property: color, max-width
 }
 
@@ -22054,9 +21639,6 @@ md-slider-container>:last-child:not(md-slider) {
 }
 
 md-slider-container[md-vertical] {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column
 }
 
@@ -22146,7 +21728,6 @@ md-slider-container md-input-container input[type=number] {
 }
 
 .md-subheader-wrapper:not(.md-sticky-no-effect) {
-    -webkit-transition: .2s ease-out margin;
     transition: .2s ease-out margin
 }
 
@@ -22213,11 +21794,7 @@ md-switch {
     user-select: none;
     height: 30px;
     line-height: 28px;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     margin-left: inherit;
     margin-right: 16px
@@ -22290,17 +21867,13 @@ md-switch:not([disabled]).md-dragging .md-container {
     cursor: grabbing
 }
 
-md-switch.md-focused:not([disabled]) .md-thumb:before {
+md-switch.md-focused .md-thumb:before {
     left: -8px;
     top: -8px;
     right: -8px;
     bottom: -8px
 }
 
-md-switch.md-focused:not([disabled]):not(.md-checked) .md-thumb:before {
-    background-color: rgba(0, 0, 0, .12)
-}
-
 md-switch .md-label {
     border-color: transparent;
     border-width: 0;
@@ -22354,7 +21927,6 @@ md-switch .md-thumb:before {
     top: 0;
     right: 0;
     bottom: 0;
-    -webkit-transition: all .5s;
     transition: all .5s;
     width: auto
 }
@@ -22373,9 +21945,7 @@ md-switch .md-thumb .md-ripple-container {
 md-switch:not(.md-dragging) .md-bar,
 md-switch:not(.md-dragging) .md-thumb,
 md-switch:not(.md-dragging) .md-thumb-container {
-    -webkit-transition: all 80ms linear;
     transition: all 80ms linear;
-    -webkit-transition-property: background-color, -webkit-transform;
     transition-property: background-color, -webkit-transform;
     transition-property: transform, background-color;
     transition-property: transform, background-color, -webkit-transform
@@ -22383,7 +21953,6 @@ md-switch:not(.md-dragging) .md-thumb-container {
 
 md-switch:not(.md-dragging) .md-bar,
 md-switch:not(.md-dragging) .md-thumb {
-    -webkit-transition-delay: 50ms;
     transition-delay: 50ms
 }
 
@@ -22445,7 +22014,6 @@ md-tabs {
     border-radius: 2px;
     overflow: hidden;
     position: relative;
-    -webkit-flex-shrink: 0;
     flex-shrink: 0
 }
 
@@ -22497,8 +22065,8 @@ md-tabs[md-border-bottom]:not(.md-dynamic-height) md-tabs-content-wrapper {
 md-tabs-wrapper {
     display: block;
     position: relative;
-    -webkit-transform: translate3d(0, 0, 0);
-    transform: translate3d(0, 0, 0)
+    -webkit-transform: translate(0, 0);
+    transform: translate(0, 0)
 }
 
 md-tabs-wrapper md-next-button,
@@ -22514,7 +22082,6 @@ md-tabs-wrapper md-prev-button {
     cursor: pointer;
     font-size: 16px;
     background: transparent no-repeat center center;
-    -webkit-transition: all .5s cubic-bezier(.35, 0, .25, 1);
     transition: all .5s cubic-bezier(.35, 0, .25, 1)
 }
 
@@ -22531,7 +22098,6 @@ md-tabs-wrapper md-prev-button.md-disabled {
 
 md-tabs-wrapper md-next-button.ng-leave,
 md-tabs-wrapper md-prev-button.ng-leave {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -22540,8 +22106,8 @@ md-tabs-wrapper md-prev-button md-icon {
     position: absolute;
     top: 50%;
     left: 50%;
-    -webkit-transform: translate3d(-50%, -50%, 0);
-    transform: translate3d(-50%, -50%, 0)
+    -webkit-transform: translate(-50%, -50%);
+    transform: translate(-50%, -50%)
 }
 
 [dir=rtl] md-tabs-wrapper md-next-button,
@@ -22571,21 +22137,16 @@ md-tabs-wrapper md-next-button {
 }
 
 md-tabs-wrapper md-next-button md-icon {
-    -webkit-transform: translate3d(-50%, -50%, 0) rotate(180deg);
-    transform: translate3d(-50%, -50%, 0) rotate(180deg)
+    -webkit-transform: translate(-50%, -50%) rotate(180deg);
+    transform: translate(-50%, -50%) rotate(180deg)
 }
 
 md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper {
     width: 100%;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
 md-tabs-wrapper.md-stretch-tabs md-pagination-wrapper md-tab-item {
-    -webkit-box-flex: 1;
-    -webkit-flex-grow: 1;
     flex-grow: 1
 }
 
@@ -22618,12 +22179,7 @@ md-tabs-canvas.md-paginated {
 }
 
 md-tabs-canvas.md-center-tabs {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     text-align: center
 }
@@ -22635,17 +22191,14 @@ md-tabs-canvas.md-center-tabs .md-tab {
 
 md-pagination-wrapper {
     height: 48px;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-transition: -webkit-transform .5s cubic-bezier(.35, 0, .25, 1);
     transition: -webkit-transform .5s cubic-bezier(.35, 0, .25, 1);
     transition: transform .5s cubic-bezier(.35, 0, .25, 1);
     transition: transform .5s cubic-bezier(.35, 0, .25, 1), -webkit-transform .5s cubic-bezier(.35, 0, .25, 1);
     position: absolute;
     left: 0;
-    -webkit-transform: translate3d(0, 0, 0);
-    transform: translate3d(0, 0, 0)
+    -webkit-transform: translate(0, 0);
+    transform: translate(0, 0)
 }
 
 md-pagination-wrapper:after {
@@ -22661,8 +22214,6 @@ md-pagination-wrapper:after {
 
 md-pagination-wrapper.md-center-tabs {
     position: relative;
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
     justify-content: center
 }
 
@@ -22677,21 +22228,18 @@ md-tabs-content-wrapper {
 }
 
 md-tab-content {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
     position: absolute;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
-    -webkit-transition: -webkit-transform .5s cubic-bezier(.35, 0, .25, 1);
     transition: -webkit-transform .5s cubic-bezier(.35, 0, .25, 1);
     transition: transform .5s cubic-bezier(.35, 0, .25, 1);
     transition: transform .5s cubic-bezier(.35, 0, .25, 1), -webkit-transform .5s cubic-bezier(.35, 0, .25, 1);
     overflow: auto;
-    -webkit-transform: translate3d(0, 0, 0);
-    transform: translate3d(0, 0, 0)
+    -webkit-transform: translate(0, 0);
+    transform: translate(0, 0)
 }
 
 md-tab-content.md-no-scroll {
@@ -22701,7 +22249,6 @@ md-tab-content.md-no-scroll {
 
 md-tab-content.md-no-transition,
 md-tab-content.ng-leave {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -22719,9 +22266,7 @@ md-tab-content.md-left:not(.md-active) {
 }
 
 md-tab-content.md-left:not(.md-active) * {
-    -webkit-transition: visibility 0s linear;
     transition: visibility 0s linear;
-    -webkit-transition-delay: .5s;
     transition-delay: .5s;
     visibility: hidden
 }
@@ -22740,16 +22285,12 @@ md-tab-content.md-right:not(.md-active) {
 }
 
 md-tab-content.md-right:not(.md-active) * {
-    -webkit-transition: visibility 0s linear;
     transition: visibility 0s linear;
-    -webkit-transition-delay: .5s;
     transition-delay: .5s;
     visibility: hidden
 }
 
 md-tab-content>div {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 0 100%;
     flex: 1 0 100%;
     min-width: 0
 }
@@ -22768,12 +22309,10 @@ md-ink-bar {
 }
 
 md-ink-bar.md-left {
-    -webkit-transition: left 125ms cubic-bezier(.35, 0, .25, 1), right .25s cubic-bezier(.35, 0, .25, 1);
     transition: left 125ms cubic-bezier(.35, 0, .25, 1), right .25s cubic-bezier(.35, 0, .25, 1)
 }
 
 md-ink-bar.md-right {
-    -webkit-transition: left .25s cubic-bezier(.35, 0, .25, 1), right 125ms cubic-bezier(.35, 0, .25, 1);
     transition: left .25s cubic-bezier(.35, 0, .25, 1), right 125ms cubic-bezier(.35, 0, .25, 1)
 }
 
@@ -22788,7 +22327,6 @@ md-tab {
     text-align: center;
     line-height: 24px;
     padding: 12px 24px;
-    -webkit-transition: background-color .35s cubic-bezier(.35, 0, .25, 1);
     transition: background-color .35s cubic-bezier(.35, 0, .25, 1);
     cursor: pointer;
     white-space: nowrap;
@@ -22828,7 +22366,6 @@ md-tab {
 }
 
 .md-tab.ng-leave {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -22850,20 +22387,12 @@ md-toast {
     overflow: hidden;
     padding: 8px;
     opacity: 1;
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1)
 }
 
 md-toast .md-toast-content {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
     max-height: 168px;
     max-width: 100%;
@@ -22875,10 +22404,7 @@ md-toast .md-toast-content {
     overflow: hidden;
     -webkit-transform: translate3d(0, 0, 0) rotateZ(0);
     transform: translate3d(0, 0, 0) rotateZ(0);
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-box-pack: start;
-    -webkit-justify-content: flex-start;
     justify-content: flex-start
 }
 
@@ -22890,14 +22416,10 @@ md-toast .md-toast-content::before {
 }
 
 [dir=rtl] md-toast .md-toast-content {
-    -webkit-box-pack: end;
-    -webkit-justify-content: flex-end;
     justify-content: flex-end
 }
 
 md-toast .md-toast-content span {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 0%;
     flex: 1 1 0%;
     box-sizing: border-box;
     min-width: 0
@@ -22912,7 +22434,6 @@ md-toast.md-capsule .md-toast-content {
 }
 
 md-toast.ng-leave-active .md-toast-content {
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2)
 }
 
@@ -22920,7 +22441,6 @@ md-toast.md-swipedown .md-toast-content,
 md-toast.md-swipeleft .md-toast-content,
 md-toast.md-swiperight .md-toast-content,
 md-toast.md-swipeup .md-toast-content {
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1)
 }
 
@@ -23082,12 +22602,7 @@ md-toast .md-button {
 
 md-toolbar {
     box-sizing: border-box;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column;
     position: relative;
     z-index: 2;
@@ -23097,17 +22612,13 @@ md-toolbar {
 }
 
 md-toolbar._md-toolbar-transitions {
-    -webkit-transition-duration: .5s;
     transition-duration: .5s;
-    -webkit-transition-timing-function: cubic-bezier(.35, 0, .25, 1);
     transition-timing-function: cubic-bezier(.35, 0, .25, 1);
-    -webkit-transition-property: background-color, fill, color;
     transition-property: background-color, fill, color
 }
 
 md-toolbar.md-whiteframe-z1-add,
 md-toolbar.md-whiteframe-z1-remove {
-    -webkit-transition: box-shadow .5s linear;
     transition: box-shadow .5s linear
 }
 
@@ -23122,7 +22633,6 @@ md-toolbar :before {
 }
 
 md-toolbar.ng-animate {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -23166,15 +22676,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     letter-spacing: .005em;
     box-sizing: border-box;
     font-weight: 400;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row;
     width: 100%;
     height: 64px;
@@ -23197,11 +22700,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .md-toolbar-tools .fill-height {
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex;
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center
 }
 
@@ -23216,17 +22715,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
 .md-toolbar-tools .md-button,
 .md-toolbar-tools .md-button.md-icon-button md-icon {
-    -webkit-transition-duration: .5s;
     transition-duration: .5s;
-    -webkit-transition-timing-function: cubic-bezier(.35, 0, .25, 1);
     transition-timing-function: cubic-bezier(.35, 0, .25, 1);
-    -webkit-transition-property: background-color, fill, color;
     transition-property: background-color, fill, color
 }
 
 .md-toolbar-tools .md-button.md-icon-button md-icon.ng-animate,
 .md-toolbar-tools .md-button.ng-animate {
-    -webkit-transition: none;
     transition: none
 }
 
@@ -23365,9 +22860,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .md-tooltip.md-show {
-    -webkit-transition: all .4s cubic-bezier(.25, .8, .25, 1);
     transition: all .4s cubic-bezier(.25, .8, .25, 1);
-    -webkit-transition-duration: 150ms;
     transition-duration: 150ms;
     -webkit-transform: scale(1);
     transform: scale(1);
@@ -23375,9 +22868,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .md-tooltip.md-hide {
-    -webkit-transition: all .3s cubic-bezier(.55, 0, .55, .2);
     transition: all .3s cubic-bezier(.55, 0, .55, .2);
-    -webkit-transition-duration: 150ms;
     transition-duration: 150ms;
     -webkit-transform: scale(0);
     transform: scale(0);
@@ -23589,254 +23080,170 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-order {
-    -webkit-box-ordinal-group: 1;
-    -webkit-order: 0;
     order: 0
 }
 
 .flex-order--20 {
-    -webkit-box-ordinal-group: -19;
-    -webkit-order: -20;
     order: -20
 }
 
 .flex-order--19 {
-    -webkit-box-ordinal-group: -18;
-    -webkit-order: -19;
     order: -19
 }
 
 .flex-order--18 {
-    -webkit-box-ordinal-group: -17;
-    -webkit-order: -18;
     order: -18
 }
 
 .flex-order--17 {
-    -webkit-box-ordinal-group: -16;
-    -webkit-order: -17;
     order: -17
 }
 
 .flex-order--16 {
-    -webkit-box-ordinal-group: -15;
-    -webkit-order: -16;
     order: -16
 }
 
 .flex-order--15 {
-    -webkit-box-ordinal-group: -14;
-    -webkit-order: -15;
     order: -15
 }
 
 .flex-order--14 {
-    -webkit-box-ordinal-group: -13;
-    -webkit-order: -14;
     order: -14
 }
 
 .flex-order--13 {
-    -webkit-box-ordinal-group: -12;
-    -webkit-order: -13;
     order: -13
 }
 
 .flex-order--12 {
-    -webkit-box-ordinal-group: -11;
-    -webkit-order: -12;
     order: -12
 }
 
 .flex-order--11 {
-    -webkit-box-ordinal-group: -10;
-    -webkit-order: -11;
     order: -11
 }
 
 .flex-order--10 {
-    -webkit-box-ordinal-group: -9;
-    -webkit-order: -10;
     order: -10
 }
 
 .flex-order--9 {
-    -webkit-box-ordinal-group: -8;
-    -webkit-order: -9;
     order: -9
 }
 
 .flex-order--8 {
-    -webkit-box-ordinal-group: -7;
-    -webkit-order: -8;
     order: -8
 }
 
 .flex-order--7 {
-    -webkit-box-ordinal-group: -6;
-    -webkit-order: -7;
     order: -7
 }
 
 .flex-order--6 {
-    -webkit-box-ordinal-group: -5;
-    -webkit-order: -6;
     order: -6
 }
 
 .flex-order--5 {
-    -webkit-box-ordinal-group: -4;
-    -webkit-order: -5;
     order: -5
 }
 
 .flex-order--4 {
-    -webkit-box-ordinal-group: -3;
-    -webkit-order: -4;
     order: -4
 }
 
 .flex-order--3 {
-    -webkit-box-ordinal-group: -2;
-    -webkit-order: -3;
     order: -3
 }
 
 .flex-order--2 {
-    -webkit-box-ordinal-group: -1;
-    -webkit-order: -2;
     order: -2
 }
 
 .flex-order--1 {
-    -webkit-box-ordinal-group: 0;
-    -webkit-order: -1;
     order: -1
 }
 
 .flex-order-0 {
-    -webkit-box-ordinal-group: 1;
-    -webkit-order: 0;
     order: 0
 }
 
 .flex-order-1 {
-    -webkit-box-ordinal-group: 2;
-    -webkit-order: 1;
     order: 1
 }
 
 .flex-order-2 {
-    -webkit-box-ordinal-group: 3;
-    -webkit-order: 2;
     order: 2
 }
 
 .flex-order-3 {
-    -webkit-box-ordinal-group: 4;
-    -webkit-order: 3;
     order: 3
 }
 
 .flex-order-4 {
-    -webkit-box-ordinal-group: 5;
-    -webkit-order: 4;
     order: 4
 }
 
 .flex-order-5 {
-    -webkit-box-ordinal-group: 6;
-    -webkit-order: 5;
     order: 5
 }
 
 .flex-order-6 {
-    -webkit-box-ordinal-group: 7;
-    -webkit-order: 6;
     order: 6
 }
 
 .flex-order-7 {
-    -webkit-box-ordinal-group: 8;
-    -webkit-order: 7;
     order: 7
 }
 
 .flex-order-8 {
-    -webkit-box-ordinal-group: 9;
-    -webkit-order: 8;
     order: 8
 }
 
 .flex-order-9 {
-    -webkit-box-ordinal-group: 10;
-    -webkit-order: 9;
     order: 9
 }
 
 .flex-order-10 {
-    -webkit-box-ordinal-group: 11;
-    -webkit-order: 10;
     order: 10
 }
 
 .flex-order-11 {
-    -webkit-box-ordinal-group: 12;
-    -webkit-order: 11;
     order: 11
 }
 
 .flex-order-12 {
-    -webkit-box-ordinal-group: 13;
-    -webkit-order: 12;
     order: 12
 }
 
 .flex-order-13 {
-    -webkit-box-ordinal-group: 14;
-    -webkit-order: 13;
     order: 13
 }
 
 .flex-order-14 {
-    -webkit-box-ordinal-group: 15;
-    -webkit-order: 14;
     order: 14
 }
 
 .flex-order-15 {
-    -webkit-box-ordinal-group: 16;
-    -webkit-order: 15;
     order: 15
 }
 
 .flex-order-16 {
-    -webkit-box-ordinal-group: 17;
-    -webkit-order: 16;
     order: 16
 }
 
 .flex-order-17 {
-    -webkit-box-ordinal-group: 18;
-    -webkit-order: 17;
     order: 17
 }
 
 .flex-order-18 {
-    -webkit-box-ordinal-group: 19;
-    -webkit-order: 18;
     order: 18
 }
 
 .flex-order-19 {
-    -webkit-box-ordinal-group: 20;
-    -webkit-order: 19;
     order: 19
 }
 
 .flex-order-20 {
-    -webkit-box-ordinal-group: 21;
-    -webkit-order: 20;
     order: 20
 }
 
@@ -24164,13 +23571,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
 .layout-align,
 .layout-align-start-stretch {
-    -webkit-box-pack: start;
-    -webkit-justify-content: flex-start;
     justify-content: flex-start;
-    -webkit-align-content: stretch;
     align-content: stretch;
-    -webkit-box-align: stretch;
-    -webkit-align-items: stretch;
     align-items: stretch
 }
 
@@ -24179,8 +23581,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-start-end,
 .layout-align-start-start,
 .layout-align-start-stretch {
-    -webkit-box-pack: start;
-    -webkit-justify-content: flex-start;
     justify-content: flex-start
 }
 
@@ -24189,8 +23589,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-center-end,
 .layout-align-center-start,
 .layout-align-center-stretch {
-    -webkit-box-pack: center;
-    -webkit-justify-content: center;
     justify-content: center
 }
 
@@ -24199,8 +23597,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-end-end,
 .layout-align-end-start,
 .layout-align-end-stretch {
-    -webkit-box-pack: end;
-    -webkit-justify-content: flex-end;
     justify-content: flex-end
 }
 
@@ -24209,7 +23605,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-space-around-end,
 .layout-align-space-around-start,
 .layout-align-space-around-stretch {
-    -webkit-justify-content: space-around;
     justify-content: space-around
 }
 
@@ -24218,8 +23613,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-space-between-end,
 .layout-align-space-between-start,
 .layout-align-space-between-stretch {
-    -webkit-box-pack: justify;
-    -webkit-justify-content: space-between;
     justify-content: space-between
 }
 
@@ -24228,10 +23621,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-space-around-start,
 .layout-align-space-between-start,
 .layout-align-start-start {
-    -webkit-box-align: start;
-    -webkit-align-items: flex-start;
     align-items: flex-start;
-    -webkit-align-content: flex-start;
     align-content: flex-start
 }
 
@@ -24240,10 +23630,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-space-around-center,
 .layout-align-space-between-center,
 .layout-align-start-center {
-    -webkit-box-align: center;
-    -webkit-align-items: center;
     align-items: center;
-    -webkit-align-content: center;
     align-content: center;
     max-width: 100%
 }
@@ -24262,10 +23649,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-space-around-end,
 .layout-align-space-between-end,
 .layout-align-start-end {
-    -webkit-box-align: end;
-    -webkit-align-items: flex-end;
     align-items: flex-end;
-    -webkit-align-content: flex-end;
     align-content: flex-end
 }
 
@@ -24274,65 +23658,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-align-space-around-stretch,
 .layout-align-space-between-stretch,
 .layout-align-start-stretch {
-    -webkit-box-align: stretch;
-    -webkit-align-items: stretch;
     align-items: stretch;
-    -webkit-align-content: stretch;
     align-content: stretch
 }
 
 .flex {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1;
     flex: 1;
     box-sizing: border-box
 }
 
 .flex-grow {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     box-sizing: border-box
 }
 
 .flex-initial {
-    -webkit-box-flex: 0;
-    -webkit-flex: 0 1 auto;
     flex: 0 1 auto;
     box-sizing: border-box
 }
 
 .flex-auto {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 auto;
     flex: 1 1 auto;
     box-sizing: border-box
 }
 
 .flex-none {
-    -webkit-box-flex: 0;
-    -webkit-flex: 0 0 auto;
     flex: 0 0 auto;
     box-sizing: border-box
 }
 
 .flex-noshrink {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 0 auto;
     flex: 1 0 auto;
     box-sizing: border-box
 }
 
 .flex-nogrow {
-    -webkit-box-flex: 0;
-    -webkit-flex: 0 1 auto;
     flex: 0 1 auto;
     box-sizing: border-box
 }
 
 .flex-0 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 0%;
     max-height: 100%;
@@ -24340,8 +23705,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-0 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 0%;
     max-height: 100%;
@@ -24350,37 +23713,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-0 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 0%;
     box-sizing: border-box
 }
 
-.layout-row>.flex-0 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 0%;
-    max-height: 100%;
-    box-sizing: border-box;
-    min-width: 0
-}
-
-.layout-column>.flex-0 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 0%;
-    box-sizing: border-box;
-    min-height: 0
-}
-
 .flex-5 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 5%;
     max-height: 100%;
@@ -24388,26 +23727,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-5 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 5%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-5 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 5%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-5 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 5%;
     max-height: 100%;
@@ -24415,8 +23734,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-5 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 5%;
@@ -24424,8 +23741,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-10 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 10%;
     max-height: 100%;
@@ -24433,8 +23748,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-10 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 10%;
     max-height: 100%;
@@ -24442,26 +23755,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-10 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 10%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-10 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 10%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-10 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 10%;
@@ -24469,35 +23762,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-15 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 15%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-15 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 15%;
     max-height: 100%;
     box-sizing: border-box
 }
 
-.layout-column>.flex-15 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 15%;
-    box-sizing: border-box
-}
-
 .layout-row>.flex-15 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 15%;
     max-height: 100%;
@@ -24505,8 +23776,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-15 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 15%;
@@ -24514,8 +23783,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-20 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 20%;
     max-height: 100%;
@@ -24523,26 +23790,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-20 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 20%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-20 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 20%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-20 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 20%;
     max-height: 100%;
@@ -24550,8 +23797,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-20 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 20%;
@@ -24559,8 +23804,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-25 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 25%;
     max-height: 100%;
@@ -24568,8 +23811,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-25 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 25%;
     max-height: 100%;
@@ -24577,26 +23818,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-25 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 25%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-25 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 25%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-25 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 25%;
@@ -24604,35 +23825,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-30 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 30%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-30 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 30%;
     max-height: 100%;
     box-sizing: border-box
 }
 
-.layout-column>.flex-30 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 30%;
-    box-sizing: border-box
-}
-
 .layout-row>.flex-30 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 30%;
     max-height: 100%;
@@ -24640,8 +23839,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-30 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 30%;
@@ -24649,8 +23846,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-35 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 35%;
     max-height: 100%;
@@ -24658,8 +23853,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-35 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 35%;
     max-height: 100%;
@@ -24667,26 +23860,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-35 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 35%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-35 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 35%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-35 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 35%;
@@ -24694,8 +23867,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-40 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 40%;
     max-height: 100%;
@@ -24703,8 +23874,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-40 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 40%;
     max-height: 100%;
@@ -24712,26 +23881,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-40 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 40%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-40 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 40%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-40 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 40%;
@@ -24739,35 +23888,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-45 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 45%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-45 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 45%;
     max-height: 100%;
     box-sizing: border-box
 }
 
-.layout-column>.flex-45 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 45%;
-    box-sizing: border-box
-}
-
 .layout-row>.flex-45 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 45%;
     max-height: 100%;
@@ -24775,8 +23902,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-45 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 45%;
@@ -24784,35 +23909,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-50 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 50%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-50 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 50%;
     max-height: 100%;
     box-sizing: border-box
 }
 
-.layout-column>.flex-50 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 50%;
-    box-sizing: border-box
-}
-
 .layout-row>.flex-50 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 50%;
     max-height: 100%;
@@ -24820,8 +23923,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-50 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 50%;
@@ -24829,8 +23930,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-55 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 55%;
     max-height: 100%;
@@ -24838,8 +23937,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-55 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 55%;
     max-height: 100%;
@@ -24847,26 +23944,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-55 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 55%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-55 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 55%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-55 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 55%;
@@ -24874,35 +23951,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-60 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 60%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-60 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 60%;
     max-height: 100%;
     box-sizing: border-box
 }
 
-.layout-column>.flex-60 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 60%;
-    box-sizing: border-box
-}
-
 .layout-row>.flex-60 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 60%;
     max-height: 100%;
@@ -24910,8 +23965,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-60 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 60%;
@@ -24919,8 +23972,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-65 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 65%;
     max-height: 100%;
@@ -24928,8 +23979,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-65 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 65%;
     max-height: 100%;
@@ -24937,26 +23986,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-65 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 65%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-65 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 65%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-65 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 65%;
@@ -24964,8 +23993,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-70 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 70%;
     max-height: 100%;
@@ -24973,26 +24000,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-70 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 70%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-70 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 70%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-70 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 70%;
     max-height: 100%;
@@ -25000,8 +24007,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-70 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 70%;
@@ -25009,8 +24014,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-75 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 75%;
     max-height: 100%;
@@ -25018,26 +24021,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-75 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 75%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-75 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 75%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-75 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 75%;
     max-height: 100%;
@@ -25045,8 +24028,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-75 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 75%;
@@ -25054,35 +24035,13 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-80 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 80%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-80 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 80%;
     max-height: 100%;
     box-sizing: border-box
 }
 
-.layout-column>.flex-80 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 80%;
-    box-sizing: border-box
-}
-
 .layout-row>.flex-80 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 80%;
     max-height: 100%;
@@ -25090,8 +24049,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-80 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 80%;
@@ -25099,8 +24056,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-85 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 85%;
     max-height: 100%;
@@ -25108,8 +24063,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-85 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 85%;
     max-height: 100%;
@@ -25117,26 +24070,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-85 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 85%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-85 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 85%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-85 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 85%;
@@ -25144,8 +24077,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-90 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 90%;
     max-height: 100%;
@@ -25153,26 +24084,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-90 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 90%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-90 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 90%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-90 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 90%;
     max-height: 100%;
@@ -25180,8 +24091,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-90 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 90%;
@@ -25189,8 +24098,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-95 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 95%;
     max-height: 100%;
@@ -25198,8 +24105,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-95 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 95%;
     max-height: 100%;
@@ -25207,26 +24112,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-95 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 95%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-95 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 95%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-95 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 95%;
@@ -25234,26 +24119,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-100 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-row>.flex-100 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
-    flex: 1 1 100%;
-    max-width: 100%;
-    max-height: 100%;
-    box-sizing: border-box
-}
-
-.layout-column>.flex-100 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 100%;
@@ -25261,8 +24126,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-100 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 100%;
@@ -25270,8 +24133,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-100 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 100%;
@@ -25279,8 +24140,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-33 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 33.33%;
     max-height: 100%;
@@ -25288,8 +24147,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .flex-66 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 66.66%;
     max-height: 100%;
@@ -25297,8 +24154,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-33 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 33.33%;
     flex: 1 1 33.33%;
     max-width: 33.33%;
     max-height: 100%;
@@ -25306,8 +24161,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-66 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 66.66%;
     flex: 1 1 66.66%;
     max-width: 66.66%;
     max-height: 100%;
@@ -25315,8 +24168,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-33 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 33.33%;
     flex: 1 1 33.33%;
     max-width: 100%;
     max-height: 33.33%;
@@ -25324,8 +24175,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-66 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 66.66%;
     flex: 1 1 66.66%;
     max-width: 100%;
     max-height: 66.66%;
@@ -25333,8 +24182,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-33 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 33.33%;
     max-height: 100%;
@@ -25342,8 +24189,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-row>.flex-66 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 66.66%;
     max-height: 100%;
@@ -25355,8 +24200,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-33 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 33.33%;
@@ -25364,8 +24207,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-column>.flex-66 {
-    -webkit-box-flex: 1;
-    -webkit-flex: 1 1 100%;
     flex: 1 1 100%;
     max-width: 100%;
     max-height: 66.66%;
@@ -25380,22 +24221,14 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 .layout-column,
 .layout-row {
     box-sizing: border-box;
-    display: -webkit-box;
-    display: -webkit-flex;
     display: flex
 }
 
 .layout-column {
-    -webkit-box-orient: vertical;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: column;
     flex-direction: column
 }
 
 .layout-row {
-    -webkit-box-orient: horizontal;
-    -webkit-box-direction: normal;
-    -webkit-flex-direction: row;
     flex-direction: row
 }
 
@@ -25452,12 +24285,10 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 }
 
 .layout-wrap {
-    -webkit-flex-wrap: wrap;
     flex-wrap: wrap
 }
 
 .layout-nowrap {
-    -webkit-flex-wrap: nowrap;
     flex-wrap: nowrap
 }
 
@@ -25476,248 +24307,166 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-order-xs--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-xs--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-xs--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-xs--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-xs--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-xs--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-xs--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-xs--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-xs--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-xs--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-xs--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-xs--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-xs--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-xs--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-xs--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-xs--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-xs--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-xs--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-xs--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-xs--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-xs-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-xs-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-xs-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-xs-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-xs-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-xs-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-xs-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-xs-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-xs-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-xs-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-xs-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-xs-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-xs-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-xs-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-xs-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-xs-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-xs-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-xs-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-xs-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-xs-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-xs-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -26045,13 +24794,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-xs,
     .layout-align-xs-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -26060,8 +24804,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-start-end,
     .layout-align-xs-start-start,
     .layout-align-xs-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -26070,8 +24812,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-center-end,
     .layout-align-xs-center-start,
     .layout-align-xs-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -26080,8 +24820,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-end-end,
     .layout-align-xs-end-start,
     .layout-align-xs-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -26090,7 +24828,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-space-around-end,
     .layout-align-xs-space-around-start,
     .layout-align-xs-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -26099,8 +24836,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-space-between-end,
     .layout-align-xs-space-between-start,
     .layout-align-xs-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -26109,10 +24844,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-space-around-start,
     .layout-align-xs-space-between-start,
     .layout-align-xs-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -26121,10 +24853,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-space-around-center,
     .layout-align-xs-space-between-center,
     .layout-align-xs-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -26143,10 +24872,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-space-around-end,
     .layout-align-xs-space-between-end,
     .layout-align-xs-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -26155,65 +24881,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xs-space-around-stretch,
     .layout-align-xs-space-between-stretch,
     .layout-align-xs-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-xs {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-xs-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-xs-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-xs-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-xs-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-xs-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-xs-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -26221,8 +24928,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -26231,8 +24936,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -26240,8 +24943,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -26250,8 +24951,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -26260,8 +24959,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -26269,8 +24966,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -26278,8 +24973,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -26287,8 +24980,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -26296,8 +24987,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -26305,8 +24994,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -26314,8 +25001,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -26323,8 +25008,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -26332,8 +25015,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -26341,8 +25022,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -26350,8 +25029,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -26359,8 +25036,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -26368,8 +25043,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -26377,8 +25050,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -26386,8 +25057,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -26395,8 +25064,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -26404,8 +25071,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -26413,8 +25078,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -26422,8 +25085,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -26431,8 +25092,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -26440,8 +25099,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -26449,8 +25106,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -26458,8 +25113,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -26467,8 +25120,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -26476,8 +25127,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -26485,8 +25134,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -26494,8 +25141,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -26503,8 +25148,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -26512,8 +25155,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -26521,8 +25162,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -26530,8 +25169,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -26539,8 +25176,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -26548,8 +25183,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -26557,8 +25190,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -26566,8 +25197,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -26575,8 +25204,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -26584,8 +25211,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -26593,8 +25218,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -26602,8 +25225,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -26611,8 +25232,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -26620,8 +25239,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -26629,8 +25246,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -26638,8 +25253,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -26647,8 +25260,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -26656,8 +25267,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -26665,8 +25274,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -26674,8 +25281,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -26683,8 +25288,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -26692,8 +25295,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -26701,8 +25302,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -26710,8 +25309,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -26719,8 +25316,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -26728,8 +25323,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -26737,8 +25330,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -26746,8 +25337,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -26755,8 +25344,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -26764,8 +25351,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -26773,8 +25358,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -26782,8 +25365,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -26791,8 +25372,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -26800,8 +25379,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -26809,8 +25386,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -26818,8 +25393,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -26827,8 +25400,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -26836,8 +25407,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -26845,8 +25414,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -26854,8 +25421,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -26863,8 +25428,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -26872,8 +25435,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -26881,8 +25442,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -26890,8 +25449,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -26899,8 +25456,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -26908,8 +25463,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -26917,8 +25470,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -26926,8 +25477,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -26935,8 +25484,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -26944,8 +25491,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -26953,8 +25498,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -26962,8 +25505,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -26971,8 +25512,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -26980,8 +25519,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -26989,8 +25526,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -26998,8 +25533,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -27007,8 +25540,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -27016,8 +25547,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -27025,8 +25554,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -27034,8 +25561,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -27043,8 +25568,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -27052,8 +25575,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -27061,8 +25582,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -27070,8 +25589,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -27079,8 +25596,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -27088,8 +25603,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -27097,8 +25610,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -27106,8 +25617,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -27115,8 +25624,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -27124,8 +25631,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -27133,8 +25638,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -27142,8 +25645,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -27151,8 +25652,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -27160,8 +25659,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -27169,8 +25666,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -27178,8 +25673,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -27187,8 +25680,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -27196,8 +25687,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -27205,8 +25694,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-row>.flex-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -27218,8 +25705,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -27227,8 +25712,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xs-column>.flex-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -27243,270 +25726,180 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-xs-column,
     .layout-xs-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-xs-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-xs-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 }
 
 @media (min-width:600px) {
     .flex-order-gt-xs--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-gt-xs--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-gt-xs--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-gt-xs--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-gt-xs--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-gt-xs--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-gt-xs--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-gt-xs--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-gt-xs--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-gt-xs--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-gt-xs--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-gt-xs--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-gt-xs--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-gt-xs--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-gt-xs--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-gt-xs--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-gt-xs--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-gt-xs--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-gt-xs--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-gt-xs--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-gt-xs-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-gt-xs-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-gt-xs-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-gt-xs-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-gt-xs-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-gt-xs-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-gt-xs-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-gt-xs-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-gt-xs-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-gt-xs-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-gt-xs-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-gt-xs-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-gt-xs-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-gt-xs-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-gt-xs-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-gt-xs-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-gt-xs-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-gt-xs-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-gt-xs-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-gt-xs-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-gt-xs-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -27834,13 +26227,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-gt-xs,
     .layout-align-gt-xs-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -27849,8 +26237,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-start-end,
     .layout-align-gt-xs-start-start,
     .layout-align-gt-xs-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -27859,8 +26245,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-center-end,
     .layout-align-gt-xs-center-start,
     .layout-align-gt-xs-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -27869,8 +26253,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-end-end,
     .layout-align-gt-xs-end-start,
     .layout-align-gt-xs-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -27879,7 +26261,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-space-around-end,
     .layout-align-gt-xs-space-around-start,
     .layout-align-gt-xs-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -27888,8 +26269,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-space-between-end,
     .layout-align-gt-xs-space-between-start,
     .layout-align-gt-xs-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -27898,10 +26277,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-space-around-start,
     .layout-align-gt-xs-space-between-start,
     .layout-align-gt-xs-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -27910,10 +26286,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-space-around-center,
     .layout-align-gt-xs-space-between-center,
     .layout-align-gt-xs-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -27932,10 +26305,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-space-around-end,
     .layout-align-gt-xs-space-between-end,
     .layout-align-gt-xs-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -27944,65 +26314,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-xs-space-around-stretch,
     .layout-align-gt-xs-space-between-stretch,
     .layout-align-gt-xs-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-gt-xs {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-gt-xs-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-gt-xs-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-xs-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-xs-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-xs-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-xs-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -28010,8 +26361,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -28020,8 +26369,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -28029,8 +26376,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -28039,8 +26384,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -28049,8 +26392,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -28058,8 +26399,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -28067,8 +26406,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -28076,8 +26413,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -28085,8 +26420,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -28094,8 +26427,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -28103,8 +26434,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -28112,8 +26441,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -28121,8 +26448,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -28130,8 +26455,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -28139,8 +26462,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -28148,8 +26469,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -28157,8 +26476,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -28166,8 +26483,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -28175,8 +26490,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -28184,8 +26497,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -28193,8 +26504,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -28202,8 +26511,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -28211,8 +26518,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -28220,8 +26525,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -28229,8 +26532,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -28238,8 +26539,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -28247,8 +26546,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -28256,8 +26553,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -28265,8 +26560,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -28274,8 +26567,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -28283,8 +26574,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -28292,8 +26581,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -28301,8 +26588,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -28310,8 +26595,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -28319,8 +26602,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -28328,8 +26609,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -28337,8 +26616,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -28346,8 +26623,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -28355,8 +26630,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -28364,8 +26637,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -28373,8 +26644,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -28382,8 +26651,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -28391,8 +26658,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -28400,8 +26665,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -28409,8 +26672,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -28418,8 +26679,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -28427,8 +26686,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -28436,8 +26693,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -28445,8 +26700,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -28454,8 +26707,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -28463,8 +26714,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -28472,8 +26721,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -28481,8 +26728,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -28490,8 +26735,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -28499,8 +26742,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -28508,8 +26749,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -28517,8 +26756,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -28526,8 +26763,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -28535,8 +26770,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -28544,8 +26777,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -28553,8 +26784,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -28562,8 +26791,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -28571,8 +26798,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -28580,8 +26805,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -28589,8 +26812,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -28598,8 +26819,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -28607,8 +26826,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -28616,8 +26833,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -28625,8 +26840,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -28634,8 +26847,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -28643,8 +26854,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -28652,8 +26861,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -28661,8 +26868,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -28670,8 +26875,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -28679,8 +26882,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -28688,8 +26889,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -28697,8 +26896,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -28706,8 +26903,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -28715,8 +26910,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -28724,8 +26917,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -28733,8 +26924,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -28742,8 +26931,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -28751,8 +26938,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -28760,8 +26945,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -28769,8 +26952,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -28778,8 +26959,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -28787,8 +26966,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -28796,8 +26973,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -28805,8 +26980,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -28814,8 +26987,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -28823,8 +26994,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -28832,8 +27001,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -28841,8 +27008,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -28850,8 +27015,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -28859,8 +27022,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -28868,8 +27029,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -28877,8 +27036,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -28886,8 +27043,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -28895,8 +27050,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -28904,8 +27057,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -28913,8 +27064,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -28922,8 +27071,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -28931,8 +27078,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -28940,8 +27085,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -28949,8 +27092,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -28958,8 +27099,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -28967,8 +27106,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -28976,8 +27113,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -28985,8 +27120,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -28994,8 +27127,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-row>.flex-gt-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -29007,8 +27138,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -29016,8 +27145,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-xs-column>.flex-gt-xs-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -29032,22 +27159,14 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-gt-xs-column,
     .layout-gt-xs-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-gt-xs-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-gt-xs-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 }
@@ -29064,248 +27183,166 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-order-sm--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-sm--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-sm--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-sm--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-sm--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-sm--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-sm--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-sm--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-sm--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-sm--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-sm--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-sm--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-sm--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-sm--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-sm--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-sm--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-sm--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-sm--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-sm--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-sm--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-sm-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-sm-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-sm-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-sm-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-sm-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-sm-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-sm-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-sm-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-sm-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-sm-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-sm-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-sm-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-sm-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-sm-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-sm-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-sm-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-sm-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-sm-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-sm-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-sm-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-sm-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -29633,13 +27670,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-sm,
     .layout-align-sm-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -29648,8 +27680,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-start-end,
     .layout-align-sm-start-start,
     .layout-align-sm-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -29658,8 +27688,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-center-end,
     .layout-align-sm-center-start,
     .layout-align-sm-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -29668,8 +27696,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-end-end,
     .layout-align-sm-end-start,
     .layout-align-sm-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -29678,7 +27704,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-space-around-end,
     .layout-align-sm-space-around-start,
     .layout-align-sm-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -29687,8 +27712,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-space-between-end,
     .layout-align-sm-space-between-start,
     .layout-align-sm-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -29697,10 +27720,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-space-around-start,
     .layout-align-sm-space-between-start,
     .layout-align-sm-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -29709,10 +27729,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-space-around-center,
     .layout-align-sm-space-between-center,
     .layout-align-sm-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -29731,10 +27748,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-space-around-end,
     .layout-align-sm-space-between-end,
     .layout-align-sm-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -29743,65 +27757,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-sm-space-around-stretch,
     .layout-align-sm-space-between-stretch,
     .layout-align-sm-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-sm {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-sm-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-sm-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-sm-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-sm-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-sm-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-sm-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -29809,8 +27804,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -29819,8 +27812,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -29828,8 +27819,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -29838,8 +27827,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -29848,8 +27835,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -29857,8 +27842,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -29866,8 +27849,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -29875,8 +27856,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -29884,8 +27863,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -29893,8 +27870,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -29902,8 +27877,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -29911,8 +27884,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -29920,8 +27891,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -29929,8 +27898,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -29938,8 +27905,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -29947,8 +27912,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -29956,8 +27919,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -29965,8 +27926,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -29974,8 +27933,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -29983,8 +27940,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -29992,8 +27947,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -30001,8 +27954,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -30010,8 +27961,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -30019,8 +27968,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -30028,8 +27975,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -30037,8 +27982,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -30046,8 +27989,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -30055,8 +27996,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -30064,8 +28003,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -30073,8 +28010,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -30082,8 +28017,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -30091,8 +28024,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -30100,8 +28031,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -30109,8 +28038,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -30118,8 +28045,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -30127,8 +28052,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -30136,8 +28059,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -30145,8 +28066,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -30154,8 +28073,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -30163,8 +28080,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -30172,8 +28087,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -30181,8 +28094,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -30190,8 +28101,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -30199,8 +28108,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -30208,8 +28115,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -30217,8 +28122,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -30226,8 +28129,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -30235,8 +28136,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -30244,8 +28143,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -30253,8 +28150,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -30262,8 +28157,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -30271,8 +28164,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -30280,8 +28171,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -30289,8 +28178,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -30298,8 +28185,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -30307,8 +28192,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -30316,8 +28199,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -30325,8 +28206,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -30334,8 +28213,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -30343,8 +28220,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -30352,8 +28227,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -30361,8 +28234,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -30370,8 +28241,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -30379,8 +28248,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -30388,8 +28255,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -30397,8 +28262,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -30406,8 +28269,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -30415,8 +28276,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -30424,8 +28283,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -30433,8 +28290,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -30442,8 +28297,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -30451,8 +28304,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -30460,8 +28311,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -30469,8 +28318,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -30478,8 +28325,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -30487,8 +28332,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -30496,8 +28339,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -30505,8 +28346,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -30514,8 +28353,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -30523,8 +28360,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -30532,8 +28367,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -30541,8 +28374,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -30550,8 +28381,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -30559,8 +28388,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -30568,8 +28395,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -30577,8 +28402,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -30586,8 +28409,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -30595,8 +28416,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -30604,8 +28423,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -30613,8 +28430,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -30622,8 +28437,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -30631,8 +28444,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -30640,8 +28451,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -30649,8 +28458,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -30658,8 +28465,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -30667,8 +28472,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -30676,8 +28479,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -30685,8 +28486,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -30694,8 +28493,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -30703,8 +28500,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -30712,8 +28507,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -30721,8 +28514,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -30730,8 +28521,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -30739,8 +28528,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -30748,8 +28535,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -30757,8 +28542,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -30766,8 +28549,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -30775,8 +28556,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -30784,8 +28563,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -30793,8 +28570,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-row>.flex-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -30806,8 +28581,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -30815,8 +28588,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-sm-column>.flex-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -30831,270 +28602,180 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-sm-column,
     .layout-sm-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-sm-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-sm-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 }
 
 @media (min-width:960px) {
     .flex-order-gt-sm--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-gt-sm--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-gt-sm--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-gt-sm--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-gt-sm--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-gt-sm--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-gt-sm--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-gt-sm--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-gt-sm--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-gt-sm--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-gt-sm--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-gt-sm--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-gt-sm--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-gt-sm--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-gt-sm--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-gt-sm--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-gt-sm--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-gt-sm--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-gt-sm--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-gt-sm--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-gt-sm-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-gt-sm-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-gt-sm-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-gt-sm-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-gt-sm-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-gt-sm-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-gt-sm-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-gt-sm-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-gt-sm-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-gt-sm-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-gt-sm-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-gt-sm-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-gt-sm-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-gt-sm-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-gt-sm-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-gt-sm-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-gt-sm-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-gt-sm-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-gt-sm-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-gt-sm-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-gt-sm-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -31422,13 +29103,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-gt-sm,
     .layout-align-gt-sm-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -31437,8 +29113,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-start-end,
     .layout-align-gt-sm-start-start,
     .layout-align-gt-sm-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -31447,8 +29121,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-center-end,
     .layout-align-gt-sm-center-start,
     .layout-align-gt-sm-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -31457,8 +29129,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-end-end,
     .layout-align-gt-sm-end-start,
     .layout-align-gt-sm-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -31467,7 +29137,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-space-around-end,
     .layout-align-gt-sm-space-around-start,
     .layout-align-gt-sm-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -31476,8 +29145,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-space-between-end,
     .layout-align-gt-sm-space-between-start,
     .layout-align-gt-sm-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -31486,10 +29153,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-space-around-start,
     .layout-align-gt-sm-space-between-start,
     .layout-align-gt-sm-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -31498,10 +29162,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-space-around-center,
     .layout-align-gt-sm-space-between-center,
     .layout-align-gt-sm-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -31520,10 +29181,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-space-around-end,
     .layout-align-gt-sm-space-between-end,
     .layout-align-gt-sm-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -31532,65 +29190,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-sm-space-around-stretch,
     .layout-align-gt-sm-space-between-stretch,
     .layout-align-gt-sm-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-gt-sm {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-gt-sm-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-gt-sm-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-sm-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-sm-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-sm-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-sm-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -31598,8 +29237,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -31608,8 +29245,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -31617,8 +29252,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -31627,8 +29260,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -31637,8 +29268,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -31646,8 +29275,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -31655,8 +29282,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -31664,8 +29289,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -31673,8 +29296,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -31682,8 +29303,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -31691,8 +29310,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -31700,8 +29317,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -31709,8 +29324,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -31718,8 +29331,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -31727,8 +29338,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -31736,8 +29345,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -31745,8 +29352,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -31754,8 +29359,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -31763,8 +29366,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -31772,8 +29373,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -31781,8 +29380,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -31790,8 +29387,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -31799,8 +29394,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -31808,8 +29401,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -31817,8 +29408,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -31826,8 +29415,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -31835,8 +29422,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -31844,8 +29429,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -31853,8 +29436,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -31862,8 +29443,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -31871,8 +29450,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -31880,8 +29457,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -31889,8 +29464,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -31898,8 +29471,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -31907,8 +29478,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -31916,8 +29485,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -31925,8 +29492,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -31934,8 +29499,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -31943,8 +29506,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -31952,8 +29513,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -31961,8 +29520,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -31970,8 +29527,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -31979,8 +29534,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -31988,8 +29541,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -31997,8 +29548,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -32006,8 +29555,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -32015,8 +29562,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -32024,8 +29569,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -32033,8 +29576,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -32042,8 +29583,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -32051,8 +29590,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -32060,8 +29597,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -32069,8 +29604,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -32078,8 +29611,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -32087,8 +29618,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -32096,8 +29625,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -32105,8 +29632,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -32114,8 +29639,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -32123,8 +29646,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -32132,8 +29653,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -32141,8 +29660,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -32150,8 +29667,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -32159,8 +29674,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -32168,8 +29681,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -32177,8 +29688,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -32186,8 +29695,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -32195,8 +29702,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -32204,8 +29709,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -32213,8 +29716,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -32222,8 +29723,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -32231,8 +29730,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -32240,8 +29737,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -32249,8 +29744,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -32258,8 +29751,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -32267,8 +29758,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -32276,8 +29765,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -32285,8 +29772,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -32294,8 +29779,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -32303,8 +29786,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -32312,8 +29793,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -32321,8 +29800,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -32330,8 +29807,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -32339,8 +29814,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -32348,8 +29821,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -32357,8 +29828,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -32366,8 +29835,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -32375,8 +29842,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -32384,8 +29849,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -32393,8 +29856,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -32402,8 +29863,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -32411,8 +29870,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -32420,8 +29877,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -32429,8 +29884,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -32438,8 +29891,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -32447,8 +29898,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -32456,8 +29905,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -32465,8 +29912,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -32474,8 +29919,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -32483,8 +29926,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -32492,8 +29933,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -32501,8 +29940,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -32510,8 +29947,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -32519,8 +29954,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -32528,8 +29961,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -32537,8 +29968,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -32546,8 +29975,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -32555,8 +29982,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -32564,8 +29989,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -32573,8 +29996,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -32582,8 +30003,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-row>.flex-gt-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -32595,8 +30014,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -32604,8 +30021,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-sm-column>.flex-gt-sm-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -32620,22 +30035,14 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-gt-sm-column,
     .layout-gt-sm-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-gt-sm-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-gt-sm-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 }
@@ -32653,248 +30060,166 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-order-md--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-md--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-md--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-md--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-md--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-md--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-md--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-md--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-md--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-md--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-md--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-md--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-md--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-md--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-md--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-md--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-md--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-md--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-md--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-md--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-md-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-md-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-md-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-md-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-md-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-md-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-md-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-md-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-md-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-md-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-md-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-md-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-md-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-md-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-md-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-md-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-md-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-md-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-md-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-md-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-md-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -33222,13 +30547,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-md,
     .layout-align-md-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -33237,8 +30557,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-start-end,
     .layout-align-md-start-start,
     .layout-align-md-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -33247,8 +30565,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-center-end,
     .layout-align-md-center-start,
     .layout-align-md-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -33257,8 +30573,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-end-end,
     .layout-align-md-end-start,
     .layout-align-md-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -33267,7 +30581,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-space-around-end,
     .layout-align-md-space-around-start,
     .layout-align-md-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -33276,8 +30589,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-space-between-end,
     .layout-align-md-space-between-start,
     .layout-align-md-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -33286,10 +30597,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-space-around-start,
     .layout-align-md-space-between-start,
     .layout-align-md-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -33298,10 +30606,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-space-around-center,
     .layout-align-md-space-between-center,
     .layout-align-md-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -33320,10 +30625,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-space-around-end,
     .layout-align-md-space-between-end,
     .layout-align-md-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -33332,65 +30634,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-md-space-around-stretch,
     .layout-align-md-space-between-stretch,
     .layout-align-md-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-md {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-md-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-md-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-md-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-md-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-md-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-md-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -33398,8 +30681,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -33408,8 +30689,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -33417,8 +30696,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -33427,8 +30704,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -33437,8 +30712,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -33446,8 +30719,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -33455,8 +30726,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -33464,8 +30733,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -33473,8 +30740,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -33482,8 +30747,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -33491,8 +30754,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -33500,8 +30761,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -33509,8 +30768,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -33518,8 +30775,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -33527,8 +30782,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -33536,8 +30789,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -33545,8 +30796,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -33554,8 +30803,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -33563,8 +30810,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -33572,8 +30817,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -33581,8 +30824,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -33590,8 +30831,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -33599,8 +30838,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -33608,8 +30845,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -33617,8 +30852,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -33626,8 +30859,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -33635,8 +30866,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -33644,8 +30873,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -33653,8 +30880,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -33662,8 +30887,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -33671,8 +30894,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -33680,8 +30901,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -33689,8 +30908,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -33698,8 +30915,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -33707,8 +30922,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -33716,8 +30929,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -33725,8 +30936,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -33734,8 +30943,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -33743,8 +30950,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -33752,8 +30957,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -33761,8 +30964,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -33770,8 +30971,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -33779,8 +30978,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -33788,8 +30985,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -33797,8 +30992,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -33806,8 +30999,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -33815,8 +31006,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -33824,8 +31013,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -33833,8 +31020,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -33842,8 +31027,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -33851,8 +31034,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -33860,8 +31041,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -33869,8 +31048,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -33878,8 +31055,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -33887,8 +31062,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -33896,8 +31069,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -33905,8 +31076,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -33914,8 +31083,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -33923,8 +31090,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -33932,8 +31097,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -33941,8 +31104,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -33950,8 +31111,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -33959,8 +31118,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -33968,8 +31125,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -33977,8 +31132,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -33986,8 +31139,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -33995,8 +31146,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -34004,8 +31153,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -34013,8 +31160,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -34022,8 +31167,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -34031,8 +31174,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -34040,8 +31181,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -34049,8 +31188,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -34058,8 +31195,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -34067,8 +31202,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -34076,8 +31209,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -34085,8 +31216,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -34094,8 +31223,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -34103,8 +31230,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -34112,8 +31237,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -34121,8 +31244,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -34130,8 +31251,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -34139,8 +31258,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -34148,8 +31265,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -34157,8 +31272,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -34166,8 +31279,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -34175,8 +31286,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -34184,8 +31293,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -34193,8 +31300,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -34202,8 +31307,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -34211,8 +31314,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -34220,8 +31321,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -34229,8 +31328,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -34238,8 +31335,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -34247,8 +31342,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -34256,8 +31349,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -34265,8 +31356,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -34274,8 +31363,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -34283,8 +31370,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -34292,8 +31377,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -34301,8 +31384,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -34310,8 +31391,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -34319,8 +31398,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -34328,8 +31405,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -34337,8 +31412,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -34346,8 +31419,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -34355,8 +31426,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -34364,8 +31433,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -34373,8 +31440,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -34382,8 +31447,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-row>.flex-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -34395,8 +31458,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -34404,8 +31465,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-md-column>.flex-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -34420,270 +31479,180 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-md-column,
     .layout-md-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-md-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-md-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 }
 
 @media (min-width:1280px) {
     .flex-order-gt-md--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-gt-md--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-gt-md--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-gt-md--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-gt-md--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-gt-md--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-gt-md--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-gt-md--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-gt-md--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-gt-md--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-gt-md--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-gt-md--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-gt-md--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-gt-md--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-gt-md--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-gt-md--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-gt-md--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-gt-md--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-gt-md--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-gt-md--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-gt-md-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-gt-md-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-gt-md-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-gt-md-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-gt-md-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-gt-md-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-gt-md-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-gt-md-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-gt-md-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-gt-md-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-gt-md-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-gt-md-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-gt-md-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-gt-md-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-gt-md-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-gt-md-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-gt-md-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-gt-md-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-gt-md-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-gt-md-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-gt-md-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -35011,13 +31980,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-gt-md,
     .layout-align-gt-md-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -35026,8 +31990,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-start-end,
     .layout-align-gt-md-start-start,
     .layout-align-gt-md-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -35036,8 +31998,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-center-end,
     .layout-align-gt-md-center-start,
     .layout-align-gt-md-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -35046,8 +32006,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-end-end,
     .layout-align-gt-md-end-start,
     .layout-align-gt-md-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -35056,7 +32014,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-space-around-end,
     .layout-align-gt-md-space-around-start,
     .layout-align-gt-md-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -35065,8 +32022,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-space-between-end,
     .layout-align-gt-md-space-between-start,
     .layout-align-gt-md-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -35075,10 +32030,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-space-around-start,
     .layout-align-gt-md-space-between-start,
     .layout-align-gt-md-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -35087,10 +32039,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-space-around-center,
     .layout-align-gt-md-space-between-center,
     .layout-align-gt-md-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -35109,10 +32058,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-space-around-end,
     .layout-align-gt-md-space-between-end,
     .layout-align-gt-md-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -35121,65 +32067,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-md-space-around-stretch,
     .layout-align-gt-md-space-between-stretch,
     .layout-align-gt-md-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-gt-md {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-gt-md-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-gt-md-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-md-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-md-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-md-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-md-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -35187,8 +32114,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -35197,8 +32122,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -35206,8 +32129,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -35216,8 +32137,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -35226,8 +32145,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -35235,8 +32152,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -35244,8 +32159,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -35253,8 +32166,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -35262,8 +32173,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -35271,8 +32180,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -35280,8 +32187,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -35289,8 +32194,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -35298,8 +32201,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -35307,8 +32208,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -35316,8 +32215,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -35325,8 +32222,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -35334,8 +32229,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -35343,8 +32236,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -35352,8 +32243,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -35361,8 +32250,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -35370,8 +32257,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -35379,8 +32264,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -35388,8 +32271,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -35397,8 +32278,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -35406,8 +32285,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -35415,8 +32292,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -35424,8 +32299,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -35433,8 +32306,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -35442,8 +32313,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -35451,8 +32320,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -35460,8 +32327,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -35469,8 +32334,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -35478,8 +32341,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -35487,8 +32348,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -35496,8 +32355,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -35505,8 +32362,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -35514,8 +32369,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -35523,8 +32376,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -35532,8 +32383,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -35541,8 +32390,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -35550,8 +32397,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -35559,8 +32404,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -35568,8 +32411,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -35577,8 +32418,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -35586,8 +32425,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -35595,8 +32432,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -35604,8 +32439,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -35613,8 +32446,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -35622,8 +32453,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -35631,8 +32460,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -35640,8 +32467,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -35649,8 +32474,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -35658,8 +32481,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -35667,8 +32488,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -35676,8 +32495,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -35685,8 +32502,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -35694,8 +32509,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -35703,8 +32516,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -35712,8 +32523,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -35721,8 +32530,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -35730,8 +32537,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -35739,8 +32544,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -35748,8 +32551,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -35757,8 +32558,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -35766,8 +32565,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -35775,8 +32572,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -35784,8 +32579,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -35793,8 +32586,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -35802,8 +32593,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -35811,8 +32600,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -35820,8 +32607,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -35829,8 +32614,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -35838,8 +32621,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -35847,8 +32628,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -35856,8 +32635,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -35865,8 +32642,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -35874,8 +32649,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -35883,8 +32656,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -35892,8 +32663,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -35901,8 +32670,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -35910,8 +32677,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -35919,8 +32684,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -35928,8 +32691,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -35937,8 +32698,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -35946,8 +32705,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -35955,8 +32712,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -35964,8 +32719,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -35973,8 +32726,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -35982,8 +32733,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -35991,8 +32740,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -36000,8 +32747,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -36009,8 +32754,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -36018,8 +32761,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -36027,8 +32768,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -36036,8 +32775,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -36045,8 +32782,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -36054,8 +32789,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -36063,8 +32796,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -36072,8 +32803,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -36081,8 +32810,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -36090,8 +32817,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -36099,8 +32824,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -36108,8 +32831,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -36117,8 +32838,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -36126,8 +32845,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -36135,8 +32852,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -36144,8 +32859,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -36153,8 +32866,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -36162,8 +32873,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -36171,8 +32880,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-row>.flex-gt-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -36184,8 +32891,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -36193,8 +32898,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-md-column>.flex-gt-md-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -36209,22 +32912,14 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-gt-md-column,
     .layout-gt-md-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-gt-md-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-gt-md-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 }
@@ -36243,248 +32938,166 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-order-lg--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-lg--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-lg--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-lg--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-lg--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-lg--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-lg--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-lg--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-lg--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-lg--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-lg--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-lg--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-lg--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-lg--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-lg--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-lg--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-lg--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-lg--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-lg--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-lg--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-lg-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-lg-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-lg-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-lg-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-lg-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-lg-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-lg-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-lg-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-lg-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-lg-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-lg-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-lg-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-lg-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-lg-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-lg-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-lg-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-lg-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-lg-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-lg-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-lg-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-lg-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -36812,13 +33425,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-lg,
     .layout-align-lg-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -36827,8 +33435,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-start-end,
     .layout-align-lg-start-start,
     .layout-align-lg-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -36837,8 +33443,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-center-end,
     .layout-align-lg-center-start,
     .layout-align-lg-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -36847,8 +33451,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-end-end,
     .layout-align-lg-end-start,
     .layout-align-lg-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -36857,7 +33459,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-space-around-end,
     .layout-align-lg-space-around-start,
     .layout-align-lg-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -36866,8 +33467,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-space-between-end,
     .layout-align-lg-space-between-start,
     .layout-align-lg-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -36876,10 +33475,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-space-around-start,
     .layout-align-lg-space-between-start,
     .layout-align-lg-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -36888,10 +33484,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-space-around-center,
     .layout-align-lg-space-between-center,
     .layout-align-lg-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -36910,10 +33503,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-space-around-end,
     .layout-align-lg-space-between-end,
     .layout-align-lg-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -36922,65 +33512,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-lg-space-around-stretch,
     .layout-align-lg-space-between-stretch,
     .layout-align-lg-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-lg {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-lg-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-lg-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-lg-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-lg-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-lg-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-lg-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -36988,8 +33559,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -36998,8 +33567,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -37007,8 +33574,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -37017,8 +33582,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -37027,8 +33590,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -37036,8 +33597,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -37045,8 +33604,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -37054,8 +33611,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -37063,8 +33618,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -37072,8 +33625,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -37081,8 +33632,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -37090,8 +33639,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -37099,8 +33646,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -37108,8 +33653,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -37117,8 +33660,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -37126,8 +33667,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -37135,8 +33674,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -37144,8 +33681,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -37153,8 +33688,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -37162,8 +33695,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -37171,8 +33702,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -37180,8 +33709,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -37189,8 +33716,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -37198,8 +33723,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -37207,8 +33730,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -37216,8 +33737,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -37225,8 +33744,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -37234,8 +33751,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -37243,8 +33758,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -37252,8 +33765,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -37261,8 +33772,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -37270,8 +33779,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -37279,8 +33786,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -37288,8 +33793,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -37297,8 +33800,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -37306,8 +33807,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -37315,8 +33814,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -37324,8 +33821,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -37333,8 +33828,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -37342,8 +33835,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -37351,8 +33842,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -37360,8 +33849,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -37369,8 +33856,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -37378,8 +33863,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -37387,8 +33870,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -37396,8 +33877,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -37405,8 +33884,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -37414,8 +33891,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -37423,8 +33898,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -37432,8 +33905,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -37441,8 +33912,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -37450,8 +33919,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -37459,8 +33926,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -37468,8 +33933,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -37477,8 +33940,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -37486,8 +33947,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -37495,8 +33954,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -37504,8 +33961,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -37513,8 +33968,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -37522,8 +33975,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -37531,8 +33982,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -37540,8 +33989,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -37549,8 +33996,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -37558,8 +34003,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -37567,8 +34010,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -37576,8 +34017,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -37585,8 +34024,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -37594,8 +34031,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -37603,8 +34038,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -37612,8 +34045,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -37621,8 +34052,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -37630,8 +34059,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -37639,8 +34066,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -37648,8 +34073,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -37657,8 +34080,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -37666,8 +34087,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -37675,8 +34094,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -37684,8 +34101,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -37693,8 +34108,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -37702,8 +34115,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -37711,8 +34122,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -37720,8 +34129,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -37729,8 +34136,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -37738,8 +34143,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -37747,8 +34150,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -37756,8 +34157,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -37765,8 +34164,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -37774,8 +34171,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -37783,8 +34178,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -37792,8 +34185,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -37801,8 +34192,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -37810,8 +34199,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -37819,8 +34206,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -37828,8 +34213,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -37837,8 +34220,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -37846,8 +34227,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -37855,8 +34234,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -37864,8 +34241,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -37873,8 +34248,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -37882,8 +34255,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -37891,8 +34262,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -37900,8 +34269,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -37909,8 +34276,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -37918,8 +34283,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -37927,8 +34290,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -37936,8 +34297,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -37945,8 +34304,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -37954,8 +34311,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -37963,8 +34318,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -37972,8 +34325,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-row>.flex-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -37985,8 +34336,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -37994,8 +34343,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-lg-column>.flex-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -38010,270 +34357,180 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-lg-column,
     .layout-lg-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-lg-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-lg-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 }
 
 @media (min-width:1920px) {
     .flex-order-gt-lg--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-gt-lg--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-gt-lg--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-gt-lg--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-gt-lg--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-gt-lg--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-gt-lg--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-gt-lg--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-gt-lg--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-gt-lg--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-gt-lg--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-gt-lg--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-gt-lg--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-gt-lg--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-gt-lg--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-gt-lg--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-gt-lg--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-gt-lg--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-gt-lg--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-gt-lg--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-gt-lg-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-gt-lg-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-gt-lg-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-gt-lg-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-gt-lg-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-gt-lg-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-gt-lg-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-gt-lg-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-gt-lg-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-gt-lg-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-gt-lg-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-gt-lg-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-gt-lg-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-gt-lg-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-gt-lg-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-gt-lg-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-gt-lg-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-gt-lg-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-gt-lg-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-gt-lg-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-gt-lg-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -38601,13 +34858,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-gt-lg,
     .layout-align-gt-lg-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -38616,8 +34868,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-start-end,
     .layout-align-gt-lg-start-start,
     .layout-align-gt-lg-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -38626,8 +34876,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-center-end,
     .layout-align-gt-lg-center-start,
     .layout-align-gt-lg-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -38636,8 +34884,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-end-end,
     .layout-align-gt-lg-end-start,
     .layout-align-gt-lg-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -38646,7 +34892,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-space-around-end,
     .layout-align-gt-lg-space-around-start,
     .layout-align-gt-lg-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -38655,8 +34900,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-space-between-end,
     .layout-align-gt-lg-space-between-start,
     .layout-align-gt-lg-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -38665,10 +34908,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-space-around-start,
     .layout-align-gt-lg-space-between-start,
     .layout-align-gt-lg-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -38677,10 +34917,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-space-around-center,
     .layout-align-gt-lg-space-between-center,
     .layout-align-gt-lg-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -38699,10 +34936,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-space-around-end,
     .layout-align-gt-lg-space-between-end,
     .layout-align-gt-lg-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -38711,65 +34945,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-gt-lg-space-around-stretch,
     .layout-align-gt-lg-space-between-stretch,
     .layout-align-gt-lg-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-gt-lg {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-gt-lg-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-gt-lg-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-lg-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-lg-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-lg-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-gt-lg-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-gt-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -38777,8 +34992,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -38787,8 +35000,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -38796,8 +35007,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -38806,8 +35015,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -38816,8 +35023,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -38825,8 +35030,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -38834,8 +35037,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -38843,8 +35044,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -38852,8 +35051,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -38861,8 +35058,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -38870,8 +35065,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -38879,8 +35072,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -38888,8 +35079,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -38897,8 +35086,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -38906,8 +35093,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -38915,8 +35100,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -38924,8 +35107,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -38933,8 +35114,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -38942,8 +35121,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -38951,8 +35128,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -38960,8 +35135,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -38969,8 +35142,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -38978,8 +35149,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -38987,8 +35156,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -38996,8 +35163,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -39005,8 +35170,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -39014,8 +35177,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -39023,8 +35184,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -39032,8 +35191,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -39041,8 +35198,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -39050,8 +35205,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -39059,8 +35212,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -39068,8 +35219,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -39077,8 +35226,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -39086,8 +35233,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -39095,8 +35240,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -39104,8 +35247,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -39113,8 +35254,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -39122,8 +35261,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -39131,8 +35268,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -39140,8 +35275,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -39149,8 +35282,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -39158,8 +35289,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -39167,8 +35296,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -39176,8 +35303,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -39185,8 +35310,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -39194,8 +35317,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -39203,8 +35324,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -39212,8 +35331,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -39221,8 +35338,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -39230,8 +35345,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -39239,8 +35352,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -39248,8 +35359,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -39257,8 +35366,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -39266,8 +35373,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -39275,8 +35380,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -39284,8 +35387,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -39293,8 +35394,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -39302,8 +35401,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -39311,8 +35408,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -39320,8 +35415,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -39329,8 +35422,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -39338,8 +35429,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -39347,8 +35436,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -39356,8 +35443,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -39365,8 +35450,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -39374,8 +35457,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -39383,8 +35464,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -39392,8 +35471,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -39401,8 +35478,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -39410,8 +35485,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -39419,8 +35492,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -39428,8 +35499,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -39437,8 +35506,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -39446,8 +35513,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -39455,8 +35520,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -39464,8 +35527,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -39473,8 +35534,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -39482,8 +35541,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -39491,8 +35548,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -39500,8 +35555,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -39509,8 +35562,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -39518,8 +35569,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -39527,8 +35576,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -39536,8 +35583,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -39545,8 +35590,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -39554,8 +35597,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -39563,8 +35604,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -39572,8 +35611,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -39581,8 +35618,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -39590,8 +35625,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -39599,8 +35632,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -39608,8 +35639,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -39617,8 +35646,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -39626,8 +35653,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -39635,8 +35660,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -39644,8 +35667,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -39653,8 +35674,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -39662,8 +35681,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -39671,8 +35688,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-gt-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -39680,8 +35695,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -39689,8 +35702,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -39698,8 +35709,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -39707,8 +35716,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -39716,8 +35723,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -39725,8 +35730,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-gt-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -39734,8 +35737,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -39743,8 +35744,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-gt-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -39752,8 +35751,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -39761,8 +35758,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-row>.flex-gt-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -39774,8 +35769,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -39783,8 +35776,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-gt-lg-column>.flex-gt-lg-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -39799,268 +35790,178 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-gt-lg-column,
     .layout-gt-lg-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-gt-lg-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-gt-lg-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 
     .flex-order-xl--20 {
-        -webkit-box-ordinal-group: -19;
-        -webkit-order: -20;
         order: -20
     }
 
     .flex-order-xl--19 {
-        -webkit-box-ordinal-group: -18;
-        -webkit-order: -19;
         order: -19
     }
 
     .flex-order-xl--18 {
-        -webkit-box-ordinal-group: -17;
-        -webkit-order: -18;
         order: -18
     }
 
     .flex-order-xl--17 {
-        -webkit-box-ordinal-group: -16;
-        -webkit-order: -17;
         order: -17
     }
 
     .flex-order-xl--16 {
-        -webkit-box-ordinal-group: -15;
-        -webkit-order: -16;
         order: -16
     }
 
     .flex-order-xl--15 {
-        -webkit-box-ordinal-group: -14;
-        -webkit-order: -15;
         order: -15
     }
 
     .flex-order-xl--14 {
-        -webkit-box-ordinal-group: -13;
-        -webkit-order: -14;
         order: -14
     }
 
     .flex-order-xl--13 {
-        -webkit-box-ordinal-group: -12;
-        -webkit-order: -13;
         order: -13
     }
 
     .flex-order-xl--12 {
-        -webkit-box-ordinal-group: -11;
-        -webkit-order: -12;
         order: -12
     }
 
     .flex-order-xl--11 {
-        -webkit-box-ordinal-group: -10;
-        -webkit-order: -11;
         order: -11
     }
 
     .flex-order-xl--10 {
-        -webkit-box-ordinal-group: -9;
-        -webkit-order: -10;
         order: -10
     }
 
     .flex-order-xl--9 {
-        -webkit-box-ordinal-group: -8;
-        -webkit-order: -9;
         order: -9
     }
 
     .flex-order-xl--8 {
-        -webkit-box-ordinal-group: -7;
-        -webkit-order: -8;
         order: -8
     }
 
     .flex-order-xl--7 {
-        -webkit-box-ordinal-group: -6;
-        -webkit-order: -7;
         order: -7
     }
 
     .flex-order-xl--6 {
-        -webkit-box-ordinal-group: -5;
-        -webkit-order: -6;
         order: -6
     }
 
     .flex-order-xl--5 {
-        -webkit-box-ordinal-group: -4;
-        -webkit-order: -5;
         order: -5
     }
 
     .flex-order-xl--4 {
-        -webkit-box-ordinal-group: -3;
-        -webkit-order: -4;
         order: -4
     }
 
     .flex-order-xl--3 {
-        -webkit-box-ordinal-group: -2;
-        -webkit-order: -3;
         order: -3
     }
 
     .flex-order-xl--2 {
-        -webkit-box-ordinal-group: -1;
-        -webkit-order: -2;
         order: -2
     }
 
     .flex-order-xl--1 {
-        -webkit-box-ordinal-group: 0;
-        -webkit-order: -1;
         order: -1
     }
 
     .flex-order-xl-0 {
-        -webkit-box-ordinal-group: 1;
-        -webkit-order: 0;
         order: 0
     }
 
     .flex-order-xl-1 {
-        -webkit-box-ordinal-group: 2;
-        -webkit-order: 1;
         order: 1
     }
 
     .flex-order-xl-2 {
-        -webkit-box-ordinal-group: 3;
-        -webkit-order: 2;
         order: 2
     }
 
     .flex-order-xl-3 {
-        -webkit-box-ordinal-group: 4;
-        -webkit-order: 3;
         order: 3
     }
 
     .flex-order-xl-4 {
-        -webkit-box-ordinal-group: 5;
-        -webkit-order: 4;
         order: 4
     }
 
     .flex-order-xl-5 {
-        -webkit-box-ordinal-group: 6;
-        -webkit-order: 5;
         order: 5
     }
 
     .flex-order-xl-6 {
-        -webkit-box-ordinal-group: 7;
-        -webkit-order: 6;
         order: 6
     }
 
     .flex-order-xl-7 {
-        -webkit-box-ordinal-group: 8;
-        -webkit-order: 7;
         order: 7
     }
 
     .flex-order-xl-8 {
-        -webkit-box-ordinal-group: 9;
-        -webkit-order: 8;
         order: 8
     }
 
     .flex-order-xl-9 {
-        -webkit-box-ordinal-group: 10;
-        -webkit-order: 9;
         order: 9
     }
 
     .flex-order-xl-10 {
-        -webkit-box-ordinal-group: 11;
-        -webkit-order: 10;
         order: 10
     }
 
     .flex-order-xl-11 {
-        -webkit-box-ordinal-group: 12;
-        -webkit-order: 11;
         order: 11
     }
 
     .flex-order-xl-12 {
-        -webkit-box-ordinal-group: 13;
-        -webkit-order: 12;
         order: 12
     }
 
     .flex-order-xl-13 {
-        -webkit-box-ordinal-group: 14;
-        -webkit-order: 13;
         order: 13
     }
 
     .flex-order-xl-14 {
-        -webkit-box-ordinal-group: 15;
-        -webkit-order: 14;
         order: 14
     }
 
     .flex-order-xl-15 {
-        -webkit-box-ordinal-group: 16;
-        -webkit-order: 15;
         order: 15
     }
 
     .flex-order-xl-16 {
-        -webkit-box-ordinal-group: 17;
-        -webkit-order: 16;
         order: 16
     }
 
     .flex-order-xl-17 {
-        -webkit-box-ordinal-group: 18;
-        -webkit-order: 17;
         order: 17
     }
 
     .flex-order-xl-18 {
-        -webkit-box-ordinal-group: 19;
-        -webkit-order: 18;
         order: 18
     }
 
     .flex-order-xl-19 {
-        -webkit-box-ordinal-group: 20;
-        -webkit-order: 19;
         order: 19
     }
 
     .flex-order-xl-20 {
-        -webkit-box-ordinal-group: 21;
-        -webkit-order: 20;
         order: 20
     }
 
@@ -40388,13 +36289,8 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
 
     .layout-align-xl,
     .layout-align-xl-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start;
-        -webkit-align-content: stretch;
         align-content: stretch;
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch
     }
 
@@ -40403,8 +36299,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-start-end,
     .layout-align-xl-start-start,
     .layout-align-xl-start-stretch {
-        -webkit-box-pack: start;
-        -webkit-justify-content: flex-start;
         justify-content: flex-start
     }
 
@@ -40413,8 +36307,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-center-end,
     .layout-align-xl-center-start,
     .layout-align-xl-center-stretch {
-        -webkit-box-pack: center;
-        -webkit-justify-content: center;
         justify-content: center
     }
 
@@ -40423,8 +36315,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-end-end,
     .layout-align-xl-end-start,
     .layout-align-xl-end-stretch {
-        -webkit-box-pack: end;
-        -webkit-justify-content: flex-end;
         justify-content: flex-end
     }
 
@@ -40433,7 +36323,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-space-around-end,
     .layout-align-xl-space-around-start,
     .layout-align-xl-space-around-stretch {
-        -webkit-justify-content: space-around;
         justify-content: space-around
     }
 
@@ -40442,8 +36331,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-space-between-end,
     .layout-align-xl-space-between-start,
     .layout-align-xl-space-between-stretch {
-        -webkit-box-pack: justify;
-        -webkit-justify-content: space-between;
         justify-content: space-between
     }
 
@@ -40452,10 +36339,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-space-around-start,
     .layout-align-xl-space-between-start,
     .layout-align-xl-start-start {
-        -webkit-box-align: start;
-        -webkit-align-items: flex-start;
         align-items: flex-start;
-        -webkit-align-content: flex-start;
         align-content: flex-start
     }
 
@@ -40464,10 +36348,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-space-around-center,
     .layout-align-xl-space-between-center,
     .layout-align-xl-start-center {
-        -webkit-box-align: center;
-        -webkit-align-items: center;
         align-items: center;
-        -webkit-align-content: center;
         align-content: center;
         max-width: 100%
     }
@@ -40486,10 +36367,7 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-space-around-end,
     .layout-align-xl-space-between-end,
     .layout-align-xl-start-end {
-        -webkit-box-align: end;
-        -webkit-align-items: flex-end;
         align-items: flex-end;
-        -webkit-align-content: flex-end;
         align-content: flex-end
     }
 
@@ -40498,65 +36376,46 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-align-xl-space-around-stretch,
     .layout-align-xl-space-between-stretch,
     .layout-align-xl-start-stretch {
-        -webkit-box-align: stretch;
-        -webkit-align-items: stretch;
         align-items: stretch;
-        -webkit-align-content: stretch;
         align-content: stretch
     }
 
     .flex-xl {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1;
         flex: 1;
         box-sizing: border-box
     }
 
     .flex-xl-grow {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         box-sizing: border-box
     }
 
     .flex-xl-initial {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-xl-auto {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 auto;
         flex: 1 1 auto;
         box-sizing: border-box
     }
 
     .flex-xl-none {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 0 auto;
         flex: 0 0 auto;
         box-sizing: border-box
     }
 
     .flex-xl-noshrink {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 0 auto;
         flex: 1 0 auto;
         box-sizing: border-box
     }
 
     .flex-xl-nogrow {
-        -webkit-box-flex: 0;
-        -webkit-flex: 0 1 auto;
         flex: 0 1 auto;
         box-sizing: border-box
     }
 
     .flex-xl-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -40564,8 +36423,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -40574,8 +36431,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -40583,8 +36438,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 0%;
         max-height: 100%;
@@ -40593,8 +36446,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-0 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 0%;
@@ -40603,8 +36454,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -40612,8 +36461,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -40621,8 +36468,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -40630,8 +36475,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 5%;
         max-height: 100%;
@@ -40639,8 +36482,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-5 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 5%;
@@ -40648,8 +36489,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -40657,8 +36496,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -40666,8 +36503,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -40675,8 +36510,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 10%;
         max-height: 100%;
@@ -40684,8 +36517,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-10 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 10%;
@@ -40693,8 +36524,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -40702,8 +36531,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -40711,8 +36538,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -40720,8 +36545,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 15%;
         max-height: 100%;
@@ -40729,8 +36552,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-15 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 15%;
@@ -40738,8 +36559,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -40747,8 +36566,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -40756,8 +36573,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -40765,8 +36580,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 20%;
         max-height: 100%;
@@ -40774,8 +36587,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-20 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 20%;
@@ -40783,8 +36594,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -40792,8 +36601,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -40801,8 +36608,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -40810,8 +36615,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 25%;
         max-height: 100%;
@@ -40819,8 +36622,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-25 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 25%;
@@ -40828,8 +36629,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -40837,8 +36636,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -40846,8 +36643,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -40855,8 +36650,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 30%;
         max-height: 100%;
@@ -40864,8 +36657,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-30 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 30%;
@@ -40873,8 +36664,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -40882,8 +36671,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -40891,8 +36678,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -40900,8 +36685,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 35%;
         max-height: 100%;
@@ -40909,8 +36692,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-35 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 35%;
@@ -40918,8 +36699,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -40927,8 +36706,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -40936,8 +36713,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -40945,8 +36720,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 40%;
         max-height: 100%;
@@ -40954,8 +36727,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-40 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 40%;
@@ -40963,8 +36734,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -40972,8 +36741,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -40981,8 +36748,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -40990,8 +36755,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 45%;
         max-height: 100%;
@@ -40999,8 +36762,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-45 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 45%;
@@ -41008,8 +36769,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -41017,8 +36776,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -41026,8 +36783,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -41035,8 +36790,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 50%;
         max-height: 100%;
@@ -41044,8 +36797,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-50 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 50%;
@@ -41053,8 +36804,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -41062,8 +36811,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -41071,8 +36818,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -41080,8 +36825,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 55%;
         max-height: 100%;
@@ -41089,8 +36832,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-55 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 55%;
@@ -41098,8 +36839,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -41107,8 +36846,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -41116,8 +36853,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -41125,8 +36860,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 60%;
         max-height: 100%;
@@ -41134,8 +36867,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-60 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 60%;
@@ -41143,8 +36874,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -41152,8 +36881,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -41161,8 +36888,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -41170,8 +36895,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 65%;
         max-height: 100%;
@@ -41179,8 +36902,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-65 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 65%;
@@ -41188,8 +36909,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -41197,8 +36916,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -41206,8 +36923,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -41215,8 +36930,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 70%;
         max-height: 100%;
@@ -41224,8 +36937,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-70 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 70%;
@@ -41233,8 +36944,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -41242,8 +36951,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -41251,8 +36958,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -41260,8 +36965,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 75%;
         max-height: 100%;
@@ -41269,8 +36972,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-75 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 75%;
@@ -41278,8 +36979,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -41287,8 +36986,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -41296,8 +36993,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -41305,8 +37000,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 80%;
         max-height: 100%;
@@ -41314,8 +37007,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-80 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 80%;
@@ -41323,8 +37014,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -41332,8 +37021,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -41341,8 +37028,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -41350,8 +37035,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 85%;
         max-height: 100%;
@@ -41359,8 +37042,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-85 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 85%;
@@ -41368,8 +37049,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -41377,8 +37056,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -41386,8 +37063,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -41395,8 +37070,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 90%;
         max-height: 100%;
@@ -41404,8 +37077,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-90 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 90%;
@@ -41413,8 +37084,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -41422,8 +37091,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -41431,8 +37098,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -41440,8 +37105,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 95%;
         max-height: 100%;
@@ -41449,8 +37112,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-95 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 95%;
@@ -41458,8 +37119,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .flex-xl-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -41467,8 +37126,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -41476,8 +37133,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -41485,8 +37140,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -41494,8 +37147,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-100 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 100%;
@@ -41503,8 +37154,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 33.33%;
         max-height: 100%;
@@ -41512,8 +37161,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-row>.flex-xl-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 66.66%;
         max-height: 100%;
@@ -41521,8 +37168,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 33.33%;
         flex: 1 1 33.33%;
         max-width: 100%;
         max-height: 33.33%;
@@ -41530,8 +37175,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-column>.flex-xl-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 66.66%;
         flex: 1 1 66.66%;
         max-width: 100%;
         max-height: 66.66%;
@@ -41539,8 +37182,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 33.33%;
         max-height: 100%;
@@ -41548,8 +37189,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-row>.flex-xl-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 66.66%;
         max-height: 100%;
@@ -41561,8 +37200,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-33 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 33.33%;
@@ -41570,8 +37207,6 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     }
 
     .layout-xl-column>.flex-xl-66 {
-        -webkit-box-flex: 1;
-        -webkit-flex: 1 1 100%;
         flex: 1 1 100%;
         max-width: 100%;
         max-height: 66.66%;
@@ -41586,22 +37221,14 @@ md-toolbar~md-content>md-list md-list-item:last-child md-divider {
     .layout-xl-column,
     .layout-xl-row {
         box-sizing: border-box;
-        display: -webkit-box;
-        display: -webkit-flex;
         display: flex
     }
 
     .layout-xl-column {
-        -webkit-box-orient: vertical;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: column;
         flex-direction: column
     }
 
     .layout-xl-row {
-        -webkit-box-orient: horizontal;
-        -webkit-box-direction: normal;
-        -webkit-flex-direction: row;
         flex-direction: row
     }
 
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge